@naptics/vue-collection 0.2.14 → 0.3.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 (170) hide show
  1. package/.github/workflows/build.yml +26 -0
  2. package/.github/workflows/deploy-demo.yml +46 -0
  3. package/.github/workflows/deploy-lib.yml +65 -0
  4. package/.gitlab-ci.yml +57 -0
  5. package/.nvmrc +1 -0
  6. package/.prettierrc +8 -0
  7. package/.vscode/extensions.json +10 -0
  8. package/.vscode/launch.json +23 -0
  9. package/.vscode/settings.json +13 -0
  10. package/babel.config.json +3 -0
  11. package/components/NAlert.d.ts +1 -44
  12. package/components/NBadge.d.ts +1 -133
  13. package/components/NBreadcrub.d.ts +2 -106
  14. package/components/NBreadcrub.js +1 -1
  15. package/components/NButton.d.ts +2 -118
  16. package/components/NCheckbox.d.ts +1 -32
  17. package/components/NCheckboxLabel.d.ts +1 -45
  18. package/components/NCheckboxLabel.js +1 -1
  19. package/components/NCrudModal.d.ts +9 -221
  20. package/components/NCrudModal.js +1 -1
  21. package/components/NDialog.d.ts +1 -110
  22. package/components/NDialog.js +1 -1
  23. package/components/NDropdown.d.ts +1 -69
  24. package/components/NDropdown.js +1 -1
  25. package/components/NDropzone.d.ts +1 -115
  26. package/components/NDropzone.js +1 -1
  27. package/components/NForm.d.ts +1 -23
  28. package/components/NFormModal.d.ts +9 -127
  29. package/components/NIconButton.d.ts +3 -159
  30. package/components/NIconButton.js +1 -1
  31. package/components/NIconCircle.d.ts +1 -87
  32. package/components/NInput.d.ts +1 -164
  33. package/components/NInput.js +1 -1
  34. package/components/NInputPhone.d.ts +2 -114
  35. package/components/NInputPhone.js +1 -1
  36. package/components/NInputSelect.d.ts +2 -187
  37. package/components/NInputSelect.js +1 -1
  38. package/components/NInputSuggestion.d.ts +2 -155
  39. package/components/NInputSuggestion.js +1 -1
  40. package/components/NLink.d.ts +1 -70
  41. package/components/NList.d.ts +1 -43
  42. package/components/NList.js +1 -1
  43. package/components/NLoadingIndicator.d.ts +1 -49
  44. package/components/NModal.d.ts +15 -227
  45. package/components/NModal.js +16 -2
  46. package/components/NPagination.d.ts +1 -63
  47. package/components/NSearchbar.d.ts +1 -56
  48. package/components/NSearchbarList.d.ts +3 -63
  49. package/components/NSearchbarList.js +1 -1
  50. package/components/NSelect.d.ts +2 -148
  51. package/components/NSelect.js +1 -1
  52. package/components/NSuggestionList.d.ts +3 -126
  53. package/components/NSuggestionList.js +5 -2
  54. package/components/NTable.d.ts +1 -85
  55. package/components/NTable.js +12 -6
  56. package/components/NTableAction.d.ts +2 -46
  57. package/components/NTableAction.js +1 -1
  58. package/components/NTextArea.d.ts +2 -181
  59. package/components/NTextArea.js +1 -1
  60. package/components/NTooltip.d.ts +1 -105
  61. package/components/NTooltip.js +1 -1
  62. package/components/NValInput.d.ts +7 -182
  63. package/components/NValInput.js +1 -1
  64. package/env.d.ts +15 -0
  65. package/eslint.config.cjs +29 -0
  66. package/index.html +13 -0
  67. package/package.json +21 -19
  68. package/postcss.config.js +6 -0
  69. package/public/favicon.ico +0 -0
  70. package/scripts/build-lib.sh +52 -0
  71. package/scripts/sync-node-types.js +70 -0
  72. package/src/demo/App.css +9 -0
  73. package/src/demo/App.tsx +5 -0
  74. package/src/demo/components/ColorGrid.tsx +26 -0
  75. package/src/demo/components/ComponentGrid.tsx +26 -0
  76. package/src/demo/components/ComponentSection.tsx +30 -0
  77. package/src/demo/components/VariantSection.tsx +18 -0
  78. package/src/demo/i18n/de.ts +7 -0
  79. package/src/demo/i18n/en.ts +7 -0
  80. package/src/demo/i18n/index.ts +24 -0
  81. package/src/demo/main.ts +13 -0
  82. package/src/demo/router/index.ts +21 -0
  83. package/src/demo/views/HomeView.tsx +94 -0
  84. package/src/demo/views/NavigationView.tsx +43 -0
  85. package/src/demo/views/presentation/AlertView.tsx +40 -0
  86. package/src/demo/views/presentation/BadgeView.tsx +61 -0
  87. package/src/demo/views/presentation/BreadcrumbView.tsx +52 -0
  88. package/src/demo/views/presentation/ButtonView.tsx +49 -0
  89. package/src/demo/views/presentation/CheckboxView.tsx +59 -0
  90. package/src/demo/views/presentation/DropdownView.tsx +59 -0
  91. package/src/demo/views/presentation/DropzoneView.tsx +39 -0
  92. package/src/demo/views/presentation/IconButtonView.tsx +47 -0
  93. package/src/demo/views/presentation/IconCircleView.tsx +38 -0
  94. package/src/demo/views/presentation/InputView.tsx +179 -0
  95. package/src/demo/views/presentation/LinkView.tsx +50 -0
  96. package/src/demo/views/presentation/ListView.tsx +29 -0
  97. package/src/demo/views/presentation/LoadingIndicatorView.tsx +38 -0
  98. package/src/demo/views/presentation/ModalView.tsx +210 -0
  99. package/src/demo/views/presentation/PaginationView.tsx +25 -0
  100. package/src/demo/views/presentation/SearchbarView.tsx +80 -0
  101. package/src/demo/views/presentation/TableView.tsx +146 -0
  102. package/src/demo/views/presentation/TooltipView.tsx +86 -0
  103. package/src/lib/components/NAlert.tsx +85 -0
  104. package/src/lib/components/NBadge.tsx +75 -0
  105. package/src/lib/components/NBreadcrub.tsx +97 -0
  106. package/src/lib/components/NButton.tsx +80 -0
  107. package/src/lib/components/NCheckbox.tsx +55 -0
  108. package/src/lib/components/NCheckboxLabel.tsx +51 -0
  109. package/src/lib/components/NCrudModal.tsx +133 -0
  110. package/src/lib/components/NDialog.tsx +182 -0
  111. package/src/lib/components/NDropdown.tsx +167 -0
  112. package/src/lib/components/NDropzone.tsx +265 -0
  113. package/src/lib/components/NForm.tsx +32 -0
  114. package/src/lib/components/NFormModal.tsx +66 -0
  115. package/src/lib/components/NIconButton.tsx +92 -0
  116. package/src/lib/components/NIconCircle.tsx +78 -0
  117. package/src/lib/components/NInput.css +11 -0
  118. package/src/lib/components/NInput.tsx +139 -0
  119. package/src/lib/components/NInputPhone.tsx +53 -0
  120. package/src/lib/components/NInputSelect.tsx +126 -0
  121. package/src/lib/components/NInputSuggestion.tsx +80 -0
  122. package/src/lib/components/NLink.tsx +68 -0
  123. package/src/lib/components/NList.tsx +67 -0
  124. package/src/lib/components/NLoadingIndicator.css +46 -0
  125. package/src/lib/components/NLoadingIndicator.tsx +63 -0
  126. package/src/lib/components/NModal.tsx +243 -0
  127. package/src/lib/components/NPagination.css +15 -0
  128. package/src/lib/components/NPagination.tsx +131 -0
  129. package/src/lib/components/NSearchbar.tsx +78 -0
  130. package/src/lib/components/NSearchbarList.tsx +47 -0
  131. package/src/lib/components/NSelect.tsx +128 -0
  132. package/src/lib/components/NSuggestionList.tsx +216 -0
  133. package/src/lib/components/NTable.css +3 -0
  134. package/src/lib/components/NTable.tsx +247 -0
  135. package/src/lib/components/NTableAction.tsx +49 -0
  136. package/src/lib/components/NTextArea.tsx +159 -0
  137. package/src/lib/components/NTooltip.css +37 -0
  138. package/src/lib/components/NTooltip.tsx +250 -0
  139. package/src/lib/components/NValInput.tsx +163 -0
  140. package/src/lib/components/ValidatedForm.ts +71 -0
  141. package/src/lib/components/__tests__/NButton.spec.tsx +26 -0
  142. package/src/lib/components/__tests__/NCheckbox.spec.tsx +39 -0
  143. package/src/lib/i18n/de/vue-collection.json +58 -0
  144. package/src/lib/i18n/en/vue-collection.json +58 -0
  145. package/src/lib/i18n/index.ts +54 -0
  146. package/src/lib/index.ts +2 -0
  147. package/src/lib/jsx.d.ts +13 -0
  148. package/src/lib/utils/__tests__/identifiable.spec.ts +72 -0
  149. package/src/lib/utils/__tests__/validation.spec.ts +92 -0
  150. package/src/lib/utils/breakpoints.ts +47 -0
  151. package/src/lib/utils/component.tsx +131 -0
  152. package/src/lib/utils/deferred.ts +28 -0
  153. package/src/lib/utils/identifiable.ts +87 -0
  154. package/src/lib/utils/stringMaxLength.ts +25 -0
  155. package/src/lib/utils/tailwind.ts +41 -0
  156. package/src/lib/utils/utils.ts +90 -0
  157. package/src/lib/utils/vModel.ts +260 -0
  158. package/src/lib/utils/validation.ts +189 -0
  159. package/src/lib/utils/vue.ts +25 -0
  160. package/tailwind.config.js +38 -0
  161. package/tsconfig.config.json +9 -0
  162. package/tsconfig.demo.json +19 -0
  163. package/tsconfig.json +16 -0
  164. package/tsconfig.lib.json +18 -0
  165. package/tsconfig.vitest.json +8 -0
  166. package/utils/breakpoints.d.ts +1 -1
  167. package/utils/component.d.ts +3 -7
  168. package/utils/component.js +5 -2
  169. package/utils/identifiable.js +5 -1
  170. package/vite.config.ts +28 -0
@@ -1,7 +1,7 @@
1
- import { Fragment as _Fragment, createVNode as _createVNode } from "vue";
1
+ import { createVNode as _createVNode, Fragment as _Fragment } from "vue";
2
2
  import { isWidthBreakpoint } from '../utils/breakpoints';
3
3
  import { createComponent } from '../utils/component';
4
- import { ChevronDownIcon, ChevronUpIcon } from '@heroicons/vue/24/solid';
4
+ import { ChevronLeftIcon } from '@heroicons/vue/24/solid';
5
5
  import { computed, Fragment, ref, watch } from 'vue';
6
6
  import NIconButton from './NIconButton';
7
7
  import './NTable.css';
@@ -95,17 +95,23 @@ const Component = createComponent('NTable', nTableProps, props => {
95
95
  "class": "p-4"
96
96
  }, [_createVNode("div", {
97
97
  "class": ['flex', heading.emph ? 'font-medium text-default-900' : '', heading.cellClass, heading.key == N_TABLE_ACTION_KEY ? 'justify-end items-center space-x-3' : '']
98
- }, [item[heading.key] && buildItem(item[heading.key]), heading.key == N_TABLE_ACTION_KEY && showDetails.value && _createVNode(NIconButton, {
99
- "icon": isDetailsOpen(itemIndex) ? ChevronDownIcon : ChevronUpIcon,
98
+ }, [item[heading.key] && buildItem(item[heading.key]), heading.key == N_TABLE_ACTION_KEY && showDetails.value && _createVNode("div", {
99
+ "class": "inline-flex transition-transform duration-200",
100
+ "style": {
101
+ transform: isDetailsOpen(itemIndex) ? 'rotate(-90deg)' : 'rotate(0deg)',
102
+ transformOrigin: 'center center'
103
+ }
104
+ }, [_createVNode(NIconButton, {
105
+ "icon": ChevronLeftIcon,
100
106
  "onClick": () => toggleDetailsOpen(itemIndex)
101
- }, null)])]))])]), showDetails.value && isDetailsOpen(itemIndex) && _createVNode("tbody", {
107
+ }, null)])])]))])]), showDetails.value && isDetailsOpen(itemIndex) && _createVNode("tbody", {
102
108
  "class": [itemIndex % 2 === 0 ? 'bg-white' : 'bg-default-50', item.detailsClass]
103
109
  }, [details.value.map((detail, detailIndex) => _createVNode("tr", {
104
110
  "key": `detail-${detailIndex}`
105
111
  }, [_createVNode("td", {
106
112
  "class": ['table-heading px-4 py-1', props.headingDetailsClass, details.value.length - 1 == detailIndex ? 'pb-4' : '']
107
113
  }, [buildItem(detail.label)]), _createVNode("td", {
108
- "class": ['px-4 py-1', details.value[detailIndex].detailsClass, details.value.length - 1 == detailIndex ? 'pb-4' : ''],
114
+ "class": ['px-4 py-1', details.value[detailIndex]?.detailsClass, details.value.length - 1 == detailIndex ? 'pb-4' : ''],
109
115
  "colspan": headings.value.length - 1
110
116
  }, [item[detail.key] && buildItem(item[detail.key])])]))])]))])]);
111
117
  });
@@ -13,7 +13,7 @@ export declare const nTableActionProps: {
13
13
  * The html attribute, which indicates the type of the button.
14
14
  */
15
15
  readonly type: {
16
- readonly type: PropType<"button" | "submit" | "reset">;
16
+ readonly type: PropType<"submit" | "button" | "reset">;
17
17
  readonly default: "button";
18
18
  };
19
19
  /**
@@ -26,49 +26,5 @@ export declare const nTableActionProps: {
26
26
  * The `NTableAction` is a button or {@link RouterLink} which is styled to fit into a table.
27
27
  * It is basically styled as an emphasized text in the table.
28
28
  */
29
- declare const Component: import("vue").DefineComponent<{
30
- /**
31
- * The route of the action. If set the component will be a {@link RouterLink}.
32
- */
33
- readonly route: PropType<RouteLocationRaw>;
34
- /**
35
- * The text of the action.
36
- */
37
- readonly text: StringConstructor;
38
- /**
39
- * The html attribute, which indicates the type of the button.
40
- */
41
- readonly type: {
42
- readonly type: PropType<"button" | "submit" | "reset">;
43
- readonly default: "button";
44
- };
45
- /**
46
- * This is called when the action is clicked.
47
- * It is only called when the `route` prop is not set on the action.
48
- */
49
- readonly onClick: PropType<() => void>;
50
- }, 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<{
51
- /**
52
- * The route of the action. If set the component will be a {@link RouterLink}.
53
- */
54
- readonly route: PropType<RouteLocationRaw>;
55
- /**
56
- * The text of the action.
57
- */
58
- readonly text: StringConstructor;
59
- /**
60
- * The html attribute, which indicates the type of the button.
61
- */
62
- readonly type: {
63
- readonly type: PropType<"button" | "submit" | "reset">;
64
- readonly default: "button";
65
- };
66
- /**
67
- * This is called when the action is clicked.
68
- * It is only called when the `route` prop is not set on the action.
69
- */
70
- readonly onClick: PropType<() => void>;
71
- }>> & {}, {
72
- readonly type: "button" | "submit" | "reset";
73
- }>;
29
+ declare const Component: import("vue").DefineSetupFnComponent<Record<string, any>, {}, {}, Record<string, any> & {}, import("vue").PublicProps>;
74
30
  export { Component as NTableAction, Component as default };
@@ -1,4 +1,4 @@
1
- import { isVNode as _isVNode, createVNode as _createVNode, Fragment as _Fragment } from "vue";
1
+ import { Fragment as _Fragment, createVNode as _createVNode, isVNode as _isVNode } from "vue";
2
2
  import { createComponent } from '../utils/component';
3
3
  import { RouterLink } from 'vue-router';
4
4
  import { nButtonProps } from './NButton';
@@ -3,7 +3,7 @@ export declare const nTextAreaProps: {
3
3
  readonly disableValidation: BooleanConstructor;
4
4
  readonly optional: BooleanConstructor;
5
5
  readonly rules: {
6
- readonly type: PropType<import("../utils/validation").ValidationRule | import("../utils/validation").ValidationRule[]>;
6
+ readonly type: PropType<import("../utils/validation").ValidationRule[] | import("../utils/validation").ValidationRule>;
7
7
  readonly default: () => never[];
8
8
  };
9
9
  readonly form: PropType<import("./ValidatedForm").ValidatedForm>;
@@ -88,184 +88,5 @@ export type NTextAreaExposed = {
88
88
  */
89
89
  focus(): void;
90
90
  };
91
- declare const Component: import("vue").DefineComponent<{
92
- readonly disableValidation: BooleanConstructor;
93
- readonly optional: BooleanConstructor;
94
- readonly rules: {
95
- readonly type: PropType<import("../utils/validation").ValidationRule | import("../utils/validation").ValidationRule[]>;
96
- readonly default: () => never[];
97
- };
98
- readonly form: PropType<import("./ValidatedForm").ValidatedForm>;
99
- readonly error: BooleanConstructor;
100
- readonly errorMessage: StringConstructor;
101
- readonly hideErrorMessage: BooleanConstructor;
102
- readonly disableBlurValidation: BooleanConstructor;
103
- readonly tooltipText: StringConstructor;
104
- readonly tooltipContent: PropType<() => JSX.Element>;
105
- readonly tooltipHide: BooleanConstructor;
106
- readonly tooltipShow: BooleanConstructor;
107
- readonly tooltipPlacement: {
108
- readonly type: PropType<import("./NTooltip").TooltipPlacement>;
109
- readonly default: "auto";
110
- };
111
- readonly tooltipMaxWidth: {
112
- readonly type: PropType<import("../utils/tailwind").TWMaxWidth>;
113
- readonly default: "max-w-xs";
114
- };
115
- readonly tooltipWrapperClass: StringConstructor;
116
- readonly tooltipContentClass: StringConstructor;
117
- readonly tooltipArrowClass: StringConstructor;
118
- /**
119
- * The name of the text area. Is displayed as a label above the text area.
120
- */
121
- readonly name: StringConstructor;
122
- /**
123
- * The placeholder of the text area.
124
- */
125
- readonly placeholder: StringConstructor;
126
- /**
127
- * The html autocomplete attribute of the text area.
128
- */
129
- readonly autocomplete: {
130
- readonly type: StringConstructor;
131
- readonly default: "off";
132
- };
133
- /**
134
- * If set to `true`, the text area is resizable in y-direction.
135
- */
136
- readonly resizable: {
137
- readonly type: BooleanConstructor;
138
- readonly default: true;
139
- };
140
- /**
141
- * The initial height of the text area in terms of
142
- * how many text rows fit inside the text area.
143
- * The height can be change if {@link nTextAreaProps.resizable} is `true`
144
- */
145
- readonly rows: NumberConstructor;
146
- /**
147
- * The maximum length of the input string. Entering longer strings are simply
148
- * prevented, but no error message is shown to the user.
149
- */
150
- readonly maxLength: NumberConstructor;
151
- /**
152
- * If set to `true` the text area is disabled and no interaction is possible.
153
- */
154
- readonly disabled: BooleanConstructor;
155
- /**
156
- * If set to `true` the text area's label is hidden.
157
- */
158
- readonly hideLabel: BooleanConstructor;
159
- /**
160
- * Adds the classes directly to the input (e.g. for shadow).
161
- */
162
- readonly inputClass: StringConstructor;
163
- /**
164
- * This is called when the text area reveices focus.
165
- */
166
- readonly onFocus: PropType<() => void>;
167
- /**
168
- * This is called when the text area looses focus.
169
- */
170
- readonly onBlur: PropType<() => void>;
171
- readonly value: PropType<string>;
172
- readonly onUpdateValue: PropType<(newValue: string) => void>;
173
- }, 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<{
174
- readonly disableValidation: BooleanConstructor;
175
- readonly optional: BooleanConstructor;
176
- readonly rules: {
177
- readonly type: PropType<import("../utils/validation").ValidationRule | import("../utils/validation").ValidationRule[]>;
178
- readonly default: () => never[];
179
- };
180
- readonly form: PropType<import("./ValidatedForm").ValidatedForm>;
181
- readonly error: BooleanConstructor;
182
- readonly errorMessage: StringConstructor;
183
- readonly hideErrorMessage: BooleanConstructor;
184
- readonly disableBlurValidation: BooleanConstructor;
185
- readonly tooltipText: StringConstructor;
186
- readonly tooltipContent: PropType<() => JSX.Element>;
187
- readonly tooltipHide: BooleanConstructor;
188
- readonly tooltipShow: BooleanConstructor;
189
- readonly tooltipPlacement: {
190
- readonly type: PropType<import("./NTooltip").TooltipPlacement>;
191
- readonly default: "auto";
192
- };
193
- readonly tooltipMaxWidth: {
194
- readonly type: PropType<import("../utils/tailwind").TWMaxWidth>;
195
- readonly default: "max-w-xs";
196
- };
197
- readonly tooltipWrapperClass: StringConstructor;
198
- readonly tooltipContentClass: StringConstructor;
199
- readonly tooltipArrowClass: StringConstructor;
200
- /**
201
- * The name of the text area. Is displayed as a label above the text area.
202
- */
203
- readonly name: StringConstructor;
204
- /**
205
- * The placeholder of the text area.
206
- */
207
- readonly placeholder: StringConstructor;
208
- /**
209
- * The html autocomplete attribute of the text area.
210
- */
211
- readonly autocomplete: {
212
- readonly type: StringConstructor;
213
- readonly default: "off";
214
- };
215
- /**
216
- * If set to `true`, the text area is resizable in y-direction.
217
- */
218
- readonly resizable: {
219
- readonly type: BooleanConstructor;
220
- readonly default: true;
221
- };
222
- /**
223
- * The initial height of the text area in terms of
224
- * how many text rows fit inside the text area.
225
- * The height can be change if {@link nTextAreaProps.resizable} is `true`
226
- */
227
- readonly rows: NumberConstructor;
228
- /**
229
- * The maximum length of the input string. Entering longer strings are simply
230
- * prevented, but no error message is shown to the user.
231
- */
232
- readonly maxLength: NumberConstructor;
233
- /**
234
- * If set to `true` the text area is disabled and no interaction is possible.
235
- */
236
- readonly disabled: BooleanConstructor;
237
- /**
238
- * If set to `true` the text area's label is hidden.
239
- */
240
- readonly hideLabel: BooleanConstructor;
241
- /**
242
- * Adds the classes directly to the input (e.g. for shadow).
243
- */
244
- readonly inputClass: StringConstructor;
245
- /**
246
- * This is called when the text area reveices focus.
247
- */
248
- readonly onFocus: PropType<() => void>;
249
- /**
250
- * This is called when the text area looses focus.
251
- */
252
- readonly onBlur: PropType<() => void>;
253
- readonly value: PropType<string>;
254
- readonly onUpdateValue: PropType<(newValue: string) => void>;
255
- }>> & {}, {
256
- readonly tooltipHide: boolean;
257
- readonly tooltipShow: boolean;
258
- readonly tooltipPlacement: import("./NTooltip").TooltipPlacement;
259
- readonly tooltipMaxWidth: import("../utils/tailwind").TWMaxWidth;
260
- readonly disabled: boolean;
261
- readonly error: boolean;
262
- readonly autocomplete: string;
263
- readonly hideLabel: boolean;
264
- readonly disableValidation: boolean;
265
- readonly optional: boolean;
266
- readonly rules: import("../utils/validation").ValidationRule | import("../utils/validation").ValidationRule[];
267
- readonly hideErrorMessage: boolean;
268
- readonly disableBlurValidation: boolean;
269
- readonly resizable: boolean;
270
- }>;
91
+ declare const Component: import("vue").DefineSetupFnComponent<Record<string, any>, {}, {}, Record<string, any> & {}, import("vue").PublicProps>;
271
92
  export { Component as NTextArea, Component as default };
@@ -1,4 +1,4 @@
1
- import { withDirectives as _withDirectives, vShow as _vShow, createVNode as _createVNode, mergeProps as _mergeProps } from "vue";
1
+ import { mergeProps as _mergeProps, createVNode as _createVNode, vShow as _vShow, withDirectives as _withDirectives } from "vue";
2
2
  import { createComponent } from '../utils/component';
3
3
  import { ref } from 'vue';
4
4
  import { ExclamationCircleIcon } from '@heroicons/vue/24/solid';
@@ -131,110 +131,6 @@ export declare function mapTooltipProps(props: ExtractedProps<typeof nToolTipPro
131
131
  * <NButton />
132
132
  * </NTooltip>
133
133
  */
134
- declare const Component: import("vue").DefineComponent<{
135
- /**
136
- * The text content of the tooltip.
137
- */
138
- readonly text: StringConstructor;
139
- /**
140
- * A slot to replace the content of the tooltip. This will override the `text` prop.
141
- */
142
- readonly content: PropType<() => JSX.Element>;
143
- /**
144
- * If set to `true` the tooltip is shown constantly.
145
- */
146
- readonly show: BooleanConstructor;
147
- /**
148
- * If set to `true` the tooltip is hidden constantly.
149
- */
150
- readonly hide: BooleanConstructor;
151
- /**
152
- * If set to `true` the `block` class is applied to the tooltip.
153
- * This should be set if the content in the default slot is also block.
154
- */
155
- readonly block: BooleanConstructor;
156
- /**
157
- * The placement of the tooltip.
158
- */
159
- readonly placement: {
160
- readonly type: PropType<TooltipPlacement>;
161
- readonly default: "auto";
162
- };
163
- /**
164
- * The maximum width of the tooltip.
165
- */
166
- readonly maxWidth: {
167
- readonly type: PropType<TWMaxWidth>;
168
- readonly default: "max-w-xs";
169
- };
170
- /**
171
- * Adds the classes to the (invisible) wrapper element.
172
- */
173
- readonly wrapperClass: StringConstructor;
174
- /**
175
- * Adds the classes to the container of the tooltips content.
176
- */
177
- readonly contentClass: StringConstructor;
178
- /**
179
- * Adds the classes to the tooltip arrow. Make sure to use `before:` classes
180
- * to target the arrow (which is the before element).
181
- */
182
- readonly arrowClass: StringConstructor;
183
- }, 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<{
184
- /**
185
- * The text content of the tooltip.
186
- */
187
- readonly text: StringConstructor;
188
- /**
189
- * A slot to replace the content of the tooltip. This will override the `text` prop.
190
- */
191
- readonly content: PropType<() => JSX.Element>;
192
- /**
193
- * If set to `true` the tooltip is shown constantly.
194
- */
195
- readonly show: BooleanConstructor;
196
- /**
197
- * If set to `true` the tooltip is hidden constantly.
198
- */
199
- readonly hide: BooleanConstructor;
200
- /**
201
- * If set to `true` the `block` class is applied to the tooltip.
202
- * This should be set if the content in the default slot is also block.
203
- */
204
- readonly block: BooleanConstructor;
205
- /**
206
- * The placement of the tooltip.
207
- */
208
- readonly placement: {
209
- readonly type: PropType<TooltipPlacement>;
210
- readonly default: "auto";
211
- };
212
- /**
213
- * The maximum width of the tooltip.
214
- */
215
- readonly maxWidth: {
216
- readonly type: PropType<TWMaxWidth>;
217
- readonly default: "max-w-xs";
218
- };
219
- /**
220
- * Adds the classes to the (invisible) wrapper element.
221
- */
222
- readonly wrapperClass: StringConstructor;
223
- /**
224
- * Adds the classes to the container of the tooltips content.
225
- */
226
- readonly contentClass: StringConstructor;
227
- /**
228
- * Adds the classes to the tooltip arrow. Make sure to use `before:` classes
229
- * to target the arrow (which is the before element).
230
- */
231
- readonly arrowClass: StringConstructor;
232
- }>> & {}, {
233
- readonly show: boolean;
234
- readonly hide: boolean;
235
- readonly block: boolean;
236
- readonly placement: TooltipPlacement;
237
- readonly maxWidth: TWMaxWidth;
238
- }>;
134
+ declare const Component: import("vue").DefineSetupFnComponent<Record<string, any>, {}, {}, Record<string, any> & {}, import("vue").PublicProps>;
239
135
  export { Component as NTooltip, Component as default };
240
136
  export type TooltipPlacement = 'auto' | 'auto-start' | 'auto-end' | 'top' | 'top-start' | 'top-end' | 'bottom' | 'bottom-start' | 'bottom-end' | 'right' | 'right-start' | 'right-end' | 'left' | 'left-start' | 'left-end';
@@ -1,4 +1,4 @@
1
- import { withDirectives as _withDirectives, vShow as _vShow, Fragment as _Fragment, createVNode as _createVNode } from "vue";
1
+ import { createVNode as _createVNode, Fragment as _Fragment, vShow as _vShow, withDirectives as _withDirectives } from "vue";
2
2
  import { createComponent } from '../utils/component';
3
3
  import { uniqueId } from '../utils/utils';
4
4
  import { computed, onMounted, ref, watch, onUnmounted, Transition } from 'vue';
@@ -19,7 +19,7 @@ export declare const validationProps: {
19
19
  * If `optional` is set to false, the rule {@link required} will be checked first.
20
20
  */
21
21
  readonly rules: {
22
- readonly type: PropType<ValidationRule | ValidationRule[]>;
22
+ readonly type: PropType<ValidationRule[] | ValidationRule>;
23
23
  readonly default: () => never[];
24
24
  };
25
25
  /**
@@ -66,7 +66,7 @@ export declare const nValInputProps: {
66
66
  * If `optional` is set to false, the rule {@link required} will be checked first.
67
67
  */
68
68
  readonly rules: {
69
- readonly type: PropType<ValidationRule | ValidationRule[]>;
69
+ readonly type: PropType<ValidationRule[] | ValidationRule>;
70
70
  readonly default: () => never[];
71
71
  };
72
72
  /**
@@ -92,7 +92,10 @@ export declare const nValInputProps: {
92
92
  */
93
93
  readonly disableBlurValidation: BooleanConstructor;
94
94
  readonly tooltipText: StringConstructor;
95
- readonly tooltipContent: PropType<() => JSX.Element>;
95
+ readonly tooltipContent: PropType<() => JSX.Element /**
96
+ * If set to `true` this input is always valid when its value is empty.
97
+ * If set to `false` the input receives the {@link required} rule. Default is `false`.
98
+ */>;
96
99
  readonly tooltipHide: BooleanConstructor;
97
100
  readonly tooltipShow: BooleanConstructor;
98
101
  readonly tooltipPlacement: {
@@ -148,183 +151,5 @@ export type NValInputExposed = {
148
151
  /**
149
152
  * The `NValInput` is a `NInput` with custom validation.
150
153
  */
151
- declare const Component: import("vue").DefineComponent<{
152
- /**
153
- * A slot to replace the input.
154
- */
155
- readonly input: PropType<(props: InputSlotProps) => JSX.Element>;
156
- /**
157
- * If set to `true` this inputs validation will always succeed and all validation
158
- * rules are ignored. Default is `false`.
159
- */
160
- readonly disableValidation: BooleanConstructor;
161
- /**
162
- * If set to `true` this input is always valid when its value is empty.
163
- * If set to `false` the input receives the {@link required} rule. Default is `false`.
164
- */
165
- readonly optional: BooleanConstructor;
166
- /**
167
- * The rules which this input is checked with.
168
- * The rules are checked sequentially and the error of the first failed rule is displayed.
169
- * If `optional` is set to false, the rule {@link required} will be checked first.
170
- */
171
- readonly rules: {
172
- readonly type: PropType<ValidationRule | ValidationRule[]>;
173
- readonly default: () => never[];
174
- };
175
- /**
176
- * The form, which this input will be added to.
177
- * On initialization, this input will call {@link ValidatedForm.addInput} passing itself to the form.
178
- */
179
- readonly form: PropType<ValidatedForm>;
180
- /**
181
- * Overrides the internal error state. If set to true, it will always display an error.
182
- */
183
- readonly error: BooleanConstructor;
184
- /**
185
- * Overrides the internal error message. If set, this message is always displayed.
186
- */
187
- readonly errorMessage: StringConstructor;
188
- /**
189
- * If set to `true` the error message is not shown.
190
- * However, the input is still marked red if it is in an error state.
191
- */
192
- readonly hideErrorMessage: BooleanConstructor;
193
- /**
194
- * Disables the validation on blur. Should only be used in special occasions.
195
- */
196
- readonly disableBlurValidation: BooleanConstructor;
197
- readonly tooltipText: StringConstructor;
198
- readonly tooltipContent: PropType<() => JSX.Element>;
199
- readonly tooltipHide: BooleanConstructor;
200
- readonly tooltipShow: BooleanConstructor;
201
- readonly tooltipPlacement: {
202
- readonly type: PropType<import("./NTooltip").TooltipPlacement>;
203
- readonly default: "auto";
204
- };
205
- readonly tooltipMaxWidth: {
206
- readonly type: PropType<import("../utils/tailwind").TWMaxWidth>;
207
- readonly default: "max-w-xs";
208
- };
209
- readonly tooltipWrapperClass: StringConstructor;
210
- readonly tooltipContentClass: StringConstructor;
211
- readonly tooltipArrowClass: StringConstructor;
212
- readonly name: StringConstructor;
213
- readonly placeholder: StringConstructor;
214
- readonly autocomplete: {
215
- readonly type: StringConstructor;
216
- readonly default: "off";
217
- };
218
- readonly type: {
219
- readonly type: StringConstructor;
220
- readonly default: "text";
221
- };
222
- readonly max: StringConstructor;
223
- readonly min: StringConstructor;
224
- readonly disabled: BooleanConstructor;
225
- readonly small: BooleanConstructor;
226
- readonly hideLabel: BooleanConstructor;
227
- readonly inputClass: StringConstructor;
228
- readonly onFocus: PropType<() => void>;
229
- readonly onBlur: PropType<() => void>;
230
- readonly value: PropType<string>;
231
- readonly onUpdateValue: PropType<(newValue: string) => void>;
232
- }, 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<{
233
- /**
234
- * A slot to replace the input.
235
- */
236
- readonly input: PropType<(props: InputSlotProps) => JSX.Element>;
237
- /**
238
- * If set to `true` this inputs validation will always succeed and all validation
239
- * rules are ignored. Default is `false`.
240
- */
241
- readonly disableValidation: BooleanConstructor;
242
- /**
243
- * If set to `true` this input is always valid when its value is empty.
244
- * If set to `false` the input receives the {@link required} rule. Default is `false`.
245
- */
246
- readonly optional: BooleanConstructor;
247
- /**
248
- * The rules which this input is checked with.
249
- * The rules are checked sequentially and the error of the first failed rule is displayed.
250
- * If `optional` is set to false, the rule {@link required} will be checked first.
251
- */
252
- readonly rules: {
253
- readonly type: PropType<ValidationRule | ValidationRule[]>;
254
- readonly default: () => never[];
255
- };
256
- /**
257
- * The form, which this input will be added to.
258
- * On initialization, this input will call {@link ValidatedForm.addInput} passing itself to the form.
259
- */
260
- readonly form: PropType<ValidatedForm>;
261
- /**
262
- * Overrides the internal error state. If set to true, it will always display an error.
263
- */
264
- readonly error: BooleanConstructor;
265
- /**
266
- * Overrides the internal error message. If set, this message is always displayed.
267
- */
268
- readonly errorMessage: StringConstructor;
269
- /**
270
- * If set to `true` the error message is not shown.
271
- * However, the input is still marked red if it is in an error state.
272
- */
273
- readonly hideErrorMessage: BooleanConstructor;
274
- /**
275
- * Disables the validation on blur. Should only be used in special occasions.
276
- */
277
- readonly disableBlurValidation: BooleanConstructor;
278
- readonly tooltipText: StringConstructor;
279
- readonly tooltipContent: PropType<() => JSX.Element>;
280
- readonly tooltipHide: BooleanConstructor;
281
- readonly tooltipShow: BooleanConstructor;
282
- readonly tooltipPlacement: {
283
- readonly type: PropType<import("./NTooltip").TooltipPlacement>;
284
- readonly default: "auto";
285
- };
286
- readonly tooltipMaxWidth: {
287
- readonly type: PropType<import("../utils/tailwind").TWMaxWidth>;
288
- readonly default: "max-w-xs";
289
- };
290
- readonly tooltipWrapperClass: StringConstructor;
291
- readonly tooltipContentClass: StringConstructor;
292
- readonly tooltipArrowClass: StringConstructor;
293
- readonly name: StringConstructor;
294
- readonly placeholder: StringConstructor;
295
- readonly autocomplete: {
296
- readonly type: StringConstructor;
297
- readonly default: "off";
298
- };
299
- readonly type: {
300
- readonly type: StringConstructor;
301
- readonly default: "text";
302
- };
303
- readonly max: StringConstructor;
304
- readonly min: StringConstructor;
305
- readonly disabled: BooleanConstructor;
306
- readonly small: BooleanConstructor;
307
- readonly hideLabel: BooleanConstructor;
308
- readonly inputClass: StringConstructor;
309
- readonly onFocus: PropType<() => void>;
310
- readonly onBlur: PropType<() => void>;
311
- readonly value: PropType<string>;
312
- readonly onUpdateValue: PropType<(newValue: string) => void>;
313
- }>> & {}, {
314
- readonly small: boolean;
315
- readonly type: string;
316
- readonly tooltipHide: boolean;
317
- readonly tooltipShow: boolean;
318
- readonly tooltipPlacement: import("./NTooltip").TooltipPlacement;
319
- readonly tooltipMaxWidth: import("../utils/tailwind").TWMaxWidth;
320
- readonly disabled: boolean;
321
- readonly error: boolean;
322
- readonly autocomplete: string;
323
- readonly hideLabel: boolean;
324
- readonly disableValidation: boolean;
325
- readonly optional: boolean;
326
- readonly rules: ValidationRule | ValidationRule[];
327
- readonly hideErrorMessage: boolean;
328
- readonly disableBlurValidation: boolean;
329
- }>;
154
+ declare const Component: import("vue").DefineSetupFnComponent<Record<string, any>, {}, {}, Record<string, any> & {}, import("vue").PublicProps>;
330
155
  export { Component as NValInput, Component as default };
@@ -1,4 +1,4 @@
1
- import { createVNode as _createVNode, mergeProps as _mergeProps } from "vue";
1
+ import { mergeProps as _mergeProps, createVNode as _createVNode } from "vue";
2
2
  import { createComponentWithSlots } from '../utils/component';
3
3
  import { computed, onMounted, onUnmounted } from 'vue';
4
4
  import { ref, reactive, watch } from 'vue';
package/env.d.ts ADDED
@@ -0,0 +1,15 @@
1
+ /// <reference types="vite/client" />
2
+
3
+ import type { VNode } from 'vue'
4
+
5
+ declare global {
6
+ namespace JSX {
7
+ interface IntrinsicElements {
8
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
9
+ [elem: string]: any
10
+ }
11
+ type Element = VNode
12
+ }
13
+ }
14
+
15
+ export {}