vxe-table 4.10.13 → 4.10.14

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/lib/index.umd.js CHANGED
@@ -3138,7 +3138,7 @@ function eqEmptyValue(cellValue) {
3138
3138
  ;// ./packages/ui/index.ts
3139
3139
 
3140
3140
 
3141
- const version = "4.10.13";
3141
+ const version = "4.10.14";
3142
3142
  core_.VxeUI.version = version;
3143
3143
  core_.VxeUI.tableVersion = version;
3144
3144
  core_.VxeUI.setConfig({
@@ -3585,7 +3585,7 @@ var esnext_iterator_some = __webpack_require__(7550);
3585
3585
  const {
3586
3586
  log: log_log
3587
3587
  } = core_.VxeUI;
3588
- const log_version = `table v${"4.10.13"}`;
3588
+ const log_version = `table v${"4.10.14"}`;
3589
3589
  const warnLog = log_log.create('warn', log_version);
3590
3590
  const errLog = log_log.create('error', log_version);
3591
3591
  ;// ./packages/table/src/columnInfo.ts
@@ -20164,6 +20164,10 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
20164
20164
  }
20165
20165
  },
20166
20166
  triggerBodyScrollEvent(evnt, fixedType) {
20167
+ const {
20168
+ scrollYLoad,
20169
+ scrollXLoad
20170
+ } = reactData;
20167
20171
  const {
20168
20172
  elemStore,
20169
20173
  intoRunScroll,
@@ -20229,13 +20233,17 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
20229
20233
  setScrollTop(rightScrollElem, scrollTop);
20230
20234
  }
20231
20235
  setScrollTop(yHandleEl, scrollTop);
20232
- $xeTable.triggerScrollYEvent(evnt);
20236
+ if (scrollYLoad) {
20237
+ $xeTable.triggerScrollYEvent(evnt);
20238
+ }
20233
20239
  }
20234
20240
  if (isRollX) {
20235
20241
  setScrollLeft(xHandleEl, scrollLeft);
20236
20242
  setScrollLeft(headerScrollElem, scrollLeft);
20237
20243
  setScrollLeft(footerScrollElem, scrollLeft);
20238
- $xeTable.triggerScrollXEvent(evnt);
20244
+ if (scrollXLoad) {
20245
+ $xeTable.triggerScrollXEvent(evnt);
20246
+ }
20239
20247
  }
20240
20248
  $xeTable.handleScrollEvent(evnt, isRollY, isRollX, scrollTop, scrollLeft, {
20241
20249
  type: 'body',
@@ -20243,6 +20251,9 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
20243
20251
  });
20244
20252
  },
20245
20253
  triggerHeaderScrollEvent(evnt, fixedType) {
20254
+ const {
20255
+ scrollXLoad
20256
+ } = reactData;
20246
20257
  const {
20247
20258
  elemStore,
20248
20259
  intoRunScroll,
@@ -20279,13 +20290,18 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
20279
20290
  setScrollLeft(xHandleEl, scrollLeft);
20280
20291
  setScrollLeft(footerScrollElem, scrollLeft);
20281
20292
  setScrollLeft(bodyScrollElem, scrollLeft);
20282
- $xeTable.triggerScrollXEvent(evnt);
20293
+ if (scrollXLoad) {
20294
+ $xeTable.triggerScrollXEvent(evnt);
20295
+ }
20283
20296
  $xeTable.handleScrollEvent(evnt, isRollY, isRollX, scrollTop, scrollLeft, {
20284
20297
  type: 'header',
20285
20298
  fixed: fixedType
20286
20299
  });
20287
20300
  },
20288
20301
  triggerFooterScrollEvent(evnt, fixedType) {
20302
+ const {
20303
+ scrollXLoad
20304
+ } = reactData;
20289
20305
  const {
20290
20306
  elemStore,
20291
20307
  intoRunScroll,
@@ -20322,7 +20338,9 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
20322
20338
  setScrollLeft(xHandleEl, scrollLeft);
20323
20339
  setScrollLeft(headerScrollElem, scrollLeft);
20324
20340
  setScrollLeft(bodyScrollElem, scrollLeft);
20325
- $xeTable.triggerScrollXEvent(evnt);
20341
+ if (scrollXLoad) {
20342
+ $xeTable.triggerScrollXEvent(evnt);
20343
+ }
20326
20344
  $xeTable.handleScrollEvent(evnt, isRollY, isRollX, scrollTop, scrollLeft, {
20327
20345
  type: 'footer',
20328
20346
  fixed: fixedType
@@ -20340,6 +20358,9 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
20340
20358
  const {
20341
20359
  highlightHoverRow
20342
20360
  } = src_props;
20361
+ const {
20362
+ scrollYLoad
20363
+ } = reactData;
20343
20364
  const {
20344
20365
  elemStore,
20345
20366
  lastScrollTop,
@@ -20386,7 +20407,9 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
20386
20407
  setScrollTop(bodyScrollElem, currTopNum);
20387
20408
  setScrollTop(leftScrollElem, currTopNum);
20388
20409
  setScrollTop(rightScrollElem, currTopNum);
20389
- $xeTable.triggerScrollYEvent(evnt);
20410
+ if (scrollYLoad) {
20411
+ $xeTable.triggerScrollYEvent(evnt);
20412
+ }
20390
20413
  $xeTable.handleScrollEvent(evnt, isRollY, isRollX, currTopNum, scrollLeft, {
20391
20414
  type: 'table',
20392
20415
  fixed: ''
@@ -20405,6 +20428,9 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
20405
20428
  }
20406
20429
  },
20407
20430
  triggerVirtualScrollXEvent(evnt) {
20431
+ const {
20432
+ scrollXLoad
20433
+ } = reactData;
20408
20434
  const {
20409
20435
  elemStore,
20410
20436
  inWheelScroll,
@@ -20438,13 +20464,18 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
20438
20464
  setScrollLeft(bodyScrollElem, scrollLeft);
20439
20465
  setScrollLeft(headerScrollElem, scrollLeft);
20440
20466
  setScrollLeft(footerScrollElem, scrollLeft);
20441
- $xeTable.triggerScrollXEvent(evnt);
20467
+ if (scrollXLoad) {
20468
+ $xeTable.triggerScrollXEvent(evnt);
20469
+ }
20442
20470
  $xeTable.handleScrollEvent(evnt, isRollY, isRollX, scrollTop, scrollLeft, {
20443
20471
  type: 'table',
20444
20472
  fixed: ''
20445
20473
  });
20446
20474
  },
20447
20475
  triggerVirtualScrollYEvent(evnt) {
20476
+ const {
20477
+ scrollYLoad
20478
+ } = reactData;
20448
20479
  const {
20449
20480
  elemStore,
20450
20481
  inWheelScroll,
@@ -20478,7 +20509,9 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
20478
20509
  setScrollTop(bodyScrollElem, scrollTop);
20479
20510
  setScrollTop(leftScrollElem, scrollTop);
20480
20511
  setScrollTop(rightScrollElem, scrollTop);
20481
- $xeTable.triggerScrollYEvent(evnt);
20512
+ if (scrollYLoad) {
20513
+ $xeTable.triggerScrollYEvent(evnt);
20514
+ }
20482
20515
  $xeTable.handleScrollEvent(evnt, isRollY, isRollX, scrollTop, scrollLeft, {
20483
20516
  type: 'table',
20484
20517
  fixed: ''
@@ -22629,7 +22662,7 @@ edit_hook_hooks.add('tableEditModule', {
22629
22662
  }
22630
22663
  }
22631
22664
  };
22632
- function syncActivedCell() {
22665
+ const syncActivedCell = () => {
22633
22666
  const {
22634
22667
  editStore,
22635
22668
  tableColumn
@@ -22649,8 +22682,8 @@ edit_hook_hooks.add('tableEditModule', {
22649
22682
  setEditColumnModel(row, column);
22650
22683
  }
22651
22684
  }
22652
- }
22653
- function insertTreeRow(newRecords, isAppend) {
22685
+ };
22686
+ const insertTreeRow = (newRecords, isAppend) => {
22654
22687
  const {
22655
22688
  tableFullTreeData,
22656
22689
  afterFullData,
@@ -22731,7 +22764,7 @@ edit_hook_hooks.add('tableEditModule', {
22731
22764
  fullAllDataRowIdData[rowid] = rest;
22732
22765
  }
22733
22766
  });
22734
- }
22767
+ };
22735
22768
  const handleInsertRowAt = (records, targetRow, isInsertNextRow) => {
22736
22769
  const {
22737
22770
  treeConfig
@@ -23050,6 +23083,160 @@ edit_hook_hooks.add('tableEditModule', {
23050
23083
  }
23051
23084
  });
23052
23085
  };
23086
+ const handleEditActive = (params, evnt, isFocus) => {
23087
+ const {
23088
+ editConfig,
23089
+ mouseConfig
23090
+ } = props;
23091
+ const {
23092
+ editStore,
23093
+ tableColumn
23094
+ } = reactData;
23095
+ const editOpts = computeEditOpts.value;
23096
+ const {
23097
+ mode
23098
+ } = editOpts;
23099
+ const {
23100
+ actived,
23101
+ focused
23102
+ } = editStore;
23103
+ const {
23104
+ row,
23105
+ column
23106
+ } = params;
23107
+ const {
23108
+ editRender
23109
+ } = column;
23110
+ const cell = params.cell || $xeTable.getCellElement(row, column);
23111
+ const beforeEditMethod = editOpts.beforeEditMethod || editOpts.activeMethod;
23112
+ params.cell = cell;
23113
+ if (cell && isEnableConf(editConfig) && isEnableConf(editRender)) {
23114
+ // 激活编辑
23115
+ if (!$xeTable.isPendingByRow(row)) {
23116
+ if (actived.row !== row || (mode === 'cell' ? actived.column !== column : false)) {
23117
+ // 判断是否禁用编辑
23118
+ let type = 'edit-disabled';
23119
+ if (!beforeEditMethod || beforeEditMethod({
23120
+ ...params,
23121
+ $table: $xeTable,
23122
+ $grid: $xeTable.xegrid
23123
+ })) {
23124
+ if (mouseConfig) {
23125
+ $xeTable.clearSelected();
23126
+ if ($xeTable.clearCellAreas) {
23127
+ $xeTable.clearCellAreas();
23128
+ $xeTable.clearCopyCellArea();
23129
+ }
23130
+ }
23131
+ $xeTable.closeTooltip();
23132
+ if (actived.column) {
23133
+ handleClearEdit(evnt);
23134
+ }
23135
+ type = 'edit-activated';
23136
+ column.renderHeight = cell.offsetHeight;
23137
+ actived.args = params;
23138
+ actived.row = row;
23139
+ actived.column = column;
23140
+ if (mode === 'row') {
23141
+ tableColumn.forEach(column => getEditColumnModel(row, column));
23142
+ } else {
23143
+ getEditColumnModel(row, column);
23144
+ }
23145
+ const afterEditMethod = editOpts.afterEditMethod;
23146
+ (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)(() => {
23147
+ if (isFocus) {
23148
+ $xeTable.handleFocus(params, evnt);
23149
+ }
23150
+ if (afterEditMethod) {
23151
+ afterEditMethod({
23152
+ ...params,
23153
+ $table: $xeTable,
23154
+ $grid: $xeTable.xegrid
23155
+ });
23156
+ }
23157
+ });
23158
+ }
23159
+ $xeTable.dispatchEvent(type, {
23160
+ row,
23161
+ rowIndex: $xeTable.getRowIndex(row),
23162
+ $rowIndex: $xeTable.getVMRowIndex(row),
23163
+ column,
23164
+ columnIndex: $xeTable.getColumnIndex(column),
23165
+ $columnIndex: $xeTable.getVMColumnIndex(column)
23166
+ }, evnt);
23167
+ // v4已废弃
23168
+ if (type === 'edit-activated') {
23169
+ $xeTable.dispatchEvent('edit-actived', {
23170
+ row,
23171
+ rowIndex: $xeTable.getRowIndex(row),
23172
+ $rowIndex: $xeTable.getVMRowIndex(row),
23173
+ column,
23174
+ columnIndex: $xeTable.getColumnIndex(column),
23175
+ $columnIndex: $xeTable.getVMColumnIndex(column)
23176
+ }, evnt);
23177
+ }
23178
+ } else {
23179
+ const {
23180
+ column: oldColumn
23181
+ } = actived;
23182
+ if (mouseConfig) {
23183
+ $xeTable.clearSelected();
23184
+ if ($xeTable.clearCellAreas) {
23185
+ $xeTable.clearCellAreas();
23186
+ $xeTable.clearCopyCellArea();
23187
+ }
23188
+ }
23189
+ if (oldColumn !== column) {
23190
+ const {
23191
+ model: oldModel
23192
+ } = oldColumn;
23193
+ if (oldModel.update) {
23194
+ setCellValue(row, oldColumn, oldModel.value);
23195
+ }
23196
+ if ($xeTable.clearValidate) {
23197
+ $xeTable.clearValidate(row, column);
23198
+ }
23199
+ }
23200
+ column.renderHeight = cell.offsetHeight;
23201
+ actived.args = params;
23202
+ actived.column = column;
23203
+ if (isFocus) {
23204
+ setTimeout(() => {
23205
+ $xeTable.handleFocus(params, evnt);
23206
+ });
23207
+ }
23208
+ }
23209
+ focused.column = null;
23210
+ focused.row = null;
23211
+ $xeTable.focus();
23212
+ }
23213
+ }
23214
+ return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();
23215
+ };
23216
+ const handleEditCell = (row, fieldOrColumn, isPos) => {
23217
+ const {
23218
+ editConfig
23219
+ } = props;
23220
+ const column = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isString(fieldOrColumn) ? $xeTable.getColumnByField(fieldOrColumn) : fieldOrColumn;
23221
+ if (row && column && isEnableConf(editConfig) && isEnableConf(column.editRender)) {
23222
+ return Promise.resolve(isPos ? $xeTable.scrollToRow(row, column) : null).then(() => {
23223
+ const cell = $xeTable.getCellElement(row, column);
23224
+ if (cell) {
23225
+ handleEditActive({
23226
+ row,
23227
+ rowIndex: $xeTable.getRowIndex(row),
23228
+ column,
23229
+ columnIndex: $xeTable.getColumnIndex(column),
23230
+ cell,
23231
+ $table: $xeTable
23232
+ }, null, false);
23233
+ internalData._lastCallTime = Date.now();
23234
+ }
23235
+ return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();
23236
+ });
23237
+ }
23238
+ return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();
23239
+ };
23053
23240
  editMethods = {
23054
23241
  /**
23055
23242
  * 往表格中插入临时数据
@@ -23444,7 +23631,7 @@ edit_hook_hooks.add('tableEditModule', {
23444
23631
  if (fieldOrColumn) {
23445
23632
  column = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isString(fieldOrColumn) ? $xeTable.getColumnByField(fieldOrColumn) : fieldOrColumn;
23446
23633
  }
23447
- return $xeTable.setEditCell(row, column);
23634
+ return handleEditCell(row, column, false);
23448
23635
  },
23449
23636
  setActiveCell(row, fieldOrColumn) {
23450
23637
  if (true) {
@@ -23457,28 +23644,7 @@ edit_hook_hooks.add('tableEditModule', {
23457
23644
  * 激活单元格编辑
23458
23645
  */
23459
23646
  setEditCell(row, fieldOrColumn) {
23460
- const {
23461
- editConfig
23462
- } = props;
23463
- const column = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isString(fieldOrColumn) ? $xeTable.getColumnByField(fieldOrColumn) : fieldOrColumn;
23464
- if (row && column && isEnableConf(editConfig) && isEnableConf(column.editRender)) {
23465
- return $xeTable.scrollToRow(row, column).then(() => {
23466
- const cell = $xeTable.getCellElement(row, column);
23467
- if (cell) {
23468
- editPrivateMethods.handleEdit({
23469
- row,
23470
- rowIndex: $xeTable.getRowIndex(row),
23471
- column,
23472
- columnIndex: $xeTable.getColumnIndex(column),
23473
- cell,
23474
- $table: $xeTable
23475
- });
23476
- internalData._lastCallTime = Date.now();
23477
- }
23478
- return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();
23479
- });
23480
- }
23481
- return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();
23647
+ return handleEditCell(row, fieldOrColumn, true);
23482
23648
  },
23483
23649
  /**
23484
23650
  * 只对 trigger=dblclick 有效,选中单元格
@@ -23511,130 +23677,7 @@ edit_hook_hooks.add('tableEditModule', {
23511
23677
  * 处理激活编辑
23512
23678
  */
23513
23679
  handleEdit(params, evnt) {
23514
- const {
23515
- editConfig,
23516
- mouseConfig
23517
- } = props;
23518
- const {
23519
- editStore,
23520
- tableColumn
23521
- } = reactData;
23522
- const editOpts = computeEditOpts.value;
23523
- const {
23524
- mode
23525
- } = editOpts;
23526
- const {
23527
- actived,
23528
- focused
23529
- } = editStore;
23530
- const {
23531
- row,
23532
- column
23533
- } = params;
23534
- const {
23535
- editRender
23536
- } = column;
23537
- const cell = params.cell || $xeTable.getCellElement(row, column);
23538
- const beforeEditMethod = editOpts.beforeEditMethod || editOpts.activeMethod;
23539
- params.cell = cell;
23540
- if (cell && isEnableConf(editConfig) && isEnableConf(editRender)) {
23541
- // 激活编辑
23542
- if (!$xeTable.isPendingByRow(row)) {
23543
- if (actived.row !== row || (mode === 'cell' ? actived.column !== column : false)) {
23544
- // 判断是否禁用编辑
23545
- let type = 'edit-disabled';
23546
- if (!beforeEditMethod || beforeEditMethod({
23547
- ...params,
23548
- $table: $xeTable,
23549
- $grid: $xeTable.xegrid
23550
- })) {
23551
- if (mouseConfig) {
23552
- editMethods.clearSelected();
23553
- if ($xeTable.clearCellAreas) {
23554
- $xeTable.clearCellAreas();
23555
- $xeTable.clearCopyCellArea();
23556
- }
23557
- }
23558
- $xeTable.closeTooltip();
23559
- if (actived.column) {
23560
- handleClearEdit(evnt);
23561
- }
23562
- type = 'edit-activated';
23563
- column.renderHeight = cell.offsetHeight;
23564
- actived.args = params;
23565
- actived.row = row;
23566
- actived.column = column;
23567
- if (mode === 'row') {
23568
- tableColumn.forEach(column => getEditColumnModel(row, column));
23569
- } else {
23570
- getEditColumnModel(row, column);
23571
- }
23572
- const afterEditMethod = editOpts.afterEditMethod;
23573
- (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)(() => {
23574
- editPrivateMethods.handleFocus(params, evnt);
23575
- if (afterEditMethod) {
23576
- afterEditMethod({
23577
- ...params,
23578
- $table: $xeTable,
23579
- $grid: $xeTable.xegrid
23580
- });
23581
- }
23582
- });
23583
- }
23584
- $xeTable.dispatchEvent(type, {
23585
- row,
23586
- rowIndex: $xeTable.getRowIndex(row),
23587
- $rowIndex: $xeTable.getVMRowIndex(row),
23588
- column,
23589
- columnIndex: $xeTable.getColumnIndex(column),
23590
- $columnIndex: $xeTable.getVMColumnIndex(column)
23591
- }, evnt);
23592
- // v4已废弃
23593
- if (type === 'edit-activated') {
23594
- $xeTable.dispatchEvent('edit-actived', {
23595
- row,
23596
- rowIndex: $xeTable.getRowIndex(row),
23597
- $rowIndex: $xeTable.getVMRowIndex(row),
23598
- column,
23599
- columnIndex: $xeTable.getColumnIndex(column),
23600
- $columnIndex: $xeTable.getVMColumnIndex(column)
23601
- }, evnt);
23602
- }
23603
- } else {
23604
- const {
23605
- column: oldColumn
23606
- } = actived;
23607
- if (mouseConfig) {
23608
- editMethods.clearSelected();
23609
- if ($xeTable.clearCellAreas) {
23610
- $xeTable.clearCellAreas();
23611
- $xeTable.clearCopyCellArea();
23612
- }
23613
- }
23614
- if (oldColumn !== column) {
23615
- const {
23616
- model: oldModel
23617
- } = oldColumn;
23618
- if (oldModel.update) {
23619
- setCellValue(row, oldColumn, oldModel.value);
23620
- }
23621
- if ($xeTable.clearValidate) {
23622
- $xeTable.clearValidate(row, column);
23623
- }
23624
- }
23625
- column.renderHeight = cell.offsetHeight;
23626
- actived.args = params;
23627
- actived.column = column;
23628
- setTimeout(() => {
23629
- editPrivateMethods.handleFocus(params, evnt);
23630
- });
23631
- }
23632
- focused.column = null;
23633
- focused.row = null;
23634
- $xeTable.focus();
23635
- }
23636
- }
23637
- return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();
23680
+ return handleEditActive(params, evnt, true);
23638
23681
  },
23639
23682
  /**
23640
23683
  * @deprecated