sea-chart 2.0.37 → 2.0.38
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 +20 -69
- package/dist/assets/css/sea-chart-d3-tooltip.css +0 -1
- package/dist/components/cell-factory/FormatterConfig.js +55 -62
- package/dist/components/cell-factory/SimpleCellFormatter.js +5 -12
- package/dist/components/cell-factory/SingleSelectOption.js +11 -18
- package/dist/components/cell-factory/cell-editor-factory.js +5 -12
- package/dist/components/cell-factory/cell-formatter-factory.js +4 -11
- package/dist/components/cell-factory/link-content.js +30 -38
- package/dist/components/chart-color-selector/color-selector.js +11 -18
- package/dist/components/collaborator/index.js +7 -14
- package/dist/components/color-picker/index.js +12 -19
- package/dist/components/color-popover/color-rules/color-rule.js +26 -34
- package/dist/components/color-popover/color-rules/index.js +7 -15
- package/dist/components/color-popover/color-rules/rule-filters/filter.js +27 -34
- package/dist/components/color-popover/color-rules/rule-filters/index.js +17 -25
- package/dist/components/color-popover/color-rules/rule-filters/number-input.js +9 -17
- package/dist/components/color-popover/color-rules-popover.js +31 -37
- package/dist/components/color-popover/color-selector-popover.js +12 -20
- package/dist/components/color-setting/color-group-selector.js +13 -21
- package/dist/components/common-add-tool/index.js +8 -15
- package/dist/components/data-process-setter/data-setting-header.js +7 -14
- package/dist/components/data-process-setter/hide-column-setter.js +13 -20
- package/dist/components/data-process-setter/index.js +4 -27
- package/dist/components/data-process-setter/sort-setter.js +18 -26
- package/dist/components/draggable/Draggable.js +7 -13
- package/dist/components/drill-down-settings/drill-down-fields-popover/index.js +41 -48
- package/dist/components/drill-down-settings/drill-down-fields-settings/index.js +10 -18
- package/dist/components/drill-down-settings/index.js +11 -18
- package/dist/components/dtable-popover/index.js +13 -20
- package/dist/components/dtable-search-input/index.js +13 -21
- package/dist/components/font-settings/index.js +14 -22
- package/dist/components/goal-line-setting/goal-setting-item.js +6 -14
- package/dist/components/goal-line-setting/index.js +12 -19
- package/dist/components/highlighter/highlighter.js +7 -14
- package/dist/components/icon/index.js +12 -23
- package/dist/components/index.js +7 -48
- package/dist/components/loading/index.js +6 -13
- package/dist/components/number-input/index.js +11 -24
- package/dist/components/pixel-editor/index.js +15 -23
- package/dist/components/popover/hide-column-popover/hide-column-popover-widgets/hide-column-item.js +13 -16
- package/dist/components/popover/hide-column-popover/hide-column-popover.css +5 -1
- package/dist/components/popover/hide-column-popover/hide-column-popover.js +28 -38
- package/dist/components/popover/sort-popover/sort-popover-widgets/sort-utils.js +9 -18
- package/dist/components/popover/sort-popover/sort-popover.js +58 -69
- package/dist/components/resize-handle/ResizeHandle.js +6 -13
- package/dist/components/row-card/row-card-header-cell.js +17 -24
- package/dist/components/row-card/row-card-header.js +15 -22
- package/dist/components/row-card/row-card-item.js +35 -43
- package/dist/components/row-card/row-card.js +17 -25
- package/dist/components/statistic-record-dialog/index.js +61 -68
- package/dist/components/tooltip/index.js +39 -28
- package/dist/components/types-dialog/index.js +62 -70
- package/dist/components/types-dialog/use-force-update.js +4 -10
- package/dist/constants/color-rules.js +8 -14
- package/dist/constants/common-constants.js +8 -14
- package/dist/constants/error.js +2 -8
- package/dist/constants/geolocation.js +9 -15
- package/dist/constants/index.js +142 -271
- package/dist/constants/key-codes.js +0 -2
- package/dist/constants/model.js +3 -9
- package/dist/constants/regions.js +3 -8
- package/dist/constants/style.js +6 -12
- package/dist/constants/table.js +1 -7
- package/dist/constants/type-image.js +33 -39
- package/dist/constants/type.js +3 -9
- package/dist/context.js +13 -20
- package/dist/editor/index.js +13 -16
- package/dist/index.js +13 -104
- package/dist/intl.js +10 -17
- package/dist/locale/index.js +16 -23
- package/dist/locale/lang/de.js +2 -7
- package/dist/locale/lang/en.js +2 -7
- package/dist/locale/lang/es.js +2 -7
- package/dist/locale/lang/fr.js +2 -7
- package/dist/locale/lang/pt.js +2 -7
- package/dist/locale/lang/ru.js +2 -7
- package/dist/locale/lang/zh_CN.js +2 -7
- package/dist/model/area-group.js +12 -19
- package/dist/model/area.js +12 -19
- package/dist/model/bar-custom.js +11 -18
- package/dist/model/bar-group.js +12 -19
- package/dist/model/bar-stack.js +10 -17
- package/dist/model/bar.js +11 -18
- package/dist/model/base-model.js +4 -11
- package/dist/model/basic-number-card.js +13 -20
- package/dist/model/chart.js +7 -13
- package/dist/model/combination.js +15 -22
- package/dist/model/compare-bar.js +14 -21
- package/dist/model/completeness-group.js +11 -18
- package/dist/model/completeness.js +10 -17
- package/dist/model/dashboard.js +7 -14
- package/dist/model/funnel.js +14 -21
- package/dist/model/generic-model.js +135 -143
- package/dist/model/heat-map.js +9 -16
- package/dist/model/horizontal-bar.js +11 -18
- package/dist/model/horizontal-group-bar.js +10 -17
- package/dist/model/index.js +69 -93
- package/dist/model/line-group.js +13 -20
- package/dist/model/line.js +12 -19
- package/dist/model/map-bubble.js +14 -17
- package/dist/model/map.js +12 -19
- package/dist/model/mirror.js +13 -20
- package/dist/model/pie.js +12 -19
- package/dist/model/ring.js +12 -19
- package/dist/model/scatter.js +10 -17
- package/dist/model/stacked-horizontal-bar.js +11 -18
- package/dist/model/table-element.js +5 -12
- package/dist/model/table.js +7 -14
- package/dist/model/tree-map.js +7 -14
- package/dist/model/trend.js +11 -18
- package/dist/model/user.js +1 -7
- package/dist/model/world-map-bubble.js +12 -19
- package/dist/model/world-map.js +12 -19
- package/dist/services/map-json.js +14 -17
- package/dist/settings/advance-bar-settings/data-settings.js +36 -44
- package/dist/settings/advance-bar-settings/index.js +3 -20
- package/dist/settings/advance-bar-settings/style-settings.js +66 -73
- package/dist/settings/bar-settings/data-settings.js +39 -47
- package/dist/settings/bar-settings/index.js +3 -20
- package/dist/settings/bar-settings/style-settings.js +51 -59
- package/dist/settings/basic-number-card/data-settings.js +50 -57
- package/dist/settings/basic-number-card/index.js +3 -20
- package/dist/settings/basic-number-card/style-settings.js +19 -27
- package/dist/settings/combination-settings/data-settings.js +55 -64
- package/dist/settings/combination-settings/index.js +3 -20
- package/dist/settings/combination-settings/style-settings.js +67 -75
- package/dist/settings/completeness-settings/callbacks/callbacks.js +16 -27
- package/dist/settings/completeness-settings/data-settings/completion-settings.js +21 -28
- package/dist/settings/completeness-settings/data-settings/data-settings.js +25 -32
- package/dist/settings/completeness-settings/index.js +3 -20
- package/dist/settings/completeness-settings/style-settings.js +19 -26
- package/dist/settings/dashboard-settings/data-settings.js +44 -51
- package/dist/settings/dashboard-settings/index.js +2 -13
- package/dist/settings/data-settings.js +72 -79
- package/dist/settings/funnel-settings/components/dnd-item/dnd-item.js +12 -19
- package/dist/settings/funnel-settings/components/dnd-list.js +15 -23
- package/dist/settings/funnel-settings/components/funnel-label-setting.js +32 -40
- package/dist/settings/funnel-settings/components/funnel-layer-setting.js +22 -30
- package/dist/settings/funnel-settings/data-settings.js +23 -31
- package/dist/settings/funnel-settings/index.js +3 -20
- package/dist/settings/funnel-settings/style-settings.js +11 -19
- package/dist/settings/heat-map-settings/data-settings.js +18 -26
- package/dist/settings/heat-map-settings/index.js +3 -20
- package/dist/settings/heat-map-settings/style-settings.js +18 -26
- package/dist/settings/horizontal-bar-settings/data-settings.js +12 -19
- package/dist/settings/horizontal-bar-settings/index.js +3 -20
- package/dist/settings/horizontal-bar-settings/style-settings.js +12 -19
- package/dist/settings/index.js +57 -70
- package/dist/settings/map-settings/components/location-field-selector.js +10 -17
- package/dist/settings/map-settings/components/map-level-selector.js +11 -18
- package/dist/settings/map-settings/components/map-province-city-selector.js +19 -26
- package/dist/settings/map-settings/index.js +3 -20
- package/dist/settings/map-settings/map-data-settings.js +23 -30
- package/dist/settings/map-settings/map-style-settings.js +27 -35
- package/dist/settings/mirror-settings/data-settings.js +26 -34
- package/dist/settings/mirror-settings/index.js +2 -13
- package/dist/settings/pie-settings/data-settings.js +33 -41
- package/dist/settings/pie-settings/index.js +3 -20
- package/dist/settings/pie-settings/style-settings.js +47 -55
- package/dist/settings/scatter/data-settings.js +27 -34
- package/dist/settings/scatter/index.js +3 -12
- package/dist/settings/stacks-settings/index.js +19 -27
- package/dist/settings/stacks-settings/stack-item-settings.js +19 -27
- package/dist/settings/style-settings.js +65 -73
- package/dist/settings/table-element-settings/components/data-filter.js +49 -58
- package/dist/settings/table-element-settings/data-settings.js +21 -29
- package/dist/settings/table-element-settings/index.css +1 -31
- package/dist/settings/table-element-settings/index.js +2 -13
- package/dist/settings/table-settings/data-settings.js +113 -120
- package/dist/settings/table-settings/index.js +2 -13
- package/dist/settings/time-comparison-settings/data-settings.js +43 -51
- package/dist/settings/time-comparison-settings/index.js +3 -20
- package/dist/settings/time-comparison-settings/style-settings.js +44 -52
- package/dist/settings/trend-settings/data-settings.js +24 -32
- package/dist/settings/trend-settings/index.js +3 -20
- package/dist/settings/trend-settings/style-setting.js +19 -27
- package/dist/settings/widgets/basic-summary/index.js +59 -66
- package/dist/settings/widgets/chart-type/index.js +18 -26
- package/dist/settings/widgets/color-settings/index.js +72 -80
- package/dist/settings/widgets/common-data-settings.js +27 -34
- package/dist/settings/widgets/data-filter/index.js +59 -59
- package/dist/settings/widgets/data-sort.js +16 -24
- package/dist/settings/widgets/date-summary-item.js +26 -34
- package/dist/settings/widgets/display-values-settings/index.js +14 -22
- package/dist/settings/widgets/divider/index.js +8 -16
- package/dist/settings/widgets/font-settings/font-color-settings.js +11 -19
- package/dist/settings/widgets/font-settings/font-size-settings.js +14 -22
- package/dist/settings/widgets/font-settings/font-weight-settings.js +17 -25
- package/dist/settings/widgets/font-settings/index.js +4 -27
- package/dist/settings/widgets/group-by.js +52 -59
- package/dist/settings/widgets/min-max-setting.js +10 -18
- package/dist/settings/widgets/mininum-slice-percent.js +10 -18
- package/dist/settings/widgets/numeric-summary-item.js +25 -33
- package/dist/settings/widgets/select-line-type/index.js +10 -17
- package/dist/settings/widgets/select-table/index.js +9 -16
- package/dist/settings/widgets/select-view/index.js +20 -28
- package/dist/settings/widgets/stack.js +14 -22
- package/dist/settings/widgets/summary-method-setting.js +17 -25
- package/dist/settings/widgets/summary-settings.js +75 -82
- package/dist/settings/widgets/switch/index.js +9 -16
- package/dist/settings/widgets/text-horizontal-settings.js +15 -23
- package/dist/settings/widgets/time-picker.js +29 -37
- package/dist/settings/widgets/title-settings/index.js +29 -37
- package/dist/settings/widgets/title-settings/title-text.js +5 -12
- package/dist/settings/widgets/x-axios.js +0 -1
- package/dist/settings/widgets/y-axis-group-settings.js +65 -72
- package/dist/utils/cell-format-utils.js +25 -33
- package/dist/utils/cell-value-utils.js +4 -11
- package/dist/utils/chart-utils/base-utils.js +467 -367
- package/dist/utils/chart-utils/index.js +29 -40
- package/dist/utils/chart-utils/original-data-utils/basic-chart-calculator.js +78 -85
- package/dist/utils/chart-utils/original-data-utils/card-calculator.js +20 -21
- package/dist/utils/chart-utils/original-data-utils/combination-calculator.js +45 -52
- package/dist/utils/chart-utils/original-data-utils/compare-bar-chart-calculator.js +21 -28
- package/dist/utils/chart-utils/original-data-utils/completeness-calculator.js +33 -40
- package/dist/utils/chart-utils/original-data-utils/dashboard-calculator.js +28 -26
- package/dist/utils/chart-utils/original-data-utils/index.js +50 -57
- package/dist/utils/chart-utils/original-data-utils/mirror-calculator.js +19 -26
- package/dist/utils/chart-utils/original-data-utils/pivot-table-calculator.js +94 -97
- package/dist/utils/chart-utils/original-data-utils/scatter-calculator.js +19 -25
- package/dist/utils/chart-utils/original-data-utils/trend-calculator.js +50 -36
- package/dist/utils/chart-utils/sql-statistics-utils.js +385 -388
- package/dist/utils/chart.js +9 -17
- package/dist/utils/collaborator-manager.js +3 -9
- package/dist/utils/collaborator-utils.js +19 -31
- package/dist/utils/collaborator.js +6 -15
- package/dist/utils/color-utils.js +18 -29
- package/dist/utils/column-utils.js +88 -102
- package/dist/utils/common-utils.js +28 -53
- package/dist/utils/concurrency-manager.js +1 -7
- package/dist/utils/contexts.js +7 -11
- package/dist/utils/date-translate.js +12 -20
- package/dist/utils/digital-sign-utils.js +7 -14
- package/dist/utils/event-bus.js +1 -7
- package/dist/utils/hotkey.js +5 -11
- package/dist/utils/index.js +73 -219
- package/dist/utils/key-generator.js +2 -9
- package/dist/utils/map.js +22 -31
- package/dist/utils/object-utils.js +2 -8
- package/dist/utils/options-utils.js +10 -18
- package/dist/utils/row-record-utils.js +251 -183
- package/dist/utils/row-utils.js +27 -38
- package/dist/utils/search.js +24 -32
- package/dist/utils/sql/chart-data-sql.js +106 -112
- package/dist/utils/sql/column-2-sql-column.js +162 -172
- package/dist/utils/sql/index.js +3 -27
- package/dist/utils/trend-utils.js +50 -45
- package/dist/view/index.css +2 -8
- package/dist/view/index.js +102 -103
- package/dist/view/title/index.js +16 -24
- package/dist/view/wrapper/area-group.js +57 -57
- package/dist/view/wrapper/area.js +43 -51
- package/dist/view/wrapper/bar-compare.js +56 -48
- package/dist/view/wrapper/bar-custom-stack.js +73 -55
- package/dist/view/wrapper/bar-group.js +94 -73
- package/dist/view/wrapper/bar-stack.js +49 -57
- package/dist/view/wrapper/bar.js +40 -48
- package/dist/view/wrapper/basic-number-card.js +50 -34
- package/dist/view/wrapper/chart-component.js +164 -569
- package/dist/view/wrapper/combination.js +55 -63
- package/dist/view/wrapper/completeness-group.js +140 -93
- package/dist/view/wrapper/completeness.js +36 -44
- package/dist/view/wrapper/dashboard.js +104 -59
- package/dist/view/wrapper/funnel.js +40 -43
- package/dist/view/wrapper/heat-map.js +62 -70
- package/dist/view/wrapper/horizontal-bar-group.js +70 -58
- package/dist/view/wrapper/horizontal-bar-stack.js +48 -56
- package/dist/view/wrapper/horizontal-bar.js +41 -49
- package/dist/view/wrapper/index.js +107 -115
- package/dist/view/wrapper/line-group.js +49 -52
- package/dist/view/wrapper/line.js +42 -50
- package/dist/view/wrapper/map-bubble.js +40 -48
- package/dist/view/wrapper/map-world-bubble.js +40 -47
- package/dist/view/wrapper/map-world.js +42 -49
- package/dist/view/wrapper/map.js +42 -50
- package/dist/view/wrapper/mirror.js +41 -49
- package/dist/view/wrapper/pie.js +45 -53
- package/dist/view/wrapper/ring.js +50 -58
- package/dist/view/wrapper/scatter.js +50 -56
- package/dist/view/wrapper/table/index.js +14 -22
- package/dist/view/wrapper/table/one-dimension-table-no-numeric-columns.js +49 -57
- package/dist/view/wrapper/table/one-dimension-table-with-numeric-columns.js +53 -61
- package/dist/view/wrapper/table/pivot-table-display-name.js +82 -90
- package/dist/view/wrapper/table/two-dimension-table.js +85 -92
- package/dist/view/wrapper/table-element/components/dataset-utils.js +23 -36
- package/dist/view/wrapper/table-element/components/formatter.js +90 -99
- package/dist/view/wrapper/table-element/components/formatters/FileFormatter/index.js +23 -32
- package/dist/view/wrapper/table-element/components/formatters/formula-formatter.js +9 -16
- package/dist/view/wrapper/table-element/components/formatters/link-formatter.js +90 -97
- package/dist/view/wrapper/table-element/components/formula-formatter.js +9 -16
- package/dist/view/wrapper/table-element/components/link-formatter.js +90 -97
- package/dist/view/wrapper/table-element/components/record.js +13 -20
- package/dist/view/wrapper/table-element/components/records-body.js +9 -17
- package/dist/view/wrapper/table-element/components/records-header/index.js +7 -16
- package/dist/view/wrapper/table-element/components/records-header/records-header-cell.js +8 -16
- package/dist/view/wrapper/table-element/components/records.js +25 -33
- package/dist/view/wrapper/table-element/components/resize-column-handle/resize-column-handle.js +8 -13
- package/dist/view/wrapper/table-element/components/utils.js +6 -16
- package/dist/view/wrapper/table-element/components/value-display-utils.js +4 -11
- package/dist/view/wrapper/table-element/components/vertical-scrollbar/index.js +6 -13
- package/dist/view/wrapper/table-element/index.js +30 -43
- package/dist/view/wrapper/treemap.js +38 -46
- package/dist/view/wrapper/trend.js +80 -65
- package/package.json +15 -12
|
@@ -1,14 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.default = void 0;
|
|
8
|
-
var _DTableSwitch2 = _interopRequireDefault(require("dtable-ui-component/lib/DTableSwitch"));
|
|
9
|
-
var _react = _interopRequireDefault(require("react"));
|
|
10
|
-
var _classnames = _interopRequireDefault(require("classnames"));
|
|
11
|
-
require("./index.css");
|
|
1
|
+
import _DTableSwitch from "dtable-ui-component/lib/DTableSwitch";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import classnames from 'classnames';
|
|
4
|
+
import './index.css';
|
|
12
5
|
const Switch = _ref => {
|
|
13
6
|
let {
|
|
14
7
|
checked,
|
|
@@ -17,10 +10,10 @@ const Switch = _ref => {
|
|
|
17
10
|
disabled,
|
|
18
11
|
onChange
|
|
19
12
|
} = _ref;
|
|
20
|
-
return /*#__PURE__*/
|
|
21
|
-
className: (
|
|
22
|
-
}, /*#__PURE__*/
|
|
23
|
-
key:
|
|
13
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
14
|
+
className: classnames('sea-chart-parameter-container', className)
|
|
15
|
+
}, /*#__PURE__*/React.createElement(_DTableSwitch, {
|
|
16
|
+
key: `custom-switch-checkbox-${checked}`,
|
|
24
17
|
checked: checked,
|
|
25
18
|
disabled: disabled,
|
|
26
19
|
switchClassName: "sea-chart-toggle-parameter",
|
|
@@ -28,4 +21,4 @@ const Switch = _ref => {
|
|
|
28
21
|
onChange: onChange
|
|
29
22
|
}));
|
|
30
23
|
};
|
|
31
|
-
|
|
24
|
+
export default Switch;
|
|
@@ -1,17 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
});
|
|
8
|
-
exports.default = void 0;
|
|
9
|
-
var _DTableRadioGroup2 = _interopRequireDefault(require("dtable-ui-component/lib/DTableRadioGroup"));
|
|
10
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
11
|
-
var _reactstrap = require("reactstrap");
|
|
12
|
-
var _classnames = _interopRequireDefault(require("classnames"));
|
|
13
|
-
var _constants = require("../../constants");
|
|
14
|
-
var _intl = _interopRequireDefault(require("../../intl"));
|
|
1
|
+
import _DTableRadioGroup from "dtable-ui-component/lib/DTableRadioGroup";
|
|
2
|
+
import React, { useCallback } from 'react';
|
|
3
|
+
import { Row, Label } from 'reactstrap';
|
|
4
|
+
import classnames from 'classnames';
|
|
5
|
+
import { HORIZONTAL_ALIGNS, HORIZONTAL_ALIGN_SHOW } from '../../constants';
|
|
6
|
+
import intl from '../../intl';
|
|
15
7
|
const TextHorizontalSettings = _ref => {
|
|
16
8
|
let {
|
|
17
9
|
defaultValue,
|
|
@@ -19,25 +11,25 @@ const TextHorizontalSettings = _ref => {
|
|
|
19
11
|
onChange,
|
|
20
12
|
className
|
|
21
13
|
} = _ref;
|
|
22
|
-
const validValue = value || defaultValue ||
|
|
23
|
-
const onHorizontalChanged =
|
|
14
|
+
const validValue = value || defaultValue || HORIZONTAL_ALIGNS[0];
|
|
15
|
+
const onHorizontalChanged = useCallback(value => {
|
|
24
16
|
onChange && onChange(value);
|
|
25
17
|
}, [onChange]);
|
|
26
18
|
const getOptionsDisplay = () => {
|
|
27
|
-
return
|
|
19
|
+
return HORIZONTAL_ALIGNS.reduce((optionDisplayMap, align) => {
|
|
28
20
|
return {
|
|
29
21
|
...optionDisplayMap,
|
|
30
|
-
[align]:
|
|
22
|
+
[align]: intl.get(HORIZONTAL_ALIGN_SHOW[align])
|
|
31
23
|
};
|
|
32
24
|
}, {});
|
|
33
25
|
};
|
|
34
|
-
return /*#__PURE__*/
|
|
35
|
-
className: (
|
|
36
|
-
}, /*#__PURE__*/
|
|
26
|
+
return /*#__PURE__*/React.createElement(Row, {
|
|
27
|
+
className: classnames('mt-0 mb-4 ml-0 mr-0 settings-text-horizontal-align sea-chart-select-group', className)
|
|
28
|
+
}, /*#__PURE__*/React.createElement(Label, null, intl.get('Text_horizontal_alignment')), /*#__PURE__*/React.createElement(_DTableRadioGroup, {
|
|
37
29
|
activeOption: validValue,
|
|
38
|
-
options:
|
|
30
|
+
options: HORIZONTAL_ALIGNS,
|
|
39
31
|
optionsDisplay: getOptionsDisplay(),
|
|
40
32
|
onSelectChanged: onHorizontalChanged
|
|
41
33
|
}));
|
|
42
34
|
};
|
|
43
|
-
|
|
35
|
+
export default TextHorizontalSettings;
|
|
@@ -1,31 +1,23 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
var _Picker = _interopRequireDefault(require("@seafile/seafile-calendar/lib/Picker"));
|
|
13
|
-
require("dayjs/locale/zh-cn");
|
|
14
|
-
require("dayjs/locale/en-gb");
|
|
15
|
-
var _utils = require("../../utils");
|
|
16
|
-
var _intl = _interopRequireDefault(require("../../intl"));
|
|
17
|
-
var _context = _interopRequireDefault(require("../../context"));
|
|
18
|
-
require("@seafile/seafile-calendar/assets/index.css");
|
|
19
|
-
let now = (0, _dayjs.default)();
|
|
1
|
+
import React, { Component } from 'react';
|
|
2
|
+
import dayjs from 'dayjs';
|
|
3
|
+
import Calendar from '@seafile/seafile-calendar';
|
|
4
|
+
import DatePicker from '@seafile/seafile-calendar/lib/Picker';
|
|
5
|
+
import 'dayjs/locale/zh-cn';
|
|
6
|
+
import 'dayjs/locale/en-gb';
|
|
7
|
+
import { translateCalendar } from '../../utils';
|
|
8
|
+
import intl from '../../intl';
|
|
9
|
+
import context from '../../context';
|
|
10
|
+
import '@seafile/seafile-calendar/assets/index.css';
|
|
11
|
+
let now = dayjs();
|
|
20
12
|
const DATE_FORMAT = 'YYYY-MM-DD';
|
|
21
|
-
class TimePicker extends
|
|
13
|
+
class TimePicker extends Component {
|
|
22
14
|
constructor(props) {
|
|
23
15
|
super(props);
|
|
24
16
|
this.getDefaultMinutesTime = () => {
|
|
25
17
|
const {
|
|
26
18
|
value
|
|
27
19
|
} = this.props;
|
|
28
|
-
if (value) return (
|
|
20
|
+
if (value) return dayjs(value).format('HH:mm');
|
|
29
21
|
return '';
|
|
30
22
|
};
|
|
31
23
|
this.getCalendarContainer = () => {
|
|
@@ -81,24 +73,24 @@ class TimePicker extends _react.Component {
|
|
|
81
73
|
open: false,
|
|
82
74
|
value: null
|
|
83
75
|
};
|
|
84
|
-
this.calendarContainerRef =
|
|
76
|
+
this.calendarContainerRef = React.createRef();
|
|
85
77
|
this.defaultCalendarValue = null;
|
|
86
78
|
}
|
|
87
79
|
componentDidMount() {
|
|
88
80
|
const {
|
|
89
81
|
value
|
|
90
82
|
} = this.props;
|
|
91
|
-
const iszhcn =
|
|
83
|
+
const iszhcn = context.getSetting('lang') === 'zh-cn';
|
|
92
84
|
if (iszhcn) {
|
|
93
85
|
now = now.locale('zh-cn');
|
|
94
86
|
} else {
|
|
95
87
|
now = now.locale('en-gb');
|
|
96
88
|
}
|
|
97
89
|
this.defaultCalendarValue = now.clone();
|
|
98
|
-
if (value && (
|
|
99
|
-
let validValue = (
|
|
90
|
+
if (value && dayjs(value).isValid()) {
|
|
91
|
+
let validValue = dayjs(value).isValid() ? dayjs(value) : dayjs(this.defaultCalendarValue);
|
|
100
92
|
this.setState({
|
|
101
|
-
value: iszhcn ? (
|
|
93
|
+
value: iszhcn ? dayjs(validValue).locale('zh-cn') : dayjs(validValue).locale('en-gb')
|
|
102
94
|
});
|
|
103
95
|
}
|
|
104
96
|
}
|
|
@@ -111,7 +103,7 @@ class TimePicker extends _react.Component {
|
|
|
111
103
|
open
|
|
112
104
|
} = this.state;
|
|
113
105
|
const minutesTime = this.getDefaultMinutesTime();
|
|
114
|
-
if (isReadOnly) return /*#__PURE__*/
|
|
106
|
+
if (isReadOnly) return /*#__PURE__*/React.createElement("input", {
|
|
115
107
|
className: "ant-calendar-picker-input ant-input form-control",
|
|
116
108
|
value: value && value.format(DATE_FORMAT) || '',
|
|
117
109
|
disabled: true
|
|
@@ -124,17 +116,17 @@ class TimePicker extends _react.Component {
|
|
|
124
116
|
fontSize: '12px',
|
|
125
117
|
cursor: 'pointer'
|
|
126
118
|
};
|
|
127
|
-
const clearIcon =
|
|
119
|
+
const clearIcon = React.createElement('i', {
|
|
128
120
|
className: 'item-icon dtable-font dtable-icon-x',
|
|
129
121
|
style: clearStyle
|
|
130
122
|
});
|
|
131
|
-
const calendar = /*#__PURE__*/
|
|
123
|
+
const calendar = /*#__PURE__*/React.createElement(Calendar, {
|
|
132
124
|
className: "dtable-rc-calendar",
|
|
133
|
-
locale:
|
|
125
|
+
locale: translateCalendar(),
|
|
134
126
|
style: {
|
|
135
127
|
zIndex: 1001
|
|
136
128
|
},
|
|
137
|
-
dateInputPlaceholder:
|
|
129
|
+
dateInputPlaceholder: intl.get('Please_input_date'),
|
|
138
130
|
format: DATE_FORMAT,
|
|
139
131
|
defaultValue: this.defaultCalendarValue,
|
|
140
132
|
showDateInput: true,
|
|
@@ -145,10 +137,10 @@ class TimePicker extends _react.Component {
|
|
|
145
137
|
defaultMinutesTime: minutesTime,
|
|
146
138
|
onClickRightPanelTime: this.onClickRightPanelTime
|
|
147
139
|
});
|
|
148
|
-
return /*#__PURE__*/
|
|
140
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
149
141
|
className: "sea-chart-date-picker-container",
|
|
150
142
|
ref: ref => this.datePicker = ref
|
|
151
|
-
}, /*#__PURE__*/
|
|
143
|
+
}, /*#__PURE__*/React.createElement(DatePicker, {
|
|
152
144
|
calendar: calendar,
|
|
153
145
|
value: value,
|
|
154
146
|
onChange: this.onChange,
|
|
@@ -162,19 +154,19 @@ class TimePicker extends _react.Component {
|
|
|
162
154
|
let {
|
|
163
155
|
value
|
|
164
156
|
} = _ref;
|
|
165
|
-
return /*#__PURE__*/
|
|
157
|
+
return /*#__PURE__*/React.createElement("span", {
|
|
166
158
|
tabIndex: "0",
|
|
167
159
|
onFocus: this.onReadOnlyFocus
|
|
168
|
-
}, /*#__PURE__*/
|
|
160
|
+
}, /*#__PURE__*/React.createElement("input", {
|
|
169
161
|
tabIndex: "-1",
|
|
170
162
|
onChange: () => {},
|
|
171
163
|
className: "ant-calendar-picker-input ant-input form-control",
|
|
172
164
|
value: value && value.format(DATE_FORMAT) || '',
|
|
173
165
|
onMouseDown: this.handleMouseDown
|
|
174
|
-
}), /*#__PURE__*/
|
|
166
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
175
167
|
ref: this.calendarContainerRef
|
|
176
168
|
}));
|
|
177
169
|
}));
|
|
178
170
|
}
|
|
179
171
|
}
|
|
180
|
-
|
|
172
|
+
export default TimePicker;
|
|
@@ -1,28 +1,20 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
11
|
-
var _reactstrap = require("reactstrap");
|
|
12
|
-
var _contexts = require("../../../utils/contexts");
|
|
13
|
-
var _fontSettings = require("../font-settings");
|
|
14
|
-
var _textHorizontalSettings = _interopRequireDefault(require("../text-horizontal-settings"));
|
|
15
|
-
var _constants = require("../../../constants");
|
|
16
|
-
var _intl = _interopRequireDefault(require("../../../intl"));
|
|
17
|
-
var _titleText = _interopRequireDefault(require("./title-text"));
|
|
1
|
+
import _CollapsibleSettingLayout from "dtable-ui-component/lib/CollapsibleSettingLayout";
|
|
2
|
+
import React, { useMemo, useContext } from 'react';
|
|
3
|
+
import { Label } from 'reactstrap';
|
|
4
|
+
import { GlobalThemeContext, settingsContext } from '../../../utils/contexts';
|
|
5
|
+
import { FontSizeSettings, FontWeightSettings, FontColorSettings } from '../font-settings';
|
|
6
|
+
import TextHorizontalSettings from '../text-horizontal-settings';
|
|
7
|
+
import { DEFAULT_CHART_FONT_WEIGHT, DEFAULT_CHART_TITLE_FONT_SIZE, CHART_SUPPORT_FONT_WEIGHTS, HORIZONTAL_ALIGN, DEFAULT_TREND_CHART_TITLE_FONT_SIZE, CHART_TYPE, TITLE_FONT_COLOR_MAP, DEFAULT_CHART_TITLE_FONT_COLOR_LIGHT } from '../../../constants';
|
|
8
|
+
import intl from '../../../intl';
|
|
9
|
+
import TitleText from './title-text';
|
|
18
10
|
const TitleSetting = props => {
|
|
19
11
|
const {
|
|
20
12
|
hideTitleStyleSetting
|
|
21
|
-
} =
|
|
13
|
+
} = useContext(settingsContext);
|
|
22
14
|
const {
|
|
23
15
|
globalTheme
|
|
24
|
-
} =
|
|
25
|
-
const initialTitle =
|
|
16
|
+
} = useContext(GlobalThemeContext);
|
|
17
|
+
const initialTitle = useMemo(() => {
|
|
26
18
|
return props.title || {};
|
|
27
19
|
}, [props.title]);
|
|
28
20
|
const modifyTitle = updated => {
|
|
@@ -63,45 +55,45 @@ const TitleSetting = props => {
|
|
|
63
55
|
font_color: updatedFontColor
|
|
64
56
|
});
|
|
65
57
|
};
|
|
66
|
-
const isCard = props.type ===
|
|
58
|
+
const isCard = props.type === CHART_TYPE.TREND || props.type === CHART_TYPE.BASIC_NUMBER_CARD;
|
|
67
59
|
|
|
68
60
|
// if no text then set trend default font size to 16 and font_weight to 400
|
|
69
61
|
if (isCard && !initialTitle.text) {
|
|
70
|
-
initialTitle.font_weight =
|
|
71
|
-
initialTitle.font_size =
|
|
62
|
+
initialTitle.font_weight = CHART_SUPPORT_FONT_WEIGHTS[0];
|
|
63
|
+
initialTitle.font_size = DEFAULT_TREND_CHART_TITLE_FONT_SIZE;
|
|
72
64
|
}
|
|
73
65
|
const getChildren = () => {
|
|
74
|
-
return /*#__PURE__*/
|
|
66
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(TitleText, {
|
|
75
67
|
text: initialTitle.text,
|
|
76
68
|
modifyText: modifyText
|
|
77
|
-
}), /*#__PURE__*/
|
|
69
|
+
}), /*#__PURE__*/React.createElement(FontSizeSettings, {
|
|
78
70
|
className: 'mt-3',
|
|
79
71
|
fontSize: initialTitle.font_size,
|
|
80
|
-
defaultFontSize: isCard ?
|
|
72
|
+
defaultFontSize: isCard ? DEFAULT_TREND_CHART_TITLE_FONT_SIZE : DEFAULT_CHART_TITLE_FONT_SIZE,
|
|
81
73
|
modifyFontSize: modifyFontSize
|
|
82
|
-
}), /*#__PURE__*/
|
|
74
|
+
}), /*#__PURE__*/React.createElement(FontWeightSettings, {
|
|
83
75
|
className: 'mt-3',
|
|
84
|
-
fontWeight: initialTitle.font_weight ||
|
|
85
|
-
supportFontWeights:
|
|
76
|
+
fontWeight: initialTitle.font_weight || DEFAULT_CHART_FONT_WEIGHT,
|
|
77
|
+
supportFontWeights: CHART_SUPPORT_FONT_WEIGHTS,
|
|
86
78
|
modifyFontWeight: modifyFontWeight
|
|
87
|
-
}), /*#__PURE__*/
|
|
79
|
+
}), /*#__PURE__*/React.createElement(FontColorSettings, {
|
|
88
80
|
className: 'mt-3',
|
|
89
81
|
fontColor: initialTitle.font_color,
|
|
90
|
-
defaultFontColor:
|
|
82
|
+
defaultFontColor: TITLE_FONT_COLOR_MAP[globalTheme] || DEFAULT_CHART_TITLE_FONT_COLOR_LIGHT,
|
|
91
83
|
modifyFontColor: modifyFontColor
|
|
92
|
-
}), /*#__PURE__*/
|
|
84
|
+
}), /*#__PURE__*/React.createElement(TextHorizontalSettings, {
|
|
93
85
|
className: 'mt-3',
|
|
94
86
|
value: initialTitle.horizontal_align,
|
|
95
|
-
defaultValue:
|
|
87
|
+
defaultValue: HORIZONTAL_ALIGN.LEFT,
|
|
96
88
|
onChange: modifyHorizontalAlign
|
|
97
89
|
}));
|
|
98
90
|
};
|
|
99
|
-
return /*#__PURE__*/
|
|
91
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, hideTitleStyleSetting && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Label, null, intl.get('Title')), /*#__PURE__*/React.createElement(TitleText, {
|
|
100
92
|
text: initialTitle.text,
|
|
101
93
|
modifyText: modifyText
|
|
102
|
-
})), !hideTitleStyleSetting && /*#__PURE__*/
|
|
103
|
-
title:
|
|
94
|
+
})), !hideTitleStyleSetting && /*#__PURE__*/React.createElement(_CollapsibleSettingLayout, {
|
|
95
|
+
title: intl.get('Title'),
|
|
104
96
|
children: getChildren()
|
|
105
97
|
}));
|
|
106
98
|
};
|
|
107
|
-
|
|
99
|
+
export default TitleSetting;
|
|
@@ -1,14 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.default = void 0;
|
|
8
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
-
var _reactstrap = require("reactstrap");
|
|
1
|
+
import React, { useState } from 'react';
|
|
2
|
+
import { Input } from 'reactstrap';
|
|
10
3
|
const TitleText = props => {
|
|
11
|
-
const [currText, setCurrText] =
|
|
4
|
+
const [currText, setCurrText] = useState(props.text || '');
|
|
12
5
|
const onKeyDown = event => {
|
|
13
6
|
if (event.key === 'Enter') {
|
|
14
7
|
event.preventDefault();
|
|
@@ -18,7 +11,7 @@ const TitleText = props => {
|
|
|
18
11
|
const onSaveText = () => {
|
|
19
12
|
props.modifyText(currText);
|
|
20
13
|
};
|
|
21
|
-
return /*#__PURE__*/
|
|
14
|
+
return /*#__PURE__*/React.createElement(Input, {
|
|
22
15
|
type: "text",
|
|
23
16
|
value: currText,
|
|
24
17
|
onBlur: onSaveText,
|
|
@@ -26,4 +19,4 @@ const TitleText = props => {
|
|
|
26
19
|
onKeyDown: onKeyDown
|
|
27
20
|
});
|
|
28
21
|
};
|
|
29
|
-
|
|
22
|
+
export default TitleText;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";
|