adp-web-components 0.0.11 → 0.0.13
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 +27 -15
- package/dist/cjs/distributor-lookup.cjs.entry.js +30 -20
- package/dist/cjs/dynamic-claim.cjs.entry.js +7 -7
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/manufacturer-lookup.cjs.entry.js +7 -20
- package/dist/cjs/paint-thickness.cjs.entry.js +8 -21
- package/dist/cjs/{partInformation-2a6a018b.js → partInformation-07651204.js} +2 -2
- package/dist/cjs/service-history.cjs.entry.js +6 -19
- package/dist/cjs/shift-components.cjs.js +1 -1
- package/dist/cjs/vehicle-accessories.cjs.entry.js +8 -21
- package/dist/cjs/vehicle-specification.cjs.entry.js +6 -19
- package/dist/cjs/{vehicleInformation-4c1dcaf2.js → vehicleInformation-35c470fc.js} +5 -5
- package/dist/cjs/warranty-details.cjs.entry.js +10 -34
- package/dist/collection/components/dynamic-claim/dynamic-claim.js +16 -8
- package/dist/collection/components/paint-thickness/paint-thickness.js +17 -22
- package/dist/collection/components/part-lookup/dead-stock-lookup.css +1 -1
- package/dist/collection/components/part-lookup/dead-stock-lookup.js +49 -30
- package/dist/collection/components/part-lookup/distributor-lookup.css +1 -1
- package/dist/collection/components/part-lookup/distributor-lookup.js +39 -21
- package/dist/collection/components/part-lookup/manufacturer-lookup.css +1 -1
- package/dist/collection/components/part-lookup/manufacturer-lookup.js +16 -21
- package/dist/collection/components/service-history/service-history.js +15 -20
- package/dist/collection/components/vehicle-accessories/vehicle-accessories.js +17 -22
- package/dist/collection/components/vehicle-specification/vehicle-specification.js +15 -20
- package/dist/collection/components/warranty-details/warranty-details.js +21 -40
- package/dist/collection/global/api/partInformation.js +2 -2
- package/dist/collection/global/api/vehicleInformation.js +5 -5
- package/dist/collection/templates/vehicle-lookup.js +163 -96
- 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/manufacturer-lookup.js +1 -1
- package/dist/components/p-4f08bcb8.js +5 -0
- package/dist/components/p-c4fad245.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-specification.js +1 -1
- package/dist/components/warranty-details.js +1 -1
- package/dist/esm/dead-stock-lookup.entry.js +27 -15
- package/dist/esm/distributor-lookup.entry.js +30 -20
- package/dist/esm/dynamic-claim.entry.js +7 -7
- package/dist/esm/loader.js +1 -1
- package/dist/esm/manufacturer-lookup.entry.js +7 -20
- package/dist/esm/paint-thickness.entry.js +8 -21
- package/dist/esm/{partInformation-73ece994.js → partInformation-096a8f55.js} +2 -2
- package/dist/esm/service-history.entry.js +6 -19
- package/dist/esm/shift-components.js +1 -1
- package/dist/esm/vehicle-accessories.entry.js +8 -21
- package/dist/esm/vehicle-specification.entry.js +6 -19
- package/dist/esm/{vehicleInformation-f1081f83.js → vehicleInformation-f7290628.js} +5 -5
- package/dist/esm/warranty-details.entry.js +10 -34
- package/dist/shift-components/p-4f08bcb8.js +5 -0
- package/dist/shift-components/p-6b21ce2d.entry.js +5 -0
- package/dist/shift-components/p-7d85e912.entry.js +5 -0
- package/dist/shift-components/p-7f258017.entry.js +5 -0
- package/dist/shift-components/p-9653e992.entry.js +5 -0
- package/dist/shift-components/p-c4fad245.js +5 -0
- package/dist/shift-components/p-ca1e2e5b.entry.js +5 -0
- package/dist/shift-components/p-d1b9cd93.entry.js +5 -0
- package/dist/shift-components/p-d6f40c8d.entry.js +5 -0
- package/dist/shift-components/p-e05acce1.entry.js +5 -0
- package/dist/shift-components/p-faa8070a.entry.js +5 -0
- package/dist/shift-components/shift-components.esm.js +1 -1
- package/dist/types/components/dynamic-claim/dynamic-claim.d.ts +2 -2
- package/dist/types/components/paint-thickness/paint-thickness.d.ts +2 -2
- package/dist/types/components/part-lookup/dead-stock-lookup.d.ts +4 -5
- package/dist/types/components/part-lookup/distributor-lookup.d.ts +2 -2
- package/dist/types/components/part-lookup/manufacturer-lookup.d.ts +2 -2
- package/dist/types/components/service-history/service-history.d.ts +2 -2
- package/dist/types/components/vehicle-accessories/vehicle-accessories.d.ts +2 -2
- package/dist/types/components/vehicle-specification/vehicle-specification.d.ts +2 -2
- package/dist/types/components/warranty-details/warranty-details.d.ts +3 -4
- package/dist/types/components.d.ts +18 -18
- package/dist/types/global/api/partInformation.d.ts +1 -1
- package/dist/types/global/api/vehicleInformation.d.ts +1 -1
- package/package.json +1 -1
- package/dist/components/p-5df9bc5f.js +0 -5
- package/dist/components/p-d265c109.js +0 -5
- package/dist/shift-components/p-15f86441.entry.js +0 -5
- package/dist/shift-components/p-1ae3a61f.entry.js +0 -5
- package/dist/shift-components/p-5df9bc5f.js +0 -5
- package/dist/shift-components/p-8c261972.entry.js +0 -5
- package/dist/shift-components/p-9bd4471c.entry.js +0 -5
- package/dist/shift-components/p-9f790b14.entry.js +0 -5
- package/dist/shift-components/p-c113792c.entry.js +0 -5
- package/dist/shift-components/p-d265c109.js +0 -5
- package/dist/shift-components/p-dc9845ed.entry.js +0 -5
- package/dist/shift-components/p-e32b0798.entry.js +0 -5
- package/dist/shift-components/p-f759c597.entry.js +0 -5
|
@@ -9,7 +9,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
9
9
|
const index = require('./index-d4b5214c.js');
|
|
10
10
|
const cn = require('./cn-f559f9e5.js');
|
|
11
11
|
const loader = require('./loader-baf2418b.js');
|
|
12
|
-
const vehicleInformation = require('./vehicleInformation-
|
|
12
|
+
const vehicleInformation = require('./vehicleInformation-35c470fc.js');
|
|
13
13
|
|
|
14
14
|
const loaderSvg = 'data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9ImN1cnJlbnRDb2xvciIKICAgIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIiBjbGFzcz0ibHVjaWRlIGx1Y2lkZS1sb2FkZXIiPgogICAgPHBhdGggZD0iTTEyIDJ2NCIgLz4KICAgIDxwYXRoIGQ9Im0xNi4yIDcuOCAyLjktMi45IiAvPgogICAgPHBhdGggZD0iTTE4IDEyaDQiIC8+CiAgICA8cGF0aCBkPSJtMTYuMiAxNi4yIDIuOSAyLjkiIC8+CiAgICA8cGF0aCBkPSJNMTIgMTh2NCIgLz4KICAgIDxwYXRoIGQ9Im00LjkgMTkuMSAyLjktMi45IiAvPgogICAgPHBhdGggZD0iTTIgMTJoNCIgLz4KICAgIDxwYXRoIGQ9Im00LjkgNC45IDIuOSAyLjkiIC8+Cjwvc3ZnPg==';
|
|
15
15
|
|
|
@@ -110,6 +110,7 @@ const WarrantyDetails = class {
|
|
|
110
110
|
this.vehicleInformation = undefined;
|
|
111
111
|
this.checkingUnauthorizedSSC = false;
|
|
112
112
|
this.recaptchaRes = null;
|
|
113
|
+
this.headers = {};
|
|
113
114
|
}
|
|
114
115
|
handleSettingData(response) {
|
|
115
116
|
var _a, _b, _c;
|
|
@@ -142,7 +143,6 @@ const WarrantyDetails = class {
|
|
|
142
143
|
if (this.isDev) {
|
|
143
144
|
this.checkingUnauthorizedSSC = true;
|
|
144
145
|
this.showRecaptcha = false;
|
|
145
|
-
//this.calculateHeight(this.state);
|
|
146
146
|
await new Promise(r => setTimeout(r, 3000));
|
|
147
147
|
this.checkingUnauthorizedSSC = false;
|
|
148
148
|
const hasPendingSSC = Math.random() < 0.5 ? false : true;
|
|
@@ -150,17 +150,14 @@ const WarrantyDetails = class {
|
|
|
150
150
|
hasSSC: hasPendingSSC,
|
|
151
151
|
message: hasPendingSSC ? 'This Vehicle has a Pending SSC' : 'No Pending SSC',
|
|
152
152
|
};
|
|
153
|
-
//this.calculateHeight(this.state);
|
|
154
153
|
}
|
|
155
154
|
else {
|
|
156
155
|
this.checkingUnauthorizedSSC = true;
|
|
157
156
|
this.showRecaptcha = false;
|
|
158
|
-
|
|
157
|
+
///
|
|
159
158
|
const response = await fetch(`${this.unauthorizedSscLookupBaseUrl}${vin}/${(_a = this.vehicleInformation) === null || _a === void 0 ? void 0 : _a.sscLogId}?${this.unauthorizedSscLookupQueryString}`, {
|
|
160
159
|
signal: this.abortController.signal,
|
|
161
|
-
headers: {
|
|
162
|
-
'Ssc-Recaptcha-Token': recaptchaResponse,
|
|
163
|
-
},
|
|
160
|
+
headers: Object.assign(Object.assign({}, this.headers), { 'Ssc-Recaptcha-Token': recaptchaResponse }),
|
|
164
161
|
});
|
|
165
162
|
const vinResponse = await response.json();
|
|
166
163
|
if (vinResponse && this.networkTimeoutRef === scopedTimeoutRef) {
|
|
@@ -170,7 +167,6 @@ const WarrantyDetails = class {
|
|
|
170
167
|
hasSSC: hasPendingSSC,
|
|
171
168
|
message: hasPendingSSC ? 'This Vehicle has a Pending SSC' : 'No Pending SSC',
|
|
172
169
|
};
|
|
173
|
-
//this.calculateHeight(this.state);
|
|
174
170
|
}
|
|
175
171
|
else
|
|
176
172
|
throw new Error('Wrong response format');
|
|
@@ -183,8 +179,9 @@ const WarrantyDetails = class {
|
|
|
183
179
|
this.showRecaptcha = false;
|
|
184
180
|
}
|
|
185
181
|
}
|
|
186
|
-
async setData(newData) {
|
|
182
|
+
async setData(newData, headers = {}) {
|
|
187
183
|
this.recaptchaRes = null;
|
|
184
|
+
this.headers = headers;
|
|
188
185
|
clearTimeout(this.networkTimeoutRef);
|
|
189
186
|
clearInterval(this.recaptchaIntervalRef);
|
|
190
187
|
if (this.abortController)
|
|
@@ -196,7 +193,6 @@ const WarrantyDetails = class {
|
|
|
196
193
|
this.externalVin = vin;
|
|
197
194
|
try {
|
|
198
195
|
if (!vin || vin.trim().length === 0) {
|
|
199
|
-
//this.componentHeight = '0px';
|
|
200
196
|
this.state = 'idle';
|
|
201
197
|
return;
|
|
202
198
|
}
|
|
@@ -209,7 +205,7 @@ const WarrantyDetails = class {
|
|
|
209
205
|
scopedTimeoutRef = setTimeout(r, 600);
|
|
210
206
|
this.networkTimeoutRef = scopedTimeoutRef;
|
|
211
207
|
});
|
|
212
|
-
const vehicleResponse = isVinRequest ? await vehicleInformation.getVehicleInformation(this, { scopedTimeoutRef, vin, mockData }) : newData;
|
|
208
|
+
const vehicleResponse = isVinRequest ? await vehicleInformation.getVehicleInformation(this, { scopedTimeoutRef, vin, mockData }, headers) : newData;
|
|
213
209
|
if (this.networkTimeoutRef === scopedTimeoutRef) {
|
|
214
210
|
if (!vehicleResponse)
|
|
215
211
|
throw new Error('Wrong response format');
|
|
@@ -227,8 +223,8 @@ const WarrantyDetails = class {
|
|
|
227
223
|
this.errorMessage = error.message;
|
|
228
224
|
}
|
|
229
225
|
}
|
|
230
|
-
async fetchData(requestedVin = this.externalVin) {
|
|
231
|
-
await this.setData(requestedVin);
|
|
226
|
+
async fetchData(requestedVin = this.externalVin, headers = {}) {
|
|
227
|
+
await this.setData(requestedVin, headers);
|
|
232
228
|
}
|
|
233
229
|
async componentDidLoad() {
|
|
234
230
|
if (this.recaptchaKey !== '') {
|
|
@@ -240,39 +236,19 @@ const WarrantyDetails = class {
|
|
|
240
236
|
document.head.appendChild(script);
|
|
241
237
|
}
|
|
242
238
|
}
|
|
243
|
-
//calculateHeight(componentState: string) {
|
|
244
|
-
// if (componentState.includes('loading') && this.componentHeight === '0px') {
|
|
245
|
-
// this.componentHeight = '100px';
|
|
246
|
-
// } else if (componentState !== 'idle') {
|
|
247
|
-
// setTimeout(() => {
|
|
248
|
-
// this.componentHeight = `${this.wrapperRef.clientHeight}px`;
|
|
249
|
-
// }, 50);
|
|
250
|
-
// } else {
|
|
251
|
-
// this.componentHeight = '0px';
|
|
252
|
-
// }
|
|
253
|
-
//}
|
|
254
239
|
async setMockData(newMockData) {
|
|
255
240
|
mockData = newMockData;
|
|
256
241
|
}
|
|
257
|
-
onShowSscChange() {
|
|
258
|
-
//this.calculateHeight(this.state);
|
|
259
|
-
}
|
|
260
|
-
onShowWarrantyChange() {
|
|
261
|
-
//this.calculateHeight(this.state);
|
|
262
|
-
}
|
|
263
242
|
async loadingListener() {
|
|
264
|
-
//this.calculateHeight(newState);
|
|
265
243
|
if (this.loadingStateChange)
|
|
266
244
|
this.loadingStateChange(this.state.includes('loading'));
|
|
267
245
|
}
|
|
268
246
|
render() {
|
|
269
247
|
var _a, _b, _c, _d, _e;
|
|
270
|
-
return (index.h(index.Host, { key: '
|
|
248
|
+
return (index.h(index.Host, { key: '3c8f75a5285bcae20b14896f48219478873dc56f' }, index.h("div", { key: 'b87f7c2301163f6a8a59ea30005bf5fdce3084b3', class: "min-h-[100px] warranty" }, index.h("div", { key: '2e9eca00ba1b2b5a362966ce7bec90118a255be4' }, index.h(Loading, { key: 'e0dcf745ea9409ffd55f54a2b304bf448f00981d', isLoading: this.state.includes('loading') }), index.h("div", { key: 'ae2feac973e3ddfc3e8b38f1887f1f3ff2da0393', class: "transition duration-700", style: { transform: this.state.includes('loading') || this.state === 'idle' ? 'scale(0)' : 'scale(1)', opacity: this.state.includes('loading') ? '0' : '1' } }, (this.showSsc || this.showWarranty) && (index.h("div", { key: 'd27ea304918aad5f6fc6acce7ea4b4da89be5d7b', style: { color: !!this.errorMessage ? 'red' : 'black' }, class: "warranty-vin" }, (_a = this.vehicleInformation) === null || _a === void 0 ? void 0 : _a.vin)), ['error', 'error-loading'].includes(this.state) && (index.h("div", { key: '1f797e76bb68d350ff3b071a11d94cd72f031569', class: "py-4" }, index.h(StatusCard, { key: '4f674cc1259a7628bb565f737575108ef1882569', desc: this.errorMessage, className: "mx-auto reject-card max-w-500" }), ' ')), this.showWarranty && ['data', 'data-loading'].includes(this.state) && (index.h(CardsContainer, { key: '7c47e8a2c5dd921af1df7f8d2453a3897709dde3', isAuthorized: (_b = this.vehicleInformation) === null || _b === void 0 ? void 0 : _b.isAuthorized, unInvoicedByBrokerName: this.unInvoicedByBrokerName, warranty: (_c = this.vehicleInformation) === null || _c === void 0 ? void 0 : _c.warranty })), index.h("div", { key: '250484f60f45bc8470c074056cbd567017fb1fcd', style: Object.assign({}, (this.showRecaptcha ? { height: 'auto', padding: '16px 16px 0px 16px' } : { height: '0px' })), class: "recaptcha-container" }, index.h("slot", { key: '4e728a717fdc8b34a6c861a40ff0cf7ec9dacf95' })), ['data', 'data-loading'].includes(this.state) && this.recaptchaRes && (index.h("div", { key: 'aa3134245674835812a638b4d8ccf6da1baafc13', class: cn.cn('recaptcha-response', !this.recaptchaRes.hasSSC ? 'success-card' : 'reject-card ') }, this.recaptchaRes.message)), this.checkingUnauthorizedSSC && (index.h("div", { key: '33c4511869c04b4780285f35e19efee5362b6240', class: "loading-spinner", style: { marginTop: '20px', flexDirection: 'column' } }, index.h("div", { key: '69c77e7eff03943790b00030068ec3b25c86fb25' }, index.h("strong", { key: 'a6b3cf9c81dc0cf5dcad68189827428511eb289f' }, "Checking TMC")), index.h("img", { key: '812b2eb0ca00baa596ccf6e6e5e4943dccc89159', class: "spin", src: loader.loaderSvg }))), this.showSsc && ['data', 'data-loading'].includes(this.state) && ((_d = this.vehicleInformation) === null || _d === void 0 ? void 0 : _d.ssc) !== null && !!((_e = this.vehicleInformation) === null || _e === void 0 ? void 0 : _e.ssc.length) && (index.h(SSCTable, { key: 'be4c7f932929fc7aff56eb3fb6c45e5d2bd3ff1d', ssc: this.vehicleInformation.ssc })))))));
|
|
271
249
|
}
|
|
272
250
|
get el() { return index.getElement(this); }
|
|
273
251
|
static get watchers() { return {
|
|
274
|
-
"showSsc": ["onShowSscChange"],
|
|
275
|
-
"showWarranty": ["onShowWarrantyChange"],
|
|
276
252
|
"state": ["loadingListener"]
|
|
277
253
|
}; }
|
|
278
254
|
};
|
|
@@ -57,7 +57,7 @@ export class DynamicClaim {
|
|
|
57
57
|
async setMockData(newMockData) {
|
|
58
58
|
mockData = newMockData;
|
|
59
59
|
}
|
|
60
|
-
async setData(newData) {
|
|
60
|
+
async setData(newData, headers = {}) {
|
|
61
61
|
clearTimeout(this.networkTimeoutRef);
|
|
62
62
|
if (this.abortController)
|
|
63
63
|
this.abortController.abort();
|
|
@@ -77,7 +77,7 @@ export class DynamicClaim {
|
|
|
77
77
|
scopedTimeoutRef = setTimeout(r, 1000);
|
|
78
78
|
this.networkTimeoutRef = scopedTimeoutRef;
|
|
79
79
|
});
|
|
80
|
-
const vehicleResponse = isVinRequest ? await getVehicleInformation(this, { scopedTimeoutRef, vin, mockData }) : newData;
|
|
80
|
+
const vehicleResponse = isVinRequest ? await getVehicleInformation(this, { scopedTimeoutRef, vin, mockData }, headers) : newData;
|
|
81
81
|
if (this.networkTimeoutRef === scopedTimeoutRef) {
|
|
82
82
|
if (!vehicleResponse)
|
|
83
83
|
throw new Error('Wrong response format');
|
|
@@ -96,8 +96,8 @@ export class DynamicClaim {
|
|
|
96
96
|
this.errorMessage = error.message;
|
|
97
97
|
}
|
|
98
98
|
}
|
|
99
|
-
async fetchData(requestedVin = this.externalVin) {
|
|
100
|
-
await this.setData(requestedVin);
|
|
99
|
+
async fetchData(requestedVin = this.externalVin, headers = {}) {
|
|
100
|
+
await this.setData(requestedVin, headers);
|
|
101
101
|
}
|
|
102
102
|
onLoadingChange(newValue) {
|
|
103
103
|
if (this.loadingStateChange)
|
|
@@ -270,7 +270,7 @@ export class DynamicClaim {
|
|
|
270
270
|
render() {
|
|
271
271
|
var _a, _b;
|
|
272
272
|
const serviceItems = ((_a = this.vehicleInformation) === null || _a === void 0 ? void 0 : _a.serviceItems) || [];
|
|
273
|
-
return (h(Host, { key: '
|
|
273
|
+
return (h(Host, { key: '15b709f7252b85f308c880576dd4f8ff6a7dc666' }, h("dynamic-redeem", { key: '71a57f4626d0f394c2293db5bfccaf477c5c3f1e', id: "dynamic-redeem" }), h("div", { key: '3e247cedd1e720c89a30af72f8c9758f7a5642fb', class: cn('dynamic-claim-wrapper', { loading: this.isLoading, idle: this.isIdle }) }, h("div", { key: 'd6aea716001e09c9ff3180889afc5daca008b130', class: "dynamic-claim-header" }, h("strong", { key: 'f9469ece92c4e189eed94a119d233787d78aa8b1', onAnimationEnd: this.removeLoadAnimationClass, class: "dynamic-claim-header-vin load-animation" }, this.errorMessage && h("span", { key: 'b132706208c827613e967186ba98a1314d9aaf08', style: { color: 'red' } }, this.errorMessage), !this.errorMessage && ((_b = this.vehicleInformation) === null || _b === void 0 ? void 0 : _b.vin))), h("div", { key: '849960f27d5188e3ab088c5de8d0bebc25723829', class: "dynamic-claim-body" }, h("div", { key: 'bdbd37aa75a00973008634299d1768dcbe95843f', class: "loading-lane" }, h("div", { key: '6a17f141b034edbcd38b86979431c3ff26614d00', class: "dynamic-claim-loading-slider" }, h("div", { key: '34597a589f5dab07e60959ba09d39876901f2ee1', class: "dynamic-claim-loading-slider-line" }), h("div", { key: '4a2483d4997fff60631cd01302d272665e2d2736', class: "dynamic-claim-loading-slider-subline dynamic-claim-inc" }), h("div", { key: 'c05466961bfcfd2580f670c57178492f31729f52', class: "dynamic-claim-loading-slider-subline dynamic-claim-dec" }))), h("div", { key: 'ac968ede27ec14df080f8c17758e071cfa272d2d', class: "dynamic-claim-progress-lane" }, serviceItems.map((item, idx) => {
|
|
274
274
|
let statusClass = '';
|
|
275
275
|
if (item.status === 'pending') {
|
|
276
276
|
if (serviceItems.findIndex(i => i.status === 'pending') === idx)
|
|
@@ -279,7 +279,7 @@ export class DynamicClaim {
|
|
|
279
279
|
else
|
|
280
280
|
statusClass = item.status;
|
|
281
281
|
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, item.status.charAt(0).toUpperCase() + item.status.slice(1)), 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)));
|
|
282
|
-
}), h("div", { key: '
|
|
282
|
+
}), h("div", { key: '720ee8e73001f6c4304f9e0af8212e37fc69e74a', class: "dynamic-claim-progress-bar" }))))));
|
|
283
283
|
}
|
|
284
284
|
static get is() { return "dynamic-claim"; }
|
|
285
285
|
static get encapsulation() { return "shadow"; }
|
|
@@ -432,11 +432,15 @@ export class DynamicClaim {
|
|
|
432
432
|
},
|
|
433
433
|
"setData": {
|
|
434
434
|
"complexType": {
|
|
435
|
-
"signature": "(newData: VehicleInformation | string) => Promise<void>",
|
|
435
|
+
"signature": "(newData: VehicleInformation | string, headers?: any) => Promise<void>",
|
|
436
436
|
"parameters": [{
|
|
437
437
|
"name": "newData",
|
|
438
438
|
"type": "string | VehicleInformation",
|
|
439
439
|
"docs": ""
|
|
440
|
+
}, {
|
|
441
|
+
"name": "headers",
|
|
442
|
+
"type": "any",
|
|
443
|
+
"docs": ""
|
|
440
444
|
}],
|
|
441
445
|
"references": {
|
|
442
446
|
"Promise": {
|
|
@@ -462,11 +466,15 @@ export class DynamicClaim {
|
|
|
462
466
|
},
|
|
463
467
|
"fetchData": {
|
|
464
468
|
"complexType": {
|
|
465
|
-
"signature": "(requestedVin?: string) => Promise<void>",
|
|
469
|
+
"signature": "(requestedVin?: string, headers?: any) => Promise<void>",
|
|
466
470
|
"parameters": [{
|
|
467
471
|
"name": "requestedVin",
|
|
468
472
|
"type": "string",
|
|
469
473
|
"docs": ""
|
|
474
|
+
}, {
|
|
475
|
+
"name": "headers",
|
|
476
|
+
"type": "any",
|
|
477
|
+
"docs": ""
|
|
470
478
|
}],
|
|
471
479
|
"references": {
|
|
472
480
|
"Promise": {
|
|
@@ -40,7 +40,7 @@ export class PaintThickness {
|
|
|
40
40
|
response.paintThickness.imageGroups = [];
|
|
41
41
|
this.vehicleInformation = response;
|
|
42
42
|
}
|
|
43
|
-
async setData(newData) {
|
|
43
|
+
async setData(newData, headers = {}) {
|
|
44
44
|
clearTimeout(this.networkTimeoutRef);
|
|
45
45
|
if (this.abortController)
|
|
46
46
|
this.abortController.abort();
|
|
@@ -51,7 +51,6 @@ export class PaintThickness {
|
|
|
51
51
|
this.externalVin = vin;
|
|
52
52
|
try {
|
|
53
53
|
if (!vin || vin.trim().length === 0) {
|
|
54
|
-
//this.componentHeight = '0px';
|
|
55
54
|
this.state = 'idle';
|
|
56
55
|
return;
|
|
57
56
|
}
|
|
@@ -64,7 +63,7 @@ export class PaintThickness {
|
|
|
64
63
|
scopedTimeoutRef = setTimeout(r, 700);
|
|
65
64
|
this.networkTimeoutRef = scopedTimeoutRef;
|
|
66
65
|
});
|
|
67
|
-
const vehicleResponse = isVinRequest ? await getVehicleInformation(this, { scopedTimeoutRef, vin, mockData }) : newData;
|
|
66
|
+
const vehicleResponse = isVinRequest ? await getVehicleInformation(this, { scopedTimeoutRef, vin, mockData }, headers) : newData;
|
|
68
67
|
if (this.networkTimeoutRef === scopedTimeoutRef) {
|
|
69
68
|
if (!vehicleResponse)
|
|
70
69
|
throw new Error('Wrong response format');
|
|
@@ -81,22 +80,10 @@ export class PaintThickness {
|
|
|
81
80
|
this.errorMessage = error.message;
|
|
82
81
|
}
|
|
83
82
|
}
|
|
84
|
-
async fetchData(requestedVin = this.externalVin) {
|
|
85
|
-
await this.setData(requestedVin);
|
|
83
|
+
async fetchData(requestedVin = this.externalVin, headers = {}) {
|
|
84
|
+
await this.setData(requestedVin, headers);
|
|
86
85
|
}
|
|
87
|
-
//calculateHeight(componentState: string) {
|
|
88
|
-
// if (componentState.includes('loading') && this.componentHeight === '0px') {
|
|
89
|
-
// this.componentHeight = '100px';
|
|
90
|
-
// } else if (componentState !== 'idle') {
|
|
91
|
-
// setTimeout(() => {
|
|
92
|
-
// this.componentHeight = `${this.wrapperRef.clientHeight}px`;
|
|
93
|
-
// }, 50);
|
|
94
|
-
// } else {
|
|
95
|
-
// this.componentHeight = '0px';
|
|
96
|
-
// }
|
|
97
|
-
//}
|
|
98
86
|
async loadingListener() {
|
|
99
|
-
//this.calculateHeight(newState);
|
|
100
87
|
if (this.loadingStateChange)
|
|
101
88
|
this.loadingStateChange(this.state.includes('loading'));
|
|
102
89
|
}
|
|
@@ -106,11 +93,11 @@ export class PaintThickness {
|
|
|
106
93
|
render() {
|
|
107
94
|
var _a, _b;
|
|
108
95
|
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: [] };
|
|
109
|
-
return (h(Host, { key: '
|
|
96
|
+
return (h(Host, { key: 'dd25115d7451c326da5411d30b8cebeac06ea3b4' }, h("div", { key: 'ebec5094a98846ffbe00abcbdc5bb5b987262548', class: "min-h-[100px] relative transition-all duration-300 overflow-hidden" }, h("div", { key: '67d4926b51399a2f990251d95a58558d07c64865' }, h(Loading, { key: 'd56bac7fe821253d2d9aea3a31e19a55002dc1ce', isLoading: this.state.includes('loading') }), h("div", { key: '27b2f517a1f974182c5704d9682213662f3dd2d3', class: cn('transition-all duration-700', { 'scale-0': this.state.includes('loading') || this.state === 'idle', 'opacity-0': this.state.includes('loading') }) }, h("div", { key: 'f9bdf1767f4e8d6f24f018a60649f54b75151de2', 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: 'd2b739c8f39501a2335a312b6c9d0a0431104300', class: "py-[16px]" }, h("div", { key: '06e78434d8122f36a26faa5fed05a64d759c18c3', class: " px-[16px] py-[8px] border reject-card text-[20px] rounded-[8px] w-fit mx-auto" }, this.errorMessage))), ['data', 'data-loading'].includes(this.state) && (h("div", { key: 'f17f4c019ed1357fb40f6f32c125918ab24069ce', class: "flex mt-[12px] w-full max-h-[70dvh] overflow-hidden mx-auto rounded-[4px] flex-col border border-[#d6d8dc]" }, h("div", { key: 'b79eed13d13b7b91aff4aeb4b2280eb349592896', class: "w-full h-[40px] flex shrink-0 justify-center text-[18px] items-center text-[#383c43] text-center bg-[#e1e3e5]" }, "Paint Thickeness"), h("div", { key: 'aab4ba79f226602f913652e27341df333f5be00d', class: "h-0 overflow-auto flex-1" }, !parts.length && h("div", { key: 'edf880bf05cc8c31000960c1ee9471d166444541', class: "h-[50px] px-[30px] flex items-center justify-center text-[18px]" }, "No parts are available."), !!parts.length && (h("table", { key: 'ddac23c3ba00bb44e58f2b5dfaa11034d4f13594', class: "w-full overflow-auto relative border-collapse" }, h("thead", { key: 'c39718f9cd059c765c51b90ba2f2f4e570b9778b', class: "top-0 font-bold sticky bg-white" }, h("tr", { key: 'ba28cd9cadfc036162a735d7353a089a581a8559' }, ['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]" }, title))))), h("tbody", { key: '6049aecd19316b1d7e1c79606d7cf304b0b260ec' }, 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]', {
|
|
110
97
|
'!border-none': idx === parts.length - 1,
|
|
111
|
-
}) }, part[key] || '...')))))))))))), ['data', 'data-loading'].includes(this.state) && (h("div", { key: '
|
|
98
|
+
}) }, part[key] || '...')))))))))))), ['data', 'data-loading'].includes(this.state) && (h("div", { key: '73bfbe41ad8f91591c23b0dccd7be84b4505ede8' }, !imageGroups.length && h("div", { key: '33c2491e22faf7a5f11b6ec2ee62a1b758123b8e', class: "h-[40px] px-[30px] flex text-red-500 items-center justify-center text-[18px]" }, "No image groups are available."), !!imageGroups.length && (h("div", { key: '02103207298b679bdbe8d336c70d2cb8936087a4', 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" }, "Expand")), h("img", { class: "w-auto h-[150px] cursor-pointer shadow-sm rounded-lg transition-all duration-300", src: image }))))))))), h("div", { key: '7e239537ed9d3b07119fbf15fcb8cb238280c095', 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', {
|
|
112
99
|
'pointer-events-auto opacity-100 delay-200': this.expandedImage,
|
|
113
|
-
}) }, h("button", { key: '
|
|
100
|
+
}) }, h("button", { key: 'a961871288f09b8776ca9530a6e5ae56133cb3bc', class: "flex flex-col mt-[16px] items-center justify-center size-12 float-right mr-[16px]", onClick: () => this.closeImage() }, h("div", { key: '6db275131cf9b431540c2402552449a4ca2d4289', class: "h-1 w-12 rounded-full rotate-45 absolute bg-white" }), h("div", { key: '1b0c9149a6d22c436e89baf35fb146c08d13a40a', class: "h-1 w-12 rounded-full -rotate-45 absolute bg-white" }))), h("img", { key: '38939c47ad696305c5cc2b3ccb4c72112eea2cce', alt: "", id: "expanded-image", class: "fixed opacity-0 z-40 transition-all rounded-lg" }))))))))));
|
|
114
101
|
}
|
|
115
102
|
static get is() { return "paint-thickness"; }
|
|
116
103
|
static get encapsulation() { return "shadow"; }
|
|
@@ -231,11 +218,15 @@ export class PaintThickness {
|
|
|
231
218
|
return {
|
|
232
219
|
"setData": {
|
|
233
220
|
"complexType": {
|
|
234
|
-
"signature": "(newData: VehicleInformation | string) => Promise<void>",
|
|
221
|
+
"signature": "(newData: VehicleInformation | string, headers?: any) => Promise<void>",
|
|
235
222
|
"parameters": [{
|
|
236
223
|
"name": "newData",
|
|
237
224
|
"type": "string | VehicleInformation",
|
|
238
225
|
"docs": ""
|
|
226
|
+
}, {
|
|
227
|
+
"name": "headers",
|
|
228
|
+
"type": "any",
|
|
229
|
+
"docs": ""
|
|
239
230
|
}],
|
|
240
231
|
"references": {
|
|
241
232
|
"Promise": {
|
|
@@ -261,11 +252,15 @@ export class PaintThickness {
|
|
|
261
252
|
},
|
|
262
253
|
"fetchData": {
|
|
263
254
|
"complexType": {
|
|
264
|
-
"signature": "(requestedVin?: string) => Promise<void>",
|
|
255
|
+
"signature": "(requestedVin?: string, headers?: any) => Promise<void>",
|
|
265
256
|
"parameters": [{
|
|
266
257
|
"name": "requestedVin",
|
|
267
258
|
"type": "string",
|
|
268
259
|
"docs": ""
|
|
260
|
+
}, {
|
|
261
|
+
"name": "headers",
|
|
262
|
+
"type": "any",
|
|
263
|
+
"docs": ""
|
|
269
264
|
}],
|
|
270
265
|
"references": {
|
|
271
266
|
"Promise": {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
*,:after,:before{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: ;border:0 solid #e5e7eb;box-sizing:border-box}::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }/*! tailwindcss v3.4.15 | MIT License | https://tailwindcss.com*/:after,:before{--tw-content:""}:host,html{-webkit-text-size-adjust:100%;font-feature-settings:normal;-webkit-tap-highlight-color:transparent;font-family:ui-sans-serif,system-ui,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;font-variation-settings:normal;line-height:1.5;-moz-tab-size:4;tab-size:4}body{line-height:inherit;margin:0}hr{border-top-width:1px;color:inherit;height:0}abbr:where([title]){text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-feature-settings:normal;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:1em;font-variation-settings:normal}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{border-collapse:collapse;border-color:inherit;text-indent:0}button,input,optgroup,select,textarea{font-feature-settings:inherit;color:inherit;font-family:inherit;font-size:100%;font-variation-settings:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dd,dl,fieldset,figure,h1,h2,h3,h4,h5,h6,hr,p,pre{margin:0}fieldset,legend{padding:0}menu,ol,ul{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::placeholder,textarea::placeholder{color:#9ca3af;opacity:1}[role=button],button{cursor:pointer}:disabled{cursor:default}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{height:auto;max-width:100%}[hidden]:where(:not([hidden=until-found])){display:none}.block{display:block}
|
|
1
|
+
*,:after,:before{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: ;border:0 solid #e5e7eb;box-sizing:border-box}::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }/*! tailwindcss v3.4.15 | MIT License | https://tailwindcss.com*/:after,:before{--tw-content:""}:host,html{-webkit-text-size-adjust:100%;font-feature-settings:normal;-webkit-tap-highlight-color:transparent;font-family:ui-sans-serif,system-ui,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;font-variation-settings:normal;line-height:1.5;-moz-tab-size:4;tab-size:4}body{line-height:inherit;margin:0}hr{border-top-width:1px;color:inherit;height:0}abbr:where([title]){text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-feature-settings:normal;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:1em;font-variation-settings:normal}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{border-collapse:collapse;border-color:inherit;text-indent:0}button,input,optgroup,select,textarea{font-feature-settings:inherit;color:inherit;font-family:inherit;font-size:100%;font-variation-settings:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dd,dl,fieldset,figure,h1,h2,h3,h4,h5,h6,hr,p,pre{margin:0}fieldset,legend{padding:0}menu,ol,ul{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::placeholder,textarea::placeholder{color:#9ca3af;opacity:1}[role=button],button{cursor:pointer}:disabled{cursor:default}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{height:auto;max-width:100%}[hidden]:where(:not([hidden=until-found])){display:none}.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}.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}.w-full{width:100%}.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-left{text-align:left}.text-center{text-align:center}.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}
|
|
@@ -7,10 +7,11 @@ import { getPartInformation } from "../../global/api/partInformation";
|
|
|
7
7
|
import Loading from "../parts/Loading";
|
|
8
8
|
import cn from "../../global/lib/cn";
|
|
9
9
|
let mockData = {};
|
|
10
|
+
const closedAccordionHeight = '46px';
|
|
10
11
|
export class DeadStockLookup {
|
|
11
12
|
constructor() {
|
|
12
|
-
this.isDev = false;
|
|
13
13
|
this.baseUrl = '';
|
|
14
|
+
this.isDev = false;
|
|
14
15
|
this.queryString = '';
|
|
15
16
|
this.loadingStateChange = undefined;
|
|
16
17
|
this.loadedResponse = undefined;
|
|
@@ -18,15 +19,11 @@ export class DeadStockLookup {
|
|
|
18
19
|
this.externalPartNumber = null;
|
|
19
20
|
this.errorMessage = null;
|
|
20
21
|
this.partInformation = undefined;
|
|
21
|
-
this.activeIndex = null;
|
|
22
22
|
}
|
|
23
23
|
handleSettingData(response) {
|
|
24
24
|
this.partInformation = response;
|
|
25
25
|
}
|
|
26
|
-
|
|
27
|
-
this.activeIndex = this.activeIndex === index ? null : index;
|
|
28
|
-
}
|
|
29
|
-
async setData(newData) {
|
|
26
|
+
async setData(newData, headers = {}) {
|
|
30
27
|
clearTimeout(this.networkTimeoutRef);
|
|
31
28
|
if (this.abortController)
|
|
32
29
|
this.abortController.abort();
|
|
@@ -37,7 +34,6 @@ export class DeadStockLookup {
|
|
|
37
34
|
this.externalPartNumber = partNumber;
|
|
38
35
|
try {
|
|
39
36
|
if (!partNumber || partNumber.trim().length === 0) {
|
|
40
|
-
//this.componentHeight = '0px';
|
|
41
37
|
this.state = 'idle';
|
|
42
38
|
return;
|
|
43
39
|
}
|
|
@@ -50,7 +46,7 @@ export class DeadStockLookup {
|
|
|
50
46
|
scopedTimeoutRef = setTimeout(r, 700);
|
|
51
47
|
this.networkTimeoutRef = scopedTimeoutRef;
|
|
52
48
|
});
|
|
53
|
-
const partResponse = isPartNumberRequest ? await getPartInformation(this, { scopedTimeoutRef, partNumber, mockData }) : newData;
|
|
49
|
+
const partResponse = isPartNumberRequest ? await getPartInformation(this, { scopedTimeoutRef, partNumber, mockData }, headers) : newData;
|
|
54
50
|
if (this.networkTimeoutRef === scopedTimeoutRef) {
|
|
55
51
|
if (!partResponse)
|
|
56
52
|
throw new Error('Wrong response format');
|
|
@@ -67,21 +63,37 @@ export class DeadStockLookup {
|
|
|
67
63
|
this.errorMessage = error.message;
|
|
68
64
|
}
|
|
69
65
|
}
|
|
70
|
-
async fetchData(
|
|
71
|
-
await this.setData(
|
|
66
|
+
async fetchData(partNumber = this.externalPartNumber, headers = {}) {
|
|
67
|
+
await this.setData(partNumber, headers);
|
|
72
68
|
}
|
|
73
69
|
async loadingListener() {
|
|
74
|
-
//this.calculateHeight(newState);
|
|
75
70
|
if (this.loadingStateChange)
|
|
76
71
|
this.loadingStateChange(this.state.includes('loading'));
|
|
77
72
|
}
|
|
78
73
|
async setMockData(newMockData) {
|
|
79
74
|
mockData = newMockData;
|
|
80
75
|
}
|
|
76
|
+
toggleAccordion(event) {
|
|
77
|
+
const container = event.target.parentElement;
|
|
78
|
+
const icon = container.getElementsByClassName('icon')[0];
|
|
79
|
+
const isExpanded = container.getAttribute('aria-expanded') === 'true';
|
|
80
|
+
if (isExpanded) {
|
|
81
|
+
container.style.height = closedAccordionHeight;
|
|
82
|
+
icon.style.transform = 'rotate(0deg)';
|
|
83
|
+
container.setAttribute('aria-expanded', 'false');
|
|
84
|
+
}
|
|
85
|
+
else {
|
|
86
|
+
const content = container.getElementsByClassName('content')[0];
|
|
87
|
+
const totalHeight = +closedAccordionHeight.replace('px', '') + content.getClientRects()[0].height;
|
|
88
|
+
container.style.height = `${totalHeight}px`;
|
|
89
|
+
icon.style.transform = 'rotate(180deg)';
|
|
90
|
+
container.setAttribute('aria-expanded', 'true');
|
|
91
|
+
}
|
|
92
|
+
}
|
|
81
93
|
render() {
|
|
82
94
|
var _a, _b;
|
|
83
|
-
return (h(Host, { key: '
|
|
84
|
-
_b.map(
|
|
95
|
+
return (h(Host, { key: 'f868a1c81dc98548642bb3baf78bc96d0a602c6a' }, h("div", { key: 'a868a68dc54e4a5463ad6395e209e6538f972960', class: "min-h-[100px] relative transition-all duration-300 overflow-hidden" }, h("div", { key: 'c5cc22080a9c9ebc4b55dd038bfbc263c3cf4dd1' }, h(Loading, { key: 'c2d039a04fc763b329fd3d0ad0e70c68a2a3d716', isLoading: this.state.includes('loading') }), h("div", { key: 'f29a10d23d05c5266880fdb1f3c1618e87e1379d', 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: 'd886904d0fe6521ea5a068a8a04b0828605c0264', class: "py-[16px]" }, h("div", { key: 'e59d14518de70ebbb5da2588199e5be6ff20d6d7', class: " px-[16px] py-[8px] border reject-card text-[20px] rounded-[8px] w-fit mx-auto" }, this.errorMessage))), ['data', 'data-loading'].includes(this.state) && (h("div", { key: '7b088662fc257bb3284a01fb492c0b976ef78a44' }, h("div", { key: '93df28e47a2ac1384606072e4fa1e4748d5f539a', class: "flex mt-[12px] max-h-[70dvh] overflow-hidden rounded-[4px] flex-col border border-[#d6d8dc]" }, h("div", { key: '0ccf2ca8e0761803289e0b07961c0ae294f27fd2', 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
|
+
_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))))))))))))))))))));
|
|
85
97
|
}
|
|
86
98
|
static get is() { return "dead-stock-lookup"; }
|
|
87
99
|
static get encapsulation() { return "shadow"; }
|
|
@@ -97,12 +109,12 @@ export class DeadStockLookup {
|
|
|
97
109
|
}
|
|
98
110
|
static get properties() {
|
|
99
111
|
return {
|
|
100
|
-
"
|
|
101
|
-
"type": "
|
|
112
|
+
"baseUrl": {
|
|
113
|
+
"type": "string",
|
|
102
114
|
"mutable": false,
|
|
103
115
|
"complexType": {
|
|
104
|
-
"original": "
|
|
105
|
-
"resolved": "
|
|
116
|
+
"original": "string",
|
|
117
|
+
"resolved": "string",
|
|
106
118
|
"references": {}
|
|
107
119
|
},
|
|
108
120
|
"required": false,
|
|
@@ -111,16 +123,16 @@ export class DeadStockLookup {
|
|
|
111
123
|
"tags": [],
|
|
112
124
|
"text": ""
|
|
113
125
|
},
|
|
114
|
-
"attribute": "
|
|
126
|
+
"attribute": "base-url",
|
|
115
127
|
"reflect": false,
|
|
116
|
-
"defaultValue": "
|
|
128
|
+
"defaultValue": "''"
|
|
117
129
|
},
|
|
118
|
-
"
|
|
119
|
-
"type": "
|
|
130
|
+
"isDev": {
|
|
131
|
+
"type": "boolean",
|
|
120
132
|
"mutable": false,
|
|
121
133
|
"complexType": {
|
|
122
|
-
"original": "
|
|
123
|
-
"resolved": "
|
|
134
|
+
"original": "boolean",
|
|
135
|
+
"resolved": "boolean",
|
|
124
136
|
"references": {}
|
|
125
137
|
},
|
|
126
138
|
"required": false,
|
|
@@ -129,9 +141,9 @@ export class DeadStockLookup {
|
|
|
129
141
|
"tags": [],
|
|
130
142
|
"text": ""
|
|
131
143
|
},
|
|
132
|
-
"attribute": "
|
|
144
|
+
"attribute": "is-dev",
|
|
133
145
|
"reflect": false,
|
|
134
|
-
"defaultValue": "
|
|
146
|
+
"defaultValue": "false"
|
|
135
147
|
},
|
|
136
148
|
"queryString": {
|
|
137
149
|
"type": "string",
|
|
@@ -194,19 +206,22 @@ export class DeadStockLookup {
|
|
|
194
206
|
"state": {},
|
|
195
207
|
"externalPartNumber": {},
|
|
196
208
|
"errorMessage": {},
|
|
197
|
-
"partInformation": {}
|
|
198
|
-
"activeIndex": {}
|
|
209
|
+
"partInformation": {}
|
|
199
210
|
};
|
|
200
211
|
}
|
|
201
212
|
static get methods() {
|
|
202
213
|
return {
|
|
203
214
|
"setData": {
|
|
204
215
|
"complexType": {
|
|
205
|
-
"signature": "(newData: PartInformation | string) => Promise<void>",
|
|
216
|
+
"signature": "(newData: PartInformation | string, headers?: any) => Promise<void>",
|
|
206
217
|
"parameters": [{
|
|
207
218
|
"name": "newData",
|
|
208
219
|
"type": "string | PartInformation",
|
|
209
220
|
"docs": ""
|
|
221
|
+
}, {
|
|
222
|
+
"name": "headers",
|
|
223
|
+
"type": "any",
|
|
224
|
+
"docs": ""
|
|
210
225
|
}],
|
|
211
226
|
"references": {
|
|
212
227
|
"Promise": {
|
|
@@ -232,11 +247,15 @@ export class DeadStockLookup {
|
|
|
232
247
|
},
|
|
233
248
|
"fetchData": {
|
|
234
249
|
"complexType": {
|
|
235
|
-
"signature": "(
|
|
250
|
+
"signature": "(partNumber?: string, headers?: any) => Promise<void>",
|
|
236
251
|
"parameters": [{
|
|
237
|
-
"name": "
|
|
252
|
+
"name": "partNumber",
|
|
238
253
|
"type": "string",
|
|
239
254
|
"docs": ""
|
|
255
|
+
}, {
|
|
256
|
+
"name": "headers",
|
|
257
|
+
"type": "any",
|
|
258
|
+
"docs": ""
|
|
240
259
|
}],
|
|
241
260
|
"references": {
|
|
242
261
|
"Promise": {
|