adp-web-components 0.0.45 → 0.0.48
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-c3489701.js +16 -0
- package/dist/cjs/contact-us-form.cjs.entry.js +5096 -0
- package/dist/cjs/dead-stock-lookup_3.cjs.entry.js +4 -4
- package/dist/cjs/dynamic-claim_6.cjs.entry.js +7 -6
- package/dist/cjs/dynamic-redeem.cjs.entry.js +2 -3
- package/dist/cjs/form-input_4.cjs.entry.js +256 -0
- package/dist/cjs/form-structure_2.cjs.entry.js +97 -0
- package/dist/cjs/{index.esm-c628daeb.js → get-local-language-ebb05d9e.js} +242 -0
- package/dist/cjs/{index-846c93d2.js → index-603d8f32.js} +12 -19
- package/dist/cjs/{Loading-6f4f0127.js → loader-baf2418b.js} +0 -9
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/part-lookup.cjs.entry.js +2 -3
- package/dist/cjs/shift-components.cjs.js +2 -2
- package/dist/cjs/vehicle-lookup.cjs.entry.js +2 -3
- package/dist/collection/collection-manifest.json +7 -2
- package/dist/collection/components/form-elements/form-input.css +1 -0
- package/dist/collection/components/form-elements/form-input.js +400 -0
- package/dist/collection/components/form-elements/form-select.css +1 -0
- package/dist/collection/components/form-elements/form-select.js +397 -0
- package/dist/collection/components/form-elements/form-structure-error.css +1 -0
- package/dist/collection/components/form-elements/form-structure-error.js +72 -0
- package/dist/collection/components/form-elements/form-structure.css +1 -0
- package/dist/collection/components/form-elements/form-structure.js +227 -0
- package/dist/collection/components/form-elements/form-submit.css +1 -0
- package/dist/collection/components/form-elements/form-submit.js +93 -0
- package/dist/collection/components/form-elements/form-text-area.css +1 -0
- package/dist/collection/components/form-elements/form-text-area.js +288 -0
- package/dist/collection/components/forms/contact-us/form.css +1 -0
- package/dist/collection/components/forms/contact-us/mapper.js +12 -0
- package/dist/collection/components/forms/contact-us/params.js +72 -0
- package/dist/collection/components/forms/contact-us/validations.js +19 -0
- package/dist/collection/components/forms/contact-us-form.js +308 -0
- package/dist/collection/components/part-lookup/dead-stock-lookup.js +1 -1
- package/dist/collection/components/part-lookup/distributor-lookup.js +1 -1
- package/dist/collection/components/part-lookup/manufacturer-lookup.js +1 -1
- package/dist/collection/components/vehicle-lookup/dynamic-claim.js +1 -1
- package/dist/collection/components/vehicle-lookup/paint-thickness.js +1 -1
- package/dist/collection/components/vehicle-lookup/service-history.js +1 -1
- package/dist/collection/components/vehicle-lookup/vehicle-accessories.js +1 -1
- package/dist/collection/components/vehicle-lookup/vehicle-specification.js +3 -2
- package/dist/collection/components/vehicle-lookup/warranty-details.js +2 -2
- package/dist/collection/global/api/urls.js +6 -0
- package/dist/collection/global/assets/white-loader.svg +11 -0
- package/dist/collection/global/lib/form-hook.js +25 -14
- package/dist/collection/global/lib/recaptcha.js +25 -0
- package/dist/collection/global/lib/validate-form-structure.js +47 -0
- package/dist/collection/global/types/forms.js +1 -0
- package/dist/collection/global/types/general.js +1 -0
- package/dist/collection/global/types/locales/error-schema.js +1 -0
- package/dist/collection/global/types/locales/forms/contact-us-schema.js +24 -0
- package/dist/collection/global/types/locales/forms/index.js +11 -0
- package/dist/collection/global/types/locales/general.js +8 -0
- package/dist/collection/global/types/locales/index.js +6 -0
- package/dist/collection/global/types/locales/inquiryTypes.js +15 -0
- package/dist/collection/templates/vehicle-lookup/mock-data.js +1 -5
- package/dist/components/{general-inquiry-form.d.ts → contact-us-form.d.ts} +4 -4
- package/dist/components/contact-us-form.js +5 -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/form-select.d.ts +11 -0
- package/dist/components/form-select.js +5 -0
- package/dist/components/form-structure-error.d.ts +11 -0
- package/dist/components/form-structure-error.js +5 -0
- package/dist/components/form-structure.d.ts +11 -0
- package/dist/components/form-structure.js +5 -0
- package/dist/components/form-submit.d.ts +11 -0
- package/dist/components/form-submit.js +5 -0
- package/dist/components/form-text-area.d.ts +11 -0
- package/dist/components/form-text-area.js +5 -0
- package/dist/components/index.js +1 -1
- package/dist/components/manufacturer-lookup.js +1 -1
- package/dist/components/{p-efd76ea7.js → p-08357e63.js} +1 -1
- package/dist/components/{p-443f6446.js → p-0d76f2b9.js} +1 -1
- package/dist/components/{p-64a8e560.js → p-171807db.js} +1 -1
- package/dist/components/{p-9c9f58f9.js → p-344f4417.js} +1 -1
- package/dist/components/p-5d5842e9.js +5 -0
- package/dist/components/{p-6a4bffe2.js → p-62beac88.js} +1 -1
- package/dist/components/p-638e64fa.js +5 -0
- package/dist/components/p-75476014.js +5 -0
- package/dist/components/{p-336607f4.js → p-7e62f352.js} +1 -1
- package/dist/components/p-87da0395.js +5 -0
- package/dist/components/p-8de98849.js +5 -0
- package/dist/components/{p-467cc8d5.js → p-9a50bc07.js} +1 -1
- package/dist/components/p-aae5c784.js +5 -0
- package/dist/components/{p-9e28d16d.js → p-ac4a782f.js} +1 -1
- package/dist/components/p-af8083e5.js +5 -0
- package/dist/components/{p-bc8714c3.js → p-b400d6f6.js} +1 -1
- package/dist/components/{p-a1adf184.js → p-bb28c098.js} +1 -1
- package/dist/components/p-da2ea879.js +5 -0
- package/dist/components/p-fefbfbe8.js +5 -0
- package/dist/components/paint-thickness.js +1 -1
- package/dist/components/part-lookup.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-3fdd028d.js +14 -0
- package/dist/esm/contact-us-form.entry.js +5092 -0
- package/dist/esm/dead-stock-lookup_3.entry.js +4 -4
- package/dist/esm/dynamic-claim_6.entry.js +7 -6
- package/dist/esm/dynamic-redeem.entry.js +2 -3
- package/dist/esm/form-input_4.entry.js +249 -0
- package/dist/esm/form-structure_2.entry.js +92 -0
- package/dist/esm/{index.esm-46e0cdad.js → get-local-language-50038b04.js} +241 -1
- package/dist/esm/{index-33ae6859.js → index-cac905b0.js} +12 -19
- package/dist/esm/{Loading-f4d666ee.js → loader-027b88af.js} +1 -9
- package/dist/esm/loader.js +3 -3
- package/dist/esm/part-lookup.entry.js +2 -3
- package/dist/esm/shift-components.js +3 -3
- package/dist/esm/vehicle-lookup.entry.js +2 -3
- package/dist/locales/ar.json +39 -1
- package/dist/locales/en.json +38 -0
- package/dist/locales/ku.json +39 -1
- package/dist/locales/ru.json +40 -2
- package/dist/shift-components/p-49005e96.entry.js +5 -0
- package/dist/shift-components/p-4e5e528c.entry.js +5 -0
- package/dist/shift-components/p-65102e7a.js +6 -0
- package/dist/shift-components/{p-75363a52.entry.js → p-6cd76655.entry.js} +1 -1
- package/dist/shift-components/p-96570d9d.entry.js +5 -0
- package/dist/shift-components/p-983cb144.entry.js +5 -0
- package/dist/shift-components/p-a21e2e2e.js +5 -0
- package/dist/shift-components/p-aad6afa6.entry.js +5 -0
- package/dist/shift-components/p-b11c327e.js +5 -0
- package/dist/shift-components/p-b7d8b392.entry.js +5 -0
- package/dist/shift-components/p-bc1b619c.entry.js +5 -0
- package/dist/shift-components/p-fa19695e.js +5 -0
- package/dist/shift-components/shift-components.esm.js +1 -1
- package/dist/types/components/form-elements/form-input.d.ts +27 -0
- package/dist/types/components/form-elements/form-select.d.ts +38 -0
- package/dist/types/components/form-elements/form-structure-error.d.ts +8 -0
- package/dist/types/components/form-elements/form-structure.d.ts +18 -0
- package/dist/types/components/form-elements/form-submit.d.ts +7 -0
- package/dist/types/components/form-elements/form-text-area.d.ts +21 -0
- package/dist/types/components/forms/contact-us/mapper.d.ts +2 -0
- package/dist/types/components/forms/contact-us/params.d.ts +2 -0
- package/dist/types/components/forms/contact-us/validations.d.ts +26 -0
- package/dist/types/components/forms/contact-us-form.d.ts +29 -0
- package/dist/types/components.d.ts +194 -31
- package/dist/types/global/api/urls.d.ts +2 -0
- package/dist/types/global/lib/form-hook.d.ts +1 -30
- package/dist/types/global/lib/recaptcha.d.ts +16 -0
- package/dist/types/global/lib/validate-form-structure.d.ts +3 -0
- package/dist/types/global/types/forms.d.ts +48 -0
- package/dist/types/global/types/general.d.ts +14 -0
- package/dist/types/global/types/locales/error-schema.d.ts +2 -0
- package/dist/types/global/types/locales/forms/contact-us-schema.d.ts +37 -0
- package/dist/types/global/types/locales/forms/index.d.ts +45 -0
- package/dist/types/global/types/locales/general.d.ts +5 -0
- package/dist/types/global/types/locales/index.d.ts +74 -0
- package/dist/types/global/types/locales/inquiryTypes.d.ts +19 -0
- package/package.json +2 -1
- package/dist/cjs/form-input.cjs.entry.js +0 -36
- package/dist/cjs/general-inquiry-form.cjs.entry.js +0 -154
- package/dist/cjs/get-local-language-1ba6d190.js +0 -204
- package/dist/collection/components/form-input/form-input.css +0 -1
- package/dist/collection/components/form-input/form-input.js +0 -209
- package/dist/collection/components/general-inquiry-form/general-inquiry-form.css +0 -1
- package/dist/collection/components/general-inquiry-form/general-inquiry-form.js +0 -46
- package/dist/components/general-inquiry-form.js +0 -5
- package/dist/components/p-83e017fe.js +0 -5
- package/dist/components/p-935af250.js +0 -5
- package/dist/components/p-9c8b634a.js +0 -5
- package/dist/components/p-b2051f01.js +0 -5
- package/dist/components/p-e446fb9d.js +0 -5
- package/dist/esm/form-input.entry.js +0 -32
- package/dist/esm/general-inquiry-form.entry.js +0 -150
- package/dist/esm/get-local-language-42468fce.js +0 -201
- package/dist/shift-components/p-0f0e54c1.js +0 -6
- package/dist/shift-components/p-219fb385.entry.js +0 -5
- package/dist/shift-components/p-33bf409e.entry.js +0 -5
- package/dist/shift-components/p-5ba2e35c.entry.js +0 -5
- package/dist/shift-components/p-6e4e85c0.entry.js +0 -5
- package/dist/shift-components/p-6f356085.js +0 -5
- package/dist/shift-components/p-8f603ea1.entry.js +0 -5
- package/dist/shift-components/p-95532c3e.entry.js +0 -5
- package/dist/shift-components/p-99d314b5.js +0 -5
- package/dist/shift-components/p-e446fb9d.js +0 -5
- package/dist/types/components/form-input/form-input.d.ts +0 -14
- package/dist/types/components/general-inquiry-form/general-inquiry-form.d.ts +0 -21
|
@@ -9,15 +9,31 @@ import { ErrorKeys, LanguageKeys } from "./global/types/locales/index";
|
|
|
9
9
|
import { PartInformation } from "./global/types/part-information";
|
|
10
10
|
import { DotNetObjectReference, MockJson } from "./global/types/components";
|
|
11
11
|
import { ServiceItem, VehicleInformation } from "./global/types/vehicle-information";
|
|
12
|
+
import { FormElementMapper, FormFieldParams, FormInputChanges, FormSelectFetcher, LocaleFormKeys, StructureObject } from "./global/types/forms";
|
|
13
|
+
import { FormHook } from "./global/lib/form-hook";
|
|
12
14
|
import { ActiveElement } from "./components/part-lookup/part-lookup";
|
|
13
15
|
import { ActiveElement as ActiveElement1 } from "./components/vehicle-lookup/vehicle-lookup";
|
|
14
16
|
export { ErrorKeys, LanguageKeys } from "./global/types/locales/index";
|
|
15
17
|
export { PartInformation } from "./global/types/part-information";
|
|
16
18
|
export { DotNetObjectReference, MockJson } from "./global/types/components";
|
|
17
19
|
export { ServiceItem, VehicleInformation } from "./global/types/vehicle-information";
|
|
20
|
+
export { FormElementMapper, FormFieldParams, FormInputChanges, FormSelectFetcher, LocaleFormKeys, StructureObject } from "./global/types/forms";
|
|
21
|
+
export { FormHook } from "./global/lib/form-hook";
|
|
18
22
|
export { ActiveElement } from "./components/part-lookup/part-lookup";
|
|
19
23
|
export { ActiveElement as ActiveElement1 } from "./components/vehicle-lookup/vehicle-lookup";
|
|
20
24
|
export namespace Components {
|
|
25
|
+
interface ContactUsForm {
|
|
26
|
+
"baseUrl": string;
|
|
27
|
+
"brandId": string;
|
|
28
|
+
"errorCallback": (error: any) => void;
|
|
29
|
+
"language": LanguageKeys;
|
|
30
|
+
"loadingChanges": (loading: boolean) => void;
|
|
31
|
+
"queryString": string;
|
|
32
|
+
"recaptchaKey": string;
|
|
33
|
+
"structure": string;
|
|
34
|
+
"successCallback": (values: any) => void;
|
|
35
|
+
"theme": string;
|
|
36
|
+
}
|
|
21
37
|
interface DeadStockLookup {
|
|
22
38
|
"baseUrl": string;
|
|
23
39
|
"errorCallback": (errorMessage: ErrorKeys) => void;
|
|
@@ -74,16 +90,69 @@ export namespace Components {
|
|
|
74
90
|
}
|
|
75
91
|
interface FormInput {
|
|
76
92
|
"class": string;
|
|
77
|
-
"
|
|
93
|
+
"componentClass": string;
|
|
94
|
+
"componentId": string;
|
|
95
|
+
"defaultValue"?: string;
|
|
78
96
|
"disabled": boolean;
|
|
79
|
-
"errorClass": string;
|
|
80
97
|
"errorMessage": string;
|
|
98
|
+
"formLocaleName": LocaleFormKeys;
|
|
99
|
+
"inputChanges": FormInputChanges;
|
|
100
|
+
"inputPreFix": string;
|
|
81
101
|
"isError": boolean;
|
|
102
|
+
"isRequired": boolean;
|
|
82
103
|
"label": string;
|
|
83
|
-
"
|
|
104
|
+
"language": LanguageKeys;
|
|
84
105
|
"name": string;
|
|
106
|
+
"numberDirection"?: boolean;
|
|
107
|
+
"onChangeMiddleware"?: (event: InputEvent) => InputEvent;
|
|
108
|
+
"placeholder": string;
|
|
109
|
+
"type": string;
|
|
110
|
+
}
|
|
111
|
+
interface FormSelect {
|
|
112
|
+
"componentClass": string;
|
|
113
|
+
"componentId": string;
|
|
114
|
+
"disabled": boolean;
|
|
115
|
+
"errorMessage": string;
|
|
116
|
+
"fetcher": FormSelectFetcher;
|
|
117
|
+
"formLocaleName": string;
|
|
118
|
+
"inputChanges": FormInputChanges;
|
|
119
|
+
"isError": boolean;
|
|
120
|
+
"isRequired": boolean;
|
|
121
|
+
"label": string;
|
|
122
|
+
"language": LanguageKeys;
|
|
123
|
+
"name": string;
|
|
124
|
+
"placeholder": string;
|
|
85
125
|
}
|
|
86
|
-
interface
|
|
126
|
+
interface FormStructure {
|
|
127
|
+
"form": FormHook<any>;
|
|
128
|
+
"formElementMapper": FormElementMapper;
|
|
129
|
+
"formFieldParams": FormFieldParams;
|
|
130
|
+
"isLoading": boolean;
|
|
131
|
+
"language": LanguageKeys;
|
|
132
|
+
"renderControl": {};
|
|
133
|
+
"structureObject": StructureObject;
|
|
134
|
+
}
|
|
135
|
+
interface FormStructureError {
|
|
136
|
+
"language": LanguageKeys;
|
|
137
|
+
}
|
|
138
|
+
interface FormSubmit {
|
|
139
|
+
"isLoading": boolean;
|
|
140
|
+
"params": FormFieldParams;
|
|
141
|
+
"structureElement": StructureObject;
|
|
142
|
+
}
|
|
143
|
+
interface FormTextArea {
|
|
144
|
+
"componentClass": string;
|
|
145
|
+
"componentId": string;
|
|
146
|
+
"disabled": boolean;
|
|
147
|
+
"errorMessage": string;
|
|
148
|
+
"formLocaleName": LocaleFormKeys;
|
|
149
|
+
"inputChanges": FormInputChanges;
|
|
150
|
+
"isError": boolean;
|
|
151
|
+
"isRequired": boolean;
|
|
152
|
+
"label": string;
|
|
153
|
+
"language": LanguageKeys;
|
|
154
|
+
"name": string;
|
|
155
|
+
"placeholder": string;
|
|
87
156
|
}
|
|
88
157
|
interface ManufacturerLookup {
|
|
89
158
|
"baseUrl": string;
|
|
@@ -210,11 +279,13 @@ export namespace Components {
|
|
|
210
279
|
"userId"?: string;
|
|
211
280
|
}
|
|
212
281
|
}
|
|
213
|
-
export interface FormInputCustomEvent<T> extends CustomEvent<T> {
|
|
214
|
-
detail: T;
|
|
215
|
-
target: HTMLFormInputElement;
|
|
216
|
-
}
|
|
217
282
|
declare global {
|
|
283
|
+
interface HTMLContactUsFormElement extends Components.ContactUsForm, HTMLStencilElement {
|
|
284
|
+
}
|
|
285
|
+
var HTMLContactUsFormElement: {
|
|
286
|
+
prototype: HTMLContactUsFormElement;
|
|
287
|
+
new (): HTMLContactUsFormElement;
|
|
288
|
+
};
|
|
218
289
|
interface HTMLDeadStockLookupElement extends Components.DeadStockLookup, HTMLStencilElement {
|
|
219
290
|
}
|
|
220
291
|
var HTMLDeadStockLookupElement: {
|
|
@@ -239,28 +310,41 @@ declare global {
|
|
|
239
310
|
prototype: HTMLDynamicRedeemElement;
|
|
240
311
|
new (): HTMLDynamicRedeemElement;
|
|
241
312
|
};
|
|
242
|
-
interface HTMLFormInputElementEventMap {
|
|
243
|
-
"onInput": any;
|
|
244
|
-
}
|
|
245
313
|
interface HTMLFormInputElement extends Components.FormInput, HTMLStencilElement {
|
|
246
|
-
addEventListener<K extends keyof HTMLFormInputElementEventMap>(type: K, listener: (this: HTMLFormInputElement, ev: FormInputCustomEvent<HTMLFormInputElementEventMap[K]>) => any, options?: boolean | AddEventListenerOptions): void;
|
|
247
|
-
addEventListener<K extends keyof DocumentEventMap>(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
|
|
248
|
-
addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
|
|
249
|
-
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
|
|
250
|
-
removeEventListener<K extends keyof HTMLFormInputElementEventMap>(type: K, listener: (this: HTMLFormInputElement, ev: FormInputCustomEvent<HTMLFormInputElementEventMap[K]>) => any, options?: boolean | EventListenerOptions): void;
|
|
251
|
-
removeEventListener<K extends keyof DocumentEventMap>(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
|
|
252
|
-
removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
|
|
253
|
-
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
|
254
314
|
}
|
|
255
315
|
var HTMLFormInputElement: {
|
|
256
316
|
prototype: HTMLFormInputElement;
|
|
257
317
|
new (): HTMLFormInputElement;
|
|
258
318
|
};
|
|
259
|
-
interface
|
|
319
|
+
interface HTMLFormSelectElement extends Components.FormSelect, HTMLStencilElement {
|
|
320
|
+
}
|
|
321
|
+
var HTMLFormSelectElement: {
|
|
322
|
+
prototype: HTMLFormSelectElement;
|
|
323
|
+
new (): HTMLFormSelectElement;
|
|
324
|
+
};
|
|
325
|
+
interface HTMLFormStructureElement extends Components.FormStructure, HTMLStencilElement {
|
|
260
326
|
}
|
|
261
|
-
var
|
|
262
|
-
prototype:
|
|
263
|
-
new ():
|
|
327
|
+
var HTMLFormStructureElement: {
|
|
328
|
+
prototype: HTMLFormStructureElement;
|
|
329
|
+
new (): HTMLFormStructureElement;
|
|
330
|
+
};
|
|
331
|
+
interface HTMLFormStructureErrorElement extends Components.FormStructureError, HTMLStencilElement {
|
|
332
|
+
}
|
|
333
|
+
var HTMLFormStructureErrorElement: {
|
|
334
|
+
prototype: HTMLFormStructureErrorElement;
|
|
335
|
+
new (): HTMLFormStructureErrorElement;
|
|
336
|
+
};
|
|
337
|
+
interface HTMLFormSubmitElement extends Components.FormSubmit, HTMLStencilElement {
|
|
338
|
+
}
|
|
339
|
+
var HTMLFormSubmitElement: {
|
|
340
|
+
prototype: HTMLFormSubmitElement;
|
|
341
|
+
new (): HTMLFormSubmitElement;
|
|
342
|
+
};
|
|
343
|
+
interface HTMLFormTextAreaElement extends Components.FormTextArea, HTMLStencilElement {
|
|
344
|
+
}
|
|
345
|
+
var HTMLFormTextAreaElement: {
|
|
346
|
+
prototype: HTMLFormTextAreaElement;
|
|
347
|
+
new (): HTMLFormTextAreaElement;
|
|
264
348
|
};
|
|
265
349
|
interface HTMLManufacturerLookupElement extends Components.ManufacturerLookup, HTMLStencilElement {
|
|
266
350
|
}
|
|
@@ -311,12 +395,17 @@ declare global {
|
|
|
311
395
|
new (): HTMLWarrantyDetailsElement;
|
|
312
396
|
};
|
|
313
397
|
interface HTMLElementTagNameMap {
|
|
398
|
+
"contact-us-form": HTMLContactUsFormElement;
|
|
314
399
|
"dead-stock-lookup": HTMLDeadStockLookupElement;
|
|
315
400
|
"distributor-lookup": HTMLDistributorLookupElement;
|
|
316
401
|
"dynamic-claim": HTMLDynamicClaimElement;
|
|
317
402
|
"dynamic-redeem": HTMLDynamicRedeemElement;
|
|
318
403
|
"form-input": HTMLFormInputElement;
|
|
319
|
-
"
|
|
404
|
+
"form-select": HTMLFormSelectElement;
|
|
405
|
+
"form-structure": HTMLFormStructureElement;
|
|
406
|
+
"form-structure-error": HTMLFormStructureErrorElement;
|
|
407
|
+
"form-submit": HTMLFormSubmitElement;
|
|
408
|
+
"form-text-area": HTMLFormTextAreaElement;
|
|
320
409
|
"manufacturer-lookup": HTMLManufacturerLookupElement;
|
|
321
410
|
"paint-thickness": HTMLPaintThicknessElement;
|
|
322
411
|
"part-lookup": HTMLPartLookupElement;
|
|
@@ -328,6 +417,18 @@ declare global {
|
|
|
328
417
|
}
|
|
329
418
|
}
|
|
330
419
|
declare namespace LocalJSX {
|
|
420
|
+
interface ContactUsForm {
|
|
421
|
+
"baseUrl"?: string;
|
|
422
|
+
"brandId"?: string;
|
|
423
|
+
"errorCallback"?: (error: any) => void;
|
|
424
|
+
"language"?: LanguageKeys;
|
|
425
|
+
"loadingChanges"?: (loading: boolean) => void;
|
|
426
|
+
"queryString"?: string;
|
|
427
|
+
"recaptchaKey"?: string;
|
|
428
|
+
"structure"?: string;
|
|
429
|
+
"successCallback"?: (values: any) => void;
|
|
430
|
+
"theme"?: string;
|
|
431
|
+
}
|
|
331
432
|
interface DeadStockLookup {
|
|
332
433
|
"baseUrl"?: string;
|
|
333
434
|
"errorCallback"?: (errorMessage: ErrorKeys) => void;
|
|
@@ -369,17 +470,69 @@ declare namespace LocalJSX {
|
|
|
369
470
|
}
|
|
370
471
|
interface FormInput {
|
|
371
472
|
"class"?: string;
|
|
372
|
-
"
|
|
473
|
+
"componentClass"?: string;
|
|
474
|
+
"componentId"?: string;
|
|
475
|
+
"defaultValue"?: string;
|
|
373
476
|
"disabled"?: boolean;
|
|
374
|
-
"errorClass"?: string;
|
|
375
477
|
"errorMessage"?: string;
|
|
478
|
+
"formLocaleName"?: LocaleFormKeys;
|
|
479
|
+
"inputChanges"?: FormInputChanges;
|
|
480
|
+
"inputPreFix"?: string;
|
|
376
481
|
"isError"?: boolean;
|
|
482
|
+
"isRequired"?: boolean;
|
|
377
483
|
"label"?: string;
|
|
378
|
-
"
|
|
484
|
+
"language"?: LanguageKeys;
|
|
379
485
|
"name"?: string;
|
|
380
|
-
"
|
|
486
|
+
"numberDirection"?: boolean;
|
|
487
|
+
"onChangeMiddleware"?: (event: InputEvent) => InputEvent;
|
|
488
|
+
"placeholder"?: string;
|
|
489
|
+
"type"?: string;
|
|
490
|
+
}
|
|
491
|
+
interface FormSelect {
|
|
492
|
+
"componentClass"?: string;
|
|
493
|
+
"componentId"?: string;
|
|
494
|
+
"disabled"?: boolean;
|
|
495
|
+
"errorMessage"?: string;
|
|
496
|
+
"fetcher"?: FormSelectFetcher;
|
|
497
|
+
"formLocaleName"?: string;
|
|
498
|
+
"inputChanges"?: FormInputChanges;
|
|
499
|
+
"isError"?: boolean;
|
|
500
|
+
"isRequired"?: boolean;
|
|
501
|
+
"label"?: string;
|
|
502
|
+
"language"?: LanguageKeys;
|
|
503
|
+
"name"?: string;
|
|
504
|
+
"placeholder"?: string;
|
|
505
|
+
}
|
|
506
|
+
interface FormStructure {
|
|
507
|
+
"form"?: FormHook<any>;
|
|
508
|
+
"formElementMapper"?: FormElementMapper;
|
|
509
|
+
"formFieldParams"?: FormFieldParams;
|
|
510
|
+
"isLoading"?: boolean;
|
|
511
|
+
"language"?: LanguageKeys;
|
|
512
|
+
"renderControl"?: {};
|
|
513
|
+
"structureObject"?: StructureObject;
|
|
514
|
+
}
|
|
515
|
+
interface FormStructureError {
|
|
516
|
+
"language"?: LanguageKeys;
|
|
381
517
|
}
|
|
382
|
-
interface
|
|
518
|
+
interface FormSubmit {
|
|
519
|
+
"isLoading"?: boolean;
|
|
520
|
+
"params"?: FormFieldParams;
|
|
521
|
+
"structureElement"?: StructureObject;
|
|
522
|
+
}
|
|
523
|
+
interface FormTextArea {
|
|
524
|
+
"componentClass"?: string;
|
|
525
|
+
"componentId"?: string;
|
|
526
|
+
"disabled"?: boolean;
|
|
527
|
+
"errorMessage"?: string;
|
|
528
|
+
"formLocaleName"?: LocaleFormKeys;
|
|
529
|
+
"inputChanges"?: FormInputChanges;
|
|
530
|
+
"isError"?: boolean;
|
|
531
|
+
"isRequired"?: boolean;
|
|
532
|
+
"label"?: string;
|
|
533
|
+
"language"?: LanguageKeys;
|
|
534
|
+
"name"?: string;
|
|
535
|
+
"placeholder"?: string;
|
|
383
536
|
}
|
|
384
537
|
interface ManufacturerLookup {
|
|
385
538
|
"baseUrl"?: string;
|
|
@@ -478,12 +631,17 @@ declare namespace LocalJSX {
|
|
|
478
631
|
"userId"?: string;
|
|
479
632
|
}
|
|
480
633
|
interface IntrinsicElements {
|
|
634
|
+
"contact-us-form": ContactUsForm;
|
|
481
635
|
"dead-stock-lookup": DeadStockLookup;
|
|
482
636
|
"distributor-lookup": DistributorLookup;
|
|
483
637
|
"dynamic-claim": DynamicClaim;
|
|
484
638
|
"dynamic-redeem": DynamicRedeem;
|
|
485
639
|
"form-input": FormInput;
|
|
486
|
-
"
|
|
640
|
+
"form-select": FormSelect;
|
|
641
|
+
"form-structure": FormStructure;
|
|
642
|
+
"form-structure-error": FormStructureError;
|
|
643
|
+
"form-submit": FormSubmit;
|
|
644
|
+
"form-text-area": FormTextArea;
|
|
487
645
|
"manufacturer-lookup": ManufacturerLookup;
|
|
488
646
|
"paint-thickness": PaintThickness;
|
|
489
647
|
"part-lookup": PartLookup;
|
|
@@ -498,12 +656,17 @@ export { LocalJSX as JSX };
|
|
|
498
656
|
declare module "@stencil/core" {
|
|
499
657
|
export namespace JSX {
|
|
500
658
|
interface IntrinsicElements {
|
|
659
|
+
"contact-us-form": LocalJSX.ContactUsForm & JSXBase.HTMLAttributes<HTMLContactUsFormElement>;
|
|
501
660
|
"dead-stock-lookup": LocalJSX.DeadStockLookup & JSXBase.HTMLAttributes<HTMLDeadStockLookupElement>;
|
|
502
661
|
"distributor-lookup": LocalJSX.DistributorLookup & JSXBase.HTMLAttributes<HTMLDistributorLookupElement>;
|
|
503
662
|
"dynamic-claim": LocalJSX.DynamicClaim & JSXBase.HTMLAttributes<HTMLDynamicClaimElement>;
|
|
504
663
|
"dynamic-redeem": LocalJSX.DynamicRedeem & JSXBase.HTMLAttributes<HTMLDynamicRedeemElement>;
|
|
505
664
|
"form-input": LocalJSX.FormInput & JSXBase.HTMLAttributes<HTMLFormInputElement>;
|
|
506
|
-
"
|
|
665
|
+
"form-select": LocalJSX.FormSelect & JSXBase.HTMLAttributes<HTMLFormSelectElement>;
|
|
666
|
+
"form-structure": LocalJSX.FormStructure & JSXBase.HTMLAttributes<HTMLFormStructureElement>;
|
|
667
|
+
"form-structure-error": LocalJSX.FormStructureError & JSXBase.HTMLAttributes<HTMLFormStructureErrorElement>;
|
|
668
|
+
"form-submit": LocalJSX.FormSubmit & JSXBase.HTMLAttributes<HTMLFormSubmitElement>;
|
|
669
|
+
"form-text-area": LocalJSX.FormTextArea & JSXBase.HTMLAttributes<HTMLFormTextAreaElement>;
|
|
507
670
|
"manufacturer-lookup": LocalJSX.ManufacturerLookup & JSXBase.HTMLAttributes<HTMLManufacturerLookupElement>;
|
|
508
671
|
"paint-thickness": LocalJSX.PaintThickness & JSXBase.HTMLAttributes<HTMLPaintThicknessElement>;
|
|
509
672
|
"part-lookup": LocalJSX.PartLookup & JSXBase.HTMLAttributes<HTMLPartLookupElement>;
|
|
@@ -1,33 +1,5 @@
|
|
|
1
1
|
import { AnyObjectSchema } from 'yup';
|
|
2
|
-
|
|
3
|
-
name: string;
|
|
4
|
-
label: string;
|
|
5
|
-
class: string;
|
|
6
|
-
isError: boolean;
|
|
7
|
-
disabled: boolean;
|
|
8
|
-
labelClass: string;
|
|
9
|
-
errorClass: string;
|
|
10
|
-
errorMessage: string;
|
|
11
|
-
containerClass: string;
|
|
12
|
-
}
|
|
13
|
-
export interface FormHookInterface<T> {
|
|
14
|
-
el: HTMLElement;
|
|
15
|
-
renderControl: {};
|
|
16
|
-
isLoading: boolean;
|
|
17
|
-
formSubmit: (formValues: T) => void;
|
|
18
|
-
}
|
|
19
|
-
type FieldType = 'text';
|
|
20
|
-
type ValidationType = 'onSubmit' | 'always';
|
|
21
|
-
interface Field {
|
|
22
|
-
name: string;
|
|
23
|
-
isError: boolean;
|
|
24
|
-
disabled: boolean;
|
|
25
|
-
errorMessage: string;
|
|
26
|
-
onInput: (event: InputEvent) => void;
|
|
27
|
-
}
|
|
28
|
-
export interface FormStateOptions {
|
|
29
|
-
validationType?: ValidationType;
|
|
30
|
-
}
|
|
2
|
+
import { Field, FieldType, FormHookInterface, FormStateOptions } from "../types/forms";
|
|
31
3
|
export declare class FormHook<T> {
|
|
32
4
|
private isSubmitted;
|
|
33
5
|
private context;
|
|
@@ -51,4 +23,3 @@ export declare class FormHook<T> {
|
|
|
51
23
|
private signal;
|
|
52
24
|
private onChanges;
|
|
53
25
|
}
|
|
54
|
-
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { LanguageKeys } from "../types/locales/index";
|
|
2
|
+
export type Grecaptcha = {
|
|
3
|
+
getResponse(): string;
|
|
4
|
+
reset(widgetId?: number): void;
|
|
5
|
+
ready(callback: () => void): void;
|
|
6
|
+
execute(siteKey: string, options: {
|
|
7
|
+
action: string;
|
|
8
|
+
}): Promise<string>;
|
|
9
|
+
render(container: HTMLElement | string, parameters: {
|
|
10
|
+
'sitekey': string;
|
|
11
|
+
'callback'?: (token: string) => void;
|
|
12
|
+
'error-callback'?: () => void;
|
|
13
|
+
'expired-callback'?: () => void;
|
|
14
|
+
}): number;
|
|
15
|
+
};
|
|
16
|
+
export declare const setupRecaptcha: (recaptchaKey: string, language?: LanguageKeys, callback?: () => void) => void;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { StructureArray, StructureObject } from "../types/forms";
|
|
2
|
+
export declare const formStructureStringExample = "[[\"div.kodo#j7\",\"name.name#name\"], \"div.d3#s2\"]";
|
|
3
|
+
export declare const isValidStructure: (requestedStructure: string | StructureArray) => StructureObject;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { LanguageKeys, Locale } from "./locales/index";
|
|
2
|
+
export interface FormHookInterface<T> {
|
|
3
|
+
locale: Locale;
|
|
4
|
+
el: HTMLElement;
|
|
5
|
+
structure: string;
|
|
6
|
+
renderControl: {};
|
|
7
|
+
isLoading: boolean;
|
|
8
|
+
language: LanguageKeys;
|
|
9
|
+
structureObject: StructureObject;
|
|
10
|
+
formSubmit: (formValues: T) => void;
|
|
11
|
+
}
|
|
12
|
+
export type FormSelectItem = {
|
|
13
|
+
value: string;
|
|
14
|
+
label: string;
|
|
15
|
+
};
|
|
16
|
+
export type FormInputChanges = (event: InputEvent | string) => void;
|
|
17
|
+
export type FormSelectFetcher = (language: string, signal: AbortSignal) => FormSelectItem[];
|
|
18
|
+
export type FieldType = 'text' | 'select' | 'number' | 'text-area';
|
|
19
|
+
export type FormElementMapper = Record<string, FieldType>;
|
|
20
|
+
export type ValidationType = 'onSubmit' | 'always';
|
|
21
|
+
export interface Field {
|
|
22
|
+
name: string;
|
|
23
|
+
isError: boolean;
|
|
24
|
+
disabled: boolean;
|
|
25
|
+
isRequired: boolean;
|
|
26
|
+
fieldType: FieldType;
|
|
27
|
+
errorMessage: string;
|
|
28
|
+
inputChanges: FormInputChanges;
|
|
29
|
+
}
|
|
30
|
+
export type FieldControllers = Record<string, Field>;
|
|
31
|
+
export interface FormStateOptions {
|
|
32
|
+
validationType?: ValidationType;
|
|
33
|
+
}
|
|
34
|
+
type FormElementStructure = {
|
|
35
|
+
id: string;
|
|
36
|
+
class: string;
|
|
37
|
+
children: FormElementStructure[];
|
|
38
|
+
element: '' | 'div' | 'slot' | 'submit' | 'button' | string;
|
|
39
|
+
};
|
|
40
|
+
export type StructureArray = (string | StructureArray)[];
|
|
41
|
+
export type StructureObject = FormElementStructure | null;
|
|
42
|
+
export type LocaleFormKeys = 'contactUs';
|
|
43
|
+
export type Params = {
|
|
44
|
+
[key: string]: any;
|
|
45
|
+
formLocaleName: LocaleFormKeys;
|
|
46
|
+
};
|
|
47
|
+
export type FormFieldParams = Record<string, Params>;
|
|
48
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export type Grecaptcha = {
|
|
2
|
+
getResponse(): string;
|
|
3
|
+
reset(widgetId?: number): void;
|
|
4
|
+
ready(callback: () => void): void;
|
|
5
|
+
execute(siteKey: string, options: {
|
|
6
|
+
action: string;
|
|
7
|
+
}): Promise<string>;
|
|
8
|
+
render(container: HTMLElement | string, parameters: {
|
|
9
|
+
'sitekey': string;
|
|
10
|
+
'callback'?: (token: string) => void;
|
|
11
|
+
'error-callback'?: () => void;
|
|
12
|
+
'expired-callback'?: () => void;
|
|
13
|
+
}): number;
|
|
14
|
+
};
|
|
@@ -4,6 +4,7 @@ export declare const errorsSchema: import("yup").ObjectSchema<{
|
|
|
4
4
|
invalidVin: string;
|
|
5
5
|
noPartsFound: string;
|
|
6
6
|
vinNumberRequired: string;
|
|
7
|
+
wrongFormStructure: string;
|
|
7
8
|
partNumberRequired: string;
|
|
8
9
|
noServiceAvailable: string;
|
|
9
10
|
wrongResponseFormat: string;
|
|
@@ -14,6 +15,7 @@ export declare const errorsSchema: import("yup").ObjectSchema<{
|
|
|
14
15
|
invalidVin: undefined;
|
|
15
16
|
noPartsFound: undefined;
|
|
16
17
|
vinNumberRequired: undefined;
|
|
18
|
+
wrongFormStructure: undefined;
|
|
17
19
|
partNumberRequired: undefined;
|
|
18
20
|
noServiceAvailable: undefined;
|
|
19
21
|
wrongResponseFormat: undefined;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
export declare const contactUsSchema: import("yup").ObjectSchema<{
|
|
2
|
+
fullName: string;
|
|
3
|
+
fullNameMinimum: string;
|
|
4
|
+
fullNameIsRequired: string;
|
|
5
|
+
emailAddress: string;
|
|
6
|
+
emailAddressNotValid: string;
|
|
7
|
+
city: string;
|
|
8
|
+
selectCity: string;
|
|
9
|
+
cityIsRequired: string;
|
|
10
|
+
phoneNumber: string;
|
|
11
|
+
phoneNumberIsRequired: string;
|
|
12
|
+
phoneNumberFormatInvalid: string;
|
|
13
|
+
inquiryType: string;
|
|
14
|
+
selectInquiryType: string;
|
|
15
|
+
inquiryTypeIsRequired: string;
|
|
16
|
+
writeAMessage: string;
|
|
17
|
+
leaveUsMessage: string;
|
|
18
|
+
messageIsRequired: string;
|
|
19
|
+
}, import("yup").AnyObject, {
|
|
20
|
+
fullName: undefined;
|
|
21
|
+
fullNameMinimum: undefined;
|
|
22
|
+
fullNameIsRequired: undefined;
|
|
23
|
+
emailAddress: undefined;
|
|
24
|
+
emailAddressNotValid: undefined;
|
|
25
|
+
city: undefined;
|
|
26
|
+
selectCity: undefined;
|
|
27
|
+
cityIsRequired: undefined;
|
|
28
|
+
phoneNumber: undefined;
|
|
29
|
+
phoneNumberIsRequired: undefined;
|
|
30
|
+
phoneNumberFormatInvalid: undefined;
|
|
31
|
+
inquiryType: undefined;
|
|
32
|
+
selectInquiryType: undefined;
|
|
33
|
+
inquiryTypeIsRequired: undefined;
|
|
34
|
+
writeAMessage: undefined;
|
|
35
|
+
leaveUsMessage: undefined;
|
|
36
|
+
messageIsRequired: undefined;
|
|
37
|
+
}, "">;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
export declare const FormsSchema: import("yup").ObjectSchema<{
|
|
2
|
+
contactUs: {
|
|
3
|
+
fullName?: string;
|
|
4
|
+
fullNameMinimum?: string;
|
|
5
|
+
fullNameIsRequired?: string;
|
|
6
|
+
emailAddress?: string;
|
|
7
|
+
emailAddressNotValid?: string;
|
|
8
|
+
city?: string;
|
|
9
|
+
selectCity?: string;
|
|
10
|
+
cityIsRequired?: string;
|
|
11
|
+
phoneNumber?: string;
|
|
12
|
+
phoneNumberIsRequired?: string;
|
|
13
|
+
phoneNumberFormatInvalid?: string;
|
|
14
|
+
inquiryType?: string;
|
|
15
|
+
selectInquiryType?: string;
|
|
16
|
+
inquiryTypeIsRequired?: string;
|
|
17
|
+
writeAMessage?: string;
|
|
18
|
+
leaveUsMessage?: string;
|
|
19
|
+
messageIsRequired?: string;
|
|
20
|
+
};
|
|
21
|
+
reCaptchaIsRequired: string;
|
|
22
|
+
inputValueIsIncorrect: string;
|
|
23
|
+
}, import("yup").AnyObject, {
|
|
24
|
+
contactUs: {
|
|
25
|
+
fullName: undefined;
|
|
26
|
+
fullNameMinimum: undefined;
|
|
27
|
+
fullNameIsRequired: undefined;
|
|
28
|
+
emailAddress: undefined;
|
|
29
|
+
emailAddressNotValid: undefined;
|
|
30
|
+
city: undefined;
|
|
31
|
+
selectCity: undefined;
|
|
32
|
+
cityIsRequired: undefined;
|
|
33
|
+
phoneNumber: undefined;
|
|
34
|
+
phoneNumberIsRequired: undefined;
|
|
35
|
+
phoneNumberFormatInvalid: undefined;
|
|
36
|
+
inquiryType: undefined;
|
|
37
|
+
selectInquiryType: undefined;
|
|
38
|
+
inquiryTypeIsRequired: undefined;
|
|
39
|
+
writeAMessage: undefined;
|
|
40
|
+
leaveUsMessage: undefined;
|
|
41
|
+
messageIsRequired: undefined;
|
|
42
|
+
};
|
|
43
|
+
reCaptchaIsRequired: undefined;
|
|
44
|
+
inputValueIsIncorrect: undefined;
|
|
45
|
+
}, "">;
|