bhl-forms 0.0.15 → 0.0.18
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.
- package/dist/bhl-forms.es.js +51 -35
- package/dist/bhl-forms.iife.js +10 -10
- package/dist/bhl-forms.umd.js +10 -10
- package/dist/forms/childAndFamily.es.js +75 -60
- package/dist/forms/childAndFamily.iife.js +1 -654
- package/dist/forms/childAndFamily.json +1 -1
- package/dist/forms/testForm.es.js +89 -54
- package/dist/forms/testForm.iife.js +1 -363
- package/dist/forms/testForm.json +1 -1
- package/dist/main.css +1 -1
- package/package.json +3 -2
|
@@ -2,6 +2,58 @@ function merge() {
|
|
|
2
2
|
return Object.assign({}, ...arguments)
|
|
3
3
|
}
|
|
4
4
|
|
|
5
|
+
const formPropDefaults = {
|
|
6
|
+
type: 'form',
|
|
7
|
+
id: 'form',
|
|
8
|
+
onSubmit: '$submit("https://httpbin.org/post", $prepData, $getRedirect)',
|
|
9
|
+
plugins: '$plugins',
|
|
10
|
+
actions: false,
|
|
11
|
+
prepop: {
|
|
12
|
+
fromURL: true
|
|
13
|
+
},
|
|
14
|
+
errorCodes: {
|
|
15
|
+
403: "An Error Occurred",
|
|
16
|
+
409: { abort: false },
|
|
17
|
+
429: "An Error Occurred"
|
|
18
|
+
},
|
|
19
|
+
formClass: '!t-max-w-xl'
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
function formProps(updates) {
|
|
23
|
+
return merge(
|
|
24
|
+
formPropDefaults,
|
|
25
|
+
updates
|
|
26
|
+
)
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
const hiddenInputs = [
|
|
30
|
+
{
|
|
31
|
+
$formkit: 'hidden',
|
|
32
|
+
name: "vertical",
|
|
33
|
+
value: "Legal"
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
$formkit: 'hidden',
|
|
37
|
+
name: "TCPA_Language",
|
|
38
|
+
value: "$meta.tcpaLanguage"
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
$formkit: 'hidden',
|
|
42
|
+
name: "gclid",
|
|
43
|
+
value: null,
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
$formkit: 'hidden',
|
|
47
|
+
name: "campaignid",
|
|
48
|
+
value: null,
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
$formkit: 'hidden',
|
|
52
|
+
name: "s",
|
|
53
|
+
value: null,
|
|
54
|
+
}
|
|
55
|
+
];
|
|
56
|
+
|
|
5
57
|
// ------ Common Base Settings
|
|
6
58
|
|
|
7
59
|
const radio = (updates) => {
|
|
@@ -11,7 +63,7 @@ const radio = (updates) => {
|
|
|
11
63
|
validationMessages: {
|
|
12
64
|
required: 'Field is required',
|
|
13
65
|
},
|
|
14
|
-
optionsClass: 'pt-3 pl-1',
|
|
66
|
+
optionsClass: 't-pt-3 t-pl-1',
|
|
15
67
|
legendClass: 'required'
|
|
16
68
|
}, updates)
|
|
17
69
|
};
|
|
@@ -19,18 +71,18 @@ const radio = (updates) => {
|
|
|
19
71
|
const sbs2ColRadio = (updates) => {
|
|
20
72
|
updates.legendClass = 'legend-left required';
|
|
21
73
|
updates.fieldsetClass = '$reset side-by-side';
|
|
22
|
-
updates.optionsClass = 'grid grid-cols-1 md:grid-cols-2';
|
|
23
|
-
updates.innerClass = 'flex items-start';
|
|
24
|
-
updates.wrapperClass = '$reset flex cursor-pointer mb-3';
|
|
74
|
+
updates.optionsClass = 't-grid t-grid-cols-1 md:t-grid-cols-2';
|
|
75
|
+
updates.innerClass = 't-flex t-items-start';
|
|
76
|
+
updates.wrapperClass = '$reset t-flex t-cursor-pointer t-mb-3';
|
|
25
77
|
return radio(updates)
|
|
26
78
|
};
|
|
27
79
|
|
|
28
80
|
const sbsYesNoRadio = (updates) => {
|
|
29
81
|
updates.options = ['Yes', 'No'];
|
|
30
82
|
updates.legendClass = 'legend-left required';
|
|
31
|
-
updates.fieldsetClass = '$reset side-by-side items-center';
|
|
32
|
-
updates.optionsClass = 'pl-1 side-by-side items-center';
|
|
33
|
-
updates.innerClass = 'flex items-center';
|
|
83
|
+
updates.fieldsetClass = '$reset side-by-side t-items-center';
|
|
84
|
+
updates.optionsClass = 't-pl-1 side-by-side t-items-center';
|
|
85
|
+
updates.innerClass = 't-flex t-items-center';
|
|
34
86
|
return radio(updates)
|
|
35
87
|
};
|
|
36
88
|
|
|
@@ -42,14 +94,14 @@ const select = (updates) => {
|
|
|
42
94
|
validationMessages: {
|
|
43
95
|
required: 'Field is required',
|
|
44
96
|
},
|
|
45
|
-
inputClass: 'bg-white',
|
|
97
|
+
inputClass: 't-bg-white',
|
|
46
98
|
labelClass: 'required'
|
|
47
99
|
}, updates)
|
|
48
100
|
};
|
|
49
101
|
|
|
50
102
|
const sbsSelect = (updates) => {
|
|
51
103
|
updates.labelClass = 'required';
|
|
52
|
-
updates.wrapperClass = 'side-by-side items-center';
|
|
104
|
+
updates.wrapperClass = 'side-by-side t-items-center';
|
|
53
105
|
updates.innerClass = 'select-height-content';
|
|
54
106
|
return select(updates)
|
|
55
107
|
};
|
|
@@ -67,7 +119,7 @@ const text = (updates) => {
|
|
|
67
119
|
|
|
68
120
|
const sbsText = (updates) => {
|
|
69
121
|
updates.labelClass = 'required';
|
|
70
|
-
updates.wrapperClass = 'side-by-side items-center';
|
|
122
|
+
updates.wrapperClass = 'side-by-side t-items-center';
|
|
71
123
|
return text(updates)
|
|
72
124
|
};
|
|
73
125
|
|
|
@@ -237,7 +289,7 @@ const TCPAConsent = () => ({
|
|
|
237
289
|
accepted: 'Consent is required',
|
|
238
290
|
},
|
|
239
291
|
classes: {
|
|
240
|
-
label: "text-xs text-slate-500 font-normal"
|
|
292
|
+
label: "t-text-xs t-text-slate-500 t-font-normal"
|
|
241
293
|
}
|
|
242
294
|
});
|
|
243
295
|
|
|
@@ -410,7 +462,7 @@ function contactInfo() {
|
|
|
410
462
|
$el: 'h3',
|
|
411
463
|
children: 'Based on your input, you may benefit from speaking with a family lawyer. Please verify your contact information:',
|
|
412
464
|
attrs: {
|
|
413
|
-
class: 'flex justify-center text-center text-lg font-bold pb-5 pt-0 px-3'
|
|
465
|
+
class: 't-flex t-justify-center t-text-center t-text-lg t-font-bold t-pb-5 t-pt-0 t-px-3'
|
|
414
466
|
}
|
|
415
467
|
},
|
|
416
468
|
email(),
|
|
@@ -420,7 +472,7 @@ function contactInfo() {
|
|
|
420
472
|
$el: 'div',
|
|
421
473
|
if: '$activeStep === $lastStep()',
|
|
422
474
|
attrs: {
|
|
423
|
-
class: 'flex justify-center'
|
|
475
|
+
class: 't-flex t-justify-center'
|
|
424
476
|
},
|
|
425
477
|
children: [
|
|
426
478
|
{
|
|
@@ -460,7 +512,7 @@ function TOLPQuestions() {
|
|
|
460
512
|
$el: 'h3',
|
|
461
513
|
children: 'Please Complete the Following:',
|
|
462
514
|
attrs: {
|
|
463
|
-
class: 'flex justify-center text-center text-2xl font-bold text-blue-500 pb-5 pt-0 px-3'
|
|
515
|
+
class: 't-flex t-justify-center t-text-center t-text-2xl t-font-bold t-text-blue-500 t-pb-5 t-pt-0 t-px-3'
|
|
464
516
|
}
|
|
465
517
|
},
|
|
466
518
|
AdoptionQuestions(),
|
|
@@ -520,7 +572,7 @@ const formDetails = () => ({
|
|
|
520
572
|
$el: 'pre',
|
|
521
573
|
children: '$stringify( $get(form).value )',
|
|
522
574
|
attrs: {
|
|
523
|
-
class: 'text-xs',
|
|
575
|
+
class: 't-text-xs',
|
|
524
576
|
style: 'overflow: scroll'
|
|
525
577
|
}
|
|
526
578
|
},
|
|
@@ -528,7 +580,7 @@ const formDetails = () => ({
|
|
|
528
580
|
$el: 'pre',
|
|
529
581
|
children: ['activeStep: ', '$activeStep'],
|
|
530
582
|
attrs: {
|
|
531
|
-
class: 'text-xs',
|
|
583
|
+
class: 't-text-xs',
|
|
532
584
|
style: 'overflow: scroll'
|
|
533
585
|
}
|
|
534
586
|
},
|
|
@@ -536,7 +588,7 @@ const formDetails = () => ({
|
|
|
536
588
|
$el: 'pre',
|
|
537
589
|
children: ['stepHistory: ', '$stepHistory'],
|
|
538
590
|
attrs: {
|
|
539
|
-
class: 'text-xs',
|
|
591
|
+
class: 't-text-xs',
|
|
540
592
|
style: 'overflow: scroll'
|
|
541
593
|
}
|
|
542
594
|
},
|
|
@@ -544,7 +596,7 @@ const formDetails = () => ({
|
|
|
544
596
|
$el: 'pre',
|
|
545
597
|
children: ['stepQueue: ', '$stepQueue'],
|
|
546
598
|
attrs: {
|
|
547
|
-
class: 'text-xs',
|
|
599
|
+
class: 't-text-xs',
|
|
548
600
|
style: 'overflow: scroll'
|
|
549
601
|
}
|
|
550
602
|
}
|
|
@@ -560,22 +612,10 @@ const schema = [
|
|
|
560
612
|
},
|
|
561
613
|
{
|
|
562
614
|
$cmp: 'FormKit',
|
|
563
|
-
props: {
|
|
564
|
-
type: 'form',
|
|
565
|
-
id: 'form',
|
|
615
|
+
props: formProps({
|
|
566
616
|
formId: 'childAndFamily',
|
|
567
617
|
onSubmit: '$submit("https://httpbin.org/post", $prepData, $getRedirect)',
|
|
568
618
|
// onSubmit: '$submit("http://localhost:8080/api/v1/form_leads_ext", $prepData, $getRedirect)',
|
|
569
|
-
plugins: '$plugins',
|
|
570
|
-
actions: false,
|
|
571
|
-
prepop: {
|
|
572
|
-
fromURL: true
|
|
573
|
-
},
|
|
574
|
-
errorCodes: {
|
|
575
|
-
403: "An Error Occurred",
|
|
576
|
-
409: { abort: false },
|
|
577
|
-
429: "An Error Occurred"
|
|
578
|
-
},
|
|
579
619
|
redirectMap: {
|
|
580
620
|
'Adoption': 'https://justanswer.9pctbx.net/c/2880795/565949/9320?sharedid=${properties.vid}',
|
|
581
621
|
'Child Custody and Support': 'https://justanswer.9pctbx.net/c/2880795/565949/9320?sharedid=${properties.vid}',
|
|
@@ -583,15 +623,14 @@ const schema = [
|
|
|
583
623
|
'Guardianship': 'https://justanswer.9pctbx.net/c/2880795/565949/9320?sharedid=${properties.vid}',
|
|
584
624
|
'*': 'https://justanswer.9pctbx.net/c/2880795/808601/9320?sharedid=${properties.vid}'
|
|
585
625
|
},
|
|
586
|
-
|
|
587
|
-
},
|
|
626
|
+
}),
|
|
588
627
|
children: [
|
|
589
628
|
{
|
|
590
629
|
$el: 'h1',
|
|
591
630
|
if: '$activeStep === $firstStep()',
|
|
592
631
|
children: 'Get Child & Family Help Today',
|
|
593
632
|
attrs: {
|
|
594
|
-
class: 'flex justify-center text-center text-3xl font-bold pt-5 px-3'
|
|
633
|
+
class: 't-flex t-justify-center t-text-center t-text-3xl t-font-bold t-pt-5 t-px-3'
|
|
595
634
|
}
|
|
596
635
|
},
|
|
597
636
|
{
|
|
@@ -599,34 +638,10 @@ const schema = [
|
|
|
599
638
|
if: '$activeStep === $firstStep()',
|
|
600
639
|
children: 'Contact Us Now for Child Support, Custody and Family Issues',
|
|
601
640
|
attrs: {
|
|
602
|
-
class: 'flex justify-center text-center text-md font-medium text-blue-500 px-3'
|
|
641
|
+
class: 't-flex t-justify-center t-text-center t-text-md t-font-medium t-text-blue-500 t-px-3'
|
|
603
642
|
}
|
|
604
643
|
},
|
|
605
|
-
|
|
606
|
-
$formkit: 'hidden',
|
|
607
|
-
name: "vertical",
|
|
608
|
-
value: "Legal"
|
|
609
|
-
},
|
|
610
|
-
{
|
|
611
|
-
$formkit: 'hidden',
|
|
612
|
-
name: "TCPA_Language",
|
|
613
|
-
value: "$meta.tcpaLanguage"
|
|
614
|
-
},
|
|
615
|
-
{
|
|
616
|
-
$formkit: 'hidden',
|
|
617
|
-
name: "gclid",
|
|
618
|
-
value: null,
|
|
619
|
-
},
|
|
620
|
-
{
|
|
621
|
-
$formkit: 'hidden',
|
|
622
|
-
name: "campaignid",
|
|
623
|
-
value: null,
|
|
624
|
-
},
|
|
625
|
-
{
|
|
626
|
-
$formkit: 'hidden',
|
|
627
|
-
name: "s",
|
|
628
|
-
value: null,
|
|
629
|
-
},
|
|
644
|
+
...hiddenInputs,
|
|
630
645
|
{
|
|
631
646
|
$el: 'div',
|
|
632
647
|
attrs: {
|