vxe-table 3.11.17 → 3.11.19

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.
@@ -634,8 +634,10 @@ const Methods = {
634
634
  * @param {Array} datas 数据
635
635
  */
636
636
  loadTableData(datas) {
637
+ const $xeTable = this;
637
638
  const { keepSource, showOverflow, treeConfig, treeOpts, editStore, scrollYStore, scrollXStore, lastScrollLeft, lastScrollTop, scrollYLoad: oldScrollYLoad, sXOpts, sYOpts } = this;
638
639
  const childrenField = treeOpts.children || treeOpts.childrenField;
640
+ const rowOpts = $xeTable.computeRowOpts;
639
641
  let treeData = [];
640
642
  let fullData = datas ? datas.slice(0) : [];
641
643
  if (treeConfig) {
@@ -698,9 +700,11 @@ const Methods = {
698
700
  }
699
701
  if (sYLoad) {
700
702
  if (showOverflow) {
701
- const errColumn = this.tableFullColumn.find((column) => column.showOverflow === false);
702
- if (errColumn) {
703
- errLog('vxe.error.errProp', [`column[field="${errColumn.field}"].show-overflow=false`, 'show-overflow=true']);
703
+ if (!rowOpts.height) {
704
+ const errColumn = this.tableFullColumn.find((column) => column.showOverflow === false);
705
+ if (errColumn) {
706
+ errLog('vxe.error.errProp', [`column[field="${errColumn.field}"].show-overflow=false`, 'show-overflow=true']);
707
+ }
704
708
  }
705
709
  }
706
710
  if (process.env.NODE_ENV === 'development') {
@@ -2237,7 +2241,7 @@ const Methods = {
2237
2241
  const isCustomVisible = isAllCustom || storageOpts.visible;
2238
2242
  const isCustomFixed = isAllCustom || storageOpts.fixed;
2239
2243
  const isCustomSort = isAllCustom || storageOpts.sort;
2240
- if (customConfig && (isCustomResizable || isCustomVisible || isCustomFixed || isCustomSort)) {
2244
+ if ((customConfig ? isEnableConf(customOpts) : customOpts.enabled) && (isCustomResizable || isCustomVisible || isCustomFixed || isCustomSort)) {
2241
2245
  if (!tableId) {
2242
2246
  errLog('vxe.error.reqProp', ['id']);
2243
2247
  return;
@@ -2334,7 +2338,11 @@ const Methods = {
2334
2338
  return storeData;
2335
2339
  },
2336
2340
  saveCustomStore(type) {
2337
- const { tableId, customOpts } = this;
2341
+ const $xeTable = this;
2342
+ const props = $xeTable;
2343
+ const { customConfig } = props;
2344
+ const tableId = $xeTable.computeTableId;
2345
+ const customOpts = $xeTable.computeCustomOpts;
2338
2346
  const { updateStore, storage } = customOpts;
2339
2347
  const isAllCustom = storage === true;
2340
2348
  const storageOpts = isAllCustom ? {} : Object.assign({}, storage || {});
@@ -2342,7 +2350,7 @@ const Methods = {
2342
2350
  const isCustomVisible = isAllCustom || storageOpts.visible;
2343
2351
  const isCustomFixed = isAllCustom || storageOpts.fixed;
2344
2352
  const isCustomSort = isAllCustom || storageOpts.sort;
2345
- if (isCustomResizable || isCustomVisible || isCustomFixed || isCustomSort) {
2353
+ if ((customConfig ? isEnableConf(customOpts) : customOpts.enabled) && (isCustomResizable || isCustomVisible || isCustomFixed || isCustomSort)) {
2346
2354
  if (!tableId) {
2347
2355
  errLog('vxe.error.reqProp', ['id']);
2348
2356
  return this.$nextTick();
@@ -2396,6 +2404,11 @@ const Methods = {
2396
2404
  * 将固定的列左边、右边分别靠边
2397
2405
  */
2398
2406
  parseColumns() {
2407
+ const $xeTable = this;
2408
+ const props = $xeTable;
2409
+ const internalData = $xeTable;
2410
+ const { showOverflow } = props;
2411
+ const rowOpts = $xeTable.computeRowOpts;
2399
2412
  const leftList = [];
2400
2413
  const centerList = [];
2401
2414
  const rightList = [];
@@ -2466,6 +2479,14 @@ const Methods = {
2466
2479
  this.hasFixedColumn = leftList.length > 0 || rightList.length > 0;
2467
2480
  Object.assign(columnStore, { leftList, centerList, rightList });
2468
2481
  if (scrollXLoad) {
2482
+ if (showOverflow) {
2483
+ if (!rowOpts.height) {
2484
+ const errColumn = internalData.tableFullColumn.find((column) => column.showOverflow === false);
2485
+ if (errColumn) {
2486
+ errLog('vxe.error.errProp', [`column[field="${errColumn.field}"].show-overflow=false`, 'show-overflow=true']);
2487
+ }
2488
+ }
2489
+ }
2469
2490
  if (process.env.NODE_ENV === 'development') {
2470
2491
  // if (this.showHeader && !this.showHeaderOverflow) {
2471
2492
  // warnLog('vxe.error.reqProp', ['show-header-overflow'])
@@ -2612,11 +2633,7 @@ const Methods = {
2612
2633
  },
2613
2634
  calcCellWidth() {
2614
2635
  const $xeTable = this;
2615
- const { autoWidthColumnList, tableData } = this;
2616
- if (!tableData.length || !autoWidthColumnList.length) {
2617
- this.isCalcColumn = false;
2618
- return this.$nextTick();
2619
- }
2636
+ const { autoWidthColumnList } = this;
2620
2637
  this.isCalcColumn = true;
2621
2638
  return this.$nextTick().then(() => {
2622
2639
  const internalData = $xeTable;
@@ -3346,9 +3363,12 @@ const Methods = {
3346
3363
  * 全局键盘事件
3347
3364
  */
3348
3365
  handleGlobalKeydownEvent(evnt) {
3366
+ const $xeTable = this;
3367
+ const internalData = $xeTable;
3349
3368
  // 该行为只对当前激活的表格有效
3350
3369
  if (this.isActivated) {
3351
3370
  this.preventEvent(evnt, 'event.keydown', null, () => {
3371
+ const { afterFullData } = internalData;
3352
3372
  const { filterStore, isCtxMenu, ctxMenuStore, editStore, editOpts, editConfig, mouseConfig, mouseOpts, keyboardConfig, keyboardOpts, treeConfig, treeOpts, highlightCurrentRow, currentRow, bodyCtxMenu, rowOpts } = this;
3353
3373
  const { selected, actived } = editStore;
3354
3374
  const { keyCode } = evnt;
@@ -3421,6 +3441,7 @@ const Methods = {
3421
3441
  }, 1000);
3422
3442
  }
3423
3443
  else if (isEnter && !hasAltKey && keyboardConfig && keyboardOpts.isEnter && (selected.row || actived.row || (treeConfig && (rowOpts.isCurrent || highlightCurrentRow) && currentRow))) {
3444
+ const { isLastEnterAppendRow, beforeEnterMethod, enterMethod } = keyboardOpts;
3424
3445
  // 退出选中
3425
3446
  if (hasCtrlKey) {
3426
3447
  // 如果是激活编辑状态,则取消编辑
@@ -3436,21 +3457,51 @@ const Methods = {
3436
3457
  else {
3437
3458
  // 如果是激活状态,退则出到上一行/下一行
3438
3459
  if (selected.row || actived.row) {
3439
- const targetArgs = selected.row ? selected.args : actived.args;
3460
+ const activeParams = selected.row ? selected.args : actived.args;
3440
3461
  if (hasShiftKey) {
3441
3462
  if (keyboardOpts.enterToTab) {
3442
- this.moveTabSelected(targetArgs, hasShiftKey, evnt);
3463
+ this.moveTabSelected(activeParams, hasShiftKey, evnt);
3443
3464
  }
3444
3465
  else {
3445
- this.moveSelected(targetArgs, isLeftArrow, true, isRightArrow, false, evnt);
3466
+ this.moveSelected(activeParams, isLeftArrow, true, isRightArrow, false, evnt);
3446
3467
  }
3447
3468
  }
3448
3469
  else {
3449
3470
  if (keyboardOpts.enterToTab) {
3450
- this.moveTabSelected(targetArgs, hasShiftKey, evnt);
3471
+ this.moveTabSelected(activeParams, hasShiftKey, evnt);
3451
3472
  }
3452
3473
  else {
3453
- this.moveSelected(targetArgs, isLeftArrow, false, isRightArrow, true, evnt);
3474
+ const activeRow = selected.row || actived.row;
3475
+ const activeColumn = selected.column || actived.column;
3476
+ const _rowIndex = $xeTable.getVTRowIndex(activeRow);
3477
+ const etrParams = {
3478
+ row: activeRow,
3479
+ rowIndex: $xeTable.getRowIndex(activeRow),
3480
+ $rowIndex: $xeTable.getVMRowIndex(activeRow),
3481
+ _rowIndex,
3482
+ column: activeColumn,
3483
+ columnIndex: $xeTable.getColumnIndex(activeColumn),
3484
+ $columnIndex: $xeTable.getVMColumnIndex(activeColumn),
3485
+ _columnIndex: $xeTable.getVTColumnIndex(activeColumn),
3486
+ $table: $xeTable
3487
+ };
3488
+ if (!beforeEnterMethod || beforeEnterMethod(etrParams) !== false) {
3489
+ // 最后一行按下回车键,自动追加一行
3490
+ if (isLastEnterAppendRow) {
3491
+ if (_rowIndex >= afterFullData.length - 1) {
3492
+ $xeTable.insertAt({}, -1).then(({ row: newRow }) => {
3493
+ $xeTable.scrollToRow(newRow, selected.column);
3494
+ $xeTable.handleSelected(Object.assign(Object.assign({}, activeParams), { row: newRow }), evnt);
3495
+ });
3496
+ $xeTable.dispatchEvent('enter-append-row', etrParams, evnt);
3497
+ return;
3498
+ }
3499
+ }
3500
+ this.moveSelected(activeParams, isLeftArrow, false, isRightArrow, true, evnt);
3501
+ if (enterMethod) {
3502
+ enterMethod(etrParams);
3503
+ }
3504
+ }
3454
3505
  }
3455
3506
  }
3456
3507
  }
@@ -3517,7 +3568,7 @@ const Methods = {
3517
3568
  }
3518
3569
  else if (hasBackspaceKey && keyboardConfig && keyboardOpts.isBack && isEnableConf(editConfig) && (selected.row || selected.column)) {
3519
3570
  if (!isEditStatus) {
3520
- const { backMethod } = keyboardOpts;
3571
+ const { editMode, backMethod } = keyboardOpts;
3521
3572
  // 如果是删除键
3522
3573
  if (keyboardOpts.isDel && isEnableConf(editConfig) && (selected.row || selected.column)) {
3523
3574
  const params = {
@@ -3534,7 +3585,10 @@ const Methods = {
3534
3585
  backMethod(params);
3535
3586
  }
3536
3587
  else {
3537
- setCellValue(selected.row, selected.column, null);
3588
+ // 追加方式与覆盖式
3589
+ if (editMode !== 'insert') {
3590
+ setCellValue(selected.row, selected.column, null);
3591
+ }
3538
3592
  this.handleEdit(selected.args, evnt);
3539
3593
  }
3540
3594
  this.emitEvent('cell-backspace-value', params, evnt);
@@ -6162,7 +6216,7 @@ const Methods = {
6162
6216
  $xeTable.checkScrolling();
6163
6217
  internalData.lastScrollLeft = scrollLeft;
6164
6218
  }
6165
- else {
6219
+ if (isRollY) {
6166
6220
  const yThreshold = $xeTable.computeScrollYThreshold;
6167
6221
  isTop = scrollTop <= 0;
6168
6222
  if (!isTop) {
@@ -6275,7 +6329,7 @@ const Methods = {
6275
6329
  scrollXEvent(evnt) {
6276
6330
  const $xeTable = this;
6277
6331
  const internalData = $xeTable;
6278
- const { inFooterScroll, inBodyScroll } = internalData;
6332
+ const { inFooterScroll, inBodyScroll, lastScrollTop } = internalData;
6279
6333
  if (inFooterScroll) {
6280
6334
  return;
6281
6335
  }
@@ -6288,10 +6342,16 @@ const Methods = {
6288
6342
  const bodyElem = tableBody.$el;
6289
6343
  const headerElem = tableHeader ? tableHeader.$el : null;
6290
6344
  const footerElem = tableFooter ? tableFooter.$el : null;
6345
+ const yHandleEl = $xeTable.$refs.refScrollYHandleElem;
6291
6346
  const wrapperEl = evnt.currentTarget;
6292
- const { scrollTop, scrollLeft } = wrapperEl;
6347
+ const { scrollLeft } = wrapperEl;
6348
+ const yBodyEl = yHandleEl || bodyElem;
6349
+ let scrollTop = 0;
6350
+ if (yBodyEl) {
6351
+ scrollTop = yBodyEl.scrollTop;
6352
+ }
6293
6353
  const isRollX = true;
6294
- const isRollY = false;
6354
+ const isRollY = scrollTop !== lastScrollTop;
6295
6355
  internalData.inVirtualScroll = true;
6296
6356
  setScrollLeft(bodyElem, scrollLeft);
6297
6357
  setScrollLeft(headerElem, scrollLeft);
@@ -6305,7 +6365,7 @@ const Methods = {
6305
6365
  scrollYEvent(evnt) {
6306
6366
  const $xeTable = this;
6307
6367
  const internalData = $xeTable;
6308
- const { inFooterScroll, inBodyScroll } = internalData;
6368
+ const { inFooterScroll, inBodyScroll, lastScrollLeft } = internalData;
6309
6369
  if (inFooterScroll) {
6310
6370
  return;
6311
6371
  }
@@ -6318,9 +6378,15 @@ const Methods = {
6318
6378
  const bodyElem = tableBody.$el;
6319
6379
  const leftElem = leftBody ? leftBody.$el : null;
6320
6380
  const rightElem = rightBody ? rightBody.$el : null;
6381
+ const xHandleEl = $xeTable.$refs.refScrollXHandleElem;
6321
6382
  const wrapperEl = evnt.currentTarget;
6322
- const { scrollTop, scrollLeft } = wrapperEl;
6323
- const isRollX = false;
6383
+ const { scrollTop } = wrapperEl;
6384
+ const xBodyEl = xHandleEl || bodyElem;
6385
+ let scrollLeft = 0;
6386
+ if (xBodyEl) {
6387
+ scrollLeft = xBodyEl.scrollLeft;
6388
+ }
6389
+ const isRollX = scrollLeft !== lastScrollLeft;
6324
6390
  const isRollY = true;
6325
6391
  internalData.inVirtualScroll = true;
6326
6392
  setScrollTop(bodyElem, scrollTop);
@@ -6564,7 +6630,7 @@ const Methods = {
6564
6630
  }
6565
6631
  }
6566
6632
  if (this.scrollXLoad || this.scrollYLoad) {
6567
- return new Promise(resolve => setTimeout(() => resolve(this.$nextTick()), 50));
6633
+ return new Promise(resolve => setTimeout(() => resolve(this.$nextTick()), 30));
6568
6634
  }
6569
6635
  return this.$nextTick();
6570
6636
  },
@@ -397,6 +397,9 @@ export default {
397
397
  };
398
398
  },
399
399
  computed: Object.assign(Object.assign({}, {}), { tableId() {
400
+ return this.computeTableId;
401
+ },
402
+ computeTableId() {
400
403
  const { id } = this;
401
404
  if (id) {
402
405
  if (XEUtils.isFunction(id)) {
@@ -878,8 +881,10 @@ export default {
878
881
  }
879
882
  if (process.env.NODE_ENV === 'development') {
880
883
  const customOpts = this.customOpts;
881
- if (!this.id && this.customConfig && (customOpts.storage === true || (customOpts.storage && customOpts.storage.resizable) || (customOpts.storage && customOpts.storage.visible))) {
882
- errLog('vxe.error.reqProp', ['id']);
884
+ if (!this.id) {
885
+ if ((this.customConfig ? isEnableConf(customOpts) : customOpts.enabled) && customOpts.storage) {
886
+ errLog('vxe.error.reqProp', ['id']);
887
+ }
883
888
  }
884
889
  if (this.treeConfig && this.checkboxOpts.range) {
885
890
  errLog('vxe.error.noTree', ['checkbox-config.range']);
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.11.17";
3
+ export const version = "3.11.19";
4
4
  VxeUI.version = version;
5
5
  VxeUI.tableVersion = version;
6
6
  VxeUI.setConfig({
@@ -69,6 +69,7 @@ VxeUI.setConfig({
69
69
  // visibleMethod () {}
70
70
  // },
71
71
  customConfig: {
72
+ // enabled: false,
72
73
  allowVisible: true,
73
74
  allowResizable: true,
74
75
  allowFixed: true,
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.11.17"}`;
3
+ const version = `table v${"3.11.19"}`;
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.11.17";
2223
+ const version = "3.11.19";
2224
2224
  core_.VxeUI.version = version;
2225
2225
  core_.VxeUI.tableVersion = version;
2226
2226
  core_.VxeUI.setConfig({
@@ -2289,6 +2289,7 @@ core_.VxeUI.setConfig({
2289
2289
  // visibleMethod () {}
2290
2290
  // },
2291
2291
  customConfig: {
2292
+ // enabled: false,
2292
2293
  allowVisible: true,
2293
2294
  allowResizable: true,
2294
2295
  allowFixed: true,
@@ -2778,7 +2779,7 @@ function isNodeElement(elem) {
2778
2779
  const {
2779
2780
  log: log_log
2780
2781
  } = core_.VxeUI;
2781
- const log_version = `table v${"3.11.17"}`;
2782
+ const log_version = `table v${"3.11.19"}`;
2782
2783
  const warnLog = log_log.create('warn', log_version);
2783
2784
  const errLog = log_log.create('error', log_version);
2784
2785
  ;// CONCATENATED MODULE: ./packages/table/src/columnInfo.ts
@@ -5587,6 +5588,7 @@ const Methods = {
5587
5588
  * @param {Array} datas 数据
5588
5589
  */
5589
5590
  loadTableData(datas) {
5591
+ const $xeTable = this;
5590
5592
  const {
5591
5593
  keepSource,
5592
5594
  showOverflow,
@@ -5602,6 +5604,7 @@ const Methods = {
5602
5604
  sYOpts
5603
5605
  } = this;
5604
5606
  const childrenField = treeOpts.children || treeOpts.childrenField;
5607
+ const rowOpts = $xeTable.computeRowOpts;
5605
5608
  let treeData = [];
5606
5609
  let fullData = datas ? datas.slice(0) : [];
5607
5610
  if (treeConfig) {
@@ -5663,9 +5666,11 @@ const Methods = {
5663
5666
  }
5664
5667
  if (sYLoad) {
5665
5668
  if (showOverflow) {
5666
- const errColumn = this.tableFullColumn.find(column => column.showOverflow === false);
5667
- if (errColumn) {
5668
- errLog('vxe.error.errProp', [`column[field="${errColumn.field}"].show-overflow=false`, 'show-overflow=true']);
5669
+ if (!rowOpts.height) {
5670
+ const errColumn = this.tableFullColumn.find(column => column.showOverflow === false);
5671
+ if (errColumn) {
5672
+ errLog('vxe.error.errProp', [`column[field="${errColumn.field}"].show-overflow=false`, 'show-overflow=true']);
5673
+ }
5669
5674
  }
5670
5675
  }
5671
5676
  if (true) {
@@ -7513,7 +7518,7 @@ const Methods = {
7513
7518
  const isCustomVisible = isAllCustom || storageOpts.visible;
7514
7519
  const isCustomFixed = isAllCustom || storageOpts.fixed;
7515
7520
  const isCustomSort = isAllCustom || storageOpts.sort;
7516
- if (customConfig && (isCustomResizable || isCustomVisible || isCustomFixed || isCustomSort)) {
7521
+ if ((customConfig ? isEnableConf(customOpts) : customOpts.enabled) && (isCustomResizable || isCustomVisible || isCustomFixed || isCustomSort)) {
7517
7522
  if (!tableId) {
7518
7523
  errLog('vxe.error.reqProp', ['id']);
7519
7524
  return;
@@ -7620,10 +7625,13 @@ const Methods = {
7620
7625
  return storeData;
7621
7626
  },
7622
7627
  saveCustomStore(type) {
7628
+ const $xeTable = this;
7629
+ const props = $xeTable;
7623
7630
  const {
7624
- tableId,
7625
- customOpts
7626
- } = this;
7631
+ customConfig
7632
+ } = props;
7633
+ const tableId = $xeTable.computeTableId;
7634
+ const customOpts = $xeTable.computeCustomOpts;
7627
7635
  const {
7628
7636
  updateStore,
7629
7637
  storage
@@ -7634,7 +7642,7 @@ const Methods = {
7634
7642
  const isCustomVisible = isAllCustom || storageOpts.visible;
7635
7643
  const isCustomFixed = isAllCustom || storageOpts.fixed;
7636
7644
  const isCustomSort = isAllCustom || storageOpts.sort;
7637
- if (isCustomResizable || isCustomVisible || isCustomFixed || isCustomSort) {
7645
+ if ((customConfig ? isEnableConf(customOpts) : customOpts.enabled) && (isCustomResizable || isCustomVisible || isCustomFixed || isCustomSort)) {
7638
7646
  if (!tableId) {
7639
7647
  errLog('vxe.error.reqProp', ['id']);
7640
7648
  return this.$nextTick();
@@ -7685,6 +7693,13 @@ const Methods = {
7685
7693
  * 将固定的列左边、右边分别靠边
7686
7694
  */
7687
7695
  parseColumns() {
7696
+ const $xeTable = this;
7697
+ const props = $xeTable;
7698
+ const internalData = $xeTable;
7699
+ const {
7700
+ showOverflow
7701
+ } = props;
7702
+ const rowOpts = $xeTable.computeRowOpts;
7688
7703
  const leftList = [];
7689
7704
  const centerList = [];
7690
7705
  const rightList = [];
@@ -7759,6 +7774,14 @@ const Methods = {
7759
7774
  rightList
7760
7775
  });
7761
7776
  if (scrollXLoad) {
7777
+ if (showOverflow) {
7778
+ if (!rowOpts.height) {
7779
+ const errColumn = internalData.tableFullColumn.find(column => column.showOverflow === false);
7780
+ if (errColumn) {
7781
+ errLog('vxe.error.errProp', [`column[field="${errColumn.field}"].show-overflow=false`, 'show-overflow=true']);
7782
+ }
7783
+ }
7784
+ }
7762
7785
  if (true) {
7763
7786
  // if (this.showHeader && !this.showHeaderOverflow) {
7764
7787
  // warnLog('vxe.error.reqProp', ['show-header-overflow'])
@@ -7926,13 +7949,8 @@ const Methods = {
7926
7949
  calcCellWidth() {
7927
7950
  const $xeTable = this;
7928
7951
  const {
7929
- autoWidthColumnList,
7930
- tableData
7952
+ autoWidthColumnList
7931
7953
  } = this;
7932
- if (!tableData.length || !autoWidthColumnList.length) {
7933
- this.isCalcColumn = false;
7934
- return this.$nextTick();
7935
- }
7936
7954
  this.isCalcColumn = true;
7937
7955
  return this.$nextTick().then(() => {
7938
7956
  const internalData = $xeTable;
@@ -8751,9 +8769,14 @@ const Methods = {
8751
8769
  * 全局键盘事件
8752
8770
  */
8753
8771
  handleGlobalKeydownEvent(evnt) {
8772
+ const $xeTable = this;
8773
+ const internalData = $xeTable;
8754
8774
  // 该行为只对当前激活的表格有效
8755
8775
  if (this.isActivated) {
8756
8776
  this.preventEvent(evnt, 'event.keydown', null, () => {
8777
+ const {
8778
+ afterFullData
8779
+ } = internalData;
8757
8780
  const {
8758
8781
  filterStore,
8759
8782
  isCtxMenu,
@@ -8841,6 +8864,11 @@ const Methods = {
8841
8864
  this._keyCtx = false;
8842
8865
  }, 1000);
8843
8866
  } else if (isEnter && !hasAltKey && keyboardConfig && keyboardOpts.isEnter && (selected.row || actived.row || treeConfig && (rowOpts.isCurrent || highlightCurrentRow) && currentRow)) {
8867
+ const {
8868
+ isLastEnterAppendRow,
8869
+ beforeEnterMethod,
8870
+ enterMethod
8871
+ } = keyboardOpts;
8844
8872
  // 退出选中
8845
8873
  if (hasCtrlKey) {
8846
8874
  // 如果是激活编辑状态,则取消编辑
@@ -8855,18 +8883,53 @@ const Methods = {
8855
8883
  } else {
8856
8884
  // 如果是激活状态,退则出到上一行/下一行
8857
8885
  if (selected.row || actived.row) {
8858
- const targetArgs = selected.row ? selected.args : actived.args;
8886
+ const activeParams = selected.row ? selected.args : actived.args;
8859
8887
  if (hasShiftKey) {
8860
8888
  if (keyboardOpts.enterToTab) {
8861
- this.moveTabSelected(targetArgs, hasShiftKey, evnt);
8889
+ this.moveTabSelected(activeParams, hasShiftKey, evnt);
8862
8890
  } else {
8863
- this.moveSelected(targetArgs, isLeftArrow, true, isRightArrow, false, evnt);
8891
+ this.moveSelected(activeParams, isLeftArrow, true, isRightArrow, false, evnt);
8864
8892
  }
8865
8893
  } else {
8866
8894
  if (keyboardOpts.enterToTab) {
8867
- this.moveTabSelected(targetArgs, hasShiftKey, evnt);
8895
+ this.moveTabSelected(activeParams, hasShiftKey, evnt);
8868
8896
  } else {
8869
- this.moveSelected(targetArgs, isLeftArrow, false, isRightArrow, true, evnt);
8897
+ const activeRow = selected.row || actived.row;
8898
+ const activeColumn = selected.column || actived.column;
8899
+ const _rowIndex = $xeTable.getVTRowIndex(activeRow);
8900
+ const etrParams = {
8901
+ row: activeRow,
8902
+ rowIndex: $xeTable.getRowIndex(activeRow),
8903
+ $rowIndex: $xeTable.getVMRowIndex(activeRow),
8904
+ _rowIndex,
8905
+ column: activeColumn,
8906
+ columnIndex: $xeTable.getColumnIndex(activeColumn),
8907
+ $columnIndex: $xeTable.getVMColumnIndex(activeColumn),
8908
+ _columnIndex: $xeTable.getVTColumnIndex(activeColumn),
8909
+ $table: $xeTable
8910
+ };
8911
+ if (!beforeEnterMethod || beforeEnterMethod(etrParams) !== false) {
8912
+ // 最后一行按下回车键,自动追加一行
8913
+ if (isLastEnterAppendRow) {
8914
+ if (_rowIndex >= afterFullData.length - 1) {
8915
+ $xeTable.insertAt({}, -1).then(({
8916
+ row: newRow
8917
+ }) => {
8918
+ $xeTable.scrollToRow(newRow, selected.column);
8919
+ $xeTable.handleSelected({
8920
+ ...activeParams,
8921
+ row: newRow
8922
+ }, evnt);
8923
+ });
8924
+ $xeTable.dispatchEvent('enter-append-row', etrParams, evnt);
8925
+ return;
8926
+ }
8927
+ }
8928
+ this.moveSelected(activeParams, isLeftArrow, false, isRightArrow, true, evnt);
8929
+ if (enterMethod) {
8930
+ enterMethod(etrParams);
8931
+ }
8932
+ }
8870
8933
  }
8871
8934
  }
8872
8935
  } else if (treeConfig && (rowOpts.isCurrent || highlightCurrentRow) && currentRow) {
@@ -8929,6 +8992,7 @@ const Methods = {
8929
8992
  } else if (hasBackspaceKey && keyboardConfig && keyboardOpts.isBack && isEnableConf(editConfig) && (selected.row || selected.column)) {
8930
8993
  if (!isEditStatus) {
8931
8994
  const {
8995
+ editMode,
8932
8996
  backMethod
8933
8997
  } = keyboardOpts;
8934
8998
  // 如果是删除键
@@ -8946,7 +9010,10 @@ const Methods = {
8946
9010
  if (backMethod) {
8947
9011
  backMethod(params);
8948
9012
  } else {
8949
- setCellValue(selected.row, selected.column, null);
9013
+ // 追加方式与覆盖式
9014
+ if (editMode !== 'insert') {
9015
+ setCellValue(selected.row, selected.column, null);
9016
+ }
8950
9017
  this.handleEdit(selected.args, evnt);
8951
9018
  }
8952
9019
  this.emitEvent('cell-backspace-value', params, evnt);
@@ -12177,7 +12244,8 @@ const Methods = {
12177
12244
  }
12178
12245
  $xeTable.checkScrolling();
12179
12246
  internalData.lastScrollLeft = scrollLeft;
12180
- } else {
12247
+ }
12248
+ if (isRollY) {
12181
12249
  const yThreshold = $xeTable.computeScrollYThreshold;
12182
12250
  isTop = scrollTop <= 0;
12183
12251
  if (!isTop) {
@@ -12307,7 +12375,8 @@ const Methods = {
12307
12375
  const internalData = $xeTable;
12308
12376
  const {
12309
12377
  inFooterScroll,
12310
- inBodyScroll
12378
+ inBodyScroll,
12379
+ lastScrollTop
12311
12380
  } = internalData;
12312
12381
  if (inFooterScroll) {
12313
12382
  return;
@@ -12321,13 +12390,18 @@ const Methods = {
12321
12390
  const bodyElem = tableBody.$el;
12322
12391
  const headerElem = tableHeader ? tableHeader.$el : null;
12323
12392
  const footerElem = tableFooter ? tableFooter.$el : null;
12393
+ const yHandleEl = $xeTable.$refs.refScrollYHandleElem;
12324
12394
  const wrapperEl = evnt.currentTarget;
12325
12395
  const {
12326
- scrollTop,
12327
12396
  scrollLeft
12328
12397
  } = wrapperEl;
12398
+ const yBodyEl = yHandleEl || bodyElem;
12399
+ let scrollTop = 0;
12400
+ if (yBodyEl) {
12401
+ scrollTop = yBodyEl.scrollTop;
12402
+ }
12329
12403
  const isRollX = true;
12330
- const isRollY = false;
12404
+ const isRollY = scrollTop !== lastScrollTop;
12331
12405
  internalData.inVirtualScroll = true;
12332
12406
  setScrollLeft(bodyElem, scrollLeft);
12333
12407
  setScrollLeft(headerElem, scrollLeft);
@@ -12343,7 +12417,8 @@ const Methods = {
12343
12417
  const internalData = $xeTable;
12344
12418
  const {
12345
12419
  inFooterScroll,
12346
- inBodyScroll
12420
+ inBodyScroll,
12421
+ lastScrollLeft
12347
12422
  } = internalData;
12348
12423
  if (inFooterScroll) {
12349
12424
  return;
@@ -12357,12 +12432,17 @@ const Methods = {
12357
12432
  const bodyElem = tableBody.$el;
12358
12433
  const leftElem = leftBody ? leftBody.$el : null;
12359
12434
  const rightElem = rightBody ? rightBody.$el : null;
12435
+ const xHandleEl = $xeTable.$refs.refScrollXHandleElem;
12360
12436
  const wrapperEl = evnt.currentTarget;
12361
12437
  const {
12362
- scrollTop,
12363
- scrollLeft
12438
+ scrollTop
12364
12439
  } = wrapperEl;
12365
- const isRollX = false;
12440
+ const xBodyEl = xHandleEl || bodyElem;
12441
+ let scrollLeft = 0;
12442
+ if (xBodyEl) {
12443
+ scrollLeft = xBodyEl.scrollLeft;
12444
+ }
12445
+ const isRollX = scrollLeft !== lastScrollLeft;
12366
12446
  const isRollY = true;
12367
12447
  internalData.inVirtualScroll = true;
12368
12448
  setScrollTop(bodyElem, scrollTop);
@@ -12667,7 +12747,7 @@ const Methods = {
12667
12747
  }
12668
12748
  }
12669
12749
  if (this.scrollXLoad || this.scrollYLoad) {
12670
- return new Promise(resolve => setTimeout(() => resolve(this.$nextTick()), 50));
12750
+ return new Promise(resolve => setTimeout(() => resolve(this.$nextTick()), 30));
12671
12751
  }
12672
12752
  return this.$nextTick();
12673
12753
  },
@@ -13178,7 +13258,8 @@ function renderColumn(h, _vm, $xetable, seq, rowid, fixedType, rowLevel, row, ro
13178
13258
  const showEllipsis = cellOverflow === 'ellipsis';
13179
13259
  const showTitle = cellOverflow === 'title';
13180
13260
  const showTooltip = cellOverflow === true || cellOverflow === 'tooltip';
13181
- const hasEllipsis = showTitle || showTooltip || showEllipsis;
13261
+ // 如果表格加上 showOverflow 则不再支持列单独设置
13262
+ const hasEllipsis = allColumnOverflow || showTitle || showTooltip || showEllipsis;
13182
13263
  let isDirty;
13183
13264
  const tdOns = {};
13184
13265
  const rest = fullAllDataRowIdData[rowid];
@@ -22511,6 +22592,9 @@ function handleUupdateResize(_vm) {
22511
22592
  computed: {
22512
22593
  ...{},
22513
22594
  tableId() {
22595
+ return this.computeTableId;
22596
+ },
22597
+ computeTableId() {
22514
22598
  const {
22515
22599
  id
22516
22600
  } = this;
@@ -23053,8 +23137,10 @@ function handleUupdateResize(_vm) {
23053
23137
  }
23054
23138
  if (true) {
23055
23139
  const customOpts = this.customOpts;
23056
- if (!this.id && this.customConfig && (customOpts.storage === true || customOpts.storage && customOpts.storage.resizable || customOpts.storage && customOpts.storage.visible)) {
23057
- errLog('vxe.error.reqProp', ['id']);
23140
+ if (!this.id) {
23141
+ if ((this.customConfig ? isEnableConf(customOpts) : customOpts.enabled) && customOpts.storage) {
23142
+ errLog('vxe.error.reqProp', ['id']);
23143
+ }
23058
23144
  }
23059
23145
  if (this.treeConfig && this.checkboxOpts.range) {
23060
23146
  errLog('vxe.error.noTree', ['checkbox-config.range']);