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.
@@ -1050,7 +1050,7 @@ function updateStyle($xeTable) {
1050
1050
  isOptimizeMode = true;
1051
1051
  }
1052
1052
  }
1053
- if (!isOptimizeMode) {
1053
+ if (!isOptimizeMode || (!isColLoading && (fixedType || !overflowX))) {
1054
1054
  renderColumnList = visibleColumn;
1055
1055
  }
1056
1056
  if (fixedType) {
@@ -7275,13 +7275,13 @@ const Methods = {
7275
7275
  checkValidate($xeTable, 'blur')
7276
7276
  .catch((e) => e)
7277
7277
  .then(() => {
7278
- this.handleEdit(params, evnt)
7278
+ $xeTable.handleEdit(params, evnt)
7279
7279
  .then(() => checkValidate($xeTable, 'change'))
7280
7280
  .catch((e) => e);
7281
7281
  });
7282
7282
  }
7283
7283
  else if (editOpts.mode === 'cell') {
7284
- this.handleEdit(params, evnt)
7284
+ $xeTable.handleEdit(params, evnt)
7285
7285
  .then(() => checkValidate($xeTable, 'change'))
7286
7286
  .catch((e) => e);
7287
7287
  }
@@ -8132,7 +8132,7 @@ const Methods = {
8132
8132
  },
8133
8133
  sort(sortConfs, sortOrder) {
8134
8134
  const $xeTable = this;
8135
- const { sortOpts } = this;
8135
+ const sortOpts = $xeTable.computeSortOpts;
8136
8136
  const { multiple, remote, orders } = sortOpts;
8137
8137
  if (sortConfs) {
8138
8138
  if (XEUtils.isString(sortConfs)) {
@@ -8147,20 +8147,20 @@ const Methods = {
8147
8147
  if (sortConfs.length) {
8148
8148
  let firstSortColumn;
8149
8149
  if (!multiple) {
8150
- clearAllSort(this);
8150
+ clearAllSort($xeTable);
8151
8151
  }
8152
8152
  (multiple ? sortConfs : [sortConfs[0]]).forEach((confs, index) => {
8153
8153
  let { field, order } = confs;
8154
8154
  let column = field;
8155
8155
  if (XEUtils.isString(field)) {
8156
- column = this.getColumnByField(field);
8156
+ column = $xeTable.getColumnByField(field);
8157
8157
  }
8158
8158
  if (column && (column.sortable || column.remoteSort)) {
8159
8159
  if (!firstSortColumn) {
8160
8160
  firstSortColumn = column;
8161
8161
  }
8162
- if (orders.indexOf(order) === -1) {
8163
- order = getNextSortOrder(this, column);
8162
+ if (orders && orders.indexOf(order) === -1) {
8163
+ order = getNextSortOrder($xeTable, column);
8164
8164
  }
8165
8165
  if (column.order !== order) {
8166
8166
  column.order = order;
@@ -8170,14 +8170,15 @@ const Methods = {
8170
8170
  });
8171
8171
  // 如果是服务端排序,则跳过本地排序处理
8172
8172
  if (!remote || (firstSortColumn && firstSortColumn.remoteSort)) {
8173
- this.handleTableData(true);
8173
+ $xeTable.handleTableData(true);
8174
8174
  }
8175
- return this.$nextTick().then(() => {
8176
- this.updateCellAreas();
8175
+ return $xeTable.$nextTick().then(() => {
8176
+ updateRowOffsetTop($xeTable);
8177
+ $xeTable.updateCellAreas();
8177
8178
  return updateStyle($xeTable);
8178
8179
  });
8179
8180
  }
8180
- return this.$nextTick();
8181
+ return $xeTable.$nextTick();
8181
8182
  },
8182
8183
  setSort(sortConfs, isUpdate) {
8183
8184
  const $xeTable = this;
@@ -8202,7 +8203,7 @@ const Methods = {
8202
8203
  firstColumn = column;
8203
8204
  }
8204
8205
  if (column && column.sortable) {
8205
- if (orders.indexOf(order) === -1) {
8206
+ if (orders && orders.indexOf(order) === -1) {
8206
8207
  order = getNextSortOrder($xeTable, column);
8207
8208
  }
8208
8209
  if (column.order !== order) {
@@ -8218,6 +8219,7 @@ const Methods = {
8218
8219
  $xeTable.handleColumnSortEvent(new Event('click'), firstColumn);
8219
8220
  }
8220
8221
  return $xeTable.$nextTick().then(() => {
8222
+ updateRowOffsetTop($xeTable);
8221
8223
  $xeTable.updateCellAreas();
8222
8224
  return updateStyle($xeTable);
8223
8225
  });
@@ -8231,20 +8233,23 @@ const Methods = {
8231
8233
  */
8232
8234
  clearSort(fieldOrColumn) {
8233
8235
  const $xeTable = this;
8234
- const { sortOpts } = this;
8236
+ const sortOpts = $xeTable.computeSortOpts;
8235
8237
  if (fieldOrColumn) {
8236
- const column = handleFieldOrColumn(this, fieldOrColumn);
8238
+ const column = handleFieldOrColumn($xeTable, fieldOrColumn);
8237
8239
  if (column) {
8238
8240
  column.order = null;
8239
8241
  }
8240
8242
  }
8241
8243
  else {
8242
- clearAllSort(this);
8244
+ clearAllSort($xeTable);
8243
8245
  }
8244
8246
  if (!sortOpts.remote) {
8245
- this.handleTableData(true);
8247
+ $xeTable.handleTableData(true);
8246
8248
  }
8247
- return this.$nextTick().then(() => updateStyle($xeTable));
8249
+ return $xeTable.$nextTick().then(() => {
8250
+ updateRowOffsetTop($xeTable);
8251
+ return updateStyle($xeTable);
8252
+ });
8248
8253
  },
8249
8254
  // 在 v3 中废弃
8250
8255
  getSortColumn() {
@@ -9389,7 +9394,7 @@ const Methods = {
9389
9394
  const $xeTable = this;
9390
9395
  const reactData = $xeTable;
9391
9396
  const internalData = $xeTable;
9392
- const { isGroup, scrollXLoad, overflowX, scrollXWidth } = reactData;
9397
+ const { scrollXLoad, overflowX, scrollXWidth } = reactData;
9393
9398
  const { visibleColumn, scrollXStore, elemStore, fullColumnIdData } = internalData;
9394
9399
  const mouseOpts = $xeTable.computeMouseOpts;
9395
9400
  const tableBody = $xeTable.$refs.refTableBody;
@@ -9428,13 +9433,13 @@ const Methods = {
9428
9433
  marginLeft = `${xSpaceLeft}px`;
9429
9434
  }
9430
9435
  if (headerTableElem) {
9431
- headerTableElem.style.marginLeft = isGroup ? '' : marginLeft;
9436
+ headerTableElem.style.marginLeft = headerTableElem.getAttribute('xvm') ? marginLeft : '';
9432
9437
  }
9433
9438
  if (bodyTableElem) {
9434
9439
  bodyTableElem.style.marginLeft = marginLeft;
9435
9440
  }
9436
9441
  if (footerTableElem) {
9437
- footerTableElem.style.marginLeft = marginLeft;
9442
+ footerTableElem.style.marginLeft = footerTableElem.getAttribute('xvm') ? marginLeft : '';
9438
9443
  }
9439
9444
  reactData.isScrollXBig = isScrollXBig;
9440
9445
  const containerList = ['main'];
package/es/ui/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { VxeUI } from '@vxe-ui/core';
2
2
  import { getFuncText } from './src/utils';
3
- export const version = "3.15.9";
3
+ export const version = "3.15.11";
4
4
  VxeUI.version = version;
5
5
  VxeUI.tableVersion = version;
6
6
  VxeUI.setConfig({
package/es/ui/src/log.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { VxeUI } from '@vxe-ui/core';
2
2
  const { log } = VxeUI;
3
- const version = `table v${"3.15.9"}`;
3
+ const version = `table v${"3.15.11"}`;
4
4
  export const warnLog = log.create('warn', version);
5
5
  export const errLog = log.create('error', version);
package/lib/index.umd.js CHANGED
@@ -2220,7 +2220,7 @@ function getClass(property, params) {
2220
2220
  ;// CONCATENATED MODULE: ./packages/ui/index.ts
2221
2221
 
2222
2222
 
2223
- const version = "3.15.9";
2223
+ const version = "3.15.11";
2224
2224
  core_.VxeUI.version = version;
2225
2225
  core_.VxeUI.tableVersion = version;
2226
2226
  core_.VxeUI.setConfig({
@@ -2858,7 +2858,7 @@ function isNodeElement(elem) {
2858
2858
  const {
2859
2859
  log: log_log
2860
2860
  } = core_.VxeUI;
2861
- const log_version = `table v${"3.15.9"}`;
2861
+ const log_version = `table v${"3.15.11"}`;
2862
2862
  const warnLog = log_log.create('warn', log_version);
2863
2863
  const errLog = log_log.create('error', log_version);
2864
2864
  ;// CONCATENATED MODULE: ./packages/table/src/columnInfo.ts
@@ -6589,7 +6589,7 @@ function updateStyle($xeTable) {
6589
6589
  isOptimizeMode = true;
6590
6590
  }
6591
6591
  }
6592
- if (!isOptimizeMode) {
6592
+ if (!isOptimizeMode || !isColLoading && (fixedType || !overflowX)) {
6593
6593
  renderColumnList = visibleColumn;
6594
6594
  }
6595
6595
  if (fixedType) {
@@ -13786,10 +13786,10 @@ const Methods = {
13786
13786
  if (!actived.args || evnt.currentTarget !== actived.args.cell) {
13787
13787
  if (editOpts.mode === 'row') {
13788
13788
  checkValidate($xeTable, 'blur').catch(e => e).then(() => {
13789
- this.handleEdit(params, evnt).then(() => checkValidate($xeTable, 'change')).catch(e => e);
13789
+ $xeTable.handleEdit(params, evnt).then(() => checkValidate($xeTable, 'change')).catch(e => e);
13790
13790
  });
13791
13791
  } else if (editOpts.mode === 'cell') {
13792
- this.handleEdit(params, evnt).then(() => checkValidate($xeTable, 'change')).catch(e => e);
13792
+ $xeTable.handleEdit(params, evnt).then(() => checkValidate($xeTable, 'change')).catch(e => e);
13793
13793
  }
13794
13794
  }
13795
13795
  }
@@ -14784,9 +14784,7 @@ const Methods = {
14784
14784
  },
14785
14785
  sort(sortConfs, sortOrder) {
14786
14786
  const $xeTable = this;
14787
- const {
14788
- sortOpts
14789
- } = this;
14787
+ const sortOpts = $xeTable.computeSortOpts;
14790
14788
  const {
14791
14789
  multiple,
14792
14790
  remote,
@@ -14806,7 +14804,7 @@ const Methods = {
14806
14804
  if (sortConfs.length) {
14807
14805
  let firstSortColumn;
14808
14806
  if (!multiple) {
14809
- clearAllSort(this);
14807
+ clearAllSort($xeTable);
14810
14808
  }
14811
14809
  (multiple ? sortConfs : [sortConfs[0]]).forEach((confs, index) => {
14812
14810
  let {
@@ -14815,14 +14813,14 @@ const Methods = {
14815
14813
  } = confs;
14816
14814
  let column = field;
14817
14815
  if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isString(field)) {
14818
- column = this.getColumnByField(field);
14816
+ column = $xeTable.getColumnByField(field);
14819
14817
  }
14820
14818
  if (column && (column.sortable || column.remoteSort)) {
14821
14819
  if (!firstSortColumn) {
14822
14820
  firstSortColumn = column;
14823
14821
  }
14824
- if (orders.indexOf(order) === -1) {
14825
- order = getNextSortOrder(this, column);
14822
+ if (orders && orders.indexOf(order) === -1) {
14823
+ order = getNextSortOrder($xeTable, column);
14826
14824
  }
14827
14825
  if (column.order !== order) {
14828
14826
  column.order = order;
@@ -14832,14 +14830,15 @@ const Methods = {
14832
14830
  });
14833
14831
  // 如果是服务端排序,则跳过本地排序处理
14834
14832
  if (!remote || firstSortColumn && firstSortColumn.remoteSort) {
14835
- this.handleTableData(true);
14833
+ $xeTable.handleTableData(true);
14836
14834
  }
14837
- return this.$nextTick().then(() => {
14838
- this.updateCellAreas();
14835
+ return $xeTable.$nextTick().then(() => {
14836
+ updateRowOffsetTop($xeTable);
14837
+ $xeTable.updateCellAreas();
14839
14838
  return updateStyle($xeTable);
14840
14839
  });
14841
14840
  }
14842
- return this.$nextTick();
14841
+ return $xeTable.$nextTick();
14843
14842
  },
14844
14843
  setSort(sortConfs, isUpdate) {
14845
14844
  const $xeTable = this;
@@ -14871,7 +14870,7 @@ const Methods = {
14871
14870
  firstColumn = column;
14872
14871
  }
14873
14872
  if (column && column.sortable) {
14874
- if (orders.indexOf(order) === -1) {
14873
+ if (orders && orders.indexOf(order) === -1) {
14875
14874
  order = getNextSortOrder($xeTable, column);
14876
14875
  }
14877
14876
  if (column.order !== order) {
@@ -14887,6 +14886,7 @@ const Methods = {
14887
14886
  $xeTable.handleColumnSortEvent(new Event('click'), firstColumn);
14888
14887
  }
14889
14888
  return $xeTable.$nextTick().then(() => {
14889
+ updateRowOffsetTop($xeTable);
14890
14890
  $xeTable.updateCellAreas();
14891
14891
  return updateStyle($xeTable);
14892
14892
  });
@@ -14900,21 +14900,22 @@ const Methods = {
14900
14900
  */
14901
14901
  clearSort(fieldOrColumn) {
14902
14902
  const $xeTable = this;
14903
- const {
14904
- sortOpts
14905
- } = this;
14903
+ const sortOpts = $xeTable.computeSortOpts;
14906
14904
  if (fieldOrColumn) {
14907
- const column = handleFieldOrColumn(this, fieldOrColumn);
14905
+ const column = handleFieldOrColumn($xeTable, fieldOrColumn);
14908
14906
  if (column) {
14909
14907
  column.order = null;
14910
14908
  }
14911
14909
  } else {
14912
- clearAllSort(this);
14910
+ clearAllSort($xeTable);
14913
14911
  }
14914
14912
  if (!sortOpts.remote) {
14915
- this.handleTableData(true);
14913
+ $xeTable.handleTableData(true);
14916
14914
  }
14917
- return this.$nextTick().then(() => updateStyle($xeTable));
14915
+ return $xeTable.$nextTick().then(() => {
14916
+ updateRowOffsetTop($xeTable);
14917
+ return updateStyle($xeTable);
14918
+ });
14918
14919
  },
14919
14920
  // 在 v3 中废弃
14920
14921
  getSortColumn() {
@@ -16283,7 +16284,6 @@ const Methods = {
16283
16284
  const reactData = $xeTable;
16284
16285
  const internalData = $xeTable;
16285
16286
  const {
16286
- isGroup,
16287
16287
  scrollXLoad,
16288
16288
  overflowX,
16289
16289
  scrollXWidth
@@ -16330,13 +16330,13 @@ const Methods = {
16330
16330
  marginLeft = `${xSpaceLeft}px`;
16331
16331
  }
16332
16332
  if (headerTableElem) {
16333
- headerTableElem.style.marginLeft = isGroup ? '' : marginLeft;
16333
+ headerTableElem.style.marginLeft = headerTableElem.getAttribute('xvm') ? marginLeft : '';
16334
16334
  }
16335
16335
  if (bodyTableElem) {
16336
16336
  bodyTableElem.style.marginLeft = marginLeft;
16337
16337
  }
16338
16338
  if (footerTableElem) {
16339
- footerTableElem.style.marginLeft = marginLeft;
16339
+ footerTableElem.style.marginLeft = footerTableElem.getAttribute('xvm') ? marginLeft : '';
16340
16340
  }
16341
16341
  reactData.isScrollXBig = isScrollXBig;
16342
16342
  const containerList = ['main'];