sea-chart 2.0.56 → 2.0.58-alpha.1

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.
Files changed (2) hide show
  1. package/dist/view/index.js +25 -20
  2. package/package.json +21 -29
@@ -146,7 +146,10 @@ class View extends _react.default.PureComponent {
146
146
  isCalculateByView,
147
147
  autoRefresh,
148
148
  refreshInterval,
149
- pageId
149
+ pageId,
150
+ hasUnSaved,
151
+ chart,
152
+ tables
150
153
  } = this.props;
151
154
  this.unsubscribeReFreshChart = _eventBus.default.subscribe(_commonConstants.CommonEventTypes.REFRESH_CHARTS, this.refreshChart);
152
155
 
@@ -167,10 +170,7 @@ class View extends _react.default.PureComponent {
167
170
  this.calculateStatistic();
168
171
  }, refreshInterval * 60000);
169
172
  }
170
- const {
171
- hasUnSaved
172
- } = this.props;
173
- if (!hasUnSaved) {
173
+ if (!hasUnSaved || !_chartUtils.BaseUtils.isValidExistChart(tables, chart)) {
174
174
  this.calculateStatistic();
175
175
  }
176
176
  }
@@ -178,20 +178,20 @@ class View extends _react.default.PureComponent {
178
178
  this.unsubscribeReFreshChart();
179
179
  this.refreshTimer && clearInterval(this.refreshTimer);
180
180
  }
181
- componentDidUpdate(nextProps) {
182
- const {
183
- chart: oldChart,
184
- hasUnSaved,
185
- version
186
- } = this.props;
181
+ componentDidUpdate(prevProps) {
187
182
  const {
188
183
  chart,
189
- hasUnSaved: nextUnSaved,
190
- version: nextVersion,
184
+ hasUnSaved,
185
+ version,
191
186
  autoRefresh,
192
187
  refreshInterval,
193
188
  pageId
194
- } = nextProps;
189
+ } = this.props;
190
+ const {
191
+ chart: oldChart,
192
+ hasUnSaved: prevHasUnSaved,
193
+ version: prevVersion
194
+ } = prevProps;
195
195
  const {
196
196
  data
197
197
  } = this.state;
@@ -216,32 +216,32 @@ class View extends _react.default.PureComponent {
216
216
 
217
217
  // universal-apps will not trigger calculation of the chart before the chart config saved
218
218
  // after saving, hasUnSaved was set to false, then start calculation
219
- const needCalc = hasUnSaved === true && nextUnSaved === false;
219
+ const needCalc = prevHasUnSaved === true && hasUnSaved === false;
220
220
  if (needCalc && !data) {
221
221
  this.calculateStatistic();
222
222
  return;
223
223
  }
224
224
 
225
225
  // version was used to dectect table change in big screen plugin
226
- if ((0, _shallowequal.default)(chart, oldChart) && version === nextVersion) return;
226
+ if ((0, _shallowequal.default)(chart, oldChart) && version === prevVersion) return;
227
227
  this.setState({
228
228
  isCalculated: false
229
229
  }, () => {
230
- if (_chartUtils.BaseUtils.isChartTypeChange(chart, oldChart)) {
230
+ if (_chartUtils.BaseUtils.isChartTypeChange(oldChart, chart)) {
231
231
  this.calculateStatistic();
232
232
  return;
233
233
  }
234
- if (_chartUtils.BaseUtils.isChartViewChange(chart, oldChart)) {
234
+ if (_chartUtils.BaseUtils.isChartViewChange(oldChart, chart)) {
235
235
  this.calculateStatistic();
236
236
  return;
237
237
  }
238
- if (_chartUtils.BaseUtils.isChartStyleChange(chart, oldChart)) {
238
+ if (_chartUtils.BaseUtils.isChartStyleChange(oldChart, chart)) {
239
239
  this.setState({
240
240
  isCalculated: true
241
241
  });
242
242
  return;
243
243
  }
244
- if (_chartUtils.BaseUtils.isChartSortChange(chart, oldChart)) {
244
+ if (_chartUtils.BaseUtils.isChartSortChange(oldChart, chart)) {
245
245
  this.calculateStatistic(false);
246
246
  return;
247
247
  }
@@ -365,6 +365,11 @@ const propTypes = exports.propTypes = {
365
365
  departments: _propTypes.default.array,
366
366
  dtableStoreValue: _propTypes.default.object,
367
367
  isCalculateByView: _propTypes.default.bool,
368
+ hasUnSaved: _propTypes.default.bool,
369
+ pageId: _propTypes.default.string,
370
+ version: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number]),
371
+ autoRefresh: _propTypes.default.bool,
372
+ refreshInterval: _propTypes.default.number,
368
373
  // event
369
374
  integratedEventTypes: _propTypes.default.object,
370
375
  integratedEventBus: _propTypes.default.object,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sea-chart",
3
- "version": "2.0.56",
3
+ "version": "2.0.58-alpha.1",
4
4
  "main": "./dist/index.js",
5
5
  "dependencies": {
6
6
  "@dnd-kit/core": "^6.1.0",
@@ -9,7 +9,7 @@
9
9
  "@dnd-kit/utilities": "^3.2.2",
10
10
  "@seafile/seafile-calendar": "^1.0.8",
11
11
  "@seafile/seafile-editor": "^3.0.26",
12
- "axios": "~1.16.*",
12
+ "axios": "^1.19.0",
13
13
  "classnames": "^2.3.2",
14
14
  "d3": "~7.9.0",
15
15
  "dayjs": "1.10.7",
@@ -36,12 +36,11 @@
36
36
  "start.bak": "node scripts/start.js",
37
37
  "build": "node scripts/build.js",
38
38
  "pub:dist": "cross-env BABEL_ENV=production ./node_modules/.bin/babel src --out-dir dist --copy-files",
39
- "eslint": "eslint --ext .jsx,.js src --max-warnings=0",
39
+ "eslint": "cross-env BABEL_ENV=development NODE_ENV=development eslint --ext .jsx,.js src --max-warnings=0",
40
40
  "lint": "lint-staged",
41
41
  "pub:optimized": "rimraf dist/config.js",
42
42
  "prepare": "husky install",
43
43
  "prepublishOnly": "npm run clean && npm run pub:dist",
44
- "release": "release-it",
45
44
  "start": "cross-env NODE_ENV=development LOG_ENV=rc NODE_OPTIONS=--openssl-legacy-provider node dev-server.js",
46
45
  "translate": "node scripts/translate.js",
47
46
  "push-translate": "tx push -s",
@@ -75,7 +74,8 @@
75
74
  },
76
75
  "devDependencies": {
77
76
  "@babel/cli": "7.22.10",
78
- "@babel/core": "7.22.11",
77
+ "@babel/core": "7.29.7",
78
+ "@babel/eslint-parser": "7.25.9",
79
79
  "@babel/plugin-proposal-object-rest-spread": "^7.9.6",
80
80
  "@babel/plugin-proposal-private-property-in-object": "7.21.11",
81
81
  "@babel/plugin-transform-runtime": "^7.23.9",
@@ -84,9 +84,8 @@
84
84
  "@gatsbyjs/reach-router": "^1.3.9",
85
85
  "@svgr/webpack": "6.5.1",
86
86
  "@types/jest": "29.0.0",
87
- "@typescript-eslint/eslint-plugin": "^2.2.0",
88
- "@typescript-eslint/parser": "^2.2.0",
89
- "babel-eslint": "10.0.3",
87
+ "@typescript-eslint/eslint-plugin": "5.62.0",
88
+ "@typescript-eslint/parser": "5.62.0",
90
89
  "babel-jest": "26.6.3",
91
90
  "babel-loader": "8.0.6",
92
91
  "babel-plugin-import": "^1.13.8",
@@ -99,19 +98,19 @@
99
98
  "core-js": "^3.35.1",
100
99
  "cross-env": "^7.0.3",
101
100
  "css-loader": "^6.5.1",
102
- "css-minimizer-webpack-plugin": "5.0.1",
101
+ "css-minimizer-webpack-plugin": "8.0.0",
103
102
  "dotenv": "6.2.0",
104
103
  "dotenv-expand": "5.1.0",
105
104
  "dtable-store": "~6.0.11",
106
105
  "dtable-ui-component": "7.0.7",
107
106
  "ejs": "3.1.10",
108
- "eslint": "^6.8.0",
109
- "eslint-config-react-app": "^5.0.2",
110
- "eslint-loader": "4.0.2",
111
- "eslint-plugin-flowtype": "3.13.0",
112
- "eslint-plugin-import": "^2.18.2",
113
- "eslint-plugin-jsx-a11y": "6.2.3",
114
- "eslint-plugin-react": "~7.37.4",
107
+ "eslint": "8.57.1",
108
+ "eslint-config-react-app": "7.0.1",
109
+ "eslint-plugin-flowtype": "8.0.3",
110
+ "eslint-plugin-import": "2.32.0",
111
+ "eslint-plugin-jsx-a11y": "6.10.2",
112
+ "eslint-plugin-react": "7.37.5",
113
+ "eslint-webpack-plugin": "4.2.0",
115
114
  "file-loader": "6.2.0",
116
115
  "fs-extra": "^10.1.0",
117
116
  "html-webpack-plugin": "^5.6.0",
@@ -119,7 +118,7 @@
119
118
  "identity-obj-proxy": "3.0.0",
120
119
  "is-wsl": "^1.1.0",
121
120
  "jest": "26.6.3",
122
- "koa": "2.16.1",
121
+ "koa": "2.16.4",
123
122
  "koa-router": "7.3.0",
124
123
  "koa-send": "5.0.1",
125
124
  "koa2-cors": "2.0.6",
@@ -129,7 +128,7 @@
129
128
  "nodemon": "^3.1.0",
130
129
  "object-assign": "4.1.1",
131
130
  "pnp-webpack-plugin": "1.5.0",
132
- "postcss": "8.4.31",
131
+ "postcss": "8.5.26",
133
132
  "postcss-flexbugs-fixes": "^5.0.2",
134
133
  "postcss-loader": "^6.2.1",
135
134
  "postcss-normalize": "^10.0.1",
@@ -138,33 +137,26 @@
138
137
  "raf": "3.4.0",
139
138
  "react": "~18.3.1",
140
139
  "react-app-polyfill": "~3.0.0",
141
- "react-cookies": "0.1.1",
142
140
  "react-dev-utils": "^12.0.1",
143
141
  "react-dom": "~18.3.1",
144
142
  "react-i18next": "12.1.4",
145
143
  "regenerator-runtime": "^0.14.1",
146
- "release-it": "16.2.1",
147
144
  "resolve": "1.12.0",
148
145
  "resolve-url-loader": "5.0.0",
149
146
  "rimraf": "^5.0.7",
150
147
  "sass-loader": "13.3.2",
151
148
  "style-loader": "^1.0.1",
152
149
  "svgo-loader": "^3.0.0",
153
- "terser-webpack-plugin": "4.2.3",
150
+ "terser-webpack-plugin": "5.6.1",
154
151
  "ts-pnp": "1.1.4",
155
152
  "url-loader": "4.1.1",
156
- "webpack": "5.88.2",
157
- "webpack-dev-server": "5.2.0",
153
+ "webpack": "5.91.0",
154
+ "webpack-dev-server": "5.2.6",
158
155
  "webpack-manifest-plugin": "5.0.0",
159
156
  "webpack-merge": "5.8.0",
160
- "workbox-webpack-plugin": "7.0.0"
157
+ "workbox-webpack-plugin": "7.4.1"
161
158
  },
162
159
  "publishConfig": {
163
160
  "access": "public"
164
- },
165
- "release-it": {
166
- "npm": {
167
- "tag": "next"
168
- }
169
161
  }
170
162
  }