refactored

Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
This commit is contained in:
Matt Bruce 2024-08-02 16:49:11 -05:00
parent 4399eef2d6
commit 0a10dbceb4

View File

@ -104,13 +104,15 @@ class InputStepperViewController: BaseViewController<InputStepper> {
maxValueTextField maxValueTextField
.numberPublisher .numberPublisher
.sink { [weak self] number in .sink { [weak self] number in
self?.component.maxValue = number?.intValue guard let number else { return }
self?.component.maxValue = number.intValue
}.store(in: &subscribers) }.store(in: &subscribers)
minValueTextField minValueTextField
.numberPublisher .numberPublisher
.sink { [weak self] number in .sink { [weak self] number in
self?.component.minValue = number?.intValue guard let number else { return }
self?.component.minValue = number.intValue
}.store(in: &subscribers) }.store(in: &subscribers)
trailingTextField trailingTextField
@ -223,18 +225,26 @@ class InputStepperViewController: BaseViewController<InputStepper> {
component.labelText = "Quantity" component.labelText = "Quantity"
component.helperText = "Add up to max lines." component.helperText = "Add up to max lines."
component.errorText = "You must choose a number of lines before advancing to the next step." component.errorText = "You must choose a number of lines before advancing to the next step."
component.defaultValue = 8 component.defaultValue = nil
component.trailingText = "" component.trailingText = ""
component.onChange = { component in
if let text = component.value {
print("inputStepper Change: \(text)")
} else {
print("inputStepper Change: check code")
}
}
trailingTextField.text = component.trailingText trailingTextField.text = component.trailingText
controlWidthTextField.text = "" controlWidthTextField.text = ""
errorTextField.text = component.errorText errorTextField.text = component.errorText
helperTextField.text = component.helperText helperTextField.text = component.helperText
labelTextField.text = component.labelText labelTextField.text = component.labelText
if let defaultVal = component.defaultValue as? Int { if let defaultVal = component.defaultValue {
defaultValueField.text = String(defaultVal) defaultValueField.text = String(defaultVal)
} }
minValueTextField.text = String(component.minValue ?? 0) minValueTextField.text = String(component.minValue)
maxValueTextField.text = String(component.maxValue ?? 99) maxValueTextField.text = String(component.maxValue)
component.size = .large component.size = .large
sizePickerSelectorView.text = "large" sizePickerSelectorView.text = "large"