@semcore/mini-chart 0.29.4-prerelease.0 → 16.0.0-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 +6 -0
- package/lib/cjs/component/score/Donut.js +14 -16
- package/lib/cjs/component/score/Donut.js.map +1 -1
- package/lib/cjs/component/score/Line.js +21 -23
- package/lib/cjs/component/score/Line.js.map +1 -1
- package/lib/cjs/component/score/Line.types.js.map +1 -1
- package/lib/cjs/component/trend/Bar.js +12 -14
- package/lib/cjs/component/trend/Bar.js.map +1 -1
- package/lib/cjs/component/trend/Line.js +13 -15
- package/lib/cjs/component/trend/Line.js.map +1 -1
- package/lib/es6/component/score/Donut.js +13 -13
- package/lib/es6/component/score/Donut.js.map +1 -1
- package/lib/es6/component/score/Line.js +21 -21
- package/lib/es6/component/score/Line.js.map +1 -1
- package/lib/es6/component/score/Line.types.js.map +1 -1
- package/lib/es6/component/trend/Bar.js +11 -11
- package/lib/es6/component/trend/Bar.js.map +1 -1
- package/lib/es6/component/trend/Line.js +12 -12
- package/lib/es6/component/trend/Line.js.map +1 -1
- package/lib/esm/component/score/Donut.mjs +14 -15
- package/lib/esm/component/score/Line.mjs +25 -26
- package/lib/esm/component/trend/Bar.mjs +12 -13
- package/lib/esm/component/trend/Line.mjs +13 -14
- package/lib/types/component/score/Donut.d.ts +1 -1
- package/lib/types/component/score/Line.types.d.ts +2 -2
- package/lib/types/component/trend/Bar.d.ts +1 -1
- package/lib/types/component/trend/Line.d.ts +1 -1
- package/package.json +3 -8
|
@@ -4,35 +4,35 @@ import _createClass from "@babel/runtime/helpers/createClass";
|
|
|
4
4
|
import _inherits from "@babel/runtime/helpers/inherits";
|
|
5
5
|
import _createSuper from "@babel/runtime/helpers/createSuper";
|
|
6
6
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
7
|
-
import { sstyled as _sstyled } from "@semcore/
|
|
7
|
+
import { sstyled as _sstyled } from "@semcore/core";
|
|
8
8
|
import { assignProps as _assignProps3 } from "@semcore/core";
|
|
9
9
|
import { assignProps as _assignProps2 } from "@semcore/core";
|
|
10
10
|
import { assignProps as _assignProps } from "@semcore/core";
|
|
11
11
|
import React from 'react';
|
|
12
|
-
import createComponent,
|
|
12
|
+
import { createComponent, Component, Root, sstyled } from '@semcore/core';
|
|
13
13
|
import { Box, Flex } from '@semcore/flex-box';
|
|
14
|
-
import resolveColorEnhance from '@semcore/
|
|
14
|
+
import resolveColorEnhance from '@semcore/core/lib/utils/enhances/resolveColorEnhance';
|
|
15
15
|
/*!__reshadow-styles__:"./line.shadow.css"*/
|
|
16
|
-
var style = ( /*__reshadow_css_start__*/_sstyled.insert( /*__inner_css_start__*/"@keyframes
|
|
16
|
+
var style = ( /*__reshadow_css_start__*/_sstyled.insert( /*__inner_css_start__*/"@keyframes pulse_2vm7d{0%,to{opacity:1}50%{opacity:.4}}@keyframes move-line_2vm7d{0%{transform:translateX(0)}to{transform:translateX(100%)}}.___SDonutContainer_2vm7d_gg_.__loading_2vm7d_gg_,.___SLineGauge_2vm7d_gg_.__loading_2vm7d_gg_,.___STrendBar_2vm7d_gg_.__loading_2vm7d_gg_,.___STrendLine_2vm7d_gg_.__loading_2vm7d_gg_{animation-name:pulse_2vm7d;animation-iteration-count:infinite;animation-timing-function:ease-in-out;animation-duration:1.6s;will-change:opacity}.___SLineGauge_2vm7d_gg_{height:8px;background-color:var(--base-bg-color_2vm7d, var(--intergalactic-chart-grid-bar-chart-base-bg, #e0e1e9));border-radius:var(--intergalactic-chart-rounded, 2px);overflow:hidden;position:relative}.___SLineValue_2vm7d_gg_{height:8px;border-radius:var(--intergalactic-chart-rounded, 2px)0 0 var(--intergalactic-chart-rounded, 2px)}.___SLineValue_2vm7d_gg_.__percent_2vm7d_gg_{width:var(--percent_2vm7d)}.___SLineSegmentItem_2vm7d_gg_.__color_2vm7d_gg_,.___SLineValue_2vm7d_gg_.__color_2vm7d_gg_{background-color:var(--color_2vm7d, var(--intergalactic-chart-palette-order-1, #2bb3ff))}.___SLineGauge_2vm7d_gg_.__segments_2vm7d_gg_{border-radius:var(--intergalactic-progress-bar-rounded, 6px)}.___SAnimationLine_2vm7d_gg_,.___SLineGaugeSegment_2vm7d_gg_{position:absolute;top:0;left:0;right:0;bottom:0}.___SLineSegmentItem_2vm7d_gg_:last-child{margin-right:0;border-right:none}.___SLineSegmentItem_2vm7d_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_2vm7d_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_2vm7d;animation-duration:.5s;animation-timing-function:ease-in-out;animation-fill-mode:forwards}", /*__inner_css_end__*/"2vm7d_gg_"),
|
|
17
17
|
/*__reshadow_css_end__*/
|
|
18
18
|
{
|
|
19
|
-
"__SLineGauge": "
|
|
20
|
-
"_loading": "
|
|
21
|
-
"__SDonutContainer": "
|
|
22
|
-
"__STrendLine": "
|
|
23
|
-
"__STrendBar": "
|
|
24
|
-
"@pulse": "
|
|
25
|
-
"--base-bg-color": "--base-bg-
|
|
26
|
-
"__SLineValue": "
|
|
27
|
-
"_percent": "
|
|
28
|
-
"--percent": "--
|
|
29
|
-
"_color": "
|
|
30
|
-
"__SLineSegmentItem": "
|
|
31
|
-
"--color": "--
|
|
32
|
-
"_segments": "
|
|
33
|
-
"__SLineGaugeSegment": "
|
|
34
|
-
"__SAnimationLine": "
|
|
35
|
-
"@move-line": "move-
|
|
19
|
+
"__SLineGauge": "___SLineGauge_2vm7d_gg_",
|
|
20
|
+
"_loading": "__loading_2vm7d_gg_",
|
|
21
|
+
"__SDonutContainer": "___SDonutContainer_2vm7d_gg_",
|
|
22
|
+
"__STrendLine": "___STrendLine_2vm7d_gg_",
|
|
23
|
+
"__STrendBar": "___STrendBar_2vm7d_gg_",
|
|
24
|
+
"@pulse": "pulse_2vm7d",
|
|
25
|
+
"--base-bg-color": "--base-bg-color_2vm7d",
|
|
26
|
+
"__SLineValue": "___SLineValue_2vm7d_gg_",
|
|
27
|
+
"_percent": "__percent_2vm7d_gg_",
|
|
28
|
+
"--percent": "--percent_2vm7d",
|
|
29
|
+
"_color": "__color_2vm7d_gg_",
|
|
30
|
+
"__SLineSegmentItem": "___SLineSegmentItem_2vm7d_gg_",
|
|
31
|
+
"--color": "--color_2vm7d",
|
|
32
|
+
"_segments": "__segments_2vm7d_gg_",
|
|
33
|
+
"__SLineGaugeSegment": "___SLineGaugeSegment_2vm7d_gg_",
|
|
34
|
+
"__SAnimationLine": "___SAnimationLine_2vm7d_gg_",
|
|
35
|
+
"@move-line": "move-line_2vm7d"
|
|
36
36
|
});
|
|
37
37
|
var LineRoot = /*#__PURE__*/function (_Component) {
|
|
38
38
|
_inherits(LineRoot, _Component);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Line.js","names":["React","createComponent","Component","Root","sstyled","Box","Flex","resolveColorEnhance","style","_sstyled","insert","LineRoot","_Component","_inherits","_super","_createSuper","_classCallCheck","apply","arguments","_createClass","key","value","getSegmentProps","segmentProps","_this$asProps","asProps","children","resolveColor","sum","Children","forEach","child","isValidElement","props","width","w","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 React from 'react';\nimport createComponent,
|
|
1
|
+
{"version":3,"file":"Line.js","names":["React","createComponent","Component","Root","sstyled","Box","Flex","resolveColorEnhance","style","_sstyled","insert","LineRoot","_Component","_inherits","_super","_createSuper","_classCallCheck","apply","arguments","_createClass","key","value","getSegmentProps","segmentProps","_this$asProps","asProps","children","resolveColor","sum","Children","forEach","child","isValidElement","props","width","w","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 React from 'react';\nimport { createComponent, Component, Root, sstyled } from '@semcore/core';\nimport { Box, Flex } from '@semcore/flex-box';\nimport resolveColorEnhance from '@semcore/core/lib/utils/enhances/resolveColorEnhance';\n\nimport style from './line.shadow.css';\nimport {\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,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,eAAe,EAAEC,SAAS,EAAEC,IAAI,EAAEC,OAAO,QAAQ,eAAe;AACzE,SAASC,GAAG,EAAEC,IAAI,QAAQ,mBAAmB;AAC7C,OAAOC,mBAAmB,MAAM,sDAAsD;AAAC;AAAA,IAAAC,KAAA,+BAAAC,QAAA,CAAAC,MAAA;AAAA;AAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;AAAA;AAAA,IAUjFC,QAAQ,0BAAAC,UAAA;EAAAC,SAAA,CAAAF,QAAA,EAAAC,UAAA;EAAA,IA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IGH,KAAK;AAAA2D,eAAA,CAJhBxD,QAAQ,kBAMU;EACpBwC,OAAO,EAAE;AACX,CAAC;AAqFH,SAASiB,OAAOA,CAACnC,KAAwB,EAAE;EAAA,IAAAoC,KAAA,GAAAC,YAAA;IAAAC,KAAA;EACzC,IAAQxB,MAAM,GAAKd,KAAK,CAAhBc,MAAM;EACd,IAAMF,gBAAgB,GAE2BxC,GAAG;EAApD,OAAAkE,KAAA,GAAOnE,OAAO,CAAC2C,MAAM,CAAC,eAAC/C,KAAA,CAAAsD,aAAA,CAACT,gBAAgB,EAAA0B,KAAA,CAAAhB,EAAA,qBAAAC,aAAA,KAAAgB,aAAA,KAAAH,KAAA,IAAgB;AAC1D;AACAD,OAAO,CAACK,WAAW,GAAG,SAAS;AAE/B,OAAO,IAAMC,SAA6B,GAAGzE,eAAe,CAACU,QAAQ,EAAE;EACrEyD,OAAO,EAAPA;AACF,CAAC,CAAC;AAEFM,SAAS,CAACD,WAAW,GAAG,qBAAqB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Line.types.js","names":[],"sources":["../../../../src/component/score/Line.types.ts"],"sourcesContent":["import { Intergalactic, ComponentType } from '@semcore/
|
|
1
|
+
{"version":3,"file":"Line.types.js","names":[],"sources":["../../../../src/component/score/Line.types.ts"],"sourcesContent":["import { Intergalactic, ComponentType } from '@semcore/core';\nimport { CommonScoreProps } from './Score';\nimport React from 'react';\nimport { BoxProps, Box } from '@semcore/flex-box';\nimport resolveColorEnhance from '@semcore/core/lib/utils/enhances/resolveColorEnhance';\n\ntype Enumerate<N extends number, Acc extends number[] = []> = Acc['length'] extends N\n ? Acc[number]\n : Enumerate<N, [...Acc, Acc['length']]>;\n\ntype Range<F extends number, T extends number> = Exclude<Enumerate<T>, Enumerate<F>>;\n\nexport type SegmentColor = `chart-palette-order-${Range<1, 24>}`;\n\nexport type SegmentProps = {\n value: number;\n /**\n * Color of value\n */\n color: SegmentColor;\n};\n\ntype SegmentComponent = React.FC<SegmentProps>;\n\nexport type InnerSegmentProps = SegmentProps & {\n styles: React.DetailedHTMLProps<React.StyleHTMLAttributes<HTMLStyleElement>, HTMLStyleElement>;\n};\n\ntype ValuedScoreProps = {\n /**\n * Value of score (in percents from 0 to 100) or count of selected segments (for Line with segments)\n */\n value: number;\n /**\n * Color of value\n */\n color?: SegmentColor;\n /**\n * Count of line segments\n */\n segments?: number;\n /**\n * We don't accept children in this way\n */\n children?: never;\n};\n\ntype CustomRenderScoreProps = {\n children: SegmentComponent[];\n};\n\nexport type ScoreLineGaugeProps = BoxProps &\n Intergalactic.InternalTypings.EfficientOmit<CommonScoreProps, 'value' | 'color'> &\n (ValuedScoreProps | CustomRenderScoreProps);\n\nexport type Enhances = {\n resolveColor: ReturnType<typeof resolveColorEnhance>;\n};\n\nexport type ScoreLineComponent = ComponentType<ScoreLineGaugeProps, {}, {}, Enhances> & {\n Segment: Intergalactic.Component<typeof Box, SegmentProps>;\n};\n"],"mappings":""}
|
|
@@ -5,25 +5,25 @@ import _createClass from "@babel/runtime/helpers/createClass";
|
|
|
5
5
|
import _inherits from "@babel/runtime/helpers/inherits";
|
|
6
6
|
import _createSuper from "@babel/runtime/helpers/createSuper";
|
|
7
7
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
8
|
-
import { sstyled as _sstyled } from "@semcore/
|
|
8
|
+
import { sstyled as _sstyled } from "@semcore/core";
|
|
9
9
|
import { assignProps as _assignProps } from "@semcore/core";
|
|
10
10
|
import React from 'react';
|
|
11
|
-
import createComponent,
|
|
12
|
-
import resolveColorEnhance from '@semcore/
|
|
11
|
+
import { createComponent, assignProps, Root, sstyled } from '@semcore/core';
|
|
12
|
+
import resolveColorEnhance from '@semcore/core/lib/utils/enhances/resolveColorEnhance';
|
|
13
13
|
import { Trend } from './Trend';
|
|
14
14
|
import { Box } from '@semcore/flex-box';
|
|
15
15
|
/*!__reshadow-styles__:"../skeleton/skeleton.shadow.css"*/
|
|
16
|
-
var style = ( /*__reshadow_css_start__*/_sstyled.insert( /*__inner_css_start__*/"@keyframes
|
|
16
|
+
var style = ( /*__reshadow_css_start__*/_sstyled.insert( /*__inner_css_start__*/"@keyframes pulse_7jer1{0%,to{opacity:1}50%{opacity:.4}}.___SDonutContainer_7jer1_gg_.__loading_7jer1_gg_,.___SLineGauge_7jer1_gg_.__loading_7jer1_gg_,.___STrendBar_7jer1_gg_.__loading_7jer1_gg_,.___STrendLine_7jer1_gg_.__loading_7jer1_gg_{animation-name:pulse_7jer1;animation-iteration-count:infinite;animation-timing-function:ease-in-out;animation-duration:1.6s;will-change:opacity}", /*__inner_css_end__*/"7jer1_gg_"),
|
|
17
17
|
/*__reshadow_css_end__*/
|
|
18
18
|
{
|
|
19
|
-
"__SLineGauge": "
|
|
20
|
-
"_loading": "
|
|
21
|
-
"__SDonutContainer": "
|
|
22
|
-
"__STrendLine": "
|
|
23
|
-
"__STrendBar": "
|
|
24
|
-
"@pulse": "
|
|
19
|
+
"__SLineGauge": "___SLineGauge_7jer1_gg_",
|
|
20
|
+
"_loading": "__loading_7jer1_gg_",
|
|
21
|
+
"__SDonutContainer": "___SDonutContainer_7jer1_gg_",
|
|
22
|
+
"__STrendLine": "___STrendLine_7jer1_gg_",
|
|
23
|
+
"__STrendBar": "___STrendBar_7jer1_gg_",
|
|
24
|
+
"@pulse": "pulse_7jer1"
|
|
25
25
|
});
|
|
26
|
-
import { extractAriaProps } from '@semcore/
|
|
26
|
+
import { extractAriaProps } from '@semcore/core/lib/utils/ariaProps';
|
|
27
27
|
var TrendBarRoot = /*#__PURE__*/function (_Trend) {
|
|
28
28
|
_inherits(TrendBarRoot, _Trend);
|
|
29
29
|
var _super = _createSuper(TrendBarRoot);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Bar.js","names":["React","createComponent","assignProps","Root","sstyled","resolveColorEnhance","Trend","Box","style","_sstyled","insert","extractAriaProps","TrendBarRoot","_Trend","_inherits","_super","_createSuper","_classCallCheck","apply","arguments","_createClass","key","get","value","_this$asProps","asProps","data","loading","defaultData","render","_ref","_ref2","_this","STrendBar","_this$asProps2","styles","resolveColor","isHistogram","animate","step","defaultWidth","length","_extractAriaProps","__excludeProps","extractedAriaProps","createElement","cn","_objectSpread","_assignProps","containerRef","concat","_toConsumableArray","svgWidth","svgHeight","map","barItem","index","color","x","y","defaultHeight","width","height","fill","attributeName","values","dur","_defineProperty","TrendBar","displayName","TrendHistogram","enhancements","wrapperProps","props"],"sources":["../../../../src/component/trend/Bar.tsx"],"sourcesContent":["import React from 'react';\nimport createComponent,
|
|
1
|
+
{"version":3,"file":"Bar.js","names":["React","createComponent","assignProps","Root","sstyled","resolveColorEnhance","Trend","Box","style","_sstyled","insert","extractAriaProps","TrendBarRoot","_Trend","_inherits","_super","_createSuper","_classCallCheck","apply","arguments","_createClass","key","get","value","_this$asProps","asProps","data","loading","defaultData","render","_ref","_ref2","_this","STrendBar","_this$asProps2","styles","resolveColor","isHistogram","animate","step","defaultWidth","length","_extractAriaProps","__excludeProps","extractedAriaProps","createElement","cn","_objectSpread","_assignProps","containerRef","concat","_toConsumableArray","svgWidth","svgHeight","map","barItem","index","color","x","y","defaultHeight","width","height","fill","attributeName","values","dur","_defineProperty","TrendBar","displayName","TrendHistogram","enhancements","wrapperProps","props"],"sources":["../../../../src/component/trend/Bar.tsx"],"sourcesContent":["import React from 'react';\nimport { createComponent, ComponentType, assignProps, Root, sstyled } from '@semcore/core';\nimport resolveColorEnhance from '@semcore/core/lib/utils/enhances/resolveColorEnhance';\nimport { Trend, CommonTrendProps } from './Trend';\nimport { Box } from '@semcore/flex-box';\n\nimport style from '../skeleton/skeleton.shadow.css';\nimport { extractAriaProps } from '@semcore/core/lib/utils/ariaProps';\n\ntype BarItem = {\n /**\n * Value\n */\n value: number;\n /**\n * Color of value\n */\n color?: string;\n};\n\nexport type TrendBarProps = CommonTrendProps & {\n /**\n * Data to bar chart\n */\n data: BarItem[];\n};\n\ntype Enhances = {\n resolveColor: ReturnType<typeof resolveColorEnhance>;\n isHistogram?: true;\n};\n\nclass TrendBarRoot extends Trend<TrendBarProps, typeof TrendBarRoot.enhance> {\n static enhance = [resolveColorEnhance()] as const;\n\n static style = style;\n\n static defaultProps = {\n animate: true,\n };\n\n get defaultData(): BarItem[] {\n return [{ value: 20 }, { value: 80 }, { value: 45 }, { value: 10 }];\n }\n\n get data(): BarItem[] {\n const { data, loading } = this.asProps;\n\n if (loading) {\n return this.defaultData;\n }\n\n return data;\n }\n\n render() {\n const STrendBar = Root;\n const { styles, resolveColor, isHistogram, animate, loading } = this.asProps;\n const step = this.defaultWidth / this.data.length;\n const { __excludeProps, extractedAriaProps } = extractAriaProps(this.asProps);\n\n return sstyled(styles)(\n <STrendBar render={Box} ref={this.containerRef} __excludeProps={['data', ...__excludeProps]}>\n <svg\n width='100%'\n height='100%'\n viewBox={`0 0 ${this.svgWidth} ${this.svgHeight}`}\n role='img'\n {...extractedAriaProps}\n >\n {this.data.map((barItem, index) => {\n let color = resolveColor('chart-palette-order-other-data');\n\n if (barItem.color) {\n color = resolveColor(barItem.color);\n }\n\n return (\n <rect\n key={index}\n x={step * index}\n y={this.defaultHeight - barItem.value}\n width={isHistogram ? step : step * 0.8}\n height={barItem.value}\n fill={color}\n >\n {animate && !loading && (\n <animate\n attributeName={'y'}\n values={`${this.defaultHeight};${this.defaultHeight - barItem.value}`}\n dur={'500ms'}\n />\n )}\n </rect>\n );\n })}\n </svg>\n </STrendBar>,\n );\n }\n}\n\nexport const TrendBar: ComponentType<TrendBarProps, {}, {}, Enhances> =\n createComponent(TrendBarRoot);\n\nTrendBar.displayName = 'MiniChart.TrendBar';\n\nexport const TrendHistogram: ComponentType<TrendBarProps, {}, {}, Enhances> = createComponent(\n TrendBarRoot,\n {},\n {\n enhancements: [\n () => {\n return {\n wrapperProps: (props: TrendBarProps) => {\n return assignProps(props, { isHistogram: true });\n },\n };\n },\n ],\n },\n);\n\nTrendBar.displayName = 'MiniChart.TrendHistogram';\n"],"mappings":";;;;;;;;;AA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|
@@ -5,26 +5,26 @@ import _createClass from "@babel/runtime/helpers/createClass";
|
|
|
5
5
|
import _inherits from "@babel/runtime/helpers/inherits";
|
|
6
6
|
import _createSuper from "@babel/runtime/helpers/createSuper";
|
|
7
7
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
8
|
-
import { sstyled as _sstyled } from "@semcore/
|
|
8
|
+
import { sstyled as _sstyled } from "@semcore/core";
|
|
9
9
|
import { assignProps as _assignProps } from "@semcore/core";
|
|
10
10
|
import React from 'react';
|
|
11
|
-
import createComponent,
|
|
12
|
-
import resolveColorEnhance from '@semcore/
|
|
13
|
-
import uniqueIDEnhancement from '@semcore/
|
|
11
|
+
import { createComponent, assignProps, Root, sstyled } from '@semcore/core';
|
|
12
|
+
import resolveColorEnhance from '@semcore/core/lib/utils/enhances/resolveColorEnhance';
|
|
13
|
+
import uniqueIDEnhancement from '@semcore/core/lib/utils/uniqueID';
|
|
14
14
|
import { Trend } from './Trend';
|
|
15
15
|
import { Box } from '@semcore/flex-box';
|
|
16
16
|
/*!__reshadow-styles__:"../skeleton/skeleton.shadow.css"*/
|
|
17
|
-
var style = ( /*__reshadow_css_start__*/_sstyled.insert( /*__inner_css_start__*/"@keyframes
|
|
17
|
+
var style = ( /*__reshadow_css_start__*/_sstyled.insert( /*__inner_css_start__*/"@keyframes pulse_7jer1{0%,to{opacity:1}50%{opacity:.4}}.___SDonutContainer_7jer1_gg_.__loading_7jer1_gg_,.___SLineGauge_7jer1_gg_.__loading_7jer1_gg_,.___STrendBar_7jer1_gg_.__loading_7jer1_gg_,.___STrendLine_7jer1_gg_.__loading_7jer1_gg_{animation-name:pulse_7jer1;animation-iteration-count:infinite;animation-timing-function:ease-in-out;animation-duration:1.6s;will-change:opacity}", /*__inner_css_end__*/"7jer1_gg_"),
|
|
18
18
|
/*__reshadow_css_end__*/
|
|
19
19
|
{
|
|
20
|
-
"__SLineGauge": "
|
|
21
|
-
"_loading": "
|
|
22
|
-
"__SDonutContainer": "
|
|
23
|
-
"__STrendLine": "
|
|
24
|
-
"__STrendBar": "
|
|
25
|
-
"@pulse": "
|
|
20
|
+
"__SLineGauge": "___SLineGauge_7jer1_gg_",
|
|
21
|
+
"_loading": "__loading_7jer1_gg_",
|
|
22
|
+
"__SDonutContainer": "___SDonutContainer_7jer1_gg_",
|
|
23
|
+
"__STrendLine": "___STrendLine_7jer1_gg_",
|
|
24
|
+
"__STrendBar": "___STrendBar_7jer1_gg_",
|
|
25
|
+
"@pulse": "pulse_7jer1"
|
|
26
26
|
});
|
|
27
|
-
import { extractAriaProps } from '@semcore/
|
|
27
|
+
import { extractAriaProps } from '@semcore/core/lib/utils/ariaProps';
|
|
28
28
|
var TrendLineRoot = /*#__PURE__*/function (_Trend) {
|
|
29
29
|
_inherits(TrendLineRoot, _Trend);
|
|
30
30
|
var _super = _createSuper(TrendLineRoot);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Line.js","names":["React","createComponent","assignProps","Root","sstyled","resolveColorEnhance","uniqueIDEnhancement","Trend","Box","style","_sstyled","insert","extractAriaProps","TrendLineRoot","_Trend","_inherits","_super","_createSuper","_classCallCheck","apply","arguments","_createClass","key","get","_this$asProps$lastPoi","asProps","lastPointRadius","_this$asProps","data","loading","defaultData","lastPointColor","defaultWidth","defaultHeight","_this$asProps2","resolveColor","_this$asProps2$color","color","value","render","_ref","_ref2","STrendLine","_this$asProps3","uid","withArea","animate","styles","points","length","step","i","push","concat","_extractAriaProps","__excludeProps","extractedAriaProps","createElement","cn","_objectSpread","_assignProps","containerRef","_toConsumableArray","svgWidth","svgHeight","join","_defineProperty","TrendLine","displayName","TrendArea","enhancements","wrapperProps","props"],"sources":["../../../../src/component/trend/Line.tsx"],"sourcesContent":["import React from 'react';\nimport createComponent, { ComponentType, assignProps, Root, sstyled } from '@semcore/core';\nimport resolveColorEnhance from '@semcore/utils/lib/enhances/resolveColorEnhance';\nimport uniqueIDEnhancement from '@semcore/utils/lib/uniqueID';\nimport { Trend, CommonTrendProps } from './Trend';\nimport { Box } from '@semcore/flex-box';\n\nimport style from '../skeleton/skeleton.shadow.css';\nimport { extractAriaProps } from '@semcore/utils/lib/ariaProps';\n\nexport type TrendLineProps = CommonTrendProps & {\n /**\n * List of values\n */\n data: number[];\n\n /**\n * Color of line\n */\n color?: string;\n\n /**\n * Color of last point in chart\n */\n lastPointColor?: string;\n\n /**\n * Radius for last point item\n */\n lastPointRadius?: number;\n};\n\ntype Enhances = {\n uid: string;\n resolveColor: ReturnType<typeof resolveColorEnhance>;\n withArea?: true;\n};\n\nclass TrendLineRoot extends Trend<TrendLineProps, typeof TrendLineRoot.enhance> {\n static enhance = [resolveColorEnhance(), uniqueIDEnhancement()] as const;\n\n static style = style;\n\n static defaultProps = {\n animate: true,\n };\n\n get defaultData(): number[] {\n return [15, 70, 20, 85, 20];\n }\n\n get lastPointRadius(): number {\n return this.asProps.lastPointRadius ?? 6;\n }\n\n get data(): number[] {\n const { data, loading } = this.asProps;\n\n if (loading) {\n return this.defaultData;\n }\n\n return data;\n }\n\n override get svgWidth(): number {\n return this.asProps.lastPointColor\n ? this.defaultWidth + this.lastPointRadius\n : this.defaultWidth;\n }\n\n override get svgHeight(): number {\n return this.asProps.lastPointColor\n ? this.defaultHeight + this.lastPointRadius\n : this.defaultHeight;\n }\n\n get color() {\n const { resolveColor, color = 'chart-palette-order-1', loading } = this.asProps;\n\n if (loading) {\n return resolveColor('skeleton-bg');\n }\n\n return resolveColor(color);\n }\n\n render() {\n const STrendLine = Root;\n const { uid, withArea, animate, lastPointColor, resolveColor, loading, styles } = this.asProps;\n\n const points: string[] = [];\n const length = this.data.length;\n const step = this.defaultWidth / (length - 1);\n\n for (let i = 0; i < length; i++) {\n points.push(`${step * i},${this.defaultHeight - this.data[i]}`);\n }\n const { __excludeProps, extractedAriaProps } = extractAriaProps(this.asProps);\n\n return sstyled(styles)(\n <STrendLine render={Box} ref={this.containerRef} __excludeProps={['data', ...__excludeProps]}>\n <svg\n width='100%'\n height='100%'\n viewBox={`0 0 ${this.svgWidth} ${this.svgHeight}`}\n role='img'\n {...extractedAriaProps}\n >\n <polyline\n points={points.join(' ')}\n stroke={this.color}\n strokeWidth='4'\n fill={'none'}\n clipPath={`url(#${uid})`}\n />\n {withArea && (\n <polyline\n points={`0,${this.defaultHeight} ${points.join(' ')} ${this.defaultWidth},${\n this.defaultHeight\n }`}\n fill={this.color}\n fillOpacity={0.2}\n clipPath={`url(#${uid})`}\n />\n )}\n {lastPointColor && !loading && (\n <circle\n cx={step * (length - 1)}\n cy={this.defaultHeight - this.data[length - 1]}\n r={this.lastPointRadius}\n fill={resolveColor(lastPointColor)}\n stroke={resolveColor('chart-grid-border')}\n strokeWidth={4}\n clipPath={`url(#${uid})`}\n />\n )}\n\n {animate && !loading && (\n <clipPath id={uid}>\n <rect x='0' y='0' width='100%' height='100%' fill={'black'}>\n <animate dur='500ms' attributeName='width' values='0;100%' />\n </rect>\n </clipPath>\n )}\n </svg>\n </STrendLine>,\n );\n }\n}\n\nexport const TrendLine: ComponentType<TrendLineProps, {}, {}, Enhances> =\n createComponent(TrendLineRoot);\n\nTrendLine.displayName = 'MiniChart.TrendLine';\n\nexport const TrendArea: ComponentType<TrendLineProps, {}, {}, Enhances> = createComponent(\n TrendLineRoot,\n {},\n {\n enhancements: [\n () => {\n return {\n wrapperProps: (props: TrendLineProps) => {\n return assignProps(props, { withArea: true });\n },\n };\n },\n ],\n },\n);\n\nTrendArea.displayName = 'MiniChart.TrendArea';\n"],"mappings":";;;;;;;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,eAAe,IAAmBC,WAAW,EAAEC,IAAI,EAAEC,OAAO,QAAQ,eAAe;AAC1F,OAAOC,mBAAmB,MAAM,iDAAiD;AACjF,OAAOC,mBAAmB,MAAM,6BAA6B;AAC7D,SAASC,KAAK,QAA0B,SAAS;AACjD,SAASC,GAAG,QAAQ,mBAAmB;AAAC;AAAA,IAAAC,KAAA,+BAAAC,QAAA,CAAAC,MA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AAG,qBAAqB;AAE7C,OAAO,IAAMC,SAA0D,GAAGpE,eAAe,CACvFY,aAAa,EACb,CAAC,CAAC,EACF;EACEyD,YAAY,EAAE,CACZ,YAAM;IACJ,OAAO;MACLC,YAAY,EAAE,SAAAA,aAACC,KAAqB,EAAK;QACvC,OAAOtE,WAAW,CAACsE,KAAK,EAAE;UAAE3B,QAAQ,EAAE;QAAK,CAAC,CAAC;MAC/C;IACF,CAAC;EACH,CAAC;AAEL,CAAC,CACF;AAEDwB,SAAS,CAACD,WAAW,GAAG,qBAAqB"}
|
|
1
|
+
{"version":3,"file":"Line.js","names":["React","createComponent","assignProps","Root","sstyled","resolveColorEnhance","uniqueIDEnhancement","Trend","Box","style","_sstyled","insert","extractAriaProps","TrendLineRoot","_Trend","_inherits","_super","_createSuper","_classCallCheck","apply","arguments","_createClass","key","get","_this$asProps$lastPoi","asProps","lastPointRadius","_this$asProps","data","loading","defaultData","lastPointColor","defaultWidth","defaultHeight","_this$asProps2","resolveColor","_this$asProps2$color","color","value","render","_ref","_ref2","STrendLine","_this$asProps3","uid","withArea","animate","styles","points","length","step","i","push","concat","_extractAriaProps","__excludeProps","extractedAriaProps","createElement","cn","_objectSpread","_assignProps","containerRef","_toConsumableArray","svgWidth","svgHeight","join","_defineProperty","TrendLine","displayName","TrendArea","enhancements","wrapperProps","props"],"sources":["../../../../src/component/trend/Line.tsx"],"sourcesContent":["import React from 'react';\nimport { createComponent, ComponentType, assignProps, Root, sstyled } from '@semcore/core';\nimport resolveColorEnhance from '@semcore/core/lib/utils/enhances/resolveColorEnhance';\nimport uniqueIDEnhancement from '@semcore/core/lib/utils/uniqueID';\nimport { Trend, CommonTrendProps } from './Trend';\nimport { Box } from '@semcore/flex-box';\n\nimport style from '../skeleton/skeleton.shadow.css';\nimport { extractAriaProps } from '@semcore/core/lib/utils/ariaProps';\n\nexport type TrendLineProps = CommonTrendProps & {\n /**\n * List of values\n */\n data: number[];\n\n /**\n * Color of line\n */\n color?: string;\n\n /**\n * Color of last point in chart\n */\n lastPointColor?: string;\n\n /**\n * Radius for last point item\n */\n lastPointRadius?: number;\n};\n\ntype Enhances = {\n uid: string;\n resolveColor: ReturnType<typeof resolveColorEnhance>;\n withArea?: true;\n};\n\nclass TrendLineRoot extends Trend<TrendLineProps, typeof TrendLineRoot.enhance> {\n static enhance = [resolveColorEnhance(), uniqueIDEnhancement()] as const;\n\n static style = style;\n\n static defaultProps = {\n animate: true,\n };\n\n get defaultData(): number[] {\n return [15, 70, 20, 85, 20];\n }\n\n get lastPointRadius(): number {\n return this.asProps.lastPointRadius ?? 6;\n }\n\n get data(): number[] {\n const { data, loading } = this.asProps;\n\n if (loading) {\n return this.defaultData;\n }\n\n return data;\n }\n\n override get svgWidth(): number {\n return this.asProps.lastPointColor\n ? this.defaultWidth + this.lastPointRadius\n : this.defaultWidth;\n }\n\n override get svgHeight(): number {\n return this.asProps.lastPointColor\n ? this.defaultHeight + this.lastPointRadius\n : this.defaultHeight;\n }\n\n get color() {\n const { resolveColor, color = 'chart-palette-order-1', loading } = this.asProps;\n\n if (loading) {\n return resolveColor('skeleton-bg');\n }\n\n return resolveColor(color);\n }\n\n render() {\n const STrendLine = Root;\n const { uid, withArea, animate, lastPointColor, resolveColor, loading, styles } = this.asProps;\n\n const points: string[] = [];\n const length = this.data.length;\n const step = this.defaultWidth / (length - 1);\n\n for (let i = 0; i < length; i++) {\n points.push(`${step * i},${this.defaultHeight - this.data[i]}`);\n }\n const { __excludeProps, extractedAriaProps } = extractAriaProps(this.asProps);\n\n return sstyled(styles)(\n <STrendLine render={Box} ref={this.containerRef} __excludeProps={['data', ...__excludeProps]}>\n <svg\n width='100%'\n height='100%'\n viewBox={`0 0 ${this.svgWidth} ${this.svgHeight}`}\n role='img'\n {...extractedAriaProps}\n >\n <polyline\n points={points.join(' ')}\n stroke={this.color}\n strokeWidth='4'\n fill={'none'}\n clipPath={`url(#${uid})`}\n />\n {withArea && (\n <polyline\n points={`0,${this.defaultHeight} ${points.join(' ')} ${this.defaultWidth},${\n this.defaultHeight\n }`}\n fill={this.color}\n fillOpacity={0.2}\n clipPath={`url(#${uid})`}\n />\n )}\n {lastPointColor && !loading && (\n <circle\n cx={step * (length - 1)}\n cy={this.defaultHeight - this.data[length - 1]}\n r={this.lastPointRadius}\n fill={resolveColor(lastPointColor)}\n stroke={resolveColor('chart-grid-border')}\n strokeWidth={4}\n clipPath={`url(#${uid})`}\n />\n )}\n\n {animate && !loading && (\n <clipPath id={uid}>\n <rect x='0' y='0' width='100%' height='100%' fill={'black'}>\n <animate dur='500ms' attributeName='width' values='0;100%' />\n </rect>\n </clipPath>\n )}\n </svg>\n </STrendLine>,\n );\n }\n}\n\nexport const TrendLine: ComponentType<TrendLineProps, {}, {}, Enhances> =\n createComponent(TrendLineRoot);\n\nTrendLine.displayName = 'MiniChart.TrendLine';\n\nexport const TrendArea: ComponentType<TrendLineProps, {}, {}, Enhances> = createComponent(\n TrendLineRoot,\n {},\n {\n enhancements: [\n () => {\n return {\n wrapperProps: (props: TrendLineProps) => {\n return assignProps(props, { withArea: true });\n },\n };\n },\n ],\n },\n);\n\nTrendArea.displayName = 'MiniChart.TrendArea';\n"],"mappings":";;;;;;;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,eAAe,EAAiBC,WAAW,EAAEC,IAAI,EAAEC,OAAO,QAAQ,eAAe;AAC1F,OAAOC,mBAAmB,MAAM,sDAAsD;AACtF,OAAOC,mBAAmB,MAAM,kCAAkC;AAClE,SAASC,KAAK,QAA0B,SAAS;AACjD,SAASC,GAAG,QAAQ,mBAAmB;AAAC;AAAA,IAAAC,KAAA,+BAAAC,QAAA,CAAAC,MAAA;AAAA;AAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;AAAA;AAGxC,SAASC,gBAAgB,QAAQ,mCAAmC;AAAC,IA8B/DC,aAAa,0BAAAC,MAAA;EAAAC,SAAA,CAAAF,aAAA,EAAAC,MAAA;EAAA,IAAAE,MAAA,GAAAC,YAAA,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E,KAAK,EAAE;UAAE3B,QAAQ,EAAE;QAAK,CAAC,CAAC;MAC/C;IACF,CAAC;EACH,CAAC;AAEL,CAAC,CACF;AAEDwB,SAAS,CAACD,WAAW,GAAG,qBAAqB"}
|
|
@@ -4,30 +4,29 @@ import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
|
4
4
|
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
5
5
|
import _createSuper from "@babel/runtime/helpers/esm/createSuper";
|
|
6
6
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
7
|
-
import { sstyled } from "@semcore/
|
|
8
|
-
import createComponent, { assignProps, sstyled as sstyled$1, Component } from "@semcore/core";
|
|
7
|
+
import { sstyled, createComponent, assignProps, Component } from "@semcore/core";
|
|
9
8
|
import React from "react";
|
|
10
9
|
import { Box } from "@semcore/flex-box";
|
|
11
|
-
import resolveColorEnhance from "@semcore/
|
|
12
|
-
import { extractAriaProps } from "@semcore/
|
|
10
|
+
import resolveColorEnhance from "@semcore/core/lib/utils/enhances/resolveColorEnhance";
|
|
11
|
+
import { extractAriaProps } from "@semcore/core/lib/utils/ariaProps";
|
|
13
12
|
/*!__reshadow-styles__:"./donut.shadow.css"*/
|
|
14
13
|
var style = (
|
|
15
14
|
/*__reshadow_css_start__*/
|
|
16
15
|
(sstyled.insert(
|
|
17
16
|
/*__inner_css_start__*/
|
|
18
|
-
"@keyframes
|
|
17
|
+
"@keyframes pulse_1cm94{0%,to{opacity:1}50%{opacity:.4}}.___SDonutContainer_1cm94_gg_.__loading_1cm94_gg_,.___SLineGauge_1cm94_gg_.__loading_1cm94_gg_,.___STrendBar_1cm94_gg_.__loading_1cm94_gg_,.___STrendLine_1cm94_gg_.__loading_1cm94_gg_{animation-name:pulse_1cm94;animation-iteration-count:infinite;animation-timing-function:ease-in-out;animation-duration:1.6s;will-change:opacity}.___SDonutContainer_1cm94_gg_.__semi_1cm94_gg_ g{transform:rotate(180deg) translate(-24px,-24px)}.___SDonutContainer_1cm94_gg_ g{transform:rotate(-90deg) translate(-24px)}.___SDonutContainer_1cm94_gg_.__animate_1cm94_gg_ circle{transition:all var(--intergalactic-duration-extra-slow, 500) ease-in-out}",
|
|
19
18
|
/*__inner_css_end__*/
|
|
20
|
-
"
|
|
19
|
+
"1cm94_gg_"
|
|
21
20
|
), /*__reshadow_css_end__*/
|
|
22
21
|
{
|
|
23
|
-
"__SLineGauge": "
|
|
24
|
-
"_loading": "
|
|
25
|
-
"__SDonutContainer": "
|
|
26
|
-
"__STrendLine": "
|
|
27
|
-
"__STrendBar": "
|
|
28
|
-
"@pulse": "
|
|
29
|
-
"_animate": "
|
|
30
|
-
"_semi": "
|
|
22
|
+
"__SLineGauge": "___SLineGauge_1cm94_gg_",
|
|
23
|
+
"_loading": "__loading_1cm94_gg_",
|
|
24
|
+
"__SDonutContainer": "___SDonutContainer_1cm94_gg_",
|
|
25
|
+
"__STrendLine": "___STrendLine_1cm94_gg_",
|
|
26
|
+
"__STrendBar": "___STrendBar_1cm94_gg_",
|
|
27
|
+
"@pulse": "pulse_1cm94",
|
|
28
|
+
"_animate": "__animate_1cm94_gg_",
|
|
29
|
+
"_semi": "__semi_1cm94_gg_"
|
|
31
30
|
})
|
|
32
31
|
);
|
|
33
32
|
var DonutRoot = /* @__PURE__ */ function(_Component) {
|
|
@@ -57,7 +56,7 @@ var DonutRoot = /* @__PURE__ */ function(_Component) {
|
|
|
57
56
|
var viewBox = isSemiDonut ? "0 0 24 12" : "0 0 24 24";
|
|
58
57
|
var strokeDashoffsetBase = -1 * (valueStrokeDasharray + (isSemiDonut ? offsetPoint : 0));
|
|
59
58
|
var _extractAriaProps = extractAriaProps(this.asProps), __excludeProps = _extractAriaProps.__excludeProps, extractedAriaProps = _extractAriaProps.extractedAriaProps;
|
|
60
|
-
return _ref2 = sstyled
|
|
59
|
+
return _ref2 = sstyled(styles), /* @__PURE__ */ React.createElement(SDonutContainer, _ref2.cn("SDonutContainer", _objectSpread({}, assignProps({
|
|
61
60
|
"semi": isSemiDonut,
|
|
62
61
|
"__excludeProps": __excludeProps
|
|
63
62
|
}, _ref))), /* @__PURE__ */ React.createElement("svg", _ref2.cn("svg", _objectSpread({
|
|
@@ -4,38 +4,37 @@ import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
|
4
4
|
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
5
5
|
import _createSuper from "@babel/runtime/helpers/esm/createSuper";
|
|
6
6
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
7
|
-
import { sstyled } from "@semcore/
|
|
8
|
-
import createComponent, { sstyled as sstyled$1, assignProps, Component } from "@semcore/core";
|
|
7
|
+
import { sstyled, createComponent, assignProps, Component } from "@semcore/core";
|
|
9
8
|
import React from "react";
|
|
10
9
|
import { Box, Flex } from "@semcore/flex-box";
|
|
11
|
-
import resolveColorEnhance from "@semcore/
|
|
10
|
+
import resolveColorEnhance from "@semcore/core/lib/utils/enhances/resolveColorEnhance";
|
|
12
11
|
/*!__reshadow-styles__:"./line.shadow.css"*/
|
|
13
12
|
var style = (
|
|
14
13
|
/*__reshadow_css_start__*/
|
|
15
14
|
(sstyled.insert(
|
|
16
15
|
/*__inner_css_start__*/
|
|
17
|
-
"@keyframes
|
|
16
|
+
"@keyframes pulse_2vm7d{0%,to{opacity:1}50%{opacity:.4}}@keyframes move-line_2vm7d{0%{transform:translateX(0)}to{transform:translateX(100%)}}.___SDonutContainer_2vm7d_gg_.__loading_2vm7d_gg_,.___SLineGauge_2vm7d_gg_.__loading_2vm7d_gg_,.___STrendBar_2vm7d_gg_.__loading_2vm7d_gg_,.___STrendLine_2vm7d_gg_.__loading_2vm7d_gg_{animation-name:pulse_2vm7d;animation-iteration-count:infinite;animation-timing-function:ease-in-out;animation-duration:1.6s;will-change:opacity}.___SLineGauge_2vm7d_gg_{height:8px;background-color:var(--base-bg-color_2vm7d, var(--intergalactic-chart-grid-bar-chart-base-bg, #e0e1e9));border-radius:var(--intergalactic-chart-rounded, 2px);overflow:hidden;position:relative}.___SLineValue_2vm7d_gg_{height:8px;border-radius:var(--intergalactic-chart-rounded, 2px)0 0 var(--intergalactic-chart-rounded, 2px)}.___SLineValue_2vm7d_gg_.__percent_2vm7d_gg_{width:var(--percent_2vm7d)}.___SLineSegmentItem_2vm7d_gg_.__color_2vm7d_gg_,.___SLineValue_2vm7d_gg_.__color_2vm7d_gg_{background-color:var(--color_2vm7d, var(--intergalactic-chart-palette-order-1, #2bb3ff))}.___SLineGauge_2vm7d_gg_.__segments_2vm7d_gg_{border-radius:var(--intergalactic-progress-bar-rounded, 6px)}.___SAnimationLine_2vm7d_gg_,.___SLineGaugeSegment_2vm7d_gg_{position:absolute;top:0;left:0;right:0;bottom:0}.___SLineSegmentItem_2vm7d_gg_:last-child{margin-right:0;border-right:none}.___SLineSegmentItem_2vm7d_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_2vm7d_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_2vm7d;animation-duration:.5s;animation-timing-function:ease-in-out;animation-fill-mode:forwards}",
|
|
18
17
|
/*__inner_css_end__*/
|
|
19
|
-
"
|
|
18
|
+
"2vm7d_gg_"
|
|
20
19
|
), /*__reshadow_css_end__*/
|
|
21
20
|
{
|
|
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-
|
|
21
|
+
"__SLineGauge": "___SLineGauge_2vm7d_gg_",
|
|
22
|
+
"_loading": "__loading_2vm7d_gg_",
|
|
23
|
+
"__SDonutContainer": "___SDonutContainer_2vm7d_gg_",
|
|
24
|
+
"__STrendLine": "___STrendLine_2vm7d_gg_",
|
|
25
|
+
"__STrendBar": "___STrendBar_2vm7d_gg_",
|
|
26
|
+
"@pulse": "pulse_2vm7d",
|
|
27
|
+
"--base-bg-color": "--base-bg-color_2vm7d",
|
|
28
|
+
"__SLineValue": "___SLineValue_2vm7d_gg_",
|
|
29
|
+
"_percent": "__percent_2vm7d_gg_",
|
|
30
|
+
"--percent": "--percent_2vm7d",
|
|
31
|
+
"_color": "__color_2vm7d_gg_",
|
|
32
|
+
"__SLineSegmentItem": "___SLineSegmentItem_2vm7d_gg_",
|
|
33
|
+
"--color": "--color_2vm7d",
|
|
34
|
+
"_segments": "__segments_2vm7d_gg_",
|
|
35
|
+
"__SLineGaugeSegment": "___SLineGaugeSegment_2vm7d_gg_",
|
|
36
|
+
"__SAnimationLine": "___SAnimationLine_2vm7d_gg_",
|
|
37
|
+
"@move-line": "move-line_2vm7d"
|
|
39
38
|
})
|
|
40
39
|
);
|
|
41
40
|
var LineRoot = /* @__PURE__ */ function(_Component) {
|
|
@@ -73,7 +72,7 @@ var LineRoot = /* @__PURE__ */ function(_Component) {
|
|
|
73
72
|
var _this$asProps2 = this.asProps, value = _this$asProps2.value, styles = _this$asProps2.styles, _this$asProps2$color = _this$asProps2.color, color = _this$asProps2$color === void 0 ? "chart-palette-order-1" : _this$asProps2$color, baseBgColor = _this$asProps2.baseBgColor, resolveColor = _this$asProps2.resolveColor, loading = _this$asProps2.loading, children = _this$asProps2.children, Children = _this$asProps2.Children, animate = _this$asProps2.animate;
|
|
74
73
|
if (children !== void 0) {
|
|
75
74
|
var _ref3;
|
|
76
|
-
return _ref3 = sstyled
|
|
75
|
+
return _ref3 = sstyled(styles), /* @__PURE__ */ React.createElement(SLineGauge, _ref3.cn("SLineGauge", _objectSpread({}, assignProps({
|
|
77
76
|
"segments": true,
|
|
78
77
|
"base-bg-color": resolveColor(baseBgColor)
|
|
79
78
|
}, _ref))), /* @__PURE__ */ React.createElement(SLineGaugeSegment, _ref3.cn("SLineGaugeSegment", {}), /* @__PURE__ */ React.createElement(Children, _ref3.cn("Children", {}))), animate && /* @__PURE__ */ React.createElement(SAnimationLine, _ref3.cn("SAnimationLine", {})));
|
|
@@ -84,7 +83,7 @@ var LineRoot = /* @__PURE__ */ function(_Component) {
|
|
|
84
83
|
for (var i = 0; i < segments; i++) {
|
|
85
84
|
var _ref4;
|
|
86
85
|
var width = "calc((100% - ".concat(segments - 1, "px) / ").concat(segments, ")");
|
|
87
|
-
SegmentItems.push((_ref4 = sstyled
|
|
86
|
+
SegmentItems.push((_ref4 = sstyled(styles), /* @__PURE__ */ React.createElement(SLineSegmentItem, _ref4.cn("SLineSegmentItem", {
|
|
88
87
|
"key": i,
|
|
89
88
|
"color": i < value ? resolveColor(color) : void 0,
|
|
90
89
|
"w": width
|
|
@@ -95,7 +94,7 @@ var LineRoot = /* @__PURE__ */ function(_Component) {
|
|
|
95
94
|
if (segments) {
|
|
96
95
|
percent = "".concat(value / segments * 100, "%");
|
|
97
96
|
}
|
|
98
|
-
return _ref5 = sstyled
|
|
97
|
+
return _ref5 = sstyled(styles), /* @__PURE__ */ React.createElement(SLineGauge, _ref5.cn("SLineGauge", _objectSpread({}, assignProps({
|
|
99
98
|
"base-bg-color": resolveColor(baseBgColor)
|
|
100
99
|
}, _ref))), !loading && /* @__PURE__ */ React.createElement(SLineValue, _ref5.cn("SLineValue", {
|
|
101
100
|
"w": percent,
|
|
@@ -115,7 +114,7 @@ function Segment(props) {
|
|
|
115
114
|
var _ref2 = arguments[0], _ref6;
|
|
116
115
|
var styles = props.styles;
|
|
117
116
|
var SLineSegmentItem = Box;
|
|
118
|
-
return _ref6 = sstyled
|
|
117
|
+
return _ref6 = sstyled(styles), /* @__PURE__ */ React.createElement(SLineSegmentItem, _ref6.cn("SLineSegmentItem", _objectSpread({}, assignProps({}, _ref2))));
|
|
119
118
|
}
|
|
120
119
|
Segment.displayName = "Segment";
|
|
121
120
|
var ScoreLine = createComponent(LineRoot, {
|
|
@@ -5,29 +5,28 @@ import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
|
5
5
|
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
6
6
|
import _createSuper from "@babel/runtime/helpers/esm/createSuper";
|
|
7
7
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
8
|
-
import { sstyled } from "@semcore/
|
|
9
|
-
import createComponent, { assignProps, sstyled as sstyled$1 } from "@semcore/core";
|
|
8
|
+
import { sstyled, createComponent, assignProps } from "@semcore/core";
|
|
10
9
|
import React from "react";
|
|
11
|
-
import resolveColorEnhance from "@semcore/
|
|
10
|
+
import resolveColorEnhance from "@semcore/core/lib/utils/enhances/resolveColorEnhance";
|
|
12
11
|
import { Trend } from "./Trend.mjs";
|
|
13
12
|
import { Box } from "@semcore/flex-box";
|
|
14
|
-
import { extractAriaProps } from "@semcore/
|
|
13
|
+
import { extractAriaProps } from "@semcore/core/lib/utils/ariaProps";
|
|
15
14
|
/*!__reshadow-styles__:"../skeleton/skeleton.shadow.css"*/
|
|
16
15
|
var style = (
|
|
17
16
|
/*__reshadow_css_start__*/
|
|
18
17
|
(sstyled.insert(
|
|
19
18
|
/*__inner_css_start__*/
|
|
20
|
-
"@keyframes
|
|
19
|
+
"@keyframes pulse_7jer1{0%,to{opacity:1}50%{opacity:.4}}.___SDonutContainer_7jer1_gg_.__loading_7jer1_gg_,.___SLineGauge_7jer1_gg_.__loading_7jer1_gg_,.___STrendBar_7jer1_gg_.__loading_7jer1_gg_,.___STrendLine_7jer1_gg_.__loading_7jer1_gg_{animation-name:pulse_7jer1;animation-iteration-count:infinite;animation-timing-function:ease-in-out;animation-duration:1.6s;will-change:opacity}",
|
|
21
20
|
/*__inner_css_end__*/
|
|
22
|
-
"
|
|
21
|
+
"7jer1_gg_"
|
|
23
22
|
), /*__reshadow_css_end__*/
|
|
24
23
|
{
|
|
25
|
-
"__SLineGauge": "
|
|
26
|
-
"_loading": "
|
|
27
|
-
"__SDonutContainer": "
|
|
28
|
-
"__STrendLine": "
|
|
29
|
-
"__STrendBar": "
|
|
30
|
-
"@pulse": "
|
|
24
|
+
"__SLineGauge": "___SLineGauge_7jer1_gg_",
|
|
25
|
+
"_loading": "__loading_7jer1_gg_",
|
|
26
|
+
"__SDonutContainer": "___SDonutContainer_7jer1_gg_",
|
|
27
|
+
"__STrendLine": "___STrendLine_7jer1_gg_",
|
|
28
|
+
"__STrendBar": "___STrendBar_7jer1_gg_",
|
|
29
|
+
"@pulse": "pulse_7jer1"
|
|
31
30
|
})
|
|
32
31
|
);
|
|
33
32
|
var TrendBarRoot = /* @__PURE__ */ function(_Trend) {
|
|
@@ -67,7 +66,7 @@ var TrendBarRoot = /* @__PURE__ */ function(_Trend) {
|
|
|
67
66
|
var _this$asProps2 = this.asProps, styles = _this$asProps2.styles, resolveColor = _this$asProps2.resolveColor, isHistogram = _this$asProps2.isHistogram, animate = _this$asProps2.animate, loading = _this$asProps2.loading;
|
|
68
67
|
var step = this.defaultWidth / this.data.length;
|
|
69
68
|
var _extractAriaProps = extractAriaProps(this.asProps), __excludeProps = _extractAriaProps.__excludeProps, extractedAriaProps = _extractAriaProps.extractedAriaProps;
|
|
70
|
-
return _ref2 = sstyled
|
|
69
|
+
return _ref2 = sstyled(styles), /* @__PURE__ */ React.createElement(STrendBar, _ref2.cn("STrendBar", _objectSpread({}, assignProps({
|
|
71
70
|
"ref": this.containerRef,
|
|
72
71
|
"__excludeProps": ["data"].concat(_toConsumableArray(__excludeProps))
|
|
73
72
|
}, _ref))), /* @__PURE__ */ React.createElement("svg", _ref2.cn("svg", _objectSpread({
|
|
@@ -5,30 +5,29 @@ import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
|
5
5
|
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
6
6
|
import _createSuper from "@babel/runtime/helpers/esm/createSuper";
|
|
7
7
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
8
|
-
import { sstyled } from "@semcore/
|
|
9
|
-
import createComponent, { assignProps, sstyled as sstyled$1 } from "@semcore/core";
|
|
8
|
+
import { sstyled, createComponent, assignProps } from "@semcore/core";
|
|
10
9
|
import React from "react";
|
|
11
|
-
import resolveColorEnhance from "@semcore/
|
|
12
|
-
import uniqueIDEnhancement from "@semcore/
|
|
10
|
+
import resolveColorEnhance from "@semcore/core/lib/utils/enhances/resolveColorEnhance";
|
|
11
|
+
import uniqueIDEnhancement from "@semcore/core/lib/utils/uniqueID";
|
|
13
12
|
import { Trend } from "./Trend.mjs";
|
|
14
13
|
import { Box } from "@semcore/flex-box";
|
|
15
|
-
import { extractAriaProps } from "@semcore/
|
|
14
|
+
import { extractAriaProps } from "@semcore/core/lib/utils/ariaProps";
|
|
16
15
|
/*!__reshadow-styles__:"../skeleton/skeleton.shadow.css"*/
|
|
17
16
|
var style = (
|
|
18
17
|
/*__reshadow_css_start__*/
|
|
19
18
|
(sstyled.insert(
|
|
20
19
|
/*__inner_css_start__*/
|
|
21
|
-
"@keyframes
|
|
20
|
+
"@keyframes pulse_7jer1{0%,to{opacity:1}50%{opacity:.4}}.___SDonutContainer_7jer1_gg_.__loading_7jer1_gg_,.___SLineGauge_7jer1_gg_.__loading_7jer1_gg_,.___STrendBar_7jer1_gg_.__loading_7jer1_gg_,.___STrendLine_7jer1_gg_.__loading_7jer1_gg_{animation-name:pulse_7jer1;animation-iteration-count:infinite;animation-timing-function:ease-in-out;animation-duration:1.6s;will-change:opacity}",
|
|
22
21
|
/*__inner_css_end__*/
|
|
23
|
-
"
|
|
22
|
+
"7jer1_gg_"
|
|
24
23
|
), /*__reshadow_css_end__*/
|
|
25
24
|
{
|
|
26
|
-
"__SLineGauge": "
|
|
27
|
-
"_loading": "
|
|
28
|
-
"__SDonutContainer": "
|
|
29
|
-
"__STrendLine": "
|
|
30
|
-
"__STrendBar": "
|
|
31
|
-
"@pulse": "
|
|
25
|
+
"__SLineGauge": "___SLineGauge_7jer1_gg_",
|
|
26
|
+
"_loading": "__loading_7jer1_gg_",
|
|
27
|
+
"__SDonutContainer": "___SDonutContainer_7jer1_gg_",
|
|
28
|
+
"__STrendLine": "___STrendLine_7jer1_gg_",
|
|
29
|
+
"__STrendBar": "___STrendBar_7jer1_gg_",
|
|
30
|
+
"@pulse": "pulse_7jer1"
|
|
32
31
|
})
|
|
33
32
|
);
|
|
34
33
|
var TrendLineRoot = /* @__PURE__ */ function(_Trend) {
|
|
@@ -90,7 +89,7 @@ var TrendLineRoot = /* @__PURE__ */ function(_Trend) {
|
|
|
90
89
|
points.push("".concat(step * i, ",").concat(this.defaultHeight - this.data[i]));
|
|
91
90
|
}
|
|
92
91
|
var _extractAriaProps = extractAriaProps(this.asProps), __excludeProps = _extractAriaProps.__excludeProps, extractedAriaProps = _extractAriaProps.extractedAriaProps;
|
|
93
|
-
return _ref2 = sstyled
|
|
92
|
+
return _ref2 = sstyled(styles), /* @__PURE__ */ React.createElement(STrendLine, _ref2.cn("STrendLine", _objectSpread({}, assignProps({
|
|
94
93
|
"ref": this.containerRef,
|
|
95
94
|
"__excludeProps": ["data"].concat(_toConsumableArray(__excludeProps))
|
|
96
95
|
}, _ref))), /* @__PURE__ */ React.createElement("svg", _ref2.cn("svg", _objectSpread({
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ComponentType } from '@semcore/core';
|
|
2
2
|
import { BoxProps } from '@semcore/flex-box';
|
|
3
|
-
import resolveColorEnhance from '@semcore/
|
|
3
|
+
import resolveColorEnhance from '@semcore/core/lib/utils/enhances/resolveColorEnhance';
|
|
4
4
|
import { CommonScoreProps } from './Score';
|
|
5
5
|
export type ScoreDonutProps = BoxProps & CommonScoreProps;
|
|
6
6
|
type Enhances = {
|