adp-web-components 0.0.49 → 0.0.52
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 → Loading-bd3bbdba.js} +2 -2
- package/dist/cjs/contact-us-form.cjs.entry.js +93 -5003
- package/dist/cjs/dead-stock-lookup_3.cjs.entry.js +7 -8
- package/dist/cjs/dynamic-claim_6.cjs.entry.js +23 -21
- package/dist/cjs/dynamic-redeem.cjs.entry.js +3 -4
- package/dist/cjs/form-dialog_8.cjs.entry.js +502 -0
- package/dist/cjs/{get-local-language-9c24d981.js → get-local-language-16ab3d1d.js} +2586 -2
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/part-lookup.cjs.entry.js +2 -3
- package/dist/cjs/service-booking-form.cjs.entry.js +208 -0
- package/dist/cjs/shift-components.cjs.js +1 -1
- package/dist/cjs/urls-9077b31c.js +4874 -0
- package/dist/cjs/vehicle-lookup.cjs.entry.js +2 -3
- package/dist/collection/collection-manifest.json +3 -1
- package/dist/collection/components/form-elements/form-dialog.css +1 -1
- package/dist/collection/components/form-elements/form-dialog.js +1 -1
- package/dist/collection/components/form-elements/form-input.css +1 -1
- package/dist/collection/components/form-elements/form-input.js +31 -145
- package/dist/collection/components/form-elements/form-select.css +1 -1
- package/dist/collection/components/form-elements/form-select.js +18 -42
- package/dist/collection/components/form-elements/form-shadow-input.css +1 -0
- package/dist/collection/components/form-elements/form-shadow-input.js +100 -0
- package/dist/collection/components/form-elements/form-structure-error.css +1 -1
- package/dist/collection/components/form-elements/form-structure-error.js +1 -1
- package/dist/collection/components/form-elements/form-structure.css +1 -1
- package/dist/collection/components/form-elements/form-structure.js +83 -59
- package/dist/collection/components/form-elements/form-submit.css +1 -1
- package/dist/collection/components/form-elements/form-submit.js +51 -4
- package/dist/collection/components/form-elements/form-text-area.css +1 -1
- package/dist/collection/components/form-elements/form-text-area.js +27 -102
- package/dist/collection/components/forms/contact-us/element-mapper.js +87 -0
- package/dist/collection/components/forms/contact-us/form.css +1 -1
- package/dist/collection/components/forms/contact-us-form.js +39 -72
- package/dist/collection/components/forms/service-booking/element-mapper.js +87 -0
- package/dist/collection/components/forms/service-booking/form.css +1 -0
- package/dist/collection/components/forms/service-booking/validations.js +19 -0
- package/dist/collection/components/forms/service-booking-form.js +280 -0
- 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/components/SSCTable.js +3 -1
- package/dist/collection/components/vehicle-lookup/warranty-details.css +1 -1
- package/dist/collection/global/lib/form-hook.js +41 -26
- package/dist/collection/global/types/locales/general.js +2 -0
- package/dist/collection/templates/part-lookup/mock-data.js +2 -2
- package/dist/collection/templates/vehicle-lookup/mock-data.js +27 -9
- package/dist/collection/templates/vehicle-lookup/warranty-mock-data.js +27 -9
- package/dist/components/contact-us-form.js +1 -1
- 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-dialog.js +1 -1
- package/dist/components/form-input.js +1 -1
- package/dist/components/form-select.js +1 -1
- package/dist/components/form-shadow-input.d.ts +11 -0
- package/dist/components/form-shadow-input.js +5 -0
- 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-text-area.js +1 -1
- package/dist/components/manufacturer-lookup.js +1 -1
- package/dist/components/p-0290248e.js +5 -0
- package/dist/components/p-1a03137d.js +5 -0
- package/dist/components/{p-a762e41e.js → p-1ee2b770.js} +1 -1
- package/dist/components/p-2ee2e50c.js +5 -0
- package/dist/components/{p-dd2ca9f8.js → p-31c700e3.js} +1 -1
- package/dist/components/{p-cd16aa91.js → p-31e785ef.js} +1 -1
- package/dist/components/p-45b46803.js +5 -0
- package/dist/components/p-47bfe3f2.js +5 -0
- package/dist/components/p-48f1632a.js +5 -0
- package/dist/{shift-components/p-fa19695e.js → components/p-4bb1ff53.js} +1 -1
- package/dist/components/{p-ad293da0.js → p-58c11ee3.js} +1 -1
- package/dist/components/p-59348016.js +5 -0
- package/dist/components/p-5e64dce1.js +5 -0
- package/dist/components/{p-49f54b37.js → p-70b2d76f.js} +1 -1
- package/dist/components/{p-a7c8367b.js → p-7570edef.js} +1 -1
- package/dist/components/p-78a2e4a3.js +5 -0
- package/dist/components/p-88e47a05.js +5 -0
- package/dist/components/p-932ff922.js +5 -0
- package/dist/components/{p-5d3020cf.js → p-a0d7cb3b.js} +1 -1
- package/dist/components/{p-e74a2c29.js → p-f18da100.js} +1 -1
- package/dist/components/p-fb10d3b3.js +5 -0
- package/dist/components/paint-thickness.js +1 -1
- package/dist/components/part-lookup.js +1 -1
- package/dist/components/service-booking-form.d.ts +11 -0
- package/dist/components/service-booking-form.js +5 -0
- 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 → Loading-0e0128f2.js} +1 -1
- package/dist/esm/contact-us-form.entry.js +92 -5002
- package/dist/esm/dead-stock-lookup_3.entry.js +5 -6
- package/dist/esm/dynamic-claim_6.entry.js +7 -5
- package/dist/esm/dynamic-redeem.entry.js +1 -2
- package/dist/esm/form-dialog_8.entry.js +491 -0
- package/dist/esm/{get-local-language-80b87597.js → get-local-language-7b768590.js} +2586 -3
- package/dist/esm/loader.js +1 -1
- package/dist/esm/part-lookup.entry.js +1 -2
- package/dist/esm/service-booking-form.entry.js +204 -0
- package/dist/esm/shift-components.js +1 -1
- package/dist/esm/urls-e22234f9.js +4870 -0
- package/dist/esm/vehicle-lookup.entry.js +1 -2
- package/dist/locales/ar.json +3 -1
- package/dist/locales/en.json +3 -1
- package/dist/locales/ku.json +3 -1
- package/dist/locales/ru.json +3 -1
- package/dist/shift-components/p-16fcb94c.entry.js +5 -0
- package/dist/shift-components/p-22693b71.entry.js +5 -0
- package/dist/shift-components/p-54ed06de.entry.js +5 -0
- package/dist/shift-components/p-635a820a.entry.js +5 -0
- package/dist/shift-components/p-7a9f22c6.js +5 -0
- package/dist/shift-components/p-8b8e58f3.entry.js +5 -0
- package/dist/shift-components/p-8cf903b1.entry.js +5 -0
- package/dist/shift-components/p-932ff922.js +5 -0
- package/dist/shift-components/p-9e786e3f.entry.js +5 -0
- package/dist/shift-components/p-a6f85fc3.js +5 -0
- package/dist/shift-components/p-fa985979.entry.js +5 -0
- package/dist/shift-components/shift-components.esm.js +1 -1
- package/dist/types/components/form-elements/form-input.d.ts +5 -10
- package/dist/types/components/form-elements/form-select.d.ts +3 -4
- package/dist/types/components/form-elements/form-shadow-input.d.ts +9 -0
- package/dist/types/components/form-elements/form-structure.d.ts +8 -4
- package/dist/types/components/form-elements/form-submit.d.ts +5 -0
- package/dist/types/components/form-elements/form-text-area.d.ts +5 -8
- package/dist/types/components/forms/contact-us/element-mapper.d.ts +3 -0
- package/dist/types/components/forms/contact-us-form.d.ts +13 -11
- package/dist/types/components/forms/service-booking/element-mapper.d.ts +3 -0
- package/dist/types/components/forms/service-booking/validations.d.ts +26 -0
- package/dist/types/components/forms/service-booking-form.d.ts +32 -0
- package/dist/types/components.d.ts +82 -46
- package/dist/types/global/lib/form-hook.d.ts +17 -4
- package/dist/types/global/types/forms.d.ts +16 -9
- package/dist/types/global/types/general.d.ts +9 -0
- package/dist/types/global/types/locales/general.d.ts +4 -0
- package/dist/types/global/types/locales/index.d.ts +4 -0
- package/dist/types/global/types/vehicle-information.d.ts +6 -1
- package/package.json +1 -1
- package/dist/cjs/cn-f559f9e5.js +0 -2588
- package/dist/cjs/form-dialog_5.cjs.entry.js +0 -344
- package/dist/cjs/form-structure_2.cjs.entry.js +0 -98
- package/dist/collection/components/forms/contact-us/mapper.js +0 -12
- package/dist/collection/components/forms/contact-us/params.js +0 -72
- package/dist/components/p-15eb8e7b.js +0 -5
- package/dist/components/p-237a7c55.js +0 -5
- package/dist/components/p-2eadbfd5.js +0 -5
- package/dist/components/p-5f7ef1e2.js +0 -5
- package/dist/components/p-7b4a568a.js +0 -5
- package/dist/components/p-b155c713.js +0 -5
- package/dist/components/p-c015f62c.js +0 -5
- package/dist/components/p-c9c50bd5.js +0 -5
- package/dist/components/p-df782441.js +0 -5
- package/dist/components/p-f7ea9714.js +0 -5
- package/dist/components/p-f9be83de.js +0 -5
- package/dist/esm/cn-cc419b94.js +0 -2586
- package/dist/esm/form-dialog_5.entry.js +0 -336
- package/dist/esm/form-structure_2.entry.js +0 -93
- package/dist/shift-components/p-07c08204.entry.js +0 -5
- package/dist/shift-components/p-13d46f3d.entry.js +0 -5
- package/dist/shift-components/p-27c1f365.entry.js +0 -5
- package/dist/shift-components/p-4a717542.entry.js +0 -5
- package/dist/shift-components/p-654aaa7d.entry.js +0 -5
- package/dist/shift-components/p-940585ec.entry.js +0 -5
- package/dist/shift-components/p-98d9e7ab.js +0 -5
- package/dist/shift-components/p-991b3547.js +0 -5
- package/dist/shift-components/p-bff6ab62.entry.js +0 -5
- package/dist/shift-components/p-ea177504.entry.js +0 -5
- package/dist/types/components/forms/contact-us/mapper.d.ts +0 -2
- package/dist/types/components/forms/contact-us/params.d.ts +0 -2
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Built by ShiftSoftware
|
|
3
|
+
* Copyright (c)
|
|
4
|
+
*/
|
|
5
|
+
import { h } from "@stencil/core";
|
|
6
|
+
import { phoneValidator } from "./validations";
|
|
7
|
+
import { getLocaleLanguage } from "../../../global/lib/get-local-language";
|
|
8
|
+
import { CITY_ENDPOINT } from "../../../global/api/urls";
|
|
9
|
+
export const contactUsElements = {
|
|
10
|
+
submit: formContext => {
|
|
11
|
+
return h("form-submit", Object.assign({}, formContext));
|
|
12
|
+
},
|
|
13
|
+
name: ({ form, language, structureElement }) => {
|
|
14
|
+
const { disabled, errorMessage, isError, isRequired, name } = form.getInputState('name');
|
|
15
|
+
const inputParams = {
|
|
16
|
+
name,
|
|
17
|
+
disabled,
|
|
18
|
+
type: 'text',
|
|
19
|
+
placeholder: 'fullName',
|
|
20
|
+
};
|
|
21
|
+
return (h("form-input", { form: form, label: "fullName", isError: isError, language: language, isRequired: isRequired, inputParams: inputParams, formLocaleName: "contactUs", errorMessage: errorMessage, wrapperId: structureElement.id, wrapperClass: structureElement.class }));
|
|
22
|
+
},
|
|
23
|
+
email: ({ form, language, structureElement }) => {
|
|
24
|
+
const { disabled, errorMessage, isError, isRequired, name } = form.getInputState('email');
|
|
25
|
+
const inputParams = {
|
|
26
|
+
name,
|
|
27
|
+
disabled,
|
|
28
|
+
type: 'email',
|
|
29
|
+
placeholder: 'emailAddress',
|
|
30
|
+
};
|
|
31
|
+
return (h("form-input", { form: form, isError: isError, language: language, label: "emailAddress", isRequired: isRequired, inputParams: inputParams, formLocaleName: "contactUs", errorMessage: errorMessage, wrapperId: structureElement.id, wrapperClass: structureElement.class }));
|
|
32
|
+
},
|
|
33
|
+
phone: ({ form, language, structureElement }) => {
|
|
34
|
+
const { disabled, errorMessage, isError, isRequired, name } = form.getInputState('phone');
|
|
35
|
+
const inputParams = {
|
|
36
|
+
name,
|
|
37
|
+
disabled,
|
|
38
|
+
type: 'text',
|
|
39
|
+
placeholder: 'phoneNumber',
|
|
40
|
+
defaultValue: phoneValidator.default,
|
|
41
|
+
onInput: (event) => {
|
|
42
|
+
const target = event.target;
|
|
43
|
+
phoneValidator.reset();
|
|
44
|
+
target.value = phoneValidator.input(target.value);
|
|
45
|
+
},
|
|
46
|
+
};
|
|
47
|
+
return (h("form-input", { form: form, numberDirection: true, isError: isError, language: language, label: "phoneNumber", isRequired: isRequired, inputParams: inputParams, formLocaleName: "contactUs", errorMessage: errorMessage, wrapperId: structureElement.id, wrapperClass: structureElement.class }));
|
|
48
|
+
},
|
|
49
|
+
message: ({ form, language, structureElement }) => {
|
|
50
|
+
const { disabled, errorMessage, isError, isRequired, name } = form.getInputState('message');
|
|
51
|
+
const inputParams = {
|
|
52
|
+
name,
|
|
53
|
+
disabled,
|
|
54
|
+
type: 'email',
|
|
55
|
+
placeholder: 'leaveUsMessage',
|
|
56
|
+
};
|
|
57
|
+
return (h("form-text-area", { form: form, isError: isError, language: language, label: "writeAMessage", isRequired: isRequired, inputParams: inputParams, formLocaleName: "contactUs", errorMessage: errorMessage, wrapperId: structureElement.id, wrapperClass: structureElement.class }));
|
|
58
|
+
},
|
|
59
|
+
generalTicketType: ({ form, language, structureElement }) => {
|
|
60
|
+
const { disabled, errorMessage, isError, isRequired, name } = form.getInputState('generalTicketType');
|
|
61
|
+
const fetcher = async (language, _) => {
|
|
62
|
+
const ticketTypes = (await getLocaleLanguage(language)).generalTicketTypes;
|
|
63
|
+
const generalInquiryTypes = [
|
|
64
|
+
{
|
|
65
|
+
value: 'GeneralInquiry',
|
|
66
|
+
label: ticketTypes.GeneralInquiry,
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
value: 'Complaint',
|
|
70
|
+
label: ticketTypes.Complaint,
|
|
71
|
+
},
|
|
72
|
+
];
|
|
73
|
+
return generalInquiryTypes;
|
|
74
|
+
};
|
|
75
|
+
return (h("form-select", { name: name, form: form, fetcher: fetcher, isError: isError, disabled: disabled, language: language, label: "inquiryType", isRequired: isRequired, formLocaleName: "contactUs", errorMessage: errorMessage, placeholder: "selectInquiryType", wrapperId: structureElement.id, wrapperClass: structureElement.class }));
|
|
76
|
+
},
|
|
77
|
+
cityId: ({ form, language, structureElement }) => {
|
|
78
|
+
const { disabled, errorMessage, isError, isRequired, name } = form.getInputState('cityId');
|
|
79
|
+
const fetcher = async (language, signal) => {
|
|
80
|
+
const response = await fetch(CITY_ENDPOINT, { signal, headers: { 'Accept-Language': language } });
|
|
81
|
+
const arrayRes = (await response.json());
|
|
82
|
+
const selectItems = arrayRes.map(item => ({ label: item.Name, value: item.ID }));
|
|
83
|
+
return selectItems;
|
|
84
|
+
};
|
|
85
|
+
return (h("form-select", { name: name, form: form, label: "city", fetcher: fetcher, isError: isError, disabled: disabled, language: language, isRequired: isRequired, placeholder: "selectCity", formLocaleName: "contactUs", errorMessage: errorMessage, wrapperId: structureElement.id, wrapperClass: structureElement.class }));
|
|
86
|
+
},
|
|
87
|
+
};
|
|
@@ -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}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Built by ShiftSoftware
|
|
3
|
+
* Copyright (c)
|
|
4
|
+
*/
|
|
5
|
+
import { AsYouType } from "libphonenumber-js";
|
|
6
|
+
import { object, string } from "yup";
|
|
7
|
+
export const phoneValidator = new AsYouType('IQ');
|
|
8
|
+
phoneValidator.default = '+' + phoneValidator.metadata.numberingPlan.metadata[0];
|
|
9
|
+
phoneValidator.input(phoneValidator.default);
|
|
10
|
+
export const contactUsSchema = object({
|
|
11
|
+
cityId: string(),
|
|
12
|
+
email: string().email('emailAddressNotValid'),
|
|
13
|
+
message: string().required('messageIsRequired'),
|
|
14
|
+
generalTicketType: string().required('inquiryTypeIsRequired'),
|
|
15
|
+
name: string().required('fullNameIsRequired').min(3, 'fullNameMinimum'),
|
|
16
|
+
phone: string()
|
|
17
|
+
.required('phoneNumberIsRequired')
|
|
18
|
+
.test('libphonenumber-validation', 'phoneNumberFormatInvalid', () => phoneValidator.isValid()),
|
|
19
|
+
});
|
|
@@ -0,0 +1,280 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Built by ShiftSoftware
|
|
3
|
+
* Copyright (c)
|
|
4
|
+
*/
|
|
5
|
+
import { Host, h } from "@stencil/core";
|
|
6
|
+
import cn from "../../global/lib/cn";
|
|
7
|
+
import { FormHook } from "../../global/lib/form-hook";
|
|
8
|
+
import { contactUsSchema } from "./service-booking/validations";
|
|
9
|
+
import themes from "./service-booking/themes.json";
|
|
10
|
+
import { contactUsElements } from "./service-booking/element-mapper";
|
|
11
|
+
export class ContactUsForm {
|
|
12
|
+
constructor() {
|
|
13
|
+
this.recaptchaWidget = null;
|
|
14
|
+
this.form = new FormHook(this, contactUsSchema);
|
|
15
|
+
this.theme = undefined;
|
|
16
|
+
this.baseUrl = undefined;
|
|
17
|
+
this.brandId = undefined;
|
|
18
|
+
this.queryString = '';
|
|
19
|
+
this.language = 'en';
|
|
20
|
+
this.structure = '["submit.Submit"]';
|
|
21
|
+
this.recaptchaKey = '6Lehq6IpAAAAAETTDS2Zh60nHIT1a8oVkRtJ2WsA';
|
|
22
|
+
this.errorCallback = undefined;
|
|
23
|
+
this.successCallback = undefined;
|
|
24
|
+
this.loadingChanges = undefined;
|
|
25
|
+
this.isLoading = undefined;
|
|
26
|
+
this.renderControl = {};
|
|
27
|
+
this.errorMessage = undefined;
|
|
28
|
+
}
|
|
29
|
+
async componentDidLoad() {
|
|
30
|
+
try {
|
|
31
|
+
if (this.recaptchaKey) {
|
|
32
|
+
const script = document.createElement('script');
|
|
33
|
+
script.src = `https://www.google.com/recaptcha/api.js?render=${this.recaptchaKey}&hl=${this.language}`;
|
|
34
|
+
script.async = true;
|
|
35
|
+
script.defer = true;
|
|
36
|
+
document.head.appendChild(script);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
catch (error) {
|
|
40
|
+
console.log(error);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
async formSubmit(formValues) {
|
|
44
|
+
try {
|
|
45
|
+
if (this.loadingChanges)
|
|
46
|
+
this.loadingChanges(true);
|
|
47
|
+
const token = await grecaptcha.execute(this.recaptchaKey, { action: 'submit' });
|
|
48
|
+
const response = await fetch(`${this.baseUrl}?${this.queryString}`, {
|
|
49
|
+
method: 'post',
|
|
50
|
+
body: JSON.stringify(formValues),
|
|
51
|
+
headers: {
|
|
52
|
+
'Brand': this.brandId,
|
|
53
|
+
'Recaptcha-Token': token,
|
|
54
|
+
'Accept-Language': this.language,
|
|
55
|
+
'Content-Type': 'application/json',
|
|
56
|
+
},
|
|
57
|
+
});
|
|
58
|
+
const data = await response.json();
|
|
59
|
+
if (this.successCallback)
|
|
60
|
+
this.successCallback(data);
|
|
61
|
+
this.form.successAnimation();
|
|
62
|
+
setTimeout(() => {
|
|
63
|
+
this.form.reset();
|
|
64
|
+
}, 1000);
|
|
65
|
+
}
|
|
66
|
+
catch (error) {
|
|
67
|
+
console.error(error);
|
|
68
|
+
if (this.errorCallback)
|
|
69
|
+
this.errorCallback(error);
|
|
70
|
+
if (error === null || error === void 0 ? void 0 : error.message)
|
|
71
|
+
this.errorMessage = error.message;
|
|
72
|
+
}
|
|
73
|
+
finally {
|
|
74
|
+
if (this.loadingChanges)
|
|
75
|
+
this.loadingChanges(false);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
render() {
|
|
79
|
+
return (h(Host, { key: 'b72461b8191c770943b6c10313c951099a3df2e7', class: cn({
|
|
80
|
+
[`contact-us-${this.theme}`]: this.theme,
|
|
81
|
+
}) }, h("form-structure", { key: '1f1a7918f216566aa87856aec06e0bfe337f1453', themes: themes, form: this.form, theme: this.theme, language: this.language, isLoading: this.isLoading, errorMessage: this.errorMessage, renderControl: this.renderControl, formElementMapper: contactUsElements }, h("slot", { key: '7e0019db452ff4da29e9081f477872dfa3b0cf1a' }))));
|
|
82
|
+
}
|
|
83
|
+
static get is() { return "service-booking-form"; }
|
|
84
|
+
static get originalStyleUrls() {
|
|
85
|
+
return {
|
|
86
|
+
"$": ["service-booking/form.css"]
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
static get styleUrls() {
|
|
90
|
+
return {
|
|
91
|
+
"$": ["service-booking/form.css"]
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
static get properties() {
|
|
95
|
+
return {
|
|
96
|
+
"theme": {
|
|
97
|
+
"type": "string",
|
|
98
|
+
"mutable": false,
|
|
99
|
+
"complexType": {
|
|
100
|
+
"original": "string",
|
|
101
|
+
"resolved": "string",
|
|
102
|
+
"references": {}
|
|
103
|
+
},
|
|
104
|
+
"required": false,
|
|
105
|
+
"optional": false,
|
|
106
|
+
"docs": {
|
|
107
|
+
"tags": [],
|
|
108
|
+
"text": ""
|
|
109
|
+
},
|
|
110
|
+
"attribute": "theme",
|
|
111
|
+
"reflect": false
|
|
112
|
+
},
|
|
113
|
+
"baseUrl": {
|
|
114
|
+
"type": "string",
|
|
115
|
+
"mutable": false,
|
|
116
|
+
"complexType": {
|
|
117
|
+
"original": "string",
|
|
118
|
+
"resolved": "string",
|
|
119
|
+
"references": {}
|
|
120
|
+
},
|
|
121
|
+
"required": false,
|
|
122
|
+
"optional": false,
|
|
123
|
+
"docs": {
|
|
124
|
+
"tags": [],
|
|
125
|
+
"text": ""
|
|
126
|
+
},
|
|
127
|
+
"attribute": "base-url",
|
|
128
|
+
"reflect": false
|
|
129
|
+
},
|
|
130
|
+
"brandId": {
|
|
131
|
+
"type": "string",
|
|
132
|
+
"mutable": false,
|
|
133
|
+
"complexType": {
|
|
134
|
+
"original": "string",
|
|
135
|
+
"resolved": "string",
|
|
136
|
+
"references": {}
|
|
137
|
+
},
|
|
138
|
+
"required": false,
|
|
139
|
+
"optional": false,
|
|
140
|
+
"docs": {
|
|
141
|
+
"tags": [],
|
|
142
|
+
"text": ""
|
|
143
|
+
},
|
|
144
|
+
"attribute": "brand-id",
|
|
145
|
+
"reflect": false
|
|
146
|
+
},
|
|
147
|
+
"queryString": {
|
|
148
|
+
"type": "string",
|
|
149
|
+
"mutable": false,
|
|
150
|
+
"complexType": {
|
|
151
|
+
"original": "string",
|
|
152
|
+
"resolved": "string",
|
|
153
|
+
"references": {}
|
|
154
|
+
},
|
|
155
|
+
"required": false,
|
|
156
|
+
"optional": false,
|
|
157
|
+
"docs": {
|
|
158
|
+
"tags": [],
|
|
159
|
+
"text": ""
|
|
160
|
+
},
|
|
161
|
+
"attribute": "query-string",
|
|
162
|
+
"reflect": false,
|
|
163
|
+
"defaultValue": "''"
|
|
164
|
+
},
|
|
165
|
+
"language": {
|
|
166
|
+
"type": "string",
|
|
167
|
+
"mutable": false,
|
|
168
|
+
"complexType": {
|
|
169
|
+
"original": "LanguageKeys",
|
|
170
|
+
"resolved": "\"ar\" | \"en\" | \"ku\" | \"ru\"",
|
|
171
|
+
"references": {
|
|
172
|
+
"LanguageKeys": {
|
|
173
|
+
"location": "import",
|
|
174
|
+
"path": "~types/locales",
|
|
175
|
+
"id": "src/global/types/locales/index.ts::LanguageKeys"
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
},
|
|
179
|
+
"required": false,
|
|
180
|
+
"optional": false,
|
|
181
|
+
"docs": {
|
|
182
|
+
"tags": [],
|
|
183
|
+
"text": ""
|
|
184
|
+
},
|
|
185
|
+
"attribute": "language",
|
|
186
|
+
"reflect": false,
|
|
187
|
+
"defaultValue": "'en'"
|
|
188
|
+
},
|
|
189
|
+
"structure": {
|
|
190
|
+
"type": "string",
|
|
191
|
+
"mutable": false,
|
|
192
|
+
"complexType": {
|
|
193
|
+
"original": "string",
|
|
194
|
+
"resolved": "string",
|
|
195
|
+
"references": {}
|
|
196
|
+
},
|
|
197
|
+
"required": false,
|
|
198
|
+
"optional": false,
|
|
199
|
+
"docs": {
|
|
200
|
+
"tags": [],
|
|
201
|
+
"text": ""
|
|
202
|
+
},
|
|
203
|
+
"attribute": "structure",
|
|
204
|
+
"reflect": false,
|
|
205
|
+
"defaultValue": "'[\"submit.Submit\"]'"
|
|
206
|
+
},
|
|
207
|
+
"recaptchaKey": {
|
|
208
|
+
"type": "string",
|
|
209
|
+
"mutable": false,
|
|
210
|
+
"complexType": {
|
|
211
|
+
"original": "string",
|
|
212
|
+
"resolved": "string",
|
|
213
|
+
"references": {}
|
|
214
|
+
},
|
|
215
|
+
"required": false,
|
|
216
|
+
"optional": false,
|
|
217
|
+
"docs": {
|
|
218
|
+
"tags": [],
|
|
219
|
+
"text": ""
|
|
220
|
+
},
|
|
221
|
+
"attribute": "recaptcha-key",
|
|
222
|
+
"reflect": false,
|
|
223
|
+
"defaultValue": "'6Lehq6IpAAAAAETTDS2Zh60nHIT1a8oVkRtJ2WsA'"
|
|
224
|
+
},
|
|
225
|
+
"errorCallback": {
|
|
226
|
+
"type": "unknown",
|
|
227
|
+
"mutable": false,
|
|
228
|
+
"complexType": {
|
|
229
|
+
"original": "(error: any) => void",
|
|
230
|
+
"resolved": "(error: any) => void",
|
|
231
|
+
"references": {}
|
|
232
|
+
},
|
|
233
|
+
"required": false,
|
|
234
|
+
"optional": false,
|
|
235
|
+
"docs": {
|
|
236
|
+
"tags": [],
|
|
237
|
+
"text": ""
|
|
238
|
+
}
|
|
239
|
+
},
|
|
240
|
+
"successCallback": {
|
|
241
|
+
"type": "unknown",
|
|
242
|
+
"mutable": false,
|
|
243
|
+
"complexType": {
|
|
244
|
+
"original": "(values: any) => void",
|
|
245
|
+
"resolved": "(values: any) => void",
|
|
246
|
+
"references": {}
|
|
247
|
+
},
|
|
248
|
+
"required": false,
|
|
249
|
+
"optional": false,
|
|
250
|
+
"docs": {
|
|
251
|
+
"tags": [],
|
|
252
|
+
"text": ""
|
|
253
|
+
}
|
|
254
|
+
},
|
|
255
|
+
"loadingChanges": {
|
|
256
|
+
"type": "unknown",
|
|
257
|
+
"mutable": false,
|
|
258
|
+
"complexType": {
|
|
259
|
+
"original": "(loading: boolean) => void",
|
|
260
|
+
"resolved": "(loading: boolean) => void",
|
|
261
|
+
"references": {}
|
|
262
|
+
},
|
|
263
|
+
"required": false,
|
|
264
|
+
"optional": false,
|
|
265
|
+
"docs": {
|
|
266
|
+
"tags": [],
|
|
267
|
+
"text": ""
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
};
|
|
271
|
+
}
|
|
272
|
+
static get states() {
|
|
273
|
+
return {
|
|
274
|
+
"isLoading": {},
|
|
275
|
+
"renderControl": {},
|
|
276
|
+
"errorMessage": {}
|
|
277
|
+
};
|
|
278
|
+
}
|
|
279
|
+
static get elementRef() { return "el"; }
|
|
280
|
+
}
|
|
@@ -137,7 +137,7 @@ export class DistributorLookup {
|
|
|
137
137
|
const displayDistributer = this.partInformation
|
|
138
138
|
? !this.partInformation.stockParts.some(({ quantityLookUpResult }) => quantityLookUpResult === 'LookupIsSkipped' || quantityLookUpResult === 'QuantityNotWithinLookupThreshold')
|
|
139
139
|
: false;
|
|
140
|
-
return (h(Host, null, h("div", { dir: this.locale.direction, class: "min-h-[100px] relative transition-all duration-300 overflow-hidden" }, h("div", null, h(Loading, { isLoading: this.state.includes('loading') }), h("div", { class: cn('transition-all duration-700', { 'scale-0': this.state.includes('loading') || this.state === 'idle', 'opacity-0': this.state.includes('loading') }) }, ['error', 'error-loading'].includes(this.state) && (h("div", { class: "py-[16px] min-h-[100px] flex items-center" }, h("div", { 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))), ['data', 'data-loading'].includes(this.state) && (h("div", null, h("div", { class: "flex mt-[12px] max-h-[70dvh] overflow-hidden rounded-[4px] flex-col border border-[#d6d8dc]" }, h("div", { class: "w-full h-[40px] flex shrink-0 justify-center text-[18px] items-center text-[#383c43] text-center bg-[#e1e3e5]" }, texts.info), h("div", { class: "py-[10px] px-[30px] flex flex-col gap-[15px]" }, h("div", { class: "grid grid-cols-3 gap-[50px]" }, displayedFields.map(({ label, value, values, key }) => (h("div", { key: key, class: "flex flex-col flex-1" }, h("strong", { class: "py-[10px] px-0 border-b-[gray] border-b" }, label), values ? (h("div", null, values.map(x => (h("span", { key: x.header + x.body, class: "inline-flex items-center bg-red-50 text-red-800 text-sm font-medium px-3 py-1 me-1 mt-2 rounded-lg border border-red-300" }, x.header && h("span", { class: "font-semibold" }, x.header, ":"), h("span", { class: "ml-1" }, x.body)))))) : (h("div", { class: "py-[10px] px-0" }, value)))))))), displayDistributer && (h("div", { class: "flex mt-[12px] max-h-[70dvh] overflow-hidden rounded-[4px] flex-col border border-[#d6d8dc]" }, h("div", { class: "w-full h-[40px] flex shrink-0 justify-center text-[18px] items-center text-[#383c43] text-center bg-[#e1e3e5]" }, texts.distributorStock), h("div", { class: "flex flex-col gap-[15px]" }, h("table", { class: "w-full overflow-auto relative border-collapse" }, h("thead", { class: "top-0 font-bold sticky bg-white" }, h("tr", null, [texts.location, texts.availability].map(title => (h("th", { key: title, class: "px-[10px] py-[20px] text-center whitespace-nowrap border-b border-[#d6d8dc]" }, title))))), h("tbody", null, (_a = this.partInformation) === null || _a === void 0 ? void 0 : _a.stockParts.map(stock => (h("tr", { class: "transition-colors duration-100 border-b border-[#d6d8dc] last:border-none hover:bg-slate-100", key: stock.locationID }, h("td", { class: cn('px-[10px] py-[20px] text-center whitespace-nowrap') }, stock.locationName), h("td", { class: cn('px-[10px] py-[20px] text-center whitespace-nowrap') }, h("div", { class: cn('text-[red]', {
|
|
140
|
+
return (h(Host, null, h("div", { dir: this.locale.direction, class: "min-h-[100px] relative transition-all duration-300 overflow-hidden" }, h("div", null, h(Loading, { isLoading: this.state.includes('loading') }), h("div", { class: cn('transition-all duration-700', { 'scale-0': this.state.includes('loading') || this.state === 'idle', 'opacity-0': this.state.includes('loading') }) }, ['error', 'error-loading'].includes(this.state) && (h("div", { class: "py-[16px] min-h-[100px] flex items-center" }, h("div", { 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))), ['data', 'data-loading'].includes(this.state) && (h("div", null, h("div", { class: "flex mt-[12px] max-h-[70dvh] overflow-hidden rounded-[4px] flex-col border border-[#d6d8dc]" }, h("div", { class: "w-full h-[40px] flex shrink-0 justify-center text-[18px] items-center text-[#383c43] text-center bg-[#e1e3e5]" }, texts.info), h("div", { class: "py-[10px] px-[30px] flex flex-col gap-[15px]" }, h("div", { class: "grid grid-cols-3 gap-[50px]" }, displayedFields.map(({ label, value, values, key }) => (h("div", { key: key, class: "flex flex-col flex-1" }, h("strong", { class: "py-[10px] px-0 border-b-[gray] border-b" }, label), values ? (h("div", null, values.filter(x => x.body).map(x => (h("span", { key: x.header + x.body, class: "inline-flex items-center bg-red-50 text-red-800 text-sm font-medium px-3 py-1 me-1 mt-2 rounded-lg border border-red-300" }, x.header && h("span", { class: "font-semibold" }, x.header, ":"), h("span", { class: "ml-1" }, x.body)))))) : (h("div", { class: "py-[10px] px-0" }, value)))))))), displayDistributer && (h("div", { class: "flex mt-[12px] max-h-[70dvh] overflow-hidden rounded-[4px] flex-col border border-[#d6d8dc]" }, h("div", { class: "w-full h-[40px] flex shrink-0 justify-center text-[18px] items-center text-[#383c43] text-center bg-[#e1e3e5]" }, texts.distributorStock), h("div", { class: "flex flex-col gap-[15px]" }, h("table", { class: "w-full overflow-auto relative border-collapse" }, h("thead", { class: "top-0 font-bold sticky bg-white" }, h("tr", null, [texts.location, texts.availability].map(title => (h("th", { key: title, class: "px-[10px] py-[20px] text-center whitespace-nowrap border-b border-[#d6d8dc]" }, title))))), h("tbody", null, (_a = this.partInformation) === null || _a === void 0 ? void 0 : _a.stockParts.map(stock => (h("tr", { class: "transition-colors duration-100 border-b border-[#d6d8dc] last:border-none hover:bg-slate-100", key: stock.locationID }, h("td", { class: cn('px-[10px] py-[20px] text-center whitespace-nowrap') }, stock.locationName), h("td", { class: cn('px-[10px] py-[20px] text-center whitespace-nowrap') }, h("div", { class: cn('text-[red]', {
|
|
141
141
|
'text-[green]': stock.quantityLookUpResult === 'Available',
|
|
142
142
|
'text-[orange]': stock.quantityLookUpResult === 'PartiallyAvailable',
|
|
143
143
|
}) }, h("strong", null, stock.quantityLookUpResult === 'Available'
|
|
@@ -124,7 +124,7 @@ export class ManufacturerLookup {
|
|
|
124
124
|
]
|
|
125
125
|
: [];
|
|
126
126
|
const displayedManufacturerData = manufacturerData.filter(part => !hiddenFields.includes(part.key));
|
|
127
|
-
return (h(Host, null, h("div", { dir: this.locale.direction, class: "min-h-[100px] relative transition-all duration-300 overflow-hidden" }, h("div", null, h(Loading, { isLoading: this.state.includes('loading') }), h("div", { class: cn('transition-all duration-700', { 'scale-0': this.state.includes('loading') || this.state === 'idle', 'opacity-0': this.state.includes('loading') }) }, ['error', 'error-loading'].includes(this.state) && (h("div", { class: "py-[16px] min-h-[100px] flex items-center" }, h("div", { 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))), ['data', 'data-loading'].includes(this.state) && (h("div", null, h("div", { class: "flex mt-[12px] overflow-hidden rounded-[4px] flex-col border border-[#d6d8dc]" }, h("div", { class: "w-full h-[40px] flex shrink-0 justify-center text-[18px] items-center text-[#383c43] text-center bg-[#e1e3e5]" }, this.headerTitle), h("div", { class: "px-[30px] py-[10px] flex flex-col gap-[15px]" }, h("div", { class: "grid grid-cols-3 gap-[50px]" }, displayedManufacturerData.map(({ label, value, values, key }) => (h("div", { key: key, class: "flex flex-col flex-1" }, h("strong", { class: "py-[10px] px-0 border-b-[gray] border-b" }, label), values ? (h("div", null, values.map(x => (h("span", { key: x.header + x.body, class: "inline-flex items-center bg-red-50 text-red-800 text-sm font-medium px-3 py-1 me-1 mt-2 rounded-lg border border-red-300" }, x.header && h("span", { class: "font-semibold" }, x.header, ":"), h("span", { class: "ml-1" }, x.body)))))) : (h("div", { class: "py-[10px] px-0" }, value)))))))))))))));
|
|
127
|
+
return (h(Host, null, h("div", { dir: this.locale.direction, class: "min-h-[100px] relative transition-all duration-300 overflow-hidden" }, h("div", null, h(Loading, { isLoading: this.state.includes('loading') }), h("div", { class: cn('transition-all duration-700', { 'scale-0': this.state.includes('loading') || this.state === 'idle', 'opacity-0': this.state.includes('loading') }) }, ['error', 'error-loading'].includes(this.state) && (h("div", { class: "py-[16px] min-h-[100px] flex items-center" }, h("div", { 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))), ['data', 'data-loading'].includes(this.state) && (h("div", null, h("div", { class: "flex mt-[12px] overflow-hidden rounded-[4px] flex-col border border-[#d6d8dc]" }, h("div", { class: "w-full h-[40px] flex shrink-0 justify-center text-[18px] items-center text-[#383c43] text-center bg-[#e1e3e5]" }, this.headerTitle), h("div", { class: "px-[30px] py-[10px] flex flex-col gap-[15px]" }, h("div", { class: "grid grid-cols-3 gap-[50px]" }, displayedManufacturerData.map(({ label, value, values, key }) => (h("div", { key: key, class: "flex flex-col flex-1" }, h("strong", { class: "py-[10px] px-0 border-b-[gray] border-b" }, label), values ? (h("div", null, values.filter(x => x.body).map(x => (h("span", { key: x.header + x.body, class: "inline-flex items-center bg-red-50 text-red-800 text-sm font-medium px-3 py-1 me-1 mt-2 rounded-lg border border-red-300" }, x.header && h("span", { class: "font-semibold" }, x.header, ":"), h("span", { class: "ml-1" }, x.body)))))) : (h("div", { class: "py-[10px] px-0" }, value)))))))))))))));
|
|
128
128
|
}
|
|
129
129
|
static get is() { return "manufacturer-lookup"; }
|
|
130
130
|
static get encapsulation() { return "shadow"; }
|
|
@@ -8,7 +8,9 @@ import CheckIcon from "../assets/check.svg";
|
|
|
8
8
|
export default function SSCTable({ ssc, locale }) {
|
|
9
9
|
const warrantyLocale = locale.vehicleLookup.warranty;
|
|
10
10
|
return (h("div", { class: "wrapper-table" }, h("div", { class: "header" }, warrantyLocale.sscCampings), h("div", { class: "ssc-table-container" }, h("table", { class: "ssc-table" }, h("thead", null, h("tr", null, h("th", null, warrantyLocale.sscTableCode), h("th", null, warrantyLocale.sscTableDescription), h("th", null, warrantyLocale.sscTableRepairStatus), h("th", null, warrantyLocale.sscTableOPCode), h("th", null, warrantyLocale.sscTablePartNumber))), h("tbody", null, ssc.map(sscItem => (h("tr", { class: "transition", key: sscItem.sscCode }, h("td", null, sscItem.sscCode), h("td", null, sscItem.description), h("td", null, h("div", { class: "table-cell-container" }, h("img", { class: "table-status-icon", src: sscItem.repaired ? CheckIcon : XIcon }), " ", sscItem === null || sscItem === void 0 ? void 0 :
|
|
11
|
-
sscItem.repairDate)), h("td", null,
|
|
11
|
+
sscItem.repairDate)), h("td", null, h("div", { class: "table-cell-container table-cell-labors-container" }, !!sscItem.labors.length
|
|
12
|
+
? sscItem.labors.map(labor => (h("div", { key: labor.laborCode, class: 'success' }, labor.laborCode)))
|
|
13
|
+
: '...')), h("td", null, h("div", { class: "table-cell-container table-cell-parts-container" }, !!sscItem.parts.length
|
|
12
14
|
? sscItem.parts.map(part => (h("div", { key: part.partNumber, class: part.isAvailable ? 'success' : 'reject' }, part.partNumber)))
|
|
13
15
|
: '...'))))))))));
|
|
14
16
|
}
|
|
@@ -1 +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}.collapse{visibility:collapse}.absolute{left:0;position:absolute;top:0}.relative{position:relative}.sticky{position:sticky}.mx-auto{margin-left:auto;margin-right:auto}.mt-4{margin-top:1rem}.block{display:block}.flex{display:flex}.grid{display:grid}.hidden{display:none}.h-0{height:0!important;height:0}.flex-shrink{flex-shrink:1}.border-collapse{border-collapse:collapse}.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))}.flex-wrap{flex-wrap:wrap}.border{border-width:1px}.pb-3{padding-bottom:.75rem}.pb-4{padding-bottom:1rem}.pr-1{padding-right:4px}.pt-3{padding-top:.75rem}.pt-4{padding-top:1rem}.font-semibold{font-weight:600}.transition{transition:all;transition-duration:.3s;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-1000{transition-duration:1s}.duration-500{transition-duration:.5s}.duration-700{transition-duration:.7s}.ease-in{transition-timing-function:cubic-bezier(.4,0,1,1)}.success-card{background:#d0e7de;background-color:#d0e7de;border-color:#a2d0bb!important;border-color:#a2d0bb;color:#0b3521}.reject-card{background:#f7d7d8;background-color:#f7d7d8;border-color:#f2aeb5!important;border-color:#f2aeb5;color:#58151c}:host{all:initial!important;display:block}*{font-family:Arial}@keyframes spin{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}.fade-in{animation:fadeIn .3s ease-in forwards;opacity:0}@keyframes fadeOut{0%{opacity:1}to{opacity:0}}.fade-out{animation:fadeIn .3s ease-in forwards;opacity:1}.spin{animation:spin 2s linear infinite}.loading-spinner{align-items:center;display:flex;height:100%;justify-content:center;pointer-events:none;transition:all;transition-duration:.1s;width:100%}.loading-spinner img{height:40px;width:40px}.warranty{overflow:hidden;position:relative;transition:all;transition-duration:.3s}.hide{opacity:0}.card{border:1px solid;border-radius:6px;flex-shrink:0;gap:8px;padding:8px 12px}.card,.card p{align-items:center;display:flex}.card p{flex:1 1 0%;font-size:16px;height:25px;margin:0;padding-left:50px}.card p.no-padding{padding-left:4px}.card img{height:25px;width:25px}.recaptcha-response{border:1px solid;border-radius:8px;font-size:20px;margin:16px auto 0;padding:8px 16px;width:-moz-fit-content;width:fit-content}.warning-card{background:#fcf8e3;border-color:#faebcc!important;color:#8a6d3b}.span-entire-2nd-row{grid-column:1/3;grid-row:2/3}.warranty-tags{display:grid;gap:12px;grid-template-columns:1fr 1fr;max-width:1000px}.pt-3,.py-3{padding-top:12px}.pb-3,.py-3{padding-bottom:12px}.pt-4,.py-4{padding-top:16px}.pb-4,.py-4{padding-bottom:16px}.max-w-500{max-width:500px}.mt-4,.my-4{margin-bottom:16px;margin-top:16px}.warranty *{box-sizing:border-box}.wrapper-table{border:1px solid #d6d8dc;border-radius:4px;display:flex;flex-direction:column;margin-top:12px;max-height:70vh;overflow:hidden}.ssc-table-container{flex:1 1 0%;height:0;overflow:auto}.wrapper-table .header{align-items:center;background:#e1e3e5;color:#383c43;display:flex;flex-shrink:0;font-size:18px;height:40px;justify-content:center;width:100%}.ssc-table{border-collapse:collapse;overflow:auto;position:relative;width:100%}.ssc-table thead{background-color:#fff;font-weight:700;position:sticky;top:0}.ssc-table td,.ssc-table th{border-bottom:1px solid #d6d8dc;padding:10px 20px;text-align:center;transition:all;transition-duration:.3s;white-space:nowrap}.ssc-table tr:hover{background:#f4f4f4}.ssc-table tr:last-child td{border:none}.table-cell-container{align-items:center;display:flex;gap:8px;justify-content:center;width:100%}.table-cell-parts-container{flex-wrap:wrap}.table-cell-parts-container div{border-radius:4px;font-size:14px;padding:4px 8px}.table-cell-parts-container div.success{background:#d0e7de}.table-cell-parts-container div.reject{background:#f7d7d8}.table-status-icon{height:20px;width:20px}.warranty-vin{font-size:20px;padding-top:4px;text-align:center}.recaptcha-container{display:flex;justify-content:center;overflow:hidden}.static{position:static}.w-full{width:100%}.top-0{top:0}.my-2{margin-bottom:.5rem;margin-top:.5rem}.mt-\[12px\]{margin-top:12px}.table{display:table}.h-\[40px\]{height:40px}.h-\[80px\]{height:80px}.max-h-\[70dvh\]{max-height:70dvh}.min-h-\[100px\]{min-height:100px}.w-fit{width:fit-content}.flex-1{flex:1 1 0%}.shrink-0{flex-shrink:0}.scale-0{--tw-scale-x:0;--tw-scale-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))}.flex-col{flex-direction:column}.items-center{align-items:center}.justify-center{justify-content:center}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.whitespace-nowrap{white-space:nowrap}.rounded-\[4px\]{border-radius:4px}.rounded-\[8px\]{border-radius:8px}.border-b{border-bottom-width:1px}.border-\[\#d6d8dc\]{--tw-border-opacity:1;border-color:rgb(214 216 220/var(--tw-border-opacity,1))}.bg-\[\#e1e3e5\]{--tw-bg-opacity:1;background-color:rgb(225 227 229/var(--tw-bg-opacity,1))}.bg-white{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity,1))}.px-\[10px\]{padding-left:10px;padding-right:10px}.px-\[16px\]{padding-left:16px;padding-right:16px}.py-\[16px\]{padding-bottom:16px;padding-top:16px}.py-\[20px\]{padding-bottom:20px;padding-top:20px}.py-\[8px\]{padding-bottom:8px;padding-top:8px}.pt-\[4px\]{padding-top:4px}.text-center{text-align:center}.text-\[18px\]{font-size:18px}.text-\[20px\]{font-size:20px}.font-bold{font-weight:700}.text-\[\#383c43\]{--tw-text-opacity:1;color:rgb(56 60 67/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}.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)}.duration-300{transition-duration:.3s}
|
|
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}.collapse{visibility:collapse}.absolute{left:0;position:absolute;top:0}.relative{position:relative}.sticky{position:sticky}.mx-auto{margin-left:auto;margin-right:auto}.mt-4{margin-top:1rem}.block{display:block}.flex{display:flex}.grid{display:grid}.hidden{display:none}.h-0{height:0!important;height:0}.flex-shrink{flex-shrink:1}.border-collapse{border-collapse:collapse}.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))}.flex-wrap{flex-wrap:wrap}.border{border-width:1px}.pb-3{padding-bottom:.75rem}.pb-4{padding-bottom:1rem}.pr-1{padding-right:4px}.pt-3{padding-top:.75rem}.pt-4{padding-top:1rem}.font-semibold{font-weight:600}.transition{transition:all;transition-duration:.3s;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-1000{transition-duration:1s}.duration-500{transition-duration:.5s}.duration-700{transition-duration:.7s}.ease-in{transition-timing-function:cubic-bezier(.4,0,1,1)}.success-card{background:#d0e7de;background-color:#d0e7de;border-color:#a2d0bb!important;border-color:#a2d0bb;color:#0b3521}.reject-card{background:#f7d7d8;background-color:#f7d7d8;border-color:#f2aeb5!important;border-color:#f2aeb5;color:#58151c}:host{all:initial!important;display:block}*{font-family:Arial}@keyframes spin{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}.fade-in{animation:fadeIn .3s ease-in forwards;opacity:0}@keyframes fadeOut{0%{opacity:1}to{opacity:0}}.fade-out{animation:fadeIn .3s ease-in forwards;opacity:1}.spin{animation:spin 2s linear infinite}.loading-spinner{align-items:center;display:flex;height:100%;justify-content:center;pointer-events:none;transition:all;transition-duration:.1s;width:100%}.loading-spinner img{height:40px;width:40px}.warranty{overflow:hidden;position:relative;transition:all;transition-duration:.3s}.hide{opacity:0}.card{border:1px solid;border-radius:6px;flex-shrink:0;gap:8px;padding:8px 12px}.card,.card p{align-items:center;display:flex}.card p{flex:1 1 0%;font-size:16px;height:25px;margin:0;padding-left:50px}.card p.no-padding{padding-left:4px}.card img{height:25px;width:25px}.recaptcha-response{border:1px solid;border-radius:8px;font-size:20px;margin:16px auto 0;padding:8px 16px;width:-moz-fit-content;width:fit-content}.warning-card{background:#fcf8e3;border-color:#faebcc!important;color:#8a6d3b}.span-entire-2nd-row{grid-column:1/3;grid-row:2/3}.warranty-tags{display:grid;gap:12px;grid-template-columns:1fr 1fr;max-width:1000px}.pt-3,.py-3{padding-top:12px}.pb-3,.py-3{padding-bottom:12px}.pt-4,.py-4{padding-top:16px}.pb-4,.py-4{padding-bottom:16px}.max-w-500{max-width:500px}.mt-4,.my-4{margin-bottom:16px;margin-top:16px}.warranty *{box-sizing:border-box}.wrapper-table{border:1px solid #d6d8dc;border-radius:4px;display:flex;flex-direction:column;margin-top:12px;max-height:70vh;overflow:hidden}.ssc-table-container{flex:1 1 0%;height:0;overflow:auto}.wrapper-table .header{align-items:center;background:#e1e3e5;color:#383c43;display:flex;flex-shrink:0;font-size:18px;height:40px;justify-content:center;width:100%}.ssc-table{border-collapse:collapse;overflow:auto;position:relative;width:100%}.ssc-table thead{background-color:#fff;font-weight:700;position:sticky;top:0}.ssc-table td,.ssc-table th{border-bottom:1px solid #d6d8dc;padding:10px 20px;text-align:center;transition:all;transition-duration:.3s;white-space:nowrap}.ssc-table tr:hover{background:#f4f4f4}.ssc-table tr:last-child td{border:none}.table-cell-container{align-items:center;display:flex;gap:8px;justify-content:center;width:100%}.table-cell-labors-container,.table-cell-parts-container{flex-wrap:wrap}.table-cell-labors-container div,.table-cell-parts-container div{border-radius:4px;font-size:14px;padding:4px 8px}.table-cell-labors-container div.success,.table-cell-parts-container div.success{background:#d0e7de}.table-cell-labors-container div.reject,.table-cell-parts-container div.reject{background:#f7d7d8}.table-status-icon{height:20px;width:20px}.warranty-vin{font-size:20px;padding-top:4px;text-align:center}.recaptcha-container{display:flex;justify-content:center;overflow:hidden}.static{position:static}.w-full{width:100%}.top-0{top:0}.my-2{margin-bottom:.5rem;margin-top:.5rem}.mt-\[12px\]{margin-top:12px}.table{display:table}.h-\[40px\]{height:40px}.h-\[80px\]{height:80px}.max-h-\[70dvh\]{max-height:70dvh}.min-h-\[100px\]{min-height:100px}.w-fit{width:fit-content}.flex-1{flex:1 1 0%}.shrink-0{flex-shrink:0}.scale-0{--tw-scale-x:0;--tw-scale-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))}.flex-col{flex-direction:column}.items-center{align-items:center}.justify-center{justify-content:center}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.whitespace-nowrap{white-space:nowrap}.rounded-\[4px\]{border-radius:4px}.rounded-\[8px\]{border-radius:8px}.border-b{border-bottom-width:1px}.border-\[\#d6d8dc\]{--tw-border-opacity:1;border-color:rgb(214 216 220/var(--tw-border-opacity,1))}.bg-\[\#e1e3e5\]{--tw-bg-opacity:1;background-color:rgb(225 227 229/var(--tw-bg-opacity,1))}.bg-white{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity,1))}.px-\[10px\]{padding-left:10px;padding-right:10px}.px-\[16px\]{padding-left:16px;padding-right:16px}.py-\[16px\]{padding-bottom:16px;padding-top:16px}.py-\[20px\]{padding-bottom:20px;padding-top:20px}.py-\[8px\]{padding-bottom:8px;padding-top:8px}.pt-\[4px\]{padding-top:4px}.text-center{text-align:center}.text-\[18px\]{font-size:18px}.text-\[20px\]{font-size:20px}.font-bold{font-weight:700}.text-\[\#383c43\]{--tw-text-opacity:1;color:rgb(56 60 67/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}.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)}.duration-300{transition-duration:.3s}
|
|
@@ -4,22 +4,34 @@
|
|
|
4
4
|
*/
|
|
5
5
|
export class FormHook {
|
|
6
6
|
constructor(context, schemaObject, formStateOptions) {
|
|
7
|
+
this.successAnimation = () => { };
|
|
7
8
|
this.isSubmitted = false;
|
|
9
|
+
this.cachedValues = {};
|
|
8
10
|
this.subscribers = [];
|
|
9
11
|
this.haltValidation = false;
|
|
10
12
|
this.validationType = 'onSubmit';
|
|
11
13
|
this.subscribedFields = {};
|
|
12
14
|
this.formErrors = {};
|
|
15
|
+
this.setSuccessAnimation = (newSuccessAnimation) => (this.successAnimation = newSuccessAnimation);
|
|
13
16
|
this.subscribe = (formName, formElement) => this.subscribers.push({ name: formName, context: formElement });
|
|
14
17
|
this.unsubscribe = (formName) => (this.subscribers = this.subscribers.filter(({ name }) => name !== formName));
|
|
18
|
+
this.onInput = (event) => {
|
|
19
|
+
const target = event.target;
|
|
20
|
+
if (this.onValuesUpdate)
|
|
21
|
+
this.onValuesUpdate(Object.assign(Object.assign({}, this.getValues()), { [target.name]: target.value }));
|
|
22
|
+
this.validateForm(target.name, target.value);
|
|
23
|
+
};
|
|
15
24
|
this.resetFormErrorMessage = () => (this.context.errorMessage = '');
|
|
16
25
|
this.getFormErrors = () => this.formErrors;
|
|
26
|
+
this.setCachedValues = (newValues) => {
|
|
27
|
+
this.cachedValues = newValues;
|
|
28
|
+
};
|
|
17
29
|
this.getValues = () => {
|
|
18
30
|
const formDom = this.context.el.shadowRoot || this.context.el;
|
|
19
31
|
const form = formDom.querySelector('form');
|
|
20
32
|
const formData = new FormData(form);
|
|
21
33
|
const formObject = Object.fromEntries(formData.entries());
|
|
22
|
-
return formObject;
|
|
34
|
+
return Object.assign(Object.assign({}, this.cachedValues), formObject);
|
|
23
35
|
};
|
|
24
36
|
this.focusFirstInput = (errorFields) => {
|
|
25
37
|
if (errorFields.length) {
|
|
@@ -43,7 +55,7 @@ export class FormHook {
|
|
|
43
55
|
this.isSubmitted = true;
|
|
44
56
|
this.context.isLoading = true;
|
|
45
57
|
this.signal({ isError: false, disabled: true });
|
|
46
|
-
const formObject = this.getValues();
|
|
58
|
+
const formObject = Object.assign(Object.assign({}, this.cachedValues), this.getValues());
|
|
47
59
|
const values = await this.schemaObject.validate(formObject, { abortEarly: false });
|
|
48
60
|
await this.context.formSubmit(values);
|
|
49
61
|
}
|
|
@@ -76,25 +88,17 @@ export class FormHook {
|
|
|
76
88
|
}
|
|
77
89
|
})();
|
|
78
90
|
};
|
|
79
|
-
this.
|
|
91
|
+
this.getInputState = (name) => {
|
|
80
92
|
const validationDescription = this.schemaObject.describe().fields[name];
|
|
81
|
-
|
|
82
|
-
name
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
this.subscribedFields[name] = Object.assign(Object.assign({}, sharedFields), { inputChanges: (event) => {
|
|
91
|
-
const value = event.target.value;
|
|
92
|
-
this.onChanges(name, value);
|
|
93
|
-
} });
|
|
94
|
-
else if (fieldType === 'select')
|
|
95
|
-
this.subscribedFields[name] = Object.assign(Object.assign({}, sharedFields), { inputChanges: (value) => {
|
|
96
|
-
this.onChanges(name, value);
|
|
97
|
-
} });
|
|
93
|
+
if (!this.subscribedFields[name])
|
|
94
|
+
this.subscribedFields[name] = {
|
|
95
|
+
name,
|
|
96
|
+
isError: false,
|
|
97
|
+
disabled: false,
|
|
98
|
+
errorMessage: '',
|
|
99
|
+
continuousValidation: false,
|
|
100
|
+
isRequired: validationDescription === null || validationDescription === void 0 ? void 0 : validationDescription.tests.some(test => test.name === 'required'),
|
|
101
|
+
};
|
|
98
102
|
return this.subscribedFields[name];
|
|
99
103
|
};
|
|
100
104
|
this.signal = (partialSignal) => {
|
|
@@ -108,11 +112,17 @@ export class FormHook {
|
|
|
108
112
|
Object.values(this.subscribedFields).forEach(field => Object.assign(field, partialSignal));
|
|
109
113
|
}
|
|
110
114
|
};
|
|
111
|
-
this.
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
115
|
+
this.validateInput = (name) => {
|
|
116
|
+
const value = (this.getValues()[name] || '');
|
|
117
|
+
return this.validateForm(name, value, false);
|
|
118
|
+
};
|
|
119
|
+
this.validateForm = (name, value, strict = true) => {
|
|
120
|
+
if (strict) {
|
|
121
|
+
if (this.haltValidation)
|
|
122
|
+
return;
|
|
123
|
+
if (!this.isSubmitted && this.validationType !== 'always' && !this.subscribedFields[name].continuousValidation)
|
|
124
|
+
return;
|
|
125
|
+
}
|
|
116
126
|
const wasError = this.subscribedFields[name].isError;
|
|
117
127
|
try {
|
|
118
128
|
// @ts-ignore
|
|
@@ -120,17 +130,22 @@ export class FormHook {
|
|
|
120
130
|
this.signal([{ name, isError: false }]);
|
|
121
131
|
if (wasError !== false)
|
|
122
132
|
this.context.renderControl = {};
|
|
133
|
+
return { isError: false, errorMessage: '' };
|
|
123
134
|
}
|
|
124
135
|
catch (error) {
|
|
125
136
|
if (error.message) {
|
|
126
137
|
this.signal([{ name, isError: true, errorMessage: error.message }]);
|
|
127
138
|
this.context.renderControl = {};
|
|
139
|
+
return { isError: true, errorMessage: error.message };
|
|
128
140
|
}
|
|
129
141
|
}
|
|
142
|
+
finally {
|
|
143
|
+
this.subscribedFields[name].continuousValidation = true;
|
|
144
|
+
}
|
|
130
145
|
};
|
|
131
146
|
this.context = context;
|
|
132
147
|
this.schemaObject = schemaObject;
|
|
133
|
-
this.formController = { onSubmit: this.onSubmit };
|
|
148
|
+
this.formController = { onSubmit: this.onSubmit, onInput: this.onInput };
|
|
134
149
|
if (formStateOptions === null || formStateOptions === void 0 ? void 0 : formStateOptions.validationType)
|
|
135
150
|
this.validationType = formStateOptions.validationType;
|
|
136
151
|
}
|