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
|
@@ -19,7 +19,7 @@ export class VehicleSpecification {
|
|
|
19
19
|
this.errorMessage = null;
|
|
20
20
|
this.vehicleInformation = undefined;
|
|
21
21
|
}
|
|
22
|
-
async setData(newData) {
|
|
22
|
+
async setData(newData, headers = {}) {
|
|
23
23
|
clearTimeout(this.networkTimeoutRef);
|
|
24
24
|
if (this.abortController)
|
|
25
25
|
this.abortController.abort();
|
|
@@ -30,7 +30,6 @@ export class VehicleSpecification {
|
|
|
30
30
|
this.externalVin = vin;
|
|
31
31
|
try {
|
|
32
32
|
if (!vin || vin.trim().length === 0) {
|
|
33
|
-
//this.componentHeight = '0px';
|
|
34
33
|
this.state = 'idle';
|
|
35
34
|
return;
|
|
36
35
|
}
|
|
@@ -43,7 +42,7 @@ export class VehicleSpecification {
|
|
|
43
42
|
scopedTimeoutRef = setTimeout(r, 700);
|
|
44
43
|
this.networkTimeoutRef = scopedTimeoutRef;
|
|
45
44
|
});
|
|
46
|
-
const vehicleResponse = isVinRequest ? await getVehicleInformation(this, { scopedTimeoutRef, vin, mockData }) : newData;
|
|
45
|
+
const vehicleResponse = isVinRequest ? await getVehicleInformation(this, { scopedTimeoutRef, vin, mockData }, headers) : newData;
|
|
47
46
|
if (this.networkTimeoutRef === scopedTimeoutRef) {
|
|
48
47
|
if (!vehicleResponse)
|
|
49
48
|
throw new Error('Wrong response format');
|
|
@@ -60,22 +59,10 @@ export class VehicleSpecification {
|
|
|
60
59
|
this.errorMessage = error.message;
|
|
61
60
|
}
|
|
62
61
|
}
|
|
63
|
-
async fetchData(requestedVin = this.externalVin) {
|
|
64
|
-
await this.setData(requestedVin);
|
|
62
|
+
async fetchData(requestedVin = this.externalVin, headers = {}) {
|
|
63
|
+
await this.setData(requestedVin, headers);
|
|
65
64
|
}
|
|
66
|
-
//calculateHeight(componentState: string) {
|
|
67
|
-
// if (componentState.includes('loading') && this.componentHeight === '0px') {
|
|
68
|
-
// this.componentHeight = '100px';
|
|
69
|
-
// } else if (componentState !== 'idle') {
|
|
70
|
-
// setTimeout(() => {
|
|
71
|
-
// this.componentHeight = `${this.wrapperRef.clientHeight}px`;
|
|
72
|
-
// }, 50);
|
|
73
|
-
// } else {
|
|
74
|
-
// this.componentHeight = '0px';
|
|
75
|
-
// }
|
|
76
|
-
//}
|
|
77
65
|
async loadingListener() {
|
|
78
|
-
//this.calculateHeight(newState);
|
|
79
66
|
if (this.loadingStateChange)
|
|
80
67
|
this.loadingStateChange(this.state.includes('loading'));
|
|
81
68
|
}
|
|
@@ -84,7 +71,7 @@ export class VehicleSpecification {
|
|
|
84
71
|
}
|
|
85
72
|
render() {
|
|
86
73
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
87
|
-
return (h(Host, { key: '
|
|
74
|
+
return (h(Host, { key: 'b9a0f984a08acc14315b7b7b30742ad9f5bdb49e' }, h("div", { key: 'af83954e986a078b9e33bfd4fc8797fb79fb028b', class: "min-h-[100px] relative transition-all duration-300 overflow-hidden" }, h("div", { key: '448f30f13b9c20fb30ff369e55bf564bd0d8fe20' }, h(Loading, { key: '53523ee006eef27b765fd1b6375f39bf7f1e02c6', isLoading: this.state.includes('loading') }), h("div", { key: '78dd7934c80487fb68c67747512c5c96809280ac', class: cn('transition-all duration-700', { 'scale-0': this.state.includes('loading') || this.state === 'idle', 'opacity-0': this.state.includes('loading') }) }, h("div", { key: 'da5b237a42b1ff4b0c20fe40ad5c46224c265986', 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: 'dc9cae0fec62f66c747de76185d2e1688162224e', class: "py-4" }, h("div", { key: '8f3b7129711bff7688170ac8228417b0bf3b4c5c', 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: '9215e325e2b80534142c4833b717b569949721ec', class: "flex mt-[12px] max-h-[70dvh] overflow-hidden rounded-[4px] flex-col border border-[#d6d8dc]" }, h("div", { key: '87630966a701dc6989221ac7a133ca7e0856fcf1', class: "w-full h-[40px] flex shrink-0 justify-center text-[18px] items-center text-[#383c43] text-center bg-[#e1e3e5]" }, "Vehicle Specifications"), h("div", { key: '06489c6c3ad553a5502cdf72cc43724d2b5c74bc', class: "h-0 overflow-auto flex-1" }, !((_b = this.vehicleInformation) === null || _b === void 0 ? void 0 : _b.vehicleSpecification) && h("div", { key: 'e6e2d53c4233cacc6571b1b9d2eaa6553bae7831', class: "h-[80px] flex items-center justify-center text-[18px]" }, "No data is available."), !!((_c = this.vehicleInformation) === null || _c === void 0 ? void 0 : _c.vehicleSpecification) && (h("table", { key: '30bf7dfaf6c8c5d9829e8a30d9644326c5a2c6d2', class: "w-full overflow-auto relative border-collapse" }, h("thead", { key: 'b64236329f77e1e236ad286bbe5068e55f5e40c9', class: "top-0 font-bold sticky bg-white" }, h("tr", { key: 'b79c310db87dc4b40a56a0efbe82ffd54da09a21' }, ['Model', 'Variant', 'Katashiki', 'Model Year', 'SFX'].map(title => (h("th", { key: title, class: "px-[10px] py-[20px] text-center whitespace-nowrap border-b border-[#d6d8dc]" }, title))))), h("tbody", { key: 'b8afb49709c1362e95dd4446978b54c2fc570fcb' }, h("tr", { key: 'b566724d705cd430f7fba1e1addab9a1189ebb5d' }, h("td", { key: '0577fa2f9221fdd8df0a557b92e77f3bad0885ac', class: "px-[10px] py-[20px] text-center whitespace-nowrap" }, ((_e = (_d = this === null || this === void 0 ? void 0 : this.vehicleInformation) === null || _d === void 0 ? void 0 : _d.vehicleVariantInfo) === null || _e === void 0 ? void 0 : _e.modelCode) || '...', " ", h("br", { key: 'f751d6784c076ce25442d7a916bc468ecd007777', class: "my-2" }), ((_g = (_f = this === null || this === void 0 ? void 0 : this.vehicleInformation) === null || _f === void 0 ? void 0 : _f.vehicleSpecification) === null || _g === void 0 ? void 0 : _g.modelDesc) || '...'), h("td", { key: '01e40cad1d8dc4cdfc933dcfade4b8e605219d3e', class: "px-[10px] py-[20px] text-center whitespace-nowrap" }, ((_j = (_h = this === null || this === void 0 ? void 0 : this.vehicleInformation) === null || _h === void 0 ? void 0 : _h.identifiers) === null || _j === void 0 ? void 0 : _j.variant) || '...', " ", h("br", { key: 'f34677ab8bf2311f6ac2fd7426805cfe50ccafd7' }), ((_l = (_k = this === null || this === void 0 ? void 0 : this.vehicleInformation) === null || _k === void 0 ? void 0 : _k.vehicleSpecification) === null || _l === void 0 ? void 0 : _l.variantDesc) || '...'), ['identifiers.katashiki', 'vehicleVariantInfo.modelYear', 'vehicleVariantInfo.sfx'].map(infoPath => {
|
|
88
75
|
var _a;
|
|
89
76
|
const [place, field] = infoPath.split('.');
|
|
90
77
|
const cellValue = (_a = this === null || this === void 0 ? void 0 : this.vehicleInformation) === null || _a === void 0 ? void 0 : _a[place][field].toString();
|
|
@@ -209,11 +196,15 @@ export class VehicleSpecification {
|
|
|
209
196
|
return {
|
|
210
197
|
"setData": {
|
|
211
198
|
"complexType": {
|
|
212
|
-
"signature": "(newData: VehicleInformation | string) => Promise<void>",
|
|
199
|
+
"signature": "(newData: VehicleInformation | string, headers?: any) => Promise<void>",
|
|
213
200
|
"parameters": [{
|
|
214
201
|
"name": "newData",
|
|
215
202
|
"type": "string | VehicleInformation",
|
|
216
203
|
"docs": ""
|
|
204
|
+
}, {
|
|
205
|
+
"name": "headers",
|
|
206
|
+
"type": "any",
|
|
207
|
+
"docs": ""
|
|
217
208
|
}],
|
|
218
209
|
"references": {
|
|
219
210
|
"Promise": {
|
|
@@ -239,11 +230,15 @@ export class VehicleSpecification {
|
|
|
239
230
|
},
|
|
240
231
|
"fetchData": {
|
|
241
232
|
"complexType": {
|
|
242
|
-
"signature": "(requestedVin?: string) => Promise<void>",
|
|
233
|
+
"signature": "(requestedVin?: string, headers?: any) => Promise<void>",
|
|
243
234
|
"parameters": [{
|
|
244
235
|
"name": "requestedVin",
|
|
245
236
|
"type": "string",
|
|
246
237
|
"docs": ""
|
|
238
|
+
}, {
|
|
239
|
+
"name": "headers",
|
|
240
|
+
"type": "any",
|
|
241
|
+
"docs": ""
|
|
247
242
|
}],
|
|
248
243
|
"references": {
|
|
249
244
|
"Promise": {
|
|
@@ -42,6 +42,7 @@ export class WarrantyDetails {
|
|
|
42
42
|
this.vehicleInformation = undefined;
|
|
43
43
|
this.checkingUnauthorizedSSC = false;
|
|
44
44
|
this.recaptchaRes = null;
|
|
45
|
+
this.headers = {};
|
|
45
46
|
}
|
|
46
47
|
handleSettingData(response) {
|
|
47
48
|
var _a, _b, _c;
|
|
@@ -74,7 +75,6 @@ export class WarrantyDetails {
|
|
|
74
75
|
if (this.isDev) {
|
|
75
76
|
this.checkingUnauthorizedSSC = true;
|
|
76
77
|
this.showRecaptcha = false;
|
|
77
|
-
//this.calculateHeight(this.state);
|
|
78
78
|
await new Promise(r => setTimeout(r, 3000));
|
|
79
79
|
this.checkingUnauthorizedSSC = false;
|
|
80
80
|
const hasPendingSSC = Math.random() < 0.5 ? false : true;
|
|
@@ -82,17 +82,14 @@ export class WarrantyDetails {
|
|
|
82
82
|
hasSSC: hasPendingSSC,
|
|
83
83
|
message: hasPendingSSC ? 'This Vehicle has a Pending SSC' : 'No Pending SSC',
|
|
84
84
|
};
|
|
85
|
-
//this.calculateHeight(this.state);
|
|
86
85
|
}
|
|
87
86
|
else {
|
|
88
87
|
this.checkingUnauthorizedSSC = true;
|
|
89
88
|
this.showRecaptcha = false;
|
|
90
|
-
|
|
89
|
+
///
|
|
91
90
|
const response = await fetch(`${this.unauthorizedSscLookupBaseUrl}${vin}/${(_a = this.vehicleInformation) === null || _a === void 0 ? void 0 : _a.sscLogId}?${this.unauthorizedSscLookupQueryString}`, {
|
|
92
91
|
signal: this.abortController.signal,
|
|
93
|
-
headers: {
|
|
94
|
-
'Ssc-Recaptcha-Token': recaptchaResponse,
|
|
95
|
-
},
|
|
92
|
+
headers: Object.assign(Object.assign({}, this.headers), { 'Ssc-Recaptcha-Token': recaptchaResponse }),
|
|
96
93
|
});
|
|
97
94
|
const vinResponse = await response.json();
|
|
98
95
|
if (vinResponse && this.networkTimeoutRef === scopedTimeoutRef) {
|
|
@@ -102,7 +99,6 @@ export class WarrantyDetails {
|
|
|
102
99
|
hasSSC: hasPendingSSC,
|
|
103
100
|
message: hasPendingSSC ? 'This Vehicle has a Pending SSC' : 'No Pending SSC',
|
|
104
101
|
};
|
|
105
|
-
//this.calculateHeight(this.state);
|
|
106
102
|
}
|
|
107
103
|
else
|
|
108
104
|
throw new Error('Wrong response format');
|
|
@@ -115,8 +111,9 @@ export class WarrantyDetails {
|
|
|
115
111
|
this.showRecaptcha = false;
|
|
116
112
|
}
|
|
117
113
|
}
|
|
118
|
-
async setData(newData) {
|
|
114
|
+
async setData(newData, headers = {}) {
|
|
119
115
|
this.recaptchaRes = null;
|
|
116
|
+
this.headers = headers;
|
|
120
117
|
clearTimeout(this.networkTimeoutRef);
|
|
121
118
|
clearInterval(this.recaptchaIntervalRef);
|
|
122
119
|
if (this.abortController)
|
|
@@ -128,7 +125,6 @@ export class WarrantyDetails {
|
|
|
128
125
|
this.externalVin = vin;
|
|
129
126
|
try {
|
|
130
127
|
if (!vin || vin.trim().length === 0) {
|
|
131
|
-
//this.componentHeight = '0px';
|
|
132
128
|
this.state = 'idle';
|
|
133
129
|
return;
|
|
134
130
|
}
|
|
@@ -141,7 +137,7 @@ export class WarrantyDetails {
|
|
|
141
137
|
scopedTimeoutRef = setTimeout(r, 600);
|
|
142
138
|
this.networkTimeoutRef = scopedTimeoutRef;
|
|
143
139
|
});
|
|
144
|
-
const vehicleResponse = isVinRequest ? await getVehicleInformation(this, { scopedTimeoutRef, vin, mockData }) : newData;
|
|
140
|
+
const vehicleResponse = isVinRequest ? await getVehicleInformation(this, { scopedTimeoutRef, vin, mockData }, headers) : newData;
|
|
145
141
|
if (this.networkTimeoutRef === scopedTimeoutRef) {
|
|
146
142
|
if (!vehicleResponse)
|
|
147
143
|
throw new Error('Wrong response format');
|
|
@@ -159,8 +155,8 @@ export class WarrantyDetails {
|
|
|
159
155
|
this.errorMessage = error.message;
|
|
160
156
|
}
|
|
161
157
|
}
|
|
162
|
-
async fetchData(requestedVin = this.externalVin) {
|
|
163
|
-
await this.setData(requestedVin);
|
|
158
|
+
async fetchData(requestedVin = this.externalVin, headers = {}) {
|
|
159
|
+
await this.setData(requestedVin, headers);
|
|
164
160
|
}
|
|
165
161
|
async componentDidLoad() {
|
|
166
162
|
if (this.recaptchaKey !== '') {
|
|
@@ -172,34 +168,16 @@ export class WarrantyDetails {
|
|
|
172
168
|
document.head.appendChild(script);
|
|
173
169
|
}
|
|
174
170
|
}
|
|
175
|
-
//calculateHeight(componentState: string) {
|
|
176
|
-
// if (componentState.includes('loading') && this.componentHeight === '0px') {
|
|
177
|
-
// this.componentHeight = '100px';
|
|
178
|
-
// } else if (componentState !== 'idle') {
|
|
179
|
-
// setTimeout(() => {
|
|
180
|
-
// this.componentHeight = `${this.wrapperRef.clientHeight}px`;
|
|
181
|
-
// }, 50);
|
|
182
|
-
// } else {
|
|
183
|
-
// this.componentHeight = '0px';
|
|
184
|
-
// }
|
|
185
|
-
//}
|
|
186
171
|
async setMockData(newMockData) {
|
|
187
172
|
mockData = newMockData;
|
|
188
173
|
}
|
|
189
|
-
onShowSscChange() {
|
|
190
|
-
//this.calculateHeight(this.state);
|
|
191
|
-
}
|
|
192
|
-
onShowWarrantyChange() {
|
|
193
|
-
//this.calculateHeight(this.state);
|
|
194
|
-
}
|
|
195
174
|
async loadingListener() {
|
|
196
|
-
//this.calculateHeight(newState);
|
|
197
175
|
if (this.loadingStateChange)
|
|
198
176
|
this.loadingStateChange(this.state.includes('loading'));
|
|
199
177
|
}
|
|
200
178
|
render() {
|
|
201
179
|
var _a, _b, _c, _d, _e;
|
|
202
|
-
return (h(Host, { key: '
|
|
180
|
+
return (h(Host, { key: '3c8f75a5285bcae20b14896f48219478873dc56f' }, h("div", { key: 'b87f7c2301163f6a8a59ea30005bf5fdce3084b3', class: "min-h-[100px] warranty" }, h("div", { key: '2e9eca00ba1b2b5a362966ce7bec90118a255be4' }, h(Loading, { key: 'e0dcf745ea9409ffd55f54a2b304bf448f00981d', isLoading: this.state.includes('loading') }), 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) && (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) && (h("div", { key: '1f797e76bb68d350ff3b071a11d94cd72f031569', class: "py-4" }, h(StatusCard, { key: '4f674cc1259a7628bb565f737575108ef1882569', desc: this.errorMessage, className: "mx-auto reject-card max-w-500" }), ' ')), this.showWarranty && ['data', 'data-loading'].includes(this.state) && (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 })), h("div", { key: '250484f60f45bc8470c074056cbd567017fb1fcd', style: Object.assign({}, (this.showRecaptcha ? { height: 'auto', padding: '16px 16px 0px 16px' } : { height: '0px' })), class: "recaptcha-container" }, h("slot", { key: '4e728a717fdc8b34a6c861a40ff0cf7ec9dacf95' })), ['data', 'data-loading'].includes(this.state) && this.recaptchaRes && (h("div", { key: 'aa3134245674835812a638b4d8ccf6da1baafc13', class: cn('recaptcha-response', !this.recaptchaRes.hasSSC ? 'success-card' : 'reject-card ') }, this.recaptchaRes.message)), this.checkingUnauthorizedSSC && (h("div", { key: '33c4511869c04b4780285f35e19efee5362b6240', class: "loading-spinner", style: { marginTop: '20px', flexDirection: 'column' } }, h("div", { key: '69c77e7eff03943790b00030068ec3b25c86fb25' }, h("strong", { key: 'a6b3cf9c81dc0cf5dcad68189827428511eb289f' }, "Checking TMC")), h("img", { key: '812b2eb0ca00baa596ccf6e6e5e4943dccc89159', class: "spin", src: Loader }))), this.showSsc && ['data', 'data-loading'].includes(this.state) && ((_d = this.vehicleInformation) === null || _d === void 0 ? void 0 : _d.ssc) !== null && !!((_e = this.vehicleInformation) === null || _e === void 0 ? void 0 : _e.ssc.length) && (h(SSCTable, { key: 'be4c7f932929fc7aff56eb3fb6c45e5d2bd3ff1d', ssc: this.vehicleInformation.ssc })))))));
|
|
203
181
|
}
|
|
204
182
|
static get is() { return "warranty-details"; }
|
|
205
183
|
static get encapsulation() { return "shadow"; }
|
|
@@ -604,18 +582,23 @@ export class WarrantyDetails {
|
|
|
604
582
|
"unInvoicedByBrokerName": {},
|
|
605
583
|
"vehicleInformation": {},
|
|
606
584
|
"checkingUnauthorizedSSC": {},
|
|
607
|
-
"recaptchaRes": {}
|
|
585
|
+
"recaptchaRes": {},
|
|
586
|
+
"headers": {}
|
|
608
587
|
};
|
|
609
588
|
}
|
|
610
589
|
static get methods() {
|
|
611
590
|
return {
|
|
612
591
|
"setData": {
|
|
613
592
|
"complexType": {
|
|
614
|
-
"signature": "(newData: VehicleInformation | string) => Promise<void>",
|
|
593
|
+
"signature": "(newData: VehicleInformation | string, headers?: any) => Promise<void>",
|
|
615
594
|
"parameters": [{
|
|
616
595
|
"name": "newData",
|
|
617
596
|
"type": "string | VehicleInformation",
|
|
618
597
|
"docs": ""
|
|
598
|
+
}, {
|
|
599
|
+
"name": "headers",
|
|
600
|
+
"type": "any",
|
|
601
|
+
"docs": ""
|
|
619
602
|
}],
|
|
620
603
|
"references": {
|
|
621
604
|
"Promise": {
|
|
@@ -641,11 +624,15 @@ export class WarrantyDetails {
|
|
|
641
624
|
},
|
|
642
625
|
"fetchData": {
|
|
643
626
|
"complexType": {
|
|
644
|
-
"signature": "(requestedVin?: string) => Promise<void>",
|
|
627
|
+
"signature": "(requestedVin?: string, headers?: any) => Promise<void>",
|
|
645
628
|
"parameters": [{
|
|
646
629
|
"name": "requestedVin",
|
|
647
630
|
"type": "string",
|
|
648
631
|
"docs": ""
|
|
632
|
+
}, {
|
|
633
|
+
"name": "headers",
|
|
634
|
+
"type": "any",
|
|
635
|
+
"docs": ""
|
|
649
636
|
}],
|
|
650
637
|
"references": {
|
|
651
638
|
"Promise": {
|
|
@@ -696,12 +683,6 @@ export class WarrantyDetails {
|
|
|
696
683
|
static get elementRef() { return "el"; }
|
|
697
684
|
static get watchers() {
|
|
698
685
|
return [{
|
|
699
|
-
"propName": "showSsc",
|
|
700
|
-
"methodName": "onShowSscChange"
|
|
701
|
-
}, {
|
|
702
|
-
"propName": "showWarranty",
|
|
703
|
-
"methodName": "onShowWarrantyChange"
|
|
704
|
-
}, {
|
|
705
686
|
"propName": "state",
|
|
706
687
|
"methodName": "loadingListener"
|
|
707
688
|
}];
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Built by ShiftSoftware
|
|
3
3
|
* Copyright (c)
|
|
4
4
|
*/
|
|
5
|
-
export const getPartInformation = async (component, generalProps) => {
|
|
5
|
+
export const getPartInformation = async (component, generalProps, headers = {}) => {
|
|
6
6
|
const { notAvailableMessage, mockData, partNumber, scopedTimeoutRef, middlewareCallback } = generalProps;
|
|
7
7
|
const { isDev, baseUrl, queryString, abortController, networkTimeoutRef, loadedResponse } = component;
|
|
8
8
|
const handleResult = (newPartInformation) => {
|
|
@@ -23,7 +23,7 @@ export const getPartInformation = async (component, generalProps) => {
|
|
|
23
23
|
else {
|
|
24
24
|
if (!baseUrl)
|
|
25
25
|
throw new Error('Please provide base-url');
|
|
26
|
-
const response = await fetch(`${baseUrl}${partNumber}?${queryString}`, { signal: abortController.signal });
|
|
26
|
+
const response = await fetch(`${baseUrl}${partNumber}?${queryString}`, { signal: abortController.signal, headers: headers });
|
|
27
27
|
const newData = (await response.json());
|
|
28
28
|
return handleResult(newData);
|
|
29
29
|
}
|
|
@@ -13,9 +13,9 @@ const vehicleRequestHeaders = {
|
|
|
13
13
|
cityIntegrationId: 'City-Integration-Id',
|
|
14
14
|
brandIntegrationId: 'Brand-Integration-Id',
|
|
15
15
|
companyIntegrationId: 'Company-Integration-Id',
|
|
16
|
-
companyBranchIntegrationId: 'Company-Branch-Integration-Id'
|
|
16
|
+
companyBranchIntegrationId: 'Company-Branch-Integration-Id'
|
|
17
17
|
};
|
|
18
|
-
export const getVehicleInformation = async (component, generalProps) => {
|
|
18
|
+
export const getVehicleInformation = async (component, generalProps, headers = {}) => {
|
|
19
19
|
const { notAvailableMessage, mockData, vin, scopedTimeoutRef, middlewareCallback } = generalProps;
|
|
20
20
|
const { isDev, baseUrl, queryString, abortController, networkTimeoutRef, loadedResponse } = component;
|
|
21
21
|
const handleResult = (newVehicleInformation) => {
|
|
@@ -36,12 +36,12 @@ export const getVehicleInformation = async (component, generalProps) => {
|
|
|
36
36
|
else {
|
|
37
37
|
if (!baseUrl)
|
|
38
38
|
throw new Error('Please provide base-url');
|
|
39
|
-
const
|
|
39
|
+
const componentHeaders = Object.assign({}, headers);
|
|
40
40
|
Object.entries(vehicleRequestHeaders).forEach(([componentHeaderKey, headerField]) => {
|
|
41
41
|
if (component[componentHeaderKey])
|
|
42
|
-
|
|
42
|
+
componentHeaders[headerField] = component[componentHeaderKey];
|
|
43
43
|
});
|
|
44
|
-
const response = await fetch(`${baseUrl}${vin}?${queryString}`, { signal: abortController.signal, headers:
|
|
44
|
+
const response = await fetch(`${baseUrl}${vin}?${queryString}`, { signal: abortController.signal, headers: componentHeaders });
|
|
45
45
|
const newData = (await response.json());
|
|
46
46
|
return handleResult(newData);
|
|
47
47
|
}
|
|
@@ -1,42 +1,26 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
const franchiseSelectorError = document.getElementById('franchise-selector-error-message');
|
|
19
|
-
|
|
20
|
-
var lastLookupResult = null;
|
|
1
|
+
let vehicleSpecification;
|
|
2
|
+
let vehicleAccessories;
|
|
3
|
+
let warranty;
|
|
4
|
+
let serviceHistory;
|
|
5
|
+
let paintThickness;
|
|
6
|
+
let dynamicClaim;
|
|
7
|
+
let distributorLookup;
|
|
8
|
+
let deadStockLookup;
|
|
9
|
+
let manufacturerLookup;
|
|
10
|
+
let componentsList;
|
|
11
|
+
let searchutton;
|
|
12
|
+
let partNumberInput;
|
|
13
|
+
let partQtyInput;
|
|
14
|
+
let vinInput;
|
|
15
|
+
let franchiseSelector;
|
|
16
|
+
let searching;
|
|
17
|
+
let lookupPage;
|
|
21
18
|
|
|
22
19
|
function handleLoadingState(isLoading) {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
searchIcon.style.display = 'none';
|
|
27
|
-
spinnerIcon.style.display = 'inline-block';
|
|
28
|
-
searchText.innerHTML = 'Searching...';
|
|
29
|
-
input.readOnly = true;
|
|
30
|
-
input.classList.add('disabled');
|
|
31
|
-
} else {
|
|
32
|
-
$("li:not('.active')").removeClass('disabled');
|
|
33
|
-
searchIcon.style.display = 'inline-block';
|
|
34
|
-
spinnerIcon.style.display = 'none';
|
|
35
|
-
searchText.innerHTML = 'Search';
|
|
36
|
-
input.readOnly = false;
|
|
37
|
-
input.classList.remove('disabled');
|
|
20
|
+
lookupPage.invokeMethodAsync('onLoadingStateChanged', isLoading);
|
|
21
|
+
|
|
22
|
+
if (!isLoading)
|
|
38
23
|
searching = false;
|
|
39
|
-
}
|
|
40
24
|
}
|
|
41
25
|
|
|
42
26
|
function handleLoadData(newResponse, activeElement) {
|
|
@@ -45,15 +29,43 @@ function handleLoadData(newResponse, activeElement) {
|
|
|
45
29
|
});
|
|
46
30
|
}
|
|
47
31
|
|
|
48
|
-
|
|
49
|
-
$('#vehicle-info-tab a').click(function (e) {
|
|
50
|
-
e.preventDefault();
|
|
51
|
-
$(this).tab('show');
|
|
52
|
-
});
|
|
32
|
+
function registerLookupPage(instance) {
|
|
53
33
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
34
|
+
lookupPage = instance;
|
|
35
|
+
|
|
36
|
+
vehicleSpecification = document.getElementById('vehicle-specification');
|
|
37
|
+
vehicleAccessories = document.getElementById('vehicle-accessories');
|
|
38
|
+
warranty = document.getElementById('warranty');
|
|
39
|
+
serviceHistory = document.getElementById('service-history');
|
|
40
|
+
paintThickness = document.getElementById('paint-thickness');
|
|
41
|
+
dynamicClaim = document.getElementById('dynamic-claim');
|
|
42
|
+
distributorLookup = document.getElementById('distributor-lookup');
|
|
43
|
+
deadStockLookup = document.getElementById('dead-stock-lookup');
|
|
44
|
+
manufacturerLookup = document.getElementById('manufacturer-lookup');
|
|
45
|
+
componentsList = [vehicleSpecification, warranty, serviceHistory, dynamicClaim, paintThickness, vehicleAccessories, distributorLookup, deadStockLookup, manufacturerLookup];
|
|
46
|
+
searchutton = document.getElementById('searchButton');
|
|
47
|
+
partNumberInput = document.getElementById('partNumberInput');
|
|
48
|
+
partQtyInput = document.getElementById('partQtyInput');
|
|
49
|
+
vinInput = document.getElementById('vinInput');
|
|
50
|
+
franchiseSelector = document.getElementById('franchise-selector');
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
if (lookupPage.invokeMethodAsync) {
|
|
54
|
+
|
|
55
|
+
}
|
|
56
|
+
else {
|
|
57
|
+
lookupPage.invokeMethodAsync = async function (methodName, payload) {
|
|
58
|
+
if (methodName === 'onErrorStateChanged') {
|
|
59
|
+
await lookupPage.onErrorStateChanged(payload);
|
|
60
|
+
}
|
|
61
|
+
else if (methodName === 'onLoadingStateChanged') {
|
|
62
|
+
await lookupPage.onLoadingStateChanged(payload);
|
|
63
|
+
}
|
|
64
|
+
else if (methodName === 'getHeaders') {
|
|
65
|
+
return await lookupPage.getHeaders();
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
57
69
|
|
|
58
70
|
componentsList.forEach(element => {
|
|
59
71
|
if (element === null) return;
|
|
@@ -62,84 +74,136 @@ document.onreadystatechange = function (e) {
|
|
|
62
74
|
element.loadedResponse = newResponse => handleLoadData(newResponse, element);
|
|
63
75
|
});
|
|
64
76
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
77
|
+
if (searchutton) {
|
|
78
|
+
searchutton.addEventListener("click", async function (e) {
|
|
79
|
+
await search();
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
if (vinInput) {
|
|
84
|
+
vinInput.addEventListener("keydown", async function (e) {
|
|
85
|
+
if (e.key === 'Enter') {
|
|
86
|
+
e.preventDefault();
|
|
87
|
+
await search();
|
|
88
|
+
}
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
if (partNumberInput) {
|
|
93
|
+
partNumberInput.addEventListener("keydown", async function (e) {
|
|
94
|
+
if (e.key === 'Enter') {
|
|
95
|
+
e.preventDefault();
|
|
96
|
+
await search();
|
|
97
|
+
}
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
if (partQtyInput) {
|
|
102
|
+
partQtyInput.addEventListener("keydown", async function (e) {
|
|
103
|
+
if (e.key === 'Enter') {
|
|
104
|
+
e.preventDefault();
|
|
105
|
+
await search();
|
|
106
|
+
}
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
async function search() {
|
|
72
112
|
|
|
73
|
-
var searching = false;
|
|
74
|
-
function search() {
|
|
75
113
|
if (searching) return;
|
|
76
114
|
|
|
77
115
|
searching = true;
|
|
78
116
|
|
|
79
|
-
|
|
80
|
-
error.innerHTML = '';
|
|
117
|
+
lookupPage.invokeMethodAsync('onErrorStateChanged', { vinError: null, franchiseError: null, partError: null });
|
|
81
118
|
|
|
82
|
-
if (
|
|
83
|
-
|
|
119
|
+
if (vinInput) {
|
|
120
|
+
var vin = vinInput.value;
|
|
84
121
|
|
|
85
|
-
|
|
86
|
-
|
|
122
|
+
if (vin == '') {
|
|
123
|
+
lookupPage.invokeMethodAsync('onErrorStateChanged', { vinError: 'VIN is required', franchiseError: null, partError: null });
|
|
87
124
|
|
|
88
|
-
|
|
125
|
+
searching = false;
|
|
89
126
|
|
|
90
|
-
|
|
91
|
-
|
|
127
|
+
return;
|
|
128
|
+
}
|
|
92
129
|
|
|
93
|
-
|
|
130
|
+
if (!validateVin(vin)) {
|
|
131
|
+
lookupPage.invokeMethodAsync('onErrorStateChanged', { vinError: 'Invalid VIN', franchiseError: null, partError: null });
|
|
94
132
|
|
|
95
|
-
|
|
133
|
+
searching = false;
|
|
96
134
|
|
|
97
|
-
|
|
98
|
-
|
|
135
|
+
return;
|
|
136
|
+
}
|
|
99
137
|
|
|
100
|
-
|
|
101
|
-
input.classList.add('error_bg');
|
|
138
|
+
if (franchiseSelector) {
|
|
102
139
|
|
|
103
|
-
|
|
140
|
+
var franchise = franchiseSelector.value;
|
|
104
141
|
|
|
105
|
-
|
|
142
|
+
warranty.setAttribute('brand-integration-id', franchise);
|
|
106
143
|
|
|
107
|
-
|
|
108
|
-
|
|
144
|
+
if (franchise == '') {
|
|
145
|
+
|
|
146
|
+
lookupPage.invokeMethodAsync('onErrorStateChanged', { vinError: null, franchiseError: 'Please Select a Franchise', partError: null });
|
|
147
|
+
|
|
148
|
+
searching = false;
|
|
149
|
+
|
|
150
|
+
return;
|
|
151
|
+
}
|
|
152
|
+
}
|
|
109
153
|
|
|
110
|
-
|
|
111
|
-
var franchise = franchiseSelector.value;
|
|
154
|
+
var headers = await lookupPage.invokeMethodAsync('getHeaders');
|
|
112
155
|
|
|
113
|
-
|
|
156
|
+
if (vehicleSpecification && vehicleSpecification.checkVisibility()) {
|
|
157
|
+
vehicleSpecification.fetchData(vin, headers);
|
|
158
|
+
}
|
|
159
|
+
if (warranty && warranty.checkVisibility()) {
|
|
160
|
+
warranty.fetchData(vin, headers);
|
|
161
|
+
}
|
|
162
|
+
if (serviceHistory && serviceHistory.checkVisibility()) {
|
|
163
|
+
serviceHistory.fetchData(vin, headers);
|
|
164
|
+
}
|
|
165
|
+
if (dynamicClaim && dynamicClaim.checkVisibility()) {
|
|
166
|
+
dynamicClaim.fetchData(vin, headers);
|
|
167
|
+
}
|
|
168
|
+
if (paintThickness && paintThickness.checkVisibility()) {
|
|
169
|
+
paintThickness.fetchData(vin, headers);
|
|
170
|
+
}
|
|
171
|
+
if (vehicleAccessories && vehicleAccessories.checkVisibility()) {
|
|
172
|
+
vehicleAccessories.fetchData(vin, headers);
|
|
173
|
+
}
|
|
174
|
+
}
|
|
114
175
|
|
|
115
|
-
|
|
116
|
-
|
|
176
|
+
if (partNumberInput) {
|
|
177
|
+
var partNumber = partNumberInput.value;
|
|
117
178
|
|
|
118
|
-
|
|
179
|
+
if (partNumber == '') {
|
|
180
|
+
lookupPage.invokeMethodAsync('onErrorStateChanged', { partError: 'Part Number is Required' });
|
|
119
181
|
|
|
120
182
|
searching = false;
|
|
121
183
|
|
|
122
184
|
return;
|
|
123
185
|
}
|
|
124
|
-
}
|
|
125
186
|
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
187
|
+
|
|
188
|
+
var searchText = partNumber;
|
|
189
|
+
|
|
190
|
+
var partQty = partQtyInput.value;
|
|
191
|
+
|
|
192
|
+
if (partQty.trim() !== '' && partQty !== '0') {
|
|
193
|
+
searchText = `${partNumber}/${partQty}`;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
var headers = await lookupPage.invokeMethodAsync('getHeaders');
|
|
197
|
+
|
|
198
|
+
if (distributorLookup && distributorLookup.checkVisibility()) {
|
|
199
|
+
distributorLookup.fetchData(searchText, headers);
|
|
200
|
+
}
|
|
201
|
+
if (deadStockLookup && deadStockLookup.checkVisibility()) {
|
|
202
|
+
deadStockLookup.fetchData(searchText, headers);
|
|
203
|
+
}
|
|
204
|
+
if (manufacturerLookup && manufacturerLookup.checkVisibility()) {
|
|
205
|
+
manufacturerLookup.fetchData(searchText, headers);
|
|
206
|
+
}
|
|
143
207
|
}
|
|
144
208
|
}
|
|
145
209
|
|
|
@@ -216,3 +280,6 @@ function validateVin(vin) {
|
|
|
216
280
|
|
|
217
281
|
return valid;
|
|
218
282
|
}
|
|
283
|
+
|
|
284
|
+
|
|
285
|
+
export { registerLookupPage };
|