added more properties
Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
This commit is contained in:
parent
b1c59124a7
commit
be5a691365
@ -129,7 +129,10 @@ open class ItemDropdownEntryField: VDS.DropdownSelect, VDSMoleculeViewProtocol,
|
|||||||
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
|
||||||
|
transparentBackground = viewModel.transparentBackground
|
||||||
|
|
||||||
if let index = viewModel.selectedIndex {
|
if let index = viewModel.selectedIndex {
|
||||||
selectId = index
|
selectId = index
|
||||||
|
|||||||
@ -16,7 +16,11 @@ import VDS
|
|||||||
public var action: ActionModelProtocol?
|
public var action: ActionModelProtocol?
|
||||||
public var options: [String] = []
|
public var options: [String] = []
|
||||||
public var selectedIndex: Int?
|
public var selectedIndex: Int?
|
||||||
|
public var showInlineLabel: Bool = false
|
||||||
|
public var feedbackTextPlacement: VDS.EntryFieldBase.HelperTextPlacement = .bottom
|
||||||
public var tooltip: TooltipModel?
|
public var tooltip: TooltipModel?
|
||||||
|
public var transparentBackground: Bool = false
|
||||||
|
public var width: CGFloat?
|
||||||
|
|
||||||
public init(with options: [String], selectedIndex: Int? = nil) {
|
public init(with options: [String], selectedIndex: Int? = nil) {
|
||||||
self.options = options
|
self.options = options
|
||||||
@ -45,7 +49,10 @@ import VDS
|
|||||||
case options
|
case options
|
||||||
case selectedIndex
|
case selectedIndex
|
||||||
case action
|
case action
|
||||||
|
case showInlineLabel
|
||||||
case tooltip
|
case tooltip
|
||||||
|
case transparentBackground
|
||||||
|
case width
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
@ -62,8 +69,11 @@ import VDS
|
|||||||
self.selectedIndex = selectedIndex
|
self.selectedIndex = selectedIndex
|
||||||
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
|
||||||
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
|
||||||
|
width = try typeContainer.decodeIfPresent(CGFloat.self, forKey: .width)
|
||||||
}
|
}
|
||||||
|
|
||||||
public override func encode(to encoder: Encoder) throws {
|
public override func encode(to encoder: Encoder) throws {
|
||||||
@ -71,7 +81,10 @@ import VDS
|
|||||||
var container = encoder.container(keyedBy: CodingKeys.self)
|
var container = encoder.container(keyedBy: CodingKeys.self)
|
||||||
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.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.encodeIfPresent(width, forKey: .width)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user