Merge branch 'develop' of https://gitlab.verizon.com/BPHV_MIPS/mvm_core_ui into feature/rightVariable_payments_list
This commit is contained in:
commit
51732b72a9
@ -30,6 +30,7 @@ public class CaretLinkModel: ButtonModelProtocol, MoleculeModelProtocol {
|
|||||||
case enabledColor
|
case enabledColor
|
||||||
case disabledColor
|
case disabledColor
|
||||||
case enabled
|
case enabled
|
||||||
|
case moleculeName
|
||||||
}
|
}
|
||||||
|
|
||||||
required public init(from decoder: Decoder) throws {
|
required public init(from decoder: Decoder) throws {
|
||||||
@ -50,6 +51,7 @@ public class CaretLinkModel: ButtonModelProtocol, MoleculeModelProtocol {
|
|||||||
|
|
||||||
public func encode(to encoder: Encoder) throws {
|
public func encode(to encoder: Encoder) throws {
|
||||||
var container = encoder.container(keyedBy: CodingKeys.self)
|
var container = encoder.container(keyedBy: CodingKeys.self)
|
||||||
|
try container.encode(moleculeName, forKey: .moleculeName)
|
||||||
try container.encode(title, forKey: .title)
|
try container.encode(title, forKey: .title)
|
||||||
try container.encodeIfPresent(backgroundColor, forKey: .backgroundColor)
|
try container.encodeIfPresent(backgroundColor, forKey: .backgroundColor)
|
||||||
try container.encodeModel(action, forKey: .action)
|
try container.encodeModel(action, forKey: .action)
|
||||||
|
|||||||
@ -36,6 +36,10 @@ import UIKit
|
|||||||
context?.strokePath()
|
context?.strokePath()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------
|
||||||
|
// MARK: - ModelMoleculeViewProtocol
|
||||||
|
//--------------------------------------------------
|
||||||
|
|
||||||
public override func setWithModel(_ model: MoleculeModelProtocol?, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable: Any]?) {
|
public override func setWithModel(_ model: MoleculeModelProtocol?, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable: Any]?) {
|
||||||
super.setWithModel(model, delegateObject, additionalData)
|
super.setWithModel(model, delegateObject, additionalData)
|
||||||
guard let model = model as? LinkModel else { return }
|
guard let model = model as? LinkModel else { return }
|
||||||
|
|||||||
@ -9,7 +9,12 @@
|
|||||||
import UIKit
|
import UIKit
|
||||||
|
|
||||||
public class LinkModel: ButtonModelProtocol, MoleculeModelProtocol {
|
public class LinkModel: ButtonModelProtocol, MoleculeModelProtocol {
|
||||||
|
//--------------------------------------------------
|
||||||
|
// MARK: - Properties
|
||||||
|
//--------------------------------------------------
|
||||||
|
|
||||||
public static var identifier: String = "link"
|
public static var identifier: String = "link"
|
||||||
|
|
||||||
public var backgroundColor: Color?
|
public var backgroundColor: Color?
|
||||||
public var title: String
|
public var title: String
|
||||||
public var action: ActionModelProtocol
|
public var action: ActionModelProtocol
|
||||||
@ -17,12 +22,21 @@ public class LinkModel: ButtonModelProtocol, MoleculeModelProtocol {
|
|||||||
public var textColor = Color(uiColor: .mvmBlack)
|
public var textColor = Color(uiColor: .mvmBlack)
|
||||||
public var disabledColor = Color(uiColor: .mvmCoolGray6)
|
public var disabledColor = Color(uiColor: .mvmCoolGray6)
|
||||||
|
|
||||||
|
//--------------------------------------------------
|
||||||
|
// MARK: - Initializer
|
||||||
|
//--------------------------------------------------
|
||||||
|
|
||||||
public init(title: String, action: ActionModelProtocol) {
|
public init(title: String, action: ActionModelProtocol) {
|
||||||
self.title = title
|
self.title = title
|
||||||
self.action = action
|
self.action = action
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------
|
||||||
|
// MARK: - Keys
|
||||||
|
//--------------------------------------------------
|
||||||
|
|
||||||
private enum CodingKeys: String, CodingKey {
|
private enum CodingKeys: String, CodingKey {
|
||||||
|
case moleculeName
|
||||||
case backgroundColor
|
case backgroundColor
|
||||||
case title
|
case title
|
||||||
case action
|
case action
|
||||||
@ -31,11 +45,16 @@ public class LinkModel: ButtonModelProtocol, MoleculeModelProtocol {
|
|||||||
case disabledColor
|
case disabledColor
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------
|
||||||
|
// MARK: - Codec
|
||||||
|
//--------------------------------------------------
|
||||||
|
|
||||||
required public init(from decoder: Decoder) throws {
|
required public init(from decoder: Decoder) throws {
|
||||||
let typeContainer = try decoder.container(keyedBy: CodingKeys.self)
|
let typeContainer = try decoder.container(keyedBy: CodingKeys.self)
|
||||||
backgroundColor = try typeContainer.decodeIfPresent(Color.self, forKey: .backgroundColor)
|
backgroundColor = try typeContainer.decodeIfPresent(Color.self, forKey: .backgroundColor)
|
||||||
title = try typeContainer.decode(String.self, forKey: .title)
|
title = try typeContainer.decode(String.self, forKey: .title)
|
||||||
action = try typeContainer.decodeModel(codingKey: .action, typeCodingKey: ActionCodingKey.actionType)
|
action = try typeContainer.decodeModel(codingKey: .action, typeCodingKey: ActionCodingKey.actionType)
|
||||||
|
|
||||||
if let enabled = try typeContainer.decodeIfPresent(Bool.self, forKey: .enabled) {
|
if let enabled = try typeContainer.decodeIfPresent(Bool.self, forKey: .enabled) {
|
||||||
self.enabled = enabled
|
self.enabled = enabled
|
||||||
}
|
}
|
||||||
@ -51,6 +70,7 @@ public class LinkModel: ButtonModelProtocol, MoleculeModelProtocol {
|
|||||||
public func encode(to encoder: Encoder) throws {
|
public func encode(to encoder: Encoder) throws {
|
||||||
var container = encoder.container(keyedBy: CodingKeys.self)
|
var container = encoder.container(keyedBy: CodingKeys.self)
|
||||||
try container.encode(title, forKey: .title)
|
try container.encode(title, forKey: .title)
|
||||||
|
try container.encode(moleculeName, forKey: .moleculeName)
|
||||||
try container.encodeIfPresent(backgroundColor, forKey: .backgroundColor)
|
try container.encodeIfPresent(backgroundColor, forKey: .backgroundColor)
|
||||||
try container.encodeModel(action, forKey: .action)
|
try container.encodeModel(action, forKey: .action)
|
||||||
try container.encode(enabled, forKey: .enabled)
|
try container.encode(enabled, forKey: .enabled)
|
||||||
|
|||||||
@ -37,9 +37,9 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
public override func encode(to encoder: Encoder) throws {
|
public override func encode(to encoder: Encoder) throws {
|
||||||
try super.encode(to: encoder)
|
|
||||||
try super.encode(to: encoder)
|
try super.encode(to: encoder)
|
||||||
var container = encoder.container(keyedBy: CodingKeys.self)
|
var container = encoder.container(keyedBy: CodingKeys.self)
|
||||||
|
try container.encode(moleculeName, forKey: .moleculeName)
|
||||||
try container.encode(caretView, forKey: .caretView)
|
try container.encode(caretView, forKey: .caretView)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -19,7 +19,6 @@ import Foundation
|
|||||||
}
|
}
|
||||||
|
|
||||||
public var backgroundColor: Color?
|
public var backgroundColor: Color?
|
||||||
public var moleculeName: String?
|
|
||||||
public var title: String?
|
public var title: String?
|
||||||
public var feedback: String?
|
public var feedback: String?
|
||||||
public var errorMessage: String = ""
|
public var errorMessage: String = ""
|
||||||
@ -54,7 +53,6 @@ import Foundation
|
|||||||
|
|
||||||
required public init(from decoder: Decoder) throws {
|
required public init(from decoder: Decoder) throws {
|
||||||
let typeContainer = try decoder.container(keyedBy: CodingKeys.self)
|
let typeContainer = try decoder.container(keyedBy: CodingKeys.self)
|
||||||
moleculeName = try typeContainer.decodeIfPresent(String.self, forKey: .moleculeName)
|
|
||||||
backgroundColor = try typeContainer.decodeIfPresent(Color.self, forKey: .backgroundColor)
|
backgroundColor = try typeContainer.decodeIfPresent(Color.self, forKey: .backgroundColor)
|
||||||
title = try typeContainer.decodeIfPresent(String.self, forKey: .title)
|
title = try typeContainer.decodeIfPresent(String.self, forKey: .title)
|
||||||
feedback = try typeContainer.decodeIfPresent(String.self, forKey: .feedback)
|
feedback = try typeContainer.decodeIfPresent(String.self, forKey: .feedback)
|
||||||
|
|||||||
@ -12,7 +12,7 @@ import UIKit
|
|||||||
|
|
||||||
public static var identifier: String = "textField"
|
public static var identifier: String = "textField"
|
||||||
public var backgroundColor: Color?
|
public var backgroundColor: Color?
|
||||||
public var moleculeName: String
|
public var moleculeName: String? = TextFieldModel.identifier
|
||||||
public var editable: Bool?
|
public var editable: Bool?
|
||||||
public var disabled: Bool?
|
public var disabled: Bool?
|
||||||
public var errorMsg: String?
|
public var errorMsg: String?
|
||||||
|
|||||||
@ -18,6 +18,7 @@ import Foundation
|
|||||||
public var lineWidth: CGFloat?
|
public var lineWidth: CGFloat?
|
||||||
|
|
||||||
private enum CodingKeys: String, CodingKey {
|
private enum CodingKeys: String, CodingKey {
|
||||||
|
case moleculeName
|
||||||
case backgroundColor
|
case backgroundColor
|
||||||
case strokeColor
|
case strokeColor
|
||||||
case isHidden
|
case isHidden
|
||||||
@ -38,6 +39,7 @@ import Foundation
|
|||||||
|
|
||||||
public func encode(to encoder: Encoder) throws {
|
public func encode(to encoder: Encoder) throws {
|
||||||
var container = encoder.container(keyedBy: CodingKeys.self)
|
var container = encoder.container(keyedBy: CodingKeys.self)
|
||||||
|
try container.encode(moleculeName, forKey: .moleculeName)
|
||||||
try container.encode(strokeColor, forKey: .strokeColor)
|
try container.encode(strokeColor, forKey: .strokeColor)
|
||||||
try container.encodeIfPresent(isHidden, forKey: .isHidden)
|
try container.encodeIfPresent(isHidden, forKey: .isHidden)
|
||||||
try container.encodeIfPresent(isOpaque, forKey: .isOpaque)
|
try container.encodeIfPresent(isOpaque, forKey: .isOpaque)
|
||||||
|
|||||||
@ -39,6 +39,7 @@ import Foundation
|
|||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
|
|
||||||
private enum CodingKeys: String, CodingKey {
|
private enum CodingKeys: String, CodingKey {
|
||||||
|
case moleculeName
|
||||||
case groupName
|
case groupName
|
||||||
case value
|
case value
|
||||||
case fieldKey
|
case fieldKey
|
||||||
@ -85,6 +86,7 @@ import Foundation
|
|||||||
|
|
||||||
public func encode(to encoder: Encoder) throws {
|
public func encode(to encoder: Encoder) throws {
|
||||||
var container = encoder.container(keyedBy: CodingKeys.self)
|
var container = encoder.container(keyedBy: CodingKeys.self)
|
||||||
|
try container.encode(moleculeName, forKey: .moleculeName)
|
||||||
try container.encodeIfPresent(groupName, forKey: .groupName)
|
try container.encodeIfPresent(groupName, forKey: .groupName)
|
||||||
try container.encodeIfPresent(value, forKey: .value)
|
try container.encodeIfPresent(value, forKey: .value)
|
||||||
try container.encodeIfPresent(fieldKey, forKey: .fieldKey)
|
try container.encodeIfPresent(fieldKey, forKey: .fieldKey)
|
||||||
|
|||||||
@ -48,6 +48,7 @@ public class CircleProgressModel: MoleculeModelProtocol {
|
|||||||
case duration
|
case duration
|
||||||
case colors
|
case colors
|
||||||
case backgroundColor
|
case backgroundColor
|
||||||
|
case moleculeName
|
||||||
}
|
}
|
||||||
|
|
||||||
required public init(from decoder: Decoder) throws {
|
required public init(from decoder: Decoder) throws {
|
||||||
@ -78,6 +79,7 @@ public class CircleProgressModel: MoleculeModelProtocol {
|
|||||||
|
|
||||||
public func encode(to encoder: Encoder) throws {
|
public func encode(to encoder: Encoder) throws {
|
||||||
var container = encoder.container(keyedBy: CodingKeys.self)
|
var container = encoder.container(keyedBy: CodingKeys.self)
|
||||||
|
try container.encode(moleculeName, forKey: .moleculeName)
|
||||||
try container.encode(style, forKey: .style)
|
try container.encode(style, forKey: .style)
|
||||||
try container.encode(size, forKey: .size)
|
try container.encode(size, forKey: .size)
|
||||||
try container.encode(diameter, forKey: .diameter)
|
try container.encode(diameter, forKey: .diameter)
|
||||||
|
|||||||
@ -20,6 +20,7 @@ import Foundation
|
|||||||
}
|
}
|
||||||
|
|
||||||
private enum CodingKeys: String, CodingKey {
|
private enum CodingKeys: String, CodingKey {
|
||||||
|
case moleculeName
|
||||||
case backgroundColor
|
case backgroundColor
|
||||||
case dashColor
|
case dashColor
|
||||||
case isHidden
|
case isHidden
|
||||||
@ -36,6 +37,7 @@ import Foundation
|
|||||||
|
|
||||||
public func encode(to encoder: Encoder) throws {
|
public func encode(to encoder: Encoder) throws {
|
||||||
var container = encoder.container(keyedBy: CodingKeys.self)
|
var container = encoder.container(keyedBy: CodingKeys.self)
|
||||||
|
try container.encode(moleculeName, forKey: .moleculeName)
|
||||||
try container.encode(dashColor, forKey: .dashColor)
|
try container.encode(dashColor, forKey: .dashColor)
|
||||||
try container.encodeIfPresent(isHidden, forKey: .isHidden)
|
try container.encodeIfPresent(isHidden, forKey: .isHidden)
|
||||||
try container.encodeIfPresent(backgroundColor, forKey: .backgroundColor)
|
try container.encodeIfPresent(backgroundColor, forKey: .backgroundColor)
|
||||||
|
|||||||
@ -11,6 +11,7 @@ import Foundation
|
|||||||
@objcMembers public class ImageViewModel: MoleculeModelProtocol {
|
@objcMembers public class ImageViewModel: MoleculeModelProtocol {
|
||||||
public static var identifier: String = "image"
|
public static var identifier: String = "image"
|
||||||
public var backgroundColor: Color?
|
public var backgroundColor: Color?
|
||||||
|
public var moleculeName: String? = ImageViewModel.identifier
|
||||||
public var image: String
|
public var image: String
|
||||||
public var accessibilityText: String?
|
public var accessibilityText: String?
|
||||||
public var fallbackImage: String?
|
public var fallbackImage: String?
|
||||||
|
|||||||
@ -10,7 +10,12 @@ import UIKit
|
|||||||
|
|
||||||
@objcMembers public class LeftRightLabelModel: MoleculeModelProtocol {
|
@objcMembers public class LeftRightLabelModel: MoleculeModelProtocol {
|
||||||
public static var identifier: String = "leftRightLabelView"
|
public static var identifier: String = "leftRightLabelView"
|
||||||
|
public var moleculeName: String? = LeftRightLabelModel.identifier
|
||||||
public var backgroundColor: Color?
|
public var backgroundColor: Color?
|
||||||
public var leftText: LabelModel
|
public var leftText: LabelModel
|
||||||
public var rightText: LabelModel?
|
public var rightText: LabelModel?
|
||||||
|
|
||||||
|
init(_ leftText: LabelModel) {
|
||||||
|
self.leftText = leftText
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -26,6 +26,7 @@ import Foundation
|
|||||||
public var roundedRect: Bool?
|
public var roundedRect: Bool?
|
||||||
|
|
||||||
private enum CodingKeys: String, CodingKey {
|
private enum CodingKeys: String, CodingKey {
|
||||||
|
case moleculeName
|
||||||
case progressList
|
case progressList
|
||||||
case thickness
|
case thickness
|
||||||
case roundedRect
|
case roundedRect
|
||||||
@ -46,6 +47,7 @@ import Foundation
|
|||||||
|
|
||||||
public func encode(to encoder: Encoder) throws {
|
public func encode(to encoder: Encoder) throws {
|
||||||
var container = encoder.container(keyedBy: CodingKeys.self)
|
var container = encoder.container(keyedBy: CodingKeys.self)
|
||||||
|
try container.encode(moleculeName, forKey: .moleculeName)
|
||||||
try container.encode(progressList, forKey: .progressList)
|
try container.encode(progressList, forKey: .progressList)
|
||||||
try container.encodeIfPresent(thickness, forKey: .thickness)
|
try container.encodeIfPresent(thickness, forKey: .thickness)
|
||||||
try container.encodeIfPresent(roundedRect, forKey: .roundedRect)
|
try container.encodeIfPresent(roundedRect, forKey: .roundedRect)
|
||||||
|
|||||||
@ -10,7 +10,6 @@ import UIKit
|
|||||||
|
|
||||||
public class ToggleModel: MoleculeModelProtocol {
|
public class ToggleModel: MoleculeModelProtocol {
|
||||||
public static var identifier: String = "toggle"
|
public static var identifier: String = "toggle"
|
||||||
public var moleculeName: String?
|
|
||||||
public var backgroundColor: Color?
|
public var backgroundColor: Color?
|
||||||
public var state: Bool = true
|
public var state: Bool = true
|
||||||
public var action: ActionModelProtocol?
|
public var action: ActionModelProtocol?
|
||||||
|
|||||||
@ -12,6 +12,7 @@ public typealias ButtonAction = (Button) -> ()
|
|||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
// MARK: - Properties
|
// MARK: - Properties
|
||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
|
|
||||||
open var model: MoleculeModelProtocol?
|
open var model: MoleculeModelProtocol?
|
||||||
open var actionModel: ActionModelProtocol?
|
open var actionModel: ActionModelProtocol?
|
||||||
|
|
||||||
@ -67,7 +68,7 @@ public typealias ButtonAction = (Button) -> ()
|
|||||||
addTarget(self, action: #selector(callActionBlock(_:)), for: event)
|
addTarget(self, action: #selector(callActionBlock(_:)), for: event)
|
||||||
}
|
}
|
||||||
|
|
||||||
@objc private func callActionBlock(_ sender: Button) {
|
@objc func callActionBlock(_ sender: Button) {
|
||||||
buttonAction?(self)
|
buttonAction?(self)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -88,11 +89,13 @@ public typealias ButtonAction = (Button) -> ()
|
|||||||
// MARK:- ModelMoleculeViewProtocol
|
// MARK:- ModelMoleculeViewProtocol
|
||||||
open func setWithModel(_ model: MoleculeModelProtocol?, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable: Any]?) {
|
open func setWithModel(_ model: MoleculeModelProtocol?, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable: Any]?) {
|
||||||
self.model = model
|
self.model = model
|
||||||
|
|
||||||
if let backgroundColor = model?.backgroundColor {
|
if let backgroundColor = model?.backgroundColor {
|
||||||
self.backgroundColor = backgroundColor.uiColor
|
self.backgroundColor = backgroundColor.uiColor
|
||||||
}
|
}
|
||||||
|
|
||||||
guard let model = model as? ButtonModelProtocol else { return }
|
guard let model = model as? ButtonModelProtocol else { return }
|
||||||
|
|
||||||
isEnabled = model.enabled
|
isEnabled = model.enabled
|
||||||
set(with: model.action, delegateObject: delegateObject, additionalData: additionalData)
|
set(with: model.action, delegateObject: delegateObject, additionalData: additionalData)
|
||||||
}
|
}
|
||||||
@ -113,7 +116,7 @@ public typealias ButtonAction = (Button) -> ()
|
|||||||
// MARK: - MVMCoreViewProtocol
|
// MARK: - MVMCoreViewProtocol
|
||||||
extension Button: MVMCoreViewProtocol {
|
extension Button: MVMCoreViewProtocol {
|
||||||
|
|
||||||
open func updateView(_ size: CGFloat) {}
|
open func updateView(_ size: CGFloat) { }
|
||||||
|
|
||||||
/// Will be called only once.
|
/// Will be called only once.
|
||||||
open func setupView() {
|
open func setupView() {
|
||||||
@ -126,6 +129,7 @@ extension Button: MVMCoreViewProtocol {
|
|||||||
|
|
||||||
// MARK: - MVMCoreUIMoleculeViewProtocol
|
// MARK: - MVMCoreUIMoleculeViewProtocol
|
||||||
extension Button: MVMCoreUIMoleculeViewProtocol {
|
extension Button: MVMCoreUIMoleculeViewProtocol {
|
||||||
|
|
||||||
open func reset() {
|
open func reset() {
|
||||||
backgroundColor = .clear
|
backgroundColor = .clear
|
||||||
}
|
}
|
||||||
@ -133,6 +137,7 @@ extension Button: MVMCoreUIMoleculeViewProtocol {
|
|||||||
|
|
||||||
// MARK: AppleGuidelinesProtocol
|
// MARK: AppleGuidelinesProtocol
|
||||||
extension Button: AppleGuidelinesProtocol {
|
extension Button: AppleGuidelinesProtocol {
|
||||||
|
|
||||||
override open func point(inside point: CGPoint, with event: UIEvent?) -> Bool {
|
override open func point(inside point: CGPoint, with event: UIEvent?) -> Bool {
|
||||||
return Self.acceptablyOutsideBounds(point: point, bounds: bounds)
|
return Self.acceptablyOutsideBounds(point: point, bounds: bounds)
|
||||||
}
|
}
|
||||||
|
|||||||
@ -3,7 +3,7 @@ import Foundation
|
|||||||
|
|
||||||
public protocol MoleculeModelProtocol: Model {
|
public protocol MoleculeModelProtocol: Model {
|
||||||
var moleculeName: String? { get }
|
var moleculeName: String? { get }
|
||||||
var backgroundColor: Color? { get set}
|
var backgroundColor: Color? { get set }
|
||||||
}
|
}
|
||||||
|
|
||||||
public extension MoleculeModelProtocol {
|
public extension MoleculeModelProtocol {
|
||||||
|
|||||||
@ -11,6 +11,7 @@ import Foundation
|
|||||||
@objcMembers public class DoughnutChartModel: MoleculeModelProtocol {
|
@objcMembers public class DoughnutChartModel: MoleculeModelProtocol {
|
||||||
public var backgroundColor: Color?
|
public var backgroundColor: Color?
|
||||||
public static var identifier: String = "doughnutChart"
|
public static var identifier: String = "doughnutChart"
|
||||||
|
public var moleculeName: String? = DoughnutChartModel.identifier
|
||||||
public var title: LabelModel?
|
public var title: LabelModel?
|
||||||
public var subtitle: LabelModel?
|
public var subtitle: LabelModel?
|
||||||
public var sections: [DoughnutChartItemModel]
|
public var sections: [DoughnutChartItemModel]
|
||||||
@ -24,6 +25,7 @@ import Foundation
|
|||||||
@objcMembers public class DoughnutChartItemModel: MoleculeModelProtocol {
|
@objcMembers public class DoughnutChartItemModel: MoleculeModelProtocol {
|
||||||
public var backgroundColor: Color?
|
public var backgroundColor: Color?
|
||||||
public static var identifier: String = "doughnutChartItem"
|
public static var identifier: String = "doughnutChartItem"
|
||||||
|
public var moleculeName: String? = DoughnutChartItemModel.identifier
|
||||||
public var label: LabelModel
|
public var label: LabelModel
|
||||||
@Percent public var percent: CGFloat
|
@Percent public var percent: CGFloat
|
||||||
public var color: Color
|
public var color: Color
|
||||||
|
|||||||
@ -10,6 +10,7 @@ import Foundation
|
|||||||
|
|
||||||
public struct ImageHeadlineBodyModel: MoleculeModelProtocol {
|
public struct ImageHeadlineBodyModel: MoleculeModelProtocol {
|
||||||
public static var identifier: String = "imageHeadlineBody"
|
public static var identifier: String = "imageHeadlineBody"
|
||||||
|
public var moleculeName: String? = ImageHeadlineBodyModel.identifier
|
||||||
public var backgroundColor: Color?
|
public var backgroundColor: Color?
|
||||||
public var image: ImageViewModel
|
public var image: ImageViewModel
|
||||||
public var headlineBody: HeadlineBodyModel
|
public var headlineBody: HeadlineBodyModel
|
||||||
|
|||||||
@ -22,6 +22,7 @@ public class TabsModel: MoleculeModelProtocol {
|
|||||||
case backgroundColor
|
case backgroundColor
|
||||||
case selectedColor
|
case selectedColor
|
||||||
case selectedIndex
|
case selectedIndex
|
||||||
|
case moleculeName
|
||||||
}
|
}
|
||||||
|
|
||||||
public init(with tabs: [LabelModel]) {
|
public init(with tabs: [LabelModel]) {
|
||||||
@ -42,6 +43,7 @@ public class TabsModel: MoleculeModelProtocol {
|
|||||||
|
|
||||||
public func encode(to encoder: Encoder) throws {
|
public func encode(to encoder: Encoder) throws {
|
||||||
var container = encoder.container(keyedBy: CodingKeys.self)
|
var container = encoder.container(keyedBy: CodingKeys.self)
|
||||||
|
try container.encode(moleculeName, forKey: .moleculeName)
|
||||||
try container.encode(tabs, forKey: .tabs)
|
try container.encode(tabs, forKey: .tabs)
|
||||||
try container.encode(backgroundColor, forKey: .backgroundColor)
|
try container.encode(backgroundColor, forKey: .backgroundColor)
|
||||||
try container.encode(selectedColor, forKey: .selectedColor)
|
try container.encode(selectedColor, forKey: .selectedColor)
|
||||||
|
|||||||
@ -14,7 +14,6 @@ import Foundation
|
|||||||
public var backgroundColor: Color?
|
public var backgroundColor: Color?
|
||||||
public var peakingUI: Bool?
|
public var peakingUI: Bool?
|
||||||
public var peakingArrowColor: Color?
|
public var peakingArrowColor: Color?
|
||||||
public var moleculeName: String?
|
|
||||||
|
|
||||||
private enum CodingKeys: String, CodingKey {
|
private enum CodingKeys: String, CodingKey {
|
||||||
case moleculeName
|
case moleculeName
|
||||||
@ -25,7 +24,6 @@ import Foundation
|
|||||||
|
|
||||||
required public init(from decoder: Decoder) throws {
|
required public init(from decoder: Decoder) throws {
|
||||||
let typeContainer = try decoder.container(keyedBy: CodingKeys.self)
|
let typeContainer = try decoder.container(keyedBy: CodingKeys.self)
|
||||||
moleculeName = try typeContainer.decodeIfPresent(String.self, forKey: .moleculeName)
|
|
||||||
backgroundColor = try typeContainer.decodeIfPresent(Color.self, forKey: .backgroundColor)
|
backgroundColor = try typeContainer.decodeIfPresent(Color.self, forKey: .backgroundColor)
|
||||||
peakingUI = try typeContainer.decodeIfPresent(Bool.self, forKey: .peakingUI)
|
peakingUI = try typeContainer.decodeIfPresent(Bool.self, forKey: .peakingUI)
|
||||||
peakingArrowColor = try typeContainer.decodeIfPresent(Color.self, forKey: .peakingArrowColor)
|
peakingArrowColor = try typeContainer.decodeIfPresent(Color.self, forKey: .peakingArrowColor)
|
||||||
|
|||||||
@ -10,6 +10,7 @@ import Foundation
|
|||||||
|
|
||||||
@objcMembers public class StackItemModel: ContainerModel, StackItemModelProtocol, MoleculeModelProtocol {
|
@objcMembers public class StackItemModel: ContainerModel, StackItemModelProtocol, MoleculeModelProtocol {
|
||||||
public static var identifier: String = "simpleStackItem"
|
public static var identifier: String = "simpleStackItem"
|
||||||
|
public var moleculeName: String? = StackItemModel.identifier
|
||||||
public var backgroundColor: Color?
|
public var backgroundColor: Color?
|
||||||
public var spacing: CGFloat?
|
public var spacing: CGFloat?
|
||||||
public var percent: Int?
|
public var percent: Int?
|
||||||
|
|||||||
@ -10,6 +10,7 @@ import Foundation
|
|||||||
|
|
||||||
public struct ActionDetailWithImageModel: MoleculeModelProtocol {
|
public struct ActionDetailWithImageModel: MoleculeModelProtocol {
|
||||||
public static var identifier: String = "actionDetailWithImage"
|
public static var identifier: String = "actionDetailWithImage"
|
||||||
|
public var moleculeName: String? = ActionDetailWithImageModel.identifier
|
||||||
public var backgroundColor: Color?
|
public var backgroundColor: Color?
|
||||||
public var headlineBodyButton: HeadlineBodyButtonModel
|
public var headlineBodyButton: HeadlineBodyButtonModel
|
||||||
public var image: ImageViewModel
|
public var image: ImageViewModel
|
||||||
|
|||||||
@ -28,6 +28,7 @@ public class CornerLabelsModel: MoleculeModelProtocol {
|
|||||||
case bottomLeftLabel
|
case bottomLeftLabel
|
||||||
case bottomRightLabel
|
case bottomRightLabel
|
||||||
case molecule
|
case molecule
|
||||||
|
case moleculeName
|
||||||
}
|
}
|
||||||
|
|
||||||
required public init(from decoder: Decoder) throws {
|
required public init(from decoder: Decoder) throws {
|
||||||
@ -48,5 +49,6 @@ public class CornerLabelsModel: MoleculeModelProtocol {
|
|||||||
try container.encodeIfPresent(topRightLabel, forKey: .topRightLabel)
|
try container.encodeIfPresent(topRightLabel, forKey: .topRightLabel)
|
||||||
try container.encodeIfPresent(bottomLeftLabel, forKey: .bottomLeftLabel)
|
try container.encodeIfPresent(bottomLeftLabel, forKey: .bottomLeftLabel)
|
||||||
try container.encodeIfPresent(bottomRightLabel, forKey: .bottomRightLabel)
|
try container.encodeIfPresent(bottomRightLabel, forKey: .bottomRightLabel)
|
||||||
|
try container.encode(moleculeName, forKey: .moleculeName)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -9,6 +9,7 @@
|
|||||||
import Foundation
|
import Foundation
|
||||||
public struct HeadlineBodyLinkToggleModel: MoleculeModelProtocol {
|
public struct HeadlineBodyLinkToggleModel: MoleculeModelProtocol {
|
||||||
public static var identifier: String = "headlineBodyLinkToggle"
|
public static var identifier: String = "headlineBodyLinkToggle"
|
||||||
|
public var moleculeName: String? = HeadlineBodyLinkToggleModel.identifier
|
||||||
public var backgroundColor: Color?
|
public var backgroundColor: Color?
|
||||||
public var headlineBodyLink: HeadlineBodyLinkModel
|
public var headlineBodyLink: HeadlineBodyLinkModel
|
||||||
public var toggle: ToggleModel
|
public var toggle: ToggleModel
|
||||||
|
|||||||
@ -11,6 +11,7 @@ import Foundation
|
|||||||
|
|
||||||
open class HeadlineBodyToggleModel: MoleculeModelProtocol {
|
open class HeadlineBodyToggleModel: MoleculeModelProtocol {
|
||||||
public static var identifier: String = "headlineBodyToggle"
|
public static var identifier: String = "headlineBodyToggle"
|
||||||
|
public var moleculeName: String? = HeadlineBodyToggleModel.identifier
|
||||||
open var backgroundColor: Color?
|
open var backgroundColor: Color?
|
||||||
open var headlineBody: HeadlineBodyModel
|
open var headlineBody: HeadlineBodyModel
|
||||||
open var toggle: ToggleModel
|
open var toggle: ToggleModel
|
||||||
|
|||||||
@ -10,7 +10,13 @@ import Foundation
|
|||||||
|
|
||||||
public class LabelToggleModel: MoleculeModelProtocol {
|
public class LabelToggleModel: MoleculeModelProtocol {
|
||||||
public static var identifier: String = "labelToggle"
|
public static var identifier: String = "labelToggle"
|
||||||
|
public var moleculeName: String? = LabelToggleModel.identifier
|
||||||
public var backgroundColor: Color?
|
public var backgroundColor: Color?
|
||||||
public var label: LabelModel
|
public var label: LabelModel
|
||||||
public var toggle: ToggleModel
|
public var toggle: ToggleModel
|
||||||
|
|
||||||
|
init(_ label: LabelModel, _ toggle: ToggleModel) {
|
||||||
|
self.label = label
|
||||||
|
self.toggle = toggle
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -10,5 +10,6 @@ import UIKit
|
|||||||
|
|
||||||
public class ScrollerModel: MoleculeContainerModel, MoleculeModelProtocol {
|
public class ScrollerModel: MoleculeContainerModel, MoleculeModelProtocol {
|
||||||
public static var identifier: String = "scroller"
|
public static var identifier: String = "scroller"
|
||||||
|
public var moleculeName: String? = ScrollerModel.identifier
|
||||||
public var backgroundColor: Color?
|
public var backgroundColor: Color?
|
||||||
}
|
}
|
||||||
|
|||||||
@ -11,7 +11,7 @@ import Foundation
|
|||||||
struct EyebrowHeadlineBodyLinkModel: MoleculeModelProtocol {
|
struct EyebrowHeadlineBodyLinkModel: MoleculeModelProtocol {
|
||||||
static var identifier: String = "eyebrowHeadlineBodyLink"
|
static var identifier: String = "eyebrowHeadlineBodyLink"
|
||||||
var backgroundColor: Color?
|
var backgroundColor: Color?
|
||||||
|
var moleculeName: String? = EyebrowHeadlineBodyLinkModel.identifier
|
||||||
public var eyeBrow: LabelModel?
|
public var eyeBrow: LabelModel?
|
||||||
public var headline: LabelModel?
|
public var headline: LabelModel?
|
||||||
public var body: LabelModel?
|
public var body: LabelModel?
|
||||||
|
|||||||
@ -10,6 +10,7 @@ import Foundation
|
|||||||
|
|
||||||
public struct HeadlineBodyButtonModel: MoleculeModelProtocol {
|
public struct HeadlineBodyButtonModel: MoleculeModelProtocol {
|
||||||
public static var identifier: String = "headlineBodyButton"
|
public static var identifier: String = "headlineBodyButton"
|
||||||
|
public var moleculeName: String? = HeadlineBodyButtonModel.identifier
|
||||||
public var backgroundColor: Color?
|
public var backgroundColor: Color?
|
||||||
|
|
||||||
public var headlineBody: HeadlineBodyModel
|
public var headlineBody: HeadlineBodyModel
|
||||||
|
|||||||
@ -10,6 +10,7 @@ import Foundation
|
|||||||
|
|
||||||
public struct HeadlineBodyLinkModel: MoleculeModelProtocol {
|
public struct HeadlineBodyLinkModel: MoleculeModelProtocol {
|
||||||
public static var identifier: String = "headlineBodyLink"
|
public static var identifier: String = "headlineBodyLink"
|
||||||
|
public var moleculeName: String? = HeadlineBodyLinkModel.identifier
|
||||||
public var headlineBody: HeadlineBodyModel
|
public var headlineBody: HeadlineBodyModel
|
||||||
public var link: LinkModel
|
public var link: LinkModel
|
||||||
public var backgroundColor: Color?
|
public var backgroundColor: Color?
|
||||||
|
|||||||
@ -10,6 +10,7 @@ import Foundation
|
|||||||
|
|
||||||
@objcMembers public class HeadlineBodyModel: MoleculeModelProtocol {
|
@objcMembers public class HeadlineBodyModel: MoleculeModelProtocol {
|
||||||
public static var identifier: String = "headlineBody"
|
public static var identifier: String = "headlineBody"
|
||||||
|
public var moleculeName: String? = HeadlineBodyModel.identifier
|
||||||
public var headline: LabelModel?
|
public var headline: LabelModel?
|
||||||
public var body: LabelModel?
|
public var body: LabelModel?
|
||||||
public var style: String?
|
public var style: String?
|
||||||
|
|||||||
@ -38,5 +38,6 @@ public class StringAndMoleculeModel: MoleculeModelProtocol {
|
|||||||
try container.encodeIfPresent(backgroundColor, forKey: .backgroundColor)
|
try container.encodeIfPresent(backgroundColor, forKey: .backgroundColor)
|
||||||
try container.encode(string, forKey: .string)
|
try container.encode(string, forKey: .string)
|
||||||
try container.encodeModel(molecule, forKey: .molecule)
|
try container.encodeModel(molecule, forKey: .molecule)
|
||||||
|
try container.encode(moleculeName, forKey: .moleculeName)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -53,7 +53,7 @@ import UIKit
|
|||||||
|
|
||||||
public func encode(to encoder: Encoder) throws {
|
public func encode(to encoder: Encoder) throws {
|
||||||
var container = encoder.container(keyedBy: CodingKeys.self)
|
var container = encoder.container(keyedBy: CodingKeys.self)
|
||||||
try container.encodeIfPresent(moleculeName, forKey: .moleculeName)
|
try container.encode(moleculeName, forKey: .moleculeName)
|
||||||
try container.encodeIfPresent(backgroundColor, forKey: .backgroundColor)
|
try container.encodeIfPresent(backgroundColor, forKey: .backgroundColor)
|
||||||
try container.encode(molecules, forKey: .molecules)
|
try container.encode(molecules, forKey: .molecules)
|
||||||
try container.encode(spacing, forKey: .spacing)
|
try container.encode(spacing, forKey: .spacing)
|
||||||
|
|||||||
@ -45,5 +45,6 @@ import Foundation
|
|||||||
try container.encodeIfPresent(molecules, forKey: .molecules)
|
try container.encodeIfPresent(molecules, forKey: .molecules)
|
||||||
try container.encodeIfPresent(axis.rawValueString, forKey: .axis)
|
try container.encodeIfPresent(axis.rawValueString, forKey: .axis)
|
||||||
try container.encodeIfPresent(spacing, forKey: .spacing)
|
try container.encodeIfPresent(spacing, forKey: .spacing)
|
||||||
|
try container.encode(moleculeName, forKey: .moleculeName)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user