vxe-table 3.7.0-beta.1 → 3.7.0-beta.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -9
- package/helper/vetur/attributes.json +86 -22
- package/helper/vetur/tags.json +17 -1
- package/lib/button/src/button.js +9 -3
- package/lib/button/src/button.min.js +1 -1
- package/lib/edit/src/mixin.js +10 -10
- package/lib/edit/src/mixin.min.js +1 -1
- package/lib/export/src/mixin.js +24 -13
- package/lib/export/src/mixin.min.js +1 -1
- package/lib/filter/src/mixin.js +13 -7
- package/lib/filter/src/mixin.min.js +1 -1
- package/lib/form/src/form.js +27 -5
- package/lib/form/src/form.min.js +1 -1
- package/lib/grid/src/grid.js +7 -3
- package/lib/grid/src/grid.min.js +1 -1
- package/lib/icon/style/style.css +1 -1
- package/lib/icon/style/style.min.css +1 -1
- package/lib/index.css +1 -1
- package/lib/index.umd.js +559 -229
- package/lib/index.umd.min.js +1 -1
- package/lib/input/src/input.js +11 -1
- package/lib/input/src/input.min.js +1 -1
- package/lib/locale/lang/en-US.js +8 -0
- package/lib/locale/lang/en-US.min.js +1 -1
- package/lib/locale/lang/en-US.umd.js +8 -0
- package/lib/locale/lang/es-ES.js +8 -0
- package/lib/locale/lang/es-ES.min.js +1 -1
- package/lib/locale/lang/es-ES.umd.js +8 -0
- package/lib/locale/lang/ja-JP.d.ts +1 -1
- package/lib/locale/lang/ja-JP.js +8 -0
- package/lib/locale/lang/ja-JP.min.js +1 -1
- package/lib/locale/lang/ja-JP.umd.js +8 -0
- package/lib/locale/lang/pt-BR.d.ts +8 -0
- package/lib/locale/lang/pt-BR.js +330 -0
- package/lib/locale/lang/pt-BR.min.js +1 -0
- package/lib/locale/lang/pt-BR.umd.js +344 -0
- package/lib/locale/lang/zh-CN.d.ts +1 -1
- package/lib/locale/lang/zh-CN.js +8 -0
- package/lib/locale/lang/zh-CN.min.js +1 -1
- package/lib/locale/lang/zh-CN.umd.js +8 -0
- package/lib/locale/lang/zh-HK.d.ts +1 -1
- package/lib/locale/lang/zh-HK.min.js +1 -1
- package/lib/locale/lang/zh-HK.umd.js +8 -0
- package/lib/locale/lang/zh-MO.d.ts +1 -1
- package/lib/locale/lang/zh-MO.min.js +1 -1
- package/lib/locale/lang/zh-MO.umd.js +8 -0
- package/lib/locale/lang/zh-TC.d.ts +1 -1
- package/lib/locale/lang/zh-TC.js +8 -0
- package/lib/locale/lang/zh-TC.min.js +1 -1
- package/lib/locale/lang/zh-TC.umd.js +8 -0
- package/lib/locale/lang/zh-TW.d.ts +1 -1
- package/lib/locale/lang/zh-TW.min.js +1 -1
- package/lib/locale/lang/zh-TW.umd.js +8 -0
- package/lib/menu/src/mixin.js +3 -3
- package/lib/menu/src/mixin.min.js +1 -1
- package/lib/pulldown/src/pulldown.js +11 -2
- package/lib/pulldown/src/pulldown.min.js +1 -1
- package/lib/select/src/select.js +11 -2
- package/lib/select/src/select.min.js +1 -1
- package/lib/style.css +1 -1
- package/lib/style.min.css +1 -1
- package/lib/table/src/body.js +3 -2
- package/lib/table/src/body.min.js +1 -1
- package/lib/table/src/cell.js +9 -7
- package/lib/table/src/cell.min.js +1 -1
- package/lib/table/src/columnInfo.js +7 -7
- package/lib/table/src/columnInfo.min.js +1 -1
- package/lib/table/src/methods.js +171 -124
- package/lib/table/src/methods.min.js +1 -1
- package/lib/table/src/table.js +22 -29
- package/lib/table/src/table.min.js +1 -1
- package/lib/table/src/util.js +3 -1
- package/lib/table/src/util.min.js +1 -1
- package/lib/table/style/style.css +7 -2
- package/lib/table/style/style.min.css +1 -1
- package/lib/textarea/src/textarea.js +6 -1
- package/lib/textarea/src/textarea.min.js +1 -1
- package/lib/toolbar/src/toolbar.js +23 -7
- package/lib/toolbar/src/toolbar.min.js +1 -1
- package/lib/tools/log.js +1 -1
- package/lib/tools/log.min.js +1 -1
- package/lib/tooltip/src/tooltip.js +5 -1
- package/lib/tooltip/src/tooltip.min.js +1 -1
- package/lib/tooltip/style/style.css +0 -6
- package/lib/tooltip/style/style.min.css +1 -1
- package/lib/v-x-e-table/index.js +3 -1
- package/lib/v-x-e-table/index.min.js +1 -1
- package/lib/v-x-e-table/src/commands.js +60 -2
- package/lib/v-x-e-table/src/commands.min.js +1 -1
- package/lib/v-x-e-table/src/conf.js +7 -4
- package/lib/v-x-e-table/src/conf.min.js +1 -1
- package/lib/v-x-e-table/src/formats.js +60 -2
- package/lib/v-x-e-table/src/formats.min.js +1 -1
- package/lib/v-x-e-table/src/menus.js +60 -2
- package/lib/v-x-e-table/src/menus.min.js +1 -1
- package/lib/v-x-e-table/src/renderer.js +10 -0
- package/lib/v-x-e-table/src/renderer.min.js +1 -1
- package/lib/v-x-e-table/src/store.js +5 -2
- package/lib/v-x-e-table/src/store.min.js +1 -1
- package/lib/v-x-e-table/src/validators.js +15 -0
- package/lib/v-x-e-table/src/validators.min.js +1 -0
- package/lib/validator/src/mixin.js +36 -4
- package/lib/validator/src/mixin.min.js +1 -1
- package/package.json +2 -2
- package/packages/button/src/button.js +5 -4
- package/packages/edit/src/mixin.js +10 -9
- package/packages/export/src/mixin.js +22 -13
- package/packages/filter/src/mixin.js +5 -1
- package/packages/form/src/form.js +27 -6
- package/packages/grid/src/grid.js +7 -3
- package/packages/input/src/input.js +9 -1
- package/packages/locale/lang/en-US.js +8 -0
- package/packages/locale/lang/es-ES.js +8 -0
- package/packages/locale/lang/ja-JP.d.ts +1 -1
- package/packages/locale/lang/ja-JP.js +8 -0
- package/packages/locale/lang/pt-BR.d.ts +8 -0
- package/packages/locale/lang/pt-BR.js +323 -0
- package/packages/locale/lang/zh-CN.d.ts +1 -1
- package/packages/locale/lang/zh-CN.js +8 -0
- package/packages/locale/lang/zh-HK.d.ts +1 -1
- package/packages/locale/lang/zh-MO.d.ts +1 -1
- package/packages/locale/lang/zh-TC.d.ts +1 -1
- package/packages/locale/lang/zh-TC.js +8 -0
- package/packages/locale/lang/zh-TW.d.ts +1 -1
- package/packages/menu/src/mixin.js +3 -3
- package/packages/pulldown/src/pulldown.js +6 -3
- package/packages/select/src/select.js +7 -3
- package/packages/table/src/body.js +3 -2
- package/packages/table/src/cell.js +9 -5
- package/packages/table/src/columnInfo.js +7 -7
- package/packages/table/src/methods.js +142 -93
- package/packages/table/src/table.js +17 -7
- package/packages/table/src/util.js +3 -1
- package/packages/textarea/src/textarea.js +4 -1
- package/packages/toolbar/src/toolbar.js +22 -7
- package/packages/tooltip/src/tooltip.js +3 -2
- package/packages/v-x-e-table/index.js +2 -0
- package/packages/v-x-e-table/src/commands.js +50 -2
- package/packages/v-x-e-table/src/conf.js +7 -4
- package/packages/v-x-e-table/src/formats.js +50 -2
- package/packages/v-x-e-table/src/menus.js +50 -2
- package/packages/v-x-e-table/src/renderer.js +11 -1
- package/packages/v-x-e-table/src/store.js +4 -2
- package/packages/v-x-e-table/src/validators.js +7 -0
- package/packages/validator/src/mixin.js +35 -4
- package/styles/all.scss +30 -0
- package/styles/css-variable.scss +272 -0
- package/styles/cssvar.scss +2 -275
- package/styles/index.scss +2 -0
- package/styles/modules.scss +4 -1
- package/styles/table.scss +11 -4
- package/styles/tooltip.scss +0 -8
- package/styles/variable.scss +1 -4
- package/types/all.d.ts +2 -2
- package/types/colgroup.d.ts +3 -1
- package/types/column.d.ts +3 -0
- package/types/edit.d.ts +4 -2
- package/types/export.d.ts +3 -0
- package/types/filter.d.ts +3 -1
- package/types/footer.d.ts +3 -1
- package/types/form-item.d.ts +2 -0
- package/types/form.d.ts +16 -12
- package/types/grid.d.ts +3 -0
- package/types/header.d.ts +3 -1
- package/types/index.d.ts +1 -1
- package/types/input.d.ts +2 -0
- package/types/list.d.ts +1 -1
- package/types/menu.d.ts +2 -0
- package/types/modal.d.ts +7 -3
- package/types/pulldown.d.ts +2 -3
- package/types/table.d.ts +54 -30
- package/types/textarea.d.ts +1 -0
- package/types/toolbar.d.ts +2 -0
- package/types/tooltip.d.ts +1 -1
- package/types/v-x-e-table/commands.d.ts +23 -13
- package/types/v-x-e-table/formats.d.ts +21 -12
- package/types/v-x-e-table/index.d.ts +33 -26
- package/types/v-x-e-table/interceptor.d.ts +1 -1
- package/types/v-x-e-table/menus.d.ts +17 -6
- package/types/v-x-e-table/renderer.d.ts +5 -3
- package/types/v-x-e-table/setup.d.ts +10 -33
- package/types/v-x-e-table/validators.d.ts +30 -0
- package/types/validator.d.ts +15 -4
- /package/lib/icon/style/{iconfont.1688948811910.ttf → iconfont.1691021948915.ttf} +0 -0
- /package/lib/icon/style/{iconfont.1688948811910.woff → iconfont.1691021948915.woff} +0 -0
- /package/lib/icon/style/{iconfont.1688948811910.woff2 → iconfont.1691021948915.woff2} +0 -0
- /package/lib/{iconfont.1688948811910.ttf → iconfont.1691021948915.ttf} +0 -0
- /package/lib/{iconfont.1688948811910.woff → iconfont.1691021948915.woff} +0 -0
- /package/lib/{iconfont.1688948811910.woff2 → iconfont.1691021948915.woff2} +0 -0
|
@@ -8,25 +8,28 @@ import { VxeGlobalInterceptor } from './interceptor'
|
|
|
8
8
|
import { VxeGlobalCommands } from './commands'
|
|
9
9
|
import { VxeGlobalFormats } from './formats'
|
|
10
10
|
import { VxeGlobalMenus } from './menus'
|
|
11
|
-
import {
|
|
11
|
+
import { VxeGlobalValidators } from './validators'
|
|
12
|
+
import { VxeGlobalConfigMethod } from './setup'
|
|
13
|
+
|
|
14
|
+
/* eslint-disable no-use-before-define */
|
|
12
15
|
|
|
13
16
|
export type VxeGlobalI18n = (key: string, args?: any) => number | string;
|
|
14
17
|
export type VxeGlobalTranslate = (key: string, args?: any) => string;
|
|
15
18
|
export type VxeGlobalUse = (plugin: VXETablePluginObject, ...options: any[]) => VXETableCore;
|
|
16
19
|
|
|
17
|
-
export const setup:
|
|
18
|
-
export const interceptor: VxeGlobalInterceptor
|
|
19
|
-
export const renderer: VxeGlobalRenderer
|
|
20
|
-
export const commands: VxeGlobalCommands
|
|
21
|
-
export const formats: VxeGlobalFormats
|
|
22
|
-
export const menus: VxeGlobalMenus
|
|
23
|
-
export const modal: ModalController
|
|
24
|
-
export const saveFile: SaveFileFunction
|
|
25
|
-
export const readFile: ReadFileFunction
|
|
26
|
-
export const print: PrintFunction
|
|
27
|
-
export const t: VxeGlobalI18n
|
|
28
|
-
export const _t: VxeGlobalTranslate
|
|
29
|
-
export const use: VxeGlobalUse
|
|
20
|
+
export const setup: VxeGlobalConfigMethod
|
|
21
|
+
export const interceptor: VxeGlobalInterceptor
|
|
22
|
+
export const renderer: VxeGlobalRenderer
|
|
23
|
+
export const commands: VxeGlobalCommands
|
|
24
|
+
export const formats: VxeGlobalFormats
|
|
25
|
+
export const menus: VxeGlobalMenus
|
|
26
|
+
export const modal: ModalController
|
|
27
|
+
export const saveFile: SaveFileFunction
|
|
28
|
+
export const readFile: ReadFileFunction
|
|
29
|
+
export const print: PrintFunction
|
|
30
|
+
export const t: VxeGlobalI18n
|
|
31
|
+
export const _t: VxeGlobalTranslate
|
|
32
|
+
export const use: VxeGlobalUse
|
|
30
33
|
|
|
31
34
|
export interface VXETablePluginObject {
|
|
32
35
|
install(vxetable: VXETableCore, ...options: any[]): void;
|
|
@@ -50,7 +53,7 @@ export interface VXETableCore {
|
|
|
50
53
|
/**
|
|
51
54
|
* 设置全局参数/获取所有参数
|
|
52
55
|
*/
|
|
53
|
-
setup:
|
|
56
|
+
setup: VxeGlobalConfigMethod;
|
|
54
57
|
/**
|
|
55
58
|
* Table interceptor
|
|
56
59
|
*/
|
|
@@ -71,6 +74,10 @@ export interface VXETableCore {
|
|
|
71
74
|
* Table context menu
|
|
72
75
|
*/
|
|
73
76
|
menus: VxeGlobalMenus;
|
|
77
|
+
/**
|
|
78
|
+
* Validators table/form
|
|
79
|
+
*/
|
|
80
|
+
validators: VxeGlobalValidators
|
|
74
81
|
/**
|
|
75
82
|
* 弹窗
|
|
76
83
|
*/
|
|
@@ -101,16 +108,16 @@ export interface VXETableCore {
|
|
|
101
108
|
}
|
|
102
109
|
|
|
103
110
|
/**
|
|
104
|
-
* 一个基于 vue 的 PC
|
|
111
|
+
* 一个基于 vue 的 PC 端表单/表格组件,支持增删改查、虚拟列表、虚拟树、懒加载、快捷菜单、数据校验、树形结构、打印导出、表单渲染、数据分页、弹窗、自定义模板、渲染器、JSON 配置式为零代码而设计...
|
|
105
112
|
*/
|
|
106
|
-
|
|
113
|
+
export const VXETable: VXETableCore
|
|
114
|
+
|
|
115
|
+
export * from './renderer'
|
|
116
|
+
export * from './interceptor'
|
|
117
|
+
export * from './commands'
|
|
118
|
+
export * from './formats'
|
|
119
|
+
export * from './menus'
|
|
120
|
+
export * from './validators'
|
|
121
|
+
export * from './setup'
|
|
107
122
|
|
|
108
|
-
|
|
109
|
-
export * from './interceptor'
|
|
110
|
-
export * from './commands'
|
|
111
|
-
export * from './formats'
|
|
112
|
-
export * from './menus'
|
|
113
|
-
export * from './setup'
|
|
114
|
-
|
|
115
|
-
export default VXETable
|
|
116
|
-
|
|
123
|
+
export default VXETable
|
|
@@ -19,7 +19,7 @@ export interface InterceptorParams extends GridRenderParams {
|
|
|
19
19
|
$event: any;
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
-
export
|
|
22
|
+
export type InterceptorKeydownParams = InterceptorParams
|
|
23
23
|
|
|
24
24
|
export interface InterceptorExportParams extends InterceptorParams {
|
|
25
25
|
options: TableExportConfig;
|
|
@@ -1,13 +1,24 @@
|
|
|
1
1
|
import { MenuLinkParams } from '../menu'
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
/* eslint-disable no-use-before-define */
|
|
4
|
+
|
|
5
|
+
export namespace VxeGlobalMenusHandles {
|
|
6
|
+
export type MenusOption = {
|
|
7
|
+
menuMethod?: (params: MenuMethodParams, event: Event) => any
|
|
8
|
+
}
|
|
9
|
+
export type MenuMethodParams = MenuLinkParams
|
|
10
|
+
}
|
|
4
11
|
|
|
5
12
|
/**
|
|
6
13
|
* 全局快捷菜单
|
|
7
14
|
*/
|
|
8
|
-
export
|
|
9
|
-
mixin(
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
15
|
+
export interface VxeGlobalMenus {
|
|
16
|
+
mixin(opts: {
|
|
17
|
+
[code: string]: VxeGlobalMenusHandles.MenusOption | ((params: VxeGlobalMenusHandles.MenuMethodParams, event: Event) => any)
|
|
18
|
+
}): VxeGlobalMenus
|
|
19
|
+
has(code: string): boolean
|
|
20
|
+
get(code: string): VxeGlobalMenusHandles.MenusOption
|
|
21
|
+
add(code: string, options: VxeGlobalMenusHandles.MenusOption | ((params: VxeGlobalMenusHandles.MenuMethodParams, event: Event) => any)): VxeGlobalMenus
|
|
22
|
+
delete(code: string): void
|
|
23
|
+
forEach(callback: (options: VxeGlobalMenusHandles.MenusOption, code: string) => void): void
|
|
13
24
|
}
|
|
@@ -10,6 +10,8 @@ import { ColumnFilterRenderOptions, ColumnFilterRenderParams, ColumnFilterMethod
|
|
|
10
10
|
import { ToolbarButtonRenderOptions, ToolbarButtonRenderParams, ToolbarToolRenderOptions, ToolbarToolRenderParams } from '../toolbar'
|
|
11
11
|
import { FormItemRenderOptions, FormItemRenderParams, FormItemVisibleParams, FormItemResetParams } from '../form-item'
|
|
12
12
|
|
|
13
|
+
/* eslint-disable no-use-before-define */
|
|
14
|
+
|
|
13
15
|
/**
|
|
14
16
|
* 渲染器
|
|
15
17
|
*/
|
|
@@ -43,7 +45,7 @@ export interface RendererMapOptions {
|
|
|
43
45
|
|
|
44
46
|
// 单元格渲染
|
|
45
47
|
cellClassName?: string | ((params: ColumnCellRenderParams | ColumnEditRenderParams) => string | VNodeClassName)
|
|
46
|
-
cellStyle?:
|
|
48
|
+
cellStyle?: VNodeStyle | ((params: ColumnCellRenderParams | ColumnEditRenderParams) => VNodeStyle)
|
|
47
49
|
renderHeader?(h: CreateElement, renderOpts: ColumnCellRenderOptions | ColumnEditRenderOptions, params: ColumnCellRenderParams | ColumnEditRenderParams): SlotVNodeType | SlotVNodeType[];
|
|
48
50
|
renderDefault?(h: CreateElement, renderOpts: ColumnCellRenderOptions | ColumnEditRenderOptions, params: ColumnCellRenderParams | ColumnEditRenderParams): SlotVNodeType | SlotVNodeType[];
|
|
49
51
|
renderFooter?(h: CreateElement, renderOpts: ColumnCellRenderOptions | ColumnEditRenderOptions, params: ColumnFooterRenderParams): SlotVNodeType | SlotVNodeType[];
|
|
@@ -101,11 +103,11 @@ export class RenderOptions {
|
|
|
101
103
|
/**
|
|
102
104
|
* 目标组件渲染的事件
|
|
103
105
|
*/
|
|
104
|
-
events?: { [key: string]:
|
|
106
|
+
events?: { [key: string]: ((...angs: any[])=>any) };
|
|
105
107
|
/**
|
|
106
108
|
* 目标组件渲染的原生事件
|
|
107
109
|
*/
|
|
108
|
-
nativeEvents?: { [key: string]:
|
|
110
|
+
nativeEvents?: { [key: string]: ((...angs: any[])=>any) };
|
|
109
111
|
[key: string]: any;
|
|
110
112
|
}
|
|
111
113
|
|
|
@@ -5,7 +5,7 @@ interface DefaultOptions {
|
|
|
5
5
|
[key: string]: any;
|
|
6
6
|
}
|
|
7
7
|
|
|
8
|
-
export interface
|
|
8
|
+
export interface VXETableConfigOptions {
|
|
9
9
|
size?: SizeType;
|
|
10
10
|
zIndex?: number;
|
|
11
11
|
version?: number;
|
|
@@ -39,36 +39,13 @@ export interface VXETableSetupOptions {
|
|
|
39
39
|
[key: string]: any;
|
|
40
40
|
}
|
|
41
41
|
|
|
42
|
-
export
|
|
43
|
-
size: SizeType;
|
|
44
|
-
zIndex: number;
|
|
45
|
-
version: number;
|
|
46
|
-
emptyCell: string;
|
|
47
|
-
icon: {
|
|
48
|
-
[key: string]: string;
|
|
49
|
-
};
|
|
50
|
-
table: any;
|
|
51
|
-
grid: any;
|
|
52
|
-
export: {
|
|
53
|
-
types: {
|
|
54
|
-
[key: string]: 0 | 1 | 2;
|
|
55
|
-
}
|
|
56
|
-
[key: string]: any;
|
|
57
|
-
};
|
|
58
|
-
tooltip: DefaultOptions;
|
|
59
|
-
pager: any;
|
|
60
|
-
form: DefaultOptions;
|
|
61
|
-
input: DefaultOptions;
|
|
62
|
-
textarea: DefaultOptions;
|
|
63
|
-
select: DefaultOptions;
|
|
64
|
-
toolbar: any;
|
|
65
|
-
button: DefaultOptions;
|
|
66
|
-
radio: DefaultOptions;
|
|
67
|
-
checkbox: DefaultOptions;
|
|
68
|
-
switch: DefaultOptions;
|
|
69
|
-
modal: DefaultOptions;
|
|
70
|
-
list: DefaultOptions;
|
|
71
|
-
i18n(key: string, args?: any): string;
|
|
72
|
-
}
|
|
42
|
+
export type VxeGlobalConfigMethod = (options?: VXETableConfigOptions) => Required<VXETableConfigOptions>
|
|
73
43
|
|
|
74
|
-
|
|
44
|
+
/**
|
|
45
|
+
* @deprecated
|
|
46
|
+
*/
|
|
47
|
+
export type VXETableSetupOptions = VXETableConfigOptions
|
|
48
|
+
/**
|
|
49
|
+
* @deprecated
|
|
50
|
+
*/
|
|
51
|
+
export type VxeGlobalSetup = VxeGlobalConfigMethod;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { CellRuleValidatorParams } from '../validator'
|
|
2
|
+
import { FormRuleValidatorParams } from '../form'
|
|
3
|
+
|
|
4
|
+
/* eslint-disable no-use-before-define */
|
|
5
|
+
|
|
6
|
+
export namespace VxeGlobalValidatorsHandles {
|
|
7
|
+
export interface ValidatorsOptions {
|
|
8
|
+
itemValidatorMethod?: ItemValidatorMethod
|
|
9
|
+
cellValidatorMethod?: CellValidatorMethod
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export type ItemValidatorMethod = (params: ItemValidatorParams, ...args: any[]) => void | Error | Promise<any>
|
|
13
|
+
export type CellValidatorMethod = (params: CellValidatorParams, ...args: any[]) => void | Error | Promise<any>
|
|
14
|
+
export type ItemValidatorParams = FormRuleValidatorParams
|
|
15
|
+
export type CellValidatorParams = CellRuleValidatorParams
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* 全局快捷菜单
|
|
20
|
+
*/
|
|
21
|
+
export interface VxeGlobalValidators {
|
|
22
|
+
mixin(options: {
|
|
23
|
+
[code: string]: VxeGlobalValidatorsHandles.ValidatorsOptions
|
|
24
|
+
}): VxeGlobalValidators
|
|
25
|
+
has(code: string): boolean
|
|
26
|
+
get(code: string): VxeGlobalValidatorsHandles.ValidatorsOptions
|
|
27
|
+
add(code: string, callback: VxeGlobalValidatorsHandles.ValidatorsOptions): VxeGlobalValidators
|
|
28
|
+
delete(code: string): void
|
|
29
|
+
forEach(callback: (options: VxeGlobalValidatorsHandles.ValidatorsOptions, code: string) => void): void
|
|
30
|
+
}
|
package/types/validator.d.ts
CHANGED
|
@@ -2,6 +2,8 @@ import { VXETableComponent } from './component'
|
|
|
2
2
|
import { ColumnInfo } from './column'
|
|
3
3
|
import { Table } from './table'
|
|
4
4
|
|
|
5
|
+
/* eslint-disable no-use-before-define */
|
|
6
|
+
|
|
5
7
|
/**
|
|
6
8
|
* 表格校验
|
|
7
9
|
*/
|
|
@@ -32,7 +34,7 @@ export interface ColumnEditRule {
|
|
|
32
34
|
* 使用自定义校验函数,接收一个 Promise
|
|
33
35
|
* @param params 参数
|
|
34
36
|
*/
|
|
35
|
-
validator?:
|
|
37
|
+
validator?: string | ((params: CellRuleValidatorParams) => void | Error | Promise<any>);
|
|
36
38
|
/**
|
|
37
39
|
* 提示消息
|
|
38
40
|
*/
|
|
@@ -41,9 +43,18 @@ export interface ColumnEditRule {
|
|
|
41
43
|
maxWidth?: number;
|
|
42
44
|
}
|
|
43
45
|
|
|
44
|
-
export
|
|
45
|
-
|
|
46
|
-
|
|
46
|
+
export interface CellRuleValidatorParams {
|
|
47
|
+
$table: Table,
|
|
48
|
+
cellValue: any,
|
|
49
|
+
rule: ColumnEditRule;
|
|
50
|
+
rules: ColumnEditRule[];
|
|
51
|
+
column: ColumnInfo;
|
|
52
|
+
columnIndex: number;
|
|
53
|
+
row: any;
|
|
54
|
+
rowIndex: number;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export function ColumnValidatorMethod(params: ColumnEditValidErrParams): void | Error | Promise<any>;
|
|
47
58
|
|
|
48
59
|
export interface ColumnEditValidErrParams {
|
|
49
60
|
$table: Table,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|