vxe-table 3.12.1-beta.0 → 3.12.1-beta.2

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.
@@ -270,15 +270,29 @@ function calcTableHeight(_vm, key) {
270
270
  }
271
271
  return num;
272
272
  }
273
+ // const updateCellOffset = ($xeTable: VxeTableConstructor) => {
274
+ // const internalData = $xeTable as unknown as TableInternalData
275
+ // const { chTimeout, chRunTime } = internalData
276
+ // if (chTimeout) {
277
+ // clearTimeout(chTimeout)
278
+ // }
279
+ // if (!chRunTime || chRunTime + 10 < Date.now()) {
280
+ // internalData.chRunTime = Date.now()
281
+ // }
282
+ // internalData.chTimeout = setTimeout(() => {
283
+ // internalData.chRunTime = undefined
284
+ // internalData.chTimeout = undefined
285
+ // }, 80)
286
+ // }
273
287
  const calcCellHeight = ($xeTable) => {
274
288
  const props = $xeTable;
275
289
  const reactData = $xeTable;
276
290
  const internalData = $xeTable;
277
291
  const { showOverflow } = props;
278
- const { tableData, scrollXLoad, scrollYLoad } = reactData;
292
+ const { tableData, scrollXLoad } = reactData;
279
293
  const { fullAllDataRowIdData } = internalData;
280
294
  const el = $xeTable.$refs.refElem;
281
- if (!showOverflow && (scrollXLoad || scrollYLoad) && el) {
295
+ if (!showOverflow && el) {
282
296
  let paddingTop = 0;
283
297
  let paddingBottom = 0;
284
298
  let calcPadding = false;
@@ -309,6 +323,7 @@ const calcCellHeight = ($xeTable) => {
309
323
  }
310
324
  });
311
325
  }
326
+ // updateCellOffset($xeTable)
312
327
  };
313
328
  function getOrderField(_vm, column) {
314
329
  const { sortBy, sortType } = column;
@@ -530,7 +545,7 @@ const handleScrollToRowColumn = ($xeTable, fieldOrColumn, row) => {
530
545
  function handleRecalculateLayout($xeTable, reFull) {
531
546
  const internalData = $xeTable;
532
547
  const el = $xeTable.$refs.refElem;
533
- internalData.reRunTime = Date.now();
548
+ internalData.rceRunTime = Date.now();
534
549
  if (!el || !el.clientWidth) {
535
550
  return $xeTable.$nextTick();
536
551
  }
@@ -561,10 +576,14 @@ function checkLastSyncScroll($xeTable, isRollX, isRollY) {
561
576
  internalData.bodyScrollType = '';
562
577
  internalData.inFooterScroll = false;
563
578
  if (isRollX && scrollXLoad) {
564
- $xeTable.updateScrollXData();
579
+ $xeTable.updateScrollXData().then(() => {
580
+ $xeTable.loadScrollXData();
581
+ });
565
582
  }
566
583
  if (isRollY && scrollYLoad) {
567
- $xeTable.updateScrollYData();
584
+ $xeTable.updateScrollYData().then(() => {
585
+ $xeTable.loadScrollYData();
586
+ });
568
587
  }
569
588
  $xeTable.updateCellAreas();
570
589
  }, 200);
@@ -2431,6 +2450,7 @@ const Methods = {
2431
2450
  saveCustomStore(type) {
2432
2451
  const $xeTable = this;
2433
2452
  const props = $xeTable;
2453
+ const reactData = $xeTable;
2434
2454
  const { customConfig } = props;
2435
2455
  const tableId = $xeTable.computeTableId;
2436
2456
  const customOpts = $xeTable.computeCustomOpts;
@@ -2441,6 +2461,9 @@ const Methods = {
2441
2461
  const isCustomVisible = isAllCustom || storageOpts.visible;
2442
2462
  const isCustomFixed = isAllCustom || storageOpts.fixed;
2443
2463
  const isCustomSort = isAllCustom || storageOpts.sort;
2464
+ if (type !== 'reset') {
2465
+ reactData.isCustomStatus = true;
2466
+ }
2444
2467
  if ((customConfig ? isEnableConf(customOpts) : customOpts.enabled) && (isCustomResizable || isCustomVisible || isCustomFixed || isCustomSort)) {
2445
2468
  if (!tableId) {
2446
2469
  errLog('vxe.error.reqProp', ['id']);
@@ -2707,7 +2730,7 @@ const Methods = {
2707
2730
  const $xeTable = this;
2708
2731
  const internalData = $xeTable;
2709
2732
  return new Promise(resolve => {
2710
- const { rceTimeout, reRunTime } = internalData;
2733
+ const { rceTimeout, rceRunTime } = internalData;
2711
2734
  const resizeOpts = $xeTable.computeResizeOpts;
2712
2735
  const refreshDelay = resizeOpts.refreshDelay || 20;
2713
2736
  const el = $xeTable.$refs.refElem;
@@ -2716,7 +2739,7 @@ const Methods = {
2716
2739
  }
2717
2740
  if (rceTimeout) {
2718
2741
  clearTimeout(rceTimeout);
2719
- if (reRunTime && reRunTime + (refreshDelay - 5) < Date.now()) {
2742
+ if (rceRunTime && rceRunTime + (refreshDelay - 5) < Date.now()) {
2720
2743
  resolve(handleRecalculateLayout($xeTable, !!reFull));
2721
2744
  }
2722
2745
  else {
@@ -6954,7 +6977,9 @@ const Methods = {
6954
6977
  scrollXStore.offsetSize = offsetXSize;
6955
6978
  scrollXStore.visibleSize = visibleXSize;
6956
6979
  scrollXStore.endIndex = Math.max(scrollXStore.startIndex + scrollXStore.visibleSize + offsetXSize, scrollXStore.endIndex);
6957
- $xeTable.updateScrollXData();
6980
+ $xeTable.updateScrollXData().then(() => {
6981
+ $xeTable.loadScrollXData();
6982
+ });
6958
6983
  }
6959
6984
  else {
6960
6985
  $xeTable.updateScrollXSpace();
@@ -6970,7 +6995,9 @@ const Methods = {
6970
6995
  scrollYStore.offsetSize = offsetYSize;
6971
6996
  scrollYStore.visibleSize = visibleYSize;
6972
6997
  scrollYStore.endIndex = Math.max(scrollYStore.startIndex + visibleYSize + offsetYSize, scrollYStore.endIndex);
6973
- $xeTable.updateScrollYData();
6998
+ $xeTable.updateScrollYData().then(() => {
6999
+ $xeTable.loadScrollYData();
7000
+ });
6974
7001
  }
6975
7002
  else {
6976
7003
  $xeTable.updateScrollYSpace();
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.12.1-beta.0";
3
+ export const version = "3.12.1-beta.2";
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.12.1-beta.0"}`;
3
+ const version = `table v${"3.12.1-beta.2"}`;
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.12.1-beta.0";
2223
+ const version = "3.12.1-beta.2";
2224
2224
  core_.VxeUI.version = version;
2225
2225
  core_.VxeUI.tableVersion = version;
2226
2226
  core_.VxeUI.setConfig({
@@ -2814,7 +2814,7 @@ function isNodeElement(elem) {
2814
2814
  const {
2815
2815
  log: log_log
2816
2816
  } = core_.VxeUI;
2817
- const log_version = `table v${"3.12.1-beta.0"}`;
2817
+ const log_version = `table v${"3.12.1-beta.2"}`;
2818
2818
  const warnLog = log_log.create('warn', log_version);
2819
2819
  const errLog = log_log.create('error', log_version);
2820
2820
  ;// CONCATENATED MODULE: ./packages/table/src/columnInfo.ts
@@ -5282,6 +5282,20 @@ function calcTableHeight(_vm, key) {
5282
5282
  }
5283
5283
  return num;
5284
5284
  }
5285
+ // const updateCellOffset = ($xeTable: VxeTableConstructor) => {
5286
+ // const internalData = $xeTable as unknown as TableInternalData
5287
+ // const { chTimeout, chRunTime } = internalData
5288
+ // if (chTimeout) {
5289
+ // clearTimeout(chTimeout)
5290
+ // }
5291
+ // if (!chRunTime || chRunTime + 10 < Date.now()) {
5292
+ // internalData.chRunTime = Date.now()
5293
+ // }
5294
+ // internalData.chTimeout = setTimeout(() => {
5295
+ // internalData.chRunTime = undefined
5296
+ // internalData.chTimeout = undefined
5297
+ // }, 80)
5298
+ // }
5285
5299
  const calcCellHeight = $xeTable => {
5286
5300
  const props = $xeTable;
5287
5301
  const reactData = $xeTable;
@@ -5291,14 +5305,13 @@ const calcCellHeight = $xeTable => {
5291
5305
  } = props;
5292
5306
  const {
5293
5307
  tableData,
5294
- scrollXLoad,
5295
- scrollYLoad
5308
+ scrollXLoad
5296
5309
  } = reactData;
5297
5310
  const {
5298
5311
  fullAllDataRowIdData
5299
5312
  } = internalData;
5300
5313
  const el = $xeTable.$refs.refElem;
5301
- if (!showOverflow && (scrollXLoad || scrollYLoad) && el) {
5314
+ if (!showOverflow && el) {
5302
5315
  let paddingTop = 0;
5303
5316
  let paddingBottom = 0;
5304
5317
  let calcPadding = false;
@@ -5329,6 +5342,7 @@ const calcCellHeight = $xeTable => {
5329
5342
  }
5330
5343
  });
5331
5344
  }
5345
+ // updateCellOffset($xeTable)
5332
5346
  };
5333
5347
  function getOrderField(_vm, column) {
5334
5348
  const {
@@ -5567,7 +5581,7 @@ const handleScrollToRowColumn = ($xeTable, fieldOrColumn, row) => {
5567
5581
  function handleRecalculateLayout($xeTable, reFull) {
5568
5582
  const internalData = $xeTable;
5569
5583
  const el = $xeTable.$refs.refElem;
5570
- internalData.reRunTime = Date.now();
5584
+ internalData.rceRunTime = Date.now();
5571
5585
  if (!el || !el.clientWidth) {
5572
5586
  return $xeTable.$nextTick();
5573
5587
  }
@@ -5603,10 +5617,14 @@ function checkLastSyncScroll($xeTable, isRollX, isRollY) {
5603
5617
  internalData.bodyScrollType = '';
5604
5618
  internalData.inFooterScroll = false;
5605
5619
  if (isRollX && scrollXLoad) {
5606
- $xeTable.updateScrollXData();
5620
+ $xeTable.updateScrollXData().then(() => {
5621
+ $xeTable.loadScrollXData();
5622
+ });
5607
5623
  }
5608
5624
  if (isRollY && scrollYLoad) {
5609
- $xeTable.updateScrollYData();
5625
+ $xeTable.updateScrollYData().then(() => {
5626
+ $xeTable.loadScrollYData();
5627
+ });
5610
5628
  }
5611
5629
  $xeTable.updateCellAreas();
5612
5630
  }, 200);
@@ -7836,6 +7854,7 @@ const Methods = {
7836
7854
  saveCustomStore(type) {
7837
7855
  const $xeTable = this;
7838
7856
  const props = $xeTable;
7857
+ const reactData = $xeTable;
7839
7858
  const {
7840
7859
  customConfig
7841
7860
  } = props;
@@ -7851,6 +7870,9 @@ const Methods = {
7851
7870
  const isCustomVisible = isAllCustom || storageOpts.visible;
7852
7871
  const isCustomFixed = isAllCustom || storageOpts.fixed;
7853
7872
  const isCustomSort = isAllCustom || storageOpts.sort;
7873
+ if (type !== 'reset') {
7874
+ reactData.isCustomStatus = true;
7875
+ }
7854
7876
  if ((customConfig ? isEnableConf(customOpts) : customOpts.enabled) && (isCustomResizable || isCustomVisible || isCustomFixed || isCustomSort)) {
7855
7877
  if (!tableId) {
7856
7878
  errLog('vxe.error.reqProp', ['id']);
@@ -8141,7 +8163,7 @@ const Methods = {
8141
8163
  return new Promise(resolve => {
8142
8164
  const {
8143
8165
  rceTimeout,
8144
- reRunTime
8166
+ rceRunTime
8145
8167
  } = internalData;
8146
8168
  const resizeOpts = $xeTable.computeResizeOpts;
8147
8169
  const refreshDelay = resizeOpts.refreshDelay || 20;
@@ -8151,7 +8173,7 @@ const Methods = {
8151
8173
  }
8152
8174
  if (rceTimeout) {
8153
8175
  clearTimeout(rceTimeout);
8154
- if (reRunTime && reRunTime + (refreshDelay - 5) < Date.now()) {
8176
+ if (rceRunTime && rceRunTime + (refreshDelay - 5) < Date.now()) {
8155
8177
  resolve(handleRecalculateLayout($xeTable, !!reFull));
8156
8178
  } else {
8157
8179
  $xeTable.$nextTick(() => {
@@ -13225,7 +13247,9 @@ const Methods = {
13225
13247
  scrollXStore.offsetSize = offsetXSize;
13226
13248
  scrollXStore.visibleSize = visibleXSize;
13227
13249
  scrollXStore.endIndex = Math.max(scrollXStore.startIndex + scrollXStore.visibleSize + offsetXSize, scrollXStore.endIndex);
13228
- $xeTable.updateScrollXData();
13250
+ $xeTable.updateScrollXData().then(() => {
13251
+ $xeTable.loadScrollXData();
13252
+ });
13229
13253
  } else {
13230
13254
  $xeTable.updateScrollXSpace();
13231
13255
  }
@@ -13242,7 +13266,9 @@ const Methods = {
13242
13266
  scrollYStore.offsetSize = offsetYSize;
13243
13267
  scrollYStore.visibleSize = visibleYSize;
13244
13268
  scrollYStore.endIndex = Math.max(scrollYStore.startIndex + visibleYSize + offsetYSize, scrollYStore.endIndex);
13245
- $xeTable.updateScrollYData();
13269
+ $xeTable.updateScrollYData().then(() => {
13270
+ $xeTable.loadScrollYData();
13271
+ });
13246
13272
  } else {
13247
13273
  $xeTable.updateScrollYSpace();
13248
13274
  }
@@ -14174,12 +14200,14 @@ function renderColumn(h, _vm, $xeTable, seq, rowid, fixedType, rowLevel, row, ro
14174
14200
  }
14175
14201
  }
14176
14202
  let cellHeight = '';
14177
- if (hasEllipsis && (scrollYRHeight || rowHeight)) {
14178
- cellHeight = `${scrollYRHeight || rowHeight}px`;
14179
- } else if (scrollXLoad || scrollYLoad) {
14180
- if (!hasEllipsis) {
14181
- cellHeight = `${rest.height || 24}px`;
14203
+ if (hasEllipsis) {
14204
+ if (scrollYRHeight || rowHeight) {
14205
+ cellHeight = `${scrollYRHeight || rowHeight}px`;
14206
+ } else if (!isAllOverflow) {
14207
+ cellHeight = `${rest.height || 18}px`;
14182
14208
  }
14209
+ } else {
14210
+ cellHeight = `${rest.height || 18}px`;
14183
14211
  }
14184
14212
  if (mouseConfig && mouseOpts.area && selectCellToRow) {
14185
14213
  if (!$columnIndex && selectCellToRow === true || selectCellToRow === column.field) {
@@ -21848,7 +21876,7 @@ const convertToRows = originColumns => {
21848
21876
  handleOptions.data = afterFullData;
21849
21877
  }
21850
21878
  }
21851
- return handleExport($xeTable, opts);
21879
+ return handleExport($xeTable, handleOptions);
21852
21880
  },
21853
21881
  _importByFile(file, options) {
21854
21882
  const opts = Object.assign({}, options);