@naptics/vue-collection 0.0.6 → 0.1.0

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 (77) hide show
  1. package/README.md +8 -6
  2. package/components/NAlert.d.ts +20 -20
  3. package/components/NAlert.js +3 -3
  4. package/components/NBadge.d.ts +87 -87
  5. package/components/NBadge.js +3 -3
  6. package/components/NBreadcrub.d.ts +57 -57
  7. package/components/NBreadcrub.js +3 -3
  8. package/components/NButton.d.ts +69 -69
  9. package/components/NButton.js +3 -3
  10. package/components/NCheckbox.d.ts +20 -20
  11. package/components/NCheckbox.js +3 -3
  12. package/components/NCheckboxLabel.d.ts +30 -30
  13. package/components/NCheckboxLabel.js +3 -3
  14. package/components/NCrudModal.d.ts +238 -203
  15. package/components/NCrudModal.js +17 -4
  16. package/components/NDialog.d.ts +1 -1
  17. package/components/NDialog.js +3 -3
  18. package/components/NDropdown.d.ts +25 -25
  19. package/components/NDropdown.js +3 -3
  20. package/components/NDropzone.d.ts +52 -52
  21. package/components/NDropzone.js +3 -3
  22. package/components/NForm.d.ts +6 -6
  23. package/components/NForm.js +3 -3
  24. package/components/NFormModal.d.ts +136 -136
  25. package/components/NFormModal.js +3 -3
  26. package/components/NIconButton.d.ts +100 -94
  27. package/components/NIconButton.js +3 -3
  28. package/components/NIconCircle.d.ts +46 -46
  29. package/components/NIconCircle.js +3 -3
  30. package/components/NInput.d.ts +94 -94
  31. package/components/NInput.js +3 -3
  32. package/components/NInputPhone.d.ts +125 -125
  33. package/components/NInputPhone.js +2 -2
  34. package/components/NInputSelect.d.ts +131 -131
  35. package/components/NInputSelect.js +3 -3
  36. package/components/NInputSuggestion.d.ts +179 -167
  37. package/components/NInputSuggestion.js +3 -3
  38. package/components/NLink.d.ts +32 -32
  39. package/components/NLink.js +3 -3
  40. package/components/NList.d.ts +10 -10
  41. package/components/NList.js +3 -3
  42. package/components/NLoadingIndicator.d.ts +30 -30
  43. package/components/NLoadingIndicator.js +3 -3
  44. package/components/NModal.d.ts +118 -118
  45. package/components/NModal.js +3 -3
  46. package/components/NPagination.d.ts +30 -30
  47. package/components/NPagination.js +3 -3
  48. package/components/NSearchbar.d.ts +29 -29
  49. package/components/NSearchbar.js +3 -3
  50. package/components/NSearchbarList.d.ts +53 -62
  51. package/components/NSearchbarList.js +3 -3
  52. package/components/NSelect.d.ts +64 -64
  53. package/components/NSelect.js +3 -3
  54. package/components/NSuggestionList.d.ts +84 -84
  55. package/components/NSuggestionList.js +7 -7
  56. package/components/NTable.d.ts +29 -29
  57. package/components/NTable.js +3 -3
  58. package/components/NTableAction.d.ts +19 -19
  59. package/components/NTableAction.js +3 -3
  60. package/components/NTextArea.d.ts +118 -124
  61. package/components/NTextArea.js +5 -5
  62. package/components/NTooltip.d.ts +44 -44
  63. package/components/NTooltip.js +4 -4
  64. package/components/NValInput.d.ts +134 -134
  65. package/components/NValInput.js +5 -5
  66. package/index.d.ts +2 -2
  67. package/index.js +2 -2
  68. package/package.json +3 -1
  69. package/utils/breakpoints.d.ts +3 -0
  70. package/utils/breakpoints.js +3 -0
  71. package/utils/component.d.ts +0 -8
  72. package/utils/component.js +0 -10
  73. package/utils/identifiable.d.ts +8 -8
  74. package/utils/identifiable.js +4 -2
  75. package/utils/tailwind.d.ts +2 -0
  76. package/utils/utils.d.ts +25 -12
  77. package/utils/utils.js +30 -9
@@ -4,7 +4,7 @@ export declare const nInputSelectProps: {
4
4
  /**
5
5
  * The id of the currently selected option of this input.
6
6
  */
7
- value: StringConstructor;
7
+ readonly value: StringConstructor;
8
8
  /**
9
9
  * This is called with the newly selected id when the selection has changed.
10
10
  * This happens, when an item from the suggestion list is selected or the
@@ -12,75 +12,75 @@ export declare const nInputSelectProps: {
12
12
  * If no id is selected, the empty string is passed, in order to
13
13
  * match the API of all other inputs who never pass `undefined`.
14
14
  */
15
- onUpdateValue: PropType<(newValue: string) => void>;
15
+ readonly onUpdateValue: PropType<(newValue: string) => void>;
16
16
  /**
17
17
  * The options which are allowed and suggested for this input.
18
18
  * The options are filtered based on the user input.
19
19
  */
20
- options: {
21
- type: PropType<InputSelectOption[]>;
22
- default: () => never[];
20
+ readonly options: {
21
+ readonly type: PropType<InputSelectOption[]>;
22
+ readonly default: () => never[];
23
23
  };
24
24
  /**
25
25
  * @see {@link nValInputProps.optional}
26
26
  */
27
- optional: BooleanConstructor;
27
+ readonly optional: BooleanConstructor;
28
28
  /**
29
29
  * @see {@link nValInputProps.form}
30
30
  */
31
- form: PropType<import("./ValidatedForm").ValidatedForm>;
31
+ readonly form: PropType<import("./ValidatedForm").ValidatedForm>;
32
32
  /**
33
33
  * @see {@link nValInputProps.error}
34
34
  */
35
- error: BooleanConstructor;
35
+ readonly error: BooleanConstructor;
36
36
  /**
37
37
  * @see {@link nValInputProps.errorMessage}
38
38
  */
39
- errorMessage: StringConstructor;
39
+ readonly errorMessage: StringConstructor;
40
40
  /**
41
41
  * If set to `true` the list is hidden even if there are still matching items in the list.
42
42
  */
43
- hideList: BooleanConstructor;
43
+ readonly hideList: BooleanConstructor;
44
44
  /**
45
45
  * @see {@link nSuggestionListProps.maxItems}
46
46
  */
47
- maxItems: {
48
- type: NumberConstructor;
49
- default: () => 8;
47
+ readonly maxItems: {
48
+ readonly type: NumberConstructor;
49
+ readonly default: () => number;
50
50
  };
51
51
  /**
52
52
  * @see {@link nSuggestionListProps.listItem}
53
53
  */
54
- listItem: PropType<(props: import("./NSuggestionList").ItemSlotProps<import("./NSuggestionList").SuggestionItem>) => JSX.Element>;
55
- tooltipText: StringConstructor;
56
- tooltipContent: PropType<() => void>;
57
- tooltipHide: BooleanConstructor;
58
- tooltipShow: BooleanConstructor;
59
- tooltipPlacement: {
60
- type: PropType<import("./NTooltip").TooltipPlacement>;
61
- default: string;
54
+ readonly listItem: PropType<(props: import("./NSuggestionList").ItemSlotProps<import("./NSuggestionList").SuggestionItem>) => JSX.Element>;
55
+ readonly tooltipText: StringConstructor;
56
+ readonly tooltipContent: PropType<() => JSX.Element>;
57
+ readonly tooltipHide: BooleanConstructor;
58
+ readonly tooltipShow: BooleanConstructor;
59
+ readonly tooltipPlacement: {
60
+ readonly type: PropType<import("./NTooltip").TooltipPlacement>;
61
+ readonly default: "auto";
62
62
  };
63
- tooltipMaxWidth: {
64
- type: PropType<import("../utils/tailwind").TWMaxWidth>;
65
- default: string;
63
+ readonly tooltipMaxWidth: {
64
+ readonly type: PropType<import("../utils/tailwind").TWMaxWidth>;
65
+ readonly default: "max-w-xs";
66
66
  };
67
- name: StringConstructor;
68
- placeholder: StringConstructor;
69
- autocomplete: {
70
- type: StringConstructor;
71
- default: string;
67
+ readonly name: StringConstructor;
68
+ readonly placeholder: StringConstructor;
69
+ readonly autocomplete: {
70
+ readonly type: StringConstructor;
71
+ readonly default: "off";
72
72
  };
73
- type: {
74
- type: StringConstructor;
75
- default: string;
73
+ readonly type: {
74
+ readonly type: StringConstructor;
75
+ readonly default: "text";
76
76
  };
77
- max: StringConstructor;
78
- min: StringConstructor;
79
- disabled: BooleanConstructor;
80
- small: BooleanConstructor;
81
- hideLabel: BooleanConstructor;
82
- onFocus: PropType<() => void>;
83
- onBlur: PropType<() => void>;
77
+ readonly max: StringConstructor;
78
+ readonly min: StringConstructor;
79
+ readonly disabled: BooleanConstructor;
80
+ readonly small: BooleanConstructor;
81
+ readonly hideLabel: BooleanConstructor;
82
+ readonly onFocus: PropType<() => void>;
83
+ readonly onBlur: PropType<() => void>;
84
84
  };
85
85
  export type InputSelectOption = Identifiable & {
86
86
  label: string;
@@ -94,7 +94,7 @@ declare const _default: import("vue").DefineComponent<{
94
94
  /**
95
95
  * The id of the currently selected option of this input.
96
96
  */
97
- value: StringConstructor;
97
+ readonly value: StringConstructor;
98
98
  /**
99
99
  * This is called with the newly selected id when the selection has changed.
100
100
  * This happens, when an item from the suggestion list is selected or the
@@ -102,80 +102,80 @@ declare const _default: import("vue").DefineComponent<{
102
102
  * If no id is selected, the empty string is passed, in order to
103
103
  * match the API of all other inputs who never pass `undefined`.
104
104
  */
105
- onUpdateValue: PropType<(newValue: string) => void>;
105
+ readonly onUpdateValue: PropType<(newValue: string) => void>;
106
106
  /**
107
107
  * The options which are allowed and suggested for this input.
108
108
  * The options are filtered based on the user input.
109
109
  */
110
- options: {
111
- type: PropType<InputSelectOption[]>;
112
- default: () => never[];
110
+ readonly options: {
111
+ readonly type: PropType<InputSelectOption[]>;
112
+ readonly default: () => never[];
113
113
  };
114
114
  /**
115
115
  * @see {@link nValInputProps.optional}
116
116
  */
117
- optional: BooleanConstructor;
117
+ readonly optional: BooleanConstructor;
118
118
  /**
119
119
  * @see {@link nValInputProps.form}
120
120
  */
121
- form: PropType<import("./ValidatedForm").ValidatedForm>;
121
+ readonly form: PropType<import("./ValidatedForm").ValidatedForm>;
122
122
  /**
123
123
  * @see {@link nValInputProps.error}
124
124
  */
125
- error: BooleanConstructor;
125
+ readonly error: BooleanConstructor;
126
126
  /**
127
127
  * @see {@link nValInputProps.errorMessage}
128
128
  */
129
- errorMessage: StringConstructor;
129
+ readonly errorMessage: StringConstructor;
130
130
  /**
131
131
  * If set to `true` the list is hidden even if there are still matching items in the list.
132
132
  */
133
- hideList: BooleanConstructor;
133
+ readonly hideList: BooleanConstructor;
134
134
  /**
135
135
  * @see {@link nSuggestionListProps.maxItems}
136
136
  */
137
- maxItems: {
138
- type: NumberConstructor;
139
- default: () => 8;
137
+ readonly maxItems: {
138
+ readonly type: NumberConstructor;
139
+ readonly default: () => number;
140
140
  };
141
141
  /**
142
142
  * @see {@link nSuggestionListProps.listItem}
143
143
  */
144
- listItem: PropType<(props: import("./NSuggestionList").ItemSlotProps<import("./NSuggestionList").SuggestionItem>) => JSX.Element>;
145
- tooltipText: StringConstructor;
146
- tooltipContent: PropType<() => void>;
147
- tooltipHide: BooleanConstructor;
148
- tooltipShow: BooleanConstructor;
149
- tooltipPlacement: {
150
- type: PropType<import("./NTooltip").TooltipPlacement>;
151
- default: string;
144
+ readonly listItem: PropType<(props: import("./NSuggestionList").ItemSlotProps<import("./NSuggestionList").SuggestionItem>) => JSX.Element>;
145
+ readonly tooltipText: StringConstructor;
146
+ readonly tooltipContent: PropType<() => JSX.Element>;
147
+ readonly tooltipHide: BooleanConstructor;
148
+ readonly tooltipShow: BooleanConstructor;
149
+ readonly tooltipPlacement: {
150
+ readonly type: PropType<import("./NTooltip").TooltipPlacement>;
151
+ readonly default: "auto";
152
152
  };
153
- tooltipMaxWidth: {
154
- type: PropType<import("../utils/tailwind").TWMaxWidth>;
155
- default: string;
153
+ readonly tooltipMaxWidth: {
154
+ readonly type: PropType<import("../utils/tailwind").TWMaxWidth>;
155
+ readonly default: "max-w-xs";
156
156
  };
157
- name: StringConstructor;
158
- placeholder: StringConstructor;
159
- autocomplete: {
160
- type: StringConstructor;
161
- default: string;
157
+ readonly name: StringConstructor;
158
+ readonly placeholder: StringConstructor;
159
+ readonly autocomplete: {
160
+ readonly type: StringConstructor;
161
+ readonly default: "off";
162
162
  };
163
- type: {
164
- type: StringConstructor;
165
- default: string;
163
+ readonly type: {
164
+ readonly type: StringConstructor;
165
+ readonly default: "text";
166
166
  };
167
- max: StringConstructor;
168
- min: StringConstructor;
169
- disabled: BooleanConstructor;
170
- small: BooleanConstructor;
171
- hideLabel: BooleanConstructor;
172
- onFocus: PropType<() => void>;
173
- onBlur: PropType<() => void>;
167
+ readonly max: StringConstructor;
168
+ readonly min: StringConstructor;
169
+ readonly disabled: BooleanConstructor;
170
+ readonly small: BooleanConstructor;
171
+ readonly hideLabel: BooleanConstructor;
172
+ readonly onFocus: PropType<() => void>;
173
+ readonly onBlur: PropType<() => void>;
174
174
  }, 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<{
175
175
  /**
176
176
  * The id of the currently selected option of this input.
177
177
  */
178
- value: StringConstructor;
178
+ readonly value: StringConstructor;
179
179
  /**
180
180
  * This is called with the newly selected id when the selection has changed.
181
181
  * This happens, when an item from the suggestion list is selected or the
@@ -183,89 +183,89 @@ declare const _default: import("vue").DefineComponent<{
183
183
  * If no id is selected, the empty string is passed, in order to
184
184
  * match the API of all other inputs who never pass `undefined`.
185
185
  */
186
- onUpdateValue: PropType<(newValue: string) => void>;
186
+ readonly onUpdateValue: PropType<(newValue: string) => void>;
187
187
  /**
188
188
  * The options which are allowed and suggested for this input.
189
189
  * The options are filtered based on the user input.
190
190
  */
191
- options: {
192
- type: PropType<InputSelectOption[]>;
193
- default: () => never[];
191
+ readonly options: {
192
+ readonly type: PropType<InputSelectOption[]>;
193
+ readonly default: () => never[];
194
194
  };
195
195
  /**
196
196
  * @see {@link nValInputProps.optional}
197
197
  */
198
- optional: BooleanConstructor;
198
+ readonly optional: BooleanConstructor;
199
199
  /**
200
200
  * @see {@link nValInputProps.form}
201
201
  */
202
- form: PropType<import("./ValidatedForm").ValidatedForm>;
202
+ readonly form: PropType<import("./ValidatedForm").ValidatedForm>;
203
203
  /**
204
204
  * @see {@link nValInputProps.error}
205
205
  */
206
- error: BooleanConstructor;
206
+ readonly error: BooleanConstructor;
207
207
  /**
208
208
  * @see {@link nValInputProps.errorMessage}
209
209
  */
210
- errorMessage: StringConstructor;
210
+ readonly errorMessage: StringConstructor;
211
211
  /**
212
212
  * If set to `true` the list is hidden even if there are still matching items in the list.
213
213
  */
214
- hideList: BooleanConstructor;
214
+ readonly hideList: BooleanConstructor;
215
215
  /**
216
216
  * @see {@link nSuggestionListProps.maxItems}
217
217
  */
218
- maxItems: {
219
- type: NumberConstructor;
220
- default: () => 8;
218
+ readonly maxItems: {
219
+ readonly type: NumberConstructor;
220
+ readonly default: () => number;
221
221
  };
222
222
  /**
223
223
  * @see {@link nSuggestionListProps.listItem}
224
224
  */
225
- listItem: PropType<(props: import("./NSuggestionList").ItemSlotProps<import("./NSuggestionList").SuggestionItem>) => JSX.Element>;
226
- tooltipText: StringConstructor;
227
- tooltipContent: PropType<() => void>;
228
- tooltipHide: BooleanConstructor;
229
- tooltipShow: BooleanConstructor;
230
- tooltipPlacement: {
231
- type: PropType<import("./NTooltip").TooltipPlacement>;
232
- default: string;
225
+ readonly listItem: PropType<(props: import("./NSuggestionList").ItemSlotProps<import("./NSuggestionList").SuggestionItem>) => JSX.Element>;
226
+ readonly tooltipText: StringConstructor;
227
+ readonly tooltipContent: PropType<() => JSX.Element>;
228
+ readonly tooltipHide: BooleanConstructor;
229
+ readonly tooltipShow: BooleanConstructor;
230
+ readonly tooltipPlacement: {
231
+ readonly type: PropType<import("./NTooltip").TooltipPlacement>;
232
+ readonly default: "auto";
233
233
  };
234
- tooltipMaxWidth: {
235
- type: PropType<import("../utils/tailwind").TWMaxWidth>;
236
- default: string;
234
+ readonly tooltipMaxWidth: {
235
+ readonly type: PropType<import("../utils/tailwind").TWMaxWidth>;
236
+ readonly default: "max-w-xs";
237
237
  };
238
- name: StringConstructor;
239
- placeholder: StringConstructor;
240
- autocomplete: {
241
- type: StringConstructor;
242
- default: string;
238
+ readonly name: StringConstructor;
239
+ readonly placeholder: StringConstructor;
240
+ readonly autocomplete: {
241
+ readonly type: StringConstructor;
242
+ readonly default: "off";
243
243
  };
244
- type: {
245
- type: StringConstructor;
246
- default: string;
244
+ readonly type: {
245
+ readonly type: StringConstructor;
246
+ readonly default: "text";
247
247
  };
248
- max: StringConstructor;
249
- min: StringConstructor;
250
- disabled: BooleanConstructor;
251
- small: BooleanConstructor;
252
- hideLabel: BooleanConstructor;
253
- onFocus: PropType<() => void>;
254
- onBlur: PropType<() => void>;
248
+ readonly max: StringConstructor;
249
+ readonly min: StringConstructor;
250
+ readonly disabled: BooleanConstructor;
251
+ readonly small: BooleanConstructor;
252
+ readonly hideLabel: BooleanConstructor;
253
+ readonly onFocus: PropType<() => void>;
254
+ readonly onBlur: PropType<() => void>;
255
255
  }>> & {}, {
256
- small: boolean;
257
- type: string;
258
- tooltipHide: boolean;
259
- tooltipShow: boolean;
260
- tooltipPlacement: import("./NTooltip").TooltipPlacement;
261
- tooltipMaxWidth: import("../utils/tailwind").TWMaxWidth;
262
- options: InputSelectOption[];
263
- disabled: boolean;
264
- error: boolean;
265
- autocomplete: string;
266
- hideLabel: boolean;
267
- optional: boolean;
268
- maxItems: number;
269
- hideList: boolean;
256
+ readonly small: boolean;
257
+ readonly type: string;
258
+ readonly tooltipHide: boolean;
259
+ readonly tooltipShow: boolean;
260
+ readonly tooltipPlacement: import("./NTooltip").TooltipPlacement;
261
+ readonly tooltipMaxWidth: import("../utils/tailwind").TWMaxWidth;
262
+ readonly options: InputSelectOption[];
263
+ readonly disabled: boolean;
264
+ readonly error: boolean;
265
+ readonly autocomplete: string;
266
+ readonly hideLabel: boolean;
267
+ readonly optional: boolean;
268
+ readonly maxItems: number;
269
+ readonly hideList: boolean;
270
270
  }>;
271
271
  export default _default;
@@ -1,5 +1,5 @@
1
1
  import { createVNode as _createVNode, mergeProps as _mergeProps } from "vue";
2
- import { createComponent, createProps } from '../utils/component';
2
+ import { createComponent } from '../utils/component';
3
3
  import { Id } from '../utils/identifiable';
4
4
  import { option } from '../utils/validation';
5
5
  import { vModelForRef } from '../utils/vModel';
@@ -8,7 +8,7 @@ import { computed, ref, watch } from 'vue';
8
8
  import { nInputProps } from './NInput';
9
9
  import NSuggestionList, { nSuggestionListProps } from './NSuggestionList';
10
10
  import NValInput, { nValInputProps } from './NValInput';
11
- export const nInputSelectProps = createProps({
11
+ export const nInputSelectProps = {
12
12
  ...nInputProps,
13
13
  /**
14
14
  * The id of the currently selected option of this input.
@@ -58,7 +58,7 @@ export const nInputSelectProps = createProps({
58
58
  * @see {@link nSuggestionListProps.listItem}
59
59
  */
60
60
  listItem: nSuggestionListProps.listItem
61
- });
61
+ };
62
62
  /**
63
63
  * The `NInputSelect` is very similar to the {@link NSelect}, but instead of a select input it is a regular input.
64
64
  * The user is forced to use a value from the specified options of the input.