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.
Files changed (189) hide show
  1. package/README.md +6 -9
  2. package/helper/vetur/attributes.json +86 -22
  3. package/helper/vetur/tags.json +17 -1
  4. package/lib/button/src/button.js +9 -3
  5. package/lib/button/src/button.min.js +1 -1
  6. package/lib/edit/src/mixin.js +10 -10
  7. package/lib/edit/src/mixin.min.js +1 -1
  8. package/lib/export/src/mixin.js +24 -13
  9. package/lib/export/src/mixin.min.js +1 -1
  10. package/lib/filter/src/mixin.js +13 -7
  11. package/lib/filter/src/mixin.min.js +1 -1
  12. package/lib/form/src/form.js +27 -5
  13. package/lib/form/src/form.min.js +1 -1
  14. package/lib/grid/src/grid.js +7 -3
  15. package/lib/grid/src/grid.min.js +1 -1
  16. package/lib/icon/style/style.css +1 -1
  17. package/lib/icon/style/style.min.css +1 -1
  18. package/lib/index.css +1 -1
  19. package/lib/index.umd.js +559 -229
  20. package/lib/index.umd.min.js +1 -1
  21. package/lib/input/src/input.js +11 -1
  22. package/lib/input/src/input.min.js +1 -1
  23. package/lib/locale/lang/en-US.js +8 -0
  24. package/lib/locale/lang/en-US.min.js +1 -1
  25. package/lib/locale/lang/en-US.umd.js +8 -0
  26. package/lib/locale/lang/es-ES.js +8 -0
  27. package/lib/locale/lang/es-ES.min.js +1 -1
  28. package/lib/locale/lang/es-ES.umd.js +8 -0
  29. package/lib/locale/lang/ja-JP.d.ts +1 -1
  30. package/lib/locale/lang/ja-JP.js +8 -0
  31. package/lib/locale/lang/ja-JP.min.js +1 -1
  32. package/lib/locale/lang/ja-JP.umd.js +8 -0
  33. package/lib/locale/lang/pt-BR.d.ts +8 -0
  34. package/lib/locale/lang/pt-BR.js +330 -0
  35. package/lib/locale/lang/pt-BR.min.js +1 -0
  36. package/lib/locale/lang/pt-BR.umd.js +344 -0
  37. package/lib/locale/lang/zh-CN.d.ts +1 -1
  38. package/lib/locale/lang/zh-CN.js +8 -0
  39. package/lib/locale/lang/zh-CN.min.js +1 -1
  40. package/lib/locale/lang/zh-CN.umd.js +8 -0
  41. package/lib/locale/lang/zh-HK.d.ts +1 -1
  42. package/lib/locale/lang/zh-HK.min.js +1 -1
  43. package/lib/locale/lang/zh-HK.umd.js +8 -0
  44. package/lib/locale/lang/zh-MO.d.ts +1 -1
  45. package/lib/locale/lang/zh-MO.min.js +1 -1
  46. package/lib/locale/lang/zh-MO.umd.js +8 -0
  47. package/lib/locale/lang/zh-TC.d.ts +1 -1
  48. package/lib/locale/lang/zh-TC.js +8 -0
  49. package/lib/locale/lang/zh-TC.min.js +1 -1
  50. package/lib/locale/lang/zh-TC.umd.js +8 -0
  51. package/lib/locale/lang/zh-TW.d.ts +1 -1
  52. package/lib/locale/lang/zh-TW.min.js +1 -1
  53. package/lib/locale/lang/zh-TW.umd.js +8 -0
  54. package/lib/menu/src/mixin.js +3 -3
  55. package/lib/menu/src/mixin.min.js +1 -1
  56. package/lib/pulldown/src/pulldown.js +11 -2
  57. package/lib/pulldown/src/pulldown.min.js +1 -1
  58. package/lib/select/src/select.js +11 -2
  59. package/lib/select/src/select.min.js +1 -1
  60. package/lib/style.css +1 -1
  61. package/lib/style.min.css +1 -1
  62. package/lib/table/src/body.js +3 -2
  63. package/lib/table/src/body.min.js +1 -1
  64. package/lib/table/src/cell.js +9 -7
  65. package/lib/table/src/cell.min.js +1 -1
  66. package/lib/table/src/columnInfo.js +7 -7
  67. package/lib/table/src/columnInfo.min.js +1 -1
  68. package/lib/table/src/methods.js +171 -124
  69. package/lib/table/src/methods.min.js +1 -1
  70. package/lib/table/src/table.js +22 -29
  71. package/lib/table/src/table.min.js +1 -1
  72. package/lib/table/src/util.js +3 -1
  73. package/lib/table/src/util.min.js +1 -1
  74. package/lib/table/style/style.css +7 -2
  75. package/lib/table/style/style.min.css +1 -1
  76. package/lib/textarea/src/textarea.js +6 -1
  77. package/lib/textarea/src/textarea.min.js +1 -1
  78. package/lib/toolbar/src/toolbar.js +23 -7
  79. package/lib/toolbar/src/toolbar.min.js +1 -1
  80. package/lib/tools/log.js +1 -1
  81. package/lib/tools/log.min.js +1 -1
  82. package/lib/tooltip/src/tooltip.js +5 -1
  83. package/lib/tooltip/src/tooltip.min.js +1 -1
  84. package/lib/tooltip/style/style.css +0 -6
  85. package/lib/tooltip/style/style.min.css +1 -1
  86. package/lib/v-x-e-table/index.js +3 -1
  87. package/lib/v-x-e-table/index.min.js +1 -1
  88. package/lib/v-x-e-table/src/commands.js +60 -2
  89. package/lib/v-x-e-table/src/commands.min.js +1 -1
  90. package/lib/v-x-e-table/src/conf.js +7 -4
  91. package/lib/v-x-e-table/src/conf.min.js +1 -1
  92. package/lib/v-x-e-table/src/formats.js +60 -2
  93. package/lib/v-x-e-table/src/formats.min.js +1 -1
  94. package/lib/v-x-e-table/src/menus.js +60 -2
  95. package/lib/v-x-e-table/src/menus.min.js +1 -1
  96. package/lib/v-x-e-table/src/renderer.js +10 -0
  97. package/lib/v-x-e-table/src/renderer.min.js +1 -1
  98. package/lib/v-x-e-table/src/store.js +5 -2
  99. package/lib/v-x-e-table/src/store.min.js +1 -1
  100. package/lib/v-x-e-table/src/validators.js +15 -0
  101. package/lib/v-x-e-table/src/validators.min.js +1 -0
  102. package/lib/validator/src/mixin.js +36 -4
  103. package/lib/validator/src/mixin.min.js +1 -1
  104. package/package.json +2 -2
  105. package/packages/button/src/button.js +5 -4
  106. package/packages/edit/src/mixin.js +10 -9
  107. package/packages/export/src/mixin.js +22 -13
  108. package/packages/filter/src/mixin.js +5 -1
  109. package/packages/form/src/form.js +27 -6
  110. package/packages/grid/src/grid.js +7 -3
  111. package/packages/input/src/input.js +9 -1
  112. package/packages/locale/lang/en-US.js +8 -0
  113. package/packages/locale/lang/es-ES.js +8 -0
  114. package/packages/locale/lang/ja-JP.d.ts +1 -1
  115. package/packages/locale/lang/ja-JP.js +8 -0
  116. package/packages/locale/lang/pt-BR.d.ts +8 -0
  117. package/packages/locale/lang/pt-BR.js +323 -0
  118. package/packages/locale/lang/zh-CN.d.ts +1 -1
  119. package/packages/locale/lang/zh-CN.js +8 -0
  120. package/packages/locale/lang/zh-HK.d.ts +1 -1
  121. package/packages/locale/lang/zh-MO.d.ts +1 -1
  122. package/packages/locale/lang/zh-TC.d.ts +1 -1
  123. package/packages/locale/lang/zh-TC.js +8 -0
  124. package/packages/locale/lang/zh-TW.d.ts +1 -1
  125. package/packages/menu/src/mixin.js +3 -3
  126. package/packages/pulldown/src/pulldown.js +6 -3
  127. package/packages/select/src/select.js +7 -3
  128. package/packages/table/src/body.js +3 -2
  129. package/packages/table/src/cell.js +9 -5
  130. package/packages/table/src/columnInfo.js +7 -7
  131. package/packages/table/src/methods.js +142 -93
  132. package/packages/table/src/table.js +17 -7
  133. package/packages/table/src/util.js +3 -1
  134. package/packages/textarea/src/textarea.js +4 -1
  135. package/packages/toolbar/src/toolbar.js +22 -7
  136. package/packages/tooltip/src/tooltip.js +3 -2
  137. package/packages/v-x-e-table/index.js +2 -0
  138. package/packages/v-x-e-table/src/commands.js +50 -2
  139. package/packages/v-x-e-table/src/conf.js +7 -4
  140. package/packages/v-x-e-table/src/formats.js +50 -2
  141. package/packages/v-x-e-table/src/menus.js +50 -2
  142. package/packages/v-x-e-table/src/renderer.js +11 -1
  143. package/packages/v-x-e-table/src/store.js +4 -2
  144. package/packages/v-x-e-table/src/validators.js +7 -0
  145. package/packages/validator/src/mixin.js +35 -4
  146. package/styles/all.scss +30 -0
  147. package/styles/css-variable.scss +272 -0
  148. package/styles/cssvar.scss +2 -275
  149. package/styles/index.scss +2 -0
  150. package/styles/modules.scss +4 -1
  151. package/styles/table.scss +11 -4
  152. package/styles/tooltip.scss +0 -8
  153. package/styles/variable.scss +1 -4
  154. package/types/all.d.ts +2 -2
  155. package/types/colgroup.d.ts +3 -1
  156. package/types/column.d.ts +3 -0
  157. package/types/edit.d.ts +4 -2
  158. package/types/export.d.ts +3 -0
  159. package/types/filter.d.ts +3 -1
  160. package/types/footer.d.ts +3 -1
  161. package/types/form-item.d.ts +2 -0
  162. package/types/form.d.ts +16 -12
  163. package/types/grid.d.ts +3 -0
  164. package/types/header.d.ts +3 -1
  165. package/types/index.d.ts +1 -1
  166. package/types/input.d.ts +2 -0
  167. package/types/list.d.ts +1 -1
  168. package/types/menu.d.ts +2 -0
  169. package/types/modal.d.ts +7 -3
  170. package/types/pulldown.d.ts +2 -3
  171. package/types/table.d.ts +54 -30
  172. package/types/textarea.d.ts +1 -0
  173. package/types/toolbar.d.ts +2 -0
  174. package/types/tooltip.d.ts +1 -1
  175. package/types/v-x-e-table/commands.d.ts +23 -13
  176. package/types/v-x-e-table/formats.d.ts +21 -12
  177. package/types/v-x-e-table/index.d.ts +33 -26
  178. package/types/v-x-e-table/interceptor.d.ts +1 -1
  179. package/types/v-x-e-table/menus.d.ts +17 -6
  180. package/types/v-x-e-table/renderer.d.ts +5 -3
  181. package/types/v-x-e-table/setup.d.ts +10 -33
  182. package/types/v-x-e-table/validators.d.ts +30 -0
  183. package/types/validator.d.ts +15 -4
  184. /package/lib/icon/style/{iconfont.1688948811910.ttf → iconfont.1691021948915.ttf} +0 -0
  185. /package/lib/icon/style/{iconfont.1688948811910.woff → iconfont.1691021948915.woff} +0 -0
  186. /package/lib/icon/style/{iconfont.1688948811910.woff2 → iconfont.1691021948915.woff2} +0 -0
  187. /package/lib/{iconfont.1688948811910.ttf → iconfont.1691021948915.ttf} +0 -0
  188. /package/lib/{iconfont.1688948811910.woff → iconfont.1691021948915.woff} +0 -0
  189. /package/lib/{iconfont.1688948811910.woff2 → iconfont.1691021948915.woff2} +0 -0
package/types/column.d.ts CHANGED
@@ -8,6 +8,8 @@ import { ColumnEditRenderOptions, ColumnEditSlotParams } from './edit'
8
8
  import { ColumnExportCellRenderParams, ColumnExportFooterRenderParams, ColumnExportHeaderRenderParams } from './export'
9
9
  import { TableOverflow } from './table'
10
10
 
11
+ /* eslint-disable no-use-before-define */
12
+
11
13
  /**
12
14
  * 列
13
15
  */
@@ -356,6 +358,7 @@ export class ColumnInfo {
356
358
  update: boolean;
357
359
  value: any;
358
360
  };
361
+
359
362
  children: ColumnInfo[];
360
363
 
361
364
  getTitle(): string;
package/types/edit.d.ts CHANGED
@@ -1,17 +1,19 @@
1
1
  import { VXETableComponent } from './component'
2
2
  import { ColumnCellRenderParams, RenderOptions, OptionProps, OptionGroupProps } from './v-x-e-table'
3
3
 
4
+ /* eslint-disable no-use-before-define */
5
+
4
6
  /**
5
7
  * 编辑
6
8
  */
7
9
  export declare class Edit extends VXETableComponent {}
8
10
 
9
- export interface ColumnEditSlotParams extends ColumnEditRenderParams {}
11
+ export type ColumnEditSlotParams = ColumnEditRenderParams
10
12
 
11
13
  /**
12
14
  * 单元格编辑渲染参数
13
15
  */
14
- export interface ColumnEditRenderParams extends ColumnCellRenderParams {}
16
+ export type ColumnEditRenderParams = ColumnCellRenderParams
15
17
 
16
18
  /**
17
19
  * 编辑渲染配置项
package/types/export.d.ts CHANGED
@@ -4,6 +4,8 @@ import { Grid } from './grid'
4
4
  import { ColumnInfo } from './column'
5
5
  import { GridRenderParams } from './v-x-e-table'
6
6
 
7
+ /* eslint-disable no-use-before-define */
8
+
7
9
  /**
8
10
  * 导出
9
11
  */
@@ -231,6 +233,7 @@ export interface ColumnExportCellRenderParams extends GridRenderParams {
231
233
 
232
234
  export interface ColumnExportHeaderRenderParams extends GridRenderParams {
233
235
  column: ColumnInfo;
236
+ options: ExportParams;
234
237
  }
235
238
 
236
239
  export interface ColumnExportFooterRenderParams extends GridRenderParams {
package/types/filter.d.ts CHANGED
@@ -2,6 +2,8 @@ import { VXETableComponent } from './component'
2
2
  import { ColumnInfo } from './column'
3
3
  import { TableRenderParams, RenderOptions, OptionProps, OptionGroupProps } from './v-x-e-table'
4
4
 
5
+ /* eslint-disable no-use-before-define */
6
+
5
7
  /**
6
8
  * 筛选
7
9
  */
@@ -92,7 +94,7 @@ export interface ColumnFilterMethodParams {
92
94
  column: ColumnInfo;
93
95
  }
94
96
 
95
- export interface ColumnFilterSlotParams extends ColumnFilterRenderParams {}
97
+ export type ColumnFilterSlotParams = ColumnFilterRenderParams
96
98
 
97
99
  export interface ColumnFilterResetParams extends TableRenderParams {
98
100
  options: ColumnFilterParams[];
package/types/footer.d.ts CHANGED
@@ -2,12 +2,14 @@ import { VXETableComponent } from './component'
2
2
  import { ColumnInfo } from './column'
3
3
  import { TableRenderParams } from './v-x-e-table'
4
4
 
5
+ /* eslint-disable no-use-before-define */
6
+
5
7
  /**
6
8
  * 表尾
7
9
  */
8
10
  export declare class Footer extends VXETableComponent {}
9
11
 
10
- export interface ColumnFooterSlotParams extends ColumnFooterRenderParams {}
12
+ export type ColumnFooterSlotParams = ColumnFooterRenderParams
11
13
 
12
14
  /**
13
15
  * 表尾渲染参数
@@ -2,6 +2,8 @@ import { VXETableComponent } from './component'
2
2
  import { Form } from './form'
3
3
  import { RenderParams, RenderOptions, OptionProps, OptionGroupProps } from './v-x-e-table'
4
4
 
5
+ /* eslint-disable no-use-before-define */
6
+
5
7
  /**
6
8
  * 表单 - 项
7
9
  */
package/types/form.d.ts CHANGED
@@ -1,6 +1,8 @@
1
1
  import { VXETableComponent } from './component'
2
2
  import { FormItemOptions } from './form-item'
3
3
 
4
+ /* eslint-disable no-use-before-define */
5
+
4
6
  /**
5
7
  * 表单
6
8
  */
@@ -81,18 +83,7 @@ export interface FormRule {
81
83
  * 使用自定义校验函数,接收一个 Promise
82
84
  * @param params 参数
83
85
  */
84
- validator?(params: {
85
- $form: Form,
86
- itemValue: any,
87
- rule: FormRule;
88
- rules: FormRule[];
89
- data: any;
90
- field: string
91
- /**
92
- * @deprecated
93
- */
94
- property: string
95
- }): void | Error | Promise<any>
86
+ validator?(params: FormRuleValidatorParams): void | Error | Promise<any>
96
87
  /**
97
88
  * 提示消息
98
89
  */
@@ -101,6 +92,19 @@ export interface FormRule {
101
92
  maxWidth?: number;
102
93
  }
103
94
 
95
+ export interface FormRuleValidatorParams {
96
+ $form: Form,
97
+ itemValue: any,
98
+ rule: FormRule;
99
+ rules: FormRule[];
100
+ data: any;
101
+ field: string
102
+ /**
103
+ * @deprecated
104
+ */
105
+ property: string
106
+ }
107
+
104
108
  /**
105
109
  * 校验规则配置项
106
110
  */
package/types/grid.d.ts CHANGED
@@ -7,6 +7,8 @@ import { ToolbarOptions } from './toolbar'
7
7
  import { PagerOptions } from './pager'
8
8
  import { RowInfo } from './component'
9
9
 
10
+ /* eslint-disable no-use-before-define */
11
+
10
12
  /**
11
13
  * 高级表格
12
14
  */
@@ -74,6 +76,7 @@ export declare class Grid extends Table {
74
76
  pager: any;
75
77
  pendingRecords: any[];
76
78
  };
79
+
77
80
  [key: string]: any;
78
81
  }
79
82
 
package/types/header.d.ts CHANGED
@@ -2,12 +2,14 @@ import { VXETableComponent } from './component'
2
2
  import { ColumnInfo } from './column'
3
3
  import { TableRenderParams } from './v-x-e-table'
4
4
 
5
+ /* eslint-disable no-use-before-define */
6
+
5
7
  /**
6
8
  * 表头
7
9
  */
8
10
  export declare class Header extends VXETableComponent {}
9
11
 
10
- export interface ColumnHeaderSlotParams extends ColumnHeaderRenderParams {}
12
+ export type ColumnHeaderSlotParams = ColumnHeaderRenderParams
11
13
 
12
14
  /**
13
15
  * 表头渲染参数
package/types/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import * as VXETableExport from './all'
2
2
 
3
3
  /**
4
- * 一个基于 vue 的 PC 端表格组件,支持增删改查、虚拟列表、虚拟树、懒加载、快捷菜单、数据校验、树形结构、打印导出、表单渲染、数据分页、弹窗、自定义模板、渲染器、贼灵活的配置项、扩展接口等...
4
+ * 一个基于 vue 的 PC 端表格组件,支持增删改查、虚拟列表、虚拟树、懒加载、快捷菜单、数据校验、树形结构、打印导出、表单渲染、数据分页、弹窗、自定义模板、渲染器、贼灵活的配置项、扩展接口等...
5
5
  */
6
6
  declare const VXETable: typeof VXETableExport
7
7
 
package/types/input.d.ts CHANGED
@@ -1,5 +1,7 @@
1
1
  import { VXETableComponent } from './component'
2
2
 
3
+ /* eslint-disable no-use-before-define */
4
+
3
5
  /**
4
6
  * 输入框
5
7
  */
package/types/list.d.ts CHANGED
@@ -62,7 +62,7 @@ export declare class List extends VXETableComponent {
62
62
  * 刷新滚动操作,手动同步滚动相关位置
63
63
  */
64
64
  refreshScroll(): Promise<any>;
65
-
65
+
66
66
  /**
67
67
  * 手动清除滚动相关信息,还原到初始状态
68
68
  */
package/types/menu.d.ts CHANGED
@@ -1,6 +1,8 @@
1
1
  import { VXETableComponent } from './component'
2
2
  import { ColumnCellRenderParams } from './v-x-e-table'
3
3
 
4
+ /* eslint-disable no-use-before-define */
5
+
4
6
  /**
5
7
  * 快捷菜单
6
8
  */
package/types/modal.d.ts CHANGED
@@ -1,6 +1,8 @@
1
1
  import { CreateElement, VNode } from 'vue'
2
2
  import { VXETableComponent } from './component'
3
3
 
4
+ /* eslint-disable no-use-before-define */
5
+
4
6
  /**
5
7
  * 弹窗
6
8
  */
@@ -40,6 +42,7 @@ export declare class Modal extends VXETableComponent {
40
42
  top?: number;
41
43
  left?: number;
42
44
  };
45
+
43
46
  /**
44
47
  * 窗口的标题
45
48
  */
@@ -157,6 +160,7 @@ export declare class Modal extends VXETableComponent {
157
160
  top?: number;
158
161
  left?: number;
159
162
  } | null;
163
+
160
164
  /**
161
165
  * 设置窗口位置
162
166
  */
@@ -257,9 +261,9 @@ export interface ModalDefaultSlotParams {
257
261
  $modal: Modal;
258
262
  }
259
263
 
260
- export interface ModalHeaderSlotParams extends ModalDefaultSlotParams {}
261
- export interface ModalTitleSlotParams extends ModalDefaultSlotParams {}
262
- export interface ModalFooterSlotParams extends ModalDefaultSlotParams {}
264
+ export type ModalHeaderSlotParams = ModalDefaultSlotParams
265
+ export type ModalTitleSlotParams = ModalDefaultSlotParams
266
+ export type ModalFooterSlotParams = ModalDefaultSlotParams
263
267
 
264
268
  export interface ModalEventParams {
265
269
  $modal: Modal;
@@ -30,15 +30,14 @@ export declare class Pulldown extends VXETableComponent {
30
30
  * 切换下拉面板
31
31
  */
32
32
  togglePanel(): Promise<any>;
33
-
33
+
34
34
  /**
35
35
  * 显示下拉面板
36
36
  */
37
37
  showPanel(): Promise<any>;
38
-
38
+
39
39
  /**
40
40
  * 隐藏下拉面板
41
41
  */
42
42
  hidePanel(): Promise<any>;
43
-
44
43
  }
package/types/table.d.ts CHANGED
@@ -7,6 +7,8 @@ import { ColumnEditRule, ColumnEditValidErrMapParams } from './validator'
7
7
  import { ColumnFooterRenderParams } from './footer'
8
8
  import { MenuOptions, MenuFirstOption } from './menu'
9
9
 
10
+ /* eslint-disable no-use-before-define */
11
+
10
12
  /**
11
13
  * 表格
12
14
  */
@@ -23,6 +25,10 @@ export declare class Table extends VXETableComponent {
23
25
  * 表格的高度
24
26
  */
25
27
  height?: number | string;
28
+ /**
29
+ * 表格的最小高度
30
+ */
31
+ minHeight?: number | string;
26
32
  /**
27
33
  * 表格的最大高度
28
34
  */
@@ -95,51 +101,51 @@ export declare class Table extends VXETableComponent {
95
101
  /**
96
102
  * 给行附加 className
97
103
  */
98
- rowClassName?: string | Function;
104
+ rowClassName?: string | ((params: any) => any);
99
105
  /**
100
106
  * 给单元格附加 className
101
107
  */
102
- cellClassName?: string | Function;
108
+ cellClassName?: string | ((params: any) => any);
103
109
  /**
104
110
  * 给表头的行附加 className
105
111
  */
106
- headerRowClassName?: string | Function;
112
+ headerRowClassName?: string | ((params: any) => any);
107
113
  /**
108
114
  * 给表头的单元格附加 className
109
115
  */
110
- headerCellClassName?: string | Function;
116
+ headerCellClassName?: string | ((params: any) => any);
111
117
  /**
112
118
  * 给表尾的行附加 className
113
119
  */
114
- footerRowClassName?: string | Function;
120
+ footerRowClassName?: string | ((params: any) => any);
115
121
  /**
116
122
  * 给表尾的单元格附加 className
117
123
  */
118
- footerCellClassName?: string | Function;
124
+ footerCellClassName?: string | ((params: any) => any);
119
125
  /**
120
126
  * 给单元格附加样式
121
127
  */
122
- cellStyle?: { [key: string]: any } | Array<string | number | boolean | { [key: string]: any }> | Function;
128
+ cellStyle?: { [key: string]: any } | Array<string | number | boolean | { [key: string]: any }> | ((params: any) => any);
123
129
  /**
124
130
  * 给表头单元格附加样式
125
131
  */
126
- headerCellStyle?: { [key: string]: any } | Array<string | number | boolean | { [key: string]: any }> | Function;
132
+ headerCellStyle?: { [key: string]: any } | Array<string | number | boolean | { [key: string]: any }> | ((params: any) => any);
127
133
  /**
128
134
  * 给表尾单元格附加样式
129
135
  */
130
- footerCellStyle?: { [key: string]: any } | Array<string | number | boolean | { [key: string]: any }> | Function;
136
+ footerCellStyle?: { [key: string]: any } | Array<string | number | boolean | { [key: string]: any }> | ((params: any) => any);
131
137
  /**
132
138
  * 给行附加样式
133
139
  */
134
- rowStyle?: { [key: string]: any } | Array<string | number | boolean | { [key: string]: any }> | Function;
140
+ rowStyle?: { [key: string]: any } | Array<string | number | boolean | { [key: string]: any }> | ((params: any) => any);
135
141
  /**
136
142
  * 给表头行附加样式
137
143
  */
138
- headerRowStyle?: { [key: string]: any } | Array<string | number | boolean | { [key: string]: any }> | Function;
144
+ headerRowStyle?: { [key: string]: any } | Array<string | number | boolean | { [key: string]: any }> | ((params: any) => any);
139
145
  /**
140
146
  * 给表尾行附加样式
141
147
  */
142
- footerRowStyle?: { [key: string]: any } | Array<string | number | boolean | { [key: string]: any }> | Function;
148
+ footerRowStyle?: { [key: string]: any } | Array<string | number | boolean | { [key: string]: any }> | ((params: any) => any);
143
149
  /**
144
150
  * 临时合并单元格
145
151
  */
@@ -496,6 +502,7 @@ export declare class Table extends VXETableComponent {
496
502
  fixed?: boolean
497
503
  order?: boolean
498
504
  }): Promise<any>;
505
+
499
506
  /**
500
507
  * 刷新列配置
501
508
  * 对于动态修改属性、显示/隐藏列等场景下可能会用到
@@ -1161,18 +1168,18 @@ export interface TableOptions {
1161
1168
  highlightCell?: boolean;
1162
1169
  showFooter?: boolean;
1163
1170
  footerMethod?: typeof TableFooterMethod;
1164
- rowClassName?: string | Function;
1165
- cellClassName?: string | Function;
1166
- headerRowClassName?: string | Function;
1167
- headerCellClassName?: string | Function;
1168
- footerRowClassName?: string | Function;
1169
- footerCellClassName?: string | Function;
1170
- cellStyle?: { [key: string]: any } | Array<string | number | boolean | { [key: string]: any }> | Function;
1171
- headerCellStyle?: { [key: string]: any } | Array<string | number | boolean | { [key: string]: any }> | Function;
1172
- footerCellStyle?: { [key: string]: any } | Array<string | number | boolean | { [key: string]: any }> | Function;
1173
- rowStyle?: { [key: string]: any } | Array<string | number | boolean | { [key: string]: any }> | Function;
1174
- headerRowStyle?: { [key: string]: any } | Array<string | number | boolean | { [key: string]: any }> | Function;
1175
- footerRowStyle?: { [key: string]: any } | Array<string | number | boolean | { [key: string]: any }> | Function;
1171
+ rowClassName?: string | ((params: any) => any);
1172
+ cellClassName?: string | ((params: any) => any);
1173
+ headerRowClassName?: string | ((params: any) => any);
1174
+ headerCellClassName?: string | ((params: any) => any);
1175
+ footerRowClassName?: string | ((params: any) => any);
1176
+ footerCellClassName?: string | ((params: any) => any);
1177
+ cellStyle?: { [key: string]: any } | Array<string | number | boolean | { [key: string]: any }> | ((params: any) => any);
1178
+ headerCellStyle?: { [key: string]: any } | Array<string | number | boolean | { [key: string]: any }> | ((params: any) => any);
1179
+ footerCellStyle?: { [key: string]: any } | Array<string | number | boolean | { [key: string]: any }> | ((params: any) => any);
1180
+ rowStyle?: { [key: string]: any } | Array<string | number | boolean | { [key: string]: any }> | ((params: any) => any);
1181
+ headerRowStyle?: { [key: string]: any } | Array<string | number | boolean | { [key: string]: any }> | ((params: any) => any);
1182
+ footerRowStyle?: { [key: string]: any } | Array<string | number | boolean | { [key: string]: any }> | ((params: any) => any);
1176
1183
  mergeCells?: TableMergeConfig[];
1177
1184
  mergeFooterItems?: TableMergeConfig[];
1178
1185
  spanMethod?: typeof TableSpanMethod;
@@ -1250,6 +1257,7 @@ export interface TableColumnConfig {
1250
1257
  width?: number
1251
1258
  minWidth?: number
1252
1259
  maxWidth?: number
1260
+ headerExportMethod?(params: any): string | number
1253
1261
  }
1254
1262
  export type ColumnDefaultConfig = TableColumnConfig
1255
1263
 
@@ -1276,13 +1284,13 @@ export interface TableSeqConfig {
1276
1284
  }
1277
1285
  export type SeqConfig = TableSeqConfig
1278
1286
 
1287
+ export type TableSortOrder = 'asc' | 'desc' | '' | null;
1288
+
1279
1289
  export interface TableSortConfs {
1280
1290
  field: string;
1281
1291
  order?: TableSortOrder;
1282
1292
  }
1283
1293
 
1284
- export type TableSortOrder = 'asc' | 'desc' | '' | null;
1285
-
1286
1294
  /**
1287
1295
  * 排序配置项
1288
1296
  */
@@ -1382,26 +1390,41 @@ export type ExpandConfig = TableExpandConfig
1382
1390
  * 树形结构配置项
1383
1391
  */
1384
1392
  export interface TableTreeConfig {
1385
- children?: string;
1393
+ childrenField?: string;
1386
1394
  indent?: number;
1387
- line?: boolean;
1395
+ showLine?: boolean;
1388
1396
  expandAll?: boolean;
1389
1397
  expandRowKeys?: string[] | number[];
1390
1398
  accordion?: boolean;
1391
1399
  trigger?: 'default' | 'cell' | 'row' | '';
1392
1400
  lazy?: boolean;
1393
- hasChild?: string;
1401
+ hasChildField?: string;
1394
1402
  loadMethod?(params: { row: RowInfo }): Promise<any[]>;
1395
1403
  toggleMethod?(params: { expanded: boolean, row: RowInfo, column: ColumnInfo, columnIndex: number, $columnIndex: number }): boolean;
1396
1404
  showIcon?: boolean;
1397
1405
  iconOpen?: string;
1398
1406
  iconClose?: string;
1399
1407
  iconLoaded?: string;
1408
+ /**
1409
+ * 已废弃,请使用 showLine
1410
+ * @deprecated
1411
+ */
1412
+ line?: boolean;
1413
+ /**
1414
+ * 已废弃,请使用 hasChildField
1415
+ * @deprecated
1416
+ */
1417
+ hasChild: string;
1418
+ /**
1419
+ * 已废弃,请使用 childrenField
1420
+ * @deprecated
1421
+ */
1422
+ children?: string
1400
1423
  }
1401
1424
  export type TreeConfig = TableTreeConfig
1402
1425
 
1403
1426
  export interface TreeOpts {
1404
- children: string;
1427
+ childrenField: string;
1405
1428
  indent: number;
1406
1429
  line?: boolean;
1407
1430
  expandAll?: boolean;
@@ -1410,6 +1433,7 @@ export interface TreeOpts {
1410
1433
  trigger?: 'default' | 'cell' | 'row' | '';
1411
1434
  lazy?: boolean;
1412
1435
  hasChild: string;
1436
+ hasChildField: string;
1413
1437
  loadMethod?(params: { row: RowInfo }): Promise<any[]>;
1414
1438
  toggleMethod?(params: { expanded: boolean, row: RowInfo, column: ColumnInfo, columnIndex: number, $columnIndex: number }): boolean;
1415
1439
  showIcon: boolean;
@@ -43,6 +43,7 @@ export declare class Textarea extends VXETableComponent {
43
43
  minRows?: number;
44
44
  maxRows?: number;
45
45
  };
46
+
46
47
  /**
47
48
  * 原生 form 属性
48
49
  */
@@ -3,6 +3,8 @@ import { VXETableComponent } from './component'
3
3
  import { ColumnInfo } from './column'
4
4
  import { GridRenderParams, RenderOptions } from './v-x-e-table'
5
5
 
6
+ /* eslint-disable no-use-before-define */
7
+
6
8
  /**
7
9
  * 工具栏
8
10
  */
@@ -19,7 +19,7 @@ export declare class Tooltip extends VXETableComponent {
19
19
  /**
20
20
  * 显示内容
21
21
  */
22
- content?: string | Function;
22
+ content?: string | ((params: any) => any);
23
23
  /**
24
24
  * 自定义堆叠顺序
25
25
  */
@@ -1,19 +1,29 @@
1
1
  import { ToolbarButtonConfig } from '../toolbar'
2
- import { GridRenderParams } from './renderer'
2
+ import { Table } from '../table'
3
3
 
4
- declare function commandsFunc(params: CommandsParams, ...args: any[]): any;
4
+ /* eslint-disable no-use-before-define */
5
5
 
6
- /**
7
- * 全局指令
8
- */
9
- export class VxeGlobalCommands {
10
- mixin(map: { [type: string]: typeof commandsFunc }): VxeGlobalCommands;
11
- get(type: string): typeof commandsFunc;
12
- add(type: string, callback: typeof commandsFunc): VxeGlobalCommands;
13
- delete(type: string): VxeGlobalCommands;
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
+ }
14
15
  }
15
16
 
16
- export interface CommandsParams extends GridRenderParams {
17
- code: string;
18
- button?: ToolbarButtonConfig;
17
+ /**
18
+ * 全局格式化
19
+ */
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
19
29
  }
@@ -1,19 +1,28 @@
1
1
  import { ColumnInfo } from '../column'
2
2
 
3
- declare function formatsFunc(params: FormatsParams, ...args: any[]): any;
3
+ /* eslint-disable no-use-before-define */
4
+
5
+ export namespace VxeGlobalFormatsHandles {
6
+ export interface FormatsOptions {
7
+ cellFormatMethod?: (params: FormatMethodParams, ...args: any[]) => string | number
8
+ }
9
+ export interface FormatMethodParams {
10
+ cellValue: any
11
+ row: any
12
+ column: ColumnInfo
13
+ }
14
+ }
4
15
 
5
16
  /**
6
17
  * 全局格式化
7
18
  */
8
- export class VxeGlobalFormats {
9
- mixin(map: { [type: string]: typeof formatsFunc }): VxeGlobalFormats;
10
- get(type: string): typeof formatsFunc;
11
- add(type: string, callback: typeof formatsFunc): VxeGlobalFormats;
12
- delete(type: string): VxeGlobalFormats;
13
- }
14
-
15
- export interface FormatsParams {
16
- cellValue: any;
17
- row: any,
18
- 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
19
28
  }