updated helper text placement

Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
This commit is contained in:
Matt Bruce 2024-07-11 12:47:31 -05:00
parent d76d7c0974
commit 4c28312191
2 changed files with 7 additions and 1 deletions

View File

@ -93,6 +93,8 @@ open class ItemDropdownEntryField: VDS.DropdownSelect, VDSMoleculeViewProtocol,
//-------------------------------------------------- //--------------------------------------------------
open override func setup() { open override func setup() {
super.setup() super.setup()
useRequiredRule = false
publisher(for: .valueChanged) publisher(for: .valueChanged)
.sink { [weak self] control in .sink { [weak self] control in
guard let self, let selectedItem else { return } guard let self, let selectedItem else { return }
@ -124,12 +126,13 @@ open class ItemDropdownEntryField: VDS.DropdownSelect, VDSMoleculeViewProtocol,
public func viewModelDidUpdate() { public func viewModelDidUpdate() {
pickerData = viewModel.options pickerData = viewModel.options
showInlineLabel = viewModel.showInlineLabel
helperTextPlacement = viewModel.feedbackTextPlacement
labelText = viewModel.title labelText = viewModel.title
helperText = viewModel.feedback helperText = viewModel.feedback
isEnabled = viewModel.enabled isEnabled = viewModel.enabled
isReadOnly = viewModel.readOnly isReadOnly = viewModel.readOnly
isRequired = viewModel.required isRequired = viewModel.required
showInlineLabel = viewModel.showInlineLabel
tooltipModel = viewModel.tooltip?.toVDSTooltipModel() tooltipModel = viewModel.tooltip?.toVDSTooltipModel()
width = viewModel.width width = viewModel.width
transparentBackground = viewModel.transparentBackground transparentBackground = viewModel.transparentBackground

View File

@ -50,6 +50,7 @@ import VDS
case selectedIndex case selectedIndex
case action case action
case showInlineLabel case showInlineLabel
case feedbackTextPlacement
case tooltip case tooltip
case transparentBackground case transparentBackground
case width case width
@ -70,6 +71,7 @@ import VDS
baseValue = options.indices.contains(selectedIndex) ? options[selectedIndex] : nil baseValue = options.indices.contains(selectedIndex) ? options[selectedIndex] : nil
} }
showInlineLabel = try typeContainer.decodeIfPresent(Bool.self, forKey: .showInlineLabel) ?? false 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) action = try typeContainer.decodeModelIfPresent(codingKey: .action)
tooltip = try typeContainer.decodeIfPresent(TooltipModel.self, forKey: .tooltip) tooltip = try typeContainer.decodeIfPresent(TooltipModel.self, forKey: .tooltip)
transparentBackground = try typeContainer.decodeIfPresent(Bool.self, forKey: .transparentBackground) ?? false transparentBackground = try typeContainer.decodeIfPresent(Bool.self, forKey: .transparentBackground) ?? false
@ -82,6 +84,7 @@ import VDS
try container.encode(options, forKey: .options) try container.encode(options, forKey: .options)
try container.encodeIfPresent(selectedIndex, forKey: .selectedIndex) try container.encodeIfPresent(selectedIndex, forKey: .selectedIndex)
try container.encode(showInlineLabel, forKey: .showInlineLabel) try container.encode(showInlineLabel, forKey: .showInlineLabel)
try container.encode(feedbackTextPlacement, forKey: .feedbackTextPlacement)
try container.encodeModelIfPresent(action, forKey: .action) try container.encodeModelIfPresent(action, forKey: .action)
try container.encodeIfPresent(tooltip, forKey: .tooltip) try container.encodeIfPresent(tooltip, forKey: .tooltip)
try container.encode(transparentBackground, forKey: .transparentBackground) try container.encode(transparentBackground, forKey: .transparentBackground)