Merge branch 'develop' of https://gitlab.verizon.com/BPHV_MIPS/mvm_core_ui into develop
This commit is contained in:
commit
a1c63a853d
@ -278,6 +278,8 @@
|
|||||||
D236E5B5241FEB1000C38625 /* ListTwoColumnPriceDescriptionModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = D236E5B3241FEB1000C38625 /* ListTwoColumnPriceDescriptionModel.swift */; };
|
D236E5B5241FEB1000C38625 /* ListTwoColumnPriceDescriptionModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = D236E5B3241FEB1000C38625 /* ListTwoColumnPriceDescriptionModel.swift */; };
|
||||||
D236E5B7242007C500C38625 /* MVMControllerModelProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = D236E5B6242007C500C38625 /* MVMControllerModelProtocol.swift */; };
|
D236E5B7242007C500C38625 /* MVMControllerModelProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = D236E5B6242007C500C38625 /* MVMControllerModelProtocol.swift */; };
|
||||||
D243859923A16B1800332775 /* Container.swift in Sources */ = {isa = PBXBuildFile; fileRef = D243859823A16B1800332775 /* Container.swift */; };
|
D243859923A16B1800332775 /* Container.swift in Sources */ = {isa = PBXBuildFile; fileRef = D243859823A16B1800332775 /* Container.swift */; };
|
||||||
|
D253BB9C245874F8002DE544 /* BGImageMolecule.swift in Sources */ = {isa = PBXBuildFile; fileRef = D253BB9B245874F8002DE544 /* BGImageMolecule.swift */; };
|
||||||
|
D253BB9E2458751F002DE544 /* BGImageMoleculeModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = D253BB9D2458751F002DE544 /* BGImageMoleculeModel.swift */; };
|
||||||
D256E9932412880000360572 /* Header.swift in Sources */ = {isa = PBXBuildFile; fileRef = D256E9922412880000360572 /* Header.swift */; };
|
D256E9932412880000360572 /* Header.swift in Sources */ = {isa = PBXBuildFile; fileRef = D256E9922412880000360572 /* Header.swift */; };
|
||||||
D260105323CEA61600764D80 /* ToggleModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = D260105223CEA61600764D80 /* ToggleModel.swift */; };
|
D260105323CEA61600764D80 /* ToggleModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = D260105223CEA61600764D80 /* ToggleModel.swift */; };
|
||||||
D260105923D0A92900764D80 /* ContainerProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = D260105823D0A92900764D80 /* ContainerProtocol.swift */; };
|
D260105923D0A92900764D80 /* ContainerProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = D260105823D0A92900764D80 /* ContainerProtocol.swift */; };
|
||||||
@ -732,6 +734,8 @@
|
|||||||
D236E5B3241FEB1000C38625 /* ListTwoColumnPriceDescriptionModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ListTwoColumnPriceDescriptionModel.swift; sourceTree = "<group>"; };
|
D236E5B3241FEB1000C38625 /* ListTwoColumnPriceDescriptionModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ListTwoColumnPriceDescriptionModel.swift; sourceTree = "<group>"; };
|
||||||
D236E5B6242007C500C38625 /* MVMControllerModelProtocol.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MVMControllerModelProtocol.swift; sourceTree = "<group>"; };
|
D236E5B6242007C500C38625 /* MVMControllerModelProtocol.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MVMControllerModelProtocol.swift; sourceTree = "<group>"; };
|
||||||
D243859823A16B1800332775 /* Container.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Container.swift; sourceTree = "<group>"; };
|
D243859823A16B1800332775 /* Container.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Container.swift; sourceTree = "<group>"; };
|
||||||
|
D253BB9B245874F8002DE544 /* BGImageMolecule.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BGImageMolecule.swift; sourceTree = "<group>"; };
|
||||||
|
D253BB9D2458751F002DE544 /* BGImageMoleculeModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BGImageMoleculeModel.swift; sourceTree = "<group>"; };
|
||||||
D256E9922412880000360572 /* Header.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Header.swift; sourceTree = "<group>"; };
|
D256E9922412880000360572 /* Header.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Header.swift; sourceTree = "<group>"; };
|
||||||
D260105223CEA61600764D80 /* ToggleModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ToggleModel.swift; sourceTree = "<group>"; };
|
D260105223CEA61600764D80 /* ToggleModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ToggleModel.swift; sourceTree = "<group>"; };
|
||||||
D260105823D0A92900764D80 /* ContainerProtocol.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContainerProtocol.swift; sourceTree = "<group>"; };
|
D260105823D0A92900764D80 /* ContainerProtocol.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContainerProtocol.swift; sourceTree = "<group>"; };
|
||||||
@ -1019,10 +1023,10 @@
|
|||||||
isa = PBXGroup;
|
isa = PBXGroup;
|
||||||
children = (
|
children = (
|
||||||
9432A79E23DB47BA00719041 /* EntryFieldContainer.swift */,
|
9432A79E23DB47BA00719041 /* EntryFieldContainer.swift */,
|
||||||
D29E28DE23D740FC00ACEA85 /* Container */,
|
D260105823D0A92900764D80 /* ContainerProtocol.swift */,
|
||||||
D2D90B432404789000DD6EC9 /* MoleculeContainerProtocol.swift */,
|
D29E28DC23D7404C00ACEA85 /* ContainerHelper.swift */,
|
||||||
014AA72123C501E2006F3E93 /* MoleculeContainerModel.swift */,
|
014AA72223C501E2006F3E93 /* ContainerModel.swift */,
|
||||||
D2FB151A23A2B65B00C20E10 /* MoleculeContainer.swift */,
|
D243859823A16B1800332775 /* Container.swift */,
|
||||||
);
|
);
|
||||||
path = Views;
|
path = Views;
|
||||||
sourceTree = "<group>";
|
sourceTree = "<group>";
|
||||||
@ -1486,6 +1490,22 @@
|
|||||||
path = TwoColumn;
|
path = TwoColumn;
|
||||||
sourceTree = "<group>";
|
sourceTree = "<group>";
|
||||||
};
|
};
|
||||||
|
D253BB9A24587023002DE544 /* OtherContainers */ = {
|
||||||
|
isa = PBXGroup;
|
||||||
|
children = (
|
||||||
|
D2D90B432404789000DD6EC9 /* MoleculeContainerProtocol.swift */,
|
||||||
|
014AA72123C501E2006F3E93 /* MoleculeContainerModel.swift */,
|
||||||
|
D2FB151A23A2B65B00C20E10 /* MoleculeContainer.swift */,
|
||||||
|
D28A838423CCCA8900DFE4FC /* ScrollerModel.swift */,
|
||||||
|
D2D6CD3F22E78C1A00D701B8 /* Scroller.swift */,
|
||||||
|
012A88C5238DA34000FE3DA1 /* ModuleMoleculeModel.swift */,
|
||||||
|
D29B770F22C281F400D6ACE0 /* ModuleMolecule.swift */,
|
||||||
|
D253BB9D2458751F002DE544 /* BGImageMoleculeModel.swift */,
|
||||||
|
D253BB9B245874F8002DE544 /* BGImageMolecule.swift */,
|
||||||
|
);
|
||||||
|
path = OtherContainers;
|
||||||
|
sourceTree = "<group>";
|
||||||
|
};
|
||||||
D260105723CF9CC500764D80 /* Doughnut */ = {
|
D260105723CF9CC500764D80 /* Doughnut */ = {
|
||||||
isa = PBXGroup;
|
isa = PBXGroup;
|
||||||
children = (
|
children = (
|
||||||
@ -1609,6 +1629,7 @@
|
|||||||
D29DF10E21E67A77003B2FB9 /* Molecules */ = {
|
D29DF10E21E67A77003B2FB9 /* Molecules */ = {
|
||||||
isa = PBXGroup;
|
isa = PBXGroup;
|
||||||
children = (
|
children = (
|
||||||
|
D253BB9A24587023002DE544 /* OtherContainers */,
|
||||||
D22B38E923F4E07800490EF6 /* DesignedComponents */,
|
D22B38E923F4E07800490EF6 /* DesignedComponents */,
|
||||||
D22479912316A9EF003FCCF9 /* Items */,
|
D22479912316A9EF003FCCF9 /* Items */,
|
||||||
D224798F2316A99F003FCCF9 /* LeftRightViews */,
|
D224798F2316A99F003FCCF9 /* LeftRightViews */,
|
||||||
@ -1620,10 +1641,6 @@
|
|||||||
D2A514662213885800345BFB /* MoleculeHeaderView.swift */,
|
D2A514662213885800345BFB /* MoleculeHeaderView.swift */,
|
||||||
012A88EB238F084D00FE3DA1 /* FooterModel.swift */,
|
012A88EB238F084D00FE3DA1 /* FooterModel.swift */,
|
||||||
D274CA322236A78900B01B62 /* FooterView.swift */,
|
D274CA322236A78900B01B62 /* FooterView.swift */,
|
||||||
012A88C5238DA34000FE3DA1 /* ModuleMoleculeModel.swift */,
|
|
||||||
D29B770F22C281F400D6ACE0 /* ModuleMolecule.swift */,
|
|
||||||
D28A838423CCCA8900DFE4FC /* ScrollerModel.swift */,
|
|
||||||
D2D6CD3F22E78C1A00D701B8 /* Scroller.swift */,
|
|
||||||
D260105723CF9CC500764D80 /* Doughnut */,
|
D260105723CF9CC500764D80 /* Doughnut */,
|
||||||
D20FB164241A5D75004AFC3A /* NavigationItemModelProtocol.swift */,
|
D20FB164241A5D75004AFC3A /* NavigationItemModelProtocol.swift */,
|
||||||
);
|
);
|
||||||
@ -1919,17 +1936,6 @@
|
|||||||
path = StringAndMoleculeStack;
|
path = StringAndMoleculeStack;
|
||||||
sourceTree = "<group>";
|
sourceTree = "<group>";
|
||||||
};
|
};
|
||||||
D29E28DE23D740FC00ACEA85 /* Container */ = {
|
|
||||||
isa = PBXGroup;
|
|
||||||
children = (
|
|
||||||
014AA72223C501E2006F3E93 /* ContainerModel.swift */,
|
|
||||||
D260105823D0A92900764D80 /* ContainerProtocol.swift */,
|
|
||||||
D243859823A16B1800332775 /* Container.swift */,
|
|
||||||
D29E28DC23D7404C00ACEA85 /* ContainerHelper.swift */,
|
|
||||||
);
|
|
||||||
path = Container;
|
|
||||||
sourceTree = "<group>";
|
|
||||||
};
|
|
||||||
D2B18B7D236090D500A9AEDC /* BaseClasses */ = {
|
D2B18B7D236090D500A9AEDC /* BaseClasses */ = {
|
||||||
isa = PBXGroup;
|
isa = PBXGroup;
|
||||||
children = (
|
children = (
|
||||||
@ -2381,6 +2387,7 @@
|
|||||||
AAA74A172410C04600080241 /* HeadersH2NoButtonsBodyText.swift in Sources */,
|
AAA74A172410C04600080241 /* HeadersH2NoButtonsBodyText.swift in Sources */,
|
||||||
522679C223FE886900906CBA /* ListLeftVariableCheckboxAllTextAndLinksModel.swift in Sources */,
|
522679C223FE886900906CBA /* ListLeftVariableCheckboxAllTextAndLinksModel.swift in Sources */,
|
||||||
8D084AD02410BF4800951227 /* ListOneColumnFullWidthTextBodyTextModel.swift in Sources */,
|
8D084AD02410BF4800951227 /* ListOneColumnFullWidthTextBodyTextModel.swift in Sources */,
|
||||||
|
D253BB9E2458751F002DE544 /* BGImageMoleculeModel.swift in Sources */,
|
||||||
0ABD1371237DB0450081388D /* ItemDropdownEntryField.swift in Sources */,
|
0ABD1371237DB0450081388D /* ItemDropdownEntryField.swift in Sources */,
|
||||||
8D24041123E7FB9E009E23BE /* ListLeftVariableIconWithRightCaret.swift in Sources */,
|
8D24041123E7FB9E009E23BE /* ListLeftVariableIconWithRightCaret.swift in Sources */,
|
||||||
BBAA4F03243D8E3B005AAD5F /* RadioBoxes.swift in Sources */,
|
BBAA4F03243D8E3B005AAD5F /* RadioBoxes.swift in Sources */,
|
||||||
@ -2404,6 +2411,7 @@
|
|||||||
D2092355244FA0FD0044AD09 /* ThreeLayerTemplateModelProtocol.swift in Sources */,
|
D2092355244FA0FD0044AD09 /* ThreeLayerTemplateModelProtocol.swift in Sources */,
|
||||||
0AE14F64238315D2005417F8 /* TextField.swift in Sources */,
|
0AE14F64238315D2005417F8 /* TextField.swift in Sources */,
|
||||||
0AB764D124460F6300E7FE72 /* UIDatePicker+Extension.swift in Sources */,
|
0AB764D124460F6300E7FE72 /* UIDatePicker+Extension.swift in Sources */,
|
||||||
|
D253BB9C245874F8002DE544 /* BGImageMolecule.swift in Sources */,
|
||||||
D29DF17B21E69E1F003B2FB9 /* PrimaryButton.m in Sources */,
|
D29DF17B21E69E1F003B2FB9 /* PrimaryButton.m in Sources */,
|
||||||
D2C78CD224228BBD00B69FDE /* ActionOpenPanelModel.swift in Sources */,
|
D2C78CD224228BBD00B69FDE /* ActionOpenPanelModel.swift in Sources */,
|
||||||
AA617AB02453010A00910B8F /* ListDeviceComplexLinkSmall.swift in Sources */,
|
AA617AB02453010A00910B8F /* ListDeviceComplexLinkSmall.swift in Sources */,
|
||||||
|
|||||||
@ -24,7 +24,7 @@ import UIKit
|
|||||||
textField.setContentCompressionResistancePriority(.required, for: .vertical)
|
textField.setContentCompressionResistancePriority(.required, for: .vertical)
|
||||||
textField.setContentCompressionResistancePriority(.required, for: .horizontal)
|
textField.setContentCompressionResistancePriority(.required, for: .horizontal)
|
||||||
textField.textAlignment = .center
|
textField.textAlignment = .center
|
||||||
textField.font = MFStyler.fontForTextField()
|
textField.font = Styler.Font.RegularBodyLarge.getFont()
|
||||||
textField.keyboardType = .numberPad
|
textField.keyboardType = .numberPad
|
||||||
return textField
|
return textField
|
||||||
}()
|
}()
|
||||||
@ -48,11 +48,11 @@ import UIKit
|
|||||||
DispatchQueue.main.async { [weak self] in
|
DispatchQueue.main.async { [weak self] in
|
||||||
guard let self = self else { return }
|
guard let self = self else { return }
|
||||||
|
|
||||||
self.borderStrokeColor = error ? .mfPumpkin() : .mfSilver()
|
self.borderStrokeColor = error ? .mvmOrange : .mvmCoolGray3
|
||||||
|
|
||||||
let barHeight: CGFloat = self.showError ? 4 : 1
|
let barHeight: CGFloat = self.showError ? 4 : 1
|
||||||
self.bottomBar?.frame = CGRect(x: 0, y: self.bounds.height - barHeight, width: self.bounds.width, height: barHeight)
|
self.bottomBar?.frame = CGRect(x: 0, y: self.bounds.height - barHeight, width: self.bounds.width, height: barHeight)
|
||||||
self.bottomBar?.backgroundColor = self.showError ? UIColor.mfPumpkin().cgColor : UIColor.black.cgColor
|
self.bottomBar?.backgroundColor = self.showError ? UIColor.mvmOrange.cgColor : UIColor.mvmBlack.cgColor
|
||||||
|
|
||||||
self.setNeedsDisplay()
|
self.setNeedsDisplay()
|
||||||
self.layoutIfNeeded()
|
self.layoutIfNeeded()
|
||||||
@ -97,29 +97,24 @@ import UIKit
|
|||||||
|
|
||||||
open override func setupView() {
|
open override func setupView() {
|
||||||
super.setupView()
|
super.setupView()
|
||||||
|
|
||||||
guard constraints.isEmpty else { return }
|
|
||||||
|
|
||||||
translatesAutoresizingMaskIntoConstraints = false
|
|
||||||
backgroundColor = .clear
|
|
||||||
|
|
||||||
addSubview(digitField)
|
addSubview(digitField)
|
||||||
digitField.delegate = self
|
digitField.delegate = self
|
||||||
digitField.didDeleteDelegate = self
|
digitField.didDeleteDelegate = self
|
||||||
|
|
||||||
NSLayoutConstraint.activate([
|
|
||||||
digitField.topAnchor.constraint(equalTo: topAnchor, constant: PaddingOne),
|
|
||||||
digitField.leadingAnchor.constraint(equalTo: leadingAnchor, constant: PaddingOne),
|
|
||||||
bottomAnchor.constraint(equalTo: digitField.bottomAnchor, constant: PaddingOne),
|
|
||||||
trailingAnchor.constraint(equalTo: digitField.trailingAnchor, constant: PaddingOne),
|
|
||||||
digitField.centerYAnchor.constraint(equalTo: centerYAnchor),
|
|
||||||
digitField.centerXAnchor.constraint(equalTo: centerXAnchor)])
|
|
||||||
|
|
||||||
widthConstraint = widthAnchor.constraint(equalToConstant: DigitBox.size.width)
|
widthConstraint = widthAnchor.constraint(equalToConstant: DigitBox.size.width)
|
||||||
widthConstraint?.isActive = true
|
widthConstraint?.isActive = true
|
||||||
heightConstraint = heightAnchor.constraint(equalToConstant: DigitBox.size.height)
|
heightConstraint = heightAnchor.constraint(equalToConstant: DigitBox.size.height)
|
||||||
heightConstraint?.isActive = true
|
heightConstraint?.isActive = true
|
||||||
|
|
||||||
|
NSLayoutConstraint.activate([
|
||||||
|
digitField.topAnchor.constraint(equalTo: topAnchor, constant: Padding.Three),
|
||||||
|
digitField.leadingAnchor.constraint(equalTo: leadingAnchor),
|
||||||
|
bottomAnchor.constraint(equalTo: digitField.bottomAnchor, constant: Padding.Three),
|
||||||
|
trailingAnchor.constraint(equalTo: digitField.trailingAnchor),
|
||||||
|
digitField.centerYAnchor.constraint(equalTo: centerYAnchor)
|
||||||
|
])
|
||||||
|
|
||||||
if let bottomBar = bottomBar {
|
if let bottomBar = bottomBar {
|
||||||
layer.addSublayer(bottomBar)
|
layer.addSublayer(bottomBar)
|
||||||
}
|
}
|
||||||
@ -146,7 +141,7 @@ import UIKit
|
|||||||
super.reset()
|
super.reset()
|
||||||
|
|
||||||
backgroundColor = .clear
|
backgroundColor = .clear
|
||||||
digitField.font = MFStyler.fontForTextField()
|
digitField.font = Styler.Font.RegularBodyLarge.getFont()
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
@ -186,7 +181,7 @@ import UIKit
|
|||||||
sizeObject?.performBlockBase(onSize: size)
|
sizeObject?.performBlockBase(onSize: size)
|
||||||
widthConstraint?.constant = width
|
widthConstraint?.constant = width
|
||||||
heightConstraint?.constant = height
|
heightConstraint?.constant = height
|
||||||
digitField.font = MFFonts.mfFont55Rg(pointSize)
|
digitField.font = MFFonts.mfFontDSRegular(pointSize)
|
||||||
previousSize = size
|
previousSize = size
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -35,6 +35,7 @@ import UIKit
|
|||||||
digitBoxes.append(newDigitBox)
|
digitBoxes.append(newDigitBox)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
self.digitBoxes.forEach { $0.removeFromSuperview() }
|
||||||
self.digitBoxes = digitBoxes
|
self.digitBoxes = digitBoxes
|
||||||
guard let space = MFSizeObject(standardSize: 5, smalliPhoneSize: 3)?.getValueBasedOnScreenSize() else { return }
|
guard let space = MFSizeObject(standardSize: 5, smalliPhoneSize: 3)?.getValueBasedOnScreenSize() else { return }
|
||||||
|
|
||||||
@ -76,6 +77,10 @@ import UIKit
|
|||||||
public var digitBoxes: [DigitBox] = []
|
public var digitBoxes: [DigitBox] = []
|
||||||
private var selectedDigitBox: DigitBox?
|
private var selectedDigitBox: DigitBox?
|
||||||
|
|
||||||
|
public var digitEntryModel: DigitEntryFieldModel? {
|
||||||
|
return model as? DigitEntryFieldModel
|
||||||
|
}
|
||||||
|
|
||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
// MARK: - Computed Properties
|
// MARK: - Computed Properties
|
||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
@ -224,14 +229,24 @@ import UIKit
|
|||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
|
|
||||||
@objc open override func updateView(_ size: CGFloat) {
|
@objc open override func updateView(_ size: CGFloat) {
|
||||||
super.updateView(size)
|
|
||||||
|
|
||||||
entryFieldContainer.disableAllBorders = true
|
entryFieldContainer.disableAllBorders = true
|
||||||
|
|
||||||
if !self.digitBoxes.isEmpty {
|
if !self.digitBoxes.isEmpty {
|
||||||
self.digitBoxes.forEach { $0.updateView(size) }
|
self.digitBoxes.forEach { $0.updateView(size) }
|
||||||
}
|
}
|
||||||
layoutIfNeeded()
|
|
||||||
|
super.updateView(size)
|
||||||
|
}
|
||||||
|
|
||||||
|
public override func reset() {
|
||||||
|
super.reset()
|
||||||
|
|
||||||
|
accessibilityElements = nil
|
||||||
|
switchFieldsAutomatically = false
|
||||||
|
selectedDigitBox = nil
|
||||||
|
text = ""
|
||||||
|
digitBoxes.forEach { $0.digitField.text = "" }
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
@ -326,7 +341,7 @@ import UIKit
|
|||||||
}
|
}
|
||||||
|
|
||||||
public override func set(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable: Any]?) {
|
public override func set(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable: Any]?) {
|
||||||
|
|
||||||
guard let model = model as? DigitEntryFieldModel else { return }
|
guard let model = model as? DigitEntryFieldModel else { return }
|
||||||
|
|
||||||
numberOfDigits = model.digits
|
numberOfDigits = model.digits
|
||||||
@ -341,7 +356,7 @@ import UIKit
|
|||||||
$0.digitField.inputAccessoryView = UIToolbar.getToolbarWithDoneButton(delegate: observingDelegate,
|
$0.digitField.inputAccessoryView = UIToolbar.getToolbarWithDoneButton(delegate: observingDelegate,
|
||||||
action: #selector(observingDelegate.dismissFieldInput))
|
action: #selector(observingDelegate.dismissFieldInput))
|
||||||
}
|
}
|
||||||
|
|
||||||
super.set(with: model, delegateObject, additionalData)
|
super.set(with: model, delegateObject, additionalData)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -378,12 +393,14 @@ extension DigitEntryField {
|
|||||||
|
|
||||||
// One character, switch old value with new, select next textfield
|
// One character, switch old value with new, select next textfield
|
||||||
textField.text = string
|
textField.text = string
|
||||||
|
digitEntryModel?.text = text
|
||||||
selectNextDigitField(textField, clear: false)
|
selectNextDigitField(textField, clear: false)
|
||||||
return false
|
return false
|
||||||
|
|
||||||
} else if replacementLength == 0 && oldLength == 1 {
|
} else if replacementLength == 0 && oldLength == 1 {
|
||||||
// Non empty cell, clear and stay.
|
// Non empty cell, clear and stay.
|
||||||
textField.text = ""
|
textField.text = ""
|
||||||
|
digitEntryModel?.text = text
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -410,6 +427,7 @@ extension DigitEntryField {
|
|||||||
|
|
||||||
if !switchFieldsAutomatically {
|
if !switchFieldsAutomatically {
|
||||||
textField.text = ""
|
textField.text = ""
|
||||||
|
digitEntryModel?.text = text
|
||||||
}
|
}
|
||||||
|
|
||||||
proprietorTextDelegate?.textFieldDidBeginEditing?(textField)
|
proprietorTextDelegate?.textFieldDidBeginEditing?(textField)
|
||||||
|
|||||||
@ -60,6 +60,7 @@ import UIKit
|
|||||||
self.titleLabel.textColor = enabled ? .mvmBlack : .mvmCoolGray3
|
self.titleLabel.textColor = enabled ? .mvmBlack : .mvmCoolGray3
|
||||||
self.feedbackLabel.textColor = enabled ? .mvmBlack : .mvmCoolGray3
|
self.feedbackLabel.textColor = enabled ? .mvmBlack : .mvmCoolGray3
|
||||||
self.entryFieldContainer.isEnabled = enabled
|
self.entryFieldContainer.isEnabled = enabled
|
||||||
|
self.entryFieldModel?.enabled = enabled
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -69,6 +70,7 @@ import UIKit
|
|||||||
set (error) {
|
set (error) {
|
||||||
self.feedback = error ? entryFieldModel?.errorMessage : entryFieldModel?.feedback
|
self.feedback = error ? entryFieldModel?.errorMessage : entryFieldModel?.feedback
|
||||||
self.entryFieldContainer.showError = error
|
self.entryFieldContainer.showError = error
|
||||||
|
self.entryFieldModel?.showError = error
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -77,6 +79,7 @@ import UIKit
|
|||||||
get { return entryFieldContainer.isLocked }
|
get { return entryFieldContainer.isLocked }
|
||||||
set (locked) {
|
set (locked) {
|
||||||
self.entryFieldContainer.isLocked = locked
|
self.entryFieldContainer.isLocked = locked
|
||||||
|
self.entryFieldModel?.locked = locked
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -85,6 +88,7 @@ import UIKit
|
|||||||
get { return entryFieldContainer.isSelected }
|
get { return entryFieldContainer.isSelected }
|
||||||
set (selected) {
|
set (selected) {
|
||||||
self.entryFieldContainer.isSelected = selected
|
self.entryFieldContainer.isSelected = selected
|
||||||
|
self.entryFieldModel?.selected = selected
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -257,11 +261,13 @@ import UIKit
|
|||||||
if let isLocked = model.locked {
|
if let isLocked = model.locked {
|
||||||
self.isLocked = isLocked
|
self.isLocked = isLocked
|
||||||
|
|
||||||
} else if let isSelected = model.selected {
|
} else if (model.selected ?? false) && !model.wasInitiallySelected {
|
||||||
self.isSelected = isSelected
|
|
||||||
|
model.wasInitiallySelected = true
|
||||||
|
self.isSelected = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
open override class func estimatedHeight(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?) -> CGFloat? {
|
open override class func estimatedHeight(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?) -> CGFloat? {
|
||||||
return 115
|
return 115
|
||||||
}
|
}
|
||||||
|
|||||||
@ -10,7 +10,6 @@ import Foundation
|
|||||||
|
|
||||||
|
|
||||||
@objcMembers public class EntryFieldModel: MoleculeModelProtocol, FormFieldProtocol, FormRuleWatcherFieldProtocol, EnableableModelProtocol {
|
@objcMembers public class EntryFieldModel: MoleculeModelProtocol, FormFieldProtocol, FormRuleWatcherFieldProtocol, EnableableModelProtocol {
|
||||||
|
|
||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
// MARK: - Properties
|
// MARK: - Properties
|
||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
@ -24,12 +23,14 @@ import Foundation
|
|||||||
public var feedback: String?
|
public var feedback: String?
|
||||||
public var errorMessage: String?
|
public var errorMessage: String?
|
||||||
public var enabled: Bool = true
|
public var enabled: Bool = true
|
||||||
|
public var showError: Bool?
|
||||||
public var locked: Bool?
|
public var locked: Bool?
|
||||||
public var selected: Bool?
|
public var selected: Bool?
|
||||||
public var text: String?
|
public var text: String?
|
||||||
public var fieldKey: String?
|
public var fieldKey: String?
|
||||||
public var groupName: String = FormValidator.defaultGroupName
|
public var groupName: String = FormValidator.defaultGroupName
|
||||||
public var baseValue: AnyHashable?
|
public var baseValue: AnyHashable?
|
||||||
|
public var wasInitiallySelected: Bool = false
|
||||||
|
|
||||||
public var isValid: Bool? {
|
public var isValid: Bool? {
|
||||||
didSet { updateUI?() }
|
didSet { updateUI?() }
|
||||||
@ -51,6 +52,7 @@ import Foundation
|
|||||||
case errorMessage
|
case errorMessage
|
||||||
case locked
|
case locked
|
||||||
case selected
|
case selected
|
||||||
|
case showError
|
||||||
case text
|
case text
|
||||||
case fieldKey
|
case fieldKey
|
||||||
case groupName
|
case groupName
|
||||||
@ -93,6 +95,7 @@ import Foundation
|
|||||||
text = try typeContainer.decodeIfPresent(String.self, forKey: .text)
|
text = try typeContainer.decodeIfPresent(String.self, forKey: .text)
|
||||||
baseValue = text
|
baseValue = text
|
||||||
fieldKey = try typeContainer.decodeIfPresent(String.self, forKey: .fieldKey)
|
fieldKey = try typeContainer.decodeIfPresent(String.self, forKey: .fieldKey)
|
||||||
|
|
||||||
if let groupName = try typeContainer.decodeIfPresent(String.self, forKey: .groupName) {
|
if let groupName = try typeContainer.decodeIfPresent(String.self, forKey: .groupName) {
|
||||||
self.groupName = groupName
|
self.groupName = groupName
|
||||||
}
|
}
|
||||||
@ -106,6 +109,7 @@ import Foundation
|
|||||||
try container.encodeIfPresent(feedback, forKey: .feedback)
|
try container.encodeIfPresent(feedback, forKey: .feedback)
|
||||||
try container.encodeIfPresent(text, forKey: .text)
|
try container.encodeIfPresent(text, forKey: .text)
|
||||||
try container.encodeIfPresent(locked, forKey: .locked)
|
try container.encodeIfPresent(locked, forKey: .locked)
|
||||||
|
try container.encodeIfPresent(showError, forKey: .showError)
|
||||||
try container.encodeIfPresent(selected, forKey: .selected)
|
try container.encodeIfPresent(selected, forKey: .selected)
|
||||||
try container.encodeIfPresent(errorMessage, forKey: .errorMessage)
|
try container.encodeIfPresent(errorMessage, forKey: .errorMessage)
|
||||||
try container.encode(enabled, forKey: .enabled)
|
try container.encode(enabled, forKey: .enabled)
|
||||||
|
|||||||
@ -339,6 +339,10 @@ import UIKit
|
|||||||
uiTextFieldDelegate = delegateObject?.uiTextFieldDelegate
|
uiTextFieldDelegate = delegateObject?.uiTextFieldDelegate
|
||||||
observingTextFieldDelegate = delegateObject?.observingTextFieldDelegate
|
observingTextFieldDelegate = delegateObject?.observingTextFieldDelegate
|
||||||
setupTextFieldToolbar()
|
setupTextFieldToolbar()
|
||||||
|
|
||||||
|
if isSelected {
|
||||||
|
startEditing()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -126,6 +126,7 @@ import Foundation
|
|||||||
MoleculeObjectMapping.shared()?.register(viewClass: FooterView.self, viewModelClass: FooterModel.self)
|
MoleculeObjectMapping.shared()?.register(viewClass: FooterView.self, viewModelClass: FooterModel.self)
|
||||||
MoleculeObjectMapping.shared()?.register(viewClass: Scroller.self, viewModelClass: ScrollerModel.self)
|
MoleculeObjectMapping.shared()?.register(viewClass: Scroller.self, viewModelClass: ScrollerModel.self)
|
||||||
MoleculeObjectMapping.shared()?.register(viewClass: ModuleMolecule.self, viewModelClass: ModuleMoleculeModel.self)
|
MoleculeObjectMapping.shared()?.register(viewClass: ModuleMolecule.self, viewModelClass: ModuleMoleculeModel.self)
|
||||||
|
MoleculeObjectMapping.shared()?.register(viewClass: BGImageMolecule.self, viewModelClass: BGImageMoleculeModel.self)
|
||||||
|
|
||||||
// Other Molecules
|
// Other Molecules
|
||||||
MoleculeObjectMapping.shared()?.register(viewClass: DoughnutChartView.self, viewModelClass: DoughnutChartModel.self)
|
MoleculeObjectMapping.shared()?.register(viewClass: DoughnutChartView.self, viewModelClass: DoughnutChartModel.self)
|
||||||
|
|||||||
@ -45,8 +45,11 @@ import Foundation
|
|||||||
if useVerticalMargins == nil {
|
if useVerticalMargins == nil {
|
||||||
useVerticalMargins = true
|
useVerticalMargins = true
|
||||||
}
|
}
|
||||||
if style == nil {
|
if topPadding == nil {
|
||||||
style = "standard"
|
topPadding = 24
|
||||||
|
}
|
||||||
|
if bottomPadding == nil {
|
||||||
|
bottomPadding = 24
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -0,0 +1,25 @@
|
|||||||
|
//
|
||||||
|
// BGImageMolecule.swift
|
||||||
|
// MVMCoreUI
|
||||||
|
//
|
||||||
|
// Created by Scott Pfeil on 4/28/20.
|
||||||
|
// Copyright © 2020 Verizon Wireless. All rights reserved.
|
||||||
|
//
|
||||||
|
|
||||||
|
import Foundation
|
||||||
|
|
||||||
|
open class BGImageMolecule: MoleculeContainer {
|
||||||
|
|
||||||
|
let image = MFLoadImageView(pinnedEdges: .all)
|
||||||
|
|
||||||
|
open override func setupView() {
|
||||||
|
super.setupView()
|
||||||
|
insertSubview(image, at: 0)
|
||||||
|
NSLayoutConstraint.constraintPinSubview(toSuperview: image)
|
||||||
|
}
|
||||||
|
|
||||||
|
open override func set(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable: Any]?) {
|
||||||
|
image.setOptional(with: (model as? BGImageMoleculeModel)?.image, delegateObject, additionalData)
|
||||||
|
super.set(with: model, delegateObject, additionalData)
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,52 @@
|
|||||||
|
//
|
||||||
|
// BGImageMoleculeModel.swift
|
||||||
|
// MVMCoreUI
|
||||||
|
//
|
||||||
|
// Created by Scott Pfeil on 4/28/20.
|
||||||
|
// Copyright © 2020 Verizon Wireless. All rights reserved.
|
||||||
|
//
|
||||||
|
|
||||||
|
import Foundation
|
||||||
|
|
||||||
|
open class BGImageMoleculeModel: MoleculeContainerModel {
|
||||||
|
public override class var identifier: String {
|
||||||
|
return "bgImageContainer"
|
||||||
|
}
|
||||||
|
public var image: ImageViewModel
|
||||||
|
|
||||||
|
open override func setDefaults() {
|
||||||
|
if useHorizontalMargins == nil {
|
||||||
|
useHorizontalMargins = true
|
||||||
|
}
|
||||||
|
if useVerticalMargins == nil {
|
||||||
|
useVerticalMargins = true
|
||||||
|
}
|
||||||
|
if topPadding == nil {
|
||||||
|
topPadding = PaddingDefaultVerticalSpacing3
|
||||||
|
}
|
||||||
|
if bottomPadding == nil {
|
||||||
|
bottomPadding = PaddingDefaultVerticalSpacing3
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private enum CodingKeys: String, CodingKey {
|
||||||
|
case image
|
||||||
|
}
|
||||||
|
|
||||||
|
public init(_ image: ImageViewModel, molecule: MoleculeModelProtocol) {
|
||||||
|
self.image = image
|
||||||
|
super.init(with: molecule)
|
||||||
|
}
|
||||||
|
|
||||||
|
required public init(from decoder: Decoder) throws {
|
||||||
|
let typeContainer = try decoder.container(keyedBy: CodingKeys.self)
|
||||||
|
image = try typeContainer.decode(ImageViewModel.self, forKey:.image)
|
||||||
|
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(image, forKey: .image)
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -8,7 +8,7 @@
|
|||||||
|
|
||||||
import Foundation
|
import Foundation
|
||||||
|
|
||||||
public class MoleculeContainerModel: ContainerModel, MoleculeContainerModelProtocol, MoleculeModelProtocol {
|
open class MoleculeContainerModel: ContainerModel, MoleculeContainerModelProtocol, MoleculeModelProtocol {
|
||||||
public class var identifier: String {
|
public class var identifier: String {
|
||||||
return "container"
|
return "container"
|
||||||
}
|
}
|
||||||
@ -148,6 +148,7 @@ import UIKit
|
|||||||
preservesSuperviewLayoutMargins = false
|
preservesSuperviewLayoutMargins = false
|
||||||
contentView.insetsLayoutMarginsFromSafeArea = false
|
contentView.insetsLayoutMarginsFromSafeArea = false
|
||||||
contentView.preservesSuperviewLayoutMargins = false
|
contentView.preservesSuperviewLayoutMargins = false
|
||||||
|
styleStandard()
|
||||||
}
|
}
|
||||||
|
|
||||||
//TODO: ModelProtocol, Change to model
|
//TODO: ModelProtocol, Change to model
|
||||||
@ -183,6 +184,7 @@ import UIKit
|
|||||||
|
|
||||||
open func reset() {
|
open func reset() {
|
||||||
molecule?.reset()
|
molecule?.reset()
|
||||||
|
styleStandard()
|
||||||
backgroundColor = .white
|
backgroundColor = .white
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user