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,16 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
exports.default = DrillDownSettings;
|
|
8
|
-
var _CollapsibleSettingLayout2 = _interopRequireDefault(require("dtable-ui-component/lib/CollapsibleSettingLayout"));
|
|
9
|
-
var _DTableSwitch2 = _interopRequireDefault(require("dtable-ui-component/lib/DTableSwitch"));
|
|
10
|
-
var _react = _interopRequireDefault(require("react"));
|
|
11
|
-
var _intl = _interopRequireDefault(require("../../intl"));
|
|
12
|
-
var _drillDownFieldsSettings = _interopRequireDefault(require("./drill-down-fields-settings"));
|
|
13
|
-
function DrillDownSettings(_ref) {
|
|
1
|
+
import _CollapsibleSettingLayout from "dtable-ui-component/lib/CollapsibleSettingLayout";
|
|
2
|
+
import _DTableSwitch from "dtable-ui-component/lib/DTableSwitch";
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import intl from '../../intl';
|
|
5
|
+
import DrillDownFieldSettings from './drill-down-fields-settings';
|
|
6
|
+
export default function DrillDownSettings(_ref) {
|
|
14
7
|
let {
|
|
15
8
|
columns,
|
|
16
9
|
drillDownStatus,
|
|
@@ -18,13 +11,13 @@ function DrillDownSettings(_ref) {
|
|
|
18
11
|
drillDownFields,
|
|
19
12
|
setDrillDownFields
|
|
20
13
|
} = _ref;
|
|
21
|
-
return /*#__PURE__*/
|
|
22
|
-
title:
|
|
23
|
-
}, /*#__PURE__*/
|
|
14
|
+
return /*#__PURE__*/React.createElement(_CollapsibleSettingLayout, {
|
|
15
|
+
title: intl.get('Drill_down_settings')
|
|
16
|
+
}, /*#__PURE__*/React.createElement(_DTableSwitch, {
|
|
24
17
|
onChange: toggleDrillDownStatus,
|
|
25
18
|
checked: drillDownStatus,
|
|
26
|
-
placeholder:
|
|
27
|
-
}), drillDownStatus && /*#__PURE__*/
|
|
19
|
+
placeholder: intl.get('Enable_drill_down_feature')
|
|
20
|
+
}), drillDownStatus && /*#__PURE__*/React.createElement(DrillDownFieldSettings, {
|
|
28
21
|
columns: columns,
|
|
29
22
|
drillDownFields: drillDownFields,
|
|
30
23
|
setDrillDownFields: setDrillDownFields
|
|
@@ -1,16 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
exports.default = void 0;
|
|
8
|
-
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
var _reactstrap = require("reactstrap");
|
|
10
|
-
var _commonConstants = require("../../constants/common-constants");
|
|
11
|
-
var _keyCodes = _interopRequireDefault(require("../../constants/key-codes.js"));
|
|
12
|
-
var _commonUtils = require("../../utils/common-utils");
|
|
13
|
-
class DTablePopover extends _react.default.Component {
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Popover } from 'reactstrap';
|
|
3
|
+
import { CommonEventTypes } from '../../constants/common-constants';
|
|
4
|
+
import KeyCodes from '../../constants/key-codes.js';
|
|
5
|
+
import { getEventClassName } from '../../utils/common-utils';
|
|
6
|
+
class DTablePopover extends React.Component {
|
|
14
7
|
constructor() {
|
|
15
8
|
super(...arguments);
|
|
16
9
|
this.dtablePopoverRef = null;
|
|
@@ -24,10 +17,10 @@ class DTablePopover extends _react.default.Component {
|
|
|
24
17
|
canHideDTablePopover,
|
|
25
18
|
hideDTablePopoverWithEsc
|
|
26
19
|
} = this.props;
|
|
27
|
-
if (e.keyCode ===
|
|
20
|
+
if (e.keyCode === KeyCodes.Escape && typeof hideDTablePopoverWithEsc === 'function' && !this.isSelectOpen) {
|
|
28
21
|
e.preventDefault();
|
|
29
22
|
hideDTablePopoverWithEsc();
|
|
30
|
-
} else if (e.keyCode ===
|
|
23
|
+
} else if (e.keyCode === KeyCodes.Enter) {
|
|
31
24
|
// Resolve the default behavior of the enter key when entering formulas is blocked
|
|
32
25
|
if (canHideDTablePopover) return;
|
|
33
26
|
e.stopImmediatePropagation();
|
|
@@ -41,7 +34,7 @@ class DTablePopover extends _react.default.Component {
|
|
|
41
34
|
canHideDTablePopover
|
|
42
35
|
} = this.props;
|
|
43
36
|
if (!canHideDTablePopover) return;
|
|
44
|
-
if (this.dtablePopoverRef && e &&
|
|
37
|
+
if (this.dtablePopoverRef && e && getEventClassName(e).indexOf('popover') === -1 && !this.dtablePopoverRef.contains(e.target)) {
|
|
45
38
|
this.props.hideDTablePopover(e);
|
|
46
39
|
}
|
|
47
40
|
};
|
|
@@ -54,7 +47,7 @@ class DTablePopover extends _react.default.Component {
|
|
|
54
47
|
document.addEventListener('mousedown', this.onMouseDown);
|
|
55
48
|
document.addEventListener('keydown', this.onKeyDown);
|
|
56
49
|
window.addEventListener('popstate', this.onHistoryState);
|
|
57
|
-
this.unsubscribeOpenSelect = (_window = window) === null || _window === void 0 ? void 0 : (_window$app = _window.app) === null || _window$app === void 0 ? void 0 : (_window$app$eventBus = _window$app.eventBus) === null || _window$app$eventBus === void 0 ? void 0 : _window$app$eventBus.subscribe(
|
|
50
|
+
this.unsubscribeOpenSelect = (_window = window) === null || _window === void 0 ? void 0 : (_window$app = _window.app) === null || _window$app === void 0 ? void 0 : (_window$app$eventBus = _window$app.eventBus) === null || _window$app$eventBus === void 0 ? void 0 : _window$app$eventBus.subscribe(CommonEventTypes.OPEN_SELECT, this.setSelectStatus);
|
|
58
51
|
}
|
|
59
52
|
componentWillUnmount() {
|
|
60
53
|
document.removeEventListener('mousedown', this.onMouseDown);
|
|
@@ -76,7 +69,7 @@ class DTablePopover extends _react.default.Component {
|
|
|
76
69
|
if (boundariesElement) {
|
|
77
70
|
additionalProps.boundariesElement = boundariesElement;
|
|
78
71
|
}
|
|
79
|
-
return /*#__PURE__*/
|
|
72
|
+
return /*#__PURE__*/React.createElement(Popover, Object.assign({
|
|
80
73
|
placement: placement,
|
|
81
74
|
isOpen: true,
|
|
82
75
|
target: target,
|
|
@@ -85,7 +78,7 @@ class DTablePopover extends _react.default.Component {
|
|
|
85
78
|
innerClassName: innerClassName,
|
|
86
79
|
className: popoverClassName,
|
|
87
80
|
modifiers: modifiers
|
|
88
|
-
}, additionalProps), /*#__PURE__*/
|
|
81
|
+
}, additionalProps), /*#__PURE__*/React.createElement("div", {
|
|
89
82
|
ref: ref => this.dtablePopoverRef = ref,
|
|
90
83
|
onClick: this.onPopoverInsideClick
|
|
91
84
|
}, this.props.children));
|
|
@@ -96,4 +89,4 @@ DTablePopover.defaultProps = {
|
|
|
96
89
|
hideArrow: true,
|
|
97
90
|
canHideDTablePopover: true
|
|
98
91
|
};
|
|
99
|
-
|
|
92
|
+
export default DTablePopover;
|
|
@@ -1,15 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports.default = void 0;
|
|
9
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
10
|
-
var _classnames = _interopRequireDefault(require("classnames"));
|
|
11
|
-
var _utils = require("../../utils");
|
|
12
|
-
class DtableSearchInput extends _react.Component {
|
|
1
|
+
import React, { Component, Fragment } from 'react';
|
|
2
|
+
import classnames from 'classnames';
|
|
3
|
+
import { isFunction } from '../../utils';
|
|
4
|
+
class DtableSearchInput extends Component {
|
|
13
5
|
constructor(props) {
|
|
14
6
|
super(props);
|
|
15
7
|
this.onCompositionStart = () => {
|
|
@@ -66,17 +58,17 @@ class DtableSearchInput extends _react.Component {
|
|
|
66
58
|
const {
|
|
67
59
|
ClearIndicator
|
|
68
60
|
} = components;
|
|
69
|
-
if (
|
|
70
|
-
return
|
|
61
|
+
if (React.isValidElement(ClearIndicator)) {
|
|
62
|
+
return React.cloneElement(ClearIndicator, {
|
|
71
63
|
clearValue: this.clearSearch
|
|
72
64
|
});
|
|
73
|
-
} else if (
|
|
74
|
-
return /*#__PURE__*/
|
|
65
|
+
} else if (isFunction(ClearIndicator)) {
|
|
66
|
+
return /*#__PURE__*/React.createElement(ClearIndicator, {
|
|
75
67
|
clearValue: this.clearSearch
|
|
76
68
|
});
|
|
77
69
|
}
|
|
78
|
-
return /*#__PURE__*/
|
|
79
|
-
className: (
|
|
70
|
+
return /*#__PURE__*/React.createElement("i", {
|
|
71
|
+
className: classnames('search-text-clear input-icon-addon', clearClassName),
|
|
80
72
|
onClick: this.clearSearch
|
|
81
73
|
}, "\xD7");
|
|
82
74
|
};
|
|
@@ -111,10 +103,10 @@ class DtableSearchInput extends _react.Component {
|
|
|
111
103
|
const {
|
|
112
104
|
searchValue
|
|
113
105
|
} = this.state;
|
|
114
|
-
return /*#__PURE__*/
|
|
106
|
+
return /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement("input", {
|
|
115
107
|
type: "text",
|
|
116
108
|
value: searchValue,
|
|
117
|
-
className: (
|
|
109
|
+
className: classnames('form-control', className),
|
|
118
110
|
onChange: this.onChange,
|
|
119
111
|
autoFocus: autoFocus,
|
|
120
112
|
placeholder: placeholder,
|
|
@@ -132,4 +124,4 @@ DtableSearchInput.defaultProps = {
|
|
|
132
124
|
disabled: false,
|
|
133
125
|
value: ''
|
|
134
126
|
};
|
|
135
|
-
|
|
127
|
+
export default DtableSearchInput;
|
|
@@ -1,17 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
});
|
|
8
|
-
exports.default = GeneralFontSetting;
|
|
9
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
10
|
-
var _reactstrap = require("reactstrap");
|
|
11
|
-
var _fontSettings = require("../../settings/widgets/font-settings");
|
|
12
|
-
var _textHorizontalSettings = _interopRequireDefault(require("../../settings/widgets/text-horizontal-settings"));
|
|
13
|
-
var _constants = require("../../constants");
|
|
14
|
-
function GeneralFontSetting(_ref) {
|
|
1
|
+
import React, { useRef, useState } from 'react';
|
|
2
|
+
import { Input } from 'reactstrap';
|
|
3
|
+
import { FontColorSettings, FontSizeSettings, FontWeightSettings } from '../../settings/widgets/font-settings';
|
|
4
|
+
import TextHorizontalSettings from '../../settings/widgets/text-horizontal-settings';
|
|
5
|
+
import { CHART_SUPPORT_FONT_WEIGHTS } from '../../constants';
|
|
6
|
+
export default function GeneralFontSetting(_ref) {
|
|
15
7
|
let {
|
|
16
8
|
labelTitle,
|
|
17
9
|
config,
|
|
@@ -31,8 +23,8 @@ function GeneralFontSetting(_ref) {
|
|
|
31
23
|
text_align: defaultTextAlign,
|
|
32
24
|
font_weight: defaultFontWeight
|
|
33
25
|
} = defaultConfig;
|
|
34
|
-
const labelRef =
|
|
35
|
-
const [currentLabel, setCurrentLabel] =
|
|
26
|
+
const labelRef = useRef(null);
|
|
27
|
+
const [currentLabel, setCurrentLabel] = useState(label);
|
|
36
28
|
const handleLabelChange = e => {
|
|
37
29
|
setCurrentLabel(e.target.value);
|
|
38
30
|
};
|
|
@@ -51,28 +43,28 @@ function GeneralFontSetting(_ref) {
|
|
|
51
43
|
const handleFontWeightChange = value => {
|
|
52
44
|
onChange('font_weight', value);
|
|
53
45
|
};
|
|
54
|
-
return /*#__PURE__*/
|
|
46
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, labelTitle && /*#__PURE__*/React.createElement(Input, {
|
|
55
47
|
ref: labelRef,
|
|
56
48
|
type: "text",
|
|
57
49
|
value: currentLabel,
|
|
58
50
|
onBlur: onSaveLabel,
|
|
59
51
|
onChange: handleLabelChange
|
|
60
|
-
}), /*#__PURE__*/
|
|
52
|
+
}), /*#__PURE__*/React.createElement(FontSizeSettings, {
|
|
61
53
|
className: 'mt-3',
|
|
62
54
|
fontSize: font_size,
|
|
63
55
|
defaultFontSize: defaultFontSize,
|
|
64
56
|
modifyFontSize: handleFontSizeChange
|
|
65
|
-
}), /*#__PURE__*/
|
|
57
|
+
}), /*#__PURE__*/React.createElement(FontWeightSettings, {
|
|
66
58
|
className: 'mt-3',
|
|
67
59
|
fontWeight: font_weight || defaultFontWeight,
|
|
68
|
-
supportFontWeights:
|
|
60
|
+
supportFontWeights: CHART_SUPPORT_FONT_WEIGHTS,
|
|
69
61
|
modifyFontWeight: handleFontWeightChange
|
|
70
|
-
}), /*#__PURE__*/
|
|
62
|
+
}), /*#__PURE__*/React.createElement(FontColorSettings, {
|
|
71
63
|
className: 'mt-3',
|
|
72
64
|
fontColor: font_color,
|
|
73
65
|
defaultFontColor: defaultFontColor,
|
|
74
66
|
modifyFontColor: handleFontColorChange
|
|
75
|
-
}), /*#__PURE__*/
|
|
67
|
+
}), /*#__PURE__*/React.createElement(TextHorizontalSettings, {
|
|
76
68
|
className: 'mt-3',
|
|
77
69
|
value: text_align,
|
|
78
70
|
defaultValue: defaultTextAlign,
|
|
@@ -1,14 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports.default = void 0;
|
|
9
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
10
|
-
var _reactstrap = require("reactstrap");
|
|
11
|
-
var _intl = _interopRequireDefault(require("../../intl"));
|
|
1
|
+
import React, { useState } from 'react';
|
|
2
|
+
import { Input, Label } from 'reactstrap';
|
|
3
|
+
import intl from '../../intl';
|
|
12
4
|
const GoalSettingItem = _ref => {
|
|
13
5
|
let {
|
|
14
6
|
title,
|
|
@@ -17,7 +9,7 @@ const GoalSettingItem = _ref => {
|
|
|
17
9
|
handleValueChange,
|
|
18
10
|
onlyNumber
|
|
19
11
|
} = _ref;
|
|
20
|
-
const [currText, setCurrText] =
|
|
12
|
+
const [currText, setCurrText] = useState(modelValue || '');
|
|
21
13
|
const onTextChange = event => {
|
|
22
14
|
const value = onlyNumber ? parseFloat(event.target.value) : event.target.value;
|
|
23
15
|
setCurrText(value);
|
|
@@ -33,7 +25,7 @@ const GoalSettingItem = _ref => {
|
|
|
33
25
|
[modelKey]: currText
|
|
34
26
|
});
|
|
35
27
|
};
|
|
36
|
-
return /*#__PURE__*/
|
|
28
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Label, null, intl.get(title)), /*#__PURE__*/React.createElement(Input, {
|
|
37
29
|
type: onlyNumber ? 'number' : 'text',
|
|
38
30
|
value: currText,
|
|
39
31
|
onBlur: onSaveText,
|
|
@@ -42,4 +34,4 @@ const GoalSettingItem = _ref => {
|
|
|
42
34
|
className: "mb-3"
|
|
43
35
|
}));
|
|
44
36
|
};
|
|
45
|
-
|
|
37
|
+
export default GoalSettingItem;
|
|
@@ -1,16 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
exports.default = GoalLineSetting;
|
|
8
|
-
var _CollapsibleSettingLayout2 = _interopRequireDefault(require("dtable-ui-component/lib/CollapsibleSettingLayout"));
|
|
9
|
-
var _DTableSwitch2 = _interopRequireDefault(require("dtable-ui-component/lib/DTableSwitch"));
|
|
10
|
-
var _react = _interopRequireDefault(require("react"));
|
|
11
|
-
var _intl = _interopRequireDefault(require("../../intl"));
|
|
12
|
-
var _goalSettingItem = _interopRequireDefault(require("./goal-setting-item"));
|
|
13
|
-
function GoalLineSetting(_ref) {
|
|
1
|
+
import _CollapsibleSettingLayout from "dtable-ui-component/lib/CollapsibleSettingLayout";
|
|
2
|
+
import _DTableSwitch from "dtable-ui-component/lib/DTableSwitch";
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import intl from '../../intl';
|
|
5
|
+
import GoalSettingItem from './goal-setting-item';
|
|
6
|
+
export default function GoalLineSetting(_ref) {
|
|
14
7
|
let {
|
|
15
8
|
displayGoalLine,
|
|
16
9
|
goalLabel,
|
|
@@ -25,19 +18,19 @@ function GoalLineSetting(_ref) {
|
|
|
25
18
|
const onGoalSettingChange = value => {
|
|
26
19
|
onChange && onChange(value);
|
|
27
20
|
};
|
|
28
|
-
return /*#__PURE__*/
|
|
29
|
-
title:
|
|
30
|
-
}, /*#__PURE__*/
|
|
21
|
+
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(_CollapsibleSettingLayout, {
|
|
22
|
+
title: intl.get('Goal_line')
|
|
23
|
+
}, /*#__PURE__*/React.createElement(_DTableSwitch, {
|
|
31
24
|
switchClassName: "mb-3",
|
|
32
25
|
onChange: toggleDisplayGoalLine,
|
|
33
26
|
checked: !!displayGoalLine,
|
|
34
|
-
placeholder:
|
|
35
|
-
}), displayGoalLine && /*#__PURE__*/
|
|
27
|
+
placeholder: intl.get('Display_goal_line')
|
|
28
|
+
}), displayGoalLine && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(GoalSettingItem, {
|
|
36
29
|
title: "Goal_label",
|
|
37
30
|
modelKey: "goal_label",
|
|
38
31
|
modelValue: goalLabel,
|
|
39
32
|
handleValueChange: onGoalSettingChange
|
|
40
|
-
}), /*#__PURE__*/
|
|
33
|
+
}), /*#__PURE__*/React.createElement(GoalSettingItem, {
|
|
41
34
|
title: "Goal_value",
|
|
42
35
|
modelKey: "goal_value",
|
|
43
36
|
modelValue: goalValue,
|
|
@@ -1,12 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.default = void 0;
|
|
8
|
-
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
var _commonUtils = require("../../utils/common-utils");
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { escapeRegExp } from '../../utils/common-utils';
|
|
10
3
|
const Highlighter = _ref => {
|
|
11
4
|
let {
|
|
12
5
|
children,
|
|
@@ -14,19 +7,19 @@ const Highlighter = _ref => {
|
|
|
14
7
|
} = _ref;
|
|
15
8
|
if (!children) return null;
|
|
16
9
|
if (!highlight || !Array.isArray(highlight)) return children;
|
|
17
|
-
const cleanHighlights = highlight.map(item =>
|
|
10
|
+
const cleanHighlights = highlight.map(item => escapeRegExp(item));
|
|
18
11
|
const regexp = new RegExp(cleanHighlights.join('|'), 'ig');
|
|
19
12
|
const matches = children.match(regexp);
|
|
20
13
|
let parts = children.split(regexp);
|
|
21
14
|
for (let i = 0; i < parts.length - 1; i++) {
|
|
22
|
-
parts[i] = /*#__PURE__*/
|
|
15
|
+
parts[i] = /*#__PURE__*/React.createElement(React.Fragment, {
|
|
23
16
|
key: i
|
|
24
|
-
}, parts[i], /*#__PURE__*/
|
|
17
|
+
}, parts[i], /*#__PURE__*/React.createElement("span", {
|
|
25
18
|
className: "highlighted"
|
|
26
19
|
}, matches[i]));
|
|
27
20
|
}
|
|
28
|
-
return /*#__PURE__*/
|
|
21
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
29
22
|
className: "highlighter"
|
|
30
23
|
}, parts);
|
|
31
24
|
};
|
|
32
|
-
|
|
25
|
+
export default Highlighter;
|
|
@@ -1,31 +1,20 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import './index.css';
|
|
3
|
+
const components = {};
|
|
4
|
+
const requireContext = require.context('../../assets/icons', false, /\.svg$/);
|
|
5
|
+
requireContext.keys().forEach(path => {
|
|
6
|
+
const iconName = path.replace(/^\.\/(.*?)\.svg$/, '$1').toLowerCase();
|
|
7
|
+
components[iconName] = requireContext(path).default;
|
|
6
8
|
});
|
|
7
|
-
exports.default = void 0;
|
|
8
|
-
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
require("./index.css");
|
|
10
|
-
const importAll = requireContext => {
|
|
11
|
-
requireContext.keys().forEach(requireContext);
|
|
12
|
-
};
|
|
13
|
-
try {
|
|
14
|
-
importAll(require.context('../../assets/icons', true, /\.svg$/));
|
|
15
|
-
} catch (error) {
|
|
16
|
-
// eslint-disable-next-line no-console
|
|
17
|
-
console.log(error);
|
|
18
|
-
}
|
|
19
9
|
const Icon = props => {
|
|
20
10
|
const {
|
|
21
11
|
className,
|
|
22
12
|
symbol
|
|
23
13
|
} = props;
|
|
24
|
-
const iconClass =
|
|
25
|
-
|
|
14
|
+
const iconClass = `sea-chart-icon sea-chart-icon-${symbol} ${className || ''}`;
|
|
15
|
+
const IconComponent = components[symbol];
|
|
16
|
+
return /*#__PURE__*/React.createElement(IconComponent, {
|
|
26
17
|
className: iconClass
|
|
27
|
-
}
|
|
28
|
-
xlinkHref: "#".concat(symbol)
|
|
29
|
-
}));
|
|
18
|
+
});
|
|
30
19
|
};
|
|
31
|
-
|
|
20
|
+
export default Icon;
|
package/dist/components/index.js
CHANGED
|
@@ -1,48 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
enumerable: true,
|
|
9
|
-
get: function () {
|
|
10
|
-
return _collaborator.default;
|
|
11
|
-
}
|
|
12
|
-
});
|
|
13
|
-
Object.defineProperty(exports, "Icon", {
|
|
14
|
-
enumerable: true,
|
|
15
|
-
get: function () {
|
|
16
|
-
return _icon.default;
|
|
17
|
-
}
|
|
18
|
-
});
|
|
19
|
-
Object.defineProperty(exports, "Loading", {
|
|
20
|
-
enumerable: true,
|
|
21
|
-
get: function () {
|
|
22
|
-
return _loading.default;
|
|
23
|
-
}
|
|
24
|
-
});
|
|
25
|
-
Object.defineProperty(exports, "NumberInput", {
|
|
26
|
-
enumerable: true,
|
|
27
|
-
get: function () {
|
|
28
|
-
return _numberInput.default;
|
|
29
|
-
}
|
|
30
|
-
});
|
|
31
|
-
Object.defineProperty(exports, "PixelEditor", {
|
|
32
|
-
enumerable: true,
|
|
33
|
-
get: function () {
|
|
34
|
-
return _pixelEditor.default;
|
|
35
|
-
}
|
|
36
|
-
});
|
|
37
|
-
Object.defineProperty(exports, "TypesDialog", {
|
|
38
|
-
enumerable: true,
|
|
39
|
-
get: function () {
|
|
40
|
-
return _typesDialog.default;
|
|
41
|
-
}
|
|
42
|
-
});
|
|
43
|
-
var _collaborator = _interopRequireDefault(require("./collaborator"));
|
|
44
|
-
var _loading = _interopRequireDefault(require("./loading"));
|
|
45
|
-
var _icon = _interopRequireDefault(require("./icon"));
|
|
46
|
-
var _numberInput = _interopRequireDefault(require("./number-input"));
|
|
47
|
-
var _typesDialog = _interopRequireDefault(require("./types-dialog"));
|
|
48
|
-
var _pixelEditor = _interopRequireDefault(require("./pixel-editor"));
|
|
1
|
+
import Collaborator from './collaborator';
|
|
2
|
+
import Loading from './loading';
|
|
3
|
+
import Icon from './icon';
|
|
4
|
+
import NumberInput from './number-input';
|
|
5
|
+
import TypesDialog from './types-dialog';
|
|
6
|
+
import PixelEditor from './pixel-editor';
|
|
7
|
+
export { Collaborator, Loading, Icon, NumberInput, TypesDialog, PixelEditor };
|
|
@@ -1,19 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.default = void 0;
|
|
8
|
-
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
var _classnames = _interopRequireDefault(require("classnames"));
|
|
10
|
-
require("./index.css");
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import classnames from 'classnames';
|
|
3
|
+
import './index.css';
|
|
11
4
|
const Loading = _ref => {
|
|
12
5
|
let {
|
|
13
6
|
className
|
|
14
7
|
} = _ref;
|
|
15
|
-
return /*#__PURE__*/
|
|
16
|
-
className: (
|
|
8
|
+
return /*#__PURE__*/React.createElement("span", {
|
|
9
|
+
className: classnames('loading-icon loading-tip', className)
|
|
17
10
|
});
|
|
18
11
|
};
|
|
19
|
-
|
|
12
|
+
export default Loading;
|
|
@@ -1,27 +1,20 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.default = void 0;
|
|
8
|
-
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
var _reactstrap = require("reactstrap");
|
|
10
|
-
function NumberInput(props) {
|
|
11
|
-
const {
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Input } from 'reactstrap';
|
|
3
|
+
function NumberInput(_ref) {
|
|
4
|
+
let {
|
|
12
5
|
value,
|
|
13
6
|
onChange,
|
|
14
|
-
min,
|
|
15
|
-
step,
|
|
16
|
-
max,
|
|
17
|
-
readOnly,
|
|
7
|
+
min = 0,
|
|
8
|
+
step = 1,
|
|
9
|
+
max = Infinity,
|
|
10
|
+
readOnly = false,
|
|
18
11
|
className,
|
|
19
12
|
useEmpty,
|
|
20
13
|
...otherProps
|
|
21
|
-
} =
|
|
14
|
+
} = _ref;
|
|
22
15
|
// useempty is used to control whether to use empty string or '0'
|
|
23
16
|
const number = value ? value : useEmpty ? '' : '0';
|
|
24
|
-
return /*#__PURE__*/
|
|
17
|
+
return /*#__PURE__*/React.createElement(Input, Object.assign({
|
|
25
18
|
type: "number",
|
|
26
19
|
className: className,
|
|
27
20
|
value: number,
|
|
@@ -32,10 +25,4 @@ function NumberInput(props) {
|
|
|
32
25
|
onChange: onChange
|
|
33
26
|
}, otherProps));
|
|
34
27
|
}
|
|
35
|
-
|
|
36
|
-
min: 0,
|
|
37
|
-
step: 1,
|
|
38
|
-
max: Infinity,
|
|
39
|
-
readOnly: false
|
|
40
|
-
};
|
|
41
|
-
var _default = exports.default = NumberInput;
|
|
28
|
+
export default NumberInput;
|
|
@@ -1,27 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports.default = void 0;
|
|
9
|
-
var _dtableUtils = require("dtable-utils");
|
|
10
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
11
|
-
var _utils = require("../../utils");
|
|
12
|
-
var _numberInput = _interopRequireDefault(require("../number-input"));
|
|
13
|
-
require("./index.css");
|
|
1
|
+
import { isNumber } from 'dtable-utils';
|
|
2
|
+
import React, { useEffect, useRef, useState } from 'react';
|
|
3
|
+
import { isBoolean } from '../../utils';
|
|
4
|
+
import NumberInput from '../number-input';
|
|
5
|
+
import './index.css';
|
|
14
6
|
const PixelEditor = props => {
|
|
15
7
|
const {
|
|
16
8
|
pixel
|
|
17
9
|
} = props;
|
|
18
|
-
const [currPixel, setCurrPixel] =
|
|
19
|
-
const mountRef =
|
|
20
|
-
|
|
10
|
+
const [currPixel, setCurrPixel] = useState(isNumber(pixel) ? pixel : null);
|
|
11
|
+
const mountRef = useRef(false);
|
|
12
|
+
useEffect(() => {
|
|
21
13
|
if (!mountRef.current) {
|
|
22
14
|
mountRef.current = true;
|
|
23
15
|
} else {
|
|
24
|
-
setCurrPixel(
|
|
16
|
+
setCurrPixel(isNumber(props.pixel) ? props.pixel : null);
|
|
25
17
|
}
|
|
26
18
|
}, [props.pixel]);
|
|
27
19
|
const onSavePixel = () => {
|
|
@@ -33,17 +25,17 @@ const PixelEditor = props => {
|
|
|
33
25
|
event.target.blur();
|
|
34
26
|
}
|
|
35
27
|
};
|
|
36
|
-
const showPx =
|
|
37
|
-
return /*#__PURE__*/
|
|
28
|
+
const showPx = isBoolean(props.showPx) ? props.showPx : true;
|
|
29
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
38
30
|
className: "sea-chart-pixel-editor-wrapper"
|
|
39
|
-
}, /*#__PURE__*/
|
|
31
|
+
}, /*#__PURE__*/React.createElement(NumberInput, {
|
|
40
32
|
value: currPixel,
|
|
41
33
|
useEmpty: props.useEmpty,
|
|
42
34
|
onChange: event => setCurrPixel(event.target.value),
|
|
43
35
|
onBlur: onSavePixel,
|
|
44
36
|
onKeyDown: onKeyDown
|
|
45
|
-
}), showPx && /*#__PURE__*/
|
|
37
|
+
}), showPx && /*#__PURE__*/React.createElement("div", {
|
|
46
38
|
className: "pixel-unit"
|
|
47
|
-
}, /*#__PURE__*/
|
|
39
|
+
}, /*#__PURE__*/React.createElement("span", null, "px")));
|
|
48
40
|
};
|
|
49
|
-
|
|
41
|
+
export default PixelEditor;
|