@semcore/mini-chart 16.0.2-prerelease.3 → 16.0.3-prerelease.0
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/CHANGELOG.md +7 -0
- package/lib/cjs/component/score/Donut.js +10 -10
- package/lib/cjs/component/score/Donut.js.map +1 -1
- package/lib/cjs/component/score/Line.js +21 -19
- package/lib/cjs/component/score/Line.js.map +1 -1
- package/lib/cjs/component/trend/Bar.js +7 -7
- package/lib/cjs/component/trend/Line.js +7 -7
- package/lib/cjs/utils/ScoreDonutUtils.js +7 -0
- package/lib/cjs/utils/ScoreDonutUtils.js.map +1 -1
- package/lib/es6/component/score/Donut.js +10 -10
- package/lib/es6/component/score/Donut.js.map +1 -1
- package/lib/es6/component/score/Line.js +21 -19
- package/lib/es6/component/score/Line.js.map +1 -1
- package/lib/es6/component/trend/Bar.js +7 -7
- package/lib/es6/component/trend/Line.js +7 -7
- package/lib/es6/utils/ScoreDonutUtils.js +7 -0
- package/lib/es6/utils/ScoreDonutUtils.js.map +1 -1
- package/lib/esm/component/score/Donut.mjs +11 -11
- package/lib/esm/component/score/Line.mjs +21 -20
- package/lib/esm/component/trend/Bar.mjs +8 -8
- package/lib/esm/component/trend/Line.mjs +8 -8
- package/lib/esm/utils/ScoreDonutUtils.mjs +7 -0
- package/lib/types/utils/ScoreDonutUtils.d.ts +1 -0
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
CHANGELOG.md standards are inspired by [keepachangelog.com](https://keepachangelog.com/en/1.0.0/).
|
|
4
4
|
|
|
5
|
+
## [16.0.3] - 2025-06-18
|
|
6
|
+
|
|
7
|
+
### Fixed
|
|
8
|
+
|
|
9
|
+
- Rendering issues in ScoreDonut and ScoreSemiDonut when value is 0.
|
|
10
|
+
- ScoreLine rendered segments with zero value, causing unnecessary visual elements.
|
|
11
|
+
|
|
5
12
|
## [16.0.2] - 2025-06-11
|
|
6
13
|
|
|
7
14
|
### Fixed
|
|
@@ -21,17 +21,17 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
21
21
|
var _ScoreDonutUtils = require("../../utils/ScoreDonutUtils");
|
|
22
22
|
function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2["default"])(o), (0, _possibleConstructorReturn2["default"])(t, (0, _isNativeReflectConstruct2["default"])() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2["default"])(t).constructor) : o.apply(t, e)); }
|
|
23
23
|
/*!__reshadow-styles__:"./donut.shadow.css"*/
|
|
24
|
-
var style = (/*__reshadow_css_start__*/_core.sstyled.insert(/*__inner_css_start__*/"@keyframes
|
|
24
|
+
var style = (/*__reshadow_css_start__*/_core.sstyled.insert(/*__inner_css_start__*/"@keyframes pulse_1jz5n{0%,to{opacity:1}50%{opacity:.4}}.___SDonutContainer_1jz5n_gg_.__loading_1jz5n_gg_,.___SLineGauge_1jz5n_gg_.__loading_1jz5n_gg_,.___STrendBar_1jz5n_gg_.__loading_1jz5n_gg_,.___STrendLine_1jz5n_gg_.__loading_1jz5n_gg_{animation-name:pulse_1jz5n;animation-iteration-count:infinite;animation-timing-function:ease-in-out;animation-duration:1.6s;will-change:opacity}.___SDonutContainer_1jz5n_gg_.__semi_1jz5n_gg_ g{transform:rotate(180deg) translate(-24px,-24px)}.___SDonutContainer_1jz5n_gg_ g{transform:rotate(-90deg) translate(-24px)}.___SDonutContainer_1jz5n_gg_.__animate_1jz5n_gg_ circle{transition:all var(--intergalactic-duration-extra-slow, 500) ease-in-out}", /*__inner_css_end__*/"1jz5n_gg_"),
|
|
25
25
|
/*__reshadow_css_end__*/
|
|
26
26
|
{
|
|
27
|
-
"__SLineGauge": "
|
|
28
|
-
"_loading": "
|
|
29
|
-
"__SDonutContainer": "
|
|
30
|
-
"__STrendLine": "
|
|
31
|
-
"__STrendBar": "
|
|
32
|
-
"@pulse": "
|
|
33
|
-
"_animate": "
|
|
34
|
-
"_semi": "
|
|
27
|
+
"__SLineGauge": "___SLineGauge_1jz5n_gg_",
|
|
28
|
+
"_loading": "__loading_1jz5n_gg_",
|
|
29
|
+
"__SDonutContainer": "___SDonutContainer_1jz5n_gg_",
|
|
30
|
+
"__STrendLine": "___STrendLine_1jz5n_gg_",
|
|
31
|
+
"__STrendBar": "___STrendBar_1jz5n_gg_",
|
|
32
|
+
"@pulse": "pulse_1jz5n",
|
|
33
|
+
"_animate": "__animate_1jz5n_gg_",
|
|
34
|
+
"_semi": "__semi_1jz5n_gg_"
|
|
35
35
|
});
|
|
36
36
|
var DonutRoot = /*#__PURE__*/function (_Component) {
|
|
37
37
|
function DonutRoot() {
|
|
@@ -87,7 +87,7 @@ var DonutRoot = /*#__PURE__*/function (_Component) {
|
|
|
87
87
|
}), /*#__PURE__*/_react["default"].createElement("animate", _ref2.cn("animate", {
|
|
88
88
|
"attributeName": 'stroke-dashoffset',
|
|
89
89
|
"values": "0;".concat(scoreDonut.valueStrokeDashArray)
|
|
90
|
-
}))),
|
|
90
|
+
}))), scoreDonut.hasDivider && !isSemiDonut && /*#__PURE__*/_react["default"].createElement("circle", _ref2.cn("circle", {
|
|
91
91
|
"cx": '12',
|
|
92
92
|
"cy": '12',
|
|
93
93
|
"r": scoreDonut.radius,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Donut.js","names":["_core","require","_ariaProps","_resolveColorEnhance","_interopRequireDefault","_flexBox","_react","_ScoreDonutUtils","_callSuper","t","o","e","_getPrototypeOf2","_possibleConstructorReturn2","_isNativeReflectConstruct2","Reflect","construct","constructor","apply","style","sstyled","insert","DonutRoot","_Component","_classCallCheck2","arguments","_inherits2","_createClass2","key","value","render","_ref","asProps","_ref2","SDonutContainer","Box","_this$asProps","styles","_this$asProps$baseBgC","baseBgColor","_this$asProps$color","color","resolveColor","isSemiDonut","loading","scoreDonut","ScoreDonutUtils","_extractAriaProps","extractAriaProps","__excludeProps","extractedAriaProps","createElement","cn","_objectSpread2","assignProps","viewBox","radius","strokeWidth","undefined","concat","greyStrokeDashArray","baseStrokeDashArray","strokeDashOffsetBase","Fragment","valueStrokeDashArray","strokeDashArrayParts","Component","_defineProperty2","resolveColorEnhance","animate","ScoreDonut","exports","createComponent","displayName","ScoreSemiDonut","enhancements","wrapperProps","props"],"sources":["../../../../src/component/score/Donut.tsx"],"sourcesContent":["import { createComponent, Component, Root, sstyled, type ComponentType } from '@semcore/core';\nimport { assignProps } from '@semcore/core';\nimport { extractAriaProps } from '@semcore/core/lib/utils/ariaProps';\nimport resolveColorEnhance from '@semcore/core/lib/utils/enhances/resolveColorEnhance';\nimport { Box, type BoxProps } from '@semcore/flex-box';\nimport React from 'react';\n\nimport style from './donut.shadow.css';\nimport type { CommonScoreProps } from './Score';\nimport { ScoreDonutUtils } from '../../utils/ScoreDonutUtils';\n\nexport type ScoreDonutProps = BoxProps & CommonScoreProps;\n\ntype Enhances = {\n resolveColor: ReturnType<typeof resolveColorEnhance>;\n isSemiDonut?: true;\n};\n\nclass DonutRoot extends Component<ScoreDonutProps, {}, {}, typeof DonutRoot.enhance> {\n static enhance = [resolveColorEnhance()] as const;\n\n static style = style;\n\n static defaultProps = {\n animate: true,\n };\n\n render() {\n const SDonutContainer = Root;\n const {\n value,\n styles,\n baseBgColor = 'chart-grid-bar-chart-base-bg',\n color = 'chart-palette-order-1',\n resolveColor,\n isSemiDonut,\n loading,\n } = this.asProps;\n\n const scoreDonut = new ScoreDonutUtils(value, isSemiDonut);\n const { __excludeProps, extractedAriaProps } = extractAriaProps(this.asProps);\n\n return sstyled(styles)(\n <SDonutContainer render={Box} semi={isSemiDonut} __excludeProps={__excludeProps}>\n <svg\n width='100%'\n height='100%'\n viewBox={scoreDonut.viewBox}\n fill='none'\n role='img'\n {...extractedAriaProps}\n >\n <g>\n <circle\n cx='12'\n cy='12'\n r={scoreDonut.radius}\n strokeWidth={scoreDonut.strokeWidth}\n stroke={resolveColor(baseBgColor)}\n strokeDasharray={\n loading ? undefined : `${scoreDonut.greyStrokeDashArray} ${scoreDonut.baseStrokeDashArray}`\n }\n strokeDashoffset={scoreDonut.strokeDashOffsetBase}\n />\n {!loading && (\n <>\n <circle\n cx='12'\n cy='12'\n r={scoreDonut.radius}\n strokeWidth={scoreDonut.strokeWidth}\n stroke={resolveColor(color)}\n strokeDasharray={`${scoreDonut.valueStrokeDashArray} ${scoreDonut.baseStrokeDashArray}`}\n strokeDashoffset={scoreDonut.valueStrokeDashArray}\n >\n <animate\n attributeName='stroke-dashoffset'\n values={`0;${scoreDonut.valueStrokeDashArray}`}\n />\n </circle>\n {
|
|
1
|
+
{"version":3,"file":"Donut.js","names":["_core","require","_ariaProps","_resolveColorEnhance","_interopRequireDefault","_flexBox","_react","_ScoreDonutUtils","_callSuper","t","o","e","_getPrototypeOf2","_possibleConstructorReturn2","_isNativeReflectConstruct2","Reflect","construct","constructor","apply","style","sstyled","insert","DonutRoot","_Component","_classCallCheck2","arguments","_inherits2","_createClass2","key","value","render","_ref","asProps","_ref2","SDonutContainer","Box","_this$asProps","styles","_this$asProps$baseBgC","baseBgColor","_this$asProps$color","color","resolveColor","isSemiDonut","loading","scoreDonut","ScoreDonutUtils","_extractAriaProps","extractAriaProps","__excludeProps","extractedAriaProps","createElement","cn","_objectSpread2","assignProps","viewBox","radius","strokeWidth","undefined","concat","greyStrokeDashArray","baseStrokeDashArray","strokeDashOffsetBase","Fragment","valueStrokeDashArray","hasDivider","strokeDashArrayParts","Component","_defineProperty2","resolveColorEnhance","animate","ScoreDonut","exports","createComponent","displayName","ScoreSemiDonut","enhancements","wrapperProps","props"],"sources":["../../../../src/component/score/Donut.tsx"],"sourcesContent":["import { createComponent, Component, Root, sstyled, type ComponentType } from '@semcore/core';\nimport { assignProps } from '@semcore/core';\nimport { extractAriaProps } from '@semcore/core/lib/utils/ariaProps';\nimport resolveColorEnhance from '@semcore/core/lib/utils/enhances/resolveColorEnhance';\nimport { Box, type BoxProps } from '@semcore/flex-box';\nimport React from 'react';\n\nimport style from './donut.shadow.css';\nimport type { CommonScoreProps } from './Score';\nimport { ScoreDonutUtils } from '../../utils/ScoreDonutUtils';\n\nexport type ScoreDonutProps = BoxProps & CommonScoreProps;\n\ntype Enhances = {\n resolveColor: ReturnType<typeof resolveColorEnhance>;\n isSemiDonut?: true;\n};\n\nclass DonutRoot extends Component<ScoreDonutProps, {}, {}, typeof DonutRoot.enhance> {\n static enhance = [resolveColorEnhance()] as const;\n\n static style = style;\n\n static defaultProps = {\n animate: true,\n };\n\n render() {\n const SDonutContainer = Root;\n const {\n value,\n styles,\n baseBgColor = 'chart-grid-bar-chart-base-bg',\n color = 'chart-palette-order-1',\n resolveColor,\n isSemiDonut,\n loading,\n } = this.asProps;\n\n const scoreDonut = new ScoreDonutUtils(value, isSemiDonut);\n const { __excludeProps, extractedAriaProps } = extractAriaProps(this.asProps);\n\n return sstyled(styles)(\n <SDonutContainer render={Box} semi={isSemiDonut} __excludeProps={__excludeProps}>\n <svg\n width='100%'\n height='100%'\n viewBox={scoreDonut.viewBox}\n fill='none'\n role='img'\n {...extractedAriaProps}\n >\n <g>\n <circle\n cx='12'\n cy='12'\n r={scoreDonut.radius}\n strokeWidth={scoreDonut.strokeWidth}\n stroke={resolveColor(baseBgColor)}\n strokeDasharray={\n loading ? undefined : `${scoreDonut.greyStrokeDashArray} ${scoreDonut.baseStrokeDashArray}`\n }\n strokeDashoffset={scoreDonut.strokeDashOffsetBase}\n />\n {!loading && (\n <>\n <circle\n cx='12'\n cy='12'\n r={scoreDonut.radius}\n strokeWidth={scoreDonut.strokeWidth}\n stroke={resolveColor(color)}\n strokeDasharray={`${scoreDonut.valueStrokeDashArray} ${scoreDonut.baseStrokeDashArray}`}\n strokeDashoffset={scoreDonut.valueStrokeDashArray}\n >\n <animate\n attributeName='stroke-dashoffset'\n values={`0;${scoreDonut.valueStrokeDashArray}`}\n />\n </circle>\n {scoreDonut.hasDivider && !isSemiDonut && (\n <circle\n cx='12'\n cy='12'\n r={scoreDonut.radius}\n strokeWidth={scoreDonut.strokeWidth}\n stroke={resolveColor('chart-grid-border')}\n strokeDasharray={scoreDonut.strokeDashArrayParts}\n strokeDashoffset={-1 * scoreDonut.valueStrokeDashArray}\n />\n )}\n </>\n )}\n </g>\n </svg>\n </SDonutContainer>,\n );\n }\n}\n\nexport const ScoreDonut: ComponentType<ScoreDonutProps, {}, {}, Enhances> =\n createComponent(DonutRoot);\n\nScoreDonut.displayName = 'MiniChart.ScoreDonut';\n\nexport const ScoreSemiDonut: ComponentType<ScoreDonutProps, {}, {}, Enhances> = createComponent(\n DonutRoot,\n {},\n {\n enhancements: [\n () => {\n return {\n wrapperProps: (props: ScoreDonutProps) => {\n return assignProps(props, { isSemiDonut: true });\n },\n };\n },\n ],\n },\n);\n\nScoreSemiDonut.displayName = 'MiniChart.ScoreSemiDonut';\n"],"mappings":";;;;;;;;;;;;;;;AAAA,IAAAA,KAAA,GAAAC,OAAA;AAEA,IAAAC,UAAA,GAAAD,OAAA;AACA,IAAAE,oBAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AACA,IAAAK,MAAA,GAAAF,sBAAA,CAAAH,OAAA;AAIA,IAAAM,gBAAA,GAAAN,OAAA;AAA8D,SAAAO,WAAAC,CAAA,EAAAC,CAAA,EAAAC,CAAA,WAAAD,CAAA,OAAAE,gBAAA,aAAAF,CAAA,OAAAG,2BAAA,aAAAJ,CAAA,MAAAK,0BAAA,iBAAAC,OAAA,CAAAC,SAAA,CAAAN,CAAA,EAAAC,CAAA,YAAAC,gBAAA,aAAAH,CAAA,EAAAQ,WAAA,IAAAP,CAAA,CAAAQ,KAAA,CAAAT,CAAA,EAAAE,CAAA;AAAA;AAAA,IAAAQ,KAAA,8BAAAnB,KAAA,CAAAoB,OAAA,CAAAC,MAAA;AAAA;AAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;AAAA;AAAA,IASxDC,SAAS,0BAAAC,UAAA;EAAA,SAAAD,UAAA;IAAA,IAA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A,MACK,IAAI;QAAA,MACJ,IAAI;QAAA,KACJP,UAAU,CAACW,MAAM;QAAA,eACPX,UAAU,CAACY,WAAW;QAAA,UAC3Bf,YAAY,CAAC,mBAAmB,CAAC;QAAA,mBACxBG,UAAU,CAACqB,oBAAoB;QAAA,oBAC9B,CAAC,CAAC,GAAGrB,UAAU,CAACmB;MAAoB,EACvD,CAEH,CAEH,CACA,CACU,CAAC;IAEtB;EAAC;AAAA,EA/EqBG,eAAS;AAAA,IAAAC,gBAAA,aAA3B9C,SAAS,aACI,CAAC,IAAA+C,+BAAmB,EAAC,CAAC,CAAC;AAAA,IAAAD,gBAAA,aADpC9C,SAAS,WAGEH,KAAK;AAAA,IAAAiD,gBAAA,aAHhB9C,SAAS,kBAKS;EACpBgD,OAAO,EAAE;AACX,CAAC;AA2EI,IAAMC,UAA4D,GAAAC,OAAA,CAAAD,UAAA,GACvE,IAAAE,qBAAe,EAACnD,SAAS,CAAC;AAE5BiD,UAAU,CAACG,WAAW,GAAG,sBAAsB;AAExC,IAAMC,cAAgE,GAAAH,OAAA,CAAAG,cAAA,GAAG,IAAAF,qBAAe,EAC7FnD,SAAS,EACT,CAAC,CAAC,EACF;EACEsD,YAAY,EAAE,CACZ,YAAM;IACJ,OAAO;MACLC,YAAY,EAAE,SAAdA,YAAYA,CAAGC,KAAsB,EAAK;QACxC,OAAO,IAAAxB,iBAAW,EAACwB,KAAK,EAAE;UAAEnC,WAAW,EAAE;QAAK,CAAC,CAAC;MAClD;IACF,CAAC;EACH,CAAC;AAEL,CACF,CAAC;AAEDgC,cAAc,CAACD,WAAW,GAAG,0BAA0B","ignoreList":[]}
|
|
@@ -19,26 +19,26 @@ var _flexBox = require("@semcore/flex-box");
|
|
|
19
19
|
var _react = _interopRequireDefault(require("react"));
|
|
20
20
|
function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2["default"])(o), (0, _possibleConstructorReturn2["default"])(t, (0, _isNativeReflectConstruct2["default"])() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2["default"])(t).constructor) : o.apply(t, e)); }
|
|
21
21
|
/*!__reshadow-styles__:"./line.shadow.css"*/
|
|
22
|
-
var style = (/*__reshadow_css_start__*/_core.sstyled.insert(/*__inner_css_start__*/"@keyframes
|
|
22
|
+
var style = (/*__reshadow_css_start__*/_core.sstyled.insert(/*__inner_css_start__*/"@keyframes pulse_1pqun{0%,to{opacity:1}50%{opacity:.4}}@keyframes move-line_1pqun{0%{transform:translateX(0)}to{transform:translateX(100%)}}.___SDonutContainer_1pqun_gg_.__loading_1pqun_gg_,.___SLineGauge_1pqun_gg_.__loading_1pqun_gg_,.___STrendBar_1pqun_gg_.__loading_1pqun_gg_,.___STrendLine_1pqun_gg_.__loading_1pqun_gg_{animation-name:pulse_1pqun;animation-iteration-count:infinite;animation-timing-function:ease-in-out;animation-duration:1.6s;will-change:opacity}.___SLineGauge_1pqun_gg_{height:8px;background-color:var(--base-bg-color_1pqun, var(--intergalactic-chart-grid-bar-chart-base-bg, #e0e1e9));border-radius:var(--intergalactic-chart-rounded, 2px);overflow:hidden;position:relative}.___SLineValue_1pqun_gg_{height:8px;border-radius:var(--intergalactic-chart-rounded, 2px)0 0 var(--intergalactic-chart-rounded, 2px)}.___SLineValue_1pqun_gg_.__percent_1pqun_gg_{width:var(--percent_1pqun)}.___SLineSegmentItem_1pqun_gg_.__color_1pqun_gg_,.___SLineValue_1pqun_gg_.__color_1pqun_gg_{background-color:var(--color_1pqun, var(--intergalactic-chart-palette-order-1, #2bb3ff))}.___SLineGauge_1pqun_gg_.__segments_1pqun_gg_{border-radius:var(--intergalactic-progress-bar-rounded, 6px)}.___SAnimationLine_1pqun_gg_,.___SLineGaugeSegment_1pqun_gg_{position:absolute;top:0;left:0;right:0;bottom:0}.___SLineSegmentItem_1pqun_gg_:last-child{margin-right:0;border-right:none}.___SLineSegmentItem_1pqun_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_1pqun_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_1pqun;animation-duration:.5s;animation-timing-function:ease-in-out;animation-fill-mode:forwards}", /*__inner_css_end__*/"1pqun_gg_"),
|
|
23
23
|
/*__reshadow_css_end__*/
|
|
24
24
|
{
|
|
25
|
-
"__SLineGauge": "
|
|
26
|
-
"_loading": "
|
|
27
|
-
"__SDonutContainer": "
|
|
28
|
-
"__STrendLine": "
|
|
29
|
-
"__STrendBar": "
|
|
30
|
-
"@pulse": "
|
|
31
|
-
"--base-bg-color": "--base-bg-
|
|
32
|
-
"__SLineValue": "
|
|
33
|
-
"_percent": "
|
|
34
|
-
"--percent": "--
|
|
35
|
-
"_color": "
|
|
36
|
-
"__SLineSegmentItem": "
|
|
37
|
-
"--color": "--
|
|
38
|
-
"_segments": "
|
|
39
|
-
"__SLineGaugeSegment": "
|
|
40
|
-
"__SAnimationLine": "
|
|
41
|
-
"@move-line": "move-
|
|
25
|
+
"__SLineGauge": "___SLineGauge_1pqun_gg_",
|
|
26
|
+
"_loading": "__loading_1pqun_gg_",
|
|
27
|
+
"__SDonutContainer": "___SDonutContainer_1pqun_gg_",
|
|
28
|
+
"__STrendLine": "___STrendLine_1pqun_gg_",
|
|
29
|
+
"__STrendBar": "___STrendBar_1pqun_gg_",
|
|
30
|
+
"@pulse": "pulse_1pqun",
|
|
31
|
+
"--base-bg-color": "--base-bg-color_1pqun",
|
|
32
|
+
"__SLineValue": "___SLineValue_1pqun_gg_",
|
|
33
|
+
"_percent": "__percent_1pqun_gg_",
|
|
34
|
+
"--percent": "--percent_1pqun",
|
|
35
|
+
"_color": "__color_1pqun_gg_",
|
|
36
|
+
"__SLineSegmentItem": "___SLineSegmentItem_1pqun_gg_",
|
|
37
|
+
"--color": "--color_1pqun",
|
|
38
|
+
"_segments": "__segments_1pqun_gg_",
|
|
39
|
+
"__SLineGaugeSegment": "___SLineGaugeSegment_1pqun_gg_",
|
|
40
|
+
"__SAnimationLine": "___SAnimationLine_1pqun_gg_",
|
|
41
|
+
"@move-line": "move-line_1pqun"
|
|
42
42
|
});
|
|
43
43
|
var LineRoot = /*#__PURE__*/function (_Component) {
|
|
44
44
|
function LineRoot() {
|
|
@@ -127,8 +127,10 @@ var LineRoot = /*#__PURE__*/function (_Component) {
|
|
|
127
127
|
function Segment(props) {
|
|
128
128
|
var _ref2 = arguments[0],
|
|
129
129
|
_ref6;
|
|
130
|
-
var styles = props.styles
|
|
130
|
+
var styles = props.styles,
|
|
131
|
+
value = props.value;
|
|
131
132
|
var SLineSegmentItem = _flexBox.Box;
|
|
133
|
+
if (!value) return null;
|
|
132
134
|
return _ref6 = (0, _core.sstyled)(styles), /*#__PURE__*/_react["default"].createElement(SLineSegmentItem, _ref6.cn("SLineSegmentItem", (0, _objectSpread2["default"])({}, (0, _core.assignProps)({}, _ref2))));
|
|
133
135
|
}
|
|
134
136
|
Segment.displayName = 'Segment';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Line.js","names":["_core","require","_resolveColorEnhance","_interopRequireDefault","_flexBox","_react","_callSuper","t","o","e","_getPrototypeOf2","_possibleConstructorReturn2","_isNativeReflectConstruct2","Reflect","construct","constructor","apply","style","sstyled","insert","LineRoot","_Component","_classCallCheck2","arguments","_inherits2","_createClass2","key","value","getSegmentProps","segmentProps","_this$asProps","asProps","children","resolveColor","sum","React","Children","forEach","child","isValidElement","props","width","concat","color","render","_ref","_ref5","SLineGauge","Box","SLineValue","SAnimationLine","SLineGaugeSegment","Flex","SLineSegmentItem","_this$asProps2","styles","_this$asProps2$color","baseBgColor","loading","animate","undefined","_ref3","createElement","cn","_objectSpread2","assignProps","segments","SegmentItems","i","_ref4","push","percent","Boolean","length","Component","_defineProperty2","resolveColorEnhance","Segment","_ref2","arguments[0]","_ref6","displayName","ScoreLine","exports","createComponent"],"sources":["../../../../src/component/score/Line.tsx"],"sourcesContent":["import { createComponent, Component, Root, sstyled } from '@semcore/core';\nimport resolveColorEnhance from '@semcore/core/lib/utils/enhances/resolveColorEnhance';\nimport { Box, Flex } from '@semcore/flex-box';\nimport React from 'react';\n\nimport style from './line.shadow.css';\nimport type {\n ScoreLineComponent,\n ScoreLineGaugeProps,\n SegmentProps,\n InnerSegmentProps,\n} from './Line.types';\n\nclass LineRoot extends Component<ScoreLineGaugeProps, {}, {}, typeof LineRoot.enhance> {\n static enhance = [resolveColorEnhance()] as const;\n static displayName = 'ScoreLine';\n\n static style = style;\n\n static defaultProps = {\n animate: true,\n };\n\n getSegmentProps(segmentProps: SegmentProps) {\n const { children, resolveColor } = this.asProps;\n\n let sum = 0;\n React.Children.forEach(children, (child) => {\n if (React.isValidElement<SegmentProps>(child)) {\n sum = sum + child.props.value;\n }\n });\n\n const width = sum > 0 ? (100 * segmentProps.value) / sum : 0;\n\n return {\n 'w': `${width}%`,\n 'use:color': resolveColor(segmentProps.color),\n };\n }\n\n render() {\n const SLineGauge = Root;\n const SLineValue = Box;\n const SAnimationLine = Box;\n const SLineGaugeSegment = Flex;\n const SLineSegmentItem = Box;\n const {\n value,\n styles,\n color = 'chart-palette-order-1',\n baseBgColor,\n resolveColor,\n loading,\n children,\n Children,\n animate,\n } = this.asProps;\n\n if (children !== undefined) {\n return sstyled(styles)(\n <SLineGauge render={Box} segments base-bg-color={resolveColor(baseBgColor)}>\n <SLineGaugeSegment>\n <Children />\n </SLineGaugeSegment>\n {animate && <SAnimationLine />}\n </SLineGauge>,\n );\n }\n\n const { segments } = this.asProps;\n\n const SegmentItems = [];\n\n if (segments) {\n for (let i = 0; i < segments; i++) {\n const width = `calc((100% - ${segments - 1}px) / ${segments})`;\n\n SegmentItems.push(\n sstyled(styles)(\n <SLineSegmentItem\n key={i}\n color={i < value ? resolveColor(color) : undefined}\n w={width}\n />,\n ),\n );\n }\n }\n\n let percent = `${value}%`;\n\n if (segments) {\n percent = `${(value / segments) * 100}%`;\n }\n\n return sstyled(styles)(\n <SLineGauge render={Box} base-bg-color={resolveColor(baseBgColor)}>\n {!loading && <SLineValue w={percent} color={resolveColor(color)} />}\n {Boolean(SegmentItems.length) && <SLineGaugeSegment>{SegmentItems}</SLineGaugeSegment>}\n {animate && <SAnimationLine />}\n </SLineGauge>,\n );\n }\n}\n\nfunction Segment(props: InnerSegmentProps) {\n const { styles } = props;\n const SLineSegmentItem = Root;\n\n return sstyled(styles)(<SLineSegmentItem render={Box} />);\n}\nSegment.displayName = 'Segment';\n\nexport const ScoreLine: ScoreLineComponent = createComponent(LineRoot, {\n Segment,\n});\n\nScoreLine.displayName = 'MiniChart.ScoreLine';\n"],"mappings":";;;;;;;;;;;;;;;AAAA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,oBAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,MAAA,GAAAF,sBAAA,CAAAF,OAAA;AAA0B,SAAAK,WAAAC,CAAA,EAAAC,CAAA,EAAAC,CAAA,WAAAD,CAAA,OAAAE,gBAAA,aAAAF,CAAA,OAAAG,2BAAA,aAAAJ,CAAA,MAAAK,0BAAA,iBAAAC,OAAA,CAAAC,SAAA,CAAAN,CAAA,EAAAC,CAAA,YAAAC,gBAAA,aAAAH,CAAA,EAAAQ,WAAA,IAAAP,CAAA,CAAAQ,KAAA,CAAAT,CAAA,EAAAE,CAAA;AAAA;AAAA,IAAAQ,KAAA,8BAAAjB,KAAA,CAAAkB,OAAA,CAAAC,MAAA;AAAA;AAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;AAAA;AAAA,IAUpBC,QAAQ,0BAAAC,UAAA;EAAA,SAAAD,SAAA;IAAA,IAAAE,gBAAA,mBAAAF,QAAA;IAAA,OAAAd,UAAA,OAAAc,QAAA,EAAAG,SAAA;EAAA;EAAA,IAAAC,UAAA,aAA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K;AAAA,IAAA0D,gBAAA,aAJhBvD,QAAQ,kBAMU;EACpBuC,OAAO,EAAE;AACX,CAAC;AAqFH,SAASkB,OAAOA,CAACrC,KAAwB,EAAE;EAAA,IAAAsC,KAAA,GAAAC,YAAA;IAAAC,KAAA;EACzC,IAAQzB,MAAM,
|
|
1
|
+
{"version":3,"file":"Line.js","names":["_core","require","_resolveColorEnhance","_interopRequireDefault","_flexBox","_react","_callSuper","t","o","e","_getPrototypeOf2","_possibleConstructorReturn2","_isNativeReflectConstruct2","Reflect","construct","constructor","apply","style","sstyled","insert","LineRoot","_Component","_classCallCheck2","arguments","_inherits2","_createClass2","key","value","getSegmentProps","segmentProps","_this$asProps","asProps","children","resolveColor","sum","React","Children","forEach","child","isValidElement","props","width","concat","color","render","_ref","_ref5","SLineGauge","Box","SLineValue","SAnimationLine","SLineGaugeSegment","Flex","SLineSegmentItem","_this$asProps2","styles","_this$asProps2$color","baseBgColor","loading","animate","undefined","_ref3","createElement","cn","_objectSpread2","assignProps","segments","SegmentItems","i","_ref4","push","percent","Boolean","length","Component","_defineProperty2","resolveColorEnhance","Segment","_ref2","arguments[0]","_ref6","displayName","ScoreLine","exports","createComponent"],"sources":["../../../../src/component/score/Line.tsx"],"sourcesContent":["import { createComponent, Component, Root, sstyled } from '@semcore/core';\nimport resolveColorEnhance from '@semcore/core/lib/utils/enhances/resolveColorEnhance';\nimport { Box, Flex } from '@semcore/flex-box';\nimport React from 'react';\n\nimport style from './line.shadow.css';\nimport type {\n ScoreLineComponent,\n ScoreLineGaugeProps,\n SegmentProps,\n InnerSegmentProps,\n} from './Line.types';\n\nclass LineRoot extends Component<ScoreLineGaugeProps, {}, {}, typeof LineRoot.enhance> {\n static enhance = [resolveColorEnhance()] as const;\n static displayName = 'ScoreLine';\n\n static style = style;\n\n static defaultProps = {\n animate: true,\n };\n\n getSegmentProps(segmentProps: SegmentProps) {\n const { children, resolveColor } = this.asProps;\n\n let sum = 0;\n React.Children.forEach(children, (child) => {\n if (React.isValidElement<SegmentProps>(child)) {\n sum = sum + child.props.value;\n }\n });\n\n const width = sum > 0 ? (100 * segmentProps.value) / sum : 0;\n\n return {\n 'w': `${width}%`,\n 'use:color': resolveColor(segmentProps.color),\n };\n }\n\n render() {\n const SLineGauge = Root;\n const SLineValue = Box;\n const SAnimationLine = Box;\n const SLineGaugeSegment = Flex;\n const SLineSegmentItem = Box;\n const {\n value,\n styles,\n color = 'chart-palette-order-1',\n baseBgColor,\n resolveColor,\n loading,\n children,\n Children,\n animate,\n } = this.asProps;\n\n if (children !== undefined) {\n return sstyled(styles)(\n <SLineGauge render={Box} segments base-bg-color={resolveColor(baseBgColor)}>\n <SLineGaugeSegment>\n <Children />\n </SLineGaugeSegment>\n {animate && <SAnimationLine />}\n </SLineGauge>,\n );\n }\n\n const { segments } = this.asProps;\n\n const SegmentItems = [];\n\n if (segments) {\n for (let i = 0; i < segments; i++) {\n const width = `calc((100% - ${segments - 1}px) / ${segments})`;\n\n SegmentItems.push(\n sstyled(styles)(\n <SLineSegmentItem\n key={i}\n color={i < value ? resolveColor(color) : undefined}\n w={width}\n />,\n ),\n );\n }\n }\n\n let percent = `${value}%`;\n\n if (segments) {\n percent = `${(value / segments) * 100}%`;\n }\n\n return sstyled(styles)(\n <SLineGauge render={Box} base-bg-color={resolveColor(baseBgColor)}>\n {!loading && <SLineValue w={percent} color={resolveColor(color)} />}\n {Boolean(SegmentItems.length) && <SLineGaugeSegment>{SegmentItems}</SLineGaugeSegment>}\n {animate && <SAnimationLine />}\n </SLineGauge>,\n );\n }\n}\n\nfunction Segment(props: InnerSegmentProps) {\n const { styles, value } = props;\n const SLineSegmentItem = Root;\n\n if (!value) return null;\n\n return sstyled(styles)(<SLineSegmentItem render={Box} />);\n}\nSegment.displayName = 'Segment';\n\nexport const ScoreLine: ScoreLineComponent = createComponent(LineRoot, {\n Segment,\n});\n\nScoreLine.displayName = 'MiniChart.ScoreLine';\n"],"mappings":";;;;;;;;;;;;;;;AAAA,IAAAA,KAA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B,KAAA,CAAAjB,EAAA,yBAAAC,cAAA,qBAAAhE,KAAA,CAAAiE,WAAA,MAAAa,KAAA,GAAe,CAAC;AAC1D;AACAD,OAAO,CAACI,WAAW,GAAG,SAAS;AAExB,IAAMC,SAA6B,GAAAC,OAAA,CAAAD,SAAA,GAAG,IAAAE,qBAAe,EAAChE,QAAQ,EAAE;EACrEyD,OAAO,EAAPA;AACF,CAAC,CAAC;AAEFK,SAAS,CAACD,WAAW,GAAG,qBAAqB","ignoreList":[]}
|
|
@@ -22,15 +22,15 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
22
22
|
var _Trend2 = require("./Trend");
|
|
23
23
|
function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2["default"])(o), (0, _possibleConstructorReturn2["default"])(t, (0, _isNativeReflectConstruct2["default"])() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2["default"])(t).constructor) : o.apply(t, e)); }
|
|
24
24
|
/*!__reshadow-styles__:"../skeleton/skeleton.shadow.css"*/
|
|
25
|
-
var style = (/*__reshadow_css_start__*/_core.sstyled.insert(/*__inner_css_start__*/"@keyframes
|
|
25
|
+
var style = (/*__reshadow_css_start__*/_core.sstyled.insert(/*__inner_css_start__*/"@keyframes pulse_ix66r{0%,to{opacity:1}50%{opacity:.4}}.___SDonutContainer_ix66r_gg_.__loading_ix66r_gg_,.___SLineGauge_ix66r_gg_.__loading_ix66r_gg_,.___STrendBar_ix66r_gg_.__loading_ix66r_gg_,.___STrendLine_ix66r_gg_.__loading_ix66r_gg_{animation-name:pulse_ix66r;animation-iteration-count:infinite;animation-timing-function:ease-in-out;animation-duration:1.6s;will-change:opacity}", /*__inner_css_end__*/"ix66r_gg_"),
|
|
26
26
|
/*__reshadow_css_end__*/
|
|
27
27
|
{
|
|
28
|
-
"__SLineGauge": "
|
|
29
|
-
"_loading": "
|
|
30
|
-
"__SDonutContainer": "
|
|
31
|
-
"__STrendLine": "
|
|
32
|
-
"__STrendBar": "
|
|
33
|
-
"@pulse": "
|
|
28
|
+
"__SLineGauge": "___SLineGauge_ix66r_gg_",
|
|
29
|
+
"_loading": "__loading_ix66r_gg_",
|
|
30
|
+
"__SDonutContainer": "___SDonutContainer_ix66r_gg_",
|
|
31
|
+
"__STrendLine": "___STrendLine_ix66r_gg_",
|
|
32
|
+
"__STrendBar": "___STrendBar_ix66r_gg_",
|
|
33
|
+
"@pulse": "pulse_ix66r"
|
|
34
34
|
});
|
|
35
35
|
var TrendBarRoot = /*#__PURE__*/function (_Trend) {
|
|
36
36
|
function TrendBarRoot() {
|
|
@@ -23,15 +23,15 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
23
23
|
var _Trend2 = require("./Trend");
|
|
24
24
|
function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2["default"])(o), (0, _possibleConstructorReturn2["default"])(t, (0, _isNativeReflectConstruct2["default"])() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2["default"])(t).constructor) : o.apply(t, e)); }
|
|
25
25
|
/*!__reshadow-styles__:"../skeleton/skeleton.shadow.css"*/
|
|
26
|
-
var style = (/*__reshadow_css_start__*/_core.sstyled.insert(/*__inner_css_start__*/"@keyframes
|
|
26
|
+
var style = (/*__reshadow_css_start__*/_core.sstyled.insert(/*__inner_css_start__*/"@keyframes pulse_ix66r{0%,to{opacity:1}50%{opacity:.4}}.___SDonutContainer_ix66r_gg_.__loading_ix66r_gg_,.___SLineGauge_ix66r_gg_.__loading_ix66r_gg_,.___STrendBar_ix66r_gg_.__loading_ix66r_gg_,.___STrendLine_ix66r_gg_.__loading_ix66r_gg_{animation-name:pulse_ix66r;animation-iteration-count:infinite;animation-timing-function:ease-in-out;animation-duration:1.6s;will-change:opacity}", /*__inner_css_end__*/"ix66r_gg_"),
|
|
27
27
|
/*__reshadow_css_end__*/
|
|
28
28
|
{
|
|
29
|
-
"__SLineGauge": "
|
|
30
|
-
"_loading": "
|
|
31
|
-
"__SDonutContainer": "
|
|
32
|
-
"__STrendLine": "
|
|
33
|
-
"__STrendBar": "
|
|
34
|
-
"@pulse": "
|
|
29
|
+
"__SLineGauge": "___SLineGauge_ix66r_gg_",
|
|
30
|
+
"_loading": "__loading_ix66r_gg_",
|
|
31
|
+
"__SDonutContainer": "___SDonutContainer_ix66r_gg_",
|
|
32
|
+
"__STrendLine": "___STrendLine_ix66r_gg_",
|
|
33
|
+
"__STrendBar": "___STrendBar_ix66r_gg_",
|
|
34
|
+
"@pulse": "pulse_ix66r"
|
|
35
35
|
});
|
|
36
36
|
var TrendLineRoot = /*#__PURE__*/function (_Trend) {
|
|
37
37
|
function TrendLineRoot() {
|
|
@@ -19,6 +19,11 @@ var ScoreDonutUtils = exports.ScoreDonutUtils = /*#__PURE__*/function () {
|
|
|
19
19
|
this.value = value;
|
|
20
20
|
}
|
|
21
21
|
return (0, _createClass2["default"])(ScoreDonutUtils, [{
|
|
22
|
+
key: "hasDivider",
|
|
23
|
+
get: function get() {
|
|
24
|
+
return ![0, 100].includes(this.value);
|
|
25
|
+
}
|
|
26
|
+
}, {
|
|
22
27
|
key: "viewBox",
|
|
23
28
|
get: function get() {
|
|
24
29
|
return this.isSemiDonut ? '0 0 24 12' : '0 0 24 24';
|
|
@@ -63,6 +68,8 @@ var ScoreDonutUtils = exports.ScoreDonutUtils = /*#__PURE__*/function () {
|
|
|
63
68
|
}, {
|
|
64
69
|
key: "strokeDashOffsetBase",
|
|
65
70
|
get: function get() {
|
|
71
|
+
var hasDivider = this.hasDivider;
|
|
72
|
+
if (!hasDivider) return 0;
|
|
66
73
|
var valueStroke = this.valueStrokeDashArray;
|
|
67
74
|
var offsetPoint = this.offsetPoint;
|
|
68
75
|
return -1 * (valueStroke + (this.isSemiDonut ? offsetPoint : 0));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ScoreDonutUtils.js","names":["ScoreDonutUtils","exports","value","isSemiDonut","_classCallCheck2","_defineProperty2","radius","_createClass2","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":";;;;;;;;;;IAAaA,eAAe,GAAAC,OAAA,CAAAD,eAAA;EAM1B,SAAAA,gBAAYE,KAAa,EAAEC,WAAoB,EAAE;IAAA,IAAAC,gBAAA,mBAAAJ,eAAA;IAAA,IAAAK,gBAAA;IAAA,IAAAA,gBAAA;IAAA,IAAAA,gBAAA;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,WAAAK,aAAA,aAAAP,eAAA;IAAAQ,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,
|
|
1
|
+
{"version":3,"file":"ScoreDonutUtils.js","names":["ScoreDonutUtils","exports","value","isSemiDonut","_classCallCheck2","_defineProperty2","radius","_createClass2","key","get","includes","Math","PI","baseStrokeDashArray","valueStrokeDashArray","greyStroke","greyStrokeDashArray","offsetPoint","greyStrokeDash","strokeDashArrayBetweenSpaces","concat","hasDivider","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 hasDivider() {\n return ![0, 100].includes(this.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 hasDivider = this.hasDivider;\n\n if (!hasDivider) return 0;\n\n const valueStroke = this.valueStrokeDashArray;\n const offsetPoint = this.offsetPoint;\n\n return -1 * (valueStroke + (this.isSemiDonut ? offsetPoint : 0));\n };\n}\n"],"mappings":";;;;;;;;;;IAAaA,eAAe,GAAAC,OAAA,CAAAD,eAAA;EAM1B,SAAAA,gBAAYE,KAAa,EAAEC,WAAoB,EAAE;IAAA,IAAAC,gBAAA,mBAAAJ,eAAA;IAAA,IAAAK,gBAAA;IAAA,IAAAA,gBAAA;IAAA,IAAAA,gBAAA;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,WAAAK,aAAA,aAAAP,eAAA;IAAAQ,GAAA;IAAAC,GAAA,EAED,SAAAA,IAAA,EAAwB;MACtB,OAAO,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC,CAACC,QAAQ,CAAC,IAAI,CAACR,KAAK,CAAC;IACvC;EAAC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AA,CAAUH,WAAW,OAAAG,MAAA,CAAI,IAAI,CAAClB,KAAK,GAAG,EAAE,GAAGiB,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;IAAAL,GAAA;IAAAC,GAAA,EAED,SAAAA,IAAA,EAAkC;MAChC,IAAMY,UAAU,GAAG,IAAI,CAACA,UAAU;MAElC,IAAI,CAACA,UAAU,EAAE,OAAO,CAAC;MAEzB,IAAMC,WAAW,GAAG,IAAI,CAACR,oBAAoB;MAC7C,IAAMG,WAAW,GAAG,IAAI,CAACA,WAAW;MAEpC,OAAO,CAAC,CAAC,IAAIK,WAAW,IAAI,IAAI,CAACnB,WAAW,GAAGc,WAAW,GAAG,CAAC,CAAC,CAAC;IAClE;EAAC;AAAA","ignoreList":[]}
|
|
@@ -16,17 +16,17 @@ import resolveColorEnhance from '@semcore/core/lib/utils/enhances/resolveColorEn
|
|
|
16
16
|
import { Box } from '@semcore/flex-box';
|
|
17
17
|
import React from 'react';
|
|
18
18
|
/*!__reshadow-styles__:"./donut.shadow.css"*/
|
|
19
|
-
var style = (/*__reshadow_css_start__*/_sstyled.insert(/*__inner_css_start__*/"@keyframes
|
|
19
|
+
var style = (/*__reshadow_css_start__*/_sstyled.insert(/*__inner_css_start__*/"@keyframes pulse_1jz5n{0%,to{opacity:1}50%{opacity:.4}}.___SDonutContainer_1jz5n_gg_.__loading_1jz5n_gg_,.___SLineGauge_1jz5n_gg_.__loading_1jz5n_gg_,.___STrendBar_1jz5n_gg_.__loading_1jz5n_gg_,.___STrendLine_1jz5n_gg_.__loading_1jz5n_gg_{animation-name:pulse_1jz5n;animation-iteration-count:infinite;animation-timing-function:ease-in-out;animation-duration:1.6s;will-change:opacity}.___SDonutContainer_1jz5n_gg_.__semi_1jz5n_gg_ g{transform:rotate(180deg) translate(-24px,-24px)}.___SDonutContainer_1jz5n_gg_ g{transform:rotate(-90deg) translate(-24px)}.___SDonutContainer_1jz5n_gg_.__animate_1jz5n_gg_ circle{transition:all var(--intergalactic-duration-extra-slow, 500) ease-in-out}", /*__inner_css_end__*/"1jz5n_gg_"),
|
|
20
20
|
/*__reshadow_css_end__*/
|
|
21
21
|
{
|
|
22
|
-
"__SLineGauge": "
|
|
23
|
-
"_loading": "
|
|
24
|
-
"__SDonutContainer": "
|
|
25
|
-
"__STrendLine": "
|
|
26
|
-
"__STrendBar": "
|
|
27
|
-
"@pulse": "
|
|
28
|
-
"_animate": "
|
|
29
|
-
"_semi": "
|
|
22
|
+
"__SLineGauge": "___SLineGauge_1jz5n_gg_",
|
|
23
|
+
"_loading": "__loading_1jz5n_gg_",
|
|
24
|
+
"__SDonutContainer": "___SDonutContainer_1jz5n_gg_",
|
|
25
|
+
"__STrendLine": "___STrendLine_1jz5n_gg_",
|
|
26
|
+
"__STrendBar": "___STrendBar_1jz5n_gg_",
|
|
27
|
+
"@pulse": "pulse_1jz5n",
|
|
28
|
+
"_animate": "__animate_1jz5n_gg_",
|
|
29
|
+
"_semi": "__semi_1jz5n_gg_"
|
|
30
30
|
});
|
|
31
31
|
import { ScoreDonutUtils } from '../../utils/ScoreDonutUtils';
|
|
32
32
|
var DonutRoot = /*#__PURE__*/function (_Component) {
|
|
@@ -83,7 +83,7 @@ var DonutRoot = /*#__PURE__*/function (_Component) {
|
|
|
83
83
|
}), /*#__PURE__*/React.createElement("animate", _ref2.cn("animate", {
|
|
84
84
|
"attributeName": 'stroke-dashoffset',
|
|
85
85
|
"values": "0;".concat(scoreDonut.valueStrokeDashArray)
|
|
86
|
-
}))),
|
|
86
|
+
}))), scoreDonut.hasDivider && !isSemiDonut && /*#__PURE__*/React.createElement("circle", _ref2.cn("circle", {
|
|
87
87
|
"cx": '12',
|
|
88
88
|
"cy": '12',
|
|
89
89
|
"r": scoreDonut.radius,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Donut.js","names":["createComponent","Component","Root","sstyled","assignProps","extractAriaProps","resolveColorEnhance","Box","React","style","_sstyled","insert","ScoreDonutUtils","DonutRoot","_Component","_classCallCheck","_callSuper","arguments","_inherits","_createClass","key","value","render","_ref","asProps","_ref2","SDonutContainer","_this$asProps","styles","_this$asProps$baseBgC","baseBgColor","_this$asProps$color","color","resolveColor","isSemiDonut","loading","scoreDonut","_extractAriaProps","__excludeProps","extractedAriaProps","createElement","cn","_objectSpread","_assignProps","viewBox","radius","strokeWidth","undefined","concat","greyStrokeDashArray","baseStrokeDashArray","strokeDashOffsetBase","Fragment","valueStrokeDashArray","strokeDashArrayParts","_defineProperty","animate","ScoreDonut","displayName","ScoreSemiDonut","enhancements","wrapperProps","props"],"sources":["../../../../src/component/score/Donut.tsx"],"sourcesContent":["import { createComponent, Component, Root, sstyled, type ComponentType } from '@semcore/core';\nimport { assignProps } from '@semcore/core';\nimport { extractAriaProps } from '@semcore/core/lib/utils/ariaProps';\nimport resolveColorEnhance from '@semcore/core/lib/utils/enhances/resolveColorEnhance';\nimport { Box, type BoxProps } from '@semcore/flex-box';\nimport React from 'react';\n\nimport style from './donut.shadow.css';\nimport type { CommonScoreProps } from './Score';\nimport { ScoreDonutUtils } from '../../utils/ScoreDonutUtils';\n\nexport type ScoreDonutProps = BoxProps & CommonScoreProps;\n\ntype Enhances = {\n resolveColor: ReturnType<typeof resolveColorEnhance>;\n isSemiDonut?: true;\n};\n\nclass DonutRoot extends Component<ScoreDonutProps, {}, {}, typeof DonutRoot.enhance> {\n static enhance = [resolveColorEnhance()] as const;\n\n static style = style;\n\n static defaultProps = {\n animate: true,\n };\n\n render() {\n const SDonutContainer = Root;\n const {\n value,\n styles,\n baseBgColor = 'chart-grid-bar-chart-base-bg',\n color = 'chart-palette-order-1',\n resolveColor,\n isSemiDonut,\n loading,\n } = this.asProps;\n\n const scoreDonut = new ScoreDonutUtils(value, isSemiDonut);\n const { __excludeProps, extractedAriaProps } = extractAriaProps(this.asProps);\n\n return sstyled(styles)(\n <SDonutContainer render={Box} semi={isSemiDonut} __excludeProps={__excludeProps}>\n <svg\n width='100%'\n height='100%'\n viewBox={scoreDonut.viewBox}\n fill='none'\n role='img'\n {...extractedAriaProps}\n >\n <g>\n <circle\n cx='12'\n cy='12'\n r={scoreDonut.radius}\n strokeWidth={scoreDonut.strokeWidth}\n stroke={resolveColor(baseBgColor)}\n strokeDasharray={\n loading ? undefined : `${scoreDonut.greyStrokeDashArray} ${scoreDonut.baseStrokeDashArray}`\n }\n strokeDashoffset={scoreDonut.strokeDashOffsetBase}\n />\n {!loading && (\n <>\n <circle\n cx='12'\n cy='12'\n r={scoreDonut.radius}\n strokeWidth={scoreDonut.strokeWidth}\n stroke={resolveColor(color)}\n strokeDasharray={`${scoreDonut.valueStrokeDashArray} ${scoreDonut.baseStrokeDashArray}`}\n strokeDashoffset={scoreDonut.valueStrokeDashArray}\n >\n <animate\n attributeName='stroke-dashoffset'\n values={`0;${scoreDonut.valueStrokeDashArray}`}\n />\n </circle>\n {
|
|
1
|
+
{"version":3,"file":"Donut.js","names":["createComponent","Component","Root","sstyled","assignProps","extractAriaProps","resolveColorEnhance","Box","React","style","_sstyled","insert","ScoreDonutUtils","DonutRoot","_Component","_classCallCheck","_callSuper","arguments","_inherits","_createClass","key","value","render","_ref","asProps","_ref2","SDonutContainer","_this$asProps","styles","_this$asProps$baseBgC","baseBgColor","_this$asProps$color","color","resolveColor","isSemiDonut","loading","scoreDonut","_extractAriaProps","__excludeProps","extractedAriaProps","createElement","cn","_objectSpread","_assignProps","viewBox","radius","strokeWidth","undefined","concat","greyStrokeDashArray","baseStrokeDashArray","strokeDashOffsetBase","Fragment","valueStrokeDashArray","hasDivider","strokeDashArrayParts","_defineProperty","animate","ScoreDonut","displayName","ScoreSemiDonut","enhancements","wrapperProps","props"],"sources":["../../../../src/component/score/Donut.tsx"],"sourcesContent":["import { createComponent, Component, Root, sstyled, type ComponentType } from '@semcore/core';\nimport { assignProps } from '@semcore/core';\nimport { extractAriaProps } from '@semcore/core/lib/utils/ariaProps';\nimport resolveColorEnhance from '@semcore/core/lib/utils/enhances/resolveColorEnhance';\nimport { Box, type BoxProps } from '@semcore/flex-box';\nimport React from 'react';\n\nimport style from './donut.shadow.css';\nimport type { CommonScoreProps } from './Score';\nimport { ScoreDonutUtils } from '../../utils/ScoreDonutUtils';\n\nexport type ScoreDonutProps = BoxProps & CommonScoreProps;\n\ntype Enhances = {\n resolveColor: ReturnType<typeof resolveColorEnhance>;\n isSemiDonut?: true;\n};\n\nclass DonutRoot extends Component<ScoreDonutProps, {}, {}, typeof DonutRoot.enhance> {\n static enhance = [resolveColorEnhance()] as const;\n\n static style = style;\n\n static defaultProps = {\n animate: true,\n };\n\n render() {\n const SDonutContainer = Root;\n const {\n value,\n styles,\n baseBgColor = 'chart-grid-bar-chart-base-bg',\n color = 'chart-palette-order-1',\n resolveColor,\n isSemiDonut,\n loading,\n } = this.asProps;\n\n const scoreDonut = new ScoreDonutUtils(value, isSemiDonut);\n const { __excludeProps, extractedAriaProps } = extractAriaProps(this.asProps);\n\n return sstyled(styles)(\n <SDonutContainer render={Box} semi={isSemiDonut} __excludeProps={__excludeProps}>\n <svg\n width='100%'\n height='100%'\n viewBox={scoreDonut.viewBox}\n fill='none'\n role='img'\n {...extractedAriaProps}\n >\n <g>\n <circle\n cx='12'\n cy='12'\n r={scoreDonut.radius}\n strokeWidth={scoreDonut.strokeWidth}\n stroke={resolveColor(baseBgColor)}\n strokeDasharray={\n loading ? undefined : `${scoreDonut.greyStrokeDashArray} ${scoreDonut.baseStrokeDashArray}`\n }\n strokeDashoffset={scoreDonut.strokeDashOffsetBase}\n />\n {!loading && (\n <>\n <circle\n cx='12'\n cy='12'\n r={scoreDonut.radius}\n strokeWidth={scoreDonut.strokeWidth}\n stroke={resolveColor(color)}\n strokeDasharray={`${scoreDonut.valueStrokeDashArray} ${scoreDonut.baseStrokeDashArray}`}\n strokeDashoffset={scoreDonut.valueStrokeDashArray}\n >\n <animate\n attributeName='stroke-dashoffset'\n values={`0;${scoreDonut.valueStrokeDashArray}`}\n />\n </circle>\n {scoreDonut.hasDivider && !isSemiDonut && (\n <circle\n cx='12'\n cy='12'\n r={scoreDonut.radius}\n strokeWidth={scoreDonut.strokeWidth}\n stroke={resolveColor('chart-grid-border')}\n strokeDasharray={scoreDonut.strokeDashArrayParts}\n strokeDashoffset={-1 * scoreDonut.valueStrokeDashArray}\n />\n )}\n </>\n )}\n </g>\n </svg>\n </SDonutContainer>,\n );\n }\n}\n\nexport const ScoreDonut: ComponentType<ScoreDonutProps, {}, {}, Enhances> =\n createComponent(DonutRoot);\n\nScoreDonut.displayName = 'MiniChart.ScoreDonut';\n\nexport const ScoreSemiDonut: ComponentType<ScoreDonutProps, {}, {}, Enhances> = createComponent(\n DonutRoot,\n {},\n {\n enhancements: [\n () => {\n return {\n wrapperProps: (props: ScoreDonutProps) => {\n return assignProps(props, { isSemiDonut: true });\n },\n };\n },\n ],\n },\n);\n\nScoreSemiDonut.displayName = 'MiniChart.ScoreSemiDonut';\n"],"mappings":";;;;;;;;;;;AAAA,SAASA,eAAe,EAAEC,SAAS,EAAEC,IAAI,EAAEC,OAAO,QAA4B,eAAe;AAC7F,SAASC,WAAW,QAAQ,eAAe;AAC3C,SAASC,gBAAgB,QAAQ,mCAAmC;AACpE,OAAOC,mBAAmB,MAAM,sDAAsD;AACtF,SAASC,GAAG,QAAuB,mBAAmB;AACtD,OAAOC,KAAK,MAAM,OAAO;AAAC;AAAA,IAAAC,KAAA,8BAAAC,QAAA,CAAAC,MAAA;AAAA;AAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;AAAA;AAI1B,SAASC,eAAe,QAAQ,6BAA6B;AAAC,IASxDC,SAAS,0BAAAC,UAAA;EAAA,SAAAD,UAAA;IAAAE,eAAA,OAAAF,SAAA;IAAA,OAA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AU,CAACU,WAAW;QAAA,UAC3Bb,YAAY,CAAC,mBAAmB,CAAC;QAAA,mBACxBG,UAAU,CAACmB,oBAAoB;QAAA,oBAC9B,CAAC,CAAC,GAAGnB,UAAU,CAACiB;MAAoB,EACvD,CAEH,CAEH,CACA,CACU,CAAC;IAEtB;EAAC;AAAA,EA/EqBpD,SAAS;AAAAuD,eAAA,CAA3B3C,SAAS,aACI,CAACP,mBAAmB,CAAC,CAAC,CAAC;AAAAkD,eAAA,CADpC3C,SAAS,WAGEJ,KAAK;AAAA+C,eAAA,CAHhB3C,SAAS,kBAKS;EACpB4C,OAAO,EAAE;AACX,CAAC;AA2EH,OAAO,IAAMC,UAA4D,GACvE1D,eAAe,CAACa,SAAS,CAAC;AAE5B6C,UAAU,CAACC,WAAW,GAAG,sBAAsB;AAE/C,OAAO,IAAMC,cAAgE,GAAG5D,eAAe,CAC7Fa,SAAS,EACT,CAAC,CAAC,EACF;EACEgD,YAAY,EAAE,CACZ,YAAM;IACJ,OAAO;MACLC,YAAY,EAAE,SAAdA,YAAYA,CAAGC,KAAsB,EAAK;QACxC,OAAO3D,WAAW,CAAC2D,KAAK,EAAE;UAAE7B,WAAW,EAAE;QAAK,CAAC,CAAC;MAClD;IACF,CAAC;EACH,CAAC;AAEL,CACF,CAAC;AAED0B,cAAc,CAACD,WAAW,GAAG,0BAA0B","ignoreList":[]}
|
|
@@ -16,26 +16,26 @@ import resolveColorEnhance from '@semcore/core/lib/utils/enhances/resolveColorEn
|
|
|
16
16
|
import { Box, Flex } from '@semcore/flex-box';
|
|
17
17
|
import React from 'react';
|
|
18
18
|
/*!__reshadow-styles__:"./line.shadow.css"*/
|
|
19
|
-
var style = (/*__reshadow_css_start__*/_sstyled.insert(/*__inner_css_start__*/"@keyframes
|
|
19
|
+
var style = (/*__reshadow_css_start__*/_sstyled.insert(/*__inner_css_start__*/"@keyframes pulse_1pqun{0%,to{opacity:1}50%{opacity:.4}}@keyframes move-line_1pqun{0%{transform:translateX(0)}to{transform:translateX(100%)}}.___SDonutContainer_1pqun_gg_.__loading_1pqun_gg_,.___SLineGauge_1pqun_gg_.__loading_1pqun_gg_,.___STrendBar_1pqun_gg_.__loading_1pqun_gg_,.___STrendLine_1pqun_gg_.__loading_1pqun_gg_{animation-name:pulse_1pqun;animation-iteration-count:infinite;animation-timing-function:ease-in-out;animation-duration:1.6s;will-change:opacity}.___SLineGauge_1pqun_gg_{height:8px;background-color:var(--base-bg-color_1pqun, var(--intergalactic-chart-grid-bar-chart-base-bg, #e0e1e9));border-radius:var(--intergalactic-chart-rounded, 2px);overflow:hidden;position:relative}.___SLineValue_1pqun_gg_{height:8px;border-radius:var(--intergalactic-chart-rounded, 2px)0 0 var(--intergalactic-chart-rounded, 2px)}.___SLineValue_1pqun_gg_.__percent_1pqun_gg_{width:var(--percent_1pqun)}.___SLineSegmentItem_1pqun_gg_.__color_1pqun_gg_,.___SLineValue_1pqun_gg_.__color_1pqun_gg_{background-color:var(--color_1pqun, var(--intergalactic-chart-palette-order-1, #2bb3ff))}.___SLineGauge_1pqun_gg_.__segments_1pqun_gg_{border-radius:var(--intergalactic-progress-bar-rounded, 6px)}.___SAnimationLine_1pqun_gg_,.___SLineGaugeSegment_1pqun_gg_{position:absolute;top:0;left:0;right:0;bottom:0}.___SLineSegmentItem_1pqun_gg_:last-child{margin-right:0;border-right:none}.___SLineSegmentItem_1pqun_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_1pqun_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_1pqun;animation-duration:.5s;animation-timing-function:ease-in-out;animation-fill-mode:forwards}", /*__inner_css_end__*/"1pqun_gg_"),
|
|
20
20
|
/*__reshadow_css_end__*/
|
|
21
21
|
{
|
|
22
|
-
"__SLineGauge": "
|
|
23
|
-
"_loading": "
|
|
24
|
-
"__SDonutContainer": "
|
|
25
|
-
"__STrendLine": "
|
|
26
|
-
"__STrendBar": "
|
|
27
|
-
"@pulse": "
|
|
28
|
-
"--base-bg-color": "--base-bg-
|
|
29
|
-
"__SLineValue": "
|
|
30
|
-
"_percent": "
|
|
31
|
-
"--percent": "--
|
|
32
|
-
"_color": "
|
|
33
|
-
"__SLineSegmentItem": "
|
|
34
|
-
"--color": "--
|
|
35
|
-
"_segments": "
|
|
36
|
-
"__SLineGaugeSegment": "
|
|
37
|
-
"__SAnimationLine": "
|
|
38
|
-
"@move-line": "move-
|
|
22
|
+
"__SLineGauge": "___SLineGauge_1pqun_gg_",
|
|
23
|
+
"_loading": "__loading_1pqun_gg_",
|
|
24
|
+
"__SDonutContainer": "___SDonutContainer_1pqun_gg_",
|
|
25
|
+
"__STrendLine": "___STrendLine_1pqun_gg_",
|
|
26
|
+
"__STrendBar": "___STrendBar_1pqun_gg_",
|
|
27
|
+
"@pulse": "pulse_1pqun",
|
|
28
|
+
"--base-bg-color": "--base-bg-color_1pqun",
|
|
29
|
+
"__SLineValue": "___SLineValue_1pqun_gg_",
|
|
30
|
+
"_percent": "__percent_1pqun_gg_",
|
|
31
|
+
"--percent": "--percent_1pqun",
|
|
32
|
+
"_color": "__color_1pqun_gg_",
|
|
33
|
+
"__SLineSegmentItem": "___SLineSegmentItem_1pqun_gg_",
|
|
34
|
+
"--color": "--color_1pqun",
|
|
35
|
+
"_segments": "__segments_1pqun_gg_",
|
|
36
|
+
"__SLineGaugeSegment": "___SLineGaugeSegment_1pqun_gg_",
|
|
37
|
+
"__SAnimationLine": "___SAnimationLine_1pqun_gg_",
|
|
38
|
+
"@move-line": "move-line_1pqun"
|
|
39
39
|
});
|
|
40
40
|
var LineRoot = /*#__PURE__*/function (_Component) {
|
|
41
41
|
function LineRoot() {
|
|
@@ -124,8 +124,10 @@ _defineProperty(LineRoot, "defaultProps", {
|
|
|
124
124
|
function Segment(props) {
|
|
125
125
|
var _ref2 = arguments[0],
|
|
126
126
|
_ref6;
|
|
127
|
-
var styles = props.styles
|
|
127
|
+
var styles = props.styles,
|
|
128
|
+
value = props.value;
|
|
128
129
|
var SLineSegmentItem = Box;
|
|
130
|
+
if (!value) return null;
|
|
129
131
|
return _ref6 = sstyled(styles), /*#__PURE__*/React.createElement(SLineSegmentItem, _ref6.cn("SLineSegmentItem", _objectSpread({}, _assignProps3({}, _ref2))));
|
|
130
132
|
}
|
|
131
133
|
Segment.displayName = 'Segment';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Line.js","names":["createComponent","Component","Root","sstyled","resolveColorEnhance","Box","Flex","React","style","_sstyled","insert","LineRoot","_Component","_classCallCheck","_callSuper","arguments","_inherits","_createClass","key","value","getSegmentProps","segmentProps","_this$asProps","asProps","children","resolveColor","sum","Children","forEach","child","isValidElement","props","width","concat","color","render","_ref","_ref5","SLineGauge","SLineValue","SAnimationLine","SLineGaugeSegment","SLineSegmentItem","_this$asProps2","styles","_this$asProps2$color","baseBgColor","loading","animate","undefined","_ref3","createElement","cn","_objectSpread","_assignProps","segments","SegmentItems","i","_ref4","push","percent","_assignProps2","Boolean","length","_defineProperty","Segment","_ref2","arguments[0]","_ref6","_assignProps3","displayName","ScoreLine"],"sources":["../../../../src/component/score/Line.tsx"],"sourcesContent":["import { createComponent, Component, Root, sstyled } from '@semcore/core';\nimport resolveColorEnhance from '@semcore/core/lib/utils/enhances/resolveColorEnhance';\nimport { Box, Flex } from '@semcore/flex-box';\nimport React from 'react';\n\nimport style from './line.shadow.css';\nimport type {\n ScoreLineComponent,\n ScoreLineGaugeProps,\n SegmentProps,\n InnerSegmentProps,\n} from './Line.types';\n\nclass LineRoot extends Component<ScoreLineGaugeProps, {}, {}, typeof LineRoot.enhance> {\n static enhance = [resolveColorEnhance()] as const;\n static displayName = 'ScoreLine';\n\n static style = style;\n\n static defaultProps = {\n animate: true,\n };\n\n getSegmentProps(segmentProps: SegmentProps) {\n const { children, resolveColor } = this.asProps;\n\n let sum = 0;\n React.Children.forEach(children, (child) => {\n if (React.isValidElement<SegmentProps>(child)) {\n sum = sum + child.props.value;\n }\n });\n\n const width = sum > 0 ? (100 * segmentProps.value) / sum : 0;\n\n return {\n 'w': `${width}%`,\n 'use:color': resolveColor(segmentProps.color),\n };\n }\n\n render() {\n const SLineGauge = Root;\n const SLineValue = Box;\n const SAnimationLine = Box;\n const SLineGaugeSegment = Flex;\n const SLineSegmentItem = Box;\n const {\n value,\n styles,\n color = 'chart-palette-order-1',\n baseBgColor,\n resolveColor,\n loading,\n children,\n Children,\n animate,\n } = this.asProps;\n\n if (children !== undefined) {\n return sstyled(styles)(\n <SLineGauge render={Box} segments base-bg-color={resolveColor(baseBgColor)}>\n <SLineGaugeSegment>\n <Children />\n </SLineGaugeSegment>\n {animate && <SAnimationLine />}\n </SLineGauge>,\n );\n }\n\n const { segments } = this.asProps;\n\n const SegmentItems = [];\n\n if (segments) {\n for (let i = 0; i < segments; i++) {\n const width = `calc((100% - ${segments - 1}px) / ${segments})`;\n\n SegmentItems.push(\n sstyled(styles)(\n <SLineSegmentItem\n key={i}\n color={i < value ? resolveColor(color) : undefined}\n w={width}\n />,\n ),\n );\n }\n }\n\n let percent = `${value}%`;\n\n if (segments) {\n percent = `${(value / segments) * 100}%`;\n }\n\n return sstyled(styles)(\n <SLineGauge render={Box} base-bg-color={resolveColor(baseBgColor)}>\n {!loading && <SLineValue w={percent} color={resolveColor(color)} />}\n {Boolean(SegmentItems.length) && <SLineGaugeSegment>{SegmentItems}</SLineGaugeSegment>}\n {animate && <SAnimationLine />}\n </SLineGauge>,\n );\n }\n}\n\nfunction Segment(props: InnerSegmentProps) {\n const { styles } = props;\n const SLineSegmentItem = Root;\n\n return sstyled(styles)(<SLineSegmentItem render={Box} />);\n}\nSegment.displayName = 'Segment';\n\nexport const ScoreLine: ScoreLineComponent = createComponent(LineRoot, {\n Segment,\n});\n\nScoreLine.displayName = 'MiniChart.ScoreLine';\n"],"mappings":";;;;;;;;;;;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C,EAAG,CAAC,EAClE4B,OAAO,CAACN,YAAY,CAACO,MAAM,CAAC,iBAAIxD,KAAA,CAAA4C,aAAA,CAACV,iBAAiB,EAAAJ,KAAA,CAAAe,EAAA,2BAAEI,YAAgC,CAAC,EACrFR,OAAO,iBAAIzC,KAAA,CAAA4C,aAAA,CAACX,cAAc,EAAAH,KAAA,CAAAe,EAAA,sBAAE,CACnB,CAAC;IAEjB;EAAC;AAAA,EA1FoBnD,SAAS;AAAA+D,eAAA,CAA1BrD,QAAQ,aACK,CAACP,mBAAmB,CAAC,CAAC,CAAC;AAAA4D,eAAA,CADpCrD,QAAQ,iBAES,WAAW;AAAAqD,eAAA,CAF5BrD,QAAQ,WAIGH,KAAK;AAAAwD,eAAA,CAJhBrD,QAAQ,kBAMU;EACpBqC,OAAO,EAAE;AACX,CAAC;AAqFH,SAASiB,OAAOA,CAAClC,KAAwB,EAAE;EAAA,IAAAmC,KAAA,GAAAC,YAAA;IAAAC,KAAA;EACzC,IAAQxB,MAAM,
|
|
1
|
+
{"version":3,"file":"Line.js","names":["createComponent","Component","Root","sstyled","resolveColorEnhance","Box","Flex","React","style","_sstyled","insert","LineRoot","_Component","_classCallCheck","_callSuper","arguments","_inherits","_createClass","key","value","getSegmentProps","segmentProps","_this$asProps","asProps","children","resolveColor","sum","Children","forEach","child","isValidElement","props","width","concat","color","render","_ref","_ref5","SLineGauge","SLineValue","SAnimationLine","SLineGaugeSegment","SLineSegmentItem","_this$asProps2","styles","_this$asProps2$color","baseBgColor","loading","animate","undefined","_ref3","createElement","cn","_objectSpread","_assignProps","segments","SegmentItems","i","_ref4","push","percent","_assignProps2","Boolean","length","_defineProperty","Segment","_ref2","arguments[0]","_ref6","_assignProps3","displayName","ScoreLine"],"sources":["../../../../src/component/score/Line.tsx"],"sourcesContent":["import { createComponent, Component, Root, sstyled } from '@semcore/core';\nimport resolveColorEnhance from '@semcore/core/lib/utils/enhances/resolveColorEnhance';\nimport { Box, Flex } from '@semcore/flex-box';\nimport React from 'react';\n\nimport style from './line.shadow.css';\nimport type {\n ScoreLineComponent,\n ScoreLineGaugeProps,\n SegmentProps,\n InnerSegmentProps,\n} from './Line.types';\n\nclass LineRoot extends Component<ScoreLineGaugeProps, {}, {}, typeof LineRoot.enhance> {\n static enhance = [resolveColorEnhance()] as const;\n static displayName = 'ScoreLine';\n\n static style = style;\n\n static defaultProps = {\n animate: true,\n };\n\n getSegmentProps(segmentProps: SegmentProps) {\n const { children, resolveColor } = this.asProps;\n\n let sum = 0;\n React.Children.forEach(children, (child) => {\n if (React.isValidElement<SegmentProps>(child)) {\n sum = sum + child.props.value;\n }\n });\n\n const width = sum > 0 ? (100 * segmentProps.value) / sum : 0;\n\n return {\n 'w': `${width}%`,\n 'use:color': resolveColor(segmentProps.color),\n };\n }\n\n render() {\n const SLineGauge = Root;\n const SLineValue = Box;\n const SAnimationLine = Box;\n const SLineGaugeSegment = Flex;\n const SLineSegmentItem = Box;\n const {\n value,\n styles,\n color = 'chart-palette-order-1',\n baseBgColor,\n resolveColor,\n loading,\n children,\n Children,\n animate,\n } = this.asProps;\n\n if (children !== undefined) {\n return sstyled(styles)(\n <SLineGauge render={Box} segments base-bg-color={resolveColor(baseBgColor)}>\n <SLineGaugeSegment>\n <Children />\n </SLineGaugeSegment>\n {animate && <SAnimationLine />}\n </SLineGauge>,\n );\n }\n\n const { segments } = this.asProps;\n\n const SegmentItems = [];\n\n if (segments) {\n for (let i = 0; i < segments; i++) {\n const width = `calc((100% - ${segments - 1}px) / ${segments})`;\n\n SegmentItems.push(\n sstyled(styles)(\n <SLineSegmentItem\n key={i}\n color={i < value ? resolveColor(color) : undefined}\n w={width}\n />,\n ),\n );\n }\n }\n\n let percent = `${value}%`;\n\n if (segments) {\n percent = `${(value / segments) * 100}%`;\n }\n\n return sstyled(styles)(\n <SLineGauge render={Box} base-bg-color={resolveColor(baseBgColor)}>\n {!loading && <SLineValue w={percent} color={resolveColor(color)} />}\n {Boolean(SegmentItems.length) && <SLineGaugeSegment>{SegmentItems}</SLineGaugeSegment>}\n {animate && <SAnimationLine />}\n </SLineGauge>,\n );\n }\n}\n\nfunction Segment(props: InnerSegmentProps) {\n const { styles, value } = props;\n const SLineSegmentItem = Root;\n\n if (!value) return null;\n\n return sstyled(styles)(<SLineSegmentItem render={Box} />);\n}\nSegment.displayName = 'Segment';\n\nexport const ScoreLine: ScoreLineComponent = createComponent(LineRoot, {\n Segment,\n});\n\nScoreLine.displayName = 'MiniChart.ScoreLine';\n"],"mappings":";;;;;;;;;;;;;AAAA,SAASA,eAAe,EAAEC,SAAS,EAAEC,IAAI,EAAEC,OAAO,QAAQ,eAAe;AACzE,OAAOC,mBAAmB,MAAM,sDAAsD;AACtF,SAASC,GAAG,EAAEC,IAAI,QAAQ,mBAAmB;AAC7C,OAAOC,KAAK,MAAM,OAAO;AAAC;AAAA,IAAAC,KAAA,8BAAAC,QAAA,CAAAC,MAAA;AAAA;AAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;AAAA;AAAA,IAUpBC,QAAQ,0BAAAC,UAAA;EAAA,SAAAD,SAAA;IAAAE,eAAA,OAAAF,QAAA;IAAA,OAAAG,UAAA,OAAAH,QAAA,EAAAI,SAAA;EAAA;EAAAC,SAAA,CAAAL,QAAA,EAAAC,UAAA;EAAA,OAAAK,YAAA,CAAAN,QAAA;IAAAO,GAAA;IAAAC,KAAA,EAUZ,SAAAC,eAAeA,CAACC,YAA0B,EAAE;MAC1C,IAAAC,aAAA,GAAmC,IAAI,CAACC,OAAO;QAAvCC,QAAQ,GAAAF,aAAA,CAARE,QAAQ;QAAEC,YAAY,GAAAH,aAAA,CAAZG,YAAY;MAE9B,IAAIC,GAAG,GAAG,CAAC;MACXnB,KAAK,CAACoB,QAAQ,CAACC,OAAO,CAACJ,QAAQ,EAAE,UAACK,KAAK,EAAK;QAC1C,iBAAItB,KAAK,CAACuB,cAAc,CAA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AAA,KAAAgB,aAAA,KAAAH,KAAA,GAAe,CAAC;AAC1D;AACAD,OAAO,CAACK,WAAW,GAAG,SAAS;AAE/B,OAAO,IAAMC,SAA6B,GAAGvE,eAAe,CAACW,QAAQ,EAAE;EACrEsD,OAAO,EAAPA;AACF,CAAC,CAAC;AAEFM,SAAS,CAACD,WAAW,GAAG,qBAAqB","ignoreList":[]}
|
|
@@ -17,15 +17,15 @@ import { Box } from '@semcore/flex-box';
|
|
|
17
17
|
import React from 'react';
|
|
18
18
|
import { Trend } from './Trend';
|
|
19
19
|
/*!__reshadow-styles__:"../skeleton/skeleton.shadow.css"*/
|
|
20
|
-
var style = (/*__reshadow_css_start__*/_sstyled.insert(/*__inner_css_start__*/"@keyframes
|
|
20
|
+
var style = (/*__reshadow_css_start__*/_sstyled.insert(/*__inner_css_start__*/"@keyframes pulse_ix66r{0%,to{opacity:1}50%{opacity:.4}}.___SDonutContainer_ix66r_gg_.__loading_ix66r_gg_,.___SLineGauge_ix66r_gg_.__loading_ix66r_gg_,.___STrendBar_ix66r_gg_.__loading_ix66r_gg_,.___STrendLine_ix66r_gg_.__loading_ix66r_gg_{animation-name:pulse_ix66r;animation-iteration-count:infinite;animation-timing-function:ease-in-out;animation-duration:1.6s;will-change:opacity}", /*__inner_css_end__*/"ix66r_gg_"),
|
|
21
21
|
/*__reshadow_css_end__*/
|
|
22
22
|
{
|
|
23
|
-
"__SLineGauge": "
|
|
24
|
-
"_loading": "
|
|
25
|
-
"__SDonutContainer": "
|
|
26
|
-
"__STrendLine": "
|
|
27
|
-
"__STrendBar": "
|
|
28
|
-
"@pulse": "
|
|
23
|
+
"__SLineGauge": "___SLineGauge_ix66r_gg_",
|
|
24
|
+
"_loading": "__loading_ix66r_gg_",
|
|
25
|
+
"__SDonutContainer": "___SDonutContainer_ix66r_gg_",
|
|
26
|
+
"__STrendLine": "___STrendLine_ix66r_gg_",
|
|
27
|
+
"__STrendBar": "___STrendBar_ix66r_gg_",
|
|
28
|
+
"@pulse": "pulse_ix66r"
|
|
29
29
|
});
|
|
30
30
|
var TrendBarRoot = /*#__PURE__*/function (_Trend) {
|
|
31
31
|
function TrendBarRoot() {
|
|
@@ -18,15 +18,15 @@ import { Box } from '@semcore/flex-box';
|
|
|
18
18
|
import React from 'react';
|
|
19
19
|
import { Trend } from './Trend';
|
|
20
20
|
/*!__reshadow-styles__:"../skeleton/skeleton.shadow.css"*/
|
|
21
|
-
var style = (/*__reshadow_css_start__*/_sstyled.insert(/*__inner_css_start__*/"@keyframes
|
|
21
|
+
var style = (/*__reshadow_css_start__*/_sstyled.insert(/*__inner_css_start__*/"@keyframes pulse_ix66r{0%,to{opacity:1}50%{opacity:.4}}.___SDonutContainer_ix66r_gg_.__loading_ix66r_gg_,.___SLineGauge_ix66r_gg_.__loading_ix66r_gg_,.___STrendBar_ix66r_gg_.__loading_ix66r_gg_,.___STrendLine_ix66r_gg_.__loading_ix66r_gg_{animation-name:pulse_ix66r;animation-iteration-count:infinite;animation-timing-function:ease-in-out;animation-duration:1.6s;will-change:opacity}", /*__inner_css_end__*/"ix66r_gg_"),
|
|
22
22
|
/*__reshadow_css_end__*/
|
|
23
23
|
{
|
|
24
|
-
"__SLineGauge": "
|
|
25
|
-
"_loading": "
|
|
26
|
-
"__SDonutContainer": "
|
|
27
|
-
"__STrendLine": "
|
|
28
|
-
"__STrendBar": "
|
|
29
|
-
"@pulse": "
|
|
24
|
+
"__SLineGauge": "___SLineGauge_ix66r_gg_",
|
|
25
|
+
"_loading": "__loading_ix66r_gg_",
|
|
26
|
+
"__SDonutContainer": "___SDonutContainer_ix66r_gg_",
|
|
27
|
+
"__STrendLine": "___STrendLine_ix66r_gg_",
|
|
28
|
+
"__STrendBar": "___STrendBar_ix66r_gg_",
|
|
29
|
+
"@pulse": "pulse_ix66r"
|
|
30
30
|
});
|
|
31
31
|
var TrendLineRoot = /*#__PURE__*/function (_Trend) {
|
|
32
32
|
function TrendLineRoot() {
|
|
@@ -12,6 +12,11 @@ export var ScoreDonutUtils = /*#__PURE__*/function () {
|
|
|
12
12
|
this.value = value;
|
|
13
13
|
}
|
|
14
14
|
return _createClass(ScoreDonutUtils, [{
|
|
15
|
+
key: "hasDivider",
|
|
16
|
+
get: function get() {
|
|
17
|
+
return ![0, 100].includes(this.value);
|
|
18
|
+
}
|
|
19
|
+
}, {
|
|
15
20
|
key: "viewBox",
|
|
16
21
|
get: function get() {
|
|
17
22
|
return this.isSemiDonut ? '0 0 24 12' : '0 0 24 24';
|
|
@@ -56,6 +61,8 @@ export var ScoreDonutUtils = /*#__PURE__*/function () {
|
|
|
56
61
|
}, {
|
|
57
62
|
key: "strokeDashOffsetBase",
|
|
58
63
|
get: function get() {
|
|
64
|
+
var hasDivider = this.hasDivider;
|
|
65
|
+
if (!hasDivider) return 0;
|
|
59
66
|
var valueStroke = this.valueStrokeDashArray;
|
|
60
67
|
var offsetPoint = this.offsetPoint;
|
|
61
68
|
return -1 * (valueStroke + (this.isSemiDonut ? offsetPoint : 0));
|
|
@@ -1 +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,
|
|
1
|
+
{"version":3,"file":"ScoreDonutUtils.js","names":["ScoreDonutUtils","value","isSemiDonut","_classCallCheck","_defineProperty","radius","_createClass","key","get","includes","Math","PI","baseStrokeDashArray","valueStrokeDashArray","greyStroke","greyStrokeDashArray","offsetPoint","greyStrokeDash","strokeDashArrayBetweenSpaces","concat","hasDivider","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 hasDivider() {\n return ![0, 100].includes(this.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 hasDivider = this.hasDivider;\n\n if (!hasDivider) return 0;\n\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,EAAwB;MACtB,OAAO,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC,CAACC,QAAQ,CAAC,IAAI,CAACR,KAAK,CAAC;IACvC;EAAC;IAAAM,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,GAAGQ,IAAI,CAACC,EAAE,GAAG,IAAI,CAACN,MAAM,GAAG,CAAC,GAAGK,IAAI,CAACC,EAAE,GAAG,IAAI,CAACN,MAAM;IAC7E;EAAC;IAAAE,GAAA;IAAAC,GAAA,EAED,SAAAA,IAAA,EAAkC;MAChC,OAAO,IAAI,CAACI,mBAAmB,IAAI,IAAI,CAACX,KAAK,GAAG,GAAG,CAAC;IACt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AACnB,WAAW,GAAGc,WAAW,GAAG,CAAC,CAAC,CAAC;IAClE;EAAC;AAAA","ignoreList":[]}
|
|
@@ -20,19 +20,19 @@ var style = (
|
|
|
20
20
|
/*__reshadow_css_start__*/
|
|
21
21
|
(sstyled.insert(
|
|
22
22
|
/*__inner_css_start__*/
|
|
23
|
-
"@keyframes
|
|
23
|
+
"@keyframes pulse_1jz5n{0%,to{opacity:1}50%{opacity:.4}}.___SDonutContainer_1jz5n_gg_.__loading_1jz5n_gg_,.___SLineGauge_1jz5n_gg_.__loading_1jz5n_gg_,.___STrendBar_1jz5n_gg_.__loading_1jz5n_gg_,.___STrendLine_1jz5n_gg_.__loading_1jz5n_gg_{animation-name:pulse_1jz5n;animation-iteration-count:infinite;animation-timing-function:ease-in-out;animation-duration:1.6s;will-change:opacity}.___SDonutContainer_1jz5n_gg_.__semi_1jz5n_gg_ g{transform:rotate(180deg) translate(-24px,-24px)}.___SDonutContainer_1jz5n_gg_ g{transform:rotate(-90deg) translate(-24px)}.___SDonutContainer_1jz5n_gg_.__animate_1jz5n_gg_ circle{transition:all var(--intergalactic-duration-extra-slow, 500) ease-in-out}",
|
|
24
24
|
/*__inner_css_end__*/
|
|
25
|
-
"
|
|
25
|
+
"1jz5n_gg_"
|
|
26
26
|
), /*__reshadow_css_end__*/
|
|
27
27
|
{
|
|
28
|
-
"__SLineGauge": "
|
|
29
|
-
"_loading": "
|
|
30
|
-
"__SDonutContainer": "
|
|
31
|
-
"__STrendLine": "
|
|
32
|
-
"__STrendBar": "
|
|
33
|
-
"@pulse": "
|
|
34
|
-
"_animate": "
|
|
35
|
-
"_semi": "
|
|
28
|
+
"__SLineGauge": "___SLineGauge_1jz5n_gg_",
|
|
29
|
+
"_loading": "__loading_1jz5n_gg_",
|
|
30
|
+
"__SDonutContainer": "___SDonutContainer_1jz5n_gg_",
|
|
31
|
+
"__STrendLine": "___STrendLine_1jz5n_gg_",
|
|
32
|
+
"__STrendBar": "___STrendBar_1jz5n_gg_",
|
|
33
|
+
"@pulse": "pulse_1jz5n",
|
|
34
|
+
"_animate": "__animate_1jz5n_gg_",
|
|
35
|
+
"_semi": "__semi_1jz5n_gg_"
|
|
36
36
|
})
|
|
37
37
|
);
|
|
38
38
|
var DonutRoot = /* @__PURE__ */ function(_Component) {
|
|
@@ -77,7 +77,7 @@ var DonutRoot = /* @__PURE__ */ function(_Component) {
|
|
|
77
77
|
}), /* @__PURE__ */ React.createElement("animate", _ref2.cn("animate", {
|
|
78
78
|
"attributeName": "stroke-dashoffset",
|
|
79
79
|
"values": "0;".concat(scoreDonut.valueStrokeDashArray)
|
|
80
|
-
}))),
|
|
80
|
+
}))), scoreDonut.hasDivider && !isSemiDonut && /* @__PURE__ */ React.createElement("circle", _ref2.cn("circle", {
|
|
81
81
|
"cx": "12",
|
|
82
82
|
"cy": "12",
|
|
83
83
|
"r": scoreDonut.radius,
|
|
@@ -18,28 +18,28 @@ var style = (
|
|
|
18
18
|
/*__reshadow_css_start__*/
|
|
19
19
|
(sstyled.insert(
|
|
20
20
|
/*__inner_css_start__*/
|
|
21
|
-
"@keyframes
|
|
21
|
+
"@keyframes pulse_1pqun{0%,to{opacity:1}50%{opacity:.4}}@keyframes move-line_1pqun{0%{transform:translateX(0)}to{transform:translateX(100%)}}.___SDonutContainer_1pqun_gg_.__loading_1pqun_gg_,.___SLineGauge_1pqun_gg_.__loading_1pqun_gg_,.___STrendBar_1pqun_gg_.__loading_1pqun_gg_,.___STrendLine_1pqun_gg_.__loading_1pqun_gg_{animation-name:pulse_1pqun;animation-iteration-count:infinite;animation-timing-function:ease-in-out;animation-duration:1.6s;will-change:opacity}.___SLineGauge_1pqun_gg_{height:8px;background-color:var(--base-bg-color_1pqun, var(--intergalactic-chart-grid-bar-chart-base-bg, #e0e1e9));border-radius:var(--intergalactic-chart-rounded, 2px);overflow:hidden;position:relative}.___SLineValue_1pqun_gg_{height:8px;border-radius:var(--intergalactic-chart-rounded, 2px)0 0 var(--intergalactic-chart-rounded, 2px)}.___SLineValue_1pqun_gg_.__percent_1pqun_gg_{width:var(--percent_1pqun)}.___SLineSegmentItem_1pqun_gg_.__color_1pqun_gg_,.___SLineValue_1pqun_gg_.__color_1pqun_gg_{background-color:var(--color_1pqun, var(--intergalactic-chart-palette-order-1, #2bb3ff))}.___SLineGauge_1pqun_gg_.__segments_1pqun_gg_{border-radius:var(--intergalactic-progress-bar-rounded, 6px)}.___SAnimationLine_1pqun_gg_,.___SLineGaugeSegment_1pqun_gg_{position:absolute;top:0;left:0;right:0;bottom:0}.___SLineSegmentItem_1pqun_gg_:last-child{margin-right:0;border-right:none}.___SLineSegmentItem_1pqun_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_1pqun_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_1pqun;animation-duration:.5s;animation-timing-function:ease-in-out;animation-fill-mode:forwards}",
|
|
22
22
|
/*__inner_css_end__*/
|
|
23
|
-
"
|
|
23
|
+
"1pqun_gg_"
|
|
24
24
|
), /*__reshadow_css_end__*/
|
|
25
25
|
{
|
|
26
|
-
"__SLineGauge": "
|
|
27
|
-
"_loading": "
|
|
28
|
-
"__SDonutContainer": "
|
|
29
|
-
"__STrendLine": "
|
|
30
|
-
"__STrendBar": "
|
|
31
|
-
"@pulse": "
|
|
32
|
-
"--base-bg-color": "--base-bg-
|
|
33
|
-
"__SLineValue": "
|
|
34
|
-
"_percent": "
|
|
35
|
-
"--percent": "--
|
|
36
|
-
"_color": "
|
|
37
|
-
"__SLineSegmentItem": "
|
|
38
|
-
"--color": "--
|
|
39
|
-
"_segments": "
|
|
40
|
-
"__SLineGaugeSegment": "
|
|
41
|
-
"__SAnimationLine": "
|
|
42
|
-
"@move-line": "move-
|
|
26
|
+
"__SLineGauge": "___SLineGauge_1pqun_gg_",
|
|
27
|
+
"_loading": "__loading_1pqun_gg_",
|
|
28
|
+
"__SDonutContainer": "___SDonutContainer_1pqun_gg_",
|
|
29
|
+
"__STrendLine": "___STrendLine_1pqun_gg_",
|
|
30
|
+
"__STrendBar": "___STrendBar_1pqun_gg_",
|
|
31
|
+
"@pulse": "pulse_1pqun",
|
|
32
|
+
"--base-bg-color": "--base-bg-color_1pqun",
|
|
33
|
+
"__SLineValue": "___SLineValue_1pqun_gg_",
|
|
34
|
+
"_percent": "__percent_1pqun_gg_",
|
|
35
|
+
"--percent": "--percent_1pqun",
|
|
36
|
+
"_color": "__color_1pqun_gg_",
|
|
37
|
+
"__SLineSegmentItem": "___SLineSegmentItem_1pqun_gg_",
|
|
38
|
+
"--color": "--color_1pqun",
|
|
39
|
+
"_segments": "__segments_1pqun_gg_",
|
|
40
|
+
"__SLineGaugeSegment": "___SLineGaugeSegment_1pqun_gg_",
|
|
41
|
+
"__SAnimationLine": "___SAnimationLine_1pqun_gg_",
|
|
42
|
+
"@move-line": "move-line_1pqun"
|
|
43
43
|
})
|
|
44
44
|
);
|
|
45
45
|
var LineRoot = /* @__PURE__ */ function(_Component) {
|
|
@@ -115,8 +115,9 @@ _defineProperty(LineRoot, "defaultProps", {
|
|
|
115
115
|
});
|
|
116
116
|
function Segment(props) {
|
|
117
117
|
var _ref2 = arguments[0], _ref6;
|
|
118
|
-
var styles = props.styles;
|
|
118
|
+
var styles = props.styles, value = props.value;
|
|
119
119
|
var SLineSegmentItem = Box;
|
|
120
|
+
if (!value) return null;
|
|
120
121
|
return _ref6 = sstyled(styles), /* @__PURE__ */ React.createElement(SLineSegmentItem, _ref6.cn("SLineSegmentItem", _objectSpread({}, assignProps({}, _ref2))));
|
|
121
122
|
}
|
|
122
123
|
Segment.displayName = "Segment";
|
|
@@ -21,17 +21,17 @@ var style = (
|
|
|
21
21
|
/*__reshadow_css_start__*/
|
|
22
22
|
(sstyled.insert(
|
|
23
23
|
/*__inner_css_start__*/
|
|
24
|
-
"@keyframes
|
|
24
|
+
"@keyframes pulse_ix66r{0%,to{opacity:1}50%{opacity:.4}}.___SDonutContainer_ix66r_gg_.__loading_ix66r_gg_,.___SLineGauge_ix66r_gg_.__loading_ix66r_gg_,.___STrendBar_ix66r_gg_.__loading_ix66r_gg_,.___STrendLine_ix66r_gg_.__loading_ix66r_gg_{animation-name:pulse_ix66r;animation-iteration-count:infinite;animation-timing-function:ease-in-out;animation-duration:1.6s;will-change:opacity}",
|
|
25
25
|
/*__inner_css_end__*/
|
|
26
|
-
"
|
|
26
|
+
"ix66r_gg_"
|
|
27
27
|
), /*__reshadow_css_end__*/
|
|
28
28
|
{
|
|
29
|
-
"__SLineGauge": "
|
|
30
|
-
"_loading": "
|
|
31
|
-
"__SDonutContainer": "
|
|
32
|
-
"__STrendLine": "
|
|
33
|
-
"__STrendBar": "
|
|
34
|
-
"@pulse": "
|
|
29
|
+
"__SLineGauge": "___SLineGauge_ix66r_gg_",
|
|
30
|
+
"_loading": "__loading_ix66r_gg_",
|
|
31
|
+
"__SDonutContainer": "___SDonutContainer_ix66r_gg_",
|
|
32
|
+
"__STrendLine": "___STrendLine_ix66r_gg_",
|
|
33
|
+
"__STrendBar": "___STrendBar_ix66r_gg_",
|
|
34
|
+
"@pulse": "pulse_ix66r"
|
|
35
35
|
})
|
|
36
36
|
);
|
|
37
37
|
var TrendBarRoot = /* @__PURE__ */ function(_Trend) {
|
|
@@ -22,17 +22,17 @@ var style = (
|
|
|
22
22
|
/*__reshadow_css_start__*/
|
|
23
23
|
(sstyled.insert(
|
|
24
24
|
/*__inner_css_start__*/
|
|
25
|
-
"@keyframes
|
|
25
|
+
"@keyframes pulse_ix66r{0%,to{opacity:1}50%{opacity:.4}}.___SDonutContainer_ix66r_gg_.__loading_ix66r_gg_,.___SLineGauge_ix66r_gg_.__loading_ix66r_gg_,.___STrendBar_ix66r_gg_.__loading_ix66r_gg_,.___STrendLine_ix66r_gg_.__loading_ix66r_gg_{animation-name:pulse_ix66r;animation-iteration-count:infinite;animation-timing-function:ease-in-out;animation-duration:1.6s;will-change:opacity}",
|
|
26
26
|
/*__inner_css_end__*/
|
|
27
|
-
"
|
|
27
|
+
"ix66r_gg_"
|
|
28
28
|
), /*__reshadow_css_end__*/
|
|
29
29
|
{
|
|
30
|
-
"__SLineGauge": "
|
|
31
|
-
"_loading": "
|
|
32
|
-
"__SDonutContainer": "
|
|
33
|
-
"__STrendLine": "
|
|
34
|
-
"__STrendBar": "
|
|
35
|
-
"@pulse": "
|
|
30
|
+
"__SLineGauge": "___SLineGauge_ix66r_gg_",
|
|
31
|
+
"_loading": "__loading_ix66r_gg_",
|
|
32
|
+
"__SDonutContainer": "___SDonutContainer_ix66r_gg_",
|
|
33
|
+
"__STrendLine": "___STrendLine_ix66r_gg_",
|
|
34
|
+
"__STrendBar": "___STrendBar_ix66r_gg_",
|
|
35
|
+
"@pulse": "pulse_ix66r"
|
|
36
36
|
})
|
|
37
37
|
);
|
|
38
38
|
var TrendLineRoot = /* @__PURE__ */ function(_Trend) {
|
|
@@ -12,6 +12,11 @@ var ScoreDonutUtils = /* @__PURE__ */ function() {
|
|
|
12
12
|
this.value = value;
|
|
13
13
|
}
|
|
14
14
|
return _createClass(ScoreDonutUtils2, [{
|
|
15
|
+
key: "hasDivider",
|
|
16
|
+
get: function get() {
|
|
17
|
+
return ![0, 100].includes(this.value);
|
|
18
|
+
}
|
|
19
|
+
}, {
|
|
15
20
|
key: "viewBox",
|
|
16
21
|
get: function get() {
|
|
17
22
|
return this.isSemiDonut ? "0 0 24 12" : "0 0 24 24";
|
|
@@ -56,6 +61,8 @@ var ScoreDonutUtils = /* @__PURE__ */ function() {
|
|
|
56
61
|
}, {
|
|
57
62
|
key: "strokeDashOffsetBase",
|
|
58
63
|
get: function get() {
|
|
64
|
+
var hasDivider = this.hasDivider;
|
|
65
|
+
if (!hasDivider) return 0;
|
|
59
66
|
var valueStroke = this.valueStrokeDashArray;
|
|
60
67
|
var offsetPoint = this.offsetPoint;
|
|
61
68
|
return -1 * (valueStroke + (this.isSemiDonut ? offsetPoint : 0));
|
|
@@ -3,6 +3,7 @@ export declare class ScoreDonutUtils {
|
|
|
3
3
|
private readonly value;
|
|
4
4
|
readonly radius: number;
|
|
5
5
|
constructor(value: number, isSemiDonut: boolean);
|
|
6
|
+
get hasDivider(): boolean;
|
|
6
7
|
get viewBox(): "0 0 24 12" | "0 0 24 24";
|
|
7
8
|
get strokeWidth(): 6 | 4;
|
|
8
9
|
get baseStrokeDashArray(): number;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@semcore/mini-chart",
|
|
3
3
|
"description": "Semrush MiniChart Component",
|
|
4
|
-
"version": "16.0.
|
|
4
|
+
"version": "16.0.3-prerelease.0",
|
|
5
5
|
"main": "lib/cjs/index.js",
|
|
6
6
|
"module": "lib/es6/index.js",
|
|
7
7
|
"typings": "lib/types/index.d.ts",
|
|
@@ -14,8 +14,8 @@
|
|
|
14
14
|
"types": "./lib/types/index.d.ts"
|
|
15
15
|
},
|
|
16
16
|
"peerDependencies": {
|
|
17
|
-
"@semcore/base-components": "^16.0
|
|
18
|
-
"@semcore/flex-box": "^16.0.
|
|
17
|
+
"@semcore/base-components": "^16.1.0-prerelease.0",
|
|
18
|
+
"@semcore/flex-box": "^16.0.3-prerelease.0"
|
|
19
19
|
},
|
|
20
20
|
"repository": {
|
|
21
21
|
"type": "git",
|
|
@@ -23,8 +23,8 @@
|
|
|
23
23
|
"directory": "semcore/mini-chart"
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|
|
26
|
-
"@semcore/
|
|
27
|
-
"@semcore/
|
|
26
|
+
"@semcore/testing-utils": "1.0.0",
|
|
27
|
+
"@semcore/core": "16.0.1-prerelease.0"
|
|
28
28
|
},
|
|
29
29
|
"scripts": {
|
|
30
30
|
"build": "pnpm semcore-builder --source=ts && pnpm vite build"
|