diff --git a/VDS/Components/Selector/SelectorGroupBase.swift b/VDS/Components/Selector/SelectorGroupBase.swift index a0bcea69..feea9ab2 100644 --- a/VDS/Components/Selector/SelectorGroupBase.swift +++ b/VDS/Components/Selector/SelectorGroupBase.swift @@ -9,7 +9,7 @@ import Foundation import UIKit import Combine -open class SelectorGroupBase>: View, Changable where SelectorType == SelectorGroupType.SelectorType { +open class SelectorGroupBase>: View, Changable where SelectorModelType == SelectorGroupType.SelectorModelType { public var selectorViews: [SelectorHandlerType] = [] @@ -113,7 +113,7 @@ open class SelectorGroupBase SelectorType? { + public func getCachedSelector(viewModel: SelectorModelType) -> SelectorModelType? { if let index = model.selectors.firstIndex(where: { element in return element.id == viewModel.id }) { @@ -123,7 +123,7 @@ open class SelectorGroupBase: Modelable, FormFieldable, Errorable { - associatedtype SelectorType: SelectorModel - var selectors: [SelectorType] { get set } -} - -public struct DefaultSelectorGroupModel: 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 - } +public protocol SelectorGroupModel: Modelable, FormFieldable, Errorable { + associatedtype SelectorModelType: SelectorModel + var selectors: [SelectorModelType] { get set } }