refactored to convertTo
Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
This commit is contained in:
parent
3fd10bf199
commit
b71a4c5b25
@ -40,5 +40,27 @@ import VDS
|
|||||||
self.label = label
|
self.label = label
|
||||||
self.subTitle = subTitle
|
self.subTitle = subTitle
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
extension Array where Element == RadioButtonLabelModel {
|
||||||
|
internal func convertToVDSRadioButtonItemModel(surface: Surface,
|
||||||
|
delegateObject: MVMCoreUIDelegateObject?,
|
||||||
|
additionalData: [AnyHashable: Any]?) -> [RadioButtonGroup.RadioButtonItemModel] {
|
||||||
|
return compactMap({ model in
|
||||||
|
var item = RadioButtonGroup.RadioButtonItemModel()
|
||||||
|
item.inputId = model.radioButton.fieldKey
|
||||||
|
item.labelText = model.label.text
|
||||||
|
if let attributes = model.label.attributes?.toVDSLabelAttributeModel(delegateObject: delegateObject, additionalData: additionalData) {
|
||||||
|
item.labelTextAttributes = attributes
|
||||||
|
}
|
||||||
|
item.childText = model.subTitle?.text
|
||||||
|
if let attributes = model.subTitle?.attributes?.toVDSLabelAttributeModel(delegateObject: delegateObject, additionalData: additionalData) {
|
||||||
|
item.childTextAttributes = attributes
|
||||||
|
}
|
||||||
|
item.surface = surface
|
||||||
|
item.selected = model.radioButton.state
|
||||||
|
item.disabled = !(model.radioButton.enabled && !model.radioButton.readOnly)
|
||||||
|
return item
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user