sea-chart 0.0.56-alpha.0 → 0.0.56-alpha.2

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,7 @@ import _DurationFormatter from "dtable-ui-component/lib/DurationFormatter";
6
6
  import _EmailFormatter from "dtable-ui-component/lib/EmailFormatter";
7
7
  import _UrlFormatter from "dtable-ui-component/lib/UrlFormatter";
8
8
  import _AutoNumberFormatter from "dtable-ui-component/lib/AutoNumberFormatter";
9
+ import _FormulaFormatter from "dtable-ui-component/lib/FormulaFormatter";
9
10
  import _GeolocationFormatter from "dtable-ui-component/lib/GeolocationFormatter";
10
11
  import _MTimeFormatter from "dtable-ui-component/lib/MTimeFormatter";
11
12
  import _LastModifierFormatter from "dtable-ui-component/lib/LastModifierFormatter";
@@ -19,6 +20,7 @@ import _MultipleSelectFormatter from "dtable-ui-component/lib/MultipleSelectForm
19
20
  import _FileFormatter from "dtable-ui-component/lib/FileFormatter";
20
21
  import _ImageFormatter from "dtable-ui-component/lib/ImageFormatter";
21
22
  import _SingleSelectFormatter from "dtable-ui-component/lib/SingleSelectFormatter";
23
+ import _LongTextFormatter from "dtable-ui-component/lib/LongTextFormatter";
22
24
  import _CheckboxFormatter from "dtable-ui-component/lib/CheckboxFormatter";
23
25
  import React from 'react';
24
26
  import { CellType } from 'dtable-utils';
@@ -27,7 +29,7 @@ const FormatterConfig = {
27
29
  [CellType.DEFAULT]: /*#__PURE__*/React.createElement(SimpleCellFormatter, null),
28
30
  [CellType.TEXT]: /*#__PURE__*/React.createElement(SimpleCellFormatter, null),
29
31
  [CellType.CHECKBOX]: /*#__PURE__*/React.createElement(_CheckboxFormatter, null),
30
- // [CellType.LONG_TEXT]: <LongTextFormatter />,
32
+ [CellType.LONG_TEXT]: /*#__PURE__*/React.createElement(_LongTextFormatter, null),
31
33
  [CellType.SINGLE_SELECT]: /*#__PURE__*/React.createElement(_SingleSelectFormatter, null),
32
34
  [CellType.IMAGE]: /*#__PURE__*/React.createElement(_ImageFormatter, null),
33
35
  [CellType.FILE]: /*#__PURE__*/React.createElement(_FileFormatter, null),
@@ -41,13 +43,13 @@ const FormatterConfig = {
41
43
  [CellType.LAST_MODIFIER]: /*#__PURE__*/React.createElement(_LastModifierFormatter, null),
42
44
  [CellType.MTIME]: /*#__PURE__*/React.createElement(_MTimeFormatter, null),
43
45
  [CellType.GEOLOCATION]: /*#__PURE__*/React.createElement(_GeolocationFormatter, null),
44
- // [CellType.FORMULA]: <FormulaFormatter />,
46
+ [CellType.FORMULA]: /*#__PURE__*/React.createElement(_FormulaFormatter, null),
45
47
  [CellType.AUTO_NUMBER]: /*#__PURE__*/React.createElement(_AutoNumberFormatter, null),
46
48
  [CellType.URL]: /*#__PURE__*/React.createElement(_UrlFormatter, null),
47
49
  [CellType.EMAIL]: /*#__PURE__*/React.createElement(_EmailFormatter, null),
48
50
  [CellType.DURATION]: /*#__PURE__*/React.createElement(_DurationFormatter, null),
49
51
  [CellType.BUTTON]: /*#__PURE__*/React.createElement(_ButtonFormatter, null),
50
- // [CellType.LINK_FORMULA]: <FormulaFormatter />,
52
+ [CellType.LINK_FORMULA]: /*#__PURE__*/React.createElement(_FormulaFormatter, null),
51
53
  [CellType.RATE]: /*#__PURE__*/React.createElement(_RateFormatter, null),
52
54
  [CellType.DIGITAL_SIGN]: /*#__PURE__*/React.createElement(_DigitalSignFormatter, null),
53
55
  [CellType.DEPARTMENT_SINGLE_SELECT]: /*#__PURE__*/React.createElement(_DepartmentSingleSelectFormatter, null)
@@ -243,24 +243,11 @@ class StatisticRecordDialog extends React.Component {
243
243
  };
244
244
  };
245
245
  this.renderRowsCards = () => {
246
- var _window, _window$app;
247
246
  const {
248
247
  searchedRowsIds
249
248
  } = this.state;
250
249
  const searchedRows = this.getRowsByIds(searchedRowsIds);
251
250
  if (searchedRows.length === 0) return null;
252
- if ((_window = window) === null || _window === void 0 ? void 0 : (_window$app = _window.app) === null || _window$app === void 0 ? void 0 : _window$app.renderRowsCards) {
253
- return window.app.renderRowsCards({
254
- table: this.table,
255
- renderedColumns: this.renderedColumns,
256
- unShowColumnKeyList: this.unShowColumnKeyList,
257
- isShowRowCardHeader: true,
258
- formulaRows: this.formulaRows,
259
- columns: this.renderedColumns,
260
- rows: searchedRows,
261
- rowCardType: 'statistic'
262
- });
263
- }
264
251
  const props = {
265
252
  table: this.table,
266
253
  renderedColumns: this.renderedColumns,
@@ -55,10 +55,12 @@ async function calculator(chart, value, _ref) {
55
55
  if (labelCountMap[label]) {
56
56
  labelCountMap[label].currentValue = currentValue + labelCountMap[label].currentValue;
57
57
  labelCountMap[label].targetValue = targetValue + labelCountMap[label].targetValue;
58
+ labelCountMap[label].rows = [row];
58
59
  } else {
59
60
  labelCountMap[label] = {
60
61
  currentValue,
61
- targetValue
62
+ targetValue,
63
+ rows: [row]
62
64
  };
63
65
  labels.push(label);
64
66
  }
@@ -68,7 +70,8 @@ async function calculator(chart, value, _ref) {
68
70
  if (labelCountMap[label]) {
69
71
  const {
70
72
  currentValue,
71
- targetValue
73
+ targetValue,
74
+ rows
72
75
  } = labelCountMap[label];
73
76
  if (currentValue < targetValue) {
74
77
  result.unshift({
@@ -76,13 +79,15 @@ async function calculator(chart, value, _ref) {
76
79
  value: currentValue,
77
80
  type: 'completed',
78
81
  current_value: currentValue,
79
- target_value: targetValue
82
+ target_value: targetValue,
83
+ rows
80
84
  }, {
81
85
  name: label,
82
86
  value: targetValue - currentValue,
83
87
  type: 'uncompleted',
84
88
  current_value: currentValue,
85
- target_value: targetValue
89
+ target_value: targetValue,
90
+ rows
86
91
  });
87
92
  } else {
88
93
  result.unshift({
@@ -90,7 +95,8 @@ async function calculator(chart, value, _ref) {
90
95
  value: currentValue,
91
96
  type: 'completed',
92
97
  current_value: currentValue,
93
- target_value: targetValue
98
+ target_value: targetValue,
99
+ rows
94
100
  });
95
101
  }
96
102
  }
@@ -137,10 +143,12 @@ async function calculator(chart, value, _ref) {
137
143
  if (labelCountMap[concatLabel]) {
138
144
  labelCountMap[concatLabel].currentValue = currentValue + labelCountMap[concatLabel].currentValue;
139
145
  labelCountMap[concatLabel].targetValue = targetValue + labelCountMap[concatLabel].targetValue;
146
+ labelCountMap[concatLabel].rows = [row];
140
147
  } else {
141
148
  labelCountMap[concatLabel] = {
142
149
  currentValue,
143
- targetValue
150
+ targetValue,
151
+ rows: [row]
144
152
  };
145
153
  labelGroups.push({
146
154
  key: concatLabel,
@@ -161,7 +169,8 @@ async function calculator(chart, value, _ref) {
161
169
  const color = colorMap[groupLabel];
162
170
  const {
163
171
  currentValue,
164
- targetValue
172
+ targetValue,
173
+ rows
165
174
  } = labelCountMap[key];
166
175
  if (currentValue < targetValue) {
167
176
  result.unshift({
@@ -171,7 +180,8 @@ async function calculator(chart, value, _ref) {
171
180
  color,
172
181
  type: 'completed',
173
182
  current_value: currentValue,
174
- target_value: targetValue
183
+ target_value: targetValue,
184
+ rows
175
185
  }, {
176
186
  name: label,
177
187
  group_label: groupLabel,
@@ -179,7 +189,8 @@ async function calculator(chart, value, _ref) {
179
189
  color,
180
190
  type: 'uncompleted',
181
191
  current_value: currentValue,
182
- target_value: targetValue
192
+ target_value: targetValue,
193
+ rows
183
194
  });
184
195
  } else {
185
196
  result.unshift({
@@ -189,7 +200,8 @@ async function calculator(chart, value, _ref) {
189
200
  color,
190
201
  type: 'completed',
191
202
  current_value: currentValue,
192
- target_value: targetValue
203
+ target_value: targetValue,
204
+ rows
193
205
  });
194
206
  }
195
207
  }
@@ -14,7 +14,7 @@ function summaryResult(result, summaryMethod, precision) {
14
14
  });
15
15
  return newResult;
16
16
  }
17
- function normalizeResult(result, groupColumn, summaryColumn, summaryType, summaryMethod) {
17
+ function normalizeResult(result, groupColumn, summaryColumn, summaryType, summaryMethod, rows) {
18
18
  const data = [];
19
19
  const colorSet = [];
20
20
  Object.keys(result).forEach((groupId, index) => {
@@ -32,7 +32,8 @@ function normalizeResult(result, groupColumn, summaryColumn, summaryType, summar
32
32
  value,
33
33
  formatted_value: formattedValue,
34
34
  group_name: groupItem.name,
35
- color: groupItem.color
35
+ color: groupItem.color,
36
+ rows
36
37
  });
37
38
  });
38
39
  });
@@ -139,6 +140,6 @@ async function calculator(chart, dtableValue, _ref) {
139
140
  result = summaryResult(result, summary_method, data.precision);
140
141
  }
141
142
  }
142
- return normalizeResult(result, groupColumn, numericColumn, summary_type, summary_method);
143
+ return normalizeResult(result, groupColumn, numericColumn, summary_type, summary_method, rows);
143
144
  }
144
145
  export default calculator;
@@ -108,7 +108,6 @@ class LineGroup extends ChartComponent {
108
108
  fillOpacity: 1
109
109
  });
110
110
  this.chart.on('point:click', e => {
111
- console.log('line-group', e);
112
111
  this.props.toggleRecords(e.data.data);
113
112
  });
114
113
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sea-chart",
3
- "version": "0.0.56-alpha.0",
3
+ "version": "0.0.56-alpha.2",
4
4
  "main": "./dist/index.js",
5
5
  "dependencies": {
6
6
  "@antv/data-set": "0.11.8",