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() {
|
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
|
||||||
|
|||||||
@ -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)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user