@pie-lib/charting 5.18.0 → 5.19.0

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.
Files changed (68) hide show
  1. package/CHANGELOG.md +13 -65
  2. package/package.json +5 -4
  3. package/src/actions-button.jsx +2 -2
  4. package/src/axes.jsx +1 -1
  5. package/src/bars/common/bars.jsx +1 -1
  6. package/src/chart-setup.jsx +1 -1
  7. package/src/common/drag-handle.jsx +1 -1
  8. package/src/common/styles.js +1 -1
  9. package/src/grid.jsx +1 -1
  10. package/src/key-legend.jsx +1 -1
  11. package/src/line/common/drag-handle.jsx +1 -1
  12. package/src/line/common/line.jsx +1 -1
  13. package/src/line/line-cross.js +1 -1
  14. package/src/line/line-dot.js +1 -1
  15. package/src/mark-label.jsx +1 -1
  16. package/src/plot/common/plot.jsx +1 -1
  17. package/src/tool-menu.jsx +1 -1
  18. package/lib/actions-button.js +0 -174
  19. package/lib/actions-button.js.map +0 -1
  20. package/lib/axes.js +0 -614
  21. package/lib/axes.js.map +0 -1
  22. package/lib/bars/bar.js +0 -86
  23. package/lib/bars/bar.js.map +0 -1
  24. package/lib/bars/common/bars.js +0 -299
  25. package/lib/bars/common/bars.js.map +0 -1
  26. package/lib/bars/histogram.js +0 -87
  27. package/lib/bars/histogram.js.map +0 -1
  28. package/lib/chart-setup.js +0 -458
  29. package/lib/chart-setup.js.map +0 -1
  30. package/lib/chart-type.js +0 -71
  31. package/lib/chart-type.js.map +0 -1
  32. package/lib/chart-types.js +0 -31
  33. package/lib/chart-types.js.map +0 -1
  34. package/lib/chart.js +0 -447
  35. package/lib/chart.js.map +0 -1
  36. package/lib/common/drag-handle.js +0 -175
  37. package/lib/common/drag-handle.js.map +0 -1
  38. package/lib/common/drag-icon.js +0 -52
  39. package/lib/common/drag-icon.js.map +0 -1
  40. package/lib/common/styles.js +0 -40
  41. package/lib/common/styles.js.map +0 -1
  42. package/lib/grid.js +0 -141
  43. package/lib/grid.js.map +0 -1
  44. package/lib/index.js +0 -48
  45. package/lib/index.js.map +0 -1
  46. package/lib/key-legend.js +0 -111
  47. package/lib/key-legend.js.map +0 -1
  48. package/lib/line/common/drag-handle.js +0 -151
  49. package/lib/line/common/drag-handle.js.map +0 -1
  50. package/lib/line/common/line.js +0 -257
  51. package/lib/line/common/line.js.map +0 -1
  52. package/lib/line/line-cross.js +0 -203
  53. package/lib/line/line-cross.js.map +0 -1
  54. package/lib/line/line-dot.js +0 -156
  55. package/lib/line/line-dot.js.map +0 -1
  56. package/lib/mark-label.js +0 -260
  57. package/lib/mark-label.js.map +0 -1
  58. package/lib/plot/common/plot.js +0 -281
  59. package/lib/plot/common/plot.js.map +0 -1
  60. package/lib/plot/dot.js +0 -123
  61. package/lib/plot/dot.js.map +0 -1
  62. package/lib/plot/line.js +0 -152
  63. package/lib/plot/line.js.map +0 -1
  64. package/lib/shared/index.js +0 -136
  65. package/lib/tool-menu.js +0 -142
  66. package/lib/tool-menu.js.map +0 -1
  67. package/lib/utils.js +0 -244
  68. package/lib/utils.js.map +0 -1
package/CHANGELOG.md CHANGED
@@ -3,7 +3,7 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
- # [5.18.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/charting@5.15.6...@pie-lib/charting@5.18.0) (2025-07-31)
6
+ # [5.19.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/charting@5.15.6...@pie-lib/charting@5.19.0) (2025-07-31)
7
7
 
8
8
  **Note:** Version bump only for package @pie-lib/charting
9
9
 
@@ -11,7 +11,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
11
11
 
12
12
 
13
13
 
14
- # [5.17.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/charting@5.15.6...@pie-lib/charting@5.17.0) (2025-07-31)
14
+ # [5.18.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/charting@5.15.6...@pie-lib/charting@5.18.0) (2025-07-31)
15
15
 
16
16
  **Note:** Version bump only for package @pie-lib/charting
17
17
 
@@ -19,7 +19,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
19
19
 
20
20
 
21
21
 
22
- # [5.16.0-beta.8](https://github.com/pie-framework/pie-lib/compare/@pie-lib/charting@5.15.6...@pie-lib/charting@5.16.0-beta.8) (2025-07-25)
22
+ # [5.17.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/charting@5.15.6...@pie-lib/charting@5.17.0) (2025-07-31)
23
23
 
24
24
  **Note:** Version bump only for package @pie-lib/charting
25
25
 
@@ -27,142 +27,90 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
27
27
 
28
28
 
29
29
 
30
- # [5.16.0-beta.7](https://github.com/pie-framework/pie-lib/compare/@pie-lib/charting@5.15.6...@pie-lib/charting@5.16.0-beta.7) (2025-07-25)
30
+ # [5.17.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/charting@5.15.6...@pie-lib/charting@5.17.0) (2025-07-31)
31
31
 
32
32
  **Note:** Version bump only for package @pie-lib/charting
33
33
 
34
+ # [5.18.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/charting@5.15.6...@pie-lib/charting@5.18.0) (2025-07-31)
34
35
 
36
+ **Note:** Version bump only for package @pie-lib/charting
35
37
 
38
+ # [5.17.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/charting@5.15.6...@pie-lib/charting@5.17.0) (2025-07-31)
36
39
 
40
+ **Note:** Version bump only for package @pie-lib/charting
37
41
 
38
- # [5.16.0-beta.7](https://github.com/pie-framework/pie-lib/compare/@pie-lib/charting@5.15.6...@pie-lib/charting@5.16.0-beta.7) (2025-07-25)
42
+ # [5.16.0-beta.8](https://github.com/pie-framework/pie-lib/compare/@pie-lib/charting@5.15.6...@pie-lib/charting@5.16.0-beta.8) (2025-07-25)
39
43
 
40
44
  **Note:** Version bump only for package @pie-lib/charting
41
45
 
46
+ # [5.16.0-beta.7](https://github.com/pie-framework/pie-lib/compare/@pie-lib/charting@5.15.6...@pie-lib/charting@5.16.0-beta.7) (2025-07-25)
42
47
 
48
+ **Note:** Version bump only for package @pie-lib/charting
43
49
 
50
+ # [5.16.0-beta.7](https://github.com/pie-framework/pie-lib/compare/@pie-lib/charting@5.15.6...@pie-lib/charting@5.16.0-beta.7) (2025-07-25)
44
51
 
52
+ **Note:** Version bump only for package @pie-lib/charting
45
53
 
46
54
  # [5.16.0-beta.6](https://github.com/pie-framework/pie-lib/compare/@pie-lib/charting@5.15.6...@pie-lib/charting@5.16.0-beta.6) (2025-07-25)
47
55
 
48
56
  **Note:** Version bump only for package @pie-lib/charting
49
57
 
50
-
51
-
52
-
53
-
54
58
  # [5.16.0-beta.6](https://github.com/pie-framework/pie-lib/compare/@pie-lib/charting@5.15.6...@pie-lib/charting@5.16.0-beta.6) (2025-07-25)
55
59
 
56
60
  **Note:** Version bump only for package @pie-lib/charting
57
61
 
58
-
59
-
60
-
61
-
62
62
  # [5.16.0-beta.5](https://github.com/pie-framework/pie-lib/compare/@pie-lib/charting@5.15.6...@pie-lib/charting@5.16.0-beta.5) (2025-07-25)
63
63
 
64
64
  **Note:** Version bump only for package @pie-lib/charting
65
65
 
66
-
67
-
68
-
69
-
70
66
  # [5.16.0-beta.5](https://github.com/pie-framework/pie-lib/compare/@pie-lib/charting@5.15.6...@pie-lib/charting@5.16.0-beta.5) (2025-07-25)
71
67
 
72
68
  **Note:** Version bump only for package @pie-lib/charting
73
69
 
74
-
75
-
76
-
77
-
78
70
  # [5.16.0-beta.4](https://github.com/pie-framework/pie-lib/compare/@pie-lib/charting@5.15.6...@pie-lib/charting@5.16.0-beta.4) (2025-07-25)
79
71
 
80
72
  **Note:** Version bump only for package @pie-lib/charting
81
73
 
82
-
83
-
84
-
85
-
86
74
  # [5.16.0-beta.3](https://github.com/pie-framework/pie-lib/compare/@pie-lib/charting@5.15.6...@pie-lib/charting@5.16.0-beta.3) (2025-07-25)
87
75
 
88
76
  **Note:** Version bump only for package @pie-lib/charting
89
77
 
90
-
91
-
92
-
93
-
94
78
  # [5.16.0-beta.4](https://github.com/pie-framework/pie-lib/compare/@pie-lib/charting@5.15.6...@pie-lib/charting@5.16.0-beta.4) (2025-07-23)
95
79
 
96
80
  **Note:** Version bump only for package @pie-lib/charting
97
81
 
98
-
99
-
100
-
101
-
102
82
  # [5.16.0-beta.3](https://github.com/pie-framework/pie-lib/compare/@pie-lib/charting@5.15.6...@pie-lib/charting@5.16.0-beta.3) (2025-07-23)
103
83
 
104
84
  **Note:** Version bump only for package @pie-lib/charting
105
85
 
106
-
107
-
108
-
109
-
110
86
  # [5.16.0-beta.3](https://github.com/pie-framework/pie-lib/compare/@pie-lib/charting@5.15.6...@pie-lib/charting@5.16.0-beta.3) (2025-07-20)
111
87
 
112
88
  **Note:** Version bump only for package @pie-lib/charting
113
89
 
114
-
115
-
116
-
117
-
118
90
  # [5.16.0-beta.2](https://github.com/pie-framework/pie-lib/compare/@pie-lib/charting@5.15.6...@pie-lib/charting@5.16.0-beta.2) (2025-07-20)
119
91
 
120
92
  **Note:** Version bump only for package @pie-lib/charting
121
93
 
122
-
123
-
124
-
125
-
126
94
  # [5.16.0-beta.1](https://github.com/pie-framework/pie-lib/compare/@pie-lib/charting@5.15.6...@pie-lib/charting@5.16.0-beta.1) (2025-07-20)
127
95
 
128
96
  **Note:** Version bump only for package @pie-lib/charting
129
97
 
130
-
131
-
132
-
133
-
134
98
  # [5.16.0-beta.2](https://github.com/pie-framework/pie-lib/compare/@pie-lib/charting@5.15.6...@pie-lib/charting@5.16.0-beta.2) (2025-07-20)
135
99
 
136
100
  **Note:** Version bump only for package @pie-lib/charting
137
101
 
138
-
139
-
140
-
141
-
142
102
  # [5.16.0-beta.1](https://github.com/pie-framework/pie-lib/compare/@pie-lib/charting@5.15.6...@pie-lib/charting@5.16.0-beta.1) (2025-07-20)
143
103
 
144
104
  **Note:** Version bump only for package @pie-lib/charting
145
105
 
146
-
147
-
148
-
149
-
150
106
  # [5.16.0-beta.1](https://github.com/pie-framework/pie-lib/compare/@pie-lib/charting@5.15.6...@pie-lib/charting@5.16.0-beta.1) (2025-07-20)
151
107
 
152
108
  **Note:** Version bump only for package @pie-lib/charting
153
109
 
154
-
155
-
156
-
157
-
158
110
  # [5.16.0-beta.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/charting@5.15.6...@pie-lib/charting@5.16.0-beta.0) (2025-07-20)
159
111
 
160
112
  **Note:** Version bump only for package @pie-lib/charting
161
113
 
162
-
163
-
164
-
165
-
166
114
  # [5.17.0-beta.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/charting@5.15.6...@pie-lib/charting@5.17.0-beta.0) (2025-07-15)
167
115
 
168
116
  **Note:** Version bump only for package @pie-lib/charting
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "5.18.0",
6
+ "version": "5.19.0",
7
7
  "description": "charting",
8
8
  "keywords": [
9
9
  "react",
@@ -19,8 +19,9 @@
19
19
  "dependencies": {
20
20
  "@mapbox/point-geometry": "^0.1.0",
21
21
  "@material-ui/core": "^3.8.3",
22
- "@pie-lib/plot": "beta",
23
- "@pie-lib/translator": "beta",
22
+ "@pie-lib/plot": "^2.11.0",
23
+ "@pie-lib/render-ui": "^4.19.0",
24
+ "@pie-lib/translator": "^2.7.0",
24
25
  "@vx/axis": "^0.0.183",
25
26
  "@vx/event": "^0.0.182",
26
27
  "@vx/grid": "^0.0.183",
@@ -44,5 +45,5 @@
44
45
  "peerDependencies": {
45
46
  "react": "^16.8.1"
46
47
  },
47
- "gitHead": "ecb1ca31aa1c24d23af00d5ad04ce73ed8871057"
48
+ "gitHead": "889a13bfea2c768b8a3a6eabfc6fe7b7725aa832"
48
49
  }
@@ -5,7 +5,7 @@ import Button from '@material-ui/core/Button';
5
5
  import Popover from '@material-ui/core/Popover';
6
6
  import Paper from '@material-ui/core/Paper';
7
7
 
8
- import { color } from '../../render-ui/src/index';
8
+ import { color } from '@pie-lib/render-ui';
9
9
  import Translator from '@pie-lib/translator';
10
10
 
11
11
  const { translator } = Translator;
@@ -72,7 +72,7 @@ export class ActionsButton extends React.Component {
72
72
  !category.correctness && (
73
73
  <Button key={index} onClick={() => this.handleDeleteCategory(index)}>
74
74
  {`${translator.t('charting.delete', { lng: language })} <${category.label ||
75
- translator.t('charting.newLabel', { lng: language })}>`}
75
+ translator.t('charting.newLabel', { lng: language })}>`}
76
76
  </Button>
77
77
  ),
78
78
  )}
package/src/axes.jsx CHANGED
@@ -2,7 +2,7 @@ import React from 'react';
2
2
  import PropTypes from 'prop-types';
3
3
  import { withStyles } from '@material-ui/core/styles';
4
4
  import { types } from '@pie-lib/plot';
5
- import { color } from '../../render-ui/src/index';
5
+ import { color } from '@pie-lib/render-ui';
6
6
  import { AlertDialog } from '@pie-lib/config-ui';
7
7
  import { AxisLeft, AxisBottom } from '@vx/axis';
8
8
  import { bandKey, getTickValues, getRotateAngle } from './utils';
@@ -2,7 +2,7 @@ import React from 'react';
2
2
  import PropTypes from 'prop-types';
3
3
  import { types } from '@pie-lib/plot';
4
4
  import { Group } from '@vx/group';
5
- import { color } from '../../../render-ui/src/index';
5
+ import { color } from '@pie-lib/render-ui';
6
6
  import { Bar as VxBar } from '@vx/shape';
7
7
  import { withStyles } from '@material-ui/core/styles/index';
8
8
  import debug from 'debug';
@@ -1,6 +1,6 @@
1
1
  import React, { useState, useEffect } from 'react';
2
2
  import PropTypes from 'prop-types';
3
- import { color } from '../../render-ui/src/index';
3
+ import { color } from '@pie-lib/render-ui';
4
4
  import { withStyles } from '@material-ui/core/styles';
5
5
  import Typography from '@material-ui/core/Typography';
6
6
  import ChartType from './chart-type';
@@ -3,7 +3,7 @@ import PropTypes from 'prop-types';
3
3
  import classNames from 'classnames';
4
4
  import { withStyles } from '@material-ui/core/styles';
5
5
  import { gridDraggable, utils, types } from '@pie-lib/plot';
6
- import { color as enumColor } from '../../../render-ui/src/index';
6
+ import { color as enumColor } from '@pie-lib/render-ui';
7
7
  import { correct, incorrect, disabled } from './styles';
8
8
  import { getScale } from '../utils';
9
9
  import DragIcon from './drag-icon';
@@ -1,4 +1,4 @@
1
- import { color } from '../../../render-ui/src/index';
1
+ import { color } from '@pie-lib/render-ui';
2
2
 
3
3
  export const disabled = (key = 'fill') => ({
4
4
  [key]: `var(--graph-disabled, ${color.disabled()})`,
package/src/grid.jsx CHANGED
@@ -5,7 +5,7 @@ import classNames from 'classnames';
5
5
  import { GridRows, GridColumns } from '@vx/grid';
6
6
 
7
7
  import { types } from '@pie-lib/plot';
8
- import { color } from '../../render-ui/src/index';
8
+ import { color } from '@pie-lib/render-ui';
9
9
 
10
10
  export class Grid extends React.Component {
11
11
  static propTypes = {
@@ -3,7 +3,7 @@ import PropTypes from 'prop-types';
3
3
  import { withStyles } from '@material-ui/core/styles';
4
4
  import Check from '@material-ui/icons/Check';
5
5
  import Close from '@material-ui/icons/Close';
6
- import { color } from '../../render-ui/src/index';
6
+ import { color } from '@pie-lib/render-ui';
7
7
  import Translator from '@pie-lib/translator';
8
8
 
9
9
  const styles = (theme) => ({
@@ -2,7 +2,7 @@ import React from 'react';
2
2
  import classNames from 'classnames';
3
3
  import { gridDraggable, utils, types } from '@pie-lib/plot';
4
4
  import { withStyles } from '@material-ui/core/styles/index';
5
- import { color } from '../../../../render-ui/src/index';
5
+ import { color } from '@pie-lib/render-ui';
6
6
  import PropTypes from 'prop-types';
7
7
  import { correct, incorrect, disabled } from '../../common/styles';
8
8
 
@@ -6,7 +6,7 @@ import { types } from '@pie-lib/plot';
6
6
  import DraggableHandle, { DragHandle } from './drag-handle';
7
7
  import { withStyles } from '@material-ui/core/styles/index';
8
8
  import isEqual from 'lodash/isEqual';
9
- import { color } from '../../../../render-ui/src/index';
9
+ import { color } from '@pie-lib/render-ui';
10
10
 
11
11
  const getData = (data, domain) => {
12
12
  const { max } = domain || {};
@@ -4,7 +4,7 @@ import { types } from '@pie-lib/plot';
4
4
  import { LinePath } from '@vx/shape';
5
5
  import { Group } from '@vx/group';
6
6
  import classNames from 'classnames';
7
- import { color } from '../../../render-ui/src/index';
7
+ import { color } from '@pie-lib/render-ui';
8
8
  import { dataToXBand } from '../utils';
9
9
  import RawLine from './common/line';
10
10
 
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import PropTypes from 'prop-types';
3
3
  import { types } from '@pie-lib/plot';
4
- import { color } from '../../../render-ui/src/index';
4
+ import { color } from '@pie-lib/render-ui';
5
5
  import { dataToXBand } from '../utils';
6
6
  import RawLine from './common/line';
7
7
  import classNames from 'classnames';
@@ -5,7 +5,7 @@ import AutosizeInput from 'react-input-autosize';
5
5
  import PropTypes from 'prop-types';
6
6
  import { types } from '@pie-lib/plot';
7
7
  import { correct, incorrect, disabled } from './common/styles';
8
- import { color } from '../../render-ui/src/index';
8
+ import { color } from '@pie-lib/render-ui';
9
9
  import { renderMath } from '@pie-lib/math-rendering';
10
10
 
11
11
  const styles = (theme) => ({
@@ -5,7 +5,7 @@ import { Group } from '@vx/group';
5
5
  import { withStyles } from '@material-ui/core/styles/index';
6
6
  import DraggableHandle, { DragHandle } from '../../common/drag-handle';
7
7
  import debug from 'debug';
8
- import { color } from '../../../../render-ui/src/index';
8
+ import { color } from '@pie-lib/render-ui';
9
9
  import { bandKey } from '../../utils';
10
10
  import { correct, incorrect } from '../../common/styles';
11
11
 
package/src/tool-menu.jsx CHANGED
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import PropTypes from 'prop-types';
3
3
  import classNames from 'classnames';
4
- import { color } from '../../render-ui/src/index';
4
+ import { color } from '@pie-lib/render-ui';
5
5
 
6
6
  import { withStyles } from '@material-ui/core/styles';
7
7
  import cn from 'classnames';
@@ -1,174 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
- Object.defineProperty(exports, "__esModule", {
6
- value: true
7
- });
8
- exports["default"] = exports.ActionsButton = void 0;
9
-
10
- var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
11
-
12
- var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
13
-
14
- var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
15
-
16
- var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
17
-
18
- var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
19
-
20
- var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
21
-
22
- var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
23
-
24
- var _react = _interopRequireDefault(require("react"));
25
-
26
- var _propTypes = _interopRequireDefault(require("prop-types"));
27
-
28
- var _styles = require("@material-ui/core/styles");
29
-
30
- var _Button = _interopRequireDefault(require("@material-ui/core/Button"));
31
-
32
- var _Popover = _interopRequireDefault(require("@material-ui/core/Popover"));
33
-
34
- var _Paper = _interopRequireDefault(require("@material-ui/core/Paper"));
35
-
36
- var _index = require("./shared/index");
37
-
38
- var _translator = _interopRequireDefault(require("@pie-lib/translator"));
39
-
40
- function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2["default"])(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2["default"])(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2["default"])(this, result); }; }
41
-
42
- function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
43
-
44
- var translator = _translator["default"].translator;
45
-
46
- var ActionsButton = /*#__PURE__*/function (_React$Component) {
47
- (0, _inherits2["default"])(ActionsButton, _React$Component);
48
-
49
- var _super = _createSuper(ActionsButton);
50
-
51
- function ActionsButton(props) {
52
- var _this;
53
-
54
- (0, _classCallCheck2["default"])(this, ActionsButton);
55
- _this = _super.call(this, props);
56
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "handleActionsClick", function (event) {
57
- _this.setState({
58
- actionsAnchorEl: event.currentTarget
59
- });
60
- });
61
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "handleActionsClose", function () {
62
- _this.setState({
63
- actionsAnchorEl: null
64
- });
65
- });
66
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "handleAddCategory", function () {
67
- var addCategory = _this.props.addCategory;
68
- addCategory();
69
-
70
- _this.handleActionsClose();
71
- });
72
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "handleDeleteCategory", function (index) {
73
- var deleteCategory = _this.props.deleteCategory;
74
- deleteCategory(index);
75
-
76
- _this.handleActionsClose();
77
- });
78
- _this.state = {
79
- actionsAnchorEl: null
80
- };
81
- return _this;
82
- }
83
-
84
- (0, _createClass2["default"])(ActionsButton, [{
85
- key: "render",
86
- value: function render() {
87
- var _this2 = this;
88
-
89
- var _this$props = this.props,
90
- classes = _this$props.classes,
91
- categories = _this$props.categories,
92
- language = _this$props.language;
93
- return /*#__PURE__*/_react["default"].createElement("div", {
94
- className: classes.actions
95
- }, /*#__PURE__*/_react["default"].createElement("div", {
96
- role: "button",
97
- tabIndex: 0,
98
- className: classes.trigger,
99
- onClick: this.handleActionsClick
100
- }, "Actions"), /*#__PURE__*/_react["default"].createElement(_Popover["default"], {
101
- open: Boolean(this.state.actionsAnchorEl),
102
- anchorEl: this.state.actionsAnchorEl,
103
- onClose: this.handleActionsClose,
104
- anchorOrigin: {
105
- vertical: 'bottom',
106
- horizontal: 'left'
107
- },
108
- transformOrigin: {
109
- vertical: 'top',
110
- horizontal: 'left'
111
- }
112
- }, /*#__PURE__*/_react["default"].createElement(_Paper["default"], {
113
- className: classes.actionsPaper
114
- }, /*#__PURE__*/_react["default"].createElement(_Button["default"], {
115
- onClick: function onClick() {
116
- return _this2.handleAddCategory();
117
- }
118
- }, "+ ", translator.t('charting.add', {
119
- lng: language
120
- })), categories.length > 0 && categories.map(function (category, index) {
121
- return category.deletable && !category.correctness && /*#__PURE__*/_react["default"].createElement(_Button["default"], {
122
- key: index,
123
- onClick: function onClick() {
124
- return _this2.handleDeleteCategory(index);
125
- }
126
- }, "".concat(translator.t('charting.delete', {
127
- lng: language
128
- }), " <").concat(category.label || translator.t('charting.newLabel', {
129
- lng: language
130
- }), ">"));
131
- }))));
132
- }
133
- }]);
134
- return ActionsButton;
135
- }(_react["default"].Component);
136
-
137
- exports.ActionsButton = ActionsButton;
138
- (0, _defineProperty2["default"])(ActionsButton, "propTypes", {
139
- classes: _propTypes["default"].object.isRequired,
140
- categories: _propTypes["default"].array,
141
- addCategory: _propTypes["default"].func.isRequired,
142
- deleteCategory: _propTypes["default"].func.isRequired,
143
- language: _propTypes["default"].string.isRequired
144
- });
145
-
146
- var styles = function styles(theme) {
147
- return {
148
- actions: {
149
- alignSelf: 'flex-end'
150
- },
151
- trigger: {
152
- cursor: 'pointer',
153
- fontSize: theme.typography.fontSize,
154
- color: _index.color.tertiary()
155
- },
156
- actionsPaper: {
157
- padding: theme.spacing.unit,
158
- display: 'flex',
159
- flexDirection: 'column',
160
- gap: theme.spacing.unit,
161
- '& button': {
162
- textTransform: 'none',
163
- fontSize: theme.typography.fontSize,
164
- color: _index.color.text(),
165
- justifyContent: 'flex-start'
166
- }
167
- }
168
- };
169
- };
170
-
171
- var _default = (0, _styles.withStyles)(styles)(ActionsButton);
172
-
173
- exports["default"] = _default;
174
- //# sourceMappingURL=actions-button.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/actions-button.jsx"],"names":["translator","Translator","ActionsButton","props","event","setState","actionsAnchorEl","currentTarget","addCategory","handleActionsClose","index","deleteCategory","state","classes","categories","language","actions","trigger","handleActionsClick","Boolean","vertical","horizontal","actionsPaper","handleAddCategory","t","lng","length","map","category","deletable","correctness","handleDeleteCategory","label","React","Component","PropTypes","object","isRequired","array","func","string","styles","theme","alignSelf","cursor","fontSize","typography","color","tertiary","padding","spacing","unit","display","flexDirection","gap","textTransform","text","justifyContent"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAEA;;AACA;;;;;;AAEA,IAAQA,UAAR,GAAuBC,sBAAvB,CAAQD,UAAR;;IAEaE,a;;;;;AACX,yBAAYC,KAAZ,EAAmB;AAAA;;AAAA;AACjB,8BAAMA,KAAN;AADiB,2GAeE,UAACC,KAAD,EAAW;AAC9B,YAAKC,QAAL,CAAc;AAAEC,QAAAA,eAAe,EAAEF,KAAK,CAACG;AAAzB,OAAd;AACD,KAjBkB;AAAA,2GAmBE,YAAM;AACzB,YAAKF,QAAL,CAAc;AAAEC,QAAAA,eAAe,EAAE;AAAnB,OAAd;AACD,KArBkB;AAAA,0GAuBC,YAAM;AACxB,UAAQE,WAAR,GAAwB,MAAKL,KAA7B,CAAQK,WAAR;AACAA,MAAAA,WAAW;;AACX,YAAKC,kBAAL;AACD,KA3BkB;AAAA,6GA6BI,UAACC,KAAD,EAAW;AAChC,UAAQC,cAAR,GAA2B,MAAKR,KAAhC,CAAQQ,cAAR;AACAA,MAAAA,cAAc,CAACD,KAAD,CAAd;;AACA,YAAKD,kBAAL;AACD,KAjCkB;AAEjB,UAAKG,KAAL,GAAa;AACXN,MAAAA,eAAe,EAAE;AADN,KAAb;AAFiB;AAKlB;;;;WA8BD,kBAAS;AAAA;;AACP,wBAA0C,KAAKH,KAA/C;AAAA,UAAQU,OAAR,eAAQA,OAAR;AAAA,UAAiBC,UAAjB,eAAiBA,UAAjB;AAAA,UAA6BC,QAA7B,eAA6BA,QAA7B;AAEA,0BACE;AAAK,QAAA,SAAS,EAAEF,OAAO,CAACG;AAAxB,sBACE;AAAK,QAAA,IAAI,EAAC,QA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'react';\nimport PropTypes from 'prop-types';\nimport { withStyles } from '@material-ui/core/styles';\nimport Button from '@material-ui/core/Button';\nimport Popover from '@material-ui/core/Popover';\nimport Paper from '@material-ui/core/Paper';\n\nimport { color } from '../../render-ui/src/index';\nimport Translator from '@pie-lib/translator';\n\nconst { translator } = Translator;\n\nexport class ActionsButton extends React.Component {\n constructor(props) {\n super(props);\n this.state = {\n actionsAnchorEl: null,\n };\n }\n\n static propTypes = {\n classes: PropTypes.object.isRequired,\n categories: PropTypes.array,\n addCategory: PropTypes.func.isRequired,\n deleteCategory: PropTypes.func.isRequired,\n language: PropTypes.string.isRequired,\n };\n\n handleActionsClick = (event) => {\n this.setState({ actionsAnchorEl: event.currentTarget });\n };\n\n handleActionsClose = () => {\n this.setState({ actionsAnchorEl: null });\n };\n\n handleAddCategory = () => {\n const { addCategory } = this.props;\n addCategory();\n this.handleActionsClose();\n };\n\n handleDeleteCategory = (index) => {\n const { deleteCategory } = this.props;\n deleteCategory(index);\n this.handleActionsClose();\n };\n\n render() {\n const { classes, categories, language } = this.props;\n\n return (\n <div className={classes.actions}>\n <div role=\"button\" tabIndex={0} className={classes.trigger} onClick={this.handleActionsClick}>\n Actions\n </div>\n <Popover\n open={Boolean(this.state.actionsAnchorEl)}\n anchorEl={this.state.actionsAnchorEl}\n onClose={this.handleActionsClose}\n anchorOrigin={{ vertical: 'bottom', horizontal: 'left' }}\n transformOrigin={{ vertical: 'top', horizontal: 'left' }}\n >\n <Paper className={classes.actionsPaper}>\n <Button onClick={() => this.handleAddCategory()}>\n + {translator.t('charting.add', { lng: language })}\n </Button>\n {categories.length > 0 &&\n categories.map(\n (category, index) =>\n category.deletable &&\n !category.correctness && (\n <Button key={index} onClick={() => this.handleDeleteCategory(index)}>\n {`${translator.t('charting.delete', { lng: language })} <${category.label ||\n translator.t('charting.newLabel', { lng: language })}>`}\n </Button>\n ),\n )}\n </Paper>\n </Popover>\n </div>\n );\n }\n}\n\nconst styles = (theme) => ({\n actions: {\n alignSelf: 'flex-end',\n },\n trigger: {\n cursor: 'pointer',\n fontSize: theme.typography.fontSize,\n color: color.tertiary(),\n },\n actionsPaper: {\n padding: theme.spacing.unit,\n display: 'flex',\n flexDirection: 'column',\n gap: theme.spacing.unit,\n '& button': {\n textTransform: 'none',\n fontSize: theme.typography.fontSize,\n color: color.text(),\n justifyContent: 'flex-start',\n },\n },\n});\n\nexport default withStyles(styles)(ActionsButton);\n"],"file":"actions-button.js"}