bhl-forms 0.7.3 → 0.7.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (101) hide show
  1. package/dist/bhl-forms.es.js +551 -543
  2. package/dist/bhl-forms.iife.js +4 -4
  3. package/dist/bhl-forms.modern.es.js +649 -649
  4. package/dist/bhl-forms.modern.iife.js +7 -7
  5. package/dist/bhl-forms.modern.umd.js +7 -7
  6. package/dist/bhl-forms.umd.js +4 -4
  7. package/dist/forms/accidentsAndInjuries.es.js +1461 -1151
  8. package/dist/forms/accidentsAndInjuries.iife.js +1 -1
  9. package/dist/forms/accidentsAndInjuries.json +1 -1
  10. package/dist/forms/appraisals.es.js +138 -137
  11. package/dist/forms/appraisals.iife.js +1 -1
  12. package/dist/forms/business.es.js +1434 -1149
  13. package/dist/forms/business.iife.js +1 -1
  14. package/dist/forms/business.json +1 -1
  15. package/dist/forms/childAndFamily.es.js +1329 -1043
  16. package/dist/forms/childAndFamily.iife.js +1 -1
  17. package/dist/forms/childAndFamily.json +1 -1
  18. package/dist/forms/childAndFamilySingle.es.js +1528 -1378
  19. package/dist/forms/childAndFamilySingle.iife.js +1 -1
  20. package/dist/forms/childAndFamilySingle.json +1 -1
  21. package/dist/forms/civilLawsuit.es.js +2000 -1807
  22. package/dist/forms/civilLawsuit.iife.js +1 -1
  23. package/dist/forms/civilLawsuit.json +1 -1
  24. package/dist/forms/coins.es.js +138 -137
  25. package/dist/forms/coins.iife.js +1 -1
  26. package/dist/forms/contracts.es.js +1349 -1050
  27. package/dist/forms/contracts.iife.js +1 -1
  28. package/dist/forms/contracts.json +1 -1
  29. package/dist/forms/criminal.es.js +1832 -1711
  30. package/dist/forms/criminal.iife.js +1 -1
  31. package/dist/forms/criminal.json +1 -1
  32. package/dist/forms/divorce.es.js +1541 -1385
  33. package/dist/forms/divorce.iife.js +1 -1
  34. package/dist/forms/divorce.json +1 -1
  35. package/dist/forms/employmentAndWorkplace.es.js +1833 -1678
  36. package/dist/forms/employmentAndWorkplace.iife.js +1 -1
  37. package/dist/forms/employmentAndWorkplace.json +1 -1
  38. package/dist/forms/generalHomeImprovement.es.js +2381 -2010
  39. package/dist/forms/generalHomeImprovement.iife.js +1 -1
  40. package/dist/forms/generalHomeImprovement.json +1 -1
  41. package/dist/forms/generalHomeImprovementThankYou.es.js +1795 -2008
  42. package/dist/forms/generalHomeImprovementThankYou.iife.js +1 -1
  43. package/dist/forms/generalHomeImprovementThankYou.json +1 -1
  44. package/dist/forms/generalLegal.es.js +3037 -2535
  45. package/dist/forms/generalLegal.iife.js +1 -1
  46. package/dist/forms/generalLegal.json +1 -1
  47. package/dist/forms/generalLegalJustAnswer.es.js +3216 -2872
  48. package/dist/forms/generalLegalJustAnswer.iife.js +1 -1
  49. package/dist/forms/generalLegalJustAnswer.json +1 -1
  50. package/dist/forms/generalLegalPopUnder.es.js +3037 -2535
  51. package/dist/forms/generalLegalPopUnder.iife.js +1 -1
  52. package/dist/forms/generalLegalPopUnder.json +1 -1
  53. package/dist/forms/generalLegalPopUnderSingle.es.js +3216 -2872
  54. package/dist/forms/generalLegalPopUnderSingle.iife.js +1 -1
  55. package/dist/forms/generalLegalPopUnderSingle.json +1 -1
  56. package/dist/forms/generalLegalSingle.es.js +3216 -2872
  57. package/dist/forms/generalLegalSingle.iife.js +1 -1
  58. package/dist/forms/generalLegalSingle.json +1 -1
  59. package/dist/forms/generalLegalThankYou.es.js +2825 -2303
  60. package/dist/forms/generalLegalThankYou.iife.js +1 -1
  61. package/dist/forms/generalLegalThankYou.json +1 -1
  62. package/dist/forms/generalLegalThankYouConsultation.es.js +3216 -2872
  63. package/dist/forms/generalLegalThankYouConsultation.iife.js +1 -1
  64. package/dist/forms/generalLegalThankYouConsultation.json +1 -1
  65. package/dist/forms/harassmentAndDiscrimination.es.js +1425 -1120
  66. package/dist/forms/harassmentAndDiscrimination.iife.js +1 -1
  67. package/dist/forms/harassmentAndDiscrimination.json +1 -1
  68. package/dist/forms/landlordTenant.es.js +1395 -1106
  69. package/dist/forms/landlordTenant.iife.js +1 -1
  70. package/dist/forms/landlordTenant.json +1 -1
  71. package/dist/forms/malpractice.es.js +1531 -1223
  72. package/dist/forms/malpractice.iife.js +1 -1
  73. package/dist/forms/malpractice.json +1 -1
  74. package/dist/forms/mechanics.es.js +702 -530
  75. package/dist/forms/mechanics.iife.js +1 -1
  76. package/dist/forms/mechanics.json +1 -1
  77. package/dist/forms/patentsAndIP.es.js +1830 -1652
  78. package/dist/forms/patentsAndIP.iife.js +1 -1
  79. package/dist/forms/patentsAndIP.json +1 -1
  80. package/dist/forms/realEstate.es.js +2852 -2405
  81. package/dist/forms/realEstate.iife.js +1 -1
  82. package/dist/forms/realEstate.json +1 -1
  83. package/dist/forms/repossession.es.js +1568 -1251
  84. package/dist/forms/repossession.iife.js +1 -1
  85. package/dist/forms/repossession.json +1 -1
  86. package/dist/forms/ssdi.es.js +635 -520
  87. package/dist/forms/ssdi.iife.js +1 -1
  88. package/dist/forms/ssdi.json +1 -1
  89. package/dist/forms/testForm.es.js +409 -371
  90. package/dist/forms/testForm.iife.js +1 -1
  91. package/dist/forms/testForm.json +1 -1
  92. package/dist/forms/testRedirects.es.js +421 -316
  93. package/dist/forms/testRedirects.iife.js +1 -1
  94. package/dist/forms/testRedirects.json +1 -1
  95. package/dist/forms/vets.es.js +138 -137
  96. package/dist/forms/vets.iife.js +1 -1
  97. package/dist/forms/willsAndTrusts.es.js +1428 -1112
  98. package/dist/forms/willsAndTrusts.iife.js +1 -1
  99. package/dist/forms/willsAndTrusts.json +1 -1
  100. package/dist/main.css +1 -1
  101. package/package.json +1 -1
@@ -10,32 +10,65 @@ const radio = (updates) => {
10
10
  if (updates.name && !updates.id) {
11
11
  updates.id = updates.name;
12
12
  }
13
- return merge({
14
- $formkit: 'radio',
15
- validation: 'required',
16
- validationMessages: {
17
- required: 'Field is required'
13
+ return merge(
14
+ {
15
+ $formkit: "radio",
16
+ validation: "required",
17
+ validationMessages: {
18
+ required: "Field is required",
19
+ },
20
+ optionsClass: "t-pt-3 t-pl-1",
21
+ legendClass: "required",
18
22
  },
19
- optionsClass: 't-pt-3 t-pl-1',
20
- legendClass: 'required'
21
- }, updates)
23
+ updates
24
+ )
22
25
  };
23
26
 
24
27
  const col2Radio = (updates) => {
25
- updates.legendClass = 'required';
26
- updates.fieldsetClass = '$reset';
27
- updates.optionsClass = 't-pl-2 t-pt-3 t-grid t-grid-cols-1 md:t-grid-cols-2';
28
- updates.innerClass = 't-items-start';
29
- updates.wrapperClass = '$reset t-flex t-cursor-pointer t-mb-3';
28
+ updates.legendClass = "required";
29
+ updates.fieldsetClass = "$reset";
30
+ updates.optionsClass = "t-pl-2 t-pt-3 t-grid t-grid-cols-1 md:t-grid-cols-2";
31
+ updates.innerClass = "t-items-start";
32
+ updates.wrapperClass = "$reset t-flex t-cursor-pointer t-mb-3";
33
+ return radio(updates)
34
+ };
35
+
36
+ // TODO: rename
37
+ const col2RadioCenter = (updates) => {
38
+ updates.legendClass = "required t-w-[100%] t-text-center";
39
+ if (typeof updates.fieldsetClass === "undefined") {
40
+ updates.fieldsetClass = "$reset t-flex t-justify-center";
41
+ }
42
+ updates.innerClass = "t-items-start";
43
+ updates.wrapperClass = "$reset t-flex t-cursor-pointer t-mb-3";
44
+ updates.optionClass = "t-pl-4 md:t-pl-8 md:t-min-w-[200px]";
45
+ updates.optionsClass = "t-pl-4 t-pt-3 t-grid t-grid-cols-1 md:t-grid-cols-2";
46
+ updates.messagesClass = "t-flex t-justify-center";
47
+ updates.helpClass = "t-mt-0 t-mb-4 !t-text-sm t-text-center";
30
48
  return radio(updates)
31
49
  };
32
50
 
33
51
  const sbs2ItemRadio = (updates) => {
34
- updates.legendClass = 'legend-left t-pb-1 required';
35
- updates.fieldsetClass = '$reset side-by-side t-items-center';
36
- updates.optionsClass = 't-mt-1 t-grid t-grid-cols-1 md:t-grid-cols-2-125 t-items-center';
37
- updates.innerClass = 't-flex t-items-center';
38
- updates.optionClass = 't-pr-1';
52
+ updates.legendClass = "legend-left t-pb-1 required";
53
+ updates.fieldsetClass = "$reset side-by-side t-items-center";
54
+ updates.optionsClass = "t-mt-1 t-grid t-grid-cols-1 md:t-grid-cols-2-125 t-items-center";
55
+ updates.innerClass = "t-flex t-items-center";
56
+ updates.optionClass = "t-pr-1";
57
+ return radio(updates)
58
+ };
59
+
60
+ const verticalButtonRadio = (updates) => {
61
+ updates.legendClass = "legend-left";
62
+ updates.fieldsetClass = "$reset t-flex t-justify-center t-flex-col-reverse t-items-center";
63
+ if (typeof updates.optionsClass === "undefined") {
64
+ updates.optionsClass = "t-flex t-flex-col sm:t-flex-row t-justify-center t-my-3";
65
+ }
66
+ updates.optionClass = "radiobtn t-my-2 sm:t-my-0 t-mx-2 md:t-mx-5";
67
+ updates.wrapperClass = "$reset formkit-wrapper t-mb-0 t-flex t-items-center t-h-[100%]";
68
+ updates.labelClass = "t-font-semibold t-text-[#1e448f] t-w-[100%]";
69
+ updates.decoratorIcon = false;
70
+ updates.messagesClass = "t-flex t-justify-center";
71
+ updates.helpClass = "t-mt-2.5 !t-text-sm t-text-center";
39
72
  return radio(updates)
40
73
  };
41
74
 
@@ -43,23 +76,35 @@ const select = (updates) => {
43
76
  if (updates.name && !updates.id) {
44
77
  updates.id = updates.name;
45
78
  }
46
- return merge({
47
- $formkit: 'select',
48
- placeholder: "Please Select",
49
- validation: 'required',
50
- validationMessages: {
51
- required: 'Field is required'
79
+ return merge(
80
+ {
81
+ $formkit: "select",
82
+ placeholder: "Please Select",
83
+ validation: "required",
84
+ validationMessages: {
85
+ required: "Field is required",
86
+ },
87
+ inputClass: "t-bg-white",
88
+ labelClass: "required",
52
89
  },
53
- inputClass: 't-bg-white',
54
- labelClass: 'required'
55
- }, updates)
90
+ updates
91
+ )
56
92
  };
57
93
 
58
94
  const sbsSelect = (updates) => {
59
- updates.labelClass = 'required';
60
- updates.wrapperClass = 'side-by-side t-items-center';
61
- updates.innerClass = 'select-height-content';
62
- updates.helpClass = 't-mt-2.5 md:t-text-right md:t-mt-[-5px]';
95
+ updates.labelClass = "required";
96
+ updates.wrapperClass = "side-by-side t-items-center";
97
+ updates.innerClass = "select-height-content";
98
+ updates.helpClass = "t-mt-2.5 md:t-text-right md:t-mt-[-5px]";
99
+ return select(updates)
100
+ };
101
+
102
+ const verticalSelect = (updates) => {
103
+ updates.labelClass = "required";
104
+ updates.wrapperClass = "t-flex t-justify-center";
105
+ updates.messagesClass = "t-flex t-justify-center";
106
+ updates.inputClass = "t-min-w-[150px] t-bg-white";
107
+ updates.helpClass = "t-mt-2.5 t-text-center";
63
108
  return select(updates)
64
109
  };
65
110
 
@@ -67,221 +112,290 @@ const text = (updates) => {
67
112
  if (updates.name && !updates.id) {
68
113
  updates.id = updates.name;
69
114
  }
70
- return merge({
71
- $formkit: 'text',
72
- validation: 'required',
73
- validationMessages: {
74
- required: 'Field is required'
115
+ return merge(
116
+ {
117
+ $formkit: "text",
118
+ validation: "required",
119
+ validationMessages: {
120
+ required: "Field is required",
121
+ },
122
+ labelClass: "required",
75
123
  },
76
- labelClass: 'required'
77
- }, updates)
124
+ updates
125
+ )
78
126
  };
79
127
 
80
128
  const sbsText = (updates) => {
81
- updates.wrapperClass = 'side-by-side t-items-center';
129
+ updates.wrapperClass = "side-by-side t-items-center";
82
130
  return text(updates)
83
131
  };
84
132
 
85
133
  const verticalText = (updates) => {
86
- updates.wrapperClass = 't-flex t-justify-center';
87
- updates.messagesClass = 't-flex t-justify-center';
88
- updates.inputClass = 't-text-center';
89
- updates.helpClass = 't-mt-2.5 !t-text-sm t-text-center';
134
+ updates.wrapperClass = "t-flex t-justify-center";
135
+ updates.messagesClass = "t-flex t-justify-center";
136
+ updates.inputClass = "t-text-center";
137
+ updates.helpClass = "t-mt-2.5 !t-text-sm t-text-center";
90
138
  return text(updates)
91
139
  };
92
140
 
93
-
94
141
  const zipcode = (scope, vertical, updates = {}) => {
95
142
  const func = vertical ? verticalText : sbsText;
96
- const label = vertical ? (updates.label) : 'Zip Code:';
97
- const help = vertical ? (updates.help ?? "We try to match you with local help") : null;
143
+ const label = vertical ? updates.label : "Zip Code:";
144
+ const help = vertical ? updates.help ?? "We try to match you with local help" : null;
98
145
  return func({
99
146
  label,
100
147
  help,
101
- placeholder: '#####',
102
- name: scope ? scope + ':' + 'Zip' : 'Zip',
148
+ placeholder: "#####",
149
+ name: scope ? scope + ":" + "Zip" : "Zip",
103
150
  maxlength: 5,
104
151
  inputmode: "numeric",
105
- autocomplete: 'postal-code',
106
- validation: 'required|matches:/^[0-9]{5}$/',
152
+ autocomplete: "postal-code",
153
+ validation: "required|matches:/^[0-9]{5}$/",
107
154
  validationMessages: {
108
- required: 'Zip Code is required',
109
- matches: 'Invalid Zip Code'
155
+ required: "Zip Code is required",
156
+ matches: "Invalid Zip Code",
110
157
  },
111
- ...updates
158
+ ...updates,
112
159
  })
113
160
  };
114
161
 
115
- const civilDefense = (updates) => sbs2ItemRadio(merge({
116
- name: 'Civil_Defense',
117
- id: 'Civil_Defense',
118
- if: '$get(Type_Of_Legal_Problem).value == "Civil Lawsuit"',
119
- label: 'Do You Need Representation to File a Lawsuit or Defend One?',
120
- options: {
121
- Yes: 'Defend a Lawsuit',
122
- No: 'File a Lawsuit'
123
- }
124
- }, updates));
125
-
126
- const civilLawsuitTOLPDisplay = (updates) => col2Radio(merge({
127
- name: 'Type_Of_Legal_Problem_Display',
128
- if: '$get(Type_Of_Legal_Problem).value == "Civil Lawsuit" && $get(Civil_Defense).value == "No"',
129
- label: 'Select The Type of Lawsuit You Would Like to File:',
130
- options: [
131
- 'Automobile Accident',
132
- 'Contract Disputes',
133
- 'Defamation and Slander',
134
- 'Dog Bite',
135
- 'Employment and Workplace',
136
- 'Fraud',
137
- 'Medical Malpractice',
138
- 'Personal Injury',
139
- 'Property Damage',
140
- 'Small Claims',
141
- 'Real Estate',
142
- 'Not Sure or Other'
143
- ]
144
- }, updates));
145
-
146
- const employmentAndWorkplaceTOLPDisplay = (updates) => col2Radio(merge({
147
- name: 'Type_Of_Legal_Problem_Display',
148
- if: '$get(Type_Of_Legal_Problem).value == "Employment and Workplace"',
149
- label: 'Select The Workplace Issue:',
150
- options: [
151
- 'Workplace Harassment',
152
- 'Workplace Discrimination',
153
- 'Wrongful Termination',
154
- 'Payment Disputes',
155
- 'Workers Compensation',
156
- 'Personal Injury',
157
- 'Unemployment',
158
- 'Other Workplace Issues'
159
- ]
160
- }, updates));
162
+ const civilDefense = (scope, vertical, updates = {}) => {
163
+ const func = vertical ? verticalButtonRadio : sbs2ItemRadio;
164
+ const label = vertical ? updates.label : "Do You Need Representation to File a Lawsuit or Defend One?";
165
+ const _if = vertical ? updates.if : '$get(Type_Of_Legal_Problem).value == "Civil Lawsuit"';
166
+ return func(
167
+ merge(
168
+ {
169
+ label,
170
+ if: _if,
171
+ name: scope ? scope + ":" + "Civil_Defense" : "Civil_Defense",
172
+ options: ["Defend a Lawsuit", "File a Lawsuit"],
173
+ },
174
+ updates
175
+ )
176
+ )
177
+ };
161
178
 
179
+ const civilLawsuitTOLPDisplay = (scope, vertical, updates = {}) => {
180
+ const func = vertical ? col2RadioCenter : col2Radio;
181
+ const label = vertical ? updates.label : "Select The Type of Lawsuit You Would Like to File:";
182
+ const _if = vertical
183
+ ? null
184
+ : '$get(Type_Of_Legal_Problem).value == "Civil Lawsuit" && $get(Civil_Defense).value == "File a Lawsuit"';
185
+ return func(
186
+ merge(
187
+ {
188
+ label,
189
+ if: _if,
190
+ name: scope ? scope + ":" + "Type_Of_Legal_Problem_Display" : "Type_Of_Legal_Problem_Display",
191
+ options: [
192
+ "Automobile Accident",
193
+ "Contract Disputes",
194
+ "Defamation and Slander",
195
+ "Dog Bite",
196
+ "Employment and Workplace",
197
+ "Fraud",
198
+ "Medical Malpractice",
199
+ "Personal Injury",
200
+ "Property Damage",
201
+ "Small Claims",
202
+ "Real Estate",
203
+ "Not Sure or Other",
204
+ ],
205
+ },
206
+ updates
207
+ )
208
+ )
209
+ };
210
+
211
+ const employmentAndWorkplaceTOLPDisplay = (scope, vertical, updates = {}) => {
212
+ const func = vertical ? col2RadioCenter : col2Radio;
213
+ const label = vertical ? updates.label : "Select The Workplace Issue:";
214
+ return func(
215
+ merge(
216
+ {
217
+ label,
218
+ if: '$get(Type_Of_Legal_Problem).value == "Employment and Workplace"',
219
+ name: scope ? scope + ":" + "Type_Of_Legal_Problem_Display" : "Type_Of_Legal_Problem_Display",
220
+ options: [
221
+ "Workplace Harassment",
222
+ "Workplace Discrimination",
223
+ "Wrongful Termination",
224
+ "Payment Disputes",
225
+ "Workers Compensation",
226
+ "Personal Injury",
227
+ "Unemployment",
228
+ "Other Workplace Issues",
229
+ ],
230
+ },
231
+ updates
232
+ )
233
+ )
234
+ };
162
235
 
163
236
  const TOLPOptions = [
164
- 'Adoption',
165
- 'Asbestos and Mesothelioma',
166
- 'Auto and Car Accidents',
167
- 'Bankruptcy',
168
- 'Birth Certificate and Name Change',
169
- 'Business Lawyers',
170
- 'Child Custody',
171
- 'Child Support',
172
- 'Civil Rights and Discrimination',
173
- 'Consumer Lawyers',
174
- 'Copyrights and Trademarks',
175
- 'Criminal and Felony',
176
- 'Debt and Collections',
177
- 'Defend a Lawsuit',
178
- 'Divorce and Separation',
179
- 'DUI and DWI',
180
- 'Elder Law',
181
- 'Employment and Workplace',
182
- 'Expungement',
183
- 'Family Issues',
184
- 'File a Lawsuit',
185
- 'Foreclosure',
186
- 'Guardianship',
187
- 'Harassment and Discrimination',
188
- 'Identity Theft',
189
- 'Immigration and Visas',
190
- 'Insurance',
191
- 'Landlord and Tenant',
192
- 'Lemon Law',
193
- 'Long Term Disability',
194
- 'Medical Malpractice',
195
- 'Non-Workplace Discrimination',
196
- 'Non-Workplace Harassment',
197
- 'Patents and Intellectual Property',
198
- 'Personal Injury',
199
- 'Power of Attorney',
200
- 'Probate and Estates',
201
- 'Product Liability',
202
- 'Property Damage',
203
- 'Real Estate',
204
- 'Sexual Harassment',
205
- 'Social Security Disability and Insurance',
206
- 'Tax and IRS',
207
- 'Traffic and Tickets',
208
- 'Unemployment',
209
- 'Victim of a Crime',
210
- 'Wills and Trusts',
211
- 'Workers Compensation',
212
- 'Workplace Discrimination',
213
- 'Workplace Harassment',
214
- 'Wrongful Death',
215
- 'Wrongful Termination',
216
- 'Not Sure or Other'
237
+ "Adoption",
238
+ "Asbestos and Mesothelioma",
239
+ "Auto and Car Accidents",
240
+ "Bankruptcy",
241
+ "Birth Certificate and Name Change",
242
+ "Business Lawyers",
243
+ "Child Custody",
244
+ "Child Support",
245
+ "Civil Rights and Discrimination",
246
+ "Consumer Lawyers",
247
+ "Copyrights and Trademarks",
248
+ "Criminal and Felony",
249
+ "Debt and Collections",
250
+ "Defend a Lawsuit",
251
+ "Divorce and Separation",
252
+ "DUI and DWI",
253
+ "Elder Law",
254
+ "Employment and Workplace",
255
+ "Expungement",
256
+ "Family Issues",
257
+ "File a Lawsuit",
258
+ "Foreclosure",
259
+ "Guardianship",
260
+ "Harassment and Discrimination",
261
+ "Identity Theft",
262
+ "Immigration and Visas",
263
+ "Insurance",
264
+ "Landlord and Tenant",
265
+ "Lemon Law",
266
+ "Long Term Disability",
267
+ "Medical Malpractice",
268
+ "Non-Workplace Discrimination",
269
+ "Non-Workplace Harassment",
270
+ "Patents and Intellectual Property",
271
+ "Personal Injury",
272
+ "Power of Attorney",
273
+ "Probate and Estates",
274
+ "Product Liability",
275
+ "Property Damage",
276
+ "Real Estate",
277
+ "Sexual Harassment",
278
+ "Social Security Disability and Insurance",
279
+ "Tax and IRS",
280
+ "Traffic and Tickets",
281
+ "Unemployment",
282
+ "Victim of a Crime",
283
+ "Wills and Trusts",
284
+ "Workers Compensation",
285
+ "Workplace Discrimination",
286
+ "Workplace Harassment",
287
+ "Wrongful Death",
288
+ "Wrongful Termination",
289
+ "Not Sure or Other",
217
290
  ];
218
291
 
219
- const generalTOLP = (updates) => sbsSelect(merge({
220
- label: 'Type of Help Needed:',
221
- name: 'Type_Of_Legal_Problem',
222
- id: 'Type_Of_Legal_Problem',
223
- options: TOLPOptions,
224
- }, updates));
225
-
226
- const landlordTenantIssueRadio = () => col2Radio({
227
- label: 'What is the Landlord / Tenant Issue?',
228
- if: '$get(Type_Of_Legal_Problem).value == "Landlord and Tenant"',
229
- id: 'Landlord_Tenant_Issue',
230
- name: 'Landlord_Tenant_Issue',
231
- options: [
232
- "Eviction",
233
- "Repairs and Maintenance",
234
- "Lease and Rental Agreements",
235
- "Discrimination",
236
- "Right of Entry and Privacy",
237
- "Screening and Applications",
238
- "Environmental Hazards",
239
- "Other Dispute"
240
- ]
241
- });
292
+ const generalTOLP = (scope, vertical, updates = {}) => {
293
+ const func = vertical ? verticalSelect : sbsSelect;
294
+ const label = vertical ? updates.label : "Type of Help Needed:";
295
+ return func(
296
+ merge(
297
+ {
298
+ label,
299
+ name: scope ? scope + ":" + "Type_Of_Legal_Problem" : "Type_Of_Legal_Problem",
300
+ id: scope ? scope + ":" + "Type_Of_Legal_Problem" : "Type_Of_Legal_Problem",
301
+ options: TOLPOptions,
302
+ },
303
+ updates
304
+ )
305
+ )
306
+ };
307
+
308
+ const landlordTenantIssueRadio = (scope, vertical, updates = {}) => {
309
+ const func = vertical ? col2RadioCenter : col2Radio;
310
+ const label = vertical ? updates.label : "What is the Landlord / Tenant Issue?";
311
+ const _if = vertical ? updates.if : '$get(Type_Of_Legal_Problem).value == "Landlord and Tenant"';
312
+ return func(
313
+ merge(
314
+ {
315
+ label,
316
+ if: _if,
317
+ id: scope ? scope + ":" + "Landlord_Tenant_Issue" : "Landlord_Tenant_Issue",
318
+ name: scope ? scope + ":" + "Landlord_Tenant_Issue" : "Landlord_Tenant_Issue",
319
+ options: [
320
+ "Eviction",
321
+ "Repairs and Maintenance",
322
+ "Lease and Rental Agreements",
323
+ "Discrimination",
324
+ "Right of Entry and Privacy",
325
+ "Screening and Applications",
326
+ "Environmental Hazards",
327
+ "Other Dispute",
328
+ ],
329
+ },
330
+ updates
331
+ )
332
+ )
333
+ };
334
+
335
+ const realEstateTOLPDisplay = (scope, vertical, updates = {}) => {
336
+ const func = vertical ? col2RadioCenter : col2Radio;
337
+ const label = vertical ? updates.label : "Select The Real Estate Issue:";
338
+ const _if = vertical ? updates.if : '$get(Type_Of_Legal_Problem).value == "Real Estate"';
339
+ return func(
340
+ merge(
341
+ {
342
+ label,
343
+ if: _if,
344
+ name: scope ? scope + ":" + "Type_Of_Legal_Problem_Display" : "Type_Of_Legal_Problem_Display",
345
+ options: [
346
+ "Contracts and Agreements",
347
+ "Deeds, Liens, and Titles",
348
+ "Foreclosure",
349
+ "Insurance",
350
+ "Landlord and Tenant",
351
+ "Loans and Mortgages",
352
+ "Wills, Trusts, and Estates",
353
+ "Property Damage",
354
+ "Not Sure or Other",
355
+ ],
356
+ },
357
+ updates
358
+ )
359
+ )
360
+ };
361
+
362
+ const criminalTOLPDisplay = (scope, vertical, updates = {}) => {
363
+ const func = vertical ? col2RadioCenter : col2Radio;
364
+ const label = vertical ? updates.label : "Select The Criminal Issue:";
365
+ const _if = vertical ? updates.if : '$get(Type_Of_Legal_Problem).value == "Criminal and Felony"';
366
+ return func(
367
+ merge(
368
+ {
369
+ label,
370
+ if: _if,
371
+ name: scope ? scope + ":" + "Type_Of_Legal_Problem_Display" : "Type_Of_Legal_Problem_Display",
372
+ options: [
373
+ "Criminal Defense",
374
+ "Victim of a Crime",
375
+ "DUI and DWI",
376
+ "Expungement",
377
+ "Harassment",
378
+ "Not Sure or Other",
379
+ ],
380
+ },
381
+ updates
382
+ )
383
+ )
384
+ };
385
+
386
+ const NEXT_ON_ENTER = "$onEnter($setNextStep($fireStepEvent($get(form)), $preStepFunc($get(form))))";
387
+ const NEXT_ON_INPUT = "$onInput($setNextStep($fireStepEvent($get(form)), $preStepFunc($get(form))))";
242
388
 
243
- const realEstateTOLPDisplay = (updates) => col2Radio(merge({
244
- name: 'Type_Of_Legal_Problem_Display',
245
- if: '$get(Type_Of_Legal_Problem).value == "Real Estate"',
246
- label: 'Select The Type of Real Estate Issue:',
247
- options: [
248
- 'Contracts and Agreements',
249
- 'Deeds, Liens, and Titles',
250
- 'Foreclosure',
251
- 'Insurance',
252
- 'Landlord and Tenant',
253
- 'Loans and Mortgages',
254
- 'Wills, Trusts, and Estates',
255
- 'Property Damage',
256
- 'Not Sure or Other'
257
- ]
258
- }, updates));
259
-
260
- const criminalTOLPDisplay = (updates) => col2Radio(merge({
261
- name: 'Type_Of_Legal_Problem_Display',
262
- if: '$get(Type_Of_Legal_Problem).value == "Criminal and Felony"',
263
- label: 'Which Type of Criminal Issue?',
264
- options: [
265
- 'Criminal Defense',
266
- 'Victim of a Crime',
267
- 'DUI and DWI',
268
- 'Expungement',
269
- 'Harassment',
270
- 'Not Sure or Other',
271
- ]
272
- }, updates));
273
-
274
- const NEXT_ON_ENTER = '$onEnter($setNextStep($fireStepEvent($get(form)), $preStepFunc($get(form))))';
275
- const NEXT_ON_INPUT = '$onInput($setNextStep($fireStepEvent($get(form)), $preStepFunc($get(form))))';
276
-
277
- const isInput = (n) => { return (n.type !== 'group' && n.type !== 'section' && n.type !== 'form' && n.$formkit !== 'hidden' && !n.children) };
389
+ const isInput = (n) => {
390
+ return n.type !== "group" && n.type !== "section" && n.type !== "form" && n.$formkit !== "hidden" && !n.children
391
+ };
278
392
 
279
393
  const findLastInput = (n) => {
280
394
  if (isInput(n)) {
281
395
  return n
282
396
  }
283
397
  for (var i = n.children.length - 1; i >= 0; i--) {
284
- if (typeof n.children === 'string') {
398
+ if (typeof n.children === "string") {
285
399
  continue
286
400
  }
287
401
  const child = n.children[i];
@@ -297,12 +411,12 @@ const findLastInput = (n) => {
297
411
  };
298
412
 
299
413
  const stepDefaults = (step, stepKey) => ({
300
- $el: 'section',
414
+ $el: "section",
301
415
  if: '$stepEnabled("' + step + '")',
302
416
  attrs: {
303
417
  hidden: '$activeStep !== "' + step + '"',
304
- key: stepKey ? stepKey : step
305
- }
418
+ key: stepKey ? stepKey : step,
419
+ },
306
420
  });
307
421
 
308
422
  function step(name, inputs, updates = {}) {
@@ -325,27 +439,24 @@ function step(name, inputs, updates = {}) {
325
439
  }
326
440
  }
327
441
 
328
- return merge(
329
- stepDefaults(name, stepKey),
330
- {
331
- children: [
332
- {
333
- $formkit: 'group',
334
- id: name,
335
- name: name,
336
- nextStepMap: nextStepMap,
337
- triggerRedirectMap: triggerRedirectMap,
338
- autoFocus: autoFocus,
339
- children: inputs
340
- }
341
- ]
342
- }
343
- )
442
+ return merge(stepDefaults(name, stepKey), {
443
+ children: [
444
+ {
445
+ $formkit: "group",
446
+ id: name,
447
+ name: name,
448
+ nextStepMap: nextStepMap,
449
+ triggerRedirectMap: triggerRedirectMap,
450
+ autoFocus: autoFocus,
451
+ children: inputs,
452
+ },
453
+ ],
454
+ })
344
455
  }
345
456
 
346
457
  function generalLegalTOLPAndZip(updates = {}) {
347
458
  return step(
348
- 'generalLegalTOLPAndZip',
459
+ "generalLegalTOLPAndZip",
349
460
  [
350
461
  generalTOLP(),
351
462
  civilDefense(),
@@ -354,7 +465,7 @@ function generalLegalTOLPAndZip(updates = {}) {
354
465
  employmentAndWorkplaceTOLPDisplay(),
355
466
  landlordTenantIssueRadio(),
356
467
  realEstateTOLPDisplay(),
357
- zipcode()
468
+ zipcode(),
358
469
  ],
359
470
  updates
360
471
  )
@@ -362,87 +473,87 @@ function generalLegalTOLPAndZip(updates = {}) {
362
473
 
363
474
  function formNavigationOnlySubmit(updates = {}) {
364
475
  return {
365
- $el: 'div',
476
+ $el: "div",
366
477
  attrs: {
367
- class: 'step-nav'
478
+ class: "step-nav",
368
479
  },
369
480
  children: [
370
481
  {
371
- $formkit: 'button',
372
- name: 'hidden_button',
373
- children: 'Hidden',
482
+ $formkit: "button",
483
+ name: "hidden_button",
484
+ children: "Hidden",
374
485
  style: {
375
- if: '$activeStep === $firstStep()',
376
- then: 'visibility: hidden;'
377
- }
486
+ if: "$activeStep === $firstStep()",
487
+ then: "visibility: hidden;",
488
+ },
378
489
  },
379
490
  {
380
- $formkit: 'submit',
381
- name: 'submit_button',
382
- label: updates.submitLabel || 'Chat Now'
383
- }
384
- ]
491
+ $formkit: "submit",
492
+ name: "submit_button",
493
+ label: updates.submitLabel || "Chat Now",
494
+ },
495
+ ],
385
496
  }
386
497
  }
387
498
 
388
499
  const formDetails = () => ({
389
- $el: 'pre',
500
+ $el: "pre",
390
501
  if: '$urlParam("fdbg", "") == 1',
391
502
  children: [
392
503
  {
393
- $el: 'pre',
394
- children: '$stringify( $get(form).value )',
504
+ $el: "pre",
505
+ children: "$stringify( $get(form).value )",
395
506
  attrs: {
396
- class: 't-text-xs',
397
- style: 'overflow: scroll'
398
- }
507
+ class: "t-text-xs",
508
+ style: "overflow: scroll",
509
+ },
399
510
  },
400
511
  {
401
- $el: 'pre',
402
- children: ['activeStep: ', '$activeStep'],
512
+ $el: "pre",
513
+ children: ["activeStep: ", "$activeStep"],
403
514
  attrs: {
404
- class: 't-text-xs',
405
- style: 'overflow: scroll'
406
- }
515
+ class: "t-text-xs",
516
+ style: "overflow: scroll",
517
+ },
407
518
  },
408
519
  {
409
- $el: 'pre',
410
- children: ['stepHistory: ', '$stepHistory'],
520
+ $el: "pre",
521
+ children: ["stepHistory: ", "$stepHistory"],
411
522
  attrs: {
412
- class: 't-text-xs',
413
- style: 'overflow: scroll'
414
- }
523
+ class: "t-text-xs",
524
+ style: "overflow: scroll",
525
+ },
415
526
  },
416
527
  {
417
- $el: 'pre',
418
- children: ['stepQueue: ', '$stepQueue'],
528
+ $el: "pre",
529
+ children: ["stepQueue: ", "$stepQueue"],
419
530
  attrs: {
420
- class: 't-text-xs',
421
- style: 'overflow: scroll'
422
- }
531
+ class: "t-text-xs",
532
+ style: "overflow: scroll",
533
+ },
423
534
  },
424
535
  {
425
- $el: 'pre',
426
- children: ['steps: ', '$stepKeys()'],
536
+ $el: "pre",
537
+ children: ["steps: ", "$stepKeys()"],
427
538
  attrs: {
428
- class: 't-text-xs',
429
- style: 'overflow: scroll'
430
- }
431
- }
432
- ]
539
+ class: "t-text-xs",
540
+ style: "overflow: scroll",
541
+ },
542
+ },
543
+ ],
433
544
  });
434
545
 
435
546
  const formPropDefaults = {
436
- type: 'form',
437
- id: 'form',
438
- config: { validationVisibility: 'submit' },
547
+ type: "form",
548
+ id: "form",
549
+ config: { validationVisibility: "submit" },
439
550
  onSubmit: '$submit($submitUrl, $prepData, $handleRedirect, "text/plain; charset=UTF-8")',
440
- plugins: '$plugins',
551
+ plugins: "$plugins",
441
552
  actions: false,
442
- anchorElement: 'form-anchor',
553
+ anchorElement: "form-anchor",
443
554
  useLocalStorage: true,
444
555
  prepop: {
445
- fromURL: true
556
+ fromURL: true,
446
557
  },
447
558
  errorCodes: {
448
559
  403: { message: "An Error Occurred", abort: false },
@@ -450,7 +561,7 @@ const formPropDefaults = {
450
561
  429: "An Error Occurred",
451
562
  504: { message: "An Error Occurred", abort: false },
452
563
  },
453
- formClass: '!t-max-w-[40rem]'
564
+ formClass: "!t-max-w-[40rem]",
454
565
  };
455
566
 
456
567
  // export function filteredNextStepsMapLegal(keyList) {
@@ -460,10 +571,7 @@ const formPropDefaults = {
460
571
  // }
461
572
 
462
573
  function formProps(updates) {
463
- const props = merge(
464
- formPropDefaults,
465
- updates
466
- );
574
+ const props = merge(formPropDefaults, updates);
467
575
  if (props.formId && !props.name) {
468
576
  props.name = props.formId;
469
577
  }
@@ -471,76 +579,73 @@ function formProps(updates) {
471
579
  }
472
580
 
473
581
  const formAnchorDefaults = {
474
- $el: 'div',
582
+ $el: "div",
475
583
  children: [
476
584
  {
477
- $el: 'div',
585
+ $el: "div",
478
586
  attrs: {
479
- id: 'form-anchor',
480
- class: 't-absolute',
481
- style: { top: '-30px', left: 0 }
482
- }
483
- }
587
+ id: "form-anchor",
588
+ class: "t-absolute",
589
+ style: { top: "-30px", left: 0 },
590
+ },
591
+ },
484
592
  ],
485
593
  attrs: {
486
- class: 't-relative'
487
- }
594
+ class: "t-relative",
595
+ },
488
596
  };
489
597
 
490
598
  function formAnchor(updates) {
491
- return merge(
492
- formAnchorDefaults,
493
- updates
494
- )
599
+ return merge(formAnchorDefaults, updates)
495
600
  }
496
601
 
497
602
  function headlineDefaults(updates = {}) {
498
603
  return {
499
- $el: 'h1',
604
+ $el: "h1",
500
605
  attrs: {
501
- class: 't-flex t-justify-center t-text-center !t-text-[2rem] t-font-semibold t-pt-5 t-px-7 md:t-px-3' + ' ' + (updates.headlineClass || '')
502
- }
606
+ class:
607
+ "t-flex t-justify-center t-text-center !t-text-[2rem] t-font-semibold t-pt-5 t-px-7 md:t-px-3" +
608
+ " " +
609
+ (updates.headlineClass || ""),
610
+ },
503
611
  }
504
612
  }
505
613
 
506
614
  function headline(updates = {}) {
507
- return merge(
508
- headlineDefaults(updates),
509
- updates
510
- )
615
+ return merge(headlineDefaults(updates), updates)
511
616
  }
512
617
 
513
618
  const hiddenInputsBase = [
514
619
  {
515
- $formkit: 'hidden',
620
+ $formkit: "hidden",
516
621
  name: "gclid",
517
- value: null
622
+ value: null,
518
623
  },
519
624
  {
520
- $formkit: 'hidden',
625
+ $formkit: "hidden",
521
626
  name: "campaignid",
522
- value: null
627
+ value: null,
523
628
  },
524
629
  {
525
- $formkit: 'hidden',
630
+ $formkit: "hidden",
526
631
  name: "s",
527
- value: null
528
- }
632
+ value: null,
633
+ },
529
634
  ];
530
635
 
531
636
  const hiddenInputsMechanics = [
532
637
  {
533
- $formkit: 'hidden',
638
+ $formkit: "hidden",
534
639
  name: "vertical",
535
- value: "AutoRepair"
640
+ value: "AutoRepair",
536
641
  },
537
642
  {
538
- $formkit: 'hidden',
643
+ $formkit: "hidden",
539
644
  name: "Category",
540
645
  id: "Category",
541
- value: "Mechanics"
646
+ value: "Mechanics",
542
647
  },
543
- ...hiddenInputsBase
648
+ ...hiddenInputsBase,
544
649
  ];
545
650
 
546
651
  const schema = [