updated model

Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
This commit is contained in:
Matt Bruce 2024-07-12 14:45:20 -05:00
parent cadded3217
commit 1b391272c5

View File

@ -25,6 +25,7 @@ import VDS
public var readOnly: Bool = false
public var showError: Bool?
public var errorMessage: String?
public var initialErrorMessage: String?
public var fieldKey: String?
public var groupName: String = FormValidator.defaultGroupName
@ -89,9 +90,11 @@ import VDS
if let ruleErrorMessage = errorMessage, fieldKey != nil {
self.errorMessage = ruleErrorMessage
} else {
self.errorMessage = initialErrorMessage
}
self.isValid = valid
isValid = valid
updateUI?()
}
@ -103,6 +106,7 @@ import VDS
id = try typeContainer.decodeIfPresent(String.self, forKey: .id) ?? UUID().uuidString
accessibilityIdentifier = try typeContainer.decodeIfPresent(String.self, forKey: .accessibilityIdentifier)
errorMessage = try typeContainer.decodeIfPresent(String.self, forKey: .errorMessage)
initialErrorMessage = errorMessage
enabled = try typeContainer.decodeIfPresent(Bool.self, forKey: .enabled) ?? true
required = try typeContainer.decodeIfPresent(Bool.self, forKey: .required) ?? true
readOnly = try typeContainer.decodeIfPresent(Bool.self, forKey: .readOnly) ?? false