pdap-design-system 3.1.0-beta.2 → 3.1.0-beta.3
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 +42 -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 +24 -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 +24 -0
- package/dist/components/InputPassword/index.d.ts +1 -0
- package/dist/components/InputText/PdapInputText.vue.d.ts +24 -0
- package/dist/components/InputText/index.d.ts +1 -0
- package/dist/components/InputText/types.d.ts +6 -0
- package/dist/components/index.d.ts +4 -0
- package/dist/demo/pages/FormV2Demo.vue.d.ts +2 -0
- package/dist/index.cjs +7 -7
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1870 -1624
- package/dist/styles.css +1 -1
- 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,42 @@
|
|
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
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
9
|
+
submit: (...args: any[]) => void;
|
10
|
+
}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<PdapFormPropsV2>, {
|
11
|
+
error: null;
|
12
|
+
}>>> & {
|
13
|
+
onSubmit?: ((...args: any[]) => any) | undefined;
|
14
|
+
}, {
|
15
|
+
error: string | null;
|
16
|
+
}, {}>, {
|
17
|
+
error?(_: {}): any;
|
18
|
+
default?(_: {}): any;
|
19
|
+
}>;
|
20
|
+
export default _default;
|
21
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
22
|
+
type __VLS_TypePropsToRuntimeProps<T> = {
|
23
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
24
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
25
|
+
} : {
|
26
|
+
type: import('vue').PropType<T[K]>;
|
27
|
+
required: true;
|
28
|
+
};
|
29
|
+
};
|
30
|
+
type __VLS_WithDefaults<P, D> = {
|
31
|
+
[K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
|
32
|
+
default: D[K];
|
33
|
+
}> : P[K];
|
34
|
+
};
|
35
|
+
type __VLS_Prettify<T> = {
|
36
|
+
[K in keyof T]: T[K];
|
37
|
+
} & {};
|
38
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
39
|
+
new (): {
|
40
|
+
$slots: S;
|
41
|
+
};
|
42
|
+
};
|
@@ -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,24 @@
|
|
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?(_: {
|
4
|
+
class: string;
|
5
|
+
}): any;
|
6
|
+
label?(_: {
|
7
|
+
for: string;
|
8
|
+
}): any;
|
9
|
+
}>;
|
10
|
+
export default _default;
|
11
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
12
|
+
type __VLS_TypePropsToRuntimeProps<T> = {
|
13
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
14
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
15
|
+
} : {
|
16
|
+
type: import('vue').PropType<T[K]>;
|
17
|
+
required: true;
|
18
|
+
};
|
19
|
+
};
|
20
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
21
|
+
new (): {
|
22
|
+
$slots: S;
|
23
|
+
};
|
24
|
+
};
|
@@ -0,0 +1 @@
|
|
1
|
+
export { default as InputCheckbox } from './PdapInputCheckbox.vue';
|
@@ -0,0 +1,24 @@
|
|
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
|
+
error?(_: {
|
4
|
+
class: string;
|
5
|
+
}): any;
|
6
|
+
label?(_: {
|
7
|
+
for: string;
|
8
|
+
}): any;
|
9
|
+
}>;
|
10
|
+
export default _default;
|
11
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
12
|
+
type __VLS_TypePropsToRuntimeProps<T> = {
|
13
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
14
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
15
|
+
} : {
|
16
|
+
type: import('vue').PropType<T[K]>;
|
17
|
+
required: true;
|
18
|
+
};
|
19
|
+
};
|
20
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
21
|
+
new (): {
|
22
|
+
$slots: S;
|
23
|
+
};
|
24
|
+
};
|
@@ -0,0 +1 @@
|
|
1
|
+
export { default as InputPassword } from './PdapInputPassword.vue';
|
@@ -0,0 +1,24 @@
|
|
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
|
+
error?(_: {
|
4
|
+
class: string;
|
5
|
+
}): any;
|
6
|
+
label?(_: {
|
7
|
+
for: string;
|
8
|
+
}): any;
|
9
|
+
}>;
|
10
|
+
export default _default;
|
11
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
12
|
+
type __VLS_TypePropsToRuntimeProps<T> = {
|
13
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
14
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
15
|
+
} : {
|
16
|
+
type: import('vue').PropType<T[K]>;
|
17
|
+
required: true;
|
18
|
+
};
|
19
|
+
};
|
20
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
21
|
+
new (): {
|
22
|
+
$slots: S;
|
23
|
+
};
|
24
|
+
};
|
@@ -0,0 +1 @@
|
|
1
|
+
export { default as InputText } from './PdapInputText.vue';
|
@@ -2,7 +2,11 @@ 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';
|
6
10
|
export { Header } from './Header';
|
7
11
|
export { Nav } from './Nav';
|
8
12
|
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;
|