vxe-table 4.1.20 → 4.2.0-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.en.md +2 -4
- package/README.md +2 -3
- package/README.zh-TW.md +2 -4
- package/es/button/index.js +1 -1
- package/es/checkbox/index.js +1 -1
- package/es/checkbox-group/index.js +1 -1
- package/es/colgroup/index.js +3 -2
- package/es/column/index.js +3 -2
- package/es/edit/src/hook.js +2 -1
- package/es/export/index.js +2 -2
- package/es/export/src/hook.js +2 -1
- package/es/export/src/util.js +3 -5
- package/es/filter/index.js +1 -1
- package/es/filter/src/hook.js +17 -10
- package/es/footer/index.js +1 -1
- package/es/footer/src/footer.js +3 -2
- package/es/form/index.js +1 -1
- package/es/form/src/form-gather.js +3 -3
- package/es/form/src/form-item.js +4 -4
- package/es/form/src/form.js +36 -43
- package/es/form/src/render.js +15 -10
- package/es/form/src/util.js +6 -0
- package/es/form-gather/index.js +1 -1
- package/es/form-item/index.js +1 -1
- package/es/grid/index.js +1 -1
- package/es/grid/src/grid.js +2 -1
- package/es/header/index.js +1 -1
- package/es/header/src/header.js +1 -1
- package/es/input/index.js +1 -1
- package/es/input/src/date.js +41 -0
- package/es/input/src/input.js +4 -51
- package/es/input/src/number.js +10 -0
- package/es/list/index.js +1 -1
- package/es/menu/index.js +1 -1
- package/es/modal/index.js +1 -1
- package/es/modal/src/modal.js +2 -1
- package/es/optgroup/index.js +1 -1
- package/es/option/index.js +1 -1
- package/es/pager/index.js +1 -1
- package/es/pager/src/pager.js +13 -2
- package/es/pulldown/index.js +1 -1
- package/es/radio/index.js +1 -1
- package/es/radio-button/index.js +1 -1
- package/es/radio-group/index.js +1 -1
- package/es/select/index.js +1 -1
- package/es/select/style.css +1 -1
- package/es/style.css +1 -1
- package/es/style.min.css +1 -1
- package/es/switch/index.js +1 -1
- package/es/table/index.js +1 -1
- package/es/table/src/body.js +32 -11
- package/es/table/src/cell.js +3 -3
- package/es/table/src/column.js +3 -1
- package/es/table/src/columnInfo.js +5 -4
- package/es/table/src/emits.js +5 -1
- package/es/table/src/props.js +5 -2
- package/es/table/src/table.js +120 -86
- package/es/table/src/util.js +5 -3
- package/es/textarea/index.js +1 -1
- package/es/toolbar/index.js +1 -1
- package/es/toolbar/src/toolbar.js +2 -1
- package/es/tools/dom.js +9 -0
- package/es/tools/log.js +13 -0
- package/es/tools/utils.js +0 -12
- package/es/tooltip/index.js +1 -1
- package/es/tooltip/src/tooltip.js +85 -45
- package/es/tooltip/style.css +1 -1
- package/es/v-x-e-table/index.js +1 -0
- package/es/v-x-e-table/src/conf.js +12 -7
- package/es/v-x-e-table/src/interceptor.js +1 -1
- package/es/v-x-e-table/src/renderer.js +2 -1
- package/es/v-x-e-table/src/store.js +1 -1
- package/helper/vetur/attributes.json +31 -11
- package/helper/vetur/tags.json +8 -3
- package/lib/button/index.js +3 -2
- package/lib/button/index.min.js +1 -1
- package/lib/checkbox/index.js +3 -2
- package/lib/checkbox/index.min.js +1 -1
- package/lib/checkbox-group/index.js +3 -2
- package/lib/checkbox-group/index.min.js +1 -1
- package/lib/colgroup/index.js +6 -4
- package/lib/colgroup/index.min.js +1 -1
- package/lib/column/index.js +6 -4
- package/lib/column/index.min.js +1 -1
- package/lib/edit/src/hook.js +7 -5
- package/lib/edit/src/hook.min.js +1 -1
- package/lib/export/index.js +5 -4
- package/lib/export/index.min.js +1 -1
- package/lib/export/src/hook.js +14 -12
- package/lib/export/src/hook.min.js +1 -1
- package/lib/export/src/util.js +7 -9
- package/lib/export/src/util.min.js +1 -1
- package/lib/filter/index.js +3 -2
- package/lib/filter/index.min.js +1 -1
- package/lib/filter/src/hook.js +24 -13
- package/lib/filter/src/hook.min.js +1 -1
- package/lib/footer/index.js +3 -2
- package/lib/footer/index.min.js +1 -1
- package/lib/footer/src/footer.js +7 -3
- package/lib/footer/src/footer.min.js +1 -1
- package/lib/form/index.js +3 -2
- package/lib/form/index.min.js +1 -1
- package/lib/form/src/form-gather.js +3 -3
- package/lib/form/src/form-gather.min.js +1 -1
- package/lib/form/src/form-item.js +3 -3
- package/lib/form/src/form-item.min.js +1 -1
- package/lib/form/src/form.js +45 -58
- package/lib/form/src/form.min.js +1 -1
- package/lib/form/src/render.js +24 -10
- package/lib/form/src/render.min.js +1 -1
- package/lib/form/src/util.js +11 -0
- package/lib/form/src/util.min.js +1 -1
- package/lib/form-gather/index.js +3 -2
- package/lib/form-gather/index.min.js +1 -1
- package/lib/form-item/index.js +3 -2
- package/lib/form-item/index.min.js +1 -1
- package/lib/grid/index.js +3 -2
- package/lib/grid/index.min.js +1 -1
- package/lib/grid/src/grid.js +16 -14
- package/lib/grid/src/grid.min.js +1 -1
- package/lib/header/index.js +3 -2
- package/lib/header/index.min.js +1 -1
- package/lib/header/src/header.js +1 -1
- package/lib/header/src/header.min.js +1 -1
- package/lib/index.umd.js +584 -415
- package/lib/index.umd.min.js +1 -2
- package/lib/input/index.js +3 -2
- package/lib/input/index.min.js +1 -1
- package/lib/input/src/date.js +56 -0
- package/lib/input/src/date.min.js +1 -0
- package/lib/input/src/input.js +13 -67
- package/lib/input/src/input.min.js +1 -1
- package/lib/input/src/number.js +23 -0
- package/lib/input/src/number.min.js +1 -0
- package/lib/list/index.js +3 -2
- package/lib/list/index.min.js +1 -1
- package/lib/menu/index.js +3 -2
- package/lib/menu/index.min.js +1 -1
- package/lib/modal/index.js +3 -2
- package/lib/modal/index.min.js +1 -1
- package/lib/modal/src/modal.js +3 -1
- package/lib/modal/src/modal.min.js +1 -1
- package/lib/optgroup/index.js +3 -2
- package/lib/optgroup/index.min.js +1 -1
- package/lib/option/index.js +3 -2
- package/lib/option/index.min.js +1 -1
- package/lib/pager/index.js +3 -2
- package/lib/pager/index.min.js +1 -1
- package/lib/pager/src/pager.js +15 -1
- package/lib/pager/src/pager.min.js +1 -1
- package/lib/pulldown/index.js +3 -2
- package/lib/pulldown/index.min.js +1 -1
- package/lib/radio/index.js +3 -2
- package/lib/radio/index.min.js +1 -1
- package/lib/radio-button/index.js +3 -2
- package/lib/radio-button/index.min.js +1 -1
- package/lib/radio-group/index.js +3 -2
- package/lib/radio-group/index.min.js +1 -1
- package/lib/select/index.js +3 -2
- package/lib/select/index.min.js +1 -1
- package/lib/select/style/style.css +1 -1
- package/lib/select/style/style.min.css +1 -1
- package/lib/style.css +1 -1
- package/lib/style.min.css +1 -1
- package/lib/switch/index.js +3 -2
- package/lib/switch/index.min.js +1 -1
- package/lib/table/index.js +3 -2
- package/lib/table/index.min.js +1 -1
- package/lib/table/src/body.js +32 -11
- package/lib/table/src/body.min.js +1 -1
- package/lib/table/src/cell.js +3 -3
- package/lib/table/src/cell.min.js +1 -1
- package/lib/table/src/column.js +3 -1
- package/lib/table/src/column.min.js +1 -1
- package/lib/table/src/columnInfo.js +13 -9
- package/lib/table/src/columnInfo.min.js +1 -1
- package/lib/table/src/emits.js +1 -1
- package/lib/table/src/emits.min.js +1 -1
- package/lib/table/src/props.js +5 -2
- package/lib/table/src/table.js +187 -148
- package/lib/table/src/table.min.js +1 -1
- package/lib/table/src/util.js +5 -3
- package/lib/table/src/util.min.js +1 -1
- package/lib/textarea/index.js +3 -2
- package/lib/textarea/index.min.js +1 -1
- package/lib/toolbar/index.js +3 -2
- package/lib/toolbar/index.min.js +1 -1
- package/lib/toolbar/src/toolbar.js +4 -2
- package/lib/toolbar/src/toolbar.min.js +1 -1
- package/lib/tools/dom.js +12 -1
- package/lib/tools/dom.min.js +1 -1
- package/lib/tools/log.js +29 -0
- package/lib/tools/log.min.js +1 -0
- package/lib/tools/utils.js +0 -20
- package/lib/tools/utils.min.js +1 -1
- package/lib/tooltip/index.js +3 -3
- package/lib/tooltip/index.min.js +1 -1
- package/lib/tooltip/src/tooltip.js +114 -60
- package/lib/tooltip/src/tooltip.min.js +1 -1
- package/lib/tooltip/style/style.css +1 -1
- package/lib/tooltip/style/style.min.css +1 -1
- package/lib/v-x-e-table/index.js +1 -0
- package/lib/v-x-e-table/index.min.js +1 -1
- package/lib/v-x-e-table/src/conf.js +12 -7
- package/lib/v-x-e-table/src/conf.min.js +1 -1
- package/lib/v-x-e-table/src/interceptor.js +3 -3
- package/lib/v-x-e-table/src/interceptor.min.js +1 -1
- package/lib/v-x-e-table/src/renderer.js +3 -1
- package/lib/v-x-e-table/src/renderer.min.js +1 -1
- package/lib/v-x-e-table/src/store.js +2 -2
- package/lib/v-x-e-table/src/store.min.js +1 -1
- package/package.json +4 -4
- package/packages/button/index.ts +2 -1
- package/packages/checkbox/index.ts +2 -1
- package/packages/checkbox-group/index.ts +2 -1
- package/packages/colgroup/index.ts +4 -2
- package/packages/column/index.ts +4 -2
- package/packages/edit/src/hook.ts +2 -1
- package/packages/export/index.ts +3 -2
- package/packages/export/src/hook.ts +2 -1
- package/packages/export/src/util.ts +4 -6
- package/packages/filter/index.ts +2 -1
- package/packages/filter/src/hook.ts +17 -10
- package/packages/footer/index.ts +2 -1
- package/packages/footer/src/footer.ts +3 -2
- package/packages/form/index.ts +2 -1
- package/packages/form/src/form-gather.ts +3 -3
- package/packages/form/src/form-item.ts +4 -4
- package/packages/form/src/form.ts +38 -46
- package/packages/form/src/render.ts +8 -6
- package/packages/form/src/util.ts +8 -1
- package/packages/form-gather/index.ts +2 -1
- package/packages/form-item/index.ts +2 -1
- package/packages/grid/index.ts +2 -1
- package/packages/grid/src/grid.ts +2 -1
- package/packages/header/index.ts +2 -1
- package/packages/header/src/header.ts +1 -1
- package/packages/input/index.ts +2 -1
- package/packages/input/src/date.ts +42 -0
- package/packages/input/src/input.ts +3 -51
- package/packages/input/src/number.ts +12 -0
- package/packages/list/index.ts +2 -1
- package/packages/menu/index.ts +2 -1
- package/packages/modal/index.ts +2 -1
- package/packages/modal/src/modal.ts +2 -1
- package/packages/optgroup/index.ts +2 -1
- package/packages/option/index.ts +2 -1
- package/packages/pager/index.ts +2 -1
- package/packages/pager/src/pager.ts +17 -3
- package/packages/pulldown/index.ts +2 -1
- package/packages/radio/index.ts +2 -1
- package/packages/radio-button/index.ts +2 -1
- package/packages/radio-group/index.ts +2 -1
- package/packages/select/index.ts +2 -1
- package/packages/switch/index.ts +2 -1
- package/packages/table/index.ts +2 -1
- package/packages/table/src/body.ts +33 -12
- package/packages/table/src/cell.ts +3 -3
- package/packages/table/src/column.ts +3 -1
- package/packages/table/src/columnInfo.ts +5 -3
- package/packages/table/src/emits.ts +5 -1
- package/packages/table/src/props.ts +5 -2
- package/packages/table/src/table.ts +120 -84
- package/packages/table/src/util.ts +5 -3
- package/packages/textarea/index.ts +2 -1
- package/packages/toolbar/index.ts +2 -1
- package/packages/toolbar/src/toolbar.ts +2 -1
- package/packages/tools/dom.ts +11 -0
- package/packages/tools/log.ts +16 -0
- package/packages/tools/utils.ts +0 -15
- package/packages/tooltip/index.ts +2 -1
- package/packages/tooltip/src/tooltip.ts +87 -46
- package/packages/v-x-e-table/index.ts +1 -0
- package/packages/v-x-e-table/src/conf.ts +12 -7
- package/packages/v-x-e-table/src/interceptor.ts +1 -1
- package/packages/v-x-e-table/src/renderer.ts +2 -1
- package/packages/v-x-e-table/src/store.ts +1 -1
- package/styles/select.scss +1 -1
- package/styles/tooltip.scss +1 -1
- package/types/all.d.ts +2 -2
- package/types/button.d.ts +54 -54
- package/types/checkbox-group.d.ts +21 -21
- package/types/checkbox.d.ts +30 -30
- package/types/colgroup.d.ts +16 -16
- package/types/column.d.ts +172 -161
- package/types/component.d.ts +9 -9
- package/types/edit.d.ts +35 -35
- package/types/export.d.ts +101 -101
- package/types/filter.d.ts +19 -19
- package/types/footer.d.ts +1 -1
- package/types/form-gather.d.ts +3 -3
- package/types/form-item.d.ts +68 -66
- package/types/form.d.ts +136 -131
- package/types/grid.d.ts +257 -257
- package/types/header.d.ts +1 -1
- package/types/icon.d.ts +1 -1
- package/types/input.d.ts +162 -162
- package/types/keyboard.d.ts +6 -6
- package/types/list.d.ts +54 -54
- package/types/menu.d.ts +33 -33
- package/types/modal.d.ts +160 -160
- package/types/optgroup.d.ts +5 -5
- package/types/option.d.ts +19 -19
- package/types/pager.d.ts +65 -61
- package/types/plugins/pro.d.ts +245 -215
- package/types/pulldown.d.ts +36 -36
- package/types/radio-button.d.ts +25 -25
- package/types/radio-group.d.ts +20 -20
- package/types/radio.d.ts +27 -27
- package/types/select.d.ts +82 -82
- package/types/switch.d.ts +40 -40
- package/types/table.d.ts +1422 -1336
- package/types/textarea.d.ts +71 -71
- package/types/toolbar.d.ts +65 -65
- package/types/tooltip.d.ts +50 -44
- package/types/v-x-e-table/commands.d.ts +12 -12
- package/types/v-x-e-table/formats.d.ts +10 -10
- package/types/v-x-e-table/hooks.d.ts +9 -9
- package/types/v-x-e-table/index.d.ts +51 -43
- package/types/v-x-e-table/interceptor.d.ts +26 -26
- package/types/v-x-e-table/menus.d.ts +13 -13
- package/types/v-x-e-table/renderer.d.ts +128 -128
- package/types/v-x-e-table/setup.d.ts +55 -55
- package/types/validator.d.ts +28 -28
package/types/form-item.d.ts
CHANGED
|
@@ -1,60 +1,61 @@
|
|
|
1
1
|
import { VNode } from 'vue'
|
|
2
2
|
import { VXEComponent } from './component'
|
|
3
3
|
import { VxeFormConstructor, VxeFormDefines, VxeFormPropTypes } from './form'
|
|
4
|
+
import { VxeTooltipPropTypes } from './tooltip'
|
|
4
5
|
import { VxeGlobalRendererHandles } from './v-x-e-table'
|
|
5
6
|
|
|
6
7
|
/**
|
|
7
8
|
* 组件 - 表单项
|
|
8
9
|
* @example import { FormItem as VxeFormItem } from 'vxe-table'
|
|
9
10
|
*/
|
|
10
|
-
export const FormItem: VXEComponent<VxeFormItemProps
|
|
11
|
+
export const FormItem: VXEComponent<VxeFormItemProps>
|
|
11
12
|
|
|
12
13
|
export interface VxeFormItemProps {
|
|
13
14
|
/**
|
|
14
15
|
* 标题
|
|
15
16
|
*/
|
|
16
|
-
title?: VxeFormItemPropTypes.Title
|
|
17
|
+
title?: VxeFormItemPropTypes.Title
|
|
17
18
|
/**
|
|
18
19
|
* 字段名
|
|
19
20
|
*/
|
|
20
|
-
field?: VxeFormItemPropTypes.Field
|
|
21
|
+
field?: VxeFormItemPropTypes.Field
|
|
21
22
|
/**
|
|
22
23
|
* 栅格占据的列数(共 24 分栏)
|
|
23
24
|
*/
|
|
24
|
-
span?: VxeFormItemPropTypes.Span
|
|
25
|
+
span?: VxeFormItemPropTypes.Span
|
|
25
26
|
/**
|
|
26
27
|
* 内容对齐方式
|
|
27
28
|
*/
|
|
28
|
-
align?: VxeFormItemPropTypes.Align
|
|
29
|
+
align?: VxeFormItemPropTypes.Align
|
|
29
30
|
/**
|
|
30
31
|
* 标题对齐方式
|
|
31
32
|
*/
|
|
32
|
-
titleAlign?: VxeFormItemPropTypes.TitleAlign
|
|
33
|
+
titleAlign?: VxeFormItemPropTypes.TitleAlign
|
|
33
34
|
/**
|
|
34
35
|
* 标题宽度
|
|
35
36
|
*/
|
|
36
|
-
titleWidth?: VxeFormItemPropTypes.TitleWidth
|
|
37
|
+
titleWidth?: VxeFormItemPropTypes.TitleWidth
|
|
37
38
|
/**
|
|
38
39
|
* 给表单项附加 className
|
|
39
40
|
*/
|
|
40
|
-
className?: VxeFormItemPropTypes.ClassName
|
|
41
|
+
className?: VxeFormItemPropTypes.ClassName
|
|
41
42
|
/**
|
|
42
43
|
* 前缀配置项
|
|
43
44
|
*/
|
|
44
|
-
titlePrefix?: VxeFormItemPropTypes.TitlePrefix
|
|
45
|
+
titlePrefix?: VxeFormItemPropTypes.TitlePrefix
|
|
45
46
|
/**
|
|
46
47
|
* 后缀配置项
|
|
47
48
|
*/
|
|
48
|
-
titleSuffix?: VxeFormItemPropTypes.TitleSuffix
|
|
49
|
-
titleOverflow?: VxeFormItemPropTypes.TitleOverflow
|
|
49
|
+
titleSuffix?: VxeFormItemPropTypes.TitleSuffix
|
|
50
|
+
titleOverflow?: VxeFormItemPropTypes.TitleOverflow
|
|
50
51
|
/**
|
|
51
52
|
* 重置时的默认值
|
|
52
53
|
*/
|
|
53
|
-
resetValue?: VxeFormItemPropTypes.ResetValue
|
|
54
|
+
resetValue?: VxeFormItemPropTypes.ResetValue
|
|
54
55
|
/**
|
|
55
56
|
* 是否显示
|
|
56
57
|
*/
|
|
57
|
-
visible?: VxeFormItemPropTypes.Visible
|
|
58
|
+
visible?: VxeFormItemPropTypes.Visible
|
|
58
59
|
/**
|
|
59
60
|
* 该方法的返回值用来决定该项是否显示
|
|
60
61
|
*/
|
|
@@ -62,58 +63,59 @@ export interface VxeFormItemProps {
|
|
|
62
63
|
/**
|
|
63
64
|
* 默认收起
|
|
64
65
|
*/
|
|
65
|
-
folding?: VxeFormItemPropTypes.Folding
|
|
66
|
+
folding?: VxeFormItemPropTypes.Folding
|
|
66
67
|
/**
|
|
67
68
|
* 折叠节点
|
|
68
69
|
*/
|
|
69
|
-
collapseNode?: VxeFormItemPropTypes.CollapseNode
|
|
70
|
+
collapseNode?: VxeFormItemPropTypes.CollapseNode
|
|
70
71
|
/**
|
|
71
72
|
* 项渲染配置项
|
|
72
73
|
*/
|
|
73
|
-
itemRender?: FormItemRenderOptions
|
|
74
|
-
slots?: VxeFormItemPropTypes.Slots
|
|
75
|
-
children?: VxeFormItemProps[]
|
|
74
|
+
itemRender?: FormItemRenderOptions
|
|
75
|
+
slots?: VxeFormItemPropTypes.Slots
|
|
76
|
+
children?: VxeFormItemProps[]
|
|
76
77
|
}
|
|
77
78
|
|
|
78
79
|
export namespace VxeFormItemPropTypes {
|
|
79
|
-
export type Title = string
|
|
80
|
-
export type Field = string
|
|
81
|
-
export type Span = VxeFormPropTypes.Span
|
|
82
|
-
export type Align = VxeFormPropTypes.Align
|
|
83
|
-
export type TitleAlign = VxeFormPropTypes.TitleAlign
|
|
84
|
-
export type TitleWidth = VxeFormPropTypes.TitleWidth
|
|
80
|
+
export type Title = string
|
|
81
|
+
export type Field = string
|
|
82
|
+
export type Span = VxeFormPropTypes.Span
|
|
83
|
+
export type Align = VxeFormPropTypes.Align
|
|
84
|
+
export type TitleAlign = VxeFormPropTypes.TitleAlign
|
|
85
|
+
export type TitleWidth = VxeFormPropTypes.TitleWidth
|
|
85
86
|
|
|
86
87
|
interface ClassNameParams {
|
|
87
|
-
$form: VxeFormConstructor
|
|
88
|
-
data: any
|
|
89
|
-
item: VxeFormDefines.ItemInfo
|
|
90
|
-
property: string
|
|
88
|
+
$form: VxeFormConstructor
|
|
89
|
+
data: any
|
|
90
|
+
item: VxeFormDefines.ItemInfo
|
|
91
|
+
property: string
|
|
91
92
|
}
|
|
92
|
-
export type ClassName = string | ((params: ClassNameParams) => string)
|
|
93
|
+
export type ClassName = string | ((params: ClassNameParams) => string)
|
|
93
94
|
|
|
94
95
|
interface PrefixOption {
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
96
|
+
useHTML?: VxeTooltipPropTypes.UseHTML
|
|
97
|
+
content?: VxeTooltipPropTypes.Content
|
|
98
|
+
enterable?: VxeTooltipPropTypes.Enterable
|
|
99
|
+
theme?: VxeTooltipPropTypes.Theme
|
|
100
|
+
icon?: string
|
|
99
101
|
/**
|
|
100
102
|
* @deprecated 已废弃,请使用 content
|
|
101
103
|
*/
|
|
102
|
-
message?: string
|
|
104
|
+
message?: string
|
|
103
105
|
}
|
|
104
106
|
export type TitlePrefix = PrefixOption
|
|
105
107
|
export type TitleSuffix = PrefixOption
|
|
106
108
|
export type TitleOverflow = VxeFormPropTypes.TitleOverflow
|
|
107
109
|
|
|
108
|
-
export type ResetValue = any
|
|
109
|
-
export type Visible = boolean
|
|
110
|
-
export type VisibleMethod = (params: FormItemVisibleParams) => boolean
|
|
111
|
-
export type Folding = boolean
|
|
112
|
-
export type CollapseNode = boolean
|
|
113
|
-
export type ItemRender = FormItemRenderOptions
|
|
110
|
+
export type ResetValue = any
|
|
111
|
+
export type Visible = boolean
|
|
112
|
+
export type VisibleMethod = (params: FormItemVisibleParams) => boolean
|
|
113
|
+
export type Folding = boolean
|
|
114
|
+
export type CollapseNode = boolean
|
|
115
|
+
export type ItemRender = FormItemRenderOptions
|
|
114
116
|
export type Slots = {
|
|
115
|
-
title?: string | ((params: FormItemTitleRenderParams) => JSX.Element[] | VNode[] | string[]) | null
|
|
116
|
-
default?: string | ((params: FormItemContentRenderParams) => JSX.Element[] | VNode[] | string[]) | null
|
|
117
|
+
title?: string | ((params: FormItemTitleRenderParams) => JSX.Element[] | VNode[] | string[]) | null
|
|
118
|
+
default?: string | ((params: FormItemContentRenderParams) => JSX.Element[] | VNode[] | string[]) | null
|
|
117
119
|
}
|
|
118
120
|
}
|
|
119
121
|
|
|
@@ -124,68 +126,68 @@ export interface FormItemRenderOptions extends VxeGlobalRendererHandles.RenderOp
|
|
|
124
126
|
/**
|
|
125
127
|
* 下拉选项列表(需要渲染器支持)
|
|
126
128
|
*/
|
|
127
|
-
options?: any[]
|
|
129
|
+
options?: any[]
|
|
128
130
|
/**
|
|
129
131
|
* 下拉选项属性参数配置(需要渲染器支持)
|
|
130
132
|
*/
|
|
131
|
-
optionProps?: VxeGlobalRendererHandles.RenderOptionProps
|
|
133
|
+
optionProps?: VxeGlobalRendererHandles.RenderOptionProps
|
|
132
134
|
/**
|
|
133
135
|
* 下拉分组选项列表(需要渲染器支持)
|
|
134
136
|
*/
|
|
135
|
-
optionGroups?: any[]
|
|
137
|
+
optionGroups?: any[]
|
|
136
138
|
/**
|
|
137
139
|
* 下拉分组选项属性参数配置(需要渲染器支持)
|
|
138
140
|
*/
|
|
139
|
-
optionGroupProps?: VxeGlobalRendererHandles.RenderOptionGroupProps
|
|
141
|
+
optionGroupProps?: VxeGlobalRendererHandles.RenderOptionGroupProps
|
|
140
142
|
/**
|
|
141
143
|
* 渲染组件的内容(需要渲染器支持)
|
|
142
144
|
*/
|
|
143
|
-
content?: string
|
|
144
|
-
autofocus?: boolean
|
|
145
|
-
defaultValue?: ((params: { item: VxeFormItemProps }) => any) | null | undefined | string | number | RegExp | object | any[] | Date
|
|
145
|
+
content?: string
|
|
146
|
+
autofocus?: boolean
|
|
147
|
+
defaultValue?: ((params: { item: VxeFormItemProps }) => any) | null | undefined | string | number | RegExp | object | any[] | Date
|
|
146
148
|
}
|
|
147
149
|
|
|
148
150
|
/**
|
|
149
151
|
* 项标题渲染参数
|
|
150
152
|
*/
|
|
151
153
|
export interface FormItemTitleRenderParams {
|
|
152
|
-
$form: VxeFormConstructor
|
|
153
|
-
data: any
|
|
154
|
-
item: VxeFormDefines.ItemInfo
|
|
155
|
-
property: string
|
|
154
|
+
$form: VxeFormConstructor
|
|
155
|
+
data: any
|
|
156
|
+
item: VxeFormDefines.ItemInfo
|
|
157
|
+
property: string
|
|
156
158
|
}
|
|
157
159
|
|
|
158
160
|
/**
|
|
159
161
|
* 项内容渲染参数
|
|
160
162
|
*/
|
|
161
163
|
export interface FormItemContentRenderParams {
|
|
162
|
-
$form: VxeFormConstructor
|
|
163
|
-
data: any
|
|
164
|
-
item: VxeFormDefines.ItemInfo
|
|
165
|
-
property: string
|
|
164
|
+
$form: VxeFormConstructor
|
|
165
|
+
data: any
|
|
166
|
+
item: VxeFormDefines.ItemInfo
|
|
167
|
+
property: string
|
|
166
168
|
}
|
|
167
169
|
|
|
168
170
|
/**
|
|
169
171
|
* 项可视方法参数
|
|
170
172
|
*/
|
|
171
173
|
export interface FormItemVisibleParams {
|
|
172
|
-
$form: VxeFormConstructor
|
|
173
|
-
data: any
|
|
174
|
-
item: VxeFormDefines.ItemInfo
|
|
175
|
-
property: string
|
|
174
|
+
$form: VxeFormConstructor
|
|
175
|
+
data: any
|
|
176
|
+
item: VxeFormDefines.ItemInfo
|
|
177
|
+
property: string
|
|
176
178
|
}
|
|
177
179
|
|
|
178
180
|
/**
|
|
179
181
|
* 项重置方法参数
|
|
180
182
|
*/
|
|
181
183
|
export interface FormItemResetParams {
|
|
182
|
-
$form: VxeFormConstructor
|
|
183
|
-
data: any
|
|
184
|
-
item: VxeFormDefines.ItemInfo
|
|
185
|
-
field: string
|
|
184
|
+
$form: VxeFormConstructor
|
|
185
|
+
data: any
|
|
186
|
+
item: VxeFormDefines.ItemInfo
|
|
187
|
+
field: string
|
|
186
188
|
/**
|
|
187
189
|
* 已废弃,该属性被 field 替换
|
|
188
190
|
* @deprecated
|
|
189
191
|
*/
|
|
190
|
-
property: string
|
|
192
|
+
property: string
|
|
191
193
|
}
|
package/types/form.d.ts
CHANGED
|
@@ -6,44 +6,43 @@ import { VxeFormItemProps, VxeFormItemPropTypes } from './form-item'
|
|
|
6
6
|
* 组件 - 表单
|
|
7
7
|
* @example import { Form as VxeForm } from 'vxe-table'
|
|
8
8
|
*/
|
|
9
|
-
export const Form: VXEComponent<VxeFormProps, VxeFormEventProps
|
|
9
|
+
export const Form: VXEComponent<VxeFormProps, VxeFormEventProps>
|
|
10
10
|
|
|
11
|
-
export type VxeFormInstance = ComponentPublicInstance<VxeFormProps, VxeFormConstructor
|
|
11
|
+
export type VxeFormInstance = ComponentPublicInstance<VxeFormProps, VxeFormConstructor>
|
|
12
12
|
|
|
13
13
|
export interface VxeFormConstructor extends VxeComponentBase, VxeFormMethods {
|
|
14
|
-
props: VxeFormProps
|
|
15
|
-
context: SetupContext<VxeFormEmits
|
|
16
|
-
reactData: FormReactData
|
|
17
|
-
internalData: FormInternalData
|
|
18
|
-
getRefMaps(): FormPrivateRef
|
|
19
|
-
getComputeMaps(): FormPrivateComputed
|
|
20
|
-
renderVN: RenderFunction
|
|
14
|
+
props: VxeFormProps
|
|
15
|
+
context: SetupContext<VxeFormEmits>
|
|
16
|
+
reactData: FormReactData
|
|
17
|
+
internalData: FormInternalData
|
|
18
|
+
getRefMaps(): FormPrivateRef
|
|
19
|
+
getComputeMaps(): FormPrivateComputed
|
|
20
|
+
renderVN: RenderFunction
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
export interface FormPrivateRef {
|
|
24
|
-
refElem: Ref<HTMLFormElement
|
|
24
|
+
refElem: Ref<HTMLFormElement>
|
|
25
25
|
}
|
|
26
26
|
export interface VxeFormPrivateRef extends FormPrivateRef { }
|
|
27
27
|
|
|
28
28
|
export interface FormPrivateComputed {
|
|
29
|
-
computeSize: ComputedRef<VxeFormPropTypes.Size
|
|
30
|
-
computeValidOpts: ComputedRef<VxeFormPropTypes.ValidOpts
|
|
31
|
-
computeTooltipOpts: ComputedRef<VxeFormPropTypes.TooltipOpts
|
|
29
|
+
computeSize: ComputedRef<VxeFormPropTypes.Size>
|
|
30
|
+
computeValidOpts: ComputedRef<VxeFormPropTypes.ValidOpts>
|
|
31
|
+
computeTooltipOpts: ComputedRef<VxeFormPropTypes.TooltipOpts>
|
|
32
32
|
}
|
|
33
33
|
export interface VxeFormPrivateComputed extends FormPrivateComputed { }
|
|
34
34
|
|
|
35
35
|
export interface FormReactData {
|
|
36
|
-
collapseAll: boolean
|
|
37
|
-
staticItems: any[]
|
|
38
|
-
formItems: VxeFormDefines.ItemInfo[]
|
|
36
|
+
collapseAll: boolean
|
|
37
|
+
staticItems: any[]
|
|
38
|
+
formItems: VxeFormDefines.ItemInfo[]
|
|
39
39
|
}
|
|
40
40
|
|
|
41
41
|
export interface FormInternalData {
|
|
42
|
-
tooltipTimeout: any
|
|
43
|
-
tooltipActive: boolean;
|
|
42
|
+
tooltipTimeout: any
|
|
44
43
|
tooltipStore: {
|
|
45
|
-
item: VxeFormDefines.ItemInfo | null
|
|
46
|
-
visible: boolean
|
|
44
|
+
item: VxeFormDefines.ItemInfo | null
|
|
45
|
+
visible: boolean
|
|
47
46
|
}
|
|
48
47
|
}
|
|
49
48
|
|
|
@@ -57,216 +56,222 @@ export type VxeFormEmits = [
|
|
|
57
56
|
]
|
|
58
57
|
|
|
59
58
|
export namespace VxeFormPropTypes {
|
|
60
|
-
export type Size = SizeType
|
|
61
|
-
export type CollapseStatus = boolean
|
|
62
|
-
export type Loading = boolean
|
|
63
|
-
export type Data = any
|
|
64
|
-
export type Span = string | number
|
|
65
|
-
export type Align = 'left' | 'center' | 'right' | null
|
|
66
|
-
export type TitleAlign = Align
|
|
67
|
-
export type TitleWidth = string | number
|
|
68
|
-
export type TitleColon = boolean
|
|
69
|
-
export type TitleAsterisk = boolean
|
|
70
|
-
export type TitleOverflow = boolean | 'ellipsis' | 'title' | 'tooltip' | null
|
|
59
|
+
export type Size = SizeType
|
|
60
|
+
export type CollapseStatus = boolean
|
|
61
|
+
export type Loading = boolean
|
|
62
|
+
export type Data = any
|
|
63
|
+
export type Span = string | number
|
|
64
|
+
export type Align = 'left' | 'center' | 'right' | null
|
|
65
|
+
export type TitleAlign = Align
|
|
66
|
+
export type TitleWidth = string | number
|
|
67
|
+
export type TitleColon = boolean
|
|
68
|
+
export type TitleAsterisk = boolean
|
|
69
|
+
export type TitleOverflow = boolean | 'ellipsis' | 'title' | 'tooltip' | null
|
|
71
70
|
|
|
72
71
|
interface ClassNameParams {
|
|
73
|
-
$form: VxeFormConstructor
|
|
74
|
-
data: any
|
|
75
|
-
items: VxeFormDefines.ItemInfo[]
|
|
72
|
+
$form: VxeFormConstructor
|
|
73
|
+
data: any
|
|
74
|
+
items: VxeFormDefines.ItemInfo[]
|
|
76
75
|
}
|
|
77
|
-
export type ClassName = string | ((params: ClassNameParams) => string)
|
|
76
|
+
export type ClassName = string | ((params: ClassNameParams) => string)
|
|
78
77
|
|
|
79
|
-
export type Items = VxeFormItemProps[]
|
|
78
|
+
export type Items = VxeFormItemProps[]
|
|
80
79
|
|
|
81
80
|
/**
|
|
82
81
|
* 校验规则配置项
|
|
83
82
|
*/
|
|
84
83
|
export interface Rules {
|
|
85
|
-
[field: string]: VxeFormDefines.FormRule[]
|
|
84
|
+
[field: string]: VxeFormDefines.FormRule[]
|
|
86
85
|
}
|
|
87
86
|
|
|
88
|
-
export type PreventSubmit = boolean
|
|
87
|
+
export type PreventSubmit = boolean
|
|
89
88
|
export type ValidConfig = {
|
|
90
|
-
autoPos?: boolean
|
|
91
|
-
showMessage?: boolean
|
|
92
|
-
}
|
|
89
|
+
autoPos?: boolean
|
|
90
|
+
showMessage?: boolean
|
|
91
|
+
}
|
|
93
92
|
export interface ValidOpts extends ValidConfig { }
|
|
94
93
|
|
|
95
94
|
/**
|
|
96
95
|
* 提示信息配置项
|
|
97
96
|
*/
|
|
98
97
|
export interface TooltipConfig {
|
|
99
|
-
theme?: 'dark' | 'light'
|
|
100
|
-
enterable?: boolean
|
|
101
|
-
leaveDelay?: number
|
|
102
|
-
leaveMethod?: (params: { $event: Event }) => boolean
|
|
98
|
+
theme?: 'dark' | 'light'
|
|
99
|
+
enterable?: boolean
|
|
100
|
+
leaveDelay?: number
|
|
101
|
+
leaveMethod?: (params: { $event: Event }) => boolean
|
|
103
102
|
}
|
|
104
103
|
export interface TooltipOpts extends TooltipConfig { }
|
|
105
104
|
|
|
106
|
-
export type CustomLayout = boolean
|
|
105
|
+
export type CustomLayout = boolean
|
|
107
106
|
}
|
|
108
107
|
|
|
109
108
|
export type VxeFormProps<D = any> = {
|
|
110
|
-
size?: VxeFormPropTypes.Size
|
|
111
|
-
collapseStatus?: VxeFormPropTypes.CollapseStatus
|
|
112
|
-
loading?: VxeFormPropTypes.Loading
|
|
113
|
-
data?: D
|
|
114
|
-
span?: VxeFormPropTypes.Span
|
|
115
|
-
align?: VxeFormPropTypes.Align
|
|
116
|
-
titleAlign?: VxeFormPropTypes.TitleAlign
|
|
117
|
-
titleWidth?: VxeFormPropTypes.TitleWidth
|
|
118
|
-
titleColon?: VxeFormPropTypes.TitleColon
|
|
119
|
-
titleAsterisk?: VxeFormPropTypes.TitleAsterisk
|
|
120
|
-
titleOverflow?: VxeFormPropTypes.TitleOverflow
|
|
121
|
-
className?: VxeFormPropTypes.ClassName
|
|
122
|
-
items?: VxeFormPropTypes.Items
|
|
123
|
-
rules?: VxeFormPropTypes.Rules
|
|
124
|
-
preventSubmit?: VxeFormPropTypes.PreventSubmit
|
|
125
|
-
validConfig?: VxeFormPropTypes.ValidConfig
|
|
126
|
-
tooltipConfig?: VxeFormPropTypes.TooltipConfig
|
|
127
|
-
customLayout?: VxeFormPropTypes.CustomLayout
|
|
109
|
+
size?: VxeFormPropTypes.Size
|
|
110
|
+
collapseStatus?: VxeFormPropTypes.CollapseStatus
|
|
111
|
+
loading?: VxeFormPropTypes.Loading
|
|
112
|
+
data?: D
|
|
113
|
+
span?: VxeFormPropTypes.Span
|
|
114
|
+
align?: VxeFormPropTypes.Align
|
|
115
|
+
titleAlign?: VxeFormPropTypes.TitleAlign
|
|
116
|
+
titleWidth?: VxeFormPropTypes.TitleWidth
|
|
117
|
+
titleColon?: VxeFormPropTypes.TitleColon
|
|
118
|
+
titleAsterisk?: VxeFormPropTypes.TitleAsterisk
|
|
119
|
+
titleOverflow?: VxeFormPropTypes.TitleOverflow
|
|
120
|
+
className?: VxeFormPropTypes.ClassName
|
|
121
|
+
items?: VxeFormPropTypes.Items
|
|
122
|
+
rules?: VxeFormPropTypes.Rules
|
|
123
|
+
preventSubmit?: VxeFormPropTypes.PreventSubmit
|
|
124
|
+
validConfig?: VxeFormPropTypes.ValidConfig
|
|
125
|
+
tooltipConfig?: VxeFormPropTypes.TooltipConfig
|
|
126
|
+
customLayout?: VxeFormPropTypes.CustomLayout
|
|
128
127
|
}
|
|
129
128
|
|
|
130
129
|
export interface FormMethods {
|
|
131
|
-
dispatchEvent(type: ValueOf<VxeFormEmits>, params: any, evnt: Event): void
|
|
130
|
+
dispatchEvent(type: ValueOf<VxeFormEmits>, params: any, evnt: Event): void
|
|
132
131
|
/**
|
|
133
132
|
* 重置表单
|
|
134
133
|
*/
|
|
135
|
-
reset(): Promise<any
|
|
134
|
+
reset(): Promise<any>
|
|
136
135
|
/**
|
|
137
136
|
* 对表单进行校验,参数为一个回调函数。该回调函数会在校验结束后被调用 callback(errMap)。若不传入回调函数,则会返回一个 promise
|
|
138
137
|
* @param callback 回调函数
|
|
139
138
|
*/
|
|
140
|
-
validate(callback?: (errMap?: VxeFormDefines.ValidateErrorMapParams) => void): Promise<any
|
|
139
|
+
validate(callback?: (errMap?: VxeFormDefines.ValidateErrorMapParams) => void): Promise<any>
|
|
141
140
|
/**
|
|
142
141
|
* 对表单指定项进行校验,参数为一个回调函数。该回调函数会在校验结束后被调用 callback(errMap)。若不传入回调函数,则会返回一个 promise
|
|
143
142
|
* @param callback 回调函数
|
|
144
143
|
*/
|
|
145
|
-
validateField(field: VxeFormItemPropTypes.Field, callback?: (errMap?: VxeFormDefines.ValidateErrorMapParams) => void): Promise<any
|
|
144
|
+
validateField(field: VxeFormItemPropTypes.Field | VxeFormDefines.ItemInfo, callback?: (errMap?: VxeFormDefines.ValidateErrorMapParams) => void): Promise<any>
|
|
146
145
|
/**
|
|
147
146
|
* 手动清除校验状态,如果指定 field 则清除指定的项,否则清除整个表单
|
|
148
147
|
* @param field 字段名
|
|
149
148
|
*/
|
|
150
|
-
clearValidate(field?:
|
|
149
|
+
clearValidate(field?: VxeFormItemPropTypes.Field | VxeFormDefines.ItemInfo): Promise<any>
|
|
151
150
|
/**
|
|
152
151
|
* 更新项状态
|
|
153
152
|
* 当使用自定义渲染时可能会用到
|
|
154
153
|
* @param scope 插槽对象
|
|
155
154
|
*/
|
|
156
|
-
updateStatus(scope: any, itemValue?: any): void
|
|
155
|
+
updateStatus(scope: any, itemValue?: any): void
|
|
157
156
|
/**
|
|
158
157
|
* 获取表单项列表
|
|
159
158
|
*/
|
|
160
|
-
getItems(): VxeFormDefines.ItemInfo[]
|
|
159
|
+
getItems(): VxeFormDefines.ItemInfo[]
|
|
160
|
+
/**
|
|
161
|
+
* 根据列的字段名获取表单项
|
|
162
|
+
* @param field 字段名
|
|
163
|
+
*
|
|
164
|
+
*/
|
|
165
|
+
getItemByField(field: VxeFormItemPropTypes.Field): VxeFormDefines.ItemInfo | null
|
|
161
166
|
/**
|
|
162
167
|
* 关闭 tooltip 提示
|
|
163
168
|
*/
|
|
164
|
-
closeTooltip(): Promise<any
|
|
169
|
+
closeTooltip(): Promise<any>
|
|
165
170
|
/**
|
|
166
171
|
* 手动切换折叠状态
|
|
167
172
|
*/
|
|
168
|
-
toggleCollapse(): Promise<any
|
|
173
|
+
toggleCollapse(): Promise<any>
|
|
169
174
|
}
|
|
170
175
|
export interface VxeFormMethods extends FormMethods { }
|
|
171
176
|
|
|
172
177
|
export interface FormPrivateMethods {
|
|
173
|
-
callSlot<T>(slotFunc: ((params: T) => any[]) | string | null, params: T): VNode[]
|
|
174
|
-
toggleCollapseEvent(evnt: Event): void
|
|
175
|
-
|
|
176
|
-
item: VxeFormDefines.ItemInfo
|
|
177
|
-
}): void
|
|
178
|
-
|
|
178
|
+
callSlot<T>(slotFunc: ((params: T) => any[]) | string | null, params: T): VNode[]
|
|
179
|
+
toggleCollapseEvent(evnt: Event): void
|
|
180
|
+
triggerTitleTipEvent(evnt: MouseEvent, params: {
|
|
181
|
+
item: VxeFormDefines.ItemInfo
|
|
182
|
+
}): void
|
|
183
|
+
handleTitleTipLeaveEvent(): void
|
|
179
184
|
}
|
|
180
185
|
export interface VxeFormPrivateMethods extends FormPrivateMethods { }
|
|
181
186
|
|
|
182
187
|
export namespace VxeFormDefines {
|
|
183
188
|
export class ItemInfo {
|
|
184
|
-
id: string
|
|
185
|
-
|
|
186
|
-
title: VxeFormItemPropTypes.Title
|
|
187
|
-
field: VxeFormItemPropTypes.Field
|
|
188
|
-
span: VxeFormItemPropTypes.Span
|
|
189
|
-
align: VxeFormItemPropTypes.Align
|
|
190
|
-
titleAlign: VxeFormItemPropTypes.TitleAlign
|
|
191
|
-
titleWidth: VxeFormItemPropTypes.TitleWidth
|
|
192
|
-
titlePrefix: VxeFormItemPropTypes.TitlePrefix
|
|
193
|
-
titleSuffix: VxeFormItemPropTypes.TitleSuffix
|
|
194
|
-
titleOverflow: VxeFormItemPropTypes.TitleOverflow
|
|
195
|
-
resetValue: VxeFormItemPropTypes.ResetValue
|
|
196
|
-
visibleMethod: VxeFormItemPropTypes.VisibleMethod
|
|
197
|
-
visible: VxeFormItemPropTypes.Visible
|
|
198
|
-
folding: VxeFormItemPropTypes.Folding
|
|
199
|
-
collapseNode: VxeFormItemPropTypes.CollapseNode
|
|
200
|
-
className: VxeFormItemPropTypes.ClassName
|
|
201
|
-
itemRender: VxeFormItemPropTypes.ItemRender
|
|
189
|
+
id: string
|
|
190
|
+
|
|
191
|
+
title: VxeFormItemPropTypes.Title
|
|
192
|
+
field: VxeFormItemPropTypes.Field
|
|
193
|
+
span: VxeFormItemPropTypes.Span
|
|
194
|
+
align: VxeFormItemPropTypes.Align
|
|
195
|
+
titleAlign: VxeFormItemPropTypes.TitleAlign
|
|
196
|
+
titleWidth: VxeFormItemPropTypes.TitleWidth
|
|
197
|
+
titlePrefix: VxeFormItemPropTypes.TitlePrefix
|
|
198
|
+
titleSuffix: VxeFormItemPropTypes.TitleSuffix
|
|
199
|
+
titleOverflow: VxeFormItemPropTypes.TitleOverflow
|
|
200
|
+
resetValue: VxeFormItemPropTypes.ResetValue
|
|
201
|
+
visibleMethod: VxeFormItemPropTypes.VisibleMethod
|
|
202
|
+
visible: VxeFormItemPropTypes.Visible
|
|
203
|
+
folding: VxeFormItemPropTypes.Folding
|
|
204
|
+
collapseNode: VxeFormItemPropTypes.CollapseNode
|
|
205
|
+
className: VxeFormItemPropTypes.ClassName
|
|
206
|
+
itemRender: VxeFormItemPropTypes.ItemRender
|
|
202
207
|
// 渲染属性
|
|
203
|
-
showError: boolean
|
|
204
|
-
errRule: any
|
|
205
|
-
slots: VxeFormItemPropTypes.Slots
|
|
206
|
-
children: ItemInfo[]
|
|
208
|
+
showError: boolean
|
|
209
|
+
errRule: any
|
|
210
|
+
slots: VxeFormItemPropTypes.Slots
|
|
211
|
+
children: ItemInfo[]
|
|
207
212
|
}
|
|
208
213
|
|
|
209
214
|
export interface FormRule {
|
|
210
215
|
/**
|
|
211
216
|
* 是否必填
|
|
212
217
|
*/
|
|
213
|
-
required?: boolean
|
|
218
|
+
required?: boolean
|
|
214
219
|
/**
|
|
215
220
|
* 最小长度/值
|
|
216
221
|
*/
|
|
217
|
-
min?: number
|
|
222
|
+
min?: number
|
|
218
223
|
/**
|
|
219
224
|
* 最大长度/值
|
|
220
225
|
*/
|
|
221
|
-
max?: number
|
|
226
|
+
max?: number
|
|
222
227
|
/**
|
|
223
228
|
* 数据类型
|
|
224
229
|
*/
|
|
225
|
-
type?: 'number' | 'string' | 'array'
|
|
230
|
+
type?: 'number' | 'string' | 'array'
|
|
226
231
|
/**
|
|
227
232
|
* 使用正则表达式校验
|
|
228
233
|
*/
|
|
229
|
-
pattern?: string | RegExp
|
|
234
|
+
pattern?: string | RegExp
|
|
230
235
|
/**
|
|
231
236
|
* 使用自定义校验函数,接收一个 Promise
|
|
232
237
|
* @param params 参数
|
|
233
238
|
*/
|
|
234
|
-
validator?(params: ValidateErrorParams): void | Error | Promise<any
|
|
239
|
+
validator?(params: ValidateErrorParams): void | Error | Promise<any>
|
|
235
240
|
/**
|
|
236
241
|
* 提示消息
|
|
237
242
|
*/
|
|
238
|
-
content?: string
|
|
239
|
-
trigger?: 'change'
|
|
240
|
-
maxWidth?: number
|
|
243
|
+
content?: string
|
|
244
|
+
trigger?: 'change'
|
|
245
|
+
maxWidth?: number
|
|
241
246
|
/**
|
|
242
247
|
* @deprecated 已废弃,请使用 content
|
|
243
248
|
*/
|
|
244
|
-
message?: string
|
|
249
|
+
message?: string
|
|
245
250
|
}
|
|
246
251
|
|
|
247
252
|
interface ValidateErrorParams {
|
|
248
253
|
$form: VxeFormConstructor,
|
|
249
254
|
itemValue: any,
|
|
250
|
-
rule: VxeFormDefines.FormRule
|
|
251
|
-
rules: VxeFormDefines.FormRule[]
|
|
252
|
-
data: any
|
|
253
|
-
field: string
|
|
255
|
+
rule: VxeFormDefines.FormRule
|
|
256
|
+
rules: VxeFormDefines.FormRule[]
|
|
257
|
+
data: any
|
|
258
|
+
field: string
|
|
254
259
|
/**
|
|
255
260
|
* 已废弃,该属性被 field 替换
|
|
256
261
|
*/
|
|
257
|
-
property: string
|
|
262
|
+
property: string
|
|
258
263
|
}
|
|
259
264
|
|
|
260
265
|
export interface ValidateErrorMapParams {
|
|
261
|
-
[field: string]: ValidateErrorParams[]
|
|
266
|
+
[field: string]: ValidateErrorParams[]
|
|
262
267
|
}
|
|
263
268
|
|
|
264
269
|
interface FormEventParams extends VxeEvent {
|
|
265
|
-
$form: VxeFormConstructor
|
|
270
|
+
$form: VxeFormConstructor
|
|
266
271
|
}
|
|
267
272
|
|
|
268
273
|
interface FormBaseParams {
|
|
269
|
-
data: any
|
|
274
|
+
data: any
|
|
270
275
|
}
|
|
271
276
|
|
|
272
277
|
export interface CollapseParams extends FormBaseParams { }
|
|
@@ -283,22 +288,22 @@ export namespace VxeFormDefines {
|
|
|
283
288
|
}
|
|
284
289
|
|
|
285
290
|
export type VxeFormEventProps = {
|
|
286
|
-
onCollapse?: VxeFormEvents.Collapse
|
|
287
|
-
onSubmit?: VxeFormEvents.Submit
|
|
288
|
-
onSubmitInvalid?: VxeFormEvents.SubmitInvalid
|
|
289
|
-
onReset?: VxeFormEvents.Reset
|
|
291
|
+
onCollapse?: VxeFormEvents.Collapse
|
|
292
|
+
onSubmit?: VxeFormEvents.Submit
|
|
293
|
+
onSubmitInvalid?: VxeFormEvents.SubmitInvalid
|
|
294
|
+
onReset?: VxeFormEvents.Reset
|
|
290
295
|
}
|
|
291
296
|
|
|
292
297
|
export interface VxeFormListeners {
|
|
293
|
-
collapse?: VxeFormEvents.Collapse
|
|
294
|
-
submit?: VxeFormEvents.Submit
|
|
295
|
-
submitInvalid?: VxeFormEvents.SubmitInvalid
|
|
296
|
-
reset?: VxeFormEvents.Reset
|
|
298
|
+
collapse?: VxeFormEvents.Collapse
|
|
299
|
+
submit?: VxeFormEvents.Submit
|
|
300
|
+
submitInvalid?: VxeFormEvents.SubmitInvalid
|
|
301
|
+
reset?: VxeFormEvents.Reset
|
|
297
302
|
}
|
|
298
303
|
|
|
299
304
|
export namespace VxeFormEvents {
|
|
300
|
-
export type Collapse = (params: VxeFormDefines.CollapseEventParams) => void
|
|
301
|
-
export type Submit = (params: VxeFormDefines.SubmitEventParams) => void
|
|
302
|
-
export type SubmitInvalid = (params: VxeFormDefines.SubmitInvalidEventParams) => void
|
|
303
|
-
export type Reset = (params: VxeFormDefines.ResetEventParams) => void
|
|
305
|
+
export type Collapse = (params: VxeFormDefines.CollapseEventParams) => void
|
|
306
|
+
export type Submit = (params: VxeFormDefines.SubmitEventParams) => void
|
|
307
|
+
export type SubmitInvalid = (params: VxeFormDefines.SubmitInvalidEventParams) => void
|
|
308
|
+
export type Reset = (params: VxeFormDefines.ResetEventParams) => void
|
|
304
309
|
}
|