@naptics/vue-collection 0.2.15 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/workflows/build.yml +26 -0
- package/.github/workflows/deploy-demo.yml +46 -0
- package/.github/workflows/deploy-lib.yml +59 -0
- package/.gitlab-ci.yml +57 -0
- package/.nvmrc +1 -0
- package/.prettierrc +8 -0
- package/.vscode/extensions.json +10 -0
- package/.vscode/launch.json +23 -0
- package/.vscode/settings.json +13 -0
- package/babel.config.json +3 -0
- package/components/NAlert.d.ts +1 -44
- package/components/NBadge.d.ts +1 -133
- package/components/NBreadcrub.d.ts +2 -106
- package/components/NBreadcrub.js +1 -1
- package/components/NButton.d.ts +2 -118
- package/components/NCheckbox.d.ts +1 -32
- package/components/NCheckboxLabel.d.ts +1 -45
- package/components/NCheckboxLabel.js +1 -1
- package/components/NCrudModal.d.ts +7 -251
- package/components/NCrudModal.js +1 -1
- package/components/NDialog.d.ts +1 -110
- package/components/NDialog.js +1 -1
- package/components/NDropdown.d.ts +1 -69
- package/components/NDropdown.js +1 -1
- package/components/NDropzone.d.ts +1 -115
- package/components/NDropzone.js +1 -1
- package/components/NForm.d.ts +1 -23
- package/components/NFormModal.d.ts +7 -151
- package/components/NIconButton.d.ts +3 -159
- package/components/NIconButton.js +1 -1
- package/components/NIconCircle.d.ts +1 -87
- package/components/NInput.d.ts +1 -164
- package/components/NInput.js +1 -1
- package/components/NInputPhone.d.ts +2 -114
- package/components/NInputPhone.js +1 -1
- package/components/NInputSelect.d.ts +2 -187
- package/components/NInputSelect.js +1 -1
- package/components/NInputSuggestion.d.ts +2 -155
- package/components/NInputSuggestion.js +1 -1
- package/components/NLink.d.ts +6 -70
- package/components/NLink.js +8 -1
- package/components/NList.d.ts +1 -43
- package/components/NList.js +1 -1
- package/components/NLoadingIndicator.d.ts +1 -49
- package/components/NModal.d.ts +12 -250
- package/components/NModal.js +15 -9
- package/components/NPagination.d.ts +1 -63
- package/components/NSearchbar.d.ts +1 -56
- package/components/NSearchbarList.d.ts +3 -63
- package/components/NSearchbarList.js +1 -1
- package/components/NSelect.d.ts +2 -148
- package/components/NSelect.js +1 -1
- package/components/NSuggestionList.d.ts +3 -126
- package/components/NSuggestionList.js +5 -2
- package/components/NTable.d.ts +1 -85
- package/components/NTable.js +12 -6
- package/components/NTableAction.d.ts +2 -46
- package/components/NTableAction.js +1 -1
- package/components/NTextArea.d.ts +2 -181
- package/components/NTextArea.js +1 -1
- package/components/NTooltip.d.ts +1 -105
- package/components/NTooltip.js +1 -1
- package/components/NValInput.d.ts +7 -182
- package/components/NValInput.js +1 -1
- package/env.d.ts +15 -0
- package/eslint.config.cjs +29 -0
- package/index.html +13 -0
- package/package.json +21 -19
- package/postcss.config.js +6 -0
- package/public/favicon.ico +0 -0
- package/scripts/build-lib.sh +52 -0
- package/scripts/sync-node-types.js +70 -0
- package/src/demo/App.css +9 -0
- package/src/demo/App.tsx +5 -0
- package/src/demo/components/ColorGrid.tsx +26 -0
- package/src/demo/components/ComponentGrid.tsx +26 -0
- package/src/demo/components/ComponentSection.tsx +30 -0
- package/src/demo/components/VariantSection.tsx +18 -0
- package/src/demo/i18n/de.ts +7 -0
- package/src/demo/i18n/en.ts +7 -0
- package/src/demo/i18n/index.ts +24 -0
- package/src/demo/main.ts +13 -0
- package/src/demo/router/index.ts +21 -0
- package/src/demo/views/HomeView.tsx +94 -0
- package/src/demo/views/NavigationView.tsx +43 -0
- package/src/demo/views/presentation/AlertView.tsx +40 -0
- package/src/demo/views/presentation/BadgeView.tsx +61 -0
- package/src/demo/views/presentation/BreadcrumbView.tsx +52 -0
- package/src/demo/views/presentation/ButtonView.tsx +49 -0
- package/src/demo/views/presentation/CheckboxView.tsx +59 -0
- package/src/demo/views/presentation/DropdownView.tsx +59 -0
- package/src/demo/views/presentation/DropzoneView.tsx +39 -0
- package/src/demo/views/presentation/IconButtonView.tsx +47 -0
- package/src/demo/views/presentation/IconCircleView.tsx +38 -0
- package/src/demo/views/presentation/InputView.tsx +179 -0
- package/src/demo/views/presentation/LinkView.tsx +60 -0
- package/src/demo/views/presentation/ListView.tsx +29 -0
- package/src/demo/views/presentation/LoadingIndicatorView.tsx +38 -0
- package/src/demo/views/presentation/ModalView.tsx +210 -0
- package/src/demo/views/presentation/PaginationView.tsx +25 -0
- package/src/demo/views/presentation/SearchbarView.tsx +80 -0
- package/src/demo/views/presentation/TableView.tsx +146 -0
- package/src/demo/views/presentation/TooltipView.tsx +86 -0
- package/src/lib/components/NAlert.tsx +85 -0
- package/src/lib/components/NBadge.tsx +75 -0
- package/src/lib/components/NBreadcrub.tsx +97 -0
- package/src/lib/components/NButton.tsx +80 -0
- package/src/lib/components/NCheckbox.tsx +55 -0
- package/src/lib/components/NCheckboxLabel.tsx +51 -0
- package/src/lib/components/NCrudModal.tsx +133 -0
- package/src/lib/components/NDialog.tsx +182 -0
- package/src/lib/components/NDropdown.tsx +167 -0
- package/src/lib/components/NDropzone.tsx +265 -0
- package/src/lib/components/NForm.tsx +32 -0
- package/src/lib/components/NFormModal.tsx +66 -0
- package/src/lib/components/NIconButton.tsx +92 -0
- package/src/lib/components/NIconCircle.tsx +78 -0
- package/src/lib/components/NInput.css +11 -0
- package/src/lib/components/NInput.tsx +139 -0
- package/src/lib/components/NInputPhone.tsx +53 -0
- package/src/lib/components/NInputSelect.tsx +126 -0
- package/src/lib/components/NInputSuggestion.tsx +80 -0
- package/src/lib/components/NLink.tsx +82 -0
- package/src/lib/components/NList.tsx +67 -0
- package/src/lib/components/NLoadingIndicator.css +46 -0
- package/src/lib/components/NLoadingIndicator.tsx +63 -0
- package/src/lib/components/NModal.tsx +243 -0
- package/src/lib/components/NPagination.css +15 -0
- package/src/lib/components/NPagination.tsx +131 -0
- package/src/lib/components/NSearchbar.tsx +78 -0
- package/src/lib/components/NSearchbarList.tsx +47 -0
- package/src/lib/components/NSelect.tsx +128 -0
- package/src/lib/components/NSuggestionList.tsx +216 -0
- package/src/lib/components/NTable.css +3 -0
- package/src/lib/components/NTable.tsx +247 -0
- package/src/lib/components/NTableAction.tsx +49 -0
- package/src/lib/components/NTextArea.tsx +159 -0
- package/src/lib/components/NTooltip.css +37 -0
- package/src/lib/components/NTooltip.tsx +250 -0
- package/src/lib/components/NValInput.tsx +163 -0
- package/src/lib/components/ValidatedForm.ts +71 -0
- package/src/lib/components/__tests__/NButton.spec.tsx +26 -0
- package/src/lib/components/__tests__/NCheckbox.spec.tsx +39 -0
- package/src/lib/i18n/de/vue-collection.json +58 -0
- package/src/lib/i18n/en/vue-collection.json +58 -0
- package/src/lib/i18n/index.ts +54 -0
- package/src/lib/index.ts +2 -0
- package/src/lib/jsx.d.ts +13 -0
- package/src/lib/utils/__tests__/identifiable.spec.ts +72 -0
- package/src/lib/utils/__tests__/validation.spec.ts +92 -0
- package/src/lib/utils/breakpoints.ts +47 -0
- package/src/lib/utils/component.tsx +131 -0
- package/src/lib/utils/deferred.ts +28 -0
- package/src/lib/utils/identifiable.ts +87 -0
- package/src/lib/utils/stringMaxLength.ts +25 -0
- package/src/lib/utils/tailwind.ts +41 -0
- package/src/lib/utils/utils.ts +90 -0
- package/src/lib/utils/vModel.ts +260 -0
- package/src/lib/utils/validation.ts +189 -0
- package/src/lib/utils/vue.ts +25 -0
- package/tailwind.config.js +38 -0
- package/tsconfig.config.json +9 -0
- package/tsconfig.demo.json +19 -0
- package/tsconfig.json +16 -0
- package/tsconfig.lib.json +18 -0
- package/tsconfig.vitest.json +8 -0
- package/utils/breakpoints.d.ts +1 -1
- package/utils/component.d.ts +3 -7
- package/utils/component.js +5 -2
- package/utils/identifiable.js +5 -1
- package/vite.config.ts +28 -0
|
@@ -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").
|
|
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 };
|
package/components/NTextArea.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
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';
|
package/components/NTooltip.d.ts
CHANGED
|
@@ -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").
|
|
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';
|
package/components/NTooltip.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
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").
|
|
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 };
|
package/components/NValInput.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
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 {}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
const pluginVue = require('eslint-plugin-vue')
|
|
2
|
+
const { defineConfigWithVueTs, vueTsConfigs } = require('@vue/eslint-config-typescript')
|
|
3
|
+
const js = require('@eslint/js')
|
|
4
|
+
const prettierConfig = require('@vue/eslint-config-prettier')
|
|
5
|
+
|
|
6
|
+
require('@rushstack/eslint-patch/modern-module-resolution')
|
|
7
|
+
|
|
8
|
+
module.exports = defineConfigWithVueTs(
|
|
9
|
+
{
|
|
10
|
+
ignores: ['node_modules/**', 'dist/**', 'dist-ssr/**', 'lib/**', 'coverage/**', 'scripts/*.js'],
|
|
11
|
+
},
|
|
12
|
+
js.configs.recommended,
|
|
13
|
+
pluginVue.configs['flat/essential'],
|
|
14
|
+
vueTsConfigs.recommended,
|
|
15
|
+
prettierConfig,
|
|
16
|
+
{
|
|
17
|
+
files: ['**/*.config.js', '**/*.config.cjs'],
|
|
18
|
+
languageOptions: {
|
|
19
|
+
globals: {
|
|
20
|
+
require: 'readonly',
|
|
21
|
+
module: 'readonly',
|
|
22
|
+
__dirname: 'readonly',
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
rules: {
|
|
26
|
+
'@typescript-eslint/no-require-imports': 'off',
|
|
27
|
+
},
|
|
28
|
+
}
|
|
29
|
+
)
|
package/index.html
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8" />
|
|
5
|
+
<link rel="icon" href="/favicon.ico" />
|
|
6
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
7
|
+
<title>Vue Collection</title>
|
|
8
|
+
</head>
|
|
9
|
+
<body>
|
|
10
|
+
<div id="app"></div>
|
|
11
|
+
<script type="module" src="/src/demo/main.ts"></script>
|
|
12
|
+
</body>
|
|
13
|
+
</html>
|