@xleddyl/443-components-vue 0.8.1 → 0.8.3
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/README.md +52 -4
- package/dist/chart/BarChart.vue +33 -22
- package/dist/chart/BarChart.vue.d.ts +4 -0
- package/dist/chart/chart.css +2 -2
- package/dist/chart/useChartColors.mjs +8 -8
- package/dist/components/core/Button.vue.d.ts +1 -1
- package/dist/components/core/FormField.vue +5 -0
- package/dist/components/core/FormField.vue.d.ts +4 -0
- package/dist/components/core/Input.vue +59 -5
- package/dist/components/core/Input.vue.d.ts +9 -5
- package/dist/components/core/Textarea.vue +28 -3
- package/dist/components/core/Textarea.vue.d.ts +7 -5
- package/dist/components/core/types.d.ts +1 -1
- package/dist/components/data/Badge.vue.d.ts +1 -1
- package/dist/components/data/DescriptionList.vue.d.ts +1 -1
- package/dist/components/data/FilterPills.vue +43 -4
- package/dist/components/data/FilterPills.vue.d.ts +4 -1
- package/dist/components/data/Pagination.vue +63 -2
- package/dist/components/data/Pagination.vue.d.ts +12 -0
- package/dist/components/data/Tag.vue.d.ts +1 -1
- package/dist/components/data/Tree.vue.d.ts +1 -1
- package/dist/components/data/types.d.ts +1 -0
- package/dist/components/feedback/Meter.vue.d.ts +1 -1
- package/dist/components/feedback/Progress.vue.d.ts +1 -1
- package/dist/components/feedback/ProgressRing.vue.d.ts +1 -1
- package/dist/components/forms/Calendar.vue +31 -7
- package/dist/components/forms/Calendar.vue.d.ts +13 -2
- package/dist/components/forms/CheckboxGroup.vue +7 -1
- package/dist/components/forms/CheckboxGroup.vue.d.ts +1 -0
- package/dist/components/forms/ColorInput.vue.d.ts +5 -5
- package/dist/components/forms/Combobox.vue +4 -3
- package/dist/components/forms/Combobox.vue.d.ts +1 -0
- package/dist/components/forms/DateInput.vue.d.ts +10 -6
- package/dist/components/forms/DatePicker.vue.d.ts +1 -1
- package/dist/components/forms/FileInput.vue.d.ts +1 -1
- package/dist/components/forms/NumberInput.vue.d.ts +5 -5
- package/dist/components/forms/PasswordInput.vue.d.ts +9 -5
- package/dist/components/forms/PinInput.vue.d.ts +5 -5
- package/dist/components/forms/Select.vue +21 -2
- package/dist/components/forms/Select.vue.d.ts +4 -4
- package/dist/components/forms/Slider.vue.d.ts +5 -5
- package/dist/components/forms/Switch.vue.d.ts +1 -1
- package/dist/components/forms/TimeInput.vue.d.ts +9 -5
- package/dist/components/layout/AppShell.vue +4 -2
- package/dist/components/layout/AppShell.vue.d.ts +2 -0
- package/dist/components/layout/Card.vue.d.ts +1 -1
- package/dist/components/layout/CopyButton.vue.d.ts +1 -1
- package/dist/components/layout/PageHeader.vue +15 -3
- package/dist/components/layout/PageHeader.vue.d.ts +5 -0
- package/dist/components/layout/Separator.vue +17 -4
- package/dist/components/layout/Separator.vue.d.ts +7 -1
- package/dist/components/layout/Tabs.vue +10 -0
- package/dist/components/layout/types.d.ts +3 -0
- package/dist/components/overlays/ConfirmDialog.vue.d.ts +8 -4
- package/dist/components/overlays/ConfirmHost.vue.d.ts +8 -4
- package/dist/components/overlays/ContextMenu.vue.d.ts +4 -2
- package/dist/components/overlays/DropdownMenu.vue +5 -1
- package/dist/components/overlays/DropdownMenu.vue.d.ts +8 -2
- package/dist/components/overlays/Modal.vue +9 -2
- package/dist/components/overlays/Modal.vue.d.ts +4 -0
- package/dist/components/overlays/types.d.ts +2 -2
- package/dist/components/templates/DashboardLayout.vue +2 -0
- package/dist/components/templates/DashboardLayout.vue.d.ts +2 -0
- package/dist/components/templates/SettingsModal.vue.d.ts +8 -4
- package/dist/components/templates/types.d.ts +1 -0
- package/dist/composables/useForm.d.ts +24 -2
- package/dist/composables/useForm.mjs +51 -8
- package/dist/composables/useOverlay.d.ts +1 -1
- package/dist/editor/RichTextEditor.vue +108 -10
- package/dist/editor/RichTextEditor.vue.d.ts +5 -2
- package/dist/editor/rich-text-editor.css +31 -4
- package/dist/editor/types.d.ts +2 -1
- package/dist/grid/DataGrid.vue +106 -24
- package/dist/grid/DataGrid.vue.d.ts +14 -2
- package/dist/grid/cells/DateCell.vue +18 -3
- package/dist/grid/cells/ImageCell.vue +6 -1
- package/dist/grid/data-grid.css +17 -3
- package/dist/grid/index.d.ts +2 -1
- package/dist/grid/index.mjs +6 -1
- package/dist/grid/modules.d.ts +2 -0
- package/dist/grid/modules.mjs +32 -0
- package/dist/grid/theme.mjs +5 -5
- package/dist/grid/types.d.ts +4 -0
- package/dist/icons/builtin.d.ts +3 -0
- package/dist/icons/builtin.mjs +3 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.mjs +1 -0
- package/dist/internal/core/intl.d.ts +2 -0
- package/dist/internal/core/intl.mjs +17 -0
- package/dist/internal/forms/counter.d.ts +18 -0
- package/dist/internal/forms/counter.mjs +31 -0
- package/dist/internal/keys.d.ts +2 -1
- package/dist/internal/keys.mjs +1 -0
- package/dist/internal/overlays/MenuList.vue +4 -2
- package/dist/internal/overlays/MenuList.vue.d.ts +2 -0
- package/dist/internal/overlays/OverlayView.vue.d.ts +8 -4
- package/dist/locale/de.mjs +21 -3
- package/dist/locale/en.mjs +21 -3
- package/dist/locale/it.mjs +21 -3
- package/dist/locale/types.d.ts +18 -0
- package/dist/nuxt/runtime/layouts/dashboard.vue +1 -0
- package/dist/styles/base.css +2 -1
- package/dist/styles/core/button.css +42 -16
- package/dist/styles/core/form-field.css +7 -1
- package/dist/styles/core/input.css +31 -2
- package/dist/styles/core/kbd.css +1 -1
- package/dist/styles/core/textarea.css +10 -0
- package/dist/styles/data/avatar.css +1 -1
- package/dist/styles/data/badge.css +39 -23
- package/dist/styles/data/description-list.css +2 -2
- package/dist/styles/data/filter-pills.css +24 -3
- package/dist/styles/data/pagination.css +26 -3
- package/dist/styles/data/selection-bar.css +1 -1
- package/dist/styles/data/stat.css +4 -4
- package/dist/styles/data/table.css +4 -4
- package/dist/styles/data/tag.css +1 -1
- package/dist/styles/data/timeline.css +1 -1
- package/dist/styles/data/tree.css +2 -2
- package/dist/styles/feedback/empty-state.css +1 -1
- package/dist/styles/feedback/loading-host.css +1 -1
- package/dist/styles/feedback/loading-overlay.css +1 -1
- package/dist/styles/feedback/meter.css +1 -1
- package/dist/styles/feedback/progress.css +2 -2
- package/dist/styles/forced-colors.css +6 -1
- package/dist/styles/forms/calendar.css +30 -3
- package/dist/styles/forms/checkbox.css +1 -1
- package/dist/styles/forms/choice.css +7 -1
- package/dist/styles/forms/combobox.css +2 -2
- package/dist/styles/forms/file-input.css +1 -1
- package/dist/styles/forms/password-input.css +1 -1
- package/dist/styles/forms/pin-input.css +1 -1
- package/dist/styles/forms/radio.css +1 -1
- package/dist/styles/forms/segmented.css +2 -2
- package/dist/styles/forms/select.css +2 -2
- package/dist/styles/forms/slider.css +1 -1
- package/dist/styles/forms/switch.css +4 -4
- package/dist/styles/layout/accordion.css +2 -2
- package/dist/styles/layout/app-shell.css +18 -6
- package/dist/styles/layout/breadcrumbs.css +3 -3
- package/dist/styles/layout/card.css +1 -1
- package/dist/styles/layout/nav-link.css +1 -1
- package/dist/styles/layout/page-header.css +21 -1
- package/dist/styles/layout/separator.css +21 -1
- package/dist/styles/layout/sidebar.css +1 -1
- package/dist/styles/layout/tabs.css +30 -1
- package/dist/styles/layout/theme-switch.css +1 -1
- package/dist/styles/overlays/command.css +3 -3
- package/dist/styles/overlays/drawer.css +4 -3
- package/dist/styles/overlays/floating.css +2 -2
- package/dist/styles/overlays/menu.css +5 -1
- package/dist/styles/overlays/modal.css +12 -9
- package/dist/styles/overlays/toast.css +3 -3
- package/dist/styles/overlays/tooltip.css +26 -8
- package/dist/styles/shared.css +2 -2
- package/dist/styles/templates/account-menu.css +1 -1
- package/dist/styles/templates/auth-layout.css +4 -4
- package/dist/styles/templates/brand.css +2 -2
- package/dist/styles/templates/dashboard-page.css +1 -1
- package/dist/styles/templates/empty-page.css +3 -3
- package/dist/styles/templates/error-page.css +1 -1
- package/dist/styles/templates/save-bar.css +1 -1
- package/dist/styles/templates/settings-modal.css +6 -6
- package/dist/styles/utilities.css +3 -3
- package/package.json +1 -1
|
@@ -21,11 +21,11 @@ declare const __VLS_base: import("vue").DefineComponent<{
|
|
|
21
21
|
key?: PropertyKey | undefined;
|
|
22
22
|
loading?: boolean;
|
|
23
23
|
prefix?: "k-modal" | "k-drawer" | undefined;
|
|
24
|
+
size?: import("./types.ts").ModalSize;
|
|
24
25
|
label?: string;
|
|
25
26
|
style?: import("vue").StyleValue;
|
|
26
27
|
results?: (string | number) | undefined;
|
|
27
28
|
placeholder?: string | undefined;
|
|
28
|
-
size?: import("./types.ts").ModalSize;
|
|
29
29
|
dir?: string | undefined;
|
|
30
30
|
class?: import("vue").ClassValue;
|
|
31
31
|
role?: string | undefined;
|
|
@@ -129,6 +129,7 @@ declare const __VLS_base: import("vue").DefineComponent<{
|
|
|
129
129
|
color?: string | undefined;
|
|
130
130
|
id?: string | undefined;
|
|
131
131
|
lang?: string | undefined;
|
|
132
|
+
width?: string;
|
|
132
133
|
tabindex?: (string | number) | undefined;
|
|
133
134
|
'aria-activedescendant'?: string | undefined;
|
|
134
135
|
'aria-atomic'?: (boolean | "true" | "false") | undefined;
|
|
@@ -220,14 +221,15 @@ declare const __VLS_base: import("vue").DefineComponent<{
|
|
|
220
221
|
onVnodeBeforeUnmount?: (((vnode: import("vue").VNode) => void) | ((vnode: import("vue").VNode) => void)[]) | undefined;
|
|
221
222
|
onVnodeUnmounted?: (((vnode: import("vue").VNode) => void) | ((vnode: import("vue").VNode) => void)[]) | undefined;
|
|
222
223
|
flush?: boolean;
|
|
223
|
-
onClose?: (() => any) | undefined;
|
|
224
224
|
sheet?: boolean;
|
|
225
|
+
onClose?: (() => any) | undefined;
|
|
225
226
|
onOpen?: (() => any) | undefined;
|
|
226
227
|
closeLabel?: string;
|
|
227
228
|
rootClass?: unknown;
|
|
228
229
|
hideClose?: boolean;
|
|
229
230
|
beforeClose?: import("./types.ts").DialogBeforeClose;
|
|
230
231
|
closedby?: import("../../index.ts").DialogClosedBy;
|
|
232
|
+
minHeight?: string;
|
|
231
233
|
}, {
|
|
232
234
|
confirm: typeof confirm;
|
|
233
235
|
cancel: typeof cancel;
|
|
@@ -249,11 +251,11 @@ declare const __VLS_base: import("vue").DefineComponent<{
|
|
|
249
251
|
key?: PropertyKey | undefined;
|
|
250
252
|
loading?: boolean;
|
|
251
253
|
prefix?: "k-modal" | "k-drawer" | undefined;
|
|
254
|
+
size?: import("./types.ts").ModalSize;
|
|
252
255
|
label?: string;
|
|
253
256
|
style?: import("vue").StyleValue;
|
|
254
257
|
results?: (string | number) | undefined;
|
|
255
258
|
placeholder?: string | undefined;
|
|
256
|
-
size?: import("./types.ts").ModalSize;
|
|
257
259
|
dir?: string | undefined;
|
|
258
260
|
class?: import("vue").ClassValue;
|
|
259
261
|
role?: string | undefined;
|
|
@@ -357,6 +359,7 @@ declare const __VLS_base: import("vue").DefineComponent<{
|
|
|
357
359
|
color?: string | undefined;
|
|
358
360
|
id?: string | undefined;
|
|
359
361
|
lang?: string | undefined;
|
|
362
|
+
width?: string;
|
|
360
363
|
tabindex?: (string | number) | undefined;
|
|
361
364
|
'aria-activedescendant'?: string | undefined;
|
|
362
365
|
'aria-atomic'?: (boolean | "true" | "false") | undefined;
|
|
@@ -448,14 +451,15 @@ declare const __VLS_base: import("vue").DefineComponent<{
|
|
|
448
451
|
onVnodeBeforeUnmount?: (((vnode: import("vue").VNode) => void) | ((vnode: import("vue").VNode) => void)[]) | undefined;
|
|
449
452
|
onVnodeUnmounted?: (((vnode: import("vue").VNode) => void) | ((vnode: import("vue").VNode) => void)[]) | undefined;
|
|
450
453
|
flush?: boolean;
|
|
451
|
-
onClose?: (() => any) | undefined;
|
|
452
454
|
sheet?: boolean;
|
|
455
|
+
onClose?: (() => any) | undefined;
|
|
453
456
|
onOpen?: (() => any) | undefined;
|
|
454
457
|
closeLabel?: string;
|
|
455
458
|
rootClass?: unknown;
|
|
456
459
|
hideClose?: boolean;
|
|
457
460
|
beforeClose?: import("./types.ts").DialogBeforeClose;
|
|
458
461
|
closedby?: import("../../index.ts").DialogClosedBy;
|
|
462
|
+
minHeight?: string;
|
|
459
463
|
}> & Readonly<{
|
|
460
464
|
onCancel?: (() => any) | undefined;
|
|
461
465
|
"onUpdate:open"?: ((value: boolean) => any) | undefined;
|
|
@@ -11,11 +11,11 @@ declare const __VLS_export: import("vue").DefineComponent<Partial<NonNullable<{
|
|
|
11
11
|
readonly key?: PropertyKey | undefined;
|
|
12
12
|
readonly loading?: boolean | undefined;
|
|
13
13
|
readonly prefix?: "k-modal" | "k-drawer" | undefined;
|
|
14
|
+
readonly size?: import("./types.ts").ModalSize | undefined;
|
|
14
15
|
readonly label?: string | undefined;
|
|
15
16
|
readonly style?: import("vue").StyleValue;
|
|
16
17
|
readonly results?: (string | number) | undefined;
|
|
17
18
|
readonly placeholder?: string | undefined | undefined;
|
|
18
|
-
readonly size?: import("./types.ts").ModalSize | undefined;
|
|
19
19
|
readonly dir?: string | undefined | undefined;
|
|
20
20
|
readonly class?: import("vue").ClassValue;
|
|
21
21
|
readonly role?: string | undefined | undefined;
|
|
@@ -119,6 +119,7 @@ declare const __VLS_export: import("vue").DefineComponent<Partial<NonNullable<{
|
|
|
119
119
|
readonly color?: string | undefined | undefined;
|
|
120
120
|
readonly id?: string | undefined | undefined;
|
|
121
121
|
readonly lang?: string | undefined | undefined;
|
|
122
|
+
readonly width?: string | undefined;
|
|
122
123
|
readonly tabindex?: (string | number) | undefined;
|
|
123
124
|
readonly 'aria-activedescendant'?: string | undefined | undefined;
|
|
124
125
|
readonly 'aria-atomic'?: (boolean | "true" | "false") | undefined;
|
|
@@ -210,14 +211,15 @@ declare const __VLS_export: import("vue").DefineComponent<Partial<NonNullable<{
|
|
|
210
211
|
readonly onVnodeBeforeUnmount?: (((vnode: import("vue").VNode) => void) | ((vnode: import("vue").VNode) => void)[]) | undefined;
|
|
211
212
|
readonly onVnodeUnmounted?: (((vnode: import("vue").VNode) => void) | ((vnode: import("vue").VNode) => void)[]) | undefined;
|
|
212
213
|
readonly flush?: boolean | undefined;
|
|
213
|
-
readonly onClose?: (() => any) | undefined;
|
|
214
214
|
readonly sheet?: boolean | undefined;
|
|
215
|
+
readonly onClose?: (() => any) | undefined;
|
|
215
216
|
readonly onOpen?: (() => any) | undefined;
|
|
216
217
|
readonly closeLabel?: string | undefined;
|
|
217
218
|
readonly rootClass?: unknown;
|
|
218
219
|
readonly hideClose?: boolean | undefined;
|
|
219
220
|
readonly beforeClose?: import("./types.ts").DialogBeforeClose | undefined;
|
|
220
221
|
readonly closedby?: import("../../index.ts").DialogClosedBy | undefined;
|
|
222
|
+
readonly minHeight?: string | undefined;
|
|
221
223
|
readonly onCancel?: (() => any) | undefined;
|
|
222
224
|
readonly "onUpdate:open"?: ((value: boolean) => any) | undefined;
|
|
223
225
|
readonly onAfterLeave?: (() => any) | undefined;
|
|
@@ -235,11 +237,11 @@ declare const __VLS_export: import("vue").DefineComponent<Partial<NonNullable<{
|
|
|
235
237
|
readonly key?: PropertyKey | undefined;
|
|
236
238
|
readonly loading?: boolean | undefined;
|
|
237
239
|
readonly prefix?: "k-modal" | "k-drawer" | undefined;
|
|
240
|
+
readonly size?: import("./types.ts").ModalSize | undefined;
|
|
238
241
|
readonly label?: string | undefined;
|
|
239
242
|
readonly style?: import("vue").StyleValue;
|
|
240
243
|
readonly results?: (string | number) | undefined;
|
|
241
244
|
readonly placeholder?: string | undefined | undefined;
|
|
242
|
-
readonly size?: import("./types.ts").ModalSize | undefined;
|
|
243
245
|
readonly dir?: string | undefined | undefined;
|
|
244
246
|
readonly class?: import("vue").ClassValue;
|
|
245
247
|
readonly role?: string | undefined | undefined;
|
|
@@ -343,6 +345,7 @@ declare const __VLS_export: import("vue").DefineComponent<Partial<NonNullable<{
|
|
|
343
345
|
readonly color?: string | undefined | undefined;
|
|
344
346
|
readonly id?: string | undefined | undefined;
|
|
345
347
|
readonly lang?: string | undefined | undefined;
|
|
348
|
+
readonly width?: string | undefined;
|
|
346
349
|
readonly tabindex?: (string | number) | undefined;
|
|
347
350
|
readonly 'aria-activedescendant'?: string | undefined | undefined;
|
|
348
351
|
readonly 'aria-atomic'?: (boolean | "true" | "false") | undefined;
|
|
@@ -434,14 +437,15 @@ declare const __VLS_export: import("vue").DefineComponent<Partial<NonNullable<{
|
|
|
434
437
|
readonly onVnodeBeforeUnmount?: (((vnode: import("vue").VNode) => void) | ((vnode: import("vue").VNode) => void)[]) | undefined;
|
|
435
438
|
readonly onVnodeUnmounted?: (((vnode: import("vue").VNode) => void) | ((vnode: import("vue").VNode) => void)[]) | undefined;
|
|
436
439
|
readonly flush?: boolean | undefined;
|
|
437
|
-
readonly onClose?: (() => any) | undefined;
|
|
438
440
|
readonly sheet?: boolean | undefined;
|
|
441
|
+
readonly onClose?: (() => any) | undefined;
|
|
439
442
|
readonly onOpen?: (() => any) | undefined;
|
|
440
443
|
readonly closeLabel?: string | undefined;
|
|
441
444
|
readonly rootClass?: unknown;
|
|
442
445
|
readonly hideClose?: boolean | undefined;
|
|
443
446
|
readonly beforeClose?: import("./types.ts").DialogBeforeClose | undefined;
|
|
444
447
|
readonly closedby?: import("../../index.ts").DialogClosedBy | undefined;
|
|
448
|
+
readonly minHeight?: string | undefined;
|
|
445
449
|
readonly onCancel?: (() => any) | undefined;
|
|
446
450
|
readonly "onUpdate:open"?: ((value: boolean) => any) | undefined;
|
|
447
451
|
readonly onAfterLeave?: (() => any) | undefined;
|
|
@@ -12,7 +12,7 @@ declare const __VLS_base: import("vue").DefineComponent<{
|
|
|
12
12
|
open?: boolean;
|
|
13
13
|
key?: PropertyKey | undefined;
|
|
14
14
|
prefix?: string | undefined;
|
|
15
|
-
anchor?: (() => import("
|
|
15
|
+
anchor?: (() => import("./types").OverlayAnchorTarget | null | undefined) | undefined;
|
|
16
16
|
title?: string | undefined;
|
|
17
17
|
style?: import("vue").StyleValue;
|
|
18
18
|
results?: (string | number) | undefined;
|
|
@@ -213,6 +213,7 @@ declare const __VLS_base: import("vue").DefineComponent<{
|
|
|
213
213
|
level?: number;
|
|
214
214
|
labelledby?: string;
|
|
215
215
|
manualPositioning?: boolean;
|
|
216
|
+
matchWidth?: boolean;
|
|
216
217
|
onOpenChange?: ((open: boolean) => any) | undefined;
|
|
217
218
|
}, {
|
|
218
219
|
openAt: (x: number, y: number) => void;
|
|
@@ -227,7 +228,7 @@ declare const __VLS_base: import("vue").DefineComponent<{
|
|
|
227
228
|
open?: boolean;
|
|
228
229
|
key?: PropertyKey | undefined;
|
|
229
230
|
prefix?: string | undefined;
|
|
230
|
-
anchor?: (() => import("
|
|
231
|
+
anchor?: (() => import("./types").OverlayAnchorTarget | null | undefined) | undefined;
|
|
231
232
|
title?: string | undefined;
|
|
232
233
|
style?: import("vue").StyleValue;
|
|
233
234
|
results?: (string | number) | undefined;
|
|
@@ -428,6 +429,7 @@ declare const __VLS_base: import("vue").DefineComponent<{
|
|
|
428
429
|
level?: number;
|
|
429
430
|
labelledby?: string;
|
|
430
431
|
manualPositioning?: boolean;
|
|
432
|
+
matchWidth?: boolean;
|
|
431
433
|
onOpenChange?: ((open: boolean) => any) | undefined;
|
|
432
434
|
}> & Readonly<{
|
|
433
435
|
onSelect?: ((item: MenuItem, event: Event) => any) | undefined;
|
|
@@ -11,6 +11,8 @@
|
|
|
11
11
|
:offset="offset"
|
|
12
12
|
:label="label"
|
|
13
13
|
:labelledby="label ? void 0 : triggerId"
|
|
14
|
+
:match-width="matchTriggerWidth"
|
|
15
|
+
:style="minWidth ? { minWidth } : void 0"
|
|
14
16
|
@open-change="isOpen = $event"
|
|
15
17
|
@select="(item, event) => emit('select', item, event)"
|
|
16
18
|
/>
|
|
@@ -27,7 +29,9 @@ const props = defineProps({
|
|
|
27
29
|
items: { type: Array, required: true },
|
|
28
30
|
placement: { type: null, required: false, default: "bottom-start" },
|
|
29
31
|
offset: { type: Number, required: false, default: 6 },
|
|
30
|
-
label: { type: String, required: false }
|
|
32
|
+
label: { type: String, required: false },
|
|
33
|
+
matchTriggerWidth: { type: Boolean, required: false },
|
|
34
|
+
minWidth: { type: String, required: false }
|
|
31
35
|
});
|
|
32
36
|
const emit = defineEmits(["select"]);
|
|
33
37
|
const open = defineModel("open", { type: Boolean, ...{ default: false } });
|
|
@@ -10,10 +10,12 @@ declare const __VLS_base: import("vue").DefineComponent<{
|
|
|
10
10
|
placement?: OverlayPlacement;
|
|
11
11
|
offset?: number;
|
|
12
12
|
label?: string;
|
|
13
|
+
matchTriggerWidth?: boolean;
|
|
14
|
+
minWidth?: string;
|
|
13
15
|
open?: boolean;
|
|
14
16
|
key?: PropertyKey | undefined;
|
|
15
17
|
prefix?: string | undefined;
|
|
16
|
-
anchor?: (() => import("
|
|
18
|
+
anchor?: (() => import("./types").OverlayAnchorTarget | null | undefined) | undefined;
|
|
17
19
|
title?: string | undefined;
|
|
18
20
|
style?: import("vue").StyleValue;
|
|
19
21
|
results?: (string | number) | undefined;
|
|
@@ -212,6 +214,7 @@ declare const __VLS_base: import("vue").DefineComponent<{
|
|
|
212
214
|
level?: number;
|
|
213
215
|
labelledby?: string;
|
|
214
216
|
manualPositioning?: boolean;
|
|
217
|
+
matchWidth?: boolean;
|
|
215
218
|
onOpenChange?: ((open: boolean) => any) | undefined;
|
|
216
219
|
}, {
|
|
217
220
|
show: () => void | undefined;
|
|
@@ -224,10 +227,12 @@ declare const __VLS_base: import("vue").DefineComponent<{
|
|
|
224
227
|
placement?: OverlayPlacement;
|
|
225
228
|
offset?: number;
|
|
226
229
|
label?: string;
|
|
230
|
+
matchTriggerWidth?: boolean;
|
|
231
|
+
minWidth?: string;
|
|
227
232
|
open?: boolean;
|
|
228
233
|
key?: PropertyKey | undefined;
|
|
229
234
|
prefix?: string | undefined;
|
|
230
|
-
anchor?: (() => import("
|
|
235
|
+
anchor?: (() => import("./types").OverlayAnchorTarget | null | undefined) | undefined;
|
|
231
236
|
title?: string | undefined;
|
|
232
237
|
style?: import("vue").StyleValue;
|
|
233
238
|
results?: (string | number) | undefined;
|
|
@@ -426,6 +431,7 @@ declare const __VLS_base: import("vue").DefineComponent<{
|
|
|
426
431
|
level?: number;
|
|
427
432
|
labelledby?: string;
|
|
428
433
|
manualPositioning?: boolean;
|
|
434
|
+
matchWidth?: boolean;
|
|
429
435
|
onOpenChange?: ((open: boolean) => any) | undefined;
|
|
430
436
|
}> & Readonly<{
|
|
431
437
|
onSelect?: ((item: MenuItem, event: Event) => any) | undefined;
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
v-model:open="open"
|
|
5
5
|
prefix="k-modal"
|
|
6
6
|
:root-class="[`k-modal-${size}`, { 'is-sheet': sheet && size !== 'fullscreen' }]"
|
|
7
|
+
:style="sizeStyle"
|
|
7
8
|
:title="title"
|
|
8
9
|
:description="description"
|
|
9
10
|
:label="label"
|
|
@@ -26,7 +27,7 @@
|
|
|
26
27
|
<script setup>
|
|
27
28
|
import { computed, useTemplateRef } from "vue";
|
|
28
29
|
import DialogFrame from "../../internal/overlays/DialogFrame.vue";
|
|
29
|
-
defineProps({
|
|
30
|
+
const props = defineProps({
|
|
30
31
|
title: { type: String, required: false },
|
|
31
32
|
description: { type: String, required: false },
|
|
32
33
|
label: { type: String, required: false },
|
|
@@ -37,8 +38,14 @@ defineProps({
|
|
|
37
38
|
sheet: { type: Boolean, required: false, default: true },
|
|
38
39
|
flush: { type: Boolean, required: false },
|
|
39
40
|
loading: { type: Boolean, required: false },
|
|
40
|
-
beforeClose: { type: Function, required: false }
|
|
41
|
+
beforeClose: { type: Function, required: false },
|
|
42
|
+
width: { type: String, required: false },
|
|
43
|
+
minHeight: { type: String, required: false }
|
|
41
44
|
});
|
|
45
|
+
const sizeStyle = computed(() => ({
|
|
46
|
+
"--k-modal-custom-width": props.width,
|
|
47
|
+
"--k-modal-min-height": props.minHeight
|
|
48
|
+
}));
|
|
42
49
|
const slots = defineSlots();
|
|
43
50
|
const slotNames = computed(() => Object.keys(slots));
|
|
44
51
|
const emit = defineEmits(["open", "close", "afterLeave"]);
|
|
@@ -13,6 +13,8 @@ declare const __VLS_base: import("vue").DefineComponent<{
|
|
|
13
13
|
flush?: boolean;
|
|
14
14
|
loading?: boolean;
|
|
15
15
|
beforeClose?: DialogBeforeClose;
|
|
16
|
+
width?: string;
|
|
17
|
+
minHeight?: string;
|
|
16
18
|
open?: boolean | undefined;
|
|
17
19
|
key?: PropertyKey | undefined;
|
|
18
20
|
prefix?: "k-modal" | "k-drawer" | undefined;
|
|
@@ -234,6 +236,8 @@ declare const __VLS_base: import("vue").DefineComponent<{
|
|
|
234
236
|
flush?: boolean;
|
|
235
237
|
loading?: boolean;
|
|
236
238
|
beforeClose?: DialogBeforeClose;
|
|
239
|
+
width?: string;
|
|
240
|
+
minHeight?: string;
|
|
237
241
|
open?: boolean | undefined;
|
|
238
242
|
key?: PropertyKey | undefined;
|
|
239
243
|
prefix?: "k-modal" | "k-drawer" | undefined;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { LinkTarget } from '../core/types';
|
|
2
2
|
import type { IconName } from '../../composables/useIcons';
|
|
3
|
-
import type { Placement, Side } from '../../internal/floating/position';
|
|
4
|
-
export type { Placement as OverlayPlacement, Side as OverlaySide };
|
|
3
|
+
import type { AnchorTarget, Placement, Side, VirtualAnchor } from '../../internal/floating/position';
|
|
4
|
+
export type { AnchorTarget as OverlayAnchorTarget, Placement as OverlayPlacement, Side as OverlaySide, VirtualAnchor as OverlayVirtualAnchor, };
|
|
5
5
|
export type ModalSize = 'sm' | 'md' | 'lg' | 'xl' | 'full' | 'fit' | 'fullscreen';
|
|
6
6
|
export type DialogCloseReason = 'escape' | 'backdrop' | 'close-button' | 'action';
|
|
7
7
|
export type DialogBeforeClose = (reason: DialogCloseReason) => boolean | Promise<boolean>;
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
:close-label="closeLabel"
|
|
11
11
|
:skip-label="skipLabel"
|
|
12
12
|
:fluid="fluid"
|
|
13
|
+
:fill="fill"
|
|
13
14
|
:topbar="hasDesktopTopbar"
|
|
14
15
|
:storage-key="storageKey || void 0"
|
|
15
16
|
:shortcut="shortcut"
|
|
@@ -193,6 +194,7 @@ const props = defineProps({
|
|
|
193
194
|
storageKey: { type: [String, Boolean], required: false, default: "k-sidebar-collapsed" },
|
|
194
195
|
shortcut: { type: [String, Boolean], required: false, default: "mod+b" },
|
|
195
196
|
fluid: { type: Boolean, required: false },
|
|
197
|
+
fill: { type: Boolean, required: false },
|
|
196
198
|
viewTransition: { type: Boolean, required: false, default: true },
|
|
197
199
|
navLabel: { type: String, required: false },
|
|
198
200
|
sidebarLabel: { type: String, required: false },
|
|
@@ -34,6 +34,7 @@ declare const __VLS_export: <T = unknown>(__VLS_props: NonNullable<Awaited<typeo
|
|
|
34
34
|
storageKey?: string | false;
|
|
35
35
|
shortcut?: string | false;
|
|
36
36
|
fluid?: boolean;
|
|
37
|
+
fill?: boolean;
|
|
37
38
|
viewTransition?: boolean;
|
|
38
39
|
navLabel?: string;
|
|
39
40
|
sidebarLabel?: string;
|
|
@@ -61,6 +62,7 @@ declare const __VLS_export: <T = unknown>(__VLS_props: NonNullable<Awaited<typeo
|
|
|
61
62
|
readonly closeLabel?: string | undefined;
|
|
62
63
|
readonly skipLabel?: string | undefined;
|
|
63
64
|
readonly fluid?: boolean | undefined;
|
|
65
|
+
readonly fill?: boolean | undefined;
|
|
64
66
|
readonly topbar?: boolean | undefined;
|
|
65
67
|
readonly storageKey?: string | false | undefined;
|
|
66
68
|
readonly shortcut?: string | false | undefined;
|
|
@@ -36,12 +36,12 @@ declare const __VLS_base: import("vue").DefineComponent<{
|
|
|
36
36
|
key?: PropertyKey | undefined;
|
|
37
37
|
loading?: boolean;
|
|
38
38
|
prefix?: "k-modal" | "k-drawer" | undefined;
|
|
39
|
+
size?: import("../overlays/types").ModalSize;
|
|
39
40
|
label?: string;
|
|
40
41
|
style?: import("vue").StyleValue;
|
|
41
42
|
results?: (string | number) | undefined;
|
|
42
43
|
placeholder?: string | undefined;
|
|
43
44
|
description?: string;
|
|
44
|
-
size?: import("../overlays/types").ModalSize;
|
|
45
45
|
dir?: string | undefined;
|
|
46
46
|
class?: import("vue").ClassValue;
|
|
47
47
|
role?: string | undefined;
|
|
@@ -145,6 +145,7 @@ declare const __VLS_base: import("vue").DefineComponent<{
|
|
|
145
145
|
color?: string | undefined;
|
|
146
146
|
id?: string | undefined;
|
|
147
147
|
lang?: string | undefined;
|
|
148
|
+
width?: string;
|
|
148
149
|
tabindex?: (string | number) | undefined;
|
|
149
150
|
'aria-activedescendant'?: string | undefined;
|
|
150
151
|
'aria-atomic'?: (boolean | "true" | "false") | undefined;
|
|
@@ -236,11 +237,12 @@ declare const __VLS_base: import("vue").DefineComponent<{
|
|
|
236
237
|
onVnodeBeforeUnmount?: (((vnode: import("vue").VNode) => void) | ((vnode: import("vue").VNode) => void)[]) | undefined;
|
|
237
238
|
onVnodeUnmounted?: (((vnode: import("vue").VNode) => void) | ((vnode: import("vue").VNode) => void)[]) | undefined;
|
|
238
239
|
flush?: boolean;
|
|
239
|
-
onCancel?: ((payload: Event) => void) | undefined;
|
|
240
240
|
sheet?: boolean;
|
|
241
|
+
onCancel?: ((payload: Event) => void) | undefined;
|
|
241
242
|
rootClass?: unknown;
|
|
242
243
|
hideClose?: boolean;
|
|
243
244
|
closedby?: import("../../index.ts").DialogClosedBy;
|
|
245
|
+
minHeight?: string;
|
|
244
246
|
}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
245
247
|
close: () => any;
|
|
246
248
|
open: () => any;
|
|
@@ -273,12 +275,12 @@ declare const __VLS_base: import("vue").DefineComponent<{
|
|
|
273
275
|
key?: PropertyKey | undefined;
|
|
274
276
|
loading?: boolean;
|
|
275
277
|
prefix?: "k-modal" | "k-drawer" | undefined;
|
|
278
|
+
size?: import("../overlays/types").ModalSize;
|
|
276
279
|
label?: string;
|
|
277
280
|
style?: import("vue").StyleValue;
|
|
278
281
|
results?: (string | number) | undefined;
|
|
279
282
|
placeholder?: string | undefined;
|
|
280
283
|
description?: string;
|
|
281
|
-
size?: import("../overlays/types").ModalSize;
|
|
282
284
|
dir?: string | undefined;
|
|
283
285
|
class?: import("vue").ClassValue;
|
|
284
286
|
role?: string | undefined;
|
|
@@ -382,6 +384,7 @@ declare const __VLS_base: import("vue").DefineComponent<{
|
|
|
382
384
|
color?: string | undefined;
|
|
383
385
|
id?: string | undefined;
|
|
384
386
|
lang?: string | undefined;
|
|
387
|
+
width?: string;
|
|
385
388
|
tabindex?: (string | number) | undefined;
|
|
386
389
|
'aria-activedescendant'?: string | undefined;
|
|
387
390
|
'aria-atomic'?: (boolean | "true" | "false") | undefined;
|
|
@@ -473,11 +476,12 @@ declare const __VLS_base: import("vue").DefineComponent<{
|
|
|
473
476
|
onVnodeBeforeUnmount?: (((vnode: import("vue").VNode) => void) | ((vnode: import("vue").VNode) => void)[]) | undefined;
|
|
474
477
|
onVnodeUnmounted?: (((vnode: import("vue").VNode) => void) | ((vnode: import("vue").VNode) => void)[]) | undefined;
|
|
475
478
|
flush?: boolean;
|
|
476
|
-
onCancel?: ((payload: Event) => void) | undefined;
|
|
477
479
|
sheet?: boolean;
|
|
480
|
+
onCancel?: ((payload: Event) => void) | undefined;
|
|
478
481
|
rootClass?: unknown;
|
|
479
482
|
hideClose?: boolean;
|
|
480
483
|
closedby?: import("../../index.ts").DialogClosedBy;
|
|
484
|
+
minHeight?: string;
|
|
481
485
|
}> & Readonly<{
|
|
482
486
|
onClose?: (() => any) | undefined;
|
|
483
487
|
onOpen?: (() => any) | undefined;
|
|
@@ -1,7 +1,12 @@
|
|
|
1
|
-
import type { ComputedRef, MaybeRefOrGetter, Ref, UnwrapRef } from 'vue';
|
|
1
|
+
import type { App, ComputedRef, MaybeRefOrGetter, Ref, UnwrapRef } from 'vue';
|
|
2
2
|
import type { IssueKeyResolver, StandardSchemaIssue, StandardSchemaV1 } from '../internal/forms/standard-schema';
|
|
3
|
+
import type { MessageParams } from '../locale/types';
|
|
3
4
|
export type { IssuePath as FormIssuePath, StandardSchemaIssue, StandardSchemaResult, StandardSchemaV1, } from '../internal/forms/standard-schema';
|
|
4
|
-
export
|
|
5
|
+
export interface FieldValidationMessage {
|
|
6
|
+
message: string;
|
|
7
|
+
params?: MessageParams;
|
|
8
|
+
}
|
|
9
|
+
export type FieldValidationResult = string | FieldValidationMessage | undefined | null | boolean;
|
|
5
10
|
export interface FieldDefinition<T = unknown> {
|
|
6
11
|
initial?: T | (() => T);
|
|
7
12
|
label?: string;
|
|
@@ -11,6 +16,7 @@ export interface FieldDefinition<T = unknown> {
|
|
|
11
16
|
minLength?: number;
|
|
12
17
|
maxLength?: number;
|
|
13
18
|
pattern?: RegExp;
|
|
19
|
+
isEmpty?: (value: T) => boolean;
|
|
14
20
|
schema?: StandardSchemaV1;
|
|
15
21
|
validate?: (value: T, values: Record<string, unknown>) => FieldValidationResult | Promise<FieldValidationResult>;
|
|
16
22
|
messages?: Partial<FormMessages>;
|
|
@@ -36,6 +42,17 @@ export interface FormMessages {
|
|
|
36
42
|
pattern: (context: FormMessageContext) => string;
|
|
37
43
|
invalid: (context: FormMessageContext) => string;
|
|
38
44
|
}
|
|
45
|
+
export interface FormTranslateContext {
|
|
46
|
+
name?: string;
|
|
47
|
+
label?: string;
|
|
48
|
+
kind: 'error' | 'warning';
|
|
49
|
+
params?: MessageParams;
|
|
50
|
+
}
|
|
51
|
+
export type FormTranslateMessage = (message: string, context: FormTranslateContext) => string;
|
|
52
|
+
export interface FormConfig {
|
|
53
|
+
messages?: Partial<FormMessages>;
|
|
54
|
+
translateMessage?: FormTranslateMessage;
|
|
55
|
+
}
|
|
39
56
|
export type FormValidationTrigger = 'submit' | 'blur' | 'input';
|
|
40
57
|
export type FormIssueKey = IssueKeyResolver;
|
|
41
58
|
export type FormMessageMap = Record<string, string | undefined>;
|
|
@@ -50,6 +67,7 @@ export interface UseFormOptions<S extends FormSchema = FormSchema, V extends obj
|
|
|
50
67
|
warnings?: FormWarnings<V>;
|
|
51
68
|
issueKey?: FormIssueKey;
|
|
52
69
|
messages?: Partial<FormMessages>;
|
|
70
|
+
translateMessage?: FormTranslateMessage;
|
|
53
71
|
validateOn?: FormValidationTrigger;
|
|
54
72
|
onSubmit?: (values: V) => unknown;
|
|
55
73
|
onInvalid?: (errors: FormErrors<S>) => unknown;
|
|
@@ -94,4 +112,8 @@ export interface UseFormReturn<S extends FormSchema = FormSchema, V extends obje
|
|
|
94
112
|
export declare function isEmptyValue(value: unknown): boolean;
|
|
95
113
|
export declare function useForm<S extends FormSchema = FormSchema, V extends object = FormValues<S>>(options: UseFormOptions<S, V>): UseFormReturn<S, V>;
|
|
96
114
|
export declare function useFormContext(): FormContext | null;
|
|
115
|
+
export declare function provideFormConfig(config: FormConfig): FormConfig;
|
|
116
|
+
export declare function createFormConfig(config: FormConfig): {
|
|
117
|
+
install(app: App): void;
|
|
118
|
+
};
|
|
97
119
|
export declare function provideForm(form: FormContext): FormContext;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
computed,
|
|
3
|
+
hasInjectionContext,
|
|
3
4
|
inject,
|
|
4
5
|
isRef,
|
|
5
6
|
provide,
|
|
@@ -18,7 +19,8 @@ import {
|
|
|
18
19
|
keyPath,
|
|
19
20
|
schemaIssues
|
|
20
21
|
} from "../internal/forms/standard-schema.mjs";
|
|
21
|
-
import { FORM_KEY } from "../internal/keys.mjs";
|
|
22
|
+
import { FORM_CONFIG_KEY, FORM_KEY } from "../internal/keys.mjs";
|
|
23
|
+
import { formatLocaleMessage } from "../locale/index.mjs";
|
|
22
24
|
import { useLocale } from "./useLocale.mjs";
|
|
23
25
|
function localeFormMessages(t) {
|
|
24
26
|
return {
|
|
@@ -31,11 +33,17 @@ function localeFormMessages(t) {
|
|
|
31
33
|
invalid: () => t("form.invalid")
|
|
32
34
|
};
|
|
33
35
|
}
|
|
36
|
+
function isPlainObject(value) {
|
|
37
|
+
if (value === null || typeof value !== "object") return false;
|
|
38
|
+
const prototype = Object.getPrototypeOf(value);
|
|
39
|
+
return prototype === Object.prototype || prototype === null;
|
|
40
|
+
}
|
|
34
41
|
export function isEmptyValue(value) {
|
|
35
42
|
if (value === null || value === void 0) return true;
|
|
36
43
|
if (typeof value === "string") return value.trim() === "";
|
|
37
44
|
if (Array.isArray(value)) return value.length === 0;
|
|
38
45
|
if (typeof value === "number") return Number.isNaN(value);
|
|
46
|
+
if (isPlainObject(value)) return Object.values(value).every(isEmptyValue);
|
|
39
47
|
return false;
|
|
40
48
|
}
|
|
41
49
|
function cloneValue(value) {
|
|
@@ -100,8 +108,24 @@ export function useForm(options) {
|
|
|
100
108
|
const schema = options.schema ?? {};
|
|
101
109
|
const schemaNames = Object.keys(schema);
|
|
102
110
|
const external = options.values !== void 0;
|
|
103
|
-
const { t } = useLocale();
|
|
104
|
-
const
|
|
111
|
+
const { t, locale } = useLocale();
|
|
112
|
+
const config = hasInjectionContext() && inject(FORM_CONFIG_KEY, null) || null;
|
|
113
|
+
const messages = computed(() => ({
|
|
114
|
+
...localeFormMessages(t),
|
|
115
|
+
...config?.messages,
|
|
116
|
+
...options.messages
|
|
117
|
+
}));
|
|
118
|
+
const translator = options.translateMessage ?? config?.translateMessage;
|
|
119
|
+
const translate = (message, context) => {
|
|
120
|
+
if (!message) return message;
|
|
121
|
+
if (translator) return translator(message, context);
|
|
122
|
+
return context.params ? formatLocaleMessage(locale.value.code, message, context.params) : message;
|
|
123
|
+
};
|
|
124
|
+
const translateIssues = (issues, kind) => issues.map((issue) => {
|
|
125
|
+
const name = issue.path.map(String).join(".") || void 0;
|
|
126
|
+
const label = name ? schema[name]?.label : void 0;
|
|
127
|
+
return { ...issue, message: translate(issue.message, { name, label, kind }) };
|
|
128
|
+
});
|
|
105
129
|
const validateOn = options.validateOn ?? "submit";
|
|
106
130
|
const issueKey = options.issueKey ?? defaultIssueKey;
|
|
107
131
|
const initialValues = () => Object.fromEntries(schemaNames.map((name) => [name, resolveInitial(schema[name])]));
|
|
@@ -153,7 +177,7 @@ export function useForm(options) {
|
|
|
153
177
|
if (!validator) return groupIssues([]);
|
|
154
178
|
return chain(
|
|
155
179
|
validator["~standard"].validate(cloneValue(target())),
|
|
156
|
-
(result) => groupIssues(schemaIssues(result.issues ?? []), issueKey)
|
|
180
|
+
(result) => groupIssues(translateIssues(schemaIssues(result.issues ?? []), "error"), issueKey)
|
|
157
181
|
);
|
|
158
182
|
}
|
|
159
183
|
async function runValidator() {
|
|
@@ -164,6 +188,12 @@ export function useForm(options) {
|
|
|
164
188
|
if (!definition) return void 0;
|
|
165
189
|
const value = readValue(name);
|
|
166
190
|
const fieldMessages = { ...messages.value, ...definition.messages };
|
|
191
|
+
const own = (message, params) => translate(message, {
|
|
192
|
+
name,
|
|
193
|
+
label: definition.label,
|
|
194
|
+
kind: "error",
|
|
195
|
+
...params ? { params } : {}
|
|
196
|
+
});
|
|
167
197
|
const context = {
|
|
168
198
|
label: definition.label,
|
|
169
199
|
value,
|
|
@@ -172,7 +202,7 @@ export function useForm(options) {
|
|
|
172
202
|
minLength: definition.minLength,
|
|
173
203
|
maxLength: definition.maxLength
|
|
174
204
|
};
|
|
175
|
-
if (isEmptyValue(value)) {
|
|
205
|
+
if (definition.isEmpty ? definition.isEmpty(value) : isEmptyValue(value)) {
|
|
176
206
|
if (definition.required) return fieldMessages.required(context);
|
|
177
207
|
} else {
|
|
178
208
|
if (typeof value === "number") {
|
|
@@ -197,12 +227,14 @@ export function useForm(options) {
|
|
|
197
227
|
if (!definition.schema) return void 0;
|
|
198
228
|
return chain(definition.schema["~standard"].validate(value), (result) => {
|
|
199
229
|
const issues = result.issues ?? [];
|
|
200
|
-
return issues.length ? issues[0].message || fieldMessages.invalid(context) : void 0;
|
|
230
|
+
return issues.length ? issues[0].message && own(issues[0].message) || fieldMessages.invalid(context) : void 0;
|
|
201
231
|
});
|
|
202
232
|
};
|
|
203
233
|
if (!definition.validate) return runSchema();
|
|
204
234
|
return chain(definition.validate(value, target()), (result) => {
|
|
205
|
-
if (typeof result === "string" && result) return result;
|
|
235
|
+
if (typeof result === "string" && result) return own(result);
|
|
236
|
+
if (result && typeof result === "object" && result.message)
|
|
237
|
+
return own(result.message, result.params);
|
|
206
238
|
if (result === false) return fieldMessages.invalid(context);
|
|
207
239
|
return runSchema();
|
|
208
240
|
});
|
|
@@ -373,7 +405,7 @@ export function useForm(options) {
|
|
|
373
405
|
let warningRun = 0;
|
|
374
406
|
const applyWarnings = (result) => {
|
|
375
407
|
const list = Array.isArray(result) ? schemaIssues(result) : Object.entries(result ?? {}).filter((entry) => Boolean(entry[1])).map(([key, message]) => ({ message, path: keyPath(key) }));
|
|
376
|
-
const grouped = groupIssues(list, issueKey);
|
|
408
|
+
const grouped = groupIssues(translateIssues(list, "warning"), issueKey);
|
|
377
409
|
replaceEntries(warnings, grouped.fields);
|
|
378
410
|
rootWarnings.value = grouped.root;
|
|
379
411
|
};
|
|
@@ -423,6 +455,17 @@ export function useForm(options) {
|
|
|
423
455
|
export function useFormContext() {
|
|
424
456
|
return inject(FORM_KEY, null);
|
|
425
457
|
}
|
|
458
|
+
export function provideFormConfig(config) {
|
|
459
|
+
provide(FORM_CONFIG_KEY, config);
|
|
460
|
+
return config;
|
|
461
|
+
}
|
|
462
|
+
export function createFormConfig(config) {
|
|
463
|
+
return {
|
|
464
|
+
install(app) {
|
|
465
|
+
app.provide(FORM_CONFIG_KEY, config);
|
|
466
|
+
}
|
|
467
|
+
};
|
|
468
|
+
}
|
|
426
469
|
export function provideForm(form) {
|
|
427
470
|
provide(FORM_KEY, form);
|
|
428
471
|
return form;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { AllowedComponentProps, Component, VNodeProps } from 'vue';
|
|
2
2
|
import type { OverlayContext, OverlayEntry, OverlayKind, OverlayOptions } from '../internal/overlays/stack';
|
|
3
|
-
export type { OverlayContext, OverlayKind, OverlayOptions };
|
|
3
|
+
export type { OverlayContext, OverlayEntry, OverlayKind, OverlayOptions };
|
|
4
4
|
export type OverlayComponentProps<C> = C extends new (...args: never[]) => {
|
|
5
5
|
$props: infer P;
|
|
6
6
|
} ? Omit<P, keyof VNodeProps | keyof AllowedComponentProps> : Record<string, unknown>;
|