sea-chart 2.0.35 → 2.0.36
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/dist/api/index.js +17 -59
- package/dist/assets/css/sea-chart-d3-tooltip.css +0 -1
- package/dist/components/color-popover/color-rules-popover.js +4 -2
- package/dist/components/drill-down-settings/drill-down-fields-popover/index.js +5 -4
- package/dist/components/icon/index.js +9 -13
- package/dist/components/number-input/index.js +7 -13
- package/dist/components/popover/hide-column-popover/hide-column-popover-widgets/hide-column-item.js +7 -3
- package/dist/components/popover/hide-column-popover/hide-column-popover.css +5 -1
- package/dist/components/popover/hide-column-popover/hide-column-popover.js +2 -4
- package/dist/components/popover/sort-popover/sort-popover.js +6 -7
- package/dist/components/statistic-record-dialog/index.js +9 -8
- package/dist/components/tooltip/index.js +26 -8
- package/dist/editor/index.js +5 -1
- package/dist/locale/lang/de.js +1 -0
- package/dist/locale/lang/en.js +1 -0
- package/dist/locale/lang/es.js +1 -0
- package/dist/locale/lang/fr.js +1 -0
- package/dist/locale/lang/pt.js +1 -0
- package/dist/locale/lang/ru.js +1 -0
- package/dist/locale/lang/zh_CN.js +1 -0
- package/dist/model/funnel.js +2 -2
- package/dist/model/map-bubble.js +4 -0
- package/dist/services/map-json.js +3 -0
- package/dist/settings/advance-bar-settings/data-settings.js +1 -1
- package/dist/settings/advance-bar-settings/style-settings.js +4 -3
- package/dist/settings/bar-settings/data-settings.js +1 -1
- package/dist/settings/bar-settings/style-settings.js +2 -2
- package/dist/settings/basic-number-card/data-settings.js +3 -2
- package/dist/settings/combination-settings/data-settings.js +0 -1
- package/dist/settings/combination-settings/style-settings.js +2 -2
- package/dist/settings/dashboard-settings/data-settings.js +3 -2
- package/dist/settings/funnel-settings/components/funnel-layer-setting.js +7 -7
- package/dist/settings/index.js +8 -3
- package/dist/settings/table-element-settings/components/data-filter.js +24 -25
- package/dist/settings/table-element-settings/index.css +1 -31
- package/dist/settings/table-settings/data-settings.js +3 -2
- package/dist/settings/time-comparison-settings/style-settings.js +2 -2
- package/dist/settings/widgets/basic-summary/index.js +8 -7
- package/dist/settings/widgets/common-data-settings.js +7 -6
- package/dist/settings/widgets/data-filter/index.js +30 -22
- package/dist/settings/widgets/group-by.js +4 -3
- package/dist/settings/widgets/summary-settings.js +3 -2
- package/dist/settings/widgets/y-axis-group-settings.js +3 -2
- package/dist/utils/cell-format-utils.js +9 -7
- package/dist/utils/chart-utils/base-utils.js +194 -86
- package/dist/utils/chart-utils/index.js +5 -3
- package/dist/utils/chart-utils/original-data-utils/basic-chart-calculator.js +5 -5
- package/dist/utils/chart-utils/original-data-utils/card-calculator.js +8 -2
- package/dist/utils/chart-utils/original-data-utils/dashboard-calculator.js +12 -3
- package/dist/utils/chart-utils/original-data-utils/pivot-table-calculator.js +4 -1
- package/dist/utils/chart-utils/original-data-utils/scatter-calculator.js +1 -0
- package/dist/utils/chart-utils/original-data-utils/trend-calculator.js +24 -3
- package/dist/utils/chart-utils/sql-statistics-utils.js +182 -177
- package/dist/utils/column-utils.js +20 -7
- package/dist/utils/contexts.js +5 -2
- package/dist/utils/index.js +25 -4
- package/dist/utils/row-record-utils.js +100 -20
- package/dist/utils/sql/column-2-sql-column.js +10 -10
- package/dist/utils/trend-utils.js +15 -2
- package/dist/view/index.css +2 -8
- package/dist/view/index.js +14 -9
- package/dist/view/wrapper/area-group.js +15 -7
- package/dist/view/wrapper/bar-compare.js +18 -2
- package/dist/view/wrapper/bar-custom-stack.js +35 -9
- package/dist/view/wrapper/bar-group.js +55 -26
- package/dist/view/wrapper/bar-stack.js +2 -2
- package/dist/view/wrapper/basic-number-card.js +27 -3
- package/dist/view/wrapper/chart-component.js +43 -440
- package/dist/view/wrapper/completeness-group.js +104 -49
- package/dist/view/wrapper/dashboard.js +68 -18
- package/dist/view/wrapper/horizontal-bar-group.js +26 -6
- package/dist/view/wrapper/horizontal-bar-stack.js +2 -2
- package/dist/view/wrapper/line-group.js +8 -3
- package/dist/view/wrapper/map-world-bubble.js +1 -0
- package/dist/view/wrapper/map-world.js +1 -0
- package/dist/view/wrapper/pie.js +1 -1
- package/dist/view/wrapper/ring.js +1 -1
- package/dist/view/wrapper/scatter.js +8 -6
- package/dist/view/wrapper/table/two-dimension-table.js +3 -2
- package/dist/view/wrapper/table-element/components/records-header/index.js +0 -1
- package/dist/view/wrapper/table-element/components/resize-column-handle/resize-column-handle.js +3 -1
- package/dist/view/wrapper/table-element/index.js +16 -21
- package/dist/view/wrapper/trend.js +24 -1
- package/package.json +15 -12
package/dist/api/index.js
CHANGED
|
@@ -24,42 +24,16 @@ class SeaChartAPI {
|
|
|
24
24
|
});
|
|
25
25
|
};
|
|
26
26
|
this.getBaseData = () => {
|
|
27
|
-
const
|
|
28
|
-
|
|
29
|
-
dtableUuid,
|
|
30
|
-
accessToken
|
|
31
|
-
} = this;
|
|
32
|
-
const url = dtableServer + 'dtables/' + dtableUuid;
|
|
33
|
-
const headers = {
|
|
34
|
-
'Authorization': 'Token ' + accessToken
|
|
35
|
-
};
|
|
36
|
-
return _axios.default.get(url, {
|
|
37
|
-
headers
|
|
38
|
-
});
|
|
27
|
+
const url = "/api/v2/dtables/".concat(this.dtableUuid, "/");
|
|
28
|
+
return this.req.get(url);
|
|
39
29
|
};
|
|
40
30
|
this.getBaseMetaData = () => {
|
|
41
|
-
const
|
|
42
|
-
|
|
43
|
-
dtableUuid,
|
|
44
|
-
accessToken
|
|
45
|
-
} = this;
|
|
46
|
-
const url = dtableServer + 'api/v1/dtables/' + dtableUuid + '/metadata';
|
|
47
|
-
const headers = {
|
|
48
|
-
'Authorization': 'Token ' + accessToken
|
|
49
|
-
};
|
|
50
|
-
return _axios.default.get(url, {
|
|
51
|
-
headers
|
|
52
|
-
});
|
|
31
|
+
const url = "/api/v2/dtables/".concat(this.dtableUuid, "/metadata/");
|
|
32
|
+
return this.req.get(url);
|
|
53
33
|
};
|
|
54
34
|
this.sqlQuery = function (sql, parameters) {
|
|
55
35
|
let convert_keys = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
56
|
-
|
|
57
|
-
const {
|
|
58
|
-
dtableDB,
|
|
59
|
-
dtableUuid,
|
|
60
|
-
accessToken
|
|
61
|
-
} = _this;
|
|
62
|
-
const url = dtableDB + '/api/v2/dtables/' + dtableUuid + '/sql/';
|
|
36
|
+
const url = "/api/v2/dtables/".concat(_this.dtableUuid, "/sql/");
|
|
63
37
|
const data = {
|
|
64
38
|
sql,
|
|
65
39
|
convert_keys,
|
|
@@ -67,20 +41,16 @@ class SeaChartAPI {
|
|
|
67
41
|
parameters: parameters
|
|
68
42
|
})
|
|
69
43
|
};
|
|
70
|
-
|
|
71
|
-
'Authorization': 'Token ' + accessToken
|
|
72
|
-
};
|
|
73
|
-
return _axios.default.post(url, data, {
|
|
74
|
-
headers
|
|
75
|
-
});
|
|
44
|
+
return _this.req.post(url, data);
|
|
76
45
|
};
|
|
77
46
|
this.config = config;
|
|
47
|
+
const {
|
|
48
|
+
server: _server
|
|
49
|
+
} = config;
|
|
78
50
|
this.instance = null;
|
|
79
51
|
this.appName = '';
|
|
80
|
-
this.accessToken = '';
|
|
81
52
|
this.dtableUuid = '';
|
|
82
|
-
this.
|
|
83
|
-
this.dtableSocket = '';
|
|
53
|
+
this.baseURL = _server[_server.length - 1] === '/' ? "".concat(_server, "api-gateway") : "".concat(_server, "/api-gateway");
|
|
84
54
|
}
|
|
85
55
|
static getInstance(config) {
|
|
86
56
|
if (this.instance) return this.instance;
|
|
@@ -92,28 +62,16 @@ class SeaChartAPI {
|
|
|
92
62
|
const {
|
|
93
63
|
app_name,
|
|
94
64
|
access_token,
|
|
95
|
-
dtable_uuid
|
|
96
|
-
dtable_server,
|
|
97
|
-
dtable_socket,
|
|
98
|
-
dtable_db
|
|
65
|
+
dtable_uuid
|
|
99
66
|
} = accessTokenRes.data;
|
|
100
67
|
this.appName = app_name;
|
|
101
|
-
this.accessToken = access_token;
|
|
102
68
|
this.dtableUuid = dtable_uuid;
|
|
103
|
-
this.
|
|
104
|
-
|
|
105
|
-
|
|
69
|
+
this.req = _axios.default.create({
|
|
70
|
+
baseURL: this.baseURL,
|
|
71
|
+
headers: {
|
|
72
|
+
'Authorization': 'Token ' + access_token
|
|
73
|
+
}
|
|
74
|
+
});
|
|
106
75
|
}
|
|
107
|
-
|
|
108
|
-
// queryUsers(userIdList) {
|
|
109
|
-
// const { dtableServer, accessToken } = this;
|
|
110
|
-
// const url = dtableServer + 'api/v2.1/user-list';
|
|
111
|
-
// let operation = { user_id_list: userIdList };
|
|
112
|
-
// const headers = {
|
|
113
|
-
// 'Content-type': 'application/json',
|
|
114
|
-
// 'Authorization': 'Token ' + accessToken
|
|
115
|
-
// };
|
|
116
|
-
// return axios.post(url, operation, { headers });
|
|
117
|
-
// }
|
|
118
76
|
}
|
|
119
77
|
var _default = exports.default = SeaChartAPI;
|
|
@@ -8,8 +8,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
8
8
|
exports.default = void 0;
|
|
9
9
|
var _react = _interopRequireWildcard(require("react"));
|
|
10
10
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
11
|
-
var _intl = _interopRequireDefault(require("../../intl"));
|
|
12
11
|
var _dtableUtils = require("dtable-utils");
|
|
12
|
+
var _intl = _interopRequireDefault(require("../../intl"));
|
|
13
13
|
var _commonAddTool = _interopRequireDefault(require("../common-add-tool"));
|
|
14
14
|
var _dtablePopover = _interopRequireDefault(require("../dtable-popover"));
|
|
15
15
|
var _colorRules = _interopRequireDefault(require("./color-rules"));
|
|
@@ -83,7 +83,9 @@ class ColorRulesPopover extends _react.Component {
|
|
|
83
83
|
switch (filterType) {
|
|
84
84
|
case _colorRules2.COLOR_RULE_FILTER_TYPE_MAP.NUMERIC_VALUE:
|
|
85
85
|
{
|
|
86
|
-
return _dtableUtils.
|
|
86
|
+
return (0, _dtableUtils.getColumnFilterOptions)({
|
|
87
|
+
type: _dtableUtils.CellType.NUMBER
|
|
88
|
+
});
|
|
87
89
|
}
|
|
88
90
|
default:
|
|
89
91
|
{
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
3
|
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
4
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
8
|
exports.default = DrillDownFieldsPopover;
|
|
9
|
-
var
|
|
9
|
+
var _DTableColumnIcon2 = _interopRequireDefault(require("dtable-ui-component/lib/DTableColumnIcon"));
|
|
10
10
|
var _react = _interopRequireWildcard(require("react"));
|
|
11
11
|
var _reactstrap = require("reactstrap");
|
|
12
12
|
var _isHotkey = _interopRequireDefault(require("is-hotkey"));
|
|
@@ -101,8 +101,9 @@ function DrillDownFieldsPopover(_ref) {
|
|
|
101
101
|
}, /*#__PURE__*/_react.default.createElement("td", {
|
|
102
102
|
className: "pl-5 text-truncate",
|
|
103
103
|
title: column.name
|
|
104
|
-
}, /*#__PURE__*/_react.default.createElement(
|
|
105
|
-
|
|
104
|
+
}, /*#__PURE__*/_react.default.createElement(_DTableColumnIcon2.default, {
|
|
105
|
+
column: column,
|
|
106
|
+
className: "".concat(_indexModule.default['drill-down-fields-icon'], " mr-2")
|
|
106
107
|
}), /*#__PURE__*/_react.default.createElement("span", null, column.name)), /*#__PURE__*/_react.default.createElement("td", {
|
|
107
108
|
className: "".concat(_indexModule.default['column-checkbox'], " pr-3")
|
|
108
109
|
}, /*#__PURE__*/_react.default.createElement("input", {
|
|
@@ -7,25 +7,21 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.default = void 0;
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
require("./index.css");
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
}
|
|
16
|
-
// eslint-disable-next-line no-console
|
|
17
|
-
console.log(error);
|
|
18
|
-
}
|
|
10
|
+
const components = {};
|
|
11
|
+
const requireContext = require.context('../../assets/icons', false, /\.svg$/);
|
|
12
|
+
requireContext.keys().forEach(path => {
|
|
13
|
+
const iconName = path.replace(/^\.\/(.*?)\.svg$/, '$1').toLowerCase();
|
|
14
|
+
components[iconName] = requireContext(path).default;
|
|
15
|
+
});
|
|
19
16
|
const Icon = props => {
|
|
20
17
|
const {
|
|
21
18
|
className,
|
|
22
19
|
symbol
|
|
23
20
|
} = props;
|
|
24
21
|
const iconClass = "sea-chart-icon sea-chart-icon-".concat(symbol, " ").concat(className || '');
|
|
25
|
-
|
|
22
|
+
const IconComponent = components[symbol];
|
|
23
|
+
return /*#__PURE__*/_react.default.createElement(IconComponent, {
|
|
26
24
|
className: iconClass
|
|
27
|
-
}
|
|
28
|
-
xlinkHref: "#".concat(symbol)
|
|
29
|
-
}));
|
|
25
|
+
});
|
|
30
26
|
};
|
|
31
27
|
var _default = exports.default = Icon;
|
|
@@ -7,18 +7,18 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.default = void 0;
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
var _reactstrap = require("reactstrap");
|
|
10
|
-
function NumberInput(
|
|
11
|
-
|
|
10
|
+
function NumberInput(_ref) {
|
|
11
|
+
let {
|
|
12
12
|
value,
|
|
13
13
|
onChange,
|
|
14
|
-
min,
|
|
15
|
-
step,
|
|
16
|
-
max,
|
|
17
|
-
readOnly,
|
|
14
|
+
min = 0,
|
|
15
|
+
step = 1,
|
|
16
|
+
max = Infinity,
|
|
17
|
+
readOnly = false,
|
|
18
18
|
className,
|
|
19
19
|
useEmpty,
|
|
20
20
|
...otherProps
|
|
21
|
-
} =
|
|
21
|
+
} = _ref;
|
|
22
22
|
// useempty is used to control whether to use empty string or '0'
|
|
23
23
|
const number = value ? value : useEmpty ? '' : '0';
|
|
24
24
|
return /*#__PURE__*/_react.default.createElement(_reactstrap.Input, Object.assign({
|
|
@@ -32,10 +32,4 @@ function NumberInput(props) {
|
|
|
32
32
|
onChange: onChange
|
|
33
33
|
}, otherProps));
|
|
34
34
|
}
|
|
35
|
-
NumberInput.defaultProps = {
|
|
36
|
-
min: 0,
|
|
37
|
-
step: 1,
|
|
38
|
-
max: Infinity,
|
|
39
|
-
readOnly: false
|
|
40
|
-
};
|
|
41
35
|
var _default = exports.default = NumberInput;
|
package/dist/components/popover/hide-column-popover/hide-column-popover-widgets/hide-column-item.js
CHANGED
|
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.default = void 0;
|
|
8
8
|
var _DTableSwitch2 = _interopRequireDefault(require("dtable-ui-component/lib/DTableSwitch"));
|
|
9
|
+
var _DTableColumnIcon2 = _interopRequireDefault(require("dtable-ui-component/lib/DTableColumnIcon"));
|
|
9
10
|
var _react = _interopRequireDefault(require("react"));
|
|
10
11
|
class HideColumnItem extends _react.default.PureComponent {
|
|
11
12
|
constructor(props) {
|
|
@@ -47,11 +48,14 @@ class HideColumnItem extends _react.default.PureComponent {
|
|
|
47
48
|
const {
|
|
48
49
|
readonly
|
|
49
50
|
} = this.props;
|
|
50
|
-
const
|
|
51
|
-
|
|
51
|
+
const {
|
|
52
|
+
column
|
|
53
|
+
} = setting;
|
|
54
|
+
const placeholder = /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_DTableColumnIcon2.default, {
|
|
55
|
+
column: column
|
|
52
56
|
}), /*#__PURE__*/_react.default.createElement("span", {
|
|
53
57
|
className: "text-truncate"
|
|
54
|
-
},
|
|
58
|
+
}, column.name));
|
|
55
59
|
return /*#__PURE__*/_react.default.createElement(_DTableSwitch2.default, {
|
|
56
60
|
checked: setting.isChecked,
|
|
57
61
|
disabled: readonly,
|
|
@@ -2,8 +2,12 @@
|
|
|
2
2
|
width: 192px;
|
|
3
3
|
display: inline-flex;
|
|
4
4
|
align-items: center;
|
|
5
|
-
margin: 0;
|
|
6
5
|
padding-right: 5px;
|
|
6
|
+
margin: 0;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.hidden-column-popover .field-settings-body .dtable-switch.dropdown-item {
|
|
10
|
+
padding: 0 10px;
|
|
7
11
|
}
|
|
8
12
|
|
|
9
13
|
.hidden-column-popover .custom-switch .dtable-font {
|
|
@@ -8,7 +8,6 @@ exports.default = void 0;
|
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
var _reactstrap = require("reactstrap");
|
|
10
10
|
var _isHotkey = _interopRequireDefault(require("is-hotkey"));
|
|
11
|
-
var _dtableUtils = require("dtable-utils");
|
|
12
11
|
var _intl = _interopRequireDefault(require("../../../intl"));
|
|
13
12
|
var _utils = require("../../../utils");
|
|
14
13
|
var _hideColumnItem = _interopRequireDefault(require("./hide-column-popover-widgets/hide-column-item"));
|
|
@@ -120,7 +119,7 @@ class HideColumnPopover extends _react.default.Component {
|
|
|
120
119
|
return fieldSettings;
|
|
121
120
|
}
|
|
122
121
|
return fieldSettings.filter(setting => {
|
|
123
|
-
return setting.
|
|
122
|
+
return setting.column.name.toLowerCase().includes(searchVal);
|
|
124
123
|
});
|
|
125
124
|
};
|
|
126
125
|
this.state = {
|
|
@@ -145,8 +144,7 @@ class HideColumnPopover extends _react.default.Component {
|
|
|
145
144
|
return {
|
|
146
145
|
key: column.key,
|
|
147
146
|
isChecked: shownColumnKeys.includes(column.key),
|
|
148
|
-
|
|
149
|
-
columnIcon: _dtableUtils.COLUMNS_ICON_CONFIG[column.type]
|
|
147
|
+
column: column
|
|
150
148
|
};
|
|
151
149
|
});
|
|
152
150
|
// table page cannot hide first column
|
|
@@ -7,6 +7,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
});
|
|
8
8
|
exports.default = void 0;
|
|
9
9
|
var _DTableCustomizeSelect2 = _interopRequireDefault(require("dtable-ui-component/lib/DTableCustomizeSelect"));
|
|
10
|
+
var _DTableColumnIcon2 = _interopRequireDefault(require("dtable-ui-component/lib/DTableColumnIcon"));
|
|
10
11
|
var _react = _interopRequireWildcard(require("react"));
|
|
11
12
|
var _isHotkey = _interopRequireDefault(require("is-hotkey"));
|
|
12
13
|
var _reactstrap = require("reactstrap");
|
|
@@ -128,7 +129,6 @@ class SortPopover extends _react.Component {
|
|
|
128
129
|
const sortableColumns = columns.filter(column => _dtableUtils.SORT_COLUMN_OPTIONS.includes(column.type));
|
|
129
130
|
return sortableColumns.map(column => {
|
|
130
131
|
const {
|
|
131
|
-
type,
|
|
132
132
|
name
|
|
133
133
|
} = column;
|
|
134
134
|
return {
|
|
@@ -137,8 +137,8 @@ class SortPopover extends _react.Component {
|
|
|
137
137
|
},
|
|
138
138
|
label: /*#__PURE__*/_react.default.createElement(_react.Fragment, null, /*#__PURE__*/_react.default.createElement("span", {
|
|
139
139
|
className: "filter-header-icon"
|
|
140
|
-
}, /*#__PURE__*/_react.default.createElement(
|
|
141
|
-
|
|
140
|
+
}, /*#__PURE__*/_react.default.createElement(_DTableColumnIcon2.default, {
|
|
141
|
+
column: column
|
|
142
142
|
})), /*#__PURE__*/_react.default.createElement("span", {
|
|
143
143
|
className: "select-option-name"
|
|
144
144
|
}, name))
|
|
@@ -171,8 +171,7 @@ class SortPopover extends _react.Component {
|
|
|
171
171
|
};
|
|
172
172
|
this.renderSortItem = (column, sort, index) => {
|
|
173
173
|
let {
|
|
174
|
-
name
|
|
175
|
-
type
|
|
174
|
+
name
|
|
176
175
|
} = column;
|
|
177
176
|
const {
|
|
178
177
|
readonly
|
|
@@ -180,8 +179,8 @@ class SortPopover extends _react.Component {
|
|
|
180
179
|
let selectedColumn = {
|
|
181
180
|
label: /*#__PURE__*/_react.default.createElement(_react.Fragment, null, /*#__PURE__*/_react.default.createElement("span", {
|
|
182
181
|
className: "filter-header-icon"
|
|
183
|
-
}, /*#__PURE__*/_react.default.createElement(
|
|
184
|
-
|
|
182
|
+
}, /*#__PURE__*/_react.default.createElement(_DTableColumnIcon2.default, {
|
|
183
|
+
column: column
|
|
185
184
|
})), /*#__PURE__*/_react.default.createElement("span", {
|
|
186
185
|
className: "select-option-name",
|
|
187
186
|
title: name,
|
|
@@ -22,6 +22,7 @@ var _rowRecordUtils = require("../../utils/row-record-utils");
|
|
|
22
22
|
var _rowCard = _interopRequireDefault(require("../row-card/row-card"));
|
|
23
23
|
var _commonConstants = require("../../constants/common-constants");
|
|
24
24
|
var _utils = require("../../utils");
|
|
25
|
+
var _constants = require("../../constants");
|
|
25
26
|
require("./index.css");
|
|
26
27
|
class StatisticRecordDialog extends _react.default.Component {
|
|
27
28
|
constructor(_props) {
|
|
@@ -64,7 +65,11 @@ class StatisticRecordDialog extends _react.default.Component {
|
|
|
64
65
|
// if more then 2 filters, use 'Or' conjunction to get them all
|
|
65
66
|
// if the statistic record is '_Others', use 'Or' conjunction to get them all
|
|
66
67
|
if ((detailFilterConditions === null || detailFilterConditions === void 0 ? void 0 : detailFilterConditions.filters.length) > 2 || statisticRecord.name === '_Others') {
|
|
67
|
-
|
|
68
|
+
if (chart.config.type === _constants.CHART_TYPE.SCATTER) {
|
|
69
|
+
detailFilterConditions.filter_conjunction = 'And';
|
|
70
|
+
} else {
|
|
71
|
+
detailFilterConditions.filter_conjunction = 'Or';
|
|
72
|
+
}
|
|
68
73
|
}
|
|
69
74
|
_context.default.api.customQueryRows(currentElementId, detailFilterConditions).then(res => {
|
|
70
75
|
const {
|
|
@@ -355,14 +360,10 @@ class StatisticRecordDialog extends _react.default.Component {
|
|
|
355
360
|
zIndex: 1048
|
|
356
361
|
}, /*#__PURE__*/_react.default.createElement(_react.Fragment, null, /*#__PURE__*/_react.default.createElement("div", {
|
|
357
362
|
className: "search-header"
|
|
358
|
-
}, /*#__PURE__*/_react.default.createElement("span", null, title), /*#__PURE__*/_react.default.createElement("
|
|
359
|
-
|
|
360
|
-
className: "close",
|
|
361
|
-
"aria-label": "Close",
|
|
363
|
+
}, /*#__PURE__*/_react.default.createElement("span", null, title), /*#__PURE__*/_react.default.createElement("span", {
|
|
364
|
+
className: "dtable-font dtable-icon-x btn-close-row-detail",
|
|
362
365
|
onClick: this.toggle
|
|
363
|
-
}, /*#__PURE__*/_react.default.createElement("
|
|
364
|
-
"aria-hidden": "true"
|
|
365
|
-
}, "\xD7"))), /*#__PURE__*/_react.default.createElement("div", {
|
|
366
|
+
})), /*#__PURE__*/_react.default.createElement("div", {
|
|
366
367
|
className: "search-input-container"
|
|
367
368
|
}, /*#__PURE__*/_react.default.createElement("i", {
|
|
368
369
|
className: "header-search-icon dtable-font dtable-icon-search"
|
|
@@ -25,7 +25,10 @@ const ToolTip = _ref => {
|
|
|
25
25
|
title: '',
|
|
26
26
|
items: []
|
|
27
27
|
};
|
|
28
|
-
|
|
28
|
+
|
|
29
|
+
// use layout effect to measure tooltip size and adjust its position before the browser paints,
|
|
30
|
+
// to preventing a visible flicker
|
|
31
|
+
(0, _react.useLayoutEffect)(() => {
|
|
29
32
|
if (!toolTipPosition) {
|
|
30
33
|
setPosition({
|
|
31
34
|
offsetX: -9999,
|
|
@@ -33,7 +36,7 @@ const ToolTip = _ref => {
|
|
|
33
36
|
});
|
|
34
37
|
return;
|
|
35
38
|
}
|
|
36
|
-
if (chart && toolTipPosition) {
|
|
39
|
+
if (chart && toolTipPosition && tooltipRef.current) {
|
|
37
40
|
const width = Number(chart.node().getAttribute('width'));
|
|
38
41
|
const height = Number(chart.node().getAttribute('height'));
|
|
39
42
|
const {
|
|
@@ -48,12 +51,26 @@ const ToolTip = _ref => {
|
|
|
48
51
|
const insertPadding = 30;
|
|
49
52
|
let translateX = offsetX + distance;
|
|
50
53
|
let translateY = offsetY;
|
|
51
|
-
const
|
|
52
|
-
const
|
|
53
|
-
|
|
54
|
-
|
|
54
|
+
const minX = insertPadding;
|
|
55
|
+
const maxX = width - tooltipWidth - insertPadding;
|
|
56
|
+
const rightAvailableWidth = width - (offsetX + distance) - insertPadding;
|
|
57
|
+
const leftAvailableWidth = offsetX - distance - insertPadding;
|
|
58
|
+
const canShowOnRight = rightAvailableWidth >= tooltipWidth;
|
|
59
|
+
const canShowOnLeft = leftAvailableWidth >= tooltipWidth;
|
|
60
|
+
if (canShowOnRight) {
|
|
61
|
+
translateX = offsetX + distance;
|
|
62
|
+
} else if (canShowOnLeft) {
|
|
55
63
|
translateX = offsetX - distance - tooltipWidth - insertPadding;
|
|
64
|
+
} else {
|
|
65
|
+
// If neither side has enough space, choose the side with more space.
|
|
66
|
+
if (rightAvailableWidth >= leftAvailableWidth) {
|
|
67
|
+
translateX = offsetX + distance;
|
|
68
|
+
} else {
|
|
69
|
+
translateX = offsetX - distance - tooltipWidth - insertPadding;
|
|
70
|
+
}
|
|
71
|
+
translateX = Math.max(minX, Math.min(translateX, maxX));
|
|
56
72
|
}
|
|
73
|
+
const endOffsetY = offsetY + tooltipHeight + insertPadding;
|
|
57
74
|
// Bottom overflow
|
|
58
75
|
if (endOffsetY > height) {
|
|
59
76
|
translateY = offsetY - (endOffsetY - height);
|
|
@@ -63,13 +80,14 @@ const ToolTip = _ref => {
|
|
|
63
80
|
offsetY: translateY
|
|
64
81
|
});
|
|
65
82
|
}
|
|
66
|
-
}, [chart, toolTipPosition
|
|
83
|
+
}, [chart, toolTipPosition]);
|
|
67
84
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
68
85
|
ref: tooltipRef,
|
|
69
86
|
className: "sea-chart-d3-tooltip-container",
|
|
70
87
|
style: {
|
|
71
88
|
transform: "translate(".concat(position.offsetX, "px, ").concat(position.offsetY, "px)"),
|
|
72
|
-
|
|
89
|
+
visibility: position.offsetX === -9999 ? 'hidden' : 'visible',
|
|
90
|
+
opacity: position.offsetX === -9999 ? 0 : 1
|
|
73
91
|
}
|
|
74
92
|
}, title && /*#__PURE__*/_react.default.createElement("div", {
|
|
75
93
|
className: "sea-chart-d3-tooltip-title"
|
package/dist/editor/index.js
CHANGED
|
@@ -10,7 +10,11 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
10
10
|
var _view = _interopRequireWildcard(require("../view"));
|
|
11
11
|
var _settings = _interopRequireWildcard(require("../settings"));
|
|
12
12
|
require("./index.css");
|
|
13
|
-
function Editor(
|
|
13
|
+
function Editor() {
|
|
14
|
+
let props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {
|
|
15
|
+
...defaultProps,
|
|
16
|
+
...settingsDefaultProps
|
|
17
|
+
};
|
|
14
18
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
15
19
|
className: "sea-chart-editor"
|
|
16
20
|
}, /*#__PURE__*/_react.default.createElement(_view.default, props), /*#__PURE__*/_react.default.createElement(_settings.default, props, props.children));
|
package/dist/locale/lang/de.js
CHANGED
|
@@ -153,6 +153,7 @@ const de = {
|
|
|
153
153
|
"Execution_time_of_the_query_exceeds_the_limit": "Le temps d'exécution de la requête dépasse la limite. Les données ne peuvent pas être chargées.",
|
|
154
154
|
"There_are_some_problems_with_the_filters": "Die Filterbedingungen sind abnormal. Bitte setzen sie die Filterbedingungen in den Ansichtseinstellungen zurück.",
|
|
155
155
|
"Please_complete_the_chart_configuration_first": "Configure chart in element settings",
|
|
156
|
+
"The_chart_settings_are_invalid_please_contact_the_administrator_for_relevant_configurations": "The chart settings are invalid. Please contact the administrator for relevant configurations",
|
|
156
157
|
"Not_used": "Nicht verwendet",
|
|
157
158
|
"Select_field": "Feld auswählen",
|
|
158
159
|
"Display_total": "Gesamtwert anzeigen",
|
package/dist/locale/lang/en.js
CHANGED
|
@@ -153,6 +153,7 @@ const en = {
|
|
|
153
153
|
"Execution_time_of_the_query_exceeds_the_limit": "Execution time of the query exceeds the limit. Data cannot be loaded.",
|
|
154
154
|
"There_are_some_problems_with_the_filters": "There are some problems with the filters.",
|
|
155
155
|
"Please_complete_the_chart_configuration_first": "Configure chart in element settings",
|
|
156
|
+
"The_chart_settings_are_invalid_please_contact_the_administrator_for_relevant_configurations": "The chart settings are invalid. Please contact the administrator for relevant configurations",
|
|
156
157
|
"Not_used": "Not used",
|
|
157
158
|
"Select_field": "Select field",
|
|
158
159
|
"Display_total": "Display total",
|
package/dist/locale/lang/es.js
CHANGED
|
@@ -153,6 +153,7 @@ const es = {
|
|
|
153
153
|
"Execution_time_of_the_query_exceeds_the_limit": "Execution time of the query exceeds the limit. Data cannot be loaded.",
|
|
154
154
|
"There_are_some_problems_with_the_filters": "There are some problems with the filters.",
|
|
155
155
|
"Please_complete_the_chart_configuration_first": "Configure chart in element settings",
|
|
156
|
+
"The_chart_settings_are_invalid_please_contact_the_administrator_for_relevant_configurations": "The chart settings are invalid. Please contact the administrator for relevant configurations",
|
|
156
157
|
"Not_used": "Not used",
|
|
157
158
|
"Select_field": "Select field",
|
|
158
159
|
"Display_total": "Display total",
|
package/dist/locale/lang/fr.js
CHANGED
|
@@ -153,6 +153,7 @@ const fr = {
|
|
|
153
153
|
"Execution_time_of_the_query_exceeds_the_limit": "Le temps d'exécution de la requête dépasse la limite. Les données ne peuvent pas être chargées.",
|
|
154
154
|
"There_are_some_problems_with_the_filters": "Les conditions de filtrage sont anormales. Veuillez réinitialiser les conditions de filtrage dans les paramètres de vue.",
|
|
155
155
|
"Please_complete_the_chart_configuration_first": "Configure chart in element settings",
|
|
156
|
+
"The_chart_settings_are_invalid_please_contact_the_administrator_for_relevant_configurations": "The chart settings are invalid. Please contact the administrator for relevant configurations",
|
|
156
157
|
"Not_used": "Ne pas utilisé",
|
|
157
158
|
"Select_field": "Sélectionner un champ",
|
|
158
159
|
"Display_total": "Afficher le total",
|
package/dist/locale/lang/pt.js
CHANGED
|
@@ -153,6 +153,7 @@ const pt = {
|
|
|
153
153
|
"Execution_time_of_the_query_exceeds_the_limit": "Execution time of the query exceeds the limit. Data cannot be loaded.",
|
|
154
154
|
"There_are_some_problems_with_the_filters": "There are some problems with the filters.",
|
|
155
155
|
"Please_complete_the_chart_configuration_first": "Configure chart in element settings",
|
|
156
|
+
"The_chart_settings_are_invalid_please_contact_the_administrator_for_relevant_configurations": "The chart settings are invalid. Please contact the administrator for relevant configurations",
|
|
156
157
|
"Not_used": "Not used",
|
|
157
158
|
"Select_field": "Select field",
|
|
158
159
|
"Display_total": "Display total",
|
package/dist/locale/lang/ru.js
CHANGED
|
@@ -153,6 +153,7 @@ const ru = {
|
|
|
153
153
|
"Execution_time_of_the_query_exceeds_the_limit": "Execution time of the query exceeds the limit. Data cannot be loaded.",
|
|
154
154
|
"There_are_some_problems_with_the_filters": "There are some problems with the filters.",
|
|
155
155
|
"Please_complete_the_chart_configuration_first": "Configure chart in element settings",
|
|
156
|
+
"The_chart_settings_are_invalid_please_contact_the_administrator_for_relevant_configurations": "The chart settings are invalid. Please contact the administrator for relevant configurations",
|
|
156
157
|
"Not_used": "Not used",
|
|
157
158
|
"Select_field": "Select field",
|
|
158
159
|
"Display_total": "Display total",
|
|
@@ -153,6 +153,7 @@ const zh_CN = {
|
|
|
153
153
|
"Execution_time_of_the_query_exceeds_the_limit": "查询的执行时间超出限制。无法加载数据。",
|
|
154
154
|
"There_are_some_problems_with_the_filters": "过滤器有一些问题。",
|
|
155
155
|
"Please_complete_the_chart_configuration_first": "在元素设置中配置图表",
|
|
156
|
+
"The_chart_settings_are_invalid_please_contact_the_administrator_for_relevant_configurations": "图表设置无效,请联系管理员进行相关配置",
|
|
156
157
|
"Not_used": "不使用",
|
|
157
158
|
"Select_field": "选择字段",
|
|
158
159
|
"Display_total": "显示总计",
|
package/dist/model/funnel.js
CHANGED
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.default = void 0;
|
|
8
8
|
var _dtableUtils = require("dtable-utils");
|
|
9
|
-
var
|
|
9
|
+
var _lodash = require("lodash");
|
|
10
10
|
var _constants = require("../constants");
|
|
11
11
|
var _baseModel = _interopRequireDefault(require("./base-model"));
|
|
12
12
|
class Funnel extends _baseModel.default {
|
|
@@ -31,7 +31,7 @@ class Funnel extends _baseModel.default {
|
|
|
31
31
|
const table = tables.find(table => table._id === options.table_id);
|
|
32
32
|
const column = table.columns.find(column => column.key === options.x_axis_column_key);
|
|
33
33
|
if (column.type === _dtableUtils.CellType.SINGLE_SELECT) {
|
|
34
|
-
this.x_axis_option_list = (0,
|
|
34
|
+
this.x_axis_option_list = (0, _lodash.cloneDeep)(column.data.options);
|
|
35
35
|
} else {
|
|
36
36
|
this.x_axis_option_list = [];
|
|
37
37
|
}
|
package/dist/model/map-bubble.js
CHANGED
|
@@ -24,6 +24,10 @@ class MapBubble extends _baseModel.default {
|
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
26
|
this.geolocation_granularity = options.x_axis_geolocation_granularity;
|
|
27
|
+
this.map_level = options.map_level || _constants.MAP_LEVEL.COUNTRY;
|
|
28
|
+
this.map_location = options.map_location || {
|
|
29
|
+
province: _constants.regions[0].name
|
|
30
|
+
};
|
|
27
31
|
this.summary_type = options.y_axis_summary_type || 'count';
|
|
28
32
|
this.summary_method = options.y_axis_summary_method;
|
|
29
33
|
this.summary_column_key = options.y_axis_summary_column_key;
|
|
@@ -95,6 +95,9 @@ async function fetchMapJson(mapLevel, mapLocation, mediaUrl) {
|
|
|
95
95
|
let mapJson;
|
|
96
96
|
try {
|
|
97
97
|
const res = await fetch("".concat(mediaUrl, "dtable-statistic/geolocation/").concat(url, ".json"));
|
|
98
|
+
if (!res.ok) {
|
|
99
|
+
return null;
|
|
100
|
+
}
|
|
98
101
|
mapJson = await res.json();
|
|
99
102
|
} catch (error) {
|
|
100
103
|
console.error('on fetchMapJson: fetch error', error);
|
|
@@ -46,7 +46,7 @@ const DataSettings = _ref => {
|
|
|
46
46
|
update['x_axis_date_granularity'] = null;
|
|
47
47
|
update['x_axis_geolocation_granularity'] = null;
|
|
48
48
|
} else {
|
|
49
|
-
if (_dtableUtils.DATE_COLUMN_OPTIONS.includes(type) || (0, _columnUtils.
|
|
49
|
+
if (_dtableUtils.DATE_COLUMN_OPTIONS.includes(type) || (0, _columnUtils.isDateFormulaColumn)(column)) {
|
|
50
50
|
update['x_axis_date_granularity'] = _constants.CHART_SUMMARY_TYPE.MONTH;
|
|
51
51
|
update['x_axis_geolocation_granularity'] = null;
|
|
52
52
|
} else if (type === _dtableUtils.CellType.GEOLOCATION) {
|
|
@@ -59,7 +59,8 @@ const StyleSettings = _ref => {
|
|
|
59
59
|
goal_label
|
|
60
60
|
} = style_config || {};
|
|
61
61
|
const table = tables.find(table => table._id === table_id);
|
|
62
|
-
const
|
|
62
|
+
const columns = (table === null || table === void 0 ? void 0 : table.columns) || [];
|
|
63
|
+
const column = (0, _utils.getColumnByKey)(column_groupby_column_key, columns);
|
|
63
64
|
const isGroupBySingleSelectColumn = (column === null || column === void 0 ? void 0 : column.type) === _dtableUtils.CellType.SINGLE_SELECT;
|
|
64
65
|
const defaultColorTheme = _colorRules.SUPPORT_SINGLE_SELECT_THEMES_OPTIONS.DEFAULT;
|
|
65
66
|
const [currYaxisTitle, setCurrYaxisTitle] = (0, _react.useState)(title_name || '');
|
|
@@ -106,7 +107,7 @@ const StyleSettings = _ref => {
|
|
|
106
107
|
});
|
|
107
108
|
}, [chart, onChange]);
|
|
108
109
|
const onYAxisMinChange = (0, _react.useCallback)(min => {
|
|
109
|
-
const newMin =
|
|
110
|
+
const newMin = parseFloat(min);
|
|
110
111
|
if (Number.isNaN(newMin)) return;
|
|
111
112
|
const {
|
|
112
113
|
config
|
|
@@ -120,7 +121,7 @@ const StyleSettings = _ref => {
|
|
|
120
121
|
});
|
|
121
122
|
}, [chart, onChange]);
|
|
122
123
|
const onYAxisMaxChange = (0, _react.useCallback)(max => {
|
|
123
|
-
const newMax =
|
|
124
|
+
const newMax = parseFloat(max);
|
|
124
125
|
if (Number.isNaN(newMax)) return;
|
|
125
126
|
const {
|
|
126
127
|
config
|
|
@@ -46,7 +46,7 @@ const DataSettings = _ref => {
|
|
|
46
46
|
update['x_axis_date_granularity'] = null;
|
|
47
47
|
update['x_axis_geolocation_granularity'] = null;
|
|
48
48
|
} else {
|
|
49
|
-
if (_dtableUtils.DATE_COLUMN_OPTIONS.includes(type) || (0, _columnUtils.
|
|
49
|
+
if (_dtableUtils.DATE_COLUMN_OPTIONS.includes(type) || (0, _columnUtils.isDateFormulaColumn)(column)) {
|
|
50
50
|
update['x_axis_date_granularity'] = _constants.CHART_SUMMARY_TYPE.MONTH;
|
|
51
51
|
update['x_axis_geolocation_granularity'] = null;
|
|
52
52
|
} else if (type === _dtableUtils.CellType.GEOLOCATION) {
|