vxe-pc-ui 1.2.0 → 1.4.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.
Files changed (85) hide show
  1. package/es/drawer/index.js +0 -1
  2. package/es/form/src/form.js +5 -2
  3. package/es/form-design/widget-select/select-form.js +2 -3
  4. package/es/icon/style/iconfont.1716394371834.ttf +0 -0
  5. package/es/icon/style/iconfont.1716394371834.woff +0 -0
  6. package/es/icon/style/iconfont.1716394371834.woff2 +0 -0
  7. package/es/icon/style.css +1 -1
  8. package/es/iconfont.1716394371834.ttf +0 -0
  9. package/es/iconfont.1716394371834.woff +0 -0
  10. package/es/iconfont.1716394371834.woff2 +0 -0
  11. package/es/modal/index.js +0 -1
  12. package/es/print/src/util.js +9 -0
  13. package/es/style.css +1 -1
  14. package/es/style.min.css +1 -1
  15. package/es/ui/index.js +9 -1
  16. package/lib/drawer/index.js +1 -2
  17. package/lib/drawer/index.min.js +1 -1
  18. package/lib/form/src/form.js +5 -2
  19. package/lib/form/src/form.min.js +1 -1
  20. package/lib/form-design/widget-select/select-form.js +1 -2
  21. package/lib/form-design/widget-select/select-form.min.js +1 -1
  22. package/lib/icon/style/iconfont.1716394371834.ttf +0 -0
  23. package/lib/icon/style/iconfont.1716394371834.woff +0 -0
  24. package/lib/icon/style/iconfont.1716394371834.woff2 +0 -0
  25. package/lib/icon/style/style.css +1 -1
  26. package/lib/icon/style/style.min.css +1309 -1
  27. package/lib/iconfont.1716394371834.ttf +0 -0
  28. package/lib/iconfont.1716394371834.woff +0 -0
  29. package/lib/iconfont.1716394371834.woff2 +0 -0
  30. package/lib/index.umd.js +33 -22
  31. package/lib/index.umd.min.js +1 -1
  32. package/lib/modal/index.js +1 -2
  33. package/lib/modal/index.min.js +1 -1
  34. package/lib/print/src/util.js +9 -0
  35. package/lib/print/src/util.min.js +1 -1
  36. package/lib/style.css +1 -1
  37. package/lib/style.min.css +1 -1
  38. package/lib/ui/index.js +9 -1
  39. package/lib/ui/index.min.js +1 -1
  40. package/package.json +7 -5
  41. package/packages/components.ts +1 -3
  42. package/packages/drawer/index.ts +0 -2
  43. package/packages/form/src/form-config-item.ts +2 -2
  44. package/packages/form/src/form-gather.ts +1 -1
  45. package/packages/form/src/form-item.ts +2 -2
  46. package/packages/form/src/form.ts +5 -2
  47. package/packages/form-design/widget-select/select-form.ts +2 -3
  48. package/packages/input/src/input.ts +2 -2
  49. package/packages/modal/index.ts +0 -2
  50. package/packages/print/src/print.ts +1 -1
  51. package/packages/print/src/util.ts +9 -0
  52. package/packages/pulldown/src/pulldown.ts +2 -2
  53. package/packages/select/src/select.ts +2 -2
  54. package/packages/ui/index.ts +9 -1
  55. package/packages/ui/src/vn.ts +1 -2
  56. package/types/components/colgroup.d.ts +137 -0
  57. package/types/components/column.d.ts +621 -0
  58. package/types/components/form-item.d.ts +7 -3
  59. package/types/components/form.d.ts +2 -2
  60. package/types/components/grid.d.ts +633 -0
  61. package/types/components/option.d.ts +2 -2
  62. package/types/components/print.d.ts +19 -3
  63. package/types/components/table-module/custom.d.ts +32 -0
  64. package/types/components/table-module/edit.d.ts +166 -0
  65. package/types/components/table-module/export.d.ts +81 -0
  66. package/types/components/table-module/filter.d.ts +79 -0
  67. package/types/components/table-module/index.d.ts +7 -0
  68. package/types/components/table-module/keyboard.d.ts +22 -0
  69. package/types/components/table-module/menu.d.ts +54 -0
  70. package/types/components/table-module/validator.d.ts +104 -0
  71. package/types/components/table-plugins/extend-cell-area.d.ts +601 -0
  72. package/types/components/table-plugins/index.d.ts +1 -0
  73. package/types/components/table.d.ts +3714 -0
  74. package/types/components/toolbar.d.ts +291 -0
  75. package/types/components/tooltip.d.ts +1 -1
  76. package/types/ui/commands.d.ts +13 -0
  77. package/types/ui/formats.d.ts +11 -0
  78. package/types/ui/global-config.d.ts +43 -0
  79. package/types/ui/global-icon.d.ts +34 -0
  80. package/types/ui/hooks.d.ts +11 -0
  81. package/types/ui/index.d.ts +6 -8
  82. package/types/ui/interceptor.d.ts +47 -0
  83. package/types/ui/menus.d.ts +14 -0
  84. package/types/ui/renderer.d.ts +224 -8
  85. package/types/ui/validators.d.ts +5 -0
@@ -0,0 +1,32 @@
1
+ /* eslint-disable no-use-before-define */
2
+
3
+ export interface VxeCustomPanel {
4
+ }
5
+
6
+ export interface TableCustomMethods<D = any> {
7
+ /**
8
+ * 打开自定义面板
9
+ */
10
+ openCustom(): Promise<void>
11
+ /**
12
+ * 处理自定义面板
13
+ */
14
+ closeCustom(): Promise<void>
15
+ }
16
+
17
+ export interface TableCustomPrivateMethods<D = any> {
18
+ checkCustomStatus(): void
19
+ emitCustomEvent(type: string, evnt: Event): void
20
+ triggerCustomEvent(evnt: MouseEvent): void
21
+ customOpenEvent (evnt: Event): void
22
+ customColseEvent (evnt: Event): void
23
+ }
24
+
25
+ declare module '../grid' {
26
+ export interface VxeGridMethods<D = any> extends TableCustomMethods<D> { }
27
+ }
28
+
29
+ declare module '../table' {
30
+ export interface VxeTableMethods<D = any> extends TableCustomMethods<D> { }
31
+ export interface VxeTablePrivateMethods<D = any> extends TableCustomPrivateMethods<D> { }
32
+ }
@@ -0,0 +1,166 @@
1
+ import { VxeTableDefines } from '../table'
2
+
3
+ /* eslint-disable no-use-before-define */
4
+
5
+ export interface TableEditMethods<D = any> {
6
+ /**
7
+ * 往表格插入临时数据,从第一行新增一行或多行新数据
8
+ * @param records 新数据
9
+ */
10
+ insert(records: any): Promise<{ row: D, rows: D[] }>
11
+ /**
12
+ * 往表格指定行中插入临时数据
13
+ * 如果 row 为空则从插入到顶部,如果为树结构,则插入到目标节点顶部
14
+ * 如果 row 为 -1 则从插入到底部,如果为树结构,则插入到目标节点底部
15
+ * 如果 row 为有效行则插入到该行的位置,如果为树结构,则有插入到效的目标节点该行的位置
16
+ * @param {Object/Array} records 新的数据
17
+ * @param {Row} row 指定行
18
+ */
19
+ insertAt(records: any, row: any | -1 | null): Promise<{ row: D, rows: D[] }>
20
+ /**
21
+ * 往表格在指定行中的下一行插入临时数据
22
+ * 如果 row 为空则从插入到顶部,如果为树结构,则插入到目标节点顶部
23
+ * 如果 row 为 -1 则从插入到底部,如果为树结构,则插入到目标节点底部
24
+ * 如果 row 为有效行则插入到该行的下一行位置,如果为树结构,则有插入到效的目标节点该行的下一行位置
25
+ * @param records records 新的数据
26
+ * @param row row 指定行
27
+ */
28
+ insertNextAt(records: any, row: any | -1 | null): Promise<{ row: D, rows: D[] }>
29
+ /**
30
+ * 删除指定行数据,指定 row 或 [row, ...] 删除多条数据,如果为空则删除所有数据
31
+ * @param rows 指定行
32
+ */
33
+ remove(rows?: any | any[]): Promise<{ row: D, rows: D[] }>
34
+ /**
35
+ * 删除复选框选中的行数据
36
+ */
37
+ removeCheckboxRow(): Promise<{ row: D, rows: D[] }>
38
+ /**
39
+ * 删除单选框选中的行数据
40
+ */
41
+ removeRadioRow(): Promise<{ row: D, rows: D[] }>
42
+ /**
43
+ * 删除当前行选中的行数据
44
+ */
45
+ removeCurrentRow(): Promise<{ row: D, rows: D[] }>
46
+ /**
47
+ * 获取表格数据集
48
+ * 获取新增、删除、更改的数据
49
+ */
50
+ getRecordset(): {
51
+ insertRecords: D[]
52
+ removeRecords: D[]
53
+ updateRecords: D[]
54
+ pendingRecords: D[]
55
+ }
56
+ /**
57
+ * 用于 edit-config,获取新增的临时数据
58
+ */
59
+ getInsertRecords(): D[]
60
+ /**
61
+ * 获取已删除的数据
62
+ */
63
+ getRemoveRecords(): D[]
64
+ /**
65
+ * 用于 edit-config,获取已修改的数据
66
+ */
67
+ getUpdateRecords(): D[]
68
+ /**
69
+ * 请使用 getEditRecord
70
+ * @deprecated
71
+ */
72
+ getActiveRecord(): {
73
+ row: D
74
+ rowIndex: number
75
+ $rowIndex: number
76
+ column: VxeTableDefines.ColumnInfo<D>
77
+ columnIndex: number
78
+ $columnIndex: number
79
+ cell: HTMLElement
80
+ }
81
+ /**
82
+ * 用于 edit-config,获取已激活的行数据
83
+ */
84
+ getEditRecord(): {
85
+ row: D
86
+ rowIndex: number
87
+ $rowIndex: number
88
+ column: VxeTableDefines.ColumnInfo<D>
89
+ columnIndex: number
90
+ $columnIndex: number
91
+ cell: HTMLElement
92
+ }
93
+ /**
94
+ * 用于 mouse-config.selected,获取选中的单元格信息
95
+ */
96
+ getSelectedCell(): {
97
+ row: D
98
+ column: VxeTableDefines.ColumnInfo<D>
99
+ }
100
+ /**
101
+ * 请使用 clearEdit()
102
+ * @deprecated
103
+ */
104
+ clearActived(evnt?: Event): Promise<any>
105
+ /**
106
+ * 手动清除单元格激活状态
107
+ */
108
+ clearEdit(evnt?: Event): Promise<any>
109
+ /**
110
+ * 手动清除单元格选中状态
111
+ */
112
+ clearSelected(): Promise<any>
113
+ /**
114
+ * 请使用 isEditByRow
115
+ * @deprecated
116
+ */
117
+ isActiveByRow(row: any): boolean
118
+ /**
119
+ * 用于 edit-config,判断行是否为激活编辑状态
120
+ * @param row 指定行
121
+ */
122
+ isEditByRow(row: any): boolean
123
+ /**
124
+ * 请使用 setEditRow
125
+ * @deprecated
126
+ */
127
+ setActiveRow(row: any): Promise<void>
128
+ /**
129
+ * 用于 edit-config,激活行编辑并默认激活第一个列,也可以指定列
130
+ * @param row 指定行
131
+ */
132
+ setEditRow(row: any, fieldOrColumn?: string | VxeTableDefines.ColumnInfo<any>): Promise<void>
133
+ /**
134
+ * 请使用 setEditCell
135
+ * @deprecated
136
+ */
137
+ setActiveCell(row: any, fieldOrColumn: string | VxeTableDefines.ColumnInfo<any>): Promise<void>
138
+ /**
139
+ * 用于 edit-config,激活单元格编辑
140
+ * @param row 指定行
141
+ * @param field 字段名
142
+ */
143
+ setEditCell(row: any, fieldOrColumn: string | VxeTableDefines.ColumnInfo<any>): Promise<void>
144
+ /**
145
+ * 用于 mouse-config.mouse-config,选中某个单元格
146
+ * @param row 指定行
147
+ * @param field 字段名
148
+ */
149
+ setSelectCell(row: any, fieldOrColumn: string | VxeTableDefines.ColumnInfo<any>): Promise<void>
150
+ }
151
+
152
+ export interface TableEditPrivateMethods<D = any> {
153
+ handleActived(params: any, evnt?: any): Promise<any>
154
+ handleFocus(params: any, evnt?: any): void
155
+ handleSelected(params: any, evnt: any): Promise<any>
156
+ addCellSelectedClass(): void
157
+ }
158
+
159
+ declare module '../grid' {
160
+ export interface VxeGridMethods<D = any> extends TableEditMethods<D> { }
161
+ }
162
+
163
+ declare module '../table' {
164
+ export interface VxeTableMethods<D = any> extends TableEditMethods<D> { }
165
+ export interface VxeTablePrivateMethods<D = any> extends TableEditPrivateMethods<D> { }
166
+ }
@@ -0,0 +1,81 @@
1
+ import { VxeTablePropTypes } from '../table'
2
+
3
+ /* eslint-disable no-use-before-define */
4
+
5
+ export interface TableExportMethods<D = any> {
6
+ /**
7
+ * 打开高级导出
8
+ * @param options 参数
9
+ */
10
+ openExport(options?: VxeTablePropTypes.ExportConfig): void
11
+ /**
12
+ * 将表格数据导出
13
+ * @param options 参数
14
+ */
15
+ exportData(options?: VxeTablePropTypes.ExportConfig): Promise<any>
16
+ /**
17
+ * 打开高级导入
18
+ * @param options 参数
19
+ */
20
+ openImport(options?: VxeTablePropTypes.ImportConfig): void
21
+ /**
22
+ * 将数据导入表格
23
+ * @param options 参数
24
+ */
25
+ importData(options?: VxeTablePropTypes.ImportConfig): Promise<any>
26
+ /**
27
+ * 将一个文件的数据导入表格
28
+ * @param file 文件流
29
+ * @param options 参数
30
+ */
31
+ importByFile(file: File, options: VxeTablePropTypes.ImportConfig): Promise<any>
32
+ /**
33
+ * 保存文件到本地
34
+ * @param options
35
+ */
36
+ saveFile: SaveFileFunction
37
+ /**
38
+ * 读取本地文件
39
+ * @param options 参数
40
+ */
41
+ readFile: ReadFileFunction
42
+ /**
43
+ * 打印表格数据
44
+ * @param options 参数
45
+ */
46
+ print: PrintFunction
47
+ /**
48
+ * 打开高级打印
49
+ * @param options 参数
50
+ */
51
+ openPrint(options?: VxeTablePropTypes.PrintConfig): void
52
+ }
53
+
54
+ export interface TableExportPrivateMethods<D = any> { }
55
+
56
+ declare module '../grid' {
57
+ export interface VxeGridMethods<D = any> extends TableExportMethods<D> { }
58
+ }
59
+
60
+ declare module '../table' {
61
+ export interface VxeTableMethods<D = any> extends TableExportMethods<D> { }
62
+ export interface VxeTablePrivateMethods<D = any> extends TableExportPrivateMethods<D> { }
63
+ }
64
+
65
+ export type SaveFileFunction = (options: {
66
+ filename: string
67
+ type: string
68
+ content: string | Blob
69
+ }) => Promise<any>
70
+
71
+ export type ReadFileFunction = (options?: {
72
+ multiple?: boolean
73
+ types?: string[]
74
+ message?: boolean
75
+ }) => Promise<{
76
+ status: boolean
77
+ files: FileList
78
+ file: File
79
+ }>
80
+
81
+ export type PrintFunction = (options?: VxeTablePropTypes.PrintConfig) => any
@@ -0,0 +1,79 @@
1
+ import { VxeTableDefines } from '../table'
2
+ import { VxeColumnPropTypes } from '../column'
3
+
4
+ /* eslint-disable no-use-before-define */
5
+
6
+ export interface VxeFilterPanel {
7
+ /**
8
+ * 筛选所有发生改变
9
+ * @param evnt 事件
10
+ * @param checked 是否选中
11
+ */
12
+ changeAllOption(evnt: Event | null, checked: boolean): void
13
+ /**
14
+ * 筛选选项发生改变
15
+ * @param evnt 事件
16
+ * @param checked 是否选中
17
+ * @param option 选项对象
18
+ */
19
+ changeOption(evnt: Event | null, checked: boolean, option: VxeTableDefines.FilterOption): void
20
+ /**
21
+ * 确认筛选
22
+ */
23
+ confirmFilter(evnt?: Event): void
24
+ /**
25
+ * 重置筛选
26
+ */
27
+ resetFilter(evnt?: Event): void
28
+ }
29
+
30
+ export interface TableFilterMethods<D = any> {
31
+ /**
32
+ * 手动弹出筛选
33
+ * @param fieldOrColumn
34
+ */
35
+ openFilter(fieldOrColumn: VxeColumnPropTypes.Field | VxeTableDefines.ColumnInfo<any>):Promise<void>
36
+ /**
37
+ * 用于 filters,修改筛选列表
38
+ * 在筛选条件更新之后可以调用 updateData 函数处理表格数据
39
+ * @param columnOrField 列对象或字段名
40
+ * @param options 选项列表
41
+ */
42
+ setFilter(fieldOrColumn: VxeColumnPropTypes.Field | VxeTableDefines.ColumnInfo<any>, options: VxeColumnPropTypes.Filter[]): Promise<void>
43
+ /**
44
+ * 手动清空筛选条件
45
+ * 如果不传 column 则清空所有筛选条件,数据会恢复成未筛选的状态
46
+ * @param column 字段名
47
+ */
48
+ clearFilter(column?: VxeColumnPropTypes.Field | VxeTableDefines.ColumnInfo<any> | null): Promise<void>
49
+ /**
50
+ * 获取当前筛选的所有列信息
51
+ */
52
+ getCheckedFilters(): VxeTableDefines.FilterCheckedParams<D>[]
53
+ }
54
+
55
+ export interface TableFilterPrivateMethods<D = any> {
56
+ checkFilterOptions(): void
57
+ handleClearFilter(column: any): void
58
+ triggerFilterEvent(evnt: any, column: any, params: any): void
59
+ confirmFilterEvent(evnt: Event): void
60
+ }
61
+
62
+ declare module '../grid' {
63
+ export interface VxeGridMethods<D = any> extends TableFilterMethods<D> { }
64
+ }
65
+
66
+ declare module '../table' {
67
+ export interface VxeTableMethods<D = any> extends TableFilterMethods<D> { }
68
+ export interface VxeTablePrivateMethods<D = any> extends TableFilterPrivateMethods<D> { }
69
+ export namespace VxeTableDefines {
70
+ export interface FilterOption {
71
+ label: string | number
72
+ value: any
73
+ data: any
74
+ resetValue: any
75
+ checked: boolean
76
+ _checked: boolean
77
+ }
78
+ }
79
+ }
@@ -0,0 +1,7 @@
1
+ export * from './filter'
2
+ export * from './menu'
3
+ export * from './edit'
4
+ export * from './export'
5
+ export * from './keyboard'
6
+ export * from './validator'
7
+ export * from './custom'
@@ -0,0 +1,22 @@
1
+ import { any } from '../table'
2
+
3
+ /* eslint-disable no-use-before-define */
4
+
5
+ export interface TableKeyboardMethods<D = any> {}
6
+
7
+ export interface TableKeyboardPrivateMethods<D = any> {
8
+ moveTabSelected(args: any, isLeft: any, evnt: any): void
9
+ moveCurrentRow(isUpArrow: any, isDwArrow: any, evnt: any): void
10
+ moveSelected(args: any, isLeftArrow: any, isUpArrow: any, isRightArrow: any, isDwArrow: any, evnt: any): void
11
+ triggerHeaderCellMousedownEvent(evnt: any, params: any): void
12
+ triggerCellMousedownEvent(evnt: any, params: any): void
13
+ }
14
+
15
+ declare module '../grid' {
16
+ export interface VxeGridMethods<D = any> extends TableKeyboardMethods<D> { }
17
+ }
18
+
19
+ declare module '../table' {
20
+ export interface VxeTableMethods<D = any> extends TableKeyboardMethods<D> { }
21
+ export interface VxeTablePrivateMethods<D = any> extends TableKeyboardPrivateMethods<D> { }
22
+ }
@@ -0,0 +1,54 @@
1
+ /* eslint-disable no-use-before-define */
2
+
3
+ export interface TableMenuMethods<D = any> {
4
+ /**
5
+ * 手动关闭快捷菜单
6
+ */
7
+ closeMenu(): Promise<any>
8
+ }
9
+
10
+ export interface TableMenuPrivateMethods<D = any> {
11
+ moveCtxMenu(evnt: any, ctxMenuStore: any, property: any, hasOper: boolean, operRest: any, menuList: any): void
12
+ handleOpenMenuEvent(evnt: Event, type: 'header' | 'body' | 'footer', params: any): void
13
+ handleGlobalContextmenuEvent(evnt: any): void
14
+ ctxMenuMouseoverEvent(evnt: any, item: any, child?: any): void
15
+ ctxMenuMouseoutEvent(evnt: any, item: any): void
16
+ ctxMenuLinkEvent(evnt: any, menu: any): void
17
+ }
18
+
19
+ declare module '../grid' {
20
+ export interface VxeGridMethods<D = any> extends TableMenuMethods<D> { }
21
+ }
22
+
23
+ declare module '../table' {
24
+ export interface VxeTableMethods<D = any> extends TableMenuMethods<D> { }
25
+ export interface VxeTablePrivateMethods<D = any> extends TableMenuPrivateMethods<D> { }
26
+ export namespace VxeTableDefines {
27
+ export interface MenuOptions {
28
+ disabled?: boolean
29
+ options?: MenuFirstOption[][]
30
+ }
31
+ export interface MenuFirstOption {
32
+ code?: string
33
+ name?: string
34
+ prefixIcon?: string
35
+ suffixIcon?: string
36
+ className?: string
37
+ visible?: boolean
38
+ disabled?: boolean
39
+ children?: MenuChildOption[]
40
+ params?: any
41
+ [key: string]: any
42
+ }
43
+ export interface MenuChildOption {
44
+ code?: string
45
+ name?: string
46
+ prefixIcon?: string
47
+ className?: string
48
+ visible?: boolean
49
+ disabled?: boolean
50
+ params?: any
51
+ [key: string]: any
52
+ }
53
+ }
54
+ }
@@ -0,0 +1,104 @@
1
+ import { VxeTableDefines, VxeTableConstructor } from '../table'
2
+ import { VxeGridConstructor } from '../grid'
3
+ import { VxeColumnPropTypes } from '../column'
4
+
5
+ /* eslint-disable no-use-before-define */
6
+
7
+ export interface TableValidatorMethods<D = any> {
8
+ /**
9
+ * 手动清除校验
10
+ */
11
+ clearValidate(rows?: any, fieldOrColumn?: VxeColumnPropTypes.Field | VxeTableDefines.ColumnInfo<any> | VxeColumnPropTypes.Field[] | VxeTableDefines.ColumnInfo<any>[]): Promise<void>
12
+ /**
13
+ * 完整校验,默认校验当前表格数据,和 validate 的区别就是默认校验当前表格数据并且给有效数据中的每一行进行校验
14
+ * @param rows 指定行
15
+ */
16
+ fullValidate(rows?: boolean | object | any[] | ((errMap: VxeTableDefines.ValidatorErrorMapParams<D>) => void), callback?: (errMap: VxeTableDefines.ValidatorErrorMapParams<D>) => void): Promise<VxeTableDefines.ValidatorErrorMapParams<D>>
17
+ /**
18
+ * 快速校验,如果存在记录不通过的记录,则返回不再继续校验(异步校验除外);
19
+ * 如果第一个参数为 true 则校验当前表格数据,如果指定 row 或 rows 则校验指定一行或多行,如果不指定数据,则默认只校验临时变动的数据,例如新增或修改。该回调函数会在校验结束后被调用 callback(errMap)。若不传入回调函数,则会返回一个 promise
20
+ * @param rows 指定行
21
+ */
22
+ validate(rows?: boolean | object | any[] | ((errMap?: VxeTableDefines.ValidatorErrorMapParams<D>) => void), callback?: (errMap?: VxeTableDefines.ValidatorErrorMapParams<D>) => void): Promise<VxeTableDefines.ValidatorErrorMapParams<D>>
23
+ }
24
+
25
+ export interface TableValidatorPrivateMethods<D = any> {
26
+ validCellRules(type: any, row: any, column: VxeTableDefines.ColumnInfo<any>, val?: any): Promise<any>
27
+ hasCellRules(type: any, row: any, column: VxeTableDefines.ColumnInfo<any>): boolean
28
+ triggerValidate(type: any): Promise<any>
29
+ showValidTooltip(params: any): void
30
+ }
31
+
32
+ declare module '../grid' {
33
+ export interface VxeGridMethods<D = any> extends TableValidatorMethods<D> { }
34
+ }
35
+
36
+ declare module '../table' {
37
+ export interface VxeTableMethods<D = any> extends TableValidatorMethods<D> { }
38
+ export interface VxeTablePrivateMethods<D = any> extends TableValidatorPrivateMethods<D> { }
39
+ export namespace VxeTableDefines {
40
+ export interface ValidatorRule<D = any> {
41
+ /**
42
+ * 是否必填
43
+ */
44
+ required?: boolean
45
+ /**
46
+ * 最小长度/值
47
+ */
48
+ min?: number | string
49
+ /**
50
+ * 最大长度/值
51
+ */
52
+ max?: number | string
53
+ /**
54
+ * 数据类型
55
+ */
56
+ type?: 'number' | 'string' | 'array' | '' | null
57
+ /**
58
+ * 使用正则表达式校验
59
+ */
60
+ pattern?: string | RegExp
61
+ /**
62
+ * 使用自定义校验函数,接收一个 Promise
63
+ * @param params 参数
64
+ */
65
+ validator?: string | ((params: RuleValidatorParams<D>) => void | Error | Promise<void>)
66
+ /**
67
+ * 提示消息
68
+ */
69
+ content?: string
70
+ trigger?: 'blur' | 'change' | 'manual' | '' | null
71
+ maxWidth?: number
72
+ /**
73
+ * @deprecated 已废弃,请使用 content
74
+ */
75
+ message?: string
76
+ }
77
+ export interface RuleValidatorParams<D = any> {
78
+ $table: VxeTableConstructor<D>
79
+ $grid: VxeGridConstructor<D> | null
80
+ cellValue: any
81
+ rule: ValidatorRule<D>
82
+ rules: ValidatorRule<D>[]
83
+ column: VxeTableDefines.ColumnInfo<D>
84
+ columnIndex: number
85
+ row: D
86
+ rowIndex: number
87
+ field: string
88
+ }
89
+ export interface ValidatorErrorParams<D = any> {
90
+ $table: VxeTableConstructor<D>
91
+ cellValue: any
92
+ rule: ValidatorRule<D>
93
+ rules: ValidatorRule<D>[]
94
+ column: VxeTableDefines.ColumnInfo<D>
95
+ columnIndex: number
96
+ row: D
97
+ rowIndex: number
98
+ field: string
99
+ }
100
+ export interface ValidatorErrorMapParams<D = any> {
101
+ [key: string]: VxeTableDefines.ValidatorErrorParams<D>[]
102
+ }
103
+ }
104
+ }