added enabled

Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
This commit is contained in:
Matt Bruce 2024-01-11 12:07:42 -06:00
parent ea3ee2adda
commit 1f74c88ce6
2 changed files with 6 additions and 1 deletions

View File

@ -40,6 +40,7 @@ import VDS
}
}
surface = viewModel.surface
isEnabled = viewModel.enabled
alignment = viewModel.alignment
rowQuantityPhone = viewModel.rowQuantityPhone
rowQuantityTablet = viewModel.rowQuantityTablet

View File

@ -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)