public to open
Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
This commit is contained in:
parent
4aa2e0d929
commit
56c2217b0c
@ -26,8 +26,8 @@ public typealias ObjectColorable = Colorable & Initable & ObjectWithable
|
||||
/// You can pass in a Surfaceable object and this will return the corresponding Color based on the object's surface property.
|
||||
open class SurfaceColorConfiguration: ObjectColorable {
|
||||
public typealias ObjectType = Surfaceable
|
||||
public var lightColor: UIColor = .clear
|
||||
public var darkColor: UIColor = .clear
|
||||
open var lightColor: UIColor = .clear
|
||||
open var darkColor: UIColor = .clear
|
||||
|
||||
required public init(){}
|
||||
|
||||
|
||||
@ -17,9 +17,9 @@ open class Control: UIControl, Handlerable, ViewProtocol, Resettable, UserInfoab
|
||||
// MARK: - Combine Properties
|
||||
//--------------------------------------------------
|
||||
/// Set of Subscribers for any Publishers for this Control.
|
||||
public var subscribers = Set<AnyCancellable>()
|
||||
open var subscribers = Set<AnyCancellable>()
|
||||
|
||||
public var onClickSubscriber: AnyCancellable? {
|
||||
open var onClickSubscriber: AnyCancellable? {
|
||||
willSet {
|
||||
if let onClickSubscriber {
|
||||
onClickSubscriber.cancel()
|
||||
@ -40,6 +40,7 @@ open class Control: UIControl, Handlerable, ViewProtocol, Resettable, UserInfoab
|
||||
/// 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 {
|
||||
@ -52,7 +53,7 @@ open class Control: UIControl, Handlerable, ViewProtocol, Resettable, UserInfoab
|
||||
/// Override for isSelected to handle setNeedsUpdate() on changes.
|
||||
open override var isSelected: Bool { didSet { setNeedsUpdate() } }
|
||||
|
||||
public var touchUpInsideCount: Int = 0
|
||||
open var touchUpInsideCount: Int = 0
|
||||
|
||||
var isHighlightAnimating = false
|
||||
|
||||
|
||||
@ -20,7 +20,7 @@ public protocol SelectorControlable: Control, Changeable {
|
||||
|
||||
open class SelectorBase: Control, SelectorControlable {
|
||||
|
||||
public var onChangeSubscriber: AnyCancellable? {
|
||||
open var onChangeSubscriber: AnyCancellable? {
|
||||
willSet {
|
||||
if let onChangeSubscriber {
|
||||
onChangeSubscriber.cancel()
|
||||
|
||||
@ -17,10 +17,10 @@ open class SelectorGroupHandlerBase<HandlerType: Control>: Control, Changeable {
|
||||
//--------------------------------------------------
|
||||
|
||||
/// Array of the HandlerType registered.
|
||||
public var selectorViews: [HandlerType] = []
|
||||
open var selectorViews: [HandlerType] = []
|
||||
|
||||
/// The primary subscriber for onChange or the UIControl valueChanged event.
|
||||
public var onChangeSubscriber: AnyCancellable? {
|
||||
open var onChangeSubscriber: AnyCancellable? {
|
||||
willSet {
|
||||
if let onChangeSubscriber {
|
||||
onChangeSubscriber.cancel()
|
||||
@ -28,8 +28,8 @@ open class SelectorGroupHandlerBase<HandlerType: Control>: Control, Changeable {
|
||||
}
|
||||
}
|
||||
|
||||
/// Override to update the child SelectorViews disabled property for this group.
|
||||
override public var disabled: Bool {
|
||||
/// Whether this object is disabled or not
|
||||
override open var disabled: Bool {
|
||||
didSet {
|
||||
selectorViews.forEach { handler in
|
||||
handler.disabled = disabled
|
||||
@ -38,7 +38,7 @@ open class SelectorGroupHandlerBase<HandlerType: Control>: Control, Changeable {
|
||||
}
|
||||
|
||||
/// Current Surface and this is used to pass down to child objects that implement Surfacable.
|
||||
override public var surface: Surface {
|
||||
override open var surface: Surface {
|
||||
didSet {
|
||||
selectorViews.forEach { handler in
|
||||
handler.surface = surface
|
||||
@ -57,7 +57,7 @@ open class SelectorGroupHandlerBase<HandlerType: Control>: Control, Changeable {
|
||||
}
|
||||
|
||||
/// Helper method to execute the valueChanged event.
|
||||
public func valueChanged() {
|
||||
open func valueChanged() {
|
||||
DispatchQueue.main.asyncAfter(deadline: .now() + .milliseconds(100)) { [weak self] in
|
||||
self?.sendActions(for: .valueChanged)
|
||||
}
|
||||
|
||||
@ -18,7 +18,7 @@ open class View: UIView, Handlerable, ViewProtocol, Resettable, UserInfoable {
|
||||
// MARK: - Combine Properties
|
||||
//--------------------------------------------------
|
||||
/// Set of Subscribers for any Publishers for this Control.
|
||||
public var subscribers = Set<AnyCancellable>()
|
||||
open var subscribers = Set<AnyCancellable>()
|
||||
|
||||
//--------------------------------------------------
|
||||
// MARK: - Properties
|
||||
|
||||
@ -149,6 +149,7 @@ open class Button: ButtonBase, Useable {
|
||||
return CGSize(width: width > size.minimumWidth ? width : size.minimumWidth, height: size.height)
|
||||
}
|
||||
|
||||
/// Function used to make changes to the View based off a change events or from local properties.
|
||||
open override func updateView() {
|
||||
super.updateView()
|
||||
let bgColor = backgroundColorConfiguration.getColor(self)
|
||||
|
||||
@ -29,9 +29,9 @@ open class ButtonBase: UIButton, Buttonable, Handlerable, ViewProtocol, Resettab
|
||||
// MARK: - Combine Properties
|
||||
//--------------------------------------------------
|
||||
/// Set of Subscribers for any Publishers for this Control.
|
||||
public var subscribers = Set<AnyCancellable>()
|
||||
open var subscribers = Set<AnyCancellable>()
|
||||
|
||||
public var onClickSubscriber: AnyCancellable? {
|
||||
open var onClickSubscriber: AnyCancellable? {
|
||||
willSet {
|
||||
if let onClickSubscriber {
|
||||
onClickSubscriber.cancel()
|
||||
@ -63,7 +63,7 @@ open class ButtonBase: UIButton, Buttonable, Handlerable, ViewProtocol, Resettab
|
||||
|
||||
open var userInfo = [String: Primitive]()
|
||||
|
||||
public var touchUpInsideCount: Int = 0
|
||||
open var touchUpInsideCount: Int = 0
|
||||
|
||||
internal var isHighlightAnimating = false
|
||||
|
||||
@ -160,6 +160,7 @@ open class ButtonBase: UIButton, Buttonable, Handlerable, ViewProtocol, Resettab
|
||||
return CGSize(width: adjustedWidth, height: adjustedHeight)
|
||||
}
|
||||
|
||||
/// Function used to make changes to the View based off a change events or from local properties.
|
||||
open func updateView() {
|
||||
updateLabel()
|
||||
updateAccessibility()
|
||||
|
||||
@ -29,7 +29,7 @@ open class ButtonGroup: View, UICollectionViewDataSource, UICollectionViewDelega
|
||||
|
||||
open var rowQuantityTablet: Int = 0 { didSet { setNeedsUpdate() } }
|
||||
|
||||
public var rowQuantity: Int { UIDevice.isIPad ? rowQuantityTablet : rowQuantityPhone }
|
||||
open var rowQuantity: Int { UIDevice.isIPad ? rowQuantityTablet : rowQuantityPhone }
|
||||
|
||||
//If provided, aligns TextLink/TextLinkCaret alignment when rowQuantity is set one.
|
||||
open var buttonPosition: ButtonPosition = .center { didSet { setNeedsUpdate() }}
|
||||
@ -93,7 +93,8 @@ open class ButtonGroup: View, UICollectionViewDataSource, UICollectionViewDelega
|
||||
//--------------------------------------------------
|
||||
// MARK: - Overrides
|
||||
//--------------------------------------------------
|
||||
override public var disabled: Bool {
|
||||
/// Whether this object is disabled or not
|
||||
override open var disabled: Bool {
|
||||
didSet {
|
||||
buttons.forEach { button in
|
||||
var b = button
|
||||
@ -103,7 +104,7 @@ open class ButtonGroup: View, UICollectionViewDataSource, UICollectionViewDelega
|
||||
}
|
||||
|
||||
/// Current Surface and this is used to pass down to child objects that implement Surfacable
|
||||
override public var surface: Surface {
|
||||
override open var surface: Surface {
|
||||
didSet {
|
||||
buttons.forEach { button in
|
||||
var b = button
|
||||
@ -138,6 +139,7 @@ open class ButtonGroup: View, UICollectionViewDataSource, UICollectionViewDelega
|
||||
//--------------------------------------------------
|
||||
// MARK: - Overrides
|
||||
//--------------------------------------------------
|
||||
/// Function used to make changes to the View based off a change events or from local properties.
|
||||
open override func updateView() {
|
||||
super.updateView()
|
||||
positionLayout.position = buttonPosition
|
||||
|
||||
@ -107,6 +107,7 @@ open class TextLink: ButtonBase {
|
||||
return titleLabel?.intrinsicContentSize ?? super.intrinsicContentSize
|
||||
}
|
||||
|
||||
/// Function used to make changes to the View based off a change events or from local properties.
|
||||
open override func updateView() {
|
||||
//need to set the properties so the super class
|
||||
//can render out the label correctly
|
||||
|
||||
@ -94,6 +94,7 @@ open class TextLinkCaret: ButtonBase {
|
||||
return titleLabel?.intrinsicContentSize ?? super.intrinsicContentSize
|
||||
}
|
||||
|
||||
/// Function used to make changes to the View based off a change events or from local properties.
|
||||
open override func updateView() {
|
||||
imageAttribute = CaretLabelAttribute(tintColor: textColor, position: iconPosition)
|
||||
super.updateView()
|
||||
|
||||
@ -14,13 +14,13 @@ open class CheckboxGroup: SelectorGroupHandlerBase<CheckboxItem> {
|
||||
//--------------------------------------------------
|
||||
// MARK: - Public Properties
|
||||
//--------------------------------------------------
|
||||
public var selectedHandlers: [CheckboxItem]? {
|
||||
open var selectedHandlers: [CheckboxItem]? {
|
||||
let selected = selectorViews.filter{ $0.isSelected == true }
|
||||
guard selected.count > 0 else { return nil }
|
||||
return selected
|
||||
}
|
||||
|
||||
public override var selectorViews: [CheckboxItem] {
|
||||
open override var selectorViews: [CheckboxItem] {
|
||||
willSet {
|
||||
mainStackView.arrangedSubviews.forEach { $0.removeFromSuperview() }
|
||||
}
|
||||
@ -35,7 +35,7 @@ open class CheckboxGroup: SelectorGroupHandlerBase<CheckboxItem> {
|
||||
}
|
||||
}
|
||||
|
||||
public var selectorModels: [CheckboxModel]? {
|
||||
open var selectorModels: [CheckboxModel]? {
|
||||
didSet {
|
||||
if let selectorModels {
|
||||
selectorViews = selectorModels.enumerated().map { index, model in
|
||||
@ -61,7 +61,7 @@ open class CheckboxGroup: SelectorGroupHandlerBase<CheckboxItem> {
|
||||
}
|
||||
|
||||
private var _showError: Bool = false
|
||||
public var showError: Bool {
|
||||
open var showError: Bool {
|
||||
get { _showError }
|
||||
set {
|
||||
var newShowError = newValue
|
||||
@ -112,6 +112,7 @@ open class CheckboxGroup: SelectorGroupHandlerBase<CheckboxItem> {
|
||||
extension CheckboxGroup {
|
||||
public struct CheckboxModel : Surfaceable, Disabling, Initable, FormFieldable, Errorable {
|
||||
|
||||
/// 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
|
||||
public var surface: Surface
|
||||
|
||||
@ -44,6 +44,7 @@ open class CheckboxItem: SelectorItemBase<Checkbox> {
|
||||
sendActions(for: .valueChanged)
|
||||
}
|
||||
|
||||
/// Function used to make changes to the View based off a change events or from local properties.
|
||||
open override func updateView() {
|
||||
selectorView.isAnimated = isAnimated
|
||||
super.updateView()
|
||||
|
||||
@ -268,6 +268,7 @@ open class ButtonIcon: Control {
|
||||
setNeedsUpdate()
|
||||
}
|
||||
|
||||
/// Function used to make changes to the View based off a change events or from local properties.
|
||||
open override func updateView() {
|
||||
super.updateView()
|
||||
|
||||
|
||||
@ -69,6 +69,7 @@ open class Icon: View {
|
||||
imageView.image = nil
|
||||
}
|
||||
|
||||
/// Function used to make changes to the View based off a change events or from local properties.
|
||||
open override func updateView() {
|
||||
super.updateView()
|
||||
//get the color for the image
|
||||
|
||||
@ -17,7 +17,7 @@ open class Label: UILabel, Handlerable, ViewProtocol, Resettable, UserInfoable {
|
||||
// MARK: - Combine Properties
|
||||
//--------------------------------------------------
|
||||
/// Set of Subscribers for any Publishers for this Control.
|
||||
public var subscribers = Set<AnyCancellable>()
|
||||
open var subscribers = Set<AnyCancellable>()
|
||||
|
||||
//--------------------------------------------------
|
||||
// MARK: - Properties
|
||||
@ -66,7 +66,7 @@ open class Label: UILabel, Handlerable, ViewProtocol, Resettable, UserInfoable {
|
||||
//--------------------------------------------------
|
||||
// MARK: - Configuration Properties
|
||||
//--------------------------------------------------
|
||||
public var textColorConfiguration: AnyColorable = ViewColorConfiguration().with {
|
||||
open var textColorConfiguration: AnyColorable = ViewColorConfiguration().with {
|
||||
$0.setSurfaceColors(VDSColor.interactiveDisabledOnlight, VDSColor.interactiveDisabledOndark, forDisabled: true)
|
||||
$0.setSurfaceColors(VDSColor.elementsPrimaryOnlight, VDSColor.elementsPrimaryOndark, forDisabled: false)
|
||||
}.eraseToAnyColorable(){ didSet { setNeedsUpdate() }}
|
||||
@ -139,7 +139,8 @@ open class Label: UILabel, Handlerable, ViewProtocol, Resettable, UserInfoable {
|
||||
|
||||
//--------------------------------------------------
|
||||
// MARK: - Overrides
|
||||
//--------------------------------------------------
|
||||
//--------------------------------------------------
|
||||
/// Function used to make changes to the View based off a change events or from local properties.
|
||||
open func updateView() {
|
||||
if !useAttributedText {
|
||||
if let text = text {
|
||||
|
||||
@ -31,7 +31,7 @@ open class Line: View {
|
||||
//--------------------------------------------------
|
||||
// MARK: - Configuration
|
||||
//--------------------------------------------------
|
||||
public var lineViewColorConfiguration: AnyColorable = {
|
||||
open var lineViewColorConfiguration: AnyColorable = {
|
||||
let config = KeyedColorConfiguration<Line, Style>(keyPath: \.style)
|
||||
config.setSurfaceColors(VDSColor.elementsPrimaryOnlight, VDSColor.elementsPrimaryOndark, forKey: .primary)
|
||||
config.setSurfaceColors(VDSColor.elementsLowcontrastOnlight, VDSColor.elementsLowcontrastOndark, forKey: .secondary)
|
||||
@ -56,6 +56,7 @@ open class Line: View {
|
||||
style = .primary
|
||||
}
|
||||
|
||||
/// Function used to make changes to the View based off a change events or from local properties.
|
||||
open override func updateView() {
|
||||
lineView.backgroundColor = lineViewColorConfiguration.getColor(self)
|
||||
}
|
||||
|
||||
@ -24,10 +24,10 @@ open class Loader: View {
|
||||
// MARK: - Public Properties
|
||||
//--------------------------------------------------
|
||||
/// Loader will be active if 'active' prop is passed.
|
||||
public var isActive: Bool = true { didSet { setNeedsUpdate() } }
|
||||
open var isActive: Bool = true { didSet { setNeedsUpdate() } }
|
||||
|
||||
/// The Int used to determine the height and width of the Loader
|
||||
public var size: Int = 40 { didSet { setNeedsUpdate() } }
|
||||
open var size: Int = 40 { didSet { setNeedsUpdate() } }
|
||||
|
||||
//--------------------------------------------------
|
||||
// MARK: - Lifecycle
|
||||
@ -46,6 +46,7 @@ open class Loader: View {
|
||||
])
|
||||
}
|
||||
|
||||
/// Function used to make changes to the View based off a change events or from local properties.
|
||||
open override func updateView() {
|
||||
super.updateView()
|
||||
icon.color = iconColorConfiguration.getColor(self)
|
||||
|
||||
@ -43,7 +43,7 @@ open class LoaderViewController: UIViewController, Surfaceable {
|
||||
updateView()
|
||||
}
|
||||
|
||||
/// Update this view based off of property chang
|
||||
/// Function used to make changes to the View based off a change events or from local properties.
|
||||
open func updateView() {
|
||||
view.backgroundColor = backgroundColorConfiguration.getColor(self).withAlphaComponent(0.8)
|
||||
if let size {
|
||||
|
||||
@ -264,6 +264,7 @@ open class Notification: View {
|
||||
setNeedsUpdate()
|
||||
}
|
||||
|
||||
/// Function used to make changes to the View based off a change events or from local properties.
|
||||
open override func updateView() {
|
||||
backgroundColor = backgroundColorConfiguration.getColor(self)
|
||||
updateIcons()
|
||||
|
||||
@ -30,7 +30,7 @@ open class RadioBoxGroup: SelectorGroupSelectedHandlerBase<RadioBoxItem> {
|
||||
}
|
||||
}
|
||||
|
||||
public var selectorModels: [RadioBoxModel]? {
|
||||
open var selectorModels: [RadioBoxModel]? {
|
||||
didSet {
|
||||
if let selectorModels {
|
||||
selectorViews = selectorModels.enumerated().map { index, model in
|
||||
@ -107,6 +107,7 @@ open class RadioBoxGroup: SelectorGroupSelectedHandlerBase<RadioBoxItem> {
|
||||
|
||||
extension RadioBoxGroup {
|
||||
public struct RadioBoxModel: Surfaceable, Initable, Disabling, 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
|
||||
public var surface: Surface
|
||||
|
||||
@ -56,7 +56,7 @@ open class RadioBoxItem: Control, Changeable {
|
||||
//--------------------------------------------------
|
||||
// MARK: - Public Properties
|
||||
//--------------------------------------------------
|
||||
public var onChangeSubscriber: AnyCancellable? {
|
||||
open var onChangeSubscriber: AnyCancellable? {
|
||||
willSet {
|
||||
if let onChangeSubscriber {
|
||||
onChangeSubscriber.cancel()
|
||||
@ -82,7 +82,7 @@ open class RadioBoxItem: Control, Changeable {
|
||||
$0.textStyle = .bodyLarge
|
||||
}
|
||||
|
||||
public var selectorView = UIView().with {
|
||||
open var selectorView = UIView().with {
|
||||
$0.translatesAutoresizingMaskIntoConstraints = false
|
||||
}
|
||||
|
||||
@ -259,6 +259,7 @@ open class RadioBoxItem: Control, Changeable {
|
||||
sendActions(for: .valueChanged)
|
||||
}
|
||||
|
||||
/// Function used to make changes to the View based off a change events or from local properties.
|
||||
open override func updateView() {
|
||||
updateLabels()
|
||||
updateAccessibility()
|
||||
|
||||
@ -30,7 +30,7 @@ open class RadioButtonGroup: SelectorGroupSelectedHandlerBase<RadioButtonItem> {
|
||||
}
|
||||
}
|
||||
|
||||
public var selectorModels: [RadioButtonModel]? {
|
||||
open var selectorModels: [RadioButtonModel]? {
|
||||
didSet {
|
||||
if let selectorModels {
|
||||
selectorViews = selectorModels.enumerated().map { index, model in
|
||||
@ -56,7 +56,7 @@ open class RadioButtonGroup: SelectorGroupSelectedHandlerBase<RadioButtonItem> {
|
||||
}
|
||||
|
||||
private var _showError: Bool = false
|
||||
public var showError: Bool {
|
||||
open var showError: Bool {
|
||||
get { _showError }
|
||||
set {
|
||||
var newShowError = newValue
|
||||
@ -116,6 +116,7 @@ open class RadioButtonGroup: SelectorGroupSelectedHandlerBase<RadioButtonItem> {
|
||||
extension RadioButtonGroup {
|
||||
public struct RadioButtonModel: Surfaceable, Disabling, Initable, FormFieldable, Errorable {
|
||||
|
||||
/// 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
|
||||
public var surface: Surface
|
||||
|
||||
@ -32,11 +32,11 @@ open class RadioSwatch: Control {
|
||||
//--------------------------------------------------
|
||||
// MARK: - Public Properties
|
||||
//--------------------------------------------------
|
||||
public var selectorView = UIView().with {
|
||||
open var selectorView = UIView().with {
|
||||
$0.translatesAutoresizingMaskIntoConstraints = false
|
||||
}
|
||||
|
||||
public var fillView = UIImageView().with {
|
||||
open var fillView = UIImageView().with {
|
||||
$0.translatesAutoresizingMaskIntoConstraints = false
|
||||
$0.contentMode = .scaleAspectFit
|
||||
}
|
||||
@ -125,6 +125,7 @@ open class RadioSwatch: Control {
|
||||
sendActions(for: .valueChanged)
|
||||
}
|
||||
|
||||
/// Function used to make changes to the View based off a change events or from local properties.
|
||||
open override func updateView() {
|
||||
layer.setNeedsDisplay()
|
||||
}
|
||||
|
||||
@ -21,7 +21,7 @@ open class RadioSwatchGroup: SelectorGroupSelectedHandlerBase<RadioSwatch>, UICo
|
||||
}
|
||||
}
|
||||
|
||||
public var selectorModels: [RadioSwatchModel]? {
|
||||
open var selectorModels: [RadioSwatchModel]? {
|
||||
didSet {
|
||||
if let selectorModels {
|
||||
selectorViews = selectorModels.map { model in
|
||||
@ -46,7 +46,7 @@ open class RadioSwatchGroup: SelectorGroupSelectedHandlerBase<RadioSwatch>, UICo
|
||||
//--------------------------------------------------
|
||||
// MARK: - Private Properties
|
||||
//--------------------------------------------------
|
||||
public var label = Label()
|
||||
open var label = Label()
|
||||
private let cellSize: CGFloat = 48.0
|
||||
private let labelSpacing: CGFloat = 24.0
|
||||
private let labelHeight: CGFloat = 16.0
|
||||
@ -71,6 +71,7 @@ open class RadioSwatchGroup: SelectorGroupSelectedHandlerBase<RadioSwatch>, UICo
|
||||
//--------------------------------------------------
|
||||
// MARK: - Overrides
|
||||
//--------------------------------------------------
|
||||
/// Whether this object is disabled or not
|
||||
override public var disabled: Bool {
|
||||
didSet {
|
||||
for selector in selectorViews {
|
||||
@ -123,6 +124,7 @@ open class RadioSwatchGroup: SelectorGroupSelectedHandlerBase<RadioSwatch>, UICo
|
||||
collectionView.dataSource = self
|
||||
}
|
||||
|
||||
/// Function used to make changes to the View based off a change events or from local properties.
|
||||
open override func updateView() {
|
||||
label.textPosition = .left
|
||||
label.textStyle = .bodySmall
|
||||
@ -190,7 +192,9 @@ open class RadioSwatchGroup: SelectorGroupSelectedHandlerBase<RadioSwatch>, UICo
|
||||
|
||||
extension RadioSwatchGroup {
|
||||
public struct RadioSwatchModel: Surfaceable, Disabling, 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
|
||||
public var surface: Surface
|
||||
public var inputId: String?
|
||||
public var value: AnyHashable?
|
||||
|
||||
@ -146,6 +146,7 @@ extension Tabs {
|
||||
layoutGuide.trailingAnchor.constraint(equalTo: trailingAnchor)])
|
||||
}
|
||||
|
||||
/// Function used to make changes to the View based off a change events or from local properties.
|
||||
open override func updateView() {
|
||||
super.updateView()
|
||||
|
||||
|
||||
@ -232,6 +232,7 @@ open class Tabs: View {
|
||||
}
|
||||
}
|
||||
|
||||
/// Function used to make changes to the View based off a change events or from local properties.
|
||||
open override func updateView() {
|
||||
super.updateView()
|
||||
|
||||
|
||||
@ -140,6 +140,7 @@ open class TabsContainer: View {
|
||||
])
|
||||
}
|
||||
|
||||
/// Function used to make changes to the View based off a change events or from local properties.
|
||||
open override func updateView() {
|
||||
super.updateView()
|
||||
|
||||
|
||||
@ -98,7 +98,7 @@ open class EntryField: Control, Changeable {
|
||||
//--------------------------------------------------
|
||||
// MARK: - Public Properties
|
||||
//--------------------------------------------------
|
||||
public var onChangeSubscriber: AnyCancellable? {
|
||||
open var onChangeSubscriber: AnyCancellable? {
|
||||
willSet {
|
||||
if let onChangeSubscriber {
|
||||
onChangeSubscriber.cancel()
|
||||
@ -258,9 +258,7 @@ open class EntryField: Control, Changeable {
|
||||
readOnly = false
|
||||
}
|
||||
|
||||
//--------------------------------------------------
|
||||
// MARK: - State
|
||||
//--------------------------------------------------
|
||||
/// Function used to make changes to the View based off a change events or from local properties.
|
||||
open override func updateView() {
|
||||
|
||||
containerView.backgroundColor = backgroundColorConfiguration.getColor(self)
|
||||
|
||||
@ -103,7 +103,7 @@ open class InputField: EntryField, UITextFieldDelegate {
|
||||
$0.font = TextStyle.bodyLarge.font
|
||||
}
|
||||
|
||||
public var textFieldTextColorConfiguration: AnyColorable = ViewColorConfiguration().with {
|
||||
open var textFieldTextColorConfiguration: AnyColorable = ViewColorConfiguration().with {
|
||||
$0.setSurfaceColors(VDSColor.interactiveDisabledOnlight, VDSColor.interactiveDisabledOndark, forDisabled: true)
|
||||
$0.setSurfaceColors(VDSColor.elementsPrimaryOnlight, VDSColor.elementsPrimaryOndark, forDisabled: false)
|
||||
}.eraseToAnyColorable()
|
||||
@ -161,6 +161,7 @@ open class InputField: EntryField, UITextFieldDelegate {
|
||||
return inputFieldStackView
|
||||
}
|
||||
|
||||
/// Function used to make changes to the View based off a change events or from local properties.
|
||||
open override func updateView() {
|
||||
super.updateView()
|
||||
|
||||
|
||||
@ -53,10 +53,10 @@ open class TextArea: EntryField {
|
||||
$0.isScrollEnabled = false
|
||||
}
|
||||
|
||||
public var textViewTextColorConfiguration: AnyColorable = ViewColorConfiguration().with {
|
||||
open var textViewTextColorConfiguration: AnyColorable = ViewColorConfiguration().with {
|
||||
$0.setSurfaceColors(VDSColor.interactiveDisabledOnlight, VDSColor.interactiveDisabledOndark, forDisabled: true)
|
||||
$0.setSurfaceColors(VDSColor.elementsPrimaryOnlight, VDSColor.elementsPrimaryOndark, forDisabled: false)
|
||||
}.eraseToAnyColorable()
|
||||
}.eraseToAnyColorable() { didSet { setNeedsUpdate() }}
|
||||
|
||||
internal var minWidthConstraint: NSLayoutConstraint?
|
||||
internal var textViewHeightConstraint: NSLayoutConstraint?
|
||||
@ -91,6 +91,7 @@ open class TextArea: EntryField {
|
||||
return inputFieldStackView
|
||||
}
|
||||
|
||||
/// Function used to make changes to the View based off a change events or from local properties.
|
||||
open override func updateView() {
|
||||
super.updateView()
|
||||
|
||||
|
||||
@ -77,26 +77,26 @@ open class TileContainer: Control {
|
||||
//--------------------------------------------------
|
||||
// MARK: - Public Properties
|
||||
//--------------------------------------------------
|
||||
public var backgroundImage: UIImage? { didSet{ setNeedsUpdate() } }
|
||||
open var backgroundImage: UIImage? { didSet{ setNeedsUpdate() } }
|
||||
|
||||
public var containerView = View().with {
|
||||
open var containerView = View().with {
|
||||
$0.isUserInteractionEnabled = false
|
||||
}
|
||||
|
||||
public var highlightView = View().with {
|
||||
open var highlightView = View().with {
|
||||
$0.isUserInteractionEnabled = false
|
||||
}
|
||||
|
||||
public var color: BackgroundColor = .white { didSet{ setNeedsUpdate() } }
|
||||
open var color: BackgroundColor = .white { didSet{ setNeedsUpdate() } }
|
||||
|
||||
public var padding: Padding = .padding4X { didSet{ setNeedsUpdate() } }
|
||||
open var padding: Padding = .padding4X { didSet{ setNeedsUpdate() } }
|
||||
|
||||
public var aspectRatio: AspectRatio = .ratio1x1 { didSet{ setNeedsUpdate() } }
|
||||
open var aspectRatio: AspectRatio = .ratio1x1 { didSet{ setNeedsUpdate() } }
|
||||
|
||||
public var imageFallbackColor: Surface = .light { didSet{ setNeedsUpdate() } }
|
||||
open var imageFallbackColor: Surface = .light { didSet{ setNeedsUpdate() } }
|
||||
|
||||
private var _width: CGFloat?
|
||||
public var width: CGFloat? {
|
||||
open var width: CGFloat? {
|
||||
get { return _width }
|
||||
set {
|
||||
if let newValue, newValue > 100 {
|
||||
@ -109,7 +109,7 @@ open class TileContainer: Control {
|
||||
}
|
||||
|
||||
private var _height: CGFloat?
|
||||
public var height: CGFloat? {
|
||||
open var height: CGFloat? {
|
||||
get { return _height }
|
||||
set {
|
||||
if let newValue, newValue > 44 {
|
||||
@ -121,9 +121,9 @@ open class TileContainer: Control {
|
||||
}
|
||||
}
|
||||
|
||||
public var showBorder: Bool = false { didSet{ setNeedsUpdate() } }
|
||||
open var showBorder: Bool = false { didSet{ setNeedsUpdate() } }
|
||||
|
||||
public var showDropShadows: Bool = false { didSet{ setNeedsUpdate() } }
|
||||
open var showDropShadows: Bool = false { didSet{ setNeedsUpdate() } }
|
||||
|
||||
//--------------------------------------------------
|
||||
// MARK: - Private Properties
|
||||
@ -204,6 +204,7 @@ open class TileContainer: Control {
|
||||
setNeedsUpdate()
|
||||
}
|
||||
|
||||
/// Function used to make changes to the View based off a change events or from local properties.
|
||||
open override func updateView() {
|
||||
super.updateView()
|
||||
|
||||
|
||||
@ -162,13 +162,13 @@ open class Tilelet: TileContainer {
|
||||
open var textPostion: TextPosition = .top { didSet { setNeedsUpdate() }}
|
||||
|
||||
//models
|
||||
public var badgeModel: BadgeModel? { didSet { setNeedsUpdate() }}
|
||||
public var titleModel: TitleModel? { didSet { setNeedsUpdate() }}
|
||||
public var subTitleModel: SubTitleModel? { didSet { setNeedsUpdate() }}
|
||||
open var badgeModel: BadgeModel? { didSet { setNeedsUpdate() }}
|
||||
open var titleModel: TitleModel? { didSet { setNeedsUpdate() }}
|
||||
open var subTitleModel: SubTitleModel? { didSet { setNeedsUpdate() }}
|
||||
|
||||
//only 1 Icon can be active
|
||||
private var _descriptiveIconModel: DescriptiveIcon?
|
||||
public var descriptiveIconModel: DescriptiveIcon? {
|
||||
open var descriptiveIconModel: DescriptiveIcon? {
|
||||
get { _descriptiveIconModel }
|
||||
set {
|
||||
_descriptiveIconModel = newValue;
|
||||
@ -178,7 +178,7 @@ open class Tilelet: TileContainer {
|
||||
}
|
||||
|
||||
private var _directionalIconModel: DirectionalIcon?
|
||||
public var directionalIconModel: DirectionalIcon? {
|
||||
open var directionalIconModel: DirectionalIcon? {
|
||||
get { _directionalIconModel }
|
||||
set {
|
||||
_directionalIconModel = newValue;
|
||||
@ -365,6 +365,7 @@ open class Tilelet: TileContainer {
|
||||
}
|
||||
}
|
||||
|
||||
/// Function used to make changes to the View based off a change events or from local properties.
|
||||
open override func updateView() {
|
||||
super.updateView()
|
||||
|
||||
|
||||
@ -285,6 +285,7 @@ open class TitleLockup: View {
|
||||
setNeedsUpdate()
|
||||
}
|
||||
|
||||
/// Function used to make changes to the View based off a change events or from local properties.
|
||||
open override func updateView() {
|
||||
super.updateView()
|
||||
|
||||
|
||||
@ -191,6 +191,7 @@ open class Toggle: Control, Changeable {
|
||||
setNeedsUpdate()
|
||||
}
|
||||
|
||||
/// Function used to make changes to the View based off a change events or from local properties.
|
||||
open override func updateView() {
|
||||
updateLabel()
|
||||
toggleView.surface = surface
|
||||
|
||||
@ -53,7 +53,7 @@ open class ToggleView: Control, Changeable {
|
||||
//--------------------------------------------------
|
||||
// MARK: - Public Properties
|
||||
//--------------------------------------------------
|
||||
public var onChangeSubscriber: AnyCancellable?
|
||||
open var onChangeSubscriber: AnyCancellable?
|
||||
|
||||
open var isOn: Bool {
|
||||
get { isSelected }
|
||||
@ -152,6 +152,7 @@ open class ToggleView: Control, Changeable {
|
||||
setNeedsUpdate()
|
||||
}
|
||||
|
||||
/// Function used to make changes to the View based off a change events or from local properties.
|
||||
open override func updateView() {
|
||||
updateToggle()
|
||||
updateAccessibility()
|
||||
|
||||
@ -154,6 +154,7 @@ open class Tooltip: Control, TooltipLaunchable {
|
||||
setNeedsUpdate()
|
||||
}
|
||||
|
||||
/// Function used to make changes to the View based off a change events or from local properties.
|
||||
open override func updateView() {
|
||||
super.updateView()
|
||||
|
||||
|
||||
@ -13,7 +13,7 @@ import VDSColorTokens
|
||||
open class TooltipAlertViewController: UIViewController, Surfaceable {
|
||||
|
||||
/// Set of Subscribers for any Publishers for this Control.
|
||||
public var subscribers = Set<AnyCancellable>()
|
||||
open var subscribers = Set<AnyCancellable>()
|
||||
|
||||
//--------------------------------------------------
|
||||
// MARK: - Private Properties
|
||||
@ -105,6 +105,7 @@ open class TooltipAlertViewController: UIViewController, Surfaceable {
|
||||
])
|
||||
}
|
||||
|
||||
/// Function used to make changes to the View based off a change events or from local properties.
|
||||
open func updateView() {
|
||||
view.backgroundColor = backgroundColorConfiguration.getColor(self).withAlphaComponent(0.3)
|
||||
tooltipDialog.surface = surface
|
||||
@ -222,6 +223,7 @@ open class TooltipDialog: View, UIScrollViewDelegate {
|
||||
heightConstraint?.activate()
|
||||
}
|
||||
|
||||
/// Function used to make changes to the View based off a change events or from local properties.
|
||||
open override func updateView() {
|
||||
super.updateView()
|
||||
|
||||
|
||||
@ -62,6 +62,7 @@ open class TrailingTooltipLabel: View, TooltipLaunchable {
|
||||
}.store(in: &subscribers)
|
||||
}
|
||||
|
||||
/// Function used to make changes to the View based off a change events or from local properties.
|
||||
open override func updateView() {
|
||||
super.updateView()
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user