pdap-design-system 1.0.6 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- package/CONTRIBUTING.md +31 -1
- package/README.md +97 -24
- package/bin/pdap-design-system-cli.js +27 -0
- package/dist/components/Button/PdapButton.vue.d.ts +36 -0
- package/dist/components/Button/index.d.ts +2 -0
- package/dist/components/Button/types.d.ts +4 -0
- package/dist/components/FlexContainer/FlexContainer.vue.d.ts +36 -0
- package/dist/components/FlexContainer/index.d.ts +2 -0
- package/dist/components/FlexContainer/types.d.ts +4 -0
- package/dist/components/Footer/PdapFooter.vue.d.ts +29 -0
- package/dist/components/Footer/index.d.ts +2 -0
- package/dist/components/Footer/types.d.ts +9 -0
- package/dist/components/Form/InputsGenerator/FormInputsGenerator.vue.d.ts +37 -0
- package/dist/components/Form/InputsGenerator/index.d.ts +2 -0
- package/dist/components/Form/PdapForm.vue.d.ts +39 -0
- package/dist/components/Form/index.d.ts +2 -0
- package/dist/components/Form/types.d.ts +35 -0
- package/dist/components/GridContainer/GridContainer.vue.d.ts +39 -0
- package/dist/components/GridContainer/index.d.ts +2 -0
- package/dist/components/GridContainer/types.d.ts +7 -0
- package/dist/components/GridItem/GridItem.vue.d.ts +39 -0
- package/dist/components/GridItem/index.d.ts +2 -0
- package/dist/components/GridItem/types.d.ts +5 -0
- package/dist/components/Header/PdapHeader.vue.d.ts +29 -0
- package/dist/components/Header/index.d.ts +2 -0
- package/dist/components/Header/types.d.ts +4 -0
- package/dist/components/Input/Checkbox/InputCheckbox.vue.d.ts +24 -0
- package/dist/components/Input/Checkbox/index.d.ts +2 -0
- package/dist/components/Input/PdapInput.vue.d.ts +19 -0
- package/dist/components/Input/Text/InputText.vue.d.ts +24 -0
- package/dist/components/Input/Text/index.d.ts +2 -0
- package/dist/components/Input/index.d.ts +2 -0
- package/dist/components/Input/types.d.ts +20 -0
- package/dist/components/Input/utils.d.ts +4 -0
- package/dist/components/Nav/PdapNav.vue.d.ts +12 -0
- package/dist/components/Nav/index.d.ts +2 -0
- package/dist/components/Nav/types.d.ts +12 -0
- package/dist/components/TileIcon/TileIcon.vue.d.ts +12 -0
- package/dist/components/TileIcon/index.d.ts +2 -0
- package/dist/components/TileIcon/types.d.ts +4 -0
- package/dist/components/index.d.ts +12 -0
- package/dist/index.cjs +2 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.js +1728 -0
- package/dist/styles.css +1 -0
- package/dist/tools/testing/serializer.d.ts +7 -0
- package/dist/tools/testing/setup.d.ts +1 -0
- package/dist/utils/vuelidate.d.ts +36 -0
- package/package.json +106 -20
- package/system/css/global-styles.css +0 -735
- package/system/css/normalize.css +0 -349
- package/system/demo.html +0 -185
- package/system/js/nav.js +0 -12
- /package/{system → dist}/images/acronym.svg +0 -0
- /package/{system → dist}/images/favicon.png +0 -0
- /package/{system → dist}/images/icons/automation.svg +0 -0
- /package/{system → dist}/images/icons/community.svg +0 -0
- /package/{system → dist}/images/icons/scrapers.svg +0 -0
- /package/{system → dist}/images/icons/sources.svg +0 -0
- /package/{system → dist}/images/icons/standard.svg +0 -0
- /package/{system → dist}/images/lockup.svg +0 -0
- /package/{system → dist}/images/logo.svg +0 -0
- /package/{system → dist}/images/webclip.gif +0 -0
package/CONTRIBUTING.md
CHANGED
@@ -1,4 +1,34 @@
|
|
1
1
|
# Contributing
|
2
|
+
|
3
|
+
## Tech Stack
|
4
|
+
|
5
|
+
This is a `Vue` component library. It is built using `Vue3` and the `composition` API with TypeScript. Styles are created using `TailwindCSS`. The library is built using `Vite`. For testing, we use `Vitest`, for linting `eslint`, for formatting `prettier`
|
6
|
+
Some helpful resources and reading:
|
7
|
+
|
8
|
+
[Vue.js docs](https://vuejs.org/guide/introduction.html)
|
9
|
+
[Vite docs](https://vitejs.dev/guide/)
|
10
|
+
[Vitest docs](https://vitest.dev/guide/)
|
11
|
+
[Vue Testing Handbook](https://lmiller1990.github.io/vue-testing-handbook/v3/)
|
12
|
+
[Tailwind docs](https://tailwindui.com/documentation)
|
13
|
+
[TypeScript docs](https://www.typescriptlang.org/docs/)
|
14
|
+
|
15
|
+
### Etiquette
|
16
|
+
|
17
|
+
Head to [\#outreach](https://discord.com/channels/828274060034965575/853442226034442260/) in our [Discord](https://discord.gg/vKhDv7nC8B) if you'd like to collect feedback from the wider group.
|
18
|
+
|
19
|
+
Test your changes **locally first**, if possible. Include **screenshots with your PR** if you're changing something visual.
|
20
|
+
|
21
|
+
### Setup
|
22
|
+
|
23
|
+
1. [Clone the repository](https://docs.github.com/en/repositories/creating-and-managing-repositories/cloning-a-repository).
|
24
|
+
|
2
25
|
For PDAP staff: Make changes as needed, but consider how widely this is used. Don't merge things until we test the changes.
|
3
26
|
|
4
|
-
For the public: This is an internal system, but it could easily be forked and altered to meet your needs. Feel free to share potentially useful things back to us in a Pull Request.
|
27
|
+
For the public: This is an internal system, but it could easily be forked and altered to meet your needs. Feel free to share potentially useful things back to us in a Pull Request.
|
28
|
+
|
29
|
+
To test the package locally:
|
30
|
+
|
31
|
+
1. Run `npm link` from the root of the project directory.
|
32
|
+
2. `cd` into the local directory of the app you want to test importing into, then run `npm link pdap-design-system`
|
33
|
+
3. This will create a symlink between your local directories, allowing you to test changes in real time without actually publishing to the `npm` registry.
|
34
|
+
4. To test publishing your changes, run `npm publish --dry-run`. The console will output the result of the `publish` method, if you had actually called it.
|
package/README.md
CHANGED
@@ -1,45 +1,118 @@
|
|
1
1
|
# Design System
|
2
|
-
These are styling resources like CSS and templates for new PDAP microservices or branded web projects.
|
3
2
|
|
4
|
-
|
3
|
+
This is a `Vue` component library, styling system, and image asset repository for PDAP-branded client apps.
|
5
4
|
|
6
|
-
|
5
|
+
## Usage
|
7
6
|
|
8
|
-
|
7
|
+
1. Install the package
|
9
8
|
|
10
|
-
|
9
|
+
```
|
10
|
+
npm install pdap-design-system
|
11
|
+
```
|
11
12
|
|
12
|
-
|
13
|
-
1. In the project's directory:
|
13
|
+
2. Import the stylesheet in the app's entrypoint (usually `index.js` or `main.js`, at the root of your project)
|
14
14
|
|
15
15
|
```
|
16
|
-
|
16
|
+
// index.js
|
17
|
+
|
18
|
+
import 'pdap-design-system/styles';
|
19
|
+
```
|
20
|
+
|
21
|
+
3. Import and use the components
|
22
|
+
|
23
|
+
```
|
24
|
+
import { Button, Form } from 'pdap-design-system';
|
25
|
+
```
|
26
|
+
|
27
|
+
4. If your project is using `TypeScript`, the component props definitions and other types are exposed for import as well.
|
28
|
+
_n.b. This can be particularly useful for composing `Form` schemas, where `Input` schema objects are defined differently depending on the `type` of input desired._
|
29
|
+
|
30
|
+
```
|
31
|
+
import { PdapInputTypes } from 'pdap-design-system';
|
32
|
+
```
|
33
|
+
|
34
|
+
5. See [the component documentation](./doc/components.md) for details on each component's API.
|
35
|
+
|
36
|
+
### About images
|
37
|
+
|
38
|
+
PDAP image assets contained in this repo are built to the `/dist` folder. For convenience an importing alias `/images` has been added.
|
39
|
+
|
40
|
+
```
|
41
|
+
import 'pdap-design-system/images/acronym.svg';
|
42
|
+
```
|
43
|
+
|
44
|
+
Or, if you need them all, you can import all images at the app level. Just remember that if it's imported it gets bundled with your production app, so take care not to import unneeded images.
|
45
|
+
|
46
|
+
```
|
47
|
+
import `pdap-design-system/images`;
|
17
48
|
```
|
18
49
|
|
19
|
-
|
50
|
+
### Using the CLI to copy assets to your local project directory
|
51
|
+
|
52
|
+
If you want either styles or images copied to a local folder, you can do so from the root directory of your project.
|
53
|
+
|
54
|
+
Assets can be copied using the `pdap-design-system` command line method exposed by this package.
|
55
|
+
|
56
|
+
One of the following arguments is required:
|
57
|
+
`--copy-assets`: Copies all images and styles.
|
58
|
+
`--copy-images`: Copies all images.
|
59
|
+
`--copy-styles`: Copies all styles.
|
60
|
+
|
61
|
+
The following argument is optional:
|
62
|
+
`--to={path}`: Path to directory where assets should be copied. Defaults to `assets`
|
63
|
+
|
64
|
+
```
|
65
|
+
pdap-design-system --copy-images --to=image-assets
|
66
|
+
```
|
67
|
+
|
68
|
+
## Development Setup
|
69
|
+
|
70
|
+
1. Clone the repo
|
20
71
|
|
21
72
|
```
|
22
|
-
|
23
|
-
|
24
|
-
```
|
73
|
+
gh repo clone Police-Data-Accessibility-Project/design-system
|
74
|
+
```
|
25
75
|
|
76
|
+
2. CD into the project folder and install dependencies
|
26
77
|
|
78
|
+
```
|
79
|
+
cd design-system
|
80
|
+
npm i
|
81
|
+
```
|
27
82
|
|
28
|
-
|
29
|
-
This is a first pass, so they're not etched in stone. Open to suggestions.
|
83
|
+
3. Step 2 should result in the `build` script being run after packages are installed. Check the `dist` folder for changes. You then may want to take one or both of the following steps:
|
30
84
|
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
-
|
38
|
-
|
85
|
+
- If `build` wasn't called when you installed deps, build styles and images to the `dist` folder:
|
86
|
+
|
87
|
+
```
|
88
|
+
npm run build
|
89
|
+
```
|
90
|
+
|
91
|
+
- To watch for changes and update the build as you make changes:
|
92
|
+
|
93
|
+
```
|
94
|
+
npm run build:watch
|
95
|
+
```
|
96
|
+
|
97
|
+
4. If you use VS Code as your editor, you may want to install the [tailwind VS Code extension](https://marketplace.visualstudio.com/items?itemName=bradlc.vscode-tailwindcss), which helps with intellisense and the custom at-rules used by TailwindCSS.
|
98
|
+
|
99
|
+
5. Read the [contributing guide](./CONTRIBUTING.md) for development requirements and tips.
|
39
100
|
|
40
101
|
## Assets
|
102
|
+
|
41
103
|
Use these [brand assets](https://docs.pdap.io/meta/about/staff/brand-assets).
|
42
104
|
Use this [terminology](https://docs.pdap.io/activities/terms-and-definitions).
|
43
105
|
|
44
|
-
##
|
45
|
-
|
106
|
+
## Scripts reference
|
107
|
+
|
108
|
+
| Script | What it does |
|
109
|
+
| -------------- | ----------------------------------------------- |
|
110
|
+
| `build` | Builds the library |
|
111
|
+
| `build:watch` | Builds the library and watches for file changes |
|
112
|
+
| `clean` | Removes testing coverage reports after build |
|
113
|
+
| `lint` | Lint `ts` and `css` |
|
114
|
+
| `lint:es` | Lint `ts` |
|
115
|
+
| `lint:css` | Lint `css` |
|
116
|
+
| `test` | Runs full test suite |
|
117
|
+
| `test:changed` | Runs only test suites affected by changed files |
|
118
|
+
| `types` | Runs type check on all `ts` and `vue` files |
|
@@ -0,0 +1,27 @@
|
|
1
|
+
#!/usr/bin/env node
|
2
|
+
import minimist from 'minimist';
|
3
|
+
import cli from '../src/cli/index.js';
|
4
|
+
|
5
|
+
// Convert argv to object keyed by argName where --argName is what is passed to CLI
|
6
|
+
const args = minimist(process.argv);
|
7
|
+
|
8
|
+
switch (true) {
|
9
|
+
case args['copy-assets']:
|
10
|
+
cli.copyAllAssets(args);
|
11
|
+
break;
|
12
|
+
case args['copy-images']:
|
13
|
+
cli.copyImageAssets(args);
|
14
|
+
break;
|
15
|
+
case args['copy-styles']:
|
16
|
+
cli.copyStyleAssets(args);
|
17
|
+
break;
|
18
|
+
default:
|
19
|
+
console.log(
|
20
|
+
'No option argument was passed to pdap-design-system CLI.',
|
21
|
+
'\n Current options are:',
|
22
|
+
'\n --copy-assets: Copy all assets to assets/ (default) or custom path passed to optional --to argument.',
|
23
|
+
'\n --copy-images: Copy only image assets to assets/ (default) or custom path passed to optional --to argument.',
|
24
|
+
'\n --copy-styles: Copy only CSS assets to assets/ (default) or custom path passed to optional --to argument.'
|
25
|
+
);
|
26
|
+
break;
|
27
|
+
}
|
@@ -0,0 +1,36 @@
|
|
1
|
+
import { PdapButtonProps } from './types';
|
2
|
+
declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<PdapButtonProps>, {
|
3
|
+
intent: string;
|
4
|
+
isLoading: boolean;
|
5
|
+
}>, {}, 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<PdapButtonProps>, {
|
6
|
+
intent: string;
|
7
|
+
isLoading: boolean;
|
8
|
+
}>>>, {
|
9
|
+
intent: "primary" | "secondary";
|
10
|
+
isLoading: boolean;
|
11
|
+
}, {}>, {
|
12
|
+
default?(_: {}): any;
|
13
|
+
}>;
|
14
|
+
export default _default;
|
15
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
16
|
+
type __VLS_TypePropsToRuntimeProps<T> = {
|
17
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
18
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
19
|
+
} : {
|
20
|
+
type: import('vue').PropType<T[K]>;
|
21
|
+
required: true;
|
22
|
+
};
|
23
|
+
};
|
24
|
+
type __VLS_WithDefaults<P, D> = {
|
25
|
+
[K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
|
26
|
+
default: D[K];
|
27
|
+
}> : P[K];
|
28
|
+
};
|
29
|
+
type __VLS_Prettify<T> = {
|
30
|
+
[K in keyof T]: T[K];
|
31
|
+
} & {};
|
32
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
33
|
+
new (): {
|
34
|
+
$slots: S;
|
35
|
+
};
|
36
|
+
};
|
@@ -0,0 +1,36 @@
|
|
1
|
+
import { PdapFlexContainerProps } from './types';
|
2
|
+
declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<PdapFlexContainerProps>, {
|
3
|
+
alignment: string;
|
4
|
+
component: string;
|
5
|
+
}>, {}, 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<PdapFlexContainerProps>, {
|
6
|
+
alignment: string;
|
7
|
+
component: string;
|
8
|
+
}>>>, {
|
9
|
+
alignment: "center" | "start";
|
10
|
+
component: string;
|
11
|
+
}, {}>, {
|
12
|
+
default?(_: {}): any;
|
13
|
+
}>;
|
14
|
+
export default _default;
|
15
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
16
|
+
type __VLS_TypePropsToRuntimeProps<T> = {
|
17
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
18
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
19
|
+
} : {
|
20
|
+
type: import('vue').PropType<T[K]>;
|
21
|
+
required: true;
|
22
|
+
};
|
23
|
+
};
|
24
|
+
type __VLS_WithDefaults<P, D> = {
|
25
|
+
[K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
|
26
|
+
default: D[K];
|
27
|
+
}> : P[K];
|
28
|
+
};
|
29
|
+
type __VLS_Prettify<T> = {
|
30
|
+
[K in keyof T]: T[K];
|
31
|
+
} & {};
|
32
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
33
|
+
new (): {
|
34
|
+
$slots: S;
|
35
|
+
};
|
36
|
+
};
|
@@ -0,0 +1,29 @@
|
|
1
|
+
import { PdapFooterProps } from './types';
|
2
|
+
declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<PdapFooterProps>, {
|
3
|
+
logoImageSrc: string;
|
4
|
+
logoImageAnchorPath: string;
|
5
|
+
}>, {}, 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<PdapFooterProps>, {
|
6
|
+
logoImageSrc: string;
|
7
|
+
logoImageAnchorPath: string;
|
8
|
+
}>>>, {
|
9
|
+
logoImageSrc: string;
|
10
|
+
logoImageAnchorPath: string;
|
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
|
+
} & {};
|
@@ -0,0 +1,37 @@
|
|
1
|
+
import { PropType } from 'vue';
|
2
|
+
import { PdapFormSchema } from '../types.ts';
|
3
|
+
declare const _default: import("vue").DefineComponent<{
|
4
|
+
schema: {
|
5
|
+
type: PropType<PdapFormSchema>;
|
6
|
+
};
|
7
|
+
values: {
|
8
|
+
type: PropType<Record<string, unknown>>;
|
9
|
+
};
|
10
|
+
v$: {
|
11
|
+
type: PropType<import("@vuelidate/core").Validation<{}, Record<string, unknown>>>;
|
12
|
+
};
|
13
|
+
}, void, {
|
14
|
+
formData: Record<string, unknown>;
|
15
|
+
INPUT_COMPONENT_MAP: {
|
16
|
+
checkbox: string;
|
17
|
+
text: string;
|
18
|
+
};
|
19
|
+
v: import("@vuelidate/core").Validation<{}, Record<string, unknown>> | undefined;
|
20
|
+
}, {}, {
|
21
|
+
updateForm(fieldName: string, value: unknown): void;
|
22
|
+
updateValidations(fieldName: string): void;
|
23
|
+
}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("input" | "blur")[], "input" | "blur", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
24
|
+
schema: {
|
25
|
+
type: PropType<PdapFormSchema>;
|
26
|
+
};
|
27
|
+
values: {
|
28
|
+
type: PropType<Record<string, unknown>>;
|
29
|
+
};
|
30
|
+
v$: {
|
31
|
+
type: PropType<import("@vuelidate/core").Validation<{}, Record<string, unknown>>>;
|
32
|
+
};
|
33
|
+
}>> & {
|
34
|
+
onBlur?: ((...args: any[]) => any) | undefined;
|
35
|
+
onInput?: ((...args: any[]) => any) | undefined;
|
36
|
+
}, {}, {}>;
|
37
|
+
export default _default;
|
@@ -0,0 +1,39 @@
|
|
1
|
+
import { PdapFormProps } from './types';
|
2
|
+
declare const v$: import("vue").Ref<import("@vuelidate/core").Validation<{}, Record<string, unknown>>>;
|
3
|
+
export type VuelidateInstance = typeof v$.value;
|
4
|
+
declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<PdapFormProps>, {
|
5
|
+
error: null;
|
6
|
+
}>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
7
|
+
submit: (...args: any[]) => void;
|
8
|
+
}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<PdapFormProps>, {
|
9
|
+
error: null;
|
10
|
+
}>>> & {
|
11
|
+
onSubmit?: ((...args: any[]) => any) | undefined;
|
12
|
+
}, {
|
13
|
+
error: string | null;
|
14
|
+
}, {}>, {
|
15
|
+
default?(_: {}): any;
|
16
|
+
}>;
|
17
|
+
export default _default;
|
18
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
19
|
+
type __VLS_TypePropsToRuntimeProps<T> = {
|
20
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
21
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
22
|
+
} : {
|
23
|
+
type: import('vue').PropType<T[K]>;
|
24
|
+
required: true;
|
25
|
+
};
|
26
|
+
};
|
27
|
+
type __VLS_WithDefaults<P, D> = {
|
28
|
+
[K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
|
29
|
+
default: D[K];
|
30
|
+
}> : P[K];
|
31
|
+
};
|
32
|
+
type __VLS_Prettify<T> = {
|
33
|
+
[K in keyof T]: T[K];
|
34
|
+
} & {};
|
35
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
36
|
+
new (): {
|
37
|
+
$slots: S;
|
38
|
+
};
|
39
|
+
};
|
@@ -0,0 +1,35 @@
|
|
1
|
+
import { PdapInputCheckboxProps, PdapInputTextProps } from '../Input/types';
|
2
|
+
export type PdapLengthRules = 'maxLength' | 'minLength';
|
3
|
+
export interface PdapFormValidator<T> {
|
4
|
+
message?: string;
|
5
|
+
value: T;
|
6
|
+
}
|
7
|
+
/**
|
8
|
+
* Keyed by currently used validators.
|
9
|
+
* Add any Vuelidate validators or custom ones here as we need them.
|
10
|
+
* See https://vuelidate-next.netlify.app/validators.html#using-builtin-validators for more.
|
11
|
+
*
|
12
|
+
*/
|
13
|
+
export interface PdapFormValidators {
|
14
|
+
maxLength: PdapFormValidator<number>;
|
15
|
+
minLength: PdapFormValidator<number>;
|
16
|
+
required: PdapFormValidator<boolean>;
|
17
|
+
}
|
18
|
+
export interface PdapFormSchemaEntryInputCheckbox extends PdapInputCheckboxProps {
|
19
|
+
validators?: Partial<PdapFormValidators>;
|
20
|
+
}
|
21
|
+
export interface PdapFormSchemaEntryInputText extends PdapInputTextProps {
|
22
|
+
validators?: Partial<PdapFormValidators>;
|
23
|
+
}
|
24
|
+
export type PdapFormSchemaEntry = PdapFormSchemaEntryInputCheckbox | PdapFormSchemaEntryInputText;
|
25
|
+
export type PdapFormSchema = PdapFormSchemaEntry[];
|
26
|
+
export type PdapFormData = Record<string, unknown>;
|
27
|
+
/**
|
28
|
+
* PDAP Form props interface.
|
29
|
+
*/
|
30
|
+
export interface PdapFormProps {
|
31
|
+
error?: string | undefined | null;
|
32
|
+
id: string;
|
33
|
+
name: string;
|
34
|
+
schema: PdapFormSchema;
|
35
|
+
}
|
@@ -0,0 +1,39 @@
|
|
1
|
+
import { PdapGridContainerProps } from './types';
|
2
|
+
declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<PdapGridContainerProps>, {
|
3
|
+
columns: string;
|
4
|
+
component: string;
|
5
|
+
rows: string;
|
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<PdapGridContainerProps>, {
|
7
|
+
columns: string;
|
8
|
+
component: string;
|
9
|
+
rows: string;
|
10
|
+
}>>>, {
|
11
|
+
component: string;
|
12
|
+
columns: 1 | 2 | 3 | "auto";
|
13
|
+
rows: number | "auto";
|
14
|
+
}, {}>, {
|
15
|
+
default?(_: {}): any;
|
16
|
+
}>;
|
17
|
+
export default _default;
|
18
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
19
|
+
type __VLS_TypePropsToRuntimeProps<T> = {
|
20
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
21
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
22
|
+
} : {
|
23
|
+
type: import('vue').PropType<T[K]>;
|
24
|
+
required: true;
|
25
|
+
};
|
26
|
+
};
|
27
|
+
type __VLS_WithDefaults<P, D> = {
|
28
|
+
[K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
|
29
|
+
default: D[K];
|
30
|
+
}> : P[K];
|
31
|
+
};
|
32
|
+
type __VLS_Prettify<T> = {
|
33
|
+
[K in keyof T]: T[K];
|
34
|
+
} & {};
|
35
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
36
|
+
new (): {
|
37
|
+
$slots: S;
|
38
|
+
};
|
39
|
+
};
|
@@ -0,0 +1,39 @@
|
|
1
|
+
import { PdapGridItemProps } from './types';
|
2
|
+
declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<PdapGridItemProps>, {
|
3
|
+
component: string;
|
4
|
+
spanColumn: number;
|
5
|
+
spanRow: number;
|
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<PdapGridItemProps>, {
|
7
|
+
component: string;
|
8
|
+
spanColumn: number;
|
9
|
+
spanRow: number;
|
10
|
+
}>>>, {
|
11
|
+
component: string;
|
12
|
+
spanColumn: 1 | 2 | 3;
|
13
|
+
spanRow: number;
|
14
|
+
}, {}>, {
|
15
|
+
default?(_: {}): any;
|
16
|
+
}>;
|
17
|
+
export default _default;
|
18
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
19
|
+
type __VLS_TypePropsToRuntimeProps<T> = {
|
20
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
21
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
22
|
+
} : {
|
23
|
+
type: import('vue').PropType<T[K]>;
|
24
|
+
required: true;
|
25
|
+
};
|
26
|
+
};
|
27
|
+
type __VLS_WithDefaults<P, D> = {
|
28
|
+
[K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
|
29
|
+
default: D[K];
|
30
|
+
}> : P[K];
|
31
|
+
};
|
32
|
+
type __VLS_Prettify<T> = {
|
33
|
+
[K in keyof T]: T[K];
|
34
|
+
} & {};
|
35
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
36
|
+
new (): {
|
37
|
+
$slots: S;
|
38
|
+
};
|
39
|
+
};
|
@@ -0,0 +1,29 @@
|
|
1
|
+
import { PdapHeaderProps } from './types';
|
2
|
+
declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<PdapHeaderProps>, {
|
3
|
+
logoImageSrc: string;
|
4
|
+
logoImageAnchorPath: string;
|
5
|
+
}>, {}, 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<PdapHeaderProps>, {
|
6
|
+
logoImageSrc: string;
|
7
|
+
logoImageAnchorPath: string;
|
8
|
+
}>>>, {
|
9
|
+
logoImageSrc: string;
|
10
|
+
logoImageAnchorPath: string;
|
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
|
+
} & {};
|
@@ -0,0 +1,24 @@
|
|
1
|
+
import { PdapInputCheckboxProps } from '../types';
|
2
|
+
declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<PdapInputCheckboxProps>, {}>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
3
|
+
change: (val: string) => void;
|
4
|
+
}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<PdapInputCheckboxProps>, {}>>> & {
|
5
|
+
onChange?: ((val: string) => any) | undefined;
|
6
|
+
}, {}, {}>;
|
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
|
+
};
|
17
|
+
type __VLS_WithDefaults<P, D> = {
|
18
|
+
[K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
|
19
|
+
default: D[K];
|
20
|
+
}> : P[K];
|
21
|
+
};
|
22
|
+
type __VLS_Prettify<T> = {
|
23
|
+
[K in keyof T]: T[K];
|
24
|
+
} & {};
|