updated helper text placement
Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
This commit is contained in:
parent
d76d7c0974
commit
4c28312191
@ -93,6 +93,8 @@ open class ItemDropdownEntryField: VDS.DropdownSelect, VDSMoleculeViewProtocol,
|
||||
//--------------------------------------------------
|
||||
open override func setup() {
|
||||
super.setup()
|
||||
useRequiredRule = false
|
||||
|
||||
publisher(for: .valueChanged)
|
||||
.sink { [weak self] control in
|
||||
guard let self, let selectedItem else { return }
|
||||
@ -124,12 +126,13 @@ open class ItemDropdownEntryField: VDS.DropdownSelect, VDSMoleculeViewProtocol,
|
||||
|
||||
public func viewModelDidUpdate() {
|
||||
pickerData = viewModel.options
|
||||
showInlineLabel = viewModel.showInlineLabel
|
||||
helperTextPlacement = viewModel.feedbackTextPlacement
|
||||
labelText = viewModel.title
|
||||
helperText = viewModel.feedback
|
||||
isEnabled = viewModel.enabled
|
||||
isReadOnly = viewModel.readOnly
|
||||
isRequired = viewModel.required
|
||||
showInlineLabel = viewModel.showInlineLabel
|
||||
tooltipModel = viewModel.tooltip?.toVDSTooltipModel()
|
||||
width = viewModel.width
|
||||
transparentBackground = viewModel.transparentBackground
|
||||
|
||||
@ -50,6 +50,7 @@ import VDS
|
||||
case selectedIndex
|
||||
case action
|
||||
case showInlineLabel
|
||||
case feedbackTextPlacement
|
||||
case tooltip
|
||||
case transparentBackground
|
||||
case width
|
||||
@ -70,6 +71,7 @@ import VDS
|
||||
baseValue = options.indices.contains(selectedIndex) ? options[selectedIndex] : nil
|
||||
}
|
||||
showInlineLabel = try typeContainer.decodeIfPresent(Bool.self, forKey: .showInlineLabel) ?? false
|
||||
feedbackTextPlacement = try typeContainer.decodeIfPresent(VDS.EntryFieldBase.HelperTextPlacement.self, forKey: .feedbackTextPlacement) ?? .bottom
|
||||
action = try typeContainer.decodeModelIfPresent(codingKey: .action)
|
||||
tooltip = try typeContainer.decodeIfPresent(TooltipModel.self, forKey: .tooltip)
|
||||
transparentBackground = try typeContainer.decodeIfPresent(Bool.self, forKey: .transparentBackground) ?? false
|
||||
@ -82,6 +84,7 @@ import VDS
|
||||
try container.encode(options, forKey: .options)
|
||||
try container.encodeIfPresent(selectedIndex, forKey: .selectedIndex)
|
||||
try container.encode(showInlineLabel, forKey: .showInlineLabel)
|
||||
try container.encode(feedbackTextPlacement, forKey: .feedbackTextPlacement)
|
||||
try container.encodeModelIfPresent(action, forKey: .action)
|
||||
try container.encodeIfPresent(tooltip, forKey: .tooltip)
|
||||
try container.encode(transparentBackground, forKey: .transparentBackground)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user