@selfdecode/sd-component-library 4.0.145 → 4.0.147
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/buttons/button/interfaces.d.ts +1 -0
- package/lib/sd-component-library100.js +2 -2
- package/lib/sd-component-library101.js +3 -3
- package/lib/sd-component-library102.js +2 -2
- package/lib/sd-component-library104.js +4 -4
- package/lib/sd-component-library106.js +4 -4
- package/lib/sd-component-library111.js +1 -1
- package/lib/sd-component-library117.js +1 -1
- package/lib/sd-component-library118.js +1 -1
- package/lib/sd-component-library120.js +1 -1
- package/lib/sd-component-library121.js +1 -1
- package/lib/sd-component-library126.js +1 -1
- package/lib/sd-component-library127.js +1 -1
- package/lib/sd-component-library129.js +1 -1
- package/lib/sd-component-library133.js +3 -3
- package/lib/sd-component-library136.js +2 -2
- package/lib/sd-component-library168.js +1 -1
- package/lib/sd-component-library171.js +1 -1
- package/lib/sd-component-library172.js +4 -4
- package/lib/sd-component-library197.js +3 -3
- package/lib/sd-component-library200.js +60 -2
- package/lib/sd-component-library200.js.map +1 -1
- package/lib/sd-component-library201.js +3 -30
- package/lib/sd-component-library201.js.map +1 -1
- package/lib/sd-component-library202.js +2 -599
- package/lib/sd-component-library202.js.map +1 -1
- package/lib/sd-component-library203.js +30 -60
- package/lib/sd-component-library203.js.map +1 -1
- package/lib/sd-component-library204.js +599 -3
- package/lib/sd-component-library204.js.map +1 -1
- package/lib/sd-component-library207.js +21 -18
- package/lib/sd-component-library207.js.map +1 -1
- package/lib/sd-component-library208.js +3 -64
- package/lib/sd-component-library208.js.map +1 -1
- package/lib/sd-component-library209.js +3 -23
- package/lib/sd-component-library209.js.map +1 -1
- package/lib/sd-component-library210.js +17 -39
- package/lib/sd-component-library210.js.map +1 -1
- package/lib/sd-component-library211.js +62 -19
- package/lib/sd-component-library211.js.map +1 -1
- package/lib/sd-component-library212.js +23 -3
- package/lib/sd-component-library212.js.map +1 -1
- package/lib/sd-component-library213.js +40 -3
- package/lib/sd-component-library213.js.map +1 -1
- package/lib/sd-component-library221.js +64 -45
- package/lib/sd-component-library221.js.map +1 -1
- package/lib/sd-component-library222.js +3 -65
- package/lib/sd-component-library222.js.map +1 -1
- package/lib/sd-component-library223.js +46 -3
- package/lib/sd-component-library223.js.map +1 -1
- package/lib/sd-component-library226.js +3 -3
- package/lib/sd-component-library226.js.map +1 -1
- package/lib/sd-component-library228.js +129 -19
- package/lib/sd-component-library228.js.map +1 -1
- package/lib/sd-component-library229.js +42 -19
- package/lib/sd-component-library229.js.map +1 -1
- package/lib/sd-component-library230.js +47 -28
- package/lib/sd-component-library230.js.map +1 -1
- package/lib/sd-component-library231.js +7 -32
- package/lib/sd-component-library231.js.map +1 -1
- package/lib/sd-component-library232.js +3 -3
- package/lib/sd-component-library232.js.map +1 -1
- package/lib/sd-component-library233.js +4 -4
- package/lib/sd-component-library234.js +41 -41
- package/lib/sd-component-library234.js.map +1 -1
- package/lib/sd-component-library235.js +13 -43
- package/lib/sd-component-library235.js.map +1 -1
- package/lib/sd-component-library236.js +19 -13
- package/lib/sd-component-library236.js.map +1 -1
- package/lib/sd-component-library237.js +20 -21
- package/lib/sd-component-library237.js.map +1 -1
- package/lib/sd-component-library238.js +26 -107
- package/lib/sd-component-library238.js.map +1 -1
- package/lib/sd-component-library239.js +27 -41
- package/lib/sd-component-library239.js.map +1 -1
- package/lib/sd-component-library24.js +57 -53
- package/lib/sd-component-library24.js.map +1 -1
- package/lib/sd-component-library240.js +21 -24
- package/lib/sd-component-library240.js.map +1 -1
- package/lib/sd-component-library241.js +103 -47
- package/lib/sd-component-library241.js.map +1 -1
- package/lib/sd-component-library242.js +43 -17
- package/lib/sd-component-library242.js.map +1 -1
- package/lib/sd-component-library243.js +24 -20
- package/lib/sd-component-library243.js.map +1 -1
- package/lib/sd-component-library244.js +52 -47
- package/lib/sd-component-library244.js.map +1 -1
- package/lib/sd-component-library245.js +46 -39
- package/lib/sd-component-library245.js.map +1 -1
- package/lib/sd-component-library246.js +74 -26
- package/lib/sd-component-library246.js.map +1 -1
- package/lib/sd-component-library247.js +41 -2
- package/lib/sd-component-library247.js.map +1 -1
- package/lib/sd-component-library248.js +26 -74
- package/lib/sd-component-library248.js.map +1 -1
- package/lib/sd-component-library249.js +2 -29
- package/lib/sd-component-library249.js.map +1 -1
- package/lib/sd-component-library250.js +21 -3
- package/lib/sd-component-library250.js.map +1 -1
- package/lib/sd-component-library251.js +20 -24
- package/lib/sd-component-library251.js.map +1 -1
- package/lib/sd-component-library252.js +325 -3
- package/lib/sd-component-library252.js.map +1 -1
- package/lib/sd-component-library253.js +5 -325
- package/lib/sd-component-library253.js.map +1 -1
- package/lib/sd-component-library254.js +29 -5
- package/lib/sd-component-library254.js.map +1 -1
- package/lib/sd-component-library255.js +3 -2
- package/lib/sd-component-library255.js.map +1 -1
- package/lib/sd-component-library256.js +24 -2
- package/lib/sd-component-library256.js.map +1 -1
- package/lib/sd-component-library257.js +3 -129
- package/lib/sd-component-library257.js.map +1 -1
- package/lib/sd-component-library258.js +21 -43
- package/lib/sd-component-library258.js.map +1 -1
- package/lib/sd-component-library259.js +22 -8
- package/lib/sd-component-library259.js.map +1 -1
- package/lib/sd-component-library260.js +44 -18
- package/lib/sd-component-library260.js.map +1 -1
- package/lib/sd-component-library261.js +26 -18
- package/lib/sd-component-library261.js.map +1 -1
- package/lib/sd-component-library262.js +134 -30
- package/lib/sd-component-library262.js.map +1 -1
- package/lib/sd-component-library263.js +59 -119
- package/lib/sd-component-library263.js.map +1 -1
- package/lib/sd-component-library264.js +63 -38
- package/lib/sd-component-library264.js.map +1 -1
- package/lib/sd-component-library265.js +30 -74
- package/lib/sd-component-library265.js.map +1 -1
- package/lib/sd-component-library266.js +15 -70
- package/lib/sd-component-library266.js.map +1 -1
- package/lib/sd-component-library267.js +120 -25
- package/lib/sd-component-library267.js.map +1 -1
- package/lib/sd-component-library268.js +9 -20
- package/lib/sd-component-library268.js.map +1 -1
- package/lib/sd-component-library269.js +41 -116
- package/lib/sd-component-library269.js.map +1 -1
- package/lib/sd-component-library271.js +9 -10
- package/lib/sd-component-library271.js.map +1 -1
- package/lib/sd-component-library272.js +49 -48
- package/lib/sd-component-library272.js.map +1 -1
- package/lib/sd-component-library273.js +89 -8
- package/lib/sd-component-library273.js.map +1 -1
- package/lib/sd-component-library274.js +89 -48
- package/lib/sd-component-library274.js.map +1 -1
- package/lib/sd-component-library275.js +2 -90
- package/lib/sd-component-library275.js.map +1 -1
- package/lib/sd-component-library276.js +2 -92
- package/lib/sd-component-library276.js.map +1 -1
- package/lib/sd-component-library296.js +33 -91
- package/lib/sd-component-library296.js.map +1 -1
- package/lib/sd-component-library297.js +25 -51
- package/lib/sd-component-library297.js.map +1 -1
- package/lib/sd-component-library298.js +9 -5
- package/lib/sd-component-library298.js.map +1 -1
- package/lib/sd-component-library299.js +5 -25
- package/lib/sd-component-library299.js.map +1 -1
- package/lib/sd-component-library300.js +4 -4
- package/lib/sd-component-library300.js.map +1 -1
- package/lib/sd-component-library301.js +19 -35
- package/lib/sd-component-library301.js.map +1 -1
- package/lib/sd-component-library302.js +3 -9
- package/lib/sd-component-library302.js.map +1 -1
- package/lib/sd-component-library303.js +5 -5
- package/lib/sd-component-library303.js.map +1 -1
- package/lib/sd-component-library304.js +4 -4
- package/lib/sd-component-library304.js.map +1 -1
- package/lib/sd-component-library305.js +93 -19
- package/lib/sd-component-library305.js.map +1 -1
- package/lib/sd-component-library306.js +51 -3
- package/lib/sd-component-library306.js.map +1 -1
- package/lib/sd-component-library48.js +1 -1
- package/lib/sd-component-library49.js +1 -1
- package/lib/sd-component-library51.js +3 -3
- package/lib/sd-component-library52.js +2 -2
- package/lib/sd-component-library53.js +2 -2
- package/lib/sd-component-library6.js +1 -1
- package/lib/sd-component-library60.js +1 -1
- package/lib/sd-component-library7.js +1 -1
- package/lib/sd-component-library75.js +2 -2
- package/lib/sd-component-library76.js +1 -1
- package/lib/sd-component-library77.js +1 -1
- package/lib/sd-component-library81.js +1 -1
- package/lib/sd-component-library81.js.map +1 -1
- package/lib/sd-component-library86.js +5 -5
- package/lib/sd-component-library87.js +1 -1
- package/lib/sd-component-library88.js +1 -1
- package/lib/sd-component-library89.js +4 -4
- package/lib/sd-component-library92.js +4 -4
- package/lib/sd-component-library94.js +6 -6
- package/lib/sd-component-library98.js +2 -2
- package/lib/sd-component-library99.js +3 -3
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sd-component-library229.js","sources":["../src/components/meters/
|
|
1
|
+
{"version":3,"file":"sd-component-library229.js","sources":["../src/components/meters/outline-meter/partials/outline-meter-scale/outline-meter-scale.tsx"],"sourcesContent":["import React from \"react\";\n\nimport {\n degToRad,\n getCoordinateForArc,\n getInnerX,\n getInnerY,\n} from \"../../utils\";\nimport { OutlineMeterScaleProps as Props } from \"./interfaces\";\n\nexport const OutlineMeterScale: React.FC<Props> = (props) => {\n const {\n diameter,\n arc,\n color = \"#CCD0DB\",\n dashHeight,\n dashWidth,\n numberOfDashes,\n distanceFromRangesToScale: distanceFromRanges,\n gaugeWidth,\n } = props;\n const radius = diameter / 2;\n\n const arcStart = (360 - arc) / 2; // deg\n const degPerDash = arc / (numberOfDashes - 1);\n\n return (\n <g>\n {[...Array(numberOfDashes)].map((_, idx) => {\n const alpha = arcStart + idx * degPerDash;\n const { x, y } = getCoordinateForArc(radius, alpha);\n const alphaInRad = degToRad(alpha);\n const dashTopX = getInnerX(\n x,\n alphaInRad,\n gaugeWidth + distanceFromRanges\n );\n const dashTopY = getInnerY(\n y,\n alphaInRad,\n gaugeWidth + distanceFromRanges\n );\n const dashBottomX = getInnerX(\n x,\n alphaInRad,\n gaugeWidth + distanceFromRanges + dashHeight\n );\n const dashBottomY = getInnerY(\n y,\n alphaInRad,\n gaugeWidth + distanceFromRanges + dashHeight\n );\n return (\n <path\n key={idx}\n d={`M${dashTopX},${dashTopY} L${dashBottomX},${dashBottomY}`}\n stroke={color}\n strokeWidth={dashWidth}\n />\n );\n })}\n </g>\n );\n};\n"],"names":["OutlineMeterScale","props","diameter","arc","color","dashHeight","dashWidth","numberOfDashes","distanceFromRanges","gaugeWidth","radius","arcStart","degPerDash","jsx","_","idx","alpha","x","y","getCoordinateForArc","alphaInRad","degToRad","dashTopX","getInnerX","dashTopY","getInnerY","dashBottomX","dashBottomY"],"mappings":";;AAUa,MAAAA,IAAqC,CAACC,MAAU;AACrD,QAAA;AAAA,IACJ,UAAAC;AAAA,IACA,KAAAC;AAAA,IACA,OAAAC,IAAQ;AAAA,IACR,YAAAC;AAAA,IACA,WAAAC;AAAA,IACA,gBAAAC;AAAA,IACA,2BAA2BC;AAAA,IAC3B,YAAAC;AAAA,EACE,IAAAR,GACES,IAASR,IAAW,GAEpBS,KAAY,MAAMR,KAAO,GACzBS,IAAaT,KAAOI,IAAiB;AAGzC,SAAAM,gBAAAA,MAAC,KACE,EAAA,UAAA,CAAC,GAAG,MAAMN,CAAc,CAAC,EAAE,IAAI,CAACO,GAAGC,MAAQ;AACpC,UAAAC,IAAQL,IAAWI,IAAMH,GACzB,EAAE,GAAAK,GAAG,GAAAC,EAAA,IAAMC,EAAoBT,GAAQM,CAAK,GAC5CI,IAAaC,EAASL,CAAK,GAC3BM,IAAWC;AAAA,MACfN;AAAA,MACAG;AAAA,MACAX,IAAaD;AAAA,IAAA,GAETgB,IAAWC;AAAA,MACfP;AAAA,MACAE;AAAA,MACAX,IAAaD;AAAA,IAAA,GAETkB,IAAcH;AAAA,MAClBN;AAAA,MACAG;AAAA,MACAX,IAAaD,IAAqBH;AAAA,IAAA,GAE9BsB,IAAcF;AAAA,MAClBP;AAAA,MACAE;AAAA,MACAX,IAAaD,IAAqBH;AAAA,IAAA;AAGlC,WAAAQ,gBAAAA,EAAA;AAAA,MAAC;AAAA,MAAA;AAAA,QAEC,GAAG,IAAIS,CAAQ,IAAIE,CAAQ,KAAKE,CAAW,IAAIC,CAAW;AAAA,QAC1D,QAAQvB;AAAA,QACR,aAAaE;AAAA,MAAA;AAAA,MAHRS;AAAA,IAAA;AAAA,EAMV,CAAA,EACH,CAAA;AAEJ;"}
|
|
@@ -1,31 +1,50 @@
|
|
|
1
|
-
import { j as
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
)
|
|
26
|
-
|
|
27
|
-
)
|
|
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-library296.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
|
+
}
|
|
45
|
+
);
|
|
46
|
+
};
|
|
28
47
|
export {
|
|
29
|
-
|
|
48
|
+
G as OutlineMeterNeedle
|
|
30
49
|
};
|
|
31
50
|
//# sourceMappingURL=sd-component-library230.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sd-component-library230.js","sources":["../src/components/meters/
|
|
1
|
+
{"version":3,"file":"sd-component-library230.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,36 +1,11 @@
|
|
|
1
|
-
import { j as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
const
|
|
5
|
-
const {
|
|
6
|
-
|
|
7
|
-
arc: n,
|
|
8
|
-
totalRanges: o,
|
|
9
|
-
distanceBetweenRanges: r,
|
|
10
|
-
idx: s,
|
|
11
|
-
diameter: d,
|
|
12
|
-
segmented: c,
|
|
13
|
-
counterClockWise: i
|
|
14
|
-
} = e, { start: g, end: l } = a, m = d / 2, { rangeArcMiddle: x } = p(
|
|
15
|
-
n,
|
|
16
|
-
o,
|
|
17
|
-
r,
|
|
18
|
-
s,
|
|
19
|
-
g,
|
|
20
|
-
l
|
|
21
|
-
), t = Math.round(x);
|
|
22
|
-
return /* @__PURE__ */ h.jsx(
|
|
23
|
-
u,
|
|
24
|
-
{
|
|
25
|
-
...e,
|
|
26
|
-
...a,
|
|
27
|
-
alpha: i ? 360 - t : t,
|
|
28
|
-
radius: m,
|
|
29
|
-
round: c
|
|
30
|
-
}
|
|
31
|
-
);
|
|
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-library244.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 });
|
|
32
7
|
};
|
|
33
8
|
export {
|
|
34
|
-
|
|
9
|
+
g as OutlineMeterLabelBox
|
|
35
10
|
};
|
|
36
11
|
//# sourceMappingURL=sd-component-library231.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sd-component-library231.js","sources":["../src/components/meters/
|
|
1
|
+
{"version":3,"file":"sd-component-library231.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,6 +1,6 @@
|
|
|
1
|
-
|
|
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" }))));
|
|
1
|
+
const t = 1, o = 13;
|
|
3
2
|
export {
|
|
4
|
-
t as
|
|
3
|
+
t as defaultPointerWidth,
|
|
4
|
+
o as defaultTextBottomMargin
|
|
5
5
|
};
|
|
6
6
|
//# sourceMappingURL=sd-component-library232.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sd-component-library232.js","sources":["../src/components/meters/
|
|
1
|
+
{"version":3,"file":"sd-component-library232.js","sources":["../src/components/meters/multi-option-discrete-outline-meter/constants.ts"],"sourcesContent":["export const defaultPointerWidth = 1;\nexport const defaultTextBottomMargin = 13;\n"],"names":["defaultPointerWidth","defaultTextBottomMargin"],"mappings":"AAAO,MAAMA,IAAsB,GACtBC,IAA0B;"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { j as a } from "./sd-component-library197.js";
|
|
2
2
|
import { getCoordinateForArc as i } from "./sd-component-library91.js";
|
|
3
|
-
import { defaultTextBottomMargin as X } from "./sd-component-
|
|
4
|
-
import { getRangeProperties as Y } from "./sd-component-
|
|
5
|
-
import { BaseOutlineArc as b } from "./sd-component-
|
|
6
|
-
import { DiscreteMeterLabelPointer as w } from "./sd-component-
|
|
3
|
+
import { defaultTextBottomMargin as X } from "./sd-component-library232.js";
|
|
4
|
+
import { getRangeProperties as Y } from "./sd-component-library303.js";
|
|
5
|
+
import { BaseOutlineArc as b } from "./sd-component-library297.js";
|
|
6
|
+
import { DiscreteMeterLabelPointer as w } from "./sd-component-library304.js";
|
|
7
7
|
function z(s) {
|
|
8
8
|
const {
|
|
9
9
|
color: n,
|
|
@@ -1,46 +1,46 @@
|
|
|
1
|
-
import { j as
|
|
2
|
-
import { getInnerX as
|
|
3
|
-
|
|
1
|
+
import { j as M } from "./sd-component-library197.js";
|
|
2
|
+
import { getInnerX as T, getInnerY as W, degToRad as r, getCoordinateForArc as y } from "./sd-component-library91.js";
|
|
3
|
+
import { BaseNeedle as B } from "./sd-component-library296.js";
|
|
4
|
+
function E(p) {
|
|
4
5
|
const {
|
|
5
|
-
|
|
6
|
+
needleColor: u,
|
|
7
|
+
options: n,
|
|
8
|
+
value: h,
|
|
9
|
+
needleWidth: e,
|
|
10
|
+
innerCircleRadius: m,
|
|
11
|
+
innerCircleStrokeWidth: x,
|
|
12
|
+
diameter: R,
|
|
6
13
|
arc: a,
|
|
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
|
-
stroke: u,
|
|
37
|
-
strokeWidth: x
|
|
38
|
-
},
|
|
39
|
-
n
|
|
40
|
-
);
|
|
41
|
-
}) });
|
|
42
|
-
};
|
|
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
|
+
}
|
|
43
43
|
export {
|
|
44
|
-
|
|
44
|
+
E as DiscreteMeterNeedle
|
|
45
45
|
};
|
|
46
46
|
//# sourceMappingURL=sd-component-library234.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sd-component-library234.js","sources":["../src/components/meters/outline-meter/partials/
|
|
1
|
+
{"version":3,"file":"sd-component-library234.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,46 +1,16 @@
|
|
|
1
|
-
import { j as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
const {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
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 g } from "./sd-component-library197.js";
|
|
2
|
+
import { getRangeProperties as d } from "./sd-component-library303.js";
|
|
3
|
+
import { MatchedRangeLabelBox as x } from "./sd-component-library305.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
|
+
};
|
|
43
13
|
export {
|
|
44
|
-
|
|
14
|
+
h as MatchedRangeLabelBox
|
|
45
15
|
};
|
|
46
16
|
//# sourceMappingURL=sd-component-library235.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sd-component-library235.js","sources":["../src/components/meters/multi-option-discrete-outline-meter/partials/
|
|
1
|
+
{"version":3,"file":"sd-component-library235.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,16 +1,22 @@
|
|
|
1
|
-
import { j as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
return /* @__PURE__ */ g.jsx(x, { ...e, alpha: c, round: !0 });
|
|
12
|
-
};
|
|
1
|
+
import { j as t } from "./sd-component-library197.js";
|
|
2
|
+
import { SmileyGaugeColor as e } from "./sd-component-library237.js";
|
|
3
|
+
import { ReactComponent as o } from "./sd-component-library287.js";
|
|
4
|
+
import { ReactComponent as m } from "./sd-component-library288.js";
|
|
5
|
+
import { ReactComponent as i } from "./sd-component-library289.js";
|
|
6
|
+
const S = 10, c = 80, p = 100, y = 87, R = 30, d = 3, f = 2, g = 4, u = /* @__PURE__ */ new Map([
|
|
7
|
+
[e.GREEN, /* @__PURE__ */ t.jsx(o, {})],
|
|
8
|
+
[e.ORANGE, /* @__PURE__ */ t.jsx(m, {})],
|
|
9
|
+
[e.RED, /* @__PURE__ */ t.jsx(i, {})]
|
|
10
|
+
]);
|
|
13
11
|
export {
|
|
14
|
-
|
|
12
|
+
u as COLOR_TO_ICON_MAP,
|
|
13
|
+
S as defaultDistanceBetweenRanges,
|
|
14
|
+
c as defaultSmileyWidth,
|
|
15
|
+
g as smallSmileyGaugeWidth,
|
|
16
|
+
f as smallSmileyInnerPointRadius,
|
|
17
|
+
d as smallSmileyInnerPointStrokeWidth,
|
|
18
|
+
y as smallSmileyMeterHeight,
|
|
19
|
+
p as smallSmileyMeterWidth,
|
|
20
|
+
R as smallSmileyWidth
|
|
15
21
|
};
|
|
16
22
|
//# 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/smiley-meter-v2/constants.tsx"],"sourcesContent":["import React from \"react\";\n\nimport { HappySmileyIcon, NeutralSmileyIcon, SadSmileyIcon } from \"./assets\";\n\n/**\n * Large Smiley meter v2 default values.\n */\nimport { SmileyGaugeColor } from \"./utils\";\n\nexport const defaultDistanceBetweenRanges = 10;\nexport const defaultSmileyWidth = 80;\n\n/**\n * Small Smiley meter v2 default values.\n */\nexport const smallSmileyMeterWidth = 100;\nexport const smallSmileyMeterHeight = 87;\nexport const smallSmileyWidth = 30;\nexport const smallSmileyInnerPointStrokeWidth = 3;\nexport const smallSmileyInnerPointRadius = 2;\nexport const smallSmileyGaugeWidth = 4;\n\nexport const COLOR_TO_ICON_MAP = new Map<SmileyGaugeColor, React.ReactNode>([\n [SmileyGaugeColor.GREEN, <HappySmileyIcon />],\n [SmileyGaugeColor.ORANGE, <NeutralSmileyIcon />],\n [SmileyGaugeColor.RED, <SadSmileyIcon />],\n]);\n"],"names":["defaultDistanceBetweenRanges","defaultSmileyWidth","smallSmileyMeterWidth","smallSmileyMeterHeight","smallSmileyWidth","smallSmileyInnerPointStrokeWidth","smallSmileyInnerPointRadius","smallSmileyGaugeWidth","COLOR_TO_ICON_MAP","SmileyGaugeColor","jsx","HappySmileyIcon","NeutralSmileyIcon","SadSmileyIcon"],"mappings":";;;;;AASO,MAAMA,IAA+B,IAC/BC,IAAqB,IAKrBC,IAAwB,KACxBC,IAAyB,IACzBC,IAAmB,IACnBC,IAAmC,GACnCC,IAA8B,GAC9BC,IAAwB,GAExBC,wBAAwB,IAAuC;AAAA,EAC1E,CAACC,EAAiB,OAAOC,gBAAAA,EAAA,IAACC,IAAgB,CAAA,CAAE;AAAA,EAC5C,CAACF,EAAiB,QAAQC,gBAAAA,EAAA,IAACE,IAAkB,CAAA,CAAE;AAAA,EAC/C,CAACH,EAAiB,KAAKC,gBAAAA,EAAA,IAACG,IAAc,CAAA,CAAE;AAC1C,CAAC;"}
|
|
@@ -1,24 +1,23 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
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 { isCorrectOutlineMeterConfig as l } from "./sd-component-library91.js";
|
|
2
|
+
var a = /* @__PURE__ */ ((r) => (r.GREEN = "#00B466", r.ORANGE = "#FF9900", r.RED = "#FF0000", r))(a || {});
|
|
3
|
+
const u = (r) => !r.some(
|
|
4
|
+
({ color: t }) => !Object.values(a).includes(t)
|
|
5
|
+
), f = (r, t) => l(r, t) && u(t), A = (r, t, n, i, o, d) => {
|
|
6
|
+
const c = r - (t - 1) * n, e = (360 - r) / 2 + n * i + c * o, s = e + c * (d - o), g = (e + s) / 2;
|
|
7
|
+
return {
|
|
8
|
+
rangeArcStart: e,
|
|
9
|
+
rangeArcEnd: s,
|
|
10
|
+
rangeArcMiddle: g
|
|
11
|
+
};
|
|
12
|
+
}, R = (r) => {
|
|
13
|
+
const { start: t, end: n } = r;
|
|
14
|
+
return t === 0 ? n < 0.6 : n === 1 ? t > 0.4 : !1;
|
|
15
|
+
};
|
|
18
16
|
export {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
17
|
+
a as SmileyGaugeColor,
|
|
18
|
+
u as areColorsValid,
|
|
19
|
+
R as getIsHorizontal,
|
|
20
|
+
A as getRangeProperties,
|
|
21
|
+
f as isCorrectSmileyMeterConfig
|
|
23
22
|
};
|
|
24
23
|
//# 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/smiley-meter-v2/utils.ts"],"sourcesContent":["import { OutlineMeterRangeConfig } from \"../outline-meter\";\nimport { isCorrectOutlineMeterConfig } from \"../outline-meter/utils\";\nimport { SmileyMeterRange } from \"./interfaces\";\n\nexport enum SmileyGaugeColor {\n GREEN = \"#00B466\",\n ORANGE = \"#FF9900\",\n RED = \"#FF0000\",\n}\n\nexport const areColorsValid = (ranges: OutlineMeterRangeConfig[]) =>\n !ranges.some(\n ({ color }) => !Object.values(SmileyGaugeColor).includes(color as any)\n );\n\nexport const isCorrectSmileyMeterConfig = (\n value: number,\n ranges: OutlineMeterRangeConfig[]\n): ranges is SmileyMeterRange[] => {\n return isCorrectOutlineMeterConfig(value, ranges) && areColorsValid(ranges);\n};\n\nexport const getRangeProperties = (\n arc: number,\n totalRanges: number,\n distanceBetweenRanges: number,\n idx: number,\n start: number,\n end: number\n) => {\n const arcForRanges = arc - (totalRanges - 1) * distanceBetweenRanges;\n const arcStart = (360 - arc) / 2; // deg\n const rangeArcStart =\n arcStart + distanceBetweenRanges * idx + arcForRanges * start;\n const rangeArcEnd = rangeArcStart + arcForRanges * (end - start);\n\n const rangeArcMiddle = (rangeArcStart + rangeArcEnd) / 2;\n return {\n rangeArcStart,\n rangeArcEnd,\n rangeArcMiddle,\n };\n};\n\nexport const getIsHorizontal = (range: SmileyMeterRange) => {\n const { start, end } = range;\n return start === 0 ? end < 0.6 : end === 1 ? start > 0.4 : false;\n};\n"],"names":["SmileyGaugeColor","areColorsValid","ranges","color","isCorrectSmileyMeterConfig","value","isCorrectOutlineMeterConfig","getRangeProperties","arc","totalRanges","distanceBetweenRanges","idx","start","end","arcForRanges","rangeArcStart","rangeArcEnd","rangeArcMiddle","getIsHorizontal","range"],"mappings":";AAIY,IAAAA,sBAAAA,OACVA,EAAA,QAAQ,WACRA,EAAA,SAAS,WACTA,EAAA,MAAM,WAHIA,IAAAA,KAAA,CAAA,CAAA;AAML,MAAMC,IAAiB,CAACC,MAC7B,CAACA,EAAO;AAAA,EACN,CAAC,EAAE,OAAAC,EAAY,MAAA,CAAC,OAAO,OAAOH,CAAgB,EAAE,SAASG,CAAY;AACvE,GAEWC,IAA6B,CACxCC,GACAH,MAEOI,EAA4BD,GAAOH,CAAM,KAAKD,EAAeC,CAAM,GAG/DK,IAAqB,CAChCC,GACAC,GACAC,GACAC,GACAC,GACAC,MACG;AACG,QAAAC,IAAeN,KAAOC,IAAc,KAAKC,GAEzCK,KADY,MAAMP,KAAO,IAElBE,IAAwBC,IAAMG,IAAeF,GACpDI,IAAcD,IAAgBD,KAAgBD,IAAMD,IAEpDK,KAAkBF,IAAgBC,KAAe;AAChD,SAAA;AAAA,IACL,eAAAD;AAAA,IACA,aAAAC;AAAA,IACA,gBAAAC;AAAA,EAAA;AAEJ,GAEaC,IAAkB,CAACC,MAA4B;AACpD,QAAA,EAAE,OAAAP,GAAO,KAAAC,EAAQ,IAAAM;AACvB,SAAOP,MAAU,IAAIC,IAAM,MAAMA,MAAQ,IAAID,IAAQ,MAAM;AAC7D;"}
|