@naptics/vue-collection 0.1.8 → 0.1.9
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.
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { type Identifiable } from '../utils/identifiable';
|
|
2
2
|
import { type PropType } from 'vue';
|
|
3
|
+
import type { AnyObject } from '../utils/utils';
|
|
3
4
|
export declare const nInputSelectProps: {
|
|
4
5
|
/**
|
|
5
6
|
* The id of the currently selected option of this input.
|
|
@@ -62,22 +63,14 @@ export declare const nInputSelectProps: {
|
|
|
62
63
|
};
|
|
63
64
|
readonly tooltipMaxWidth: {
|
|
64
65
|
readonly type: PropType<import("../utils/tailwind").TWMaxWidth>;
|
|
65
|
-
readonly default: "max-w-xs";
|
|
66
|
-
* @see {@link nValInputProps.optional}
|
|
67
|
-
*/
|
|
66
|
+
readonly default: "max-w-xs";
|
|
68
67
|
};
|
|
69
68
|
readonly tooltipWrapperAddClass: StringConstructor;
|
|
70
69
|
readonly tooltipContentAddClass: StringConstructor;
|
|
71
70
|
readonly name: StringConstructor;
|
|
72
71
|
readonly placeholder: StringConstructor;
|
|
73
72
|
readonly autocomplete: {
|
|
74
|
-
readonly type: StringConstructor;
|
|
75
|
-
* This is called with the newly selected id when the selection has changed.
|
|
76
|
-
* This happens, when an item from the suggestion list is selected or the
|
|
77
|
-
* input matches a selection option exactly.
|
|
78
|
-
* If no id is selected, the empty string is passed, in order to
|
|
79
|
-
* match the API of all other inputs who never pass `undefined`.
|
|
80
|
-
*/
|
|
73
|
+
readonly type: StringConstructor;
|
|
81
74
|
readonly default: "off";
|
|
82
75
|
};
|
|
83
76
|
readonly type: {
|
|
@@ -96,7 +89,7 @@ export declare const nInputSelectProps: {
|
|
|
96
89
|
};
|
|
97
90
|
export type InputSelectOption = Identifiable & {
|
|
98
91
|
label: string;
|
|
99
|
-
} &
|
|
92
|
+
} & AnyObject;
|
|
100
93
|
/**
|
|
101
94
|
* The `NInputSelect` is very similar to the {@link NSelect}, but instead of a select input it is a regular input.
|
|
102
95
|
* The user is forced to use a value from the specified options of the input.
|
|
@@ -164,22 +157,14 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
164
157
|
};
|
|
165
158
|
readonly tooltipMaxWidth: {
|
|
166
159
|
readonly type: PropType<import("../utils/tailwind").TWMaxWidth>;
|
|
167
|
-
readonly default: "max-w-xs";
|
|
168
|
-
* @see {@link nValInputProps.optional}
|
|
169
|
-
*/
|
|
160
|
+
readonly default: "max-w-xs";
|
|
170
161
|
};
|
|
171
162
|
readonly tooltipWrapperAddClass: StringConstructor;
|
|
172
163
|
readonly tooltipContentAddClass: StringConstructor;
|
|
173
164
|
readonly name: StringConstructor;
|
|
174
165
|
readonly placeholder: StringConstructor;
|
|
175
166
|
readonly autocomplete: {
|
|
176
|
-
readonly type: StringConstructor;
|
|
177
|
-
* This is called with the newly selected id when the selection has changed.
|
|
178
|
-
* This happens, when an item from the suggestion list is selected or the
|
|
179
|
-
* input matches a selection option exactly.
|
|
180
|
-
* If no id is selected, the empty string is passed, in order to
|
|
181
|
-
* match the API of all other inputs who never pass `undefined`.
|
|
182
|
-
*/
|
|
167
|
+
readonly type: StringConstructor;
|
|
183
168
|
readonly default: "off";
|
|
184
169
|
};
|
|
185
170
|
readonly type: {
|
|
@@ -257,22 +242,14 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
257
242
|
};
|
|
258
243
|
readonly tooltipMaxWidth: {
|
|
259
244
|
readonly type: PropType<import("../utils/tailwind").TWMaxWidth>;
|
|
260
|
-
readonly default: "max-w-xs";
|
|
261
|
-
* @see {@link nValInputProps.optional}
|
|
262
|
-
*/
|
|
245
|
+
readonly default: "max-w-xs";
|
|
263
246
|
};
|
|
264
247
|
readonly tooltipWrapperAddClass: StringConstructor;
|
|
265
248
|
readonly tooltipContentAddClass: StringConstructor;
|
|
266
249
|
readonly name: StringConstructor;
|
|
267
250
|
readonly placeholder: StringConstructor;
|
|
268
251
|
readonly autocomplete: {
|
|
269
|
-
readonly type: StringConstructor;
|
|
270
|
-
* This is called with the newly selected id when the selection has changed.
|
|
271
|
-
* This happens, when an item from the suggestion list is selected or the
|
|
272
|
-
* input matches a selection option exactly.
|
|
273
|
-
* If no id is selected, the empty string is passed, in order to
|
|
274
|
-
* match the API of all other inputs who never pass `undefined`.
|
|
275
|
-
*/
|
|
252
|
+
readonly type: StringConstructor;
|
|
276
253
|
readonly default: "off";
|
|
277
254
|
};
|
|
278
255
|
readonly type: {
|
package/components/NList.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import type { PropType } from 'vue';
|
|
2
2
|
export type ListItem = {
|
|
3
3
|
/**
|
|
4
|
-
* The title of the item.
|
|
4
|
+
* The title of the item. Accepts either string or a function returning a JSX element.
|
|
5
5
|
*/
|
|
6
|
-
title: string;
|
|
6
|
+
title: string | (() => JSX.Element);
|
|
7
7
|
/**
|
|
8
|
-
* The text of the item.
|
|
8
|
+
* The text of the item. Accepts either string or a function returning a JSX element.
|
|
9
9
|
*/
|
|
10
|
-
text?: string;
|
|
10
|
+
text?: string | (() => JSX.Element);
|
|
11
11
|
};
|
|
12
12
|
export declare const nListProps: {
|
|
13
13
|
/**
|
package/components/NList.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { createVNode as _createVNode } from "vue";
|
|
1
|
+
import { Fragment as _Fragment, createVNode as _createVNode } from "vue";
|
|
2
2
|
import { createComponent } from '../utils/component';
|
|
3
3
|
export const nListProps = {
|
|
4
4
|
/**
|
|
@@ -24,7 +24,10 @@ export default createComponent('NList', nListProps, props => {
|
|
|
24
24
|
"class": ['py-5 px-4 sm:grid sm:grid-cols-3 sm:gap-4', index % 2 === 1 ? 'bg-white' : 'bg-default-50']
|
|
25
25
|
}, [_createVNode("dt", {
|
|
26
26
|
"class": "text-sm font-medium text-default-500"
|
|
27
|
-
}, [item.title]), _createVNode("dd", {
|
|
27
|
+
}, [buildElement(item.title)]), _createVNode("dd", {
|
|
28
28
|
"class": "mt-1 text-sm sm:mt-0 sm:col-span-2"
|
|
29
|
-
}, [item.text])]))]);
|
|
30
|
-
});
|
|
29
|
+
}, [buildElement(item.text)])]))]);
|
|
30
|
+
});
|
|
31
|
+
function buildElement(element) {
|
|
32
|
+
if (typeof element === 'function') return element();else return _createVNode(_Fragment, null, [element]);
|
|
33
|
+
}
|
|
@@ -19,9 +19,7 @@ export declare const nSearchbarListProps: {
|
|
|
19
19
|
readonly items: {
|
|
20
20
|
readonly type: import("vue").PropType<import("./NSuggestionList").SuggestionItem[]>;
|
|
21
21
|
readonly default: () => never[];
|
|
22
|
-
};
|
|
23
|
-
* Adds the classes directly to the input (e.g. for shadow).
|
|
24
|
-
*/
|
|
22
|
+
};
|
|
25
23
|
readonly maxItems: {
|
|
26
24
|
readonly type: NumberConstructor;
|
|
27
25
|
readonly default: () => number;
|
|
@@ -56,9 +54,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
56
54
|
readonly items: {
|
|
57
55
|
readonly type: import("vue").PropType<import("./NSuggestionList").SuggestionItem[]>;
|
|
58
56
|
readonly default: () => never[];
|
|
59
|
-
};
|
|
60
|
-
* Adds the classes directly to the input (e.g. for shadow).
|
|
61
|
-
*/
|
|
57
|
+
};
|
|
62
58
|
readonly maxItems: {
|
|
63
59
|
readonly type: NumberConstructor;
|
|
64
60
|
readonly default: () => number;
|
|
@@ -89,9 +85,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
89
85
|
readonly items: {
|
|
90
86
|
readonly type: import("vue").PropType<import("./NSuggestionList").SuggestionItem[]>;
|
|
91
87
|
readonly default: () => never[];
|
|
92
|
-
};
|
|
93
|
-
* Adds the classes directly to the input (e.g. for shadow).
|
|
94
|
-
*/
|
|
88
|
+
};
|
|
95
89
|
readonly maxItems: {
|
|
96
90
|
readonly type: NumberConstructor;
|
|
97
91
|
readonly default: () => number;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { Identifiable } from '../utils/identifiable';
|
|
2
2
|
import { type PropType } from 'vue';
|
|
3
|
+
import type { AnyObject } from '../utils/utils';
|
|
3
4
|
export declare const nSuggestionListPropsForConfig: {
|
|
4
5
|
/**
|
|
5
6
|
* The items which are available to show in the list. The first `maxItems` will be displayed.
|
|
@@ -144,7 +145,7 @@ export type ItemSlotProps<T extends Identifiable = SuggestionItem> = {
|
|
|
144
145
|
};
|
|
145
146
|
export type SuggestionItem = Identifiable & {
|
|
146
147
|
label?: string;
|
|
147
|
-
} &
|
|
148
|
+
} & AnyObject;
|
|
148
149
|
/**
|
|
149
150
|
* The `NSuggestionList` can be added to an input and adds a list below it which is shown when the input is focused.
|
|
150
151
|
*/
|
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.1.
|
|
5
|
+
"version": "0.1.9",
|
|
6
6
|
"main": "./index.js",
|
|
7
7
|
"repository": {
|
|
8
8
|
"type": "git",
|
package/utils/utils.d.ts
CHANGED
|
@@ -22,7 +22,7 @@ export declare function isNullish(value: Nullish<unknown>): value is null | unde
|
|
|
22
22
|
*/
|
|
23
23
|
export declare function notNullishRef<T>(ref: Ref<T>): ref is Ref<NonNullable<T>>;
|
|
24
24
|
export type AnyObject = Record<string | number | symbol, unknown>;
|
|
25
|
-
export type EmptyObject = Record<string, never>;
|
|
25
|
+
export type EmptyObject = Record<string | number | symbol, never>;
|
|
26
26
|
export declare function isAnyObject(object: unknown): object is AnyObject;
|
|
27
27
|
/**
|
|
28
28
|
* Marks all properties of an object (including sub-objects) as readonly.
|