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