sea-chart 1.1.105 → 1.1.107

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.
@@ -1,7 +1,7 @@
1
1
  import React, { Component } from 'react';
2
2
  import classnames from 'classnames';
3
+ import { getColumnFilterOptions, CellType } from 'dtable-utils';
3
4
  import intl from '../../intl';
4
- import { CellType, FILTER_COLUMN_OPTIONS } from 'dtable-utils';
5
5
  import CommonAddTool from '../common-add-tool';
6
6
  import DTablePopover from '../dtable-popover';
7
7
  import ColorRules from './color-rules';
@@ -75,7 +75,9 @@ class ColorRulesPopover extends Component {
75
75
  switch (filterType) {
76
76
  case COLOR_RULE_FILTER_TYPE_MAP.NUMERIC_VALUE:
77
77
  {
78
- return FILTER_COLUMN_OPTIONS[CellType.NUMBER];
78
+ return getColumnFilterOptions({
79
+ type: CellType.NUMBER
80
+ });
79
81
  }
80
82
  default:
81
83
  {
@@ -1,4 +1,4 @@
1
- import { COLUMNS_ICON_CONFIG } from 'dtable-utils';
1
+ import _DTableColumnIcon from "dtable-ui-component/lib/DTableColumnIcon";
2
2
  import React, { useEffect, useRef } from 'react';
3
3
  import { UncontrolledPopover } from 'reactstrap';
4
4
  import isHotkey from 'is-hotkey';
@@ -93,8 +93,9 @@ export default function DrillDownFieldsPopover(_ref) {
93
93
  }, /*#__PURE__*/React.createElement("td", {
94
94
  className: "pl-5 text-truncate",
95
95
  title: column.name
96
- }, /*#__PURE__*/React.createElement("i", {
97
- className: `${COLUMNS_ICON_CONFIG[column.type]} mr-2 ${styles['drill-down-fields-icon']}`
96
+ }, /*#__PURE__*/React.createElement(_DTableColumnIcon, {
97
+ column: column,
98
+ className: `${styles['drill-down-fields-icon']} mr-2`
98
99
  }), /*#__PURE__*/React.createElement("span", null, column.name)), /*#__PURE__*/React.createElement("td", {
99
100
  className: `${styles['column-checkbox']} pr-3`
100
101
  }, /*#__PURE__*/React.createElement("input", {
@@ -1,4 +1,5 @@
1
1
  import _DTableSwitch from "dtable-ui-component/lib/DTableSwitch";
2
+ import _DTableColumnIcon from "dtable-ui-component/lib/DTableColumnIcon";
2
3
  import React from 'react';
3
4
  class HideColumnItem extends React.PureComponent {
4
5
  constructor(props) {
@@ -40,11 +41,14 @@ class HideColumnItem extends React.PureComponent {
40
41
  const {
41
42
  readonly
42
43
  } = this.props;
43
- const placeholder = /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("i", {
44
- className: `dtable-font ${setting.columnIcon}`
44
+ const {
45
+ column
46
+ } = setting;
47
+ const placeholder = /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(_DTableColumnIcon, {
48
+ column: column
45
49
  }), /*#__PURE__*/React.createElement("span", {
46
50
  className: "text-truncate"
47
- }, setting.columnName));
51
+ }, column.name));
48
52
  return /*#__PURE__*/React.createElement(_DTableSwitch, {
49
53
  checked: setting.isChecked,
50
54
  disabled: readonly,
@@ -2,8 +2,12 @@
2
2
  width: 192px;
3
3
  display: inline-flex;
4
4
  align-items: center;
5
- margin: 0;
6
5
  padding-right: 5px;
6
+ margin: 0;
7
+ }
8
+
9
+ .hidden-column-popover .field-settings-body .dtable-switch.dropdown-item {
10
+ padding: 0 10px;
7
11
  }
8
12
 
9
13
  .hidden-column-popover .custom-switch .dtable-font {
@@ -35,4 +39,4 @@
35
39
  border-radius: 50%;
36
40
  transition: .3s left;
37
41
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, .4);
38
- }
42
+ }
@@ -2,7 +2,6 @@ import React from 'react';
2
2
  // import intl from 'react-intl-universal';
3
3
  import { UncontrolledPopover } from 'reactstrap';
4
4
  import isHotkey from 'is-hotkey';
5
- import { COLUMNS_ICON_CONFIG } from 'dtable-utils';
6
5
  import intl from '../../../intl';
7
6
  import { getEventClassName } from '../../../utils';
8
7
  import HideColumnItem from './hide-column-popover-widgets/hide-column-item';
@@ -112,7 +111,7 @@ class HideColumnPopover extends React.Component {
112
111
  return fieldSettings;
113
112
  }
114
113
  return fieldSettings.filter(setting => {
115
- return setting.columnName.toLowerCase().includes(searchVal);
114
+ return setting.column.name.toLowerCase().includes(searchVal);
116
115
  });
117
116
  };
118
117
  this.state = {
@@ -137,8 +136,7 @@ class HideColumnPopover extends React.Component {
137
136
  return {
138
137
  key: column.key,
139
138
  isChecked: shownColumnKeys.includes(column.key),
140
- columnName: column.name,
141
- columnIcon: COLUMNS_ICON_CONFIG[column.type]
139
+ column: column
142
140
  };
143
141
  });
144
142
  // table page cannot hide first column
@@ -1,9 +1,10 @@
1
1
  import _DTableCustomizeSelect from "dtable-ui-component/lib/DTableCustomizeSelect";
2
+ import _DTableColumnIcon from "dtable-ui-component/lib/DTableColumnIcon";
2
3
  import React, { Component, Fragment } from 'react';
3
4
  // import intl from 'react-intl-universal';
4
5
  import isHotkey from 'is-hotkey';
5
6
  import { Button, UncontrolledPopover } from 'reactstrap';
6
- import { COLUMNS_ICON_CONFIG, SORT_COLUMN_OPTIONS, SORT_TYPE } from 'dtable-utils';
7
+ import { SORT_COLUMN_OPTIONS, SORT_TYPE } from 'dtable-utils';
7
8
  import { getEventClassName, getColumnByKey } from '../../../utils';
8
9
  import CommonAddTool from '../../common-add-tool';
9
10
  // import eventBus from '../../utils/event-bus';
@@ -118,7 +119,6 @@ class SortPopover extends Component {
118
119
  const sortableColumns = columns.filter(column => SORT_COLUMN_OPTIONS.includes(column.type));
119
120
  return sortableColumns.map(column => {
120
121
  const {
121
- type,
122
122
  name
123
123
  } = column;
124
124
  return {
@@ -127,8 +127,8 @@ class SortPopover extends Component {
127
127
  },
128
128
  label: /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement("span", {
129
129
  className: "filter-header-icon"
130
- }, /*#__PURE__*/React.createElement("i", {
131
- className: COLUMNS_ICON_CONFIG[type]
130
+ }, /*#__PURE__*/React.createElement(_DTableColumnIcon, {
131
+ column: column
132
132
  })), /*#__PURE__*/React.createElement("span", {
133
133
  className: "select-option-name"
134
134
  }, name))
@@ -161,8 +161,7 @@ class SortPopover extends Component {
161
161
  };
162
162
  this.renderSortItem = (column, sort, index) => {
163
163
  let {
164
- name,
165
- type
164
+ name
166
165
  } = column;
167
166
  const {
168
167
  readonly
@@ -170,8 +169,8 @@ class SortPopover extends Component {
170
169
  let selectedColumn = {
171
170
  label: /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement("span", {
172
171
  className: "filter-header-icon"
173
- }, /*#__PURE__*/React.createElement("i", {
174
- className: COLUMNS_ICON_CONFIG[type]
172
+ }, /*#__PURE__*/React.createElement(_DTableColumnIcon, {
173
+ column: column
175
174
  })), /*#__PURE__*/React.createElement("span", {
176
175
  className: "select-option-name",
177
176
  title: name,
@@ -1,7 +1,8 @@
1
1
  import _DTableSelect from "dtable-ui-component/lib/DTableSelect";
2
+ import _DTableColumnIcon from "dtable-ui-component/lib/DTableColumnIcon";
2
3
  import React, { useCallback, useMemo } from 'react';
3
4
  import { FormGroup } from 'reactstrap';
4
- import { COLUMNS_ICON_CONFIG, getTableById } from 'dtable-utils';
5
+ import { getTableById } from 'dtable-utils';
5
6
  import CommonDataSettings from '../widgets/common-data-settings';
6
7
  import { BaseUtils } from '../../utils';
7
8
  import { CHART_SUMMARY_SHOW, CHART_SUMMARY_CALCULATION_METHOD, CHART_SUPPORT_COLUMNS, CHART_Y_GROUP_TYPE, BASIC_NUMBER_CARD_CALCULATION_METHOD } from '../../constants';
@@ -59,8 +60,8 @@ const DataSettings = _ref => {
59
60
  value: column,
60
61
  label: /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("span", {
61
62
  className: "sea-chart-column-icon"
62
- }, /*#__PURE__*/React.createElement("i", {
63
- className: COLUMNS_ICON_CONFIG[column.type]
63
+ }, /*#__PURE__*/React.createElement(_DTableColumnIcon, {
64
+ column: column
64
65
  })), /*#__PURE__*/React.createElement("span", {
65
66
  className: 'select-module select-module-name ml-0'
66
67
  }, column.name))
@@ -1,7 +1,8 @@
1
1
  import _DTableSelect from "dtable-ui-component/lib/DTableSelect";
2
+ import _DTableColumnIcon from "dtable-ui-component/lib/DTableColumnIcon";
2
3
  import React, { Fragment, useCallback, useMemo } from 'react';
3
4
  import { FormGroup } from 'reactstrap';
4
- import { COLUMNS_ICON_CONFIG, getTableById } from 'dtable-utils';
5
+ import { getTableById } from 'dtable-utils';
5
6
  import CommonDataSettings from '../widgets/common-data-settings';
6
7
  import { BaseUtils } from '../../utils';
7
8
  import { CHART_SUMMARY_SHOW, CHART_SUMMARY_CALCULATION_METHOD, CHART_SUPPORT_COLUMNS, BASIC_NUMBER_CARD_CALCULATION_METHOD } from '../../constants';
@@ -44,8 +45,8 @@ const DataSettings = _ref => {
44
45
  value: column,
45
46
  label: /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("span", {
46
47
  className: "sea-chart-column-icon"
47
- }, /*#__PURE__*/React.createElement("i", {
48
- className: COLUMNS_ICON_CONFIG[column.type]
48
+ }, /*#__PURE__*/React.createElement(_DTableColumnIcon, {
49
+ column: column
49
50
  })), /*#__PURE__*/React.createElement("span", {
50
51
  className: 'select-module select-module-name ml-0'
51
52
  }, column.name))
@@ -1,5 +1,5 @@
1
1
  import _DTableSelect from "dtable-ui-component/lib/DTableSelect";
2
- import { COLUMNS_ICON_CONFIG } from 'dtable-utils';
2
+ import _DTableColumnIcon from "dtable-ui-component/lib/DTableColumnIcon";
3
3
  import React, { useCallback, useMemo } from 'react';
4
4
  import { FormGroup, Label } from 'reactstrap';
5
5
  import { cloneDeep } from 'lodash';
@@ -17,8 +17,8 @@ export default function FunnelLayerSetting(_ref) {
17
17
  value: column,
18
18
  label: /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("span", {
19
19
  className: "header-icon"
20
- }, /*#__PURE__*/React.createElement("i", {
21
- className: COLUMNS_ICON_CONFIG[column.type]
20
+ }, /*#__PURE__*/React.createElement(_DTableColumnIcon, {
21
+ column: column
22
22
  })), /*#__PURE__*/React.createElement("span", {
23
23
  className: 'select-option-name'
24
24
  }, column.name))
@@ -37,8 +37,8 @@ export default function FunnelLayerSetting(_ref) {
37
37
  value: selectedColumn,
38
38
  label: /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("span", {
39
39
  className: "header-icon"
40
- }, /*#__PURE__*/React.createElement("i", {
41
- className: COLUMNS_ICON_CONFIG[selectedColumn.type]
40
+ }, /*#__PURE__*/React.createElement(_DTableColumnIcon, {
41
+ column: selectedColumn
42
42
  })), /*#__PURE__*/React.createElement("span", {
43
43
  className: 'select-option-name'
44
44
  }, selectedColumn.name))
@@ -1,8 +1,9 @@
1
1
  import _DTableSelect from "dtable-ui-component/lib/DTableSelect";
2
2
  import _DTableSwitch from "dtable-ui-component/lib/DTableSwitch";
3
+ import _DTableColumnIcon from "dtable-ui-component/lib/DTableColumnIcon";
3
4
  import React, { useCallback, useMemo } from 'react';
4
5
  import { FormGroup, Label } from 'reactstrap';
5
- import { CellType, COLUMNS_ICON_CONFIG, DATE_COLUMN_OPTIONS, getTableById } from 'dtable-utils';
6
+ import { CellType, DATE_COLUMN_OPTIONS, getTableById } from 'dtable-utils';
6
7
  import CommonDataSettings from '../widgets/common-data-settings';
7
8
  import Divider from '../widgets/divider';
8
9
  import GroupBy from '../widgets/group-by';
@@ -37,8 +38,8 @@ const DataSettings = _ref => {
37
38
  value: column,
38
39
  label: /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("span", {
39
40
  className: "sea-chart-column-icon"
40
- }, /*#__PURE__*/React.createElement("i", {
41
- className: COLUMNS_ICON_CONFIG[column.type]
41
+ }, /*#__PURE__*/React.createElement(_DTableColumnIcon, {
42
+ column: column
42
43
  })), /*#__PURE__*/React.createElement("span", {
43
44
  className: "select-module select-module-name ml-0"
44
45
  }, column.name))
@@ -1,7 +1,8 @@
1
1
  import _DTableSelect from "dtable-ui-component/lib/DTableSelect";
2
+ import _DTableColumnIcon from "dtable-ui-component/lib/DTableColumnIcon";
2
3
  import React, { useCallback, useMemo } from 'react';
3
4
  import { Label, FormGroup } from 'reactstrap';
4
- import { COLUMNS_ICON_CONFIG, CellType, getTableById } from 'dtable-utils';
5
+ import { CellType, getTableById } from 'dtable-utils';
5
6
  import { BaseUtils } from '../../../utils';
6
7
  import intl from '../../../intl';
7
8
  import StacksSettings from '../../stacks-settings';
@@ -44,8 +45,8 @@ const BasicSummary = _ref => {
44
45
  column: column,
45
46
  label: /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("span", {
46
47
  className: "sea-chart-column-icon"
47
- }, /*#__PURE__*/React.createElement("i", {
48
- className: COLUMNS_ICON_CONFIG[column.type]
48
+ }, /*#__PURE__*/React.createElement(_DTableColumnIcon, {
49
+ column: column
49
50
  })), /*#__PURE__*/React.createElement("span", {
50
51
  className: "select-module select-module-name ml-0"
51
52
  }, column.name))
@@ -1,9 +1,10 @@
1
1
  import _DTableSelect from "dtable-ui-component/lib/DTableSelect";
2
2
  import _DTableCustomizeSelect from "dtable-ui-component/lib/DTableCustomizeSelect";
3
+ import _DTableColumnIcon from "dtable-ui-component/lib/DTableColumnIcon";
3
4
  import React, { Component } from 'react';
4
5
  import classnames from 'classnames';
5
6
  import { Label, FormGroup } from 'reactstrap';
6
- import { CellType, COLUMNS_ICON_CONFIG, DATE_COLUMN_OPTIONS, getTableById, getTableColumnByKey } from 'dtable-utils';
7
+ import { CellType, DATE_COLUMN_OPTIONS, getTableById, getTableColumnByKey } from 'dtable-utils';
7
8
  import { isDateFormulaColumn } from '../../utils/column-utils';
8
9
  import { CHART_SUPPORT_COLUMNS, DATE_GRANULATES, GEOLOCATION_GRANULATES, CHART_SUMMARY_SHOW, GEOLOCATION_FORMAT_MAP, CHART_TYPE, TIME_COLUMN_LIST, COMPLETENESS_GROUPBY_SUPPORTED_COLUMN_TYPE, NUMBERIC_COLUMN_TYPE, MIRROR_COLUMN_LIST } from '../../constants';
9
10
  import intl from '../../intl';
@@ -92,8 +93,8 @@ class GroupBy extends Component {
92
93
  value: column,
93
94
  label: /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("span", {
94
95
  className: "header-icon"
95
- }, /*#__PURE__*/React.createElement("i", {
96
- className: COLUMNS_ICON_CONFIG[column.type]
96
+ }, /*#__PURE__*/React.createElement(_DTableColumnIcon, {
97
+ column: column
97
98
  })), /*#__PURE__*/React.createElement("span", {
98
99
  className: 'select-option-name'
99
100
  }, column.name))
@@ -1,6 +1,7 @@
1
1
  import _DTableSelect from "dtable-ui-component/lib/DTableSelect";
2
+ import _DTableColumnIcon from "dtable-ui-component/lib/DTableColumnIcon";
2
3
  import React, { Component, Fragment } from 'react';
3
- import { COLUMNS_ICON_CONFIG, getTableById } from 'dtable-utils';
4
+ import { getTableById } from 'dtable-utils';
4
5
  import { FormGroup, Label } from 'reactstrap';
5
6
  import { BaseUtils } from '../../utils';
6
7
  import { CHART_SUMMARY_SHOW, CHART_SUMMARY_CALCULATION_METHOD, CHART_SUMMARY_TYPE, CHART_Y_GROUP_TYPE, CHART_TYPE, CHART_SUPPORT_COLUMNS, CHART_DATE_SUMMARY_CALCULATION_METHOD } from '../../constants';
@@ -42,8 +43,8 @@ class SummarySettings extends Component {
42
43
  value: column,
43
44
  label: /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("span", {
44
45
  className: "sea-chart-column-icon"
45
- }, /*#__PURE__*/React.createElement("i", {
46
- className: COLUMNS_ICON_CONFIG[column.type]
46
+ }, /*#__PURE__*/React.createElement(_DTableColumnIcon, {
47
+ column: column
47
48
  })), /*#__PURE__*/React.createElement("span", {
48
49
  className: 'select-module select-module-name ml-0'
49
50
  }, column.name))
@@ -1,7 +1,8 @@
1
1
  import _DTableSelect from "dtable-ui-component/lib/DTableSelect";
2
+ import _DTableColumnIcon from "dtable-ui-component/lib/DTableColumnIcon";
2
3
  import React, { Component } from 'react';
3
4
  import { FormGroup, Label } from 'reactstrap';
4
- import { COLUMNS_ICON_CONFIG, getTableById } from 'dtable-utils';
5
+ import { getTableById } from 'dtable-utils';
5
6
  import { CHART_Y_GROUP_TYPE, CHART_SUMMARY_SHOW, CHART_SUMMARY_CALCULATION_METHOD, CHART_SUMMARY_TYPE, DATE_GRANULATES, GEOLOCATION_GRANULATES, CHART_DATE_SUMMARY_CALCULATION_METHOD, CHART_SUPPORT_COLUMNS, CHART_TYPE } from '../../constants';
6
7
  import { BaseUtils } from '../../utils';
7
8
  import intl from '../../intl';
@@ -74,8 +75,8 @@ class YAxisGroupSettings extends Component {
74
75
  value: column,
75
76
  label: /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("span", {
76
77
  className: "sea-chart-column-icon"
77
- }, /*#__PURE__*/React.createElement("i", {
78
- className: COLUMNS_ICON_CONFIG[column.type]
78
+ }, /*#__PURE__*/React.createElement(_DTableColumnIcon, {
79
+ column: column
79
80
  })), /*#__PURE__*/React.createElement("span", {
80
81
  className: 'select-module select-module-name ml-0'
81
82
  }, column.name))
@@ -1,5 +1,5 @@
1
+ import _DTableColumnIcon from "dtable-ui-component/lib/DTableColumnIcon";
1
2
  import { CellType, DEFAULT_DATE_FORMAT, FORMULA_COLUMN_TYPES_MAP, FORMULA_RESULT_TYPE, isNumber, isNumericColumn, getNumberDisplayString } from 'dtable-utils';
2
- import { COLUMNS_ICON_CONFIG } from 'dtable-utils';
3
3
  import React from 'react';
4
4
  import { MIRROR_COLUMN_LIST, CHART_SUMMARY_TYPE } from '../constants';
5
5
  import { getClientFormulaDisplayString } from './cell-format-utils';
@@ -205,8 +205,8 @@ export function getColumnOptions(columns) {
205
205
  value: column,
206
206
  label: /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("span", {
207
207
  className: "sea-chart-column-icon"
208
- }, /*#__PURE__*/React.createElement("i", {
209
- className: COLUMNS_ICON_CONFIG[column.type]
208
+ }, /*#__PURE__*/React.createElement(_DTableColumnIcon, {
209
+ column: column
210
210
  })), /*#__PURE__*/React.createElement("span", {
211
211
  className: 'select-module select-module-name ml-0'
212
212
  }, column.name))
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sea-chart",
3
- "version": "1.1.105",
3
+ "version": "1.1.107",
4
4
  "main": "./dist/index.js",
5
5
  "dependencies": {
6
6
  "@antv/data-set": "0.11.8",
@@ -11,7 +11,7 @@
11
11
  "@dnd-kit/utilities": "^3.2.2",
12
12
  "@seafile/seafile-calendar": "^0.0.24",
13
13
  "@seafile/seafile-editor": "^2.0.12",
14
- "axios": "~1.8.*",
14
+ "axios": "~1.12.*",
15
15
  "classnames": "^2.3.2",
16
16
  "dayjs": "1.10.7",
17
17
  "is-hotkey": "0.2.0",
@@ -99,7 +99,7 @@
99
99
  "css-minimizer-webpack-plugin": "5.0.1",
100
100
  "dotenv": "6.2.0",
101
101
  "dotenv-expand": "5.1.0",
102
- "dtable-store": "~6.0.3",
102
+ "dtable-store": "~6.0.11",
103
103
  "ejs": "3.1.10",
104
104
  "eslint": "^6.8.0",
105
105
  "eslint-config-react-app": "^5.0.2",