Merge branch 'refactor/enabling' of https://gitlab.verizon.com/BPHV_MIPS/vds_ios.git into refactor/enabling

# Conflicts:
#	VDS/Classes/SelectorGroupHandlerBase.swift
#	VDS/Components/Buttons/Button/ButtonBase.swift
#	VDS/Components/Buttons/ButtonGroup/ButtonGroup.swift
#	VDS/Components/Label/Label.swift
#	VDS/Components/RadioButton/RadioButtonGroup.swift
#	VDS/Components/RadioSwatch/RadioSwatchGroup.swift
#	VDS/Components/TextFields/EntryField/EntryField.swift
#	VDS/Components/Tooltip/TrailingTooltipLabel.swift

Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
This commit is contained in:
Matt Bruce 2023-08-25 16:20:00 -05:00
commit 52b08b88c9
11 changed files with 14 additions and 23 deletions

View File

@ -33,16 +33,6 @@ open class View: UIView, ViewProtocol, UserInfoable {
/// Current Surface and this is used to pass down to child objects that implement Surfacable
open var surface: Surface = .light { didSet { setNeedsUpdate() } }
/// Whether this object is disabled or not.
open var disabled: Bool {
get { !isEnabled }
set {
if !isEnabled != newValue {
isEnabled = !newValue
}
}
}
/// Whether the View is enabled or not.
open var isEnabled: Bool = true { didSet { setNeedsUpdate() } }

View File

@ -83,7 +83,7 @@ open class ButtonBase: UIButton, Buttonable, ViewProtocol, UserInfoable, Clickab
}
}
}
/// Whether the Control is enabled or not.
open override var isEnabled: Bool { didSet { setNeedsUpdate() } }

View File

@ -110,7 +110,7 @@ open class CheckboxGroup: SelectorGroupHandlerBase<CheckboxItem> {
}
extension CheckboxGroup {
public struct CheckboxModel : Surfaceable, Disabling, Initable, FormFieldable, Errorable {
public struct CheckboxModel : Surfaceable, Initable, FormFieldable, Errorable {
/// Whether this object is disabled or not
public var disabled: Bool

View File

@ -54,7 +54,7 @@ open class Label: UILabel, ViewProtocol, UserInfoable {
setNeedsUpdate()
}
}
/// Whether the View is enabled or not.
open override var isEnabled: Bool { didSet { setNeedsUpdate() } }

View File

@ -106,7 +106,7 @@ open class RadioBoxGroup: SelectorGroupSelectedHandlerBase<RadioBoxItem> {
}
extension RadioBoxGroup {
public struct RadioBoxModel: Surfaceable, Initable, Disabling, FormFieldable {
public struct RadioBoxModel: Surfaceable, Initable, FormFieldable {
/// Whether this object is disabled or not
public var disabled: Bool
/// Current Surface and this is used to pass down to child objects that implement Surfacable

View File

@ -114,7 +114,7 @@ open class RadioButtonGroup: SelectorGroupSelectedHandlerBase<RadioButtonItem> {
}
extension RadioButtonGroup {
public struct RadioButtonModel: Surfaceable, Disabling, Initable, FormFieldable, Errorable {
public struct RadioButtonModel: Surfaceable, Initable, FormFieldable, Errorable {
/// Whether this object is disabled or not
public var disabled: Bool

View File

@ -71,6 +71,7 @@ open class RadioSwatchGroup: SelectorGroupSelectedHandlerBase<RadioSwatch>, UICo
//--------------------------------------------------
// MARK: - Overrides
//--------------------------------------------------
/// Whether this object is disabled or not
override public var isEnabled: Bool {
didSet {
@ -192,7 +193,7 @@ open class RadioSwatchGroup: SelectorGroupSelectedHandlerBase<RadioSwatch>, UICo
}
extension RadioSwatchGroup {
public struct RadioSwatchModel: Surfaceable, Disabling, Initable {
public struct RadioSwatchModel: Surfaceable, Initable {
/// Whether this object is disabled or not
public var disabled: Bool = false
/// Current Surface and this is used to pass down to child objects that implement Surfacable

View File

@ -302,7 +302,6 @@ open class EntryField: Control, Changeable {
titleLabel.attributes = attributes
titleLabel.surface = surface
titleLabel.isEnabled = isEnabled
}
open func updateErrorLabel(){

View File

@ -179,6 +179,7 @@ open class Toggle: Control, Changeable {
super.reset()
shouldUpdateView = false
label.reset()
isEnabled = true
isOn = false
isAnimated = true
showText = false

View File

@ -72,7 +72,7 @@ open class TrailingTooltipLabel: View, TooltipLaunchable {
label.attributes = labelAttributes
label.surface = surface
label.isEnabled = isEnabled
//add tooltip
if let labelText, !labelText.isEmpty {
label.addTooltip(model: .init(surface: surface, closeButtonText: tooltipCloseButtonText, title: tooltipTitle, content: tooltipContent, contentView: tooltipContentView))

View File

@ -7,8 +7,8 @@
import Foundation
/// Any object that can be disabled, which may change the appearance
public protocol Disabling {
/// Whether this object is disabled or not
var disabled: Bool { get set }
}
///// Any object that can be disabled, which may change the appearance
//public protocol Disabling {
// /// Whether this object is disabled or not
// var disabled: Bool { get set }
//}