sea-chart 1.1.120 → 1.1.121
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 +8 -15
- 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 +30 -38
- 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 +40 -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 +5 -12
- package/dist/components/index.js +7 -48
- package/dist/components/loading/index.js +6 -13
- package/dist/components/number-input/index.js +4 -11
- package/dist/components/pixel-editor/index.js +15 -23
- package/dist/components/popover/hide-column-popover/hide-column-popover-widgets/hide-column-item.js +8 -15
- package/dist/components/popover/hide-column-popover/hide-column-popover.js +26 -34
- package/dist/components/popover/sort-popover/sort-popover-widgets/sort-utils.js +9 -18
- package/dist/components/popover/sort-popover/sort-popover.js +55 -65
- 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 +56 -64
- 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 +10 -17
- 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 +1 -7
- package/dist/locale/lang/en.js +1 -7
- package/dist/locale/lang/es.js +1 -7
- package/dist/locale/lang/fr.js +1 -7
- package/dist/locale/lang/pt.js +1 -7
- package/dist/locale/lang/ru.js +1 -7
- package/dist/locale/lang/zh_CN.js +1 -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 +10 -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 +11 -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 +63 -71
- 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 +49 -57
- package/dist/settings/basic-number-card/data-settings.js +49 -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 -63
- package/dist/settings/combination-settings/index.js +3 -20
- package/dist/settings/combination-settings/style-settings.js +65 -73
- 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 +43 -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 +20 -28
- 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 +53 -71
- 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 +30 -38
- package/dist/settings/table-element-settings/data-settings.js +21 -29
- package/dist/settings/table-element-settings/index.js +2 -13
- package/dist/settings/table-settings/data-settings.js +112 -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 +42 -50
- 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 +55 -63
- 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 +21 -29
- package/dist/settings/widgets/data-filter/index.js +35 -43
- 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 +51 -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 +74 -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 +64 -72
- package/dist/utils/cell-format-utils.js +17 -27
- package/dist/utils/cell-value-utils.js +4 -11
- package/dist/utils/chart-utils/base-utils.js +315 -323
- package/dist/utils/chart-utils/index.js +28 -41
- package/dist/utils/chart-utils/original-data-utils/basic-chart-calculator.js +77 -84
- package/dist/utils/chart-utils/original-data-utils/card-calculator.js +13 -20
- 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 +16 -23
- 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 +90 -96
- package/dist/utils/chart-utils/original-data-utils/scatter-calculator.js +19 -26
- package/dist/utils/chart-utils/original-data-utils/trend-calculator.js +31 -38
- package/dist/utils/chart-utils/sql-statistics-utils.js +228 -236
- 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 +77 -104
- package/dist/utils/common-utils.js +28 -53
- package/dist/utils/concurrency-manager.js +1 -7
- package/dist/utils/contexts.js +5 -12
- package/dist/utils/custom-g2.js +212 -241
- 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 +54 -221
- 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 +166 -178
- 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 +158 -168
- package/dist/utils/sql/index.js +3 -27
- package/dist/utils/trend-utils.js +39 -47
- package/dist/view/index.js +89 -95
- package/dist/view/title/index.js +16 -24
- package/dist/view/wrapper/area.js +39 -46
- package/dist/view/wrapper/bar-custom.js +33 -40
- package/dist/view/wrapper/bar-group.js +54 -60
- package/dist/view/wrapper/bar.js +35 -42
- package/dist/view/wrapper/basic-number-card.js +25 -33
- package/dist/view/wrapper/chart-component.js +75 -74
- package/dist/view/wrapper/combination.js +97 -98
- package/dist/view/wrapper/compare.js +50 -57
- package/dist/view/wrapper/completeness.js +24 -32
- package/dist/view/wrapper/dashboard.js +23 -25
- package/dist/view/wrapper/funnel.js +20 -27
- package/dist/view/wrapper/heat-map.js +53 -60
- package/dist/view/wrapper/horizontal-bar-group.js +47 -54
- package/dist/view/wrapper/horizontal-bar.js +32 -39
- package/dist/view/wrapper/horizontal-component.js +24 -32
- package/dist/view/wrapper/index.js +96 -104
- package/dist/view/wrapper/line-group.js +34 -41
- package/dist/view/wrapper/line.js +32 -39
- package/dist/view/wrapper/map.js +47 -55
- package/dist/view/wrapper/mirror.js +32 -39
- package/dist/view/wrapper/pie.js +43 -50
- package/dist/view/wrapper/ring.js +53 -60
- package/dist/view/wrapper/scatter.js +24 -32
- 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 -93
- 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 -15
- 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 +5 -12
- 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 +19 -27
- package/dist/view/wrapper/treemap.js +36 -43
- package/dist/view/wrapper/trend.js +57 -65
- package/dist/view/wrapper/world-map.js +53 -61
- package/package.json +2 -2
package/dist/api/index.js
CHANGED
|
@@ -1,11 +1,4 @@
|
|
|
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 _axios = _interopRequireDefault(require("axios"));
|
|
1
|
+
import axios from 'axios';
|
|
9
2
|
class SeaChartAPI {
|
|
10
3
|
constructor(config) {
|
|
11
4
|
var _this = this;
|
|
@@ -19,21 +12,21 @@ class SeaChartAPI {
|
|
|
19
12
|
const headers = {
|
|
20
13
|
'Authorization': 'Token ' + APIToken
|
|
21
14
|
};
|
|
22
|
-
return
|
|
15
|
+
return axios.get(url, {
|
|
23
16
|
headers
|
|
24
17
|
});
|
|
25
18
|
};
|
|
26
19
|
this.getBaseData = () => {
|
|
27
|
-
const url =
|
|
20
|
+
const url = `/api/v2/dtables/${this.dtableUuid}/`;
|
|
28
21
|
return this.req.get(url);
|
|
29
22
|
};
|
|
30
23
|
this.getBaseMetaData = () => {
|
|
31
|
-
const url =
|
|
24
|
+
const url = `/api/v2/dtables/${this.dtableUuid}/metadata/`;
|
|
32
25
|
return this.req.get(url);
|
|
33
26
|
};
|
|
34
27
|
this.sqlQuery = function (sql, parameters) {
|
|
35
28
|
let convert_keys = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
36
|
-
const url =
|
|
29
|
+
const url = `/api/v2/dtables/${_this.dtableUuid}/sql/`;
|
|
37
30
|
const data = {
|
|
38
31
|
sql,
|
|
39
32
|
convert_keys,
|
|
@@ -50,7 +43,7 @@ class SeaChartAPI {
|
|
|
50
43
|
this.instance = null;
|
|
51
44
|
this.appName = '';
|
|
52
45
|
this.dtableUuid = '';
|
|
53
|
-
this.baseURL = _server[_server.length - 1] === '/' ?
|
|
46
|
+
this.baseURL = _server[_server.length - 1] === '/' ? `${_server}api-gateway` : `${_server}/api-gateway`;
|
|
54
47
|
}
|
|
55
48
|
static getInstance(config) {
|
|
56
49
|
if (this.instance) return this.instance;
|
|
@@ -66,7 +59,7 @@ class SeaChartAPI {
|
|
|
66
59
|
} = accessTokenRes.data;
|
|
67
60
|
this.appName = app_name;
|
|
68
61
|
this.dtableUuid = dtable_uuid;
|
|
69
|
-
this.req =
|
|
62
|
+
this.req = axios.create({
|
|
70
63
|
baseURL: this.baseURL,
|
|
71
64
|
headers: {
|
|
72
65
|
'Authorization': 'Token ' + access_token
|
|
@@ -74,4 +67,4 @@ class SeaChartAPI {
|
|
|
74
67
|
});
|
|
75
68
|
}
|
|
76
69
|
}
|
|
77
|
-
|
|
70
|
+
export default SeaChartAPI;
|
|
@@ -1,64 +1,57 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
var _ImageFormatter2 = _interopRequireDefault(require("dtable-ui-component/lib/ImageFormatter"));
|
|
29
|
-
var _SingleSelectFormatter2 = _interopRequireDefault(require("dtable-ui-component/lib/SingleSelectFormatter"));
|
|
30
|
-
var _LongTextFormatter2 = _interopRequireDefault(require("dtable-ui-component/lib/LongTextFormatter"));
|
|
31
|
-
var _CheckboxFormatter2 = _interopRequireDefault(require("dtable-ui-component/lib/CheckboxFormatter"));
|
|
32
|
-
var _react = _interopRequireDefault(require("react"));
|
|
33
|
-
var _dtableUtils = require("dtable-utils");
|
|
34
|
-
var _SimpleCellFormatter = _interopRequireDefault(require("../cell-factory/SimpleCellFormatter"));
|
|
1
|
+
import _DepartmentSingleSelectFormatter from "dtable-ui-component/lib/DepartmentSingleSelectFormatter";
|
|
2
|
+
import _DigitalSignFormatter from "dtable-ui-component/lib/DigitalSignFormatter";
|
|
3
|
+
import _RateFormatter from "dtable-ui-component/lib/RateFormatter";
|
|
4
|
+
import _ButtonFormatter from "dtable-ui-component/lib/ButtonFormatter";
|
|
5
|
+
import _DurationFormatter from "dtable-ui-component/lib/DurationFormatter";
|
|
6
|
+
import _EmailFormatter from "dtable-ui-component/lib/EmailFormatter";
|
|
7
|
+
import _UrlFormatter from "dtable-ui-component/lib/UrlFormatter";
|
|
8
|
+
import _AutoNumberFormatter from "dtable-ui-component/lib/AutoNumberFormatter";
|
|
9
|
+
import _FormulaFormatter from "dtable-ui-component/lib/FormulaFormatter";
|
|
10
|
+
import _GeolocationFormatter from "dtable-ui-component/lib/GeolocationFormatter";
|
|
11
|
+
import _MTimeFormatter from "dtable-ui-component/lib/MTimeFormatter";
|
|
12
|
+
import _LastModifierFormatter from "dtable-ui-component/lib/LastModifierFormatter";
|
|
13
|
+
import _CTimeFormatter from "dtable-ui-component/lib/CTimeFormatter";
|
|
14
|
+
import _CreatorFormatter from "dtable-ui-component/lib/CreatorFormatter";
|
|
15
|
+
import _LinkFormatter from "dtable-ui-component/lib/LinkFormatter";
|
|
16
|
+
import _DateFormatter from "dtable-ui-component/lib/DateFormatter";
|
|
17
|
+
import _NumberFormatter from "dtable-ui-component/lib/NumberFormatter";
|
|
18
|
+
import _CollaboratorFormatter from "dtable-ui-component/lib/CollaboratorFormatter";
|
|
19
|
+
import _MultipleSelectFormatter from "dtable-ui-component/lib/MultipleSelectFormatter";
|
|
20
|
+
import _FileFormatter from "dtable-ui-component/lib/FileFormatter";
|
|
21
|
+
import _ImageFormatter from "dtable-ui-component/lib/ImageFormatter";
|
|
22
|
+
import _SingleSelectFormatter from "dtable-ui-component/lib/SingleSelectFormatter";
|
|
23
|
+
import _LongTextFormatter from "dtable-ui-component/lib/LongTextFormatter";
|
|
24
|
+
import _CheckboxFormatter from "dtable-ui-component/lib/CheckboxFormatter";
|
|
25
|
+
import React from 'react';
|
|
26
|
+
import { CellType } from 'dtable-utils';
|
|
27
|
+
import SimpleCellFormatter from '../cell-factory/SimpleCellFormatter';
|
|
35
28
|
const FormatterConfig = {
|
|
36
|
-
[
|
|
37
|
-
[
|
|
38
|
-
[
|
|
39
|
-
[
|
|
40
|
-
[
|
|
41
|
-
[
|
|
42
|
-
[
|
|
43
|
-
[
|
|
44
|
-
[
|
|
45
|
-
[
|
|
46
|
-
[
|
|
47
|
-
[
|
|
48
|
-
[
|
|
49
|
-
[
|
|
50
|
-
[
|
|
51
|
-
[
|
|
52
|
-
[
|
|
53
|
-
[
|
|
54
|
-
[
|
|
55
|
-
[
|
|
56
|
-
[
|
|
57
|
-
[
|
|
58
|
-
[
|
|
59
|
-
[
|
|
60
|
-
[
|
|
61
|
-
[
|
|
62
|
-
[
|
|
29
|
+
[CellType.DEFAULT]: /*#__PURE__*/React.createElement(SimpleCellFormatter, null),
|
|
30
|
+
[CellType.TEXT]: /*#__PURE__*/React.createElement(SimpleCellFormatter, null),
|
|
31
|
+
[CellType.CHECKBOX]: /*#__PURE__*/React.createElement(_CheckboxFormatter, null),
|
|
32
|
+
[CellType.LONG_TEXT]: /*#__PURE__*/React.createElement(_LongTextFormatter, null),
|
|
33
|
+
[CellType.SINGLE_SELECT]: /*#__PURE__*/React.createElement(_SingleSelectFormatter, null),
|
|
34
|
+
[CellType.IMAGE]: /*#__PURE__*/React.createElement(_ImageFormatter, null),
|
|
35
|
+
[CellType.FILE]: /*#__PURE__*/React.createElement(_FileFormatter, null),
|
|
36
|
+
[CellType.MULTIPLE_SELECT]: /*#__PURE__*/React.createElement(_MultipleSelectFormatter, null),
|
|
37
|
+
[CellType.COLLABORATOR]: /*#__PURE__*/React.createElement(_CollaboratorFormatter, null),
|
|
38
|
+
[CellType.NUMBER]: /*#__PURE__*/React.createElement(_NumberFormatter, null),
|
|
39
|
+
[CellType.DATE]: /*#__PURE__*/React.createElement(_DateFormatter, null),
|
|
40
|
+
[CellType.LINK]: /*#__PURE__*/React.createElement(_LinkFormatter, null),
|
|
41
|
+
[CellType.CREATOR]: /*#__PURE__*/React.createElement(_CreatorFormatter, null),
|
|
42
|
+
[CellType.CTIME]: /*#__PURE__*/React.createElement(_CTimeFormatter, null),
|
|
43
|
+
[CellType.LAST_MODIFIER]: /*#__PURE__*/React.createElement(_LastModifierFormatter, null),
|
|
44
|
+
[CellType.MTIME]: /*#__PURE__*/React.createElement(_MTimeFormatter, null),
|
|
45
|
+
[CellType.GEOLOCATION]: /*#__PURE__*/React.createElement(_GeolocationFormatter, null),
|
|
46
|
+
[CellType.FORMULA]: /*#__PURE__*/React.createElement(_FormulaFormatter, null),
|
|
47
|
+
[CellType.AUTO_NUMBER]: /*#__PURE__*/React.createElement(_AutoNumberFormatter, null),
|
|
48
|
+
[CellType.URL]: /*#__PURE__*/React.createElement(_UrlFormatter, null),
|
|
49
|
+
[CellType.EMAIL]: /*#__PURE__*/React.createElement(_EmailFormatter, null),
|
|
50
|
+
[CellType.DURATION]: /*#__PURE__*/React.createElement(_DurationFormatter, null),
|
|
51
|
+
[CellType.BUTTON]: /*#__PURE__*/React.createElement(_ButtonFormatter, null),
|
|
52
|
+
[CellType.LINK_FORMULA]: /*#__PURE__*/React.createElement(_FormulaFormatter, null),
|
|
53
|
+
[CellType.RATE]: /*#__PURE__*/React.createElement(_RateFormatter, null),
|
|
54
|
+
[CellType.DIGITAL_SIGN]: /*#__PURE__*/React.createElement(_DigitalSignFormatter, null),
|
|
55
|
+
[CellType.DEPARTMENT_SINGLE_SELECT]: /*#__PURE__*/React.createElement(_DepartmentSingleSelectFormatter, null)
|
|
63
56
|
};
|
|
64
|
-
|
|
57
|
+
export default FormatterConfig;
|
|
@@ -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
|
-
class SimpleCellFormatter extends _react.default.Component {
|
|
1
|
+
import React from 'react';
|
|
2
|
+
class SimpleCellFormatter extends React.Component {
|
|
10
3
|
constructor() {
|
|
11
4
|
super(...arguments);
|
|
12
5
|
this.getFormattedValue = val => {
|
|
@@ -27,13 +20,13 @@ class SimpleCellFormatter extends _react.default.Component {
|
|
|
27
20
|
if (typeof value === 'object') {
|
|
28
21
|
return null;
|
|
29
22
|
}
|
|
30
|
-
const gridCellClassName = this.props.type ?
|
|
23
|
+
const gridCellClassName = this.props.type ? `grid-cell-type-${this.props.type}` : 'grid-cell-type-default';
|
|
31
24
|
let formattedValue = this.getFormattedValue(value);
|
|
32
|
-
return /*#__PURE__*/
|
|
25
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
33
26
|
className: gridCellClassName,
|
|
34
27
|
title: formattedValue,
|
|
35
28
|
"aria-label": formattedValue
|
|
36
29
|
}, formattedValue);
|
|
37
30
|
}
|
|
38
31
|
}
|
|
39
|
-
|
|
32
|
+
export default SimpleCellFormatter;
|
|
@@ -1,15 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
});
|
|
7
|
-
exports.default = void 0;
|
|
8
|
-
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
var _intl = _interopRequireDefault(require("../../intl"));
|
|
10
|
-
var _columnUtils = require("../../utils/column-utils");
|
|
11
|
-
var _commonConstants = require("../../constants/common-constants");
|
|
12
|
-
class SingleSelectOption extends _react.default.Component {
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import intl from '../../intl';
|
|
3
|
+
import { getSelectColumnOptions } from '../../utils/column-utils';
|
|
4
|
+
import { DELETED_OPTION_BACKGROUND_COLOR, DELETED_OPTION_TIPS } from '../../constants/common-constants';
|
|
5
|
+
class SingleSelectOption extends React.Component {
|
|
13
6
|
constructor() {
|
|
14
7
|
super(...arguments);
|
|
15
8
|
this.getCurrentOption = () => {
|
|
@@ -17,7 +10,7 @@ class SingleSelectOption extends _react.default.Component {
|
|
|
17
10
|
value,
|
|
18
11
|
column
|
|
19
12
|
} = this.props;
|
|
20
|
-
let options =
|
|
13
|
+
let options = getSelectColumnOptions(column);
|
|
21
14
|
return options.find(item => item.id === value);
|
|
22
15
|
};
|
|
23
16
|
this.getStyle = option => {
|
|
@@ -34,7 +27,7 @@ class SingleSelectOption extends _react.default.Component {
|
|
|
34
27
|
style.backgroundColor = option.color;
|
|
35
28
|
style.color = option.textColor || null;
|
|
36
29
|
} else {
|
|
37
|
-
style.backgroundColor =
|
|
30
|
+
style.backgroundColor = DELETED_OPTION_BACKGROUND_COLOR;
|
|
38
31
|
}
|
|
39
32
|
return style;
|
|
40
33
|
};
|
|
@@ -45,11 +38,11 @@ class SingleSelectOption extends _react.default.Component {
|
|
|
45
38
|
column
|
|
46
39
|
} = this.props;
|
|
47
40
|
if (!value) {
|
|
48
|
-
return /*#__PURE__*/
|
|
41
|
+
return /*#__PURE__*/React.createElement("div", null);
|
|
49
42
|
}
|
|
50
43
|
const currentOption = this.getCurrentOption();
|
|
51
|
-
const name = currentOption ? currentOption.name :
|
|
52
|
-
return /*#__PURE__*/
|
|
44
|
+
const name = currentOption ? currentOption.name : intl.get(DELETED_OPTION_TIPS);
|
|
45
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
53
46
|
// If parent node is FormulaFormatter, column is {data: array_data}, so column.type is undefined
|
|
54
47
|
className: 'grid_cell_type_' + (column.type || ''),
|
|
55
48
|
style: this.getStyle(currentOption),
|
|
@@ -57,4 +50,4 @@ class SingleSelectOption extends _react.default.Component {
|
|
|
57
50
|
}, name);
|
|
58
51
|
}
|
|
59
52
|
}
|
|
60
|
-
|
|
53
|
+
export default SingleSelectOption;
|
|
@@ -1,19 +1,12 @@
|
|
|
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 _EditorConfig = _interopRequireDefault(require("../cell-editors/EditorConfig"));
|
|
1
|
+
import EditorConfig from '../cell-editors/EditorConfig';
|
|
9
2
|
const DEFAULT = 'default';
|
|
10
3
|
class CellEditorFactory {
|
|
11
4
|
createEditor(editorType) {
|
|
12
|
-
if (
|
|
13
|
-
return
|
|
5
|
+
if (EditorConfig[editorType]) {
|
|
6
|
+
return EditorConfig[editorType];
|
|
14
7
|
}
|
|
15
|
-
return
|
|
8
|
+
return EditorConfig[DEFAULT];
|
|
16
9
|
}
|
|
17
10
|
}
|
|
18
11
|
let cellEditorFactory = new CellEditorFactory();
|
|
19
|
-
|
|
12
|
+
export default cellEditorFactory;
|
|
@@ -1,18 +1,11 @@
|
|
|
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 _FormatterConfig = _interopRequireDefault(require(".//FormatterConfig"));
|
|
1
|
+
import FormatterConfig from './/FormatterConfig';
|
|
9
2
|
class CellFormatterFactory {
|
|
10
3
|
createFormatter(formatterType) {
|
|
11
|
-
if (
|
|
12
|
-
return
|
|
4
|
+
if (FormatterConfig[formatterType]) {
|
|
5
|
+
return FormatterConfig[formatterType];
|
|
13
6
|
}
|
|
14
7
|
return null;
|
|
15
8
|
}
|
|
16
9
|
}
|
|
17
10
|
const cellFormatterFactory = new CellFormatterFactory();
|
|
18
|
-
|
|
11
|
+
export default cellFormatterFactory;
|
|
@@ -1,20 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
exports.default = void 0;
|
|
9
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
10
|
-
var _dtableUtils = require("dtable-utils");
|
|
11
|
-
var _context = _interopRequireDefault(require("../../context"));
|
|
12
|
-
var _commonUtils = require("../../utils/common-utils");
|
|
13
|
-
var _SimpleCellFormatter = _interopRequireDefault(require("../cell-factory/SimpleCellFormatter"));
|
|
14
|
-
var _commonConstants = require("../../constants/common-constants");
|
|
15
|
-
var _cellFormatterFactory = _interopRequireDefault(require("./cell-formatter-factory"));
|
|
1
|
+
import React, { Component } from 'react';
|
|
2
|
+
import { CellType, getCellValueStringResult } from 'dtable-utils';
|
|
3
|
+
import context from '../../context';
|
|
4
|
+
import { isFunction } from '../../utils/common-utils';
|
|
5
|
+
import SimpleCellFormatter from '../cell-factory/SimpleCellFormatter';
|
|
6
|
+
import { LINK_NOT_SUPPORT_TYPES, NEED_FORMATTER } from '../../constants/common-constants';
|
|
7
|
+
import cellFormatterFactory from './cell-formatter-factory';
|
|
16
8
|
const DEFAULT_MAX_DISPLAY_LINKS = 40;
|
|
17
|
-
class LinkContent extends
|
|
9
|
+
class LinkContent extends Component {
|
|
18
10
|
constructor() {
|
|
19
11
|
super(...arguments);
|
|
20
12
|
this.getFormatterContent = shownLinks => {
|
|
@@ -24,34 +16,34 @@ class LinkContent extends _react.Component {
|
|
|
24
16
|
const {
|
|
25
17
|
type
|
|
26
18
|
} = linkedColumn;
|
|
27
|
-
let Formatter =
|
|
19
|
+
let Formatter = cellFormatterFactory.createFormatter(type);
|
|
28
20
|
let formatterProps = {
|
|
29
21
|
column: linkedColumn,
|
|
30
22
|
isCellSelected: false,
|
|
31
23
|
readOnly: true
|
|
32
24
|
};
|
|
33
|
-
const className =
|
|
25
|
+
const className = `link formatter-item ${type === CellType.SINGLE_SELECT ? 'mr-1' : ''}`;
|
|
34
26
|
return shownLinks.map(link => {
|
|
35
27
|
if (!link) return null;
|
|
36
28
|
const {
|
|
37
29
|
row_id,
|
|
38
30
|
display_value
|
|
39
31
|
} = link;
|
|
40
|
-
if ([
|
|
32
|
+
if ([CellType.SINGLE_SELECT].includes(type)) {
|
|
41
33
|
var _linkedColumn$data;
|
|
42
34
|
formatterProps['options'] = (linkedColumn === null || linkedColumn === void 0 ? void 0 : (_linkedColumn$data = linkedColumn.data) === null || _linkedColumn$data === void 0 ? void 0 : _linkedColumn$data.options) || [];
|
|
43
35
|
}
|
|
44
36
|
if (!Array.isArray(display_value)) {
|
|
45
37
|
formatterProps['value'] = display_value;
|
|
46
|
-
return /*#__PURE__*/
|
|
47
|
-
key:
|
|
38
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
39
|
+
key: `link-record-item-${row_id}`,
|
|
48
40
|
className: className
|
|
49
41
|
}, this.createColumnFormatter(Formatter, formatterProps));
|
|
50
42
|
}
|
|
51
43
|
return display_value.map((item, index) => {
|
|
52
44
|
formatterProps['value'] = item;
|
|
53
|
-
return /*#__PURE__*/
|
|
54
|
-
key:
|
|
45
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
46
|
+
key: `link-record-item-${row_id}-${index}`,
|
|
55
47
|
className: className
|
|
56
48
|
}, this.createColumnFormatter(Formatter, formatterProps));
|
|
57
49
|
});
|
|
@@ -71,33 +63,33 @@ class LinkContent extends _react.Component {
|
|
|
71
63
|
return [];
|
|
72
64
|
}
|
|
73
65
|
const shownLinks = computedValue.length > maxDisplayLinks ? computedValue.slice(0, 40) : computedValue;
|
|
74
|
-
if (
|
|
66
|
+
if (NEED_FORMATTER.includes(type)) {
|
|
75
67
|
return this.getFormatterContent(shownLinks);
|
|
76
68
|
}
|
|
77
|
-
const collaborators =
|
|
78
|
-
const departments =
|
|
69
|
+
const collaborators = context.getCollaboratorsFromCache() || [];
|
|
70
|
+
const departments = context.getDepartments();
|
|
79
71
|
return shownLinks.map((link, index) => {
|
|
80
72
|
const {
|
|
81
73
|
row_id,
|
|
82
74
|
display_value
|
|
83
75
|
} = link;
|
|
84
|
-
const linkedValue =
|
|
76
|
+
const linkedValue = LINK_NOT_SUPPORT_TYPES.includes(type) ? null : display_value;
|
|
85
77
|
const row = {
|
|
86
78
|
_id: row_id,
|
|
87
79
|
[key]: linkedValue
|
|
88
80
|
};
|
|
89
|
-
const formulaRows = type ===
|
|
81
|
+
const formulaRows = type === CellType.FORMULA ? {
|
|
90
82
|
[row_id]: row
|
|
91
83
|
} : null;
|
|
92
|
-
const cellValue =
|
|
84
|
+
const cellValue = getCellValueStringResult(row, linkedColumn, {
|
|
93
85
|
formulaRows,
|
|
94
86
|
collaborators,
|
|
95
87
|
departments
|
|
96
88
|
});
|
|
97
|
-
return /*#__PURE__*/
|
|
98
|
-
key:
|
|
89
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
90
|
+
key: `link-item-${index}`,
|
|
99
91
|
className: "link"
|
|
100
|
-
}, /*#__PURE__*/
|
|
92
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
101
93
|
className: "link-name pr-1",
|
|
102
94
|
title: cellValue
|
|
103
95
|
}, cellValue));
|
|
@@ -105,14 +97,14 @@ class LinkContent extends _react.Component {
|
|
|
105
97
|
};
|
|
106
98
|
}
|
|
107
99
|
createColumnFormatter(Formatter, formatterProps) {
|
|
108
|
-
if (
|
|
109
|
-
return
|
|
100
|
+
if (React.isValidElement(Formatter)) {
|
|
101
|
+
return React.cloneElement(Formatter, {
|
|
110
102
|
...formatterProps
|
|
111
103
|
});
|
|
112
|
-
} else if (
|
|
113
|
-
return /*#__PURE__*/
|
|
104
|
+
} else if (isFunction(Formatter)) {
|
|
105
|
+
return /*#__PURE__*/React.createElement(Formatter, formatterProps);
|
|
114
106
|
}
|
|
115
|
-
return /*#__PURE__*/
|
|
107
|
+
return /*#__PURE__*/React.createElement(SimpleCellFormatter, formatterProps);
|
|
116
108
|
}
|
|
117
109
|
render() {
|
|
118
110
|
const {
|
|
@@ -130,4 +122,4 @@ LinkContent.defaultProps = {
|
|
|
130
122
|
maxDisplayLinks: DEFAULT_MAX_DISPLAY_LINKS,
|
|
131
123
|
Empty: null
|
|
132
124
|
};
|
|
133
|
-
|
|
125
|
+
export default LinkContent;
|
|
@@ -1,32 +1,25 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
exports.default = ColorSelector;
|
|
8
|
-
var _DTableSelect2 = _interopRequireDefault(require("dtable-ui-component/lib/DTableSelect"));
|
|
9
|
-
var _react = _interopRequireDefault(require("react"));
|
|
10
|
-
var _reactstrap = require("reactstrap");
|
|
11
|
-
var _colorRules = require("../../constants/color-rules");
|
|
12
|
-
var _intl = _interopRequireDefault(require("../../intl"));
|
|
13
|
-
function ColorSelector(_ref) {
|
|
1
|
+
import _DTableSelect from "dtable-ui-component/lib/DTableSelect";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { FormGroup, Label } from 'reactstrap';
|
|
4
|
+
import { SUPPORT_SINGLE_SELECT_THEMES_OPTIONS } from '../../constants/color-rules';
|
|
5
|
+
import intl from '../../intl';
|
|
6
|
+
export default function ColorSelector(_ref) {
|
|
14
7
|
let {
|
|
15
8
|
colorTheme,
|
|
16
9
|
onChange
|
|
17
10
|
} = _ref;
|
|
18
11
|
const options = [{
|
|
19
|
-
value:
|
|
20
|
-
label: /*#__PURE__*/
|
|
12
|
+
value: SUPPORT_SINGLE_SELECT_THEMES_OPTIONS.DEFAULT,
|
|
13
|
+
label: /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("span", null, intl.get('Use_default_color')))
|
|
21
14
|
}, {
|
|
22
|
-
value:
|
|
23
|
-
label: /*#__PURE__*/
|
|
15
|
+
value: SUPPORT_SINGLE_SELECT_THEMES_OPTIONS.SINGLE_SELECT_COLUMN_COLORS,
|
|
16
|
+
label: /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("span", null, intl.get('Use_colors_in_single_select_solumn')))
|
|
24
17
|
}];
|
|
25
18
|
const selectedOption = options.find(option => option.value === colorTheme);
|
|
26
19
|
const handleChange = selectedOption => {
|
|
27
20
|
onChange(selectedOption.value);
|
|
28
21
|
};
|
|
29
|
-
return /*#__PURE__*/
|
|
22
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(FormGroup, null, /*#__PURE__*/React.createElement(Label, null, intl.get('Color')), /*#__PURE__*/React.createElement(_DTableSelect, {
|
|
30
23
|
value: selectedOption,
|
|
31
24
|
onChange: handleChange,
|
|
32
25
|
options: options
|
|
@@ -1,11 +1,4 @@
|
|
|
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"));
|
|
1
|
+
import React from 'react';
|
|
9
2
|
const Collaborator = _ref => {
|
|
10
3
|
let {
|
|
11
4
|
collaborator = {}
|
|
@@ -14,20 +7,20 @@ const Collaborator = _ref => {
|
|
|
14
7
|
avatar_url,
|
|
15
8
|
name
|
|
16
9
|
} = collaborator || {};
|
|
17
|
-
return /*#__PURE__*/
|
|
10
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
18
11
|
className: "collaborators-formatter"
|
|
19
|
-
}, /*#__PURE__*/
|
|
12
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
20
13
|
className: "collaborator"
|
|
21
|
-
}, /*#__PURE__*/
|
|
14
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
22
15
|
className: "collaborator-avatar-container"
|
|
23
|
-
}, /*#__PURE__*/
|
|
16
|
+
}, /*#__PURE__*/React.createElement("img", {
|
|
24
17
|
src: avatar_url,
|
|
25
18
|
alt: '',
|
|
26
19
|
className: "collaborator-avatar"
|
|
27
|
-
})), /*#__PURE__*/
|
|
20
|
+
})), /*#__PURE__*/React.createElement("span", {
|
|
28
21
|
className: "collaborator-name",
|
|
29
22
|
title: name,
|
|
30
23
|
"aria-label": name
|
|
31
24
|
}, name)));
|
|
32
25
|
};
|
|
33
|
-
|
|
26
|
+
export default Collaborator;
|
|
@@ -1,14 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.default = void 0;
|
|
8
|
-
var _DTableColorPicker2 = _interopRequireDefault(require("dtable-ui-component/lib/DTableColorPicker"));
|
|
9
|
-
var _react = _interopRequireDefault(require("react"));
|
|
10
|
-
require("./index.css");
|
|
11
|
-
class ColorPicker extends _react.default.PureComponent {
|
|
1
|
+
import _DTableColorPicker from "dtable-ui-component/lib/DTableColorPicker";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import './index.css';
|
|
4
|
+
class ColorPicker extends React.PureComponent {
|
|
12
5
|
constructor(props) {
|
|
13
6
|
super(props);
|
|
14
7
|
this.onPickColorToggle = () => {
|
|
@@ -25,30 +18,30 @@ class ColorPicker extends _react.default.PureComponent {
|
|
|
25
18
|
isShowColorPicker: false
|
|
26
19
|
};
|
|
27
20
|
this.colorPickerContainerRef = null;
|
|
28
|
-
this.colorPickerRef =
|
|
21
|
+
this.colorPickerRef = React.createRef();
|
|
29
22
|
}
|
|
30
23
|
render() {
|
|
31
24
|
const {
|
|
32
25
|
activeColor
|
|
33
26
|
} = this.props;
|
|
34
27
|
const isWhiteColor = activeColor && activeColor.toUpperCase() === '#FFFFFF';
|
|
35
|
-
return /*#__PURE__*/
|
|
28
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
36
29
|
className: "color-picker-container",
|
|
37
30
|
ref: ref => this.colorPickerContainerRef = ref
|
|
38
|
-
}, /*#__PURE__*/
|
|
31
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
39
32
|
className: "picker-control"
|
|
40
|
-
}, /*#__PURE__*/
|
|
41
|
-
className:
|
|
33
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
34
|
+
className: `color-control ${isWhiteColor ? 'white-color' : ''}`,
|
|
42
35
|
onClick: this.onPickColorToggle,
|
|
43
36
|
style: {
|
|
44
37
|
background: activeColor
|
|
45
38
|
}
|
|
46
|
-
}), /*#__PURE__*/
|
|
39
|
+
}), /*#__PURE__*/React.createElement("input", {
|
|
47
40
|
className: "text-control",
|
|
48
41
|
type: "text",
|
|
49
42
|
value: activeColor,
|
|
50
43
|
onChange: this.onInputChanged
|
|
51
|
-
})), this.state.isShowColorPicker && /*#__PURE__*/
|
|
44
|
+
})), this.state.isShowColorPicker && /*#__PURE__*/React.createElement(_DTableColorPicker, {
|
|
52
45
|
ref: this.colorPickerRef,
|
|
53
46
|
color: activeColor,
|
|
54
47
|
onSubmit: this.props.onColorChanged,
|
|
@@ -62,4 +55,4 @@ class ColorPicker extends _react.default.PureComponent {
|
|
|
62
55
|
ColorPicker.defaultProps = {
|
|
63
56
|
activeColor: '#000000'
|
|
64
57
|
};
|
|
65
|
-
|
|
58
|
+
export default ColorPicker;
|