vxe-table 3.15.9 → 3.15.11

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.
@@ -1321,7 +1321,7 @@ function updateStyle($xeTable) {
1321
1321
  isOptimizeMode = true;
1322
1322
  }
1323
1323
  }
1324
- if (!isOptimizeMode) {
1324
+ if (!isOptimizeMode || !isColLoading && (fixedType || !overflowX)) {
1325
1325
  renderColumnList = visibleColumn;
1326
1326
  }
1327
1327
  if (fixedType) {
@@ -8505,10 +8505,10 @@ const Methods = {
8505
8505
  if (!actived.args || evnt.currentTarget !== actived.args.cell) {
8506
8506
  if (editOpts.mode === 'row') {
8507
8507
  checkValidate($xeTable, 'blur').catch(e => e).then(() => {
8508
- this.handleEdit(params, evnt).then(() => checkValidate($xeTable, 'change')).catch(e => e);
8508
+ $xeTable.handleEdit(params, evnt).then(() => checkValidate($xeTable, 'change')).catch(e => e);
8509
8509
  });
8510
8510
  } else if (editOpts.mode === 'cell') {
8511
- this.handleEdit(params, evnt).then(() => checkValidate($xeTable, 'change')).catch(e => e);
8511
+ $xeTable.handleEdit(params, evnt).then(() => checkValidate($xeTable, 'change')).catch(e => e);
8512
8512
  }
8513
8513
  }
8514
8514
  }
@@ -9505,9 +9505,7 @@ const Methods = {
9505
9505
  },
9506
9506
  sort(sortConfs, sortOrder) {
9507
9507
  const $xeTable = this;
9508
- const {
9509
- sortOpts
9510
- } = this;
9508
+ const sortOpts = $xeTable.computeSortOpts;
9511
9509
  const {
9512
9510
  multiple,
9513
9511
  remote,
@@ -9527,7 +9525,7 @@ const Methods = {
9527
9525
  if (sortConfs.length) {
9528
9526
  let firstSortColumn;
9529
9527
  if (!multiple) {
9530
- clearAllSort(this);
9528
+ clearAllSort($xeTable);
9531
9529
  }
9532
9530
  (multiple ? sortConfs : [sortConfs[0]]).forEach((confs, index) => {
9533
9531
  let {
@@ -9536,14 +9534,14 @@ const Methods = {
9536
9534
  } = confs;
9537
9535
  let column = field;
9538
9536
  if (_xeUtils.default.isString(field)) {
9539
- column = this.getColumnByField(field);
9537
+ column = $xeTable.getColumnByField(field);
9540
9538
  }
9541
9539
  if (column && (column.sortable || column.remoteSort)) {
9542
9540
  if (!firstSortColumn) {
9543
9541
  firstSortColumn = column;
9544
9542
  }
9545
- if (orders.indexOf(order) === -1) {
9546
- order = getNextSortOrder(this, column);
9543
+ if (orders && orders.indexOf(order) === -1) {
9544
+ order = getNextSortOrder($xeTable, column);
9547
9545
  }
9548
9546
  if (column.order !== order) {
9549
9547
  column.order = order;
@@ -9553,14 +9551,15 @@ const Methods = {
9553
9551
  });
9554
9552
  // 如果是服务端排序,则跳过本地排序处理
9555
9553
  if (!remote || firstSortColumn && firstSortColumn.remoteSort) {
9556
- this.handleTableData(true);
9554
+ $xeTable.handleTableData(true);
9557
9555
  }
9558
- return this.$nextTick().then(() => {
9559
- this.updateCellAreas();
9556
+ return $xeTable.$nextTick().then(() => {
9557
+ updateRowOffsetTop($xeTable);
9558
+ $xeTable.updateCellAreas();
9560
9559
  return updateStyle($xeTable);
9561
9560
  });
9562
9561
  }
9563
- return this.$nextTick();
9562
+ return $xeTable.$nextTick();
9564
9563
  },
9565
9564
  setSort(sortConfs, isUpdate) {
9566
9565
  const $xeTable = this;
@@ -9592,7 +9591,7 @@ const Methods = {
9592
9591
  firstColumn = column;
9593
9592
  }
9594
9593
  if (column && column.sortable) {
9595
- if (orders.indexOf(order) === -1) {
9594
+ if (orders && orders.indexOf(order) === -1) {
9596
9595
  order = getNextSortOrder($xeTable, column);
9597
9596
  }
9598
9597
  if (column.order !== order) {
@@ -9608,6 +9607,7 @@ const Methods = {
9608
9607
  $xeTable.handleColumnSortEvent(new Event('click'), firstColumn);
9609
9608
  }
9610
9609
  return $xeTable.$nextTick().then(() => {
9610
+ updateRowOffsetTop($xeTable);
9611
9611
  $xeTable.updateCellAreas();
9612
9612
  return updateStyle($xeTable);
9613
9613
  });
@@ -9621,21 +9621,22 @@ const Methods = {
9621
9621
  */
9622
9622
  clearSort(fieldOrColumn) {
9623
9623
  const $xeTable = this;
9624
- const {
9625
- sortOpts
9626
- } = this;
9624
+ const sortOpts = $xeTable.computeSortOpts;
9627
9625
  if (fieldOrColumn) {
9628
- const column = (0, _util.handleFieldOrColumn)(this, fieldOrColumn);
9626
+ const column = (0, _util.handleFieldOrColumn)($xeTable, fieldOrColumn);
9629
9627
  if (column) {
9630
9628
  column.order = null;
9631
9629
  }
9632
9630
  } else {
9633
- clearAllSort(this);
9631
+ clearAllSort($xeTable);
9634
9632
  }
9635
9633
  if (!sortOpts.remote) {
9636
- this.handleTableData(true);
9634
+ $xeTable.handleTableData(true);
9637
9635
  }
9638
- return this.$nextTick().then(() => updateStyle($xeTable));
9636
+ return $xeTable.$nextTick().then(() => {
9637
+ updateRowOffsetTop($xeTable);
9638
+ return updateStyle($xeTable);
9639
+ });
9639
9640
  },
9640
9641
  // 在 v3 中废弃
9641
9642
  getSortColumn() {
@@ -11003,7 +11004,6 @@ const Methods = {
11003
11004
  const reactData = $xeTable;
11004
11005
  const internalData = $xeTable;
11005
11006
  const {
11006
- isGroup,
11007
11007
  scrollXLoad,
11008
11008
  overflowX,
11009
11009
  scrollXWidth
@@ -11050,13 +11050,13 @@ const Methods = {
11050
11050
  marginLeft = `${xSpaceLeft}px`;
11051
11051
  }
11052
11052
  if (headerTableElem) {
11053
- headerTableElem.style.marginLeft = isGroup ? '' : marginLeft;
11053
+ headerTableElem.style.marginLeft = headerTableElem.getAttribute('xvm') ? marginLeft : '';
11054
11054
  }
11055
11055
  if (bodyTableElem) {
11056
11056
  bodyTableElem.style.marginLeft = marginLeft;
11057
11057
  }
11058
11058
  if (footerTableElem) {
11059
- footerTableElem.style.marginLeft = marginLeft;
11059
+ footerTableElem.style.marginLeft = footerTableElem.getAttribute('xvm') ? marginLeft : '';
11060
11060
  }
11061
11061
  reactData.isScrollXBig = isScrollXBig;
11062
11062
  const containerList = ['main'];