Merge branch 'develop' of https://gitlab.verizon.com/BPHV_MIPS/vds_ios_sample into vasavk/calendar
This commit is contained in:
commit
cc7b5bb093
@ -696,7 +696,7 @@
|
|||||||
CODE_SIGN_IDENTITY = "Apple Development";
|
CODE_SIGN_IDENTITY = "Apple Development";
|
||||||
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
|
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
|
||||||
CODE_SIGN_STYLE = Manual;
|
CODE_SIGN_STYLE = Manual;
|
||||||
CURRENT_PROJECT_VERSION = 61;
|
CURRENT_PROJECT_VERSION = 62;
|
||||||
DEVELOPMENT_TEAM = "";
|
DEVELOPMENT_TEAM = "";
|
||||||
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = FCMA4QKS77;
|
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = FCMA4QKS77;
|
||||||
GENERATE_INFOPLIST_FILE = YES;
|
GENERATE_INFOPLIST_FILE = YES;
|
||||||
@ -731,7 +731,7 @@
|
|||||||
CODE_SIGN_IDENTITY = "Apple Development";
|
CODE_SIGN_IDENTITY = "Apple Development";
|
||||||
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
|
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
|
||||||
CODE_SIGN_STYLE = Manual;
|
CODE_SIGN_STYLE = Manual;
|
||||||
CURRENT_PROJECT_VERSION = 61;
|
CURRENT_PROJECT_VERSION = 62;
|
||||||
DEVELOPMENT_TEAM = "";
|
DEVELOPMENT_TEAM = "";
|
||||||
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = FCMA4QKS77;
|
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = FCMA4QKS77;
|
||||||
GENERATE_INFOPLIST_FILE = YES;
|
GENERATE_INFOPLIST_FILE = YES;
|
||||||
|
|||||||
@ -10,6 +10,12 @@ import VDS
|
|||||||
|
|
||||||
class DropdownSelectViewController: BaseViewController<DropdownSelect> {
|
class DropdownSelectViewController: BaseViewController<DropdownSelect> {
|
||||||
|
|
||||||
|
lazy var helperTextPlacementPickerSelectorView = {
|
||||||
|
PickerSelectorView(title: "",
|
||||||
|
picker: self.picker,
|
||||||
|
items: InputField.HelperTextPlacement.allCases)
|
||||||
|
}()
|
||||||
|
|
||||||
var disabledSwitch = Toggle()
|
var disabledSwitch = Toggle()
|
||||||
var requiredSwitch = Toggle()
|
var requiredSwitch = Toggle()
|
||||||
var labelTextField = TextField()
|
var labelTextField = TextField()
|
||||||
@ -21,6 +27,7 @@ class DropdownSelectViewController: BaseViewController<DropdownSelect> {
|
|||||||
var errorSwitch = Toggle()
|
var errorSwitch = Toggle()
|
||||||
var tooltipTitleTextField = TextField()
|
var tooltipTitleTextField = TextField()
|
||||||
var tooltipContentTextField = TextField()
|
var tooltipContentTextField = TextField()
|
||||||
|
var widthTextField = NumericField()
|
||||||
var optionsSwitch = Toggle()
|
var optionsSwitch = Toggle()
|
||||||
var moreOptions: [DropdownSelect.DropdownOptionModel] = [
|
var moreOptions: [DropdownSelect.DropdownOptionModel] = [
|
||||||
.init(text: "Alabama"),
|
.init(text: "Alabama"),
|
||||||
@ -60,12 +67,14 @@ class DropdownSelectViewController: BaseViewController<DropdownSelect> {
|
|||||||
addFormRow(label: "Disabled", view: disabledSwitch)
|
addFormRow(label: "Disabled", view: disabledSwitch)
|
||||||
addFormRow(label: "Required", view: requiredSwitch)
|
addFormRow(label: "Required", view: requiredSwitch)
|
||||||
addFormRow(label: "Label Text", view: labelTextField)
|
addFormRow(label: "Label Text", view: labelTextField)
|
||||||
|
addFormRow(label: "Helper Text Placement", view: helperTextPlacementPickerSelectorView)
|
||||||
addFormRow(label: "Helper Text", view: helperTextField)
|
addFormRow(label: "Helper Text", view: helperTextField)
|
||||||
addFormRow(label: "Inline Label", view: .makeWrapper(for: inlineLabelSwitch))
|
addFormRow(label: "Inline Label", view: .makeWrapper(for: inlineLabelSwitch))
|
||||||
addFormRow(label: "Readonly", view: readonlySwitch)
|
addFormRow(label: "Readonly", view: readonlySwitch)
|
||||||
addFormRow(label: "Transparent Background", view: transparentBgSwitch)
|
addFormRow(label: "Transparent Background", view: transparentBgSwitch)
|
||||||
addFormRow(label: "Error", view: .makeWrapper(for: errorSwitch))
|
addFormRow(label: "Error", view: .makeWrapper(for: errorSwitch))
|
||||||
addFormRow(label: "Error Text", view: errorTextField)
|
addFormRow(label: "Error Text", view: errorTextField)
|
||||||
|
addFormRow(label: "Width", view: widthTextField)
|
||||||
addFormRow(label: "ToolTip Title", view: tooltipTitleTextField)
|
addFormRow(label: "ToolTip Title", view: tooltipTitleTextField)
|
||||||
addFormRow(label: "ToolTip Content", view: tooltipContentTextField)
|
addFormRow(label: "ToolTip Content", view: tooltipContentTextField)
|
||||||
addFormRow(label: "More Options", view: optionsSwitch)
|
addFormRow(label: "More Options", view: optionsSwitch)
|
||||||
@ -119,6 +128,12 @@ class DropdownSelectViewController: BaseViewController<DropdownSelect> {
|
|||||||
self?.component.errorText = text
|
self?.component.errorText = text
|
||||||
}.store(in: &subscribers)
|
}.store(in: &subscribers)
|
||||||
|
|
||||||
|
widthTextField
|
||||||
|
.numberPublisher
|
||||||
|
.sink { [weak self] number in
|
||||||
|
self?.component.width = number?.cgFloatValue
|
||||||
|
}.store(in: &subscribers)
|
||||||
|
|
||||||
tooltipTitleTextField
|
tooltipTitleTextField
|
||||||
.textPublisher
|
.textPublisher
|
||||||
.sink { [weak self] text in
|
.sink { [weak self] text in
|
||||||
@ -161,6 +176,7 @@ class DropdownSelectViewController: BaseViewController<DropdownSelect> {
|
|||||||
requiredSwitch.isOn = component.isRequired
|
requiredSwitch.isOn = component.isRequired
|
||||||
surfacePickerSelectorView.text = component.surface.rawValue
|
surfacePickerSelectorView.text = component.surface.rawValue
|
||||||
labelTextField.text = component.labelText
|
labelTextField.text = component.labelText
|
||||||
|
helperTextPlacementPickerSelectorView.text = component.helperTextPlacement.rawValue
|
||||||
helperTextField.text = component.helperText
|
helperTextField.text = component.helperText
|
||||||
readonlySwitch.isOn = false
|
readonlySwitch.isOn = false
|
||||||
transparentBgSwitch.isOn = false
|
transparentBgSwitch.isOn = false
|
||||||
@ -176,6 +192,11 @@ class DropdownSelectViewController: BaseViewController<DropdownSelect> {
|
|||||||
self?.component.surface = item
|
self?.component.surface = item
|
||||||
self?.contentTopView.backgroundColor = item.color
|
self?.contentTopView.backgroundColor = item.color
|
||||||
}
|
}
|
||||||
|
|
||||||
|
helperTextPlacementPickerSelectorView.onPickerDidSelect = { [weak self] item in
|
||||||
|
self?.component.helperTextPlacement = item
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func updateTooltip() {
|
func updateTooltip() {
|
||||||
|
|||||||
@ -62,6 +62,27 @@ class InputFieldViewController: BaseViewController<InputField> {
|
|||||||
$0.isHidden = true
|
$0.isHidden = true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//inlineAction
|
||||||
|
var inlineActionTextField = TextField()
|
||||||
|
lazy var inlineActionSection = FormSection().with {
|
||||||
|
$0.title = "inlineAction Settings"
|
||||||
|
$0.addFormRow(label: "Action Text", view: inlineActionTextField)
|
||||||
|
$0.isHidden = true
|
||||||
|
}
|
||||||
|
|
||||||
|
//securityCode
|
||||||
|
lazy var cardTypePickerSelectorView = {
|
||||||
|
PickerSelectorView(title: "",
|
||||||
|
picker: self.picker,
|
||||||
|
items: InputField.CreditCardType.allCases)
|
||||||
|
}()
|
||||||
|
|
||||||
|
lazy var securityCodeSection = FormSection().with {
|
||||||
|
$0.title = "Security Code Settings"
|
||||||
|
$0.addFormRow(label: "Card Type", view: cardTypePickerSelectorView)
|
||||||
|
$0.isHidden = true
|
||||||
|
}
|
||||||
|
|
||||||
override func viewDidLoad() {
|
override func viewDidLoad() {
|
||||||
super.viewDidLoad()
|
super.viewDidLoad()
|
||||||
addContentTopView(view: component)
|
addContentTopView(view: component)
|
||||||
@ -71,23 +92,37 @@ class InputFieldViewController: BaseViewController<InputField> {
|
|||||||
|
|
||||||
override func setupForm(){
|
override func setupForm(){
|
||||||
super.setupForm()
|
super.setupForm()
|
||||||
addFormRow(label: "Disabled", view: disabledSwitch)
|
|
||||||
addFormRow(label: "Required", view: requiredSwitch)
|
|
||||||
addFormRow(label: "Surface", view: surfacePickerSelectorView)
|
|
||||||
addFormRow(label: "Label Text", view: labelTextField)
|
|
||||||
addFormRow(label: "Helper Text Placement", view: helperTextPlacementPickerSelectorView)
|
|
||||||
addFormRow(label: "Helper Text", view: helperTextField)
|
|
||||||
addFormRow(label: "Error", view: showErrorSwitch)
|
|
||||||
addFormRow(label: "Error Text", view: errorTextField)
|
|
||||||
addFormRow(label: "Success", view: showSuccessSwitch)
|
|
||||||
addFormRow(label: "Success Text", view: successTextField)
|
|
||||||
addFormRow(label: "Width", view: widthTextField)
|
|
||||||
addFormRow(label: "ToolTip Title", view: tooltipTitleTextField)
|
|
||||||
addFormRow(label: "ToolTip Content", view: tooltipContentTextField)
|
|
||||||
addFormRow(label: "Field Type", view: inputTypePickerSelectorView)
|
|
||||||
|
|
||||||
|
|
||||||
|
let fieldType = FormSection().with {
|
||||||
|
$0.title = "Field Type Settings"
|
||||||
|
$0.addFormRow(label: "Field Type", view: inputTypePickerSelectorView)
|
||||||
|
}
|
||||||
|
|
||||||
|
let general = FormSection().with {
|
||||||
|
$0.title = "\n\nGeneral Settings"
|
||||||
|
}
|
||||||
|
|
||||||
|
general.addFormRow(label: "Disabled", view: disabledSwitch)
|
||||||
|
general.addFormRow(label: "Required", view: requiredSwitch)
|
||||||
|
general.addFormRow(label: "Surface", view: surfacePickerSelectorView)
|
||||||
|
general.addFormRow(label: "Label Text", view: labelTextField)
|
||||||
|
general.addFormRow(label: "Helper Text Placement", view: helperTextPlacementPickerSelectorView)
|
||||||
|
general.addFormRow(label: "Helper Text", view: helperTextField)
|
||||||
|
general.addFormRow(label: "Error", view: showErrorSwitch)
|
||||||
|
general.addFormRow(label: "Error Text", view: errorTextField)
|
||||||
|
general.addFormRow(label: "Success", view: showSuccessSwitch)
|
||||||
|
general.addFormRow(label: "Success Text", view: successTextField)
|
||||||
|
general.addFormRow(label: "Width", view: widthTextField)
|
||||||
|
general.addFormRow(label: "ToolTip Title", view: tooltipTitleTextField)
|
||||||
|
general.addFormRow(label: "ToolTip Content", view: tooltipContentTextField)
|
||||||
|
|
||||||
|
append(section: fieldType)
|
||||||
append(section: passwordSection)
|
append(section: passwordSection)
|
||||||
append(section: dateSection)
|
append(section: dateSection)
|
||||||
|
append(section: inlineActionSection)
|
||||||
|
append(section: securityCodeSection)
|
||||||
|
append(section: general)
|
||||||
|
|
||||||
requiredSwitch.onChange = { [weak self] sender in
|
requiredSwitch.onChange = { [weak self] sender in
|
||||||
self?.component.isRequired = sender.isOn
|
self?.component.isRequired = sender.isOn
|
||||||
@ -162,16 +197,29 @@ class InputFieldViewController: BaseViewController<InputField> {
|
|||||||
.sink { [weak self] text in
|
.sink { [weak self] text in
|
||||||
self?.component.showPasswordButtonText = text
|
self?.component.showPasswordButtonText = text
|
||||||
}.store(in: &subscribers)
|
}.store(in: &subscribers)
|
||||||
|
|
||||||
|
//inlineAction
|
||||||
|
inlineActionTextField
|
||||||
|
.textPublisher
|
||||||
|
.sink { [weak self] text in
|
||||||
|
if !text.isEmpty {
|
||||||
|
self?.component.actionTextLinkModel = .init(text: text, onClick: { inputField in
|
||||||
|
var value = inputField.value ?? ""
|
||||||
|
value = !value.isEmpty ? value : "nil"
|
||||||
|
self?.present(UIAlertController(title: "inlineAction", message: "Clicked and you get the value: \(value)", preferredStyle: .alert).with{ $0.addAction(.init(title: "OK", style: .default)) }, animated: true)
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
self?.component.actionTextLinkModel = nil
|
||||||
|
}
|
||||||
|
}.store(in: &subscribers)
|
||||||
}
|
}
|
||||||
|
|
||||||
func setupModel() {
|
func setupModel() {
|
||||||
component.fieldType = .text
|
component.fieldType = .text
|
||||||
component.width = 328
|
|
||||||
component.labelText = "Street Address"
|
component.labelText = "Street Address"
|
||||||
component.helperText = "For example: 123 Verizon St"
|
component.helperText = "For example: 123 Verizon St"
|
||||||
component.errorText = "Enter a valid address."
|
component.errorText = "Enter a valid address."
|
||||||
component.successText = "Good job entering a valid address!"
|
component.successText = "Good job entering a valid address!"
|
||||||
component.tooltipModel = .init(title: "Check the formatting of your address", content:"House/Building number then street name")
|
|
||||||
|
|
||||||
component.onChange = { component in
|
component.onChange = { component in
|
||||||
if let text = component.value {
|
if let text = component.value {
|
||||||
@ -184,6 +232,7 @@ class InputFieldViewController: BaseViewController<InputField> {
|
|||||||
//setup UI
|
//setup UI
|
||||||
surfacePickerSelectorView.text = component.surface.rawValue
|
surfacePickerSelectorView.text = component.surface.rawValue
|
||||||
helperTextPlacementPickerSelectorView.text = component.helperTextPlacement.rawValue
|
helperTextPlacementPickerSelectorView.text = component.helperTextPlacement.rawValue
|
||||||
|
dateFormatPickerSelectorView.text = component.dateFormat.rawValue
|
||||||
inputTypePickerSelectorView.text = component.fieldType.rawValue
|
inputTypePickerSelectorView.text = component.fieldType.rawValue
|
||||||
disabledSwitch.isOn = !component.isEnabled
|
disabledSwitch.isOn = !component.isEnabled
|
||||||
requiredSwitch.isOn = component.isRequired
|
requiredSwitch.isOn = component.isRequired
|
||||||
@ -213,6 +262,7 @@ class InputFieldViewController: BaseViewController<InputField> {
|
|||||||
|
|
||||||
inputTypePickerSelectorView.onPickerDidSelect = { [weak self] item in
|
inputTypePickerSelectorView.onPickerDidSelect = { [weak self] item in
|
||||||
self?.component.fieldType = item
|
self?.component.fieldType = item
|
||||||
|
self?.component.text = ""
|
||||||
self?.updateFormSections()
|
self?.updateFormSections()
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -220,6 +270,10 @@ class InputFieldViewController: BaseViewController<InputField> {
|
|||||||
self?.component.dateFormat = item
|
self?.component.dateFormat = item
|
||||||
self?.updateFormSections()
|
self?.updateFormSections()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
cardTypePickerSelectorView.onPickerDidSelect = { [weak self] item in
|
||||||
|
self?.component.cardType = item
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func updateTooltip() {
|
func updateTooltip() {
|
||||||
@ -231,33 +285,30 @@ class InputFieldViewController: BaseViewController<InputField> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func updateFormSections() {
|
func updateFormSections() {
|
||||||
[passwordSection, dateSection].forEach { $0.isHidden = true }
|
[passwordSection, dateSection, inlineActionSection, securityCodeSection].forEach { $0.isHidden = true }
|
||||||
|
//reset other fields
|
||||||
|
component.actionTextLinkModel = nil
|
||||||
|
component.tooltipModel = nil
|
||||||
|
component.cardType = .generic
|
||||||
|
tooltipTitleTextField.text = nil
|
||||||
|
tooltipContentTextField.text = nil
|
||||||
|
dateFormatPickerSelectorView.text = component.dateFormat.rawValue
|
||||||
|
cardTypePickerSelectorView.text = component.cardType.rawValue
|
||||||
switch component.fieldType {
|
switch component.fieldType {
|
||||||
case .text:
|
|
||||||
break
|
|
||||||
|
|
||||||
case .number:
|
|
||||||
break
|
|
||||||
|
|
||||||
case .inlineAction:
|
case .inlineAction:
|
||||||
break
|
inlineActionTextField.text = nil
|
||||||
|
inlineActionSection.isHidden = false
|
||||||
|
|
||||||
case .password:
|
case .password:
|
||||||
passwordSection.isHidden = false
|
passwordSection.isHidden = false
|
||||||
|
|
||||||
case .creditCard:
|
|
||||||
break
|
|
||||||
|
|
||||||
case .tel:
|
|
||||||
break
|
|
||||||
|
|
||||||
case .date:
|
case .date:
|
||||||
dateSection.isHidden = false
|
dateSection.isHidden = false
|
||||||
|
|
||||||
case .securityCode:
|
case .securityCode:
|
||||||
break
|
securityCodeSection.isHidden = false
|
||||||
|
|
||||||
@unknown default:
|
default:
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -81,7 +81,7 @@ class MenuViewController: UITableViewController, TooltipLaunchable {
|
|||||||
MenuComponent(title: "CheckboxGroup", completed: true, viewController: CheckboxGroupViewController.self),
|
MenuComponent(title: "CheckboxGroup", completed: true, viewController: CheckboxGroupViewController.self),
|
||||||
MenuComponent(title: "DropdownSelect", completed: true, viewController: DropdownSelectViewController.self),
|
MenuComponent(title: "DropdownSelect", completed: true, viewController: DropdownSelectViewController.self),
|
||||||
MenuComponent(title: "Icon", completed: true, viewController: IconViewController.self),
|
MenuComponent(title: "Icon", completed: true, viewController: IconViewController.self),
|
||||||
MenuComponent(title: "InputField", completed: false, viewController: InputFieldViewController.self),
|
MenuComponent(title: "InputField", completed: true, viewController: InputFieldViewController.self),
|
||||||
MenuComponent(title: "Label", completed: true, viewController: LabelViewController.self),
|
MenuComponent(title: "Label", completed: true, viewController: LabelViewController.self),
|
||||||
MenuComponent(title: "Line", completed: true, viewController: LineViewController.self),
|
MenuComponent(title: "Line", completed: true, viewController: LineViewController.self),
|
||||||
MenuComponent(title: "Loader", completed: true, viewController: LoaderViewController.self),
|
MenuComponent(title: "Loader", completed: true, viewController: LoaderViewController.self),
|
||||||
|
|||||||
@ -126,7 +126,6 @@ class TextAreaViewController: BaseViewController<TextArea> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func setupModel() {
|
func setupModel() {
|
||||||
component.width = 328
|
|
||||||
component.labelText = "Street Address"
|
component.labelText = "Street Address"
|
||||||
component.helperText = "For example: 123 Verizon St"
|
component.helperText = "For example: 123 Verizon St"
|
||||||
component.errorText = "Enter a valid address."
|
component.errorText = "Enter a valid address."
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user