@semcore/mini-chart 16.0.1-prerelease.4 → 16.0.2-prerelease.1

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.
Files changed (55) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/README.md +1 -5
  3. package/lib/cjs/component/score/Donut.js +38 -50
  4. package/lib/cjs/component/score/Donut.js.map +1 -1
  5. package/lib/cjs/component/score/Line.js +31 -31
  6. package/lib/cjs/component/score/Line.js.map +1 -1
  7. package/lib/cjs/component/score/Line.types.js.map +1 -1
  8. package/lib/cjs/component/score/Score.js.map +1 -1
  9. package/lib/cjs/component/score/index.js.map +1 -1
  10. package/lib/cjs/component/trend/Bar.js +22 -23
  11. package/lib/cjs/component/trend/Bar.js.map +1 -1
  12. package/lib/cjs/component/trend/Line.js +20 -21
  13. package/lib/cjs/component/trend/Line.js.map +1 -1
  14. package/lib/cjs/component/trend/Trend.js +12 -13
  15. package/lib/cjs/component/trend/Trend.js.map +1 -1
  16. package/lib/cjs/component/trend/index.js +1 -1
  17. package/lib/cjs/component/trend/index.js.map +1 -1
  18. package/lib/cjs/index.js +1 -2
  19. package/lib/cjs/index.js.map +1 -1
  20. package/lib/cjs/utils/ScoreDonutUtils.js +72 -0
  21. package/lib/cjs/utils/ScoreDonutUtils.js.map +1 -0
  22. package/lib/es6/component/score/Donut.js +36 -46
  23. package/lib/es6/component/score/Donut.js.map +1 -1
  24. package/lib/es6/component/score/Line.js +29 -28
  25. package/lib/es6/component/score/Line.js.map +1 -1
  26. package/lib/es6/component/score/Line.types.js.map +1 -1
  27. package/lib/es6/component/score/Score.js.map +1 -1
  28. package/lib/es6/component/score/index.js.map +1 -1
  29. package/lib/es6/component/trend/Bar.js +19 -18
  30. package/lib/es6/component/trend/Bar.js.map +1 -1
  31. package/lib/es6/component/trend/Line.js +17 -16
  32. package/lib/es6/component/trend/Line.js.map +1 -1
  33. package/lib/es6/component/trend/Trend.js +10 -10
  34. package/lib/es6/component/trend/Trend.js.map +1 -1
  35. package/lib/es6/component/trend/index.js +1 -1
  36. package/lib/es6/component/trend/index.js.map +1 -1
  37. package/lib/es6/index.js.map +1 -1
  38. package/lib/es6/utils/ScoreDonutUtils.js +65 -0
  39. package/lib/es6/utils/ScoreDonutUtils.js.map +1 -0
  40. package/lib/esm/component/score/Donut.mjs +39 -47
  41. package/lib/esm/component/score/Line.mjs +32 -29
  42. package/lib/esm/component/trend/Bar.mjs +21 -18
  43. package/lib/esm/component/trend/Line.mjs +21 -18
  44. package/lib/esm/component/trend/Trend.mjs +12 -10
  45. package/lib/esm/index.mjs +3 -3
  46. package/lib/esm/utils/ScoreDonutUtils.mjs +67 -0
  47. package/lib/types/component/score/Donut.d.ts +3 -3
  48. package/lib/types/component/score/Line.d.ts +1 -1
  49. package/lib/types/component/score/Line.types.d.ts +5 -5
  50. package/lib/types/component/trend/Bar.d.ts +2 -2
  51. package/lib/types/component/trend/Line.d.ts +2 -2
  52. package/lib/types/component/trend/Trend.d.ts +2 -2
  53. package/lib/types/component/trend/index.d.ts +1 -1
  54. package/lib/types/utils/ScoreDonutUtils.d.ts +14 -0
  55. package/package.json +4 -4
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ScoreDonutUtils.js","names":["ScoreDonutUtils","value","isSemiDonut","_classCallCheck","_defineProperty","radius","_createClass","key","get","Math","PI","baseStrokeDashArray","valueStrokeDashArray","greyStroke","greyStrokeDashArray","offsetPoint","greyStrokeDash","strokeDashArrayBetweenSpaces","concat","valueStroke"],"sources":["../../../src/utils/ScoreDonutUtils.ts"],"sourcesContent":["export class ScoreDonutUtils {\n private readonly isSemiDonut: boolean;\n private readonly value: number;\n\n public readonly radius: number;\n\n constructor(value: number, isSemiDonut: boolean) {\n this.isSemiDonut = isSemiDonut;\n this.radius = isSemiDonut ? 9 : 10;\n this.value = value;\n }\n\n public get viewBox() {\n return this.isSemiDonut ? '0 0 24 12' : '0 0 24 24';\n }\n\n public get strokeWidth() {\n return this.isSemiDonut ? 6 : 4;\n }\n\n public get baseStrokeDashArray() {\n return this.isSemiDonut ? Math.PI * this.radius : 2 * Math.PI * this.radius;\n }\n\n public get valueStrokeDashArray() {\n return this.baseStrokeDashArray * (this.value / 100);\n }\n\n public get greyStrokeDashArray() {\n return this.baseStrokeDashArray - this.valueStrokeDashArray;\n }\n\n public get offsetPoint() {\n return this.isSemiDonut ? this.baseStrokeDashArray / (100 / 3) : this.baseStrokeDashArray / 100;\n }\n\n public get strokeDashArrayParts() {\n const greyStroke = this.greyStrokeDashArray;\n const offsetPoint = this.offsetPoint;\n\n const greyStrokeDash = greyStroke - 2 * offsetPoint;\n const strokeDashArrayBetweenSpaces = `${greyStrokeDash} ${offsetPoint}`;\n\n if (this.isSemiDonut) {\n return `${offsetPoint} ${this.value < 95 ? strokeDashArrayBetweenSpaces : ''} ${this.baseStrokeDashArray}`;\n }\n\n return `${offsetPoint} ${greyStrokeDash >= 0 ? strokeDashArrayBetweenSpaces : ''} ${this.baseStrokeDashArray}`;\n }\n\n public get strokeDashOffsetBase() {\n const valueStroke = this.valueStrokeDashArray;\n const offsetPoint = this.offsetPoint;\n\n return -1 * (valueStroke + (this.isSemiDonut ? offsetPoint : 0));\n };\n}\n"],"mappings":";;;AAAA,WAAaA,eAAe;EAM1B,SAAAA,gBAAYC,KAAa,EAAEC,WAAoB,EAAE;IAAAC,eAAA,OAAAH,eAAA;IAAAI,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAC/C,IAAI,CAACF,WAAW,GAAGA,WAAW;IAC9B,IAAI,CAACG,MAAM,GAAGH,WAAW,GAAG,CAAC,GAAG,EAAE;IAClC,IAAI,CAACD,KAAK,GAAGA,KAAK;EACpB;EAAC,OAAAK,YAAA,CAAAN,eAAA;IAAAO,GAAA;IAAAC,GAAA,EAED,SAAAA,IAAA,EAAqB;MACnB,OAAO,IAAI,CAACN,WAAW,GAAG,WAAW,GAAG,WAAW;IACrD;EAAC;IAAAK,GAAA;IAAAC,GAAA,EAED,SAAAA,IAAA,EAAyB;MACvB,OAAO,IAAI,CAACN,WAAW,GAAG,CAAC,GAAG,CAAC;IACjC;EAAC;IAAAK,GAAA;IAAAC,GAAA,EAED,SAAAA,IAAA,EAAiC;MAC/B,OAAO,IAAI,CAACN,WAAW,GAAGO,IAAI,CAACC,EAAE,GAAG,IAAI,CAACL,MAAM,GAAG,CAAC,GAAGI,IAAI,CAACC,EAAE,GAAG,IAAI,CAACL,MAAM;IAC7E;EAAC;IAAAE,GAAA;IAAAC,GAAA,EAED,SAAAA,IAAA,EAAkC;MAChC,OAAO,IAAI,CAACG,mBAAmB,IAAI,IAAI,CAACV,KAAK,GAAG,GAAG,CAAC;IACtD;EAAC;IAAAM,GAAA;IAAAC,GAAA,EAED,SAAAA,IAAA,EAAiC;MAC/B,OAAO,IAAI,CAACG,mBAAmB,GAAG,IAAI,CAACC,oBAAoB;IAC7D;EAAC;IAAAL,GAAA;IAAAC,GAAA,EAED,SAAAA,IAAA,EAAyB;MACvB,OAAO,IAAI,CAACN,WAAW,GAAG,IAAI,CAACS,mBAAmB,IAAI,GAAG,GAAG,CAAC,CAAC,GAAG,IAAI,CAACA,mBAAmB,GAAG,GAAG;IACjG;EAAC;IAAAJ,GAAA;IAAAC,GAAA,EAED,SAAAA,IAAA,EAAkC;MAChC,IAAMK,UAAU,GAAG,IAAI,CAACC,mBAAmB;MAC3C,IAAMC,WAAW,GAAG,IAAI,CAACA,WAAW;MAEpC,IAAMC,cAAc,GAAGH,UAAU,GAAG,CAAC,GAAGE,WAAW;MACnD,IAAME,4BAA4B,MAAAC,MAAA,CAAMF,cAAc,OAAAE,MAAA,CAAIH,WAAW,CAAE;MAEvE,IAAI,IAAI,CAACb,WAAW,EAAE;QACpB,UAAAgB,MAAA,CAAUH,WAAW,OAAAG,MAAA,CAAI,IAAI,CAACjB,KAAK,GAAG,EAAE,GAAGgB,4BAA4B,GAAG,EAAE,OAAAC,MAAA,CAAI,IAAI,CAACP,mBAAmB;MAC1G;MAEA,UAAAO,MAAA,CAAUH,WAAW,OAAAG,MAAA,CAAIF,cAAc,IAAI,CAAC,GAAGC,4BAA4B,GAAG,EAAE,OAAAC,MAAA,CAAI,IAAI,CAACP,mBAAmB;IAC9G;EAAC;IAAAJ,GAAA;IAAAC,GAAA,EAED,SAAAA,IAAA,EAAkC;MAChC,IAAMW,WAAW,GAAG,IAAI,CAACP,oBAAoB;MAC7C,IAAMG,WAAW,GAAG,IAAI,CAACA,WAAW;MAEpC,OAAO,CAAC,CAAC,IAAII,WAAW,IAAI,IAAI,CAACjB,WAAW,GAAGa,WAAW,GAAG,CAAC,CAAC,CAAC;IAClE;EAAC;AAAA","ignoreList":[]}
@@ -1,60 +1,53 @@
1
1
  import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
2
2
  import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
3
3
  import _createClass from "@babel/runtime/helpers/esm/createClass";
4
+ import _possibleConstructorReturn from "@babel/runtime/helpers/esm/possibleConstructorReturn";
5
+ import _isNativeReflectConstruct from "@babel/runtime/helpers/esm/isNativeReflectConstruct";
6
+ import _getPrototypeOf from "@babel/runtime/helpers/esm/getPrototypeOf";
4
7
  import _inherits from "@babel/runtime/helpers/esm/inherits";
5
- import _createSuper from "@babel/runtime/helpers/esm/createSuper";
6
8
  import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
7
- import { sstyled, createComponent, assignProps, Component } from "@semcore/core";
8
- import React from "react";
9
- import { Box } from "@semcore/flex-box";
10
- import resolveColorEnhance from "@semcore/core/lib/utils/enhances/resolveColorEnhance";
9
+ import { createComponent, sstyled, assignProps, Component } from "@semcore/core";
11
10
  import { extractAriaProps } from "@semcore/core/lib/utils/ariaProps";
11
+ import resolveColorEnhance from "@semcore/core/lib/utils/enhances/resolveColorEnhance";
12
+ import { Box } from "@semcore/flex-box";
13
+ import React from "react";
14
+ import { ScoreDonutUtils } from "../../utils/ScoreDonutUtils.mjs";
15
+ function _callSuper(t, o, e) {
16
+ return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
17
+ }
12
18
  /*!__reshadow-styles__:"./donut.shadow.css"*/
13
19
  var style = (
14
20
  /*__reshadow_css_start__*/
15
21
  (sstyled.insert(
16
22
  /*__inner_css_start__*/
17
- "@keyframes pulse_1i1x7{0%,to{opacity:1}50%{opacity:.4}}.___SDonutContainer_1i1x7_gg_.__loading_1i1x7_gg_,.___SLineGauge_1i1x7_gg_.__loading_1i1x7_gg_,.___STrendBar_1i1x7_gg_.__loading_1i1x7_gg_,.___STrendLine_1i1x7_gg_.__loading_1i1x7_gg_{animation-name:pulse_1i1x7;animation-iteration-count:infinite;animation-timing-function:ease-in-out;animation-duration:1.6s;will-change:opacity}.___SDonutContainer_1i1x7_gg_.__semi_1i1x7_gg_ g{transform:rotate(180deg) translate(-24px,-24px)}.___SDonutContainer_1i1x7_gg_ g{transform:rotate(-90deg) translate(-24px)}.___SDonutContainer_1i1x7_gg_.__animate_1i1x7_gg_ circle{transition:all var(--intergalactic-duration-extra-slow, 500) ease-in-out}",
23
+ "@keyframes pulse_iv4ae{0%,to{opacity:1}50%{opacity:.4}}.___SDonutContainer_iv4ae_gg_.__loading_iv4ae_gg_,.___SLineGauge_iv4ae_gg_.__loading_iv4ae_gg_,.___STrendBar_iv4ae_gg_.__loading_iv4ae_gg_,.___STrendLine_iv4ae_gg_.__loading_iv4ae_gg_{animation-name:pulse_iv4ae;animation-iteration-count:infinite;animation-timing-function:ease-in-out;animation-duration:1.6s;will-change:opacity}.___SDonutContainer_iv4ae_gg_.__semi_iv4ae_gg_ g{transform:rotate(180deg) translate(-24px,-24px)}.___SDonutContainer_iv4ae_gg_ g{transform:rotate(-90deg) translate(-24px)}.___SDonutContainer_iv4ae_gg_.__animate_iv4ae_gg_ circle{transition:all var(--intergalactic-duration-extra-slow, 500) ease-in-out}",
18
24
  /*__inner_css_end__*/
19
- "1i1x7_gg_"
25
+ "iv4ae_gg_"
20
26
  ), /*__reshadow_css_end__*/
21
27
  {
22
- "__SLineGauge": "___SLineGauge_1i1x7_gg_",
23
- "_loading": "__loading_1i1x7_gg_",
24
- "__SDonutContainer": "___SDonutContainer_1i1x7_gg_",
25
- "__STrendLine": "___STrendLine_1i1x7_gg_",
26
- "__STrendBar": "___STrendBar_1i1x7_gg_",
27
- "@pulse": "pulse_1i1x7",
28
- "_animate": "__animate_1i1x7_gg_",
29
- "_semi": "__semi_1i1x7_gg_"
28
+ "__SLineGauge": "___SLineGauge_iv4ae_gg_",
29
+ "_loading": "__loading_iv4ae_gg_",
30
+ "__SDonutContainer": "___SDonutContainer_iv4ae_gg_",
31
+ "__STrendLine": "___STrendLine_iv4ae_gg_",
32
+ "__STrendBar": "___STrendBar_iv4ae_gg_",
33
+ "@pulse": "pulse_iv4ae",
34
+ "_animate": "__animate_iv4ae_gg_",
35
+ "_semi": "__semi_iv4ae_gg_"
30
36
  })
31
37
  );
32
38
  var DonutRoot = /* @__PURE__ */ function(_Component) {
33
- _inherits(DonutRoot2, _Component);
34
- var _super = _createSuper(DonutRoot2);
35
39
  function DonutRoot2() {
36
40
  _classCallCheck(this, DonutRoot2);
37
- return _super.apply(this, arguments);
41
+ return _callSuper(this, DonutRoot2, arguments);
38
42
  }
39
- _createClass(DonutRoot2, [{
43
+ _inherits(DonutRoot2, _Component);
44
+ return _createClass(DonutRoot2, [{
40
45
  key: "render",
41
46
  value: function render() {
42
47
  var _ref = this.asProps, _ref2;
43
48
  var SDonutContainer = Box;
44
49
  var _this$asProps = this.asProps, value = _this$asProps.value, styles = _this$asProps.styles, _this$asProps$baseBgC = _this$asProps.baseBgColor, baseBgColor = _this$asProps$baseBgC === void 0 ? "chart-grid-bar-chart-base-bg" : _this$asProps$baseBgC, _this$asProps$color = _this$asProps.color, color = _this$asProps$color === void 0 ? "chart-palette-order-1" : _this$asProps$color, resolveColor = _this$asProps.resolveColor, isSemiDonut = _this$asProps.isSemiDonut, loading = _this$asProps.loading;
45
- var strokeWidth = isSemiDonut ? 6 : 4;
46
- var radius = isSemiDonut ? 9 : 10;
47
- var baseStrokeDasharray = isSemiDonut ? Math.PI * radius : Math.PI * 2 * radius;
48
- var valueStrokeDasharray = baseStrokeDasharray * (value / 100);
49
- var greyStrokeDasharray = baseStrokeDasharray * ((100 - value) / 100);
50
- var offsetPoint = isSemiDonut ? baseStrokeDasharray / (100 / 3) : baseStrokeDasharray / 100;
51
- var strokeDasharrayBetweenSpaces = "".concat(greyStrokeDasharray - 2 * offsetPoint, " ").concat(offsetPoint);
52
- var spaceStrokeDasharray = "".concat(offsetPoint, " ").concat(value < 99 ? "".concat(strokeDasharrayBetweenSpaces) : "", " ").concat(baseStrokeDasharray);
53
- if (isSemiDonut) {
54
- spaceStrokeDasharray = "".concat(offsetPoint, " ").concat(value < 95 ? "".concat(strokeDasharrayBetweenSpaces) : "", " ").concat(baseStrokeDasharray);
55
- }
56
- var viewBox = isSemiDonut ? "0 0 24 12" : "0 0 24 24";
57
- var strokeDashoffsetBase = -1 * (valueStrokeDasharray + (isSemiDonut ? offsetPoint : 0));
50
+ var scoreDonut = new ScoreDonutUtils(value, isSemiDonut);
58
51
  var _extractAriaProps = extractAriaProps(this.asProps), __excludeProps = _extractAriaProps.__excludeProps, extractedAriaProps = _extractAriaProps.extractedAriaProps;
59
52
  return _ref2 = sstyled(styles), /* @__PURE__ */ React.createElement(SDonutContainer, _ref2.cn("SDonutContainer", _objectSpread({}, assignProps({
60
53
  "semi": isSemiDonut,
@@ -62,40 +55,39 @@ var DonutRoot = /* @__PURE__ */ function(_Component) {
62
55
  }, _ref))), /* @__PURE__ */ React.createElement("svg", _ref2.cn("svg", _objectSpread({
63
56
  "width": "100%",
64
57
  "height": "100%",
65
- "viewBox": viewBox,
58
+ "viewBox": scoreDonut.viewBox,
66
59
  "fill": "none",
67
60
  "role": "img"
68
61
  }, extractedAriaProps)), /* @__PURE__ */ React.createElement("g", _ref2.cn("g", {}), /* @__PURE__ */ React.createElement("circle", _ref2.cn("circle", {
69
62
  "cx": "12",
70
63
  "cy": "12",
71
- "r": radius,
72
- "strokeWidth": strokeWidth,
64
+ "r": scoreDonut.radius,
65
+ "strokeWidth": scoreDonut.strokeWidth,
73
66
  "stroke": resolveColor(baseBgColor),
74
- "strokeDasharray": loading ? void 0 : "".concat(greyStrokeDasharray, " ").concat(baseStrokeDasharray),
75
- "strokeDashoffset": strokeDashoffsetBase
67
+ "strokeDasharray": loading ? void 0 : "".concat(scoreDonut.greyStrokeDashArray, " ").concat(scoreDonut.baseStrokeDashArray),
68
+ "strokeDashoffset": scoreDonut.strokeDashOffsetBase
76
69
  })), !loading && /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("circle", _ref2.cn("circle", {
77
70
  "cx": "12",
78
71
  "cy": "12",
79
- "r": radius,
80
- "strokeWidth": strokeWidth,
72
+ "r": scoreDonut.radius,
73
+ "strokeWidth": scoreDonut.strokeWidth,
81
74
  "stroke": resolveColor(color),
82
- "strokeDasharray": "".concat(valueStrokeDasharray, " ").concat(baseStrokeDasharray),
83
- "strokeDashoffset": valueStrokeDasharray
75
+ "strokeDasharray": "".concat(scoreDonut.valueStrokeDashArray, " ").concat(scoreDonut.baseStrokeDashArray),
76
+ "strokeDashoffset": scoreDonut.valueStrokeDashArray
84
77
  }), /* @__PURE__ */ React.createElement("animate", _ref2.cn("animate", {
85
78
  "attributeName": "stroke-dashoffset",
86
- "values": "0;".concat(valueStrokeDasharray)
79
+ "values": "0;".concat(scoreDonut.valueStrokeDashArray)
87
80
  }))), value !== 100 && !isSemiDonut && /* @__PURE__ */ React.createElement("circle", _ref2.cn("circle", {
88
81
  "cx": "12",
89
82
  "cy": "12",
90
- "r": radius,
91
- "strokeWidth": strokeWidth,
83
+ "r": scoreDonut.radius,
84
+ "strokeWidth": scoreDonut.strokeWidth,
92
85
  "stroke": resolveColor("chart-grid-border"),
93
- "strokeDasharray": spaceStrokeDasharray,
94
- "strokeDashoffset": -1 * valueStrokeDasharray
86
+ "strokeDasharray": scoreDonut.strokeDashArrayParts,
87
+ "strokeDashoffset": -1 * scoreDonut.valueStrokeDashArray
95
88
  }))))));
96
89
  }
97
90
  }]);
98
- return DonutRoot2;
99
91
  }(Component);
100
92
  _defineProperty(DonutRoot, "enhance", [resolveColorEnhance()]);
101
93
  _defineProperty(DonutRoot, "style", style);
@@ -1,50 +1,54 @@
1
1
  import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
2
2
  import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
3
3
  import _createClass from "@babel/runtime/helpers/esm/createClass";
4
+ import _possibleConstructorReturn from "@babel/runtime/helpers/esm/possibleConstructorReturn";
5
+ import _isNativeReflectConstruct from "@babel/runtime/helpers/esm/isNativeReflectConstruct";
6
+ import _getPrototypeOf from "@babel/runtime/helpers/esm/getPrototypeOf";
4
7
  import _inherits from "@babel/runtime/helpers/esm/inherits";
5
- import _createSuper from "@babel/runtime/helpers/esm/createSuper";
6
8
  import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
7
- import { sstyled, createComponent, assignProps, Component } from "@semcore/core";
8
- import React from "react";
9
- import { Box, Flex } from "@semcore/flex-box";
9
+ import { createComponent, sstyled, assignProps, Component } from "@semcore/core";
10
10
  import resolveColorEnhance from "@semcore/core/lib/utils/enhances/resolveColorEnhance";
11
+ import { Box, Flex } from "@semcore/flex-box";
12
+ import React from "react";
13
+ function _callSuper(t, o, e) {
14
+ return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
15
+ }
11
16
  /*!__reshadow-styles__:"./line.shadow.css"*/
12
17
  var style = (
13
18
  /*__reshadow_css_start__*/
14
19
  (sstyled.insert(
15
20
  /*__inner_css_start__*/
16
- "@keyframes pulse_7icm2{0%,to{opacity:1}50%{opacity:.4}}@keyframes move-line_7icm2{0%{transform:translateX(0)}to{transform:translateX(100%)}}.___SDonutContainer_7icm2_gg_.__loading_7icm2_gg_,.___SLineGauge_7icm2_gg_.__loading_7icm2_gg_,.___STrendBar_7icm2_gg_.__loading_7icm2_gg_,.___STrendLine_7icm2_gg_.__loading_7icm2_gg_{animation-name:pulse_7icm2;animation-iteration-count:infinite;animation-timing-function:ease-in-out;animation-duration:1.6s;will-change:opacity}.___SLineGauge_7icm2_gg_{height:8px;background-color:var(--base-bg-color_7icm2, var(--intergalactic-chart-grid-bar-chart-base-bg, #e0e1e9));border-radius:var(--intergalactic-chart-rounded, 2px);overflow:hidden;position:relative}.___SLineValue_7icm2_gg_{height:8px;border-radius:var(--intergalactic-chart-rounded, 2px)0 0 var(--intergalactic-chart-rounded, 2px)}.___SLineValue_7icm2_gg_.__percent_7icm2_gg_{width:var(--percent_7icm2)}.___SLineSegmentItem_7icm2_gg_.__color_7icm2_gg_,.___SLineValue_7icm2_gg_.__color_7icm2_gg_{background-color:var(--color_7icm2, var(--intergalactic-chart-palette-order-1, #2bb3ff))}.___SLineGauge_7icm2_gg_.__segments_7icm2_gg_{border-radius:var(--intergalactic-progress-bar-rounded, 6px)}.___SAnimationLine_7icm2_gg_,.___SLineGaugeSegment_7icm2_gg_{position:absolute;top:0;left:0;right:0;bottom:0}.___SLineSegmentItem_7icm2_gg_:last-child{margin-right:0;border-right:none}.___SLineSegmentItem_7icm2_gg_{height:8px;background:0 0;border-right-color:var(--intergalactic-chart-grid-border, #ffffff);border-right-style:solid;border-right-width:1px;box-sizing:content-box}.___SAnimationLine_7icm2_gg_{background-color:var(--intergalactic-chart-grid-bar-chart-base-bg, #e0e1e9);transition:all var(--intergalactic-duration-extra-slow, 500) ease-in-out;animation-name:move-line_7icm2;animation-duration:.5s;animation-timing-function:ease-in-out;animation-fill-mode:forwards}",
21
+ "@keyframes pulse_v62p0{0%,to{opacity:1}50%{opacity:.4}}@keyframes move-line_v62p0{0%{transform:translateX(0)}to{transform:translateX(100%)}}.___SDonutContainer_v62p0_gg_.__loading_v62p0_gg_,.___SLineGauge_v62p0_gg_.__loading_v62p0_gg_,.___STrendBar_v62p0_gg_.__loading_v62p0_gg_,.___STrendLine_v62p0_gg_.__loading_v62p0_gg_{animation-name:pulse_v62p0;animation-iteration-count:infinite;animation-timing-function:ease-in-out;animation-duration:1.6s;will-change:opacity}.___SLineGauge_v62p0_gg_{height:8px;background-color:var(--base-bg-color_v62p0, var(--intergalactic-chart-grid-bar-chart-base-bg, #e0e1e9));border-radius:var(--intergalactic-chart-rounded, 2px);overflow:hidden;position:relative}.___SLineValue_v62p0_gg_{height:8px;border-radius:var(--intergalactic-chart-rounded, 2px)0 0 var(--intergalactic-chart-rounded, 2px)}.___SLineValue_v62p0_gg_.__percent_v62p0_gg_{width:var(--percent_v62p0)}.___SLineSegmentItem_v62p0_gg_.__color_v62p0_gg_,.___SLineValue_v62p0_gg_.__color_v62p0_gg_{background-color:var(--color_v62p0, var(--intergalactic-chart-palette-order-1, #2bb3ff))}.___SLineGauge_v62p0_gg_.__segments_v62p0_gg_{border-radius:var(--intergalactic-progress-bar-rounded, 6px)}.___SAnimationLine_v62p0_gg_,.___SLineGaugeSegment_v62p0_gg_{position:absolute;top:0;left:0;right:0;bottom:0}.___SLineSegmentItem_v62p0_gg_:last-child{margin-right:0;border-right:none}.___SLineSegmentItem_v62p0_gg_{height:8px;background:0 0;border-right-color:var(--intergalactic-chart-grid-border, #ffffff);border-right-style:solid;border-right-width:1px;box-sizing:content-box}.___SAnimationLine_v62p0_gg_{background-color:var(--intergalactic-chart-grid-bar-chart-base-bg, #e0e1e9);transition:all var(--intergalactic-duration-extra-slow, 500) ease-in-out;animation-name:move-line_v62p0;animation-duration:.5s;animation-timing-function:ease-in-out;animation-fill-mode:forwards}",
17
22
  /*__inner_css_end__*/
18
- "7icm2_gg_"
23
+ "v62p0_gg_"
19
24
  ), /*__reshadow_css_end__*/
20
25
  {
21
- "__SLineGauge": "___SLineGauge_7icm2_gg_",
22
- "_loading": "__loading_7icm2_gg_",
23
- "__SDonutContainer": "___SDonutContainer_7icm2_gg_",
24
- "__STrendLine": "___STrendLine_7icm2_gg_",
25
- "__STrendBar": "___STrendBar_7icm2_gg_",
26
- "@pulse": "pulse_7icm2",
27
- "--base-bg-color": "--base-bg-color_7icm2",
28
- "__SLineValue": "___SLineValue_7icm2_gg_",
29
- "_percent": "__percent_7icm2_gg_",
30
- "--percent": "--percent_7icm2",
31
- "_color": "__color_7icm2_gg_",
32
- "__SLineSegmentItem": "___SLineSegmentItem_7icm2_gg_",
33
- "--color": "--color_7icm2",
34
- "_segments": "__segments_7icm2_gg_",
35
- "__SLineGaugeSegment": "___SLineGaugeSegment_7icm2_gg_",
36
- "__SAnimationLine": "___SAnimationLine_7icm2_gg_",
37
- "@move-line": "move-line_7icm2"
26
+ "__SLineGauge": "___SLineGauge_v62p0_gg_",
27
+ "_loading": "__loading_v62p0_gg_",
28
+ "__SDonutContainer": "___SDonutContainer_v62p0_gg_",
29
+ "__STrendLine": "___STrendLine_v62p0_gg_",
30
+ "__STrendBar": "___STrendBar_v62p0_gg_",
31
+ "@pulse": "pulse_v62p0",
32
+ "--base-bg-color": "--base-bg-color_v62p0",
33
+ "__SLineValue": "___SLineValue_v62p0_gg_",
34
+ "_percent": "__percent_v62p0_gg_",
35
+ "--percent": "--percent_v62p0",
36
+ "_color": "__color_v62p0_gg_",
37
+ "__SLineSegmentItem": "___SLineSegmentItem_v62p0_gg_",
38
+ "--color": "--color_v62p0",
39
+ "_segments": "__segments_v62p0_gg_",
40
+ "__SLineGaugeSegment": "___SLineGaugeSegment_v62p0_gg_",
41
+ "__SAnimationLine": "___SAnimationLine_v62p0_gg_",
42
+ "@move-line": "move-line_v62p0"
38
43
  })
39
44
  );
40
45
  var LineRoot = /* @__PURE__ */ function(_Component) {
41
- _inherits(LineRoot2, _Component);
42
- var _super = _createSuper(LineRoot2);
43
46
  function LineRoot2() {
44
47
  _classCallCheck(this, LineRoot2);
45
- return _super.apply(this, arguments);
48
+ return _callSuper(this, LineRoot2, arguments);
46
49
  }
47
- _createClass(LineRoot2, [{
50
+ _inherits(LineRoot2, _Component);
51
+ return _createClass(LineRoot2, [{
48
52
  key: "getSegmentProps",
49
53
  value: function getSegmentProps(segmentProps) {
50
54
  var _this$asProps = this.asProps, children = _this$asProps.children, resolveColor = _this$asProps.resolveColor;
@@ -56,7 +60,7 @@ var LineRoot = /* @__PURE__ */ function(_Component) {
56
60
  });
57
61
  var width = sum > 0 ? 100 * segmentProps.value / sum : 0;
58
62
  return {
59
- w: "".concat(width, "%"),
63
+ "w": "".concat(width, "%"),
60
64
  "use:color": resolveColor(segmentProps.color)
61
65
  };
62
66
  }
@@ -102,7 +106,6 @@ var LineRoot = /* @__PURE__ */ function(_Component) {
102
106
  })), Boolean(SegmentItems.length) && /* @__PURE__ */ React.createElement(SLineGaugeSegment, _ref5.cn("SLineGaugeSegment", {}), SegmentItems), animate && /* @__PURE__ */ React.createElement(SAnimationLine, _ref5.cn("SAnimationLine", {})));
103
107
  }
104
108
  }]);
105
- return LineRoot2;
106
109
  }(Component);
107
110
  _defineProperty(LineRoot, "enhance", [resolveColorEnhance()]);
108
111
  _defineProperty(LineRoot, "displayName", "ScoreLine");
@@ -2,41 +2,45 @@ import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
2
2
  import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
3
3
  import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
4
4
  import _createClass from "@babel/runtime/helpers/esm/createClass";
5
+ import _possibleConstructorReturn from "@babel/runtime/helpers/esm/possibleConstructorReturn";
6
+ import _isNativeReflectConstruct from "@babel/runtime/helpers/esm/isNativeReflectConstruct";
7
+ import _getPrototypeOf from "@babel/runtime/helpers/esm/getPrototypeOf";
5
8
  import _inherits from "@babel/runtime/helpers/esm/inherits";
6
- import _createSuper from "@babel/runtime/helpers/esm/createSuper";
7
9
  import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
8
- import { sstyled, createComponent, assignProps } from "@semcore/core";
9
- import React from "react";
10
+ import { createComponent, assignProps, sstyled } from "@semcore/core";
11
+ import { extractAriaProps } from "@semcore/core/lib/utils/ariaProps";
10
12
  import resolveColorEnhance from "@semcore/core/lib/utils/enhances/resolveColorEnhance";
11
- import { Trend } from "./Trend.mjs";
12
13
  import { Box } from "@semcore/flex-box";
13
- import { extractAriaProps } from "@semcore/core/lib/utils/ariaProps";
14
+ import React from "react";
15
+ import { Trend } from "./Trend.mjs";
16
+ function _callSuper(t, o, e) {
17
+ return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
18
+ }
14
19
  /*!__reshadow-styles__:"../skeleton/skeleton.shadow.css"*/
15
20
  var style = (
16
21
  /*__reshadow_css_start__*/
17
22
  (sstyled.insert(
18
23
  /*__inner_css_start__*/
19
- "@keyframes pulse_1ql6o{0%,to{opacity:1}50%{opacity:.4}}.___SDonutContainer_1ql6o_gg_.__loading_1ql6o_gg_,.___SLineGauge_1ql6o_gg_.__loading_1ql6o_gg_,.___STrendBar_1ql6o_gg_.__loading_1ql6o_gg_,.___STrendLine_1ql6o_gg_.__loading_1ql6o_gg_{animation-name:pulse_1ql6o;animation-iteration-count:infinite;animation-timing-function:ease-in-out;animation-duration:1.6s;will-change:opacity}",
24
+ "@keyframes pulse_1pnj2{0%,to{opacity:1}50%{opacity:.4}}.___SDonutContainer_1pnj2_gg_.__loading_1pnj2_gg_,.___SLineGauge_1pnj2_gg_.__loading_1pnj2_gg_,.___STrendBar_1pnj2_gg_.__loading_1pnj2_gg_,.___STrendLine_1pnj2_gg_.__loading_1pnj2_gg_{animation-name:pulse_1pnj2;animation-iteration-count:infinite;animation-timing-function:ease-in-out;animation-duration:1.6s;will-change:opacity}",
20
25
  /*__inner_css_end__*/
21
- "1ql6o_gg_"
26
+ "1pnj2_gg_"
22
27
  ), /*__reshadow_css_end__*/
23
28
  {
24
- "__SLineGauge": "___SLineGauge_1ql6o_gg_",
25
- "_loading": "__loading_1ql6o_gg_",
26
- "__SDonutContainer": "___SDonutContainer_1ql6o_gg_",
27
- "__STrendLine": "___STrendLine_1ql6o_gg_",
28
- "__STrendBar": "___STrendBar_1ql6o_gg_",
29
- "@pulse": "pulse_1ql6o"
29
+ "__SLineGauge": "___SLineGauge_1pnj2_gg_",
30
+ "_loading": "__loading_1pnj2_gg_",
31
+ "__SDonutContainer": "___SDonutContainer_1pnj2_gg_",
32
+ "__STrendLine": "___STrendLine_1pnj2_gg_",
33
+ "__STrendBar": "___STrendBar_1pnj2_gg_",
34
+ "@pulse": "pulse_1pnj2"
30
35
  })
31
36
  );
32
37
  var TrendBarRoot = /* @__PURE__ */ function(_Trend) {
33
- _inherits(TrendBarRoot2, _Trend);
34
- var _super = _createSuper(TrendBarRoot2);
35
38
  function TrendBarRoot2() {
36
39
  _classCallCheck(this, TrendBarRoot2);
37
- return _super.apply(this, arguments);
40
+ return _callSuper(this, TrendBarRoot2, arguments);
38
41
  }
39
- _createClass(TrendBarRoot2, [{
42
+ _inherits(TrendBarRoot2, _Trend);
43
+ return _createClass(TrendBarRoot2, [{
40
44
  key: "defaultData",
41
45
  get: function get() {
42
46
  return [{
@@ -94,7 +98,6 @@ var TrendBarRoot = /* @__PURE__ */ function(_Trend) {
94
98
  })));
95
99
  }
96
100
  }]);
97
- return TrendBarRoot2;
98
101
  }(Trend);
99
102
  _defineProperty(TrendBarRoot, "enhance", [resolveColorEnhance()]);
100
103
  _defineProperty(TrendBarRoot, "style", style);
@@ -2,42 +2,46 @@ import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
2
2
  import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
3
3
  import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
4
4
  import _createClass from "@babel/runtime/helpers/esm/createClass";
5
+ import _possibleConstructorReturn from "@babel/runtime/helpers/esm/possibleConstructorReturn";
6
+ import _isNativeReflectConstruct from "@babel/runtime/helpers/esm/isNativeReflectConstruct";
7
+ import _getPrototypeOf from "@babel/runtime/helpers/esm/getPrototypeOf";
5
8
  import _inherits from "@babel/runtime/helpers/esm/inherits";
6
- import _createSuper from "@babel/runtime/helpers/esm/createSuper";
7
9
  import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
8
- import { sstyled, createComponent, assignProps } from "@semcore/core";
9
- import React from "react";
10
+ import { createComponent, assignProps, sstyled } from "@semcore/core";
11
+ import { extractAriaProps } from "@semcore/core/lib/utils/ariaProps";
10
12
  import resolveColorEnhance from "@semcore/core/lib/utils/enhances/resolveColorEnhance";
11
13
  import uniqueIDEnhancement from "@semcore/core/lib/utils/uniqueID";
12
- import { Trend } from "./Trend.mjs";
13
14
  import { Box } from "@semcore/flex-box";
14
- import { extractAriaProps } from "@semcore/core/lib/utils/ariaProps";
15
+ import React from "react";
16
+ import { Trend } from "./Trend.mjs";
17
+ function _callSuper(t, o, e) {
18
+ return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
19
+ }
15
20
  /*!__reshadow-styles__:"../skeleton/skeleton.shadow.css"*/
16
21
  var style = (
17
22
  /*__reshadow_css_start__*/
18
23
  (sstyled.insert(
19
24
  /*__inner_css_start__*/
20
- "@keyframes pulse_1ql6o{0%,to{opacity:1}50%{opacity:.4}}.___SDonutContainer_1ql6o_gg_.__loading_1ql6o_gg_,.___SLineGauge_1ql6o_gg_.__loading_1ql6o_gg_,.___STrendBar_1ql6o_gg_.__loading_1ql6o_gg_,.___STrendLine_1ql6o_gg_.__loading_1ql6o_gg_{animation-name:pulse_1ql6o;animation-iteration-count:infinite;animation-timing-function:ease-in-out;animation-duration:1.6s;will-change:opacity}",
25
+ "@keyframes pulse_1pnj2{0%,to{opacity:1}50%{opacity:.4}}.___SDonutContainer_1pnj2_gg_.__loading_1pnj2_gg_,.___SLineGauge_1pnj2_gg_.__loading_1pnj2_gg_,.___STrendBar_1pnj2_gg_.__loading_1pnj2_gg_,.___STrendLine_1pnj2_gg_.__loading_1pnj2_gg_{animation-name:pulse_1pnj2;animation-iteration-count:infinite;animation-timing-function:ease-in-out;animation-duration:1.6s;will-change:opacity}",
21
26
  /*__inner_css_end__*/
22
- "1ql6o_gg_"
27
+ "1pnj2_gg_"
23
28
  ), /*__reshadow_css_end__*/
24
29
  {
25
- "__SLineGauge": "___SLineGauge_1ql6o_gg_",
26
- "_loading": "__loading_1ql6o_gg_",
27
- "__SDonutContainer": "___SDonutContainer_1ql6o_gg_",
28
- "__STrendLine": "___STrendLine_1ql6o_gg_",
29
- "__STrendBar": "___STrendBar_1ql6o_gg_",
30
- "@pulse": "pulse_1ql6o"
30
+ "__SLineGauge": "___SLineGauge_1pnj2_gg_",
31
+ "_loading": "__loading_1pnj2_gg_",
32
+ "__SDonutContainer": "___SDonutContainer_1pnj2_gg_",
33
+ "__STrendLine": "___STrendLine_1pnj2_gg_",
34
+ "__STrendBar": "___STrendBar_1pnj2_gg_",
35
+ "@pulse": "pulse_1pnj2"
31
36
  })
32
37
  );
33
38
  var TrendLineRoot = /* @__PURE__ */ function(_Trend) {
34
- _inherits(TrendLineRoot2, _Trend);
35
- var _super = _createSuper(TrendLineRoot2);
36
39
  function TrendLineRoot2() {
37
40
  _classCallCheck(this, TrendLineRoot2);
38
- return _super.apply(this, arguments);
41
+ return _callSuper(this, TrendLineRoot2, arguments);
39
42
  }
40
- _createClass(TrendLineRoot2, [{
43
+ _inherits(TrendLineRoot2, _Trend);
44
+ return _createClass(TrendLineRoot2, [{
41
45
  key: "defaultData",
42
46
  get: function get() {
43
47
  return [15, 70, 20, 85, 20];
@@ -131,7 +135,6 @@ var TrendLineRoot = /* @__PURE__ */ function(_Trend) {
131
135
  }))))));
132
136
  }
133
137
  }]);
134
- return TrendLineRoot2;
135
138
  }(Trend);
136
139
  _defineProperty(TrendLineRoot, "enhance", [resolveColorEnhance(), uniqueIDEnhancement()]);
137
140
  _defineProperty(TrendLineRoot, "style", style);
@@ -1,29 +1,32 @@
1
1
  import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
2
2
  import _createClass from "@babel/runtime/helpers/esm/createClass";
3
- import _assertThisInitialized from "@babel/runtime/helpers/esm/assertThisInitialized";
3
+ import _possibleConstructorReturn from "@babel/runtime/helpers/esm/possibleConstructorReturn";
4
+ import _isNativeReflectConstruct from "@babel/runtime/helpers/esm/isNativeReflectConstruct";
5
+ import _getPrototypeOf from "@babel/runtime/helpers/esm/getPrototypeOf";
4
6
  import _inherits from "@babel/runtime/helpers/esm/inherits";
5
- import _createSuper from "@babel/runtime/helpers/esm/createSuper";
6
7
  import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
7
- import React from "react";
8
8
  import { Component } from "@semcore/core";
9
+ import React from "react";
10
+ function _callSuper(t, o, e) {
11
+ return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
12
+ }
9
13
  var Trend = /* @__PURE__ */ function(_Component) {
10
- _inherits(Trend2, _Component);
11
- var _super = _createSuper(Trend2);
12
14
  function Trend2() {
13
15
  var _this;
14
16
  for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
15
17
  args[_key] = arguments[_key];
16
18
  }
17
19
  _classCallCheck(this, Trend2);
18
- _this = _super.call.apply(_super, [this].concat(args));
19
- _defineProperty(_assertThisInitialized(_this), "state", {
20
+ _this = _callSuper(this, Trend2, [].concat(args));
21
+ _defineProperty(_this, "state", {
20
22
  width: 200,
21
23
  height: 100
22
24
  });
23
- _defineProperty(_assertThisInitialized(_this), "containerRef", /* @__PURE__ */ React.createRef());
25
+ _defineProperty(_this, "containerRef", /* @__PURE__ */ React.createRef());
24
26
  return _this;
25
27
  }
26
- _createClass(Trend2, [{
28
+ _inherits(Trend2, _Component);
29
+ return _createClass(Trend2, [{
27
30
  key: "componentDidMount",
28
31
  value: function componentDidMount() {
29
32
  this.setSizes();
@@ -71,7 +74,6 @@ var Trend = /* @__PURE__ */ function(_Component) {
71
74
  }
72
75
  }
73
76
  }]);
74
- return Trend2;
75
77
  }(Component);
76
78
  export {
77
79
  Trend
package/lib/esm/index.mjs CHANGED
@@ -1,7 +1,7 @@
1
- import { ScoreSemiDonut, ScoreDonut } from "./component/score/Donut.mjs";
1
+ import { ScoreDonut, ScoreSemiDonut } from "./component/score/Donut.mjs";
2
2
  import { ScoreLine } from "./component/score/Line.mjs";
3
- import { TrendLine, TrendArea } from "./component/trend/Line.mjs";
4
- import { TrendBar, TrendHistogram } from "./component/trend/Bar.mjs";
3
+ import { TrendHistogram, TrendBar } from "./component/trend/Bar.mjs";
4
+ import { TrendArea, TrendLine } from "./component/trend/Line.mjs";
5
5
  var miniCharts = {
6
6
  TrendLine,
7
7
  TrendArea,
@@ -0,0 +1,67 @@
1
+ import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
2
+ import _createClass from "@babel/runtime/helpers/esm/createClass";
3
+ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
4
+ var ScoreDonutUtils = /* @__PURE__ */ function() {
5
+ function ScoreDonutUtils2(value, isSemiDonut) {
6
+ _classCallCheck(this, ScoreDonutUtils2);
7
+ _defineProperty(this, "isSemiDonut", void 0);
8
+ _defineProperty(this, "value", void 0);
9
+ _defineProperty(this, "radius", void 0);
10
+ this.isSemiDonut = isSemiDonut;
11
+ this.radius = isSemiDonut ? 9 : 10;
12
+ this.value = value;
13
+ }
14
+ return _createClass(ScoreDonutUtils2, [{
15
+ key: "viewBox",
16
+ get: function get() {
17
+ return this.isSemiDonut ? "0 0 24 12" : "0 0 24 24";
18
+ }
19
+ }, {
20
+ key: "strokeWidth",
21
+ get: function get() {
22
+ return this.isSemiDonut ? 6 : 4;
23
+ }
24
+ }, {
25
+ key: "baseStrokeDashArray",
26
+ get: function get() {
27
+ return this.isSemiDonut ? Math.PI * this.radius : 2 * Math.PI * this.radius;
28
+ }
29
+ }, {
30
+ key: "valueStrokeDashArray",
31
+ get: function get() {
32
+ return this.baseStrokeDashArray * (this.value / 100);
33
+ }
34
+ }, {
35
+ key: "greyStrokeDashArray",
36
+ get: function get() {
37
+ return this.baseStrokeDashArray - this.valueStrokeDashArray;
38
+ }
39
+ }, {
40
+ key: "offsetPoint",
41
+ get: function get() {
42
+ return this.isSemiDonut ? this.baseStrokeDashArray / (100 / 3) : this.baseStrokeDashArray / 100;
43
+ }
44
+ }, {
45
+ key: "strokeDashArrayParts",
46
+ get: function get() {
47
+ var greyStroke = this.greyStrokeDashArray;
48
+ var offsetPoint = this.offsetPoint;
49
+ var greyStrokeDash = greyStroke - 2 * offsetPoint;
50
+ var strokeDashArrayBetweenSpaces = "".concat(greyStrokeDash, " ").concat(offsetPoint);
51
+ if (this.isSemiDonut) {
52
+ return "".concat(offsetPoint, " ").concat(this.value < 95 ? strokeDashArrayBetweenSpaces : "", " ").concat(this.baseStrokeDashArray);
53
+ }
54
+ return "".concat(offsetPoint, " ").concat(greyStrokeDash >= 0 ? strokeDashArrayBetweenSpaces : "", " ").concat(this.baseStrokeDashArray);
55
+ }
56
+ }, {
57
+ key: "strokeDashOffsetBase",
58
+ get: function get() {
59
+ var valueStroke = this.valueStrokeDashArray;
60
+ var offsetPoint = this.offsetPoint;
61
+ return -1 * (valueStroke + (this.isSemiDonut ? offsetPoint : 0));
62
+ }
63
+ }]);
64
+ }();
65
+ export {
66
+ ScoreDonutUtils
67
+ };
@@ -1,7 +1,7 @@
1
- import { ComponentType } from '@semcore/core';
2
- import { BoxProps } from '@semcore/flex-box';
1
+ import { type ComponentType } from '@semcore/core';
3
2
  import resolveColorEnhance from '@semcore/core/lib/utils/enhances/resolveColorEnhance';
4
- import { CommonScoreProps } from './Score';
3
+ import { type BoxProps } from '@semcore/flex-box';
4
+ import type { CommonScoreProps } from './Score';
5
5
  export type ScoreDonutProps = BoxProps & CommonScoreProps;
6
6
  type Enhances = {
7
7
  resolveColor: ReturnType<typeof resolveColorEnhance>;
@@ -1,2 +1,2 @@
1
- import { ScoreLineComponent } from './Line.types';
1
+ import type { ScoreLineComponent } from './Line.types';
2
2
  export declare const ScoreLine: ScoreLineComponent;
@@ -1,8 +1,8 @@
1
- import { Intergalactic, ComponentType } from '@semcore/core';
2
- import { CommonScoreProps } from './Score';
3
- import React from 'react';
4
- import { BoxProps, Box } from '@semcore/flex-box';
5
- import resolveColorEnhance from '@semcore/core/lib/utils/enhances/resolveColorEnhance';
1
+ import type { Intergalactic, ComponentType } from '@semcore/core';
2
+ import type resolveColorEnhance from '@semcore/core/lib/utils/enhances/resolveColorEnhance';
3
+ import type { BoxProps, Box } from '@semcore/flex-box';
4
+ import type React from 'react';
5
+ import type { CommonScoreProps } from './Score';
6
6
  type Enumerate<N extends number, Acc extends number[] = []> = Acc['length'] extends N ? Acc[number] : Enumerate<N, [...Acc, Acc['length']]>;
7
7
  type Range<F extends number, T extends number> = Exclude<Enumerate<T>, Enumerate<F>>;
8
8
  export type SegmentColor = `chart-palette-order-${Range<1, 24>}`;
@@ -1,6 +1,6 @@
1
- import { ComponentType } from '@semcore/core';
1
+ import { type ComponentType } from '@semcore/core';
2
2
  import resolveColorEnhance from '@semcore/core/lib/utils/enhances/resolveColorEnhance';
3
- import { CommonTrendProps } from './Trend';
3
+ import { type CommonTrendProps } from './Trend';
4
4
  type BarItem = {
5
5
  /**
6
6
  * Value
@@ -1,6 +1,6 @@
1
- import { ComponentType } from '@semcore/core';
1
+ import { type ComponentType } from '@semcore/core';
2
2
  import resolveColorEnhance from '@semcore/core/lib/utils/enhances/resolveColorEnhance';
3
- import { CommonTrendProps } from './Trend';
3
+ import { type CommonTrendProps } from './Trend';
4
4
  export type TrendLineProps = CommonTrendProps & {
5
5
  /**
6
6
  * List of values
@@ -1,6 +1,6 @@
1
- import React from 'react';
2
1
  import { Component } from '@semcore/core';
3
- import { BoxProps } from '@semcore/flex-box';
2
+ import type { BoxProps } from '@semcore/flex-box';
3
+ import React from 'react';
4
4
  export type CommonTrendProps = BoxProps & {
5
5
  /**
6
6
  * Flag to enable animate of charts
@@ -1,3 +1,3 @@
1
- import { TrendLine, TrendArea } from './Line';
2
1
  import { TrendBar, TrendHistogram } from './Bar';
2
+ import { TrendLine, TrendArea } from './Line';
3
3
  export { TrendLine, TrendArea, TrendBar, TrendHistogram };
@@ -0,0 +1,14 @@
1
+ export declare class ScoreDonutUtils {
2
+ private readonly isSemiDonut;
3
+ private readonly value;
4
+ readonly radius: number;
5
+ constructor(value: number, isSemiDonut: boolean);
6
+ get viewBox(): "0 0 24 12" | "0 0 24 24";
7
+ get strokeWidth(): 6 | 4;
8
+ get baseStrokeDashArray(): number;
9
+ get valueStrokeDashArray(): number;
10
+ get greyStrokeDashArray(): number;
11
+ get offsetPoint(): number;
12
+ get strokeDashArrayParts(): string;
13
+ get strokeDashOffsetBase(): number;
14
+ }