@kdcloudjs/table 1.2.0-canary.12 → 1.2.0-canary.14

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.
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  *
3
- * @kdcloudjs/table v1.2.0-canary.11
3
+ * @kdcloudjs/table v1.2.0-canary.13
4
4
  *
5
5
  * Copyright 2020-present, Kingdee, Inc.
6
6
  * All rights reserved.
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  *
3
- * @kdcloudjs/table v1.2.0-canary.11
3
+ * @kdcloudjs/table v1.2.0-canary.13
4
4
  *
5
5
  * Copyright 2020-present, Kingdee, Inc.
6
6
  * All rights reserved.
@@ -3950,7 +3950,8 @@ var BaseTable = /*#__PURE__*/function (_React$Component) {
3950
3950
  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_27___default.a.createElement("div", {
3951
3951
  className: classnames__WEBPACK_IMPORTED_MODULE_26___default()(_styles__WEBPACK_IMPORTED_MODULE_38__["Classes"].horizontalScrollLeftSpacer),
3952
3952
  style: {
3953
- width: info.leftLockTotalWidth
3953
+ width: info.leftLockTotalWidth,
3954
+ display: hasStickyScroll && hasScroll ? 'block' : 'none'
3954
3955
  }
3955
3956
  }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_27___default.a.createElement("div", {
3956
3957
  className: classnames__WEBPACK_IMPORTED_MODULE_26___default()(_styles__WEBPACK_IMPORTED_MODULE_38__["Classes"].stickyScroll),
@@ -3963,7 +3964,8 @@ var BaseTable = /*#__PURE__*/function (_React$Component) {
3963
3964
  })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_27___default.a.createElement("div", {
3964
3965
  className: classnames__WEBPACK_IMPORTED_MODULE_26___default()(_styles__WEBPACK_IMPORTED_MODULE_38__["Classes"].horizontalScrollRightSpacer),
3965
3966
  style: {
3966
- width: info.rightLockTotalWidth
3967
+ width: info.rightLockTotalWidth,
3968
+ display: hasStickyScroll && hasScroll ? 'block' : 'none'
3967
3969
  }
3968
3970
  }));
3969
3971
  }
@@ -6092,7 +6094,7 @@ function filter() {
6092
6094
  var colFilterIcon = (_col$features$filterI = (_col$features3 = col.features) === null || _col$features3 === void 0 ? void 0 : _col$features3.filterIcon) !== null && _col$features$filterI !== void 0 ? _col$features$filterI : filterIcon;
6093
6095
 
6094
6096
  var _Filter = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_17___default.a.createElement(_filter__WEBPACK_IMPORTED_MODULE_21__["Filter"], {
6095
- key: "filter",
6097
+ key: "".concat(col.code, "_filter"),
6096
6098
  FilterPanelContent: filterPanel,
6097
6099
  filterIcon: colFilterIcon,
6098
6100
  filterModel: inputFiltersMap.get(col.code),
@@ -10804,6 +10806,11 @@ function treeMode() {
10804
10806
  return pipeline.mapDataSource(processDataSource).mapColumns(processColumns);
10805
10807
 
10806
10808
  function processDataSource(input) {
10809
+ if (pipeline.isSameInputDataSource() && openKeys === pipeline.getFeatureOptions('lastOpenKeys')) {
10810
+ return pipeline.getFeatureOptions('lastTreeMode');
10811
+ }
10812
+
10813
+ pipeline.setFeatureOptions('lastOpenKeys', pipeline.getStateAtKey(stateKey));
10807
10814
  var result = [];
10808
10815
  dfs(input, 0);
10809
10816
 
@@ -10844,6 +10851,7 @@ function treeMode() {
10844
10851
  }
10845
10852
  }
10846
10853
 
10854
+ pipeline.setFeatureOptions('lastTreeMode', result);
10847
10855
  return result;
10848
10856
  }
10849
10857
 
@@ -11287,6 +11295,8 @@ var TablePipeline = /*#__PURE__*/function () {
11287
11295
 
11288
11296
  _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_10___default()(this, "_dataSource", void 0);
11289
11297
 
11298
+ _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_10___default()(this, "_isSameInputDataSource", void 0);
11299
+
11290
11300
  _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_10___default()(this, "_columns", void 0);
11291
11301
 
11292
11302
  _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_10___default()(this, "_footerDataSource", void 0);
@@ -11338,6 +11348,11 @@ var TablePipeline = /*#__PURE__*/function () {
11338
11348
  return this._snapshots[name].dataSource;
11339
11349
  }
11340
11350
  }
11351
+ }, {
11352
+ key: "isSameInputDataSource",
11353
+ value: function isSameInputDataSource() {
11354
+ return this._isSameInputDataSource;
11355
+ }
11341
11356
  }, {
11342
11357
  key: "getColumns",
11343
11358
  value: function getColumns(name) {
@@ -11388,9 +11403,12 @@ var TablePipeline = /*#__PURE__*/function () {
11388
11403
 
11389
11404
  if (this._dataSource != null || this._columns != null) {
11390
11405
  throw new Error('input 不能调用两次');
11391
- }
11406
+ } // 在 pipeline 中识别本次更新是否有数据变化
11407
+
11392
11408
 
11409
+ this._isSameInputDataSource = _input.dataSource === this.ref.current._lastInputDataSource;
11393
11410
  this._dataSource = _input.dataSource;
11411
+ this.ref.current._lastInputDataSource = _input.dataSource;
11394
11412
  this._columns = _input.columns.map(function (col) {
11395
11413
  return _objectSpread(_objectSpread({}, col), {}, {
11396
11414
  key: _this.guid()