converted defaults to structs
Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
This commit is contained in:
parent
7fef4aadb7
commit
ce4faadf0c
@ -7,6 +7,12 @@
|
|||||||
|
|
||||||
import Foundation
|
import Foundation
|
||||||
|
|
||||||
|
public func updated <T> (_ value: T, with update: (inout T) -> Void) -> T {
|
||||||
|
var editable = value
|
||||||
|
update(&editable)
|
||||||
|
return editable
|
||||||
|
}
|
||||||
|
|
||||||
public struct VDSConstants {
|
public struct VDSConstants {
|
||||||
public static let ModelStateDebounce = 0.02
|
public static let ModelStateDebounce = 0.02
|
||||||
}
|
}
|
||||||
|
|||||||
@ -76,7 +76,7 @@ extension VDSCheckboxModel {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public class DefaultCheckboxModel: VDSCheckboxModel {
|
public struct DefaultCheckboxModel: VDSCheckboxModel {
|
||||||
public var id: String?
|
public var id: String?
|
||||||
public var on: Bool = false
|
public var on: Bool = false
|
||||||
|
|
||||||
@ -102,5 +102,5 @@ public class DefaultCheckboxModel: VDSCheckboxModel {
|
|||||||
public var accessibilityLabelEnabled: String?
|
public var accessibilityLabelEnabled: String?
|
||||||
public var accessibilityLabelDisabled: String?
|
public var accessibilityLabelDisabled: String?
|
||||||
|
|
||||||
public required init() {}
|
public init() {}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -41,7 +41,7 @@ extension VDSToggleModel {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public class DefaultToggleModel: DefaultLabelModel, VDSToggleModel {
|
public struct DefaultToggleModel: VDSToggleModel {
|
||||||
public var id: String?
|
public var id: String?
|
||||||
public var inputId: String?
|
public var inputId: String?
|
||||||
public var showText: Bool = false
|
public var showText: Bool = false
|
||||||
@ -49,6 +49,8 @@ public class DefaultToggleModel: DefaultLabelModel, VDSToggleModel {
|
|||||||
public var offText: String = "Off"
|
public var offText: String = "Off"
|
||||||
public var onText: String = "On"
|
public var onText: String = "On"
|
||||||
public var value: AnyHashable? = true
|
public var value: AnyHashable? = true
|
||||||
|
public var surface: Surface = .light
|
||||||
|
public var disabled: Bool = false
|
||||||
public var dataAnalyticsTrack: String?
|
public var dataAnalyticsTrack: String?
|
||||||
public var dataClickStream: String?
|
public var dataClickStream: String?
|
||||||
public var dataTrack: String?
|
public var dataTrack: String?
|
||||||
@ -59,7 +61,11 @@ public class DefaultToggleModel: DefaultLabelModel, VDSToggleModel {
|
|||||||
public var accessibilityLabelEnabled: String?
|
public var accessibilityLabelEnabled: String?
|
||||||
public var accessibilityLabelDisabled: String?
|
public var accessibilityLabelDisabled: String?
|
||||||
|
|
||||||
public required init() {
|
//labelmodel
|
||||||
super.init()
|
public var fontCategory: VDSFontCategory = .body
|
||||||
}
|
public var fontSize: VDSFontSize = .small
|
||||||
|
public var fontWeight: VDSFontWeight = .regular
|
||||||
|
public var textPosition: VDSTextPosition = .left
|
||||||
|
|
||||||
|
public init() { }
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user