@selfdecode/sd-component-library 4.0.113 → 4.0.114
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 +2 -0
- package/lib/sd-component-library100.js +2 -2
- package/lib/sd-component-library101.js +1 -1
- package/lib/sd-component-library102.js +2 -2
- package/lib/sd-component-library103.js +3 -3
- package/lib/sd-component-library104.js +2 -2
- package/lib/sd-component-library106.js +4 -4
- package/lib/sd-component-library108.js +4 -4
- package/lib/sd-component-library114.js +1 -1
- package/lib/sd-component-library119.js +1 -1
- package/lib/sd-component-library120.js +2 -2
- package/lib/sd-component-library122.js +1 -1
- package/lib/sd-component-library123.js +1 -1
- package/lib/sd-component-library128.js +2 -2
- package/lib/sd-component-library129.js +2 -2
- package/lib/sd-component-library131.js +1 -1
- package/lib/sd-component-library135.js +3 -3
- package/lib/sd-component-library136.js +1 -1
- package/lib/sd-component-library138.js +2 -2
- package/lib/sd-component-library169.js +1 -1
- package/lib/sd-component-library174.js +4 -4
- package/lib/sd-component-library175.js +1 -1
- package/lib/sd-component-library198.js +3 -3
- package/lib/sd-component-library202.js +3 -2
- package/lib/sd-component-library202.js.map +1 -1
- package/lib/sd-component-library203.js +2 -30
- package/lib/sd-component-library203.js.map +1 -1
- package/lib/sd-component-library204.js +21 -590
- package/lib/sd-component-library204.js.map +1 -1
- package/lib/sd-component-library205.js +599 -3
- package/lib/sd-component-library205.js.map +1 -1
- package/lib/sd-component-library207.js +24 -17
- package/lib/sd-component-library207.js.map +1 -1
- package/lib/sd-component-library208.js +15 -60
- package/lib/sd-component-library208.js.map +1 -1
- package/lib/sd-component-library209.js +5 -23
- package/lib/sd-component-library209.js.map +1 -1
- package/lib/sd-component-library210.js +5 -21
- package/lib/sd-component-library210.js.map +1 -1
- package/lib/sd-component-library211.js +18 -3
- package/lib/sd-component-library211.js.map +1 -1
- package/lib/sd-component-library212.js +21 -3
- package/lib/sd-component-library212.js.map +1 -1
- package/lib/sd-component-library213.js +3 -40
- package/lib/sd-component-library213.js.map +1 -1
- package/lib/sd-component-library214.js +3 -129
- package/lib/sd-component-library214.js.map +1 -1
- package/lib/sd-component-library215.js +64 -13
- package/lib/sd-component-library215.js.map +1 -1
- package/lib/sd-component-library216.js +23 -14
- package/lib/sd-component-library216.js.map +1 -1
- package/lib/sd-component-library217.js +40 -3
- package/lib/sd-component-library217.js.map +1 -1
- package/lib/sd-component-library218.js +129 -3
- package/lib/sd-component-library218.js.map +1 -1
- package/lib/sd-component-library219.js +13 -3
- package/lib/sd-component-library219.js.map +1 -1
- package/lib/sd-component-library220.js +14 -52
- package/lib/sd-component-library220.js.map +1 -1
- package/lib/sd-component-library221.js +3 -65
- package/lib/sd-component-library221.js.map +1 -1
- package/lib/sd-component-library222.js +2 -2
- package/lib/sd-component-library222.js.map +1 -1
- package/lib/sd-component-library223.js +64 -45
- package/lib/sd-component-library223.js.map +1 -1
- package/lib/sd-component-library224.js +3 -17
- package/lib/sd-component-library224.js.map +1 -1
- package/lib/sd-component-library225.js +3 -26
- package/lib/sd-component-library225.js.map +1 -1
- package/lib/sd-component-library226.js +52 -3
- package/lib/sd-component-library226.js.map +1 -1
- package/lib/sd-component-library227.js +46 -31
- package/lib/sd-component-library227.js.map +1 -1
- package/lib/sd-component-library228.js +17 -19
- package/lib/sd-component-library228.js.map +1 -1
- package/lib/sd-component-library229.js +3 -20
- package/lib/sd-component-library229.js.map +1 -1
- package/lib/sd-component-library230.js +31 -28
- package/lib/sd-component-library230.js.map +1 -1
- package/lib/sd-component-library231.js +19 -33
- package/lib/sd-component-library231.js.map +1 -1
- package/lib/sd-component-library232.js +20 -3
- package/lib/sd-component-library232.js.map +1 -1
- package/lib/sd-component-library233.js +26 -127
- package/lib/sd-component-library233.js.map +1 -1
- package/lib/sd-component-library234.js +31 -41
- package/lib/sd-component-library234.js.map +1 -1
- package/lib/sd-component-library235.js +22 -43
- package/lib/sd-component-library235.js.map +1 -1
- package/lib/sd-component-library236.js +3 -8
- package/lib/sd-component-library236.js.map +1 -1
- package/lib/sd-component-library237.js +21 -64
- package/lib/sd-component-library237.js.map +1 -1
- package/lib/sd-component-library238.js +107 -41
- package/lib/sd-component-library238.js.map +1 -1
- package/lib/sd-component-library239.js +42 -12
- package/lib/sd-component-library239.js.map +1 -1
- package/lib/sd-component-library24.js +2 -2
- package/lib/sd-component-library240.js +47 -21
- package/lib/sd-component-library240.js.map +1 -1
- package/lib/sd-component-library241.js +23 -108
- package/lib/sd-component-library241.js.map +1 -1
- package/lib/sd-component-library242.js +49 -43
- package/lib/sd-component-library242.js.map +1 -1
- package/lib/sd-component-library243.js +129 -24
- package/lib/sd-component-library243.js.map +1 -1
- package/lib/sd-component-library244.js +43 -49
- package/lib/sd-component-library244.js.map +1 -1
- package/lib/sd-component-library245.js +7 -47
- package/lib/sd-component-library245.js.map +1 -1
- package/lib/sd-component-library246.js +46 -73
- package/lib/sd-component-library246.js.map +1 -1
- package/lib/sd-component-library247.js +1 -1
- package/lib/sd-component-library249.js +72 -18
- package/lib/sd-component-library249.js.map +1 -1
- package/lib/sd-component-library25.js +2 -2
- package/lib/sd-component-library250.js +20 -19
- package/lib/sd-component-library250.js.map +1 -1
- package/lib/sd-component-library251.js +20 -2
- package/lib/sd-component-library251.js.map +1 -1
- package/lib/sd-component-library252.js +2 -25
- package/lib/sd-component-library252.js.map +1 -1
- package/lib/sd-component-library253.js +323 -17
- package/lib/sd-component-library253.js.map +1 -1
- package/lib/sd-component-library254.js +5 -5
- package/lib/sd-component-library254.js.map +1 -1
- package/lib/sd-component-library255.js +64 -5
- package/lib/sd-component-library255.js.map +1 -1
- package/lib/sd-component-library256.js +39 -25
- package/lib/sd-component-library256.js.map +1 -1
- package/lib/sd-component-library257.js +13 -3
- package/lib/sd-component-library257.js.map +1 -1
- package/lib/sd-component-library258.js +18 -17
- package/lib/sd-component-library258.js.map +1 -1
- package/lib/sd-component-library259.js +1 -1
- package/lib/sd-component-library259.js.map +1 -1
- package/lib/sd-component-library26.js +1 -1
- package/lib/sd-component-library260.js +21 -24
- package/lib/sd-component-library260.js.map +1 -1
- package/lib/sd-component-library261.js +3 -22
- package/lib/sd-component-library261.js.map +1 -1
- package/lib/sd-component-library262.js +27 -323
- package/lib/sd-component-library262.js.map +1 -1
- package/lib/sd-component-library263.js +24 -5
- package/lib/sd-component-library263.js.map +1 -1
- package/lib/sd-component-library264.js +27 -27
- package/lib/sd-component-library264.js.map +1 -1
- package/lib/sd-component-library265.js +43 -13
- package/lib/sd-component-library265.js.map +1 -1
- package/lib/sd-component-library266.js +118 -112
- package/lib/sd-component-library266.js.map +1 -1
- package/lib/sd-component-library267.js +57 -105
- package/lib/sd-component-library267.js.map +1 -1
- package/lib/sd-component-library268.js +75 -9
- package/lib/sd-component-library268.js.map +1 -1
- package/lib/sd-component-library269.js +30 -50
- package/lib/sd-component-library269.js.map +1 -1
- package/lib/sd-component-library270.js +20 -29
- package/lib/sd-component-library270.js.map +1 -1
- package/lib/sd-component-library271.js +118 -44
- package/lib/sd-component-library271.js.map +1 -1
- package/lib/sd-component-library272.js +9 -130
- package/lib/sd-component-library272.js.map +1 -1
- package/lib/sd-component-library273.js +41 -65
- package/lib/sd-component-library273.js.map +1 -1
- package/lib/sd-component-library274.js +107 -61
- package/lib/sd-component-library274.js.map +1 -1
- package/lib/sd-component-library276.js +51 -49
- package/lib/sd-component-library276.js.map +1 -1
- package/lib/sd-component-library277.js +87 -48
- package/lib/sd-component-library277.js.map +1 -1
- package/lib/sd-component-library278.js +54 -52
- package/lib/sd-component-library278.js.map +1 -1
- package/lib/sd-component-library279.js +48 -91
- package/lib/sd-component-library279.js.map +1 -1
- package/lib/sd-component-library282.js +2 -10
- package/lib/sd-component-library282.js.map +1 -1
- package/lib/sd-component-library283.js +2 -2
- package/lib/sd-component-library284.js +70 -2
- package/lib/sd-component-library284.js.map +1 -1
- package/lib/sd-component-library285.js +101 -69
- package/lib/sd-component-library285.js.map +1 -1
- package/lib/sd-component-library286.js +95 -91
- package/lib/sd-component-library286.js.map +1 -1
- package/lib/sd-component-library287.js +10 -106
- package/lib/sd-component-library287.js.map +1 -1
- package/lib/sd-component-library291.js +4 -4
- package/lib/sd-component-library292.js +2 -3
- package/lib/sd-component-library292.js.map +1 -1
- package/lib/sd-component-library293.js +8 -3
- package/lib/sd-component-library293.js.map +1 -1
- package/lib/sd-component-library294.js +328 -3
- package/lib/sd-component-library294.js.map +1 -1
- package/lib/sd-component-library295.js +51 -2
- package/lib/sd-component-library295.js.map +1 -1
- package/lib/sd-component-library296.js +3 -8
- package/lib/sd-component-library296.js.map +1 -1
- package/lib/sd-component-library297.js +3 -328
- package/lib/sd-component-library297.js.map +1 -1
- package/lib/sd-component-library298.js +3 -51
- package/lib/sd-component-library298.js.map +1 -1
- package/lib/sd-component-library314.js +52 -20
- package/lib/sd-component-library314.js.map +1 -1
- package/lib/sd-component-library315.js +20 -52
- package/lib/sd-component-library315.js.map +1 -1
- package/lib/sd-component-library316.js +47 -89
- package/lib/sd-component-library316.js.map +1 -1
- package/lib/sd-component-library317.js +89 -47
- package/lib/sd-component-library317.js.map +1 -1
- package/lib/sd-component-library318.js +34 -4
- package/lib/sd-component-library318.js.map +1 -1
- package/lib/sd-component-library320.js +5 -4
- package/lib/sd-component-library320.js.map +1 -1
- package/lib/sd-component-library321.js +4 -35
- package/lib/sd-component-library321.js.map +1 -1
- package/lib/sd-component-library323.js +1 -1
- package/lib/sd-component-library50.js +1 -1
- package/lib/sd-component-library51.js +1 -1
- package/lib/sd-component-library53.js +3 -3
- package/lib/sd-component-library54.js +2 -2
- package/lib/sd-component-library55.js +2 -2
- package/lib/sd-component-library6.js +1 -1
- package/lib/sd-component-library62.js +1 -1
- package/lib/sd-component-library63.js +1 -1
- package/lib/sd-component-library64.js +4 -4
- package/lib/sd-component-library65.js +1 -1
- package/lib/sd-component-library66.js +2 -2
- package/lib/sd-component-library67.js +1 -1
- package/lib/sd-component-library7.js +1 -1
- package/lib/sd-component-library72.js +2 -2
- package/lib/sd-component-library74.js +3 -3
- package/lib/sd-component-library76.js +2 -2
- package/lib/sd-component-library77.js +3 -3
- package/lib/sd-component-library78.js +1 -1
- package/lib/sd-component-library79.js +1 -1
- package/lib/sd-component-library81.js +1 -1
- package/lib/sd-component-library82.js +1 -1
- package/lib/sd-component-library83.js +28 -26
- package/lib/sd-component-library83.js.map +1 -1
- package/lib/sd-component-library87.js +1 -1
- package/lib/sd-component-library88.js +6 -6
- package/lib/sd-component-library89.js +2 -2
- package/lib/sd-component-library90.js +1 -1
- package/lib/sd-component-library91.js +5 -5
- package/lib/sd-component-library92.js +1 -1
- package/lib/sd-component-library94.js +6 -6
- package/lib/sd-component-library95.js +1 -1
- package/lib/sd-component-library96.js +7 -7
- package/lib/sd-component-library97.js +1 -1
- package/package.json +1 -1
|
@@ -1,56 +1,50 @@
|
|
|
1
|
-
import { j as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
import { ResponsiveTextV2 as v } from "./sd-component-library152.js";
|
|
6
|
-
const C = (x) => {
|
|
1
|
+
import { j as k } from "./sd-component-library198.js";
|
|
2
|
+
import { isValueInRange as w, getInnerX as E, getInnerY as O, degToRad as r, getCoordinateForArc as V } from "./sd-component-library93.js";
|
|
3
|
+
import { BaseNeedle as b } from "./sd-component-library318.js";
|
|
4
|
+
const G = (x) => {
|
|
7
5
|
const {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
6
|
+
diameter: f,
|
|
7
|
+
value: c,
|
|
8
|
+
arc: i,
|
|
9
|
+
ranges: o,
|
|
10
|
+
useSegmentedBehavior: v,
|
|
11
|
+
innerCircleRadius: I,
|
|
12
|
+
innerCircleStrokeWidth: A,
|
|
13
|
+
distanceFromRange: d,
|
|
14
|
+
needleWidth: e,
|
|
15
|
+
needleColor: C,
|
|
16
|
+
distanceBetweenRanges: l,
|
|
17
|
+
gaugeWidth: g
|
|
18
|
+
} = x, a = o.find(
|
|
19
|
+
({ start: s, end: y, bounds: N }) => w(c, s, y, N)
|
|
20
|
+
);
|
|
21
|
+
if (!a)
|
|
22
|
+
return null;
|
|
23
|
+
const u = f / 2, S = (360 - i) / 2, m = i - (o.length - 1) * l, { start: t, end: h, color: X } = a, Y = o.findIndex((s) => s === a), p = m * (h - t), R = S + l * Y + m * t, n = v ? R + p / 2 : R + (c - t) / (h - t) * p, { x: j, y: B } = V(u, n), F = E(
|
|
24
|
+
j,
|
|
25
|
+
r(n),
|
|
26
|
+
d + g + e / 2
|
|
27
|
+
), M = O(
|
|
28
|
+
B,
|
|
29
|
+
r(n),
|
|
30
|
+
d + g + e / 2
|
|
31
|
+
), T = e / 2 * Math.cos(r(n)), W = e / 2 * Math.sin(r(n));
|
|
32
|
+
return /* @__PURE__ */ k.jsx(
|
|
33
|
+
b,
|
|
21
34
|
{
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
borderBottomStyle: !e && t === "top" ? "none" : "solid",
|
|
32
|
-
borderRadius: e ? `${o}px ${o}px ${t !== "left" ? `${o}px` : "0"} ${t !== "right" ? `${o}px` : "0"}` : "0",
|
|
33
|
-
bg: "cl_white",
|
|
34
|
-
"& > div": {
|
|
35
|
-
maxWidth: t === "top" ? void 0 : `${u}px`
|
|
36
|
-
}
|
|
37
|
-
},
|
|
38
|
-
ref: i,
|
|
39
|
-
children: /* @__PURE__ */ s.jsx(
|
|
40
|
-
v,
|
|
41
|
-
{
|
|
42
|
-
width: "max-content",
|
|
43
|
-
fontSizeWeight: [[12, "semi-bold"]],
|
|
44
|
-
color: e && n !== "#CCD0DB" ? n : "cl_darkGrey",
|
|
45
|
-
textTransform: "uppercase",
|
|
46
|
-
letterSpacing: "1.8px",
|
|
47
|
-
children: d
|
|
48
|
-
}
|
|
49
|
-
)
|
|
35
|
+
dx: T,
|
|
36
|
+
dy: W,
|
|
37
|
+
color: C || X,
|
|
38
|
+
radius: u,
|
|
39
|
+
tipX: F,
|
|
40
|
+
tipY: M,
|
|
41
|
+
innerCircleStrokeWidth: A,
|
|
42
|
+
innerCircleRadius: I,
|
|
43
|
+
needleWidth: e
|
|
50
44
|
}
|
|
51
|
-
)
|
|
45
|
+
);
|
|
52
46
|
};
|
|
53
47
|
export {
|
|
54
|
-
|
|
48
|
+
G as OutlineMeterNeedle
|
|
55
49
|
};
|
|
56
50
|
//# sourceMappingURL=sd-component-library244.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sd-component-library244.js","sources":["../src/components/meters/outline-meter/partials/
|
|
1
|
+
{"version":3,"file":"sd-component-library244.js","sources":["../src/components/meters/outline-meter/partials/outline-meter-needle/outline-meter-needle.tsx"],"sourcesContent":["import React from \"react\";\n\nimport {\n degToRad,\n getCoordinateForArc,\n getInnerX,\n getInnerY,\n isValueInRange,\n} from \"../../utils\";\nimport { BaseNeedle } from \"../base-needle\";\nimport { OutlineMeterNeedleProps as Props } from \"./interfaces\";\n\nexport const OutlineMeterNeedle: React.FC<Props> = (props) => {\n const {\n diameter,\n value,\n arc,\n ranges,\n useSegmentedBehavior,\n innerCircleRadius,\n innerCircleStrokeWidth,\n distanceFromRange,\n needleWidth,\n needleColor,\n distanceBetweenRanges,\n gaugeWidth,\n } = props;\n\n const matchingRange = ranges.find(({ start, end, bounds }) =>\n isValueInRange(value, start, end, bounds)\n );\n\n if (!matchingRange) return null;\n\n const radius = diameter / 2;\n\n const arcStart = (360 - arc) / 2;\n const arcForRanges = arc - (ranges.length - 1) * distanceBetweenRanges;\n const { start, end, color } = matchingRange;\n const matchingRangeIndex = ranges.findIndex((r) => r === matchingRange);\n const rangeArc = arcForRanges * (end - start);\n\n const rangeArcStart =\n arcStart +\n distanceBetweenRanges * matchingRangeIndex +\n arcForRanges * start;\n\n const valueAlpha = useSegmentedBehavior\n ? rangeArcStart + rangeArc / 2\n : rangeArcStart + ((value - start) / (end - start)) * rangeArc;\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 || color}\n radius={radius}\n tipX={needleTipX}\n tipY={needleTipY}\n innerCircleStrokeWidth={innerCircleStrokeWidth}\n innerCircleRadius={innerCircleRadius}\n needleWidth={needleWidth}\n />\n );\n};\n"],"names":["OutlineMeterNeedle","props","diameter","value","arc","ranges","useSegmentedBehavior","innerCircleRadius","innerCircleStrokeWidth","distanceFromRange","needleWidth","needleColor","distanceBetweenRanges","gaugeWidth","matchingRange","start","end","bounds","isValueInRange","radius","arcStart","arcForRanges","color","matchingRangeIndex","r","rangeArc","rangeArcStart","valueAlpha","valueX","valueY","getCoordinateForArc","needleTipX","getInnerX","degToRad","needleTipY","getInnerY","dx","dy","jsx","BaseNeedle"],"mappings":";;;AAYa,MAAAA,IAAsC,CAACC,MAAU;AACtD,QAAA;AAAA,IACJ,UAAAC;AAAA,IACA,OAAAC;AAAA,IACA,KAAAC;AAAA,IACA,QAAAC;AAAA,IACA,sBAAAC;AAAA,IACA,mBAAAC;AAAA,IACA,wBAAAC;AAAA,IACA,mBAAAC;AAAA,IACA,aAAAC;AAAA,IACA,aAAAC;AAAA,IACA,uBAAAC;AAAA,IACA,YAAAC;AAAA,EACE,IAAAZ,GAEEa,IAAgBT,EAAO;AAAA,IAAK,CAAC,EAAE,OAAAU,GAAO,KAAAC,GAAK,QAAAC,QAC/CC,EAAef,GAAOY,GAAOC,GAAKC,CAAM;AAAA,EAAA;AAG1C,MAAI,CAACH;AAAsB,WAAA;AAE3B,QAAMK,IAASjB,IAAW,GAEpBkB,KAAY,MAAMhB,KAAO,GACzBiB,IAAejB,KAAOC,EAAO,SAAS,KAAKO,GAC3C,EAAE,OAAAG,GAAO,KAAAC,GAAK,OAAAM,EAAA,IAAUR,GACxBS,IAAqBlB,EAAO,UAAU,CAACmB,MAAMA,MAAMV,CAAa,GAChEW,IAAWJ,KAAgBL,IAAMD,IAEjCW,IACJN,IACAR,IAAwBW,IACxBF,IAAeN,GAEXY,IAAarB,IACfoB,IAAgBD,IAAW,IAC3BC,KAAkBvB,IAAQY,MAAUC,IAAMD,KAAUU,GAClD,EAAE,GAAGG,GAAQ,GAAGC,MAAWC,EAAoBX,GAAQQ,CAAU,GAEjEI,IAAaC;AAAA,IACjBJ;AAAA,IACAK,EAASN,CAAU;AAAA,IACnBlB,IAAoBI,IAAaH,IAAc;AAAA,EAAA,GAE3CwB,IAAaC;AAAA,IACjBN;AAAA,IACAI,EAASN,CAAU;AAAA,IACnBlB,IAAoBI,IAAaH,IAAc;AAAA,EAAA,GAG3C0B,IAAM1B,IAAc,IAAK,KAAK,IAAIuB,EAASN,CAAU,CAAC,GACtDU,IAAM3B,IAAc,IAAK,KAAK,IAAIuB,EAASN,CAAU,CAAC;AAG1D,SAAAW,gBAAAA,EAAA;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,IAAAH;AAAA,MACA,IAAAC;AAAA,MACA,OAAO1B,KAAeW;AAAA,MACtB,QAAAH;AAAA,MACA,MAAMY;AAAA,MACN,MAAMG;AAAA,MACN,wBAAA1B;AAAA,MACA,mBAAAD;AAAA,MACA,aAAAG;AAAA,IAAA;AAAA,EAAA;AAGN;"}
|
|
@@ -1,51 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
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
|
|
34
|
-
);
|
|
35
|
-
return {
|
|
36
|
-
startX: l,
|
|
37
|
-
startY: u,
|
|
38
|
-
endX: h,
|
|
39
|
-
endY: i,
|
|
40
|
-
startInnerX: f,
|
|
41
|
-
startInnerY: m,
|
|
42
|
-
endInnerX: g,
|
|
43
|
-
endInnerY: S,
|
|
44
|
-
arc: d
|
|
45
|
-
};
|
|
1
|
+
import { j as m } from "./sd-component-library198.js";
|
|
2
|
+
import { isValueInRange as x } from "./sd-component-library93.js";
|
|
3
|
+
import { BaseMeterLabelBox as u } from "./sd-component-library242.js";
|
|
4
|
+
const g = (t) => {
|
|
5
|
+
const { value: o, idx: e, totalRanges: n, start: s, end: r, bounds: a } = t, i = x(o, s, r, a), l = e === 0 ? "left" : e === n - 1 ? "right" : "top";
|
|
6
|
+
return /* @__PURE__ */ m.jsx(u, { isInRange: i, position: l, ...t });
|
|
46
7
|
};
|
|
47
8
|
export {
|
|
48
|
-
|
|
49
|
-
x as getSegmentCoordinates
|
|
9
|
+
g as OutlineMeterLabelBox
|
|
50
10
|
};
|
|
51
11
|
//# sourceMappingURL=sd-component-library245.js.map
|
|
@@ -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/outline-meter/partials/outline-meter-label-box/outline-meter-label-box.tsx"],"sourcesContent":["import React from \"react\";\n\nimport { isValueInRange } from \"../../utils\";\nimport { BaseMeterLabelBox } from \"../base-meter-label-box\";\nimport { OutlineMeterLabelBoxProps as Props } from \"./interfaces\";\n\nexport const OutlineMeterLabelBox: React.FC<Props> = (props) => {\n const { value, idx, totalRanges, start, end, bounds } = props;\n\n const isInRange = isValueInRange(value, start, end, bounds);\n const position =\n idx === 0 ? \"left\" : idx === totalRanges - 1 ? \"right\" : \"top\";\n\n return (\n <BaseMeterLabelBox isInRange={isInRange} position={position} {...props} />\n );\n};\n"],"names":["OutlineMeterLabelBox","props","value","idx","totalRanges","start","end","bounds","isInRange","isValueInRange","position","jsx","BaseMeterLabelBox"],"mappings":";;;AAMa,MAAAA,IAAwC,CAACC,MAAU;AAC9D,QAAM,EAAE,OAAAC,GAAO,KAAAC,GAAK,aAAAC,GAAa,OAAAC,GAAO,KAAAC,GAAK,QAAAC,EAAW,IAAAN,GAElDO,IAAYC,EAAeP,GAAOG,GAAOC,GAAKC,CAAM,GACpDG,IACJP,MAAQ,IAAI,SAASA,MAAQC,IAAc,IAAI,UAAU;AAE3D,SACGO,gBAAAA,EAAAA,IAAAC,GAAA,EAAkB,WAAAJ,GAAsB,UAAAE,GAAqB,GAAGT,EAAO,CAAA;AAE5E;"}
|
|
@@ -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-library93.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-library246.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sd-component-library246.js","sources":["../src/components/meters/donut-diagram/
|
|
1
|
+
{"version":3,"file":"sd-component-library246.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;AAE7B,QADgBR,EAASQ,IAAI,CAAC,EAClB,QAAQC,EAAe;AACrC,aAAAL,EAAU,4DAA4D,GAC/D;AAAA,EAEX;AAEO,SAAA;AACT,GAEaM,IAAwB,CACnC,EAAE,OAAAR,GAAO,KAAAC,EAAI,GACbQ,GACAC,MACG;AACH,QAAMC,IAAcF,IAASC,GAEvBE,IAAa,KAAK,MAAMZ,IAAQ,GAAG,GACnCa,IAAW,KAAK,MAAMZ,IAAM,GAAG,GAC/Ba,IAAMD,IAAWD,GAEjB,EAAE,GAAGG,GAAQ,GAAGC,MAAWC,EAAoBR,GAAQG,CAAU,GACjE,EAAE,GAAGM,GAAa,GAAGC,EAAgB,IAAAF;AAAA,IACzCN;AAAA,IACAC;AAAA,IACAH;AAAA,EAAA,GAGI,EAAE,GAAGW,GAAM,GAAGC,MAASJ,EAAoBR,GAAQI,CAAQ,GAC3D,EAAE,GAAGS,GAAW,GAAGC,EAAc,IAAAN;AAAA,IACrCN;AAAA,IACAE;AAAA,IACAJ;AAAA,EAAA;AAEK,SAAA;AAAA,IACL,QAAAM;AAAA,IACA,QAAAC;AAAA,IACA,MAAAI;AAAA,IACA,MAAAC;AAAA,IACA,aAAAH;AAAA,IACA,aAAAC;AAAA,IACA,WAAAG;AAAA,IACA,WAAAC;AAAA,IACA,KAAAT;AAAA,EAAA;AAEJ;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { j as n } from "./sd-component-library198.js";
|
|
2
2
|
import g from "./sd-component-library197.js";
|
|
3
|
-
import { getSegmentCoordinates as I } from "./sd-component-
|
|
3
|
+
import { getSegmentCoordinates as I } from "./sd-component-library246.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-library198.js";
|
|
2
|
+
import { useHover as Z } from "./sd-component-library3.js";
|
|
3
|
+
import { getCoordinateForArc as l } from "./sd-component-library93.js";
|
|
4
|
+
import { getSegmentCoordinates as O } from "./sd-component-library246.js";
|
|
5
|
+
import { SegmentLabel as q } from "./sd-component-library325.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-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/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,UAAA;AAAA,IAAAS,gBAAAA,EAAA;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,GAAG,IAAIb,CAAM,IAAIA,CAAM,KAAKQ,CAAU,IAAIC,CAAU,KAAKF,CAAS,IAAIA,CAAS,MAC7ET,IAAM,MAAM,MAAM,GACpB,MAAMa,CAAQ,IAAIC,CAAQ;AAAA,QAC1B,MAAK;AAAA,MAAA;AAAA,IACP;AAAA,IAGAC,gBAAAA,EAAA;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,GAAG,IAAIb,CAAM,IAAIA,CAAM,KAAKH,CAAM,IAAID,CAAM,KAAKR,CAAM,IAAIA,CAAM,MAC/DU,IAAM,MAAM,MAAM,GACpB,MAAMJ,CAAI,IAAIC,CAAI;AAAA,QAClB,MAAMT;AAAA,QACN,aAAaN;AAAA,QACb,QAAO;AAAA,MAAA;AAAA,IACT;AAAA,IAGAiC,gBAAAA,EAAA;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,GAAG,IAAIb,CAAM,IAAIA,CAAM,KAAKV,CAAW,IAAIC,CAAW,KAAKF,CAAW,IAAIA,CAAW,MACnFS,IAAM,MAAM,MAAM,GACpB,MAAMN,CAAS,IAAIC,CAAS;AAAA,QAC5B,MAAK;AAAA,QACL,OAAO;AAAA,UACL,WAAW,SAASa,IAAY,MAAM,CAAC;AAAA,UACvC,iBAAiB;AAAA,UACjB,YAAY,OAAO9B,CAAiB;AAAA,QACtC;AAAA,MAAA;AAAA,IACF;AAAA,IAEAqC,gBAAAA,EAAA;AAAA,MAACC;AAAA,MAAA;AAAA,QACC,SAAApC;AAAA,QACA,QAAAU;AAAA,QACA,mBAAAZ;AAAA,QACA,SAAS8B;AAAA,QACT,QAAAxB;AAAA,QACC,GAAGC;AAAA,MAAA;AAAA,IACN;AAAA,EACF,EAAA,CAAA;AAEJ;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { j as o } from "./sd-component-library198.js";
|
|
2
|
-
import { LogoButton as e } from "./sd-component-
|
|
3
|
-
import { ReactComponent as r } from "./sd-component-
|
|
2
|
+
import { LogoButton as e } from "./sd-component-library208.js";
|
|
3
|
+
import { ReactComponent as r } from "./sd-component-library209.js";
|
|
4
4
|
const p = (t) => /* @__PURE__ */ o.jsx(
|
|
5
5
|
e,
|
|
6
6
|
{
|
|
@@ -1,23 +1,24 @@
|
|
|
1
|
-
import { j as
|
|
2
|
-
import {
|
|
3
|
-
const
|
|
4
|
-
|
|
1
|
+
import { j as x } from "./sd-component-library198.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-library250.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sd-component-library250.js","sources":["../src/components/meters/linear-gauge-meter-partials/linear-gauge-
|
|
1
|
+
{"version":3,"file":"sd-component-library250.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-library198.js";
|
|
2
|
+
import { ResponsiveTextV2 as r } from "./sd-component-library152.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-library251.js.map
|