vxe-table 4.20.7 → 4.20.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.
Files changed (48) hide show
  1. package/dist/all.esm.js +57 -33
  2. package/dist/style.css +1 -1
  3. package/es/grid/src/grid.js +11 -0
  4. package/es/style.css +1 -1
  5. package/es/table/src/body.js +3 -3
  6. package/es/table/src/cell.js +2 -2
  7. package/es/table/src/footer.js +3 -3
  8. package/es/table/src/header.js +3 -3
  9. package/es/table/src/table.js +26 -19
  10. package/es/table/src/util.js +5 -1
  11. package/es/ui/index.js +3 -1
  12. package/es/ui/src/log.js +1 -1
  13. package/lib/grid/src/grid.js +15 -0
  14. package/lib/grid/src/grid.min.js +1 -1
  15. package/lib/index.umd.js +51 -27
  16. package/lib/index.umd.min.js +1 -1
  17. package/lib/style.css +1 -1
  18. package/lib/table/src/body.js +3 -3
  19. package/lib/table/src/body.min.js +1 -1
  20. package/lib/table/src/cell.js +2 -2
  21. package/lib/table/src/cell.min.js +1 -1
  22. package/lib/table/src/footer.js +3 -3
  23. package/lib/table/src/footer.min.js +1 -1
  24. package/lib/table/src/header.js +3 -3
  25. package/lib/table/src/header.min.js +1 -1
  26. package/lib/table/src/table.js +16 -13
  27. package/lib/table/src/table.min.js +1 -1
  28. package/lib/table/src/util.js +5 -1
  29. package/lib/table/src/util.min.js +1 -1
  30. package/lib/ui/index.js +3 -1
  31. package/lib/ui/index.min.js +1 -1
  32. package/lib/ui/src/log.js +1 -1
  33. package/lib/ui/src/log.min.js +1 -1
  34. package/package.json +2 -2
  35. package/packages/grid/src/grid.ts +11 -0
  36. package/packages/table/src/body.ts +3 -3
  37. package/packages/table/src/cell.ts +2 -2
  38. package/packages/table/src/footer.ts +3 -3
  39. package/packages/table/src/header.ts +3 -3
  40. package/packages/table/src/table.ts +26 -19
  41. package/packages/table/src/util.ts +5 -1
  42. package/packages/ui/index.ts +2 -0
  43. /package/es/{iconfont.1784868296497.ttf → iconfont.1785140083044.ttf} +0 -0
  44. /package/es/{iconfont.1784868296497.woff → iconfont.1785140083044.woff} +0 -0
  45. /package/es/{iconfont.1784868296497.woff2 → iconfont.1785140083044.woff2} +0 -0
  46. /package/lib/{iconfont.1784868296497.ttf → iconfont.1785140083044.ttf} +0 -0
  47. /package/lib/{iconfont.1784868296497.woff → iconfont.1785140083044.woff} +0 -0
  48. /package/lib/{iconfont.1784868296497.woff2 → iconfont.1785140083044.woff2} +0 -0
package/dist/all.esm.js CHANGED
@@ -44,7 +44,7 @@ function eqEmptyValue(cellValue) {
44
44
  return cellValue === '' || XEUtils.eqNull(cellValue);
45
45
  }
46
46
 
47
- const version = "4.20.7";
47
+ const version = "4.20.8";
48
48
  VxeUI.version = version;
49
49
  VxeUI.tableVersion = version;
50
50
  VxeUI.setConfig({
@@ -115,9 +115,11 @@ VxeUI.setConfig({
115
115
  defaultPlacement: 'top'
116
116
  },
117
117
  headerTooltipConfig: {
118
+ mode: 'tooltip',
118
119
  enterable: true
119
120
  },
120
121
  footerTooltipConfig: {
122
+ mode: 'tooltip',
121
123
  enterable: true
122
124
  },
123
125
  validConfig: {
@@ -756,7 +758,7 @@ function wheelScrollTopTo(diffNum, cb) {
756
758
  }
757
759
 
758
760
  const { log } = VxeUI;
759
- const tableVersion = `table v${"4.20.7"}`;
761
+ const tableVersion = `table v${"4.20.8"}`;
760
762
  function createComponentLog(name) {
761
763
  const uiVersion = VxeUI.uiVersion ? `ui v${VxeUI.uiVersion}` : '';
762
764
  const ganttVersion = VxeUI.ganttVersion ? `gantt v${VxeUI.ganttVersion}` : '';
@@ -1111,6 +1113,8 @@ function createInternalData$3() {
1111
1113
  tooltipTimeout: null,
1112
1114
  initStatus: false,
1113
1115
  isActivated: false,
1116
+ // rceTimeout: undefined,
1117
+ // rceRunTime: undefined,
1114
1118
  rceDelay: 0
1115
1119
  // _sToTime: null
1116
1120
  };
@@ -2004,6 +2008,7 @@ function handleCustomStoreConfig($xeTable) {
2004
2008
  const isCustomSort = hangleBolleanDefaultValue(storageOpts.sort, isAllCustom);
2005
2009
  const isCustomAggGroup = hangleBolleanDefaultValue(storageOpts.aggGroup, isAllCustom);
2006
2010
  const isCustomAggFunc = hangleBolleanDefaultValue(storageOpts.aggFunc, isAllCustom);
2011
+ const isCustomPager = hangleBolleanDefaultValue(storageOpts.pager, isAllCustom);
2007
2012
  return {
2008
2013
  isCustomAlign,
2009
2014
  isCustomHeaderAlign,
@@ -2013,7 +2018,8 @@ function handleCustomStoreConfig($xeTable) {
2013
2018
  isCustomFixed,
2014
2019
  isCustomSort,
2015
2020
  isCustomAggGroup,
2016
- isCustomAggFunc
2021
+ isCustomAggFunc,
2022
+ isCustomPager
2017
2023
  };
2018
2024
  }
2019
2025
 
@@ -2228,8 +2234,8 @@ function renderTitleContent(params, content) {
2228
2234
  const headerTooltipOpts = computeHeaderTooltipOpts.value;
2229
2235
  const showAllTip = headerTooltipOpts.showAll;
2230
2236
  const headOverflow = XEUtils.eqNull(showHeaderOverflow) ? allColumnHeaderOverflow : showHeaderOverflow;
2231
- const showTitle = headOverflow === 'title';
2232
- const showTooltip = headOverflow === true || headOverflow === 'tooltip';
2237
+ const showTitle = (headOverflow === true ? headerTooltipOpts.mode : headOverflow) === 'title';
2238
+ const showTooltip = (headOverflow === true ? headerTooltipOpts.mode : headOverflow) === 'tooltip';
2233
2239
  const ons = {};
2234
2240
  if (showTitle || showTooltip || showAllTip) {
2235
2241
  ons.onMouseenter = (evnt) => {
@@ -4172,9 +4178,9 @@ var TableBodyComponent = defineVxeComponent({
4172
4178
  let fixedHiddenColumn = overflowX && (fixedType ? column.fixed !== fixedType : !!column.fixed);
4173
4179
  const isCellPadding = XEUtils.eqNull(padding) ? (allPadding === null ? cellOpts.padding : allPadding) : padding;
4174
4180
  const cellOverflow = XEUtils.eqNull(showOverflow) ? allShowOverflow : showOverflow;
4175
- const showEllipsis = cellOverflow === 'ellipsis';
4176
- const showTitle = cellOverflow === 'title';
4177
- const showTooltip = cellOverflow === true ? tooltipOpts.mode === 'tooltip' : cellOverflow === 'tooltip';
4181
+ const showEllipsis = (cellOverflow === true ? tooltipOpts.mode : cellOverflow) === 'ellipsis';
4182
+ const showTitle = (cellOverflow === true ? tooltipOpts.mode : cellOverflow) === 'title';
4183
+ const showTooltip = (cellOverflow === true ? tooltipOpts.mode : cellOverflow) === 'tooltip';
4178
4184
  const hasEllipsis = isAllOverflow || showTitle || showTooltip || showEllipsis;
4179
4185
  const showResizable = (XEUtils.isBoolean(column.resizable) ? column.resizable : (columnOpts.resizable || allResizable));
4180
4186
  const isCsHeight = !!customCellHeight;
@@ -4971,9 +4977,9 @@ var TableHeaderComponent = defineVxeComponent({
4971
4977
  const isPadding = XEUtils.isBoolean(headerCellOpts.padding) ? headerCellOpts.padding : cellOpts.padding;
4972
4978
  const headOverflow = XEUtils.eqNull(showHeaderOverflow) ? allColumnHeaderOverflow : showHeaderOverflow;
4973
4979
  const headAlign = headerAlign || (compConf ? compConf.tableHeaderCellAlign : '') || allHeaderAlign || align || (compConf ? compConf.tableCellAlign : '') || allAlign;
4974
- const showEllipsis = headOverflow === 'ellipsis';
4975
- const showTitle = headOverflow === 'title';
4976
- const showTooltip = headOverflow === true ? headerTooltipOpts.mode === 'tooltip' : headOverflow === 'tooltip';
4980
+ const showEllipsis = (headOverflow === true ? headerTooltipOpts.mode : headOverflow) === 'ellipsis';
4981
+ const showTitle = (headOverflow === true ? headerTooltipOpts.mode : headOverflow) === 'title';
4982
+ const showTooltip = (headOverflow === true ? headerTooltipOpts.mode : headOverflow) === 'tooltip';
4977
4983
  const hasEllipsis = showTitle || showTooltip || showEllipsis;
4978
4984
  let hasFilter = false;
4979
4985
  let firstFilterOption = null;
@@ -5472,9 +5478,9 @@ var TableFooterComponent = defineVxeComponent({
5472
5478
  const isPadding = XEUtils.isBoolean(footerCellOpts.padding) ? footerCellOpts.padding : cellOpts.padding;
5473
5479
  const footOverflow = XEUtils.eqNull(showFooterOverflow) ? allColumnFooterOverflow : showFooterOverflow;
5474
5480
  const footAlign = footerAlign || (compConf ? compConf.tableFooterCellAlign : '') || allFooterAlign || align || (compConf ? compConf.tableCellAlign : '') || allAlign;
5475
- const showEllipsis = footOverflow === 'ellipsis';
5476
- const showTitle = footOverflow === 'title';
5477
- const showTooltip = footOverflow === true ? footerTooltipOpts.mode === 'tooltip' : footOverflow === 'tooltip';
5481
+ const showEllipsis = (footOverflow === true ? footerTooltipOpts.mode : footOverflow) === 'ellipsis';
5482
+ const showTitle = (footOverflow === true ? footerTooltipOpts.mode : footOverflow) === 'title';
5483
+ const showTooltip = (footOverflow === true ? footerTooltipOpts.mode : footOverflow) === 'tooltip';
5478
5484
  const hasEllipsis = showTitle || showTooltip || showEllipsis;
5479
5485
  const showResizable = (XEUtils.isBoolean(column.resizable) ? column.resizable : (columnOpts.resizable || allResizable));
5480
5486
  const attrs = { colid };
@@ -16813,8 +16819,8 @@ var VxeTableComponent = defineVxeComponent({
16813
16819
  const handleCustomRestore = (storeData) => {
16814
16820
  const { aggregateConfig, rowGroupConfig } = props;
16815
16821
  const { collectColumn } = internalData;
16816
- const { isCustomAlign, isCustomHeaderAlign, isCustomFooterAlign, isCustomResizable, isCustomVisible, isCustomFixed, isCustomSort, isCustomAggGroup, isCustomAggFunc } = handleCustomStoreConfig($xeTable);
16817
- let { alignData, headerAlignData, footerAlignData, resizableData, sortData, visibleData, fixedData, aggGroupData, aggFuncData } = storeData;
16822
+ const { isCustomAlign, isCustomHeaderAlign, isCustomFooterAlign, isCustomResizable, isCustomVisible, isCustomFixed, isCustomSort, isCustomAggGroup, isCustomAggFunc, isCustomPager } = handleCustomStoreConfig($xeTable);
16823
+ let { alignData, headerAlignData, footerAlignData, resizableData, sortData, visibleData, fixedData, aggGroupData, aggFuncData, pagerData } = storeData;
16818
16824
  // 处理还原
16819
16825
  if ((isCustomAlign && alignData) ||
16820
16826
  (isCustomHeaderAlign && headerAlignData) ||
@@ -16824,7 +16830,8 @@ var VxeTableComponent = defineVxeComponent({
16824
16830
  (isCustomVisible && visibleData) ||
16825
16831
  (isCustomFixed && fixedData) ||
16826
16832
  (isCustomAggGroup && aggGroupData) ||
16827
- (isCustomAggFunc && aggFuncData)) {
16833
+ (isCustomAggFunc && aggFuncData) ||
16834
+ (isCustomPager && pagerData && $xeGGWrapper)) {
16828
16835
  const sortColMaps = {};
16829
16836
  if (isCustomSort && sortData) {
16830
16837
  // 转换兼容老版本数据,即将废弃兼容
@@ -17141,7 +17148,7 @@ var VxeTableComponent = defineVxeComponent({
17141
17148
  const autoWidthColumnList = computeAutoWidthColumnList.value;
17142
17149
  const { fullColumnIdData } = internalData;
17143
17150
  const el = refElem.value;
17144
- if (el) {
17151
+ if (el && autoWidthColumnList.length) {
17145
17152
  el.setAttribute('data-calc-col', 'Y');
17146
17153
  autoWidthColumnList.forEach(column => {
17147
17154
  const colid = column.id;
@@ -17426,7 +17433,7 @@ var VxeTableComponent = defineVxeComponent({
17426
17433
  const fullMaps = {};
17427
17434
  let rowNum = 0;
17428
17435
  const { handleGetRowId } = createHandleGetRowId($xeTable);
17429
- XEUtils.eachTree(afterTreeFullData, (row, index, items, path) => {
17436
+ XEUtils.eachTree(afterTreeFullData, (row, index, items, path, parentRow) => {
17430
17437
  const rowid = handleGetRowId(row);
17431
17438
  const rowRest = fullAllDataRowIdData[rowid];
17432
17439
  const seq = path.map((num, i) => i % 2 === 0 ? (Number(num) + 1) : '.').join('');
@@ -17434,10 +17441,11 @@ var VxeTableComponent = defineVxeComponent({
17434
17441
  rowRest.seq = seq;
17435
17442
  rowRest._seq = rowNum;
17436
17443
  rowRest.treeIndex = index;
17444
+ rowRest._index = rowNum;
17437
17445
  rowRest._tIndex = rowNum;
17438
17446
  }
17439
17447
  else {
17440
- const rest = { row, rowid, _seq: rowNum, seq, index: -1, $index: -1, _index: -1, treeIndex: -1, _tIndex: rowNum, items: [], parent: null, level: 0, height: 0, resizeHeight: 0, oTop: 0, expandHeight: 0 };
17448
+ const rest = { row, rowid, _seq: rowNum, seq, index, $index: -1, _index: rowNum, treeIndex: index, _tIndex: rowNum, items, parent: parentRow, level: 0, height: 0, resizeHeight: 0, oTop: 0, expandHeight: 0 };
17441
17449
  fullAllDataRowIdData[rowid] = rest;
17442
17450
  fullDataRowIdData[rowid] = rest;
17443
17451
  }
@@ -18650,7 +18658,7 @@ var VxeTableComponent = defineVxeComponent({
18650
18658
  if (reWidth) {
18651
18659
  calcCellWidth();
18652
18660
  }
18653
- if (reFull) {
18661
+ if (reWidth || reFull) {
18654
18662
  autoCellWidth();
18655
18663
  }
18656
18664
  calcScrollbar();
@@ -18665,7 +18673,7 @@ var VxeTableComponent = defineVxeComponent({
18665
18673
  if (reWidth) {
18666
18674
  calcCellWidth();
18667
18675
  }
18668
- if (reFull) {
18676
+ if (reWidth || reFull) {
18669
18677
  autoCellWidth();
18670
18678
  }
18671
18679
  if (reHeight) {
@@ -18757,7 +18765,7 @@ var VxeTableComponent = defineVxeComponent({
18757
18765
  return;
18758
18766
  }
18759
18767
  internalData.rsePending = true;
18760
- handleLazyRecalculate(true, true, true, {
18768
+ handleLazyRecalculate(false, true, true, {
18761
18769
  minRunDelay: 200
18762
18770
  }).then(() => {
18763
18771
  internalData.rsePending = false;
@@ -20007,12 +20015,12 @@ var VxeTableComponent = defineVxeComponent({
20007
20015
  return;
20008
20016
  }
20009
20017
  const expandOpts = computeExpandOpts.value;
20010
- const rowOpts = computeRowOpts.value;
20011
- const cellOpts = computeCellOpts.value;
20012
- const defaultRowHeight = computeDefaultRowHeight.value;
20013
20018
  const { mode } = expandOpts;
20014
20019
  if (expandColumn && mode === 'fixed') {
20015
20020
  const { elemStore, fullAllDataRowIdData } = internalData;
20021
+ const rowOpts = computeRowOpts.value;
20022
+ const cellOpts = computeCellOpts.value;
20023
+ const defaultRowHeight = computeDefaultRowHeight.value;
20016
20024
  const rowExpandEl = refRowExpandElem.value;
20017
20025
  const bodyScrollElem = getRefElem(elemStore['main-body-scroll']);
20018
20026
  if (rowExpandEl && bodyScrollElem) {
@@ -23375,7 +23383,7 @@ var VxeTableComponent = defineVxeComponent({
23375
23383
  const { isRowGroupStatus, rowGroupList } = reactData;
23376
23384
  const { fullColumnFieldData, collectColumn } = internalData;
23377
23385
  const { storage, checkMethod } = customOpts;
23378
- const { isCustomAlign, isCustomHeaderAlign, isCustomFooterAlign, isCustomResizable, isCustomVisible, isCustomFixed, isCustomSort, isCustomAggGroup, isCustomAggFunc } = handleCustomStoreConfig($xeTable);
23386
+ const { isCustomAlign, isCustomHeaderAlign, isCustomFooterAlign, isCustomResizable, isCustomVisible, isCustomFixed, isCustomSort, isCustomAggGroup, isCustomAggFunc, isCustomPager } = handleCustomStoreConfig($xeTable);
23379
23387
  const alignData = {};
23380
23388
  const headerAlignData = {};
23381
23389
  const footerAlignData = {};
@@ -23386,6 +23394,7 @@ var VxeTableComponent = defineVxeComponent({
23386
23394
  const aggGroupData = {};
23387
23395
  const aggFuncData = {};
23388
23396
  const storeData = {
23397
+ pagerData: isCustomPager && $xeGGWrapper && $xeGGWrapper.getCustomPagerData ? $xeGGWrapper.getCustomPagerData() : undefined,
23389
23398
  alignData: undefined,
23390
23399
  headerAlignData: undefined,
23391
23400
  footerAlignData: undefined,
@@ -24236,8 +24245,10 @@ var VxeTableComponent = defineVxeComponent({
24236
24245
  if (!el || !el.clientWidth) {
24237
24246
  return;
24238
24247
  }
24248
+ if (internalData.rsePending) {
24249
+ return;
24250
+ }
24239
24251
  handleResizeEvent();
24240
- $xeTable.updateCellAreas();
24241
24252
  };
24242
24253
  const handleTargetEnterEvent = (isClear) => {
24243
24254
  const $tooltip = refTooltip.value;
@@ -25365,7 +25376,7 @@ var VxeTableComponent = defineVxeComponent({
25365
25376
  const tableId = computeTableId.value;
25366
25377
  const customOpts = computeCustomOpts.value;
25367
25378
  const { updateStore, storage } = customOpts;
25368
- const { isCustomAlign, isCustomHeaderAlign, isCustomFooterAlign, isCustomResizable, isCustomVisible, isCustomFixed, isCustomSort, isCustomAggGroup, isCustomAggFunc } = handleCustomStoreConfig($xeTable);
25379
+ const { isCustomAlign, isCustomHeaderAlign, isCustomFooterAlign, isCustomResizable, isCustomVisible, isCustomFixed, isCustomSort, isCustomAggGroup, isCustomAggFunc, isCustomPager } = handleCustomStoreConfig($xeTable);
25369
25380
  if (type !== 'reset') {
25370
25381
  // fix:修复拖动列宽,重置按钮无法点击的问题
25371
25382
  reactData.isCustomStatus = true;
@@ -25380,13 +25391,15 @@ var VxeTableComponent = defineVxeComponent({
25380
25391
  isCustomFixed ||
25381
25392
  isCustomSort ||
25382
25393
  isCustomAggGroup ||
25383
- isCustomAggFunc)) {
25394
+ isCustomAggFunc ||
25395
+ isCustomPager)) {
25384
25396
  if (!tableId) {
25385
25397
  errLog$2('vxe.error.reqProp', ['id']);
25386
25398
  return nextTick();
25387
25399
  }
25388
25400
  const storeData = type === 'reset'
25389
25401
  ? {
25402
+ pagerData: {},
25390
25403
  alignData: {},
25391
25404
  headerAlignData: {},
25392
25405
  footerAlignData: {},
@@ -29720,9 +29733,9 @@ var VxeTableComponent = defineVxeComponent({
29720
29733
  // if (treeConfig && (treeOpts.showLine || treeOpts.line) && !showOverflow) {
29721
29734
  // warnLog('vxe.error.reqProp', ['show-overflow'])
29722
29735
  // }
29723
- if (treeConfig && !treeOpts.transform && props.stripe) {
29724
- warnLog$2('vxe.error.noTree', ['stripe']);
29725
- }
29736
+ // if (treeConfig && !treeOpts.transform && props.stripe) {
29737
+ // warnLog('vxe.error.noTree', ['stripe'])
29738
+ // }
29726
29739
  if (treeConfig && !treeOpts.transform) {
29727
29740
  if (sortOpts.isDeep) {
29728
29741
  warnLog$2('vxe.error.reqSupportProp', ['transform=false', 'sort-config.isDeep=false']);
@@ -32094,6 +32107,17 @@ var VxeGridComponent = defineVxeComponent({
32094
32107
  };
32095
32108
  }
32096
32109
  return null;
32110
+ },
32111
+ getCustomPagerData() {
32112
+ const { pagerConfig } = props;
32113
+ const { tablePage } = reactData;
32114
+ const pagerOpts = computePagerOpts.value;
32115
+ if (pagerConfig && isEnableConf(pagerOpts)) {
32116
+ return {
32117
+ pSize: tablePage.pageSize
32118
+ };
32119
+ }
32120
+ return {};
32097
32121
  }
32098
32122
  // setProxyInfo (options) {
32099
32123
  // if (props.proxyConfig && options) {