refactored name to subTitle
Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
This commit is contained in:
parent
1d048f9389
commit
fcd4f4e0ec
@ -25,10 +25,6 @@ import VDS
|
|||||||
var fieldValue: JSONValue?
|
var fieldValue: JSONValue?
|
||||||
var groupName: String?
|
var groupName: String?
|
||||||
|
|
||||||
public var checkboxModel: CheckboxModel? {
|
|
||||||
viewModel
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Disables all selection logic when setting the value of isSelected, reducing it to a stored property.
|
/// Disables all selection logic when setting the value of isSelected, reducing it to a stored property.
|
||||||
public var updateSelectionOnly: Bool = false
|
public var updateSelectionOnly: Bool = false
|
||||||
|
|
||||||
@ -154,7 +150,7 @@ import VDS
|
|||||||
public func updateView(_ size: CGFloat) {}
|
public func updateView(_ size: CGFloat) {}
|
||||||
|
|
||||||
private func performCheckboxAction(with actionModel: ActionModelProtocol, delegateObject: MVMCoreUIDelegateObject?, additionalData: [AnyHashable: Any]?) {
|
private func performCheckboxAction(with actionModel: ActionModelProtocol, delegateObject: MVMCoreUIDelegateObject?, additionalData: [AnyHashable: Any]?) {
|
||||||
MVMCoreUIActionHandler.performActionUnstructured(with: actionModel, sourceModel: checkboxModel, additionalData: additionalData, delegateObject: delegateObject)
|
MVMCoreUIActionHandler.performActionUnstructured(with: actionModel, sourceModel: viewModel, additionalData: additionalData, delegateObject: delegateObject)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -50,9 +50,9 @@ import VDS
|
|||||||
}
|
}
|
||||||
|
|
||||||
//secondary label
|
//secondary label
|
||||||
if let subtitleModel = viewModel.subtitle {
|
if let subTitleModel = viewModel.subTitle {
|
||||||
childText = subtitleModel.text
|
childText = subTitleModel.text
|
||||||
if let attributes = subtitleModel.attributes?.toVDSLabelAttributeModel(delegateObject: delegateObject, additionalData: additionalData) {
|
if let attributes = subTitleModel.attributes?.toVDSLabelAttributeModel(delegateObject: delegateObject, additionalData: additionalData) {
|
||||||
childTextAttributes = attributes
|
childTextAttributes = attributes
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -10,12 +10,6 @@ import Foundation
|
|||||||
import MVMCore
|
import MVMCore
|
||||||
import VDS
|
import VDS
|
||||||
|
|
||||||
public enum CheckboxPosition: String, Codable {
|
|
||||||
case center
|
|
||||||
case top
|
|
||||||
case bottom
|
|
||||||
}
|
|
||||||
|
|
||||||
@objcMembers open class CheckboxLabelModel: MoleculeModelProtocol, ParentMoleculeModelProtocol {
|
@objcMembers open class CheckboxLabelModel: MoleculeModelProtocol, ParentMoleculeModelProtocol {
|
||||||
open class var identifier: String { "checkboxLabel" }
|
open class var identifier: String { "checkboxLabel" }
|
||||||
public var moleculeName: String = CheckboxLabelModel.identifier
|
public var moleculeName: String = CheckboxLabelModel.identifier
|
||||||
@ -24,23 +18,23 @@ public enum CheckboxPosition: String, Codable {
|
|||||||
public var backgroundColor: Color?
|
public var backgroundColor: Color?
|
||||||
public var checkbox: CheckboxModel
|
public var checkbox: CheckboxModel
|
||||||
public var label: LabelModel
|
public var label: LabelModel
|
||||||
public var subtitle: LabelModel?
|
public var subTitle: LabelModel?
|
||||||
public var inverted: Bool? = false
|
public var inverted: Bool? = false
|
||||||
public var surface: Surface { inverted ?? false ? .dark : .light }
|
public var surface: Surface { inverted ?? false ? .dark : .light }
|
||||||
|
|
||||||
public var children: [MoleculeModelProtocol] {
|
public var children: [MoleculeModelProtocol] {
|
||||||
guard let subtitle else { return [checkbox, label] }
|
guard let subTitle else { return [checkbox, label] }
|
||||||
return [checkbox, label, subtitle]
|
return [checkbox, label, subTitle]
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
// MARK: - Initializer
|
// MARK: - Initializer
|
||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
|
|
||||||
public init(checkbox: CheckboxModel, label: LabelModel, subtitle: LabelModel?) {
|
public init(checkbox: CheckboxModel, label: LabelModel, subTitle: LabelModel?) {
|
||||||
self.checkbox = checkbox
|
self.checkbox = checkbox
|
||||||
self.label = label
|
self.label = label
|
||||||
self.subtitle = subtitle
|
self.subTitle = subTitle
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user