vxe-table 3.12.0-beta.9 → 3.12.0

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 (75) hide show
  1. package/es/locale/lang/de-DE.js +490 -490
  2. package/es/locale/lang/en-US.js +438 -438
  3. package/es/locale/lang/it-IT.js +692 -0
  4. package/es/locale/lang/ru-RU.js +36 -36
  5. package/es/locale/lang/th-TH.js +692 -0
  6. package/es/locale/lang/zh-CHT.js +19 -19
  7. package/es/style.css +1 -1
  8. package/es/table/module/custom/panel.js +5 -5
  9. package/es/table/module/export/mixin.js +208 -140
  10. package/es/table/src/cell.js +88 -61
  11. package/es/table/src/column.js +2 -2
  12. package/es/table/src/group.js +2 -2
  13. package/es/table/src/methods.js +112 -87
  14. package/es/table/src/table.js +7 -11
  15. package/es/toolbar/src/toolbar.js +22 -4
  16. package/es/ui/index.js +2 -2
  17. package/es/ui/src/log.js +1 -1
  18. package/es/ui/src/vn.js +3 -0
  19. package/lib/index.umd.js +512 -356
  20. package/lib/index.umd.min.js +1 -1
  21. package/lib/locale/lang/de-DE.js +490 -490
  22. package/lib/locale/lang/de-DE.min.js +1 -1
  23. package/lib/locale/lang/en-US.js +438 -438
  24. package/lib/locale/lang/en-US.min.js +1 -1
  25. package/lib/locale/lang/en-US.umd.js +438 -438
  26. package/lib/locale/lang/it-IT.js +698 -0
  27. package/lib/locale/lang/it-IT.min.js +1 -0
  28. package/lib/locale/lang/ru-RU.js +36 -36
  29. package/lib/locale/lang/ru-RU.min.js +1 -1
  30. package/lib/locale/lang/ru-RU.umd.js +36 -36
  31. package/lib/locale/lang/th-TH.js +698 -0
  32. package/lib/locale/lang/th-TH.min.js +1 -0
  33. package/lib/locale/lang/zh-CHT.js +19 -19
  34. package/lib/locale/lang/zh-CHT.min.js +1 -1
  35. package/lib/locale/lang/zh-CHT.umd.js +19 -19
  36. package/lib/style.css +1 -1
  37. package/lib/table/module/custom/panel.js +5 -5
  38. package/lib/table/module/custom/panel.min.js +1 -1
  39. package/lib/table/module/export/mixin.js +239 -167
  40. package/lib/table/module/export/mixin.min.js +1 -1
  41. package/lib/table/src/cell.js +109 -83
  42. package/lib/table/src/cell.min.js +1 -1
  43. package/lib/table/src/methods.js +112 -87
  44. package/lib/table/src/methods.min.js +1 -1
  45. package/lib/table/src/table.js +4 -9
  46. package/lib/table/src/table.min.js +1 -1
  47. package/lib/toolbar/src/toolbar.js +36 -2
  48. package/lib/toolbar/src/toolbar.min.js +1 -1
  49. package/lib/ui/index.js +2 -2
  50. package/lib/ui/index.min.js +1 -1
  51. package/lib/ui/src/log.js +1 -1
  52. package/lib/ui/src/log.min.js +1 -1
  53. package/lib/ui/src/vn.js +3 -0
  54. package/lib/ui/src/vn.min.js +1 -1
  55. package/package.json +3 -3
  56. package/packages/locale/lang/de-DE.ts +492 -491
  57. package/packages/locale/lang/en-US.ts +438 -438
  58. package/packages/locale/lang/it-IT.ts +692 -0
  59. package/packages/locale/lang/ru-RU.ts +36 -36
  60. package/packages/locale/lang/th-TH.ts +692 -0
  61. package/packages/locale/lang/zh-CHT.ts +19 -19
  62. package/packages/table/module/custom/panel.ts +5 -5
  63. package/packages/table/module/export/mixin.ts +227 -156
  64. package/packages/table/src/cell.ts +141 -108
  65. package/packages/table/src/methods.ts +136 -105
  66. package/packages/table/src/table.ts +8 -12
  67. package/packages/toolbar/src/toolbar.ts +26 -8
  68. package/packages/ui/index.ts +1 -1
  69. package/packages/ui/src/vn.ts +4 -1
  70. /package/es/{iconfont.1735301172726.ttf → iconfont.1735661059384.ttf} +0 -0
  71. /package/es/{iconfont.1735301172726.woff → iconfont.1735661059384.woff} +0 -0
  72. /package/es/{iconfont.1735301172726.woff2 → iconfont.1735661059384.woff2} +0 -0
  73. /package/lib/{iconfont.1735301172726.ttf → iconfont.1735661059384.ttf} +0 -0
  74. /package/lib/{iconfont.1735301172726.woff → iconfont.1735661059384.woff} +0 -0
  75. /package/lib/{iconfont.1735301172726.woff2 → iconfont.1735661059384.woff2} +0 -0
@@ -6,11 +6,11 @@ import { updateCellTitle } from '../../ui/src/dom'
6
6
  import { createColumn, getRowid } from './util'
7
7
  import { getSlotVNs } from '../../ui/src/vn'
8
8
 
9
- import type { VxeTableDefines } from '../../../types'
9
+ import type { VxeTableDefines, VxeColumnPropTypes, VxeTableConstructor, VxeTablePrivateMethods, VxeComponentSlotType, TableReactData, TableInternalData } from '../../../types'
10
10
 
11
11
  const { getI18n, getIcon, renderer, formats, renderEmptyElement } = VxeUI
12
12
 
13
- function renderTitlePrefixIcon (h: CreateElement, params: any) {
13
+ function renderTitlePrefixIcon (h: CreateElement, params: VxeTableDefines.CellRenderHeaderParams & { $table: VxeTableConstructor & VxeTablePrivateMethods }) {
14
14
  const { $table, column } = params
15
15
  const titlePrefix = column.titlePrefix || column.titleHelp
16
16
  if (titlePrefix) {
@@ -29,7 +29,7 @@ function renderTitlePrefixIcon (h: CreateElement, params: any) {
29
29
  return renderEmptyElement($table)
30
30
  }
31
31
 
32
- function renderTitleSuffixIcon (h: CreateElement, params: any) {
32
+ function renderTitleSuffixIcon (h: CreateElement, params: VxeTableDefines.CellRenderHeaderParams & { $table: VxeTableConstructor & VxeTablePrivateMethods }) {
33
33
  const { $table, column } = params
34
34
  const titleSuffix = column.titleSuffix
35
35
  if (titleSuffix) {
@@ -48,7 +48,7 @@ function renderTitleSuffixIcon (h: CreateElement, params: any) {
48
48
  return renderEmptyElement($table)
49
49
  }
50
50
 
51
- function renderCellDragIcon (h: CreateElement, params: any) {
51
+ function renderCellDragIcon (h: CreateElement, params: VxeTableDefines.CellRenderBodyParams & { $table: VxeTableConstructor & VxeTablePrivateMethods }) {
52
52
  const { $table } = params
53
53
  const tableProps = $table
54
54
  const { dragConfig } = tableProps
@@ -78,19 +78,19 @@ function renderCellDragIcon (h: CreateElement, params: any) {
78
78
  ])
79
79
  }
80
80
 
81
- function renderCellBaseVNs (h: CreateElement, params: any, content: any) {
81
+ function renderCellBaseVNs (h: CreateElement, params: VxeTableDefines.CellRenderBodyParams & { $table: VxeTableConstructor & VxeTablePrivateMethods }, content: VxeComponentSlotType | VxeComponentSlotType[]) {
82
82
  const { $table, column, level } = params
83
83
  const { dragSort } = column
84
84
  const tableProps = $table
85
85
  const { treeConfig, dragConfig } = tableProps
86
86
  const rowOpts = $table.computeRowOpts
87
87
  const rowDragOpts = $table.computeRowDragOpts
88
- const { showIcon, isCrossDrag, visibleMethod } = rowDragOpts
88
+ const { showIcon, isPeerDrag, isCrossDrag, visibleMethod } = rowDragOpts
89
89
  const rVisibleMethod = visibleMethod || (dragConfig ? dragConfig.rowVisibleMethod : null)
90
90
  const vns: any[] = XEUtils.isArray(content) ? content : [content]
91
91
  if (dragSort && rowOpts.drag && ((showIcon || (dragConfig ? dragConfig.showRowIcon : false)) && (!rVisibleMethod || rVisibleMethod(params)))) {
92
92
  if (treeConfig) {
93
- if (isCrossDrag || !level) {
93
+ if (isPeerDrag || isCrossDrag || !level) {
94
94
  vns.unshift(
95
95
  renderCellDragIcon(h, params)
96
96
  )
@@ -104,13 +104,13 @@ function renderCellBaseVNs (h: CreateElement, params: any, content: any) {
104
104
  return vns
105
105
  }
106
106
 
107
- function renderHeaderCellDragIcon (h: CreateElement, params: VxeTableDefines.CellRenderHeaderParams) {
107
+ function renderHeaderCellDragIcon (h: CreateElement, params: VxeTableDefines.CellRenderHeaderParams & { $table: VxeTableConstructor & VxeTablePrivateMethods }) {
108
108
  const { $table, column } = params
109
109
  const columnOpts = $table.computeColumnOpts
110
110
  const columnDragOpts = $table.computeColumnDragOpts
111
- const { showIcon, icon, trigger, isCrossDrag, visibleMethod, disabledMethod } = columnDragOpts
111
+ const { showIcon, icon, trigger, isPeerDrag, isCrossDrag, visibleMethod, disabledMethod } = columnDragOpts
112
112
  if (columnOpts.drag && showIcon && (!visibleMethod || visibleMethod(params))) {
113
- if (!column.fixed && (isCrossDrag || !column.parentId)) {
113
+ if (!column.fixed && (isPeerDrag || isCrossDrag || !column.parentId)) {
114
114
  const isDisabled = disabledMethod && disabledMethod(params)
115
115
  const ons: Record<string, any> = {}
116
116
  if (trigger !== 'cell') {
@@ -137,7 +137,7 @@ function renderHeaderCellDragIcon (h: CreateElement, params: VxeTableDefines.Cel
137
137
  return renderEmptyElement($table)
138
138
  }
139
139
 
140
- function renderHeaderCellBaseVNs (h: CreateElement, params: VxeTableDefines.CellRenderHeaderParams, content: VNode | VNode[]) {
140
+ function renderHeaderCellBaseVNs (h: CreateElement, params: VxeTableDefines.CellRenderHeaderParams & { $table: VxeTableConstructor & VxeTablePrivateMethods }, content: VNode | VNode[]) {
141
141
  const vns = [
142
142
  renderTitlePrefixIcon(h, params),
143
143
  renderHeaderCellDragIcon(h, params),
@@ -147,18 +147,21 @@ function renderHeaderCellBaseVNs (h: CreateElement, params: VxeTableDefines.Cell
147
147
  return vns
148
148
  }
149
149
 
150
- function renderTitleContent (h: CreateElement, params: any, content: any) {
150
+ function renderTitleContent (h: CreateElement, params: VxeTableDefines.CellRenderHeaderParams & { $table: VxeTableConstructor & VxeTablePrivateMethods }, content: VxeComponentSlotType | VxeComponentSlotType[]) {
151
151
  const { $table, column } = params
152
152
  const { type, showHeaderOverflow } = column
153
- const { showHeaderOverflow: allColumnHeaderOverflow, tooltipOpts } = $table
154
- const showAllTip = tooltipOpts.showAll || tooltipOpts.enabled
153
+ const tableProps = $table
154
+ const tableReactData = $table as unknown as TableReactData
155
+ const { showHeaderOverflow: allColumnHeaderOverflow } = tableProps
156
+ const tooltipOpts = $table.computeTooltipOpts
157
+ const showAllTip = tooltipOpts.showAll
155
158
  const headOverflow = XEUtils.isUndefined(showHeaderOverflow) || XEUtils.isNull(showHeaderOverflow) ? allColumnHeaderOverflow : showHeaderOverflow
156
159
  const showTitle = headOverflow === 'title'
157
160
  const showTooltip = headOverflow === true || headOverflow === 'tooltip'
158
- const ons: any = {}
161
+ const ons: Record<string, any> = {}
159
162
  if (showTitle || showTooltip || showAllTip) {
160
- ons.mouseenter = (evnt: any) => {
161
- if ($table._isResize) {
163
+ ons.mouseenter = (evnt: MouseEvent) => {
164
+ if (tableReactData._isResize) {
162
165
  return
163
166
  }
164
167
  if (showTitle) {
@@ -170,7 +173,7 @@ function renderTitleContent (h: CreateElement, params: any, content: any) {
170
173
  }
171
174
  if (showTooltip || showAllTip) {
172
175
  ons.mouseleave = (evnt: any) => {
173
- if ($table._isResize) {
176
+ if (tableReactData._isResize) {
174
177
  return
175
178
  }
176
179
  if (showTooltip || showAllTip) {
@@ -194,20 +197,26 @@ function renderTitleContent (h: CreateElement, params: any, content: any) {
194
197
  ]
195
198
  }
196
199
 
197
- function formatFooterLabel (footerFormatter: any, params: any) {
200
+ function formatFooterLabel (footerFormatter: VxeColumnPropTypes.FooterFormatter, params: {
201
+ itemValue: any
202
+ column: VxeTableDefines.ColumnInfo
203
+ row: any
204
+ items: any[]
205
+ _columnIndex: number
206
+ }) {
198
207
  if (XEUtils.isFunction(footerFormatter)) {
199
- return footerFormatter(params)
208
+ return `${footerFormatter(params)}`
200
209
  }
201
210
  const isArr = XEUtils.isArray(footerFormatter)
202
211
  const gFormatOpts = isArr ? formats.get(footerFormatter[0]) : formats.get(footerFormatter)
203
212
  const footerFormatMethod = gFormatOpts ? gFormatOpts.tableFooterCellFormatMethod : null
204
213
  if (footerFormatMethod) {
205
- return isArr ? footerFormatMethod(params, ...footerFormatter.slice(1)) : footerFormatMethod(params)
214
+ return `${isArr ? footerFormatMethod(params, ...footerFormatter.slice(1)) : footerFormatMethod(params)}`
206
215
  }
207
216
  return ''
208
217
  }
209
218
 
210
- function getFooterContent (h: CreateElement, params: any) {
219
+ function getFooterContent (h: CreateElement, params: VxeTableDefines.CellRenderFooterParams & { $table: VxeTableConstructor & VxeTablePrivateMethods }) {
211
220
  const { $table, column, _columnIndex, row, items } = params
212
221
  const { slots, editRender, cellRender, footerFormatter } = column
213
222
  const renderOpts = editRender || cellRender
@@ -251,7 +260,7 @@ function getFooterContent (h: CreateElement, params: any) {
251
260
  ]
252
261
  }
253
262
 
254
- function getDefaultCellLabel (params: any) {
263
+ function getDefaultCellLabel (params: VxeTableDefines.CellRenderBodyParams) {
255
264
  const { $table, row, column } = params
256
265
  return formatText($table.getCellLabel(row, column), 1)
257
266
  }
@@ -309,7 +318,7 @@ export const Cell = {
309
318
  /**
310
319
  * 列头标题
311
320
  */
312
- renderHeaderTitle (h: any, params: any) {
321
+ renderHeaderTitle (h: CreateElement, params: VxeTableDefines.CellRenderHeaderParams & { $table: VxeTableConstructor & VxeTablePrivateMethods }) {
313
322
  const { $table, column } = params
314
323
  const { slots, editRender, cellRender } = column
315
324
  const renderOpts = editRender || cellRender
@@ -325,10 +334,10 @@ export const Cell = {
325
334
  }
326
335
  return renderTitleContent(h, params, formatText(column.getTitle(), 1))
327
336
  },
328
- renderDefaultHeader (h: CreateElement, params: any) {
337
+ renderDefaultHeader (h: CreateElement, params: VxeTableDefines.CellRenderHeaderParams & { $table: VxeTableConstructor & VxeTablePrivateMethods }) {
329
338
  return renderHeaderCellBaseVNs(h, params, Cell.renderHeaderTitle(h, params))
330
339
  },
331
- renderDefaultCell (h: CreateElement, params: any) {
340
+ renderDefaultCell (h: CreateElement, params: VxeTableDefines.CellRenderBodyParams & { $table: VxeTableConstructor & VxeTablePrivateMethods }) {
332
341
  const { $table, row, column } = params
333
342
  const { slots, editRender, cellRender } = column
334
343
  const renderOpts = editRender || cellRender
@@ -359,10 +368,10 @@ export const Cell = {
359
368
  ])
360
369
  ])
361
370
  },
362
- renderTreeCell (h: CreateElement, params: any) {
371
+ renderTreeCell (h: CreateElement, params: VxeTableDefines.CellRenderBodyParams & { $table: VxeTableConstructor & VxeTablePrivateMethods }) {
363
372
  return Cell.renderTreeIcon(h, params, Cell.renderDefaultCell.call(this, h, params))
364
373
  },
365
- renderDefaultFooter (h: CreateElement, params: any) {
374
+ renderDefaultFooter (h: CreateElement, params: VxeTableDefines.CellRenderFooterParams & { $table: VxeTableConstructor & VxeTablePrivateMethods }) {
366
375
  return [
367
376
  h('span', {
368
377
  class: 'vxe-cell--item'
@@ -373,9 +382,13 @@ export const Cell = {
373
382
  /**
374
383
  * 树节点
375
384
  */
376
- renderTreeIcon (h: CreateElement, params: any, cellVNodes: any) {
385
+ renderTreeIcon (h: CreateElement, params: VxeTableDefines.CellRenderBodyParams & { $table: VxeTableConstructor & VxeTablePrivateMethods }, cellVNodes: VxeComponentSlotType[]) {
377
386
  const { $table, isHidden } = params
378
- const { treeOpts, treeExpandedMaps, treeExpandLazyLoadedMaps, fullAllDataRowIdData } = $table
387
+ const tableReactData = $table as unknown as TableReactData
388
+ const tableInternalData = $table as unknown as TableInternalData
389
+ const { treeExpandedMaps, treeExpandLazyLoadedMaps } = tableReactData
390
+ const { fullAllDataRowIdData } = tableInternalData
391
+ const treeOpts = $table.computeTreeOpts
379
392
  const { row, column, level } = params
380
393
  const { slots } = column
381
394
  const { indent, lazy, trigger, iconLoaded, showIcon, iconOpen, iconClose } = treeOpts
@@ -383,17 +396,18 @@ export const Cell = {
383
396
  const hasChildField = treeOpts.hasChild || treeOpts.hasChildField
384
397
  const rowChilds = row[childrenField]
385
398
  const hasChild = rowChilds && rowChilds.length
399
+ const iconSlot = slots ? slots.icon : null
386
400
  let hasLazyChilds = false
387
- let isAceived = false
401
+ let isActive = false
388
402
  let isLazyLoading = false
389
403
  let isLazyLoaded = false
390
- const on: any = {}
391
- if (slots && slots.icon) {
392
- return $table.callSlot(slots.icon, params, h, cellVNodes)
404
+ const ons: Record<string, any> = {}
405
+ if (iconSlot) {
406
+ return $table.callSlot(iconSlot, params, h)
393
407
  }
394
408
  if (!isHidden) {
395
409
  const rowid = getRowid($table, row)
396
- isAceived = !!treeExpandedMaps[rowid]
410
+ isActive = !!treeExpandedMaps[rowid]
397
411
  if (lazy) {
398
412
  const rest = fullAllDataRowIdData[rowid]
399
413
  isLazyLoading = !!treeExpandLazyLoadedMaps[rowid]
@@ -402,14 +416,14 @@ export const Cell = {
402
416
  }
403
417
  }
404
418
  if (!trigger || trigger === 'default') {
405
- on.click = (evnt: any) => {
419
+ ons.click = (evnt: MouseEvent) => {
406
420
  $table.triggerTreeExpandEvent(evnt, params)
407
421
  }
408
422
  }
409
423
  return [
410
424
  h('div', {
411
425
  class: ['vxe-cell--tree-node', {
412
- 'is--active': isAceived
426
+ 'is--active': isActive
413
427
  }],
414
428
  style: {
415
429
  paddingLeft: `${level * indent}px`
@@ -419,10 +433,10 @@ export const Cell = {
419
433
  ? [
420
434
  h('div', {
421
435
  class: 'vxe-tree--btn-wrapper',
422
- on
436
+ on: ons
423
437
  }, [
424
438
  h('i', {
425
- class: ['vxe-tree--node-btn', isLazyLoading ? (iconLoaded || getIcon().TABLE_TREE_LOADED) : (isAceived ? (iconOpen || getIcon().TABLE_TREE_OPEN) : (iconClose || getIcon().TABLE_TREE_CLOSE))]
439
+ class: ['vxe-tree--node-btn', isLazyLoading ? (iconLoaded || getIcon().TABLE_TREE_LOADED) : (isActive ? (iconOpen || getIcon().TABLE_TREE_OPEN) : (iconClose || getIcon().TABLE_TREE_CLOSE))]
426
440
  })
427
441
  ])
428
442
  ]
@@ -437,14 +451,16 @@ export const Cell = {
437
451
  /**
438
452
  * 序号
439
453
  */
440
- renderSeqHeader (h: CreateElement, params: any) {
454
+ renderSeqHeader (h: CreateElement, params: VxeTableDefines.CellRenderHeaderParams & { $table: VxeTableConstructor & VxeTablePrivateMethods }) {
441
455
  const { $table, column } = params
442
456
  const { slots } = column
443
457
  return renderHeaderCellBaseVNs(h, params, renderTitleContent(h, params, slots && slots.header ? $table.callSlot(slots.header, params, h) : formatText(column.getTitle(), 1)))
444
458
  },
445
- renderSeqCell (h: CreateElement, params: any) {
459
+ renderSeqCell (h: CreateElement, params: VxeTableDefines.CellRenderBodyParams & { $table: VxeTableConstructor & VxeTablePrivateMethods }) {
446
460
  const { $table, column } = params
447
- const { treeConfig, seqOpts } = $table
461
+ const tableProps = $table
462
+ const { treeConfig } = tableProps
463
+ const seqOpts = $table.computeSeqOpts
448
464
  const { slots } = column
449
465
  if (slots && slots.default) {
450
466
  return renderCellBaseVNs(h, params, $table.callSlot(slots.default, params, h))
@@ -452,17 +468,17 @@ export const Cell = {
452
468
  const { seq } = params
453
469
  const seqMethod = seqOpts.seqMethod
454
470
  return renderCellBaseVNs(h, params, [
455
- h('span', `${formatText(seqMethod ? seqMethod(params) : treeConfig ? seq : (seqOpts.startIndex || 0) + seq, 1)}`)
471
+ h('span', `${formatText(seqMethod ? seqMethod(params) : treeConfig ? seq : (seqOpts.startIndex || 0) + (seq as number), 1)}`)
456
472
  ])
457
473
  },
458
- renderTreeIndexCell (h: CreateElement, params: any) {
474
+ renderTreeIndexCell (h: CreateElement, params: VxeTableDefines.CellRenderBodyParams & { $table: VxeTableConstructor & VxeTablePrivateMethods }) {
459
475
  return Cell.renderTreeIcon(h, params, Cell.renderSeqCell(h, params))
460
476
  },
461
477
 
462
478
  /**
463
479
  * 单选
464
480
  */
465
- renderRadioHeader (h: CreateElement, params: any) {
481
+ renderRadioHeader (h: CreateElement, params: VxeTableDefines.CellRenderHeaderParams & { $table: VxeTableConstructor & VxeTablePrivateMethods }) {
466
482
  const { $table, column } = params
467
483
  const { slots } = column
468
484
  const headerSlot = slots ? slots.header : null
@@ -477,9 +493,11 @@ export const Cell = {
477
493
  ])
478
494
  )
479
495
  },
480
- renderRadioCell (h: CreateElement, params: any) {
496
+ renderRadioCell (h: CreateElement, params: VxeTableDefines.CellRenderBodyParams & { $table: VxeTableConstructor & VxeTablePrivateMethods }) {
481
497
  const { $table, column, isHidden } = params
482
- const { radioOpts, selectRadioRow } = $table
498
+ const tableReactData = $table as unknown as TableReactData
499
+ const { selectRadioRow } = tableReactData
500
+ const radioOpts = $table.computeRadioOpts
483
501
  const { slots } = column
484
502
  const { labelField, checkMethod, visibleMethod } = radioOpts
485
503
  const { row } = params
@@ -530,28 +548,28 @@ export const Cell = {
530
548
  }, radioVNs)
531
549
  ])
532
550
  },
533
- renderTreeRadioCell (h: CreateElement, params: any) {
551
+ renderTreeRadioCell (h: CreateElement, params: VxeTableDefines.CellRenderBodyParams & { $table: VxeTableConstructor & VxeTablePrivateMethods }) {
534
552
  return Cell.renderTreeIcon(h, params, Cell.renderRadioCell(h, params))
535
553
  },
536
554
 
537
555
  /**
538
556
  * 多选
539
557
  */
540
- renderCheckboxHeader (h: CreateElement, params: any) {
558
+ renderCheckboxHeader (h: CreateElement, params: VxeTableDefines.CellRenderHeaderParams & { $table: VxeTableConstructor & VxeTablePrivateMethods }) {
541
559
  const { $table, column, isHidden } = params
542
- const { isAllSelected: isAllCheckboxSelected, isIndeterminate: isAllCheckboxIndeterminate, isAllCheckboxDisabled } = $table
560
+ const tableReactData = $table as unknown as TableReactData
561
+ const { isAllSelected: isAllCheckboxSelected, isIndeterminate: isAllCheckboxIndeterminate } = tableReactData
562
+ const isAllCheckboxDisabled = $table.computeIsAllCheckboxDisabled
543
563
  const { slots } = column
544
564
  const headerSlot = slots ? slots.header : null
545
565
  const titleSlot = slots ? slots.title : null
546
- const checkboxOpts = $table.checkboxOpts
566
+ const checkboxOpts = $table.computeCheckboxOpts
547
567
  const headerTitle = column.getTitle()
548
- let on
568
+ const ons: Record<string, any> = {}
549
569
  if (!isHidden) {
550
- on = {
551
- click (evnt: any) {
552
- if (!isAllCheckboxDisabled) {
553
- $table.triggerCheckAllEvent(evnt, !isAllCheckboxSelected)
554
- }
570
+ ons.click = (evnt: any) => {
571
+ if (!isAllCheckboxDisabled) {
572
+ $table.triggerCheckAllEvent(evnt, !isAllCheckboxSelected)
555
573
  }
556
574
  }
557
575
  }
@@ -577,7 +595,7 @@ export const Cell = {
577
595
  attrs: {
578
596
  title: getI18n('vxe.table.allTitle')
579
597
  },
580
- on
598
+ on: ons
581
599
  }, [
582
600
  h('span', {
583
601
  class: ['vxe-checkbox--icon', isAllCheckboxIndeterminate ? getIcon().TABLE_CHECKBOX_INDETERMINATE : (isAllCheckboxSelected ? getIcon().TABLE_CHECKBOX_CHECKED : getIcon().TABLE_CHECKBOX_UNCHECKED)]
@@ -592,10 +610,14 @@ export const Cell = {
592
610
  ])
593
611
  )
594
612
  },
595
- renderCheckboxCell (h: CreateElement, params: any) {
613
+ renderCheckboxCell (h: CreateElement, params: VxeTableDefines.CellRenderBodyParams & { $table: VxeTableConstructor & VxeTablePrivateMethods }) {
596
614
  const { $table, row, column, isHidden } = params
597
- const { treeConfig, treeIndeterminateMaps, selectCheckboxMaps } = $table
598
- const { labelField, checkMethod, visibleMethod } = $table.checkboxOpts
615
+ const tableProps = $table
616
+ const tableReactData = $table as unknown as TableReactData
617
+ const { treeConfig } = tableProps
618
+ const { selectCheckboxMaps, treeIndeterminateMaps } = tableReactData
619
+ const checkboxOpts = $table.computeCheckboxOpts
620
+ const { labelField, checkMethod, visibleMethod } = checkboxOpts
599
621
  const { slots } = column
600
622
  const defaultSlot = slots ? slots.default : null
601
623
  const checkboxSlot = slots ? slots.checkbox : null
@@ -603,15 +625,13 @@ export const Cell = {
603
625
  let isChecked = false
604
626
  const isVisible = !visibleMethod || visibleMethod({ row })
605
627
  let isDisabled = !!checkMethod
606
- let on
628
+ const ons: Record<string, any> = {}
607
629
  if (!isHidden) {
608
630
  const rowid = getRowid($table, row)
609
631
  isChecked = !!selectCheckboxMaps[rowid]
610
- on = {
611
- click (evnt: any) {
612
- if (!isDisabled && isVisible) {
613
- $table.triggerCheckRowEvent(evnt, params, !isChecked)
614
- }
632
+ ons.click = (evnt: any) => {
633
+ if (!isDisabled && isVisible) {
634
+ $table.triggerCheckRowEvent(evnt, params, !isChecked)
615
635
  }
616
636
  }
617
637
  if (checkMethod) {
@@ -648,16 +668,20 @@ export const Cell = {
648
668
  'is--indeterminate': indeterminate,
649
669
  'is--hidden': !isVisible
650
670
  }],
651
- on
671
+ on: ons
652
672
  }, checkVNs)
653
673
  ])
654
674
  },
655
- renderTreeSelectionCell (h: CreateElement, params: any) {
675
+ renderTreeSelectionCell (h: CreateElement, params: VxeTableDefines.CellRenderBodyParams & { $table: VxeTableConstructor & VxeTablePrivateMethods }) {
656
676
  return Cell.renderTreeIcon(h, params, Cell.renderCheckboxCell(h, params))
657
677
  },
658
- renderCheckboxCellByProp (h: CreateElement, params: any) {
678
+ renderCheckboxCellByProp (h: CreateElement, params: VxeTableDefines.CellRenderBodyParams & { $table: VxeTableConstructor & VxeTablePrivateMethods }) {
659
679
  const { $table, row, column, isHidden } = params
660
- const { treeConfig, treeIndeterminateMaps, checkboxOpts } = $table
680
+ const tableProps = $table
681
+ const tableReactData = $table as unknown as TableReactData
682
+ const { treeConfig } = tableProps
683
+ const { treeIndeterminateMaps } = tableReactData
684
+ const checkboxOpts = $table.computeCheckboxOpts
661
685
  const { labelField, checkField, checkMethod, visibleMethod } = checkboxOpts
662
686
  const indeterminateField = checkboxOpts.indeterminateField || checkboxOpts.halfField
663
687
  const { slots } = column
@@ -667,15 +691,13 @@ export const Cell = {
667
691
  let isChecked = false
668
692
  const isVisible = !visibleMethod || visibleMethod({ row })
669
693
  let isDisabled = !!checkMethod
670
- let on
694
+ const ons: Record<string, any> = {}
671
695
  if (!isHidden) {
672
696
  const rowid = getRowid($table, row)
673
697
  isChecked = XEUtils.get(row, checkField)
674
- on = {
675
- click (evnt: any) {
676
- if (!isDisabled && isVisible) {
677
- $table.triggerCheckRowEvent(evnt, params, !isChecked)
678
- }
698
+ ons.click = (evnt: any) => {
699
+ if (!isDisabled && isVisible) {
700
+ $table.triggerCheckRowEvent(evnt, params, !isChecked)
679
701
  }
680
702
  }
681
703
  if (checkMethod) {
@@ -712,31 +734,34 @@ export const Cell = {
712
734
  'is--indeterminate': indeterminateField && !isChecked ? row[indeterminateField] : isIndeterminate,
713
735
  'is--hidden': !isVisible
714
736
  }],
715
- on
737
+ on: ons
716
738
  }, checkVNs)
717
739
  ])
718
740
  },
719
- renderTreeSelectionCellByProp (h: CreateElement, params: any) {
741
+ renderTreeSelectionCellByProp (h: CreateElement, params: VxeTableDefines.CellRenderBodyParams & { $table: VxeTableConstructor & VxeTablePrivateMethods }) {
720
742
  return Cell.renderTreeIcon(h, params, Cell.renderCheckboxCellByProp(h, params))
721
743
  },
722
744
 
723
745
  /**
724
746
  * 展开行
725
747
  */
726
- renderExpandCell (h: CreateElement, params: any) {
748
+ renderExpandCell (h: CreateElement, params: VxeTableDefines.CellRenderBodyParams & { $table: VxeTableConstructor & VxeTablePrivateMethods }) {
727
749
  const { $table, isHidden, row, column } = params
728
- const { expandOpts, rowExpandedMaps, rowExpandLazyLoadedMaps } = $table
750
+ const tableReactData = $table as unknown as TableReactData
751
+ const { rowExpandedMaps, rowExpandLazyLoadedMaps } = tableReactData
752
+ const expandOpts = $table.computeExpandOpts
729
753
  const { lazy, labelField, iconLoaded, showIcon, iconOpen, iconClose, visibleMethod } = expandOpts
730
754
  const { slots } = column
731
755
  const defaultSlot = slots ? slots.default : null
732
- let isAceived = false
756
+ const iconSlot = slots ? slots.icon : null
757
+ let isActive = false
733
758
  let isLazyLoading = false
734
- if (slots && slots.icon) {
735
- return renderCellBaseVNs(h, params, $table.callSlot(slots.icon, params, h))
759
+ if (iconSlot) {
760
+ return renderCellBaseVNs(h, params, $table.callSlot(iconSlot, params, h))
736
761
  }
737
762
  if (!isHidden) {
738
763
  const rowid = getRowid($table, row)
739
- isAceived = !!rowExpandedMaps[rowid]
764
+ isActive = !!rowExpandedMaps[rowid]
740
765
  if (lazy) {
741
766
  isLazyLoading = !!rowExpandLazyLoadedMaps[rowid]
742
767
  }
@@ -745,7 +770,7 @@ export const Cell = {
745
770
  showIcon && (!visibleMethod || visibleMethod(params))
746
771
  ? h('span', {
747
772
  class: ['vxe-table--expanded', {
748
- 'is--active': isAceived
773
+ 'is--active': isActive
749
774
  }],
750
775
  on: {
751
776
  click (evnt: any) {
@@ -754,7 +779,7 @@ export const Cell = {
754
779
  }
755
780
  }, [
756
781
  h('i', {
757
- class: ['vxe-table--expand-btn', isLazyLoading ? (iconLoaded || getIcon().TABLE_EXPAND_LOADED) : (isAceived ? (iconOpen || getIcon().TABLE_EXPAND_OPEN) : (iconClose || getIcon().TABLE_EXPAND_CLOSE))]
782
+ class: ['vxe-table--expand-btn', isLazyLoading ? (iconLoaded || getIcon().TABLE_EXPAND_LOADED) : (isActive ? (iconOpen || getIcon().TABLE_EXPAND_OPEN) : (iconClose || getIcon().TABLE_EXPAND_CLOSE))]
758
783
  })
759
784
  ])
760
785
  : renderEmptyElement($table),
@@ -765,7 +790,7 @@ export const Cell = {
765
790
  : renderEmptyElement($table)
766
791
  ])
767
792
  },
768
- renderExpandData (h: CreateElement, params: any) {
793
+ renderExpandData (h: CreateElement, params: VxeTableDefines.CellRenderDataParams & { $table: VxeTableConstructor & VxeTablePrivateMethods }) {
769
794
  const { $table, column } = params
770
795
  const { slots, contentRender } = column
771
796
  if (slots && slots.content) {
@@ -784,7 +809,7 @@ export const Cell = {
784
809
  /**
785
810
  * HTML 标签
786
811
  */
787
- renderHTMLCell (h: CreateElement, params: any) {
812
+ renderHTMLCell (h: CreateElement, params: VxeTableDefines.CellRenderBodyParams & { $table: VxeTableConstructor & VxeTablePrivateMethods }) {
788
813
  const { $table, column } = params
789
814
  const { slots } = column
790
815
  if (slots && slots.default) {
@@ -799,14 +824,14 @@ export const Cell = {
799
824
  })
800
825
  ])
801
826
  },
802
- renderTreeHTMLCell (h: CreateElement, params: any) {
827
+ renderTreeHTMLCell (h: CreateElement, params: VxeTableDefines.CellRenderBodyParams & { $table: VxeTableConstructor & VxeTablePrivateMethods }) {
803
828
  return Cell.renderTreeIcon(h, params, Cell.renderHTMLCell(h, params))
804
829
  },
805
830
 
806
831
  /**
807
832
  * 排序和筛选
808
833
  */
809
- renderSortAndFilterHeader (h: CreateElement, params: any) {
834
+ renderSortAndFilterHeader (h: CreateElement, params: VxeTableDefines.CellRenderHeaderParams & { $table: VxeTableConstructor & VxeTablePrivateMethods }) {
810
835
  return renderHeaderCellBaseVNs(
811
836
  h,
812
837
  params,
@@ -817,14 +842,14 @@ export const Cell = {
817
842
  /**
818
843
  * 排序
819
844
  */
820
- renderSortHeader (h: CreateElement, params: any) {
845
+ renderSortHeader (h: CreateElement, params: VxeTableDefines.CellRenderHeaderParams & { $table: VxeTableConstructor & VxeTablePrivateMethods }) {
821
846
  return renderHeaderCellBaseVNs(
822
847
  h,
823
848
  params,
824
849
  Cell.renderHeaderTitle(h, params).concat(Cell.renderSortIcon(h, params))
825
850
  )
826
851
  },
827
- renderSortIcon (h: CreateElement, params: any) {
852
+ renderSortIcon (h: CreateElement, params: (VxeTableDefines.CellRenderHeaderParams | VxeTableDefines.CellRenderHeaderParams) & { $table: VxeTableConstructor & VxeTablePrivateMethods }) {
828
853
  const { $table, column } = params
829
854
  const { showIcon, iconLayout, iconAsc, iconDesc } = $table.sortOpts
830
855
  return showIcon
@@ -868,12 +893,14 @@ export const Cell = {
868
893
  /**
869
894
  * 筛选
870
895
  */
871
- renderFilterHeader (h: CreateElement, params: any) {
896
+ renderFilterHeader (h: CreateElement, params: VxeTableDefines.CellRenderHeaderParams & { $table: VxeTableConstructor & VxeTablePrivateMethods }) {
872
897
  return renderHeaderCellBaseVNs(h, params, Cell.renderHeaderTitle(h, params).concat(Cell.renderFilterIcon(h, params)))
873
898
  },
874
- renderFilterIcon (h: CreateElement, params: any) {
899
+ renderFilterIcon (h: CreateElement, params: VxeTableDefines.CellRenderHeaderParams & { $table: VxeTableConstructor & VxeTablePrivateMethods }) {
875
900
  const { $table, column, hasFilter } = params
876
- const { filterStore, filterOpts } = $table
901
+ const tableReactData = $table as unknown as TableReactData
902
+ const { filterStore } = tableReactData
903
+ const filterOpts = $table.computeFilterOpts
877
904
  const { showIcon, iconNone, iconMatch } = filterOpts
878
905
  return showIcon
879
906
  ? [
@@ -888,7 +915,7 @@ export const Cell = {
888
915
  title: getI18n('vxe.table.filter')
889
916
  },
890
917
  on: {
891
- click (evnt: any) {
918
+ click (evnt: MouseEvent) {
892
919
  if ($table.triggerFilterEvent) {
893
920
  $table.triggerFilterEvent(evnt, params.column, params)
894
921
  }
@@ -903,10 +930,12 @@ export const Cell = {
903
930
  /**
904
931
  * 可编辑
905
932
  */
906
- renderEditHeader (h: CreateElement, params: any) {
933
+ renderEditHeader (h: CreateElement, params: VxeTableDefines.CellRenderHeaderParams & { $table: VxeTableConstructor & VxeTablePrivateMethods }) {
907
934
  const { $table, column } = params
908
- const { editConfig, editRules, editOpts } = $table
909
- const { sortable, remoteSort, filters, editRender } = column
935
+ const tableProps = $table
936
+ const { editConfig, editRules } = tableProps
937
+ const editOpts = $table.computeEditOpts
938
+ const { sortable, filters, editRender } = column
910
939
  let isRequired = false
911
940
  if (editRules) {
912
941
  const columnRules = XEUtils.get(editRules, column.field)
@@ -931,31 +960,35 @@ export const Cell = {
931
960
  }
932
961
  return renderHeaderCellBaseVNs(h, params,
933
962
  editIconVNs.concat(Cell.renderHeaderTitle(h, params))
934
- .concat(sortable || remoteSort ? Cell.renderSortIcon(h, params) : [])
963
+ .concat(sortable ? Cell.renderSortIcon(h, params) : [])
935
964
  .concat(filters ? Cell.renderFilterIcon(h, params) : [])
936
965
  )
937
966
  },
938
967
  // 行格编辑模式
939
- renderRowEdit (h: CreateElement, params: any) {
968
+ renderRowEdit (h: CreateElement, params: VxeTableDefines.CellRenderBodyParams & { $table: VxeTableConstructor & VxeTablePrivateMethods }) {
940
969
  const { $table, column } = params
970
+ const tableReactData = $table as unknown as TableReactData
971
+ const { editStore } = tableReactData
972
+ const { actived } = editStore
941
973
  const { editRender } = column
942
- const { actived } = $table.editStore
943
974
  return Cell.runRenderer(h, params, this, isEnableConf(editRender) && actived && actived.row === params.row)
944
975
  },
945
- renderTreeRowEdit (h: CreateElement, params: any) {
976
+ renderTreeRowEdit (h: CreateElement, params: VxeTableDefines.CellRenderBodyParams & { $table: VxeTableConstructor & VxeTablePrivateMethods }) {
946
977
  return Cell.renderTreeIcon(h, params, Cell.renderRowEdit(h, params))
947
978
  },
948
979
  // 单元格编辑模式
949
- renderCellEdit (h: CreateElement, params: any) {
980
+ renderCellEdit (h: CreateElement, params: VxeTableDefines.CellRenderBodyParams & { $table: VxeTableConstructor & VxeTablePrivateMethods }) {
950
981
  const { $table, column } = params
982
+ const tableReactData = $table as unknown as TableReactData
983
+ const { editStore } = tableReactData
984
+ const { actived } = editStore
951
985
  const { editRender } = column
952
- const { actived } = $table.editStore
953
986
  return Cell.runRenderer(h, params, this, isEnableConf(editRender) && actived && actived.row === params.row && actived.column === params.column)
954
987
  },
955
- renderTreeCellEdit (h: CreateElement, params: any) {
988
+ renderTreeCellEdit (h: CreateElement, params: VxeTableDefines.CellRenderBodyParams & { $table: VxeTableConstructor & VxeTablePrivateMethods }) {
956
989
  return Cell.renderTreeIcon(h, params, Cell.renderCellEdit(h, params))
957
990
  },
958
- runRenderer (h: CreateElement, params: any, _vm: any, isEdit: any) {
991
+ runRenderer (h: CreateElement, params: VxeTableDefines.CellRenderBodyParams & { $table: VxeTableConstructor & VxeTablePrivateMethods }, _vm: any, isEdit: boolean) {
959
992
  const { $table, column } = params
960
993
  const { slots, editRender, formatter } = column
961
994
  const compConf = renderer.get(editRender.name)