Merge branch 'develop' of https://gitlab.verizon.com/BPHV_MIPS/mvm_core_ui.git into feature/ACT-192-YearInReview
This commit is contained in:
commit
197ec8fb2a
@ -31,10 +31,10 @@ open class Badge: VDS.Badge, VDSMoleculeViewProtocol {
|
|||||||
self.accessibilityIdentifier = accessibilityIdentifier
|
self.accessibilityIdentifier = accessibilityIdentifier
|
||||||
}
|
}
|
||||||
text = viewModel.text
|
text = viewModel.text
|
||||||
textColor = viewModel.textColor
|
textColor = viewModel.textColorStyle
|
||||||
maxWidth = viewModel.maxWidth
|
maxWidth = viewModel.maxWidth
|
||||||
numberOfLines = viewModel.numberOfLines
|
numberOfLines = viewModel.numberOfLines
|
||||||
fillColor = viewModel.fillColor
|
fillColor = viewModel.fillColorStyle
|
||||||
surface = viewModel.surface
|
surface = viewModel.surface
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -22,15 +22,18 @@ open class BadgeModel: MoleculeModelProtocol {
|
|||||||
// MARK: - VDS Properties
|
// MARK: - VDS Properties
|
||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
public var text: String = ""
|
public var text: String = ""
|
||||||
public var textColor: Badge.TextColor? = nil
|
public var textColorStyle: Badge.TextColor? = nil
|
||||||
public var accessibilityText: String?
|
public var accessibilityText: String?
|
||||||
public var maxWidth: CGFloat?
|
public var maxWidth: CGFloat?
|
||||||
public var numberOfLines: Int = 1
|
public var numberOfLines: Int = 1
|
||||||
public var fillColor = Badge.FillColor.red
|
public var fillColorStyle = Badge.FillColor.red
|
||||||
public var surface: Surface = .light
|
public var surface: Surface = .light
|
||||||
|
|
||||||
private enum CodingKeys: String, CodingKey {
|
private enum CodingKeys: String, CodingKey {
|
||||||
case id, accessibilityIdentifier, text, textColor, accessibilityText, fillColor, surface, numberOfLines, maxWidth
|
case id, accessibilityIdentifier, accessibilityText
|
||||||
|
case surface, numberOfLines, maxWidth
|
||||||
|
case text, textColor
|
||||||
|
case fillColor, fillColorStyle
|
||||||
}
|
}
|
||||||
|
|
||||||
required public convenience init(from decoder: Decoder) throws {
|
required public convenience init(from decoder: Decoder) throws {
|
||||||
@ -39,11 +42,20 @@ open class BadgeModel: MoleculeModelProtocol {
|
|||||||
id = try container.decodeIfPresent(String.self, forKey: .id) ?? UUID().uuidString
|
id = try container.decodeIfPresent(String.self, forKey: .id) ?? UUID().uuidString
|
||||||
accessibilityIdentifier = try container.decodeIfPresent(String.self, forKey: .accessibilityIdentifier)
|
accessibilityIdentifier = try container.decodeIfPresent(String.self, forKey: .accessibilityIdentifier)
|
||||||
text = try container.decode(String.self, forKey: .text)
|
text = try container.decode(String.self, forKey: .text)
|
||||||
if let foundTextColor = try container.decodeIfPresent(Color.self, forKey: .textColor) {
|
|
||||||
textColor = .custom(foundTextColor.uiColor)
|
|
||||||
}
|
|
||||||
accessibilityText = try container.decodeIfPresent(String.self, forKey: .accessibilityText)
|
accessibilityText = try container.decodeIfPresent(String.self, forKey: .accessibilityText)
|
||||||
fillColor = try container.decodeIfPresent(Badge.FillColor.self, forKey: .fillColor) ?? .red
|
|
||||||
|
//look for a textColor
|
||||||
|
if let textColor = try container.decodeIfPresent(Color.self, forKey: .textColor) {
|
||||||
|
textColorStyle = .custom(textColor.uiColor)
|
||||||
|
}
|
||||||
|
|
||||||
|
//look for a style
|
||||||
|
fillColorStyle = try container.decodeIfPresent(Badge.FillColor.self, forKey: .fillColorStyle) ?? .red
|
||||||
|
|
||||||
|
//look for a color and set the style
|
||||||
|
if let fillColor = try container.decodeIfPresent(Color.self, forKey: .fillColor) {
|
||||||
|
fillColorStyle = .custom(fillColor.uiColor)
|
||||||
|
}
|
||||||
surface = try container.decodeIfPresent(Surface.self, forKey: .surface) ?? .light
|
surface = try container.decodeIfPresent(Surface.self, forKey: .surface) ?? .light
|
||||||
numberOfLines = try container.decodeIfPresent(Int.self, forKey: .numberOfLines) ?? 1
|
numberOfLines = try container.decodeIfPresent(Int.self, forKey: .numberOfLines) ?? 1
|
||||||
maxWidth = try container.decodeIfPresent(CGFloat.self, forKey: .maxWidth)
|
maxWidth = try container.decodeIfPresent(CGFloat.self, forKey: .maxWidth)
|
||||||
@ -55,11 +67,11 @@ open class BadgeModel: MoleculeModelProtocol {
|
|||||||
try container.encode(text, forKey: .text)
|
try container.encode(text, forKey: .text)
|
||||||
try container.encode(accessibilityText, forKey: .accessibilityText)
|
try container.encode(accessibilityText, forKey: .accessibilityText)
|
||||||
try container.encodeIfPresent(accessibilityIdentifier, forKey: .accessibilityIdentifier)
|
try container.encodeIfPresent(accessibilityIdentifier, forKey: .accessibilityIdentifier)
|
||||||
try container.encode(fillColor, forKey: .fillColor)
|
|
||||||
try container.encode(surface, forKey: .surface)
|
try container.encode(surface, forKey: .surface)
|
||||||
try container.encode(numberOfLines, forKey: .numberOfLines)
|
try container.encode(numberOfLines, forKey: .numberOfLines)
|
||||||
try container.encodeIfPresent(maxWidth, forKey: .maxWidth)
|
try container.encodeIfPresent(maxWidth, forKey: .maxWidth)
|
||||||
switch textColor {
|
try container.encode(fillColorStyle, forKey: .fillColorStyle)
|
||||||
|
switch textColorStyle {
|
||||||
case .custom(let color):
|
case .custom(let color):
|
||||||
try container.encode(Color(uiColor: color), forKey: .textColor)
|
try container.encode(Color(uiColor: color), forKey: .textColor)
|
||||||
default:
|
default:
|
||||||
@ -70,7 +82,8 @@ open class BadgeModel: MoleculeModelProtocol {
|
|||||||
public func isEqual(to model: any ModelComparisonProtocol) -> Bool {
|
public func isEqual(to model: any ModelComparisonProtocol) -> Bool {
|
||||||
guard let model = model as? BadgeModel else { return false }
|
guard let model = model as? BadgeModel else { return false }
|
||||||
return self.backgroundColor == model.backgroundColor
|
return self.backgroundColor == model.backgroundColor
|
||||||
&& self.fillColor == model.fillColor
|
&& self.fillColorStyle == model.fillColorStyle
|
||||||
|
&& self.textColorStyle == model.textColorStyle
|
||||||
&& self.numberOfLines == model.numberOfLines
|
&& self.numberOfLines == model.numberOfLines
|
||||||
&& self.text == model.text
|
&& self.text == model.text
|
||||||
&& self.surface == model.surface
|
&& self.surface == model.surface
|
||||||
|
|||||||
@ -94,8 +94,8 @@ open class TileletModel: TileContainerBaseModel<Tilelet.Padding, Tilelet>, Molec
|
|||||||
public func badgeModel() -> Tilelet.BadgeModel? {
|
public func badgeModel() -> Tilelet.BadgeModel? {
|
||||||
guard let badge else { return nil }
|
guard let badge else { return nil }
|
||||||
return .init(text: badge.text,
|
return .init(text: badge.text,
|
||||||
textColor: badge.textColor,
|
textColor: badge.textColorStyle,
|
||||||
fillColor: badge.fillColor,
|
fillColor: badge.fillColorStyle,
|
||||||
surface: badge.surface,
|
surface: badge.surface,
|
||||||
numberOfLines: badge.numberOfLines,
|
numberOfLines: badge.numberOfLines,
|
||||||
maxWidth: badge.maxWidth
|
maxWidth: badge.maxWidth
|
||||||
|
|||||||
@ -294,49 +294,40 @@ extension VDS.TitleLockup.TextColor: Codable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
extension VDS.Badge.FillColor: Codable {
|
extension VDS.Badge.FillColor: Codable {
|
||||||
enum CodingKeys: String, CodingKey {
|
|
||||||
case type
|
|
||||||
case color
|
|
||||||
}
|
|
||||||
|
|
||||||
enum CustomColorType: String, Codable {
|
|
||||||
case red, yellow, green, orange, blue, black, white
|
|
||||||
case custom
|
|
||||||
}
|
|
||||||
|
|
||||||
public init(from decoder: Decoder) throws {
|
public init(from decoder: Decoder) throws {
|
||||||
let container = try decoder.container(keyedBy: CodingKeys.self)
|
let container = try decoder.singleValueContainer()
|
||||||
let type = try container.decode(CustomColorType.self, forKey: .type)
|
let type = try container.decode(String.self)
|
||||||
|
|
||||||
switch type {
|
switch type {
|
||||||
case .red:
|
case "red":
|
||||||
self = .red
|
self = .red
|
||||||
case .yellow:
|
case "yellow":
|
||||||
self = .yellow
|
self = .yellow
|
||||||
case .green:
|
case "green":
|
||||||
self = .green
|
self = .green
|
||||||
case .orange:
|
case "orange":
|
||||||
self = .orange
|
self = .orange
|
||||||
case .blue:
|
case "blue":
|
||||||
self = .blue
|
self = .blue
|
||||||
case .black:
|
case "black":
|
||||||
self = .black
|
self = .black
|
||||||
case .white:
|
case "white":
|
||||||
self = .white
|
self = .white
|
||||||
case .custom:
|
default:
|
||||||
let color = try container.decode(Color.self, forKey: .color)
|
if let color = try? Color(from: decoder) {
|
||||||
self = .custom(color.uiColor)
|
self = .custom(color.uiColor)
|
||||||
|
} else {
|
||||||
|
self = .custom(UIColor(hexString: type))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public func encode(to encoder: Encoder) throws {
|
public func encode(to encoder: Encoder) throws {
|
||||||
var container = encoder.container(keyedBy: CodingKeys.self)
|
var container = encoder.singleValueContainer()
|
||||||
switch self {
|
switch self {
|
||||||
case .custom(let color):
|
case .custom(let value):
|
||||||
try container.encode(CustomColorType.custom.rawValue, forKey: .type)
|
try container.encode(Color(uiColor: value))
|
||||||
try container.encode(Color(uiColor: color), forKey: .color)
|
|
||||||
default:
|
default:
|
||||||
try container.encode("\(self)", forKey: .type)
|
try container.encode(String(reflecting: self))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -52,6 +52,9 @@ public class HeadersH1ButtonModel: HeaderModel, MoleculeModelProtocol, ParentMol
|
|||||||
if titleLockup.subTitle?.fontStyle == nil {
|
if titleLockup.subTitle?.fontStyle == nil {
|
||||||
titleLockup.subTitle?.fontStyle = Styler.Font.RegularTitleMedium
|
titleLockup.subTitle?.fontStyle = Styler.Font.RegularTitleMedium
|
||||||
}
|
}
|
||||||
|
if titleLockup.title.accessibilityTraits == nil {
|
||||||
|
titleLockup.title.accessibilityTraits = [.header]
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
|
|||||||
@ -31,6 +31,9 @@ public class HeadersH1NoButtonsBodyTextModel: HeaderModel, MoleculeModelProtocol
|
|||||||
if titleLockup.subTitle?.fontStyle == nil {
|
if titleLockup.subTitle?.fontStyle == nil {
|
||||||
titleLockup.subTitle?.fontStyle = Styler.Font.RegularTitleMedium
|
titleLockup.subTitle?.fontStyle = Styler.Font.RegularTitleMedium
|
||||||
}
|
}
|
||||||
|
if titleLockup.title.accessibilityTraits == nil {
|
||||||
|
titleLockup.title.accessibilityTraits = [.header]
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
|
|||||||
@ -47,18 +47,15 @@ public class HeadersH2ButtonsModel: HeaderModel, MoleculeModelProtocol, ParentMo
|
|||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
|
|
||||||
public override func setDefaults() {
|
public override func setDefaults() {
|
||||||
if topPadding == nil {
|
|
||||||
topPadding = Padding.Component.VerticalMarginSpacing
|
|
||||||
}
|
|
||||||
if bottomPadding == nil {
|
|
||||||
bottomPadding = Padding.Component.VerticalMarginSpacing
|
|
||||||
}
|
|
||||||
if titleLockup.title.fontStyle == nil {
|
if titleLockup.title.fontStyle == nil {
|
||||||
titleLockup.title.fontStyle = Styler.Font.RegularTitleXLarge
|
titleLockup.title.fontStyle = Styler.Font.RegularTitleXLarge
|
||||||
}
|
}
|
||||||
if titleLockup.subTitle?.fontStyle == nil {
|
if titleLockup.subTitle?.fontStyle == nil {
|
||||||
titleLockup.subTitle?.fontStyle = Styler.Font.RegularTitleMedium
|
titleLockup.subTitle?.fontStyle = Styler.Font.RegularTitleMedium
|
||||||
}
|
}
|
||||||
|
if titleLockup.title.accessibilityTraits == nil {
|
||||||
|
titleLockup.title.accessibilityTraits = [.header]
|
||||||
|
}
|
||||||
super.setDefaults()
|
super.setDefaults()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -42,18 +42,15 @@ public class HeadersH2CaretLinkModel: HeaderModel, MoleculeModelProtocol, Parent
|
|||||||
// MARK: - Methods
|
// MARK: - Methods
|
||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
public override func setDefaults() {
|
public override func setDefaults() {
|
||||||
if topPadding == nil {
|
|
||||||
topPadding = Padding.Component.VerticalMarginSpacing
|
|
||||||
}
|
|
||||||
if bottomPadding == nil {
|
|
||||||
bottomPadding = Padding.Component.VerticalMarginSpacing
|
|
||||||
}
|
|
||||||
if titleLockup.title.fontStyle == nil {
|
if titleLockup.title.fontStyle == nil {
|
||||||
titleLockup.title.fontStyle = Styler.Font.RegularTitleXLarge
|
titleLockup.title.fontStyle = Styler.Font.RegularTitleXLarge
|
||||||
}
|
}
|
||||||
if titleLockup.subTitle?.fontStyle == nil {
|
if titleLockup.subTitle?.fontStyle == nil {
|
||||||
titleLockup.subTitle?.fontStyle = Styler.Font.RegularTitleMedium
|
titleLockup.subTitle?.fontStyle = Styler.Font.RegularTitleMedium
|
||||||
}
|
}
|
||||||
|
if titleLockup.title.accessibilityTraits == nil {
|
||||||
|
titleLockup.title.accessibilityTraits = [.header]
|
||||||
|
}
|
||||||
super.setDefaults()
|
super.setDefaults()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -46,18 +46,15 @@ public class HeadersH2LinkModel: HeaderModel, ParentMoleculeModelProtocol {
|
|||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
|
|
||||||
public override func setDefaults() {
|
public override func setDefaults() {
|
||||||
if topPadding == nil {
|
if titleLockup.title.fontStyle == nil {
|
||||||
topPadding = Padding.Component.VerticalMarginSpacing
|
|
||||||
}
|
|
||||||
if bottomPadding == nil {
|
|
||||||
bottomPadding = Padding.Component.VerticalMarginSpacing
|
|
||||||
}
|
|
||||||
if titleLockup.title.fontStyle == nil {
|
|
||||||
titleLockup.title.fontStyle = Styler.Font.RegularTitleXLarge
|
titleLockup.title.fontStyle = Styler.Font.RegularTitleXLarge
|
||||||
}
|
}
|
||||||
if titleLockup.subTitle?.fontStyle == nil {
|
if titleLockup.subTitle?.fontStyle == nil {
|
||||||
titleLockup.subTitle?.fontStyle = Styler.Font.RegularTitleMedium
|
titleLockup.subTitle?.fontStyle = Styler.Font.RegularTitleMedium
|
||||||
}
|
}
|
||||||
|
if titleLockup.title.accessibilityTraits == nil {
|
||||||
|
titleLockup.title.accessibilityTraits = [.header]
|
||||||
|
}
|
||||||
super.setDefaults()
|
super.setDefaults()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -36,18 +36,15 @@ public class HeadersH2NoButtonsBodyTextModel: HeaderModel, MoleculeModelProtocol
|
|||||||
}
|
}
|
||||||
|
|
||||||
public override func setDefaults() {
|
public override func setDefaults() {
|
||||||
if topPadding == nil {
|
|
||||||
topPadding = Padding.Component.VerticalMarginSpacing
|
|
||||||
}
|
|
||||||
if bottomPadding == nil {
|
|
||||||
bottomPadding = Padding.Component.VerticalMarginSpacing
|
|
||||||
}
|
|
||||||
if titleLockup.title.fontStyle == nil {
|
if titleLockup.title.fontStyle == nil {
|
||||||
titleLockup.title.fontStyle = Styler.Font.RegularTitleXLarge
|
titleLockup.title.fontStyle = Styler.Font.RegularTitleXLarge
|
||||||
}
|
}
|
||||||
if titleLockup.subTitle?.fontStyle == nil {
|
if titleLockup.subTitle?.fontStyle == nil {
|
||||||
titleLockup.subTitle?.fontStyle = Styler.Font.RegularTitleMedium
|
titleLockup.subTitle?.fontStyle = Styler.Font.RegularTitleMedium
|
||||||
}
|
}
|
||||||
|
if titleLockup.title.accessibilityTraits == nil {
|
||||||
|
titleLockup.title.accessibilityTraits = [.header]
|
||||||
|
}
|
||||||
super.setDefaults()
|
super.setDefaults()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -57,12 +57,6 @@ public class HeadersH2PricingTwoRowsModel: HeaderModel, MoleculeModelProtocol, P
|
|||||||
// MARK: - Methods
|
// MARK: - Methods
|
||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
public override func setDefaults() {
|
public override func setDefaults() {
|
||||||
if topPadding == nil {
|
|
||||||
topPadding = Padding.Component.VerticalMarginSpacing
|
|
||||||
}
|
|
||||||
if bottomPadding == nil {
|
|
||||||
bottomPadding = Padding.Component.VerticalMarginSpacing
|
|
||||||
}
|
|
||||||
if headline.accessibilityTraits == nil {
|
if headline.accessibilityTraits == nil {
|
||||||
headline.accessibilityTraits = .header
|
headline.accessibilityTraits = .header
|
||||||
}
|
}
|
||||||
|
|||||||
@ -47,18 +47,15 @@ public class HeadersH2TinyButtonModel: HeaderModel, MoleculeModelProtocol, Paren
|
|||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
|
|
||||||
public override func setDefaults() {
|
public override func setDefaults() {
|
||||||
if topPadding == nil {
|
|
||||||
topPadding = Padding.Component.VerticalMarginSpacing
|
|
||||||
}
|
|
||||||
if bottomPadding == nil {
|
|
||||||
bottomPadding = Padding.Component.VerticalMarginSpacing
|
|
||||||
}
|
|
||||||
if titleLockup.title.fontStyle == nil {
|
if titleLockup.title.fontStyle == nil {
|
||||||
titleLockup.title.fontStyle = Styler.Font.RegularTitleXLarge
|
titleLockup.title.fontStyle = Styler.Font.RegularTitleXLarge
|
||||||
}
|
}
|
||||||
if titleLockup.subTitle?.fontStyle == nil {
|
if titleLockup.subTitle?.fontStyle == nil {
|
||||||
titleLockup.subTitle?.fontStyle = Styler.Font.RegularTitleMedium
|
titleLockup.subTitle?.fontStyle = Styler.Font.RegularTitleMedium
|
||||||
}
|
}
|
||||||
|
if titleLockup.title.accessibilityTraits == nil {
|
||||||
|
titleLockup.title.accessibilityTraits = [.header]
|
||||||
|
}
|
||||||
super.setDefaults()
|
super.setDefaults()
|
||||||
button.style = .secondary
|
button.style = .secondary
|
||||||
button.size = .small
|
button.size = .small
|
||||||
|
|||||||
@ -15,7 +15,7 @@ import Foundation
|
|||||||
//-----------------------------------------------------
|
//-----------------------------------------------------
|
||||||
|
|
||||||
public var stack: Stack<StackModel>
|
public var stack: Stack<StackModel>
|
||||||
public let headline = Label(fontStyle: .BoldTitleMedium)
|
public let headline = Label(fontStyle: .BoldTitleLarge)
|
||||||
public let body = Label(fontStyle: .RegularBodySmall)
|
public let body = Label(fontStyle: .RegularBodySmall)
|
||||||
|
|
||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
@ -24,7 +24,7 @@ import Foundation
|
|||||||
|
|
||||||
public override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
|
public override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
|
||||||
stack = Stack<StackModel>.createStack(with: [(view: headline, model: StackItemModel(horizontalAlignment: .leading)),
|
stack = Stack<StackModel>.createStack(with: [(view: headline, model: StackItemModel(horizontalAlignment: .leading)),
|
||||||
(view: body, model: StackItemModel(spacing: 0, horizontalAlignment: .leading))],
|
(view: body, model: StackItemModel(spacing: 8, horizontalAlignment: .leading))],
|
||||||
axis: .vertical)
|
axis: .vertical)
|
||||||
super.init(style: style, reuseIdentifier: reuseIdentifier)
|
super.init(style: style, reuseIdentifier: reuseIdentifier)
|
||||||
}
|
}
|
||||||
@ -63,7 +63,7 @@ import Foundation
|
|||||||
|
|
||||||
open override func reset() {
|
open override func reset() {
|
||||||
super.reset()
|
super.reset()
|
||||||
headline.setFontStyle(.BoldTitleMedium)
|
headline.setFontStyle(.BoldTitleLarge)
|
||||||
body.setFontStyle(.RegularBodySmall)
|
body.setFontStyle(.RegularBodySmall)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -47,6 +47,9 @@ public class ListOneColumnTextWithWhitespaceDividerShortModel: ListItemModel, Mo
|
|||||||
|
|
||||||
override public func setDefaults() {
|
override public func setDefaults() {
|
||||||
style = .shortDivider
|
style = .shortDivider
|
||||||
|
if headline.accessibilityTraits == nil {
|
||||||
|
headline.accessibilityTraits = [.header]
|
||||||
|
}
|
||||||
super.setDefaults()
|
super.setDefaults()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -15,7 +15,7 @@ import Foundation
|
|||||||
//-----------------------------------------------------
|
//-----------------------------------------------------
|
||||||
|
|
||||||
public var stack: Stack<StackModel>
|
public var stack: Stack<StackModel>
|
||||||
public let headline = Label(fontStyle: .BoldTitleMedium)
|
public let headline = Label(fontStyle: .BoldTitleLarge)
|
||||||
public let body = Label(fontStyle: .RegularBodySmall)
|
public let body = Label(fontStyle: .RegularBodySmall)
|
||||||
|
|
||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
@ -24,7 +24,7 @@ import Foundation
|
|||||||
|
|
||||||
public override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
|
public override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
|
||||||
stack = Stack<StackModel>.createStack(with: [(view: headline, model: StackItemModel(horizontalAlignment: .leading)),
|
stack = Stack<StackModel>.createStack(with: [(view: headline, model: StackItemModel(horizontalAlignment: .leading)),
|
||||||
(view: body, model: StackItemModel(spacing: 0, horizontalAlignment: .leading))],
|
(view: body, model: StackItemModel(spacing: 8, horizontalAlignment: .leading))],
|
||||||
axis: .vertical)
|
axis: .vertical)
|
||||||
super.init(style: style, reuseIdentifier: reuseIdentifier)
|
super.init(style: style, reuseIdentifier: reuseIdentifier)
|
||||||
}
|
}
|
||||||
@ -62,7 +62,7 @@ import Foundation
|
|||||||
|
|
||||||
open override func reset() {
|
open override func reset() {
|
||||||
super.reset()
|
super.reset()
|
||||||
headline.setFontStyle(.BoldTitleMedium)
|
headline.setFontStyle(.BoldTitleLarge)
|
||||||
body.setFontStyle(.RegularBodySmall)
|
body.setFontStyle(.RegularBodySmall)
|
||||||
accessibilityLabel = nil
|
accessibilityLabel = nil
|
||||||
}
|
}
|
||||||
|
|||||||
@ -47,6 +47,9 @@ public class ListOneColumnTextWithWhitespaceDividerTallModel: ListItemModel, Mol
|
|||||||
|
|
||||||
override public func setDefaults() {
|
override public func setDefaults() {
|
||||||
style = .tallDivider
|
style = .tallDivider
|
||||||
|
if headline.accessibilityTraits == nil {
|
||||||
|
headline.accessibilityTraits = [.header]
|
||||||
|
}
|
||||||
super.setDefaults()
|
super.setDefaults()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -72,9 +72,9 @@ import MVMCore
|
|||||||
case .standard:
|
case .standard:
|
||||||
set(topPadding: Padding.Component.VerticalMarginSpacing, bottomPadding: Padding.Component.VerticalMarginSpacing)
|
set(topPadding: Padding.Component.VerticalMarginSpacing, bottomPadding: Padding.Component.VerticalMarginSpacing)
|
||||||
case .shortDivider:
|
case .shortDivider:
|
||||||
set(topPadding: Padding.Component.LargeVerticalMarginSpacing, bottomPadding: Padding.Four)
|
set(topPadding: Padding.Component.LargeVerticalMarginSpacing, bottomPadding: Padding.Five)
|
||||||
case .tallDivider:
|
case .tallDivider:
|
||||||
set(topPadding: Padding.Twelve, bottomPadding: Padding.Four)
|
set(topPadding: Padding.Twelve, bottomPadding: Padding.Five)
|
||||||
case .sectionFooter:
|
case .sectionFooter:
|
||||||
set(topPadding: Padding.Component.VerticalMarginSpacing, bottomPadding: 0)
|
set(topPadding: Padding.Component.VerticalMarginSpacing, bottomPadding: 0)
|
||||||
case ListItemStyle.none:
|
case ListItemStyle.none:
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user