vds_ios/VDS/Components/Selector/SelectorGroupModel.swift
Matt Bruce 9d440aaeac refactored to hasError
Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
2022-08-11 17:30:54 -05:00

30 lines
839 B
Swift

//
// SelectorGroupModel.swift
// VDS
//
// Created by Matt Bruce on 8/11/22.
//
import Foundation
public protocol SelectorGroupModel<SelectorType>: Modelable, FormFieldable, Errorable {
associatedtype SelectorType: SelectorModel
var selectors: [SelectorType] { get set }
}
public struct DefaultSelectorGroupModel<SelectorType: SelectorModel>: SelectorGroupModel {
public var id: UUID = UUID()
public var inputId: String?
public var value: AnyHashable?
public var surface: Surface = .light
public var hasError: Bool = false
public var errorText: String?
public var disabled: Bool = false
public var selectedModel: SelectorType?
public var selectors: [SelectorType]
public init() { selectors = [] }
public init(selectors: [SelectorType]){
self.selectors = selectors
}
}