added isEqual to Checkbox variations
Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
This commit is contained in:
parent
b70d2f8add
commit
f94ddbf866
@ -94,4 +94,18 @@ import VDS
|
|||||||
try container.encodeModelIfPresent(action, forKey: .action)
|
try container.encodeModelIfPresent(action, forKey: .action)
|
||||||
try container.encodeModelIfPresent(offAction, forKey: .offAction)
|
try container.encodeModelIfPresent(offAction, forKey: .offAction)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
open override func isEqual(to model: any ModelComparisonProtocol) -> Bool {
|
||||||
|
guard super.isEqual(to: model), let model = model as? Self else { return false }
|
||||||
|
return selected == model.selected
|
||||||
|
&& animated == model.animated
|
||||||
|
&& offAction.isEqual(to: model.offAction)
|
||||||
|
&& 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 selected == model.selected
|
||||||
|
&& animated == model.animated
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -82,4 +82,32 @@ public class CheckboxesModel: MoleculeModelProtocol {
|
|||||||
try container.encode(inverted, forKey: .inverted)
|
try container.encode(inverted, forKey: .inverted)
|
||||||
try container.encode(checkboxes, forKey: .checkboxes)
|
try container.encode(checkboxes, forKey: .checkboxes)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
open func isEqual(to model: any ModelComparisonProtocol) -> Bool {
|
||||||
|
guard let model = model as? Self else { return false }
|
||||||
|
return moleculeName == model.moleculeName
|
||||||
|
&& enabled == model.enabled
|
||||||
|
&& showError == model.showError
|
||||||
|
&& readOnly == model.readOnly
|
||||||
|
&& required == model.required
|
||||||
|
&& inverted == model.inverted
|
||||||
|
&& accessibilityText == model.accessibilityText
|
||||||
|
&& accessibilityIdentifier == model.accessibilityIdentifier
|
||||||
|
&& accessibilityTraits == model.accessibilityTraits
|
||||||
|
&& checkboxes == model.checkboxes
|
||||||
|
}
|
||||||
|
|
||||||
|
open func isVisuallyEquivalent(to model: any MoleculeModelComparisonProtocol) -> Bool {
|
||||||
|
guard let model = model as? Self else { return false }
|
||||||
|
return moleculeName == model.moleculeName
|
||||||
|
&& enabled == model.enabled
|
||||||
|
&& showError == model.showError
|
||||||
|
&& readOnly == model.readOnly
|
||||||
|
&& required == model.required
|
||||||
|
&& inverted == model.inverted
|
||||||
|
&& accessibilityText == model.accessibilityText
|
||||||
|
&& accessibilityIdentifier == model.accessibilityIdentifier
|
||||||
|
&& accessibilityTraits == model.accessibilityTraits
|
||||||
|
&& checkboxes == model.checkboxes
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -36,6 +36,30 @@ import VDS
|
|||||||
self.label = label
|
self.label = label
|
||||||
self.subTitle = subTitle
|
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
|
||||||
|
&& checkbox == model.checkbox
|
||||||
|
&& 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
|
||||||
|
&& checkbox == model.checkbox
|
||||||
|
&& label == model.label
|
||||||
|
&& subTitle == model.subTitle
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
extension Array where Element == CheckboxLabelModel {
|
extension Array where Element == CheckboxLabelModel {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user