Merge branch 'develop' into mbruce/bugfix
# Conflicts: # VDS/SupportingFiles/ReleaseNotes.txt Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
This commit is contained in:
commit
cb704ea1e9
@ -67,15 +67,20 @@ open class CalendarBase: Control, Changeable {
|
||||
//--------------------------------------------------
|
||||
// MARK: - Private Properties
|
||||
//--------------------------------------------------
|
||||
internal var containerSize: CGSize { CGSize(width: 328, height: 336) }
|
||||
internal var containerSize: CGSize { CGSize(width: widthDefault, height: 336) }
|
||||
internal var calendar = Calendar.current
|
||||
|
||||
private let cellItemSize = CGSize(width: 40, height: 40)
|
||||
private let headerHeight = 88.0
|
||||
private let footerHeight = 40.0
|
||||
private let calendarWidth = 304.0
|
||||
private let screenThreeSixty = 360.0
|
||||
private let widthDefault = 328.0
|
||||
private let widthTight = 320.0
|
||||
|
||||
private var heightConstraint: NSLayoutConstraint?
|
||||
private var collectionViewLeadingConstraint: NSLayoutConstraint?
|
||||
private var collectionViewHeightConstraint: NSLayoutConstraint?
|
||||
private var containerWidthConstraint: NSLayoutConstraint?
|
||||
private var containerHeightConstraint: NSLayoutConstraint?
|
||||
private var selectedIndexPath : IndexPath?
|
||||
private var dates: [Date] = []
|
||||
@ -115,7 +120,7 @@ open class CalendarBase: Control, Changeable {
|
||||
//--------------------------------------------------
|
||||
internal var containerBorderColorConfiguration = SurfaceColorConfiguration(VDSColor.elementsPrimaryOnlight , VDSColor.elementsPrimaryOndark)
|
||||
internal var backgroundColorConfiguration = SurfaceColorConfiguration(VDSFormControlsColor.backgroundOnlight, VDSFormControlsColor.backgroundOndark)
|
||||
|
||||
|
||||
//--------------------------------------------------
|
||||
// MARK: - Overrides
|
||||
//--------------------------------------------------
|
||||
@ -133,21 +138,16 @@ open class CalendarBase: Control, Changeable {
|
||||
.pinTop()
|
||||
.pinBottom()
|
||||
.pinLeadingGreaterThanOrEqualTo()
|
||||
.pinTrailingLessThanOrEqualTo()
|
||||
.width(containerSize.width)
|
||||
.heightGreaterThanEqualTo(containerSize.height)
|
||||
containerView.centerXAnchor.constraint(equalTo: centerXAnchor).activate()
|
||||
|
||||
// Calendar View
|
||||
containerView.addSubview(collectionView)
|
||||
let calendarHeight = containerSize.height - (2 * VDSLayout.space4X)
|
||||
let spacing = (containerSize.width - calendarWidth) / 2
|
||||
|
||||
collectionView
|
||||
.pinTop(VDSLayout.space4X)
|
||||
.pinBottom(VDSLayout.space4X)
|
||||
.pinLeading(spacing)
|
||||
.pinTrailing(spacing)
|
||||
.width(calendarWidth)
|
||||
.heightGreaterThanEqualTo(calendarHeight)
|
||||
|
||||
@ -163,16 +163,14 @@ open class CalendarBase: Control, Changeable {
|
||||
displayDate = fallsBetween ? displayDate : minDate
|
||||
fetchDates(with: displayDate)
|
||||
}
|
||||
|
||||
containerView.layer.backgroundColor = backgroundColorConfiguration.getColor(self).cgColor
|
||||
containerView.backgroundColor = transparentBackground ? .clear : backgroundColorConfiguration.getColor(self)
|
||||
containerView.layer.cornerRadius = VDSFormControls.borderRadius
|
||||
if hideContainerBorder {
|
||||
containerView.layer.borderColor = nil
|
||||
containerView.layer.borderWidth = 0
|
||||
containerView.layer.cornerRadius = 0
|
||||
} else {
|
||||
containerView.layer.borderColor = containerBorderColorConfiguration.getColor(self).cgColor
|
||||
containerView.layer.borderWidth = VDSFormControls.borderWidth
|
||||
containerView.layer.cornerRadius = VDSFormControls.borderRadius
|
||||
}
|
||||
}
|
||||
|
||||
@ -191,8 +189,6 @@ open class CalendarBase: Control, Changeable {
|
||||
// MARK: - Private Methods
|
||||
//--------------------------------------------------
|
||||
func fetchDates(with aDate: Date) {
|
||||
heightConstraint?.isActive = false
|
||||
containerHeightConstraint?.isActive = false
|
||||
days.removeAll()
|
||||
dates = aDate.calendarDisplayDays
|
||||
|
||||
@ -204,17 +200,35 @@ open class CalendarBase: Control, Changeable {
|
||||
days.append(date.getDay())
|
||||
}
|
||||
}
|
||||
|
||||
updateViewConstraints()
|
||||
}
|
||||
|
||||
func updateViewConstraints() {
|
||||
collectionView.reloadData()
|
||||
|
||||
// container width && collection view leading
|
||||
collectionViewLeadingConstraint?.isActive = false
|
||||
containerWidthConstraint?.isActive = false
|
||||
var width = containerView.frame.size.width
|
||||
width = ((width > 0) && (width < screenThreeSixty)) ? ((width > widthTight) && (width < screenThreeSixty)) ? widthTight : containerView.frame.size.width : widthDefault
|
||||
let spacing = (width - calendarWidth) / 2
|
||||
collectionViewLeadingConstraint = collectionView.leadingAnchor.constraint(equalTo: containerView.leadingAnchor, constant: spacing)
|
||||
containerWidthConstraint = containerView.widthAnchor.constraint(equalToConstant: calendarWidth + ( 2 * spacing))
|
||||
collectionViewLeadingConstraint?.isActive = true
|
||||
containerWidthConstraint?.isActive = true
|
||||
|
||||
|
||||
// container height && collection view height
|
||||
collectionViewHeightConstraint?.isActive = false
|
||||
containerHeightConstraint?.isActive = false
|
||||
var height = collectionView.collectionViewLayout.collectionViewContentSize.height
|
||||
height = height > 0 ? height : containerSize.height
|
||||
heightConstraint = collectionView.heightAnchor.constraint(equalToConstant: height)
|
||||
containerHeightConstraint = containerView.heightAnchor.constraint(equalToConstant: height + (2 * VDSLayout.space4X))
|
||||
heightConstraint?.isActive = true
|
||||
collectionViewHeightConstraint = collectionView.heightAnchor.constraint(equalToConstant: height)
|
||||
containerHeightConstraint?.isActive = true
|
||||
collectionViewHeightConstraint?.isActive = true
|
||||
layoutIfNeeded()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
extension CalendarBase: UICollectionViewDelegate, UICollectionViewDataSource, UICollectionViewDelegateFlowLayout {
|
||||
|
||||
@ -8,6 +8,11 @@
|
||||
- CXTDT-560823 – TextArea – Accessibility Labels/Error/ReadyOnly/Disabled
|
||||
- CXTDT-553663 - DropdownSelect – Accessibility
|
||||
- CXTDT-544662 - Breadcrumbs - Text Wrapping
|
||||
- CXTDT-568398 - Calendar - Saturday missing (on smaller screen size devices)
|
||||
- CXTDT-568402 - Calendar - Extra row (on smaller screen size devices)
|
||||
- CXTDT-568409 - Calendar - Width control missing
|
||||
- CXTDT-568419 - Calendar - When hideContainerBorder=true, corner radius disappears
|
||||
- CXTDT-568413 - Calendar - Missing option for Transparent Background
|
||||
|
||||
1.0.65
|
||||
----------------
|
||||
|
||||
Loading…
Reference in New Issue
Block a user