vxe-table 4.8.0 → 4.8.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 (118) hide show
  1. package/es/locale/lang/en-US.js +4 -2
  2. package/es/locale/lang/es-ES.js +4 -2
  3. package/es/locale/lang/hu-HU.js +4 -2
  4. package/es/locale/lang/ja-JP.js +4 -2
  5. package/es/locale/lang/ko-KR.js +4 -2
  6. package/es/locale/lang/pt-BR.js +4 -2
  7. package/es/locale/lang/ru-RU.js +4 -2
  8. package/es/locale/lang/uk-UA.js +4 -2
  9. package/es/locale/lang/vi-VN.js +4 -2
  10. package/es/locale/lang/zh-CHT.js +4 -2
  11. package/es/locale/lang/zh-CN.js +4 -2
  12. package/es/style.css +1 -1
  13. package/es/style.min.css +1 -1
  14. package/es/table/module/edit/hook.js +7 -4
  15. package/es/table/src/body.js +22 -8
  16. package/es/table/src/cell.js +53 -24
  17. package/es/table/src/column.js +3 -1
  18. package/es/table/src/columnInfo.js +1 -0
  19. package/es/table/src/emits.js +3 -0
  20. package/es/table/src/props.js +2 -0
  21. package/es/table/src/table.js +241 -40
  22. package/es/table/style.css +74 -2
  23. package/es/table/style.min.css +1 -1
  24. package/es/ui/index.js +4 -1
  25. package/es/ui/src/log.js +1 -1
  26. package/es/vxe-table/style.css +74 -2
  27. package/es/vxe-table/style.min.css +1 -1
  28. package/helper/vetur/attributes.json +1 -1
  29. package/helper/vetur/tags.json +1 -1
  30. package/lib/index.umd.js +359 -82
  31. package/lib/index.umd.min.js +1 -1
  32. package/lib/locale/lang/en-US.js +4 -2
  33. package/lib/locale/lang/en-US.min.js +1 -1
  34. package/lib/locale/lang/en-US.umd.js +4 -2
  35. package/lib/locale/lang/es-ES.js +4 -2
  36. package/lib/locale/lang/es-ES.min.js +1 -1
  37. package/lib/locale/lang/es-ES.umd.js +4 -2
  38. package/lib/locale/lang/hu-HU.js +4 -2
  39. package/lib/locale/lang/hu-HU.min.js +1 -1
  40. package/lib/locale/lang/hu-HU.umd.js +4 -2
  41. package/lib/locale/lang/ja-JP.js +4 -2
  42. package/lib/locale/lang/ja-JP.min.js +1 -1
  43. package/lib/locale/lang/ja-JP.umd.js +4 -2
  44. package/lib/locale/lang/ko-KR.js +4 -2
  45. package/lib/locale/lang/ko-KR.min.js +1 -1
  46. package/lib/locale/lang/ko-KR.umd.js +4 -2
  47. package/lib/locale/lang/pt-BR.js +4 -2
  48. package/lib/locale/lang/pt-BR.min.js +1 -1
  49. package/lib/locale/lang/pt-BR.umd.js +4 -2
  50. package/lib/locale/lang/ru-RU.js +4 -2
  51. package/lib/locale/lang/ru-RU.min.js +1 -1
  52. package/lib/locale/lang/ru-RU.umd.js +4 -2
  53. package/lib/locale/lang/uk-UA.js +4 -2
  54. package/lib/locale/lang/uk-UA.min.js +1 -1
  55. package/lib/locale/lang/uk-UA.umd.js +4 -2
  56. package/lib/locale/lang/vi-VN.js +4 -2
  57. package/lib/locale/lang/vi-VN.min.js +1 -1
  58. package/lib/locale/lang/zh-CHT.js +4 -2
  59. package/lib/locale/lang/zh-CHT.min.js +1 -1
  60. package/lib/locale/lang/zh-CN.js +4 -2
  61. package/lib/locale/lang/zh-CN.min.js +1 -1
  62. package/lib/locale/lang/zh-CN.umd.js +4 -2
  63. package/lib/style.css +1 -1
  64. package/lib/style.min.css +1 -1
  65. package/lib/table/module/edit/hook.js +8 -4
  66. package/lib/table/module/edit/hook.min.js +1 -1
  67. package/lib/table/src/body.js +18 -5
  68. package/lib/table/src/body.min.js +1 -1
  69. package/lib/table/src/cell.js +60 -24
  70. package/lib/table/src/cell.min.js +1 -1
  71. package/lib/table/src/column.js +3 -1
  72. package/lib/table/src/column.min.js +1 -1
  73. package/lib/table/src/columnInfo.js +1 -0
  74. package/lib/table/src/columnInfo.min.js +1 -1
  75. package/lib/table/src/emits.js +1 -1
  76. package/lib/table/src/emits.min.js +1 -1
  77. package/lib/table/src/props.js +2 -0
  78. package/lib/table/src/props.min.js +1 -1
  79. package/lib/table/src/table.js +258 -43
  80. package/lib/table/src/table.min.js +1 -1
  81. package/lib/table/style/style.css +74 -2
  82. package/lib/table/style/style.min.css +1 -1
  83. package/lib/ui/index.js +4 -1
  84. package/lib/ui/index.min.js +1 -1
  85. package/lib/ui/src/log.js +1 -1
  86. package/lib/ui/src/log.min.js +1 -1
  87. package/lib/vxe-table/style/style.css +74 -2
  88. package/lib/vxe-table/style/style.min.css +1 -1
  89. package/package.json +2 -2
  90. package/packages/locale/lang/en-US.ts +4 -2
  91. package/packages/locale/lang/es-ES.ts +4 -2
  92. package/packages/locale/lang/hu-HU.ts +4 -2
  93. package/packages/locale/lang/ja-JP.ts +4 -2
  94. package/packages/locale/lang/ko-KR.ts +4 -2
  95. package/packages/locale/lang/pt-BR.ts +4 -2
  96. package/packages/locale/lang/ru-RU.ts +4 -2
  97. package/packages/locale/lang/uk-UA.ts +4 -2
  98. package/packages/locale/lang/vi-VN.ts +4 -2
  99. package/packages/locale/lang/zh-CHT.ts +4 -2
  100. package/packages/locale/lang/zh-CN.ts +4 -2
  101. package/packages/table/module/custom/panel.ts +1 -1
  102. package/packages/table/module/edit/hook.ts +7 -4
  103. package/packages/table/src/body.ts +22 -8
  104. package/packages/table/src/cell.ts +57 -24
  105. package/packages/table/src/column.ts +3 -1
  106. package/packages/table/src/columnInfo.ts +1 -0
  107. package/packages/table/src/emits.ts +4 -0
  108. package/packages/table/src/props.ts +2 -0
  109. package/packages/table/src/table.ts +258 -42
  110. package/packages/ui/index.ts +3 -0
  111. package/styles/components/table-module/custom.scss +9 -3
  112. package/styles/components/table.scss +80 -0
  113. /package/es/{iconfont.1730681238555.ttf → iconfont.1730873064176.ttf} +0 -0
  114. /package/es/{iconfont.1730681238555.woff → iconfont.1730873064176.woff} +0 -0
  115. /package/es/{iconfont.1730681238555.woff2 → iconfont.1730873064176.woff2} +0 -0
  116. /package/lib/{iconfont.1730681238555.ttf → iconfont.1730873064176.ttf} +0 -0
  117. /package/lib/{iconfont.1730681238555.woff → iconfont.1730873064176.woff} +0 -0
  118. /package/lib/{iconfont.1730681238555.woff2 → iconfont.1730873064176.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.0";
2001
+ const version = "4.8.1";
2002
2002
  core_.VxeUI.version = version;
2003
2003
  core_.VxeUI.tableVersion = version;
2004
2004
  core_.VxeUI.setConfig({
@@ -2035,6 +2035,9 @@ core_.VxeUI.setConfig({
2035
2035
  // trigger: 'default'
2036
2036
  strict: true
2037
2037
  },
2038
+ dragConfig: {
2039
+ showIcon: true
2040
+ },
2038
2041
  checkboxConfig: {
2039
2042
  // trigger: 'default',
2040
2043
  strict: true
@@ -2384,7 +2387,7 @@ var es_array_push = __webpack_require__(4114);
2384
2387
  const {
2385
2388
  log: log_log
2386
2389
  } = core_.VxeUI;
2387
- const log_version = `table v${"4.8.0"}`;
2390
+ const log_version = `table v${"4.8.1"}`;
2388
2391
  const warnLog = log_log.create('warn', log_version);
2389
2392
  const errLog = log_log.create('error', log_version);
2390
2393
  ;// CONCATENATED MODULE: ./packages/table/src/columnInfo.ts
@@ -2483,6 +2486,7 @@ class ColumnInfo {
2483
2486
  filterRecoverMethod: _vm.filterRecoverMethod,
2484
2487
  filterRender: _vm.filterRender,
2485
2488
  treeNode: _vm.treeNode,
2489
+ dragSort: _vm.dragSort,
2486
2490
  cellType: _vm.cellType,
2487
2491
  cellRender: _vm.cellRender,
2488
2492
  editRender: _vm.editRender,
@@ -3316,7 +3320,8 @@ const {
3316
3320
  getI18n: cell_getI18n,
3317
3321
  getIcon: cell_getIcon,
3318
3322
  renderer: cell_renderer,
3319
- formats: cell_formats
3323
+ formats: cell_formats,
3324
+ renderEmptyElement
3320
3325
  } = core_.VxeUI;
3321
3326
  function renderTitlePrefixIcon(params) {
3322
3327
  const {
@@ -3350,6 +3355,41 @@ function renderTitleSuffixIcon(params) {
3350
3355
  }
3351
3356
  })] : [];
3352
3357
  }
3358
+ function renderCellDragIcon(params) {
3359
+ const {
3360
+ $table
3361
+ } = params;
3362
+ return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('span', {
3363
+ key: 'dg',
3364
+ class: 'vxe-cell--drag-handle',
3365
+ onMousedown(evnt) {
3366
+ $table.handleCellDragMousedownEvent(evnt, params);
3367
+ },
3368
+ onMouseup: $table.handleCellDragMouseupEvent
3369
+ }, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('i', {
3370
+ class: 'vxe-table-icon-drag-handle'
3371
+ })]);
3372
+ }
3373
+ function renderCellBaseVNs(params, content) {
3374
+ const {
3375
+ $table,
3376
+ column
3377
+ } = params;
3378
+ const {
3379
+ dragSort
3380
+ } = column;
3381
+ const vns = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(content) ? content : [content];
3382
+ const {
3383
+ computeRowOpts,
3384
+ computeDragOpts
3385
+ } = $table.getComputeMaps();
3386
+ const rowOpts = computeRowOpts.value;
3387
+ const dragOpts = computeDragOpts.value;
3388
+ if (dragSort && rowOpts.drag && dragOpts.showIcon) {
3389
+ vns.unshift(renderCellDragIcon(params));
3390
+ }
3391
+ return vns;
3392
+ }
3353
3393
  function renderTitleContent(params, content) {
3354
3394
  const {
3355
3395
  $table,
@@ -3588,7 +3628,7 @@ const Cell = {
3588
3628
  const renderOpts = editRender || cellRender;
3589
3629
  const defaultSlot = slots ? slots.default : null;
3590
3630
  if (defaultSlot) {
3591
- return $table.callSlot(defaultSlot, params);
3631
+ return renderCellBaseVNs(params, $table.callSlot(defaultSlot, params));
3592
3632
  }
3593
3633
  if (renderOpts) {
3594
3634
  const compConf = cell_renderer.get(renderOpts.name);
@@ -3597,21 +3637,21 @@ const Cell = {
3597
3637
  const rtDefault = compConf.renderTableDefault || compConf.renderDefault;
3598
3638
  const renderFn = editRender ? rtCell : rtDefault;
3599
3639
  if (renderFn) {
3600
- return getSlotVNs(renderFn(renderOpts, Object.assign({
3640
+ return renderCellBaseVNs(params, getSlotVNs(renderFn(renderOpts, Object.assign({
3601
3641
  $type: editRender ? 'edit' : 'cell'
3602
- }, params)));
3642
+ }, params))));
3603
3643
  }
3604
3644
  }
3605
3645
  }
3606
3646
  const cellValue = $table.getCellLabel(row, column);
3607
3647
  const cellPlaceholder = editRender ? editRender.placeholder : '';
3608
- return [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('span', {
3648
+ return renderCellBaseVNs(params, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('span', {
3609
3649
  class: 'vxe-cell--label'
3610
3650
  }, [
3611
3651
  // 如果设置占位符
3612
3652
  editRender && eqEmptyValue(cellValue) ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('span', {
3613
3653
  class: 'vxe-cell--placeholder'
3614
- }, formatText(getFuncText(cellPlaceholder), 1)) : (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('span', formatText(cellValue, 1))])];
3654
+ }, formatText(getFuncText(cellPlaceholder), 1)) : (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('span', formatText(cellValue, 1))])]);
3615
3655
  },
3616
3656
  renderTreeCell(params) {
3617
3657
  return Cell.renderTreeIcon(params, Cell.renderDefaultCell(params));
@@ -3739,13 +3779,13 @@ const Cell = {
3739
3779
  } = column;
3740
3780
  const defaultSlot = slots ? slots.default : null;
3741
3781
  if (defaultSlot) {
3742
- return $table.callSlot(defaultSlot, params);
3782
+ return renderCellBaseVNs(params, $table.callSlot(defaultSlot, params));
3743
3783
  }
3744
3784
  const {
3745
3785
  seq
3746
3786
  } = params;
3747
3787
  const seqMethod = seqOpts.seqMethod;
3748
- return [formatText(seqMethod ? seqMethod(params) : treeConfig ? seq : (seqOpts.startIndex || 0) + seq, 1)];
3788
+ return renderCellBaseVNs(params, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('span', `${formatText(seqMethod ? seqMethod(params) : treeConfig ? seq : (seqOpts.startIndex || 0) + seq, 1)}`)]);
3749
3789
  },
3750
3790
  renderTreeIndexCell(params) {
3751
3791
  return Cell.renderTreeIcon(params, Cell.renderSeqCell(params));
@@ -3823,7 +3863,7 @@ const Cell = {
3823
3863
  visible: isVisible
3824
3864
  };
3825
3865
  if (radioSlot) {
3826
- return $table.callSlot(radioSlot, radioParams);
3866
+ return renderCellBaseVNs(params, $table.callSlot(radioSlot, radioParams));
3827
3867
  }
3828
3868
  const radioVNs = [];
3829
3869
  if (isVisible) {
@@ -3836,13 +3876,13 @@ const Cell = {
3836
3876
  class: 'vxe-radio--label'
3837
3877
  }, defaultSlot ? $table.callSlot(defaultSlot, radioParams) : external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(row, labelField)));
3838
3878
  }
3839
- return [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('span', {
3879
+ return renderCellBaseVNs(params, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('span', {
3840
3880
  class: ['vxe-cell--radio', {
3841
3881
  'is--checked': isChecked,
3842
3882
  'is--disabled': isDisabled
3843
3883
  }],
3844
3884
  ...ons
3845
- }, radioVNs)];
3885
+ }, radioVNs)]);
3846
3886
  },
3847
3887
  renderTreeRadioCell(params) {
3848
3888
  return Cell.renderTreeIcon(params, Cell.renderRadioCell(params));
@@ -3979,7 +4019,7 @@ const Cell = {
3979
4019
  indeterminate
3980
4020
  };
3981
4021
  if (checkboxSlot) {
3982
- return $table.callSlot(checkboxSlot, checkboxParams);
4022
+ return renderCellBaseVNs(params, $table.callSlot(checkboxSlot, checkboxParams));
3983
4023
  }
3984
4024
  const checkVNs = [];
3985
4025
  if (isVisible) {
@@ -3992,7 +4032,7 @@ const Cell = {
3992
4032
  class: 'vxe-checkbox--label'
3993
4033
  }, defaultSlot ? $table.callSlot(defaultSlot, checkboxParams) : external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(row, labelField)));
3994
4034
  }
3995
- return [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('span', {
4035
+ return renderCellBaseVNs(params, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('span', {
3996
4036
  class: ['vxe-cell--checkbox', {
3997
4037
  'is--checked': isChecked,
3998
4038
  'is--disabled': isDisabled,
@@ -4000,7 +4040,7 @@ const Cell = {
4000
4040
  'is--hidden': !isVisible
4001
4041
  }],
4002
4042
  ...ons
4003
- }, checkVNs)];
4043
+ }, checkVNs)]);
4004
4044
  },
4005
4045
  renderTreeSelectionCell(params) {
4006
4046
  return Cell.renderTreeIcon(params, Cell.renderCheckboxCell(params));
@@ -4072,7 +4112,7 @@ const Cell = {
4072
4112
  indeterminate: isIndeterminate
4073
4113
  };
4074
4114
  if (checkboxSlot) {
4075
- return $table.callSlot(checkboxSlot, checkboxParams);
4115
+ return renderCellBaseVNs(params, $table.callSlot(checkboxSlot, checkboxParams));
4076
4116
  }
4077
4117
  const checkVNs = [];
4078
4118
  if (isVisible) {
@@ -4085,7 +4125,7 @@ const Cell = {
4085
4125
  }, defaultSlot ? $table.callSlot(defaultSlot, checkboxParams) : external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(row, labelField)));
4086
4126
  }
4087
4127
  }
4088
- return [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('span', {
4128
+ return renderCellBaseVNs(params, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('span', {
4089
4129
  class: ['vxe-cell--checkbox', {
4090
4130
  'is--checked': isChecked,
4091
4131
  'is--disabled': isDisabled,
@@ -4093,7 +4133,7 @@ const Cell = {
4093
4133
  'is--hidden': !isVisible
4094
4134
  }],
4095
4135
  ...ons
4096
- }, checkVNs)];
4136
+ }, checkVNs)]);
4097
4137
  },
4098
4138
  renderTreeSelectionCellByProp(params) {
4099
4139
  return Cell.renderTreeIcon(params, Cell.renderCheckboxCellByProp(params));
@@ -4136,7 +4176,7 @@ const Cell = {
4136
4176
  let isAceived = false;
4137
4177
  let isLazyLoading = false;
4138
4178
  if (iconSlot) {
4139
- return $table.callSlot(iconSlot, params);
4179
+ return renderCellBaseVNs(params, $table.callSlot(iconSlot, params));
4140
4180
  }
4141
4181
  if (!isHidden) {
4142
4182
  const rowid = getRowid($table, row);
@@ -4145,7 +4185,7 @@ const Cell = {
4145
4185
  isLazyLoading = !!rowExpandLazyLoadedMaps[rowid];
4146
4186
  }
4147
4187
  }
4148
- return [showIcon && (!visibleMethod || visibleMethod(params)) ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('span', {
4188
+ return renderCellBaseVNs(params, [showIcon && (!visibleMethod || visibleMethod(params)) ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('span', {
4149
4189
  class: ['vxe-table--expanded', {
4150
4190
  'is--active': isAceived
4151
4191
  }],
@@ -4154,9 +4194,9 @@ const Cell = {
4154
4194
  }
4155
4195
  }, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('i', {
4156
4196
  class: ['vxe-table--expand-btn', isLazyLoading ? iconLoaded || cell_getIcon().TABLE_EXPAND_LOADED : isAceived ? iconOpen || cell_getIcon().TABLE_EXPAND_OPEN : iconClose || cell_getIcon().TABLE_EXPAND_CLOSE]
4157
- })]) : null, defaultSlot || labelField ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('span', {
4197
+ })]) : renderEmptyElement($table), defaultSlot || labelField ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('span', {
4158
4198
  class: 'vxe-table--expand-label'
4159
- }, defaultSlot ? $table.callSlot(defaultSlot, params) : external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(row, labelField)) : null];
4199
+ }, defaultSlot ? $table.callSlot(defaultSlot, params) : external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(row, labelField)) : renderEmptyElement($table)]);
4160
4200
  },
4161
4201
  renderExpandData(params) {
4162
4202
  const {
@@ -4195,12 +4235,12 @@ const Cell = {
4195
4235
  } = column;
4196
4236
  const defaultSlot = slots ? slots.default : null;
4197
4237
  if (defaultSlot) {
4198
- return $table.callSlot(defaultSlot, params);
4238
+ return renderCellBaseVNs(params, $table.callSlot(defaultSlot, params));
4199
4239
  }
4200
- return [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('span', {
4240
+ return renderCellBaseVNs(params, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('span', {
4201
4241
  class: 'vxe-cell--html',
4202
4242
  innerHTML: getDefaultCellLabel(params)
4203
- })];
4243
+ })]);
4204
4244
  },
4205
4245
  renderTreeHTMLCell(params) {
4206
4246
  return Cell.renderTreeIcon(params, Cell.renderHTMLCell(params));
@@ -4505,8 +4545,10 @@ const columnProps = {
4505
4545
  filterRecoverMethod: Function,
4506
4546
  // 筛选模板配置项
4507
4547
  filterRender: Object,
4508
- // 指定为树节点
4548
+ // 设置为树节点
4509
4549
  treeNode: Boolean,
4550
+ // 指定为树节点
4551
+ dragSort: Boolean,
4510
4552
  // 是否可视
4511
4553
  visible: {
4512
4554
  type: Boolean,
@@ -5079,7 +5121,7 @@ const lineOffsetSizes = {
5079
5121
  'col--valid-error': !!errorValidItem,
5080
5122
  'col--current': currentColumn === column
5081
5123
  }, getPropClass(compCellClassName, params), getPropClass(className, params), getPropClass(allCellClassName, params)],
5082
- key: columnKey || columnOpts.useKey ? colid : $columnIndex,
5124
+ key: columnKey || columnOpts.useKey || rowOpts.useKey ? colid : $columnIndex,
5083
5125
  ...attrs,
5084
5126
  style: Object.assign({
5085
5127
  height: cellHeight
@@ -5126,7 +5168,7 @@ const lineOffsetSizes = {
5126
5168
  let rowIndex = $rowIndex;
5127
5169
  // 确保任何情况下 rowIndex 都精准指向真实 data 索引
5128
5170
  rowIndex = $xeTable.getRowIndex(row);
5129
- // 事件绑定
5171
+ // 当前行事件
5130
5172
  if (rowOpts.isHover || highlightHoverRow) {
5131
5173
  trOn.onMouseenter = evnt => {
5132
5174
  if (isVMScrollProcess()) {
@@ -5144,6 +5186,12 @@ const lineOffsetSizes = {
5144
5186
  $xeTable.clearHoverRow();
5145
5187
  };
5146
5188
  }
5189
+ // 拖拽行事件
5190
+ if (rowOpts.drag) {
5191
+ trOn.onDragstart = $xeTable.handleRowDragDragstartEvent;
5192
+ trOn.onDragend = $xeTable.handleRowDragDragendEvent;
5193
+ trOn.onDragover = $xeTable.handleRowDragDragoverEvent;
5194
+ }
5147
5195
  const rowid = getRowid($xeTable, row);
5148
5196
  const rest = fullAllDataRowIdData[rowid];
5149
5197
  let rowLevel = 0;
@@ -5193,7 +5241,7 @@ const lineOffsetSizes = {
5193
5241
  }, getPropClass(rowClassName, params)],
5194
5242
  rowid: rowid,
5195
5243
  style: rowStyle ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isFunction(rowStyle) ? rowStyle(params) : rowStyle : null,
5196
- key: rowKey || rowOpts.useKey || treeConfig ? rowid : $rowIndex,
5244
+ key: rowKey || rowOpts.useKey || rowOpts.drag || treeConfig ? rowid : $rowIndex,
5197
5245
  ...trOn
5198
5246
  }, tableColumn.map((column, $columnIndex) => {
5199
5247
  return renderColumn(seq, rowid, fixedType, rowLevel, row, rowIndex, $rowIndex, _rowIndex, column, $columnIndex, tableColumn, tableData);
@@ -5498,7 +5546,8 @@ const lineOffsetSizes = {
5498
5546
  tableData,
5499
5547
  mergeList,
5500
5548
  scrollYLoad,
5501
- isAllOverflow
5549
+ isAllOverflow,
5550
+ isDragRowMove
5502
5551
  } = tableReactData;
5503
5552
  const {
5504
5553
  visibleColumn
@@ -5506,6 +5555,7 @@ const lineOffsetSizes = {
5506
5555
  const {
5507
5556
  slots
5508
5557
  } = tableContext;
5558
+ const rowOpts = computeRowOpts.value;
5509
5559
  const sYOpts = computeSYOpts.value;
5510
5560
  const emptyOpts = computeEmptyOpts.value;
5511
5561
  const keyboardOpts = computeKeyboardOpts.value;
@@ -5587,7 +5637,12 @@ const lineOffsetSizes = {
5587
5637
  /**
5588
5638
  * 内容
5589
5639
  */
5590
- (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('tbody', {
5640
+ rowOpts.drag ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)(external_commonjs_vue_commonjs2_vue_root_Vue_.TransitionGroup, {
5641
+ name: `vxe-body--row-list${isDragRowMove ? '' : '-disabled'}`,
5642
+ tag: 'tbody'
5643
+ }, {
5644
+ default: () => renderRows(fixedType, tableData, tableColumn)
5645
+ }) : (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('tbody', {
5591
5646
  ref: refBodyTBody
5592
5647
  }, renderRows(fixedType, tableData, tableColumn))]), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
5593
5648
  class: 'vxe-table--checkbox-range'
@@ -6553,6 +6608,8 @@ const {
6553
6608
  cellConfig: Object,
6554
6609
  // 行配置信息
6555
6610
  rowConfig: Object,
6611
+ // 可拖拽配置项
6612
+ dragConfig: Object,
6556
6613
  // 列调整配置项
6557
6614
  resizableConfig: Object,
6558
6615
  // 序号配置项
@@ -6619,7 +6676,7 @@ const {
6619
6676
  params: Object
6620
6677
  });
6621
6678
  ;// CONCATENATED MODULE: ./packages/table/src/emits.ts
6622
- /* 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', 'edit-actived', 'edit-activated', 'edit-disabled', 'valid-error', 'scroll', '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']);
6679
+ /* 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', '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']);
6623
6680
  ;// CONCATENATED MODULE: ./packages/table/module/custom/panel.ts
6624
6681
 
6625
6682
 
@@ -8740,6 +8797,9 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
8740
8797
  isFooter: false
8741
8798
  },
8742
8799
  scrollVMLoading: false,
8800
+ isDragRowMove: false,
8801
+ dragRow: null,
8802
+ dragTipText: '',
8743
8803
  _isResize: false,
8744
8804
  _isLoading: false
8745
8805
  });
@@ -8814,6 +8874,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
8814
8874
  columnStatusMaps: {},
8815
8875
  // 行选取状态
8816
8876
  rowStatusMaps: {},
8877
+ // prevDragRow: null,
8817
8878
  inited: false,
8818
8879
  tooltipTimeout: null,
8819
8880
  initStatus: false,
@@ -8841,6 +8902,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
8841
8902
  const refRightContainer = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)();
8842
8903
  const refCellResizeBar = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)();
8843
8904
  const refEmptyPlaceholder = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)();
8905
+ const refRowDragTipElem = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)();
8844
8906
  const refScrollXVirtualElem = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)();
8845
8907
  const refScrollYVirtualElem = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)();
8846
8908
  const refScrollXHandleElem = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)();
@@ -8890,6 +8952,9 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
8890
8952
  const computeRowOpts = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
8891
8953
  return Object.assign({}, table_getConfig().table.rowConfig, props.rowConfig);
8892
8954
  });
8955
+ const computeDragOpts = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
8956
+ return Object.assign({}, table_getConfig().table.dragConfig, props.dragConfig);
8957
+ });
8893
8958
  const computeResizeOpts = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
8894
8959
  return Object.assign({}, table_getConfig().table.resizeConfig, props.resizeConfig);
8895
8960
  });
@@ -9137,6 +9202,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
9137
9202
  computeColumnOpts,
9138
9203
  computeCellOpts,
9139
9204
  computeRowOpts,
9205
+ computeDragOpts,
9140
9206
  computeResizeOpts,
9141
9207
  computeResizableOpts,
9142
9208
  computeSeqOpts,
@@ -11707,7 +11773,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
11707
11773
  const handleCheckAllEvent = (evnt, value) => {
11708
11774
  handleCheckedAllCheckboxRow(value);
11709
11775
  if (evnt) {
11710
- tableMethods.dispatchEvent('checkbox-all', {
11776
+ dispatchEvent('checkbox-all', {
11711
11777
  records: tableMethods.getCheckboxRecords(),
11712
11778
  reserves: tableMethods.getCheckboxReserveRecords(),
11713
11779
  indeterminates: tableMethods.getCheckboxIndeterminateRecords(),
@@ -11786,14 +11852,22 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
11786
11852
  leading: false,
11787
11853
  trailing: true
11788
11854
  });
11789
- const scrollXEvent = evnt => {
11790
- const wrapperEl = evnt.currentTarget;
11855
+ const handleSyncScrollX = scrollLeft => {
11791
11856
  const tableHeader = refTableHeader.value;
11792
11857
  const tableBody = refTableBody.value;
11793
11858
  const tableFooter = refTableFooter.value;
11794
11859
  const bodyElem = tableBody.$el;
11795
11860
  const headerElem = tableHeader ? tableHeader.$el : null;
11796
11861
  const footerElem = tableFooter ? tableFooter.$el : null;
11862
+ setScrollLeft(bodyElem, scrollLeft);
11863
+ setScrollLeft(headerElem, scrollLeft);
11864
+ setScrollLeft(footerElem, scrollLeft);
11865
+ setScrollLeft(bodyElem, scrollLeft);
11866
+ setScrollLeft(headerElem, scrollLeft);
11867
+ setScrollLeft(footerElem, scrollLeft);
11868
+ };
11869
+ const scrollXEvent = evnt => {
11870
+ const wrapperEl = evnt.currentTarget;
11797
11871
  const {
11798
11872
  scrollTop,
11799
11873
  scrollLeft
@@ -11802,9 +11876,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
11802
11876
  const isRollY = false;
11803
11877
  internalData.lastScrollLeft = scrollLeft;
11804
11878
  reactData.lastScrollTime = Date.now();
11805
- setScrollLeft(bodyElem, scrollLeft);
11806
- setScrollLeft(headerElem, scrollLeft);
11807
- setScrollLeft(footerElem, scrollLeft);
11879
+ handleSyncScrollX(scrollLeft);
11808
11880
  $xeTable.triggerScrollXEvent(evnt);
11809
11881
  $xeTable.handleScrollEvent(evnt, isRollY, isRollX, {
11810
11882
  type: 'table',
@@ -11819,14 +11891,19 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
11819
11891
  leading: false,
11820
11892
  trailing: true
11821
11893
  });
11822
- const scrollYEvent = evnt => {
11823
- const wrapperEl = evnt.currentTarget;
11894
+ const handleSyncScrollY = scrollTop => {
11824
11895
  const tableBody = refTableBody.value;
11825
11896
  const leftBody = refTableLeftBody.value;
11826
11897
  const rightBody = refTableRightBody.value;
11827
11898
  const bodyElem = tableBody.$el;
11828
11899
  const leftElem = leftBody ? leftBody.$el : null;
11829
11900
  const rightElem = rightBody ? rightBody.$el : null;
11901
+ setScrollTop(bodyElem, scrollTop);
11902
+ setScrollTop(leftElem, scrollTop);
11903
+ setScrollTop(rightElem, scrollTop);
11904
+ };
11905
+ const scrollYEvent = evnt => {
11906
+ const wrapperEl = evnt.currentTarget;
11830
11907
  const {
11831
11908
  scrollTop,
11832
11909
  scrollLeft
@@ -11835,9 +11912,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
11835
11912
  const isRollY = true;
11836
11913
  internalData.lastScrollTop = scrollTop;
11837
11914
  reactData.lastScrollTime = Date.now();
11838
- setScrollTop(bodyElem, scrollTop);
11839
- setScrollTop(leftElem, scrollTop);
11840
- setScrollTop(rightElem, scrollTop);
11915
+ handleSyncScrollY(scrollTop);
11841
11916
  $xeTable.triggerScrollYEvent(evnt);
11842
11917
  $xeTable.handleScrollEvent(evnt, isRollY, isRollX, {
11843
11918
  type: 'table',
@@ -11847,13 +11922,14 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
11847
11922
  });
11848
11923
  };
11849
11924
  let keyCtxTimeout;
11925
+ const dispatchEvent = (type, params, evnt) => {
11926
+ emit(type, createEvent(evnt, {
11927
+ $table: $xeTable,
11928
+ $grid: $xeGrid
11929
+ }, params));
11930
+ };
11850
11931
  tableMethods = {
11851
- dispatchEvent(type, params, evnt) {
11852
- emit(type, createEvent(evnt, {
11853
- $table: $xeTable,
11854
- $grid: $xeGrid
11855
- }, params));
11856
- },
11932
+ dispatchEvent,
11857
11933
  /**
11858
11934
  * 重置表格的一切数据状态
11859
11935
  */
@@ -13371,7 +13447,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
13371
13447
  visible: false
13372
13448
  });
13373
13449
  if (visible) {
13374
- $xeTable.dispatchEvent('filter-visible', {
13450
+ dispatchEvent('filter-visible', {
13375
13451
  column,
13376
13452
  property: column.field,
13377
13453
  field: column.field,
@@ -14313,7 +14389,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
14313
14389
  tablePrivateMethods.preventEvent(evnt, 'event.clearAreas', {}, () => {
14314
14390
  $xeTable.clearCellAreas();
14315
14391
  $xeTable.clearCopyCellArea();
14316
- $xeTable.dispatchEvent('clear-cell-area-selection', {
14392
+ dispatchEvent('clear-cell-area-selection', {
14317
14393
  cellAreas
14318
14394
  }, evnt);
14319
14395
  });
@@ -14375,7 +14451,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
14375
14451
  const isEsc = table_globalEvents.hasKey(evnt, GLOBAL_EVENT_KEYS.ESCAPE);
14376
14452
  if (isEsc) {
14377
14453
  tablePrivateMethods.preventEvent(evnt, 'event.keydown', null, () => {
14378
- tableMethods.dispatchEvent('keydown-start', {}, evnt);
14454
+ dispatchEvent('keydown-start', {}, evnt);
14379
14455
  if (keyboardConfig && mouseConfig && mouseOpts.area && $xeTable.handleKeyboardEvent) {
14380
14456
  $xeTable.handleKeyboardEvent(evnt);
14381
14457
  } else if (actived.row || filterStore.visible || ctxMenuStore.visible) {
@@ -14397,8 +14473,8 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
14397
14473
  }
14398
14474
  }
14399
14475
  }
14400
- tableMethods.dispatchEvent('keydown', {}, evnt);
14401
- tableMethods.dispatchEvent('keydown-end', {}, evnt);
14476
+ dispatchEvent('keydown', {}, evnt);
14477
+ dispatchEvent('keydown-end', {}, evnt);
14402
14478
  });
14403
14479
  }
14404
14480
  };
@@ -14590,7 +14666,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
14590
14666
  }
14591
14667
  // 如果按下 del 键,更新表尾数据
14592
14668
  tableMethods.updateFooter();
14593
- $xeTable.dispatchEvent('cell-delete-value', params, evnt);
14669
+ dispatchEvent('cell-delete-value', params, evnt);
14594
14670
  }
14595
14671
  }
14596
14672
  } else if (hasBackspaceKey && keyboardConfig && keyboardOpts.isBack && isEnableConf(editConfig) && (selected.row || selected.column)) {
@@ -14616,7 +14692,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
14616
14692
  setCellValue(selected.row, selected.column, null);
14617
14693
  $xeTable.handleEdit(selected.args, evnt);
14618
14694
  }
14619
- $xeTable.dispatchEvent('cell-backspace-value', params, evnt);
14695
+ dispatchEvent('cell-backspace-value', params, evnt);
14620
14696
  }
14621
14697
  }
14622
14698
  }
@@ -14671,7 +14747,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
14671
14747
  }
14672
14748
  }
14673
14749
  }
14674
- tableMethods.dispatchEvent('keydown', {}, evnt);
14750
+ dispatchEvent('keydown', {}, evnt);
14675
14751
  });
14676
14752
  }
14677
14753
  };
@@ -14698,7 +14774,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
14698
14774
  $xeTable.handlePasteCellAreaEvent(evnt);
14699
14775
  }
14700
14776
  }
14701
- tableMethods.dispatchEvent('paste', {}, evnt);
14777
+ dispatchEvent('paste', {}, evnt);
14702
14778
  }
14703
14779
  };
14704
14780
  const handleGlobalCopyEvent = evnt => {
@@ -14724,7 +14800,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
14724
14800
  $xeTable.handleCopyCellAreaEvent(evnt);
14725
14801
  }
14726
14802
  }
14727
- tableMethods.dispatchEvent('copy', {}, evnt);
14803
+ dispatchEvent('copy', {}, evnt);
14728
14804
  }
14729
14805
  };
14730
14806
  const handleGlobalCutEvent = evnt => {
@@ -14750,7 +14826,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
14750
14826
  $xeTable.handleCutCellAreaEvent(evnt);
14751
14827
  }
14752
14828
  }
14753
- tableMethods.dispatchEvent('cut', {}, evnt);
14829
+ dispatchEvent('cut', {}, evnt);
14754
14830
  }
14755
14831
  };
14756
14832
  const handleGlobalResizeEvent = () => {
@@ -14775,6 +14851,50 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
14775
14851
  }
14776
14852
  }
14777
14853
  };
14854
+ const clearRowDropOrigin = () => {
14855
+ const el = refElem.value;
14856
+ if (el) {
14857
+ const clss = 'row--drag-origin';
14858
+ external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().arrayEach(el.querySelectorAll(`.${clss}`), elem => {
14859
+ elem.draggable = false;
14860
+ removeClass(elem, clss);
14861
+ });
14862
+ }
14863
+ };
14864
+ const clearRowDropTarget = () => {
14865
+ const el = refElem.value;
14866
+ if (el) {
14867
+ const clss = 'row--drag-active-target';
14868
+ external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().arrayEach(el.querySelectorAll(`.${clss}`), elem => {
14869
+ removeClass(elem, clss);
14870
+ });
14871
+ }
14872
+ };
14873
+ const showRowDropTip = evnt => {
14874
+ const rdTipEl = refRowDragTipElem.value;
14875
+ if (!rdTipEl) {
14876
+ return;
14877
+ }
14878
+ const el = refElem.value;
14879
+ if (!el) {
14880
+ return;
14881
+ }
14882
+ if (rdTipEl) {
14883
+ const wrapperRect = el.getBoundingClientRect();
14884
+ rdTipEl.style.display = 'block';
14885
+ rdTipEl.style.top = `${Math.min(el.clientHeight - el.scrollTop - rdTipEl.clientHeight, evnt.clientY - wrapperRect.y)}px`;
14886
+ rdTipEl.style.left = `${Math.min(el.clientWidth - el.scrollLeft - rdTipEl.clientWidth - 16, evnt.clientX - wrapperRect.x)}px`;
14887
+ }
14888
+ };
14889
+ const hideRowDropTip = () => {
14890
+ const rdTipEl = refRowDragTipElem.value;
14891
+ if (rdTipEl) {
14892
+ rdTipEl.style.display = '';
14893
+ }
14894
+ };
14895
+ const updateRowDropTipContent = tdEl => {
14896
+ reactData.dragTipText = tdEl.textContent || '';
14897
+ };
14778
14898
  /**
14779
14899
  * 处理显示 tooltip
14780
14900
  * @param {Event} evnt 事件
@@ -15674,7 +15794,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
15674
15794
  if (sortOpts.trigger === 'cell' && !(triggerResizable || triggerSort || triggerFilter)) {
15675
15795
  tablePrivateMethods.triggerSortEvent(evnt, column, getNextSortOrder(column));
15676
15796
  }
15677
- tableMethods.dispatchEvent('header-cell-click', Object.assign({
15797
+ dispatchEvent('header-cell-click', Object.assign({
15678
15798
  triggerResizable,
15679
15799
  triggerSort,
15680
15800
  triggerFilter,
@@ -15685,7 +15805,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
15685
15805
  }
15686
15806
  },
15687
15807
  triggerHeaderCellDblclickEvent(evnt, params) {
15688
- tableMethods.dispatchEvent('header-cell-dblclick', Object.assign({
15808
+ dispatchEvent('header-cell-dblclick', Object.assign({
15689
15809
  cell: evnt.currentTarget
15690
15810
  }, params), evnt);
15691
15811
  },
@@ -15786,7 +15906,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
15786
15906
  }
15787
15907
  }
15788
15908
  }
15789
- tableMethods.dispatchEvent('cell-click', params, evnt);
15909
+ dispatchEvent('cell-click', params, evnt);
15790
15910
  },
15791
15911
  /**
15792
15912
  * 列双击点击事件
@@ -15818,7 +15938,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
15818
15938
  }
15819
15939
  }
15820
15940
  }
15821
- tableMethods.dispatchEvent('cell-dblclick', params, evnt);
15941
+ dispatchEvent('cell-dblclick', params, evnt);
15822
15942
  },
15823
15943
  handleToggleCheckRowEvent(evnt, params) {
15824
15944
  const {
@@ -15874,7 +15994,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
15874
15994
  tableMethods.setAllCheckboxRow(false);
15875
15995
  const rangeRows = _rowIndex < _firstRowIndex ? afterFullData.slice(_rowIndex, _firstRowIndex + 1) : afterFullData.slice(_firstRowIndex, _rowIndex + 1);
15876
15996
  handleCheckedCheckboxRow(rangeRows, true, false);
15877
- tableMethods.dispatchEvent('checkbox-range-select', Object.assign({
15997
+ dispatchEvent('checkbox-range-select', Object.assign({
15878
15998
  rangeRecords: rangeRows
15879
15999
  }, params), evnt);
15880
16000
  return;
@@ -15886,7 +16006,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
15886
16006
  })) {
15887
16007
  tablePrivateMethods.handleSelectRow(params, value);
15888
16008
  tablePrivateMethods.checkSelectionStatus();
15889
- tableMethods.dispatchEvent('checkbox-change', Object.assign({
16009
+ dispatchEvent('checkbox-change', Object.assign({
15890
16010
  records: tableMethods.getCheckboxRecords(),
15891
16011
  reserves: tableMethods.getCheckboxReserveRecords(),
15892
16012
  indeterminates: tableMethods.getCheckboxIndeterminateRecords(),
@@ -15940,7 +16060,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
15940
16060
  }
15941
16061
  }
15942
16062
  if (isChange) {
15943
- tableMethods.dispatchEvent('radio-change', {
16063
+ dispatchEvent('radio-change', {
15944
16064
  oldValue,
15945
16065
  newValue,
15946
16066
  ...params
@@ -15978,7 +16098,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
15978
16098
  })) {
15979
16099
  tableMethods.setCurrentRow(newValue);
15980
16100
  if (isChange) {
15981
- tableMethods.dispatchEvent('current-change', {
16101
+ dispatchEvent('current-change', {
15982
16102
  oldValue,
15983
16103
  newValue,
15984
16104
  ...params
@@ -16012,7 +16132,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
16012
16132
  const columnIndex = tableMethods.getColumnIndex(column);
16013
16133
  const $columnIndex = tableMethods.getVMColumnIndex(column);
16014
16134
  tableMethods.setRowExpand(row, expanded);
16015
- tableMethods.dispatchEvent('toggle-row-expand', {
16135
+ dispatchEvent('toggle-row-expand', {
16016
16136
  expanded,
16017
16137
  column,
16018
16138
  columnIndex,
@@ -16049,7 +16169,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
16049
16169
  const columnIndex = tableMethods.getColumnIndex(column);
16050
16170
  const $columnIndex = tableMethods.getVMColumnIndex(column);
16051
16171
  tableMethods.setTreeExpand(row, expanded);
16052
- tableMethods.dispatchEvent('toggle-tree-expand', {
16172
+ dispatchEvent('toggle-tree-expand', {
16053
16173
  expanded,
16054
16174
  column,
16055
16175
  columnIndex,
@@ -16093,9 +16213,152 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
16093
16213
  if (mouseConfig && mouseOpts.area && $xeTable.handleSortEvent) {
16094
16214
  $xeTable.handleSortEvent(evnt, params);
16095
16215
  }
16096
- tableMethods.dispatchEvent('sort-change', params, evnt);
16216
+ dispatchEvent('sort-change', params, evnt);
16097
16217
  }
16098
16218
  },
16219
+ handleRowDragDragstartEvent(evnt) {
16220
+ const img = new Image();
16221
+ if (evnt.dataTransfer) {
16222
+ evnt.dataTransfer.setDragImage(img, 0, 0);
16223
+ }
16224
+ },
16225
+ handleRowDragDragendEvent(evnt) {
16226
+ const {
16227
+ treeConfig
16228
+ } = props;
16229
+ const rowOpts = computeRowOpts.value;
16230
+ const {
16231
+ dragEndMethod
16232
+ } = rowOpts;
16233
+ const treeOpts = computeTreeOpts.value;
16234
+ const {
16235
+ transform
16236
+ } = treeOpts;
16237
+ const {
16238
+ dragRow
16239
+ } = reactData;
16240
+ const {
16241
+ afterFullData,
16242
+ tableFullData,
16243
+ prevDragRow,
16244
+ prevDragPos
16245
+ } = internalData;
16246
+ if (prevDragRow && dragRow) {
16247
+ // 判断是否有拖动
16248
+ if (prevDragRow !== dragRow) {
16249
+ Promise.resolve(dragEndMethod ? dragEndMethod({
16250
+ oldRow: dragRow,
16251
+ newRow: prevDragRow
16252
+ }) : true).then(status => {
16253
+ if (!status) {
16254
+ return;
16255
+ }
16256
+ const dragOffsetIndex = prevDragPos === 'bottom' ? 1 : 0;
16257
+ // 移出源位置
16258
+ const oafIndex = $xeTable.findRowIndexOf(afterFullData, dragRow);
16259
+ const otfIndex = $xeTable.findRowIndexOf(tableFullData, dragRow);
16260
+ afterFullData.splice(oafIndex, 1);
16261
+ tableFullData.splice(otfIndex, 1);
16262
+ // 插新位置
16263
+ const pafIndex = $xeTable.findRowIndexOf(afterFullData, prevDragRow);
16264
+ const ptfIndex = $xeTable.findRowIndexOf(tableFullData, prevDragRow);
16265
+ const nafIndex = pafIndex + dragOffsetIndex;
16266
+ const ntfIndex = ptfIndex + dragOffsetIndex;
16267
+ afterFullData.splice(nafIndex, 0, dragRow);
16268
+ tableFullData.splice(ntfIndex, 0, dragRow);
16269
+ reactData.isDragRowMove = true;
16270
+ $xeTable.cacheRowMap();
16271
+ $xeTable.updateScrollYStatus();
16272
+ $xeTable.handleTableData(treeConfig && transform);
16273
+ if (!(treeConfig && transform)) {
16274
+ $xeTable.updateAfterDataIndex();
16275
+ }
16276
+ $xeTable.updateFooter();
16277
+ $xeTable.checkSelectionStatus();
16278
+ if (reactData.scrollYLoad) {
16279
+ $xeTable.updateScrollYSpace();
16280
+ }
16281
+ (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)().then(() => {
16282
+ $xeTable.updateCellAreas();
16283
+ return $xeTable.recalculate();
16284
+ });
16285
+ dispatchEvent('row-dragend', {
16286
+ oldRow: dragRow,
16287
+ newRow: prevDragRow,
16288
+ _index: {
16289
+ newIndex: nafIndex,
16290
+ oldIndex: oafIndex
16291
+ }
16292
+ }, evnt);
16293
+ }).catch(() => {});
16294
+ }
16295
+ }
16296
+ hideRowDropTip();
16297
+ clearRowDropOrigin();
16298
+ clearRowDropTarget();
16299
+ reactData.dragRow = null;
16300
+ setTimeout(() => {
16301
+ reactData.isDragRowMove = false;
16302
+ }, 500);
16303
+ },
16304
+ handleRowDragDragoverEvent(evnt) {
16305
+ const trEl = evnt.currentTarget;
16306
+ const rowid = trEl.getAttribute('rowid');
16307
+ const row = $xeTable.getRowById(rowid);
16308
+ clearRowDropTarget();
16309
+ if (row) {
16310
+ evnt.preventDefault();
16311
+ evnt.preventDefault();
16312
+ const {
16313
+ dragRow
16314
+ } = reactData;
16315
+ const offsetY = evnt.clientY - trEl.getBoundingClientRect().y;
16316
+ const dragPos = offsetY < trEl.clientHeight / 2 ? 'top' : 'bottom';
16317
+ addClass(trEl, 'row--drag-active-target');
16318
+ trEl.setAttribute('drag-pos', dragPos);
16319
+ internalData.prevDragRow = row;
16320
+ internalData.prevDragPos = dragPos;
16321
+ dispatchEvent('row-dragover', {
16322
+ oldRow: dragRow,
16323
+ targetRow: row,
16324
+ dragPos
16325
+ }, evnt);
16326
+ }
16327
+ showRowDropTip(evnt);
16328
+ },
16329
+ handleCellDragMousedownEvent(evnt, params) {
16330
+ evnt.stopPropagation();
16331
+ const rowOpts = computeRowOpts.value;
16332
+ const {
16333
+ dragStartMethod
16334
+ } = rowOpts;
16335
+ const {
16336
+ row
16337
+ } = params;
16338
+ const dragEl = evnt.currentTarget;
16339
+ const tdEl = dragEl.parentNode?.parentNode;
16340
+ const trEl = tdEl.parentNode;
16341
+ reactData.isDragRowMove = false;
16342
+ clearRowDropOrigin();
16343
+ if (dragStartMethod && !dragStartMethod(params)) {
16344
+ trEl.draggable = false;
16345
+ reactData.dragRow = null;
16346
+ hideRowDropTip();
16347
+ return;
16348
+ }
16349
+ reactData.dragRow = row;
16350
+ trEl.draggable = true;
16351
+ addClass(trEl, 'row--drag-origin');
16352
+ showRowDropTip(evnt);
16353
+ updateRowDropTipContent(tdEl);
16354
+ dispatchEvent('row-dragstart', params, evnt);
16355
+ },
16356
+ handleCellDragMouseupEvent() {
16357
+ clearRowDropOrigin();
16358
+ hideRowDropTip();
16359
+ reactData.dragRow = null;
16360
+ reactData.isDragRowMove = false;
16361
+ },
16099
16362
  /**
16100
16363
  * 横向 X 可视渲染事件处理
16101
16364
  */
@@ -16127,7 +16390,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
16127
16390
  const bodyWidth = bodyElem ? bodyElem.clientWidth : 0;
16128
16391
  const scrollHeight = bodyElem ? bodyElem.scrollHeight : 0;
16129
16392
  const scrollWidth = bodyElem ? bodyElem.scrollWidth : 0;
16130
- $xeTable.dispatchEvent('scroll', {
16393
+ const evntParams = {
16131
16394
  bodyHeight,
16132
16395
  bodyWidth,
16133
16396
  scrollHeight,
@@ -16135,7 +16398,8 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
16135
16398
  isX: isRollX,
16136
16399
  isY: isRollY,
16137
16400
  ...params
16138
- }, evnt);
16401
+ };
16402
+ dispatchEvent('scroll', evntParams, evnt);
16139
16403
  },
16140
16404
  /**
16141
16405
  * 纵向 Y 可视渲染事件处理
@@ -16312,14 +16576,14 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
16312
16576
  },
16313
16577
  updateScrollXData() {
16314
16578
  // reactData.tableColumn = []
16315
- (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)(() => {
16579
+ return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)().then(() => {
16316
16580
  handleTableColumn();
16317
16581
  tablePrivateMethods.updateScrollXSpace();
16318
16582
  });
16319
16583
  },
16320
16584
  updateScrollYData() {
16321
16585
  // reactData.tableData = []
16322
- (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)(() => {
16586
+ return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)().then(() => {
16323
16587
  tablePrivateMethods.handleTableData();
16324
16588
  calcCellHeight();
16325
16589
  tablePrivateMethods.updateScrollYSpace();
@@ -16712,6 +16976,13 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
16712
16976
  key: 'tm',
16713
16977
  ref: refTableMenu
16714
16978
  }) : (0,external_commonjs_vue_commonjs2_vue_root_Vue_.createCommentVNode)(),
16979
+ /**
16980
+ * 拖拽提示
16981
+ */
16982
+ rowOpts.drag ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
16983
+ ref: refRowDragTipElem,
16984
+ class: 'vxe-table--row-drag-hint'
16985
+ }, table_getI18n('vxe.table.dragTip', [reactData.dragTipText])) : (0,external_commonjs_vue_commonjs2_vue_root_Vue_.createCommentVNode)(),
16715
16986
  /**
16716
16987
  * 提示相关
16717
16988
  */
@@ -18043,7 +18314,8 @@ edit_hook_hooks.add('tableEditModule', {
18043
18314
  computeMouseOpts,
18044
18315
  computeEditOpts,
18045
18316
  computeCheckboxOpts,
18046
- computeTreeOpts
18317
+ computeTreeOpts,
18318
+ computeValidOpts
18047
18319
  } = $xeTable.getComputeMaps();
18048
18320
  let editMethods = {};
18049
18321
  let editPrivateMethods = {};
@@ -18707,6 +18979,7 @@ edit_hook_hooks.add('tableEditModule', {
18707
18979
  row,
18708
18980
  column
18709
18981
  } = actived;
18982
+ const validOpts = computeValidOpts.value;
18710
18983
  if (row || column) {
18711
18984
  syncActivedCell();
18712
18985
  actived.args = null;
@@ -18722,9 +18995,11 @@ edit_hook_hooks.add('tableEditModule', {
18722
18995
  $columnIndex: $xeTable.getVMColumnIndex(column)
18723
18996
  }, evnt || null);
18724
18997
  }
18725
- if (hook_getConfig().cellVaildMode === 'obsolete') {
18726
- if ($xeTable.clearValidate) {
18727
- return $xeTable.clearValidate();
18998
+ if (validOpts.autoClear) {
18999
+ if (validOpts.msgMode !== 'full' || hook_getConfig().cellVaildMode === 'obsolete') {
19000
+ if ($xeTable.clearValidate) {
19001
+ return $xeTable.clearValidate();
19002
+ }
18728
19003
  }
18729
19004
  }
18730
19005
  focused.row = null;
@@ -25220,6 +25495,7 @@ const Grid = VxeGrid;
25220
25495
  impSuccess: '成功导入 {0} 条记录',
25221
25496
  expLoading: '正在导出中',
25222
25497
  expSuccess: '导出成功',
25498
+ expError: '导出失败',
25223
25499
  expFilename: '导出_{0}',
25224
25500
  expOriginFilename: '导出_源_{0}',
25225
25501
  customTitle: '列设置',
@@ -25228,7 +25504,8 @@ const Grid = VxeGrid;
25228
25504
  customClose: '关闭',
25229
25505
  customCancel: '取消',
25230
25506
  customRestore: '恢复默认',
25231
- maxFixedCol: '最大冻结列的数量不能超过 {0} 个'
25507
+ maxFixedCol: '最大冻结列的数量不能超过 {0} 个',
25508
+ dragTip: '移动:{0}'
25232
25509
  },
25233
25510
  grid: {
25234
25511
  selectOneRecord: '请至少选择一条记录!',
@@ -25279,7 +25556,7 @@ const Grid = VxeGrid;
25279
25556
  cstmCancel: '取消',
25280
25557
  cstmConfirm: '确定',
25281
25558
  cstmConfirmRestore: '请确认是否恢复成默认列配置?',
25282
- cstmDragTarget: '移动目标:{0}',
25559
+ cstmDragTarget: '移动:{0}',
25283
25560
  setting: {
25284
25561
  colSort: '排序',
25285
25562
  sortHelpTip: '点击并拖动图标可以调整列的排序',