Merge branch 'feature/tilet' into 'develop'
refactored structs into parent See merge request BPHV_MIPS/vds_ios!31
This commit is contained in:
commit
fdc1af7d3a
@ -171,13 +171,13 @@ open class Tilet: TileContainer {
|
|||||||
open var textPostion: TextPosition = .top { didSet { didChange() }}
|
open var textPostion: TextPosition = .top { didSet { didChange() }}
|
||||||
|
|
||||||
//models
|
//models
|
||||||
public var badgeModel: TiletBadgeModel? { didSet { didChange() }}
|
public var badgeModel: BadgeModel? { didSet { didChange() }}
|
||||||
public var titleModel: TiletTitleModel? { didSet { didChange() }}
|
public var titleModel: TitleModel? { didSet { didChange() }}
|
||||||
public var subTitleModel: TiletSubTitleModel? { didSet { didChange() }}
|
public var subTitleModel: SubTitleModel? { didSet { didChange() }}
|
||||||
|
|
||||||
//only 1 Icon can be active
|
//only 1 Icon can be active
|
||||||
private var _descriptiveIconModel: TiletDescriptiveIcon?
|
private var _descriptiveIconModel: DescriptiveIcon?
|
||||||
public var descriptiveIconModel: TiletDescriptiveIcon? {
|
public var descriptiveIconModel: DescriptiveIcon? {
|
||||||
get { _descriptiveIconModel }
|
get { _descriptiveIconModel }
|
||||||
set {
|
set {
|
||||||
_descriptiveIconModel = newValue;
|
_descriptiveIconModel = newValue;
|
||||||
@ -186,8 +186,8 @@ open class Tilet: TileContainer {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private var _directionalIconModel: TiletDirectionalIcon?
|
private var _directionalIconModel: DirectionalIcon?
|
||||||
public var directionalIconModel: TiletDirectionalIcon? {
|
public var directionalIconModel: DirectionalIcon? {
|
||||||
get { _directionalIconModel }
|
get { _directionalIconModel }
|
||||||
set {
|
set {
|
||||||
_directionalIconModel = newValue;
|
_directionalIconModel = newValue;
|
||||||
|
|||||||
@ -7,17 +7,19 @@
|
|||||||
|
|
||||||
import Foundation
|
import Foundation
|
||||||
|
|
||||||
public struct TiletBadgeModel: Codable {
|
extension Tilet {
|
||||||
public var text: String = ""
|
public struct BadgeModel: Codable {
|
||||||
public var fillColor:Badge.FillColor
|
public var text: String = ""
|
||||||
public var surface: Surface
|
public var fillColor:Badge.FillColor
|
||||||
public var numberOfLines: Int
|
public var surface: Surface
|
||||||
public var maxWidth: CGFloat?
|
public var numberOfLines: Int
|
||||||
public init(text: String, fillColor: Badge.FillColor = .red, surface: Surface = .light, numberOfLines: Int = 0, maxWidth: CGFloat? = nil) {
|
public var maxWidth: CGFloat?
|
||||||
self.text = text
|
public init(text: String, fillColor: Badge.FillColor = .red, surface: Surface = .light, numberOfLines: Int = 0, maxWidth: CGFloat? = nil) {
|
||||||
self.fillColor = fillColor
|
self.text = text
|
||||||
self.surface = surface
|
self.fillColor = fillColor
|
||||||
self.numberOfLines = numberOfLines
|
self.surface = surface
|
||||||
self.maxWidth = maxWidth
|
self.numberOfLines = numberOfLines
|
||||||
|
self.maxWidth = maxWidth
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -8,24 +8,27 @@
|
|||||||
import Foundation
|
import Foundation
|
||||||
import UIKit
|
import UIKit
|
||||||
|
|
||||||
public struct TiletDescriptiveIcon: Codable {
|
extension Tilet {
|
||||||
public var name: Icon.Name = .multipleDocuments
|
|
||||||
public var size: Icon.Size = .medium
|
|
||||||
public var surface: Surface = .dark
|
|
||||||
|
|
||||||
public init(name: Icon.Name = .multipleDocuments, size: Icon.Size, surface: Surface) {
|
public struct DescriptiveIcon: Codable {
|
||||||
self.name = name
|
public var name: Icon.Name = .multipleDocuments
|
||||||
self.size = size
|
public var size: Icon.Size = .medium
|
||||||
self.surface = surface
|
public var surface: Surface = .dark
|
||||||
}
|
|
||||||
}
|
public init(name: Icon.Name = .multipleDocuments, size: Icon.Size, surface: Surface) {
|
||||||
|
self.name = name
|
||||||
public struct TiletDirectionalIcon: Codable {
|
self.size = size
|
||||||
public var size: Icon.Size = .medium
|
self.surface = surface
|
||||||
public var surface: Surface = .dark
|
}
|
||||||
|
}
|
||||||
public init(size: Icon.Size, surface: Surface) {
|
|
||||||
self.size = size
|
public struct DirectionalIcon: Codable {
|
||||||
self.surface = surface
|
public var size: Icon.Size = .medium
|
||||||
|
public var surface: Surface = .dark
|
||||||
|
|
||||||
|
public init(size: Icon.Size, surface: Surface) {
|
||||||
|
self.size = size
|
||||||
|
self.surface = surface
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -7,46 +7,48 @@
|
|||||||
|
|
||||||
import Foundation
|
import Foundation
|
||||||
|
|
||||||
public struct TiletSubTitleModel: Codable {
|
extension Tilet {
|
||||||
//--------------------------------------------------
|
public struct SubTitleModel: Codable {
|
||||||
// MARK: - Enums
|
//--------------------------------------------------
|
||||||
//--------------------------------------------------
|
// MARK: - Enums
|
||||||
public enum TextStyle: String, Codable, EnumSubset {
|
//--------------------------------------------------
|
||||||
case BodyLarge
|
public enum TextStyle: String, Codable, EnumSubset {
|
||||||
case BoldBodyLarge
|
case BodyLarge
|
||||||
case BodyMedium
|
case BoldBodyLarge
|
||||||
case BoldBodyMedium
|
case BodyMedium
|
||||||
case BodySmall
|
case BoldBodyMedium
|
||||||
case BoldBodySmall
|
case BodySmall
|
||||||
|
case BoldBodySmall
|
||||||
|
|
||||||
|
public var defaultValue: TitleLockup.OtherTextStyle { .BodySmall }
|
||||||
|
}
|
||||||
|
|
||||||
public var defaultValue: TitleLockup.OtherTextStyle { .BodySmall }
|
//--------------------------------------------------
|
||||||
}
|
// MARK: - Public Properties
|
||||||
|
//--------------------------------------------------
|
||||||
//--------------------------------------------------
|
public var text: String = ""
|
||||||
// MARK: - Public Properties
|
public var textStyle: TextStyle = .BodySmall
|
||||||
//--------------------------------------------------
|
public var textColor: Use = .primary
|
||||||
public var text: String = ""
|
|
||||||
public var textStyle: TextStyle = .BodySmall
|
//--------------------------------------------------
|
||||||
public var textColor: Use = .primary
|
// MARK: - Initializers
|
||||||
|
//--------------------------------------------------
|
||||||
//--------------------------------------------------
|
public init(text: String,
|
||||||
// MARK: - Initializers
|
textColor: Use = .primary,
|
||||||
//--------------------------------------------------
|
textAttributes: [any LabelAttributeModel]? = nil,
|
||||||
public init(text: String,
|
textStyle: TextStyle = .BodySmall) {
|
||||||
textColor: Use = .primary,
|
self.text = text
|
||||||
textAttributes: [any LabelAttributeModel]? = nil,
|
self.textColor = textColor
|
||||||
textStyle: TextStyle = .BodySmall) {
|
self.textStyle = textStyle
|
||||||
self.text = text
|
}
|
||||||
self.textColor = textColor
|
|
||||||
self.textStyle = textStyle
|
//--------------------------------------------------
|
||||||
}
|
// MARK: - Public Functions
|
||||||
|
//--------------------------------------------------
|
||||||
//--------------------------------------------------
|
public func toTitleLockupSubTitleModel() -> TitleLockup.SubTitleModel {
|
||||||
// MARK: - Public Functions
|
TitleLockup.SubTitleModel(text: text,
|
||||||
//--------------------------------------------------
|
textColor: textColor,
|
||||||
public func toTitleLockupSubTitleModel() -> TitleLockup.SubTitleModel {
|
textAttributes: nil)
|
||||||
TitleLockup.SubTitleModel(text: text,
|
}
|
||||||
textColor: textColor,
|
|
||||||
textAttributes: nil)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -7,44 +7,46 @@
|
|||||||
|
|
||||||
import Foundation
|
import Foundation
|
||||||
|
|
||||||
public struct TiletTitleModel: Codable {
|
extension Tilet {
|
||||||
//--------------------------------------------------
|
public struct TitleModel: Codable {
|
||||||
// MARK: - Enums
|
//--------------------------------------------------
|
||||||
//--------------------------------------------------
|
// MARK: - Enums
|
||||||
public enum TextStyle: String, EnumSubset, Codable {
|
//--------------------------------------------------
|
||||||
case TitleXLarge
|
public enum TextStyle: String, EnumSubset, Codable {
|
||||||
case BoldTitleXLarge
|
case TitleXLarge
|
||||||
case TitleLarge
|
case BoldTitleXLarge
|
||||||
case BoldTitleLarge
|
case TitleLarge
|
||||||
case TitleMedium
|
case BoldTitleLarge
|
||||||
case BoldTitleMedium
|
case TitleMedium
|
||||||
case TitleSmall
|
case BoldTitleMedium
|
||||||
case BoldTitleSmall
|
case TitleSmall
|
||||||
|
case BoldTitleSmall
|
||||||
|
|
||||||
|
public var defaultValue: TitleLockup.TitleTextStyle { .BoldTitleSmall }
|
||||||
|
}
|
||||||
|
|
||||||
public var defaultValue: TitleLockup.TitleTextStyle { .BoldTitleSmall }
|
//--------------------------------------------------
|
||||||
}
|
// MARK: - Public Properties
|
||||||
|
//--------------------------------------------------
|
||||||
//--------------------------------------------------
|
public var text: String = ""
|
||||||
// MARK: - Public Properties
|
public var textStyle: TextStyle = .BoldTitleSmall
|
||||||
//--------------------------------------------------
|
|
||||||
public var text: String = ""
|
//--------------------------------------------------
|
||||||
public var textStyle: TextStyle = .BoldTitleSmall
|
// MARK: - Initializers
|
||||||
|
//--------------------------------------------------
|
||||||
//--------------------------------------------------
|
public init(text: String,
|
||||||
// MARK: - Initializers
|
textStyle: TextStyle = .BoldTitleSmall) {
|
||||||
//--------------------------------------------------
|
self.text = text
|
||||||
public init(text: String,
|
self.textStyle = textStyle
|
||||||
textStyle: TextStyle = .BoldTitleSmall) {
|
}
|
||||||
self.text = text
|
|
||||||
self.textStyle = textStyle
|
//--------------------------------------------------
|
||||||
}
|
// MARK: - Public Functions
|
||||||
|
//--------------------------------------------------
|
||||||
//--------------------------------------------------
|
public func toTitleLockupTitleModel() -> TitleLockup.TitleModel {
|
||||||
// MARK: - Public Functions
|
TitleLockup.TitleModel(text: text,
|
||||||
//--------------------------------------------------
|
textAttributes: nil,
|
||||||
public func toTitleLockupTitleModel() -> TitleLockup.TitleModel {
|
textStyle: textStyle.value)
|
||||||
TitleLockup.TitleModel(text: text,
|
}
|
||||||
textAttributes: nil,
|
|
||||||
textStyle: textStyle.value)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user