adp-web-components 0.0.13 → 0.0.15
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/{loader-baf2418b.js → Loading-20e4ef35.js} +9 -0
- package/dist/cjs/dead-stock-lookup.cjs.entry.js +3 -4
- package/dist/cjs/distributor-lookup.cjs.entry.js +3 -4
- package/dist/cjs/dynamic-claim_6.cjs.entry.js +1046 -0
- package/dist/cjs/dynamic-redeem.cjs.entry.js +5 -5
- package/dist/cjs/form-input.cjs.entry.js +2 -2
- package/dist/cjs/general-inquiry-form.cjs.entry.js +2 -2
- package/dist/cjs/{index-d4b5214c.js → index-97b8da6d.js} +289 -8
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/manufacturer-lookup.cjs.entry.js +3 -4
- package/dist/cjs/shift-components.cjs.js +2 -2
- package/dist/cjs/vehicle-lookup.cjs.entry.js +133 -0
- package/dist/collection/collection-manifest.json +6 -5
- package/dist/collection/components/dynamic-claim/dynamic-claim.css +1 -1
- package/dist/collection/components/dynamic-claim/dynamic-claim.js +2 -2
- package/dist/collection/components/dynamic-redeem/dynamic-redeem.css +1 -1
- package/dist/collection/components/dynamic-redeem/dynamic-redeem.js +3 -3
- package/dist/collection/components/form-input/form-input.js +1 -1
- package/dist/collection/components/general-inquiry-form/general-inquiry-form.js +1 -1
- package/dist/collection/components/paint-thickness/paint-thickness.css +1 -1
- package/dist/collection/components/paint-thickness/paint-thickness.js +3 -3
- package/dist/collection/components/part-lookup/dead-stock-lookup.js +1 -1
- package/dist/collection/components/part-lookup/distributor-lookup.js +1 -1
- package/dist/collection/components/part-lookup/manufacturer-lookup.js +1 -1
- package/dist/collection/components/service-history/service-history.css +1 -1
- package/dist/collection/components/service-history/service-history.js +1 -1
- package/dist/collection/components/vehicle-accessories/vehicle-accessories.css +1 -1
- package/dist/collection/components/vehicle-accessories/vehicle-accessories.js +3 -3
- package/dist/collection/components/vehicle-lookup/vehicle-lookup.css +1 -0
- package/dist/collection/components/vehicle-lookup/vehicle-lookup.js +244 -0
- package/dist/collection/components/vehicle-specification/vehicle-specification.css +1 -1
- package/dist/collection/components/vehicle-specification/vehicle-specification.js +1 -1
- package/dist/collection/components/warranty-details/warranty-details.css +1 -1
- package/dist/collection/components/warranty-details/warranty-details.js +1 -1
- package/dist/collection/global/lib/validate-vin.js +62 -0
- package/dist/components/dead-stock-lookup.js +1 -1
- package/dist/components/distributor-lookup.js +1 -1
- package/dist/components/dynamic-claim.js +1 -1
- package/dist/components/dynamic-redeem.js +1 -1
- package/dist/components/form-input.js +1 -1
- package/dist/components/general-inquiry-form.js +1 -1
- package/dist/components/index.js +1 -1
- package/dist/components/manufacturer-lookup.js +1 -1
- package/dist/components/p-05871c28.js +5 -0
- package/dist/components/p-23551e81.js +5 -0
- package/dist/components/p-325b6857.js +5 -0
- package/dist/components/{p-50f73226.js → p-3bf0339d.js} +1 -1
- package/dist/components/p-514c4736.js +5 -0
- package/dist/components/{p-2b0cc0c6.js → p-8385e385.js} +1 -1
- package/dist/components/p-be0a5ab5.js +5 -0
- package/dist/components/p-c8eef708.js +5 -0
- package/dist/components/p-da533bd7.js +5 -0
- package/dist/components/p-e46b126e.js +5 -0
- package/dist/components/p-f1ffc23d.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.d.ts +11 -0
- package/dist/components/vehicle-lookup.js +5 -0
- package/dist/components/vehicle-specification.js +1 -1
- package/dist/components/warranty-details.js +1 -1
- package/dist/esm/{loader-027b88af.js → Loading-d050617c.js} +9 -1
- package/dist/esm/dead-stock-lookup.entry.js +3 -4
- package/dist/esm/distributor-lookup.entry.js +3 -4
- package/dist/esm/dynamic-claim_6.entry.js +1037 -0
- package/dist/esm/dynamic-redeem.entry.js +5 -5
- package/dist/esm/form-input.entry.js +2 -2
- package/dist/esm/general-inquiry-form.entry.js +2 -2
- package/dist/esm/{index-ef54644b.js → index-ff1dab22.js} +289 -8
- package/dist/esm/loader.js +3 -3
- package/dist/esm/manufacturer-lookup.entry.js +3 -4
- package/dist/esm/shift-components.js +3 -3
- package/dist/esm/vehicle-lookup.entry.js +129 -0
- package/dist/shift-components/{p-894e7518.entry.js → p-15e82b1a.entry.js} +1 -1
- package/dist/shift-components/p-1a727cfd.entry.js +5 -0
- package/dist/shift-components/p-2bb4415e.entry.js +5 -0
- package/dist/shift-components/p-3f3b41b4.entry.js +5 -0
- package/dist/shift-components/{p-8e818568.entry.js → p-4c3f2850.entry.js} +1 -1
- package/dist/shift-components/p-4ca95c3d.entry.js +5 -0
- package/dist/shift-components/p-65939a2f.js +5 -0
- package/dist/shift-components/p-8b198a04.entry.js +5 -0
- package/dist/shift-components/p-d577db71.entry.js +5 -0
- package/dist/shift-components/p-f37b60d5.js +6 -0
- package/dist/shift-components/shift-components.esm.js +1 -1
- package/dist/types/components/vehicle-lookup/vehicle-lookup.d.ts +23 -0
- package/dist/types/components.d.ts +37 -0
- package/dist/types/global/lib/validate-vin.d.ts +1 -0
- package/package.json +1 -1
- package/readme.md +2 -91
- package/dist/cjs/Loading-ee1a2ceb.js +0 -16
- package/dist/cjs/dynamic-claim.cjs.entry.js +0 -306
- package/dist/cjs/image-expansion-a9c9c6f7.js +0 -77
- package/dist/cjs/paint-thickness.cjs.entry.js +0 -118
- package/dist/cjs/service-history.cjs.entry.js +0 -103
- package/dist/cjs/vehicle-accessories.cjs.entry.js +0 -122
- package/dist/cjs/vehicle-specification.cjs.entry.js +0 -98
- package/dist/cjs/vehicleInformation-35c470fc.js +0 -52
- package/dist/cjs/warranty-details.cjs.entry.js +0 -257
- package/dist/components/p-4dc47f5f.js +0 -5
- package/dist/components/p-8375923d.js +0 -5
- package/dist/components/p-a454210b.js +0 -5
- package/dist/esm/Loading-61648252.js +0 -14
- package/dist/esm/dynamic-claim.entry.js +0 -302
- package/dist/esm/image-expansion-08c4bf0d.js +0 -73
- package/dist/esm/paint-thickness.entry.js +0 -114
- package/dist/esm/service-history.entry.js +0 -99
- package/dist/esm/vehicle-accessories.entry.js +0 -118
- package/dist/esm/vehicle-specification.entry.js +0 -94
- package/dist/esm/vehicleInformation-f7290628.js +0 -50
- package/dist/esm/warranty-details.entry.js +0 -253
- package/dist/shift-components/p-65e6ab8e.js +0 -5
- package/dist/shift-components/p-6b21ce2d.entry.js +0 -5
- package/dist/shift-components/p-7d85e912.entry.js +0 -5
- package/dist/shift-components/p-7f258017.entry.js +0 -5
- package/dist/shift-components/p-9653e992.entry.js +0 -5
- package/dist/shift-components/p-a21e2e2e.js +0 -5
- package/dist/shift-components/p-c4fad245.js +0 -5
- package/dist/shift-components/p-ca1e2e5b.entry.js +0 -5
- package/dist/shift-components/p-d1b9cd93.entry.js +0 -5
- package/dist/shift-components/p-d5ff7544.js +0 -5
- package/dist/shift-components/p-d6f40c8d.entry.js +0 -5
- package/dist/shift-components/p-e05acce1.entry.js +0 -5
- package/dist/shift-components/p-e97316d2.js +0 -6
- package/dist/shift-components/p-faa8070a.entry.js +0 -5
- package/dist/shift-components/p-feb3df85.entry.js +0 -5
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Built by ShiftSoftware
|
|
3
|
-
* Copyright (c)
|
|
4
|
-
*/
|
|
5
|
-
import { r as registerInstance, h, H as Host, g as getElement } from './index-ef54644b.js';
|
|
6
|
-
import { L as Loading } from './Loading-61648252.js';
|
|
7
|
-
import { c as cn } from './cn-cc419b94.js';
|
|
8
|
-
import { g as getVehicleInformation } from './vehicleInformation-f7290628.js';
|
|
9
|
-
import './loader-027b88af.js';
|
|
10
|
-
|
|
11
|
-
const serviceHistoryCss = "*,: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}.sticky{position:sticky}.top-0{top:0}.mx-auto{margin-left:auto;margin-right:auto}.mt-\\[12px\\]{margin-top:12px}.flex{display:flex}.table{display:table}.h-0{height:0}.h-\\[40px\\]{height:40px}.h-\\[80px\\]{height:80px}.max-h-\\[70dvh\\]{max-height:70dvh}.min-h-\\[100px\\]{min-height:100px}.w-fit{width:fit-content}.w-full{width:100%}.flex-1{flex:1 1 0%}.shrink-0{flex-shrink:0}.border-collapse{border-collapse:collapse}.scale-0{--tw-scale-x:0;--tw-scale-y:0;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.flex-col{flex-direction:column}.items-center{align-items:center}.justify-center{justify-content:center}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.whitespace-nowrap{white-space:nowrap}.rounded-\\[4px\\]{border-radius:4px}.rounded-\\[8px\\]{border-radius:8px}.border{border-width:1px}.border-b{border-bottom-width:1px}.\\!border-none{border-style:none!important}.border-\\[\\#d6d8dc\\]{--tw-border-opacity:1;border-color:rgb(214 216 220/var(--tw-border-opacity,1))}.bg-\\[\\#e1e3e5\\]{--tw-bg-opacity:1;background-color:rgb(225 227 229/var(--tw-bg-opacity,1))}.bg-white{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity,1))}.px-\\[10px\\]{padding-left:10px;padding-right:10px}.px-\\[16px\\]{padding-left:16px;padding-right:16px}.py-\\[16px\\]{padding-bottom:16px;padding-top:16px}.py-\\[20px\\]{padding-bottom:20px;padding-top:20px}.py-\\[8px\\]{padding-bottom:8px;padding-top:8px}.pt-\\[4px\\]{padding-top:4px}.text-center{text-align:center}.text-\\[18px\\]{font-size:18px}.text-\\[20px\\]{font-size:20px}.font-bold{font-weight:700}.text-\\[\\#383c43\\]{--tw-text-opacity:1;color:rgb(56 60 67/var(--tw-text-opacity,1))}.text-red-600{--tw-text-opacity:1;color:rgb(220 38 38/var(--tw-text-opacity,1))}.opacity-0{opacity:0}.shadow{--tw-shadow:0 1px 3px 0 rgba(0,0,0,.1),0 1px 2px -1px rgba(0,0,0,.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color),0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.transition-all{transition-duration:.15s;transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1)}.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)}.duration-100{transition-duration:.1s}.duration-300{transition-duration:.3s}.duration-700{transition-duration:.7s}.reject-card{background-color:#f7d7d8;border-color:#f2aeb5;color:#58151c}.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}";
|
|
12
|
-
const ServiceHistoryStyle0 = serviceHistoryCss;
|
|
13
|
-
|
|
14
|
-
let mockData = {};
|
|
15
|
-
const ServiceHistory = class {
|
|
16
|
-
constructor(hostRef) {
|
|
17
|
-
registerInstance(this, hostRef);
|
|
18
|
-
this.baseUrl = '';
|
|
19
|
-
this.isDev = false;
|
|
20
|
-
this.queryString = '';
|
|
21
|
-
this.loadingStateChange = undefined;
|
|
22
|
-
this.loadedResponse = undefined;
|
|
23
|
-
this.state = 'idle';
|
|
24
|
-
this.externalVin = null;
|
|
25
|
-
this.errorMessage = null;
|
|
26
|
-
this.vehicleInformation = undefined;
|
|
27
|
-
}
|
|
28
|
-
handleSettingData(response) {
|
|
29
|
-
if (response.serviceHistory === null)
|
|
30
|
-
response.serviceHistory = [];
|
|
31
|
-
this.vehicleInformation = response;
|
|
32
|
-
}
|
|
33
|
-
async setData(newData, headers = {}) {
|
|
34
|
-
clearTimeout(this.networkTimeoutRef);
|
|
35
|
-
if (this.abortController)
|
|
36
|
-
this.abortController.abort();
|
|
37
|
-
this.abortController = new AbortController();
|
|
38
|
-
let scopedTimeoutRef;
|
|
39
|
-
const isVinRequest = typeof newData === 'string';
|
|
40
|
-
const vin = isVinRequest ? newData : newData === null || newData === void 0 ? void 0 : newData.vin;
|
|
41
|
-
this.externalVin = vin;
|
|
42
|
-
try {
|
|
43
|
-
if (!vin || vin.trim().length === 0) {
|
|
44
|
-
this.state = 'idle';
|
|
45
|
-
return;
|
|
46
|
-
}
|
|
47
|
-
if (this.state === 'data' || this.state === 'error') {
|
|
48
|
-
this.state = (this.state + '-loading');
|
|
49
|
-
}
|
|
50
|
-
else
|
|
51
|
-
this.state = 'loading';
|
|
52
|
-
await new Promise(r => {
|
|
53
|
-
scopedTimeoutRef = setTimeout(r, 700);
|
|
54
|
-
this.networkTimeoutRef = scopedTimeoutRef;
|
|
55
|
-
});
|
|
56
|
-
const vehicleResponse = isVinRequest ? await getVehicleInformation(this, { scopedTimeoutRef, vin, mockData }, headers) : newData;
|
|
57
|
-
if (this.networkTimeoutRef === scopedTimeoutRef) {
|
|
58
|
-
if (!vehicleResponse)
|
|
59
|
-
throw new Error('Wrong response format');
|
|
60
|
-
this.handleSettingData(vehicleResponse);
|
|
61
|
-
}
|
|
62
|
-
this.errorMessage = null;
|
|
63
|
-
this.state = 'data';
|
|
64
|
-
}
|
|
65
|
-
catch (error) {
|
|
66
|
-
if (error && (error === null || error === void 0 ? void 0 : error.name) === 'AbortError')
|
|
67
|
-
return;
|
|
68
|
-
this.state = 'error';
|
|
69
|
-
this.vehicleInformation = null;
|
|
70
|
-
this.errorMessage = error.message;
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
async fetchData(requestedVin = this.externalVin, headers = {}) {
|
|
74
|
-
await this.setData(requestedVin, headers);
|
|
75
|
-
}
|
|
76
|
-
async loadingListener() {
|
|
77
|
-
if (this.loadingStateChange)
|
|
78
|
-
this.loadingStateChange(this.state.includes('loading'));
|
|
79
|
-
}
|
|
80
|
-
async setMockData(newMockData) {
|
|
81
|
-
mockData = newMockData;
|
|
82
|
-
}
|
|
83
|
-
render() {
|
|
84
|
-
var _a, _b, _c, _d;
|
|
85
|
-
return (h(Host, { key: '41626d52c1a46c5aa17d924c740ff128c717db72' }, h("div", { key: '148b48b3511bbb0edcb06c95f432cec3794bb8be', class: "min-h-[100px] relative transition-all duration-300 overflow-hidden" }, h("div", { key: '83af30eb9e1bb760b7d0524b5868b98390ae67c0' }, h(Loading, { key: '6f4a0f5c66407fc24ba9ffc624d3d2e37abca2f6', isLoading: this.state.includes('loading') }), h("div", { key: 'f16ed2ccb8a9e3bcd8f71eaf05fb3c4a28eb0a16', class: cn('transition-all duration-700', { 'scale-0': this.state.includes('loading') || this.state === 'idle', 'opacity-0': this.state.includes('loading') }) }, h("div", { key: 'ffba94045d0641ffad445c78173ef139e133ae8d', 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: '710d22f3233b428cafab34984cc562e46fa92d8b', class: "py-[16px]" }, h("div", { key: 'b036ab0231e60c66a24757b23ec5acceeca359f9', 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: '64fd2439a7edc45b552a7e7ea2a6583b9376b57b', class: "flex mt-[12px] max-h-[70dvh] overflow-hidden rounded-[4px] flex-col border border-[#d6d8dc]" }, h("div", { key: 'dec74cb4310d310094fa9958b0c3991f476d9bb8', class: "w-full h-[40px] flex shrink-0 justify-center text-[18px] items-center text-[#383c43] text-center bg-[#e1e3e5]" }, "Service History"), h("div", { key: 'bc17bcd99593f7a86c00c6fbed2a9cc3c516eae7', class: "h-0 overflow-auto flex-1" }, !((_b = this.vehicleInformation) === null || _b === void 0 ? void 0 : _b.serviceHistory.length) && h("div", { key: '8d5a0902e8a13909867f0f138bbd629ad97b8b3e', class: "h-[80px] flex items-center justify-center text-[18px]" }, "No data is available."), !!((_c = this.vehicleInformation) === null || _c === void 0 ? void 0 : _c.serviceHistory.length) && (h("table", { key: '9121de3dbcdd6ceb6e88380d15ba3a0885626af3', class: "w-full overflow-auto relative border-collapse" }, h("thead", { key: '492edb0969f9774ff1fa78af9fdb4bab3f240e23', class: "top-0 font-bold sticky bg-white" }, h("tr", { key: '91bb78d8f37c12c20f331ec55f76d362572bfcee' }, ['Branch', 'Dealer', 'Invoice No.', 'Date', 'Service Type', 'Odometer'].map(title => (h("th", { key: title, class: "px-[10px] py-[20px] text-center whitespace-nowrap border-b border-[#d6d8dc]" }, title))))), h("tbody", { key: '6019cc8f4ad18c13b3b082fe87da6a2bfab65773' }, (_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 => {
|
|
86
|
-
var _a;
|
|
87
|
-
return (h("td", { key: service.invoiceNumber + serviceType, class: cn('px-[10px] py-[20px] text-center whitespace-nowrap border-b border-[#d6d8dc]', {
|
|
88
|
-
'!border-none': idx === ((_a = this.vehicleInformation) === null || _a === void 0 ? void 0 : _a.serviceHistory.length) - 1,
|
|
89
|
-
}) }, service[serviceType] || '...'));
|
|
90
|
-
})))))))))))))));
|
|
91
|
-
}
|
|
92
|
-
get el() { return getElement(this); }
|
|
93
|
-
static get watchers() { return {
|
|
94
|
-
"state": ["loadingListener"]
|
|
95
|
-
}; }
|
|
96
|
-
};
|
|
97
|
-
ServiceHistory.style = ServiceHistoryStyle0;
|
|
98
|
-
|
|
99
|
-
export { ServiceHistory as service_history };
|
|
@@ -1,118 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Built by ShiftSoftware
|
|
3
|
-
* Copyright (c)
|
|
4
|
-
*/
|
|
5
|
-
import { r as registerInstance, h, H as Host, g as getElement } from './index-ef54644b.js';
|
|
6
|
-
import { g as getVehicleInformation } from './vehicleInformation-f7290628.js';
|
|
7
|
-
import { c as cn } from './cn-cc419b94.js';
|
|
8
|
-
import { L as Loading } from './Loading-61648252.js';
|
|
9
|
-
import { o as openImageViewer, c as closeImageViewer, e as eyeSvg } from './image-expansion-08c4bf0d.js';
|
|
10
|
-
import './loader-027b88af.js';
|
|
11
|
-
|
|
12
|
-
const vehicleAccessoriesCss = "*,: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}.pointer-events-none{pointer-events:none}.pointer-events-auto{pointer-events:auto}.static{position:static}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.sticky{position:sticky}.left-0{left:0}.top-0{top:0}.z-40{z-index:40}.z-50{z-index:50}.float-right{float:right}.mx-auto{margin-left:auto;margin-right:auto}.mr-\\[16px\\]{margin-right:16px}.mt-\\[12px\\]{margin-top:12px}.mt-\\[16px\\]{margin-top:16px}.flex{display:flex}.table{display:table}.size-12{height:3rem;width:3rem}.size-full{height:100%;width:100%}.h-0{height:0}.h-1{height:.25rem}.h-\\[100dvh\\]{height:100dvh}.h-\\[40px\\]{height:40px}.h-\\[80px\\]{height:80px}.h-auto{height:auto}.max-h-\\[133px\\]{max-height:133px}.max-h-\\[70dvh\\]{max-height:70dvh}.min-h-\\[100px\\]{min-height:100px}.w-12{width:3rem}.w-\\[100dvw\\]{width:100dvw}.w-auto{width:auto}.w-fit{width:fit-content}.w-full{width:100%}.max-w-\\[133px\\]{max-width:133px}.flex-1{flex:1 1 0%}.shrink-0{flex-shrink:0}.border-collapse{border-collapse:collapse}.-rotate-45{--tw-rotate:-45deg}.-rotate-45,.rotate-45{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.rotate-45{--tw-rotate:45deg}.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))}.cursor-pointer{cursor:pointer}.flex-col{flex-direction:column}.items-center{align-items:center}.justify-center{justify-content:center}.gap-\\[4px\\]{gap:4px}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.whitespace-nowrap{white-space:nowrap}.rounded-\\[4px\\]{border-radius:4px}.rounded-\\[8px\\]{border-radius:8px}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:.5rem}.border{border-width:1px}.border-b{border-bottom-width:1px}.\\!border-none{border-style:none!important}.border-\\[\\#d6d8dc\\]{--tw-border-opacity:1;border-color:rgb(214 216 220/var(--tw-border-opacity,1))}.bg-\\[\\#e1e3e5\\]{--tw-bg-opacity:1;background-color:rgb(225 227 229/var(--tw-bg-opacity,1))}.bg-black\\/40{background-color:rgba(0,0,0,.4)}.bg-white{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity,1))}.px-\\[10px\\]{padding-left:10px;padding-right:10px}.px-\\[16px\\]{padding-left:16px;padding-right:16px}.py-\\[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}.pt-\\[4px\\]{padding-top:4px}.text-center{text-align:center}.text-\\[18px\\]{font-size:18px}.text-\\[20px\\]{font-size:20px}.font-bold{font-weight:700}.text-\\[\\#383c43\\]{--tw-text-opacity:1;color:rgb(56 60 67/var(--tw-text-opacity,1))}.text-red-600{--tw-text-opacity:1;color:rgb(220 38 38/var(--tw-text-opacity,1))}.text-white{--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity,1))}.opacity-0{opacity:0}.opacity-100{opacity:1}.shadow{--tw-shadow:0 1px 3px 0 rgba(0,0,0,.1),0 1px 2px -1px rgba(0,0,0,.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color),0 1px 2px -1px var(--tw-shadow-color)}.shadow,.shadow-sm{box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.shadow-sm{--tw-shadow:0 1px 2px 0 rgba(0,0,0,.05);--tw-shadow-colored:0 1px 2px 0 var(--tw-shadow-color)}.outline-none{outline:2px solid transparent;outline-offset:2px}.ring-0{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.blur{--tw-blur:blur(8px);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)}.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)}.delay-200{transition-delay:.2s}.duration-100{transition-duration:.1s}.duration-300{transition-duration:.3s}.duration-700{transition-duration:.7s}.reject-card{background-color:#f7d7d8;border-color:#f2aeb5;color:#58151c}.hover\\:bg-slate-100:hover{--tw-bg-opacity:1;background-color:rgb(241 245 249/var(--tw-bg-opacity,1))}.hover\\:opacity-100:hover{opacity:1}.\\[\\&_div\\]\\:hover\\:\\!opacity-100:hover div{opacity:1!important}.\\[\\&_img\\]\\:hover\\:shadow-lg:hover img{--tw-shadow:0 10px 15px -3px rgba(0,0,0,.1),0 4px 6px -4px rgba(0,0,0,.1);--tw-shadow-colored:0 10px 15px -3px var(--tw-shadow-color),0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.size-\\[40px\\]{height:40px;width:40px}@keyframes spin{to{transform:rotate(1turn)}}.animate-spin-2s{animation:spin 2s linear infinite}";
|
|
13
|
-
const VehicleAccessoriesStyle0 = vehicleAccessoriesCss;
|
|
14
|
-
|
|
15
|
-
let mockData = {};
|
|
16
|
-
const VehicleAccessories = class {
|
|
17
|
-
constructor(hostRef) {
|
|
18
|
-
registerInstance(this, hostRef);
|
|
19
|
-
this.closeImageListener = (event) => {
|
|
20
|
-
this.closeImage(event);
|
|
21
|
-
};
|
|
22
|
-
this.openImage = (target, imageSrc) => {
|
|
23
|
-
openImageViewer(this, target, imageSrc);
|
|
24
|
-
};
|
|
25
|
-
this.closeImage = (event) => {
|
|
26
|
-
closeImageViewer(this, event);
|
|
27
|
-
};
|
|
28
|
-
this.baseUrl = '';
|
|
29
|
-
this.isDev = false;
|
|
30
|
-
this.queryString = '';
|
|
31
|
-
this.loadingStateChange = undefined;
|
|
32
|
-
this.loadedResponse = undefined;
|
|
33
|
-
this.state = 'idle';
|
|
34
|
-
this.externalVin = null;
|
|
35
|
-
this.errorMessage = null;
|
|
36
|
-
this.expandedImage = null;
|
|
37
|
-
this.vehicleInformation = undefined;
|
|
38
|
-
}
|
|
39
|
-
handleSettingData(response) {
|
|
40
|
-
if (!response.accessories || !Array.isArray(response.accessories))
|
|
41
|
-
response.accessories = [];
|
|
42
|
-
this.vehicleInformation = response;
|
|
43
|
-
}
|
|
44
|
-
async setData(newData, headers = {}) {
|
|
45
|
-
clearTimeout(this.networkTimeoutRef);
|
|
46
|
-
if (this.abortController)
|
|
47
|
-
this.abortController.abort();
|
|
48
|
-
this.abortController = new AbortController();
|
|
49
|
-
let scopedTimeoutRef;
|
|
50
|
-
const isVinRequest = typeof newData === 'string';
|
|
51
|
-
const vin = isVinRequest ? newData : newData === null || newData === void 0 ? void 0 : newData.vin;
|
|
52
|
-
this.externalVin = vin;
|
|
53
|
-
try {
|
|
54
|
-
if (!vin || vin.trim().length === 0) {
|
|
55
|
-
this.state = 'idle';
|
|
56
|
-
return;
|
|
57
|
-
}
|
|
58
|
-
if (this.state === 'data' || this.state === 'error') {
|
|
59
|
-
this.state = (this.state + '-loading');
|
|
60
|
-
}
|
|
61
|
-
else
|
|
62
|
-
this.state = 'loading';
|
|
63
|
-
await new Promise(r => {
|
|
64
|
-
scopedTimeoutRef = setTimeout(r, 700);
|
|
65
|
-
this.networkTimeoutRef = scopedTimeoutRef;
|
|
66
|
-
});
|
|
67
|
-
const vehicleResponse = isVinRequest ? await getVehicleInformation(this, { scopedTimeoutRef, vin, mockData }, headers) : newData;
|
|
68
|
-
if (this.networkTimeoutRef === scopedTimeoutRef) {
|
|
69
|
-
if (!vehicleResponse)
|
|
70
|
-
throw new Error('Wrong response format');
|
|
71
|
-
this.handleSettingData(vehicleResponse);
|
|
72
|
-
}
|
|
73
|
-
this.errorMessage = null;
|
|
74
|
-
this.state = 'data';
|
|
75
|
-
}
|
|
76
|
-
catch (error) {
|
|
77
|
-
if (error && (error === null || error === void 0 ? void 0 : error.name) === 'AbortError')
|
|
78
|
-
return;
|
|
79
|
-
this.state = 'error';
|
|
80
|
-
this.vehicleInformation = null;
|
|
81
|
-
this.errorMessage = error.message;
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
async fetchData(requestedVin = this.externalVin, headers = {}) {
|
|
85
|
-
await this.setData(requestedVin, headers);
|
|
86
|
-
}
|
|
87
|
-
async loadingListener() {
|
|
88
|
-
if (this.loadingStateChange)
|
|
89
|
-
this.loadingStateChange(this.state.includes('loading'));
|
|
90
|
-
}
|
|
91
|
-
async setMockData(newMockData) {
|
|
92
|
-
mockData = newMockData;
|
|
93
|
-
}
|
|
94
|
-
render() {
|
|
95
|
-
var _a, _b;
|
|
96
|
-
const accessories = (this === null || this === void 0 ? void 0 : this.vehicleInformation) ? (_a = this.vehicleInformation) === null || _a === void 0 ? void 0 : _a.accessories : [];
|
|
97
|
-
return (h(Host, { key: '7e5394e3dad05815f3a514a342f7afbe11a8d4c1' }, h("div", { key: '1d3fea9972e6827680908bc1becb9be17a4305db', class: "min-h-[100px] relative transition-all duration-300 overflow-hidden" }, h("div", { key: '853e8ff5ad5adf557db5805fc6cc841d7ee224d0' }, h(Loading, { key: '46cdabae84cf49eb88b277bf55b45f233cf28021', isLoading: this.state.includes('loading') }), h("div", { key: '948f2861dcf3e7a8b94f84400a75f681f405122a', class: cn('transition-all duration-700', { 'scale-0': this.state.includes('loading') || this.state === 'idle', 'opacity-0': this.state.includes('loading') }) }, h("div", { key: '2b53f6a05b1beab10a9436435969bfc0bc383cae', 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: '90d5c9e6f1efd3cef3994d2d7ccd6d278d424a76', class: "py-[16px]" }, h("div", { key: '4cd2e9823137e6a7b861fea69f13a6a0343929b2', 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: '9481a97632f581c0b3ebdf0df9086730d10dfdc1', class: "flex mt-[12px] max-h-[70dvh] overflow-hidden rounded-[4px] flex-col border border-[#d6d8dc]" }, h("div", { key: '649fa9917501f66fa2380e3557c5e86ad26d7f89', class: "w-full h-[40px] flex shrink-0 justify-center text-[18px] items-center text-[#383c43] text-center bg-[#e1e3e5]" }, "Vehicle Accessories"), h("div", { key: '262a67208efe49dbb113c7925cf6b6ae835b3f0c', class: "h-0 overflow-auto flex-1" }, !accessories.length && h("div", { key: 'ec443d025b8ca3e50f397ffb1c66e5b280e42f70', class: "h-[80px] flex items-center justify-center text-[18px]" }, "No data is available."), !!accessories.length && (h("table", { key: '48d6e63959a8732972b89ca514b72d5677eb4447', class: "w-full overflow-auto relative border-collapse" }, h("thead", { key: 'b9cdc265accdb543d14bacc09756e2a7ac44e6e8', class: "top-0 font-bold z-40 sticky bg-white" }, h("tr", { key: '2951863ff3d03fa9eab980acd348d2ae352cc1b4' }, ['Part Number', 'Description', 'Image'].map(title => (h("th", { key: title, class: "px-[10px] py-[20px] text-center whitespace-nowrap border-b border-[#d6d8dc]" }, title))))), h("tbody", { key: '7106dfb61229963e59d800f630a0e351be1d680f' }, accessories.map((accessory, idx) => {
|
|
98
|
-
var _a;
|
|
99
|
-
return (h("tr", { class: "transition-colors duration-100 hover:bg-slate-100", key: accessory.partNumber }, ['partNumber', 'description'].map(key => {
|
|
100
|
-
var _a;
|
|
101
|
-
return (h("td", { key: accessory.partNumber + key, class: cn('px-[10px] py-[20px] text-center whitespace-nowrap border-b border-[#d6d8dc]', {
|
|
102
|
-
'!border-none': idx === ((_a = this.vehicleInformation) === null || _a === void 0 ? void 0 : _a.serviceHistory.length) - 1,
|
|
103
|
-
}) }, accessory[key] || '...'));
|
|
104
|
-
}), h("td", { class: cn('px-[10px] py-[10px] text-center whitespace-nowrap border-b border-[#d6d8dc]', {
|
|
105
|
-
'!border-none': idx === ((_a = this.vehicleInformation) === null || _a === void 0 ? void 0 : _a.serviceHistory.length) - 1,
|
|
106
|
-
}) }, h("button", { onClick: ({ target }) => this.openImage(target, accessory.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: eyeSvg }), h("span", { class: "text-white" }, "Expand")), h("img", { class: "w-auto h-auto max-w-[133px] max-h-[133px] cursor-pointer shadow-sm rounded-lg transition-all duration-300", src: accessory.image })))));
|
|
107
|
-
})), h("div", { key: 'a16654412c64f0811caf281bc9a10b4325143f74', onClick: () => this.closeImage(), style: { backdropFilter: this.expandedImage ? 'blur(3px)' : 'blur(0px)' }, class: cn('pointer-events-none w-[100dvw] h-[100dvh] fixed top-0 z-50 left-0 opacity-0 bg-black/40 transition-all duration-400', {
|
|
108
|
-
'pointer-events-auto opacity-100 delay-200': this.expandedImage,
|
|
109
|
-
}) }, h("button", { key: '2a1f6a6de320d464b549be5c8d0955743eab0c1a', class: "flex flex-col mt-[16px] items-center justify-center size-12 float-right mr-[16px]", onClick: () => this.closeImage() }, h("div", { key: '9806406418b9a2588b18a9659a183b494d2dc029', class: "h-1 w-12 rounded-full rotate-45 absolute bg-white" }), h("div", { key: 'e52ccc81db9fad6cde21438bae24ac06ed06d886', class: "h-1 w-12 rounded-full -rotate-45 absolute bg-white" }))), h("img", { key: '9db20d318e852a02ad255e5dc463d5ffd3135eb5', alt: "", id: "expanded-image", class: "fixed opacity-0 z-50 transition-all rounded-lg" })))))))))));
|
|
110
|
-
}
|
|
111
|
-
get el() { return getElement(this); }
|
|
112
|
-
static get watchers() { return {
|
|
113
|
-
"state": ["loadingListener"]
|
|
114
|
-
}; }
|
|
115
|
-
};
|
|
116
|
-
VehicleAccessories.style = VehicleAccessoriesStyle0;
|
|
117
|
-
|
|
118
|
-
export { VehicleAccessories as vehicle_accessories };
|
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Built by ShiftSoftware
|
|
3
|
-
* Copyright (c)
|
|
4
|
-
*/
|
|
5
|
-
import { r as registerInstance, h, H as Host, g as getElement } from './index-ef54644b.js';
|
|
6
|
-
import { L as Loading } from './Loading-61648252.js';
|
|
7
|
-
import { c as cn } from './cn-cc419b94.js';
|
|
8
|
-
import { g as getVehicleInformation } from './vehicleInformation-f7290628.js';
|
|
9
|
-
import './loader-027b88af.js';
|
|
10
|
-
|
|
11
|
-
const vehicleSpecificationCss = "*,: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}.sticky{position:sticky}.top-0{top:0}.mx-auto{margin-left:auto;margin-right:auto}.my-2{margin-bottom:.5rem;margin-top:.5rem}.mt-\\[12px\\]{margin-top:12px}.flex{display:flex}.table{display:table}.h-0{height:0}.h-\\[40px\\]{height:40px}.h-\\[80px\\]{height:80px}.max-h-\\[70dvh\\]{max-height:70dvh}.min-h-\\[100px\\]{min-height:100px}.w-fit{width:fit-content}.w-full{width:100%}.flex-1{flex:1 1 0%}.shrink-0{flex-shrink:0}.border-collapse{border-collapse:collapse}.scale-0{--tw-scale-x:0;--tw-scale-y:0;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.flex-col{flex-direction:column}.items-center{align-items:center}.justify-center{justify-content:center}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.whitespace-nowrap{white-space:nowrap}.rounded-\\[4px\\]{border-radius:4px}.rounded-\\[8px\\]{border-radius:8px}.border{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))}.bg-white{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity,1))}.px-\\[10px\\]{padding-left:10px;padding-right:10px}.px-\\[16px\\]{padding-left:16px;padding-right:16px}.py-4{padding-bottom:1rem;padding-top:1rem}.py-\\[20px\\]{padding-bottom:20px;padding-top:20px}.py-\\[8px\\]{padding-bottom:8px;padding-top:8px}.pt-\\[4px\\]{padding-top:4px}.text-center{text-align:center}.text-\\[18px\\]{font-size:18px}.text-\\[20px\\]{font-size:20px}.font-bold{font-weight:700}.text-\\[\\#383c43\\]{--tw-text-opacity:1;color:rgb(56 60 67/var(--tw-text-opacity,1))}.text-red-600{--tw-text-opacity:1;color:rgb(220 38 38/var(--tw-text-opacity,1))}.opacity-0{opacity:0}.shadow{--tw-shadow:0 1px 3px 0 rgba(0,0,0,.1),0 1px 2px -1px rgba(0,0,0,.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color),0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.transition-all{transition-duration:.15s;transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1)}.duration-300{transition-duration:.3s}.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}";
|
|
12
|
-
const VehicleSpecificationStyle0 = vehicleSpecificationCss;
|
|
13
|
-
|
|
14
|
-
let mockData = {};
|
|
15
|
-
const VehicleSpecification = class {
|
|
16
|
-
constructor(hostRef) {
|
|
17
|
-
registerInstance(this, hostRef);
|
|
18
|
-
this.baseUrl = '';
|
|
19
|
-
this.isDev = false;
|
|
20
|
-
this.queryString = '';
|
|
21
|
-
this.loadingStateChange = undefined;
|
|
22
|
-
this.loadedResponse = undefined;
|
|
23
|
-
this.state = 'idle';
|
|
24
|
-
this.externalVin = null;
|
|
25
|
-
this.errorMessage = null;
|
|
26
|
-
this.vehicleInformation = undefined;
|
|
27
|
-
}
|
|
28
|
-
async setData(newData, headers = {}) {
|
|
29
|
-
clearTimeout(this.networkTimeoutRef);
|
|
30
|
-
if (this.abortController)
|
|
31
|
-
this.abortController.abort();
|
|
32
|
-
this.abortController = new AbortController();
|
|
33
|
-
let scopedTimeoutRef;
|
|
34
|
-
const isVinRequest = typeof newData === 'string';
|
|
35
|
-
const vin = isVinRequest ? newData : newData === null || newData === void 0 ? void 0 : newData.vin;
|
|
36
|
-
this.externalVin = vin;
|
|
37
|
-
try {
|
|
38
|
-
if (!vin || vin.trim().length === 0) {
|
|
39
|
-
this.state = 'idle';
|
|
40
|
-
return;
|
|
41
|
-
}
|
|
42
|
-
if (this.state === 'data' || this.state === 'error') {
|
|
43
|
-
this.state = (this.state + '-loading');
|
|
44
|
-
}
|
|
45
|
-
else
|
|
46
|
-
this.state = 'loading';
|
|
47
|
-
await new Promise(r => {
|
|
48
|
-
scopedTimeoutRef = setTimeout(r, 700);
|
|
49
|
-
this.networkTimeoutRef = scopedTimeoutRef;
|
|
50
|
-
});
|
|
51
|
-
const vehicleResponse = isVinRequest ? await getVehicleInformation(this, { scopedTimeoutRef, vin, mockData }, headers) : newData;
|
|
52
|
-
if (this.networkTimeoutRef === scopedTimeoutRef) {
|
|
53
|
-
if (!vehicleResponse)
|
|
54
|
-
throw new Error('Wrong response format');
|
|
55
|
-
this.vehicleInformation = vehicleResponse;
|
|
56
|
-
}
|
|
57
|
-
this.errorMessage = null;
|
|
58
|
-
this.state = 'data';
|
|
59
|
-
}
|
|
60
|
-
catch (error) {
|
|
61
|
-
if (error && (error === null || error === void 0 ? void 0 : error.name) === 'AbortError')
|
|
62
|
-
return;
|
|
63
|
-
this.state = 'error';
|
|
64
|
-
this.vehicleInformation = null;
|
|
65
|
-
this.errorMessage = error.message;
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
async fetchData(requestedVin = this.externalVin, headers = {}) {
|
|
69
|
-
await this.setData(requestedVin, headers);
|
|
70
|
-
}
|
|
71
|
-
async loadingListener() {
|
|
72
|
-
if (this.loadingStateChange)
|
|
73
|
-
this.loadingStateChange(this.state.includes('loading'));
|
|
74
|
-
}
|
|
75
|
-
async setMockData(newMockData) {
|
|
76
|
-
mockData = newMockData;
|
|
77
|
-
}
|
|
78
|
-
render() {
|
|
79
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
80
|
-
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 => {
|
|
81
|
-
var _a;
|
|
82
|
-
const [place, field] = infoPath.split('.');
|
|
83
|
-
const cellValue = (_a = this === null || this === void 0 ? void 0 : this.vehicleInformation) === null || _a === void 0 ? void 0 : _a[place][field].toString();
|
|
84
|
-
return (h("td", { key: infoPath, class: cn('px-[10px] py-[20px] text-center whitespace-nowrap') }, cellValue.trim() ? cellValue : '...'));
|
|
85
|
-
})))))))))))));
|
|
86
|
-
}
|
|
87
|
-
get el() { return getElement(this); }
|
|
88
|
-
static get watchers() { return {
|
|
89
|
-
"state": ["loadingListener"]
|
|
90
|
-
}; }
|
|
91
|
-
};
|
|
92
|
-
VehicleSpecification.style = VehicleSpecificationStyle0;
|
|
93
|
-
|
|
94
|
-
export { VehicleSpecification as vehicle_specification };
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Built by ShiftSoftware
|
|
3
|
-
* Copyright (c)
|
|
4
|
-
*/
|
|
5
|
-
const vehicleRequestHeaders = {
|
|
6
|
-
cityId: 'City-Id',
|
|
7
|
-
userId: 'User-Id',
|
|
8
|
-
companyId: 'Company-Id',
|
|
9
|
-
customerName: 'Customer-Name',
|
|
10
|
-
customerPhone: 'Customer-Phone',
|
|
11
|
-
customerEmail: 'Customer-Email',
|
|
12
|
-
companyBranchId: 'Company-Branch-Id',
|
|
13
|
-
cityIntegrationId: 'City-Integration-Id',
|
|
14
|
-
brandIntegrationId: 'Brand-Integration-Id',
|
|
15
|
-
companyIntegrationId: 'Company-Integration-Id',
|
|
16
|
-
companyBranchIntegrationId: 'Company-Branch-Integration-Id'
|
|
17
|
-
};
|
|
18
|
-
const getVehicleInformation = async (component, generalProps, headers = {}) => {
|
|
19
|
-
const { notAvailableMessage, mockData, vin, scopedTimeoutRef, middlewareCallback } = generalProps;
|
|
20
|
-
const { isDev, baseUrl, queryString, abortController, networkTimeoutRef, loadedResponse } = component;
|
|
21
|
-
const handleResult = (newVehicleInformation) => {
|
|
22
|
-
if (networkTimeoutRef === scopedTimeoutRef) {
|
|
23
|
-
if (!newVehicleInformation && vin)
|
|
24
|
-
throw new Error(notAvailableMessage || 'Wrong response format');
|
|
25
|
-
if (loadedResponse)
|
|
26
|
-
loadedResponse(newVehicleInformation);
|
|
27
|
-
if (middlewareCallback)
|
|
28
|
-
middlewareCallback(newVehicleInformation);
|
|
29
|
-
return newVehicleInformation;
|
|
30
|
-
}
|
|
31
|
-
};
|
|
32
|
-
if (isDev) {
|
|
33
|
-
const newData = mockData[vin];
|
|
34
|
-
return handleResult(newData);
|
|
35
|
-
}
|
|
36
|
-
else {
|
|
37
|
-
if (!baseUrl)
|
|
38
|
-
throw new Error('Please provide base-url');
|
|
39
|
-
const componentHeaders = Object.assign({}, headers);
|
|
40
|
-
Object.entries(vehicleRequestHeaders).forEach(([componentHeaderKey, headerField]) => {
|
|
41
|
-
if (component[componentHeaderKey])
|
|
42
|
-
componentHeaders[headerField] = component[componentHeaderKey];
|
|
43
|
-
});
|
|
44
|
-
const response = await fetch(`${baseUrl}${vin}?${queryString}`, { signal: abortController.signal, headers: componentHeaders });
|
|
45
|
-
const newData = (await response.json());
|
|
46
|
-
return handleResult(newData);
|
|
47
|
-
}
|
|
48
|
-
};
|
|
49
|
-
|
|
50
|
-
export { getVehicleInformation as g };
|