diff --git a/MVMCoreUI/Molecules/LeftRightViews/ListLeftVariableCheckboxWithRightCaretAllTextAndLinks.swift b/MVMCoreUI/Molecules/LeftRightViews/ListLeftVariableCheckboxWithRightCaretAllTextAndLinks.swift index c1f68e94..c194cc50 100644 --- a/MVMCoreUI/Molecules/LeftRightViews/ListLeftVariableCheckboxWithRightCaretAllTextAndLinks.swift +++ b/MVMCoreUI/Molecules/LeftRightViews/ListLeftVariableCheckboxWithRightCaretAllTextAndLinks.swift @@ -54,11 +54,10 @@ import Foundation eyebrowHeadlineBodyLink.setWithModel(model.eyebrowHeadlineBodyLink, delegateObject, additionalData) // Create a stack model to use for the internal stack and set the alignment of labels - let checkbox = StackItemModel() + let checkbox = StackItemModel(percent: 10) checkbox.horizontalAlignment = .leading - let eyebrowHeadlineBodyLink = StackItemModel() - eyebrowHeadlineBodyLink.horizontalAlignment = .leading - eyebrowHeadlineBodyLink.spacing = 20 + let eyebrowHeadlineBodyLink = StackItemModel(percent: 90) + eyebrowHeadlineBodyLink.horizontalAlignment = .fill let stackModel = StackModel(molecules: [checkbox,eyebrowHeadlineBodyLink]) stackModel.axis = .horizontal stack.model = stackModel diff --git a/MVMCoreUI/Molecules/LeftRightViews/ListLeftVariableCheckboxWithRightCaretAllTextAndLinksModel.swift b/MVMCoreUI/Molecules/LeftRightViews/ListLeftVariableCheckboxWithRightCaretAllTextAndLinksModel.swift index 24979f78..790e8598 100644 --- a/MVMCoreUI/Molecules/LeftRightViews/ListLeftVariableCheckboxWithRightCaretAllTextAndLinksModel.swift +++ b/MVMCoreUI/Molecules/LeftRightViews/ListLeftVariableCheckboxWithRightCaretAllTextAndLinksModel.swift @@ -8,33 +8,12 @@ import Foundation -public class ListLeftVariableCheckboxWithRightCaretAllTextAndLinksModel: ContainerModel, ListItemModelProtocol { +public class ListLeftVariableCheckboxWithRightCaretAllTextAndLinksModel: ListItemModel, MoleculeModelProtocol { - public var line: LineModel? - public var style: String? = "standard" - public var hideArrow: Bool? = false - public var backgroundColor: Color? - public var action: ActionModelProtocol? public static var identifier: String = "listLVCB" public var checkbox: CheckboxModel - public var spacing: CGFloat = 16.0 var eyebrowHeadlineBodyLink: EyebrowHeadlineBodyLinkModel - func setDefaults() { - if useHorizontalMargins == nil { - useHorizontalMargins = true - } - if useVerticalMargins == nil { - useVerticalMargins = true - } - if topMarginPadding == nil { - topMarginPadding = 24 - } - if bottomMarginPadding == nil { - bottomMarginPadding = 0 - } - } - init(checkbox: CheckboxModel, eyebrowHeadlineBodyLink: EyebrowHeadlineBodyLinkModel) { self.checkbox = checkbox self.eyebrowHeadlineBodyLink = eyebrowHeadlineBodyLink @@ -43,35 +22,23 @@ public class ListLeftVariableCheckboxWithRightCaretAllTextAndLinksModel: Contain private enum CodingKeys: String, CodingKey { case moleculeName - case backgroundColor case eyebrowHeadlineBodyLink case checkbox - case action - case spacing } required public init(from decoder: Decoder) throws { let typeContainer = try decoder.container(keyedBy: CodingKeys.self) - backgroundColor = try typeContainer.decodeIfPresent(Color.self, forKey: .backgroundColor) eyebrowHeadlineBodyLink = try typeContainer.decode(EyebrowHeadlineBodyLinkModel.self, forKey: .eyebrowHeadlineBodyLink) checkbox = try typeContainer.decode(CheckboxModel.self, forKey: .checkbox) - action = try typeContainer.decodeModelIfPresent(codingKey: .action, typeCodingKey: ActionCodingKey.actionType) - if let spacing = try typeContainer.decodeIfPresent(CGFloat.self, forKey: .spacing) { - self.spacing = spacing - } try super.init(from: decoder) - setDefaults() } public override func encode(to encoder: Encoder) throws { try super.encode(to: encoder) var container = encoder.container(keyedBy: CodingKeys.self) try container.encode(moleculeName, forKey: .moleculeName) - try container.encodeIfPresent(backgroundColor, forKey: .backgroundColor) try container.encode(eyebrowHeadlineBodyLink, forKey: .eyebrowHeadlineBodyLink) try container.encode(checkbox, forKey: .checkbox) - try container.encodeModelIfPresent(action, forKey: .action) - try container.encodeIfPresent(spacing, forKey: .spacing) } }