@alfalab/core-components-chart 3.1.7 → 3.1.9

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 (54) hide show
  1. package/Component.js +15 -15
  2. package/components/Dot/index.css +8 -8
  3. package/components/Dot/index.js +1 -1
  4. package/components/Legends/index.css +16 -17
  5. package/components/Legends/index.js +1 -1
  6. package/components/Tick/index.css +12 -9
  7. package/components/Tick/index.js +1 -1
  8. package/components/TooltipContent/index.css +16 -20
  9. package/components/TooltipContent/index.js +1 -1
  10. package/cssm/Component.js +14 -14
  11. package/cssm/components/Legends/index.module.css +15 -16
  12. package/cssm/components/Tick/index.module.css +11 -8
  13. package/cssm/components/TooltipContent/index.module.css +15 -19
  14. package/cssm/hooks/useSettings/index.js +2 -2
  15. package/cssm/hooks/useSettings/utils/setDatas.js +2 -2
  16. package/cssm/hooks/useSettings/utils/setGradientCharts.js +2 -2
  17. package/cssm/index.js +1 -1
  18. package/cssm/index.module.css +12 -10
  19. package/esm/Component.js +2 -2
  20. package/esm/components/Dot/index.css +8 -8
  21. package/esm/components/Dot/index.js +1 -1
  22. package/esm/components/Legends/index.css +16 -17
  23. package/esm/components/Legends/index.js +1 -1
  24. package/esm/components/Tick/index.css +12 -9
  25. package/esm/components/Tick/index.js +1 -1
  26. package/esm/components/TooltipContent/index.css +16 -20
  27. package/esm/components/TooltipContent/index.js +1 -1
  28. package/esm/hooks/useSettings/index.js +1 -1
  29. package/esm/hooks/useSettings/utils/setDatas.js +1 -1
  30. package/esm/hooks/useSettings/utils/setGradientCharts.js +1 -1
  31. package/esm/index.css +13 -11
  32. package/esm/index.js +1 -1
  33. package/hooks/useSettings/index.js +2 -2
  34. package/hooks/useSettings/utils/setDatas.js +2 -2
  35. package/hooks/useSettings/utils/setGradientCharts.js +2 -2
  36. package/index.css +13 -11
  37. package/index.js +1 -1
  38. package/modern/Component.js +1 -1
  39. package/modern/components/Dot/index.css +8 -8
  40. package/modern/components/Dot/index.js +1 -1
  41. package/modern/components/Legends/index.css +16 -17
  42. package/modern/components/Legends/index.js +1 -1
  43. package/modern/components/Tick/index.css +12 -9
  44. package/modern/components/Tick/index.js +1 -1
  45. package/modern/components/TooltipContent/index.css +16 -20
  46. package/modern/components/TooltipContent/index.js +1 -1
  47. package/modern/index.css +13 -11
  48. package/package.json +5 -4
  49. package/cssm/tslib.es6-19b064c1.d.ts +0 -36
  50. package/cssm/tslib.es6-19b064c1.js +0 -28
  51. package/esm/tslib.es6-69453a3a.d.ts +0 -36
  52. package/esm/tslib.es6-69453a3a.js +0 -28
  53. package/tslib.es6-692855d9.d.ts +0 -36
  54. package/tslib.es6-692855d9.js +0 -28
package/Component.js CHANGED
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var tslib_es6 = require('./tslib.es6-692855d9.js');
3
+ var tslib = require('tslib');
4
4
  var React = require('react');
5
5
  var cn = require('classnames');
6
6
  var recharts = require('recharts');
@@ -32,11 +32,11 @@ var React__default = /*#__PURE__*/_interopDefaultCompat(React);
32
32
  var cn__default = /*#__PURE__*/_interopDefaultCompat(cn);
33
33
 
34
34
  var CustomizedHOC = function (Component, options) {
35
- var NewComponent = function (props) { return React__default.default.createElement(Component, tslib_es6.__assign({}, props, options)); };
35
+ var NewComponent = function (props) { return React__default.default.createElement(Component, tslib.__assign({}, props, options)); };
36
36
  return NewComponent;
37
37
  };
38
38
 
39
- var styles = {"coreChart":"chart__coreChart_sapp3","bar":"chart__bar_sapp3","unfocused":"chart__unfocused_sapp3"};
39
+ var styles = {"coreChart":"chart__coreChart_1g9e3","bar":"chart__bar_1g9e3","unfocused":"chart__unfocused_1g9e3"};
40
40
  require('./index.css')
41
41
 
42
42
  var Chart = function (props) {
@@ -77,7 +77,7 @@ var Chart = function (props) {
77
77
  if (!changed)
78
78
  return;
79
79
  setCharts(function (prev) {
80
- var newState = tslib_es6.__assign({}, prev);
80
+ var newState = tslib.__assign({}, prev);
81
81
  newState["".concat(dataKey)] = !newState["".concat(dataKey)];
82
82
  if (withGrad)
83
83
  newState["".concat(dataKey, "-gradient")] = !newState["".concat(dataKey, "-gradient")];
@@ -99,14 +99,14 @@ var Chart = function (props) {
99
99
  var translate = ((_a = state === null || state === void 0 ? void 0 : state.xAxis) === null || _a === void 0 ? void 0 : _a.tickMargin) && ((_b = state === null || state === void 0 ? void 0 : state.legend) === null || _b === void 0 ? void 0 : _b.verticalAlign) !== 'top'
100
100
  ? state.xAxis.tickMargin + (((_c = state === null || state === void 0 ? void 0 : state.brush) === null || _c === void 0 ? void 0 : _c.brushMargin) || 0)
101
101
  : 0;
102
- return (React__default.default.createElement(recharts.Legend, tslib_es6.__assign({}, (state.legend || null), { content: React__default.default.createElement(components_Legends_index.Legends, { legend: state.legend, series: state.series, id: state.id, toggleChart: toggleChart, ref: legendRef, charts: charts }), wrapperStyle: {
102
+ return (React__default.default.createElement(recharts.Legend, tslib.__assign({}, (state.legend || null), { content: React__default.default.createElement(components_Legends_index.Legends, { legend: state.legend, series: state.series, id: state.id, toggleChart: toggleChart, ref: legendRef, charts: charts }), wrapperStyle: {
103
103
  transform: "translateY(".concat(translate, "px)"),
104
104
  } })));
105
105
  }, [state, charts, toggleChart, legendRef]);
106
106
  var renderCartesianGrid = React.useMemo(function () {
107
107
  if (!(state === null || state === void 0 ? void 0 : state.cartesianGrid))
108
108
  return null;
109
- return React__default.default.createElement(recharts.CartesianGrid, tslib_es6.__assign({}, state.cartesianGrid));
109
+ return React__default.default.createElement(recharts.CartesianGrid, tslib.__assign({}, state.cartesianGrid));
110
110
  }, [state]);
111
111
  var renderXAxis = React.useMemo(function () {
112
112
  var _a;
@@ -122,7 +122,7 @@ var Chart = function (props) {
122
122
  else {
123
123
  tick = true;
124
124
  }
125
- return React__default.default.createElement(recharts.XAxis, tslib_es6.__assign({}, state.xAxis, { tick: tick }));
125
+ return React__default.default.createElement(recharts.XAxis, tslib.__assign({}, state.xAxis, { tick: tick }));
126
126
  }, [state]);
127
127
  var renderYAxis = React.useMemo(function () {
128
128
  var _a;
@@ -138,17 +138,17 @@ var Chart = function (props) {
138
138
  else {
139
139
  tick = true;
140
140
  }
141
- return React__default.default.createElement(recharts.YAxis, tslib_es6.__assign({}, state.yAxis, { tick: tick }));
141
+ return React__default.default.createElement(recharts.YAxis, tslib.__assign({}, state.yAxis, { tick: tick }));
142
142
  }, [state]);
143
143
  var renderBrush = React.useMemo(function () {
144
144
  if (!(state === null || state === void 0 ? void 0 : state.brush))
145
145
  return null;
146
- return React__default.default.createElement(recharts.Brush, tslib_es6.__assign({ y: typeof yBrush === 'number' ? yBrush : 0 }, state.brush));
146
+ return React__default.default.createElement(recharts.Brush, tslib.__assign({ y: typeof yBrush === 'number' ? yBrush : 0 }, state.brush));
147
147
  }, [state, yBrush]);
148
148
  var renderTooltip = React.useMemo(function () {
149
149
  if (!(state === null || state === void 0 ? void 0 : state.tooltip))
150
150
  return null;
151
- return (React__default.default.createElement(recharts.Tooltip, tslib_es6.__assign({ ref: tooltipRef }, state.tooltip, { content: CustomizedHOC(components_TooltipContent_index.TooltipContent, { series: state.series, tooltipArrowSide: tooltipArrowSide }) })));
151
+ return (React__default.default.createElement(recharts.Tooltip, tslib.__assign({ ref: tooltipRef }, state.tooltip, { content: CustomizedHOC(components_TooltipContent_index.TooltipContent, { series: state.series, tooltipArrowSide: tooltipArrowSide }) })));
152
152
  }, [state, tooltipArrowSide]);
153
153
  var renderChartsItems = React.useMemo(function () {
154
154
  if (!state || !charts)
@@ -158,8 +158,8 @@ var Chart = function (props) {
158
158
  var show = charts["".concat(properties.dataKey)];
159
159
  switch (chart) {
160
160
  case 'bar':
161
- return show && !(item === null || item === void 0 ? void 0 : item.hide) ? (React__default.default.createElement(recharts.Bar, tslib_es6.__assign({ key: "".concat(state.id, "-").concat(properties.dataKey) }, properties, { shape: React__default.default.createElement(components_RectBar.RectBar, { radius: radius }) }),
162
- labelList && (React__default.default.createElement(recharts.LabelList, tslib_es6.__assign({ dataKey: properties.dataKey.toString() }, labelList, { content: React__default.default.createElement(components_CustomizedLabel.CustomizedLabel, { radius: radius }) }))),
161
+ return show && !(item === null || item === void 0 ? void 0 : item.hide) ? (React__default.default.createElement(recharts.Bar, tslib.__assign({ key: "".concat(state.id, "-").concat(properties.dataKey) }, properties, { shape: React__default.default.createElement(components_RectBar.RectBar, { radius: radius }) }),
162
+ labelList && (React__default.default.createElement(recharts.LabelList, tslib.__assign({ dataKey: properties.dataKey.toString() }, labelList, { content: React__default.default.createElement(components_CustomizedLabel.CustomizedLabel, { radius: radius }) }))),
163
163
  data.map(function (_, index) {
164
164
  var key = "".concat(state.id, "-").concat(properties.dataKey, "-").concat(index);
165
165
  return (React__default.default.createElement(recharts.Cell, { key: key, className: cn__default.default(styles.bar, typeof activeDotsState.active === 'number' &&
@@ -169,7 +169,7 @@ var Chart = function (props) {
169
169
  }))) : null;
170
170
  case 'area':
171
171
  case 'line':
172
- return show && !(item === null || item === void 0 ? void 0 : item.hide) ? (React__default.default.createElement(recharts.Line, tslib_es6.__assign({ key: "".concat(state.id, "-").concat(properties.dataKey) }, properties, { dot: properties.dot && properties.dotSettings
172
+ return show && !(item === null || item === void 0 ? void 0 : item.hide) ? (React__default.default.createElement(recharts.Line, tslib.__assign({ key: "".concat(state.id, "-").concat(properties.dataKey) }, properties, { dot: properties.dot && properties.dotSettings
173
173
  ? CustomizedHOC(components_Dot_index.Dot, {
174
174
  activeDot: activeDotsState.active,
175
175
  dotSettings: properties.dotSettings,
@@ -179,7 +179,7 @@ var Chart = function (props) {
179
179
  })
180
180
  : false, activeDot: false }))) : null;
181
181
  case 'gradient':
182
- return show && !(item === null || item === void 0 ? void 0 : item.hide) ? (React__default.default.createElement(recharts.Area, tslib_es6.__assign({}, item.properties, { key: "".concat(state.id, "-").concat(item.properties.dataKey), dataKey: "".concat(item.properties.dataKey), stroke: 'transparent', fill: item.gradient.gid
182
+ return show && !(item === null || item === void 0 ? void 0 : item.hide) ? (React__default.default.createElement(recharts.Area, tslib.__assign({}, item.properties, { key: "".concat(state.id, "-").concat(item.properties.dataKey), dataKey: "".concat(item.properties.dataKey), stroke: 'transparent', fill: item.gradient.gid
183
183
  ? "url(#".concat(state.id, "-").concat(item.gradient.gid, ")")
184
184
  : item.properties.fill, dot: false, activeDot: false }))) : null;
185
185
  default:
@@ -263,7 +263,7 @@ var Chart = function (props) {
263
263
  return null;
264
264
  return (React__default.default.createElement("div", { className: styles.coreChart, ref: svgRef, id: (state === null || state === void 0 ? void 0 : state.id) || '', style: { width: '100%', height: '100%' } },
265
265
  React__default.default.createElement(recharts.ResponsiveContainer, { debounce: ((_a = state === null || state === void 0 ? void 0 : state.responsiveContainer) === null || _a === void 0 ? void 0 : _a.debounce) ? state.responsiveContainer.debounce : 0, width: '100%' },
266
- React__default.default.createElement(recharts.ComposedChart, tslib_es6.__assign({}, state === null || state === void 0 ? void 0 : state.composeChart, { onMouseMove: mouseMove, onMouseLeave: mouseLeave, data: data }),
266
+ React__default.default.createElement(recharts.ComposedChart, tslib.__assign({}, state === null || state === void 0 ? void 0 : state.composeChart, { onMouseMove: mouseMove, onMouseLeave: mouseLeave, data: data }),
267
267
  React__default.default.createElement("defs", null, renderGradient),
268
268
  state.cartesianGrid && renderCartesianGrid,
269
269
  state.xAxis && renderXAxis,
@@ -1,19 +1,19 @@
1
- /* hash: 16i6x */
2
- .chart__dotUnfocused_1k2nr {
1
+ /* hash: 1ckc2 */
2
+ .chart__dotUnfocused_p7bjp {
3
3
  opacity: 0.3;
4
4
  }
5
5
 
6
- .chart__dot_1k2nr,
7
- .chart__dotItem_1k2nr,
8
- .chart__dotWrap_1k2nr {
6
+ .chart__dot_p7bjp,
7
+ .chart__dotItem_p7bjp,
8
+ .chart__dotWrap_p7bjp {
9
9
  transition: all 0.2s ease;
10
10
  }
11
11
 
12
- .chart__dot_1k2nr {
13
- animation: chart__showDot_1k2nr 0.5s ease;
12
+ .chart__dot_p7bjp {
13
+ animation: chart__showDot_p7bjp 0.5s ease;
14
14
  }
15
15
 
16
- @keyframes chart__showDot_1k2nr {
16
+ @keyframes chart__showDot_p7bjp {
17
17
  from {
18
18
  opacity: 0;
19
19
  }
@@ -9,7 +9,7 @@ function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'defau
9
9
  var React__default = /*#__PURE__*/_interopDefaultCompat(React);
10
10
  var cn__default = /*#__PURE__*/_interopDefaultCompat(cn);
11
11
 
12
- var styles = {"dotUnfocused":"chart__dotUnfocused_1k2nr","dot":"chart__dot_1k2nr","dotItem":"chart__dotItem_1k2nr","dotWrap":"chart__dotWrap_1k2nr","showDot":"chart__showDot_1k2nr"};
12
+ var styles = {"dotUnfocused":"chart__dotUnfocused_p7bjp","dot":"chart__dot_p7bjp","dotItem":"chart__dotItem_p7bjp","dotWrap":"chart__dotWrap_p7bjp","showDot":"chart__showDot_p7bjp"};
13
13
  require('./index.css')
14
14
 
15
15
  var Dot = React__default.default.forwardRef(function (_a, ref) {
@@ -1,40 +1,39 @@
1
- /* hash: 4rv6w */
1
+ /* hash: nmflm */
2
2
  :root {
3
+ } /* deprecated */ :root {
4
+ } :root {
5
+ } :root {
6
+ } :root {
3
7
 
4
8
  /* Hard */
5
9
 
6
10
  /* Up */
7
11
 
8
12
  /* Hard up */
9
- }
10
- :root {
13
+ } :root {
14
+ } :root {
11
15
  --gap-2xl: 32px;
12
- }
13
- .chart__legendContent_hzv13 {
16
+ } :root {
17
+ } :root {
18
+ } .chart__legendContent_cb6tz {
14
19
  display: flex;
15
20
  align-items: center;
16
21
  flex-wrap: wrap;
17
- }
18
- .chart__legendWrap_hzv13 {
22
+ } .chart__legendWrap_cb6tz {
19
23
  width: 100%;
20
24
  margin: 0;
21
25
  padding: 0;
22
- }
23
- .chart__legendItem_hzv13 {
26
+ } .chart__legendItem_cb6tz {
24
27
  margin-right: var(--gap-2xl);
25
28
  cursor: pointer;
26
29
  display: inline-block;
27
- }
28
- .chart__legendItem_hzv13:last-child {
30
+ } .chart__legendItem_cb6tz:last-child {
29
31
  margin-right: 0;
30
- }
31
- .chart__legendUnactive_hzv13 {
32
+ } .chart__legendUnactive_cb6tz {
32
33
  opacity: 0.3;
33
- }
34
- .chart__legendIcon_hzv13 {
34
+ } .chart__legendIcon_cb6tz {
35
35
  margin-right: 13px;
36
36
  display: flex;
37
- }
38
- .chart__legendValue_hzv13 {
37
+ } .chart__legendValue_cb6tz {
39
38
  text-transform: capitalize;
40
39
  }
@@ -13,7 +13,7 @@ function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'defau
13
13
  var React__default = /*#__PURE__*/_interopDefaultCompat(React);
14
14
  var cn__default = /*#__PURE__*/_interopDefaultCompat(cn);
15
15
 
16
- var styles = {"legendContent":"chart__legendContent_hzv13","legendWrap":"chart__legendWrap_hzv13","legendItem":"chart__legendItem_hzv13","legendUnactive":"chart__legendUnactive_hzv13","legendIcon":"chart__legendIcon_hzv13","legendValue":"chart__legendValue_hzv13"};
16
+ var styles = {"legendContent":"chart__legendContent_cb6tz","legendWrap":"chart__legendWrap_cb6tz","legendItem":"chart__legendItem_cb6tz","legendUnactive":"chart__legendUnactive_cb6tz","legendIcon":"chart__legendIcon_cb6tz","legendValue":"chart__legendValue_cb6tz"};
17
17
  require('./index.css')
18
18
 
19
19
  var icons = {
@@ -1,27 +1,30 @@
1
- /* hash: 4c7i4 */
1
+ /* hash: x0lns */
2
2
  :root {
3
+ } /* deprecated */ :root {
3
4
  --color-dark-bg-primary: #0b1f35;
4
5
  --color-light-text-primary: #0b1f35;
5
- }
6
- :root {
6
+ } :root {
7
+ } :root {
8
+ } :root {
7
9
 
8
10
  /* Hard */
9
11
 
10
12
  /* Up */
11
13
 
12
14
  /* Hard up */
13
- }
14
- .chart__tickText_1p75j {
15
+ } :root {
16
+ } :root {
17
+ } :root {
18
+ } :root {
19
+ } .chart__tickText_1t0io {
15
20
  fill: var(--color-light-text-primary);
16
21
  font-size: 16px;
17
22
  line-height: 24px;
18
23
  font-weight: 400;
19
- }
20
- .chart__circle_1p75j {
24
+ } .chart__circle_1t0io {
21
25
  opacity: 0.3;
22
26
  fill: var(--color-dark-bg-primary);
23
- }
24
- .chart__circle_1p75j {
27
+ } .chart__circle_1t0io {
25
28
  opacity: 0.3;
26
29
  fill: var(--color-dark-bg-primary);
27
30
  }
@@ -8,7 +8,7 @@ function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'defau
8
8
  var React__default = /*#__PURE__*/_interopDefaultCompat(React);
9
9
  var cn__default = /*#__PURE__*/_interopDefaultCompat(cn);
10
10
 
11
- var styles = {"tickText":"chart__tickText_1p75j","circle":"chart__circle_1p75j"};
11
+ var styles = {"tickText":"chart__tickText_1t0io","circle":"chart__circle_1t0io"};
12
12
  require('./index.css')
13
13
 
14
14
  var Tick = function (_a) {
@@ -1,9 +1,11 @@
1
- /* hash: yyy00 */
1
+ /* hash: fv9xh */
2
2
  :root {
3
+ } /* deprecated */ :root {
3
4
  --color-light-bg-primary: #fff;
4
5
  --color-light-border-primary: #dbdee1;
5
- }
6
- :root {
6
+ } :root {
7
+ } :root {
8
+ } :root {
7
9
  --shadow-l: 0 0 24px rgba(11, 31, 53, 0.12), 0 12px 24px rgba(11, 31, 53, 0.24);
8
10
 
9
11
  /* Hard */
@@ -11,15 +13,14 @@
11
13
  /* Up */
12
14
 
13
15
  /* Hard up */
14
- }
15
- :root {
16
+ } :root {
17
+ --border-radius-m: 8px;
18
+ } :root {
16
19
  --gap-s: 12px;
17
20
  --gap-m: 16px;
18
- }
19
- :root {
20
- --border-radius-m: 8px;
21
- }
22
- .chart__tooltip_1tjmf {
21
+ } :root {
22
+ } :root {
23
+ } .chart__tooltip_p68vf {
23
24
  background-color: var(--color-light-bg-primary);
24
25
  border: 1px solid var(--color-light-border-primary);
25
26
  box-shadow: var(--shadow-l);
@@ -27,18 +28,15 @@
27
28
  padding: var(--gap-s) var(--gap-m);
28
29
  pointer-events: none;
29
30
  position: relative;
30
- }
31
- .chart__tooltipList_1tjmf {
31
+ } .chart__tooltipList_p68vf {
32
32
  position: relative;
33
33
  z-index: 5;
34
34
  list-style-type: none;
35
35
  padding: 0;
36
36
  margin: 0;
37
- }
38
- .chart__tooltipItem_1tjmf {
37
+ } .chart__tooltipItem_p68vf {
39
38
  margin-bottom: 10px;
40
- }
41
- .chart__tooltipArrow_1tjmf {
39
+ } .chart__tooltipArrow_p68vf {
42
40
  position: absolute;
43
41
  left: 0;
44
42
  top: 50%;
@@ -47,8 +45,7 @@
47
45
  height: 10px;
48
46
  border: 1px solid var(--color-light-border-primary);
49
47
  background-color: var(--color-light-bg-primary);
50
- }
51
- .chart__tooltipArrow_1tjmf:before {
48
+ } .chart__tooltipArrow_p68vf:before {
52
49
  content: '';
53
50
  position: absolute;
54
51
  left: -2px;
@@ -58,8 +55,7 @@
58
55
  border-style: solid;
59
56
  border-width: 0 24px 24px 0;
60
57
  border-color: transparent var(--color-light-bg-primary) transparent transparent;
61
- }
62
- .chart__tooltipArrowRight_1tjmf {
58
+ } .chart__tooltipArrowRight_p68vf {
63
59
  left: 100%;
64
60
  transform: translate(-50%, -50%) scale(-1, 1) rotate(45deg);
65
61
  }
@@ -9,7 +9,7 @@ function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'defau
9
9
  var React__default = /*#__PURE__*/_interopDefaultCompat(React);
10
10
  var cn__default = /*#__PURE__*/_interopDefaultCompat(cn);
11
11
 
12
- var styles = {"tooltip":"chart__tooltip_1tjmf","tooltipList":"chart__tooltipList_1tjmf","tooltipItem":"chart__tooltipItem_1tjmf","tooltipArrow":"chart__tooltipArrow_1tjmf","tooltipArrowRight":"chart__tooltipArrowRight_1tjmf"};
12
+ var styles = {"tooltip":"chart__tooltip_p68vf","tooltipList":"chart__tooltipList_p68vf","tooltipItem":"chart__tooltipItem_p68vf","tooltipArrow":"chart__tooltipArrow_p68vf","tooltipArrowRight":"chart__tooltipArrowRight_p68vf"};
13
13
  require('./index.css')
14
14
 
15
15
  var TooltipContent = function (_a) {
package/cssm/Component.js CHANGED
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var tslib_es6 = require('./tslib.es6-19b064c1.js');
3
+ var tslib = require('tslib');
4
4
  var React = require('react');
5
5
  var cn = require('classnames');
6
6
  var recharts = require('recharts');
@@ -38,7 +38,7 @@ var cn__default = /*#__PURE__*/_interopDefaultCompat(cn);
38
38
  var styles__default = /*#__PURE__*/_interopDefaultCompat(styles);
39
39
 
40
40
  var CustomizedHOC = function (Component, options) {
41
- var NewComponent = function (props) { return React__default.default.createElement(Component, tslib_es6.__assign({}, props, options)); };
41
+ var NewComponent = function (props) { return React__default.default.createElement(Component, tslib.__assign({}, props, options)); };
42
42
  return NewComponent;
43
43
  };
44
44
 
@@ -80,7 +80,7 @@ var Chart = function (props) {
80
80
  if (!changed)
81
81
  return;
82
82
  setCharts(function (prev) {
83
- var newState = tslib_es6.__assign({}, prev);
83
+ var newState = tslib.__assign({}, prev);
84
84
  newState["".concat(dataKey)] = !newState["".concat(dataKey)];
85
85
  if (withGrad)
86
86
  newState["".concat(dataKey, "-gradient")] = !newState["".concat(dataKey, "-gradient")];
@@ -102,14 +102,14 @@ var Chart = function (props) {
102
102
  var translate = ((_a = state === null || state === void 0 ? void 0 : state.xAxis) === null || _a === void 0 ? void 0 : _a.tickMargin) && ((_b = state === null || state === void 0 ? void 0 : state.legend) === null || _b === void 0 ? void 0 : _b.verticalAlign) !== 'top'
103
103
  ? state.xAxis.tickMargin + (((_c = state === null || state === void 0 ? void 0 : state.brush) === null || _c === void 0 ? void 0 : _c.brushMargin) || 0)
104
104
  : 0;
105
- return (React__default.default.createElement(recharts.Legend, tslib_es6.__assign({}, (state.legend || null), { content: React__default.default.createElement(components_Legends_index.Legends, { legend: state.legend, series: state.series, id: state.id, toggleChart: toggleChart, ref: legendRef, charts: charts }), wrapperStyle: {
105
+ return (React__default.default.createElement(recharts.Legend, tslib.__assign({}, (state.legend || null), { content: React__default.default.createElement(components_Legends_index.Legends, { legend: state.legend, series: state.series, id: state.id, toggleChart: toggleChart, ref: legendRef, charts: charts }), wrapperStyle: {
106
106
  transform: "translateY(".concat(translate, "px)"),
107
107
  } })));
108
108
  }, [state, charts, toggleChart, legendRef]);
109
109
  var renderCartesianGrid = React.useMemo(function () {
110
110
  if (!(state === null || state === void 0 ? void 0 : state.cartesianGrid))
111
111
  return null;
112
- return React__default.default.createElement(recharts.CartesianGrid, tslib_es6.__assign({}, state.cartesianGrid));
112
+ return React__default.default.createElement(recharts.CartesianGrid, tslib.__assign({}, state.cartesianGrid));
113
113
  }, [state]);
114
114
  var renderXAxis = React.useMemo(function () {
115
115
  var _a;
@@ -125,7 +125,7 @@ var Chart = function (props) {
125
125
  else {
126
126
  tick = true;
127
127
  }
128
- return React__default.default.createElement(recharts.XAxis, tslib_es6.__assign({}, state.xAxis, { tick: tick }));
128
+ return React__default.default.createElement(recharts.XAxis, tslib.__assign({}, state.xAxis, { tick: tick }));
129
129
  }, [state]);
130
130
  var renderYAxis = React.useMemo(function () {
131
131
  var _a;
@@ -141,17 +141,17 @@ var Chart = function (props) {
141
141
  else {
142
142
  tick = true;
143
143
  }
144
- return React__default.default.createElement(recharts.YAxis, tslib_es6.__assign({}, state.yAxis, { tick: tick }));
144
+ return React__default.default.createElement(recharts.YAxis, tslib.__assign({}, state.yAxis, { tick: tick }));
145
145
  }, [state]);
146
146
  var renderBrush = React.useMemo(function () {
147
147
  if (!(state === null || state === void 0 ? void 0 : state.brush))
148
148
  return null;
149
- return React__default.default.createElement(recharts.Brush, tslib_es6.__assign({ y: typeof yBrush === 'number' ? yBrush : 0 }, state.brush));
149
+ return React__default.default.createElement(recharts.Brush, tslib.__assign({ y: typeof yBrush === 'number' ? yBrush : 0 }, state.brush));
150
150
  }, [state, yBrush]);
151
151
  var renderTooltip = React.useMemo(function () {
152
152
  if (!(state === null || state === void 0 ? void 0 : state.tooltip))
153
153
  return null;
154
- return (React__default.default.createElement(recharts.Tooltip, tslib_es6.__assign({ ref: tooltipRef }, state.tooltip, { content: CustomizedHOC(components_TooltipContent_index.TooltipContent, { series: state.series, tooltipArrowSide: tooltipArrowSide }) })));
154
+ return (React__default.default.createElement(recharts.Tooltip, tslib.__assign({ ref: tooltipRef }, state.tooltip, { content: CustomizedHOC(components_TooltipContent_index.TooltipContent, { series: state.series, tooltipArrowSide: tooltipArrowSide }) })));
155
155
  }, [state, tooltipArrowSide]);
156
156
  var renderChartsItems = React.useMemo(function () {
157
157
  if (!state || !charts)
@@ -161,8 +161,8 @@ var Chart = function (props) {
161
161
  var show = charts["".concat(properties.dataKey)];
162
162
  switch (chart) {
163
163
  case 'bar':
164
- return show && !(item === null || item === void 0 ? void 0 : item.hide) ? (React__default.default.createElement(recharts.Bar, tslib_es6.__assign({ key: "".concat(state.id, "-").concat(properties.dataKey) }, properties, { shape: React__default.default.createElement(components_RectBar.RectBar, { radius: radius }) }),
165
- labelList && (React__default.default.createElement(recharts.LabelList, tslib_es6.__assign({ dataKey: properties.dataKey.toString() }, labelList, { content: React__default.default.createElement(components_CustomizedLabel.CustomizedLabel, { radius: radius }) }))),
164
+ return show && !(item === null || item === void 0 ? void 0 : item.hide) ? (React__default.default.createElement(recharts.Bar, tslib.__assign({ key: "".concat(state.id, "-").concat(properties.dataKey) }, properties, { shape: React__default.default.createElement(components_RectBar.RectBar, { radius: radius }) }),
165
+ labelList && (React__default.default.createElement(recharts.LabelList, tslib.__assign({ dataKey: properties.dataKey.toString() }, labelList, { content: React__default.default.createElement(components_CustomizedLabel.CustomizedLabel, { radius: radius }) }))),
166
166
  data.map(function (_, index) {
167
167
  var key = "".concat(state.id, "-").concat(properties.dataKey, "-").concat(index);
168
168
  return (React__default.default.createElement(recharts.Cell, { key: key, className: cn__default.default(styles__default.default.bar, typeof activeDotsState.active === 'number' &&
@@ -172,7 +172,7 @@ var Chart = function (props) {
172
172
  }))) : null;
173
173
  case 'area':
174
174
  case 'line':
175
- return show && !(item === null || item === void 0 ? void 0 : item.hide) ? (React__default.default.createElement(recharts.Line, tslib_es6.__assign({ key: "".concat(state.id, "-").concat(properties.dataKey) }, properties, { dot: properties.dot && properties.dotSettings
175
+ return show && !(item === null || item === void 0 ? void 0 : item.hide) ? (React__default.default.createElement(recharts.Line, tslib.__assign({ key: "".concat(state.id, "-").concat(properties.dataKey) }, properties, { dot: properties.dot && properties.dotSettings
176
176
  ? CustomizedHOC(components_Dot_index.Dot, {
177
177
  activeDot: activeDotsState.active,
178
178
  dotSettings: properties.dotSettings,
@@ -182,7 +182,7 @@ var Chart = function (props) {
182
182
  })
183
183
  : false, activeDot: false }))) : null;
184
184
  case 'gradient':
185
- return show && !(item === null || item === void 0 ? void 0 : item.hide) ? (React__default.default.createElement(recharts.Area, tslib_es6.__assign({}, item.properties, { key: "".concat(state.id, "-").concat(item.properties.dataKey), dataKey: "".concat(item.properties.dataKey), stroke: 'transparent', fill: item.gradient.gid
185
+ return show && !(item === null || item === void 0 ? void 0 : item.hide) ? (React__default.default.createElement(recharts.Area, tslib.__assign({}, item.properties, { key: "".concat(state.id, "-").concat(item.properties.dataKey), dataKey: "".concat(item.properties.dataKey), stroke: 'transparent', fill: item.gradient.gid
186
186
  ? "url(#".concat(state.id, "-").concat(item.gradient.gid, ")")
187
187
  : item.properties.fill, dot: false, activeDot: false }))) : null;
188
188
  default:
@@ -266,7 +266,7 @@ var Chart = function (props) {
266
266
  return null;
267
267
  return (React__default.default.createElement("div", { className: styles__default.default.coreChart, ref: svgRef, id: (state === null || state === void 0 ? void 0 : state.id) || '', style: { width: '100%', height: '100%' } },
268
268
  React__default.default.createElement(recharts.ResponsiveContainer, { debounce: ((_a = state === null || state === void 0 ? void 0 : state.responsiveContainer) === null || _a === void 0 ? void 0 : _a.debounce) ? state.responsiveContainer.debounce : 0, width: '100%' },
269
- React__default.default.createElement(recharts.ComposedChart, tslib_es6.__assign({}, state === null || state === void 0 ? void 0 : state.composeChart, { onMouseMove: mouseMove, onMouseLeave: mouseLeave, data: data }),
269
+ React__default.default.createElement(recharts.ComposedChart, tslib.__assign({}, state === null || state === void 0 ? void 0 : state.composeChart, { onMouseMove: mouseMove, onMouseLeave: mouseLeave, data: data }),
270
270
  React__default.default.createElement("defs", null, renderGradient),
271
271
  state.cartesianGrid && renderCartesianGrid,
272
272
  state.xAxis && renderXAxis,
@@ -1,39 +1,38 @@
1
1
  :root {
2
+ } /* deprecated */ :root {
3
+ } :root {
4
+ } :root {
5
+ } :root {
2
6
 
3
7
  /* Hard */
4
8
 
5
9
  /* Up */
6
10
 
7
11
  /* Hard up */
8
- }
9
- :root {
12
+ } :root {
13
+ } :root {
10
14
  --gap-2xl: 32px;
11
- }
12
- .legendContent {
15
+ } :root {
16
+ } :root {
17
+ } .legendContent {
13
18
  display: flex;
14
19
  align-items: center;
15
20
  flex-wrap: wrap;
16
- }
17
- .legendWrap {
21
+ } .legendWrap {
18
22
  width: 100%;
19
23
  margin: 0;
20
24
  padding: 0;
21
- }
22
- .legendItem {
25
+ } .legendItem {
23
26
  margin-right: var(--gap-2xl);
24
27
  cursor: pointer;
25
28
  display: inline-block;
26
- }
27
- .legendItem:last-child {
29
+ } .legendItem:last-child {
28
30
  margin-right: 0;
29
- }
30
- .legendUnactive {
31
+ } .legendUnactive {
31
32
  opacity: 0.3;
32
- }
33
- .legendIcon {
33
+ } .legendIcon {
34
34
  margin-right: 13px;
35
35
  display: flex;
36
- }
37
- .legendValue {
36
+ } .legendValue {
38
37
  text-transform: capitalize;
39
38
  }
@@ -1,26 +1,29 @@
1
1
  :root {
2
+ } /* deprecated */ :root {
2
3
  --color-dark-bg-primary: #0b1f35;
3
4
  --color-light-text-primary: #0b1f35;
4
- }
5
- :root {
5
+ } :root {
6
+ } :root {
7
+ } :root {
6
8
 
7
9
  /* Hard */
8
10
 
9
11
  /* Up */
10
12
 
11
13
  /* Hard up */
12
- }
13
- .tickText {
14
+ } :root {
15
+ } :root {
16
+ } :root {
17
+ } :root {
18
+ } .tickText {
14
19
  fill: var(--color-light-text-primary);
15
20
  font-size: 16px;
16
21
  line-height: 24px;
17
22
  font-weight: 400;
18
- }
19
- .circle {
23
+ } .circle {
20
24
  opacity: 0.3;
21
25
  fill: var(--color-dark-bg-primary);
22
- }
23
- .circle {
26
+ } .circle {
24
27
  opacity: 0.3;
25
28
  fill: var(--color-dark-bg-primary);
26
29
  }
@@ -1,8 +1,10 @@
1
1
  :root {
2
+ } /* deprecated */ :root {
2
3
  --color-light-bg-primary: #fff;
3
4
  --color-light-border-primary: #dbdee1;
4
- }
5
- :root {
5
+ } :root {
6
+ } :root {
7
+ } :root {
6
8
  --shadow-l: 0 0 24px rgba(11, 31, 53, 0.12), 0 12px 24px rgba(11, 31, 53, 0.24);
7
9
 
8
10
  /* Hard */
@@ -10,15 +12,14 @@
10
12
  /* Up */
11
13
 
12
14
  /* Hard up */
13
- }
14
- :root {
15
+ } :root {
16
+ --border-radius-m: 8px;
17
+ } :root {
15
18
  --gap-s: 12px;
16
19
  --gap-m: 16px;
17
- }
18
- :root {
19
- --border-radius-m: 8px;
20
- }
21
- .tooltip {
20
+ } :root {
21
+ } :root {
22
+ } .tooltip {
22
23
  background-color: var(--color-light-bg-primary);
23
24
  border: 1px solid var(--color-light-border-primary);
24
25
  box-shadow: var(--shadow-l);
@@ -26,18 +27,15 @@
26
27
  padding: var(--gap-s) var(--gap-m);
27
28
  pointer-events: none;
28
29
  position: relative;
29
- }
30
- .tooltipList {
30
+ } .tooltipList {
31
31
  position: relative;
32
32
  z-index: 5;
33
33
  list-style-type: none;
34
34
  padding: 0;
35
35
  margin: 0;
36
- }
37
- .tooltipItem {
36
+ } .tooltipItem {
38
37
  margin-bottom: 10px;
39
- }
40
- .tooltipArrow {
38
+ } .tooltipArrow {
41
39
  position: absolute;
42
40
  left: 0;
43
41
  top: 50%;
@@ -46,8 +44,7 @@
46
44
  height: 10px;
47
45
  border: 1px solid var(--color-light-border-primary);
48
46
  background-color: var(--color-light-bg-primary);
49
- }
50
- .tooltipArrow:before {
47
+ } .tooltipArrow:before {
51
48
  content: '';
52
49
  position: absolute;
53
50
  left: -2px;
@@ -57,8 +54,7 @@
57
54
  border-style: solid;
58
55
  border-width: 0 24px 24px 0;
59
56
  border-color: transparent var(--color-light-bg-primary) transparent transparent;
60
- }
61
- .tooltipArrowRight {
57
+ } .tooltipArrowRight {
62
58
  left: 100%;
63
59
  transform: translate(-50%, -50%) scale(-1, 1) rotate(45deg);
64
60
  }