@selfdecode/sd-component-library 4.0.141 → 4.0.142
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/lib/sd-component-library100.js +2 -2
- package/lib/sd-component-library101.js +3 -3
- package/lib/sd-component-library104.js +2 -2
- package/lib/sd-component-library106.js +2 -2
- package/lib/sd-component-library112.js +1 -1
- package/lib/sd-component-library118.js +1 -1
- package/lib/sd-component-library126.js +1 -1
- package/lib/sd-component-library127.js +1 -1
- package/lib/sd-component-library129.js +1 -1
- package/lib/sd-component-library133.js +3 -3
- package/lib/sd-component-library134.js +1 -1
- package/lib/sd-component-library136.js +2 -2
- package/lib/sd-component-library16.js +1 -1
- package/lib/sd-component-library167.js +1 -1
- package/lib/sd-component-library197.js +3 -3
- package/lib/sd-component-library201.js +3 -2
- package/lib/sd-component-library201.js.map +1 -1
- package/lib/sd-component-library202.js +57 -30
- package/lib/sd-component-library202.js.map +1 -1
- package/lib/sd-component-library203.js +2 -599
- package/lib/sd-component-library203.js.map +1 -1
- package/lib/sd-component-library204.js +30 -26
- package/lib/sd-component-library204.js.map +1 -1
- package/lib/sd-component-library205.js +599 -18
- package/lib/sd-component-library205.js.map +1 -1
- package/lib/sd-component-library206.js +19 -57
- package/lib/sd-component-library206.js.map +1 -1
- package/lib/sd-component-library207.js +18 -23
- package/lib/sd-component-library207.js.map +1 -1
- package/lib/sd-component-library208.js +62 -19
- package/lib/sd-component-library208.js.map +1 -1
- package/lib/sd-component-library209.js +23 -3
- package/lib/sd-component-library209.js.map +1 -1
- package/lib/sd-component-library210.js +21 -3
- package/lib/sd-component-library210.js.map +1 -1
- package/lib/sd-component-library211.js +3 -40
- package/lib/sd-component-library211.js.map +1 -1
- package/lib/sd-component-library212.js +3 -129
- package/lib/sd-component-library212.js.map +1 -1
- package/lib/sd-component-library213.js +26 -13
- package/lib/sd-component-library213.js.map +1 -1
- package/lib/sd-component-library214.js +3 -14
- package/lib/sd-component-library214.js.map +1 -1
- package/lib/sd-component-library215.js +31 -3
- package/lib/sd-component-library215.js.map +1 -1
- package/lib/sd-component-library216.js +19 -3
- package/lib/sd-component-library216.js.map +1 -1
- package/lib/sd-component-library217.js +20 -3
- package/lib/sd-component-library217.js.map +1 -1
- package/lib/sd-component-library218.js +28 -52
- package/lib/sd-component-library218.js.map +1 -1
- package/lib/sd-component-library219.js +29 -61
- package/lib/sd-component-library219.js.map +1 -1
- package/lib/sd-component-library220.js +3 -3
- package/lib/sd-component-library220.js.map +1 -1
- package/lib/sd-component-library221.js +129 -46
- package/lib/sd-component-library221.js.map +1 -1
- package/lib/sd-component-library222.js +43 -17
- package/lib/sd-component-library222.js.map +1 -1
- package/lib/sd-component-library223.js +43 -22
- package/lib/sd-component-library223.js.map +1 -1
- package/lib/sd-component-library224.js +7 -56
- package/lib/sd-component-library224.js.map +1 -1
- package/lib/sd-component-library225.js +64 -3
- package/lib/sd-component-library225.js.map +1 -1
- package/lib/sd-component-library226.js +43 -3
- package/lib/sd-component-library226.js.map +1 -1
- package/lib/sd-component-library227.js +13 -3
- package/lib/sd-component-library227.js.map +1 -1
- package/lib/sd-component-library228.js +21 -31
- package/lib/sd-component-library228.js.map +1 -1
- package/lib/sd-component-library229.js +108 -18
- package/lib/sd-component-library229.js.map +1 -1
- package/lib/sd-component-library230.js +46 -19
- package/lib/sd-component-library230.js.map +1 -1
- package/lib/sd-component-library231.js +24 -28
- package/lib/sd-component-library231.js.map +1 -1
- package/lib/sd-component-library232.js +49 -29
- package/lib/sd-component-library232.js.map +1 -1
- package/lib/sd-component-library233.js +47 -128
- package/lib/sd-component-library233.js.map +1 -1
- package/lib/sd-component-library234.js +72 -40
- package/lib/sd-component-library234.js.map +1 -1
- package/lib/sd-component-library235.js +39 -45
- package/lib/sd-component-library235.js.map +1 -1
- package/lib/sd-component-library236.js +27 -8
- package/lib/sd-component-library236.js.map +1 -1
- package/lib/sd-component-library237.js +20 -63
- package/lib/sd-component-library237.js.map +1 -1
- package/lib/sd-component-library238.js +20 -43
- package/lib/sd-component-library238.js.map +1 -1
- package/lib/sd-component-library239.js +2 -13
- package/lib/sd-component-library239.js.map +1 -1
- package/lib/sd-component-library24.js +1 -1
- package/lib/sd-component-library240.js +40 -21
- package/lib/sd-component-library240.js.map +1 -1
- package/lib/sd-component-library241.js +128 -108
- package/lib/sd-component-library241.js.map +1 -1
- package/lib/sd-component-library242.js +13 -47
- package/lib/sd-component-library242.js.map +1 -1
- package/lib/sd-component-library243.js +14 -24
- package/lib/sd-component-library243.js.map +1 -1
- package/lib/sd-component-library244.js +3 -53
- package/lib/sd-component-library244.js.map +1 -1
- package/lib/sd-component-library245.js +3 -48
- package/lib/sd-component-library245.js.map +1 -1
- package/lib/sd-component-library246.js +3 -41
- package/lib/sd-component-library246.js.map +1 -1
- package/lib/sd-component-library247.js +52 -27
- package/lib/sd-component-library247.js.map +1 -1
- package/lib/sd-component-library248.js +62 -72
- package/lib/sd-component-library248.js.map +1 -1
- package/lib/sd-component-library249.js +3 -21
- package/lib/sd-component-library249.js.map +1 -1
- package/lib/sd-component-library250.js +46 -20
- package/lib/sd-component-library250.js.map +1 -1
- package/lib/sd-component-library251.js +17 -2
- package/lib/sd-component-library251.js.map +1 -1
- package/lib/sd-component-library252.js +6 -6
- package/lib/sd-component-library254.js +21 -25
- package/lib/sd-component-library254.js.map +1 -1
- package/lib/sd-component-library256.js +22 -24
- package/lib/sd-component-library256.js.map +1 -1
- package/lib/sd-component-library258.js +25 -21
- package/lib/sd-component-library258.js.map +1 -1
- package/lib/sd-component-library259.js +24 -22
- package/lib/sd-component-library259.js.map +1 -1
- package/lib/sd-component-library262.js +1 -1
- package/lib/sd-component-library265.js +30 -122
- package/lib/sd-component-library265.js.map +1 -1
- package/lib/sd-component-library266.js +20 -9
- package/lib/sd-component-library266.js.map +1 -1
- package/lib/sd-component-library267.js +116 -41
- package/lib/sd-component-library267.js.map +1 -1
- package/lib/sd-component-library268.js +122 -30
- package/lib/sd-component-library268.js.map +1 -1
- package/lib/sd-component-library269.js +9 -20
- package/lib/sd-component-library269.js.map +1 -1
- package/lib/sd-component-library270.js +41 -116
- package/lib/sd-component-library270.js.map +1 -1
- package/lib/sd-component-library278.js +3 -2
- package/lib/sd-component-library278.js.map +1 -1
- package/lib/sd-component-library279.js +3 -2
- package/lib/sd-component-library279.js.map +1 -1
- package/lib/sd-component-library280.js +3 -70
- package/lib/sd-component-library280.js.map +1 -1
- package/lib/sd-component-library281.js +2 -102
- package/lib/sd-component-library281.js.map +1 -1
- package/lib/sd-component-library282.js +2 -106
- package/lib/sd-component-library282.js.map +1 -1
- package/lib/sd-component-library283.js +70 -10
- package/lib/sd-component-library283.js.map +1 -1
- package/lib/sd-component-library284.js +102 -2
- package/lib/sd-component-library284.js.map +1 -1
- package/lib/sd-component-library285.js +104 -34
- package/lib/sd-component-library285.js.map +1 -1
- package/lib/sd-component-library286.js +10 -14
- package/lib/sd-component-library286.js.map +1 -1
- package/lib/sd-component-library287.js +2 -2
- package/lib/sd-component-library288.js +36 -8
- package/lib/sd-component-library288.js.map +1 -1
- package/lib/sd-component-library289.js +14 -328
- package/lib/sd-component-library289.js.map +1 -1
- package/lib/sd-component-library290.js +2 -51
- package/lib/sd-component-library290.js.map +1 -1
- package/lib/sd-component-library291.js +8 -2
- package/lib/sd-component-library291.js.map +1 -1
- package/lib/sd-component-library292.js +324 -73
- package/lib/sd-component-library292.js.map +1 -1
- package/lib/sd-component-library293.js +48 -90
- package/lib/sd-component-library293.js.map +1 -1
- package/lib/sd-component-library294.js +2 -53
- package/lib/sd-component-library294.js.map +1 -1
- package/lib/sd-component-library295.js +76 -8
- package/lib/sd-component-library295.js.map +1 -1
- package/lib/sd-component-library296.js +92 -4
- package/lib/sd-component-library296.js.map +1 -1
- package/lib/sd-component-library297.js +48 -48
- package/lib/sd-component-library297.js.map +1 -1
- package/lib/sd-component-library298.js +9 -3
- package/lib/sd-component-library298.js.map +1 -1
- package/lib/sd-component-library299.js +5 -3
- package/lib/sd-component-library299.js.map +1 -1
- package/lib/sd-component-library300.js +53 -3
- package/lib/sd-component-library300.js.map +1 -1
- package/lib/sd-component-library301.js +9 -2
- package/lib/sd-component-library301.js.map +1 -1
- package/lib/sd-component-library302.js +5 -2
- package/lib/sd-component-library302.js.map +1 -1
- package/lib/sd-component-library303.js +3 -8
- package/lib/sd-component-library303.js.map +1 -1
- package/lib/sd-component-library304.js +19 -5
- package/lib/sd-component-library304.js.map +1 -1
- package/lib/sd-component-library305.js +3 -4
- package/lib/sd-component-library305.js.map +1 -1
- package/lib/sd-component-library306.js +2 -19
- package/lib/sd-component-library306.js.map +1 -1
- package/lib/sd-component-library307.js +2 -3
- package/lib/sd-component-library307.js.map +1 -1
- package/lib/sd-component-library309.js +21 -54
- package/lib/sd-component-library309.js.map +1 -1
- package/lib/sd-component-library310.js +50 -25
- package/lib/sd-component-library310.js.map +1 -1
- package/lib/sd-component-library311.js +33 -91
- package/lib/sd-component-library311.js.map +1 -1
- package/lib/sd-component-library312.js +5 -51
- package/lib/sd-component-library312.js.map +1 -1
- package/lib/sd-component-library313.js +91 -33
- package/lib/sd-component-library313.js.map +1 -1
- package/lib/sd-component-library314.js +4 -25
- package/lib/sd-component-library314.js.map +1 -1
- package/lib/sd-component-library315.js +57 -4
- package/lib/sd-component-library315.js.map +1 -1
- package/lib/sd-component-library316.js +26 -4
- package/lib/sd-component-library316.js.map +1 -1
- package/lib/sd-component-library318.js +89 -28
- package/lib/sd-component-library318.js.map +1 -1
- package/lib/sd-component-library319.js +25 -17
- package/lib/sd-component-library319.js.map +1 -1
- package/lib/sd-component-library320.js +20 -89
- package/lib/sd-component-library320.js.map +1 -1
- package/lib/sd-component-library48.js +1 -1
- package/lib/sd-component-library49.js +1 -1
- package/lib/sd-component-library51.js +3 -3
- package/lib/sd-component-library52.js +2 -2
- package/lib/sd-component-library53.js +2 -2
- package/lib/sd-component-library6.js +1 -1
- package/lib/sd-component-library60.js +1 -1
- package/lib/sd-component-library61.js +2 -2
- package/lib/sd-component-library62.js +5 -5
- package/lib/sd-component-library63.js +1 -1
- package/lib/sd-component-library64.js +2 -2
- package/lib/sd-component-library65.js +1 -1
- package/lib/sd-component-library7.js +1 -1
- package/lib/sd-component-library70.js +2 -2
- package/lib/sd-component-library72.js +3 -3
- package/lib/sd-component-library74.js +2 -2
- package/lib/sd-component-library75.js +3 -3
- package/lib/sd-component-library76.js +1 -1
- package/lib/sd-component-library77.js +1 -1
- package/lib/sd-component-library79.js +1 -1
- package/lib/sd-component-library80.js +1 -1
- package/lib/sd-component-library85.js +1 -1
- package/lib/sd-component-library86.js +6 -6
- package/lib/sd-component-library87.js +2 -2
- package/lib/sd-component-library88.js +1 -1
- package/lib/sd-component-library89.js +5 -5
- package/lib/sd-component-library90.js +1 -1
- package/lib/sd-component-library92.js +6 -6
- package/lib/sd-component-library93.js +1 -1
- package/lib/sd-component-library94.js +7 -7
- package/lib/sd-component-library95.js +1 -1
- package/lib/sd-component-library98.js +2 -2
- package/lib/sd-component-library99.js +3 -3
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sd-component-library232.js","sources":["../src/components/meters/
|
|
1
|
+
{"version":3,"file":"sd-component-library232.js","sources":["../src/components/meters/outline-meter/partials/base-meter-label-box/base-meter-label-box.tsx"],"sourcesContent":["import React, { useEffect, useRef, useState } from \"react\";\n\nimport { Box } from \"rebass\";\n\nimport { ResponsiveTextV2 } from \"../../../../texts/responsive-text-v2\";\nimport { labelPaddingX, labelWidth } from \"../../contants\";\nimport { BaseMeterLabelBoxProps as Props } from \"./interfaces\";\n\nexport const BaseMeterLabelBox: React.FC<Props> = (props) => {\n const {\n position,\n diameter,\n label,\n distanceFromLabelToRanges,\n isInRange,\n color,\n } = props;\n const ref = useRef<HTMLElement>();\n const [textHeight, setTextHeight] = useState(0);\n\n useEffect(() => {\n if (ref.current) setTextHeight(ref.current.getBoundingClientRect().height);\n }, [ref]);\n\n const left =\n position === \"right\"\n ? `${diameter + distanceFromLabelToRanges}px`\n : position === \"top\"\n ? `${diameter / 2}px`\n : undefined;\n const right =\n position === \"left\"\n ? `${diameter + distanceFromLabelToRanges}px`\n : undefined;\n const top =\n position === \"left\" || position === \"right\"\n ? `${diameter / 2}px`\n : `${-distanceFromLabelToRanges}px`;\n\n return (\n <Box sx={{ position: \"absolute\", left, top, right }}>\n <Box\n sx={{\n position: \"relative\",\n top: `-${textHeight}px`,\n left: position === \"top\" ? \"-50%\" : undefined,\n py: \"7px\",\n px: isInRange ? `${labelPaddingX}px` : \"0\",\n borderColor: isInRange ? color : \"cl_lightGrey\",\n borderWidth: isInRange ? \"2px\" : \"1pt\",\n borderStyle: isInRange ? \"solid\" : \"none\",\n borderBottomStyle:\n !isInRange && position === \"top\" ? \"none\" : \"solid\",\n borderRadius: isInRange\n ? `${labelPaddingX}px ${labelPaddingX}px ${\n position !== \"left\" ? `${labelPaddingX}px` : \"0\"\n } ${position !== \"right\" ? `${labelPaddingX}px` : \"0\"}`\n : \"0\",\n bg: \"cl_white\",\n \"& > div\": {\n maxWidth: position === \"top\" ? undefined : `${labelWidth}px`,\n },\n }}\n ref={ref}\n >\n <ResponsiveTextV2\n width=\"max-content\"\n fontSizeWeight={[[12, \"semi-bold\"]]}\n color={isInRange && color !== \"#CCD0DB\" ? color : \"cl_darkGrey\"}\n textTransform=\"uppercase\"\n letterSpacing=\"1.8px\"\n >\n {label}\n </ResponsiveTextV2>\n </Box>\n </Box>\n );\n};\n"],"names":["BaseMeterLabelBox","props","position","diameter","label","distanceFromLabelToRanges","isInRange","color","ref","useRef","textHeight","setTextHeight","useState","useEffect","left","right","top","jsx","Box","labelPaddingX","labelWidth","ResponsiveTextV2"],"mappings":";;;;;AAQa,MAAAA,IAAqC,CAACC,MAAU;AACrD,QAAA;AAAA,IACJ,UAAAC;AAAA,IACA,UAAAC;AAAA,IACA,OAAAC;AAAA,IACA,2BAAAC;AAAA,IACA,WAAAC;AAAA,IACA,OAAAC;AAAA,EACE,IAAAN,GACEO,IAAMC,KACN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gB,CAAC,CAAC,IAAI,WAAW,CAAC;AAAA,UAClC,OAAOf,KAAaC,MAAU,YAAYA,IAAQ;AAAA,UAClD,eAAc;AAAA,UACd,eAAc;AAAA,UAEb,UAAAH;AAAA,QAAA;AAAA,MACH;AAAA,IAAA;AAAA,EAEJ,EAAA,CAAA;AAEJ;"}
|
|
@@ -1,132 +1,51 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
distanceFromRanges: b,
|
|
24
|
-
label: w,
|
|
25
|
-
labelPosition: V,
|
|
26
|
-
hideLabels: E,
|
|
27
|
-
connected: _
|
|
28
|
-
} = D, S = "#CCD0DB", A = v - (y - 1) * l, H = A * (r - n), Y = Z(g, n, r, R), q = (360 - v) / 2, t = o / 2, a = q + l * m + A * n, C = _ && F(g, r, R), i = a + A * (r - n) + (C ? l : 0), { x: P, y: j } = d(
|
|
29
|
-
t,
|
|
30
|
-
a
|
|
31
|
-
), { x: W, y: k } = d(
|
|
32
|
-
t,
|
|
33
|
-
i
|
|
34
|
-
), u = V || m === 0 ? "left" : m === y - 1 ? "right" : "top";
|
|
35
|
-
if (f || !Y) {
|
|
36
|
-
const J = f && Y || !f && F(g, r, R) ? x : S, B = C ? i - l : i, { y: K } = d(
|
|
37
|
-
t,
|
|
38
|
-
B
|
|
39
|
-
), { x: N, y: Q } = d(
|
|
40
|
-
t,
|
|
41
|
-
(a + B) / 2
|
|
42
|
-
);
|
|
43
|
-
return /* @__PURE__ */ e.jsxs("g", { children: [
|
|
44
|
-
/* @__PURE__ */ e.jsx(
|
|
45
|
-
X,
|
|
46
|
-
{
|
|
47
|
-
startX: P,
|
|
48
|
-
startY: j,
|
|
49
|
-
endX: W,
|
|
50
|
-
endY: k,
|
|
51
|
-
startAlpha: a,
|
|
52
|
-
endAlpha: i,
|
|
53
|
-
color: J,
|
|
54
|
-
radius: t,
|
|
55
|
-
width: s
|
|
56
|
-
}
|
|
57
|
-
),
|
|
58
|
-
!E && w && /* @__PURE__ */ e.jsx(
|
|
59
|
-
O,
|
|
60
|
-
{
|
|
61
|
-
diameter: o,
|
|
62
|
-
position: u,
|
|
63
|
-
distanceFromRanges: b,
|
|
64
|
-
isInRange: Y,
|
|
65
|
-
...u === "right" && j > o / 2 || u === "left" && K > o / 2 ? {
|
|
66
|
-
rangeX: N,
|
|
67
|
-
rangeY: Q
|
|
68
|
-
} : void 0
|
|
69
|
-
}
|
|
70
|
-
)
|
|
71
|
-
] });
|
|
72
|
-
}
|
|
73
|
-
const c = a + (g - n) / (r - n) * H, { x: h, y: p } = d(t, c), z = $(h, L(c), s), G = tt(p, L(c), s);
|
|
74
|
-
return /* @__PURE__ */ e.jsxs("g", { children: [
|
|
75
|
-
/* @__PURE__ */ e.jsx(
|
|
76
|
-
X,
|
|
77
|
-
{
|
|
78
|
-
startX: P,
|
|
79
|
-
startY: j,
|
|
80
|
-
endX: h,
|
|
81
|
-
endY: p,
|
|
82
|
-
startAlpha: a,
|
|
83
|
-
endAlpha: c,
|
|
84
|
-
color: x,
|
|
85
|
-
radius: t,
|
|
86
|
-
width: s,
|
|
87
|
-
roundEnd: !1
|
|
88
|
-
}
|
|
89
|
-
),
|
|
90
|
-
/* @__PURE__ */ e.jsx(
|
|
91
|
-
X,
|
|
92
|
-
{
|
|
93
|
-
startX: h,
|
|
94
|
-
startY: p,
|
|
95
|
-
endX: W,
|
|
96
|
-
endY: k,
|
|
97
|
-
startAlpha: c,
|
|
98
|
-
endAlpha: i,
|
|
99
|
-
color: S,
|
|
100
|
-
radius: t,
|
|
101
|
-
width: s,
|
|
102
|
-
roundStart: !1
|
|
103
|
-
}
|
|
104
|
-
),
|
|
105
|
-
/* @__PURE__ */ e.jsx(
|
|
106
|
-
"circle",
|
|
107
|
-
{
|
|
108
|
-
cx: (h + z) / 2,
|
|
109
|
-
cy: (p + G) / 2,
|
|
110
|
-
r: I + T,
|
|
111
|
-
strokeWidth: I,
|
|
112
|
-
stroke: x,
|
|
113
|
-
fill: "white",
|
|
114
|
-
ref: M
|
|
115
|
-
}
|
|
116
|
-
),
|
|
117
|
-
!E && w && /* @__PURE__ */ e.jsx(
|
|
118
|
-
O,
|
|
119
|
-
{
|
|
120
|
-
diameter: o,
|
|
121
|
-
isInRange: !0,
|
|
122
|
-
position: u,
|
|
123
|
-
distanceFromRanges: b
|
|
124
|
-
}
|
|
125
|
-
)
|
|
126
|
-
] });
|
|
1
|
+
import { getCoordinateForArc as s } from "./sd-component-library91.js";
|
|
2
|
+
const v = (r) => {
|
|
3
|
+
const a = `Received ${r.map(
|
|
4
|
+
({ start: e, end: t }) => `(${e},${t})`
|
|
5
|
+
)}`, n = (e) => console.error(e, a);
|
|
6
|
+
if (r.some(
|
|
7
|
+
({ start: e, end: t }) => [e, t].some((o) => o < 0 || o > 1)
|
|
8
|
+
))
|
|
9
|
+
return n("Segment values should be between 0 and 1"), !1;
|
|
10
|
+
if (r.reduce(
|
|
11
|
+
(e, { start: t }) => e + (t === 0 ? 1 : 0),
|
|
12
|
+
0
|
|
13
|
+
) !== 1)
|
|
14
|
+
return n("One segment should start from 0"), !1;
|
|
15
|
+
if (r.reduce((e, { end: t }) => e + (t === 1 ? 1 : 0), 0) !== 1)
|
|
16
|
+
return n("One segment should end by 1"), !1;
|
|
17
|
+
if (r.some(({ start: e, end: t }) => e >= t))
|
|
18
|
+
return n("Segment start should be smaller than end"), !1;
|
|
19
|
+
for (let e = 1; e < r.length; e++) {
|
|
20
|
+
const t = r[e];
|
|
21
|
+
if (r[e - 1].end !== t.start)
|
|
22
|
+
return n("Previous segment end should be equal to next segment start"), !1;
|
|
127
23
|
}
|
|
128
|
-
|
|
24
|
+
return !0;
|
|
25
|
+
}, x = ({ start: r, end: a }, n, e) => {
|
|
26
|
+
const t = n - e, o = Math.round(r * 360), c = Math.round(a * 360), d = c - o, { x: l, y: u } = s(n, o), { x: f, y: m } = s(
|
|
27
|
+
t,
|
|
28
|
+
o,
|
|
29
|
+
n
|
|
30
|
+
), { x: h, y: i } = s(n, c), { x: g, y: S } = s(
|
|
31
|
+
t,
|
|
32
|
+
c,
|
|
33
|
+
n
|
|
34
|
+
);
|
|
35
|
+
return {
|
|
36
|
+
startX: l,
|
|
37
|
+
startY: u,
|
|
38
|
+
endX: h,
|
|
39
|
+
endY: i,
|
|
40
|
+
startInnerX: f,
|
|
41
|
+
startInnerY: m,
|
|
42
|
+
endInnerX: g,
|
|
43
|
+
endInnerY: S,
|
|
44
|
+
arc: d
|
|
45
|
+
};
|
|
46
|
+
};
|
|
129
47
|
export {
|
|
130
|
-
|
|
48
|
+
v as areSegmentsValid,
|
|
49
|
+
x as getSegmentCoordinates
|
|
131
50
|
};
|
|
132
51
|
//# sourceMappingURL=sd-component-library233.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sd-component-library233.js","sources":["../src/components/meters/
|
|
1
|
+
{"version":3,"file":"sd-component-library233.js","sources":["../src/components/meters/donut-diagram/utils.ts"],"sourcesContent":["import { getCoordinateForArc } from \"../outline-meter/utils\";\nimport { DonutSegment } from \"./interfaces\";\n\nexport const areSegmentsValid = (\n segments: Pick<DonutSegment, \"start\" | \"end\">[]\n): boolean => {\n const receivedSegments = `Received ${segments.map(\n ({ start, end }) => `(${start},${end})`\n )}`;\n const showError = (text: string) => console.error(text, receivedSegments);\n\n if (\n segments.some(({ start, end }) =>\n [start, end].some((point) => point < 0 || point > 1)\n )\n ) {\n showError(\"Segment values should be between 0 and 1\");\n return false;\n }\n\n if (\n segments.reduce<number>(\n (acc, { start }) => acc + (start === 0 ? 1 : 0),\n 0\n ) !== 1\n ) {\n showError(\"One segment should start from 0\");\n return false;\n }\n\n if (\n segments.reduce<number>((acc, { end }) => acc + (end === 1 ? 1 : 0), 0) !==\n 1\n ) {\n showError(\"One segment should end by 1\");\n return false;\n }\n\n if (segments.some(({ start, end }) => start >= end)) {\n showError(\"Segment start should be smaller than end\");\n return false;\n }\n\n for (let i = 1; i < segments.length; i++) {\n const currentSegment = segments[i];\n const prevSegment = segments[i - 1];\n if (prevSegment.end !== currentSegment.start) {\n showError(\"Previous segment end should be equal to next segment start\");\n return false;\n }\n }\n\n return true;\n};\n\nexport const getSegmentCoordinates = (\n { start, end }: Pick<DonutSegment, \"start\" | \"end\">,\n radius: number,\n segmentWidth: number\n) => {\n const innerRadius = radius - segmentWidth;\n\n const startAlpha = Math.round(start * 360);\n const endAlpha = Math.round(end * 360);\n const arc = endAlpha - startAlpha;\n\n const { x: startX, y: startY } = getCoordinateForArc(radius, startAlpha);\n const { x: startInnerX, y: startInnerY } = getCoordinateForArc(\n innerRadius,\n startAlpha,\n radius\n );\n\n const { x: endX, y: endY } = getCoordinateForArc(radius, endAlpha);\n const { x: endInnerX, y: endInnerY } = getCoordinateForArc(\n innerRadius,\n endAlpha,\n radius\n );\n return {\n startX,\n startY,\n endX,\n endY,\n startInnerX,\n startInnerY,\n endInnerX,\n endInnerY,\n arc,\n };\n};\n"],"names":["areSegmentsValid","segments","receivedSegments","start","end","showError","text","point","acc","i","currentSegment","getSegmentCoordinates","radius","segmentWidth","innerRadius","startAlpha","endAlpha","arc","startX","startY","getCoordinateForArc","startInnerX","startInnerY","endX","endY","endInnerX","endInnerY"],"mappings":";AAGa,MAAAA,IAAmB,CAC9BC,MACY;AACN,QAAAC,IAAmB,YAAYD,EAAS;AAAA,IAC5C,CAAC,EAAE,OAAAE,GAAO,KAAAC,QAAU,IAAID,CAAK,IAAIC,CAAG;AAAA,EACrC,CAAA,IACKC,IAAY,CAACC,MAAiB,QAAQ,MAAMA,GAAMJ,CAAgB;AAExE,MACED,EAAS;AAAA,IAAK,CAAC,EAAE,OAAAE,GAAO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,IACAE;AAAA,IACAJ;AAAA,EAAA;AAEK,SAAA;AAAA,IACL,QAAAM;AAAA,IACA,QAAAC;AAAA,IACA,MAAAI;AAAA,IACA,MAAAC;AAAA,IACA,aAAAH;AAAA,IACA,aAAAC;AAAA,IACA,WAAAG;AAAA,IACA,WAAAC;AAAA,IACA,KAAAT;AAAA,EAAA;AAEJ;"}
|
|
@@ -1,46 +1,78 @@
|
|
|
1
|
-
import { j as
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
1
|
+
import { j as n } from "./sd-component-library197.js";
|
|
2
|
+
import { useHover as Z } from "./sd-component-library3.js";
|
|
3
|
+
import { getCoordinateForArc as l } from "./sd-component-library91.js";
|
|
4
|
+
import { getSegmentCoordinates as O } from "./sd-component-library233.js";
|
|
5
|
+
import { SegmentLabel as q } from "./sd-component-library318.js";
|
|
6
|
+
const h = 300, G = ({
|
|
7
|
+
segment: o,
|
|
8
|
+
segmentWidth: $,
|
|
9
|
+
outlineWidth: f,
|
|
10
|
+
size: i,
|
|
11
|
+
mobile: a,
|
|
12
|
+
...c
|
|
13
|
+
}) => {
|
|
14
|
+
const { start: p, end: x, color: u } = o, { labelOffset: j } = c, t = i / 2, d = t - $, {
|
|
15
|
+
startInnerX: k,
|
|
16
|
+
startInnerY: A,
|
|
17
|
+
endInnerX: M,
|
|
18
|
+
endInnerY: X,
|
|
19
|
+
endX: Y,
|
|
20
|
+
endY: v,
|
|
21
|
+
startY: S,
|
|
22
|
+
startX: g,
|
|
23
|
+
arc: e
|
|
24
|
+
} = O(o, t, $), r = i / 2, H = Math.round(p * 360), I = Math.round(x * 360), { isHover: L, hoverCallbacks: w } = Z(), m = L && !a, s = Math.sqrt(2) * (t + j), { x: y, y: C } = l(
|
|
25
|
+
s,
|
|
26
|
+
H,
|
|
27
|
+
t
|
|
28
|
+
), { x: E, y: R } = l(
|
|
29
|
+
s,
|
|
30
|
+
I,
|
|
31
|
+
t
|
|
32
|
+
);
|
|
33
|
+
return /* @__PURE__ */ n.jsxs("g", { ...a ? {} : w, children: [
|
|
34
|
+
/* @__PURE__ */ n.jsx(
|
|
33
35
|
"path",
|
|
34
36
|
{
|
|
35
|
-
d: `M${
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
37
|
+
d: `M${r},${r} L${y},${C} A${s},${s} 0 ${e > 180 ? "1" : "0"},1 ${E},${R}Z`,
|
|
38
|
+
fill: "transparent"
|
|
39
|
+
}
|
|
40
|
+
),
|
|
41
|
+
/* @__PURE__ */ n.jsx(
|
|
42
|
+
"path",
|
|
43
|
+
{
|
|
44
|
+
d: `M${r},${r} L${g},${S} A${t},${t} 0 ${e > 180 ? "1" : "0"},1 ${Y},${v}Z`,
|
|
45
|
+
fill: u,
|
|
46
|
+
strokeWidth: f,
|
|
47
|
+
stroke: "white"
|
|
48
|
+
}
|
|
49
|
+
),
|
|
50
|
+
/* @__PURE__ */ n.jsx(
|
|
51
|
+
"path",
|
|
52
|
+
{
|
|
53
|
+
d: `M${r},${r} L${k},${A} A${d},${d} 0 ${e > 180 ? "1" : "0"},1 ${M},${X}Z`,
|
|
54
|
+
fill: "white",
|
|
55
|
+
style: {
|
|
56
|
+
transform: `scale(${m ? 0.8 : 1}`,
|
|
57
|
+
transformOrigin: "center",
|
|
58
|
+
transition: `all ${h}ms`
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
),
|
|
62
|
+
/* @__PURE__ */ n.jsx(
|
|
63
|
+
q,
|
|
64
|
+
{
|
|
65
|
+
segment: o,
|
|
66
|
+
radius: t,
|
|
67
|
+
animationDuration: h,
|
|
68
|
+
isHover: m,
|
|
69
|
+
mobile: a,
|
|
70
|
+
...c
|
|
71
|
+
}
|
|
72
|
+
)
|
|
73
|
+
] });
|
|
42
74
|
};
|
|
43
75
|
export {
|
|
44
|
-
|
|
76
|
+
G as Segment
|
|
45
77
|
};
|
|
46
78
|
//# sourceMappingURL=sd-component-library234.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sd-component-library234.js","sources":["../src/components/meters/
|
|
1
|
+
{"version":3,"file":"sd-component-library234.js","sources":["../src/components/meters/donut-diagram/partials/segment/segment.tsx"],"sourcesContent":["import React from \"react\";\n\nimport { useHover } from \"../../../../../core/custom-hooks\";\nimport { getCoordinateForArc } from \"../../../outline-meter/utils\";\nimport { getSegmentCoordinates } from \"../../utils\";\nimport { SegmentLabel } from \"../segment-label\";\nimport { SegmentProps as Props } from \"./interfaces\";\n\nconst animationDuration = 300;\n\nexport const Segment: React.FC<Props> = ({\n segment,\n segmentWidth,\n outlineWidth,\n size: diameter,\n mobile,\n ...labelProps\n}) => {\n const { start, end, color } = segment;\n const { labelOffset } = labelProps;\n\n const radius = diameter / 2;\n const innerRadius = radius - segmentWidth;\n\n const {\n startInnerX,\n startInnerY,\n endInnerX,\n endInnerY,\n endX,\n endY,\n startY,\n startX,\n arc,\n } = getSegmentCoordinates(segment, radius, segmentWidth);\n\n const center = diameter / 2;\n\n const startAlpha = Math.round(start * 360);\n const endAlpha = Math.round(end * 360);\n\n const { isHover, hoverCallbacks } = useHover();\n const showHover = isHover && !mobile;\n\n const maxRadius = Math.sqrt(2) * (radius + labelOffset);\n\n const { x: maskStartX, y: maskStartY } = getCoordinateForArc(\n maxRadius,\n startAlpha,\n radius\n );\n\n const { x: maskEndX, y: maskEndY } = getCoordinateForArc(\n maxRadius,\n endAlpha,\n radius\n );\n\n return (\n <g {...(mobile ? {} : hoverCallbacks)}>\n {/* mask */}\n <path\n d={`M${center},${center} L${maskStartX},${maskStartY} A${maxRadius},${maxRadius} 0 ${\n arc > 180 ? \"1\" : \"0\"\n },1 ${maskEndX},${maskEndY}Z`}\n fill=\"transparent\"\n />\n\n {/* colored sector */}\n <path\n d={`M${center},${center} L${startX},${startY} A${radius},${radius} 0 ${\n arc > 180 ? \"1\" : \"0\"\n },1 ${endX},${endY}Z`}\n fill={color}\n strokeWidth={outlineWidth}\n stroke=\"white\"\n />\n\n {/* white inner sector */}\n <path\n d={`M${center},${center} L${startInnerX},${startInnerY} A${innerRadius},${innerRadius} 0 ${\n arc > 180 ? \"1\" : \"0\"\n },1 ${endInnerX},${endInnerY}Z`}\n fill=\"white\"\n style={{\n transform: `scale(${showHover ? 0.8 : 1}`,\n transformOrigin: \"center\",\n transition: `all ${animationDuration}ms`,\n }}\n />\n\n <SegmentLabel\n segment={segment}\n radius={radius}\n animationDuration={animationDuration}\n isHover={showHover}\n mobile={mobile}\n {...labelProps}\n />\n </g>\n );\n};\n"],"names":["animationDuration","Segment","segment","segmentWidth","outlineWidth","diameter","mobile","labelProps","start","end","color","labelOffset","radius","innerRadius","startInnerX","startInnerY","endInnerX","endInnerY","endX","endY","startY","startX","arc","getSegmentCoordinates","center","startAlpha","endAlpha","isHover","hoverCallbacks","useHover","showHover","maxRadius","maskStartX","maskStartY","getCoordinateForArc","maskEndX","maskEndY","jsx","SegmentLabel"],"mappings":";;;;;AAQA,MAAMA,IAAoB,KAEbC,IAA2B,CAAC;AAAA,EACvC,SAAAC;AAAA,EACA,cAAAC;AAAA,EACA,cAAAC;AAAA,EACA,MAAMC;AAAA,EACN,QAAAC;AAAA,EACA,GAAGC;AACL,MAAM;AACJ,QAAM,EAAE,OAAAC,GAAO,KAAAC,GAAK,OAAAC,EAAA,IAAUR,GACxB,EAAE,aAAAS,EAAgB,IAAAJ,GAElBK,IAASP,IAAW,GACpBQ,IA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AA,MAAA;AAAA,IACT;AAAA,IAGAiC,gBAAAA,EAAA;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,GAAG,IAAIb,CAAM,IAAIA,CAAM,KAAKV,CAAW,IAAIC,CAAW,KAAKF,CAAW,IAAIA,CAAW,MACnFS,IAAM,MAAM,MAAM,GACpB,MAAMN,CAAS,IAAIC,CAAS;AAAA,QAC5B,MAAK;AAAA,QACL,OAAO;AAAA,UACL,WAAW,SAASa,IAAY,MAAM,CAAC;AAAA,UACvC,iBAAiB;AAAA,UACjB,YAAY,OAAO9B,CAAiB;AAAA,QACtC;AAAA,MAAA;AAAA,IACF;AAAA,IAEAqC,gBAAAA,EAAA;AAAA,MAACC;AAAA,MAAA;AAAA,QACC,SAAApC;AAAA,QACA,QAAAU;AAAA,QACA,mBAAAZ;AAAA,QACA,SAAS8B;AAAA,QACT,QAAAxB;AAAA,QACC,GAAGC;AAAA,MAAA;AAAA,IACN;AAAA,EACF,EAAA,CAAA;AAEJ;"}
|
|
@@ -1,50 +1,44 @@
|
|
|
1
|
-
import { j as
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
const
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import { j as n } from "./sd-component-library197.js";
|
|
2
|
+
import g from "./sd-component-library196.js";
|
|
3
|
+
import { getSegmentCoordinates as I } from "./sd-component-library233.js";
|
|
4
|
+
const w = ({
|
|
5
|
+
segment: e,
|
|
6
|
+
size: o,
|
|
7
|
+
segmentWidth: s,
|
|
8
|
+
outlineWidth: c,
|
|
9
|
+
isMatching: a
|
|
10
|
+
}) => {
|
|
11
|
+
const { color: d } = e, t = o / 2, $ = t - s, {
|
|
12
|
+
startX: l,
|
|
13
|
+
startY: m,
|
|
8
14
|
arc: i,
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
{
|
|
35
|
-
dx: T,
|
|
36
|
-
dy: W,
|
|
37
|
-
color: C || X,
|
|
38
|
-
radius: u,
|
|
39
|
-
tipX: F,
|
|
40
|
-
tipY: M,
|
|
41
|
-
innerCircleStrokeWidth: A,
|
|
42
|
-
innerCircleRadius: I,
|
|
43
|
-
needleWidth: e
|
|
44
|
-
}
|
|
45
|
-
);
|
|
15
|
+
startInnerY: p,
|
|
16
|
+
startInnerX: h,
|
|
17
|
+
endInnerY: u,
|
|
18
|
+
endInnerX: x,
|
|
19
|
+
endX: f,
|
|
20
|
+
endY: j
|
|
21
|
+
} = I(e, t, s), r = o / 2;
|
|
22
|
+
return /* @__PURE__ */ n.jsxs("g", { children: [
|
|
23
|
+
/* @__PURE__ */ n.jsx(
|
|
24
|
+
"path",
|
|
25
|
+
{
|
|
26
|
+
d: `M${r},${r} L${l},${m} A${t},${t} 0 ${i > 180 ? "1" : "0"},1 ${f},${j}Z`,
|
|
27
|
+
fill: a ? d : g.colors.cl_lightGrey,
|
|
28
|
+
strokeWidth: c,
|
|
29
|
+
stroke: "white"
|
|
30
|
+
}
|
|
31
|
+
),
|
|
32
|
+
/* @__PURE__ */ n.jsx(
|
|
33
|
+
"path",
|
|
34
|
+
{
|
|
35
|
+
d: `M${r},${r} L${h},${p} A${$},${$} 0 ${i > 180 ? "1" : "0"},1 ${x},${u}Z`,
|
|
36
|
+
fill: "white"
|
|
37
|
+
}
|
|
38
|
+
)
|
|
39
|
+
] });
|
|
46
40
|
};
|
|
47
41
|
export {
|
|
48
|
-
|
|
42
|
+
w as CompactDonutGaugeSegment
|
|
49
43
|
};
|
|
50
44
|
//# sourceMappingURL=sd-component-library235.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sd-component-library235.js","sources":["../src/components/meters/
|
|
1
|
+
{"version":3,"file":"sd-component-library235.js","sources":["../src/components/meters/compact-donut-gauge/partials/compact-donut-gauge-segment/compact-donut-gauge-segment.tsx"],"sourcesContent":["import React from \"react\";\n\nimport theme from \"../../../../../core/theme\";\nimport { getSegmentCoordinates } from \"../../../donut-diagram/utils\";\nimport { CompactDonutGaugeSegmentProps as Props } from \"./interfaces\";\n\nexport const CompactDonutGaugeSegment: React.FC<Props> = ({\n segment,\n size: diameter,\n segmentWidth,\n outlineWidth,\n isMatching,\n}) => {\n const { color } = segment;\n\n const radius = diameter / 2;\n const innerRadius = radius - segmentWidth;\n\n const {\n startX,\n startY,\n arc,\n startInnerY,\n startInnerX,\n endInnerY,\n endInnerX,\n endX,\n endY,\n } = getSegmentCoordinates(segment, radius, segmentWidth);\n\n const center = diameter / 2;\n\n return (\n <g>\n {/* colored sector */}\n <path\n d={`M${center},${center} L${startX},${startY} A${radius},${radius} 0 ${\n arc > 180 ? \"1\" : \"0\"\n },1 ${endX},${endY}Z`}\n fill={isMatching ? color : theme.colors[\"cl_lightGrey\"]}\n strokeWidth={outlineWidth}\n stroke=\"white\"\n />\n\n {/* white inner sector */}\n <path\n d={`M${center},${center} L${startInnerX},${startInnerY} A${innerRadius},${innerRadius} 0 ${\n arc > 180 ? \"1\" : \"0\"\n },1 ${endInnerX},${endInnerY}Z`}\n fill=\"white\"\n />\n </g>\n );\n};\n"],"names":["CompactDonutGaugeSegment","segment","diameter","segmentWidth","outlineWidth","isMatching","color","radius","innerRadius","startX","startY","arc","startInnerY","startInnerX","endInnerY","endInnerX","endX","endY","getSegmentCoordinates","center","jsx","theme"],"mappings":";;;AAMO,MAAMA,IAA4C,CAAC;AAAA,EACxD,SAAAC;AAAA,EACA,MAAMC;AAAA,EACN,cAAAC;AAAA,EACA,cAAAC;AAAA,EACA,YAAAC;AACF,MAAM;AACE,QAAA,EAAE,OAAAC,EAAU,IAAAL,GAEZM,IAASL,IAAW,GACpBM,IAAcD,IAASJ,GAEvB;AAAA,IACJ,QAAAM;AAAA,IACA,QAAAC;AAAA,IACA,KAAAC;AAAA,IACA,aAAAC;AAAA,IACA,aAAAC;AAAA,IACA,WAAAC;AAAA,IACA,WAAAC;AAAA,IACA,MAAAC;AAAA,IACA,MAAAC;AAAA,EACE,IAAAC,EAAsBjB,GAASM,GAAQJ,CAAY,GAEjDgB,IAASjB,IAAW;AAE1B,gCACG,KAEC,EAAA,UAAA;AAAA,IAAAkB,gBAAAA,EAAA;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,GAAG,IAAID,CAAM,IAAIA,CAAM,KAAKV,CAAM,IAAIC,CAAM,KAAKH,CAAM,IAAIA,CAAM,MAC/DI,IAAM,MAAM,MAAM,GACpB,MAAMK,CAAI,IAAIC,CAAI;AAAA,QAClB,MAAMZ,IAAaC,IAAQe,EAAM,OAAO;AAAA,QACxC,aAAajB;AAAA,QACb,QAAO;AAAA,MAAA;AAAA,IACT;AAAA,IAGAgB,gBAAAA,EAAA;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,GAAG,IAAID,CAAM,IAAIA,CAAM,KAAKN,CAAW,IAAID,CAAW,KAAKJ,CAAW,IAAIA,CAAW,MACnFG,IAAM,MAAM,MAAM,GACpB,MAAMI,CAAS,IAAID,CAAS;AAAA,QAC5B,MAAK;AAAA,MAAA;AAAA,IACP;AAAA,EACF,EAAA,CAAA;AAEJ;"}
|
|
@@ -1,11 +1,30 @@
|
|
|
1
|
-
import { j as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
const
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
}
|
|
1
|
+
import { j as t } from "./sd-component-library197.js";
|
|
2
|
+
import { FlexCenter as s } from "./sd-component-library34.js";
|
|
3
|
+
import { ResponsiveTextV2 as i } from "./sd-component-library150.js";
|
|
4
|
+
const l = ({
|
|
5
|
+
segment: { start: n, end: r, color: e },
|
|
6
|
+
size: o
|
|
7
|
+
}) => /* @__PURE__ */ t.jsx("foreignObject", { x: 0, y: 0, width: o, height: o, children: /* @__PURE__ */ t.jsx(s, { height: "100%", children: /* @__PURE__ */ t.jsxs(
|
|
8
|
+
i,
|
|
9
|
+
{
|
|
10
|
+
fontSizeWeight: [20, "bold"],
|
|
11
|
+
color: e,
|
|
12
|
+
sx: { position: "relative" },
|
|
13
|
+
children: [
|
|
14
|
+
Math.round((r - n) * 100),
|
|
15
|
+
/* @__PURE__ */ t.jsx(
|
|
16
|
+
i,
|
|
17
|
+
{
|
|
18
|
+
fontSizeWeight: [10, "bold"],
|
|
19
|
+
color: e,
|
|
20
|
+
sx: { position: "absolute", top: "4px", left: "100%" },
|
|
21
|
+
children: "%"
|
|
22
|
+
}
|
|
23
|
+
)
|
|
24
|
+
]
|
|
25
|
+
}
|
|
26
|
+
) }) });
|
|
8
27
|
export {
|
|
9
|
-
|
|
28
|
+
l as CompactDonutGaugeValueIndicator
|
|
10
29
|
};
|
|
11
30
|
//# sourceMappingURL=sd-component-library236.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sd-component-library236.js","sources":["../src/components/meters/
|
|
1
|
+
{"version":3,"file":"sd-component-library236.js","sources":["../src/components/meters/compact-donut-gauge/partials/compact-donut-gauge-value-indicator/compact-donut-gauge-value-indicator.tsx"],"sourcesContent":["import React from \"react\";\n\nimport { Flex } from \"rebass\";\n\nimport { FlexCenter } from \"../../../../containers\";\nimport { ResponsiveTextV2 } from \"../../../../texts\";\nimport { CompactDonutGaugeValueIndicatorProps as Props } from \"./interfaces\";\n\nexport const CompactDonutGaugeValueIndicator: React.FC<Props> = ({\n segment: { start, end, color },\n size,\n}) => {\n return (\n <foreignObject x={0} y={0} width={size} height={size}>\n <FlexCenter height=\"100%\">\n <ResponsiveTextV2\n fontSizeWeight={[20, \"bold\"]}\n color={color}\n sx={{ position: \"relative\" }}\n >\n {Math.round((end - start) * 100)}\n\n <ResponsiveTextV2\n fontSizeWeight={[10, \"bold\"]}\n color={color}\n sx={{ position: \"absolute\", top: \"4px\", left: \"100%\" }}\n >\n %\n </ResponsiveTextV2>\n </ResponsiveTextV2>\n </FlexCenter>\n </foreignObject>\n );\n};\n"],"names":["CompactDonutGaugeValueIndicator","start","end","color","size","jsx","FlexCenter","jsxs","ResponsiveTextV2"],"mappings":";;;AAQO,MAAMA,IAAmD,CAAC;AAAA,EAC/D,SAAS,EAAE,OAAAC,GAAO,KAAAC,GAAK,OAAAC,EAAM;AAAA,EAC7B,MAAAC;AACF,MAEKC,gBAAAA,EAAAA,IAAA,iBAAA,EAAc,GAAG,GAAG,GAAG,GAAG,OAAOD,GAAM,QAAQA,GAC9C,UAACC,gBAAAA,MAAAC,GAAA,EAAW,QAAO,QACjB,UAAAC,gBAAAA,EAAA;AAAA,EAACC;AAAA,EAAA;AAAA,IACC,gBAAgB,CAAC,IAAI,MAAM;AAAA,IAC3B,OAAAL;AAAA,IACA,IAAI,EAAE,UAAU,WAAW;AAAA,IAE1B,UAAA;AAAA,MAAK,KAAA,OAAOD,IAAMD,KAAS,GAAG;AAAA,MAE/BI,gBAAAA,EAAA;AAAA,QAACG;AAAA,QAAA;AAAA,UACC,gBAAgB,CAAC,IAAI,MAAM;AAAA,UAC3B,OAAAL;AAAA,UACA,IAAI,EAAE,UAAU,YAAY,KAAK,OAAO,MAAM,OAAO;AAAA,UACtD,UAAA;AAAA,QAAA;AAAA,MAED;AAAA,IAAA;AAAA,EAAA;AAAA,EAEJ,CAAA,EACF,CAAA;"}
|