moleculeName
This commit is contained in:
parent
6de4fc4864
commit
438661dfe1
@ -20,7 +20,6 @@ public enum ButtonSize: String, Codable {
|
|||||||
|
|
||||||
public class ButtonModel: ButtonModelProtocol, MoleculeModelProtocol {
|
public class ButtonModel: ButtonModelProtocol, MoleculeModelProtocol {
|
||||||
public static var identifier: String = "button"
|
public static var identifier: String = "button"
|
||||||
public var moleculeName: String?
|
|
||||||
public var backgroundColor: Color?
|
public var backgroundColor: Color?
|
||||||
public var title: String
|
public var title: String
|
||||||
public var action: ActionModelProtocol
|
public var action: ActionModelProtocol
|
||||||
@ -39,14 +38,14 @@ public class ButtonModel: ButtonModelProtocol, MoleculeModelProtocol {
|
|||||||
init(with title: String, action: ActionModelProtocol) {
|
init(with title: String, action: ActionModelProtocol) {
|
||||||
self.title = title
|
self.title = title
|
||||||
self.action = action
|
self.action = action
|
||||||
moleculeName = Self.identifier
|
//moleculeName = Self.identifier
|
||||||
}
|
}
|
||||||
|
|
||||||
init(secondaryButtonWith title: String, action: ActionModelProtocol) {
|
init(secondaryButtonWith title: String, action: ActionModelProtocol) {
|
||||||
self.title = title
|
self.title = title
|
||||||
self.action = action
|
self.action = action
|
||||||
style = .secondary
|
style = .secondary
|
||||||
moleculeName = Self.identifier
|
//moleculeName = Self.identifier
|
||||||
}
|
}
|
||||||
|
|
||||||
init(primaryButtonWith title: String, action: ActionModelProtocol) {
|
init(primaryButtonWith title: String, action: ActionModelProtocol) {
|
||||||
@ -75,7 +74,6 @@ public class ButtonModel: ButtonModelProtocol, MoleculeModelProtocol {
|
|||||||
|
|
||||||
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.decode(String.self, forKey: .title)
|
title = try typeContainer.decode(String.self, forKey: .title)
|
||||||
|
|||||||
@ -11,7 +11,6 @@ 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?
|
|
||||||
public var image: String
|
public var image: String
|
||||||
public var accessibilityText: String?
|
public var accessibilityText: String?
|
||||||
public var fallbackImage: String?
|
public var fallbackImage: String?
|
||||||
@ -38,6 +37,5 @@ import Foundation
|
|||||||
|
|
||||||
public init(image: String) {
|
public init(image: String) {
|
||||||
self.image = image
|
self.image = image
|
||||||
moleculeName = Self.identifier
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -11,9 +11,7 @@ import Foundation
|
|||||||
|
|
||||||
@objcMembers public class LabelModel: MoleculeModelProtocol {
|
@objcMembers public class LabelModel: MoleculeModelProtocol {
|
||||||
public static var identifier: String = "label"
|
public static var identifier: String = "label"
|
||||||
public var moleculeName: String?
|
|
||||||
public var backgroundColor: Color?
|
public var backgroundColor: Color?
|
||||||
|
|
||||||
public var text: String
|
public var text: String
|
||||||
public var accessibilityText: String?
|
public var accessibilityText: String?
|
||||||
public var textColor: String?
|
public var textColor: String?
|
||||||
@ -48,12 +46,10 @@ import Foundation
|
|||||||
|
|
||||||
public init(text: String) {
|
public init(text: String) {
|
||||||
self.text = text
|
self.text = text
|
||||||
moleculeName = Self.identifier
|
|
||||||
}
|
}
|
||||||
|
|
||||||
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)
|
|
||||||
text = try typeContainer.decode(String.self, forKey: .text)
|
text = try typeContainer.decode(String.self, forKey: .text)
|
||||||
accessibilityText = try typeContainer.decodeIfPresent(String.self, forKey: .accessibilityText)
|
accessibilityText = try typeContainer.decodeIfPresent(String.self, forKey: .accessibilityText)
|
||||||
textColor = try typeContainer.decodeIfPresent(String.self, forKey: .textColor)
|
textColor = try typeContainer.decodeIfPresent(String.self, forKey: .textColor)
|
||||||
|
|||||||
@ -12,7 +12,6 @@ import Foundation
|
|||||||
@objcMembers public class FooterModel: MoleculeContainerModel, MoleculeModelProtocol {
|
@objcMembers public class FooterModel: MoleculeContainerModel, MoleculeModelProtocol {
|
||||||
public static var identifier: String = "footer"
|
public static var identifier: String = "footer"
|
||||||
public var backgroundColor: Color?
|
public var backgroundColor: Color?
|
||||||
public var moleculeName: String?
|
|
||||||
|
|
||||||
private enum CodingKeys: String, CodingKey {
|
private enum CodingKeys: String, CodingKey {
|
||||||
case moleculeName
|
case moleculeName
|
||||||
@ -38,7 +37,6 @@ import Foundation
|
|||||||
public override init(with moleculeModel: MoleculeModelProtocol) {
|
public override init(with moleculeModel: MoleculeModelProtocol) {
|
||||||
super.init(with: moleculeModel)
|
super.init(with: moleculeModel)
|
||||||
setDefaults()
|
setDefaults()
|
||||||
moleculeName = Self.identifier
|
|
||||||
}
|
}
|
||||||
|
|
||||||
required public init(from decoder: Decoder) throws {
|
required public init(from decoder: Decoder) throws {
|
||||||
|
|||||||
@ -10,7 +10,6 @@ import UIKit
|
|||||||
|
|
||||||
public class TwoButtonViewModel: MoleculeModelProtocol {
|
public class TwoButtonViewModel: MoleculeModelProtocol {
|
||||||
public static var identifier: String = "twoButtonView"
|
public static var identifier: String = "twoButtonView"
|
||||||
public var moleculeName: String?
|
|
||||||
public var backgroundColor: Color?
|
public var backgroundColor: Color?
|
||||||
public var primaryButton: ButtonModel?
|
public var primaryButton: ButtonModel?
|
||||||
public var secondaryButton: ButtonModel?
|
public var secondaryButton: ButtonModel?
|
||||||
@ -22,9 +21,7 @@ public class TwoButtonViewModel: MoleculeModelProtocol {
|
|||||||
case secondaryButton
|
case secondaryButton
|
||||||
}
|
}
|
||||||
|
|
||||||
init() {
|
init() { }
|
||||||
moleculeName = Self.identifier
|
|
||||||
}
|
|
||||||
|
|
||||||
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)
|
||||||
|
|||||||
@ -13,7 +13,6 @@ import Foundation
|
|||||||
public var backgroundColor: Color?
|
public var backgroundColor: Color?
|
||||||
public var spacing: CGFloat?
|
public var spacing: CGFloat?
|
||||||
public var percent: Int?
|
public var percent: Int?
|
||||||
public var moleculeName: String?
|
|
||||||
public var gone: Bool = false
|
public var gone: Bool = false
|
||||||
|
|
||||||
private enum CodingKeys: String, CodingKey {
|
private enum CodingKeys: String, CodingKey {
|
||||||
@ -25,7 +24,6 @@ import Foundation
|
|||||||
|
|
||||||
public override init(with moleculeModel: MoleculeModelProtocol) {
|
public override init(with moleculeModel: MoleculeModelProtocol) {
|
||||||
super.init(with: moleculeModel)
|
super.init(with: moleculeModel)
|
||||||
moleculeName = Self.identifier
|
|
||||||
}
|
}
|
||||||
|
|
||||||
required public init(from decoder: Decoder) throws {
|
required public init(from decoder: Decoder) throws {
|
||||||
|
|||||||
@ -10,7 +10,6 @@ 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?
|
|
||||||
public var headline: LabelModel?
|
public var headline: LabelModel?
|
||||||
public var body: LabelModel?
|
public var body: LabelModel?
|
||||||
public var style: String?
|
public var style: String?
|
||||||
@ -18,6 +17,5 @@ import Foundation
|
|||||||
|
|
||||||
public init(headline: LabelModel) {
|
public init(headline: LabelModel) {
|
||||||
self.headline = headline
|
self.headline = headline
|
||||||
moleculeName = Self.identifier
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user