adp-web-components 0.0.30 → 0.0.31
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/dead-stock-lookup.cjs.entry.js +16 -4
- package/dist/cjs/distributor-lookup.cjs.entry.js +15 -3
- package/dist/cjs/dynamic-claim_6.cjs.entry.js +19 -13
- package/dist/cjs/dynamic-redeem.cjs.entry.js +1 -1
- package/dist/cjs/{get-local-language-42973450.js → get-local-language-6b6b182f.js} +2 -9
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/manufacturer-lookup.cjs.entry.js +16 -4
- package/dist/cjs/{partInformation-2b4e0593.js → partInformation-16ea1f8e.js} +1 -1
- package/dist/cjs/shift-components.cjs.js +1 -1
- package/dist/collection/components/part-lookup/dead-stock-lookup.js +45 -6
- package/dist/collection/components/part-lookup/distributor-lookup.js +43 -4
- package/dist/collection/components/part-lookup/manufacturer-lookup.js +45 -6
- package/dist/collection/components/vehicle-lookup/dynamic-claim.js +3 -2
- package/dist/collection/components/vehicle-lookup/paint-thickness.js +4 -3
- package/dist/collection/components/vehicle-lookup/service-history.js +2 -1
- package/dist/collection/components/vehicle-lookup/vehicle-accessories.js +4 -3
- package/dist/collection/components/vehicle-lookup/vehicle-specification.js +2 -1
- package/dist/collection/components/vehicle-lookup/warranty-details.js +2 -1
- package/dist/collection/global/api/partInformation.js +1 -1
- package/dist/collection/global/api/vehicleInformation.js +1 -1
- package/dist/collection/global/types/locales/error-schema.js +2 -0
- package/dist/collection/global/types/locales/vehicle-lookup/dynamic-redeem-schema.js +0 -9
- 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/manufacturer-lookup.js +1 -1
- package/dist/components/p-27603946.js +5 -0
- package/dist/components/p-41d63f74.js +5 -0
- package/dist/components/p-5d492eec.js +5 -0
- package/dist/components/p-6c720036.js +5 -0
- package/dist/components/p-8b1d90d7.js +5 -0
- package/dist/components/{p-0ae60f32.js → p-9b821a7e.js} +1 -1
- package/dist/components/p-a83ffeb1.js +5 -0
- package/dist/components/p-b8f9bf61.js +5 -0
- package/dist/components/p-c76ffad2.js +5 -0
- package/dist/components/{p-6c064413.js → p-e30d8e8f.js} +1 -1
- package/dist/components/p-f99c8b2f.js +5 -0
- package/dist/components/paint-thickness.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/dead-stock-lookup.entry.js +16 -4
- package/dist/esm/distributor-lookup.entry.js +15 -3
- package/dist/esm/dynamic-claim_6.entry.js +19 -13
- package/dist/esm/dynamic-redeem.entry.js +1 -1
- package/dist/esm/{get-local-language-85ed0b3b.js → get-local-language-554f1f34.js} +2 -9
- package/dist/esm/loader.js +1 -1
- package/dist/esm/manufacturer-lookup.entry.js +16 -4
- package/dist/esm/{partInformation-f40b1fe6.js → partInformation-ba1470e1.js} +1 -1
- package/dist/esm/shift-components.js +1 -1
- package/dist/locales/ar.json +4 -12
- package/dist/locales/en.json +4 -12
- package/dist/locales/ku.json +4 -12
- package/dist/shift-components/p-4a5ba0d7.entry.js +5 -0
- package/dist/shift-components/p-60c334c8.entry.js +5 -0
- package/dist/shift-components/p-6b51b757.entry.js +5 -0
- package/dist/shift-components/p-962897dc.js +5 -0
- package/dist/shift-components/p-9cf24b05.entry.js +5 -0
- package/dist/shift-components/{p-1de8531d.entry.js → p-d075be6d.entry.js} +1 -1
- package/dist/shift-components/p-f99c8b2f.js +5 -0
- package/dist/shift-components/shift-components.esm.js +1 -1
- package/dist/types/components/part-lookup/dead-stock-lookup.d.ts +8 -3
- package/dist/types/components/part-lookup/distributor-lookup.d.ts +7 -2
- package/dist/types/components/part-lookup/manufacturer-lookup.d.ts +7 -2
- package/dist/types/components.d.ts +8 -2
- package/dist/types/global/types/locales/error-schema.d.ts +4 -0
- package/dist/types/global/types/locales/index.d.ts +4 -18
- package/dist/types/global/types/locales/vehicle-lookup/dynamic-redeem-schema.d.ts +0 -18
- package/dist/types/global/types/locales/vehicle-lookup/index.d.ts +0 -18
- package/package.json +1 -1
- package/dist/components/p-1d80419b.js +0 -5
- package/dist/components/p-1ea3089a.js +0 -5
- package/dist/components/p-2e747eb3.js +0 -5
- package/dist/components/p-4f99745c.js +0 -5
- package/dist/components/p-609c2470.js +0 -5
- package/dist/components/p-7360f9b1.js +0 -5
- package/dist/components/p-79ea7639.js +0 -5
- package/dist/components/p-d466b65f.js +0 -5
- package/dist/components/p-eb89583a.js +0 -5
- package/dist/components/p-f691e103.js +0 -5
- package/dist/shift-components/p-062cd94b.entry.js +0 -5
- package/dist/shift-components/p-0e0b69a1.entry.js +0 -5
- package/dist/shift-components/p-2e747eb3.js +0 -5
- package/dist/shift-components/p-c4efbdc3.js +0 -5
- package/dist/shift-components/p-d49f73db.entry.js +0 -5
- package/dist/shift-components/p-e36c54d0.entry.js +0 -5
|
@@ -7,10 +7,12 @@
|
|
|
7
7
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
8
8
|
|
|
9
9
|
const index = require('./index-846c93d2.js');
|
|
10
|
-
const Loading = require('./Loading-6f4f0127.js');
|
|
11
10
|
const cn = require('./cn-f559f9e5.js');
|
|
12
|
-
const partInformation = require('./partInformation-2b4e0593.js');
|
|
13
11
|
const general = require('./general-a1e72036.js');
|
|
12
|
+
const getLocalLanguage = require('./get-local-language-6b6b182f.js');
|
|
13
|
+
const Loading = require('./Loading-6f4f0127.js');
|
|
14
|
+
const partInformation = require('./partInformation-16ea1f8e.js');
|
|
15
|
+
require('./index.esm-c628daeb.js');
|
|
14
16
|
|
|
15
17
|
const manufacturerLookupCss = "*,: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}.relative{position:relative}.mx-auto{margin-left:auto;margin-right:auto}.mt-\\[12px\\]{margin-top:12px}.flex{display:flex}.grid{display:grid}.h-\\[40px\\]{height:40px}.min-h-\\[100px\\]{min-height:100px}.w-fit{width:fit-content}.w-full{width:100%}.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))}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.flex-col{flex-direction:column}.items-center{align-items:center}.justify-center{justify-content:center}.gap-\\[15px\\]{gap:15px}.gap-\\[50px\\]{gap:50px}.overflow-hidden{overflow:hidden}.rounded-\\[4px\\]{border-radius:4px}.rounded-\\[8px\\]{border-radius:8px}.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))}.border-b-\\[gray\\]{--tw-border-opacity:1;border-bottom-color:rgb(128 128 128/var(--tw-border-opacity,1))}.bg-\\[\\#e1e3e5\\]{--tw-bg-opacity:1;background-color:rgb(225 227 229/var(--tw-bg-opacity,1))}.px-0{padding-left:0;padding-right:0}.px-\\[16px\\]{padding-left:16px;padding-right:16px}.px-\\[30px\\]{padding-left:30px;padding-right:30px}.py-\\[10px\\]{padding-bottom:10px;padding-top:10px}.py-\\[16px\\]{padding-bottom:16px;padding-top:16px}.py-\\[8px\\]{padding-bottom:8px;padding-top:8px}.text-center{text-align:center}.text-\\[18px\\]{font-size:18px}.text-\\[20px\\]{font-size:20px}.capitalize{text-transform:capitalize}.text-\\[\\#383c43\\]{--tw-text-opacity:1;color:rgb(56 60 67/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)}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.transition-all{transition-duration:.15s;transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1)}.duration-300{transition-duration:.3s}.duration-700{transition-duration:.7s}.reject-card{background-color:#f7d7d8;border-color:#f2aeb5;color:#58151c}.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}.duration-100{transition-duration:.1s}";
|
|
16
18
|
const ManufacturerLookupStyle0 = manufacturerLookupCss;
|
|
@@ -23,14 +25,22 @@ const ManufacturerLookup = class {
|
|
|
23
25
|
this.isDev = false;
|
|
24
26
|
this.queryString = '';
|
|
25
27
|
this.hiddenFields = '';
|
|
28
|
+
this.language = 'en';
|
|
26
29
|
this.localizationName = '';
|
|
27
30
|
this.headerTitle = 'Manufacturer';
|
|
28
31
|
this.loadingStateChange = undefined;
|
|
29
32
|
this.loadedResponse = undefined;
|
|
30
33
|
this.state = 'idle';
|
|
31
|
-
this.externalPartNumber = null;
|
|
32
34
|
this.errorMessage = null;
|
|
33
35
|
this.partInformation = undefined;
|
|
36
|
+
this.externalPartNumber = null;
|
|
37
|
+
this.locale = getLocalLanguage.localeSchema.getDefault();
|
|
38
|
+
}
|
|
39
|
+
async componentWillLoad() {
|
|
40
|
+
await this.changeLanguage(this.language);
|
|
41
|
+
}
|
|
42
|
+
async changeLanguage(newLanguage) {
|
|
43
|
+
this.locale = await getLocalLanguage.getLocaleLanguage(newLanguage);
|
|
34
44
|
}
|
|
35
45
|
handleSettingData(response) {
|
|
36
46
|
this.partInformation = response;
|
|
@@ -70,6 +80,7 @@ const ManufacturerLookup = class {
|
|
|
70
80
|
catch (error) {
|
|
71
81
|
if (error && (error === null || error === void 0 ? void 0 : error.name) === 'AbortError')
|
|
72
82
|
return;
|
|
83
|
+
console.error(error);
|
|
73
84
|
this.state = 'error';
|
|
74
85
|
this.partInformation = null;
|
|
75
86
|
this.errorMessage = error.message;
|
|
@@ -109,10 +120,11 @@ const ManufacturerLookup = class {
|
|
|
109
120
|
]
|
|
110
121
|
: [];
|
|
111
122
|
const displayedManufacturerData = manufacturerData.filter(part => !hiddenFields.includes(part.key));
|
|
112
|
-
return (index.h(index.Host, { key: '
|
|
123
|
+
return (index.h(index.Host, { key: '240952c91ef587f359edb5a4d1a56bf460c73802' }, index.h("div", { key: '8e59a7dfcc2f4b04d113c0a865d35e679a68d9ea', dir: this.locale.direction, class: "min-h-[100px] relative transition-all duration-300 overflow-hidden" }, index.h("div", { key: '4996dad1f8281e707cb7bfbc4dbb63b12504e48e' }, index.h(Loading.Loading, { key: 'b22faa9d2e6b31a8225a03725ffe101200c0dd0a', isLoading: this.state.includes('loading') }), index.h("div", { key: '499e795f1721619a42a316d0400ff02a218f6958', 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: 'ac7386925ffff92a1c8e3936ff0c817046c1968d', class: "py-[16px]" }, index.h("div", { key: '90510c25179ef9d852b6e5f3ccc641c0bf7ebd30', 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: '02d9d4409ec8bb3cab30d91bf42789c59a11bb99' }, index.h("div", { key: '52e64a6ae5be9a057f823aa7390392d9bae84d5b', class: "flex mt-[12px] overflow-hidden rounded-[4px] flex-col border border-[#d6d8dc]" }, index.h("div", { key: 'f9f2ec608d422b7ad8c69b5bcb3ce733aaf42e83', 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", { key: '71fab2926dffdf7272544f82522fcec45cf2139a', class: "px-[30px] py-[10px] flex flex-col gap-[15px]" }, index.h("div", { key: 'ad48f4d4df7207f04b03cb8c7c10445246852230', class: "grid grid-cols-3 gap-[50px]" }, displayedManufacturerData.map(({ label, value, 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), index.h("div", { class: "py-[10px] px-0" }, value))))))))))))));
|
|
113
124
|
}
|
|
114
125
|
get el() { return index.getElement(this); }
|
|
115
126
|
static get watchers() { return {
|
|
127
|
+
"language": ["changeLanguage"],
|
|
116
128
|
"state": ["loadingListener"]
|
|
117
129
|
}; }
|
|
118
130
|
};
|
|
@@ -24,7 +24,7 @@ const getPartInformation = async (component, generalProps, headers = {}) => {
|
|
|
24
24
|
}
|
|
25
25
|
else {
|
|
26
26
|
if (!baseUrl)
|
|
27
|
-
throw new Error('
|
|
27
|
+
throw new Error('noBaseUrl');
|
|
28
28
|
const response = await fetch(`${baseUrl}${partNumber}?${queryString}`, { signal: abortController.signal, headers: headers });
|
|
29
29
|
const newData = (await response.json());
|
|
30
30
|
return handleResult(newData);
|
|
@@ -23,7 +23,7 @@ var patchBrowser = () => {
|
|
|
23
23
|
|
|
24
24
|
patchBrowser().then(async (options) => {
|
|
25
25
|
await appGlobals.globalScripts();
|
|
26
|
-
return index.bootstrapLazy([["vehicle-lookup.cjs",[[4,"vehicle-lookup",{"activeElement":[1,"active-element"],"baseUrl":[1,"base-url"],"isDev":[4,"is-dev"],"queryString":[1,"query-string"],"language":[1],"blazorErrorStateListener":[1,"blazor-error-state-listener"],"blazorOnLoadingStateChange":[1,"blazor-on-loading-state-change"],"errorStateListener":[16],"loadingStateChanged":[16],"wrapperErrorState":[32],"blazorRef":[32],"setBlazorRef":[64],"fetchVin":[64],"getPageContext":[64]},null,{"wrapperErrorState":["errorListener"],"onLoadingStateChanged":["handleLoadingListenerPropChange"],"blazorOnLoadingStateChange":["handleBlazorLoadingRefChange"]}]]],["general-inquiry-form.cjs",[[1,"general-inquiry-form",{"isLoading":[32],"renderControl":[32]}]]],["dead-stock-lookup.cjs",[[1,"dead-stock-lookup",{"baseUrl":[1,"base-url"],"isDev":[4,"is-dev"],"queryString":[1,"query-string"],"loadingStateChange":[16],"loadedResponse":[16],"state":[32],"
|
|
26
|
+
return index.bootstrapLazy([["vehicle-lookup.cjs",[[4,"vehicle-lookup",{"activeElement":[1,"active-element"],"baseUrl":[1,"base-url"],"isDev":[4,"is-dev"],"queryString":[1,"query-string"],"language":[1],"blazorErrorStateListener":[1,"blazor-error-state-listener"],"blazorOnLoadingStateChange":[1,"blazor-on-loading-state-change"],"errorStateListener":[16],"loadingStateChanged":[16],"wrapperErrorState":[32],"blazorRef":[32],"setBlazorRef":[64],"fetchVin":[64],"getPageContext":[64]},null,{"wrapperErrorState":["errorListener"],"onLoadingStateChanged":["handleLoadingListenerPropChange"],"blazorOnLoadingStateChange":["handleBlazorLoadingRefChange"]}]]],["general-inquiry-form.cjs",[[1,"general-inquiry-form",{"isLoading":[32],"renderControl":[32]}]]],["dead-stock-lookup.cjs",[[1,"dead-stock-lookup",{"baseUrl":[1,"base-url"],"isDev":[4,"is-dev"],"queryString":[1,"query-string"],"language":[1],"loadingStateChange":[16],"loadedResponse":[16],"state":[32],"errorMessage":[32],"partInformation":[32],"externalPartNumber":[32],"locale":[32],"setData":[64],"fetchData":[64],"setMockData":[64]},null,{"language":["changeLanguage"],"state":["loadingListener"]}]]],["distributor-lookup.cjs",[[1,"distributor-lookup",{"baseUrl":[1,"base-url"],"isDev":[4,"is-dev"],"queryString":[1,"query-string"],"hiddenFields":[1,"hidden-fields"],"language":[1],"localizationName":[1,"localization-name"],"loadingStateChange":[16],"loadedResponse":[16],"state":[32],"errorMessage":[32],"partInformation":[32],"externalPartNumber":[32],"locale":[32],"setData":[64],"fetchData":[64],"setMockData":[64]},null,{"language":["changeLanguage"],"state":["loadingListener"]}]]],["manufacturer-lookup.cjs",[[1,"manufacturer-lookup",{"baseUrl":[1,"base-url"],"isDev":[4,"is-dev"],"queryString":[1,"query-string"],"hiddenFields":[1,"hidden-fields"],"language":[1],"localizationName":[1,"localization-name"],"headerTitle":[1,"header-title"],"loadingStateChange":[16],"loadedResponse":[16],"state":[32],"errorMessage":[32],"partInformation":[32],"externalPartNumber":[32],"locale":[32],"setData":[64],"fetchData":[64],"setMockData":[64]},null,{"language":["changeLanguage"],"state":["loadingListener"]}]]],["form-input.cjs",[[0,"form-input",{"name":[1],"label":[1],"class":[1],"isError":[4,"is-error"],"disabled":[4],"labelClass":[1,"label-class"],"errorClass":[1,"error-class"],"errorMessage":[1,"error-message"],"containerClass":[1,"container-class"]}]]],["dynamic-redeem.cjs",[[1,"dynamic-redeem",{"vin":[1],"item":[16],"language":[1],"canceledItems":[16],"unInvoicedByBrokerName":[1,"un-invoiced-by-broker-name"],"handleScanner":[16],"handleQrChanges":[16],"loadingStateChange":[16],"locale":[32],"isLoading":[32],"internalVin":[32],"isOpened":[32],"internalItem":[32],"confirmServiceCancellation":[32],"internalCanceledItem":[32],"confirmUnInvoicedTBPVehicles":[32],"quite":[64],"getQrValue":[64]},null,{"language":["changeLanguage"],"isLoading":["onIsLoadingChange"],"canceledItems":["changeInternalCanceledItem"],"unInvoicedByBrokerName":["changeConfirmUnInvoicedTBPVehicles"],"vin":["changeInternalVin"],"item":["changeInternalItem"]}]]],["dynamic-claim_6.cjs",[[1,"dynamic-claim",{"baseUrl":[1,"base-url"],"isDev":[4,"is-dev"],"queryString":[1,"query-string"],"language":[1],"loadingStateChange":[16],"loadedResponse":[16],"locale":[32],"isIdle":[32],"popupClasses":[32],"isLoading":[32],"externalVin":[32],"errorMessage":[32],"activePopupIndex":[32],"vehicleInformation":[32],"setMockData":[64],"setData":[64],"fetchData":[64],"completeClaim":[64]},null,{"language":["changeLanguage"],"isLoading":["onLoadingChange"],"vehicleInformation":["resetProgressBar"],"popupClasses":["windowScrollListener"]}],[1,"paint-thickness",{"baseUrl":[1,"base-url"],"isDev":[4,"is-dev"],"queryString":[1,"query-string"],"language":[1],"loadingStateChange":[16],"loadedResponse":[16],"locale":[32],"state":[32],"externalVin":[32],"expandedImage":[32],"errorMessage":[32],"vehicleInformation":[32],"setData":[64],"fetchData":[64],"setMockData":[64]},null,{"language":["changeLanguage"],"state":["loadingListener"]}],[1,"service-history",{"baseUrl":[1,"base-url"],"isDev":[4,"is-dev"],"queryString":[1,"query-string"],"language":[1],"loadingStateChange":[16],"loadedResponse":[16],"locale":[32],"state":[32],"externalVin":[32],"errorMessage":[32],"vehicleInformation":[32],"setData":[64],"fetchData":[64],"setMockData":[64]},null,{"language":["changeLanguage"],"state":["loadingListener"]}],[1,"vehicle-accessories",{"baseUrl":[1,"base-url"],"isDev":[4,"is-dev"],"queryString":[1,"query-string"],"language":[1],"loadingStateChange":[16],"loadedResponse":[16],"locale":[32],"state":[32],"externalVin":[32],"expandedImage":[32],"errorMessage":[32],"vehicleInformation":[32],"setData":[64],"fetchData":[64],"setMockData":[64]},null,{"language":["changeLanguage"],"state":["loadingListener"]}],[1,"vehicle-specification",{"baseUrl":[1,"base-url"],"isDev":[4,"is-dev"],"queryString":[1,"query-string"],"language":[1],"loadingStateChange":[16],"loadedResponse":[16],"locale":[32],"state":[32],"externalVin":[32],"errorMessage":[32],"vehicleInformation":[32],"setData":[64],"fetchData":[64],"setMockData":[64]},null,{"language":["changeLanguage"],"state":["loadingListener"]}],[1,"warranty-details",{"baseUrl":[1,"base-url"],"isDev":[4,"is-dev"],"showSsc":[4,"show-ssc"],"queryString":[1,"query-string"],"recaptchaKey":[1,"recaptcha-key"],"language":[1],"showWarranty":[4,"show-warranty"],"unauthorizedSscLookupBaseUrl":[1,"unauthorized-ssc-lookup-base-url"],"unauthorizedSscLookupQueryString":[1,"unauthorized-ssc-lookup-query-string"],"cityId":[1,"city-id"],"cityIntegrationId":[1,"city-integration-id"],"companyId":[1,"company-id"],"companyIntegrationId":[1,"company-integration-id"],"companyBranchId":[1,"company-branch-id"],"companyBranchIntegrationId":[1,"company-branch-integration-id"],"userId":[1,"user-id"],"brandIntegrationId":[1,"brand-integration-id"],"customerName":[1,"customer-name"],"customerPhone":[1,"customer-phone"],"customerEmail":[1,"customer-email"],"loadingStateChange":[16],"loadedResponse":[16],"state":[32],"externalVin":[32],"showRecaptcha":[32],"errorMessage":[32],"unInvoicedByBrokerName":[32],"vehicleInformation":[32],"checkingUnauthorizedSSC":[32],"recaptchaRes":[32],"headers":[32],"locale":[32],"setData":[64],"fetchData":[64],"setMockData":[64]},null,{"language":["changeLanguage"],"state":["loadingListener"]}]]]], options);
|
|
27
27
|
});
|
|
28
28
|
|
|
29
29
|
exports.setNonce = index.setNonce;
|
|
@@ -3,9 +3,11 @@
|
|
|
3
3
|
* Copyright (c)
|
|
4
4
|
*/
|
|
5
5
|
import { Host, h } from "@stencil/core";
|
|
6
|
-
import {
|
|
7
|
-
import Loading from "../components/Loading";
|
|
6
|
+
import { localeSchema } from "../../global/types/locales/index";
|
|
8
7
|
import cn from "../../global/lib/cn";
|
|
8
|
+
import { getLocaleLanguage } from "../../global/lib/get-local-language";
|
|
9
|
+
import Loading from "../components/Loading";
|
|
10
|
+
import { getPartInformation } from "../../global/api/partInformation";
|
|
9
11
|
let mockData = {};
|
|
10
12
|
const closedAccordionHeight = '46px';
|
|
11
13
|
export class DeadStockLookup {
|
|
@@ -13,12 +15,20 @@ export class DeadStockLookup {
|
|
|
13
15
|
this.baseUrl = '';
|
|
14
16
|
this.isDev = false;
|
|
15
17
|
this.queryString = '';
|
|
18
|
+
this.language = 'en';
|
|
16
19
|
this.loadingStateChange = undefined;
|
|
17
20
|
this.loadedResponse = undefined;
|
|
18
21
|
this.state = 'idle';
|
|
19
|
-
this.externalPartNumber = null;
|
|
20
22
|
this.errorMessage = null;
|
|
21
23
|
this.partInformation = undefined;
|
|
24
|
+
this.externalPartNumber = null;
|
|
25
|
+
this.locale = localeSchema.getDefault();
|
|
26
|
+
}
|
|
27
|
+
async componentWillLoad() {
|
|
28
|
+
await this.changeLanguage(this.language);
|
|
29
|
+
}
|
|
30
|
+
async changeLanguage(newLanguage) {
|
|
31
|
+
this.locale = await getLocaleLanguage(newLanguage);
|
|
22
32
|
}
|
|
23
33
|
handleSettingData(response) {
|
|
24
34
|
this.partInformation = response;
|
|
@@ -58,6 +68,7 @@ export class DeadStockLookup {
|
|
|
58
68
|
catch (error) {
|
|
59
69
|
if (error && (error === null || error === void 0 ? void 0 : error.name) === 'AbortError')
|
|
60
70
|
return;
|
|
71
|
+
console.error(error);
|
|
61
72
|
this.state = 'error';
|
|
62
73
|
this.partInformation = null;
|
|
63
74
|
this.errorMessage = error.message;
|
|
@@ -92,7 +103,7 @@ export class DeadStockLookup {
|
|
|
92
103
|
}
|
|
93
104
|
render() {
|
|
94
105
|
var _a, _b;
|
|
95
|
-
return (h(Host, { key: '
|
|
106
|
+
return (h(Host, { key: '6e4ae6ad08a5ddc15fe5146953d1d2a07038835d' }, h("div", { key: '85c386f5c877f71d064be8f308e4408c01155eb1', dir: this.locale.direction, class: "min-h-[100px] relative transition-all duration-300 overflow-hidden" }, h("div", { key: '71930858160fcaacfe90d18bea2c48bb413c9e9c' }, h(Loading, { key: '4d1f90ee35055e7046b0df380a631b8ca65aa62f', isLoading: this.state.includes('loading') }), h("div", { key: 'b5c3e8ec0f8560363f8268e1975c7ca039b6edbb', 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", { key: '3e928834d4562f5cbe05e451768b668fc9067e61', class: "py-[16px]" }, h("div", { key: '6dd21bc59f9636a706f4094364eeab7141a88c52', 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", { key: '415d90744dd72e7d7f4e65ca2e83e16131f33c62' }, h("div", { key: 'a659d9b44da828b63f8896c45dcffff3e9e0931f', class: "flex mt-[12px] max-h-[70dvh] overflow-hidden rounded-[4px] flex-col border border-[#d6d8dc]" }, h("div", { key: '1e55efab0617d36b8f3b816bc391a828fcd3089c', class: "w-full h-[40px] flex shrink-0 justify-center text-[18px] items-center text-[#383c43] text-center bg-[#e1e3e5]" }, "Dead stock"), (_b = (_a = this.partInformation) === null || _a === void 0 ? void 0 : _a.deadStock) === null || _b === void 0 ? void 0 :
|
|
96
107
|
_b.map(deadStock => (h("div", { key: deadStock.companyIntegrationID, class: "py-[10px] px-[20px]" }, h("div", { "aria-expanded": "false", style: { height: closedAccordionHeight }, class: "border shadow transition-all duration-500 overflow-hidden rounded-md mb-[10px] border-[#d6d8dc]" }, h("button", { onClick: this.toggleAccordion, style: { height: closedAccordionHeight }, class: "w-full flex px-[10px] justify-between items-center text-slate-800" }, h("strong", null, deadStock.companyName), h("span", { class: "icon text-slate-800 transition-transform duration-500" }, h("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 16 16", fill: "currentColor", class: "size-[22px]" }, 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" })))), h("div", { class: "content" }, h("table", { class: "w-full overflow-auto relative border-collapse" }, h("thead", null, h("tr", null, h("th", { class: "py-[20px] px-[10px] text-left whitespace-nowrap border-b border-[#d6d8dc]" }, "Branch"), h("th", { class: "py-[20px] px-[10px] text-left whitespace-nowrap border-b border-[#d6d8dc]" }, "Available Qty"))), h("tbody", null, deadStock === null || deadStock === void 0 ? void 0 : deadStock.branchDeadStock.map(branchDeadStock => (h("tr", { class: "transition-colors border-b border-[#d6d8dc] last:border-none duration-100 hover:bg-slate-100", key: branchDeadStock.companyBranchIntegrationID }, h("td", { class: cn('py-[20px] px-[10px] text-left whitespace-nowrap') }, branchDeadStock.companyBranchName), h("td", { class: cn('py-[20px] px-[10px] text-left whitespace-nowrap') }, h("strong", null, branchDeadStock.quantity))))))))))))))))))));
|
|
97
108
|
}
|
|
98
109
|
static get is() { return "dead-stock-lookup"; }
|
|
@@ -163,6 +174,30 @@ export class DeadStockLookup {
|
|
|
163
174
|
"reflect": false,
|
|
164
175
|
"defaultValue": "''"
|
|
165
176
|
},
|
|
177
|
+
"language": {
|
|
178
|
+
"type": "string",
|
|
179
|
+
"mutable": false,
|
|
180
|
+
"complexType": {
|
|
181
|
+
"original": "LanguageKeys",
|
|
182
|
+
"resolved": "\"ar\" | \"en\" | \"ku\"",
|
|
183
|
+
"references": {
|
|
184
|
+
"LanguageKeys": {
|
|
185
|
+
"location": "import",
|
|
186
|
+
"path": "~types/locales",
|
|
187
|
+
"id": "src/global/types/locales/index.ts::LanguageKeys"
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
},
|
|
191
|
+
"required": false,
|
|
192
|
+
"optional": false,
|
|
193
|
+
"docs": {
|
|
194
|
+
"tags": [],
|
|
195
|
+
"text": ""
|
|
196
|
+
},
|
|
197
|
+
"attribute": "language",
|
|
198
|
+
"reflect": false,
|
|
199
|
+
"defaultValue": "'en'"
|
|
200
|
+
},
|
|
166
201
|
"loadingStateChange": {
|
|
167
202
|
"type": "unknown",
|
|
168
203
|
"mutable": false,
|
|
@@ -204,9 +239,10 @@ export class DeadStockLookup {
|
|
|
204
239
|
static get states() {
|
|
205
240
|
return {
|
|
206
241
|
"state": {},
|
|
207
|
-
"externalPartNumber": {},
|
|
208
242
|
"errorMessage": {},
|
|
209
|
-
"partInformation": {}
|
|
243
|
+
"partInformation": {},
|
|
244
|
+
"externalPartNumber": {},
|
|
245
|
+
"locale": {}
|
|
210
246
|
};
|
|
211
247
|
}
|
|
212
248
|
static get methods() {
|
|
@@ -306,6 +342,9 @@ export class DeadStockLookup {
|
|
|
306
342
|
static get elementRef() { return "el"; }
|
|
307
343
|
static get watchers() {
|
|
308
344
|
return [{
|
|
345
|
+
"propName": "language",
|
|
346
|
+
"methodName": "changeLanguage"
|
|
347
|
+
}, {
|
|
309
348
|
"propName": "state",
|
|
310
349
|
"methodName": "loadingListener"
|
|
311
350
|
}];
|
|
@@ -5,6 +5,8 @@
|
|
|
5
5
|
import { Host, h } from "@stencil/core";
|
|
6
6
|
import cn from "../../global/lib/cn";
|
|
7
7
|
import { capitalize } from "../../global/lib/general";
|
|
8
|
+
import { getLocaleLanguage } from "../../global/lib/get-local-language";
|
|
9
|
+
import { localeSchema } from "../../global/types/locales/index";
|
|
8
10
|
import { getPartInformation } from "../../global/api/partInformation";
|
|
9
11
|
import Loading from "../components/Loading";
|
|
10
12
|
let mockData = {};
|
|
@@ -14,13 +16,21 @@ export class DistributorLookup {
|
|
|
14
16
|
this.isDev = false;
|
|
15
17
|
this.queryString = '';
|
|
16
18
|
this.hiddenFields = '';
|
|
19
|
+
this.language = 'en';
|
|
17
20
|
this.localizationName = '';
|
|
18
21
|
this.loadingStateChange = undefined;
|
|
19
22
|
this.loadedResponse = undefined;
|
|
20
23
|
this.state = 'idle';
|
|
21
|
-
this.externalPartNumber = null;
|
|
22
24
|
this.errorMessage = null;
|
|
23
25
|
this.partInformation = undefined;
|
|
26
|
+
this.externalPartNumber = null;
|
|
27
|
+
this.locale = localeSchema.getDefault();
|
|
28
|
+
}
|
|
29
|
+
async componentWillLoad() {
|
|
30
|
+
await this.changeLanguage(this.language);
|
|
31
|
+
}
|
|
32
|
+
async changeLanguage(newLanguage) {
|
|
33
|
+
this.locale = await getLocaleLanguage(newLanguage);
|
|
24
34
|
}
|
|
25
35
|
handleSettingData(response) {
|
|
26
36
|
this.partInformation = response;
|
|
@@ -60,6 +70,7 @@ export class DistributorLookup {
|
|
|
60
70
|
catch (error) {
|
|
61
71
|
if (error && (error === null || error === void 0 ? void 0 : error.name) === 'AbortError')
|
|
62
72
|
return;
|
|
73
|
+
console.error(error);
|
|
63
74
|
this.state = 'error';
|
|
64
75
|
this.partInformation = null;
|
|
65
76
|
this.errorMessage = error.message;
|
|
@@ -94,7 +105,7 @@ export class DistributorLookup {
|
|
|
94
105
|
const displayDistributer = this.partInformation
|
|
95
106
|
? !this.partInformation.stockParts.some(({ quantityLookUpResult }) => quantityLookUpResult === 'LookupIsSkipped' || quantityLookUpResult === 'QuantityNotWithinLookupThreshold')
|
|
96
107
|
: false;
|
|
97
|
-
return (h(Host, { key: '
|
|
108
|
+
return (h(Host, { key: 'e98cdb5d363200db122ed0100f591462c5f37af2' }, h("div", { key: 'f4b850d2247759ed7a060064924e0c48356c1527', dir: this.locale.direction, class: "min-h-[100px] relative transition-all duration-300 overflow-hidden" }, h("div", { key: '2fbd7dabccc4949c8d8efd6891addde68a429293' }, h(Loading, { key: 'b1e47d98eef64a800ec9bd3a5b069d289bfeeea2', isLoading: this.state.includes('loading') }), h("div", { key: '9679d81255f3e0198f8755904e537de4e6afe552', 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", { key: '4c1d5123ee5b4236885ba1bf1561de631c0efd3a', class: "py-[16px]" }, h("div", { key: '17d40851fb8a76d4737a9d224768c9afa592ecda', 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", { key: '027820e491b435e9cf8ef47357eeb77d147cd161' }, h("div", { key: '741d06d76a2d15ccd2b55e727c628123d16bc185', class: "flex mt-[12px] max-h-[70dvh] overflow-hidden rounded-[4px] flex-col border border-[#d6d8dc]" }, h("div", { key: '03843816d41d722e92d1cbd902f387096e232185', class: "w-full h-[40px] flex shrink-0 justify-center text-[18px] items-center text-[#383c43] text-center bg-[#e1e3e5]" }, "Info"), h("div", { key: 'f61b2d94e6acfd42f3e033d1d7534aa97f920d64', class: "py-[10px] px-[30px] flex flex-col gap-[15px]" }, h("div", { key: '14a2be07f2a55f438960edc2517c629fd76664d6', class: "grid grid-cols-3 gap-[50px]" }, displayedFields.map(({ label, value, key }) => (h("div", { key: key, class: "flex flex-col flex-1" }, h("strong", { class: "py-[10px] px-0 border-b-[gray] border-b" }, label), h("div", { class: "py-[10px] px-0" }, value))))))), displayDistributer && (h("div", { key: 'aadd189054ec8a4ed1136a53b5ce0fb61554370c', class: "flex mt-[12px] max-h-[70dvh] overflow-hidden rounded-[4px] flex-col border border-[#d6d8dc]" }, h("div", { key: 'f8c768548a0d9cac69a36bf20b0d28e6da5d0646', class: "w-full h-[40px] flex shrink-0 justify-center text-[18px] items-center text-[#383c43] text-center bg-[#e1e3e5]" }, "Distributor Stock"), h("div", { key: '207802621ce60285f6fa5548c52bdbbde40197fc', class: "flex flex-col gap-[15px]" }, h("table", { key: '8e39bc72148d479caf6d8b9c45381f0d77263d98', class: "w-full overflow-auto relative border-collapse" }, h("thead", { key: 'ea6575025fbe61ccbc854ac42c8ea8cadb3d0fcb', class: "top-0 font-bold sticky bg-white" }, h("tr", { key: '48a7230029048265e6be05832095aa6bb2614324' }, ['Location', 'Availability'].map(title => (h("th", { key: title, class: "px-[10px] py-[20px] text-center whitespace-nowrap border-b border-[#d6d8dc]" }, title))))), h("tbody", { key: '4c5eea82b7b51363f184e8473ab18ad4a4258494' }, (_c = this.partInformation) === null || _c === void 0 ? void 0 : _c.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]', {
|
|
98
109
|
'text-[green]': stock.quantityLookUpResult === 'Available',
|
|
99
110
|
'text-[orange]': stock.quantityLookUpResult === 'PartiallyAvailable',
|
|
100
111
|
}) }, h("strong", null, stock.quantityLookUpResult === 'Available'
|
|
@@ -189,6 +200,30 @@ export class DistributorLookup {
|
|
|
189
200
|
"reflect": false,
|
|
190
201
|
"defaultValue": "''"
|
|
191
202
|
},
|
|
203
|
+
"language": {
|
|
204
|
+
"type": "string",
|
|
205
|
+
"mutable": false,
|
|
206
|
+
"complexType": {
|
|
207
|
+
"original": "LanguageKeys",
|
|
208
|
+
"resolved": "\"ar\" | \"en\" | \"ku\"",
|
|
209
|
+
"references": {
|
|
210
|
+
"LanguageKeys": {
|
|
211
|
+
"location": "import",
|
|
212
|
+
"path": "~types/locales",
|
|
213
|
+
"id": "src/global/types/locales/index.ts::LanguageKeys"
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
},
|
|
217
|
+
"required": false,
|
|
218
|
+
"optional": false,
|
|
219
|
+
"docs": {
|
|
220
|
+
"tags": [],
|
|
221
|
+
"text": ""
|
|
222
|
+
},
|
|
223
|
+
"attribute": "language",
|
|
224
|
+
"reflect": false,
|
|
225
|
+
"defaultValue": "'en'"
|
|
226
|
+
},
|
|
192
227
|
"localizationName": {
|
|
193
228
|
"type": "string",
|
|
194
229
|
"mutable": false,
|
|
@@ -248,9 +283,10 @@ export class DistributorLookup {
|
|
|
248
283
|
static get states() {
|
|
249
284
|
return {
|
|
250
285
|
"state": {},
|
|
251
|
-
"externalPartNumber": {},
|
|
252
286
|
"errorMessage": {},
|
|
253
|
-
"partInformation": {}
|
|
287
|
+
"partInformation": {},
|
|
288
|
+
"externalPartNumber": {},
|
|
289
|
+
"locale": {}
|
|
254
290
|
};
|
|
255
291
|
}
|
|
256
292
|
static get methods() {
|
|
@@ -350,6 +386,9 @@ export class DistributorLookup {
|
|
|
350
386
|
static get elementRef() { return "el"; }
|
|
351
387
|
static get watchers() {
|
|
352
388
|
return [{
|
|
389
|
+
"propName": "language",
|
|
390
|
+
"methodName": "changeLanguage"
|
|
391
|
+
}, {
|
|
353
392
|
"propName": "state",
|
|
354
393
|
"methodName": "loadingListener"
|
|
355
394
|
}];
|
|
@@ -3,10 +3,12 @@
|
|
|
3
3
|
* Copyright (c)
|
|
4
4
|
*/
|
|
5
5
|
import { Host, h } from "@stencil/core";
|
|
6
|
-
import Loading from "../components/Loading";
|
|
7
6
|
import cn from "../../global/lib/cn";
|
|
8
|
-
import { getPartInformation } from "../../global/api/partInformation";
|
|
9
7
|
import { capitalize } from "../../global/lib/general";
|
|
8
|
+
import { getLocaleLanguage } from "../../global/lib/get-local-language";
|
|
9
|
+
import { localeSchema } from "../../global/types/locales/index";
|
|
10
|
+
import Loading from "../components/Loading";
|
|
11
|
+
import { getPartInformation } from "../../global/api/partInformation";
|
|
10
12
|
let mockData = {};
|
|
11
13
|
export class ManufacturerLookup {
|
|
12
14
|
constructor() {
|
|
@@ -14,14 +16,22 @@ export class ManufacturerLookup {
|
|
|
14
16
|
this.isDev = false;
|
|
15
17
|
this.queryString = '';
|
|
16
18
|
this.hiddenFields = '';
|
|
19
|
+
this.language = 'en';
|
|
17
20
|
this.localizationName = '';
|
|
18
21
|
this.headerTitle = 'Manufacturer';
|
|
19
22
|
this.loadingStateChange = undefined;
|
|
20
23
|
this.loadedResponse = undefined;
|
|
21
24
|
this.state = 'idle';
|
|
22
|
-
this.externalPartNumber = null;
|
|
23
25
|
this.errorMessage = null;
|
|
24
26
|
this.partInformation = undefined;
|
|
27
|
+
this.externalPartNumber = null;
|
|
28
|
+
this.locale = localeSchema.getDefault();
|
|
29
|
+
}
|
|
30
|
+
async componentWillLoad() {
|
|
31
|
+
await this.changeLanguage(this.language);
|
|
32
|
+
}
|
|
33
|
+
async changeLanguage(newLanguage) {
|
|
34
|
+
this.locale = await getLocaleLanguage(newLanguage);
|
|
25
35
|
}
|
|
26
36
|
handleSettingData(response) {
|
|
27
37
|
this.partInformation = response;
|
|
@@ -61,6 +71,7 @@ export class ManufacturerLookup {
|
|
|
61
71
|
catch (error) {
|
|
62
72
|
if (error && (error === null || error === void 0 ? void 0 : error.name) === 'AbortError')
|
|
63
73
|
return;
|
|
74
|
+
console.error(error);
|
|
64
75
|
this.state = 'error';
|
|
65
76
|
this.partInformation = null;
|
|
66
77
|
this.errorMessage = error.message;
|
|
@@ -100,7 +111,7 @@ export class ManufacturerLookup {
|
|
|
100
111
|
]
|
|
101
112
|
: [];
|
|
102
113
|
const displayedManufacturerData = manufacturerData.filter(part => !hiddenFields.includes(part.key));
|
|
103
|
-
return (h(Host, { key: '
|
|
114
|
+
return (h(Host, { key: '240952c91ef587f359edb5a4d1a56bf460c73802' }, h("div", { key: '8e59a7dfcc2f4b04d113c0a865d35e679a68d9ea', dir: this.locale.direction, class: "min-h-[100px] relative transition-all duration-300 overflow-hidden" }, h("div", { key: '4996dad1f8281e707cb7bfbc4dbb63b12504e48e' }, h(Loading, { key: 'b22faa9d2e6b31a8225a03725ffe101200c0dd0a', isLoading: this.state.includes('loading') }), h("div", { key: '499e795f1721619a42a316d0400ff02a218f6958', 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", { key: 'ac7386925ffff92a1c8e3936ff0c817046c1968d', class: "py-[16px]" }, h("div", { key: '90510c25179ef9d852b6e5f3ccc641c0bf7ebd30', 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", { key: '02d9d4409ec8bb3cab30d91bf42789c59a11bb99' }, h("div", { key: '52e64a6ae5be9a057f823aa7390392d9bae84d5b', class: "flex mt-[12px] overflow-hidden rounded-[4px] flex-col border border-[#d6d8dc]" }, h("div", { key: 'f9f2ec608d422b7ad8c69b5bcb3ce733aaf42e83', class: "w-full h-[40px] flex shrink-0 justify-center text-[18px] items-center text-[#383c43] text-center bg-[#e1e3e5]" }, this.headerTitle), h("div", { key: '71fab2926dffdf7272544f82522fcec45cf2139a', class: "px-[30px] py-[10px] flex flex-col gap-[15px]" }, h("div", { key: 'ad48f4d4df7207f04b03cb8c7c10445246852230', class: "grid grid-cols-3 gap-[50px]" }, displayedManufacturerData.map(({ label, value, key }) => (h("div", { key: key, class: "flex flex-col flex-1" }, h("strong", { class: "py-[10px] px-0 border-b-[gray] border-b" }, label), h("div", { class: "py-[10px] px-0" }, value))))))))))))));
|
|
104
115
|
}
|
|
105
116
|
static get is() { return "manufacturer-lookup"; }
|
|
106
117
|
static get encapsulation() { return "shadow"; }
|
|
@@ -188,6 +199,30 @@ export class ManufacturerLookup {
|
|
|
188
199
|
"reflect": false,
|
|
189
200
|
"defaultValue": "''"
|
|
190
201
|
},
|
|
202
|
+
"language": {
|
|
203
|
+
"type": "string",
|
|
204
|
+
"mutable": false,
|
|
205
|
+
"complexType": {
|
|
206
|
+
"original": "LanguageKeys",
|
|
207
|
+
"resolved": "\"ar\" | \"en\" | \"ku\"",
|
|
208
|
+
"references": {
|
|
209
|
+
"LanguageKeys": {
|
|
210
|
+
"location": "import",
|
|
211
|
+
"path": "~types/locales",
|
|
212
|
+
"id": "src/global/types/locales/index.ts::LanguageKeys"
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
},
|
|
216
|
+
"required": false,
|
|
217
|
+
"optional": false,
|
|
218
|
+
"docs": {
|
|
219
|
+
"tags": [],
|
|
220
|
+
"text": ""
|
|
221
|
+
},
|
|
222
|
+
"attribute": "language",
|
|
223
|
+
"reflect": false,
|
|
224
|
+
"defaultValue": "'en'"
|
|
225
|
+
},
|
|
191
226
|
"localizationName": {
|
|
192
227
|
"type": "string",
|
|
193
228
|
"mutable": false,
|
|
@@ -265,9 +300,10 @@ export class ManufacturerLookup {
|
|
|
265
300
|
static get states() {
|
|
266
301
|
return {
|
|
267
302
|
"state": {},
|
|
268
|
-
"externalPartNumber": {},
|
|
269
303
|
"errorMessage": {},
|
|
270
|
-
"partInformation": {}
|
|
304
|
+
"partInformation": {},
|
|
305
|
+
"externalPartNumber": {},
|
|
306
|
+
"locale": {}
|
|
271
307
|
};
|
|
272
308
|
}
|
|
273
309
|
static get methods() {
|
|
@@ -367,6 +403,9 @@ export class ManufacturerLookup {
|
|
|
367
403
|
static get elementRef() { return "el"; }
|
|
368
404
|
static get watchers() {
|
|
369
405
|
return [{
|
|
406
|
+
"propName": "language",
|
|
407
|
+
"methodName": "changeLanguage"
|
|
408
|
+
}, {
|
|
370
409
|
"propName": "state",
|
|
371
410
|
"methodName": "loadingListener"
|
|
372
411
|
}];
|
|
@@ -101,6 +101,7 @@ export class DynamicClaim {
|
|
|
101
101
|
catch (error) {
|
|
102
102
|
if (error && (error === null || error === void 0 ? void 0 : error.name) === 'AbortError')
|
|
103
103
|
return;
|
|
104
|
+
console.error(error);
|
|
104
105
|
this.isLoading = false;
|
|
105
106
|
this.vehicleInformation = null;
|
|
106
107
|
this.errorMessage = error.message;
|
|
@@ -282,7 +283,7 @@ export class DynamicClaim {
|
|
|
282
283
|
var _a, _b;
|
|
283
284
|
const serviceItems = ((_a = this.vehicleInformation) === null || _a === void 0 ? void 0 : _a.serviceItems) || [];
|
|
284
285
|
const texts = this.locale.vehicleLookup.dynamicClaim;
|
|
285
|
-
return (h(Host, { key: '
|
|
286
|
+
return (h(Host, { key: 'eae03b35a7067f0df313d4d36c1c610a51cb59e6' }, h("dynamic-redeem", { key: '4dca53c053a437120a488fea07f85794dd471031', language: this.language, id: "dynamic-redeem" }), h("div", { key: '4293fcc2195e751d4118a9064b30a835f76b5fa7', class: cn('dynamic-claim-wrapper', { loading: this.isLoading, idle: this.isIdle }) }, h("div", { key: '64b1e5073886f1b96ebaf6bccca921d468b81a1a', class: "dynamic-claim-header" }, h("strong", { key: '8d652b2ba5b658d633596b3cb67badd0adfcca4f', onAnimationEnd: this.removeLoadAnimationClass, class: "dynamic-claim-header-vin load-animation" }, this.errorMessage && (h("span", { key: 'd43a32b705fb761ccdc990e502aa5b614cc0c37e', dir: this.locale.direction, style: { color: 'red' } }, this.locale.errors[this.errorMessage] || this.locale.errors.wildCard)), !this.errorMessage && ((_b = this.vehicleInformation) === null || _b === void 0 ? void 0 : _b.vin))), h("div", { key: '774e18ad9e0bdce66813cca712bd152f96f3ba29', class: "dynamic-claim-body" }, h("div", { key: 'c8ccffc4f5fa61cb0f620530e5b25db5465b04e9', class: "loading-lane" }, h("div", { key: 'c8231fcb02ce2f708c2bbf60e5a812c384b42a80', class: "dynamic-claim-loading-slider" }, h("div", { key: 'e333b516efe3e89dcb6411b1ca3770812df4fc4f', class: "dynamic-claim-loading-slider-line" }), h("div", { key: '659b9698f22a73127bc3c81f18191a799f6d7303', class: "dynamic-claim-loading-slider-subline dynamic-claim-inc" }), h("div", { key: 'b4eb0acb6402db195ff118eb7457fa2efd3f2f6c', class: "dynamic-claim-loading-slider-subline dynamic-claim-dec" }))), h("div", { key: '1ddbadcb901e64352ac23f9ed272ddb066836a50', class: "dynamic-claim-progress-lane" }, serviceItems.map((item, idx) => {
|
|
286
287
|
let statusClass = '';
|
|
287
288
|
if (item.status === 'pending') {
|
|
288
289
|
if (serviceItems.findIndex(i => i.status === 'pending') === idx)
|
|
@@ -291,7 +292,7 @@ export class DynamicClaim {
|
|
|
291
292
|
else
|
|
292
293
|
statusClass = item.status;
|
|
293
294
|
return (h("div", { key: item.name, class: cn('dynamic-claim-item', statusClass), onMouseLeave: this.onMouseLeave }, h("div", { onAnimationEnd: this.removeLoadAnimationClass, class: "dynamic-claim-item-header load-animation", onMouseEnter: event => this.onMouseEnter(event.target, idx) }, h("img", { src: icons[item.status], alt: "status icon" }), h("span", null, texts[item.status]), this.activePopupIndex === idx && this.createPopup(item)), h("div", { onAnimationEnd: this.removeLoadAnimationClass, class: "dynamic-claim-item-circle load-animation" }), h("p", { onAnimationEnd: this.removeLoadAnimationClass, class: "dynamic-claim-item-footer load-animation" }, item.name)));
|
|
294
|
-
}), h("div", { key: '
|
|
295
|
+
}), h("div", { key: 'ce4a02398dcde7edb5435837e7830c0bef2266fd', class: "dynamic-claim-progress-bar" }))))));
|
|
295
296
|
}
|
|
296
297
|
static get is() { return "dynamic-claim"; }
|
|
297
298
|
static get encapsulation() { return "shadow"; }
|
|
@@ -85,6 +85,7 @@ export class PaintThickness {
|
|
|
85
85
|
catch (error) {
|
|
86
86
|
if (error && (error === null || error === void 0 ? void 0 : error.name) === 'AbortError')
|
|
87
87
|
return;
|
|
88
|
+
console.error(error);
|
|
88
89
|
this.state = 'error';
|
|
89
90
|
this.vehicleInformation = null;
|
|
90
91
|
this.errorMessage = error.message;
|
|
@@ -104,11 +105,11 @@ export class PaintThickness {
|
|
|
104
105
|
var _a, _b;
|
|
105
106
|
const texts = this.locale.vehicleLookup.paintThickness;
|
|
106
107
|
const { imageGroups, parts } = (this === null || this === void 0 ? void 0 : this.vehicleInformation) ? (_a = this === null || this === void 0 ? void 0 : this.vehicleInformation) === null || _a === void 0 ? void 0 : _a.paintThickness : { imageGroups: [], parts: [] };
|
|
107
|
-
return (h(Host, { key: '
|
|
108
|
+
return (h(Host, { key: '63c26e93dfd02ecf3dedb8c02b90c53217ebac74' }, h("div", { key: '1afca3004303df017df436308db4f265f86f73c5', dir: this.locale.direction, class: "min-h-[100px] relative transition-all duration-300 overflow-hidden" }, h("div", { key: 'a13c70ca9d772e7e344db801e12c119698934dcb' }, h(Loading, { key: '8e0ec05cb31af7afd60b5d39c58474d081423c0c', isLoading: this.state.includes('loading') }), h("div", { key: '8e26c7228bae3709ec604aa76069023a928d5315', class: cn('transition-all duration-700', { 'scale-0': this.state.includes('loading') || this.state === 'idle', 'opacity-0': this.state.includes('loading') }) }, h("div", { key: 'fbbad92f671914f1de952cb9cf3e3a8d987d3170', class: cn('text-center pt-[4px] text-[20px]', { 'text-red-600': !!this.errorMessage }) }, (_b = this.vehicleInformation) === null || _b === void 0 ? void 0 : _b.vin), ['error', 'error-loading'].includes(this.state) && (h("div", { key: '2e86c841565522c2221084fff77787d36af5f0c9', class: "py-[16px]" }, h("div", { key: '73c67505be7dfe19ab2dc833ea6fde5d50a118cc', 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", { key: '00ef9f81a04ce61409ef0fe2d05c5e53c54e8ec9', class: "flex mt-[12px] w-full max-h-[70dvh] overflow-hidden mx-auto rounded-[4px] flex-col border border-[#d6d8dc]" }, h("div", { key: 'a5b578f25ed757ec44575e842b8dcccbe1c6f852', class: "w-full h-[40px] flex shrink-0 justify-center text-[18px] items-center text-[#383c43] text-center bg-[#e1e3e5]" }, texts.paintThickness), h("div", { key: '6312fc77ad4169509bd184f38a78fca84c826a55', class: "h-0 overflow-auto flex-1" }, !parts.length && h("div", { key: '6effdd6539fb90f4945352c03de92aefda585735', class: "h-[50px] px-[30px] flex items-center justify-center text-[18px]" }, texts.noData), !!parts.length && (h("table", { key: '7b873c31bca0834899609894e901efc871ca3bdc', class: "w-full overflow-auto relative border-collapse" }, h("thead", { key: 'e7525470ad10cbb85e2a648a272fb5e33dde9aee', class: "top-0 font-bold sticky bg-white" }, h("tr", { key: 'ae4518825cf0588211b4a8f22056404aa79aab9a' }, ['part', 'left', 'right'].map(title => (h("th", { key: title, class: "px-[15px] min-w-[100px] py-[15px] text-center whitespace-nowrap border-b border-[#d6d8dc]" }, texts[title]))))), h("tbody", { key: '68b428b4be79e61ecac8024bc763b69dbae763e2' }, parts.map((part, idx) => (h("tr", { class: "transition-colors duration-100 hover:bg-slate-100", key: part.part }, ['part', 'left', 'right'].map(key => (h("td", { key: part.part + key, class: cn('px-[10px] py-[20px] text-center whitespace-nowrap border-b border-[#d6d8dc]', {
|
|
108
109
|
'!border-none': idx === parts.length - 1,
|
|
109
|
-
}) }, part[key] || '...')))))))))))), ['data', 'data-loading'].includes(this.state) && (h("div", { key: '
|
|
110
|
+
}) }, part[key] || '...')))))))))))), ['data', 'data-loading'].includes(this.state) && (h("div", { key: '8960617e47afdc6db66912cca04729e05b7c0c4f' }, !imageGroups.length && h("div", { key: 'ff88633f24dab1ab3e1571b95a285b758d9607c9', class: "h-[40px] px-[30px] flex text-red-500 items-center justify-center text-[18px]" }, texts.noImageGroups), !!imageGroups.length && (h("div", { key: '838e0f573b5452a5154a92f5f97f613d610c7bf1', class: "py-[16px] gap-[16px] justify-center flex flex-wrap px-[24px] w-full" }, imageGroups.map(imageGroup => (h("div", { class: "shrink-0 rounded-lg shadow-sm border overflow-hidden flex flex-col", key: imageGroup.name }, h("h1", { class: "text-center border-b bg-slate-200 font-semibold p-[6px]" }, imageGroup.name), h("div", { class: "flex p-[12px] gap-[8px]" }, imageGroup.images.map(image => (h("div", { class: "flex gap-[8px]", key: image }, h("button", { onClick: ({ target }) => this.openImage(target, image), class: "shrink-0 relative ring-0 outline-none w-fit mx-auto [&_img]:hover:shadow-lg [&_div]:hover:!opacity-100 cursor-pointer" }, h("div", { class: "absolute flex-col justify-center gap-[4px] size-full flex items-center pointer-events-none hover:opacity-100 rounded-lg opacity-0 bg-black/40 transition-all duration-300" }, h("img", { src: Eye }), h("span", { class: "text-white" }, texts.expand)), h("img", { class: "w-auto h-[150px] cursor-pointer shadow-sm rounded-lg transition-all duration-300", src: image }))))))))), h("div", { key: '788024dce16b13c1509ae49fe69b5e48e1afc8ba', onClick: () => this.closeImage(), style: { backdropFilter: this.expandedImage ? 'blur(3px)' : 'blur(0px)' }, class: cn('pointer-events-none w-[100dvw] h-[100dvh] fixed top-0 z-10 left-0 opacity-0 bg-black/40 transition-all duration-400', {
|
|
110
111
|
'pointer-events-auto opacity-100 delay-200': this.expandedImage,
|
|
111
|
-
}) }, h("button", { key: '
|
|
112
|
+
}) }, h("button", { key: 'f3b66783393492c980e76f875aa8e15dd34467cb', class: "flex flex-col mt-[16px] items-center justify-center size-12 float-right mr-[16px]", onClick: () => this.closeImage() }, h("div", { key: '96729fd9b6be1cb392e5e0e990606dc49ec2bdbc', class: "h-1 w-12 rounded-full rotate-45 absolute bg-white" }), h("div", { key: 'ba4e7211b3cdb19195855eb353f1e12259039bff', class: "h-1 w-12 rounded-full -rotate-45 absolute bg-white" }))), h("img", { key: '7ea590ea5d9783fad22238ccbe5380424dd0c685', alt: "", id: "expanded-image", class: "fixed opacity-0 z-40 transition-all rounded-lg" }))))))))));
|
|
112
113
|
}
|
|
113
114
|
static get is() { return "paint-thickness"; }
|
|
114
115
|
static get encapsulation() { return "shadow"; }
|
|
@@ -69,6 +69,7 @@ export class ServiceHistory {
|
|
|
69
69
|
catch (error) {
|
|
70
70
|
if (error && (error === null || error === void 0 ? void 0 : error.name) === 'AbortError')
|
|
71
71
|
return;
|
|
72
|
+
console.error(error);
|
|
72
73
|
this.state = 'error';
|
|
73
74
|
this.vehicleInformation = null;
|
|
74
75
|
this.errorMessage = error.message;
|
|
@@ -87,7 +88,7 @@ export class ServiceHistory {
|
|
|
87
88
|
render() {
|
|
88
89
|
var _a, _b, _c, _d;
|
|
89
90
|
const texts = this.locale.vehicleLookup.serviceHistory;
|
|
90
|
-
return (h(Host, { key: '
|
|
91
|
+
return (h(Host, { key: 'f89ce7f17b78c775cbcee6a4db109ef3c00e6d29' }, h("div", { key: 'd6b942daf06542e542a04d3bb72068c5758c80e9', dir: this.locale.direction, class: "min-h-[100px] relative transition-all duration-300 overflow-hidden" }, h("div", { key: 'acf33e3e253eb114c443a7d987db2b5e5db1468e' }, h(Loading, { key: '74d21f31cf67f9b5959e6ba4af3ebaea10bb6b04', isLoading: this.state.includes('loading') }), h("div", { key: '803d65860d980d5bac019b749d75a5692b5dfa06', class: cn('transition-all duration-700', { 'scale-0': this.state.includes('loading') || this.state === 'idle', 'opacity-0': this.state.includes('loading') }) }, h("div", { key: '1e9672450bd13031d6079a2ed33e06a40e36a6bc', class: cn('text-center pt-[4px] text-[20px]', { 'text-red-600': !!this.errorMessage }) }, (_a = this.vehicleInformation) === null || _a === void 0 ? void 0 : _a.vin), ['error', 'error-loading'].includes(this.state) && (h("div", { key: 'b8b5edb12f6e38919945160d446e004cbc7ad6ba', class: "py-[16px]" }, h("div", { key: '9836f3fdca8b2b7307b95305bd26343d177ce52b', 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", { key: 'e591ba63512e82b6550aa9aee55a8fa406227b85', class: "flex mt-[12px] max-h-[70dvh] overflow-hidden rounded-[4px] flex-col border border-[#d6d8dc]" }, h("div", { key: 'd0fb2a760d372b9d1bff0470bbd05541a0214d9f', class: "w-full h-[40px] flex shrink-0 justify-center text-[18px] items-center text-[#383c43] text-center bg-[#e1e3e5]" }, texts.serviceHistory), h("div", { key: '9d9972cb39d1921b7bb4e4c5bd264c13b62ac0c2', class: "h-0 overflow-auto flex-1" }, !((_b = this.vehicleInformation) === null || _b === void 0 ? void 0 : _b.serviceHistory.length) && h("div", { key: '5c200eb45535a3e310d6aec7eee854a527b379fd', class: "h-[80px] flex items-center justify-center text-[18px]" }, texts.noData), !!((_c = this.vehicleInformation) === null || _c === void 0 ? void 0 : _c.serviceHistory.length) && (h("table", { key: '5d93b0cd99ca7f38631c36259c9d019b4b5234fd', class: "w-full overflow-auto relative border-collapse" }, h("thead", { key: 'bdd4ccde39e53fcbd15d4ccf27f0d504e1ba9d21', class: "top-0 font-bold sticky bg-white" }, h("tr", { key: '83d5b447ef3f5ee92314cb9be124ae316d196c22' }, ['branch', 'dealer', 'invoiceNumber', 'date', 'serviceType', 'odometer'].map(title => (h("th", { key: title, class: "px-[10px] py-[20px] text-center whitespace-nowrap border-b border-[#d6d8dc]" }, texts[title]))))), h("tbody", { key: 'f32901ca2350c6fadf44972681f909c2b27b7707' }, (_d = this.vehicleInformation) === null || _d === void 0 ? void 0 : _d.serviceHistory.map((service, idx) => (h("tr", { class: "transition-colors duration-100 hover:bg-slate-100", key: service.invoiceNumber }, ['branchName', 'companyName', 'invoiceNumber', 'serviceDate', 'serviceType', 'mileage'].map(serviceType => {
|
|
91
92
|
var _a;
|
|
92
93
|
return (h("td", { key: service.invoiceNumber + serviceType, class: cn('px-[10px] py-[20px] text-center whitespace-nowrap border-b border-[#d6d8dc]', {
|
|
93
94
|
'!border-none': idx === ((_a = this.vehicleInformation) === null || _a === void 0 ? void 0 : _a.serviceHistory.length) - 1,
|