@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/components/NTooltip.js
CHANGED
|
@@ -40,7 +40,15 @@ export const nTooltipProps = {
|
|
|
40
40
|
maxWidth: {
|
|
41
41
|
type: String,
|
|
42
42
|
default: 'max-w-xs'
|
|
43
|
-
}
|
|
43
|
+
},
|
|
44
|
+
/**
|
|
45
|
+
* Adds the classes to the (invisible) wrapper element.
|
|
46
|
+
*/
|
|
47
|
+
wrapperAddClass: String,
|
|
48
|
+
/**
|
|
49
|
+
* Adds the classes to the container of the tooltips content.
|
|
50
|
+
*/
|
|
51
|
+
contentAddClass: String
|
|
44
52
|
};
|
|
45
53
|
/**
|
|
46
54
|
* These props are made to use on a component which implements the tooltip
|
|
@@ -75,7 +83,15 @@ export const nToolTipPropsForImplementor = {
|
|
|
75
83
|
/**
|
|
76
84
|
* @see {@link nTooltipProps.maxWidth}
|
|
77
85
|
*/
|
|
78
|
-
tooltipMaxWidth: nTooltipProps.maxWidth
|
|
86
|
+
tooltipMaxWidth: nTooltipProps.maxWidth,
|
|
87
|
+
/**
|
|
88
|
+
* @see {@link nTooltipProps.wrapperAddClass}
|
|
89
|
+
*/
|
|
90
|
+
tooltipWrapperAddClass: nTooltipProps.wrapperAddClass,
|
|
91
|
+
/**
|
|
92
|
+
* @see {@link nTooltipProps.contentAddClass}
|
|
93
|
+
*/
|
|
94
|
+
tooltipContentAddClass: nTooltipProps.contentAddClass
|
|
79
95
|
};
|
|
80
96
|
/**
|
|
81
97
|
* Maps the {@link nToolTipPropsForImplementor} props to normal tooltip props
|
|
@@ -88,7 +104,9 @@ export function mapTooltipProps(props) {
|
|
|
88
104
|
hide: props.tooltipHide,
|
|
89
105
|
show: props.tooltipShow,
|
|
90
106
|
placement: props.tooltipPlacement,
|
|
91
|
-
maxWidth: props.tooltipMaxWidth
|
|
107
|
+
maxWidth: props.tooltipMaxWidth,
|
|
108
|
+
wrapperAddClass: props.tooltipWrapperAddClass,
|
|
109
|
+
contentAddClass: props.tooltipContentAddClass
|
|
92
110
|
};
|
|
93
111
|
}
|
|
94
112
|
/**
|
|
@@ -106,7 +124,7 @@ export default createComponent('NTooltip', nTooltipProps, (props, {
|
|
|
106
124
|
slots
|
|
107
125
|
}) => {
|
|
108
126
|
return () => _createVNode("div", {
|
|
109
|
-
"class": props.block ? 'block' : 'inline-block'
|
|
127
|
+
"class": [props.block ? 'block' : 'inline-block', props.wrapperAddClass]
|
|
110
128
|
}, [props.content || props.text ? _createVNode(NTooltipBase, props, {
|
|
111
129
|
default: () => [slots.default?.()]
|
|
112
130
|
}) : slots.default?.()]);
|
|
@@ -169,7 +187,7 @@ const NTooltipBase = createComponent('NTooltipBase', nTooltipProps, (props, {
|
|
|
169
187
|
"onMouseleave": () => isHoveringTooltip.value = false,
|
|
170
188
|
"class": [isHovering.value ? 'z-20' : 'z-10', props.maxWidth, 'tooltip']
|
|
171
189
|
}, [_createVNode("div", {
|
|
172
|
-
"class":
|
|
190
|
+
"class": `bg-white rounded-md py-2 px-4 shadow-lg border-default-200 border text-sm whitespace-normal font-normal text-default-700 ${props.contentAddClass}`
|
|
173
191
|
}, [props.content?.() || props.text]), _createVNode("div", {
|
|
174
192
|
"data-popper-arrow": true,
|
|
175
193
|
"class": "arrow"
|
|
@@ -82,7 +82,7 @@ export declare const nValInputProps: {
|
|
|
82
82
|
*/
|
|
83
83
|
readonly disableBlurValidation: BooleanConstructor;
|
|
84
84
|
readonly tooltipText: StringConstructor;
|
|
85
|
-
readonly tooltipContent: PropType<() =>
|
|
85
|
+
readonly tooltipContent: PropType<() => JSX.Element>;
|
|
86
86
|
readonly tooltipHide: BooleanConstructor;
|
|
87
87
|
readonly tooltipShow: BooleanConstructor;
|
|
88
88
|
readonly tooltipPlacement: {
|
|
@@ -93,6 +93,8 @@ export declare const nValInputProps: {
|
|
|
93
93
|
readonly type: PropType<import("../utils/tailwind").TWMaxWidth>;
|
|
94
94
|
readonly default: "max-w-xs";
|
|
95
95
|
};
|
|
96
|
+
readonly tooltipWrapperAddClass: StringConstructor;
|
|
97
|
+
readonly tooltipContentAddClass: StringConstructor;
|
|
96
98
|
readonly name: StringConstructor;
|
|
97
99
|
readonly placeholder: StringConstructor;
|
|
98
100
|
readonly autocomplete: {
|
|
@@ -108,6 +110,8 @@ export declare const nValInputProps: {
|
|
|
108
110
|
readonly disabled: BooleanConstructor;
|
|
109
111
|
readonly small: BooleanConstructor;
|
|
110
112
|
readonly hideLabel: BooleanConstructor;
|
|
113
|
+
readonly inputClass: StringConstructor;
|
|
114
|
+
readonly addClass: StringConstructor;
|
|
111
115
|
readonly onFocus: PropType<() => void>;
|
|
112
116
|
readonly onBlur: PropType<() => void>;
|
|
113
117
|
readonly value: PropType<string>;
|
|
@@ -176,7 +180,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
176
180
|
*/
|
|
177
181
|
readonly disableBlurValidation: BooleanConstructor;
|
|
178
182
|
readonly tooltipText: StringConstructor;
|
|
179
|
-
readonly tooltipContent: PropType<() =>
|
|
183
|
+
readonly tooltipContent: PropType<() => JSX.Element>;
|
|
180
184
|
readonly tooltipHide: BooleanConstructor;
|
|
181
185
|
readonly tooltipShow: BooleanConstructor;
|
|
182
186
|
readonly tooltipPlacement: {
|
|
@@ -187,6 +191,8 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
187
191
|
readonly type: PropType<import("../utils/tailwind").TWMaxWidth>;
|
|
188
192
|
readonly default: "max-w-xs";
|
|
189
193
|
};
|
|
194
|
+
readonly tooltipWrapperAddClass: StringConstructor;
|
|
195
|
+
readonly tooltipContentAddClass: StringConstructor;
|
|
190
196
|
readonly name: StringConstructor;
|
|
191
197
|
readonly placeholder: StringConstructor;
|
|
192
198
|
readonly autocomplete: {
|
|
@@ -202,6 +208,8 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
202
208
|
readonly disabled: BooleanConstructor;
|
|
203
209
|
readonly small: BooleanConstructor;
|
|
204
210
|
readonly hideLabel: BooleanConstructor;
|
|
211
|
+
readonly inputClass: StringConstructor;
|
|
212
|
+
readonly addClass: StringConstructor;
|
|
205
213
|
readonly onFocus: PropType<() => void>;
|
|
206
214
|
readonly onBlur: PropType<() => void>;
|
|
207
215
|
readonly value: PropType<string>;
|
|
@@ -248,7 +256,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
248
256
|
*/
|
|
249
257
|
readonly disableBlurValidation: BooleanConstructor;
|
|
250
258
|
readonly tooltipText: StringConstructor;
|
|
251
|
-
readonly tooltipContent: PropType<() =>
|
|
259
|
+
readonly tooltipContent: PropType<() => JSX.Element>;
|
|
252
260
|
readonly tooltipHide: BooleanConstructor;
|
|
253
261
|
readonly tooltipShow: BooleanConstructor;
|
|
254
262
|
readonly tooltipPlacement: {
|
|
@@ -259,6 +267,8 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
259
267
|
readonly type: PropType<import("../utils/tailwind").TWMaxWidth>;
|
|
260
268
|
readonly default: "max-w-xs";
|
|
261
269
|
};
|
|
270
|
+
readonly tooltipWrapperAddClass: StringConstructor;
|
|
271
|
+
readonly tooltipContentAddClass: StringConstructor;
|
|
262
272
|
readonly name: StringConstructor;
|
|
263
273
|
readonly placeholder: StringConstructor;
|
|
264
274
|
readonly autocomplete: {
|
|
@@ -274,6 +284,8 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
274
284
|
readonly disabled: BooleanConstructor;
|
|
275
285
|
readonly small: BooleanConstructor;
|
|
276
286
|
readonly hideLabel: BooleanConstructor;
|
|
287
|
+
readonly inputClass: StringConstructor;
|
|
288
|
+
readonly addClass: StringConstructor;
|
|
277
289
|
readonly onFocus: PropType<() => void>;
|
|
278
290
|
readonly onBlur: PropType<() => void>;
|
|
279
291
|
readonly value: PropType<string>;
|
package/components/NValInput.js
CHANGED
|
@@ -93,12 +93,17 @@ export default createComponent('NValInput', nValInputProps, (props, context) =>
|
|
|
93
93
|
};
|
|
94
94
|
context.expose(expose);
|
|
95
95
|
props.form?.addInput(expose);
|
|
96
|
-
|
|
97
|
-
"ref": inputRef
|
|
98
|
-
}, {
|
|
96
|
+
const childProps = computed(() => ({
|
|
99
97
|
...props,
|
|
98
|
+
// We should not pass this property to the child, as the class is applied on this element.
|
|
99
|
+
addClass: undefined,
|
|
100
100
|
...inputSlotProps
|
|
101
|
-
})
|
|
101
|
+
}));
|
|
102
|
+
return () => _createVNode("div", {
|
|
103
|
+
"class": props.addClass
|
|
104
|
+
}, [props.input?.(inputSlotProps) || _createVNode(NInput, _mergeProps({
|
|
105
|
+
"ref": inputRef
|
|
106
|
+
}, childProps.value), null), showErrorMessage.value && _createVNode("p", {
|
|
102
107
|
"class": "text-red-500 text-xs mt-1"
|
|
103
108
|
}, [errorMessage.value])]);
|
|
104
109
|
});
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@naptics/vue-collection",
|
|
3
3
|
"author": "Timo Siegenthaler",
|
|
4
4
|
"description": "Vue Collection is a collection of styled and fully functional Vue components which can easily be integrated into our projects.",
|
|
5
|
-
"version": "0.
|
|
5
|
+
"version": "0.1.1",
|
|
6
6
|
"main": "./index.js",
|
|
7
7
|
"repository": {
|
|
8
8
|
"type": "git",
|