vxe-table 3.7.0-beta.5 → 3.7.0-beta.7

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 (137) hide show
  1. package/README.md +4 -8
  2. package/lib/edit/src/mixin.js +3 -3
  3. package/lib/edit/src/mixin.min.js +1 -1
  4. package/lib/filter/src/mixin.js +13 -7
  5. package/lib/filter/src/mixin.min.js +1 -1
  6. package/lib/form/src/form.js +27 -5
  7. package/lib/form/src/form.min.js +1 -1
  8. package/lib/grid/src/grid.js +7 -3
  9. package/lib/grid/src/grid.min.js +1 -1
  10. package/lib/icon/style/style.css +1 -1
  11. package/lib/icon/style/style.min.css +1 -1
  12. package/lib/index.css +1 -1
  13. package/lib/index.umd.js +394 -127
  14. package/lib/index.umd.min.js +1 -1
  15. package/lib/input/src/input.js +11 -1
  16. package/lib/input/src/input.min.js +1 -1
  17. package/lib/locale/lang/en-US.js +7 -0
  18. package/lib/locale/lang/en-US.min.js +1 -1
  19. package/lib/locale/lang/en-US.umd.js +7 -0
  20. package/lib/locale/lang/es-ES.js +7 -0
  21. package/lib/locale/lang/es-ES.min.js +1 -1
  22. package/lib/locale/lang/es-ES.umd.js +7 -0
  23. package/lib/locale/lang/ja-JP.js +7 -0
  24. package/lib/locale/lang/ja-JP.min.js +1 -1
  25. package/lib/locale/lang/ja-JP.umd.js +7 -0
  26. package/lib/locale/lang/zh-CN.js +7 -0
  27. package/lib/locale/lang/zh-CN.min.js +1 -1
  28. package/lib/locale/lang/zh-CN.umd.js +7 -0
  29. package/lib/locale/lang/zh-HK.min.js +1 -1
  30. package/lib/locale/lang/zh-HK.umd.js +7 -0
  31. package/lib/locale/lang/zh-MO.min.js +1 -1
  32. package/lib/locale/lang/zh-MO.umd.js +7 -0
  33. package/lib/locale/lang/zh-TC.js +7 -0
  34. package/lib/locale/lang/zh-TC.min.js +1 -1
  35. package/lib/locale/lang/zh-TC.umd.js +7 -0
  36. package/lib/locale/lang/zh-TW.min.js +1 -1
  37. package/lib/locale/lang/zh-TW.umd.js +7 -0
  38. package/lib/menu/src/mixin.js +3 -3
  39. package/lib/menu/src/mixin.min.js +1 -1
  40. package/lib/select/src/select.js +6 -1
  41. package/lib/select/src/select.min.js +1 -1
  42. package/lib/style.css +1 -1
  43. package/lib/style.min.css +1 -1
  44. package/lib/table/src/cell.js +4 -2
  45. package/lib/table/src/cell.min.js +1 -1
  46. package/lib/table/src/columnInfo.js +6 -6
  47. package/lib/table/src/columnInfo.min.js +1 -1
  48. package/lib/table/src/methods.js +74 -47
  49. package/lib/table/src/methods.min.js +1 -1
  50. package/lib/table/src/table.js +12 -25
  51. package/lib/table/src/table.min.js +1 -1
  52. package/lib/table/style/style.css +2 -2
  53. package/lib/table/style/style.min.css +1 -1
  54. package/lib/textarea/src/textarea.js +6 -1
  55. package/lib/textarea/src/textarea.min.js +1 -1
  56. package/lib/toolbar/src/toolbar.js +18 -6
  57. package/lib/toolbar/src/toolbar.min.js +1 -1
  58. package/lib/tools/log.js +1 -1
  59. package/lib/tools/log.min.js +1 -1
  60. package/lib/v-x-e-table/index.js +3 -1
  61. package/lib/v-x-e-table/index.min.js +1 -1
  62. package/lib/v-x-e-table/src/commands.js +58 -2
  63. package/lib/v-x-e-table/src/commands.min.js +1 -1
  64. package/lib/v-x-e-table/src/conf.js +4 -1
  65. package/lib/v-x-e-table/src/conf.min.js +1 -1
  66. package/lib/v-x-e-table/src/formats.js +58 -2
  67. package/lib/v-x-e-table/src/formats.min.js +1 -1
  68. package/lib/v-x-e-table/src/menus.js +58 -2
  69. package/lib/v-x-e-table/src/menus.min.js +1 -1
  70. package/lib/v-x-e-table/src/store.js +5 -2
  71. package/lib/v-x-e-table/src/store.min.js +1 -1
  72. package/lib/v-x-e-table/src/validators.js +15 -0
  73. package/lib/v-x-e-table/src/validators.min.js +1 -0
  74. package/lib/validator/src/mixin.js +26 -4
  75. package/lib/validator/src/mixin.min.js +1 -1
  76. package/package.json +2 -2
  77. package/packages/edit/src/mixin.js +3 -3
  78. package/packages/filter/src/mixin.js +5 -1
  79. package/packages/form/src/form.js +27 -6
  80. package/packages/grid/src/grid.js +7 -3
  81. package/packages/input/src/input.js +9 -1
  82. package/packages/locale/lang/en-US.js +7 -0
  83. package/packages/locale/lang/es-ES.js +7 -0
  84. package/packages/locale/lang/ja-JP.js +7 -0
  85. package/packages/locale/lang/zh-CN.js +7 -0
  86. package/packages/locale/lang/zh-TC.js +7 -0
  87. package/packages/menu/src/mixin.js +3 -3
  88. package/packages/select/src/select.js +4 -1
  89. package/packages/table/src/cell.js +4 -2
  90. package/packages/table/src/columnInfo.js +6 -6
  91. package/packages/table/src/methods.js +67 -46
  92. package/packages/table/src/table.js +6 -2
  93. package/packages/textarea/src/textarea.js +4 -1
  94. package/packages/toolbar/src/toolbar.js +18 -6
  95. package/packages/v-x-e-table/index.js +2 -0
  96. package/packages/v-x-e-table/src/commands.js +48 -2
  97. package/packages/v-x-e-table/src/conf.js +4 -1
  98. package/packages/v-x-e-table/src/formats.js +48 -2
  99. package/packages/v-x-e-table/src/menus.js +48 -2
  100. package/packages/v-x-e-table/src/store.js +4 -2
  101. package/packages/v-x-e-table/src/validators.js +7 -0
  102. package/packages/validator/src/mixin.js +25 -4
  103. package/styles/table.scss +2 -2
  104. package/types/colgroup.d.ts +3 -1
  105. package/types/column.d.ts +3 -0
  106. package/types/edit.d.ts +4 -2
  107. package/types/export.d.ts +2 -0
  108. package/types/filter.d.ts +3 -1
  109. package/types/footer.d.ts +3 -1
  110. package/types/form-item.d.ts +2 -0
  111. package/types/form.d.ts +16 -12
  112. package/types/grid.d.ts +3 -0
  113. package/types/header.d.ts +3 -1
  114. package/types/index.d.ts +1 -1
  115. package/types/input.d.ts +2 -0
  116. package/types/list.d.ts +1 -1
  117. package/types/menu.d.ts +2 -0
  118. package/types/modal.d.ts +7 -3
  119. package/types/pulldown.d.ts +2 -3
  120. package/types/table.d.ts +33 -26
  121. package/types/textarea.d.ts +1 -0
  122. package/types/toolbar.d.ts +2 -0
  123. package/types/tooltip.d.ts +1 -1
  124. package/types/v-x-e-table/commands.d.ts +23 -13
  125. package/types/v-x-e-table/formats.d.ts +21 -12
  126. package/types/v-x-e-table/index.d.ts +31 -24
  127. package/types/v-x-e-table/interceptor.d.ts +1 -1
  128. package/types/v-x-e-table/menus.d.ts +17 -6
  129. package/types/v-x-e-table/renderer.d.ts +5 -3
  130. package/types/v-x-e-table/validators.d.ts +30 -0
  131. package/types/validator.d.ts +15 -4
  132. /package/lib/icon/style/{iconfont.1689384538396.ttf → iconfont.1690156580206.ttf} +0 -0
  133. /package/lib/icon/style/{iconfont.1689384538396.woff → iconfont.1690156580206.woff} +0 -0
  134. /package/lib/icon/style/{iconfont.1689384538396.woff2 → iconfont.1690156580206.woff2} +0 -0
  135. /package/lib/{iconfont.1689384538396.ttf → iconfont.1690156580206.ttf} +0 -0
  136. /package/lib/{iconfont.1689384538396.woff → iconfont.1690156580206.woff} +0 -0
  137. /package/lib/{iconfont.1689384538396.woff2 → iconfont.1690156580206.woff2} +0 -0
@@ -1,6 +1,52 @@
1
- import VXEStore from './store'
1
+ import XEUtils from 'xe-utils'
2
+ import { warnLog } from '../../tools/log'
2
3
 
3
- export const formats = new VXEStore()
4
+ class VXEFormatsStore {
5
+ constructor () {
6
+ this.store = {}
7
+ }
8
+
9
+ mixin (options) {
10
+ XEUtils.each(options, (item, key) => {
11
+ this.add(key, item)
12
+ })
13
+ return VXEFormatsStore
14
+ }
15
+
16
+ get (name) {
17
+ return this.store[name]
18
+ }
19
+
20
+ add (name, render) {
21
+ const conf = this.store[name]
22
+ // 兼容
23
+ if (XEUtils.isFunction(render)) {
24
+ // warnLog('vxe.error.delProp', ['callback', 'formatMethod'])
25
+ render = {
26
+ formatMethod: render
27
+ }
28
+ }
29
+
30
+ // 检测是否覆盖
31
+ if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
32
+ const confKeys = XEUtils.keys(conf)
33
+ XEUtils.each(render, (item, key) => {
34
+ if (confKeys.includes(key)) {
35
+ warnLog('vxe.error.coverProp', [name, key])
36
+ }
37
+ })
38
+ }
39
+ this.store[name] = conf ? XEUtils.merge(conf, render) : render
40
+ return VXEFormatsStore
41
+ }
42
+
43
+ delete (name) {
44
+ delete this.store[name]
45
+ return VXEFormatsStore
46
+ }
47
+ }
48
+
49
+ export const formats = new VXEFormatsStore()
4
50
 
5
51
  if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
6
52
  Object.assign(formats, { _name: 'Formats' })
@@ -1,6 +1,52 @@
1
- import VXEStore from './store'
1
+ import XEUtils from 'xe-utils'
2
+ import { warnLog } from '../../tools/log'
2
3
 
3
- export const menus = new VXEStore()
4
+ class VXEMenusStore {
5
+ constructor () {
6
+ this.store = {}
7
+ }
8
+
9
+ mixin (options) {
10
+ XEUtils.each(options, (item, key) => {
11
+ this.add(key, item)
12
+ })
13
+ return VXEMenusStore
14
+ }
15
+
16
+ get (name) {
17
+ return this.store[name]
18
+ }
19
+
20
+ add (name, render) {
21
+ const conf = this.store[name]
22
+ // 兼容
23
+ if (XEUtils.isFunction(render)) {
24
+ // warnLog('vxe.error.delProp', ['callback', 'menuMethod'])
25
+ render = {
26
+ menuMethod: render
27
+ }
28
+ }
29
+
30
+ // 检测是否覆盖
31
+ if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
32
+ const confKeys = XEUtils.keys(conf)
33
+ XEUtils.each(render, (item, key) => {
34
+ if (confKeys.includes(key)) {
35
+ warnLog('vxe.error.coverProp', [name, key])
36
+ }
37
+ })
38
+ }
39
+ this.store[name] = conf ? XEUtils.merge(conf, render) : render
40
+ return VXEMenusStore
41
+ }
42
+
43
+ delete (name) {
44
+ delete this.store[name]
45
+ return VXEMenusStore
46
+ }
47
+ }
48
+
49
+ export const menus = new VXEMenusStore()
4
50
 
5
51
  if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
6
52
  Object.assign(menus, { _name: 'Menus' })
@@ -9,8 +9,10 @@ class Store {
9
9
  this.store = {}
10
10
  }
11
11
 
12
- mixin (map) {
13
- Object.assign(this.store, map)
12
+ mixin (options) {
13
+ XEUtils.each(options, (item, key) => {
14
+ this.add(key, item)
15
+ })
14
16
  return Store
15
17
  }
16
18
 
@@ -0,0 +1,7 @@
1
+ import VXEStore from './store'
2
+
3
+ export const validators = new VXEStore()
4
+
5
+ if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
6
+ Object.assign(validators, { _name: 'Validators' })
7
+ }
@@ -1,6 +1,8 @@
1
1
  import XEUtils from 'xe-utils'
2
+ import VXETable from '../../v-x-e-table'
2
3
  import GlobalConfig from '../../v-x-e-table/src/conf'
3
4
  import { eqEmptyValue, getFuncText } from '../../tools/utils'
5
+ import { warnLog, errLog } from '../../tools/log'
4
6
  import DomTools from '../../tools/dom'
5
7
 
6
8
  /**
@@ -248,10 +250,10 @@ export default {
248
250
  if (rules) {
249
251
  const cellValue = XEUtils.isUndefined(val) ? XEUtils.get(row, property) : val
250
252
  rules.forEach(rule => {
251
- const { type, trigger, required } = rule
253
+ const { type, trigger, required, validator } = rule
252
254
  if (validType === 'all' || !trigger || validType === trigger) {
253
- if (XEUtils.isFunction(rule.validator)) {
254
- const customValid = rule.validator({
255
+ if (validator) {
256
+ const validParams = {
255
257
  cellValue,
256
258
  rule,
257
259
  rules,
@@ -261,7 +263,26 @@ export default {
261
263
  columnIndex: this.getColumnIndex(column),
262
264
  field: column.property,
263
265
  $table: this
264
- })
266
+ }
267
+ let customValid
268
+ if (XEUtils.isString(validator)) {
269
+ const gvItem = VXETable.validators.get(validator)
270
+ if (gvItem) {
271
+ if (gvItem.cellValidatorMethod) {
272
+ customValid = gvItem.cellValidatorMethod(validParams)
273
+ } else {
274
+ if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
275
+ warnLog('vxe.error.notValidators', [validator])
276
+ }
277
+ }
278
+ } else {
279
+ if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
280
+ errLog('vxe.error.notValidators', [validator])
281
+ }
282
+ }
283
+ } else {
284
+ customValid = validator(validParams)
285
+ }
265
286
  if (customValid) {
266
287
  if (XEUtils.isError(customValid)) {
267
288
  this.validRuleErr = true
package/styles/table.scss CHANGED
@@ -1230,8 +1230,8 @@
1230
1230
  position: relative;
1231
1231
  &:before {
1232
1232
  content: "";
1233
- top: $vxe-table-cell-dirty-width;
1234
- left: $vxe-table-cell-dirty-width;
1233
+ top: calc($vxe-table-cell-dirty-width * -1);
1234
+ left: calc($vxe-table-cell-dirty-width * -1);
1235
1235
  position: absolute;
1236
1236
  border-width: $vxe-table-cell-dirty-width;
1237
1237
  border-style: solid;
@@ -7,12 +7,14 @@ import { ColumnEditRenderOptions } from './edit'
7
7
  import { ColumnExportCellRenderParams, ColumnExportFooterRenderParams } from './export'
8
8
  import { TableOverflow } from './table'
9
9
 
10
+ /* eslint-disable no-use-before-define */
11
+
10
12
  /**
11
13
  * 组件 - 表格分组列
12
14
  */
13
15
  export declare class Colgroup extends Column {}
14
16
 
15
- export interface ColgroupOptions extends ColgroupProps {}
17
+ export type ColgroupOptions = ColgroupProps
16
18
 
17
19
  export interface ColgroupProps {
18
20
  /**
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
  */
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;
@@ -1277,13 +1284,13 @@ export interface TableSeqConfig {
1277
1284
  }
1278
1285
  export type SeqConfig = TableSeqConfig
1279
1286
 
1287
+ export type TableSortOrder = 'asc' | 'desc' | '' | null;
1288
+
1280
1289
  export interface TableSortConfs {
1281
1290
  field: string;
1282
1291
  order?: TableSortOrder;
1283
1292
  }
1284
1293
 
1285
- export type TableSortOrder = 'asc' | 'desc' | '' | null;
1286
-
1287
1294
  /**
1288
1295
  * 排序配置项
1289
1296
  */
@@ -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
  */