29 lines
805 B
Swift
29 lines
805 B
Swift
//
|
|
// SelectorGroupModel.swift
|
|
// VDS
|
|
//
|
|
// Created by Matt Bruce on 8/11/22.
|
|
//
|
|
|
|
import Foundation
|
|
|
|
public protocol SelectorGroupModel<SelectorType>: Modelable, FormFieldable {
|
|
associatedtype SelectorType: SelectorModel
|
|
var selectedModel: SelectorType? { get set }
|
|
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 disabled: Bool = false
|
|
public var selectedModel: SelectorType?
|
|
public var selectors: [SelectorType]
|
|
public init() { selectors = [] }
|
|
public init(selectors: [SelectorType]){
|
|
self.selectors = selectors
|
|
}
|
|
}
|