sea-chart 0.0.1 → 0.0.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.
- package/README.md +117 -1
- package/dist/api/index.js +101 -0
- package/{lib → dist}/components/collaborator/index.js +8 -6
- package/{lib → dist}/components/icon/index.css +1 -1
- package/{lib → dist}/components/icon/index.js +7 -5
- package/dist/components/index.js +8 -0
- package/{lib → dist}/components/loading/index.js +4 -2
- package/dist/components/number-input/index.js +31 -0
- package/{lib → dist}/components/pixel-editor/index.css +4 -4
- package/{lib → dist}/components/pixel-editor/index.js +11 -15
- package/{lib → dist}/components/select-group/index.css +10 -10
- package/dist/components/select-group/index.js +52 -0
- package/dist/components/types-dialog/index.css +97 -0
- package/dist/components/types-dialog/index.js +117 -0
- package/{lib → dist}/constants/geolocation.js +3 -3
- package/dist/constants/index.js +184 -0
- package/{lib → dist}/constants/model.js +25 -5
- package/dist/constants/style.js +15 -0
- package/dist/constants/type-image.js +59 -0
- package/dist/constants/type.js +124 -0
- package/dist/context.js +83 -0
- package/dist/editor/index.js +41 -0
- package/dist/index.js +9 -0
- package/dist/intl.js +37 -0
- package/dist/locale/index.js +18 -0
- package/{lib → dist}/locale/lang/de.js +1 -1
- package/{lib → dist}/locale/lang/en.js +1 -1
- package/{lib → dist}/locale/lang/es.js +1 -1
- package/{lib → dist}/locale/lang/fr.js +1 -1
- package/{lib → dist}/locale/lang/pt.js +1 -1
- package/{lib → dist}/locale/lang/ru.js +1 -1
- package/{lib → dist}/locale/lang/zh_CN.js +1 -1
- package/dist/model/area-group.js +41 -0
- package/dist/model/area.js +32 -0
- package/dist/model/bar-group.js +44 -0
- package/dist/model/bar-stack.js +41 -0
- package/dist/model/bar.js +38 -0
- package/dist/model/base-model.js +9 -0
- package/dist/model/basic-number-card.js +22 -0
- package/dist/model/chart.js +23 -0
- package/dist/model/combination.js +38 -0
- package/dist/model/compare-bar.js +39 -0
- package/dist/model/completeness-group.js +24 -0
- package/dist/model/completeness.js +18 -0
- package/dist/model/dashboard.js +16 -0
- package/dist/model/generic-model.js +224 -0
- package/dist/model/heat-map.js +23 -0
- package/dist/model/horizontal-bar.js +38 -0
- package/dist/model/horizontal-group-bar.js +43 -0
- package/dist/model/index.js +63 -0
- package/dist/model/line-group.js +44 -0
- package/dist/model/line.js +38 -0
- package/dist/model/map-bubble.js +27 -0
- package/dist/model/map.js +27 -0
- package/dist/model/mirror.js +26 -0
- package/dist/model/pie.js +26 -0
- package/dist/model/ring.js +26 -0
- package/dist/model/scatter.js +19 -0
- package/dist/model/stacked-horizontal-bar.js +32 -0
- package/dist/model/table.js +23 -0
- package/dist/model/tree-map.js +20 -0
- package/dist/model/trend.js +24 -0
- package/dist/model/user.js +15 -0
- package/dist/model/world-map-bubble.js +26 -0
- package/dist/model/world-map.js +26 -0
- package/{lib/components → dist}/settings/advance-bar-settings/data-settings.js +68 -45
- package/dist/settings/advance-bar-settings/style-settings.js +161 -0
- package/{lib/components → dist}/settings/bar-settings/data-settings.js +76 -51
- package/dist/settings/bar-settings/style-settings.js +179 -0
- package/dist/settings/basic-number-card/data-settings.js +126 -0
- package/dist/settings/basic-number-card/style-settings.js +42 -0
- package/dist/settings/combination-settings/data-settings.js +279 -0
- package/dist/settings/combination-settings/style-settings.js +174 -0
- package/dist/settings/dashboard-settings/data-settings.js +179 -0
- package/{lib/components → dist}/settings/data-settings.js +28 -22
- package/dist/settings/horizontal-bar-settings/data-settings.js +55 -0
- package/dist/settings/horizontal-bar-settings/style-settings.js +46 -0
- package/dist/settings/index.css +85 -0
- package/dist/settings/index.js +76 -0
- package/{lib/components → dist}/settings/pie-settings/data-settings.js +67 -44
- package/{lib/components → dist}/settings/pie-settings/style-settings.js +67 -49
- package/dist/settings/style-settings.js +118 -0
- package/{lib/components → dist}/settings/table-settings/data-settings.js +269 -208
- package/{lib/components → dist}/settings/time-comparison-settings/data-settings.js +82 -67
- package/dist/settings/time-comparison-settings/style-settings.js +213 -0
- package/dist/settings/widgets/basic-summary/index.css +12 -0
- package/dist/settings/widgets/basic-summary/index.js +176 -0
- package/{lib/components/settings/widgets/statistic-type → dist/settings/widgets/chart-type}/index.css +5 -5
- package/dist/settings/widgets/chart-type/index.js +59 -0
- package/{lib/components → dist}/settings/widgets/common-data-settings.js +24 -18
- package/dist/settings/widgets/data-filter/index.css +17 -0
- package/{lib/components → dist}/settings/widgets/data-filter/index.js +51 -37
- package/dist/settings/widgets/data-sort.js +44 -0
- package/dist/settings/widgets/date-summary-item.js +111 -0
- package/dist/settings/widgets/display-values-settings/index.css +13 -0
- package/{lib/components → dist}/settings/widgets/display-values-settings/index.js +19 -14
- package/{lib/components → dist}/settings/widgets/divider/index.css +1 -1
- package/dist/settings/widgets/divider/index.js +12 -0
- package/{lib/components → dist}/settings/widgets/font-settings/font-size-settings.js +14 -12
- package/{lib/components → dist}/settings/widgets/font-settings/font-weight-settings.js +14 -16
- package/dist/settings/widgets/group-by.js +160 -0
- package/{lib/components → dist}/settings/widgets/label-color.js +10 -10
- package/dist/settings/widgets/min-max-setting.js +52 -0
- package/dist/settings/widgets/mininum-slice-percent.js +63 -0
- package/dist/settings/widgets/numeric-summary-item.js +90 -0
- package/dist/settings/widgets/select-table/index.js +38 -0
- package/dist/settings/widgets/stack.js +50 -0
- package/dist/settings/widgets/summary-method-setting.js +66 -0
- package/dist/settings/widgets/summary-settings.js +411 -0
- package/dist/settings/widgets/switch/index.css +37 -0
- package/{lib/components → dist}/settings/widgets/switch/index.js +11 -8
- package/{lib/components → dist}/settings/widgets/text-horizontal-settings.js +12 -10
- package/dist/settings/widgets/time-picker.js +174 -0
- package/{lib/components → dist}/settings/widgets/title-settings/index.js +15 -13
- package/dist/settings/widgets/title-settings/title-text.js +25 -0
- package/dist/settings/widgets/x-axios.js +0 -0
- package/dist/settings/widgets/y-axis-group-settings.js +438 -0
- package/dist/utils/cell-format-utils.js +42 -0
- package/dist/utils/chart-data-sql.js +606 -0
- package/dist/utils/chart-utils.js +1803 -0
- package/dist/utils/chart.js +6 -0
- package/dist/utils/collaborator-manager.js +24 -0
- package/dist/utils/collaborator-utils.js +40 -0
- package/dist/utils/column-2-sql-column.js +551 -0
- package/dist/utils/column-utils.js +208 -0
- package/{lib → dist}/utils/custom-g2.js +11 -11
- package/{lib → dist}/utils/date-translate.js +11 -11
- package/dist/utils/index.js +48 -0
- package/dist/utils/key-generator.js +13 -0
- package/dist/utils/object-utils.js +45 -0
- package/{lib → dist}/utils/options-utils.js +17 -18
- package/dist/view/index.css +53 -0
- package/dist/view/index.js +169 -0
- package/{lib/layout → dist/view}/title/index.css +1 -1
- package/dist/view/title/index.js +46 -0
- package/dist/view/wrapper/area.js +150 -0
- package/dist/view/wrapper/bar-group.js +148 -0
- package/dist/view/wrapper/bar.js +138 -0
- package/dist/view/wrapper/basic-number-card.js +127 -0
- package/dist/view/wrapper/chart-component.js +261 -0
- package/dist/view/wrapper/combination.js +399 -0
- package/dist/view/wrapper/dashboard.js +164 -0
- package/dist/view/wrapper/horizontal-bar-group.js +149 -0
- package/dist/view/wrapper/horizontal-bar.js +140 -0
- package/dist/view/wrapper/horizontal-component.js +78 -0
- package/{lib/components/formatter → dist/view/wrapper}/index.js +90 -71
- package/dist/view/wrapper/line-group.js +145 -0
- package/dist/view/wrapper/line.js +157 -0
- package/dist/view/wrapper/pie.js +185 -0
- package/dist/view/wrapper/ring.js +264 -0
- package/{lib/components/formatter → dist/view/wrapper}/table/index.css +18 -18
- package/dist/view/wrapper/table/index.js +31 -0
- package/dist/view/wrapper/table/one-dimension-table-no-numeric-columns.js +144 -0
- package/dist/view/wrapper/table/one-dimension-table-with-numeric-columns.js +198 -0
- package/dist/view/wrapper/table/pivot-table-display-name.js +248 -0
- package/dist/view/wrapper/table/two-dimension-table.js +249 -0
- package/dist/view/wrapper/treemap.js +186 -0
- package/package.json +91 -100
- package/lib/components/formatter/area.js +0 -162
- package/lib/components/formatter/bar-group.js +0 -160
- package/lib/components/formatter/bar.js +0 -150
- package/lib/components/formatter/basic-number-card.js +0 -138
- package/lib/components/formatter/chart-component.js +0 -266
- package/lib/components/formatter/combination.js +0 -407
- package/lib/components/formatter/dashboard.js +0 -182
- package/lib/components/formatter/horizontal-bar-group.js +0 -161
- package/lib/components/formatter/horizontal-bar.js +0 -152
- package/lib/components/formatter/horizontal-component.js +0 -91
- package/lib/components/formatter/line-group.js +0 -157
- package/lib/components/formatter/line.js +0 -170
- package/lib/components/formatter/pie.js +0 -201
- package/lib/components/formatter/ring.js +0 -277
- package/lib/components/formatter/table/index.js +0 -42
- package/lib/components/formatter/table/one-dimension-table-no-numeric-columns.js +0 -145
- package/lib/components/formatter/table/one-dimension-table-with-numeric-columns.js +0 -193
- package/lib/components/formatter/table/pivot-table-display-name.js +0 -249
- package/lib/components/formatter/table/two-dimension-table.js +0 -241
- package/lib/components/formatter/treemap.js +0 -213
- package/lib/components/index.js +0 -5
- package/lib/components/number-input/index.js +0 -31
- package/lib/components/select-group/index.js +0 -63
- package/lib/components/settings/advance-bar-settings/style-settings.js +0 -149
- package/lib/components/settings/bar-settings/style-settings.js +0 -163
- package/lib/components/settings/basic-number-card/data-settings.js +0 -121
- package/lib/components/settings/basic-number-card/style-settings.js +0 -42
- package/lib/components/settings/combination-settings/data-settings.js +0 -256
- package/lib/components/settings/combination-settings/style-settings.js +0 -183
- package/lib/components/settings/dashboard-settings/data-settings.js +0 -167
- package/lib/components/settings/horizontal-bar-settings/data-settings.js +0 -45
- package/lib/components/settings/horizontal-bar-settings/style-settings.js +0 -38
- package/lib/components/settings/index.css +0 -73
- package/lib/components/settings/index.js +0 -74
- package/lib/components/settings/style-settings.js +0 -100
- package/lib/components/settings/time-comparison-settings/style-settings.js +0 -191
- package/lib/components/settings/widgets/basic-summary/index.css +0 -12
- package/lib/components/settings/widgets/basic-summary/index.js +0 -173
- package/lib/components/settings/widgets/data-filter/index.css +0 -17
- package/lib/components/settings/widgets/data-sort.js +0 -38
- package/lib/components/settings/widgets/date-summary-item.js +0 -126
- package/lib/components/settings/widgets/display-values-settings/index.css +0 -13
- package/lib/components/settings/widgets/divider/index.js +0 -10
- package/lib/components/settings/widgets/group-by.js +0 -168
- package/lib/components/settings/widgets/min-max-setting.js +0 -64
- package/lib/components/settings/widgets/mininum-slice-percent.js +0 -72
- package/lib/components/settings/widgets/numeric-summary-item.js +0 -109
- package/lib/components/settings/widgets/select-table/index.js +0 -49
- package/lib/components/settings/widgets/stack.js +0 -58
- package/lib/components/settings/widgets/statistic-type/index.js +0 -54
- package/lib/components/settings/widgets/summary-method-setting.js +0 -80
- package/lib/components/settings/widgets/summary-settings.js +0 -394
- package/lib/components/settings/widgets/switch/index.css +0 -37
- package/lib/components/settings/widgets/time-picker.js +0 -182
- package/lib/components/settings/widgets/title-settings/title-text.js +0 -31
- package/lib/components/settings/widgets/y-axis-group-settings.js +0 -399
- package/lib/components/types-dialog/index.css +0 -97
- package/lib/components/types-dialog/index.js +0 -127
- package/lib/constants/index.js +0 -164
- package/lib/constants/style.js +0 -13
- package/lib/constants/type-image.js +0 -32
- package/lib/constants/type.js +0 -97
- package/lib/context.js +0 -49
- package/lib/index.js +0 -6
- package/lib/intl.js +0 -37
- package/lib/layout/index.js +0 -4
- package/lib/layout/statistic/index.css +0 -53
- package/lib/layout/statistic/index.js +0 -190
- package/lib/layout/title/index.js +0 -41
- package/lib/locale/index.js +0 -11
- package/lib/model/area-group.js +0 -51
- package/lib/model/area.js +0 -42
- package/lib/model/bar-group.js +0 -54
- package/lib/model/bar-stack.js +0 -51
- package/lib/model/bar.js +0 -48
- package/lib/model/base-model.js +0 -11
- package/lib/model/basic-number-card.js +0 -32
- package/lib/model/combination.js +0 -48
- package/lib/model/compare-bar.js +0 -49
- package/lib/model/completeness-group.js +0 -34
- package/lib/model/completeness.js +0 -28
- package/lib/model/dashboard.js +0 -26
- package/lib/model/generic-model.js +0 -235
- package/lib/model/heat-map.js +0 -33
- package/lib/model/horizontal-bar.js +0 -48
- package/lib/model/horizontal-group-bar.js +0 -53
- package/lib/model/index.js +0 -36
- package/lib/model/line-group.js +0 -54
- package/lib/model/line.js +0 -48
- package/lib/model/map-bubble.js +0 -37
- package/lib/model/map.js +0 -37
- package/lib/model/mirror.js +0 -36
- package/lib/model/pie.js +0 -36
- package/lib/model/ring.js +0 -36
- package/lib/model/scatter.js +0 -29
- package/lib/model/stacked-horizontal-bar.js +0 -42
- package/lib/model/statistic.js +0 -22
- package/lib/model/table.js +0 -33
- package/lib/model/tree-map.js +0 -30
- package/lib/model/trend.js +0 -34
- package/lib/model/user.js +0 -22
- package/lib/model/world-map-bubble.js +0 -36
- package/lib/model/world-map.js +0 -36
- package/lib/utils/cell-format-utils.js +0 -41
- package/lib/utils/chart.js +0 -6
- package/lib/utils/collaborator-utils.js +0 -40
- package/lib/utils/column-utils.js +0 -247
- package/lib/utils/data-filter/filter-item-utils.js +0 -80
- package/lib/utils/data-filter/filters-utils.js +0 -406
- package/lib/utils/data-filter/index.js +0 -3
- package/lib/utils/index.js +0 -50
- package/lib/utils/key-generator.js +0 -13
- package/lib/utils/object-utils.js +0 -61
- package/lib/utils/statistic-column-2-sql-column-utils.js +0 -499
- package/lib/utils/statistic-utils.js +0 -1685
- /package/{lib → dist}/assets/icons/area-chart.svg +0 -0
- /package/{lib → dist}/assets/icons/bar-chart.svg +0 -0
- /package/{lib → dist}/assets/icons/card.svg +0 -0
- /package/{lib → dist}/assets/icons/combination-chart.svg +0 -0
- /package/{lib → dist}/assets/icons/dtable-logo.svg +0 -0
- /package/{lib → dist}/assets/icons/facet-chart.svg +0 -0
- /package/{lib → dist}/assets/icons/gauge.svg +0 -0
- /package/{lib → dist}/assets/icons/heat-map.svg +0 -0
- /package/{lib → dist}/assets/icons/histogram.svg +0 -0
- /package/{lib → dist}/assets/icons/line-chart.svg +0 -0
- /package/{lib → dist}/assets/icons/map.svg +0 -0
- /package/{lib → dist}/assets/icons/pie-chart.svg +0 -0
- /package/{lib → dist}/assets/icons/rectangular-tree-diagram.svg +0 -0
- /package/{lib → dist}/assets/icons/scatter-chart.svg +0 -0
- /package/{lib → dist}/assets/icons/type-change.svg +0 -0
- /package/{lib → dist}/assets/img/area-chart.png +0 -0
- /package/{lib → dist}/assets/img/area-group-chart.png +0 -0
- /package/{lib → dist}/assets/img/bar-group.png +0 -0
- /package/{lib → dist}/assets/img/bar-stack.png +0 -0
- /package/{lib → dist}/assets/img/bar.png +0 -0
- /package/{lib → dist}/assets/img/combination-chart.png +0 -0
- /package/{lib → dist}/assets/img/compared-chart.png +0 -0
- /package/{lib → dist}/assets/img/completeness-chart.png +0 -0
- /package/{lib → dist}/assets/img/custom-bar.png +0 -0
- /package/{lib → dist}/assets/img/dashboard-chart.png +0 -0
- /package/{lib → dist}/assets/img/group-completeness-chart.png +0 -0
- /package/{lib → dist}/assets/img/group_line.png +0 -0
- /package/{lib → dist}/assets/img/heat-map.png +0 -0
- /package/{lib → dist}/assets/img/horizontal-bar.png +0 -0
- /package/{lib → dist}/assets/img/horizontal-group-bar.png +0 -0
- /package/{lib → dist}/assets/img/line.png +0 -0
- /package/{lib → dist}/assets/img/map-bubble.png +0 -0
- /package/{lib → dist}/assets/img/map.png +0 -0
- /package/{lib → dist}/assets/img/mirror.png +0 -0
- /package/{lib → dist}/assets/img/number-card.png +0 -0
- /package/{lib → dist}/assets/img/pie.png +0 -0
- /package/{lib → dist}/assets/img/pivot-table.png +0 -0
- /package/{lib → dist}/assets/img/ring.png +0 -0
- /package/{lib → dist}/assets/img/scatter.png +0 -0
- /package/{lib → dist}/assets/img/stacked-horizontal-bar.png +0 -0
- /package/{lib → dist}/assets/img/treemap.png +0 -0
- /package/{lib → dist}/assets/img/trend-chart.png +0 -0
- /package/{lib → dist}/assets/img/world-map-bubble.png +0 -0
- /package/{lib → dist}/assets/img/world-map.png +0 -0
- /package/{lib → dist}/components/loading/index.css +0 -0
- /package/{lib/components/settings/widgets/select-table → dist/editor}/index.css +0 -0
- /package/{lib/components → dist}/settings/advance-bar-settings/index.js +0 -0
- /package/{lib/components → dist}/settings/bar-settings/index.js +0 -0
- /package/{lib/components → dist}/settings/basic-number-card/index.js +0 -0
- /package/{lib/components → dist}/settings/combination-settings/index.js +0 -0
- /package/{lib/components → dist}/settings/dashboard-settings/index.js +0 -0
- /package/{lib/components → dist}/settings/horizontal-bar-settings/index.js +0 -0
- /package/{lib/components → dist}/settings/pie-settings/index.js +0 -0
- /package/{lib/components → dist}/settings/table-settings/index.js +0 -0
- /package/{lib/components → dist}/settings/time-comparison-settings/index.js +0 -0
- /package/{lib/components → dist}/settings/widgets/font-settings/index.js +0 -0
- /package/{lib/components/settings/widgets/x-axios.js → dist/settings/widgets/select-table/index.css} +0 -0
|
@@ -1,168 +0,0 @@
|
|
|
1
|
-
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
2
|
-
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
3
|
-
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
4
|
-
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
5
|
-
import _createSuper from "@babel/runtime/helpers/esm/createSuper";
|
|
6
|
-
import React, { Component } from 'react';
|
|
7
|
-
import classnames from 'classnames';
|
|
8
|
-
import { Label, FormGroup } from 'reactstrap';
|
|
9
|
-
import DTableSelect from "dtable-ui-component/lib/DTableSelect";
|
|
10
|
-
import { CellType, COLUMNS_ICON_CONFIG, DATE_COLUMN_OPTIONS, getTableById, getTableColumnByKey } from 'dtable-utils';
|
|
11
|
-
import { STATISTIC_SUPPORT_COLUMNS, DATE_GRANULATES, GEOLOCATION_GRANULATES, STATISTIC_SUMMARY_SHOW, GEOLOCATION_FORMAT_MAP } from '../../../constants';
|
|
12
|
-
import intl from '../../../intl';
|
|
13
|
-
var GroupBy = /*#__PURE__*/function (_Component) {
|
|
14
|
-
_inherits(GroupBy, _Component);
|
|
15
|
-
var _super = _createSuper(GroupBy);
|
|
16
|
-
function GroupBy(_props) {
|
|
17
|
-
var _this;
|
|
18
|
-
_classCallCheck(this, GroupBy);
|
|
19
|
-
_this = _super.call(this, _props);
|
|
20
|
-
_this.generatorGranulatesOptions = function (granulates) {
|
|
21
|
-
return granulates.map(function (item) {
|
|
22
|
-
return {
|
|
23
|
-
value: item,
|
|
24
|
-
label: /*#__PURE__*/React.createElement("span", {
|
|
25
|
-
className: "select-module select-module-name ml-0"
|
|
26
|
-
}, intl.get(STATISTIC_SUMMARY_SHOW[item]))
|
|
27
|
-
};
|
|
28
|
-
});
|
|
29
|
-
};
|
|
30
|
-
_this.initOptions = function (props) {
|
|
31
|
-
var tables = props.tables,
|
|
32
|
-
selectedTableId = props.selectedTableId;
|
|
33
|
-
_this.selectedTable = getTableById(tables, selectedTableId);
|
|
34
|
-
var columns = _this.selectedTable && Array.isArray(_this.selectedTable.columns) ? _this.selectedTable.columns : [];
|
|
35
|
-
_this.validColumns = _this.getAvailableColumns(columns);
|
|
36
|
-
_this.columnOptions = _this.getColumnOptions(_this.validColumns);
|
|
37
|
-
};
|
|
38
|
-
_this.initGeolocationOptions = function (props) {
|
|
39
|
-
var selectedColumnKey = props.selectedColumnKey;
|
|
40
|
-
if (!selectedColumnKey) {
|
|
41
|
-
_this.geolocationGranulatesOptions = [];
|
|
42
|
-
return;
|
|
43
|
-
}
|
|
44
|
-
var groupbyColumn = getTableColumnByKey(_this.selectedTable, selectedColumnKey);
|
|
45
|
-
if (!groupbyColumn) {
|
|
46
|
-
_this.geolocationGranulatesOptions = [];
|
|
47
|
-
return;
|
|
48
|
-
}
|
|
49
|
-
var _ref = groupbyColumn.data || {},
|
|
50
|
-
geo_format = _ref.geo_format;
|
|
51
|
-
if (geo_format === GEOLOCATION_FORMAT_MAP.PROVINCE) {
|
|
52
|
-
_this.geolocationGranulatesOptions = _this.generatorGranulatesOptions(GEOLOCATION_GRANULATES.filter(function (item) {
|
|
53
|
-
return item === GEOLOCATION_FORMAT_MAP.PROVINCE;
|
|
54
|
-
}));
|
|
55
|
-
return;
|
|
56
|
-
}
|
|
57
|
-
if (geo_format === GEOLOCATION_FORMAT_MAP.PROVINCE_CITY) {
|
|
58
|
-
_this.geolocationGranulatesOptions = _this.generatorGranulatesOptions(GEOLOCATION_GRANULATES.filter(function (item) {
|
|
59
|
-
return item === 'district';
|
|
60
|
-
}));
|
|
61
|
-
return;
|
|
62
|
-
}
|
|
63
|
-
if (geo_format === GEOLOCATION_FORMAT_MAP.COUNTRY_REGION || geo_format === GEOLOCATION_FORMAT_MAP.LNG_LAT) {
|
|
64
|
-
_this.geolocationGranulatesOptions = [];
|
|
65
|
-
return;
|
|
66
|
-
}
|
|
67
|
-
_this.geolocationGranulatesOptions = _this.generatorGranulatesOptions(GEOLOCATION_GRANULATES);
|
|
68
|
-
};
|
|
69
|
-
_this.getAvailableColumns = function (columns) {
|
|
70
|
-
if (!columns || !Array.isArray(columns)) return [];
|
|
71
|
-
return columns.filter(function (column) {
|
|
72
|
-
return STATISTIC_SUPPORT_COLUMNS.includes(column.type);
|
|
73
|
-
});
|
|
74
|
-
};
|
|
75
|
-
_this.getColumnOptions = function (columns) {
|
|
76
|
-
return columns.map(function (column) {
|
|
77
|
-
return {
|
|
78
|
-
value: column,
|
|
79
|
-
label: /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("span", {
|
|
80
|
-
className: "header-icon"
|
|
81
|
-
}, /*#__PURE__*/React.createElement("i", {
|
|
82
|
-
className: COLUMNS_ICON_CONFIG[column.type]
|
|
83
|
-
})), /*#__PURE__*/React.createElement("span", {
|
|
84
|
-
className: 'select-module select-module-name ml-0'
|
|
85
|
-
}, column.name))
|
|
86
|
-
};
|
|
87
|
-
});
|
|
88
|
-
};
|
|
89
|
-
_this.renderSelector = function () {
|
|
90
|
-
var selectedColumnKey = _this.props.selectedColumnKey;
|
|
91
|
-
var selectedOption = selectedColumnKey ? _this.columnOptions.find(function (option) {
|
|
92
|
-
return option.value.key === selectedColumnKey;
|
|
93
|
-
}) : null;
|
|
94
|
-
return /*#__PURE__*/React.createElement(DTableSelect, {
|
|
95
|
-
value: selectedOption,
|
|
96
|
-
classNamePrefix: "select-column",
|
|
97
|
-
options: _this.columnOptions,
|
|
98
|
-
onChange: _this.props.onGroupByChange,
|
|
99
|
-
noOptionsMessage: function noOptionsMessage() {
|
|
100
|
-
return /*#__PURE__*/React.createElement("span", null, intl.get('No_column'));
|
|
101
|
-
}
|
|
102
|
-
});
|
|
103
|
-
};
|
|
104
|
-
_this.renderGroupbyDateGranulates = function () {
|
|
105
|
-
var selectedDateGranularity = _this.props.selectedDateGranularity;
|
|
106
|
-
var selectedOption = _this.dateGranulatesOptions.find(function (option) {
|
|
107
|
-
return option.value === selectedDateGranularity;
|
|
108
|
-
});
|
|
109
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
110
|
-
className: "seastatistic-parameter-item mt-4"
|
|
111
|
-
}, /*#__PURE__*/React.createElement(DTableSelect, {
|
|
112
|
-
value: selectedOption,
|
|
113
|
-
options: _this.dateGranulatesOptions,
|
|
114
|
-
onChange: _this.props.onGroupbyDateGranularityChange
|
|
115
|
-
}));
|
|
116
|
-
};
|
|
117
|
-
_this.renderGroupbyGeolocationGranulates = function () {
|
|
118
|
-
var selectedGeolocationGranularity = _this.props.selectedGeolocationGranularity;
|
|
119
|
-
var selectedOption = _this.geolocationGranulatesOptions.find(function (option) {
|
|
120
|
-
return option.value === selectedGeolocationGranularity;
|
|
121
|
-
});
|
|
122
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
123
|
-
className: "seastatistic-parameter-item mt-4"
|
|
124
|
-
}, /*#__PURE__*/React.createElement(DTableSelect, {
|
|
125
|
-
value: selectedOption,
|
|
126
|
-
options: _this.geolocationGranulatesOptions,
|
|
127
|
-
onChange: _this.props.onGroupbyGeolocationGranularityChange
|
|
128
|
-
}));
|
|
129
|
-
};
|
|
130
|
-
_this.renderGroupBy = function () {
|
|
131
|
-
var selectedColumnKey = _this.props.selectedColumnKey;
|
|
132
|
-
if (!selectedColumnKey) return null;
|
|
133
|
-
var groupbyColumn = getTableColumnByKey(_this.selectedTable, selectedColumnKey);
|
|
134
|
-
if (!groupbyColumn) return null;
|
|
135
|
-
var groupbyColumnType = groupbyColumn.type;
|
|
136
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, DATE_COLUMN_OPTIONS.includes(groupbyColumnType) && _this.renderGroupbyDateGranulates(), groupbyColumnType === CellType.GEOLOCATION && _this.geolocationGranulatesOptions.length > 0 && _this.renderGroupbyGeolocationGranulates());
|
|
137
|
-
};
|
|
138
|
-
_this.dateGranulatesOptions = _this.generatorGranulatesOptions(DATE_GRANULATES);
|
|
139
|
-
_this.initOptions(_props);
|
|
140
|
-
_this.initGeolocationOptions(_props);
|
|
141
|
-
return _this;
|
|
142
|
-
}
|
|
143
|
-
_createClass(GroupBy, [{
|
|
144
|
-
key: "UNSAFE_componentWillReceiveProps",
|
|
145
|
-
value: function UNSAFE_componentWillReceiveProps(nextProps) {
|
|
146
|
-
var selectedTableId = nextProps.selectedTableId,
|
|
147
|
-
selectedColumnKey = nextProps.selectedColumnKey;
|
|
148
|
-
if (selectedTableId !== this.props.selectedTableId) {
|
|
149
|
-
this.initOptions(nextProps);
|
|
150
|
-
}
|
|
151
|
-
if (selectedColumnKey !== this.props.selectedColumnKey) {
|
|
152
|
-
this.initGeolocationOptions(nextProps);
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
}, {
|
|
156
|
-
key: "render",
|
|
157
|
-
value: function render() {
|
|
158
|
-
var _this$props = this.props,
|
|
159
|
-
label = _this$props.label,
|
|
160
|
-
className = _this$props.className;
|
|
161
|
-
return /*#__PURE__*/React.createElement(FormGroup, {
|
|
162
|
-
className: classnames('seastatistic-setting-item table-setting', _defineProperty({}, className, className))
|
|
163
|
-
}, /*#__PURE__*/React.createElement(Label, null, label), this.renderSelector(), this.renderGroupBy());
|
|
164
|
-
}
|
|
165
|
-
}]);
|
|
166
|
-
return GroupBy;
|
|
167
|
-
}(Component);
|
|
168
|
-
export default GroupBy;
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
2
|
-
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
3
|
-
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
4
|
-
import _createSuper from "@babel/runtime/helpers/esm/createSuper";
|
|
5
|
-
import React, { Component } from 'react';
|
|
6
|
-
import { FormGroup, Label, Input } from 'reactstrap';
|
|
7
|
-
import intl from '../../../intl';
|
|
8
|
-
var MinMaxSetting = /*#__PURE__*/function (_Component) {
|
|
9
|
-
_inherits(MinMaxSetting, _Component);
|
|
10
|
-
var _super = _createSuper(MinMaxSetting);
|
|
11
|
-
function MinMaxSetting(props) {
|
|
12
|
-
var _this;
|
|
13
|
-
_classCallCheck(this, MinMaxSetting);
|
|
14
|
-
_this = _super.call(this, props);
|
|
15
|
-
_this.onMinChange = function (e) {
|
|
16
|
-
var min = e.target.value;
|
|
17
|
-
_this.setState({
|
|
18
|
-
min: min
|
|
19
|
-
}, function () {
|
|
20
|
-
_this.props.onMinChange(min);
|
|
21
|
-
});
|
|
22
|
-
};
|
|
23
|
-
_this.onMaxChange = function (e) {
|
|
24
|
-
var max = e.target.value;
|
|
25
|
-
_this.setState({
|
|
26
|
-
max: max
|
|
27
|
-
}, function () {
|
|
28
|
-
_this.props.onMaxChange(max);
|
|
29
|
-
});
|
|
30
|
-
};
|
|
31
|
-
_this.state = {
|
|
32
|
-
min: props.min,
|
|
33
|
-
max: props.max
|
|
34
|
-
};
|
|
35
|
-
return _this;
|
|
36
|
-
}
|
|
37
|
-
_createClass(MinMaxSetting, [{
|
|
38
|
-
key: "render",
|
|
39
|
-
value: function render() {
|
|
40
|
-
var _this$state = this.state,
|
|
41
|
-
min = _this$state.min,
|
|
42
|
-
max = _this$state.max;
|
|
43
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(FormGroup, {
|
|
44
|
-
className: "mb-2"
|
|
45
|
-
}, /*#__PURE__*/React.createElement(Label, {
|
|
46
|
-
for: "min"
|
|
47
|
-
}, intl.get('Min')), /*#__PURE__*/React.createElement(Input, {
|
|
48
|
-
id: "min",
|
|
49
|
-
type: "number",
|
|
50
|
-
value: min,
|
|
51
|
-
onChange: this.onMinChange
|
|
52
|
-
})), /*#__PURE__*/React.createElement(FormGroup, null, /*#__PURE__*/React.createElement(Label, {
|
|
53
|
-
for: "max"
|
|
54
|
-
}, intl.get('Max')), /*#__PURE__*/React.createElement(Input, {
|
|
55
|
-
id: "max",
|
|
56
|
-
type: "number",
|
|
57
|
-
value: max,
|
|
58
|
-
onChange: this.onMaxChange
|
|
59
|
-
})));
|
|
60
|
-
}
|
|
61
|
-
}]);
|
|
62
|
-
return MinMaxSetting;
|
|
63
|
-
}(Component);
|
|
64
|
-
export default MinMaxSetting;
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
2
|
-
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
3
|
-
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
4
|
-
import _createSuper from "@babel/runtime/helpers/esm/createSuper";
|
|
5
|
-
import React, { Component } from 'react';
|
|
6
|
-
import { FormGroup, Label } from 'reactstrap';
|
|
7
|
-
import NumberInput from '../../../components/number-input';
|
|
8
|
-
import intl from '../../../intl';
|
|
9
|
-
var MiniNumSlicePercent = /*#__PURE__*/function (_Component) {
|
|
10
|
-
_inherits(MiniNumSlicePercent, _Component);
|
|
11
|
-
var _super = _createSuper(MiniNumSlicePercent);
|
|
12
|
-
function MiniNumSlicePercent(props) {
|
|
13
|
-
var _this;
|
|
14
|
-
_classCallCheck(this, MiniNumSlicePercent);
|
|
15
|
-
_this = _super.call(this, props);
|
|
16
|
-
_this.replaceNumberNotAllowInput = function (value) {
|
|
17
|
-
if (!value) {
|
|
18
|
-
return '';
|
|
19
|
-
}
|
|
20
|
-
value = value.replace(/。/g, '.');
|
|
21
|
-
value = value.replace(/-/g, '');
|
|
22
|
-
return value.replace(/[^.-\d,]/g, '');
|
|
23
|
-
};
|
|
24
|
-
_this.onKeyDown = function (event) {
|
|
25
|
-
if (event.keyCode === 13) {
|
|
26
|
-
event.preventDefault();
|
|
27
|
-
event.target.blur();
|
|
28
|
-
}
|
|
29
|
-
};
|
|
30
|
-
_this.onPercentChange = function (event) {
|
|
31
|
-
var value = _this.replaceNumberNotAllowInput(event.target.value);
|
|
32
|
-
if (value === _this.state.value) return;
|
|
33
|
-
_this.setState({
|
|
34
|
-
value: value
|
|
35
|
-
}, function () {
|
|
36
|
-
_this.onCommit();
|
|
37
|
-
});
|
|
38
|
-
};
|
|
39
|
-
_this.onBlur = function () {
|
|
40
|
-
_this.onCommit();
|
|
41
|
-
};
|
|
42
|
-
_this.onCommit = function () {
|
|
43
|
-
var value = _this.state.value;
|
|
44
|
-
if (value === _this.props.value) return;
|
|
45
|
-
var validValue = value || value === 0 ? Number(value) : 1.5;
|
|
46
|
-
_this.props.onChange(validValue);
|
|
47
|
-
};
|
|
48
|
-
_this.state = {
|
|
49
|
-
value: props.value
|
|
50
|
-
};
|
|
51
|
-
return _this;
|
|
52
|
-
}
|
|
53
|
-
_createClass(MiniNumSlicePercent, [{
|
|
54
|
-
key: "render",
|
|
55
|
-
value: function render() {
|
|
56
|
-
var value = this.props.value;
|
|
57
|
-
return /*#__PURE__*/React.createElement(FormGroup, {
|
|
58
|
-
className: "seastatistic-parameter-item"
|
|
59
|
-
}, /*#__PURE__*/React.createElement(Label, null, intl.get('Minimum_slice_percent')), /*#__PURE__*/React.createElement(NumberInput, {
|
|
60
|
-
value: value,
|
|
61
|
-
onChange: this.onPercentChange,
|
|
62
|
-
step: 0.1,
|
|
63
|
-
min: 0,
|
|
64
|
-
max: 100,
|
|
65
|
-
onBlur: this.onBlur,
|
|
66
|
-
onKeyDown: this.onKeyDown
|
|
67
|
-
}));
|
|
68
|
-
}
|
|
69
|
-
}]);
|
|
70
|
-
return MiniNumSlicePercent;
|
|
71
|
-
}(Component);
|
|
72
|
-
export default MiniNumSlicePercent;
|
|
@@ -1,109 +0,0 @@
|
|
|
1
|
-
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
2
|
-
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
3
|
-
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
4
|
-
import _createSuper from "@babel/runtime/helpers/esm/createSuper";
|
|
5
|
-
import React, { Component } from 'react';
|
|
6
|
-
import DTableSelect from "dtable-ui-component/lib/DTableSelect";
|
|
7
|
-
import { FormGroup, Label } from 'reactstrap';
|
|
8
|
-
import shallowEqual from 'shallowequal';
|
|
9
|
-
import { STATISTIC_TYPE, STATISTIC_SUMMARY_CALCULATION_METHOD, STATISTIC_SUMMARY_SHOW, STATISTIC_DATE_SUMMARY_CALCULATION_METHOD } from '../../../constants';
|
|
10
|
-
import { StatisticsUtils } from '../../../utils';
|
|
11
|
-
import intl from '../../../intl';
|
|
12
|
-
var NumericSummaryItem = /*#__PURE__*/function (_Component) {
|
|
13
|
-
_inherits(NumericSummaryItem, _Component);
|
|
14
|
-
var _super = _createSuper(NumericSummaryItem);
|
|
15
|
-
function NumericSummaryItem(_props) {
|
|
16
|
-
var _this;
|
|
17
|
-
_classCallCheck(this, NumericSummaryItem);
|
|
18
|
-
_this = _super.call(this, _props);
|
|
19
|
-
_this.initSummaryMethodOptions = function (props) {
|
|
20
|
-
var value = props.value,
|
|
21
|
-
numericColumnOptions = props.numericColumnOptions;
|
|
22
|
-
var selectedOption = numericColumnOptions.find(function (item) {
|
|
23
|
-
return item.value.key === value.column_key;
|
|
24
|
-
});
|
|
25
|
-
var summaryMethodOptions = selectedOption && StatisticsUtils.isDateSummaryColumn(selectedOption.value) ? STATISTIC_DATE_SUMMARY_CALCULATION_METHOD : STATISTIC_SUMMARY_CALCULATION_METHOD;
|
|
26
|
-
_this.summaryMethodOptions = summaryMethodOptions.map(function (item) {
|
|
27
|
-
return {
|
|
28
|
-
value: item,
|
|
29
|
-
label: intl.get(STATISTIC_SUMMARY_SHOW[item])
|
|
30
|
-
};
|
|
31
|
-
});
|
|
32
|
-
};
|
|
33
|
-
_this.onToggleExpand = function () {
|
|
34
|
-
_this.setState({
|
|
35
|
-
isExpand: !_this.state.isExpand
|
|
36
|
-
});
|
|
37
|
-
};
|
|
38
|
-
_this.state = {
|
|
39
|
-
isExpand: true
|
|
40
|
-
};
|
|
41
|
-
_this.initSummaryMethodOptions(_props);
|
|
42
|
-
return _this;
|
|
43
|
-
}
|
|
44
|
-
_createClass(NumericSummaryItem, [{
|
|
45
|
-
key: "UNSAFE_componentWillReceiveProps",
|
|
46
|
-
value: function UNSAFE_componentWillReceiveProps(nextProps) {
|
|
47
|
-
if (!shallowEqual(this.props.value, nextProps.value)) {
|
|
48
|
-
this.initSummaryMethodOptions(nextProps);
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
}, {
|
|
52
|
-
key: "render",
|
|
53
|
-
value: function render() {
|
|
54
|
-
var _this2 = this;
|
|
55
|
-
var _this$props = this.props,
|
|
56
|
-
index = _this$props.index,
|
|
57
|
-
statistic = _this$props.statistic,
|
|
58
|
-
value = _this$props.value,
|
|
59
|
-
numericColumnOptions = _this$props.numericColumnOptions;
|
|
60
|
-
var type = statistic.config.type;
|
|
61
|
-
var column_key = value.column_key,
|
|
62
|
-
summary_method = value.summary_method;
|
|
63
|
-
var selectedColumnOption = numericColumnOptions.find(function (option) {
|
|
64
|
-
return option.value.key === column_key;
|
|
65
|
-
});
|
|
66
|
-
var selectedSummaryMethodOption = this.summaryMethodOptions.find(function (option) {
|
|
67
|
-
return option.value === summary_method;
|
|
68
|
-
});
|
|
69
|
-
var isExpand = this.state.isExpand;
|
|
70
|
-
var isFirst = index === 0;
|
|
71
|
-
return /*#__PURE__*/React.createElement(FormGroup, {
|
|
72
|
-
className: "seastatistic-parameter-item"
|
|
73
|
-
}, /*#__PURE__*/React.createElement(Label, {
|
|
74
|
-
className: "numeric-summary-item d-flex align-items-center justify-content-between w-100"
|
|
75
|
-
}, /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement("i", {
|
|
76
|
-
onClick: this.onToggleExpand,
|
|
77
|
-
className: "numeric-summary-item-icon dtable-font mr-2 ".concat(isExpand ? 'dtable-icon-drop-down' : 'dtable-icon-right-slide')
|
|
78
|
-
}), /*#__PURE__*/React.createElement("span", null, (type === STATISTIC_TYPE.TABLE ? intl.get('Summary_field') : intl.get('Numeric_field')) + ' ' + (1 + index))), !isFirst && /*#__PURE__*/React.createElement("div", {
|
|
79
|
-
className: "delete-numeric-summary-item-content close d-flex align-items-center justify-content-center",
|
|
80
|
-
onClick: function onClick() {
|
|
81
|
-
return _this2.props.onDelete(index);
|
|
82
|
-
}
|
|
83
|
-
}, /*#__PURE__*/React.createElement("i", {
|
|
84
|
-
className: "dtable-font dtable-icon-fork-number delete-icon"
|
|
85
|
-
}))), /*#__PURE__*/React.createElement("div", {
|
|
86
|
-
className: "pl-4 ".concat(isExpand ? 'expanded-numeric-summary-content' : 'collapsed-numeric-summary-content d-none')
|
|
87
|
-
}, /*#__PURE__*/React.createElement(FormGroup, {
|
|
88
|
-
className: "seastatistic-parameter-item numeric-column"
|
|
89
|
-
}, /*#__PURE__*/React.createElement(DTableSelect, {
|
|
90
|
-
value: selectedColumnOption,
|
|
91
|
-
placeholder: intl.get('Select_a_column'),
|
|
92
|
-
onChange: function onChange(option) {
|
|
93
|
-
return _this2.props.onColumnOptionChange(option, index);
|
|
94
|
-
},
|
|
95
|
-
options: numericColumnOptions
|
|
96
|
-
})), /*#__PURE__*/React.createElement(FormGroup, {
|
|
97
|
-
className: "seastatistic-parameter-item summary-method"
|
|
98
|
-
}, /*#__PURE__*/React.createElement(Label, null, intl.get('Summary_method')), /*#__PURE__*/React.createElement(DTableSelect, {
|
|
99
|
-
value: selectedSummaryMethodOption,
|
|
100
|
-
onChange: function onChange(option) {
|
|
101
|
-
return _this2.props.onSummaryMethodChange(option, index);
|
|
102
|
-
},
|
|
103
|
-
options: this.summaryMethodOptions
|
|
104
|
-
}))));
|
|
105
|
-
}
|
|
106
|
-
}]);
|
|
107
|
-
return NumericSummaryItem;
|
|
108
|
-
}(Component);
|
|
109
|
-
export default NumericSummaryItem;
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
2
|
-
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
3
|
-
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
4
|
-
import _createSuper from "@babel/runtime/helpers/esm/createSuper";
|
|
5
|
-
import React from 'react';
|
|
6
|
-
import { Label, FormGroup } from 'reactstrap';
|
|
7
|
-
import DTableSelect from "dtable-ui-component/lib/DTableSelect";
|
|
8
|
-
import intl from '../../../../intl';
|
|
9
|
-
var SelectTable = /*#__PURE__*/function (_React$Component) {
|
|
10
|
-
_inherits(SelectTable, _React$Component);
|
|
11
|
-
var _super = _createSuper(SelectTable);
|
|
12
|
-
function SelectTable(props) {
|
|
13
|
-
var _this;
|
|
14
|
-
_classCallCheck(this, SelectTable);
|
|
15
|
-
_this = _super.call(this, props);
|
|
16
|
-
_this.renderSelector = function () {
|
|
17
|
-
var selectedTableId = _this.props.selectedTableId;
|
|
18
|
-
var selectedOption = selectedTableId ? _this.tableOptions.find(function (option) {
|
|
19
|
-
return option.value === selectedTableId;
|
|
20
|
-
}) : null;
|
|
21
|
-
return /*#__PURE__*/React.createElement(DTableSelect, {
|
|
22
|
-
menuPortalTarget: '#wrapper',
|
|
23
|
-
value: selectedOption,
|
|
24
|
-
options: _this.tableOptions,
|
|
25
|
-
onChange: _this.props.onSettingUpdate
|
|
26
|
-
});
|
|
27
|
-
};
|
|
28
|
-
var tables = props.tables;
|
|
29
|
-
_this.tableOptions = Array.isArray(tables) ? tables.map(function (table) {
|
|
30
|
-
var value = table._id;
|
|
31
|
-
var label = table['name'];
|
|
32
|
-
return {
|
|
33
|
-
value: value,
|
|
34
|
-
label: label
|
|
35
|
-
};
|
|
36
|
-
}) : [];
|
|
37
|
-
return _this;
|
|
38
|
-
}
|
|
39
|
-
_createClass(SelectTable, [{
|
|
40
|
-
key: "render",
|
|
41
|
-
value: function render() {
|
|
42
|
-
return /*#__PURE__*/React.createElement(FormGroup, {
|
|
43
|
-
className: "seastatistic-setting-item table-setting"
|
|
44
|
-
}, /*#__PURE__*/React.createElement(Label, null, intl.get('Table')), this.renderSelector());
|
|
45
|
-
}
|
|
46
|
-
}]);
|
|
47
|
-
return SelectTable;
|
|
48
|
-
}(React.Component);
|
|
49
|
-
export default SelectTable;
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
2
|
-
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
3
|
-
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
4
|
-
import _createSuper from "@babel/runtime/helpers/esm/createSuper";
|
|
5
|
-
import React, { Component } from 'react';
|
|
6
|
-
import { Label, FormGroup } from 'reactstrap';
|
|
7
|
-
import { getTableById, getTableColumnByKey } from 'dtable-utils';
|
|
8
|
-
import Switch from './switch';
|
|
9
|
-
import { eventStopPropagation } from '../../../utils';
|
|
10
|
-
import intl from '../../../intl';
|
|
11
|
-
var Stack = /*#__PURE__*/function (_Component) {
|
|
12
|
-
_inherits(Stack, _Component);
|
|
13
|
-
var _super = _createSuper(Stack);
|
|
14
|
-
function Stack() {
|
|
15
|
-
var _this;
|
|
16
|
-
_classCallCheck(this, Stack);
|
|
17
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
18
|
-
args[_key] = arguments[_key];
|
|
19
|
-
}
|
|
20
|
-
_this = _super.call.apply(_super, [this].concat(args));
|
|
21
|
-
_this.onUseStackChange = function (event) {
|
|
22
|
-
eventStopPropagation(event);
|
|
23
|
-
var statistic = _this.props.statistic;
|
|
24
|
-
var config = statistic.config;
|
|
25
|
-
var y_axis_use_stack = config.y_axis_use_stack;
|
|
26
|
-
_this.props.onChange({
|
|
27
|
-
y_axis_use_stack: !y_axis_use_stack
|
|
28
|
-
});
|
|
29
|
-
};
|
|
30
|
-
return _this;
|
|
31
|
-
}
|
|
32
|
-
_createClass(Stack, [{
|
|
33
|
-
key: "render",
|
|
34
|
-
value: function render() {
|
|
35
|
-
var _this$props = this.props,
|
|
36
|
-
statistic = _this$props.statistic,
|
|
37
|
-
tables = _this$props.tables,
|
|
38
|
-
selectedTableId = _this$props.selectedTableId;
|
|
39
|
-
var _statistic$config = statistic.config,
|
|
40
|
-
y_axis_use_stack = _statistic$config.y_axis_use_stack,
|
|
41
|
-
column_groupby_column_key = _statistic$config.column_groupby_column_key;
|
|
42
|
-
if (!column_groupby_column_key) return null;
|
|
43
|
-
var selectedTable = getTableById(tables, selectedTableId);
|
|
44
|
-
if (!selectedTable) return null;
|
|
45
|
-
var columnGroupbyColumn = getTableColumnByKey(selectedTable, column_groupby_column_key);
|
|
46
|
-
if (!columnGroupbyColumn) return null;
|
|
47
|
-
return /*#__PURE__*/React.createElement(FormGroup, {
|
|
48
|
-
className: "seastatistic-parameter-item"
|
|
49
|
-
}, /*#__PURE__*/React.createElement(Label, null, intl.get('Display_mode')), /*#__PURE__*/React.createElement(Switch, {
|
|
50
|
-
checked: y_axis_use_stack || false,
|
|
51
|
-
placeholder: intl.get('Stack'),
|
|
52
|
-
onChange: this.onUseStackChange
|
|
53
|
-
}));
|
|
54
|
-
}
|
|
55
|
-
}]);
|
|
56
|
-
return Stack;
|
|
57
|
-
}(Component);
|
|
58
|
-
export default Stack;
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
2
|
-
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
3
|
-
import React, { useCallback, useState } from 'react';
|
|
4
|
-
import { Label, FormGroup } from 'reactstrap';
|
|
5
|
-
import TypesDialog from '../../../types-dialog';
|
|
6
|
-
import { STATISTIC_TYPE_SHOW } from '../../../../constants';
|
|
7
|
-
import { eventStopPropagation } from '../../../../utils';
|
|
8
|
-
import intl from '../../../../intl';
|
|
9
|
-
import Icon from '../../../icon';
|
|
10
|
-
import './index.css';
|
|
11
|
-
var StatisticType = function StatisticType(_ref) {
|
|
12
|
-
var statistic = _ref.statistic,
|
|
13
|
-
generateChartConfig = _ref.generateChartConfig,
|
|
14
|
-
onChange = _ref.onChange;
|
|
15
|
-
var _useState = useState(false),
|
|
16
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
17
|
-
isDialogShow = _useState2[0],
|
|
18
|
-
setDialogShow = _useState2[1];
|
|
19
|
-
var openTypesDialog = useCallback(function (event) {
|
|
20
|
-
eventStopPropagation(event);
|
|
21
|
-
setDialogShow(true);
|
|
22
|
-
}, []);
|
|
23
|
-
var closeTypesDialog = useCallback(function () {
|
|
24
|
-
setDialogShow(false);
|
|
25
|
-
}, []);
|
|
26
|
-
var onTypeChange = useCallback(function (type) {
|
|
27
|
-
var config = statistic.config;
|
|
28
|
-
var oldType = config.type;
|
|
29
|
-
if (type === oldType) return;
|
|
30
|
-
var convertedChart = generateChartConfig(_objectSpread(_objectSpread({}, config), {}, {
|
|
31
|
-
type: type
|
|
32
|
-
}));
|
|
33
|
-
onChange && onChange(convertedChart);
|
|
34
|
-
}, [statistic, generateChartConfig, onChange]);
|
|
35
|
-
var config = statistic.config;
|
|
36
|
-
var type = config.type;
|
|
37
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(FormGroup, {
|
|
38
|
-
className: "seastatistic-parameter-item",
|
|
39
|
-
id: "seastatistic-type-container"
|
|
40
|
-
}, /*#__PURE__*/React.createElement(Label, null, intl.get('Chart_type')), /*#__PURE__*/React.createElement("div", {
|
|
41
|
-
className: "seastatistic-selected-type-container d-flex align-items-center"
|
|
42
|
-
}, /*#__PURE__*/React.createElement("span", null, intl.get(STATISTIC_TYPE_SHOW[type])), /*#__PURE__*/React.createElement("div", {
|
|
43
|
-
className: "seastatistic-type-icon-container",
|
|
44
|
-
onClick: openTypesDialog
|
|
45
|
-
}, /*#__PURE__*/React.createElement(Icon, {
|
|
46
|
-
symbol: "type-change",
|
|
47
|
-
className: "seastatistic-type-icon"
|
|
48
|
-
})))), isDialogShow && /*#__PURE__*/React.createElement(TypesDialog, {
|
|
49
|
-
type: type,
|
|
50
|
-
onToggle: closeTypesDialog,
|
|
51
|
-
onChange: onTypeChange
|
|
52
|
-
}));
|
|
53
|
-
};
|
|
54
|
-
export default StatisticType;
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
2
|
-
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
3
|
-
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
4
|
-
import _createSuper from "@babel/runtime/helpers/esm/createSuper";
|
|
5
|
-
import React, { Component } from 'react';
|
|
6
|
-
import DTableSelect from "dtable-ui-component/lib/DTableSelect";
|
|
7
|
-
import { FormGroup, Label } from 'reactstrap';
|
|
8
|
-
import shallowEqual from 'shallowequal';
|
|
9
|
-
import { STATISTIC_TYPE, STATISTIC_SUMMARY_CALCULATION_METHOD, STATISTIC_SUMMARY_SHOW, STATISTIC_DATE_SUMMARY_CALCULATION_METHOD } from '../../../constants';
|
|
10
|
-
import { StatisticsUtils } from '../../../utils';
|
|
11
|
-
import intl from '../../../intl';
|
|
12
|
-
var SummaryMethodSettings = /*#__PURE__*/function (_Component) {
|
|
13
|
-
_inherits(SummaryMethodSettings, _Component);
|
|
14
|
-
var _super = _createSuper(SummaryMethodSettings);
|
|
15
|
-
function SummaryMethodSettings(_props) {
|
|
16
|
-
var _this;
|
|
17
|
-
_classCallCheck(this, SummaryMethodSettings);
|
|
18
|
-
_this = _super.call(this, _props);
|
|
19
|
-
_this.initSummaryMethodOptions = function (props) {
|
|
20
|
-
var value = props.value,
|
|
21
|
-
numericColumnOptions = props.numericColumnOptions;
|
|
22
|
-
var selectedOption = numericColumnOptions.find(function (item) {
|
|
23
|
-
return item.value.key === value.column_key;
|
|
24
|
-
});
|
|
25
|
-
var summaryMethodOptions = selectedOption && StatisticsUtils.isDateSummaryColumn(selectedOption.value) ? STATISTIC_DATE_SUMMARY_CALCULATION_METHOD : STATISTIC_SUMMARY_CALCULATION_METHOD;
|
|
26
|
-
_this.summaryMethodOptions = summaryMethodOptions.map(function (item) {
|
|
27
|
-
return {
|
|
28
|
-
value: item,
|
|
29
|
-
label: intl.get(STATISTIC_SUMMARY_SHOW[item])
|
|
30
|
-
};
|
|
31
|
-
});
|
|
32
|
-
};
|
|
33
|
-
_this.state = {
|
|
34
|
-
isExpand: true
|
|
35
|
-
};
|
|
36
|
-
_this.initSummaryMethodOptions(_props);
|
|
37
|
-
return _this;
|
|
38
|
-
}
|
|
39
|
-
_createClass(SummaryMethodSettings, [{
|
|
40
|
-
key: "UNSAFE_componentWillReceiveProps",
|
|
41
|
-
value: function UNSAFE_componentWillReceiveProps(nextProps) {
|
|
42
|
-
if (!shallowEqual(this.props.value, nextProps.value)) {
|
|
43
|
-
this.initSummaryMethodOptions(nextProps);
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
}, {
|
|
47
|
-
key: "render",
|
|
48
|
-
value: function render() {
|
|
49
|
-
var _this$props = this.props,
|
|
50
|
-
statistic = _this$props.statistic,
|
|
51
|
-
value = _this$props.value,
|
|
52
|
-
numericColumnOptions = _this$props.numericColumnOptions;
|
|
53
|
-
var type = statistic.config.type;
|
|
54
|
-
var column_key = value.column_key,
|
|
55
|
-
summary_method = value.summary_method;
|
|
56
|
-
var selectedColumnOption = numericColumnOptions.find(function (option) {
|
|
57
|
-
return option.value.key === column_key;
|
|
58
|
-
});
|
|
59
|
-
var selectedSummaryMethodOption = this.summaryMethodOptions.find(function (option) {
|
|
60
|
-
return option.value === summary_method;
|
|
61
|
-
});
|
|
62
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(FormGroup, {
|
|
63
|
-
className: "statistic-parameter-item"
|
|
64
|
-
}, /*#__PURE__*/React.createElement(Label, null, type === STATISTIC_TYPE.TABLE ? intl.get('Summary_field') : intl.get('Numeric_field')), /*#__PURE__*/React.createElement(DTableSelect, {
|
|
65
|
-
value: selectedColumnOption,
|
|
66
|
-
placeholder: intl.get('Select_a_column'),
|
|
67
|
-
onChange: this.props.onColumnOptionChange,
|
|
68
|
-
options: numericColumnOptions
|
|
69
|
-
})), /*#__PURE__*/React.createElement(FormGroup, {
|
|
70
|
-
className: "statistic-parameter-item"
|
|
71
|
-
}, /*#__PURE__*/React.createElement(Label, null, intl.get('Summary_method')), /*#__PURE__*/React.createElement(DTableSelect, {
|
|
72
|
-
value: selectedSummaryMethodOption,
|
|
73
|
-
onChange: this.props.onSummaryMethodChange,
|
|
74
|
-
options: this.summaryMethodOptions
|
|
75
|
-
})));
|
|
76
|
-
}
|
|
77
|
-
}]);
|
|
78
|
-
return SummaryMethodSettings;
|
|
79
|
-
}(Component);
|
|
80
|
-
export default SummaryMethodSettings;
|