adp-web-components 0.0.50 → 0.0.52
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 → Loading-bd3bbdba.js} +2 -2
- package/dist/cjs/contact-us-form.cjs.entry.js +93 -5003
- package/dist/cjs/dead-stock-lookup_3.cjs.entry.js +7 -8
- package/dist/cjs/dynamic-claim_6.cjs.entry.js +18 -19
- package/dist/cjs/dynamic-redeem.cjs.entry.js +3 -4
- package/dist/cjs/form-dialog_8.cjs.entry.js +502 -0
- package/dist/cjs/{get-local-language-d31d6c20.js → get-local-language-16ab3d1d.js} +2586 -2
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/part-lookup.cjs.entry.js +2 -3
- package/dist/cjs/service-booking-form.cjs.entry.js +208 -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 -3
- package/dist/collection/collection-manifest.json +3 -1
- package/dist/collection/components/form-elements/form-dialog.css +1 -1
- package/dist/collection/components/form-elements/form-dialog.js +1 -1
- 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/distributor-lookup.js +1 -1
- package/dist/collection/components/part-lookup/manufacturer-lookup.js +1 -1
- 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/manufacturer-lookup.js +1 -1
- package/dist/components/p-0290248e.js +5 -0
- package/dist/components/p-1a03137d.js +5 -0
- package/dist/components/{p-7238850d.js → p-1ee2b770.js} +1 -1
- package/dist/components/p-2ee2e50c.js +5 -0
- package/dist/components/{p-40724fe5.js → p-31c700e3.js} +1 -1
- package/dist/components/{p-a03e7980.js → p-31e785ef.js} +1 -1
- package/dist/components/p-45b46803.js +5 -0
- package/dist/components/p-47bfe3f2.js +5 -0
- package/dist/components/p-48f1632a.js +5 -0
- package/dist/{shift-components/p-fa19695e.js → components/p-4bb1ff53.js} +1 -1
- package/dist/components/{p-92947610.js → p-58c11ee3.js} +1 -1
- package/dist/components/p-59348016.js +5 -0
- package/dist/components/{p-0c8382bd.js → p-5e64dce1.js} +1 -1
- package/dist/components/{p-e84dd0e1.js → p-70b2d76f.js} +1 -1
- package/dist/components/{p-896a1743.js → p-7570edef.js} +1 -1
- package/dist/components/p-78a2e4a3.js +5 -0
- package/dist/components/p-88e47a05.js +5 -0
- package/dist/components/p-932ff922.js +5 -0
- package/dist/components/{p-8bf65def.js → p-a0d7cb3b.js} +1 -1
- package/dist/components/{p-1b22cf00.js → p-f18da100.js} +1 -1
- package/dist/components/p-fb10d3b3.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/{Loading-3fdd028d.js → Loading-0e0128f2.js} +1 -1
- package/dist/esm/contact-us-form.entry.js +92 -5002
- package/dist/esm/dead-stock-lookup_3.entry.js +5 -6
- package/dist/esm/dynamic-claim_6.entry.js +2 -3
- package/dist/esm/dynamic-redeem.entry.js +1 -2
- package/dist/esm/form-dialog_8.entry.js +491 -0
- package/dist/esm/{get-local-language-4167379b.js → get-local-language-7b768590.js} +2586 -3
- package/dist/esm/loader.js +1 -1
- package/dist/esm/part-lookup.entry.js +1 -2
- package/dist/esm/service-booking-form.entry.js +204 -0
- package/dist/esm/shift-components.js +1 -1
- package/dist/esm/urls-e22234f9.js +4870 -0
- package/dist/esm/vehicle-lookup.entry.js +1 -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-16fcb94c.entry.js +5 -0
- package/dist/shift-components/p-22693b71.entry.js +5 -0
- package/dist/shift-components/p-54ed06de.entry.js +5 -0
- package/dist/shift-components/p-635a820a.entry.js +5 -0
- package/dist/shift-components/p-7a9f22c6.js +5 -0
- package/dist/shift-components/p-8b8e58f3.entry.js +5 -0
- package/dist/shift-components/p-8cf903b1.entry.js +5 -0
- package/dist/shift-components/p-932ff922.js +5 -0
- package/dist/shift-components/p-9e786e3f.entry.js +5 -0
- package/dist/{components/p-f99ae672.js → shift-components/p-a6f85fc3.js} +1 -1
- package/dist/shift-components/p-fa985979.entry.js +5 -0
- package/dist/shift-components/shift-components.esm.js +1 -1
- 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 +82 -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/cn-f559f9e5.js +0 -2588
- 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/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-211b8783.js +0 -5
- package/dist/components/p-342c04e7.js +0 -5
- package/dist/components/p-5f7ef1e2.js +0 -5
- package/dist/components/p-92437cb1.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/esm/cn-cc419b94.js +0 -2586
- 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-98d9e7ab.js +0 -5
- package/dist/shift-components/p-d0c9c65a.entry.js +0 -5
- package/dist/shift-components/p-d557c08c.entry.js +0 -5
- package/dist/shift-components/p-e6ec4aa0.entry.js +0 -5
- package/dist/shift-components/p-e9b69720.js +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
|
@@ -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;
|