@selfdecode/sd-component-library 4.0.146 → 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 +2 -2
- 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-library129.js +1 -1
- package/lib/sd-component-library134.js +1 -1
- package/lib/sd-component-library136.js +2 -2
- package/lib/sd-component-library16.js +1 -1
- package/lib/sd-component-library197.js +3 -3
- package/lib/sd-component-library201.js +3 -2
- package/lib/sd-component-library201.js.map +1 -1
- package/lib/sd-component-library202.js +2 -30
- package/lib/sd-component-library202.js.map +1 -1
- package/lib/sd-component-library203.js +21 -590
- package/lib/sd-component-library203.js.map +1 -1
- package/lib/sd-component-library204.js +599 -3
- package/lib/sd-component-library204.js.map +1 -1
- package/lib/sd-component-library205.js +55 -24
- package/lib/sd-component-library205.js.map +1 -1
- package/lib/sd-component-library206.js +24 -55
- package/lib/sd-component-library206.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 -21
- package/lib/sd-component-library208.js.map +1 -1
- package/lib/sd-component-library209.js +1 -1
- package/lib/sd-component-library209.js.map +1 -1
- package/lib/sd-component-library210.js +18 -3
- package/lib/sd-component-library210.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 +64 -129
- package/lib/sd-component-library233.js.map +1 -1
- package/lib/sd-component-library234.js +41 -41
- package/lib/sd-component-library234.js.map +1 -1
- package/lib/sd-component-library235.js +12 -46
- package/lib/sd-component-library235.js.map +1 -1
- package/lib/sd-component-library236.js +19 -8
- package/lib/sd-component-library236.js.map +1 -1
- package/lib/sd-component-library237.js +20 -64
- package/lib/sd-component-library237.js.map +1 -1
- package/lib/sd-component-library238.js +28 -43
- package/lib/sd-component-library238.js.map +1 -1
- package/lib/sd-component-library239.js +30 -10
- 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-library241.js +1 -1
- package/lib/sd-component-library242.js +1 -1
- package/lib/sd-component-library247.js +38 -18
- package/lib/sd-component-library247.js.map +1 -1
- package/lib/sd-component-library248.js +25 -18
- package/lib/sd-component-library248.js.map +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 +5 -5
- package/lib/sd-component-library260.js +51 -30
- package/lib/sd-component-library260.js.map +1 -1
- package/lib/sd-component-library261.js +30 -51
- package/lib/sd-component-library261.js.map +1 -1
- package/lib/sd-component-library268.js +9 -121
- package/lib/sd-component-library268.js.map +1 -1
- package/lib/sd-component-library269.js +49 -9
- package/lib/sd-component-library269.js.map +1 -1
- package/lib/sd-component-library270.js +111 -39
- package/lib/sd-component-library270.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 -25
- package/lib/sd-component-library298.js.map +1 -1
- package/lib/sd-component-library299.js +5 -35
- package/lib/sd-component-library299.js.map +1 -1
- package/lib/sd-component-library300.js +3 -8
- package/lib/sd-component-library300.js.map +1 -1
- package/lib/sd-component-library301.js +19 -5
- package/lib/sd-component-library301.js.map +1 -1
- package/lib/sd-component-library302.js +3 -4
- package/lib/sd-component-library302.js.map +1 -1
- package/lib/sd-component-library303.js +5 -19
- package/lib/sd-component-library303.js.map +1 -1
- package/lib/sd-component-library304.js +4 -3
- package/lib/sd-component-library304.js.map +1 -1
- package/lib/sd-component-library305.js +92 -4
- package/lib/sd-component-library305.js.map +1 -1
- package/lib/sd-component-library306.js +51 -4
- 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-library6.js +1 -1
- package/lib/sd-component-library7.js +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 +5 -5
- package/lib/sd-component-library94.js +1 -1
- package/lib/sd-component-library99.js +2 -2
- package/package.json +1 -1
|
@@ -1,132 +1,67 @@
|
|
|
1
|
-
import { j as
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
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
|
-
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(
|
|
76
|
-
X,
|
|
77
|
-
{
|
|
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,
|
|
87
|
-
roundEnd: !1
|
|
88
|
-
}
|
|
89
|
-
),
|
|
90
|
-
/* @__PURE__ */ e.jsx(
|
|
91
|
-
X,
|
|
92
|
-
{
|
|
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,
|
|
102
|
-
roundStart: !1
|
|
103
|
-
}
|
|
104
|
-
),
|
|
105
|
-
/* @__PURE__ */ e.jsx(
|
|
106
|
-
"circle",
|
|
107
|
-
{
|
|
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
|
|
124
|
-
}
|
|
125
|
-
)
|
|
126
|
-
] });
|
|
127
|
-
}
|
|
128
|
-
);
|
|
1
|
+
import { j as a } from "./sd-component-library197.js";
|
|
2
|
+
import { getCoordinateForArc as i } from "./sd-component-library91.js";
|
|
3
|
+
import { defaultTextBottomMargin as X } from "./sd-component-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
|
+
function z(s) {
|
|
8
|
+
const {
|
|
9
|
+
color: n,
|
|
10
|
+
idx: c,
|
|
11
|
+
gaugeWidth: d,
|
|
12
|
+
diameter: g,
|
|
13
|
+
arc: m,
|
|
14
|
+
distanceBetweenRanges: l,
|
|
15
|
+
totalRanges: p,
|
|
16
|
+
showLabel: h,
|
|
17
|
+
label: o,
|
|
18
|
+
isMatchedRange: x,
|
|
19
|
+
pointerWidth: f,
|
|
20
|
+
pointerLength: A,
|
|
21
|
+
horizontal: u
|
|
22
|
+
} = s, t = g / 2, { rangeArcStart: r, rangeArcEnd: e } = Y(
|
|
23
|
+
m,
|
|
24
|
+
p,
|
|
25
|
+
l,
|
|
26
|
+
c
|
|
27
|
+
), { x: R, y: j } = i(
|
|
28
|
+
t,
|
|
29
|
+
r
|
|
30
|
+
), { x: B, y: E } = i(
|
|
31
|
+
t,
|
|
32
|
+
e
|
|
33
|
+
), M = (r + e) / 2;
|
|
34
|
+
return /* @__PURE__ */ a.jsxs("g", { children: [
|
|
35
|
+
/* @__PURE__ */ a.jsx(
|
|
36
|
+
b,
|
|
37
|
+
{
|
|
38
|
+
startX: R,
|
|
39
|
+
startY: j,
|
|
40
|
+
endX: B,
|
|
41
|
+
endY: E,
|
|
42
|
+
startAlpha: r,
|
|
43
|
+
endAlpha: e,
|
|
44
|
+
color: n,
|
|
45
|
+
radius: t,
|
|
46
|
+
width: d
|
|
47
|
+
}
|
|
48
|
+
),
|
|
49
|
+
h && o && !x && /* @__PURE__ */ a.jsx(
|
|
50
|
+
w,
|
|
51
|
+
{
|
|
52
|
+
alpha: M,
|
|
53
|
+
pointerLength: A,
|
|
54
|
+
pointerWidth: f,
|
|
55
|
+
radius: t,
|
|
56
|
+
color: n,
|
|
57
|
+
textBottomMargin: X,
|
|
58
|
+
label: o,
|
|
59
|
+
horizontal: u
|
|
60
|
+
}
|
|
61
|
+
)
|
|
62
|
+
] });
|
|
63
|
+
}
|
|
129
64
|
export {
|
|
130
|
-
|
|
65
|
+
z as DiscreteRange
|
|
131
66
|
};
|
|
132
67
|
//# sourceMappingURL=sd-component-library233.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sd-component-library233.js","sources":["../src/components/meters/outline-meter/partials/
|
|
1
|
+
{"version":3,"file":"sd-component-library233.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,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,50 +1,16 @@
|
|
|
1
|
-
import { j as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
const
|
|
5
|
-
const {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
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
|
-
);
|
|
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 });
|
|
46
12
|
};
|
|
47
13
|
export {
|
|
48
|
-
|
|
14
|
+
h as MatchedRangeLabelBox
|
|
49
15
|
};
|
|
50
16
|
//# sourceMappingURL=sd-component-library235.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sd-component-library235.js","sources":["../src/components/meters/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,11 +1,22 @@
|
|
|
1
|
-
import { j as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
}
|
|
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
|
+
]);
|
|
8
11
|
export {
|
|
9
|
-
|
|
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
|
|
10
21
|
};
|
|
11
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,67 +1,23 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
showLabel: h,
|
|
17
|
-
label: o,
|
|
18
|
-
isMatchedRange: x,
|
|
19
|
-
pointerWidth: f,
|
|
20
|
-
pointerLength: A,
|
|
21
|
-
horizontal: u
|
|
22
|
-
} = s, t = g / 2, { rangeArcStart: r, rangeArcEnd: e } = Y(
|
|
23
|
-
m,
|
|
24
|
-
p,
|
|
25
|
-
l,
|
|
26
|
-
c
|
|
27
|
-
), { x: R, y: j } = i(
|
|
28
|
-
t,
|
|
29
|
-
r
|
|
30
|
-
), { x: B, y: E } = i(
|
|
31
|
-
t,
|
|
32
|
-
e
|
|
33
|
-
), M = (r + e) / 2;
|
|
34
|
-
return /* @__PURE__ */ a.jsxs("g", { children: [
|
|
35
|
-
/* @__PURE__ */ a.jsx(
|
|
36
|
-
b,
|
|
37
|
-
{
|
|
38
|
-
startX: R,
|
|
39
|
-
startY: j,
|
|
40
|
-
endX: B,
|
|
41
|
-
endY: E,
|
|
42
|
-
startAlpha: r,
|
|
43
|
-
endAlpha: e,
|
|
44
|
-
color: n,
|
|
45
|
-
radius: t,
|
|
46
|
-
width: d
|
|
47
|
-
}
|
|
48
|
-
),
|
|
49
|
-
h && o && !x && /* @__PURE__ */ a.jsx(
|
|
50
|
-
w,
|
|
51
|
-
{
|
|
52
|
-
alpha: M,
|
|
53
|
-
pointerLength: A,
|
|
54
|
-
pointerWidth: f,
|
|
55
|
-
radius: t,
|
|
56
|
-
color: n,
|
|
57
|
-
textBottomMargin: X,
|
|
58
|
-
label: o,
|
|
59
|
-
horizontal: u
|
|
60
|
-
}
|
|
61
|
-
)
|
|
62
|
-
] });
|
|
63
|
-
}
|
|
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
|
+
};
|
|
64
16
|
export {
|
|
65
|
-
|
|
17
|
+
a as SmileyGaugeColor,
|
|
18
|
+
u as areColorsValid,
|
|
19
|
+
R as getIsHorizontal,
|
|
20
|
+
A as getRangeProperties,
|
|
21
|
+
f as isCorrectSmileyMeterConfig
|
|
66
22
|
};
|
|
67
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;"}
|