refactored
Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
This commit is contained in:
parent
422695a427
commit
0f6787c32a
@ -59,7 +59,7 @@ class CheckboxGroupViewController: BaseViewController<CheckboxGroup> {
|
|||||||
|
|
||||||
component.onChange = { [weak self] group in
|
component.onChange = { [weak self] group in
|
||||||
guard let label = self?.actionLabel else { return }
|
guard let label = self?.actionLabel else { return }
|
||||||
let selected = group.selectedHandlers?
|
let selected = group.selectedItems?
|
||||||
.compactMap{"\($0.labelText!)"}
|
.compactMap{"\($0.labelText!)"}
|
||||||
.joined(separator: "\r") ?? "none selected"
|
.joined(separator: "\r") ?? "none selected"
|
||||||
|
|
||||||
@ -104,7 +104,7 @@ class CheckboxGroupViewController: BaseViewController<CheckboxGroup> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var checkbox: CheckboxItem? {
|
var checkbox: CheckboxItem? {
|
||||||
component.selectorViews.first
|
component.items.first
|
||||||
}
|
}
|
||||||
|
|
||||||
//Picker
|
//Picker
|
||||||
|
|||||||
@ -17,7 +17,6 @@ class NotificationViewController: BaseViewController<VDS.Notification> {
|
|||||||
let firstButtonTextField = TextField()
|
let firstButtonTextField = TextField()
|
||||||
let secondButtonTextField = TextField()
|
let secondButtonTextField = TextField()
|
||||||
let hideCloseButtonToggle = Toggle()
|
let hideCloseButtonToggle = Toggle()
|
||||||
let fullBleedToggle = Toggle()
|
|
||||||
|
|
||||||
let titleDefaultText = "This is title"
|
let titleDefaultText = "This is title"
|
||||||
let subtitleDefaultText = "This is subtitle"
|
let subtitleDefaultText = "This is subtitle"
|
||||||
@ -59,7 +58,6 @@ class NotificationViewController: BaseViewController<VDS.Notification> {
|
|||||||
addFormRow(label: "SubTitle", view: subTitleTextField)
|
addFormRow(label: "SubTitle", view: subTitleTextField)
|
||||||
addFormRow(label: "Hide Button Group", view: buttonGroupToggle)
|
addFormRow(label: "Hide Button Group", view: buttonGroupToggle)
|
||||||
addFormRow(label: "Hide Close Button", view: hideCloseButtonToggle)
|
addFormRow(label: "Hide Close Button", view: hideCloseButtonToggle)
|
||||||
addFormRow(label: "Full bleed", view: fullBleedToggle)
|
|
||||||
addFormRow(label: "Action", view: label)
|
addFormRow(label: "Action", view: label)
|
||||||
addFormRow(label: "First Button Text", view: firstButtonTextField)
|
addFormRow(label: "First Button Text", view: firstButtonTextField)
|
||||||
addFormRow(label: "Second Button Text", view: secondButtonTextField)
|
addFormRow(label: "Second Button Text", view: secondButtonTextField)
|
||||||
@ -107,9 +105,6 @@ class NotificationViewController: BaseViewController<VDS.Notification> {
|
|||||||
self?.component.hideCloseButton = toggle.isOn
|
self?.component.hideCloseButton = toggle.isOn
|
||||||
}
|
}
|
||||||
|
|
||||||
fullBleedToggle.onChange = { [weak self] toggle in
|
|
||||||
self?.component.fullBleed = toggle.isOn
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func setupPicker() {
|
func setupPicker() {
|
||||||
|
|||||||
@ -84,7 +84,7 @@ class RadioBoxGroupViewController: BaseViewController<RadioBoxGroup>{
|
|||||||
component.selectorModels = [radioBox1, radioBox2]
|
component.selectorModels = [radioBox1, radioBox2]
|
||||||
|
|
||||||
component.onChange = { [weak self] group in
|
component.onChange = { [weak self] group in
|
||||||
let newText = "Selected:\r\(group.selectedHandler?.text ?? "none")"
|
let newText = "Selected:\r\(group.selectedItem?.text ?? "none")"
|
||||||
self?.actionLabel.text = newText
|
self?.actionLabel.text = newText
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -97,7 +97,7 @@ class RadioBoxGroupViewController: BaseViewController<RadioBoxGroup>{
|
|||||||
}
|
}
|
||||||
|
|
||||||
var radioBox: RadioBoxItem? {
|
var radioBox: RadioBoxItem? {
|
||||||
component.selectorViews.first
|
component.items.first
|
||||||
}
|
}
|
||||||
|
|
||||||
//Picker
|
//Picker
|
||||||
|
|||||||
@ -79,7 +79,7 @@ class RadioButtonGroupViewController: BaseViewController<RadioButtonGroup> {
|
|||||||
component.selectorModels = [radioButton1, radioButton2, radioButton3]
|
component.selectorModels = [radioButton1, radioButton2, radioButton3]
|
||||||
|
|
||||||
component.onChange = { [weak self] group in
|
component.onChange = { [weak self] group in
|
||||||
let newText = "Selected:\r\(group.selectedHandler?.labelText ?? "none")"
|
let newText = "Selected:\r\(group.selectedItem?.labelText ?? "none")"
|
||||||
self?.showErrorSwitch.isOn = group.showError
|
self?.showErrorSwitch.isOn = group.showError
|
||||||
self?.actionLabel.text = newText
|
self?.actionLabel.text = newText
|
||||||
}
|
}
|
||||||
@ -93,7 +93,7 @@ class RadioButtonGroupViewController: BaseViewController<RadioButtonGroup> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var radioButton: RadioButtonItem? {
|
var radioButton: RadioButtonItem? {
|
||||||
component.selectorViews.first
|
component.items.first
|
||||||
}
|
}
|
||||||
|
|
||||||
//Picker
|
//Picker
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user