diff --git a/MVMCoreUI/Atomic/Atoms/Buttons/ButtonGroup.swift b/MVMCoreUI/Atomic/Atoms/Buttons/ButtonGroup.swift index 8fe15acb..53c0a476 100644 --- a/MVMCoreUI/Atomic/Atoms/Buttons/ButtonGroup.swift +++ b/MVMCoreUI/Atomic/Atoms/Buttons/ButtonGroup.swift @@ -40,6 +40,7 @@ import VDS } } surface = viewModel.surface + isEnabled = viewModel.enabled alignment = viewModel.alignment rowQuantityPhone = viewModel.rowQuantityPhone rowQuantityTablet = viewModel.rowQuantityTablet diff --git a/MVMCoreUI/Atomic/Atoms/Buttons/ButtonGroupModel.swift b/MVMCoreUI/Atomic/Atoms/Buttons/ButtonGroupModel.swift index 0ee3b68e..4921d0f0 100644 --- a/MVMCoreUI/Atomic/Atoms/Buttons/ButtonGroupModel.swift +++ b/MVMCoreUI/Atomic/Atoms/Buttons/ButtonGroupModel.swift @@ -28,7 +28,7 @@ public class ButtonGroupModel: MoleculeModelProtocol { public var childWidthValue: CGFloat? public var childWidthPercentage: CGFloat? public var surface: VDS.Surface = .light - + public var enabled: Bool = true //-------------------------------------------------- // MARK: - Keys //-------------------------------------------------- @@ -44,6 +44,7 @@ public class ButtonGroupModel: MoleculeModelProtocol { case childWidthValue case childWidthPercentage case surface + case enabled } //-------------------------------------------------- @@ -54,6 +55,7 @@ public class ButtonGroupModel: MoleculeModelProtocol { let typeContainer = try decoder.container(keyedBy: CodingKeys.self) id = try typeContainer.decodeIfPresent(String.self, forKey: .id) ?? UUID().uuidString surface = try typeContainer.decodeIfPresent(Surface.self, forKey: .surface) ?? .light + enabled = try typeContainer.decodeIfPresent(Bool.self, forKey: .enabled) ?? true buttons = try typeContainer.decodeModels(codingKey: .buttons) alignment = try typeContainer.decodeIfPresent(VDS.ButtonGroup.Alignment.self, forKey: .alignment) ?? .center rowQuantityPhone = try typeContainer.decodeIfPresent(Int.self, forKey: .rowQuantityPhone) ?? 0 @@ -66,6 +68,8 @@ public class ButtonGroupModel: MoleculeModelProtocol { var container = encoder.container(keyedBy: CodingKeys.self) try container.encode(id, forKey: .id) try container.encode(moleculeName, forKey: .moleculeName) + try container.encode(surface, forKey: .surface) + try container.encode(enabled, forKey: .enabled) try container.encodeModels(buttons, forKey: .buttons) try container.encode(alignment, forKey: .alignment) try container.encode(rowQuantityPhone, forKey: .rowQuantityPhone)