vxe-table 4.5.0-beta.12 → 4.5.0-beta.13
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 +1 -1
- package/README.md +1 -1
- package/README.zh-TW.md +1 -1
- package/es/form/src/form.js +27 -5
- package/es/icon/style.css +1 -1
- package/es/input/src/input.js +4 -1
- package/es/locale/lang/en-US.js +4 -0
- package/es/locale/lang/es-ES.js +5 -0
- package/es/locale/lang/ja-JP.js +5 -0
- package/es/locale/lang/zh-CN.js +5 -0
- package/es/locale/lang/zh-TC.js +5 -0
- package/es/menu/src/hooks.js +3 -3
- package/es/select/src/select.js +4 -1
- package/es/style.css +1 -1
- package/es/style.min.css +1 -1
- package/es/table/src/table.js +3 -3
- package/es/table/style.css +2 -2
- package/es/textarea/src/textarea.js +4 -1
- package/es/tools/log.js +1 -1
- package/es/v-x-e-table/index.js +4 -1
- package/es/v-x-e-table/src/menus.js +48 -2
- package/es/v-x-e-table/src/store.js +4 -1
- package/es/v-x-e-table/src/validators.js +5 -0
- package/es/validator/src/hook.js +31 -6
- package/es/vxe-table/style.css +2 -2
- package/lib/form/src/form.js +24 -4
- package/lib/form/src/form.min.js +1 -1
- package/lib/icon/style/style.css +1 -1
- package/lib/icon/style/style.min.css +1 -1
- package/lib/index.umd.js +140 -23
- package/lib/index.umd.min.js +1 -1
- package/lib/input/src/input.js +6 -1
- package/lib/input/src/input.min.js +1 -1
- package/lib/locale/lang/en-US.js +4 -0
- package/lib/locale/lang/en-US.min.js +1 -1
- package/lib/locale/lang/en-US.umd.js +4 -0
- package/lib/locale/lang/es-ES.js +5 -0
- package/lib/locale/lang/es-ES.min.js +1 -1
- package/lib/locale/lang/es-ES.umd.js +5 -0
- package/lib/locale/lang/ja-JP.js +5 -0
- package/lib/locale/lang/ja-JP.min.js +1 -1
- package/lib/locale/lang/ja-JP.umd.js +5 -0
- package/lib/locale/lang/zh-CN.js +5 -0
- package/lib/locale/lang/zh-CN.min.js +1 -1
- package/lib/locale/lang/zh-CN.umd.js +5 -0
- package/lib/locale/lang/zh-HK.min.js +1 -1
- package/lib/locale/lang/zh-HK.umd.js +5 -0
- package/lib/locale/lang/zh-MO.min.js +1 -1
- package/lib/locale/lang/zh-MO.umd.js +5 -0
- package/lib/locale/lang/zh-TC.js +5 -0
- package/lib/locale/lang/zh-TC.min.js +1 -1
- package/lib/locale/lang/zh-TC.umd.js +5 -0
- package/lib/locale/lang/zh-TW.min.js +1 -1
- package/lib/locale/lang/zh-TW.umd.js +5 -0
- package/lib/menu/src/hooks.js +3 -3
- package/lib/menu/src/hooks.min.js +1 -1
- package/lib/select/src/select.js +6 -1
- 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/table.js +4 -4
- package/lib/table/src/table.min.js +1 -1
- package/lib/table/style/style.css +2 -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/tools/log.js +1 -1
- package/lib/tools/log.min.js +1 -1
- package/lib/v-x-e-table/index.js +14 -1
- package/lib/v-x-e-table/index.min.js +1 -1
- package/lib/v-x-e-table/src/menus.js +48 -2
- package/lib/v-x-e-table/src/menus.min.js +1 -1
- package/lib/v-x-e-table/src/store.js +4 -1
- 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/hook.js +29 -6
- package/lib/validator/src/hook.min.js +1 -1
- package/lib/vxe-table/style/style.css +2 -2
- package/lib/vxe-table/style/style.min.css +1 -1
- package/package.json +2 -2
- package/packages/form/src/form.ts +24 -5
- package/packages/input/src/input.ts +4 -1
- package/packages/locale/lang/en-US.ts +4 -0
- package/packages/locale/lang/es-ES.ts +5 -0
- package/packages/locale/lang/ja-JP.ts +5 -0
- package/packages/locale/lang/zh-CN.ts +5 -0
- package/packages/locale/lang/zh-TC.ts +5 -0
- package/packages/menu/src/hooks.ts +3 -3
- package/packages/select/src/select.ts +4 -1
- package/packages/table/src/table.ts +3 -3
- package/packages/textarea/src/textarea.ts +4 -1
- package/packages/v-x-e-table/index.ts +3 -0
- package/packages/v-x-e-table/src/menus.ts +52 -2
- package/packages/v-x-e-table/src/store.ts +3 -1
- package/packages/v-x-e-table/src/validators.ts +9 -0
- package/packages/validator/src/hook.ts +28 -6
- package/styles/table.scss +2 -2
- package/types/form.d.ts +9 -12
- package/types/v-x-e-table/index.d.ts +8 -1
- package/types/v-x-e-table/menus.d.ts +19 -7
- package/types/v-x-e-table/validators.d.ts +30 -0
- package/types/validator.d.ts +14 -1
- /package/es/icon/style/{iconfont.1690003639196.ttf → iconfont.1690032028705.ttf} +0 -0
- /package/es/icon/style/{iconfont.1690003639196.woff → iconfont.1690032028705.woff} +0 -0
- /package/es/icon/style/{iconfont.1690003639196.woff2 → iconfont.1690032028705.woff2} +0 -0
- /package/es/{iconfont.1690003639196.ttf → iconfont.1690032028705.ttf} +0 -0
- /package/es/{iconfont.1690003639196.woff → iconfont.1690032028705.woff} +0 -0
- /package/es/{iconfont.1690003639196.woff2 → iconfont.1690032028705.woff2} +0 -0
- /package/lib/icon/style/{iconfont.1690003639196.ttf → iconfont.1690032028705.ttf} +0 -0
- /package/lib/icon/style/{iconfont.1690003639196.woff → iconfont.1690032028705.woff} +0 -0
- /package/lib/icon/style/{iconfont.1690003639196.woff2 → iconfont.1690032028705.woff2} +0 -0
- /package/lib/{iconfont.1690003639196.ttf → iconfont.1690032028705.ttf} +0 -0
- /package/lib/{iconfont.1690003639196.woff → iconfont.1690032028705.woff} +0 -0
- /package/lib/{iconfont.1690003639196.woff2 → iconfont.1690032028705.woff2} +0 -0
|
@@ -6,6 +6,7 @@ import { VxeGlobalInterceptor } from './interceptor'
|
|
|
6
6
|
import { VxeGlobalCommands } from './commands'
|
|
7
7
|
import { VxeGlobalFormats } from './formats'
|
|
8
8
|
import { VxeGlobalMenus } from './menus'
|
|
9
|
+
import { VxeGlobalValidators } from './validators'
|
|
9
10
|
import { VxeGlobalHooks } from './hooks'
|
|
10
11
|
import { VxeGlobalSetup } from './setup'
|
|
11
12
|
|
|
@@ -39,6 +40,7 @@ export const renderer: VxeGlobalRenderer
|
|
|
39
40
|
export const commands: VxeGlobalCommands
|
|
40
41
|
export const formats: VxeGlobalFormats
|
|
41
42
|
export const menus: VxeGlobalMenus
|
|
43
|
+
export const validators: VxeGlobalValidators
|
|
42
44
|
export const hooks: VxeGlobalHooks
|
|
43
45
|
export const modal: ModalController
|
|
44
46
|
export const saveFile: SaveFileFunction
|
|
@@ -93,6 +95,10 @@ export interface VXETableCore {
|
|
|
93
95
|
* Table context menu
|
|
94
96
|
*/
|
|
95
97
|
menus: VxeGlobalMenus
|
|
98
|
+
/**
|
|
99
|
+
* Validators table/form
|
|
100
|
+
*/
|
|
101
|
+
validators: VxeGlobalValidators
|
|
96
102
|
/**
|
|
97
103
|
* Table VxeGlobalHooks API
|
|
98
104
|
*/
|
|
@@ -131,7 +137,7 @@ export interface VXETableCore {
|
|
|
131
137
|
}
|
|
132
138
|
|
|
133
139
|
/**
|
|
134
|
-
* 一个基于 vue 的 PC
|
|
140
|
+
* 一个基于 vue 的 PC 端表格组件,支持增删改查、虚拟列表、虚拟树、懒加载、快捷菜单、数据校验、树形结构、打印导出、表单渲染、数据分页、弹窗、自定义模板、渲染器、JSON 配置式为零代码而设计...
|
|
135
141
|
*/
|
|
136
142
|
export const VXETable: VXETableCore
|
|
137
143
|
|
|
@@ -140,6 +146,7 @@ export * from './interceptor'
|
|
|
140
146
|
export * from './commands'
|
|
141
147
|
export * from './formats'
|
|
142
148
|
export * from './menus'
|
|
149
|
+
export * from './validators'
|
|
143
150
|
export * from './hooks'
|
|
144
151
|
export * from './setup'
|
|
145
152
|
|
|
@@ -5,18 +5,30 @@ import { VxeGlobalRendererHandles } from './renderer'
|
|
|
5
5
|
/* eslint-disable no-use-before-define */
|
|
6
6
|
|
|
7
7
|
export namespace VxeGlobalMenusHandles {
|
|
8
|
-
export type
|
|
9
|
-
|
|
8
|
+
export type MenusOption<D = VxeTableDataRow> = {
|
|
9
|
+
menuMethod?: (params: MenuMethodParams<D>, event: Event) => any
|
|
10
|
+
}
|
|
10
11
|
interface MenusParams<D = VxeTableDataRow> {
|
|
11
12
|
$grid: VxeGridConstructor<D> | null
|
|
12
13
|
$table: VxeTableConstructor<D> & VxeTablePrivateMethods<D>
|
|
13
14
|
}
|
|
14
|
-
export interface
|
|
15
|
+
export interface MenuMethodParams<D = VxeTableDataRow> extends MenusParams<D>, VxeGlobalRendererHandles.RenderCellParams<D> {
|
|
15
16
|
$grid: VxeGridConstructor<D> | null
|
|
16
17
|
$table: VxeTableConstructor<D> & VxeTablePrivateMethods<D>
|
|
17
18
|
$event: MouseEvent
|
|
18
19
|
menu: VxeTableDefines.MenuFirstOption | VxeTableDefines.MenuChildOption
|
|
19
20
|
}
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* 请使用 MenusOption
|
|
24
|
+
* @deprecated
|
|
25
|
+
*/
|
|
26
|
+
export type MenusCallback = MenusOption
|
|
27
|
+
/**
|
|
28
|
+
* 请使用 MenuMethodParams
|
|
29
|
+
* @deprecated
|
|
30
|
+
*/
|
|
31
|
+
export interface MenusCallbackParams<D = VxeTableDataRow> extends MenuMethodParams<D> {}
|
|
20
32
|
}
|
|
21
33
|
|
|
22
34
|
/**
|
|
@@ -24,11 +36,11 @@ export namespace VxeGlobalMenusHandles {
|
|
|
24
36
|
*/
|
|
25
37
|
export interface VxeGlobalMenus {
|
|
26
38
|
mixin(options: {
|
|
27
|
-
[code: string]: VxeGlobalMenusHandles.
|
|
39
|
+
[code: string]: VxeGlobalMenusHandles.MenusOption<any> | ((params: VxeGlobalMenusHandles.MenuMethodParams<any>, event: Event) => any)
|
|
28
40
|
}): VxeGlobalMenus
|
|
29
41
|
has(code: string): boolean
|
|
30
|
-
get(code: string): VxeGlobalMenusHandles.
|
|
31
|
-
add(code: string,
|
|
42
|
+
get(code: string): VxeGlobalMenusHandles.MenusOption<any>
|
|
43
|
+
add(code: string, options: VxeGlobalMenusHandles.MenusOption<any> | ((params: VxeGlobalMenusHandles.MenuMethodParams<any>, event: Event) => any)): VxeGlobalMenus
|
|
32
44
|
delete(code: string): void
|
|
33
|
-
forEach(callback: (options: VxeGlobalMenusHandles.
|
|
45
|
+
forEach(callback: (options: VxeGlobalMenusHandles.MenusOption<any>, code: string) => void): void
|
|
34
46
|
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { VxeTableDefines, VxeTableDataRow } from '../table'
|
|
2
|
+
import { VxeFormDefines } from '../form'
|
|
3
|
+
|
|
4
|
+
/* eslint-disable no-use-before-define */
|
|
5
|
+
|
|
6
|
+
export namespace VxeGlobalValidatorsHandles {
|
|
7
|
+
export interface ValidatorsOptions<D = VxeTableDataRow> {
|
|
8
|
+
itemValidatorMethod?: ItemValidatorMethod
|
|
9
|
+
cellValidatorMethod?: CellValidatorMethod<D>
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export type ItemValidatorMethod = (params: ItemValidatorParams, ...args: any[]) => void | Error | Promise<any>
|
|
13
|
+
export type CellValidatorMethod<D = VxeTableDataRow> = (params: CellValidatorParams<D>, ...args: any[]) => void | Error | Promise<any>
|
|
14
|
+
export interface ItemValidatorParams extends VxeFormDefines.RuleValidatorParams {}
|
|
15
|
+
export interface CellValidatorParams<D = VxeTableDataRow> extends VxeTableDefines.RuleValidatorParams<D> {}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* 全局快捷菜单
|
|
20
|
+
*/
|
|
21
|
+
export interface VxeGlobalValidators {
|
|
22
|
+
mixin(options: {
|
|
23
|
+
[code: string]: VxeGlobalValidatorsHandles.ValidatorsOptions<any>
|
|
24
|
+
}): VxeGlobalValidators
|
|
25
|
+
has(code: string): boolean
|
|
26
|
+
get(code: string): VxeGlobalValidatorsHandles.ValidatorsOptions<any>
|
|
27
|
+
add(code: string, callback: VxeGlobalValidatorsHandles.ValidatorsOptions<any>): VxeGlobalValidators
|
|
28
|
+
delete(code: string): void
|
|
29
|
+
forEach(callback: (options: VxeGlobalValidatorsHandles.ValidatorsOptions<any>, code: string) => void): void
|
|
30
|
+
}
|
package/types/validator.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { VXEComponent } from './component'
|
|
2
2
|
import { VxeTableDefines, VxeTableDataRow, VxeTableConstructor } from './table'
|
|
3
|
+
import { VxeGridConstructor } from './grid'
|
|
3
4
|
import { VxeColumnPropTypes } from './column'
|
|
4
5
|
|
|
5
6
|
/* eslint-disable no-use-before-define */
|
|
@@ -71,7 +72,7 @@ declare module './table' {
|
|
|
71
72
|
* 使用自定义校验函数,接收一个 Promise
|
|
72
73
|
* @param params 参数
|
|
73
74
|
*/
|
|
74
|
-
validator
|
|
75
|
+
validator?: string | ((params: RuleValidatorParams<D>) => void | Error | Promise<void>)
|
|
75
76
|
/**
|
|
76
77
|
* 提示消息
|
|
77
78
|
*/
|
|
@@ -83,6 +84,18 @@ declare module './table' {
|
|
|
83
84
|
*/
|
|
84
85
|
message?: string
|
|
85
86
|
}
|
|
87
|
+
export interface RuleValidatorParams<D = VxeTableDataRow> {
|
|
88
|
+
$table: VxeTableConstructor<D>
|
|
89
|
+
$grid: VxeGridConstructor<D> | null
|
|
90
|
+
cellValue: any
|
|
91
|
+
rule: ValidatorRule<D>
|
|
92
|
+
rules: ValidatorRule<D>[]
|
|
93
|
+
column: VxeTableDefines.ColumnInfo<D>
|
|
94
|
+
columnIndex: number
|
|
95
|
+
row: D
|
|
96
|
+
rowIndex: number
|
|
97
|
+
field: string
|
|
98
|
+
}
|
|
86
99
|
export interface ValidatorErrorParams<D = VxeTableDataRow> {
|
|
87
100
|
$table: VxeTableConstructor<D>
|
|
88
101
|
cellValue: any
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|