vxe-table 3.17.8 → 3.17.9

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.
@@ -458,6 +458,8 @@ function cacheColumnMap($xeTable) {
458
458
  reactData.rowGroupColumn = rowGroupColumn;
459
459
  reactData.treeNodeColumn = treeNodeColumn;
460
460
  reactData.expandColumn = expandColumn;
461
+ reactData.checkboxColumn = checkboxColumn;
462
+ reactData.radioColumn = radioColumn;
461
463
  reactData.isAllOverflow = isAllOverflow;
462
464
  }
463
465
  function updateScrollXStatus($xeTable, fullColumn) {
@@ -1235,9 +1237,7 @@ function updateStyle($xeTable) {
1235
1237
  editStore,
1236
1238
  isAllOverflow,
1237
1239
  expandColumn,
1238
- isColLoading,
1239
- tHeaderHeight,
1240
- tFooterHeight
1240
+ isColLoading
1241
1241
  } = reactData;
1242
1242
  const {
1243
1243
  visibleColumn,
@@ -1245,7 +1245,9 @@ function updateStyle($xeTable) {
1245
1245
  elemStore,
1246
1246
  customHeight,
1247
1247
  customMinHeight,
1248
- customMaxHeight
1248
+ customMaxHeight,
1249
+ tHeaderHeight,
1250
+ tFooterHeight
1249
1251
  } = internalData;
1250
1252
  const $xeGanttView = internalData.xeGanttView;
1251
1253
  const el = $xeTable.$refs.refElem;
@@ -1254,8 +1256,9 @@ function updateStyle($xeTable) {
1254
1256
  }
1255
1257
  const containerList = ['main', 'left', 'right'];
1256
1258
  let osbWidth = overflowY ? scrollbarWidth : 0;
1257
- const osbHeight = overflowX ? scrollbarHeight : 0;
1259
+ let osbHeight = overflowX ? scrollbarHeight : 0;
1258
1260
  const emptyPlaceholderElem = $xeTable.$refs.refEmptyPlaceholder;
1261
+ const scrollbarOpts = $xeTable.computeScrollbarOpts;
1259
1262
  const mouseOpts = $xeTable.computeMouseOpts;
1260
1263
  const expandOpts = $xeTable.computeExpandOpts;
1261
1264
  const bodyWrapperElem = (0, _util.getRefElem)(elemStore['main-body-wrapper']);
@@ -1266,13 +1269,18 @@ function updateStyle($xeTable) {
1266
1269
  }
1267
1270
  const scrollbarXToTop = $xeTable.computeScrollbarXToTop;
1268
1271
  const scrollbarYToLeft = $xeTable.computeScrollbarYToLeft;
1269
- const xScrollbarVisible = overflowX ? 'visible' : 'hidden';
1270
- let yScrollbarVisible = overflowY ? 'visible' : 'hidden';
1272
+ let xScrollbarVisible = overflowX ? 'visible' : 'hidden';
1271
1273
  if ($xeGanttView) {
1272
- if (!scrollbarYToLeft) {
1273
- osbWidth = 0;
1274
- yScrollbarVisible = 'hidden';
1275
- }
1274
+ osbHeight = scrollbarHeight;
1275
+ xScrollbarVisible = 'visible';
1276
+ } else if (scrollbarOpts.x && scrollbarOpts.x.visible === false) {
1277
+ osbHeight = 0;
1278
+ xScrollbarVisible = 'hidden';
1279
+ }
1280
+ let yScrollbarVisible = overflowY ? 'visible' : 'hidden';
1281
+ if (scrollbarOpts.y && scrollbarOpts.y.visible === false || $xeGanttView && !scrollbarYToLeft) {
1282
+ osbWidth = 0;
1283
+ yScrollbarVisible = 'hidden';
1276
1284
  }
1277
1285
  let tbHeight = 0;
1278
1286
  let bodyMaxHeight = 0;
@@ -1341,7 +1349,7 @@ function updateStyle($xeTable) {
1341
1349
  rowExpandEl.style.height = `${tbHeight}px`;
1342
1350
  rowExpandEl.style.top = `${tHeaderHeight}px`;
1343
1351
  }
1344
- reactData.tBodyHeight = tbHeight;
1352
+ internalData.tBodyHeight = tbHeight;
1345
1353
  containerList.forEach((name, index) => {
1346
1354
  const fixedType = index > 0 ? name : '';
1347
1355
  const layoutList = ['header', 'body', 'footer'];
@@ -3230,8 +3238,8 @@ function calcScrollbar($xeTable) {
3230
3238
  const hHeight = headerTableElem ? headerTableElem.clientHeight : 0;
3231
3239
  const fHeight = footerTableElem ? footerTableElem.clientHeight : 0;
3232
3240
  internalData.tableHeight = bodyWrapperElem.offsetHeight;
3233
- reactData.tHeaderHeight = hHeight;
3234
- reactData.tFooterHeight = fHeight;
3241
+ internalData.tHeaderHeight = hHeight;
3242
+ internalData.tFooterHeight = fHeight;
3235
3243
  reactData.overflowX = overflowX;
3236
3244
  reactData.parentHeight = Math.max(hHeight + fHeight + 20, $xeTable.getParentHeight());
3237
3245
  }
@@ -3321,6 +3329,9 @@ function handleLazyRecalculate($xeTable, reFull, reWidth, reHeight) {
3321
3329
  }, refreshDelay);
3322
3330
  });
3323
3331
  }
3332
+ function handleResizeEvent($xeTable) {
3333
+ handleLazyRecalculate($xeTable, true, true, true);
3334
+ }
3324
3335
  function handleUpdateAggValues($xeTable) {
3325
3336
  const reactData = $xeTable;
3326
3337
  const internalData = $xeTable;
@@ -4123,11 +4134,6 @@ function lazyScrollYData($xeTable) {
4123
4134
  function checkLastSyncScroll($xeTable, isRollX, isRollY) {
4124
4135
  const reactData = $xeTable;
4125
4136
  const internalData = $xeTable;
4126
- const {
4127
- scrollXLoad,
4128
- scrollYLoad,
4129
- isAllOverflow
4130
- } = reactData;
4131
4137
  const {
4132
4138
  lcsTimeout
4133
4139
  } = internalData;
@@ -4135,6 +4141,11 @@ function checkLastSyncScroll($xeTable, isRollX, isRollY) {
4135
4141
  clearTimeout(lcsTimeout);
4136
4142
  }
4137
4143
  internalData.lcsTimeout = setTimeout(() => {
4144
+ const {
4145
+ scrollXLoad,
4146
+ scrollYLoad,
4147
+ isAllOverflow
4148
+ } = reactData;
4138
4149
  internalData.lcsRunTime = Date.now();
4139
4150
  internalData.lcsTimeout = undefined;
4140
4151
  internalData.intoRunScroll = false;
@@ -6952,6 +6963,10 @@ const Methods = {
6952
6963
  }, 10);
6953
6964
  });
6954
6965
  },
6966
+ handleResizeEvent() {
6967
+ const $xeTable = this;
6968
+ handleResizeEvent($xeTable);
6969
+ },
6955
6970
  /**
6956
6971
  * 重新渲染布局
6957
6972
  * 刷新布局
@@ -7635,7 +7650,7 @@ const Methods = {
7635
7650
  const $xeTable = this;
7636
7651
  $xeTable.closeMenu();
7637
7652
  $xeTable.updateCellAreas();
7638
- handleLazyRecalculate($xeTable, true, true, true);
7653
+ handleResizeEvent($xeTable);
7639
7654
  $xeTable.updateCellAreas();
7640
7655
  },
7641
7656
  /**
@@ -9063,13 +9078,19 @@ const Methods = {
9063
9078
  const props = $xeTable;
9064
9079
  const reactData = $xeTable;
9065
9080
  const {
9081
+ treeConfig,
9066
9082
  highlightCurrentRow,
9067
9083
  highlightCurrentColumn,
9068
- editConfig
9084
+ editConfig,
9085
+ aggregateConfig,
9086
+ rowGroupConfig
9069
9087
  } = props;
9070
9088
  const {
9071
9089
  editStore,
9072
- isDragResize
9090
+ isDragResize,
9091
+ expandColumn,
9092
+ checkboxColumn,
9093
+ radioColumn
9073
9094
  } = reactData;
9074
9095
  if (isDragResize) {
9075
9096
  return;
@@ -9115,15 +9136,15 @@ const Methods = {
9115
9136
  }, params);
9116
9137
  if (!triggerCheckbox && !triggerRadio) {
9117
9138
  // 如果是展开行
9118
- if (!triggerExpandNode && (expandOpts.trigger === 'row' || isExpandType && expandOpts.trigger === 'cell')) {
9139
+ if (!triggerExpandNode && (expandColumn && expandOpts.trigger === 'row' || isExpandType && expandOpts.trigger === 'cell')) {
9119
9140
  $xeTable.triggerRowExpandEvent(evnt, params);
9120
9141
  }
9121
9142
  // 如果是树形表格
9122
- if (treeOpts.trigger === 'row' || treeNode && treeOpts.trigger === 'cell') {
9143
+ if (treeConfig && (treeOpts.trigger === 'row' || treeNode && treeOpts.trigger === 'cell')) {
9123
9144
  $xeTable.triggerTreeExpandEvent(evnt, params);
9124
9145
  }
9125
9146
  // 如果是行分组
9126
- if (aggregateOpts.trigger === 'row' || rowGroupNode && aggregateOpts.trigger === 'cell') {
9147
+ if ((aggregateConfig || rowGroupConfig) && (aggregateOpts.trigger === 'row' || rowGroupNode && aggregateOpts.trigger === 'cell')) {
9127
9148
  $xeTable.triggerRowGroupExpandEvent(evnt, params);
9128
9149
  }
9129
9150
  }
@@ -9143,11 +9164,11 @@ const Methods = {
9143
9164
  }
9144
9165
  }
9145
9166
  // 如果是单选框
9146
- if (!triggerRadio && (radioOpts.trigger === 'row' || isRadioType && radioOpts.trigger === 'cell')) {
9167
+ if (!triggerRadio && (radioColumn && radioOpts.trigger === 'row' || isRadioType && radioOpts.trigger === 'cell')) {
9147
9168
  $xeTable.triggerRadioRowEvent(evnt, params);
9148
9169
  }
9149
9170
  // 如果是复选框
9150
- if (!triggerCheckbox && (checkboxOpts.trigger === 'row' || isCheckboxType && checkboxOpts.trigger === 'cell')) {
9171
+ if (!triggerCheckbox && (checkboxColumn && checkboxOpts.trigger === 'row' || isCheckboxType && checkboxOpts.trigger === 'cell')) {
9151
9172
  $xeTable.handleToggleCheckRowEvent(evnt, params);
9152
9173
  }
9153
9174
  }