added isEqual to RadioButton variations
Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
This commit is contained in:
parent
c40dc5e396
commit
878fd11c8a
@ -83,4 +83,18 @@ open class RadioButtonModel: FormFieldModel {
|
||||
try container.encodeIfPresent(fieldValue, forKey: .fieldValue)
|
||||
try container.encodeModelIfPresent(action, forKey: .action)
|
||||
}
|
||||
|
||||
open override func isEqual(to model: any ModelComparisonProtocol) -> Bool {
|
||||
guard super.isEqual(to: model), let model = model as? Self else { return false }
|
||||
return state == model.state
|
||||
&& fieldValue == model.fieldValue
|
||||
&& action.isEqual(to: model.action)
|
||||
}
|
||||
|
||||
open override func isVisuallyEquivalent(to model: any MoleculeModelComparisonProtocol) -> Bool {
|
||||
guard super.isVisuallyEquivalent(to: model), let model = model as? Self else { return false }
|
||||
return state == model.state
|
||||
&& fieldValue == model.fieldValue
|
||||
&& action.isEqual(to: model.action)
|
||||
}
|
||||
}
|
||||
|
||||
@ -69,4 +69,14 @@ public class RadioButtonsModel: FormFieldModel {
|
||||
var container = encoder.container(keyedBy: CodingKeys.self)
|
||||
try container.encode(radioButtons, forKey: .radioButtons)
|
||||
}
|
||||
|
||||
open override func isEqual(to model: any ModelComparisonProtocol) -> Bool {
|
||||
guard super.isEqual(to: model), let model = model as? Self else { return false }
|
||||
return radioButtons == radioButtons
|
||||
}
|
||||
|
||||
open override func isVisuallyEquivalent(to model: any MoleculeModelComparisonProtocol) -> Bool {
|
||||
guard super.isVisuallyEquivalent(to: model), let model = model as? Self else { return false }
|
||||
return radioButtons == radioButtons
|
||||
}
|
||||
}
|
||||
|
||||
@ -40,6 +40,30 @@ import VDS
|
||||
self.label = label
|
||||
self.subTitle = subTitle
|
||||
}
|
||||
|
||||
open func isEqual(to model: any ModelComparisonProtocol) -> Bool {
|
||||
guard let model = model as? Self else { return false }
|
||||
return moleculeName == model.moleculeName
|
||||
&& inverted == model.inverted
|
||||
&& accessibilityText == model.accessibilityText
|
||||
&& accessibilityIdentifier == model.accessibilityIdentifier
|
||||
&& accessibilityTraits == model.accessibilityTraits
|
||||
&& radioButton == model.radioButton
|
||||
&& label == model.label
|
||||
&& subTitle == model.subTitle
|
||||
}
|
||||
|
||||
open func isVisuallyEquivalent(to model: any MoleculeModelComparisonProtocol) -> Bool {
|
||||
guard let model = model as? Self else { return false }
|
||||
return moleculeName == model.moleculeName
|
||||
&& inverted == model.inverted
|
||||
&& accessibilityText == model.accessibilityText
|
||||
&& accessibilityIdentifier == model.accessibilityIdentifier
|
||||
&& accessibilityTraits == model.accessibilityTraits
|
||||
&& radioButton == model.radioButton
|
||||
&& label == model.label
|
||||
&& subTitle == model.subTitle
|
||||
}
|
||||
}
|
||||
|
||||
extension Array where Element == RadioButtonLabelModel {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user