Digital ACT-191 ONEAPP-6827 story: added new breadcrumbItem page
This commit is contained in:
parent
a5f2116470
commit
e8049108d6
@ -32,6 +32,8 @@
|
||||
/* End PBXAggregateTarget section */
|
||||
|
||||
/* Begin PBXBuildFile section */
|
||||
1832AC5B2BA1347B008AE476 /* BreadcrumbsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1832AC5A2BA1347B008AE476 /* BreadcrumbsViewController.swift */; };
|
||||
1832AC5D2BA13499008AE476 /* BreadcrumbItemViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1832AC5C2BA13499008AE476 /* BreadcrumbItemViewController.swift */; };
|
||||
445BA07A29C088470036A7C5 /* NotificationViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 445BA07929C088470036A7C5 /* NotificationViewController.swift */; };
|
||||
44604AD929CE1CF900E62B51 /* LineViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 44604AD829CE1CF900E62B51 /* LineViewController.swift */; };
|
||||
5FC35BE928D5235A004EBEAC /* ButtonViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5FC35BE828D5235A004EBEAC /* ButtonViewController.swift */; };
|
||||
@ -127,6 +129,8 @@
|
||||
/* End PBXCopyFilesBuildPhase section */
|
||||
|
||||
/* Begin PBXFileReference section */
|
||||
1832AC5A2BA1347B008AE476 /* BreadcrumbsViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BreadcrumbsViewController.swift; sourceTree = "<group>"; };
|
||||
1832AC5C2BA13499008AE476 /* BreadcrumbItemViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BreadcrumbItemViewController.swift; sourceTree = "<group>"; };
|
||||
445BA07929C088470036A7C5 /* NotificationViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NotificationViewController.swift; sourceTree = "<group>"; };
|
||||
44604AD829CE1CF900E62B51 /* LineViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LineViewController.swift; sourceTree = "<group>"; };
|
||||
5FC35BE828D5235A004EBEAC /* ButtonViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ButtonViewController.swift; sourceTree = "<group>"; };
|
||||
@ -314,6 +318,8 @@
|
||||
EAB1D2C828AAAA1D00DAE764 /* BaseViewController.swift */,
|
||||
EA4DB30328DCD25B00103EE3 /* BadgeViewController.swift */,
|
||||
EAD062AC2A3B86950015965D /* BadgeIndicatorViewController.swift */,
|
||||
1832AC5C2BA13499008AE476 /* BreadcrumbItemViewController.swift */,
|
||||
1832AC5A2BA1347B008AE476 /* BreadcrumbsViewController.swift */,
|
||||
EA81410D2A0ED8DC004F60D2 /* ButtonIconViewController.swift */,
|
||||
EAB5FEEE2927E28400998C17 /* ButtonGroupViewController.swift */,
|
||||
5FC35BE828D5235A004EBEAC /* ButtonViewController.swift */,
|
||||
@ -500,6 +506,7 @@
|
||||
EA5E3050294D11540082B959 /* TileContainerViewController.swift in Sources */,
|
||||
445BA07A29C088470036A7C5 /* NotificationViewController.swift in Sources */,
|
||||
EAEEEC942B1F824500531FC2 /* Bundle.swift in Sources */,
|
||||
1832AC5D2BA13499008AE476 /* BreadcrumbItemViewController.swift in Sources */,
|
||||
EAF7F11A28A14A0E00B287F5 /* RadioButtonGroupViewController.swift in Sources */,
|
||||
EA89204628B66CE2006B9984 /* ScrollViewController.swift in Sources */,
|
||||
EA471F402A97BEAA00CE9E58 /* CustomRotorable.swift in Sources */,
|
||||
@ -526,6 +533,7 @@
|
||||
EA89204E28B67332006B9984 /* CheckBoxGroupViewController.swift in Sources */,
|
||||
EAA5EEAD28EB6924003B3210 /* InputFieldViewController.swift in Sources */,
|
||||
EA985C25296E06EA00F2FF2E /* TextAreaViewController.swift in Sources */,
|
||||
1832AC5B2BA1347B008AE476 /* BreadcrumbsViewController.swift in Sources */,
|
||||
EA81410E2A0ED8DC004F60D2 /* ButtonIconViewController.swift in Sources */,
|
||||
EA985C20296DECF600F2FF2E /* IconName.swift in Sources */,
|
||||
EA89204928B66CE2006B9984 /* KeyboardFrameChangeListening.swift in Sources */,
|
||||
|
||||
82
VDSSample/ViewControllers/BreadcrumbItemViewController.swift
Normal file
82
VDSSample/ViewControllers/BreadcrumbItemViewController.swift
Normal file
@ -0,0 +1,82 @@
|
||||
//
|
||||
// BreadcrumbItemViewController.swift
|
||||
// VDSSample
|
||||
//
|
||||
// Created by Kanamarlapudi, Vasavi on 11/03/24.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import UIKit
|
||||
import VDS
|
||||
import VDSColorTokens
|
||||
|
||||
class BreadcrumbItemViewController: BaseViewController<BreadcrumbItem> {
|
||||
|
||||
var label = Label()
|
||||
var disabledSwitch = Toggle()
|
||||
var selectedSwitch = Toggle()
|
||||
var textField = TextField()
|
||||
|
||||
override func viewDidLoad() {
|
||||
super.viewDidLoad()
|
||||
addContentTopView(view: .makeWrapper(for: component, edgeSpacing: 16.0), edgeSpacing: 0.0)
|
||||
|
||||
setupPicker()
|
||||
setupModel()
|
||||
}
|
||||
|
||||
override func allTextFields() -> [TextField]? { [textField] }
|
||||
|
||||
override func setupForm(){
|
||||
super.setupForm()
|
||||
addFormRow(label: "Action", view: label)
|
||||
addFormRow(label: "Surface", view: surfacePickerSelectorView)
|
||||
addFormRow(label: "Disabled", view: disabledSwitch)
|
||||
addFormRow(label: "Label", view: textField)
|
||||
addFormRow(label: "selected", view: selectedSwitch)
|
||||
|
||||
disabledSwitch.onChange = { [weak self] sender in
|
||||
self?.component.isEnabled = !sender.isOn
|
||||
}
|
||||
|
||||
selectedSwitch.onChange = { [weak self] sender in
|
||||
guard let self else { return }
|
||||
self.component.selectable = !self.component.selectable
|
||||
}
|
||||
|
||||
textField
|
||||
.textPublisher
|
||||
.sink { [weak self] text in
|
||||
self?.component.text = text
|
||||
}.store(in: &subscribers)
|
||||
}
|
||||
|
||||
func setupModel() {
|
||||
component.text = "Billing statement FAQs"
|
||||
component.labelPublisher(label)
|
||||
// component.selectable = selectedSwitch.isOn
|
||||
|
||||
//setup UI
|
||||
surfacePickerSelectorView.text = component.surface.rawValue
|
||||
disabledSwitch.isOn = !component.isEnabled
|
||||
// selectedSwitch.isOn = !component.isSelected
|
||||
textField.text = component.text
|
||||
}
|
||||
|
||||
func setupPicker(){
|
||||
|
||||
surfacePickerSelectorView.onPickerDidSelect = { [weak self] item in
|
||||
self?.component.surface = item
|
||||
self?.contentTopView.backgroundColor = item.color
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
extension BreadcrumbItemViewController: ComponentSampleable {
|
||||
static func makeSample() -> ComponentSample {
|
||||
let component = Self.makeComponent()
|
||||
component.text = "Billing statement FAQs"
|
||||
component.onClick = { c in print("\(c.text!) Click")}
|
||||
return ComponentSample(component: component, trailingPinningType: .lessThanOrEqual)
|
||||
}
|
||||
}
|
||||
16
VDSSample/ViewControllers/BreadcrumbsViewController.swift
Normal file
16
VDSSample/ViewControllers/BreadcrumbsViewController.swift
Normal file
@ -0,0 +1,16 @@
|
||||
//
|
||||
// BreadcrumbsViewController.swift
|
||||
// VDSSample
|
||||
//
|
||||
// Created by Kanamarlapudi, Vasavi on 05/03/24.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import UIKit
|
||||
import VDS
|
||||
import VDSColorTokens
|
||||
import Combine
|
||||
|
||||
class BreadcrumbsViewController: BaseViewController<Breadcrumbs> {
|
||||
|
||||
}
|
||||
@ -70,6 +70,7 @@ class MenuViewController: UITableViewController, TooltipLaunchable {
|
||||
MenuComponent(title: "TableView Tester", completed: true, viewController: TableViewTestController.self),
|
||||
MenuComponent(title: "Badge", completed: true, viewController: BadgeViewController.self),
|
||||
MenuComponent(title: "Badge Indicator", completed: true, viewController: BadgeIndicatorViewController.self),
|
||||
MenuComponent(title: "Breadcrumb Item", completed: true, viewController: BreadcrumbItemViewController.self),
|
||||
MenuComponent(title: "Button", completed: true, viewController: ButtonViewController.self),
|
||||
MenuComponent(title: "ButtonGroup", completed: true, viewController: ButtonGroupViewController.self),
|
||||
MenuComponent(title: "ButtonIcon", completed: true, viewController: ButtonIconViewController.self),
|
||||
|
||||
Loading…
Reference in New Issue
Block a user