pdap-design-system 3.1.0-beta.1 → 3.1.0-beta.11
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/components/Form/PdapForm.vue.d.ts +3 -0
- package/dist/components/FormV2/PdapFormV2.vue.d.ts +65 -0
- package/dist/components/FormV2/index.d.ts +1 -0
- package/dist/components/FormV2/types.d.ts +40 -0
- package/dist/components/FormV2/util.d.ts +5 -0
- package/dist/components/InputCheckbox/PdapInputCheckbox.vue.d.ts +20 -0
- package/dist/components/InputCheckbox/index.d.ts +1 -0
- package/dist/components/InputCheckbox/types.d.ts +6 -0
- package/dist/components/InputPassword/PdapInputPassword.vue.d.ts +20 -0
- package/dist/components/InputPassword/index.d.ts +1 -0
- package/dist/components/InputSelect/PdapInputSelect.vue.d.ts +34 -0
- package/dist/components/InputSelect/index.d.ts +1 -0
- package/dist/components/InputSelect/types.d.ts +11 -0
- package/dist/components/InputText/PdapInputText.vue.d.ts +20 -0
- package/dist/components/InputText/index.d.ts +1 -0
- package/dist/components/InputText/types.d.ts +6 -0
- package/dist/components/InputTextArea/PdapInputTextArea.vue.d.ts +34 -0
- package/dist/components/InputTextArea/index.d.ts +1 -0
- package/dist/components/InputTextArea/types.d.ts +6 -0
- package/dist/components/index.d.ts +6 -0
- package/dist/demo/pages/FormV2Demo.vue.d.ts +2 -0
- package/dist/index.cjs +7 -7
- package/dist/index.d.ts +4 -1
- package/dist/index.js +2280 -1774
- package/dist/styles.css +1 -1
- package/docs/components.md +1 -0
- package/package.json +1 -1
@@ -4,6 +4,9 @@ import { PdapFormProps } from './types';
|
|
4
4
|
* The `Form` component is powerful. All you need to do is pass a few props, and the component will generate inputs and render them in the UI, complete with customizable form validation and both form-level and input-level error states.
|
5
5
|
*
|
6
6
|
*
|
7
|
+
* @deprecated use FormV2 with the PdapInputCheckbox, ...Text, and ...Password components instead
|
8
|
+
*
|
9
|
+
*
|
7
10
|
* ## Props
|
8
11
|
* @prop {string | undefined | null} error Error state. Only a non-falsy string results in a form-level error being displayed
|
9
12
|
* @prop {string} id Passed through to the `form` element as its `id`
|
@@ -0,0 +1,65 @@
|
|
1
|
+
import { PdapFormPropsV2 } from './types';
|
2
|
+
declare const values: import("vue").Ref<Record<PropertyKey, unknown>>;
|
3
|
+
declare function setValues(val: Partial<typeof values.value>): void;
|
4
|
+
declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<PdapFormPropsV2>, {
|
5
|
+
error: null;
|
6
|
+
}>, {
|
7
|
+
setValues: typeof setValues;
|
8
|
+
v$: import("vue").Ref<import("@vuelidate/core").Validation<Record<string, {
|
9
|
+
[x: string]: import("@vuelidate/core").ValidationRuleWithParams<{
|
10
|
+
max: number;
|
11
|
+
}, any> | import("@vuelidate/core").ValidationRuleWithParams<{
|
12
|
+
min: number;
|
13
|
+
}, any>;
|
14
|
+
} | {
|
15
|
+
[x: string]: import("@vuelidate/core").ValidationRuleWithParams<object, any>;
|
16
|
+
} | {
|
17
|
+
required: import("@vuelidate/core").ValidationRuleWithoutParams<any>;
|
18
|
+
} | {
|
19
|
+
required: import("@vuelidate/core").ValidationRuleWithParams<object, any>;
|
20
|
+
} | {
|
21
|
+
email: import("@vuelidate/core").ValidationRuleWithoutParams<any>;
|
22
|
+
} | {
|
23
|
+
email: import("@vuelidate/core").ValidationRuleWithParams<object, any>;
|
24
|
+
} | {
|
25
|
+
password: any;
|
26
|
+
}>, Record<PropertyKey, unknown>>>;
|
27
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
28
|
+
change: (...args: any[]) => void;
|
29
|
+
error: (...args: any[]) => void;
|
30
|
+
submit: (...args: any[]) => void;
|
31
|
+
}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<PdapFormPropsV2>, {
|
32
|
+
error: null;
|
33
|
+
}>>> & {
|
34
|
+
onChange?: ((...args: any[]) => any) | undefined;
|
35
|
+
onSubmit?: ((...args: any[]) => any) | undefined;
|
36
|
+
onError?: ((...args: any[]) => any) | undefined;
|
37
|
+
}, {
|
38
|
+
error: string | null;
|
39
|
+
}, {}>, {
|
40
|
+
error?(_: {}): any;
|
41
|
+
default?(_: {}): any;
|
42
|
+
}>;
|
43
|
+
export default _default;
|
44
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
45
|
+
type __VLS_TypePropsToRuntimeProps<T> = {
|
46
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
47
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
48
|
+
} : {
|
49
|
+
type: import('vue').PropType<T[K]>;
|
50
|
+
required: true;
|
51
|
+
};
|
52
|
+
};
|
53
|
+
type __VLS_WithDefaults<P, D> = {
|
54
|
+
[K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
|
55
|
+
default: D[K];
|
56
|
+
}> : P[K];
|
57
|
+
};
|
58
|
+
type __VLS_Prettify<T> = {
|
59
|
+
[K in keyof T]: T[K];
|
60
|
+
} & {};
|
61
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
62
|
+
new (): {
|
63
|
+
$slots: S;
|
64
|
+
};
|
65
|
+
};
|
@@ -0,0 +1 @@
|
|
1
|
+
export { default as FormV2 } from './PdapFormV2.vue';
|
@@ -0,0 +1,40 @@
|
|
1
|
+
import useVuelidate from '@vuelidate/core';
|
2
|
+
import { makeRules } from './util';
|
3
|
+
import { Ref } from 'vue';
|
4
|
+
export interface PdapFormValidatorV2<T> {
|
5
|
+
message?: string;
|
6
|
+
value: T;
|
7
|
+
}
|
8
|
+
/**
|
9
|
+
* Keyed by currently used validators.
|
10
|
+
* Add any Vuelidate validators or custom ones here as we need them.
|
11
|
+
* See https://vuelidate-next.netlify.app/validators.html#using-builtin-validators for more.
|
12
|
+
*
|
13
|
+
*/
|
14
|
+
export interface PdapFormValidatorsV2 {
|
15
|
+
maxLength: PdapFormValidatorV2<number>;
|
16
|
+
minLength: PdapFormValidatorV2<number>;
|
17
|
+
required: PdapFormValidatorV2<boolean>;
|
18
|
+
email: PdapFormValidatorV2<boolean>;
|
19
|
+
password: PdapFormValidatorV2<boolean>;
|
20
|
+
}
|
21
|
+
export type ValidationSchemaV2 = {
|
22
|
+
name: string;
|
23
|
+
validators: Partial<PdapFormValidatorsV2>;
|
24
|
+
}[];
|
25
|
+
/**
|
26
|
+
* PDAP Form props interface.
|
27
|
+
*/
|
28
|
+
export interface PdapFormPropsV2 {
|
29
|
+
defaultValues?: Record<PropertyKey, unknown>;
|
30
|
+
error?: string | undefined | null;
|
31
|
+
id: string;
|
32
|
+
name: string;
|
33
|
+
schema: ValidationSchemaV2;
|
34
|
+
}
|
35
|
+
export interface PdapFormProvideV2 {
|
36
|
+
values: Ref<Record<PropertyKey, unknown>>;
|
37
|
+
setValues: (values: Record<PropertyKey, unknown>) => void;
|
38
|
+
rules: ReturnType<typeof makeRules>;
|
39
|
+
v$: ReturnType<typeof useVuelidate>;
|
40
|
+
}
|
@@ -0,0 +1,5 @@
|
|
1
|
+
import { createRule } from '../../utils/vuelidate';
|
2
|
+
import { PdapFormProvideV2, ValidationSchemaV2 } from './types';
|
3
|
+
import { InjectionKey } from 'vue';
|
4
|
+
export declare function makeRules(schema: ValidationSchemaV2): Record<string, ReturnType<typeof createRule>>;
|
5
|
+
export declare const provideKey: InjectionKey<PdapFormProvideV2>;
|
@@ -0,0 +1,20 @@
|
|
1
|
+
import { PdapInputCheckboxProps } from './types';
|
2
|
+
declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__VLS_TypePropsToRuntimeProps<PdapInputCheckboxProps>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<PdapInputCheckboxProps>>>, {}, {}>, {
|
3
|
+
error?(_: {}): any;
|
4
|
+
label?(_: {}): any;
|
5
|
+
}>;
|
6
|
+
export default _default;
|
7
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
8
|
+
type __VLS_TypePropsToRuntimeProps<T> = {
|
9
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
10
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
11
|
+
} : {
|
12
|
+
type: import('vue').PropType<T[K]>;
|
13
|
+
required: true;
|
14
|
+
};
|
15
|
+
};
|
16
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
17
|
+
new (): {
|
18
|
+
$slots: S;
|
19
|
+
};
|
20
|
+
};
|
@@ -0,0 +1 @@
|
|
1
|
+
export { default as InputCheckbox } from './PdapInputCheckbox.vue';
|
@@ -0,0 +1,20 @@
|
|
1
|
+
import { PdapInputTextProps } from '../InputText/types';
|
2
|
+
declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__VLS_TypePropsToRuntimeProps<PdapInputTextProps>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<PdapInputTextProps>>>, {}, {}>, {
|
3
|
+
label?(_: {}): any;
|
4
|
+
error?(_: {}): any;
|
5
|
+
}>;
|
6
|
+
export default _default;
|
7
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
8
|
+
type __VLS_TypePropsToRuntimeProps<T> = {
|
9
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
10
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
11
|
+
} : {
|
12
|
+
type: import('vue').PropType<T[K]>;
|
13
|
+
required: true;
|
14
|
+
};
|
15
|
+
};
|
16
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
17
|
+
new (): {
|
18
|
+
$slots: S;
|
19
|
+
};
|
20
|
+
};
|
@@ -0,0 +1 @@
|
|
1
|
+
export { default as InputPassword } from './PdapInputPassword.vue';
|
@@ -0,0 +1,34 @@
|
|
1
|
+
import { PdapInputSelectProps } from './types';
|
2
|
+
declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<PdapInputSelectProps>, {
|
3
|
+
placeholder: string;
|
4
|
+
}>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<PdapInputSelectProps>, {
|
5
|
+
placeholder: string;
|
6
|
+
}>>>, {
|
7
|
+
placeholder: string;
|
8
|
+
}, {}>, {
|
9
|
+
label?(_: {}): any;
|
10
|
+
error?(_: {}): any;
|
11
|
+
}>;
|
12
|
+
export default _default;
|
13
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
14
|
+
type __VLS_TypePropsToRuntimeProps<T> = {
|
15
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
16
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
17
|
+
} : {
|
18
|
+
type: import('vue').PropType<T[K]>;
|
19
|
+
required: true;
|
20
|
+
};
|
21
|
+
};
|
22
|
+
type __VLS_WithDefaults<P, D> = {
|
23
|
+
[K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
|
24
|
+
default: D[K];
|
25
|
+
}> : P[K];
|
26
|
+
};
|
27
|
+
type __VLS_Prettify<T> = {
|
28
|
+
[K in keyof T]: T[K];
|
29
|
+
} & {};
|
30
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
31
|
+
new (): {
|
32
|
+
$slots: S;
|
33
|
+
};
|
34
|
+
};
|
@@ -0,0 +1 @@
|
|
1
|
+
export { default as InputSelect } from './PdapInputSelect.vue';
|
@@ -0,0 +1,20 @@
|
|
1
|
+
import { PdapInputTextProps } from './types';
|
2
|
+
declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__VLS_TypePropsToRuntimeProps<PdapInputTextProps>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<PdapInputTextProps>>>, {}, {}>, {
|
3
|
+
label?(_: {}): any;
|
4
|
+
error?(_: {}): any;
|
5
|
+
}>;
|
6
|
+
export default _default;
|
7
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
8
|
+
type __VLS_TypePropsToRuntimeProps<T> = {
|
9
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
10
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
11
|
+
} : {
|
12
|
+
type: import('vue').PropType<T[K]>;
|
13
|
+
required: true;
|
14
|
+
};
|
15
|
+
};
|
16
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
17
|
+
new (): {
|
18
|
+
$slots: S;
|
19
|
+
};
|
20
|
+
};
|
@@ -0,0 +1 @@
|
|
1
|
+
export { default as InputText } from './PdapInputText.vue';
|
@@ -0,0 +1,34 @@
|
|
1
|
+
import { PdapInputTextAreaProps } from './types';
|
2
|
+
declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<PdapInputTextAreaProps>, {
|
3
|
+
placeholder: string;
|
4
|
+
}>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<PdapInputTextAreaProps>, {
|
5
|
+
placeholder: string;
|
6
|
+
}>>>, {
|
7
|
+
placeholder: string;
|
8
|
+
}, {}>, {
|
9
|
+
label?(_: {}): any;
|
10
|
+
error?(_: {}): any;
|
11
|
+
}>;
|
12
|
+
export default _default;
|
13
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
14
|
+
type __VLS_TypePropsToRuntimeProps<T> = {
|
15
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
16
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
17
|
+
} : {
|
18
|
+
type: import('vue').PropType<T[K]>;
|
19
|
+
required: true;
|
20
|
+
};
|
21
|
+
};
|
22
|
+
type __VLS_WithDefaults<P, D> = {
|
23
|
+
[K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
|
24
|
+
default: D[K];
|
25
|
+
}> : P[K];
|
26
|
+
};
|
27
|
+
type __VLS_Prettify<T> = {
|
28
|
+
[K in keyof T]: T[K];
|
29
|
+
} & {};
|
30
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
31
|
+
new (): {
|
32
|
+
$slots: S;
|
33
|
+
};
|
34
|
+
};
|
@@ -0,0 +1 @@
|
|
1
|
+
export { default as InputTextArea } from './PdapInputTextArea.vue';
|
@@ -2,7 +2,13 @@ export { Button } from './Button';
|
|
2
2
|
export { ErrorBoundary } from './ErrorBoundary';
|
3
3
|
export { Footer } from './Footer';
|
4
4
|
export { Form } from './Form';
|
5
|
+
export { FormV2 } from './FormV2';
|
5
6
|
export { Input } from './Input';
|
7
|
+
export { InputCheckbox } from './InputCheckbox';
|
8
|
+
export { InputPassword } from './InputPassword';
|
9
|
+
export { InputText } from './InputText';
|
10
|
+
export { InputSelect } from './InputSelect';
|
11
|
+
export { InputTextArea } from './InputTextArea';
|
6
12
|
export { Header } from './Header';
|
7
13
|
export { Nav } from './Nav';
|
8
14
|
export { QuickSearchForm } from './QuickSearchForm';
|
@@ -0,0 +1,2 @@
|
|
1
|
+
declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}, {}>;
|
2
|
+
export default _default;
|