From e7220e67a393bac0937ee3ffbb7a70d6cba0a697 Mon Sep 17 00:00:00 2001 From: Matt Bruce Date: Mon, 8 Apr 2024 11:26:09 -0500 Subject: [PATCH] put to public since all subcomponents are required to be accessible to devs. Signed-off-by: Matt Bruce --- .../DropdownSelect/DropdownSelect.swift | 39 ++++++++++--------- 1 file changed, 21 insertions(+), 18 deletions(-) diff --git a/VDS/Components/DropdownSelect/DropdownSelect.swift b/VDS/Components/DropdownSelect/DropdownSelect.swift index 68e4fba4..072a9846 100644 --- a/VDS/Components/DropdownSelect/DropdownSelect.swift +++ b/VDS/Components/DropdownSelect/DropdownSelect.swift @@ -93,13 +93,7 @@ open class DropdownSelect: Control { $0.translatesAutoresizingMaskIntoConstraints = false $0.axis = .vertical } - - private var titleLabel = Label().with { - $0.setContentCompressionResistancePriority(.required, for: .vertical) - $0.textAlignment = .left - $0.textStyle = .bodySmall - } - + var containerView: UIView = UIView().with { $0.translatesAutoresizingMaskIntoConstraints = false } @@ -110,44 +104,53 @@ open class DropdownSelect: Control { $0.spacing = VDSFormControls.spaceInset } - private var dropdownField = UITextField().with { - $0.translatesAutoresizingMaskIntoConstraints = false - $0.tintColor = UIColor.clear - $0.font = TextStyle.bodyLarge.font + //-------------------------------------------------- + // MARK: - Public Properties + //-------------------------------------------------- + open var titleLabel = Label().with { + $0.setContentCompressionResistancePriority(.required, for: .vertical) + $0.textAlignment = .left + $0.textStyle = .bodySmall } - private var inlineDisplayLabel = Label().with { + open var inlineDisplayLabel = Label().with { $0.textAlignment = .left $0.textStyle = .boldBodyLarge $0.lineBreakMode = .byCharWrapping $0.sizeToFit() } - private var selectedOptionLabel = Label().with { + open var selectedOptionLabel = Label().with { $0.setContentCompressionResistancePriority(.required, for: .vertical) $0.textAlignment = .left $0.textStyle = .bodyLarge $0.lineBreakMode = .byCharWrapping } - private var icon: Icon = Icon().with { + open var icon: Icon = Icon().with { $0.size = .medium $0.name = Icon.Name(name: "down-caret") } - private var errorLabel = Label().with { + open var errorLabel = Label().with { $0.setContentCompressionResistancePriority(.required, for: .vertical) $0.textAlignment = .left $0.textStyle = .bodySmall } - private var helperLabel = Label().with { + open var helperLabel = Label().with { $0.setContentCompressionResistancePriority(.required, for: .vertical) $0.textAlignment = .left $0.textStyle = .bodySmall } - private var optionsPicker = UIPickerView() + open var dropdownField = UITextField().with { + $0.translatesAutoresizingMaskIntoConstraints = false + $0.tintColor = UIColor.clear + $0.font = TextStyle.bodyLarge.font + } + + open var optionsPicker = UIPickerView() //-------------------------------------------------- // MARK: - Constraints @@ -376,7 +379,7 @@ open class DropdownSelect: Control { icon.surface = surface errorLabel.isHidden = true } - icon.color = titleLabel.textColorConfiguration.getColor(self) + icon.color = iconColorConfig.getColor(self) } open func updateHelperLabel() {