vxe-table 3.10.1 → 3.10.3

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 (119) hide show
  1. package/es/locale/lang/en-US.js +3 -2
  2. package/es/locale/lang/es-ES.js +3 -2
  3. package/es/locale/lang/hu-HU.js +3 -2
  4. package/es/locale/lang/ja-JP.js +3 -2
  5. package/es/locale/lang/ko-KR.js +3 -2
  6. package/es/locale/lang/pt-BR.js +3 -2
  7. package/es/locale/lang/ru-RU.js +3 -2
  8. package/es/locale/lang/uk-UA.js +3 -2
  9. package/es/locale/lang/vi-VN.js +3 -2
  10. package/es/locale/lang/zh-CHT.js +3 -2
  11. package/es/locale/lang/zh-CN.js +3 -2
  12. package/es/style.css +1 -1
  13. package/es/style.min.css +1 -1
  14. package/es/table/module/edit/mixin.js +9 -4
  15. package/es/table/src/body.js +43 -24
  16. package/es/table/src/cell.js +65 -27
  17. package/es/table/src/column.js +3 -1
  18. package/es/table/src/columnInfo.js +1 -0
  19. package/es/table/src/methods.js +211 -14
  20. package/es/table/src/props.js +2 -0
  21. package/es/table/src/table.js +16 -1
  22. package/es/table/style.css +77 -2
  23. package/es/table/style.min.css +1 -1
  24. package/es/ui/index.js +4 -1
  25. package/es/ui/src/log.js +1 -1
  26. package/es/vxe-table/style.css +77 -2
  27. package/es/vxe-table/style.min.css +1 -1
  28. package/helper/vetur/attributes.json +1 -1
  29. package/helper/vetur/tags.json +1 -1
  30. package/lib/index.umd.js +387 -78
  31. package/lib/index.umd.min.js +1 -1
  32. package/lib/locale/lang/en-US.js +3 -2
  33. package/lib/locale/lang/en-US.min.js +1 -1
  34. package/lib/locale/lang/en-US.umd.js +3 -2
  35. package/lib/locale/lang/es-ES.js +3 -2
  36. package/lib/locale/lang/es-ES.min.js +1 -1
  37. package/lib/locale/lang/es-ES.umd.js +3 -2
  38. package/lib/locale/lang/hu-HU.js +3 -2
  39. package/lib/locale/lang/hu-HU.min.js +1 -1
  40. package/lib/locale/lang/hu-HU.umd.js +3 -2
  41. package/lib/locale/lang/ja-JP.js +3 -2
  42. package/lib/locale/lang/ja-JP.min.js +1 -1
  43. package/lib/locale/lang/ja-JP.umd.js +3 -2
  44. package/lib/locale/lang/ko-KR.js +3 -2
  45. package/lib/locale/lang/ko-KR.min.js +1 -1
  46. package/lib/locale/lang/ko-KR.umd.js +3 -2
  47. package/lib/locale/lang/pt-BR.js +3 -2
  48. package/lib/locale/lang/pt-BR.min.js +1 -1
  49. package/lib/locale/lang/pt-BR.umd.js +3 -2
  50. package/lib/locale/lang/ru-RU.js +3 -2
  51. package/lib/locale/lang/ru-RU.min.js +1 -1
  52. package/lib/locale/lang/ru-RU.umd.js +3 -2
  53. package/lib/locale/lang/uk-UA.js +3 -2
  54. package/lib/locale/lang/uk-UA.min.js +1 -1
  55. package/lib/locale/lang/uk-UA.umd.js +3 -2
  56. package/lib/locale/lang/vi-VN.js +3 -2
  57. package/lib/locale/lang/vi-VN.min.js +1 -1
  58. package/lib/locale/lang/zh-CHT.js +3 -2
  59. package/lib/locale/lang/zh-CHT.min.js +1 -1
  60. package/lib/locale/lang/zh-CHT.umd.js +3 -2
  61. package/lib/locale/lang/zh-CN.js +3 -2
  62. package/lib/locale/lang/zh-CN.min.js +1 -1
  63. package/lib/locale/lang/zh-CN.umd.js +3 -2
  64. package/lib/style.css +1 -1
  65. package/lib/style.min.css +1 -1
  66. package/lib/table/module/edit/mixin.js +9 -4
  67. package/lib/table/module/edit/mixin.min.js +1 -1
  68. package/lib/table/src/body.js +41 -22
  69. package/lib/table/src/body.min.js +1 -1
  70. package/lib/table/src/cell.js +78 -27
  71. package/lib/table/src/cell.min.js +1 -1
  72. package/lib/table/src/column.js +3 -1
  73. package/lib/table/src/column.min.js +1 -1
  74. package/lib/table/src/columnInfo.js +1 -0
  75. package/lib/table/src/columnInfo.min.js +1 -1
  76. package/lib/table/src/methods.js +227 -14
  77. package/lib/table/src/methods.min.js +1 -1
  78. package/lib/table/src/props.js +2 -0
  79. package/lib/table/src/props.min.js +1 -1
  80. package/lib/table/src/table.js +15 -2
  81. package/lib/table/src/table.min.js +1 -1
  82. package/lib/table/style/style.css +77 -2
  83. package/lib/table/style/style.min.css +1 -1
  84. package/lib/ui/index.js +4 -1
  85. package/lib/ui/index.min.js +1 -1
  86. package/lib/ui/src/log.js +1 -1
  87. package/lib/ui/src/log.min.js +1 -1
  88. package/lib/vxe-table/style/style.css +77 -2
  89. package/lib/vxe-table/style/style.min.css +1 -1
  90. package/package.json +2 -2
  91. package/packages/locale/lang/en-US.ts +3 -2
  92. package/packages/locale/lang/es-ES.ts +3 -2
  93. package/packages/locale/lang/hu-HU.ts +3 -2
  94. package/packages/locale/lang/ja-JP.ts +3 -2
  95. package/packages/locale/lang/ko-KR.ts +3 -2
  96. package/packages/locale/lang/pt-BR.ts +3 -2
  97. package/packages/locale/lang/ru-RU.ts +3 -2
  98. package/packages/locale/lang/uk-UA.ts +3 -2
  99. package/packages/locale/lang/vi-VN.ts +3 -2
  100. package/packages/locale/lang/zh-CHT.ts +3 -2
  101. package/packages/locale/lang/zh-CN.ts +3 -2
  102. package/packages/table/module/custom/panel.ts +8 -8
  103. package/packages/table/module/edit/mixin.ts +10 -4
  104. package/packages/table/src/body.ts +43 -24
  105. package/packages/table/src/cell.ts +69 -27
  106. package/packages/table/src/column.ts +3 -1
  107. package/packages/table/src/columnInfo.ts +1 -0
  108. package/packages/table/src/methods.ts +227 -14
  109. package/packages/table/src/props.ts +2 -0
  110. package/packages/table/src/table.ts +16 -1
  111. package/packages/ui/index.ts +3 -0
  112. package/styles/components/table-module/custom.scss +14 -3
  113. package/styles/components/table.scss +80 -0
  114. /package/es/{iconfont.1730710763407.ttf → iconfont.1730898131844.ttf} +0 -0
  115. /package/es/{iconfont.1730710763407.woff → iconfont.1730898131844.woff} +0 -0
  116. /package/es/{iconfont.1730710763407.woff2 → iconfont.1730898131844.woff2} +0 -0
  117. /package/lib/{iconfont.1730710763407.ttf → iconfont.1730898131844.ttf} +0 -0
  118. /package/lib/{iconfont.1730710763407.woff → iconfont.1730898131844.woff} +0 -0
  119. /package/lib/{iconfont.1730710763407.woff2 → iconfont.1730898131844.woff2} +0 -0
@@ -71,7 +71,8 @@ export default {
71
71
  customClose: '关闭',
72
72
  customCancel: '取消',
73
73
  customRestore: '恢复默认',
74
- maxFixedCol: '最大冻结列的数量不能超过 {0} 个'
74
+ maxFixedCol: '最大冻结列的数量不能超过 {0} 个',
75
+ dragTip: '移动:{0}'
75
76
  },
76
77
  grid: {
77
78
  selectOneRecord: '请至少选择一条记录!',
@@ -122,7 +123,7 @@ export default {
122
123
  cstmCancel: '取消',
123
124
  cstmConfirm: '确定',
124
125
  cstmConfirmRestore: '请确认是否恢复成默认列配置?',
125
- cstmDragTarget: '移动目标:{0}',
126
+ cstmDragTarget: '移动:{0}',
126
127
  setting: {
127
128
  colSort: '排序',
128
129
  sortHelpTip: '点击并拖动图标可以调整列的排序',
@@ -901,21 +901,21 @@ export default {
901
901
  }
902
902
  $xetable.checkCustomStatus()
903
903
  },
904
- sortMousedownEvent (evnt: any) {
904
+ sortMousedownEvent (evnt: MouseEvent) {
905
905
  const { $xetable } = this
906
- const btnEl = evnt.currentTarget
907
- const tdEl = btnEl.parentNode
908
- const trEl = tdEl.parentNode
906
+ const btnEl = evnt.currentTarget as HTMLElement
907
+ const tdEl = btnEl.parentNode as HTMLElement
908
+ const trEl = tdEl.parentNode as HTMLElement
909
909
  const colid = trEl.getAttribute('colid')
910
910
  const column = $xetable.getColumnById(colid)
911
911
  trEl.draggable = true
912
912
  this.dragColumn = column
913
913
  addClass(trEl, 'active--drag-origin')
914
914
  },
915
- sortMouseupEvent (evnt: any) {
916
- const btnEl = evnt.currentTarget
917
- const tdEl = btnEl.parentNode
918
- const trEl = tdEl.parentNode
915
+ sortMouseupEvent (evnt: MouseEvent) {
916
+ const btnEl = evnt.currentTarget as HTMLElement
917
+ const tdEl = btnEl.parentNode as HTMLElement
918
+ const trEl = tdEl.parentNode as HTMLElement
919
919
  const dragHintEl = this.$refs.dragHintElemRef
920
920
  trEl.draggable = false
921
921
  this.dragColumn = null
@@ -547,9 +547,13 @@ export default {
547
547
  * 清除激活的编辑
548
548
  */
549
549
  _clearEdit (evnt: any) {
550
- const { editStore } = this
550
+ const $xeTable = this
551
+ const reactData = $xeTable
552
+
553
+ const { editStore } = reactData
551
554
  const { actived, focused } = editStore
552
555
  const { row, column } = actived
556
+ const validOpts = $xeTable.validOpts
553
557
  if (row || column) {
554
558
  this._syncActivedCell()
555
559
  actived.args = null
@@ -567,9 +571,11 @@ export default {
567
571
  }
568
572
  focused.row = null
569
573
  focused.column = null
570
- if (getConfig().cellVaildMode === 'obsolete') {
571
- if (this.clearValidate) {
572
- return this.clearValidate()
574
+ if (validOpts.autoClear) {
575
+ if (validOpts.msgMode !== 'full' || getConfig().cellVaildMode === 'obsolete') {
576
+ if (this.clearValidate) {
577
+ return this.clearValidate()
578
+ }
573
579
  }
574
580
  }
575
581
  return this.$nextTick()
@@ -299,7 +299,7 @@ function renderColumn (h: any, _vm: any, $xetable: any, seq: any, rowid: any, fi
299
299
  getClass(className, params),
300
300
  getClass(allCellClassName, params)
301
301
  ],
302
- key: columnKey || columnOpts.useKey ? column.id : $columnIndex,
302
+ key: columnKey || columnOpts.useKey || rowOpts.useKey ? column.id : $columnIndex,
303
303
  attrs,
304
304
  style: Object.assign({
305
305
  height: cellHeight
@@ -308,7 +308,7 @@ function renderColumn (h: any, _vm: any, $xetable: any, seq: any, rowid: any, fi
308
308
  }, tdVNs)
309
309
  }
310
310
 
311
- function renderRows (h: CreateElement, _vm: any, $xetable: any, fixedType: any, tableData: any, tableColumn: any) {
311
+ function renderRows (h: CreateElement, _vm: any, $xeTable: any, fixedType: any, tableData: any, tableColumn: any) {
312
312
  const {
313
313
  stripe,
314
314
  rowKey,
@@ -332,35 +332,47 @@ function renderRows (h: CreateElement, _vm: any, $xetable: any, fixedType: any,
332
332
  rowOpts,
333
333
  pendingRowList,
334
334
  pendingRowMaps
335
- } = $xetable
335
+ } = $xeTable
336
336
  const childrenField = treeOpts.children || treeOpts.childrenField
337
337
  const rows: any[] = []
338
338
  tableData.forEach((row: any, $rowIndex: any) => {
339
339
  const trOn: any = {}
340
340
  let rowIndex = $rowIndex
341
- const _rowIndex = $xetable.getVTRowIndex(row)
341
+ const _rowIndex = $xeTable.getVTRowIndex(row)
342
342
  // 确保任何情况下 rowIndex 都精准指向真实 data 索引
343
- rowIndex = $xetable.getRowIndex(row)
344
- // 事件绑定
343
+ rowIndex = $xeTable.getRowIndex(row)
344
+ // 当前行事件
345
345
  if (rowOpts.isHover || highlightHoverRow) {
346
346
  trOn.mouseenter = (evnt: any) => {
347
- if (isVMScrollProcess($xetable)) {
347
+ if (isVMScrollProcess($xeTable)) {
348
348
  return
349
349
  }
350
- $xetable.triggerHoverEvent(evnt, { row, rowIndex })
350
+ $xeTable.triggerHoverEvent(evnt, { row, rowIndex })
351
351
  }
352
352
  trOn.mouseleave = () => {
353
- if (isVMScrollProcess($xetable)) {
353
+ if (isVMScrollProcess($xeTable)) {
354
354
  return
355
355
  }
356
- $xetable.clearHoverRow()
356
+ $xeTable.clearHoverRow()
357
+ }
358
+ }
359
+ // 拖拽行事件
360
+ if (rowOpts.drag) {
361
+ trOn.dragstart = (evnt: DragEvent) => {
362
+ $xeTable.handleRowDragDragstartEvent(evnt)
363
+ }
364
+ trOn.dragover = (evnt: DragEvent) => {
365
+ $xeTable.handleRowDragDragoverEvent(evnt)
366
+ }
367
+ trOn.dragend = (evnt: DragEvent) => {
368
+ $xeTable.handleRowDragDragendEvent(evnt)
357
369
  }
358
370
  }
359
- const rowid = getRowid($xetable, row)
371
+ const rowid = getRowid($xeTable, row)
360
372
  const rest = fullAllDataRowIdData[rowid]
361
373
  const rowLevel = rest ? rest.level : 0
362
374
  const seq = rest ? rest.seq : -1
363
- const params = { $table: $xetable, seq, rowid, fixed: fixedType, type: renderType, level: rowLevel, row, rowIndex, $rowIndex }
375
+ const params = { $table: $xeTable, seq, rowid, fixed: fixedType, type: renderType, level: rowLevel, row, rowIndex, $rowIndex }
364
376
  // 行是否被展开
365
377
  const isExpandRow = expandColumn && !!rowExpandedMaps[rowid]
366
378
  // 树节点是否被展开
@@ -369,7 +381,7 @@ function renderRows (h: CreateElement, _vm: any, $xetable: any, fixedType: any,
369
381
  // 是否新增行
370
382
  let isNewRow = false
371
383
  if (editConfig) {
372
- isNewRow = $xetable.isInsertByRow(row)
384
+ isNewRow = $xeTable.isInsertByRow(row)
373
385
  }
374
386
  if (treeConfig && !scrollYLoad && !treeOpts.transform) {
375
387
  rowChildren = row[childrenField]
@@ -381,13 +393,13 @@ function renderRows (h: CreateElement, _vm: any, $xetable: any, fixedType: any,
381
393
  'vxe-body--row',
382
394
  treeConfig ? `row--level-${rowLevel}` : '',
383
395
  {
384
- 'row--stripe': stripe && ($xetable.getVTRowIndex(row) + 1) % 2 === 0,
396
+ 'row--stripe': stripe && ($xeTable.getVTRowIndex(row) + 1) % 2 === 0,
385
397
  'is--new': isNewRow,
386
398
  'is--expand-row': isExpandRow,
387
399
  'is--expand-tree': isExpandTree,
388
400
  'row--new': isNewRow && (editOpts.showStatus || editOpts.showInsertStatus),
389
- 'row--radio': radioOpts.highlight && $xetable.selectRadioRow === row,
390
- 'row--checked': checkboxOpts.highlight && $xetable.isCheckedByCheckboxRow(row),
401
+ 'row--radio': radioOpts.highlight && $xeTable.selectRadioRow === row,
402
+ 'row--checked': checkboxOpts.highlight && $xeTable.isCheckedByCheckboxRow(row),
391
403
  'row--pending': pendingRowList.length && !!pendingRowMaps[rowid]
392
404
  },
393
405
  rowClassName ? (XEUtils.isFunction(rowClassName) ? rowClassName(params) : rowClassName) : ''
@@ -396,10 +408,10 @@ function renderRows (h: CreateElement, _vm: any, $xetable: any, fixedType: any,
396
408
  rowid
397
409
  },
398
410
  style: rowStyle ? (XEUtils.isFunction(rowStyle) ? rowStyle(params) : rowStyle) : null,
399
- key: (rowKey || rowOpts.useKey) || treeConfig ? rowid : $rowIndex,
411
+ key: rowKey || rowOpts.useKey || rowOpts.drag || treeConfig ? rowid : $rowIndex,
400
412
  on: trOn
401
413
  }, tableColumn.map((column: any, $columnIndex: any) => {
402
- return renderColumn(h, _vm, $xetable, seq, rowid, fixedType, rowLevel, row, rowIndex, $rowIndex, _rowIndex, column, $columnIndex, tableColumn, tableData)
414
+ return renderColumn(h, _vm, $xeTable, seq, rowid, fixedType, rowLevel, row, rowIndex, $rowIndex, _rowIndex, column, $columnIndex, tableColumn, tableData)
403
415
  }))
404
416
  )
405
417
  // 如果行被展开了
@@ -414,7 +426,7 @@ function renderRows (h: CreateElement, _vm: any, $xetable: any, fixedType: any,
414
426
  }
415
427
  const { showOverflow } = expandColumn
416
428
  const hasEllipsis = (XEUtils.isUndefined(showOverflow) || XEUtils.isNull(showOverflow)) ? allColumnOverflow : showOverflow
417
- const expandParams = { $table: $xetable, seq, column: expandColumn, fixed: fixedType, type: renderType, level: rowLevel, row, rowIndex, $rowIndex }
429
+ const expandParams = { $table: $xeTable, seq, column: expandColumn, fixed: fixedType, type: renderType, level: rowLevel, row, rowIndex, $rowIndex }
418
430
  rows.push(
419
431
  h('tr', {
420
432
  class: ['vxe-body--expanded-row', {
@@ -449,7 +461,7 @@ function renderRows (h: CreateElement, _vm: any, $xetable: any, fixedType: any,
449
461
  }
450
462
  // 如果是树形表格
451
463
  if (isExpandTree) {
452
- rows.push(...renderRows(h, _vm, $xetable, fixedType, rowChildren, tableColumn))
464
+ rows.push(...renderRows(h, _vm, $xeTable, fixedType, rowChildren, tableColumn))
453
465
  }
454
466
  })
455
467
  return rows
@@ -501,7 +513,7 @@ export default {
501
513
  },
502
514
  render (this: any, h: CreateElement) {
503
515
  const { _e, $parent: $xetable, fixedColumn, fixedType } = this
504
- let { $scopedSlots, tId, tableData, tableColumn, visibleColumn, expandColumn, showOverflow: allColumnOverflow, keyboardConfig, keyboardOpts, mergeList, spanMethod, scrollXLoad, scrollYLoad, isAllOverflow, emptyOpts, mouseConfig, mouseOpts, sYOpts } = $xetable
516
+ let { $scopedSlots, tId, tableData, tableColumn, visibleColumn, expandColumn, showOverflow: allColumnOverflow, keyboardConfig, keyboardOpts, mergeList, spanMethod, scrollXLoad, scrollYLoad, isAllOverflow, emptyOpts, mouseConfig, mouseOpts, sYOpts, rowOpts, isDragRowMove } = $xetable
505
517
  // 如果是使用优化模式
506
518
  if (fixedType) {
507
519
  // 如果存在展开行使用全量渲染
@@ -580,9 +592,16 @@ export default {
580
592
  /**
581
593
  * 内容
582
594
  */
583
- h('tbody', {
584
- ref: 'tbody'
585
- }, renderRows(h, this, $xetable, fixedType, tableData, tableColumn))
595
+ rowOpts.drag
596
+ ? h('transition-group', {
597
+ props: {
598
+ tag: 'tbody',
599
+ name: `vxe-body--row-list${isDragRowMove ? '' : '-disabled'}`
600
+ }
601
+ }, renderRows(h, this, $xetable, fixedType, tableData, tableColumn))
602
+ : h('tbody', {
603
+ ref: 'tbody'
604
+ }, renderRows(h, this, $xetable, fixedType, tableData, tableColumn))
586
605
  ]),
587
606
  h('div', {
588
607
  class: 'vxe-table--checkbox-range'
@@ -6,7 +6,7 @@ import { updateCellTitle } from '../../ui/src/dom'
6
6
  import { createColumn, getRowid } from './util'
7
7
  import { getSlotVNs } from '../../ui/src/vn'
8
8
 
9
- const { getI18n, getIcon, renderer, formats } = VxeUI
9
+ const { getI18n, getIcon, renderer, formats, renderEmptyElement } = VxeUI
10
10
 
11
11
  function renderTitlePrefixIcon (h: CreateElement, params: any) {
12
12
  const { $table, column } = params
@@ -48,6 +48,46 @@ function renderTitleSuffixIcon (h: CreateElement, params: any) {
48
48
  : []
49
49
  }
50
50
 
51
+ function renderCellDragIcon (h: CreateElement, params: any) {
52
+ const { $table } = params
53
+ const dragOpts = $table.computeDragOpts
54
+ const { rowDisabledMethod } = dragOpts
55
+ const isDisabled = rowDisabledMethod && rowDisabledMethod(params)
56
+ return h('span', {
57
+ key: 'dg',
58
+ class: ['vxe-cell--drag-handle', {
59
+ 'is--disabled': isDisabled
60
+ }],
61
+ on: {
62
+ mousedown (evnt: DragEvent) {
63
+ if (!isDisabled) {
64
+ $table.handleCellDragMousedownEvent(evnt, params)
65
+ }
66
+ },
67
+ mouseup: $table.handleCellDragMouseupEvent
68
+ }
69
+ }, [
70
+ h('i', {
71
+ class: 'vxe-table-icon-drag-handle'
72
+ })
73
+ ])
74
+ }
75
+
76
+ function renderCellBaseVNs (h: CreateElement, params: any, content: any) {
77
+ const { $table, column, row } = params
78
+ const { dragSort } = column
79
+ const vns: any[] = XEUtils.isArray(content) ? content : [content]
80
+ const rowOpts = $table.computeRowOpts
81
+ const dragOpts = $table.computeDragOpts
82
+ const { showRowIcon, rowVisibleMethod } = dragOpts
83
+ if (dragSort && rowOpts.drag && (showRowIcon && (!rowVisibleMethod || rowVisibleMethod({ row, column })))) {
84
+ vns.unshift(
85
+ renderCellDragIcon(h, params)
86
+ )
87
+ }
88
+ return vns
89
+ }
90
+
51
91
  function renderTitleContent (h: CreateElement, params: any, content: any) {
52
92
  const { $table, column } = params
53
93
  const { type, showHeaderOverflow } = column
@@ -234,7 +274,7 @@ export const Cell = {
234
274
  const { slots, editRender, cellRender } = column
235
275
  const renderOpts = editRender || cellRender
236
276
  if (slots && slots.default) {
237
- return $table.callSlot(slots.default, params, h)
277
+ return renderCellBaseVNs(h, params, $table.callSlot(slots.default, params, h))
238
278
  }
239
279
  if (renderOpts) {
240
280
  const compConf = renderer.get(renderOpts.name)
@@ -242,12 +282,12 @@ export const Cell = {
242
282
  const rtCell = compConf ? (compConf.renderTableCell || compConf.renderCell) : null
243
283
  const renderFn = editRender ? rtCell : rtDefault
244
284
  if (renderFn) {
245
- return getSlotVNs(renderFn.call($table, h, renderOpts, Object.assign({ $type: editRender ? 'edit' : 'cell' }, params)))
285
+ return renderCellBaseVNs(h, params, getSlotVNs(renderFn.call($table, h, renderOpts, Object.assign({ $type: editRender ? 'edit' : 'cell' }, params))))
246
286
  }
247
287
  }
248
288
  const cellValue = $table.getCellLabel(row, column)
249
289
  const cellPlaceholder = editRender ? editRender.placeholder : ''
250
- return [
290
+ return renderCellBaseVNs(h, params, [
251
291
  h('span', {
252
292
  class: 'vxe-cell--label'
253
293
  }, [
@@ -258,7 +298,7 @@ export const Cell = {
258
298
  }, formatText(getFuncText(cellPlaceholder), 1))
259
299
  : h('span', formatText(cellValue, 1))
260
300
  ])
261
- ]
301
+ ])
262
302
  },
263
303
  renderTreeCell (h: CreateElement, params: any) {
264
304
  return Cell.renderTreeIcon(h, params, Cell.renderDefaultCell.call(this, h, params))
@@ -348,11 +388,13 @@ export const Cell = {
348
388
  const { treeConfig, seqOpts } = $table
349
389
  const { slots } = column
350
390
  if (slots && slots.default) {
351
- return $table.callSlot(slots.default, params, h)
391
+ return renderCellBaseVNs(h, params, $table.callSlot(slots.default, params, h))
352
392
  }
353
393
  const { seq } = params
354
394
  const seqMethod = seqOpts.seqMethod
355
- return [formatText(seqMethod ? seqMethod(params) : treeConfig ? seq : (seqOpts.startIndex || 0) + seq, 1)]
395
+ return renderCellBaseVNs(h, params, [
396
+ h('span', `${formatText(seqMethod ? seqMethod(params) : treeConfig ? seq : (seqOpts.startIndex || 0) + seq, 1)}`)
397
+ ])
356
398
  },
357
399
  renderTreeIndexCell (h: CreateElement, params: any) {
358
400
  return Cell.renderTreeIcon(h, params, Cell.renderSeqCell(h, params))
@@ -400,7 +442,7 @@ export const Cell = {
400
442
  }
401
443
  const radioParams = { ...params, checked: isChecked, disabled: isDisabled, visible: isVisible }
402
444
  if (radioSlot) {
403
- return $table.callSlot(radioSlot, radioParams, h)
445
+ return renderCellBaseVNs(h, params, $table.callSlot(radioSlot, radioParams, h))
404
446
  }
405
447
  const radioVNs = []
406
448
  if (isVisible) {
@@ -417,7 +459,7 @@ export const Cell = {
417
459
  }, defaultSlot ? $table.callSlot(defaultSlot, radioParams, h) : XEUtils.get(row, labelField))
418
460
  )
419
461
  }
420
- return [
462
+ return renderCellBaseVNs(h, params, [
421
463
  h('span', {
422
464
  class: ['vxe-cell--radio', {
423
465
  'is--checked': isChecked,
@@ -425,7 +467,7 @@ export const Cell = {
425
467
  }],
426
468
  on
427
469
  }, radioVNs)
428
- ]
470
+ ])
429
471
  },
430
472
  renderTreeRadioCell (h: CreateElement, params: any) {
431
473
  return Cell.renderTreeIcon(h, params, Cell.renderRadioCell(h, params))
@@ -518,7 +560,7 @@ export const Cell = {
518
560
  }
519
561
  const checkboxParams = { ...params, checked: isChecked, disabled: isDisabled, visible: isVisible, indeterminate }
520
562
  if (checkboxSlot) {
521
- return $table.callSlot(checkboxSlot, checkboxParams, h)
563
+ return renderCellBaseVNs(h, params, $table.callSlot(checkboxSlot, checkboxParams, h))
522
564
  }
523
565
  const checkVNs = []
524
566
  if (isVisible) {
@@ -535,7 +577,7 @@ export const Cell = {
535
577
  }, defaultSlot ? $table.callSlot(defaultSlot, checkboxParams, h) : XEUtils.get(row, labelField))
536
578
  )
537
579
  }
538
- return [
580
+ return renderCellBaseVNs(h, params, [
539
581
  h('span', {
540
582
  class: ['vxe-cell--checkbox', {
541
583
  'is--checked': isChecked,
@@ -545,7 +587,7 @@ export const Cell = {
545
587
  }],
546
588
  on
547
589
  }, checkVNs)
548
- ]
590
+ ])
549
591
  },
550
592
  renderTreeSelectionCell (h: CreateElement, params: any) {
551
593
  return Cell.renderTreeIcon(h, params, Cell.renderCheckboxCell(h, params))
@@ -582,7 +624,7 @@ export const Cell = {
582
624
  }
583
625
  const checkboxParams = { ...params, checked: isChecked, disabled: isDisabled, visible: isVisible, indeterminate: isIndeterminate }
584
626
  if (checkboxSlot) {
585
- return $table.callSlot(checkboxSlot, checkboxParams, h)
627
+ return renderCellBaseVNs(h, params, $table.callSlot(checkboxSlot, checkboxParams, h))
586
628
  }
587
629
  const checkVNs = []
588
630
  if (isVisible) {
@@ -599,7 +641,7 @@ export const Cell = {
599
641
  }, defaultSlot ? $table.callSlot(defaultSlot, checkboxParams, h) : XEUtils.get(row, labelField))
600
642
  )
601
643
  }
602
- return [
644
+ return renderCellBaseVNs(h, params, [
603
645
  h('span', {
604
646
  class: ['vxe-cell--checkbox', {
605
647
  'is--checked': isChecked,
@@ -609,7 +651,7 @@ export const Cell = {
609
651
  }],
610
652
  on
611
653
  }, checkVNs)
612
- ]
654
+ ])
613
655
  },
614
656
  renderTreeSelectionCellByProp (h: CreateElement, params: any) {
615
657
  return Cell.renderTreeIcon(h, params, Cell.renderCheckboxCellByProp(h, params))
@@ -627,7 +669,7 @@ export const Cell = {
627
669
  let isAceived = false
628
670
  let isLazyLoading = false
629
671
  if (slots && slots.icon) {
630
- return $table.callSlot(slots.icon, params, h)
672
+ return renderCellBaseVNs(h, params, $table.callSlot(slots.icon, params, h))
631
673
  }
632
674
  if (!isHidden) {
633
675
  const rowid = getRowid($table, row)
@@ -636,7 +678,7 @@ export const Cell = {
636
678
  isLazyLoading = !!rowExpandLazyLoadedMaps[rowid]
637
679
  }
638
680
  }
639
- return [
681
+ return renderCellBaseVNs(h, params, [
640
682
  showIcon && (!visibleMethod || visibleMethod(params))
641
683
  ? h('span', {
642
684
  class: ['vxe-table--expanded', {
@@ -652,13 +694,13 @@ export const Cell = {
652
694
  class: ['vxe-table--expand-btn', isLazyLoading ? (iconLoaded || getIcon().TABLE_EXPAND_LOADED) : (isAceived ? (iconOpen || getIcon().TABLE_EXPAND_OPEN) : (iconClose || getIcon().TABLE_EXPAND_CLOSE))]
653
695
  })
654
696
  ])
655
- : null,
697
+ : renderEmptyElement($table),
656
698
  defaultSlot || labelField
657
699
  ? h('span', {
658
700
  class: 'vxe-table--expand-label'
659
701
  }, defaultSlot ? $table.callSlot(defaultSlot, params, h) : XEUtils.get(row, labelField))
660
- : null
661
- ]
702
+ : renderEmptyElement($table)
703
+ ])
662
704
  },
663
705
  renderExpandData (h: CreateElement, params: any) {
664
706
  const { $table, column } = params
@@ -683,16 +725,16 @@ export const Cell = {
683
725
  const { $table, column } = params
684
726
  const { slots } = column
685
727
  if (slots && slots.default) {
686
- return $table.callSlot(slots.default, params, h)
728
+ return renderCellBaseVNs(h, params, $table.callSlot(slots.default, params, h))
687
729
  }
688
- return [
730
+ return renderCellBaseVNs(h, params, [
689
731
  h('span', {
690
732
  class: 'vxe-cell--html',
691
733
  domProps: {
692
734
  innerHTML: getDefaultCellLabel(params)
693
735
  }
694
736
  })
695
- ]
737
+ ])
696
738
  },
697
739
  renderTreeHTMLCell (h: CreateElement, params: any) {
698
740
  return Cell.renderTreeIcon(h, params, Cell.renderHTMLCell(h, params))
@@ -856,14 +898,14 @@ export const Cell = {
856
898
  return []
857
899
  }
858
900
  if (slots && slots.default) {
859
- return $table.callSlot(slots.default, cellParams, h)
901
+ return renderCellBaseVNs(h, params, $table.callSlot(slots.default, cellParams, h))
860
902
  }
861
903
  if (formatter) {
862
- return [
904
+ return renderCellBaseVNs(h, params, [
863
905
  h('span', {
864
906
  class: 'vxe-cell--label'
865
907
  }, [getDefaultCellLabel(cellParams)])
866
- ]
908
+ ])
867
909
  }
868
910
  return Cell.renderDefaultCell.call(_vm, h, cellParams)
869
911
  }
@@ -64,8 +64,10 @@ const props = {
64
64
  filterRecoverMethod: Function,
65
65
  // 筛选模板配置项
66
66
  filterRender: Object,
67
- // 指定为树节点
67
+ // 设置为树节点
68
68
  treeNode: Boolean,
69
+ // 设置为拖拽排序
70
+ dragSort: Boolean,
69
71
  // 是否可视
70
72
  visible: { type: Boolean, default: null },
71
73
  // 表头单元格数据导出方法
@@ -88,6 +88,7 @@ export class ColumnInfo {
88
88
  filterRecoverMethod: _vm.filterRecoverMethod,
89
89
  filterRender: _vm.filterRender,
90
90
  treeNode: _vm.treeNode,
91
+ dragSort: _vm.dragSort,
91
92
  cellType: _vm.cellType,
92
93
  cellRender: _vm.cellRender,
93
94
  editRender: _vm.editRender,