vxe-table 3.20.1 → 3.20.3

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 (58) hide show
  1. package/es/index.css +1 -1
  2. package/es/index.min.css +1 -1
  3. package/es/style.css +1 -1
  4. package/es/style.min.css +1 -1
  5. package/es/table/module/filter/mixin.js +11 -2
  6. package/es/table/module/menu/mixin.js +2 -2
  7. package/es/table/src/body.js +4 -2
  8. package/es/table/src/methods.js +93 -7
  9. package/es/table/src/table.js +16 -1
  10. package/es/table/src/util.js +1 -2
  11. package/es/table/style.css +2 -2
  12. package/es/table/style.min.css +1 -1
  13. package/es/ui/index.js +3 -2
  14. package/es/ui/src/log.js +1 -1
  15. package/es/vxe-table/style.css +2 -2
  16. package/es/vxe-table/style.min.css +1 -1
  17. package/lib/index.css +1 -1
  18. package/lib/index.min.css +1 -1
  19. package/lib/index.umd.js +49 -17
  20. package/lib/index.umd.min.js +1 -1
  21. package/lib/style.css +1 -1
  22. package/lib/style.min.css +1 -1
  23. package/lib/table/module/filter/mixin.js +12 -2
  24. package/lib/table/module/filter/mixin.min.js +1 -1
  25. package/lib/table/module/menu/mixin.js +2 -1
  26. package/lib/table/module/menu/mixin.min.js +1 -1
  27. package/lib/table/src/body.js +5 -2
  28. package/lib/table/src/body.min.js +1 -1
  29. package/lib/table/src/methods.js +7 -7
  30. package/lib/table/src/methods.min.js +1 -1
  31. package/lib/table/src/table.js +18 -0
  32. package/lib/table/src/table.min.js +1 -1
  33. package/lib/table/src/util.js +1 -2
  34. package/lib/table/src/util.min.js +1 -1
  35. package/lib/table/style/style.css +2 -2
  36. package/lib/table/style/style.min.css +1 -1
  37. package/lib/ui/index.js +3 -2
  38. package/lib/ui/index.min.js +1 -1
  39. package/lib/ui/src/log.js +1 -1
  40. package/lib/ui/src/log.min.js +1 -1
  41. package/lib/vxe-table/style/style.css +2 -2
  42. package/lib/vxe-table/style/style.min.css +1 -1
  43. package/package.json +1 -1
  44. package/packages/table/module/filter/mixin.ts +10 -2
  45. package/packages/table/module/menu/mixin.ts +2 -2
  46. package/packages/table/src/body.ts +4 -2
  47. package/packages/table/src/methods.ts +99 -9
  48. package/packages/table/src/table.ts +18 -2
  49. package/packages/table/src/util.ts +2 -2
  50. package/packages/ui/index.ts +2 -1
  51. package/styles/components/table.scss +2 -2
  52. package/styles/theme/base.scss +3 -0
  53. /package/es/{iconfont.1773109164685.ttf → iconfont.1773640262712.ttf} +0 -0
  54. /package/es/{iconfont.1773109164685.woff → iconfont.1773640262712.woff} +0 -0
  55. /package/es/{iconfont.1773109164685.woff2 → iconfont.1773640262712.woff2} +0 -0
  56. /package/lib/{iconfont.1773109164685.ttf → iconfont.1773640262712.ttf} +0 -0
  57. /package/lib/{iconfont.1773109164685.woff → iconfont.1773640262712.woff} +0 -0
  58. /package/lib/{iconfont.1773109164685.woff2 → iconfont.1773640262712.woff2} +0 -0
@@ -107,7 +107,7 @@ export default {
107
107
  const tableEl = $xeTable.$refs.refElem;
108
108
  const { scrollTop, scrollLeft, visibleHeight, visibleWidth } = getDomNode();
109
109
  const filterOpts = $xeTable.computeFilterOpts;
110
- const { transfer } = filterOpts;
110
+ const { maxHeight: customMaxHeight, transfer, zIndex } = filterOpts;
111
111
  const currEl = btnEl || colEl;
112
112
  const tableRect = tableEl.getBoundingClientRect();
113
113
  const filterRender = column ? column.filterRender : null;
@@ -164,14 +164,23 @@ export default {
164
164
  }
165
165
  }
166
166
  }
167
- filterStore.style = {
167
+ const fStys = {
168
168
  top: toCssUnit(top),
169
169
  left: toCssUnit(left)
170
170
  };
171
+ if (zIndex) {
172
+ fStys.zIndex = zIndex;
173
+ }
174
+ filterStore.style = fStys;
171
175
  // 筛选面板是自适应表格高度
172
176
  if (compConf ? !compConf.tableFilterAutoHeight : false) {
173
177
  maxHeight = 0;
174
178
  }
179
+ else {
180
+ if (customMaxHeight) {
181
+ maxHeight = customMaxHeight > maxHeight ? maxHeight : customMaxHeight;
182
+ }
183
+ }
175
184
  // 判断面板不能大于表格高度
176
185
  filterStore.maxHeight = maxHeight;
177
186
  });
@@ -172,7 +172,7 @@ export default {
172
172
  const isContentMenu = $xeTable.computeIsContentMenu;
173
173
  const menuOpts = $xeTable.computeMenuOpts;
174
174
  const config = menuOpts[type];
175
- const { transfer, visibleMethod } = menuOpts;
175
+ const { zIndex, transfer, visibleMethod } = menuOpts;
176
176
  if (config) {
177
177
  const { options, disabled } = config;
178
178
  if (disabled) {
@@ -202,7 +202,7 @@ export default {
202
202
  selectChild: null,
203
203
  showChild: false,
204
204
  style: {
205
- zIndex: internalData.tZindex,
205
+ zIndex: zIndex || internalData.tZindex,
206
206
  top: `${top}px`,
207
207
  left: `${left}px`
208
208
  }
@@ -11,9 +11,11 @@ const renderType = 'body';
11
11
  const isVMScrollProcess = ($xeTable) => {
12
12
  const tableProps = $xeTable;
13
13
  const tableReactData = $xeTable;
14
+ const tableInternalData = $xeTable;
14
15
  const { delayHover } = tableProps;
15
- const { lastScrollTime, isDragResize } = tableReactData;
16
- return !!(isDragResize || (lastScrollTime && Date.now() < lastScrollTime + delayHover));
16
+ const { isDragResize } = tableReactData;
17
+ const { lastSTime } = tableInternalData;
18
+ return !!(isDragResize || (lastSTime && Date.now() < lastSTime + delayHover));
17
19
  };
18
20
  function renderLine(h, $xeTable, rowid, params, cellHeight) {
19
21
  const tableProps = $xeTable;
@@ -3357,7 +3357,7 @@ function loadTableData($xeTable, datas, isReload, isReset) {
3357
3357
  if (reactData.expandColumn && expandOpts.mode !== 'fixed') {
3358
3358
  errLog('vxe.error.notConflictProp', ['column.type="expand', 'expand-config.mode="fixed"']);
3359
3359
  }
3360
- if (virtualYOpts.mode === 'scroll' && expandOpts.mode === 'fixed') {
3360
+ if (virtualYOpts.mode === 'scroll' && reactData.expandColumn && expandOpts.mode === 'fixed') {
3361
3361
  warnLog('vxe.error.notConflictProp', ['virtual-y-config.mode=scroll', 'expand-config.mode=inside']);
3362
3362
  }
3363
3363
  // if (showOverflow) {
@@ -3862,7 +3862,7 @@ function handleSyncScroll($xeTable, isRollX, isRollY) {
3862
3862
  return Promise.all([
3863
3863
  xRest,
3864
3864
  yRest,
3865
- $xeTable.updateCellAreas()
3865
+ scrollXLoad || scrollYLoad ? $xeTable.updateCellAreas() : null
3866
3866
  ]);
3867
3867
  }
3868
3868
  function checkLastSyncScroll($xeTable, isRollX, isRollY) {
@@ -5108,6 +5108,48 @@ const tableMethods = {
5108
5108
  }
5109
5109
  return cellLabel;
5110
5110
  },
5111
+ updateCellLabel(row, fieldOrColumn) {
5112
+ const $xeTable = this;
5113
+ const internalData = $xeTable;
5114
+ const column = handleFieldOrColumn($xeTable, fieldOrColumn);
5115
+ if (!column) {
5116
+ return null;
5117
+ }
5118
+ const { fullAllDataRowIdData } = internalData;
5119
+ const rowid = getRowid($xeTable, row);
5120
+ if (rowid) {
5121
+ const colid = column.id;
5122
+ const rowid = getRowid($xeTable, row);
5123
+ const rowRest = fullAllDataRowIdData[rowid];
5124
+ if (rowRest) {
5125
+ const formatData = rowRest.formatData;
5126
+ if (formatData) {
5127
+ delete formatData[colid];
5128
+ }
5129
+ }
5130
+ }
5131
+ return $xeTable.getFooterCellLabel(row, column);
5132
+ },
5133
+ clearFormatterCache(isUpdate) {
5134
+ const $xeTable = this;
5135
+ const reactData = $xeTable;
5136
+ const internalData = $xeTable;
5137
+ const { tableData, tableColumn } = reactData;
5138
+ const { fullAllDataRowIdData } = internalData;
5139
+ XEUtils.each(fullAllDataRowIdData, (rowRest) => {
5140
+ if (rowRest.formatData) {
5141
+ rowRest.formatData = undefined;
5142
+ }
5143
+ });
5144
+ if (isUpdate) {
5145
+ tableData.forEach(row => {
5146
+ tableColumn.forEach(column => {
5147
+ $xeTable.getCellLabel(row, column);
5148
+ });
5149
+ });
5150
+ }
5151
+ return $xeTable.$nextTick();
5152
+ },
5111
5153
  getFooterCellLabel(row, fieldOrColumn) {
5112
5154
  const $xeTable = this;
5113
5155
  const reactData = $xeTable;
@@ -5179,6 +5221,47 @@ const tableMethods = {
5179
5221
  }
5180
5222
  return cellLabel;
5181
5223
  },
5224
+ updateFooterCellLabel(row, fieldOrColumn) {
5225
+ const $xeTable = this;
5226
+ const reactData = $xeTable;
5227
+ const internalData = $xeTable;
5228
+ const column = handleFieldOrColumn($xeTable, fieldOrColumn);
5229
+ if (!column) {
5230
+ return null;
5231
+ }
5232
+ const { footerTableData } = reactData;
5233
+ const { footerFullDataRowData } = internalData;
5234
+ const colid = column.id;
5235
+ const $rowIndex = footerTableData.indexOf(row);
5236
+ const rowRest = footerFullDataRowData[$rowIndex];
5237
+ if (rowRest) {
5238
+ const formatData = rowRest.formatData;
5239
+ if (formatData) {
5240
+ delete formatData[colid];
5241
+ }
5242
+ }
5243
+ return $xeTable.getFooterCellLabel(row, column);
5244
+ },
5245
+ clearFooterFormatterCache(isUpdate) {
5246
+ const $xeTable = this;
5247
+ const reactData = $xeTable;
5248
+ const internalData = $xeTable;
5249
+ const { tableData, tableColumn } = reactData;
5250
+ const { footerFullDataRowData } = internalData;
5251
+ XEUtils.each(footerFullDataRowData, (rowRest) => {
5252
+ if (rowRest.formatData) {
5253
+ rowRest.formatData = undefined;
5254
+ }
5255
+ });
5256
+ if (isUpdate) {
5257
+ tableData.forEach(row => {
5258
+ tableColumn.forEach(column => {
5259
+ $xeTable.getFooterCellLabel(row, column);
5260
+ });
5261
+ });
5262
+ }
5263
+ return $xeTable.$nextTick();
5264
+ },
5182
5265
  /**
5183
5266
  * 检查是否为临时行数据
5184
5267
  */
@@ -11074,7 +11157,6 @@ const tableMethods = {
11074
11157
  handleScrollEvent(evnt, isRollY, isRollX, scrollTop, scrollLeft, params) {
11075
11158
  const $xeTable = this;
11076
11159
  const props = $xeTable;
11077
- const reactData = $xeTable;
11078
11160
  const internalData = $xeTable;
11079
11161
  const { highlightHoverRow } = props;
11080
11162
  const { lastScrollLeft, lastScrollTop } = internalData;
@@ -11140,7 +11222,7 @@ const tableMethods = {
11140
11222
  }
11141
11223
  internalData.lastScrollTop = scrollTop;
11142
11224
  }
11143
- reactData.lastScrollTime = Date.now();
11225
+ internalData.lastSTime = Date.now();
11144
11226
  const evntParams = Object.assign({ source: sourceType, scrollTop,
11145
11227
  scrollLeft,
11146
11228
  bodyHeight,
@@ -11396,7 +11478,7 @@ const tableMethods = {
11396
11478
  if (!bodyScrollElem) {
11397
11479
  return;
11398
11480
  }
11399
- const wheelSpeed = getWheelSpeed(reactData.lastScrollTime);
11481
+ const wheelSpeed = getWheelSpeed(internalData.lastSTime);
11400
11482
  const deltaTop = shiftKey ? 0 : (deltaY * wheelSpeed);
11401
11483
  const deltaLeft = (shiftKey ? (deltaX || deltaY) : deltaX) * wheelSpeed;
11402
11484
  const currScrollTop = bodyScrollElem.scrollTop;
@@ -11883,14 +11965,18 @@ const tableMethods = {
11883
11965
  setScrollLeft(bodyScrollElem, scrollLeft);
11884
11966
  setScrollLeft(headerScrollElem, scrollLeft);
11885
11967
  setScrollLeft(footerScrollElem, scrollLeft);
11886
- loadScrollXData($xeTable);
11968
+ if (reactData.scrollXLoad) {
11969
+ loadScrollXData($xeTable);
11970
+ }
11887
11971
  }
11888
11972
  if (XEUtils.isNumber(scrollTop)) {
11889
11973
  setScrollTop(yHandleEl, scrollTop);
11890
11974
  setScrollTop(bodyScrollElem, scrollTop);
11891
11975
  setScrollTop(leftScrollElem, scrollTop);
11892
11976
  setScrollTop(rightScrollElem, scrollTop);
11893
- loadScrollYData($xeTable);
11977
+ if (reactData.scrollYLoad) {
11978
+ loadScrollYData($xeTable);
11979
+ }
11894
11980
  }
11895
11981
  return new Promise(resolve => {
11896
11982
  setTimeout(() => {
@@ -1,6 +1,6 @@
1
1
  import XEUtils from 'xe-utils';
2
2
  import { getFuncText, isEnableConf } from '../../ui/src/utils';
3
- import { initTpImg } from '../../ui/src/dom';
3
+ import { initTpImg, toCssUnit } from '../../ui/src/dom';
4
4
  import { createReactData, createInternalData, createHandleGetRowId, getCalcHeight, hasDeepKey } from './util';
5
5
  import { VxeUI } from '../../ui';
6
6
  import methods from './methods';
@@ -1136,6 +1136,19 @@ export default {
1136
1136
  }
1137
1137
  return '';
1138
1138
  },
1139
+ computeTableStyle() {
1140
+ const $xeTable = this;
1141
+ const scrollbarOpts = $xeTable.computeScrollbarOpts;
1142
+ const { width, height } = scrollbarOpts;
1143
+ const tStys = {};
1144
+ if (width) {
1145
+ tStys['--vxe-ui-table-view-scrollbar-width'] = toCssUnit(width);
1146
+ }
1147
+ if (height) {
1148
+ tStys['--vxe-ui-table-view-scrollbar-height'] = toCssUnit(height);
1149
+ }
1150
+ return tStys;
1151
+ },
1139
1152
  computeTableRowExpandedList() {
1140
1153
  const $xeTable = this;
1141
1154
  const reactData = $xeTable;
@@ -1919,6 +1932,7 @@ export default {
1919
1932
  footer: slots.footerTooltip || slots['footer-tooltip']
1920
1933
  };
1921
1934
  const currTooltipSlot = tooltipStore.visible && tooltipStore.type ? tipSlots[tooltipStore.type] : null;
1935
+ const tableStyle = $xeTable.computeTableStyle;
1922
1936
  const rowDragOpts = $xeTable.computeRowDragOpts;
1923
1937
  const tableTipConfig = $xeTable.computeTableTipConfig;
1924
1938
  const validTipConfig = $xeTable.computeValidTipConfig;
@@ -1986,6 +2000,7 @@ export default {
1986
2000
  'is--virtual-x': scrollXLoad,
1987
2001
  'is--virtual-y': scrollYLoad
1988
2002
  }],
2003
+ style: tableStyle,
1989
2004
  attrs: {
1990
2005
  spellcheck: false
1991
2006
  },
@@ -124,6 +124,7 @@ export function createInternalData() {
124
124
  tFooterHeight: 0,
125
125
  teleportToWrapperElem: null,
126
126
  popupToWrapperElem: null,
127
+ lastSTime: 0,
127
128
  inited: false,
128
129
  tooltipTimeout: null,
129
130
  initStatus: false,
@@ -153,8 +154,6 @@ export function createReactData() {
153
154
  scrollbarWidth: 0,
154
155
  // 横向滚动条的高度
155
156
  scrollbarHeight: 0,
156
- // 最后滚动时间戳
157
- lastScrollTime: 0,
158
157
  // 行高
159
158
  rowHeight: 0,
160
159
  // 表格父容器的高度
@@ -2415,7 +2415,7 @@
2415
2415
  .vxe-table .vxe-table--scroll-x-handle {
2416
2416
  overflow-y: hidden;
2417
2417
  overflow-x: scroll;
2418
- height: 18px;
2418
+ height: var(--vxe-ui-table-view-scrollbar-height);
2419
2419
  }
2420
2420
  .vxe-table .vxe-table--scroll-y-handle,
2421
2421
  .vxe-table .vxe-table--scroll-y-wrapper {
@@ -2427,7 +2427,7 @@
2427
2427
  .vxe-table .vxe-table--scroll-y-handle {
2428
2428
  overflow-y: scroll;
2429
2429
  overflow-x: hidden;
2430
- width: 18px;
2430
+ width: var(--vxe-ui-table-view-scrollbar-width);
2431
2431
  height: 100%;
2432
2432
  }
2433
2433
  .vxe-table .vxe-table--scroll-x-space {