adp-web-components 0.0.44 → 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 +45 -20
- package/dist/cjs/dynamic-claim_6.cjs.entry.js +15 -15
- package/dist/cjs/dynamic-redeem.cjs.entry.js +5 -6
- 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 +3 -4
- package/dist/cjs/shift-components.cjs.js +2 -2
- package/dist/cjs/vehicle-lookup.cjs.entry.js +3 -4
- 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.css +1 -1
- package/dist/collection/components/part-lookup/dead-stock-lookup.js +4 -4
- package/dist/collection/components/part-lookup/distributor-lookup.js +28 -8
- package/dist/collection/components/part-lookup/manufacturer-lookup.js +11 -6
- package/dist/collection/components/part-lookup/part-lookup.js +1 -1
- package/dist/collection/components/vehicle-lookup/dynamic-claim.js +3 -3
- package/dist/collection/components/vehicle-lookup/dynamic-redeem.js +3 -3
- package/dist/collection/components/vehicle-lookup/paint-thickness.js +4 -4
- package/dist/collection/components/vehicle-lookup/service-history.js +2 -2
- package/dist/collection/components/vehicle-lookup/vehicle-accessories.js +4 -4
- package/dist/collection/components/vehicle-lookup/vehicle-lookup.js +1 -1
- package/dist/collection/components/vehicle-lookup/vehicle-specification.js +2 -2
- 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 +7 -0
- package/dist/collection/global/types/locales/inquiryTypes.js +15 -0
- package/dist/collection/templates/part-lookup/mock-data.js +180 -100
- 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-0f15eb0b.js +5 -0
- package/dist/components/{p-c59cfec8.js → p-14df0c85.js} +1 -1
- package/dist/components/p-176b63e3.js +5 -0
- package/dist/components/{p-7662fe0a.js → p-21feb9cb.js} +1 -1
- package/dist/components/p-40bb71e4.js +5 -0
- package/dist/components/p-4bae9c16.js +5 -0
- package/dist/components/p-5d3abb5b.js +5 -0
- 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-c37ba710.js → p-7f889bd6.js} +1 -1
- package/dist/components/{p-f5015d31.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-ce440126.js +5 -0
- package/dist/components/p-d70c3cbd.js +5 -0
- package/dist/components/{p-d98710fe.js → p-d8a1e55d.js} +1 -1
- package/dist/components/{p-2e567b64.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 +45 -20
- package/dist/esm/dynamic-claim_6.entry.js +15 -15
- package/dist/esm/dynamic-redeem.entry.js +5 -6
- 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 +3 -4
- package/dist/esm/shift-components.js +3 -3
- package/dist/esm/vehicle-lookup.entry.js +3 -4
- package/dist/locales/ar.json +40 -1
- package/dist/locales/en.json +39 -0
- package/dist/locales/ku.json +40 -1
- package/dist/locales/ru.json +41 -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-36423afa.entry.js +5 -0
- 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 +76 -0
- package/dist/types/global/types/locales/inquiryTypes.d.ts +19 -0
- package/dist/types/global/types/part-information.d.ts +10 -3
- 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-30419427.js +0 -203
- 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-42a5d3c9.js +0 -5
- package/dist/components/p-4c7017f8.js +0 -5
- package/dist/components/p-4cdcb520.js +0 -5
- package/dist/components/p-8c079b39.js +0 -5
- package/dist/components/p-8dc757e9.js +0 -5
- package/dist/components/p-b2051f01.js +0 -5
- package/dist/components/p-b7a8a0ff.js +0 -5
- package/dist/components/p-c1acb397.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-9742a5f6.js +0 -200
- package/dist/shift-components/p-02589422.entry.js +0 -5
- package/dist/shift-components/p-0f0e54c1.js +0 -6
- package/dist/shift-components/p-33434784.entry.js +0 -5
- package/dist/shift-components/p-99d314b5.js +0 -5
- package/dist/shift-components/p-a6ecaa3f.js +0 -5
- package/dist/shift-components/p-a88d388f.entry.js +0 -5
- package/dist/shift-components/p-ad59c0ac.entry.js +0 -5
- package/dist/shift-components/p-b1663a0f.entry.js +0 -5
- package/dist/shift-components/p-c87d536f.entry.js +0 -5
- package/dist/shift-components/p-e446fb9d.js +0 -5
- package/dist/shift-components/p-edf9ed4b.entry.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,16 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Built by ShiftSoftware
|
|
3
|
+
* Copyright (c)
|
|
4
|
+
*/
|
|
5
|
+
'use strict';
|
|
6
|
+
|
|
7
|
+
const index = require('./index-603d8f32.js');
|
|
8
|
+
const loader = require('./loader-baf2418b.js');
|
|
9
|
+
const cn = require('./cn-f559f9e5.js');
|
|
10
|
+
|
|
11
|
+
function Loading({ isLoading }) {
|
|
12
|
+
return (index.h("div", { class: cn.cn('size-full transition-all z-50 duration-100 flex items-center justify-center pointer-events-none absolute ', { 'opacity-0': !isLoading }) },
|
|
13
|
+
index.h("img", { class: "animate-spin-2s size-[40px]", src: loader.loaderSvg })));
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
exports.Loading = Loading;
|
|
@@ -0,0 +1,352 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Built by ShiftSoftware
|
|
3
|
+
* Copyright (c)
|
|
4
|
+
*/
|
|
5
|
+
'use strict';
|
|
6
|
+
|
|
7
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
8
|
+
|
|
9
|
+
const index = require('./index-603d8f32.js');
|
|
10
|
+
const getLocalLanguage = require('./get-local-language-3ae85685.js');
|
|
11
|
+
const cn = require('./cn-f559f9e5.js');
|
|
12
|
+
|
|
13
|
+
class FormHook {
|
|
14
|
+
constructor(context, schemaObject, formStateOptions) {
|
|
15
|
+
this.isSubmitted = false;
|
|
16
|
+
this.validationType = 'onSubmit';
|
|
17
|
+
this.subscribedFields = {};
|
|
18
|
+
this.formErrors = {};
|
|
19
|
+
this.getFormErrors = () => this.formErrors;
|
|
20
|
+
this.getValues = () => {
|
|
21
|
+
const formDom = this.context.el.shadowRoot || this.context.el;
|
|
22
|
+
const form = formDom.querySelector('form');
|
|
23
|
+
const formData = new FormData(form);
|
|
24
|
+
const formObject = Object.fromEntries(formData.entries());
|
|
25
|
+
return formObject;
|
|
26
|
+
};
|
|
27
|
+
this.focusFirstInput = (errorFields) => {
|
|
28
|
+
if (errorFields.length) {
|
|
29
|
+
const formDom = this.context.el.shadowRoot || this.context.el;
|
|
30
|
+
const domElements = errorFields.map(field => formDom.querySelector(`*[name="${field.name}"]`)).filter(dom => dom);
|
|
31
|
+
const sortedDomElements = domElements.sort((a, b) => {
|
|
32
|
+
if (a.compareDocumentPosition(b) & Node.DOCUMENT_POSITION_FOLLOWING)
|
|
33
|
+
return -1; // a comes before b
|
|
34
|
+
if (a.compareDocumentPosition(b) & Node.DOCUMENT_POSITION_PRECEDING)
|
|
35
|
+
return 1; // b comes before a
|
|
36
|
+
return 0; // They are the same
|
|
37
|
+
});
|
|
38
|
+
if (sortedDomElements[0])
|
|
39
|
+
sortedDomElements[0].focus();
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
this.onSubmit = (formEvent) => {
|
|
43
|
+
formEvent.preventDefault();
|
|
44
|
+
(async () => {
|
|
45
|
+
try {
|
|
46
|
+
this.isSubmitted = true;
|
|
47
|
+
this.context.isLoading = true;
|
|
48
|
+
this.signal({ isError: false, disabled: true });
|
|
49
|
+
const formObject = this.getValues();
|
|
50
|
+
const values = await this.schemaObject.validate(formObject, { abortEarly: false });
|
|
51
|
+
await this.context.formSubmit(values);
|
|
52
|
+
}
|
|
53
|
+
catch (error) {
|
|
54
|
+
if (error.name === 'ValidationError') {
|
|
55
|
+
this.formErrors = {};
|
|
56
|
+
const errorFields = [];
|
|
57
|
+
error.inner.forEach((element) => {
|
|
58
|
+
if (element.path) {
|
|
59
|
+
this.formErrors[element.path] = element.message;
|
|
60
|
+
if (!errorFields.find(field => field.name === element.path)) {
|
|
61
|
+
errorFields.push({
|
|
62
|
+
isError: true,
|
|
63
|
+
name: element.path,
|
|
64
|
+
errorMessage: element.message,
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
this.signal(errorFields);
|
|
70
|
+
this.focusFirstInput(errorFields);
|
|
71
|
+
}
|
|
72
|
+
else
|
|
73
|
+
console.error('Unexpected Error:', error);
|
|
74
|
+
}
|
|
75
|
+
finally {
|
|
76
|
+
this.signal({ disabled: false });
|
|
77
|
+
this.context.isLoading = false;
|
|
78
|
+
}
|
|
79
|
+
})();
|
|
80
|
+
};
|
|
81
|
+
this.newController = (name, fieldType) => {
|
|
82
|
+
const validationDescription = this.schemaObject.describe().fields[name];
|
|
83
|
+
const sharedFields = {
|
|
84
|
+
name,
|
|
85
|
+
fieldType,
|
|
86
|
+
isError: false,
|
|
87
|
+
disabled: false,
|
|
88
|
+
errorMessage: '',
|
|
89
|
+
isRequired: validationDescription === null || validationDescription === void 0 ? void 0 : validationDescription.tests.some(test => test.name === 'required'),
|
|
90
|
+
};
|
|
91
|
+
if (fieldType === 'text' || fieldType === 'number' || fieldType === 'text-area')
|
|
92
|
+
this.subscribedFields[name] = Object.assign(Object.assign({}, sharedFields), { inputChanges: (event) => {
|
|
93
|
+
const value = event.target.value;
|
|
94
|
+
this.onChanges(name, value);
|
|
95
|
+
} });
|
|
96
|
+
else if (fieldType === 'select')
|
|
97
|
+
this.subscribedFields[name] = Object.assign(Object.assign({}, sharedFields), { inputChanges: (value) => {
|
|
98
|
+
this.onChanges(name, value);
|
|
99
|
+
} });
|
|
100
|
+
return this.subscribedFields[name];
|
|
101
|
+
};
|
|
102
|
+
this.signal = (partialSignal) => {
|
|
103
|
+
if (Array.isArray(partialSignal)) {
|
|
104
|
+
partialSignal.forEach(field => {
|
|
105
|
+
if (this.subscribedFields[field.name])
|
|
106
|
+
Object.assign(this.subscribedFields[field.name], field);
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
else {
|
|
110
|
+
Object.values(this.subscribedFields).forEach(field => Object.assign(field, partialSignal));
|
|
111
|
+
}
|
|
112
|
+
};
|
|
113
|
+
this.onChanges = async (name, value) => {
|
|
114
|
+
if (!this.isSubmitted && this.validationType !== 'always')
|
|
115
|
+
return;
|
|
116
|
+
const wasError = this.subscribedFields[name].isError;
|
|
117
|
+
try {
|
|
118
|
+
// @ts-ignore
|
|
119
|
+
this.schemaObject.fields[name].validateSync(value);
|
|
120
|
+
this.signal([{ name, isError: false }]);
|
|
121
|
+
if (wasError !== false)
|
|
122
|
+
this.context.renderControl = {};
|
|
123
|
+
}
|
|
124
|
+
catch (error) {
|
|
125
|
+
if (error.message) {
|
|
126
|
+
this.signal([{ name, isError: true, errorMessage: error.message }]);
|
|
127
|
+
this.context.renderControl = {};
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
};
|
|
131
|
+
this.context = context;
|
|
132
|
+
this.schemaObject = schemaObject;
|
|
133
|
+
this.formController = { onSubmit: this.onSubmit };
|
|
134
|
+
if (formStateOptions === null || formStateOptions === void 0 ? void 0 : formStateOptions.validationType)
|
|
135
|
+
this.validationType = formStateOptions.validationType;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
function parseElement(str) {
|
|
140
|
+
const elementPart = str.split(/\.|#/)[0];
|
|
141
|
+
const classMatch = str.match(/\.(\w+)/);
|
|
142
|
+
const idMatch = str.match(/#(\w+)/);
|
|
143
|
+
return {
|
|
144
|
+
children: [],
|
|
145
|
+
element: elementPart,
|
|
146
|
+
id: idMatch ? idMatch[1] : '',
|
|
147
|
+
class: classMatch ? classMatch[1] : '',
|
|
148
|
+
};
|
|
149
|
+
}
|
|
150
|
+
const recursiveParser = (structuredArray) => {
|
|
151
|
+
if (!Array.isArray(structuredArray) || !structuredArray.length)
|
|
152
|
+
throw new Error('Invalid structure');
|
|
153
|
+
let parent = { element: '', class: '', id: '', children: [] };
|
|
154
|
+
let startIndex = 0;
|
|
155
|
+
if (typeof structuredArray[0] === 'string' && structuredArray[0].startsWith('div')) {
|
|
156
|
+
parent = parseElement(structuredArray[0]);
|
|
157
|
+
startIndex++;
|
|
158
|
+
}
|
|
159
|
+
for (let idx = startIndex; idx < structuredArray.length; idx++) {
|
|
160
|
+
const child = structuredArray[idx];
|
|
161
|
+
if (typeof child === 'string')
|
|
162
|
+
parent.children.push(parseElement(child));
|
|
163
|
+
else
|
|
164
|
+
parent.children.push(recursiveParser(child));
|
|
165
|
+
}
|
|
166
|
+
return parent;
|
|
167
|
+
};
|
|
168
|
+
const isValidStructure = (structureString) => {
|
|
169
|
+
try {
|
|
170
|
+
const parsedStructure = JSON.parse(structureString);
|
|
171
|
+
if (!Array.isArray(parsedStructure) || !parsedStructure.length)
|
|
172
|
+
throw new Error('Invalid structure');
|
|
173
|
+
const structuredObject = recursiveParser(parsedStructure);
|
|
174
|
+
return structuredObject;
|
|
175
|
+
}
|
|
176
|
+
catch (error) {
|
|
177
|
+
console.log(error);
|
|
178
|
+
return null;
|
|
179
|
+
}
|
|
180
|
+
};
|
|
181
|
+
|
|
182
|
+
const CITY_ENDPOINT = 'https://tiq-identity-server.azurewebsites.net/api/public/city';
|
|
183
|
+
|
|
184
|
+
const contactUsFormCss = "*,: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-scroll-snap-strictness:proximity;--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;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-scroll-snap-strictness:proximity;--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;}/*! 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}";
|
|
185
|
+
const ContactUsFormStyle0 = contactUsFormCss;
|
|
186
|
+
|
|
187
|
+
const contactUsSchema = getLocalLanguage.create$3({
|
|
188
|
+
cityId: getLocalLanguage.create$6(),
|
|
189
|
+
email: getLocalLanguage.create$6().email('emailAddressNotValid'),
|
|
190
|
+
message: getLocalLanguage.create$6().required('messageIsRequired'),
|
|
191
|
+
generalTicketType: getLocalLanguage.create$6().required('inquiryTypeIsRequired'),
|
|
192
|
+
name: getLocalLanguage.create$6().required('fullNameIsRequired').min(3, 'fullNameMinimum'),
|
|
193
|
+
phone: getLocalLanguage.create$6()
|
|
194
|
+
.required('phoneNumberIsRequired')
|
|
195
|
+
.transform(value => value.replace(/^0/, ''))
|
|
196
|
+
.matches(/^\d+$/, 'phoneNumberFormatInvalid')
|
|
197
|
+
.length(10, 'phoneNumberFormatInvalid'),
|
|
198
|
+
});
|
|
199
|
+
const formElementMapper = {
|
|
200
|
+
name: 'text',
|
|
201
|
+
email: 'text',
|
|
202
|
+
phone: 'number',
|
|
203
|
+
cityId: 'select',
|
|
204
|
+
message: 'text-area',
|
|
205
|
+
generalTicketType: 'select',
|
|
206
|
+
};
|
|
207
|
+
const formFieldParams = {
|
|
208
|
+
name: {
|
|
209
|
+
label: 'fullName',
|
|
210
|
+
formLocaleName: 'contactUs',
|
|
211
|
+
},
|
|
212
|
+
email: {
|
|
213
|
+
type: 'email',
|
|
214
|
+
label: 'emailAddress',
|
|
215
|
+
formLocaleName: 'contactUs',
|
|
216
|
+
},
|
|
217
|
+
message: {
|
|
218
|
+
label: 'writeAMessage',
|
|
219
|
+
formLocaleName: 'contactUs',
|
|
220
|
+
placeholder: 'leaveUsMessage',
|
|
221
|
+
},
|
|
222
|
+
phone: { inputPreFix: '+964', type: 'number', label: 'phoneNumber', formLocaleName: 'contactUs' },
|
|
223
|
+
cityId: {
|
|
224
|
+
label: 'city',
|
|
225
|
+
placeholder: 'selectCity',
|
|
226
|
+
formLocaleName: 'contactUs',
|
|
227
|
+
fetcher: async (language, signal) => {
|
|
228
|
+
const response = await fetch(CITY_ENDPOINT, { signal, headers: { 'Accept-Language': language } });
|
|
229
|
+
const arrayRes = (await response.json());
|
|
230
|
+
const selectItems = arrayRes.map(item => ({ label: item.Name, value: item.ID }));
|
|
231
|
+
return selectItems;
|
|
232
|
+
},
|
|
233
|
+
},
|
|
234
|
+
generalTicketType: {
|
|
235
|
+
label: 'inquiryType',
|
|
236
|
+
formLocaleName: 'contactUs',
|
|
237
|
+
placeholder: 'selectInquiryType',
|
|
238
|
+
fetcher: async (language, _) => {
|
|
239
|
+
const ticketTypes = (await getLocalLanguage.getLocaleLanguage(language)).generalTicketTypes;
|
|
240
|
+
const generalInquiryTypes = [
|
|
241
|
+
{
|
|
242
|
+
value: 'GeneralInquiry',
|
|
243
|
+
label: ticketTypes.GeneralInquiry,
|
|
244
|
+
},
|
|
245
|
+
{
|
|
246
|
+
value: 'Complaint',
|
|
247
|
+
label: ticketTypes.Complaint,
|
|
248
|
+
},
|
|
249
|
+
];
|
|
250
|
+
return generalInquiryTypes;
|
|
251
|
+
},
|
|
252
|
+
},
|
|
253
|
+
};
|
|
254
|
+
const themes = {
|
|
255
|
+
tiq: '["div#container", ["div#inputs_wrapper", "name", "email", "cityId", "phone", "generalTicketType" ], "message#message",["div#recaptcha_container", "slot"], "submit.Submit"]',
|
|
256
|
+
};
|
|
257
|
+
const ContactUsForm = class {
|
|
258
|
+
constructor(hostRef) {
|
|
259
|
+
index.registerInstance(this, hostRef);
|
|
260
|
+
this.recaptchaWidget = null;
|
|
261
|
+
this.form = new FormHook(this, contactUsSchema);
|
|
262
|
+
this.theme = undefined;
|
|
263
|
+
this.baseUrl = undefined;
|
|
264
|
+
this.brandId = undefined;
|
|
265
|
+
this.queryString = '';
|
|
266
|
+
this.language = 'en';
|
|
267
|
+
this.errorCallback = undefined;
|
|
268
|
+
this.successCallback = undefined;
|
|
269
|
+
this.structure = '["submit.Submit"]';
|
|
270
|
+
this.loadingChanges = undefined;
|
|
271
|
+
this.recaptchaKey = '6Lehq6IpAAAAAETTDS2Zh60nHIT1a8oVkRtJ2WsA';
|
|
272
|
+
this.isLoading = undefined;
|
|
273
|
+
this.renderControl = {};
|
|
274
|
+
this.structureObject = null;
|
|
275
|
+
this.locale = getLocalLanguage.localeSchema.getDefault();
|
|
276
|
+
}
|
|
277
|
+
async componentWillLoad() {
|
|
278
|
+
let structure;
|
|
279
|
+
if (this.theme && themes[this.theme])
|
|
280
|
+
structure = themes[this.theme];
|
|
281
|
+
else
|
|
282
|
+
structure = this.structure;
|
|
283
|
+
await Promise.all([this.structureValidation(structure), this.changeLanguage(this.language)]);
|
|
284
|
+
}
|
|
285
|
+
async changeLanguage(newLanguage) {
|
|
286
|
+
this.locale = await getLocalLanguage.getLocaleLanguage(newLanguage);
|
|
287
|
+
}
|
|
288
|
+
async onStructureChange(newStructure) {
|
|
289
|
+
await this.structureValidation(newStructure);
|
|
290
|
+
}
|
|
291
|
+
async structureValidation(structureString) {
|
|
292
|
+
this.structureObject = isValidStructure(structureString);
|
|
293
|
+
}
|
|
294
|
+
async componentDidLoad() {
|
|
295
|
+
try {
|
|
296
|
+
if (this.recaptchaKey) {
|
|
297
|
+
const script = document.createElement('script');
|
|
298
|
+
script.src = `https://www.google.com/recaptcha/api.js?render=${this.recaptchaKey}&hl=${this.language}`;
|
|
299
|
+
script.async = true;
|
|
300
|
+
script.defer = true;
|
|
301
|
+
document.head.appendChild(script);
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
catch (error) {
|
|
305
|
+
console.log(error);
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
async formSubmit(formValues) {
|
|
309
|
+
try {
|
|
310
|
+
if (this.loadingChanges)
|
|
311
|
+
this.loadingChanges(true);
|
|
312
|
+
const token = await grecaptcha.execute(this.recaptchaKey, { action: 'submit' });
|
|
313
|
+
const response = await fetch(`${this.baseUrl}?${this.queryString}`, {
|
|
314
|
+
method: 'post',
|
|
315
|
+
body: JSON.stringify(formValues),
|
|
316
|
+
headers: {
|
|
317
|
+
'Brand': this.brandId,
|
|
318
|
+
'Recaptcha-Token': token,
|
|
319
|
+
'Accept-Language': this.language,
|
|
320
|
+
'Content-Type': 'application/json',
|
|
321
|
+
},
|
|
322
|
+
});
|
|
323
|
+
const data = await response.json();
|
|
324
|
+
if (this.successCallback)
|
|
325
|
+
this.successCallback(data);
|
|
326
|
+
}
|
|
327
|
+
catch (error) {
|
|
328
|
+
console.log(error);
|
|
329
|
+
if (this.errorCallback)
|
|
330
|
+
this.errorCallback(error);
|
|
331
|
+
}
|
|
332
|
+
finally {
|
|
333
|
+
if (this.loadingChanges)
|
|
334
|
+
this.loadingChanges(false);
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
render() {
|
|
338
|
+
if (this.structureObject === null)
|
|
339
|
+
return index.h("form-structure-error", { language: this.language });
|
|
340
|
+
return (index.h(index.Host, { class: cn.cn({
|
|
341
|
+
[`contact-us-${this.theme}`]: this.theme,
|
|
342
|
+
}) }, index.h("form-structure", { form: this.form, language: this.language, isLoading: this.isLoading, formFieldParams: formFieldParams, renderControl: this.renderControl, formElementMapper: formElementMapper, structureObject: this.structureObject }, index.h("slot", null))));
|
|
343
|
+
}
|
|
344
|
+
get el() { return index.getElement(this); }
|
|
345
|
+
static get watchers() { return {
|
|
346
|
+
"language": ["changeLanguage"],
|
|
347
|
+
"structure": ["onStructureChange"]
|
|
348
|
+
}; }
|
|
349
|
+
};
|
|
350
|
+
ContactUsForm.style = ContactUsFormStyle0;
|
|
351
|
+
|
|
352
|
+
exports.contact_us_form = ContactUsForm;
|
|
@@ -6,11 +6,11 @@
|
|
|
6
6
|
|
|
7
7
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
8
8
|
|
|
9
|
-
const index = require('./index-
|
|
10
|
-
const getLocalLanguage = require('./get-local-language-
|
|
9
|
+
const index = require('./index-603d8f32.js');
|
|
10
|
+
const getLocalLanguage = require('./get-local-language-3ae85685.js');
|
|
11
11
|
const cn = require('./cn-f559f9e5.js');
|
|
12
|
-
const Loading = require('./Loading-
|
|
13
|
-
require('./
|
|
12
|
+
const Loading = require('./Loading-c3489701.js');
|
|
13
|
+
require('./loader-baf2418b.js');
|
|
14
14
|
|
|
15
15
|
const getPartInformation = async (component, generalProps, headers = {}) => {
|
|
16
16
|
const { notAvailableMessage, mockData, partNumber, scopedTimeoutRef, middlewareCallback } = generalProps;
|
|
@@ -41,7 +41,7 @@ const getPartInformation = async (component, generalProps, headers = {}) => {
|
|
|
41
41
|
}
|
|
42
42
|
};
|
|
43
43
|
|
|
44
|
-
const deadStockLookupCss = "*,: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-scroll-snap-strictness:proximity;--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;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-scroll-snap-strictness:proximity;--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;}/*! 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}.block{display:block}:host{all:initial!important;display:block}*{font-family:Arial}.static{position:static}.hidden{display:none}.w-full{width:100%}.relative{position:relative}.mx-auto{margin-left:auto;margin-right:auto}.mb-\\[10px\\]{margin-bottom:10px}.mt-\\[12px\\]{margin-top:12px}.flex{display:flex}.table{display:table}.size-\\[22px\\]{height:22px;width:22px}.h-\\[40px\\]{height:40px}.max-h-\\[70dvh\\]{max-height:70dvh}.min-h-\\[100px\\]{min-height:100px}.w-fit{width:fit-content}.shrink-0{flex-shrink:0}.border-collapse{border-collapse:collapse}.scale-0{--tw-scale-x:0;--tw-scale-y:0}.scale-0,.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-col{flex-direction:column}.items-center{align-items:center}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.whitespace-nowrap{white-space:nowrap}.rounded-\\[4px\\]{border-radius:4px}.rounded-\\[8px\\]{border-radius:8px}.rounded-md{border-radius:.375rem}.border{border-width:1px}.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))}.px-\\[10px\\]{padding-left:10px;padding-right:10px}.px-\\[16px\\]{padding-left:16px;padding-right:16px}.px-\\[20px\\]{padding-left:20px;padding-right:20px}.py-\\[10px\\]{padding-bottom:10px;padding-top:10px}.py-\\[16px\\]{padding-bottom:16px;padding-top:16px}.py-\\[20px\\]{padding-bottom:20px;padding-top:20px}.py-\\[8px\\]{padding-bottom:8px;padding-top:8px}.text-center{text-align:center}.text-start{text-align:start}.text-\\[18px\\]{font-size:18px}.text-\\[20px\\]{font-size:20px}.text-\\[\\#383c43\\]{--tw-text-opacity:1;color:rgb(56 60 67/var(--tw-text-opacity,1))}.text-slate-800{--tw-text-opacity:1;color:rgb(30 41 59/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)}.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-transform{transition-duration:.15s;transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1)}.duration-100{transition-duration:.1s}.duration-300{transition-duration:.3s}.duration-500{transition-duration:.5s}.duration-700{transition-duration:.7s}.reject-card{background-color:#f7d7d8;border-color:#f2aeb5;color:#58151c}.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}}.last\\:border-none:last-child{border-style:none}.hover\\:bg-slate-100:hover{--tw-bg-opacity:1;background-color:rgb(241 245 249/var(--tw-bg-opacity,1))}.pointer-events-none{pointer-events:none}.absolute{position:absolute}.z-50{z-index:50}.size-\\[40px\\]{height:40px;width:40px}.size-full{height:100%;width:100%}@keyframes spin{to{transform:rotate(1turn)}}.animate-spin-2s{animation:spin 2s linear infinite}";
|
|
44
|
+
const deadStockLookupCss = "*,: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-scroll-snap-strictness:proximity;--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;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-scroll-snap-strictness:proximity;--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;}/*! 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}.block{display:block}:host{all:initial!important;display:block}*{font-family:Arial}.static{position:static}.hidden{display:none}.w-full{width:100%}.relative{position:relative}.mx-auto{margin-left:auto;margin-right:auto}.mb-\\[10px\\]{margin-bottom:10px}.mt-\\[12px\\]{margin-top:12px}.flex{display:flex}.table{display:table}.size-\\[22px\\]{height:22px;width:22px}.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}.shrink-0{flex-shrink:0}.border-collapse{border-collapse:collapse}.scale-0{--tw-scale-x:0;--tw-scale-y:0}.scale-0,.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-col{flex-direction:column}.items-center{align-items:center}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.whitespace-nowrap{white-space:nowrap}.rounded-\\[4px\\]{border-radius:4px}.rounded-\\[8px\\]{border-radius:8px}.rounded-md{border-radius:.375rem}.border{border-width:1px}.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))}.px-\\[10px\\]{padding-left:10px;padding-right:10px}.px-\\[16px\\]{padding-left:16px;padding-right:16px}.px-\\[20px\\]{padding-left:20px;padding-right:20px}.py-\\[10px\\]{padding-bottom:10px;padding-top:10px}.py-\\[16px\\]{padding-bottom:16px;padding-top:16px}.py-\\[20px\\]{padding-bottom:20px;padding-top:20px}.py-\\[8px\\]{padding-bottom:8px;padding-top:8px}.text-center{text-align:center}.text-start{text-align:start}.text-\\[18px\\]{font-size:18px}.text-\\[20px\\]{font-size:20px}.text-\\[\\#383c43\\]{--tw-text-opacity:1;color:rgb(56 60 67/var(--tw-text-opacity,1))}.text-slate-800{--tw-text-opacity:1;color:rgb(30 41 59/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)}.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-transform{transition-duration:.15s;transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1)}.duration-100{transition-duration:.1s}.duration-300{transition-duration:.3s}.duration-500{transition-duration:.5s}.duration-700{transition-duration:.7s}.reject-card{background-color:#f7d7d8;border-color:#f2aeb5;color:#58151c}.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}}.last\\:border-none:last-child{border-style:none}.hover\\:bg-slate-100:hover{--tw-bg-opacity:1;background-color:rgb(241 245 249/var(--tw-bg-opacity,1))}.pointer-events-none{pointer-events:none}.absolute{position:absolute}.z-50{z-index:50}.size-\\[40px\\]{height:40px;width:40px}.size-full{height:100%;width:100%}@keyframes spin{to{transform:rotate(1turn)}}.animate-spin-2s{animation:spin 2s linear infinite}";
|
|
45
45
|
const DeadStockLookupStyle0 = deadStockLookupCss;
|
|
46
46
|
|
|
47
47
|
let mockData$2 = {};
|
|
@@ -145,10 +145,10 @@ const DeadStockLookup = class {
|
|
|
145
145
|
}
|
|
146
146
|
}
|
|
147
147
|
render() {
|
|
148
|
-
var _a, _b;
|
|
148
|
+
var _a, _b, _c, _d;
|
|
149
149
|
const texts = this.locale.partLookup.deadStock;
|
|
150
|
-
return (index.h(index.Host, { key: '8e90f1998fe2184d555e7213065147e2e2403dd1' }, index.h("div", { key: '774bea05f92f91784c3a96d3f34c332428d3dfb3', dir: this.locale.direction, class: "min-h-[100px] relative transition-all duration-300 overflow-hidden" }, index.h("div", { key: '9a391c96e4f96281d992282871c7538a3d31e42f' }, index.h(Loading.Loading, { key: 'b62445ae1983828a74a62a9ee15cd07a159a9bb1', isLoading: this.state.includes('loading') }), index.h("div", { key: '939df7c5ee00c70bf0cd2ce6e83cb19eb83c7b5e', class: cn.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) && (index.h("div", { key: 'aeeeb9df8f126abcb5bd654a200f6170843ca25f', class: "py-[16px] min-h-[100px] flex items-center" }, index.h("div", { key: '746fc041eae5db843e6e0d167ee84571f7b22432', 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) && (index.h("div", { key: '3e5a6e9ed98698da6ea563e632ba5088f736ea94' }, index.h("div", { key: 'a292f6441da3999bdb28293bc81b216ad83b6311', class: "flex mt-[12px] max-h-[70dvh] overflow-hidden rounded-[4px] flex-col border border-[#d6d8dc]" }, index.h("div", { key: '6a21112d4bd30a512e93668ed1d58c520eeb3f9d', class: "w-full h-[40px] flex shrink-0 justify-center text-[18px] items-center text-[#383c43] text-center bg-[#e1e3e5]" }, texts.deadStock), (_b = (_a = this.partInformation) === null || _a === void 0 ? void 0 : _a.deadStock) === null || _b === void 0 ? void 0 :
|
|
151
|
-
|
|
150
|
+
return (index.h(index.Host, { key: '8e90f1998fe2184d555e7213065147e2e2403dd1' }, index.h("div", { key: '774bea05f92f91784c3a96d3f34c332428d3dfb3', dir: this.locale.direction, class: "min-h-[100px] relative transition-all duration-300 overflow-hidden" }, index.h("div", { key: '9a391c96e4f96281d992282871c7538a3d31e42f' }, index.h(Loading.Loading, { key: 'b62445ae1983828a74a62a9ee15cd07a159a9bb1', isLoading: this.state.includes('loading') }), index.h("div", { key: '939df7c5ee00c70bf0cd2ce6e83cb19eb83c7b5e', class: cn.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) && (index.h("div", { key: 'aeeeb9df8f126abcb5bd654a200f6170843ca25f', class: "py-[16px] min-h-[100px] flex items-center" }, index.h("div", { key: '746fc041eae5db843e6e0d167ee84571f7b22432', 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) && (index.h("div", { key: '3e5a6e9ed98698da6ea563e632ba5088f736ea94' }, index.h("div", { key: 'a292f6441da3999bdb28293bc81b216ad83b6311', class: "flex mt-[12px] max-h-[70dvh] overflow-hidden rounded-[4px] flex-col border border-[#d6d8dc]" }, index.h("div", { key: '6a21112d4bd30a512e93668ed1d58c520eeb3f9d', class: "w-full h-[40px] flex shrink-0 justify-center text-[18px] items-center text-[#383c43] text-center bg-[#e1e3e5]" }, texts.deadStock), !((_b = (_a = this.partInformation) === null || _a === void 0 ? void 0 : _a.deadStock) === null || _b === void 0 ? void 0 : _b.length) && index.h("div", { key: '44808df425a73e5247a2c869779065d9353b8605', class: "h-[80px] flex items-center justify-center text-[18px]" }, this.locale.noData), (_d = (_c = this.partInformation) === null || _c === void 0 ? void 0 : _c.deadStock) === null || _d === void 0 ? void 0 :
|
|
151
|
+
_d.map(deadStock => (index.h("div", { key: deadStock.companyIntegrationID, class: "py-[10px] px-[20px]" }, index.h("div", { "aria-expanded": "false", style: { height: closedAccordionHeight }, class: "border shadow transition-all duration-500 overflow-hidden rounded-md mb-[10px] border-[#d6d8dc]" }, index.h("button", { onClick: this.toggleAccordion, style: { height: closedAccordionHeight }, class: "w-full flex px-[10px] justify-between items-center text-slate-800" }, index.h("strong", null, deadStock.companyName), index.h("span", { class: "icon text-slate-800 transition-transform duration-500" }, index.h("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 16 16", fill: "currentColor", class: "size-[22px]" }, index.h("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M11.78 9.78a.75.75 0 0 1-1.06 0L8 7.06 5.28 9.78a.75.75 0 0 1-1.06-1.06l3.25-3.25a.75.75 0 0 1 1.06 0l3.25 3.25a.75.75 0 0 1 0 1.06Z" })))), index.h("div", { class: "content" }, index.h("table", { class: "w-full overflow-auto relative border-collapse" }, index.h("thead", null, index.h("tr", null, index.h("th", { class: "py-[20px] px-[10px] text-start whitespace-nowrap border-b border-[#d6d8dc]" }, texts.branch), index.h("th", { class: "py-[20px] px-[10px] text-start whitespace-nowrap border-b border-[#d6d8dc]" }, texts.availableQuantity))), index.h("tbody", null, deadStock === null || deadStock === void 0 ? void 0 : deadStock.branchDeadStock.map(branchDeadStock => (index.h("tr", { class: "transition-colors border-b border-[#d6d8dc] last:border-none duration-100 hover:bg-slate-100", key: branchDeadStock.companyBranchIntegrationID }, index.h("td", { class: cn.cn('py-[20px] px-[10px] text-start whitespace-nowrap') }, branchDeadStock.companyBranchName), index.h("td", { class: cn.cn('py-[20px] px-[10px] text-start whitespace-nowrap') }, index.h("strong", null, branchDeadStock.quantity))))))))))))))))))));
|
|
152
152
|
}
|
|
153
153
|
get el() { return index.getElement(this); }
|
|
154
154
|
static get watchers() { return {
|
|
@@ -259,19 +259,39 @@ const DistributorLookup = class {
|
|
|
259
259
|
key: 'localDescription',
|
|
260
260
|
value: this.partInformation.localDescription,
|
|
261
261
|
},
|
|
262
|
-
{
|
|
263
|
-
|
|
264
|
-
|
|
262
|
+
{
|
|
263
|
+
label: texts.dealerPurchasePrice,
|
|
264
|
+
key: 'fob',
|
|
265
|
+
value: null,
|
|
266
|
+
values: this.partInformation.prices.map(price => {
|
|
267
|
+
var _a;
|
|
268
|
+
return { header: price === null || price === void 0 ? void 0 : price.countryName, body: (_a = price === null || price === void 0 ? void 0 : price.fob) === null || _a === void 0 ? void 0 : _a.formattedValue };
|
|
269
|
+
}),
|
|
270
|
+
},
|
|
271
|
+
{
|
|
272
|
+
label: texts.recommendedRetailPrice,
|
|
273
|
+
key: 'price',
|
|
274
|
+
value: null,
|
|
275
|
+
values: this.partInformation.prices.map(price => {
|
|
276
|
+
var _a;
|
|
277
|
+
return { header: price === null || price === void 0 ? void 0 : price.countryName, body: (_a = price === null || price === void 0 ? void 0 : price.price) === null || _a === void 0 ? void 0 : _a.formattedValue };
|
|
278
|
+
}),
|
|
279
|
+
},
|
|
280
|
+
{
|
|
281
|
+
label: texts.supersessions,
|
|
282
|
+
key: 'supersededTo',
|
|
283
|
+
value: null,
|
|
284
|
+
values: this.partInformation.supersededTo.map(part => {
|
|
285
|
+
return { header: null, body: part };
|
|
286
|
+
}),
|
|
287
|
+
},
|
|
265
288
|
]
|
|
266
289
|
: [];
|
|
267
290
|
const displayedFields = partsInformation.filter(part => !hiddenFields.includes(part.key));
|
|
268
291
|
const displayDistributer = this.partInformation
|
|
269
292
|
? !this.partInformation.stockParts.some(({ quantityLookUpResult }) => quantityLookUpResult === 'LookupIsSkipped' || quantityLookUpResult === 'QuantityNotWithinLookupThreshold')
|
|
270
293
|
: false;
|
|
271
|
-
return (index.h(index.Host, null, index.h("div", { dir: this.locale.direction, class: "min-h-[100px] relative transition-all duration-300 overflow-hidden" }, index.h("div", null, index.h(Loading.Loading, { isLoading: this.state.includes('loading') }), index.h("div", { class: cn.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) && (index.h("div", { class: "py-[16px] min-h-[100px] flex items-center" }, index.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) && (index.h("div", null, index.h("div", { class: "flex mt-[12px] max-h-[70dvh] overflow-hidden rounded-[4px] flex-col border border-[#d6d8dc]" }, index.h("div", { class: "w-full h-[40px] flex shrink-0 justify-center text-[18px] items-center text-[#383c43] text-center bg-[#e1e3e5]" }, texts.info), index.h("div", { class: "py-[10px] px-[30px] flex flex-col gap-[15px]" }, index.h("div", { class: "grid grid-cols-3 gap-[50px]" }, displayedFields.map(({ label, value, values, key }) => (index.h("div", { key: key, class: "flex flex-col flex-1" }, index.h("strong", { class: "py-[10px] px-0 border-b-[gray] border-b" }, label), values ?
|
|
272
|
-
index.h("div", null, (values.map(x => (index.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 && index.h("span", { class: "font-semibold" }, x.header, ":"), index.h("span", { class: "ml-1" }, x.body))))))
|
|
273
|
-
:
|
|
274
|
-
(index.h("div", { class: "py-[10px] px-0" }, value)))))))), displayDistributer && (index.h("div", { class: "flex mt-[12px] max-h-[70dvh] overflow-hidden rounded-[4px] flex-col border border-[#d6d8dc]" }, index.h("div", { class: "w-full h-[40px] flex shrink-0 justify-center text-[18px] items-center text-[#383c43] text-center bg-[#e1e3e5]" }, texts.distributorStock), index.h("div", { class: "flex flex-col gap-[15px]" }, index.h("table", { class: "w-full overflow-auto relative border-collapse" }, index.h("thead", { class: "top-0 font-bold sticky bg-white" }, index.h("tr", null, [texts.location, texts.availability].map(title => (index.h("th", { key: title, class: "px-[10px] py-[20px] text-center whitespace-nowrap border-b border-[#d6d8dc]" }, title))))), index.h("tbody", null, (_a = this.partInformation) === null || _a === void 0 ? void 0 : _a.stockParts.map(stock => (index.h("tr", { class: "transition-colors duration-100 border-b border-[#d6d8dc] last:border-none hover:bg-slate-100", key: stock.locationID }, index.h("td", { class: cn.cn('px-[10px] py-[20px] text-center whitespace-nowrap') }, stock.locationName), index.h("td", { class: cn.cn('px-[10px] py-[20px] text-center whitespace-nowrap') }, index.h("div", { class: cn.cn('text-[red]', {
|
|
294
|
+
return (index.h(index.Host, null, index.h("div", { dir: this.locale.direction, class: "min-h-[100px] relative transition-all duration-300 overflow-hidden" }, index.h("div", null, index.h(Loading.Loading, { isLoading: this.state.includes('loading') }), index.h("div", { class: cn.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) && (index.h("div", { class: "py-[16px] min-h-[100px] flex items-center" }, index.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) && (index.h("div", null, index.h("div", { class: "flex mt-[12px] max-h-[70dvh] overflow-hidden rounded-[4px] flex-col border border-[#d6d8dc]" }, index.h("div", { class: "w-full h-[40px] flex shrink-0 justify-center text-[18px] items-center text-[#383c43] text-center bg-[#e1e3e5]" }, texts.info), index.h("div", { class: "py-[10px] px-[30px] flex flex-col gap-[15px]" }, index.h("div", { class: "grid grid-cols-3 gap-[50px]" }, displayedFields.map(({ label, value, values, key }) => (index.h("div", { key: key, class: "flex flex-col flex-1" }, index.h("strong", { class: "py-[10px] px-0 border-b-[gray] border-b" }, label), values ? (index.h("div", null, values.map(x => (index.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 && index.h("span", { class: "font-semibold" }, x.header, ":"), index.h("span", { class: "ml-1" }, x.body)))))) : (index.h("div", { class: "py-[10px] px-0" }, value)))))))), displayDistributer && (index.h("div", { class: "flex mt-[12px] max-h-[70dvh] overflow-hidden rounded-[4px] flex-col border border-[#d6d8dc]" }, index.h("div", { class: "w-full h-[40px] flex shrink-0 justify-center text-[18px] items-center text-[#383c43] text-center bg-[#e1e3e5]" }, texts.distributorStock), index.h("div", { class: "flex flex-col gap-[15px]" }, index.h("table", { class: "w-full overflow-auto relative border-collapse" }, index.h("thead", { class: "top-0 font-bold sticky bg-white" }, index.h("tr", null, [texts.location, texts.availability].map(title => (index.h("th", { key: title, class: "px-[10px] py-[20px] text-center whitespace-nowrap border-b border-[#d6d8dc]" }, title))))), index.h("tbody", null, (_a = this.partInformation) === null || _a === void 0 ? void 0 : _a.stockParts.map(stock => (index.h("tr", { class: "transition-colors duration-100 border-b border-[#d6d8dc] last:border-none hover:bg-slate-100", key: stock.locationID }, index.h("td", { class: cn.cn('px-[10px] py-[20px] text-center whitespace-nowrap') }, stock.locationName), index.h("td", { class: cn.cn('px-[10px] py-[20px] text-center whitespace-nowrap') }, index.h("div", { class: cn.cn('text-[red]', {
|
|
275
295
|
'text-[green]': stock.quantityLookUpResult === 'Available',
|
|
276
296
|
'text-[orange]': stock.quantityLookUpResult === 'PartiallyAvailable',
|
|
277
297
|
}) }, index.h("strong", null, stock.quantityLookUpResult === 'Available'
|
|
@@ -383,7 +403,15 @@ const ManufacturerLookup = class {
|
|
|
383
403
|
const manufacturerData = this.partInformation
|
|
384
404
|
? [
|
|
385
405
|
{ label: texts.origin, key: 'origin', value: this.partInformation.origin },
|
|
386
|
-
{
|
|
406
|
+
{
|
|
407
|
+
label: texts.warrantyPrice,
|
|
408
|
+
key: 'warrantyPrice',
|
|
409
|
+
value: null,
|
|
410
|
+
values: this.partInformation.prices.map(price => {
|
|
411
|
+
var _a;
|
|
412
|
+
return { header: price === null || price === void 0 ? void 0 : price.countryName, body: (_a = price === null || price === void 0 ? void 0 : price.warrantyPrice) === null || _a === void 0 ? void 0 : _a.formattedValue };
|
|
413
|
+
}),
|
|
414
|
+
},
|
|
387
415
|
{ label: texts.specialPrice, key: 'specialPrice', value: null },
|
|
388
416
|
{ label: texts.wholesalesPrice, key: 'salesPrice', value: null },
|
|
389
417
|
{ label: texts.pnc, key: 'pnc', value: this.partInformation.pnc },
|
|
@@ -400,10 +428,7 @@ const ManufacturerLookup = class {
|
|
|
400
428
|
]
|
|
401
429
|
: [];
|
|
402
430
|
const displayedManufacturerData = manufacturerData.filter(part => !hiddenFields.includes(part.key));
|
|
403
|
-
return (index.h(index.Host, null, index.h("div", { dir: this.locale.direction, class: "min-h-[100px] relative transition-all duration-300 overflow-hidden" }, index.h("div", null, index.h(Loading.Loading, { isLoading: this.state.includes('loading') }), index.h("div", { class: cn.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) && (index.h("div", { class: "py-[16px] min-h-[100px] flex items-center" }, index.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) && (index.h("div", null, index.h("div", { class: "flex mt-[12px] overflow-hidden rounded-[4px] flex-col border border-[#d6d8dc]" }, index.h("div", { class: "w-full h-[40px] flex shrink-0 justify-center text-[18px] items-center text-[#383c43] text-center bg-[#e1e3e5]" }, this.headerTitle), index.h("div", { class: "px-[30px] py-[10px] flex flex-col gap-[15px]" }, index.h("div", { class: "grid grid-cols-3 gap-[50px]" }, displayedManufacturerData.map(({ label, value, values, key }) => (index.h("div", { key: key, class: "flex flex-col flex-1" }, index.h("strong", { class: "py-[10px] px-0 border-b-[gray] border-b" }, label), values ?
|
|
404
|
-
index.h("div", null, (values.map(x => (index.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 && index.h("span", { class: "font-semibold" }, x.header, ":"), index.h("span", { class: "ml-1" }, x.body))))))
|
|
405
|
-
:
|
|
406
|
-
(index.h("div", { class: "py-[10px] px-0" }, value)))))))))))))));
|
|
431
|
+
return (index.h(index.Host, null, index.h("div", { dir: this.locale.direction, class: "min-h-[100px] relative transition-all duration-300 overflow-hidden" }, index.h("div", null, index.h(Loading.Loading, { isLoading: this.state.includes('loading') }), index.h("div", { class: cn.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) && (index.h("div", { class: "py-[16px] min-h-[100px] flex items-center" }, index.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) && (index.h("div", null, index.h("div", { class: "flex mt-[12px] overflow-hidden rounded-[4px] flex-col border border-[#d6d8dc]" }, index.h("div", { class: "w-full h-[40px] flex shrink-0 justify-center text-[18px] items-center text-[#383c43] text-center bg-[#e1e3e5]" }, this.headerTitle), index.h("div", { class: "px-[30px] py-[10px] flex flex-col gap-[15px]" }, index.h("div", { class: "grid grid-cols-3 gap-[50px]" }, displayedManufacturerData.map(({ label, value, values, key }) => (index.h("div", { key: key, class: "flex flex-col flex-1" }, index.h("strong", { class: "py-[10px] px-0 border-b-[gray] border-b" }, label), values ? (index.h("div", null, values.map(x => (index.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 && index.h("span", { class: "font-semibold" }, x.header, ":"), index.h("span", { class: "ml-1" }, x.body)))))) : (index.h("div", { class: "py-[10px] px-0" }, value)))))))))))))));
|
|
407
432
|
}
|
|
408
433
|
get el() { return index.getElement(this); }
|
|
409
434
|
static get watchers() { return {
|