@naptics/vue-collection 0.0.7 → 0.1.1
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 +7 -5
- package/components/NAlert.d.ts +12 -0
- package/components/NAlert.js +5 -1
- package/components/NBadge.d.ts +21 -3
- package/components/NBadge.js +5 -1
- package/components/NBreadcrub.d.ts +12 -0
- package/components/NBreadcrub.js +5 -1
- package/components/NButton.d.ts +21 -3
- package/components/NButton.js +5 -1
- package/components/NCheckbox.d.ts +12 -0
- package/components/NCheckbox.js +6 -2
- package/components/NCheckboxLabel.d.ts +3 -0
- package/components/NCheckboxLabel.js +8 -2
- package/components/NDropdown.d.ts +12 -0
- package/components/NDropdown.js +6 -2
- package/components/NDropzone.d.ts +12 -0
- package/components/NDropzone.js +6 -2
- package/components/NIconButton.d.ts +30 -6
- package/components/NIconButton.js +5 -1
- package/components/NIconCircle.d.ts +12 -0
- package/components/NIconCircle.js +6 -2
- package/components/NInput.d.ts +33 -3
- package/components/NInput.js +12 -2
- package/components/NInputPhone.d.ts +15 -3
- package/components/NInputSelect.d.ts +15 -3
- package/components/NInputSuggestion.d.ts +15 -3
- package/components/NLink.d.ts +12 -0
- package/components/NLink.js +5 -1
- package/components/NList.d.ts +12 -0
- package/components/NList.js +8 -2
- package/components/NLoadingIndicator.d.ts +12 -0
- package/components/NLoadingIndicator.js +6 -2
- package/components/NPagination.d.ts +12 -0
- package/components/NPagination.js +5 -1
- package/components/NSearchbar.d.ts +15 -3
- package/components/NSearchbar.js +8 -2
- package/components/NSearchbarList.d.ts +33 -3
- package/components/NSearchbarList.js +11 -2
- package/components/NSelect.d.ts +33 -3
- package/components/NSelect.js +9 -1
- package/components/NTable.d.ts +12 -0
- package/components/NTable.js +6 -2
- package/components/NTableAction.d.ts +12 -0
- package/components/NTableAction.js +5 -1
- package/components/NTextArea.d.ts +36 -12
- package/components/NTextArea.js +9 -1
- package/components/NTooltip.d.ts +39 -5
- package/components/NTooltip.js +23 -5
- package/components/NValInput.d.ts +15 -3
- package/components/NValInput.js +9 -4
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -26,15 +26,17 @@ This section shows how to create a new Vue project with the recommended tech-sta
|
|
|
26
26
|
These are the steps to add Vue Collection to an existing project. You may have to go through the steps of `Project Setup` and check if you have the neccesary (peer-)dependencies installed.
|
|
27
27
|
|
|
28
28
|
1. Go to [npmjs.com](https://npmjs.com), sign in with naptics and create a new read-only classic access token.
|
|
29
|
-
2.
|
|
29
|
+
2. Add a `.npmrc` file in your repository and add the following contents.
|
|
30
30
|
|
|
31
31
|
```
|
|
32
|
-
//registry.npmjs.org/:_authToken
|
|
32
|
+
//registry.npmjs.org/:_authToken=${NPM_TOKEN}
|
|
33
33
|
```
|
|
34
34
|
|
|
35
|
-
3.
|
|
36
|
-
4.
|
|
37
|
-
5.
|
|
35
|
+
3. Add the created token to your environment with the key `NPM_TOKEN` (e.g., by modifing `~/.zshrc`).
|
|
36
|
+
4. If the project also uses pipelines to build, make sure to create a second read-only token and add it to the build environment secrets.
|
|
37
|
+
5. Install Vue Collection with `npm i @naptics/vue-collection`.
|
|
38
|
+
6. Add tailwind config -> See below
|
|
39
|
+
7. Register i18n provider -> See below
|
|
38
40
|
|
|
39
41
|
## Create new components
|
|
40
42
|
|
package/components/NAlert.d.ts
CHANGED
|
@@ -16,6 +16,10 @@ export declare const nAlertProps: {
|
|
|
16
16
|
* If set to `true` the X-button of the alert is hidden.
|
|
17
17
|
*/
|
|
18
18
|
readonly hideX: BooleanConstructor;
|
|
19
|
+
/**
|
|
20
|
+
* Adds the classes to the top-level element.
|
|
21
|
+
*/
|
|
22
|
+
readonly addClass: StringConstructor;
|
|
19
23
|
/**
|
|
20
24
|
* This is called, when the X-button is clicked.
|
|
21
25
|
*/
|
|
@@ -41,6 +45,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
41
45
|
* If set to `true` the X-button of the alert is hidden.
|
|
42
46
|
*/
|
|
43
47
|
readonly hideX: BooleanConstructor;
|
|
48
|
+
/**
|
|
49
|
+
* Adds the classes to the top-level element.
|
|
50
|
+
*/
|
|
51
|
+
readonly addClass: StringConstructor;
|
|
44
52
|
/**
|
|
45
53
|
* This is called, when the X-button is clicked.
|
|
46
54
|
*/
|
|
@@ -61,6 +69,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
61
69
|
* If set to `true` the X-button of the alert is hidden.
|
|
62
70
|
*/
|
|
63
71
|
readonly hideX: BooleanConstructor;
|
|
72
|
+
/**
|
|
73
|
+
* Adds the classes to the top-level element.
|
|
74
|
+
*/
|
|
75
|
+
readonly addClass: StringConstructor;
|
|
64
76
|
/**
|
|
65
77
|
* This is called, when the X-button is clicked.
|
|
66
78
|
*/
|
package/components/NAlert.js
CHANGED
|
@@ -20,6 +20,10 @@ export const nAlertProps = {
|
|
|
20
20
|
* If set to `true` the X-button of the alert is hidden.
|
|
21
21
|
*/
|
|
22
22
|
hideX: Boolean,
|
|
23
|
+
/**
|
|
24
|
+
* Adds the classes to the top-level element.
|
|
25
|
+
*/
|
|
26
|
+
addClass: String,
|
|
23
27
|
/**
|
|
24
28
|
* This is called, when the X-button is clicked.
|
|
25
29
|
*/
|
|
@@ -32,7 +36,7 @@ export const nAlertProps = {
|
|
|
32
36
|
export default createComponent('NAlert', nAlertProps, props => {
|
|
33
37
|
const variant = computed(() => VARIANTS[props.variant]);
|
|
34
38
|
return () => _createVNode("div", {
|
|
35
|
-
"class": `rounded-md p-3 shadow-lg bg-${variant.value.color}-50`
|
|
39
|
+
"class": `rounded-md p-3 shadow-lg bg-${variant.value.color}-50 ${props.addClass}`
|
|
36
40
|
}, [_createVNode("div", {
|
|
37
41
|
"class": "flex items-center"
|
|
38
42
|
}, [_createVNode("div", {
|
package/components/NBadge.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import type { TWTextSize } from '../utils/tailwind';
|
|
|
2
2
|
import type { PropType } from 'vue';
|
|
3
3
|
export declare const nBadgeProps: {
|
|
4
4
|
readonly tooltipText: StringConstructor;
|
|
5
|
-
readonly tooltipContent: PropType<() =>
|
|
5
|
+
readonly tooltipContent: PropType<() => JSX.Element>;
|
|
6
6
|
readonly tooltipHide: BooleanConstructor;
|
|
7
7
|
readonly tooltipShow: BooleanConstructor;
|
|
8
8
|
readonly tooltipPlacement: {
|
|
@@ -13,6 +13,8 @@ export declare const nBadgeProps: {
|
|
|
13
13
|
readonly type: PropType<import("../utils/tailwind").TWMaxWidth>;
|
|
14
14
|
readonly default: "max-w-xs";
|
|
15
15
|
};
|
|
16
|
+
readonly tooltipWrapperAddClass: StringConstructor;
|
|
17
|
+
readonly tooltipContentAddClass: StringConstructor;
|
|
16
18
|
/**
|
|
17
19
|
* The text of the badge. Can alternatively be passed in the default slot.
|
|
18
20
|
*/
|
|
@@ -52,13 +54,17 @@ export declare const nBadgeProps: {
|
|
|
52
54
|
readonly type: BooleanConstructor;
|
|
53
55
|
readonly default: true;
|
|
54
56
|
};
|
|
57
|
+
/**
|
|
58
|
+
* Adds the classes to the top-level element.
|
|
59
|
+
*/
|
|
60
|
+
readonly addClass: StringConstructor;
|
|
55
61
|
};
|
|
56
62
|
/**
|
|
57
63
|
* The `NBadge` is a styled element to wrap a text.
|
|
58
64
|
*/
|
|
59
65
|
declare const _default: import("vue").DefineComponent<{
|
|
60
66
|
readonly tooltipText: StringConstructor;
|
|
61
|
-
readonly tooltipContent: PropType<() =>
|
|
67
|
+
readonly tooltipContent: PropType<() => JSX.Element>;
|
|
62
68
|
readonly tooltipHide: BooleanConstructor;
|
|
63
69
|
readonly tooltipShow: BooleanConstructor;
|
|
64
70
|
readonly tooltipPlacement: {
|
|
@@ -69,6 +75,8 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
69
75
|
readonly type: PropType<import("../utils/tailwind").TWMaxWidth>;
|
|
70
76
|
readonly default: "max-w-xs";
|
|
71
77
|
};
|
|
78
|
+
readonly tooltipWrapperAddClass: StringConstructor;
|
|
79
|
+
readonly tooltipContentAddClass: StringConstructor;
|
|
72
80
|
/**
|
|
73
81
|
* The text of the badge. Can alternatively be passed in the default slot.
|
|
74
82
|
*/
|
|
@@ -108,9 +116,13 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
108
116
|
readonly type: BooleanConstructor;
|
|
109
117
|
readonly default: true;
|
|
110
118
|
};
|
|
119
|
+
/**
|
|
120
|
+
* Adds the classes to the top-level element.
|
|
121
|
+
*/
|
|
122
|
+
readonly addClass: StringConstructor;
|
|
111
123
|
}, import("vue").RenderFunction, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, never[], never, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
112
124
|
readonly tooltipText: StringConstructor;
|
|
113
|
-
readonly tooltipContent: PropType<() =>
|
|
125
|
+
readonly tooltipContent: PropType<() => JSX.Element>;
|
|
114
126
|
readonly tooltipHide: BooleanConstructor;
|
|
115
127
|
readonly tooltipShow: BooleanConstructor;
|
|
116
128
|
readonly tooltipPlacement: {
|
|
@@ -121,6 +133,8 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
121
133
|
readonly type: PropType<import("../utils/tailwind").TWMaxWidth>;
|
|
122
134
|
readonly default: "max-w-xs";
|
|
123
135
|
};
|
|
136
|
+
readonly tooltipWrapperAddClass: StringConstructor;
|
|
137
|
+
readonly tooltipContentAddClass: StringConstructor;
|
|
124
138
|
/**
|
|
125
139
|
* The text of the badge. Can alternatively be passed in the default slot.
|
|
126
140
|
*/
|
|
@@ -160,6 +174,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
160
174
|
readonly type: BooleanConstructor;
|
|
161
175
|
readonly default: true;
|
|
162
176
|
};
|
|
177
|
+
/**
|
|
178
|
+
* Adds the classes to the top-level element.
|
|
179
|
+
*/
|
|
180
|
+
readonly addClass: StringConstructor;
|
|
163
181
|
}>> & {}, {
|
|
164
182
|
readonly color: string;
|
|
165
183
|
readonly shade: number;
|
package/components/NBadge.js
CHANGED
|
@@ -41,6 +41,10 @@ export const nBadgeProps = {
|
|
|
41
41
|
type: Boolean,
|
|
42
42
|
default: true
|
|
43
43
|
},
|
|
44
|
+
/**
|
|
45
|
+
* Adds the classes to the top-level element.
|
|
46
|
+
*/
|
|
47
|
+
addClass: String,
|
|
44
48
|
...nToolTipPropsForImplementor
|
|
45
49
|
};
|
|
46
50
|
/**
|
|
@@ -51,7 +55,7 @@ export default createComponent('NBadge', nBadgeProps, (props, {
|
|
|
51
55
|
}) => {
|
|
52
56
|
return () => _createVNode(NTooltip, mapTooltipProps(props), {
|
|
53
57
|
default: () => [_createVNode("div", {
|
|
54
|
-
"class": ['px-2 py-1 rounded-md font-semibold shadow', `${props.textSize} bg-${props.color}-${props.shade} text-${props.color}-${props.textShade}`, props.allCaps ? 'uppercase' : '']
|
|
58
|
+
"class": ['px-2 py-1 rounded-md font-semibold shadow', `${props.textSize} bg-${props.color}-${props.shade} text-${props.color}-${props.textShade}`, props.allCaps ? 'uppercase' : '', props.addClass]
|
|
55
59
|
}, [slots.default?.() || props.text])]
|
|
56
60
|
});
|
|
57
61
|
});
|
|
@@ -38,6 +38,10 @@ export declare const nBreadcrumbProps: {
|
|
|
38
38
|
readonly type: NumberConstructor;
|
|
39
39
|
readonly default: 5;
|
|
40
40
|
};
|
|
41
|
+
/**
|
|
42
|
+
* Adds the classes to the top-level element.
|
|
43
|
+
*/
|
|
44
|
+
readonly addClass: StringConstructor;
|
|
41
45
|
/**
|
|
42
46
|
* A slot the replace the breadcrumb labels.
|
|
43
47
|
*/
|
|
@@ -97,6 +101,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
97
101
|
readonly type: NumberConstructor;
|
|
98
102
|
readonly default: 5;
|
|
99
103
|
};
|
|
104
|
+
/**
|
|
105
|
+
* Adds the classes to the top-level element.
|
|
106
|
+
*/
|
|
107
|
+
readonly addClass: StringConstructor;
|
|
100
108
|
/**
|
|
101
109
|
* A slot the replace the breadcrumb labels.
|
|
102
110
|
*/
|
|
@@ -142,6 +150,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
142
150
|
readonly type: NumberConstructor;
|
|
143
151
|
readonly default: 5;
|
|
144
152
|
};
|
|
153
|
+
/**
|
|
154
|
+
* Adds the classes to the top-level element.
|
|
155
|
+
*/
|
|
156
|
+
readonly addClass: StringConstructor;
|
|
145
157
|
/**
|
|
146
158
|
* A slot the replace the breadcrumb labels.
|
|
147
159
|
*/
|
package/components/NBreadcrub.js
CHANGED
|
@@ -38,6 +38,10 @@ export const nBreadcrumbProps = {
|
|
|
38
38
|
type: Number,
|
|
39
39
|
default: 5
|
|
40
40
|
},
|
|
41
|
+
/**
|
|
42
|
+
* Adds the classes to the top-level element.
|
|
43
|
+
*/
|
|
44
|
+
addClass: String,
|
|
41
45
|
/**
|
|
42
46
|
* A slot the replace the breadcrumb labels.
|
|
43
47
|
*/
|
|
@@ -53,7 +57,7 @@ export const nBreadcrumbProps = {
|
|
|
53
57
|
*/
|
|
54
58
|
export default createComponent('NBreadcrumb', nBreadcrumbProps, props => {
|
|
55
59
|
return () => _createVNode("div", {
|
|
56
|
-
"class":
|
|
60
|
+
"class": `flex flex-wrap items-center ${props.addClass}`
|
|
57
61
|
}, [props.items.map((item, index) => _createVNode(_Fragment, null, [props.item?.(item, index) || _createVNode(NLink, {
|
|
58
62
|
"textSize": props.textSize,
|
|
59
63
|
"route": item.route,
|
package/components/NButton.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type PropType } from 'vue';
|
|
2
2
|
export declare const nButtonProps: {
|
|
3
3
|
readonly tooltipText: StringConstructor;
|
|
4
|
-
readonly tooltipContent: PropType<() =>
|
|
4
|
+
readonly tooltipContent: PropType<() => JSX.Element>;
|
|
5
5
|
readonly tooltipHide: BooleanConstructor;
|
|
6
6
|
readonly tooltipShow: BooleanConstructor;
|
|
7
7
|
readonly tooltipPlacement: {
|
|
@@ -12,6 +12,8 @@ export declare const nButtonProps: {
|
|
|
12
12
|
readonly type: PropType<import("../utils/tailwind").TWMaxWidth>;
|
|
13
13
|
readonly default: "max-w-xs";
|
|
14
14
|
};
|
|
15
|
+
readonly tooltipWrapperAddClass: StringConstructor;
|
|
16
|
+
readonly tooltipContentAddClass: StringConstructor;
|
|
15
17
|
/**
|
|
16
18
|
* The color of the button.
|
|
17
19
|
*/
|
|
@@ -39,6 +41,10 @@ export declare const nButtonProps: {
|
|
|
39
41
|
* If set to `true` the button will appear smaller.
|
|
40
42
|
*/
|
|
41
43
|
readonly small: BooleanConstructor;
|
|
44
|
+
/**
|
|
45
|
+
* Adds the classes to the top-level element.
|
|
46
|
+
*/
|
|
47
|
+
readonly addClass: StringConstructor;
|
|
42
48
|
/**
|
|
43
49
|
* This is called, when the button is clicked.
|
|
44
50
|
*/
|
|
@@ -49,7 +55,7 @@ export declare const nButtonProps: {
|
|
|
49
55
|
*/
|
|
50
56
|
declare const _default: import("vue").DefineComponent<{
|
|
51
57
|
readonly tooltipText: StringConstructor;
|
|
52
|
-
readonly tooltipContent: PropType<() =>
|
|
58
|
+
readonly tooltipContent: PropType<() => JSX.Element>;
|
|
53
59
|
readonly tooltipHide: BooleanConstructor;
|
|
54
60
|
readonly tooltipShow: BooleanConstructor;
|
|
55
61
|
readonly tooltipPlacement: {
|
|
@@ -60,6 +66,8 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
60
66
|
readonly type: PropType<import("../utils/tailwind").TWMaxWidth>;
|
|
61
67
|
readonly default: "max-w-xs";
|
|
62
68
|
};
|
|
69
|
+
readonly tooltipWrapperAddClass: StringConstructor;
|
|
70
|
+
readonly tooltipContentAddClass: StringConstructor;
|
|
63
71
|
/**
|
|
64
72
|
* The color of the button.
|
|
65
73
|
*/
|
|
@@ -87,13 +95,17 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
87
95
|
* If set to `true` the button will appear smaller.
|
|
88
96
|
*/
|
|
89
97
|
readonly small: BooleanConstructor;
|
|
98
|
+
/**
|
|
99
|
+
* Adds the classes to the top-level element.
|
|
100
|
+
*/
|
|
101
|
+
readonly addClass: StringConstructor;
|
|
90
102
|
/**
|
|
91
103
|
* This is called, when the button is clicked.
|
|
92
104
|
*/
|
|
93
105
|
readonly onClick: PropType<() => void>;
|
|
94
106
|
}, import("vue").RenderFunction, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, never[], never, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
95
107
|
readonly tooltipText: StringConstructor;
|
|
96
|
-
readonly tooltipContent: PropType<() =>
|
|
108
|
+
readonly tooltipContent: PropType<() => JSX.Element>;
|
|
97
109
|
readonly tooltipHide: BooleanConstructor;
|
|
98
110
|
readonly tooltipShow: BooleanConstructor;
|
|
99
111
|
readonly tooltipPlacement: {
|
|
@@ -104,6 +116,8 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
104
116
|
readonly type: PropType<import("../utils/tailwind").TWMaxWidth>;
|
|
105
117
|
readonly default: "max-w-xs";
|
|
106
118
|
};
|
|
119
|
+
readonly tooltipWrapperAddClass: StringConstructor;
|
|
120
|
+
readonly tooltipContentAddClass: StringConstructor;
|
|
107
121
|
/**
|
|
108
122
|
* The color of the button.
|
|
109
123
|
*/
|
|
@@ -131,6 +145,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
131
145
|
* If set to `true` the button will appear smaller.
|
|
132
146
|
*/
|
|
133
147
|
readonly small: BooleanConstructor;
|
|
148
|
+
/**
|
|
149
|
+
* Adds the classes to the top-level element.
|
|
150
|
+
*/
|
|
151
|
+
readonly addClass: StringConstructor;
|
|
134
152
|
/**
|
|
135
153
|
* This is called, when the button is clicked.
|
|
136
154
|
*/
|
package/components/NButton.js
CHANGED
|
@@ -31,6 +31,10 @@ export const nButtonProps = {
|
|
|
31
31
|
* If set to `true` the button will appear smaller.
|
|
32
32
|
*/
|
|
33
33
|
small: Boolean,
|
|
34
|
+
/**
|
|
35
|
+
* Adds the classes to the top-level element.
|
|
36
|
+
*/
|
|
37
|
+
addClass: String,
|
|
34
38
|
/**
|
|
35
39
|
* This is called, when the button is clicked.
|
|
36
40
|
*/
|
|
@@ -48,7 +52,7 @@ export default createComponent('NButton', nButtonProps, (props, {
|
|
|
48
52
|
default: () => [_createVNode("button", {
|
|
49
53
|
"disabled": isDisabled.value,
|
|
50
54
|
"type": props.type,
|
|
51
|
-
"class": [`block w-full font-medium rounded-md focus:outline-none focus-visible:ring-2 shadow text-${props.color}-900 relative`, isDisabled.value ? `bg-${props.color}-100 text-opacity-20 cursor-default` : `bg-${props.color}-200 hover:bg-${props.color}-300 focus-visible:ring-${props.color}-500`, props.small ? 'py-1 px-2 text-xs' : 'py-2 px-4 text-sm'],
|
|
55
|
+
"class": [`block w-full font-medium rounded-md focus:outline-none focus-visible:ring-2 shadow text-${props.color}-900 relative`, isDisabled.value ? `bg-${props.color}-100 text-opacity-20 cursor-default` : `bg-${props.color}-200 hover:bg-${props.color}-300 focus-visible:ring-${props.color}-500`, props.small ? 'py-1 px-2 text-xs' : 'py-2 px-4 text-sm', props.addClass],
|
|
52
56
|
"onClick": props.onClick
|
|
53
57
|
}, [_createVNode("span", {
|
|
54
58
|
"class": {
|
|
@@ -10,6 +10,10 @@ export declare const nCheckboxProps: {
|
|
|
10
10
|
* If set to `true` the checkbox is disabled and no interaction is possible.
|
|
11
11
|
*/
|
|
12
12
|
readonly disabled: BooleanConstructor;
|
|
13
|
+
/**
|
|
14
|
+
* Adds the classes to the top-level element.
|
|
15
|
+
*/
|
|
16
|
+
readonly addClass: StringConstructor;
|
|
13
17
|
readonly value: import("vue").PropType<boolean>;
|
|
14
18
|
readonly onUpdateValue: import("vue").PropType<(newValue: boolean) => void>;
|
|
15
19
|
};
|
|
@@ -28,6 +32,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
28
32
|
* If set to `true` the checkbox is disabled and no interaction is possible.
|
|
29
33
|
*/
|
|
30
34
|
readonly disabled: BooleanConstructor;
|
|
35
|
+
/**
|
|
36
|
+
* Adds the classes to the top-level element.
|
|
37
|
+
*/
|
|
38
|
+
readonly addClass: StringConstructor;
|
|
31
39
|
readonly value: import("vue").PropType<boolean>;
|
|
32
40
|
readonly onUpdateValue: import("vue").PropType<(newValue: boolean) => void>;
|
|
33
41
|
}, import("vue").RenderFunction, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, never[], never, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
@@ -42,6 +50,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
42
50
|
* If set to `true` the checkbox is disabled and no interaction is possible.
|
|
43
51
|
*/
|
|
44
52
|
readonly disabled: BooleanConstructor;
|
|
53
|
+
/**
|
|
54
|
+
* Adds the classes to the top-level element.
|
|
55
|
+
*/
|
|
56
|
+
readonly addClass: StringConstructor;
|
|
45
57
|
readonly value: import("vue").PropType<boolean>;
|
|
46
58
|
readonly onUpdateValue: import("vue").PropType<(newValue: boolean) => void>;
|
|
47
59
|
}>> & {}, {
|
package/components/NCheckbox.js
CHANGED
|
@@ -14,7 +14,11 @@ export const nCheckboxProps = {
|
|
|
14
14
|
/**
|
|
15
15
|
* If set to `true` the checkbox is disabled and no interaction is possible.
|
|
16
16
|
*/
|
|
17
|
-
disabled: Boolean
|
|
17
|
+
disabled: Boolean,
|
|
18
|
+
/**
|
|
19
|
+
* Adds the classes to the top-level element.
|
|
20
|
+
*/
|
|
21
|
+
addClass: String
|
|
18
22
|
};
|
|
19
23
|
/**
|
|
20
24
|
* The `NCheckbox` is a styled checkbox.
|
|
@@ -37,6 +41,6 @@ export default createComponent('NCheckbox', nCheckboxProps, props => {
|
|
|
37
41
|
"disabled": props.disabled,
|
|
38
42
|
"onClick": toggle,
|
|
39
43
|
"key": updateKey.value,
|
|
40
|
-
"class": [`h-5 w-5 border-default-300 rounded focus:outline-none focus:ring-0 focus-visible:ring-2 focus-visible:ring-${props.color}-500`, props.disabled ? `cursor-default bg-default-100 text-${props.color}-200` : `cursor-pointer text-${props.color}-400
|
|
44
|
+
"class": [`h-5 w-5 border-default-300 rounded focus:outline-none focus:ring-0 focus-visible:ring-2 focus-visible:ring-${props.color}-500`, props.disabled ? `cursor-default bg-default-100 text-${props.color}-200` : `cursor-pointer text-${props.color}-400`, props.addClass]
|
|
41
45
|
}, null);
|
|
42
46
|
});
|
|
@@ -16,6 +16,7 @@ export declare const nCheckboxLabelProps: {
|
|
|
16
16
|
readonly default: "primary";
|
|
17
17
|
};
|
|
18
18
|
readonly disabled: BooleanConstructor;
|
|
19
|
+
readonly addClass: StringConstructor;
|
|
19
20
|
readonly value: import("vue").PropType<boolean>;
|
|
20
21
|
readonly onUpdateValue: import("vue").PropType<(newValue: boolean) => void>;
|
|
21
22
|
};
|
|
@@ -40,6 +41,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
40
41
|
readonly default: "primary";
|
|
41
42
|
};
|
|
42
43
|
readonly disabled: BooleanConstructor;
|
|
44
|
+
readonly addClass: StringConstructor;
|
|
43
45
|
readonly value: import("vue").PropType<boolean>;
|
|
44
46
|
readonly onUpdateValue: import("vue").PropType<(newValue: boolean) => void>;
|
|
45
47
|
}, import("vue").RenderFunction, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, never[], never, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
@@ -60,6 +62,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
60
62
|
readonly default: "primary";
|
|
61
63
|
};
|
|
62
64
|
readonly disabled: BooleanConstructor;
|
|
65
|
+
readonly addClass: StringConstructor;
|
|
63
66
|
readonly value: import("vue").PropType<boolean>;
|
|
64
67
|
readonly onUpdateValue: import("vue").PropType<(newValue: boolean) => void>;
|
|
65
68
|
}>> & {}, {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { createVNode as _createVNode } from "vue";
|
|
2
|
+
import { computed } from 'vue';
|
|
2
3
|
import { createComponent } from '../utils/component';
|
|
3
4
|
import NCheckbox, { nCheckboxProps } from './NCheckbox';
|
|
4
5
|
export const nCheckboxLabelProps = {
|
|
@@ -23,9 +24,14 @@ export default createComponent('NCheckboxLabel', nCheckboxLabelProps, props => {
|
|
|
23
24
|
const toggleValue = () => {
|
|
24
25
|
if (!props.disabled) props.onUpdateValue?.(!props.value);
|
|
25
26
|
};
|
|
27
|
+
// addClass is not passed as it is used on the top-level element.
|
|
28
|
+
const childProps = computed(() => ({
|
|
29
|
+
...props,
|
|
30
|
+
addClass: undefined
|
|
31
|
+
}));
|
|
26
32
|
return () => _createVNode("div", {
|
|
27
|
-
"class":
|
|
28
|
-
}, [_createVNode(NCheckbox,
|
|
33
|
+
"class": `flex items-center ${props.addClass}`
|
|
34
|
+
}, [_createVNode(NCheckbox, childProps.value, null), _createVNode("div", {
|
|
29
35
|
"class": `${props.compact ? 'ml-2' : 'ml-3'} text-sm`
|
|
30
36
|
}, [_createVNode("label", {
|
|
31
37
|
"onClick": toggleValue,
|
|
@@ -27,6 +27,10 @@ export declare const nDropdownProps: {
|
|
|
27
27
|
* A slot to replace the button of the dropdown.
|
|
28
28
|
*/
|
|
29
29
|
readonly button: PropType<() => JSX.Element>;
|
|
30
|
+
/**
|
|
31
|
+
* Adds the classes to the top-level element.
|
|
32
|
+
*/
|
|
33
|
+
readonly addClass: StringConstructor;
|
|
30
34
|
};
|
|
31
35
|
export type DropdownItem = {
|
|
32
36
|
/**
|
|
@@ -82,6 +86,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
82
86
|
* A slot to replace the button of the dropdown.
|
|
83
87
|
*/
|
|
84
88
|
readonly button: PropType<() => JSX.Element>;
|
|
89
|
+
/**
|
|
90
|
+
* Adds the classes to the top-level element.
|
|
91
|
+
*/
|
|
92
|
+
readonly addClass: StringConstructor;
|
|
85
93
|
}, import("vue").RenderFunction, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, never[], never, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
86
94
|
/**
|
|
87
95
|
* The title of the dropdown-button.
|
|
@@ -108,6 +116,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
108
116
|
* A slot to replace the button of the dropdown.
|
|
109
117
|
*/
|
|
110
118
|
readonly button: PropType<() => JSX.Element>;
|
|
119
|
+
/**
|
|
120
|
+
* Adds the classes to the top-level element.
|
|
121
|
+
*/
|
|
122
|
+
readonly addClass: StringConstructor;
|
|
111
123
|
}>> & {}, {
|
|
112
124
|
readonly right: boolean;
|
|
113
125
|
readonly disabled: boolean;
|
package/components/NDropdown.js
CHANGED
|
@@ -32,7 +32,11 @@ export const nDropdownProps = {
|
|
|
32
32
|
/**
|
|
33
33
|
* A slot to replace the button of the dropdown.
|
|
34
34
|
*/
|
|
35
|
-
button: Function
|
|
35
|
+
button: Function,
|
|
36
|
+
/**
|
|
37
|
+
* Adds the classes to the top-level element.
|
|
38
|
+
*/
|
|
39
|
+
addClass: String
|
|
36
40
|
};
|
|
37
41
|
/**
|
|
38
42
|
* The `NDropdown` consists of a button and a panel with multiple actions.
|
|
@@ -52,7 +56,7 @@ export default createComponent('NDropdown', nDropdownProps, (props, {
|
|
|
52
56
|
}, null), _createVNode("span", null, [item.label])]);
|
|
53
57
|
return () => _createVNode(Menu, {
|
|
54
58
|
"as": "div",
|
|
55
|
-
"class":
|
|
59
|
+
"class": `relative inline-block text-left ${props.addClass}`
|
|
56
60
|
}, {
|
|
57
61
|
default: () => [_createVNode("div", {
|
|
58
62
|
"class": "flex"
|
|
@@ -46,6 +46,10 @@ export declare const nDropzoneProps: {
|
|
|
46
46
|
readonly type: StringConstructor;
|
|
47
47
|
readonly default: "min-h-36";
|
|
48
48
|
};
|
|
49
|
+
/**
|
|
50
|
+
* Adds the classes to the top-level element.
|
|
51
|
+
*/
|
|
52
|
+
readonly addClass: StringConstructor;
|
|
49
53
|
readonly value: import("vue").PropType<File[]>;
|
|
50
54
|
readonly onUpdateValue: import("vue").PropType<(newValue: File[]) => void>;
|
|
51
55
|
};
|
|
@@ -101,6 +105,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
101
105
|
readonly type: StringConstructor;
|
|
102
106
|
readonly default: "min-h-36";
|
|
103
107
|
};
|
|
108
|
+
/**
|
|
109
|
+
* Adds the classes to the top-level element.
|
|
110
|
+
*/
|
|
111
|
+
readonly addClass: StringConstructor;
|
|
104
112
|
readonly value: import("vue").PropType<File[]>;
|
|
105
113
|
readonly onUpdateValue: import("vue").PropType<(newValue: File[]) => void>;
|
|
106
114
|
}, import("vue").RenderFunction, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, never[], never, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
@@ -151,6 +159,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
151
159
|
readonly type: StringConstructor;
|
|
152
160
|
readonly default: "min-h-36";
|
|
153
161
|
};
|
|
162
|
+
/**
|
|
163
|
+
* Adds the classes to the top-level element.
|
|
164
|
+
*/
|
|
165
|
+
readonly addClass: StringConstructor;
|
|
154
166
|
readonly value: import("vue").PropType<File[]>;
|
|
155
167
|
readonly onUpdateValue: import("vue").PropType<(newValue: File[]) => void>;
|
|
156
168
|
}>> & {}, {
|
package/components/NDropzone.js
CHANGED
|
@@ -60,7 +60,11 @@ export const nDropzoneProps = {
|
|
|
60
60
|
height: {
|
|
61
61
|
type: String,
|
|
62
62
|
default: 'min-h-36'
|
|
63
|
-
}
|
|
63
|
+
},
|
|
64
|
+
/**
|
|
65
|
+
* Adds the classes to the top-level element.
|
|
66
|
+
*/
|
|
67
|
+
addClass: String
|
|
64
68
|
};
|
|
65
69
|
/**
|
|
66
70
|
* The `NDropzone` is an area where files can be added by the user by drag & drop.
|
|
@@ -143,7 +147,7 @@ export default createComponent('NDropzone', nDropzoneProps, props => {
|
|
|
143
147
|
return () => {
|
|
144
148
|
let _slot;
|
|
145
149
|
return _createVNode("div", null, [_createVNode("button", {
|
|
146
|
-
"class": ['block w-full rounded-md border-dashed border-2 hover:border-primary-300 hover:bg-primary-50 focus-visible:border-primary-500 focus:outline-none ', 'flex flex-col items-center justify-center text-center text-sm select-none hover:text-primary-700 p-4', isDragOver.value ? 'border-primary-300 bg-primary-50 text-primary-700' : 'border-default-300 bg-default-50 text-default-500', props.height],
|
|
150
|
+
"class": ['block w-full rounded-md border-dashed border-2 hover:border-primary-300 hover:bg-primary-50 focus-visible:border-primary-500 focus:outline-none ', 'flex flex-col items-center justify-center text-center text-sm select-none hover:text-primary-700 p-4', isDragOver.value ? 'border-primary-300 bg-primary-50 text-primary-700' : 'border-default-300 bg-default-50 text-default-500', props.height, props.addClass],
|
|
147
151
|
"onDrop": onDrop,
|
|
148
152
|
"onDragover": onDragOver,
|
|
149
153
|
"onDragleave": onDragLeave,
|
|
@@ -3,17 +3,21 @@ import type { PropType } from 'vue';
|
|
|
3
3
|
import { type RouteLocationRaw } from 'vue-router';
|
|
4
4
|
export declare const nIconButtonProps: {
|
|
5
5
|
readonly tooltipText: StringConstructor;
|
|
6
|
-
readonly tooltipContent: PropType<() =>
|
|
6
|
+
readonly tooltipContent: PropType<() => JSX.Element>;
|
|
7
7
|
readonly tooltipHide: BooleanConstructor;
|
|
8
8
|
readonly tooltipShow: BooleanConstructor;
|
|
9
9
|
readonly tooltipPlacement: {
|
|
10
|
-
readonly type: PropType<import("./NTooltip").TooltipPlacement>;
|
|
10
|
+
readonly type: PropType<import("./NTooltip").TooltipPlacement>; /**
|
|
11
|
+
* If set to `true` the icon-button is disabled and no interaction is possible.
|
|
12
|
+
*/
|
|
11
13
|
readonly default: "auto";
|
|
12
14
|
};
|
|
13
15
|
readonly tooltipMaxWidth: {
|
|
14
16
|
readonly type: PropType<import("../utils/tailwind").TWMaxWidth>;
|
|
15
17
|
readonly default: "max-w-xs";
|
|
16
18
|
};
|
|
19
|
+
readonly tooltipWrapperAddClass: StringConstructor;
|
|
20
|
+
readonly tooltipContentAddClass: StringConstructor;
|
|
17
21
|
/**
|
|
18
22
|
* The icon of the icon-button.
|
|
19
23
|
*/
|
|
@@ -57,6 +61,10 @@ export declare const nIconButtonProps: {
|
|
|
57
61
|
* If set to `true` the icon-button is disabled and no interaction is possible.
|
|
58
62
|
*/
|
|
59
63
|
readonly disabled: BooleanConstructor;
|
|
64
|
+
/**
|
|
65
|
+
* Adds the classes to the top-level element.
|
|
66
|
+
*/
|
|
67
|
+
readonly addClass: StringConstructor;
|
|
60
68
|
/**
|
|
61
69
|
* This is called when the icon-button is clicked.
|
|
62
70
|
* It is only called when the `route` prop is not set on the icon-button.
|
|
@@ -68,17 +76,21 @@ export declare const nIconButtonProps: {
|
|
|
68
76
|
*/
|
|
69
77
|
declare const _default: import("vue").DefineComponent<{
|
|
70
78
|
readonly tooltipText: StringConstructor;
|
|
71
|
-
readonly tooltipContent: PropType<() =>
|
|
79
|
+
readonly tooltipContent: PropType<() => JSX.Element>;
|
|
72
80
|
readonly tooltipHide: BooleanConstructor;
|
|
73
81
|
readonly tooltipShow: BooleanConstructor;
|
|
74
82
|
readonly tooltipPlacement: {
|
|
75
|
-
readonly type: PropType<import("./NTooltip").TooltipPlacement>;
|
|
83
|
+
readonly type: PropType<import("./NTooltip").TooltipPlacement>; /**
|
|
84
|
+
* If set to `true` the icon-button is disabled and no interaction is possible.
|
|
85
|
+
*/
|
|
76
86
|
readonly default: "auto";
|
|
77
87
|
};
|
|
78
88
|
readonly tooltipMaxWidth: {
|
|
79
89
|
readonly type: PropType<import("../utils/tailwind").TWMaxWidth>;
|
|
80
90
|
readonly default: "max-w-xs";
|
|
81
91
|
};
|
|
92
|
+
readonly tooltipWrapperAddClass: StringConstructor;
|
|
93
|
+
readonly tooltipContentAddClass: StringConstructor;
|
|
82
94
|
/**
|
|
83
95
|
* The icon of the icon-button.
|
|
84
96
|
*/
|
|
@@ -122,6 +134,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
122
134
|
* If set to `true` the icon-button is disabled and no interaction is possible.
|
|
123
135
|
*/
|
|
124
136
|
readonly disabled: BooleanConstructor;
|
|
137
|
+
/**
|
|
138
|
+
* Adds the classes to the top-level element.
|
|
139
|
+
*/
|
|
140
|
+
readonly addClass: StringConstructor;
|
|
125
141
|
/**
|
|
126
142
|
* This is called when the icon-button is clicked.
|
|
127
143
|
* It is only called when the `route` prop is not set on the icon-button.
|
|
@@ -129,17 +145,21 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
129
145
|
readonly onClick: PropType<() => void>;
|
|
130
146
|
}, import("vue").RenderFunction, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, never[], never, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
131
147
|
readonly tooltipText: StringConstructor;
|
|
132
|
-
readonly tooltipContent: PropType<() =>
|
|
148
|
+
readonly tooltipContent: PropType<() => JSX.Element>;
|
|
133
149
|
readonly tooltipHide: BooleanConstructor;
|
|
134
150
|
readonly tooltipShow: BooleanConstructor;
|
|
135
151
|
readonly tooltipPlacement: {
|
|
136
|
-
readonly type: PropType<import("./NTooltip").TooltipPlacement>;
|
|
152
|
+
readonly type: PropType<import("./NTooltip").TooltipPlacement>; /**
|
|
153
|
+
* If set to `true` the icon-button is disabled and no interaction is possible.
|
|
154
|
+
*/
|
|
137
155
|
readonly default: "auto";
|
|
138
156
|
};
|
|
139
157
|
readonly tooltipMaxWidth: {
|
|
140
158
|
readonly type: PropType<import("../utils/tailwind").TWMaxWidth>;
|
|
141
159
|
readonly default: "max-w-xs";
|
|
142
160
|
};
|
|
161
|
+
readonly tooltipWrapperAddClass: StringConstructor;
|
|
162
|
+
readonly tooltipContentAddClass: StringConstructor;
|
|
143
163
|
/**
|
|
144
164
|
* The icon of the icon-button.
|
|
145
165
|
*/
|
|
@@ -183,6 +203,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
183
203
|
* If set to `true` the icon-button is disabled and no interaction is possible.
|
|
184
204
|
*/
|
|
185
205
|
readonly disabled: BooleanConstructor;
|
|
206
|
+
/**
|
|
207
|
+
* Adds the classes to the top-level element.
|
|
208
|
+
*/
|
|
209
|
+
readonly addClass: StringConstructor;
|
|
186
210
|
/**
|
|
187
211
|
* This is called when the icon-button is clicked.
|
|
188
212
|
* It is only called when the `route` prop is not set on the icon-button.
|