Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
dbb8124882 | ||
|
|
e27b421311 | ||
|
|
fd47fde62e | ||
|
|
76fd6a119c |
@ -37,6 +37,7 @@
|
|||||||
1832AC5B2BA1347B008AE476 /* BreadcrumbsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1832AC5A2BA1347B008AE476 /* BreadcrumbsViewController.swift */; };
|
1832AC5B2BA1347B008AE476 /* BreadcrumbsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1832AC5A2BA1347B008AE476 /* BreadcrumbsViewController.swift */; };
|
||||||
183B16F52C80B27C00BA6A10 /* FootnoteGroupViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 183B16F42C80B27C00BA6A10 /* FootnoteGroupViewController.swift */; };
|
183B16F52C80B27C00BA6A10 /* FootnoteGroupViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 183B16F42C80B27C00BA6A10 /* FootnoteGroupViewController.swift */; };
|
||||||
184023492C61E9E700A412C8 /* PriceLockupViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 184023482C61E9E700A412C8 /* PriceLockupViewController.swift */; };
|
184023492C61E9E700A412C8 /* PriceLockupViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 184023482C61E9E700A412C8 /* PriceLockupViewController.swift */; };
|
||||||
|
1859B3152CBF77B30031CD70 /* ListUnorderedViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1859B3142CBF77B30031CD70 /* ListUnorderedViewController.swift */; };
|
||||||
186D13CD2BBA990800986B53 /* DropdownSelectViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 186D13CC2BBA990800986B53 /* DropdownSelectViewController.swift */; };
|
186D13CD2BBA990800986B53 /* DropdownSelectViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 186D13CC2BBA990800986B53 /* DropdownSelectViewController.swift */; };
|
||||||
18926F5F2C76185A00C55BF6 /* FootnoteItemViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 18926F5E2C76185A00C55BF6 /* FootnoteItemViewController.swift */; };
|
18926F5F2C76185A00C55BF6 /* FootnoteItemViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 18926F5E2C76185A00C55BF6 /* FootnoteItemViewController.swift */; };
|
||||||
18A3F1302BD9332500498E4A /* CalendarViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 18A3F12F2BD9332500498E4A /* CalendarViewController.swift */; };
|
18A3F1302BD9332500498E4A /* CalendarViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 18A3F12F2BD9332500498E4A /* CalendarViewController.swift */; };
|
||||||
@ -141,6 +142,7 @@
|
|||||||
1832AC5A2BA1347B008AE476 /* BreadcrumbsViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BreadcrumbsViewController.swift; sourceTree = "<group>"; };
|
1832AC5A2BA1347B008AE476 /* BreadcrumbsViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BreadcrumbsViewController.swift; sourceTree = "<group>"; };
|
||||||
183B16F42C80B27C00BA6A10 /* FootnoteGroupViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FootnoteGroupViewController.swift; sourceTree = "<group>"; };
|
183B16F42C80B27C00BA6A10 /* FootnoteGroupViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FootnoteGroupViewController.swift; sourceTree = "<group>"; };
|
||||||
184023482C61E9E700A412C8 /* PriceLockupViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PriceLockupViewController.swift; sourceTree = "<group>"; };
|
184023482C61E9E700A412C8 /* PriceLockupViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PriceLockupViewController.swift; sourceTree = "<group>"; };
|
||||||
|
1859B3142CBF77B30031CD70 /* ListUnorderedViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListUnorderedViewController.swift; sourceTree = "<group>"; };
|
||||||
186D13CC2BBA990800986B53 /* DropdownSelectViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DropdownSelectViewController.swift; sourceTree = "<group>"; };
|
186D13CC2BBA990800986B53 /* DropdownSelectViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DropdownSelectViewController.swift; sourceTree = "<group>"; };
|
||||||
18926F5E2C76185A00C55BF6 /* FootnoteItemViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FootnoteItemViewController.swift; sourceTree = "<group>"; };
|
18926F5E2C76185A00C55BF6 /* FootnoteItemViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FootnoteItemViewController.swift; sourceTree = "<group>"; };
|
||||||
18A3F12F2BD9332500498E4A /* CalendarViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CalendarViewController.swift; sourceTree = "<group>"; };
|
18A3F12F2BD9332500498E4A /* CalendarViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CalendarViewController.swift; sourceTree = "<group>"; };
|
||||||
@ -357,6 +359,7 @@
|
|||||||
180636CA2C29B12B00C92D86 /* InputStepperViewController.swift */,
|
180636CA2C29B12B00C92D86 /* InputStepperViewController.swift */,
|
||||||
EAB1D2D328AC409F00DAE764 /* LabelViewController.swift */,
|
EAB1D2D328AC409F00DAE764 /* LabelViewController.swift */,
|
||||||
44604AD829CE1CF900E62B51 /* LineViewController.swift */,
|
44604AD829CE1CF900E62B51 /* LineViewController.swift */,
|
||||||
|
1859B3142CBF77B30031CD70 /* ListUnorderedViewController.swift */,
|
||||||
EAD0688F2A55FC11002E3A2D /* LoaderViewController.swift */,
|
EAD0688F2A55FC11002E3A2D /* LoaderViewController.swift */,
|
||||||
18C0F9472C98177F00E1DD71 /* ModalViewController.swift */,
|
18C0F9472C98177F00E1DD71 /* ModalViewController.swift */,
|
||||||
445BA07929C088470036A7C5 /* NotificationViewController.swift */,
|
445BA07929C088470036A7C5 /* NotificationViewController.swift */,
|
||||||
@ -562,6 +565,7 @@
|
|||||||
EAB5FEF32928153D00998C17 /* Helper.swift in Sources */,
|
EAB5FEF32928153D00998C17 /* Helper.swift in Sources */,
|
||||||
EA89204728B66CE2006B9984 /* KeyboardFrameChangeListener.swift in Sources */,
|
EA89204728B66CE2006B9984 /* KeyboardFrameChangeListener.swift in Sources */,
|
||||||
EA4DB30428DCD25B00103EE3 /* BadgeViewController.swift in Sources */,
|
EA4DB30428DCD25B00103EE3 /* BadgeViewController.swift in Sources */,
|
||||||
|
1859B3152CBF77B30031CD70 /* ListUnorderedViewController.swift in Sources */,
|
||||||
18C0F9482C98177F00E1DD71 /* ModalViewController.swift in Sources */,
|
18C0F9482C98177F00E1DD71 /* ModalViewController.swift in Sources */,
|
||||||
EAB2376029E88D5D00AABE9A /* TooltipViewController.swift in Sources */,
|
EAB2376029E88D5D00AABE9A /* TooltipViewController.swift in Sources */,
|
||||||
EA89204828B66CE2006B9984 /* ScrollViewKeyboardAvoiding.swift in Sources */,
|
EA89204828B66CE2006B9984 /* ScrollViewKeyboardAvoiding.swift in Sources */,
|
||||||
|
|||||||
138
VDSSample/ViewControllers/ListUnorderedViewController.swift
Normal file
138
VDSSample/ViewControllers/ListUnorderedViewController.swift
Normal file
@ -0,0 +1,138 @@
|
|||||||
|
//
|
||||||
|
// ListUnorderedViewController.swift
|
||||||
|
// VDSSample
|
||||||
|
//
|
||||||
|
// Created by Vasavi Kanamarlapudi on 16/10/24.
|
||||||
|
//
|
||||||
|
|
||||||
|
import Foundation
|
||||||
|
import VDS
|
||||||
|
|
||||||
|
class ListUnorderedViewController: BaseViewController<ListUnordered> {
|
||||||
|
|
||||||
|
lazy var sizePickerView = {
|
||||||
|
PickerSelectorView(title: "Large",
|
||||||
|
picker: self.picker,
|
||||||
|
items: ListUnordered.Size.allCases)
|
||||||
|
}()
|
||||||
|
|
||||||
|
lazy var spacingPickerView = {
|
||||||
|
PickerSelectorView(title:"Standard",
|
||||||
|
picker: self.picker,
|
||||||
|
items: ListUnordered.Spacing.allCases)
|
||||||
|
}()
|
||||||
|
|
||||||
|
var leadInTextField = TextField()
|
||||||
|
var itemLevelTwoTextOne = TextField()
|
||||||
|
var itemLevelTwoTextTwo = TextField()
|
||||||
|
|
||||||
|
var unorderedList: [ListUnordered.ListUnorderedItemModel]?
|
||||||
|
|
||||||
|
override func viewDidLoad() {
|
||||||
|
super.viewDidLoad()
|
||||||
|
addContentTopView(view: component)
|
||||||
|
setupPicker()
|
||||||
|
setupModel()
|
||||||
|
}
|
||||||
|
|
||||||
|
override func setupForm() {
|
||||||
|
super.setupForm()
|
||||||
|
addFormRow(label: "Surface", view: surfacePickerSelectorView)
|
||||||
|
addFormRow(label: "Size", view: sizePickerView)
|
||||||
|
addFormRow(label: "Spacing", view: spacingPickerView)
|
||||||
|
|
||||||
|
let form1 = FormSection()
|
||||||
|
form1.title = "Lead-In Text (optional)"
|
||||||
|
form1.addFormRow(label: "Lead In Text", view: leadInTextField)
|
||||||
|
|
||||||
|
let form2 = FormSection()
|
||||||
|
form2.title = "List Item Level 2 (Optional)"
|
||||||
|
form2.addFormRow(label: "Subtext 1", view: itemLevelTwoTextOne)
|
||||||
|
form2.addFormRow(label: "Subtext 2", view: itemLevelTwoTextTwo)
|
||||||
|
|
||||||
|
append(section: form1)
|
||||||
|
append(section: form2)
|
||||||
|
|
||||||
|
leadInTextField
|
||||||
|
.textPublisher
|
||||||
|
.sink { [weak self] text in
|
||||||
|
self?.component.leadInText = text
|
||||||
|
}.store(in: &subscribers)
|
||||||
|
|
||||||
|
itemLevelTwoTextOne
|
||||||
|
.textPublisher
|
||||||
|
.sink { [weak self] text in
|
||||||
|
guard let self else { return }
|
||||||
|
self.updateUnorderList()
|
||||||
|
self.component.unorderedList = unorderedList ?? []
|
||||||
|
}.store(in: &subscribers)
|
||||||
|
|
||||||
|
itemLevelTwoTextTwo
|
||||||
|
.textPublisher
|
||||||
|
.sink { [weak self] text in
|
||||||
|
guard let self else { return }
|
||||||
|
self.updateUnorderList()
|
||||||
|
self.component.unorderedList = unorderedList ?? []
|
||||||
|
}.store(in: &subscribers)
|
||||||
|
}
|
||||||
|
|
||||||
|
func setupPicker() {
|
||||||
|
surfacePickerSelectorView.onPickerDidSelect = { [weak self] item in
|
||||||
|
self?.component.surface = item
|
||||||
|
self?.contentTopView.backgroundColor = item.color
|
||||||
|
}
|
||||||
|
|
||||||
|
sizePickerView.onPickerDidSelect = { [weak self] item in
|
||||||
|
self?.component.size = item
|
||||||
|
}
|
||||||
|
|
||||||
|
spacingPickerView.onPickerDidSelect = { [weak self] item in
|
||||||
|
self?.component.spacing = item
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func setupModel() {
|
||||||
|
sizePickerView.text = component.size.rawValue
|
||||||
|
spacingPickerView.text = component.spacing.rawValue
|
||||||
|
leadInTextField.text = "To manage your existing Call Intercept calling feature:"
|
||||||
|
self.component.leadInText = leadInTextField.text
|
||||||
|
itemLevelTwoTextOne.text = "Priority callers can bypass Call Intercept by entering your 4 digit Call Intercept Override Code."
|
||||||
|
itemLevelTwoTextTwo.text = "Your phone will alert you with a short-short-long ring and \"Priority Caller\" will appear on your display."
|
||||||
|
updateUnorderList()
|
||||||
|
self.component.unorderedList = self.unorderedList ?? []
|
||||||
|
}
|
||||||
|
|
||||||
|
// Update test data
|
||||||
|
func updateUnorderList() {
|
||||||
|
if (itemLevelTwoTextOne.text?.isEmpty == true) {
|
||||||
|
itemLevelTwoTextOne.text = nil
|
||||||
|
}
|
||||||
|
if (itemLevelTwoTextTwo.text?.isEmpty == true) {
|
||||||
|
itemLevelTwoTextTwo.text = nil
|
||||||
|
}
|
||||||
|
var levelTwoSubTexts : [String?]? = nil
|
||||||
|
if let subtextOneEmpty = itemLevelTwoTextOne.text?.isEmpty, let subtextTwoEmpty = itemLevelTwoTextTwo.text?.isEmpty {
|
||||||
|
if !subtextOneEmpty && !subtextTwoEmpty {
|
||||||
|
levelTwoSubTexts = [itemLevelTwoTextOne.text, itemLevelTwoTextTwo.text]
|
||||||
|
} else if !subtextOneEmpty || !subtextTwoEmpty {
|
||||||
|
if subtextOneEmpty {
|
||||||
|
levelTwoSubTexts = [itemLevelTwoTextTwo.text]
|
||||||
|
} else if subtextTwoEmpty {
|
||||||
|
levelTwoSubTexts = [itemLevelTwoTextOne.text]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
unorderedList = [
|
||||||
|
.init(itemLevelOneText: "Call 800-435-7986 to have your PIN reset."),
|
||||||
|
.init(itemLevelOneText: "To bypass Call Intercept",
|
||||||
|
itemLevelTwoTexts: levelTwoSubTexts)
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
extension ListUnorderedViewController: ComponentSampleable {
|
||||||
|
static func makeSample() -> ComponentSample {
|
||||||
|
let component = Self.makeComponent()
|
||||||
|
return ComponentSample(component: component)
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -89,6 +89,7 @@ class MenuViewController: UITableViewController, TooltipLaunchable {
|
|||||||
MenuComponent(title: "InputStepper", completed: true, viewController: InputStepperViewController.self),
|
MenuComponent(title: "InputStepper", completed: true, viewController: InputStepperViewController.self),
|
||||||
MenuComponent(title: "Label", completed: true, viewController: LabelViewController.self),
|
MenuComponent(title: "Label", completed: true, viewController: LabelViewController.self),
|
||||||
MenuComponent(title: "Line", completed: true, viewController: LineViewController.self),
|
MenuComponent(title: "Line", completed: true, viewController: LineViewController.self),
|
||||||
|
MenuComponent(title: "List Unordered", completed: false, viewController: ListUnorderedViewController.self),
|
||||||
MenuComponent(title: "Loader", completed: true, viewController: LoaderViewController.self),
|
MenuComponent(title: "Loader", completed: true, viewController: LoaderViewController.self),
|
||||||
MenuComponent(title: "Modal", completed: true, viewController: ModalViewController.self),
|
MenuComponent(title: "Modal", completed: true, viewController: ModalViewController.self),
|
||||||
MenuComponent(title: "Notification", completed: true, viewController: NotificationViewController.self),
|
MenuComponent(title: "Notification", completed: true, viewController: NotificationViewController.self),
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user