@selfdecode/sd-component-library 4.0.142 → 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/components/wrapper/functions.d.ts +1 -1
- package/lib/components/wrapper/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-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-library16.js +1 -1
- package/lib/sd-component-library167.js +1 -1
- package/lib/sd-component-library172.js +1 -1
- package/lib/sd-component-library197.js +3 -3
- package/lib/sd-component-library198.js +57 -57
- package/lib/sd-component-library198.js.map +1 -1
- package/lib/sd-component-library2.js +14 -4
- package/lib/sd-component-library2.js.map +1 -1
- package/lib/sd-component-library202.js +2 -57
- package/lib/sd-component-library202.js.map +1 -1
- package/lib/sd-component-library203.js +30 -2
- package/lib/sd-component-library203.js.map +1 -1
- package/lib/sd-component-library204.js +590 -21
- package/lib/sd-component-library204.js.map +1 -1
- package/lib/sd-component-library205.js +25 -598
- 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-library210.js +40 -21
- package/lib/sd-component-library210.js.map +1 -1
- package/lib/sd-component-library211.js +129 -3
- package/lib/sd-component-library211.js.map +1 -1
- package/lib/sd-component-library212.js +13 -3
- package/lib/sd-component-library212.js.map +1 -1
- package/lib/sd-component-library213.js +14 -26
- package/lib/sd-component-library213.js.map +1 -1
- package/lib/sd-component-library214.js +3 -3
- package/lib/sd-component-library214.js.map +1 -1
- package/lib/sd-component-library215.js +3 -31
- package/lib/sd-component-library215.js.map +1 -1
- package/lib/sd-component-library216.js +65 -19
- package/lib/sd-component-library216.js.map +1 -1
- package/lib/sd-component-library217.js +3 -20
- package/lib/sd-component-library217.js.map +1 -1
- package/lib/sd-component-library218.js +3 -28
- package/lib/sd-component-library218.js.map +1 -1
- package/lib/sd-component-library219.js +44 -31
- 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 +15 -127
- package/lib/sd-component-library221.js.map +1 -1
- package/lib/sd-component-library222.js +19 -41
- package/lib/sd-component-library222.js.map +1 -1
- package/lib/sd-component-library223.js +3 -47
- package/lib/sd-component-library223.js.map +1 -1
- package/lib/sd-component-library224.js +3 -8
- package/lib/sd-component-library224.js.map +1 -1
- package/lib/sd-component-library225.js +3 -64
- package/lib/sd-component-library225.js.map +1 -1
- package/lib/sd-component-library226.js +31 -43
- package/lib/sd-component-library226.js.map +1 -1
- package/lib/sd-component-library227.js +19 -13
- package/lib/sd-component-library227.js.map +1 -1
- package/lib/sd-component-library228.js +20 -21
- package/lib/sd-component-library228.js.map +1 -1
- package/lib/sd-component-library229.js +26 -107
- package/lib/sd-component-library229.js.map +1 -1
- package/lib/sd-component-library230.js +27 -41
- package/lib/sd-component-library230.js.map +1 -1
- package/lib/sd-component-library231.js +129 -24
- package/lib/sd-component-library231.js.map +1 -1
- package/lib/sd-component-library232.js +40 -50
- package/lib/sd-component-library232.js.map +1 -1
- package/lib/sd-component-library233.js +45 -46
- package/lib/sd-component-library233.js.map +1 -1
- package/lib/sd-component-library234.js +7 -74
- package/lib/sd-component-library234.js.map +1 -1
- package/lib/sd-component-library235.js +3 -41
- package/lib/sd-component-library235.js.map +1 -1
- package/lib/sd-component-library236.js +20 -26
- 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 +24 -2
- package/lib/sd-component-library239.js.map +1 -1
- package/lib/sd-component-library24.js +1 -1
- package/lib/sd-component-library240.js +49 -36
- package/lib/sd-component-library240.js.map +1 -1
- package/lib/sd-component-library241.js +63 -128
- package/lib/sd-component-library241.js.map +1 -1
- package/lib/sd-component-library242.js +43 -13
- package/lib/sd-component-library242.js.map +1 -1
- package/lib/sd-component-library243.js +13 -14
- package/lib/sd-component-library243.js.map +1 -1
- package/lib/sd-component-library244.js +48 -3
- package/lib/sd-component-library244.js.map +1 -1
- package/lib/sd-component-library245.js +41 -3
- package/lib/sd-component-library245.js.map +1 -1
- package/lib/sd-component-library246.js +27 -3
- package/lib/sd-component-library246.js.map +1 -1
- package/lib/sd-component-library247.js +16 -47
- package/lib/sd-component-library247.js.map +1 -1
- package/lib/sd-component-library248.js +16 -61
- package/lib/sd-component-library248.js.map +1 -1
- package/lib/sd-component-library249.js +75 -3
- package/lib/sd-component-library249.js.map +1 -1
- package/lib/sd-component-library250.js +2 -46
- package/lib/sd-component-library250.js.map +1 -1
- package/lib/sd-component-library251.js +324 -16
- package/lib/sd-component-library251.js.map +1 -1
- package/lib/sd-component-library252.js +5 -325
- package/lib/sd-component-library252.js.map +1 -1
- package/lib/sd-component-library253.js +26 -5
- package/lib/sd-component-library253.js.map +1 -1
- package/lib/sd-component-library261.js +1 -1
- package/lib/sd-component-library262.js +1 -1
- package/lib/sd-component-library264.js +1 -1
- package/lib/sd-component-library277.js +2 -6
- package/lib/sd-component-library277.js.map +1 -1
- package/lib/sd-component-library278.js +2 -3
- package/lib/sd-component-library278.js.map +1 -1
- package/lib/sd-component-library279.js +9 -2
- package/lib/sd-component-library279.js.map +1 -1
- package/lib/sd-component-library280.js +70 -3
- package/lib/sd-component-library280.js.map +1 -1
- package/lib/sd-component-library281.js +102 -2
- package/lib/sd-component-library281.js.map +1 -1
- package/lib/sd-component-library282.js +106 -2
- package/lib/sd-component-library282.js.map +1 -1
- package/lib/sd-component-library283.js +6 -70
- package/lib/sd-component-library283.js.map +1 -1
- package/lib/sd-component-library284.js +2 -102
- package/lib/sd-component-library284.js.map +1 -1
- package/lib/sd-component-library285.js +34 -104
- package/lib/sd-component-library285.js.map +1 -1
- package/lib/sd-component-library286.js +14 -10
- package/lib/sd-component-library286.js.map +1 -1
- package/lib/sd-component-library287.js +3 -2
- package/lib/sd-component-library287.js.map +1 -1
- package/lib/sd-component-library288.js +3 -36
- package/lib/sd-component-library288.js.map +1 -1
- package/lib/sd-component-library289.js +3 -14
- package/lib/sd-component-library289.js.map +1 -1
- package/lib/sd-component-library291.js +3 -3
- package/lib/sd-component-library292.js +4 -4
- package/lib/sd-component-library293.js +1 -1
- package/lib/sd-component-library294.js +58 -2
- package/lib/sd-component-library294.js.map +1 -1
- package/lib/sd-component-library295.js +25 -76
- package/lib/sd-component-library295.js.map +1 -1
- package/lib/sd-component-library296.js +89 -89
- package/lib/sd-component-library296.js.map +1 -1
- package/lib/sd-component-library297.js +50 -52
- package/lib/sd-component-library297.js.map +1 -1
- package/lib/sd-component-library298.js +35 -9
- package/lib/sd-component-library298.js.map +1 -1
- package/lib/sd-component-library299.js +25 -5
- package/lib/sd-component-library299.js.map +1 -1
- package/lib/sd-component-library300.js +5 -53
- package/lib/sd-component-library300.js.map +1 -1
- package/lib/sd-component-library301.js +4 -9
- package/lib/sd-component-library301.js.map +1 -1
- package/lib/sd-component-library302.js +8 -4
- package/lib/sd-component-library302.js.map +1 -1
- package/lib/sd-component-library303.js +5 -4
- package/lib/sd-component-library303.js.map +1 -1
- package/lib/sd-component-library304.js +4 -19
- package/lib/sd-component-library304.js.map +1 -1
- package/lib/sd-component-library305.js +19 -3
- package/lib/sd-component-library305.js.map +1 -1
- package/lib/sd-component-library306.js +3 -2
- package/lib/sd-component-library306.js.map +1 -1
- package/lib/sd-component-library307.js +34 -2
- package/lib/sd-component-library307.js.map +1 -1
- package/lib/sd-component-library308.js +2 -6
- package/lib/sd-component-library308.js.map +1 -1
- package/lib/sd-component-library309.js +76 -24
- package/lib/sd-component-library309.js.map +1 -1
- package/lib/sd-component-library310.js +92 -50
- package/lib/sd-component-library310.js.map +1 -1
- package/lib/sd-component-library311.js +52 -34
- package/lib/sd-component-library311.js.map +1 -1
- package/lib/sd-component-library312.js +9 -5
- package/lib/sd-component-library312.js.map +1 -1
- package/lib/sd-component-library313.js +5 -93
- package/lib/sd-component-library313.js.map +1 -1
- package/lib/sd-component-library314.js +53 -4
- package/lib/sd-component-library314.js.map +1 -1
- package/lib/sd-component-library315.js +20 -49
- package/lib/sd-component-library315.js.map +1 -1
- package/lib/sd-component-library316.js +15 -20
- package/lib/sd-component-library316.js.map +1 -1
- package/lib/sd-component-library317.js +6 -34
- package/lib/sd-component-library317.js.map +1 -1
- package/lib/sd-component-library319.js +31 -28
- package/lib/sd-component-library319.js.map +1 -1
- package/lib/sd-component-library320.js +2 -21
- package/lib/sd-component-library320.js.map +1 -1
- package/lib/sd-component-library321.js +2 -32
- package/lib/sd-component-library321.js.map +1 -1
- package/lib/sd-component-library51.js +3 -3
- package/lib/sd-component-library60.js +1 -1
- package/lib/sd-component-library61.js +2 -2
- package/lib/sd-component-library62.js +5 -5
- package/lib/sd-component-library63.js +1 -1
- package/lib/sd-component-library64.js +2 -2
- package/lib/sd-component-library65.js +1 -1
- package/lib/sd-component-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,51 +1,50 @@
|
|
|
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
|
-
|
|
28
|
-
|
|
29
|
-
n
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
1
|
+
import { j as k } from "./sd-component-library197.js";
|
|
2
|
+
import { isValueInRange as w, getInnerX as E, getInnerY as O, degToRad as r, getCoordinateForArc as V } from "./sd-component-library91.js";
|
|
3
|
+
import { BaseNeedle as b } from "./sd-component-library298.js";
|
|
4
|
+
const G = (x) => {
|
|
5
|
+
const {
|
|
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,
|
|
34
|
+
{
|
|
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
|
|
44
|
+
}
|
|
34
45
|
);
|
|
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
|
-
};
|
|
46
46
|
};
|
|
47
47
|
export {
|
|
48
|
-
|
|
49
|
-
x as getSegmentCoordinates
|
|
48
|
+
G as OutlineMeterNeedle
|
|
50
49
|
};
|
|
51
50
|
//# sourceMappingURL=sd-component-library233.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sd-component-library233.js","sources":["../src/components/meters/
|
|
1
|
+
{"version":3,"file":"sd-component-library233.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,78 +1,11 @@
|
|
|
1
|
-
import { j as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
segment: o,
|
|
8
|
-
segmentWidth: $,
|
|
9
|
-
outlineWidth: f,
|
|
10
|
-
size: i,
|
|
11
|
-
mobile: a,
|
|
12
|
-
...c
|
|
13
|
-
}) => {
|
|
14
|
-
const { start: p, end: x, color: u } = o, { labelOffset: j } = c, t = i / 2, d = t - $, {
|
|
15
|
-
startInnerX: k,
|
|
16
|
-
startInnerY: A,
|
|
17
|
-
endInnerX: M,
|
|
18
|
-
endInnerY: X,
|
|
19
|
-
endX: Y,
|
|
20
|
-
endY: v,
|
|
21
|
-
startY: S,
|
|
22
|
-
startX: g,
|
|
23
|
-
arc: e
|
|
24
|
-
} = O(o, t, $), r = i / 2, H = Math.round(p * 360), I = Math.round(x * 360), { isHover: L, hoverCallbacks: w } = Z(), m = L && !a, s = Math.sqrt(2) * (t + j), { x: y, y: C } = l(
|
|
25
|
-
s,
|
|
26
|
-
H,
|
|
27
|
-
t
|
|
28
|
-
), { x: E, y: R } = l(
|
|
29
|
-
s,
|
|
30
|
-
I,
|
|
31
|
-
t
|
|
32
|
-
);
|
|
33
|
-
return /* @__PURE__ */ n.jsxs("g", { ...a ? {} : w, children: [
|
|
34
|
-
/* @__PURE__ */ n.jsx(
|
|
35
|
-
"path",
|
|
36
|
-
{
|
|
37
|
-
d: `M${r},${r} L${y},${C} A${s},${s} 0 ${e > 180 ? "1" : "0"},1 ${E},${R}Z`,
|
|
38
|
-
fill: "transparent"
|
|
39
|
-
}
|
|
40
|
-
),
|
|
41
|
-
/* @__PURE__ */ n.jsx(
|
|
42
|
-
"path",
|
|
43
|
-
{
|
|
44
|
-
d: `M${r},${r} L${g},${S} A${t},${t} 0 ${e > 180 ? "1" : "0"},1 ${Y},${v}Z`,
|
|
45
|
-
fill: u,
|
|
46
|
-
strokeWidth: f,
|
|
47
|
-
stroke: "white"
|
|
48
|
-
}
|
|
49
|
-
),
|
|
50
|
-
/* @__PURE__ */ n.jsx(
|
|
51
|
-
"path",
|
|
52
|
-
{
|
|
53
|
-
d: `M${r},${r} L${k},${A} A${d},${d} 0 ${e > 180 ? "1" : "0"},1 ${M},${X}Z`,
|
|
54
|
-
fill: "white",
|
|
55
|
-
style: {
|
|
56
|
-
transform: `scale(${m ? 0.8 : 1}`,
|
|
57
|
-
transformOrigin: "center",
|
|
58
|
-
transition: `all ${h}ms`
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
),
|
|
62
|
-
/* @__PURE__ */ n.jsx(
|
|
63
|
-
q,
|
|
64
|
-
{
|
|
65
|
-
segment: o,
|
|
66
|
-
radius: t,
|
|
67
|
-
animationDuration: h,
|
|
68
|
-
isHover: m,
|
|
69
|
-
mobile: a,
|
|
70
|
-
...c
|
|
71
|
-
}
|
|
72
|
-
)
|
|
73
|
-
] });
|
|
1
|
+
import { j as m } from "./sd-component-library197.js";
|
|
2
|
+
import { isValueInRange as x } from "./sd-component-library91.js";
|
|
3
|
+
import { BaseMeterLabelBox as u } from "./sd-component-library240.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 });
|
|
74
7
|
};
|
|
75
8
|
export {
|
|
76
|
-
|
|
9
|
+
g as OutlineMeterLabelBox
|
|
77
10
|
};
|
|
78
11
|
//# sourceMappingURL=sd-component-library234.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sd-component-library234.js","sources":["../src/components/meters/
|
|
1
|
+
{"version":3,"file":"sd-component-library234.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,44 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
import { getSegmentCoordinates as I } from "./sd-component-library233.js";
|
|
4
|
-
const w = ({
|
|
5
|
-
segment: e,
|
|
6
|
-
size: o,
|
|
7
|
-
segmentWidth: s,
|
|
8
|
-
outlineWidth: c,
|
|
9
|
-
isMatching: a
|
|
10
|
-
}) => {
|
|
11
|
-
const { color: d } = e, t = o / 2, $ = t - s, {
|
|
12
|
-
startX: l,
|
|
13
|
-
startY: m,
|
|
14
|
-
arc: i,
|
|
15
|
-
startInnerY: p,
|
|
16
|
-
startInnerX: h,
|
|
17
|
-
endInnerY: u,
|
|
18
|
-
endInnerX: x,
|
|
19
|
-
endX: f,
|
|
20
|
-
endY: j
|
|
21
|
-
} = I(e, t, s), r = o / 2;
|
|
22
|
-
return /* @__PURE__ */ n.jsxs("g", { children: [
|
|
23
|
-
/* @__PURE__ */ n.jsx(
|
|
24
|
-
"path",
|
|
25
|
-
{
|
|
26
|
-
d: `M${r},${r} L${l},${m} A${t},${t} 0 ${i > 180 ? "1" : "0"},1 ${f},${j}Z`,
|
|
27
|
-
fill: a ? d : g.colors.cl_lightGrey,
|
|
28
|
-
strokeWidth: c,
|
|
29
|
-
stroke: "white"
|
|
30
|
-
}
|
|
31
|
-
),
|
|
32
|
-
/* @__PURE__ */ n.jsx(
|
|
33
|
-
"path",
|
|
34
|
-
{
|
|
35
|
-
d: `M${r},${r} L${h},${p} A${$},${$} 0 ${i > 180 ? "1" : "0"},1 ${x},${u}Z`,
|
|
36
|
-
fill: "white"
|
|
37
|
-
}
|
|
38
|
-
)
|
|
39
|
-
] });
|
|
40
|
-
};
|
|
1
|
+
import * as e from "react";
|
|
2
|
+
const t = (a) => /* @__PURE__ */ e.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 16.04 33.79", ...a }, /* @__PURE__ */ e.createElement("g", null, /* @__PURE__ */ e.createElement("g", null, /* @__PURE__ */ e.createElement("path", { className: "first-half", d: "M8,0V6.37H8A3.19,3.19,0,0,1,8,0ZM1,8.24a4,4,0,0,0-1,2.7V19.5a1.64,1.64,0,0,0,.45,1.28v0a1.49,1.49,0,0,0,2.12,0A1.64,1.64,0,0,0,3,19.5V12.11h.7L3.67,31.64c0,.07,0,.14,0,.21a1.92,1.92,0,0,0,1.91,1.93h.12a2,2,0,0,0,1.88-2.12V21.75H8V7H3.72A3.57,3.57,0,0,0,1,8.24Z" }), /* @__PURE__ */ e.createElement("path", { className: "second-half", d: "M8,6.38H8V0H8A3.19,3.19,0,0,1,8,6.38Zm7.07,1.86A3.59,3.59,0,0,0,12.32,7H8V21.75h.41v9.93a1.36,1.36,0,0,0,0,.35,1.95,1.95,0,1,0,3.88-.39V12.1h.63v7.4a1.68,1.68,0,0,0,.46,1.29,1.58,1.58,0,0,0,2.18,0A1.69,1.69,0,0,0,16,19.5V10.94A4.09,4.09,0,0,0,15.07,8.24Z" }))));
|
|
41
3
|
export {
|
|
42
|
-
|
|
4
|
+
t as ReactComponent
|
|
43
5
|
};
|
|
44
6
|
//# sourceMappingURL=sd-component-library235.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sd-component-library235.js","sources":["../src/components/meters/
|
|
1
|
+
{"version":3,"file":"sd-component-library235.js","sources":["../src/components/meters/people-meter/assets/person.svg"],"sourcesContent":["export default \"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxNi4wNCAzMy43OSI+CiAgICA8Zz4KICAgICAgICA8Zz4KICAgICAgICAgICAgPHBhdGggY2xhc3M9ImZpcnN0LWhhbGYiCiAgICAgICAgICAgICAgICBkPSJNOCwwVjYuMzdIOEEzLjE5LDMuMTksMCwwLDEsOCwwWk0xLDguMjRhNCw0LDAsMCwwLTEsMi43VjE5LjVhMS42NCwxLjY0LDAsMCwwLC40NSwxLjI4djBhMS40OSwxLjQ5LDAsMCwwLDIuMTIsMEExLjY0LDEuNjQsMCwwLDAsMywxOS41VjEyLjExaC43TDMuNjcsMzEuNjRjMCwuMDcsMCwuMTQsMCwuMjF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
children: [
|
|
14
|
-
Math.round((r - n) * 100),
|
|
15
|
-
/* @__PURE__ */ t.jsx(
|
|
16
|
-
i,
|
|
17
|
-
{
|
|
18
|
-
fontSizeWeight: [10, "bold"],
|
|
19
|
-
color: e,
|
|
20
|
-
sx: { position: "absolute", top: "4px", left: "100%" },
|
|
21
|
-
children: "%"
|
|
22
|
-
}
|
|
23
|
-
)
|
|
24
|
-
]
|
|
1
|
+
const i = (t, n) => [t, n], T = function* (t = []) {
|
|
2
|
+
for (; t.length > 1; )
|
|
3
|
+
yield i(t[0], t[1]), t = t.slice(1);
|
|
4
|
+
}, I = (t, n, e) => {
|
|
5
|
+
if (n && !e)
|
|
6
|
+
return n;
|
|
7
|
+
if (!n && e)
|
|
8
|
+
return e;
|
|
9
|
+
if (n && e) {
|
|
10
|
+
const s = a(n), r = a(e), c = s.map((B, f) => Math.round(B * (1 - t) + r[f] * t));
|
|
11
|
+
return c ? u(c[0], c[1], c[2]) : "";
|
|
25
12
|
}
|
|
26
|
-
|
|
13
|
+
return "";
|
|
14
|
+
}, u = (t, n, e) => "#" + (16777216 + (t << 16) + (n << 8) + e).toString(16).slice(1), a = (t) => {
|
|
15
|
+
const n = t.match(/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i);
|
|
16
|
+
return n ? n.slice(1).map((e) => parseInt(e, 16)) : null;
|
|
17
|
+
}, h = (t, n, e) => Math.floor(t * n) === (e === "left" ? 0 : e === "right" ? n - 1 : 1), _ = (t) => t === "left" ? "right" : t === "top" ? "top" : "left";
|
|
27
18
|
export {
|
|
28
|
-
|
|
19
|
+
_ as flipPosition,
|
|
20
|
+
I as getFractionColor,
|
|
21
|
+
h as isLabelActive,
|
|
22
|
+
T as mapAdjacent
|
|
29
23
|
};
|
|
30
24
|
//# sourceMappingURL=sd-component-library236.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sd-component-library236.js","sources":["../src/components/meters/
|
|
1
|
+
{"version":3,"file":"sd-component-library236.js","sources":["../src/components/meters/gradient-outline-meter/utils.ts"],"sourcesContent":["import { OutlineMeterLabelPosition } from \"../outline-meter\";\n\nconst pair = <T>(a: T, b: T): [T, T] => [a, b];\n\n/**\n * Returns an array of mapped adjacent elements into pairs.\n */\nexport const mapAdjacent = function* <T>(iter: T[] = []) {\n while (iter.length > 1) {\n yield pair<T>(iter[0], iter[1]);\n iter = iter.slice(1);\n }\n};\n\n/**\n * @param fraction numerical value from 0 to 1.\n * @param lowColor initial color of the gradient.\n * @param topColor final color of the gradient.\n * @returns color of gradient at specified fraction point or empty string\n */\nexport const getFractionColor = (\n fraction: number,\n lowColor?: string,\n topColor?: string\n): string => {\n if (lowColor && !topColor) return lowColor;\n if (!lowColor && topColor) return topColor;\n if (lowColor && topColor) {\n const lowRGB = hexToRGB(lowColor);\n const topRGB = hexToRGB(topColor);\n const resultRGB = lowRGB!.map((component, i) => {\n return Math.round(component * (1 - fraction) + topRGB![i] * fraction);\n });\n return resultRGB ? rgbToHex(resultRGB[0], resultRGB[1], resultRGB[2]) : \"\";\n }\n return \"\";\n};\n\n/**\n * Converts rgb color representation into hex representation.\n * @param red component of color.\n * @param green component of color.\n * @param blue component of color.\n */\nconst rgbToHex = (red: number, green: number, blue: number): string => {\n const BITS_IN_BYTE = 8;\n return (\n \"#\" +\n (\n (1 << (3 * BITS_IN_BYTE)) +\n (red << (2 * BITS_IN_BYTE)) +\n (green << BITS_IN_BYTE) +\n blue\n )\n .toString(16)\n .slice(1)\n );\n};\n\n/**\n * Converts hex representation of color into rgb.\n * @param hex complete and correct representation of color\n */\nconst hexToRGB = (hex: string) => {\n const normal = hex.match(/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i);\n return normal ? normal.slice(1).map((e) => parseInt(e, 16)) : null;\n};\n\nexport const isLabelActive = (\n value: number,\n totalColors: number,\n position: OutlineMeterLabelPosition\n) =>\n Math.floor(value * totalColors) ===\n (position === \"left\" ? 0 : position === \"right\" ? totalColors - 1 : 1);\n\n/**\n * Mirrors entered position for outline meter label.\n */\nexport const flipPosition = (position: OutlineMeterLabelPosition) =>\n position === \"left\" ? \"right\" : position === \"top\" ? \"top\" : \"left\";\n"],"names":["pair","a","b","mapAdjacent","iter","getFractionColor","fraction","lowColor","topColor","lowRGB","hexToRGB","topRGB","resultRGB","component","i","rgbToHex","red","green","blue","hex","normal","isLabelActive","value","totalColors","position","flipPosition"],"mappings":"AAEA,MAAMA,IAAO,CAAIC,GAAMC,MAAiB,CAACD,GAAGC,CAAC,GAKhCC,IAAc,WAAcC,IAAY,IAAI;AAChD,SAAAA,EAAK,SAAS;AACnB,UAAMJ,EAAQI,EAAK,CAAC,GAAGA,EAAK,CAAC,CAAC,GACvBA,IAAAA,EAAK,MAAM,CAAC;AAEvB,GAQaC,IAAmB,CAC9BC,GACAC,GACAC,MACW;AACX,MAAID,KAAY,CAACC;AAAiB,WAAAD;AAClC,MAAI,CAACA,KAAYC;AAAiB,WAAAA;AAClC,MAAID,KAAYC,GAAU;AAClB,UAAAC,IAASC,EAASH,CAAQ,GAC1BI,IAASD,EAASF,CAAQ,GAC1BI,IAAYH,EAAQ,IAAI,CAACI,GAAWC,MACjC,KAAK,MAAMD,KAAa,IAAIP,KAAYK,EAAQG,CAAC,IAAIR,CAAQ,CACrE;AACM,WAAAM,IAAYG,EAASH,EAAU,CAAC,GAAGA,EAAU,CAAC,GAAGA,EAAU,CAAC,CAAC,IAAI;AAAA,EAC1E;AACO,SAAA;AACT,GAQMG,IAAW,CAACC,GAAaC,GAAeC,MAG1C,OAEG,YACAF,KAAQ,OACRC,KAAS,KACVC,GAEC,SAAS,EAAE,EACX,MAAM,CAAC,GAQRR,IAAW,CAACS,MAAgB;AAC1B,QAAAC,IAASD,EAAI,MAAM,6CAA6C;AACtE,SAAOC,IAASA,EAAO,MAAM,CAAC,EAAE,IAAI,CAAC,MAAM,SAAS,GAAG,EAAE,CAAC,IAAI;AAChE,GAEaC,IAAgB,CAC3BC,GACAC,GACAC,MAEA,KAAK,MAAMF,IAAQC,CAAW,OAC7BC,MAAa,SAAS,IAAIA,MAAa,UAAUD,IAAc,IAAI,IAKzDE,IAAe,CAACD,MAC3BA,MAAa,SAAS,UAAUA,MAAa,QAAQ,QAAQ;"}
|
|
@@ -1,24 +1,112 @@
|
|
|
1
|
-
import { j as
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
1
|
+
import { j as t } from "./sd-component-library197.js";
|
|
2
|
+
import { getCoordinateForArc as A, getInnerX as H, getInnerY as M, degToRad as E } from "./sd-component-library91.js";
|
|
3
|
+
import { getFractionColor as O } from "./sd-component-library236.js";
|
|
4
|
+
import { BaseOutlineArc as X } from "./sd-component-library299.js";
|
|
5
|
+
const w = "#CCD0DB", q = (G) => {
|
|
6
|
+
const {
|
|
7
|
+
diameter: I,
|
|
8
|
+
idx: d,
|
|
9
|
+
endColor: Y,
|
|
10
|
+
startColor: f,
|
|
11
|
+
segmented: v,
|
|
12
|
+
totalRanges: n,
|
|
13
|
+
value: i,
|
|
14
|
+
arc: l,
|
|
15
|
+
innerPointRadius: W,
|
|
16
|
+
pointStrokeWidth: C,
|
|
17
|
+
gaugeWidth: e,
|
|
18
|
+
pointColor: $
|
|
19
|
+
} = G, c = d / n, x = (d + 1) / n, k = i >= c && i <= x, R = (360 - l) / 2, r = I / 2, g = R + l * c, j = R + l * x, { x: u, y: h } = A(
|
|
20
|
+
r,
|
|
21
|
+
g
|
|
22
|
+
), { x: m, y } = A(
|
|
23
|
+
r,
|
|
24
|
+
j
|
|
19
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
|
+
] });
|
|
20
108
|
};
|
|
21
109
|
export {
|
|
22
|
-
|
|
110
|
+
q as GradientMeterRange
|
|
23
111
|
};
|
|
24
112
|
//# sourceMappingURL=sd-component-library237.js.map
|
|
@@ -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,I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;AAAA,MACP;AAAA,IAAA,GACF;AAAA,EACF,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
|