moleculeName

This commit is contained in:
Suresh, Kamlesh 2020-02-19 11:26:24 -05:00
parent a2700e81b4
commit cbe01463d9
20 changed files with 34 additions and 3 deletions

View File

@ -37,9 +37,9 @@
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
try container.encode(moleculeName, forKey: .moleculeName)
try container.encode(caretView, forKey: .caretView)
}
}

View File

@ -12,7 +12,7 @@ import UIKit
public static var identifier: String = "textField"
public var backgroundColor: Color?
public var moleculeName: String
public var moleculeName: String? = TextFieldModel.identifier
public var editable: Bool?
public var disabled: Bool?
public var errorMsg: String?

View File

@ -18,6 +18,7 @@ import Foundation
public var lineWidth: CGFloat?
private enum CodingKeys: String, CodingKey {
case moleculeName
case backgroundColor
case strokeColor
case isHidden
@ -38,6 +39,7 @@ import Foundation
public func encode(to encoder: Encoder) throws {
var container = encoder.container(keyedBy: CodingKeys.self)
try container.encode(moleculeName, forKey: .moleculeName)
try container.encode(strokeColor, forKey: .strokeColor)
try container.encodeIfPresent(isHidden, forKey: .isHidden)
try container.encodeIfPresent(isOpaque, forKey: .isOpaque)

View File

@ -39,6 +39,7 @@ import Foundation
//--------------------------------------------------
private enum CodingKeys: String, CodingKey {
case moleculeName
case groupName
case value
case fieldKey
@ -85,6 +86,7 @@ import Foundation
public func encode(to encoder: Encoder) throws {
var container = encoder.container(keyedBy: CodingKeys.self)
try container.encode(moleculeName, forKey: .moleculeName)
try container.encodeIfPresent(groupName, forKey: .groupName)
try container.encodeIfPresent(value, forKey: .value)
try container.encodeIfPresent(fieldKey, forKey: .fieldKey)

View File

@ -20,6 +20,7 @@ import Foundation
}
private enum CodingKeys: String, CodingKey {
case moleculeName
case backgroundColor
case dashColor
case isHidden
@ -36,6 +37,7 @@ import Foundation
public func encode(to encoder: Encoder) throws {
var container = encoder.container(keyedBy: CodingKeys.self)
try container.encode(moleculeName, forKey: .moleculeName)
try container.encode(dashColor, forKey: .dashColor)
try container.encodeIfPresent(isHidden, forKey: .isHidden)
try container.encodeIfPresent(backgroundColor, forKey: .backgroundColor)

View File

@ -11,6 +11,7 @@ import Foundation
@objcMembers public class ImageViewModel: MoleculeModelProtocol {
public static var identifier: String = "image"
public var backgroundColor: Color?
public var moleculeName: String? = ImageViewModel.identifier
public var image: String
public var accessibilityText: String?
public var fallbackImage: String?

View File

@ -10,7 +10,12 @@ import UIKit
@objcMembers public class LeftRightLabelModel: MoleculeModelProtocol {
public static var identifier: String = "leftRightLabelView"
public var moleculeName: String? = LeftRightLabelModel.identifier
public var backgroundColor: Color?
public var leftText: LabelModel
public var rightText: LabelModel?
init(_ leftText: LabelModel) {
self.leftText = leftText
}
}

View File

@ -26,6 +26,7 @@ import Foundation
public var roundedRect: Bool?
private enum CodingKeys: String, CodingKey {
case moleculeName
case progressList
case thickness
case roundedRect
@ -46,6 +47,7 @@ import Foundation
public func encode(to encoder: Encoder) throws {
var container = encoder.container(keyedBy: CodingKeys.self)
try container.encode(moleculeName, forKey: .moleculeName)
try container.encode(progressList, forKey: .progressList)
try container.encodeIfPresent(thickness, forKey: .thickness)
try container.encodeIfPresent(roundedRect, forKey: .roundedRect)

View File

@ -11,6 +11,7 @@ import Foundation
@objcMembers public class DoughnutChartModel: MoleculeModelProtocol {
public var backgroundColor: Color?
public static var identifier: String = "doughnutChart"
public var moleculeName: String? = DoughnutChartModel.identifier
public var title: LabelModel?
public var subtitle: LabelModel?
public var sections: [DoughnutChartItemModel]
@ -24,6 +25,7 @@ import Foundation
@objcMembers public class DoughnutChartItemModel: MoleculeModelProtocol {
public var backgroundColor: Color?
public static var identifier: String = "doughnutChartItem"
public var moleculeName: String? = DoughnutChartItemModel.identifier
public var label: LabelModel
@Percent public var percent: CGFloat
public var color: Color

View File

@ -10,6 +10,7 @@ import Foundation
public struct ImageHeadlineBodyModel: MoleculeModelProtocol {
public static var identifier: String = "imageHeadlineBody"
public var moleculeName: String? = ImageHeadlineBodyModel.identifier
public var backgroundColor: Color?
public var image: ImageViewModel
public var headlineBody: HeadlineBodyModel

View File

@ -10,6 +10,7 @@ import Foundation
@objcMembers public class StackItemModel: ContainerModel, StackItemModelProtocol, MoleculeModelProtocol {
public static var identifier: String = "simpleStackItem"
public var moleculeName: String? = StackItemModel.identifier
public var backgroundColor: Color?
public var spacing: CGFloat?
public var percent: Int?

View File

@ -10,6 +10,7 @@ import Foundation
public struct ActionDetailWithImageModel: MoleculeModelProtocol {
public static var identifier: String = "actionDetailWithImage"
public var moleculeName: String? = ActionDetailWithImageModel.identifier
public var backgroundColor: Color?
public var headlineBodyButton: HeadlineBodyButtonModel
public var image: ImageViewModel

View File

@ -9,6 +9,7 @@
import Foundation
public struct HeadlineBodyLinkToggleModel: MoleculeModelProtocol {
public static var identifier: String = "headlineBodyLinkToggle"
public var moleculeName: String? = HeadlineBodyLinkToggleModel.identifier
public var backgroundColor: Color?
public var headlineBodyLink: HeadlineBodyLinkModel
public var toggle: ToggleModel

View File

@ -11,6 +11,7 @@ import Foundation
open class HeadlineBodyToggleModel: MoleculeModelProtocol {
public static var identifier: String = "headlineBodyToggle"
public var moleculeName: String? = HeadlineBodyToggleModel.identifier
open var backgroundColor: Color?
open var headlineBody: HeadlineBodyModel
open var toggle: ToggleModel

View File

@ -10,7 +10,13 @@ import Foundation
public class LabelToggleModel: MoleculeModelProtocol {
public static var identifier: String = "labelToggle"
public var moleculeName: String? = LabelToggleModel.identifier
public var backgroundColor: Color?
public var label: LabelModel
public var toggle: ToggleModel
init(_ label: LabelModel, _ toggle: ToggleModel) {
self.label = label
self.toggle = toggle
}
}

View File

@ -10,5 +10,6 @@ import UIKit
public class ScrollerModel: MoleculeContainerModel, MoleculeModelProtocol {
public static var identifier: String = "scroller"
public var moleculeName: String? = ScrollerModel.identifier
public var backgroundColor: Color?
}

View File

@ -11,7 +11,7 @@ import Foundation
struct EyebrowHeadlineBodyLinkModel: MoleculeModelProtocol {
static var identifier: String = "eyebrowHeadlineBodyLink"
var backgroundColor: Color?
var moleculeName: String? = EyebrowHeadlineBodyLinkModel.identifier
public var eyeBrow: LabelModel?
public var headline: LabelModel?
public var body: LabelModel?

View File

@ -10,6 +10,7 @@ import Foundation
public struct HeadlineBodyButtonModel: MoleculeModelProtocol {
public static var identifier: String = "headlineBodyButton"
public var moleculeName: String? = HeadlineBodyButtonModel.identifier
public var backgroundColor: Color?
public var headlineBody: HeadlineBodyModel

View File

@ -10,6 +10,7 @@ import Foundation
public struct HeadlineBodyLinkModel: MoleculeModelProtocol {
public static var identifier: String = "headlineBodyLink"
public var moleculeName: String? = HeadlineBodyLinkModel.identifier
public var headlineBody: HeadlineBodyModel
public var link: LinkModel
public var backgroundColor: Color?

View File

@ -10,6 +10,7 @@ import Foundation
@objcMembers public class HeadlineBodyModel: MoleculeModelProtocol {
public static var identifier: String = "headlineBody"
public var moleculeName: String? = HeadlineBodyModel.identifier
public var headline: LabelModel?
public var body: LabelModel?
public var style: String?