adp-web-components 0.0.45 → 0.0.47
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/Loading-c3489701.js +16 -0
- package/dist/cjs/contact-us-form.cjs.entry.js +352 -0
- package/dist/cjs/dead-stock-lookup_3.cjs.entry.js +4 -4
- package/dist/cjs/dynamic-claim_6.cjs.entry.js +5 -5
- package/dist/cjs/dynamic-redeem.cjs.entry.js +2 -3
- package/dist/cjs/form-input_4.cjs.entry.js +252 -0
- package/dist/cjs/form-structure_2.cjs.entry.js +97 -0
- package/dist/cjs/{index.esm-c628daeb.js → get-local-language-3ae85685.js} +242 -0
- package/dist/cjs/{index-846c93d2.js → index-603d8f32.js} +12 -19
- package/dist/cjs/{Loading-6f4f0127.js → loader-baf2418b.js} +0 -9
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/part-lookup.cjs.entry.js +2 -3
- package/dist/cjs/shift-components.cjs.js +2 -2
- package/dist/cjs/vehicle-lookup.cjs.entry.js +2 -3
- package/dist/collection/collection-manifest.json +7 -2
- package/dist/collection/components/form-elements/form-input.css +1 -0
- package/dist/collection/components/form-elements/form-input.js +342 -0
- package/dist/collection/components/form-elements/form-select.css +1 -0
- package/dist/collection/components/form-elements/form-select.js +397 -0
- package/dist/collection/components/form-elements/form-structure-error.css +1 -0
- package/dist/collection/components/form-elements/form-structure-error.js +72 -0
- package/dist/collection/components/form-elements/form-structure.css +1 -0
- package/dist/collection/components/form-elements/form-structure.js +227 -0
- package/dist/collection/components/form-elements/form-submit.css +1 -0
- package/dist/collection/components/form-elements/form-submit.js +93 -0
- package/dist/collection/components/form-elements/form-text-area.css +1 -0
- package/dist/collection/components/form-elements/form-text-area.js +288 -0
- package/dist/collection/components/forms/contact-us-form.css +1 -0
- package/dist/collection/components/forms/contact-us-form.js +376 -0
- package/dist/collection/components/part-lookup/dead-stock-lookup.js +1 -1
- package/dist/collection/components/part-lookup/distributor-lookup.js +1 -1
- package/dist/collection/components/part-lookup/manufacturer-lookup.js +1 -1
- package/dist/collection/components/vehicle-lookup/dynamic-claim.js +1 -1
- package/dist/collection/components/vehicle-lookup/paint-thickness.js +1 -1
- package/dist/collection/components/vehicle-lookup/service-history.js +1 -1
- package/dist/collection/components/vehicle-lookup/vehicle-accessories.js +1 -1
- package/dist/collection/components/vehicle-lookup/vehicle-specification.js +1 -1
- package/dist/collection/components/vehicle-lookup/warranty-details.js +2 -2
- package/dist/collection/global/api/urls.js +6 -0
- package/dist/collection/global/assets/white-loader.svg +11 -0
- package/dist/collection/global/lib/form-hook.js +25 -14
- package/dist/collection/global/lib/recaptcha.js +25 -0
- package/dist/collection/global/lib/validate-form-structure.js +47 -0
- package/dist/collection/global/types/forms.js +1 -0
- package/dist/collection/global/types/general.js +1 -0
- package/dist/collection/global/types/locales/error-schema.js +1 -0
- package/dist/collection/global/types/locales/forms/contact-us-schema.js +24 -0
- package/dist/collection/global/types/locales/forms/index.js +11 -0
- package/dist/collection/global/types/locales/general.js +8 -0
- package/dist/collection/global/types/locales/index.js +6 -0
- package/dist/collection/global/types/locales/inquiryTypes.js +15 -0
- package/dist/components/{general-inquiry-form.d.ts → contact-us-form.d.ts} +4 -4
- package/dist/components/contact-us-form.js +5 -0
- package/dist/components/dead-stock-lookup.js +1 -1
- package/dist/components/distributor-lookup.js +1 -1
- package/dist/components/dynamic-claim.js +1 -1
- package/dist/components/dynamic-redeem.js +1 -1
- package/dist/components/form-input.js +1 -1
- package/dist/components/form-select.d.ts +11 -0
- package/dist/components/form-select.js +5 -0
- package/dist/components/form-structure-error.d.ts +11 -0
- package/dist/components/form-structure-error.js +5 -0
- package/dist/components/form-structure.d.ts +11 -0
- package/dist/components/form-structure.js +5 -0
- package/dist/components/form-submit.d.ts +11 -0
- package/dist/components/form-submit.js +5 -0
- package/dist/components/form-text-area.d.ts +11 -0
- package/dist/components/form-text-area.js +5 -0
- package/dist/components/index.js +1 -1
- package/dist/components/manufacturer-lookup.js +1 -1
- package/dist/components/{p-64a8e560.js → p-0f15eb0b.js} +1 -1
- package/dist/components/{p-935af250.js → p-14df0c85.js} +1 -1
- package/dist/components/p-176b63e3.js +5 -0
- package/dist/components/{p-9c9f58f9.js → p-21feb9cb.js} +1 -1
- package/dist/components/{p-efd76ea7.js → p-40bb71e4.js} +1 -1
- package/dist/components/p-4bae9c16.js +5 -0
- package/dist/components/{p-467cc8d5.js → p-5d3abb5b.js} +1 -1
- package/dist/components/p-5e1738a6.js +5 -0
- package/dist/components/p-64e16378.js +5 -0
- package/dist/components/p-75476014.js +5 -0
- package/dist/components/{p-a1adf184.js → p-7f889bd6.js} +1 -1
- package/dist/components/{p-9e28d16d.js → p-8db6fbb6.js} +1 -1
- package/dist/components/p-9faefa40.js +5 -0
- package/dist/components/p-b224d16f.js +5 -0
- package/dist/components/p-b901ce51.js +5 -0
- package/dist/components/{p-6a4bffe2.js → p-ce440126.js} +1 -1
- package/dist/components/{p-336607f4.js → p-d70c3cbd.js} +1 -1
- package/dist/components/{p-bc8714c3.js → p-d8a1e55d.js} +1 -1
- package/dist/components/{p-443f6446.js → p-e4ae4434.js} +1 -1
- package/dist/components/paint-thickness.js +1 -1
- package/dist/components/part-lookup.js +1 -1
- package/dist/components/service-history.js +1 -1
- package/dist/components/vehicle-accessories.js +1 -1
- package/dist/components/vehicle-lookup.js +1 -1
- package/dist/components/vehicle-specification.js +1 -1
- package/dist/components/warranty-details.js +1 -1
- package/dist/esm/Loading-3fdd028d.js +14 -0
- package/dist/esm/contact-us-form.entry.js +348 -0
- package/dist/esm/dead-stock-lookup_3.entry.js +4 -4
- package/dist/esm/dynamic-claim_6.entry.js +5 -5
- package/dist/esm/dynamic-redeem.entry.js +2 -3
- package/dist/esm/form-input_4.entry.js +245 -0
- package/dist/esm/form-structure_2.entry.js +92 -0
- package/dist/esm/{index.esm-46e0cdad.js → get-local-language-cd53bfd4.js} +241 -1
- package/dist/esm/{index-33ae6859.js → index-cac905b0.js} +12 -19
- package/dist/esm/{Loading-f4d666ee.js → loader-027b88af.js} +1 -9
- package/dist/esm/loader.js +3 -3
- package/dist/esm/part-lookup.entry.js +2 -3
- package/dist/esm/shift-components.js +3 -3
- package/dist/esm/vehicle-lookup.entry.js +2 -3
- package/dist/locales/ar.json +39 -1
- package/dist/locales/en.json +38 -0
- package/dist/locales/ku.json +39 -1
- package/dist/locales/ru.json +40 -2
- package/dist/shift-components/p-14de3422.entry.js +5 -0
- package/dist/shift-components/p-359ea480.entry.js +5 -0
- package/dist/shift-components/{p-75363a52.entry.js → p-36423afa.entry.js} +1 -1
- package/dist/shift-components/p-65102e7a.js +6 -0
- package/dist/shift-components/p-6cc94857.entry.js +5 -0
- package/dist/shift-components/p-974f9490.entry.js +5 -0
- package/dist/shift-components/p-a21e2e2e.js +5 -0
- package/dist/shift-components/p-b8390527.entry.js +5 -0
- package/dist/shift-components/p-ba46e8f2.entry.js +5 -0
- package/dist/shift-components/p-ecc53648.entry.js +5 -0
- package/dist/shift-components/p-f4b4e9d2.js +5 -0
- package/dist/shift-components/p-fa19695e.js +5 -0
- package/dist/shift-components/shift-components.esm.js +1 -1
- package/dist/types/components/form-elements/form-input.d.ts +24 -0
- package/dist/types/components/form-elements/form-select.d.ts +38 -0
- package/dist/types/components/form-elements/form-structure-error.d.ts +8 -0
- package/dist/types/components/form-elements/form-structure.d.ts +18 -0
- package/dist/types/components/form-elements/form-submit.d.ts +7 -0
- package/dist/types/components/form-elements/form-text-area.d.ts +21 -0
- package/dist/types/components/forms/contact-us-form.d.ts +46 -0
- package/dist/types/components.d.ts +188 -31
- package/dist/types/global/api/urls.d.ts +2 -0
- package/dist/types/global/lib/form-hook.d.ts +1 -30
- package/dist/types/global/lib/recaptcha.d.ts +16 -0
- package/dist/types/global/lib/validate-form-structure.d.ts +3 -0
- package/dist/types/global/types/forms.d.ts +48 -0
- package/dist/types/global/types/general.d.ts +14 -0
- package/dist/types/global/types/locales/error-schema.d.ts +2 -0
- package/dist/types/global/types/locales/forms/contact-us-schema.d.ts +37 -0
- package/dist/types/global/types/locales/forms/index.d.ts +45 -0
- package/dist/types/global/types/locales/general.d.ts +5 -0
- package/dist/types/global/types/locales/index.d.ts +74 -0
- package/dist/types/global/types/locales/inquiryTypes.d.ts +19 -0
- package/package.json +1 -1
- package/dist/cjs/form-input.cjs.entry.js +0 -36
- package/dist/cjs/general-inquiry-form.cjs.entry.js +0 -154
- package/dist/cjs/get-local-language-1ba6d190.js +0 -204
- package/dist/collection/components/form-input/form-input.css +0 -1
- package/dist/collection/components/form-input/form-input.js +0 -209
- package/dist/collection/components/general-inquiry-form/general-inquiry-form.css +0 -1
- package/dist/collection/components/general-inquiry-form/general-inquiry-form.js +0 -46
- package/dist/components/general-inquiry-form.js +0 -5
- package/dist/components/p-83e017fe.js +0 -5
- package/dist/components/p-9c8b634a.js +0 -5
- package/dist/components/p-b2051f01.js +0 -5
- package/dist/components/p-e446fb9d.js +0 -5
- package/dist/esm/form-input.entry.js +0 -32
- package/dist/esm/general-inquiry-form.entry.js +0 -150
- package/dist/esm/get-local-language-42468fce.js +0 -201
- package/dist/shift-components/p-0f0e54c1.js +0 -6
- package/dist/shift-components/p-219fb385.entry.js +0 -5
- package/dist/shift-components/p-33bf409e.entry.js +0 -5
- package/dist/shift-components/p-5ba2e35c.entry.js +0 -5
- package/dist/shift-components/p-6e4e85c0.entry.js +0 -5
- package/dist/shift-components/p-6f356085.js +0 -5
- package/dist/shift-components/p-8f603ea1.entry.js +0 -5
- package/dist/shift-components/p-95532c3e.entry.js +0 -5
- package/dist/shift-components/p-99d314b5.js +0 -5
- package/dist/shift-components/p-e446fb9d.js +0 -5
- package/dist/types/components/form-input/form-input.d.ts +0 -14
- package/dist/types/components/general-inquiry-form/general-inquiry-form.d.ts +0 -21
|
@@ -0,0 +1 @@
|
|
|
1
|
+
*,:after,:before{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: ;border:0 solid #e5e7eb;box-sizing:border-box}::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }/*! tailwindcss v3.4.15 | MIT License | https://tailwindcss.com*/:after,:before{--tw-content:""}:host,html{-webkit-text-size-adjust:100%;font-feature-settings:normal;-webkit-tap-highlight-color:transparent;font-family:ui-sans-serif,system-ui,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;font-variation-settings:normal;line-height:1.5;-moz-tab-size:4;tab-size:4}body{line-height:inherit;margin:0}hr{border-top-width:1px;color:inherit;height:0}abbr:where([title]){text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-feature-settings:normal;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:1em;font-variation-settings:normal}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{border-collapse:collapse;border-color:inherit;text-indent:0}button,input,optgroup,select,textarea{font-feature-settings:inherit;color:inherit;font-family:inherit;font-size:100%;font-variation-settings:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dd,dl,fieldset,figure,h1,h2,h3,h4,h5,h6,hr,p,pre{margin:0}fieldset,legend{padding:0}menu,ol,ul{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::placeholder,textarea::placeholder{color:#9ca3af;opacity:1}[role=button],button{cursor:pointer}:disabled{cursor:default}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{height:auto;max-width:100%}[hidden]:where(:not([hidden=until-found])){display:none}.mx-auto{margin-left:auto;margin-right:auto}.mb-\[24px\]{margin-bottom:24px}.block{display:block}.flex{display:flex}.max-w-\[700px\]{max-width:700px}.flex-col{flex-direction:column}.gap-\[24px\]{gap:24px}.container{width:100%}@media (min-width:640px){.container{max-width:640px}}@media (min-width:768px){.container{max-width:768px}}@media (min-width:1024px){.container{max-width:1024px}}@media (min-width:1280px){.container{max-width:1280px}}@media (min-width:1536px){.container{max-width:1536px}}:host{all:initial!important;display:block}*{font-family:Arial}.contact-us-tiq #container{margin-left:auto;margin-right:auto;max-width:700px}.contact-us-tiq #inputs_wrapper{display:flex;flex-direction:column;gap:24px;margin-bottom:24px}@media (min-width:640px){.contact-us-tiq #inputs_wrapper{display:grid;grid-template-columns:repeat(2,minmax(0,1fr))}}.contact-us-tiq #message{margin-bottom:24px}@media (min-width:640px){.sm\:grid{display:grid}}.static{position:static}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.pointer-events-none{pointer-events:none}.absolute{position:absolute}.relative{position:relative}.bottom-0{bottom:0}.left-0{left:0}.top-0{top:0}.-z-10{z-index:-10}.mb-\[4px\]{margin-bottom:4px}.ms-0\.5{margin-inline-start:.125rem}.inline-flex{display:inline-flex}.h-\[38px\]{height:38px}.w-full{width:100%}.flex-1{flex:1 1 0%}.-translate-y-\[4px\]{--tw-translate-y:-4px}.-translate-y-\[4px\],.translate-y-full{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-y-full{--tw-translate-y:100%}.appearance-none{appearance:none}.items-center{align-items:center}.justify-center{justify-content:center}.rounded-md{border-radius:.375rem}.border{border-width:1px}.\!border-red-500{--tw-border-opacity:1!important;border-color:rgb(239 68 68/var(--tw-border-opacity,1))!important}.px-2{padding-left:.5rem;padding-right:.5rem}.px-\[12px\]{padding-left:12px;padding-right:12px}.py-\[6px\]{padding-bottom:6px;padding-top:6px}.pt-\[1px\]{padding-top:1px}.text-\[12px\]{font-size:12px}.text-red-500{--tw-text-opacity:1;color:rgb(239 68 68/var(--tw-text-opacity,1))}.text-red-600{--tw-text-opacity:1;color:rgb(220 38 38/var(--tw-text-opacity,1))}.opacity-0{opacity:0}.opacity-100{opacity:1}.opacity-75{opacity:.75}.outline-none{outline:2px solid transparent;outline-offset:2px}.transition{transition-duration:.15s;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1)}.duration-300{transition-duration:.3s}.focus\:border-slate-600:focus{--tw-border-opacity:1;border-color:rgb(71 85 105/var(--tw-border-opacity,1))}.focus\:shadow-\[0_0_0_0\.2rem_rgba\(239\2c 68\2c 68\2c 0\.25\)\]:focus{--tw-shadow:0 0 0 0.2rem rgba(239,68,68,.25);--tw-shadow-colored:0 0 0 0.2rem var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.focus\:shadow-\[0_0_0_0\.2rem_rgba\(71\2c 85\2c 105\2c 0\.25\)\]:focus{--tw-shadow:0 0 0 0.2rem rgba(71,85,105,.25);--tw-shadow-colored:0 0 0 0.2rem var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.disabled\:bg-white:disabled{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity,1))}.\[\&\:\:-webkit-inner-spin-button\]\:appearance-none::-webkit-inner-spin-button,.\[\&\:\:-webkit-outer-spin-button\]\:appearance-none::-webkit-outer-spin-button{appearance:none}.pointer-events-auto{pointer-events:auto}.z-\[10\]{z-index:10}.-mt-\[8px\]{margin-top:-8px}.mt-\[8px\]{margin-top:8px}.hidden{display:none}.size-5{height:1.25rem;width:1.25rem}.size-6{height:1.5rem;width:1.5rem}.size-\[22px\]{height:22px;width:22px}.h-\[100px\]{height:100px}.max-h-\[250px\]{max-height:250px}.-translate-y-\[4px\],.-translate-y-full{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.-translate-y-full{--tw-translate-y:-100%}.translate-y-\[38px\]{--tw-translate-y:38px}.rotate-180,.translate-y-\[38px\],.translate-y-full{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.rotate-180{--tw-rotate:180deg}.animate-spin-2s{animation:spin 2s linear infinite}.justify-between{justify-content:space-between}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.bg-slate-200{--tw-bg-opacity:1;background-color:rgb(226 232 240/var(--tw-bg-opacity,1))}.bg-white{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity,1))}.px-4{padding-left:1rem;padding-right:1rem}.py-2{padding-bottom:.5rem;padding-top:.5rem}.text-\[\#9CA3AF\]{--tw-text-opacity:1;color:rgb(156 163 175/var(--tw-text-opacity,1))}.shadow{--tw-shadow:0 1px 3px 0 rgba(0,0,0,.1),0 1px 2px -1px rgba(0,0,0,.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color),0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.transition-all{transition-duration:.15s;transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1)}.transition-colors{transition-duration:.15s;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1)}.transition-opacity{transition-duration:.15s;transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1)}.hover\:bg-slate-100:hover{--tw-bg-opacity:1;background-color:rgb(241 245 249/var(--tw-bg-opacity,1))}.enabled\:border-slate-600:enabled{--tw-border-opacity:1;border-color:rgb(71 85 105/var(--tw-border-opacity,1))}.enabled\:shadow-\[0_0_0_0\.2rem_rgba\(71\2c 85\2c 105\2c 0\.25\)\]:enabled{--tw-shadow:0 0 0 0.2rem rgba(71,85,105,.25);--tw-shadow-colored:0 0 0 0.2rem var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.enabled\:focus\:border-slate-600:focus:enabled{--tw-border-opacity:1;border-color:rgb(71 85 105/var(--tw-border-opacity,1))}.enabled\:focus\:shadow-\[0_0_0_0\.2rem_rgba\(71\2c 85\2c 105\2c 0\.25\)\]:focus:enabled{--tw-shadow:0 0 0 0.2rem rgba(71,85,105,.25);--tw-shadow-colored:0 0 0 0.2rem var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.disabled\:opacity-75:disabled{opacity:.75}.min-h-\[100px\]{min-height:100px}.w-fit{width:fit-content}.rounded-\[8px\]{border-radius:8px}.border-\[\#f2aeb5\]{--tw-border-opacity:1;border-color:rgb(242 174 181/var(--tw-border-opacity,1))}.bg-\[\#f7d7d8\]{--tw-bg-opacity:1;background-color:rgb(247 215 216/var(--tw-bg-opacity,1))}.px-\[16px\]{padding-left:16px;padding-right:16px}.py-\[16px\]{padding-bottom:16px;padding-top:16px}.py-\[8px\]{padding-bottom:8px;padding-top:8px}.text-\[20px\]{font-size:20px}.text-\[\#58151c\]{--tw-text-opacity:1;color:rgb(88 21 28/var(--tw-text-opacity,1))}.size-full{height:100%;width:100%}.-translate-y-full,.translate-y-0{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-y-0{--tw-translate-y:0px}.rounded{border-radius:.25rem}.bg-slate-600{--tw-bg-opacity:1;background-color:rgb(71 85 105/var(--tw-bg-opacity,1))}.bg-slate-700{--tw-bg-opacity:1;background-color:rgb(51 65 85/var(--tw-bg-opacity,1))}.text-white{--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity,1))}.duration-1000{transition-duration:1s}.enabled\:hover\:bg-slate-600:hover:enabled{--tw-bg-opacity:1;background-color:rgb(71 85 105/var(--tw-bg-opacity,1))}.enabled\:active\:bg-slate-800:active:enabled{--tw-bg-opacity:1;background-color:rgb(30 41 59/var(--tw-bg-opacity,1))}.-mt-\[4px\]{margin-top:-4px}.h-\[200px\]{height:200px}.-translate-y-\[10px\]{--tw-translate-y:-10px}.-translate-y-\[10px\],.translate-y-\[calc\(100\%-5px\)\]{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-y-\[calc\(100\%-5px\)\]{--tw-translate-y:calc(100% - 5px)}.resize-none{resize:none}
|
|
@@ -0,0 +1,376 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Built by ShiftSoftware
|
|
3
|
+
* Copyright (c)
|
|
4
|
+
*/
|
|
5
|
+
import { object, string } from "yup";
|
|
6
|
+
import { Host, h } from "@stencil/core";
|
|
7
|
+
import { localeSchema } from "../../global/types/locales/index";
|
|
8
|
+
import cn from "../../global/lib/cn";
|
|
9
|
+
import { FormHook } from "../../global/lib/form-hook";
|
|
10
|
+
import { getLocaleLanguage } from "../../global/lib/get-local-language";
|
|
11
|
+
import { isValidStructure } from "../../global/lib/validate-form-structure";
|
|
12
|
+
import { CITY_ENDPOINT } from "../../global/api/urls";
|
|
13
|
+
const contactUsSchema = object({
|
|
14
|
+
cityId: string(),
|
|
15
|
+
email: string().email('emailAddressNotValid'),
|
|
16
|
+
message: string().required('messageIsRequired'),
|
|
17
|
+
generalTicketType: string().required('inquiryTypeIsRequired'),
|
|
18
|
+
name: string().required('fullNameIsRequired').min(3, 'fullNameMinimum'),
|
|
19
|
+
phone: string()
|
|
20
|
+
.required('phoneNumberIsRequired')
|
|
21
|
+
.transform(value => value.replace(/^0/, ''))
|
|
22
|
+
.matches(/^\d+$/, 'phoneNumberFormatInvalid')
|
|
23
|
+
.length(10, 'phoneNumberFormatInvalid'),
|
|
24
|
+
});
|
|
25
|
+
const formElementMapper = {
|
|
26
|
+
name: 'text',
|
|
27
|
+
email: 'text',
|
|
28
|
+
phone: 'number',
|
|
29
|
+
cityId: 'select',
|
|
30
|
+
message: 'text-area',
|
|
31
|
+
generalTicketType: 'select',
|
|
32
|
+
};
|
|
33
|
+
const formFieldParams = {
|
|
34
|
+
name: {
|
|
35
|
+
label: 'fullName',
|
|
36
|
+
formLocaleName: 'contactUs',
|
|
37
|
+
},
|
|
38
|
+
email: {
|
|
39
|
+
type: 'email',
|
|
40
|
+
label: 'emailAddress',
|
|
41
|
+
formLocaleName: 'contactUs',
|
|
42
|
+
},
|
|
43
|
+
message: {
|
|
44
|
+
label: 'writeAMessage',
|
|
45
|
+
formLocaleName: 'contactUs',
|
|
46
|
+
placeholder: 'leaveUsMessage',
|
|
47
|
+
},
|
|
48
|
+
phone: { inputPreFix: '+964', type: 'number', label: 'phoneNumber', formLocaleName: 'contactUs' },
|
|
49
|
+
cityId: {
|
|
50
|
+
label: 'city',
|
|
51
|
+
placeholder: 'selectCity',
|
|
52
|
+
formLocaleName: 'contactUs',
|
|
53
|
+
fetcher: async (language, signal) => {
|
|
54
|
+
const response = await fetch(CITY_ENDPOINT, { signal, headers: { 'Accept-Language': language } });
|
|
55
|
+
const arrayRes = (await response.json());
|
|
56
|
+
const selectItems = arrayRes.map(item => ({ label: item.Name, value: item.ID }));
|
|
57
|
+
return selectItems;
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
|
+
generalTicketType: {
|
|
61
|
+
label: 'inquiryType',
|
|
62
|
+
formLocaleName: 'contactUs',
|
|
63
|
+
placeholder: 'selectInquiryType',
|
|
64
|
+
fetcher: async (language, _) => {
|
|
65
|
+
const ticketTypes = (await getLocaleLanguage(language)).generalTicketTypes;
|
|
66
|
+
const generalInquiryTypes = [
|
|
67
|
+
{
|
|
68
|
+
value: 'GeneralInquiry',
|
|
69
|
+
label: ticketTypes.GeneralInquiry,
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
value: 'Complaint',
|
|
73
|
+
label: ticketTypes.Complaint,
|
|
74
|
+
},
|
|
75
|
+
];
|
|
76
|
+
return generalInquiryTypes;
|
|
77
|
+
},
|
|
78
|
+
},
|
|
79
|
+
};
|
|
80
|
+
const themes = {
|
|
81
|
+
tiq: '["div#container", ["div#inputs_wrapper", "name", "email", "cityId", "phone", "generalTicketType" ], "message#message",["div#recaptcha_container", "slot"], "submit.Submit"]',
|
|
82
|
+
};
|
|
83
|
+
export class ContactUsForm {
|
|
84
|
+
constructor() {
|
|
85
|
+
this.recaptchaWidget = null;
|
|
86
|
+
this.form = new FormHook(this, contactUsSchema);
|
|
87
|
+
this.theme = undefined;
|
|
88
|
+
this.baseUrl = undefined;
|
|
89
|
+
this.brandId = undefined;
|
|
90
|
+
this.queryString = '';
|
|
91
|
+
this.language = 'en';
|
|
92
|
+
this.errorCallback = undefined;
|
|
93
|
+
this.successCallback = undefined;
|
|
94
|
+
this.structure = '["submit.Submit"]';
|
|
95
|
+
this.loadingChanges = undefined;
|
|
96
|
+
this.recaptchaKey = '6Lehq6IpAAAAAETTDS2Zh60nHIT1a8oVkRtJ2WsA';
|
|
97
|
+
this.isLoading = undefined;
|
|
98
|
+
this.renderControl = {};
|
|
99
|
+
this.structureObject = null;
|
|
100
|
+
this.locale = localeSchema.getDefault();
|
|
101
|
+
}
|
|
102
|
+
async componentWillLoad() {
|
|
103
|
+
let structure;
|
|
104
|
+
if (this.theme && themes[this.theme])
|
|
105
|
+
structure = themes[this.theme];
|
|
106
|
+
else
|
|
107
|
+
structure = this.structure;
|
|
108
|
+
await Promise.all([this.structureValidation(structure), this.changeLanguage(this.language)]);
|
|
109
|
+
}
|
|
110
|
+
async changeLanguage(newLanguage) {
|
|
111
|
+
this.locale = await getLocaleLanguage(newLanguage);
|
|
112
|
+
}
|
|
113
|
+
async onStructureChange(newStructure) {
|
|
114
|
+
await this.structureValidation(newStructure);
|
|
115
|
+
}
|
|
116
|
+
async structureValidation(structureString) {
|
|
117
|
+
this.structureObject = isValidStructure(structureString);
|
|
118
|
+
}
|
|
119
|
+
async componentDidLoad() {
|
|
120
|
+
try {
|
|
121
|
+
if (this.recaptchaKey) {
|
|
122
|
+
const script = document.createElement('script');
|
|
123
|
+
script.src = `https://www.google.com/recaptcha/api.js?render=${this.recaptchaKey}&hl=${this.language}`;
|
|
124
|
+
script.async = true;
|
|
125
|
+
script.defer = true;
|
|
126
|
+
document.head.appendChild(script);
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
catch (error) {
|
|
130
|
+
console.log(error);
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
async formSubmit(formValues) {
|
|
134
|
+
try {
|
|
135
|
+
if (this.loadingChanges)
|
|
136
|
+
this.loadingChanges(true);
|
|
137
|
+
const token = await grecaptcha.execute(this.recaptchaKey, { action: 'submit' });
|
|
138
|
+
const response = await fetch(`${this.baseUrl}?${this.queryString}`, {
|
|
139
|
+
method: 'post',
|
|
140
|
+
body: JSON.stringify(formValues),
|
|
141
|
+
headers: {
|
|
142
|
+
'Brand': this.brandId,
|
|
143
|
+
'Recaptcha-Token': token,
|
|
144
|
+
'Accept-Language': this.language,
|
|
145
|
+
'Content-Type': 'application/json',
|
|
146
|
+
},
|
|
147
|
+
});
|
|
148
|
+
const data = await response.json();
|
|
149
|
+
if (this.successCallback)
|
|
150
|
+
this.successCallback(data);
|
|
151
|
+
}
|
|
152
|
+
catch (error) {
|
|
153
|
+
console.log(error);
|
|
154
|
+
if (this.errorCallback)
|
|
155
|
+
this.errorCallback(error);
|
|
156
|
+
}
|
|
157
|
+
finally {
|
|
158
|
+
if (this.loadingChanges)
|
|
159
|
+
this.loadingChanges(false);
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
render() {
|
|
163
|
+
if (this.structureObject === null)
|
|
164
|
+
return h("form-structure-error", { language: this.language });
|
|
165
|
+
return (h(Host, { class: cn({
|
|
166
|
+
[`contact-us-${this.theme}`]: this.theme,
|
|
167
|
+
}) }, h("form-structure", { form: this.form, language: this.language, isLoading: this.isLoading, formFieldParams: formFieldParams, renderControl: this.renderControl, formElementMapper: formElementMapper, structureObject: this.structureObject }, h("slot", null))));
|
|
168
|
+
}
|
|
169
|
+
static get is() { return "contact-us-form"; }
|
|
170
|
+
static get originalStyleUrls() {
|
|
171
|
+
return {
|
|
172
|
+
"$": ["contact-us-form.css"]
|
|
173
|
+
};
|
|
174
|
+
}
|
|
175
|
+
static get styleUrls() {
|
|
176
|
+
return {
|
|
177
|
+
"$": ["contact-us-form.css"]
|
|
178
|
+
};
|
|
179
|
+
}
|
|
180
|
+
static get properties() {
|
|
181
|
+
return {
|
|
182
|
+
"theme": {
|
|
183
|
+
"type": "string",
|
|
184
|
+
"mutable": false,
|
|
185
|
+
"complexType": {
|
|
186
|
+
"original": "string",
|
|
187
|
+
"resolved": "string",
|
|
188
|
+
"references": {}
|
|
189
|
+
},
|
|
190
|
+
"required": false,
|
|
191
|
+
"optional": false,
|
|
192
|
+
"docs": {
|
|
193
|
+
"tags": [],
|
|
194
|
+
"text": ""
|
|
195
|
+
},
|
|
196
|
+
"attribute": "theme",
|
|
197
|
+
"reflect": false
|
|
198
|
+
},
|
|
199
|
+
"baseUrl": {
|
|
200
|
+
"type": "string",
|
|
201
|
+
"mutable": false,
|
|
202
|
+
"complexType": {
|
|
203
|
+
"original": "string",
|
|
204
|
+
"resolved": "string",
|
|
205
|
+
"references": {}
|
|
206
|
+
},
|
|
207
|
+
"required": false,
|
|
208
|
+
"optional": false,
|
|
209
|
+
"docs": {
|
|
210
|
+
"tags": [],
|
|
211
|
+
"text": ""
|
|
212
|
+
},
|
|
213
|
+
"attribute": "base-url",
|
|
214
|
+
"reflect": false
|
|
215
|
+
},
|
|
216
|
+
"brandId": {
|
|
217
|
+
"type": "string",
|
|
218
|
+
"mutable": false,
|
|
219
|
+
"complexType": {
|
|
220
|
+
"original": "string",
|
|
221
|
+
"resolved": "string",
|
|
222
|
+
"references": {}
|
|
223
|
+
},
|
|
224
|
+
"required": false,
|
|
225
|
+
"optional": false,
|
|
226
|
+
"docs": {
|
|
227
|
+
"tags": [],
|
|
228
|
+
"text": ""
|
|
229
|
+
},
|
|
230
|
+
"attribute": "brand-id",
|
|
231
|
+
"reflect": false
|
|
232
|
+
},
|
|
233
|
+
"queryString": {
|
|
234
|
+
"type": "string",
|
|
235
|
+
"mutable": false,
|
|
236
|
+
"complexType": {
|
|
237
|
+
"original": "string",
|
|
238
|
+
"resolved": "string",
|
|
239
|
+
"references": {}
|
|
240
|
+
},
|
|
241
|
+
"required": false,
|
|
242
|
+
"optional": false,
|
|
243
|
+
"docs": {
|
|
244
|
+
"tags": [],
|
|
245
|
+
"text": ""
|
|
246
|
+
},
|
|
247
|
+
"attribute": "query-string",
|
|
248
|
+
"reflect": false,
|
|
249
|
+
"defaultValue": "''"
|
|
250
|
+
},
|
|
251
|
+
"language": {
|
|
252
|
+
"type": "string",
|
|
253
|
+
"mutable": false,
|
|
254
|
+
"complexType": {
|
|
255
|
+
"original": "LanguageKeys",
|
|
256
|
+
"resolved": "\"ar\" | \"en\" | \"ku\" | \"ru\"",
|
|
257
|
+
"references": {
|
|
258
|
+
"LanguageKeys": {
|
|
259
|
+
"location": "import",
|
|
260
|
+
"path": "~types/locales",
|
|
261
|
+
"id": "src/global/types/locales/index.ts::LanguageKeys"
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
},
|
|
265
|
+
"required": false,
|
|
266
|
+
"optional": false,
|
|
267
|
+
"docs": {
|
|
268
|
+
"tags": [],
|
|
269
|
+
"text": ""
|
|
270
|
+
},
|
|
271
|
+
"attribute": "language",
|
|
272
|
+
"reflect": false,
|
|
273
|
+
"defaultValue": "'en'"
|
|
274
|
+
},
|
|
275
|
+
"errorCallback": {
|
|
276
|
+
"type": "unknown",
|
|
277
|
+
"mutable": false,
|
|
278
|
+
"complexType": {
|
|
279
|
+
"original": "(error: any) => void",
|
|
280
|
+
"resolved": "(error: any) => void",
|
|
281
|
+
"references": {}
|
|
282
|
+
},
|
|
283
|
+
"required": false,
|
|
284
|
+
"optional": false,
|
|
285
|
+
"docs": {
|
|
286
|
+
"tags": [],
|
|
287
|
+
"text": ""
|
|
288
|
+
}
|
|
289
|
+
},
|
|
290
|
+
"successCallback": {
|
|
291
|
+
"type": "unknown",
|
|
292
|
+
"mutable": false,
|
|
293
|
+
"complexType": {
|
|
294
|
+
"original": "(values: any) => void",
|
|
295
|
+
"resolved": "(values: any) => void",
|
|
296
|
+
"references": {}
|
|
297
|
+
},
|
|
298
|
+
"required": false,
|
|
299
|
+
"optional": false,
|
|
300
|
+
"docs": {
|
|
301
|
+
"tags": [],
|
|
302
|
+
"text": ""
|
|
303
|
+
}
|
|
304
|
+
},
|
|
305
|
+
"structure": {
|
|
306
|
+
"type": "string",
|
|
307
|
+
"mutable": false,
|
|
308
|
+
"complexType": {
|
|
309
|
+
"original": "string",
|
|
310
|
+
"resolved": "string",
|
|
311
|
+
"references": {}
|
|
312
|
+
},
|
|
313
|
+
"required": false,
|
|
314
|
+
"optional": false,
|
|
315
|
+
"docs": {
|
|
316
|
+
"tags": [],
|
|
317
|
+
"text": ""
|
|
318
|
+
},
|
|
319
|
+
"attribute": "structure",
|
|
320
|
+
"reflect": false,
|
|
321
|
+
"defaultValue": "'[\"submit.Submit\"]'"
|
|
322
|
+
},
|
|
323
|
+
"loadingChanges": {
|
|
324
|
+
"type": "unknown",
|
|
325
|
+
"mutable": false,
|
|
326
|
+
"complexType": {
|
|
327
|
+
"original": "(loading: boolean) => void",
|
|
328
|
+
"resolved": "(loading: boolean) => void",
|
|
329
|
+
"references": {}
|
|
330
|
+
},
|
|
331
|
+
"required": false,
|
|
332
|
+
"optional": false,
|
|
333
|
+
"docs": {
|
|
334
|
+
"tags": [],
|
|
335
|
+
"text": ""
|
|
336
|
+
}
|
|
337
|
+
},
|
|
338
|
+
"recaptchaKey": {
|
|
339
|
+
"type": "string",
|
|
340
|
+
"mutable": false,
|
|
341
|
+
"complexType": {
|
|
342
|
+
"original": "string",
|
|
343
|
+
"resolved": "string",
|
|
344
|
+
"references": {}
|
|
345
|
+
},
|
|
346
|
+
"required": false,
|
|
347
|
+
"optional": false,
|
|
348
|
+
"docs": {
|
|
349
|
+
"tags": [],
|
|
350
|
+
"text": ""
|
|
351
|
+
},
|
|
352
|
+
"attribute": "recaptcha-key",
|
|
353
|
+
"reflect": false,
|
|
354
|
+
"defaultValue": "'6Lehq6IpAAAAAETTDS2Zh60nHIT1a8oVkRtJ2WsA'"
|
|
355
|
+
}
|
|
356
|
+
};
|
|
357
|
+
}
|
|
358
|
+
static get states() {
|
|
359
|
+
return {
|
|
360
|
+
"isLoading": {},
|
|
361
|
+
"renderControl": {},
|
|
362
|
+
"structureObject": {},
|
|
363
|
+
"locale": {}
|
|
364
|
+
};
|
|
365
|
+
}
|
|
366
|
+
static get elementRef() { return "el"; }
|
|
367
|
+
static get watchers() {
|
|
368
|
+
return [{
|
|
369
|
+
"propName": "language",
|
|
370
|
+
"methodName": "changeLanguage"
|
|
371
|
+
}, {
|
|
372
|
+
"propName": "structure",
|
|
373
|
+
"methodName": "onStructureChange"
|
|
374
|
+
}];
|
|
375
|
+
}
|
|
376
|
+
}
|
|
@@ -314,7 +314,7 @@ export class DeadStockLookup {
|
|
|
314
314
|
"signature": "(message: ErrorKeys) => Promise<void>",
|
|
315
315
|
"parameters": [{
|
|
316
316
|
"name": "message",
|
|
317
|
-
"type": "OptionalKeys<{ wildCard: string; noBaseUrl: string; invalidVin: string; noPartsFound: string; vinNumberRequired: string; partNumberRequired: string; noServiceAvailable: string; wrongResponseFormat: string; requestFailedPleaseTryAgainLater: string; }>",
|
|
317
|
+
"type": "OptionalKeys<{ wildCard: string; noBaseUrl: string; invalidVin: string; noPartsFound: string; vinNumberRequired: string; wrongFormStructure: string; partNumberRequired: string; noServiceAvailable: string; wrongResponseFormat: string; requestFailedPleaseTryAgainLater: string; }>",
|
|
318
318
|
"docs": ""
|
|
319
319
|
}],
|
|
320
320
|
"references": {
|
|
@@ -377,7 +377,7 @@ export class DistributorLookup {
|
|
|
377
377
|
"signature": "(message: ErrorKeys) => Promise<void>",
|
|
378
378
|
"parameters": [{
|
|
379
379
|
"name": "message",
|
|
380
|
-
"type": "OptionalKeys<{ wildCard: string; noBaseUrl: string; invalidVin: string; noPartsFound: string; vinNumberRequired: string; partNumberRequired: string; noServiceAvailable: string; wrongResponseFormat: string; requestFailedPleaseTryAgainLater: string; }>",
|
|
380
|
+
"type": "OptionalKeys<{ wildCard: string; noBaseUrl: string; invalidVin: string; noPartsFound: string; vinNumberRequired: string; wrongFormStructure: string; partNumberRequired: string; noServiceAvailable: string; wrongResponseFormat: string; requestFailedPleaseTryAgainLater: string; }>",
|
|
381
381
|
"docs": ""
|
|
382
382
|
}],
|
|
383
383
|
"references": {
|
|
@@ -375,7 +375,7 @@ export class ManufacturerLookup {
|
|
|
375
375
|
"signature": "(message: ErrorKeys) => Promise<void>",
|
|
376
376
|
"parameters": [{
|
|
377
377
|
"name": "message",
|
|
378
|
-
"type": "OptionalKeys<{ wildCard: string; noBaseUrl: string; invalidVin: string; noPartsFound: string; vinNumberRequired: string; partNumberRequired: string; noServiceAvailable: string; wrongResponseFormat: string; requestFailedPleaseTryAgainLater: string; }>",
|
|
378
|
+
"type": "OptionalKeys<{ wildCard: string; noBaseUrl: string; invalidVin: string; noPartsFound: string; vinNumberRequired: string; wrongFormStructure: string; partNumberRequired: string; noServiceAvailable: string; wrongResponseFormat: string; requestFailedPleaseTryAgainLater: string; }>",
|
|
379
379
|
"docs": ""
|
|
380
380
|
}],
|
|
381
381
|
"references": {
|
|
@@ -536,7 +536,7 @@ export class DynamicClaim {
|
|
|
536
536
|
"signature": "(message: ErrorKeys) => Promise<void>",
|
|
537
537
|
"parameters": [{
|
|
538
538
|
"name": "message",
|
|
539
|
-
"type": "OptionalKeys<{ wildCard: string; noBaseUrl: string; invalidVin: string; noPartsFound: string; vinNumberRequired: string; partNumberRequired: string; noServiceAvailable: string; wrongResponseFormat: string; requestFailedPleaseTryAgainLater: string; }>",
|
|
539
|
+
"type": "OptionalKeys<{ wildCard: string; noBaseUrl: string; invalidVin: string; noPartsFound: string; vinNumberRequired: string; wrongFormStructure: string; partNumberRequired: string; noServiceAvailable: string; wrongResponseFormat: string; requestFailedPleaseTryAgainLater: string; }>",
|
|
540
540
|
"docs": ""
|
|
541
541
|
}],
|
|
542
542
|
"references": {
|
|
@@ -319,7 +319,7 @@ export class PaintThickness {
|
|
|
319
319
|
"signature": "(message: ErrorKeys) => Promise<void>",
|
|
320
320
|
"parameters": [{
|
|
321
321
|
"name": "message",
|
|
322
|
-
"type": "OptionalKeys<{ wildCard: string; noBaseUrl: string; invalidVin: string; noPartsFound: string; vinNumberRequired: string; partNumberRequired: string; noServiceAvailable: string; wrongResponseFormat: string; requestFailedPleaseTryAgainLater: string; }>",
|
|
322
|
+
"type": "OptionalKeys<{ wildCard: string; noBaseUrl: string; invalidVin: string; noPartsFound: string; vinNumberRequired: string; wrongFormStructure: string; partNumberRequired: string; noServiceAvailable: string; wrongResponseFormat: string; requestFailedPleaseTryAgainLater: string; }>",
|
|
323
323
|
"docs": ""
|
|
324
324
|
}],
|
|
325
325
|
"references": {
|
|
@@ -302,7 +302,7 @@ export class ServiceHistory {
|
|
|
302
302
|
"signature": "(message: ErrorKeys) => Promise<void>",
|
|
303
303
|
"parameters": [{
|
|
304
304
|
"name": "message",
|
|
305
|
-
"type": "OptionalKeys<{ wildCard: string; noBaseUrl: string; invalidVin: string; noPartsFound: string; vinNumberRequired: string; partNumberRequired: string; noServiceAvailable: string; wrongResponseFormat: string; requestFailedPleaseTryAgainLater: string; }>",
|
|
305
|
+
"type": "OptionalKeys<{ wildCard: string; noBaseUrl: string; invalidVin: string; noPartsFound: string; vinNumberRequired: string; wrongFormStructure: string; partNumberRequired: string; noServiceAvailable: string; wrongResponseFormat: string; requestFailedPleaseTryAgainLater: string; }>",
|
|
306
306
|
"docs": ""
|
|
307
307
|
}],
|
|
308
308
|
"references": {
|
|
@@ -323,7 +323,7 @@ export class VehicleAccessories {
|
|
|
323
323
|
"signature": "(message: ErrorKeys) => Promise<void>",
|
|
324
324
|
"parameters": [{
|
|
325
325
|
"name": "message",
|
|
326
|
-
"type": "OptionalKeys<{ wildCard: string; noBaseUrl: string; invalidVin: string; noPartsFound: string; vinNumberRequired: string; partNumberRequired: string; noServiceAvailable: string; wrongResponseFormat: string; requestFailedPleaseTryAgainLater: string; }>",
|
|
326
|
+
"type": "OptionalKeys<{ wildCard: string; noBaseUrl: string; invalidVin: string; noPartsFound: string; vinNumberRequired: string; wrongFormStructure: string; partNumberRequired: string; noServiceAvailable: string; wrongResponseFormat: string; requestFailedPleaseTryAgainLater: string; }>",
|
|
327
327
|
"docs": ""
|
|
328
328
|
}],
|
|
329
329
|
"references": {
|
|
@@ -297,7 +297,7 @@ export class VehicleSpecification {
|
|
|
297
297
|
"signature": "(message: ErrorKeys) => Promise<void>",
|
|
298
298
|
"parameters": [{
|
|
299
299
|
"name": "message",
|
|
300
|
-
"type": "OptionalKeys<{ wildCard: string; noBaseUrl: string; invalidVin: string; noPartsFound: string; vinNumberRequired: string; partNumberRequired: string; noServiceAvailable: string; wrongResponseFormat: string; requestFailedPleaseTryAgainLater: string; }>",
|
|
300
|
+
"type": "OptionalKeys<{ wildCard: string; noBaseUrl: string; invalidVin: string; noPartsFound: string; vinNumberRequired: string; wrongFormStructure: string; partNumberRequired: string; noServiceAvailable: string; wrongResponseFormat: string; requestFailedPleaseTryAgainLater: string; }>",
|
|
301
301
|
"docs": ""
|
|
302
302
|
}],
|
|
303
303
|
"references": {
|
|
@@ -193,7 +193,7 @@ export class WarrantyDetails {
|
|
|
193
193
|
}
|
|
194
194
|
render() {
|
|
195
195
|
var _a, _b, _c, _d, _e;
|
|
196
|
-
return (h(Host, { key: '
|
|
196
|
+
return (h(Host, { key: 'a2450072b8322100a2b26fffde2f2368fa6f859e' }, h("div", { key: 'b62fc2c807ee3c7d28d86d247610d79b282bee77', dir: this.locale.direction, class: "min-h-[100px] warranty" }, h("div", { key: '07d047b42d6a2811b09bfb4a679580eae17007e8' }, h(Loading, { key: 'dbc3ab7702d82d35e77360730fb982e862794b29', isLoading: this.state.includes('loading') }), h("div", { key: '290ae621db597035e73f65a856c1bb438cd4b9e7', class: "transition duration-700", style: { transform: this.state.includes('loading') || this.state === 'idle' ? 'scale(0)' : 'scale(1)', opacity: this.state.includes('loading') ? '0' : '1' } }, (this.showSsc || this.showWarranty) && (h("div", { key: '8331397a1da36813069186f23fb40b4189549d27', style: { color: !!this.errorMessage ? 'red' : 'black' }, class: "warranty-vin" }, (_a = this.vehicleInformation) === null || _a === void 0 ? void 0 : _a.vin)), ['error', 'error-loading'].includes(this.state) && (h("div", { key: '0c48f32b6ed6604dad626c32203a30af9107bdae', class: "py-[16px] min-h-[100px] flex items-center" }, h("div", { key: '1ca1709b2e88e66272b1de6f9c32c2b88f444172', class: "px-[16px] py-[8px] border reject-card text-[20px] rounded-[8px] w-fit mx-auto" }, this.locale.errors[this.errorMessage] || this.locale.errors.wildCard))), this.showWarranty && ['data', 'data-loading'].includes(this.state) && (h(CardsContainer, { key: '6c72a9bc36dce8a07de4bb31324160925b99f0f5', locale: this.locale, isAuthorized: (_b = this.vehicleInformation) === null || _b === void 0 ? void 0 : _b.isAuthorized, unInvoicedByBrokerName: this.unInvoicedByBrokerName, warranty: (_c = this.vehicleInformation) === null || _c === void 0 ? void 0 : _c.warranty })), h("div", { key: '1df38bbb43f2068d07be564141d7ad05535a4821', style: Object.assign({}, (this.showRecaptcha ? { height: 'auto', padding: '16px 16px 0px 16px' } : { height: '0px' })), class: "recaptcha-container" }, h("slot", { key: 'c0a13e5c4b8472cec694eb0e3c86ec47126ed17f' })), ['data', 'data-loading'].includes(this.state) && this.recaptchaRes && (h("div", { key: '0538982583473257a4d950bf256c088600515059', class: cn('recaptcha-response', !this.recaptchaRes.hasSSC ? 'success-card' : 'reject-card ') }, this.locale.vehicleLookup.warranty[this.recaptchaRes.message])), this.checkingUnauthorizedSSC && (h("div", { key: 'b124c96b6cb2c04c9e66a26a29408df14658e020', class: "loading-spinner", style: { marginTop: '20px', flexDirection: 'column' } }, h("div", { key: 'c1f047e2cf8cc089ffd68bd973237a418220664d' }, h("strong", { key: 'f99dbf2f323fe499afcd5e4e75a970c40e40503e' }, this.locale.vehicleLookup.warranty.checkingTMC)), h("img", { key: '6232d00679900c7f6625311a3846b0c022b35c53', class: "spin", src: Loader }))), this.showSsc && ['data', 'data-loading'].includes(this.state) && ((_d = this.vehicleInformation) === null || _d === void 0 ? void 0 : _d.ssc) !== null && !!((_e = this.vehicleInformation) === null || _e === void 0 ? void 0 : _e.ssc.length) && (h(SSCTable, { key: '633a617baadedc94ad0aacb5d8db7da6df880258', locale: this.locale, ssc: this.vehicleInformation.ssc })))))));
|
|
197
197
|
}
|
|
198
198
|
static get is() { return "warranty-details"; }
|
|
199
199
|
static get encapsulation() { return "shadow"; }
|
|
@@ -689,7 +689,7 @@ export class WarrantyDetails {
|
|
|
689
689
|
"signature": "(message: ErrorKeys) => Promise<void>",
|
|
690
690
|
"parameters": [{
|
|
691
691
|
"name": "message",
|
|
692
|
-
"type": "OptionalKeys<{ wildCard: string; noBaseUrl: string; invalidVin: string; noPartsFound: string; vinNumberRequired: string; partNumberRequired: string; noServiceAvailable: string; wrongResponseFormat: string; requestFailedPleaseTryAgainLater: string; }>",
|
|
692
|
+
"type": "OptionalKeys<{ wildCard: string; noBaseUrl: string; invalidVin: string; noPartsFound: string; vinNumberRequired: string; wrongFormStructure: string; partNumberRequired: string; noServiceAvailable: string; wrongResponseFormat: string; requestFailedPleaseTryAgainLater: string; }>",
|
|
693
693
|
"docs": ""
|
|
694
694
|
}],
|
|
695
695
|
"references": {
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="white"
|
|
2
|
+
stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-loader">
|
|
3
|
+
<path d="M12 2v4" />
|
|
4
|
+
<path d="m16.2 7.8 2.9-2.9" />
|
|
5
|
+
<path d="M18 12h4" />
|
|
6
|
+
<path d="m16.2 16.2 2.9 2.9" />
|
|
7
|
+
<path d="M12 18v4" />
|
|
8
|
+
<path d="m4.9 19.1 2.9-2.9" />
|
|
9
|
+
<path d="M2 12h4" />
|
|
10
|
+
<path d="m4.9 4.9 2.9 2.9" />
|
|
11
|
+
</svg>
|
|
@@ -10,14 +10,16 @@ export class FormHook {
|
|
|
10
10
|
this.formErrors = {};
|
|
11
11
|
this.getFormErrors = () => this.formErrors;
|
|
12
12
|
this.getValues = () => {
|
|
13
|
-
const
|
|
13
|
+
const formDom = this.context.el.shadowRoot || this.context.el;
|
|
14
|
+
const form = formDom.querySelector('form');
|
|
14
15
|
const formData = new FormData(form);
|
|
15
16
|
const formObject = Object.fromEntries(formData.entries());
|
|
16
17
|
return formObject;
|
|
17
18
|
};
|
|
18
19
|
this.focusFirstInput = (errorFields) => {
|
|
19
20
|
if (errorFields.length) {
|
|
20
|
-
const
|
|
21
|
+
const formDom = this.context.el.shadowRoot || this.context.el;
|
|
22
|
+
const domElements = errorFields.map(field => formDom.querySelector(`*[name="${field.name}"]`)).filter(dom => dom);
|
|
21
23
|
const sortedDomElements = domElements.sort((a, b) => {
|
|
22
24
|
if (a.compareDocumentPosition(b) & Node.DOCUMENT_POSITION_FOLLOWING)
|
|
23
25
|
return -1; // a comes before b
|
|
@@ -35,9 +37,9 @@ export class FormHook {
|
|
|
35
37
|
try {
|
|
36
38
|
this.isSubmitted = true;
|
|
37
39
|
this.context.isLoading = true;
|
|
38
|
-
this.signal({ isError: false });
|
|
40
|
+
this.signal({ isError: false, disabled: true });
|
|
39
41
|
const formObject = this.getValues();
|
|
40
|
-
const values = await this.schemaObject.validate(formObject, { abortEarly: false
|
|
42
|
+
const values = await this.schemaObject.validate(formObject, { abortEarly: false });
|
|
41
43
|
await this.context.formSubmit(values);
|
|
42
44
|
}
|
|
43
45
|
catch (error) {
|
|
@@ -47,12 +49,13 @@ export class FormHook {
|
|
|
47
49
|
error.inner.forEach((element) => {
|
|
48
50
|
if (element.path) {
|
|
49
51
|
this.formErrors[element.path] = element.message;
|
|
50
|
-
if (!errorFields.find(field => field.name === element.path))
|
|
52
|
+
if (!errorFields.find(field => field.name === element.path)) {
|
|
51
53
|
errorFields.push({
|
|
52
54
|
isError: true,
|
|
53
55
|
name: element.path,
|
|
54
56
|
errorMessage: element.message,
|
|
55
57
|
});
|
|
58
|
+
}
|
|
56
59
|
}
|
|
57
60
|
});
|
|
58
61
|
this.signal(errorFields);
|
|
@@ -62,22 +65,30 @@ export class FormHook {
|
|
|
62
65
|
console.error('Unexpected Error:', error);
|
|
63
66
|
}
|
|
64
67
|
finally {
|
|
68
|
+
this.signal({ disabled: false });
|
|
65
69
|
this.context.isLoading = false;
|
|
66
70
|
}
|
|
67
71
|
})();
|
|
68
72
|
};
|
|
69
73
|
this.newController = (name, fieldType) => {
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
74
|
+
const validationDescription = this.schemaObject.describe().fields[name];
|
|
75
|
+
const sharedFields = {
|
|
76
|
+
name,
|
|
77
|
+
fieldType,
|
|
78
|
+
isError: false,
|
|
79
|
+
disabled: false,
|
|
80
|
+
errorMessage: '',
|
|
81
|
+
isRequired: validationDescription === null || validationDescription === void 0 ? void 0 : validationDescription.tests.some(test => test.name === 'required'),
|
|
82
|
+
};
|
|
83
|
+
if (fieldType === 'text' || fieldType === 'number' || fieldType === 'text-area')
|
|
84
|
+
this.subscribedFields[name] = Object.assign(Object.assign({}, sharedFields), { inputChanges: (event) => {
|
|
77
85
|
const value = event.target.value;
|
|
78
86
|
this.onChanges(name, value);
|
|
79
|
-
}
|
|
80
|
-
|
|
87
|
+
} });
|
|
88
|
+
else if (fieldType === 'select')
|
|
89
|
+
this.subscribedFields[name] = Object.assign(Object.assign({}, sharedFields), { inputChanges: (value) => {
|
|
90
|
+
this.onChanges(name, value);
|
|
91
|
+
} });
|
|
81
92
|
return this.subscribedFields[name];
|
|
82
93
|
};
|
|
83
94
|
this.signal = (partialSignal) => {
|