Merge branch 'feature/coding' of gitlab.verizon.com:BPHV_MIPS/mvm_core_ui into feature/coding
This commit is contained in:
commit
b4994b0351
@ -12,6 +12,7 @@
|
||||
0105618E224BBE7700E1557D /* FormValidator+TextFields.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0105618B224BBE7700E1557D /* FormValidator+TextFields.swift */; };
|
||||
0105618F224BBE7700E1557D /* FormValidator+FormParams.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0105618C224BBE7700E1557D /* FormValidator+FormParams.swift */; };
|
||||
0116A4E5228B19640094F3ED /* RadioButtonModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0116A4E4228B19640094F3ED /* RadioButtonModel.swift */; };
|
||||
012A88EE239858E300FE3DA1 /* ContainerMoleculeProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = 012A88ED239858E300FE3DA1 /* ContainerMoleculeProtocol.swift */; };
|
||||
012CA98923849699003F810F /* SeperatorModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 012CA98823849699003F810F /* SeperatorModel.swift */; };
|
||||
012CA99A2384A687003F810F /* MFTextField+ModelExtension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 012CA9992384A687003F810F /* MFTextField+ModelExtension.swift */; };
|
||||
012CA99C23859FDC003F810F /* ViewConstrainingView+ModelExtension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 012CA99B23859FDC003F810F /* ViewConstrainingView+ModelExtension.swift */; };
|
||||
@ -85,9 +86,9 @@
|
||||
D260D7B122D65BDD007E7233 /* MVMCoreUIPageControl.h in Headers */ = {isa = PBXBuildFile; fileRef = D260D7AF22D65BDD007E7233 /* MVMCoreUIPageControl.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
D260D7B222D65BDD007E7233 /* MVMCoreUIPageControl.m in Sources */ = {isa = PBXBuildFile; fileRef = D260D7B022D65BDD007E7233 /* MVMCoreUIPageControl.m */; };
|
||||
D260D7B622D68514007E7233 /* MVMCoreUIPagingProtocol.h in Headers */ = {isa = PBXBuildFile; fileRef = D260D7B522D68509007E7233 /* MVMCoreUIPagingProtocol.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
D268C70C2386DFFD007F2C1C /* MoleculeStackItemModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 01EB368A23609801006832FA /* MoleculeStackItemModel.swift */; };
|
||||
D268C70E238C22D7007F2C1C /* DropDownFilterTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = D268C70D238C22D7007F2C1C /* DropDownFilterTableViewCell.swift */; };
|
||||
D268C712238D6699007F2C1C /* DropDown.swift in Sources */ = {isa = PBXBuildFile; fileRef = D268C711238D6699007F2C1C /* DropDown.swift */; };
|
||||
D268C70C2386DFFD007F2C1C /* MoleculeStackItemModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 01EB368A23609801006832FA /* MoleculeStackItemModel.swift */; };
|
||||
D274CA332236A78900B01B62 /* StandardFooterView.swift in Sources */ = {isa = PBXBuildFile; fileRef = D274CA322236A78900B01B62 /* StandardFooterView.swift */; };
|
||||
D2755D7B23689C7500485468 /* TableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = D2755D7A23689C7500485468 /* TableViewCell.swift */; };
|
||||
D27CD40E2322EEAF00C1DC07 /* TabsTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = D27CD40D2322EEAF00C1DC07 /* TabsTableViewCell.swift */; };
|
||||
@ -247,6 +248,7 @@
|
||||
0105618B224BBE7700E1557D /* FormValidator+TextFields.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "FormValidator+TextFields.swift"; sourceTree = "<group>"; };
|
||||
0105618C224BBE7700E1557D /* FormValidator+FormParams.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "FormValidator+FormParams.swift"; sourceTree = "<group>"; };
|
||||
0116A4E4228B19640094F3ED /* RadioButtonModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RadioButtonModel.swift; sourceTree = "<group>"; };
|
||||
012A88ED239858E300FE3DA1 /* ContainerMoleculeProtocol.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContainerMoleculeProtocol.swift; sourceTree = "<group>"; };
|
||||
012CA98823849699003F810F /* SeperatorModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SeperatorModel.swift; sourceTree = "<group>"; };
|
||||
012CA9992384A687003F810F /* MFTextField+ModelExtension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "MFTextField+ModelExtension.swift"; sourceTree = "<group>"; };
|
||||
012CA99B23859FDC003F810F /* ViewConstrainingView+ModelExtension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "ViewConstrainingView+ModelExtension.swift"; sourceTree = "<group>"; };
|
||||
@ -499,6 +501,7 @@
|
||||
0AA33B322398134B0067DD0F /* Primitive Models */,
|
||||
017BEB392360EEB40024EF95 /* PageModel.swift */,
|
||||
01EB3683236097C0006832FA /* MoleculeProtocol.swift */,
|
||||
012A88ED239858E300FE3DA1 /* ContainerMoleculeProtocol.swift */,
|
||||
012CA9BD2385C692003F810F /* ConstrainingMoleculeProtocol.swift */,
|
||||
946EE1B5237B663A0036751F /* Extensions */,
|
||||
01EB368723609801006832FA /* Molecules */,
|
||||
@ -926,7 +929,7 @@
|
||||
D22D1F45220496A30077CEC0 /* MVMCoreUISwitch.m */,
|
||||
DBC4391C2245232D001AB423 /* LabelWithInternalButton.swift */,
|
||||
DB891E822253FA8500022516 /* Label.swift */,
|
||||
94C2D9822386F3E30006CF46 /* LabelModel */,
|
||||
94C2D9822386F3E30006CF46 /* LabelModel */,
|
||||
0A7BAFA0232BE61800FB8E22 /* Checkbox.swift */,
|
||||
0A7BAFA2232BE63400FB8E22 /* CheckboxWithLabelView.swift */,
|
||||
01004F2F22721C3800991ECC /* RadioButton.swift */,
|
||||
@ -1288,6 +1291,7 @@
|
||||
D29DF26D21E6AA0B003B2FB9 /* FLAnimatedImageView.m in Sources */,
|
||||
D29DF2EF21ECEAE1003B2FB9 /* MFFonts.m in Sources */,
|
||||
D22479942316AE5E003FCCF9 /* NSLayoutConstraintExtension.swift in Sources */,
|
||||
012A88EE239858E300FE3DA1 /* ContainerMoleculeProtocol.swift in Sources */,
|
||||
D2B18B94236214AD00A9AEDC /* NavigationController.swift in Sources */,
|
||||
D282AACB2243C61700C46919 /* ButtonView.swift in Sources */,
|
||||
D2D6CD4222E78FAB00D701B8 /* ThreeLayerTemplate.swift in Sources */,
|
||||
|
||||
@ -9,8 +9,9 @@
|
||||
import Foundation
|
||||
|
||||
@objcMembers public class CaretViewModel: MoleculeProtocol {
|
||||
|
||||
public static var identifier: String = "caretView"
|
||||
public var moleculeName: String
|
||||
public var backgroundColor: String?
|
||||
|
||||
public var strokeColor: String?
|
||||
public var isHidden: Bool?
|
||||
|
||||
@ -11,8 +11,8 @@ import Foundation
|
||||
@objcMembers public class DashLineModel: MoleculeProtocol {
|
||||
public static var identifier: String = "dashLine"
|
||||
public var moleculeName: String
|
||||
public var backgroundColor: String?
|
||||
|
||||
public var dashColor: String
|
||||
public var isHidden: Bool?
|
||||
public var backgroundColor: String?
|
||||
}
|
||||
|
||||
@ -11,6 +11,7 @@ import Foundation
|
||||
@objcMembers public class ImageViewModel: MoleculeProtocol {
|
||||
public static var identifier: String = "image"
|
||||
public var moleculeName: String
|
||||
public var backgroundColor: String?
|
||||
|
||||
public var image: String
|
||||
public var accessibilityText: String?
|
||||
|
||||
@ -12,10 +12,11 @@ import Foundation
|
||||
@objcMembers public class LabelModel: MoleculeProtocol {
|
||||
public static var identifier: String = "label"
|
||||
public var moleculeName: String?
|
||||
public var backgroundColor: String?
|
||||
|
||||
public var text: String
|
||||
public var accessibilityText: String?
|
||||
public var textColor: String?
|
||||
public var backgroundColor: String?
|
||||
public var fontStyle: String?
|
||||
public var fontName: String?
|
||||
public var fontSize: CGFloat?
|
||||
|
||||
@ -17,6 +17,7 @@ import Foundation
|
||||
@objcMembers public class MultiProgressBarModel: MoleculeProtocol {
|
||||
public static var identifier: String = "multiProgressBar"
|
||||
public var moleculeName: String
|
||||
public var backgroundColor: String?
|
||||
public var progressList: [SingleProgressBarModel]
|
||||
public var thickness: CGFloat?
|
||||
public var roundedRect: Bool?
|
||||
|
||||
@ -30,18 +30,20 @@ extension ViewConstrainingView {
|
||||
(molecule as? ModelMoleculeViewProtocol)?.setWithModel(model, delegateObject, additionalData)
|
||||
}
|
||||
|
||||
if let useHorizontalMargins = model?.useHorizontalMargins {
|
||||
updateViewHorizontalDefaults = useHorizontalMargins
|
||||
}
|
||||
if let useVerticalMargins = model?.useVerticalMargins {
|
||||
updateViewVerticalDefaults = useVerticalMargins
|
||||
}
|
||||
if let containerMoleculeModel = model as? ContainerMoleculeProtocol {
|
||||
if let useHorizontalMargins = containerMoleculeModel.useHorizontalMargins {
|
||||
updateViewHorizontalDefaults = useHorizontalMargins
|
||||
}
|
||||
if let useVerticalMargins = containerMoleculeModel.useVerticalMargins {
|
||||
updateViewVerticalDefaults = useVerticalMargins
|
||||
}
|
||||
|
||||
if let horizontalAlignment = model?.horizontalAlignment {
|
||||
alignHorizontal(ViewConstrainingView.getAlignmentFor(horizontalAlignment, defaultAlignment: .fill))
|
||||
}
|
||||
if let verticalAlignment = model?.verticalAlignment {
|
||||
alignVertical(ViewConstrainingView.getAlignmentFor(verticalAlignment, defaultAlignment: .fill))
|
||||
if let horizontalAlignment = containerMoleculeModel.horizontalAlignment {
|
||||
alignHorizontal(ViewConstrainingView.getAlignmentFor(horizontalAlignment, defaultAlignment: .fill))
|
||||
}
|
||||
if let verticalAlignment = containerMoleculeModel.verticalAlignment {
|
||||
alignVertical(ViewConstrainingView.getAlignmentFor(verticalAlignment, defaultAlignment: .fill))
|
||||
}
|
||||
}
|
||||
|
||||
#warning("work on the below")
|
||||
|
||||
17
MVMCoreUI/Models/ContainerMoleculeProtocol.swift
Normal file
17
MVMCoreUI/Models/ContainerMoleculeProtocol.swift
Normal file
@ -0,0 +1,17 @@
|
||||
//
|
||||
// ContainerMoleculeProtocol.swift
|
||||
// MVMCoreUI
|
||||
//
|
||||
// Created by Suresh, Kamlesh on 12/4/19.
|
||||
// Copyright © 2019 Verizon Wireless. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
protocol ContainerMoleculeProtocol: MoleculeProtocol {
|
||||
var molecule: MoleculeProtocol? { get }
|
||||
var useHorizontalMargins: Bool? { get }
|
||||
var useVerticalMargins: Bool? { get }
|
||||
var horizontalAlignment: String? { get }
|
||||
var verticalAlignment: String? { get }
|
||||
}
|
||||
@ -4,42 +4,12 @@ public protocol MoleculeProtocol: Model {
|
||||
var moleculeName: String? { get }
|
||||
var backgroundColor: String? { get }
|
||||
var dictionary: [AnyHashable: Any]? { get }
|
||||
var molecule: MoleculeProtocol? { get }
|
||||
|
||||
var useHorizontalMargins: Bool? { get }
|
||||
var useVerticalMargins: Bool? { get }
|
||||
var horizontalAlignment: String? { get }
|
||||
var verticalAlignment: String? { get }
|
||||
}
|
||||
|
||||
extension MoleculeProtocol {
|
||||
public var moleculeName: String? {
|
||||
get { return Self.identifier }
|
||||
}
|
||||
|
||||
public var molecule: MoleculeProtocol? {
|
||||
get { return nil }
|
||||
}
|
||||
|
||||
public var backgroundColor: String? {
|
||||
get { return toJSON()?["backgroundColor"] as? String }
|
||||
}
|
||||
|
||||
public var useHorizontalMargins: Bool? {
|
||||
get { return toJSON()?["useHorizontalMargins"] as? Bool }
|
||||
}
|
||||
|
||||
public var useVerticalMargins: Bool? {
|
||||
get { return toJSON()?["useVerticalMargins"] as? Bool }
|
||||
}
|
||||
|
||||
public var horizontalAlignment: String? {
|
||||
get { return toJSON()?["horizontalAlignment"] as? String }
|
||||
}
|
||||
|
||||
public var verticalAlignment: String? {
|
||||
get { return toJSON()?["verticalAlignment"] as? String }
|
||||
}
|
||||
|
||||
public var dictionary: [AnyHashable: Any]? {
|
||||
return toJSON()
|
||||
|
||||
@ -10,12 +10,11 @@ import Foundation
|
||||
|
||||
@objcMembers public class HeadlineBodyModel: MoleculeProtocol {
|
||||
public static var identifier: String = "headlineBody"
|
||||
public var moleculeName: String?
|
||||
public var backgroundColor: String?
|
||||
public var headline: LabelModel?
|
||||
|
||||
public init(headline: LabelModel?) {
|
||||
self.headline = headline
|
||||
self.moleculeName = Self.identifier
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -10,11 +10,10 @@ import UIKit
|
||||
|
||||
@objcMembers public class LineModel: MoleculeProtocol {
|
||||
public static var identifier: String = "line"
|
||||
public var moleculeName: String?
|
||||
public var backgroundColor: String?
|
||||
public var type: String?
|
||||
|
||||
public init(type: String?) {
|
||||
self.type = type
|
||||
self.moleculeName = Self.identifier
|
||||
self.type = type
|
||||
}
|
||||
}
|
||||
|
||||
@ -10,14 +10,13 @@ import Foundation
|
||||
|
||||
@objcMembers public class ListItemModel: MoleculeProtocol {
|
||||
public static var identifier: String = "listItem"
|
||||
public var moleculeName: String?
|
||||
public var molecule: MoleculeProtocol?
|
||||
public var backgroundColor: String?
|
||||
public var action: ActionModel?
|
||||
|
||||
public init(molecule: MoleculeProtocol?, actionMap: ActionModel?) {
|
||||
self.molecule = molecule
|
||||
self.action = actionMap
|
||||
self.moleculeName = Self.identifier
|
||||
}
|
||||
|
||||
enum CodingKeys: String, CodingKey {
|
||||
@ -28,7 +27,6 @@ import Foundation
|
||||
|
||||
required public init(from decoder: Decoder) throws {
|
||||
let typeContainer = try decoder.container(keyedBy: CodingKeys.self)
|
||||
self.moleculeName = try typeContainer.decode(String.self, forKey: .moleculeName)
|
||||
self.molecule = try typeContainer.decodeIfPresent(codingKey: .molecule)
|
||||
self.action = try typeContainer.decodeIfPresent(ActionModel.self, forKey: .action)
|
||||
}
|
||||
|
||||
@ -10,12 +10,12 @@ import Foundation
|
||||
|
||||
@objcMembers public class MoleculeStackItemModel: MoleculeProtocol {
|
||||
public static var identifier: String = "stackItem"
|
||||
public var moleculeName: String?
|
||||
|
||||
public var molecule: MoleculeProtocol?
|
||||
public var backgroundColor: String?
|
||||
|
||||
public init(molecule: MoleculeProtocol?) {
|
||||
self.molecule = molecule
|
||||
self.moleculeName = Self.identifier
|
||||
}
|
||||
enum CodingKeys: String, CodingKey {
|
||||
case moleculeName
|
||||
@ -24,7 +24,6 @@ import Foundation
|
||||
|
||||
required public init(from decoder: Decoder) throws {
|
||||
let typeContainer = try decoder.container(keyedBy: CodingKeys.self)
|
||||
self.moleculeName = try typeContainer.decode(String.self, forKey: .moleculeName)
|
||||
self.molecule = try typeContainer.decodeIfPresent(codingKey: .molecule)
|
||||
}
|
||||
|
||||
|
||||
@ -11,14 +11,13 @@ import Foundation
|
||||
@objcMembers public class MoleculeStackModel: MoleculeProtocol {
|
||||
|
||||
public static var identifier: String = "moleculeStack"
|
||||
public var moleculeName: String?
|
||||
public var backgroundColor: String?
|
||||
public var molecules: [MoleculeStackItemModel]?
|
||||
public var axis: String?
|
||||
|
||||
public init(axis: String?, molecules: [MoleculeStackItemModel]?) {
|
||||
self.axis = axis
|
||||
self.molecules = molecules
|
||||
self.moleculeName = Self.identifier
|
||||
}
|
||||
|
||||
enum CodingKeys: String, CodingKey {
|
||||
@ -29,7 +28,6 @@ import Foundation
|
||||
|
||||
required public init(from decoder: Decoder) throws {
|
||||
let typeContainer = try decoder.container(keyedBy: CodingKeys.self)
|
||||
self.moleculeName = try typeContainer.decodeIfPresent(String.self, forKey: .moleculeName)
|
||||
self.molecules = try typeContainer.decode([MoleculeStackItemModel].self, forKey: .molecules)
|
||||
self.axis = try typeContainer.decodeIfPresent(String.self, forKey: .axis)
|
||||
}
|
||||
|
||||
@ -10,5 +10,6 @@ import UIKit
|
||||
|
||||
class SeperatorModel: MoleculeProtocol {
|
||||
public static var identifier: String = "line"
|
||||
public var backgroundColor: String?
|
||||
public var type: String?
|
||||
}
|
||||
|
||||
@ -9,7 +9,9 @@
|
||||
import UIKit
|
||||
|
||||
@objcMembers public class TextFieldModel: MoleculeProtocol, FormModelProtocol {
|
||||
|
||||
public static var identifier: String = "textField"
|
||||
public var backgroundColor: String?
|
||||
|
||||
public var editable = true
|
||||
public var disabled = false
|
||||
|
||||
Loading…
Reference in New Issue
Block a user