refactored more for the naming
Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
This commit is contained in:
parent
0af79c97b7
commit
a7d777a97d
@ -263,7 +263,7 @@ open class DropdownSelect: EntryFieldBase {
|
||||
//set the helper label position
|
||||
if helperText != nil {
|
||||
if helperTextPlacement == .right {
|
||||
middleStackView.spacing = 12
|
||||
middleStackView.spacing = VDSLayout.space3X
|
||||
middleStackView.distribution = .fillEqually
|
||||
middleStackView.addArrangedSubview(helperLabel)
|
||||
} else {
|
||||
|
||||
@ -40,19 +40,6 @@ open class EntryFieldBase: Control, Changeable, FormFieldInternalValidatable {
|
||||
//--------------------------------------------------
|
||||
// MARK: - Private Properties
|
||||
//--------------------------------------------------
|
||||
///This is the stackView that is the first subView of the EntryFieldBase, that will
|
||||
///layout the following hierarchy
|
||||
///
|
||||
///- primaryStackView (vertical)
|
||||
///---- titleLabel
|
||||
///---- containerView (has the border for the user to interact with.
|
||||
///------ containerHorizontal
|
||||
///--------- fieldContainerView (subclass implements, ie UITextField, UITextView, etc...)
|
||||
///--------- statusIcon (error, succes, or overridden by dev)
|
||||
///---- UIView (getBottomContainer)
|
||||
///------ bottomContainerStackView (vertical)
|
||||
///------- errorLabel
|
||||
///--------helpLabel
|
||||
internal var stackView: UIStackView = {
|
||||
return UIStackView().with {
|
||||
$0.translatesAutoresizingMaskIntoConstraints = false
|
||||
@ -91,6 +78,7 @@ open class EntryFieldBase: Control, Changeable, FormFieldInternalValidatable {
|
||||
$0.translatesAutoresizingMaskIntoConstraints = false
|
||||
$0.axis = .vertical
|
||||
$0.distribution = .fill
|
||||
$0.spacing = VDSLayout.space2X
|
||||
}
|
||||
}()
|
||||
|
||||
@ -229,9 +217,18 @@ open class EntryFieldBase: Control, Changeable, FormFieldInternalValidatable {
|
||||
widthConstraint = containerView.widthAnchor.constraint(equalToConstant: 0)
|
||||
widthConstraint?.priority = .defaultHigh
|
||||
|
||||
let leftStackView = UIStackView().with {
|
||||
$0.translatesAutoresizingMaskIntoConstraints = false
|
||||
$0.axis = .vertical
|
||||
$0.distribution = .fill
|
||||
$0.alignment = .leading
|
||||
}
|
||||
leftStackView.addArrangedSubview(containerView)
|
||||
leftStackView.setCustomSpacing(8, after: containerView)
|
||||
|
||||
//add the containerView to the middleStack
|
||||
middleStackView.addArrangedSubview(containerView)
|
||||
|
||||
middleStackView.addArrangedSubview(leftStackView)
|
||||
|
||||
//add ContainerStackView
|
||||
//this is the horizontal stack that contains
|
||||
//the left, InputContainer, Icons, Buttons
|
||||
@ -249,18 +246,16 @@ open class EntryFieldBase: Control, Changeable, FormFieldInternalValidatable {
|
||||
//get the container this is what show helper text, error text
|
||||
//can include other for character count, max length
|
||||
let bottomContainer = getBottomContainer()
|
||||
|
||||
|
||||
//this is the vertical stack that contains error text, helper text
|
||||
bottomContainerStackView.addArrangedSubview(errorLabel)
|
||||
bottomContainerStackView.addArrangedSubview(helperLabel)
|
||||
|
||||
stackView.addArrangedSubview(titleLabel)
|
||||
stackView.addArrangedSubview(middleStackView)
|
||||
stackView.addArrangedSubview(bottomContainer)
|
||||
leftStackView.addArrangedSubview(bottomContainer)
|
||||
|
||||
stackView.setCustomSpacing(4, after: titleLabel)
|
||||
stackView.setCustomSpacing(8, after: middleStackView)
|
||||
stackView.setCustomSpacing(8, after: bottomContainer)
|
||||
|
||||
stackView
|
||||
.pinTop()
|
||||
|
||||
@ -270,7 +270,7 @@ open class InputField: EntryFieldBase {
|
||||
//set the helper label position
|
||||
if helperText != nil {
|
||||
if helperTextPlacement == .right {
|
||||
middleStackView.spacing = 12
|
||||
middleStackView.spacing = VDSLayout.space3X
|
||||
middleStackView.distribution = .fillEqually
|
||||
middleStackView.addArrangedSubview(helperLabel)
|
||||
} else {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user