converted defaults to structs

Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
This commit is contained in:
Matt Bruce 2022-08-03 09:01:46 -05:00
parent 7fef4aadb7
commit ce4faadf0c
3 changed files with 18 additions and 6 deletions

View File

@ -7,6 +7,12 @@
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 static let ModelStateDebounce = 0.02
}

View File

@ -76,7 +76,7 @@ extension VDSCheckboxModel {
}
}
public class DefaultCheckboxModel: VDSCheckboxModel {
public struct DefaultCheckboxModel: VDSCheckboxModel {
public var id: String?
public var on: Bool = false
@ -102,5 +102,5 @@ public class DefaultCheckboxModel: VDSCheckboxModel {
public var accessibilityLabelEnabled: String?
public var accessibilityLabelDisabled: String?
public required init() {}
public init() {}
}

View File

@ -41,7 +41,7 @@ extension VDSToggleModel {
}
}
public class DefaultToggleModel: DefaultLabelModel, VDSToggleModel {
public struct DefaultToggleModel: VDSToggleModel {
public var id: String?
public var inputId: String?
public var showText: Bool = false
@ -49,6 +49,8 @@ public class DefaultToggleModel: DefaultLabelModel, VDSToggleModel {
public var offText: String = "Off"
public var onText: String = "On"
public var value: AnyHashable? = true
public var surface: Surface = .light
public var disabled: Bool = false
public var dataAnalyticsTrack: String?
public var dataClickStream: String?
public var dataTrack: String?
@ -59,7 +61,11 @@ public class DefaultToggleModel: DefaultLabelModel, VDSToggleModel {
public var accessibilityLabelEnabled: String?
public var accessibilityLabelDisabled: String?
public required init() {
super.init()
}
//labelmodel
public var fontCategory: VDSFontCategory = .body
public var fontSize: VDSFontSize = .small
public var fontWeight: VDSFontWeight = .regular
public var textPosition: VDSTextPosition = .left
public init() { }
}