@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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sd-component-library240.js","sources":["../src/components/meters/gradient-outline-meter/
|
|
1
|
+
{"version":3,"file":"sd-component-library240.js","sources":["../src/components/meters/gradient-outline-meter/partials/gradient-meter-needle/gradient-meter-needle.tsx"],"sourcesContent":["import React 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 { getFractionColor } from \"../../utils\";\nimport { GradientMeterNeedleProps as Props } from \"./interfaces\";\n\nexport const GradientMeterNeedle: React.FC<Props> = (props) => {\n const {\n ranges,\n distanceFromRange,\n innerCircleRadius,\n innerCircleStrokeWidth,\n needleWidth,\n arc,\n value,\n gaugeWidth,\n diameter,\n needleColor,\n } = props;\n const radius = diameter / 2;\n const totalRanges = ranges.length;\n const valueRangeIndex = Math.floor(value * totalRanges);\n const startColor = ranges[valueRangeIndex][0];\n const endColor = ranges[valueRangeIndex][1];\n\n const arcStart = (360 - arc) / 2; // deg\n\n const rangeArcStart = arcStart + (arc * valueRangeIndex) / totalRanges;\n const rangeArcEnd = arcStart + (arc * (valueRangeIndex + 1)) / totalRanges;\n const start = valueRangeIndex / totalRanges;\n const end = (valueRangeIndex + 1) / totalRanges;\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 valueAlpha =\n rangeArcStart + (((value - start) / (end - start)) * arc) / ranges.length;\n const { x: valueX, y: valueY } = getCoordinateForArc(radius, valueAlpha);\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 const useHorizontalGradient = valueRangeIndex + 1 === totalRanges / 2 + 0.5;\n\n const fraction = useHorizontalGradient\n ? (valueX - rangeStartX) / (rangeEndX - rangeStartX)\n : (valueY - rangeStartY) / (rangeEndY - rangeStartY);\n const color = getFractionColor(fraction, startColor, endColor);\n\n return (\n <BaseNeedle\n radius={radius}\n innerCircleRadius={innerCircleRadius}\n innerCircleStrokeWidth={innerCircleStrokeWidth}\n needleWidth={needleWidth}\n color={needleColor || color}\n dx={dx}\n dy={dy}\n tipX={needleTipX}\n tipY={needleTipY}\n />\n );\n};\n"],"names":["GradientMeterNeedle","props","ranges","distanceFromRange","innerCircleRadius","innerCircleStrokeWidth","needleWidth","arc","value","gaugeWidth","diameter","needleColor","radius","totalRanges","valueRangeIndex","startColor","endColor","arcStart","rangeArcStart","rangeArcEnd","start","end","rangeStartX","rangeStartY","getCoordinateForArc","rangeEndX","rangeEndY","valueAlpha","valueX","valueY","needleTipX","getInnerX","degToRad","needleTipY","getInnerY","dx","dy","fraction","color","getFractionColor","jsx","BaseNeedle"],"mappings":";;;;AAYa,MAAAA,IAA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IAASN,MAAgBG,IAAYH,MACrCO,IAASN,MAAgBG,IAAYH,IACpCe,IAAQC,EAAiBF,GAAUtB,GAAYC,CAAQ;AAG3D,SAAAwB,gBAAAA,EAAA;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,QAAA7B;AAAA,MACA,mBAAAR;AAAA,MACA,wBAAAC;AAAA,MACA,aAAAC;AAAA,MACA,OAAOK,KAAe2B;AAAA,MACtB,IAAAH;AAAA,MACA,IAAAC;AAAA,MACA,MAAMN;AAAA,MACN,MAAMG;AAAA,IAAA;AAAA,EAAA;AAGZ;"}
|
|
@@ -1,112 +1,27 @@
|
|
|
1
|
-
import { j as
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
const {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
r,
|
|
24
|
-
j
|
|
25
|
-
);
|
|
26
|
-
if (v || !k)
|
|
27
|
-
return /* @__PURE__ */ t.jsx(
|
|
28
|
-
X,
|
|
29
|
-
{
|
|
30
|
-
startX: u,
|
|
31
|
-
startY: h,
|
|
32
|
-
endX: m,
|
|
33
|
-
endY: y,
|
|
34
|
-
startAlpha: g,
|
|
35
|
-
endAlpha: j,
|
|
36
|
-
color: v || i > x ? `url(#gradient-${f}-${Y})` : w,
|
|
37
|
-
radius: r,
|
|
38
|
-
width: e
|
|
39
|
-
}
|
|
40
|
-
);
|
|
41
|
-
const o = g + (i - c) / (x - c) * l / n, { x: a, y: s } = A(r, o), F = H(a, E(o), e), B = M(s, E(o), e), D = d >= n / 2, S = d + 1 === n / 2 + 0.5, z = S ? (a - u) / (m - u) : (s - h) / (y - h), p = O(z, f, Y);
|
|
42
|
-
return /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
|
|
43
|
-
/* @__PURE__ */ t.jsx("defs", { children: /* @__PURE__ */ t.jsxs(
|
|
44
|
-
"linearGradient",
|
|
45
|
-
{
|
|
46
|
-
id: `value-gradient-${p}`,
|
|
47
|
-
...D ? {
|
|
48
|
-
x1: 0,
|
|
49
|
-
y1: 0,
|
|
50
|
-
x2: 0,
|
|
51
|
-
y2: 1
|
|
52
|
-
} : S ? { x1: 0, y1: 0, x2: 1, y2: 0 } : {
|
|
53
|
-
x1: 0,
|
|
54
|
-
y1: 1,
|
|
55
|
-
x2: 0,
|
|
56
|
-
y2: 0
|
|
57
|
-
},
|
|
58
|
-
children: [
|
|
59
|
-
/* @__PURE__ */ t.jsx("stop", { stopColor: f, offset: "0%" }),
|
|
60
|
-
/* @__PURE__ */ t.jsx("stop", { stopColor: p, offset: "100%" })
|
|
61
|
-
]
|
|
62
|
-
}
|
|
63
|
-
) }),
|
|
64
|
-
/* @__PURE__ */ t.jsxs("g", { children: [
|
|
65
|
-
/* @__PURE__ */ t.jsx(
|
|
66
|
-
X,
|
|
67
|
-
{
|
|
68
|
-
startX: u,
|
|
69
|
-
startY: h,
|
|
70
|
-
endX: a,
|
|
71
|
-
endY: s,
|
|
72
|
-
startAlpha: g,
|
|
73
|
-
endAlpha: o,
|
|
74
|
-
color: `url(#value-gradient-${p})`,
|
|
75
|
-
radius: r,
|
|
76
|
-
width: e,
|
|
77
|
-
roundEnd: !1
|
|
78
|
-
}
|
|
79
|
-
),
|
|
80
|
-
/* @__PURE__ */ t.jsx(
|
|
81
|
-
X,
|
|
82
|
-
{
|
|
83
|
-
startX: a,
|
|
84
|
-
startY: s,
|
|
85
|
-
endX: m,
|
|
86
|
-
endY: y,
|
|
87
|
-
startAlpha: o,
|
|
88
|
-
endAlpha: j,
|
|
89
|
-
color: w,
|
|
90
|
-
radius: r,
|
|
91
|
-
width: e,
|
|
92
|
-
roundStart: !1
|
|
93
|
-
}
|
|
94
|
-
),
|
|
95
|
-
/* @__PURE__ */ t.jsx(
|
|
96
|
-
"circle",
|
|
97
|
-
{
|
|
98
|
-
cx: (a + F) / 2,
|
|
99
|
-
cy: (s + B) / 2,
|
|
100
|
-
r: C + W,
|
|
101
|
-
strokeWidth: C,
|
|
102
|
-
stroke: $ || p,
|
|
103
|
-
fill: "white"
|
|
104
|
-
}
|
|
105
|
-
)
|
|
106
|
-
] })
|
|
107
|
-
] });
|
|
1
|
+
import { j as p } from "./sd-component-library198.js";
|
|
2
|
+
const m = (a) => {
|
|
3
|
+
const { position: s, diameter: t, rangeY: e, rangeX: n, distanceFromRanges: r, isInRange: o } = a;
|
|
4
|
+
if (o)
|
|
5
|
+
return null;
|
|
6
|
+
const { startX: d, startY: i, endX: X, endY: Y } = s === "left" ? {
|
|
7
|
+
startX: n || 0,
|
|
8
|
+
startY: e || t / 2 - 0.5,
|
|
9
|
+
endX: -r,
|
|
10
|
+
endY: t / 2 - 0.5
|
|
11
|
+
} : s === "top" ? {
|
|
12
|
+
startX: n || t / 2,
|
|
13
|
+
startY: e || 0,
|
|
14
|
+
endX: t / 2,
|
|
15
|
+
endY: -r
|
|
16
|
+
} : {
|
|
17
|
+
startX: n || t,
|
|
18
|
+
startY: e || t / 2 - 0.5,
|
|
19
|
+
endX: t + r,
|
|
20
|
+
endY: t / 2 - 0.5
|
|
21
|
+
};
|
|
22
|
+
return /* @__PURE__ */ p.jsx("path", { d: `M${d},${i} L${X},${Y}`, stroke: "#CCD0DB" });
|
|
108
23
|
};
|
|
109
24
|
export {
|
|
110
|
-
|
|
25
|
+
m as OutlineMeterLabelPointer
|
|
111
26
|
};
|
|
112
27
|
//# sourceMappingURL=sd-component-library241.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sd-component-library241.js","sources":["../src/components/meters/
|
|
1
|
+
{"version":3,"file":"sd-component-library241.js","sources":["../src/components/meters/outline-meter/partials/outline-meter-label-pointer/outline-meter-label-pointer.tsx"],"sourcesContent":["import React from \"react\";\n\nimport { OutlineMeterLabelPointerProps as Props } from \"./interfaces\";\n\nexport const OutlineMeterLabelPointer: React.FC<Props> = (props) => {\n const { position, diameter, rangeY, rangeX, distanceFromRanges, isInRange } =\n props;\n\n if (isInRange) return null;\n\n const { startX, startY, endX, endY } =\n position === \"left\"\n ? {\n startX: rangeX || 0,\n startY: rangeY || diameter / 2 - 0.5,\n endX: -distanceFromRanges,\n endY: diameter / 2 - 0.5,\n }\n : position === \"top\"\n ? {\n startX: rangeX || diameter / 2,\n startY: rangeY || 0,\n endX: diameter / 2,\n endY: -distanceFromRanges,\n }\n : {\n startX: rangeX || diameter,\n startY: rangeY || diameter / 2 - 0.5,\n endX: diameter + distanceFromRanges,\n endY: diameter / 2 - 0.5,\n };\n\n return (\n <path d={`M${startX},${startY} L${endX},${endY}`} stroke={\"#CCD0DB\"} />\n );\n};\n"],"names":["OutlineMeterLabelPointer","props","position","diameter","rangeY","rangeX","distanceFromRanges","isInRange","startX","startY","endX","endY","jsx"],"mappings":";AAIa,MAAAA,IAA4C,CAACC,MAAU;AAClE,QAAM,EAAE,UAAAC,GAAU,UAAAC,GAAU,QAAAC,GAAQ,QAAAC,GAAQ,oBAAAC,GAAoB,WAAAC,EAC9D,IAAAN;AAEE,MAAAM;AAAkB,WAAA;AAEtB,QAAM,EAAE,QAAAC,GAAQ,QAAAC,GAAQ,MAAAC,GAAM,MAAAC,EAAK,IACjCT,MAAa,SACT;AAAA,IACE,QAAQG,KAAU;AAAA,IAClB,QAAQD,KAAUD,IAAW,IAAI;AAAA,IACjC,MAAM,CAACG;AAAA,IACP,MAAMH,IAAW,IAAI;AAAA,EAAA,IAEvBD,MAAa,QACb;AAAA,IACE,QAAQG,KAAUF,IAAW;AAAA,IAC7B,QAAQC,KAAU;AAAA,IAClB,MAAMD,IAAW;AAAA,IACjB,MAAM,CAACG;AAAA,EAAA,IAET;AAAA,IACE,QAAQD,KAAUF;AAAA,IAClB,QAAQC,KAAUD,IAAW,IAAI;AAAA,IACjC,MAAMA,IAAWG;AAAA,IACjB,MAAMH,IAAW,IAAI;AAAA,EAAA;AAG7B,SACGS,gBAAAA,EAAAA,IAAA,QAAA,EAAK,GAAG,IAAIJ,CAAM,IAAIC,CAAM,KAAKC,CAAI,IAAIC,CAAI,IAAI,QAAQ,UAAW,CAAA;AAEzE;"}
|
|
@@ -1,50 +1,56 @@
|
|
|
1
|
-
import { j as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
1
|
+
import { j as s } from "./sd-component-library198.js";
|
|
2
|
+
import { useRef as g, useState as $, useEffect as b } from "react";
|
|
3
|
+
import { Box as l } from "rebass";
|
|
4
|
+
import { labelPaddingX as o, labelWidth as u } from "./sd-component-library230.js";
|
|
5
|
+
import { ResponsiveTextV2 as v } from "./sd-component-library152.js";
|
|
6
|
+
const C = (x) => {
|
|
6
7
|
const {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
), { x: j, y: F } = i(
|
|
21
|
-
s,
|
|
22
|
-
E
|
|
23
|
-
), o = m + (l - p) / (M - p) * a / r.length, { x: C, y: f } = i(s, o), G = k(
|
|
24
|
-
C,
|
|
25
|
-
c(o),
|
|
26
|
-
d + g + n / 2
|
|
27
|
-
), I = B(
|
|
28
|
-
f,
|
|
29
|
-
c(o),
|
|
30
|
-
d + g + n / 2
|
|
31
|
-
), T = n / 2 * Math.cos(c(o)), W = n / 2 * Math.sin(c(o)), z = t + 1 === e / 2 + 0.5 ? (C - h) / (j - h) : (f - x) / (F - x), H = b(z, y, A);
|
|
32
|
-
return /* @__PURE__ */ N.jsx(
|
|
33
|
-
q,
|
|
8
|
+
position: t,
|
|
9
|
+
diameter: r,
|
|
10
|
+
label: d,
|
|
11
|
+
distanceFromLabelToRanges: p,
|
|
12
|
+
isInRange: e,
|
|
13
|
+
color: n
|
|
14
|
+
} = x, i = g(), [c, a] = $(0);
|
|
15
|
+
b(() => {
|
|
16
|
+
i.current && a(i.current.getBoundingClientRect().height);
|
|
17
|
+
}, [i]);
|
|
18
|
+
const h = t === "right" ? `${r + p}px` : t === "top" ? `${r / 2}px` : void 0, m = t === "left" ? `${r + p}px` : void 0, f = t === "left" || t === "right" ? `${r / 2}px` : `${-p}px`;
|
|
19
|
+
return /* @__PURE__ */ s.jsx(l, { sx: { position: "absolute", left: h, top: f, right: m }, children: /* @__PURE__ */ s.jsx(
|
|
20
|
+
l,
|
|
34
21
|
{
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
22
|
+
sx: {
|
|
23
|
+
position: "relative",
|
|
24
|
+
top: `-${c}px`,
|
|
25
|
+
left: t === "top" ? "-50%" : void 0,
|
|
26
|
+
py: "7px",
|
|
27
|
+
px: e ? `${o}px` : "0",
|
|
28
|
+
borderColor: e ? n : "cl_lightGrey",
|
|
29
|
+
borderWidth: e ? "2px" : "1pt",
|
|
30
|
+
borderStyle: e ? "solid" : "none",
|
|
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
|
+
)
|
|
44
50
|
}
|
|
45
|
-
);
|
|
51
|
+
) });
|
|
46
52
|
};
|
|
47
53
|
export {
|
|
48
|
-
|
|
54
|
+
C as BaseMeterLabelBox
|
|
49
55
|
};
|
|
50
56
|
//# sourceMappingURL=sd-component-library242.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sd-component-library242.js","sources":["../src/components/meters/
|
|
1
|
+
{"version":3,"file":"sd-component-library242.js","sources":["../src/components/meters/outline-meter/partials/base-meter-label-box/base-meter-label-box.tsx"],"sourcesContent":["import React, { useEffect, useRef, useState } from \"react\";\n\nimport { Box } from \"rebass\";\n\nimport { ResponsiveTextV2 } from \"../../../../texts/responsive-text-v2\";\nimport { labelPaddingX, labelWidth } from \"../../contants\";\nimport { BaseMeterLabelBoxProps as Props } from \"./interfaces\";\n\nexport const BaseMeterLabelBox: React.FC<Props> = (props) => {\n const {\n position,\n diameter,\n label,\n distanceFromLabelToRanges,\n isInRange,\n color,\n } = props;\n const ref = useRef<HTMLElement>();\n const [textHeight, setTextHeight] = useState(0);\n\n useEffect(() => {\n if (ref.current) setTextHeight(ref.current.getBoundingClientRect().height);\n }, [ref]);\n\n const left =\n position === \"right\"\n ? `${diameter + distanceFromLabelToRanges}px`\n : position === \"top\"\n ? `${diameter / 2}px`\n : undefined;\n const right =\n position === \"left\"\n ? `${diameter + distanceFromLabelToRanges}px`\n : undefined;\n const top =\n position === \"left\" || position === \"right\"\n ? `${diameter / 2}px`\n : `${-distanceFromLabelToRanges}px`;\n\n return (\n <Box sx={{ position: \"absolute\", left, top, right }}>\n <Box\n sx={{\n position: \"relative\",\n top: `-${textHeight}px`,\n left: position === \"top\" ? \"-50%\" : undefined,\n py: \"7px\",\n px: isInRange ? `${labelPaddingX}px` : \"0\",\n borderColor: isInRange ? color : \"cl_lightGrey\",\n borderWidth: isInRange ? \"2px\" : \"1pt\",\n borderStyle: isInRange ? \"solid\" : \"none\",\n borderBottomStyle:\n !isInRange && position === \"top\" ? \"none\" : \"solid\",\n borderRadius: isInRange\n ? `${labelPaddingX}px ${labelPaddingX}px ${\n position !== \"left\" ? `${labelPaddingX}px` : \"0\"\n } ${position !== \"right\" ? `${labelPaddingX}px` : \"0\"}`\n : \"0\",\n bg: \"cl_white\",\n \"& > div\": {\n maxWidth: position === \"top\" ? undefined : `${labelWidth}px`,\n },\n }}\n ref={ref}\n >\n <ResponsiveTextV2\n width=\"max-content\"\n fontSizeWeight={[[12, \"semi-bold\"]]}\n color={isInRange && color !== \"#CCD0DB\" ? color : \"cl_darkGrey\"}\n textTransform=\"uppercase\"\n letterSpacing=\"1.8px\"\n >\n {label}\n </ResponsiveTextV2>\n </Box>\n </Box>\n );\n};\n"],"names":["BaseMeterLabelBox","props","position","diameter","label","distanceFromLabelToRanges","isInRange","color","ref","useRef","textHeight","setTextHeight","useState","useEffect","left","right","top","jsx","Box","labelPaddingX","labelWidth","ResponsiveTextV2"],"mappings":";;;;;AAQa,MAAAA,IAAqC,CAACC,MAAU;AACrD,QAAA;AAAA,IACJ,UAAAC;AAAA,IACA,UAAAC;AAAA,IACA,OAAAC;AAAA,IACA,2BAAAC;AAAA,IACA,WAAAC;AAAA,IACA,OAAAC;AAAA,EACE,IAAAN,GACEO,IAAMC,KACN,CAACC,GAAYC,CAAa,IAAIC,EAAS,CAAC;AAE9C,EAAAC,EAAU,MAAM;AACd,IAAIL,EAAI,WAASG,EAAcH,EAAI,QAAQ,sBAAsB,EAAE,MAAM;AAAA,EAAA,GACxE,CAACA,CAAG,CAAC;AAER,QAAMM,IACJZ,MAAa,UACT,GAAGC,IAAWE,CAAyB,OACvCH,MAAa,QACb,GAAGC,IAAW,CAAC,OACf,QACAY,IACJb,MAAa,SACT,GAAGC,IAAWE,CAAyB,OACvC,QACAW,IACJd,MAAa,UAAUA,MAAa,UAChC,GAAGC,IAAW,CAAC,OACf,GAAG,CAACE,CAAy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|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
1
|
+
import { j as e } from "./sd-component-library198.js";
|
|
2
|
+
import U from "react";
|
|
3
|
+
import { isValueInRange as Z, inValueHigherThanRange as F, getCoordinateForArc as d, getInnerX as $, getInnerY as tt, degToRad as L } from "./sd-component-library93.js";
|
|
4
|
+
import { BaseOutlineArc as X } from "./sd-component-library319.js";
|
|
5
|
+
import { OutlineMeterLabelPointer as O } from "./sd-component-library241.js";
|
|
6
|
+
const st = U.forwardRef(
|
|
7
|
+
(D, M) => {
|
|
8
|
+
const {
|
|
9
|
+
start: n,
|
|
10
|
+
end: r,
|
|
11
|
+
color: x,
|
|
12
|
+
bounds: R,
|
|
13
|
+
diameter: o,
|
|
14
|
+
arc: v,
|
|
15
|
+
distanceBetweenRanges: l,
|
|
16
|
+
totalRanges: y,
|
|
17
|
+
value: g,
|
|
18
|
+
gaugeWidth: s,
|
|
19
|
+
segmented: f,
|
|
20
|
+
idx: m,
|
|
21
|
+
pointStrokeWidth: I,
|
|
22
|
+
innerPointRadius: T,
|
|
23
|
+
distanceFromRanges: b,
|
|
24
|
+
label: w,
|
|
25
|
+
labelPosition: V,
|
|
26
|
+
hideLabels: E,
|
|
27
|
+
connected: _
|
|
28
|
+
} = D, S = "#CCD0DB", A = v - (y - 1) * l, H = A * (r - n), Y = Z(g, n, r, R), q = (360 - v) / 2, t = o / 2, a = q + l * m + A * n, C = _ && F(g, r, R), i = a + A * (r - n) + (C ? l : 0), { x: P, y: j } = d(
|
|
29
|
+
t,
|
|
30
|
+
a
|
|
31
|
+
), { x: W, y: k } = d(
|
|
32
|
+
t,
|
|
33
|
+
i
|
|
34
|
+
), u = V || m === 0 ? "left" : m === y - 1 ? "right" : "top";
|
|
35
|
+
if (f || !Y) {
|
|
36
|
+
const J = f && Y || !f && F(g, r, R) ? x : S, B = C ? i - l : i, { y: K } = d(
|
|
37
|
+
t,
|
|
38
|
+
B
|
|
39
|
+
), { x: N, y: Q } = d(
|
|
40
|
+
t,
|
|
41
|
+
(a + B) / 2
|
|
42
|
+
);
|
|
43
|
+
return /* @__PURE__ */ e.jsxs("g", { children: [
|
|
44
|
+
/* @__PURE__ */ e.jsx(
|
|
45
|
+
X,
|
|
46
|
+
{
|
|
47
|
+
startX: P,
|
|
48
|
+
startY: j,
|
|
49
|
+
endX: W,
|
|
50
|
+
endY: k,
|
|
51
|
+
startAlpha: a,
|
|
52
|
+
endAlpha: i,
|
|
53
|
+
color: J,
|
|
54
|
+
radius: t,
|
|
55
|
+
width: s
|
|
56
|
+
}
|
|
57
|
+
),
|
|
58
|
+
!E && w && /* @__PURE__ */ e.jsx(
|
|
59
|
+
O,
|
|
60
|
+
{
|
|
61
|
+
diameter: o,
|
|
62
|
+
position: u,
|
|
63
|
+
distanceFromRanges: b,
|
|
64
|
+
isInRange: Y,
|
|
65
|
+
...u === "right" && j > o / 2 || u === "left" && K > o / 2 ? {
|
|
66
|
+
rangeX: N,
|
|
67
|
+
rangeY: Q
|
|
68
|
+
} : void 0
|
|
69
|
+
}
|
|
70
|
+
)
|
|
71
|
+
] });
|
|
72
|
+
}
|
|
73
|
+
const c = a + (g - n) / (r - n) * H, { x: h, y: p } = d(t, c), z = $(h, L(c), s), G = tt(p, L(c), s);
|
|
74
|
+
return /* @__PURE__ */ e.jsxs("g", { children: [
|
|
75
|
+
/* @__PURE__ */ e.jsx(
|
|
76
|
+
X,
|
|
77
|
+
{
|
|
78
|
+
startX: P,
|
|
79
|
+
startY: j,
|
|
80
|
+
endX: h,
|
|
81
|
+
endY: p,
|
|
82
|
+
startAlpha: a,
|
|
83
|
+
endAlpha: c,
|
|
84
|
+
color: x,
|
|
85
|
+
radius: t,
|
|
86
|
+
width: s,
|
|
87
|
+
roundEnd: !1
|
|
88
|
+
}
|
|
89
|
+
),
|
|
90
|
+
/* @__PURE__ */ e.jsx(
|
|
91
|
+
X,
|
|
92
|
+
{
|
|
93
|
+
startX: h,
|
|
94
|
+
startY: p,
|
|
95
|
+
endX: W,
|
|
96
|
+
endY: k,
|
|
97
|
+
startAlpha: c,
|
|
98
|
+
endAlpha: i,
|
|
99
|
+
color: S,
|
|
100
|
+
radius: t,
|
|
101
|
+
width: s,
|
|
102
|
+
roundStart: !1
|
|
103
|
+
}
|
|
104
|
+
),
|
|
105
|
+
/* @__PURE__ */ e.jsx(
|
|
106
|
+
"circle",
|
|
107
|
+
{
|
|
108
|
+
cx: (h + z) / 2,
|
|
109
|
+
cy: (p + G) / 2,
|
|
110
|
+
r: I + T,
|
|
111
|
+
strokeWidth: I,
|
|
112
|
+
stroke: x,
|
|
113
|
+
fill: "white",
|
|
114
|
+
ref: M
|
|
115
|
+
}
|
|
116
|
+
),
|
|
117
|
+
!E && w && /* @__PURE__ */ e.jsx(
|
|
118
|
+
O,
|
|
119
|
+
{
|
|
120
|
+
diameter: o,
|
|
121
|
+
isInRange: !0,
|
|
122
|
+
position: u,
|
|
123
|
+
distanceFromRanges: b
|
|
124
|
+
}
|
|
125
|
+
)
|
|
126
|
+
] });
|
|
127
|
+
}
|
|
128
|
+
);
|
|
24
129
|
export {
|
|
25
|
-
|
|
130
|
+
st as OutlineMeterRange
|
|
26
131
|
};
|
|
27
132
|
//# sourceMappingURL=sd-component-library243.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sd-component-library243.js","sources":["../src/components/meters/outline-meter/partials/outline-meter-
|
|
1
|
+
{"version":3,"file":"sd-component-library243.js","sources":["../src/components/meters/outline-meter/partials/outline-meter-range/outline-meter-range.tsx"],"sourcesContent":["import React from \"react\";\n\nimport {\n degToRad,\n getCoordinateForArc,\n getInnerX,\n getInnerY,\n inValueHigherThanRange,\n isValueInRange,\n} from \"../../utils\";\nimport { BaseOutlineArc } from \"../base-outline-arc\";\nimport { OutlineMeterLabelPointer } from \"../outline-meter-label-pointer\";\nimport { OutlineMeterRangeProps as Props } from \"./interfaces\";\n\nexport const OutlineMeterRange = React.forwardRef<SVGCircleElement, Props>(\n (props, pointRef) => {\n const {\n start,\n end,\n color,\n bounds,\n diameter,\n arc,\n distanceBetweenRanges,\n totalRanges,\n value,\n gaugeWidth,\n segmented,\n idx,\n pointStrokeWidth,\n innerPointRadius,\n distanceFromRanges,\n label,\n labelPosition,\n hideLabels,\n connected,\n } = props;\n\n const grey = \"#CCD0DB\";\n\n /* Arc value (in degrees) used for all ranges. */\n const arcForRanges = arc - (totalRanges - 1) * distanceBetweenRanges;\n\n /* Arc value for the current range. */\n const rangeArc = arcForRanges * (end - start);\n const valueWithinRange = isValueInRange(value, start, end, bounds);\n\n const arcStart = (360 - arc) / 2; // deg\n\n const radius = diameter / 2;\n\n const rangeArcStart =\n arcStart + distanceBetweenRanges * idx + arcForRanges * start;\n const needConnection =\n connected && inValueHigherThanRange(value, end, bounds);\n const rangeArcEnd =\n rangeArcStart +\n arcForRanges * (end - start) +\n (needConnection ? distanceBetweenRanges : 0);\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 calculatedLabelPosition =\n labelPosition || idx === 0\n ? \"left\"\n : idx === totalRanges - 1\n ? \"right\"\n : \"top\";\n\n /* When range will be filled completely. */\n if (segmented || !valueWithinRange) {\n const fillColor =\n (segmented && valueWithinRange) ||\n (!segmented && inValueHigherThanRange(value, end, bounds))\n ? color\n : grey;\n\n const adjustedRangeArcEnd = needConnection\n ? rangeArcEnd - distanceBetweenRanges\n : rangeArcEnd;\n const { y: adjustedRangeY } = getCoordinateForArc(\n radius,\n adjustedRangeArcEnd\n );\n const { x: rangeX, y: rangeY } = getCoordinateForArc(\n radius,\n (rangeArcStart + adjustedRangeArcEnd) / 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={fillColor}\n radius={radius}\n width={gaugeWidth}\n />\n {!hideLabels && label && (\n <OutlineMeterLabelPointer\n diameter={diameter}\n position={calculatedLabelPosition}\n distanceFromRanges={distanceFromRanges}\n isInRange={valueWithinRange}\n {...((calculatedLabelPosition === \"right\" &&\n rangeStartY > diameter / 2) ||\n (calculatedLabelPosition === \"left\" &&\n adjustedRangeY > diameter / 2)\n ? {\n rangeX,\n rangeY,\n }\n : undefined)}\n />\n )}\n </g>\n );\n }\n\n const valueAlpha =\n rangeArcStart + ((value - start) / (end - start)) * rangeArc;\n\n const { x: valueX, y: valueY } = getCoordinateForArc(radius, valueAlpha);\n const valueInnerX = getInnerX(valueX, degToRad(valueAlpha), gaugeWidth);\n const valueInnerY = getInnerY(valueY, degToRad(valueAlpha), gaugeWidth);\n\n return (\n <g>\n <BaseOutlineArc\n startX={rangeStartX}\n startY={rangeStartY}\n endX={valueX}\n endY={valueY}\n startAlpha={rangeArcStart}\n endAlpha={valueAlpha}\n color={color}\n radius={radius}\n width={gaugeWidth}\n roundEnd={false}\n />\n <BaseOutlineArc\n startX={valueX}\n startY={valueY}\n endX={rangeEndX}\n endY={rangeEndY}\n startAlpha={valueAlpha}\n endAlpha={rangeArcEnd}\n color={grey}\n radius={radius}\n width={gaugeWidth}\n roundStart={false}\n />\n <circle\n cx={(valueX + valueInnerX) / 2}\n cy={(valueY + valueInnerY) / 2}\n r={pointStrokeWidth + innerPointRadius}\n strokeWidth={pointStrokeWidth}\n stroke={color}\n fill=\"white\"\n ref={pointRef}\n />\n {!hideLabels && label && (\n <OutlineMeterLabelPointer\n diameter={diameter}\n isInRange\n position={calculatedLabelPosition}\n distanceFromRanges={distanceFromRanges}\n />\n )}\n </g>\n );\n }\n);\n"],"names":["OutlineMeterRange","React","props","pointRef","start","end","color","bounds","diameter","arc","distanceBetweenRanges","totalRanges","value","gaugeWidth","segmented","idx","pointStrokeWidth","innerPointRadius","distanceFromRanges","label","labelPosition","hideLabels","connected","grey","arcForRanges","rangeArc","valueWithinRange","isValueInRange","arcStart","radius","rangeArcStart","needConnection","inValueHigherThanRange","rangeArcEnd","rangeStartX","rangeStartY","getCoordinateForArc","rangeEndX","rangeEndY","calculatedLabelPosition","fillColor","adjustedRangeArcEnd","adjustedRangeY","rangeX","rangeY","jsx","BaseOutlineArc","OutlineMeterLabelPointer","valueAlpha","valueX","valueY","valueInnerX","getInnerX","degToRad","valueInnerY","getInnerY"],"mappings":";;;;;AAcO,MAAMA,KAAoBC,EAAM;AAAA,EACrC,CAACC,GAAOC,MAAa;AACb,UAAA;AAAA,MACJ,OAAAC;AAAA,MACA,KAAAC;AAAA,MACA,OAAAC;AAAA,MACA,QAAAC;AAAA,MACA,UAAAC;AAAA,MACA,KAAAC;AAAA,MACA,uBAAAC;AAAA,MACA,aAAAC;AAAA,MACA,OAAAC;AAAA,MACA,YAAAC;AAAA,MACA,WAAAC;AAAA,MACA,KAAAC;AAAA,MACA,kBAAAC;AAAA,MACA,kBAAAC;AAAA,MACA,oBAAAC;AAAA,MACA,OAAAC;AAAA,MACA,eAAAC;AAAA,MACA,YAAAC;AAAA,MACA,WAAAC;AAAA,IACE,IAAApB,GAEEqB,IAAO,WAGPC,IAAef,KAAOE,IAAc,KAAKD,GAGzCe,IAAWD,KAAgBnB,IAAMD,IACjCsB,IAAmBC,EAAef,GAAOR,GAAOC,GAAKE,CAAM,GAE3DqB,KAAY,MAAMnB,KAAO,GAEzBoB,IAASrB,IAAW,GAEpBsB,IACJF,IAAWlB,IAAwBK,IAAMS,IAAepB,GACpD2B,IACJT,KAAaU,EAAuBpB,GAAOP,GAAKE,CAAM,GAClD0B,IACJH,IACAN,KAAgBnB,IAAMD,MACrB2B,IAAiBrB,IAAwB,IAEtC,EAAE,GAAGwB,GAAa,GAAGC,EAAgB,IAAAC;AAAA,MACzCP;AAAA,MACAC;AAAA,IAAA,GAEI,EAAE,GAAGO,GAAW,GAAGC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