@naptics/vue-collection 0.2.15 → 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 +7 -251
  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 +7 -151
  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 +12 -250
  45. package/components/NModal.js +15 -9
  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
@@ -23,7 +23,7 @@ export declare const nInputSuggestionProps: {
23
23
  readonly disableValidation: BooleanConstructor;
24
24
  readonly optional: BooleanConstructor;
25
25
  readonly rules: {
26
- readonly type: PropType<import("../utils/validation").ValidationRule | import("../utils/validation").ValidationRule[]>;
26
+ readonly type: PropType<import("../utils/validation").ValidationRule[] | import("../utils/validation").ValidationRule>;
27
27
  readonly default: () => never[];
28
28
  };
29
29
  readonly form: PropType<import("./ValidatedForm").ValidatedForm>;
@@ -71,158 +71,5 @@ export declare const nInputSuggestionProps: {
71
71
  * `NInputSuggestion` is an input, which shows a list of possible suggestions to the user
72
72
  * which is filtered while typing. Contrary to {@link NInputSelect} the user is not required to choose any of the suggestions.
73
73
  */
74
- declare const Component: import("vue").DefineComponent<{
75
- /**
76
- * If set to `true` the list is hidden even if there are still matching items in the list.
77
- */
78
- readonly hideList: BooleanConstructor;
79
- /**
80
- * @see {@link nSuggestionListProps.maxItems}
81
- */
82
- readonly maxItems: {
83
- readonly type: NumberConstructor;
84
- readonly default: () => number;
85
- };
86
- /**
87
- * The suggestions which are shown to the user for this input.
88
- * The suggestions are filtered based on the user input.
89
- */
90
- readonly suggestions: {
91
- readonly type: PropType<string[]>;
92
- readonly default: () => never[];
93
- };
94
- readonly input: PropType<(props: import("./NValInput").InputSlotProps) => JSX.Element>;
95
- readonly disableValidation: BooleanConstructor;
96
- readonly optional: BooleanConstructor;
97
- readonly rules: {
98
- readonly type: PropType<import("../utils/validation").ValidationRule | import("../utils/validation").ValidationRule[]>;
99
- readonly default: () => never[];
100
- };
101
- readonly form: PropType<import("./ValidatedForm").ValidatedForm>;
102
- readonly error: BooleanConstructor;
103
- readonly errorMessage: StringConstructor;
104
- readonly hideErrorMessage: BooleanConstructor;
105
- readonly disableBlurValidation: BooleanConstructor;
106
- readonly tooltipText: StringConstructor;
107
- readonly tooltipContent: PropType<() => JSX.Element>;
108
- readonly tooltipHide: BooleanConstructor;
109
- readonly tooltipShow: BooleanConstructor;
110
- readonly tooltipPlacement: {
111
- readonly type: PropType<import("./NTooltip").TooltipPlacement>;
112
- readonly default: "auto";
113
- };
114
- readonly tooltipMaxWidth: {
115
- readonly type: PropType<import("../utils/tailwind").TWMaxWidth>;
116
- readonly default: "max-w-xs";
117
- };
118
- readonly tooltipWrapperClass: StringConstructor;
119
- readonly tooltipContentClass: StringConstructor;
120
- readonly tooltipArrowClass: StringConstructor;
121
- readonly name: StringConstructor;
122
- readonly placeholder: StringConstructor;
123
- readonly autocomplete: {
124
- readonly type: StringConstructor;
125
- readonly default: "off";
126
- };
127
- readonly type: {
128
- readonly type: StringConstructor;
129
- readonly default: "text";
130
- };
131
- readonly max: StringConstructor;
132
- readonly min: StringConstructor;
133
- readonly disabled: BooleanConstructor;
134
- readonly small: BooleanConstructor;
135
- readonly hideLabel: BooleanConstructor;
136
- readonly inputClass: StringConstructor;
137
- readonly onFocus: PropType<() => void>;
138
- readonly onBlur: PropType<() => void>;
139
- readonly value: PropType<string>;
140
- readonly onUpdateValue: PropType<(newValue: string) => void>;
141
- }, 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<{
142
- /**
143
- * If set to `true` the list is hidden even if there are still matching items in the list.
144
- */
145
- readonly hideList: BooleanConstructor;
146
- /**
147
- * @see {@link nSuggestionListProps.maxItems}
148
- */
149
- readonly maxItems: {
150
- readonly type: NumberConstructor;
151
- readonly default: () => number;
152
- };
153
- /**
154
- * The suggestions which are shown to the user for this input.
155
- * The suggestions are filtered based on the user input.
156
- */
157
- readonly suggestions: {
158
- readonly type: PropType<string[]>;
159
- readonly default: () => never[];
160
- };
161
- readonly input: PropType<(props: import("./NValInput").InputSlotProps) => JSX.Element>;
162
- readonly disableValidation: BooleanConstructor;
163
- readonly optional: BooleanConstructor;
164
- readonly rules: {
165
- readonly type: PropType<import("../utils/validation").ValidationRule | import("../utils/validation").ValidationRule[]>;
166
- readonly default: () => never[];
167
- };
168
- readonly form: PropType<import("./ValidatedForm").ValidatedForm>;
169
- readonly error: BooleanConstructor;
170
- readonly errorMessage: StringConstructor;
171
- readonly hideErrorMessage: BooleanConstructor;
172
- readonly disableBlurValidation: BooleanConstructor;
173
- readonly tooltipText: StringConstructor;
174
- readonly tooltipContent: PropType<() => JSX.Element>;
175
- readonly tooltipHide: BooleanConstructor;
176
- readonly tooltipShow: BooleanConstructor;
177
- readonly tooltipPlacement: {
178
- readonly type: PropType<import("./NTooltip").TooltipPlacement>;
179
- readonly default: "auto";
180
- };
181
- readonly tooltipMaxWidth: {
182
- readonly type: PropType<import("../utils/tailwind").TWMaxWidth>;
183
- readonly default: "max-w-xs";
184
- };
185
- readonly tooltipWrapperClass: StringConstructor;
186
- readonly tooltipContentClass: StringConstructor;
187
- readonly tooltipArrowClass: StringConstructor;
188
- readonly name: StringConstructor;
189
- readonly placeholder: StringConstructor;
190
- readonly autocomplete: {
191
- readonly type: StringConstructor;
192
- readonly default: "off";
193
- };
194
- readonly type: {
195
- readonly type: StringConstructor;
196
- readonly default: "text";
197
- };
198
- readonly max: StringConstructor;
199
- readonly min: StringConstructor;
200
- readonly disabled: BooleanConstructor;
201
- readonly small: BooleanConstructor;
202
- readonly hideLabel: BooleanConstructor;
203
- readonly inputClass: StringConstructor;
204
- readonly onFocus: PropType<() => void>;
205
- readonly onBlur: PropType<() => void>;
206
- readonly value: PropType<string>;
207
- readonly onUpdateValue: PropType<(newValue: string) => void>;
208
- }>> & {}, {
209
- readonly small: boolean;
210
- readonly type: string;
211
- readonly tooltipHide: boolean;
212
- readonly tooltipShow: boolean;
213
- readonly tooltipPlacement: import("./NTooltip").TooltipPlacement;
214
- readonly tooltipMaxWidth: import("../utils/tailwind").TWMaxWidth;
215
- readonly disabled: boolean;
216
- readonly error: boolean;
217
- readonly autocomplete: string;
218
- readonly hideLabel: boolean;
219
- readonly disableValidation: boolean;
220
- readonly optional: boolean;
221
- readonly rules: import("../utils/validation").ValidationRule | import("../utils/validation").ValidationRule[];
222
- readonly hideErrorMessage: boolean;
223
- readonly disableBlurValidation: boolean;
224
- readonly maxItems: number;
225
- readonly hideList: boolean;
226
- readonly suggestions: string[];
227
- }>;
74
+ declare const Component: import("vue").DefineSetupFnComponent<Record<string, any>, {}, {}, Record<string, any> & {}, import("vue").PublicProps>;
228
75
  export { Component as NInputSuggestion, 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 { createComponent } from '../utils/component';
3
3
  import { Id } from '../utils/identifiable';
4
4
  import { computed, ref } from 'vue';
@@ -38,74 +38,5 @@ export declare const nLinkProps: {
38
38
  /**
39
39
  * The `NLink` is a styled text which can be used as a {@link RouterLink} or a regular button.
40
40
  */
41
- declare const Component: import("vue").DefineComponent<{
42
- /**
43
- * The text of the link. Can also be set in the default slot.
44
- */
45
- readonly text: StringConstructor;
46
- /**
47
- * The route of the link. If this is set,
48
- * the link becomes a {@link RouterLink} and does not emit the `onClick` event.
49
- */
50
- readonly route: PropType<RouteLocationRaw>;
51
- /**
52
- * The color of the link.
53
- */
54
- readonly color: {
55
- readonly type: StringConstructor;
56
- readonly default: "primary";
57
- };
58
- /**
59
- * The text size, a standard tailwind text-size class.
60
- */
61
- readonly textSize: PropType<TWTextSize>;
62
- /**
63
- * The shade of the link.
64
- */
65
- readonly shade: {
66
- readonly type: NumberConstructor;
67
- readonly default: 500;
68
- };
69
- /**
70
- * This is called when the link is clicked but only, if the `route` prop is not set.
71
- * If the `route` prop is not set, the link will act as a regular button.
72
- */
73
- readonly onClick: PropType<() => void>;
74
- }, 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<{
75
- /**
76
- * The text of the link. Can also be set in the default slot.
77
- */
78
- readonly text: StringConstructor;
79
- /**
80
- * The route of the link. If this is set,
81
- * the link becomes a {@link RouterLink} and does not emit the `onClick` event.
82
- */
83
- readonly route: PropType<RouteLocationRaw>;
84
- /**
85
- * The color of the link.
86
- */
87
- readonly color: {
88
- readonly type: StringConstructor;
89
- readonly default: "primary";
90
- };
91
- /**
92
- * The text size, a standard tailwind text-size class.
93
- */
94
- readonly textSize: PropType<TWTextSize>;
95
- /**
96
- * The shade of the link.
97
- */
98
- readonly shade: {
99
- readonly type: NumberConstructor;
100
- readonly default: 500;
101
- };
102
- /**
103
- * This is called when the link is clicked but only, if the `route` prop is not set.
104
- * If the `route` prop is not set, the link will act as a regular button.
105
- */
106
- readonly onClick: PropType<() => void>;
107
- }>> & {}, {
108
- readonly color: string;
109
- readonly shade: number;
110
- }>;
41
+ declare const Component: import("vue").DefineSetupFnComponent<Record<string, any>, {}, {}, Record<string, any> & {}, import("vue").PublicProps>;
111
42
  export { Component as NLink, Component as default };
@@ -33,47 +33,5 @@ export declare const nListProps: {
33
33
  /**
34
34
  * The `NList` displays key-value data in an appealing way.
35
35
  */
36
- declare const Component: import("vue").DefineComponent<{
37
- /**
38
- * The items which are displayed in the list.
39
- */
40
- readonly items: {
41
- readonly type: PropType<ListItem[]>;
42
- readonly default: () => never[];
43
- };
44
- /**
45
- * Adds the classes to all title elements (on the left side).
46
- */
47
- readonly titleClass: StringConstructor;
48
- /**
49
- * Adds the classes to all text elements (on the right side).
50
- */
51
- readonly textClass: StringConstructor;
52
- /**
53
- * Adds the classes to each row.
54
- */
55
- readonly rowClass: StringConstructor;
56
- }, 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<{
57
- /**
58
- * The items which are displayed in the list.
59
- */
60
- readonly items: {
61
- readonly type: PropType<ListItem[]>;
62
- readonly default: () => never[];
63
- };
64
- /**
65
- * Adds the classes to all title elements (on the left side).
66
- */
67
- readonly titleClass: StringConstructor;
68
- /**
69
- * Adds the classes to all text elements (on the right side).
70
- */
71
- readonly textClass: StringConstructor;
72
- /**
73
- * Adds the classes to each row.
74
- */
75
- readonly rowClass: StringConstructor;
76
- }>> & {}, {
77
- readonly items: ListItem[];
78
- }>;
36
+ declare const Component: import("vue").DefineSetupFnComponent<Record<string, any>, {}, {}, Record<string, any> & {}, import("vue").PublicProps>;
79
37
  export { Component as NList, Component as default };
@@ -1,4 +1,4 @@
1
- import { Fragment as _Fragment, createVNode as _createVNode } from "vue";
1
+ import { createVNode as _createVNode, Fragment as _Fragment } from "vue";
2
2
  import { createComponent } from '../utils/component';
3
3
  export const nListProps = {
4
4
  /**
@@ -25,53 +25,5 @@ export declare const nLoadingIndicator: {
25
25
  /**
26
26
  * The `NLoadingIndicator` is a styled loading indicator.
27
27
  */
28
- declare const Component: import("vue").DefineComponent<{
29
- /**
30
- * The color of the loading-indicator.
31
- */
32
- readonly color: {
33
- readonly type: StringConstructor;
34
- readonly default: "primary";
35
- };
36
- /**
37
- * The shade of the loading-indicator.
38
- */
39
- readonly shade: {
40
- readonly type: NumberConstructor;
41
- readonly default: 400;
42
- };
43
- /**
44
- * The height of the loading-indicator in px.
45
- */
46
- readonly size: {
47
- readonly type: NumberConstructor;
48
- readonly default: 10;
49
- };
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 color of the loading-indicator.
53
- */
54
- readonly color: {
55
- readonly type: StringConstructor;
56
- readonly default: "primary";
57
- };
58
- /**
59
- * The shade of the loading-indicator.
60
- */
61
- readonly shade: {
62
- readonly type: NumberConstructor;
63
- readonly default: 400;
64
- };
65
- /**
66
- * The height of the loading-indicator in px.
67
- */
68
- readonly size: {
69
- readonly type: NumberConstructor;
70
- readonly default: 10;
71
- };
72
- }>> & {}, {
73
- readonly color: string;
74
- readonly shade: number;
75
- readonly size: number;
76
- }>;
28
+ declare const Component: import("vue").DefineSetupFnComponent<Record<string, any>, {}, {}, Record<string, any> & {}, import("vue").PublicProps>;
77
29
  export { Component as NLoadingIndicator, Component as default };
@@ -21,242 +21,19 @@ export declare const nModalProps: {
21
21
  readonly default: "max-w-md";
22
22
  };
23
23
  /**
24
- * The title of the modal which is displayed in the header.
25
- */
26
- readonly title: StringConstructor;
27
- /**
28
- * The text of the ok-button.
29
- */
30
- readonly okText: {
31
- readonly type: StringConstructor;
32
- readonly default: string;
33
- };
34
- /**
35
- * The color of the ok-button.
36
- */
37
- readonly okColor: {
38
- readonly type: StringConstructor;
39
- readonly default: "primary";
40
- };
41
- /**
42
- * If set to `true` the modal is closed when `onOk` is called.
24
+ * The vertical position of the modal. Default is `center`.
43
25
  */
44
- readonly closeOnOk: {
45
- readonly type: BooleanConstructor;
46
- readonly default: true;
47
- };
48
26
  readonly verticalPosition: {
49
27
  readonly type: PropType<"start" | "center" | "end">;
50
28
  readonly default: "center";
51
29
  };
52
- readonly horizontalPosition: {
53
- readonly type: PropType<"start" | "center" | "end">;
54
- readonly default: "center";
55
- };
56
- /**
57
- * If set to `true` the ok-button is hidden.
58
- */
59
- readonly hideOk: BooleanConstructor;
60
- /**
61
- * If set to `true` the ok-button is disabled.
62
- */
63
- readonly okDisabled: BooleanConstructor;
64
- /**
65
- * The text of the cancel-button.
66
- */
67
- readonly cancelText: {
68
- readonly type: StringConstructor;
69
- readonly default: string;
70
- };
71
- /**
72
- * The color of the cancel-button.
73
- */
74
- readonly cancelColor: {
75
- readonly type: StringConstructor;
76
- readonly default: "default";
77
- };
78
- /**
79
- * If set to `true`, the modal is closed when clicking on the background.
80
- * This will call `onCancel`. Default is `true`.
81
- */
82
- readonly closeOnBackground: {
83
- readonly type: BooleanConstructor;
84
- readonly default: true;
85
- };
86
- /**
87
- * If set to `true` the cancel-button is hidden.
88
- */
89
- readonly hideCancel: BooleanConstructor;
90
- /**
91
- * This is called when the ok-button was clicked.
92
- */
93
- readonly onOk: PropType<() => void>;
94
- /**
95
- * This is called when the cancel-button or X-button was clicked or
96
- * if the modal was closed by clicking on the background.
97
- */
98
- readonly onCancel: PropType<() => void>;
99
- /**
100
- * A slot to replace the whole modal content including all buttons, header and footer.
101
- */
102
- readonly modal: PropType<(props: ModalSlotProps) => JSX.Element>;
103
- /**
104
- * A slot to replace the whole content section, i.e. everything between the header and the footer.
105
- */
106
- readonly content: PropType<(props: ModalSlotProps) => JSX.Element>;
107
- /**
108
- * A slot to replace the whole header section (excluding the x).
109
- */
110
- readonly header: PropType<() => JSX.Element>;
111
- /**
112
- * A slot to replace the whole footer section.
113
- */
114
- readonly footer: PropType<(props: ModalSlotProps) => JSX.Element>;
115
- readonly value: PropType<boolean>;
116
- readonly onUpdateValue: PropType<(newValue: boolean) => void>;
117
- };
118
- export type ModalSlotProps = {
119
- ok: () => void;
120
- cancel: () => void;
121
- };
122
- /**
123
- * The `NModal` is the base component for all modals and dialogs.
124
- * It provides the core mechanics to display a window in front of everything else.
125
- */
126
- declare const Component: import("vue").DefineComponent<{
127
- /**
128
- * If set to `true` the header of the modal is hidden.
129
- */
130
- readonly hideHeader: BooleanConstructor;
131
- /**
132
- * If set to `true` the footer of the modal is hidden.
133
- */
134
- readonly hideFooter: BooleanConstructor;
135
- /**
136
- * If set to `true` the X-button in the top right is hidden.
137
- */
138
- readonly hideX: BooleanConstructor;
139
- /**
140
- * The maximum width of the modal. A regular tailwind class.
141
- */
142
- readonly maxWidth: {
143
- readonly type: PropType<TWMaxWidth>;
144
- readonly default: "max-w-md";
145
- };
146
- /**
147
- * The title of the modal which is displayed in the header.
148
- */
149
- readonly title: StringConstructor;
150
- /**
151
- * The text of the ok-button.
152
- */
153
- readonly okText: {
154
- readonly type: StringConstructor;
155
- readonly default: string;
156
- };
157
30
  /**
158
- * The color of the ok-button.
159
- */
160
- readonly okColor: {
161
- readonly type: StringConstructor;
162
- readonly default: "primary";
163
- };
164
- /**
165
- * If set to `true` the modal is closed when `onOk` is called.
31
+ * The horizontal position of the modal. Default is `center`.
166
32
  */
167
- readonly closeOnOk: {
168
- readonly type: BooleanConstructor;
169
- readonly default: true;
170
- };
171
- readonly verticalPosition: {
172
- readonly type: PropType<"start" | "center" | "end">;
173
- readonly default: "center";
174
- };
175
33
  readonly horizontalPosition: {
176
34
  readonly type: PropType<"start" | "center" | "end">;
177
35
  readonly default: "center";
178
36
  };
179
- /**
180
- * If set to `true` the ok-button is hidden.
181
- */
182
- readonly hideOk: BooleanConstructor;
183
- /**
184
- * If set to `true` the ok-button is disabled.
185
- */
186
- readonly okDisabled: BooleanConstructor;
187
- /**
188
- * The text of the cancel-button.
189
- */
190
- readonly cancelText: {
191
- readonly type: StringConstructor;
192
- readonly default: string;
193
- };
194
- /**
195
- * The color of the cancel-button.
196
- */
197
- readonly cancelColor: {
198
- readonly type: StringConstructor;
199
- readonly default: "default";
200
- };
201
- /**
202
- * If set to `true`, the modal is closed when clicking on the background.
203
- * This will call `onCancel`. Default is `true`.
204
- */
205
- readonly closeOnBackground: {
206
- readonly type: BooleanConstructor;
207
- readonly default: true;
208
- };
209
- /**
210
- * If set to `true` the cancel-button is hidden.
211
- */
212
- readonly hideCancel: BooleanConstructor;
213
- /**
214
- * This is called when the ok-button was clicked.
215
- */
216
- readonly onOk: PropType<() => void>;
217
- /**
218
- * This is called when the cancel-button or X-button was clicked or
219
- * if the modal was closed by clicking on the background.
220
- */
221
- readonly onCancel: PropType<() => void>;
222
- /**
223
- * A slot to replace the whole modal content including all buttons, header and footer.
224
- */
225
- readonly modal: PropType<(props: ModalSlotProps) => JSX.Element>;
226
- /**
227
- * A slot to replace the whole content section, i.e. everything between the header and the footer.
228
- */
229
- readonly content: PropType<(props: ModalSlotProps) => JSX.Element>;
230
- /**
231
- * A slot to replace the whole header section (excluding the x).
232
- */
233
- readonly header: PropType<() => JSX.Element>;
234
- /**
235
- * A slot to replace the whole footer section.
236
- */
237
- readonly footer: PropType<(props: ModalSlotProps) => JSX.Element>;
238
- readonly value: PropType<boolean>;
239
- readonly onUpdateValue: PropType<(newValue: boolean) => void>;
240
- }, 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<{
241
- /**
242
- * If set to `true` the header of the modal is hidden.
243
- */
244
- readonly hideHeader: BooleanConstructor;
245
- /**
246
- * If set to `true` the footer of the modal is hidden.
247
- */
248
- readonly hideFooter: BooleanConstructor;
249
- /**
250
- * If set to `true` the X-button in the top right is hidden.
251
- */
252
- readonly hideX: BooleanConstructor;
253
- /**
254
- * The maximum width of the modal. A regular tailwind class.
255
- */
256
- readonly maxWidth: {
257
- readonly type: PropType<TWMaxWidth>;
258
- readonly default: "max-w-md";
259
- };
260
37
  /**
261
38
  * The title of the modal which is displayed in the header.
262
39
  */
@@ -282,14 +59,6 @@ declare const Component: import("vue").DefineComponent<{
282
59
  readonly type: BooleanConstructor;
283
60
  readonly default: true;
284
61
  };
285
- readonly verticalPosition: {
286
- readonly type: PropType<"start" | "center" | "end">;
287
- readonly default: "center";
288
- };
289
- readonly horizontalPosition: {
290
- readonly type: PropType<"start" | "center" | "end">;
291
- readonly default: "center";
292
- };
293
62
  /**
294
63
  * If set to `true` the ok-button is hidden.
295
64
  */
@@ -351,21 +120,14 @@ declare const Component: import("vue").DefineComponent<{
351
120
  readonly footer: PropType<(props: ModalSlotProps) => JSX.Element>;
352
121
  readonly value: PropType<boolean>;
353
122
  readonly onUpdateValue: PropType<(newValue: boolean) => void>;
354
- }>> & {}, {
355
- readonly maxWidth: TWMaxWidth;
356
- readonly hideX: boolean;
357
- readonly hideHeader: boolean;
358
- readonly hideFooter: boolean;
359
- readonly okText: string;
360
- readonly okColor: string;
361
- readonly closeOnOk: boolean;
362
- readonly verticalPosition: "start" | "center" | "end";
363
- readonly horizontalPosition: "start" | "center" | "end";
364
- readonly hideOk: boolean;
365
- readonly okDisabled: boolean;
366
- readonly cancelText: string;
367
- readonly cancelColor: string;
368
- readonly closeOnBackground: boolean;
369
- readonly hideCancel: boolean;
370
- }>;
123
+ };
124
+ export type ModalSlotProps = {
125
+ ok: () => void;
126
+ cancel: () => void;
127
+ };
128
+ /**
129
+ * The `NModal` is the base component for all modals and dialogs.
130
+ * It provides the core mechanics to display a window in front of everything else.
131
+ */
132
+ declare const Component: import("vue").DefineSetupFnComponent<Record<string, any>, {}, {}, Record<string, any> & {}, import("vue").PublicProps>;
371
133
  export { Component as NModal, Component as default };