formatting. json. updates.
This commit is contained in:
parent
6b3dd399cf
commit
af83f4f8b5
@ -1707,6 +1707,8 @@
|
|||||||
D2092348244A51D40044AD09 /* RadioSwatchModel.swift */,
|
D2092348244A51D40044AD09 /* RadioSwatchModel.swift */,
|
||||||
AAB9C109243496DD00151545 /* RadioSwatch.swift */,
|
AAB9C109243496DD00151545 /* RadioSwatch.swift */,
|
||||||
AA85236B244435A20059CC1E /* RadioSwatchCollectionViewCell.swift */,
|
AA85236B244435A20059CC1E /* RadioSwatchCollectionViewCell.swift */,
|
||||||
|
D260105223CEA61600764D80 /* ToggleModel.swift */,
|
||||||
|
0AA33B392398524F0067DD0F /* Toggle.swift */,
|
||||||
AAA7CD68250641F90045B959 /* HeartModel.swift */,
|
AAA7CD68250641F90045B959 /* HeartModel.swift */,
|
||||||
AAA7CD6A250642080045B959 /* Heart.swift */,
|
AAA7CD6A250642080045B959 /* Heart.swift */,
|
||||||
);
|
);
|
||||||
@ -2004,8 +2006,6 @@
|
|||||||
D28A838223CCBD3F00DFE4FC /* WheelModel.swift */,
|
D28A838223CCBD3F00DFE4FC /* WheelModel.swift */,
|
||||||
943784F3236B77BB006A1E82 /* Wheel.swift */,
|
943784F3236B77BB006A1E82 /* Wheel.swift */,
|
||||||
943784F4236B77BB006A1E82 /* WheelAnimationHandler.swift */,
|
943784F4236B77BB006A1E82 /* WheelAnimationHandler.swift */,
|
||||||
D260105223CEA61600764D80 /* ToggleModel.swift */,
|
|
||||||
0AA33B392398524F0067DD0F /* Toggle.swift */,
|
|
||||||
0AE98BB623FF18E9004C5109 /* ArrowModel.swift */,
|
0AE98BB623FF18E9004C5109 /* ArrowModel.swift */,
|
||||||
0AE98BB423FF18D2004C5109 /* Arrow.swift */,
|
0AE98BB423FF18D2004C5109 /* Arrow.swift */,
|
||||||
94382085243238D100B43AF3 /* WebViewModel.swift */,
|
94382085243238D100B43AF3 /* WebViewModel.swift */,
|
||||||
|
|||||||
@ -142,6 +142,7 @@ open class CaretLink: Button, MVMCoreUIViewConstrainingProtocol {
|
|||||||
backgroundColor = color.uiColor
|
backgroundColor = color.uiColor
|
||||||
}
|
}
|
||||||
|
|
||||||
|
accessibilityIdentifier = model.accessibilityIdentifier
|
||||||
enabledColor = (model.inverted ? model.enabledColor_inverted : model.enabledColor).uiColor
|
enabledColor = (model.inverted ? model.enabledColor_inverted : model.enabledColor).uiColor
|
||||||
disabledColor = (model.inverted ? model.disabledColor_inverted : model.disabledColor).uiColor
|
disabledColor = (model.inverted ? model.disabledColor_inverted : model.disabledColor).uiColor
|
||||||
|
|
||||||
|
|||||||
@ -241,6 +241,7 @@ class TextViewEntryField: EntryField, UITextViewDelegate, ObservingTextFieldDele
|
|||||||
|
|
||||||
textView.isEditable = model.editable
|
textView.isEditable = model.editable
|
||||||
textView.textAlignment = model.textAlignment
|
textView.textAlignment = model.textAlignment
|
||||||
|
textView.accessibilityIdentifier = model.accessibilityIdentifier
|
||||||
textView.textColor = model.enabled ? model.enabledTextColor.uiColor : model.disabledTextColor.uiColor
|
textView.textColor = model.enabled ? model.enabledTextColor.uiColor : model.disabledTextColor.uiColor
|
||||||
textView.font = model.fontStyle.getFont()
|
textView.font = model.fontStyle.getFont()
|
||||||
textView.placeholder = model.placeholder ?? ""
|
textView.placeholder = model.placeholder ?? ""
|
||||||
@ -258,7 +259,7 @@ class TextViewEntryField: EntryField, UITextViewDelegate, ObservingTextFieldDele
|
|||||||
case .email:
|
case .email:
|
||||||
textView.keyboardType = .emailAddress
|
textView.keyboardType = .emailAddress
|
||||||
|
|
||||||
default: break
|
default: break
|
||||||
}
|
}
|
||||||
|
|
||||||
/// No point in configuring if the TextView is Read-only.
|
/// No point in configuring if the TextView is Read-only.
|
||||||
|
|||||||
@ -40,7 +40,7 @@ public typealias ActionBlockConfirmation = () -> (Bool)
|
|||||||
|
|
||||||
/// Executes logic before state change. If false, then toggle state will not change and the didToggleAction will not execute.
|
/// Executes logic before state change. If false, then toggle state will not change and the didToggleAction will not execute.
|
||||||
public var shouldToggleAction: ActionBlockConfirmation? = {
|
public var shouldToggleAction: ActionBlockConfirmation? = {
|
||||||
return { return true }
|
return { true }
|
||||||
}()
|
}()
|
||||||
|
|
||||||
// Sizes are from InVision design specs.
|
// Sizes are from InVision design specs.
|
||||||
@ -69,9 +69,7 @@ public typealias ActionBlockConfirmation = () -> (Bool)
|
|||||||
|
|
||||||
/// Simple means to prevent user interaction with the toggle.
|
/// Simple means to prevent user interaction with the toggle.
|
||||||
public var isLocked: Bool = false {
|
public var isLocked: Bool = false {
|
||||||
didSet {
|
didSet { isUserInteractionEnabled = !isLocked }
|
||||||
isUserInteractionEnabled = !isLocked
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// The state on the toggle. Default value: false.
|
/// The state on the toggle. Default value: false.
|
||||||
@ -109,7 +107,7 @@ public typealias ActionBlockConfirmation = () -> (Bool)
|
|||||||
}
|
}
|
||||||
|
|
||||||
public var toggleModel: ToggleModel? {
|
public var toggleModel: ToggleModel? {
|
||||||
return model as? ToggleModel
|
model as? ToggleModel
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
@ -414,18 +412,14 @@ public typealias ActionBlockConfirmation = () -> (Bool)
|
|||||||
}
|
}
|
||||||
|
|
||||||
public override class func estimatedHeight(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?) -> CGFloat? {
|
public override class func estimatedHeight(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?) -> CGFloat? {
|
||||||
return Self.getContainerHeight()
|
Self.getContainerHeight()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// MARK: - MVMCoreUIViewConstrainingProtocol
|
// MARK: - MVMCoreUIViewConstrainingProtocol
|
||||||
extension Toggle {
|
extension Toggle {
|
||||||
|
|
||||||
public func needsToBeConstrained() -> Bool {
|
public func needsToBeConstrained() -> Bool { true }
|
||||||
return true
|
|
||||||
}
|
|
||||||
|
|
||||||
public func horizontalAlignment() -> UIStackView.Alignment {
|
public func horizontalAlignment() -> UIStackView.Alignment { .trailing }
|
||||||
return .trailing
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@ -6,8 +6,6 @@
|
|||||||
// Copyright © 2020 Verizon Wireless. All rights reserved.
|
// Copyright © 2020 Verizon Wireless. All rights reserved.
|
||||||
//
|
//
|
||||||
|
|
||||||
import UIKit
|
|
||||||
|
|
||||||
|
|
||||||
public class ToggleModel: MoleculeModelProtocol, FormFieldProtocol, EnableableModelProtocol {
|
public class ToggleModel: MoleculeModelProtocol, FormFieldProtocol, EnableableModelProtocol {
|
||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
@ -15,6 +13,7 @@ public class ToggleModel: MoleculeModelProtocol, FormFieldProtocol, EnableableMo
|
|||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
|
|
||||||
public static var identifier: String = "toggle"
|
public static var identifier: String = "toggle"
|
||||||
|
public var accessibilityIdentifier: String?
|
||||||
public var backgroundColor: Color?
|
public var backgroundColor: Color?
|
||||||
public var state: Bool = false
|
public var state: Bool = false
|
||||||
public var animated: Bool = true
|
public var animated: Bool = true
|
||||||
@ -42,6 +41,7 @@ public class ToggleModel: MoleculeModelProtocol, FormFieldProtocol, EnableableMo
|
|||||||
case enabled
|
case enabled
|
||||||
case action
|
case action
|
||||||
case backgroundColor
|
case backgroundColor
|
||||||
|
case accessibilityIdentifier
|
||||||
case alternateAction
|
case alternateAction
|
||||||
case accessibilityText
|
case accessibilityText
|
||||||
case onTintColor
|
case onTintColor
|
||||||
@ -56,9 +56,7 @@ public class ToggleModel: MoleculeModelProtocol, FormFieldProtocol, EnableableMo
|
|||||||
// MARK: - Methods
|
// MARK: - Methods
|
||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
|
|
||||||
public func formFieldValue() -> AnyHashable? {
|
public func formFieldValue() -> AnyHashable? { state }
|
||||||
return state
|
|
||||||
}
|
|
||||||
|
|
||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
// MARK: - Initializer
|
// MARK: - Initializer
|
||||||
@ -91,6 +89,7 @@ public class ToggleModel: MoleculeModelProtocol, FormFieldProtocol, EnableableMo
|
|||||||
action = try typeContainer.decodeModelIfPresent(codingKey: .action)
|
action = try typeContainer.decodeModelIfPresent(codingKey: .action)
|
||||||
alternateAction = try typeContainer.decodeModelIfPresent(codingKey: .alternateAction)
|
alternateAction = try typeContainer.decodeModelIfPresent(codingKey: .alternateAction)
|
||||||
backgroundColor = try typeContainer.decodeIfPresent(Color.self, forKey: .backgroundColor)
|
backgroundColor = try typeContainer.decodeIfPresent(Color.self, forKey: .backgroundColor)
|
||||||
|
accessibilityIdentifier = try typeContainer.decodeIfPresent(String.self, forKey: .accessibilityIdentifier)
|
||||||
|
|
||||||
if let onTintColor = try typeContainer.decodeIfPresent(Color.self, forKey: .onTintColor) {
|
if let onTintColor = try typeContainer.decodeIfPresent(Color.self, forKey: .onTintColor) {
|
||||||
self.onTintColor = onTintColor
|
self.onTintColor = onTintColor
|
||||||
@ -120,6 +119,7 @@ public class ToggleModel: MoleculeModelProtocol, FormFieldProtocol, EnableableMo
|
|||||||
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(backgroundColor, forKey: .backgroundColor)
|
try container.encodeIfPresent(backgroundColor, forKey: .backgroundColor)
|
||||||
|
try container.encodeIfPresent(accessibilityIdentifier, forKey: .accessibilityIdentifier)
|
||||||
try container.encodeModelIfPresent(action, forKey: .action)
|
try container.encodeModelIfPresent(action, forKey: .action)
|
||||||
try container.encodeModelIfPresent(alternateAction, forKey: .alternateAction)
|
try container.encodeModelIfPresent(alternateAction, forKey: .alternateAction)
|
||||||
try container.encode(moleculeName, forKey: .moleculeName)
|
try container.encode(moleculeName, forKey: .moleculeName)
|
||||||
@ -12,9 +12,7 @@ open class LabelAttributeActionModel: LabelAttributeModel {
|
|||||||
// MARK: - Properties
|
// MARK: - Properties
|
||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
|
|
||||||
override public class var identifier: String {
|
override public class var identifier: String { "action" }
|
||||||
return "action"
|
|
||||||
}
|
|
||||||
|
|
||||||
var action: ActionModelProtocol
|
var action: ActionModelProtocol
|
||||||
|
|
||||||
|
|||||||
@ -12,9 +12,7 @@
|
|||||||
// MARK: - Properties
|
// MARK: - Properties
|
||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
|
|
||||||
override public class var identifier: String {
|
override public class var identifier: String { "color" }
|
||||||
return "color"
|
|
||||||
}
|
|
||||||
|
|
||||||
var textColor: Color?
|
var textColor: Color?
|
||||||
|
|
||||||
|
|||||||
@ -12,9 +12,7 @@
|
|||||||
// MARK: - Properties
|
// MARK: - Properties
|
||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
|
|
||||||
override public class var identifier: String {
|
override public class var identifier: String { "font" }
|
||||||
return "font"
|
|
||||||
}
|
|
||||||
|
|
||||||
var style: Styler.Font?
|
var style: Styler.Font?
|
||||||
var name: String?
|
var name: String?
|
||||||
|
|||||||
@ -12,9 +12,7 @@ class LabelAttributeImageModel: LabelAttributeModel {
|
|||||||
// MARK: - Properties
|
// MARK: - Properties
|
||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
|
|
||||||
override public class var identifier: String {
|
override public class var identifier: String { "image" }
|
||||||
return "image"
|
|
||||||
}
|
|
||||||
|
|
||||||
var size: CGFloat?
|
var size: CGFloat?
|
||||||
var name: String?
|
var name: String?
|
||||||
|
|||||||
@ -12,9 +12,7 @@
|
|||||||
// MARK: - Properties
|
// MARK: - Properties
|
||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
|
|
||||||
public static var categoryName: String {
|
public static var categoryName: String { "\(LabelAttributeModel.self)" }
|
||||||
"\(LabelAttributeModel.self)"
|
|
||||||
}
|
|
||||||
|
|
||||||
public static var categoryCodingKey: String { "type" }
|
public static var categoryCodingKey: String { "type" }
|
||||||
|
|
||||||
|
|||||||
@ -12,9 +12,7 @@
|
|||||||
// MARK: - Properties
|
// MARK: - Properties
|
||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
|
|
||||||
override public class var identifier: String {
|
override public class var identifier: String { "strikethrough" }
|
||||||
return "strikethrough"
|
|
||||||
}
|
|
||||||
|
|
||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
// MARK: - Initializer
|
// MARK: - Initializer
|
||||||
|
|||||||
@ -14,9 +14,7 @@ import UIKit
|
|||||||
// MARK: - Properties
|
// MARK: - Properties
|
||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
|
|
||||||
override public class var identifier: String {
|
override public class var identifier: String { "underline" }
|
||||||
return "underline"
|
|
||||||
}
|
|
||||||
|
|
||||||
/// This returns the NSUnderlineStyle used in NSAttributedValue. If there is a pattern, it will return
|
/// This returns the NSUnderlineStyle used in NSAttributedValue. If there is a pattern, it will return
|
||||||
/// a new NSUnderlineStyle derived from the bitmask of style | pattern.
|
/// a new NSUnderlineStyle derived from the bitmask of style | pattern.
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user