Merge branch 'feature/FormEffects' into 'develop'

removed defaultText from entryfield. meaning if a field is disabled, the text will still show.

See merge request BPHV_MIPS/mvm_core_ui!785
This commit is contained in:
Pfeil, Scott Robert 2021-12-17 03:53:50 +00:00
commit ad483e42c5
2 changed files with 13 additions and 6 deletions

View File

@ -7,7 +7,8 @@
//
@objcMembers open class CarouselItemModel: MoleculeCollectionItemModel, CarouselItemModelProtocol, EnableableModelProtocol {
@objcMembers open class CarouselItemModel: MoleculeCollectionItemModel, CarouselItemModelProtocol {
//--------------------------------------------------
// MARK: - Properties
//--------------------------------------------------
@ -19,6 +20,9 @@
public var analyticsData: JSONValueDictionary?
public var fieldValue: String?
public var enabled: Bool = true
public var fieldKey: String?
public var groupName: String = FormValidator.defaultGroupName
public var baseValue: AnyHashable?
public func formFieldValue() -> AnyHashable? {
guard enabled else { return nil }
@ -34,6 +38,8 @@
case peakingArrowColor
case analyticsData
case fieldValue
case fieldKey
case groupName
}
//--------------------------------------------------
@ -46,6 +52,11 @@
peakingArrowColor = try typeContainer.decodeIfPresent(Color.self, forKey: .peakingArrowColor)
analyticsData = try typeContainer.decodeIfPresent(JSONValueDictionary.self, forKey: .analyticsData)
fieldValue = try typeContainer.decodeIfPresent(String.self, forKey: .fieldValue)
fieldKey = try typeContainer.decodeIfPresent(String.self, forKey: .fieldKey)
if let groupName = try typeContainer.decodeIfPresent(String.self, forKey: .groupName) {
self.groupName = groupName
}
baseValue = fieldValue
try super.init(from: decoder)
}

View File

@ -7,17 +7,13 @@
//
public protocol CarouselItemModelProtocol: ContainerModelProtocol {
public protocol CarouselItemModelProtocol: FormFieldProtocol, ContainerModelProtocol {
var analyticsData: JSONValueDictionary? { get set }
func formFieldValue() -> AnyHashable?
}
public extension CarouselItemModelProtocol {
var analyticsData: JSONValueDictionary? {
get { nil }
set { analyticsData = newValue }
}
func formFieldValue() -> AnyHashable? { nil }
}