@selfdecode/sd-component-library 4.0.139 → 4.0.141
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/core/functions.d.ts +1 -1
- package/lib/sd-component-library100.js +2 -2
- package/lib/sd-component-library101.js +3 -3
- package/lib/sd-component-library102.js +2 -2
- package/lib/sd-component-library104.js +4 -4
- package/lib/sd-component-library106.js +4 -4
- package/lib/sd-component-library111.js +1 -1
- 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-library130.js +15 -14
- package/lib/sd-component-library130.js.map +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-library168.js +1 -1
- package/lib/sd-component-library171.js +1 -1
- package/lib/sd-component-library172.js +4 -4
- package/lib/sd-component-library197.js +3 -3
- package/lib/sd-component-library200.js +60 -2
- package/lib/sd-component-library200.js.map +1 -1
- package/lib/sd-component-library201.js +2 -30
- package/lib/sd-component-library201.js.map +1 -1
- package/lib/sd-component-library202.js +21 -590
- package/lib/sd-component-library202.js.map +1 -1
- package/lib/sd-component-library203.js +599 -3
- package/lib/sd-component-library203.js.map +1 -1
- package/lib/sd-component-library205.js +18 -60
- package/lib/sd-component-library205.js.map +1 -1
- package/lib/sd-component-library206.js +63 -17
- package/lib/sd-component-library206.js.map +1 -1
- package/lib/sd-component-library207.js +22 -20
- package/lib/sd-component-library207.js.map +1 -1
- package/lib/sd-component-library208.js +21 -3
- package/lib/sd-component-library208.js.map +1 -1
- package/lib/sd-component-library209.js +1 -1
- package/lib/sd-component-library209.js.map +1 -1
- package/lib/sd-component-library210.js +3 -64
- package/lib/sd-component-library210.js.map +1 -1
- package/lib/sd-component-library211.js +37 -20
- package/lib/sd-component-library211.js.map +1 -1
- package/lib/sd-component-library212.js +127 -38
- package/lib/sd-component-library212.js.map +1 -1
- package/lib/sd-component-library213.js +13 -129
- package/lib/sd-component-library213.js.map +1 -1
- package/lib/sd-component-library214.js +14 -13
- package/lib/sd-component-library214.js.map +1 -1
- package/lib/sd-component-library215.js +2 -2
- package/lib/sd-component-library215.js.map +1 -1
- package/lib/sd-component-library216.js +3 -52
- package/lib/sd-component-library216.js.map +1 -1
- package/lib/sd-component-library217.js +3 -65
- package/lib/sd-component-library217.js.map +1 -1
- package/lib/sd-component-library218.js +52 -3
- package/lib/sd-component-library218.js.map +1 -1
- package/lib/sd-component-library219.js +64 -45
- package/lib/sd-component-library219.js.map +1 -1
- package/lib/sd-component-library220.js +3 -14
- package/lib/sd-component-library220.js.map +1 -1
- package/lib/sd-component-library221.js +46 -3
- package/lib/sd-component-library221.js.map +1 -1
- package/lib/sd-component-library222.js +17 -3
- package/lib/sd-component-library222.js.map +1 -1
- package/lib/sd-component-library223.js +26 -17
- package/lib/sd-component-library223.js.map +1 -1
- package/lib/sd-component-library224.js +55 -24
- package/lib/sd-component-library224.js.map +1 -1
- package/lib/sd-component-library225.js +3 -3
- package/lib/sd-component-library225.js.map +1 -1
- package/lib/sd-component-library226.js +3 -31
- package/lib/sd-component-library226.js.map +1 -1
- package/lib/sd-component-library227.js +3 -19
- package/lib/sd-component-library227.js.map +1 -1
- package/lib/sd-component-library228.js +31 -20
- package/lib/sd-component-library228.js.map +1 -1
- package/lib/sd-component-library229.js +19 -28
- package/lib/sd-component-library229.js.map +1 -1
- package/lib/sd-component-library230.js +19 -32
- package/lib/sd-component-library230.js.map +1 -1
- package/lib/sd-component-library231.js +28 -3
- package/lib/sd-component-library231.js.map +1 -1
- package/lib/sd-component-library232.js +32 -128
- package/lib/sd-component-library232.js.map +1 -1
- package/lib/sd-component-library233.js +129 -43
- package/lib/sd-component-library233.js.map +1 -1
- package/lib/sd-component-library234.js +41 -45
- package/lib/sd-component-library234.js.map +1 -1
- package/lib/sd-component-library235.js +46 -7
- package/lib/sd-component-library235.js.map +1 -1
- package/lib/sd-component-library236.js +8 -21
- package/lib/sd-component-library236.js.map +1 -1
- package/lib/sd-component-library237.js +58 -103
- package/lib/sd-component-library237.js.map +1 -1
- package/lib/sd-component-library238.js +37 -41
- package/lib/sd-component-library238.js.map +1 -1
- package/lib/sd-component-library239.js +12 -23
- package/lib/sd-component-library239.js.map +1 -1
- package/lib/sd-component-library240.js +21 -53
- package/lib/sd-component-library240.js.map +1 -1
- package/lib/sd-component-library241.js +103 -58
- package/lib/sd-component-library241.js.map +1 -1
- package/lib/sd-component-library242.js +41 -37
- package/lib/sd-component-library242.js.map +1 -1
- package/lib/sd-component-library243.js +23 -12
- package/lib/sd-component-library243.js.map +1 -1
- package/lib/sd-component-library244.js +52 -47
- package/lib/sd-component-library244.js.map +1 -1
- package/lib/sd-component-library245.js +46 -73
- package/lib/sd-component-library245.js.map +1 -1
- package/lib/sd-component-library246.js +1 -1
- package/lib/sd-component-library248.js +72 -18
- package/lib/sd-component-library248.js.map +1 -1
- package/lib/sd-component-library249.js +20 -19
- package/lib/sd-component-library249.js.map +1 -1
- package/lib/sd-component-library250.js +20 -2
- package/lib/sd-component-library250.js.map +1 -1
- package/lib/sd-component-library251.js +2 -57
- package/lib/sd-component-library251.js.map +1 -1
- package/lib/sd-component-library252.js +323 -23
- package/lib/sd-component-library252.js.map +1 -1
- package/lib/sd-component-library253.js +5 -3
- package/lib/sd-component-library253.js.map +1 -1
- package/lib/sd-component-library254.js +29 -22
- package/lib/sd-component-library254.js.map +1 -1
- package/lib/sd-component-library255.js +1 -1
- package/lib/sd-component-library255.js.map +1 -1
- package/lib/sd-component-library256.js +22 -323
- package/lib/sd-component-library256.js.map +1 -1
- package/lib/sd-component-library257.js +3 -5
- package/lib/sd-component-library257.js.map +1 -1
- package/lib/sd-component-library258.js +21 -25
- package/lib/sd-component-library258.js.map +1 -1
- package/lib/sd-component-library259.js +22 -24
- package/lib/sd-component-library259.js.map +1 -1
- package/lib/sd-component-library262.js +1 -1
- package/lib/sd-component-library265.js +122 -30
- package/lib/sd-component-library265.js.map +1 -1
- package/lib/sd-component-library266.js +9 -20
- package/lib/sd-component-library266.js.map +1 -1
- package/lib/sd-component-library267.js +41 -116
- package/lib/sd-component-library267.js.map +1 -1
- package/lib/sd-component-library268.js +30 -122
- package/lib/sd-component-library268.js.map +1 -1
- package/lib/sd-component-library269.js +20 -9
- package/lib/sd-component-library269.js.map +1 -1
- package/lib/sd-component-library270.js +116 -41
- package/lib/sd-component-library270.js.map +1 -1
- package/lib/sd-component-library271.js +9 -2
- package/lib/sd-component-library271.js.map +1 -1
- package/lib/sd-component-library272.js +51 -2
- package/lib/sd-component-library272.js.map +1 -1
- package/lib/sd-component-library273.js +89 -8
- package/lib/sd-component-library273.js.map +1 -1
- package/lib/sd-component-library274.js +89 -48
- package/lib/sd-component-library274.js.map +1 -1
- package/lib/sd-component-library275.js +2 -90
- package/lib/sd-component-library275.js.map +1 -1
- package/lib/sd-component-library276.js +2 -92
- package/lib/sd-component-library276.js.map +1 -1
- package/lib/sd-component-library277.js +6 -2
- package/lib/sd-component-library277.js.map +1 -1
- package/lib/sd-component-library278.js +2 -2
- package/lib/sd-component-library279.js +2 -70
- package/lib/sd-component-library279.js.map +1 -1
- package/lib/sd-component-library280.js +69 -101
- package/lib/sd-component-library280.js.map +1 -1
- package/lib/sd-component-library281.js +91 -95
- package/lib/sd-component-library281.js.map +1 -1
- package/lib/sd-component-library282.js +106 -10
- package/lib/sd-component-library282.js.map +1 -1
- package/lib/sd-component-library283.js +10 -6
- package/lib/sd-component-library283.js.map +1 -1
- package/lib/sd-component-library286.js +1 -1
- package/lib/sd-component-library288.js +3 -3
- package/lib/sd-component-library289.js +4 -4
- package/lib/sd-component-library290.js +1 -1
- package/lib/sd-component-library291.js +2 -3
- package/lib/sd-component-library291.js.map +1 -1
- package/lib/sd-component-library292.js +77 -3
- package/lib/sd-component-library292.js.map +1 -1
- package/lib/sd-component-library293.js +93 -3
- package/lib/sd-component-library293.js.map +1 -1
- package/lib/sd-component-library294.js +53 -2
- package/lib/sd-component-library294.js.map +1 -1
- package/lib/sd-component-library295.js +8 -76
- package/lib/sd-component-library295.js.map +1 -1
- package/lib/sd-component-library296.js +4 -92
- 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 +3 -9
- package/lib/sd-component-library298.js.map +1 -1
- package/lib/sd-component-library299.js +3 -5
- package/lib/sd-component-library299.js.map +1 -1
- package/lib/sd-component-library300.js +3 -53
- package/lib/sd-component-library300.js.map +1 -1
- package/lib/sd-component-library311.js +89 -47
- package/lib/sd-component-library311.js.map +1 -1
- package/lib/sd-component-library312.js +50 -34
- package/lib/sd-component-library312.js.map +1 -1
- package/lib/sd-component-library313.js +33 -91
- package/lib/sd-component-library313.js.map +1 -1
- package/lib/sd-component-library318.js +1 -1
- package/lib/sd-component-library4.js +16 -16
- package/lib/sd-component-library4.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 +1 -1
- package/lib/sd-component-library62.js +4 -4
- 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 +1 -1
- package/package.json +1 -1
|
@@ -1,78 +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
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
t
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
t
|
|
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;
|
|
23
|
+
}
|
|
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
|
|
32
34
|
);
|
|
33
|
-
return
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
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
|
-
] });
|
|
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
|
+
};
|
|
74
46
|
};
|
|
75
47
|
export {
|
|
76
|
-
|
|
48
|
+
v as areSegmentsValid,
|
|
49
|
+
x as getSegmentCoordinates
|
|
77
50
|
};
|
|
78
51
|
//# sourceMappingURL=sd-component-library245.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sd-component-library245.js","sources":["../src/components/meters/donut-diagram/
|
|
1
|
+
{"version":3,"file":"sd-component-library245.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,KAAAC,QACtB,CAACD,GAAOC,CAAG,EAAE,KAAK,CAACG,MAAUA,IAAQ,KAAKA,IAAQ,CAAC;AAAA,EAAA;AAGrD,WAAAF,EAAU,0CAA0C,GAC7C;AAG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A,IACA,aAAAC;AAAA,IACA,WAAAG;AAAA,IACA,WAAAC;AAAA,IACA,KAAAT;AAAA,EAAA;AAEJ;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { j as n } from "./sd-component-library197.js";
|
|
2
2
|
import g from "./sd-component-library196.js";
|
|
3
|
-
import { getSegmentCoordinates as I } from "./sd-component-
|
|
3
|
+
import { getSegmentCoordinates as I } from "./sd-component-library245.js";
|
|
4
4
|
const w = ({
|
|
5
5
|
segment: e,
|
|
6
6
|
size: o,
|
|
@@ -1,24 +1,78 @@
|
|
|
1
|
-
import { j as
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
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-library245.js";
|
|
5
|
+
import { SegmentLabel as q } from "./sd-component-library320.js";
|
|
6
|
+
const h = 300, G = ({
|
|
7
|
+
segment: o,
|
|
8
|
+
segmentWidth: $,
|
|
9
|
+
outlineWidth: f,
|
|
10
|
+
size: i,
|
|
11
|
+
mobile: a,
|
|
12
|
+
...c
|
|
8
13
|
}) => {
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
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
|
|
19
32
|
);
|
|
33
|
+
return /* @__PURE__ */ n.jsxs("g", { ...a ? {} : w, children: [
|
|
34
|
+
/* @__PURE__ */ n.jsx(
|
|
35
|
+
"path",
|
|
36
|
+
{
|
|
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
|
+
] });
|
|
20
74
|
};
|
|
21
75
|
export {
|
|
22
|
-
|
|
76
|
+
G as Segment
|
|
23
77
|
};
|
|
24
78
|
//# sourceMappingURL=sd-component-library248.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sd-component-library248.js","sources":["../src/components/meters/
|
|
1
|
+
{"version":3,"file":"sd-component-library248.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,IAAcD,IAAST,GAEvB;AAAA,IACJ,aAAAW;AAAA,IACA,aAAAC;AAAA,IACA,WAAAC;AAAA,IACA,WAAAC;AAAA,IACA,MAAAC;AAAA,IACA,MAAAC;AAAA,IACA,QAAAC;AAAA,IACA,QAAAC;AAAA,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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,23 +1,24 @@
|
|
|
1
|
-
import { j as
|
|
2
|
-
import {
|
|
3
|
-
const
|
|
4
|
-
|
|
1
|
+
import { j as x } from "./sd-component-library197.js";
|
|
2
|
+
import { Box as n } from "rebass";
|
|
3
|
+
const $ = ({
|
|
4
|
+
idx: o,
|
|
5
5
|
color: t,
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
{
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
);
|
|
6
|
+
total: i,
|
|
7
|
+
segmentHeight: r
|
|
8
|
+
}) => {
|
|
9
|
+
const s = `${o === 0 ? r / 2 : 0}px`, a = `${o === i - 1 ? r / 2 : 0}px`;
|
|
10
|
+
return /* @__PURE__ */ x.jsx(
|
|
11
|
+
n,
|
|
12
|
+
{
|
|
13
|
+
bg: t,
|
|
14
|
+
height: r,
|
|
15
|
+
sx: {
|
|
16
|
+
borderRadius: `${s} ${[...Array(2)].fill(a).join(" ")} ${s}`
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
);
|
|
20
|
+
};
|
|
20
21
|
export {
|
|
21
|
-
|
|
22
|
+
$ as LinearGaugeSegment
|
|
22
23
|
};
|
|
23
24
|
//# sourceMappingURL=sd-component-library249.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sd-component-library249.js","sources":["../src/components/meters/linear-gauge-meter-partials/linear-gauge-
|
|
1
|
+
{"version":3,"file":"sd-component-library249.js","sources":["../src/components/meters/linear-gauge-meter-partials/linear-gauge-segment/linear-gauge-segment.tsx"],"sourcesContent":["import React from \"react\";\n\nimport { Box } from \"rebass\";\n\nimport { LinearGaugeSegmentProps as Props } from \"./interfaces\";\n\nexport const LinearGaugeSegment: React.FC<Props> = ({\n idx,\n color,\n total,\n segmentHeight,\n}) => {\n const leftRadius = `${idx === 0 ? segmentHeight / 2 : 0}px`;\n const rightRadius = `${idx === total - 1 ? segmentHeight / 2 : 0}px`;\n\n return (\n <Box\n bg={color}\n height={segmentHeight}\n sx={{\n borderRadius: `${leftRadius} ${[...Array(2)]\n .fill(rightRadius)\n .join(\" \")} ${leftRadius}`,\n }}\n />\n );\n};\n"],"names":["LinearGaugeSegment","idx","color","total","segmentHeight","leftRadius","rightRadius","jsx","Box"],"mappings":";;AAMO,MAAMA,IAAsC,CAAC;AAAA,EAClD,KAAAC;AAAA,EACA,OAAAC;AAAA,EACA,OAAAC;AAAA,EACA,eAAAC;AACF,MAAM;AACJ,QAAMC,IAAa,GAAGJ,MAAQ,IAAIG,IAAgB,IAAI,CAAC,MACjDE,IAAc,GAAGL,MAAQE,IAAQ,IAAIC,IAAgB,IAAI,CAAC;AAG9D,SAAAG,gBAAAA,EAAA;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,IAAIN;AAAA,MACJ,QAAQE;AAAA,MACR,IAAI;AAAA,QACF,cAAc,GAAGC,CAAU,IAAI,CAAC,GAAG,MAAM,CAAC,CAAC,EACxC,KAAKC,CAAW,EAChB,KAAK,GAAG,CAAC,IAAID,CAAU;AAAA,MAC5B;AAAA,IAAA;AAAA,EAAA;AAGN;"}
|
|
@@ -1,5 +1,23 @@
|
|
|
1
|
-
|
|
1
|
+
import { j as o } from "./sd-component-library197.js";
|
|
2
|
+
import { ResponsiveTextV2 as r } from "./sd-component-library150.js";
|
|
3
|
+
const m = ({
|
|
4
|
+
text: e,
|
|
5
|
+
color: t,
|
|
6
|
+
...i
|
|
7
|
+
}) => /* @__PURE__ */ o.jsx(
|
|
8
|
+
r,
|
|
9
|
+
{
|
|
10
|
+
height: "12px",
|
|
11
|
+
fontSizeWeight: [10, "semi-bold"],
|
|
12
|
+
color: t,
|
|
13
|
+
mx: "auto",
|
|
14
|
+
maxWidth: "100%",
|
|
15
|
+
textAlign: "center",
|
|
16
|
+
...i,
|
|
17
|
+
children: e
|
|
18
|
+
}
|
|
19
|
+
);
|
|
2
20
|
export {
|
|
3
|
-
|
|
21
|
+
m as LinearGaugeLabel
|
|
4
22
|
};
|
|
5
23
|
//# sourceMappingURL=sd-component-library250.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sd-component-library250.js","sources":["../src/components/meters/linear-
|
|
1
|
+
{"version":3,"file":"sd-component-library250.js","sources":["../src/components/meters/linear-gauge-meter-partials/linear-gauge-label/linear-gauge-label.tsx"],"sourcesContent":["import React from \"react\";\n\nimport { ResponsiveTextV2 } from \"../../../texts\";\nimport { LinearGaugeLabelProps as Props } from \"./interfaces\";\n\nexport const LinearGaugeLabel: React.FC<Props> = ({\n text,\n color,\n ...restOfProps\n}) => {\n return (\n <ResponsiveTextV2\n height=\"12px\"\n fontSizeWeight={[10, \"semi-bold\"]}\n color={color}\n mx=\"auto\"\n maxWidth=\"100%\"\n textAlign=\"center\"\n {...restOfProps}\n >\n {text}\n </ResponsiveTextV2>\n );\n};\n"],"names":["LinearGaugeLabel","text","color","restOfProps","jsx","ResponsiveTextV2"],"mappings":";;AAKO,MAAMA,IAAoC,CAAC;AAAA,EAChD,MAAAC;AAAA,EACA,OAAAC;AAAA,EACA,GAAGC;AACL,MAEIC,gBAAAA,EAAA;AAAA,EAACC;AAAA,EAAA;AAAA,IACC,QAAO;AAAA,IACP,gBAAgB,CAAC,IAAI,WAAW;AAAA,IAChC,OAAAH;AAAA,IACA,IAAG;AAAA,IACH,UAAS;AAAA,IACT,WAAU;AAAA,IACT,GAAGC;AAAA,IAEH,UAAAF;AAAA,EAAA;AAAA;"}
|
|
@@ -1,60 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
import { Crumb as c } from "./sd-component-library17.js";
|
|
3
|
-
const l = (s, h, p) => s.map(({ title: e, dontTranslate: r, onClick: u }, o) => /* @__PURE__ */ t.jsx(
|
|
4
|
-
c,
|
|
5
|
-
{
|
|
6
|
-
variant: h,
|
|
7
|
-
crumb: { title: e, dontTranslate: r },
|
|
8
|
-
isLast: o === s.length - 1,
|
|
9
|
-
textTransform: p,
|
|
10
|
-
onClick: u
|
|
11
|
-
},
|
|
12
|
-
e + o
|
|
13
|
-
)), a = (s, h, p) => {
|
|
14
|
-
const e = [];
|
|
15
|
-
return s.slice(0, 2).forEach(({ title: r, dontTranslate: u, onClick: o }, m) => {
|
|
16
|
-
e.push(
|
|
17
|
-
/* @__PURE__ */ t.jsx(
|
|
18
|
-
c,
|
|
19
|
-
{
|
|
20
|
-
variant: h,
|
|
21
|
-
crumb: { title: r, dontTranslate: u },
|
|
22
|
-
isLast: !1,
|
|
23
|
-
textTransform: p,
|
|
24
|
-
onClick: o
|
|
25
|
-
},
|
|
26
|
-
r + m
|
|
27
|
-
)
|
|
28
|
-
);
|
|
29
|
-
}), e.push(
|
|
30
|
-
/* @__PURE__ */ t.jsx(
|
|
31
|
-
c,
|
|
32
|
-
{
|
|
33
|
-
variant: h,
|
|
34
|
-
crumb: { title: "..." },
|
|
35
|
-
isLast: !1,
|
|
36
|
-
textTransform: p
|
|
37
|
-
},
|
|
38
|
-
"..."
|
|
39
|
-
)
|
|
40
|
-
), s.slice(s.length - 2, s.length).forEach(({ title: r, onClick: u, dontTranslate: o }, m) => {
|
|
41
|
-
e.push(
|
|
42
|
-
/* @__PURE__ */ t.jsx(
|
|
43
|
-
c,
|
|
44
|
-
{
|
|
45
|
-
variant: h,
|
|
46
|
-
crumb: { title: r, dontTranslate: o },
|
|
47
|
-
isLast: m === 1,
|
|
48
|
-
textTransform: p,
|
|
49
|
-
onClick: u
|
|
50
|
-
},
|
|
51
|
-
r + m
|
|
52
|
-
)
|
|
53
|
-
);
|
|
54
|
-
}), e;
|
|
55
|
-
};
|
|
1
|
+
const i = ({ start: g, end: t }, c) => c >= g && (t === 1 ? c <= t : c < t);
|
|
56
2
|
export {
|
|
57
|
-
|
|
58
|
-
l as renderUpToFiveCrumbs
|
|
3
|
+
i as isMatchingRange
|
|
59
4
|
};
|
|
60
5
|
//# sourceMappingURL=sd-component-library251.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sd-component-library251.js","sources":["../src/components/
|
|
1
|
+
{"version":3,"file":"sd-component-library251.js","sources":["../src/components/meters/linear-numeric-gauge-meter/utils.ts"],"sourcesContent":["import { LinearNumericGaugeMeterSegment } from \"./interfaces\";\n\nexport const isMatchingRange = (\n { start, end }: Pick<LinearNumericGaugeMeterSegment, \"start\" | \"end\">,\n value: number\n) => value >= start && (end === 1 ? value <= end : value < end);\n"],"names":["isMatchingRange","start","end","value"],"mappings":"AAEO,MAAMA,IAAkB,CAC7B,EAAE,OAAAC,GAAO,KAAAC,EAAI,GACbC,MACGA,KAASF,MAAUC,MAAQ,IAAIC,KAASD,IAAMC,IAAQD;"}
|