@selfdecode/sd-component-library 4.0.150 → 4.0.151
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/components/links/link/interfaces.d.ts +2 -0
- package/lib/sd-component-library100.js +4 -4
- package/lib/sd-component-library104.js +1 -1
- package/lib/sd-component-library105.js +1 -1
- package/lib/sd-component-library110.js +1 -1
- package/lib/sd-component-library111.js +2 -2
- package/lib/sd-component-library113.js +1 -1
- package/lib/sd-component-library114.js +1 -1
- package/lib/sd-component-library119.js +2 -2
- package/lib/sd-component-library120.js +2 -2
- package/lib/sd-component-library122.js +1 -1
- package/lib/sd-component-library125.js +3 -3
- package/lib/sd-component-library126.js +1 -1
- package/lib/sd-component-library13.js +1 -1
- package/lib/sd-component-library141.js +1 -1
- package/lib/sd-component-library144.js +1 -1
- package/lib/sd-component-library145.js +4 -4
- package/lib/sd-component-library169.js +3 -3
- package/lib/sd-component-library172.js +60 -2
- package/lib/sd-component-library172.js.map +1 -1
- package/lib/sd-component-library173.js +2 -30
- package/lib/sd-component-library173.js.map +1 -1
- package/lib/sd-component-library174.js +21 -590
- package/lib/sd-component-library174.js.map +1 -1
- package/lib/sd-component-library175.js +595 -56
- package/lib/sd-component-library175.js.map +1 -1
- package/lib/sd-component-library176.js +57 -3
- package/lib/sd-component-library176.js.map +1 -1
- package/lib/sd-component-library177.js +3 -26
- package/lib/sd-component-library177.js.map +1 -1
- package/lib/sd-component-library178.js +24 -55
- package/lib/sd-component-library178.js.map +1 -1
- package/lib/sd-component-library180.js +55 -31
- package/lib/sd-component-library180.js.map +1 -1
- package/lib/sd-component-library181.js +21 -127
- package/lib/sd-component-library181.js.map +1 -1
- package/lib/sd-component-library182.js +40 -13
- package/lib/sd-component-library182.js.map +1 -1
- package/lib/sd-component-library183.js +128 -13
- package/lib/sd-component-library183.js.map +1 -1
- package/lib/sd-component-library184.js +13 -3
- package/lib/sd-component-library184.js.map +1 -1
- package/lib/sd-component-library185.js +14 -3
- package/lib/sd-component-library185.js.map +1 -1
- package/lib/sd-component-library186.js +2 -2
- package/lib/sd-component-library186.js.map +1 -1
- package/lib/sd-component-library187.js +3 -52
- package/lib/sd-component-library187.js.map +1 -1
- package/lib/sd-component-library188.js +3 -46
- package/lib/sd-component-library188.js.map +1 -1
- package/lib/sd-component-library189.js +37 -63
- package/lib/sd-component-library189.js.map +1 -1
- package/lib/sd-component-library190.js +78 -3
- package/lib/sd-component-library190.js.map +1 -1
- package/lib/sd-component-library191.js +3 -17
- package/lib/sd-component-library191.js.map +1 -1
- package/lib/sd-component-library192.js +44 -62
- package/lib/sd-component-library192.js.map +1 -1
- package/lib/sd-component-library193.js +17 -23
- package/lib/sd-component-library193.js.map +1 -1
- package/lib/sd-component-library194.js +3 -29
- package/lib/sd-component-library194.js.map +1 -1
- package/lib/sd-component-library195.js +31 -3
- package/lib/sd-component-library195.js.map +1 -1
- package/lib/sd-component-library196.js +18 -23
- package/lib/sd-component-library196.js.map +1 -1
- package/lib/sd-component-library197.js +20 -3
- package/lib/sd-component-library197.js.map +1 -1
- package/lib/sd-component-library198.js +27 -324
- package/lib/sd-component-library198.js.map +1 -1
- package/lib/sd-component-library199.js +33 -5
- package/lib/sd-component-library199.js.map +1 -1
- package/lib/sd-component-library201.js +3 -3
- package/lib/sd-component-library201.js.map +1 -1
- package/lib/sd-component-library202.js +64 -31
- package/lib/sd-component-library202.js.map +1 -1
- package/lib/sd-component-library203.js +43 -19
- package/lib/sd-component-library203.js.map +1 -1
- package/lib/sd-component-library204.js +43 -20
- package/lib/sd-component-library204.js.map +1 -1
- package/lib/sd-component-library205.js +13 -28
- package/lib/sd-component-library205.js.map +1 -1
- package/lib/sd-component-library206.js +21 -33
- package/lib/sd-component-library206.js.map +1 -1
- package/lib/sd-component-library207.js +109 -3
- package/lib/sd-component-library207.js.map +1 -1
- package/lib/sd-component-library208.js +46 -128
- package/lib/sd-component-library208.js.map +1 -1
- package/lib/sd-component-library209.js +23 -42
- package/lib/sd-component-library209.js.map +1 -1
- package/lib/sd-component-library21.js +1 -1
- package/lib/sd-component-library210.js +49 -43
- package/lib/sd-component-library210.js.map +1 -1
- package/lib/sd-component-library211.js +129 -8
- package/lib/sd-component-library211.js.map +1 -1
- package/lib/sd-component-library212.js +45 -62
- package/lib/sd-component-library212.js.map +1 -1
- package/lib/sd-component-library213.js +8 -43
- package/lib/sd-component-library213.js.map +1 -1
- package/lib/sd-component-library214.js +47 -12
- package/lib/sd-component-library214.js.map +1 -1
- package/lib/sd-component-library215.js +75 -21
- package/lib/sd-component-library215.js.map +1 -1
- package/lib/sd-component-library216.js +35 -103
- package/lib/sd-component-library216.js.map +1 -1
- package/lib/sd-component-library217.js +27 -47
- package/lib/sd-component-library217.js.map +1 -1
- package/lib/sd-component-library218.js +20 -23
- package/lib/sd-component-library218.js.map +1 -1
- package/lib/sd-component-library219.js +20 -53
- package/lib/sd-component-library219.js.map +1 -1
- package/lib/sd-component-library220.js +2 -48
- package/lib/sd-component-library220.js.map +1 -1
- package/lib/sd-component-library221.js +324 -74
- package/lib/sd-component-library221.js.map +1 -1
- package/lib/sd-component-library222.js +5 -41
- package/lib/sd-component-library222.js.map +1 -1
- package/lib/sd-component-library223.js +25 -27
- package/lib/sd-component-library223.js.map +1 -1
- package/lib/sd-component-library224.js +3 -2
- package/lib/sd-component-library224.js.map +1 -1
- package/lib/sd-component-library225.js +22 -2
- package/lib/sd-component-library225.js.map +1 -1
- package/lib/sd-component-library226.js +3 -21
- package/lib/sd-component-library226.js.map +1 -1
- package/lib/sd-component-library227.js +29 -20
- package/lib/sd-component-library227.js.map +1 -1
- package/lib/sd-component-library228.js +24 -2
- package/lib/sd-component-library228.js.map +1 -1
- package/lib/sd-component-library229.js +30 -25
- package/lib/sd-component-library229.js.map +1 -1
- package/lib/sd-component-library230.js +50 -21
- package/lib/sd-component-library230.js.map +1 -1
- package/lib/sd-component-library231.js +134 -30
- package/lib/sd-component-library231.js.map +1 -1
- package/lib/sd-component-library232.js +62 -39
- package/lib/sd-component-library232.js.map +1 -1
- package/lib/sd-component-library233.js +62 -120
- package/lib/sd-component-library233.js.map +1 -1
- package/lib/sd-component-library234.js +30 -74
- package/lib/sd-component-library234.js.map +1 -1
- package/lib/sd-component-library235.js +15 -70
- package/lib/sd-component-library235.js.map +1 -1
- package/lib/sd-component-library236.js +120 -25
- package/lib/sd-component-library236.js.map +1 -1
- package/lib/sd-component-library237.js +117 -16
- package/lib/sd-component-library237.js.map +1 -1
- package/lib/sd-component-library238.js +9 -125
- package/lib/sd-component-library238.js.map +1 -1
- package/lib/sd-component-library239.js +46 -117
- package/lib/sd-component-library239.js.map +1 -1
- package/lib/sd-component-library240.js +89 -8
- package/lib/sd-component-library240.js.map +1 -1
- package/lib/sd-component-library241.js +89 -48
- package/lib/sd-component-library241.js.map +1 -1
- package/lib/sd-component-library242.js +2 -90
- package/lib/sd-component-library242.js.map +1 -1
- package/lib/sd-component-library243.js +2 -92
- package/lib/sd-component-library243.js.map +1 -1
- package/lib/sd-component-library247.js +2 -2
- package/lib/sd-component-library248.js +2 -2
- package/lib/sd-component-library259.js +3 -3
- package/lib/sd-component-library260.js +4 -4
- package/lib/sd-component-library261.js +1 -1
- package/lib/sd-component-library262.js +25 -12
- package/lib/sd-component-library262.js.map +1 -1
- package/lib/sd-component-library263.js +93 -5
- package/lib/sd-component-library263.js.map +1 -1
- package/lib/sd-component-library264.js +51 -4
- package/lib/sd-component-library264.js.map +1 -1
- package/lib/sd-component-library265.js +35 -19
- package/lib/sd-component-library265.js.map +1 -1
- package/lib/sd-component-library266.js +5 -3
- package/lib/sd-component-library266.js.map +1 -1
- package/lib/sd-component-library267.js +21 -22
- package/lib/sd-component-library267.js.map +1 -1
- package/lib/sd-component-library268.js +4 -93
- package/lib/sd-component-library268.js.map +1 -1
- package/lib/sd-component-library269.js +13 -51
- package/lib/sd-component-library269.js.map +1 -1
- package/lib/sd-component-library270.js +5 -35
- package/lib/sd-component-library270.js.map +1 -1
- package/lib/sd-component-library271.js +3 -24
- package/lib/sd-component-library271.js.map +1 -1
- package/lib/sd-component-library272.js +19 -5
- package/lib/sd-component-library272.js.map +1 -1
- package/lib/sd-component-library273.js +3 -4
- package/lib/sd-component-library273.js.map +1 -1
- package/lib/sd-component-library275.js +2 -28
- package/lib/sd-component-library275.js.map +1 -1
- package/lib/sd-component-library276.js +76 -20
- package/lib/sd-component-library276.js.map +1 -1
- package/lib/sd-component-library277.js +93 -2
- package/lib/sd-component-library277.js.map +1 -1
- package/lib/sd-component-library278.js +50 -74
- package/lib/sd-component-library278.js.map +1 -1
- package/lib/sd-component-library279.js +8 -92
- package/lib/sd-component-library279.js.map +1 -1
- package/lib/sd-component-library280.js +4 -52
- package/lib/sd-component-library280.js.map +1 -1
- package/lib/sd-component-library281.js +52 -8
- package/lib/sd-component-library281.js.map +1 -1
- package/lib/sd-component-library282.js +28 -5
- package/lib/sd-component-library282.js.map +1 -1
- package/lib/sd-component-library283.js +19 -51
- package/lib/sd-component-library283.js.map +1 -1
- package/lib/sd-component-library47.js +2 -2
- package/lib/sd-component-library48.js +2 -2
- package/lib/sd-component-library55.js +1 -1
- package/lib/sd-component-library59.js +1 -1
- package/lib/sd-component-library6.js +1 -1
- package/lib/sd-component-library60.js +1 -1
- package/lib/sd-component-library65.js +2 -2
- package/lib/sd-component-library67.js +3 -3
- package/lib/sd-component-library69.js +2 -2
- package/lib/sd-component-library7.js +1 -1
- package/lib/sd-component-library70.js +3 -3
- package/lib/sd-component-library71.js +1 -1
- package/lib/sd-component-library72.js +1 -1
- package/lib/sd-component-library74.js +1 -1
- package/lib/sd-component-library75.js +1 -1
- package/lib/sd-component-library76.js +9 -8
- package/lib/sd-component-library76.js.map +1 -1
- package/lib/sd-component-library81.js +6 -6
- package/lib/sd-component-library82.js +2 -2
- package/lib/sd-component-library83.js +1 -1
- package/lib/sd-component-library84.js +5 -5
- package/lib/sd-component-library85.js +1 -1
- package/lib/sd-component-library87.js +6 -6
- package/lib/sd-component-library88.js +1 -1
- package/lib/sd-component-library89.js +7 -7
- package/lib/sd-component-library90.js +1 -1
- package/lib/sd-component-library93.js +2 -2
- package/lib/sd-component-library94.js +3 -3
- package/lib/sd-component-library95.js +2 -2
- package/lib/sd-component-library96.js +3 -3
- package/lib/sd-component-library97.js +2 -2
- package/lib/sd-component-library98.js +4 -4
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sd-component-library211.js","sources":["../src/components/meters/outline-meter/partials/outline-meter-
|
|
1
|
+
{"version":3,"file":"sd-component-library211.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;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d;AAAA,MACAgC,gBAAAA,EAAA;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,KAAKI,IAASE,KAAe;AAAA,UAC7B,KAAKD,IAASI,KAAe;AAAA,UAC7B,GAAGtC,IAAmBC;AAAA,UACtB,aAAaD;AAAA,UACb,QAAQV;AAAA,UACR,MAAK;AAAA,UACL,KAAKH;AAAA,QAAA;AAAA,MACP;AAAA,MACC,CAACkB,KAAcF,KACd0B,gBAAAA,EAAA;AAAA,QAACE;AAAA,QAAA;AAAA,UACC,UAAAvC;AAAA,UACA,WAAS;AAAA,UACT,UAAU+B;AAAA,UACV,oBAAArB;AAAA,QAAA;AAAA,MACF;AAAA,IAEJ,EAAA,CAAA;AAAA,EAEJ;AACF;"}
|
|
@@ -1,67 +1,50 @@
|
|
|
1
|
-
import { j as
|
|
2
|
-
import { getCoordinateForArc as
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
import { BaseOutlineArc as b } from "./sd-component-library271.js";
|
|
6
|
-
import { DiscreteMeterLabelPointer as w } from "./sd-component-library273.js";
|
|
7
|
-
function z(s) {
|
|
1
|
+
import { j as k } from "./sd-component-library169.js";
|
|
2
|
+
import { isValueInRange as w, getInnerX as E, getInnerY as O, degToRad as r, getCoordinateForArc as V } from "./sd-component-library86.js";
|
|
3
|
+
import { BaseNeedle as b } from "./sd-component-library265.js";
|
|
4
|
+
const G = (x) => {
|
|
8
5
|
const {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
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,
|
|
14
16
|
distanceBetweenRanges: l,
|
|
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
|
-
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
|
-
}
|
|
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
|
+
}
|
|
45
|
+
);
|
|
46
|
+
};
|
|
64
47
|
export {
|
|
65
|
-
|
|
48
|
+
G as OutlineMeterNeedle
|
|
66
49
|
};
|
|
67
50
|
//# sourceMappingURL=sd-component-library212.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sd-component-library212.js","sources":["../src/components/meters/
|
|
1
|
+
{"version":3,"file":"sd-component-library212.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,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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
|
-
}
|
|
1
|
+
import { j as m } from "./sd-component-library169.js";
|
|
2
|
+
import { isValueInRange as x } from "./sd-component-library86.js";
|
|
3
|
+
import { BaseMeterLabelBox as u } from "./sd-component-library210.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 });
|
|
7
|
+
};
|
|
43
8
|
export {
|
|
44
|
-
|
|
9
|
+
g as OutlineMeterLabelBox
|
|
45
10
|
};
|
|
46
11
|
//# sourceMappingURL=sd-component-library213.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sd-component-library213.js","sources":["../src/components/meters/
|
|
1
|
+
{"version":3,"file":"sd-component-library213.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,16 +1,51 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
import { getCoordinateForArc as s } from "./sd-component-library86.js";
|
|
2
|
+
const v = (r) => {
|
|
3
|
+
const a = `Received ${r.map(
|
|
4
|
+
({ start: e, end: t }) => `(${e},${t})`
|
|
5
|
+
)}`, n = (e) => console.error(e, a);
|
|
6
|
+
if (r.some(
|
|
7
|
+
({ start: e, end: t }) => [e, t].some((o) => o < 0 || o > 1)
|
|
8
|
+
))
|
|
9
|
+
return n("Segment values should be between 0 and 1"), !1;
|
|
10
|
+
if (r.reduce(
|
|
11
|
+
(e, { start: t }) => e + (t === 0 ? 1 : 0),
|
|
12
|
+
0
|
|
13
|
+
) !== 1)
|
|
14
|
+
return n("One segment should start from 0"), !1;
|
|
15
|
+
if (r.reduce((e, { end: t }) => e + (t === 1 ? 1 : 0), 0) !== 1)
|
|
16
|
+
return n("One segment should end by 1"), !1;
|
|
17
|
+
if (r.some(({ start: e, end: t }) => e >= t))
|
|
18
|
+
return n("Segment start should be smaller than end"), !1;
|
|
19
|
+
for (let e = 1; e < r.length; e++) {
|
|
20
|
+
const t = r[e];
|
|
21
|
+
if (r[e - 1].end !== t.start)
|
|
22
|
+
return n("Previous segment end should be equal to next segment start"), !1;
|
|
23
|
+
}
|
|
24
|
+
return !0;
|
|
25
|
+
}, x = ({ start: r, end: a }, n, e) => {
|
|
26
|
+
const t = n - e, o = Math.round(r * 360), c = Math.round(a * 360), d = c - o, { x: l, y: u } = s(n, o), { x: f, y: m } = s(
|
|
27
|
+
t,
|
|
28
|
+
o,
|
|
29
|
+
n
|
|
30
|
+
), { x: h, y: i } = s(n, c), { x: g, y: S } = s(
|
|
31
|
+
t,
|
|
32
|
+
c,
|
|
33
|
+
n
|
|
34
|
+
);
|
|
35
|
+
return {
|
|
36
|
+
startX: l,
|
|
37
|
+
startY: u,
|
|
38
|
+
endX: h,
|
|
39
|
+
endY: i,
|
|
40
|
+
startInnerX: f,
|
|
41
|
+
startInnerY: m,
|
|
42
|
+
endInnerX: g,
|
|
43
|
+
endInnerY: S,
|
|
44
|
+
arc: d
|
|
45
|
+
};
|
|
12
46
|
};
|
|
13
47
|
export {
|
|
14
|
-
|
|
48
|
+
v as areSegmentsValid,
|
|
49
|
+
x as getSegmentCoordinates
|
|
15
50
|
};
|
|
16
51
|
//# sourceMappingURL=sd-component-library214.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sd-component-library214.js","sources":["../src/components/meters/
|
|
1
|
+
{"version":3,"file":"sd-component-library214.js","sources":["../src/components/meters/donut-diagram/utils.ts"],"sourcesContent":["import { getCoordinateForArc } from \"../outline-meter/utils\";\nimport { DonutSegment } from \"./interfaces\";\n\nexport const areSegmentsValid = (\n segments: Pick<DonutSegment, \"start\" | \"end\">[]\n): boolean => {\n const receivedSegments = `Received ${segments.map(\n ({ start, end }) => `(${start},${end})`\n )}`;\n const showError = (text: string) => console.error(text, receivedSegments);\n\n if (\n segments.some(({ start, end }) =>\n [start, end].some((point) => point < 0 || point > 1)\n )\n ) {\n showError(\"Segment values should be between 0 and 1\");\n return false;\n }\n\n if (\n segments.reduce<number>(\n (acc, { start }) => acc + (start === 0 ? 1 : 0),\n 0\n ) !== 1\n ) {\n showError(\"One segment should start from 0\");\n return false;\n }\n\n if (\n segments.reduce<number>((acc, { end }) => acc + (end === 1 ? 1 : 0), 0) !==\n 1\n ) {\n showError(\"One segment should end by 1\");\n return false;\n }\n\n if (segments.some(({ start, end }) => start >= end)) {\n showError(\"Segment start should be smaller than end\");\n return false;\n }\n\n for (let i = 1; i < segments.length; i++) {\n const currentSegment = segments[i];\n const prevSegment = segments[i - 1];\n if (prevSegment.end !== currentSegment.start) {\n showError(\"Previous segment end should be equal to next segment start\");\n return false;\n }\n }\n\n return true;\n};\n\nexport const getSegmentCoordinates = (\n { start, end }: Pick<DonutSegment, \"start\" | \"end\">,\n radius: number,\n segmentWidth: number\n) => {\n const innerRadius = radius - segmentWidth;\n\n const startAlpha = Math.round(start * 360);\n const endAlpha = Math.round(end * 360);\n const arc = endAlpha - startAlpha;\n\n const { x: startX, y: startY } = getCoordinateForArc(radius, startAlpha);\n const { x: startInnerX, y: startInnerY } = getCoordinateForArc(\n innerRadius,\n startAlpha,\n radius\n );\n\n const { x: endX, y: endY } = getCoordinateForArc(radius, endAlpha);\n const { x: endInnerX, y: endInnerY } = getCoordinateForArc(\n innerRadius,\n endAlpha,\n radius\n );\n return {\n startX,\n startY,\n endX,\n endY,\n startInnerX,\n startInnerY,\n endInnerX,\n endInnerY,\n arc,\n };\n};\n"],"names":["areSegmentsValid","segments","receivedSegments","start","end","showError","text","point","acc","i","currentSegment","getSegmentCoordinates","radius","segmentWidth","innerRadius","startAlpha","endAlpha","arc","startX","startY","getCoordinateForArc","startInnerX","startInnerY","endX","endY","endInnerX","endInnerY"],"mappings":";AAGa,MAAAA,IAAmB,CAC9BC,MACY;AACN,QAAAC,IAAmB,YAAYD,EAAS;AAAA,IAC5C,CAAC,EAAE,OAAAE,GAAO,KAAAC,QAAU,IAAID,CAAK,IAAIC,CAAG;AAAA,EACrC,CAAA,IACKC,IAAY,CAACC,MAAiB,QAAQ,MAAMA,GAAMJ,CAAgB;AAExE,MACED,EAAS;AAAA,IAAK,CAAC,EAAE,OAAAE,GAAO,KAAAC,QACtB,CAACD,GAAOC,CAAG,EAAE,KAAK,CAACG,MAAUA,IAAQ,KAAKA,IAAQ,CAAC;AAAA,EAAA;AAGrD,WAAAF,EAAU,0CAA0C,GAC7C;AAGT,MACEJ,EAAS;AAAA,IACP,CAACO,GAAK,EAAE,OAAAL,QAAYK,KAAOL,MAAU,IAAI,IAAI;AAAA,IAC7C;AAAA,QACI;AAEN,WAAAE,EAAU,iCAAiC,GACpC;AAGT,MACEJ,EAAS,OAAe,CAACO,GAAK,EAAE,KAAAJ,EAAI,MAAMI,KAAOJ,MAAQ,IAAI,IAAI,IAAI,CAAC,MACtE;AAEA,WAAAC,EAAU,6BAA6B,GAChC;AAGL,MAAAJ,EAAS,KAAK,CAAC,EAAE,OAAAE,GAAO,KAAAC,QAAUD,KAAS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";
|
|
2
|
+
import { useHover as Z } from "./sd-component-library3.js";
|
|
3
|
+
import { getCoordinateForArc as l } from "./sd-component-library86.js";
|
|
4
|
+
import { getSegmentCoordinates as O } from "./sd-component-library214.js";
|
|
5
|
+
import { SegmentLabel as q } from "./sd-component-library285.js";
|
|
6
|
+
const h = 300, G = ({
|
|
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
|
+
] });
|
|
74
|
+
};
|
|
18
75
|
export {
|
|
19
|
-
|
|
20
|
-
I as getFractionColor,
|
|
21
|
-
h as isLabelActive,
|
|
22
|
-
T as mapAdjacent
|
|
76
|
+
G as Segment
|
|
23
77
|
};
|
|
24
78
|
//# sourceMappingURL=sd-component-library215.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sd-component-library215.js","sources":["../src/components/meters/
|
|
1
|
+
{"version":3,"file":"sd-component-library215.js","sources":["../src/components/meters/donut-diagram/partials/segment/segment.tsx"],"sourcesContent":["import React from \"react\";\n\nimport { useHover } from \"../../../../../core/custom-hooks\";\nimport { getCoordinateForArc } from \"../../../outline-meter/utils\";\nimport { getSegmentCoordinates } from \"../../utils\";\nimport { SegmentLabel } from \"../segment-label\";\nimport { SegmentProps as Props } from \"./interfaces\";\n\nconst animationDuration = 300;\n\nexport const Segment: React.FC<Props> = ({\n segment,\n segmentWidth,\n outlineWidth,\n size: diameter,\n mobile,\n ...labelProps\n}) => {\n const { start, end, color } = segment;\n const { labelOffset } = labelProps;\n\n const radius = diameter / 2;\n const innerRadius = radius - segmentWidth;\n\n const {\n startInnerX,\n startInnerY,\n endInnerX,\n endInnerY,\n endX,\n endY,\n startY,\n startX,\n arc,\n } = getSegmentCoordinates(segment, radius, segmentWidth);\n\n const center = diameter / 2;\n\n const startAlpha = Math.round(start * 360);\n const endAlpha = Math.round(end * 360);\n\n const { isHover, hoverCallbacks } = useHover();\n const showHover = isHover && !mobile;\n\n const maxRadius = Math.sqrt(2) * (radius + labelOffset);\n\n const { x: maskStartX, y: maskStartY } = getCoordinateForArc(\n maxRadius,\n startAlpha,\n radius\n );\n\n const { x: maskEndX, y: maskEndY } = getCoordinateForArc(\n maxRadius,\n endAlpha,\n radius\n );\n\n return (\n <g {...(mobile ? {} : hoverCallbacks)}>\n {/* mask */}\n <path\n d={`M${center},${center} L${maskStartX},${maskStartY} A${maxRadius},${maxRadius} 0 ${\n arc > 180 ? \"1\" : \"0\"\n },1 ${maskEndX},${maskEndY}Z`}\n fill=\"transparent\"\n />\n\n {/* colored sector */}\n <path\n d={`M${center},${center} L${startX},${startY} A${radius},${radius} 0 ${\n arc > 180 ? \"1\" : \"0\"\n },1 ${endX},${endY}Z`}\n fill={color}\n strokeWidth={outlineWidth}\n stroke=\"white\"\n />\n\n {/* white inner sector */}\n <path\n d={`M${center},${center} L${startInnerX},${startInnerY} A${innerRadius},${innerRadius} 0 ${\n arc > 180 ? \"1\" : \"0\"\n },1 ${endInnerX},${endInnerY}Z`}\n fill=\"white\"\n style={{\n transform: `scale(${showHover ? 0.8 : 1}`,\n transformOrigin: \"center\",\n transition: `all ${animationDuration}ms`,\n }}\n />\n\n <SegmentLabel\n segment={segment}\n radius={radius}\n animationDuration={animationDuration}\n isHover={showHover}\n mobile={mobile}\n {...labelProps}\n />\n </g>\n );\n};\n"],"names":["animationDuration","Segment","segment","segmentWidth","outlineWidth","diameter","mobile","labelProps","start","end","color","labelOffset","radius","innerRadius","startInnerX","startInnerY","endInnerX","endInnerY","endX","endY","startY","startX","arc","getSegmentCoordinates","center","startAlpha","endAlpha","isHover","hoverCallbacks","useHover","showHover","maxRadius","maskStartX","maskStartY","getCoordinateForArc","maskEndX","maskEndY","jsx","SegmentLabel"],"mappings":";;;;;AAQA,MAAMA,IAAoB,KAEbC,IAA2B,CAAC;AAAA,EACvC,SAAAC;AAAA,EACA,cAAAC;AAAA,EACA,cAAAC;AAAA,EACA,MAAMC;AAAA,EACN,QAAAC;AAAA,EACA,GAAGC;AACL,MAAM;AACJ,QAAM,EAAE,OAAAC,GAAO,KAAAC,GAAK,OAAAC,EAAA,IAAUR,GACxB,EAAE,aAAAS,EAAgB,IAAAJ,GAElBK,IAASP,IAAW,GACpBQ,IAAcD,IAAST,GAEvB;AAAA,IACJ,aAAAW;AAAA,IACA,aAAAC;AAAA,IACA,WAAAC;AAAA,IACA,WAAAC;AAAA,IACA,MAAAC;AAAA,IACA,MAAAC;AAAA,IACA,QAAAC;AAAA,IACA,QAAAC;AAAA,IACA,KAAAC;AAAA,EACE,IAAAC,EAAsBrB,GAASU,GAAQT,CAAY,GAEjDqB,IAASnB,IAAW,GAEpBoB,IAAa,KAAK,MAAMjB,IAAQ,GAAG,GACnCkB,IAAW,KAAK,MAAMjB,IAAM,GAAG,GAE/B,EAAE,SAAAkB,GAAS,gBAAAC,EAAe,IAAIC,EAAS,GACvCC,IAAYH,KAAW,CAACrB,GAExByB,IAAY,KAAK,KAAK,CAAC,KAAKnB,IAASD,IAErC,EAAE,GAAGqB,GAAY,GAAGC,EAAe,IAAAC;AAAA,IACvCH;AAAA,IACAN;AAAA,IACAb;AAAA,EAAA,GAGI,EAAE,GAAGuB,GAAU,GAAGC,EAAa,IAAAF;AAAA,IACnCH;AAAA,IACAL;AAAA,IACAd;AAAA,EAAA;AAGF,gCACG,KAAG,EAAA,GAAIN,IAAS,KAAKsB,G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
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
arc:
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
);
|
|
26
|
-
if (v || !k)
|
|
27
|
-
return /* @__PURE__ */ t.jsx(
|
|
28
|
-
X,
|
|
1
|
+
import { j as n } from "./sd-component-library169.js";
|
|
2
|
+
import g from "./sd-component-library168.js";
|
|
3
|
+
import { getSegmentCoordinates as I } from "./sd-component-library214.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",
|
|
29
25
|
{
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
startAlpha: g,
|
|
35
|
-
endAlpha: j,
|
|
36
|
-
color: v || i > x ? `url(#gradient-${f}-${Y})` : w,
|
|
37
|
-
radius: r,
|
|
38
|
-
width: e
|
|
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"
|
|
39
30
|
}
|
|
40
|
-
)
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
/* @__PURE__ */ t.jsx("defs", { children: /* @__PURE__ */ t.jsxs(
|
|
44
|
-
"linearGradient",
|
|
31
|
+
),
|
|
32
|
+
/* @__PURE__ */ n.jsx(
|
|
33
|
+
"path",
|
|
45
34
|
{
|
|
46
|
-
|
|
47
|
-
|
|
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
|
-
]
|
|
35
|
+
d: `M${r},${r} L${h},${p} A${$},${$} 0 ${i > 180 ? "1" : "0"},1 ${x},${u}Z`,
|
|
36
|
+
fill: "white"
|
|
62
37
|
}
|
|
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
|
-
] })
|
|
38
|
+
)
|
|
107
39
|
] });
|
|
108
40
|
};
|
|
109
41
|
export {
|
|
110
|
-
|
|
42
|
+
w as CompactDonutGaugeSegment
|
|
111
43
|
};
|
|
112
44
|
//# sourceMappingURL=sd-component-library216.js.map
|