added enabled
Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
This commit is contained in:
parent
ea3ee2adda
commit
1f74c88ce6
@ -40,6 +40,7 @@ import VDS
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
surface = viewModel.surface
|
surface = viewModel.surface
|
||||||
|
isEnabled = viewModel.enabled
|
||||||
alignment = viewModel.alignment
|
alignment = viewModel.alignment
|
||||||
rowQuantityPhone = viewModel.rowQuantityPhone
|
rowQuantityPhone = viewModel.rowQuantityPhone
|
||||||
rowQuantityTablet = viewModel.rowQuantityTablet
|
rowQuantityTablet = viewModel.rowQuantityTablet
|
||||||
|
|||||||
@ -28,7 +28,7 @@ public class ButtonGroupModel: MoleculeModelProtocol {
|
|||||||
public var childWidthValue: CGFloat?
|
public var childWidthValue: CGFloat?
|
||||||
public var childWidthPercentage: CGFloat?
|
public var childWidthPercentage: CGFloat?
|
||||||
public var surface: VDS.Surface = .light
|
public var surface: VDS.Surface = .light
|
||||||
|
public var enabled: Bool = true
|
||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
// MARK: - Keys
|
// MARK: - Keys
|
||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
@ -44,6 +44,7 @@ public class ButtonGroupModel: MoleculeModelProtocol {
|
|||||||
case childWidthValue
|
case childWidthValue
|
||||||
case childWidthPercentage
|
case childWidthPercentage
|
||||||
case surface
|
case surface
|
||||||
|
case enabled
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
@ -54,6 +55,7 @@ public class ButtonGroupModel: MoleculeModelProtocol {
|
|||||||
let typeContainer = try decoder.container(keyedBy: CodingKeys.self)
|
let typeContainer = try decoder.container(keyedBy: CodingKeys.self)
|
||||||
id = try typeContainer.decodeIfPresent(String.self, forKey: .id) ?? UUID().uuidString
|
id = try typeContainer.decodeIfPresent(String.self, forKey: .id) ?? UUID().uuidString
|
||||||
surface = try typeContainer.decodeIfPresent(Surface.self, forKey: .surface) ?? .light
|
surface = try typeContainer.decodeIfPresent(Surface.self, forKey: .surface) ?? .light
|
||||||
|
enabled = try typeContainer.decodeIfPresent(Bool.self, forKey: .enabled) ?? true
|
||||||
buttons = try typeContainer.decodeModels(codingKey: .buttons)
|
buttons = try typeContainer.decodeModels(codingKey: .buttons)
|
||||||
alignment = try typeContainer.decodeIfPresent(VDS.ButtonGroup.Alignment.self, forKey: .alignment) ?? .center
|
alignment = try typeContainer.decodeIfPresent(VDS.ButtonGroup.Alignment.self, forKey: .alignment) ?? .center
|
||||||
rowQuantityPhone = try typeContainer.decodeIfPresent(Int.self, forKey: .rowQuantityPhone) ?? 0
|
rowQuantityPhone = try typeContainer.decodeIfPresent(Int.self, forKey: .rowQuantityPhone) ?? 0
|
||||||
@ -66,6 +68,8 @@ public class ButtonGroupModel: MoleculeModelProtocol {
|
|||||||
var container = encoder.container(keyedBy: CodingKeys.self)
|
var container = encoder.container(keyedBy: CodingKeys.self)
|
||||||
try container.encode(id, forKey: .id)
|
try container.encode(id, forKey: .id)
|
||||||
try container.encode(moleculeName, forKey: .moleculeName)
|
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.encodeModels(buttons, forKey: .buttons)
|
||||||
try container.encode(alignment, forKey: .alignment)
|
try container.encode(alignment, forKey: .alignment)
|
||||||
try container.encode(rowQuantityPhone, forKey: .rowQuantityPhone)
|
try container.encode(rowQuantityPhone, forKey: .rowQuantityPhone)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user