vxe-table 3.20.0 → 3.20.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.
Files changed (53) 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/src/body.js +4 -2
  6. package/es/table/src/column.js +1 -1
  7. package/es/table/src/methods.js +23 -17
  8. package/es/table/src/table.js +16 -1
  9. package/es/table/src/util.js +1 -2
  10. package/es/table/style.css +2 -2
  11. package/es/table/style.min.css +1 -1
  12. package/es/ui/index.js +1 -1
  13. package/es/ui/src/log.js +1 -1
  14. package/es/vxe-table/style.css +2 -2
  15. package/es/vxe-table/style.min.css +1 -1
  16. package/lib/index.css +1 -1
  17. package/lib/index.min.css +1 -1
  18. package/lib/index.umd.js +34 -14
  19. package/lib/index.umd.min.js +1 -1
  20. package/lib/style.css +1 -1
  21. package/lib/style.min.css +1 -1
  22. package/lib/table/src/body.js +5 -2
  23. package/lib/table/src/body.min.js +1 -1
  24. package/lib/table/src/column.js +1 -1
  25. package/lib/table/src/column.min.js +1 -1
  26. package/lib/table/src/methods.js +7 -7
  27. package/lib/table/src/methods.min.js +1 -1
  28. package/lib/table/src/table.js +18 -0
  29. package/lib/table/src/table.min.js +1 -1
  30. package/lib/table/src/util.js +1 -2
  31. package/lib/table/src/util.min.js +1 -1
  32. package/lib/table/style/style.css +2 -2
  33. package/lib/table/style/style.min.css +1 -1
  34. package/lib/ui/index.js +1 -1
  35. package/lib/ui/index.min.js +1 -1
  36. package/lib/ui/src/log.js +1 -1
  37. package/lib/ui/src/log.min.js +1 -1
  38. package/lib/vxe-table/style/style.css +2 -2
  39. package/lib/vxe-table/style/style.min.css +1 -1
  40. package/package.json +1 -1
  41. package/packages/table/src/body.ts +4 -2
  42. package/packages/table/src/column.ts +1 -1
  43. package/packages/table/src/methods.ts +23 -17
  44. package/packages/table/src/table.ts +18 -2
  45. package/packages/table/src/util.ts +2 -2
  46. package/styles/components/table.scss +2 -2
  47. package/styles/theme/base.scss +3 -0
  48. /package/es/{iconfont.1773027250443.ttf → iconfont.1773303132392.ttf} +0 -0
  49. /package/es/{iconfont.1773027250443.woff → iconfont.1773303132392.woff} +0 -0
  50. /package/es/{iconfont.1773027250443.woff2 → iconfont.1773303132392.woff2} +0 -0
  51. /package/lib/{iconfont.1773027250443.ttf → iconfont.1773303132392.ttf} +0 -0
  52. /package/lib/{iconfont.1773027250443.woff → iconfont.1773303132392.woff} +0 -0
  53. /package/lib/{iconfont.1773027250443.woff2 → iconfont.1773303132392.woff2} +0 -0
@@ -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;
@@ -133,7 +133,7 @@ export const columnProps = {
133
133
  // 内容渲染配置项
134
134
  contentRender: Object,
135
135
  // 聚合函数
136
- aggFunc: [String, Boolean],
136
+ aggFunc: [Boolean, String],
137
137
  // 将单元格复制到剪贴板
138
138
  copyMethod: Function,
139
139
  // 将剪贴单元格的值清除
@@ -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) {
@@ -8248,6 +8248,7 @@ const tableMethods = {
8248
8248
  if (!checkMethod || checkMethod({ $table: $xeTable, row })) {
8249
8249
  let newValue = row;
8250
8250
  let isChange = oldValue !== newValue;
8251
+ const selected = !isChange;
8251
8252
  if (isChange) {
8252
8253
  handleCheckedRadioRow($xeTable, newValue);
8253
8254
  }
@@ -8259,7 +8260,7 @@ const tableMethods = {
8259
8260
  }
8260
8261
  }
8261
8262
  if (isChange) {
8262
- $xeTable.dispatchEvent('radio-change', Object.assign({ oldValue, newValue }, params), evnt);
8263
+ $xeTable.dispatchEvent('radio-change', Object.assign({ oldValue, newValue, selected }, params), evnt);
8263
8264
  }
8264
8265
  }
8265
8266
  },
@@ -8270,7 +8271,7 @@ const tableMethods = {
8270
8271
  const columnOpts = $xeTable.computeColumnOpts;
8271
8272
  const currentColumnOpts = $xeTable.computeCurrentColumnOpts;
8272
8273
  const beforeRowMethod = currentColumnOpts.beforeSelectMethod || columnOpts.currentMethod;
8273
- const { column: newValue } = params;
8274
+ let { column: newValue } = params;
8274
8275
  const { trigger, strict } = currentColumnOpts;
8275
8276
  if (trigger === 'manual') {
8276
8277
  return;
@@ -8282,8 +8283,9 @@ const tableMethods = {
8282
8283
  $xeTable.setCurrentColumn(newValue);
8283
8284
  }
8284
8285
  else {
8285
- isChange = true;
8286
- if (selected) {
8286
+ isChange = oldValue === newValue;
8287
+ if (isChange) {
8288
+ newValue = null;
8287
8289
  $xeTable.clearCurrentColumn();
8288
8290
  }
8289
8291
  else {
@@ -8291,7 +8293,7 @@ const tableMethods = {
8291
8293
  }
8292
8294
  }
8293
8295
  if (isChange) {
8294
- $xeTable.dispatchEvent('current-column-change', Object.assign({ oldValue, newValue }, params), evnt);
8296
+ $xeTable.dispatchEvent('current-column-change', Object.assign({ oldValue, newValue, selected }, params), evnt);
8295
8297
  }
8296
8298
  }
8297
8299
  else {
@@ -8305,7 +8307,7 @@ const tableMethods = {
8305
8307
  const rowOpts = $xeTable.computeRowOpts;
8306
8308
  const currentRowOpts = $xeTable.computeCurrentRowOpts;
8307
8309
  const beforeRowMethod = currentRowOpts.beforeSelectMethod || rowOpts.currentMethod;
8308
- const { row: newValue } = params;
8310
+ let { row: newValue } = params;
8309
8311
  const { trigger, strict } = currentRowOpts;
8310
8312
  if (trigger === 'manual') {
8311
8313
  return;
@@ -8317,8 +8319,9 @@ const tableMethods = {
8317
8319
  $xeTable.setCurrentRow(newValue);
8318
8320
  }
8319
8321
  else {
8320
- isChange = true;
8321
- if (selected) {
8322
+ isChange = oldValue === newValue;
8323
+ if (isChange) {
8324
+ newValue = null;
8322
8325
  $xeTable.clearCurrentRow();
8323
8326
  }
8324
8327
  else {
@@ -8326,9 +8329,9 @@ const tableMethods = {
8326
8329
  }
8327
8330
  }
8328
8331
  if (isChange) {
8329
- $xeTable.dispatchEvent('current-row-change', Object.assign({ oldValue, newValue }, params), evnt);
8332
+ $xeTable.dispatchEvent('current-row-change', Object.assign({ oldValue, newValue, selected }, params), evnt);
8330
8333
  // 已废弃
8331
- $xeTable.dispatchEvent('current-change', Object.assign({ oldValue, newValue }, params), evnt);
8334
+ $xeTable.dispatchEvent('current-change', Object.assign({ oldValue, newValue, selected }, params), evnt);
8332
8335
  }
8333
8336
  }
8334
8337
  else {
@@ -11071,7 +11074,6 @@ const tableMethods = {
11071
11074
  handleScrollEvent(evnt, isRollY, isRollX, scrollTop, scrollLeft, params) {
11072
11075
  const $xeTable = this;
11073
11076
  const props = $xeTable;
11074
- const reactData = $xeTable;
11075
11077
  const internalData = $xeTable;
11076
11078
  const { highlightHoverRow } = props;
11077
11079
  const { lastScrollLeft, lastScrollTop } = internalData;
@@ -11137,7 +11139,7 @@ const tableMethods = {
11137
11139
  }
11138
11140
  internalData.lastScrollTop = scrollTop;
11139
11141
  }
11140
- reactData.lastScrollTime = Date.now();
11142
+ internalData.lastSTime = Date.now();
11141
11143
  const evntParams = Object.assign({ source: sourceType, scrollTop,
11142
11144
  scrollLeft,
11143
11145
  bodyHeight,
@@ -11393,7 +11395,7 @@ const tableMethods = {
11393
11395
  if (!bodyScrollElem) {
11394
11396
  return;
11395
11397
  }
11396
- const wheelSpeed = getWheelSpeed(reactData.lastScrollTime);
11398
+ const wheelSpeed = getWheelSpeed(internalData.lastSTime);
11397
11399
  const deltaTop = shiftKey ? 0 : (deltaY * wheelSpeed);
11398
11400
  const deltaLeft = (shiftKey ? (deltaX || deltaY) : deltaX) * wheelSpeed;
11399
11401
  const currScrollTop = bodyScrollElem.scrollTop;
@@ -11880,14 +11882,18 @@ const tableMethods = {
11880
11882
  setScrollLeft(bodyScrollElem, scrollLeft);
11881
11883
  setScrollLeft(headerScrollElem, scrollLeft);
11882
11884
  setScrollLeft(footerScrollElem, scrollLeft);
11883
- loadScrollXData($xeTable);
11885
+ if (reactData.scrollXLoad) {
11886
+ loadScrollXData($xeTable);
11887
+ }
11884
11888
  }
11885
11889
  if (XEUtils.isNumber(scrollTop)) {
11886
11890
  setScrollTop(yHandleEl, scrollTop);
11887
11891
  setScrollTop(bodyScrollElem, scrollTop);
11888
11892
  setScrollTop(leftScrollElem, scrollTop);
11889
11893
  setScrollTop(rightScrollElem, scrollTop);
11890
- loadScrollYData($xeTable);
11894
+ if (reactData.scrollYLoad) {
11895
+ loadScrollYData($xeTable);
11896
+ }
11891
11897
  }
11892
11898
  return new Promise(resolve => {
11893
11899
  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 {