vxe-table 4.8.16 → 4.9.1

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 (135) hide show
  1. package/README.en.md +1 -1
  2. package/README.md +1 -1
  3. package/README.zh-TW.md +1 -1
  4. package/es/locale/lang/en-US.js +1 -0
  5. package/es/locale/lang/es-ES.js +1 -0
  6. package/es/locale/lang/hu-HU.js +1 -0
  7. package/es/locale/lang/ja-JP.js +1 -0
  8. package/es/locale/lang/ko-KR.js +1 -0
  9. package/es/locale/lang/pt-BR.js +1 -0
  10. package/es/locale/lang/ru-RU.js +1 -0
  11. package/es/locale/lang/uk-UA.js +1 -0
  12. package/es/locale/lang/vi-VN.js +1 -0
  13. package/es/locale/lang/zh-CHT.js +1 -0
  14. package/es/locale/lang/zh-CN.js +1 -0
  15. package/es/style.css +1 -1
  16. package/es/style.min.css +1 -1
  17. package/es/table/module/custom/hook.js +4 -0
  18. package/es/table/module/edit/hook.js +53 -34
  19. package/es/table/module/filter/hook.js +2 -3
  20. package/es/table/module/keyboard/hook.js +2 -2
  21. package/es/table/src/body.js +31 -24
  22. package/es/table/src/cell.js +99 -59
  23. package/es/table/src/emits.js +3 -0
  24. package/es/table/src/footer.js +177 -147
  25. package/es/table/src/header.js +144 -107
  26. package/es/table/src/props.js +5 -1
  27. package/es/table/src/table.js +346 -108
  28. package/es/table/src/util.js +9 -0
  29. package/es/table/style.css +33 -20
  30. package/es/table/style.min.css +1 -1
  31. package/es/ui/index.js +9 -4
  32. package/es/ui/src/log.js +1 -1
  33. package/es/vxe-table/style.css +33 -20
  34. package/es/vxe-table/style.min.css +1 -1
  35. package/helper/vetur/attributes.json +1 -1
  36. package/helper/vetur/tags.json +1 -1
  37. package/lib/index.umd.js +1035 -573
  38. package/lib/index.umd.min.js +1 -1
  39. package/lib/locale/lang/en-US.js +1 -0
  40. package/lib/locale/lang/en-US.min.js +1 -1
  41. package/lib/locale/lang/en-US.umd.js +1 -0
  42. package/lib/locale/lang/es-ES.js +1 -0
  43. package/lib/locale/lang/es-ES.min.js +1 -1
  44. package/lib/locale/lang/es-ES.umd.js +1 -0
  45. package/lib/locale/lang/hu-HU.js +1 -0
  46. package/lib/locale/lang/hu-HU.min.js +1 -1
  47. package/lib/locale/lang/hu-HU.umd.js +1 -0
  48. package/lib/locale/lang/ja-JP.js +1 -0
  49. package/lib/locale/lang/ja-JP.min.js +1 -1
  50. package/lib/locale/lang/ja-JP.umd.js +1 -0
  51. package/lib/locale/lang/ko-KR.js +1 -0
  52. package/lib/locale/lang/ko-KR.min.js +1 -1
  53. package/lib/locale/lang/ko-KR.umd.js +1 -0
  54. package/lib/locale/lang/pt-BR.js +1 -0
  55. package/lib/locale/lang/pt-BR.min.js +1 -1
  56. package/lib/locale/lang/pt-BR.umd.js +1 -0
  57. package/lib/locale/lang/ru-RU.js +1 -0
  58. package/lib/locale/lang/ru-RU.min.js +1 -1
  59. package/lib/locale/lang/ru-RU.umd.js +1 -0
  60. package/lib/locale/lang/uk-UA.js +1 -0
  61. package/lib/locale/lang/uk-UA.min.js +1 -1
  62. package/lib/locale/lang/uk-UA.umd.js +1 -0
  63. package/lib/locale/lang/vi-VN.js +1 -0
  64. package/lib/locale/lang/vi-VN.min.js +1 -1
  65. package/lib/locale/lang/zh-CHT.js +1 -0
  66. package/lib/locale/lang/zh-CHT.min.js +1 -1
  67. package/lib/locale/lang/zh-CN.js +1 -0
  68. package/lib/locale/lang/zh-CN.min.js +1 -1
  69. package/lib/locale/lang/zh-CN.umd.js +1 -0
  70. package/lib/style.css +1 -1
  71. package/lib/style.min.css +1 -1
  72. package/lib/table/module/custom/hook.js +4 -0
  73. package/lib/table/module/custom/hook.min.js +1 -1
  74. package/lib/table/module/edit/hook.js +63 -42
  75. package/lib/table/module/edit/hook.min.js +1 -1
  76. package/lib/table/module/filter/hook.js +1 -2
  77. package/lib/table/module/filter/hook.min.js +1 -1
  78. package/lib/table/module/keyboard/hook.js +2 -2
  79. package/lib/table/module/keyboard/hook.min.js +1 -1
  80. package/lib/table/src/body.js +34 -21
  81. package/lib/table/src/body.min.js +1 -1
  82. package/lib/table/src/cell.js +110 -51
  83. package/lib/table/src/cell.min.js +1 -1
  84. package/lib/table/src/emits.js +1 -1
  85. package/lib/table/src/emits.min.js +1 -1
  86. package/lib/table/src/footer.js +222 -183
  87. package/lib/table/src/footer.min.js +1 -1
  88. package/lib/table/src/header.js +188 -150
  89. package/lib/table/src/header.min.js +1 -1
  90. package/lib/table/src/props.js +5 -1
  91. package/lib/table/src/props.min.js +1 -1
  92. package/lib/table/src/table.js +380 -110
  93. package/lib/table/src/table.min.js +1 -1
  94. package/lib/table/src/util.js +10 -0
  95. package/lib/table/src/util.min.js +1 -1
  96. package/lib/table/style/style.css +33 -20
  97. package/lib/table/style/style.min.css +1 -1
  98. package/lib/ui/index.js +9 -4
  99. package/lib/ui/index.min.js +1 -1
  100. package/lib/ui/src/log.js +1 -1
  101. package/lib/ui/src/log.min.js +1 -1
  102. package/lib/vxe-table/style/style.css +33 -20
  103. package/lib/vxe-table/style/style.min.css +1 -1
  104. package/package.json +3 -3
  105. package/packages/locale/lang/en-US.ts +1 -0
  106. package/packages/locale/lang/es-ES.ts +1 -0
  107. package/packages/locale/lang/hu-HU.ts +1 -0
  108. package/packages/locale/lang/ja-JP.ts +1 -0
  109. package/packages/locale/lang/ko-KR.ts +1 -0
  110. package/packages/locale/lang/pt-BR.ts +1 -0
  111. package/packages/locale/lang/ru-RU.ts +1 -0
  112. package/packages/locale/lang/uk-UA.ts +1 -0
  113. package/packages/locale/lang/vi-VN.ts +1 -0
  114. package/packages/locale/lang/zh-CHT.ts +1 -0
  115. package/packages/locale/lang/zh-CN.ts +1 -0
  116. package/packages/table/module/custom/hook.ts +4 -0
  117. package/packages/table/module/edit/hook.ts +54 -34
  118. package/packages/table/module/filter/hook.ts +2 -3
  119. package/packages/table/module/keyboard/hook.ts +2 -2
  120. package/packages/table/src/body.ts +46 -31
  121. package/packages/table/src/cell.ts +140 -92
  122. package/packages/table/src/emits.ts +3 -0
  123. package/packages/table/src/footer.ts +189 -152
  124. package/packages/table/src/header.ts +157 -116
  125. package/packages/table/src/props.ts +5 -1
  126. package/packages/table/src/table.ts +358 -109
  127. package/packages/table/src/util.ts +10 -0
  128. package/packages/ui/index.ts +8 -3
  129. package/styles/components/table.scss +42 -35
  130. /package/es/{iconfont.1731633504443.ttf → iconfont.1731937248477.ttf} +0 -0
  131. /package/es/{iconfont.1731633504443.woff → iconfont.1731937248477.woff} +0 -0
  132. /package/es/{iconfont.1731633504443.woff2 → iconfont.1731937248477.woff2} +0 -0
  133. /package/lib/{iconfont.1731633504443.ttf → iconfont.1731937248477.ttf} +0 -0
  134. /package/lib/{iconfont.1731633504443.woff → iconfont.1731937248477.woff} +0 -0
  135. /package/lib/{iconfont.1731633504443.woff2 → iconfont.1731937248477.woff2} +0 -0
package/lib/index.umd.js CHANGED
@@ -1998,7 +1998,7 @@ function eqEmptyValue(cellValue) {
1998
1998
  ;// CONCATENATED MODULE: ./packages/ui/index.ts
1999
1999
 
2000
2000
 
2001
- const version = "4.8.16";
2001
+ const version = "4.9.1";
2002
2002
  core_.VxeUI.version = version;
2003
2003
  core_.VxeUI.tableVersion = version;
2004
2004
  core_.VxeUI.setConfig({
@@ -2035,8 +2035,11 @@ core_.VxeUI.setConfig({
2035
2035
  // trigger: 'default'
2036
2036
  strict: true
2037
2037
  },
2038
- dragConfig: {
2039
- showRowIcon: true
2038
+ rowDragConfig: {
2039
+ showIcon: true
2040
+ },
2041
+ columnDragConfig: {
2042
+ showIcon: true
2040
2043
  },
2041
2044
  checkboxConfig: {
2042
2045
  // trigger: 'default',
@@ -2133,7 +2136,8 @@ core_.VxeUI.setConfig({
2133
2136
  },
2134
2137
  areaConfig: {
2135
2138
  autoClear: true,
2136
- selectCellByHeader: true
2139
+ selectCellByHeader: true,
2140
+ selectCellByBody: true
2137
2141
  },
2138
2142
  clipConfig: {
2139
2143
  isCopy: true,
@@ -2230,6 +2234,7 @@ core_.VxeUI.setIcon({
2230
2234
  TABLE_CUSTOM_SORT: iconPrefix + 'drag-handle',
2231
2235
  TABLE_MENU_OPTIONS: iconPrefix + 'arrow-right',
2232
2236
  TABLE_DRAG_ROW: iconPrefix + 'drag-handle',
2237
+ TABLE_DRAG_COLUMN: iconPrefix + 'drag-handle',
2233
2238
  // toolbar
2234
2239
  TOOLBAR_TOOLS_REFRESH: iconPrefix + 'repeat',
2235
2240
  TOOLBAR_TOOLS_REFRESH_LOADING: iconPrefix + 'repeat roll',
@@ -2389,7 +2394,7 @@ var es_array_push = __webpack_require__(4114);
2389
2394
  const {
2390
2395
  log: log_log
2391
2396
  } = core_.VxeUI;
2392
- const log_version = `table v${"4.8.16"}`;
2397
+ const log_version = `table v${"4.9.1"}`;
2393
2398
  const warnLog = log_log.create('warn', log_version);
2394
2399
  const errLog = log_log.create('error', log_version);
2395
2400
  ;// CONCATENATED MODULE: ./packages/table/src/columnInfo.ts
@@ -2903,6 +2908,15 @@ function getCellValue(row, column) {
2903
2908
  function setCellValue(row, column, value) {
2904
2909
  return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().set(row, column.field, value);
2905
2910
  }
2911
+ function getRefElem(refEl) {
2912
+ if (refEl) {
2913
+ const rest = refEl.value;
2914
+ if (rest) {
2915
+ return rest.$el || rest;
2916
+ }
2917
+ }
2918
+ return null;
2919
+ }
2906
2920
  /**
2907
2921
  * 列宽拖动最大宽度
2908
2922
  * @param params
@@ -3331,15 +3345,18 @@ function renderTitlePrefixIcon(params) {
3331
3345
  column
3332
3346
  } = params;
3333
3347
  const titlePrefix = column.titlePrefix || column.titleHelp;
3334
- return titlePrefix ? [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('i', {
3335
- class: ['vxe-cell-title-prefix-icon', titlePrefix.icon || cell_getIcon().TABLE_TITLE_PREFIX],
3336
- onMouseenter(evnt) {
3337
- $table.triggerHeaderTitleEvent(evnt, titlePrefix, params);
3338
- },
3339
- onMouseleave(evnt) {
3340
- $table.handleTargetLeaveEvent(evnt);
3341
- }
3342
- })] : [];
3348
+ if (titlePrefix) {
3349
+ return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('i', {
3350
+ class: ['vxe-cell-title-prefix-icon', titlePrefix.icon || cell_getIcon().TABLE_TITLE_PREFIX],
3351
+ onMouseenter(evnt) {
3352
+ $table.triggerHeaderTitleEvent(evnt, titlePrefix, params);
3353
+ },
3354
+ onMouseleave(evnt) {
3355
+ $table.handleTargetLeaveEvent(evnt);
3356
+ }
3357
+ });
3358
+ }
3359
+ return renderEmptyElement($table);
3343
3360
  }
3344
3361
  function renderTitleSuffixIcon(params) {
3345
3362
  const {
@@ -3347,29 +3364,37 @@ function renderTitleSuffixIcon(params) {
3347
3364
  column
3348
3365
  } = params;
3349
3366
  const titleSuffix = column.titleSuffix;
3350
- return titleSuffix ? [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('i', {
3351
- class: ['vxe-cell-title-suffix-icon', titleSuffix.icon || cell_getIcon().TABLE_TITLE_SUFFIX],
3352
- onMouseenter(evnt) {
3353
- $table.triggerHeaderTitleEvent(evnt, titleSuffix, params);
3354
- },
3355
- onMouseleave(evnt) {
3356
- $table.handleTargetLeaveEvent(evnt);
3357
- }
3358
- })] : [];
3367
+ if (titleSuffix) {
3368
+ (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('i', {
3369
+ class: ['vxe-cell-title-suffix-icon', titleSuffix.icon || cell_getIcon().TABLE_TITLE_SUFFIX],
3370
+ onMouseenter(evnt) {
3371
+ $table.triggerHeaderTitleEvent(evnt, titleSuffix, params);
3372
+ },
3373
+ onMouseleave(evnt) {
3374
+ $table.handleTargetLeaveEvent(evnt);
3375
+ }
3376
+ });
3377
+ }
3378
+ return renderEmptyElement($table);
3359
3379
  }
3360
3380
  function renderCellDragIcon(params) {
3361
3381
  const {
3362
3382
  $table
3363
3383
  } = params;
3384
+ const tableProps = $table.props;
3385
+ const {
3386
+ dragConfig
3387
+ } = tableProps;
3364
3388
  const {
3365
- computeDragOpts
3389
+ computeRowDragOpts
3366
3390
  } = $table.getComputeMaps();
3367
- const dragOpts = computeDragOpts.value;
3391
+ const rowDragOpts = computeRowDragOpts.value;
3368
3392
  const {
3369
- rowIcon,
3370
- rowDisabledMethod
3371
- } = dragOpts;
3372
- const isDisabled = rowDisabledMethod && rowDisabledMethod(params);
3393
+ icon,
3394
+ disabledMethod
3395
+ } = rowDragOpts;
3396
+ const rDisabledMethod = disabledMethod || (dragConfig ? dragConfig.rowDisabledMethod : null);
3397
+ const isDisabled = rDisabledMethod && rDisabledMethod(params);
3373
3398
  return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('span', {
3374
3399
  key: 'dg',
3375
3400
  class: ['vxe-cell--drag-handle', {
@@ -3382,7 +3407,7 @@ function renderCellDragIcon(params) {
3382
3407
  },
3383
3408
  onMouseup: $table.handleCellDragMouseupEvent
3384
3409
  }, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('i', {
3385
- class: rowIcon || cell_getIcon().TABLE_DRAG_ROW
3410
+ class: icon || (dragConfig ? dragConfig.rowIcon : '') || cell_getIcon().TABLE_DRAG_ROW
3386
3411
  })]);
3387
3412
  }
3388
3413
  function renderCellBaseVNs(params, content) {
@@ -3396,26 +3421,70 @@ function renderCellBaseVNs(params, content) {
3396
3421
  } = column;
3397
3422
  const tableProps = $table.props;
3398
3423
  const {
3399
- treeConfig
3424
+ treeConfig,
3425
+ dragConfig
3400
3426
  } = tableProps;
3401
3427
  const {
3402
3428
  computeRowOpts,
3403
- computeDragOpts
3429
+ computeRowDragOpts
3404
3430
  } = $table.getComputeMaps();
3405
3431
  const rowOpts = computeRowOpts.value;
3406
- const dragOpts = computeDragOpts.value;
3432
+ const rowDragOpts = computeRowDragOpts.value;
3407
3433
  const {
3408
- showRowIcon,
3409
- rowVisibleMethod
3410
- } = dragOpts;
3434
+ showIcon,
3435
+ visibleMethod
3436
+ } = rowDragOpts;
3437
+ const rVisibleMethod = visibleMethod || (dragConfig ? dragConfig.rowVisibleMethod : null);
3411
3438
  const vns = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(content) ? content : [content];
3412
- if (dragSort && rowOpts.drag && showRowIcon && (!rowVisibleMethod || rowVisibleMethod(params))) {
3439
+ if (dragSort && rowOpts.drag && (showIcon || (dragConfig ? dragConfig.showRowIcon : false)) && (!rVisibleMethod || rVisibleMethod(params))) {
3413
3440
  if (!treeConfig || !level) {
3414
3441
  vns.unshift(renderCellDragIcon(params));
3415
3442
  }
3416
3443
  }
3417
3444
  return vns;
3418
3445
  }
3446
+ function renderHeaderCellDragIcon(params) {
3447
+ const {
3448
+ $table,
3449
+ column
3450
+ } = params;
3451
+ const {
3452
+ computeColumnOpts,
3453
+ computeColumnDragOpts
3454
+ } = $table.getComputeMaps();
3455
+ const columnOpts = computeColumnOpts.value;
3456
+ const columnDragOpts = computeColumnDragOpts.value;
3457
+ const {
3458
+ showIcon,
3459
+ icon,
3460
+ visibleMethod,
3461
+ disabledMethod
3462
+ } = columnDragOpts;
3463
+ const isDisabled = disabledMethod && disabledMethod(params);
3464
+ if (columnOpts.drag && showIcon && (!visibleMethod || visibleMethod(params))) {
3465
+ if (!(column.fixed || column.parentId)) {
3466
+ return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('span', {
3467
+ key: 'dg',
3468
+ class: ['vxe-cell--drag-handle', {
3469
+ 'is--disabled': isDisabled
3470
+ }],
3471
+ onMousedown(evnt) {
3472
+ if (!isDisabled) {
3473
+ $table.handleHeaderCellDragMousedownEvent(evnt, params);
3474
+ }
3475
+ },
3476
+ onMouseup: $table.handleHeaderCellDragMouseupEvent
3477
+ }, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('i', {
3478
+ class: icon || cell_getIcon().TABLE_DRAG_COLUMN
3479
+ })]);
3480
+ }
3481
+ }
3482
+ return renderEmptyElement($table);
3483
+ }
3484
+ function renderHeaderCellBaseVNs(params, content) {
3485
+ const vns = [renderTitlePrefixIcon(params), renderHeaderCellDragIcon(params), ...(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(content) ? content : [content]), renderTitleSuffixIcon(params)];
3486
+ return vns;
3487
+ }
3419
3488
  function renderTitleContent(params, content) {
3420
3489
  const {
3421
3490
  $table,
@@ -3609,7 +3678,7 @@ const Cell = {
3609
3678
  return createColumn($xeTable, columnOpts, renConfs);
3610
3679
  },
3611
3680
  /**
3612
- * 单元格
3681
+ * 列头标题
3613
3682
  */
3614
3683
  renderHeaderTitle(params) {
3615
3684
  const {
@@ -3638,7 +3707,7 @@ const Cell = {
3638
3707
  return renderTitleContent(params, formatText(column.getTitle(), 1));
3639
3708
  },
3640
3709
  renderDefaultHeader(params) {
3641
- return renderTitlePrefixIcon(params).concat(Cell.renderHeaderTitle(params)).concat(renderTitleSuffixIcon(params));
3710
+ return renderHeaderCellBaseVNs(params, Cell.renderHeaderTitle(params));
3642
3711
  },
3643
3712
  renderDefaultCell(params) {
3644
3713
  const {
@@ -3772,7 +3841,7 @@ const Cell = {
3772
3841
  }, cellVNodes)])];
3773
3842
  },
3774
3843
  /**
3775
- * 索引
3844
+ * 序号
3776
3845
  */
3777
3846
  renderSeqHeader(params) {
3778
3847
  const {
@@ -3783,7 +3852,7 @@ const Cell = {
3783
3852
  slots
3784
3853
  } = column;
3785
3854
  const headerSlot = slots ? slots.header : null;
3786
- return renderTitleContent(params, headerSlot ? $table.callSlot(headerSlot, params) : formatText(column.getTitle(), 1));
3855
+ return renderHeaderCellBaseVNs(params, renderTitleContent(params, headerSlot ? $table.callSlot(headerSlot, params) : formatText(column.getTitle(), 1)));
3787
3856
  },
3788
3857
  renderSeqCell(params) {
3789
3858
  const {
@@ -3829,9 +3898,9 @@ const Cell = {
3829
3898
  } = column;
3830
3899
  const headerSlot = slots ? slots.header : null;
3831
3900
  const titleSlot = slots ? slots.title : null;
3832
- return renderTitleContent(params, headerSlot ? $table.callSlot(headerSlot, params) : [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('span', {
3901
+ return renderHeaderCellBaseVNs(params, renderTitleContent(params, headerSlot ? $table.callSlot(headerSlot, params) : [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('span', {
3833
3902
  class: 'vxe-radio--label'
3834
- }, titleSlot ? $table.callSlot(titleSlot, params) : formatText(column.getTitle(), 1))]);
3903
+ }, titleSlot ? $table.callSlot(titleSlot, params) : formatText(column.getTitle(), 1))]));
3835
3904
  },
3836
3905
  renderRadioCell(params) {
3837
3906
  const {
@@ -3958,14 +4027,14 @@ const Cell = {
3958
4027
  indeterminate: isAllCheckboxIndeterminate
3959
4028
  };
3960
4029
  if (headerSlot) {
3961
- return renderTitleContent(checkboxParams, $table.callSlot(headerSlot, checkboxParams));
4030
+ return renderHeaderCellBaseVNs(params, renderTitleContent(checkboxParams, $table.callSlot(headerSlot, checkboxParams)));
3962
4031
  }
3963
4032
  if (checkboxOpts.checkStrictly ? !checkboxOpts.showHeader : checkboxOpts.showHeader === false) {
3964
- return renderTitleContent(checkboxParams, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('span', {
4033
+ return renderHeaderCellBaseVNs(params, renderTitleContent(checkboxParams, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('span', {
3965
4034
  class: 'vxe-checkbox--label'
3966
- }, titleSlot ? $table.callSlot(titleSlot, checkboxParams) : headerTitle)]);
4035
+ }, titleSlot ? $table.callSlot(titleSlot, checkboxParams) : headerTitle)]));
3967
4036
  }
3968
- return renderTitleContent(checkboxParams, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('span', {
4037
+ return renderHeaderCellBaseVNs(params, renderTitleContent(checkboxParams, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('span', {
3969
4038
  class: ['vxe-cell--checkbox', {
3970
4039
  'is--checked': isAllCheckboxSelected,
3971
4040
  'is--disabled': isAllCheckboxDisabled,
@@ -3977,7 +4046,7 @@ const Cell = {
3977
4046
  class: ['vxe-checkbox--icon', isAllCheckboxIndeterminate ? cell_getIcon().TABLE_CHECKBOX_INDETERMINATE : isAllCheckboxSelected ? cell_getIcon().TABLE_CHECKBOX_CHECKED : cell_getIcon().TABLE_CHECKBOX_UNCHECKED]
3978
4047
  })].concat(titleSlot || headerTitle ? [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('span', {
3979
4048
  class: 'vxe-checkbox--label'
3980
- }, titleSlot ? $table.callSlot(titleSlot, checkboxParams) : headerTitle)] : []))]);
4049
+ }, titleSlot ? $table.callSlot(titleSlot, checkboxParams) : headerTitle)] : []))]));
3981
4050
  },
3982
4051
  renderCheckboxCell(params) {
3983
4052
  const {
@@ -4275,13 +4344,13 @@ const Cell = {
4275
4344
  * 排序和筛选
4276
4345
  */
4277
4346
  renderSortAndFilterHeader(params) {
4278
- return Cell.renderDefaultHeader(params).concat(Cell.renderSortIcon(params)).concat(Cell.renderFilterIcon(params));
4347
+ return renderHeaderCellBaseVNs(params, Cell.renderHeaderTitle(params).concat(Cell.renderSortIcon(params).concat(Cell.renderFilterIcon(params))));
4279
4348
  },
4280
4349
  /**
4281
4350
  * 排序
4282
4351
  */
4283
4352
  renderSortHeader(params) {
4284
- return Cell.renderDefaultHeader(params).concat(Cell.renderSortIcon(params));
4353
+ return renderHeaderCellBaseVNs(params, Cell.renderHeaderTitle(params).concat(Cell.renderSortIcon(params)));
4285
4354
  },
4286
4355
  renderSortIcon(params) {
4287
4356
  const {
@@ -4330,7 +4399,7 @@ const Cell = {
4330
4399
  * 筛选
4331
4400
  */
4332
4401
  renderFilterHeader(params) {
4333
- return Cell.renderDefaultHeader(params).concat(Cell.renderFilterIcon(params));
4402
+ return renderHeaderCellBaseVNs(params, Cell.renderHeaderTitle(params).concat(Cell.renderFilterIcon(params)));
4334
4403
  },
4335
4404
  renderFilterIcon(params) {
4336
4405
  const {
@@ -4398,11 +4467,15 @@ const Cell = {
4398
4467
  isRequired = columnRules.some(rule => rule.required);
4399
4468
  }
4400
4469
  }
4401
- return (isEnableConf(editConfig) ? [isRequired && editOpts.showAsterisk ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('i', {
4402
- class: 'vxe-cell--required-icon'
4403
- }) : null, isEnableConf(editRender) && editOpts.showIcon ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('i', {
4404
- class: ['vxe-cell--edit-icon', editOpts.icon || cell_getIcon().TABLE_EDIT]
4405
- }) : null] : []).concat(Cell.renderDefaultHeader(params)).concat(sortable ? Cell.renderSortIcon(params) : []).concat(filters ? Cell.renderFilterIcon(params) : []);
4470
+ let editIconVNs = [];
4471
+ if (isEnableConf(editConfig)) {
4472
+ editIconVNs = [isRequired && editOpts.showAsterisk ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('i', {
4473
+ class: 'vxe-cell--required-icon'
4474
+ }) : renderEmptyElement($table), isEnableConf(editRender) && editOpts.showIcon ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('i', {
4475
+ class: ['vxe-cell--edit-icon', editOpts.icon || cell_getIcon().TABLE_EDIT]
4476
+ }) : renderEmptyElement($table)];
4477
+ }
4478
+ return renderHeaderCellBaseVNs(params, editIconVNs.concat(Cell.renderHeaderTitle(params)).concat(sortable ? Cell.renderSortIcon(params) : []).concat(filters ? Cell.renderFilterIcon(params) : []));
4406
4479
  },
4407
4480
  // 行格编辑模式
4408
4481
  renderRowEdit(params) {
@@ -5149,7 +5222,7 @@ const lineOffsetSizes = {
5149
5222
  'col--valid-error': !!errorValidItem,
5150
5223
  'col--current': currentColumn === column
5151
5224
  }, getPropClass(compCellClassName, params), getPropClass(className, params), getPropClass(allCellClassName, params)],
5152
- key: columnKey || columnOpts.useKey || rowOpts.useKey ? colid : $columnIndex,
5225
+ key: columnKey || columnOpts.useKey || rowOpts.useKey || columnOpts.drag ? colid : $columnIndex,
5153
5226
  ...attrs,
5154
5227
  style: Object.assign({
5155
5228
  height: cellHeight
@@ -5176,7 +5249,8 @@ const lineOffsetSizes = {
5176
5249
  expandColumn,
5177
5250
  selectRadioRow,
5178
5251
  pendingRowMaps,
5179
- pendingRowList
5252
+ pendingRowList,
5253
+ isDragColMove
5180
5254
  } = tableReactData;
5181
5255
  const {
5182
5256
  fullAllDataRowIdData
@@ -5186,6 +5260,7 @@ const lineOffsetSizes = {
5186
5260
  const treeOpts = computeTreeOpts.value;
5187
5261
  const editOpts = computeEditOpts.value;
5188
5262
  const rowOpts = computeRowOpts.value;
5263
+ const columnOpts = computeColumnOpts.value;
5189
5264
  const {
5190
5265
  transform
5191
5266
  } = treeOpts;
@@ -5256,24 +5331,36 @@ const lineOffsetSizes = {
5256
5331
  rowChildren = row[childrenField];
5257
5332
  isExpandTree = rowChildren && rowChildren.length > 0 && !!treeExpandedMaps[rowid];
5258
5333
  }
5259
- rows.push((0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('tr', {
5260
- class: ['vxe-body--row', treeConfig ? `row--level-${rowLevel}` : '', {
5261
- 'row--stripe': stripe && ($xeTable.getVTRowIndex(row) + 1) % 2 === 0,
5262
- 'is--new': isNewRow,
5263
- 'is--expand-row': isExpandRow,
5264
- 'is--expand-tree': isExpandTree,
5265
- 'row--new': isNewRow && (editOpts.showStatus || editOpts.showInsertStatus),
5266
- 'row--radio': radioOpts.highlight && $xeTable.eqRow(selectRadioRow, row),
5267
- 'row--checked': checkboxOpts.highlight && $xeTable.isCheckedByCheckboxRow(row),
5268
- 'row--pending': pendingRowList.length && !!pendingRowMaps[rowid]
5269
- }, getPropClass(rowClassName, params)],
5334
+ const trClass = ['vxe-body--row', treeConfig ? `row--level-${rowLevel}` : '', {
5335
+ 'row--stripe': stripe && ($xeTable.getVTRowIndex(row) + 1) % 2 === 0,
5336
+ 'is--new': isNewRow,
5337
+ 'is--expand-row': isExpandRow,
5338
+ 'is--expand-tree': isExpandTree,
5339
+ 'row--new': isNewRow && (editOpts.showStatus || editOpts.showInsertStatus),
5340
+ 'row--radio': radioOpts.highlight && $xeTable.eqRow(selectRadioRow, row),
5341
+ 'row--checked': checkboxOpts.highlight && $xeTable.isCheckedByCheckboxRow(row),
5342
+ 'row--pending': pendingRowList.length && !!pendingRowMaps[rowid]
5343
+ }, getPropClass(rowClassName, params)];
5344
+ const tdVNs = tableColumn.map((column, $columnIndex) => {
5345
+ return renderColumn(seq, rowid, fixedType, rowLevel, row, rowIndex, $rowIndex, _rowIndex, column, $columnIndex, tableColumn, tableData);
5346
+ });
5347
+ rows.push(columnOpts.drag ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)(external_commonjs_vue_commonjs2_vue_root_Vue_.TransitionGroup, {
5348
+ name: `vxe-header--col-list${isDragColMove ? '' : '-disabled'}`,
5349
+ tag: 'tr',
5350
+ class: trClass,
5270
5351
  rowid: rowid,
5271
5352
  style: rowStyle ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isFunction(rowStyle) ? rowStyle(params) : rowStyle : null,
5272
5353
  key: rowKey || rowOpts.useKey || rowOpts.drag || treeConfig ? rowid : $rowIndex,
5273
5354
  ...trOn
5274
- }, tableColumn.map((column, $columnIndex) => {
5275
- return renderColumn(seq, rowid, fixedType, rowLevel, row, rowIndex, $rowIndex, _rowIndex, column, $columnIndex, tableColumn, tableData);
5276
- })));
5355
+ }, {
5356
+ default: () => tdVNs
5357
+ }) : (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('tr', {
5358
+ class: trClass,
5359
+ rowid: rowid,
5360
+ style: rowStyle ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isFunction(rowStyle) ? rowStyle(params) : rowStyle : null,
5361
+ key: rowKey || rowOpts.useKey || rowOpts.drag || treeConfig ? rowid : $rowIndex,
5362
+ ...trOn
5363
+ }, tdVNs));
5277
5364
  // 如果行被展开了
5278
5365
  if (isExpandRow) {
5279
5366
  const expandOpts = computeExpandOpts.value;
@@ -5411,10 +5498,8 @@ const lineOffsetSizes = {
5411
5498
  const leftElem = leftBody ? leftBody.$el : null;
5412
5499
  const rightElem = rightBody ? rightBody.$el : null;
5413
5500
  const bodyElem = tableBody.$el;
5414
- const bodyYRef = elemStore['main-body-ySpace'];
5415
- const bodyYElem = bodyYRef ? bodyYRef.value : null;
5416
- const bodyXRef = elemStore['main-body-xSpace'];
5417
- const bodyXElem = bodyXRef ? bodyXRef.value : null;
5501
+ const bodyYElem = getRefElem(elemStore['main-body-ySpace']);
5502
+ const bodyXElem = getRefElem(elemStore['main-body-xSpace']);
5418
5503
  const bodyHeight = scrollYLoad && bodyYElem ? bodyYElem.clientHeight : bodyElem.clientHeight;
5419
5504
  const bodyWidth = scrollXLoad && bodyXElem ? bodyXElem.clientWidth : bodyElem.clientWidth;
5420
5505
  const remainSize = isPrevWheelTop === isTopWheel ? Math.max(0, wheelYSize - wheelYTotal) : 0;
@@ -5580,6 +5665,7 @@ const lineOffsetSizes = {
5580
5665
  const emptyOpts = computeEmptyOpts.value;
5581
5666
  const keyboardOpts = computeKeyboardOpts.value;
5582
5667
  const mouseOpts = computeMouseOpts.value;
5668
+ const columnOpts = computeColumnOpts.value;
5583
5669
  // const isMergeLeftFixedExceeded = computeIsMergeLeftFixedExceeded.value
5584
5670
  // const isMergeRightFixedExceeded = computeIsMergeRightFixedExceeded.value
5585
5671
  // 如果是使用优化模式
@@ -5657,7 +5743,8 @@ const lineOffsetSizes = {
5657
5743
  /**
5658
5744
  * 内容
5659
5745
  */
5660
- rowOpts.drag ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)(external_commonjs_vue_commonjs2_vue_root_Vue_.TransitionGroup, {
5746
+ rowOpts.drag || columnOpts.drag ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)(external_commonjs_vue_commonjs2_vue_root_Vue_.TransitionGroup, {
5747
+ ref: refBodyTBody,
5661
5748
  name: `vxe-body--row-list${isDragRowMove ? '' : '-disabled'}`,
5662
5749
  tag: 'tbody'
5663
5750
  }, {
@@ -5847,59 +5934,15 @@ const header_renderType = 'header';
5847
5934
  $xeTable.closeMenu();
5848
5935
  }
5849
5936
  };
5850
- (0,external_commonjs_vue_commonjs2_vue_root_Vue_.watch)(() => props.tableColumn, uploadColumn);
5851
- (0,external_commonjs_vue_commonjs2_vue_root_Vue_.onMounted)(() => {
5852
- (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)(() => {
5853
- const {
5854
- fixedType
5855
- } = props;
5856
- const {
5857
- internalData
5858
- } = $xeTable;
5859
- const {
5860
- elemStore
5861
- } = internalData;
5862
- const prefix = `${fixedType || 'main'}-header-`;
5863
- elemStore[`${prefix}wrapper`] = refElem;
5864
- elemStore[`${prefix}table`] = refHeaderTable;
5865
- elemStore[`${prefix}colgroup`] = refHeaderColgroup;
5866
- elemStore[`${prefix}list`] = refHeaderTHead;
5867
- elemStore[`${prefix}xSpace`] = refHeaderXSpace;
5868
- elemStore[`${prefix}repair`] = refHeaderBorderRepair;
5869
- uploadColumn();
5870
- });
5871
- });
5872
- (0,external_commonjs_vue_commonjs2_vue_root_Vue_.onUnmounted)(() => {
5937
+ const renderRows = (cols, $rowIndex) => {
5873
5938
  const {
5874
5939
  fixedType
5875
5940
  } = props;
5876
- const {
5877
- internalData
5878
- } = $xeTable;
5879
- const {
5880
- elemStore
5881
- } = internalData;
5882
- const prefix = `${fixedType || 'main'}-header-`;
5883
- elemStore[`${prefix}wrapper`] = null;
5884
- elemStore[`${prefix}table`] = null;
5885
- elemStore[`${prefix}colgroup`] = null;
5886
- elemStore[`${prefix}list`] = null;
5887
- elemStore[`${prefix}xSpace`] = null;
5888
- elemStore[`${prefix}repair`] = null;
5889
- });
5890
- const renderVN = () => {
5891
- const {
5892
- fixedType,
5893
- fixedColumn,
5894
- tableColumn
5895
- } = props;
5896
5941
  const {
5897
5942
  resizable: allResizable,
5898
5943
  border,
5899
5944
  columnKey,
5900
- headerRowClassName,
5901
5945
  headerCellClassName,
5902
- headerRowStyle,
5903
5946
  headerCellStyle,
5904
5947
  showHeaderOverflow: allColumnHeaderOverflow,
5905
5948
  headerAlign: allHeaderAlign,
@@ -5907,16 +5950,160 @@ const header_renderType = 'header';
5907
5950
  mouseConfig
5908
5951
  } = tableProps;
5909
5952
  const {
5910
- isGroup,
5911
5953
  currentColumn,
5912
5954
  scrollXLoad,
5913
5955
  overflowX,
5914
5956
  scrollbarWidth
5915
5957
  } = tableReactData;
5958
+ const columnOpts = computeColumnOpts.value;
5959
+ return cols.map((column, $columnIndex) => {
5960
+ const {
5961
+ type,
5962
+ showHeaderOverflow,
5963
+ headerAlign,
5964
+ align,
5965
+ headerClassName,
5966
+ editRender,
5967
+ cellRender
5968
+ } = column;
5969
+ const colid = column.id;
5970
+ const renderOpts = editRender || cellRender;
5971
+ const compConf = renderOpts ? header_renderer.get(renderOpts.name) : null;
5972
+ const isColGroup = column.children && column.children.length;
5973
+ const fixedHiddenColumn = fixedType ? column.fixed !== fixedType && !isColGroup : !!column.fixed && overflowX;
5974
+ const headOverflow = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eqNull(showHeaderOverflow) ? allColumnHeaderOverflow : showHeaderOverflow;
5975
+ const headAlign = headerAlign || (compConf ? compConf.tableHeaderCellAlign : '') || allHeaderAlign || align || (compConf ? compConf.tableCellAlign : '') || allAlign;
5976
+ let showEllipsis = headOverflow === 'ellipsis';
5977
+ const showTitle = headOverflow === 'title';
5978
+ const showTooltip = headOverflow === true || headOverflow === 'tooltip';
5979
+ let hasEllipsis = showTitle || showTooltip || showEllipsis;
5980
+ const hasFilter = column.filters && column.filters.some(item => item.checked);
5981
+ const columnIndex = $xeTable.getColumnIndex(column);
5982
+ const _columnIndex = $xeTable.getVTColumnIndex(column);
5983
+ const params = {
5984
+ $table: $xeTable,
5985
+ $grid: $xeTable.xegrid,
5986
+ $rowIndex,
5987
+ column,
5988
+ columnIndex,
5989
+ $columnIndex,
5990
+ _columnIndex,
5991
+ fixed: fixedType,
5992
+ type: header_renderType,
5993
+ isHidden: fixedHiddenColumn,
5994
+ hasFilter
5995
+ };
5996
+ const thOns = {
5997
+ onClick: evnt => $xeTable.triggerHeaderCellClickEvent(evnt, params),
5998
+ onDblclick: evnt => $xeTable.triggerHeaderCellDblclickEvent(evnt, params)
5999
+ };
6000
+ // 横向虚拟滚动不支持动态行高
6001
+ if (scrollXLoad && !hasEllipsis) {
6002
+ showEllipsis = hasEllipsis = true;
6003
+ }
6004
+ // 按下事件处理
6005
+ if (mouseConfig) {
6006
+ thOns.onMousedown = evnt => $xeTable.triggerHeaderCellMousedownEvent(evnt, params);
6007
+ }
6008
+ // 拖拽行事件
6009
+ if (columnOpts.drag && !column.parentId) {
6010
+ thOns.onDragstart = $xeTable.handleHeaderCellDragDragstartEvent;
6011
+ thOns.onDragend = $xeTable.handleHeaderCellDragDragendEvent;
6012
+ thOns.onDragover = $xeTable.handleHeaderCellDragDragoverEvent;
6013
+ }
6014
+ return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('th', {
6015
+ class: ['vxe-header--column', colid, {
6016
+ [`col--${headAlign}`]: headAlign,
6017
+ [`col--${type}`]: type,
6018
+ 'col--last': $columnIndex === cols.length - 1,
6019
+ 'col--fixed': column.fixed,
6020
+ 'col--group': isColGroup,
6021
+ 'col--ellipsis': hasEllipsis,
6022
+ 'fixed--hidden': fixedHiddenColumn,
6023
+ 'is--sortable': column.sortable,
6024
+ 'col--filter': !!column.filters,
6025
+ 'is--filter-active': hasFilter,
6026
+ 'col--current': currentColumn === column
6027
+ }, headerClassName ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isFunction(headerClassName) ? headerClassName(params) : headerClassName : '', headerCellClassName ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isFunction(headerCellClassName) ? headerCellClassName(params) : headerCellClassName : ''],
6028
+ colid,
6029
+ colspan: column.colSpan > 1 ? column.colSpan : null,
6030
+ rowspan: column.rowSpan > 1 ? column.rowSpan : null,
6031
+ style: headerCellStyle ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isFunction(headerCellStyle) ? headerCellStyle(params) : headerCellStyle : null,
6032
+ ...thOns,
6033
+ key: columnKey || columnOpts.useKey || columnOpts.drag || isColGroup ? colid : $columnIndex
6034
+ }, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
6035
+ class: ['vxe-cell', {
6036
+ 'c--title': showTitle,
6037
+ 'c--tooltip': showTooltip,
6038
+ 'c--ellipsis': showEllipsis
6039
+ }]
6040
+ }, column.renderHeader(params)),
6041
+ /**
6042
+ * 列宽拖动
6043
+ */
6044
+ !fixedHiddenColumn && !isColGroup && (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isBoolean(column.resizable) ? column.resizable : columnOpts.resizable || allResizable) ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
6045
+ class: ['vxe-resizable', {
6046
+ 'is--line': !border || border === 'none'
6047
+ }],
6048
+ onMousedown: evnt => resizeMousedown(evnt, params)
6049
+ }) : null]);
6050
+ }).concat(scrollbarWidth ? [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('th', {
6051
+ key: `gr${$rowIndex}`,
6052
+ class: 'vxe-header--gutter col--gutter'
6053
+ })] : []);
6054
+ };
6055
+ const renderHeads = headerGroups => {
6056
+ const {
6057
+ fixedType
6058
+ } = props;
6059
+ const {
6060
+ headerRowClassName,
6061
+ headerRowStyle
6062
+ } = tableProps;
6063
+ const {
6064
+ isDragColMove
6065
+ } = tableReactData;
6066
+ const columnOpts = computeColumnOpts.value;
6067
+ return headerGroups.map((cols, $rowIndex) => {
6068
+ const params = {
6069
+ $table: $xeTable,
6070
+ $rowIndex,
6071
+ fixed: fixedType,
6072
+ type: header_renderType
6073
+ };
6074
+ if (columnOpts.drag) {
6075
+ return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)(external_commonjs_vue_commonjs2_vue_root_Vue_.TransitionGroup, {
6076
+ name: `vxe-header--col-list${isDragColMove ? '' : '-disabled'}`,
6077
+ tag: 'tr',
6078
+ class: ['vxe-header--row', headerRowClassName ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isFunction(headerRowClassName) ? headerRowClassName(params) : headerRowClassName : ''],
6079
+ style: headerRowStyle ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isFunction(headerRowStyle) ? headerRowStyle(params) : headerRowStyle : null
6080
+ }, {
6081
+ default: () => renderRows(cols, $rowIndex)
6082
+ });
6083
+ }
6084
+ return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('tr', {
6085
+ class: ['vxe-header--row', headerRowClassName ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isFunction(headerRowClassName) ? headerRowClassName(params) : headerRowClassName : ''],
6086
+ style: headerRowStyle ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isFunction(headerRowStyle) ? headerRowStyle(params) : headerRowStyle : null
6087
+ }, renderRows(cols, $rowIndex));
6088
+ });
6089
+ };
6090
+ const renderVN = () => {
6091
+ const {
6092
+ fixedType,
6093
+ fixedColumn,
6094
+ tableColumn
6095
+ } = props;
6096
+ const {
6097
+ showHeaderOverflow: allColumnHeaderOverflow
6098
+ } = tableProps;
6099
+ const {
6100
+ isGroup,
6101
+ scrollXLoad,
6102
+ scrollbarWidth
6103
+ } = tableReactData;
5916
6104
  const {
5917
6105
  visibleColumn
5918
6106
  } = tableInternalData;
5919
- const columnOpts = computeColumnOpts.value;
5920
6107
  let headerGroups = headerColumn.value;
5921
6108
  let renderColumnList = tableColumn;
5922
6109
  if (isGroup) {
@@ -5963,109 +6150,7 @@ const header_renderType = 'header';
5963
6150
  */
5964
6151
  (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('thead', {
5965
6152
  ref: refHeaderTHead
5966
- }, headerGroups.map((cols, $rowIndex) => {
5967
- return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('tr', {
5968
- class: ['vxe-header--row', headerRowClassName ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isFunction(headerRowClassName) ? headerRowClassName({
5969
- $table: $xeTable,
5970
- $rowIndex,
5971
- fixed: fixedType,
5972
- type: header_renderType
5973
- }) : headerRowClassName : ''],
5974
- style: headerRowStyle ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isFunction(headerRowStyle) ? headerRowStyle({
5975
- $table: $xeTable,
5976
- $rowIndex,
5977
- fixed: fixedType,
5978
- type: header_renderType
5979
- }) : headerRowStyle : null
5980
- }, cols.map((column, $columnIndex) => {
5981
- const {
5982
- type,
5983
- showHeaderOverflow,
5984
- headerAlign,
5985
- align,
5986
- headerClassName,
5987
- editRender,
5988
- cellRender
5989
- } = column;
5990
- const colid = column.id;
5991
- const renderOpts = editRender || cellRender;
5992
- const compConf = renderOpts ? header_renderer.get(renderOpts.name) : null;
5993
- const isColGroup = column.children && column.children.length;
5994
- const fixedHiddenColumn = fixedType ? column.fixed !== fixedType && !isColGroup : !!column.fixed && overflowX;
5995
- const headOverflow = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eqNull(showHeaderOverflow) ? allColumnHeaderOverflow : showHeaderOverflow;
5996
- const headAlign = headerAlign || (compConf ? compConf.tableHeaderCellAlign : '') || allHeaderAlign || align || (compConf ? compConf.tableCellAlign : '') || allAlign;
5997
- let showEllipsis = headOverflow === 'ellipsis';
5998
- const showTitle = headOverflow === 'title';
5999
- const showTooltip = headOverflow === true || headOverflow === 'tooltip';
6000
- let hasEllipsis = showTitle || showTooltip || showEllipsis;
6001
- const hasFilter = column.filters && column.filters.some(item => item.checked);
6002
- const columnIndex = $xeTable.getColumnIndex(column);
6003
- const _columnIndex = $xeTable.getVTColumnIndex(column);
6004
- const params = {
6005
- $table: $xeTable,
6006
- $grid: $xeTable.xegrid,
6007
- $rowIndex,
6008
- column,
6009
- columnIndex,
6010
- $columnIndex,
6011
- _columnIndex,
6012
- fixed: fixedType,
6013
- type: header_renderType,
6014
- isHidden: fixedHiddenColumn,
6015
- hasFilter
6016
- };
6017
- const thOns = {
6018
- onClick: evnt => $xeTable.triggerHeaderCellClickEvent(evnt, params),
6019
- onDblclick: evnt => $xeTable.triggerHeaderCellDblclickEvent(evnt, params)
6020
- };
6021
- // 横向虚拟滚动不支持动态行高
6022
- if (scrollXLoad && !hasEllipsis) {
6023
- showEllipsis = hasEllipsis = true;
6024
- }
6025
- // 按下事件处理
6026
- if (mouseConfig) {
6027
- thOns.onMousedown = evnt => $xeTable.triggerHeaderCellMousedownEvent(evnt, params);
6028
- }
6029
- return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('th', {
6030
- class: ['vxe-header--column', colid, {
6031
- [`col--${headAlign}`]: headAlign,
6032
- [`col--${type}`]: type,
6033
- 'col--last': $columnIndex === cols.length - 1,
6034
- 'col--fixed': column.fixed,
6035
- 'col--group': isColGroup,
6036
- 'col--ellipsis': hasEllipsis,
6037
- 'fixed--hidden': fixedHiddenColumn,
6038
- 'is--sortable': column.sortable,
6039
- 'col--filter': !!column.filters,
6040
- 'is--filter-active': hasFilter,
6041
- 'col--current': currentColumn === column
6042
- }, headerClassName ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isFunction(headerClassName) ? headerClassName(params) : headerClassName : '', headerCellClassName ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isFunction(headerCellClassName) ? headerCellClassName(params) : headerCellClassName : ''],
6043
- colid,
6044
- colspan: column.colSpan > 1 ? column.colSpan : null,
6045
- rowspan: column.rowSpan > 1 ? column.rowSpan : null,
6046
- style: headerCellStyle ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isFunction(headerCellStyle) ? headerCellStyle(params) : headerCellStyle : null,
6047
- ...thOns,
6048
- key: columnKey || columnOpts.useKey || isColGroup ? colid : $columnIndex
6049
- }, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
6050
- class: ['vxe-cell', {
6051
- 'c--title': showTitle,
6052
- 'c--tooltip': showTooltip,
6053
- 'c--ellipsis': showEllipsis
6054
- }]
6055
- }, column.renderHeader(params)),
6056
- /**
6057
- * 列宽拖动
6058
- */
6059
- !fixedHiddenColumn && !isColGroup && (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isBoolean(column.resizable) ? column.resizable : columnOpts.resizable || allResizable) ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
6060
- class: ['vxe-resizable', {
6061
- 'is--line': !border || border === 'none'
6062
- }],
6063
- onMousedown: evnt => resizeMousedown(evnt, params)
6064
- }) : null]);
6065
- }).concat(scrollbarWidth ? [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('th', {
6066
- class: 'vxe-header--gutter col--gutter'
6067
- })] : []));
6068
- }))]),
6153
+ }, renderHeads(headerGroups))]),
6069
6154
  /**
6070
6155
  * 其他
6071
6156
  */
@@ -6074,6 +6159,46 @@ const header_renderType = 'header';
6074
6159
  class: 'vxe-table--header-border-line'
6075
6160
  })]);
6076
6161
  };
6162
+ (0,external_commonjs_vue_commonjs2_vue_root_Vue_.watch)(() => props.tableColumn, uploadColumn);
6163
+ (0,external_commonjs_vue_commonjs2_vue_root_Vue_.onMounted)(() => {
6164
+ (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)(() => {
6165
+ const {
6166
+ fixedType
6167
+ } = props;
6168
+ const {
6169
+ internalData
6170
+ } = $xeTable;
6171
+ const {
6172
+ elemStore
6173
+ } = internalData;
6174
+ const prefix = `${fixedType || 'main'}-header-`;
6175
+ elemStore[`${prefix}wrapper`] = refElem;
6176
+ elemStore[`${prefix}table`] = refHeaderTable;
6177
+ elemStore[`${prefix}colgroup`] = refHeaderColgroup;
6178
+ elemStore[`${prefix}list`] = refHeaderTHead;
6179
+ elemStore[`${prefix}xSpace`] = refHeaderXSpace;
6180
+ elemStore[`${prefix}repair`] = refHeaderBorderRepair;
6181
+ uploadColumn();
6182
+ });
6183
+ });
6184
+ (0,external_commonjs_vue_commonjs2_vue_root_Vue_.onUnmounted)(() => {
6185
+ const {
6186
+ fixedType
6187
+ } = props;
6188
+ const {
6189
+ internalData
6190
+ } = $xeTable;
6191
+ const {
6192
+ elemStore
6193
+ } = internalData;
6194
+ const prefix = `${fixedType || 'main'}-header-`;
6195
+ elemStore[`${prefix}wrapper`] = null;
6196
+ elemStore[`${prefix}table`] = null;
6197
+ elemStore[`${prefix}colgroup`] = null;
6198
+ elemStore[`${prefix}list`] = null;
6199
+ elemStore[`${prefix}xSpace`] = null;
6200
+ elemStore[`${prefix}repair`] = null;
6201
+ });
6077
6202
  return renderVN;
6078
6203
  }
6079
6204
  }));
@@ -6182,36 +6307,201 @@ function mergeFooterMethod(mergeFooterList, _rowIndex, _columnIndex) {
6182
6307
  });
6183
6308
  }
6184
6309
  };
6185
- (0,external_commonjs_vue_commonjs2_vue_root_Vue_.onMounted)(() => {
6186
- (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)(() => {
6187
- const {
6188
- fixedType
6189
- } = props;
6190
- const {
6191
- elemStore
6192
- } = tableInternalData;
6193
- const prefix = `${fixedType || 'main'}-footer-`;
6194
- elemStore[`${prefix}wrapper`] = refElem;
6195
- elemStore[`${prefix}table`] = refFooterTable;
6196
- elemStore[`${prefix}colgroup`] = refFooterColgroup;
6197
- elemStore[`${prefix}list`] = refFooterTFoot;
6198
- elemStore[`${prefix}xSpace`] = refFooterXSpace;
6199
- });
6200
- });
6201
- (0,external_commonjs_vue_commonjs2_vue_root_Vue_.onUnmounted)(() => {
6310
+ const renderRows = (tableColumn, footerTableData, row, $rowIndex, _rowIndex) => {
6202
6311
  const {
6203
6312
  fixedType
6204
6313
  } = props;
6205
6314
  const {
6206
- elemStore
6207
- } = tableInternalData;
6208
- const prefix = `${fixedType || 'main'}-footer-`;
6209
- elemStore[`${prefix}wrapper`] = null;
6210
- elemStore[`${prefix}table`] = null;
6211
- elemStore[`${prefix}colgroup`] = null;
6212
- elemStore[`${prefix}list`] = null;
6213
- elemStore[`${prefix}xSpace`] = null;
6214
- });
6315
+ footerCellClassName,
6316
+ footerCellStyle,
6317
+ footerAlign: allFooterAlign,
6318
+ footerSpanMethod,
6319
+ align: allAlign,
6320
+ columnKey,
6321
+ showFooterOverflow: allColumnFooterOverflow
6322
+ } = tableProps;
6323
+ const {
6324
+ scrollXLoad,
6325
+ overflowX,
6326
+ scrollbarWidth,
6327
+ currentColumn,
6328
+ mergeFooterList
6329
+ } = tableReactData;
6330
+ const tooltipOpts = computeTooltipOpts.value;
6331
+ const columnOpts = computeColumnOpts.value;
6332
+ return tableColumn.map((column, $columnIndex) => {
6333
+ const {
6334
+ type,
6335
+ showFooterOverflow,
6336
+ footerAlign,
6337
+ align,
6338
+ footerClassName,
6339
+ editRender,
6340
+ cellRender
6341
+ } = column;
6342
+ const renderOpts = editRender || cellRender;
6343
+ const compConf = renderOpts ? footer_renderer.get(renderOpts.name) : null;
6344
+ const showAllTip = tooltipOpts.showAll;
6345
+ const isColGroup = column.children && column.children.length;
6346
+ const fixedHiddenColumn = fixedType ? column.fixed !== fixedType && !isColGroup : column.fixed && overflowX;
6347
+ const footOverflow = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eqNull(showFooterOverflow) ? allColumnFooterOverflow : showFooterOverflow;
6348
+ const footAlign = footerAlign || (compConf ? compConf.tableFooterCellAlign : '') || allFooterAlign || align || (compConf ? compConf.tableCellAlign : '') || allAlign;
6349
+ let showEllipsis = footOverflow === 'ellipsis';
6350
+ const showTitle = footOverflow === 'title';
6351
+ const showTooltip = footOverflow === true || footOverflow === 'tooltip';
6352
+ let hasEllipsis = showTitle || showTooltip || showEllipsis;
6353
+ const attrs = {
6354
+ colid: column.id
6355
+ };
6356
+ const tfOns = {};
6357
+ const columnIndex = $xeTable.getColumnIndex(column);
6358
+ const _columnIndex = $xeTable.getVTColumnIndex(column);
6359
+ const itemIndex = _columnIndex;
6360
+ const cellParams = {
6361
+ $table: $xeTable,
6362
+ $grid: $xeTable.xegrid,
6363
+ row,
6364
+ rowIndex: _rowIndex,
6365
+ _rowIndex,
6366
+ $rowIndex,
6367
+ column,
6368
+ columnIndex,
6369
+ $columnIndex,
6370
+ _columnIndex,
6371
+ itemIndex,
6372
+ items: row,
6373
+ fixed: fixedType,
6374
+ type: footer_renderType,
6375
+ data: footerTableData
6376
+ };
6377
+ // 纵向虚拟滚动不支持动态行高
6378
+ if (scrollXLoad && !hasEllipsis) {
6379
+ showEllipsis = hasEllipsis = true;
6380
+ }
6381
+ if (showTitle || showTooltip || showAllTip) {
6382
+ tfOns.onMouseenter = evnt => {
6383
+ if (showTitle) {
6384
+ updateCellTitle(evnt.currentTarget, column);
6385
+ } else if (showTooltip || showAllTip) {
6386
+ $xeTable.triggerFooterTooltipEvent(evnt, cellParams);
6387
+ }
6388
+ };
6389
+ }
6390
+ if (showTooltip || showAllTip) {
6391
+ tfOns.onMouseleave = evnt => {
6392
+ if (showTooltip || showAllTip) {
6393
+ $xeTable.handleTargetLeaveEvent(evnt);
6394
+ }
6395
+ };
6396
+ }
6397
+ tfOns.onClick = evnt => {
6398
+ $xeTable.dispatchEvent('footer-cell-click', Object.assign({
6399
+ cell: evnt.currentTarget
6400
+ }, cellParams), evnt);
6401
+ };
6402
+ tfOns.onDblclick = evnt => {
6403
+ $xeTable.dispatchEvent('footer-cell-dblclick', Object.assign({
6404
+ cell: evnt.currentTarget
6405
+ }, cellParams), evnt);
6406
+ };
6407
+ // 合并行或列
6408
+ if (mergeFooterList.length) {
6409
+ const spanRest = mergeFooterMethod(mergeFooterList, _rowIndex, _columnIndex);
6410
+ if (spanRest) {
6411
+ const {
6412
+ rowspan,
6413
+ colspan
6414
+ } = spanRest;
6415
+ if (!rowspan || !colspan) {
6416
+ return null;
6417
+ }
6418
+ if (rowspan > 1) {
6419
+ attrs.rowspan = rowspan;
6420
+ }
6421
+ if (colspan > 1) {
6422
+ attrs.colspan = colspan;
6423
+ }
6424
+ }
6425
+ } else if (footerSpanMethod) {
6426
+ // 自定义合并方法
6427
+ const {
6428
+ rowspan = 1,
6429
+ colspan = 1
6430
+ } = footerSpanMethod(cellParams) || {};
6431
+ if (!rowspan || !colspan) {
6432
+ return null;
6433
+ }
6434
+ if (rowspan > 1) {
6435
+ attrs.rowspan = rowspan;
6436
+ }
6437
+ if (colspan > 1) {
6438
+ attrs.colspan = colspan;
6439
+ }
6440
+ }
6441
+ return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('td', {
6442
+ class: ['vxe-footer--column', column.id, {
6443
+ [`col--${footAlign}`]: footAlign,
6444
+ [`col--${type}`]: type,
6445
+ 'col--last': $columnIndex === tableColumn.length - 1,
6446
+ 'fixed--hidden': fixedHiddenColumn,
6447
+ 'col--ellipsis': hasEllipsis,
6448
+ 'col--current': currentColumn === column
6449
+ }, getPropClass(footerClassName, cellParams), getPropClass(footerCellClassName, cellParams)],
6450
+ ...attrs,
6451
+ style: footerCellStyle ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isFunction(footerCellStyle) ? footerCellStyle(cellParams) : footerCellStyle : null,
6452
+ ...tfOns,
6453
+ key: columnKey || columnOpts.useKey || columnOpts.drag ? column.id : $columnIndex
6454
+ }, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
6455
+ class: ['vxe-cell', {
6456
+ 'c--title': showTitle,
6457
+ 'c--tooltip': showTooltip,
6458
+ 'c--ellipsis': showEllipsis
6459
+ }]
6460
+ }, column.renderFooter(cellParams))]);
6461
+ }).concat(scrollbarWidth ? [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('td', {
6462
+ key: `gr${$rowIndex}`,
6463
+ class: 'vxe-footer--gutter col--gutter'
6464
+ })] : []);
6465
+ };
6466
+ const renderHeads = footerTableData => {
6467
+ const {
6468
+ fixedType,
6469
+ tableColumn
6470
+ } = props;
6471
+ const {
6472
+ footerRowClassName,
6473
+ footerRowStyle
6474
+ } = tableProps;
6475
+ const {
6476
+ isDragColMove
6477
+ } = tableReactData;
6478
+ const columnOpts = computeColumnOpts.value;
6479
+ return footerTableData.map((row, $rowIndex) => {
6480
+ const _rowIndex = $rowIndex;
6481
+ const rowParams = {
6482
+ $table: $xeTable,
6483
+ row,
6484
+ _rowIndex,
6485
+ $rowIndex,
6486
+ fixed: fixedType,
6487
+ type: footer_renderType
6488
+ };
6489
+ if (columnOpts.drag) {
6490
+ return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)(external_commonjs_vue_commonjs2_vue_root_Vue_.TransitionGroup, {
6491
+ name: `vxe-header--col-list${isDragColMove ? '' : '-disabled'}`,
6492
+ tag: 'tr',
6493
+ class: ['vxe-footer--row', footerRowClassName ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isFunction(footerRowClassName) ? footerRowClassName(rowParams) : footerRowClassName : ''],
6494
+ style: footerRowStyle ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isFunction(footerRowStyle) ? footerRowStyle(rowParams) : footerRowStyle : null
6495
+ }, {
6496
+ default: () => renderRows(tableColumn, footerTableData, row, $rowIndex, _rowIndex)
6497
+ });
6498
+ }
6499
+ return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('tr', {
6500
+ class: ['vxe-footer--row', footerRowClassName ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isFunction(footerRowClassName) ? footerRowClassName(rowParams) : footerRowClassName : ''],
6501
+ style: footerRowStyle ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isFunction(footerRowStyle) ? footerRowStyle(rowParams) : footerRowStyle : null
6502
+ }, renderRows(tableColumn, footerTableData, row, $rowIndex, _rowIndex));
6503
+ });
6504
+ };
6215
6505
  const renderVN = () => {
6216
6506
  let {
6217
6507
  fixedType,
@@ -6220,14 +6510,7 @@ function mergeFooterMethod(mergeFooterList, _rowIndex, _columnIndex) {
6220
6510
  footerTableData
6221
6511
  } = props;
6222
6512
  const {
6223
- footerRowClassName,
6224
- footerCellClassName,
6225
- footerRowStyle,
6226
- footerCellStyle,
6227
- footerAlign: allFooterAlign,
6228
6513
  footerSpanMethod,
6229
- align: allAlign,
6230
- columnKey,
6231
6514
  showFooterOverflow: allColumnFooterOverflow
6232
6515
  } = tableProps;
6233
6516
  const {
@@ -6235,13 +6518,9 @@ function mergeFooterMethod(mergeFooterList, _rowIndex, _columnIndex) {
6235
6518
  } = tableInternalData;
6236
6519
  const {
6237
6520
  scrollXLoad,
6238
- overflowX,
6239
6521
  scrollbarWidth,
6240
- currentColumn,
6241
6522
  mergeFooterList
6242
6523
  } = tableReactData;
6243
- const tooltipOpts = computeTooltipOpts.value;
6244
- const columnOpts = computeColumnOpts.value;
6245
6524
  // 如果是使用优化模式
6246
6525
  if (fixedType) {
6247
6526
  // 如果存在展开行使用全量渲染
@@ -6284,158 +6563,43 @@ function mergeFooterMethod(mergeFooterList, _rowIndex, _columnIndex) {
6284
6563
  }).concat(scrollbarWidth ? [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('col', {
6285
6564
  name: 'col_gutter'
6286
6565
  })] : [])),
6287
- /**
6288
- * 底部
6289
- */
6290
- (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('tfoot', {
6291
- ref: refFooterTFoot
6292
- }, footerTableData.map((list, _rowIndex) => {
6293
- const $rowIndex = _rowIndex;
6294
- const rowParams = {
6295
- $table: $xeTable,
6296
- row: list,
6297
- _rowIndex,
6298
- $rowIndex,
6299
- fixed: fixedType,
6300
- type: footer_renderType
6301
- };
6302
- return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('tr', {
6303
- class: ['vxe-footer--row', footerRowClassName ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isFunction(footerRowClassName) ? footerRowClassName(rowParams) : footerRowClassName : ''],
6304
- style: footerRowStyle ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isFunction(footerRowStyle) ? footerRowStyle(rowParams) : footerRowStyle : null
6305
- }, tableColumn.map((column, $columnIndex) => {
6306
- const {
6307
- type,
6308
- showFooterOverflow,
6309
- footerAlign,
6310
- align,
6311
- footerClassName,
6312
- editRender,
6313
- cellRender
6314
- } = column;
6315
- const renderOpts = editRender || cellRender;
6316
- const compConf = renderOpts ? footer_renderer.get(renderOpts.name) : null;
6317
- const showAllTip = tooltipOpts.showAll;
6318
- const isColGroup = column.children && column.children.length;
6319
- const fixedHiddenColumn = fixedType ? column.fixed !== fixedType && !isColGroup : column.fixed && overflowX;
6320
- const footOverflow = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eqNull(showFooterOverflow) ? allColumnFooterOverflow : showFooterOverflow;
6321
- const footAlign = footerAlign || (compConf ? compConf.tableFooterCellAlign : '') || allFooterAlign || align || (compConf ? compConf.tableCellAlign : '') || allAlign;
6322
- let showEllipsis = footOverflow === 'ellipsis';
6323
- const showTitle = footOverflow === 'title';
6324
- const showTooltip = footOverflow === true || footOverflow === 'tooltip';
6325
- let hasEllipsis = showTitle || showTooltip || showEllipsis;
6326
- const attrs = {
6327
- colid: column.id
6328
- };
6329
- const tfOns = {};
6330
- const columnIndex = $xeTable.getColumnIndex(column);
6331
- const _columnIndex = $xeTable.getVTColumnIndex(column);
6332
- const itemIndex = _columnIndex;
6333
- const cellParams = {
6334
- $table: $xeTable,
6335
- $grid: $xeTable.xegrid,
6336
- row: list,
6337
- rowIndex: _rowIndex,
6338
- _rowIndex,
6339
- $rowIndex,
6340
- column,
6341
- columnIndex,
6342
- $columnIndex,
6343
- _columnIndex,
6344
- itemIndex,
6345
- items: list,
6346
- fixed: fixedType,
6347
- type: footer_renderType,
6348
- data: footerTableData
6349
- };
6350
- // 纵向虚拟滚动不支持动态行高
6351
- if (scrollXLoad && !hasEllipsis) {
6352
- showEllipsis = hasEllipsis = true;
6353
- }
6354
- if (showTitle || showTooltip || showAllTip) {
6355
- tfOns.onMouseenter = evnt => {
6356
- if (showTitle) {
6357
- updateCellTitle(evnt.currentTarget, column);
6358
- } else if (showTooltip || showAllTip) {
6359
- $xeTable.triggerFooterTooltipEvent(evnt, cellParams);
6360
- }
6361
- };
6362
- }
6363
- if (showTooltip || showAllTip) {
6364
- tfOns.onMouseleave = evnt => {
6365
- if (showTooltip || showAllTip) {
6366
- $xeTable.handleTargetLeaveEvent(evnt);
6367
- }
6368
- };
6369
- }
6370
- tfOns.onClick = evnt => {
6371
- $xeTable.dispatchEvent('footer-cell-click', Object.assign({
6372
- cell: evnt.currentTarget
6373
- }, cellParams), evnt);
6374
- };
6375
- tfOns.onDblclick = evnt => {
6376
- $xeTable.dispatchEvent('footer-cell-dblclick', Object.assign({
6377
- cell: evnt.currentTarget
6378
- }, cellParams), evnt);
6379
- };
6380
- // 合并行或列
6381
- if (mergeFooterList.length) {
6382
- const spanRest = mergeFooterMethod(mergeFooterList, _rowIndex, _columnIndex);
6383
- if (spanRest) {
6384
- const {
6385
- rowspan,
6386
- colspan
6387
- } = spanRest;
6388
- if (!rowspan || !colspan) {
6389
- return null;
6390
- }
6391
- if (rowspan > 1) {
6392
- attrs.rowspan = rowspan;
6393
- }
6394
- if (colspan > 1) {
6395
- attrs.colspan = colspan;
6396
- }
6397
- }
6398
- } else if (footerSpanMethod) {
6399
- // 自定义合并方法
6400
- const {
6401
- rowspan = 1,
6402
- colspan = 1
6403
- } = footerSpanMethod(cellParams) || {};
6404
- if (!rowspan || !colspan) {
6405
- return null;
6406
- }
6407
- if (rowspan > 1) {
6408
- attrs.rowspan = rowspan;
6409
- }
6410
- if (colspan > 1) {
6411
- attrs.colspan = colspan;
6412
- }
6413
- }
6414
- return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('td', {
6415
- class: ['vxe-footer--column', column.id, {
6416
- [`col--${footAlign}`]: footAlign,
6417
- [`col--${type}`]: type,
6418
- 'col--last': $columnIndex === tableColumn.length - 1,
6419
- 'fixed--hidden': fixedHiddenColumn,
6420
- 'col--ellipsis': hasEllipsis,
6421
- 'col--current': currentColumn === column
6422
- }, getPropClass(footerClassName, cellParams), getPropClass(footerCellClassName, cellParams)],
6423
- ...attrs,
6424
- style: footerCellStyle ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isFunction(footerCellStyle) ? footerCellStyle(cellParams) : footerCellStyle : null,
6425
- ...tfOns,
6426
- key: columnKey || columnOpts.useKey ? column.id : $columnIndex
6427
- }, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
6428
- class: ['vxe-cell', {
6429
- 'c--title': showTitle,
6430
- 'c--tooltip': showTooltip,
6431
- 'c--ellipsis': showEllipsis
6432
- }]
6433
- }, column.renderFooter(cellParams))]);
6434
- }).concat(scrollbarWidth ? [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('td', {
6435
- class: 'vxe-footer--gutter col--gutter'
6436
- })] : []));
6437
- }))])]);
6566
+ /**
6567
+ * 底部
6568
+ */
6569
+ (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('tfoot', {
6570
+ ref: refFooterTFoot
6571
+ }, renderHeads(footerTableData))])]);
6438
6572
  };
6573
+ (0,external_commonjs_vue_commonjs2_vue_root_Vue_.onMounted)(() => {
6574
+ (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)(() => {
6575
+ const {
6576
+ fixedType
6577
+ } = props;
6578
+ const {
6579
+ elemStore
6580
+ } = tableInternalData;
6581
+ const prefix = `${fixedType || 'main'}-footer-`;
6582
+ elemStore[`${prefix}wrapper`] = refElem;
6583
+ elemStore[`${prefix}table`] = refFooterTable;
6584
+ elemStore[`${prefix}colgroup`] = refFooterColgroup;
6585
+ elemStore[`${prefix}list`] = refFooterTFoot;
6586
+ elemStore[`${prefix}xSpace`] = refFooterXSpace;
6587
+ });
6588
+ });
6589
+ (0,external_commonjs_vue_commonjs2_vue_root_Vue_.onUnmounted)(() => {
6590
+ const {
6591
+ fixedType
6592
+ } = props;
6593
+ const {
6594
+ elemStore
6595
+ } = tableInternalData;
6596
+ const prefix = `${fixedType || 'main'}-footer-`;
6597
+ elemStore[`${prefix}wrapper`] = null;
6598
+ elemStore[`${prefix}table`] = null;
6599
+ elemStore[`${prefix}colgroup`] = null;
6600
+ elemStore[`${prefix}list`] = null;
6601
+ elemStore[`${prefix}xSpace`] = null;
6602
+ });
6439
6603
  return renderVN;
6440
6604
  }
6441
6605
  }));
@@ -6624,8 +6788,12 @@ const {
6624
6788
  cellConfig: Object,
6625
6789
  // 行配置信息
6626
6790
  rowConfig: Object,
6627
- // 可拖拽配置项
6791
+ // 已废弃,被 rowDragConfig 替换
6628
6792
  dragConfig: Object,
6793
+ // 行拖拽排序配置项
6794
+ rowDragConfig: Object,
6795
+ // 列拖拽排序配置项
6796
+ columnDragConfig: Object,
6629
6797
  // 列调整配置项
6630
6798
  resizableConfig: Object,
6631
6799
  // 序号配置项
@@ -6692,7 +6860,7 @@ const {
6692
6860
  params: Object
6693
6861
  });
6694
6862
  ;// CONCATENATED MODULE: ./packages/table/src/emits.ts
6695
- /* harmony default export */ var emits = (['update:data', 'keydown-start', 'keydown', 'keydown-end', 'paste', 'copy', 'cut', 'current-change', 'radio-change', 'checkbox-change', 'checkbox-all', 'checkbox-range-start', 'checkbox-range-change', 'checkbox-range-end', 'checkbox-range-select', 'cell-click', 'cell-dblclick', 'cell-menu', 'cell-mouseenter', 'cell-mouseleave', 'cell-selected', 'cell-delete-value', 'cell-backspace-value', 'header-cell-click', 'header-cell-dblclick', 'header-cell-menu', 'footer-cell-click', 'footer-cell-dblclick', 'footer-cell-menu', 'clear-merge', 'sort-change', 'clear-sort', 'filter-change', 'filter-visible', 'clear-filter', 'resizable-change', 'toggle-row-expand', 'toggle-tree-expand', 'menu-click', 'edit-closed', 'row-dragstart', 'row-dragover', 'row-dragend', 'edit-actived', 'edit-activated', 'edit-disabled', 'valid-error', 'scroll', 'scroll-boundary', 'custom', 'change-fnr', 'open-fnr', 'show-fnr', 'hide-fnr', 'fnr-change', 'fnr-find', 'fnr-find-all', 'fnr-replace', 'fnr-replace-all', 'cell-area-copy', 'cell-area-cut', 'cell-area-paste', 'cell-area-merge', 'clear-cell-area-selection', 'clear-cell-area-merge', 'header-cell-area-selection', 'cell-area-selection-invalid', 'cell-area-selection-start', 'cell-area-selection-drag', 'cell-area-selection-end', 'cell-area-extension-start', 'cell-area-extension-drag', 'cell-area-extension-end', 'cell-area-selection-all-start', 'cell-area-selection-all-end', 'cell-area-arrows-start', 'cell-area-arrows-end', 'active-cell-change-start', 'active-cell-change-end']);
6863
+ /* harmony default export */ var emits = (['update:data', 'keydown-start', 'keydown', 'keydown-end', 'paste', 'copy', 'cut', 'current-change', 'radio-change', 'checkbox-change', 'checkbox-all', 'checkbox-range-start', 'checkbox-range-change', 'checkbox-range-end', 'checkbox-range-select', 'cell-click', 'cell-dblclick', 'cell-menu', 'cell-mouseenter', 'cell-mouseleave', 'cell-selected', 'cell-delete-value', 'cell-backspace-value', 'header-cell-click', 'header-cell-dblclick', 'header-cell-menu', 'footer-cell-click', 'footer-cell-dblclick', 'footer-cell-menu', 'clear-merge', 'sort-change', 'clear-sort', 'filter-change', 'filter-visible', 'clear-filter', 'resizable-change', 'toggle-row-expand', 'toggle-tree-expand', 'menu-click', 'edit-closed', 'row-dragstart', 'row-dragover', 'row-dragend', 'column-dragstart', 'column-dragover', 'column-dragend', 'edit-actived', 'edit-activated', 'edit-disabled', 'valid-error', 'scroll', 'scroll-boundary', 'custom', 'change-fnr', 'open-fnr', 'show-fnr', 'hide-fnr', 'fnr-change', 'fnr-find', 'fnr-find-all', 'fnr-replace', 'fnr-replace-all', 'cell-area-copy', 'cell-area-cut', 'cell-area-paste', 'cell-area-merge', 'clear-cell-area-selection', 'clear-cell-area-merge', 'header-cell-area-selection', 'cell-area-selection-invalid', 'cell-area-selection-start', 'cell-area-selection-drag', 'cell-area-selection-end', 'cell-area-extension-start', 'cell-area-extension-drag', 'cell-area-extension-end', 'cell-area-selection-all-start', 'cell-area-selection-all-end', 'cell-area-arrows-start', 'cell-area-arrows-end', 'active-cell-change-start', 'active-cell-change-end']);
6696
6864
  ;// CONCATENATED MODULE: ./packages/table/module/custom/panel.ts
6697
6865
 
6698
6866
 
@@ -8766,6 +8934,8 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
8766
8934
  scrollVMLoading: false,
8767
8935
  isDragRowMove: false,
8768
8936
  dragRow: null,
8937
+ isDragColMove: false,
8938
+ dragCol: null,
8769
8939
  dragTipText: '',
8770
8940
  _isResize: false,
8771
8941
  _isLoading: false
@@ -8869,7 +9039,9 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
8869
9039
  const refRightContainer = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)();
8870
9040
  const refCellResizeBar = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)();
8871
9041
  const refEmptyPlaceholder = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)();
8872
- const refRowDragTipElem = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)();
9042
+ const refDragTipElem = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)();
9043
+ const refDragRowLineElem = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)();
9044
+ const refDragColLineElem = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)();
8873
9045
  const refScrollXVirtualElem = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)();
8874
9046
  const refScrollYVirtualElem = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)();
8875
9047
  const refScrollXHandleElem = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)();
@@ -8939,8 +9111,11 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
8939
9111
  const computeRowOpts = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
8940
9112
  return Object.assign({}, table_getConfig().table.rowConfig, props.rowConfig);
8941
9113
  });
8942
- const computeDragOpts = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
8943
- return Object.assign({}, table_getConfig().table.dragConfig, props.dragConfig);
9114
+ const computeRowDragOpts = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
9115
+ return Object.assign({}, table_getConfig().table.rowDragConfig, props.rowDragConfig);
9116
+ });
9117
+ const computeColumnDragOpts = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
9118
+ return Object.assign({}, table_getConfig().table.columnDragConfig, props.columnDragConfig);
8944
9119
  });
8945
9120
  const computeResizeOpts = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
8946
9121
  return Object.assign({}, table_getConfig().table.resizeConfig, props.resizeConfig);
@@ -9189,7 +9364,8 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
9189
9364
  computeColumnOpts,
9190
9365
  computeCellOpts,
9191
9366
  computeRowOpts,
9192
- computeDragOpts,
9367
+ computeRowDragOpts,
9368
+ computeColumnDragOpts,
9193
9369
  computeResizeOpts,
9194
9370
  computeResizableOpts,
9195
9371
  computeSeqOpts,
@@ -10378,8 +10554,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
10378
10554
  const cellOffsetWidth = computeCellOffsetWidth.value;
10379
10555
  const mouseOpts = computeMouseOpts.value;
10380
10556
  const keyboardOpts = computeKeyboardOpts.value;
10381
- const bodyWrapperRef = elemStore['main-body-wrapper'];
10382
- const bodyWrapperElem = bodyWrapperRef ? bodyWrapperRef.value : null;
10557
+ const bodyWrapperElem = getRefElem(elemStore['main-body-wrapper']);
10383
10558
  if (emptyPlaceholderElem) {
10384
10559
  emptyPlaceholderElem.style.top = `${headerHeight}px`;
10385
10560
  emptyPlaceholderElem.style.height = bodyWrapperElem ? `${bodyWrapperElem.offsetHeight - scrollbarHeight}px` : '';
@@ -10424,10 +10599,8 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
10424
10599
  fixedWrapperElem = isFixedLeft ? refLeftContainer.value : refRightContainer.value;
10425
10600
  }
10426
10601
  layoutList.forEach(layout => {
10427
- const wrapperRef = elemStore[`${name}-${layout}-wrapper`];
10428
- const wrapperElem = wrapperRef ? wrapperRef.value : null;
10429
- const tableRef = elemStore[`${name}-${layout}-table`];
10430
- const tableElem = tableRef ? tableRef.value : null;
10602
+ const wrapperElem = getRefElem(elemStore[`${name}-${layout}-wrapper`]);
10603
+ const tableElem = getRefElem(elemStore[`${name}-${layout}-table`]);
10431
10604
  if (layout === 'header') {
10432
10605
  // 表头体样式处理
10433
10606
  // 横向滚动渲染
@@ -10447,13 +10620,11 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
10447
10620
  if (tableElem) {
10448
10621
  tableElem.style.width = tWidth ? `${tWidth + scrollbarWidth}px` : '';
10449
10622
  }
10450
- const repairRef = elemStore[`${name}-${layout}-repair`];
10451
- const repairElem = repairRef ? repairRef.value : null;
10623
+ const repairElem = getRefElem(elemStore[`${name}-${layout}-repair`]);
10452
10624
  if (repairElem) {
10453
10625
  repairElem.style.width = `${tableWidth}px`;
10454
10626
  }
10455
- const listRef = elemStore[`${name}-${layout}-list`];
10456
- const listElem = listRef ? listRef.value : null;
10627
+ const listElem = getRefElem(elemStore[`${name}-${layout}-list`]);
10457
10628
  if (isGroup && listElem) {
10458
10629
  external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().arrayEach(listElem.querySelectorAll('.col--group'), thElem => {
10459
10630
  const colNode = tableMethods.getColumnNode(thElem);
@@ -10484,8 +10655,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
10484
10655
  });
10485
10656
  }
10486
10657
  } else if (layout === 'body') {
10487
- const emptyBlockRef = elemStore[`${name}-${layout}-emptyBlock`];
10488
- const emptyBlockElem = emptyBlockRef ? emptyBlockRef.value : null;
10658
+ const emptyBlockElem = getRefElem(elemStore[`${name}-${layout}-emptyBlock`]);
10489
10659
  if (isNodeElement(wrapperElem)) {
10490
10660
  let bodyMaxHeight = 0;
10491
10661
  const bodyMinHeight = customMinHeight - headerHeight - footerHeight;
@@ -10573,8 +10743,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
10573
10743
  tableElem.style.width = tWidth ? `${tWidth + scrollbarWidth}px` : '';
10574
10744
  }
10575
10745
  }
10576
- const colgroupRef = elemStore[`${name}-${layout}-colgroup`];
10577
- const colgroupElem = colgroupRef ? colgroupRef.value : null;
10746
+ const colgroupElem = getRefElem(elemStore[`${name}-${layout}-colgroup`]);
10578
10747
  if (colgroupElem) {
10579
10748
  external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().arrayEach(colgroupElem.children, colElem => {
10580
10749
  const colid = colElem.getAttribute('name');
@@ -10602,8 +10771,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
10602
10771
  const showTitle = cellOverflow === 'title';
10603
10772
  const showTooltip = cellOverflow === true || cellOverflow === 'tooltip';
10604
10773
  let hasEllipsis = showTitle || showTooltip || showEllipsis;
10605
- const listRef = elemStore[`${name}-${layout}-list`];
10606
- const listElem = listRef ? listRef.value : null;
10774
+ const listElem = getRefElem(elemStore[`${name}-${layout}-list`]);
10607
10775
  // 纵向虚拟滚动不支持动态行高
10608
10776
  if (scrollYLoad && !hasEllipsis) {
10609
10777
  hasEllipsis = true;
@@ -11337,6 +11505,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
11337
11505
  editStore.removeMaps = {};
11338
11506
  const sYLoad = updateScrollYStatus(fullData);
11339
11507
  reactData.scrollYLoad = sYLoad;
11508
+ reactData.isDragRowMove = false;
11340
11509
  // 全量数据
11341
11510
  internalData.tableFullData = fullData;
11342
11511
  internalData.tableFullTreeData = treeData;
@@ -11622,6 +11791,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
11622
11791
  const tableFullColumn = getColumnList(collectColumn);
11623
11792
  internalData.tableFullColumn = tableFullColumn;
11624
11793
  reactData._isLoading = true;
11794
+ reactData.isDragColMove = false;
11625
11795
  initColumnSort();
11626
11796
  return Promise.resolve(restoreCustomStorage()).then(() => {
11627
11797
  reactData._isLoading = false;
@@ -14197,8 +14367,8 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
14197
14367
  mouseConfig
14198
14368
  } = props;
14199
14369
  const mouseOpts = computeMouseOpts.value;
14200
- if (mouseConfig && mouseOpts.area && $xeTable.handleUpdateCellAreas) {
14201
- return $xeTable.handleUpdateCellAreas();
14370
+ if (mouseConfig && mouseOpts.area && $xeTable.handleRecalculateCellAreas) {
14371
+ return $xeTable.handleRecalculateCellAreas();
14202
14372
  }
14203
14373
  return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();
14204
14374
  },
@@ -14408,7 +14578,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
14408
14578
  // 如果点击了当前表格之外
14409
14579
  !getEventTargetNode(evnt, el).flag) {
14410
14580
  setTimeout(() => {
14411
- $xeTable.clearEdit(evnt).then(() => {
14581
+ $xeTable.handleClearEdit(evnt).then(() => {
14412
14582
  // 如果存在校验,点击了表格之外则清除
14413
14583
  if (!internalData.isActivated && editRules && validOpts.autoClear) {
14414
14584
  reactData.validErrorMaps = {};
@@ -14496,8 +14666,8 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
14496
14666
  if (isEsc) {
14497
14667
  tablePrivateMethods.preventEvent(evnt, 'event.keydown', null, () => {
14498
14668
  dispatchEvent('keydown-start', {}, evnt);
14499
- if (keyboardConfig && mouseConfig && mouseOpts.area && $xeTable.handleKeyboardEvent) {
14500
- $xeTable.handleKeyboardEvent(evnt);
14669
+ if (keyboardConfig && mouseConfig && mouseOpts.area && $xeTable.handleKeyboardCellAreaEvent) {
14670
+ $xeTable.handleKeyboardCellAreaEvent(evnt);
14501
14671
  } else if (actived.row || filterStore.visible || ctxMenuStore.visible) {
14502
14672
  evnt.stopPropagation();
14503
14673
  // 如果按下了 Esc 键,关闭快捷菜单、筛选
@@ -14509,7 +14679,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
14509
14679
  // 如果是激活编辑状态,则取消编辑
14510
14680
  if (actived.row) {
14511
14681
  const params = actived.args;
14512
- $xeTable.clearEdit(evnt);
14682
+ $xeTable.handleClearEdit(evnt);
14513
14683
  // 如果配置了选中功能,则为选中状态
14514
14684
  if (mouseOpts.selected) {
14515
14685
  (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)(() => $xeTable.handleSelected(params, evnt));
@@ -14583,8 +14753,8 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
14583
14753
  } else {
14584
14754
  $xeTable.moveCtxMenu(evnt, ctxMenuStore, 'selected', isRightArrow, true, menuList);
14585
14755
  }
14586
- } else if (keyboardConfig && mouseConfig && mouseOpts.area && $xeTable.handleKeyboardEvent) {
14587
- $xeTable.handleKeyboardEvent(evnt);
14756
+ } else if (keyboardConfig && mouseConfig && mouseOpts.area && $xeTable.handleKeyboardCellAreaEvent) {
14757
+ $xeTable.handleKeyboardCellAreaEvent(evnt);
14588
14758
  } else if (isEsc) {
14589
14759
  // 如果按下了 Esc 键,关闭快捷菜单、筛选
14590
14760
  if ($xeTable.closeMenu) {
@@ -14595,7 +14765,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
14595
14765
  // 如果是激活编辑状态,则取消编辑
14596
14766
  if (actived.row) {
14597
14767
  const params = actived.args;
14598
- $xeTable.clearEdit(evnt);
14768
+ $xeTable.handleClearEdit(evnt);
14599
14769
  // 如果配置了选中功能,则为选中状态
14600
14770
  if (mouseOpts.selected) {
14601
14771
  (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)(() => $xeTable.handleSelected(params, evnt));
@@ -14631,7 +14801,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
14631
14801
  // 如果是激活编辑状态,则取消编辑
14632
14802
  if (actived.row) {
14633
14803
  const params = actived.args;
14634
- $xeTable.clearEdit(evnt);
14804
+ $xeTable.handleClearEdit(evnt);
14635
14805
  // 如果配置了选中功能,则为选中状态
14636
14806
  if (mouseOpts.selected) {
14637
14807
  (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)(() => $xeTable.handleSelected(params, evnt));
@@ -14881,8 +15051,8 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
14881
15051
  if (!el || !el.clientWidth) {
14882
15052
  return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();
14883
15053
  }
14884
- tableMethods.updateCellAreas();
14885
15054
  tableMethods.recalculate(true);
15055
+ tableMethods.updateCellAreas();
14886
15056
  };
14887
15057
  const handleTargetEnterEvent = isClear => {
14888
15058
  const $tooltip = refTooltip.value;
@@ -14915,65 +15085,120 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
14915
15085
  });
14916
15086
  }
14917
15087
  };
14918
- const clearRowDropTarget = () => {
15088
+ const updateRowDropTipContent = tdEl => {
15089
+ const {
15090
+ dragConfig
15091
+ } = props;
15092
+ const {
15093
+ dragRow
15094
+ } = reactData;
15095
+ const rowDragOpts = computeRowDragOpts.value;
15096
+ const {
15097
+ tooltipMethod
15098
+ } = rowDragOpts;
15099
+ const rTooltipMethod = tooltipMethod || (dragConfig ? dragConfig.rowTooltipMethod : null);
15100
+ let tipContent = '';
15101
+ if (rTooltipMethod) {
15102
+ tipContent = `${rTooltipMethod({
15103
+ row: dragRow
15104
+ }) || ''}`;
15105
+ } else {
15106
+ tipContent = table_getI18n('vxe.table.dragTip', [tdEl.textContent || '']);
15107
+ }
15108
+ reactData.dragTipText = tipContent;
15109
+ };
15110
+ const updateColDropOrigin = column => {
14919
15111
  const el = refElem.value;
14920
15112
  if (el) {
14921
- const clss = 'row--drag-active-target';
14922
- external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().arrayEach(el.querySelectorAll(`.${clss}`), elem => {
14923
- removeClass(elem, clss);
15113
+ const clss = 'col--drag-origin';
15114
+ external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().arrayEach(el.querySelectorAll(`[colid="${column.id}"]`), elem => {
15115
+ addClass(elem, clss);
14924
15116
  });
14925
15117
  }
14926
15118
  };
14927
- const updateRowDropTarget = (row, dragPos) => {
15119
+ const clearColDropOrigin = () => {
14928
15120
  const el = refElem.value;
14929
15121
  if (el) {
14930
- const clss = 'row--drag-active-target';
14931
- const rowid = getRowid($xeTable, row);
14932
- external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().arrayEach(el.querySelectorAll(`[rowid="${rowid}"]`), elem => {
14933
- addClass(elem, clss);
14934
- elem.setAttribute('drag-pos', dragPos);
15122
+ const clss = 'col--drag-origin';
15123
+ external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().arrayEach(el.querySelectorAll(`.${clss}`), elem => {
15124
+ elem.draggable = false;
15125
+ removeClass(elem, clss);
14935
15126
  });
14936
15127
  }
14937
15128
  };
14938
- const showRowDropTip = evnt => {
14939
- const rdTipEl = refRowDragTipElem.value;
14940
- if (!rdTipEl) {
14941
- return;
15129
+ const updateColDropTipContent = tdEl => {
15130
+ const {
15131
+ dragCol
15132
+ } = reactData;
15133
+ const columnDragOpts = computeColumnDragOpts.value;
15134
+ const {
15135
+ tooltipMethod
15136
+ } = columnDragOpts;
15137
+ let tipContent = '';
15138
+ if (tooltipMethod) {
15139
+ tipContent = `${tooltipMethod({
15140
+ column: dragCol
15141
+ }) || ''}`;
15142
+ } else {
15143
+ tipContent = table_getI18n('vxe.table.dragTip', [tdEl.textContent || '']);
14942
15144
  }
15145
+ reactData.dragTipText = tipContent;
15146
+ };
15147
+ const showDropTip = (evnt, trEl, thEl, dragPos) => {
14943
15148
  const el = refElem.value;
14944
15149
  if (!el) {
14945
15150
  return;
14946
15151
  }
15152
+ const {
15153
+ scrollbarWidth,
15154
+ scrollbarHeight
15155
+ } = reactData;
15156
+ const wrapperRect = el.getBoundingClientRect();
15157
+ if (trEl) {
15158
+ const rdLineEl = refDragRowLineElem.value;
15159
+ if (rdLineEl) {
15160
+ const trRect = trEl.getBoundingClientRect();
15161
+ let top = Math.max(1, trRect.y - wrapperRect.y);
15162
+ if (dragPos === 'bottom') {
15163
+ top = Math.min(wrapperRect.height - 1, trRect.y - wrapperRect.y + trRect.height);
15164
+ }
15165
+ rdLineEl.style.top = `${top}px`;
15166
+ rdLineEl.style.width = `${wrapperRect.width - scrollbarWidth}px`;
15167
+ rdLineEl.style.display = 'block';
15168
+ }
15169
+ } else if (thEl) {
15170
+ const cdLineEl = refDragColLineElem.value;
15171
+ if (cdLineEl) {
15172
+ const thRect = thEl.getBoundingClientRect();
15173
+ let left = Math.max(1, thRect.x - wrapperRect.x);
15174
+ if (dragPos === 'right') {
15175
+ left = Math.min(wrapperRect.width - 2, thRect.x - wrapperRect.x + thRect.width);
15176
+ }
15177
+ cdLineEl.style.left = `${left}px`;
15178
+ cdLineEl.style.height = `${wrapperRect.height - scrollbarHeight}px`;
15179
+ cdLineEl.style.display = 'block';
15180
+ }
15181
+ }
15182
+ const rdTipEl = refDragTipElem.value;
14947
15183
  if (rdTipEl) {
14948
- const wrapperRect = el.getBoundingClientRect();
14949
15184
  rdTipEl.style.display = 'block';
14950
15185
  rdTipEl.style.top = `${Math.min(el.clientHeight - el.scrollTop - rdTipEl.clientHeight, evnt.clientY - wrapperRect.y)}px`;
14951
15186
  rdTipEl.style.left = `${Math.min(el.clientWidth - el.scrollLeft - rdTipEl.clientWidth - 16, evnt.clientX - wrapperRect.x)}px`;
14952
15187
  }
14953
15188
  };
14954
- const hideRowDropTip = () => {
14955
- const rdTipEl = refRowDragTipElem.value;
15189
+ const hideDropTip = () => {
15190
+ const rdTipEl = refDragTipElem.value;
15191
+ const rdLineEl = refDragRowLineElem.value;
15192
+ const cdLineEl = refDragColLineElem.value;
14956
15193
  if (rdTipEl) {
14957
15194
  rdTipEl.style.display = '';
14958
15195
  }
14959
- };
14960
- const updateRowDropTipContent = tdEl => {
14961
- const {
14962
- dragRow
14963
- } = reactData;
14964
- const dragOpts = computeDragOpts.value;
14965
- const {
14966
- rowTooltipMethod
14967
- } = dragOpts;
14968
- let tipContent = '';
14969
- if (rowTooltipMethod) {
14970
- tipContent = `${rowTooltipMethod({
14971
- row: dragRow
14972
- }) || ''}`;
14973
- } else {
14974
- tipContent = table_getI18n('vxe.table.dragTip', [tdEl.textContent || '']);
15196
+ if (rdLineEl) {
15197
+ rdLineEl.style.display = '';
15198
+ }
15199
+ if (cdLineEl) {
15200
+ cdLineEl.style.display = '';
14975
15201
  }
14976
- reactData.dragTipText = tipContent;
14977
15202
  };
14978
15203
  /**
14979
15204
  * 处理显示 tooltip
@@ -16297,6 +16522,9 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
16297
16522
  dispatchEvent('sort-change', params, evnt);
16298
16523
  }
16299
16524
  },
16525
+ /**
16526
+ * 行拖拽
16527
+ */
16300
16528
  handleRowDragDragstartEvent(evnt) {
16301
16529
  const img = new Image();
16302
16530
  if (evnt.dataTransfer) {
@@ -16305,12 +16533,13 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
16305
16533
  },
16306
16534
  handleRowDragDragendEvent(evnt) {
16307
16535
  const {
16308
- treeConfig
16536
+ treeConfig,
16537
+ dragConfig
16309
16538
  } = props;
16310
- const dragOpts = computeDragOpts.value;
16539
+ const rowDragOpts = computeRowDragOpts.value;
16311
16540
  const {
16312
16541
  dragEndMethod
16313
- } = dragOpts;
16542
+ } = rowDragOpts;
16314
16543
  const treeOpts = computeTreeOpts.value;
16315
16544
  const {
16316
16545
  transform
@@ -16326,17 +16555,20 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
16326
16555
  prevDragRow,
16327
16556
  prevDragPos
16328
16557
  } = internalData;
16558
+ const dEndMethod = dragEndMethod || (dragConfig ? dragConfig.dragEndMethod : null);
16559
+ const dragOffsetIndex = prevDragPos === 'bottom' ? 1 : 0;
16329
16560
  if (prevDragRow && dragRow) {
16330
16561
  // 判断是否有拖动
16331
16562
  if (prevDragRow !== dragRow) {
16332
- Promise.resolve(dragEndMethod ? dragEndMethod({
16563
+ Promise.resolve(dEndMethod ? dEndMethod({
16333
16564
  oldRow: dragRow,
16334
- newRow: prevDragRow
16565
+ newRow: prevDragRow,
16566
+ dragPos: prevDragPos,
16567
+ offsetIndex: dragOffsetIndex
16335
16568
  }) : true).then(status => {
16336
16569
  if (!status) {
16337
16570
  return;
16338
16571
  }
16339
- const dragOffsetIndex = prevDragPos === 'bottom' ? 1 : 0;
16340
16572
  let oafIndex = -1;
16341
16573
  let nafIndex = -1;
16342
16574
  if (treeConfig) {
@@ -16345,7 +16577,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
16345
16577
  const otfIndex = $xeTable.findRowIndexOf(tableFullTreeData, dragRow);
16346
16578
  afterTreeFullData.splice(oafIndex, 1);
16347
16579
  tableFullTreeData.splice(otfIndex, 1);
16348
- // 插新位置
16580
+ // 插入新位置
16349
16581
  const pafIndex = $xeTable.findRowIndexOf(afterTreeFullData, prevDragRow);
16350
16582
  const ptfIndex = $xeTable.findRowIndexOf(tableFullTreeData, prevDragRow);
16351
16583
  nafIndex = pafIndex + dragOffsetIndex;
@@ -16358,7 +16590,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
16358
16590
  const otfIndex = $xeTable.findRowIndexOf(tableFullData, dragRow);
16359
16591
  afterFullData.splice(oafIndex, 1);
16360
16592
  tableFullData.splice(otfIndex, 1);
16361
- // 插新位置
16593
+ // 插入新位置
16362
16594
  const pafIndex = $xeTable.findRowIndexOf(afterFullData, prevDragRow);
16363
16595
  const ptfIndex = $xeTable.findRowIndexOf(tableFullData, prevDragRow);
16364
16596
  nafIndex = pafIndex + dragOffsetIndex;
@@ -16368,23 +16600,24 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
16368
16600
  }
16369
16601
  reactData.isDragRowMove = true;
16370
16602
  $xeTable.cacheRowMap();
16371
- $xeTable.updateScrollYStatus();
16603
+ updateScrollYStatus();
16372
16604
  $xeTable.handleTableData(treeConfig && transform);
16373
16605
  if (!(treeConfig && transform)) {
16374
16606
  $xeTable.updateAfterDataIndex();
16375
16607
  }
16376
- $xeTable.updateFooter();
16377
16608
  $xeTable.checkSelectionStatus();
16378
16609
  if (reactData.scrollYLoad) {
16379
16610
  $xeTable.updateScrollYSpace();
16380
16611
  }
16381
16612
  (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)().then(() => {
16382
16613
  $xeTable.updateCellAreas();
16383
- return $xeTable.recalculate();
16614
+ $xeTable.recalculate();
16384
16615
  });
16385
16616
  dispatchEvent('row-dragend', {
16386
16617
  oldRow: dragRow,
16387
16618
  newRow: prevDragRow,
16619
+ dragPos: prevDragPos,
16620
+ offsetIndex: dragOffsetIndex,
16388
16621
  _index: {
16389
16622
  newIndex: nafIndex,
16390
16623
  oldIndex: oafIndex
@@ -16393,19 +16626,25 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
16393
16626
  }).catch(() => {});
16394
16627
  }
16395
16628
  }
16396
- hideRowDropTip();
16629
+ hideDropTip();
16397
16630
  clearRowDropOrigin();
16398
- clearRowDropTarget();
16399
16631
  reactData.dragRow = null;
16632
+ reactData.dragCol = null;
16400
16633
  setTimeout(() => {
16401
16634
  reactData.isDragRowMove = false;
16402
16635
  }, 500);
16403
16636
  },
16404
16637
  handleRowDragDragoverEvent(evnt) {
16638
+ const {
16639
+ dragRow
16640
+ } = reactData;
16641
+ if (!dragRow) {
16642
+ evnt.preventDefault();
16643
+ return;
16644
+ }
16405
16645
  const trEl = evnt.currentTarget;
16406
16646
  const rowid = trEl.getAttribute('rowid');
16407
16647
  const row = $xeTable.getRowById(rowid);
16408
- clearRowDropTarget();
16409
16648
  if (row) {
16410
16649
  evnt.preventDefault();
16411
16650
  evnt.preventDefault();
@@ -16414,50 +16653,208 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
16414
16653
  } = reactData;
16415
16654
  const offsetY = evnt.clientY - trEl.getBoundingClientRect().y;
16416
16655
  const dragPos = offsetY < trEl.clientHeight / 2 ? 'top' : 'bottom';
16417
- updateRowDropTarget(row, dragPos);
16418
16656
  internalData.prevDragRow = row;
16419
16657
  internalData.prevDragPos = dragPos;
16658
+ showDropTip(evnt, trEl, null, dragPos);
16420
16659
  dispatchEvent('row-dragover', {
16421
16660
  oldRow: dragRow,
16422
16661
  targetRow: row,
16423
16662
  dragPos
16424
16663
  }, evnt);
16425
16664
  }
16426
- showRowDropTip(evnt);
16427
16665
  },
16428
16666
  handleCellDragMousedownEvent(evnt, params) {
16429
16667
  evnt.stopPropagation();
16430
- const dragOpts = computeDragOpts.value;
16668
+ const {
16669
+ dragConfig
16670
+ } = props;
16671
+ const rowDragOpts = computeRowDragOpts.value;
16431
16672
  const {
16432
16673
  dragStartMethod
16433
- } = dragOpts;
16674
+ } = rowDragOpts;
16434
16675
  const {
16435
16676
  row
16436
16677
  } = params;
16437
16678
  const dragEl = evnt.currentTarget;
16438
- const tdEl = dragEl.parentNode?.parentNode;
16439
- const trEl = tdEl.parentNode;
16679
+ const tdEl = dragEl.parentElement?.parentElement;
16680
+ const trEl = tdEl.parentElement;
16681
+ const dStartMethod = dragStartMethod || (dragConfig ? dragConfig.dragStartMethod : null);
16440
16682
  reactData.isDragRowMove = false;
16441
16683
  clearRowDropOrigin();
16442
- if (dragStartMethod && !dragStartMethod(params)) {
16684
+ if (dStartMethod && !dStartMethod(params)) {
16443
16685
  trEl.draggable = false;
16444
16686
  reactData.dragRow = null;
16445
- hideRowDropTip();
16687
+ reactData.dragCol = null;
16688
+ hideDropTip();
16446
16689
  return;
16447
16690
  }
16448
16691
  reactData.dragRow = row;
16692
+ reactData.dragCol = null;
16449
16693
  trEl.draggable = true;
16450
16694
  updateRowDropOrigin(row);
16451
- showRowDropTip(evnt);
16452
16695
  updateRowDropTipContent(tdEl);
16453
16696
  dispatchEvent('row-dragstart', params, evnt);
16454
16697
  },
16455
16698
  handleCellDragMouseupEvent() {
16456
16699
  clearRowDropOrigin();
16457
- hideRowDropTip();
16700
+ hideDropTip();
16458
16701
  reactData.dragRow = null;
16702
+ reactData.dragCol = null;
16459
16703
  reactData.isDragRowMove = false;
16460
16704
  },
16705
+ /**
16706
+ * 列拖拽
16707
+ */
16708
+ handleHeaderCellDragDragstartEvent(evnt) {
16709
+ const img = new Image();
16710
+ if (evnt.dataTransfer) {
16711
+ evnt.dataTransfer.setDragImage(img, 0, 0);
16712
+ }
16713
+ },
16714
+ handleHeaderCellDragDragendEvent(evnt) {
16715
+ const {
16716
+ mouseConfig
16717
+ } = props;
16718
+ const columnDragOpts = computeColumnDragOpts.value;
16719
+ const {
16720
+ dragEndMethod
16721
+ } = columnDragOpts;
16722
+ const {
16723
+ dragCol
16724
+ } = reactData;
16725
+ const {
16726
+ collectColumn,
16727
+ prevDragCol,
16728
+ prevDragPos
16729
+ } = internalData;
16730
+ const dragOffsetIndex = prevDragPos === 'right' ? 1 : 0;
16731
+ if (prevDragCol && dragCol) {
16732
+ // 判断是否有拖动
16733
+ if (prevDragCol !== dragCol) {
16734
+ Promise.resolve(dragEndMethod ? dragEndMethod({
16735
+ oldColumn: dragCol,
16736
+ newColumn: prevDragCol,
16737
+ dragPos: prevDragPos,
16738
+ offsetIndex: dragOffsetIndex
16739
+ }) : true).then(status => {
16740
+ if (!status) {
16741
+ return;
16742
+ }
16743
+ external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(collectColumn, (column, index, items, path, parent) => {
16744
+ if (!parent) {
16745
+ const sortIndex = index + 1;
16746
+ column.renderSortNumber = sortIndex;
16747
+ }
16748
+ });
16749
+ const oafIndex = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().findIndexOf(collectColumn, item => item.id === dragCol.id);
16750
+ const nafIndex = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().findIndexOf(collectColumn, item => item.id === prevDragCol.id) + dragOffsetIndex;
16751
+ const newTargetCol = collectColumn[nafIndex];
16752
+ if (newTargetCol) {
16753
+ // 插入最后位置
16754
+ dragCol.renderSortNumber = newTargetCol.renderSortNumber;
16755
+ newTargetCol.renderSortNumber = dragCol.renderSortNumber + 0.5;
16756
+ } else {
16757
+ // 插入新位置
16758
+ dragCol.renderSortNumber = collectColumn.length + 1.5;
16759
+ }
16760
+ reactData.isDragColMove = true;
16761
+ if (mouseConfig) {
16762
+ if ($xeTable.clearSelected) {
16763
+ $xeTable.clearSelected();
16764
+ }
16765
+ if ($xeTable.clearCellAreas) {
16766
+ $xeTable.clearCellAreas();
16767
+ $xeTable.clearCopyCellArea();
16768
+ }
16769
+ }
16770
+ tablePrivateMethods.analyColumnWidth();
16771
+ (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)().then(() => {
16772
+ $xeTable.updateCellAreas();
16773
+ tableMethods.refreshColumn(true);
16774
+ });
16775
+ dispatchEvent('column-dragend', {
16776
+ oldColumn: dragCol,
16777
+ newColumn: prevDragCol,
16778
+ dragPos: prevDragPos,
16779
+ offsetIndex: dragOffsetIndex,
16780
+ _index: {
16781
+ newIndex: nafIndex,
16782
+ oldIndex: oafIndex
16783
+ }
16784
+ }, evnt);
16785
+ }).catch(() => {});
16786
+ }
16787
+ }
16788
+ hideDropTip();
16789
+ clearColDropOrigin();
16790
+ reactData.dragRow = null;
16791
+ reactData.dragCol = null;
16792
+ setTimeout(() => {
16793
+ reactData.isDragColMove = false;
16794
+ }, 500);
16795
+ },
16796
+ handleHeaderCellDragDragoverEvent(evnt) {
16797
+ const {
16798
+ dragCol
16799
+ } = reactData;
16800
+ if (!dragCol) {
16801
+ evnt.preventDefault();
16802
+ return;
16803
+ }
16804
+ const thEl = evnt.currentTarget;
16805
+ const colid = thEl.getAttribute('colid');
16806
+ const column = $xeTable.getColumnById(colid);
16807
+ if (column) {
16808
+ evnt.preventDefault();
16809
+ const {
16810
+ dragCol
16811
+ } = reactData;
16812
+ const offsetX = evnt.clientX - thEl.getBoundingClientRect().x;
16813
+ const dragPos = offsetX < thEl.clientWidth / 2 ? 'left' : 'right';
16814
+ internalData.prevDragCol = column;
16815
+ internalData.prevDragPos = dragPos;
16816
+ showDropTip(evnt, null, thEl, dragPos);
16817
+ dispatchEvent('column-dragover', {
16818
+ oldColumn: dragCol,
16819
+ targetColumn: column,
16820
+ dragPos
16821
+ }, evnt);
16822
+ }
16823
+ },
16824
+ handleHeaderCellDragMousedownEvent(evnt, params) {
16825
+ evnt.stopPropagation();
16826
+ const columnDragOpts = computeColumnDragOpts.value;
16827
+ const {
16828
+ dragStartMethod
16829
+ } = columnDragOpts;
16830
+ const {
16831
+ column
16832
+ } = params;
16833
+ const dragEl = evnt.currentTarget;
16834
+ const thEl = dragEl.parentElement?.parentElement;
16835
+ reactData.isDragColMove = false;
16836
+ clearColDropOrigin();
16837
+ if (dragStartMethod && !dragStartMethod(params)) {
16838
+ thEl.draggable = false;
16839
+ reactData.dragRow = null;
16840
+ reactData.dragCol = null;
16841
+ hideDropTip();
16842
+ return;
16843
+ }
16844
+ reactData.dragCol = column;
16845
+ reactData.dragRow = null;
16846
+ thEl.draggable = true;
16847
+ updateColDropOrigin(column);
16848
+ updateColDropTipContent(thEl);
16849
+ dispatchEvent('column-dragstart', params, evnt);
16850
+ },
16851
+ handleHeaderCellDragMouseupEvent() {
16852
+ clearColDropOrigin();
16853
+ hideDropTip();
16854
+ reactData.dragRow = null;
16855
+ reactData.dragCol = null;
16856
+ reactData.isDragColMove = false;
16857
+ },
16461
16858
  /**
16462
16859
  * 横向 X 可视渲染事件处理
16463
16860
  */
@@ -16650,8 +17047,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
16650
17047
  containerList.forEach(name => {
16651
17048
  const layoutList = ['header', 'body', 'footer'];
16652
17049
  layoutList.forEach(layout => {
16653
- const xSpaceRef = elemStore[`${name}-${layout}-xSpace`];
16654
- const xSpaceElem = xSpaceRef ? xSpaceRef.value : null;
17050
+ const xSpaceElem = getRefElem(elemStore[`${name}-${layout}-xSpace`]);
16655
17051
  if (xSpaceElem) {
16656
17052
  xSpaceElem.style.width = scrollXLoad ? `${tableWidth + (layout === 'header' ? scrollbarWidth : 0)}px` : '';
16657
17053
  }
@@ -16714,14 +17110,12 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
16714
17110
  }
16715
17111
  containerList.forEach(name => {
16716
17112
  const layoutList = ['header', 'body', 'footer'];
16717
- const tableRef = elemStore[`${name}-body-table`];
16718
- const tableElem = tableRef ? tableRef.value : null;
17113
+ const tableElem = getRefElem(elemStore[`${name}-body-table`]);
16719
17114
  if (tableElem) {
16720
17115
  tableElem.style.marginTop = marginTop;
16721
17116
  }
16722
17117
  layoutList.forEach(layout => {
16723
- const ySpaceRef = elemStore[`${name}-${layout}-ySpace`];
16724
- const ySpaceElem = ySpaceRef ? ySpaceRef.value : null;
17118
+ const ySpaceElem = getRefElem(elemStore[`${name}-${layout}-ySpace`]);
16725
17119
  if (ySpaceElem) {
16726
17120
  ySpaceElem.style.height = ySpaceHeight;
16727
17121
  }
@@ -16901,6 +17295,52 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
16901
17295
  }
16902
17296
  return getFuncText(props.emptyText) || table_getI18n('vxe.table.emptyText');
16903
17297
  };
17298
+ const renderDragTipContents = () => {
17299
+ const {
17300
+ dragConfig
17301
+ } = props;
17302
+ const {
17303
+ dragRow,
17304
+ dragCol,
17305
+ dragTipText
17306
+ } = reactData;
17307
+ const columnDragOpts = computeColumnDragOpts.value;
17308
+ const rowDragOpts = computeRowDragOpts.value;
17309
+ const rowDragSlots = rowDragOpts.slots || {};
17310
+ const rTipSlot = rowDragSlots.tip || (dragConfig && dragConfig.slots ? dragConfig.slots.rowTip : null);
17311
+ const columnDragSlots = columnDragOpts.slots || {};
17312
+ const cTipSlot = columnDragSlots.tip;
17313
+ if (dragRow && rTipSlot) {
17314
+ return callSlot(rTipSlot, {
17315
+ row: dragRow
17316
+ });
17317
+ }
17318
+ if (dragCol && cTipSlot) {
17319
+ return callSlot(cTipSlot, {
17320
+ column: dragCol
17321
+ });
17322
+ }
17323
+ return [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('span', dragTipText)];
17324
+ };
17325
+ const renderDragTip = () => {
17326
+ const rowOpts = computeRowOpts.value;
17327
+ const columnOpts = computeColumnOpts.value;
17328
+ if (rowOpts.drag || columnOpts.drag) {
17329
+ return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
17330
+ class: 'vxe-table--drag-wrapper'
17331
+ }, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
17332
+ ref: refDragRowLineElem,
17333
+ class: 'vxe-table--drag-row-line'
17334
+ }), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
17335
+ ref: refDragColLineElem,
17336
+ class: 'vxe-table--drag-col-line'
17337
+ }), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
17338
+ ref: refDragTipElem,
17339
+ class: 'vxe-table--drag-sort-tip'
17340
+ }, renderDragTipContents())]);
17341
+ }
17342
+ return table_renderEmptyElement($xeTable);
17343
+ };
16904
17344
  function handleUupdateResize() {
16905
17345
  const el = refElem.value;
16906
17346
  if (el && el.clientWidth && el.clientHeight) {
@@ -16938,9 +17378,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
16938
17378
  columnStore,
16939
17379
  filterStore,
16940
17380
  customStore,
16941
- tooltipStore,
16942
- dragRow,
16943
- dragTipText
17381
+ tooltipStore
16944
17382
  } = reactData;
16945
17383
  const {
16946
17384
  leftList,
@@ -16952,18 +17390,17 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
16952
17390
  const checkboxOpts = computeCheckboxOpts.value;
16953
17391
  const treeOpts = computeTreeOpts.value;
16954
17392
  const rowOpts = computeRowOpts.value;
16955
- const dragOpts = computeDragOpts.value;
16956
17393
  const columnOpts = computeColumnOpts.value;
16957
17394
  const vSize = computeSize.value;
16958
17395
  const tableBorder = computeTableBorder.value;
16959
17396
  const mouseOpts = computeMouseOpts.value;
17397
+ const areaOpts = computeAreaOpts.value;
16960
17398
  const validTipOpts = computeValidTipOpts.value;
16961
17399
  const loadingOpts = computeLoadingOpts.value;
16962
17400
  const isMenu = computeIsMenu.value;
16963
17401
  const currLoading = reactData._isLoading || loading;
16964
17402
  const virtualScrollBars = computeVirtualScrollBars.value;
16965
- const dragSlots = dragOpts.slots || {};
16966
- const rowTipSlot = dragSlots.rowTip;
17403
+ const isArea = mouseConfig && mouseOpts.area;
16967
17404
  return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
16968
17405
  ref: refElem,
16969
17406
  class: ['vxe-table', 'vxe-table--render-default', `tid_${xID}`, `border--${tableBorder}`, {
@@ -16973,7 +17410,9 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
16973
17410
  'old-cell-valid': editRules && table_getConfig().cellVaildMode === 'obsolete',
16974
17411
  'cell--highlight': highlightCell,
16975
17412
  'cell--selected': mouseConfig && mouseOpts.selected,
16976
- 'cell--area': mouseConfig && mouseOpts.area,
17413
+ 'cell--area': isArea,
17414
+ 'header-cell--area': isArea && areaOpts.selectCellByHeader,
17415
+ 'body-cell--area': isArea && areaOpts.selectCellByBody,
16977
17416
  'row--highlight': rowOpts.isHover || highlightHoverRow,
16978
17417
  'column--highlight': columnOpts.isHover || highlightHoverColumn,
16979
17418
  'checkbox--range': checkboxOpts.range,
@@ -17141,14 +17580,9 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
17141
17580
  ref: refTableMenu
17142
17581
  }) : table_renderEmptyElement($xeTable),
17143
17582
  /**
17144
- * 拖拽提示
17583
+ * 拖拽排序提示
17145
17584
  */
17146
- rowOpts.drag && (dragRow || dragTipText) ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
17147
- ref: refRowDragTipElem,
17148
- class: 'vxe-table--row-drag-tip'
17149
- }, rowTipSlot ? dragRow ? callSlot(rowTipSlot, {
17150
- row: dragRow
17151
- }) : [table_renderEmptyElement($xeTable)] : dragTipText ? [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('span', dragTipText)] : [table_renderEmptyElement($xeTable)]) : table_renderEmptyElement($xeTable),
17585
+ renderDragTip(),
17152
17586
  /**
17153
17587
  * 提示相关
17154
17588
  */
@@ -17429,7 +17863,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
17429
17863
  if (rowOpts.height && !props.showOverflow) {
17430
17864
  warnLog('vxe.error.notProp', ['table.show-overflow']);
17431
17865
  }
17432
- if (!$xeTable.handleUpdateCellAreas) {
17866
+ if (!$xeTable.handleRecalculateCellAreas) {
17433
17867
  if (props.clipConfig) {
17434
17868
  warnLog('vxe.error.notProp', ['clip-config']);
17435
17869
  }
@@ -17441,6 +17875,9 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
17441
17875
  return;
17442
17876
  }
17443
17877
  }
17878
+ if (props.dragConfig) {
17879
+ warnLog('vxe.error.delProp', ['drag-config', 'row-drag-config']);
17880
+ }
17444
17881
  if (props.treeConfig && treeOpts.children) {
17445
17882
  warnLog('vxe.error.delProp', ['tree-config.children', 'tree-config.childrenField']);
17446
17883
  }
@@ -17971,8 +18408,7 @@ hook_hooks.add('tableFilterModule', {
17971
18408
  fixed
17972
18409
  } = column;
17973
18410
  return $xeTable.scrollToColumn(column).then(() => {
17974
- const headerWrapperRef = elemStore[`${fixed || 'main'}-header-wrapper`] || elemStore['main-header-wrapper'];
17975
- const headerWrapperElem = headerWrapperRef ? headerWrapperRef.value : null;
18411
+ const headerWrapperElem = getRefElem(elemStore[`${fixed || 'main'}-header-wrapper`] || elemStore['main-header-wrapper']);
17976
18412
  if (headerWrapperElem) {
17977
18413
  const filterBtnElem = headerWrapperElem.querySelector(`.vxe-header--column.${column.id} .vxe-filter--btn`);
17978
18414
  triggerEvent(filterBtnElem, 'click');
@@ -18807,6 +19243,57 @@ edit_hook_hooks.add('tableEditModule', {
18807
19243
  };
18808
19244
  });
18809
19245
  };
19246
+ const handleClearEdit = (evnt, targetRow) => {
19247
+ const {
19248
+ mouseConfig
19249
+ } = props;
19250
+ const {
19251
+ editStore
19252
+ } = reactData;
19253
+ const {
19254
+ actived,
19255
+ focused
19256
+ } = editStore;
19257
+ const {
19258
+ row,
19259
+ column
19260
+ } = actived;
19261
+ const validOpts = computeValidOpts.value;
19262
+ const mouseOpts = computeMouseOpts.value;
19263
+ if (row || column) {
19264
+ if (targetRow && getRowid($xeTable, targetRow) !== getRowid($xeTable, row)) {
19265
+ return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();
19266
+ }
19267
+ syncActivedCell();
19268
+ actived.args = null;
19269
+ actived.row = null;
19270
+ actived.column = null;
19271
+ $xeTable.updateFooter();
19272
+ $xeTable.dispatchEvent('edit-closed', {
19273
+ row,
19274
+ rowIndex: $xeTable.getRowIndex(row),
19275
+ $rowIndex: $xeTable.getVMRowIndex(row),
19276
+ column,
19277
+ columnIndex: $xeTable.getColumnIndex(column),
19278
+ $columnIndex: $xeTable.getVMColumnIndex(column)
19279
+ }, evnt || null);
19280
+ }
19281
+ (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)(() => {
19282
+ if (mouseConfig && mouseOpts.area && $xeTable.handleRecalculateCellAreas) {
19283
+ return $xeTable.handleRecalculateCellAreas();
19284
+ }
19285
+ });
19286
+ if (validOpts.autoClear) {
19287
+ if (validOpts.msgMode !== 'full' || hook_getConfig().cellVaildMode === 'obsolete') {
19288
+ if ($xeTable.clearValidate) {
19289
+ return $xeTable.clearValidate();
19290
+ }
19291
+ }
19292
+ }
19293
+ focused.row = null;
19294
+ focused.column = null;
19295
+ return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();
19296
+ };
18810
19297
  editMethods = {
18811
19298
  /**
18812
19299
  * 往表格中插入临时数据
@@ -19123,54 +19610,18 @@ edit_hook_hooks.add('tableEditModule', {
19123
19610
  }
19124
19611
  return null;
19125
19612
  },
19126
- clearActived(evnt) {
19613
+ clearActived(row) {
19127
19614
  // 即将废弃
19128
19615
  if (true) {
19129
19616
  warnLog('vxe.error.delFunc', ['clearActived', 'clearEdit']);
19130
19617
  }
19131
- return this.clearEdit(evnt);
19618
+ return this.clearEdit(row);
19132
19619
  },
19133
19620
  /**
19134
19621
  * 清除激活的编辑
19135
19622
  */
19136
- clearEdit(evnt) {
19137
- const {
19138
- editStore
19139
- } = reactData;
19140
- const {
19141
- actived,
19142
- focused
19143
- } = editStore;
19144
- const {
19145
- row,
19146
- column
19147
- } = actived;
19148
- const validOpts = computeValidOpts.value;
19149
- if (row || column) {
19150
- syncActivedCell();
19151
- actived.args = null;
19152
- actived.row = null;
19153
- actived.column = null;
19154
- $xeTable.updateFooter();
19155
- $xeTable.dispatchEvent('edit-closed', {
19156
- row,
19157
- rowIndex: $xeTable.getRowIndex(row),
19158
- $rowIndex: $xeTable.getVMRowIndex(row),
19159
- column,
19160
- columnIndex: $xeTable.getColumnIndex(column),
19161
- $columnIndex: $xeTable.getVMColumnIndex(column)
19162
- }, evnt || null);
19163
- }
19164
- if (validOpts.autoClear) {
19165
- if (validOpts.msgMode !== 'full' || hook_getConfig().cellVaildMode === 'obsolete') {
19166
- if ($xeTable.clearValidate) {
19167
- return $xeTable.clearValidate();
19168
- }
19169
- }
19170
- }
19171
- focused.row = null;
19172
- focused.column = null;
19173
- return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();
19623
+ clearEdit(row) {
19624
+ return handleClearEdit(null, row);
19174
19625
  },
19175
19626
  /**
19176
19627
  * 清除所选中源状态
@@ -19335,7 +19786,7 @@ edit_hook_hooks.add('tableEditModule', {
19335
19786
  }
19336
19787
  $xeTable.closeTooltip();
19337
19788
  if (actived.column) {
19338
- editMethods.clearEdit(evnt);
19789
+ handleClearEdit(evnt);
19339
19790
  }
19340
19791
  type = 'edit-activated';
19341
19792
  column.renderHeight = cell.offsetHeight;
@@ -19420,6 +19871,12 @@ edit_hook_hooks.add('tableEditModule', {
19420
19871
  handleActived(params, evnt) {
19421
19872
  return editPrivateMethods.handleEdit(params, evnt);
19422
19873
  },
19874
+ /**
19875
+ * 处理取消编辑
19876
+ * @param evnt
19877
+ * @returns
19878
+ */
19879
+ handleClearEdit,
19423
19880
  /**
19424
19881
  * 处理聚焦
19425
19882
  */
@@ -19507,7 +19964,7 @@ edit_hook_hooks.add('tableEditModule', {
19507
19964
  const selectMethod = () => {
19508
19965
  if (isMouseSelected && (selected.row !== row || selected.column !== column)) {
19509
19966
  if (actived.row !== row || (editOpts.mode === 'cell' ? actived.column !== column : false)) {
19510
- editMethods.clearEdit(evnt);
19967
+ handleClearEdit(evnt);
19511
19968
  editMethods.clearSelected();
19512
19969
  if ($xeTable.clearCellAreas) {
19513
19970
  $xeTable.clearCellAreas();
@@ -21238,6 +21695,7 @@ export_hook_hooks.add('tableExportModule', {
21238
21695
 
21239
21696
 
21240
21697
 
21698
+
21241
21699
  const {
21242
21700
  hooks: keyboard_hook_hooks
21243
21701
  } = core_.VxeUI;
@@ -21335,8 +21793,7 @@ keyboard_hook_hooks.add('tableKeyboardModule', {
21335
21793
  } = internalData;
21336
21794
  const disX = evnt.clientX;
21337
21795
  const disY = evnt.clientY;
21338
- const bodyWrapperRef = elemStore[`${column.fixed || 'main'}-body-wrapper`] || elemStore['main-body-wrapper'];
21339
- const bodyWrapperElem = bodyWrapperRef ? bodyWrapperRef.value : null;
21796
+ const bodyWrapperElem = getRefElem(elemStore[`${column.fixed || 'main'}-body-wrapper`] || elemStore['main-body-wrapper']);
21340
21797
  if (!bodyWrapperElem) {
21341
21798
  return;
21342
21799
  }
@@ -22416,6 +22873,10 @@ core_.VxeUI.hooks.add('tableCustomModule', {
22416
22873
  column.visible = column.renderVisible;
22417
22874
  }
22418
22875
  });
22876
+ reactData.isDragColMove = true;
22877
+ setTimeout(() => {
22878
+ reactData.isDragColMove = false;
22879
+ }, 1000);
22419
22880
  return $xeTable.saveCustomStore('confirm');
22420
22881
  };
22421
22882
  const cancelCustom = () => {
@@ -26114,6 +26575,7 @@ const Grid = VxeGrid;
26114
26575
  fileTypeHint: '支持 {0} 文件类型',
26115
26576
  fileSizeHint: '单个文件大小不超过{0}',
26116
26577
  fileCountHint: '最多可上传{0}个文件',
26578
+ uploadTypeErr: '文件类型不匹配!',
26117
26579
  overCountErr: '最多只能选择{0}个文件!',
26118
26580
  overCountExtraErr: '已超出最大数量{0}个,超出的{1}个文件将被忽略!',
26119
26581
  overSizeErr: '文件大小最大不能超过{0}!',