marked private/internal subcomponents to open

Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
This commit is contained in:
Matt Bruce 2023-01-23 09:27:36 -06:00
parent 508d02e7b9
commit ef1ca0f6ab
8 changed files with 73 additions and 77 deletions

View File

@ -22,9 +22,9 @@ public class Badge: View, Accessable {
}
//--------------------------------------------------
// MARK: - Private Properties
// MARK: - Public Properties
//--------------------------------------------------
private var label = Label().with {
open var label = Label().with {
$0.setContentCompressionResistancePriority(.required, for: .vertical)
$0.adjustsFontSizeToFitWidth = false
$0.lineBreakMode = .byTruncatingTail
@ -32,9 +32,6 @@ public class Badge: View, Accessable {
$0.textStyle = .boldBodySmall
}
//--------------------------------------------------
// MARK: - Public Properties
//--------------------------------------------------
open var fillColor: FillColor = .red { didSet { didChange() }}
open var text: String = "" { didSet { didChange() }}

View File

@ -73,28 +73,28 @@ open class CheckboxBase: Control, Accessable, DataTrackable, Errorable {
$0.axis = .vertical
}
private var label = Label().with {
//--------------------------------------------------
// MARK: - Public Properties
//--------------------------------------------------
open var label = Label().with {
$0.setContentCompressionResistancePriority(.required, for: .vertical)
$0.textPosition = .left
$0.textStyle = .boldBodyLarge
}
private var childLabel = Label().with {
open var childLabel = Label().with {
$0.setContentCompressionResistancePriority(.required, for: .vertical)
$0.textPosition = .left
$0.textStyle = .bodyLarge
}
private var errorLabel = Label().with {
open var errorLabel = Label().with {
$0.setContentCompressionResistancePriority(.required, for: .vertical)
$0.textPosition = .left
$0.textStyle = .bodyMedium
}
//--------------------------------------------------
// MARK: - Public Properties
//--------------------------------------------------
public var selectorView = UIView().with {
open var selectorView = UIView().with {
$0.translatesAutoresizingMaskIntoConstraints = false
}

View File

@ -19,15 +19,15 @@ public class Icon: View {
private var widthConstraint: NSLayoutConstraint?
private var heightConstraint: NSLayoutConstraint?
private var imageView = UIImageView().with {
//--------------------------------------------------
// MARK: - Public Properties
//--------------------------------------------------
open var imageView = UIImageView().with {
$0.translatesAutoresizingMaskIntoConstraints = false
$0.contentMode = .scaleAspectFill
$0.clipsToBounds = true
}
//--------------------------------------------------
// MARK: - Public Properties
//--------------------------------------------------
open var color: Color = .black { didSet { didChange() }}
open var size: Size = .medium { didSet { didChange() }}
open var name: Name? { didSet { didChange() }}

View File

@ -67,27 +67,27 @@ open class RadioBoxBase: Control, Accessable, DataTrackable{
$0.isHidden = false
}
private var textLabel = Label().with {
//--------------------------------------------------
// MARK: - Public Properties
//--------------------------------------------------
open var textLabel = Label().with {
$0.setContentCompressionResistancePriority(.required, for: .vertical)
$0.textPosition = .left
$0.textStyle = .boldBodyLarge
}
private var subTextLabel = Label().with {
open var subTextLabel = Label().with {
$0.setContentCompressionResistancePriority(.required, for: .vertical)
$0.textPosition = .left
$0.textStyle = .bodyLarge
}
private var subTextRightLabel = Label().with {
open var subTextRightLabel = Label().with {
$0.setContentCompressionResistancePriority(.required, for: .vertical)
$0.textPosition = .right
$0.textStyle = .bodyLarge
}
//--------------------------------------------------
// MARK: - Public Properties
//--------------------------------------------------
public var selectorView = UIView().with {
$0.translatesAutoresizingMaskIntoConstraints = false
}

View File

@ -80,27 +80,27 @@ open class RadioButtonBase: Control, Accessable, DataTrackable, Errorable {
$0.axis = .vertical
}
private var label = Label().with {
//--------------------------------------------------
// MARK: - Public Properties
//--------------------------------------------------
open var label = Label().with {
$0.setContentCompressionResistancePriority(.required, for: .vertical)
$0.textPosition = .left
$0.textStyle = .boldBodyLarge
}
private var childLabel = Label().with {
open var childLabel = Label().with {
$0.setContentCompressionResistancePriority(.required, for: .vertical)
$0.textPosition = .left
$0.textStyle = .bodyLarge
}
private var errorLabel = Label().with {
open var errorLabel = Label().with {
$0.setContentCompressionResistancePriority(.required, for: .vertical)
$0.textPosition = .left
$0.textStyle = .bodyMedium
}
//--------------------------------------------------
// MARK: - Public Properties
//--------------------------------------------------
public var selectorView = UIView().with {
$0.translatesAutoresizingMaskIntoConstraints = false
}

View File

@ -45,26 +45,7 @@ open class EntryField: Control, Accessable {
$0.distribution = .fill
}
}()
internal var titleLabel = Label().with {
$0.setContentCompressionResistancePriority(.required, for: .vertical)
$0.attributes = []
$0.textPosition = .left
$0.textStyle = .bodySmall
}
internal var errorLabel = Label().with {
$0.setContentCompressionResistancePriority(.required, for: .vertical)
$0.textPosition = .left
$0.textStyle = .bodySmall
}
internal var helperLabel = Label().with {
$0.setContentCompressionResistancePriority(.required, for: .vertical)
$0.textPosition = .left
$0.textStyle = .bodySmall
}
internal var containerView: UIView = {
return UIView().with {
$0.translatesAutoresizingMaskIntoConstraints = false
@ -85,13 +66,7 @@ open class EntryField: Control, Accessable {
$0.translatesAutoresizingMaskIntoConstraints = false
}
}()
internal var tooltipView: UIView?
internal var icon: Icon = Icon().with {
$0.size = .small
}
//--------------------------------------------------
// MARK: - Configuration Properties
//--------------------------------------------------
@ -123,6 +98,30 @@ open class EntryField: Control, Accessable {
//--------------------------------------------------
// MARK: - Public Properties
//--------------------------------------------------
open var titleLabel = Label().with {
$0.setContentCompressionResistancePriority(.required, for: .vertical)
$0.attributes = []
$0.textPosition = .left
$0.textStyle = .bodySmall
}
open var errorLabel = Label().with {
$0.setContentCompressionResistancePriority(.required, for: .vertical)
$0.textPosition = .left
$0.textStyle = .bodySmall
}
open var helperLabel = Label().with {
$0.setContentCompressionResistancePriority(.required, for: .vertical)
$0.textPosition = .left
$0.textStyle = .bodySmall
}
open var tooltipView: UIView?
open var icon: Icon = Icon().with {
$0.size = .small
}
open var labelText: String? { didSet { didChange() }}
open var helperText: String? { didSet { didChange() }}

View File

@ -50,8 +50,20 @@ open class Tilelet: TileContainer {
private var titleLockupContainerView = UIView().with {
$0.translatesAutoresizingMaskIntoConstraints = false
}
private var titleLockup = TitleLockup().with {
private var badgeContainerView = UIView().with {
$0.translatesAutoresizingMaskIntoConstraints = false
}
private let iconContainerView = UIView().with {
$0.translatesAutoresizingMaskIntoConstraints = false
$0.backgroundColor = .clear
}
//--------------------------------------------------
// MARK: - Public Properties
//--------------------------------------------------
open var titleLockup = TitleLockup().with {
let configs = [
TextStyle.DeviceSpacingConfig([.titleSmall, .boldTitleSmall],
neighboring: [
@ -113,28 +125,16 @@ open class Tilelet: TileContainer {
$0.bottomTextStyleSpacingConfig = TextStyle.SpacingConfig(configs: configs)
}
private var badgeContainerView = UIView().with {
$0.translatesAutoresizingMaskIntoConstraints = false
}
private var badge = Badge().with {
open var badge = Badge().with {
$0.fillColor = .red
}
private let iconContainerView = UIView().with {
$0.translatesAutoresizingMaskIntoConstraints = false
$0.backgroundColor = .clear
}
open var descriptiveIcon = Icon()
private var descriptiveIcon = Icon()
private var directionalIcon = Icon().with {
open var directionalIcon = Icon().with {
$0.name = .rightArrow
}
//--------------------------------------------------
// MARK: - Public Properties
//--------------------------------------------------
//style
private var _textWidth: CGFloat?
open var textWidth: CGFloat? {
get { _textWidth }

View File

@ -68,11 +68,7 @@ open class ToggleBase: Control, Accessable, DataTrackable {
$0.axis = .horizontal
$0.distribution = .fill
}
private var label = Label().with {
$0.setContentCompressionResistancePriority(.required, for: .vertical)
}
private var toggleView = UIView().with {
$0.translatesAutoresizingMaskIntoConstraints = false
}
@ -121,6 +117,10 @@ open class ToggleBase: Control, Accessable, DataTrackable {
//--------------------------------------------------
// MARK: - Public Properties
//--------------------------------------------------
open var label = Label().with {
$0.setContentCompressionResistancePriority(.required, for: .vertical)
}
open var isOn: Bool {
get { isSelected }
set {