@semcore/mini-chart 0.29.1 → 16.0.0-prerelease.4
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/CHANGELOG.md +6 -0
- package/lib/cjs/component/score/Donut.js +14 -16
- package/lib/cjs/component/score/Donut.js.map +1 -1
- package/lib/cjs/component/score/Line.js +21 -23
- package/lib/cjs/component/score/Line.js.map +1 -1
- package/lib/cjs/component/score/Line.types.js.map +1 -1
- package/lib/cjs/component/trend/Bar.js +12 -14
- package/lib/cjs/component/trend/Bar.js.map +1 -1
- package/lib/cjs/component/trend/Line.js +13 -15
- package/lib/cjs/component/trend/Line.js.map +1 -1
- package/lib/es6/component/score/Donut.js +13 -13
- package/lib/es6/component/score/Donut.js.map +1 -1
- package/lib/es6/component/score/Line.js +21 -21
- package/lib/es6/component/score/Line.js.map +1 -1
- package/lib/es6/component/score/Line.types.js.map +1 -1
- package/lib/es6/component/trend/Bar.js +11 -11
- package/lib/es6/component/trend/Bar.js.map +1 -1
- package/lib/es6/component/trend/Line.js +12 -12
- package/lib/es6/component/trend/Line.js.map +1 -1
- package/lib/esm/component/score/Donut.mjs +56 -57
- package/lib/esm/component/score/Line.mjs +56 -57
- package/lib/esm/component/trend/Bar.mjs +38 -39
- package/lib/esm/component/trend/Line.mjs +51 -52
- package/lib/types/component/score/Donut.d.ts +1 -1
- package/lib/types/component/score/Line.types.d.ts +2 -2
- package/lib/types/component/trend/Bar.d.ts +1 -1
- package/lib/types/component/trend/Line.d.ts +1 -1
- package/package.json +3 -8
|
@@ -4,101 +4,100 @@ import R from "@babel/runtime/helpers/esm/createClass";
|
|
|
4
4
|
import X from "@babel/runtime/helpers/esm/inherits";
|
|
5
5
|
import j from "@babel/runtime/helpers/esm/createSuper";
|
|
6
6
|
import S from "@babel/runtime/helpers/esm/defineProperty";
|
|
7
|
-
import { sstyled as z } from "@semcore/
|
|
8
|
-
import F, { sstyled as d, assignProps as G, Component as M } from "@semcore/core";
|
|
7
|
+
import { sstyled as m, createComponent as z, assignProps as G, Component as F } from "@semcore/core";
|
|
9
8
|
import e from "react";
|
|
10
|
-
import { Box as g, Flex as
|
|
11
|
-
import
|
|
12
|
-
var
|
|
9
|
+
import { Box as g, Flex as M } from "@semcore/flex-box";
|
|
10
|
+
import q from "@semcore/core/lib/utils/enhances/resolveColorEnhance";
|
|
11
|
+
var H = (
|
|
13
12
|
/*__reshadow_css_start__*/
|
|
14
|
-
(
|
|
13
|
+
(m.insert(
|
|
15
14
|
/*__inner_css_start__*/
|
|
16
|
-
"@keyframes
|
|
17
|
-
"
|
|
15
|
+
"@keyframes pulse_2vm7d{0%,to{opacity:1}50%{opacity:.4}}@keyframes move-line_2vm7d{0%{transform:translateX(0)}to{transform:translateX(100%)}}.___SDonutContainer_2vm7d_gg_.__loading_2vm7d_gg_,.___SLineGauge_2vm7d_gg_.__loading_2vm7d_gg_,.___STrendBar_2vm7d_gg_.__loading_2vm7d_gg_,.___STrendLine_2vm7d_gg_.__loading_2vm7d_gg_{animation-name:pulse_2vm7d;animation-iteration-count:infinite;animation-timing-function:ease-in-out;animation-duration:1.6s;will-change:opacity}.___SLineGauge_2vm7d_gg_{height:8px;background-color:var(--base-bg-color_2vm7d, var(--intergalactic-chart-grid-bar-chart-base-bg, #e0e1e9));border-radius:var(--intergalactic-chart-rounded, 2px);overflow:hidden;position:relative}.___SLineValue_2vm7d_gg_{height:8px;border-radius:var(--intergalactic-chart-rounded, 2px)0 0 var(--intergalactic-chart-rounded, 2px)}.___SLineValue_2vm7d_gg_.__percent_2vm7d_gg_{width:var(--percent_2vm7d)}.___SLineSegmentItem_2vm7d_gg_.__color_2vm7d_gg_,.___SLineValue_2vm7d_gg_.__color_2vm7d_gg_{background-color:var(--color_2vm7d, var(--intergalactic-chart-palette-order-1, #2bb3ff))}.___SLineGauge_2vm7d_gg_.__segments_2vm7d_gg_{border-radius:var(--intergalactic-progress-bar-rounded, 6px)}.___SAnimationLine_2vm7d_gg_,.___SLineGaugeSegment_2vm7d_gg_{position:absolute;top:0;left:0;right:0;bottom:0}.___SLineSegmentItem_2vm7d_gg_:last-child{margin-right:0;border-right:none}.___SLineSegmentItem_2vm7d_gg_{height:8px;background:0 0;border-right-color:var(--intergalactic-chart-grid-border, #ffffff);border-right-style:solid;border-right-width:1px;box-sizing:content-box}.___SAnimationLine_2vm7d_gg_{background-color:var(--intergalactic-chart-grid-bar-chart-base-bg, #e0e1e9);transition:all var(--intergalactic-duration-extra-slow, 500) ease-in-out;animation-name:move-line_2vm7d;animation-duration:.5s;animation-timing-function:ease-in-out;animation-fill-mode:forwards}",
|
|
16
|
+
"2vm7d_gg_"
|
|
18
17
|
), {
|
|
19
|
-
__SLineGauge: "
|
|
20
|
-
_loading: "
|
|
21
|
-
__SDonutContainer: "
|
|
22
|
-
__STrendLine: "
|
|
23
|
-
__STrendBar: "
|
|
24
|
-
"@pulse": "
|
|
25
|
-
"--base-bg-color": "--base-bg-
|
|
26
|
-
__SLineValue: "
|
|
27
|
-
_percent: "
|
|
28
|
-
"--percent": "--
|
|
29
|
-
_color: "
|
|
30
|
-
__SLineSegmentItem: "
|
|
31
|
-
"--color": "--
|
|
32
|
-
_segments: "
|
|
33
|
-
__SLineGaugeSegment: "
|
|
34
|
-
__SAnimationLine: "
|
|
35
|
-
"@move-line": "move-
|
|
18
|
+
__SLineGauge: "___SLineGauge_2vm7d_gg_",
|
|
19
|
+
_loading: "__loading_2vm7d_gg_",
|
|
20
|
+
__SDonutContainer: "___SDonutContainer_2vm7d_gg_",
|
|
21
|
+
__STrendLine: "___STrendLine_2vm7d_gg_",
|
|
22
|
+
__STrendBar: "___STrendBar_2vm7d_gg_",
|
|
23
|
+
"@pulse": "pulse_2vm7d",
|
|
24
|
+
"--base-bg-color": "--base-bg-color_2vm7d",
|
|
25
|
+
__SLineValue: "___SLineValue_2vm7d_gg_",
|
|
26
|
+
_percent: "__percent_2vm7d_gg_",
|
|
27
|
+
"--percent": "--percent_2vm7d",
|
|
28
|
+
_color: "__color_2vm7d_gg_",
|
|
29
|
+
__SLineSegmentItem: "___SLineSegmentItem_2vm7d_gg_",
|
|
30
|
+
"--color": "--color_2vm7d",
|
|
31
|
+
_segments: "__segments_2vm7d_gg_",
|
|
32
|
+
__SLineGaugeSegment: "___SLineGaugeSegment_2vm7d_gg_",
|
|
33
|
+
__SAnimationLine: "___SAnimationLine_2vm7d_gg_",
|
|
34
|
+
"@move-line": "move-line_2vm7d"
|
|
36
35
|
})
|
|
37
36
|
), l = /* @__PURE__ */ function(p) {
|
|
38
|
-
X(
|
|
39
|
-
var
|
|
40
|
-
function
|
|
41
|
-
return N(this,
|
|
37
|
+
X(r, p);
|
|
38
|
+
var h = j(r);
|
|
39
|
+
function r() {
|
|
40
|
+
return N(this, r), h.apply(this, arguments);
|
|
42
41
|
}
|
|
43
|
-
return R(
|
|
42
|
+
return R(r, [{
|
|
44
43
|
key: "getSegmentProps",
|
|
45
44
|
value: function(t) {
|
|
46
|
-
var _ = this.asProps, c = _.children,
|
|
45
|
+
var _ = this.asProps, c = _.children, f = _.resolveColor, a = 0;
|
|
47
46
|
e.Children.forEach(c, function(s) {
|
|
48
47
|
/* @__PURE__ */ e.isValidElement(s) && (a = a + s.props.value);
|
|
49
48
|
});
|
|
50
|
-
var
|
|
49
|
+
var d = a > 0 ? 100 * t.value / a : 0;
|
|
51
50
|
return {
|
|
52
|
-
w: "".concat(
|
|
53
|
-
"use:color":
|
|
51
|
+
w: "".concat(d, "%"),
|
|
52
|
+
"use:color": f(t.color)
|
|
54
53
|
};
|
|
55
54
|
}
|
|
56
55
|
}, {
|
|
57
56
|
key: "render",
|
|
58
57
|
value: function() {
|
|
59
|
-
var t = this.asProps, _, c = g,
|
|
58
|
+
var t = this.asProps, _, c = g, f = g, a = g, d = M, s = g, n = this.asProps, b = n.value, y = n.styles, E = n.color, P = E === void 0 ? "chart-palette-order-1" : E, k = n.baseBgColor, v = n.resolveColor, B = n.loading, T = n.children, $ = n.Children, w = n.animate;
|
|
60
59
|
if (T !== void 0) {
|
|
61
60
|
var i;
|
|
62
|
-
return i =
|
|
61
|
+
return i = m(y), /* @__PURE__ */ e.createElement(c, i.cn("SLineGauge", x({}, G({
|
|
63
62
|
segments: !0,
|
|
64
|
-
"base-bg-color":
|
|
65
|
-
}, t))), /* @__PURE__ */ e.createElement(
|
|
63
|
+
"base-bg-color": v(k)
|
|
64
|
+
}, t))), /* @__PURE__ */ e.createElement(d, i.cn("SLineGaugeSegment", {}), /* @__PURE__ */ e.createElement($, i.cn("Children", {}))), w && /* @__PURE__ */ e.createElement(a, i.cn("SAnimationLine", {})));
|
|
66
65
|
}
|
|
67
66
|
var o = this.asProps.segments, C = [];
|
|
68
67
|
if (o)
|
|
69
|
-
for (var
|
|
68
|
+
for (var u = 0; u < o; u++) {
|
|
70
69
|
var I, D = "calc((100% - ".concat(o - 1, "px) / ").concat(o, ")");
|
|
71
|
-
C.push((I =
|
|
72
|
-
key:
|
|
73
|
-
color:
|
|
70
|
+
C.push((I = m(y), /* @__PURE__ */ e.createElement(s, I.cn("SLineSegmentItem", {
|
|
71
|
+
key: u,
|
|
72
|
+
color: u < b ? v(P) : void 0,
|
|
74
73
|
w: D
|
|
75
74
|
}))));
|
|
76
75
|
}
|
|
77
|
-
var V = "".concat(
|
|
78
|
-
return o && (V = "".concat(
|
|
79
|
-
"base-bg-color":
|
|
80
|
-
}, t))), !B && /* @__PURE__ */ e.createElement(
|
|
76
|
+
var V = "".concat(b, "%");
|
|
77
|
+
return o && (V = "".concat(b / o * 100, "%")), _ = m(y), /* @__PURE__ */ e.createElement(c, _.cn("SLineGauge", x({}, G({
|
|
78
|
+
"base-bg-color": v(k)
|
|
79
|
+
}, t))), !B && /* @__PURE__ */ e.createElement(f, _.cn("SLineValue", {
|
|
81
80
|
w: V,
|
|
82
|
-
color:
|
|
83
|
-
})), !!C.length && /* @__PURE__ */ e.createElement(
|
|
81
|
+
color: v(P)
|
|
82
|
+
})), !!C.length && /* @__PURE__ */ e.createElement(d, _.cn("SLineGaugeSegment", {}), C), w && /* @__PURE__ */ e.createElement(a, _.cn("SAnimationLine", {})));
|
|
84
83
|
}
|
|
85
|
-
}]),
|
|
86
|
-
}(
|
|
87
|
-
S(l, "enhance", [
|
|
84
|
+
}]), r;
|
|
85
|
+
}(F);
|
|
86
|
+
S(l, "enhance", [q()]);
|
|
88
87
|
S(l, "displayName", "ScoreLine");
|
|
89
|
-
S(l, "style",
|
|
88
|
+
S(l, "style", H);
|
|
90
89
|
S(l, "defaultProps", {
|
|
91
90
|
animate: !0
|
|
92
91
|
});
|
|
93
92
|
function A(p) {
|
|
94
|
-
var
|
|
95
|
-
return
|
|
93
|
+
var h = arguments[0], r, L = p.styles, t = g;
|
|
94
|
+
return r = m(L), /* @__PURE__ */ e.createElement(t, r.cn("SLineSegmentItem", x({}, G({}, h))));
|
|
96
95
|
}
|
|
97
96
|
A.displayName = "Segment";
|
|
98
|
-
var
|
|
97
|
+
var J = z(l, {
|
|
99
98
|
Segment: A
|
|
100
99
|
});
|
|
101
|
-
|
|
100
|
+
J.displayName = "MiniChart.ScoreLine";
|
|
102
101
|
export {
|
|
103
|
-
|
|
102
|
+
J as ScoreLine
|
|
104
103
|
};
|
|
@@ -1,33 +1,32 @@
|
|
|
1
1
|
import w from "@babel/runtime/helpers/esm/toConsumableArray";
|
|
2
|
-
import
|
|
2
|
+
import f from "@babel/runtime/helpers/esm/objectSpread2";
|
|
3
3
|
import L from "@babel/runtime/helpers/esm/classCallCheck";
|
|
4
4
|
import A from "@babel/runtime/helpers/esm/createClass";
|
|
5
5
|
import D from "@babel/runtime/helpers/esm/inherits";
|
|
6
6
|
import E from "@babel/runtime/helpers/esm/createSuper";
|
|
7
7
|
import l from "@babel/runtime/helpers/esm/defineProperty";
|
|
8
|
-
import { sstyled as
|
|
9
|
-
import v, { assignProps as y, sstyled as G } from "@semcore/core";
|
|
8
|
+
import { sstyled as v, createComponent as y, assignProps as j } from "@semcore/core";
|
|
10
9
|
import _ from "react";
|
|
11
|
-
import
|
|
12
|
-
import { Trend as
|
|
13
|
-
import { Box as
|
|
14
|
-
import { extractAriaProps as
|
|
15
|
-
var
|
|
10
|
+
import R from "@semcore/core/lib/utils/enhances/resolveColorEnhance";
|
|
11
|
+
import { Trend as G } from "./Trend.mjs";
|
|
12
|
+
import { Box as N } from "@semcore/flex-box";
|
|
13
|
+
import { extractAriaProps as M } from "@semcore/core/lib/utils/ariaProps";
|
|
14
|
+
var W = (
|
|
16
15
|
/*__reshadow_css_start__*/
|
|
17
|
-
(
|
|
16
|
+
(v.insert(
|
|
18
17
|
/*__inner_css_start__*/
|
|
19
|
-
"@keyframes
|
|
20
|
-
"
|
|
18
|
+
"@keyframes pulse_7jer1{0%,to{opacity:1}50%{opacity:.4}}.___SDonutContainer_7jer1_gg_.__loading_7jer1_gg_,.___SLineGauge_7jer1_gg_.__loading_7jer1_gg_,.___STrendBar_7jer1_gg_.__loading_7jer1_gg_,.___STrendLine_7jer1_gg_.__loading_7jer1_gg_{animation-name:pulse_7jer1;animation-iteration-count:infinite;animation-timing-function:ease-in-out;animation-duration:1.6s;will-change:opacity}",
|
|
19
|
+
"7jer1_gg_"
|
|
21
20
|
), {
|
|
22
|
-
__SLineGauge: "
|
|
23
|
-
_loading: "
|
|
24
|
-
__SDonutContainer: "
|
|
25
|
-
__STrendLine: "
|
|
26
|
-
__STrendBar: "
|
|
27
|
-
"@pulse": "
|
|
21
|
+
__SLineGauge: "___SLineGauge_7jer1_gg_",
|
|
22
|
+
_loading: "__loading_7jer1_gg_",
|
|
23
|
+
__SDonutContainer: "___SDonutContainer_7jer1_gg_",
|
|
24
|
+
__STrendLine: "___STrendLine_7jer1_gg_",
|
|
25
|
+
__STrendBar: "___STrendBar_7jer1_gg_",
|
|
26
|
+
"@pulse": "pulse_7jer1"
|
|
28
27
|
})
|
|
29
|
-
), o = /* @__PURE__ */ function(
|
|
30
|
-
D(e,
|
|
28
|
+
), o = /* @__PURE__ */ function(u) {
|
|
29
|
+
D(e, u);
|
|
31
30
|
var s = E(e);
|
|
32
31
|
function e() {
|
|
33
32
|
return L(this, e), s.apply(this, arguments);
|
|
@@ -48,51 +47,51 @@ var j = (
|
|
|
48
47
|
}, {
|
|
49
48
|
key: "data",
|
|
50
49
|
get: function() {
|
|
51
|
-
var
|
|
50
|
+
var n = this.asProps, r = n.data, t = n.loading;
|
|
52
51
|
return t ? this.defaultData : r;
|
|
53
52
|
}
|
|
54
53
|
}, {
|
|
55
54
|
key: "render",
|
|
56
55
|
value: function() {
|
|
57
|
-
var
|
|
58
|
-
return r =
|
|
56
|
+
var n = this.asProps, r, t = this, S = N, a = this.asProps, T = a.styles, p = a.resolveColor, C = a.isHistogram, B = a.animate, x = a.loading, g = this.defaultWidth / this.data.length, c = M(this.asProps), H = c.__excludeProps, k = c.extractedAriaProps;
|
|
57
|
+
return r = v(T), /* @__PURE__ */ _.createElement(S, r.cn("STrendBar", f({}, j({
|
|
59
58
|
ref: this.containerRef,
|
|
60
59
|
__excludeProps: ["data"].concat(w(H))
|
|
61
|
-
},
|
|
60
|
+
}, n))), /* @__PURE__ */ _.createElement("svg", r.cn("svg", f({
|
|
62
61
|
width: "100%",
|
|
63
62
|
height: "100%",
|
|
64
63
|
viewBox: "0 0 ".concat(this.svgWidth, " ").concat(this.svgHeight),
|
|
65
64
|
role: "img"
|
|
66
|
-
}, k)), this.data.map(function(
|
|
67
|
-
var
|
|
68
|
-
return
|
|
65
|
+
}, k)), this.data.map(function(i, m) {
|
|
66
|
+
var h = p("chart-palette-order-other-data");
|
|
67
|
+
return i.color && (h = p(i.color)), /* @__PURE__ */ _.createElement("rect", {
|
|
69
68
|
key: m,
|
|
70
|
-
x:
|
|
71
|
-
y: t.defaultHeight -
|
|
72
|
-
width: C ?
|
|
73
|
-
height:
|
|
74
|
-
fill:
|
|
69
|
+
x: g * m,
|
|
70
|
+
y: t.defaultHeight - i.value,
|
|
71
|
+
width: C ? g : g * 0.8,
|
|
72
|
+
height: i.value,
|
|
73
|
+
fill: h
|
|
75
74
|
}, B && !x && /* @__PURE__ */ _.createElement("animate", {
|
|
76
75
|
attributeName: "y",
|
|
77
|
-
values: "".concat(t.defaultHeight, ";").concat(t.defaultHeight -
|
|
76
|
+
values: "".concat(t.defaultHeight, ";").concat(t.defaultHeight - i.value),
|
|
78
77
|
dur: "500ms"
|
|
79
78
|
}));
|
|
80
79
|
})));
|
|
81
80
|
}
|
|
82
81
|
}]), e;
|
|
83
|
-
}(
|
|
84
|
-
l(o, "enhance", [
|
|
85
|
-
l(o, "style",
|
|
82
|
+
}(G);
|
|
83
|
+
l(o, "enhance", [R()]);
|
|
84
|
+
l(o, "style", W);
|
|
86
85
|
l(o, "defaultProps", {
|
|
87
86
|
animate: !0
|
|
88
87
|
});
|
|
89
|
-
var P =
|
|
88
|
+
var P = y(o);
|
|
90
89
|
P.displayName = "MiniChart.TrendBar";
|
|
91
|
-
var
|
|
90
|
+
var b = y(o, {}, {
|
|
92
91
|
enhancements: [function() {
|
|
93
92
|
return {
|
|
94
93
|
wrapperProps: function(s) {
|
|
95
|
-
return
|
|
94
|
+
return j(s, {
|
|
96
95
|
isHistogram: !0
|
|
97
96
|
});
|
|
98
97
|
}
|
|
@@ -102,5 +101,5 @@ var ee = v(o, {}, {
|
|
|
102
101
|
P.displayName = "MiniChart.TrendHistogram";
|
|
103
102
|
export {
|
|
104
103
|
P as TrendBar,
|
|
105
|
-
|
|
104
|
+
b as TrendHistogram
|
|
106
105
|
};
|
|
@@ -4,34 +4,33 @@ import E from "@babel/runtime/helpers/esm/classCallCheck";
|
|
|
4
4
|
import R from "@babel/runtime/helpers/esm/createClass";
|
|
5
5
|
import H from "@babel/runtime/helpers/esm/inherits";
|
|
6
6
|
import W from "@babel/runtime/helpers/esm/createSuper";
|
|
7
|
-
import
|
|
8
|
-
import { sstyled as
|
|
9
|
-
import C, { assignProps as S, sstyled as b } from "@semcore/core";
|
|
7
|
+
import g from "@babel/runtime/helpers/esm/defineProperty";
|
|
8
|
+
import { sstyled as j, createComponent as C, assignProps as S } from "@semcore/core";
|
|
10
9
|
import i from "react";
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import { Trend as
|
|
14
|
-
import { Box as
|
|
15
|
-
import { extractAriaProps as
|
|
16
|
-
var
|
|
10
|
+
import $ from "@semcore/core/lib/utils/enhances/resolveColorEnhance";
|
|
11
|
+
import b from "@semcore/core/lib/utils/uniqueID";
|
|
12
|
+
import { Trend as D } from "./Trend.mjs";
|
|
13
|
+
import { Box as B } from "@semcore/flex-box";
|
|
14
|
+
import { extractAriaProps as G } from "@semcore/core/lib/utils/ariaProps";
|
|
15
|
+
var N = (
|
|
17
16
|
/*__reshadow_css_start__*/
|
|
18
|
-
(
|
|
17
|
+
(j.insert(
|
|
19
18
|
/*__inner_css_start__*/
|
|
20
|
-
"@keyframes
|
|
21
|
-
"
|
|
19
|
+
"@keyframes pulse_7jer1{0%,to{opacity:1}50%{opacity:.4}}.___SDonutContainer_7jer1_gg_.__loading_7jer1_gg_,.___SLineGauge_7jer1_gg_.__loading_7jer1_gg_,.___STrendBar_7jer1_gg_.__loading_7jer1_gg_,.___STrendLine_7jer1_gg_.__loading_7jer1_gg_{animation-name:pulse_7jer1;animation-iteration-count:infinite;animation-timing-function:ease-in-out;animation-duration:1.6s;will-change:opacity}",
|
|
20
|
+
"7jer1_gg_"
|
|
22
21
|
), {
|
|
23
|
-
__SLineGauge: "
|
|
24
|
-
_loading: "
|
|
25
|
-
__SDonutContainer: "
|
|
26
|
-
__STrendLine: "
|
|
27
|
-
__STrendBar: "
|
|
28
|
-
"@pulse": "
|
|
22
|
+
__SLineGauge: "___SLineGauge_7jer1_gg_",
|
|
23
|
+
_loading: "__loading_7jer1_gg_",
|
|
24
|
+
__SDonutContainer: "___SDonutContainer_7jer1_gg_",
|
|
25
|
+
__STrendLine: "___STrendLine_7jer1_gg_",
|
|
26
|
+
__STrendBar: "___STrendBar_7jer1_gg_",
|
|
27
|
+
"@pulse": "pulse_7jer1"
|
|
29
28
|
})
|
|
30
|
-
), l = /* @__PURE__ */ function(
|
|
31
|
-
H(s,
|
|
32
|
-
var
|
|
29
|
+
), l = /* @__PURE__ */ function(u) {
|
|
30
|
+
H(s, u);
|
|
31
|
+
var d = W(s);
|
|
33
32
|
function s() {
|
|
34
|
-
return E(this, s),
|
|
33
|
+
return E(this, s), d.apply(this, arguments);
|
|
35
34
|
}
|
|
36
35
|
return R(s, [{
|
|
37
36
|
key: "defaultData",
|
|
@@ -47,8 +46,8 @@ var M = (
|
|
|
47
46
|
}, {
|
|
48
47
|
key: "data",
|
|
49
48
|
get: function() {
|
|
50
|
-
var e = this.asProps, t = e.data,
|
|
51
|
-
return
|
|
49
|
+
var e = this.asProps, t = e.data, o = e.loading;
|
|
50
|
+
return o ? this.defaultData : t;
|
|
52
51
|
}
|
|
53
52
|
}, {
|
|
54
53
|
key: "svgWidth",
|
|
@@ -63,16 +62,16 @@ var M = (
|
|
|
63
62
|
}, {
|
|
64
63
|
key: "color",
|
|
65
64
|
get: function() {
|
|
66
|
-
var e = this.asProps, t = e.resolveColor,
|
|
67
|
-
return t(
|
|
65
|
+
var e = this.asProps, t = e.resolveColor, o = e.color, r = o === void 0 ? "chart-palette-order-1" : o, n = e.loading;
|
|
66
|
+
return t(n ? "skeleton-bg" : r);
|
|
68
67
|
}
|
|
69
68
|
}, {
|
|
70
69
|
key: "render",
|
|
71
70
|
value: function() {
|
|
72
|
-
for (var e = this.asProps, t,
|
|
73
|
-
|
|
74
|
-
var v =
|
|
75
|
-
return t =
|
|
71
|
+
for (var e = this.asProps, t, o = B, r = this.asProps, n = r.uid, k = r.withArea, T = r.animate, p = r.lastPointColor, m = r.resolveColor, f = r.loading, x = r.styles, h = [], _ = this.data.length, P = this.defaultWidth / (_ - 1), c = 0; c < _; c++)
|
|
72
|
+
h.push("".concat(P * c, ",").concat(this.defaultHeight - this.data[c]));
|
|
73
|
+
var v = G(this.asProps), L = v.__excludeProps, w = v.extractedAriaProps;
|
|
74
|
+
return t = j(x), /* @__PURE__ */ i.createElement(o, t.cn("STrendLine", y({}, S({
|
|
76
75
|
ref: this.containerRef,
|
|
77
76
|
__excludeProps: ["data"].concat(A(L))
|
|
78
77
|
}, e))), /* @__PURE__ */ i.createElement("svg", t.cn("svg", y({
|
|
@@ -81,26 +80,26 @@ var M = (
|
|
|
81
80
|
viewBox: "0 0 ".concat(this.svgWidth, " ").concat(this.svgHeight),
|
|
82
81
|
role: "img"
|
|
83
82
|
}, w)), /* @__PURE__ */ i.createElement("polyline", t.cn("polyline", {
|
|
84
|
-
points:
|
|
83
|
+
points: h.join(" "),
|
|
85
84
|
stroke: this.color,
|
|
86
85
|
strokeWidth: "4",
|
|
87
86
|
fill: "none",
|
|
88
|
-
clipPath: "url(#".concat(
|
|
87
|
+
clipPath: "url(#".concat(n, ")")
|
|
89
88
|
})), k && /* @__PURE__ */ i.createElement("polyline", t.cn("polyline", {
|
|
90
|
-
points: "0,".concat(this.defaultHeight, " ").concat(
|
|
89
|
+
points: "0,".concat(this.defaultHeight, " ").concat(h.join(" "), " ").concat(this.defaultWidth, ",").concat(this.defaultHeight),
|
|
91
90
|
fill: this.color,
|
|
92
91
|
fillOpacity: 0.2,
|
|
93
|
-
clipPath: "url(#".concat(
|
|
94
|
-
})),
|
|
92
|
+
clipPath: "url(#".concat(n, ")")
|
|
93
|
+
})), p && !f && /* @__PURE__ */ i.createElement("circle", t.cn("circle", {
|
|
95
94
|
cx: P * (_ - 1),
|
|
96
95
|
cy: this.defaultHeight - this.data[_ - 1],
|
|
97
96
|
r: this.lastPointRadius,
|
|
98
|
-
fill: p
|
|
99
|
-
stroke:
|
|
97
|
+
fill: m(p),
|
|
98
|
+
stroke: m("chart-grid-border"),
|
|
100
99
|
strokeWidth: 4,
|
|
101
|
-
clipPath: "url(#".concat(
|
|
102
|
-
})), T && !
|
|
103
|
-
id:
|
|
100
|
+
clipPath: "url(#".concat(n, ")")
|
|
101
|
+
})), T && !f && /* @__PURE__ */ i.createElement("clipPath", t.cn("clipPath", {
|
|
102
|
+
id: n
|
|
104
103
|
}), /* @__PURE__ */ i.createElement("rect", t.cn("rect", {
|
|
105
104
|
x: "0",
|
|
106
105
|
y: "0",
|
|
@@ -114,27 +113,27 @@ var M = (
|
|
|
114
113
|
}))))));
|
|
115
114
|
}
|
|
116
115
|
}]), s;
|
|
117
|
-
}(
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
116
|
+
}(D);
|
|
117
|
+
g(l, "enhance", [$(), b()]);
|
|
118
|
+
g(l, "style", N);
|
|
119
|
+
g(l, "defaultProps", {
|
|
121
120
|
animate: !0
|
|
122
121
|
});
|
|
123
|
-
var
|
|
124
|
-
|
|
125
|
-
var
|
|
122
|
+
var M = C(l);
|
|
123
|
+
M.displayName = "MiniChart.TrendLine";
|
|
124
|
+
var q = C(l, {}, {
|
|
126
125
|
enhancements: [function() {
|
|
127
126
|
return {
|
|
128
|
-
wrapperProps: function(
|
|
129
|
-
return S(
|
|
127
|
+
wrapperProps: function(d) {
|
|
128
|
+
return S(d, {
|
|
130
129
|
withArea: !0
|
|
131
130
|
});
|
|
132
131
|
}
|
|
133
132
|
};
|
|
134
133
|
}]
|
|
135
134
|
});
|
|
136
|
-
|
|
135
|
+
q.displayName = "MiniChart.TrendArea";
|
|
137
136
|
export {
|
|
138
|
-
|
|
139
|
-
|
|
137
|
+
q as TrendArea,
|
|
138
|
+
M as TrendLine
|
|
140
139
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ComponentType } from '@semcore/core';
|
|
2
2
|
import { BoxProps } from '@semcore/flex-box';
|
|
3
|
-
import resolveColorEnhance from '@semcore/
|
|
3
|
+
import resolveColorEnhance from '@semcore/core/lib/utils/enhances/resolveColorEnhance';
|
|
4
4
|
import { CommonScoreProps } from './Score';
|
|
5
5
|
export type ScoreDonutProps = BoxProps & CommonScoreProps;
|
|
6
6
|
type Enhances = {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { Intergalactic, ComponentType } from '@semcore/
|
|
1
|
+
import { Intergalactic, ComponentType } from '@semcore/core';
|
|
2
2
|
import { CommonScoreProps } from './Score';
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import { BoxProps, Box } from '@semcore/flex-box';
|
|
5
|
-
import resolveColorEnhance from '@semcore/
|
|
5
|
+
import resolveColorEnhance from '@semcore/core/lib/utils/enhances/resolveColorEnhance';
|
|
6
6
|
type Enumerate<N extends number, Acc extends number[] = []> = Acc['length'] extends N ? Acc[number] : Enumerate<N, [...Acc, Acc['length']]>;
|
|
7
7
|
type Range<F extends number, T extends number> = Exclude<Enumerate<T>, Enumerate<F>>;
|
|
8
8
|
export type SegmentColor = `chart-palette-order-${Range<1, 24>}`;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ComponentType } from '@semcore/core';
|
|
2
|
-
import resolveColorEnhance from '@semcore/
|
|
2
|
+
import resolveColorEnhance from '@semcore/core/lib/utils/enhances/resolveColorEnhance';
|
|
3
3
|
import { CommonTrendProps } from './Trend';
|
|
4
4
|
type BarItem = {
|
|
5
5
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ComponentType } from '@semcore/core';
|
|
2
|
-
import resolveColorEnhance from '@semcore/
|
|
2
|
+
import resolveColorEnhance from '@semcore/core/lib/utils/enhances/resolveColorEnhance';
|
|
3
3
|
import { CommonTrendProps } from './Trend';
|
|
4
4
|
export type TrendLineProps = CommonTrendProps & {
|
|
5
5
|
/**
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@semcore/mini-chart",
|
|
3
3
|
"description": "Semrush MiniChart Component",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "16.0.0-prerelease.4",
|
|
5
5
|
"main": "lib/cjs/index.js",
|
|
6
6
|
"module": "lib/es6/index.js",
|
|
7
7
|
"typings": "lib/types/index.d.ts",
|
|
@@ -13,14 +13,9 @@
|
|
|
13
13
|
"import": "./lib/esm/index.mjs",
|
|
14
14
|
"types": "./lib/types/index.d.ts"
|
|
15
15
|
},
|
|
16
|
-
"dependencies": {
|
|
17
|
-
"@semcore/flex-box": "5.41.1",
|
|
18
|
-
"@semcore/utils": "4.48.1"
|
|
19
|
-
},
|
|
20
16
|
"peerDependencies": {
|
|
21
|
-
"@semcore/
|
|
22
|
-
"
|
|
23
|
-
"react-dom": "16.8 - 18"
|
|
17
|
+
"@semcore/base-components": "^16.0.0-prerelease.4",
|
|
18
|
+
"@semcore/flex-box": "^16.0.0-prerelease.4"
|
|
24
19
|
},
|
|
25
20
|
"repository": {
|
|
26
21
|
"type": "git",
|