@bit-sun/business-component 4.2.1-alpha.4-longya → 4.2.1-alpha.5-longya

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.
@@ -6,6 +6,10 @@ export default class ColumnSettingSulaTable extends React.Component {
6
6
  componentDidMount(): void;
7
7
  componentWillReceiveProps(nextProps: any): void;
8
8
  setInitialShowColumn: (columns: any[], callback?: () => void) => void;
9
+ /**
10
+ * 清除自定义列设置后,恢复全部原始列及其定义顺序。
11
+ */
12
+ reSetInitialShowColumn: () => void;
9
13
  setShowColumns: (newColumns: Array<any>) => void;
10
14
  getConfigFromlocalstorage: () => any;
11
15
  /**
package/dist/index.esm.js CHANGED
@@ -17087,6 +17087,21 @@ var ColumnSettingSulaTable = /*#__PURE__*/function (_React$Component) {
17087
17087
  showColumns: showColumns
17088
17088
  }, callback);
17089
17089
  };
17090
+ /**
17091
+ * 清除自定义列设置后,恢复全部原始列及其定义顺序。
17092
+ */
17093
+ _this.reSetInitialShowColumn = function () {
17094
+ var _this$props$columns = _this.props.columns,
17095
+ columns = _this$props$columns === void 0 ? [] : _this$props$columns;
17096
+ var showColumns = columns.map(function (item) {
17097
+ return _objectSpread2(_objectSpread2({}, item), {}, {
17098
+ hidden: false
17099
+ });
17100
+ });
17101
+ _this.setState({
17102
+ showColumns: showColumns
17103
+ });
17104
+ };
17090
17105
  _this.setShowColumns = function (newColumns) {
17091
17106
  _this.setState({
17092
17107
  showColumns: _toConsumableArray(newColumns)
@@ -17536,6 +17551,7 @@ var ColumnSettingSulaTable = /*#__PURE__*/function (_React$Component) {
17536
17551
  setShowColumns: this.setShowColumns,
17537
17552
  showColumns: this.state.showColumns,
17538
17553
  datasource: columns || [],
17554
+ reSetInitialShowColumn: this.reSetInitialShowColumn,
17539
17555
  tableCode: tableCode,
17540
17556
  appRequestConfig: appRequestConfig
17541
17557
  })), /*#__PURE__*/React$1.createElement(Table$1, _objectSpread2({
package/dist/index.js CHANGED
@@ -17110,6 +17110,21 @@ var ColumnSettingSulaTable = /*#__PURE__*/function (_React$Component) {
17110
17110
  showColumns: showColumns
17111
17111
  }, callback);
17112
17112
  };
17113
+ /**
17114
+ * 清除自定义列设置后,恢复全部原始列及其定义顺序。
17115
+ */
17116
+ _this.reSetInitialShowColumn = function () {
17117
+ var _this$props$columns = _this.props.columns,
17118
+ columns = _this$props$columns === void 0 ? [] : _this$props$columns;
17119
+ var showColumns = columns.map(function (item) {
17120
+ return _objectSpread2(_objectSpread2({}, item), {}, {
17121
+ hidden: false
17122
+ });
17123
+ });
17124
+ _this.setState({
17125
+ showColumns: showColumns
17126
+ });
17127
+ };
17113
17128
  _this.setShowColumns = function (newColumns) {
17114
17129
  _this.setState({
17115
17130
  showColumns: _toConsumableArray(newColumns)
@@ -17559,6 +17574,7 @@ var ColumnSettingSulaTable = /*#__PURE__*/function (_React$Component) {
17559
17574
  setShowColumns: this.setShowColumns,
17560
17575
  showColumns: this.state.showColumns,
17561
17576
  datasource: columns || [],
17577
+ reSetInitialShowColumn: this.reSetInitialShowColumn,
17562
17578
  tableCode: tableCode,
17563
17579
  appRequestConfig: appRequestConfig
17564
17580
  })), /*#__PURE__*/React__default['default'].createElement(bssula.Table, _objectSpread2({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bit-sun/business-component",
3
- "version": "4.2.1-alpha.4-longya",
3
+ "version": "4.2.1-alpha.5-longya",
4
4
  "scripts": {
5
5
  "start": "dumi dev",
6
6
  "docs:build": "dumi build",
@@ -57,6 +57,21 @@ export default class ColumnSettingSulaTable extends React.Component {
57
57
  }, callback);
58
58
  }
59
59
 
60
+ /**
61
+ * 清除自定义列设置后,恢复全部原始列及其定义顺序。
62
+ */
63
+ reSetInitialShowColumn = () => {
64
+ const { columns = [] }: any = this.props;
65
+ const showColumns = columns.map((item: any) => ({
66
+ ...item,
67
+ hidden: false,
68
+ }));
69
+
70
+ this.setState({
71
+ showColumns,
72
+ });
73
+ }
74
+
60
75
  setShowColumns = (newColumns: Array<any>) => {
61
76
  this.setState({
62
77
  showColumns: [...newColumns]
@@ -445,6 +460,7 @@ export default class ColumnSettingSulaTable extends React.Component {
445
460
  setShowColumns={this.setShowColumns}
446
461
  showColumns={this.state.showColumns}
447
462
  datasource={columns || []}
463
+ reSetInitialShowColumn={this.reSetInitialShowColumn}
448
464
  tableCode={tableCode}
449
465
  appRequestConfig={appRequestConfig}
450
466
  />