@naptics/vue-collection 0.1.10 → 0.2.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/components/NAlert.d.ts +0 -12
- package/components/NAlert.js +1 -5
- package/components/NBadge.d.ts +21 -12
- package/components/NBadge.js +5 -3
- package/components/NBreadcrub.d.ts +3 -15
- package/components/NBreadcrub.js +3 -7
- package/components/NButton.d.ts +21 -12
- package/components/NButton.js +5 -3
- package/components/NCheckbox.d.ts +0 -12
- package/components/NCheckbox.js +2 -6
- package/components/NCheckboxLabel.d.ts +0 -3
- package/components/NCheckboxLabel.js +2 -8
- package/components/NDropdown.d.ts +89 -14
- package/components/NDropdown.js +9 -7
- package/components/NDropzone.d.ts +0 -12
- package/components/NDropzone.js +2 -6
- package/components/NFormModal.js +11 -7
- package/components/NIconButton.d.ts +21 -12
- package/components/NIconButton.js +5 -3
- package/components/NIconCircle.d.ts +0 -12
- package/components/NIconCircle.js +2 -6
- package/components/NInput.d.ts +9 -18
- package/components/NInput.js +1 -7
- package/components/NInputPhone.d.ts +9 -9
- package/components/NInputSelect.d.ts +9 -9
- package/components/NInputSuggestion.d.ts +9 -9
- package/components/NLink.d.ts +0 -12
- package/components/NLink.js +1 -5
- package/components/NList.d.ts +0 -12
- package/components/NList.js +2 -8
- package/components/NLoadingIndicator.d.ts +0 -12
- package/components/NLoadingIndicator.js +2 -6
- package/components/NPagination.d.ts +0 -12
- package/components/NPagination.js +1 -5
- package/components/NSearchbar.d.ts +0 -12
- package/components/NSearchbar.js +1 -7
- package/components/NSearchbarList.d.ts +0 -12
- package/components/NSearchbarList.js +1 -6
- package/components/NSelect.d.ts +9 -18
- package/components/NSelect.js +0 -4
- package/components/NTable.d.ts +27 -53
- package/components/NTable.js +21 -30
- package/components/NTableAction.d.ts +0 -12
- package/components/NTableAction.js +1 -5
- package/components/NTextArea.d.ts +9 -18
- package/components/NTextArea.js +0 -4
- package/components/NTooltip.d.ts +32 -12
- package/components/NTooltip.js +21 -11
- package/components/NValInput.d.ts +9 -9
- package/components/NValInput.js +4 -9
- package/package.json +1 -1
- package/utils/utils.d.ts +7 -0
- package/utils/utils.js +9 -0
package/components/NAlert.d.ts
CHANGED
|
@@ -16,10 +16,6 @@ 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;
|
|
23
19
|
/**
|
|
24
20
|
* This is called, when the X-button is clicked.
|
|
25
21
|
*/
|
|
@@ -45,10 +41,6 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
45
41
|
* If set to `true` the X-button of the alert is hidden.
|
|
46
42
|
*/
|
|
47
43
|
readonly hideX: BooleanConstructor;
|
|
48
|
-
/**
|
|
49
|
-
* Adds the classes to the top-level element.
|
|
50
|
-
*/
|
|
51
|
-
readonly addClass: StringConstructor;
|
|
52
44
|
/**
|
|
53
45
|
* This is called, when the X-button is clicked.
|
|
54
46
|
*/
|
|
@@ -69,10 +61,6 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
69
61
|
* If set to `true` the X-button of the alert is hidden.
|
|
70
62
|
*/
|
|
71
63
|
readonly hideX: BooleanConstructor;
|
|
72
|
-
/**
|
|
73
|
-
* Adds the classes to the top-level element.
|
|
74
|
-
*/
|
|
75
|
-
readonly addClass: StringConstructor;
|
|
76
64
|
/**
|
|
77
65
|
* This is called, when the X-button is clicked.
|
|
78
66
|
*/
|
package/components/NAlert.js
CHANGED
|
@@ -20,10 +20,6 @@ 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,
|
|
27
23
|
/**
|
|
28
24
|
* This is called, when the X-button is clicked.
|
|
29
25
|
*/
|
|
@@ -38,7 +34,7 @@ export default createComponent('NAlert', nAlertProps, (props, {
|
|
|
38
34
|
}) => {
|
|
39
35
|
const variant = computed(() => VARIANTS[props.variant]);
|
|
40
36
|
return () => _createVNode("div", {
|
|
41
|
-
"class": `rounded-md p-3 shadow-lg bg-${variant.value.color}-50
|
|
37
|
+
"class": `rounded-md p-3 shadow-lg bg-${variant.value.color}-50`
|
|
42
38
|
}, [_createVNode("div", {
|
|
43
39
|
"class": "flex items-center"
|
|
44
40
|
}, [_createVNode("div", {
|
package/components/NBadge.d.ts
CHANGED
|
@@ -13,8 +13,9 @@ export declare const nBadgeProps: {
|
|
|
13
13
|
readonly type: PropType<import("../utils/tailwind").TWMaxWidth>;
|
|
14
14
|
readonly default: "max-w-xs";
|
|
15
15
|
};
|
|
16
|
-
readonly
|
|
17
|
-
readonly
|
|
16
|
+
readonly tooltipWrapperClass: StringConstructor;
|
|
17
|
+
readonly tooltipContentClass: StringConstructor;
|
|
18
|
+
readonly tooltipArrowClass: StringConstructor;
|
|
18
19
|
/**
|
|
19
20
|
* The text of the badge. Can alternatively be passed in the default slot.
|
|
20
21
|
*/
|
|
@@ -55,9 +56,11 @@ export declare const nBadgeProps: {
|
|
|
55
56
|
readonly default: true;
|
|
56
57
|
};
|
|
57
58
|
/**
|
|
58
|
-
* Adds the classes to the
|
|
59
|
+
* Adds the classes to the badge.
|
|
60
|
+
* Use this instead of `class` to style the button, because the button is wrapped inside
|
|
61
|
+
* a div for the tooltip and `class` would be applied to the wrapping div.
|
|
59
62
|
*/
|
|
60
|
-
readonly
|
|
63
|
+
readonly badgeClass: StringConstructor;
|
|
61
64
|
};
|
|
62
65
|
/**
|
|
63
66
|
* The `NBadge` is a styled element to wrap a text.
|
|
@@ -75,8 +78,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
75
78
|
readonly type: PropType<import("../utils/tailwind").TWMaxWidth>;
|
|
76
79
|
readonly default: "max-w-xs";
|
|
77
80
|
};
|
|
78
|
-
readonly
|
|
79
|
-
readonly
|
|
81
|
+
readonly tooltipWrapperClass: StringConstructor;
|
|
82
|
+
readonly tooltipContentClass: StringConstructor;
|
|
83
|
+
readonly tooltipArrowClass: StringConstructor;
|
|
80
84
|
/**
|
|
81
85
|
* The text of the badge. Can alternatively be passed in the default slot.
|
|
82
86
|
*/
|
|
@@ -117,9 +121,11 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
117
121
|
readonly default: true;
|
|
118
122
|
};
|
|
119
123
|
/**
|
|
120
|
-
* Adds the classes to the
|
|
124
|
+
* Adds the classes to the badge.
|
|
125
|
+
* Use this instead of `class` to style the button, because the button is wrapped inside
|
|
126
|
+
* a div for the tooltip and `class` would be applied to the wrapping div.
|
|
121
127
|
*/
|
|
122
|
-
readonly
|
|
128
|
+
readonly badgeClass: StringConstructor;
|
|
123
129
|
}, 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<{
|
|
124
130
|
readonly tooltipText: StringConstructor;
|
|
125
131
|
readonly tooltipContent: PropType<() => JSX.Element>;
|
|
@@ -133,8 +139,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
133
139
|
readonly type: PropType<import("../utils/tailwind").TWMaxWidth>;
|
|
134
140
|
readonly default: "max-w-xs";
|
|
135
141
|
};
|
|
136
|
-
readonly
|
|
137
|
-
readonly
|
|
142
|
+
readonly tooltipWrapperClass: StringConstructor;
|
|
143
|
+
readonly tooltipContentClass: StringConstructor;
|
|
144
|
+
readonly tooltipArrowClass: StringConstructor;
|
|
138
145
|
/**
|
|
139
146
|
* The text of the badge. Can alternatively be passed in the default slot.
|
|
140
147
|
*/
|
|
@@ -175,9 +182,11 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
175
182
|
readonly default: true;
|
|
176
183
|
};
|
|
177
184
|
/**
|
|
178
|
-
* Adds the classes to the
|
|
185
|
+
* Adds the classes to the badge.
|
|
186
|
+
* Use this instead of `class` to style the button, because the button is wrapped inside
|
|
187
|
+
* a div for the tooltip and `class` would be applied to the wrapping div.
|
|
179
188
|
*/
|
|
180
|
-
readonly
|
|
189
|
+
readonly badgeClass: StringConstructor;
|
|
181
190
|
}>> & {}, {
|
|
182
191
|
readonly color: string;
|
|
183
192
|
readonly shade: number;
|
package/components/NBadge.js
CHANGED
|
@@ -42,9 +42,11 @@ export const nBadgeProps = {
|
|
|
42
42
|
default: true
|
|
43
43
|
},
|
|
44
44
|
/**
|
|
45
|
-
* Adds the classes to the
|
|
45
|
+
* Adds the classes to the badge.
|
|
46
|
+
* Use this instead of `class` to style the button, because the button is wrapped inside
|
|
47
|
+
* a div for the tooltip and `class` would be applied to the wrapping div.
|
|
46
48
|
*/
|
|
47
|
-
|
|
49
|
+
badgeClass: String,
|
|
48
50
|
...nToolTipPropsForImplementor
|
|
49
51
|
};
|
|
50
52
|
/**
|
|
@@ -55,7 +57,7 @@ export default createComponent('NBadge', nBadgeProps, (props, {
|
|
|
55
57
|
}) => {
|
|
56
58
|
return () => _createVNode(NTooltip, mapTooltipProps(props), {
|
|
57
59
|
default: () => [_createVNode("div", {
|
|
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.
|
|
60
|
+
"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.badgeClass]
|
|
59
61
|
}, [slots.default?.() || props.text])]
|
|
60
62
|
});
|
|
61
63
|
});
|
|
@@ -38,14 +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;
|
|
45
41
|
/**
|
|
46
42
|
* Adds the classes to the separator icons.
|
|
47
43
|
*/
|
|
48
|
-
readonly
|
|
44
|
+
readonly iconClass: StringConstructor;
|
|
49
45
|
/**
|
|
50
46
|
* A slot the replace the breadcrumb labels.
|
|
51
47
|
*/
|
|
@@ -105,14 +101,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
105
101
|
readonly type: NumberConstructor;
|
|
106
102
|
readonly default: 5;
|
|
107
103
|
};
|
|
108
|
-
/**
|
|
109
|
-
* Adds the classes to the top-level element.
|
|
110
|
-
*/
|
|
111
|
-
readonly addClass: StringConstructor;
|
|
112
104
|
/**
|
|
113
105
|
* Adds the classes to the separator icons.
|
|
114
106
|
*/
|
|
115
|
-
readonly
|
|
107
|
+
readonly iconClass: StringConstructor;
|
|
116
108
|
/**
|
|
117
109
|
* A slot the replace the breadcrumb labels.
|
|
118
110
|
*/
|
|
@@ -158,14 +150,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
158
150
|
readonly type: NumberConstructor;
|
|
159
151
|
readonly default: 5;
|
|
160
152
|
};
|
|
161
|
-
/**
|
|
162
|
-
* Adds the classes to the top-level element.
|
|
163
|
-
*/
|
|
164
|
-
readonly addClass: StringConstructor;
|
|
165
153
|
/**
|
|
166
154
|
* Adds the classes to the separator icons.
|
|
167
155
|
*/
|
|
168
|
-
readonly
|
|
156
|
+
readonly iconClass: StringConstructor;
|
|
169
157
|
/**
|
|
170
158
|
* A slot the replace the breadcrumb labels.
|
|
171
159
|
*/
|
package/components/NBreadcrub.js
CHANGED
|
@@ -38,14 +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,
|
|
45
41
|
/**
|
|
46
42
|
* Adds the classes to the separator icons.
|
|
47
43
|
*/
|
|
48
|
-
|
|
44
|
+
iconClass: String,
|
|
49
45
|
/**
|
|
50
46
|
* A slot the replace the breadcrumb labels.
|
|
51
47
|
*/
|
|
@@ -61,7 +57,7 @@ export const nBreadcrumbProps = {
|
|
|
61
57
|
*/
|
|
62
58
|
export default createComponentWithSlots('NBreadcrumb', nBreadcrumbProps, ['seperator', 'item'], props => {
|
|
63
59
|
return () => _createVNode("div", {
|
|
64
|
-
"class": `flex flex-wrap items-center
|
|
60
|
+
"class": `flex flex-wrap items-center`
|
|
65
61
|
}, [props.items.map((item, index) => _createVNode(_Fragment, null, [props.item?.(item, index) || _createVNode(NLink, {
|
|
66
62
|
"textSize": props.textSize,
|
|
67
63
|
"route": item.route,
|
|
@@ -69,6 +65,6 @@ export default createComponentWithSlots('NBreadcrumb', nBreadcrumbProps, ['seper
|
|
|
69
65
|
}, {
|
|
70
66
|
default: () => [item.label]
|
|
71
67
|
}), index < props.items.length - 1 && (props.seperator?.(item, index) || _createVNode(props.icon, {
|
|
72
|
-
"class": `mx-2 w-${props.iconSize} h-${props.iconSize} text-${props.color}-500 ${props.
|
|
68
|
+
"class": `mx-2 w-${props.iconSize} h-${props.iconSize} text-${props.color}-500 ${props.iconClass}`
|
|
73
69
|
}, null))]))]);
|
|
74
70
|
});
|
package/components/NButton.d.ts
CHANGED
|
@@ -12,8 +12,9 @@ export declare const nButtonProps: {
|
|
|
12
12
|
readonly type: PropType<import("../utils/tailwind").TWMaxWidth>;
|
|
13
13
|
readonly default: "max-w-xs";
|
|
14
14
|
};
|
|
15
|
-
readonly
|
|
16
|
-
readonly
|
|
15
|
+
readonly tooltipWrapperClass: StringConstructor;
|
|
16
|
+
readonly tooltipContentClass: StringConstructor;
|
|
17
|
+
readonly tooltipArrowClass: StringConstructor;
|
|
17
18
|
/**
|
|
18
19
|
* The color of the button.
|
|
19
20
|
*/
|
|
@@ -42,9 +43,11 @@ export declare const nButtonProps: {
|
|
|
42
43
|
*/
|
|
43
44
|
readonly small: BooleanConstructor;
|
|
44
45
|
/**
|
|
45
|
-
* Adds the classes to the
|
|
46
|
+
* Adds the classes to the button.
|
|
47
|
+
* Use this instead of `class` to style the button, because the button is wrapped inside
|
|
48
|
+
* a div for the tooltip and `class` would be applied to the wrapping div.
|
|
46
49
|
*/
|
|
47
|
-
readonly
|
|
50
|
+
readonly buttonClass: StringConstructor;
|
|
48
51
|
/**
|
|
49
52
|
* This is called, when the button is clicked.
|
|
50
53
|
*/
|
|
@@ -66,8 +69,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
66
69
|
readonly type: PropType<import("../utils/tailwind").TWMaxWidth>;
|
|
67
70
|
readonly default: "max-w-xs";
|
|
68
71
|
};
|
|
69
|
-
readonly
|
|
70
|
-
readonly
|
|
72
|
+
readonly tooltipWrapperClass: StringConstructor;
|
|
73
|
+
readonly tooltipContentClass: StringConstructor;
|
|
74
|
+
readonly tooltipArrowClass: StringConstructor;
|
|
71
75
|
/**
|
|
72
76
|
* The color of the button.
|
|
73
77
|
*/
|
|
@@ -96,9 +100,11 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
96
100
|
*/
|
|
97
101
|
readonly small: BooleanConstructor;
|
|
98
102
|
/**
|
|
99
|
-
* Adds the classes to the
|
|
103
|
+
* Adds the classes to the button.
|
|
104
|
+
* Use this instead of `class` to style the button, because the button is wrapped inside
|
|
105
|
+
* a div for the tooltip and `class` would be applied to the wrapping div.
|
|
100
106
|
*/
|
|
101
|
-
readonly
|
|
107
|
+
readonly buttonClass: StringConstructor;
|
|
102
108
|
/**
|
|
103
109
|
* This is called, when the button is clicked.
|
|
104
110
|
*/
|
|
@@ -116,8 +122,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
116
122
|
readonly type: PropType<import("../utils/tailwind").TWMaxWidth>;
|
|
117
123
|
readonly default: "max-w-xs";
|
|
118
124
|
};
|
|
119
|
-
readonly
|
|
120
|
-
readonly
|
|
125
|
+
readonly tooltipWrapperClass: StringConstructor;
|
|
126
|
+
readonly tooltipContentClass: StringConstructor;
|
|
127
|
+
readonly tooltipArrowClass: StringConstructor;
|
|
121
128
|
/**
|
|
122
129
|
* The color of the button.
|
|
123
130
|
*/
|
|
@@ -146,9 +153,11 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
146
153
|
*/
|
|
147
154
|
readonly small: BooleanConstructor;
|
|
148
155
|
/**
|
|
149
|
-
* Adds the classes to the
|
|
156
|
+
* Adds the classes to the button.
|
|
157
|
+
* Use this instead of `class` to style the button, because the button is wrapped inside
|
|
158
|
+
* a div for the tooltip and `class` would be applied to the wrapping div.
|
|
150
159
|
*/
|
|
151
|
-
readonly
|
|
160
|
+
readonly buttonClass: StringConstructor;
|
|
152
161
|
/**
|
|
153
162
|
* This is called, when the button is clicked.
|
|
154
163
|
*/
|
package/components/NButton.js
CHANGED
|
@@ -32,9 +32,11 @@ export const nButtonProps = {
|
|
|
32
32
|
*/
|
|
33
33
|
small: Boolean,
|
|
34
34
|
/**
|
|
35
|
-
* Adds the classes to the
|
|
35
|
+
* Adds the classes to the button.
|
|
36
|
+
* Use this instead of `class` to style the button, because the button is wrapped inside
|
|
37
|
+
* a div for the tooltip and `class` would be applied to the wrapping div.
|
|
36
38
|
*/
|
|
37
|
-
|
|
39
|
+
buttonClass: String,
|
|
38
40
|
/**
|
|
39
41
|
* This is called, when the button is clicked.
|
|
40
42
|
*/
|
|
@@ -52,7 +54,7 @@ export default createComponent('NButton', nButtonProps, (props, {
|
|
|
52
54
|
default: () => [_createVNode("button", {
|
|
53
55
|
"disabled": isDisabled.value,
|
|
54
56
|
"type": props.type,
|
|
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.
|
|
57
|
+
"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.buttonClass],
|
|
56
58
|
"onClick": props.onClick
|
|
57
59
|
}, [_createVNode("span", {
|
|
58
60
|
"class": {
|
|
@@ -10,10 +10,6 @@ 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;
|
|
17
13
|
readonly value: import("vue").PropType<boolean>;
|
|
18
14
|
readonly onUpdateValue: import("vue").PropType<(newValue: boolean) => void>;
|
|
19
15
|
};
|
|
@@ -32,10 +28,6 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
32
28
|
* If set to `true` the checkbox is disabled and no interaction is possible.
|
|
33
29
|
*/
|
|
34
30
|
readonly disabled: BooleanConstructor;
|
|
35
|
-
/**
|
|
36
|
-
* Adds the classes to the top-level element.
|
|
37
|
-
*/
|
|
38
|
-
readonly addClass: StringConstructor;
|
|
39
31
|
readonly value: import("vue").PropType<boolean>;
|
|
40
32
|
readonly onUpdateValue: import("vue").PropType<(newValue: boolean) => void>;
|
|
41
33
|
}, 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<{
|
|
@@ -50,10 +42,6 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
50
42
|
* If set to `true` the checkbox is disabled and no interaction is possible.
|
|
51
43
|
*/
|
|
52
44
|
readonly disabled: BooleanConstructor;
|
|
53
|
-
/**
|
|
54
|
-
* Adds the classes to the top-level element.
|
|
55
|
-
*/
|
|
56
|
-
readonly addClass: StringConstructor;
|
|
57
45
|
readonly value: import("vue").PropType<boolean>;
|
|
58
46
|
readonly onUpdateValue: import("vue").PropType<(newValue: boolean) => void>;
|
|
59
47
|
}>> & {}, {
|
package/components/NCheckbox.js
CHANGED
|
@@ -14,11 +14,7 @@ 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
|
|
18
|
-
/**
|
|
19
|
-
* Adds the classes to the top-level element.
|
|
20
|
-
*/
|
|
21
|
-
addClass: String
|
|
17
|
+
disabled: Boolean
|
|
22
18
|
};
|
|
23
19
|
/**
|
|
24
20
|
* The `NCheckbox` is a styled checkbox.
|
|
@@ -41,6 +37,6 @@ export default createComponent('NCheckbox', nCheckboxProps, props => {
|
|
|
41
37
|
"disabled": props.disabled,
|
|
42
38
|
"onClick": toggle,
|
|
43
39
|
"key": updateKey.value,
|
|
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
|
|
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`]
|
|
45
41
|
}, null);
|
|
46
42
|
});
|
|
@@ -16,7 +16,6 @@ export declare const nCheckboxLabelProps: {
|
|
|
16
16
|
readonly default: "primary";
|
|
17
17
|
};
|
|
18
18
|
readonly disabled: BooleanConstructor;
|
|
19
|
-
readonly addClass: StringConstructor;
|
|
20
19
|
readonly value: import("vue").PropType<boolean>;
|
|
21
20
|
readonly onUpdateValue: import("vue").PropType<(newValue: boolean) => void>;
|
|
22
21
|
};
|
|
@@ -41,7 +40,6 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
41
40
|
readonly default: "primary";
|
|
42
41
|
};
|
|
43
42
|
readonly disabled: BooleanConstructor;
|
|
44
|
-
readonly addClass: StringConstructor;
|
|
45
43
|
readonly value: import("vue").PropType<boolean>;
|
|
46
44
|
readonly onUpdateValue: import("vue").PropType<(newValue: boolean) => void>;
|
|
47
45
|
}, 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<{
|
|
@@ -62,7 +60,6 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
62
60
|
readonly default: "primary";
|
|
63
61
|
};
|
|
64
62
|
readonly disabled: BooleanConstructor;
|
|
65
|
-
readonly addClass: StringConstructor;
|
|
66
63
|
readonly value: import("vue").PropType<boolean>;
|
|
67
64
|
readonly onUpdateValue: import("vue").PropType<(newValue: boolean) => void>;
|
|
68
65
|
}>> & {}, {
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { createVNode as _createVNode } from "vue";
|
|
2
|
-
import { computed } from 'vue';
|
|
3
2
|
import { createComponent } from '../utils/component';
|
|
4
3
|
import NCheckbox, { nCheckboxProps } from './NCheckbox';
|
|
5
4
|
export const nCheckboxLabelProps = {
|
|
@@ -24,14 +23,9 @@ export default createComponent('NCheckboxLabel', nCheckboxLabelProps, props => {
|
|
|
24
23
|
const toggleValue = () => {
|
|
25
24
|
if (!props.disabled) props.onUpdateValue?.(!props.value);
|
|
26
25
|
};
|
|
27
|
-
// addClass is not passed as it is used on the top-level element.
|
|
28
|
-
const childProps = computed(() => ({
|
|
29
|
-
...props,
|
|
30
|
-
addClass: undefined
|
|
31
|
-
}));
|
|
32
26
|
return () => _createVNode("div", {
|
|
33
|
-
"class": `flex items-center
|
|
34
|
-
}, [_createVNode(NCheckbox,
|
|
27
|
+
"class": `flex items-center`
|
|
28
|
+
}, [_createVNode(NCheckbox, props, null), _createVNode("div", {
|
|
35
29
|
"class": `${props.compact ? 'ml-2' : 'ml-3'} text-sm`
|
|
36
30
|
}, [_createVNode("label", {
|
|
37
31
|
"onClick": toggleValue,
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { type PropType } from 'vue';
|
|
2
2
|
import { type RouteLocationRaw } from 'vue-router';
|
|
3
|
+
import { MenuButton } from '@headlessui/vue';
|
|
3
4
|
import type { HeroIcon } from '../utils/tailwind';
|
|
4
5
|
export declare const nDropdownProps: {
|
|
5
6
|
/**
|
|
@@ -24,13 +25,15 @@ export declare const nDropdownProps: {
|
|
|
24
25
|
*/
|
|
25
26
|
readonly disabled: BooleanConstructor;
|
|
26
27
|
/**
|
|
27
|
-
*
|
|
28
|
+
* Adds the classes to the Button of the dropdown.
|
|
28
29
|
*/
|
|
29
|
-
readonly
|
|
30
|
+
readonly buttonClass: StringConstructor;
|
|
30
31
|
/**
|
|
31
|
-
*
|
|
32
|
+
* A slot to replace the button of the dropdown.
|
|
33
|
+
* The passed parameter is the HeadlessUI `MenuButton` which should be
|
|
34
|
+
* used to create the button for the Dropdown to work properly.
|
|
32
35
|
*/
|
|
33
|
-
readonly
|
|
36
|
+
readonly button: PropType<(button: typeof MenuButton) => JSX.Element>;
|
|
34
37
|
};
|
|
35
38
|
export type DropdownItem = {
|
|
36
39
|
/**
|
|
@@ -83,13 +86,49 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
83
86
|
*/
|
|
84
87
|
readonly disabled: BooleanConstructor;
|
|
85
88
|
/**
|
|
86
|
-
*
|
|
89
|
+
* Adds the classes to the Button of the dropdown.
|
|
87
90
|
*/
|
|
88
|
-
readonly
|
|
91
|
+
readonly buttonClass: StringConstructor;
|
|
89
92
|
/**
|
|
90
|
-
*
|
|
91
|
-
|
|
92
|
-
|
|
93
|
+
* A slot to replace the button of the dropdown.
|
|
94
|
+
* The passed parameter is the HeadlessUI `MenuButton` which should be
|
|
95
|
+
* used to create the button for the Dropdown to work properly.
|
|
96
|
+
*/
|
|
97
|
+
readonly button: PropType<(button: import("vue").DefineComponent<{
|
|
98
|
+
disabled: {
|
|
99
|
+
type: BooleanConstructor;
|
|
100
|
+
default: boolean;
|
|
101
|
+
};
|
|
102
|
+
as: {
|
|
103
|
+
type: (ObjectConstructor | StringConstructor)[];
|
|
104
|
+
default: string;
|
|
105
|
+
};
|
|
106
|
+
id: {
|
|
107
|
+
type: StringConstructor;
|
|
108
|
+
default: () => string;
|
|
109
|
+
};
|
|
110
|
+
}, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
111
|
+
[key: string]: any;
|
|
112
|
+
}> | import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
113
|
+
[key: string]: any;
|
|
114
|
+
}>[] | null, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
115
|
+
disabled: {
|
|
116
|
+
type: BooleanConstructor;
|
|
117
|
+
default: boolean;
|
|
118
|
+
};
|
|
119
|
+
as: {
|
|
120
|
+
type: (ObjectConstructor | StringConstructor)[];
|
|
121
|
+
default: string;
|
|
122
|
+
};
|
|
123
|
+
id: {
|
|
124
|
+
type: StringConstructor;
|
|
125
|
+
default: () => string;
|
|
126
|
+
};
|
|
127
|
+
}>>, {
|
|
128
|
+
as: string | Record<string, any>;
|
|
129
|
+
disabled: boolean;
|
|
130
|
+
id: string;
|
|
131
|
+
}>) => JSX.Element>;
|
|
93
132
|
}, 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<{
|
|
94
133
|
/**
|
|
95
134
|
* The title of the dropdown-button.
|
|
@@ -113,13 +152,49 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
113
152
|
*/
|
|
114
153
|
readonly disabled: BooleanConstructor;
|
|
115
154
|
/**
|
|
116
|
-
*
|
|
155
|
+
* Adds the classes to the Button of the dropdown.
|
|
117
156
|
*/
|
|
118
|
-
readonly
|
|
157
|
+
readonly buttonClass: StringConstructor;
|
|
119
158
|
/**
|
|
120
|
-
*
|
|
121
|
-
|
|
122
|
-
|
|
159
|
+
* A slot to replace the button of the dropdown.
|
|
160
|
+
* The passed parameter is the HeadlessUI `MenuButton` which should be
|
|
161
|
+
* used to create the button for the Dropdown to work properly.
|
|
162
|
+
*/
|
|
163
|
+
readonly button: PropType<(button: import("vue").DefineComponent<{
|
|
164
|
+
disabled: {
|
|
165
|
+
type: BooleanConstructor;
|
|
166
|
+
default: boolean;
|
|
167
|
+
};
|
|
168
|
+
as: {
|
|
169
|
+
type: (ObjectConstructor | StringConstructor)[];
|
|
170
|
+
default: string;
|
|
171
|
+
};
|
|
172
|
+
id: {
|
|
173
|
+
type: StringConstructor;
|
|
174
|
+
default: () => string;
|
|
175
|
+
};
|
|
176
|
+
}, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
177
|
+
[key: string]: any;
|
|
178
|
+
}> | import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
179
|
+
[key: string]: any;
|
|
180
|
+
}>[] | null, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
181
|
+
disabled: {
|
|
182
|
+
type: BooleanConstructor;
|
|
183
|
+
default: boolean;
|
|
184
|
+
};
|
|
185
|
+
as: {
|
|
186
|
+
type: (ObjectConstructor | StringConstructor)[];
|
|
187
|
+
default: string;
|
|
188
|
+
};
|
|
189
|
+
id: {
|
|
190
|
+
type: StringConstructor;
|
|
191
|
+
default: () => string;
|
|
192
|
+
};
|
|
193
|
+
}>>, {
|
|
194
|
+
as: string | Record<string, any>;
|
|
195
|
+
disabled: boolean;
|
|
196
|
+
id: string;
|
|
197
|
+
}>) => JSX.Element>;
|
|
123
198
|
}>> & {}, {
|
|
124
199
|
readonly right: boolean;
|
|
125
200
|
readonly disabled: boolean;
|
package/components/NDropdown.js
CHANGED
|
@@ -30,13 +30,15 @@ export const nDropdownProps = {
|
|
|
30
30
|
*/
|
|
31
31
|
disabled: Boolean,
|
|
32
32
|
/**
|
|
33
|
-
*
|
|
33
|
+
* Adds the classes to the Button of the dropdown.
|
|
34
34
|
*/
|
|
35
|
-
|
|
35
|
+
buttonClass: String,
|
|
36
36
|
/**
|
|
37
|
-
*
|
|
37
|
+
* A slot to replace the button of the dropdown.
|
|
38
|
+
* The passed parameter is the HeadlessUI `MenuButton` which should be
|
|
39
|
+
* used to create the button for the Dropdown to work properly.
|
|
38
40
|
*/
|
|
39
|
-
|
|
41
|
+
button: Function
|
|
40
42
|
};
|
|
41
43
|
/**
|
|
42
44
|
* The `NDropdown` consists of a button and a panel with multiple actions.
|
|
@@ -56,13 +58,13 @@ export default createComponentWithSlots('NDropdown', nDropdownProps, ['button'],
|
|
|
56
58
|
}, null), _createVNode("span", null, [item.label])]);
|
|
57
59
|
return () => _createVNode(Menu, {
|
|
58
60
|
"as": "div",
|
|
59
|
-
"class": `relative inline-block text-left
|
|
61
|
+
"class": `relative inline-block text-left`
|
|
60
62
|
}, {
|
|
61
63
|
default: () => [_createVNode("div", {
|
|
62
64
|
"class": "flex"
|
|
63
|
-
}, [props.button?.() || _createVNode(MenuButton, {
|
|
65
|
+
}, [props.button?.(MenuButton) || _createVNode(MenuButton, {
|
|
64
66
|
"disabled": props.disabled,
|
|
65
|
-
"class": ['shadow w-full flex justify-between items-center text-default-700 rounded-md border bg-white border-default-300 px-4 py-2 text-sm font-medium focus:outline-none focus:ring-offset-2 focus-visible:ring-2 focus-visible:ring-primary-500', props.disabled ? 'text-opacity-20 cursor-default' : 'hover:bg-default-100']
|
|
67
|
+
"class": ['shadow w-full flex justify-between items-center text-default-700 rounded-md border bg-white border-default-300 px-4 py-2 text-sm font-medium focus:outline-none focus:ring-offset-2 focus-visible:ring-2 focus-visible:ring-primary-500', props.disabled ? 'text-opacity-20 cursor-default' : 'hover:bg-default-100', props.buttonClass]
|
|
66
68
|
}, {
|
|
67
69
|
default: () => [_createVNode("span", null, [props.title]), _createVNode(ChevronDownIcon, {
|
|
68
70
|
"class": "-mr-1 ml-2 h-5 w-5 flex-shrink-0",
|
|
@@ -46,10 +46,6 @@ 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;
|
|
53
49
|
readonly value: import("vue").PropType<File[]>;
|
|
54
50
|
readonly onUpdateValue: import("vue").PropType<(newValue: File[]) => void>;
|
|
55
51
|
};
|
|
@@ -105,10 +101,6 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
105
101
|
readonly type: StringConstructor;
|
|
106
102
|
readonly default: "min-h-36";
|
|
107
103
|
};
|
|
108
|
-
/**
|
|
109
|
-
* Adds the classes to the top-level element.
|
|
110
|
-
*/
|
|
111
|
-
readonly addClass: StringConstructor;
|
|
112
104
|
readonly value: import("vue").PropType<File[]>;
|
|
113
105
|
readonly onUpdateValue: import("vue").PropType<(newValue: File[]) => void>;
|
|
114
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<{
|
|
@@ -159,10 +151,6 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
159
151
|
readonly type: StringConstructor;
|
|
160
152
|
readonly default: "min-h-36";
|
|
161
153
|
};
|
|
162
|
-
/**
|
|
163
|
-
* Adds the classes to the top-level element.
|
|
164
|
-
*/
|
|
165
|
-
readonly addClass: StringConstructor;
|
|
166
154
|
readonly value: import("vue").PropType<File[]>;
|
|
167
155
|
readonly onUpdateValue: import("vue").PropType<(newValue: File[]) => void>;
|
|
168
156
|
}>> & {}, {
|