vxe-table 3.7.0-beta.6 → 3.7.0-beta.8

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 (142) hide show
  1. package/README.md +6 -9
  2. package/lib/filter/src/mixin.js +13 -7
  3. package/lib/filter/src/mixin.min.js +1 -1
  4. package/lib/form/src/form.js +24 -4
  5. package/lib/form/src/form.min.js +1 -1
  6. package/lib/grid/src/grid.js +7 -3
  7. package/lib/grid/src/grid.min.js +1 -1
  8. package/lib/icon/style/style.css +1 -1
  9. package/lib/icon/style/style.min.css +1 -1
  10. package/lib/index.css +1 -1
  11. package/lib/index.umd.js +352 -89
  12. package/lib/index.umd.min.js +1 -1
  13. package/lib/input/src/input.js +6 -1
  14. package/lib/input/src/input.min.js +1 -1
  15. package/lib/locale/lang/en-US.js +8 -0
  16. package/lib/locale/lang/en-US.min.js +1 -1
  17. package/lib/locale/lang/en-US.umd.js +8 -0
  18. package/lib/locale/lang/es-ES.js +8 -0
  19. package/lib/locale/lang/es-ES.min.js +1 -1
  20. package/lib/locale/lang/es-ES.umd.js +8 -0
  21. package/lib/locale/lang/ja-JP.d.ts +1 -1
  22. package/lib/locale/lang/ja-JP.js +8 -0
  23. package/lib/locale/lang/ja-JP.min.js +1 -1
  24. package/lib/locale/lang/ja-JP.umd.js +8 -0
  25. package/lib/locale/lang/pt-BR.d.ts +8 -0
  26. package/lib/locale/lang/pt-BR.js +330 -0
  27. package/lib/locale/lang/pt-BR.min.js +1 -0
  28. package/lib/locale/lang/pt-BR.umd.js +344 -0
  29. package/lib/locale/lang/zh-CN.d.ts +1 -1
  30. package/lib/locale/lang/zh-CN.js +8 -0
  31. package/lib/locale/lang/zh-CN.min.js +1 -1
  32. package/lib/locale/lang/zh-CN.umd.js +8 -0
  33. package/lib/locale/lang/zh-HK.d.ts +1 -1
  34. package/lib/locale/lang/zh-HK.min.js +1 -1
  35. package/lib/locale/lang/zh-HK.umd.js +8 -0
  36. package/lib/locale/lang/zh-MO.d.ts +1 -1
  37. package/lib/locale/lang/zh-MO.min.js +1 -1
  38. package/lib/locale/lang/zh-MO.umd.js +8 -0
  39. package/lib/locale/lang/zh-TC.d.ts +1 -1
  40. package/lib/locale/lang/zh-TC.js +8 -0
  41. package/lib/locale/lang/zh-TC.min.js +1 -1
  42. package/lib/locale/lang/zh-TC.umd.js +8 -0
  43. package/lib/locale/lang/zh-TW.d.ts +1 -1
  44. package/lib/locale/lang/zh-TW.min.js +1 -1
  45. package/lib/locale/lang/zh-TW.umd.js +8 -0
  46. package/lib/menu/src/mixin.js +3 -3
  47. package/lib/menu/src/mixin.min.js +1 -1
  48. package/lib/select/src/select.js +6 -1
  49. package/lib/select/src/select.min.js +1 -1
  50. package/lib/style.css +1 -1
  51. package/lib/style.min.css +1 -1
  52. package/lib/table/src/cell.js +2 -0
  53. package/lib/table/src/cell.min.js +1 -1
  54. package/lib/table/src/columnInfo.js +6 -6
  55. package/lib/table/src/columnInfo.min.js +1 -1
  56. package/lib/table/src/methods.js +43 -16
  57. package/lib/table/src/methods.min.js +1 -1
  58. package/lib/table/src/table.js +11 -24
  59. package/lib/table/src/table.min.js +1 -1
  60. package/lib/table/style/style.css +2 -2
  61. package/lib/table/style/style.min.css +1 -1
  62. package/lib/textarea/src/textarea.js +6 -1
  63. package/lib/textarea/src/textarea.min.js +1 -1
  64. package/lib/toolbar/src/toolbar.js +18 -6
  65. package/lib/toolbar/src/toolbar.min.js +1 -1
  66. package/lib/tools/log.js +1 -1
  67. package/lib/tools/log.min.js +1 -1
  68. package/lib/v-x-e-table/index.js +3 -1
  69. package/lib/v-x-e-table/index.min.js +1 -1
  70. package/lib/v-x-e-table/src/commands.js +58 -2
  71. package/lib/v-x-e-table/src/commands.min.js +1 -1
  72. package/lib/v-x-e-table/src/conf.js +4 -1
  73. package/lib/v-x-e-table/src/conf.min.js +1 -1
  74. package/lib/v-x-e-table/src/formats.js +58 -2
  75. package/lib/v-x-e-table/src/formats.min.js +1 -1
  76. package/lib/v-x-e-table/src/menus.js +58 -2
  77. package/lib/v-x-e-table/src/menus.min.js +1 -1
  78. package/lib/v-x-e-table/src/renderer.js +10 -0
  79. package/lib/v-x-e-table/src/renderer.min.js +1 -1
  80. package/lib/v-x-e-table/src/store.js +5 -2
  81. package/lib/v-x-e-table/src/store.min.js +1 -1
  82. package/lib/v-x-e-table/src/validators.js +15 -0
  83. package/lib/v-x-e-table/src/validators.min.js +1 -0
  84. package/lib/validator/src/mixin.js +26 -4
  85. package/lib/validator/src/mixin.min.js +1 -1
  86. package/package.json +2 -2
  87. package/packages/filter/src/mixin.js +5 -1
  88. package/packages/form/src/form.js +24 -5
  89. package/packages/grid/src/grid.js +7 -3
  90. package/packages/input/src/input.js +4 -1
  91. package/packages/locale/lang/en-US.js +8 -0
  92. package/packages/locale/lang/es-ES.js +8 -0
  93. package/packages/locale/lang/ja-JP.d.ts +1 -1
  94. package/packages/locale/lang/ja-JP.js +8 -0
  95. package/packages/locale/lang/pt-BR.d.ts +8 -0
  96. package/packages/locale/lang/pt-BR.js +323 -0
  97. package/packages/locale/lang/zh-CN.d.ts +1 -1
  98. package/packages/locale/lang/zh-CN.js +8 -0
  99. package/packages/locale/lang/zh-HK.d.ts +1 -1
  100. package/packages/locale/lang/zh-MO.d.ts +1 -1
  101. package/packages/locale/lang/zh-TC.d.ts +1 -1
  102. package/packages/locale/lang/zh-TC.js +8 -0
  103. package/packages/locale/lang/zh-TW.d.ts +1 -1
  104. package/packages/menu/src/mixin.js +3 -3
  105. package/packages/select/src/select.js +4 -1
  106. package/packages/table/src/cell.js +2 -0
  107. package/packages/table/src/columnInfo.js +6 -6
  108. package/packages/table/src/methods.js +36 -15
  109. package/packages/table/src/table.js +5 -1
  110. package/packages/textarea/src/textarea.js +4 -1
  111. package/packages/toolbar/src/toolbar.js +18 -6
  112. package/packages/v-x-e-table/index.js +2 -0
  113. package/packages/v-x-e-table/src/commands.js +48 -2
  114. package/packages/v-x-e-table/src/conf.js +4 -1
  115. package/packages/v-x-e-table/src/formats.js +48 -2
  116. package/packages/v-x-e-table/src/menus.js +48 -2
  117. package/packages/v-x-e-table/src/renderer.js +11 -1
  118. package/packages/v-x-e-table/src/store.js +4 -2
  119. package/packages/v-x-e-table/src/validators.js +7 -0
  120. package/packages/validator/src/mixin.js +25 -4
  121. package/styles/all.scss +30 -0
  122. package/styles/css-variable.scss +272 -0
  123. package/styles/cssvar.scss +2 -275
  124. package/styles/index.scss +2 -0
  125. package/styles/modules.scss +4 -1
  126. package/styles/table.scss +4 -4
  127. package/styles/tooltip.scss +2 -2
  128. package/styles/variable.scss +1 -4
  129. package/types/form.d.ts +14 -12
  130. package/types/table.d.ts +4 -0
  131. package/types/v-x-e-table/commands.d.ts +21 -13
  132. package/types/v-x-e-table/formats.d.ts +19 -12
  133. package/types/v-x-e-table/index.d.ts +7 -1
  134. package/types/v-x-e-table/menus.d.ts +17 -6
  135. package/types/v-x-e-table/validators.d.ts +30 -0
  136. package/types/validator.d.ts +15 -4
  137. /package/lib/icon/style/{iconfont.1689639571797.ttf → iconfont.1690504677290.ttf} +0 -0
  138. /package/lib/icon/style/{iconfont.1689639571797.woff → iconfont.1690504677290.woff} +0 -0
  139. /package/lib/icon/style/{iconfont.1689639571797.woff2 → iconfont.1690504677290.woff2} +0 -0
  140. /package/lib/{iconfont.1689639571797.ttf → iconfont.1690504677290.ttf} +0 -0
  141. /package/lib/{iconfont.1689639571797.woff → iconfont.1690504677290.woff} +0 -0
  142. /package/lib/{iconfont.1689639571797.woff2 → iconfont.1690504677290.woff2} +0 -0
package/types/table.d.ts CHANGED
@@ -25,6 +25,10 @@ export declare class Table extends VXETableComponent {
25
25
  * 表格的高度
26
26
  */
27
27
  height?: number | string;
28
+ /**
29
+ * 表格的最小高度
30
+ */
31
+ minHeight?: number | string;
28
32
  /**
29
33
  * 表格的最大高度
30
34
  */
@@ -1,21 +1,29 @@
1
1
  import { ToolbarButtonConfig } from '../toolbar'
2
- import { GridRenderParams } from './renderer'
2
+ import { Table } from '../table'
3
3
 
4
4
  /* eslint-disable no-use-before-define */
5
5
 
6
- declare function commandsFunc(params: CommandsParams, ...args: any[]): any;
6
+ export namespace VxeGlobalCommandsHandles {
7
+ export interface CommandsOptions {
8
+ commandMethod?: (params: CommandMethodParams, ...args: any[]) => void
9
+ }
10
+ export interface CommandMethodParams {
11
+ $table: Table;
12
+ code: string;
13
+ button?: ToolbarButtonConfig;
14
+ }
15
+ }
7
16
 
8
17
  /**
9
- * 全局指令
18
+ * 全局格式化
10
19
  */
11
- export class VxeGlobalCommands {
12
- mixin(map: { [type: string]: typeof commandsFunc }): VxeGlobalCommands;
13
- get(type: string): typeof commandsFunc;
14
- add(type: string, callback: typeof commandsFunc): VxeGlobalCommands;
15
- delete(type: string): VxeGlobalCommands;
16
- }
17
-
18
- export interface CommandsParams extends GridRenderParams {
19
- code: string;
20
- button?: ToolbarButtonConfig;
20
+ export interface VxeGlobalCommands {
21
+ mixin(opts: {
22
+ [name: string]: VxeGlobalCommandsHandles.CommandsOptions | ((params: VxeGlobalCommandsHandles.CommandMethodParams, ...args: any[]) => void)
23
+ }): VxeGlobalCommands
24
+ has(name: string): boolean
25
+ get(name: string): VxeGlobalCommandsHandles.CommandsOptions
26
+ add(name: string, options: VxeGlobalCommandsHandles.CommandsOptions | ((params: VxeGlobalCommandsHandles.CommandMethodParams, ...args: any[]) => void)): VxeGlobalCommands
27
+ delete(name: string): void
28
+ forEach(callback: (options: VxeGlobalCommandsHandles.CommandsOptions, name: string) => void): void
21
29
  }
@@ -2,20 +2,27 @@ import { ColumnInfo } from '../column'
2
2
 
3
3
  /* eslint-disable no-use-before-define */
4
4
 
5
- declare function formatsFunc(params: FormatsParams, ...args: any[]): any;
5
+ export namespace VxeGlobalFormatsHandles {
6
+ export interface FormatsOptions {
7
+ formatMethod?: (params: FormatMethodParams, ...args: any[]) => string | number
8
+ }
9
+ export interface FormatMethodParams {
10
+ cellValue: any
11
+ row: any
12
+ column: ColumnInfo
13
+ }
14
+ }
6
15
 
7
16
  /**
8
17
  * 全局格式化
9
18
  */
10
- export class VxeGlobalFormats {
11
- mixin(map: { [type: string]: typeof formatsFunc }): VxeGlobalFormats;
12
- get(type: string): typeof formatsFunc;
13
- add(type: string, callback: typeof formatsFunc): VxeGlobalFormats;
14
- delete(type: string): VxeGlobalFormats;
15
- }
16
-
17
- export interface FormatsParams {
18
- cellValue: any;
19
- row: any,
20
- column: ColumnInfo;
19
+ export interface VxeGlobalFormats {
20
+ mixin(opts: {
21
+ [name: string]: VxeGlobalFormatsHandles.FormatsOptions | ((params: VxeGlobalFormatsHandles.FormatMethodParams, ...args: any[]) => string | number)
22
+ }): VxeGlobalFormats
23
+ has(name: string): boolean
24
+ get(name: string): VxeGlobalFormatsHandles.FormatsOptions
25
+ add(name: string, options: VxeGlobalFormatsHandles.FormatsOptions | ((params: VxeGlobalFormatsHandles.FormatMethodParams, ...args: any[]) => string | number)): VxeGlobalFormats
26
+ delete(name: string): void
27
+ forEach(callback: (options: VxeGlobalFormatsHandles.FormatsOptions, name: string) => void): void
21
28
  }
@@ -8,6 +8,7 @@ import { VxeGlobalInterceptor } from './interceptor'
8
8
  import { VxeGlobalCommands } from './commands'
9
9
  import { VxeGlobalFormats } from './formats'
10
10
  import { VxeGlobalMenus } from './menus'
11
+ import { VxeGlobalValidators } from './validators'
11
12
  import { VxeGlobalSetup } from './setup'
12
13
 
13
14
  /* eslint-disable no-use-before-define */
@@ -73,6 +74,10 @@ export interface VXETableCore {
73
74
  * Table context menu
74
75
  */
75
76
  menus: VxeGlobalMenus;
77
+ /**
78
+ * Validators table/form
79
+ */
80
+ validators: VxeGlobalValidators
76
81
  /**
77
82
  * 弹窗
78
83
  */
@@ -103,7 +108,7 @@ export interface VXETableCore {
103
108
  }
104
109
 
105
110
  /**
106
- * 一个基于 vue 的 PC 端表格组件,支持增删改查、虚拟滚动、懒加载、快捷菜单、数据校验、树形结构、打印导出、表单渲染、数据分页、虚拟列表、弹窗、自定义模板、渲染器、贼灵活的配置项等...
111
+ * 一个基于 vue 的 PC 端表单/表格组件,支持增删改查、虚拟列表、虚拟树、懒加载、快捷菜单、数据校验、树形结构、打印导出、表单渲染、数据分页、弹窗、自定义模板、渲染器、JSON 配置式为零代码而设计...
107
112
  */
108
113
  export const VXETable: VXETableCore
109
114
 
@@ -112,6 +117,7 @@ export * from './interceptor'
112
117
  export * from './commands'
113
118
  export * from './formats'
114
119
  export * from './menus'
120
+ export * from './validators'
115
121
  export * from './setup'
116
122
 
117
123
  export default VXETable
@@ -1,13 +1,24 @@
1
1
  import { MenuLinkParams } from '../menu'
2
2
 
3
- declare function menuFunc (params: MenuLinkParams, event: any): any;
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 class VxeGlobalMenus {
9
- mixin(map: { [type: string]: typeof menuFunc }): VxeGlobalMenus;
10
- get(type: string): typeof menuFunc;
11
- add(type: string, callback: typeof menuFunc): VxeGlobalMenus;
12
- delete(type: string): VxeGlobalMenus;
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
  }
@@ -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
+ }
@@ -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?: typeof ColumnValidatorMethod;
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 function ColumnValidatorMethod(params: ColumnEditValidErrParams): void;
45
- export function ColumnValidatorMethod(params: ColumnEditValidErrParams): Error;
46
- export function ColumnValidatorMethod(params: ColumnEditValidErrParams): Promise<any>;
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,