@selfdecode/sd-component-library 4.0.143 → 4.0.144
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/components/links/link/interfaces.d.ts +1 -0
- package/lib/sd-component-library100.js +2 -2
- package/lib/sd-component-library101.js +3 -3
- package/lib/sd-component-library102.js +2 -2
- package/lib/sd-component-library104.js +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-library201.js +3 -2
- package/lib/sd-component-library201.js.map +1 -1
- package/lib/sd-component-library202.js +2 -30
- package/lib/sd-component-library202.js.map +1 -1
- package/lib/sd-component-library203.js +21 -590
- package/lib/sd-component-library203.js.map +1 -1
- package/lib/sd-component-library204.js +599 -3
- package/lib/sd-component-library204.js.map +1 -1
- package/lib/sd-component-library205.js +24 -55
- package/lib/sd-component-library205.js.map +1 -1
- package/lib/sd-component-library206.js +55 -24
- package/lib/sd-component-library206.js.map +1 -1
- package/lib/sd-component-library207.js +18 -21
- package/lib/sd-component-library207.js.map +1 -1
- package/lib/sd-component-library208.js +64 -3
- package/lib/sd-component-library208.js.map +1 -1
- package/lib/sd-component-library209.js +23 -3
- package/lib/sd-component-library209.js.map +1 -1
- package/lib/sd-component-library210.js +39 -17
- package/lib/sd-component-library210.js.map +1 -1
- package/lib/sd-component-library211.js +127 -62
- package/lib/sd-component-library211.js.map +1 -1
- package/lib/sd-component-library212.js +13 -23
- package/lib/sd-component-library212.js.map +1 -1
- package/lib/sd-component-library213.js +14 -40
- package/lib/sd-component-library213.js.map +1 -1
- package/lib/sd-component-library214.js +3 -14
- package/lib/sd-component-library214.js.map +1 -1
- package/lib/sd-component-library215.js +2 -2
- package/lib/sd-component-library215.js.map +1 -1
- package/lib/sd-component-library216.js +65 -3
- package/lib/sd-component-library216.js.map +1 -1
- package/lib/sd-component-library217.js +3 -129
- package/lib/sd-component-library217.js.map +1 -1
- package/lib/sd-component-library218.js +3 -13
- package/lib/sd-component-library218.js.map +1 -1
- package/lib/sd-component-library219.js +45 -64
- package/lib/sd-component-library219.js.map +1 -1
- package/lib/sd-component-library220.js +52 -3
- package/lib/sd-component-library220.js.map +1 -1
- package/lib/sd-component-library221.js +17 -3
- package/lib/sd-component-library221.js.map +1 -1
- package/lib/sd-component-library222.js +19 -50
- package/lib/sd-component-library222.js.map +1 -1
- package/lib/sd-component-library223.js +3 -46
- 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 +31 -3
- package/lib/sd-component-library226.js.map +1 -1
- package/lib/sd-component-library227.js +19 -31
- package/lib/sd-component-library227.js.map +1 -1
- package/lib/sd-component-library228.js +20 -19
- package/lib/sd-component-library228.js.map +1 -1
- package/lib/sd-component-library229.js +28 -20
- package/lib/sd-component-library229.js.map +1 -1
- package/lib/sd-component-library230.js +32 -27
- package/lib/sd-component-library230.js.map +1 -1
- package/lib/sd-component-library231.js +128 -32
- package/lib/sd-component-library231.js.map +1 -1
- package/lib/sd-component-library232.js +43 -3
- package/lib/sd-component-library232.js.map +1 -1
- package/lib/sd-component-library233.js +46 -128
- package/lib/sd-component-library233.js.map +1 -1
- package/lib/sd-component-library234.js +7 -42
- package/lib/sd-component-library234.js.map +1 -1
- package/lib/sd-component-library235.js +3 -47
- package/lib/sd-component-library235.js.map +1 -1
- package/lib/sd-component-library236.js +21 -8
- package/lib/sd-component-library236.js.map +1 -1
- package/lib/sd-component-library237.js +107 -19
- package/lib/sd-component-library237.js.map +1 -1
- package/lib/sd-component-library238.js +47 -20
- package/lib/sd-component-library238.js.map +1 -1
- package/lib/sd-component-library239.js +22 -46
- package/lib/sd-component-library239.js.map +1 -1
- package/lib/sd-component-library24.js +1 -1
- package/lib/sd-component-library240.js +51 -73
- package/lib/sd-component-library240.js.map +1 -1
- package/lib/sd-component-library241.js +64 -2
- package/lib/sd-component-library241.js.map +1 -1
- package/lib/sd-component-library242.js +41 -62
- package/lib/sd-component-library242.js.map +1 -1
- package/lib/sd-component-library243.js +13 -43
- package/lib/sd-component-library243.js.map +1 -1
- package/lib/sd-component-library244.js +47 -12
- package/lib/sd-component-library244.js.map +1 -1
- package/lib/sd-component-library245.js +41 -21
- package/lib/sd-component-library245.js.map +1 -1
- package/lib/sd-component-library246.js +22 -104
- package/lib/sd-component-library246.js.map +1 -1
- package/lib/sd-component-library247.js +17 -43
- package/lib/sd-component-library247.js.map +1 -1
- package/lib/sd-component-library248.js +20 -24
- package/lib/sd-component-library248.js.map +1 -1
- package/lib/sd-component-library249.js +73 -51
- package/lib/sd-component-library249.js.map +1 -1
- package/lib/sd-component-library250.js +2 -325
- package/lib/sd-component-library250.js.map +1 -1
- package/lib/sd-component-library251.js +325 -5
- package/lib/sd-component-library251.js.map +1 -1
- package/lib/sd-component-library252.js +5 -41
- package/lib/sd-component-library252.js.map +1 -1
- package/lib/sd-component-library253.js +25 -26
- package/lib/sd-component-library253.js.map +1 -1
- package/lib/sd-component-library254.js +21 -25
- package/lib/sd-component-library254.js.map +1 -1
- package/lib/sd-component-library256.js +22 -24
- package/lib/sd-component-library256.js.map +1 -1
- package/lib/sd-component-library258.js +25 -21
- package/lib/sd-component-library258.js.map +1 -1
- package/lib/sd-component-library259.js +24 -22
- package/lib/sd-component-library259.js.map +1 -1
- package/lib/sd-component-library262.js +1 -1
- package/lib/sd-component-library265.js +30 -9
- package/lib/sd-component-library265.js.map +1 -1
- package/lib/sd-component-library266.js +17 -47
- package/lib/sd-component-library266.js.map +1 -1
- package/lib/sd-component-library267.js +123 -88
- package/lib/sd-component-library267.js.map +1 -1
- package/lib/sd-component-library268.js +120 -90
- package/lib/sd-component-library268.js.map +1 -1
- package/lib/sd-component-library269.js +10 -30
- package/lib/sd-component-library269.js.map +1 -1
- package/lib/sd-component-library270.js +46 -17
- package/lib/sd-component-library270.js.map +1 -1
- package/lib/sd-component-library271.js +9 -125
- package/lib/sd-component-library271.js.map +1 -1
- package/lib/sd-component-library272.js +46 -117
- package/lib/sd-component-library272.js.map +1 -1
- package/lib/sd-component-library273.js +90 -10
- package/lib/sd-component-library273.js.map +1 -1
- package/lib/sd-component-library274.js +90 -48
- package/lib/sd-component-library274.js.map +1 -1
- package/lib/sd-component-library286.js +4 -4
- package/lib/sd-component-library290.js +2 -58
- package/lib/sd-component-library290.js.map +1 -1
- package/lib/sd-component-library291.js +8 -2
- package/lib/sd-component-library291.js.map +1 -1
- package/lib/sd-component-library292.js +327 -7
- package/lib/sd-component-library292.js.map +1 -1
- package/lib/sd-component-library293.js +48 -325
- package/lib/sd-component-library293.js.map +1 -1
- package/lib/sd-component-library294.js +56 -49
- package/lib/sd-component-library294.js.map +1 -1
- package/lib/sd-component-library296.js +88 -20
- package/lib/sd-component-library296.js.map +1 -1
- package/lib/sd-component-library297.js +50 -34
- package/lib/sd-component-library297.js.map +1 -1
- package/lib/sd-component-library298.js +33 -91
- package/lib/sd-component-library298.js.map +1 -1
- package/lib/sd-component-library299.js +25 -51
- package/lib/sd-component-library299.js.map +1 -1
- package/lib/sd-component-library303.js +1 -1
- package/lib/sd-component-library317.js +6 -90
- package/lib/sd-component-library317.js.map +1 -1
- package/lib/sd-component-library318.js +90 -6
- package/lib/sd-component-library318.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-library64.js +1 -1
- 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-library81.js +9 -7
- package/lib/sd-component-library81.js.map +1 -1
- package/lib/sd-component-library85.js +1 -1
- package/lib/sd-component-library86.js +6 -6
- package/lib/sd-component-library87.js +2 -2
- package/lib/sd-component-library88.js +1 -1
- package/lib/sd-component-library89.js +5 -5
- package/lib/sd-component-library90.js +1 -1
- package/lib/sd-component-library92.js +6 -6
- package/lib/sd-component-library93.js +1 -1
- package/lib/sd-component-library94.js +7 -7
- package/lib/sd-component-library95.js +1 -1
- package/lib/sd-component-library98.js +2 -2
- package/lib/sd-component-library99.js +3 -3
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sd-component-library237.js","sources":["../src/components/meters/
|
|
1
|
+
{"version":3,"file":"sd-component-library237.js","sources":["../src/components/meters/gradient-outline-meter/partials/gradient-meter-range/gradient-meter-range.tsx"],"sourcesContent":["import React from \"react\";\n\nimport { BaseOutlineArc } from \"../../../outline-meter/partials/base-outline-arc\";\nimport {\n degToRad,\n getCoordinateForArc,\n getInnerX,\n getInnerY,\n} from \"../../../outline-meter/utils\";\nimport { getFractionColor } from \"../../utils\";\nimport { GradientMeterRangeProps as Props } from \"./interfaces\";\n\nconst grey = \"#CCD0DB\";\nexport const GradientMeterRange: React.FC<Props> = (props) => {\n const {\n diameter,\n idx,\n endColor,\n startColor,\n segmented,\n totalRanges,\n value,\n arc,\n innerPointRadius,\n pointStrokeWidth,\n gaugeWidth,\n pointColor,\n } = props;\n\n const start = idx / totalRanges;\n const end = (idx + 1) / totalRanges;\n\n const valueWithinRange = value >= start && value <= end;\n\n const arcStart = (360 - arc) / 2; // deg\n\n const radius = diameter / 2;\n\n const rangeArcStart = arcStart + arc * start;\n const rangeArcEnd = arcStart + arc * end;\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 if (segmented || !valueWithinRange)\n return (\n <BaseOutlineArc\n startX={rangeStartX}\n startY={rangeStartY}\n endX={rangeEndX}\n endY={rangeEndY}\n startAlpha={rangeArcStart}\n endAlpha={rangeArcEnd}\n color={\n segmented || value > end\n ? `url(#gradient-${startColor}-${endColor})`\n : grey\n }\n radius={radius}\n width={gaugeWidth}\n />\n );\n\n const valueAlpha =\n rangeArcStart + (((value - start) / (end - start)) * arc) / totalRanges;\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 const useVerticalGradient = idx >= totalRanges / 2;\n const useHorizontalGradient = idx + 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 <>\n <defs>\n <linearGradient\n id={`value-gradient-${color}`}\n {...(useVerticalGradient\n ? {\n x1: 0,\n y1: 0,\n x2: 0,\n y2: 1,\n }\n : useHorizontalGradient\n ? { x1: 0, y1: 0, x2: 1, y2: 0 }\n : {\n x1: 0,\n y1: 1,\n x2: 0,\n y2: 0,\n })}\n >\n <stop stopColor={startColor} offset=\"0%\" />\n <stop stopColor={color} offset=\"100%\" />\n </linearGradient>\n </defs>\n <g>\n <BaseOutlineArc\n startX={rangeStartX}\n startY={rangeStartY}\n endX={valueX}\n endY={valueY}\n startAlpha={rangeArcStart}\n endAlpha={valueAlpha}\n color={`url(#value-gradient-${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={pointColor || color}\n fill=\"white\"\n />\n </g>\n </>\n );\n};\n"],"names":["grey","GradientMeterRange","props","diameter","idx","endColor","startColor","segmented","totalRanges","value","arc","innerPointRadius","pointStrokeWidth","gaugeWidth","pointColor","start","end","valueWithinRange","arcStart","radius","rangeArcStart","rangeArcEnd","rangeStartX","rangeStartY","getCoordinateForArc","rangeEndX","rangeEndY","jsx","BaseOutlineArc","valueAlpha","valueX","valueY","valueInnerX","getInnerX","degToRad","valueInnerY","getInnerY","useVerticalGradient","useHorizontalGradient","fraction","color","getFractionColor","jsxs","Fragment"],"mappings":";;;;AAYA,MAAMA,IAAO,WACAC,IAAsC,CAACC,MAAU;AACtD,QAAA;AAAA,IACJ,UAAAC;AAAA,IACA,KAAAC;AAAA,IACA,UAAAC;AAAA,IACA,YAAAC;AAAA,IACA,WAAAC;AAAA,IACA,aAAAC;AAAA,IACA,OAAAC;AAAA,IACA,KAAAC;AAAA,IACA,kBAAAC;AAAA,IACA,kBAAAC;AAAA,IACA,YAAAC;AAAA,IACA,YAAAC;AAAA,EACE,IAAAZ,GAEEa,IAAQX,IAAMI,GACdQ,KAAOZ,IAAM,KAAKI,GAElBS,IAAmBR,KAASM,KAASN,KAASO,GAE9CE,KAAY,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EAAA,CAAA;AAEJ;"}
|
|
@@ -1,23 +1,50 @@
|
|
|
1
|
-
import { j as
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
1
|
+
import { j as N } from "./sd-component-library197.js";
|
|
2
|
+
import { getInnerX as k, getInnerY as B, degToRad as c, getCoordinateForArc as i } from "./sd-component-library91.js";
|
|
3
|
+
import { getFractionColor as b } from "./sd-component-library236.js";
|
|
4
|
+
import { BaseNeedle as q } from "./sd-component-library298.js";
|
|
5
|
+
const O = (R) => {
|
|
6
|
+
const {
|
|
7
|
+
ranges: r,
|
|
8
|
+
distanceFromRange: d,
|
|
9
|
+
innerCircleRadius: X,
|
|
10
|
+
innerCircleStrokeWidth: Y,
|
|
11
|
+
needleWidth: n,
|
|
12
|
+
arc: a,
|
|
13
|
+
value: l,
|
|
14
|
+
gaugeWidth: g,
|
|
15
|
+
diameter: v,
|
|
16
|
+
needleColor: S
|
|
17
|
+
} = R, s = v / 2, e = r.length, t = Math.floor(l * e), y = r[t][0], A = r[t][1], u = (360 - a) / 2, m = u + a * t / e, E = u + a * (t + 1) / e, p = t / e, M = (t + 1) / e, { x: h, y: x } = i(
|
|
18
|
+
s,
|
|
19
|
+
m
|
|
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,
|
|
34
|
+
{
|
|
35
|
+
radius: s,
|
|
36
|
+
innerCircleRadius: X,
|
|
37
|
+
innerCircleStrokeWidth: Y,
|
|
38
|
+
needleWidth: n,
|
|
39
|
+
color: S || H,
|
|
40
|
+
dx: T,
|
|
41
|
+
dy: W,
|
|
42
|
+
tipX: G,
|
|
43
|
+
tipY: I
|
|
44
|
+
}
|
|
45
|
+
);
|
|
46
|
+
};
|
|
20
47
|
export {
|
|
21
|
-
|
|
48
|
+
O as GradientMeterNeedle
|
|
22
49
|
};
|
|
23
50
|
//# sourceMappingURL=sd-component-library238.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sd-component-library238.js","sources":["../src/components/meters/
|
|
1
|
+
{"version":3,"file":"sd-component-library238.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,IAAuC,CAACC,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gBG,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,51 +1,27 @@
|
|
|
1
|
-
import {
|
|
2
|
-
const
|
|
3
|
-
const
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
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
|
|
1
|
+
import { j as p } from "./sd-component-library197.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
|
|
45
21
|
};
|
|
22
|
+
return /* @__PURE__ */ p.jsx("path", { d: `M${d},${i} L${X},${Y}`, stroke: "#CCD0DB" });
|
|
46
23
|
};
|
|
47
24
|
export {
|
|
48
|
-
|
|
49
|
-
x as getSegmentCoordinates
|
|
25
|
+
m as OutlineMeterLabelPointer
|
|
50
26
|
};
|
|
51
27
|
//# sourceMappingURL=sd-component-library239.js.map
|
|
@@ -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/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;"}
|
|
@@ -2,7 +2,7 @@ import { j as r } from "./sd-component-library197.js";
|
|
|
2
2
|
import { Link as V } from "react-router-dom";
|
|
3
3
|
import { Button as X, Flex as Y } from "rebass";
|
|
4
4
|
import { generateTestLocator as Z } from "./sd-component-library4.js";
|
|
5
|
-
import { LoadingSpinner as tt } from "./sd-component-
|
|
5
|
+
import { LoadingSpinner as tt } from "./sd-component-library205.js";
|
|
6
6
|
function ot(t, o, e) {
|
|
7
7
|
return (n) => {
|
|
8
8
|
t == null || t(n), o && (`#${o}` !== window.location.hash && (e != null && e.replace(
|
|
@@ -1,78 +1,56 @@
|
|
|
1
|
-
import { j as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
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`
|
|
1
|
+
import { j as s } from "./sd-component-library197.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-library226.js";
|
|
5
|
+
import { ResponsiveTextV2 as v } from "./sd-component-library150.js";
|
|
6
|
+
const C = (x) => {
|
|
7
|
+
const {
|
|
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,
|
|
21
|
+
{
|
|
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`
|
|
59
36
|
}
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
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
|
+
)
|
|
50
|
+
}
|
|
51
|
+
) });
|
|
74
52
|
};
|
|
75
53
|
export {
|
|
76
|
-
|
|
54
|
+
C as BaseMeterLabelBox
|
|
77
55
|
};
|
|
78
56
|
//# sourceMappingURL=sd-component-library240.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sd-component-library240.js","sources":["../src/components/meters/
|
|
1
|
+
{"version":3,"file":"sd-component-library240.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","lab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AAAA,QACJ,IAAI;AAAA,QACJ,WAAW;AAAA,UACT,UAAUjB,MAAa,QAAQ,SAAY,GAAGkB,CAAU;AAAA,QAC1D;AAAA,MACF;AAAA,MACA,KAAAZ;AAAA,MAEA,UAAAS,gBAAAA,EAAA;AAAA,QAACI;AAAA,QAAA;AAAA,UACC,OAAM;AAAA,UACN,gBAAgB,CAAC,CAAC,IAAI,WAAW,CAAC;AAAA,UAClC,OAAOf,KAAaC,MAAU,YAAYA,IAAQ;AAAA,UAClD,eAAc;AAAA,UACd,eAAc;AAAA,UAEb,UAAAH;AAAA,QAAA;AAAA,MACH;AAAA,IAAA;AAAA,EAEJ,EAAA,CAAA;AAEJ;"}
|
|
@@ -1,5 +1,67 @@
|
|
|
1
|
-
|
|
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-library225.js";
|
|
4
|
+
import { getRangeProperties as Y } from "./sd-component-library300.js";
|
|
5
|
+
import { BaseOutlineArc as b } from "./sd-component-library299.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
|
+
}
|
|
2
64
|
export {
|
|
3
|
-
|
|
65
|
+
z as DiscreteRange
|
|
4
66
|
};
|
|
5
67
|
//# 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/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,67 +1,46 @@
|
|
|
1
|
-
import { j as
|
|
2
|
-
import { getCoordinateForArc as
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
import { BaseOutlineArc as b } from "./sd-component-library296.js";
|
|
6
|
-
import { DiscreteMeterLabelPointer as w } from "./sd-component-library301.js";
|
|
7
|
-
function z(s) {
|
|
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-library298.js";
|
|
4
|
+
function E(p) {
|
|
8
5
|
const {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
t,
|
|
29
|
-
|
|
30
|
-
),
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
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
|
-
] });
|
|
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
|
+
);
|
|
63
42
|
}
|
|
64
43
|
export {
|
|
65
|
-
|
|
44
|
+
E as DiscreteMeterNeedle
|
|
66
45
|
};
|
|
67
46
|
//# sourceMappingURL=sd-component-library242.js.map
|