@selfdecode/sd-component-library 4.0.144 → 4.0.146
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/components/links/link/interfaces.d.ts +1 -1
- package/lib/sd-component-library101.js +1 -1
- package/lib/sd-component-library102.js +2 -2
- 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-library167.js +1 -1
- package/lib/sd-component-library172.js +1 -1
- package/lib/sd-component-library197.js +3 -3
- package/lib/sd-component-library201.js +2 -3
- package/lib/sd-component-library201.js.map +1 -1
- package/lib/sd-component-library202.js +30 -2
- package/lib/sd-component-library202.js.map +1 -1
- package/lib/sd-component-library203.js +590 -21
- package/lib/sd-component-library203.js.map +1 -1
- package/lib/sd-component-library204.js +3 -599
- package/lib/sd-component-library204.js.map +1 -1
- package/lib/sd-component-library208.js +19 -62
- package/lib/sd-component-library208.js.map +1 -1
- package/lib/sd-component-library209.js +3 -23
- package/lib/sd-component-library209.js.map +1 -1
- package/lib/sd-component-library210.js +3 -40
- package/lib/sd-component-library210.js.map +1 -1
- package/lib/sd-component-library211.js +62 -127
- package/lib/sd-component-library211.js.map +1 -1
- package/lib/sd-component-library212.js +23 -13
- package/lib/sd-component-library212.js.map +1 -1
- package/lib/sd-component-library213.js +40 -14
- package/lib/sd-component-library213.js.map +1 -1
- package/lib/sd-component-library214.js +129 -3
- package/lib/sd-component-library214.js.map +1 -1
- package/lib/sd-component-library215.js +13 -3
- package/lib/sd-component-library215.js.map +1 -1
- package/lib/sd-component-library216.js +12 -63
- package/lib/sd-component-library216.js.map +1 -1
- package/lib/sd-component-library217.js +2 -2
- package/lib/sd-component-library217.js.map +1 -1
- package/lib/sd-component-library218.js +2 -2
- package/lib/sd-component-library218.js.map +1 -1
- package/lib/sd-component-library219.js +3 -46
- package/lib/sd-component-library219.js.map +1 -1
- package/lib/sd-component-library221.js +61 -13
- package/lib/sd-component-library221.js.map +1 -1
- package/lib/sd-component-library222.js +3 -21
- package/lib/sd-component-library222.js.map +1 -1
- package/lib/sd-component-library223.js +46 -3
- package/lib/sd-component-library223.js.map +1 -1
- package/lib/sd-component-library224.js +17 -3
- package/lib/sd-component-library224.js.map +1 -1
- package/lib/sd-component-library225.js +26 -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 +31 -19
- package/lib/sd-component-library227.js.map +1 -1
- package/lib/sd-component-library228.js +19 -20
- package/lib/sd-component-library228.js.map +1 -1
- package/lib/sd-component-library229.js +20 -28
- package/lib/sd-component-library229.js.map +1 -1
- package/lib/sd-component-library230.js +27 -32
- package/lib/sd-component-library230.js.map +1 -1
- package/lib/sd-component-library231.js +32 -128
- package/lib/sd-component-library231.js.map +1 -1
- package/lib/sd-component-library232.js +3 -43
- package/lib/sd-component-library232.js.map +1 -1
- package/lib/sd-component-library233.js +128 -46
- package/lib/sd-component-library233.js.map +1 -1
- package/lib/sd-component-library234.js +42 -7
- package/lib/sd-component-library234.js.map +1 -1
- package/lib/sd-component-library235.js +47 -3
- 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 -39
- package/lib/sd-component-library245.js.map +1 -1
- package/lib/sd-component-library246.js +74 -26
- package/lib/sd-component-library246.js.map +1 -1
- package/lib/sd-component-library249.js +2 -75
- package/lib/sd-component-library249.js.map +1 -1
- package/lib/sd-component-library250.js +41 -2
- package/lib/sd-component-library250.js.map +1 -1
- package/lib/sd-component-library251.js +26 -324
- package/lib/sd-component-library251.js.map +1 -1
- package/lib/sd-component-library252.js +325 -5
- package/lib/sd-component-library252.js.map +1 -1
- package/lib/sd-component-library253.js +5 -26
- package/lib/sd-component-library253.js.map +1 -1
- package/lib/sd-component-library254.js +25 -21
- package/lib/sd-component-library254.js.map +1 -1
- package/lib/sd-component-library256.js +24 -22
- package/lib/sd-component-library256.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-library279.js +70 -10
- package/lib/sd-component-library279.js.map +1 -1
- package/lib/sd-component-library280.js +101 -69
- package/lib/sd-component-library280.js.map +1 -1
- package/lib/sd-component-library281.js +95 -91
- package/lib/sd-component-library281.js.map +1 -1
- package/lib/sd-component-library282.js +10 -106
- package/lib/sd-component-library282.js.map +1 -1
- package/lib/sd-component-library286.js +4 -4
- package/lib/sd-component-library290.js +58 -2
- package/lib/sd-component-library290.js.map +1 -1
- package/lib/sd-component-library291.js +2 -8
- package/lib/sd-component-library291.js.map +1 -1
- package/lib/sd-component-library292.js +7 -327
- package/lib/sd-component-library292.js.map +1 -1
- package/lib/sd-component-library293.js +325 -48
- package/lib/sd-component-library293.js.map +1 -1
- package/lib/sd-component-library294.js +49 -56
- package/lib/sd-component-library294.js.map +1 -1
- package/lib/sd-component-library296.js +1 -1
- package/lib/sd-component-library297.js +2 -2
- package/lib/sd-component-library298.js +23 -33
- package/lib/sd-component-library298.js.map +1 -1
- package/lib/sd-component-library299.js +33 -23
- package/lib/sd-component-library299.js.map +1 -1
- package/lib/sd-component-library300.js +9 -5
- package/lib/sd-component-library300.js.map +1 -1
- package/lib/sd-component-library301.js +5 -4
- package/lib/sd-component-library301.js.map +1 -1
- package/lib/sd-component-library302.js +3 -8
- package/lib/sd-component-library302.js.map +1 -1
- package/lib/sd-component-library303.js +19 -5
- package/lib/sd-component-library303.js.map +1 -1
- package/lib/sd-component-library304.js +3 -4
- package/lib/sd-component-library304.js.map +1 -1
- package/lib/sd-component-library305.js +5 -19
- package/lib/sd-component-library305.js.map +1 -1
- package/lib/sd-component-library306.js +4 -3
- package/lib/sd-component-library306.js.map +1 -1
- package/lib/sd-component-library315.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-library62.js +3 -3
- 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 +1 -1
- 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-library81.js +1 -1
- package/lib/sd-component-library81.js.map +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-library245.js","sources":["../src/components/meters/
|
|
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;AAGT,MACEJ,EAAS;AAAA,IACP,CAACO,GAAK,EAAE,OAAAL,QAAYK,KAAOL,MAAU,IAAI,IAAI;AAAA,IAC7C;AAAA,QACI;AAEN,WAAAE,EAAU,iCAAiC,GACpC;AAGT,MACEJ,EAAS,OAAe,CAACO,GAAK,EAAE,KAAAJ,EAAI,MAAMI,KAAOJ,MAAQ,IAAI,IAAI,IAAI,CAAC,MACtE;AAEA,WAAAC,EAAU,6BAA6B,GAChC;AAGL,MAAAJ,EAAS,KAAK,CAAC,EAAE,OAAAE,GAAO,KAAAC,QAAUD,KAASC,CAAG;AAChD,WAAAC,EAAU,0CAA0C,GAC7C;AAG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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-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(
|
|
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`
|
|
22
59
|
}
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
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
|
+
] });
|
|
74
|
+
};
|
|
27
75
|
export {
|
|
28
|
-
|
|
76
|
+
G as Segment
|
|
29
77
|
};
|
|
30
78
|
//# sourceMappingURL=sd-component-library246.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sd-component-library246.js","sources":["../src/components/meters/
|
|
1
|
+
{"version":3,"file":"sd-component-library246.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,IACA,KAAAC;AAAA,EACE,IAAAC,EAAsBrB,GAASU,GAAQT,CAAY,GAEjDqB,IAASnB,IAAW,GAEpBoB,IAAa,KAAK,MAAMjB,IAAQ,GAAG,GACnCkB,IAAW,KAAK,MAAMjB,IAAM,GAAG,GAE/B,EAAE,SAAAkB,GAAS,gBAAAC,EAAe,IAAIC,EAAS,GACvCC,IAAYH,KAAW,CAACrB,GAExByB,IAAY,KAAK,KAAK,CAAC,KAAKnB,IAASD,IAErC,EAAE,GAAGqB,GAAY,GAAGC,EAAe,IAAAC;AAAA,IACvCH;AAAA,IACAN;AAAA,IACAb;AAAA,EAAA,GAGI,EAAE,GAAGuB,GAAU,GAAGC,EAAa,IAAAF;AAAA,IACnCH;AAAA,IACAL;AAAA,IACAd;AAAA,EAAA;AAGF,gCACG,KAAG,EAAA,GAAIN,IAAS,KAAKsB,GAEpB,UAA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inateForArc as l } from "./sd-component-library91.js";
|
|
4
|
-
import { getSegmentCoordinates as O } from "./sd-component-library244.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(
|
|
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
|
-
] });
|
|
74
|
-
};
|
|
1
|
+
const i = ({ start: g, end: t }, c) => c >= g && (t === 1 ? c <= t : c < t);
|
|
75
2
|
export {
|
|
76
|
-
|
|
3
|
+
i as isMatchingRange
|
|
77
4
|
};
|
|
78
5
|
//# sourceMappingURL=sd-component-library249.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sd-component-library249.js","sources":["../src/components/meters/
|
|
1
|
+
{"version":3,"file":"sd-component-library249.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;"}
|
|
@@ -1,5 +1,44 @@
|
|
|
1
|
-
|
|
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-library245.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,
|
|
14
|
+
arc: i,
|
|
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
|
+
] });
|
|
40
|
+
};
|
|
2
41
|
export {
|
|
3
|
-
|
|
42
|
+
w as CompactDonutGaugeSegment
|
|
4
43
|
};
|
|
5
44
|
//# sourceMappingURL=sd-component-library250.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sd-component-library250.js","sources":["../src/components/meters/
|
|
1
|
+
{"version":3,"file":"sd-component-library250.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;"}
|