adp-web-components 0.0.34 → 0.0.37
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/{app-globals-6d543be0.js → app-globals-4aa8f46f.js} +13 -0
- package/dist/cjs/dead-stock-lookup_3.cjs.entry.js +394 -0
- package/dist/cjs/dynamic-claim_6.cjs.entry.js +12 -12
- package/dist/cjs/dynamic-redeem.cjs.entry.js +4 -4
- 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-b48b2f48.js → get-local-language-2acb5afc.js} +51 -1
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/part-lookup.cjs.entry.js +121 -0
- package/dist/cjs/shift-components.cjs.js +2 -2
- package/dist/cjs/vehicle-lookup.cjs.entry.js +1 -1
- package/dist/collection/collection-manifest.json +5 -4
- 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/part-lookup/dead-stock-lookup.css +1 -1
- package/dist/collection/components/part-lookup/dead-stock-lookup.js +4 -3
- package/dist/collection/components/part-lookup/distributor-lookup.css +1 -1
- package/dist/collection/components/part-lookup/distributor-lookup.js +17 -13
- package/dist/collection/components/part-lookup/manufacturer-lookup.css +1 -1
- package/dist/collection/components/part-lookup/manufacturer-lookup.js +18 -18
- package/dist/collection/components/part-lookup/part-lookup.css +1 -0
- package/dist/collection/components/part-lookup/part-lookup.js +405 -0
- package/dist/collection/components/vehicle-lookup/dynamic-claim.js +3 -3
- package/dist/collection/components/vehicle-lookup/dynamic-redeem.js +4 -4
- package/dist/collection/components/vehicle-lookup/paint-thickness.js +4 -4
- package/dist/collection/components/vehicle-lookup/service-history.js +2 -2
- package/dist/collection/components/vehicle-lookup/vehicle-accessories.js +4 -4
- package/dist/collection/components/vehicle-lookup/vehicle-lookup.js +2 -2
- package/dist/collection/components/vehicle-lookup/vehicle-specification.js +2 -2
- package/dist/collection/components/vehicle-lookup/warranty-details.js +2 -2
- package/dist/collection/global/lib/middleware.js +13 -0
- package/dist/collection/global/types/locales/index.js +4 -0
- package/dist/collection/global/types/locales/part-lookup/dead-stock-schema.js +10 -0
- package/dist/collection/global/types/locales/part-lookup/distributor-schema.js +21 -0
- package/dist/collection/global/types/locales/part-lookup/index.js +13 -0
- package/dist/collection/global/types/locales/part-lookup/manufacturer-schema.js +22 -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-f6b68cb6.js → p-09dd6de2.js} +1 -1
- package/dist/components/{p-2882d59a.js → p-21dfafba.js} +1 -1
- package/dist/components/{p-5adec8c4.js → p-2f02d063.js} +1 -1
- package/dist/components/{p-f001d15b.js → p-46262302.js} +1 -1
- package/dist/components/{p-e5d74a15.js → p-58a3bbc5.js} +1 -1
- package/dist/components/p-5e80276a.js +5 -0
- package/dist/components/{p-0cfd2522.js → p-acbea376.js} +1 -1
- package/dist/components/p-bfddfd50.js +5 -0
- package/dist/components/{p-62a22efb.js → p-c20e4190.js} +1 -1
- package/dist/components/{p-1ca0dc4b.js → p-c41b74ea.js} +1 -1
- package/dist/components/p-c7747b68.js +5 -0
- package/dist/components/{p-093b1fb7.js → p-cb6dc5c3.js} +1 -1
- package/dist/components/p-f312b879.js +5 -0
- package/dist/components/paint-thickness.js +1 -1
- package/dist/components/part-lookup.d.ts +11 -0
- package/dist/components/part-lookup.js +5 -0
- 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/{app-globals-e6576027.js → app-globals-68faa233.js} +13 -0
- package/dist/esm/dead-stock-lookup_3.entry.js +388 -0
- package/dist/esm/dynamic-claim_6.entry.js +12 -12
- package/dist/esm/dynamic-redeem.entry.js +4 -4
- 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-fff1db0a.js → get-local-language-883f9a8a.js} +51 -1
- package/dist/esm/loader.js +2 -2
- package/dist/esm/part-lookup.entry.js +117 -0
- package/dist/esm/shift-components.js +2 -2
- package/dist/esm/vehicle-lookup.entry.js +1 -1
- package/dist/locales/ar.json +40 -0
- package/dist/locales/en.json +40 -0
- package/dist/locales/ku.json +40 -0
- package/dist/locales/ru.json +137 -0
- package/dist/shift-components/{p-42d320e2.js → p-446d908d.js} +1 -1
- package/dist/shift-components/{p-691f64cf.entry.js → p-45cc348b.entry.js} +1 -1
- package/dist/shift-components/{p-832fd942.entry.js → p-4f7a3fd9.entry.js} +1 -1
- package/dist/shift-components/p-5e46843c.entry.js +5 -0
- package/dist/shift-components/{p-3a4e5325.entry.js → p-5f0b9f41.entry.js} +1 -1
- package/dist/shift-components/p-954859b9.entry.js +5 -0
- package/dist/shift-components/p-c44fe649.js +5 -0
- package/dist/shift-components/{p-496a721b.entry.js → p-cde3b164.entry.js} +1 -1
- package/dist/shift-components/{p-9120c049.entry.js → p-dc33c5ac.entry.js} +1 -1
- package/dist/shift-components/shift-components.esm.js +1 -1
- package/dist/types/components/part-lookup/part-lookup.d.ts +43 -0
- package/dist/types/components.d.ts +43 -5
- package/dist/types/global/types/locales/index.d.ts +84 -2
- package/dist/types/global/types/locales/part-lookup/dead-stock-schema.d.ts +9 -0
- package/dist/types/global/types/locales/part-lookup/distributor-schema.d.ts +31 -0
- package/dist/types/global/types/locales/part-lookup/index.d.ts +79 -0
- package/dist/types/global/types/locales/part-lookup/manufacturer-schema.d.ts +33 -0
- package/dist/types/global/types/locales/vehicle-lookup/index.d.ts +1 -1
- package/package.json +1 -1
- package/dist/cjs/dead-stock-lookup.cjs.entry.js +0 -126
- package/dist/cjs/distributor-lookup.cjs.entry.js +0 -134
- package/dist/cjs/general-a1e72036.js +0 -13
- package/dist/cjs/manufacturer-lookup.cjs.entry.js +0 -133
- package/dist/cjs/partInformation-16ea1f8e.js +0 -34
- package/dist/components/p-1344d377.js +0 -5
- package/dist/components/p-50896586.js +0 -5
- package/dist/esm/dead-stock-lookup.entry.js +0 -122
- package/dist/esm/distributor-lookup.entry.js +0 -130
- package/dist/esm/general-b630a7db.js +0 -11
- package/dist/esm/manufacturer-lookup.entry.js +0 -129
- package/dist/esm/partInformation-ba1470e1.js +0 -32
- package/dist/shift-components/p-0b5958a0.entry.js +0 -5
- package/dist/shift-components/p-1344d377.js +0 -5
- package/dist/shift-components/p-cbd2ce5c.entry.js +0 -5
- package/dist/shift-components/p-e0ea03e8.js +0 -5
- package/dist/shift-components/p-eb229fab.entry.js +0 -5
- package/dist/shift-components/p-f99c8b2f.js +0 -5
|
@@ -3,11 +3,13 @@ import { errorsSchema } from './error-schema';
|
|
|
3
3
|
export declare const ARABIC_JSON_FILE = "ar.json";
|
|
4
4
|
export declare const ENGLISH_JSON_FILE = "en.json";
|
|
5
5
|
export declare const KURDISH_JSON_FILE = "ku.json";
|
|
6
|
-
export
|
|
6
|
+
export declare const RUSSIAN_JSON_FILE = "ru.json";
|
|
7
|
+
export type LanguageKeys = 'en' | 'ar' | 'ku' | 'ru';
|
|
7
8
|
export declare const languageMapper: {
|
|
8
9
|
ar: string;
|
|
9
10
|
en: string;
|
|
10
11
|
ku: string;
|
|
12
|
+
ru: string;
|
|
11
13
|
};
|
|
12
14
|
export declare const localeSchema: import("yup").ObjectSchema<{
|
|
13
15
|
errors: {
|
|
@@ -17,15 +19,55 @@ export declare const localeSchema: import("yup").ObjectSchema<{
|
|
|
17
19
|
wrongResponseFormat?: string;
|
|
18
20
|
};
|
|
19
21
|
lang: string;
|
|
22
|
+
partLookup: {
|
|
23
|
+
deadStock?: {
|
|
24
|
+
deadStock?: string;
|
|
25
|
+
branch?: string;
|
|
26
|
+
availableQuantity?: string;
|
|
27
|
+
};
|
|
28
|
+
distributor?: {
|
|
29
|
+
info?: string;
|
|
30
|
+
location?: string;
|
|
31
|
+
description?: string;
|
|
32
|
+
distributorStock?: string;
|
|
33
|
+
availability?: string;
|
|
34
|
+
notAvailable?: string;
|
|
35
|
+
partiallyAvailable?: string;
|
|
36
|
+
available?: string;
|
|
37
|
+
productGroup?: string;
|
|
38
|
+
localDescription?: string;
|
|
39
|
+
dealerPurchasePrice?: string;
|
|
40
|
+
recommendedRetailPrice?: string;
|
|
41
|
+
supersededFrom?: string;
|
|
42
|
+
supersededTo?: string;
|
|
43
|
+
};
|
|
44
|
+
manufacturer?: {
|
|
45
|
+
origin?: string;
|
|
46
|
+
warrantyPrice?: string;
|
|
47
|
+
specialPrice?: string;
|
|
48
|
+
wholesalesPrice?: string;
|
|
49
|
+
pnc?: string;
|
|
50
|
+
pncName?: string;
|
|
51
|
+
binCode?: string;
|
|
52
|
+
dimension1?: string;
|
|
53
|
+
dimension2?: string;
|
|
54
|
+
dimension3?: string;
|
|
55
|
+
netWeight?: string;
|
|
56
|
+
grossWeight?: string;
|
|
57
|
+
cubicMeasure?: string;
|
|
58
|
+
hsCode?: string;
|
|
59
|
+
uzHsCode?: string;
|
|
60
|
+
};
|
|
61
|
+
};
|
|
20
62
|
language: string;
|
|
21
63
|
direction: string;
|
|
22
64
|
vehicleLookup: {
|
|
23
65
|
serviceHistory?: {
|
|
66
|
+
branch?: string;
|
|
24
67
|
noData?: string;
|
|
25
68
|
serviceType?: string;
|
|
26
69
|
invoiceNumber?: string;
|
|
27
70
|
serviceHistory?: string;
|
|
28
|
-
branch?: string;
|
|
29
71
|
dealer?: string;
|
|
30
72
|
date?: string;
|
|
31
73
|
odometer?: string;
|
|
@@ -113,6 +155,46 @@ export declare const localeSchema: import("yup").ObjectSchema<{
|
|
|
113
155
|
wrongResponseFormat: undefined;
|
|
114
156
|
};
|
|
115
157
|
lang: undefined;
|
|
158
|
+
partLookup: {
|
|
159
|
+
deadStock: {
|
|
160
|
+
deadStock: undefined;
|
|
161
|
+
branch: undefined;
|
|
162
|
+
availableQuantity: undefined;
|
|
163
|
+
};
|
|
164
|
+
distributor: {
|
|
165
|
+
info: undefined;
|
|
166
|
+
distributorStock: undefined;
|
|
167
|
+
availability: undefined;
|
|
168
|
+
notAvailable: undefined;
|
|
169
|
+
partiallyAvailable: undefined;
|
|
170
|
+
available: undefined;
|
|
171
|
+
location: undefined;
|
|
172
|
+
description: undefined;
|
|
173
|
+
productGroup: undefined;
|
|
174
|
+
localDescription: undefined;
|
|
175
|
+
dealerPurchasePrice: undefined;
|
|
176
|
+
recommendedRetailPrice: undefined;
|
|
177
|
+
supersededFrom: undefined;
|
|
178
|
+
supersededTo: undefined;
|
|
179
|
+
};
|
|
180
|
+
manufacturer: {
|
|
181
|
+
origin: undefined;
|
|
182
|
+
warrantyPrice: undefined;
|
|
183
|
+
specialPrice: undefined;
|
|
184
|
+
wholesalesPrice: undefined;
|
|
185
|
+
pnc: undefined;
|
|
186
|
+
pncName: undefined;
|
|
187
|
+
binCode: undefined;
|
|
188
|
+
dimension1: undefined;
|
|
189
|
+
dimension2: undefined;
|
|
190
|
+
dimension3: undefined;
|
|
191
|
+
netWeight: undefined;
|
|
192
|
+
grossWeight: undefined;
|
|
193
|
+
cubicMeasure: undefined;
|
|
194
|
+
hsCode: undefined;
|
|
195
|
+
uzHsCode: undefined;
|
|
196
|
+
};
|
|
197
|
+
};
|
|
116
198
|
language: undefined;
|
|
117
199
|
direction: undefined;
|
|
118
200
|
vehicleLookup: {
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export declare const distributorSchema: import("yup").ObjectSchema<{
|
|
2
|
+
info: string;
|
|
3
|
+
distributorStock: string;
|
|
4
|
+
availability: string;
|
|
5
|
+
notAvailable: string;
|
|
6
|
+
partiallyAvailable: string;
|
|
7
|
+
available: string;
|
|
8
|
+
location: string;
|
|
9
|
+
description: string;
|
|
10
|
+
productGroup: string;
|
|
11
|
+
localDescription: string;
|
|
12
|
+
dealerPurchasePrice: string;
|
|
13
|
+
recommendedRetailPrice: string;
|
|
14
|
+
supersededFrom: string;
|
|
15
|
+
supersededTo: string;
|
|
16
|
+
}, import("yup").AnyObject, {
|
|
17
|
+
info: undefined;
|
|
18
|
+
distributorStock: undefined;
|
|
19
|
+
availability: undefined;
|
|
20
|
+
notAvailable: undefined;
|
|
21
|
+
partiallyAvailable: undefined;
|
|
22
|
+
available: undefined;
|
|
23
|
+
location: undefined;
|
|
24
|
+
description: undefined;
|
|
25
|
+
productGroup: undefined;
|
|
26
|
+
localDescription: undefined;
|
|
27
|
+
dealerPurchasePrice: undefined;
|
|
28
|
+
recommendedRetailPrice: undefined;
|
|
29
|
+
supersededFrom: undefined;
|
|
30
|
+
supersededTo: undefined;
|
|
31
|
+
}, "">;
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
export declare const partLookupSchema: import("yup").ObjectSchema<{
|
|
2
|
+
deadStock: {
|
|
3
|
+
deadStock?: string;
|
|
4
|
+
branch?: string;
|
|
5
|
+
availableQuantity?: string;
|
|
6
|
+
};
|
|
7
|
+
distributor: {
|
|
8
|
+
info?: string;
|
|
9
|
+
location?: string;
|
|
10
|
+
description?: string;
|
|
11
|
+
distributorStock?: string;
|
|
12
|
+
availability?: string;
|
|
13
|
+
notAvailable?: string;
|
|
14
|
+
partiallyAvailable?: string;
|
|
15
|
+
available?: string;
|
|
16
|
+
productGroup?: string;
|
|
17
|
+
localDescription?: string;
|
|
18
|
+
dealerPurchasePrice?: string;
|
|
19
|
+
recommendedRetailPrice?: string;
|
|
20
|
+
supersededFrom?: string;
|
|
21
|
+
supersededTo?: string;
|
|
22
|
+
};
|
|
23
|
+
manufacturer: {
|
|
24
|
+
origin?: string;
|
|
25
|
+
warrantyPrice?: string;
|
|
26
|
+
specialPrice?: string;
|
|
27
|
+
wholesalesPrice?: string;
|
|
28
|
+
pnc?: string;
|
|
29
|
+
pncName?: string;
|
|
30
|
+
binCode?: string;
|
|
31
|
+
dimension1?: string;
|
|
32
|
+
dimension2?: string;
|
|
33
|
+
dimension3?: string;
|
|
34
|
+
netWeight?: string;
|
|
35
|
+
grossWeight?: string;
|
|
36
|
+
cubicMeasure?: string;
|
|
37
|
+
hsCode?: string;
|
|
38
|
+
uzHsCode?: string;
|
|
39
|
+
};
|
|
40
|
+
}, import("yup").AnyObject, {
|
|
41
|
+
deadStock: {
|
|
42
|
+
deadStock: undefined;
|
|
43
|
+
branch: undefined;
|
|
44
|
+
availableQuantity: undefined;
|
|
45
|
+
};
|
|
46
|
+
distributor: {
|
|
47
|
+
info: undefined;
|
|
48
|
+
distributorStock: undefined;
|
|
49
|
+
availability: undefined;
|
|
50
|
+
notAvailable: undefined;
|
|
51
|
+
partiallyAvailable: undefined;
|
|
52
|
+
available: undefined;
|
|
53
|
+
location: undefined;
|
|
54
|
+
description: undefined;
|
|
55
|
+
productGroup: undefined;
|
|
56
|
+
localDescription: undefined;
|
|
57
|
+
dealerPurchasePrice: undefined;
|
|
58
|
+
recommendedRetailPrice: undefined;
|
|
59
|
+
supersededFrom: undefined;
|
|
60
|
+
supersededTo: undefined;
|
|
61
|
+
};
|
|
62
|
+
manufacturer: {
|
|
63
|
+
origin: undefined;
|
|
64
|
+
warrantyPrice: undefined;
|
|
65
|
+
specialPrice: undefined;
|
|
66
|
+
wholesalesPrice: undefined;
|
|
67
|
+
pnc: undefined;
|
|
68
|
+
pncName: undefined;
|
|
69
|
+
binCode: undefined;
|
|
70
|
+
dimension1: undefined;
|
|
71
|
+
dimension2: undefined;
|
|
72
|
+
dimension3: undefined;
|
|
73
|
+
netWeight: undefined;
|
|
74
|
+
grossWeight: undefined;
|
|
75
|
+
cubicMeasure: undefined;
|
|
76
|
+
hsCode: undefined;
|
|
77
|
+
uzHsCode: undefined;
|
|
78
|
+
};
|
|
79
|
+
}, "">;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
export declare const manufacturerSchema: import("yup").ObjectSchema<{
|
|
2
|
+
origin: string;
|
|
3
|
+
warrantyPrice: string;
|
|
4
|
+
specialPrice: string;
|
|
5
|
+
wholesalesPrice: string;
|
|
6
|
+
pnc: string;
|
|
7
|
+
pncName: string;
|
|
8
|
+
binCode: string;
|
|
9
|
+
dimension1: string;
|
|
10
|
+
dimension2: string;
|
|
11
|
+
dimension3: string;
|
|
12
|
+
netWeight: string;
|
|
13
|
+
grossWeight: string;
|
|
14
|
+
cubicMeasure: string;
|
|
15
|
+
hsCode: string;
|
|
16
|
+
uzHsCode: string;
|
|
17
|
+
}, import("yup").AnyObject, {
|
|
18
|
+
origin: undefined;
|
|
19
|
+
warrantyPrice: undefined;
|
|
20
|
+
specialPrice: undefined;
|
|
21
|
+
wholesalesPrice: undefined;
|
|
22
|
+
pnc: undefined;
|
|
23
|
+
pncName: undefined;
|
|
24
|
+
binCode: undefined;
|
|
25
|
+
dimension1: undefined;
|
|
26
|
+
dimension2: undefined;
|
|
27
|
+
dimension3: undefined;
|
|
28
|
+
netWeight: undefined;
|
|
29
|
+
grossWeight: undefined;
|
|
30
|
+
cubicMeasure: undefined;
|
|
31
|
+
hsCode: undefined;
|
|
32
|
+
uzHsCode: undefined;
|
|
33
|
+
}, "">;
|
|
@@ -65,11 +65,11 @@ export declare const vehicleLookupSchema: import("yup").ObjectSchema<{
|
|
|
65
65
|
sfx?: string;
|
|
66
66
|
};
|
|
67
67
|
serviceHistory: {
|
|
68
|
+
branch?: string;
|
|
68
69
|
noData?: string;
|
|
69
70
|
serviceType?: string;
|
|
70
71
|
invoiceNumber?: string;
|
|
71
72
|
serviceHistory?: string;
|
|
72
|
-
branch?: string;
|
|
73
73
|
dealer?: string;
|
|
74
74
|
date?: string;
|
|
75
75
|
odometer?: string;
|
package/package.json
CHANGED
|
@@ -1,126 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Built by ShiftSoftware
|
|
3
|
-
* Copyright (c)
|
|
4
|
-
*/
|
|
5
|
-
'use strict';
|
|
6
|
-
|
|
7
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
8
|
-
|
|
9
|
-
const index = require('./index-846c93d2.js');
|
|
10
|
-
const getLocalLanguage = require('./get-local-language-b48b2f48.js');
|
|
11
|
-
const cn = require('./cn-f559f9e5.js');
|
|
12
|
-
const Loading = require('./Loading-6f4f0127.js');
|
|
13
|
-
const partInformation = require('./partInformation-16ea1f8e.js');
|
|
14
|
-
require('./index.esm-c628daeb.js');
|
|
15
|
-
|
|
16
|
-
const deadStockLookupCss = "*,:after,:before{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scroll-snap-strictness:proximity;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;border:0 solid #e5e7eb;box-sizing:border-box}::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scroll-snap-strictness:proximity;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;}/*! tailwindcss v3.4.15 | MIT License | https://tailwindcss.com*/:after,:before{--tw-content:\"\"}:host,html{-webkit-text-size-adjust:100%;font-feature-settings:normal;-webkit-tap-highlight-color:transparent;font-family:ui-sans-serif,system-ui,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;font-variation-settings:normal;line-height:1.5;-moz-tab-size:4;tab-size:4}body{line-height:inherit;margin:0}hr{border-top-width:1px;color:inherit;height:0}abbr:where([title]){text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-feature-settings:normal;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:1em;font-variation-settings:normal}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{border-collapse:collapse;border-color:inherit;text-indent:0}button,input,optgroup,select,textarea{font-feature-settings:inherit;color:inherit;font-family:inherit;font-size:100%;font-variation-settings:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dd,dl,fieldset,figure,h1,h2,h3,h4,h5,h6,hr,p,pre{margin:0}fieldset,legend{padding:0}menu,ol,ul{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::placeholder,textarea::placeholder{color:#9ca3af;opacity:1}[role=button],button{cursor:pointer}:disabled{cursor:default}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{height:auto;max-width:100%}[hidden]:where(:not([hidden=until-found])){display:none}.block{display:block}:host{all:initial!important;display:block}*{font-family:Arial}.static{position:static}.relative{position:relative}.mx-auto{margin-left:auto;margin-right:auto}.mb-\\[10px\\]{margin-bottom:10px}.mt-\\[12px\\]{margin-top:12px}.flex{display:flex}.table{display:table}.size-\\[22px\\]{height:22px;width:22px}.h-\\[40px\\]{height:40px}.max-h-\\[70dvh\\]{max-height:70dvh}.min-h-\\[100px\\]{min-height:100px}.w-fit{width:fit-content}.w-full{width:100%}.shrink-0{flex-shrink:0}.border-collapse{border-collapse:collapse}.scale-0{--tw-scale-x:0;--tw-scale-y:0}.scale-0,.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.flex-col{flex-direction:column}.items-center{align-items:center}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.whitespace-nowrap{white-space:nowrap}.rounded-\\[4px\\]{border-radius:4px}.rounded-\\[8px\\]{border-radius:8px}.rounded-md{border-radius:.375rem}.border{border-width:1px}.border-b{border-bottom-width:1px}.border-\\[\\#d6d8dc\\]{--tw-border-opacity:1;border-color:rgb(214 216 220/var(--tw-border-opacity,1))}.bg-\\[\\#e1e3e5\\]{--tw-bg-opacity:1;background-color:rgb(225 227 229/var(--tw-bg-opacity,1))}.px-\\[10px\\]{padding-left:10px;padding-right:10px}.px-\\[16px\\]{padding-left:16px;padding-right:16px}.px-\\[20px\\]{padding-left:20px;padding-right:20px}.py-\\[10px\\]{padding-bottom:10px;padding-top:10px}.py-\\[16px\\]{padding-bottom:16px;padding-top:16px}.py-\\[20px\\]{padding-bottom:20px;padding-top:20px}.py-\\[8px\\]{padding-bottom:8px;padding-top:8px}.text-left{text-align:left}.text-center{text-align:center}.text-\\[18px\\]{font-size:18px}.text-\\[20px\\]{font-size:20px}.text-\\[\\#383c43\\]{--tw-text-opacity:1;color:rgb(56 60 67/var(--tw-text-opacity,1))}.text-slate-800{--tw-text-opacity:1;color:rgb(30 41 59/var(--tw-text-opacity,1))}.opacity-0{opacity:0}.shadow{--tw-shadow:0 1px 3px 0 rgba(0,0,0,.1),0 1px 2px -1px rgba(0,0,0,.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color),0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.transition-all{transition-duration:.15s;transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1)}.transition-colors{transition-duration:.15s;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1)}.transition-transform{transition-duration:.15s;transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1)}.duration-100{transition-duration:.1s}.duration-300{transition-duration:.3s}.duration-500{transition-duration:.5s}.duration-700{transition-duration:.7s}.reject-card{background-color:#f7d7d8;border-color:#f2aeb5;color:#58151c}.container{width:100%}@media (min-width:640px){.container{max-width:640px}}@media (min-width:768px){.container{max-width:768px}}@media (min-width:1024px){.container{max-width:1024px}}@media (min-width:1280px){.container{max-width:1280px}}@media (min-width:1536px){.container{max-width:1536px}}.last\\:border-none:last-child{border-style:none}.hover\\:bg-slate-100:hover{--tw-bg-opacity:1;background-color:rgb(241 245 249/var(--tw-bg-opacity,1))}.pointer-events-none{pointer-events:none}.absolute{position:absolute}.z-50{z-index:50}.size-\\[40px\\]{height:40px;width:40px}.size-full{height:100%;width:100%}@keyframes spin{to{transform:rotate(1turn)}}.animate-spin-2s{animation:spin 2s linear infinite}";
|
|
17
|
-
const DeadStockLookupStyle0 = deadStockLookupCss;
|
|
18
|
-
|
|
19
|
-
let mockData = {};
|
|
20
|
-
const closedAccordionHeight = '46px';
|
|
21
|
-
const DeadStockLookup = class {
|
|
22
|
-
constructor(hostRef) {
|
|
23
|
-
index.registerInstance(this, hostRef);
|
|
24
|
-
this.baseUrl = '';
|
|
25
|
-
this.isDev = false;
|
|
26
|
-
this.queryString = '';
|
|
27
|
-
this.language = 'en';
|
|
28
|
-
this.loadingStateChange = undefined;
|
|
29
|
-
this.loadedResponse = undefined;
|
|
30
|
-
this.state = 'idle';
|
|
31
|
-
this.errorMessage = null;
|
|
32
|
-
this.partInformation = undefined;
|
|
33
|
-
this.externalPartNumber = null;
|
|
34
|
-
this.locale = getLocalLanguage.localeSchema.getDefault();
|
|
35
|
-
}
|
|
36
|
-
async componentWillLoad() {
|
|
37
|
-
await this.changeLanguage(this.language);
|
|
38
|
-
}
|
|
39
|
-
async changeLanguage(newLanguage) {
|
|
40
|
-
this.locale = await getLocalLanguage.getLocaleLanguage(newLanguage);
|
|
41
|
-
}
|
|
42
|
-
handleSettingData(response) {
|
|
43
|
-
this.partInformation = response;
|
|
44
|
-
}
|
|
45
|
-
async setData(newData, headers = {}) {
|
|
46
|
-
clearTimeout(this.networkTimeoutRef);
|
|
47
|
-
if (this.abortController)
|
|
48
|
-
this.abortController.abort();
|
|
49
|
-
this.abortController = new AbortController();
|
|
50
|
-
let scopedTimeoutRef;
|
|
51
|
-
const isPartNumberRequest = typeof newData === 'string';
|
|
52
|
-
const partNumber = isPartNumberRequest ? newData : newData === null || newData === void 0 ? void 0 : newData.partNumber;
|
|
53
|
-
this.externalPartNumber = partNumber;
|
|
54
|
-
try {
|
|
55
|
-
if (!partNumber || partNumber.trim().length === 0) {
|
|
56
|
-
this.state = 'idle';
|
|
57
|
-
return;
|
|
58
|
-
}
|
|
59
|
-
if (this.state === 'data' || this.state === 'error') {
|
|
60
|
-
this.state = (this.state + '-loading');
|
|
61
|
-
}
|
|
62
|
-
else
|
|
63
|
-
this.state = 'loading';
|
|
64
|
-
await new Promise(r => {
|
|
65
|
-
scopedTimeoutRef = setTimeout(r, 700);
|
|
66
|
-
this.networkTimeoutRef = scopedTimeoutRef;
|
|
67
|
-
});
|
|
68
|
-
const partResponse = isPartNumberRequest ? await partInformation.getPartInformation(this, { scopedTimeoutRef, partNumber, mockData }, headers) : newData;
|
|
69
|
-
if (this.networkTimeoutRef === scopedTimeoutRef) {
|
|
70
|
-
if (!partResponse)
|
|
71
|
-
throw new Error('wrongResponseFormat');
|
|
72
|
-
this.handleSettingData(partResponse);
|
|
73
|
-
}
|
|
74
|
-
this.errorMessage = null;
|
|
75
|
-
this.state = 'data';
|
|
76
|
-
}
|
|
77
|
-
catch (error) {
|
|
78
|
-
if (error && (error === null || error === void 0 ? void 0 : error.name) === 'AbortError')
|
|
79
|
-
return;
|
|
80
|
-
console.error(error);
|
|
81
|
-
this.state = 'error';
|
|
82
|
-
this.partInformation = null;
|
|
83
|
-
this.errorMessage = error.message;
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
async fetchData(partNumber = this.externalPartNumber, headers = {}) {
|
|
87
|
-
await this.setData(partNumber, headers);
|
|
88
|
-
}
|
|
89
|
-
async loadingListener() {
|
|
90
|
-
if (this.loadingStateChange)
|
|
91
|
-
this.loadingStateChange(this.state.includes('loading'));
|
|
92
|
-
}
|
|
93
|
-
async setMockData(newMockData) {
|
|
94
|
-
mockData = newMockData;
|
|
95
|
-
}
|
|
96
|
-
toggleAccordion(event) {
|
|
97
|
-
const container = event.target.parentElement;
|
|
98
|
-
const icon = container.getElementsByClassName('icon')[0];
|
|
99
|
-
const isExpanded = container.getAttribute('aria-expanded') === 'true';
|
|
100
|
-
if (isExpanded) {
|
|
101
|
-
container.style.height = closedAccordionHeight;
|
|
102
|
-
icon.style.transform = 'rotate(0deg)';
|
|
103
|
-
container.setAttribute('aria-expanded', 'false');
|
|
104
|
-
}
|
|
105
|
-
else {
|
|
106
|
-
const content = container.getElementsByClassName('content')[0];
|
|
107
|
-
const totalHeight = +closedAccordionHeight.replace('px', '') + content.getClientRects()[0].height;
|
|
108
|
-
container.style.height = `${totalHeight}px`;
|
|
109
|
-
icon.style.transform = 'rotate(180deg)';
|
|
110
|
-
container.setAttribute('aria-expanded', 'true');
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
render() {
|
|
114
|
-
var _a, _b;
|
|
115
|
-
return (index.h(index.Host, { key: '6e4ae6ad08a5ddc15fe5146953d1d2a07038835d' }, index.h("div", { key: '85c386f5c877f71d064be8f308e4408c01155eb1', dir: this.locale.direction, class: "min-h-[100px] relative transition-all duration-300 overflow-hidden" }, index.h("div", { key: '71930858160fcaacfe90d18bea2c48bb413c9e9c' }, index.h(Loading.Loading, { key: '4d1f90ee35055e7046b0df380a631b8ca65aa62f', isLoading: this.state.includes('loading') }), index.h("div", { key: 'b5c3e8ec0f8560363f8268e1975c7ca039b6edbb', class: cn.cn('transition-all duration-700', { 'scale-0': this.state.includes('loading') || this.state === 'idle', 'opacity-0': this.state.includes('loading') }) }, ['error', 'error-loading'].includes(this.state) && (index.h("div", { key: '3e928834d4562f5cbe05e451768b668fc9067e61', class: "py-[16px]" }, index.h("div", { key: '6dd21bc59f9636a706f4094364eeab7141a88c52', class: " px-[16px] py-[8px] border reject-card text-[20px] rounded-[8px] w-fit mx-auto" }, this.locale.errors[this.errorMessage] || this.locale.errors.wildCard))), ['data', 'data-loading'].includes(this.state) && (index.h("div", { key: '415d90744dd72e7d7f4e65ca2e83e16131f33c62' }, index.h("div", { key: 'a659d9b44da828b63f8896c45dcffff3e9e0931f', class: "flex mt-[12px] max-h-[70dvh] overflow-hidden rounded-[4px] flex-col border border-[#d6d8dc]" }, index.h("div", { key: '1e55efab0617d36b8f3b816bc391a828fcd3089c', class: "w-full h-[40px] flex shrink-0 justify-center text-[18px] items-center text-[#383c43] text-center bg-[#e1e3e5]" }, "Dead stock"), (_b = (_a = this.partInformation) === null || _a === void 0 ? void 0 : _a.deadStock) === null || _b === void 0 ? void 0 :
|
|
116
|
-
_b.map(deadStock => (index.h("div", { key: deadStock.companyIntegrationID, class: "py-[10px] px-[20px]" }, index.h("div", { "aria-expanded": "false", style: { height: closedAccordionHeight }, class: "border shadow transition-all duration-500 overflow-hidden rounded-md mb-[10px] border-[#d6d8dc]" }, index.h("button", { onClick: this.toggleAccordion, style: { height: closedAccordionHeight }, class: "w-full flex px-[10px] justify-between items-center text-slate-800" }, index.h("strong", null, deadStock.companyName), index.h("span", { class: "icon text-slate-800 transition-transform duration-500" }, index.h("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 16 16", fill: "currentColor", class: "size-[22px]" }, index.h("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M11.78 9.78a.75.75 0 0 1-1.06 0L8 7.06 5.28 9.78a.75.75 0 0 1-1.06-1.06l3.25-3.25a.75.75 0 0 1 1.06 0l3.25 3.25a.75.75 0 0 1 0 1.06Z" })))), index.h("div", { class: "content" }, index.h("table", { class: "w-full overflow-auto relative border-collapse" }, index.h("thead", null, index.h("tr", null, index.h("th", { class: "py-[20px] px-[10px] text-left whitespace-nowrap border-b border-[#d6d8dc]" }, "Branch"), index.h("th", { class: "py-[20px] px-[10px] text-left whitespace-nowrap border-b border-[#d6d8dc]" }, "Available Qty"))), index.h("tbody", null, deadStock === null || deadStock === void 0 ? void 0 : deadStock.branchDeadStock.map(branchDeadStock => (index.h("tr", { class: "transition-colors border-b border-[#d6d8dc] last:border-none duration-100 hover:bg-slate-100", key: branchDeadStock.companyBranchIntegrationID }, index.h("td", { class: cn.cn('py-[20px] px-[10px] text-left whitespace-nowrap') }, branchDeadStock.companyBranchName), index.h("td", { class: cn.cn('py-[20px] px-[10px] text-left whitespace-nowrap') }, index.h("strong", null, branchDeadStock.quantity))))))))))))))))))));
|
|
117
|
-
}
|
|
118
|
-
get el() { return index.getElement(this); }
|
|
119
|
-
static get watchers() { return {
|
|
120
|
-
"language": ["changeLanguage"],
|
|
121
|
-
"state": ["loadingListener"]
|
|
122
|
-
}; }
|
|
123
|
-
};
|
|
124
|
-
DeadStockLookup.style = DeadStockLookupStyle0;
|
|
125
|
-
|
|
126
|
-
exports.dead_stock_lookup = DeadStockLookup;
|
|
@@ -1,134 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Built by ShiftSoftware
|
|
3
|
-
* Copyright (c)
|
|
4
|
-
*/
|
|
5
|
-
'use strict';
|
|
6
|
-
|
|
7
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
8
|
-
|
|
9
|
-
const index = require('./index-846c93d2.js');
|
|
10
|
-
const cn = require('./cn-f559f9e5.js');
|
|
11
|
-
const general = require('./general-a1e72036.js');
|
|
12
|
-
const getLocalLanguage = require('./get-local-language-b48b2f48.js');
|
|
13
|
-
const partInformation = require('./partInformation-16ea1f8e.js');
|
|
14
|
-
const Loading = require('./Loading-6f4f0127.js');
|
|
15
|
-
require('./index.esm-c628daeb.js');
|
|
16
|
-
|
|
17
|
-
const distributorLookupCss = "*,: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}.grid{display:grid}.h-\\[40px\\]{height:40px}.max-h-\\[70dvh\\]{max-height:70dvh}.min-h-\\[100px\\]{min-height:100px}.w-fit{width:fit-content}.w-full{width:100%}.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))}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.flex-col{flex-direction:column}.items-center{align-items:center}.justify-center{justify-content:center}.gap-\\[15px\\]{gap:15px}.gap-\\[50px\\]{gap:50px}.overflow-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))}.border-b-\\[gray\\]{--tw-border-opacity:1;border-bottom-color:rgb(128 128 128/var(--tw-border-opacity,1))}.bg-\\[\\#e1e3e5\\]{--tw-bg-opacity:1;background-color:rgb(225 227 229/var(--tw-bg-opacity,1))}.bg-white{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity,1))}.px-0{padding-left:0;padding-right:0}.px-\\[10px\\]{padding-left:10px;padding-right:10px}.px-\\[16px\\]{padding-left:16px;padding-right:16px}.px-\\[30px\\]{padding-left:30px;padding-right:30px}.py-\\[10px\\]{padding-bottom:10px;padding-top:10px}.py-\\[16px\\]{padding-bottom:16px;padding-top:16px}.py-\\[20px\\]{padding-bottom:20px;padding-top:20px}.py-\\[8px\\]{padding-bottom:8px;padding-top:8px}.text-center{text-align:center}.text-\\[18px\\]{font-size:18px}.text-\\[20px\\]{font-size:20px}.font-bold{font-weight:700}.capitalize{text-transform:capitalize}.text-\\[\\#383c43\\]{--tw-text-opacity:1;color:rgb(56 60 67/var(--tw-text-opacity,1))}.text-\\[green\\]{--tw-text-opacity:1;color:rgb(0 128 0/var(--tw-text-opacity,1))}.text-\\[orange\\]{--tw-text-opacity:1;color:rgb(255 165 0/var(--tw-text-opacity,1))}.text-\\[red\\]{--tw-text-opacity:1;color:rgb(255 0 0/var(--tw-text-opacity,1))}.opacity-0{opacity:0}.shadow{--tw-shadow:0 1px 3px 0 rgba(0,0,0,.1),0 1px 2px -1px rgba(0,0,0,.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color),0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.transition-all{transition-duration:.15s;transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1)}.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}.last\\:border-none:last-child{border-style:none}.hover\\:bg-slate-100:hover{--tw-bg-opacity:1;background-color:rgb(241 245 249/var(--tw-bg-opacity,1))}.pointer-events-none{pointer-events:none}.absolute{position:absolute}.z-50{z-index:50}.size-\\[40px\\]{height:40px;width:40px}.size-full{height:100%;width:100%}@keyframes spin{to{transform:rotate(1turn)}}.animate-spin-2s{animation:spin 2s linear infinite}";
|
|
18
|
-
const DistributorLookupStyle0 = distributorLookupCss;
|
|
19
|
-
|
|
20
|
-
let mockData = {};
|
|
21
|
-
const DistributorLookup = class {
|
|
22
|
-
constructor(hostRef) {
|
|
23
|
-
index.registerInstance(this, hostRef);
|
|
24
|
-
this.baseUrl = '';
|
|
25
|
-
this.isDev = false;
|
|
26
|
-
this.queryString = '';
|
|
27
|
-
this.hiddenFields = '';
|
|
28
|
-
this.language = 'en';
|
|
29
|
-
this.localizationName = '';
|
|
30
|
-
this.loadingStateChange = undefined;
|
|
31
|
-
this.loadedResponse = undefined;
|
|
32
|
-
this.state = 'idle';
|
|
33
|
-
this.errorMessage = null;
|
|
34
|
-
this.partInformation = undefined;
|
|
35
|
-
this.externalPartNumber = null;
|
|
36
|
-
this.locale = getLocalLanguage.localeSchema.getDefault();
|
|
37
|
-
}
|
|
38
|
-
async componentWillLoad() {
|
|
39
|
-
await this.changeLanguage(this.language);
|
|
40
|
-
}
|
|
41
|
-
async changeLanguage(newLanguage) {
|
|
42
|
-
this.locale = await getLocalLanguage.getLocaleLanguage(newLanguage);
|
|
43
|
-
}
|
|
44
|
-
handleSettingData(response) {
|
|
45
|
-
this.partInformation = response;
|
|
46
|
-
}
|
|
47
|
-
async setData(newData, headers = {}) {
|
|
48
|
-
clearTimeout(this.networkTimeoutRef);
|
|
49
|
-
if (this.abortController)
|
|
50
|
-
this.abortController.abort();
|
|
51
|
-
this.abortController = new AbortController();
|
|
52
|
-
let scopedTimeoutRef;
|
|
53
|
-
const isPartNumberRequest = typeof newData === 'string';
|
|
54
|
-
const partNumber = isPartNumberRequest ? newData : newData === null || newData === void 0 ? void 0 : newData.partNumber;
|
|
55
|
-
this.externalPartNumber = partNumber;
|
|
56
|
-
try {
|
|
57
|
-
if (!partNumber || partNumber.trim().length === 0) {
|
|
58
|
-
this.state = 'idle';
|
|
59
|
-
return;
|
|
60
|
-
}
|
|
61
|
-
if (this.state === 'data' || this.state === 'error') {
|
|
62
|
-
this.state = (this.state + '-loading');
|
|
63
|
-
}
|
|
64
|
-
else
|
|
65
|
-
this.state = 'loading';
|
|
66
|
-
await new Promise(r => {
|
|
67
|
-
scopedTimeoutRef = setTimeout(r, 700);
|
|
68
|
-
this.networkTimeoutRef = scopedTimeoutRef;
|
|
69
|
-
});
|
|
70
|
-
const partResponse = isPartNumberRequest ? await partInformation.getPartInformation(this, { scopedTimeoutRef, partNumber, mockData }, headers) : newData;
|
|
71
|
-
if (this.networkTimeoutRef === scopedTimeoutRef) {
|
|
72
|
-
if (!partResponse)
|
|
73
|
-
throw new Error('wrongResponseFormat');
|
|
74
|
-
this.handleSettingData(partResponse);
|
|
75
|
-
}
|
|
76
|
-
this.errorMessage = null;
|
|
77
|
-
this.state = 'data';
|
|
78
|
-
}
|
|
79
|
-
catch (error) {
|
|
80
|
-
if (error && (error === null || error === void 0 ? void 0 : error.name) === 'AbortError')
|
|
81
|
-
return;
|
|
82
|
-
console.error(error);
|
|
83
|
-
this.state = 'error';
|
|
84
|
-
this.partInformation = null;
|
|
85
|
-
this.errorMessage = error.message;
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
async fetchData(partNumber = this.externalPartNumber, headers = {}) {
|
|
89
|
-
await this.setData(partNumber, headers);
|
|
90
|
-
}
|
|
91
|
-
async loadingListener() {
|
|
92
|
-
if (this.loadingStateChange)
|
|
93
|
-
this.loadingStateChange(this.state.includes('loading'));
|
|
94
|
-
}
|
|
95
|
-
async setMockData(newMockData) {
|
|
96
|
-
mockData = newMockData;
|
|
97
|
-
}
|
|
98
|
-
render() {
|
|
99
|
-
var _a, _b, _c;
|
|
100
|
-
const localName = this.partInformation ? this.localizationName || 'russian' : 'russian';
|
|
101
|
-
const hiddenFields = this.partInformation ? this.hiddenFields.split(',').map(field => field.trim()) || [] : [];
|
|
102
|
-
const partsInformation = this.partInformation
|
|
103
|
-
? [
|
|
104
|
-
{ label: 'Description', key: 'partDescription', value: this.partInformation.stockParts[0].partDescription },
|
|
105
|
-
{ label: 'Product Group', key: 'group', value: this.partInformation.stockParts[0].group },
|
|
106
|
-
{ label: `${general.capitalize(localName)} Description`, key: 'localDescription', value: this.partInformation.stockParts[0].localDescription },
|
|
107
|
-
{ label: 'Dealer Purchase price', key: 'fob', value: (_a = this.partInformation.stockParts[0].fob) === null || _a === void 0 ? void 0 : _a.toFixed(2) },
|
|
108
|
-
{ label: 'Recommended Retail price', key: 'price', value: (_b = this.partInformation.stockParts[0].price) === null || _b === void 0 ? void 0 : _b.toFixed(2) },
|
|
109
|
-
{ label: 'Superseded From', key: 'supersededFrom', value: this.partInformation.stockParts[0].supersededFrom },
|
|
110
|
-
{ label: 'Superseded To', key: 'supersededTo', value: this.partInformation.stockParts[0].supersededTo },
|
|
111
|
-
]
|
|
112
|
-
: [];
|
|
113
|
-
const displayedFields = partsInformation.filter(part => !hiddenFields.includes(part.key));
|
|
114
|
-
const displayDistributer = this.partInformation
|
|
115
|
-
? !this.partInformation.stockParts.some(({ quantityLookUpResult }) => quantityLookUpResult === 'LookupIsSkipped' || quantityLookUpResult === 'QuantityNotWithinLookupThreshold')
|
|
116
|
-
: false;
|
|
117
|
-
return (index.h(index.Host, { key: 'e98cdb5d363200db122ed0100f591462c5f37af2' }, index.h("div", { key: 'f4b850d2247759ed7a060064924e0c48356c1527', dir: this.locale.direction, class: "min-h-[100px] relative transition-all duration-300 overflow-hidden" }, index.h("div", { key: '2fbd7dabccc4949c8d8efd6891addde68a429293' }, index.h(Loading.Loading, { key: 'b1e47d98eef64a800ec9bd3a5b069d289bfeeea2', isLoading: this.state.includes('loading') }), index.h("div", { key: '9679d81255f3e0198f8755904e537de4e6afe552', class: cn.cn('transition-all duration-700', { 'scale-0': this.state.includes('loading') || this.state === 'idle', 'opacity-0': this.state.includes('loading') }) }, ['error', 'error-loading'].includes(this.state) && (index.h("div", { key: '4c1d5123ee5b4236885ba1bf1561de631c0efd3a', class: "py-[16px]" }, index.h("div", { key: '17d40851fb8a76d4737a9d224768c9afa592ecda', class: " px-[16px] py-[8px] border reject-card text-[20px] rounded-[8px] w-fit mx-auto" }, this.locale.errors[this.errorMessage] || this.locale.errors.wildCard))), ['data', 'data-loading'].includes(this.state) && (index.h("div", { key: '027820e491b435e9cf8ef47357eeb77d147cd161' }, index.h("div", { key: '741d06d76a2d15ccd2b55e727c628123d16bc185', class: "flex mt-[12px] max-h-[70dvh] overflow-hidden rounded-[4px] flex-col border border-[#d6d8dc]" }, index.h("div", { key: '03843816d41d722e92d1cbd902f387096e232185', class: "w-full h-[40px] flex shrink-0 justify-center text-[18px] items-center text-[#383c43] text-center bg-[#e1e3e5]" }, "Info"), index.h("div", { key: 'f61b2d94e6acfd42f3e033d1d7534aa97f920d64', class: "py-[10px] px-[30px] flex flex-col gap-[15px]" }, index.h("div", { key: '14a2be07f2a55f438960edc2517c629fd76664d6', class: "grid grid-cols-3 gap-[50px]" }, displayedFields.map(({ label, value, key }) => (index.h("div", { key: key, class: "flex flex-col flex-1" }, index.h("strong", { class: "py-[10px] px-0 border-b-[gray] border-b" }, label), index.h("div", { class: "py-[10px] px-0" }, value))))))), displayDistributer && (index.h("div", { key: 'aadd189054ec8a4ed1136a53b5ce0fb61554370c', class: "flex mt-[12px] max-h-[70dvh] overflow-hidden rounded-[4px] flex-col border border-[#d6d8dc]" }, index.h("div", { key: 'f8c768548a0d9cac69a36bf20b0d28e6da5d0646', class: "w-full h-[40px] flex shrink-0 justify-center text-[18px] items-center text-[#383c43] text-center bg-[#e1e3e5]" }, "Distributor Stock"), index.h("div", { key: '207802621ce60285f6fa5548c52bdbbde40197fc', class: "flex flex-col gap-[15px]" }, index.h("table", { key: '8e39bc72148d479caf6d8b9c45381f0d77263d98', class: "w-full overflow-auto relative border-collapse" }, index.h("thead", { key: 'ea6575025fbe61ccbc854ac42c8ea8cadb3d0fcb', class: "top-0 font-bold sticky bg-white" }, index.h("tr", { key: '48a7230029048265e6be05832095aa6bb2614324' }, ['Location', 'Availability'].map(title => (index.h("th", { key: title, class: "px-[10px] py-[20px] text-center whitespace-nowrap border-b border-[#d6d8dc]" }, title))))), index.h("tbody", { key: '4c5eea82b7b51363f184e8473ab18ad4a4258494' }, (_c = this.partInformation) === null || _c === void 0 ? void 0 : _c.stockParts.map(stock => (index.h("tr", { class: "transition-colors duration-100 border-b border-[#d6d8dc] last:border-none hover:bg-slate-100", key: stock.locationID }, index.h("td", { class: cn.cn('px-[10px] py-[20px] text-center whitespace-nowrap') }, stock.locationName), index.h("td", { class: cn.cn('px-[10px] py-[20px] text-center whitespace-nowrap') }, index.h("div", { class: cn.cn('text-[red]', {
|
|
118
|
-
'text-[green]': stock.quantityLookUpResult === 'Available',
|
|
119
|
-
'text-[orange]': stock.quantityLookUpResult === 'PartiallyAvailable',
|
|
120
|
-
}) }, index.h("strong", null, stock.quantityLookUpResult === 'Available'
|
|
121
|
-
? 'Available'
|
|
122
|
-
: stock.quantityLookUpResult === 'PartiallyAvailable'
|
|
123
|
-
? 'Partially Available'
|
|
124
|
-
: 'Not Available'))))))))))))))))));
|
|
125
|
-
}
|
|
126
|
-
get el() { return index.getElement(this); }
|
|
127
|
-
static get watchers() { return {
|
|
128
|
-
"language": ["changeLanguage"],
|
|
129
|
-
"state": ["loadingListener"]
|
|
130
|
-
}; }
|
|
131
|
-
};
|
|
132
|
-
DistributorLookup.style = DistributorLookupStyle0;
|
|
133
|
-
|
|
134
|
-
exports.distributor_lookup = DistributorLookup;
|