@naptics/vue-collection 0.0.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.
Files changed (105) hide show
  1. package/README.md +27 -0
  2. package/lib/components/NAlert.d.ts +72 -0
  3. package/lib/components/NAlert.jsx +69 -0
  4. package/lib/components/NBadge.d.ts +174 -0
  5. package/lib/components/NBadge.jsx +58 -0
  6. package/lib/components/NBreadcrub.d.ts +161 -0
  7. package/lib/components/NBreadcrub.jsx +64 -0
  8. package/lib/components/NButton.d.ts +149 -0
  9. package/lib/components/NButton.jsx +58 -0
  10. package/lib/components/NCheckbox.d.ts +51 -0
  11. package/lib/components/NCheckbox.jsx +38 -0
  12. package/lib/components/NCheckboxLabel.d.ts +70 -0
  13. package/lib/components/NCheckboxLabel.jsx +42 -0
  14. package/lib/components/NCrudModal.d.ts +301 -0
  15. package/lib/components/NCrudModal.jsx +89 -0
  16. package/lib/components/NDialog.d.ts +190 -0
  17. package/lib/components/NDialog.jsx +144 -0
  18. package/lib/components/NDropdown.d.ts +116 -0
  19. package/lib/components/NDropdown.jsx +92 -0
  20. package/lib/components/NDropzone.d.ts +162 -0
  21. package/lib/components/NDropzone.jsx +211 -0
  22. package/lib/components/NForm.d.ts +43 -0
  23. package/lib/components/NForm.jsx +26 -0
  24. package/lib/components/NFormModal.d.ts +190 -0
  25. package/lib/components/NFormModal.jsx +48 -0
  26. package/lib/components/NIconButton.d.ts +202 -0
  27. package/lib/components/NIconButton.jsx +71 -0
  28. package/lib/components/NIconCircle.d.ts +135 -0
  29. package/lib/components/NIconCircle.jsx +67 -0
  30. package/lib/components/NInput.css +11 -0
  31. package/lib/components/NInput.d.ts +232 -0
  32. package/lib/components/NInput.jsx +97 -0
  33. package/lib/components/NInputPhone.d.ts +150 -0
  34. package/lib/components/NInputPhone.jsx +31 -0
  35. package/lib/components/NInputSelect.d.ts +271 -0
  36. package/lib/components/NInputSelect.jsx +89 -0
  37. package/lib/components/NInputSuggestion.d.ts +212 -0
  38. package/lib/components/NInputSuggestion.jsx +48 -0
  39. package/lib/components/NLink.d.ts +111 -0
  40. package/lib/components/NLink.jsx +58 -0
  41. package/lib/components/NList.d.ts +43 -0
  42. package/lib/components/NList.jsx +24 -0
  43. package/lib/components/NLoadingIndicator.css +46 -0
  44. package/lib/components/NLoadingIndicator.d.ts +77 -0
  45. package/lib/components/NLoadingIndicator.jsx +42 -0
  46. package/lib/components/NModal.d.ts +333 -0
  47. package/lib/components/NModal.jsx +170 -0
  48. package/lib/components/NPagination.css +15 -0
  49. package/lib/components/NPagination.d.ts +99 -0
  50. package/lib/components/NPagination.jsx +104 -0
  51. package/lib/components/NSearchbar.d.ts +94 -0
  52. package/lib/components/NSearchbar.jsx +58 -0
  53. package/lib/components/NSearchbarList.d.ts +90 -0
  54. package/lib/components/NSearchbarList.jsx +20 -0
  55. package/lib/components/NSelect.d.ts +159 -0
  56. package/lib/components/NSelect.jsx +81 -0
  57. package/lib/components/NSuggestionList.d.ts +275 -0
  58. package/lib/components/NSuggestionList.jsx +157 -0
  59. package/lib/components/NTable.css +3 -0
  60. package/lib/components/NTable.d.ts +187 -0
  61. package/lib/components/NTable.jsx +146 -0
  62. package/lib/components/NTableAction.d.ts +74 -0
  63. package/lib/components/NTableAction.jsx +35 -0
  64. package/lib/components/NTextArea.d.ts +252 -0
  65. package/lib/components/NTextArea.jsx +108 -0
  66. package/lib/components/NTooltip.css +37 -0
  67. package/lib/components/NTooltip.d.ts +186 -0
  68. package/lib/components/NTooltip.jsx +161 -0
  69. package/lib/components/NValInput.d.ts +297 -0
  70. package/lib/components/NValInput.jsx +101 -0
  71. package/lib/components/ValidatedForm.d.ts +34 -0
  72. package/lib/components/ValidatedForm.js +25 -0
  73. package/lib/i18n/de/template.json +10 -0
  74. package/lib/i18n/de/vue-collection.json +58 -0
  75. package/lib/i18n/de.d.ts +61 -0
  76. package/lib/i18n/de.js +5 -0
  77. package/lib/i18n/en/template.json +10 -0
  78. package/lib/i18n/en/vue-collection.json +58 -0
  79. package/lib/i18n/en.d.ts +61 -0
  80. package/lib/i18n/en.js +5 -0
  81. package/lib/i18n/index.d.ts +17 -0
  82. package/lib/i18n/index.js +34 -0
  83. package/lib/index.d.ts +64 -0
  84. package/lib/index.js +65 -0
  85. package/lib/utils/breakpoints.d.ts +15 -0
  86. package/lib/utils/breakpoints.js +37 -0
  87. package/lib/utils/component.d.ts +50 -0
  88. package/lib/utils/component.js +51 -0
  89. package/lib/utils/deferred.d.ts +13 -0
  90. package/lib/utils/deferred.js +17 -0
  91. package/lib/utils/identifiable.d.ts +57 -0
  92. package/lib/utils/identifiable.js +78 -0
  93. package/lib/utils/stringMaxLength.d.ts +14 -0
  94. package/lib/utils/stringMaxLength.js +28 -0
  95. package/lib/utils/tailwind.d.ts +2 -0
  96. package/lib/utils/tailwind.js +1 -0
  97. package/lib/utils/utils.d.ts +27 -0
  98. package/lib/utils/utils.js +26 -0
  99. package/lib/utils/vModel.d.ts +182 -0
  100. package/lib/utils/vModel.js +215 -0
  101. package/lib/utils/validation.d.ts +84 -0
  102. package/lib/utils/validation.js +163 -0
  103. package/lib/utils/vue.d.ts +13 -0
  104. package/lib/utils/vue.js +19 -0
  105. package/package.json +56 -0
@@ -0,0 +1,275 @@
1
+ import type { Identifiable } from '../utils/identifiable';
2
+ import { type PropType } from 'vue';
3
+ export declare const nSuggestionListPropsForConfig: {
4
+ /**
5
+ * The items which are available to show in the list. The first `maxItems` will be displayed.
6
+ */
7
+ items: {
8
+ type: PropType<SuggestionItem[]>;
9
+ default: () => never[];
10
+ };
11
+ /**
12
+ * The maximum items which are displayed in the list.
13
+ */
14
+ maxItems: {
15
+ type: NumberConstructor;
16
+ default: () => 8;
17
+ };
18
+ /**
19
+ * If set to `true` the list is hidden.
20
+ */
21
+ hideList: BooleanConstructor;
22
+ /**
23
+ * If set to `true` the list shows a loading indicator when the `items` array is empty.
24
+ */
25
+ loading: BooleanConstructor;
26
+ /**
27
+ * This is called with the id of the selected item.
28
+ */
29
+ onSelect: PropType<(id: string) => void>;
30
+ /**
31
+ * The slot for every item of the list.
32
+ */
33
+ listItem: PropType<(props: ItemSlotProps) => JSX.Element>;
34
+ /**
35
+ * This function is called, when the input and the suggestion list are really blurred.
36
+ * This means, it's not just the input temporarly beeing blurred because the user clicks on the item list,
37
+ * but the focus has completely disappeared from the input and the list.
38
+ */
39
+ onRealBlur: PropType<() => void>;
40
+ };
41
+ export declare const nSuggestionListPropsForInput: {
42
+ /**
43
+ * The slot for the input, which will be enhanced with the suggestion list.
44
+ */
45
+ input: {
46
+ type: PropType<(props: InputSlotProps) => JSX.Element>;
47
+ required: true;
48
+ };
49
+ /**
50
+ * When this function is called, the parent is required to call focus() on the input element.
51
+ * It won't work properly if the parent does not request focus on the input.
52
+ */
53
+ onRequestInputFocus: {
54
+ type: PropType<() => void>;
55
+ required: true;
56
+ };
57
+ /**
58
+ * The current value of the input. This is just needed to display the «No results found for {value}» message.
59
+ */
60
+ inputValue: {
61
+ type: StringConstructor;
62
+ required: true;
63
+ };
64
+ };
65
+ export declare const nSuggestionListProps: {
66
+ /**
67
+ * The slot for the input, which will be enhanced with the suggestion list.
68
+ */
69
+ input: {
70
+ type: PropType<(props: InputSlotProps) => JSX.Element>;
71
+ required: true;
72
+ };
73
+ /**
74
+ * When this function is called, the parent is required to call focus() on the input element.
75
+ * It won't work properly if the parent does not request focus on the input.
76
+ */
77
+ onRequestInputFocus: {
78
+ type: PropType<() => void>;
79
+ required: true;
80
+ };
81
+ /**
82
+ * The current value of the input. This is just needed to display the «No results found for {value}» message.
83
+ */
84
+ inputValue: {
85
+ type: StringConstructor;
86
+ required: true;
87
+ };
88
+ /**
89
+ * The items which are available to show in the list. The first `maxItems` will be displayed.
90
+ */
91
+ items: {
92
+ type: PropType<SuggestionItem[]>;
93
+ default: () => never[];
94
+ };
95
+ /**
96
+ * The maximum items which are displayed in the list.
97
+ */
98
+ maxItems: {
99
+ type: NumberConstructor;
100
+ default: () => 8;
101
+ };
102
+ /**
103
+ * If set to `true` the list is hidden.
104
+ */
105
+ hideList: BooleanConstructor;
106
+ /**
107
+ * If set to `true` the list shows a loading indicator when the `items` array is empty.
108
+ */
109
+ loading: BooleanConstructor;
110
+ /**
111
+ * This is called with the id of the selected item.
112
+ */
113
+ onSelect: PropType<(id: string) => void>;
114
+ /**
115
+ * The slot for every item of the list.
116
+ */
117
+ listItem: PropType<(props: ItemSlotProps) => JSX.Element>;
118
+ /**
119
+ * This function is called, when the input and the suggestion list are really blurred.
120
+ * This means, it's not just the input temporarly beeing blurred because the user clicks on the item list,
121
+ * but the focus has completely disappeared from the input and the list.
122
+ */
123
+ onRealBlur: PropType<() => void>;
124
+ };
125
+ export type InputSlotProps = {
126
+ /**
127
+ * Should be called when the input receives focus.
128
+ */
129
+ onFocus(): void;
130
+ /**
131
+ * Should be called when the input is blurred.
132
+ */
133
+ onBlur(): void;
134
+ };
135
+ export type ItemSlotProps<T extends Identifiable = SuggestionItem> = {
136
+ /**
137
+ * The current item of the list
138
+ */
139
+ item: T;
140
+ /**
141
+ * Is true, when the current item is highlighted ("hovered" with the keys)
142
+ */
143
+ highlighted: boolean;
144
+ };
145
+ export type SuggestionItem = Identifiable & {
146
+ label?: string;
147
+ } & Record<string, unknown>;
148
+ /**
149
+ * The `NSuggestionList` can be added to an input and adds a list below it which is shown when the input is focused.
150
+ */
151
+ declare const _default: import("vue").DefineComponent<{
152
+ /**
153
+ * The slot for the input, which will be enhanced with the suggestion list.
154
+ */
155
+ input: {
156
+ type: PropType<(props: InputSlotProps) => JSX.Element>;
157
+ required: true;
158
+ };
159
+ /**
160
+ * When this function is called, the parent is required to call focus() on the input element.
161
+ * It won't work properly if the parent does not request focus on the input.
162
+ */
163
+ onRequestInputFocus: {
164
+ type: PropType<() => void>;
165
+ required: true;
166
+ };
167
+ /**
168
+ * The current value of the input. This is just needed to display the «No results found for {value}» message.
169
+ */
170
+ inputValue: {
171
+ type: StringConstructor;
172
+ required: true;
173
+ };
174
+ /**
175
+ * The items which are available to show in the list. The first `maxItems` will be displayed.
176
+ */
177
+ items: {
178
+ type: PropType<SuggestionItem[]>;
179
+ default: () => never[];
180
+ };
181
+ /**
182
+ * The maximum items which are displayed in the list.
183
+ */
184
+ maxItems: {
185
+ type: NumberConstructor;
186
+ default: () => 8;
187
+ };
188
+ /**
189
+ * If set to `true` the list is hidden.
190
+ */
191
+ hideList: BooleanConstructor;
192
+ /**
193
+ * If set to `true` the list shows a loading indicator when the `items` array is empty.
194
+ */
195
+ loading: BooleanConstructor;
196
+ /**
197
+ * This is called with the id of the selected item.
198
+ */
199
+ onSelect: PropType<(id: string) => void>;
200
+ /**
201
+ * The slot for every item of the list.
202
+ */
203
+ listItem: PropType<(props: ItemSlotProps<SuggestionItem>) => JSX.Element>;
204
+ /**
205
+ * This function is called, when the input and the suggestion list are really blurred.
206
+ * This means, it's not just the input temporarly beeing blurred because the user clicks on the item list,
207
+ * but the focus has completely disappeared from the input and the list.
208
+ */
209
+ onRealBlur: PropType<() => void>;
210
+ }, 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<{
211
+ /**
212
+ * The slot for the input, which will be enhanced with the suggestion list.
213
+ */
214
+ input: {
215
+ type: PropType<(props: InputSlotProps) => JSX.Element>;
216
+ required: true;
217
+ };
218
+ /**
219
+ * When this function is called, the parent is required to call focus() on the input element.
220
+ * It won't work properly if the parent does not request focus on the input.
221
+ */
222
+ onRequestInputFocus: {
223
+ type: PropType<() => void>;
224
+ required: true;
225
+ };
226
+ /**
227
+ * The current value of the input. This is just needed to display the «No results found for {value}» message.
228
+ */
229
+ inputValue: {
230
+ type: StringConstructor;
231
+ required: true;
232
+ };
233
+ /**
234
+ * The items which are available to show in the list. The first `maxItems` will be displayed.
235
+ */
236
+ items: {
237
+ type: PropType<SuggestionItem[]>;
238
+ default: () => never[];
239
+ };
240
+ /**
241
+ * The maximum items which are displayed in the list.
242
+ */
243
+ maxItems: {
244
+ type: NumberConstructor;
245
+ default: () => 8;
246
+ };
247
+ /**
248
+ * If set to `true` the list is hidden.
249
+ */
250
+ hideList: BooleanConstructor;
251
+ /**
252
+ * If set to `true` the list shows a loading indicator when the `items` array is empty.
253
+ */
254
+ loading: BooleanConstructor;
255
+ /**
256
+ * This is called with the id of the selected item.
257
+ */
258
+ onSelect: PropType<(id: string) => void>;
259
+ /**
260
+ * The slot for every item of the list.
261
+ */
262
+ listItem: PropType<(props: ItemSlotProps<SuggestionItem>) => JSX.Element>;
263
+ /**
264
+ * This function is called, when the input and the suggestion list are really blurred.
265
+ * This means, it's not just the input temporarly beeing blurred because the user clicks on the item list,
266
+ * but the focus has completely disappeared from the input and the list.
267
+ */
268
+ onRealBlur: PropType<() => void>;
269
+ }>> & {}, {
270
+ loading: boolean;
271
+ items: SuggestionItem[];
272
+ maxItems: number;
273
+ hideList: boolean;
274
+ }>;
275
+ export default _default;
@@ -0,0 +1,157 @@
1
+ import { trsl } from '../i18n';
2
+ import { createComponent, createProps } from '../utils/component';
3
+ import { computed, ref } from 'vue';
4
+ import NLoadingIndicator from './NLoadingIndicator';
5
+ export const nSuggestionListPropsForConfig = createProps({
6
+ /**
7
+ * The items which are available to show in the list. The first `maxItems` will be displayed.
8
+ */
9
+ items: {
10
+ type: Array,
11
+ default: () => [],
12
+ },
13
+ /**
14
+ * The maximum items which are displayed in the list.
15
+ */
16
+ maxItems: {
17
+ type: Number,
18
+ default: () => 8,
19
+ },
20
+ /**
21
+ * If set to `true` the list is hidden.
22
+ */
23
+ hideList: Boolean,
24
+ /**
25
+ * If set to `true` the list shows a loading indicator when the `items` array is empty.
26
+ */
27
+ loading: Boolean,
28
+ /**
29
+ * This is called with the id of the selected item.
30
+ */
31
+ onSelect: Function,
32
+ /**
33
+ * The slot for every item of the list.
34
+ */
35
+ listItem: Function,
36
+ /**
37
+ * This function is called, when the input and the suggestion list are really blurred.
38
+ * This means, it's not just the input temporarly beeing blurred because the user clicks on the item list,
39
+ * but the focus has completely disappeared from the input and the list.
40
+ */
41
+ onRealBlur: Function,
42
+ });
43
+ export const nSuggestionListPropsForInput = createProps({
44
+ /**
45
+ * The slot for the input, which will be enhanced with the suggestion list.
46
+ */
47
+ input: {
48
+ type: Function,
49
+ required: true,
50
+ },
51
+ /**
52
+ * When this function is called, the parent is required to call focus() on the input element.
53
+ * It won't work properly if the parent does not request focus on the input.
54
+ */
55
+ onRequestInputFocus: {
56
+ type: Function,
57
+ required: true,
58
+ },
59
+ /**
60
+ * The current value of the input. This is just needed to display the «No results found for {value}» message.
61
+ */
62
+ inputValue: {
63
+ type: String,
64
+ required: true,
65
+ },
66
+ });
67
+ export const nSuggestionListProps = createProps({
68
+ ...nSuggestionListPropsForConfig,
69
+ ...nSuggestionListPropsForInput,
70
+ });
71
+ /**
72
+ * The `NSuggestionList` can be added to an input and adds a list below it which is shown when the input is focused.
73
+ */
74
+ export default createComponent('NSuggestionList', nSuggestionListProps, props => {
75
+ const selectedIndex = ref(null);
76
+ const displayItems = computed(() => props.items.slice(0, props.maxItems));
77
+ const isInFocus = ref(false);
78
+ const showList = computed(() => isInFocus.value && !props.hideList);
79
+ let listButtonClicked = false;
80
+ const onFocus = () => (isInFocus.value = true);
81
+ const onListMouseDown = () => (listButtonClicked = true);
82
+ const onListMouseLeave = () => props.onRequestInputFocus();
83
+ const onBlur = () => {
84
+ if (!listButtonClicked) {
85
+ isInFocus.value = false;
86
+ props.onRealBlur?.();
87
+ }
88
+ listButtonClicked = false;
89
+ };
90
+ const onSelect = (id) => {
91
+ props.onSelect?.(id);
92
+ props.onRequestInputFocus();
93
+ };
94
+ const keydown = (event) => {
95
+ if (event.key == 'ArrowDown') {
96
+ event.preventDefault();
97
+ nextItem();
98
+ }
99
+ else if (event.key == 'ArrowUp') {
100
+ event.preventDefault();
101
+ previoiusItem();
102
+ }
103
+ else if (event.key == 'Enter') {
104
+ event.preventDefault();
105
+ const index = selectedIndex.value;
106
+ if (index != null && index < displayItems.value.length) {
107
+ onSelect(displayItems.value[index].id);
108
+ }
109
+ }
110
+ };
111
+ const nextItem = () => {
112
+ adjustIndexToSize();
113
+ const currentIndex = selectedIndex.value;
114
+ let nextIndex = currentIndex == null ? 0 : currentIndex + 1;
115
+ if (nextIndex >= displayItems.value.length)
116
+ nextIndex = null;
117
+ selectedIndex.value = nextIndex;
118
+ };
119
+ const previoiusItem = () => {
120
+ adjustIndexToSize();
121
+ const currentIndex = selectedIndex.value;
122
+ let previousIndex = currentIndex == null ? displayItems.value.length - 1 : currentIndex - 1;
123
+ if (previousIndex < 0)
124
+ previousIndex = null;
125
+ selectedIndex.value = previousIndex;
126
+ };
127
+ const adjustIndexToSize = () => {
128
+ if (selectedIndex.value != null && selectedIndex.value >= displayItems.value.length) {
129
+ selectedIndex.value = null;
130
+ }
131
+ };
132
+ return () => (<div onKeydown={keydown}>
133
+ {props.input({ onFocus, onBlur })}
134
+ <div class="relative">
135
+ {showList.value && (<div class="bg-white rounded-md shadow-lg p-2 absolute top-2 left-0 min-w-full z-10">
136
+ <ul>
137
+ {displayItems.value.map((item, index) => (<li key={item.id} class={[
138
+ 'focus:outline-none hover:bg-default-50 rounded-md select-none p-2 cursor-pointer',
139
+ selectedIndex.value === index ? 'bg-default-50' : '',
140
+ ]} onMousedown={onListMouseDown} onMouseleave={onListMouseLeave} onClick={() => onSelect(item.id)}>
141
+ {props.listItem?.({ item, highlighted: selectedIndex.value === index }) ||
142
+ item.label}
143
+ </li>))}
144
+
145
+ {displayItems.value.length == 0 && (<div class="p-2 text-sm font-medium text-default-700">
146
+ {props.loading ? (<div class="flex items-center space-x-2">
147
+ <NLoadingIndicator size={6}/>
148
+ <span> {trsl('vue-collection.text.loading-search-results')}</span>
149
+ </div>) : (<div>
150
+ {trsl('vue-collection.text.no-search-results', { input: props.inputValue })}
151
+ </div>)}
152
+ </div>)}
153
+ </ul>
154
+ </div>)}
155
+ </div>
156
+ </div>);
157
+ });
@@ -0,0 +1,3 @@
1
+ .table-heading {
2
+ @apply text-left text-xs font-medium text-default-500 uppercase tracking-wider;
3
+ }
@@ -0,0 +1,187 @@
1
+ import { type TWBreakpoint } from '../utils/breakpoints';
2
+ import { type PropType } from 'vue';
3
+ import './NTable.css';
4
+ export type TableHeading = {
5
+ /**
6
+ * The key of the table heading. This should match the key of the items.
7
+ */
8
+ key: string;
9
+ /**
10
+ * The label of the table heading. If not set, no label is displayed.
11
+ */
12
+ label?: string;
13
+ /**
14
+ * If set to `true` the whole column of this heading will be emphasized.
15
+ */
16
+ emph?: boolean;
17
+ /**
18
+ * This classes will be directly set to all cells in the column of this heading.
19
+ */
20
+ cellClass?: string;
21
+ /**
22
+ * If set the heading will become a details entry when the screen is smaller than the specified breakpoint.
23
+ */
24
+ breakpoint?: TWBreakpoint;
25
+ };
26
+ export type TableDetail = {
27
+ /**
28
+ * The key of the table details. This should match the key of the items.
29
+ */
30
+ key: string;
31
+ /**
32
+ * The label of the table detail. If not set, no label is displayed.
33
+ */
34
+ label?: string;
35
+ };
36
+ export type TableRow = Record<string, TableItem> & {
37
+ /**
38
+ * The TableItem is used as the last element of the table and
39
+ * merged together in one cell with the button to toggle the details.
40
+ */
41
+ action?: TableItem;
42
+ };
43
+ export type TableItem = string | number | (() => JSX.Element);
44
+ export declare const nTableProps: {
45
+ /**
46
+ * The headings of the table. These define which columns are shown in the table and in which order.
47
+ */
48
+ headings: {
49
+ type: PropType<TableHeading[]>;
50
+ required: true;
51
+ };
52
+ /**
53
+ * Details can be added additionally to headings.
54
+ * If details are set a little chevron icon is displayed at the end of each table row
55
+ * and if clicked on it the data is displayed in a key-value fashion.
56
+ * The values of the entries should be passed via the `items` prop
57
+ * in the same way as if the details were normal headings.
58
+ * Note that details can be added dynamically by adding the `breakpoint` property to the headings.
59
+ */
60
+ details: {
61
+ type: PropType<TableDetail[]>;
62
+ default: () => never[];
63
+ };
64
+ /**
65
+ * The items of the table. They consist of an array of table rows.
66
+ * Every tablerow is an object containing elements for the heading keys.
67
+ * The elements can either be a primitive value or a function which returns a {@link JSX.Element}.
68
+ * If the item should be treated as an action (e.g. icon-button to display at the end of the row)
69
+ * the dedicated key 'action' can be used.
70
+ * @see TableRow
71
+ * @example
72
+ * // These headings are defined
73
+ * const headings: TableHeading[] = [
74
+ * { key: 'id', label: 'ID' },
75
+ * { key: 'name', label: 'Name' },
76
+ * { key: 'status', label: 'Status' }
77
+ * ]
78
+ *
79
+ * // Appropriate rows for these headings
80
+ * const items: TableRow[] = [
81
+ * { id: 1, name: 'Hubert', status: () => <NBadge ... />, action: ... }, // Row 1
82
+ * { id: 2, name: 'Franzi', status: () => <NBadge ... />, action: ... } // Row 2
83
+ * ]
84
+ */
85
+ items: {
86
+ type: PropType<TableRow[]>;
87
+ default: () => never[];
88
+ };
89
+ };
90
+ /**
91
+ * The `NTable` is a styled html table which accepts data and displays it appropriately.
92
+ */
93
+ declare const _default: import("vue").DefineComponent<{
94
+ /**
95
+ * The headings of the table. These define which columns are shown in the table and in which order.
96
+ */
97
+ headings: {
98
+ type: PropType<TableHeading[]>;
99
+ required: true;
100
+ };
101
+ /**
102
+ * Details can be added additionally to headings.
103
+ * If details are set a little chevron icon is displayed at the end of each table row
104
+ * and if clicked on it the data is displayed in a key-value fashion.
105
+ * The values of the entries should be passed via the `items` prop
106
+ * in the same way as if the details were normal headings.
107
+ * Note that details can be added dynamically by adding the `breakpoint` property to the headings.
108
+ */
109
+ details: {
110
+ type: PropType<TableDetail[]>;
111
+ default: () => never[];
112
+ };
113
+ /**
114
+ * The items of the table. They consist of an array of table rows.
115
+ * Every tablerow is an object containing elements for the heading keys.
116
+ * The elements can either be a primitive value or a function which returns a {@link JSX.Element}.
117
+ * If the item should be treated as an action (e.g. icon-button to display at the end of the row)
118
+ * the dedicated key 'action' can be used.
119
+ * @see TableRow
120
+ * @example
121
+ * // These headings are defined
122
+ * const headings: TableHeading[] = [
123
+ * { key: 'id', label: 'ID' },
124
+ * { key: 'name', label: 'Name' },
125
+ * { key: 'status', label: 'Status' }
126
+ * ]
127
+ *
128
+ * // Appropriate rows for these headings
129
+ * const items: TableRow[] = [
130
+ * { id: 1, name: 'Hubert', status: () => <NBadge ... />, action: ... }, // Row 1
131
+ * { id: 2, name: 'Franzi', status: () => <NBadge ... />, action: ... } // Row 2
132
+ * ]
133
+ */
134
+ items: {
135
+ type: PropType<TableRow[]>;
136
+ default: () => never[];
137
+ };
138
+ }, 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<{
139
+ /**
140
+ * The headings of the table. These define which columns are shown in the table and in which order.
141
+ */
142
+ headings: {
143
+ type: PropType<TableHeading[]>;
144
+ required: true;
145
+ };
146
+ /**
147
+ * Details can be added additionally to headings.
148
+ * If details are set a little chevron icon is displayed at the end of each table row
149
+ * and if clicked on it the data is displayed in a key-value fashion.
150
+ * The values of the entries should be passed via the `items` prop
151
+ * in the same way as if the details were normal headings.
152
+ * Note that details can be added dynamically by adding the `breakpoint` property to the headings.
153
+ */
154
+ details: {
155
+ type: PropType<TableDetail[]>;
156
+ default: () => never[];
157
+ };
158
+ /**
159
+ * The items of the table. They consist of an array of table rows.
160
+ * Every tablerow is an object containing elements for the heading keys.
161
+ * The elements can either be a primitive value or a function which returns a {@link JSX.Element}.
162
+ * If the item should be treated as an action (e.g. icon-button to display at the end of the row)
163
+ * the dedicated key 'action' can be used.
164
+ * @see TableRow
165
+ * @example
166
+ * // These headings are defined
167
+ * const headings: TableHeading[] = [
168
+ * { key: 'id', label: 'ID' },
169
+ * { key: 'name', label: 'Name' },
170
+ * { key: 'status', label: 'Status' }
171
+ * ]
172
+ *
173
+ * // Appropriate rows for these headings
174
+ * const items: TableRow[] = [
175
+ * { id: 1, name: 'Hubert', status: () => <NBadge ... />, action: ... }, // Row 1
176
+ * { id: 2, name: 'Franzi', status: () => <NBadge ... />, action: ... } // Row 2
177
+ * ]
178
+ */
179
+ items: {
180
+ type: PropType<TableRow[]>;
181
+ default: () => never[];
182
+ };
183
+ }>> & {}, {
184
+ details: TableDetail[];
185
+ items: TableRow[];
186
+ }>;
187
+ export default _default;