vxe-table 3.10.7 → 3.10.8

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.
package/es/ui/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { VxeUI } from '@vxe-ui/core';
2
2
  import { getFuncText } from './src/utils';
3
- export const version = "3.10.7";
3
+ export const version = "3.10.8";
4
4
  VxeUI.version = version;
5
5
  VxeUI.tableVersion = version;
6
6
  VxeUI.setConfig({
package/es/ui/src/log.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { VxeUI } from '@vxe-ui/core';
2
2
  const { log } = VxeUI;
3
- const version = `table v${"3.10.7"}`;
3
+ const version = `table v${"3.10.8"}`;
4
4
  export const warnLog = log.create('warn', version);
5
5
  export const errLog = log.create('error', version);
package/lib/index.umd.js CHANGED
@@ -2220,7 +2220,7 @@ function getClass(property, params) {
2220
2220
  ;// CONCATENATED MODULE: ./packages/ui/index.ts
2221
2221
 
2222
2222
 
2223
- const version = "3.10.7";
2223
+ const version = "3.10.8";
2224
2224
  core_.VxeUI.version = version;
2225
2225
  core_.VxeUI.tableVersion = version;
2226
2226
  core_.VxeUI.setConfig({
@@ -2769,7 +2769,7 @@ function isNodeElement(elem) {
2769
2769
  const {
2770
2770
  log: log_log
2771
2771
  } = core_.VxeUI;
2772
- const log_version = `table v${"3.10.7"}`;
2772
+ const log_version = `table v${"3.10.8"}`;
2773
2773
  const warnLog = log_log.create('warn', log_version);
2774
2774
  const errLog = log_log.create('error', log_version);
2775
2775
  ;// CONCATENATED MODULE: ./packages/table/src/columnInfo.ts
@@ -3545,23 +3545,30 @@ function renderCellBaseVNs(h, params, content) {
3545
3545
  const {
3546
3546
  $table,
3547
3547
  column,
3548
- row
3548
+ row,
3549
+ level
3549
3550
  } = params;
3550
3551
  const {
3551
3552
  dragSort
3552
3553
  } = column;
3553
- const vns = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(content) ? content : [content];
3554
+ const tableProps = $table;
3555
+ const {
3556
+ treeConfig
3557
+ } = tableProps;
3554
3558
  const rowOpts = $table.computeRowOpts;
3555
3559
  const dragOpts = $table.computeDragOpts;
3556
3560
  const {
3557
3561
  showRowIcon,
3558
3562
  rowVisibleMethod
3559
3563
  } = dragOpts;
3564
+ const vns = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(content) ? content : [content];
3560
3565
  if (dragSort && rowOpts.drag && showRowIcon && (!rowVisibleMethod || rowVisibleMethod({
3561
3566
  row,
3562
3567
  column
3563
3568
  }))) {
3564
- vns.unshift(renderCellDragIcon(h, params));
3569
+ if (!treeConfig || !level) {
3570
+ vns.unshift(renderCellDragIcon(h, params));
3571
+ }
3565
3572
  }
3566
3573
  return vns;
3567
3574
  }
@@ -5147,6 +5154,16 @@ function clearRowDropOrigin($xeTable) {
5147
5154
  });
5148
5155
  }
5149
5156
  }
5157
+ function updateRowDropOrigin($xeTable, row) {
5158
+ const el = $xeTable.$el;
5159
+ if (el) {
5160
+ const clss = 'row--drag-origin';
5161
+ const rowid = getRowid($xeTable, row);
5162
+ external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().arrayEach(el.querySelectorAll(`[rowid="${rowid}"]`), elem => {
5163
+ addClass(elem, clss);
5164
+ });
5165
+ }
5166
+ }
5150
5167
  function clearRowDropTarget($xeTable) {
5151
5168
  const el = $xeTable.$el;
5152
5169
  if (el) {
@@ -5156,6 +5173,17 @@ function clearRowDropTarget($xeTable) {
5156
5173
  });
5157
5174
  }
5158
5175
  }
5176
+ function updateRowDropTarget($xeTable, row, dragPos) {
5177
+ const el = $xeTable.$el;
5178
+ if (el) {
5179
+ const clss = 'row--drag-active-target';
5180
+ const rowid = getRowid($xeTable, row);
5181
+ external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().arrayEach(el.querySelectorAll(`[rowid="${rowid}"]`), elem => {
5182
+ addClass(elem, clss);
5183
+ elem.setAttribute('drag-pos', dragPos);
5184
+ });
5185
+ }
5186
+ }
5159
5187
  function showRowDropTip(evnt, $xeTable) {
5160
5188
  const rdTipEl = $xeTable.$refs.refRowDragTipElem;
5161
5189
  if (!rdTipEl) {
@@ -10252,7 +10280,9 @@ const Methods = {
10252
10280
  } = reactData;
10253
10281
  const {
10254
10282
  afterFullData,
10283
+ afterTreeFullData,
10255
10284
  tableFullData,
10285
+ tableFullTreeData,
10256
10286
  prevDragRow,
10257
10287
  prevDragPos
10258
10288
  } = internalData;
@@ -10267,18 +10297,35 @@ const Methods = {
10267
10297
  return;
10268
10298
  }
10269
10299
  const dragOffsetIndex = prevDragPos === 'bottom' ? 1 : 0;
10270
- // 移出源位置
10271
- const oafIndex = $xeTable.findRowIndexOf(afterFullData, dragRow);
10272
- const otfIndex = $xeTable.findRowIndexOf(tableFullData, dragRow);
10273
- afterFullData.splice(oafIndex, 1);
10274
- tableFullData.splice(otfIndex, 1);
10275
- // 插新位置
10276
- const pafIndex = $xeTable.findRowIndexOf(afterFullData, prevDragRow);
10277
- const ptfIndex = $xeTable.findRowIndexOf(tableFullData, prevDragRow);
10278
- const nafIndex = pafIndex + dragOffsetIndex;
10279
- const ntfIndex = ptfIndex + dragOffsetIndex;
10280
- afterFullData.splice(nafIndex, 0, dragRow);
10281
- tableFullData.splice(ntfIndex, 0, dragRow);
10300
+ let oafIndex = -1;
10301
+ let nafIndex = -1;
10302
+ if (treeConfig) {
10303
+ // 移出源位置
10304
+ oafIndex = $xeTable.findRowIndexOf(afterTreeFullData, dragRow);
10305
+ const otfIndex = $xeTable.findRowIndexOf(tableFullTreeData, dragRow);
10306
+ afterTreeFullData.splice(oafIndex, 1);
10307
+ tableFullTreeData.splice(otfIndex, 1);
10308
+ // 插新位置
10309
+ const pafIndex = $xeTable.findRowIndexOf(afterTreeFullData, prevDragRow);
10310
+ const ptfIndex = $xeTable.findRowIndexOf(tableFullTreeData, prevDragRow);
10311
+ nafIndex = pafIndex + dragOffsetIndex;
10312
+ const ntfIndex = ptfIndex + dragOffsetIndex;
10313
+ afterTreeFullData.splice(nafIndex, 0, dragRow);
10314
+ tableFullTreeData.splice(ntfIndex, 0, dragRow);
10315
+ } else {
10316
+ // 移出源位置
10317
+ oafIndex = $xeTable.findRowIndexOf(afterFullData, dragRow);
10318
+ const otfIndex = $xeTable.findRowIndexOf(tableFullData, dragRow);
10319
+ afterFullData.splice(oafIndex, 1);
10320
+ tableFullData.splice(otfIndex, 1);
10321
+ // 插新位置
10322
+ const pafIndex = $xeTable.findRowIndexOf(afterFullData, prevDragRow);
10323
+ const ptfIndex = $xeTable.findRowIndexOf(tableFullData, prevDragRow);
10324
+ nafIndex = pafIndex + dragOffsetIndex;
10325
+ const ntfIndex = ptfIndex + dragOffsetIndex;
10326
+ afterFullData.splice(nafIndex, 0, dragRow);
10327
+ tableFullData.splice(ntfIndex, 0, dragRow);
10328
+ }
10282
10329
  reactData.isDragRowMove = true;
10283
10330
  $xeTable.cacheRowMap();
10284
10331
  $xeTable.updateScrollYStatus();
@@ -10330,8 +10377,7 @@ const Methods = {
10330
10377
  } = reactData;
10331
10378
  const offsetY = evnt.clientY - trEl.getBoundingClientRect().y;
10332
10379
  const dragPos = offsetY < trEl.clientHeight / 2 ? 'top' : 'bottom';
10333
- addClass(trEl, 'row--drag-active-target');
10334
- trEl.setAttribute('drag-pos', dragPos);
10380
+ updateRowDropTarget($xeTable, row, dragPos);
10335
10381
  internalData.prevDragRow = row;
10336
10382
  internalData.prevDragPos = dragPos;
10337
10383
  $xeTable.dispatchEvent('row-dragover', {
@@ -10366,7 +10412,7 @@ const Methods = {
10366
10412
  }
10367
10413
  reactData.dragRow = row;
10368
10414
  trEl.draggable = true;
10369
- addClass(trEl, 'row--drag-origin');
10415
+ updateRowDropOrigin($xeTable, row);
10370
10416
  showRowDropTip(evnt, $xeTable);
10371
10417
  updateRowDropTipContent($xeTable, tdEl);
10372
10418
  $xeTable.dispatchEvent('row-dragstart', params, evnt);
@@ -13230,7 +13276,7 @@ const cellType = 'header';
13230
13276
  tId,
13231
13277
  isGroup,
13232
13278
  visibleColumn,
13233
- resizable,
13279
+ resizable: allResizable,
13234
13280
  border,
13235
13281
  columnKey,
13236
13282
  headerRowClassName,
@@ -13401,7 +13447,7 @@ const cellType = 'header';
13401
13447
  /**
13402
13448
  * 列宽拖动
13403
13449
  */
13404
- !fixedHiddenColumn && !isColGroup && (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isBoolean(column.resizable) ? column.resizable : columnOpts.resizable || resizable) ? h('div', {
13450
+ !fixedHiddenColumn && !isColGroup && (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isBoolean(column.resizable) ? column.resizable : columnOpts.resizable || allResizable) ? h('div', {
13405
13451
  class: ['vxe-resizable', {
13406
13452
  'is--line': !border || border === 'none'
13407
13453
  }],
@@ -14416,6 +14462,7 @@ const renderPopupPanel = (h, _vm) => {
14416
14462
  customStore
14417
14463
  } = _vm;
14418
14464
  const {
14465
+ resizable: allResizable,
14419
14466
  customOpts,
14420
14467
  customColumnList,
14421
14468
  columnOpts,
@@ -14550,7 +14597,7 @@ const renderPopupPanel = (h, _vm) => {
14550
14597
  }
14551
14598
  }, colTitle)]), allowResizable ? h('td', {
14552
14599
  class: 'vxe-table-custom-popup--column-item col--resizable'
14553
- }, [column.children && column.children.length ? h('span', '-') : VxeUINumberInputComponent ? h(VxeUINumberInputComponent, {
14600
+ }, [column.children && column.children.length || !(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isBoolean(column.resizable) ? column.resizable : columnOpts.resizable || allResizable) ? h('span', '-') : VxeUINumberInputComponent ? h(VxeUINumberInputComponent, {
14554
14601
  props: {
14555
14602
  type: 'integer',
14556
14603
  disabled: isDisabled || isHidden,