@selfdecode/sd-component-library 4.0.142 → 4.0.144
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/components/links/link/interfaces.d.ts +1 -0
- package/lib/components/wrapper/functions.d.ts +1 -1
- package/lib/components/wrapper/interfaces.d.ts +1 -0
- package/lib/sd-component-library100.js +2 -2
- package/lib/sd-component-library101.js +3 -3
- package/lib/sd-component-library102.js +2 -2
- package/lib/sd-component-library112.js +1 -1
- package/lib/sd-component-library118.js +1 -1
- package/lib/sd-component-library126.js +1 -1
- package/lib/sd-component-library127.js +1 -1
- package/lib/sd-component-library16.js +1 -1
- package/lib/sd-component-library167.js +1 -1
- package/lib/sd-component-library172.js +1 -1
- package/lib/sd-component-library197.js +3 -3
- package/lib/sd-component-library198.js +57 -57
- package/lib/sd-component-library198.js.map +1 -1
- package/lib/sd-component-library2.js +14 -4
- package/lib/sd-component-library2.js.map +1 -1
- package/lib/sd-component-library202.js +2 -57
- package/lib/sd-component-library202.js.map +1 -1
- package/lib/sd-component-library203.js +30 -2
- package/lib/sd-component-library203.js.map +1 -1
- package/lib/sd-component-library204.js +590 -21
- package/lib/sd-component-library204.js.map +1 -1
- package/lib/sd-component-library205.js +25 -598
- package/lib/sd-component-library205.js.map +1 -1
- package/lib/sd-component-library206.js +55 -24
- package/lib/sd-component-library206.js.map +1 -1
- package/lib/sd-component-library210.js +40 -21
- package/lib/sd-component-library210.js.map +1 -1
- package/lib/sd-component-library211.js +129 -3
- package/lib/sd-component-library211.js.map +1 -1
- package/lib/sd-component-library212.js +13 -3
- package/lib/sd-component-library212.js.map +1 -1
- package/lib/sd-component-library213.js +14 -26
- package/lib/sd-component-library213.js.map +1 -1
- package/lib/sd-component-library214.js +3 -3
- package/lib/sd-component-library214.js.map +1 -1
- package/lib/sd-component-library215.js +3 -31
- package/lib/sd-component-library215.js.map +1 -1
- package/lib/sd-component-library216.js +65 -19
- package/lib/sd-component-library216.js.map +1 -1
- package/lib/sd-component-library217.js +3 -20
- package/lib/sd-component-library217.js.map +1 -1
- package/lib/sd-component-library218.js +3 -28
- package/lib/sd-component-library218.js.map +1 -1
- package/lib/sd-component-library219.js +44 -31
- package/lib/sd-component-library219.js.map +1 -1
- package/lib/sd-component-library220.js +52 -3
- package/lib/sd-component-library220.js.map +1 -1
- package/lib/sd-component-library221.js +15 -127
- package/lib/sd-component-library221.js.map +1 -1
- package/lib/sd-component-library222.js +19 -41
- package/lib/sd-component-library222.js.map +1 -1
- package/lib/sd-component-library223.js +3 -47
- package/lib/sd-component-library223.js.map +1 -1
- package/lib/sd-component-library224.js +3 -8
- package/lib/sd-component-library224.js.map +1 -1
- package/lib/sd-component-library225.js +3 -64
- package/lib/sd-component-library225.js.map +1 -1
- package/lib/sd-component-library226.js +31 -43
- package/lib/sd-component-library226.js.map +1 -1
- package/lib/sd-component-library227.js +19 -13
- package/lib/sd-component-library227.js.map +1 -1
- package/lib/sd-component-library228.js +20 -21
- package/lib/sd-component-library228.js.map +1 -1
- package/lib/sd-component-library229.js +26 -107
- package/lib/sd-component-library229.js.map +1 -1
- package/lib/sd-component-library230.js +27 -41
- package/lib/sd-component-library230.js.map +1 -1
- package/lib/sd-component-library231.js +129 -24
- package/lib/sd-component-library231.js.map +1 -1
- package/lib/sd-component-library232.js +40 -50
- package/lib/sd-component-library232.js.map +1 -1
- package/lib/sd-component-library233.js +45 -46
- package/lib/sd-component-library233.js.map +1 -1
- package/lib/sd-component-library234.js +7 -74
- package/lib/sd-component-library234.js.map +1 -1
- package/lib/sd-component-library235.js +3 -41
- package/lib/sd-component-library235.js.map +1 -1
- package/lib/sd-component-library236.js +20 -26
- package/lib/sd-component-library236.js.map +1 -1
- package/lib/sd-component-library237.js +107 -19
- package/lib/sd-component-library237.js.map +1 -1
- package/lib/sd-component-library238.js +47 -20
- package/lib/sd-component-library238.js.map +1 -1
- package/lib/sd-component-library239.js +24 -2
- package/lib/sd-component-library239.js.map +1 -1
- package/lib/sd-component-library24.js +1 -1
- package/lib/sd-component-library240.js +49 -36
- package/lib/sd-component-library240.js.map +1 -1
- package/lib/sd-component-library241.js +63 -128
- package/lib/sd-component-library241.js.map +1 -1
- package/lib/sd-component-library242.js +43 -13
- package/lib/sd-component-library242.js.map +1 -1
- package/lib/sd-component-library243.js +13 -14
- package/lib/sd-component-library243.js.map +1 -1
- package/lib/sd-component-library244.js +48 -3
- package/lib/sd-component-library244.js.map +1 -1
- package/lib/sd-component-library245.js +41 -3
- package/lib/sd-component-library245.js.map +1 -1
- package/lib/sd-component-library246.js +27 -3
- package/lib/sd-component-library246.js.map +1 -1
- package/lib/sd-component-library247.js +16 -47
- package/lib/sd-component-library247.js.map +1 -1
- package/lib/sd-component-library248.js +16 -61
- package/lib/sd-component-library248.js.map +1 -1
- package/lib/sd-component-library249.js +75 -3
- package/lib/sd-component-library249.js.map +1 -1
- package/lib/sd-component-library250.js +2 -46
- package/lib/sd-component-library250.js.map +1 -1
- package/lib/sd-component-library251.js +324 -16
- package/lib/sd-component-library251.js.map +1 -1
- package/lib/sd-component-library252.js +5 -325
- package/lib/sd-component-library252.js.map +1 -1
- package/lib/sd-component-library253.js +26 -5
- package/lib/sd-component-library253.js.map +1 -1
- package/lib/sd-component-library261.js +1 -1
- package/lib/sd-component-library262.js +1 -1
- package/lib/sd-component-library264.js +1 -1
- package/lib/sd-component-library277.js +2 -6
- package/lib/sd-component-library277.js.map +1 -1
- package/lib/sd-component-library278.js +2 -3
- package/lib/sd-component-library278.js.map +1 -1
- package/lib/sd-component-library279.js +9 -2
- package/lib/sd-component-library279.js.map +1 -1
- package/lib/sd-component-library280.js +70 -3
- package/lib/sd-component-library280.js.map +1 -1
- package/lib/sd-component-library281.js +102 -2
- package/lib/sd-component-library281.js.map +1 -1
- package/lib/sd-component-library282.js +106 -2
- package/lib/sd-component-library282.js.map +1 -1
- package/lib/sd-component-library283.js +6 -70
- package/lib/sd-component-library283.js.map +1 -1
- package/lib/sd-component-library284.js +2 -102
- package/lib/sd-component-library284.js.map +1 -1
- package/lib/sd-component-library285.js +34 -104
- package/lib/sd-component-library285.js.map +1 -1
- package/lib/sd-component-library286.js +14 -10
- package/lib/sd-component-library286.js.map +1 -1
- package/lib/sd-component-library287.js +3 -2
- package/lib/sd-component-library287.js.map +1 -1
- package/lib/sd-component-library288.js +3 -36
- package/lib/sd-component-library288.js.map +1 -1
- package/lib/sd-component-library289.js +3 -14
- package/lib/sd-component-library289.js.map +1 -1
- package/lib/sd-component-library291.js +3 -3
- package/lib/sd-component-library292.js +4 -4
- package/lib/sd-component-library293.js +1 -1
- package/lib/sd-component-library294.js +58 -2
- package/lib/sd-component-library294.js.map +1 -1
- package/lib/sd-component-library295.js +25 -76
- package/lib/sd-component-library295.js.map +1 -1
- package/lib/sd-component-library296.js +89 -89
- package/lib/sd-component-library296.js.map +1 -1
- package/lib/sd-component-library297.js +50 -52
- package/lib/sd-component-library297.js.map +1 -1
- package/lib/sd-component-library298.js +35 -9
- package/lib/sd-component-library298.js.map +1 -1
- package/lib/sd-component-library299.js +25 -5
- package/lib/sd-component-library299.js.map +1 -1
- package/lib/sd-component-library300.js +5 -53
- package/lib/sd-component-library300.js.map +1 -1
- package/lib/sd-component-library301.js +4 -9
- package/lib/sd-component-library301.js.map +1 -1
- package/lib/sd-component-library302.js +8 -4
- package/lib/sd-component-library302.js.map +1 -1
- package/lib/sd-component-library303.js +5 -4
- package/lib/sd-component-library303.js.map +1 -1
- package/lib/sd-component-library304.js +4 -19
- package/lib/sd-component-library304.js.map +1 -1
- package/lib/sd-component-library305.js +19 -3
- package/lib/sd-component-library305.js.map +1 -1
- package/lib/sd-component-library306.js +3 -2
- package/lib/sd-component-library306.js.map +1 -1
- package/lib/sd-component-library307.js +34 -2
- package/lib/sd-component-library307.js.map +1 -1
- package/lib/sd-component-library308.js +2 -6
- package/lib/sd-component-library308.js.map +1 -1
- package/lib/sd-component-library309.js +76 -24
- package/lib/sd-component-library309.js.map +1 -1
- package/lib/sd-component-library310.js +92 -50
- package/lib/sd-component-library310.js.map +1 -1
- package/lib/sd-component-library311.js +52 -34
- package/lib/sd-component-library311.js.map +1 -1
- package/lib/sd-component-library312.js +9 -5
- package/lib/sd-component-library312.js.map +1 -1
- package/lib/sd-component-library313.js +5 -93
- package/lib/sd-component-library313.js.map +1 -1
- package/lib/sd-component-library314.js +53 -4
- package/lib/sd-component-library314.js.map +1 -1
- package/lib/sd-component-library315.js +20 -49
- package/lib/sd-component-library315.js.map +1 -1
- package/lib/sd-component-library316.js +15 -20
- package/lib/sd-component-library316.js.map +1 -1
- package/lib/sd-component-library317.js +6 -34
- package/lib/sd-component-library317.js.map +1 -1
- package/lib/sd-component-library319.js +31 -28
- package/lib/sd-component-library319.js.map +1 -1
- package/lib/sd-component-library320.js +2 -21
- package/lib/sd-component-library320.js.map +1 -1
- package/lib/sd-component-library321.js +2 -32
- package/lib/sd-component-library321.js.map +1 -1
- package/lib/sd-component-library51.js +3 -3
- package/lib/sd-component-library60.js +1 -1
- package/lib/sd-component-library61.js +2 -2
- package/lib/sd-component-library62.js +5 -5
- package/lib/sd-component-library63.js +1 -1
- package/lib/sd-component-library64.js +2 -2
- package/lib/sd-component-library65.js +1 -1
- package/lib/sd-component-library70.js +2 -2
- package/lib/sd-component-library72.js +3 -3
- package/lib/sd-component-library74.js +2 -2
- package/lib/sd-component-library75.js +3 -3
- package/lib/sd-component-library76.js +1 -1
- package/lib/sd-component-library77.js +1 -1
- package/lib/sd-component-library79.js +1 -1
- package/lib/sd-component-library80.js +1 -1
- package/lib/sd-component-library81.js +9 -7
- package/lib/sd-component-library81.js.map +1 -1
- package/lib/sd-component-library85.js +1 -1
- package/lib/sd-component-library86.js +6 -6
- package/lib/sd-component-library87.js +2 -2
- package/lib/sd-component-library88.js +1 -1
- package/lib/sd-component-library89.js +5 -5
- package/lib/sd-component-library90.js +1 -1
- package/lib/sd-component-library92.js +6 -6
- package/lib/sd-component-library93.js +1 -1
- package/lib/sd-component-library94.js +7 -7
- package/lib/sd-component-library95.js +1 -1
- package/lib/sd-component-library98.js +2 -2
- package/lib/sd-component-library99.js +3 -3
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sd-component-library238.js","sources":["../src/components/meters/
|
|
1
|
+
{"version":3,"file":"sd-component-library238.js","sources":["../src/components/meters/gradient-outline-meter/partials/gradient-meter-needle/gradient-meter-needle.tsx"],"sourcesContent":["import React 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 { getFractionColor } from \"../../utils\";\nimport { GradientMeterNeedleProps as Props } from \"./interfaces\";\n\nexport const GradientMeterNeedle: React.FC<Props> = (props) => {\n const {\n ranges,\n distanceFromRange,\n innerCircleRadius,\n innerCircleStrokeWidth,\n needleWidth,\n arc,\n value,\n gaugeWidth,\n diameter,\n needleColor,\n } = props;\n const radius = diameter / 2;\n const totalRanges = ranges.length;\n const valueRangeIndex = Math.floor(value * totalRanges);\n const startColor = ranges[valueRangeIndex][0];\n const endColor = ranges[valueRangeIndex][1];\n\n const arcStart = (360 - arc) / 2; // deg\n\n const rangeArcStart = arcStart + (arc * valueRangeIndex) / totalRanges;\n const rangeArcEnd = arcStart + (arc * (valueRangeIndex + 1)) / totalRanges;\n const start = valueRangeIndex / totalRanges;\n const end = (valueRangeIndex + 1) / totalRanges;\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 valueAlpha =\n rangeArcStart + (((value - start) / (end - start)) * arc) / ranges.length;\n const { x: valueX, y: valueY } = getCoordinateForArc(radius, valueAlpha);\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 const useHorizontalGradient = valueRangeIndex + 1 === totalRanges / 2 + 0.5;\n\n const fraction = useHorizontalGradient\n ? (valueX - rangeStartX) / (rangeEndX - rangeStartX)\n : (valueY - rangeStartY) / (rangeEndY - rangeStartY);\n const color = getFractionColor(fraction, startColor, endColor);\n\n return (\n <BaseNeedle\n radius={radius}\n innerCircleRadius={innerCircleRadius}\n innerCircleStrokeWidth={innerCircleStrokeWidth}\n needleWidth={needleWidth}\n color={needleColor || color}\n dx={dx}\n dy={dy}\n tipX={needleTipX}\n tipY={needleTipY}\n />\n );\n};\n"],"names":["GradientMeterNeedle","props","ranges","distanceFromRange","innerCircleRadius","innerCircleStrokeWidth","needleWidth","arc","value","gaugeWidth","diameter","needleColor","radius","totalRanges","valueRangeIndex","startColor","endColor","arcStart","rangeArcStart","rangeArcEnd","start","end","rangeStartX","rangeStartY","getCoordinateForArc","rangeEndX","rangeEndY","valueAlpha","valueX","valueY","needleTipX","getInnerX","degToRad","needleTipY","getInnerY","dx","dy","fraction","color","getFractionColor","jsx","BaseNeedle"],"mappings":";;;;AAYa,MAAAA,IAAuC,CAACC,MAAU;AACvD,QAAA;AAAA,IACJ,QAAAC;AAAA,IACA,mBAAAC;AAAA,IACA,mBAAAC;AAAA,IACA,wBAAAC;AAAA,IACA,aAAAC;AAAA,IACA,KAAAC;AAAA,IACA,OAAAC;AAAA,IACA,YAAAC;AAAA,IACA,UAAAC;AAAA,IACA,aAAAC;AAAA,EACE,IAAAV,GACEW,IAASF,IAAW,GACpBG,IAAcX,EAAO,QACrBY,IAAkB,KAAK,MAAMN,IAAQK,CAAW,GAChDE,IAAab,EAAOY,CAAe,EAAE,CAAC,GACtCE,IAAWd,EAAOY,CAAe,EAAE,CAAC,GAEpCG,KAAY,MAAMV,KAAO,GAEzBW,IAAgBD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js";
|
|
2
|
+
const m = (a) => {
|
|
3
|
+
const { position: s, diameter: t, rangeY: e, rangeX: n, distanceFromRanges: r, isInRange: o } = a;
|
|
4
|
+
if (o)
|
|
5
|
+
return null;
|
|
6
|
+
const { startX: d, startY: i, endX: X, endY: Y } = s === "left" ? {
|
|
7
|
+
startX: n || 0,
|
|
8
|
+
startY: e || t / 2 - 0.5,
|
|
9
|
+
endX: -r,
|
|
10
|
+
endY: t / 2 - 0.5
|
|
11
|
+
} : s === "top" ? {
|
|
12
|
+
startX: n || t / 2,
|
|
13
|
+
startY: e || 0,
|
|
14
|
+
endX: t / 2,
|
|
15
|
+
endY: -r
|
|
16
|
+
} : {
|
|
17
|
+
startX: n || t,
|
|
18
|
+
startY: e || t / 2 - 0.5,
|
|
19
|
+
endX: t + r,
|
|
20
|
+
endY: t / 2 - 0.5
|
|
21
|
+
};
|
|
22
|
+
return /* @__PURE__ */ p.jsx("path", { d: `M${d},${i} L${X},${Y}`, stroke: "#CCD0DB" });
|
|
23
|
+
};
|
|
2
24
|
export {
|
|
3
|
-
|
|
25
|
+
m as OutlineMeterLabelPointer
|
|
4
26
|
};
|
|
5
27
|
//# sourceMappingURL=sd-component-library239.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sd-component-library239.js","sources":["../src/components/meters/
|
|
1
|
+
{"version":3,"file":"sd-component-library239.js","sources":["../src/components/meters/outline-meter/partials/outline-meter-label-pointer/outline-meter-label-pointer.tsx"],"sourcesContent":["import React from \"react\";\n\nimport { OutlineMeterLabelPointerProps as Props } from \"./interfaces\";\n\nexport const OutlineMeterLabelPointer: React.FC<Props> = (props) => {\n const { position, diameter, rangeY, rangeX, distanceFromRanges, isInRange } =\n props;\n\n if (isInRange) return null;\n\n const { startX, startY, endX, endY } =\n position === \"left\"\n ? {\n startX: rangeX || 0,\n startY: rangeY || diameter / 2 - 0.5,\n endX: -distanceFromRanges,\n endY: diameter / 2 - 0.5,\n }\n : position === \"top\"\n ? {\n startX: rangeX || diameter / 2,\n startY: rangeY || 0,\n endX: diameter / 2,\n endY: -distanceFromRanges,\n }\n : {\n startX: rangeX || diameter,\n startY: rangeY || diameter / 2 - 0.5,\n endX: diameter + distanceFromRanges,\n endY: diameter / 2 - 0.5,\n };\n\n return (\n <path d={`M${startX},${startY} L${endX},${endY}`} stroke={\"#CCD0DB\"} />\n );\n};\n"],"names":["OutlineMeterLabelPointer","props","position","diameter","rangeY","rangeX","distanceFromRanges","isInRange","startX","startY","endX","endY","jsx"],"mappings":";AAIa,MAAAA,IAA4C,CAACC,MAAU;AAClE,QAAM,EAAE,UAAAC,GAAU,UAAAC,GAAU,QAAAC,GAAQ,QAAAC,GAAQ,oBAAAC,GAAoB,WAAAC,EAC9D,IAAAN;AAEE,MAAAM;AAAkB,WAAA;AAEtB,QAAM,EAAE,QAAAC,GAAQ,QAAAC,GAAQ,MAAAC,GAAM,MAAAC,EAAK,IACjCT,MAAa,SACT;AAAA,IACE,QAAQG,KAAU;AAAA,IAClB,QAAQD,KAAUD,IAAW,IAAI;AAAA,IACjC,MAAM,CAACG;AAAA,IACP,MAAMH,IAAW,IAAI;AAAA,EAAA,IAEvBD,MAAa,QACb;AAAA,IACE,QAAQG,KAAUF,IAAW;AAAA,IAC7B,QAAQC,KAAU;AAAA,IAClB,MAAMD,IAAW;AAAA,IACjB,MAAM,CAACG;AAAA,EAAA,IAET;AAAA,IACE,QAAQD,KAAUF;AAAA,IAClB,QAAQC,KAAUD,IAAW,IAAI;AAAA,IACjC,MAAMA,IAAWG;AAAA,IACjB,MAAMH,IAAW,IAAI;AAAA,EAAA;AAG7B,SACGS,gBAAAA,EAAAA,IAAA,QAAA,EAAK,GAAG,IAAIJ,CAAM,IAAIC,CAAM,KAAKC,CAAI,IAAIC,CAAI,IAAI,QAAQ,UAAW,CAAA;AAEzE;"}
|
|
@@ -2,7 +2,7 @@ import { j as r } from "./sd-component-library197.js";
|
|
|
2
2
|
import { Link as V } from "react-router-dom";
|
|
3
3
|
import { Button as X, Flex as Y } from "rebass";
|
|
4
4
|
import { generateTestLocator as Z } from "./sd-component-library4.js";
|
|
5
|
-
import { LoadingSpinner as tt } from "./sd-component-
|
|
5
|
+
import { LoadingSpinner as tt } from "./sd-component-library205.js";
|
|
6
6
|
function ot(t, o, e) {
|
|
7
7
|
return (n) => {
|
|
8
8
|
t == null || t(n), o && (`#${o}` !== window.location.hash && (e != null && e.replace(
|
|
@@ -1,43 +1,56 @@
|
|
|
1
|
-
import { j as
|
|
2
|
-
import
|
|
3
|
-
import { Box as
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
const {
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
import { j as s } from "./sd-component-library197.js";
|
|
2
|
+
import { useRef as g, useState as $, useEffect as b } from "react";
|
|
3
|
+
import { Box as l } from "rebass";
|
|
4
|
+
import { labelPaddingX as o, labelWidth as u } from "./sd-component-library226.js";
|
|
5
|
+
import { ResponsiveTextV2 as v } from "./sd-component-library150.js";
|
|
6
|
+
const C = (x) => {
|
|
7
|
+
const {
|
|
8
|
+
position: t,
|
|
9
|
+
diameter: r,
|
|
10
|
+
label: d,
|
|
11
|
+
distanceFromLabelToRanges: p,
|
|
12
|
+
isInRange: e,
|
|
13
|
+
color: n
|
|
14
|
+
} = x, i = g(), [c, a] = $(0);
|
|
15
|
+
b(() => {
|
|
16
|
+
i.current && a(i.current.getBoundingClientRect().height);
|
|
17
|
+
}, [i]);
|
|
18
|
+
const h = t === "right" ? `${r + p}px` : t === "top" ? `${r / 2}px` : void 0, m = t === "left" ? `${r + p}px` : void 0, f = t === "left" || t === "right" ? `${r / 2}px` : `${-p}px`;
|
|
19
|
+
return /* @__PURE__ */ s.jsx(l, { sx: { position: "absolute", left: h, top: f, right: m }, children: /* @__PURE__ */ s.jsx(
|
|
20
|
+
l,
|
|
10
21
|
{
|
|
11
22
|
sx: {
|
|
12
|
-
position: "
|
|
13
|
-
top:
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
23
|
+
position: "relative",
|
|
24
|
+
top: `-${c}px`,
|
|
25
|
+
left: t === "top" ? "-50%" : void 0,
|
|
26
|
+
py: "7px",
|
|
27
|
+
px: e ? `${o}px` : "0",
|
|
28
|
+
borderColor: e ? n : "cl_lightGrey",
|
|
29
|
+
borderWidth: e ? "2px" : "1pt",
|
|
30
|
+
borderStyle: e ? "solid" : "none",
|
|
31
|
+
borderBottomStyle: !e && t === "top" ? "none" : "solid",
|
|
32
|
+
borderRadius: e ? `${o}px ${o}px ${t !== "left" ? `${o}px` : "0"} ${t !== "right" ? `${o}px` : "0"}` : "0",
|
|
33
|
+
bg: "cl_white",
|
|
34
|
+
"& > div": {
|
|
35
|
+
maxWidth: t === "top" ? void 0 : `${u}px`
|
|
36
|
+
}
|
|
22
37
|
},
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
e !== t.length - 1 && /* @__PURE__ */ o.jsx(d, { color: "cl_lightGrey" })
|
|
36
|
-
] }, e))
|
|
38
|
+
ref: i,
|
|
39
|
+
children: /* @__PURE__ */ s.jsx(
|
|
40
|
+
v,
|
|
41
|
+
{
|
|
42
|
+
width: "max-content",
|
|
43
|
+
fontSizeWeight: [[12, "semi-bold"]],
|
|
44
|
+
color: e && n !== "#CCD0DB" ? n : "cl_darkGrey",
|
|
45
|
+
textTransform: "uppercase",
|
|
46
|
+
letterSpacing: "1.8px",
|
|
47
|
+
children: d
|
|
48
|
+
}
|
|
49
|
+
)
|
|
37
50
|
}
|
|
38
|
-
);
|
|
39
|
-
}
|
|
51
|
+
) });
|
|
52
|
+
};
|
|
40
53
|
export {
|
|
41
|
-
|
|
54
|
+
C as BaseMeterLabelBox
|
|
42
55
|
};
|
|
43
56
|
//# sourceMappingURL=sd-component-library240.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sd-component-library240.js","sources":["../src/components/
|
|
1
|
+
{"version":3,"file":"sd-component-library240.js","sources":["../src/components/meters/outline-meter/partials/base-meter-label-box/base-meter-label-box.tsx"],"sourcesContent":["import React, { useEffect, useRef, useState } from \"react\";\n\nimport { Box } from \"rebass\";\n\nimport { ResponsiveTextV2 } from \"../../../../texts/responsive-text-v2\";\nimport { labelPaddingX, labelWidth } from \"../../contants\";\nimport { BaseMeterLabelBoxProps as Props } from \"./interfaces\";\n\nexport const BaseMeterLabelBox: React.FC<Props> = (props) => {\n const {\n position,\n diameter,\n label,\n distanceFromLabelToRanges,\n isInRange,\n color,\n } = props;\n const ref = useRef<HTMLElement>();\n const [textHeight, setTextHeight] = useState(0);\n\n useEffect(() => {\n if (ref.current) setTextHeight(ref.current.getBoundingClientRect().height);\n }, [ref]);\n\n const left =\n position === \"right\"\n ? `${diameter + distanceFromLabelToRanges}px`\n : position === \"top\"\n ? `${diameter / 2}px`\n : undefined;\n const right =\n position === \"left\"\n ? `${diameter + distanceFromLabelToRanges}px`\n : undefined;\n const top =\n position === \"left\" || position === \"right\"\n ? `${diameter / 2}px`\n : `${-distanceFromLabelToRanges}px`;\n\n return (\n <Box sx={{ position: \"absolute\", left, top, right }}>\n <Box\n sx={{\n position: \"relative\",\n top: `-${textHeight}px`,\n left: position === \"top\" ? \"-50%\" : undefined,\n py: \"7px\",\n px: isInRange ? `${labelPaddingX}px` : \"0\",\n borderColor: isInRange ? color : \"cl_lightGrey\",\n borderWidth: isInRange ? \"2px\" : \"1pt\",\n borderStyle: isInRange ? \"solid\" : \"none\",\n borderBottomStyle:\n !isInRange && position === \"top\" ? \"none\" : \"solid\",\n borderRadius: isInRange\n ? `${labelPaddingX}px ${labelPaddingX}px ${\n position !== \"left\" ? `${labelPaddingX}px` : \"0\"\n } ${position !== \"right\" ? `${labelPaddingX}px` : \"0\"}`\n : \"0\",\n bg: \"cl_white\",\n \"& > div\": {\n maxWidth: position === \"top\" ? undefined : `${labelWidth}px`,\n },\n }}\n ref={ref}\n >\n <ResponsiveTextV2\n width=\"max-content\"\n fontSizeWeight={[[12, \"semi-bold\"]]}\n color={isInRange && color !== \"#CCD0DB\" ? color : \"cl_darkGrey\"}\n textTransform=\"uppercase\"\n letterSpacing=\"1.8px\"\n >\n {label}\n </ResponsiveTextV2>\n </Box>\n </Box>\n );\n};\n"],"names":["BaseMeterLabelBox","props","position","diameter","label","distanceFromLabelToRanges","isInRange","color","ref","useRef","textHeight","setTextHeight","useState","useEffect","left","right","top","jsx","Box","labelPaddingX","labelWidth","ResponsiveTextV2"],"mappings":";;;;;AAQa,MAAAA,IAAqC,CAACC,MAAU;AACrD,QAAA;AAAA,IACJ,UAAAC;AAAA,IACA,UAAAC;AAAA,IACA,OAAAC;AAAA,IACA,2BAAAC;AAAA,IACA,WAAAC;AAAA,IACA,OAAAC;AAAA,EACE,IAAAN,GACEO,IAAMC,KACN,CAACC,GAAYC,CAAa,IAAIC,EAAS,CAAC;AAE9C,EAAAC,EAAU,MAAM;AACd,IAAIL,EAAI,WAASG,EAAcH,EAAI,QAAQ,sBAAsB,EAAE,MAAM;AAAA,EAAA,GACxE,CAACA,CAAG,CAAC;AAER,QAAMM,IACJZ,MAAa,UACT,GAAGC,IAAWE,CAAyB,OACvCH,MAAa,QACb,GAAGC,IAAW,CAAC,OACf,QACAY,IACJb,MAAa,SACT,GAAGC,IAAWE,CAAyB,OACvC,QACAW,IACJd,MAAa,UAAUA,MAAa,UAChC,GAAGC,IAAW,CAAC,OACf,GAAG,CAACE,CAAyB;AAGjC,SAAAY,gBAAAA,MAACC,KAAI,IAAI,EAAE,UAAU,YAAY,MAAAJ,GAAM,KAAAE,GAAK,OAAAD,EAC1C,GAAA,UAAAE,gBAAAA,EAAA;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,IAAI;AAAA,QACF,UAAU;AAAA,QACV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|
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
|
-
var f = m(d), C = R(g), l = m(y);
|
|
64
|
-
function c(t) {
|
|
65
|
-
return t && t.replace(/ |\u202F|\u00A0/g, " ");
|
|
66
|
-
}
|
|
67
|
-
function E(t) {
|
|
68
|
-
var r = document.createTextNode("");
|
|
69
|
-
t.appendChild(r);
|
|
70
|
-
var e = document.activeElement === t;
|
|
71
|
-
if (r !== null && r.nodeValue !== null && e) {
|
|
72
|
-
var n = window.getSelection();
|
|
73
|
-
if (n !== null) {
|
|
74
|
-
var o = document.createRange();
|
|
75
|
-
o.setStart(r, r.nodeValue.length), o.collapse(!0), n.removeAllRanges(), n.addRange(o);
|
|
76
|
-
}
|
|
77
|
-
t instanceof HTMLElement && t.focus();
|
|
78
|
-
}
|
|
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-library225.js";
|
|
4
|
+
import { getRangeProperties as Y } from "./sd-component-library300.js";
|
|
5
|
+
import { BaseOutlineArc as b } from "./sd-component-library299.js";
|
|
6
|
+
import { DiscreteMeterLabelPointer as w } from "./sd-component-library301.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
|
+
] });
|
|
79
63
|
}
|
|
80
|
-
var w = (
|
|
81
|
-
/** @class */
|
|
82
|
-
function(t) {
|
|
83
|
-
v(r, t);
|
|
84
|
-
function r() {
|
|
85
|
-
var e = t !== null && t.apply(this, arguments) || this;
|
|
86
|
-
return e.lastHtml = e.props.html, e.el = typeof e.props.innerRef == "function" ? { current: null } : f.createRef(), e.getEl = function() {
|
|
87
|
-
return (e.props.innerRef && typeof e.props.innerRef != "function" ? e.props.innerRef : e.el).current;
|
|
88
|
-
}, e.emitChange = function(n) {
|
|
89
|
-
var o = e.getEl();
|
|
90
|
-
if (o) {
|
|
91
|
-
var i = o.innerHTML;
|
|
92
|
-
if (e.props.onChange && i !== e.lastHtml) {
|
|
93
|
-
var u = Object.assign({}, n, {
|
|
94
|
-
target: {
|
|
95
|
-
value: i
|
|
96
|
-
}
|
|
97
|
-
});
|
|
98
|
-
e.props.onChange(u);
|
|
99
|
-
}
|
|
100
|
-
e.lastHtml = i;
|
|
101
|
-
}
|
|
102
|
-
}, e;
|
|
103
|
-
}
|
|
104
|
-
return r.prototype.render = function() {
|
|
105
|
-
var e = this, n = this.props, o = n.tagName, i = n.html, u = n.innerRef, _ = j(n, ["tagName", "html", "innerRef"]);
|
|
106
|
-
return f.createElement(o || "div", p(p({}, _), { ref: typeof u == "function" ? function(s) {
|
|
107
|
-
u(s), e.el.current = s;
|
|
108
|
-
} : u || this.el, onInput: this.emitChange, onBlur: this.props.onBlur || this.emitChange, onKeyUp: this.props.onKeyUp || this.emitChange, onKeyDown: this.props.onKeyDown || this.emitChange, contentEditable: !this.props.disabled, dangerouslySetInnerHTML: { __html: i } }), this.props.children);
|
|
109
|
-
}, r.prototype.shouldComponentUpdate = function(e) {
|
|
110
|
-
var n = this.props, o = this.getEl();
|
|
111
|
-
return !o || c(e.html) !== c(o.innerHTML) ? !0 : n.disabled !== e.disabled || n.tagName !== e.tagName || n.className !== e.className || n.innerRef !== e.innerRef || n.placeholder !== e.placeholder || !C.default(n.style, e.style);
|
|
112
|
-
}, r.prototype.componentDidUpdate = function() {
|
|
113
|
-
var e = this.getEl();
|
|
114
|
-
e && (this.props.html !== e.innerHTML && (e.innerHTML = this.props.html), this.lastHtml = this.props.html, E(e));
|
|
115
|
-
}, r.propTypes = {
|
|
116
|
-
html: l.string.isRequired,
|
|
117
|
-
onChange: l.func,
|
|
118
|
-
disabled: l.bool,
|
|
119
|
-
tagName: l.string,
|
|
120
|
-
className: l.string,
|
|
121
|
-
style: l.object,
|
|
122
|
-
innerRef: l.oneOfType([
|
|
123
|
-
l.object,
|
|
124
|
-
l.func
|
|
125
|
-
])
|
|
126
|
-
}, r;
|
|
127
|
-
}(f.Component)
|
|
128
|
-
), D = h.default = w;
|
|
129
64
|
export {
|
|
130
|
-
|
|
65
|
+
z as DiscreteRange
|
|
131
66
|
};
|
|
132
67
|
//# sourceMappingURL=sd-component-library241.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sd-component-library241.js","sources":["../node_modules/react-contenteditable/lib/react-contenteditable.js"],"sourcesContent":["\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar React = __importStar(require(\"react\"));\nvar fast_deep_equal_1 = __importDefault(require(\"fast-deep-equal\"));\nvar PropTypes = __importStar(require(\"prop-types\"));\nfunction normalizeHtml(str) {\n return str && str.replace(/ |\\u202F|\\u00A0/g, ' ');\n}\nfunction replaceCaret(el) {\n // Place the caret at the end of the element\n var target = document.createTextNode('');\n el.appendChild(target);\n // do not move caret if element was not focused\n var isTargetFocused = document.activeElement === el;\n if (target !== null && target.nodeValue !== null && isTargetFocused) {\n var sel = window.getSelection();\n if (sel !== null) {\n var range = document.createRange();\n range.setStart(target, target.nodeValue.length);\n range.collapse(true);\n sel.removeAllRanges();\n sel.addRange(range);\n }\n if (el instanceof HTMLElement)\n el.focus();\n }\n}\n/**\n * A simple component for an html element with editable contents.\n */\nvar ContentEditable = /** @class */ (function (_super) {\n __extends(ContentEditable, _super);\n function ContentEditable() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.lastHtml = _this.props.html;\n _this.el = typeof _this.props.innerRef === 'function' ? { current: null } : React.createRef();\n _this.getEl = function () { return (_this.props.innerRef && typeof _this.props.innerRef !== 'function' ? _this.props.innerRef : _this.el).current; };\n _this.emitChange = function (originalEvt) {\n var el = _this.getEl();\n if (!el)\n return;\n var html = el.innerHTML;\n if (_this.props.onChange && html !== _this.lastHtml) {\n // Clone event with Object.assign to avoid\n // \"Cannot assign to read only property 'target' of object\"\n var evt = Object.assign({}, originalEvt, {\n target: {\n value: html\n }\n });\n _this.props.onChange(evt);\n }\n _this.lastHtml = html;\n };\n return _this;\n }\n ContentEditable.prototype.render = function () {\n var _this = this;\n var _a = this.props, tagName = _a.tagName, html = _a.html, innerRef = _a.innerRef, props = __rest(_a, [\"tagName\", \"html\", \"innerRef\"]);\n return React.createElement(tagName || 'div', __assign(__assign({}, props), { ref: typeof innerRef === 'function' ? function (current) {\n innerRef(current);\n _this.el.current = current;\n } : innerRef || this.el, onInput: this.emitChange, onBlur: this.props.onBlur || this.emitChange, onKeyUp: this.props.onKeyUp || this.emitChange, onKeyDown: this.props.onKeyDown || this.emitChange, contentEditable: !this.props.disabled, dangerouslySetInnerHTML: { __html: html } }), this.props.children);\n };\n ContentEditable.prototype.shouldComponentUpdate = function (nextProps) {\n var props = this.props;\n var el = this.getEl();\n // We need not rerender if the change of props simply reflects the user's edits.\n // Rerendering in this case would make the cursor/caret jump\n // Rerender if there is no element yet... (somehow?)\n if (!el)\n return true;\n // ...or if html really changed... (programmatically, not by user edit)\n if (normalizeHtml(nextProps.html) !== normalizeHtml(el.innerHTML)) {\n return true;\n }\n // Handle additional properties\n return props.disabled !== nextProps.disabled ||\n props.tagName !== nextProps.tagName ||\n props.className !== nextProps.className ||\n props.innerRef !== nextProps.innerRef ||\n props.placeholder !== nextProps.placeholder ||\n !fast_deep_equal_1.default(props.style, nextProps.style);\n };\n ContentEditable.prototype.componentDidUpdate = function () {\n var el = this.getEl();\n if (!el)\n return;\n // Perhaps React (whose VDOM gets outdated because we often prevent\n // rerendering) did not update the DOM. So we update it manually now.\n if (this.props.html !== el.innerHTML) {\n el.innerHTML = this.props.html;\n }\n this.lastHtml = this.props.html;\n replaceCaret(el);\n };\n ContentEditable.propTypes = {\n html: PropTypes.string.isRequired,\n onChange: PropTypes.func,\n disabled: PropTypes.bool,\n tagName: PropTypes.string,\n className: PropTypes.string,\n style: PropTypes.object,\n innerRef: PropTypes.oneOfType([\n PropTypes.object,\n PropTypes.func,\n ])\n };\n return ContentEditable;\n}(React.Component));\nexports.default = ContentEditable;\n"],"names":["__extends","this","extendStatics","d","b","p","__","__assign","s","i","__createBinding","o","m","k","k2","__setModuleDefault","v","__importStar","mod","result","__rest","e","t","__importDefault","reactContenteditable","React","require$$0","fast_deep_equal_1","require$$1","PropTypes","require$$2","normalizeHtml","str","replaceCaret","el","target","isTargetFocused","sel","range","ContentEditable","_super","_this","originalEvt","html","evt","_a","tagName","innerRef","props","current","nextProps","_default"],"mappings":";;;;;AACA,IAAIA,IAAaC,KAAQA,EAAK,aAAe,WAAY;AACrD,MAAIC,IAAgB,SAAUC,GAAGC,GAAG;AAChC,WAAAF,IAAgB,OAAO,kBAClB,EAAE,WAAW,CAAA,eAAgB,SAAS,SAAUC,GAAGC,GAAG;AAAE,MAAAD,EAAE,YAAYC;AAAA,IAAE,KACzE,SAAUD,GAAGC,GAAG;AAAE,eAASC,KAAKD;AAAG,QAAI,OAAO,UAAU,eAAe,KAAKA,GAAGC,CAAC,MAAGF,EAAEE,CAAC,IAAID,EAAEC,CAAC;AAAA,OAC1FH,EAAcC,GAAGC,CAAC;AAAA,EACjC;AACI,SAAO,SAAUD,GAAGC,GAAG;AACnB,QAAI,OAAOA,KAAM,cAAcA,MAAM;AACjC,YAAM,IAAI,UAAU,yBAAyB,OAAOA,CAAC,IAAI,+BAA+B;AAC5F,IAAAF,EAAcC,GAAGC,CAAC;AAClB,aAASE,IAAK;AAAE,WAAK,c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AAAA,MACjB,UAAUA,EAAU,UAAU;AAAA,QAC1BA,EAAU;AAAA,QACVA,EAAU;AAAA,MACtB,CAAS;AAAA,IACT,GACWU;AAAA,EACX,EAAEd,EAAM,SAAS;AAAA,GACjB0B,IAAA3B,EAAA,UAAkBe;","x_google_ignoreList":[0]}
|
|
1
|
+
{"version":3,"file":"sd-component-library241.js","sources":["../src/components/meters/multi-option-discrete-outline-meter/partials/discrete-range/discrete-range.tsx"],"sourcesContent":["import React, { PropsWithChildren } from \"react\";\n\nimport { BaseOutlineArc } from \"../../../outline-meter/partials/base-outline-arc\";\nimport { getCoordinateForArc } from \"../../../outline-meter/utils\";\nimport { defaultTextBottomMargin } from \"../../constants\";\nimport { getRangeProperties } from \"../../utils\";\nimport { DiscreteMeterLabelPointer } from \"../discrete-meter-label-pointer\";\nimport { DiscreteRangeProps as Props } from \"./interfaces\";\n\nexport function DiscreteRange<T>(props: PropsWithChildren<Props<T>>) {\n const {\n color,\n idx,\n gaugeWidth,\n diameter,\n arc,\n distanceBetweenRanges,\n totalRanges,\n showLabel,\n label,\n isMatchedRange,\n pointerWidth,\n pointerLength,\n horizontal,\n } = props;\n\n const radius = diameter / 2;\n\n const { rangeArcStart, rangeArcEnd } = getRangeProperties(\n arc,\n totalRanges,\n distanceBetweenRanges,\n idx\n );\n\n const { x: rangeStartX, y: rangeStartY } = getCoordinateForArc(\n radius,\n rangeArcStart\n );\n const { x: rangeEndX, y: rangeEndY } = getCoordinateForArc(\n radius,\n rangeArcEnd\n );\n\n const middleArcAlpha = (rangeArcStart + rangeArcEnd) / 2;\n\n return (\n <g>\n <BaseOutlineArc\n startX={rangeStartX}\n startY={rangeStartY}\n endX={rangeEndX}\n endY={rangeEndY}\n startAlpha={rangeArcStart}\n endAlpha={rangeArcEnd}\n color={color}\n radius={radius}\n width={gaugeWidth}\n />\n\n {showLabel && label && !isMatchedRange && (\n <DiscreteMeterLabelPointer\n alpha={middleArcAlpha}\n pointerLength={pointerLength}\n pointerWidth={pointerWidth}\n radius={radius}\n color={color}\n textBottomMargin={defaultTextBottomMargin}\n label={label}\n horizontal={horizontal}\n />\n )}\n </g>\n );\n}\n"],"names":["DiscreteRange","props","color","idx","gaugeWidth","diameter","arc","distanceBetweenRanges","totalRanges","showLabel","label","isMatchedRange","pointerWidth","pointerLength","horizontal","radius","rangeArcStart","rangeArcEnd","getRangeProperties","rangeStartX","rangeStartY","getCoordinateForArc","rangeEndX","rangeEndY","middleArcAlpha","jsx","BaseOutlineArc","DiscreteMeterLabelPointer","defaultTextBottomMargin"],"mappings":";;;;;;AASO,SAASA,EAAiBC,GAAoC;AAC7D,QAAA;AAAA,IACJ,OAAAC;AAAA,IACA,KAAAC;AAAA,IACA,YAAAC;AAAA,IACA,UAAAC;AAAA,IACA,KAAAC;AAAA,IACA,uBAAAC;AAAA,IACA,aAAAC;AAAA,IACA,WAAAC;AAAA,IACA,OAAAC;AAAA,IACA,gBAAAC;AAAA,IACA,cAAAC;AAAA,IACA,eAAAC;AAAA,IACA,YAAAC;AAAA,EACE,IAAAb,GAEEc,IAASV,IAAW,GAEpB,EAAE,eAAAW,GAAe,aAAAC,EAAA,IAAgBC;AAAA,IACrCZ;AAAA,IACAE;AAAA,IACAD;AAAA,IACAJ;AAAA,EAAA,GAGI,EAAE,GAAGgB,GAAa,GAAGC,EAAgB,IAAAC;AAAA,IACzCN;AAAA,IACAC;AAAA,EAAA,GAEI,EAAE,GAAGM,GAAW,GAAGC,EAAc,IAAAF;AAAA,IACrCN;AAAA,IACAE;AAAA,EAAA,GAGIO,KAAkBR,IAAgBC,KAAe;AAEvD,gCACG,KACC,EAAA,UAAA;AAAA,IAAAQ,gBAAAA,EAAA;AAAA,MAACC;AAAA,MAAA;AAAA,QACC,QAAQP;AAAA,QACR,QAAQC;AAAA,QACR,MAAME;AAAA,QACN,MAAMC;AAAA,QACN,YAAYP;AAAA,QACZ,UAAUC;AAAA,QACV,OAAAf;AAAA,QACA,QAAAa;AAAA,QACA,OAAOX;AAAA,MAAA;AAAA,IACT;AAAA,IAECK,KAAaC,KAAS,CAACC,KACtBc,gBAAAA,EAAA;AAAA,MAACE;AAAA,MAAA;AAAA,QACC,OAAOH;AAAA,QACP,eAAAX;AAAA,QACA,cAAAD;AAAA,QACA,QAAAG;AAAA,QACA,OAAAb;AAAA,QACA,kBAAkB0B;AAAA,QAClB,OAAAlB;AAAA,QACA,YAAAI;AAAA,MAAA;AAAA,IACF;AAAA,EAEJ,EAAA,CAAA;AAEJ;"}
|
|
@@ -1,16 +1,46 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
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-library298.js";
|
|
4
|
+
function E(p) {
|
|
5
|
+
const {
|
|
6
|
+
needleColor: u,
|
|
7
|
+
options: n,
|
|
8
|
+
value: h,
|
|
9
|
+
needleWidth: e,
|
|
10
|
+
innerCircleRadius: m,
|
|
11
|
+
innerCircleStrokeWidth: x,
|
|
12
|
+
diameter: R,
|
|
13
|
+
arc: a,
|
|
14
|
+
distanceBetweenRanges: c,
|
|
15
|
+
distanceFromRange: s,
|
|
16
|
+
gaugeWidth: i
|
|
17
|
+
} = p, o = n.findIndex(
|
|
18
|
+
(F) => h === F.value
|
|
19
|
+
), d = R / 2, f = (360 - a) / 2, l = a - (n.length - 1) * c, g = o / n.length, v = (o + 1) / n.length, A = l * (v - g), t = f + c * o + l * g + A / 2, { x: C, y: I } = y(d, t), S = T(
|
|
20
|
+
C,
|
|
21
|
+
r(t),
|
|
22
|
+
s + i + e / 2
|
|
23
|
+
), X = W(
|
|
24
|
+
I,
|
|
25
|
+
r(t),
|
|
26
|
+
s + i + e / 2
|
|
27
|
+
), Y = e / 2 * Math.cos(r(t)), j = e / 2 * Math.sin(r(t));
|
|
28
|
+
return /* @__PURE__ */ M.jsx(
|
|
29
|
+
B,
|
|
30
|
+
{
|
|
31
|
+
dx: Y,
|
|
32
|
+
dy: j,
|
|
33
|
+
color: u,
|
|
34
|
+
radius: d,
|
|
35
|
+
tipX: S,
|
|
36
|
+
tipY: X,
|
|
37
|
+
innerCircleStrokeWidth: x,
|
|
38
|
+
innerCircleRadius: m,
|
|
39
|
+
needleWidth: e
|
|
40
|
+
}
|
|
41
|
+
);
|
|
42
|
+
}
|
|
9
43
|
export {
|
|
10
|
-
|
|
11
|
-
l as htmlSpace,
|
|
12
|
-
r as lineToHtml,
|
|
13
|
-
i as unescapeWrapper,
|
|
14
|
-
n as wrapByDiv
|
|
44
|
+
E as DiscreteMeterNeedle
|
|
15
45
|
};
|
|
16
46
|
//# sourceMappingURL=sd-component-library242.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sd-component-library242.js","sources":["../src/components/
|
|
1
|
+
{"version":3,"file":"sd-component-library242.js","sources":["../src/components/meters/multi-option-discrete-outline-meter/partials/discrete-meter-needle/discrete-meter-needle.tsx"],"sourcesContent":["import React, { PropsWithChildren } from \"react\";\n\nimport { BaseNeedle } from \"../../../outline-meter/partials/base-needle\";\nimport {\n degToRad,\n getCoordinateForArc,\n getInnerX,\n getInnerY,\n} from \"../../../outline-meter/utils\";\nimport { DiscreteMeterNeedleProps as Props } from \"./interfaces\";\n\nexport function DiscreteMeterNeedle<T>(props: PropsWithChildren<Props<T>>) {\n const {\n needleColor,\n options,\n value,\n needleWidth,\n innerCircleRadius,\n innerCircleStrokeWidth,\n diameter,\n arc,\n distanceBetweenRanges,\n distanceFromRange,\n gaugeWidth,\n } = props;\n\n const matchingRangeIndex = options.findIndex(\n (option) => value === option.value\n );\n\n const radius = diameter / 2;\n\n const arcStart = (360 - arc) / 2;\n const arcForRanges = arc - (options.length - 1) * distanceBetweenRanges;\n\n const start = matchingRangeIndex / options.length;\n const end = (matchingRangeIndex + 1) / options.length;\n\n const rangeArc = arcForRanges * (end - start);\n\n const rangeArcStart =\n arcStart +\n distanceBetweenRanges * matchingRangeIndex +\n arcForRanges * start;\n\n const valueAlpha = rangeArcStart + rangeArc / 2;\n const { x: valueX, y: valueY } = getCoordinateForArc(radius, valueAlpha);\n\n const needleTipX = getInnerX(\n valueX,\n degToRad(valueAlpha),\n distanceFromRange + gaugeWidth + needleWidth / 2\n );\n const needleTipY = getInnerY(\n valueY,\n degToRad(valueAlpha),\n distanceFromRange + gaugeWidth + needleWidth / 2\n );\n\n const dx = (needleWidth / 2) * Math.cos(degToRad(valueAlpha));\n const dy = (needleWidth / 2) * Math.sin(degToRad(valueAlpha));\n\n return (\n <BaseNeedle\n dx={dx}\n dy={dy}\n color={needleColor}\n radius={radius}\n tipX={needleTipX}\n tipY={needleTipY}\n innerCircleStrokeWidth={innerCircleStrokeWidth}\n innerCircleRadius={innerCircleRadius}\n needleWidth={needleWidth}\n />\n );\n}\n"],"names":["DiscreteMeterNeedle","props","needleColor","options","value","needleWidth","innerCircleRadius","innerCircleStrokeWidth","diameter","arc","distanceBetweenRanges","distanceFromRange","gaugeWidth","matchingRangeIndex","option","radius","arcStart","arcForRanges","start","end","rangeArc","valueAlpha","valueX","valueY","getCoordinateForArc","needleTipX","getInnerX","degToRad","needleTipY","getInnerY","dx","dy","jsx","BaseNeedle"],"mappings":";;;AAWO,SAASA,EAAuBC,GAAoC;AACnE,QAAA;AAAA,IACJ,aAAAC;AAAA,IACA,SAAAC;AAAA,IACA,OAAAC;AAAA,IACA,aAAAC;AAAA,IACA,mBAAAC;AAAA,IACA,wBAAAC;AAAA,IACA,UAAAC;AAAA,IACA,KAAAC;AAAA,IACA,uBAAAC;AAAA,IACA,mBAAAC;AAAA,IACA,YAAAC;AAAA,EACE,IAAAX,GAEEY,IAAqBV,EAAQ;AAAA,IACjC,CAACW,MAAWV,MAAUU,EAAO;AAAA,EAAA,GAGzBC,IAASP,IAAW,GAEpBQ,KAAY,MAAMP,KAAO,GACzBQ,IAAeR,KAAON,EAAQ,SAAS,KAAKO,GAE5CQ,IAAQL,IAAqBV,EAAQ,QACrCgB,KAAON,IAAqB,KAAKV,EAAQ,QAEzCiB,IAAWH,KAAgBE,IAAMD,IAOjCG,IAJJL,IACAN,IAAwBG,IACxBI,IAAeC,IAEkBE,IAAW,GACxC,EAAE,GAAGE,GAAQ,GAAGC,MAAWC,EAAoBT,GAAQM,CAAU,GAEjEI,IAAaC;AAAA,IACjBJ;AAAA,IACAK,EAASN,CAAU;AAAA,IACnBV,IAAoBC,IAAaP,IAAc;AAAA,EAAA,GAE3CuB,IAAaC;AAAA,IACjBN;AAAA,IACAI,EAASN,CAAU;AAAA,IACnBV,IAAoBC,IAAaP,IAAc;AAAA,EAAA,GAG3CyB,IAAMzB,IAAc,IAAK,KAAK,IAAIsB,EAASN,CAAU,CAAC,GACtDU,IAAM1B,IAAc,IAAK,KAAK,IAAIsB,EAASN,CAAU,CAAC;AAG1D,SAAAW,gBAAAA,EAAA;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,IAAAH;AAAA,MACA,IAAAC;AAAA,MACA,OAAO7B;AAAA,MACP,QAAAa;AAAA,MACA,MAAMU;AAAA,MACN,MAAMG;AAAA,MACN,wBAAArB;AAAA,MACA,mBAAAD;AAAA,MACA,aAAAD;AAAA,IAAA;AAAA,EAAA;AAGN;"}
|
|
@@ -1,17 +1,16 @@
|
|
|
1
|
-
import { j as
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
{
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
);
|
|
1
|
+
import { j as g } from "./sd-component-library197.js";
|
|
2
|
+
import { getRangeProperties as d } from "./sd-component-library300.js";
|
|
3
|
+
import { MatchedRangeLabelBox as x } from "./sd-component-library296.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
|
+
};
|
|
14
13
|
export {
|
|
15
|
-
|
|
14
|
+
h as MatchedRangeLabelBox
|
|
16
15
|
};
|
|
17
16
|
//# sourceMappingURL=sd-component-library243.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sd-component-library243.js","sources":["../src/components/
|
|
1
|
+
{"version":3,"file":"sd-component-library243.js","sources":["../src/components/meters/multi-option-discrete-outline-meter/partials/matched-range-label-box/matched-range-label-box.tsx"],"sourcesContent":["import React from \"react\";\n\nimport { MatchedRangeLabelBox as LabelBox } from \"../../../common-outline-meter-partials\";\nimport { getRangeProperties } from \"../../utils\";\nimport { MatchedRangeLabelBoxProps as Props } from \"./interfaces\";\n\nexport const MatchedRangeLabelBox: React.FC<Props> = (props) => {\n const { idx, totalRanges, distanceBetweenRanges, arc } = props;\n\n const { rangeArcStart, rangeArcEnd } = getRangeProperties(\n arc,\n totalRanges,\n distanceBetweenRanges,\n idx\n );\n\n const alpha = Math.round((rangeArcStart + rangeArcEnd) / 2);\n\n return <LabelBox {...props} alpha={alpha} round />;\n};\n"],"names":["MatchedRangeLabelBox","props","idx","totalRanges","distanceBetweenRanges","arc","rangeArcStart","rangeArcEnd","getRangeProperties","alpha","LabelBox"],"mappings":";;;AAMa,MAAAA,IAAwC,CAACC,MAAU;AAC9D,QAAM,EAAE,KAAAC,GAAK,aAAAC,GAAa,uBAAAC,GAAuB,KAAAC,MAAQJ,GAEnD,EAAE,eAAAK,GAAe,aAAAC,EAAA,IAAgBC;AAAA,IACrCH;AAAA,IACAF;AAAA,IACAC;AAAA,IACAF;AAAA,EAAA,GAGIO,IAAQ,KAAK,OAAOH,IAAgBC,KAAe,CAAC;AAE1D,+BAAQG,GAAU,EAAA,GAAGT,GAAO,OAAAQ,GAAc,OAAK,GAAC,CAAA;AAClD;"}
|
|
@@ -1,6 +1,51 @@
|
|
|
1
|
-
import
|
|
2
|
-
const
|
|
1
|
+
import { getCoordinateForArc as s } from "./sd-component-library91.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
|
+
};
|
|
46
|
+
};
|
|
3
47
|
export {
|
|
4
|
-
|
|
48
|
+
v as areSegmentsValid,
|
|
49
|
+
x as getSegmentCoordinates
|
|
5
50
|
};
|
|
6
51
|
//# sourceMappingURL=sd-component-library244.js.map
|