@selfdecode/sd-component-library 4.0.94 → 4.0.95
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/forms-v2/form-v2-input/interfaces.d.ts +1 -0
- package/lib/sd-component-library100.js +3 -3
- package/lib/sd-component-library101.js +2 -2
- package/lib/sd-component-library102.js +3 -3
- package/lib/sd-component-library103.js +2 -2
- package/lib/sd-component-library105.js +4 -4
- package/lib/sd-component-library107.js +4 -4
- package/lib/sd-component-library113.js +1 -1
- package/lib/sd-component-library118.js +1 -1
- package/lib/sd-component-library119.js +2 -2
- package/lib/sd-component-library121.js +1 -1
- package/lib/sd-component-library122.js +1 -1
- package/lib/sd-component-library127.js +2 -2
- package/lib/sd-component-library128.js +2 -2
- package/lib/sd-component-library130.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-library15.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-library196.js +3 -3
- package/lib/sd-component-library197.js +75 -3
- package/lib/sd-component-library197.js.map +1 -1
- package/lib/sd-component-library198.js +3 -75
- package/lib/sd-component-library198.js.map +1 -1
- package/lib/sd-component-library2.js +1 -1
- package/lib/sd-component-library200.js +25 -3
- package/lib/sd-component-library200.js.map +1 -1
- package/lib/sd-component-library201.js +2 -57
- package/lib/sd-component-library201.js.map +1 -1
- package/lib/sd-component-library202.js +30 -25
- package/lib/sd-component-library202.js.map +1 -1
- package/lib/sd-component-library203.js +598 -18
- package/lib/sd-component-library203.js.map +1 -1
- package/lib/sd-component-library204.js +19 -5
- package/lib/sd-component-library204.js.map +1 -1
- package/lib/sd-component-library205.js +5 -18
- package/lib/sd-component-library205.js.map +1 -1
- package/lib/sd-component-library207.js +57 -2
- package/lib/sd-component-library207.js.map +1 -1
- package/lib/sd-component-library208.js +65 -30
- package/lib/sd-component-library208.js.map +1 -1
- package/lib/sd-component-library209.js +18 -599
- package/lib/sd-component-library209.js.map +1 -1
- package/lib/sd-component-library210.js +19 -62
- package/lib/sd-component-library210.js.map +1 -1
- package/lib/sd-component-library211.js +3 -23
- package/lib/sd-component-library211.js.map +1 -1
- package/lib/sd-component-library212.js +3 -65
- package/lib/sd-component-library212.js.map +1 -1
- package/lib/sd-component-library213.js +62 -19
- package/lib/sd-component-library213.js.map +1 -1
- package/lib/sd-component-library214.js +23 -3
- package/lib/sd-component-library214.js.map +1 -1
- package/lib/sd-component-library215.js +40 -3
- package/lib/sd-component-library215.js.map +1 -1
- package/lib/sd-component-library216.js +127 -38
- package/lib/sd-component-library216.js.map +1 -1
- package/lib/sd-component-library217.js +13 -129
- package/lib/sd-component-library217.js.map +1 -1
- package/lib/sd-component-library218.js +14 -13
- package/lib/sd-component-library218.js.map +1 -1
- package/lib/sd-component-library219.js +3 -14
- package/lib/sd-component-library219.js.map +1 -1
- package/lib/sd-component-library220.js +2 -2
- package/lib/sd-component-library220.js.map +1 -1
- package/lib/sd-component-library221.js +2 -2
- package/lib/sd-component-library221.js.map +1 -1
- package/lib/sd-component-library222.js +52 -3
- package/lib/sd-component-library222.js.map +1 -1
- package/lib/sd-component-library223.js +54 -41
- package/lib/sd-component-library223.js.map +1 -1
- package/lib/sd-component-library224.js +3 -65
- package/lib/sd-component-library224.js.map +1 -1
- package/lib/sd-component-library225.js +46 -3
- package/lib/sd-component-library225.js.map +1 -1
- package/lib/sd-component-library226.js +17 -46
- package/lib/sd-component-library226.js.map +1 -1
- package/lib/sd-component-library227.js +26 -17
- package/lib/sd-component-library227.js.map +1 -1
- package/lib/sd-component-library228.js +3 -26
- package/lib/sd-component-library228.js.map +1 -1
- package/lib/sd-component-library23.js +2 -2
- package/lib/sd-component-library233.js +1 -1
- package/lib/sd-component-library235.js +21 -3
- package/lib/sd-component-library235.js.map +1 -1
- package/lib/sd-component-library236.js +95 -115
- package/lib/sd-component-library236.js.map +1 -1
- package/lib/sd-component-library238.js +39 -39
- package/lib/sd-component-library238.js.map +1 -1
- package/lib/sd-component-library239.js +23 -7
- package/lib/sd-component-library239.js.map +1 -1
- package/lib/sd-component-library24.js +1 -1
- package/lib/sd-component-library240.js +51 -62
- package/lib/sd-component-library240.js.map +1 -1
- package/lib/sd-component-library241.js +62 -41
- 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 -21
- package/lib/sd-component-library243.js.map +1 -1
- package/lib/sd-component-library244.js +115 -95
- package/lib/sd-component-library244.js.map +1 -1
- package/lib/sd-component-library245.js +39 -39
- package/lib/sd-component-library245.js.map +1 -1
- package/lib/sd-component-library246.js +7 -23
- package/lib/sd-component-library246.js.map +1 -1
- package/lib/sd-component-library247.js +47 -52
- package/lib/sd-component-library247.js.map +1 -1
- package/lib/sd-component-library248.js +39 -46
- package/lib/sd-component-library248.js.map +1 -1
- package/lib/sd-component-library249.js +26 -74
- package/lib/sd-component-library249.js.map +1 -1
- package/lib/sd-component-library25.js +1 -1
- package/lib/sd-component-library250.js +18 -38
- package/lib/sd-component-library250.js.map +1 -1
- package/lib/sd-component-library251.js +18 -25
- package/lib/sd-component-library251.js.map +1 -1
- package/lib/sd-component-library252.js +323 -19
- package/lib/sd-component-library252.js.map +1 -1
- package/lib/sd-component-library253.js +5 -20
- package/lib/sd-component-library253.js.map +1 -1
- package/lib/sd-component-library254.js +3 -2
- package/lib/sd-component-library254.js.map +1 -1
- package/lib/sd-component-library255.js +2 -29
- package/lib/sd-component-library255.js.map +1 -1
- package/lib/sd-component-library256.js +75 -3
- package/lib/sd-component-library256.js.map +1 -1
- package/lib/sd-component-library257.js +25 -20
- package/lib/sd-component-library257.js.map +1 -1
- package/lib/sd-component-library258.js +1 -1
- package/lib/sd-component-library258.js.map +1 -1
- package/lib/sd-component-library259.js +17 -18
- package/lib/sd-component-library259.js.map +1 -1
- package/lib/sd-component-library260.js +3 -22
- package/lib/sd-component-library260.js.map +1 -1
- package/lib/sd-component-library261.js +18 -44
- package/lib/sd-component-library261.js.map +1 -1
- package/lib/sd-component-library262.js +18 -26
- package/lib/sd-component-library262.js.map +1 -1
- package/lib/sd-component-library263.js +37 -117
- package/lib/sd-component-library263.js.map +1 -1
- package/lib/sd-component-library264.js +30 -74
- package/lib/sd-component-library264.js.map +1 -1
- package/lib/sd-component-library265.js +117 -62
- package/lib/sd-component-library265.js.map +1 -1
- package/lib/sd-component-library266.js +57 -105
- package/lib/sd-component-library266.js.map +1 -1
- package/lib/sd-component-library267.js +75 -29
- package/lib/sd-component-library267.js.map +1 -1
- package/lib/sd-component-library268.js +29 -20
- package/lib/sd-component-library268.js.map +1 -1
- package/lib/sd-component-library269.js +17 -121
- package/lib/sd-component-library269.js.map +1 -1
- package/lib/sd-component-library270.js +125 -10
- package/lib/sd-component-library270.js.map +1 -1
- package/lib/sd-component-library271.js +111 -39
- package/lib/sd-component-library271.js.map +1 -1
- package/lib/sd-component-library272.js +10 -9
- package/lib/sd-component-library272.js.map +1 -1
- package/lib/sd-component-library273.js +48 -323
- package/lib/sd-component-library273.js.map +1 -1
- package/lib/sd-component-library274.js +9 -51
- package/lib/sd-component-library274.js.map +1 -1
- package/lib/sd-component-library275.js +48 -87
- package/lib/sd-component-library275.js.map +1 -1
- package/lib/sd-component-library276.js +52 -54
- package/lib/sd-component-library276.js.map +1 -1
- package/lib/sd-component-library277.js +92 -5
- package/lib/sd-component-library277.js.map +1 -1
- package/lib/sd-component-library316.js +51 -25
- package/lib/sd-component-library316.js.map +1 -1
- package/lib/sd-component-library317.js +34 -50
- package/lib/sd-component-library317.js.map +1 -1
- package/lib/sd-component-library318.js +23 -33
- package/lib/sd-component-library318.js.map +1 -1
- package/lib/sd-component-library32.js +1 -1
- package/lib/sd-component-library33.js +1 -1
- package/lib/sd-component-library49.js +1 -1
- package/lib/sd-component-library5.js +1 -1
- package/lib/sd-component-library50.js +1 -1
- package/lib/sd-component-library51.js +1 -1
- package/lib/sd-component-library52.js +3 -3
- package/lib/sd-component-library53.js +2 -2
- package/lib/sd-component-library54.js +2 -2
- package/lib/sd-component-library57.js +26 -23
- package/lib/sd-component-library57.js.map +1 -1
- package/lib/sd-component-library6.js +1 -1
- package/lib/sd-component-library61.js +1 -1
- package/lib/sd-component-library65.js +1 -1
- package/lib/sd-component-library66.js +1 -1
- package/lib/sd-component-library71.js +2 -2
- package/lib/sd-component-library73.js +3 -3
- package/lib/sd-component-library75.js +2 -2
- package/lib/sd-component-library76.js +3 -3
- package/lib/sd-component-library77.js +1 -1
- package/lib/sd-component-library78.js +1 -1
- package/lib/sd-component-library80.js +1 -1
- package/lib/sd-component-library81.js +1 -1
- package/lib/sd-component-library86.js +1 -1
- package/lib/sd-component-library89.js +1 -1
- package/lib/sd-component-library90.js +3 -3
- package/lib/sd-component-library93.js +3 -3
- package/lib/sd-component-library95.js +5 -5
- package/lib/sd-component-library99.js +2 -2
- package/package.json +1 -1
|
@@ -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","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,E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,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,46 +1,67 @@
|
|
|
1
|
-
import { j as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
1
|
+
import { j as a } from "./sd-component-library196.js";
|
|
2
|
+
import { getCoordinateForArc as i } from "./sd-component-library92.js";
|
|
3
|
+
import { defaultTextBottomMargin as X } from "./sd-component-library229.js";
|
|
4
|
+
import { getRangeProperties as Y } from "./sd-component-library319.js";
|
|
5
|
+
import { BaseOutlineArc as b } from "./sd-component-library318.js";
|
|
6
|
+
import { DiscreteMeterLabelPointer as w } from "./sd-component-library320.js";
|
|
7
|
+
function z(s) {
|
|
5
8
|
const {
|
|
6
|
-
|
|
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
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
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
|
+
] });
|
|
42
63
|
}
|
|
43
64
|
export {
|
|
44
|
-
|
|
65
|
+
z as DiscreteRange
|
|
45
66
|
};
|
|
46
67
|
//# sourceMappingURL=sd-component-library241.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sd-component-library241.js","sources":["../src/components/meters/multi-option-discrete-outline-meter/partials/discrete-
|
|
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,16 +1,46 @@
|
|
|
1
|
-
import { j as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
const {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
1
|
+
import { j as M } from "./sd-component-library196.js";
|
|
2
|
+
import { getInnerX as T, getInnerY as W, degToRad as r, getCoordinateForArc as y } from "./sd-component-library92.js";
|
|
3
|
+
import { BaseNeedle as B } from "./sd-component-library317.js";
|
|
4
|
+
function E(p) {
|
|
5
|
+
const {
|
|
6
|
+
needleColor: u,
|
|
7
|
+
options: n,
|
|
8
|
+
value: h,
|
|
9
|
+
needleWidth: e,
|
|
10
|
+
innerCircleRadius: m,
|
|
11
|
+
innerCircleStrokeWidth: x,
|
|
12
|
+
diameter: R,
|
|
13
|
+
arc: a,
|
|
14
|
+
distanceBetweenRanges: c,
|
|
15
|
+
distanceFromRange: s,
|
|
16
|
+
gaugeWidth: i
|
|
17
|
+
} = p, o = n.findIndex(
|
|
18
|
+
(F) => h === F.value
|
|
19
|
+
), d = R / 2, f = (360 - a) / 2, l = a - (n.length - 1) * c, g = o / n.length, v = (o + 1) / n.length, A = l * (v - g), t = f + c * o + l * g + A / 2, { x: C, y: I } = y(d, t), S = T(
|
|
20
|
+
C,
|
|
21
|
+
r(t),
|
|
22
|
+
s + i + e / 2
|
|
23
|
+
), X = W(
|
|
24
|
+
I,
|
|
25
|
+
r(t),
|
|
26
|
+
s + i + e / 2
|
|
27
|
+
), Y = e / 2 * Math.cos(r(t)), j = e / 2 * Math.sin(r(t));
|
|
28
|
+
return /* @__PURE__ */ M.jsx(
|
|
29
|
+
B,
|
|
30
|
+
{
|
|
31
|
+
dx: Y,
|
|
32
|
+
dy: j,
|
|
33
|
+
color: u,
|
|
34
|
+
radius: d,
|
|
35
|
+
tipX: S,
|
|
36
|
+
tipY: X,
|
|
37
|
+
innerCircleStrokeWidth: x,
|
|
38
|
+
innerCircleRadius: m,
|
|
39
|
+
needleWidth: e
|
|
40
|
+
}
|
|
41
|
+
);
|
|
42
|
+
}
|
|
13
43
|
export {
|
|
14
|
-
|
|
44
|
+
E as DiscreteMeterNeedle
|
|
15
45
|
};
|
|
16
46
|
//# sourceMappingURL=sd-component-library242.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sd-component-library242.js","sources":["../src/components/meters/multi-option-discrete-outline-meter/partials/
|
|
1
|
+
{"version":3,"file":"sd-component-library242.js","sources":["../src/components/meters/multi-option-discrete-outline-meter/partials/discrete-meter-needle/discrete-meter-needle.tsx"],"sourcesContent":["import React, { PropsWithChildren } from \"react\";\n\nimport { BaseNeedle } from \"../../../outline-meter/partials/base-needle\";\nimport {\n degToRad,\n getCoordinateForArc,\n getInnerX,\n getInnerY,\n} from \"../../../outline-meter/utils\";\nimport { DiscreteMeterNeedleProps as Props } from \"./interfaces\";\n\nexport function DiscreteMeterNeedle<T>(props: PropsWithChildren<Props<T>>) {\n const {\n needleColor,\n options,\n value,\n needleWidth,\n innerCircleRadius,\n innerCircleStrokeWidth,\n diameter,\n arc,\n distanceBetweenRanges,\n distanceFromRange,\n gaugeWidth,\n } = props;\n\n const matchingRangeIndex = options.findIndex(\n (option) => value === option.value\n );\n\n const radius = diameter / 2;\n\n const arcStart = (360 - arc) / 2;\n const arcForRanges = arc - (options.length - 1) * distanceBetweenRanges;\n\n const start = matchingRangeIndex / options.length;\n const end = (matchingRangeIndex + 1) / options.length;\n\n const rangeArc = arcForRanges * (end - start);\n\n const rangeArcStart =\n arcStart +\n distanceBetweenRanges * matchingRangeIndex +\n arcForRanges * start;\n\n const valueAlpha = rangeArcStart + rangeArc / 2;\n const { x: valueX, y: valueY } = getCoordinateForArc(radius, valueAlpha);\n\n const needleTipX = getInnerX(\n valueX,\n degToRad(valueAlpha),\n distanceFromRange + gaugeWidth + needleWidth / 2\n );\n const needleTipY = getInnerY(\n valueY,\n degToRad(valueAlpha),\n distanceFromRange + gaugeWidth + needleWidth / 2\n );\n\n const dx = (needleWidth / 2) * Math.cos(degToRad(valueAlpha));\n const dy = (needleWidth / 2) * Math.sin(degToRad(valueAlpha));\n\n return (\n <BaseNeedle\n dx={dx}\n dy={dy}\n color={needleColor}\n radius={radius}\n tipX={needleTipX}\n tipY={needleTipY}\n innerCircleStrokeWidth={innerCircleStrokeWidth}\n innerCircleRadius={innerCircleRadius}\n needleWidth={needleWidth}\n />\n );\n}\n"],"names":["DiscreteMeterNeedle","props","needleColor","options","value","needleWidth","innerCircleRadius","innerCircleStrokeWidth","diameter","arc","distanceBetweenRanges","distanceFromRange","gaugeWidth","matchingRangeIndex","option","radius","arcStart","arcForRanges","start","end","rangeArc","valueAlpha","valueX","valueY","getCoordinateForArc","needleTipX","getInnerX","degToRad","needleTipY","getInnerY","dx","dy","jsx","BaseNeedle"],"mappings":";;;AAWO,SAASA,EAAuBC,GAAoC;AACnE,QAAA;AAAA,IACJ,aAAAC;AAAA,IACA,SAAAC;AAAA,IACA,OAAAC;AAAA,IACA,aAAAC;AAAA,IACA,mBAAAC;AAAA,IACA,wBAAAC;AAAA,IACA,UAAAC;AAAA,IACA,KAAAC;AAAA,IACA,uBAAAC;AAAA,IACA,mBAAAC;AAAA,IACA,YAAAC;AAAA,EACE,IAAAX,GAEEY,IAAqBV,EAAQ;AAAA,IACjC,CAACW,MAAWV,MAAUU,EAAO;AAAA,EAAA,GAGzBC,IAASP,IAAW,GAEpBQ,KAAY,MAAMP,KAAO,GACzBQ,IAAeR,KAAON,EAAQ,SAAS,KAAKO,GAE5CQ,IAAQL,IAAqBV,EAAQ,QACrCgB,KAAON,IAAqB,KAAKV,EAAQ,QAEzCiB,IAAWH,KAAgBE,IAAMD,IAOjCG,IAJJL,IACAN,IAAwBG,IACxBI,IAAeC,IAEkBE,IAAW,GACxC,EAAE,GAAGE,GAAQ,GAAGC,MAAWC,EAAoBT,GAAQM,CAAU,GAEjEI,IAAaC;AAAA,IACjBJ;AAAA,IACAK,EAASN,CAAU;AAAA,IACnBV,IAAoBC,IAAaP,IAAc;AAAA,EAAA,GAE3CuB,IAAaC;AAAA,IACjBN;AAAA,IACAI,EAASN,CAAU;AAAA,IACnBV,IAAoBC,IAAaP,IAAc;AAAA,EAAA,GAG3CyB,IAAMzB,IAAc,IAAK,KAAK,IAAIsB,EAASN,CAAU,CAAC,GACtDU,IAAM1B,IAAc,IAAK,KAAK,IAAIsB,EAASN,CAAU,CAAC;AAG1D,SAAAW,gBAAAA,EAAA;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,IAAAH;AAAA,MACA,IAAAC;AAAA,MACA,OAAO7B;AAAA,MACP,QAAAa;AAAA,MACA,MAAMU;AAAA,MACN,MAAMG;AAAA,MACN,wBAAArB;AAAA,MACA,mBAAAD;AAAA,MACA,aAAAD;AAAA,IAAA;AAAA,EAAA;AAGN;"}
|
|
@@ -1,24 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
return "";
|
|
14
|
-
}, u = (t, n, e) => "#" + (16777216 + (t << 16) + (n << 8) + e).toString(16).slice(1), a = (t) => {
|
|
15
|
-
const n = t.match(/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i);
|
|
16
|
-
return n ? n.slice(1).map((e) => parseInt(e, 16)) : null;
|
|
17
|
-
}, h = (t, n, e) => Math.floor(t * n) === (e === "left" ? 0 : e === "right" ? n - 1 : 1), _ = (t) => t === "left" ? "right" : t === "top" ? "top" : "left";
|
|
1
|
+
import { j as g } from "./sd-component-library196.js";
|
|
2
|
+
import { getRangeProperties as d } from "./sd-component-library319.js";
|
|
3
|
+
import { MatchedRangeLabelBox as x } from "./sd-component-library315.js";
|
|
4
|
+
const h = (e) => {
|
|
5
|
+
const { idx: t, totalRanges: a, distanceBetweenRanges: r, arc: n } = e, { rangeArcStart: o, rangeArcEnd: s } = d(
|
|
6
|
+
n,
|
|
7
|
+
a,
|
|
8
|
+
r,
|
|
9
|
+
t
|
|
10
|
+
), c = Math.round((o + s) / 2);
|
|
11
|
+
return /* @__PURE__ */ g.jsx(x, { ...e, alpha: c, round: !0 });
|
|
12
|
+
};
|
|
18
13
|
export {
|
|
19
|
-
|
|
20
|
-
I as getFractionColor,
|
|
21
|
-
h as isLabelActive,
|
|
22
|
-
T as mapAdjacent
|
|
14
|
+
h as MatchedRangeLabelBox
|
|
23
15
|
};
|
|
24
16
|
//# sourceMappingURL=sd-component-library243.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sd-component-library243.js","sources":["../src/components/meters/
|
|
1
|
+
{"version":3,"file":"sd-component-library243.js","sources":["../src/components/meters/multi-option-discrete-outline-meter/partials/matched-range-label-box/matched-range-label-box.tsx"],"sourcesContent":["import React from \"react\";\n\nimport { MatchedRangeLabelBox as LabelBox } from \"../../../common-outline-meter-partials\";\nimport { getRangeProperties } from \"../../utils\";\nimport { MatchedRangeLabelBoxProps as Props } from \"./interfaces\";\n\nexport const MatchedRangeLabelBox: React.FC<Props> = (props) => {\n const { idx, totalRanges, distanceBetweenRanges, arc } = props;\n\n const { rangeArcStart, rangeArcEnd } = getRangeProperties(\n arc,\n totalRanges,\n distanceBetweenRanges,\n idx\n );\n\n const alpha = Math.round((rangeArcStart + rangeArcEnd) / 2);\n\n return <LabelBox {...props} alpha={alpha} round />;\n};\n"],"names":["MatchedRangeLabelBox","props","idx","totalRanges","distanceBetweenRanges","arc","rangeArcStart","rangeArcEnd","getRangeProperties","alpha","LabelBox"],"mappings":";;;AAMa,MAAAA,IAAwC,CAACC,MAAU;AAC9D,QAAM,EAAE,KAAAC,GAAK,aAAAC,GAAa,uBAAAC,GAAuB,KAAAC,MAAQJ,GAEnD,EAAE,eAAAK,GAAe,aAAAC,EAAA,IAAgBC;AAAA,IACrCH;AAAA,IACAF;AAAA,IACAC;AAAA,IACAF;AAAA,EAAA,GAGIO,IAAQ,KAAK,OAAOH,IAAgBC,KAAe,CAAC;AAE1D,+BAAQG,GAAU,EAAA,GAAGT,GAAO,OAAAQ,GAAc,OAAK,GAAC,CAAA;AAClD;"}
|
|
@@ -1,112 +1,132 @@
|
|
|
1
|
-
import { j as
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import { BaseOutlineArc as X } from "./sd-component-
|
|
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
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
1
|
+
import { j as e } from "./sd-component-library196.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-library92.js";
|
|
4
|
+
import { BaseOutlineArc as X } from "./sd-component-library318.js";
|
|
5
|
+
import { OutlineMeterLabelPointer as O } from "./sd-component-library239.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(
|
|
66
76
|
X,
|
|
67
77
|
{
|
|
68
|
-
startX:
|
|
69
|
-
startY:
|
|
70
|
-
endX:
|
|
71
|
-
endY:
|
|
72
|
-
startAlpha:
|
|
73
|
-
endAlpha:
|
|
74
|
-
color:
|
|
75
|
-
radius:
|
|
76
|
-
width:
|
|
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,
|
|
77
87
|
roundEnd: !1
|
|
78
88
|
}
|
|
79
89
|
),
|
|
80
|
-
/* @__PURE__ */
|
|
90
|
+
/* @__PURE__ */ e.jsx(
|
|
81
91
|
X,
|
|
82
92
|
{
|
|
83
|
-
startX:
|
|
84
|
-
startY:
|
|
85
|
-
endX:
|
|
86
|
-
endY:
|
|
87
|
-
startAlpha:
|
|
88
|
-
endAlpha:
|
|
89
|
-
color:
|
|
90
|
-
radius:
|
|
91
|
-
width:
|
|
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,
|
|
92
102
|
roundStart: !1
|
|
93
103
|
}
|
|
94
104
|
),
|
|
95
|
-
/* @__PURE__ */
|
|
105
|
+
/* @__PURE__ */ e.jsx(
|
|
96
106
|
"circle",
|
|
97
107
|
{
|
|
98
|
-
cx: (
|
|
99
|
-
cy: (
|
|
100
|
-
r:
|
|
101
|
-
strokeWidth:
|
|
102
|
-
stroke:
|
|
103
|
-
fill: "white"
|
|
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
|
|
104
124
|
}
|
|
105
125
|
)
|
|
106
|
-
] })
|
|
107
|
-
|
|
108
|
-
|
|
126
|
+
] });
|
|
127
|
+
}
|
|
128
|
+
);
|
|
109
129
|
export {
|
|
110
|
-
|
|
130
|
+
st as OutlineMeterRange
|
|
111
131
|
};
|
|
112
132
|
//# sourceMappingURL=sd-component-library244.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sd-component-library244.js","sources":["../src/components/meters/
|
|
1
|
+
{"version":3,"file":"sd-component-library244.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,I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