@selfdecode/sd-component-library 4.0.142 → 4.0.143
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/wrapper/functions.d.ts +1 -1
- package/lib/components/wrapper/interfaces.d.ts +1 -0
- 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-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-library198.js +57 -57
- package/lib/sd-component-library198.js.map +1 -1
- package/lib/sd-component-library2.js +14 -4
- package/lib/sd-component-library2.js.map +1 -1
- package/lib/sd-component-library201.js +2 -3
- package/lib/sd-component-library201.js.map +1 -1
- package/lib/sd-component-library202.js +30 -57
- package/lib/sd-component-library202.js.map +1 -1
- package/lib/sd-component-library203.js +599 -2
- package/lib/sd-component-library203.js.map +1 -1
- package/lib/sd-component-library204.js +3 -30
- package/lib/sd-component-library204.js.map +1 -1
- package/lib/sd-component-library205.js +57 -599
- package/lib/sd-component-library205.js.map +1 -1
- package/lib/sd-component-library207.js +21 -18
- package/lib/sd-component-library207.js.map +1 -1
- package/lib/sd-component-library208.js +3 -64
- 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 +18 -21
- package/lib/sd-component-library210.js.map +1 -1
- package/lib/sd-component-library211.js +64 -3
- package/lib/sd-component-library211.js.map +1 -1
- package/lib/sd-component-library212.js +23 -3
- package/lib/sd-component-library212.js.map +1 -1
- package/lib/sd-component-library213.js +35 -21
- package/lib/sd-component-library213.js.map +1 -1
- package/lib/sd-component-library214.js +14 -3
- package/lib/sd-component-library214.js.map +1 -1
- package/lib/sd-component-library215.js +3 -31
- package/lib/sd-component-library215.js.map +1 -1
- package/lib/sd-component-library216.js +3 -19
- package/lib/sd-component-library216.js.map +1 -1
- package/lib/sd-component-library217.js +127 -18
- package/lib/sd-component-library217.js.map +1 -1
- package/lib/sd-component-library218.js +13 -28
- package/lib/sd-component-library218.js.map +1 -1
- package/lib/sd-component-library219.js +61 -29
- 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 +3 -129
- package/lib/sd-component-library221.js.map +1 -1
- package/lib/sd-component-library222.js +50 -41
- package/lib/sd-component-library222.js.map +1 -1
- package/lib/sd-component-library223.js +44 -45
- package/lib/sd-component-library223.js.map +1 -1
- package/lib/sd-component-library224.js +17 -8
- package/lib/sd-component-library224.js.map +1 -1
- package/lib/sd-component-library225.js +25 -63
- package/lib/sd-component-library225.js.map +1 -1
- package/lib/sd-component-library226.js +3 -43
- package/lib/sd-component-library226.js.map +1 -1
- package/lib/sd-component-library227.js +31 -13
- package/lib/sd-component-library227.js.map +1 -1
- package/lib/sd-component-library228.js +19 -21
- package/lib/sd-component-library228.js.map +1 -1
- package/lib/sd-component-library229.js +19 -108
- package/lib/sd-component-library229.js.map +1 -1
- package/lib/sd-component-library230.js +28 -47
- package/lib/sd-component-library230.js.map +1 -1
- package/lib/sd-component-library231.js +32 -23
- package/lib/sd-component-library231.js.map +1 -1
- package/lib/sd-component-library232.js +3 -53
- package/lib/sd-component-library232.js.map +1 -1
- package/lib/sd-component-library233.js +128 -47
- package/lib/sd-component-library233.js.map +1 -1
- package/lib/sd-component-library234.js +40 -72
- package/lib/sd-component-library234.js.map +1 -1
- package/lib/sd-component-library235.js +45 -39
- package/lib/sd-component-library235.js.map +1 -1
- package/lib/sd-component-library236.js +8 -27
- package/lib/sd-component-library236.js.map +1 -1
- package/lib/sd-component-library239.js +48 -2
- package/lib/sd-component-library239.js.map +1 -1
- package/lib/sd-component-library240.js +74 -39
- package/lib/sd-component-library240.js.map +1 -1
- package/lib/sd-component-library241.js +2 -129
- package/lib/sd-component-library241.js.map +1 -1
- package/lib/sd-component-library242.js +64 -13
- package/lib/sd-component-library242.js.map +1 -1
- package/lib/sd-component-library243.js +43 -14
- package/lib/sd-component-library243.js.map +1 -1
- package/lib/sd-component-library244.js +13 -3
- package/lib/sd-component-library244.js.map +1 -1
- package/lib/sd-component-library245.js +21 -3
- package/lib/sd-component-library245.js.map +1 -1
- package/lib/sd-component-library246.js +109 -3
- package/lib/sd-component-library246.js.map +1 -1
- package/lib/sd-component-library247.js +43 -48
- package/lib/sd-component-library247.js.map +1 -1
- package/lib/sd-component-library248.js +22 -63
- package/lib/sd-component-library248.js.map +1 -1
- package/lib/sd-component-library249.js +53 -3
- package/lib/sd-component-library249.js.map +1 -1
- package/lib/sd-component-library250.js +324 -45
- package/lib/sd-component-library250.js.map +1 -1
- package/lib/sd-component-library251.js +5 -17
- package/lib/sd-component-library251.js.map +1 -1
- package/lib/sd-component-library252.js +40 -324
- package/lib/sd-component-library252.js.map +1 -1
- package/lib/sd-component-library253.js +27 -5
- 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-library261.js +1 -1
- package/lib/sd-component-library262.js +1 -1
- package/lib/sd-component-library264.js +1 -1
- package/lib/sd-component-library265.js +9 -30
- package/lib/sd-component-library265.js.map +1 -1
- package/lib/sd-component-library266.js +47 -17
- package/lib/sd-component-library266.js.map +1 -1
- package/lib/sd-component-library267.js +88 -123
- package/lib/sd-component-library267.js.map +1 -1
- package/lib/sd-component-library268.js +90 -120
- package/lib/sd-component-library268.js.map +1 -1
- package/lib/sd-component-library269.js +30 -10
- package/lib/sd-component-library269.js.map +1 -1
- package/lib/sd-component-library270.js +17 -46
- package/lib/sd-component-library270.js.map +1 -1
- package/lib/sd-component-library271.js +125 -9
- package/lib/sd-component-library271.js.map +1 -1
- package/lib/sd-component-library272.js +117 -46
- package/lib/sd-component-library272.js.map +1 -1
- package/lib/sd-component-library273.js +10 -90
- package/lib/sd-component-library273.js.map +1 -1
- package/lib/sd-component-library274.js +48 -90
- package/lib/sd-component-library274.js.map +1 -1
- package/lib/sd-component-library277.js +2 -6
- package/lib/sd-component-library277.js.map +1 -1
- package/lib/sd-component-library278.js +2 -3
- package/lib/sd-component-library278.js.map +1 -1
- package/lib/sd-component-library279.js +9 -2
- package/lib/sd-component-library279.js.map +1 -1
- package/lib/sd-component-library280.js +70 -3
- package/lib/sd-component-library280.js.map +1 -1
- package/lib/sd-component-library281.js +102 -2
- package/lib/sd-component-library281.js.map +1 -1
- package/lib/sd-component-library282.js +106 -2
- package/lib/sd-component-library282.js.map +1 -1
- package/lib/sd-component-library283.js +6 -70
- package/lib/sd-component-library283.js.map +1 -1
- package/lib/sd-component-library284.js +2 -102
- package/lib/sd-component-library284.js.map +1 -1
- package/lib/sd-component-library285.js +34 -104
- package/lib/sd-component-library285.js.map +1 -1
- package/lib/sd-component-library286.js +14 -10
- package/lib/sd-component-library286.js.map +1 -1
- package/lib/sd-component-library287.js +3 -2
- package/lib/sd-component-library287.js.map +1 -1
- package/lib/sd-component-library288.js +3 -36
- package/lib/sd-component-library288.js.map +1 -1
- package/lib/sd-component-library289.js +3 -14
- package/lib/sd-component-library289.js.map +1 -1
- 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 +51 -2
- package/lib/sd-component-library294.js.map +1 -1
- package/lib/sd-component-library295.js +25 -76
- package/lib/sd-component-library295.js.map +1 -1
- package/lib/sd-component-library296.js +25 -93
- package/lib/sd-component-library296.js.map +1 -1
- package/lib/sd-component-library297.js +34 -52
- package/lib/sd-component-library297.js.map +1 -1
- package/lib/sd-component-library298.js +93 -9
- package/lib/sd-component-library298.js.map +1 -1
- package/lib/sd-component-library299.js +51 -5
- package/lib/sd-component-library299.js.map +1 -1
- package/lib/sd-component-library300.js +5 -53
- package/lib/sd-component-library300.js.map +1 -1
- package/lib/sd-component-library301.js +4 -9
- package/lib/sd-component-library301.js.map +1 -1
- package/lib/sd-component-library302.js +8 -4
- package/lib/sd-component-library302.js.map +1 -1
- package/lib/sd-component-library303.js +5 -4
- package/lib/sd-component-library303.js.map +1 -1
- package/lib/sd-component-library304.js +4 -19
- package/lib/sd-component-library304.js.map +1 -1
- package/lib/sd-component-library305.js +19 -3
- package/lib/sd-component-library305.js.map +1 -1
- package/lib/sd-component-library306.js +3 -2
- package/lib/sd-component-library306.js.map +1 -1
- package/lib/sd-component-library307.js +34 -2
- package/lib/sd-component-library307.js.map +1 -1
- package/lib/sd-component-library308.js +2 -6
- package/lib/sd-component-library308.js.map +1 -1
- package/lib/sd-component-library309.js +76 -24
- package/lib/sd-component-library309.js.map +1 -1
- package/lib/sd-component-library310.js +92 -50
- package/lib/sd-component-library310.js.map +1 -1
- package/lib/sd-component-library311.js +52 -34
- package/lib/sd-component-library311.js.map +1 -1
- package/lib/sd-component-library312.js +9 -5
- package/lib/sd-component-library312.js.map +1 -1
- package/lib/sd-component-library313.js +5 -93
- package/lib/sd-component-library313.js.map +1 -1
- package/lib/sd-component-library314.js +53 -4
- package/lib/sd-component-library314.js.map +1 -1
- package/lib/sd-component-library315.js +20 -49
- package/lib/sd-component-library315.js.map +1 -1
- package/lib/sd-component-library316.js +15 -20
- package/lib/sd-component-library316.js.map +1 -1
- package/lib/sd-component-library317.js +88 -32
- package/lib/sd-component-library317.js.map +1 -1
- package/lib/sd-component-library318.js +6 -90
- package/lib/sd-component-library318.js.map +1 -1
- package/lib/sd-component-library319.js +31 -28
- package/lib/sd-component-library319.js.map +1 -1
- package/lib/sd-component-library320.js +2 -21
- package/lib/sd-component-library320.js.map +1 -1
- package/lib/sd-component-library321.js +2 -32
- package/lib/sd-component-library321.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-library239.js","sources":["../src/components/meters/
|
|
1
|
+
{"version":3,"file":"sd-component-library239.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;AAGT,WAASI,IAAI,GAAGA,IAAIR,EAAS,QAAQQ,KAAK;AAClC,UAAAC,IAAiBT,EAASQ,CAAC;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
|
30
|
-
|
|
31
|
-
|
|
32
|
-
},
|
|
33
|
-
r.join()
|
|
34
|
-
),
|
|
35
|
-
e !== t.length - 1 && /* @__PURE__ */ o.jsx(d, { color: "cl_lightGrey" })
|
|
36
|
-
] }, e))
|
|
37
|
-
}
|
|
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-library239.js";
|
|
5
|
+
import { SegmentLabel as q } from "./sd-component-library317.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
|
|
38
32
|
);
|
|
39
|
-
}
|
|
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
|
+
};
|
|
40
75
|
export {
|
|
41
|
-
|
|
76
|
+
G as Segment
|
|
42
77
|
};
|
|
43
78
|
//# sourceMappingURL=sd-component-library240.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sd-component-library240.js","sources":["../src/components/
|
|
1
|
+
{"version":3,"file":"sd-component-library240.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,G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AA,MAAA;AAAA,IACN;AAAA,EACF,EAAA,CAAA;AAEJ;"}
|
|
@@ -1,132 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
import { __exports as h } from "./sd-component-library287.js";
|
|
3
|
-
import d from "react";
|
|
4
|
-
import { f as g } from "./sd-component-library288.js";
|
|
5
|
-
import { p as y } from "./sd-component-library289.js";
|
|
6
|
-
var v = a && a.__extends || function() {
|
|
7
|
-
var t = function(r, e) {
|
|
8
|
-
return t = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(n, o) {
|
|
9
|
-
n.__proto__ = o;
|
|
10
|
-
} || function(n, o) {
|
|
11
|
-
for (var i in o)
|
|
12
|
-
Object.prototype.hasOwnProperty.call(o, i) && (n[i] = o[i]);
|
|
13
|
-
}, t(r, e);
|
|
14
|
-
};
|
|
15
|
-
return function(r, e) {
|
|
16
|
-
if (typeof e != "function" && e !== null)
|
|
17
|
-
throw new TypeError("Class extends value " + String(e) + " is not a constructor or null");
|
|
18
|
-
t(r, e);
|
|
19
|
-
function n() {
|
|
20
|
-
this.constructor = r;
|
|
21
|
-
}
|
|
22
|
-
r.prototype = e === null ? Object.create(e) : (n.prototype = e.prototype, new n());
|
|
23
|
-
};
|
|
24
|
-
}(), p = a && a.__assign || function() {
|
|
25
|
-
return p = Object.assign || function(t) {
|
|
26
|
-
for (var r, e = 1, n = arguments.length; e < n; e++) {
|
|
27
|
-
r = arguments[e];
|
|
28
|
-
for (var o in r)
|
|
29
|
-
Object.prototype.hasOwnProperty.call(r, o) && (t[o] = r[o]);
|
|
30
|
-
}
|
|
31
|
-
return t;
|
|
32
|
-
}, p.apply(this, arguments);
|
|
33
|
-
}, b = a && a.__createBinding || (Object.create ? function(t, r, e, n) {
|
|
34
|
-
n === void 0 && (n = e), Object.defineProperty(t, n, { enumerable: !0, get: function() {
|
|
35
|
-
return r[e];
|
|
36
|
-
} });
|
|
37
|
-
} : function(t, r, e, n) {
|
|
38
|
-
n === void 0 && (n = e), t[n] = r[e];
|
|
39
|
-
}), O = a && a.__setModuleDefault || (Object.create ? function(t, r) {
|
|
40
|
-
Object.defineProperty(t, "default", { enumerable: !0, value: r });
|
|
41
|
-
} : function(t, r) {
|
|
42
|
-
t.default = r;
|
|
43
|
-
}), m = a && a.__importStar || function(t) {
|
|
44
|
-
if (t && t.__esModule)
|
|
45
|
-
return t;
|
|
46
|
-
var r = {};
|
|
47
|
-
if (t != null)
|
|
48
|
-
for (var e in t)
|
|
49
|
-
e !== "default" && Object.prototype.hasOwnProperty.call(t, e) && b(r, t, e);
|
|
50
|
-
return O(r, t), r;
|
|
51
|
-
}, j = a && a.__rest || function(t, r) {
|
|
52
|
-
var e = {};
|
|
53
|
-
for (var n in t)
|
|
54
|
-
Object.prototype.hasOwnProperty.call(t, n) && r.indexOf(n) < 0 && (e[n] = t[n]);
|
|
55
|
-
if (t != null && typeof Object.getOwnPropertySymbols == "function")
|
|
56
|
-
for (var o = 0, n = Object.getOwnPropertySymbols(t); o < n.length; o++)
|
|
57
|
-
r.indexOf(n[o]) < 0 && Object.prototype.propertyIsEnumerable.call(t, n[o]) && (e[n[o]] = t[n[o]]);
|
|
58
|
-
return e;
|
|
59
|
-
}, R = a && a.__importDefault || function(t) {
|
|
60
|
-
return t && t.__esModule ? t : { default: t };
|
|
61
|
-
};
|
|
62
|
-
Object.defineProperty(h, "__esModule", { value: !0 });
|
|
63
|
-
var f = m(d), C = R(g), l = m(y);
|
|
64
|
-
function c(t) {
|
|
65
|
-
return t && t.replace(/ |\u202F|\u00A0/g, " ");
|
|
66
|
-
}
|
|
67
|
-
function E(t) {
|
|
68
|
-
var r = document.createTextNode("");
|
|
69
|
-
t.appendChild(r);
|
|
70
|
-
var e = document.activeElement === t;
|
|
71
|
-
if (r !== null && r.nodeValue !== null && e) {
|
|
72
|
-
var n = window.getSelection();
|
|
73
|
-
if (n !== null) {
|
|
74
|
-
var o = document.createRange();
|
|
75
|
-
o.setStart(r, r.nodeValue.length), o.collapse(!0), n.removeAllRanges(), n.addRange(o);
|
|
76
|
-
}
|
|
77
|
-
t instanceof HTMLElement && t.focus();
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
var w = (
|
|
81
|
-
/** @class */
|
|
82
|
-
function(t) {
|
|
83
|
-
v(r, t);
|
|
84
|
-
function r() {
|
|
85
|
-
var e = t !== null && t.apply(this, arguments) || this;
|
|
86
|
-
return e.lastHtml = e.props.html, e.el = typeof e.props.innerRef == "function" ? { current: null } : f.createRef(), e.getEl = function() {
|
|
87
|
-
return (e.props.innerRef && typeof e.props.innerRef != "function" ? e.props.innerRef : e.el).current;
|
|
88
|
-
}, e.emitChange = function(n) {
|
|
89
|
-
var o = e.getEl();
|
|
90
|
-
if (o) {
|
|
91
|
-
var i = o.innerHTML;
|
|
92
|
-
if (e.props.onChange && i !== e.lastHtml) {
|
|
93
|
-
var u = Object.assign({}, n, {
|
|
94
|
-
target: {
|
|
95
|
-
value: i
|
|
96
|
-
}
|
|
97
|
-
});
|
|
98
|
-
e.props.onChange(u);
|
|
99
|
-
}
|
|
100
|
-
e.lastHtml = i;
|
|
101
|
-
}
|
|
102
|
-
}, e;
|
|
103
|
-
}
|
|
104
|
-
return r.prototype.render = function() {
|
|
105
|
-
var e = this, n = this.props, o = n.tagName, i = n.html, u = n.innerRef, _ = j(n, ["tagName", "html", "innerRef"]);
|
|
106
|
-
return f.createElement(o || "div", p(p({}, _), { ref: typeof u == "function" ? function(s) {
|
|
107
|
-
u(s), e.el.current = s;
|
|
108
|
-
} : u || this.el, onInput: this.emitChange, onBlur: this.props.onBlur || this.emitChange, onKeyUp: this.props.onKeyUp || this.emitChange, onKeyDown: this.props.onKeyDown || this.emitChange, contentEditable: !this.props.disabled, dangerouslySetInnerHTML: { __html: i } }), this.props.children);
|
|
109
|
-
}, r.prototype.shouldComponentUpdate = function(e) {
|
|
110
|
-
var n = this.props, o = this.getEl();
|
|
111
|
-
return !o || c(e.html) !== c(o.innerHTML) ? !0 : n.disabled !== e.disabled || n.tagName !== e.tagName || n.className !== e.className || n.innerRef !== e.innerRef || n.placeholder !== e.placeholder || !C.default(n.style, e.style);
|
|
112
|
-
}, r.prototype.componentDidUpdate = function() {
|
|
113
|
-
var e = this.getEl();
|
|
114
|
-
e && (this.props.html !== e.innerHTML && (e.innerHTML = this.props.html), this.lastHtml = this.props.html, E(e));
|
|
115
|
-
}, r.propTypes = {
|
|
116
|
-
html: l.string.isRequired,
|
|
117
|
-
onChange: l.func,
|
|
118
|
-
disabled: l.bool,
|
|
119
|
-
tagName: l.string,
|
|
120
|
-
className: l.string,
|
|
121
|
-
style: l.object,
|
|
122
|
-
innerRef: l.oneOfType([
|
|
123
|
-
l.object,
|
|
124
|
-
l.func
|
|
125
|
-
])
|
|
126
|
-
}, r;
|
|
127
|
-
}(f.Component)
|
|
128
|
-
), D = h.default = w;
|
|
1
|
+
const i = ({ start: g, end: t }, c) => c >= g && (t === 1 ? c <= t : c < t);
|
|
129
2
|
export {
|
|
130
|
-
|
|
3
|
+
i as isMatchingRange
|
|
131
4
|
};
|
|
132
5
|
//# sourceMappingURL=sd-component-library241.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sd-component-library241.js","sources":["../node_modules/react-contenteditable/lib/react-contenteditable.js"],"sourcesContent":["\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar React = __importStar(require(\"react\"));\nvar fast_deep_equal_1 = __importDefault(require(\"fast-deep-equal\"));\nvar PropTypes = __importStar(require(\"prop-types\"));\nfunction normalizeHtml(str) {\n return str && str.replace(/ |\\u202F|\\u00A0/g, ' ');\n}\nfunction replaceCaret(el) {\n // Place the caret at the end of the element\n var target = document.createTextNode('');\n el.appendChild(target);\n // do not move caret if element was not focused\n var isTargetFocused = document.activeElement === el;\n if (target !== null && target.nodeValue !== null && isTargetFocused) {\n var sel = window.getSelection();\n if (sel !== null) {\n var range = document.createRange();\n range.setStart(target, target.nodeValue.length);\n range.collapse(true);\n sel.removeAllRanges();\n sel.addRange(range);\n }\n if (el instanceof HTMLElement)\n el.focus();\n }\n}\n/**\n * A simple component for an html element with editable contents.\n */\nvar ContentEditable = /** @class */ (function (_super) {\n __extends(ContentEditable, _super);\n function ContentEditable() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.lastHtml = _this.props.html;\n _this.el = typeof _this.props.innerRef === 'function' ? { current: null } : React.createRef();\n _this.getEl = function () { return (_this.props.innerRef && typeof _this.props.innerRef !== 'function' ? _this.props.innerRef : _this.el).current; };\n _this.emitChange = function (originalEvt) {\n var el = _this.getEl();\n if (!el)\n return;\n var html = el.innerHTML;\n if (_this.props.onChange && html !== _this.lastHtml) {\n // Clone event with Object.assign to avoid\n // \"Cannot assign to read only property 'target' of object\"\n var evt = Object.assign({}, originalEvt, {\n target: {\n value: html\n }\n });\n _this.props.onChange(evt);\n }\n _this.lastHtml = html;\n };\n return _this;\n }\n ContentEditable.prototype.render = function () {\n var _this = this;\n var _a = this.props, tagName = _a.tagName, html = _a.html, innerRef = _a.innerRef, props = __rest(_a, [\"tagName\", \"html\", \"innerRef\"]);\n return React.createElement(tagName || 'div', __assign(__assign({}, props), { ref: typeof innerRef === 'function' ? function (current) {\n innerRef(current);\n _this.el.current = current;\n } : innerRef || this.el, onInput: this.emitChange, onBlur: this.props.onBlur || this.emitChange, onKeyUp: this.props.onKeyUp || this.emitChange, onKeyDown: this.props.onKeyDown || this.emitChange, contentEditable: !this.props.disabled, dangerouslySetInnerHTML: { __html: html } }), this.props.children);\n };\n ContentEditable.prototype.shouldComponentUpdate = function (nextProps) {\n var props = this.props;\n var el = this.getEl();\n // We need not rerender if the change of props simply reflects the user's edits.\n // Rerendering in this case would make the cursor/caret jump\n // Rerender if there is no element yet... (somehow?)\n if (!el)\n return true;\n // ...or if html really changed... (programmatically, not by user edit)\n if (normalizeHtml(nextProps.html) !== normalizeHtml(el.innerHTML)) {\n return true;\n }\n // Handle additional properties\n return props.disabled !== nextProps.disabled ||\n props.tagName !== nextProps.tagName ||\n props.className !== nextProps.className ||\n props.innerRef !== nextProps.innerRef ||\n props.placeholder !== nextProps.placeholder ||\n !fast_deep_equal_1.default(props.style, nextProps.style);\n };\n ContentEditable.prototype.componentDidUpdate = function () {\n var el = this.getEl();\n if (!el)\n return;\n // Perhaps React (whose VDOM gets outdated because we often prevent\n // rerendering) did not update the DOM. So we update it manually now.\n if (this.props.html !== el.innerHTML) {\n el.innerHTML = this.props.html;\n }\n this.lastHtml = this.props.html;\n replaceCaret(el);\n };\n ContentEditable.propTypes = {\n html: PropTypes.string.isRequired,\n onChange: PropTypes.func,\n disabled: PropTypes.bool,\n tagName: PropTypes.string,\n className: PropTypes.string,\n style: PropTypes.object,\n innerRef: PropTypes.oneOfType([\n PropTypes.object,\n PropTypes.func,\n ])\n };\n return ContentEditable;\n}(React.Component));\nexports.default = ContentEditable;\n"],"names":["__extends","this","extendStatics","d","b","p","__","__assign","s","i","__createBinding","o","m","k","k2","__setModuleDefault","v","__importStar","mod","result","__rest","e","t","__importDefault","reactContenteditable","React","require$$0","fast_deep_equal_1","require$$1","PropTypes","require$$2","normalizeHtml","str","replaceCaret","el","target","isTargetFocused","sel","range","ContentEditable","_super","_this","originalEvt","html","evt","_a","tagName","innerRef","props","current","nextProps","_default"],"mappings":";;;;;AACA,IAAIA,IAAaC,KAAQA,EAAK,aAAe,WAAY;AACrD,MAAIC,IAAgB,SAAUC,GAAGC,GAAG;AAChC,WAAAF,IAAgB,OAAO,kBAClB,EAAE,WAAW,CAAA,eAAgB,SAAS,SAAUC,GAAGC,GAAG;AAAE,MAAAD,EAAE,YAAYC;AAAA,IAAE,KACzE,SAAUD,GAAGC,GAAG;AAAE,eAASC,KAAKD;AAAG,QAAI,OAAO,UAAU,eAAe,KAAKA,GAAGC,CAAC,MAAGF,E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G,cACvBA,EAAG,YAAY,KAAK,MAAM,OAE9B,KAAK,WAAW,KAAK,MAAM,MAC3BD,EAAaC,CAAE;AAAA,IACvB,GACIK,EAAgB,YAAY;AAAA,MACxB,MAAMV,EAAU,OAAO;AAAA,MACvB,UAAUA,EAAU;AAAA,MACpB,UAAUA,EAAU;AAAA,MACpB,SAASA,EAAU;AAAA,MACnB,WAAWA,EAAU;AAAA,MACrB,OAAOA,EAAU;AAAA,MACjB,UAAUA,EAAU,UAAU;AAAA,QAC1BA,EAAU;AAAA,QACVA,EAAU;AAAA,MACtB,CAAS;AAAA,IACT,GACWU;AAAA,EACX,EAAEd,EAAM,SAAS;AAAA,GACjB0B,IAAA3B,EAAA,UAAkBe;","x_google_ignoreList":[0]}
|
|
1
|
+
{"version":3,"file":"sd-component-library241.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,16 +1,67 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
import { j as a } from "./sd-component-library197.js";
|
|
2
|
+
import { getCoordinateForArc as i } from "./sd-component-library91.js";
|
|
3
|
+
import { defaultTextBottomMargin as X } from "./sd-component-library226.js";
|
|
4
|
+
import { getRangeProperties as Y } from "./sd-component-library300.js";
|
|
5
|
+
import { BaseOutlineArc as b } from "./sd-component-library296.js";
|
|
6
|
+
import { DiscreteMeterLabelPointer as w } from "./sd-component-library301.js";
|
|
7
|
+
function z(s) {
|
|
8
|
+
const {
|
|
9
|
+
color: n,
|
|
10
|
+
idx: c,
|
|
11
|
+
gaugeWidth: d,
|
|
12
|
+
diameter: g,
|
|
13
|
+
arc: m,
|
|
14
|
+
distanceBetweenRanges: l,
|
|
15
|
+
totalRanges: p,
|
|
16
|
+
showLabel: h,
|
|
17
|
+
label: o,
|
|
18
|
+
isMatchedRange: x,
|
|
19
|
+
pointerWidth: f,
|
|
20
|
+
pointerLength: A,
|
|
21
|
+
horizontal: u
|
|
22
|
+
} = s, t = g / 2, { rangeArcStart: r, rangeArcEnd: e } = Y(
|
|
23
|
+
m,
|
|
24
|
+
p,
|
|
25
|
+
l,
|
|
26
|
+
c
|
|
27
|
+
), { x: R, y: j } = i(
|
|
28
|
+
t,
|
|
29
|
+
r
|
|
30
|
+
), { x: B, y: E } = i(
|
|
31
|
+
t,
|
|
32
|
+
e
|
|
33
|
+
), M = (r + e) / 2;
|
|
34
|
+
return /* @__PURE__ */ a.jsxs("g", { children: [
|
|
35
|
+
/* @__PURE__ */ a.jsx(
|
|
36
|
+
b,
|
|
37
|
+
{
|
|
38
|
+
startX: R,
|
|
39
|
+
startY: j,
|
|
40
|
+
endX: B,
|
|
41
|
+
endY: E,
|
|
42
|
+
startAlpha: r,
|
|
43
|
+
endAlpha: e,
|
|
44
|
+
color: n,
|
|
45
|
+
radius: t,
|
|
46
|
+
width: d
|
|
47
|
+
}
|
|
48
|
+
),
|
|
49
|
+
h && o && !x && /* @__PURE__ */ a.jsx(
|
|
50
|
+
w,
|
|
51
|
+
{
|
|
52
|
+
alpha: M,
|
|
53
|
+
pointerLength: A,
|
|
54
|
+
pointerWidth: f,
|
|
55
|
+
radius: t,
|
|
56
|
+
color: n,
|
|
57
|
+
textBottomMargin: X,
|
|
58
|
+
label: o,
|
|
59
|
+
horizontal: u
|
|
60
|
+
}
|
|
61
|
+
)
|
|
62
|
+
] });
|
|
63
|
+
}
|
|
9
64
|
export {
|
|
10
|
-
|
|
11
|
-
l as htmlSpace,
|
|
12
|
-
r as lineToHtml,
|
|
13
|
-
i as unescapeWrapper,
|
|
14
|
-
n as wrapByDiv
|
|
65
|
+
z as DiscreteRange
|
|
15
66
|
};
|
|
16
67
|
//# sourceMappingURL=sd-component-library242.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sd-component-library242.js","sources":["../src/components/
|
|
1
|
+
{"version":3,"file":"sd-component-library242.js","sources":["../src/components/meters/multi-option-discrete-outline-meter/partials/discrete-range/discrete-range.tsx"],"sourcesContent":["import React, { PropsWithChildren } from \"react\";\n\nimport { BaseOutlineArc } from \"../../../outline-meter/partials/base-outline-arc\";\nimport { getCoordinateForArc } from \"../../../outline-meter/utils\";\nimport { defaultTextBottomMargin } from \"../../constants\";\nimport { getRangeProperties } from \"../../utils\";\nimport { DiscreteMeterLabelPointer } from \"../discrete-meter-label-pointer\";\nimport { DiscreteRangeProps as Props } from \"./interfaces\";\n\nexport function DiscreteRange<T>(props: PropsWithChildren<Props<T>>) {\n const {\n color,\n idx,\n gaugeWidth,\n diameter,\n arc,\n distanceBetweenRanges,\n totalRanges,\n showLabel,\n label,\n isMatchedRange,\n pointerWidth,\n pointerLength,\n horizontal,\n } = props;\n\n const radius = diameter / 2;\n\n const { rangeArcStart, rangeArcEnd } = getRangeProperties(\n arc,\n totalRanges,\n distanceBetweenRanges,\n idx\n );\n\n const { x: rangeStartX, y: rangeStartY } = getCoordinateForArc(\n radius,\n rangeArcStart\n );\n const { x: rangeEndX, y: rangeEndY } = getCoordinateForArc(\n radius,\n rangeArcEnd\n );\n\n const middleArcAlpha = (rangeArcStart + rangeArcEnd) / 2;\n\n return (\n <g>\n <BaseOutlineArc\n startX={rangeStartX}\n startY={rangeStartY}\n endX={rangeEndX}\n endY={rangeEndY}\n startAlpha={rangeArcStart}\n endAlpha={rangeArcEnd}\n color={color}\n radius={radius}\n width={gaugeWidth}\n />\n\n {showLabel && label && !isMatchedRange && (\n <DiscreteMeterLabelPointer\n alpha={middleArcAlpha}\n pointerLength={pointerLength}\n pointerWidth={pointerWidth}\n radius={radius}\n color={color}\n textBottomMargin={defaultTextBottomMargin}\n label={label}\n horizontal={horizontal}\n />\n )}\n </g>\n );\n}\n"],"names":["DiscreteRange","props","color","idx","gaugeWidth","diameter","arc","distanceBetweenRanges","totalRanges","showLabel","label","isMatchedRange","pointerWidth","pointerLength","horizontal","radius","rangeArcStart","rangeArcEnd","getRangeProperties","rangeStartX","rangeStartY","getCoordinateForArc","rangeEndX","rangeEndY","middleArcAlpha","jsx","BaseOutlineArc","DiscreteMeterLabelPointer","defaultTextBottomMargin"],"mappings":";;;;;;AASO,SAASA,EAAiBC,GAAoC;AAC7D,QAAA;AAAA,IACJ,OAAAC;AAAA,IACA,KAAAC;AAAA,IACA,YAAAC;AAAA,IACA,UAAAC;AAAA,IACA,KAAAC;AAAA,IACA,uBAAAC;AAAA,IACA,aAAAC;AAAA,IACA,WAAAC;AAAA,IACA,OAAAC;AAAA,IACA,gBAAAC;AAAA,IACA,cAAAC;AAAA,IACA,eAAAC;AAAA,IACA,YAAAC;AAAA,EACE,IAAAb,GAEEc,IAASV,IAAW,GAEpB,EAAE,eAAAW,GAAe,aAAAC,EAAA,IAAgBC;AAAA,IACrCZ;AAAA,IACAE;AAAA,IACAD;AAAA,IACAJ;AAAA,EAAA,GAGI,EAAE,GAAGgB,GAAa,GAAGC,EAAgB,IAAAC;AAAA,IACzCN;AAAA,IACAC;AAAA,EAAA,GAEI,EAAE,GAAGM,GAAW,GAAGC,EAAc,IAAAF;AAAA,IACrCN;AAAA,IACAE;AAAA,EAAA,GAGIO,KAAkBR,IAAgBC,KAAe;AAEvD,gCACG,KACC,EAAA,UAAA;AAAA,IAAAQ,gBAAAA,EAAA;AAAA,MAACC;AAAA,MAAA;AAAA,QACC,QAAQP;AAAA,QACR,QAAQC;AAAA,QACR,MAAME;AAAA,QACN,MAAMC;AAAA,QACN,YAAYP;AAAA,QACZ,UAAUC;AAAA,QACV,OAAAf;AAAA,QACA,QAAAa;AAAA,QACA,OAAOX;AAAA,MAAA;AAAA,IACT;AAAA,IAECK,KAAaC,KAAS,CAACC,KACtBc,gBAAAA,EAAA;AAAA,MAACE;AAAA,MAAA;AAAA,QACC,OAAOH;AAAA,QACP,eAAAX;AAAA,QACA,cAAAD;AAAA,QACA,QAAAG;AAAA,QACA,OAAAb;AAAA,QACA,kBAAkB0B;AAAA,QAClB,OAAAlB;AAAA,QACA,YAAAI;AAAA,MAAA;AAAA,IACF;AAAA,EAEJ,EAAA,CAAA;AAEJ;"}
|
|
@@ -1,17 +1,46 @@
|
|
|
1
|
-
import { j as
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
{
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
1
|
+
import { j as M } from "./sd-component-library197.js";
|
|
2
|
+
import { getInnerX as T, getInnerY as W, degToRad as r, getCoordinateForArc as y } from "./sd-component-library91.js";
|
|
3
|
+
import { BaseNeedle as B } from "./sd-component-library297.js";
|
|
4
|
+
function E(p) {
|
|
5
|
+
const {
|
|
6
|
+
needleColor: u,
|
|
7
|
+
options: n,
|
|
8
|
+
value: h,
|
|
9
|
+
needleWidth: e,
|
|
10
|
+
innerCircleRadius: m,
|
|
11
|
+
innerCircleStrokeWidth: x,
|
|
12
|
+
diameter: R,
|
|
13
|
+
arc: a,
|
|
14
|
+
distanceBetweenRanges: c,
|
|
15
|
+
distanceFromRange: s,
|
|
16
|
+
gaugeWidth: i
|
|
17
|
+
} = p, o = n.findIndex(
|
|
18
|
+
(F) => h === F.value
|
|
19
|
+
), d = R / 2, f = (360 - a) / 2, l = a - (n.length - 1) * c, g = o / n.length, v = (o + 1) / n.length, A = l * (v - g), t = f + c * o + l * g + A / 2, { x: C, y: I } = y(d, t), S = T(
|
|
20
|
+
C,
|
|
21
|
+
r(t),
|
|
22
|
+
s + i + e / 2
|
|
23
|
+
), X = W(
|
|
24
|
+
I,
|
|
25
|
+
r(t),
|
|
26
|
+
s + i + e / 2
|
|
27
|
+
), Y = e / 2 * Math.cos(r(t)), j = e / 2 * Math.sin(r(t));
|
|
28
|
+
return /* @__PURE__ */ M.jsx(
|
|
29
|
+
B,
|
|
30
|
+
{
|
|
31
|
+
dx: Y,
|
|
32
|
+
dy: j,
|
|
33
|
+
color: u,
|
|
34
|
+
radius: d,
|
|
35
|
+
tipX: S,
|
|
36
|
+
tipY: X,
|
|
37
|
+
innerCircleStrokeWidth: x,
|
|
38
|
+
innerCircleRadius: m,
|
|
39
|
+
needleWidth: e
|
|
40
|
+
}
|
|
41
|
+
);
|
|
42
|
+
}
|
|
14
43
|
export {
|
|
15
|
-
|
|
44
|
+
E as DiscreteMeterNeedle
|
|
16
45
|
};
|
|
17
46
|
//# sourceMappingURL=sd-component-library243.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sd-component-library243.js","sources":["../src/components/
|
|
1
|
+
{"version":3,"file":"sd-component-library243.js","sources":["../src/components/meters/multi-option-discrete-outline-meter/partials/discrete-meter-needle/discrete-meter-needle.tsx"],"sourcesContent":["import React, { PropsWithChildren } from \"react\";\n\nimport { BaseNeedle } from \"../../../outline-meter/partials/base-needle\";\nimport {\n degToRad,\n getCoordinateForArc,\n getInnerX,\n getInnerY,\n} from \"../../../outline-meter/utils\";\nimport { DiscreteMeterNeedleProps as Props } from \"./interfaces\";\n\nexport function DiscreteMeterNeedle<T>(props: PropsWithChildren<Props<T>>) {\n const {\n needleColor,\n options,\n value,\n needleWidth,\n innerCircleRadius,\n innerCircleStrokeWidth,\n diameter,\n arc,\n distanceBetweenRanges,\n distanceFromRange,\n gaugeWidth,\n } = props;\n\n const matchingRangeIndex = options.findIndex(\n (option) => value === option.value\n );\n\n const radius = diameter / 2;\n\n const arcStart = (360 - arc) / 2;\n const arcForRanges = arc - (options.length - 1) * distanceBetweenRanges;\n\n const start = matchingRangeIndex / options.length;\n const end = (matchingRangeIndex + 1) / options.length;\n\n const rangeArc = arcForRanges * (end - start);\n\n const rangeArcStart =\n arcStart +\n distanceBetweenRanges * matchingRangeIndex +\n arcForRanges * start;\n\n const valueAlpha = rangeArcStart + rangeArc / 2;\n const { x: valueX, y: valueY } = getCoordinateForArc(radius, valueAlpha);\n\n const needleTipX = getInnerX(\n valueX,\n degToRad(valueAlpha),\n distanceFromRange + gaugeWidth + needleWidth / 2\n );\n const needleTipY = getInnerY(\n valueY,\n degToRad(valueAlpha),\n distanceFromRange + gaugeWidth + needleWidth / 2\n );\n\n const dx = (needleWidth / 2) * Math.cos(degToRad(valueAlpha));\n const dy = (needleWidth / 2) * Math.sin(degToRad(valueAlpha));\n\n return (\n <BaseNeedle\n dx={dx}\n dy={dy}\n color={needleColor}\n radius={radius}\n tipX={needleTipX}\n tipY={needleTipY}\n innerCircleStrokeWidth={innerCircleStrokeWidth}\n innerCircleRadius={innerCircleRadius}\n needleWidth={needleWidth}\n />\n );\n}\n"],"names":["DiscreteMeterNeedle","props","needleColor","options","value","needleWidth","innerCircleRadius","innerCircleStrokeWidth","diameter","arc","distanceBetweenRanges","distanceFromRange","gaugeWidth","matchingRangeIndex","option","radius","arcStart","arcForRanges","start","end","rangeArc","valueAlpha","valueX","valueY","getCoordinateForArc","needleTipX","getInnerX","degToRad","needleTipY","getInnerY","dx","dy","jsx","BaseNeedle"],"mappings":";;;AAWO,SAASA,EAAuBC,GAAoC;AACnE,QAAA;AAAA,IACJ,aAAAC;AAAA,IACA,SAAAC;AAAA,IACA,OAAAC;AAAA,IACA,aAAAC;AAAA,IACA,mBAAAC;AAAA,IACA,wBAAAC;AAAA,IACA,UAAAC;AAAA,IACA,KAAAC;AAAA,IACA,uBAAAC;AAAA,IACA,mBAAAC;AAAA,IACA,YAAAC;AAAA,EACE,IAAAX,GAEEY,IAAqBV,EAAQ;AAAA,IACjC,CAACW,MAAWV,MAAUU,EAAO;AAAA,EAAA,GAGzBC,IAASP,IAAW,GAEpBQ,KAAY,MAAMP,KAAO,GACzBQ,IAAeR,KAAON,EAAQ,SAAS,KAAKO,GAE5CQ,IAAQL,IAAqBV,EAAQ,QACrCgB,KAAON,IAAqB,KAAKV,EAAQ,QAEzCiB,IAAWH,KAAgBE,IAAMD,IAOjCG,IAJJL,IACAN,IAAwBG,IACxBI,IAAeC,IAEkBE,IAAW,GACxC,EAAE,GAAGE,GAAQ,GAAGC,MAAWC,EAAoBT,GAAQM,CAAU,GAEjEI,IAAaC;AAAA,IACjBJ;AAAA,IACAK,EAASN,CAAU;AAAA,IACnBV,IAAoBC,IAAaP,IAAc;AAAA,EAAA,GAE3CuB,IAAaC;AAAA,IACjBN;AAAA,IACAI,EAASN,CAAU;AAAA,IACnBV,IAAoBC,IAAaP,IAAc;AAAA,EAAA,GAG3CyB,IAAMzB,IAAc,IAAK,KAAK,IAAIsB,EAASN,CAAU,CAAC,GACtDU,IAAM1B,IAAc,IAAK,KAAK,IAAIsB,EAASN,CAAU,CAAC;AAG1D,SAAAW,gBAAAA,EAAA;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,IAAAH;AAAA,MACA,IAAAC;AAAA,MACA,OAAO7B;AAAA,MACP,QAAAa;AAAA,MACA,MAAMU;AAAA,MACN,MAAMG;AAAA,MACN,wBAAArB;AAAA,MACA,mBAAAD;AAAA,MACA,aAAAD;AAAA,IAAA;AAAA,EAAA;AAGN;"}
|
|
@@ -1,6 +1,16 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
1
|
+
import { j as g } from "./sd-component-library197.js";
|
|
2
|
+
import { getRangeProperties as d } from "./sd-component-library300.js";
|
|
3
|
+
import { MatchedRangeLabelBox as x } from "./sd-component-library298.js";
|
|
4
|
+
const h = (e) => {
|
|
5
|
+
const { idx: t, totalRanges: a, distanceBetweenRanges: r, arc: n } = e, { rangeArcStart: o, rangeArcEnd: s } = d(
|
|
6
|
+
n,
|
|
7
|
+
a,
|
|
8
|
+
r,
|
|
9
|
+
t
|
|
10
|
+
), c = Math.round((o + s) / 2);
|
|
11
|
+
return /* @__PURE__ */ g.jsx(x, { ...e, alpha: c, round: !0 });
|
|
12
|
+
};
|
|
3
13
|
export {
|
|
4
|
-
|
|
14
|
+
h as MatchedRangeLabelBox
|
|
5
15
|
};
|
|
6
16
|
//# sourceMappingURL=sd-component-library244.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sd-component-library244.js","sources":["../src/components/
|
|
1
|
+
{"version":3,"file":"sd-component-library244.js","sources":["../src/components/meters/multi-option-discrete-outline-meter/partials/matched-range-label-box/matched-range-label-box.tsx"],"sourcesContent":["import React from \"react\";\n\nimport { MatchedRangeLabelBox as LabelBox } from \"../../../common-outline-meter-partials\";\nimport { getRangeProperties } from \"../../utils\";\nimport { MatchedRangeLabelBoxProps as Props } from \"./interfaces\";\n\nexport const MatchedRangeLabelBox: React.FC<Props> = (props) => {\n const { idx, totalRanges, distanceBetweenRanges, arc } = props;\n\n const { rangeArcStart, rangeArcEnd } = getRangeProperties(\n arc,\n totalRanges,\n distanceBetweenRanges,\n idx\n );\n\n const alpha = Math.round((rangeArcStart + rangeArcEnd) / 2);\n\n return <LabelBox {...props} alpha={alpha} round />;\n};\n"],"names":["MatchedRangeLabelBox","props","idx","totalRanges","distanceBetweenRanges","arc","rangeArcStart","rangeArcEnd","getRangeProperties","alpha","LabelBox"],"mappings":";;;AAMa,MAAAA,IAAwC,CAACC,MAAU;AAC9D,QAAM,EAAE,KAAAC,GAAK,aAAAC,GAAa,uBAAAC,GAAuB,KAAAC,MAAQJ,GAEnD,EAAE,eAAAK,GAAe,aAAAC,EAAA,IAAgBC;AAAA,IACrCH;AAAA,IACAF;AAAA,IACAC;AAAA,IACAF;AAAA,EAAA,GAGIO,IAAQ,KAAK,OAAOH,IAAgBC,KAAe,CAAC;AAE1D,+BAAQG,GAAU,EAAA,GAAGT,GAAO,OAAAQ,GAAc,OAAK,GAAC,CAAA;AAClD;"}
|
|
@@ -1,6 +1,24 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
const i = (t, n) => [t, n], T = function* (t = []) {
|
|
2
|
+
for (; t.length > 1; )
|
|
3
|
+
yield i(t[0], t[1]), t = t.slice(1);
|
|
4
|
+
}, I = (t, n, e) => {
|
|
5
|
+
if (n && !e)
|
|
6
|
+
return n;
|
|
7
|
+
if (!n && e)
|
|
8
|
+
return e;
|
|
9
|
+
if (n && e) {
|
|
10
|
+
const s = a(n), r = a(e), c = s.map((B, f) => Math.round(B * (1 - t) + r[f] * t));
|
|
11
|
+
return c ? u(c[0], c[1], c[2]) : "";
|
|
12
|
+
}
|
|
13
|
+
return "";
|
|
14
|
+
}, u = (t, n, e) => "#" + (16777216 + (t << 16) + (n << 8) + e).toString(16).slice(1), a = (t) => {
|
|
15
|
+
const n = t.match(/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i);
|
|
16
|
+
return n ? n.slice(1).map((e) => parseInt(e, 16)) : null;
|
|
17
|
+
}, h = (t, n, e) => Math.floor(t * n) === (e === "left" ? 0 : e === "right" ? n - 1 : 1), _ = (t) => t === "left" ? "right" : t === "top" ? "top" : "left";
|
|
3
18
|
export {
|
|
4
|
-
|
|
19
|
+
_ as flipPosition,
|
|
20
|
+
I as getFractionColor,
|
|
21
|
+
h as isLabelActive,
|
|
22
|
+
T as mapAdjacent
|
|
5
23
|
};
|
|
6
24
|
//# sourceMappingURL=sd-component-library245.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sd-component-library245.js","sources":["../src/components/
|
|
1
|
+
{"version":3,"file":"sd-component-library245.js","sources":["../src/components/meters/gradient-outline-meter/utils.ts"],"sourcesContent":["import { OutlineMeterLabelPosition } from \"../outline-meter\";\n\nconst pair = <T>(a: T, b: T): [T, T] => [a, b];\n\n/**\n * Returns an array of mapped adjacent elements into pairs.\n */\nexport const mapAdjacent = function* <T>(iter: T[] = []) {\n while (iter.length > 1) {\n yield pair<T>(iter[0], iter[1]);\n iter = iter.slice(1);\n }\n};\n\n/**\n * @param fraction numerical value from 0 to 1.\n * @param lowColor initial color of the gradient.\n * @param topColor final color of the gradient.\n * @returns color of gradient at specified fraction point or empty string\n */\nexport const getFractionColor = (\n fraction: number,\n lowColor?: string,\n topColor?: string\n): string => {\n if (lowColor && !topColor) return lowColor;\n if (!lowColor && topColor) return topColor;\n if (lowColor && topColor) {\n const lowRGB = hexToRGB(lowColor);\n const topRGB = hexToRGB(topColor);\n const resultRGB = lowRGB!.map((component, i) => {\n return Math.round(component * (1 - fraction) + topRGB![i] * fraction);\n });\n return resultRGB ? rgbToHex(resultRGB[0], resultRGB[1], resultRGB[2]) : \"\";\n }\n return \"\";\n};\n\n/**\n * Converts rgb color representation into hex representation.\n * @param red component of color.\n * @param green component of color.\n * @param blue component of color.\n */\nconst rgbToHex = (red: number, green: number, blue: number): string => {\n const BITS_IN_BYTE = 8;\n return (\n \"#\" +\n (\n (1 << (3 * BITS_IN_BYTE)) +\n (red << (2 * BITS_IN_BYTE)) +\n (green << BITS_IN_BYTE) +\n blue\n )\n .toString(16)\n .slice(1)\n );\n};\n\n/**\n * Converts hex representation of color into rgb.\n * @param hex complete and correct representation of color\n */\nconst hexToRGB = (hex: string) => {\n const normal = hex.match(/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i);\n return normal ? normal.slice(1).map((e) => parseInt(e, 16)) : null;\n};\n\nexport const isLabelActive = (\n value: number,\n totalColors: number,\n position: OutlineMeterLabelPosition\n) =>\n Math.floor(value * totalColors) ===\n (position === \"left\" ? 0 : position === \"right\" ? totalColors - 1 : 1);\n\n/**\n * Mirrors entered position for outline meter label.\n */\nexport const flipPosition = (position: OutlineMeterLabelPosition) =>\n position === \"left\" ? \"right\" : position === \"top\" ? \"top\" : \"left\";\n"],"names":["pair","a","b","mapAdjacent","iter","getFractionColor","fraction","lowColor","topColor","lowRGB","hexToRGB","topRGB","resultRGB","component","i","rgbToHex","red","green","blue","hex","normal","isLabelActive","value","totalColors","position","flipPosition"],"mappings":"AAEA,MAAMA,IAAO,CAAIC,GAAMC,MAAiB,CAACD,GAAGC,CAAC,GAKhCC,IAAc,WAAcC,IAAY,IAAI;AAChD,SAAAA,EAAK,SAAS;AACnB,UAAMJ,EAAQI,EAAK,CAAC,GAAGA,EAAK,CAAC,CAAC,GACvBA,IAAAA,EAAK,MAAM,CAAC;AAEvB,GAQaC,IAAmB,CAC9BC,GACAC,GACAC,MACW;AACX,MAAID,KAAY,CAACC;AAAiB,WAAAD;AAClC,MAAI,CAACA,KAAYC;AAAiB,WAAAA;AAClC,MAAID,KAAYC,GAAU;AAClB,UAAAC,IAASC,EAASH,CAAQ,GAC1BI,IAASD,EAASF,CAAQ,GAC1BI,IAAYH,EAAQ,IAAI,CAACI,GAAWC,MACjC,KAAK,MAAMD,KAAa,IAAIP,KAAYK,EAAQG,CAAC,IAAIR,CAAQ,CACrE;AACM,WAAAM,IAAYG,EAASH,EAAU,CAAC,GAAGA,EAAU,CAAC,GAAGA,EAAU,CAAC,CAAC,IAAI;AAAA,EAC1E;AACO,SAAA;AACT,GAQMG,IAAW,CAACC,GAAaC,GAAeC,MAG1C,OAEG,YACAF,KAAQ,OACRC,KAAS,KACVC,GAEC,SAAS,EAAE,EACX,MAAM,CAAC,GAQRR,IAAW,CAACS,MAAgB;AAC1B,QAAAC,IAASD,EAAI,MAAM,6CAA6C;AACtE,SAAOC,IAASA,EAAO,MAAM,CAAC,EAAE,IAAI,CAAC,MAAM,SAAS,GAAG,EAAE,CAAC,IAAI;AAChE,GAEaC,IAAgB,CAC3BC,GACAC,GACAC,MAEA,KAAK,MAAMF,IAAQC,CAAW,OAC7BC,MAAa,SAAS,IAAIA,MAAa,UAAUD,IAAc,IAAI,IAKzDE,IAAe,CAACD,MAC3BA,MAAa,SAAS,UAAUA,MAAa,QAAQ,QAAQ;"}
|