pdap-design-system 3.0.1-beta.1 → 3.1.0-beta.10

Sign up to get free protection for your applications and to get access to all the features.
Files changed (30) hide show
  1. package/dist/components/Form/PdapForm.vue.d.ts +3 -0
  2. package/dist/components/FormV2/PdapFormV2.vue.d.ts +63 -0
  3. package/dist/components/FormV2/index.d.ts +1 -0
  4. package/dist/components/FormV2/types.d.ts +40 -0
  5. package/dist/components/FormV2/util.d.ts +5 -0
  6. package/dist/components/InputCheckbox/PdapInputCheckbox.vue.d.ts +20 -0
  7. package/dist/components/InputCheckbox/index.d.ts +1 -0
  8. package/dist/components/InputCheckbox/types.d.ts +6 -0
  9. package/dist/components/InputPassword/PdapInputPassword.vue.d.ts +20 -0
  10. package/dist/components/InputPassword/index.d.ts +1 -0
  11. package/dist/components/InputSelect/PdapInputSelect.vue.d.ts +34 -0
  12. package/dist/components/InputSelect/index.d.ts +1 -0
  13. package/dist/components/InputSelect/types.d.ts +11 -0
  14. package/dist/components/InputText/PdapInputText.vue.d.ts +20 -0
  15. package/dist/components/InputText/index.d.ts +1 -0
  16. package/dist/components/InputText/types.d.ts +6 -0
  17. package/dist/components/InputTextArea/PdapInputTextArea.vue.d.ts +34 -0
  18. package/dist/components/InputTextArea/index.d.ts +1 -0
  19. package/dist/components/InputTextArea/types.d.ts +6 -0
  20. package/dist/components/RecordTypeIcon/RecordTypeIcon.vue.d.ts +16 -0
  21. package/dist/components/RecordTypeIcon/index.d.ts +1 -0
  22. package/dist/components/RecordTypeIcon/util.d.ts +5 -0
  23. package/dist/components/index.d.ts +7 -0
  24. package/dist/demo/pages/FormV2Demo.vue.d.ts +2 -0
  25. package/dist/index.cjs +558 -3
  26. package/dist/index.d.ts +4 -1
  27. package/dist/index.js +4826 -1131
  28. package/dist/styles.css +1 -1
  29. package/docs/components.md +1 -0
  30. package/package.json +6 -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,63 @@
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
+ submit: (...args: any[]) => void;
30
+ }, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<PdapFormPropsV2>, {
31
+ error: null;
32
+ }>>> & {
33
+ onChange?: ((...args: any[]) => any) | undefined;
34
+ onSubmit?: ((...args: any[]) => any) | undefined;
35
+ }, {
36
+ error: string | null;
37
+ }, {}>, {
38
+ error?(_: {}): any;
39
+ default?(_: {}): any;
40
+ }>;
41
+ export default _default;
42
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
43
+ type __VLS_TypePropsToRuntimeProps<T> = {
44
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
45
+ type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
46
+ } : {
47
+ type: import('vue').PropType<T[K]>;
48
+ required: true;
49
+ };
50
+ };
51
+ type __VLS_WithDefaults<P, D> = {
52
+ [K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
53
+ default: D[K];
54
+ }> : P[K];
55
+ };
56
+ type __VLS_Prettify<T> = {
57
+ [K in keyof T]: T[K];
58
+ } & {};
59
+ type __VLS_WithTemplateSlots<T, S> = T & {
60
+ new (): {
61
+ $slots: S;
62
+ };
63
+ };
@@ -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,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,11 @@
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
+ }
@@ -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
+ }
@@ -0,0 +1,16 @@
1
+ interface Props {
2
+ recordType: string;
3
+ }
4
+ declare const _default: import("vue").DefineComponent<__VLS_TypePropsToRuntimeProps<Props>, {
5
+ recordTypesToIcons: import("vue").Ref<Map<string, import("@fortawesome/fontawesome-common-types").IconDefinition>>;
6
+ }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<Props>>>, {}, {}>;
7
+ export default _default;
8
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
9
+ type __VLS_TypePropsToRuntimeProps<T> = {
10
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
11
+ type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
12
+ } : {
13
+ type: import('vue').PropType<T[K]>;
14
+ required: true;
15
+ };
16
+ };
@@ -0,0 +1 @@
1
+ export { default as RecordTypeIcon } from './RecordTypeIcon.vue';
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Creates map with type inference
3
+ *
4
+ * UNUSED FOR NOW, but we may need it later
5
+ */
@@ -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';
@@ -10,3 +16,4 @@ export { TileIcon } from './TileIcon';
10
16
  export { Dropdown } from './Dropdown';
11
17
  export { Breadcrumbs } from './Breadcrumbs';
12
18
  export { Spinner } from './Spinner';
19
+ export { RecordTypeIcon } from './RecordTypeIcon';
@@ -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;