adp-web-components 0.3.13 → 0.3.14
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/cjs/dead-stock-lookup_3.cjs.entry.js +5 -5
- package/dist/cjs/flexible-container.cjs.entry.js +1 -1
- package/dist/cjs/form-checkbox.cjs.entry.js +3 -3
- package/dist/cjs/form-date-picker.cjs.entry.js +1 -1
- package/dist/cjs/form-dialog_13.cjs.entry.js +35 -17
- package/dist/cjs/{form-input-PYkIVe7J.js → form-input-BBY_3Qk7.js} +8 -6
- package/dist/cjs/form-input_7.cjs.entry.js +9 -9
- package/dist/cjs/form-switch.cjs.entry.js +3 -3
- package/dist/cjs/form-time-picker.cjs.entry.js +1 -1
- package/dist/cjs/{functions-Bu1AQDD2.js → functions-DBDDNNNX.js} +4 -10
- package/dist/cjs/general-form.cjs.entry.js +4 -4
- package/dist/cjs/general-inquiry-form.cjs.entry.js +4 -4
- package/dist/cjs/{get-language-from-url-p2OXldYh.js → get-language-from-url-9TyZFCRO.js} +4 -0
- package/dist/cjs/{get-local-language-BR0p0bBg.js → get-local-language-DjRj7WaF.js} +1 -1
- package/dist/cjs/{get-mock-files-Dljv5P4k.js → get-mock-files-Br7Co-Fj.js} +1 -1
- package/dist/cjs/information-table.cjs.entry.js +1 -1
- package/dist/cjs/loading-spinner.cjs.entry.js +1 -1
- package/dist/cjs/manufacturer-part-lookup.cjs.entry.js +3 -3
- package/dist/cjs/part-lookup.cjs.entry.js +2 -2
- package/dist/cjs/service-booking-form.cjs.entry.js +4 -4
- package/dist/cjs/shift-accordion.cjs.entry.js +1 -1
- package/dist/cjs/shift-slider.cjs.entry.js +1 -1
- package/dist/cjs/shift-tab-content.cjs.entry.js +1 -1
- package/dist/cjs/shift-tabs_2.cjs.entry.js +2 -2
- package/dist/cjs/ssc-lookup-form.cjs.entry.js +4 -4
- package/dist/cjs/test-drive-form.cjs.entry.js +4 -4
- package/dist/cjs/{validation-jJwLyk27.js → validation-5ZUxalyW.js} +3 -1
- package/dist/cjs/vehicle-accessories_7.cjs.entry.js +8 -8
- package/dist/cjs/vehicle-lookup.cjs.entry.js +3 -3
- package/dist/cjs/vehicle-quotation-form.cjs.entry.js +3 -3
- package/dist/collection/components/components/flexible-container.css +1 -1
- package/dist/collection/components/components/information-table.css +1 -1
- package/dist/collection/components/components/loading-spinner.css +1 -1
- package/dist/collection/components/components/shift-accordion.css +1 -1
- package/dist/collection/components/components/shift-portal.css +1 -1
- package/dist/collection/components/components/shift-select-dropdown.css +1 -1
- package/dist/collection/components/components/shift-select.css +1 -1
- package/dist/collection/components/components/shift-slider.css +1 -1
- package/dist/collection/components/components/shift-tab-content.css +1 -1
- package/dist/collection/components/components/shift-tabs.css +1 -1
- package/dist/collection/components/form-elements/form-file.js +22 -4
- package/dist/collection/components/form-elements/form-inputs.css +1 -1
- package/dist/collection/components/forms/defaults/validation.js +2 -1
- package/dist/collection/components/part-lookup/dead-stock-lookup.css +1 -1
- package/dist/collection/components/part-lookup/distributor-lookup.css +1 -1
- package/dist/collection/components/part-lookup/manufacturer-lookup.css +1 -1
- package/dist/collection/components/part-lookup/manufacturer-part-lookup.css +1 -1
- package/dist/collection/components/part-lookup/part-lookup.css +1 -1
- package/dist/collection/components/vehicle-lookup/vehicle-accessories.css +1 -1
- package/dist/collection/components/vehicle-lookup/vehicle-claimable-items.css +1 -1
- package/dist/collection/components/vehicle-lookup/vehicle-item-claim-form.css +1 -1
- package/dist/collection/components/vehicle-lookup/vehicle-lookup.css +1 -1
- package/dist/collection/components/vehicle-lookup/vehicle-paint-thickness.css +1 -1
- package/dist/collection/components/vehicle-lookup/vehicle-sale-information.css +1 -1
- package/dist/collection/components/vehicle-lookup/vehicle-service-history.css +1 -1
- package/dist/collection/components/vehicle-lookup/vehicle-specification.css +1 -1
- package/dist/collection/components/vehicle-lookup/vehicle-warranty-details.css +1 -1
- package/dist/collection/features/form-hook/form-hook.js +4 -0
- package/dist/collection/features/form-hook/functions.js +2 -8
- package/dist/collection/features/form-hook/inputs/form-input.js +7 -5
- package/dist/components/dead-stock-lookup.js +1 -1
- package/dist/components/distributor-lookup.js +1 -1
- package/dist/components/flexible-container.js +1 -1
- package/dist/components/form-checkbox.js +1 -1
- package/dist/components/form-date-picker.js +1 -1
- package/dist/components/form-file.js +1 -1
- package/dist/components/form-input-preview.js +1 -1
- package/dist/components/form-input.js +1 -1
- package/dist/components/form-phone-number.js +1 -1
- package/dist/components/form-picker-input.js +1 -1
- package/dist/components/form-select.js +1 -1
- package/dist/components/form-shadow-input.js +1 -1
- package/dist/components/form-stepper-control.js +1 -1
- package/dist/components/form-stepper-submit.js +1 -1
- package/dist/components/form-stepper.js +1 -1
- package/dist/components/form-structure-error.js +1 -1
- package/dist/components/form-structure.js +1 -1
- package/dist/components/form-submit.js +1 -1
- package/dist/components/form-switch.js +1 -1
- package/dist/components/form-text-area.js +1 -1
- package/dist/components/form-time-picker.js +1 -1
- package/dist/components/form-vin-input.js +1 -1
- package/dist/components/general-form.js +1 -1
- package/dist/components/general-inquiry-form.js +1 -1
- package/dist/components/information-table.js +1 -1
- package/dist/components/loading-spinner.js +1 -1
- package/dist/components/manufacturer-lookup.js +1 -1
- package/dist/components/manufacturer-part-lookup.js +1 -1
- package/dist/components/{p-B8g3fLoh.js → p-0Leiluv7.js} +1 -1
- package/dist/components/{p-B42vuL_p.js → p-9zux5VXM.js} +1 -1
- package/dist/components/p-A2T8KqHs.js +5 -0
- package/dist/components/{p-dRP9cgZF.js → p-ABcgwu6F.js} +1 -1
- package/dist/components/{p-CD1XArUc.js → p-B2ZE4oRD.js} +1 -1
- package/dist/components/p-B5T-06-W.js +5 -0
- package/dist/components/{p-DbAAihIH.js → p-B6_q3Jaz.js} +1 -1
- package/dist/components/p-B6gnG2lN.js +5 -0
- package/dist/components/{p-CjByjVT0.js → p-B6ib31CX.js} +1 -1
- package/dist/components/p-BL5YkEz-.js +5 -0
- package/dist/components/{p-BsgLxjfx.js → p-BTfZ7GAi.js} +1 -1
- package/dist/components/{p-Hlqj6HsH.js → p-BUGOUxbr.js} +1 -1
- package/dist/components/{p-D-0CfzDk.js → p-Bu1VjE_4.js} +1 -1
- package/dist/components/p-CCpbwft_.js +5 -0
- package/dist/components/{p-ubqjXh5U.js → p-CH5Rb3vr.js} +1 -1
- package/dist/components/{p-C55Gk63d.js → p-CK3C2jeL.js} +1 -1
- package/dist/components/{p-BNs9PHd8.js → p-CN6RvIb-.js} +1 -1
- package/dist/components/{p-CtyIp56a.js → p-COyo4v_L.js} +1 -1
- package/dist/components/p-CYGQmS-P.js +5 -0
- package/dist/components/{p-ClDpIRF9.js → p-CbL2RmJ1.js} +1 -1
- package/dist/components/{p-BMxw31OW.js → p-CgimfOQ7.js} +1 -1
- package/dist/components/{p-BDHTK4yJ.js → p-CsqoymFO.js} +1 -1
- package/dist/components/{p-BHYsBcpG.js → p-DIMe8nY5.js} +1 -1
- package/dist/components/{p-DNZ31iYw.js → p-DJ66XSRQ.js} +1 -1
- package/dist/components/{p-DJ0awYVE.js → p-DJa_zubh.js} +1 -1
- package/dist/components/p-DQopO8HS.js +5 -0
- package/dist/components/{p-BFAzCUQY.js → p-DTQIIqm5.js} +1 -1
- package/dist/components/p-Dal_X4-W.js +5 -0
- package/dist/components/{p-CMgPnaDZ.js → p-DdUaptEO.js} +1 -1
- package/dist/components/{p-CoAe_PpX.js → p-Dhy4YWgm.js} +1 -1
- package/dist/{shift-components/p-BLdwm9KB.js → components/p-DlJAm0cB.js} +1 -1
- package/dist/components/p-DoGNkDP-.js +5 -0
- package/dist/components/{p-DBErZTaY.js → p-DwJkEi88.js} +1 -1
- package/dist/components/{p-B3Vlmu9F.js → p-SQ4fUegy.js} +1 -1
- package/dist/components/p-WdDnbO6s.js +5 -0
- package/dist/components/{p-Cl-rntc3.js → p-Y2dufCGw.js} +1 -1
- package/dist/components/{p-Dv_BQG7D.js → p-_i2jGDlH.js} +1 -1
- package/dist/components/{p-BjLQXN9e.js → p-emKMuKu4.js} +1 -1
- package/dist/components/p-puPUmTHi.js +5 -0
- package/dist/components/{p-8EOK_QhL.js → p-qYvbkatn.js} +1 -1
- package/dist/components/p-vYuOlXCR.js +5 -0
- package/dist/components/part-lookup.js +1 -1
- package/dist/components/service-booking-form.js +1 -1
- package/dist/components/shift-accordion.js +1 -1
- package/dist/components/shift-portal.js +1 -1
- package/dist/components/shift-select-dropdown.js +1 -1
- package/dist/components/shift-select.js +1 -1
- package/dist/components/shift-slider.js +1 -1
- package/dist/components/shift-tab-content.js +1 -1
- package/dist/components/shift-tabs.js +1 -1
- package/dist/components/ssc-lookup-form.js +1 -1
- package/dist/components/test-drive-form.js +1 -1
- package/dist/components/vehicle-accessories.js +1 -1
- package/dist/components/vehicle-claimable-items.js +1 -1
- package/dist/components/vehicle-item-claim-form.js +1 -1
- package/dist/components/vehicle-lookup.js +1 -1
- package/dist/components/vehicle-paint-thickness.js +1 -1
- package/dist/components/vehicle-quotation-form.js +1 -1
- package/dist/components/vehicle-sale-information.js +1 -1
- package/dist/components/vehicle-service-history.js +1 -1
- package/dist/components/vehicle-specification.js +1 -1
- package/dist/components/vehicle-warranty-details.js +1 -1
- package/dist/esm/dead-stock-lookup_3.entry.js +5 -5
- package/dist/esm/flexible-container.entry.js +1 -1
- package/dist/esm/form-checkbox.entry.js +3 -3
- package/dist/esm/form-date-picker.entry.js +1 -1
- package/dist/esm/form-dialog_13.entry.js +35 -17
- package/dist/esm/{form-input-DAgayhNz.js → form-input-B8SwfkAd.js} +8 -6
- package/dist/esm/form-input_7.entry.js +9 -9
- package/dist/esm/form-switch.entry.js +3 -3
- package/dist/esm/form-time-picker.entry.js +1 -1
- package/dist/esm/{functions-DHzedl_R.js → functions-DG73G3O6.js} +4 -10
- package/dist/esm/general-form.entry.js +4 -4
- package/dist/esm/general-inquiry-form.entry.js +4 -4
- package/dist/esm/{get-language-from-url-U4hZ4dwn.js → get-language-from-url-C1D-aPDq.js} +4 -0
- package/dist/esm/{get-local-language-TRD6vPH7.js → get-local-language-DsJgnZ5L.js} +1 -1
- package/dist/esm/{get-mock-files-K2mWecRb.js → get-mock-files-_k2h1OdV.js} +1 -1
- package/dist/esm/information-table.entry.js +1 -1
- package/dist/esm/loading-spinner.entry.js +1 -1
- package/dist/esm/manufacturer-part-lookup.entry.js +3 -3
- package/dist/esm/part-lookup.entry.js +2 -2
- package/dist/esm/service-booking-form.entry.js +4 -4
- package/dist/esm/shift-accordion.entry.js +1 -1
- package/dist/esm/shift-slider.entry.js +1 -1
- package/dist/esm/shift-tab-content.entry.js +1 -1
- package/dist/esm/shift-tabs_2.entry.js +2 -2
- package/dist/esm/ssc-lookup-form.entry.js +4 -4
- package/dist/esm/test-drive-form.entry.js +4 -4
- package/dist/esm/{validation-oieVWBn1.js → validation-lB1iHxfZ.js} +3 -2
- package/dist/esm/vehicle-accessories_7.entry.js +8 -8
- package/dist/esm/vehicle-lookup.entry.js +3 -3
- package/dist/esm/vehicle-quotation-form.entry.js +3 -3
- package/dist/integration-manifest.json +1 -1
- package/dist/shift-components/{p-fe7ece41.entry.js → p-04b02a2a.entry.js} +1 -1
- package/dist/shift-components/{p-6b82a9b3.entry.js → p-1416551c.entry.js} +1 -1
- package/dist/shift-components/{p-0dd7911f.entry.js → p-2b0e3d27.entry.js} +1 -1
- package/dist/shift-components/p-2f764c75.entry.js +5 -0
- package/dist/shift-components/p-50819229.entry.js +5 -0
- package/dist/shift-components/{p-fa39d151.entry.js → p-56f69d7f.entry.js} +1 -1
- package/dist/shift-components/p-64205a8d.entry.js +5 -0
- package/dist/shift-components/{p-d33c83ac.entry.js → p-6a10c7ff.entry.js} +1 -1
- package/dist/shift-components/{p-10511716.entry.js → p-79faecaa.entry.js} +1 -1
- package/dist/shift-components/{p-981d1f44.entry.js → p-7ff0ea83.entry.js} +1 -1
- package/dist/shift-components/{p-7a41a739.entry.js → p-8387da9d.entry.js} +1 -1
- package/dist/shift-components/{p-22648595.entry.js → p-83a38f2f.entry.js} +1 -1
- package/dist/shift-components/{p-e979caa9.entry.js → p-89853d6c.entry.js} +1 -1
- package/dist/shift-components/p-8e478de8.entry.js +5 -0
- package/dist/shift-components/{p-960fedbb.entry.js → p-9fbdc7fd.entry.js} +1 -1
- package/dist/shift-components/p-C582V9TT.js +5 -0
- package/dist/shift-components/p-CEfxRHUk.js +5 -0
- package/dist/shift-components/{p-rsylYLbj.js → p-C_AHRam8.js} +1 -1
- package/dist/{components/p-CnZZ3ASF.js → shift-components/p-D6ZxBLEm.js} +1 -1
- package/dist/shift-components/p-HI9vdFQP.js +5 -0
- package/dist/shift-components/{p-bc966aa0.entry.js → p-acd9087d.entry.js} +1 -1
- package/dist/shift-components/{p-2f904561.entry.js → p-b4f9de18.entry.js} +1 -1
- package/dist/shift-components/{p-332ebda4.entry.js → p-bd772f48.entry.js} +1 -1
- package/dist/shift-components/{p-a55ceb19.entry.js → p-c3f88c4c.entry.js} +1 -1
- package/dist/shift-components/{p-61ecc144.entry.js → p-cc3bdbd7.entry.js} +1 -1
- package/dist/shift-components/{p-23df4ed2.entry.js → p-d5db4fb4.entry.js} +1 -1
- package/dist/shift-components/{p-3fcb1657.entry.js → p-d73f83a1.entry.js} +1 -1
- package/dist/shift-components/p-e65d8cc3.entry.js +5 -0
- package/dist/shift-components/{p-a4086c90.entry.js → p-f148f0db.entry.js} +1 -1
- package/dist/shift-components/{p-CC1CaPP4.js → p-pUYjpajc.js} +1 -1
- package/dist/shift-components/shift-components.esm.js +1 -1
- package/dist/stencil-docs.json +1 -1
- package/dist/types/components/form-elements/form-file.d.ts +1 -0
- package/dist/types/components/forms/defaults/validation.d.ts +2 -0
- package/package.json +1 -1
- package/dist/components/p-50EIzP4j.js +0 -5
- package/dist/components/p-BDlZ35Dv.js +0 -5
- package/dist/components/p-BcRom3sV.js +0 -5
- package/dist/components/p-BshR1DsJ.js +0 -5
- package/dist/components/p-C24AOawm.js +0 -5
- package/dist/components/p-CK6WFXQF.js +0 -5
- package/dist/components/p-CKrwCtec.js +0 -5
- package/dist/components/p-CLkGfAsm.js +0 -5
- package/dist/components/p-CvcaE6Ss.js +0 -5
- package/dist/components/p-DlG98nFs.js +0 -5
- package/dist/components/p-G9UmKW9m.js +0 -5
- package/dist/components/p-Wv20cFTm.js +0 -5
- package/dist/shift-components/p-031f2ae6.entry.js +0 -5
- package/dist/shift-components/p-0578b913.entry.js +0 -5
- package/dist/shift-components/p-1500556f.entry.js +0 -5
- package/dist/shift-components/p-46e5146f.entry.js +0 -5
- package/dist/shift-components/p-BY1wHcOT.js +0 -5
- package/dist/shift-components/p-BuurMgGN.js +0 -5
- package/dist/shift-components/p-b611f72e.entry.js +0 -5
- package/dist/shift-components/p-yhCrSkom.js +0 -5
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
* Built by ShiftSoftware
|
|
3
3
|
* Copyright (c)
|
|
4
4
|
*/
|
|
5
|
-
import"./p-Cg4V9l26.js";import{e as o,g as e,f as c,l as s}from"./p-BDhR4pDq.js";const l="0.3.
|
|
5
|
+
import"./p-Cg4V9l26.js";import{e as o,g as e,f as c,l as s}from"./p-BDhR4pDq.js";const l="0.3.14",t={"-":["locales/"],errors:["locales/errors/"],forms:["locales/forms/","locales/forms/contactUs/","locales/forms/demo/","locales/forms/testDriveDemo/","locales/forms/vehicleQuotation/"],"forms.contactUs":["locales/forms/contactUs/"],"forms.demo":["locales/forms/demo/"],"forms.testDriveDemo":["locales/forms/testDriveDemo/"],"forms.vehicleQuotation":["locales/forms/vehicleQuotation/"],general:["locales/general/"],generalTicketTypes:["locales/generalTicketTypes/"],"partLookup.deadStock":["locales/partLookup/deadStock/"],partLookup:["locales/partLookup/deadStock/","locales/partLookup/distributor/","locales/partLookup/manufacturer/"],"partLookup.distributor":["locales/partLookup/distributor/"],"partLookup.manufacturer":["locales/partLookup/manufacturer/"],"vehicleLookup.accessories":["locales/vehicleLookup/accessories/"],vehicleLookup:["locales/vehicleLookup/accessories/","locales/vehicleLookup/claimableItems/","locales/vehicleLookup/paintThickness/","locales/vehicleLookup/saleInformation/","locales/vehicleLookup/serviceHistory/","locales/vehicleLookup/specification/","locales/vehicleLookup/warranty/"],"vehicleLookup.claimableItems":["locales/vehicleLookup/claimableItems/"],"vehicleLookup.paintThickness":["locales/vehicleLookup/paintThickness/"],"vehicleLookup.serviceHistory":["locales/vehicleLookup/serviceHistory/"],"vehicleLookup.saleInformation":["locales/vehicleLookup/saleInformation/"],"vehicleLookup.specification":["locales/vehicleLookup/specification/"],"vehicleLookup.warranty":["locales/vehicleLookup/warranty/"],"forms*":["locales/forms/"]},a={};async function r(c){const[s,l]=await Promise.all([n(c,"errors",o),n(c,"-",e)]);return Object.assign({errors:s},l)}async function i(s){const[l,t,a]=await Promise.all([n(s,"errors",o),n(s,"-",e),n(s,"forms*",c)]);return Object.assign(Object.assign(Object.assign({},t),a),l)}async function n(o,e,c){const l=s[o]||s.en,a=t[e];if(!a||!a.length)throw new Error(`Locale file not found for component: ${e}`);if(1===a.length){const o=a[0]+l,e=await f(o);try{c.validateSync(e,{strict:!0,abortEarly:!1})}catch(e){console.error(`Failed to parse locale file: ${o}`),console.error(e)}return e}{const o=a.map((o=>f(o+l))),s=await Promise.all(o),t={};u(e,c.getDefault(),t,l);try{c.validateSync(t,{strict:!0,abortEarly:!1})}catch(o){console.error(`Failed to parse locale file component: ${e}`),console.error(o)}return s}}function p(o){return"object"==typeof o&&null!==o&&!Array.isArray(o)}function u(o,e,c,s){let l=!1;Object.entries(e).forEach((([e,r])=>{if("string"!=typeof r||l){if(p(r)){const l=o+"."+e;if(Object.entries(r).some((([o,e])=>p(e))))c[e]={},u(l,r,c[e],s);else if(t[l]&&t[l].length){const o=t[l][0]+s;a[o]&&(c[e]=a[o])}}}else{if(t[o]){const e=t[o][0]+s;a[e]&&Object.assign(c,a[e])}l=!0}}))}async function f(o){if(a[o])return await a[o];try{const e=fetch(`https://cdn.jsdelivr.net/npm/adp-web-components@${l}/dist/${o}`).then((e=>(e.ok||delete a[o],e.json())));a[o]=e;const c=await e;return a[o]=c,c}catch(e){return delete a[o],{}}}export{n as a,i as b,r as g,l as v}
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
* Built by ShiftSoftware
|
|
3
3
|
* Copyright (c)
|
|
4
4
|
*/
|
|
5
|
-
import{F as o}from"./p-
|
|
5
|
+
import{F as o}from"./p-CEfxRHUk.js";import"./p-BDhR4pDq.js";import{b as i}from"./p-C_AHRam8.js";import{d as l}from"./p-DwFWMVcD.js";const t=async o=>{try{const i=await fetch(`https://api.github.com/gists/${o}`,{headers:{Accept:"application/vnd.github+json"}});if(!i.ok)throw new Error(`GitHub API error: ${i.status} ${i.statusText}`);const l=await i.json(),t=Object.values(l.files).find((o=>null==o?void 0:o.filename.endsWith(".json")));if(!t)throw new Error("No JSON file found in this gist");return function(o){try{let i=o.trim();return i=i.replace(/,\s*([}\]])/g,"$1"),i=i.replace(/([{,]\s*)([A-Za-z_]\w*)\s*:/g,'$1"$2":'),i=i.replace(/'([^'\\]*(?:\\.[^'\\]*)*)'/g,((o,i)=>`"${i.replace(/"/g,'\\"')}"`)),JSON.parse(i)}catch(o){return console.error("Failed to parse loose JSON content:",o.message),null}}(null==t?void 0:t.content)}catch(o){console.error("Error fetching gist JSON:",o.message)}};async function n(o){const i=await fetch(o);if(!i.ok)throw new Error(`HTTP error! status: ${i.status}`);return await i.json()}const e=async(o,l)=>{var t,n,e,d,a;const r=await i(l),v=null===(n=null===(t=o.structure)||void 0===t?void 0:t.data)||void 0===n?void 0:n.localization,c="object"==typeof v&&null!==(d=null!==(e=null==v?void 0:v[l])&&void 0!==e?e:null==v?void 0:v.en)&&void 0!==d?d:{};o.locale=Object.assign(Object.assign({},c),{sharedFormLocales:Object.assign(Object.assign({},r),null==c?void 0:c.sharedFormLocales)}),o.localeLanguage=l,null===(a=o.form)||void 0===a||a.rerender({rerenderAll:!0})},d=async(o,i)=>{var l,t,n,e,d;const a=(null==i?void 0:i.message)||(null===(l=null==i?void 0:i.Message)||void 0===l?void 0:l.Body)||(null===(t=null==i?void 0:i.message)||void 0===t?void 0:t.body)||(null===(d=null===(e=null===(n=o.locale)||void 0===n?void 0:n.sharedFormLocales)||void 0===e?void 0:e.errors)||void 0===d?void 0:d.wildCard)||"";let r=!0;(null==o?void 0:o.errorCallback)&&(r=!!await o.errorCallback(i,a)),r&&(o.errorMessage=a)},a=async(o,i)=>{o.isLoading=i,o.loadingChanges&&o.loadingChanges(i)},r=async(o,i)=>{let l=!0;if(o.successCallback&&(l=!!await o.successCallback(i,o.locale["Form submitted successfully."]||"")),l&&o.form.openDialog(),!o.disableScrollToTop){const i=o.el.shadowRoot||o.el,l=i instanceof ShadowRoot?i.firstElementChild:i;if(l){const o=-100,i=l.getBoundingClientRect().top+window.pageYOffset+o;window.scrollTo({top:Math.max(i,0),behavior:"smooth"})}}},v=async(i,l)=>{var e,d,a,r,v;if(!i.structure)if(i.gistId){const[o]=await Promise.all([t(i.gistId),i.changeLanguage(i.language)]);i.structure=o}else if(i.structureUrl){const[o]=await Promise.all([n(i.structureUrl),i.changeLanguage(i.language)]);i.structure=o}if(i.localeLanguage=i.language,await i.changeLanguage(i.language),!(Object.hasOwn(null===(e=i.structure)||void 0===e?void 0:e.data,"isMobileForm")?null===(a=null===(d=i.structure)||void 0===d?void 0:d.data)||void 0===a?void 0:a.isMobileForm:i.isMobileForm))try{const o=null===(v=null===(r=i.structure)||void 0===r?void 0:r.data)||void 0===v?void 0:v.recaptchaKey;if(o){const l=document.createElement("script");l.src=`https://www.google.com/recaptcha/api.js?render=${o}&hl=${i.language}`,l.async=!0,l.defer=!0,document.head.appendChild(l)}}catch(o){console.log(o)}i.form=new o(i,l)},c=async o=>{if(o.form)return o.form},u=async o=>{if(o.form)return o.form.submit()},s=async(o,i)=>{var l;i&&(null===(l=o.formReadyCallback)||void 0===l||l.call(o))},f=["utm_source","utm_medium","utm_campaign","utm_term","utm_content","gclid","fbclid"],m=o=>{var i;if(null===(i=null==o?void 0:o.data)||void 0===i?void 0:i.disableUTMLog)return{};const l=new URLSearchParams(window.location.search);if("string"==typeof l.get("disable_utm_log")&&"true"===l.get("disable_utm_log"))return{};const t={};return f.forEach((o=>{l.get(o)&&(t[o]=l.get(o))})),t},b={formLanguageChange:e,formErrorHandler:d,handleFormSubmit:u,formLoadingHandler:a,formSuccessHandler:r,formDidLoadHandler:v,formGetFormHandler:c,onFormSubmit:async({context:o,formValues:i,middleware:t,afterSuccess:n})=>{var e,d,a,r,v,c,u,s,f,b,w,j,p,O,h,g,y,S,$,_,F,H,A,E,P,R,D,L,N,T,J,C,M,x,q,B,G,U,V,k,z;try{o.setIsLoading(!0),Object.keys(i).forEach((l=>{o[`${l}-format`]&&(i[l]=o[`${l}-format`])}));const I=!!(null===(d=null===(e=o.structure)||void 0===e?void 0:e.data)||void 0===d?void 0:d.truncatedFields)&&!!(null===(v=Object.keys(null===(r=null===(a=o.structure)||void 0===a?void 0:a.data)||void 0===r?void 0:r.truncatedFields))||void 0===v?void 0:v.length),W={},Z=m(null==o?void 0:o.structure);let K=Object.assign({},i);(null===(u=null===(c=o.structure)||void 0===c?void 0:c.data)||void 0===u?void 0:u.extraPayload)&&(K=Object.assign(Object.assign({},K),null===(f=null===(s=o.structure)||void 0===s?void 0:s.data)||void 0===f?void 0:f.extraPayload)),I&&(K.additionalData=Object.assign({},W)),(null==o?void 0:o.extraPayload)&&(K=Object.assign(Object.assign({},K),null==o?void 0:o.extraPayload)),I&&Object.entries(null===(w=null===(b=o.structure)||void 0===b?void 0:b.data)||void 0===w?void 0:w.truncatedFields).forEach((([o,i])=>{if(Array.isArray(i)){let l="";i.forEach((o=>{l+=K[o.toString()]||o.toString()})),K=Object.assign(Object.assign({},K),{[o]:l})}else if("string"==typeof i&&i)if(o.startsWith("parse date: ")){const t=o.replaceAll("parse date: ","");K[t]=l.parse(K[t],i,new Date)}else if(o.startsWith("format date: ")){const i=o.replaceAll("format date: ","");K[i]=l.formatISO(K[i])}else W[i]=K[o],delete K[o]}));let Q={"Content-Type":"application/json",Brand:null===(p=null===(j=o.structure)||void 0===j?void 0:j.data)||void 0===p?void 0:p.brandId,"Accept-Language":o.localeLanguage||"en"};(null==o?void 0:o.extraHeader)&&(Q=Object.assign(Object.assign({},Q),null==o?void 0:o.extraHeader)),(null===(h=null===(O=o.structure)||void 0===O?void 0:O.data)||void 0===h?void 0:h.extraHeader)&&(Q=Object.assign(Object.assign({},Q),null===(y=null===(g=o.structure)||void 0===g?void 0:g.data)||void 0===y?void 0:y.extraHeader));let X="";if(Object.hasOwn(null===(S=o.structure)||void 0===S?void 0:S.data,"isMobileForm")?null===(_=null===($=o.structure)||void 0===$?void 0:$.data)||void 0===_?void 0:_.isMobileForm:o.isMobileForm){const i=await o.getMobileToken();i.toLowerCase().startsWith("bearer")?(Q.Authorization=i,X=null===(H=null===(F=o.structure)||void 0===F?void 0:F.data)||void 0===H?void 0:H.requestAppUrl):(Q["verification-token"]=i,X=null===(E=null===(A=o.structure)||void 0===A?void 0:A.data)||void 0===E?void 0:E.requestAppCheckUrl)}else if(X=null===(R=null===(P=o.structure)||void 0===P?void 0:P.data)||void 0===R?void 0:R.requestUrl,null===(L=null===(D=o.structure)||void 0===D?void 0:D.data)||void 0===L?void 0:L.recaptchaKey){const i=await grecaptcha.execute(null===(T=null===(N=o.structure)||void 0===N?void 0:N.data)||void 0===T?void 0:T.recaptchaKey,{action:"submit"});Q["Recaptcha-Token"]=i}if(o.isDev&&(X=X.replaceAll("production=true","production=false")),!X)throw new Error("Request endpoint is not configured");const Y=(null===(C=null===(J=o.structure)||void 0===J?void 0:J.data)||void 0===C?void 0:C.requestMethod)||"POST";if(["get","head"].includes(Y.toLowerCase())?Q=Object.assign(Object.assign({},Q),Z):K=Object.assign(Object.assign({},K),Z),t){const o=t(K,Q,X);K=Object.assign({},o.payload),Q=Object.assign({},o.header),X=o.url}await Promise.all(Object.values(o.form.pendingRequests).map((o=>o())));const oo=await fetch(X,Object.assign({headers:Q,method:(null===(x=null===(M=o.structure)||void 0===M?void 0:M.data)||void 0===x?void 0:x.requestMethod)||"POST"},"get"===(null===(G=null===(B=null===(q=o.structure)||void 0===q?void 0:q.data)||void 0===B?void 0:B.requestMethod)||void 0===G?void 0:G.toLowerCase())?{}:{body:JSON.stringify(K)}));if(!oo.ok){let o;if((oo.headers.get("content-type")||"").includes("application/json")){const i=await oo.json().catch((()=>({})));o=null!==(z=null!==(V=null===(U=null==i?void 0:i.message)||void 0===U?void 0:U.body)&&void 0!==V?V:null===(k=null==i?void 0:i.Message)||void 0===k?void 0:k.Body)&&void 0!==z?z:""}else o=await oo.text().catch((()=>""));throw new Error(o)}{const i=await oo.json().catch((()=>({})));n&&await n(K,Q),o.setSuccessCallback(i),setTimeout((()=>{o.form.reset(),o.form.rerender({rerenderForm:!0,rerenderAll:!0})}),100)}}catch(i){console.error(i),o.setErrorCallback(i)}finally{o.setIsLoading(!1)}},formStructureRenderedHandler:s};export{e as a,a as b,d as c,r as d,v as e,b as f,m as g,c as h,u as i,s as j}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Built by ShiftSoftware
|
|
3
|
+
* Copyright (c)
|
|
4
|
+
*/
|
|
5
|
+
import{c as e,a as i,b as a}from"./p-BDhR4pDq.js";import{v as n}from"./p-CUREVASG.js";const r=e=>`${e}-label`,t=e=>`${e}-format`,h=e=>`${e}-require`,s=e=>`${e}-size`,c=e=>`${e}-max`,l=e=>`${e}-upload`,o=e=>`${e}-placeholder`,d=e=>({label:r(e),placeholder:o(e)}),m=e=>`$${e}Required`,w={label:r,format:t,require:h,condition:m,placeholder:o,meta:d,size:s,max:c,upload:l},V=(r={})=>e(Object.assign({name:a().meta(d("name")).when(m("name"),{is:!0,otherwise:e=>e.optional(),then:e=>e.required(h("name")).min(3,t("name"))}),lastName:a().meta(d("lastName")).when(m("lastName"),{is:!0,otherwise:e=>e.optional(),then:e=>e.required(h("lastName")).min(3,t("lastName"))}),message:a().meta(d("message")).when(m("message"),{is:!0,otherwise:e=>e.optional(),then:e=>e.required(h("message")).min(10,t("message"))}),email:a().meta(d("email")).when(m("email"),{is:!0,otherwise:e=>e.optional(),then:e=>e.required(h("email"))}).email(t("email")),vin:a().meta(d("vin")).when(m("vin"),{is:!0,otherwise:e=>e.optional(),then:e=>e.required(h("vin")).test(t("vin"),t("vin"),(e=>n(null==e?void 0:e.toUpperCase())))}),vehicle:a().meta(d("vehicle")).when(w.condition("vehicle"),{is:!0,otherwise:e=>e.optional(),then:e=>e.required(w.require("vehicle"))}),vacancyId:a().meta(d("vacancyId")).when(w.condition("vacancyId"),{is:!0,otherwise:e=>e.optional(),then:e=>e.required(w.require("vacancyId"))}),companyBranchId:a().meta(d("companyBranchId")).when(w.condition("companyBranchId"),{is:!0,otherwise:e=>e.optional(),then:e=>e.required(w.require("companyBranchId"))}),cityId:a().meta(d("cityId")).when(w.condition("cityId"),{is:!0,otherwise:e=>e.optional(),then:e=>e.required(w.require("cityId"))}),date:a().meta(d("date")).when(m("date"),{is:!0,otherwise:e=>e.optional(),then:e=>e.required(h("date"))}),year:a().meta(d("year")).when(m("year"),{is:!0,otherwise:e=>e.optional(),then:e=>e.required(h("year"))}),time:a().meta(d("time")).when(m("time"),{is:!0,otherwise:e=>e.optional(),then:e=>e.required(h("time"))}),currentVehicleBrand:a().meta(d("currentVehicleBrand")).when("ownVehicle",{is:e=>"yes"===e,then:e=>e.required(h("currentVehicleBrand")),otherwise:e=>e.optional()}),currentVehicleModel:a().meta(d("currentVehicleModel")).when(["ownVehicle","currentVehicleBrand"],{is:(e,i)=>"yes"===e&&"Other"!==i,then:e=>e.required(h("currentVehicleModel")),otherwise:e=>e.optional()}),ownVehicle:a().meta(d("ownVehicle")).when(m("ownVehicle"),{is:!0,otherwise:e=>e.optional(),then:e=>e.required(h("ownVehicle"))}),conditionalCurrentVehicleBrand:a().meta(d("currentVehicleBrand")).when("ownVehicle",{is:e=>"yes"===e,then:e=>e.required(h("currentVehicleBrand")),otherwise:e=>e.optional()}),conditionalCurrentVehicleModel:a().meta(d("currentVehicleModel")).when(["ownVehicle","conditionalCurrentVehicleBrand"],{is:(e,i)=>"yes"===e&&"Other"!==i,then:e=>e.required(h("currentVehicleModel")),otherwise:e=>e.optional()}),gender:i().meta(d("gender")).when(m("gender"),{is:!0,otherwise:e=>e.optional(),then:e=>e.required(h("gender"))})},r));export{c as a,t as f,V as g,d as m,h as r,s,l as u,w as y}
|