vft 0.0.144 → 0.0.145
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/dist/index.css +1 -1
- package/es/app-components/form/form-label-wrap.d.ts +2 -2
- package/es/app-components/form/hooks/use-form-item.d.ts +2 -2
- package/es/component.d.ts +0 -1
- package/es/components/affix/affix.d.ts +1 -1
- package/es/components/affix/affix.vue.d.ts +6 -6
- package/es/components/affix/index.d.ts +17 -17
- package/es/components/alert/alert.vue.d.ts +1 -1
- package/es/components/alert/index.d.ts +2 -2
- package/es/components/autocomplete/autocomplete.vue.d.ts +32 -25
- package/es/components/autocomplete/index.d.ts +95 -74
- package/es/components/avatar/avatar.vue.d.ts +3 -1
- package/es/components/avatar/index.d.ts +8 -4
- package/es/components/backtop/backtop.vue.d.ts +3 -1
- package/es/components/backtop/index.d.ts +8 -4
- package/es/components/button/use-button.js +3 -3
- package/es/components/carousel/carousel.vue.d.ts +9 -9
- package/es/components/carousel/index.d.ts +16 -16
- package/es/components/check-tag/index.d.ts +1 -1
- package/es/components/checkbox/checkbox-button.vue.d.ts +4 -1
- package/es/components/checkbox/checkbox-group.vue.d.ts +4 -1
- package/es/components/checkbox/checkbox.vue.d.ts +16 -13
- package/es/components/checkbox/index.d.ts +80 -50
- package/es/components/clamp/index.d.ts +2 -2
- package/es/components/color-picker/color-picker.vue.d.ts +16 -11
- package/es/components/color-picker/index.d.ts +16 -11
- package/es/components/container/container.vue.d.ts +2 -2
- package/es/components/container/index.d.ts +10 -10
- package/es/components/date-picker/composables/use-range-picker.d.ts +1 -1
- package/es/components/date-picker/date-picker-com/basic-date-table.vue.d.ts +5 -1
- package/es/components/date-picker/date-picker-com/basic-month-table.vue.d.ts +5 -1
- package/es/components/date-picker/date-picker-com/basic-year-table.vue.d.ts +3 -1
- package/es/components/date-picker/date-picker-com/panel-date-pick.vue.d.ts +6 -2
- package/es/components/date-picker/date-picker-com/panel-date-range.vue.d.ts +7 -2
- package/es/components/date-picker/date-picker-com/panel-month-range.vue.d.ts +4 -4
- package/es/components/date-picker/date-picker.d.ts +3 -3
- package/es/components/date-picker/index.d.ts +6 -6
- package/es/components/date-picker/panel-utils.d.ts +78 -25
- package/es/components/descriptions/description.vue.d.ts +2 -2
- package/es/components/descriptions/index.d.ts +9 -9
- package/es/components/dialog/dialog-content.vue.d.ts +3 -1
- package/es/components/dialog/dialog.vue.d.ts +7 -7
- package/es/components/dialog/index.d.ts +17 -17
- package/es/components/divider/divider.vue.d.ts +2 -2
- package/es/components/divider/index.d.ts +4 -4
- package/es/components/drawer/drawer.vue.d.ts +7 -7
- package/es/components/drawer/index.d.ts +17 -17
- package/es/components/dropdown/dropdown.vue.d.ts +29 -29
- package/es/components/dropdown/index.d.ts +50 -50
- package/es/components/form/form-item.vue.d.ts +9 -9
- package/es/components/form/form.vue.d.ts +5 -3
- package/es/components/form/index.d.ts +56 -52
- package/es/components/image/image.vue.d.ts +7 -1
- package/es/components/image/index.d.ts +19 -7
- package/es/components/image-viewer/image-viewer.vue.d.ts +2 -2
- package/es/components/image-viewer/index.d.ts +5 -5
- package/es/components/index.js +113 -113
- package/es/components/input/index.d.ts +51 -51
- package/es/components/input/input.vue.d.ts +17 -17
- package/es/components/input-number/index.d.ts +5 -5
- package/es/components/input-number/input-number.vue.d.ts +5 -5
- package/es/components/link/index.d.ts +9 -5
- package/es/components/link/link.vue.d.ts +3 -1
- package/es/components/md-code-demo/index.d.ts +3 -3
- package/es/components/md-code-demo/md-code-demo.d.ts +3 -3
- package/es/components/md-container/md-container.vue2.js +51 -43
- package/es/components/menu/index.d.ts +24 -8
- package/es/components/menu/menu-item.vue.d.ts +5 -1
- package/es/components/menu/menu.vue.d.ts +2 -2
- package/es/components/message/message.vue.d.ts +3 -1
- package/es/components/modal/index.d.ts +497 -1
- package/es/components/modal/modal.vue.d.ts +246 -1
- package/es/components/overlay/index.d.ts +3 -1
- package/es/components/overlay/overlay.vue.d.ts +3 -1
- package/es/components/pagination/components/next.vue.d.ts +3 -1
- package/es/components/pagination/components/pager.vue.d.ts +3 -1
- package/es/components/pagination/components/prev.vue.d.ts +3 -1
- package/es/components/pagination/components/sizes.vue.d.ts +3 -1
- package/es/components/pagination/index.d.ts +6 -6
- package/es/components/pagination/pagination.vue.d.ts +6 -6
- package/es/components/popconfirm/index.d.ts +9 -9
- package/es/components/popconfirm/popconfirm.vue.d.ts +6 -6
- package/es/components/popover/index.d.ts +19 -7
- package/es/components/popover/popover.vue.d.ts +7 -1
- package/es/components/popper/composables/use-content.d.ts +3 -3
- package/es/components/popper/content.vue.d.ts +7 -1
- package/es/components/popper/index.d.ts +4 -4
- package/es/components/popper/popper.vue.d.ts +2 -2
- package/es/components/progress/index.d.ts +1 -1
- package/es/components/qrcode/index.d.ts +4 -1
- package/es/components/qrcode/qrcode.vue.d.ts +4 -1
- package/es/components/radio/index.d.ts +55 -37
- package/es/components/radio/radio-group.vue.d.ts +10 -7
- package/es/components/radio/radio.vue.d.ts +4 -1
- package/es/components/row/index.d.ts +1 -1
- package/es/components/scrollbar/index.d.ts +11 -11
- package/es/components/scrollbar/scrollbar.vue.d.ts +2 -2
- package/es/components/search/index.d.ts +9 -9
- package/es/components/select/index.d.ts +2 -1646
- package/es/components/select/select.vue.d.ts +1 -823
- package/es/components/select/useSelect.d.ts +25 -18
- package/es/components/slider/button.vue.d.ts +1 -1
- package/es/components/slider/composables/use-slide.d.ts +4 -4
- package/es/components/slider/index.d.ts +3 -3
- package/es/components/slider/slider.vue.d.ts +3 -3
- package/es/components/space/index.d.ts +3 -3
- package/es/components/space/space.d.ts +4 -4
- package/es/components/super-form/index.d.ts +38 -38
- package/es/components/super-form/super-form-item.vue2.js +3 -1
- package/es/components/super-form/super-form.vue.d.ts +16 -16
- package/es/components/super-form/super-form.vue2.js +73 -74
- package/es/components/super-form/types.d.ts +176 -0
- package/es/components/super-form/use/use-form-events.d.ts +30 -0
- package/es/components/super-form/use/use-form-events.js +61 -59
- package/es/components/super-form/use/use-form-values.d.ts +14 -0
- package/es/components/switch/index.d.ts +23 -19
- package/es/components/switch/switch.vue.d.ts +23 -19
- package/es/components/table/index.d.ts +233 -63
- package/es/components/table/table.vue.d.ts +118 -33
- package/es/components/table/table.vue2.js +1 -1
- package/es/components/table/types.d.ts +56 -0
- package/es/components/table/use/use-columns.d.ts +12 -12
- package/es/components/tabs/index.d.ts +11 -11
- package/es/components/tabs/tab-nav.vue.d.ts +6 -1
- package/es/components/tabs/tab-nav.vue2.js +15 -13
- package/es/components/tabs/tabs.vue.d.ts +9 -13
- package/es/components/tabs/tabs.vue2.js +53 -68
- package/es/components/tag/index.d.ts +4 -1
- package/es/components/tag/tag.vue.d.ts +4 -1
- package/es/components/time-picker/common/picker.vue.d.ts +13 -4
- package/es/components/time-picker/composables/use-time-picker.d.ts +2 -2
- package/es/components/time-picker/index.d.ts +6 -6
- package/es/components/time-picker/time-picker-com/basic-time-spinner.vue.d.ts +5 -1
- package/es/components/time-picker/time-picker-com/panel-time-pick.vue.d.ts +5 -1
- package/es/components/time-picker/time-picker-com/panel-time-range.vue.d.ts +5 -1
- package/es/components/time-picker/time-picker.d.ts +3 -3
- package/es/components/time-select/time-select.vue.d.ts +7 -2
- package/es/components/tooltip/index.d.ts +34 -20
- package/es/components/tooltip/tooltip.vue.d.ts +10 -3
- package/es/components/tree/index.d.ts +70 -70
- package/es/components/tree/tree.vue.d.ts +18 -18
- package/es/components/types.d.ts +3 -0
- package/es/components/upload/index.d.ts +37 -37
- package/es/components/upload/upload-content.vue.d.ts +20 -20
- package/es/components/upload/upload.vue.d.ts +20 -20
- package/es/components/verify-code/index.d.ts +2 -6
- package/es/components/verify-code/verify-code.vue.d.ts +2 -6
- package/es/components/virtual-list/builders/build-list.d.ts +3 -3
- package/es/components/virtual-list/components/dynamic-size-list.d.ts +3 -3
- package/es/components/virtual-list/components/fixed-size-list.d.ts +3 -3
- package/es/components/virtual-list/components/scrollbar.d.ts +3 -3
- package/es/components/virtual-list/props.d.ts +2 -2
- package/es/defaults.d.ts +1 -1
- package/es/hooks/use-popper/index.d.ts +3 -3
- package/es/index.d.ts +1 -1
- package/es/index.js +113 -113
- package/es/make-installer.d.ts +1 -1
- package/es/package.json.d.ts +2 -2
- package/es/package.json.js +1 -1
- package/es/plugin.d.ts +0 -1
- package/lib/app-components/form/form-label-wrap.d.ts +2 -2
- package/lib/app-components/form/hooks/use-form-item.d.ts +2 -2
- package/lib/component.d.ts +0 -1
- package/lib/components/affix/affix.d.ts +1 -1
- package/lib/components/affix/affix.vue.d.ts +6 -6
- package/lib/components/affix/index.d.ts +17 -17
- package/lib/components/alert/alert.vue.d.ts +1 -1
- package/lib/components/alert/index.d.ts +2 -2
- package/lib/components/autocomplete/autocomplete.vue.d.ts +32 -25
- package/lib/components/autocomplete/index.d.ts +95 -74
- package/lib/components/avatar/avatar.vue.d.ts +3 -1
- package/lib/components/avatar/index.d.ts +8 -4
- package/lib/components/backtop/backtop.vue.d.ts +3 -1
- package/lib/components/backtop/index.d.ts +8 -4
- package/lib/components/button/use-button.cjs +1 -1
- package/lib/components/carousel/carousel.vue.d.ts +9 -9
- package/lib/components/carousel/index.d.ts +16 -16
- package/lib/components/check-tag/index.d.ts +1 -1
- package/lib/components/checkbox/checkbox-button.vue.d.ts +4 -1
- package/lib/components/checkbox/checkbox-group.vue.d.ts +4 -1
- package/lib/components/checkbox/checkbox.vue.d.ts +16 -13
- package/lib/components/checkbox/index.d.ts +80 -50
- package/lib/components/clamp/index.d.ts +2 -2
- package/lib/components/color-picker/color-picker.vue.d.ts +16 -11
- package/lib/components/color-picker/index.d.ts +16 -11
- package/lib/components/container/container.vue.d.ts +2 -2
- package/lib/components/container/index.d.ts +10 -10
- package/lib/components/date-picker/composables/use-range-picker.d.ts +1 -1
- package/lib/components/date-picker/date-picker-com/basic-date-table.vue.d.ts +5 -1
- package/lib/components/date-picker/date-picker-com/basic-month-table.vue.d.ts +5 -1
- package/lib/components/date-picker/date-picker-com/basic-year-table.vue.d.ts +3 -1
- package/lib/components/date-picker/date-picker-com/panel-date-pick.vue.d.ts +6 -2
- package/lib/components/date-picker/date-picker-com/panel-date-range.vue.d.ts +7 -2
- package/lib/components/date-picker/date-picker-com/panel-month-range.vue.d.ts +4 -4
- package/lib/components/date-picker/date-picker.d.ts +3 -3
- package/lib/components/date-picker/index.d.ts +6 -6
- package/lib/components/date-picker/panel-utils.d.ts +78 -25
- package/lib/components/descriptions/description.vue.d.ts +2 -2
- package/lib/components/descriptions/index.d.ts +9 -9
- package/lib/components/dialog/dialog-content.vue.d.ts +3 -1
- package/lib/components/dialog/dialog.vue.d.ts +7 -7
- package/lib/components/dialog/index.d.ts +17 -17
- package/lib/components/divider/divider.vue.d.ts +2 -2
- package/lib/components/divider/index.d.ts +4 -4
- package/lib/components/drawer/drawer.vue.d.ts +7 -7
- package/lib/components/drawer/index.d.ts +17 -17
- package/lib/components/dropdown/dropdown.vue.d.ts +29 -29
- package/lib/components/dropdown/index.d.ts +50 -50
- package/lib/components/form/form-item.vue.d.ts +9 -9
- package/lib/components/form/form.vue.d.ts +5 -3
- package/lib/components/form/index.d.ts +56 -52
- package/lib/components/image/image.vue.d.ts +7 -1
- package/lib/components/image/index.d.ts +19 -7
- package/lib/components/image-viewer/image-viewer.vue.d.ts +2 -2
- package/lib/components/image-viewer/index.d.ts +5 -5
- package/lib/components/index.cjs +1 -1
- package/lib/components/input/index.d.ts +51 -51
- package/lib/components/input/input.vue.d.ts +17 -17
- package/lib/components/input-number/index.d.ts +5 -5
- package/lib/components/input-number/input-number.vue.d.ts +5 -5
- package/lib/components/link/index.d.ts +9 -5
- package/lib/components/link/link.vue.d.ts +3 -1
- package/lib/components/md-code-demo/index.d.ts +3 -3
- package/lib/components/md-code-demo/md-code-demo.d.ts +3 -3
- package/lib/components/md-container/md-container.vue2.cjs +1 -1
- package/lib/components/menu/index.d.ts +24 -8
- package/lib/components/menu/menu-item.vue.d.ts +5 -1
- package/lib/components/menu/menu.vue.d.ts +2 -2
- package/lib/components/message/message.vue.d.ts +3 -1
- package/lib/components/modal/index.d.ts +497 -1
- package/lib/components/modal/modal.vue.d.ts +246 -1
- package/lib/components/overlay/index.d.ts +3 -1
- package/lib/components/overlay/overlay.vue.d.ts +3 -1
- package/lib/components/pagination/components/next.vue.d.ts +3 -1
- package/lib/components/pagination/components/pager.vue.d.ts +3 -1
- package/lib/components/pagination/components/prev.vue.d.ts +3 -1
- package/lib/components/pagination/components/sizes.vue.d.ts +3 -1
- package/lib/components/pagination/index.d.ts +6 -6
- package/lib/components/pagination/pagination.vue.d.ts +6 -6
- package/lib/components/popconfirm/index.d.ts +9 -9
- package/lib/components/popconfirm/popconfirm.vue.d.ts +6 -6
- package/lib/components/popover/index.d.ts +19 -7
- package/lib/components/popover/popover.vue.d.ts +7 -1
- package/lib/components/popper/composables/use-content.d.ts +3 -3
- package/lib/components/popper/content.vue.d.ts +7 -1
- package/lib/components/popper/index.d.ts +4 -4
- package/lib/components/popper/popper.vue.d.ts +2 -2
- package/lib/components/progress/index.d.ts +1 -1
- package/lib/components/qrcode/index.d.ts +4 -1
- package/lib/components/qrcode/qrcode.vue.d.ts +4 -1
- package/lib/components/radio/index.d.ts +55 -37
- package/lib/components/radio/radio-group.vue.d.ts +10 -7
- package/lib/components/radio/radio.vue.d.ts +4 -1
- package/lib/components/row/index.d.ts +1 -1
- package/lib/components/scrollbar/index.d.ts +11 -11
- package/lib/components/scrollbar/scrollbar.vue.d.ts +2 -2
- package/lib/components/search/index.d.ts +9 -9
- package/lib/components/select/index.d.ts +2 -1646
- package/lib/components/select/select.vue.d.ts +1 -823
- package/lib/components/select/useSelect.d.ts +25 -18
- package/lib/components/slider/button.vue.d.ts +1 -1
- package/lib/components/slider/composables/use-slide.d.ts +4 -4
- package/lib/components/slider/index.d.ts +3 -3
- package/lib/components/slider/slider.vue.d.ts +3 -3
- package/lib/components/space/index.d.ts +3 -3
- package/lib/components/space/space.d.ts +4 -4
- package/lib/components/super-form/index.d.ts +38 -38
- package/lib/components/super-form/super-form-item.vue2.cjs +1 -1
- package/lib/components/super-form/super-form.vue.d.ts +16 -16
- package/lib/components/super-form/super-form.vue2.cjs +1 -1
- package/lib/components/super-form/types.d.ts +176 -0
- package/lib/components/super-form/use/use-form-events.cjs +1 -1
- package/lib/components/super-form/use/use-form-events.d.ts +30 -0
- package/lib/components/super-form/use/use-form-values.d.ts +14 -0
- package/lib/components/switch/index.d.ts +23 -19
- package/lib/components/switch/switch.vue.d.ts +23 -19
- package/lib/components/table/index.d.ts +233 -63
- package/lib/components/table/table.vue.d.ts +118 -33
- package/lib/components/table/table.vue2.cjs +1 -1
- package/lib/components/table/types.d.ts +56 -0
- package/lib/components/table/use/use-columns.d.ts +12 -12
- package/lib/components/tabs/index.d.ts +11 -11
- package/lib/components/tabs/tab-nav.vue.d.ts +6 -1
- package/lib/components/tabs/tab-nav.vue2.cjs +1 -1
- package/lib/components/tabs/tabs.vue.d.ts +9 -13
- package/lib/components/tabs/tabs.vue2.cjs +1 -1
- package/lib/components/tag/index.d.ts +4 -1
- package/lib/components/tag/tag.vue.d.ts +4 -1
- package/lib/components/time-picker/common/picker.vue.d.ts +13 -4
- package/lib/components/time-picker/composables/use-time-picker.d.ts +2 -2
- package/lib/components/time-picker/index.d.ts +6 -6
- package/lib/components/time-picker/time-picker-com/basic-time-spinner.vue.d.ts +5 -1
- package/lib/components/time-picker/time-picker-com/panel-time-pick.vue.d.ts +5 -1
- package/lib/components/time-picker/time-picker-com/panel-time-range.vue.d.ts +5 -1
- package/lib/components/time-picker/time-picker.d.ts +3 -3
- package/lib/components/time-select/time-select.vue.d.ts +7 -2
- package/lib/components/tooltip/index.d.ts +34 -20
- package/lib/components/tooltip/tooltip.vue.d.ts +10 -3
- package/lib/components/tree/index.d.ts +70 -70
- package/lib/components/tree/tree.vue.d.ts +18 -18
- package/lib/components/types.d.ts +3 -0
- package/lib/components/upload/index.d.ts +37 -37
- package/lib/components/upload/upload-content.vue.d.ts +20 -20
- package/lib/components/upload/upload.vue.d.ts +20 -20
- package/lib/components/verify-code/index.d.ts +2 -6
- package/lib/components/verify-code/verify-code.vue.d.ts +2 -6
- package/lib/components/virtual-list/builders/build-list.d.ts +3 -3
- package/lib/components/virtual-list/components/dynamic-size-list.d.ts +3 -3
- package/lib/components/virtual-list/components/fixed-size-list.d.ts +3 -3
- package/lib/components/virtual-list/components/scrollbar.d.ts +3 -3
- package/lib/components/virtual-list/props.d.ts +2 -2
- package/lib/defaults.d.ts +1 -1
- package/lib/hooks/use-popper/index.d.ts +3 -3
- package/lib/index.cjs +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/make-installer.d.ts +1 -1
- package/lib/package.json.cjs +1 -1
- package/lib/package.json.d.ts +2 -2
- package/lib/plugin.d.ts +0 -1
- package/package.json +6 -6
- package/theme-style/index.css +1 -1
- package/theme-style/src/super-form.scss +5 -0
- package/theme-style/vft-super-form.css +1 -1
- package/web-types.json +1 -1
- package/es/components/button/button.vue.d.ts +0 -209
- package/es/components/button/index.d.ts +0 -593
- package/es/components/button/use-button.d.ts +0 -20
- package/es/components/checkbox/composables/use-checkbox-disabled.d.ts +0 -6
- package/es/components/checkbox/composables/use-checkbox.d.ts +0 -15
- package/es/components/config-provider/hooks/use-global-config.d.ts +0 -31
- package/es/components/form/hooks/use-form-common-props.d.ts +0 -6
- package/es/components/loading/index.d.ts +0 -48
- package/es/components/loading/loading.d.ts +0 -36
- package/es/components/radio/use-radio.d.ts +0 -15
- package/es/components/upload/use-handlers.d.ts +0 -23
- package/lib/components/button/button.vue.d.ts +0 -209
- package/lib/components/button/index.d.ts +0 -593
- package/lib/components/button/use-button.d.ts +0 -20
- package/lib/components/checkbox/composables/use-checkbox-disabled.d.ts +0 -6
- package/lib/components/checkbox/composables/use-checkbox.d.ts +0 -15
- package/lib/components/config-provider/hooks/use-global-config.d.ts +0 -31
- package/lib/components/form/hooks/use-form-common-props.d.ts +0 -6
- package/lib/components/loading/index.d.ts +0 -48
- package/lib/components/loading/loading.d.ts +0 -36
- package/lib/components/radio/use-radio.d.ts +0 -15
- package/lib/components/upload/use-handlers.d.ts +0 -23
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { defineComponent as et, useAttrs as st, reactive as ut, ref as n, computed as
|
|
2
|
-
import { cloneDeep as Ft, pick as bt, deepMerge as Ct } from "@vft/utils";
|
|
1
|
+
import { defineComponent as et, useAttrs as st, reactive as ut, ref as n, computed as h, unref as o, watch as y, nextTick as ft, onMounted as ct, resolveComponent as dt, openBlock as l, createBlock as c, mergeProps as v, withKeys as Bt, withCtx as g, normalizeProps as d, renderSlot as O, createElementBlock as ht, Fragment as yt, renderList as Y, createSlots as vt, guardReactiveProps as Z, createVNode as gt, createCommentVNode as F } from "vue";
|
|
3
2
|
import "../alert/index.js";
|
|
4
3
|
import "../avatar/index.js";
|
|
5
4
|
import "../backtop/index.js";
|
|
@@ -14,6 +13,7 @@ import "../collapse-transition/index.js";
|
|
|
14
13
|
import "../color-picker/index.js";
|
|
15
14
|
import "../config-provider/index.js";
|
|
16
15
|
import "../container/index.js";
|
|
16
|
+
import { cloneDeep as Ft, pick as bt, deepMerge as St } from "@vft/utils";
|
|
17
17
|
import "../context-menu/context-menu.vue2.js";
|
|
18
18
|
import "../date-picker/index.js";
|
|
19
19
|
import "../date-time-select/index.js";
|
|
@@ -25,7 +25,7 @@ import "../dropdown/index.js";
|
|
|
25
25
|
import "../empty/index.js";
|
|
26
26
|
import "../exception/index.js";
|
|
27
27
|
import "../footer-layout/index.js";
|
|
28
|
-
import { VftForm as
|
|
28
|
+
import { VftForm as Ct } from "../form/index.js";
|
|
29
29
|
import "../full-screen/index.js";
|
|
30
30
|
import "../header-layout/index.js";
|
|
31
31
|
import "../horizontal-menu/index.js";
|
|
@@ -93,20 +93,19 @@ import "../../hooks/use-z-index/index.js";
|
|
|
93
93
|
import "../message/index.js";
|
|
94
94
|
import "../infinite-scroll/index.js";
|
|
95
95
|
import "../progress-i/index.js";
|
|
96
|
-
import { FormCompEnum as Vt } from "./component-map.js";
|
|
97
96
|
import tt from "./super-form-action.vue2.js";
|
|
98
97
|
import _t from "./super-form-item.vue2.js";
|
|
99
|
-
import { useAutoFocus as
|
|
100
|
-
import { createFormContext as
|
|
98
|
+
import { useAutoFocus as Ot } from "./use/use-auto-focus.js";
|
|
99
|
+
import { createFormContext as Vt } from "./use/use-form-context.js";
|
|
101
100
|
import { useFormEvents as Mt } from "./use/use-form-events.js";
|
|
102
|
-
import { useFormValues as
|
|
101
|
+
import { useFormValues as Et } from "./use/use-form-values.js";
|
|
103
102
|
const At = (
|
|
104
103
|
/* hoist-static*/
|
|
105
104
|
Rt("super-form")
|
|
106
|
-
),
|
|
105
|
+
), Dt = et({
|
|
107
106
|
name: "vft-super-form"
|
|
108
107
|
}), Oo = /* @__PURE__ */ et({
|
|
109
|
-
...
|
|
108
|
+
...Dt,
|
|
110
109
|
props: {
|
|
111
110
|
rowProps: {
|
|
112
111
|
default: {
|
|
@@ -225,165 +224,165 @@ const At = (
|
|
|
225
224
|
emits: ["register", "reset", "submit", "field-value-change"],
|
|
226
225
|
setup(ot, {
|
|
227
226
|
expose: rt,
|
|
228
|
-
emit:
|
|
227
|
+
emit: V
|
|
229
228
|
}) {
|
|
230
|
-
const
|
|
231
|
-
...
|
|
232
|
-
...o(
|
|
233
|
-
})), p =
|
|
229
|
+
const M = ot, it = st(), m = ut({}), b = n({}), B = n(!1), S = n({}), E = n(), C = n(null), A = n(), e = h(() => ({
|
|
230
|
+
...M,
|
|
231
|
+
...o(S)
|
|
232
|
+
})), p = h(() => ({
|
|
234
233
|
...it,
|
|
235
|
-
...
|
|
234
|
+
...M,
|
|
236
235
|
...o(e)
|
|
237
|
-
})),
|
|
238
|
-
const t = o(
|
|
239
|
-
return Ft(t
|
|
236
|
+
})), r = h(() => {
|
|
237
|
+
const t = o(E);
|
|
238
|
+
return Ft(t);
|
|
240
239
|
}), {
|
|
241
|
-
handleFormValues:
|
|
242
|
-
initDefault:
|
|
243
|
-
} =
|
|
240
|
+
handleFormValues: at,
|
|
241
|
+
initDefault: D
|
|
242
|
+
} = Et({
|
|
244
243
|
getProps: e,
|
|
245
244
|
defaultValueRef: b,
|
|
246
|
-
getSchema:
|
|
247
|
-
formModel:
|
|
245
|
+
getSchema: r,
|
|
246
|
+
formModel: m
|
|
248
247
|
});
|
|
249
|
-
|
|
250
|
-
getSchema:
|
|
248
|
+
Ot({
|
|
249
|
+
getSchema: r,
|
|
251
250
|
getProps: e,
|
|
252
251
|
isInitedDefault: B,
|
|
253
|
-
formElRef:
|
|
252
|
+
formElRef: C
|
|
254
253
|
});
|
|
255
254
|
const {
|
|
256
255
|
handleSubmit: s,
|
|
257
256
|
setFieldsValue: w,
|
|
258
|
-
clearValidate:
|
|
259
|
-
validate:
|
|
257
|
+
clearValidate: T,
|
|
258
|
+
validate: I,
|
|
260
259
|
validateField: N,
|
|
261
260
|
getFieldsValue: k,
|
|
262
261
|
updateSchema: P,
|
|
263
262
|
resetSchema: R,
|
|
264
263
|
appendSchemaByField: $,
|
|
265
264
|
removeSchemaByField: q,
|
|
266
|
-
resetFields:
|
|
267
|
-
scrollToField:
|
|
265
|
+
resetFields: _,
|
|
266
|
+
scrollToField: mt,
|
|
268
267
|
getFieldValue: x
|
|
269
268
|
} = Mt({
|
|
270
|
-
emit:
|
|
269
|
+
emit: V,
|
|
271
270
|
getProps: e,
|
|
272
|
-
formModel:
|
|
273
|
-
getSchema:
|
|
271
|
+
formModel: m,
|
|
272
|
+
getSchema: r,
|
|
274
273
|
defaultValueRef: b,
|
|
275
|
-
formElRef:
|
|
276
|
-
schemaRef:
|
|
277
|
-
handleFormValues:
|
|
278
|
-
initValues:
|
|
274
|
+
formElRef: C,
|
|
275
|
+
schemaRef: E,
|
|
276
|
+
handleFormValues: at,
|
|
277
|
+
initValues: A
|
|
279
278
|
});
|
|
280
|
-
|
|
281
|
-
resetAction:
|
|
279
|
+
Vt({
|
|
280
|
+
resetAction: _,
|
|
282
281
|
submitAction: s
|
|
283
|
-
}),
|
|
282
|
+
}), y(() => o(e).model, () => {
|
|
284
283
|
const {
|
|
285
284
|
model: t
|
|
286
285
|
} = o(e);
|
|
287
286
|
t && w(t);
|
|
288
287
|
}, {
|
|
289
288
|
immediate: !0
|
|
290
|
-
}),
|
|
289
|
+
}), y(() => o(e).schemas, (t) => {
|
|
291
290
|
R(t ?? []);
|
|
292
|
-
}),
|
|
293
|
-
var
|
|
291
|
+
}), y(() => r.value, (t) => {
|
|
292
|
+
var a;
|
|
294
293
|
ft(() => {
|
|
295
|
-
}), !o(B) && t != null && t.length && (
|
|
296
|
-
|
|
294
|
+
}), !o(B) && t != null && t.length && (D(), B.value = !0, (a = e.value) != null && a.watchDataIsChange && kt(() => {
|
|
295
|
+
A.value = k();
|
|
297
296
|
}, 40));
|
|
298
|
-
}),
|
|
297
|
+
}), y(() => m, Pt(() => {
|
|
299
298
|
o(e).submitOnChange && s();
|
|
300
299
|
}, 300), {
|
|
301
300
|
deep: !0
|
|
302
301
|
});
|
|
303
302
|
async function G(t) {
|
|
304
|
-
|
|
303
|
+
S.value = St(o(S) || {}, t);
|
|
305
304
|
}
|
|
306
|
-
function nt(t,
|
|
307
|
-
|
|
305
|
+
function nt(t, a, i) {
|
|
306
|
+
m[t] = a, i && i.itemProps;
|
|
308
307
|
}
|
|
309
308
|
function lt(t) {
|
|
310
309
|
const {
|
|
311
|
-
autoSubmitOnEnter:
|
|
310
|
+
autoSubmitOnEnter: a
|
|
312
311
|
} = o(e);
|
|
313
|
-
if (
|
|
314
|
-
const
|
|
315
|
-
|
|
312
|
+
if (a && t.key === "Enter" && t.target && t.target instanceof HTMLElement) {
|
|
313
|
+
const i = t.target;
|
|
314
|
+
i && i.tagName && i.tagName.toUpperCase() === "INPUT" && s();
|
|
316
315
|
}
|
|
317
316
|
}
|
|
318
317
|
const H = {
|
|
319
318
|
getFieldsValue: k,
|
|
320
319
|
getFieldValue: x,
|
|
321
320
|
setFieldsValue: w,
|
|
322
|
-
resetFields:
|
|
321
|
+
resetFields: _,
|
|
323
322
|
updateSchema: P,
|
|
324
323
|
resetSchema: R,
|
|
325
324
|
setProps: G,
|
|
326
325
|
removeSchemaByField: q,
|
|
327
326
|
appendSchemaByField: $,
|
|
328
|
-
clearValidate:
|
|
327
|
+
clearValidate: T,
|
|
329
328
|
validateField: N,
|
|
330
|
-
validate:
|
|
329
|
+
validate: I,
|
|
331
330
|
submit: s,
|
|
332
|
-
scrollToField:
|
|
331
|
+
scrollToField: mt
|
|
333
332
|
};
|
|
334
333
|
ct(() => {
|
|
335
|
-
|
|
334
|
+
D(), V("register", H);
|
|
336
335
|
});
|
|
337
|
-
const K =
|
|
336
|
+
const K = h(() => bt(e.value, ["showResetButton", "showCommonButton", "showSubmitButton", "resetButtonOptions", "submitButtonOptions", "commonButtonOptions", "actionColOptions", "actionSpan"]));
|
|
338
337
|
return rt({
|
|
339
338
|
getFieldsValue: k,
|
|
340
339
|
getFieldValue: x,
|
|
341
340
|
setFieldsValue: w,
|
|
342
|
-
resetFields:
|
|
341
|
+
resetFields: _,
|
|
343
342
|
updateSchema: P,
|
|
344
343
|
resetSchema: R,
|
|
345
344
|
setProps: G,
|
|
346
345
|
removeSchemaByField: q,
|
|
347
346
|
appendSchemaByField: $,
|
|
348
|
-
clearValidate:
|
|
347
|
+
clearValidate: T,
|
|
349
348
|
validateField: N,
|
|
350
|
-
validate:
|
|
349
|
+
validate: I,
|
|
351
350
|
submit: s,
|
|
352
|
-
getSchema:
|
|
353
|
-
}), (t,
|
|
351
|
+
getSchema: r
|
|
352
|
+
}), (t, a) => {
|
|
354
353
|
var L;
|
|
355
|
-
const
|
|
356
|
-
return B.value && ((L =
|
|
354
|
+
const i = dt("vft-col");
|
|
355
|
+
return B.value && ((L = r.value) != null && L.length) ? (l(), c(o(Ct), v({
|
|
357
356
|
key: 0
|
|
358
357
|
}, p.value, {
|
|
359
358
|
ref_key: "formElRef",
|
|
360
|
-
ref:
|
|
359
|
+
ref: C,
|
|
361
360
|
class: o(At).b(),
|
|
362
|
-
model:
|
|
361
|
+
model: m,
|
|
363
362
|
onKeypress: Bt(lt, ["enter"])
|
|
364
363
|
}), {
|
|
365
364
|
default: g(() => {
|
|
366
365
|
var z, U, W, j;
|
|
367
|
-
return [(z =
|
|
366
|
+
return [(z = r.value) != null && z.length ? (l(), c(o(wt), d(v({
|
|
368
367
|
key: 0
|
|
369
368
|
}, (U = p.value) == null ? void 0 : U.rowProps)), {
|
|
370
369
|
default: g(() => {
|
|
371
370
|
var J, Q, X;
|
|
372
|
-
return [
|
|
371
|
+
return [O(t.$slots, "formHeader"), (l(!0), ht(yt, null, Y(r.value, (u) => (l(), c(_t, {
|
|
373
372
|
key: u.field,
|
|
374
373
|
formActionType: H,
|
|
375
374
|
schema: u,
|
|
376
375
|
formProps: e.value,
|
|
377
376
|
allDefaultValues: b.value,
|
|
378
|
-
formModel:
|
|
377
|
+
formModel: m,
|
|
379
378
|
setFormModel: nt,
|
|
380
379
|
updateSchema: o(P)
|
|
381
380
|
}, vt({
|
|
382
381
|
_: 2
|
|
383
382
|
}, [Y(Object.keys(t.$slots), (f) => ({
|
|
384
383
|
name: f,
|
|
385
|
-
fn: g((pt) => [
|
|
386
|
-
}))]), 1032, ["schema", "formProps", "allDefaultValues", "formModel", "updateSchema"]))), 128)), gt(
|
|
384
|
+
fn: g((pt) => [O(t.$slots, f, d(Z(pt || {})))])
|
|
385
|
+
}))]), 1032, ["schema", "formProps", "allDefaultValues", "formModel", "updateSchema"]))), 128)), gt(i, d(Z((J = p.value) != null && J.quickColSpan ? {
|
|
387
386
|
span: Math.ceil(24 / ((Q = p.value) == null ? void 0 : Q.quickColSpan)),
|
|
388
387
|
...(X = p.value) == null ? void 0 : X.baseColProps
|
|
389
388
|
} : {})), {
|
|
@@ -399,7 +398,7 @@ const At = (
|
|
|
399
398
|
_: 3
|
|
400
399
|
}, 16)) : F("", !0), (W = e.value) != null && W.showActionButtonGroup && !((j = e.value) != null && j.actionInline) ? (l(), c(tt, d(v({
|
|
401
400
|
key: 1
|
|
402
|
-
}, K.value)), null, 16)) : F("", !0),
|
|
401
|
+
}, K.value)), null, 16)) : F("", !0), O(t.$slots, "formFooter")];
|
|
403
402
|
}),
|
|
404
403
|
_: 3
|
|
405
404
|
}, 16, ["class", "model", "onKeypress"])) : F("", !0);
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
import type { ButtonProps, ColProps, RowProps } from 'vft/es/components';
|
|
2
|
+
import type { FormItemProp, FormItemProps, FormProps } from 'vft/es/components/form';
|
|
3
|
+
import type { InternalRuleItem, RuleItem } from 'async-validator';
|
|
4
|
+
import type { StyleValue, VNode } from 'vue';
|
|
5
|
+
import { FormCompEnum } from './component-map';
|
|
6
|
+
import type { Arrayable, Recordable } from '../types';
|
|
7
|
+
export type ButtonOptions = Partial<ButtonProps> & {
|
|
8
|
+
btnText?: string;
|
|
9
|
+
};
|
|
10
|
+
export type InternalNamePath = (string | number)[];
|
|
11
|
+
export type NamePath = string | number | InternalNamePath;
|
|
12
|
+
export type FieldMapToTime = [
|
|
13
|
+
string,
|
|
14
|
+
[
|
|
15
|
+
string,
|
|
16
|
+
string
|
|
17
|
+
],
|
|
18
|
+
(string | [string, string])?
|
|
19
|
+
][];
|
|
20
|
+
export type Rule = {
|
|
21
|
+
trigger?: 'blur' | 'change' | ['change', 'blur'];
|
|
22
|
+
};
|
|
23
|
+
type FormItemRule = Omit<RuleItem, 'validator'> & Rule & {
|
|
24
|
+
validator?: (rule: InternalRuleItem, value: any, callback?: (error?: string | Error) => void) => Promise<any>;
|
|
25
|
+
} & {
|
|
26
|
+
isNumber?: boolean;
|
|
27
|
+
};
|
|
28
|
+
export interface RenderCallbackParams {
|
|
29
|
+
schema: FormSchema;
|
|
30
|
+
values: Recordable;
|
|
31
|
+
model: Recordable;
|
|
32
|
+
field: string;
|
|
33
|
+
}
|
|
34
|
+
export interface FormActionType {
|
|
35
|
+
submit: () => Promise<void>;
|
|
36
|
+
setFieldsValue: (values: Recordable) => Promise<void>;
|
|
37
|
+
resetFields: (props?: FormItemProp | FormItemProp[]) => Promise<void>;
|
|
38
|
+
getFieldsValue: () => Recordable;
|
|
39
|
+
getFieldValue: (field: string) => string | number | Recordable;
|
|
40
|
+
clearValidate: (name?: string | string[]) => Promise<void>;
|
|
41
|
+
updateSchema: (data: Partial<FormSchema> | Partial<FormSchema>[]) => Promise<void>;
|
|
42
|
+
resetSchema: (data: Partial<FormSchema> | Partial<FormSchema>[]) => Promise<void>;
|
|
43
|
+
setProps: (formProps: Partial<SuperFormProps>) => Promise<void>;
|
|
44
|
+
removeSchemaByField: (field: string | string[]) => Promise<void>;
|
|
45
|
+
setSubmitLoading: (loading?: boolean) => Promise<void>;
|
|
46
|
+
appendSchemaByField: (schema: FormSchema | FormSchema[], prefixField: string | undefined, first?: boolean | undefined) => Promise<void>;
|
|
47
|
+
validateField: (nameList?: NamePath[]) => Promise<any>;
|
|
48
|
+
validate: (nameList?: NamePath[]) => Promise<any>;
|
|
49
|
+
scrollToField: (name: NamePath, options?: ScrollOptions) => Promise<void>;
|
|
50
|
+
setFormItemError: (field: string, errMess: string) => Promise<void>;
|
|
51
|
+
}
|
|
52
|
+
export interface SuperFormActionProps {
|
|
53
|
+
showResetButton?: boolean;
|
|
54
|
+
showSubmitButton?: boolean;
|
|
55
|
+
showCommonButton?: boolean;
|
|
56
|
+
resetButtonOptions?: ButtonOptions;
|
|
57
|
+
submitButtonOptions?: ButtonOptions;
|
|
58
|
+
commonButtonOptions?: ButtonOptions;
|
|
59
|
+
actionRowOptions?: Partial<RowProps>;
|
|
60
|
+
}
|
|
61
|
+
type FormInnerProps = FormProps & SuperFormActionProps;
|
|
62
|
+
export interface SuperFormProps extends FormInnerProps {
|
|
63
|
+
/** 配置表单的 RowProps */
|
|
64
|
+
rowProps?: RowProps;
|
|
65
|
+
/** 配置所有选子项的 ColProps */
|
|
66
|
+
baseColProps?: Partial<ColProps>;
|
|
67
|
+
/** 根据 1/2/3...快速分列 */
|
|
68
|
+
quickColSpan?: number;
|
|
69
|
+
/** 自动设置占位符 */
|
|
70
|
+
autoSetPlaceHolder?: boolean;
|
|
71
|
+
/** 表单配置 */
|
|
72
|
+
schemas?: FormSchema[];
|
|
73
|
+
/** 是否聚焦第一个输入框,只在第一个表单项为 input 的时候作用 */
|
|
74
|
+
autoFocusFirstItem?: boolean;
|
|
75
|
+
/** 重置时是否提交表单 */
|
|
76
|
+
submitOnReset?: boolean;
|
|
77
|
+
/** 额外传递到子组件的参数 values */
|
|
78
|
+
mergeDynamicData?: Recordable;
|
|
79
|
+
/** 将表单内时间区域的值映射成 2 个字段 */
|
|
80
|
+
fieldMapToTime?: FieldMapToTime;
|
|
81
|
+
/** 在input中输入时按回车自动提交 */
|
|
82
|
+
autoSubmitOnEnter?: boolean;
|
|
83
|
+
/** 如果表单项有校验,会自动生成校验信息,该参数控制是否将字段中文名字拼接到自动生成的信息后方 */
|
|
84
|
+
rulesMessageJoinLabel?: boolean;
|
|
85
|
+
/** 表单改变时触发提交 */
|
|
86
|
+
submitOnChange?: boolean;
|
|
87
|
+
/** 是否显示操作按钮(重置/提交) */
|
|
88
|
+
showActionButtonGroup?: boolean;
|
|
89
|
+
/** 自动清除报错信息 */
|
|
90
|
+
autoCleanErrorMessage?: boolean;
|
|
91
|
+
/** 提交前置事件 */
|
|
92
|
+
beforeSubmitFunc?: () => Promise<void>;
|
|
93
|
+
/** 提交 */
|
|
94
|
+
submitFunc?: () => Promise<void>;
|
|
95
|
+
/** 监听数据是否发生改变 */
|
|
96
|
+
watchDataIsChange?: boolean;
|
|
97
|
+
/** Form 下组件宽度是否撑满 */
|
|
98
|
+
compFullWidth?: boolean;
|
|
99
|
+
/** 操作栏是否为行内 */
|
|
100
|
+
actionInline?: boolean;
|
|
101
|
+
/** 自定义 reset 事件 */
|
|
102
|
+
resetFunc?: () => Promise<void>;
|
|
103
|
+
}
|
|
104
|
+
export interface FormSchema {
|
|
105
|
+
/** 字段 key */
|
|
106
|
+
field: string;
|
|
107
|
+
/** 名称 label title 都可以 */
|
|
108
|
+
label?: string | VNode;
|
|
109
|
+
title?: string | VNode;
|
|
110
|
+
/** 值改变的触发事件 */
|
|
111
|
+
changeEvent?: string;
|
|
112
|
+
/** v-model 绑定的 value 值 */
|
|
113
|
+
valueField?: string;
|
|
114
|
+
/** 子 label */
|
|
115
|
+
subLabel?: string;
|
|
116
|
+
/** 是否显示 label */
|
|
117
|
+
showLabel?: boolean;
|
|
118
|
+
/** 标签宽度,如果通过,则 itemProps 配置的 labelCol 和 WrapperCol 将无效 */
|
|
119
|
+
labelWidth?: string | number;
|
|
120
|
+
/** 渲染组件 */
|
|
121
|
+
type?: FormCompEnum;
|
|
122
|
+
/** 组件内置参数 */
|
|
123
|
+
componentProps?: ((opt: {
|
|
124
|
+
schema: FormSchema;
|
|
125
|
+
formActionType: FormActionType;
|
|
126
|
+
formModel: Recordable;
|
|
127
|
+
}) => Recordable) | object;
|
|
128
|
+
/** 是否为必填项 */
|
|
129
|
+
required?: boolean | ((renderCallbackParams: RenderCallbackParams) => boolean);
|
|
130
|
+
/** 组件后自定义内容 */
|
|
131
|
+
suffix?: string | number | ((values: RenderCallbackParams) => string | number) | VNode | JSX.Element | (() => JSX.Element);
|
|
132
|
+
/** 组件前自定义内容 */
|
|
133
|
+
prefix?: string | number | ((values: RenderCallbackParams) => string | number) | VNode | JSX.Element | (() => JSX.Element);
|
|
134
|
+
/** 前置内容父级样式 */
|
|
135
|
+
prefixParentStyle?: StyleValue;
|
|
136
|
+
/** 自定义规则 */
|
|
137
|
+
rules?: FormItemRule[] | FormItemRule;
|
|
138
|
+
/** 自定义报错规则是否添加自动添加 label */
|
|
139
|
+
rulesMessageJoinLabel?: boolean;
|
|
140
|
+
/** 自动生成 placeholder */
|
|
141
|
+
placeholderJoinLabel?: boolean;
|
|
142
|
+
/** form-item 参数 */
|
|
143
|
+
itemProps?: Partial<FormItemProps & {
|
|
144
|
+
title: string;
|
|
145
|
+
}>;
|
|
146
|
+
/** col 参数 */
|
|
147
|
+
colProps?: Partial<ColProps>;
|
|
148
|
+
/** 根据 1/2/3...快速分列 */
|
|
149
|
+
quickColSpan?: number;
|
|
150
|
+
/** 默认值 */
|
|
151
|
+
defaultValue?: any;
|
|
152
|
+
/** 是否自动处理与时间相关组件的默认值 */
|
|
153
|
+
isHandleDateDefaultValue?: boolean;
|
|
154
|
+
/** 栅格占据的列数 */
|
|
155
|
+
span?: number;
|
|
156
|
+
/** 动态判断当前组件是否显示,js 控制,会删除 dom */
|
|
157
|
+
ifShow?: boolean | ((renderCallbackParams: RenderCallbackParams) => boolean);
|
|
158
|
+
/** 动态判断当前组件是否显示,css 控制,不会删除 dom */
|
|
159
|
+
show?: boolean | ((renderCallbackParams: RenderCallbackParams) => boolean);
|
|
160
|
+
/** 自定义渲染组件*/
|
|
161
|
+
render?: (renderCallbackParams: RenderCallbackParams) => VNode | VNode[] | string;
|
|
162
|
+
/** 自定义渲染组件(需要自行包含 formItem)*/
|
|
163
|
+
renderColContent?: (renderCallbackParams: RenderCallbackParams) => VNode | VNode[] | string;
|
|
164
|
+
/** 自定义渲染组内部的 slot */
|
|
165
|
+
renderComponentContent?: ((renderCallbackParams: RenderCallbackParams) => any) | VNode | VNode[] | string;
|
|
166
|
+
/** 自定义 slot,渲染组件 */
|
|
167
|
+
slot?: string;
|
|
168
|
+
/** 自定义 slot,渲染组件 (需要自行包含 formItem)*/
|
|
169
|
+
colSlot?: string;
|
|
170
|
+
/** 动态判断当前组件是否禁用 */
|
|
171
|
+
dynamicDisabled?: boolean | ((renderCallbackParams: RenderCallbackParams) => boolean);
|
|
172
|
+
/** 动态判返当前组件你校验规则 */
|
|
173
|
+
dynamicRule?: (renderCallbackParams: RenderCallbackParams) => Arrayable<FormItemRule>;
|
|
174
|
+
dynamicRuleAdd?: boolean;
|
|
175
|
+
}
|
|
176
|
+
export {};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { ComputedRef, Ref } from 'vue';
|
|
2
|
+
import type { Fn, Recordable } from '../../types';
|
|
3
|
+
import type { FormActionType, FormSchema, SuperFormProps } from '../types';
|
|
4
|
+
interface UseFormActionContext {
|
|
5
|
+
emit: any;
|
|
6
|
+
getProps: ComputedRef<SuperFormProps>;
|
|
7
|
+
getSchema: ComputedRef<FormSchema[]>;
|
|
8
|
+
formModel: Recordable;
|
|
9
|
+
defaultValueRef: Ref<Recordable>;
|
|
10
|
+
formElRef: Ref<FormActionType>;
|
|
11
|
+
schemaRef: Ref<FormSchema[]>;
|
|
12
|
+
handleFormValues: Fn;
|
|
13
|
+
initValues: Ref<Recordable>;
|
|
14
|
+
}
|
|
15
|
+
export declare function useFormEvents({ emit, getProps, formModel, getSchema, defaultValueRef, formElRef, schemaRef, handleFormValues, initValues, }: UseFormActionContext): {
|
|
16
|
+
handleSubmit: (e?: Event) => Promise<void>;
|
|
17
|
+
clearValidate: (name?: string | string[]) => Promise<void>;
|
|
18
|
+
validate: (nameList?: any[] | undefined) => Promise<any>;
|
|
19
|
+
validateField: (nameList?: any[] | undefined) => Promise<any>;
|
|
20
|
+
getFieldsValue: () => Recordable;
|
|
21
|
+
updateSchema: (data: Partial<FormSchema> | Partial<FormSchema>[]) => Promise<void>;
|
|
22
|
+
resetSchema: (data: Partial<FormSchema> | Partial<FormSchema>[]) => Promise<void>;
|
|
23
|
+
appendSchemaByField: (schema: FormSchema | FormSchema[], prefixField?: string, first?: boolean) => Promise<void>;
|
|
24
|
+
removeSchemaByField: (fields: string | string[]) => Promise<void>;
|
|
25
|
+
resetFields: (props: any) => Promise<void>;
|
|
26
|
+
setFieldsValue: (values: Recordable) => Promise<void>;
|
|
27
|
+
scrollToField: (name: any, options?: ScrollOptions | undefined) => Promise<void>;
|
|
28
|
+
getFieldValue: (field: string) => string | number | Recordable;
|
|
29
|
+
};
|
|
30
|
+
export {};
|