adp-web-components 0.0.50 → 0.0.53
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/contact-us-form.cjs.entry.js +93 -5002
- package/dist/cjs/dead-stock-lookup_3.cjs.entry.js +11 -9
- package/dist/cjs/dynamic-claim_6.cjs.entry.js +16 -24
- package/dist/cjs/dynamic-redeem.cjs.entry.js +2 -2
- package/dist/cjs/form-dialog_8.cjs.entry.js +503 -0
- package/dist/cjs/{get-local-language-d31d6c20.js → get-local-language-670a5cf3.js} +4 -2
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/loading-spinner.cjs.entry.js +27 -0
- package/dist/cjs/part-lookup.cjs.entry.js +2 -2
- package/dist/cjs/service-booking-form.cjs.entry.js +209 -0
- package/dist/cjs/shift-components.cjs.js +1 -1
- package/dist/cjs/urls-9077b31c.js +4874 -0
- package/dist/cjs/vehicle-lookup.cjs.entry.js +2 -2
- package/dist/collection/collection-manifest.json +4 -1
- package/dist/collection/components/components/loading-spinner.css +1 -0
- package/dist/collection/components/components/loading-spinner.js +47 -0
- package/dist/collection/components/form-elements/form-dialog.css +1 -1
- package/dist/collection/components/form-elements/form-dialog.js +3 -3
- package/dist/collection/components/form-elements/form-input.css +1 -1
- package/dist/collection/components/form-elements/form-input.js +31 -145
- package/dist/collection/components/form-elements/form-select.css +1 -1
- package/dist/collection/components/form-elements/form-select.js +18 -42
- package/dist/collection/components/form-elements/form-shadow-input.css +1 -0
- package/dist/collection/components/form-elements/form-shadow-input.js +100 -0
- package/dist/collection/components/form-elements/form-structure-error.css +1 -1
- package/dist/collection/components/form-elements/form-structure-error.js +1 -1
- package/dist/collection/components/form-elements/form-structure.css +1 -1
- package/dist/collection/components/form-elements/form-structure.js +83 -59
- package/dist/collection/components/form-elements/form-submit.css +1 -1
- package/dist/collection/components/form-elements/form-submit.js +51 -4
- package/dist/collection/components/form-elements/form-text-area.css +1 -1
- package/dist/collection/components/form-elements/form-text-area.js +27 -102
- package/dist/collection/components/forms/contact-us/element-mapper.js +87 -0
- package/dist/collection/components/forms/contact-us/form.css +1 -1
- package/dist/collection/components/forms/contact-us-form.js +39 -72
- package/dist/collection/components/forms/service-booking/element-mapper.js +87 -0
- package/dist/collection/components/forms/service-booking/form.css +1 -0
- package/dist/collection/components/forms/service-booking/validations.js +19 -0
- package/dist/collection/components/forms/service-booking-form.js +280 -0
- package/dist/collection/components/part-lookup/dead-stock-lookup.css +1 -1
- package/dist/collection/components/part-lookup/dead-stock-lookup.js +1 -2
- package/dist/collection/components/part-lookup/distributor-lookup.css +1 -1
- package/dist/collection/components/part-lookup/distributor-lookup.js +3 -2
- package/dist/collection/components/part-lookup/manufacturer-lookup.css +1 -1
- package/dist/collection/components/part-lookup/manufacturer-lookup.js +3 -2
- package/dist/collection/components/part-lookup/part-lookup.css +1 -1
- package/dist/collection/components/vehicle-lookup/dynamic-claim.css +1 -1
- package/dist/collection/components/vehicle-lookup/dynamic-redeem.css +1 -1
- package/dist/collection/components/vehicle-lookup/paint-thickness.css +1 -1
- package/dist/collection/components/vehicle-lookup/paint-thickness.js +3 -4
- package/dist/collection/components/vehicle-lookup/service-history.css +1 -1
- package/dist/collection/components/vehicle-lookup/service-history.js +1 -2
- package/dist/collection/components/vehicle-lookup/vehicle-accessories.css +1 -1
- package/dist/collection/components/vehicle-lookup/vehicle-accessories.js +3 -4
- package/dist/collection/components/vehicle-lookup/vehicle-lookup.css +1 -1
- package/dist/collection/components/vehicle-lookup/vehicle-specification.css +1 -1
- package/dist/collection/components/vehicle-lookup/vehicle-specification.js +1 -2
- package/dist/collection/components/vehicle-lookup/warranty-details.css +1 -1
- package/dist/collection/components/vehicle-lookup/warranty-details.js +1 -2
- package/dist/collection/global/lib/form-hook.js +41 -26
- package/dist/collection/global/types/locales/general.js +2 -0
- package/dist/collection/templates/part-lookup/mock-data.js +2 -2
- package/dist/components/contact-us-form.js +1 -1
- 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-dialog.js +1 -1
- package/dist/components/form-input.js +1 -1
- package/dist/components/form-select.js +1 -1
- package/dist/components/form-shadow-input.d.ts +11 -0
- package/dist/components/form-shadow-input.js +5 -0
- package/dist/components/form-structure-error.js +1 -1
- package/dist/components/form-structure.js +1 -1
- package/dist/components/form-submit.js +1 -1
- package/dist/components/form-text-area.js +1 -1
- package/dist/components/loading-spinner.d.ts +11 -0
- package/dist/components/loading-spinner.js +5 -0
- package/dist/components/manufacturer-lookup.js +1 -1
- package/dist/components/p-10a354a4.js +5 -0
- package/dist/components/p-1a821038.js +5 -0
- package/dist/components/p-24cf2c4a.js +5 -0
- package/dist/components/p-2f919384.js +5 -0
- package/dist/components/p-364a9fae.js +5 -0
- package/dist/components/p-41645fb3.js +5 -0
- package/dist/components/p-627912f1.js +5 -0
- package/dist/components/p-7976dc32.js +5 -0
- package/dist/components/p-84495089.js +5 -0
- package/dist/components/{p-7238850d.js → p-87549098.js} +1 -1
- package/dist/components/p-932ff922.js +5 -0
- package/dist/components/{p-896a1743.js → p-9c830357.js} +1 -1
- package/dist/components/p-af4190de.js +5 -0
- package/dist/components/p-c6cf2b33.js +5 -0
- package/dist/components/p-d32a7325.js +5 -0
- package/dist/components/p-d4278a59.js +5 -0
- package/dist/components/p-deba9887.js +5 -0
- package/dist/components/p-e87189af.js +5 -0
- package/dist/components/p-e9be80b7.js +5 -0
- package/dist/components/p-ef246f76.js +5 -0
- package/dist/components/p-f9161b73.js +5 -0
- package/dist/components/paint-thickness.js +1 -1
- package/dist/components/part-lookup.js +1 -1
- package/dist/components/service-booking-form.d.ts +11 -0
- package/dist/components/service-booking-form.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/contact-us-form.entry.js +92 -5001
- package/dist/esm/dead-stock-lookup_3.entry.js +11 -9
- package/dist/esm/dynamic-claim_6.entry.js +17 -25
- package/dist/esm/dynamic-redeem.entry.js +2 -2
- package/dist/esm/form-dialog_8.entry.js +492 -0
- package/dist/esm/{get-local-language-4167379b.js → get-local-language-b25e6d06.js} +4 -2
- package/dist/esm/loader.js +1 -1
- package/dist/esm/loading-spinner.entry.js +23 -0
- package/dist/esm/part-lookup.entry.js +2 -2
- package/dist/esm/service-booking-form.entry.js +205 -0
- package/dist/esm/shift-components.js +1 -1
- package/dist/esm/urls-e22234f9.js +4870 -0
- package/dist/esm/vehicle-lookup.entry.js +2 -2
- package/dist/locales/ar.json +3 -1
- package/dist/locales/en.json +3 -1
- package/dist/locales/ku.json +3 -1
- package/dist/locales/ru.json +3 -1
- package/dist/shift-components/p-1e863c83.entry.js +5 -0
- package/dist/shift-components/p-23079181.entry.js +5 -0
- package/dist/shift-components/p-35241ddb.entry.js +5 -0
- package/dist/shift-components/p-45693e4e.entry.js +5 -0
- package/dist/shift-components/p-727760ff.entry.js +5 -0
- package/dist/shift-components/{p-d557c08c.entry.js → p-79c484d5.entry.js} +1 -1
- package/dist/shift-components/p-932ff922.js +5 -0
- package/dist/shift-components/p-a064f620.entry.js +5 -0
- package/dist/shift-components/p-a91b818a.entry.js +5 -0
- package/dist/shift-components/p-d1432c6c.entry.js +5 -0
- package/dist/shift-components/{p-e9b69720.js → p-fdce4d7d.js} +1 -1
- package/dist/shift-components/shift-components.esm.js +1 -1
- package/dist/types/components/components/loading-spinner.d.ts +4 -0
- package/dist/types/components/form-elements/form-input.d.ts +5 -10
- package/dist/types/components/form-elements/form-select.d.ts +3 -4
- package/dist/types/components/form-elements/form-shadow-input.d.ts +9 -0
- package/dist/types/components/form-elements/form-structure.d.ts +8 -4
- package/dist/types/components/form-elements/form-submit.d.ts +5 -0
- package/dist/types/components/form-elements/form-text-area.d.ts +5 -8
- package/dist/types/components/forms/contact-us/element-mapper.d.ts +3 -0
- package/dist/types/components/forms/contact-us-form.d.ts +13 -11
- package/dist/types/components/forms/service-booking/element-mapper.d.ts +3 -0
- package/dist/types/components/forms/service-booking/validations.d.ts +26 -0
- package/dist/types/components/forms/service-booking-form.d.ts +32 -0
- package/dist/types/components.d.ts +97 -46
- package/dist/types/global/lib/form-hook.d.ts +17 -4
- package/dist/types/global/types/forms.d.ts +16 -9
- package/dist/types/global/types/general.d.ts +9 -0
- package/dist/types/global/types/locales/general.d.ts +4 -0
- package/dist/types/global/types/locales/index.d.ts +4 -0
- package/package.json +1 -1
- package/dist/cjs/Loading-c3489701.js +0 -16
- package/dist/cjs/form-dialog_5.cjs.entry.js +0 -344
- package/dist/cjs/form-structure_2.cjs.entry.js +0 -98
- package/dist/collection/components/components/Loading.js +0 -10
- package/dist/collection/components/forms/contact-us/mapper.js +0 -12
- package/dist/collection/components/forms/contact-us/params.js +0 -72
- package/dist/components/p-08dbdea7.js +0 -5
- package/dist/components/p-0a90607f.js +0 -5
- package/dist/components/p-0c8382bd.js +0 -5
- package/dist/components/p-1b22cf00.js +0 -5
- package/dist/components/p-211b8783.js +0 -5
- package/dist/components/p-342c04e7.js +0 -5
- package/dist/components/p-40724fe5.js +0 -5
- package/dist/components/p-5f7ef1e2.js +0 -5
- package/dist/components/p-8bf65def.js +0 -5
- package/dist/components/p-92437cb1.js +0 -5
- package/dist/components/p-92947610.js +0 -5
- package/dist/components/p-a03e7980.js +0 -5
- package/dist/components/p-b22497d5.js +0 -5
- package/dist/components/p-d5819993.js +0 -5
- package/dist/components/p-dbef5214.js +0 -5
- package/dist/components/p-e84dd0e1.js +0 -5
- package/dist/components/p-f99ae672.js +0 -5
- package/dist/esm/Loading-3fdd028d.js +0 -14
- package/dist/esm/form-dialog_5.entry.js +0 -336
- package/dist/esm/form-structure_2.entry.js +0 -93
- package/dist/shift-components/p-14cd1066.entry.js +0 -5
- package/dist/shift-components/p-267a7802.entry.js +0 -5
- package/dist/shift-components/p-54249df3.entry.js +0 -5
- package/dist/shift-components/p-5431e57b.entry.js +0 -5
- package/dist/shift-components/p-8d0a4f46.entry.js +0 -5
- package/dist/shift-components/p-d0c9c65a.entry.js +0 -5
- package/dist/shift-components/p-e6ec4aa0.entry.js +0 -5
- package/dist/shift-components/p-fa19695e.js +0 -5
- package/dist/types/components/components/Loading.d.ts +0 -5
- package/dist/types/components/forms/contact-us/mapper.d.ts +0 -2
- package/dist/types/components/forms/contact-us/params.d.ts +0 -2
|
@@ -10,7 +10,8 @@ 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
12
|
import { FormHook } from "./global/lib/form-hook";
|
|
13
|
-
import {
|
|
13
|
+
import { InputParams } from "./global/types/general";
|
|
14
|
+
import { FormElementMapper, FormFieldParams, FormSelectFetcher, LocaleFormKeys, StructureObject } from "./global/types/forms";
|
|
14
15
|
import { ActiveElement } from "./components/part-lookup/part-lookup";
|
|
15
16
|
import { ActiveElement as ActiveElement1 } from "./components/vehicle-lookup/vehicle-lookup";
|
|
16
17
|
export { ErrorKeys, LanguageKeys } from "./global/types/locales/index";
|
|
@@ -18,7 +19,8 @@ export { PartInformation } from "./global/types/part-information";
|
|
|
18
19
|
export { DotNetObjectReference, MockJson } from "./global/types/components";
|
|
19
20
|
export { ServiceItem, VehicleInformation } from "./global/types/vehicle-information";
|
|
20
21
|
export { FormHook } from "./global/lib/form-hook";
|
|
21
|
-
export {
|
|
22
|
+
export { InputParams } from "./global/types/general";
|
|
23
|
+
export { FormElementMapper, FormFieldParams, FormSelectFetcher, LocaleFormKeys, StructureObject } from "./global/types/forms";
|
|
22
24
|
export { ActiveElement } from "./components/part-lookup/part-lookup";
|
|
23
25
|
export { ActiveElement as ActiveElement1 } from "./components/vehicle-lookup/vehicle-lookup";
|
|
24
26
|
export namespace Components {
|
|
@@ -95,74 +97,73 @@ export namespace Components {
|
|
|
95
97
|
}
|
|
96
98
|
interface FormInput {
|
|
97
99
|
"class": string;
|
|
98
|
-
"componentClass": string;
|
|
99
|
-
"componentId": string;
|
|
100
|
-
"defaultValue"?: string;
|
|
101
|
-
"disabled": boolean;
|
|
102
100
|
"errorMessage": string;
|
|
103
101
|
"form": FormHook<any>;
|
|
104
102
|
"formLocaleName": LocaleFormKeys;
|
|
105
|
-
"
|
|
103
|
+
"inputParams": InputParams;
|
|
106
104
|
"inputPreFix": string;
|
|
107
105
|
"isError": boolean;
|
|
108
106
|
"isRequired": boolean;
|
|
109
107
|
"label": string;
|
|
110
108
|
"language": LanguageKeys;
|
|
111
|
-
"name": string;
|
|
112
109
|
"numberDirection"?: boolean;
|
|
113
|
-
"
|
|
114
|
-
"
|
|
115
|
-
"type": string;
|
|
110
|
+
"wrapperClass": string;
|
|
111
|
+
"wrapperId": string;
|
|
116
112
|
}
|
|
117
113
|
interface FormSelect {
|
|
118
|
-
"componentClass": string;
|
|
119
|
-
"componentId": string;
|
|
120
114
|
"disabled": boolean;
|
|
121
115
|
"errorMessage": string;
|
|
122
116
|
"fetcher": FormSelectFetcher;
|
|
123
117
|
"form": FormHook<any>;
|
|
124
118
|
"formLocaleName": string;
|
|
125
|
-
"inputChanges": FormInputChanges;
|
|
126
119
|
"isError": boolean;
|
|
127
120
|
"isRequired": boolean;
|
|
128
121
|
"label": string;
|
|
129
122
|
"language": LanguageKeys;
|
|
130
123
|
"name": string;
|
|
131
124
|
"placeholder": string;
|
|
125
|
+
"wrapperClass": string;
|
|
126
|
+
"wrapperId": string;
|
|
127
|
+
}
|
|
128
|
+
interface FormShadowInput {
|
|
129
|
+
"form": FormHook<any>;
|
|
130
|
+
"name": string;
|
|
131
|
+
"value": string;
|
|
132
132
|
}
|
|
133
133
|
interface FormStructure {
|
|
134
134
|
"errorMessage": string;
|
|
135
135
|
"form": FormHook<any>;
|
|
136
|
-
"formElementMapper": FormElementMapper
|
|
137
|
-
"formFieldParams": FormFieldParams;
|
|
136
|
+
"formElementMapper": FormElementMapper<any>;
|
|
138
137
|
"isLoading": boolean;
|
|
139
138
|
"language": LanguageKeys;
|
|
140
139
|
"renderControl": {};
|
|
141
|
-
"
|
|
140
|
+
"structure": string;
|
|
141
|
+
"theme": string;
|
|
142
|
+
"themes": any;
|
|
142
143
|
}
|
|
143
144
|
interface FormStructureError {
|
|
144
145
|
"language": LanguageKeys;
|
|
145
146
|
}
|
|
146
147
|
interface FormSubmit {
|
|
147
148
|
"isLoading": boolean;
|
|
149
|
+
"language": LanguageKeys;
|
|
148
150
|
"params": FormFieldParams;
|
|
149
151
|
"structureElement": StructureObject;
|
|
150
152
|
}
|
|
151
153
|
interface FormTextArea {
|
|
152
|
-
"componentClass": string;
|
|
153
|
-
"componentId": string;
|
|
154
|
-
"defaultValue"?: string;
|
|
155
|
-
"disabled": boolean;
|
|
156
154
|
"errorMessage": string;
|
|
157
155
|
"form": FormHook<any>;
|
|
158
156
|
"formLocaleName": LocaleFormKeys;
|
|
159
|
-
"
|
|
157
|
+
"inputParams": InputParams;
|
|
160
158
|
"isError": boolean;
|
|
161
159
|
"isRequired": boolean;
|
|
162
160
|
"label": string;
|
|
163
161
|
"language": LanguageKeys;
|
|
164
|
-
"
|
|
165
|
-
"
|
|
162
|
+
"wrapperClass": string;
|
|
163
|
+
"wrapperId": string;
|
|
164
|
+
}
|
|
165
|
+
interface LoadingSpinner {
|
|
166
|
+
"isLoading": boolean;
|
|
166
167
|
}
|
|
167
168
|
interface ManufacturerLookup {
|
|
168
169
|
"baseUrl": string;
|
|
@@ -206,6 +207,18 @@ export namespace Components {
|
|
|
206
207
|
"queryString": string;
|
|
207
208
|
"setBlazorRef": (newBlazorRef: DotNetObjectReference) => Promise<void>;
|
|
208
209
|
}
|
|
210
|
+
interface ServiceBookingForm {
|
|
211
|
+
"baseUrl": string;
|
|
212
|
+
"brandId": string;
|
|
213
|
+
"errorCallback": (error: any) => void;
|
|
214
|
+
"language": LanguageKeys;
|
|
215
|
+
"loadingChanges": (loading: boolean) => void;
|
|
216
|
+
"queryString": string;
|
|
217
|
+
"recaptchaKey": string;
|
|
218
|
+
"structure": string;
|
|
219
|
+
"successCallback": (values: any) => void;
|
|
220
|
+
"theme": string;
|
|
221
|
+
}
|
|
209
222
|
interface ServiceHistory {
|
|
210
223
|
"baseUrl": string;
|
|
211
224
|
"errorCallback": (errorMessage: ErrorKeys) => void;
|
|
@@ -338,6 +351,12 @@ declare global {
|
|
|
338
351
|
prototype: HTMLFormSelectElement;
|
|
339
352
|
new (): HTMLFormSelectElement;
|
|
340
353
|
};
|
|
354
|
+
interface HTMLFormShadowInputElement extends Components.FormShadowInput, HTMLStencilElement {
|
|
355
|
+
}
|
|
356
|
+
var HTMLFormShadowInputElement: {
|
|
357
|
+
prototype: HTMLFormShadowInputElement;
|
|
358
|
+
new (): HTMLFormShadowInputElement;
|
|
359
|
+
};
|
|
341
360
|
interface HTMLFormStructureElement extends Components.FormStructure, HTMLStencilElement {
|
|
342
361
|
}
|
|
343
362
|
var HTMLFormStructureElement: {
|
|
@@ -362,6 +381,12 @@ declare global {
|
|
|
362
381
|
prototype: HTMLFormTextAreaElement;
|
|
363
382
|
new (): HTMLFormTextAreaElement;
|
|
364
383
|
};
|
|
384
|
+
interface HTMLLoadingSpinnerElement extends Components.LoadingSpinner, HTMLStencilElement {
|
|
385
|
+
}
|
|
386
|
+
var HTMLLoadingSpinnerElement: {
|
|
387
|
+
prototype: HTMLLoadingSpinnerElement;
|
|
388
|
+
new (): HTMLLoadingSpinnerElement;
|
|
389
|
+
};
|
|
365
390
|
interface HTMLManufacturerLookupElement extends Components.ManufacturerLookup, HTMLStencilElement {
|
|
366
391
|
}
|
|
367
392
|
var HTMLManufacturerLookupElement: {
|
|
@@ -380,6 +405,12 @@ declare global {
|
|
|
380
405
|
prototype: HTMLPartLookupElement;
|
|
381
406
|
new (): HTMLPartLookupElement;
|
|
382
407
|
};
|
|
408
|
+
interface HTMLServiceBookingFormElement extends Components.ServiceBookingForm, HTMLStencilElement {
|
|
409
|
+
}
|
|
410
|
+
var HTMLServiceBookingFormElement: {
|
|
411
|
+
prototype: HTMLServiceBookingFormElement;
|
|
412
|
+
new (): HTMLServiceBookingFormElement;
|
|
413
|
+
};
|
|
383
414
|
interface HTMLServiceHistoryElement extends Components.ServiceHistory, HTMLStencilElement {
|
|
384
415
|
}
|
|
385
416
|
var HTMLServiceHistoryElement: {
|
|
@@ -419,13 +450,16 @@ declare global {
|
|
|
419
450
|
"form-dialog": HTMLFormDialogElement;
|
|
420
451
|
"form-input": HTMLFormInputElement;
|
|
421
452
|
"form-select": HTMLFormSelectElement;
|
|
453
|
+
"form-shadow-input": HTMLFormShadowInputElement;
|
|
422
454
|
"form-structure": HTMLFormStructureElement;
|
|
423
455
|
"form-structure-error": HTMLFormStructureErrorElement;
|
|
424
456
|
"form-submit": HTMLFormSubmitElement;
|
|
425
457
|
"form-text-area": HTMLFormTextAreaElement;
|
|
458
|
+
"loading-spinner": HTMLLoadingSpinnerElement;
|
|
426
459
|
"manufacturer-lookup": HTMLManufacturerLookupElement;
|
|
427
460
|
"paint-thickness": HTMLPaintThicknessElement;
|
|
428
461
|
"part-lookup": HTMLPartLookupElement;
|
|
462
|
+
"service-booking-form": HTMLServiceBookingFormElement;
|
|
429
463
|
"service-history": HTMLServiceHistoryElement;
|
|
430
464
|
"vehicle-accessories": HTMLVehicleAccessoriesElement;
|
|
431
465
|
"vehicle-lookup": HTMLVehicleLookupElement;
|
|
@@ -492,74 +526,73 @@ declare namespace LocalJSX {
|
|
|
492
526
|
}
|
|
493
527
|
interface FormInput {
|
|
494
528
|
"class"?: string;
|
|
495
|
-
"componentClass"?: string;
|
|
496
|
-
"componentId"?: string;
|
|
497
|
-
"defaultValue"?: string;
|
|
498
|
-
"disabled"?: boolean;
|
|
499
529
|
"errorMessage"?: string;
|
|
500
530
|
"form"?: FormHook<any>;
|
|
501
531
|
"formLocaleName"?: LocaleFormKeys;
|
|
502
|
-
"
|
|
532
|
+
"inputParams"?: InputParams;
|
|
503
533
|
"inputPreFix"?: string;
|
|
504
534
|
"isError"?: boolean;
|
|
505
535
|
"isRequired"?: boolean;
|
|
506
536
|
"label"?: string;
|
|
507
537
|
"language"?: LanguageKeys;
|
|
508
|
-
"name"?: string;
|
|
509
538
|
"numberDirection"?: boolean;
|
|
510
|
-
"
|
|
511
|
-
"
|
|
512
|
-
"type"?: string;
|
|
539
|
+
"wrapperClass"?: string;
|
|
540
|
+
"wrapperId"?: string;
|
|
513
541
|
}
|
|
514
542
|
interface FormSelect {
|
|
515
|
-
"componentClass"?: string;
|
|
516
|
-
"componentId"?: string;
|
|
517
543
|
"disabled"?: boolean;
|
|
518
544
|
"errorMessage"?: string;
|
|
519
545
|
"fetcher"?: FormSelectFetcher;
|
|
520
546
|
"form"?: FormHook<any>;
|
|
521
547
|
"formLocaleName"?: string;
|
|
522
|
-
"inputChanges"?: FormInputChanges;
|
|
523
548
|
"isError"?: boolean;
|
|
524
549
|
"isRequired"?: boolean;
|
|
525
550
|
"label"?: string;
|
|
526
551
|
"language"?: LanguageKeys;
|
|
527
552
|
"name"?: string;
|
|
528
553
|
"placeholder"?: string;
|
|
554
|
+
"wrapperClass"?: string;
|
|
555
|
+
"wrapperId"?: string;
|
|
556
|
+
}
|
|
557
|
+
interface FormShadowInput {
|
|
558
|
+
"form"?: FormHook<any>;
|
|
559
|
+
"name"?: string;
|
|
560
|
+
"value"?: string;
|
|
529
561
|
}
|
|
530
562
|
interface FormStructure {
|
|
531
563
|
"errorMessage"?: string;
|
|
532
564
|
"form"?: FormHook<any>;
|
|
533
|
-
"formElementMapper"?: FormElementMapper
|
|
534
|
-
"formFieldParams"?: FormFieldParams;
|
|
565
|
+
"formElementMapper"?: FormElementMapper<any>;
|
|
535
566
|
"isLoading"?: boolean;
|
|
536
567
|
"language"?: LanguageKeys;
|
|
537
568
|
"renderControl"?: {};
|
|
538
|
-
"
|
|
569
|
+
"structure"?: string;
|
|
570
|
+
"theme"?: string;
|
|
571
|
+
"themes"?: any;
|
|
539
572
|
}
|
|
540
573
|
interface FormStructureError {
|
|
541
574
|
"language"?: LanguageKeys;
|
|
542
575
|
}
|
|
543
576
|
interface FormSubmit {
|
|
544
577
|
"isLoading"?: boolean;
|
|
578
|
+
"language"?: LanguageKeys;
|
|
545
579
|
"params"?: FormFieldParams;
|
|
546
580
|
"structureElement"?: StructureObject;
|
|
547
581
|
}
|
|
548
582
|
interface FormTextArea {
|
|
549
|
-
"componentClass"?: string;
|
|
550
|
-
"componentId"?: string;
|
|
551
|
-
"defaultValue"?: string;
|
|
552
|
-
"disabled"?: boolean;
|
|
553
583
|
"errorMessage"?: string;
|
|
554
584
|
"form"?: FormHook<any>;
|
|
555
585
|
"formLocaleName"?: LocaleFormKeys;
|
|
556
|
-
"
|
|
586
|
+
"inputParams"?: InputParams;
|
|
557
587
|
"isError"?: boolean;
|
|
558
588
|
"isRequired"?: boolean;
|
|
559
589
|
"label"?: string;
|
|
560
590
|
"language"?: LanguageKeys;
|
|
561
|
-
"
|
|
562
|
-
"
|
|
591
|
+
"wrapperClass"?: string;
|
|
592
|
+
"wrapperId"?: string;
|
|
593
|
+
}
|
|
594
|
+
interface LoadingSpinner {
|
|
595
|
+
"isLoading"?: boolean;
|
|
563
596
|
}
|
|
564
597
|
interface ManufacturerLookup {
|
|
565
598
|
"baseUrl"?: string;
|
|
@@ -593,6 +626,18 @@ declare namespace LocalJSX {
|
|
|
593
626
|
"loadingStateChanged"?: (isLoading: boolean) => void;
|
|
594
627
|
"queryString"?: string;
|
|
595
628
|
}
|
|
629
|
+
interface ServiceBookingForm {
|
|
630
|
+
"baseUrl"?: string;
|
|
631
|
+
"brandId"?: string;
|
|
632
|
+
"errorCallback"?: (error: any) => void;
|
|
633
|
+
"language"?: LanguageKeys;
|
|
634
|
+
"loadingChanges"?: (loading: boolean) => void;
|
|
635
|
+
"queryString"?: string;
|
|
636
|
+
"recaptchaKey"?: string;
|
|
637
|
+
"structure"?: string;
|
|
638
|
+
"successCallback"?: (values: any) => void;
|
|
639
|
+
"theme"?: string;
|
|
640
|
+
}
|
|
596
641
|
interface ServiceHistory {
|
|
597
642
|
"baseUrl"?: string;
|
|
598
643
|
"errorCallback"?: (errorMessage: ErrorKeys) => void;
|
|
@@ -666,13 +711,16 @@ declare namespace LocalJSX {
|
|
|
666
711
|
"form-dialog": FormDialog;
|
|
667
712
|
"form-input": FormInput;
|
|
668
713
|
"form-select": FormSelect;
|
|
714
|
+
"form-shadow-input": FormShadowInput;
|
|
669
715
|
"form-structure": FormStructure;
|
|
670
716
|
"form-structure-error": FormStructureError;
|
|
671
717
|
"form-submit": FormSubmit;
|
|
672
718
|
"form-text-area": FormTextArea;
|
|
719
|
+
"loading-spinner": LoadingSpinner;
|
|
673
720
|
"manufacturer-lookup": ManufacturerLookup;
|
|
674
721
|
"paint-thickness": PaintThickness;
|
|
675
722
|
"part-lookup": PartLookup;
|
|
723
|
+
"service-booking-form": ServiceBookingForm;
|
|
676
724
|
"service-history": ServiceHistory;
|
|
677
725
|
"vehicle-accessories": VehicleAccessories;
|
|
678
726
|
"vehicle-lookup": VehicleLookup;
|
|
@@ -692,13 +740,16 @@ declare module "@stencil/core" {
|
|
|
692
740
|
"form-dialog": LocalJSX.FormDialog & JSXBase.HTMLAttributes<HTMLFormDialogElement>;
|
|
693
741
|
"form-input": LocalJSX.FormInput & JSXBase.HTMLAttributes<HTMLFormInputElement>;
|
|
694
742
|
"form-select": LocalJSX.FormSelect & JSXBase.HTMLAttributes<HTMLFormSelectElement>;
|
|
743
|
+
"form-shadow-input": LocalJSX.FormShadowInput & JSXBase.HTMLAttributes<HTMLFormShadowInputElement>;
|
|
695
744
|
"form-structure": LocalJSX.FormStructure & JSXBase.HTMLAttributes<HTMLFormStructureElement>;
|
|
696
745
|
"form-structure-error": LocalJSX.FormStructureError & JSXBase.HTMLAttributes<HTMLFormStructureErrorElement>;
|
|
697
746
|
"form-submit": LocalJSX.FormSubmit & JSXBase.HTMLAttributes<HTMLFormSubmitElement>;
|
|
698
747
|
"form-text-area": LocalJSX.FormTextArea & JSXBase.HTMLAttributes<HTMLFormTextAreaElement>;
|
|
748
|
+
"loading-spinner": LocalJSX.LoadingSpinner & JSXBase.HTMLAttributes<HTMLLoadingSpinnerElement>;
|
|
699
749
|
"manufacturer-lookup": LocalJSX.ManufacturerLookup & JSXBase.HTMLAttributes<HTMLManufacturerLookupElement>;
|
|
700
750
|
"paint-thickness": LocalJSX.PaintThickness & JSXBase.HTMLAttributes<HTMLPaintThicknessElement>;
|
|
701
751
|
"part-lookup": LocalJSX.PartLookup & JSXBase.HTMLAttributes<HTMLPartLookupElement>;
|
|
752
|
+
"service-booking-form": LocalJSX.ServiceBookingForm & JSXBase.HTMLAttributes<HTMLServiceBookingFormElement>;
|
|
702
753
|
"service-history": LocalJSX.ServiceHistory & JSXBase.HTMLAttributes<HTMLServiceHistoryElement>;
|
|
703
754
|
"vehicle-accessories": LocalJSX.VehicleAccessories & JSXBase.HTMLAttributes<HTMLVehicleAccessoriesElement>;
|
|
704
755
|
"vehicle-lookup": LocalJSX.VehicleLookup & JSXBase.HTMLAttributes<HTMLVehicleLookupElement>;
|
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import { AnyObjectSchema } from 'yup';
|
|
2
|
-
import { Field,
|
|
2
|
+
import { Field, FormElement, FormHookInterface, FormStateOptions } from "../types/forms";
|
|
3
3
|
export declare class FormHook<T> {
|
|
4
|
+
successAnimation: () => void;
|
|
4
5
|
private isSubmitted;
|
|
6
|
+
private cachedValues;
|
|
5
7
|
private subscribers;
|
|
6
8
|
private context;
|
|
7
9
|
private schemaObject;
|
|
8
10
|
private haltValidation;
|
|
11
|
+
private onValuesUpdate;
|
|
9
12
|
private validationType;
|
|
10
13
|
private subscribedFields;
|
|
11
14
|
formErrors: {
|
|
@@ -13,22 +16,32 @@ export declare class FormHook<T> {
|
|
|
13
16
|
};
|
|
14
17
|
formController: any;
|
|
15
18
|
constructor(context: FormHookInterface<T>, schemaObject: AnyObjectSchema, formStateOptions?: FormStateOptions);
|
|
19
|
+
setSuccessAnimation: (newSuccessAnimation: typeof this.successAnimation) => () => void;
|
|
16
20
|
subscribe: (formName: string, formElement: FormElement) => number;
|
|
17
21
|
unsubscribe: (formName: string) => {
|
|
18
22
|
name: string;
|
|
19
23
|
context: FormElement;
|
|
20
24
|
}[];
|
|
21
25
|
reset(): void;
|
|
26
|
+
onInput: (event: Event) => void;
|
|
22
27
|
resetFormErrorMessage: () => string;
|
|
23
28
|
getFormErrors: () => {
|
|
24
29
|
[key: string]: string;
|
|
25
30
|
};
|
|
26
|
-
|
|
31
|
+
setCachedValues: (newValues: Partial<T>) => void;
|
|
32
|
+
getValues: () => Partial<T> & {
|
|
27
33
|
[k: string]: FormDataEntryValue;
|
|
28
34
|
};
|
|
29
35
|
private focusFirstInput;
|
|
30
36
|
onSubmit: (formEvent: SubmitEvent) => void;
|
|
31
|
-
|
|
37
|
+
getInputState: (name: string) => Field;
|
|
32
38
|
private signal;
|
|
33
|
-
|
|
39
|
+
validateInput: (name: string) => {
|
|
40
|
+
isError: boolean;
|
|
41
|
+
errorMessage: any;
|
|
42
|
+
};
|
|
43
|
+
validateForm: (name: string, value: string, strict?: boolean) => {
|
|
44
|
+
isError: boolean;
|
|
45
|
+
errorMessage: any;
|
|
46
|
+
};
|
|
34
47
|
}
|
|
@@ -1,32 +1,28 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { JSX } from '../../stencil-public-runtime';
|
|
2
|
+
import { LanguageKeys } from "./locales/index";
|
|
3
|
+
import { FormHook } from "../lib/form-hook";
|
|
2
4
|
export interface FormHookInterface<T> {
|
|
3
|
-
locale: Locale;
|
|
4
5
|
el: HTMLElement;
|
|
5
6
|
structure: string;
|
|
6
7
|
renderControl: {};
|
|
7
8
|
isLoading: boolean;
|
|
8
9
|
errorMessage: string;
|
|
9
10
|
language: LanguageKeys;
|
|
10
|
-
structureObject: StructureObject;
|
|
11
11
|
formSubmit: (formValues: T) => void;
|
|
12
12
|
}
|
|
13
13
|
export type FormSelectItem = {
|
|
14
14
|
value: string;
|
|
15
15
|
label: string;
|
|
16
16
|
};
|
|
17
|
-
export type
|
|
18
|
-
export type FormSelectFetcher = (language: string, signal: AbortSignal) => FormSelectItem[];
|
|
19
|
-
export type FieldType = 'text' | 'select' | 'number' | 'text-area';
|
|
20
|
-
export type FormElementMapper = Record<string, FieldType>;
|
|
17
|
+
export type FormSelectFetcher = (language: string, signal: AbortSignal) => Promise<FormSelectItem[]>;
|
|
21
18
|
export type ValidationType = 'onSubmit' | 'always';
|
|
22
19
|
export interface Field {
|
|
23
20
|
name: string;
|
|
24
21
|
isError: boolean;
|
|
25
22
|
disabled: boolean;
|
|
26
23
|
isRequired: boolean;
|
|
27
|
-
fieldType: FieldType;
|
|
28
24
|
errorMessage: string;
|
|
29
|
-
|
|
25
|
+
continuousValidation: boolean;
|
|
30
26
|
}
|
|
31
27
|
export type FieldControllers = Record<string, Field>;
|
|
32
28
|
export interface FormStateOptions {
|
|
@@ -53,4 +49,15 @@ export type Subscribers = {
|
|
|
53
49
|
name: string;
|
|
54
50
|
context: FormElement;
|
|
55
51
|
}[];
|
|
52
|
+
type FormElementMapperFunction = (ElementContext: {
|
|
53
|
+
form: FormHook<any>;
|
|
54
|
+
isLoading: boolean;
|
|
55
|
+
structureElement: StructureObject;
|
|
56
|
+
language: LanguageKeys;
|
|
57
|
+
}) => JSX.Element;
|
|
58
|
+
export type FormElementMapper<T> = {
|
|
59
|
+
[K in keyof T]: FormElementMapperFunction;
|
|
60
|
+
} & {
|
|
61
|
+
submit: FormElementMapperFunction;
|
|
62
|
+
};
|
|
56
63
|
export {};
|
|
@@ -12,3 +12,12 @@ export type Grecaptcha = {
|
|
|
12
12
|
'expired-callback'?: () => void;
|
|
13
13
|
}): number;
|
|
14
14
|
};
|
|
15
|
+
export type InputParams = {
|
|
16
|
+
id?: string;
|
|
17
|
+
name: string;
|
|
18
|
+
type?: string;
|
|
19
|
+
disabled?: boolean;
|
|
20
|
+
placeholder?: string;
|
|
21
|
+
defaultValue?: string;
|
|
22
|
+
onInput?: (event: InputEvent) => void;
|
|
23
|
+
};
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
export declare const generalSchema: import("yup").ObjectSchema<{
|
|
2
2
|
close: string;
|
|
3
|
+
submit: string;
|
|
3
4
|
noSelectOptions: string;
|
|
5
|
+
formSubmittedSuccessfully: string;
|
|
4
6
|
}, import("yup").AnyObject, {
|
|
5
7
|
close: undefined;
|
|
8
|
+
submit: undefined;
|
|
6
9
|
noSelectOptions: undefined;
|
|
10
|
+
formSubmittedSuccessfully: undefined;
|
|
7
11
|
}, "">;
|
|
@@ -49,7 +49,9 @@ export declare const localeSchema: import("yup").ObjectSchema<{
|
|
|
49
49
|
};
|
|
50
50
|
general: {
|
|
51
51
|
close?: string;
|
|
52
|
+
submit?: string;
|
|
52
53
|
noSelectOptions?: string;
|
|
54
|
+
formSubmittedSuccessfully?: string;
|
|
53
55
|
};
|
|
54
56
|
lang: string;
|
|
55
57
|
noData: string;
|
|
@@ -229,7 +231,9 @@ export declare const localeSchema: import("yup").ObjectSchema<{
|
|
|
229
231
|
};
|
|
230
232
|
general: {
|
|
231
233
|
close: undefined;
|
|
234
|
+
submit: undefined;
|
|
232
235
|
noSelectOptions: undefined;
|
|
236
|
+
formSubmittedSuccessfully: undefined;
|
|
233
237
|
};
|
|
234
238
|
lang: undefined;
|
|
235
239
|
noData: undefined;
|
package/package.json
CHANGED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Built by ShiftSoftware
|
|
3
|
-
* Copyright (c)
|
|
4
|
-
*/
|
|
5
|
-
'use strict';
|
|
6
|
-
|
|
7
|
-
const index = require('./index-603d8f32.js');
|
|
8
|
-
const loader = require('./loader-baf2418b.js');
|
|
9
|
-
const cn = require('./cn-f559f9e5.js');
|
|
10
|
-
|
|
11
|
-
function Loading({ isLoading }) {
|
|
12
|
-
return (index.h("div", { class: cn.cn('size-full transition-all z-50 duration-100 flex items-center justify-center pointer-events-none absolute ', { 'opacity-0': !isLoading }) },
|
|
13
|
-
index.h("img", { class: "animate-spin-2s size-[40px]", src: loader.loaderSvg })));
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
exports.Loading = Loading;
|