@soybeanjs/headless 0.17.0 → 0.18.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.
- package/README.md +10 -5
- package/README.zh-CN.md +10 -5
- package/dist/components/_icon/types.d.ts +2 -2
- package/dist/components/accordion/types.d.ts +19 -19
- package/dist/components/affix/types.d.ts +12 -12
- package/dist/components/alert/types.d.ts +15 -15
- package/dist/components/anchor/anchor-root.vue.d.ts +1 -1
- package/dist/components/anchor/types.d.ts +19 -19
- package/dist/components/arrow/types.d.ts +1 -1
- package/dist/components/aspect-ratio/types.d.ts +1 -1
- package/dist/components/autocomplete/autocomplete-compact.vue.d.ts +2 -2
- package/dist/components/autocomplete/autocomplete-root.vue.d.ts +4 -4
- package/dist/components/autocomplete/types.d.ts +23 -23
- package/dist/components/avatar/avatar-compact.js +1 -0
- package/dist/components/avatar/avatar-compact.vue.d.ts +20 -0
- package/dist/components/avatar/avatar-fallback.js +1 -1
- package/dist/components/avatar/avatar-image.js +1 -1
- package/dist/components/avatar/avatar-root.js +1 -1
- package/dist/components/avatar/index.d.ts +6 -5
- package/dist/components/avatar/index.js +1 -1
- package/dist/components/avatar/types.d.ts +38 -7
- package/dist/components/backtop/backtop.vue.d.ts +3 -3
- package/dist/components/backtop/types.d.ts +5 -5
- package/dist/components/badge/badge-compact.js +1 -0
- package/dist/components/badge/badge-compact.vue.d.ts +21 -0
- package/dist/components/badge/badge-content.js +1 -1
- package/dist/components/badge/badge-root.js +1 -1
- package/dist/components/badge/index.d.ts +5 -4
- package/dist/components/badge/index.js +1 -1
- package/dist/components/badge/types.d.ts +26 -6
- package/dist/components/bottom-sheet/bottom-sheet-root-nested.vue.d.ts +2 -2
- package/dist/components/bottom-sheet/types.d.ts +13 -13
- package/dist/components/breadcrumb/types.d.ts +21 -21
- package/dist/components/button/button.js +1 -1
- package/dist/components/button/button.vue.d.ts +2 -2
- package/dist/components/button/types.d.ts +4 -4
- package/dist/components/calendar/types.d.ts +32 -32
- package/dist/components/card/card-root.vue.d.ts +1 -1
- package/dist/components/card/types.d.ts +20 -20
- package/dist/components/carousel/carousel-compact.js +1 -0
- package/dist/components/carousel/carousel-compact.vue.d.ts +23 -0
- package/dist/components/carousel/carousel-container.js +1 -0
- package/dist/components/carousel/carousel-container.vue.d.ts +18 -0
- package/dist/components/carousel/carousel-content.js +1 -1
- package/dist/components/carousel/carousel-control.js +1 -0
- package/dist/components/carousel/carousel-control.vue.d.ts +18 -0
- package/dist/components/carousel/carousel-item.js +1 -1
- package/dist/components/carousel/carousel-navigation.js +1 -0
- package/dist/components/carousel/carousel-navigation.vue.d.ts +18 -0
- package/dist/components/carousel/carousel-next.js +1 -1
- package/dist/components/carousel/carousel-next.vue.d.ts +2 -12
- package/dist/components/carousel/carousel-previous.js +1 -1
- package/dist/components/carousel/carousel-previous.vue.d.ts +2 -12
- package/dist/components/carousel/carousel-root.js +1 -1
- package/dist/components/carousel/carousel-root.vue.d.ts +6 -28
- package/dist/components/carousel/context.d.ts +0 -1
- package/dist/components/carousel/context.js +1 -1
- package/dist/components/carousel/hooks.js +1 -0
- package/dist/components/carousel/index.d.ts +11 -9
- package/dist/components/carousel/index.js +1 -1
- package/dist/components/carousel/types.d.ts +121 -29
- package/dist/components/checkbox/types.d.ts +27 -27
- package/dist/components/clipboard/clipboard.vue.d.ts +2 -2
- package/dist/components/clipboard/types.d.ts +5 -5
- package/dist/components/collapsible/collapsible-root.vue.d.ts +1 -1
- package/dist/components/collapsible/types.d.ts +6 -6
- package/dist/components/color-area/color-area-root.vue.d.ts +1 -1
- package/dist/components/color-area/types.d.ts +7 -7
- package/dist/components/color-field/color-field-root.vue.d.ts +1 -1
- package/dist/components/color-field/types.d.ts +5 -5
- package/dist/components/color-picker/types.d.ts +3 -3
- package/dist/components/color-slider/color-slider-root.vue.d.ts +2 -2
- package/dist/components/color-slider/types.d.ts +6 -6
- package/dist/components/color-swatch/types.d.ts +1 -1
- package/dist/components/color-swatch-picker/color-swatch-picker-root.vue.d.ts +2 -2
- package/dist/components/color-swatch-picker/types.d.ts +8 -8
- package/dist/components/combobox/combobox-compact.vue.d.ts +2 -2
- package/dist/components/combobox/combobox-content.vue.d.ts +1 -1
- package/dist/components/combobox/combobox-root.vue.d.ts +2 -2
- package/dist/components/combobox/types.d.ts +42 -42
- package/dist/components/command/command-compact.vue.d.ts +2 -2
- package/dist/components/command/types.d.ts +25 -25
- package/dist/components/config-provider/config-provider.js +12 -0
- package/dist/components/config-provider/config-provider.vue.d.ts +1 -1
- package/dist/components/config-provider/types.d.ts +1 -1
- package/dist/components/context-menu/context-menu-checkbox-compact.vue.d.ts +2 -2
- package/dist/components/context-menu/context-menu-compact.vue.d.ts +2 -2
- package/dist/components/context-menu/context-menu-content.vue.d.ts +2 -2
- package/dist/components/context-menu/context-menu-radio-compact.vue.d.ts +2 -2
- package/dist/components/context-menu/context-menu-wrapper-compact.vue.d.ts +2 -2
- package/dist/components/context-menu/types.d.ts +21 -21
- package/dist/components/date-field/date-field-root.vue.d.ts +2 -2
- package/dist/components/date-field/types.d.ts +10 -10
- package/dist/components/date-picker/date-picker-compact.vue.d.ts +2 -2
- package/dist/components/date-picker/date-picker-root.vue.d.ts +7 -7
- package/dist/components/date-picker/types.d.ts +18 -18
- package/dist/components/date-range-field/date-range-field-root.vue.d.ts +2 -2
- package/dist/components/date-range-field/types.d.ts +11 -11
- package/dist/components/date-range-picker/date-range-picker-compact.vue.d.ts +2 -2
- package/dist/components/date-range-picker/date-range-picker-root.vue.d.ts +7 -7
- package/dist/components/date-range-picker/types.d.ts +12 -12
- package/dist/components/dialog/dialog-compact.vue.d.ts +5 -5
- package/dist/components/dialog/types.d.ts +40 -40
- package/dist/components/dropdown-menu/dropdown-menu-checkbox-compact.vue.d.ts +2 -2
- package/dist/components/dropdown-menu/dropdown-menu-compact.vue.d.ts +2 -2
- package/dist/components/dropdown-menu/dropdown-menu-content.vue.d.ts +2 -2
- package/dist/components/dropdown-menu/dropdown-menu-radio-compact.vue.d.ts +2 -2
- package/dist/components/dropdown-menu/dropdown-menu-root.vue.d.ts +1 -1
- package/dist/components/dropdown-menu/dropdown-menu-wrapper-compact.vue.d.ts +2 -2
- package/dist/components/dropdown-menu/types.d.ts +21 -21
- package/dist/components/editable/types.d.ts +25 -25
- package/dist/components/empty/empty-compact.js +1 -0
- package/dist/components/empty/empty-compact.vue.d.ts +15 -0
- package/dist/components/empty/empty-content.js +1 -1
- package/dist/components/empty/empty-description.js +1 -1
- package/dist/components/empty/empty-header.js +1 -1
- package/dist/components/empty/empty-media.js +1 -1
- package/dist/components/empty/empty-root.js +1 -1
- package/dist/components/empty/empty-title.js +1 -1
- package/dist/components/empty/index.d.ts +9 -8
- package/dist/components/empty/index.js +1 -1
- package/dist/components/empty/types.d.ts +72 -9
- package/dist/components/form/context.d.ts +3 -2
- package/dist/components/form/context.js +1 -1
- package/dist/components/form/core/types.d.ts +24 -24
- package/dist/components/form/core/use-form.js +1 -1
- package/dist/components/form/form-compact.js +1 -0
- package/dist/components/form/form-compact.vue.d.ts +21 -0
- package/dist/components/form/form-control.js +1 -1
- package/dist/components/form/form-description.js +1 -1
- package/dist/components/form/form-error.js +1 -1
- package/dist/components/form/form-field-array-compact.js +1 -0
- package/dist/components/form/form-field-array-compact.vue.d.ts +16 -0
- package/dist/components/form/form-field-base-compact.js +1 -0
- package/dist/components/form/form-field-base-compact.vue.d.ts +26 -0
- package/dist/components/form/form-field-compact.js +1 -0
- package/dist/components/form/form-field-compact.vue.d.ts +16 -0
- package/dist/components/form/form-field.js +1 -1
- package/dist/components/form/form-label.js +1 -1
- package/dist/components/form/index.d.ts +14 -10
- package/dist/components/form/index.js +1 -1
- package/dist/components/form/shared.js +1 -0
- package/dist/components/form/types.d.ts +129 -10
- package/dist/components/form/use-form.d.ts +8 -0
- package/dist/components/form/use-form.js +1 -0
- package/dist/components/hover-card/hover-card-compact.vue.d.ts +1 -1
- package/dist/components/hover-card/hover-card-root.vue.d.ts +1 -1
- package/dist/components/hover-card/types.d.ts +15 -15
- package/dist/components/input/index.d.ts +6 -4
- package/dist/components/input/index.js +1 -1
- package/dist/components/input/input-clear.js +1 -0
- package/dist/components/input/input-clear.vue.d.ts +22 -0
- package/dist/components/input/input-compact.js +1 -0
- package/dist/components/input/input-compact.vue.d.ts +21 -0
- package/dist/components/input/input-control.js +1 -1
- package/dist/components/input/input-root.js +1 -1
- package/dist/components/input/types.d.ts +79 -8
- package/dist/components/input-number/input-number-root.vue.d.ts +1 -1
- package/dist/components/input-number/types.d.ts +7 -7
- package/dist/components/input-otp/input-otp-compact.vue.d.ts +4 -4
- package/dist/components/input-otp/input-otp-root.vue.d.ts +4 -4
- package/dist/components/input-otp/types.d.ts +14 -14
- package/dist/components/kbd/types.d.ts +2 -2
- package/dist/components/label/types.d.ts +1 -1
- package/dist/components/layout/layout-classic-compact.vue.d.ts +1 -1
- package/dist/components/layout/layout-compact.vue.d.ts +1 -1
- package/dist/components/layout/layout-root.vue.d.ts +1 -1
- package/dist/components/layout/types.d.ts +28 -28
- package/dist/components/link/types.d.ts +4 -4
- package/dist/components/list/types.d.ts +7 -7
- package/dist/components/listbox/listbox-root.vue.d.ts +2 -2
- package/dist/components/listbox/types.d.ts +16 -16
- package/dist/components/menu/menu-content.vue.d.ts +2 -2
- package/dist/components/menu/menu-option-compact.vue.d.ts +2 -2
- package/dist/components/menu/menu-options-compact.vue.d.ts +2 -2
- package/dist/components/menu/menu-sub-content.vue.d.ts +2 -2
- package/dist/components/menu/types.d.ts +68 -68
- package/dist/components/menubar/menubar-compact.vue.d.ts +2 -2
- package/dist/components/menubar/menubar-content.vue.d.ts +2 -2
- package/dist/components/menubar/menubar-sub-content.vue.d.ts +2 -2
- package/dist/components/menubar/types.d.ts +19 -19
- package/dist/components/month-picker/month-picker-root.vue.d.ts +5 -5
- package/dist/components/month-picker/types.d.ts +7 -7
- package/dist/components/month-range-picker/month-range-picker-root.vue.d.ts +5 -5
- package/dist/components/month-range-picker/types.d.ts +7 -7
- package/dist/components/navigation-menu/types.d.ts +31 -31
- package/dist/components/page-tabs/types.d.ts +8 -8
- package/dist/components/pagination/types.d.ts +21 -21
- package/dist/components/popover/popover-compact.vue.d.ts +1 -1
- package/dist/components/popover/types.d.ts +20 -20
- package/dist/components/popper/popper-positioner.vue.d.ts +1 -1
- package/dist/components/popper/types.d.ts +7 -7
- package/dist/components/portal/types.d.ts +1 -1
- package/dist/components/primitive/types.d.ts +2 -2
- package/dist/components/progress/types.d.ts +11 -11
- package/dist/components/radio-group/types.d.ts +16 -16
- package/dist/components/range-calendar/range-calendar-root.vue.d.ts +2 -2
- package/dist/components/range-calendar/types.d.ts +30 -30
- package/dist/components/roving-focus/roving-focus-group.vue.d.ts +1 -1
- package/dist/components/roving-focus/types.d.ts +3 -3
- package/dist/components/scroll-area/types.d.ts +10 -10
- package/dist/components/segment/types.d.ts +8 -8
- package/dist/components/select/select-content.vue.d.ts +2 -2
- package/dist/components/select/types.d.ts +51 -51
- package/dist/components/separator/types.d.ts +4 -4
- package/dist/components/skeleton/types.d.ts +1 -1
- package/dist/components/slider/slider-root.vue.d.ts +1 -1
- package/dist/components/slider/types.d.ts +10 -10
- package/dist/components/splitter/splitter-group.vue.d.ts +1 -1
- package/dist/components/splitter/splitter-panel.vue.d.ts +2 -2
- package/dist/components/splitter/types.d.ts +11 -11
- package/dist/components/stepper/types.d.ts +21 -21
- package/dist/components/switch/types.d.ts +7 -7
- package/dist/components/table/types.d.ts +67 -67
- package/dist/components/tabs/types.d.ts +17 -17
- package/dist/components/tag/types.d.ts +2 -2
- package/dist/components/tags-input/tags-input-root.vue.d.ts +2 -2
- package/dist/components/tags-input/types.d.ts +10 -10
- package/dist/components/textarea/types.d.ts +8 -8
- package/dist/components/time-field/time-field-root.vue.d.ts +1 -1
- package/dist/components/time-field/types.d.ts +7 -7
- package/dist/components/time-picker/time-picker-root.vue.d.ts +6 -6
- package/dist/components/time-picker/types.d.ts +7 -7
- package/dist/components/time-range-field/time-range-field-root.vue.d.ts +1 -1
- package/dist/components/time-range-field/types.d.ts +11 -11
- package/dist/components/time-range-picker/time-range-picker-compact.vue.d.ts +2 -2
- package/dist/components/time-range-picker/time-range-picker-root.vue.d.ts +6 -6
- package/dist/components/time-range-picker/types.d.ts +12 -12
- package/dist/components/toast/types.d.ts +25 -25
- package/dist/components/toggle/toggle.vue.d.ts +1 -1
- package/dist/components/toggle/types.d.ts +3 -3
- package/dist/components/toggle-group/types.d.ts +5 -5
- package/dist/components/toolbar/toolbar-button.vue.d.ts +2 -2
- package/dist/components/toolbar/types.d.ts +12 -12
- package/dist/components/tooltip/tooltip-root.vue.d.ts +1 -1
- package/dist/components/tooltip/types.d.ts +9 -9
- package/dist/components/tree/types.d.ts +13 -13
- package/dist/components/tree-menu/tree-menu-root.vue.d.ts +1 -1
- package/dist/components/tree-menu/types.d.ts +14 -14
- package/dist/components/virtualizer/types.d.ts +6 -6
- package/dist/components/visually-hidden/types.d.ts +3 -3
- package/dist/components/year-picker/types.d.ts +7 -7
- package/dist/components/year-picker/year-picker-root.vue.d.ts +5 -5
- package/dist/components/year-range-picker/types.d.ts +7 -7
- package/dist/components/year-range-picker/year-range-picker-root.vue.d.ts +5 -5
- package/dist/constants/components.js +1 -1
- package/dist/date/parts.d.ts +1 -1
- package/dist/index.d.ts +416 -405
- package/dist/index.js +1 -1
- package/dist/namespaced/index.d.ts +877 -851
- package/dist/namespaced/index.js +1 -1
- package/dist/types/common.d.ts +1 -1
- package/package.json +4 -2
- package/dist/components/form/core/use-form.d.ts +0 -7
- package/dist/node_modules/.pnpm/embla-carousel@8.6.0/node_modules/embla-carousel/esm/components/Alignment.d.ts +0 -4
- package/dist/node_modules/.pnpm/embla-carousel@8.6.0/node_modules/embla-carousel/esm/components/Animations.d.ts +0 -11
- package/dist/node_modules/.pnpm/embla-carousel@8.6.0/node_modules/embla-carousel/esm/components/Axis.d.ts +0 -16
- package/dist/node_modules/.pnpm/embla-carousel@8.6.0/node_modules/embla-carousel/esm/components/Counter.d.ts +0 -9
- package/dist/node_modules/.pnpm/embla-carousel@8.6.0/node_modules/embla-carousel/esm/components/DragHandler.d.ts +0 -13
- package/dist/node_modules/.pnpm/embla-carousel@8.6.0/node_modules/embla-carousel/esm/components/DragTracker.d.ts +0 -4
- package/dist/node_modules/.pnpm/embla-carousel@8.6.0/node_modules/embla-carousel/esm/components/EmblaCarousel.d.ts +0 -31
- package/dist/node_modules/.pnpm/embla-carousel@8.6.0/node_modules/embla-carousel/esm/components/Engine.d.ts +0 -67
- package/dist/node_modules/.pnpm/embla-carousel@8.6.0/node_modules/embla-carousel/esm/components/EventHandler.d.ts +0 -29
- package/dist/node_modules/.pnpm/embla-carousel@8.6.0/node_modules/embla-carousel/esm/components/EventStore.d.ts +0 -10
- package/dist/node_modules/.pnpm/embla-carousel@8.6.0/node_modules/embla-carousel/esm/components/Limit.d.ts +0 -13
- package/dist/node_modules/.pnpm/embla-carousel@8.6.0/node_modules/embla-carousel/esm/components/NodeRects.d.ts +0 -11
- package/dist/node_modules/.pnpm/embla-carousel@8.6.0/node_modules/embla-carousel/esm/components/Options.d.ts +0 -43
- package/dist/node_modules/.pnpm/embla-carousel@8.6.0/node_modules/embla-carousel/esm/components/OptionsHandler.d.ts +0 -11
- package/dist/node_modules/.pnpm/embla-carousel@8.6.0/node_modules/embla-carousel/esm/components/PercentOfView.d.ts +0 -6
- package/dist/node_modules/.pnpm/embla-carousel@8.6.0/node_modules/embla-carousel/esm/components/Plugins.d.ts +0 -20
- package/dist/node_modules/.pnpm/embla-carousel@8.6.0/node_modules/embla-carousel/esm/components/ResizeHandler.d.ts +0 -11
- package/dist/node_modules/.pnpm/embla-carousel@8.6.0/node_modules/embla-carousel/esm/components/ScrollBody.d.ts +0 -14
- package/dist/node_modules/.pnpm/embla-carousel@8.6.0/node_modules/embla-carousel/esm/components/ScrollBounds.d.ts +0 -8
- package/dist/node_modules/.pnpm/embla-carousel@8.6.0/node_modules/embla-carousel/esm/components/ScrollContain.d.ts +0 -4
- package/dist/node_modules/.pnpm/embla-carousel@8.6.0/node_modules/embla-carousel/esm/components/ScrollLooper.d.ts +0 -6
- package/dist/node_modules/.pnpm/embla-carousel@8.6.0/node_modules/embla-carousel/esm/components/ScrollProgress.d.ts +0 -6
- package/dist/node_modules/.pnpm/embla-carousel@8.6.0/node_modules/embla-carousel/esm/components/ScrollTarget.d.ts +0 -12
- package/dist/node_modules/.pnpm/embla-carousel@8.6.0/node_modules/embla-carousel/esm/components/ScrollTo.d.ts +0 -7
- package/dist/node_modules/.pnpm/embla-carousel@8.6.0/node_modules/embla-carousel/esm/components/SlideFocus.d.ts +0 -10
- package/dist/node_modules/.pnpm/embla-carousel@8.6.0/node_modules/embla-carousel/esm/components/SlideLooper.d.ts +0 -19
- package/dist/node_modules/.pnpm/embla-carousel@8.6.0/node_modules/embla-carousel/esm/components/SlideRegistry.d.ts +0 -6
- package/dist/node_modules/.pnpm/embla-carousel@8.6.0/node_modules/embla-carousel/esm/components/SlidesHandler.d.ts +0 -11
- package/dist/node_modules/.pnpm/embla-carousel@8.6.0/node_modules/embla-carousel/esm/components/SlidesInView.d.ts +0 -9
- package/dist/node_modules/.pnpm/embla-carousel@8.6.0/node_modules/embla-carousel/esm/components/SlidesToScroll.d.ts +0 -7
- package/dist/node_modules/.pnpm/embla-carousel@8.6.0/node_modules/embla-carousel/esm/components/Translate.d.ts +0 -8
- package/dist/node_modules/.pnpm/embla-carousel@8.6.0/node_modules/embla-carousel/esm/components/Vector1d.d.ts +0 -9
- package/dist/node_modules/.pnpm/embla-carousel@8.6.0/node_modules/embla-carousel/esm/components/utils.d.ts +0 -4
|
@@ -5,31 +5,31 @@ import { StandardSchemaV1 } from "@standard-schema/spec";
|
|
|
5
5
|
|
|
6
6
|
//#region src/components/form/core/types.d.ts
|
|
7
7
|
/**
|
|
8
|
-
* Type information for
|
|
8
|
+
* Type information for InferStandardSchemaInput.
|
|
9
9
|
*/
|
|
10
10
|
type InferStandardSchemaInput<S extends StandardSchemaV1<FormValues, FormValues>> = NonNullable<S['~standard']['types']>['input'];
|
|
11
11
|
/**
|
|
12
|
-
* Type information for
|
|
12
|
+
* Type information for InferStandardSchemaOutput.
|
|
13
13
|
*/
|
|
14
14
|
type InferStandardSchemaOutput<S extends StandardSchemaV1<FormValues, FormValues>> = NonNullable<S['~standard']['types']>['output'];
|
|
15
15
|
/**
|
|
16
|
-
* Type information for
|
|
16
|
+
* Type information for FormValidateMode.
|
|
17
17
|
*/
|
|
18
18
|
type FormValidateMode = 'blur' | 'input' | 'change' | 'submit';
|
|
19
19
|
/**
|
|
20
|
-
* Type information for
|
|
20
|
+
* Type information for FormValues.
|
|
21
21
|
*/
|
|
22
22
|
type FormValues = Record<string, any>;
|
|
23
23
|
/**
|
|
24
|
-
* Type information for
|
|
24
|
+
* Type information for FormErrors.
|
|
25
25
|
*/
|
|
26
26
|
type FormErrors<Values extends FormValues> = { [K in keyof Path<Values>]?: string };
|
|
27
27
|
/**
|
|
28
|
-
* Type information for
|
|
28
|
+
* Type information for FormTouched.
|
|
29
29
|
*/
|
|
30
30
|
type FormTouched<Values extends FormValues> = { [K in keyof Path<Values>]?: boolean };
|
|
31
31
|
/**
|
|
32
|
-
* Type information for
|
|
32
|
+
* Type information for FormFieldMeta.
|
|
33
33
|
*/
|
|
34
34
|
type FormFieldMeta = {
|
|
35
35
|
/**
|
|
@@ -46,7 +46,7 @@ type FormFieldMeta = {
|
|
|
46
46
|
touched: boolean | undefined;
|
|
47
47
|
};
|
|
48
48
|
/**
|
|
49
|
-
* Type information for
|
|
49
|
+
* Type information for FormSubmitHelper.
|
|
50
50
|
*/
|
|
51
51
|
interface FormSubmitHelper<Values extends FormValues> {
|
|
52
52
|
/**
|
|
@@ -59,7 +59,7 @@ interface FormSubmitHelper<Values extends FormValues> {
|
|
|
59
59
|
readonly initialValues: Values;
|
|
60
60
|
}
|
|
61
61
|
/**
|
|
62
|
-
* State values for
|
|
62
|
+
* State values for FormResetState.
|
|
63
63
|
*/
|
|
64
64
|
interface FormResetState<Values extends FormValues = FormValues> {
|
|
65
65
|
/**
|
|
@@ -80,7 +80,7 @@ interface FormResetState<Values extends FormValues = FormValues> {
|
|
|
80
80
|
submitCount: number;
|
|
81
81
|
}
|
|
82
82
|
/**
|
|
83
|
-
* Type information for
|
|
83
|
+
* Type information for FormMessage.
|
|
84
84
|
*/
|
|
85
85
|
type FormMessage<Values extends FormValues = FormValues, Name extends Path<Values> = Path<Values>> =
|
|
86
86
|
/**
|
|
@@ -234,7 +234,7 @@ type FormMessage<Values extends FormValues = FormValues, Name extends Path<Value
|
|
|
234
234
|
payload: FormResetState<Values>;
|
|
235
235
|
};
|
|
236
236
|
/**
|
|
237
|
-
* State values for
|
|
237
|
+
* State values for FormState.
|
|
238
238
|
*/
|
|
239
239
|
interface FormState<Values extends FormValues> {
|
|
240
240
|
/**
|
|
@@ -263,9 +263,9 @@ interface FormState<Values extends FormValues> {
|
|
|
263
263
|
isValidating: ShallowRef<boolean>;
|
|
264
264
|
}
|
|
265
265
|
/**
|
|
266
|
-
* Type information for
|
|
266
|
+
* Type information for UseHeadlessFormOptions.
|
|
267
267
|
*/
|
|
268
|
-
interface
|
|
268
|
+
interface UseHeadlessFormOptions<S extends StandardSchemaV1<FormValues, FormValues>> {
|
|
269
269
|
/**
|
|
270
270
|
* Schema.
|
|
271
271
|
*/
|
|
@@ -304,11 +304,11 @@ interface UseFormOptions<S extends StandardSchemaV1<FormValues, FormValues>> {
|
|
|
304
304
|
onInvalid?: (errors: FormErrors<InferStandardSchemaOutput<S>>) => void;
|
|
305
305
|
}
|
|
306
306
|
/**
|
|
307
|
-
* Type information for
|
|
307
|
+
* Type information for FormFieldValidator.
|
|
308
308
|
*/
|
|
309
309
|
type FormFieldValidator<Value> = (value: Value) => MaybePromise<string | undefined>;
|
|
310
310
|
/**
|
|
311
|
-
* Type information for
|
|
311
|
+
* Type information for FormRegisterOptions.
|
|
312
312
|
*/
|
|
313
313
|
interface FormRegisterOptions<Value> {
|
|
314
314
|
/**
|
|
@@ -321,7 +321,7 @@ interface FormRegisterOptions<Value> {
|
|
|
321
321
|
reset?: () => void;
|
|
322
322
|
}
|
|
323
323
|
/**
|
|
324
|
-
* Type information for
|
|
324
|
+
* Type information for FormEventHandler.
|
|
325
325
|
*/
|
|
326
326
|
interface FormEventHandler<S = string> {
|
|
327
327
|
/**
|
|
@@ -338,7 +338,7 @@ interface FormEventHandler<S = string> {
|
|
|
338
338
|
onInput: () => void;
|
|
339
339
|
}
|
|
340
340
|
/**
|
|
341
|
-
* State values for
|
|
341
|
+
* State values for FormFieldState.
|
|
342
342
|
*/
|
|
343
343
|
interface FormFieldState<Values extends FormValues, Name extends Path<Values>> extends FormEventHandler<Name> {
|
|
344
344
|
/**
|
|
@@ -355,7 +355,7 @@ interface FormFieldState<Values extends FormValues, Name extends Path<Values>> e
|
|
|
355
355
|
meta: FormFieldMeta;
|
|
356
356
|
}
|
|
357
357
|
/**
|
|
358
|
-
* State values for
|
|
358
|
+
* State values for FormFieldArrayState.
|
|
359
359
|
*/
|
|
360
360
|
interface FormFieldArrayState<Values extends FormValues, Name extends Path<Values>> extends FormEventHandler<Name> {
|
|
361
361
|
/**
|
|
@@ -372,7 +372,7 @@ interface FormFieldArrayState<Values extends FormValues, Name extends Path<Value
|
|
|
372
372
|
meta: FormFieldMeta;
|
|
373
373
|
}
|
|
374
374
|
/**
|
|
375
|
-
* Type information for
|
|
375
|
+
* Type information for UseFormStateReturn.
|
|
376
376
|
*/
|
|
377
377
|
interface UseFormStateReturn<Values extends FormValues> {
|
|
378
378
|
/**
|
|
@@ -464,9 +464,9 @@ interface UseFormStateReturn<Values extends FormValues> {
|
|
|
464
464
|
resetForm(nextState?: FormResetState<Values>): void;
|
|
465
465
|
}
|
|
466
466
|
/**
|
|
467
|
-
* Context for
|
|
467
|
+
* Context for UseHeadlessFormReturn.
|
|
468
468
|
*/
|
|
469
|
-
interface
|
|
469
|
+
interface UseHeadlessFormReturn<Values extends FormValues> extends Omit<UseFormStateReturn<Values>, 'formState' | 'submitHelper'>, FormState<Values> {
|
|
470
470
|
/**
|
|
471
471
|
* Handle submit used by the component context.
|
|
472
472
|
*/
|
|
@@ -485,11 +485,11 @@ interface FormContext<Values extends FormValues> extends Omit<UseFormStateReturn
|
|
|
485
485
|
useField<Name extends Path<Values>>(name: Name, opts?: FormRegisterOptions<PathValue<Values, Name>>): Ref<FormFieldState<Values, Name>>;
|
|
486
486
|
}
|
|
487
487
|
/**
|
|
488
|
-
* Type information for
|
|
488
|
+
* Type information for UseRegisterFieldArrayOptions.
|
|
489
489
|
*/
|
|
490
490
|
interface UseRegisterFieldArrayOptions<Values extends FormValues> extends Pick<UseFormStateReturn<Values>, 'getFieldState' | 'getFieldValue' | 'setFieldValue' | 'setFieldArrayValue' | 'registerFieldArray'> {}
|
|
491
491
|
/**
|
|
492
|
-
* Type information for
|
|
492
|
+
* Type information for FormFieldArrayStates.
|
|
493
493
|
*/
|
|
494
494
|
interface FormFieldArrayStates<Values extends FormValues, Name extends Path<Values>> {
|
|
495
495
|
/**
|
|
@@ -538,4 +538,4 @@ interface FormFieldArrayStates<Values extends FormValues, Name extends Path<Valu
|
|
|
538
538
|
replace: ($values: ArrayElement<NonNullable<PathValue<Values, Name>>>[]) => void;
|
|
539
539
|
}
|
|
540
540
|
//#endregion
|
|
541
|
-
export {
|
|
541
|
+
export { FormErrors, FormEventHandler, FormFieldArrayState, FormFieldArrayStates, FormFieldMeta, FormFieldState, FormFieldValidator, FormMessage, FormRegisterOptions, FormResetState, FormState, FormSubmitHelper, FormTouched, FormValidateMode, FormValues, InferStandardSchemaInput, UseFormStateReturn, UseHeadlessFormOptions, UseHeadlessFormReturn, UseRegisterFieldArrayOptions };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{isNullish as e,keysOf as t}from"../../../shared/guard.js";import"../../../shared/index.js";import{updateFormState as n}from"./shared.js";import{useFormState as r}from"./use-form-state.js";import{useRegisterFieldArray as i}from"./use-field-array.js";import{klona as a}from"klona/full";function o(o){let{onSubmit:s=()=>Promise.resolve(),onInvalid:c}=o,{formState:l,submitHelper:u,...d}=r(o),{resetForm:f,validateForm:p,registerField:m}=d;function h(e,t){let{getFieldState:n,getFieldValue:r,setFieldValue:a,setFieldArrayValue:o,registerFieldArray:s}=d;return i(e,{getFieldState:n,getFieldValue:r,setFieldValue:a,setFieldArrayValue:o,registerFieldArray:s},t?.validate)}function g(r){r?.preventDefault(),n(l,{type:`SubmitAttempt`}),p().then(r=>{if(t(r).length===0){let t=s(a(l.values),u);if(e(t))return;t.then(e=>(n(l,{type:`SubmitSuccess`}),e)).catch(()=>{n(l,{type:`SubmitFailure`})})}else n(l,{type:`SubmitFailure`}),c?.(r)})}function _(e){e?.preventDefault(),f()}return{...l,handleSubmit:g,handleReset:_,useField:m,useFieldArray:h,...d}}export{o as
|
|
1
|
+
import{isNullish as e,keysOf as t}from"../../../shared/guard.js";import"../../../shared/index.js";import{updateFormState as n}from"./shared.js";import{useFormState as r}from"./use-form-state.js";import{useRegisterFieldArray as i}from"./use-field-array.js";import{klona as a}from"klona/full";function o(o){let{onSubmit:s=()=>Promise.resolve(),onInvalid:c}=o,{formState:l,submitHelper:u,...d}=r(o),{resetForm:f,validateForm:p,registerField:m}=d;function h(e,t){let{getFieldState:n,getFieldValue:r,setFieldValue:a,setFieldArrayValue:o,registerFieldArray:s}=d;return i(e,{getFieldState:n,getFieldValue:r,setFieldValue:a,setFieldArrayValue:o,registerFieldArray:s},t?.validate)}function g(r){r?.preventDefault(),n(l,{type:`SubmitAttempt`}),p().then(r=>{if(t(r).length===0){let t=s(a(l.values),u);if(e(t))return;t.then(e=>(n(l,{type:`SubmitSuccess`}),e)).catch(()=>{n(l,{type:`SubmitFailure`})})}else n(l,{type:`SubmitFailure`}),c?.(r)})}function _(e){e?.preventDefault(),f()}return{...l,handleSubmit:g,handleReset:_,useField:m,useFieldArray:h,...d}}export{o as useHeadlessForm};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{transformPropsToContext as e}from"../../shared/vue.js";import"../../shared/index.js";import{provideFormCompactContext as t,useFormUi as n}from"./context.js";import{provideFormSub as r}from"./use-form.js";import{createElementBlock as i,defineComponent as a,normalizeClass as o,openBlock as s,renderSlot as c,unref as l}from"vue";const u=[`data-orientation`],d=a({name:`SFormCompact`,__name:`form-compact`,props:{fieldProps:{},fieldArrayProps:{},orientation:{default:`vertical`},labelProps:{},controlProps:{},descriptionProps:{},errorProps:{}},setup(a){let d=a,f=n(`form`);return t({...e(d,[`orientation`,`fieldProps`,`fieldArrayProps`,`labelProps`,`controlProps`,`descriptionProps`,`errorProps`])}),r(),(e,t)=>(s(),i(`form`,{class:o(l(f)),"data-orientation":a.orientation},[c(e.$slots,`default`)],10,u))}});export{d as default};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { DataOrientation } from "../../types/common.js";
|
|
2
|
+
import { FormCompactProps } from "./types.js";
|
|
3
|
+
import * as _$vue from "vue";
|
|
4
|
+
|
|
5
|
+
//#region src/components/form/form-compact.vue.d.ts
|
|
6
|
+
declare var __VLS_1: {};
|
|
7
|
+
type __VLS_Slots = {} & {
|
|
8
|
+
default?: (props: typeof __VLS_1) => any;
|
|
9
|
+
};
|
|
10
|
+
declare const __VLS_base: _$vue.DefineComponent<FormCompactProps, {}, {}, {}, {}, _$vue.ComponentOptionsMixin, _$vue.ComponentOptionsMixin, {}, string, _$vue.PublicProps, Readonly<FormCompactProps> & Readonly<{}>, {
|
|
11
|
+
orientation: DataOrientation;
|
|
12
|
+
}, {}, {}, {}, string, _$vue.ComponentProvideOptions, false, {}, any>;
|
|
13
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
14
|
+
declare const _default: typeof __VLS_export;
|
|
15
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
16
|
+
new (): {
|
|
17
|
+
$slots: S;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
//#endregion
|
|
21
|
+
export { _default };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useFormFieldUi as e}from"./context.js";import{createElementBlock as
|
|
1
|
+
import{useFormFieldUi as e,useFormUi as t}from"./context.js";import{mergeClasses as n}from"./shared.js";import{computed as r,createElementBlock as i,defineComponent as a,normalizeClass as o,openBlock as s,renderSlot as c}from"vue";const l=a({name:`FormControl`,__name:`form-control`,setup(a){let l=t(`control`),u=e(`control`),d=r(()=>n(l.value,u.value));return(e,t)=>(s(),i(`div`,{class:o(d.value)},[c(e.$slots,`default`)],2))}});export{l as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useFormFieldContext as e,useFormFieldUi as t}from"./context.js";import{createElementBlock as
|
|
1
|
+
import{useFormFieldContext as e,useFormFieldUi as t,useFormUi as n}from"./context.js";import{mergeClasses as r}from"./shared.js";import{computed as i,createElementBlock as a,defineComponent as o,normalizeClass as s,openBlock as c,renderSlot as l,unref as u}from"vue";const d=[`id`],f=o({name:`FormDescription`,__name:`form-description`,setup(o){let{formDescriptionId:f}=e(`FormDescription`),p=n(`description`),m=t(`description`),h=i(()=>r(p.value,m.value));return(e,t)=>(c(),a(`p`,{id:u(f),class:s(h.value)},[l(e.$slots,`default`)],10,d))}});export{f as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useFormFieldContext as e,useFormFieldUi as t}from"./context.js";import{createElementBlock as
|
|
1
|
+
import{useFormFieldContext as e,useFormFieldUi as t,useFormUi as n}from"./context.js";import{mergeClasses as r}from"./shared.js";import{computed as i,createElementBlock as a,defineComponent as o,normalizeClass as s,openBlock as c,renderSlot as l,unref as u}from"vue";const d=[`id`],f=o({name:`FormError`,__name:`form-error`,setup(o){let{formErrorId:f}=e(`FormError`),p=n(`error`),m=t(`error`),h=i(()=>r(p.value,m.value));return(e,t)=>(c(),a(`p`,{id:u(f),class:s(h.value)},[l(e.$slots,`default`)],10,d))}});export{f as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{e}from"../../node_modules/.pnpm/@soybeanjs_utils@0.1.1/node_modules/@soybeanjs/utils/dist/index.js";import{useFormSub as t}from"./use-form.js";import n from"./form-field-base-compact.js";import{computed as r,createBlock as i,createSlots as a,defineComponent as o,guardReactiveProps as s,mergeProps as c,normalizeProps as l,openBlock as u,renderList as d,renderSlot as f,unref as p,useSlots as m,withCtx as h}from"vue";const g=o({name:`FormFieldArrayCompact`,__name:`form-field-array-compact`,props:{name:{},orientation:{},label:{},description:{},labelProps:{},controlProps:{},descriptionProps:{},errorProps:{},validate:{type:Function},reset:{type:Function}},setup(o){let g=o,_=m(),{useFieldArray:v}=t(),y=v(g.name,{validate:g.validate,reset:g.reset}),b=r(()=>e(_)),x=r(()=>y.value.meta.error);return(e,t)=>(u(),i(n,c(g,{error:x.value,"is-field-array":!0}),a({_:2},[d(b.value,t=>({name:t,fn:h(()=>[f(e.$slots,t,l(s(p(y))))])}))]),1040,[`error`]))}});export{g as default};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { FormFieldArrayCompactSlots, FormFieldCompactProps } from "./types.js";
|
|
2
|
+
import * as _$vue from "vue";
|
|
3
|
+
|
|
4
|
+
//#region src/components/form/form-field-array-compact.vue.d.ts
|
|
5
|
+
type __VLS_Props = FormFieldCompactProps<any, any>;
|
|
6
|
+
type __VLS_Slots = FormFieldArrayCompactSlots<any, any>;
|
|
7
|
+
declare const __VLS_base: _$vue.DefineComponent<__VLS_Props, {}, {}, {}, {}, _$vue.ComponentOptionsMixin, _$vue.ComponentOptionsMixin, {}, string, _$vue.PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, _$vue.ComponentProvideOptions, false, {}, any>;
|
|
8
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
9
|
+
declare const _default: typeof __VLS_export;
|
|
10
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
11
|
+
new (): {
|
|
12
|
+
$slots: S;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
//#endregion
|
|
16
|
+
export { _default };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{useOmitProps as e}from"../../composables/use-props.js";import"../../composables/index.js";import{useFormCompactContext as t}from"./context.js";import n from"./form-field.js";import r from"./form-label.js";import i from"./form-control.js";import a from"./form-description.js";import o from"./form-error.js";import{computed as s,createBlock as c,createCommentVNode as l,createTextVNode as u,defineComponent as d,guardReactiveProps as f,mergeProps as p,normalizeProps as m,openBlock as h,renderSlot as g,toDisplayString as _,unref as v,useSlots as y,withCtx as b,withDirectives as x}from"vue";import{vAutoAnimate as S}from"@formkit/auto-animate/vue";const C=d({name:`FormFieldBaseCompact`,__name:`form-field-base-compact`,props:{error:{},isFieldArray:{type:Boolean},orientation:{},label:{},description:{},labelProps:{},controlProps:{},descriptionProps:{},errorProps:{}},setup(d){let C=d,w=y(),T=e(C,[`orientation`,`label`,`description`,`error`,`labelProps`,`controlProps`,`descriptionProps`,`errorProps`]),E=t(`FormFieldCompact`),D=s(()=>C.orientation??E.orientation.value??`vertical`),O=s(()=>p({...C.isFieldArray?E.fieldArrayProps.value:E.fieldProps.value},T.value)),k=s(()=>p({...E.labelProps.value},{...C.labelProps})),A=s(()=>p({...E.controlProps.value},{...C.controlProps})),j=s(()=>p({...E.descriptionProps.value},{...C.descriptionProps})),M=s(()=>p({...E.errorProps.value},{...C.errorProps}));return(e,t)=>(h(),c(n,p(O.value,{"data-orientation":D.value,"data-error":d.error?``:void 0}),{default:b(t=>[v(w).label||d.label?(h(),c(r,m(p({key:0},k.value)),{default:b(()=>[g(e.$slots,`label`,{},()=>[u(_(d.label),1)])]),_:3},16)):l(`v-if`,!0),x((h(),c(i,m(f(A.value)),{default:b(()=>[g(e.$slots,`default`,m(f(t))),d.error?(h(),c(o,m(p({key:0},M.value)),{default:b(()=>[u(_(d.error),1)]),_:1},16)):l(`v-if`,!0)]),_:2},1040)),[[v(S)]]),v(w).description||d.description?(h(),c(a,m(p({key:1},j.value)),{default:b(()=>[g(e.$slots,`description`,{},()=>[u(_(d.description),1)])]),_:3},16)):l(`v-if`,!0)]),_:3},16,[`data-orientation`,`data-error`]))}});export{C as default};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { FormFieldBaseCompactProps } from "./types.js";
|
|
2
|
+
import * as _$vue from "vue";
|
|
3
|
+
|
|
4
|
+
//#region src/components/form/form-field-base-compact.vue.d.ts
|
|
5
|
+
declare var __VLS_14: {}, __VLS_22: {
|
|
6
|
+
formFieldId: string;
|
|
7
|
+
ariaDescribedBy: string;
|
|
8
|
+
ariaInvalid: boolean;
|
|
9
|
+
}, __VLS_36: {};
|
|
10
|
+
type __VLS_Slots = {} & {
|
|
11
|
+
label?: (props: typeof __VLS_14) => any;
|
|
12
|
+
} & {
|
|
13
|
+
default?: (props: typeof __VLS_22) => any;
|
|
14
|
+
} & {
|
|
15
|
+
description?: (props: typeof __VLS_36) => any;
|
|
16
|
+
};
|
|
17
|
+
declare const __VLS_base: _$vue.DefineComponent<FormFieldBaseCompactProps, {}, {}, {}, {}, _$vue.ComponentOptionsMixin, _$vue.ComponentOptionsMixin, {}, string, _$vue.PublicProps, Readonly<FormFieldBaseCompactProps> & Readonly<{}>, {}, {}, {}, {}, string, _$vue.ComponentProvideOptions, false, {}, any>;
|
|
18
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
19
|
+
declare const _default: typeof __VLS_export;
|
|
20
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
21
|
+
new (): {
|
|
22
|
+
$slots: S;
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
//#endregion
|
|
26
|
+
export { _default };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Slot as e}from"../slot/slot.js";import"../slot/index.js";import{useFormSub as t}from"./use-form.js";import n from"./form-field-base-compact.js";import{computed as r,createBlock as i,createSlots as a,createVNode as o,defineComponent as s,guardReactiveProps as c,mergeProps as l,normalizeProps as u,openBlock as d,renderSlot as f,unref as p,useSlots as m,withCtx as h}from"vue";const g=s({name:`FormFieldCompact`,__name:`form-field-compact`,props:{name:{},orientation:{},label:{},description:{},labelProps:{},controlProps:{},descriptionProps:{},errorProps:{},validate:{type:Function},reset:{type:Function}},setup(s){let g=s,_=m(),{useField:v,setFieldValue:y}=t(),b=v(g.name,{validate:g.validate,reset:g.reset}),x=r(()=>b.value.meta.error);function S(e){y(g.name,e)}return(t,r)=>(d(),i(n,l(g,{error:x.value}),a({default:h(n=>[o(p(e),{id:n.formFieldId,"aria-describedby":n.ariaDescribedBy,"aria-invalid":n.ariaInvalid,name:s.name,"model-value":p(b).value,"onUpdate:modelValue":S,onBlur:r[0]||(r[0]=e=>p(b).onBlur(e,g.name)),onChange:p(b).onChange,onInput:p(b).onInput},{default:h(()=>[f(t.$slots,`default`,u(c(p(b))))]),_:3},8,[`id`,`aria-describedby`,`aria-invalid`,`name`,`model-value`,`onChange`,`onInput`])]),_:2},[_.label||s.label?{name:`label`,fn:h(()=>[f(t.$slots,`label`,u(c(p(b))))]),key:`0`}:void 0,_.description||s.description?{name:`description`,fn:h(()=>[f(t.$slots,`description`,u(c(p(b))))]),key:`1`}:void 0]),1040,[`error`]))}});export{g as default};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { FormFieldCompactProps, FormFieldCompactSlots } from "./types.js";
|
|
2
|
+
import * as _$vue from "vue";
|
|
3
|
+
|
|
4
|
+
//#region src/components/form/form-field-compact.vue.d.ts
|
|
5
|
+
type __VLS_Props = FormFieldCompactProps<any, any>;
|
|
6
|
+
type __VLS_Slots = FormFieldCompactSlots<any, any>;
|
|
7
|
+
declare const __VLS_base: _$vue.DefineComponent<__VLS_Props, {}, {}, {}, {}, _$vue.ComponentOptionsMixin, _$vue.ComponentOptionsMixin, {}, string, _$vue.PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, _$vue.ComponentProvideOptions, false, {}, any>;
|
|
8
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
9
|
+
declare const _default: typeof __VLS_export;
|
|
10
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
11
|
+
new (): {
|
|
12
|
+
$slots: S;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
//#endregion
|
|
16
|
+
export { _default };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{provideFormFieldContext as e,useFormFieldUi as t}from"./context.js";import{computed as
|
|
1
|
+
import{provideFormFieldContext as e,useFormFieldUi as t,useFormUi as n}from"./context.js";import{mergeClasses as r}from"./shared.js";import{computed as i,createElementBlock as a,defineComponent as o,normalizeClass as s,openBlock as c,renderSlot as l,unref as u}from"vue";const d=[`id`,`data-field-type`],f=o({name:`FormField`,__name:`form-field`,props:{error:{},isFieldArray:{type:Boolean}},setup(o){let f=o,p=f.isFieldArray?`fieldArray`:`field`,m=n(p),h=t(p),g=i(()=>r(m.value,h.value)),{formFieldId:_,ariaDescribedBy:v,ariaInvalid:y}=e({error:i(()=>f.error)});return(e,t)=>(c(),a(`div`,{id:o.isFieldArray?u(_):void 0,class:s(g.value),"data-field-type":o.isFieldArray?`array`:`field`},[l(e.$slots,`default`,{formFieldId:u(_),ariaDescribedBy:u(v),ariaInvalid:u(y)})],10,d))}});export{f as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"../label/label.js";import"../label/index.js";import{useFormFieldContext as t,useFormFieldUi as n}from"./context.js";import{createBlock as
|
|
1
|
+
import e from"../label/label.js";import"../label/index.js";import{useFormFieldContext as t,useFormFieldUi as n,useFormUi as r}from"./context.js";import{mergeClasses as i}from"./shared.js";import{computed as a,createBlock as o,defineComponent as s,normalizeClass as c,openBlock as l,renderSlot as u,unref as d,withCtx as f}from"vue";const p=s({name:`FormLabel`,__name:`form-label`,props:{for:{}},setup(s){let{formFieldId:p}=t(`FormLabel`),m=r(`label`),h=n(`label`),g=a(()=>i(m.value,h.value));return(t,n)=>(l(),o(d(e),{for:d(p),class:c(g.value)},{default:f(()=>[u(t.$slots,`default`)]),_:3},8,[`for`,`class`]))}});export{p as default};
|
|
@@ -1,11 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { _default
|
|
4
|
-
import { _default } from "./form-
|
|
5
|
-
import { _default as _default$
|
|
6
|
-
import { _default as _default$
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
1
|
+
import { FormErrors, FormEventHandler, FormFieldArrayState, FormFieldArrayStates, FormFieldMeta, FormFieldState, FormFieldValidator, FormMessage, FormRegisterOptions, FormResetState, FormState, FormSubmitHelper, FormTouched, FormValidateMode, FormValues, InferStandardSchemaInput, UseFormStateReturn, UseHeadlessFormOptions, UseHeadlessFormReturn, UseRegisterFieldArrayOptions } from "./core/types.js";
|
|
2
|
+
import { FormCompactProps, FormControlProps, FormDescriptionProps, FormErrorProps, FormFieldArrayCompactSlots, FormFieldArrayComponent, FormFieldBaseCompactProps, FormFieldBaseCompactSlots, FormFieldCompactProps, FormFieldCompactSlots, FormFieldComponent, FormFieldProps, FormFieldUi, FormFieldUiSlot, FormLabelProps, FormUi, FormUiSlot, UseFormReturn } from "./types.js";
|
|
3
|
+
import { _default } from "./form-compact.vue.js";
|
|
4
|
+
import { _default as _default$7 } from "./form-field-compact.vue.js";
|
|
5
|
+
import { _default as _default$5 } from "./form-field-array-compact.vue.js";
|
|
6
|
+
import { _default as _default$6 } from "./form-field-base-compact.vue.js";
|
|
7
|
+
import { _default as _default$4 } from "./form-field.vue.js";
|
|
8
|
+
import { _default as _default$8 } from "./form-label.vue.js";
|
|
9
|
+
import { _default as _default$1 } from "./form-control.vue.js";
|
|
10
|
+
import { _default as _default$2 } from "./form-description.vue.js";
|
|
11
|
+
import { _default as _default$3 } from "./form-error.vue.js";
|
|
12
|
+
import { provideFormFieldUi, provideFormUi } from "./context.js";
|
|
13
|
+
import { useForm } from "./use-form.js";
|
|
10
14
|
import { StandardSchemaV1 } from "@standard-schema/spec";
|
|
11
|
-
export { type
|
|
15
|
+
export { _default as FormCompact, type FormCompactProps, _default$1 as FormControl, type FormControlProps, _default$2 as FormDescription, type FormDescriptionProps, _default$3 as FormError, type FormErrorProps, type FormErrors, type FormEventHandler, _default$4 as FormField, _default$5 as FormFieldArrayCompact, type FormFieldArrayCompactSlots, type FormFieldArrayComponent, type FormFieldArrayState, type FormFieldArrayStates, _default$6 as FormFieldBaseCompact, type FormFieldBaseCompactProps, type FormFieldBaseCompactSlots, _default$7 as FormFieldCompact, type FormFieldCompactProps, type FormFieldCompactSlots, type FormFieldComponent, type FormFieldMeta, type FormFieldProps, type FormFieldState, type FormFieldUi, type FormFieldUiSlot, type FormFieldValidator, _default$8 as FormLabel, type FormLabelProps, type FormMessage, type FormRegisterOptions, type FormResetState, type FormState, type FormSubmitHelper, type FormTouched, type FormUi, type FormUiSlot, type FormValidateMode, type FormValues, type InferStandardSchemaInput, type StandardSchemaV1, type UseFormReturn, type UseFormStateReturn, type UseHeadlessFormOptions, type UseHeadlessFormReturn, type UseRegisterFieldArrayOptions, provideFormFieldUi, provideFormUi, useForm };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{provideFormFieldUi as e}from"./context.js";import
|
|
1
|
+
import{provideFormFieldUi as e,provideFormUi as t}from"./context.js";import{useForm as n}from"./use-form.js";import r from"./form-compact.js";import i from"./form-field.js";import a from"./form-label.js";import o from"./form-control.js";import s from"./form-description.js";import c from"./form-error.js";import l from"./form-field-base-compact.js";import u from"./form-field-compact.js";import d from"./form-field-array-compact.js";export{r as FormCompact,o as FormControl,s as FormDescription,c as FormError,i as FormField,d as FormFieldArrayCompact,l as FormFieldBaseCompact,u as FormFieldCompact,a as FormLabel,e as provideFormFieldUi,t as provideFormUi,n as useForm};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function e(...e){let t=e.filter(Boolean),n=[],r=[];return t.forEach(e=>{typeof e==`string`?n.push(e):r.push(e)}),[...new Set(n.join(` `).split(/\s+/g).filter(Boolean)),...r].join(` `)}export{e as mergeClasses};
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
import { UiClass } from "../../types/common.js";
|
|
1
|
+
import { DataOrientation, UiClass } from "../../types/common.js";
|
|
2
|
+
import { Path, PathValue } from "../../types/path.js";
|
|
2
3
|
import { LabelProps } from "../label/types.js";
|
|
3
|
-
import {
|
|
4
|
+
import { FormFieldArrayStates, FormFieldState, FormRegisterOptions, FormValues, UseHeadlessFormReturn } from "./core/types.js";
|
|
5
|
+
import { ComponentOptionsMixin, ComputedRef, CreateComponentPublicInstanceWithMixins, EmitsOptions, FormHTMLAttributes, HTMLAttributes, PublicProps, SlotsType } from "vue";
|
|
4
6
|
|
|
5
7
|
//#region src/components/form/types.d.ts
|
|
6
8
|
/**
|
|
7
|
-
*
|
|
9
|
+
* Properties for the FormField component.
|
|
8
10
|
*/
|
|
9
11
|
interface FormFieldProps extends /** @vue-ignore */HTMLAttributes {
|
|
10
12
|
/**
|
|
@@ -17,28 +19,145 @@ interface FormFieldProps extends /** @vue-ignore */HTMLAttributes {
|
|
|
17
19
|
isFieldArray?: boolean;
|
|
18
20
|
}
|
|
19
21
|
/**
|
|
20
|
-
*
|
|
22
|
+
* Properties for the FormLabel component.
|
|
21
23
|
*/
|
|
22
24
|
interface FormLabelProps extends LabelProps {}
|
|
23
25
|
/**
|
|
24
|
-
*
|
|
26
|
+
* Properties for the FormControl component.
|
|
25
27
|
*/
|
|
26
28
|
interface FormControlProps extends /** @vue-ignore */HTMLAttributes {}
|
|
27
29
|
/**
|
|
28
|
-
*
|
|
30
|
+
* Properties for the FormDescription component.
|
|
29
31
|
*/
|
|
30
32
|
interface FormDescriptionProps extends /** @vue-ignore */HTMLAttributes {}
|
|
31
33
|
/**
|
|
32
|
-
*
|
|
34
|
+
* Properties for the FormError component.
|
|
33
35
|
*/
|
|
34
36
|
interface FormErrorProps extends /** @vue-ignore */HTMLAttributes {}
|
|
35
37
|
/**
|
|
36
|
-
*
|
|
38
|
+
* Common properties for form field and form field array components, used in both compact and non-compact modes.
|
|
39
|
+
*/
|
|
40
|
+
interface FormFieldCommonProps {
|
|
41
|
+
/**
|
|
42
|
+
* Orientation of the form field.
|
|
43
|
+
*
|
|
44
|
+
* @default 'vertical'
|
|
45
|
+
*/
|
|
46
|
+
orientation?: DataOrientation;
|
|
47
|
+
/**
|
|
48
|
+
* Label text rendered by the component.
|
|
49
|
+
*/
|
|
50
|
+
label?: string;
|
|
51
|
+
/**
|
|
52
|
+
* Description text rendered by the component.
|
|
53
|
+
*/
|
|
54
|
+
description?: string;
|
|
55
|
+
/**
|
|
56
|
+
* Properties forwarded to the label element.
|
|
57
|
+
*/
|
|
58
|
+
labelProps?: FormLabelProps;
|
|
59
|
+
/**
|
|
60
|
+
* Properties forwarded to the control element.
|
|
61
|
+
*/
|
|
62
|
+
controlProps?: FormControlProps;
|
|
63
|
+
/**
|
|
64
|
+
* Properties forwarded to the description element.
|
|
65
|
+
*/
|
|
66
|
+
descriptionProps?: FormDescriptionProps;
|
|
67
|
+
/**
|
|
68
|
+
* Properties forwarded to the error element.
|
|
69
|
+
*/
|
|
70
|
+
errorProps?: FormErrorProps;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Properties for the FormFieldBaseCompact component.
|
|
74
|
+
*/
|
|
75
|
+
interface FormFieldBaseCompactProps extends FormFieldProps, FormFieldCommonProps {}
|
|
76
|
+
/**
|
|
77
|
+
* Slots for the FormFieldBaseCompact component.
|
|
78
|
+
*/
|
|
79
|
+
type FormFieldBaseCompactSlots = {
|
|
80
|
+
/**
|
|
81
|
+
* Custom content for the default slot.
|
|
82
|
+
*/
|
|
83
|
+
default?: () => any;
|
|
84
|
+
/**
|
|
85
|
+
* Custom content for the label slot.
|
|
86
|
+
*/
|
|
87
|
+
label?: () => any;
|
|
88
|
+
/**
|
|
89
|
+
* Custom content for the description slot.
|
|
90
|
+
*/
|
|
91
|
+
description?: () => any;
|
|
92
|
+
};
|
|
93
|
+
/**
|
|
94
|
+
* State and methods provided by the form field context.
|
|
95
|
+
*/
|
|
96
|
+
interface FormFieldCompactProps<Values extends FormValues, Name extends Path<Values>> extends Omit<FormFieldProps, 'error' | 'isFieldArray'>, FormFieldCommonProps, FormRegisterOptions<PathValue<Values, Name>> {
|
|
97
|
+
/**
|
|
98
|
+
* The name of the form field, used for registration and value retrieval.
|
|
99
|
+
*/
|
|
100
|
+
name: Name;
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Slots for the FormFieldCompact component.
|
|
104
|
+
*/
|
|
105
|
+
type FormFieldCompactSlots<Values extends FormValues, Name extends Path<Values>> = {
|
|
106
|
+
/**
|
|
107
|
+
* Custom content for the default slot.
|
|
108
|
+
*/
|
|
109
|
+
default?: (props: FormFieldState<Values, Name>) => any;
|
|
110
|
+
/**
|
|
111
|
+
* Custom content for the label slot.
|
|
112
|
+
*/
|
|
113
|
+
label?: (props: FormFieldState<Values, Name>) => any;
|
|
114
|
+
/**
|
|
115
|
+
* Custom content for the description slot.
|
|
116
|
+
*/
|
|
117
|
+
description?: (props: FormFieldState<Values, Name>) => any;
|
|
118
|
+
};
|
|
119
|
+
/**
|
|
120
|
+
* Type information for FormFieldComponent.
|
|
121
|
+
*/
|
|
122
|
+
type FormFieldComponent<Values extends FormValues, ExtraProps extends Record<string, any> = {}> = new <Name extends Path<Values>>(props: FormFieldCompactProps<Values, Name> & PublicProps & ExtraProps) => CreateComponentPublicInstanceWithMixins<FormFieldCompactProps<Values, Name> & ExtraProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, EmitsOptions, PublicProps, {}, false, {}, SlotsType<FormFieldCompactSlots<Values, Name>>>;
|
|
123
|
+
/**
|
|
124
|
+
* Slots for the FormFieldArrayCompact component.
|
|
125
|
+
*/
|
|
126
|
+
type FormFieldArrayCompactSlots<Values extends FormValues, Name extends Path<Values>> = {
|
|
127
|
+
/**
|
|
128
|
+
* Custom content for the default slot.
|
|
129
|
+
*/
|
|
130
|
+
default?: (props: FormFieldArrayStates<Values, Name>) => any;
|
|
131
|
+
/**
|
|
132
|
+
* Custom content for the label slot.
|
|
133
|
+
*/
|
|
134
|
+
label?: (props: FormFieldArrayStates<Values, Name>) => any;
|
|
135
|
+
/**
|
|
136
|
+
* Custom content for the description slot.
|
|
137
|
+
*/
|
|
138
|
+
description?: (props: FormFieldArrayStates<Values, Name>) => any;
|
|
139
|
+
};
|
|
140
|
+
/**
|
|
141
|
+
* Type information for FormFieldArrayComponent.
|
|
142
|
+
*/
|
|
143
|
+
type FormFieldArrayComponent<Values extends FormValues, ExtraProps extends Record<string, any> = {}> = new <Name extends Path<Values>>(props: FormFieldCompactProps<Values, Name> & PublicProps & ExtraProps) => CreateComponentPublicInstanceWithMixins<FormFieldCompactProps<Values, Name> & ExtraProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, EmitsOptions, PublicProps, {}, false, {}, SlotsType<FormFieldArrayCompactSlots<Values, Name>>>;
|
|
144
|
+
/**
|
|
145
|
+
* Properties for the FormCompact component.
|
|
146
|
+
*/
|
|
147
|
+
interface FormCompactProps extends Pick<FormFieldCommonProps, 'orientation' | 'labelProps' | 'controlProps' | 'descriptionProps' | 'errorProps'>, /** @vue-ignore */FormHTMLAttributes {
|
|
148
|
+
fieldProps?: FormFieldProps;
|
|
149
|
+
fieldArrayProps?: FormFieldProps;
|
|
150
|
+
}
|
|
151
|
+
type UseFormReturn<Values extends FormValues, FieldExtraProps extends Record<string, any> = {}, FieldArrayExtraProps extends Record<string, any> = {}> = [UseHeadlessFormReturn<Values>, Field: FormFieldComponent<Values, FieldExtraProps>, FieldArray: FormFieldArrayComponent<Values, FieldArrayExtraProps>];
|
|
152
|
+
/**
|
|
153
|
+
* Available UI slots for the FormField component.
|
|
37
154
|
*/
|
|
38
155
|
type FormFieldUiSlot = 'field' | 'fieldArray' | 'label' | 'control' | 'description' | 'error';
|
|
39
156
|
/**
|
|
40
|
-
* UI class overrides for the
|
|
157
|
+
* UI class overrides for the FormField component.
|
|
41
158
|
*/
|
|
42
159
|
type FormFieldUi = UiClass<FormFieldUiSlot>;
|
|
160
|
+
type FormUiSlot = 'form' | FormFieldUiSlot;
|
|
161
|
+
type FormUi = UiClass<FormUiSlot>;
|
|
43
162
|
//#endregion
|
|
44
|
-
export { FormControlProps, FormDescriptionProps, FormErrorProps, FormFieldProps, FormFieldUi, FormFieldUiSlot, FormLabelProps };
|
|
163
|
+
export { FormCompactProps, FormControlProps, FormDescriptionProps, FormErrorProps, FormFieldArrayCompactSlots, FormFieldArrayComponent, FormFieldBaseCompactProps, FormFieldBaseCompactSlots, FormFieldCompactProps, FormFieldCompactSlots, FormFieldComponent, FormFieldProps, FormFieldUi, FormFieldUiSlot, FormLabelProps, FormUi, FormUiSlot, UseFormReturn };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { FormValues, InferStandardSchemaInput, UseHeadlessFormOptions } from "./core/types.js";
|
|
2
|
+
import { FormFieldArrayComponent, FormFieldComponent, UseFormReturn } from "./types.js";
|
|
3
|
+
import { StandardSchemaV1 } from "@standard-schema/spec";
|
|
4
|
+
|
|
5
|
+
//#region src/components/form/use-form.d.ts
|
|
6
|
+
declare function useForm<S extends StandardSchemaV1<FormValues, FormValues>, FieldExtraProps extends Record<string, any> = {}, FieldArrayExtraProps extends Record<string, any> = {}>(options: UseHeadlessFormOptions<S>, Field: FormFieldComponent<InferStandardSchemaInput<S>, FieldExtraProps>, FieldArray: FormFieldArrayComponent<InferStandardSchemaInput<S>, FieldArrayExtraProps>): UseFormReturn<InferStandardSchemaInput<S>, FieldExtraProps, FieldArrayExtraProps>;
|
|
7
|
+
//#endregion
|
|
8
|
+
export { useForm };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{useHeadlessForm as e}from"./core/use-form.js";import{inject as t,provide as n}from"vue";const r=Symbol(`UseFormContext`);function i(t,i,a){let o=e(t);return n(r,o),[o,i,a]}const a=Symbol(`UseFormSubContext`);function o(){let e=t(a);if(!e)throw Error(`useFormContext must be used within a useForm provider`);return e}function s(){let e=t(r,null);if(!e)throw Error(`useFormContext must be used within a useForm provider`);return n(a,e),e}export{s as provideFormSub,i as useForm,o as useFormSub};
|
|
@@ -15,8 +15,8 @@ declare const __VLS_base: _$vue.DefineComponent<HoverCardCompactProps, {}, {}, {
|
|
|
15
15
|
onPointerDownOutside?: ((event: PointerDownOutsideEvent) => any) | undefined;
|
|
16
16
|
onFocusOutside?: ((event: FocusOutsideEvent) => any) | undefined;
|
|
17
17
|
}>, {
|
|
18
|
-
open: boolean;
|
|
19
18
|
defaultOpen: boolean;
|
|
19
|
+
open: boolean;
|
|
20
20
|
showArrow: boolean;
|
|
21
21
|
}, {}, {}, {}, string, _$vue.ComponentProvideOptions, false, {}, any>;
|
|
22
22
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
@@ -13,8 +13,8 @@ declare const __VLS_base: _$vue.DefineComponent<HoverCardRootProps, {}, {}, {},
|
|
|
13
13
|
}, string, _$vue.PublicProps, Readonly<HoverCardRootProps> & Readonly<{
|
|
14
14
|
"onUpdate:open"?: ((value: boolean) => any) | undefined;
|
|
15
15
|
}>, {
|
|
16
|
-
open: boolean;
|
|
17
16
|
defaultOpen: boolean;
|
|
17
|
+
open: boolean;
|
|
18
18
|
openDelay: number;
|
|
19
19
|
closeDelay: number;
|
|
20
20
|
}, {}, {}, {}, string, _$vue.ComponentProvideOptions, false, {}, any>;
|