@movk/nuxt 1.2.0 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.nuxt/movk-ui.css +3 -0
- package/README.md +74 -79
- package/dist/module.d.mts +57 -1
- package/dist/module.json +2 -2
- package/dist/module.mjs +120 -126
- package/dist/runtime/components/AutoForm.d.vue.ts +10 -30
- package/dist/runtime/components/AutoForm.vue +114 -125
- package/dist/runtime/components/AutoForm.vue.d.ts +10 -30
- package/dist/runtime/components/ColorChooser.d.vue.ts +21 -22
- package/dist/runtime/components/ColorChooser.vue +304 -27
- package/dist/runtime/components/ColorChooser.vue.d.ts +21 -22
- package/dist/runtime/components/DataTable.d.vue.ts +57 -0
- package/dist/runtime/components/DataTable.vue +584 -0
- package/dist/runtime/components/DataTable.vue.d.ts +57 -0
- package/dist/runtime/components/DatePicker.d.vue.ts +20 -33
- package/dist/runtime/components/DatePicker.vue +173 -65
- package/dist/runtime/components/DatePicker.vue.d.ts +20 -33
- package/dist/runtime/components/MessageBox.d.vue.ts +36 -0
- package/dist/runtime/components/MessageBox.vue +113 -0
- package/dist/runtime/components/MessageBox.vue.d.ts +36 -0
- package/dist/runtime/components/PillGroup.d.vue.ts +33 -0
- package/dist/runtime/components/PillGroup.vue +291 -0
- package/dist/runtime/components/PillGroup.vue.d.ts +33 -0
- package/dist/runtime/components/Popconfirm.d.vue.ts +30 -0
- package/dist/runtime/components/Popconfirm.vue +143 -0
- package/dist/runtime/components/Popconfirm.vue.d.ts +30 -0
- package/dist/runtime/components/SearchForm.d.vue.ts +21 -149
- package/dist/runtime/components/SearchForm.vue +211 -153
- package/dist/runtime/components/SearchForm.vue.d.ts +21 -149
- package/dist/runtime/components/SlideVerify.d.vue.ts +31 -70
- package/dist/runtime/components/SlideVerify.vue +117 -90
- package/dist/runtime/components/SlideVerify.vue.d.ts +31 -70
- package/dist/runtime/components/StarRating.d.vue.ts +38 -87
- package/dist/runtime/components/StarRating.vue +118 -74
- package/dist/runtime/components/StarRating.vue.d.ts +38 -87
- package/dist/runtime/components/input/AsPhoneNumberInput.d.vue.ts +11 -15
- package/dist/runtime/components/input/AsPhoneNumberInput.vue +22 -9
- package/dist/runtime/components/input/AsPhoneNumberInput.vue.d.ts +11 -15
- package/dist/runtime/components/input/WithCharacterLimit.d.vue.ts +11 -13
- package/dist/runtime/components/input/WithCharacterLimit.vue +23 -11
- package/dist/runtime/components/input/WithCharacterLimit.vue.d.ts +11 -13
- package/dist/runtime/components/input/WithClear.d.vue.ts +13 -11
- package/dist/runtime/components/input/WithClear.vue +27 -8
- package/dist/runtime/components/input/WithClear.vue.d.ts +13 -11
- package/dist/runtime/components/input/WithCopy.d.vue.ts +13 -13
- package/dist/runtime/components/input/WithCopy.vue +25 -8
- package/dist/runtime/components/input/WithCopy.vue.d.ts +13 -13
- package/dist/runtime/components/input/WithFloatingLabel.d.vue.ts +13 -16
- package/dist/runtime/components/input/WithFloatingLabel.vue +35 -27
- package/dist/runtime/components/input/WithFloatingLabel.vue.d.ts +13 -16
- package/dist/runtime/components/input/WithPasswordToggle.d.vue.ts +11 -7
- package/dist/runtime/components/input/WithPasswordToggle.vue +24 -7
- package/dist/runtime/components/input/WithPasswordToggle.vue.d.ts +11 -7
- package/dist/runtime/components/theme-picker/ThemePicker.d.vue.ts +8 -1
- package/dist/runtime/components/theme-picker/ThemePicker.vue +27 -12
- package/dist/runtime/components/theme-picker/ThemePicker.vue.d.ts +8 -1
- package/dist/runtime/components/theme-picker/ThemePickerButton.d.vue.ts +9 -4
- package/dist/runtime/components/theme-picker/ThemePickerButton.vue +4 -0
- package/dist/runtime/components/theme-picker/ThemePickerButton.vue.d.ts +9 -4
- package/dist/runtime/composables/index.d.ts +9 -8
- package/dist/runtime/composables/index.js +1 -0
- package/dist/runtime/composables/useApiFetch.d.ts +10 -5
- package/dist/runtime/composables/useApiFetch.js +20 -2
- package/dist/runtime/composables/useAutoForm.d.ts +4 -4
- package/dist/runtime/composables/useAutoForm.js +23 -9
- package/dist/runtime/composables/useClientApiFetch.d.ts +3 -2
- package/dist/runtime/composables/useDateFormatter.d.ts +16 -3
- package/dist/runtime/composables/useDateFormatter.js +89 -30
- package/dist/runtime/composables/useDownloadWithProgress.d.ts +26 -27
- package/dist/runtime/composables/useDownloadWithProgress.js +142 -40
- package/dist/runtime/composables/useLazyApiFetch.d.ts +3 -2
- package/dist/runtime/composables/useMessageBox.d.ts +6 -0
- package/dist/runtime/composables/useMessageBox.js +16 -0
- package/dist/runtime/composables/useTheme.d.ts +26 -16
- package/dist/runtime/composables/useTheme.js +98 -71
- package/dist/runtime/composables/useUploadWithProgress.d.ts +23 -29
- package/dist/runtime/composables/useUploadWithProgress.js +78 -67
- package/dist/runtime/domains/api/auth.d.ts +2 -0
- package/dist/runtime/domains/api/auth.js +31 -0
- package/dist/runtime/domains/api/endpoint-config.d.ts +11 -0
- package/dist/runtime/domains/api/endpoint-config.js +17 -0
- package/dist/runtime/domains/api/errors.d.ts +2 -0
- package/dist/runtime/domains/api/errors.js +10 -0
- package/dist/runtime/domains/api/fetch-key.d.ts +20 -0
- package/dist/runtime/domains/api/fetch-key.js +23 -0
- package/dist/runtime/domains/api/interceptors/error.d.ts +13 -0
- package/dist/runtime/domains/api/interceptors/error.js +49 -0
- package/dist/runtime/domains/api/interceptors/request.d.ts +12 -0
- package/dist/runtime/domains/api/interceptors/request.js +46 -0
- package/dist/runtime/domains/api/interceptors/response.d.ts +17 -0
- package/dist/runtime/domains/api/interceptors/response.js +27 -0
- package/dist/runtime/domains/api/response.d.ts +4 -0
- package/dist/runtime/domains/api/response.js +14 -0
- package/dist/runtime/domains/api/toast.d.ts +15 -0
- package/dist/runtime/domains/api/toast.js +46 -0
- package/dist/runtime/domains/api/transfer.d.ts +69 -0
- package/dist/runtime/domains/api/transfer.js +81 -0
- package/dist/runtime/domains/auto-form/actions.d.ts +2 -0
- package/dist/runtime/domains/auto-form/actions.js +4 -0
- package/dist/runtime/domains/auto-form/components/Array.d.vue.ts +13 -0
- package/dist/runtime/{components/auto-form-renderer/AutoFormRendererArray.vue → domains/auto-form/components/Array.vue} +25 -29
- package/dist/runtime/domains/auto-form/components/Array.vue.d.ts +13 -0
- package/dist/runtime/domains/auto-form/components/Children.d.vue.ts +11 -0
- package/dist/runtime/{components/auto-form-renderer/AutoFormRendererChildren.vue → domains/auto-form/components/Children.vue} +18 -18
- package/dist/runtime/domains/auto-form/components/Children.vue.d.ts +11 -0
- package/dist/runtime/domains/auto-form/components/Field.d.vue.ts +11 -0
- package/dist/runtime/domains/auto-form/components/Field.vue +56 -0
- package/dist/runtime/domains/auto-form/components/Field.vue.d.ts +11 -0
- package/dist/runtime/domains/auto-form/components/Layout.d.vue.ts +11 -0
- package/dist/runtime/{components/auto-form-renderer/AutoFormRendererLayout.vue → domains/auto-form/components/Layout.vue} +24 -25
- package/dist/runtime/domains/auto-form/components/Layout.vue.d.ts +11 -0
- package/dist/runtime/domains/auto-form/components/Nested.d.vue.ts +11 -0
- package/dist/runtime/{components/auto-form-renderer/AutoFormRendererNested.vue → domains/auto-form/components/Nested.vue} +17 -21
- package/dist/runtime/domains/auto-form/components/Nested.vue.d.ts +11 -0
- package/dist/runtime/domains/auto-form/controls.d.ts +41 -0
- package/dist/runtime/{auto-form → domains/auto-form}/controls.js +27 -24
- package/dist/runtime/{auto-form/field-utils.d.ts → domains/auto-form/fields.d.ts} +3 -1
- package/dist/runtime/{auto-form/field-utils.js → domains/auto-form/fields.js} +18 -2
- package/dist/runtime/{auto-form → domains/auto-form}/metadata.js +1 -1
- package/dist/runtime/domains/auto-form/provider.d.ts +62 -0
- package/dist/runtime/{auto-form → domains/auto-form}/provider.js +6 -3
- package/dist/runtime/{auto-form/reactive-utils.d.ts → domains/auto-form/reactive.d.ts} +5 -5
- package/dist/runtime/{auto-form/reactive-utils.js → domains/auto-form/reactive.js} +1 -1
- package/dist/runtime/{auto-form/schema-introspector.d.ts → domains/auto-form/schema.d.ts} +2 -2
- package/dist/runtime/{auto-form/schema-introspector.js → domains/auto-form/schema.js} +1 -1
- package/dist/runtime/domains/data-table/columns/constants.d.ts +50 -0
- package/dist/runtime/domains/data-table/columns/constants.js +19 -0
- package/dist/runtime/domains/data-table/columns/resolve-columns.d.ts +4 -0
- package/dist/runtime/domains/data-table/columns/resolve-columns.js +59 -0
- package/dist/runtime/domains/data-table/columns/resolve-data-column.d.ts +9 -0
- package/dist/runtime/domains/data-table/columns/resolve-data-column.js +164 -0
- package/dist/runtime/domains/data-table/columns/resolve-group-column.d.ts +4 -0
- package/dist/runtime/domains/data-table/columns/resolve-group-column.js +19 -0
- package/dist/runtime/domains/data-table/columns/resolve-special-columns.d.ts +8 -0
- package/dist/runtime/domains/data-table/columns/resolve-special-columns.js +232 -0
- package/dist/runtime/domains/data-table/columns/style.d.ts +11 -0
- package/dist/runtime/domains/data-table/columns/style.js +67 -0
- package/dist/runtime/domains/data-table/columns/utils.d.ts +6 -0
- package/dist/runtime/domains/data-table/columns/utils.js +16 -0
- package/dist/runtime/domains/data-table/components/ActionConfirm.d.vue.ts +10 -0
- package/dist/runtime/domains/data-table/components/ActionConfirm.vue +39 -0
- package/dist/runtime/domains/data-table/components/ActionConfirm.vue.d.ts +10 -0
- package/dist/runtime/domains/data-table/components/ActionsCell.d.vue.ts +11 -0
- package/dist/runtime/domains/data-table/components/ActionsCell.vue +91 -0
- package/dist/runtime/domains/data-table/components/ActionsCell.vue.d.ts +11 -0
- package/dist/runtime/domains/data-table/components/CellTooltip.d.vue.ts +9 -0
- package/dist/runtime/domains/data-table/components/CellTooltip.vue +40 -0
- package/dist/runtime/domains/data-table/components/CellTooltip.vue.d.ts +9 -0
- package/dist/runtime/domains/data-table/components/Pagination.d.vue.ts +26 -0
- package/dist/runtime/domains/data-table/components/Pagination.vue +132 -0
- package/dist/runtime/domains/data-table/components/Pagination.vue.d.ts +26 -0
- package/dist/runtime/domains/data-table/indent.d.ts +8 -0
- package/dist/runtime/domains/data-table/indent.js +19 -0
- package/dist/runtime/domains/data-table/tree-selection.d.ts +9 -0
- package/dist/runtime/domains/data-table/tree-selection.js +76 -0
- package/dist/runtime/{utils/theme.d.ts → domains/theme/theme-icons.d.ts} +0 -1
- package/dist/runtime/index.css +1 -0
- package/dist/runtime/plugins/api.factory.js +17 -117
- package/dist/runtime/plugins/theme.js +49 -27
- package/dist/runtime/types/api/config.d.ts +127 -0
- package/dist/runtime/types/api/fetch.d.ts +50 -0
- package/dist/runtime/types/api/index.d.ts +5 -0
- package/dist/runtime/types/api/module.d.ts +94 -0
- package/dist/runtime/types/api/response.d.ts +62 -0
- package/dist/runtime/types/api/response.js +0 -0
- package/dist/runtime/types/api/transfer.d.ts +32 -0
- package/dist/runtime/types/api/transfer.js +0 -0
- package/dist/runtime/types/app.config.d.ts +6 -0
- package/dist/runtime/types/auto-form/base.d.ts +26 -0
- package/dist/runtime/types/auto-form/base.js +0 -0
- package/dist/runtime/types/auto-form/component.d.ts +28 -0
- package/dist/runtime/types/auto-form/component.js +0 -0
- package/dist/runtime/types/auto-form/controls.d.ts +45 -0
- package/dist/runtime/types/auto-form/controls.js +0 -0
- package/dist/runtime/types/auto-form/fields.d.ts +68 -0
- package/dist/runtime/types/auto-form/fields.js +0 -0
- package/dist/runtime/types/auto-form/index.d.ts +7 -0
- package/dist/runtime/types/auto-form/index.js +0 -0
- package/dist/runtime/types/auto-form/search-form.d.ts +84 -0
- package/dist/runtime/types/auto-form/search-form.js +0 -0
- package/dist/runtime/types/auto-form/slots.d.ts +85 -0
- package/dist/runtime/types/auto-form/slots.js +0 -0
- package/dist/runtime/types/auto-form/zod-factory.d.ts +127 -0
- package/dist/runtime/types/auto-form/zod-factory.js +0 -0
- package/dist/runtime/types/components/color-chooser.d.ts +109 -0
- package/dist/runtime/types/components/color-chooser.js +0 -0
- package/dist/runtime/types/components/date-picker.d.ts +41 -0
- package/dist/runtime/types/components/date-picker.js +0 -0
- package/dist/runtime/types/components/index.d.ts +8 -0
- package/dist/runtime/types/components/index.js +0 -0
- package/dist/runtime/types/components/input/as-phone-number-input.d.ts +17 -0
- package/dist/runtime/types/components/input/as-phone-number-input.js +0 -0
- package/dist/runtime/types/components/input/index.d.ts +6 -0
- package/dist/runtime/types/components/input/index.js +0 -0
- package/dist/runtime/types/components/input/with-character-limit.d.ts +11 -0
- package/dist/runtime/types/components/input/with-character-limit.js +0 -0
- package/dist/runtime/types/components/input/with-clear.d.ts +10 -0
- package/dist/runtime/types/components/input/with-clear.js +0 -0
- package/dist/runtime/types/components/input/with-copy.d.ts +11 -0
- package/dist/runtime/types/components/input/with-copy.js +0 -0
- package/dist/runtime/types/components/input/with-floating-label.d.ts +12 -0
- package/dist/runtime/types/components/input/with-floating-label.js +0 -0
- package/dist/runtime/types/components/input/with-password-toggle.d.ts +7 -0
- package/dist/runtime/types/components/input/with-password-toggle.js +0 -0
- package/dist/runtime/types/components/message-box.d.ts +69 -0
- package/dist/runtime/types/components/message-box.js +0 -0
- package/dist/runtime/types/components/pill-group.d.ts +103 -0
- package/dist/runtime/types/components/pill-group.js +0 -0
- package/dist/runtime/types/components/popconfirm.d.ts +74 -0
- package/dist/runtime/types/components/popconfirm.js +0 -0
- package/dist/runtime/types/components/slide-verify.d.ts +54 -0
- package/dist/runtime/types/components/slide-verify.js +0 -0
- package/dist/runtime/types/components/star-rating.d.ts +55 -0
- package/dist/runtime/types/components/star-rating.js +0 -0
- package/dist/runtime/types/data-table/columns.d.ts +236 -0
- package/dist/runtime/types/data-table/columns.js +6 -0
- package/dist/runtime/types/data-table/component.d.ts +190 -0
- package/dist/runtime/types/data-table/component.js +0 -0
- package/dist/runtime/types/data-table/contexts.d.ts +44 -0
- package/dist/runtime/types/data-table/contexts.js +0 -0
- package/dist/runtime/types/data-table/index.d.ts +6 -0
- package/dist/runtime/types/data-table/index.js +1 -0
- package/dist/runtime/types/data-table/pagination.d.ts +87 -0
- package/dist/runtime/types/data-table/pagination.js +0 -0
- package/dist/runtime/types/index.d.ts +6 -5
- package/dist/runtime/types/index.js +5 -5
- package/dist/runtime/types/shared.d.ts +5 -0
- package/dist/runtime/types/shared.js +0 -0
- package/dist/runtime/types/zod.d.ts +11 -10
- package/dist/runtime/utils/extend-theme.d.ts +19 -0
- package/dist/runtime/utils/extend-theme.js +44 -0
- package/dist/runtime/utils/form-control.d.ts +33 -0
- package/dist/runtime/utils/form-control.js +54 -0
- package/dist/runtime/utils/meta.d.ts +2 -5
- package/dist/runtime/utils/meta.js +1 -3
- package/dist/runtime/utils/theme-defaults.d.ts +27 -0
- package/dist/runtime/utils/theme-defaults.js +28 -0
- package/dist/runtime/utils/tv.d.ts +1 -0
- package/dist/runtime/utils/tv.js +4 -0
- package/dist/runtime/vue/composables/useSiteConfig.d.ts +13 -0
- package/dist/runtime/vue/composables/useSiteConfig.js +11 -0
- package/dist/runtime/vue/plugins/theme.d.ts +6 -0
- package/dist/runtime/vue/plugins/theme.js +14 -0
- package/dist/runtime/vue/stubs/base.d.ts +2 -0
- package/dist/runtime/vue/stubs/base.js +2 -0
- package/dist/runtime/vue/stubs/inertia.d.ts +2 -0
- package/dist/runtime/vue/stubs/inertia.js +2 -0
- package/dist/runtime/vue/stubs/movk-extra.d.ts +2 -0
- package/dist/runtime/vue/stubs/movk-extra.js +2 -0
- package/dist/runtime/vue/stubs/none.d.ts +2 -0
- package/dist/runtime/vue/stubs/none.js +2 -0
- package/dist/runtime/vue/stubs/vue-router.d.ts +2 -0
- package/dist/runtime/vue/stubs/vue-router.js +2 -0
- package/dist/shared/nuxt.DfBEyjld.mjs +667 -0
- package/dist/types.d.mts +2 -6
- package/dist/unplugin.d.mts +28 -0
- package/dist/unplugin.mjs +292 -0
- package/dist/vite.d.mts +12 -0
- package/dist/vite.mjs +20 -0
- package/package.json +75 -36
- package/vue-plugin.d.ts +5 -0
- package/dist/runtime/auto-form/controls.d.ts +0 -221
- package/dist/runtime/auto-form/provider.d.ts +0 -27
- package/dist/runtime/components/auto-form-renderer/AutoFormRendererArray.d.vue.ts +0 -28
- package/dist/runtime/components/auto-form-renderer/AutoFormRendererArray.vue.d.ts +0 -28
- package/dist/runtime/components/auto-form-renderer/AutoFormRendererChildren.d.vue.ts +0 -26
- package/dist/runtime/components/auto-form-renderer/AutoFormRendererChildren.vue.d.ts +0 -26
- package/dist/runtime/components/auto-form-renderer/AutoFormRendererField.d.vue.ts +0 -26
- package/dist/runtime/components/auto-form-renderer/AutoFormRendererField.vue +0 -55
- package/dist/runtime/components/auto-form-renderer/AutoFormRendererField.vue.d.ts +0 -26
- package/dist/runtime/components/auto-form-renderer/AutoFormRendererLayout.d.vue.ts +0 -26
- package/dist/runtime/components/auto-form-renderer/AutoFormRendererLayout.vue.d.ts +0 -26
- package/dist/runtime/components/auto-form-renderer/AutoFormRendererNested.d.vue.ts +0 -26
- package/dist/runtime/components/auto-form-renderer/AutoFormRendererNested.vue.d.ts +0 -26
- package/dist/runtime/constants/api-defaults.d.ts +0 -9
- package/dist/runtime/constants/api-defaults.js +0 -32
- package/dist/runtime/constants/grid-cols.d.ts +0 -7
- package/dist/runtime/constants/grid-cols.js +0 -44
- package/dist/runtime/style.css +0 -1
- package/dist/runtime/types/api.d.ts +0 -349
- package/dist/runtime/types/auto-form.d.ts +0 -259
- package/dist/runtime/types/module.d.ts +0 -96
- package/dist/runtime/types/theme.d.ts +0 -2
- package/dist/runtime/utils/api-utils.d.ts +0 -58
- package/dist/runtime/utils/api-utils.js +0 -98
- /package/dist/runtime/{constants/auto-form.d.ts → domains/auto-form/constants.d.ts} +0 -0
- /package/dist/runtime/{constants/auto-form.js → domains/auto-form/constants.js} +0 -0
- /package/dist/runtime/{auto-form → domains/auto-form}/metadata.d.ts +0 -0
- /package/dist/runtime/{utils/theme.js → domains/theme/theme-icons.js} +0 -0
- /package/dist/runtime/types/{api.js → api/config.js} +0 -0
- /package/dist/runtime/types/{auto-form.js → api/fetch.js} +0 -0
- /package/dist/runtime/types/{module.js → api/index.js} +0 -0
- /package/dist/runtime/types/{theme.js → api/module.js} +0 -0
|
@@ -1,164 +1,36 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ComponentConfig, InferInput } from '@nuxt/ui';
|
|
2
2
|
import type { z } from 'zod';
|
|
3
|
-
import type {
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* 网格列数
|
|
12
|
-
* @defaultValue 3
|
|
13
|
-
*/
|
|
14
|
-
cols?: number | {
|
|
15
|
-
sm?: number;
|
|
16
|
-
md?: number;
|
|
17
|
-
lg?: number;
|
|
18
|
-
xl?: number;
|
|
19
|
-
};
|
|
20
|
-
/**
|
|
21
|
-
* 可见行数(折叠时显示的行数)
|
|
22
|
-
* @defaultValue 1
|
|
23
|
-
*/
|
|
24
|
-
visibleRows?: number;
|
|
25
|
-
/**
|
|
26
|
-
* 自定义控件映射(复用 AutoForm 的控件系统)
|
|
27
|
-
*/
|
|
28
|
-
controls?: AutoFormControls;
|
|
29
|
-
/**
|
|
30
|
-
* 全局字段元数据
|
|
31
|
-
*/
|
|
32
|
-
globalMeta?: ZodAutoFormFieldMeta;
|
|
33
|
-
/**
|
|
34
|
-
* 搜索按钮属性
|
|
35
|
-
*/
|
|
36
|
-
searchButtonProps?: ButtonProps;
|
|
37
|
-
/**
|
|
38
|
-
* 重置按钮属性
|
|
39
|
-
*/
|
|
40
|
-
resetButtonProps?: ButtonProps;
|
|
41
|
-
/**
|
|
42
|
-
* 搜索按钮文本
|
|
43
|
-
* @defaultValue '搜索'
|
|
44
|
-
*/
|
|
45
|
-
searchText?: string;
|
|
46
|
-
/**
|
|
47
|
-
* 重置按钮文本
|
|
48
|
-
* @defaultValue '重置'
|
|
49
|
-
*/
|
|
50
|
-
resetText?: string;
|
|
51
|
-
/**
|
|
52
|
-
* 是否显示搜索按钮
|
|
53
|
-
* @defaultValue true
|
|
54
|
-
*/
|
|
55
|
-
showSearchButton?: boolean;
|
|
56
|
-
/**
|
|
57
|
-
* 是否显示重置按钮
|
|
58
|
-
* @defaultValue true
|
|
59
|
-
*/
|
|
60
|
-
showResetButton?: boolean;
|
|
61
|
-
/**
|
|
62
|
-
* 搜索按钮加载状态
|
|
63
|
-
* @defaultValue false
|
|
64
|
-
*/
|
|
65
|
-
loading?: boolean;
|
|
66
|
-
/**
|
|
67
|
-
* 展开/收起按钮图标
|
|
68
|
-
* @defaultValue 'i-lucide-chevron-down'
|
|
69
|
-
*/
|
|
70
|
-
icon?: string;
|
|
71
|
-
/**
|
|
72
|
-
* 展开按钮文本
|
|
73
|
-
* @defaultValue '展开'
|
|
74
|
-
*/
|
|
75
|
-
expandText?: string;
|
|
76
|
-
/**
|
|
77
|
-
* 收起按钮文本
|
|
78
|
-
* @defaultValue '收起'
|
|
79
|
-
*/
|
|
80
|
-
collapseText?: string;
|
|
81
|
-
/**
|
|
82
|
-
* 默认展开状态
|
|
83
|
-
* @defaultValue false
|
|
84
|
-
*/
|
|
85
|
-
defaultExpanded?: boolean;
|
|
86
|
-
/**
|
|
87
|
-
* 网格间距
|
|
88
|
-
* @defaultValue 'gap-4'
|
|
89
|
-
*/
|
|
90
|
-
gap?: string;
|
|
91
|
-
}
|
|
92
|
-
export interface SearchFormActionSlots {
|
|
93
|
-
/** 替换默认按钮区域 */
|
|
94
|
-
actions: (props: {
|
|
95
|
-
expanded: boolean;
|
|
96
|
-
toggle: () => void;
|
|
97
|
-
search: () => void;
|
|
98
|
-
reset: () => void;
|
|
99
|
-
loading: boolean;
|
|
100
|
-
}) => any;
|
|
101
|
-
/** 追加在默认按钮后面 */
|
|
102
|
-
extraActions: (props: {
|
|
103
|
-
expanded: boolean;
|
|
104
|
-
}) => any;
|
|
105
|
-
}
|
|
106
|
-
declare const __VLS_export: <S extends z.ZodObject, T extends boolean = true, N extends boolean = false>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
107
|
-
props: import("vue").PublicProps & __VLS_PrettifyLocal<(SearchFormProps<S, T, N> & {
|
|
3
|
+
import type { AppConfig } from 'nuxt/schema';
|
|
4
|
+
import theme from '#build/movk-ui/search-form';
|
|
5
|
+
import type { SearchFormProps, SearchFormSlots } from '../types/auto-form/search-form';
|
|
6
|
+
declare const __VLS_export: <S extends z.ZodObject>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
7
|
+
props: import("vue").PublicProps & __VLS_PrettifyLocal<(SearchFormProps<S> & {
|
|
8
|
+
ui?: ComponentConfig<typeof theme, AppConfig, "searchForm">["slots"];
|
|
9
|
+
} & {
|
|
108
10
|
modelValue?: Partial<InferInput<S>>;
|
|
11
|
+
expanded?: boolean;
|
|
109
12
|
}) & {
|
|
110
|
-
|
|
13
|
+
onError?: ((event: import("@nuxt/ui").FormErrorEvent) => any) | undefined;
|
|
14
|
+
onClear?: (() => any) | undefined;
|
|
15
|
+
onReset?: (() => any) | undefined;
|
|
16
|
+
"onUpdate:modelValue"?: ((value: Partial<InferInput<S>>) => any) | undefined;
|
|
17
|
+
onExpand?: ((expanded: boolean) => any) | undefined;
|
|
18
|
+
"onUpdate:expanded"?: ((value: boolean | undefined) => any) | undefined;
|
|
111
19
|
}> & (typeof globalThis extends {
|
|
112
20
|
__VLS_PROPS_FALLBACK: infer P;
|
|
113
21
|
} ? P : {});
|
|
114
22
|
expose: (exposed: import("vue").ShallowUnwrapRef<{
|
|
115
|
-
formRef: any
|
|
23
|
+
formRef: Readonly<import("vue").ShallowRef<any, any>>;
|
|
24
|
+
submit: () => void;
|
|
116
25
|
reset: () => void;
|
|
117
26
|
clear: () => void;
|
|
118
|
-
|
|
27
|
+
setBaseline: (value?: Partial<InferInput<S>>) => void;
|
|
28
|
+
expanded: import("vue").WritableComputedRef<boolean, boolean>;
|
|
119
29
|
toggle: () => void;
|
|
120
30
|
}>) => void;
|
|
121
31
|
attrs: any;
|
|
122
|
-
slots:
|
|
123
|
-
|
|
124
|
-
label?: string;
|
|
125
|
-
} & import("../types/index.js").AutoFormFieldContext<Partial<InferInput<S>>, string>) => unknown;
|
|
126
|
-
"field-hint": (props: {
|
|
127
|
-
hint?: string;
|
|
128
|
-
} & import("../types/index.js").AutoFormFieldContext<Partial<InferInput<S>>, string>) => unknown;
|
|
129
|
-
"field-description": (props: {
|
|
130
|
-
description?: string;
|
|
131
|
-
} & import("../types/index.js").AutoFormFieldContext<Partial<InferInput<S>>, string>) => unknown;
|
|
132
|
-
"field-help": (props: {
|
|
133
|
-
help?: string;
|
|
134
|
-
} & import("../types/index.js").AutoFormFieldContext<Partial<InferInput<S>>, string>) => unknown;
|
|
135
|
-
"field-error": (props: {
|
|
136
|
-
error?: boolean | string;
|
|
137
|
-
} & import("../types/index.js").AutoFormFieldContext<Partial<InferInput<S>>, string>) => unknown;
|
|
138
|
-
"field-default": (props: {
|
|
139
|
-
error?: boolean | string;
|
|
140
|
-
} & import("../types/index.js").AutoFormFieldContext<Partial<InferInput<S>>, string>) => unknown;
|
|
141
|
-
} & { [Key in `field-label:${{ [K in keyof InferInput<S> & string]: import("@movk/core").IsPlainObject<Partial<InferInput<S>>[K]> extends true ? K | `${K}.${{ [K_2 in keyof NonNullable<Partial<InferInput<S>>[K]> & string]: import("@movk/core").IsPlainObject<NonNullable<Partial<InferInput<S>>[K]>[K_2]> extends true ? K_2 | `${K_2}.${{ [K_3 in keyof NonNullable<NonNullable<Partial<InferInput<S>>[K]>[K_2]> & string]: import("@movk/core").IsPlainObject<NonNullable<NonNullable<Partial<InferInput<S>>[K]>[K_2]>[K_3]> extends true ? K_3 : never; }[keyof NonNullable<NonNullable<Partial<InferInput<S>>[K]>[K_2]> & string]}` : never; }[keyof NonNullable<Partial<InferInput<S>>[K]> & string]}` : never; }[keyof InferInput<S> & string]}` | `field-label:${Exclude<{ [K_1 in keyof InferInput<S> & string]: import("@movk/core").IsPlainObject<Partial<InferInput<S>>[K_1]> extends true ? K_1 | `${K_1}.${{ [K_3 in keyof NonNullable<Partial<InferInput<S>>[K_1]> & string]: import("@movk/core").IsPlainObject<NonNullable<Partial<InferInput<S>>[K_1]>[K_3]> extends true ? K_3 | `${K_3}.${{ [K_4 in keyof NonNullable<NonNullable<Partial<InferInput<S>>[K_1]>[K_3]> & string]: import("@movk/core").IsPlainObject<NonNullable<NonNullable<Partial<InferInput<S>>[K_1]>[K_3]>[K_4]> extends true ? K_4 : K_4; }[keyof NonNullable<NonNullable<Partial<InferInput<S>>[K_1]>[K_3]> & string]}` : K_3; }[keyof NonNullable<Partial<InferInput<S>>[K_1]> & string]}` : K_1; }[keyof InferInput<S> & string], { [K in keyof InferInput<S> & string]: import("@movk/core").IsPlainObject<Partial<InferInput<S>>[K]> extends true ? K | `${K}.${{ [K_3 in keyof NonNullable<Partial<InferInput<S>>[K]> & string]: import("@movk/core").IsPlainObject<NonNullable<Partial<InferInput<S>>[K]>[K_3]> extends true ? K_3 | `${K_3}.${{ [K_4 in keyof NonNullable<NonNullable<Partial<InferInput<S>>[K]>[K_3]> & string]: import("@movk/core").IsPlainObject<NonNullable<NonNullable<Partial<InferInput<S>>[K]>[K_3]>[K_4]> extends true ? K_4 : never; }[keyof NonNullable<NonNullable<Partial<InferInput<S>>[K]>[K_3]> & string]}` : never; }[keyof NonNullable<Partial<InferInput<S>>[K]> & string]}` : never; }[keyof InferInput<S> & string]>}` | `field-hint:${{ [K in keyof InferInput<S> & string]: import("@movk/core").IsPlainObject<Partial<InferInput<S>>[K]> extends true ? K | `${K}.${{ [K_3 in keyof NonNullable<Partial<InferInput<S>>[K]> & string]: import("@movk/core").IsPlainObject<NonNullable<Partial<InferInput<S>>[K]>[K_3]> extends true ? K_3 | `${K_3}.${{ [K_4 in keyof NonNullable<NonNullable<Partial<InferInput<S>>[K]>[K_3]> & string]: import("@movk/core").IsPlainObject<NonNullable<NonNullable<Partial<InferInput<S>>[K]>[K_3]>[K_4]> extends true ? K_4 : never; }[keyof NonNullable<NonNullable<Partial<InferInput<S>>[K]>[K_3]> & string]}` : never; }[keyof NonNullable<Partial<InferInput<S>>[K]> & string]}` : never; }[keyof InferInput<S> & string]}` | `field-hint:${Exclude<{ [K_1 in keyof InferInput<S> & string]: import("@movk/core").IsPlainObject<Partial<InferInput<S>>[K_1]> extends true ? K_1 | `${K_1}.${{ [K_3 in keyof NonNullable<Partial<InferInput<S>>[K_1]> & string]: import("@movk/core").IsPlainObject<NonNullable<Partial<InferInput<S>>[K_1]>[K_3]> extends true ? K_3 | `${K_3}.${{ [K_4 in keyof NonNullable<NonNullable<Partial<InferInput<S>>[K_1]>[K_3]> & string]: import("@movk/core").IsPlainObject<NonNullable<NonNullable<Partial<InferInput<S>>[K_1]>[K_3]>[K_4]> extends true ? K_4 : K_4; }[keyof NonNullable<NonNullable<Partial<InferInput<S>>[K_1]>[K_3]> & string]}` : K_3; }[keyof NonNullable<Partial<InferInput<S>>[K_1]> & string]}` : K_1; }[keyof InferInput<S> & string], { [K in keyof InferInput<S> & string]: import("@movk/core").IsPlainObject<Partial<InferInput<S>>[K]> extends true ? K | `${K}.${{ [K_3 in keyof NonNullable<Partial<InferInput<S>>[K]> & string]: import("@movk/core").IsPlainObject<NonNullable<Partial<InferInput<S>>[K]>[K_3]> extends true ? K_3 | `${K_3}.${{ [K_4 in keyof NonNullable<NonNullable<Partial<InferInput<S>>[K]>[K_3]> & string]: import("@movk/core").IsPlainObject<NonNullable<NonNullable<Partial<InferInput<S>>[K]>[K_3]>[K_4]> extends true ? K_4 : never; }[keyof NonNullable<NonNullable<Partial<InferInput<S>>[K]>[K_3]> & string]}` : never; }[keyof NonNullable<Partial<InferInput<S>>[K]> & string]}` : never; }[keyof InferInput<S> & string]>}` | `field-description:${{ [K in keyof InferInput<S> & string]: import("@movk/core").IsPlainObject<Partial<InferInput<S>>[K]> extends true ? K | `${K}.${{ [K_3 in keyof NonNullable<Partial<InferInput<S>>[K]> & string]: import("@movk/core").IsPlainObject<NonNullable<Partial<InferInput<S>>[K]>[K_3]> extends true ? K_3 | `${K_3}.${{ [K_4 in keyof NonNullable<NonNullable<Partial<InferInput<S>>[K]>[K_3]> & string]: import("@movk/core").IsPlainObject<NonNullable<NonNullable<Partial<InferInput<S>>[K]>[K_3]>[K_4]> extends true ? K_4 : never; }[keyof NonNullable<NonNullable<Partial<InferInput<S>>[K]>[K_3]> & string]}` : never; }[keyof NonNullable<Partial<InferInput<S>>[K]> & string]}` : never; }[keyof InferInput<S> & string]}` | `field-description:${Exclude<{ [K_1 in keyof InferInput<S> & string]: import("@movk/core").IsPlainObject<Partial<InferInput<S>>[K_1]> extends true ? K_1 | `${K_1}.${{ [K_3 in keyof NonNullable<Partial<InferInput<S>>[K_1]> & string]: import("@movk/core").IsPlainObject<NonNullable<Partial<InferInput<S>>[K_1]>[K_3]> extends true ? K_3 | `${K_3}.${{ [K_4 in keyof NonNullable<NonNullable<Partial<InferInput<S>>[K_1]>[K_3]> & string]: import("@movk/core").IsPlainObject<NonNullable<NonNullable<Partial<InferInput<S>>[K_1]>[K_3]>[K_4]> extends true ? K_4 : K_4; }[keyof NonNullable<NonNullable<Partial<InferInput<S>>[K_1]>[K_3]> & string]}` : K_3; }[keyof NonNullable<Partial<InferInput<S>>[K_1]> & string]}` : K_1; }[keyof InferInput<S> & string], { [K in keyof InferInput<S> & string]: import("@movk/core").IsPlainObject<Partial<InferInput<S>>[K]> extends true ? K | `${K}.${{ [K_3 in keyof NonNullable<Partial<InferInput<S>>[K]> & string]: import("@movk/core").IsPlainObject<NonNullable<Partial<InferInput<S>>[K]>[K_3]> extends true ? K_3 | `${K_3}.${{ [K_4 in keyof NonNullable<NonNullable<Partial<InferInput<S>>[K]>[K_3]> & string]: import("@movk/core").IsPlainObject<NonNullable<NonNullable<Partial<InferInput<S>>[K]>[K_3]>[K_4]> extends true ? K_4 : never; }[keyof NonNullable<NonNullable<Partial<InferInput<S>>[K]>[K_3]> & string]}` : never; }[keyof NonNullable<Partial<InferInput<S>>[K]> & string]}` : never; }[keyof InferInput<S> & string]>}` | `field-help:${{ [K in keyof InferInput<S> & string]: import("@movk/core").IsPlainObject<Partial<InferInput<S>>[K]> extends true ? K | `${K}.${{ [K_3 in keyof NonNullable<Partial<InferInput<S>>[K]> & string]: import("@movk/core").IsPlainObject<NonNullable<Partial<InferInput<S>>[K]>[K_3]> extends true ? K_3 | `${K_3}.${{ [K_4 in keyof NonNullable<NonNullable<Partial<InferInput<S>>[K]>[K_3]> & string]: import("@movk/core").IsPlainObject<NonNullable<NonNullable<Partial<InferInput<S>>[K]>[K_3]>[K_4]> extends true ? K_4 : never; }[keyof NonNullable<NonNullable<Partial<InferInput<S>>[K]>[K_3]> & string]}` : never; }[keyof NonNullable<Partial<InferInput<S>>[K]> & string]}` : never; }[keyof InferInput<S> & string]}` | `field-help:${Exclude<{ [K_1 in keyof InferInput<S> & string]: import("@movk/core").IsPlainObject<Partial<InferInput<S>>[K_1]> extends true ? K_1 | `${K_1}.${{ [K_3 in keyof NonNullable<Partial<InferInput<S>>[K_1]> & string]: import("@movk/core").IsPlainObject<NonNullable<Partial<InferInput<S>>[K_1]>[K_3]> extends true ? K_3 | `${K_3}.${{ [K_4 in keyof NonNullable<NonNullable<Partial<InferInput<S>>[K_1]>[K_3]> & string]: import("@movk/core").IsPlainObject<NonNullable<NonNullable<Partial<InferInput<S>>[K_1]>[K_3]>[K_4]> extends true ? K_4 : K_4; }[keyof NonNullable<NonNullable<Partial<InferInput<S>>[K_1]>[K_3]> & string]}` : K_3; }[keyof NonNullable<Partial<InferInput<S>>[K_1]> & string]}` : K_1; }[keyof InferInput<S> & string], { [K in keyof InferInput<S> & string]: import("@movk/core").IsPlainObject<Partial<InferInput<S>>[K]> extends true ? K | `${K}.${{ [K_3 in keyof NonNullable<Partial<InferInput<S>>[K]> & string]: import("@movk/core").IsPlainObject<NonNullable<Partial<InferInput<S>>[K]>[K_3]> extends true ? K_3 | `${K_3}.${{ [K_4 in keyof NonNullable<NonNullable<Partial<InferInput<S>>[K]>[K_3]> & string]: import("@movk/core").IsPlainObject<NonNullable<NonNullable<Partial<InferInput<S>>[K]>[K_3]>[K_4]> extends true ? K_4 : never; }[keyof NonNullable<NonNullable<Partial<InferInput<S>>[K]>[K_3]> & string]}` : never; }[keyof NonNullable<Partial<InferInput<S>>[K]> & string]}` : never; }[keyof InferInput<S> & string]>}` | `field-error:${{ [K in keyof InferInput<S> & string]: import("@movk/core").IsPlainObject<Partial<InferInput<S>>[K]> extends true ? K | `${K}.${{ [K_3 in keyof NonNullable<Partial<InferInput<S>>[K]> & string]: import("@movk/core").IsPlainObject<NonNullable<Partial<InferInput<S>>[K]>[K_3]> extends true ? K_3 | `${K_3}.${{ [K_4 in keyof NonNullable<NonNullable<Partial<InferInput<S>>[K]>[K_3]> & string]: import("@movk/core").IsPlainObject<NonNullable<NonNullable<Partial<InferInput<S>>[K]>[K_3]>[K_4]> extends true ? K_4 : never; }[keyof NonNullable<NonNullable<Partial<InferInput<S>>[K]>[K_3]> & string]}` : never; }[keyof NonNullable<Partial<InferInput<S>>[K]> & string]}` : never; }[keyof InferInput<S> & string]}` | `field-error:${Exclude<{ [K_1 in keyof InferInput<S> & string]: import("@movk/core").IsPlainObject<Partial<InferInput<S>>[K_1]> extends true ? K_1 | `${K_1}.${{ [K_3 in keyof NonNullable<Partial<InferInput<S>>[K_1]> & string]: import("@movk/core").IsPlainObject<NonNullable<Partial<InferInput<S>>[K_1]>[K_3]> extends true ? K_3 | `${K_3}.${{ [K_4 in keyof NonNullable<NonNullable<Partial<InferInput<S>>[K_1]>[K_3]> & string]: import("@movk/core").IsPlainObject<NonNullable<NonNullable<Partial<InferInput<S>>[K_1]>[K_3]>[K_4]> extends true ? K_4 : K_4; }[keyof NonNullable<NonNullable<Partial<InferInput<S>>[K_1]>[K_3]> & string]}` : K_3; }[keyof NonNullable<Partial<InferInput<S>>[K_1]> & string]}` : K_1; }[keyof InferInput<S> & string], { [K in keyof InferInput<S> & string]: import("@movk/core").IsPlainObject<Partial<InferInput<S>>[K]> extends true ? K | `${K}.${{ [K_3 in keyof NonNullable<Partial<InferInput<S>>[K]> & string]: import("@movk/core").IsPlainObject<NonNullable<Partial<InferInput<S>>[K]>[K_3]> extends true ? K_3 | `${K_3}.${{ [K_4 in keyof NonNullable<NonNullable<Partial<InferInput<S>>[K]>[K_3]> & string]: import("@movk/core").IsPlainObject<NonNullable<NonNullable<Partial<InferInput<S>>[K]>[K_3]>[K_4]> extends true ? K_4 : never; }[keyof NonNullable<NonNullable<Partial<InferInput<S>>[K]>[K_3]> & string]}` : never; }[keyof NonNullable<Partial<InferInput<S>>[K]> & string]}` : never; }[keyof InferInput<S> & string]>}` | `field-default:${{ [K in keyof InferInput<S> & string]: import("@movk/core").IsPlainObject<Partial<InferInput<S>>[K]> extends true ? K | `${K}.${{ [K_3 in keyof NonNullable<Partial<InferInput<S>>[K]> & string]: import("@movk/core").IsPlainObject<NonNullable<Partial<InferInput<S>>[K]>[K_3]> extends true ? K_3 | `${K_3}.${{ [K_4 in keyof NonNullable<NonNullable<Partial<InferInput<S>>[K]>[K_3]> & string]: import("@movk/core").IsPlainObject<NonNullable<NonNullable<Partial<InferInput<S>>[K]>[K_3]>[K_4]> extends true ? K_4 : never; }[keyof NonNullable<NonNullable<Partial<InferInput<S>>[K]>[K_3]> & string]}` : never; }[keyof NonNullable<Partial<InferInput<S>>[K]> & string]}` : never; }[keyof InferInput<S> & string]}` | `field-default:${Exclude<{ [K_1 in keyof InferInput<S> & string]: import("@movk/core").IsPlainObject<Partial<InferInput<S>>[K_1]> extends true ? K_1 | `${K_1}.${{ [K_3 in keyof NonNullable<Partial<InferInput<S>>[K_1]> & string]: import("@movk/core").IsPlainObject<NonNullable<Partial<InferInput<S>>[K_1]>[K_3]> extends true ? K_3 | `${K_3}.${{ [K_4 in keyof NonNullable<NonNullable<Partial<InferInput<S>>[K_1]>[K_3]> & string]: import("@movk/core").IsPlainObject<NonNullable<NonNullable<Partial<InferInput<S>>[K_1]>[K_3]>[K_4]> extends true ? K_4 : K_4; }[keyof NonNullable<NonNullable<Partial<InferInput<S>>[K_1]>[K_3]> & string]}` : K_3; }[keyof NonNullable<Partial<InferInput<S>>[K_1]> & string]}` : K_1; }[keyof InferInput<S> & string], { [K in keyof InferInput<S> & string]: import("@movk/core").IsPlainObject<Partial<InferInput<S>>[K]> extends true ? K | `${K}.${{ [K_3 in keyof NonNullable<Partial<InferInput<S>>[K]> & string]: import("@movk/core").IsPlainObject<NonNullable<Partial<InferInput<S>>[K]>[K_3]> extends true ? K_3 | `${K_3}.${{ [K_4 in keyof NonNullable<NonNullable<Partial<InferInput<S>>[K]>[K_3]> & string]: import("@movk/core").IsPlainObject<NonNullable<NonNullable<Partial<InferInput<S>>[K]>[K_3]>[K_4]> extends true ? K_4 : never; }[keyof NonNullable<NonNullable<Partial<InferInput<S>>[K]>[K_3]> & string]}` : never; }[keyof NonNullable<Partial<InferInput<S>>[K]> & string]}` : never; }[keyof InferInput<S> & string]>}`]: Key extends `field-${infer K_2 extends keyof import("../types/index.js").AutoFormFieldSlots}:${infer P extends { [K_3 in keyof T_1 & string]: import("@movk/core").IsPlainObject<T_1[K_3]> extends true ? K_3 | `${K_3}.${{ [K_5 in keyof NonNullable<T_1[K_3]> & string]: import("@movk/core").IsPlainObject<NonNullable<T_1[K_3]>[K_5]> extends true ? K_5 | `${K_5}.${{ [K_6 in keyof NonNullable<NonNullable<T_1[K_3]>[K_5]> & string]: import("@movk/core").IsPlainObject<NonNullable<NonNullable<T_1[K_3]>[K_5]>[K_6]> extends true ? K_6 : never; }[keyof NonNullable<NonNullable<T_1[K_3]>[K_5]> & string]}` : never; }[keyof NonNullable<T_1[K_3]> & string]}` : never; }[keyof T_1 & string] | (string & import("@movk/core").NonObjectFieldKeys<T_1>)}` ? (props: {
|
|
142
|
-
label: {
|
|
143
|
-
label?: string;
|
|
144
|
-
};
|
|
145
|
-
hint: {
|
|
146
|
-
hint?: string;
|
|
147
|
-
};
|
|
148
|
-
description: {
|
|
149
|
-
description?: string;
|
|
150
|
-
};
|
|
151
|
-
help: {
|
|
152
|
-
help?: string;
|
|
153
|
-
};
|
|
154
|
-
error: {
|
|
155
|
-
error?: boolean | string;
|
|
156
|
-
};
|
|
157
|
-
default: {
|
|
158
|
-
error?: boolean | string;
|
|
159
|
-
};
|
|
160
|
-
}[K_2] & import("../types/index.js").AutoFormFieldContext<Partial<InferInput<S>>, P>) => unknown : never; } & { [P in { [K in keyof InferInput<S> & string]: import("@movk/core").IsPlainObject<Partial<InferInput<S>>[K]> extends true ? K | `${K}.${{ [K_3 in keyof NonNullable<Partial<InferInput<S>>[K]> & string]: import("@movk/core").IsPlainObject<NonNullable<Partial<InferInput<S>>[K]>[K_3]> extends true ? K_3 | `${K_3}.${{ [K_4 in keyof NonNullable<NonNullable<Partial<InferInput<S>>[K]>[K_3]> & string]: import("@movk/core").IsPlainObject<NonNullable<NonNullable<Partial<InferInput<S>>[K]>[K_3]>[K_4]> extends true ? K_4 : never; }[keyof NonNullable<NonNullable<Partial<InferInput<S>>[K]>[K_3]> & string]}` : never; }[keyof NonNullable<Partial<InferInput<S>>[K]> & string]}` : never; }[keyof InferInput<S> & string] | { [K_2 in keyof InferInput<S> & string]: NonNullable<Partial<InferInput<S>>[K_2]> extends any[] ? K_2 : import("@movk/core").IsPlainObject<Partial<InferInput<S>>[K_2]> extends true ? `${K_2}.${{ [K_4 in keyof NonNullable<Partial<InferInput<S>>[K_2]> & string]: NonNullable<NonNullable<Partial<InferInput<S>>[K_2]>[K_4]> extends any[] ? K_4 : import("@movk/core").IsPlainObject<NonNullable<Partial<InferInput<S>>[K_2]>[K_4]> extends true ? `${K_4}.${{ [K_5 in keyof NonNullable<NonNullable<Partial<InferInput<S>>[K_2]>[K_4]> & string]: NonNullable<NonNullable<NonNullable<Partial<InferInput<S>>[K_2]>[K_4]>[K_5]> extends any[] ? K_5 : import("@movk/core").IsPlainObject<NonNullable<NonNullable<Partial<InferInput<S>>[K_2]>[K_4]>[K_5]> extends true ? never : never; }[keyof NonNullable<NonNullable<Partial<InferInput<S>>[K_2]>[K_4]> & string]}` : never; }[keyof NonNullable<Partial<InferInput<S>>[K_2]> & string]}` : never; }[keyof InferInput<S> & string] as `field-content:${P}` | `field-before:${P}` | `field-after:${P}`]: (props: import("../types/index.js").AutoFormFieldContext<Partial<InferInput<S>>, P>) => unknown; };
|
|
161
|
-
emit: any & ((event: "update:modelValue", value: Partial<InferInput<S>> | undefined) => void);
|
|
32
|
+
slots: SearchFormSlots<S>;
|
|
33
|
+
emit: (((evt: "error", event: import("@nuxt/ui").FormErrorEvent) => void) & ((evt: "clear") => void) & ((evt: "reset") => void) & ((evt: "expand", expanded: boolean) => void) & ((evt: "update:expanded", expanded: boolean) => void)) & (((event: "update:modelValue", value: Partial<InferInput<S>>) => void) & ((event: "update:expanded", value: boolean | undefined) => void));
|
|
162
34
|
}>) => import("vue").VNode & {
|
|
163
35
|
__ctx?: Awaited<typeof __VLS_setup>;
|
|
164
36
|
};
|
|
@@ -1,75 +1,36 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* 滑块高度
|
|
10
|
-
* @defaultValue 32
|
|
11
|
-
*/
|
|
12
|
-
height?: number;
|
|
13
|
-
/**
|
|
14
|
-
* 是否禁用
|
|
15
|
-
* @defaultValue false
|
|
16
|
-
*/
|
|
17
|
-
disabled?: boolean;
|
|
18
|
-
/**
|
|
19
|
-
* 待滑动时的提示文本
|
|
20
|
-
* @defaultValue '请向右滑动验证'
|
|
21
|
-
*/
|
|
22
|
-
text?: string;
|
|
23
|
-
/**
|
|
24
|
-
* 验证成功时的提示文本
|
|
25
|
-
* @defaultValue '验证成功'
|
|
26
|
-
*/
|
|
27
|
-
successText?: string;
|
|
28
|
-
/**
|
|
29
|
-
* 滑块图标
|
|
30
|
-
* @defaultValue 'i-lucide-chevrons-right'
|
|
31
|
-
*/
|
|
32
|
-
icon?: string;
|
|
33
|
-
/**
|
|
34
|
-
* 验证成功时的图标
|
|
35
|
-
* @defaultValue 'i-lucide-check'
|
|
36
|
-
*/
|
|
37
|
-
successIcon?: string;
|
|
38
|
-
/**
|
|
39
|
-
* 完成验证所需的阈值百分比(0-1)
|
|
40
|
-
* @defaultValue 0.9
|
|
41
|
-
*/
|
|
42
|
-
threshold?: number;
|
|
43
|
-
/**
|
|
44
|
-
* 自定义轨道样式
|
|
45
|
-
*/
|
|
46
|
-
trackClass?: ClassNameValue;
|
|
47
|
-
/**
|
|
48
|
-
* 自定义滑块样式
|
|
49
|
-
*/
|
|
50
|
-
sliderClass?: ClassNameValue;
|
|
51
|
-
/**
|
|
52
|
-
* 自定义文本样式
|
|
53
|
-
*/
|
|
54
|
-
textClass?: ClassNameValue;
|
|
55
|
-
/**
|
|
56
|
-
* 自定义根元素样式
|
|
57
|
-
*/
|
|
58
|
-
class?: ClassNameValue;
|
|
59
|
-
}
|
|
60
|
-
export interface SlideVerifyEmits {
|
|
61
|
-
success: [];
|
|
62
|
-
dragStart: [];
|
|
63
|
-
dragEnd: [success: boolean];
|
|
64
|
-
}
|
|
65
|
-
declare var __VLS_22: {
|
|
66
|
-
verified: any;
|
|
67
|
-
progress: any;
|
|
1
|
+
import theme from '#build/movk-ui/slide-verify';
|
|
2
|
+
import type { ComponentConfig } from '@nuxt/ui';
|
|
3
|
+
import type { AppConfig } from 'nuxt/schema';
|
|
4
|
+
import type { SlideVerifyProps, SlideVerifySlots } from '../types/components/slide-verify';
|
|
5
|
+
type __VLS_Props = SlideVerifyProps & {
|
|
6
|
+
size?: ComponentConfig<typeof theme, AppConfig, 'slideVerify'>['variants']['size'];
|
|
7
|
+
ui?: ComponentConfig<typeof theme, AppConfig, 'slideVerify'>['slots'];
|
|
68
8
|
};
|
|
69
|
-
type __VLS_Slots =
|
|
70
|
-
|
|
9
|
+
type __VLS_Slots = SlideVerifySlots;
|
|
10
|
+
declare function reset(): void;
|
|
11
|
+
type __VLS_ModelProps = {
|
|
12
|
+
modelValue?: boolean;
|
|
71
13
|
};
|
|
72
|
-
|
|
14
|
+
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
15
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {
|
|
16
|
+
reset: typeof reset;
|
|
17
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
18
|
+
success: () => any;
|
|
19
|
+
"update:modelValue": (value: boolean) => any;
|
|
20
|
+
dragStart: () => any;
|
|
21
|
+
dragEnd: (success: boolean) => any;
|
|
22
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
23
|
+
onSuccess?: (() => any) | undefined;
|
|
24
|
+
"onUpdate:modelValue"?: ((value: boolean) => any) | undefined;
|
|
25
|
+
onDragStart?: (() => any) | undefined;
|
|
26
|
+
onDragEnd?: ((success: boolean) => any) | undefined;
|
|
27
|
+
}>, {
|
|
28
|
+
icon: import("@nuxt/ui").IconProps["name"];
|
|
29
|
+
text: string;
|
|
30
|
+
successText: string;
|
|
31
|
+
successIcon: import("@nuxt/ui").IconProps["name"];
|
|
32
|
+
threshold: number;
|
|
33
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
73
34
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
74
35
|
declare const _default: typeof __VLS_export;
|
|
75
36
|
export default _default;
|
|
@@ -1,57 +1,114 @@
|
|
|
1
1
|
<script setup>
|
|
2
2
|
import { UIcon } from "#components";
|
|
3
|
+
import { useAppConfig } from "#imports";
|
|
3
4
|
import { useElementSize } from "@vueuse/core";
|
|
4
|
-
import { Motion } from "motion-v";
|
|
5
5
|
import { computed, ref, useTemplateRef } from "vue";
|
|
6
|
-
|
|
6
|
+
import theme from "#build/movk-ui/slide-verify";
|
|
7
|
+
import { useExtendedTv } from "../utils/extend-theme";
|
|
8
|
+
import { useFieldControl } from "../utils/form-control";
|
|
7
9
|
const props = defineProps({
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
10
|
+
id: { type: String, required: false },
|
|
11
|
+
name: { type: String, required: false },
|
|
12
|
+
size: { type: String, required: false },
|
|
13
|
+
disabled: { type: Boolean, required: false },
|
|
11
14
|
text: { type: String, required: false, default: "\u8BF7\u5411\u53F3\u6ED1\u52A8\u9A8C\u8BC1" },
|
|
12
15
|
successText: { type: String, required: false, default: "\u9A8C\u8BC1\u6210\u529F" },
|
|
13
|
-
icon: { type:
|
|
14
|
-
successIcon: { type:
|
|
16
|
+
icon: { type: null, required: false, default: "i-lucide-chevrons-right" },
|
|
17
|
+
successIcon: { type: null, required: false, default: "i-lucide-check" },
|
|
15
18
|
threshold: { type: Number, required: false, default: 0.9 },
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
textClass: { type: [Array, String, null, Number, Boolean], required: false, skipCheck: true },
|
|
19
|
-
class: { type: [Array, String, null, Number, Boolean], required: false, skipCheck: true }
|
|
19
|
+
class: { type: null, required: false },
|
|
20
|
+
ui: { type: Object, required: false }
|
|
20
21
|
});
|
|
21
|
-
const
|
|
22
|
+
const emits = defineEmits(["success", "dragStart", "dragEnd"]);
|
|
23
|
+
defineSlots();
|
|
24
|
+
defineOptions({ inheritAttrs: false });
|
|
22
25
|
const isVerified = defineModel({ type: Boolean, ...{ default: false } });
|
|
23
|
-
const
|
|
24
|
-
|
|
26
|
+
const {
|
|
27
|
+
id,
|
|
28
|
+
name,
|
|
29
|
+
size: effectiveSize,
|
|
30
|
+
disabled: effectiveDisabled,
|
|
31
|
+
fieldGroupOrientation,
|
|
32
|
+
ariaAttrs,
|
|
33
|
+
emitFormBlur,
|
|
34
|
+
emitFormChange,
|
|
35
|
+
emitFormFocus,
|
|
36
|
+
emitFormInput
|
|
37
|
+
} = useFieldControl(props);
|
|
38
|
+
const rootRef = useTemplateRef("root");
|
|
39
|
+
const sliderRef = useTemplateRef("slider");
|
|
40
|
+
const { width: rootWidth } = useElementSize(rootRef);
|
|
41
|
+
const { width: sliderWidth } = useElementSize(sliderRef);
|
|
25
42
|
const isDragging = ref(false);
|
|
26
43
|
const dragX = ref(0);
|
|
44
|
+
const pointerStartX = ref(0);
|
|
45
|
+
const dragStartX = ref(0);
|
|
46
|
+
const appConfig = useAppConfig();
|
|
47
|
+
const { extendUi } = useExtendedTv(
|
|
48
|
+
{ slots: {} },
|
|
49
|
+
theme,
|
|
50
|
+
() => appConfig.movk?.slideVerify,
|
|
51
|
+
() => ({
|
|
52
|
+
ui: {
|
|
53
|
+
...props.ui,
|
|
54
|
+
root: [props.ui?.root, props.class]
|
|
55
|
+
},
|
|
56
|
+
variants: {
|
|
57
|
+
disabled: effectiveDisabled.value,
|
|
58
|
+
verified: isVerified.value,
|
|
59
|
+
size: effectiveSize.value,
|
|
60
|
+
fieldGroup: fieldGroupOrientation.value
|
|
61
|
+
}
|
|
62
|
+
})
|
|
63
|
+
);
|
|
64
|
+
const rootPaddingX = computed(() => {
|
|
65
|
+
void effectiveSize.value;
|
|
66
|
+
const root = rootRef.value;
|
|
67
|
+
if (!root) return 0;
|
|
68
|
+
const style = getComputedStyle(root);
|
|
69
|
+
return (Number.parseFloat(style.paddingLeft) || 0) + (Number.parseFloat(style.paddingRight) || 0);
|
|
70
|
+
});
|
|
71
|
+
const sliderOuterWidth = computed(
|
|
72
|
+
() => sliderWidth.value ? sliderRef.value?.offsetWidth || sliderWidth.value : 0
|
|
73
|
+
);
|
|
27
74
|
const maxDragDistance = computed(
|
|
28
|
-
() =>
|
|
75
|
+
() => rootWidth.value ? Math.max(0, (rootRef.value?.clientWidth || 0) - rootPaddingX.value - sliderOuterWidth.value) : 0
|
|
29
76
|
);
|
|
30
77
|
const progress = computed(
|
|
31
78
|
() => isVerified.value ? 1 : maxDragDistance.value ? Math.min(dragX.value / maxDragDistance.value, 1) : 0
|
|
32
79
|
);
|
|
33
|
-
const canInteract = computed(() => !
|
|
34
|
-
const
|
|
35
|
-
|
|
80
|
+
const canInteract = computed(() => !effectiveDisabled.value && !isVerified.value && rootWidth.value > 0);
|
|
81
|
+
const currentTranslateX = computed(
|
|
82
|
+
() => isVerified.value ? maxDragDistance.value : dragX.value
|
|
83
|
+
);
|
|
84
|
+
function handlePointerDown(e) {
|
|
36
85
|
if (!canInteract.value) return;
|
|
86
|
+
pointerStartX.value = e.clientX;
|
|
87
|
+
dragStartX.value = dragX.value;
|
|
37
88
|
isDragging.value = true;
|
|
38
|
-
|
|
89
|
+
e.currentTarget.setPointerCapture(e.pointerId);
|
|
90
|
+
emits("dragStart");
|
|
39
91
|
}
|
|
40
|
-
function
|
|
41
|
-
if (!canInteract.value) return;
|
|
42
|
-
dragX.value = Math.max(0, Math.min(
|
|
92
|
+
function handlePointerMove(e) {
|
|
93
|
+
if (!isDragging.value || !canInteract.value) return;
|
|
94
|
+
dragX.value = Math.max(0, Math.min(
|
|
95
|
+
dragStartX.value + (e.clientX - pointerStartX.value),
|
|
96
|
+
maxDragDistance.value
|
|
97
|
+
));
|
|
43
98
|
}
|
|
44
|
-
function
|
|
45
|
-
if (!
|
|
99
|
+
function handlePointerUp() {
|
|
100
|
+
if (!isDragging.value) return;
|
|
46
101
|
isDragging.value = false;
|
|
47
102
|
const success = progress.value >= props.threshold;
|
|
48
103
|
if (success) {
|
|
49
104
|
isVerified.value = true;
|
|
50
|
-
|
|
105
|
+
emits("success");
|
|
106
|
+
emitFormInput();
|
|
107
|
+
emitFormChange();
|
|
51
108
|
} else {
|
|
52
109
|
dragX.value = 0;
|
|
53
110
|
}
|
|
54
|
-
|
|
111
|
+
emits("dragEnd", success);
|
|
55
112
|
}
|
|
56
113
|
function reset() {
|
|
57
114
|
isVerified.value = false;
|
|
@@ -62,86 +119,56 @@ defineExpose({ reset });
|
|
|
62
119
|
|
|
63
120
|
<template>
|
|
64
121
|
<div
|
|
65
|
-
:
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
isVerified ? 'bg-success border-transparent' : 'bg-elevated border-default'
|
|
70
|
-
]"
|
|
71
|
-
:style="{ height: `${height}px` }"
|
|
122
|
+
:id="id"
|
|
123
|
+
ref="root"
|
|
124
|
+
:name="name"
|
|
125
|
+
:class="extendUi.root"
|
|
72
126
|
role="slider"
|
|
73
127
|
:aria-label="text"
|
|
74
128
|
:aria-valuenow="Math.round(progress * 100)"
|
|
75
129
|
aria-valuemin="0"
|
|
76
130
|
aria-valuemax="100"
|
|
77
|
-
:aria-disabled="
|
|
131
|
+
:aria-disabled="effectiveDisabled"
|
|
132
|
+
:tabindex="canInteract ? 0 : -1"
|
|
133
|
+
v-bind="ariaAttrs"
|
|
134
|
+
@blur="emitFormBlur"
|
|
135
|
+
@focus="emitFormFocus"
|
|
78
136
|
>
|
|
79
|
-
<div ref="track"
|
|
80
|
-
<
|
|
137
|
+
<div ref="track" :class="extendUi.track">
|
|
138
|
+
<div
|
|
81
139
|
v-if="!isVerified"
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
:animate="{ width: `${progress * 100}%`, opacity: 0.6 }"
|
|
85
|
-
:transition="isDragging ? { duration: 0 } : springTransition"
|
|
140
|
+
:class="[extendUi.fill, isDragging ? 'transition-none' : 'transition-[width] duration-300']"
|
|
141
|
+
:style="{ width: `${progress * 100}%` }"
|
|
86
142
|
/>
|
|
87
143
|
|
|
88
|
-
<div
|
|
89
|
-
|
|
90
|
-
:class="textClass"
|
|
91
|
-
>
|
|
92
|
-
<Motion
|
|
144
|
+
<div :class="extendUi.text">
|
|
145
|
+
<span
|
|
93
146
|
v-if="!isVerified"
|
|
94
|
-
|
|
95
|
-
class="relative inline-block bg-size-[200%_100%] bg-clip-text text-transparent bg-no-repeat"
|
|
147
|
+
class="animate-[shimmer_2s_linear_infinite] [background-size:200%_100%] bg-clip-text text-transparent bg-no-repeat select-none"
|
|
96
148
|
:style="{
|
|
97
|
-
backgroundImage: '
|
|
149
|
+
backgroundImage: 'linear-gradient(90deg, var(--ui-text-dimmed) 0%, var(--ui-text-muted) 50%, var(--ui-text-dimmed) 100%)',
|
|
98
150
|
opacity: 1 - progress * 0.5
|
|
99
151
|
}"
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
:transition="{
|
|
103
|
-
repeat: Infinity,
|
|
104
|
-
duration: 2,
|
|
105
|
-
ease: 'linear'
|
|
106
|
-
}"
|
|
107
|
-
>
|
|
108
|
-
{{ text }}
|
|
109
|
-
</Motion>
|
|
110
|
-
<span v-else class="text-inverted font-medium">{{ successText }}</span>
|
|
152
|
+
>{{ text }}</span>
|
|
153
|
+
<span v-else class="font-medium text-inverted">{{ successText }}</span>
|
|
111
154
|
</div>
|
|
112
155
|
</div>
|
|
113
156
|
|
|
114
|
-
<
|
|
115
|
-
|
|
116
|
-
class="
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
:transition="isDragging ? { duration: 0 } : springTransition"
|
|
121
|
-
:while-hover="canInteract ? { scale: 1.02 } : void 0"
|
|
122
|
-
:while-tap="canInteract ? { scale: 0.98 } : void 0"
|
|
123
|
-
:drag="canInteract ? 'x' : false"
|
|
124
|
-
:drag-constraints="{ left: 0, right: maxDragDistance }"
|
|
125
|
-
:drag-elastic="0"
|
|
126
|
-
:drag-momentum="false"
|
|
127
|
-
@drag-start="handleDragStart"
|
|
128
|
-
@drag="handleDrag"
|
|
129
|
-
@drag-end="handleDragEnd"
|
|
130
|
-
>
|
|
131
|
-
<div
|
|
132
|
-
class="size-full flex items-center justify-center rounded-md shadow-sm transition-colors"
|
|
133
|
-
:class="[
|
|
134
|
-
sliderClass,
|
|
135
|
-
isVerified ? 'bg-white/90' : 'bg-default cursor-grab active:cursor-grabbing ring-1 ring-default'
|
|
157
|
+
<div
|
|
158
|
+
ref="slider"
|
|
159
|
+
:class="[
|
|
160
|
+
extendUi.slider,
|
|
161
|
+
isDragging ? 'transition-none' : 'transition-transform duration-300 ease-out',
|
|
162
|
+
canInteract ? 'hover:scale-[1.02] active:scale-[0.98]' : ''
|
|
136
163
|
]"
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
</
|
|
145
|
-
</
|
|
164
|
+
:style="{ transform: `translateX(${currentTranslateX}px)` }"
|
|
165
|
+
@pointerdown="handlePointerDown"
|
|
166
|
+
@pointermove="handlePointerMove"
|
|
167
|
+
@pointerup="handlePointerUp"
|
|
168
|
+
>
|
|
169
|
+
<slot name="slider" :verified="isVerified" :progress="progress">
|
|
170
|
+
<UIcon :name="isVerified ? successIcon : icon" :class="extendUi.icon" />
|
|
171
|
+
</slot>
|
|
172
|
+
</div>
|
|
146
173
|
</div>
|
|
147
174
|
</template>
|