adp-web-components 0.0.28 → 0.0.30
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{Loading-df2a9144.js → Loading-6f4f0127.js} +1 -1
- package/dist/cjs/dead-stock-lookup.cjs.entry.js +5 -5
- package/dist/cjs/distributor-lookup.cjs.entry.js +5 -5
- package/dist/cjs/dynamic-claim_6.cjs.entry.js +129 -94
- package/dist/cjs/dynamic-redeem.cjs.entry.js +21 -9
- package/dist/cjs/form-input.cjs.entry.js +1 -1
- package/dist/cjs/general-inquiry-form.cjs.entry.js +1 -1
- package/dist/cjs/get-local-language-42973450.js +153 -0
- package/dist/cjs/{index-d2dc29e0.js → index-846c93d2.js} +0 -7
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/manufacturer-lookup.cjs.entry.js +5 -5
- package/dist/cjs/{partInformation-07651204.js → partInformation-2b4e0593.js} +1 -1
- package/dist/cjs/shift-components.cjs.js +2 -2
- package/dist/cjs/vehicle-lookup.cjs.entry.js +6 -5
- package/dist/collection/components/part-lookup/dead-stock-lookup.js +2 -2
- package/dist/collection/components/part-lookup/distributor-lookup.js +2 -2
- package/dist/collection/components/part-lookup/manufacturer-lookup.js +2 -2
- package/dist/collection/components/vehicle-lookup/components/CardsContainer.js +3 -2
- package/dist/collection/components/vehicle-lookup/components/SSCTable.js +3 -2
- package/dist/collection/components/vehicle-lookup/components/StatusCard.js +2 -2
- package/dist/collection/components/vehicle-lookup/dynamic-claim.css +1 -1
- package/dist/collection/components/vehicle-lookup/dynamic-claim.js +53 -13
- package/dist/collection/components/vehicle-lookup/dynamic-redeem.css +1 -1
- package/dist/collection/components/vehicle-lookup/dynamic-redeem.js +49 -10
- package/dist/collection/components/vehicle-lookup/paint-thickness.js +47 -8
- package/dist/collection/components/vehicle-lookup/service-history.js +42 -3
- package/dist/collection/components/vehicle-lookup/vehicle-accessories.js +48 -9
- package/dist/collection/components/vehicle-lookup/vehicle-lookup.js +44 -19
- package/dist/collection/components/vehicle-lookup/vehicle-specification.js +42 -3
- package/dist/collection/components/vehicle-lookup/warranty-details.js +13 -13
- package/dist/collection/global/api/partInformation.js +1 -1
- package/dist/collection/global/api/vehicleInformation.js +2 -2
- package/dist/collection/global/lib/get-local-language.js +19 -0
- package/dist/collection/global/types/locales/error-schema.js +9 -0
- package/dist/collection/global/types/locales/index.js +22 -0
- package/dist/collection/global/types/locales/vehicle-lookup/accessories-schema.js +13 -0
- package/dist/collection/global/types/locales/vehicle-lookup/dynamic-claim-schema.js +21 -0
- package/dist/collection/global/types/locales/vehicle-lookup/dynamic-redeem-schema.js +28 -0
- package/dist/collection/global/types/locales/vehicle-lookup/index.js +21 -0
- package/dist/collection/global/types/locales/vehicle-lookup/paint-thickness-schema.js +14 -0
- package/dist/collection/global/types/locales/vehicle-lookup/service-history-schema.js +15 -0
- package/dist/collection/global/types/locales/vehicle-lookup/specification-schema.js +14 -0
- package/dist/collection/global/types/locales/vehicle-lookup/warranty-schema.js +23 -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/manufacturer-lookup.js +1 -1
- package/dist/components/p-0ae60f32.js +5 -0
- package/dist/components/{p-c2815a66.js → p-1d80419b.js} +1 -1
- package/dist/components/p-1ea3089a.js +5 -0
- package/dist/components/p-2e747eb3.js +5 -0
- package/dist/components/p-4f99745c.js +5 -0
- package/dist/components/{p-c4fad245.js → p-609c2470.js} +1 -1
- package/dist/components/p-6c064413.js +5 -0
- package/dist/components/p-7360f9b1.js +5 -0
- package/dist/components/p-79ea7639.js +5 -0
- package/dist/components/p-a21e2e2e.js +5 -0
- package/dist/components/p-d466b65f.js +5 -0
- package/dist/components/p-eb89583a.js +5 -0
- package/dist/components/p-f691e103.js +5 -0
- package/dist/components/paint-thickness.js +1 -1
- package/dist/components/service-history.js +1 -1
- package/dist/components/vehicle-accessories.js +1 -1
- package/dist/components/vehicle-lookup.js +1 -1
- package/dist/components/vehicle-specification.js +1 -1
- package/dist/components/warranty-details.js +1 -1
- package/dist/esm/{Loading-3a10eb05.js → Loading-f4d666ee.js} +1 -1
- package/dist/esm/dead-stock-lookup.entry.js +5 -5
- package/dist/esm/distributor-lookup.entry.js +5 -5
- package/dist/esm/dynamic-claim_6.entry.js +127 -92
- package/dist/esm/dynamic-redeem.entry.js +21 -9
- package/dist/esm/form-input.entry.js +1 -1
- package/dist/esm/general-inquiry-form.entry.js +1 -1
- package/dist/esm/get-local-language-85ed0b3b.js +150 -0
- package/dist/esm/{index-c3d67367.js → index-33ae6859.js} +1 -7
- package/dist/esm/loader.js +3 -3
- package/dist/esm/manufacturer-lookup.entry.js +5 -5
- package/dist/esm/{partInformation-096a8f55.js → partInformation-f40b1fe6.js} +1 -1
- package/dist/esm/shift-components.js +3 -3
- package/dist/esm/vehicle-lookup.entry.js +6 -5
- package/dist/locales/ar.json +101 -1
- package/dist/locales/en.json +101 -1
- package/dist/locales/ku.json +101 -1
- package/dist/shift-components/p-062cd94b.entry.js +5 -0
- package/dist/shift-components/p-0e0b69a1.entry.js +5 -0
- package/dist/shift-components/p-0f0e54c1.js +6 -0
- package/dist/shift-components/p-1de8531d.entry.js +5 -0
- package/dist/shift-components/p-2e747eb3.js +5 -0
- package/dist/shift-components/{p-02ec4905.entry.js → p-496a721b.entry.js} +1 -1
- package/dist/shift-components/{p-0394e29f.entry.js → p-832fd942.entry.js} +1 -1
- package/dist/shift-components/p-9120c049.entry.js +5 -0
- package/dist/shift-components/{p-89d232e9.js → p-99d314b5.js} +1 -1
- package/dist/shift-components/p-c4efbdc3.js +5 -0
- package/dist/shift-components/p-d49f73db.entry.js +5 -0
- package/dist/shift-components/p-e36c54d0.entry.js +5 -0
- package/dist/shift-components/shift-components.esm.js +1 -1
- package/dist/types/components/vehicle-lookup/components/CardsContainer.d.ts +3 -1
- package/dist/types/components/vehicle-lookup/components/SSCTable.d.ts +3 -1
- package/dist/types/components/vehicle-lookup/components/StatusCard.d.ts +3 -1
- package/dist/types/components/vehicle-lookup/dynamic-claim.d.ts +10 -5
- package/dist/types/components/vehicle-lookup/dynamic-redeem.d.ts +10 -5
- package/dist/types/components/vehicle-lookup/paint-thickness.d.ts +6 -1
- package/dist/types/components/vehicle-lookup/service-history.d.ts +6 -1
- package/dist/types/components/vehicle-lookup/vehicle-accessories.d.ts +6 -1
- package/dist/types/components/vehicle-lookup/vehicle-lookup.d.ts +5 -3
- package/dist/types/components/vehicle-lookup/vehicle-specification.d.ts +6 -1
- package/dist/types/components/vehicle-lookup/warranty-details.d.ts +4 -4
- package/dist/types/components.d.ts +16 -2
- package/dist/types/global/lib/get-local-language.d.ts +2 -0
- package/dist/types/global/types/locales/error-schema.d.ts +7 -0
- package/dist/types/global/types/locales/index.d.ts +220 -0
- package/dist/types/global/types/locales/vehicle-lookup/accessories-schema.d.ts +15 -0
- package/dist/types/global/types/locales/vehicle-lookup/dynamic-claim-schema.d.ts +31 -0
- package/dist/types/global/types/locales/vehicle-lookup/dynamic-redeem-schema.d.ts +45 -0
- package/dist/types/global/types/locales/vehicle-lookup/index.d.ts +189 -0
- package/dist/types/global/types/locales/vehicle-lookup/paint-thickness-schema.d.ts +17 -0
- package/dist/types/global/types/locales/vehicle-lookup/service-history-schema.d.ts +19 -0
- package/dist/types/global/types/locales/vehicle-lookup/specification-schema.d.ts +17 -0
- package/dist/types/global/types/locales/vehicle-lookup/warranty-schema.d.ts +35 -0
- package/package.json +1 -1
- package/dist/collection/global/types/locale-schema.js +0 -30
- package/dist/components/p-0be9e62f.js +0 -5
- package/dist/components/p-0e4c747d.js +0 -5
- package/dist/components/p-4f08bcb8.js +0 -5
- package/dist/components/p-5f03cbe9.js +0 -5
- package/dist/components/p-719499ff.js +0 -5
- package/dist/components/p-7aec104e.js +0 -5
- package/dist/components/p-a3d447f9.js +0 -5
- package/dist/components/p-d07331eb.js +0 -5
- package/dist/components/p-ec05b4cd.js +0 -5
- package/dist/shift-components/p-1265a8ec.entry.js +0 -5
- package/dist/shift-components/p-1f46b4d0.entry.js +0 -5
- package/dist/shift-components/p-4f08bcb8.js +0 -5
- package/dist/shift-components/p-7a17c535.entry.js +0 -5
- package/dist/shift-components/p-9d6b2cfb.entry.js +0 -5
- package/dist/shift-components/p-bf83fa95.entry.js +0 -5
- package/dist/shift-components/p-d0683e92.entry.js +0 -5
- package/dist/shift-components/p-dbaab71c.js +0 -6
- package/dist/types/global/types/locale-schema.d.ts +0 -21
|
@@ -4,6 +4,8 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import { Host, h } from "@stencil/core";
|
|
6
6
|
import cn from "../../global/lib/cn";
|
|
7
|
+
import { getLocaleLanguage } from "../../global/lib/get-local-language";
|
|
8
|
+
import { localeSchema } from "../../global/types/locales/index";
|
|
7
9
|
export class DynamicRedeem {
|
|
8
10
|
constructor() {
|
|
9
11
|
this.closeModal = async () => {
|
|
@@ -38,18 +40,26 @@ export class DynamicRedeem {
|
|
|
38
40
|
};
|
|
39
41
|
this.vin = '';
|
|
40
42
|
this.item = null;
|
|
43
|
+
this.language = 'en';
|
|
41
44
|
this.canceledItems = null;
|
|
42
45
|
this.unInvoicedByBrokerName = null;
|
|
43
46
|
this.handleScanner = undefined;
|
|
44
47
|
this.handleQrChanges = undefined;
|
|
45
|
-
this.
|
|
46
|
-
this.
|
|
48
|
+
this.loadingStateChange = undefined;
|
|
49
|
+
this.locale = localeSchema.getDefault();
|
|
50
|
+
this.isLoading = false;
|
|
47
51
|
this.internalVin = '';
|
|
48
52
|
this.isOpened = false;
|
|
49
53
|
this.internalItem = null;
|
|
54
|
+
this.confirmServiceCancellation = false;
|
|
50
55
|
this.internalCanceledItem = null;
|
|
51
|
-
this.
|
|
52
|
-
|
|
56
|
+
this.confirmUnInvoicedTBPVehicles = false;
|
|
57
|
+
}
|
|
58
|
+
async componentWillLoad() {
|
|
59
|
+
await this.changeLanguage(this.language);
|
|
60
|
+
}
|
|
61
|
+
async changeLanguage(newLanguage) {
|
|
62
|
+
this.locale = await getLocaleLanguage(newLanguage);
|
|
53
63
|
}
|
|
54
64
|
onIsLoadingChange(newValue) {
|
|
55
65
|
if (this.loadingStateChange)
|
|
@@ -113,14 +123,15 @@ export class DynamicRedeem {
|
|
|
113
123
|
}
|
|
114
124
|
render() {
|
|
115
125
|
var _a, _b, _c, _d, _e;
|
|
126
|
+
const texts = this.locale.vehicleLookup.dynamicRedeem;
|
|
116
127
|
const disableInput = !this.confirmServiceCancellation || !this.confirmUnInvoicedTBPVehicles;
|
|
117
128
|
if (!disableInput)
|
|
118
129
|
this.focusInput();
|
|
119
|
-
return (h(Host, { key: '
|
|
130
|
+
return (h(Host, { key: 'ca899101a9c26450da9eb84acfe90b3114ca4231' }, h("div", { key: 'a33432f3509fd5ef9449fbe93f23ddd61a6d211e', dir: this.locale.direction, class: cn('dynamic-claim-processor', (this === null || this === void 0 ? void 0 : this.isOpened) && 'active') }, h("svg", { key: '45e3c9aaf9c589029b2db94c2d031d1d5ae09a0f', id: "dynamic-claim-processor-close-icon", onClick: this.closeModal, viewBox: "-0.5 0 25 25", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, h("g", { key: '3a48e6bad7078bf54b5667d4192827bf3bc9ddcd', id: "SVGRepo_bgCarrier", "stroke-width": "0" }), h("g", { key: '788ff371aceb85e226322cf51cd853050a257289', id: "SVGRepo_tracerCarrier", "stroke-linecap": "round", "stroke-linejoin": "round" }), h("g", { key: '0da1a53cbb4f609d5429fd9137ec558dcab153d4', id: "SVGRepo_iconCarrier" }, h("path", { key: '10396b01c5539a7483b289821580bb7745d6fdb8', d: "M3 21.32L21 3.32001", stroke: "#000000", "stroke-width": "1.5", "stroke-linecap": "round", "stroke-linejoin": "round" }), h("path", { key: 'd73959366cef77e85ccf49216694ef5b27cddaa5', d: "M3 3.32001L21 21.32", stroke: "#000000", "stroke-width": "1.5", "stroke-linecap": "round", "stroke-linejoin": "round" }))), h("div", { key: 'e8db86988b6cc6710b31aba19773fcea9da28ec9', class: "dynamic-claim-processor-wrapper" }, h("div", { key: '82173bff656657c1677fe929715b0f8e9f2f857e', class: "dynamic-claim-processor-info-box" }, h("div", { key: '59934f9a2f741fc1510cd01224a28f40c6a05fd3', class: "dynamic-claim-processor-info-box-header" }, h("strong", { key: '64e9771e906e66c257b8306a7c47285a7c844960', class: "dynamic-claim-header-vin" }, this === null || this === void 0 ? void 0 : this.internalVin)), h("div", { key: '1bc32deaab3847d8df2bf0e113e5d9321a9f835d', class: "dynamic-claim-processor-info-box-body" }, h("table", { key: '0b56a7503ed3a606b6eb23f95ae62816a0080907', class: "border-separate" }, h("tr", { key: '28f08134af987b8ae5418cb9fd6b6fba0caecd36' }, h("th", { key: '9edb864c1ef54e4a4419e9f44e6fce4075c9dc36' }, texts.serviceType), h("td", { key: 'ea4a2a24f61ab833b81c1e6ce45a05cd19bc9e1b' }, (_a = this === null || this === void 0 ? void 0 : this.internalItem) === null || _a === void 0 ? void 0 : _a.type), h("th", { key: 'a893fb313b6d3f0eb8e975007b7721f6a52920f9' }, texts.name), h("td", { key: '10af8d9ec964866400645349a94f5d40d1f3d525' }, (_b = this === null || this === void 0 ? void 0 : this.internalItem) === null || _b === void 0 ? void 0 : _b.name)), h("tr", { key: '10efd3c9c8f8ebb71f12f8cc086aee5850c8eaad' }, h("th", { key: 'fbea772cc1ff6924c2e13fededaf8479eeacf938' }, texts.activationDate), h("td", { key: '6eadf045b3c6cc384e29e4c21a17e27b48d19f83' }, (_c = this === null || this === void 0 ? void 0 : this.internalItem) === null || _c === void 0 ? void 0 : _c.activatedAt), h("th", { key: 'f38c16928cb337f2adb8119d13bb2b2f725c8235' }, texts.expireDate), h("td", { key: '04d214b1f4cc5f1d22976292743ade4de3796ac9' }, (_d = this === null || this === void 0 ? void 0 : this.internalItem) === null || _d === void 0 ? void 0 : _d.expiresAt)), h("tr", { key: '938f2eaa651c12b69803546d4534155d81c97da7' }, h("th", { key: 'd3c5a821fdf2a0bc291f0f005eca0b58777f8dac' }, texts.menuCode), h("td", { key: '3de2547f3d28c901c64a63ecf8ee541efabe59a2' }, (_e = this === null || this === void 0 ? void 0 : this.internalItem) === null || _e === void 0 ? void 0 : _e.menuCode))))), h("div", { key: 'bd2990561d7e1ad281d2c14bad7edb0bfa3a158e', style: { flex: '1', width: '100%', display: 'flex', flexDirection: 'column', justifyContent: 'space-evenly' } }, (this === null || this === void 0 ? void 0 : this.internalCanceledItem) && Array.isArray(this.internalCanceledItem) && !!this.internalCanceledItem.length && (h("div", { key: '69c251119797182331bedb511d7ce505ef730440', class: "admonition warning" }, h("p", { key: '68d9ea5d07d3de1d680e59338da725be62ad8b59', class: "admonition-title" }, texts.warning), h("div", { key: 'c15d908ea237cb8b9af8d0b1b931a39caa870097', style: { padding: '0 30px' } }, h("p", { key: '2fc875649be681ac73ce08df73d164d0c82e071c', class: "my-4" }, texts.skipServicesWarning), h("ul", { key: '8ae88d36ce35e36b0875bb05470a5552c3d6d211', class: "dynamic-claim-processor-to-be-cancelled-list warning-ul my-4 list-disc" }, this.internalCanceledItem.map(({ name }) => (h("li", { id: name }, name)))), h("div", { key: 'f62f9d6234d364e92590710b1166b0534b811c47', class: "cancel-confirmation-box" }, h("label", { key: '685032c42428dc2e4e43b3afccde7a4a192d4de6' }, h("input", { key: '73c84800ef65e6c4fd8cac4a7b5497d32742a805', type: "checkbox", class: "confirm-cancellation-input m-[3px] ml-1", onChange: () => {
|
|
120
131
|
this.confirmServiceCancellation = !this.confirmServiceCancellation;
|
|
121
|
-
} }),
|
|
132
|
+
} }), texts.confirmSkipServices))))), true && this.unInvoicedByBrokerName && (h("div", { key: '3e606c5d3d9aa9a9f1e94dc49d1cdaadea8c4676', class: "admonition warning" }, h("p", { key: 'f8691d691a2a7bd45e49ccfef3a03c42ff0b5f4d', class: "admonition-title" }, texts.warning), h("div", { key: '4dd487f09a0f5047d035c258479a0f9cc8fbb166', style: { padding: '0 30px' } }, h("p", { key: 'e7898c98ab73dd532364c62c4c7c10ca1a4b9079', class: "my-4" }, texts.notInvoiced), h("div", { key: '4db96f227355163dc8380a06f7264c06b7410379' }, h("strong", { key: 'acf1bcf8096eceeda7691b2813a2f0ae8f2e71e0' }, this.unInvoicedByBrokerName)), h("div", { key: 'cd56d2feecf74a3417ea7585632d0ad2d8ff22f6', class: "cancel-confirmation-box" }, h("label", { key: '8793465d1df55623853f7c62c53e7f79303bf031' }, h("input", { key: '0169c6a108ac54959ab67e83451766659410bc34', type: "checkbox", class: "confirm-cancellation-input m-[3px] ml-1", onChange: () => {
|
|
122
133
|
this.confirmUnInvoicedTBPVehicles = !this.confirmUnInvoicedTBPVehicles;
|
|
123
|
-
} }),
|
|
134
|
+
} }), texts.confirmNotInvoiced))))), h("div", { key: 'b74163dfd1bfada8535f135985d8ce0c9f154670', class: cn('dynamic-claim-processor-progress', (!this.confirmServiceCancellation || !this.confirmUnInvoicedTBPVehicles) && 'disabled') }, h("div", { key: '34f790b72367dc01f3ffd27ab942f8047fcdf3cf', id: "scan-invoice-step", class: cn('dynamic-claim-processor-progress-step', this.isLoading && 'processing') }, h("div", { key: '446982f39168194a9a56fc86c7c7dd839c667e94', style: { position: 'relative', width: '130px', height: '130px', display: 'block', margin: 'auto', marginTop: '15px' } }, h("div", { key: '8c28eafc04adb0c3943dd736f652ea159658367c', style: { position: 'absolute' }, class: "scan-invoice-wrapper flex flex-col gap-1 justify-center items-center" }, h("svg", { key: 'a7a98fc85906a57c709da365fc4efd9f982282f4', fill: "#3071a9", height: "100px", width: "100px", version: "1.1", id: "Layer_1", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 512 512", stroke: "#ffffff" }, h("g", { key: 'f9cbfec564f6682f34a689425f227bec41e082b7', id: "SVGRepo_bgCarrier", "stroke-width": "0" }), h("g", { key: '66c0e1bdafaf1eb0247a30ac1f3a7109f47a168b', id: "SVGRepo_tracerCarrier", "stroke-linecap": "round", "stroke-linejoin": "round" }), h("g", { key: '6cc2cc96df5207295619dc1307c2de966a48b59d', id: "SVGRepo_iconCarrier" }, h("g", { key: 'afedc5c6465fcff9f48345291bfb4318a905c013' }, h("g", { key: 'c34bdf5648f76b07e87444cb641a574868c9a327' }, h("path", { key: '4c884464ed129d08e9e55e310f95c02c14e3f6b9', d: "M354.338,34.205h-61.71c-3.354-9.93-12.752-17.102-23.8-17.102h-17.547C243.359,6.451,230.813,0,217.521,0 s-25.839,6.451-33.76,17.102h-17.547c-11.048,0-20.446,7.172-23.8,17.102H80.701c-18.566,0-33.67,15.105-33.67,33.67v359.148 c0,18.566,15.105,33.67,33.67,33.67h171.023c4.427,0,8.017-3.589,8.017-8.017c0-4.427-3.589-8.017-8.017-8.017H80.701 c-9.725,0-17.637-7.912-17.637-17.637V67.875c0-9.725,7.912-17.637,17.637-17.637h60.394v26.188c0,4.427,3.589,8.017,8.017,8.017 H285.93c4.427,0,8.017-3.589,8.017-8.017V50.238h60.391c9.725,0,17.637,7.912,17.637,17.637v230.881 c0,4.427,3.589,8.017,8.017,8.017c4.427,0,8.017-3.589,8.017-8.017V67.875C388.008,49.309,372.904,34.205,354.338,34.205z M277.914,68.409H157.129V42.252c0-0.011,0.001-0.02,0.001-0.031c0-0.005-0.001-0.011-0.001-0.015 c0.009-5.004,4.08-9.071,9.085-9.071h21.846c2.854,0,5.493-1.517,6.929-3.985c4.781-8.213,13.204-13.117,22.532-13.117 s17.751,4.904,22.532,13.117c1.435,2.467,4.075,3.985,6.929,3.985h21.846c4.999,0,9.067,4.059,9.085,9.055 c0,0.011-0.001,0.02-0.001,0.031c0,0.021,0.003,0.041,0.003,0.062V68.409z" }))), h("g", { key: '12afe6335adfb0c2dad77db92f2235678d704543' }, h("g", { key: 'b58403cdd31ef10bfc134ff0c471502c59c16f7b' }, h("path", { key: 'e7eb94f117455903c6ab931567ceeca44ba10256', d: "M251.722,410.455H97.269V84.443h17.64c4.427,0,8.017-3.589,8.017-8.017s-3.589-8.017-8.017-8.017H89.253 c-4.427,0-8.017,3.589-8.017,8.017v342.046c0,4.427,3.589,8.017,8.017,8.017h162.47c4.427,0,8.017-3.589,8.017-8.017 C259.739,414.044,256.15,410.455,251.722,410.455z" }))), h("g", { key: 'a977c62ea68b6373769c026855dc8a4da84e22a6' }, h("g", { key: '878b1c3a4f90504bb964dc03619afeaaf2e820b6' }, h("path", { key: '3efb5a597236dfcb70a972f90ff93d7ac04b9a0b', d: "M345.787,68.409h-25.653c-4.427,0-8.017,3.589-8.017,8.017s3.589,8.017,8.017,8.017h17.637v214.311 c0,4.427,3.589,8.017,8.017,8.017s8.017-3.589,8.017-8.017V76.426C353.804,71.999,350.214,68.409,345.787,68.409z" }))), h("g", { key: '9a246407a23df8cae8a2fc02c4ca8af51746316a' }, h("g", { key: '6b3d0d3fb1d41281f8581495539d471787124267' }, h("path", { key: 'b0f52f41515292bb3923575ee0ba46570ce9d9a8', d: "M371.44,324.944c-51.572,0-93.528,41.956-93.528,93.528S319.869,512,371.44,512s93.528-41.956,93.528-93.528 S423.012,324.944,371.44,324.944z M371.44,495.967c-42.731,0-77.495-34.764-77.495-77.495s34.764-77.495,77.495-77.495 s77.495,34.764,77.495,77.495S414.172,495.967,371.44,495.967z" }))), h("g", { key: '8a5d953c8e749662709eb677cd5726d77e642212' }, h("g", { key: '0984d6f1879e798d3d206403bb6fef1bb0a2d516' }, h("path", { key: 'ba9e7188d3af075911a380b90b7151747aa223c3', d: "M217.607,34.205h-0.086c-4.427,0-7.974,3.589-7.974,8.017c0,4.427,3.631,8.017,8.059,8.017 c4.427,0,8.017-3.589,8.017-8.017C225.624,37.794,222.035,34.205,217.607,34.205z" }))), h("g", { key: 'd63b7f69c9408edfb813207090bc48fe2f68077b' }, h("g", { key: '389d0485fb4b6258c5ea865eb3a1802761fca983' }, h("path", { key: '89c4dac4cb4af126f2280b3259eff28b0f4d608c', d: "M419.865,387.15c-3.13-3.131-8.207-3.131-11.337,0l-54.19,54.19l-28.536-28.536c-3.131-3.131-8.207-3.131-11.337,0 c-3.131,3.131-3.131,8.207,0,11.337l34.205,34.205c1.565,1.565,3.617,2.348,5.668,2.348s4.103-0.782,5.668-2.348l59.858-59.858 C422.995,395.356,422.995,390.28,419.865,387.15z" }))), h("g", { key: '6a4c35796ca14efb4df7b6646926037bc7d6caff' }, h("g", { key: '8ee77bef21eda33760f726d9f9e0a50539c42de5' }, h("path", { key: 'e0efd338df732f3bda6e1e7eaf8e507dddea8666', d: "M182.781,177.309v-32.338c11.295,1.934,18.171,7.688,18.171,11.889c0,4.427,3.589,8.017,8.017,8.017 s8.017-3.589,8.017-8.017c0-14.171-14.492-25.621-34.205-28.092v-1.036c0-4.427-3.589-8.017-8.017-8.017s-8.017,3.589-8.017,8.017 v1.036c-19.713,2.47-34.205,13.92-34.205,28.092c0,20.074,18.829,27.788,34.205,32.461v32.338 c-11.295-1.934-18.171-7.688-18.171-11.889c0-4.427-3.589-8.017-8.017-8.017s-8.017,3.589-8.017,8.017 c0,14.171,14.492,25.621,34.205,28.092v1.036c0,4.427,3.589,8.017,8.017,8.017s8.017-3.589,8.017-8.017v-1.036 c19.713-2.47,34.205-13.92,34.205-28.092C216.985,189.697,198.157,181.982,182.781,177.309z M166.747,172.411 c-13.524-4.713-18.171-8.963-18.171-15.551c0-2.535,2.236-5.335,6.134-7.68c3.294-1.982,7.473-3.415,12.037-4.198V172.411z M194.818,217.45c-3.294,1.982-7.473,3.415-12.037,4.198v-27.429c13.524,4.713,18.171,8.963,18.171,15.551 C200.952,212.306,198.716,215.105,194.818,217.45z" }))), h("g", { key: 'f2c63ce29a370df79d4b3d3423fc4a19e81aa453' }, h("g", { key: '4d94d8d7967fb496b9dd5c6357a03878b0730ea7' }, h("path", { key: 'a1bff2a143f0d83e7d49c86304b9a9da92339bae', d: "M294.48,136.818h-42.756c-4.427,0-8.017,3.589-8.017,8.017s3.589,8.017,8.017,8.017h42.756 c4.427,0,8.017-3.589,8.017-8.017S298.908,136.818,294.48,136.818z" }))), h("g", { key: '41a0726c0a5734b0346cb4b267e22f208f657ded' }, h("g", { key: '25e2d3dc14c4fd8f9a3358b56b97811474d001b0' }, h("path", { key: 'b23c5bd17211aa10253e2d6d228d3ea15c9450e6', d: "M277.378,171.023h-25.653c-4.427,0-8.017,3.589-8.017,8.017s3.589,8.017,8.017,8.017h25.653 c4.427,0,8.017-3.589,8.017-8.017S281.805,171.023,277.378,171.023z" }))), h("g", { key: 'faa32b63b35ad414b233471242c4ef789dded9fe' }, h("g", { key: '6a375b4b3abe3220e7380de5007f850b87e288ab' }, h("path", { key: '7226e245625c1789c03273f668c7afb13d20da83', d: "M294.48,205.228h-42.756c-4.427,0-8.017,3.589-8.017,8.017s3.589,8.017,8.017,8.017h42.756 c4.427,0,8.017-3.589,8.017-8.017S298.908,205.228,294.48,205.228z" }))), h("g", { key: '2e7d78e5086c0083b70e62a6cee9f1a6d6f32fcb' }, h("g", { key: '63d91f0be2f5a2f55dfb12c731d1e8784952833d' }, h("path", { key: '1f62c9709e80ffb4d0a278a5651bc10a60ac4c88', d: "M157.662,282.188H140.56c-4.427,0-8.017,3.589-8.017,8.017s3.589,8.017,8.017,8.017h17.102 c4.427,0,8.017-3.589,8.017-8.017S162.089,282.188,157.662,282.188z" }))), h("g", { key: '5330cbb034f3ca8bcb302e649b93e738d76936bf' }, h("g", { key: 'cff3ef6ac4db629e307bf210cf54f9f3a95078ae' }, h("path", { key: '9e504732e603a0c59ac84056b557c48df14762e1', d: "M157.662,350.597H140.56c-4.427,0-8.017,3.589-8.017,8.017s3.589,8.017,8.017,8.017h17.102 c4.427,0,8.017-3.589,8.017-8.017S162.089,350.597,157.662,350.597z" }))), h("g", { key: '86cb33c866ae14433e8277a8b02f57f547cd643c' }, h("g", { key: '02a5acc2f1c654d58ebee448eaf7d4155742abd2' }, h("path", { key: 'c4769f5ce4a90902f73b1658d1143ab42a423c00', d: "M157.662,316.393H140.56c-4.427,0-8.017,3.589-8.017,8.017s3.589,8.017,8.017,8.017h17.102 c4.427,0,8.017-3.589,8.017-8.017S162.089,316.393,157.662,316.393z" }))), h("g", { key: '02ef9cc91ceda2cf4bc370596c4baf25efa6eb60' }, h("g", { key: '3539387cbe4e0d8f16e1ebccabeaa1b087529bad' }, h("path", { key: 'd7dcd551530535db686cbd0563a34380b1f9aa36', d: "M294.48,282.188H191.866c-4.427,0-8.017,3.589-8.017,8.017s3.589,8.017,8.017,8.017H294.48 c4.427,0,8.017-3.589,8.017-8.017S298.908,282.188,294.48,282.188z" }))), h("g", { key: '8595194f3aaac4dac51f03380afab164f389187d' }, h("g", { key: '3a1215fdd0b0bfde4c2bbe6099ade455cf2bed51' }, h("path", { key: 'a6c2598415826e0561aab2ef14e9aa13d035025c', d: "M268.827,350.597h-76.96c-4.427,0-8.017,3.589-8.017,8.017s3.589,8.017,8.017,8.017h76.96 c4.427,0,8.017-3.589,8.017-8.017S273.254,350.597,268.827,350.597z" }))), h("g", { key: 'a7bb2dbcfaf106eec747f247e6d79773ef3f3e7a' }, h("g", { key: '24baa3a1ae8c998f7ab69de766c48c9e4dc97b24' }, h("path", { key: '5e10dde8ce3c657410c7eed8d5f476f86ee47283', d: "M294.48,316.393H191.866c-4.427,0-8.017,3.589-8.017,8.017s3.589,8.017,8.017,8.017H294.48 c4.427,0,8.017-3.589,8.017-8.017S298.908,316.393,294.48,316.393z" }))))), h("div", { key: 'd5a81966d94c2d03fc6fa5874588b23222d488d0' }, texts.scanTheInvoice)), h("div", { key: 'a199ee75b32f576b2bf0b1bebbdf58912299ddb9', style: { position: 'absolute' }, class: "loading-wrapper" }, h("div", { key: '3b19f6f053d4d67f1f49602f8dbc44e544d283da', class: cn('lds-ripple', this.isLoading && 'active') }, h("div", { key: 'a8a9ee0e218a4850a78050bda6da143d3b899602' }), h("div", { key: '588365dbd0343f057bf44582f820ef2c44a89980' })), h("div", { key: '0fef4546cb43dbcdb356a0cdc7971bf38700a398', class: cn('lds-ripple-loading', this.isLoading && 'active') }, texts.processing))), h("input", { key: '421147f0eb93612d7f56a3c9c9f0b62756e3c291', dir: "ltr", class: "qr-input", spellcheck: "false", onInput: this.onValueChanges, onKeyDown: this.qrCodeKeyDown, onBlur: () => this.input.focus(), autocomplete: "off", disabled: disableInput, placeholder: "", autofocus: true, style: { marginTop: '20px', padding: '10px 0px', fontSize: '16px' } }))))))));
|
|
124
135
|
}
|
|
125
136
|
static get is() { return "dynamic-redeem"; }
|
|
126
137
|
static get encapsulation() { return "shadow"; }
|
|
@@ -176,6 +187,30 @@ export class DynamicRedeem {
|
|
|
176
187
|
},
|
|
177
188
|
"defaultValue": "null"
|
|
178
189
|
},
|
|
190
|
+
"language": {
|
|
191
|
+
"type": "string",
|
|
192
|
+
"mutable": false,
|
|
193
|
+
"complexType": {
|
|
194
|
+
"original": "LanguageKeys",
|
|
195
|
+
"resolved": "\"ar\" | \"en\" | \"ku\"",
|
|
196
|
+
"references": {
|
|
197
|
+
"LanguageKeys": {
|
|
198
|
+
"location": "import",
|
|
199
|
+
"path": "~types/locales",
|
|
200
|
+
"id": "src/global/types/locales/index.ts::LanguageKeys"
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
},
|
|
204
|
+
"required": false,
|
|
205
|
+
"optional": false,
|
|
206
|
+
"docs": {
|
|
207
|
+
"tags": [],
|
|
208
|
+
"text": ""
|
|
209
|
+
},
|
|
210
|
+
"attribute": "language",
|
|
211
|
+
"reflect": false,
|
|
212
|
+
"defaultValue": "'en'"
|
|
213
|
+
},
|
|
179
214
|
"canceledItems": {
|
|
180
215
|
"type": "unknown",
|
|
181
216
|
"mutable": false,
|
|
@@ -265,13 +300,14 @@ export class DynamicRedeem {
|
|
|
265
300
|
}
|
|
266
301
|
static get states() {
|
|
267
302
|
return {
|
|
268
|
-
"
|
|
269
|
-
"
|
|
303
|
+
"locale": {},
|
|
304
|
+
"isLoading": {},
|
|
270
305
|
"internalVin": {},
|
|
271
306
|
"isOpened": {},
|
|
272
307
|
"internalItem": {},
|
|
308
|
+
"confirmServiceCancellation": {},
|
|
273
309
|
"internalCanceledItem": {},
|
|
274
|
-
"
|
|
310
|
+
"confirmUnInvoicedTBPVehicles": {}
|
|
275
311
|
};
|
|
276
312
|
}
|
|
277
313
|
static get methods() {
|
|
@@ -315,6 +351,9 @@ export class DynamicRedeem {
|
|
|
315
351
|
static get elementRef() { return "el"; }
|
|
316
352
|
static get watchers() {
|
|
317
353
|
return [{
|
|
354
|
+
"propName": "language",
|
|
355
|
+
"methodName": "changeLanguage"
|
|
356
|
+
}, {
|
|
318
357
|
"propName": "isLoading",
|
|
319
358
|
"methodName": "onIsLoadingChange"
|
|
320
359
|
}, {
|
|
@@ -3,10 +3,12 @@
|
|
|
3
3
|
* Copyright (c)
|
|
4
4
|
*/
|
|
5
5
|
import { Host, h } from "@stencil/core";
|
|
6
|
-
import
|
|
6
|
+
import cn from "../../global/lib/cn";
|
|
7
|
+
import { getLocaleLanguage } from "../../global/lib/get-local-language";
|
|
7
8
|
import { getVehicleInformation } from "../../global/api/vehicleInformation";
|
|
9
|
+
import { localeSchema } from "../../global/types/locales/index";
|
|
8
10
|
import Eye from "~assets/eye.svg";
|
|
9
|
-
import
|
|
11
|
+
import Loading from "../components/Loading";
|
|
10
12
|
import { closeImageViewer, openImageViewer } from "../../global/lib/image-expansion";
|
|
11
13
|
let mockData = {};
|
|
12
14
|
export class PaintThickness {
|
|
@@ -23,14 +25,22 @@ export class PaintThickness {
|
|
|
23
25
|
this.baseUrl = '';
|
|
24
26
|
this.isDev = false;
|
|
25
27
|
this.queryString = '';
|
|
28
|
+
this.language = 'en';
|
|
26
29
|
this.loadingStateChange = undefined;
|
|
27
30
|
this.loadedResponse = undefined;
|
|
31
|
+
this.locale = localeSchema.getDefault();
|
|
28
32
|
this.state = 'idle';
|
|
29
33
|
this.externalVin = null;
|
|
30
|
-
this.errorMessage = null;
|
|
31
34
|
this.expandedImage = null;
|
|
35
|
+
this.errorMessage = null;
|
|
32
36
|
this.vehicleInformation = undefined;
|
|
33
37
|
}
|
|
38
|
+
async componentWillLoad() {
|
|
39
|
+
await this.changeLanguage(this.language);
|
|
40
|
+
}
|
|
41
|
+
async changeLanguage(newLanguage) {
|
|
42
|
+
this.locale = await getLocaleLanguage(newLanguage);
|
|
43
|
+
}
|
|
34
44
|
handleSettingData(response) {
|
|
35
45
|
if (!response.paintThickness)
|
|
36
46
|
response.paintThickness = { imageGroups: [], parts: [] };
|
|
@@ -66,7 +76,7 @@ export class PaintThickness {
|
|
|
66
76
|
const vehicleResponse = isVinRequest ? await getVehicleInformation(this, { scopedTimeoutRef, vin, mockData }, headers) : newData;
|
|
67
77
|
if (this.networkTimeoutRef === scopedTimeoutRef) {
|
|
68
78
|
if (!vehicleResponse)
|
|
69
|
-
throw new Error('
|
|
79
|
+
throw new Error('wrongResponseFormat');
|
|
70
80
|
this.handleSettingData(vehicleResponse);
|
|
71
81
|
}
|
|
72
82
|
this.errorMessage = null;
|
|
@@ -92,12 +102,13 @@ export class PaintThickness {
|
|
|
92
102
|
}
|
|
93
103
|
render() {
|
|
94
104
|
var _a, _b;
|
|
105
|
+
const texts = this.locale.vehicleLookup.paintThickness;
|
|
95
106
|
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: [] };
|
|
96
|
-
return (h(Host, { key: '
|
|
107
|
+
return (h(Host, { key: 'c016cef77b893442d0d33c4f9b986ee9d704a047' }, h("div", { key: 'db3b0f02c3423e0483a5000fa52fcd02e106f417', class: "min-h-[100px] relative transition-all duration-300 overflow-hidden" }, h("div", { key: '04f5488431c759be5a01e6bbe1d58a62b291e8f2' }, h(Loading, { key: '5b8a290c885e7a32f110522806f0e76545db3400', isLoading: this.state.includes('loading') }), h("div", { key: '3304d8d438eb74c7b1b0c3ce0ab6f42870dad451', class: cn('transition-all duration-700', { 'scale-0': this.state.includes('loading') || this.state === 'idle', 'opacity-0': this.state.includes('loading') }) }, h("div", { key: 'c7b7b7ff56602b4dc86433e351e3b398bdc49b54', 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: 'aa565320287a2659040766032456e53b9108fddf', class: "py-[16px]" }, h("div", { key: 'e99991f62d92c8c80e2622189b481e09390a4836', class: " px-[16px] py-[8px] border reject-card text-[20px] rounded-[8px] w-fit mx-auto" }, this.locale.errors[this.errorMessage] || this.errorMessage))), ['data', 'data-loading'].includes(this.state) && (h("div", { key: '06ddc28439757b99a2e66603a08085bfebab2887', class: "flex mt-[12px] w-full max-h-[70dvh] overflow-hidden mx-auto rounded-[4px] flex-col border border-[#d6d8dc]" }, h("div", { key: '0191a58f1fed172f13a0c1448b0e5045f2898a2e', class: "w-full h-[40px] flex shrink-0 justify-center text-[18px] items-center text-[#383c43] text-center bg-[#e1e3e5]" }, texts.paintThickness), h("div", { key: '4ac786cbfec1df9c3a034f329ce5baa1591b124b', class: "h-0 overflow-auto flex-1" }, !parts.length && h("div", { key: '46261e7f73e45ccdcfee8af1e621cd4e4f405e79', class: "h-[50px] px-[30px] flex items-center justify-center text-[18px]" }, texts.noData), !!parts.length && (h("table", { key: 'eb30840419f8daa59aeb72190640eaadbca7f9ad', class: "w-full overflow-auto relative border-collapse" }, h("thead", { key: 'e94bfe40d27f90307fbe2303d10be468515dc0a4', class: "top-0 font-bold sticky bg-white" }, h("tr", { key: '3c51cc746f226512120e40711a0109924b3b518a' }, ['part', 'left', 'right'].map(title => (h("th", { key: title, class: "px-[15px] min-w-[100px] py-[15px] text-center whitespace-nowrap border-b border-[#d6d8dc]" }, texts[title]))))), h("tbody", { key: '9634a5a5ded1cb2ffb8488e7f36408708ee20431' }, 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]', {
|
|
97
108
|
'!border-none': idx === parts.length - 1,
|
|
98
|
-
}) }, part[key] || '...')))))))))))), ['data', 'data-loading'].includes(this.state) && (h("div", { key: '
|
|
109
|
+
}) }, part[key] || '...')))))))))))), ['data', 'data-loading'].includes(this.state) && (h("div", { key: 'd25a655f2d5f146cb84f42afea7c8d5c83e93403' }, !imageGroups.length && h("div", { key: '1541923dd14aa6f454b7213e17454880ec2903f9', class: "h-[40px] px-[30px] flex text-red-500 items-center justify-center text-[18px]" }, texts.noImageGroups), !!imageGroups.length && (h("div", { key: 'dd8785fb8af9453816c756ee253adc3f2ed273ff', class: "py-[16px] gap-[16px] justify-center flex flex-wrap px-[24px] w-full" }, imageGroups.map(imageGroup => (h("div", { class: "shrink-0 rounded-lg shadow-sm border overflow-hidden flex flex-col", key: imageGroup.name }, h("h1", { class: "text-center border-b bg-slate-200 font-semibold p-[6px]" }, imageGroup.name), h("div", { class: "flex p-[12px] gap-[8px]" }, imageGroup.images.map(image => (h("div", { class: "flex gap-[8px]", key: image }, h("button", { onClick: ({ target }) => this.openImage(target, image), class: "shrink-0 relative ring-0 outline-none w-fit mx-auto [&_img]:hover:shadow-lg [&_div]:hover:!opacity-100 cursor-pointer" }, h("div", { class: "absolute flex-col justify-center gap-[4px] size-full flex items-center pointer-events-none hover:opacity-100 rounded-lg opacity-0 bg-black/40 transition-all duration-300" }, h("img", { src: Eye }), h("span", { class: "text-white" }, texts.expand)), h("img", { class: "w-auto h-[150px] cursor-pointer shadow-sm rounded-lg transition-all duration-300", src: image }))))))))), h("div", { key: 'a6d5c4181ee71b5f8e33e45b5f0c701dbc3ea24b', 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', {
|
|
99
110
|
'pointer-events-auto opacity-100 delay-200': this.expandedImage,
|
|
100
|
-
}) }, h("button", { key: '
|
|
111
|
+
}) }, h("button", { key: 'e970d607cba3e4032063c3bf2b7ba69c2b21c4a4', class: "flex flex-col mt-[16px] items-center justify-center size-12 float-right mr-[16px]", onClick: () => this.closeImage() }, h("div", { key: 'e1ca12957a925aac35f8ce4180e155a72a3a5880', class: "h-1 w-12 rounded-full rotate-45 absolute bg-white" }), h("div", { key: '194f919ae1ac66550b9feb51c2d3a5bc968bb5b2', class: "h-1 w-12 rounded-full -rotate-45 absolute bg-white" }))), h("img", { key: '896ddba224ccf4f06ffc70ff13eb17eaa720330a', alt: "", id: "expanded-image", class: "fixed opacity-0 z-40 transition-all rounded-lg" }))))))))));
|
|
101
112
|
}
|
|
102
113
|
static get is() { return "paint-thickness"; }
|
|
103
114
|
static get encapsulation() { return "shadow"; }
|
|
@@ -167,6 +178,30 @@ export class PaintThickness {
|
|
|
167
178
|
"reflect": false,
|
|
168
179
|
"defaultValue": "''"
|
|
169
180
|
},
|
|
181
|
+
"language": {
|
|
182
|
+
"type": "string",
|
|
183
|
+
"mutable": false,
|
|
184
|
+
"complexType": {
|
|
185
|
+
"original": "LanguageKeys",
|
|
186
|
+
"resolved": "\"ar\" | \"en\" | \"ku\"",
|
|
187
|
+
"references": {
|
|
188
|
+
"LanguageKeys": {
|
|
189
|
+
"location": "import",
|
|
190
|
+
"path": "~types/locales",
|
|
191
|
+
"id": "src/global/types/locales/index.ts::LanguageKeys"
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
},
|
|
195
|
+
"required": false,
|
|
196
|
+
"optional": false,
|
|
197
|
+
"docs": {
|
|
198
|
+
"tags": [],
|
|
199
|
+
"text": ""
|
|
200
|
+
},
|
|
201
|
+
"attribute": "language",
|
|
202
|
+
"reflect": false,
|
|
203
|
+
"defaultValue": "'en'"
|
|
204
|
+
},
|
|
170
205
|
"loadingStateChange": {
|
|
171
206
|
"type": "unknown",
|
|
172
207
|
"mutable": false,
|
|
@@ -207,10 +242,11 @@ export class PaintThickness {
|
|
|
207
242
|
}
|
|
208
243
|
static get states() {
|
|
209
244
|
return {
|
|
245
|
+
"locale": {},
|
|
210
246
|
"state": {},
|
|
211
247
|
"externalVin": {},
|
|
212
|
-
"errorMessage": {},
|
|
213
248
|
"expandedImage": {},
|
|
249
|
+
"errorMessage": {},
|
|
214
250
|
"vehicleInformation": {}
|
|
215
251
|
};
|
|
216
252
|
}
|
|
@@ -311,6 +347,9 @@ export class PaintThickness {
|
|
|
311
347
|
static get elementRef() { return "el"; }
|
|
312
348
|
static get watchers() {
|
|
313
349
|
return [{
|
|
350
|
+
"propName": "language",
|
|
351
|
+
"methodName": "changeLanguage"
|
|
352
|
+
}, {
|
|
314
353
|
"propName": "state",
|
|
315
354
|
"methodName": "loadingListener"
|
|
316
355
|
}];
|
|
@@ -3,22 +3,32 @@
|
|
|
3
3
|
* Copyright (c)
|
|
4
4
|
*/
|
|
5
5
|
import { Host, h } from "@stencil/core";
|
|
6
|
-
import Loading from "../components/Loading";
|
|
7
6
|
import cn from "../../global/lib/cn";
|
|
7
|
+
import { getLocaleLanguage } from "../../global/lib/get-local-language";
|
|
8
|
+
import { localeSchema } from "../../global/types/locales/index";
|
|
8
9
|
import { getVehicleInformation } from "../../global/api/vehicleInformation";
|
|
10
|
+
import Loading from "../components/Loading";
|
|
9
11
|
let mockData = {};
|
|
10
12
|
export class ServiceHistory {
|
|
11
13
|
constructor() {
|
|
12
14
|
this.baseUrl = '';
|
|
13
15
|
this.isDev = false;
|
|
14
16
|
this.queryString = '';
|
|
17
|
+
this.language = 'en';
|
|
15
18
|
this.loadingStateChange = undefined;
|
|
16
19
|
this.loadedResponse = undefined;
|
|
20
|
+
this.locale = localeSchema.getDefault();
|
|
17
21
|
this.state = 'idle';
|
|
18
22
|
this.externalVin = null;
|
|
19
23
|
this.errorMessage = null;
|
|
20
24
|
this.vehicleInformation = undefined;
|
|
21
25
|
}
|
|
26
|
+
async componentWillLoad() {
|
|
27
|
+
await this.changeLanguage(this.language);
|
|
28
|
+
}
|
|
29
|
+
async changeLanguage(newLanguage) {
|
|
30
|
+
this.locale = await getLocaleLanguage(newLanguage);
|
|
31
|
+
}
|
|
22
32
|
handleSettingData(response) {
|
|
23
33
|
if (response.serviceHistory === null)
|
|
24
34
|
response.serviceHistory = [];
|
|
@@ -50,7 +60,7 @@ export class ServiceHistory {
|
|
|
50
60
|
const vehicleResponse = isVinRequest ? await getVehicleInformation(this, { scopedTimeoutRef, vin, mockData }, headers) : newData;
|
|
51
61
|
if (this.networkTimeoutRef === scopedTimeoutRef) {
|
|
52
62
|
if (!vehicleResponse)
|
|
53
|
-
throw new Error('
|
|
63
|
+
throw new Error('wrongResponseFormat');
|
|
54
64
|
this.handleSettingData(vehicleResponse);
|
|
55
65
|
}
|
|
56
66
|
this.errorMessage = null;
|
|
@@ -76,7 +86,8 @@ export class ServiceHistory {
|
|
|
76
86
|
}
|
|
77
87
|
render() {
|
|
78
88
|
var _a, _b, _c, _d;
|
|
79
|
-
|
|
89
|
+
const texts = this.locale.vehicleLookup.serviceHistory;
|
|
90
|
+
return (h(Host, { key: 'e5eefccce115cb82190384b31dda1315bde5fc70' }, h("div", { key: 'ec5be235022339b210e9346035c54d32e931a1ca', class: "min-h-[100px] relative transition-all duration-300 overflow-hidden" }, h("div", { key: 'c1fe096d2176c255bd481394da51b527b45cd9d7' }, h(Loading, { key: '4ed349910b887560911ac00ecd10fc01a6567837', isLoading: this.state.includes('loading') }), h("div", { key: 'a0617a3631df80fb41dbcf0c962fdd2e864d3493', class: cn('transition-all duration-700', { 'scale-0': this.state.includes('loading') || this.state === 'idle', 'opacity-0': this.state.includes('loading') }) }, h("div", { key: '2215c44cf4c0a4fe5675b12a59d0f6c77ed7fe49', 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: 'be552c787c2c35a5c69e6a64619d75f75e1f6797', class: "py-[16px]" }, h("div", { key: '7edc33ca66e08ac62b7a01bab8bdf6644bbd63fa', class: " px-[16px] py-[8px] border reject-card text-[20px] rounded-[8px] w-fit mx-auto" }, this.locale.errors[this.errorMessage] || this.errorMessage))), ['data', 'data-loading'].includes(this.state) && (h("div", { key: '29a7f3193a94147dbfe3ffa4b8ef2ad147868f1c', class: "flex mt-[12px] max-h-[70dvh] overflow-hidden rounded-[4px] flex-col border border-[#d6d8dc]" }, h("div", { key: '1a94982c5578322eb257b3dceb6ff130c788d217', class: "w-full h-[40px] flex shrink-0 justify-center text-[18px] items-center text-[#383c43] text-center bg-[#e1e3e5]" }, texts.serviceHistory), h("div", { key: '057c1d07e82b95ea22bbc80e5dd4b56ebdda99e4', class: "h-0 overflow-auto flex-1" }, !((_b = this.vehicleInformation) === null || _b === void 0 ? void 0 : _b.serviceHistory.length) && h("div", { key: '976ad885407d9e02135f60a3334e3f1e6d118a9b', class: "h-[80px] flex items-center justify-center text-[18px]" }, texts.noData), !!((_c = this.vehicleInformation) === null || _c === void 0 ? void 0 : _c.serviceHistory.length) && (h("table", { key: '6042aa7f6766c6847173d6714254fb8f377c3ca6', class: "w-full overflow-auto relative border-collapse" }, h("thead", { key: '2ee300fe27add43c20d215653f2cbd295c08f524', class: "top-0 font-bold sticky bg-white" }, h("tr", { key: 'c5331792c19ed2f6cfa8a4551ad5cd31d6d62d2a' }, ['branch', 'dealer', 'invoiceNumber', 'date', 'serviceType', 'odometer'].map(title => (h("th", { key: title, class: "px-[10px] py-[20px] text-center whitespace-nowrap border-b border-[#d6d8dc]" }, texts[title]))))), h("tbody", { key: '0940d07d7f4abc75f219286949ed5c347f456581' }, (_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 => {
|
|
80
91
|
var _a;
|
|
81
92
|
return (h("td", { key: service.invoiceNumber + serviceType, class: cn('px-[10px] py-[20px] text-center whitespace-nowrap border-b border-[#d6d8dc]', {
|
|
82
93
|
'!border-none': idx === ((_a = this.vehicleInformation) === null || _a === void 0 ? void 0 : _a.serviceHistory.length) - 1,
|
|
@@ -151,6 +162,30 @@ export class ServiceHistory {
|
|
|
151
162
|
"reflect": false,
|
|
152
163
|
"defaultValue": "''"
|
|
153
164
|
},
|
|
165
|
+
"language": {
|
|
166
|
+
"type": "string",
|
|
167
|
+
"mutable": false,
|
|
168
|
+
"complexType": {
|
|
169
|
+
"original": "LanguageKeys",
|
|
170
|
+
"resolved": "\"ar\" | \"en\" | \"ku\"",
|
|
171
|
+
"references": {
|
|
172
|
+
"LanguageKeys": {
|
|
173
|
+
"location": "import",
|
|
174
|
+
"path": "~types/locales",
|
|
175
|
+
"id": "src/global/types/locales/index.ts::LanguageKeys"
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
},
|
|
179
|
+
"required": false,
|
|
180
|
+
"optional": false,
|
|
181
|
+
"docs": {
|
|
182
|
+
"tags": [],
|
|
183
|
+
"text": ""
|
|
184
|
+
},
|
|
185
|
+
"attribute": "language",
|
|
186
|
+
"reflect": false,
|
|
187
|
+
"defaultValue": "'en'"
|
|
188
|
+
},
|
|
154
189
|
"loadingStateChange": {
|
|
155
190
|
"type": "unknown",
|
|
156
191
|
"mutable": false,
|
|
@@ -191,6 +226,7 @@ export class ServiceHistory {
|
|
|
191
226
|
}
|
|
192
227
|
static get states() {
|
|
193
228
|
return {
|
|
229
|
+
"locale": {},
|
|
194
230
|
"state": {},
|
|
195
231
|
"externalVin": {},
|
|
196
232
|
"errorMessage": {},
|
|
@@ -294,6 +330,9 @@ export class ServiceHistory {
|
|
|
294
330
|
static get elementRef() { return "el"; }
|
|
295
331
|
static get watchers() {
|
|
296
332
|
return [{
|
|
333
|
+
"propName": "language",
|
|
334
|
+
"methodName": "changeLanguage"
|
|
335
|
+
}, {
|
|
297
336
|
"propName": "state",
|
|
298
337
|
"methodName": "loadingListener"
|
|
299
338
|
}];
|
|
@@ -3,11 +3,13 @@
|
|
|
3
3
|
* Copyright (c)
|
|
4
4
|
*/
|
|
5
5
|
import { Host, h } from "@stencil/core";
|
|
6
|
+
import { localeSchema } from "../../global/types/locales/index";
|
|
6
7
|
import { getVehicleInformation } from "../../global/api/vehicleInformation";
|
|
7
8
|
import cn from "../../global/lib/cn";
|
|
8
|
-
import
|
|
9
|
-
import Eye from "~assets/eye.svg";
|
|
9
|
+
import { getLocaleLanguage } from "../../global/lib/get-local-language";
|
|
10
10
|
import { closeImageViewer, openImageViewer } from "../../global/lib/image-expansion";
|
|
11
|
+
import Eye from "~assets/eye.svg";
|
|
12
|
+
import Loading from "../components/Loading";
|
|
11
13
|
let mockData = {};
|
|
12
14
|
export class VehicleAccessories {
|
|
13
15
|
constructor() {
|
|
@@ -23,14 +25,22 @@ export class VehicleAccessories {
|
|
|
23
25
|
this.baseUrl = '';
|
|
24
26
|
this.isDev = false;
|
|
25
27
|
this.queryString = '';
|
|
28
|
+
this.language = 'en';
|
|
26
29
|
this.loadingStateChange = undefined;
|
|
27
30
|
this.loadedResponse = undefined;
|
|
31
|
+
this.locale = localeSchema.getDefault();
|
|
28
32
|
this.state = 'idle';
|
|
29
33
|
this.externalVin = null;
|
|
30
|
-
this.errorMessage = null;
|
|
31
34
|
this.expandedImage = null;
|
|
35
|
+
this.errorMessage = null;
|
|
32
36
|
this.vehicleInformation = undefined;
|
|
33
37
|
}
|
|
38
|
+
async componentWillLoad() {
|
|
39
|
+
await this.changeLanguage(this.language);
|
|
40
|
+
}
|
|
41
|
+
async changeLanguage(newLanguage) {
|
|
42
|
+
this.locale = await getLocaleLanguage(newLanguage);
|
|
43
|
+
}
|
|
34
44
|
handleSettingData(response) {
|
|
35
45
|
if (!response.accessories || !Array.isArray(response.accessories))
|
|
36
46
|
response.accessories = [];
|
|
@@ -62,7 +72,7 @@ export class VehicleAccessories {
|
|
|
62
72
|
const vehicleResponse = isVinRequest ? await getVehicleInformation(this, { scopedTimeoutRef, vin, mockData }, headers) : newData;
|
|
63
73
|
if (this.networkTimeoutRef === scopedTimeoutRef) {
|
|
64
74
|
if (!vehicleResponse)
|
|
65
|
-
throw new Error('
|
|
75
|
+
throw new Error('wrongResponseFormat');
|
|
66
76
|
this.handleSettingData(vehicleResponse);
|
|
67
77
|
}
|
|
68
78
|
this.errorMessage = null;
|
|
@@ -88,8 +98,9 @@ export class VehicleAccessories {
|
|
|
88
98
|
}
|
|
89
99
|
render() {
|
|
90
100
|
var _a, _b;
|
|
101
|
+
const texts = this.locale.vehicleLookup.accessories;
|
|
91
102
|
const accessories = (this === null || this === void 0 ? void 0 : this.vehicleInformation) ? (_a = this.vehicleInformation) === null || _a === void 0 ? void 0 : _a.accessories : [];
|
|
92
|
-
return (h(Host, { key: '
|
|
103
|
+
return (h(Host, { key: '5b676008ffd07cf3c30f6a1dbef540aeddec5650' }, h("div", { key: '936db932754ee0c5774bb9bbadcab9acdf0bd8f1', dir: this.locale.direction, class: "min-h-[100px] relative transition-all duration-300 overflow-hidden" }, h("div", { key: '46029b531877e9641e0797a08449c446d6acb41d' }, h(Loading, { key: 'c831c9e7b6ae7e3c7748ec20a531fc653570d7a1', isLoading: this.state.includes('loading') }), h("div", { key: 'eb7b7864b47ab00025c7634995a2f3d868f379df', class: cn('transition-all duration-700', { 'scale-0': this.state.includes('loading') || this.state === 'idle', 'opacity-0': this.state.includes('loading') }) }, h("div", { key: 'fdb1c1e9673a300a974e1ade26079063e5a6780e', 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: '5b777e9dabe4b1caac03d4ff4c77bc52eacafd0a', class: "py-[16px]" }, h("div", { key: 'e92c8f26bba943508ec0536f404bbf9b46b5ffef', class: " px-[16px] py-[8px] border reject-card text-[20px] rounded-[8px] w-fit mx-auto" }, this.locale.errors[this.errorMessage] || this.errorMessage))), ['data', 'data-loading'].includes(this.state) && (h("div", { key: '7e3e5c940b3b52538c58cec0f6e9befcc8b20d85', class: "flex mt-[12px] max-h-[70dvh] overflow-hidden rounded-[4px] flex-col border border-[#d6d8dc]" }, h("div", { key: 'fd6b52beb280f25ef122ca1616b3dc85ba868aac', class: "w-full h-[40px] flex shrink-0 justify-center text-[18px] items-center text-[#383c43] text-center bg-[#e1e3e5]" }, texts.vehicleAccessories), h("div", { key: 'df4343fae41a6118c73aadf8b2451c1ed55f0b24', class: "h-0 overflow-auto flex-1" }, !accessories.length && h("div", { key: 'c634537217daeb171ba9120b75baeec052727606', class: "h-[80px] flex items-center justify-center text-[18px]" }, texts.noData), !!accessories.length && (h("table", { key: '800b8700d5d7d96cccc3c0774b7c0c6d48411e51', class: "w-full overflow-auto relative border-collapse" }, h("thead", { key: '338f1360f25eeb71b0c766bc6995dc2d794694b0', class: "top-0 font-bold z-40 sticky bg-white" }, h("tr", { key: '4d7be4a922493d6e93b9a72a6de63932bb94f642' }, ['partNumber', 'description', 'image'].map(title => (h("th", { key: title, class: "px-[10px] py-[20px] text-center whitespace-nowrap border-b border-[#d6d8dc]" }, texts[title]))))), h("tbody", { key: 'eb798dcea38261093bc5fdfe5b015b79f3e6d6e9' }, accessories.map((accessory, idx) => {
|
|
93
104
|
var _a;
|
|
94
105
|
return (h("tr", { class: "transition-colors duration-100 hover:bg-slate-100", key: accessory.partNumber }, ['partNumber', 'description'].map(key => {
|
|
95
106
|
var _a;
|
|
@@ -98,10 +109,10 @@ export class VehicleAccessories {
|
|
|
98
109
|
}) }, accessory[key] || '...'));
|
|
99
110
|
}), h("td", { class: cn('px-[10px] py-[10px] text-center whitespace-nowrap border-b border-[#d6d8dc]', {
|
|
100
111
|
'!border-none': idx === ((_a = this.vehicleInformation) === null || _a === void 0 ? void 0 : _a.serviceHistory.length) - 1,
|
|
101
|
-
}) }, 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: Eye }), h("span", { class: "text-white" },
|
|
102
|
-
})), h("div", { key: '
|
|
112
|
+
}) }, 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: Eye }), h("span", { class: "text-white" }, texts.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 })))));
|
|
113
|
+
})), h("div", { key: 'bb875932b3315b24afd3589948936dd3b471bc56', 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', {
|
|
103
114
|
'pointer-events-auto opacity-100 delay-200': this.expandedImage,
|
|
104
|
-
}) }, h("button", { key: '
|
|
115
|
+
}) }, h("button", { key: '9b6a9934ecd43a4988978772d3f9ec032fc2366d', class: "flex flex-col mt-[16px] items-center justify-center size-12 float-right mr-[16px]", onClick: () => this.closeImage() }, h("div", { key: 'fc59bcd946d47fab25522506e1362ab92580efa8', class: "h-1 w-12 rounded-full rotate-45 absolute bg-white" }), h("div", { key: 'baf4b47120f23081e6f150ee3aacb8410e964c51', class: "h-1 w-12 rounded-full -rotate-45 absolute bg-white" }))), h("img", { key: '8dfbdb6402ba212b864fb7e6324db06b28e6b8b2', alt: "", id: "expanded-image", class: "fixed opacity-0 z-50 transition-all rounded-lg" })))))))))));
|
|
105
116
|
}
|
|
106
117
|
static get is() { return "vehicle-accessories"; }
|
|
107
118
|
static get encapsulation() { return "shadow"; }
|
|
@@ -171,6 +182,30 @@ export class VehicleAccessories {
|
|
|
171
182
|
"reflect": false,
|
|
172
183
|
"defaultValue": "''"
|
|
173
184
|
},
|
|
185
|
+
"language": {
|
|
186
|
+
"type": "string",
|
|
187
|
+
"mutable": false,
|
|
188
|
+
"complexType": {
|
|
189
|
+
"original": "LanguageKeys",
|
|
190
|
+
"resolved": "\"ar\" | \"en\" | \"ku\"",
|
|
191
|
+
"references": {
|
|
192
|
+
"LanguageKeys": {
|
|
193
|
+
"location": "import",
|
|
194
|
+
"path": "~types/locales",
|
|
195
|
+
"id": "src/global/types/locales/index.ts::LanguageKeys"
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
},
|
|
199
|
+
"required": false,
|
|
200
|
+
"optional": false,
|
|
201
|
+
"docs": {
|
|
202
|
+
"tags": [],
|
|
203
|
+
"text": ""
|
|
204
|
+
},
|
|
205
|
+
"attribute": "language",
|
|
206
|
+
"reflect": false,
|
|
207
|
+
"defaultValue": "'en'"
|
|
208
|
+
},
|
|
174
209
|
"loadingStateChange": {
|
|
175
210
|
"type": "unknown",
|
|
176
211
|
"mutable": false,
|
|
@@ -211,10 +246,11 @@ export class VehicleAccessories {
|
|
|
211
246
|
}
|
|
212
247
|
static get states() {
|
|
213
248
|
return {
|
|
249
|
+
"locale": {},
|
|
214
250
|
"state": {},
|
|
215
251
|
"externalVin": {},
|
|
216
|
-
"errorMessage": {},
|
|
217
252
|
"expandedImage": {},
|
|
253
|
+
"errorMessage": {},
|
|
218
254
|
"vehicleInformation": {}
|
|
219
255
|
};
|
|
220
256
|
}
|
|
@@ -315,6 +351,9 @@ export class VehicleAccessories {
|
|
|
315
351
|
static get elementRef() { return "el"; }
|
|
316
352
|
static get watchers() {
|
|
317
353
|
return [{
|
|
354
|
+
"propName": "language",
|
|
355
|
+
"methodName": "changeLanguage"
|
|
356
|
+
}, {
|
|
318
357
|
"propName": "state",
|
|
319
358
|
"methodName": "loadingListener"
|
|
320
359
|
}];
|