@dpa-id-components/dpa-shared-components 14.1.1 → 15.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +45 -21
- package/dist/components/UiAutocomplete/UiAutocomplete.stories.d.ts +12 -23
- package/dist/components/UiAutocomplete/UiAutocomplete.vue.d.ts +12 -23
- package/dist/components/UiCheckBox/UiCheckBox.stories.d.ts +12 -2
- package/dist/components/UiCheckBox/UiCheckBox.vue.d.ts +8 -2
- package/dist/components/UiInput/UiInput.stories.d.ts +48 -104
- package/dist/components/UiInput/UiInput.vue.d.ts +12 -10
- package/dist/dpa-shared-components.mjs +4497 -4453
- package/dist/dpa-shared-components.umd.js +4 -4
- package/dist/eslint.base.config.mjs +6 -12
- package/dist/fonts.css +16 -13
- package/dist/prettier.config.mjs +5 -0
- package/dist/style.css +1 -1
- package/dist/tailwind.config.cjs +3 -0
- package/package.json +13 -10
- package/dist/.prettierrc +0 -4
package/README.md
CHANGED
|
@@ -4,8 +4,7 @@ Collection of vue 3 components for usage across dpa projects.
|
|
|
4
4
|
|
|
5
5
|
## Pre-requirements
|
|
6
6
|
|
|
7
|
-
This project requires a node version of
|
|
8
|
-
required to prevent errors from the missing `crypto` library, which is needed for uuid.
|
|
7
|
+
This project requires a node version of 20.x or higher.
|
|
9
8
|
|
|
10
9
|
You need to add and integrate the Inter font that can be found in `src/assets/fonts` to your project manually.
|
|
11
10
|
An example how the CSS could look can be found in `src/tailwind/fonts.css`
|
|
@@ -56,35 +55,60 @@ The tailwind config is located at `./src/tailwind/tailwind.config.ts`.
|
|
|
56
55
|
Please be aware that used plugins must be listed in the dependencies or the projects using the components have to
|
|
57
56
|
install it.
|
|
58
57
|
|
|
59
|
-
### ESLint
|
|
58
|
+
### Code quality linting with ESLint
|
|
60
59
|
|
|
61
|
-
|
|
60
|
+
A shared ESLint configuration is provided at `@dpa-id-components/dpa-shared-components/eslintConfig`. Use it as a base configuration for code quality linting via ESLint.
|
|
62
61
|
|
|
63
|
-
|
|
64
|
-
- Project specific third-party plugins and config (updated accordingly for flat config support) should be added as `devDependencies`
|
|
65
|
-
- Files to be included or ignored by ESLint should be configured here
|
|
66
|
-
- Adjust the `lint` script in `package.json` to `"lint": "eslint . --fix"`
|
|
62
|
+
**Example ESLint configuration**:
|
|
67
63
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
import sharedConfig from "@dpa-id-components/dpa-shared-components/eslint.config";
|
|
72
|
-
// Other project specific plugins
|
|
73
|
-
import pluginCypress from "eslint-plugin-cypress/flat";
|
|
64
|
+
```js
|
|
65
|
+
import sharedConfig from "@dpa-id-components/dpa-shared-components/eslintConfig";
|
|
66
|
+
import { globalIgnores } from "eslint/config";
|
|
74
67
|
|
|
75
68
|
export default [
|
|
76
|
-
// Files to include or ignore under linting
|
|
77
69
|
{
|
|
78
|
-
files: ["**/*.
|
|
70
|
+
files: ["**/*.ts", "**/*.mts", "**/*.vue"],
|
|
79
71
|
},
|
|
72
|
+
|
|
73
|
+
globalIgnores(["**/dist/", "**/coverage/"]),
|
|
74
|
+
|
|
75
|
+
...sharedConfig,
|
|
76
|
+
|
|
80
77
|
{
|
|
81
|
-
|
|
78
|
+
files: ["**/*.vue"],
|
|
79
|
+
rules: {
|
|
80
|
+
"vue/no-undef-components": [
|
|
81
|
+
"error",
|
|
82
|
+
{
|
|
83
|
+
// Add globally-registered components here:
|
|
84
|
+
ignorePatterns: ["i18n-t", "RouterLink", "RouterView"],
|
|
85
|
+
},
|
|
86
|
+
],
|
|
87
|
+
},
|
|
82
88
|
},
|
|
83
|
-
...sharedConfig,
|
|
84
|
-
pluginCypress.configs.recommended,
|
|
85
89
|
];
|
|
86
90
|
```
|
|
87
91
|
|
|
92
|
+
### Code formatting with Prettier
|
|
93
|
+
|
|
94
|
+
A shared Prettier configuration is provided at `@dpa-id-components/dpa-shared-components/prettierConfig`. Use it as a base configuration for code formatting via Prettier.
|
|
95
|
+
|
|
96
|
+
**Example Prettier configuration**:
|
|
97
|
+
|
|
98
|
+
```js
|
|
99
|
+
import config from "@dpa-id-components/dpa-shared-components/prettierConfig";
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* @see https://prettier.io/docs/configuration
|
|
103
|
+
* @type {import("prettier").Config}
|
|
104
|
+
*/
|
|
105
|
+
export default {
|
|
106
|
+
...config,
|
|
107
|
+
};
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
You might also want to add a Prettier ignore file (e.g. for ignoring Markdown files) and set up Prettier in your code editor to automatically format on save.
|
|
111
|
+
|
|
88
112
|
## Add a component
|
|
89
113
|
|
|
90
114
|
To add a new component please add at least the following files:
|
|
@@ -166,9 +190,9 @@ Custom optimizations right now are:
|
|
|
166
190
|
|
|
167
191
|
## Releasing
|
|
168
192
|
|
|
169
|
-
To publish a new release just go to the Actions tab and click "Publish new version".
|
|
193
|
+
To publish a new release just go to the Actions tab and click "Publish new version".
|
|
170
194
|
You are prompted with the option to choose which version to bump. Behind the scenes it just does one of those commands below.
|
|
171
|
-
They will still work on their own but the #shared-components Slack channel won't be notified.
|
|
195
|
+
They will still work on their own but the #shared-components Slack channel won't be notified.
|
|
172
196
|
|
|
173
197
|
```shell
|
|
174
198
|
npm run release:patch
|
|
@@ -42,14 +42,11 @@ declare const meta: {
|
|
|
42
42
|
readonly disabled?: boolean | undefined;
|
|
43
43
|
readonly isDateTimePicker?: boolean | undefined;
|
|
44
44
|
readonly autocomplete?: string | undefined;
|
|
45
|
-
readonly isInvalid?: boolean | undefined;
|
|
46
45
|
readonly errorMessage?: string | undefined;
|
|
47
|
-
readonly showWarning?: boolean | undefined;
|
|
48
46
|
readonly warningMessage?: string | undefined;
|
|
49
47
|
readonly isTextarea?: boolean | undefined;
|
|
50
|
-
readonly hasInfo?: boolean | undefined;
|
|
51
48
|
readonly infoText?: string | undefined;
|
|
52
|
-
readonly inputStatus?: "
|
|
49
|
+
readonly inputStatus?: ("info" | "default" | "error" | "readonly" | "warning") | undefined;
|
|
53
50
|
readonly isUiAutocomplete?: boolean | undefined;
|
|
54
51
|
readonly onBlur?: ((args_0: FocusEvent) => any) | undefined;
|
|
55
52
|
readonly onFocus?: ((args_0: FocusEvent) => any) | undefined;
|
|
@@ -86,14 +83,11 @@ declare const meta: {
|
|
|
86
83
|
disabled?: boolean;
|
|
87
84
|
isDateTimePicker?: boolean;
|
|
88
85
|
autocomplete?: string;
|
|
89
|
-
isInvalid?: boolean;
|
|
90
86
|
errorMessage?: string;
|
|
91
|
-
showWarning?: boolean;
|
|
92
87
|
warningMessage?: string;
|
|
93
88
|
isTextarea?: boolean;
|
|
94
|
-
hasInfo?: boolean;
|
|
95
89
|
infoText?: string;
|
|
96
|
-
inputStatus?: "
|
|
90
|
+
inputStatus?: "info" | "default" | "error" | "readonly" | "warning";
|
|
97
91
|
isUiAutocomplete?: boolean;
|
|
98
92
|
}> & Readonly<{
|
|
99
93
|
onBlur?: ((args_0: FocusEvent) => any) | undefined;
|
|
@@ -120,14 +114,11 @@ declare const meta: {
|
|
|
120
114
|
chevron: boolean;
|
|
121
115
|
isDateTimePicker: boolean;
|
|
122
116
|
autocomplete: string;
|
|
123
|
-
isInvalid: boolean;
|
|
124
117
|
errorMessage: string;
|
|
125
|
-
showWarning: boolean;
|
|
126
118
|
warningMessage: string;
|
|
127
119
|
isTextarea: boolean;
|
|
128
|
-
hasInfo: boolean;
|
|
129
120
|
infoText: string;
|
|
130
|
-
inputStatus: "
|
|
121
|
+
inputStatus: "info" | "default" | "error" | "readonly" | "warning";
|
|
131
122
|
isUiAutocomplete: boolean;
|
|
132
123
|
}, {}, string, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, import('vue').ComponentProvideOptions> & {
|
|
133
124
|
beforeCreate?: (() => void) | (() => void)[];
|
|
@@ -160,14 +151,11 @@ declare const meta: {
|
|
|
160
151
|
chevron: boolean;
|
|
161
152
|
isDateTimePicker: boolean;
|
|
162
153
|
autocomplete: string;
|
|
163
|
-
isInvalid: boolean;
|
|
164
154
|
errorMessage: string;
|
|
165
|
-
showWarning: boolean;
|
|
166
155
|
warningMessage: string;
|
|
167
156
|
isTextarea: boolean;
|
|
168
|
-
hasInfo: boolean;
|
|
169
157
|
infoText: string;
|
|
170
|
-
inputStatus: "
|
|
158
|
+
inputStatus: "info" | "default" | "error" | "readonly" | "warning";
|
|
171
159
|
isUiAutocomplete: boolean;
|
|
172
160
|
}> & Omit<Readonly<{
|
|
173
161
|
modelValue?: string;
|
|
@@ -182,14 +170,11 @@ declare const meta: {
|
|
|
182
170
|
disabled?: boolean;
|
|
183
171
|
isDateTimePicker?: boolean;
|
|
184
172
|
autocomplete?: string;
|
|
185
|
-
isInvalid?: boolean;
|
|
186
173
|
errorMessage?: string;
|
|
187
|
-
showWarning?: boolean;
|
|
188
174
|
warningMessage?: string;
|
|
189
175
|
isTextarea?: boolean;
|
|
190
|
-
hasInfo?: boolean;
|
|
191
176
|
infoText?: string;
|
|
192
|
-
inputStatus?: "
|
|
177
|
+
inputStatus?: "info" | "default" | "error" | "readonly" | "warning";
|
|
193
178
|
isUiAutocomplete?: boolean;
|
|
194
179
|
}> & Readonly<{
|
|
195
180
|
onBlur?: ((args_0: FocusEvent) => any) | undefined;
|
|
@@ -197,11 +182,15 @@ declare const meta: {
|
|
|
197
182
|
onInput?: ((args_0: string) => any) | undefined;
|
|
198
183
|
onKeyup?: ((args_0: KeyboardEvent) => any) | undefined;
|
|
199
184
|
"onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
|
200
|
-
}>, "inputRef" | ("label" | "type" | "disabled" | "readonly" | "id" | "placeholder" | "autofocus" | "chevron" | "isDateTimePicker" | "autocomplete" | "
|
|
185
|
+
}>, "inputRef" | ("label" | "type" | "disabled" | "readonly" | "id" | "placeholder" | "autofocus" | "chevron" | "isDateTimePicker" | "autocomplete" | "errorMessage" | "warningMessage" | "isTextarea" | "infoText" | "inputStatus" | "isUiAutocomplete")> & import('vue').ShallowUnwrapRef<{
|
|
201
186
|
inputRef: import('vue').Ref<HTMLInputElement | undefined, HTMLInputElement | undefined>;
|
|
202
187
|
}> & {} & import('vue').ComponentCustomProperties & {} & {
|
|
203
|
-
$slots: {
|
|
204
|
-
buttons
|
|
188
|
+
$slots: Readonly<{
|
|
189
|
+
buttons?: () => any;
|
|
190
|
+
errors?: () => any;
|
|
191
|
+
}> & {
|
|
192
|
+
buttons?: () => any;
|
|
193
|
+
errors?: () => any;
|
|
205
194
|
};
|
|
206
195
|
}) | null;
|
|
207
196
|
dropdownRef: HTMLDivElement;
|
|
@@ -33,14 +33,11 @@ declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {
|
|
|
33
33
|
readonly disabled?: boolean | undefined;
|
|
34
34
|
readonly isDateTimePicker?: boolean | undefined;
|
|
35
35
|
readonly autocomplete?: string | undefined;
|
|
36
|
-
readonly isInvalid?: boolean | undefined;
|
|
37
36
|
readonly errorMessage?: string | undefined;
|
|
38
|
-
readonly showWarning?: boolean | undefined;
|
|
39
37
|
readonly warningMessage?: string | undefined;
|
|
40
38
|
readonly isTextarea?: boolean | undefined;
|
|
41
|
-
readonly hasInfo?: boolean | undefined;
|
|
42
39
|
readonly infoText?: string | undefined;
|
|
43
|
-
readonly inputStatus?: "
|
|
40
|
+
readonly inputStatus?: ("info" | "default" | "error" | "readonly" | "warning") | undefined;
|
|
44
41
|
readonly isUiAutocomplete?: boolean | undefined;
|
|
45
42
|
readonly onBlur?: ((args_0: FocusEvent) => any) | undefined;
|
|
46
43
|
readonly onFocus?: ((args_0: FocusEvent) => any) | undefined;
|
|
@@ -77,14 +74,11 @@ declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {
|
|
|
77
74
|
disabled?: boolean;
|
|
78
75
|
isDateTimePicker?: boolean;
|
|
79
76
|
autocomplete?: string;
|
|
80
|
-
isInvalid?: boolean;
|
|
81
77
|
errorMessage?: string;
|
|
82
|
-
showWarning?: boolean;
|
|
83
78
|
warningMessage?: string;
|
|
84
79
|
isTextarea?: boolean;
|
|
85
|
-
hasInfo?: boolean;
|
|
86
80
|
infoText?: string;
|
|
87
|
-
inputStatus?: "
|
|
81
|
+
inputStatus?: "info" | "default" | "error" | "readonly" | "warning";
|
|
88
82
|
isUiAutocomplete?: boolean;
|
|
89
83
|
}> & Readonly<{
|
|
90
84
|
onBlur?: ((args_0: FocusEvent) => any) | undefined;
|
|
@@ -111,14 +105,11 @@ declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {
|
|
|
111
105
|
chevron: boolean;
|
|
112
106
|
isDateTimePicker: boolean;
|
|
113
107
|
autocomplete: string;
|
|
114
|
-
isInvalid: boolean;
|
|
115
108
|
errorMessage: string;
|
|
116
|
-
showWarning: boolean;
|
|
117
109
|
warningMessage: string;
|
|
118
110
|
isTextarea: boolean;
|
|
119
|
-
hasInfo: boolean;
|
|
120
111
|
infoText: string;
|
|
121
|
-
inputStatus: "
|
|
112
|
+
inputStatus: "info" | "default" | "error" | "readonly" | "warning";
|
|
122
113
|
isUiAutocomplete: boolean;
|
|
123
114
|
}, {}, string, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, import('vue').ComponentProvideOptions> & {
|
|
124
115
|
beforeCreate?: (() => void) | (() => void)[];
|
|
@@ -151,14 +142,11 @@ declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {
|
|
|
151
142
|
chevron: boolean;
|
|
152
143
|
isDateTimePicker: boolean;
|
|
153
144
|
autocomplete: string;
|
|
154
|
-
isInvalid: boolean;
|
|
155
145
|
errorMessage: string;
|
|
156
|
-
showWarning: boolean;
|
|
157
146
|
warningMessage: string;
|
|
158
147
|
isTextarea: boolean;
|
|
159
|
-
hasInfo: boolean;
|
|
160
148
|
infoText: string;
|
|
161
|
-
inputStatus: "
|
|
149
|
+
inputStatus: "info" | "default" | "error" | "readonly" | "warning";
|
|
162
150
|
isUiAutocomplete: boolean;
|
|
163
151
|
}> & Omit<Readonly<{
|
|
164
152
|
modelValue?: string;
|
|
@@ -173,14 +161,11 @@ declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {
|
|
|
173
161
|
disabled?: boolean;
|
|
174
162
|
isDateTimePicker?: boolean;
|
|
175
163
|
autocomplete?: string;
|
|
176
|
-
isInvalid?: boolean;
|
|
177
164
|
errorMessage?: string;
|
|
178
|
-
showWarning?: boolean;
|
|
179
165
|
warningMessage?: string;
|
|
180
166
|
isTextarea?: boolean;
|
|
181
|
-
hasInfo?: boolean;
|
|
182
167
|
infoText?: string;
|
|
183
|
-
inputStatus?: "
|
|
168
|
+
inputStatus?: "info" | "default" | "error" | "readonly" | "warning";
|
|
184
169
|
isUiAutocomplete?: boolean;
|
|
185
170
|
}> & Readonly<{
|
|
186
171
|
onBlur?: ((args_0: FocusEvent) => any) | undefined;
|
|
@@ -188,11 +173,15 @@ declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {
|
|
|
188
173
|
onInput?: ((args_0: string) => any) | undefined;
|
|
189
174
|
onKeyup?: ((args_0: KeyboardEvent) => any) | undefined;
|
|
190
175
|
"onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
|
191
|
-
}>, "inputRef" | ("label" | "type" | "disabled" | "readonly" | "id" | "placeholder" | "autofocus" | "chevron" | "isDateTimePicker" | "autocomplete" | "
|
|
176
|
+
}>, "inputRef" | ("label" | "type" | "disabled" | "readonly" | "id" | "placeholder" | "autofocus" | "chevron" | "isDateTimePicker" | "autocomplete" | "errorMessage" | "warningMessage" | "isTextarea" | "infoText" | "inputStatus" | "isUiAutocomplete")> & import('vue').ShallowUnwrapRef<{
|
|
192
177
|
inputRef: import('vue').Ref<HTMLInputElement | undefined, HTMLInputElement | undefined>;
|
|
193
178
|
}> & {} & import('vue').ComponentCustomProperties & {} & {
|
|
194
|
-
$slots: {
|
|
195
|
-
buttons
|
|
179
|
+
$slots: Readonly<{
|
|
180
|
+
buttons?: () => any;
|
|
181
|
+
errors?: () => any;
|
|
182
|
+
}> & {
|
|
183
|
+
buttons?: () => any;
|
|
184
|
+
errors?: () => any;
|
|
196
185
|
};
|
|
197
186
|
}) | null;
|
|
198
187
|
dropdownRef: HTMLDivElement;
|
|
@@ -3,6 +3,7 @@ declare const meta: {
|
|
|
3
3
|
title: string;
|
|
4
4
|
component: {
|
|
5
5
|
new (...args: any[]): import('vue').CreateComponentPublicInstanceWithMixins<Readonly<{
|
|
6
|
+
id?: string;
|
|
6
7
|
color?: "blue" | "gray";
|
|
7
8
|
size?: "small" | "medium";
|
|
8
9
|
disabled?: boolean;
|
|
@@ -16,6 +17,7 @@ declare const meta: {
|
|
|
16
17
|
}, import('vue').PublicProps, {
|
|
17
18
|
size: "small" | "medium";
|
|
18
19
|
disabled: boolean;
|
|
20
|
+
id: string;
|
|
19
21
|
errorMessage: string;
|
|
20
22
|
color: "blue" | "gray";
|
|
21
23
|
checked: boolean;
|
|
@@ -28,6 +30,7 @@ declare const meta: {
|
|
|
28
30
|
M: {};
|
|
29
31
|
Defaults: {};
|
|
30
32
|
}, Readonly<{
|
|
33
|
+
id?: string;
|
|
31
34
|
color?: "blue" | "gray";
|
|
32
35
|
size?: "small" | "medium";
|
|
33
36
|
disabled?: boolean;
|
|
@@ -39,6 +42,7 @@ declare const meta: {
|
|
|
39
42
|
}>, {}, {}, {}, {}, {
|
|
40
43
|
size: "small" | "medium";
|
|
41
44
|
disabled: boolean;
|
|
45
|
+
id: string;
|
|
42
46
|
errorMessage: string;
|
|
43
47
|
color: "blue" | "gray";
|
|
44
48
|
checked: boolean;
|
|
@@ -48,6 +52,7 @@ declare const meta: {
|
|
|
48
52
|
__isTeleport?: never;
|
|
49
53
|
__isSuspense?: never;
|
|
50
54
|
} & import('vue').ComponentOptionsBase<Readonly<{
|
|
55
|
+
id?: string;
|
|
51
56
|
color?: "blue" | "gray";
|
|
52
57
|
size?: "small" | "medium";
|
|
53
58
|
disabled?: boolean;
|
|
@@ -61,13 +66,18 @@ declare const meta: {
|
|
|
61
66
|
}, string, {
|
|
62
67
|
size: "small" | "medium";
|
|
63
68
|
disabled: boolean;
|
|
69
|
+
id: string;
|
|
64
70
|
errorMessage: string;
|
|
65
71
|
color: "blue" | "gray";
|
|
66
72
|
checked: boolean;
|
|
67
73
|
showError: boolean;
|
|
68
74
|
}, {}, string, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, import('vue').ComponentProvideOptions> & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps & (new () => {
|
|
69
|
-
$slots: {
|
|
70
|
-
default
|
|
75
|
+
$slots: Readonly<{
|
|
76
|
+
default: () => any;
|
|
77
|
+
errors?: () => any;
|
|
78
|
+
}> & {
|
|
79
|
+
default: () => any;
|
|
80
|
+
errors?: () => any;
|
|
71
81
|
};
|
|
72
82
|
});
|
|
73
83
|
argTypes: {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
type __VLS_Props = {
|
|
2
|
+
id?: string;
|
|
2
3
|
color?: "blue" | "gray";
|
|
3
4
|
size?: "small" | "medium";
|
|
4
5
|
disabled?: boolean;
|
|
@@ -8,8 +9,12 @@ type __VLS_Props = {
|
|
|
8
9
|
};
|
|
9
10
|
declare function __VLS_template(): {
|
|
10
11
|
attrs: Partial<{}>;
|
|
11
|
-
slots: {
|
|
12
|
-
default
|
|
12
|
+
slots: Readonly<{
|
|
13
|
+
default: () => any;
|
|
14
|
+
errors?: () => any;
|
|
15
|
+
}> & {
|
|
16
|
+
default: () => any;
|
|
17
|
+
errors?: () => any;
|
|
13
18
|
};
|
|
14
19
|
refs: {};
|
|
15
20
|
rootEl: any;
|
|
@@ -22,6 +27,7 @@ declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {}, {}
|
|
|
22
27
|
}>, {
|
|
23
28
|
size: "small" | "medium";
|
|
24
29
|
disabled: boolean;
|
|
30
|
+
id: string;
|
|
25
31
|
errorMessage: string;
|
|
26
32
|
color: "blue" | "gray";
|
|
27
33
|
checked: boolean;
|