Digital ACT-191 ONEAPP-7013 story: minor changes, added carousel to menu

This commit is contained in:
vasavk 2024-06-14 13:30:25 +05:30
parent 4fe4fa0eef
commit 8de1ac8d99
2 changed files with 14 additions and 13 deletions

View File

@ -14,13 +14,13 @@ import VDSTokens
class CarouselViewController: BaseViewController<Carousel> {
let label = Label()
lazy var scalingTypePickerSelectorView = {
PickerSelectorView(title: "",
picker: self.picker,
items: Carousel.AspectRatio.allCases)
items: Tilelet.AspectRatio.allCases)
}()
lazy var paginationDisplayPickerSelectorView = {
PickerSelectorView(title: "",
picker: self.picker,
@ -42,7 +42,7 @@ class CarouselViewController: BaseViewController<Carousel> {
lazy var layoutPickerSelectorView = {
PickerSelectorView(title: "1UP",
picker: self.picker,
items: UIDevice.isIPad ? Carousel.Layout.allCases : [Carousel.Layout.oneUP, Carousel.Layout.twoUP, Carousel.Layout.threeUP])
items: UIDevice.isIPad ? CarouselScrollbar.Layout.allCases : [CarouselScrollbar.Layout.oneUP, CarouselScrollbar.Layout.twoUP, CarouselScrollbar.Layout.threeUP])
}()
lazy var paginationKindPickerSelectorView = {
@ -67,7 +67,7 @@ class CarouselViewController: BaseViewController<Carousel> {
var paginationInsetField = NumericField()
var widthTextField = NumericField()
var percentageTextField = NumericField()
override func viewDidLoad() {
super.viewDidLoad()
addContentTopView(view: component)
@ -88,7 +88,7 @@ class CarouselViewController: BaseViewController<Carousel> {
addFormRow(label: "Pagination Kind", view: paginationKindPickerSelectorView)
addFormRow(label: "Pagination Float", view: paginationFloatingSwitch)
addFormRow(label: "Pagination Inset", view: paginationInsetField)
addFormRow(label: "Slot Width", view: widthTextField)
addFormRow(label: "Width", view: widthTextField)
addFormRow(label: "Percentage (1-100)", view: percentageTextField)
addFormRow(label: "Slot Horizontal Alignment", view: horizAlignmtPickerSelectorView)
addFormRow(label: "Slot Vertical Alignment", view: vertAlignmtPickerSelectorView)
@ -103,7 +103,7 @@ class CarouselViewController: BaseViewController<Carousel> {
self?.component.width = nil
}
}.store(in: &subscribers)
percentageTextField
.numberPublisher
.sink { [weak self] number in
@ -129,7 +129,7 @@ class CarouselViewController: BaseViewController<Carousel> {
guard let self else { return }
self.component.pagination = .init(kind: paginationKindPickerSelectorView.selectedItem, floating: sender.isOn)
}
}
func setupModel() {
@ -143,15 +143,15 @@ class CarouselViewController: BaseViewController<Carousel> {
paginationFloatingSwitch.isOn = true
paginationInsetField.text = UIDevice.isIPad ? "12px" : "8px"
paginationInsetField.isUserInteractionEnabled = false
component.data = [{},{},{},{},{},{},{},{},{},{},{},{}]
component.data = [{},{},{},{},{},{},{},{}]
}
func setupPicker() {
surfacePickerSelectorView.onPickerDidSelect = { [weak self] item in
self?.component.surface = item
self?.contentTopView.backgroundColor = item.color
}
scalingTypePickerSelectorView.onPickerDidSelect = { [weak self] item in
self?.component.aspectRatio = item
}
@ -163,7 +163,7 @@ class CarouselViewController: BaseViewController<Carousel> {
peekPickerSelectorView.onPickerDidSelect = { [weak self] item in
self?.component.peek = item
}
gutterPickerSelectorView.onPickerDidSelect = { [weak self] item in
self?.component.gutter = item
}
@ -176,6 +176,6 @@ class CarouselViewController: BaseViewController<Carousel> {
guard let self else { return }
self.component.pagination = .init(kind: item, floating: paginationFloatingSwitch.isOn)
}
}
}

View File

@ -75,6 +75,7 @@ class MenuViewController: UITableViewController, TooltipLaunchable {
MenuComponent(title: "ButtonGroup", completed: true, viewController: ButtonGroupViewController.self),
MenuComponent(title: "ButtonIcon", completed: true, viewController: ButtonIconViewController.self),
MenuComponent(title: "Calendar", completed: true, viewController: CalendarViewController.self),
MenuComponent(title: "Carousel", completed: false, viewController: CarouselViewController.self),
MenuComponent(title: "Carousel Scrollbar", completed: true, viewController: CarouselScrollbarViewConttroller.self),
MenuComponent(title: "Checkbox", completed: true, viewController: CheckboxViewController.self),
MenuComponent(title: "CheckboxItem", completed: true, viewController: CheckboxItemViewController.self),