pdap-design-system 3.1.0-beta.2 → 3.1.0-beta.21

Sign up to get free protection for your applications and to get access to all the features.
@@ -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,51 @@
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_TypePropsToRuntimeProps<PdapFormPropsV2>, {
5
+ setValues: typeof setValues;
6
+ v$: import("vue").Ref<import("@vuelidate/core").Validation<Record<string, {
7
+ [x: string]: import("@vuelidate/core").ValidationRuleWithParams<{
8
+ max: number;
9
+ }, any> | import("@vuelidate/core").ValidationRuleWithParams<{
10
+ min: number;
11
+ }, any>;
12
+ } | {
13
+ [x: string]: import("@vuelidate/core").ValidationRuleWithParams<object, any>;
14
+ } | {
15
+ required: import("@vuelidate/core").ValidationRuleWithoutParams<any>;
16
+ } | {
17
+ required: import("@vuelidate/core").ValidationRuleWithParams<object, any>;
18
+ } | {
19
+ email: import("@vuelidate/core").ValidationRuleWithoutParams<any>;
20
+ } | {
21
+ email: import("@vuelidate/core").ValidationRuleWithParams<object, any>;
22
+ } | {
23
+ password: any;
24
+ }>, Record<PropertyKey, unknown>>>;
25
+ }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
26
+ change: (...args: any[]) => void;
27
+ error: (...args: any[]) => void;
28
+ submit: (...args: any[]) => void;
29
+ }, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<PdapFormPropsV2>>> & {
30
+ onChange?: ((...args: any[]) => any) | undefined;
31
+ onSubmit?: ((...args: any[]) => any) | undefined;
32
+ onError?: ((...args: any[]) => any) | undefined;
33
+ }, {}, {}>, {
34
+ error?(_: {}): any;
35
+ default?(_: {}): any;
36
+ }>;
37
+ export default _default;
38
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
39
+ type __VLS_TypePropsToRuntimeProps<T> = {
40
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
41
+ type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
42
+ } : {
43
+ type: import('vue').PropType<T[K]>;
44
+ required: true;
45
+ };
46
+ };
47
+ type __VLS_WithTemplateSlots<T, S> = T & {
48
+ new (): {
49
+ $slots: S;
50
+ };
51
+ };
@@ -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,6 @@
1
+ export interface PdapInputCheckboxProps {
2
+ id: string;
3
+ label?: string;
4
+ name: string;
5
+ defaultChecked?: boolean;
6
+ }
@@ -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,40 @@
1
+ import { PdapSelectOption as Option, PdapInputSelectProps } from './types';
2
+ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<PdapInputSelectProps>, {
3
+ combobox: boolean;
4
+ placeholder: string;
5
+ filter: (searchText: any, options: any) => any;
6
+ }>, {}, 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>, {
7
+ combobox: boolean;
8
+ placeholder: string;
9
+ filter: (searchText: any, options: any) => any;
10
+ }>>>, {
11
+ filter: (searchText: string, options: Option[]) => Option[];
12
+ placeholder: string;
13
+ combobox: boolean;
14
+ }, {}>, {
15
+ label?(_: {}): any;
16
+ error?(_: {}): any;
17
+ }>;
18
+ export default _default;
19
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
20
+ type __VLS_TypePropsToRuntimeProps<T> = {
21
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
22
+ type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
23
+ } : {
24
+ type: import('vue').PropType<T[K]>;
25
+ required: true;
26
+ };
27
+ };
28
+ type __VLS_WithDefaults<P, D> = {
29
+ [K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
30
+ default: D[K];
31
+ }> : P[K];
32
+ };
33
+ type __VLS_Prettify<T> = {
34
+ [K in keyof T]: T[K];
35
+ } & {};
36
+ type __VLS_WithTemplateSlots<T, S> = T & {
37
+ new (): {
38
+ $slots: S;
39
+ };
40
+ };
@@ -0,0 +1 @@
1
+ export { default as InputSelect } from './PdapInputSelect.vue';
@@ -0,0 +1,13 @@
1
+ export interface PdapSelectOption {
2
+ value: string;
3
+ label: string;
4
+ }
5
+ export interface PdapInputSelectProps {
6
+ id: string;
7
+ label?: string;
8
+ name: string;
9
+ placeholder?: string;
10
+ options: PdapSelectOption[];
11
+ combobox?: boolean;
12
+ filter?: (searchText: string, options: PdapSelectOption[]) => PdapSelectOption[];
13
+ }
@@ -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,6 @@
1
+ export interface PdapInputTextProps {
2
+ id: string;
3
+ label?: string;
4
+ name: string;
5
+ placeholder?: string;
6
+ }
@@ -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';
@@ -0,0 +1,6 @@
1
+ export interface PdapInputTextAreaProps {
2
+ id: string;
3
+ label?: string;
4
+ name: string;
5
+ placeholder?: string;
6
+ }
@@ -17,8 +17,8 @@ declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_T
17
17
  show: boolean;
18
18
  }>>>, {
19
19
  text: string;
20
- size: number;
21
20
  color: string;
21
+ size: number;
22
22
  show: boolean;
23
23
  }, {}>;
24
24
  export default _default;
@@ -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;