Compare commits
2 Commits
passthroug
...
develop
| Author | SHA1 | Date | |
|---|---|---|---|
| 98dde01e18 | |||
| 78dd2d5df8 |
@ -10,7 +10,6 @@ import UIKit
|
|||||||
import Combine
|
import Combine
|
||||||
|
|
||||||
/// Base Class use to build Controls.
|
/// Base Class use to build Controls.
|
||||||
@objcMembers
|
|
||||||
@objc(VDSControl)
|
@objc(VDSControl)
|
||||||
open class Control: UIControl, ViewProtocol, UserInfoable, Clickable {
|
open class Control: UIControl, ViewProtocol, UserInfoable, Clickable {
|
||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
@ -35,7 +34,6 @@ open class Control: UIControl, ViewProtocol, UserInfoable, Clickable {
|
|||||||
// MARK: - Combine Properties
|
// MARK: - Combine Properties
|
||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
open var subscribers = Set<AnyCancellable>()
|
open var subscribers = Set<AnyCancellable>()
|
||||||
open var subject = PassthroughSubject<Void, Never>()
|
|
||||||
|
|
||||||
open var onClickSubscriber: AnyCancellable?
|
open var onClickSubscriber: AnyCancellable?
|
||||||
|
|
||||||
@ -79,19 +77,10 @@ open class Control: UIControl, ViewProtocol, UserInfoable, Clickable {
|
|||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
// MARK: - Lifecycle
|
// MARK: - Lifecycle
|
||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
/// When the view moves to a window, force any pending update immediately.
|
|
||||||
open override func didMoveToWindow() {
|
|
||||||
super.didMoveToWindow()
|
|
||||||
if window != nil {
|
|
||||||
updateView()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private func initialSetup() {
|
private func initialSetup() {
|
||||||
if !initialSetupPerformed {
|
if !initialSetupPerformed {
|
||||||
initialSetupPerformed = true
|
initialSetupPerformed = true
|
||||||
shouldUpdateView = false
|
shouldUpdateView = false
|
||||||
setupDidChangeEvent(true)
|
|
||||||
setup()
|
setup()
|
||||||
setDefaults()
|
setDefaults()
|
||||||
shouldUpdateView = true
|
shouldUpdateView = true
|
||||||
|
|||||||
@ -28,7 +28,6 @@ public protocol SelectorControlable: Control, Changeable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Base Class used to build out a Selector control.
|
/// Base Class used to build out a Selector control.
|
||||||
@objcMembers
|
|
||||||
@objc(VDSSelectorBase)
|
@objc(VDSSelectorBase)
|
||||||
open class SelectorBase: Control, SelectorControlable, ParentViewProtocol {
|
open class SelectorBase: Control, SelectorControlable, ParentViewProtocol {
|
||||||
|
|
||||||
|
|||||||
@ -10,7 +10,6 @@ import UIKit
|
|||||||
import Combine
|
import Combine
|
||||||
|
|
||||||
/// Base Class used to build Views.
|
/// Base Class used to build Views.
|
||||||
@objcMembers
|
|
||||||
@objc(VDSView)
|
@objc(VDSView)
|
||||||
open class View: UIView, ViewProtocol, UserInfoable, Clickable {
|
open class View: UIView, ViewProtocol, UserInfoable, Clickable {
|
||||||
|
|
||||||
@ -36,7 +35,6 @@ open class View: UIView, ViewProtocol, UserInfoable, Clickable {
|
|||||||
// MARK: - Combine Properties
|
// MARK: - Combine Properties
|
||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
open var subscribers = Set<AnyCancellable>()
|
open var subscribers = Set<AnyCancellable>()
|
||||||
open var subject = PassthroughSubject<Void, Never>()
|
|
||||||
|
|
||||||
open var onClickSubscriber: AnyCancellable?
|
open var onClickSubscriber: AnyCancellable?
|
||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
@ -59,19 +57,10 @@ open class View: UIView, ViewProtocol, UserInfoable, Clickable {
|
|||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
// MARK: - Lifecycle
|
// MARK: - Lifecycle
|
||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
/// When the view moves to a window, force any pending update immediately.
|
|
||||||
open override func didMoveToWindow() {
|
|
||||||
super.didMoveToWindow()
|
|
||||||
if window != nil {
|
|
||||||
updateView()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private func initialSetup() {
|
private func initialSetup() {
|
||||||
if !initialSetupPerformed {
|
if !initialSetupPerformed {
|
||||||
initialSetupPerformed = true
|
initialSetupPerformed = true
|
||||||
shouldUpdateView = false
|
shouldUpdateView = false
|
||||||
setupDidChangeEvent(true)
|
|
||||||
setup()
|
setup()
|
||||||
setDefaults()
|
setDefaults()
|
||||||
shouldUpdateView = true
|
shouldUpdateView = true
|
||||||
|
|||||||
@ -10,7 +10,6 @@ import UIKit
|
|||||||
import Combine
|
import Combine
|
||||||
import VDSCoreTokens
|
import VDSCoreTokens
|
||||||
|
|
||||||
@objcMembers
|
|
||||||
@objc(VDSAlertViewController)
|
@objc(VDSAlertViewController)
|
||||||
open class AlertViewController: UIViewController, Surfaceable {
|
open class AlertViewController: UIViewController, Surfaceable {
|
||||||
|
|
||||||
|
|||||||
@ -8,7 +8,6 @@
|
|||||||
import Foundation
|
import Foundation
|
||||||
import UIKit
|
import UIKit
|
||||||
|
|
||||||
@objcMembers
|
|
||||||
@objc(VDSClearPopoverViewController)
|
@objc(VDSClearPopoverViewController)
|
||||||
open class ClearPopoverViewController: UIViewController, UIPopoverPresentationControllerDelegate {
|
open class ClearPopoverViewController: UIViewController, UIPopoverPresentationControllerDelegate {
|
||||||
|
|
||||||
|
|||||||
@ -15,7 +15,6 @@ import Combine
|
|||||||
/// If you are using AutoLayoutConstraints you have a combination of Leading/Left and Trailing/Right NSLayoutConstraints,
|
/// If you are using AutoLayoutConstraints you have a combination of Leading/Left and Trailing/Right NSLayoutConstraints,
|
||||||
/// you need to ensure that one of these Horizontal Contraints is not constraint of "equatTo". If you are to pin the left/right edges
|
/// you need to ensure that one of these Horizontal Contraints is not constraint of "equatTo". If you are to pin the left/right edges
|
||||||
/// to its parent this object will stretch to the parent's width.
|
/// to its parent this object will stretch to the parent's width.
|
||||||
@objcMembers
|
|
||||||
@objc(VDSBadge)
|
@objc(VDSBadge)
|
||||||
open class Badge: View, ParentViewProtocol {
|
open class Badge: View, ParentViewProtocol {
|
||||||
|
|
||||||
|
|||||||
@ -11,7 +11,6 @@ import VDSCoreTokens
|
|||||||
import Combine
|
import Combine
|
||||||
|
|
||||||
/// A badge indicator is a visual label used to convey status or highlight supplemental information.
|
/// A badge indicator is a visual label used to convey status or highlight supplemental information.
|
||||||
@objcMembers
|
|
||||||
@objc(VDSBadgeIndicator)
|
@objc(VDSBadgeIndicator)
|
||||||
open class BadgeIndicator: View, ParentViewProtocol {
|
open class BadgeIndicator: View, ParentViewProtocol {
|
||||||
|
|
||||||
|
|||||||
@ -13,7 +13,6 @@ import Combine
|
|||||||
/// A Breadcrumb Item contains href(link) and selected flag.
|
/// A Breadcrumb Item contains href(link) and selected flag.
|
||||||
/// Breadcrumb links to its respective page if it is not disabled.
|
/// Breadcrumb links to its respective page if it is not disabled.
|
||||||
/// Breadcrumb contains text with a separator by default, highlights text in bold without a separator if selected.
|
/// Breadcrumb contains text with a separator by default, highlights text in bold without a separator if selected.
|
||||||
@objcMembers
|
|
||||||
@objc (VDSBreadcrumbItem)
|
@objc (VDSBreadcrumbItem)
|
||||||
open class BreadcrumbItem: ButtonBase {
|
open class BreadcrumbItem: ButtonBase {
|
||||||
|
|
||||||
|
|||||||
@ -13,7 +13,6 @@ import Combine
|
|||||||
/// A Breadcrumbs contains BreadcrumbItems.
|
/// A Breadcrumbs contains BreadcrumbItems.
|
||||||
/// It contains Breadcrumb Item Default, Breadcrumb Item Selected, Separator.
|
/// It contains Breadcrumb Item Default, Breadcrumb Item Selected, Separator.
|
||||||
/// Breadcrumbs are secondary navigation that use a hierarchy of internal links to tell customers where they are in an experience. Each breadcrumb links to its respective page, except for that of current page.
|
/// Breadcrumbs are secondary navigation that use a hierarchy of internal links to tell customers where they are in an experience. Each breadcrumb links to its respective page, except for that of current page.
|
||||||
@objcMembers
|
|
||||||
@objc(VDSBreadcrumbs)
|
@objc(VDSBreadcrumbs)
|
||||||
open class Breadcrumbs: View, ParentViewProtocol {
|
open class Breadcrumbs: View, ParentViewProtocol {
|
||||||
|
|
||||||
|
|||||||
@ -15,7 +15,6 @@ import Combine
|
|||||||
/// If you are using AutoLayoutConstraints you have a combination of Leading/Left and Trailing/Right NSLayoutConstraints,
|
/// If you are using AutoLayoutConstraints you have a combination of Leading/Left and Trailing/Right NSLayoutConstraints,
|
||||||
/// you need to ensure that one of these Horizontal Contraints is not constraint of "equatTo". If you are to pin the left/right edges
|
/// you need to ensure that one of these Horizontal Contraints is not constraint of "equatTo". If you are to pin the left/right edges
|
||||||
/// to its parent this object will stretch to the parent's width.
|
/// to its parent this object will stretch to the parent's width.
|
||||||
@objcMembers
|
|
||||||
@objc(VDSButton)
|
@objc(VDSButton)
|
||||||
open class Button: ButtonBase, Useable {
|
open class Button: ButtonBase, Useable {
|
||||||
|
|
||||||
|
|||||||
@ -11,7 +11,6 @@ import VDSCoreTokens
|
|||||||
import Combine
|
import Combine
|
||||||
|
|
||||||
/// Base class used for UIButton type classes.
|
/// Base class used for UIButton type classes.
|
||||||
@objcMembers
|
|
||||||
@objc(VDSButtonBase)
|
@objc(VDSButtonBase)
|
||||||
open class ButtonBase: UIButton, ViewProtocol, UserInfoable, Clickable {
|
open class ButtonBase: UIButton, ViewProtocol, UserInfoable, Clickable {
|
||||||
|
|
||||||
@ -38,7 +37,6 @@ open class ButtonBase: UIButton, ViewProtocol, UserInfoable, Clickable {
|
|||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
/// Set of Subscribers for any Publishers for this Control.
|
/// Set of Subscribers for any Publishers for this Control.
|
||||||
open var subscribers = Set<AnyCancellable>()
|
open var subscribers = Set<AnyCancellable>()
|
||||||
open var subject = PassthroughSubject<Void, Never>()
|
|
||||||
|
|
||||||
open var onClickSubscriber: AnyCancellable?
|
open var onClickSubscriber: AnyCancellable?
|
||||||
|
|
||||||
@ -98,19 +96,10 @@ open class ButtonBase: UIButton, ViewProtocol, UserInfoable, Clickable {
|
|||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
// MARK: - Lifecycle
|
// MARK: - Lifecycle
|
||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
/// When the view moves to a window, force any pending update immediately.
|
|
||||||
open override func didMoveToWindow() {
|
|
||||||
super.didMoveToWindow()
|
|
||||||
if window != nil {
|
|
||||||
updateView()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private func initialSetup() {
|
private func initialSetup() {
|
||||||
if !initialSetupPerformed {
|
if !initialSetupPerformed {
|
||||||
initialSetupPerformed = true
|
initialSetupPerformed = true
|
||||||
shouldUpdateView = false
|
shouldUpdateView = false
|
||||||
setupDidChangeEvent(true)
|
|
||||||
setup()
|
setup()
|
||||||
setDefaults()
|
setDefaults()
|
||||||
shouldUpdateView = true
|
shouldUpdateView = true
|
||||||
|
|||||||
@ -11,7 +11,6 @@ import VDSCoreTokens
|
|||||||
import Combine
|
import Combine
|
||||||
|
|
||||||
/// A button group contains combinations of related CTAs including ``Button``, ``TextLink``, and ``TextLinkCaret``. This group component controls a combination's orientation, spacing, size and allowable size pairings.
|
/// A button group contains combinations of related CTAs including ``Button``, ``TextLink``, and ``TextLinkCaret``. This group component controls a combination's orientation, spacing, size and allowable size pairings.
|
||||||
@objcMembers
|
|
||||||
@objc(VDSButtonGroup)
|
@objc(VDSButtonGroup)
|
||||||
open class ButtonGroup: View {
|
open class ButtonGroup: View {
|
||||||
|
|
||||||
|
|||||||
@ -16,7 +16,6 @@ import Combine
|
|||||||
/// If you are using AutoLayoutConstraints you have a combination of Leading/Left and Trailing/Right NSLayoutConstraints,
|
/// If you are using AutoLayoutConstraints you have a combination of Leading/Left and Trailing/Right NSLayoutConstraints,
|
||||||
/// you need to ensure that one of these Horizontal Contraints is not constraint of "equatTo". If you are to pin the left/right edges
|
/// you need to ensure that one of these Horizontal Contraints is not constraint of "equatTo". If you are to pin the left/right edges
|
||||||
/// to its parent this object will stretch to the parent's width.
|
/// to its parent this object will stretch to the parent's width.
|
||||||
@objcMembers
|
|
||||||
@objc(VDSTextLink)
|
@objc(VDSTextLink)
|
||||||
open class TextLink: ButtonBase {
|
open class TextLink: ButtonBase {
|
||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
|
|||||||
@ -16,7 +16,6 @@ import Combine
|
|||||||
/// If you are using AutoLayoutConstraints you have a combination of Leading/Left and Trailing/Right NSLayoutConstraints,
|
/// If you are using AutoLayoutConstraints you have a combination of Leading/Left and Trailing/Right NSLayoutConstraints,
|
||||||
/// you need to ensure that one of these Horizontal Contraints is not constraint of "equatTo". If you are to pin the left/right edges
|
/// you need to ensure that one of these Horizontal Contraints is not constraint of "equatTo". If you are to pin the left/right edges
|
||||||
/// to its parent this object will stretch to the parent's width.
|
/// to its parent this object will stretch to the parent's width.
|
||||||
@objcMembers
|
|
||||||
@objc(VDSTextLinkCaret)
|
@objc(VDSTextLinkCaret)
|
||||||
open class TextLinkCaret: ButtonBase {
|
open class TextLinkCaret: ButtonBase {
|
||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
|
|||||||
@ -11,7 +11,6 @@ import VDSCoreTokens
|
|||||||
import Combine
|
import Combine
|
||||||
|
|
||||||
/// A calendar is a monthly view that lets customers select a single date.
|
/// A calendar is a monthly view that lets customers select a single date.
|
||||||
@objcMembers
|
|
||||||
@objc(VDSCalendar)
|
@objc(VDSCalendar)
|
||||||
open class CalendarBase: Control, Changeable {
|
open class CalendarBase: Control, Changeable {
|
||||||
|
|
||||||
|
|||||||
@ -12,7 +12,6 @@ import Combine
|
|||||||
|
|
||||||
/// A carousel is a collection of related content in a row that a customer can navigate through horizontally.
|
/// A carousel is a collection of related content in a row that a customer can navigate through horizontally.
|
||||||
/// Use this component to show content that is supplementary, not essential for task completion.
|
/// Use this component to show content that is supplementary, not essential for task completion.
|
||||||
@objcMembers
|
|
||||||
@objc(VDSCarousel)
|
@objc(VDSCarousel)
|
||||||
open class Carousel: View {
|
open class Carousel: View {
|
||||||
|
|
||||||
|
|||||||
@ -12,7 +12,6 @@ import Combine
|
|||||||
|
|
||||||
/// A carousel scrollbar is a control that allows to navigate between items in a carousel.
|
/// A carousel scrollbar is a control that allows to navigate between items in a carousel.
|
||||||
/// It's also a status indicator that conveys the relative amount of content in a carousel and a location within it.
|
/// It's also a status indicator that conveys the relative amount of content in a carousel and a location within it.
|
||||||
@objcMembers
|
|
||||||
@objc(VDSCarouselScrollbar)
|
@objc(VDSCarouselScrollbar)
|
||||||
open class CarouselScrollbar: View {
|
open class CarouselScrollbar: View {
|
||||||
|
|
||||||
|
|||||||
@ -12,7 +12,6 @@ import VDSCoreTokens
|
|||||||
|
|
||||||
/// Checkboxes are a multi-select component through which a customer indicates a choice. This is also used within
|
/// Checkboxes are a multi-select component through which a customer indicates a choice. This is also used within
|
||||||
/// ``CheckboxItem`` and ``CheckboxGroup``
|
/// ``CheckboxItem`` and ``CheckboxGroup``
|
||||||
@objcMembers
|
|
||||||
@objc(VDSCheckbox)
|
@objc(VDSCheckbox)
|
||||||
open class Checkbox: SelectorBase {
|
open class Checkbox: SelectorBase {
|
||||||
|
|
||||||
|
|||||||
@ -12,7 +12,6 @@ import VDSCoreTokens
|
|||||||
/// When the choice has multiple options, use a checkbox group. For example, use a checkbox group when
|
/// When the choice has multiple options, use a checkbox group. For example, use a checkbox group when
|
||||||
/// asking a customer which attributes they would like to filter their search by. This uses ``CheckboxItem``
|
/// asking a customer which attributes they would like to filter their search by. This uses ``CheckboxItem``
|
||||||
/// to allow user selection.
|
/// to allow user selection.
|
||||||
@objcMembers
|
|
||||||
@objc(VDSCheckboxGroup)
|
@objc(VDSCheckboxGroup)
|
||||||
open class CheckboxGroup: SelectorGroupBase<CheckboxItem>, SelectorGroupMultiSelect {
|
open class CheckboxGroup: SelectorGroupBase<CheckboxItem>, SelectorGroupMultiSelect {
|
||||||
|
|
||||||
|
|||||||
@ -9,7 +9,6 @@ import Foundation
|
|||||||
import UIKit
|
import UIKit
|
||||||
|
|
||||||
/// Checkboxes are a multi-select component through which a customer indicates a choice. If a binary choice, the component is a checkbox. If the choice has multiple options, the component is a ``CheckboxGroup``.
|
/// Checkboxes are a multi-select component through which a customer indicates a choice. If a binary choice, the component is a checkbox. If the choice has multiple options, the component is a ``CheckboxGroup``.
|
||||||
@objcMembers
|
|
||||||
@objc(VDSCheckboxItem)
|
@objc(VDSCheckboxItem)
|
||||||
open class CheckboxItem: SelectorItemBase<Checkbox> {
|
open class CheckboxItem: SelectorItemBase<Checkbox> {
|
||||||
|
|
||||||
|
|||||||
@ -4,7 +4,6 @@ import VDSCoreTokens
|
|||||||
import Combine
|
import Combine
|
||||||
|
|
||||||
/// A dropdown select is an expandable menu of predefined options that allows a customer to make a single selection.
|
/// A dropdown select is an expandable menu of predefined options that allows a customer to make a single selection.
|
||||||
@objcMembers
|
|
||||||
@objc(VDSDatePicker)
|
@objc(VDSDatePicker)
|
||||||
open class DatePicker: EntryFieldBase<String> {
|
open class DatePicker: EntryFieldBase<String> {
|
||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
|
|||||||
@ -11,7 +11,6 @@ import VDSCoreTokens
|
|||||||
import Combine
|
import Combine
|
||||||
|
|
||||||
/// A dropdown select is an expandable menu of predefined options that allows a customer to make a single selection.
|
/// A dropdown select is an expandable menu of predefined options that allows a customer to make a single selection.
|
||||||
@objcMembers
|
|
||||||
@objc(VDSDropdownSelect)
|
@objc(VDSDropdownSelect)
|
||||||
open class DropdownSelect: EntryFieldBase<String> {
|
open class DropdownSelect: EntryFieldBase<String> {
|
||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
|
|||||||
@ -10,7 +10,6 @@ import UIKit
|
|||||||
import VDSCoreTokens
|
import VDSCoreTokens
|
||||||
|
|
||||||
/// This must always be paired with one or more ``Footnote`` in a FootnoteGroup.
|
/// This must always be paired with one or more ``Footnote`` in a FootnoteGroup.
|
||||||
@objcMembers
|
|
||||||
@objc(VDSFootnoteGroup)
|
@objc(VDSFootnoteGroup)
|
||||||
open class FootnoteGroup: View {
|
open class FootnoteGroup: View {
|
||||||
|
|
||||||
|
|||||||
@ -11,7 +11,6 @@ import VDSCoreTokens
|
|||||||
|
|
||||||
/// A footnote is text that provides supporting details, legal copy and links to related content.
|
/// A footnote is text that provides supporting details, legal copy and links to related content.
|
||||||
/// It exists at the bottom or "foot" of a page or section.
|
/// It exists at the bottom or "foot" of a page or section.
|
||||||
@objcMembers
|
|
||||||
@objc(VDSFootnoteItem)
|
@objc(VDSFootnoteItem)
|
||||||
open class FootnoteItem: View {
|
open class FootnoteItem: View {
|
||||||
|
|
||||||
|
|||||||
@ -13,7 +13,6 @@ import Combine
|
|||||||
/// An icon is a graphical element that conveys information at a glance. It helps orient
|
/// An icon is a graphical element that conveys information at a glance. It helps orient
|
||||||
/// a customer, explain functionality and draw attention to interactive elements. Icons
|
/// a customer, explain functionality and draw attention to interactive elements. Icons
|
||||||
/// should have a functional purpose and should never be used for decoration.
|
/// should have a functional purpose and should never be used for decoration.
|
||||||
@objcMembers
|
|
||||||
@objc(VDSIcon)
|
@objc(VDSIcon)
|
||||||
open class Icon: View {
|
open class Icon: View {
|
||||||
|
|
||||||
|
|||||||
@ -11,7 +11,6 @@ import VDSCoreTokens
|
|||||||
import Combine
|
import Combine
|
||||||
|
|
||||||
/// A stepper is a two-segment control that people use to increase or decrease an incremental value.'
|
/// A stepper is a two-segment control that people use to increase or decrease an incremental value.'
|
||||||
@objcMembers
|
|
||||||
@objc(VDSInputStepper)
|
@objc(VDSInputStepper)
|
||||||
open class InputStepper: EntryFieldBase<Int> {
|
open class InputStepper: EntryFieldBase<Int> {
|
||||||
|
|
||||||
|
|||||||
@ -12,7 +12,6 @@ import Combine
|
|||||||
|
|
||||||
/// Label is a standard view used to draw text with applying Typography through ``TextStyle`` as well
|
/// Label is a standard view used to draw text with applying Typography through ``TextStyle`` as well
|
||||||
/// as other attributes using any implemetation of ``LabelAttributeModel``.
|
/// as other attributes using any implemetation of ``LabelAttributeModel``.
|
||||||
@objcMembers
|
|
||||||
@objc(VDSLabel)
|
@objc(VDSLabel)
|
||||||
open class Label: UILabel, ViewProtocol, UserInfoable {
|
open class Label: UILabel, ViewProtocol, UserInfoable {
|
||||||
|
|
||||||
@ -39,7 +38,6 @@ open class Label: UILabel, ViewProtocol, UserInfoable {
|
|||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
/// Set of Subscribers for any Publishers for this Control.
|
/// Set of Subscribers for any Publishers for this Control.
|
||||||
open var subscribers = Set<AnyCancellable>()
|
open var subscribers = Set<AnyCancellable>()
|
||||||
open var subject = PassthroughSubject<Void, Never>()
|
|
||||||
|
|
||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
// MARK: - Private Properties
|
// MARK: - Private Properties
|
||||||
@ -193,19 +191,10 @@ open class Label: UILabel, ViewProtocol, UserInfoable {
|
|||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
// MARK: - Lifecycle
|
// MARK: - Lifecycle
|
||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
/// When the view moves to a window, force any pending update immediately.
|
|
||||||
open override func didMoveToWindow() {
|
|
||||||
super.didMoveToWindow()
|
|
||||||
if window != nil {
|
|
||||||
updateView()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private func initialSetup() {
|
private func initialSetup() {
|
||||||
if !initialSetupPerformed {
|
if !initialSetupPerformed {
|
||||||
initialSetupPerformed = true
|
initialSetupPerformed = true
|
||||||
shouldUpdateView = false
|
shouldUpdateView = false
|
||||||
setupDidChangeEvent(true)
|
|
||||||
setup()
|
setup()
|
||||||
setDefaults()
|
setDefaults()
|
||||||
shouldUpdateView = true
|
shouldUpdateView = true
|
||||||
|
|||||||
@ -10,7 +10,6 @@ import UIKit
|
|||||||
import VDSCoreTokens
|
import VDSCoreTokens
|
||||||
|
|
||||||
/// A line visually separates content sections or elements in lists, tables and layouts to indicate content hierarchy.
|
/// A line visually separates content sections or elements in lists, tables and layouts to indicate content hierarchy.
|
||||||
@objcMembers
|
|
||||||
@objc(VDSLine)
|
@objc(VDSLine)
|
||||||
open class Line: View {
|
open class Line: View {
|
||||||
|
|
||||||
|
|||||||
@ -11,7 +11,6 @@ import VDSCoreTokens
|
|||||||
|
|
||||||
|
|
||||||
/// A loader is an indicator that uses animation to show customers that there is an indefinite amount of wait time while a task is ongoing, e.g. a page is loading, a form is being submitted. The component disappears when the task is complete.
|
/// A loader is an indicator that uses animation to show customers that there is an indefinite amount of wait time while a task is ongoing, e.g. a page is loading, a form is being submitted. The component disappears when the task is complete.
|
||||||
@objcMembers
|
|
||||||
@objc(VDSLoader)
|
@objc(VDSLoader)
|
||||||
open class Loader: View {
|
open class Loader: View {
|
||||||
|
|
||||||
|
|||||||
@ -10,7 +10,6 @@ import UIKit
|
|||||||
import VDSCoreTokens
|
import VDSCoreTokens
|
||||||
|
|
||||||
/// ViewController to show the Loader, this will be presented using the LoaderLaunchable Protocl.
|
/// ViewController to show the Loader, this will be presented using the LoaderLaunchable Protocl.
|
||||||
@objcMembers
|
|
||||||
@objc(VDSLoaderViewController)
|
@objc(VDSLoaderViewController)
|
||||||
open class LoaderViewController: UIViewController, Surfaceable {
|
open class LoaderViewController: UIViewController, Surfaceable {
|
||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
|
|||||||
@ -12,7 +12,6 @@ import Combine
|
|||||||
|
|
||||||
/// A Modal is an overlay that interrupts the user flow to force the customer to provide information or a response.
|
/// A Modal is an overlay that interrupts the user flow to force the customer to provide information or a response.
|
||||||
/// After the customer interacts with the modal, they can return to the parent content.
|
/// After the customer interacts with the modal, they can return to the parent content.
|
||||||
@objcMembers
|
|
||||||
@objc(VDSModal)
|
@objc(VDSModal)
|
||||||
open class Modal: Control, ModalLaunchable {
|
open class Modal: Control, ModalLaunchable {
|
||||||
|
|
||||||
|
|||||||
@ -9,7 +9,6 @@ import Foundation
|
|||||||
import UIKit
|
import UIKit
|
||||||
import VDSCoreTokens
|
import VDSCoreTokens
|
||||||
|
|
||||||
@objcMembers
|
|
||||||
@objc(VDSModalDialog)
|
@objc(VDSModalDialog)
|
||||||
open class ModalDialog: View, UIScrollViewDelegate, ParentViewProtocol {
|
open class ModalDialog: View, UIScrollViewDelegate, ParentViewProtocol {
|
||||||
|
|
||||||
|
|||||||
@ -10,7 +10,6 @@ import UIKit
|
|||||||
import Combine
|
import Combine
|
||||||
import VDSCoreTokens
|
import VDSCoreTokens
|
||||||
|
|
||||||
@objcMembers
|
|
||||||
@objc(VDSModalDialogViewController)
|
@objc(VDSModalDialogViewController)
|
||||||
open class ModalDialogViewController: UIViewController, Surfaceable {
|
open class ModalDialogViewController: UIViewController, Surfaceable {
|
||||||
|
|
||||||
|
|||||||
@ -14,7 +14,6 @@ import Combine
|
|||||||
/// in context. There are four types: information, success, warning and error; each
|
/// in context. There are four types: information, success, warning and error; each
|
||||||
/// with different color and content. They may be screen-specific, flow-specific or
|
/// with different color and content. They may be screen-specific, flow-specific or
|
||||||
/// experience-wide.
|
/// experience-wide.
|
||||||
@objcMembers
|
|
||||||
@objc(VDSNotification)
|
@objc(VDSNotification)
|
||||||
open class Notification: View, ParentViewProtocol {
|
open class Notification: View, ParentViewProtocol {
|
||||||
|
|
||||||
|
|||||||
@ -11,7 +11,6 @@ import VDSCoreTokens
|
|||||||
import Combine
|
import Combine
|
||||||
|
|
||||||
///Pagination is a control that enables customers to navigate multiple pages of content by selecting either a specific page or the next or previous set of four pages.
|
///Pagination is a control that enables customers to navigate multiple pages of content by selecting either a specific page or the next or previous set of four pages.
|
||||||
@objcMembers
|
|
||||||
@objc(VDSPagination)
|
@objc(VDSPagination)
|
||||||
open class Pagination: View {
|
open class Pagination: View {
|
||||||
|
|
||||||
|
|||||||
@ -9,7 +9,6 @@ import UIKit
|
|||||||
import VDSCoreTokens
|
import VDSCoreTokens
|
||||||
|
|
||||||
///This is customised button for Pagination view
|
///This is customised button for Pagination view
|
||||||
@objcMembers
|
|
||||||
@objc(PaginationButton)
|
@objc(PaginationButton)
|
||||||
open class PaginationButton: ButtonBase {
|
open class PaginationButton: ButtonBase {
|
||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
|
|||||||
@ -9,7 +9,6 @@ import Foundation
|
|||||||
import UIKit
|
import UIKit
|
||||||
import VDSCoreTokens
|
import VDSCoreTokens
|
||||||
|
|
||||||
@objcMembers
|
|
||||||
@objc(VDSPriceLockup)
|
@objc(VDSPriceLockup)
|
||||||
open class PriceLockup: View, ParentViewProtocol {
|
open class PriceLockup: View, ParentViewProtocol {
|
||||||
|
|
||||||
|
|||||||
@ -11,7 +11,6 @@ import UIKit
|
|||||||
/// Radio boxes are single-select components through which a customer indicates a choice.
|
/// Radio boxes are single-select components through which a customer indicates a choice.
|
||||||
/// They're stylized ``RadioButtons`` that must always be paired with one or more ``RadioBoxItem``
|
/// They're stylized ``RadioButtons`` that must always be paired with one or more ``RadioBoxItem``
|
||||||
/// in a radio box group. Use radio boxes to display choices like device storage.
|
/// in a radio box group. Use radio boxes to display choices like device storage.
|
||||||
@objcMembers
|
|
||||||
@objc(VDSRadioBoxGroup)
|
@objc(VDSRadioBoxGroup)
|
||||||
open class RadioBoxGroup: SelectorGroupBase<RadioBoxItem>, SelectorGroupSingleSelect {
|
open class RadioBoxGroup: SelectorGroupBase<RadioBoxItem>, SelectorGroupSingleSelect {
|
||||||
|
|
||||||
|
|||||||
@ -12,7 +12,6 @@ import VDSCoreTokens
|
|||||||
|
|
||||||
/// Radio boxes are single-select components through which a customer indicates a choice
|
/// Radio boxes are single-select components through which a customer indicates a choice
|
||||||
/// that are used within a ``RadioBoxGroup``.
|
/// that are used within a ``RadioBoxGroup``.
|
||||||
@objcMembers
|
|
||||||
@objc(VDSRadioBoxItem)
|
@objc(VDSRadioBoxItem)
|
||||||
open class RadioBoxItem: Control, Changeable, FormFieldable, Groupable, ParentViewProtocol {
|
open class RadioBoxItem: Control, Changeable, FormFieldable, Groupable, ParentViewProtocol {
|
||||||
|
|
||||||
|
|||||||
@ -13,7 +13,6 @@ import VDSCoreTokens
|
|||||||
/// Radio buttons are single-select components through which a customer indicates a choice.
|
/// Radio buttons are single-select components through which a customer indicates a choice.
|
||||||
/// They must always be paired with one or more ``RadioButtonItem`` within a ``RadioButtonGroup``.
|
/// They must always be paired with one or more ``RadioButtonItem`` within a ``RadioButtonGroup``.
|
||||||
/// Use radio buttons to display choices like delivery method.
|
/// Use radio buttons to display choices like delivery method.
|
||||||
@objcMembers
|
|
||||||
@objc(VDSRadioButton)
|
@objc(VDSRadioButton)
|
||||||
open class RadioButton: SelectorBase {
|
open class RadioButton: SelectorBase {
|
||||||
|
|
||||||
|
|||||||
@ -11,7 +11,6 @@ import UIKit
|
|||||||
/// Radio buttons items are single-select components through which a customer indicates a choice.
|
/// Radio buttons items are single-select components through which a customer indicates a choice.
|
||||||
/// They must always be paired with one or more other ``RadioButtonItem`` within a radio button group.
|
/// They must always be paired with one or more other ``RadioButtonItem`` within a radio button group.
|
||||||
/// Use radio buttons to display choices like delivery method.
|
/// Use radio buttons to display choices like delivery method.
|
||||||
@objcMembers
|
|
||||||
@objc(VDSRadioButtonGroup)
|
@objc(VDSRadioButtonGroup)
|
||||||
open class RadioButtonGroup: SelectorGroupBase<RadioButtonItem>, SelectorGroupSingleSelect {
|
open class RadioButtonGroup: SelectorGroupBase<RadioButtonItem>, SelectorGroupSingleSelect {
|
||||||
|
|
||||||
|
|||||||
@ -11,7 +11,6 @@ import UIKit
|
|||||||
/// Radio buttons items are single-select components through which a customer indicates a choice.
|
/// Radio buttons items are single-select components through which a customer indicates a choice.
|
||||||
/// They must always be paired with one or more other radio button items within a ``RadioButtonGroup``.
|
/// They must always be paired with one or more other radio button items within a ``RadioButtonGroup``.
|
||||||
/// Use radio buttons to display choices like delivery method.
|
/// Use radio buttons to display choices like delivery method.
|
||||||
@objcMembers
|
|
||||||
@objc(VDSRadioButtonItem)
|
@objc(VDSRadioButtonItem)
|
||||||
open class RadioButtonItem: SelectorItemBase<RadioButton> {
|
open class RadioButtonItem: SelectorItemBase<RadioButton> {
|
||||||
|
|
||||||
|
|||||||
@ -10,7 +10,6 @@ import UIKit
|
|||||||
import VDSCoreTokens
|
import VDSCoreTokens
|
||||||
|
|
||||||
///Table is view composed of rows and columns, which takes any view into each cell and resizes based on the highest cell height.
|
///Table is view composed of rows and columns, which takes any view into each cell and resizes based on the highest cell height.
|
||||||
@objcMembers
|
|
||||||
@objc(VDSTable)
|
@objc(VDSTable)
|
||||||
open class Table: View {
|
open class Table: View {
|
||||||
|
|
||||||
|
|||||||
@ -11,7 +11,6 @@ import VDSCoreTokens
|
|||||||
import Combine
|
import Combine
|
||||||
|
|
||||||
extension Tabs {
|
extension Tabs {
|
||||||
@objcMembers
|
|
||||||
@objc(VDSTab)
|
@objc(VDSTab)
|
||||||
open class Tab: Control, Groupable {
|
open class Tab: Control, Groupable {
|
||||||
|
|
||||||
|
|||||||
@ -10,7 +10,6 @@ import UIKit
|
|||||||
import VDSCoreTokens
|
import VDSCoreTokens
|
||||||
|
|
||||||
/// Tabs are organizational components that group content and allow customers to navigate its display. Use them to separate content when the content is related but doesn’t need to be compared.
|
/// Tabs are organizational components that group content and allow customers to navigate its display. Use them to separate content when the content is related but doesn’t need to be compared.
|
||||||
@objcMembers
|
|
||||||
@objc(VDSTabs)
|
@objc(VDSTabs)
|
||||||
open class Tabs: View, ParentViewProtocol {
|
open class Tabs: View, ParentViewProtocol {
|
||||||
|
|
||||||
|
|||||||
@ -8,7 +8,6 @@
|
|||||||
import Foundation
|
import Foundation
|
||||||
import UIKit
|
import UIKit
|
||||||
|
|
||||||
@objcMembers
|
|
||||||
@objc(VDSTabsContainer)
|
@objc(VDSTabsContainer)
|
||||||
open class TabsContainer: View {
|
open class TabsContainer: View {
|
||||||
|
|
||||||
|
|||||||
@ -13,7 +13,6 @@ import Combine
|
|||||||
/// An input field is an input wherein a customer enters information. They typically appear in forms.
|
/// An input field is an input wherein a customer enters information. They typically appear in forms.
|
||||||
/// Specialized input fields capture credit card numbers, inline actions, passwords, phone numbers,
|
/// Specialized input fields capture credit card numbers, inline actions, passwords, phone numbers,
|
||||||
/// dates and security codes in their correct formats.
|
/// dates and security codes in their correct formats.
|
||||||
@objcMembers
|
|
||||||
@objc(VDSInputField)
|
@objc(VDSInputField)
|
||||||
open class InputField: EntryFieldBase<String> {
|
open class InputField: EntryFieldBase<String> {
|
||||||
|
|
||||||
|
|||||||
@ -10,7 +10,6 @@ import UIKit
|
|||||||
import Combine
|
import Combine
|
||||||
import VDSCoreTokens
|
import VDSCoreTokens
|
||||||
|
|
||||||
@objcMembers
|
|
||||||
@objc(VDSTextField)
|
@objc(VDSTextField)
|
||||||
open class TextField: UITextField, ViewProtocol, Errorable {
|
open class TextField: UITextField, ViewProtocol, Errorable {
|
||||||
|
|
||||||
@ -37,7 +36,6 @@ open class TextField: UITextField, ViewProtocol, Errorable {
|
|||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
/// Set of Subscribers for any Publishers for this Control.
|
/// Set of Subscribers for any Publishers for this Control.
|
||||||
open var subscribers = Set<AnyCancellable>()
|
open var subscribers = Set<AnyCancellable>()
|
||||||
open var subject = PassthroughSubject<Void, Never>()
|
|
||||||
|
|
||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
// MARK: - Private Properties
|
// MARK: - Private Properties
|
||||||
@ -99,19 +97,10 @@ open class TextField: UITextField, ViewProtocol, Errorable {
|
|||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
// MARK: - Lifecycle
|
// MARK: - Lifecycle
|
||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
/// When the view moves to a window, force any pending update immediately.
|
|
||||||
open override func didMoveToWindow() {
|
|
||||||
super.didMoveToWindow()
|
|
||||||
if window != nil {
|
|
||||||
updateView()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private func initialSetup() {
|
private func initialSetup() {
|
||||||
if !initialSetupPerformed {
|
if !initialSetupPerformed {
|
||||||
initialSetupPerformed = true
|
initialSetupPerformed = true
|
||||||
shouldUpdateView = false
|
shouldUpdateView = false
|
||||||
setupDidChangeEvent(true)
|
|
||||||
setup()
|
setup()
|
||||||
setDefaults()
|
setDefaults()
|
||||||
shouldUpdateView = true
|
shouldUpdateView = true
|
||||||
|
|||||||
@ -12,7 +12,6 @@ import Combine
|
|||||||
|
|
||||||
/// A text area is an input wherein a customer enters long-form information.
|
/// A text area is an input wherein a customer enters long-form information.
|
||||||
/// Use a text area when you want customers to enter text that’s longer than a single line.
|
/// Use a text area when you want customers to enter text that’s longer than a single line.
|
||||||
@objcMembers
|
|
||||||
@objc(VDSTextArea)
|
@objc(VDSTextArea)
|
||||||
open class TextArea: EntryFieldBase<String> {
|
open class TextArea: EntryFieldBase<String> {
|
||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
|
|||||||
@ -10,7 +10,6 @@ import UIKit
|
|||||||
import Combine
|
import Combine
|
||||||
import VDSCoreTokens
|
import VDSCoreTokens
|
||||||
|
|
||||||
@objcMembers
|
|
||||||
@objc(VDSTextView)
|
@objc(VDSTextView)
|
||||||
open class TextView: UITextView, ViewProtocol, Errorable {
|
open class TextView: UITextView, ViewProtocol, Errorable {
|
||||||
|
|
||||||
@ -37,7 +36,6 @@ open class TextView: UITextView, ViewProtocol, Errorable {
|
|||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
/// Set of Subscribers for any Publishers for this Control.
|
/// Set of Subscribers for any Publishers for this Control.
|
||||||
open var subscribers = Set<AnyCancellable>()
|
open var subscribers = Set<AnyCancellable>()
|
||||||
open var subject = PassthroughSubject<Void, Never>()
|
|
||||||
|
|
||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
// MARK: - Private Properties
|
// MARK: - Private Properties
|
||||||
@ -108,19 +106,10 @@ open class TextView: UITextView, ViewProtocol, Errorable {
|
|||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
// MARK: - Lifecycle
|
// MARK: - Lifecycle
|
||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
/// When the view moves to a window, force any pending update immediately.
|
|
||||||
open override func didMoveToWindow() {
|
|
||||||
super.didMoveToWindow()
|
|
||||||
if window != nil {
|
|
||||||
updateView()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private func initialSetup() {
|
private func initialSetup() {
|
||||||
if !initialSetupPerformed {
|
if !initialSetupPerformed {
|
||||||
initialSetupPerformed = true
|
initialSetupPerformed = true
|
||||||
shouldUpdateView = false
|
shouldUpdateView = false
|
||||||
setupDidChangeEvent(true)
|
|
||||||
setup()
|
setup()
|
||||||
setDefaults()
|
setDefaults()
|
||||||
shouldUpdateView = true
|
shouldUpdateView = true
|
||||||
|
|||||||
@ -10,7 +10,6 @@ import VDSCoreTokens
|
|||||||
import UIKit
|
import UIKit
|
||||||
import Combine
|
import Combine
|
||||||
|
|
||||||
@objcMembers
|
|
||||||
@objc(VDSTileContainer)
|
@objc(VDSTileContainer)
|
||||||
open class TileContainer: TileContainerBase<TileContainer.Padding> {
|
open class TileContainer: TileContainerBase<TileContainer.Padding> {
|
||||||
|
|
||||||
|
|||||||
@ -15,7 +15,6 @@ import Combine
|
|||||||
/// support quick scanning and engagement. A Tilelet is fully clickable and
|
/// support quick scanning and engagement. A Tilelet is fully clickable and
|
||||||
/// while it can include an arrow CTA, it does not require one in order to
|
/// while it can include an arrow CTA, it does not require one in order to
|
||||||
/// function.
|
/// function.
|
||||||
@objcMembers
|
|
||||||
@objc(VDSTilelet)
|
@objc(VDSTilelet)
|
||||||
open class Tilelet: TileContainerBase<Tilelet.Padding>, ParentViewProtocol {
|
open class Tilelet: TileContainerBase<Tilelet.Padding>, ParentViewProtocol {
|
||||||
|
|
||||||
|
|||||||
@ -12,7 +12,6 @@ import Combine
|
|||||||
|
|
||||||
/// Title Lockup ensures the readability of words on the screen
|
/// Title Lockup ensures the readability of words on the screen
|
||||||
/// with approved built in text size configurations.
|
/// with approved built in text size configurations.
|
||||||
@objcMembers
|
|
||||||
@objc(VDSTitleLockup)
|
@objc(VDSTitleLockup)
|
||||||
open class TitleLockup: View, ParentViewProtocol {
|
open class TitleLockup: View, ParentViewProtocol {
|
||||||
|
|
||||||
|
|||||||
@ -12,7 +12,6 @@ import Combine
|
|||||||
|
|
||||||
/// A toggle is a control that lets customers instantly turn on
|
/// A toggle is a control that lets customers instantly turn on
|
||||||
/// or turn off a single option, setting or function.
|
/// or turn off a single option, setting or function.
|
||||||
@objcMembers
|
|
||||||
@objc(VDSToggle)
|
@objc(VDSToggle)
|
||||||
open class Toggle: Control, Changeable, FormFieldable, ParentViewProtocol {
|
open class Toggle: Control, Changeable, FormFieldable, ParentViewProtocol {
|
||||||
|
|
||||||
|
|||||||
@ -12,7 +12,6 @@ import Combine
|
|||||||
|
|
||||||
/// A toggle is a control that lets customers instantly turn on
|
/// A toggle is a control that lets customers instantly turn on
|
||||||
/// or turn off a single option, setting or function.
|
/// or turn off a single option, setting or function.
|
||||||
@objcMembers
|
|
||||||
@objc(VDSToggleView)
|
@objc(VDSToggleView)
|
||||||
open class ToggleView: Control, Changeable, FormFieldable {
|
open class ToggleView: Control, Changeable, FormFieldable {
|
||||||
|
|
||||||
|
|||||||
@ -13,7 +13,6 @@ import Combine
|
|||||||
/// A tooltip is an overlay that clarifies another component or content
|
/// A tooltip is an overlay that clarifies another component or content
|
||||||
/// element. It is triggered when a customer hovers, clicks or taps
|
/// element. It is triggered when a customer hovers, clicks or taps
|
||||||
/// the tooltip icon.
|
/// the tooltip icon.
|
||||||
@objcMembers
|
|
||||||
@objc(VDSTooltip)
|
@objc(VDSTooltip)
|
||||||
open class Tooltip: Control, TooltipLaunchable {
|
open class Tooltip: Control, TooltipLaunchable {
|
||||||
|
|
||||||
|
|||||||
@ -10,7 +10,6 @@ import UIKit
|
|||||||
import Combine
|
import Combine
|
||||||
import VDSCoreTokens
|
import VDSCoreTokens
|
||||||
|
|
||||||
@objcMembers
|
|
||||||
@objc(VDSTooltipAlertViewController)
|
@objc(VDSTooltipAlertViewController)
|
||||||
open class TooltipAlertViewController: UIViewController, Surfaceable {
|
open class TooltipAlertViewController: UIViewController, Surfaceable {
|
||||||
|
|
||||||
|
|||||||
@ -9,7 +9,6 @@ import Foundation
|
|||||||
import UIKit
|
import UIKit
|
||||||
import VDSCoreTokens
|
import VDSCoreTokens
|
||||||
|
|
||||||
@objcMembers
|
|
||||||
@objc(VDSTooltipDialog)
|
@objc(VDSTooltipDialog)
|
||||||
open class TooltipDialog: View, UIScrollViewDelegate, ParentViewProtocol {
|
open class TooltipDialog: View, UIScrollViewDelegate, ParentViewProtocol {
|
||||||
|
|
||||||
|
|||||||
@ -10,8 +10,6 @@ import UIKit
|
|||||||
import Combine
|
import Combine
|
||||||
|
|
||||||
public protocol ViewProtocol: AnyObject, Initable, Resettable, Enabling, Surfaceable, AccessibilityUpdatable {
|
public protocol ViewProtocol: AnyObject, Initable, Resettable, Enabling, Surfaceable, AccessibilityUpdatable {
|
||||||
var subject: PassthroughSubject<Void, Never> { get set }
|
|
||||||
|
|
||||||
/// Set of Subscribers for any Publishers for this Control.
|
/// Set of Subscribers for any Publishers for this Control.
|
||||||
var subscribers: Set<AnyCancellable> { get set }
|
var subscribers: Set<AnyCancellable> { get set }
|
||||||
|
|
||||||
@ -38,48 +36,28 @@ extension ViewProtocol {
|
|||||||
|
|
||||||
/// Called when there are changes in a View based off a change events or from local properties.
|
/// Called when there are changes in a View based off a change events or from local properties.
|
||||||
public func setNeedsUpdate() {
|
public func setNeedsUpdate() {
|
||||||
// if shouldUpdateView {
|
if shouldUpdateView {
|
||||||
// shouldUpdateView = false
|
shouldUpdateView = false
|
||||||
//
|
|
||||||
// //see if this is a view that has children
|
|
||||||
// let parent = self as? any ParentViewProtocol
|
|
||||||
// let children = parent?.getAllChildren()
|
|
||||||
// //if so turn off the shouldUpdate to keep UI
|
|
||||||
// //from blocking
|
|
||||||
// children?.forEach{ $0.shouldUpdateView = false }
|
|
||||||
//
|
|
||||||
// updateView()
|
|
||||||
// updateAccessibility()
|
|
||||||
//
|
|
||||||
// //if so turn on
|
|
||||||
// children?.forEach{
|
|
||||||
// $0.updateView()
|
|
||||||
// $0.updateAccessibility()
|
|
||||||
// $0.shouldUpdateView = true
|
|
||||||
// }
|
|
||||||
// shouldUpdateView = true
|
|
||||||
// }
|
|
||||||
subject.send()
|
|
||||||
}
|
|
||||||
|
|
||||||
public func setupDidChangeEvent(_ debounce: Bool = false) {
|
//see if this is a view that has children
|
||||||
handlerPublisher(debounce)
|
let parent = self as? any ParentViewProtocol
|
||||||
.sink { [weak self] _ in
|
let children = parent?.getAllChildren()
|
||||||
self?.updateView()
|
//if so turn off the shouldUpdate to keep UI
|
||||||
}.store(in: &subscribers)
|
//from blocking
|
||||||
}
|
children?.forEach{ $0.shouldUpdateView = false }
|
||||||
|
|
||||||
public func handlerPublisher(_ debounce: Bool = false) -> AnyPublisher<Void, Never> {
|
updateView()
|
||||||
if debounce {
|
updateAccessibility()
|
||||||
return subject
|
|
||||||
.debounce(for: .seconds(0.05), scheduler: RunLoop.main)
|
|
||||||
.eraseToAnyPublisher()
|
|
||||||
} else {
|
|
||||||
return subject
|
|
||||||
.eraseToAnyPublisher()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
//if so turn on
|
||||||
|
children?.forEach{
|
||||||
|
$0.updateView()
|
||||||
|
$0.updateAccessibility()
|
||||||
|
$0.shouldUpdateView = true
|
||||||
|
}
|
||||||
|
shouldUpdateView = true
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
extension ViewProtocol where Self: UIView {
|
extension ViewProtocol where Self: UIView {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user