@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
@@ -1,32 +1,32 @@
1
1
  import { type PropType } from 'vue';
2
2
  import { type RouteLocationRaw } from 'vue-router';
3
- import type { HeroIcon } from '../utils/utils';
3
+ import type { HeroIcon } from '../utils/tailwind';
4
4
  export declare const nDropdownProps: {
5
5
  /**
6
6
  * The title of the dropdown-button.
7
7
  */
8
- title: StringConstructor;
8
+ readonly title: StringConstructor;
9
9
  /**
10
10
  * The items of the dropdown.
11
11
  * The second dimension of the array is used
12
12
  * to create groups of items, which are visually seperated.
13
13
  */
14
- items: {
15
- type: PropType<DropdownItem[] | DropdownItem[][]>;
16
- default: () => never[];
14
+ readonly items: {
15
+ readonly type: PropType<DropdownItem[] | DropdownItem[][]>;
16
+ readonly default: () => never[];
17
17
  };
18
18
  /**
19
19
  * If set to `true` the panel is right-aligned to the button.
20
20
  */
21
- right: BooleanConstructor;
21
+ readonly right: BooleanConstructor;
22
22
  /**
23
23
  * If set to `true` the dropdown-button is disabled and no interaction is possible.
24
24
  */
25
- disabled: BooleanConstructor;
25
+ readonly disabled: BooleanConstructor;
26
26
  /**
27
27
  * A slot to replace the button of the dropdown.
28
28
  */
29
- button: PropType<() => JSX.Element>;
29
+ readonly button: PropType<() => JSX.Element>;
30
30
  };
31
31
  export type DropdownItem = {
32
32
  /**
@@ -60,57 +60,57 @@ declare const _default: import("vue").DefineComponent<{
60
60
  /**
61
61
  * The title of the dropdown-button.
62
62
  */
63
- title: StringConstructor;
63
+ readonly title: StringConstructor;
64
64
  /**
65
65
  * The items of the dropdown.
66
66
  * The second dimension of the array is used
67
67
  * to create groups of items, which are visually seperated.
68
68
  */
69
- items: {
70
- type: PropType<DropdownItem[] | DropdownItem[][]>;
71
- default: () => never[];
69
+ readonly items: {
70
+ readonly type: PropType<DropdownItem[] | DropdownItem[][]>;
71
+ readonly default: () => never[];
72
72
  };
73
73
  /**
74
74
  * If set to `true` the panel is right-aligned to the button.
75
75
  */
76
- right: BooleanConstructor;
76
+ readonly right: BooleanConstructor;
77
77
  /**
78
78
  * If set to `true` the dropdown-button is disabled and no interaction is possible.
79
79
  */
80
- disabled: BooleanConstructor;
80
+ readonly disabled: BooleanConstructor;
81
81
  /**
82
82
  * A slot to replace the button of the dropdown.
83
83
  */
84
- button: PropType<() => JSX.Element>;
84
+ readonly button: PropType<() => JSX.Element>;
85
85
  }, 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<{
86
86
  /**
87
87
  * The title of the dropdown-button.
88
88
  */
89
- title: StringConstructor;
89
+ readonly title: StringConstructor;
90
90
  /**
91
91
  * The items of the dropdown.
92
92
  * The second dimension of the array is used
93
93
  * to create groups of items, which are visually seperated.
94
94
  */
95
- items: {
96
- type: PropType<DropdownItem[] | DropdownItem[][]>;
97
- default: () => never[];
95
+ readonly items: {
96
+ readonly type: PropType<DropdownItem[] | DropdownItem[][]>;
97
+ readonly default: () => never[];
98
98
  };
99
99
  /**
100
100
  * If set to `true` the panel is right-aligned to the button.
101
101
  */
102
- right: BooleanConstructor;
102
+ readonly right: BooleanConstructor;
103
103
  /**
104
104
  * If set to `true` the dropdown-button is disabled and no interaction is possible.
105
105
  */
106
- disabled: BooleanConstructor;
106
+ readonly disabled: BooleanConstructor;
107
107
  /**
108
108
  * A slot to replace the button of the dropdown.
109
109
  */
110
- button: PropType<() => JSX.Element>;
110
+ readonly button: PropType<() => JSX.Element>;
111
111
  }>> & {}, {
112
- right: boolean;
113
- disabled: boolean;
114
- items: DropdownItem[] | DropdownItem[][];
112
+ readonly right: boolean;
113
+ readonly disabled: boolean;
114
+ readonly items: DropdownItem[] | DropdownItem[][];
115
115
  }>;
116
116
  export default _default;
@@ -1,5 +1,5 @@
1
1
  import { isVNode as _isVNode, createVNode as _createVNode } from "vue";
2
- import { createComponent, createProps } from '../utils/component';
2
+ import { createComponent } from '../utils/component';
3
3
  import { computed, Transition } from 'vue';
4
4
  import { RouterLink } from 'vue-router';
5
5
  import { Menu, MenuButton, MenuItem, MenuItems } from '@headlessui/vue';
@@ -7,7 +7,7 @@ import { ChevronDownIcon } from '@heroicons/vue/24/solid';
7
7
  function _isSlot(s) {
8
8
  return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !_isVNode(s);
9
9
  }
10
- export const nDropdownProps = createProps({
10
+ export const nDropdownProps = {
11
11
  /**
12
12
  * The title of the dropdown-button.
13
13
  */
@@ -33,7 +33,7 @@ export const nDropdownProps = createProps({
33
33
  * A slot to replace the button of the dropdown.
34
34
  */
35
35
  button: Function
36
- });
36
+ };
37
37
  /**
38
38
  * The `NDropdown` consists of a button and a panel with multiple actions.
39
39
  * It is useful to group multiple actions together in one place.
@@ -6,48 +6,48 @@ export declare const nDropzoneProps: {
6
6
  * @see {@link nDropzoneProps.accept}
7
7
  * @see {@link nDropzoneProps.maxFileSize}
8
8
  */
9
- description: StringConstructor;
9
+ readonly description: StringConstructor;
10
10
  /**
11
11
  * The maximum amount of files which can be added to the dropzone.
12
12
  */
13
- maxFiles: {
14
- type: NumberConstructor;
15
- default: number;
13
+ readonly maxFiles: {
14
+ readonly type: NumberConstructor;
15
+ readonly default: 1;
16
16
  };
17
17
  /**
18
18
  * Specifies which file types are accepted. The same syntax as with inputs of type file is used.
19
19
  * Make sure to explain the requirements to the user in the {@link nDropzoneProps.description}.
20
20
  * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/file#unique_file_type_specifiers
21
21
  */
22
- accept: StringConstructor;
22
+ readonly accept: StringConstructor;
23
23
  /**
24
24
  * Specifies the maximum size of an individual file in bytes.
25
25
  * Make sure to explain the max size to the user in the {@link nDropzoneProps.description}.
26
26
  */
27
- maxFileSize: {
28
- type: NumberConstructor;
29
- default: number;
27
+ readonly maxFileSize: {
28
+ readonly type: NumberConstructor;
29
+ readonly default: number;
30
30
  };
31
31
  /**
32
32
  * The maximum length of the file names.
33
33
  * Files names longer than the specified amount of characters will be shortened.
34
34
  * @see {@link maxLengthSplitCenter}
35
35
  */
36
- maxLengthFileNames: {
37
- type: NumberConstructor;
38
- default: number;
36
+ readonly maxLengthFileNames: {
37
+ readonly type: NumberConstructor;
38
+ readonly default: 35;
39
39
  };
40
40
  /**
41
41
  * A tailwind height class, which is applied to the dropzone area.
42
42
  * It is recommended to use `min-h-*` classes,
43
43
  * so the box is always large enough to display it's text.
44
44
  */
45
- height: {
46
- type: StringConstructor;
47
- default: string;
45
+ readonly height: {
46
+ readonly type: StringConstructor;
47
+ readonly default: "min-h-36";
48
48
  };
49
- value: import("vue").PropType<File[]>;
50
- onUpdateValue: import("vue").PropType<(newValue: File[]) => void>;
49
+ readonly value: import("vue").PropType<File[]>;
50
+ readonly onUpdateValue: import("vue").PropType<(newValue: File[]) => void>;
51
51
  };
52
52
  /**
53
53
  * The `NDropzone` is an area where files can be added by the user by drag & drop.
@@ -61,48 +61,48 @@ declare const _default: import("vue").DefineComponent<{
61
61
  * @see {@link nDropzoneProps.accept}
62
62
  * @see {@link nDropzoneProps.maxFileSize}
63
63
  */
64
- description: StringConstructor;
64
+ readonly description: StringConstructor;
65
65
  /**
66
66
  * The maximum amount of files which can be added to the dropzone.
67
67
  */
68
- maxFiles: {
69
- type: NumberConstructor;
70
- default: number;
68
+ readonly maxFiles: {
69
+ readonly type: NumberConstructor;
70
+ readonly default: 1;
71
71
  };
72
72
  /**
73
73
  * Specifies which file types are accepted. The same syntax as with inputs of type file is used.
74
74
  * Make sure to explain the requirements to the user in the {@link nDropzoneProps.description}.
75
75
  * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/file#unique_file_type_specifiers
76
76
  */
77
- accept: StringConstructor;
77
+ readonly accept: StringConstructor;
78
78
  /**
79
79
  * Specifies the maximum size of an individual file in bytes.
80
80
  * Make sure to explain the max size to the user in the {@link nDropzoneProps.description}.
81
81
  */
82
- maxFileSize: {
83
- type: NumberConstructor;
84
- default: number;
82
+ readonly maxFileSize: {
83
+ readonly type: NumberConstructor;
84
+ readonly default: number;
85
85
  };
86
86
  /**
87
87
  * The maximum length of the file names.
88
88
  * Files names longer than the specified amount of characters will be shortened.
89
89
  * @see {@link maxLengthSplitCenter}
90
90
  */
91
- maxLengthFileNames: {
92
- type: NumberConstructor;
93
- default: number;
91
+ readonly maxLengthFileNames: {
92
+ readonly type: NumberConstructor;
93
+ readonly default: 35;
94
94
  };
95
95
  /**
96
96
  * A tailwind height class, which is applied to the dropzone area.
97
97
  * It is recommended to use `min-h-*` classes,
98
98
  * so the box is always large enough to display it's text.
99
99
  */
100
- height: {
101
- type: StringConstructor;
102
- default: string;
100
+ readonly height: {
101
+ readonly type: StringConstructor;
102
+ readonly default: "min-h-36";
103
103
  };
104
- value: import("vue").PropType<File[]>;
105
- onUpdateValue: import("vue").PropType<(newValue: File[]) => void>;
104
+ readonly value: import("vue").PropType<File[]>;
105
+ readonly onUpdateValue: import("vue").PropType<(newValue: File[]) => void>;
106
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<{
107
107
  /**
108
108
  * A description which files are allowed for this dropzone.
@@ -111,52 +111,52 @@ declare const _default: import("vue").DefineComponent<{
111
111
  * @see {@link nDropzoneProps.accept}
112
112
  * @see {@link nDropzoneProps.maxFileSize}
113
113
  */
114
- description: StringConstructor;
114
+ readonly description: StringConstructor;
115
115
  /**
116
116
  * The maximum amount of files which can be added to the dropzone.
117
117
  */
118
- maxFiles: {
119
- type: NumberConstructor;
120
- default: number;
118
+ readonly maxFiles: {
119
+ readonly type: NumberConstructor;
120
+ readonly default: 1;
121
121
  };
122
122
  /**
123
123
  * Specifies which file types are accepted. The same syntax as with inputs of type file is used.
124
124
  * Make sure to explain the requirements to the user in the {@link nDropzoneProps.description}.
125
125
  * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/file#unique_file_type_specifiers
126
126
  */
127
- accept: StringConstructor;
127
+ readonly accept: StringConstructor;
128
128
  /**
129
129
  * Specifies the maximum size of an individual file in bytes.
130
130
  * Make sure to explain the max size to the user in the {@link nDropzoneProps.description}.
131
131
  */
132
- maxFileSize: {
133
- type: NumberConstructor;
134
- default: number;
132
+ readonly maxFileSize: {
133
+ readonly type: NumberConstructor;
134
+ readonly default: number;
135
135
  };
136
136
  /**
137
137
  * The maximum length of the file names.
138
138
  * Files names longer than the specified amount of characters will be shortened.
139
139
  * @see {@link maxLengthSplitCenter}
140
140
  */
141
- maxLengthFileNames: {
142
- type: NumberConstructor;
143
- default: number;
141
+ readonly maxLengthFileNames: {
142
+ readonly type: NumberConstructor;
143
+ readonly default: 35;
144
144
  };
145
145
  /**
146
146
  * A tailwind height class, which is applied to the dropzone area.
147
147
  * It is recommended to use `min-h-*` classes,
148
148
  * so the box is always large enough to display it's text.
149
149
  */
150
- height: {
151
- type: StringConstructor;
152
- default: string;
150
+ readonly height: {
151
+ readonly type: StringConstructor;
152
+ readonly default: "min-h-36";
153
153
  };
154
- value: import("vue").PropType<File[]>;
155
- onUpdateValue: import("vue").PropType<(newValue: File[]) => void>;
154
+ readonly value: import("vue").PropType<File[]>;
155
+ readonly onUpdateValue: import("vue").PropType<(newValue: File[]) => void>;
156
156
  }>> & {}, {
157
- maxFiles: number;
158
- maxFileSize: number;
159
- maxLengthFileNames: number;
160
- height: string;
157
+ readonly maxFiles: number;
158
+ readonly maxFileSize: number;
159
+ readonly maxLengthFileNames: number;
160
+ readonly height: string;
161
161
  }>;
162
162
  export default _default;
@@ -1,6 +1,6 @@
1
1
  import { isVNode as _isVNode, createTextVNode as _createTextVNode, Fragment as _Fragment, createVNode as _createVNode } from "vue";
2
2
  import { trslc } from '../i18n';
3
- import { createComponent, createProps } from '../utils/component';
3
+ import { createComponent } from '../utils/component';
4
4
  import { maxLengthSplitCenter } from '../utils/stringMaxLength';
5
5
  import { notNullish } from '../utils/utils';
6
6
  import { XMarkIcon } from '@heroicons/vue/24/solid';
@@ -12,7 +12,7 @@ import { vModelProps } from '../utils/vModel';
12
12
  function _isSlot(s) {
13
13
  return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !_isVNode(s);
14
14
  }
15
- export const nDropzoneProps = createProps({
15
+ export const nDropzoneProps = {
16
16
  ...vModelProps(Array),
17
17
  /**
18
18
  * A description which files are allowed for this dropzone.
@@ -61,7 +61,7 @@ export const nDropzoneProps = createProps({
61
61
  type: String,
62
62
  default: 'min-h-36'
63
63
  }
64
- });
64
+ };
65
65
  /**
66
66
  * The `NDropzone` is an area where files can be added by the user by drag & drop.
67
67
  * Files can also be selected with a file chooser by clicking on the dropzone.
@@ -5,12 +5,12 @@ export declare const nFormProps: {
5
5
  * The {@link ValidatedForm} which will be used to validate the inputs.
6
6
  * All inputs in this forms hierarchy should be added to the {@link ValidatedForm}.
7
7
  */
8
- form: PropType<ValidatedForm>;
8
+ readonly form: PropType<ValidatedForm>;
9
9
  /**
10
10
  * This is called, when a button of type `submit` in the hierarchy of this view is clicked
11
11
  * and when the validation of the `form` was successful.
12
12
  */
13
- onSubmit: PropType<() => void>;
13
+ readonly onSubmit: PropType<() => void>;
14
14
  };
15
15
  /**
16
16
  * The `NForm` should be used to wrap multiple inputs.
@@ -22,22 +22,22 @@ declare const _default: import("vue").DefineComponent<{
22
22
  * The {@link ValidatedForm} which will be used to validate the inputs.
23
23
  * All inputs in this forms hierarchy should be added to the {@link ValidatedForm}.
24
24
  */
25
- form: PropType<ValidatedForm>;
25
+ readonly form: PropType<ValidatedForm>;
26
26
  /**
27
27
  * This is called, when a button of type `submit` in the hierarchy of this view is clicked
28
28
  * and when the validation of the `form` was successful.
29
29
  */
30
- onSubmit: PropType<() => void>;
30
+ readonly onSubmit: PropType<() => void>;
31
31
  }, 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<{
32
32
  /**
33
33
  * The {@link ValidatedForm} which will be used to validate the inputs.
34
34
  * All inputs in this forms hierarchy should be added to the {@link ValidatedForm}.
35
35
  */
36
- form: PropType<ValidatedForm>;
36
+ readonly form: PropType<ValidatedForm>;
37
37
  /**
38
38
  * This is called, when a button of type `submit` in the hierarchy of this view is clicked
39
39
  * and when the validation of the `form` was successful.
40
40
  */
41
- onSubmit: PropType<() => void>;
41
+ readonly onSubmit: PropType<() => void>;
42
42
  }>> & {}, {}>;
43
43
  export default _default;
@@ -1,6 +1,6 @@
1
1
  import { createVNode as _createVNode } from "vue";
2
- import { createComponent, createProps } from '../utils/component';
3
- export const nFormProps = createProps({
2
+ import { createComponent } from '../utils/component';
3
+ export const nFormProps = {
4
4
  /**
5
5
  * The {@link ValidatedForm} which will be used to validate the inputs.
6
6
  * All inputs in this forms hierarchy should be added to the {@link ValidatedForm}.
@@ -11,7 +11,7 @@ export const nFormProps = createProps({
11
11
  * and when the validation of the `form` was successful.
12
12
  */
13
13
  onSubmit: Function
14
- });
14
+ };
15
15
  /**
16
16
  * The `NForm` should be used to wrap multiple inputs.
17
17
  * If it contains a button of type `submit` in it's hierarchy,