bhl-forms 0.2.5 → 0.2.6
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 +18 -9
- package/dist/bhl-forms.iife.js +7 -7
- package/dist/bhl-forms.modern.es.js +18 -9
- package/dist/bhl-forms.modern.iife.js +9 -9
- package/dist/bhl-forms.modern.umd.js +9 -9
- package/dist/bhl-forms.umd.js +7 -7
- package/dist/forms/generalLegalPopUnder.es.js +3 -1
- package/dist/forms/generalLegalPopUnder.iife.js +1 -1
- package/dist/forms/generalLegalPopUnder.json +1 -1
- package/dist/forms/generalLegalPopUnderTF.es.js +3 -1
- package/dist/forms/generalLegalPopUnderTF.iife.js +1 -1
- package/dist/forms/generalLegalPopUnderTF.json +1 -1
- package/dist/forms/mechanics.es.js +28 -27
- package/dist/forms/mechanics.iife.js +1 -1
- package/dist/forms/mechanics.json +1 -1
- package/package.json +2 -2
|
@@ -123,20 +123,25 @@ const hiddenInputsMechanics = [
|
|
|
123
123
|
...hiddenInputsBase
|
|
124
124
|
];
|
|
125
125
|
|
|
126
|
-
|
|
126
|
+
// ------ Common Base Settings
|
|
127
|
+
|
|
128
|
+
const checkbox = (updates) => {
|
|
127
129
|
return merge({
|
|
128
|
-
$formkit: '
|
|
130
|
+
$formkit: 'checkbox',
|
|
129
131
|
validation: 'required',
|
|
130
132
|
validationMessages: {
|
|
131
133
|
required: 'Field is required'
|
|
132
|
-
}
|
|
133
|
-
labelClass: 'required'
|
|
134
|
+
}
|
|
134
135
|
}, updates)
|
|
135
136
|
};
|
|
136
137
|
|
|
137
|
-
const
|
|
138
|
-
updates.
|
|
139
|
-
|
|
138
|
+
const sbsCheckbox = (updates) => {
|
|
139
|
+
updates.legendClass = 'legend-left required';
|
|
140
|
+
updates.fieldsetClass = '$reset side-by-side';
|
|
141
|
+
updates.optionsClass = 't-pl-1';
|
|
142
|
+
updates.innerClass = 't-flex t-items-center';
|
|
143
|
+
updates.wrapperClass = 't-mb-3';
|
|
144
|
+
return checkbox(updates)
|
|
140
145
|
};
|
|
141
146
|
|
|
142
147
|
const textArea = (updates) => {
|
|
@@ -153,6 +158,12 @@ const textArea = (updates) => {
|
|
|
153
158
|
}, updates)
|
|
154
159
|
};
|
|
155
160
|
|
|
161
|
+
const autoInsuranceInterest = () => sbsCheckbox({
|
|
162
|
+
label: "I'm also interested in saving money on my auto insurance",
|
|
163
|
+
name: 'Auto_Insurance_Interest',
|
|
164
|
+
validation: null,
|
|
165
|
+
});
|
|
166
|
+
|
|
156
167
|
const comments = (updates) => textArea(
|
|
157
168
|
merge({
|
|
158
169
|
label: 'Please briefly describe your situation in a few words:',
|
|
@@ -161,20 +172,6 @@ const comments = (updates) => textArea(
|
|
|
161
172
|
}, updates)
|
|
162
173
|
);
|
|
163
174
|
|
|
164
|
-
const zipcode = () => sbsText({
|
|
165
|
-
label: 'Zip Code:',
|
|
166
|
-
placeholder: '#####',
|
|
167
|
-
name: 'Zip',
|
|
168
|
-
maxlength: 5,
|
|
169
|
-
inputmode: "numeric",
|
|
170
|
-
autocomplete: 'postal-code',
|
|
171
|
-
validation: 'required|matches:/^[0-9]{5}$/',
|
|
172
|
-
validationMessages: {
|
|
173
|
-
required: 'Zip Code is required',
|
|
174
|
-
matches: 'Invalid Zip Code'
|
|
175
|
-
}
|
|
176
|
-
});
|
|
177
|
-
|
|
178
175
|
const NEXT_ON_ENTER = '$onEnter($setNextStep($fireStepEvent($get(form)), $preStepFunc($get(form))))';
|
|
179
176
|
const NEXT_ON_INPUT = '$onInput($setNextStep($fireStepEvent($get(form)), $preStepFunc($get(form))))';
|
|
180
177
|
|
|
@@ -240,16 +237,16 @@ function step(name, inputs, nextOnEnter = true, nextOnInput = false) {
|
|
|
240
237
|
)
|
|
241
238
|
}
|
|
242
239
|
|
|
243
|
-
function
|
|
240
|
+
function commentsAndAutoInsuranceInterest(updates = {}) {
|
|
244
241
|
return step(
|
|
245
|
-
'
|
|
242
|
+
'commentsAndAutoInsuranceInterest',
|
|
246
243
|
[
|
|
247
|
-
zipcode(),
|
|
248
244
|
comments({
|
|
249
245
|
label: updates.label || DEFAULT_COMMENTS_LABEL,
|
|
250
246
|
placeholder: updates.placeholder || DEFAULT_COMMENTS_PLACEHOLDER_DYNAMIC,
|
|
251
247
|
inputClass: 't-h-24',
|
|
252
|
-
})
|
|
248
|
+
}),
|
|
249
|
+
autoInsuranceInterest()
|
|
253
250
|
],
|
|
254
251
|
updates.nextOnEnter
|
|
255
252
|
)
|
|
@@ -324,7 +321,11 @@ const schema = [
|
|
|
324
321
|
$cmp: 'FormKit',
|
|
325
322
|
props: formProps({
|
|
326
323
|
formId: 'mechanics',
|
|
327
|
-
|
|
324
|
+
popUnderMap: {
|
|
325
|
+
'properties.Auto_Insurance_Interest': {
|
|
326
|
+
'true': RedirectUrl("answers-now.com", "Auto Insurance"),
|
|
327
|
+
},
|
|
328
|
+
},
|
|
328
329
|
redirectMap: {
|
|
329
330
|
'*': RedirectUrlComments('answers-now.com', 'Mechanics')
|
|
330
331
|
},
|
|
@@ -346,7 +347,7 @@ const schema = [
|
|
|
346
347
|
class: 'form-body'
|
|
347
348
|
},
|
|
348
349
|
children: [
|
|
349
|
-
|
|
350
|
+
commentsAndAutoInsuranceInterest({
|
|
350
351
|
label: 'Please describe your issue in a few words:',
|
|
351
352
|
placeholder: 'Example: "Need help changing my brake pads and rotors"',
|
|
352
353
|
nextOnEnter: false
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var mechanics=function(){"use strict";function e(){return Object.assign({},...arguments)}
|
|
1
|
+
var mechanics=function(){"use strict";function e(){return Object.assign({},...arguments)}function t(e,t){return"https://listings."+e+"/api/v1/redirect?zone_id=4&sub_id=${properties.vid}&category="+encodeURIComponent(t)}const r={type:"form",id:"form",config:{validationVisibility:"submit"},onSubmit:'$submit($submitUrl, $prepData, $handleRedirect, "text/plain; charset=UTF-8")',plugins:"$plugins",actions:!1,anchorElement:"form-anchor",prepop:{fromURL:!0},errorCodes:{403:{message:"An Error Occurred",abort:!1},409:{abort:!1},429:"An Error Occurred",504:{message:"An Error Occurred",abort:!1}},formClass:"!t-max-w-[40rem]"};const n=[{$formkit:"hidden",name:"vertical",value:"Mechanics"},{$formkit:"hidden",name:"gclid",value:null},{$formkit:"hidden",name:"campaignid",value:null},{$formkit:"hidden",name:"s",value:null}],s=t=>(t.legendClass="legend-left required",t.fieldsetClass="$reset side-by-side",t.optionsClass="t-pl-1",t.innerClass="t-flex t-items-center",t.wrapperClass="t-mb-3",(t=>e({$formkit:"checkbox",validation:"required",validationMessages:{required:"Field is required"}},t))(t)),i=t=>(t=>e({$formkit:"textarea",rows:5,maxlength:500,validation:"required",validationMessages:{required:"Field is required"},innerClass:"t-max-w-xl",labelClass:"required"},t))(e({label:"Please briefly describe your situation in a few words:",name:"Comments",placeholder:'For Example: "I would like help with child support payments" or "I need help with visitation rights"'},t)),l="$onEnter($setNextStep($fireStepEvent($get(form)), $preStepFunc($get(form))))",a="$onInput($setNextStep($fireStepEvent($get(form)), $preStepFunc($get(form))))",o=e=>"group"!==e.type&&"section"!==e.type&&"form"!==e.type&&"hidden"!==e.$formkit&&!e.children,c=e=>{if(o(e))return e;for(var t=e.children.length-1;t>=0;t--){if("string"==typeof e.children)continue;const r=e.children[t];if(o(r))return r;const n=c(r);if(n)return n}return null},d=e=>({$el:"section",if:'$stepIsEnabled("'+e+'")',attrs:{style:{if:'$activeStep !== "'+e+'"',then:"display: none;"}}});const u=[e({$el:"div",children:[{$el:"div",attrs:{id:"form-anchor",class:"t-absolute",style:{top:"-30px",left:0}}}],attrs:{class:"t-relative"}},f),{$cmp:"FormKit",props:function(t){return e(r,t)}({formId:"mechanics",popUnderMap:{"properties.Auto_Insurance_Interest":{true:t("answers-now.com","Auto Insurance")}},redirectMap:{"*":(m="answers-now.com",p="Mechanics",t(m,p)+"&Comments=${properties.Comments}")},formClass:"!t-max-w-[36rem]"}),children:[function(t={}){return e(function(e={}){return{$el:"h1",attrs:{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 "+(e.headlineClass||"")}}}(t),t)}({children:'$urlParam("hl", "Have Questions for a Mechanic?")',if:"$activeStep === $firstStep()"}),function(t={}){return e(function(e={}){return{$el:"h3",attrs:{class:"t-flex t-justify-center t-text-center !t-text-[1.2rem] t-font-medium t-text-blue-500 t-px-10 "+(e.subHeadlineClass||"")}}}(t),t)}({children:'$urlParam("shl", "Get Answers Within Minutes!")',if:"$activeStep === $firstStep()"}),...n,{$el:"div",attrs:{class:"form-body"},children:[function(t={}){return function(t,r,n=!0,s=!1){if(void 0===n&&(n=!0),r&&r.length&&(n||s)){const e=c(r[r.length-1]);!0===n&&(e.onKeypress=l),!0===s&&(e.onInput=a)}return e(d(t),{children:[{$formkit:"group",id:t,name:t,children:r}]})}("commentsAndAutoInsuranceInterest",[i({label:t.label||"Please briefly describe your legal issue in a few words:",placeholder:t.placeholder||'$getKey($meta, "commentsPlaceholders." + $get(Type_Of_Legal_Problem).value, $meta.defaultCommentsPlaceholder)',inputClass:"t-h-24"}),s({label:"I'm also interested in saving money on my auto insurance",name:"Auto_Insurance_Interest",validation:null})],t.nextOnEnter)}({label:"Please describe your issue in a few words:",placeholder:'Example: "Need help changing my brake pads and rotors"',nextOnEnter:!1}),{$el:"div",attrs:{class:"step-nav"},children:[{$formkit:"button",name:"hidden_button",children:"Hidden",style:{if:"$activeStep === $firstStep()",then:"visibility: hidden;"}},{$formkit:"submit",name:"submit_button",label:"Chat Now"}]},{$el:"pre",if:'$urlParam("fdbg", "") == 1',children:[{$el:"pre",children:"$stringify( $get(form).value )",attrs:{class:"t-text-xs",style:"overflow: scroll"}},{$el:"pre",children:["activeStep: ","$activeStep"],attrs:{class:"t-text-xs",style:"overflow: scroll"}},{$el:"pre",children:["stepHistory: ","$stepHistory"],attrs:{class:"t-text-xs",style:"overflow: scroll"}},{$el:"pre",children:["stepQueue: ","$stepQueue"],attrs:{class:"t-text-xs",style:"overflow: scroll"}}]}]}]}];var m,p,f;return u}();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
[{"$el":"div","children":[{"$el":"div","attrs":{"id":"form-anchor","class":"t-absolute","style":{"top":"-30px","left":0}}}],"attrs":{"class":"t-relative"}},{"$cmp":"FormKit","props":{"type":"form","id":"form","config":{"validationVisibility":"submit"},"onSubmit":"$submit($submitUrl, $prepData, $handleRedirect, \"text/plain; charset=UTF-8\")","plugins":"$plugins","actions":false,"anchorElement":"form-anchor","prepop":{"fromURL":true},"errorCodes":{"403":{"message":"An Error Occurred","abort":false},"409":{"abort":false},"429":"An Error Occurred","504":{"message":"An Error Occurred","abort":false}},"formClass":"!t-max-w-[36rem]","formId":"mechanics","redirectMap":{"*":"https://listings.answers-now.com/api/v1/redirect?zone_id=4&sub_id=${properties.vid}&category=Mechanics&Comments=${properties.Comments}"}},"children":[{"$el":"h1","attrs":{"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 "},"children":"$urlParam(\"hl\", \"Have Questions for a Mechanic?\")","if":"$activeStep === $firstStep()"},{"$el":"h3","attrs":{"class":"t-flex t-justify-center t-text-center !t-text-[1.2rem] t-font-medium t-text-blue-500 t-px-10 "},"children":"$urlParam(\"shl\", \"Get Answers Within Minutes!\")","if":"$activeStep === $firstStep()"},{"$formkit":"hidden","name":"vertical","value":"Mechanics"},{"$formkit":"hidden","name":"gclid","value":null},{"$formkit":"hidden","name":"campaignid","value":null},{"$formkit":"hidden","name":"s","value":null},{"$el":"div","attrs":{"class":"form-body"},"children":[{"$el":"section","if":"$stepIsEnabled(\"
|
|
1
|
+
[{"$el":"div","children":[{"$el":"div","attrs":{"id":"form-anchor","class":"t-absolute","style":{"top":"-30px","left":0}}}],"attrs":{"class":"t-relative"}},{"$cmp":"FormKit","props":{"type":"form","id":"form","config":{"validationVisibility":"submit"},"onSubmit":"$submit($submitUrl, $prepData, $handleRedirect, \"text/plain; charset=UTF-8\")","plugins":"$plugins","actions":false,"anchorElement":"form-anchor","prepop":{"fromURL":true},"errorCodes":{"403":{"message":"An Error Occurred","abort":false},"409":{"abort":false},"429":"An Error Occurred","504":{"message":"An Error Occurred","abort":false}},"formClass":"!t-max-w-[36rem]","formId":"mechanics","popUnderMap":{"properties.Auto_Insurance_Interest":{"true":"https://listings.answers-now.com/api/v1/redirect?zone_id=4&sub_id=${properties.vid}&category=Auto%20Insurance"}},"redirectMap":{"*":"https://listings.answers-now.com/api/v1/redirect?zone_id=4&sub_id=${properties.vid}&category=Mechanics&Comments=${properties.Comments}"}},"children":[{"$el":"h1","attrs":{"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 "},"children":"$urlParam(\"hl\", \"Have Questions for a Mechanic?\")","if":"$activeStep === $firstStep()"},{"$el":"h3","attrs":{"class":"t-flex t-justify-center t-text-center !t-text-[1.2rem] t-font-medium t-text-blue-500 t-px-10 "},"children":"$urlParam(\"shl\", \"Get Answers Within Minutes!\")","if":"$activeStep === $firstStep()"},{"$formkit":"hidden","name":"vertical","value":"Mechanics"},{"$formkit":"hidden","name":"gclid","value":null},{"$formkit":"hidden","name":"campaignid","value":null},{"$formkit":"hidden","name":"s","value":null},{"$el":"div","attrs":{"class":"form-body"},"children":[{"$el":"section","if":"$stepIsEnabled(\"commentsAndAutoInsuranceInterest\")","attrs":{"style":{"if":"$activeStep !== \"commentsAndAutoInsuranceInterest\"","then":"display: none;"}},"children":[{"$formkit":"group","id":"commentsAndAutoInsuranceInterest","name":"commentsAndAutoInsuranceInterest","children":[{"$formkit":"textarea","rows":5,"maxlength":500,"validation":"required","validationMessages":{"required":"Field is required"},"innerClass":"t-max-w-xl","labelClass":"required","label":"Please describe your issue in a few words:","name":"Comments","placeholder":"Example: \"Need help changing my brake pads and rotors\"","inputClass":"t-h-24"},{"$formkit":"checkbox","validation":null,"validationMessages":{"required":"Field is required"},"label":"I'm also interested in saving money on my auto insurance","name":"Auto_Insurance_Interest","legendClass":"legend-left required","fieldsetClass":"$reset side-by-side","optionsClass":"t-pl-1","innerClass":"t-flex t-items-center","wrapperClass":"t-mb-3"}]}]},{"$el":"div","attrs":{"class":"step-nav"},"children":[{"$formkit":"button","name":"hidden_button","children":"Hidden","style":{"if":"$activeStep === $firstStep()","then":"visibility: hidden;"}},{"$formkit":"submit","name":"submit_button","label":"Chat Now"}]},{"$el":"pre","if":"$urlParam(\"fdbg\", \"\") == 1","children":[{"$el":"pre","children":"$stringify( $get(form).value )","attrs":{"class":"t-text-xs","style":"overflow: scroll"}},{"$el":"pre","children":["activeStep: ","$activeStep"],"attrs":{"class":"t-text-xs","style":"overflow: scroll"}},{"$el":"pre","children":["stepHistory: ","$stepHistory"],"attrs":{"class":"t-text-xs","style":"overflow: scroll"}},{"$el":"pre","children":["stepQueue: ","$stepQueue"],"attrs":{"class":"t-text-xs","style":"overflow: scroll"}}]}]}]}]
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "bhl-forms",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.6",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"@formkit/tailwindcss": "^0.16.4",
|
|
35
35
|
"@formkit/vue": "^0.16.4",
|
|
36
|
-
"formkit-multistep": "^0.3.
|
|
36
|
+
"formkit-multistep": "^0.3.8",
|
|
37
37
|
"vue": "^3.2.16",
|
|
38
38
|
"vue3-datepicker": "^0.3.4"
|
|
39
39
|
},
|