Merge branches 'develop' and 'develop' of https://gitlab.verizon.com/BPHV_MIPS/mvm_core_ui into develop
This commit is contained in:
commit
83fde506aa
@ -179,6 +179,8 @@
|
|||||||
94CA227D24058534002D6750 /* VerizonNHGeDS-Regular.otf in Resources */ = {isa = PBXBuildFile; fileRef = 94CA227924058533002D6750 /* VerizonNHGeDS-Regular.otf */; };
|
94CA227D24058534002D6750 /* VerizonNHGeDS-Regular.otf in Resources */ = {isa = PBXBuildFile; fileRef = 94CA227924058533002D6750 /* VerizonNHGeDS-Regular.otf */; };
|
||||||
94CA227E24058534002D6750 /* VerizonNHGeDS-Bold.otf in Resources */ = {isa = PBXBuildFile; fileRef = 94CA227A24058533002D6750 /* VerizonNHGeDS-Bold.otf */; };
|
94CA227E24058534002D6750 /* VerizonNHGeDS-Bold.otf in Resources */ = {isa = PBXBuildFile; fileRef = 94CA227A24058533002D6750 /* VerizonNHGeDS-Bold.otf */; };
|
||||||
94F6516D2437954100631BF9 /* Tabs.swift in Sources */ = {isa = PBXBuildFile; fileRef = 94F6516C2437954100631BF9 /* Tabs.swift */; };
|
94F6516D2437954100631BF9 /* Tabs.swift in Sources */ = {isa = PBXBuildFile; fileRef = 94F6516C2437954100631BF9 /* Tabs.swift */; };
|
||||||
|
AA104B1A24474A66004D2810 /* HeadersH2Buttons.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA104B1924474A66004D2810 /* HeadersH2Buttons.swift */; };
|
||||||
|
AA104B1C24474A76004D2810 /* HeadersH2ButtonsModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA104B1B24474A76004D2810 /* HeadersH2ButtonsModel.swift */; };
|
||||||
AA11A41F23F15D3100D7962F /* ListRightVariablePayments.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA11A41E23F15D3100D7962F /* ListRightVariablePayments.swift */; };
|
AA11A41F23F15D3100D7962F /* ListRightVariablePayments.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA11A41E23F15D3100D7962F /* ListRightVariablePayments.swift */; };
|
||||||
AA11A42123F15D7000D7962F /* ListRightVariablePaymentsModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA11A42023F15D7000D7962F /* ListRightVariablePaymentsModel.swift */; };
|
AA11A42123F15D7000D7962F /* ListRightVariablePaymentsModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA11A42023F15D7000D7962F /* ListRightVariablePaymentsModel.swift */; };
|
||||||
AA1EC59724373985003D6F50 /* ListThreeColumnSpeedTestDividerModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA1EC59624373985003D6F50 /* ListThreeColumnSpeedTestDividerModel.swift */; };
|
AA1EC59724373985003D6F50 /* ListThreeColumnSpeedTestDividerModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA1EC59624373985003D6F50 /* ListThreeColumnSpeedTestDividerModel.swift */; };
|
||||||
@ -590,6 +592,8 @@
|
|||||||
94CA227A24058533002D6750 /* VerizonNHGeDS-Bold.otf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "VerizonNHGeDS-Bold.otf"; sourceTree = "<group>"; };
|
94CA227A24058533002D6750 /* VerizonNHGeDS-Bold.otf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "VerizonNHGeDS-Bold.otf"; sourceTree = "<group>"; };
|
||||||
94CA227B24058533002D6750 /* VerizonNHGeTX-Regular.otf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "VerizonNHGeTX-Regular.otf"; sourceTree = "<group>"; };
|
94CA227B24058533002D6750 /* VerizonNHGeTX-Regular.otf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "VerizonNHGeTX-Regular.otf"; sourceTree = "<group>"; };
|
||||||
94F6516C2437954100631BF9 /* Tabs.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Tabs.swift; sourceTree = "<group>"; };
|
94F6516C2437954100631BF9 /* Tabs.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Tabs.swift; sourceTree = "<group>"; };
|
||||||
|
AA104B1924474A66004D2810 /* HeadersH2Buttons.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HeadersH2Buttons.swift; sourceTree = "<group>"; };
|
||||||
|
AA104B1B24474A76004D2810 /* HeadersH2ButtonsModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HeadersH2ButtonsModel.swift; sourceTree = "<group>"; };
|
||||||
AA11A41E23F15D3100D7962F /* ListRightVariablePayments.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListRightVariablePayments.swift; sourceTree = "<group>"; };
|
AA11A41E23F15D3100D7962F /* ListRightVariablePayments.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListRightVariablePayments.swift; sourceTree = "<group>"; };
|
||||||
AA11A42023F15D7000D7962F /* ListRightVariablePaymentsModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListRightVariablePaymentsModel.swift; sourceTree = "<group>"; };
|
AA11A42023F15D7000D7962F /* ListRightVariablePaymentsModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListRightVariablePaymentsModel.swift; sourceTree = "<group>"; };
|
||||||
AA1EC59624373985003D6F50 /* ListThreeColumnSpeedTestDividerModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListThreeColumnSpeedTestDividerModel.swift; sourceTree = "<group>"; };
|
AA1EC59624373985003D6F50 /* ListThreeColumnSpeedTestDividerModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListThreeColumnSpeedTestDividerModel.swift; sourceTree = "<group>"; };
|
||||||
@ -955,6 +959,8 @@
|
|||||||
AAA74A162410C04600080241 /* HeadersH2NoButtonsBodyText.swift */,
|
AAA74A162410C04600080241 /* HeadersH2NoButtonsBodyText.swift */,
|
||||||
AA26850D244840C300CE34CC /* HeadersH2TinyButtonModel.swift */,
|
AA26850D244840C300CE34CC /* HeadersH2TinyButtonModel.swift */,
|
||||||
AA26850B244840AE00CE34CC /* HeadersH2TinyButton.swift */,
|
AA26850B244840AE00CE34CC /* HeadersH2TinyButton.swift */,
|
||||||
|
AA104B1B24474A76004D2810 /* HeadersH2ButtonsModel.swift */,
|
||||||
|
AA104B1924474A66004D2810 /* HeadersH2Buttons.swift */,
|
||||||
);
|
);
|
||||||
path = Headers;
|
path = Headers;
|
||||||
sourceTree = "<group>";
|
sourceTree = "<group>";
|
||||||
@ -2231,10 +2237,12 @@
|
|||||||
C003506123AA94CD00B6AC29 /* Button.swift in Sources */,
|
C003506123AA94CD00B6AC29 /* Button.swift in Sources */,
|
||||||
DBC4391B224421A0001AB423 /* CaretLink.swift in Sources */,
|
DBC4391B224421A0001AB423 /* CaretLink.swift in Sources */,
|
||||||
D264FA90243BCE6800D98315 /* ThreeLayerCollectionViewController.swift in Sources */,
|
D264FA90243BCE6800D98315 /* ThreeLayerCollectionViewController.swift in Sources */,
|
||||||
|
AA104B1C24474A76004D2810 /* HeadersH2ButtonsModel.swift in Sources */,
|
||||||
0A6BF4722360C56C0028F841 /* BaseDropdownEntryField.swift in Sources */,
|
0A6BF4722360C56C0028F841 /* BaseDropdownEntryField.swift in Sources */,
|
||||||
BB6C6AC824225290005F7224 /* ListOneColumnTextWithWhitespaceDividerShort.swift in Sources */,
|
BB6C6AC824225290005F7224 /* ListOneColumnTextWithWhitespaceDividerShort.swift in Sources */,
|
||||||
0A41BA6E2344FCD400D4C0BC /* CATransaction+Extension.swift in Sources */,
|
0A41BA6E2344FCD400D4C0BC /* CATransaction+Extension.swift in Sources */,
|
||||||
D21B7F73243BAC6800051ABF /* CollectionItemModelProtocol.swift in Sources */,
|
D21B7F73243BAC6800051ABF /* CollectionItemModelProtocol.swift in Sources */,
|
||||||
|
AA104B1A24474A66004D2810 /* HeadersH2Buttons.swift in Sources */,
|
||||||
C7192E7D23C301750050C2A0 /* HeadLineBodyCaretLinkImage.swift in Sources */,
|
C7192E7D23C301750050C2A0 /* HeadLineBodyCaretLinkImage.swift in Sources */,
|
||||||
D29DF13221E6851E003B2FB9 /* MVMCoreUITopAlertBaseView.m in Sources */,
|
D29DF13221E6851E003B2FB9 /* MVMCoreUITopAlertBaseView.m in Sources */,
|
||||||
BB1D17E2244EAA46001D2002 /* ListDeviceComplexButtonMedium.swift in Sources */,
|
BB1D17E2244EAA46001D2002 /* ListDeviceComplexButtonMedium.swift in Sources */,
|
||||||
|
|||||||
@ -71,7 +71,7 @@ open class CaretLink: Button, MVMCoreUIViewConstrainingProtocol {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public override func updateView(_ size: CGFloat) {
|
public override func updateView(_ size: CGFloat) {
|
||||||
titleLabel?.font = MFStyler.fontB1()
|
titleLabel?.font = MFStyler.fontBoldBodySmall()
|
||||||
}
|
}
|
||||||
|
|
||||||
//------------------------------------------------------
|
//------------------------------------------------------
|
||||||
|
|||||||
@ -20,7 +20,7 @@ import UIKit
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public override var isSelected: Bool {
|
@objc public override var isSelected: Bool {
|
||||||
didSet {
|
didSet {
|
||||||
radioModel?.state = isSelected
|
radioModel?.state = isSelected
|
||||||
updateAccessibilityLabel()
|
updateAccessibilityLabel()
|
||||||
@ -127,7 +127,7 @@ import UIKit
|
|||||||
func updateAccessibilityLabel() {
|
func updateAccessibilityLabel() {
|
||||||
|
|
||||||
if let state = MVMCoreUIUtility.hardcodedString(withKey: isSelected ? "radio_selected_state" : "radio_not_selected_state") {
|
if let state = MVMCoreUIUtility.hardcodedString(withKey: isSelected ? "radio_selected_state" : "radio_not_selected_state") {
|
||||||
accessibilityLabel = String(format: MVMCoreUIUtility.hardcodedString(withKey: "radio_desc_state") ?? "%@%@", "", state)
|
accessibilityLabel = state
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -19,22 +19,22 @@ import Foundation
|
|||||||
private var selectedRadioButton: RadioButton?
|
private var selectedRadioButton: RadioButton?
|
||||||
private var selectedRadioButtonModel: RadioButtonModel?
|
private var selectedRadioButtonModel: RadioButtonModel?
|
||||||
public var baseValue: AnyHashable?
|
public var baseValue: AnyHashable?
|
||||||
|
|
||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
// MARK: - Initializer
|
// MARK: - Initializer
|
||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
|
|
||||||
public func set(_ radioButtonModel: RadioButtonModel, _ radioButton: RadioButton) {
|
public func set(_ radioButtonModel: RadioButtonModel, _ radioButton: RadioButton) {
|
||||||
self.fieldKey = radioButtonModel.fieldKey
|
self.fieldKey = radioButtonModel.fieldKey
|
||||||
self.groupName = radioButtonModel.groupName
|
self.groupName = radioButtonModel.groupName
|
||||||
|
|
||||||
if radioButtonModel.state {
|
if radioButtonModel.state {
|
||||||
if self.baseValue == nil,
|
if self.baseValue == nil,
|
||||||
let selected = radioButtonModel.baseValue as? Bool, selected {
|
let selected = radioButtonModel.baseValue as? Bool, selected {
|
||||||
self.baseValue = radioButtonModel.fieldValue
|
self.baseValue = radioButtonModel.fieldValue
|
||||||
}
|
}
|
||||||
selectedRadioButtonModel = radioButtonModel
|
selectedRadioButtonModel = radioButtonModel
|
||||||
|
|
||||||
// Below code is needed for cell resuse scenario.
|
// Below code is needed for cell resuse scenario.
|
||||||
radioButton.isSelected = true
|
radioButton.isSelected = true
|
||||||
selectedRadioButton = radioButton
|
selectedRadioButton = radioButton
|
||||||
@ -50,24 +50,24 @@ import Foundation
|
|||||||
public static func setupForRadioButtonGroup(_ radioButtonModel: RadioButtonModel, _ radioButton: RadioButton, delegateObject: MVMCoreUIDelegateObject?) {
|
public static func setupForRadioButtonGroup(_ radioButtonModel: RadioButtonModel, _ radioButton: RadioButton, delegateObject: MVMCoreUIDelegateObject?) {
|
||||||
|
|
||||||
guard let groupName = radioButtonModel.fieldKey,
|
guard let groupName = radioButtonModel.fieldKey,
|
||||||
let formValidator = delegateObject?.formHolderDelegate?.formValidator else {
|
let formValidator = delegateObject?.formHolderDelegate?.formValidator
|
||||||
return
|
else { return }
|
||||||
}
|
|
||||||
|
|
||||||
let radioButtonSelectionHelper = formValidator.radioButtonsModelByGroup[groupName] ?? RadioButtonSelectionHelper()
|
let radioButtonSelectionHelper = formValidator.radioButtonsModelByGroup[groupName] ?? RadioButtonSelectionHelper()
|
||||||
radioButtonSelectionHelper.set(radioButtonModel, radioButton)
|
radioButtonSelectionHelper.set(radioButtonModel, radioButton)
|
||||||
formValidator.radioButtonsModelByGroup[groupName] = radioButtonSelectionHelper
|
formValidator.radioButtonsModelByGroup[groupName] = radioButtonSelectionHelper
|
||||||
FormValidator.setupValidation(for: radioButtonSelectionHelper, delegate: delegateObject?.formHolderDelegate)
|
FormValidator.setupValidation(for: radioButtonSelectionHelper, delegate: delegateObject?.formHolderDelegate)
|
||||||
}
|
}
|
||||||
|
|
||||||
public func selected(_ radioButton: RadioButton) {
|
public func selected(_ radioButton: RadioButton) {
|
||||||
|
|
||||||
// Checks because the view could be reused
|
// Checks because the view could be reused
|
||||||
if selectedRadioButton?.radioModel === selectedRadioButtonModel {
|
if selectedRadioButton?.radioModel === selectedRadioButtonModel {
|
||||||
selectedRadioButton?.isSelected = false
|
selectedRadioButton?.isSelected = false
|
||||||
} else {
|
} else {
|
||||||
selectedRadioButtonModel?.state = false
|
selectedRadioButtonModel?.state = false
|
||||||
}
|
}
|
||||||
|
|
||||||
selectedRadioButton = radioButton
|
selectedRadioButton = radioButton
|
||||||
selectedRadioButton?.isSelected = true
|
selectedRadioButton?.isSelected = true
|
||||||
selectedRadioButtonModel = selectedRadioButton?.radioModel
|
selectedRadioButtonModel = selectedRadioButton?.radioModel
|
||||||
@ -76,6 +76,7 @@ import Foundation
|
|||||||
|
|
||||||
// MARK: - FormValidationFormFieldProtocol
|
// MARK: - FormValidationFormFieldProtocol
|
||||||
extension RadioButtonSelectionHelper {
|
extension RadioButtonSelectionHelper {
|
||||||
|
|
||||||
public func formFieldValue() -> AnyHashable? {
|
public func formFieldValue() -> AnyHashable? {
|
||||||
return selectedRadioButtonModel?.fieldValue
|
return selectedRadioButtonModel?.fieldValue
|
||||||
}
|
}
|
||||||
|
|||||||
@ -6,9 +6,9 @@
|
|||||||
// Copyright © 2020 Verizon Wireless. All rights reserved.
|
// Copyright © 2020 Verizon Wireless. All rights reserved.
|
||||||
//
|
//
|
||||||
|
|
||||||
import Foundation
|
|
||||||
import UIKit
|
import UIKit
|
||||||
|
|
||||||
|
|
||||||
open class RadioSwatch: Control {
|
open class RadioSwatch: Control {
|
||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
// MARK: - Properties
|
// MARK: - Properties
|
||||||
|
|||||||
@ -16,7 +16,7 @@ open class NumericIndicatorView: CarouselIndicator {
|
|||||||
|
|
||||||
/// Text to display the current count of total pages for viewing.
|
/// Text to display the current count of total pages for viewing.
|
||||||
open var pageCount: Label = {
|
open var pageCount: Label = {
|
||||||
let label = Label.commonLabelB2(true)
|
let label = Label.createLabelRegularBodySmall(true)
|
||||||
label.isAccessibilityElement = false
|
label.isAccessibilityElement = false
|
||||||
label.setContentCompressionResistancePriority(.required, for: .vertical)
|
label.setContentCompressionResistancePriority(.required, for: .vertical)
|
||||||
label.textAlignment = .center
|
label.textAlignment = .center
|
||||||
|
|||||||
@ -13,7 +13,7 @@
|
|||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
|
|
||||||
public let checkbox = Checkbox()
|
public let checkbox = Checkbox()
|
||||||
public let label = Label.commonLabelB2(true)
|
public let label = Label.createLabelRegularBodySmall(true)
|
||||||
|
|
||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
// MARK: - Properties
|
// MARK: - Properties
|
||||||
|
|||||||
@ -178,6 +178,7 @@ import Foundation
|
|||||||
// Designed Headers
|
// Designed Headers
|
||||||
MoleculeObjectMapping.shared()?.register(viewClass: HeadersH2NoButtonsBodyText.self, viewModelClass: HeadersH2NoButtonsBodyTextModel.self)
|
MoleculeObjectMapping.shared()?.register(viewClass: HeadersH2NoButtonsBodyText.self, viewModelClass: HeadersH2NoButtonsBodyTextModel.self)
|
||||||
MoleculeObjectMapping.shared()?.register(viewClass: HeadersH2TinyButton.self, viewModelClass: HeadersH2TinyButtonModel.self)
|
MoleculeObjectMapping.shared()?.register(viewClass: HeadersH2TinyButton.self, viewModelClass: HeadersH2TinyButtonModel.self)
|
||||||
|
MoleculeObjectMapping.shared()?.register(viewClass: HeadersH2Buttons.self, viewModelClass: HeadersH2ButtonsModel.self)
|
||||||
|
|
||||||
// Device Items
|
// Device Items
|
||||||
MoleculeObjectMapping.shared()?.register(viewClass: ListDeviceComplexButtonMedium.self, viewModelClass: ListDeviceComplexButtonMediumModel.self)
|
MoleculeObjectMapping.shared()?.register(viewClass: ListDeviceComplexButtonMedium.self, viewModelClass: ListDeviceComplexButtonMediumModel.self)
|
||||||
|
|||||||
@ -0,0 +1,59 @@
|
|||||||
|
//
|
||||||
|
// HeadersH2Buttons.swift
|
||||||
|
// MVMCoreUI
|
||||||
|
//
|
||||||
|
// Created by Lekshmi S on 10/03/20.
|
||||||
|
// Copyright © 2020 Verizon Wireless. All rights reserved.
|
||||||
|
//
|
||||||
|
|
||||||
|
import Foundation
|
||||||
|
|
||||||
|
@objcMembers open class HeadersH2Buttons: HeaderView {
|
||||||
|
//--------------------------------------------------
|
||||||
|
// MARK: - Outlets
|
||||||
|
//--------------------------------------------------
|
||||||
|
public let headlineBody = HeadlineBody(frame: .zero)
|
||||||
|
public let buttons = TwoButtonView(frame: .zero)
|
||||||
|
public let stack: Stack<StackModel>
|
||||||
|
|
||||||
|
//-------------------------------------------------------
|
||||||
|
// MARK: - Initializers
|
||||||
|
//-------------------------------------------------------
|
||||||
|
public override init(frame: CGRect) {
|
||||||
|
stack = Stack<StackModel>.createStack(with: [headlineBody, buttons], spacing: PaddingDefaultVerticalSpacing3)
|
||||||
|
super.init(frame: frame)
|
||||||
|
}
|
||||||
|
|
||||||
|
public required init?(coder: NSCoder) {
|
||||||
|
fatalError("init(coder:) has not been implemented")
|
||||||
|
}
|
||||||
|
|
||||||
|
//-------------------------------------------------------
|
||||||
|
// MARK: - View Lifecycle
|
||||||
|
//-------------------------------------------------------
|
||||||
|
open override func setupView() {
|
||||||
|
super.setupView()
|
||||||
|
headlineBody.stylePageHeader()
|
||||||
|
addMolecule(stack)
|
||||||
|
stack.restack()
|
||||||
|
}
|
||||||
|
|
||||||
|
//----------------------------------------------------
|
||||||
|
// MARK: - Molecule
|
||||||
|
//------------------------------------------------------
|
||||||
|
open override func set(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable : Any]?) {
|
||||||
|
super.set(with: model, delegateObject, additionalData)
|
||||||
|
guard let model = model as? HeadersH2ButtonsModel else { return }
|
||||||
|
headlineBody.set(with: model.headlineBody, delegateObject, additionalData)
|
||||||
|
buttons.set(with: model.buttons, delegateObject, additionalData)
|
||||||
|
}
|
||||||
|
|
||||||
|
open override class func estimatedHeight(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?) -> CGFloat? {
|
||||||
|
return 121
|
||||||
|
}
|
||||||
|
|
||||||
|
open override func reset() {
|
||||||
|
super.reset()
|
||||||
|
headlineBody.stylePageHeader()
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,60 @@
|
|||||||
|
//
|
||||||
|
// HeadersH2ButtonsModel.swift
|
||||||
|
// MVMCoreUI
|
||||||
|
//
|
||||||
|
// Created by Lekshmi S on 10/03/20.
|
||||||
|
// Copyright © 2020 Verizon Wireless. All rights reserved.
|
||||||
|
//
|
||||||
|
|
||||||
|
import Foundation
|
||||||
|
|
||||||
|
public class HeadersH2ButtonsModel: HeaderModel, MoleculeModelProtocol {
|
||||||
|
//--------------------------------------------------
|
||||||
|
// MARK: - Properties
|
||||||
|
//--------------------------------------------------
|
||||||
|
public static var identifier: String = "headerH2Btns"
|
||||||
|
public var headlineBody: HeadlineBodyModel
|
||||||
|
public var buttons: TwoButtonViewModel
|
||||||
|
|
||||||
|
//--------------------------------------------------
|
||||||
|
// MARK: - Initializer
|
||||||
|
//--------------------------------------------------
|
||||||
|
public init(headlineBody: HeadlineBodyModel, buttons: TwoButtonViewModel) {
|
||||||
|
self.headlineBody = headlineBody
|
||||||
|
self.buttons = buttons
|
||||||
|
super.init()
|
||||||
|
}
|
||||||
|
|
||||||
|
public override func setDefaults() {
|
||||||
|
super.setDefaults()
|
||||||
|
topPadding = PaddingDefaultVerticalSpacing3
|
||||||
|
bottomPadding = PaddingDefaultVerticalSpacing3
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------
|
||||||
|
// MARK: - Keys
|
||||||
|
//--------------------------------------------------
|
||||||
|
private enum CodingKeys: String, CodingKey {
|
||||||
|
case moleculeName
|
||||||
|
case headlineBody
|
||||||
|
case buttons
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------
|
||||||
|
// MARK: - Codec
|
||||||
|
//--------------------------------------------------
|
||||||
|
required public init(from decoder: Decoder) throws {
|
||||||
|
let typeContainer = try decoder.container(keyedBy: CodingKeys.self)
|
||||||
|
headlineBody = try typeContainer.decode(HeadlineBodyModel.self, forKey: .headlineBody)
|
||||||
|
buttons = try typeContainer.decode(TwoButtonViewModel.self, forKey: .buttons)
|
||||||
|
try super.init(from: decoder)
|
||||||
|
}
|
||||||
|
|
||||||
|
public override func encode(to encoder: Encoder) throws {
|
||||||
|
try super.encode(to: encoder)
|
||||||
|
var container = encoder.container(keyedBy: CodingKeys.self)
|
||||||
|
try container.encode(moleculeName, forKey: .moleculeName)
|
||||||
|
try container.encode(headlineBody, forKey: .headlineBody)
|
||||||
|
try container.encode(buttons, forKey: .buttons)
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -12,6 +12,7 @@ import Foundation
|
|||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
// MARK: - Outlets
|
// MARK: - Outlets
|
||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
|
|
||||||
let headlineBody = HeadlineBody(frame: .zero)
|
let headlineBody = HeadlineBody(frame: .zero)
|
||||||
|
|
||||||
//-------------------------------------------------------
|
//-------------------------------------------------------
|
||||||
|
|||||||
@ -14,7 +14,19 @@ import Foundation
|
|||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
public let headlineBody = HeadlineBody(frame: .zero)
|
public let headlineBody = HeadlineBody(frame: .zero)
|
||||||
public let button = PillButton(frame: .zero)
|
public let button = PillButton(frame: .zero)
|
||||||
public var stack = Stack<StackModel>(frame: .zero)
|
public let stack: Stack<StackModel>
|
||||||
|
|
||||||
|
//-------------------------------------------------------
|
||||||
|
// MARK: - Initializers
|
||||||
|
//-------------------------------------------------------
|
||||||
|
public override init(frame: CGRect) {
|
||||||
|
stack = Stack<StackModel>.createStack(with: [(view: headlineBody, model: StackItemModel(horizontalAlignment: .fill)), (view: button, model: StackItemModel(spacing: spacingBetwenHeadlineBodyAndButton, horizontalAlignment: .leading))], axis: .vertical)
|
||||||
|
super.init(frame: frame)
|
||||||
|
}
|
||||||
|
|
||||||
|
public required init?(coder: NSCoder) {
|
||||||
|
fatalError("init(coder:) has not been implemented")
|
||||||
|
}
|
||||||
|
|
||||||
//------------------------------------------------------
|
//------------------------------------------------------
|
||||||
// MARK: - Constants
|
// MARK: - Constants
|
||||||
@ -26,7 +38,6 @@ import Foundation
|
|||||||
//-------------------------------------------------------
|
//-------------------------------------------------------
|
||||||
open override func setupView() {
|
open override func setupView() {
|
||||||
super.setupView()
|
super.setupView()
|
||||||
stack = Stack<StackModel>.createStack(with: [(view: headlineBody, model: StackItemModel(horizontalAlignment: .fill)), (view: button, model: StackItemModel(spacing: spacingBetwenHeadlineBodyAndButton, horizontalAlignment: .leading))], axis: .vertical)
|
|
||||||
headlineBody.stylePageHeader()
|
headlineBody.stylePageHeader()
|
||||||
addMolecule(stack)
|
addMolecule(stack)
|
||||||
stack.restack()
|
stack.restack()
|
||||||
|
|||||||
@ -14,10 +14,10 @@ import Foundation
|
|||||||
// MARK: - Outlets
|
// MARK: - Outlets
|
||||||
//-----------------------------------------------------
|
//-----------------------------------------------------
|
||||||
var stack: Stack<StackModel>
|
var stack: Stack<StackModel>
|
||||||
let label1 = Label.commonLabelB2(true)
|
let label1 = Label.createLabelRegularBodySmall(true)
|
||||||
let label2 = Label.commonLabelB2(true)
|
let label2 = Label.createLabelRegularBodySmall(true)
|
||||||
let label3 = Label.commonLabelB2(true)
|
let label3 = Label.createLabelRegularBodySmall(true)
|
||||||
let label4 = Label.commonLabelB2(true)
|
let label4 = Label.createLabelRegularBodySmall(true)
|
||||||
let arrow = Arrow(frame: .zero)
|
let arrow = Arrow(frame: .zero)
|
||||||
let arrowAndLabel2Stack: Stack<StackModel>
|
let arrowAndLabel2Stack: Stack<StackModel>
|
||||||
|
|
||||||
@ -69,9 +69,9 @@ import Foundation
|
|||||||
|
|
||||||
open override func reset() {
|
open override func reset() {
|
||||||
super.reset()
|
super.reset()
|
||||||
label1.styleB2(true)
|
label1.styleRegularBodySmall(true)
|
||||||
label2.styleB2(true)
|
label2.styleRegularBodySmall(true)
|
||||||
label3.styleB2(true)
|
label3.styleRegularBodySmall(true)
|
||||||
label4.styleB2(true)
|
label4.styleRegularBodySmall(true)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -6,7 +6,6 @@
|
|||||||
// Copyright © 2020 Verizon Wireless. All rights reserved.
|
// Copyright © 2020 Verizon Wireless. All rights reserved.
|
||||||
//
|
//
|
||||||
|
|
||||||
import Foundation
|
|
||||||
import UIKit
|
import UIKit
|
||||||
|
|
||||||
@objcMembers open class ListLeftVariableIconWithRightCaret: TableViewCell {
|
@objcMembers open class ListLeftVariableIconWithRightCaret: TableViewCell {
|
||||||
@ -15,8 +14,8 @@ import UIKit
|
|||||||
// MARK: - Outlets
|
// MARK: - Outlets
|
||||||
//-------------------------------------------------------
|
//-------------------------------------------------------
|
||||||
let leftImage = LoadImageView(pinnedEdges: .all)
|
let leftImage = LoadImageView(pinnedEdges: .all)
|
||||||
let leftLabel = Label.commonLabelB2(true)
|
let leftLabel = Label.createLabelRegularBodySmall(true)
|
||||||
let rightLabel = Label.commonLabelB2(true)
|
let rightLabel = Label.createLabelRegularBodySmall(true)
|
||||||
var stack: Stack<StackModel>
|
var stack: Stack<StackModel>
|
||||||
|
|
||||||
//-----------------------------------------------------
|
//-----------------------------------------------------
|
||||||
@ -64,7 +63,7 @@ import UIKit
|
|||||||
|
|
||||||
open override func reset() {
|
open override func reset() {
|
||||||
super.reset()
|
super.reset()
|
||||||
leftLabel.styleB2(true)
|
leftLabel.styleRegularBodySmall(true)
|
||||||
rightLabel.styleB2(true)
|
rightLabel.styleRegularBodySmall(true)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -14,11 +14,13 @@ import UIKit
|
|||||||
// MARK: - Outlets
|
// MARK: - Outlets
|
||||||
//-----------------------------------------------------
|
//-----------------------------------------------------
|
||||||
|
|
||||||
let radioButton = RadioButton(frame: .zero)
|
let radioButton = RadioButton()
|
||||||
let leftImage = LoadImageView(pinnedEdges: .all)
|
let leftImage = LoadImageView(pinnedEdges: .all)
|
||||||
let eyebrowHeadlineBodyLink = EyebrowHeadlineBodyLink()
|
let eyebrowHeadlineBodyLink = EyebrowHeadlineBodyLink()
|
||||||
var stack: Stack<StackModel>
|
var stack: Stack<StackModel>
|
||||||
|
|
||||||
|
private var observation: NSKeyValueObservation? = nil
|
||||||
|
|
||||||
//-----------------------------------------------------
|
//-----------------------------------------------------
|
||||||
// MARK: - Initializers
|
// MARK: - Initializers
|
||||||
//-----------------------------------------------------
|
//-----------------------------------------------------
|
||||||
@ -46,6 +48,16 @@ import UIKit
|
|||||||
stack.restack()
|
stack.restack()
|
||||||
eyebrowHeadlineBodyLink.body.textColor = .mvmOrangeAA
|
eyebrowHeadlineBodyLink.body.textColor = .mvmOrangeAA
|
||||||
eyebrowHeadlineBodyLink.headline.styleBoldBodySmall(true)
|
eyebrowHeadlineBodyLink.headline.styleBoldBodySmall(true)
|
||||||
|
radioButton.isAccessibilityElement = false
|
||||||
|
isAccessibilityElement = true
|
||||||
|
updateAccessibilityLabel()
|
||||||
|
accessibilityTraits = .button
|
||||||
|
accessibilityHint = MVMCoreUIUtility.hardcodedString(withKey: "radio_action_hint")
|
||||||
|
updateAccessibilityLabel()
|
||||||
|
|
||||||
|
observation = observe(\.radioButton.isSelected, options: [.new]) { [weak self] _, _ in
|
||||||
|
self?.updateAccessibilityLabel()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
open override func reset() {
|
open override func reset() {
|
||||||
@ -64,6 +76,7 @@ import UIKit
|
|||||||
radioButton.set(with: model.radioButton, delegateObject, additionalData)
|
radioButton.set(with: model.radioButton, delegateObject, additionalData)
|
||||||
leftImage.set(with: model.image, delegateObject, additionalData)
|
leftImage.set(with: model.image, delegateObject, additionalData)
|
||||||
eyebrowHeadlineBodyLink.set(with: model.eyebrowHeadlineBodyLink, delegateObject, additionalData)
|
eyebrowHeadlineBodyLink.set(with: model.eyebrowHeadlineBodyLink, delegateObject, additionalData)
|
||||||
|
updateAccessibilityLabel()
|
||||||
}
|
}
|
||||||
|
|
||||||
open override class func estimatedHeight(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?) -> CGFloat? {
|
open override class func estimatedHeight(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?) -> CGFloat? {
|
||||||
@ -71,6 +84,34 @@ import UIKit
|
|||||||
}
|
}
|
||||||
|
|
||||||
public override func didSelectCell(at index: IndexPath, delegateObject: MVMCoreUIDelegateObject?, additionalData: [AnyHashable: Any]?) {
|
public override func didSelectCell(at index: IndexPath, delegateObject: MVMCoreUIDelegateObject?, additionalData: [AnyHashable: Any]?) {
|
||||||
radioButton.tapAction()
|
radioButton.tapAction()
|
||||||
|
}
|
||||||
|
|
||||||
|
func updateAccessibilityLabel() {
|
||||||
|
|
||||||
|
var message = MVMCoreUIUtility.hardcodedString(withKey: "radio_button") ?? ""
|
||||||
|
|
||||||
|
radioButton.updateAccessibilityLabel()
|
||||||
|
if let radioButtonLabel = radioButton.accessibilityLabel {
|
||||||
|
message += radioButtonLabel + ", "
|
||||||
|
}
|
||||||
|
|
||||||
|
if let leftImageLabel = leftImage.accessibilityLabel {
|
||||||
|
message += leftImageLabel + ", "
|
||||||
|
}
|
||||||
|
|
||||||
|
if let eyebrowLabel = eyebrowHeadlineBodyLink.eyebrow.text {
|
||||||
|
message += eyebrowLabel + ", "
|
||||||
|
}
|
||||||
|
|
||||||
|
if let headlineLabel = eyebrowHeadlineBodyLink.headline.text {
|
||||||
|
message += headlineLabel + ", "
|
||||||
|
}
|
||||||
|
|
||||||
|
if let bodyLabel = eyebrowHeadlineBodyLink.body.text {
|
||||||
|
message += bodyLabel
|
||||||
|
}
|
||||||
|
|
||||||
|
accessibilityLabel = message
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -9,11 +9,19 @@
|
|||||||
import Foundation
|
import Foundation
|
||||||
|
|
||||||
public class ListLeftVariableRadioButtonAndPaymentMethodModel: ListItemModel, MoleculeModelProtocol {
|
public class ListLeftVariableRadioButtonAndPaymentMethodModel: ListItemModel, MoleculeModelProtocol {
|
||||||
|
//--------------------------------------------------
|
||||||
|
// MARK: - Properties
|
||||||
|
//--------------------------------------------------
|
||||||
|
|
||||||
public static var identifier: String = "listLVRBImg"
|
public static var identifier: String = "listLVRBImg"
|
||||||
public var radioButton: RadioButtonModel
|
public var radioButton: RadioButtonModel
|
||||||
public var image: ImageViewModel
|
public var image: ImageViewModel
|
||||||
public var eyebrowHeadlineBodyLink: EyebrowHeadlineBodyLinkModel
|
public var eyebrowHeadlineBodyLink: EyebrowHeadlineBodyLinkModel
|
||||||
|
|
||||||
|
//--------------------------------------------------
|
||||||
|
// MARK: - Initializer
|
||||||
|
//--------------------------------------------------
|
||||||
|
|
||||||
public init(radioButton: RadioButtonModel, image: ImageViewModel, eyebrowHeadlineBodyLink:EyebrowHeadlineBodyLinkModel) {
|
public init(radioButton: RadioButtonModel, image: ImageViewModel, eyebrowHeadlineBodyLink:EyebrowHeadlineBodyLinkModel) {
|
||||||
self.radioButton = radioButton
|
self.radioButton = radioButton
|
||||||
self.image = image
|
self.image = image
|
||||||
@ -21,6 +29,10 @@ public class ListLeftVariableRadioButtonAndPaymentMethodModel: ListItemModel, Mo
|
|||||||
super.init()
|
super.init()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------
|
||||||
|
// MARK: - Methods
|
||||||
|
//--------------------------------------------------
|
||||||
|
|
||||||
public override func setDefaults() {
|
public override func setDefaults() {
|
||||||
super.setDefaults()
|
super.setDefaults()
|
||||||
if image.width == nil, image.height == nil {
|
if image.width == nil, image.height == nil {
|
||||||
@ -29,6 +41,10 @@ public class ListLeftVariableRadioButtonAndPaymentMethodModel: ListItemModel, Mo
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------
|
||||||
|
// MARK: - Keys
|
||||||
|
//--------------------------------------------------
|
||||||
|
|
||||||
private enum CodingKeys: String, CodingKey {
|
private enum CodingKeys: String, CodingKey {
|
||||||
case moleculeName
|
case moleculeName
|
||||||
case radioButton
|
case radioButton
|
||||||
@ -36,6 +52,10 @@ public class ListLeftVariableRadioButtonAndPaymentMethodModel: ListItemModel, Mo
|
|||||||
case eyebrowHeadlineBodyLink
|
case eyebrowHeadlineBodyLink
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------
|
||||||
|
// MARK: - Codec
|
||||||
|
//--------------------------------------------------
|
||||||
|
|
||||||
required public init(from decoder: Decoder) throws {
|
required public init(from decoder: Decoder) throws {
|
||||||
let typeContainer = try decoder.container(keyedBy: CodingKeys.self)
|
let typeContainer = try decoder.container(keyedBy: CodingKeys.self)
|
||||||
radioButton = try typeContainer.decode(RadioButtonModel.self, forKey: .radioButton)
|
radioButton = try typeContainer.decode(RadioButtonModel.self, forKey: .radioButton)
|
||||||
|
|||||||
@ -14,10 +14,12 @@ open class ListLeftVariableRadioButtonBodyText: TableViewCell {
|
|||||||
// MARK: - Outlets
|
// MARK: - Outlets
|
||||||
//-----------------------------------------------------
|
//-----------------------------------------------------
|
||||||
|
|
||||||
let radioButton = RadioButton(frame: .zero)
|
let radioButton = RadioButton()
|
||||||
let headlineBody = HeadlineBody()
|
let headlineBody = HeadlineBody()
|
||||||
var stack: Stack<StackModel>
|
var stack: Stack<StackModel>
|
||||||
|
|
||||||
|
private var observation: NSKeyValueObservation? = nil
|
||||||
|
|
||||||
//-----------------------------------------------------
|
//-----------------------------------------------------
|
||||||
// MARK: - Initializers
|
// MARK: - Initializers
|
||||||
//-----------------------------------------------------
|
//-----------------------------------------------------
|
||||||
@ -42,6 +44,15 @@ open class ListLeftVariableRadioButtonBodyText: TableViewCell {
|
|||||||
|
|
||||||
addMolecule(stack)
|
addMolecule(stack)
|
||||||
stack.restack()
|
stack.restack()
|
||||||
|
isAccessibilityElement = true
|
||||||
|
radioButton.isAccessibilityElement = false
|
||||||
|
accessibilityTraits = .button
|
||||||
|
accessibilityHint = MVMCoreUIUtility.hardcodedString(withKey: "radio_action_hint")
|
||||||
|
updateAccessibilityLabel()
|
||||||
|
|
||||||
|
observation = observe(\.radioButton.isSelected, options: [.new]) { [weak self] _, _ in
|
||||||
|
self?.updateAccessibilityLabel()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------
|
//----------------------------------------------------
|
||||||
@ -55,6 +66,7 @@ open class ListLeftVariableRadioButtonBodyText: TableViewCell {
|
|||||||
|
|
||||||
radioButton.set(with: model.radioButton, delegateObject, additionalData)
|
radioButton.set(with: model.radioButton, delegateObject, additionalData)
|
||||||
headlineBody.set(with: model.headlineBody, delegateObject, additionalData)
|
headlineBody.set(with: model.headlineBody, delegateObject, additionalData)
|
||||||
|
updateAccessibilityLabel()
|
||||||
}
|
}
|
||||||
|
|
||||||
open override class func estimatedHeight(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?) -> CGFloat? {
|
open override class func estimatedHeight(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?) -> CGFloat? {
|
||||||
@ -64,4 +76,24 @@ open class ListLeftVariableRadioButtonBodyText: TableViewCell {
|
|||||||
public override func didSelectCell(at index: IndexPath, delegateObject: MVMCoreUIDelegateObject?, additionalData: [AnyHashable: Any]?) {
|
public override func didSelectCell(at index: IndexPath, delegateObject: MVMCoreUIDelegateObject?, additionalData: [AnyHashable: Any]?) {
|
||||||
radioButton.tapAction()
|
radioButton.tapAction()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func updateAccessibilityLabel() {
|
||||||
|
|
||||||
|
var message = MVMCoreUIUtility.hardcodedString(withKey: "radio_button") ?? ""
|
||||||
|
|
||||||
|
radioButton.updateAccessibilityLabel()
|
||||||
|
if let radioButtonLabel = radioButton.accessibilityLabel {
|
||||||
|
message += radioButtonLabel + ", "
|
||||||
|
}
|
||||||
|
|
||||||
|
if let headlineLabel = headlineBody.headlineLabel.text {
|
||||||
|
message += headlineLabel + ", "
|
||||||
|
}
|
||||||
|
|
||||||
|
if let messageLabel = headlineBody.messageLabel.text {
|
||||||
|
message += messageLabel
|
||||||
|
}
|
||||||
|
|
||||||
|
accessibilityLabel = message
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -15,10 +15,10 @@ import Foundation
|
|||||||
//-----------------------------------------------------
|
//-----------------------------------------------------
|
||||||
|
|
||||||
var stack: Stack<StackModel>
|
var stack: Stack<StackModel>
|
||||||
let eyebrow = Label.commonLabelB3(true)
|
let eyebrow = Label.createLabelRegularMicro(true)
|
||||||
let headline = Label.commonLabelH3(true)
|
let headline = Label.createLabelBoldTitleMedium(true)
|
||||||
let subHeadline = Label.commonLabelB1(true)
|
let subHeadline = Label.createLabelBoldBodySmall(true)
|
||||||
let body = Label.commonLabelB2(true)
|
let body = Label.createLabelRegularBodySmall(true)
|
||||||
let link = Link()
|
let link = Link()
|
||||||
|
|
||||||
//-----------------------------------------------------
|
//-----------------------------------------------------
|
||||||
@ -62,9 +62,9 @@ import Foundation
|
|||||||
|
|
||||||
open override func reset() {
|
open override func reset() {
|
||||||
super.reset()
|
super.reset()
|
||||||
eyebrow.styleB3(true)
|
eyebrow.styleRegularMicro(true)
|
||||||
headline.styleH3(true)
|
headline.styleBoldTitleMedium(true)
|
||||||
subHeadline.styleB1(true)
|
subHeadline.styleBoldBodySmall(true)
|
||||||
body.styleB2(true)
|
body.styleRegularBodySmall(true)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -9,8 +9,8 @@
|
|||||||
import Foundation
|
import Foundation
|
||||||
@objcMembers open class ListRVWheel: TableViewCell {
|
@objcMembers open class ListRVWheel: TableViewCell {
|
||||||
let wheel = Wheel(frame: .zero)
|
let wheel = Wheel(frame: .zero)
|
||||||
let leftLabel = Label.commonLabelB1(true)
|
let leftLabel = Label.createLabelBoldBodySmall(true)
|
||||||
let rightLabel = Label.commonLabelB2(true)
|
let rightLabel = Label.createLabelRegularBodySmall(true)
|
||||||
var stack: Stack<StackModel>
|
var stack: Stack<StackModel>
|
||||||
|
|
||||||
//-----------------------------------------------------
|
//-----------------------------------------------------
|
||||||
@ -54,8 +54,8 @@ import Foundation
|
|||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
open override func reset() {
|
open override func reset() {
|
||||||
super.reset()
|
super.reset()
|
||||||
leftLabel.styleB1(true)
|
leftLabel.styleBoldBodySmall(true)
|
||||||
rightLabel.styleB2(true)
|
rightLabel.styleRegularBodySmall(true)
|
||||||
}
|
}
|
||||||
|
|
||||||
public override class func estimatedHeight(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?) -> CGFloat? {
|
public override class func estimatedHeight(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?) -> CGFloat? {
|
||||||
|
|||||||
@ -13,7 +13,7 @@ import Foundation
|
|||||||
//-----------------------------------------------------
|
//-----------------------------------------------------
|
||||||
// MARK: - Outlets
|
// MARK: - Outlets
|
||||||
//-------------------------------------------------------
|
//-------------------------------------------------------
|
||||||
let leftLabel = Label.commonLabelB1(true)
|
let leftLabel = Label.createLabelBoldBodySmall(true)
|
||||||
let rightImage = LoadImageView(pinnedEdges: .all)
|
let rightImage = LoadImageView(pinnedEdges: .all)
|
||||||
var stack: Stack<StackModel>
|
var stack: Stack<StackModel>
|
||||||
|
|
||||||
@ -57,6 +57,6 @@ import Foundation
|
|||||||
|
|
||||||
open override func reset() {
|
open override func reset() {
|
||||||
super.reset()
|
super.reset()
|
||||||
leftLabel.styleB1(true)
|
leftLabel.styleBoldBodySmall(true)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -15,7 +15,7 @@ import Foundation
|
|||||||
//-----------------------------------------------------
|
//-----------------------------------------------------
|
||||||
public let eyebrowHeadlineBodyLink = EyebrowHeadlineBodyLink(frame: .zero)
|
public let eyebrowHeadlineBodyLink = EyebrowHeadlineBodyLink(frame: .zero)
|
||||||
public let arrow = Arrow(frame: .zero)
|
public let arrow = Arrow(frame: .zero)
|
||||||
public let rightLabel = Label.commonLabelB2(true)
|
public let rightLabel = Label.createLabelRegularBodySmall(true)
|
||||||
private let stack: Stack<StackModel>
|
private let stack: Stack<StackModel>
|
||||||
private let arrowStackItem: StackItem
|
private let arrowStackItem: StackItem
|
||||||
private let rightLabelStackItem: StackItem
|
private let rightLabelStackItem: StackItem
|
||||||
|
|||||||
@ -15,7 +15,7 @@ import Foundation
|
|||||||
private let stack: Stack<StackModel>
|
private let stack: Stack<StackModel>
|
||||||
public let headlineBody = HeadlineBody(frame: .zero)
|
public let headlineBody = HeadlineBody(frame: .zero)
|
||||||
public let arrow = Arrow(frame: .zero)
|
public let arrow = Arrow(frame: .zero)
|
||||||
public let rightLabel = Label.commonLabelB2(true)
|
public let rightLabel = Label.createLabelRegularBodySmall(true)
|
||||||
let arrowAndRightLabelStack: Stack<StackModel>
|
let arrowAndRightLabelStack: Stack<StackModel>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -14,8 +14,8 @@ import Foundation
|
|||||||
// MARK: - Outlets
|
// MARK: - Outlets
|
||||||
//-----------------------------------------------------
|
//-----------------------------------------------------
|
||||||
public var stack: Stack<StackModel>
|
public var stack: Stack<StackModel>
|
||||||
public let leftLabel = Label.commonLabelB1(true)
|
public let leftLabel = Label.createLabelBoldBodySmall(true)
|
||||||
public let rightLabel = Label.commonLabelB2(true)
|
public let rightLabel = Label.createLabelRegularBodySmall(true)
|
||||||
public let bar = Line()
|
public let bar = Line()
|
||||||
|
|
||||||
//-----------------------------------------------------
|
//-----------------------------------------------------
|
||||||
@ -61,8 +61,8 @@ import Foundation
|
|||||||
|
|
||||||
open override func reset() {
|
open override func reset() {
|
||||||
super.reset()
|
super.reset()
|
||||||
leftLabel.styleB1(true)
|
leftLabel.styleBoldBodySmall(true)
|
||||||
rightLabel.styleB2(true)
|
rightLabel.styleRegularBodySmall(true)
|
||||||
bar.setStyle(.heavy)
|
bar.setStyle(.heavy)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -13,15 +13,15 @@ import Foundation
|
|||||||
//-------------------------------------------------------
|
//-------------------------------------------------------
|
||||||
// MARK: - Outlets
|
// MARK: - Outlets
|
||||||
//-------------------------------------------------------
|
//-------------------------------------------------------
|
||||||
let leftHeadline1 = Label.commonLabelB1(true)
|
let leftHeadline1 = Label.createLabelBoldBodySmall(true)
|
||||||
let leftHeadline2 = Label.commonLabelB1(true)
|
let leftHeadline2 = Label.createLabelBoldBodySmall(true)
|
||||||
let leftHeadline3 = Label.commonLabelB1(true)
|
let leftHeadline3 = Label.createLabelBoldBodySmall(true)
|
||||||
let leftBody = Label.commonLabelB2(true)
|
let leftBody = Label.createLabelRegularBodySmall(true)
|
||||||
let leftLink = Link()
|
let leftLink = Link()
|
||||||
let rightHeadline1 = Label.commonLabelB1(true)
|
let rightHeadline1 = Label.createLabelBoldBodySmall(true)
|
||||||
let rightHeadline2 = Label.commonLabelB1(true)
|
let rightHeadline2 = Label.createLabelBoldBodySmall(true)
|
||||||
let rightHeadline3 = Label.commonLabelB1(true)
|
let rightHeadline3 = Label.createLabelBoldBodySmall(true)
|
||||||
let rightBody = Label.commonLabelB2(true)
|
let rightBody = Label.createLabelRegularBodySmall(true)
|
||||||
let rightLink = Link()
|
let rightLink = Link()
|
||||||
let containingStack: Stack<StackModel>
|
let containingStack: Stack<StackModel>
|
||||||
|
|
||||||
@ -97,14 +97,14 @@ import Foundation
|
|||||||
|
|
||||||
open override func reset() {
|
open override func reset() {
|
||||||
super.reset()
|
super.reset()
|
||||||
leftHeadline1.styleB1(true)
|
leftHeadline1.styleBoldBodySmall(true)
|
||||||
leftHeadline2.styleB1(true)
|
leftHeadline2.styleBoldBodySmall(true)
|
||||||
leftHeadline3.styleB1(true)
|
leftHeadline3.styleBoldBodySmall(true)
|
||||||
leftBody.styleB2(true)
|
leftBody.styleRegularBodySmall(true)
|
||||||
rightHeadline1.styleB1(true)
|
rightHeadline1.styleBoldBodySmall(true)
|
||||||
rightHeadline2.styleB1(true)
|
rightHeadline2.styleBoldBodySmall(true)
|
||||||
rightHeadline3.styleB1(true)
|
rightHeadline3.styleBoldBodySmall(true)
|
||||||
rightBody.styleB2(true)
|
rightBody.styleRegularBodySmall(true)
|
||||||
}
|
}
|
||||||
|
|
||||||
public override class func estimatedHeight(with molecule: MoleculeModelProtocol?, _ delegateObject: MVMCoreUIDelegateObject?) -> CGFloat {
|
public override class func estimatedHeight(with molecule: MoleculeModelProtocol?, _ delegateObject: MVMCoreUIDelegateObject?) -> CGFloat {
|
||||||
|
|||||||
@ -13,10 +13,10 @@ import Foundation
|
|||||||
//-----------------------------------------------------
|
//-----------------------------------------------------
|
||||||
// MARK: - Outlets
|
// MARK: - Outlets
|
||||||
//-------------------------------------------------------
|
//-------------------------------------------------------
|
||||||
public let leftHeadline = Label.commonLabelB1(true)
|
public let leftHeadline = Label.createLabelBoldBodySmall(true)
|
||||||
public let leftBody = Label.commonLabelB2(true)
|
public let leftBody = Label.createLabelRegularBodySmall(true)
|
||||||
public let rightLabel = Label.commonLabelB2(true)
|
public let rightLabel = Label.createLabelRegularBodySmall(true)
|
||||||
public let rightSubLabel = Label.commonLabelB2(true)
|
public let rightSubLabel = Label.createLabelRegularBodySmall(true)
|
||||||
|
|
||||||
public let view = MVMCoreUICommonViewsUtility.commonView()
|
public let view = MVMCoreUICommonViewsUtility.commonView()
|
||||||
public let leftVerticalStack: UIStackView
|
public let leftVerticalStack: UIStackView
|
||||||
@ -86,9 +86,9 @@ import Foundation
|
|||||||
super.reset()
|
super.reset()
|
||||||
leftVerticalStack.reset()
|
leftVerticalStack.reset()
|
||||||
rightVerticalStack.reset()
|
rightVerticalStack.reset()
|
||||||
leftHeadline.styleB1(true)
|
leftHeadline.styleBoldBodySmall(true)
|
||||||
leftBody.styleB2(true)
|
leftBody.styleRegularBodySmall(true)
|
||||||
rightLabel.styleB2(true)
|
rightLabel.styleRegularBodySmall(true)
|
||||||
rightSubLabel.styleB2(true)
|
rightSubLabel.styleRegularBodySmall(true)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -10,8 +10,8 @@ import UIKit
|
|||||||
|
|
||||||
@objcMembers open class ListTwoColumnPriceDetails: TableViewCell {
|
@objcMembers open class ListTwoColumnPriceDetails: TableViewCell {
|
||||||
|
|
||||||
let leftLabel = Label.commonLabelB2(true)
|
let leftLabel = Label.createLabelRegularBodySmall(true)
|
||||||
let rightLabel = Label.commonLabelB2(true)
|
let rightLabel = Label.createLabelRegularBodySmall(true)
|
||||||
let view = MVMCoreUICommonViewsUtility.commonView()
|
let view = MVMCoreUICommonViewsUtility.commonView()
|
||||||
|
|
||||||
// MARK: - MFViewProtocol
|
// MARK: - MFViewProtocol
|
||||||
@ -44,8 +44,8 @@ import UIKit
|
|||||||
super.reset()
|
super.reset()
|
||||||
leftLabel.reset()
|
leftLabel.reset()
|
||||||
rightLabel.reset()
|
rightLabel.reset()
|
||||||
leftLabel.styleB2(true)
|
leftLabel.styleRegularBodySmall(true)
|
||||||
rightLabel.styleB2(true)
|
rightLabel.styleRegularBodySmall(true)
|
||||||
}
|
}
|
||||||
|
|
||||||
open override class func estimatedHeight(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?) -> CGFloat {
|
open override class func estimatedHeight(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?) -> CGFloat {
|
||||||
|
|||||||
@ -13,8 +13,8 @@ import Foundation
|
|||||||
// MARK: - Outlets
|
// MARK: - Outlets
|
||||||
//-----------------------------------------------------
|
//-----------------------------------------------------
|
||||||
public var stack: Stack<StackModel>
|
public var stack: Stack<StackModel>
|
||||||
public let headline = Label.commonLabelB1(true)
|
public let headline = Label.createLabelBoldBodySmall(true)
|
||||||
public let body = Label.commonLabelB2(true)
|
public let body = Label.createLabelRegularBodySmall(true)
|
||||||
|
|
||||||
// MARK: - Initializers
|
// MARK: - Initializers
|
||||||
public override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
|
public override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
|
||||||
@ -50,7 +50,7 @@ import Foundation
|
|||||||
|
|
||||||
open override func reset() {
|
open override func reset() {
|
||||||
super.reset()
|
super.reset()
|
||||||
headline.styleB1(true)
|
headline.styleBoldBodySmall(true)
|
||||||
body.styleB2(true)
|
body.styleRegularBodySmall(true)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -13,8 +13,8 @@ import Foundation
|
|||||||
// MARK: - Outlets
|
// MARK: - Outlets
|
||||||
//-----------------------------------------------------
|
//-----------------------------------------------------
|
||||||
public var stack: Stack<StackModel>
|
public var stack: Stack<StackModel>
|
||||||
public let headline = Label.commonLabelH3(true)
|
public let headline = Label.createLabelBoldTitleMedium(true)
|
||||||
public let body = Label.commonLabelB2(true)
|
public let body = Label.createLabelRegularBodySmall(true)
|
||||||
|
|
||||||
// MARK: - Initializers
|
// MARK: - Initializers
|
||||||
public override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
|
public override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
|
||||||
@ -50,7 +50,7 @@ import Foundation
|
|||||||
|
|
||||||
open override func reset() {
|
open override func reset() {
|
||||||
super.reset()
|
super.reset()
|
||||||
headline.styleH3(true)
|
headline.styleBoldTitleMedium(true)
|
||||||
body.styleB2(true)
|
body.styleRegularBodySmall(true)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -13,8 +13,8 @@ import Foundation
|
|||||||
// MARK: - Outlets
|
// MARK: - Outlets
|
||||||
//-----------------------------------------------------
|
//-----------------------------------------------------
|
||||||
public var stack: Stack<StackModel>
|
public var stack: Stack<StackModel>
|
||||||
public let headline = Label.commonLabelH3(true)
|
public let headline = Label.createLabelBoldTitleMedium(true)
|
||||||
public let body = Label.commonLabelB2(true)
|
public let body = Label.createLabelRegularBodySmall(true)
|
||||||
|
|
||||||
// MARK: - Initializers
|
// MARK: - Initializers
|
||||||
public override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
|
public override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
|
||||||
@ -50,7 +50,7 @@ import Foundation
|
|||||||
|
|
||||||
open override func reset() {
|
open override func reset() {
|
||||||
super.reset()
|
super.reset()
|
||||||
headline.styleH3(true)
|
headline.styleBoldTitleMedium(true)
|
||||||
body.styleB2(true)
|
body.styleRegularBodySmall(true)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -18,7 +18,7 @@ import UIKit
|
|||||||
|
|
||||||
open override func setupView() {
|
open override func setupView() {
|
||||||
super.setupView()
|
super.setupView()
|
||||||
headlineBody.headlineLabel.styleB1(true)
|
headlineBody.headlineLabel.styleBoldBodySmall(true)
|
||||||
headlineBody.spaceBetweenLabelsConstant = 0
|
headlineBody.spaceBetweenLabelsConstant = 0
|
||||||
imageView.addSizeConstraintsForAspectRatio = true
|
imageView.addSizeConstraintsForAspectRatio = true
|
||||||
|
|
||||||
@ -43,7 +43,7 @@ import UIKit
|
|||||||
open override func reset() {
|
open override func reset() {
|
||||||
super.reset()
|
super.reset()
|
||||||
headlineBody.reset()
|
headlineBody.reset()
|
||||||
headlineBody.headlineLabel.styleB1(true)
|
headlineBody.headlineLabel.styleBoldBodySmall(true)
|
||||||
headlineBody.spaceBetweenLabelsConstant = 0
|
headlineBody.spaceBetweenLabelsConstant = 0
|
||||||
imageView.reset()
|
imageView.reset()
|
||||||
}
|
}
|
||||||
|
|||||||
@ -9,21 +9,39 @@
|
|||||||
import Foundation
|
import Foundation
|
||||||
import MVMCore
|
import MVMCore
|
||||||
|
|
||||||
|
|
||||||
@objcMembers public class MoleculeListItemModel: ListItemModel, MoleculeModelProtocol {
|
@objcMembers public class MoleculeListItemModel: ListItemModel, MoleculeModelProtocol {
|
||||||
|
//--------------------------------------------------
|
||||||
|
// MARK: - Properties
|
||||||
|
//--------------------------------------------------
|
||||||
|
|
||||||
public class var identifier: String {
|
public class var identifier: String {
|
||||||
return "listItem"
|
return "listItem"
|
||||||
}
|
}
|
||||||
|
|
||||||
public var molecule: MoleculeModelProtocol
|
public var molecule: MoleculeModelProtocol
|
||||||
|
|
||||||
|
//--------------------------------------------------
|
||||||
|
// MARK: - Keys
|
||||||
|
//--------------------------------------------------
|
||||||
|
|
||||||
private enum CodingKeys: String, CodingKey {
|
private enum CodingKeys: String, CodingKey {
|
||||||
case moleculeName
|
case moleculeName
|
||||||
case molecule
|
case molecule
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------
|
||||||
|
// MARK: - Initializer
|
||||||
|
//--------------------------------------------------
|
||||||
|
|
||||||
public init(with moleculeModel: MoleculeModelProtocol) {
|
public init(with moleculeModel: MoleculeModelProtocol) {
|
||||||
molecule = moleculeModel
|
molecule = moleculeModel
|
||||||
super.init()
|
super.init()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------
|
||||||
|
// MARK: - Codec
|
||||||
|
//--------------------------------------------------
|
||||||
|
|
||||||
required public init(from decoder: Decoder) throws {
|
required public init(from decoder: Decoder) throws {
|
||||||
let typeContainer = try decoder.container(keyedBy: CodingKeys.self)
|
let typeContainer = try decoder.container(keyedBy: CodingKeys.self)
|
||||||
@ -38,4 +56,3 @@ import MVMCore
|
|||||||
try container.encodeModel(molecule, forKey: .molecule)
|
try container.encodeModel(molecule, forKey: .molecule)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -10,8 +10,9 @@ import UIKit
|
|||||||
|
|
||||||
|
|
||||||
@objcMembers open class MoleculeTableViewCell: TableViewCell {
|
@objcMembers open class MoleculeTableViewCell: TableViewCell {
|
||||||
|
//--------------------------------------------------
|
||||||
// MARK: - MoleculeViewProtocol
|
// MARK: - MoleculeViewProtocol
|
||||||
|
//--------------------------------------------------
|
||||||
|
|
||||||
public override func set(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable: Any]?) {
|
public override func set(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable: Any]?) {
|
||||||
|
|
||||||
|
|||||||
@ -92,8 +92,8 @@ import UIKit
|
|||||||
|
|
||||||
private func setDefaultState() {
|
private func setDefaultState() {
|
||||||
|
|
||||||
headlineBodyButton.headlineBody.headlineLabel.font = MFStyler.fontH3()
|
headlineBodyButton.headlineBody.headlineLabel.font = MFStyler.fontBoldTitleMedium()
|
||||||
headlineBodyButton.headlineBody.messageLabel.font = MFStyler.fontB3()
|
headlineBodyButton.headlineBody.messageLabel.font = MFStyler.fontRegularMicro()
|
||||||
imageLoader.imageView.contentMode = .scaleAspectFit
|
imageLoader.imageView.contentMode = .scaleAspectFit
|
||||||
imageLoader.addSizeConstraintsForAspectRatio = true
|
imageLoader.addSizeConstraintsForAspectRatio = true
|
||||||
buttonHeaderPadding = PaddingTwo
|
buttonHeaderPadding = PaddingTwo
|
||||||
|
|||||||
@ -10,10 +10,10 @@ import UIKit
|
|||||||
|
|
||||||
@objcMembers public class CornerLabels: View {
|
@objcMembers public class CornerLabels: View {
|
||||||
var middleView: UIView?
|
var middleView: UIView?
|
||||||
let topLeftLabel = Label.commonLabelB1(true)
|
let topLeftLabel = Label.createLabelBoldBodySmall(true)
|
||||||
let topRightLabel = Label.commonLabelB1(true)
|
let topRightLabel = Label.createLabelBoldBodySmall(true)
|
||||||
let bottomLeftLabel = Label.commonLabelB3(true)
|
let bottomLeftLabel = Label.createLabelRegularMicro(true)
|
||||||
let bottomRightLabel = Label.commonLabelB3(true)
|
let bottomRightLabel = Label.createLabelRegularMicro(true)
|
||||||
let topLabelsView = MVMCoreUICommonViewsUtility.commonView()
|
let topLabelsView = MVMCoreUICommonViewsUtility.commonView()
|
||||||
let bottomLabelsView = MVMCoreUICommonViewsUtility.commonView()
|
let bottomLabelsView = MVMCoreUICommonViewsUtility.commonView()
|
||||||
|
|
||||||
@ -151,10 +151,10 @@ import UIKit
|
|||||||
}
|
}
|
||||||
|
|
||||||
func styleDefault() {
|
func styleDefault() {
|
||||||
topLeftLabel.styleB1(true)
|
topLeftLabel.styleBoldBodySmall(true)
|
||||||
topRightLabel.styleB1(true)
|
topRightLabel.styleBoldBodySmall(true)
|
||||||
bottomLeftLabel.styleB3(true)
|
bottomLeftLabel.styleRegularMicro(true)
|
||||||
bottomRightLabel.styleB3(true)
|
bottomRightLabel.styleRegularMicro(true)
|
||||||
}
|
}
|
||||||
|
|
||||||
public class func estimatedHeight(forRow json: [AnyHashable : Any]?, delegateObject: MVMCoreUIDelegateObject?) -> CGFloat {
|
public class func estimatedHeight(forRow json: [AnyHashable : Any]?, delegateObject: MVMCoreUIDelegateObject?) -> CGFloat {
|
||||||
|
|||||||
@ -6,7 +6,6 @@
|
|||||||
// Copyright © 2020 Verizon Wireless. All rights reserved.
|
// Copyright © 2020 Verizon Wireless. All rights reserved.
|
||||||
//
|
//
|
||||||
|
|
||||||
import Foundation
|
|
||||||
import UIKit
|
import UIKit
|
||||||
|
|
||||||
public class BGImageHeadlineBodyButtonModel: ContainerModel, MoleculeModelProtocol {
|
public class BGImageHeadlineBodyButtonModel: ContainerModel, MoleculeModelProtocol {
|
||||||
|
|||||||
@ -14,9 +14,9 @@ import UIKit
|
|||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
|
|
||||||
public let stack = Stack<StackModel>(frame: .zero)
|
public let stack = Stack<StackModel>(frame: .zero)
|
||||||
public let eyebrow = Label.commonLabelB3(true)
|
public let eyebrow = Label.createLabelRegularMicro(true)
|
||||||
public let headline = Label.commonLabelB1(true)
|
public let headline = Label.createLabelBoldBodySmall(true)
|
||||||
public let body = Label.commonLabelB2(true)
|
public let body = Label.createLabelRegularBodySmall(true)
|
||||||
public let link = Link()
|
public let link = Link()
|
||||||
|
|
||||||
var castModel: EyebrowHeadlineBodyLinkModel? {
|
var castModel: EyebrowHeadlineBodyLinkModel? {
|
||||||
@ -48,9 +48,9 @@ import UIKit
|
|||||||
open override func reset() {
|
open override func reset() {
|
||||||
super.reset()
|
super.reset()
|
||||||
stack.reset()
|
stack.reset()
|
||||||
eyebrow.styleB3(true)
|
eyebrow.styleRegularMicro(true)
|
||||||
headline.styleB1(true)
|
headline.styleBoldBodySmall(true)
|
||||||
body.styleB2(true)
|
body.styleRegularBodySmall(true)
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
|
|||||||
@ -10,8 +10,8 @@ import UIKit
|
|||||||
|
|
||||||
open class HeadlineBody: View {
|
open class HeadlineBody: View {
|
||||||
|
|
||||||
let headlineLabel = Label.commonLabelH2(true)
|
let headlineLabel = Label.createLabelBoldTitleLarge(true)
|
||||||
let messageLabel = Label.commonLabelB2(true)
|
let messageLabel = Label.createLabelRegularBodySmall(true)
|
||||||
var spaceBetweenLabelsConstant = PaddingOne
|
var spaceBetweenLabelsConstant = PaddingOne
|
||||||
var spaceBetweenLabels: NSLayoutConstraint?
|
var spaceBetweenLabels: NSLayoutConstraint?
|
||||||
var leftConstraintTitle: NSLayoutConstraint?
|
var leftConstraintTitle: NSLayoutConstraint?
|
||||||
@ -39,26 +39,26 @@ open class HeadlineBody: View {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func styleLandingPageHeader() {
|
func styleLandingPageHeader() {
|
||||||
headlineLabel.styleH1(true)
|
headlineLabel.styleTitle2XLarge(true)
|
||||||
messageLabel.styleB2(true)
|
messageLabel.styleRegularBodySmall(true)
|
||||||
spaceBetweenLabelsConstant = PaddingTwo
|
spaceBetweenLabelsConstant = PaddingTwo
|
||||||
}
|
}
|
||||||
|
|
||||||
func stylePageHeader() {
|
func stylePageHeader() {
|
||||||
headlineLabel.styleH2(true)
|
headlineLabel.styleBoldTitleLarge(true)
|
||||||
messageLabel.styleB2(true)
|
messageLabel.styleRegularBodySmall(true)
|
||||||
spaceBetweenLabelsConstant = PaddingOne
|
spaceBetweenLabelsConstant = PaddingOne
|
||||||
}
|
}
|
||||||
|
|
||||||
func styleListItem() {
|
func styleListItem() {
|
||||||
headlineLabel.styleB1(true)
|
headlineLabel.styleBoldBodySmall(true)
|
||||||
messageLabel.styleB2(true)
|
messageLabel.styleRegularBodySmall(true)
|
||||||
spaceBetweenLabelsConstant = 0
|
spaceBetweenLabelsConstant = 0
|
||||||
}
|
}
|
||||||
|
|
||||||
func styleListItemDivider() {
|
func styleListItemDivider() {
|
||||||
headlineLabel.styleH3(true)
|
headlineLabel.styleBoldTitleMedium(true)
|
||||||
messageLabel.styleB2(true)
|
messageLabel.styleRegularBodySmall(true)
|
||||||
spaceBetweenLabelsConstant = 0
|
spaceBetweenLabelsConstant = 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -82,8 +82,8 @@ import UIKit
|
|||||||
|
|
||||||
private func defaultState() {
|
private func defaultState() {
|
||||||
|
|
||||||
headlineBody.headlineLabel.font = MFStyler.fontH3()
|
headlineBody.headlineLabel.font = MFStyler.fontBoldTitleMedium()
|
||||||
headlineBody.messageLabel.font = MFStyler.fontB3()
|
headlineBody.messageLabel.font = MFStyler.fontRegularMicro()
|
||||||
button.styleSecondary()
|
button.styleSecondary()
|
||||||
button.isHidden = false
|
button.isHidden = false
|
||||||
buttonHeadlinePadding = PaddingTwo
|
buttonHeadlinePadding = PaddingTwo
|
||||||
|
|||||||
@ -10,7 +10,7 @@ import UIKit
|
|||||||
|
|
||||||
// This class is only temporarily necessary. Eventually we will have initWithModel instad of just init for moleculeviews, which will remove this need.
|
// This class is only temporarily necessary. Eventually we will have initWithModel instad of just init for moleculeviews, which will remove this need.
|
||||||
open class StringAndMoleculeStack: MoleculeStackView {
|
open class StringAndMoleculeStack: MoleculeStackView {
|
||||||
override open func createStackItemsFromModel(_ model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable : Any]?) {
|
override open func createStackItemsFromModel(_ model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable: Any]?) {
|
||||||
guard let model = model as? StackModelProtocol,
|
guard let model = model as? StackModelProtocol,
|
||||||
let molcules = model.molecules as? [MoleculeStackItemModel] else { return }
|
let molcules = model.molecules as? [MoleculeStackItemModel] else { return }
|
||||||
for stackItemModel in molcules {
|
for stackItemModel in molcules {
|
||||||
|
|||||||
@ -9,7 +9,7 @@
|
|||||||
import Foundation
|
import Foundation
|
||||||
|
|
||||||
open class StringAndMoleculeView: View {
|
open class StringAndMoleculeView: View {
|
||||||
var label = Label.commonLabelB2(true)
|
var label = Label.createLabelRegularBodySmall(true)
|
||||||
var molecule: MoleculeViewProtocol
|
var molecule: MoleculeViewProtocol
|
||||||
|
|
||||||
var leftWidthConstraint: NSLayoutConstraint?
|
var leftWidthConstraint: NSLayoutConstraint?
|
||||||
|
|||||||
@ -6,8 +6,6 @@
|
|||||||
// Copyright © 2019 Verizon Wireless. All rights reserved.
|
// Copyright © 2019 Verizon Wireless. All rights reserved.
|
||||||
//
|
//
|
||||||
|
|
||||||
import Foundation
|
|
||||||
|
|
||||||
import UIKit
|
import UIKit
|
||||||
import MVMCore.MVMCoreViewProtocol
|
import MVMCore.MVMCoreViewProtocol
|
||||||
|
|
||||||
|
|||||||
@ -8,7 +8,6 @@
|
|||||||
|
|
||||||
import Foundation
|
import Foundation
|
||||||
|
|
||||||
|
|
||||||
public protocol TemplateProtocol: AnyObject {
|
public protocol TemplateProtocol: AnyObject {
|
||||||
associatedtype TemplateModel: TemplateModelProtocol
|
associatedtype TemplateModel: TemplateModelProtocol
|
||||||
var templateModel: TemplateModel? { get set }
|
var templateModel: TemplateModel? { get set }
|
||||||
@ -19,6 +18,7 @@ public extension TemplateProtocol where Self: ViewController {
|
|||||||
guard let pageJSON = json else { return }
|
guard let pageJSON = json else { return }
|
||||||
let data = try JSONSerialization.data(withJSONObject: pageJSON)
|
let data = try JSONSerialization.data(withJSONObject: pageJSON)
|
||||||
let decoder = JSONDecoder()
|
let decoder = JSONDecoder()
|
||||||
|
try decoder.add(delegateObject: delegateObjectIVar)
|
||||||
let templateModel = try decoder.decode(TemplateModel.self, from: data)
|
let templateModel = try decoder.decode(TemplateModel.self, from: data)
|
||||||
self.templateModel = templateModel
|
self.templateModel = templateModel
|
||||||
self.pageModel = templateModel as? MVMControllerModelProtocol
|
self.pageModel = templateModel as? MVMControllerModelProtocol
|
||||||
|
|||||||
@ -9,6 +9,9 @@
|
|||||||
import UIKit
|
import UIKit
|
||||||
|
|
||||||
open class ModalMoleculeListTemplate: MoleculeListTemplate {
|
open class ModalMoleculeListTemplate: MoleculeListTemplate {
|
||||||
|
//--------------------------------------------------
|
||||||
|
// MARK: - Properties
|
||||||
|
//--------------------------------------------------
|
||||||
|
|
||||||
public var closeButton: Button?
|
public var closeButton: Button?
|
||||||
|
|
||||||
@ -17,5 +20,8 @@ open class ModalMoleculeListTemplate: MoleculeListTemplate {
|
|||||||
closeButton = MVMCoreUICommonViewsUtility.addCloseButton(to: view, action: { _ in
|
closeButton = MVMCoreUICommonViewsUtility.addCloseButton(to: view, action: { _ in
|
||||||
MVMCoreNavigationHandler.shared()?.removeCurrentViewController()
|
MVMCoreNavigationHandler.shared()?.removeCurrentViewController()
|
||||||
})
|
})
|
||||||
|
|
||||||
|
accessibilityElements = [closeButton as Any, tableView as Any]
|
||||||
|
UIAccessibility.post(notification: .layoutChanged, argument: closeButton)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -21,12 +21,10 @@ public protocol MoleculeListCellProtocol: UITableViewCell {
|
|||||||
|
|
||||||
// Default implementation does nothing
|
// Default implementation does nothing
|
||||||
extension MoleculeListCellProtocol {
|
extension MoleculeListCellProtocol {
|
||||||
public func setLines(with model: LineModel?, delegateObject: MVMCoreUIDelegateObject?, additionalData: [AnyHashable: Any]?, indexPath: IndexPath) {
|
|
||||||
}
|
|
||||||
|
|
||||||
public func didSelectCell(at index: IndexPath, delegateObject: MVMCoreUIDelegateObject?, additionalData: [AnyHashable: Any]?) {
|
public func setLines(with model: LineModel?, delegateObject: MVMCoreUIDelegateObject?, additionalData: [AnyHashable: Any]?, indexPath: IndexPath) { }
|
||||||
}
|
|
||||||
|
public func didSelectCell(at index: IndexPath, delegateObject: MVMCoreUIDelegateObject?, additionalData: [AnyHashable: Any]?) { }
|
||||||
func willDisplay() {
|
|
||||||
}
|
func willDisplay() { }
|
||||||
}
|
}
|
||||||
|
|||||||
@ -209,8 +209,11 @@ open class MoleculeListTemplate: ThreeLayerTableViewController, TemplateProtocol
|
|||||||
func getMoleculeInfo(with listItem: (ListItemModelProtocol & MoleculeModelProtocol)?) -> (identifier: String, class: AnyClass, molecule: ListItemModelProtocol & MoleculeModelProtocol)? {
|
func getMoleculeInfo(with listItem: (ListItemModelProtocol & MoleculeModelProtocol)?) -> (identifier: String, class: AnyClass, molecule: ListItemModelProtocol & MoleculeModelProtocol)? {
|
||||||
|
|
||||||
guard let listItem = listItem,
|
guard let listItem = listItem,
|
||||||
let moleculeClass = MoleculeObjectMapping.shared()?.getMoleculeClass(listItem) else { return nil }
|
let moleculeClass = MoleculeObjectMapping.shared()?.getMoleculeClass(listItem)
|
||||||
|
else { return nil }
|
||||||
|
|
||||||
let moleculeName = moleculeClass.nameForReuse(with: listItem, delegateObject() as? MVMCoreUIDelegateObject) ?? listItem.moleculeName
|
let moleculeName = moleculeClass.nameForReuse(with: listItem, delegateObject() as? MVMCoreUIDelegateObject) ?? listItem.moleculeName
|
||||||
|
|
||||||
return (moleculeName, moleculeClass, listItem)
|
return (moleculeName, moleculeClass, listItem)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -205,6 +205,8 @@ import UIKit
|
|||||||
let caret = CaretView(lineWidth: 1)
|
let caret = CaretView(lineWidth: 1)
|
||||||
caret.translatesAutoresizingMaskIntoConstraints = true
|
caret.translatesAutoresizingMaskIntoConstraints = true
|
||||||
caret.isAccessibilityElement = true
|
caret.isAccessibilityElement = true
|
||||||
|
caret.accessibilityTraits = .button
|
||||||
|
caret.accessibilityLabel = "Caret,"
|
||||||
caret.accessibilityHint = MVMCoreUIUtility.hardcodedString(withKey: "AccTabHint")
|
caret.accessibilityHint = MVMCoreUIUtility.hardcodedString(withKey: "AccTabHint")
|
||||||
caret.size = .small(.vertical)
|
caret.size = .small(.vertical)
|
||||||
if let size = caret.size?.dimensions() {
|
if let size = caret.size?.dimensions() {
|
||||||
|
|||||||
@ -40,6 +40,7 @@ open class ThreeLayerTableViewController: ProgrammaticTableViewController {
|
|||||||
createViewForTableHeader()
|
createViewForTableHeader()
|
||||||
createViewForTableFooter()
|
createViewForTableFooter()
|
||||||
tableView?.reloadData()
|
tableView?.reloadData()
|
||||||
|
accessibilityElements = [tableView as Any]
|
||||||
}
|
}
|
||||||
|
|
||||||
override open func viewDidLoad() {
|
override open func viewDidLoad() {
|
||||||
|
|||||||
@ -17,7 +17,10 @@ import UIKit
|
|||||||
public var manager: (UIViewController & MVMCoreViewManagerProtocol)?
|
public var manager: (UIViewController & MVMCoreViewManagerProtocol)?
|
||||||
|
|
||||||
/// A temporary iVar backer for delegateObject() until we change the protocol
|
/// A temporary iVar backer for delegateObject() until we change the protocol
|
||||||
public var delegateObjectIVar: MVMCoreUIDelegateObject?
|
public lazy var delegateObjectIVar: MVMCoreUIDelegateObject = {
|
||||||
|
return MVMCoreUIDelegateObject.create(withDelegateForAll: self)
|
||||||
|
}()
|
||||||
|
|
||||||
public func delegateObject() -> DelegateObject? {
|
public func delegateObject() -> DelegateObject? {
|
||||||
return delegateObjectIVar
|
return delegateObjectIVar
|
||||||
}
|
}
|
||||||
@ -264,9 +267,6 @@ import UIKit
|
|||||||
// Presents from the bottom.
|
// Presents from the bottom.
|
||||||
modalPresentationStyle = MVMCoreGetterUtility.isOnIPad() ? .formSheet : .overCurrentContext
|
modalPresentationStyle = MVMCoreGetterUtility.isOnIPad() ? .formSheet : .overCurrentContext
|
||||||
|
|
||||||
// Create the default delegate object.
|
|
||||||
delegateObjectIVar = MVMCoreUIDelegateObject.create(withDelegateForAll: self)
|
|
||||||
|
|
||||||
// Do some initial loading.
|
// Do some initial loading.
|
||||||
if !initialLoadFinished {
|
if !initialLoadFinished {
|
||||||
initialLoadFinished = true
|
initialLoadFinished = true
|
||||||
|
|||||||
@ -9,7 +9,12 @@
|
|||||||
|
|
||||||
import Foundation
|
import Foundation
|
||||||
|
|
||||||
|
|
||||||
open class ContainerHelper: NSObject {
|
open class ContainerHelper: NSObject {
|
||||||
|
//--------------------------------------------------
|
||||||
|
// MARK: - Constraints
|
||||||
|
//--------------------------------------------------
|
||||||
|
|
||||||
var leftConstraint: NSLayoutConstraint?
|
var leftConstraint: NSLayoutConstraint?
|
||||||
var topConstraint: NSLayoutConstraint?
|
var topConstraint: NSLayoutConstraint?
|
||||||
var bottomConstraint: NSLayoutConstraint?
|
var bottomConstraint: NSLayoutConstraint?
|
||||||
@ -28,17 +33,26 @@ open class ContainerHelper: NSObject {
|
|||||||
var bottomLowConstraint: NSLayoutConstraint?
|
var bottomLowConstraint: NSLayoutConstraint?
|
||||||
var rightLowConstraint: NSLayoutConstraint?
|
var rightLowConstraint: NSLayoutConstraint?
|
||||||
|
|
||||||
|
//--------------------------------------------------
|
||||||
|
// MARK: - Methods
|
||||||
|
//--------------------------------------------------
|
||||||
|
|
||||||
open func constrainView(_ view: UIView) {
|
open func constrainView(_ view: UIView) {
|
||||||
guard let margins = view.superview?.layoutMarginsGuide else { return }
|
guard let margins = view.superview?.layoutMarginsGuide else { return }
|
||||||
|
|
||||||
|
leftConstraint?.isActive = false
|
||||||
leftConstraint = view.leftAnchor.constraint(equalTo: margins.leftAnchor)
|
leftConstraint = view.leftAnchor.constraint(equalTo: margins.leftAnchor)
|
||||||
leftConstraint?.isActive = true
|
leftConstraint?.isActive = true
|
||||||
|
|
||||||
|
topConstraint?.isActive = false
|
||||||
topConstraint = view.topAnchor.constraint(equalTo: margins.topAnchor)
|
topConstraint = view.topAnchor.constraint(equalTo: margins.topAnchor)
|
||||||
topConstraint?.isActive = true
|
topConstraint?.isActive = true
|
||||||
|
|
||||||
|
rightConstraint?.isActive = false
|
||||||
rightConstraint = margins.rightAnchor.constraint(equalTo: view.rightAnchor)
|
rightConstraint = margins.rightAnchor.constraint(equalTo: view.rightAnchor)
|
||||||
rightConstraint?.isActive = true
|
rightConstraint?.isActive = true
|
||||||
|
|
||||||
|
bottomConstraint?.isActive = false
|
||||||
bottomConstraint = margins.bottomAnchor.constraint(equalTo: view.bottomAnchor)
|
bottomConstraint = margins.bottomAnchor.constraint(equalTo: view.bottomAnchor)
|
||||||
bottomConstraint?.isActive = true
|
bottomConstraint?.isActive = true
|
||||||
|
|
||||||
@ -50,23 +64,25 @@ open class ContainerHelper: NSObject {
|
|||||||
alignCenterTopConstraint = view.topAnchor.constraint(greaterThanOrEqualTo: margins.topAnchor)
|
alignCenterTopConstraint = view.topAnchor.constraint(greaterThanOrEqualTo: margins.topAnchor)
|
||||||
alignCenterBottomConstraint = margins.bottomAnchor.constraint(greaterThanOrEqualTo: view.bottomAnchor)
|
alignCenterBottomConstraint = margins.bottomAnchor.constraint(greaterThanOrEqualTo: view.bottomAnchor)
|
||||||
|
|
||||||
|
leftLowConstraint?.isActive = false
|
||||||
leftLowConstraint = view.leftAnchor.constraint(equalTo: margins.leftAnchor)
|
leftLowConstraint = view.leftAnchor.constraint(equalTo: margins.leftAnchor)
|
||||||
leftLowConstraint?.priority = UILayoutPriority(rawValue: 200)
|
leftLowConstraint?.priority = UILayoutPriority(rawValue: 200)
|
||||||
leftLowConstraint?.isActive = true
|
leftLowConstraint?.isActive = true
|
||||||
|
|
||||||
|
topLowConstraint?.isActive = false
|
||||||
topLowConstraint = view.topAnchor.constraint(equalTo: margins.topAnchor)
|
topLowConstraint = view.topAnchor.constraint(equalTo: margins.topAnchor)
|
||||||
topLowConstraint?.priority = UILayoutPriority(rawValue: 200)
|
topLowConstraint?.priority = UILayoutPriority(rawValue: 200)
|
||||||
topLowConstraint?.isActive = true
|
topLowConstraint?.isActive = true
|
||||||
|
|
||||||
|
rightLowConstraint?.isActive = false
|
||||||
rightLowConstraint = margins.rightAnchor.constraint(equalTo: view.rightAnchor)
|
rightLowConstraint = margins.rightAnchor.constraint(equalTo: view.rightAnchor)
|
||||||
rightLowConstraint?.priority = UILayoutPriority(rawValue: 200)
|
rightLowConstraint?.priority = UILayoutPriority(rawValue: 200)
|
||||||
rightLowConstraint?.isActive = true
|
rightLowConstraint?.isActive = true
|
||||||
|
|
||||||
|
bottomLowConstraint?.isActive = false
|
||||||
bottomLowConstraint = margins.bottomAnchor.constraint(equalTo: view.bottomAnchor)
|
bottomLowConstraint = margins.bottomAnchor.constraint(equalTo: view.bottomAnchor)
|
||||||
bottomLowConstraint?.priority = UILayoutPriority(rawValue: 200)
|
bottomLowConstraint?.priority = UILayoutPriority(rawValue: 200)
|
||||||
bottomLowConstraint?.isActive = true
|
bottomLowConstraint?.isActive = true
|
||||||
|
|
||||||
setAccessibility(view)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
open func setAccessibility(_ view: UIView) {
|
open func setAccessibility(_ view: UIView) {
|
||||||
|
|||||||
@ -53,6 +53,7 @@
|
|||||||
|
|
||||||
|
|
||||||
// MARK: Radio Button
|
// MARK: Radio Button
|
||||||
|
"radio_button" = "Radio Button,";
|
||||||
"radio_action_hint" = "Double tap to select";
|
"radio_action_hint" = "Double tap to select";
|
||||||
"radio_selected_state" = "Selected";
|
"radio_selected_state" = "Selected";
|
||||||
"radio_not_selected_state" = "Not Selected";
|
"radio_not_selected_state" = "Not Selected";
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user