refactored models
Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
This commit is contained in:
parent
ac278816ae
commit
8c3bce746e
@ -532,7 +532,7 @@ open class Tilelet: TileContainerBase<Tilelet.Padding> {
|
|||||||
var showIconContainerView = false
|
var showIconContainerView = false
|
||||||
if let descriptiveIconModel {
|
if let descriptiveIconModel {
|
||||||
descriptiveIcon.name = descriptiveIconModel.name
|
descriptiveIcon.name = descriptiveIconModel.name
|
||||||
descriptiveIcon.color = descriptiveIconModel.color
|
descriptiveIcon.colorConfiguration = descriptiveIconModel.colorConfiguration
|
||||||
descriptiveIcon.size = descriptiveIconModel.size
|
descriptiveIcon.size = descriptiveIconModel.size
|
||||||
descriptiveIcon.surface = backgroundColorSurface
|
descriptiveIcon.surface = backgroundColorSurface
|
||||||
descriptiveIcon.accessibilityLabel = descriptiveIconModel.accessibleText
|
descriptiveIcon.accessibilityLabel = descriptiveIconModel.accessibleText
|
||||||
@ -541,7 +541,7 @@ open class Tilelet: TileContainerBase<Tilelet.Padding> {
|
|||||||
|
|
||||||
if let directionalIconModel {
|
if let directionalIconModel {
|
||||||
directionalIcon.name = directionalIconModel.iconType.iconName
|
directionalIcon.name = directionalIconModel.iconType.iconName
|
||||||
directionalIcon.color = directionalIconModel.color
|
directionalIcon.colorConfiguration = directionalIconModel.colorConfiguration
|
||||||
directionalIcon.size = directionalIconModel.size
|
directionalIcon.size = directionalIconModel.size
|
||||||
directionalIcon.surface = backgroundColorSurface
|
directionalIcon.surface = backgroundColorSurface
|
||||||
directionalIcon.accessibilityLabel = directionalIconModel.accessibleText
|
directionalIcon.accessibilityLabel = directionalIconModel.accessibleText
|
||||||
|
|||||||
@ -17,23 +17,23 @@ extension Tilelet {
|
|||||||
public var name: Icon.Name
|
public var name: Icon.Name
|
||||||
|
|
||||||
/// Color of the icon.
|
/// Color of the icon.
|
||||||
public var color: UIColor
|
public var colorConfiguration: SurfaceColorConfiguration
|
||||||
|
|
||||||
/// Enum for a preset height and width for the icon.
|
/// Enum for a preset height and width for the icon.
|
||||||
public var size: Icon.Size
|
public var size: Icon.Size
|
||||||
|
|
||||||
/// Accessible Text for the Icon
|
/// Accessible Text for the Icon
|
||||||
public var accessibleText: String
|
public var accessibleText: String
|
||||||
|
|
||||||
/// Current Surface and this is used to pass down to child objects that implement Surfacable
|
|
||||||
public var surface: Surface
|
|
||||||
|
|
||||||
public init(name: Icon.Name = .multipleDocuments, color: UIColor = VDSColor.paletteBlack, size: Icon.Size = .medium, accessibleText: String? = nil, surface: Surface = .dark) {
|
public init(name: Icon.Name = .multipleDocuments,
|
||||||
|
colorConfiguration: SurfaceColorConfiguration = .init(VDSColor.elementsPrimaryOnlight, VDSColor.elementsPrimaryOndark),
|
||||||
|
size: Icon.Size = .medium,
|
||||||
|
accessibleText: String? = nil) {
|
||||||
|
|
||||||
self.name = name
|
self.name = name
|
||||||
self.color = color
|
self.colorConfiguration = colorConfiguration
|
||||||
self.accessibleText = accessibleText ?? name.rawValue
|
self.accessibleText = accessibleText ?? name.rawValue
|
||||||
self.size = size
|
self.size = size
|
||||||
self.surface = surface
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -49,8 +49,8 @@ extension Tilelet {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Color of the icon.
|
/// Color of the icon.
|
||||||
public var color: UIColor
|
public var colorConfiguration: SurfaceColorConfiguration
|
||||||
|
|
||||||
/// Accessible Text for the Icon
|
/// Accessible Text for the Icon
|
||||||
public var accessibleText: String
|
public var accessibleText: String
|
||||||
|
|
||||||
@ -59,16 +59,16 @@ extension Tilelet {
|
|||||||
|
|
||||||
/// Enum for a preset height and width for the icon.
|
/// Enum for a preset height and width for the icon.
|
||||||
public var size: Icon.Size
|
public var size: Icon.Size
|
||||||
|
|
||||||
/// Current Surface and this is used to pass down to child objects that implement Surfacable
|
public init(iconType: IconType = .rightArrow,
|
||||||
public var surface: Surface
|
colorConfiguration: SurfaceColorConfiguration = .init(.black, .white),
|
||||||
|
size: Icon.Size = .medium,
|
||||||
public init(iconType: IconType = .rightArrow, color: UIColor = VDSColor.paletteBlack, size: Icon.Size = .medium, accessibleText: String? = nil, surface: Surface = .dark) {
|
accessibleText: String? = nil) {
|
||||||
|
|
||||||
self.iconType = iconType
|
self.iconType = iconType
|
||||||
self.color = color
|
self.colorConfiguration = colorConfiguration
|
||||||
self.accessibleText = accessibleText ?? iconType.iconName.rawValue
|
self.accessibleText = accessibleText ?? iconType.iconName.rawValue
|
||||||
self.size = size
|
self.size = size
|
||||||
self.surface = surface
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user