diff --git a/MVMCoreUI/Atomic/Molecules/HorizontalCombinationViews/RadioButtonLabelModel.swift b/MVMCoreUI/Atomic/Molecules/HorizontalCombinationViews/RadioButtonLabelModel.swift index 0f4a4be6..294dd14b 100644 --- a/MVMCoreUI/Atomic/Molecules/HorizontalCombinationViews/RadioButtonLabelModel.swift +++ b/MVMCoreUI/Atomic/Molecules/HorizontalCombinationViews/RadioButtonLabelModel.swift @@ -40,5 +40,27 @@ import VDS self.label = label 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 + }) + } }