@semcore/mini-chart 16.2.0-prerelease.1 → 16.2.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/lib/cjs/component/score/Donut.js +11 -11
- package/lib/cjs/component/score/Donut.js.map +1 -1
- package/lib/cjs/component/score/Line.js +25 -25
- 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 +10 -10
- package/lib/cjs/component/trend/Bar.js.map +1 -1
- package/lib/cjs/component/trend/Line.js +9 -9
- package/lib/cjs/component/trend/Line.js.map +1 -1
- package/lib/cjs/component/trend/Trend.js.map +1 -1
- package/lib/es6/component/score/Donut.js +11 -12
- package/lib/es6/component/score/Donut.js.map +1 -1
- package/lib/es6/component/score/Line.js +19 -19
- 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 +9 -9
- package/lib/es6/component/trend/Bar.js.map +1 -1
- package/lib/es6/component/trend/Line.js +8 -8
- package/lib/es6/component/trend/Line.js.map +1 -1
- package/lib/es6/component/trend/Trend.js.map +1 -1
- package/lib/esm/component/score/Donut.mjs +12 -12
- package/lib/esm/component/score/Line.mjs +21 -21
- package/lib/esm/component/score/index.mjs +7 -0
- package/lib/esm/component/trend/Bar.mjs +11 -11
- package/lib/esm/component/trend/Line.mjs +10 -10
- package/lib/esm/component/trend/index.mjs +8 -0
- package/lib/esm/index.mjs +3 -1
- package/lib/types/component/score/Donut.d.ts +7 -12
- package/lib/types/component/score/Line.types.d.ts +8 -6
- package/lib/types/component/trend/Bar.d.ts +2 -8
- package/lib/types/component/trend/Line.d.ts +6 -10
- package/lib/types/component/trend/Trend.d.ts +3 -3
- package/package.json +4 -4
|
@@ -8,31 +8,31 @@ 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
|
+
import { Box, Flex } from '@semcore/base-components';
|
|
11
12
|
import { createComponent, Component, Root, sstyled } from '@semcore/core';
|
|
12
13
|
import resolveColorEnhance from '@semcore/core/lib/utils/enhances/resolveColorEnhance';
|
|
13
|
-
import { Box, Flex } from '@semcore/flex-box';
|
|
14
14
|
import React from 'react';
|
|
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_1y4lp{0%,to{opacity:1}50%{opacity:.4}}@keyframes move-line_1y4lp{0%{transform:translateX(0)}to{transform:translateX(100%)}}.___SDonutContainer_1y4lp_gg_.__loading_1y4lp_gg_,.___SLineGauge_1y4lp_gg_.__loading_1y4lp_gg_,.___STrendBar_1y4lp_gg_.__loading_1y4lp_gg_,.___STrendLine_1y4lp_gg_.__loading_1y4lp_gg_{animation-name:pulse_1y4lp;animation-iteration-count:infinite;animation-timing-function:ease-in-out;animation-duration:1.6s;will-change:opacity}.___SLineGauge_1y4lp_gg_{height:8px;background-color:var(--base-bg-color_1y4lp, var(--intergalactic-chart-grid-bar-chart-base-bg, rgb(241, 242, 242)));border-radius:var(--intergalactic-chart-rounded, 2px);overflow:hidden;position:relative}.___SLineValue_1y4lp_gg_{height:8px;border-radius:var(--intergalactic-chart-rounded, 2px)0 0 var(--intergalactic-chart-rounded, 2px)}.___SLineValue_1y4lp_gg_.__percent_1y4lp_gg_{width:var(--percent_1y4lp)}.___SLineSegmentItem_1y4lp_gg_.__color_1y4lp_gg_,.___SLineValue_1y4lp_gg_.__color_1y4lp_gg_{background-color:var(--color_1y4lp, var(--intergalactic-chart-palette-order-1, rgb(102, 107, 219)))}.___SLineGauge_1y4lp_gg_.__segments_1y4lp_gg_{border-radius:var(--intergalactic-progress-bar-rounded, 6px)}.___SAnimationLine_1y4lp_gg_,.___SLineGaugeSegment_1y4lp_gg_{position:absolute;top:0;left:0;right:0;bottom:0}.___SLineSegmentItem_1y4lp_gg_:last-child{margin-right:0;border-right:none}.___SLineSegmentItem_1y4lp_gg_{height:8px;background:0 0;border-right-color:var(--intergalactic-chart-grid-border, #fff);border-right-style:solid;border-right-width:1px;box-sizing:content-box}.___SAnimationLine_1y4lp_gg_{background-color:var(--intergalactic-chart-grid-bar-chart-base-bg, rgb(241, 242, 242));transition:all var(--intergalactic-duration-extra-slow, 500) ease-in-out;animation-name:move-line_1y4lp;animation-duration:.5s;animation-timing-function:ease-in-out;animation-fill-mode:forwards}", /*__inner_css_end__*/"1y4lp_gg_"),
|
|
17
17
|
/*__reshadow_css_end__*/
|
|
18
18
|
{
|
|
19
|
-
"__SLineGauge": "
|
|
20
|
-
"_loading": "
|
|
21
|
-
"__SDonutContainer": "
|
|
22
|
-
"__STrendLine": "
|
|
23
|
-
"__STrendBar": "
|
|
24
|
-
"@pulse": "
|
|
25
|
-
"__SLineValue": "
|
|
26
|
-
"_percent": "
|
|
27
|
-
"--percent": "--
|
|
28
|
-
"_color": "
|
|
29
|
-
"__SLineSegmentItem": "
|
|
30
|
-
"_segments": "
|
|
31
|
-
"__SLineGaugeSegment": "
|
|
32
|
-
"__SAnimationLine": "
|
|
33
|
-
"@move-line": "move-
|
|
34
|
-
"--base-bg-color": "--base-bg-
|
|
35
|
-
"--color": "--
|
|
19
|
+
"__SLineGauge": "___SLineGauge_1y4lp_gg_",
|
|
20
|
+
"_loading": "__loading_1y4lp_gg_",
|
|
21
|
+
"__SDonutContainer": "___SDonutContainer_1y4lp_gg_",
|
|
22
|
+
"__STrendLine": "___STrendLine_1y4lp_gg_",
|
|
23
|
+
"__STrendBar": "___STrendBar_1y4lp_gg_",
|
|
24
|
+
"@pulse": "pulse_1y4lp",
|
|
25
|
+
"__SLineValue": "___SLineValue_1y4lp_gg_",
|
|
26
|
+
"_percent": "__percent_1y4lp_gg_",
|
|
27
|
+
"--percent": "--percent_1y4lp",
|
|
28
|
+
"_color": "__color_1y4lp_gg_",
|
|
29
|
+
"__SLineSegmentItem": "___SLineSegmentItem_1y4lp_gg_",
|
|
30
|
+
"_segments": "__segments_1y4lp_gg_",
|
|
31
|
+
"__SLineGaugeSegment": "___SLineGaugeSegment_1y4lp_gg_",
|
|
32
|
+
"__SAnimationLine": "___SAnimationLine_1y4lp_gg_",
|
|
33
|
+
"@move-line": "move-line_1y4lp",
|
|
34
|
+
"--base-bg-color": "--base-bg-color_1y4lp",
|
|
35
|
+
"--color": "--color_1y4lp"
|
|
36
36
|
});
|
|
37
37
|
var LineRoot = /*#__PURE__*/function (_Component) {
|
|
38
38
|
function LineRoot() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Line.js","names":["
|
|
1
|
+
{"version":3,"file":"Line.js","names":["Box","Flex","createComponent","Component","Root","sstyled","resolveColorEnhance","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 { Box, Flex } from '@semcore/base-components';\nimport { createComponent, Component, Root, sstyled } from '@semcore/core';\nimport resolveColorEnhance from '@semcore/core/lib/utils/enhances/resolveColorEnhance';\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 = createComponent(LineRoot, {\n Segment,\n}) as ScoreLineComponent;\n\nScoreLine.displayName = 'MiniChart.ScoreLine';\n"],"mappings":";;;;;;;;;;AAAA,SAASA,GAAG,EAAEC,IAAI,QAAQ,0BAA0B;AACpD,SAASC,eAAe,EAAEC,SAAS,EAAEC,IAAI,EAAEC,OAAO,QAAQ,eAAe;AACzE,OAAOC,mBAAmB,MAAM,sDAAsD;AACtF,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,CAAeD,KAAK,CAAC,EAAE;UAC7CH,GAAG,GAAGA,GAAG,GAAGG,KAAK,CAACE,KAAK,CAACZ,KAA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AS;AAE/B,OAAO,IAAMC,SAAS,GAAGrE,eAAe,CAACS,QAAQ,EAAE;EACjDsD,OAAO,EAAPA;AACF,CAAC,CAAuB;AAExBM,SAAS,CAACD,WAAW,GAAG,qBAAqB","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Line.types.js","names":[],"sources":["../../../../src/component/score/Line.types.ts"],"sourcesContent":["import type {
|
|
1
|
+
{"version":3,"file":"Line.types.js","names":[],"sources":["../../../../src/component/score/Line.types.ts"],"sourcesContent":["import type { BoxProps, Box } from '@semcore/base-components';\nimport type { Intergalactic } from '@semcore/core';\nimport type resolveColorEnhance from '@semcore/core/lib/utils/enhances/resolveColorEnhance';\nimport type React from 'react';\n\nimport type { CommonScoreProps } from './Score';\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 = Intergalactic.Component<'svg', ScoreLineGaugeProps, {}, Enhances> & {\n Segment: Intergalactic.Component<typeof Box, SegmentProps>;\n};\n"],"mappings":"","ignoreList":[]}
|
|
@@ -7,22 +7,22 @@ import _inherits from "@babel/runtime/helpers/inherits";
|
|
|
7
7
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
8
8
|
import { sstyled as _sstyled } from "@semcore/core";
|
|
9
9
|
import { assignProps as _assignProps } from "@semcore/core";
|
|
10
|
+
import { Box } from '@semcore/base-components';
|
|
10
11
|
import { createComponent, assignProps, Root, sstyled } from '@semcore/core';
|
|
11
12
|
import { extractAriaProps } from '@semcore/core/lib/utils/ariaProps';
|
|
12
13
|
import resolveColorEnhance from '@semcore/core/lib/utils/enhances/resolveColorEnhance';
|
|
13
|
-
import { Box } from '@semcore/flex-box';
|
|
14
14
|
import React from 'react';
|
|
15
15
|
import { Trend } from './Trend';
|
|
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_1yrsa{0%,to{opacity:1}50%{opacity:.4}}.___SDonutContainer_1yrsa_gg_.__loading_1yrsa_gg_,.___SLineGauge_1yrsa_gg_.__loading_1yrsa_gg_,.___STrendBar_1yrsa_gg_.__loading_1yrsa_gg_,.___STrendLine_1yrsa_gg_.__loading_1yrsa_gg_{animation-name:pulse_1yrsa;animation-iteration-count:infinite;animation-timing-function:ease-in-out;animation-duration:1.6s;will-change:opacity}", /*__inner_css_end__*/"1yrsa_gg_"),
|
|
18
18
|
/*__reshadow_css_end__*/
|
|
19
19
|
{
|
|
20
|
-
"__SLineGauge": "
|
|
21
|
-
"_loading": "
|
|
22
|
-
"__SDonutContainer": "
|
|
23
|
-
"__STrendLine": "
|
|
24
|
-
"__STrendBar": "
|
|
25
|
-
"@pulse": "
|
|
20
|
+
"__SLineGauge": "___SLineGauge_1yrsa_gg_",
|
|
21
|
+
"_loading": "__loading_1yrsa_gg_",
|
|
22
|
+
"__SDonutContainer": "___SDonutContainer_1yrsa_gg_",
|
|
23
|
+
"__STrendLine": "___STrendLine_1yrsa_gg_",
|
|
24
|
+
"__STrendBar": "___STrendBar_1yrsa_gg_",
|
|
25
|
+
"@pulse": "pulse_1yrsa"
|
|
26
26
|
});
|
|
27
27
|
var TrendBarRoot = /*#__PURE__*/function (_Trend) {
|
|
28
28
|
function TrendBarRoot() {
|
|
@@ -118,5 +118,5 @@ export var TrendHistogram = createComponent(TrendBarRoot, {}, {
|
|
|
118
118
|
};
|
|
119
119
|
}]
|
|
120
120
|
});
|
|
121
|
-
|
|
121
|
+
TrendHistogram.displayName = 'MiniChart.TrendHistogram';
|
|
122
122
|
//# sourceMappingURL=Bar.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Bar.js","names":["createComponent","assignProps","Root","sstyled","extractAriaProps","resolveColorEnhance","
|
|
1
|
+
{"version":3,"file":"Bar.js","names":["Box","createComponent","assignProps","Root","sstyled","extractAriaProps","resolveColorEnhance","React","Trend","style","_sstyled","insert","TrendBarRoot","_Trend","_classCallCheck","_callSuper","arguments","_inherits","_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 { Box } from '@semcore/base-components';\nimport { createComponent, assignProps, Root, sstyled } from '@semcore/core';\nimport { extractAriaProps } from '@semcore/core/lib/utils/ariaProps';\nimport resolveColorEnhance from '@semcore/core/lib/utils/enhances/resolveColorEnhance';\nimport React from 'react';\n\nimport { Trend, type CommonTrendProps } from './Trend';\nimport style from '../skeleton/skeleton.shadow.css';\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\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 = createComponent<'svg', TrendBarProps, {}, typeof TrendBarRoot.enhance>(TrendBarRoot);\n\nTrendBar.displayName = 'MiniChart.TrendBar';\n\nexport const TrendHistogram = createComponent<'svg', TrendBarProps, {}, typeof TrendBarRoot.enhance>(\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\nTrendHistogram.displayName = 'MiniChart.TrendHistogram';\n"],"mappings":";;;;;;;;;AAAA,SAASA,GAAG,QAAQ,0BAA0B;AAC9C,SAASC,eAAe,EAAEC,WAAW,EAAEC,IAAI,EAAEC,OAAO,QAAQ,eAAe;AAC3E,SAASC,gBAAgB,QAAQ,mCAAmC;AACpE,OAAOC,mBAAmB,MAAM,sDAAsD;AACtF,OAAOC,KAAK,MAAM,OAAO;AAEzB,SAASC,KAAK,QAA+B,SAAS;AAAC;AAAA,IAAAC,KAAA,8BAAAC,QAAA,CAAAC,MAAA;AAAA;AAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;AAAA;AAAA,IAqBjDC,YAAY,0BAAAC,MAAA;EAAA,SAAAD,aAAA;IAAAE,eAAA,OAAAF,YAAA;IAAA,OAAAG,UAAA,OAAAH,YAAA,EAAAI,SAAA;EAAA;EAAAC,SAAA,CAAAL,YAAA,EAAAC,MAAA;EAAA,OAAAK,YAAA,CAAAN,YAAA;IAAAO,GAAA;IAAAC,GAAA,EAShB,SAAAA,IAAA,EAA6B;MAC3B,OAAO,CAAC;QAAEC,KAAK,EAAE;MAAG,CAAC,EAAE;QAAEA,KAAK,EAAE;MAAG,CAAC,EAAE;QAAEA,KAAK,EAAE;MAAG,CAAC,EAAE;QAAEA,KAAK,EAAE;MAAG,CAAC,CAAC;IACrE;EAAC;IAAAF,GAAA;IAAAC,GAAA,EAED,SAAAA,IAAA,EAAsB;MACpB,IAAAE,aAAA,GAA0B,IAAI,CAACC,OAAO;QAA9BC,IAAI,GAAAF,aAAA,CAAJE,IAAI;QAAEC,OAAO,GAAAH,aAAA,CAAPG,OAAO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AM;IACJ,OAAO;MACLC,YAAY,EAAE,SAAdA,YAAYA,CAAGC,KAAoB,EAAK;QACtC,OAAOrE,WAAW,CAACqE,KAAK,EAAE;UAAEpC,WAAW,EAAE;QAAK,CAAC,CAAC;MAClD;IACF,CAAC;EACH,CAAC;AAEL,CACF,CAAC;AAEDiC,cAAc,CAACD,WAAW,GAAG,0BAA0B","ignoreList":[]}
|
|
@@ -7,23 +7,23 @@ import _inherits from "@babel/runtime/helpers/inherits";
|
|
|
7
7
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
8
8
|
import { sstyled as _sstyled } from "@semcore/core";
|
|
9
9
|
import { assignProps as _assignProps } from "@semcore/core";
|
|
10
|
+
import { Box } from '@semcore/base-components';
|
|
10
11
|
import { createComponent, assignProps, Root, sstyled } from '@semcore/core';
|
|
11
12
|
import { extractAriaProps } from '@semcore/core/lib/utils/ariaProps';
|
|
12
13
|
import resolveColorEnhance from '@semcore/core/lib/utils/enhances/resolveColorEnhance';
|
|
13
14
|
import uniqueIDEnhancement from '@semcore/core/lib/utils/uniqueID';
|
|
14
|
-
import { Box } from '@semcore/flex-box';
|
|
15
15
|
import React from 'react';
|
|
16
16
|
import { Trend } from './Trend';
|
|
17
17
|
/*!__reshadow-styles__:"../skeleton/skeleton.shadow.css"*/
|
|
18
|
-
var style = (/*__reshadow_css_start__*/_sstyled.insert(/*__inner_css_start__*/"@keyframes
|
|
18
|
+
var style = (/*__reshadow_css_start__*/_sstyled.insert(/*__inner_css_start__*/"@keyframes pulse_1yrsa{0%,to{opacity:1}50%{opacity:.4}}.___SDonutContainer_1yrsa_gg_.__loading_1yrsa_gg_,.___SLineGauge_1yrsa_gg_.__loading_1yrsa_gg_,.___STrendBar_1yrsa_gg_.__loading_1yrsa_gg_,.___STrendLine_1yrsa_gg_.__loading_1yrsa_gg_{animation-name:pulse_1yrsa;animation-iteration-count:infinite;animation-timing-function:ease-in-out;animation-duration:1.6s;will-change:opacity}", /*__inner_css_end__*/"1yrsa_gg_"),
|
|
19
19
|
/*__reshadow_css_end__*/
|
|
20
20
|
{
|
|
21
|
-
"__SLineGauge": "
|
|
22
|
-
"_loading": "
|
|
23
|
-
"__SDonutContainer": "
|
|
24
|
-
"__STrendLine": "
|
|
25
|
-
"__STrendBar": "
|
|
26
|
-
"@pulse": "
|
|
21
|
+
"__SLineGauge": "___SLineGauge_1yrsa_gg_",
|
|
22
|
+
"_loading": "__loading_1yrsa_gg_",
|
|
23
|
+
"__SDonutContainer": "___SDonutContainer_1yrsa_gg_",
|
|
24
|
+
"__STrendLine": "___STrendLine_1yrsa_gg_",
|
|
25
|
+
"__STrendBar": "___STrendBar_1yrsa_gg_",
|
|
26
|
+
"@pulse": "pulse_1yrsa"
|
|
27
27
|
});
|
|
28
28
|
var TrendLineRoot = /*#__PURE__*/function (_Trend) {
|
|
29
29
|
function TrendLineRoot() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Line.js","names":["createComponent","assignProps","Root","sstyled","extractAriaProps","resolveColorEnhance","uniqueIDEnhancement","Box","React","Trend","style","_sstyled","insert","TrendLineRoot","_Trend","_classCallCheck","_callSuper","arguments","_inherits","_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 { createComponent, type ComponentType, assignProps, Root, sstyled } from '@semcore/core';\nimport { extractAriaProps } from '@semcore/core/lib/utils/ariaProps';\nimport resolveColorEnhance from '@semcore/core/lib/utils/enhances/resolveColorEnhance';\nimport uniqueIDEnhancement from '@semcore/core/lib/utils/uniqueID';\nimport { Box } from '@semcore/flex-box';\nimport React from 'react';\n\nimport { Trend, type CommonTrendProps } from './Trend';\nimport style from '../skeleton/skeleton.shadow.css';\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,SAASA,eAAe,EAAsBC,WAAW,EAAEC,IAAI,EAAEC,OAAO,QAAQ,eAAe;AAC/F,SAASC,gBAAgB,QAAQ,mCAAmC;AACpE,OAAOC,mBAAmB,MAAM,sDAAsD;AACtF,OAAOC,mBAAmB,MAAM,kCAAkC;AAClE,SAASC,GAAG,QAAQ,mBAAmB;AACvC,OAAOC,KAAK,MAAM,OAAO;AAEzB,SAASC,KAAK,QAA+B,SAAS;AAAC;AAAA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AAE7C,OAAO,IAAMC,SAA0D,GAAGnE,eAAe,CACvFa,aAAa,EACb,CAAC,CAAC,EACF;EACEuD,YAAY,EAAE,CACZ,YAAM;IACJ,OAAO;MACLC,YAAY,EAAE,SAAdA,YAAYA,CAAGC,KAAqB,EAAK;QACvC,OAAOrE,WAAW,CAACqE,KAAK,EAAE;UAAE3B,QAAQ,EAAE;QAAK,CAAC,CAAC;MAC/C;IACF,CAAC;EACH,CAAC;AAEL,CACF,CAAC;AAEDwB,SAAS,CAACD,WAAW,GAAG,qBAAqB","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"Line.js","names":["Box","createComponent","assignProps","Root","sstyled","extractAriaProps","resolveColorEnhance","uniqueIDEnhancement","React","Trend","style","_sstyled","insert","TrendLineRoot","_Trend","_classCallCheck","_callSuper","arguments","_inherits","_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 { Box } from '@semcore/base-components';\nimport { createComponent, assignProps, Root, sstyled } from '@semcore/core';\nimport { extractAriaProps } from '@semcore/core/lib/utils/ariaProps';\nimport resolveColorEnhance from '@semcore/core/lib/utils/enhances/resolveColorEnhance';\nimport uniqueIDEnhancement from '@semcore/core/lib/utils/uniqueID';\nimport React from 'react';\n\nimport { Trend, type CommonTrendProps } from './Trend';\nimport style from '../skeleton/skeleton.shadow.css';\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\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 = createComponent<'svg', TrendLineProps, {}, typeof TrendLineRoot.enhance>(TrendLineRoot);\n\nTrendLine.displayName = 'MiniChart.TrendLine';\n\nexport const TrendArea = createComponent<'svg', TrendLineProps, {}, typeof TrendLineRoot.enhance>(\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,SAASA,GAAG,QAAQ,0BAA0B;AAC9C,SAASC,eAAe,EAAEC,WAAW,EAAEC,IAAI,EAAEC,OAAO,QAAQ,eAAe;AAC3E,SAASC,gBAAgB,QAAQ,mCAAmC;AACpE,OAAOC,mBAAmB,MAAM,sDAAsD;AACtF,OAAOC,mBAAmB,MAAM,kCAAkC;AAClE,OAAOC,KAAK,MAAM,OAAO;AAEzB,SAASC,KAAK,QAA+B,SAAS;AAAC;AAAA,IAAAC,KAAA,8BAAAC,QAAA,CAAAC,MAAA;AAAA;AAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;AAAA;AAAA,IAyBjDC,aAAa,0BAAAC,MAAA;EAAA,SAAAD,cAAA;IAAAE,eAAA,OAAAF,aAAA;IAAA,OAAAG,UAAA,OAAAH,aAAA,EAAAI,SAAA;EAAA;EAAAC,SAAA,CAAAL,aAAA,EAAAC,MAAA;EAAA,OA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C;AAEL,CACF,CAAC;AAEDwB,SAAS,CAACD,WAAW,GAAG,qBAAqB","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Trend.js","names":["Component","React","Trend","_Component","_this","_len","arguments","length","args","Array","_key","_classCallCheck","_callSuper","concat","_defineProperty","width","height","createRef","_inherits","_createClass","key","value","componentDidMount","setSizes","componentDidUpdate","prevProps","w","props","h","data","get","_this$state","state","defaultHeight","defaultWidth","containerRef","current","boundingClientRect","getBoundingClientRect","setState"],"sources":["../../../../src/component/trend/Trend.tsx"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"Trend.js","names":["Component","React","Trend","_Component","_this","_len","arguments","length","args","Array","_key","_classCallCheck","_callSuper","concat","_defineProperty","width","height","createRef","_inherits","_createClass","key","value","componentDidMount","setSizes","componentDidUpdate","prevProps","w","props","h","data","get","_this$state","state","defaultHeight","defaultWidth","containerRef","current","boundingClientRect","getBoundingClientRect","setState"],"sources":["../../../../src/component/trend/Trend.tsx"],"sourcesContent":["import type { BoxProps } from '@semcore/base-components';\nimport { Component } from '@semcore/core';\nimport React from 'react';\n\nexport type CommonTrendProps = BoxProps & {\n /**\n * Flag to enable animate of charts\n * @default true\n */\n animate?: boolean;\n\n /**\n * Flag to enable skeleton\n * @default false\n */\n loading?: boolean;\n\n /**\n * Data for chart\n */\n data: any[];\n};\n\nexport abstract class Trend<\n P extends CommonTrendProps,\n E extends readonly ((...args: any[]) => any)[],\n> extends Component<P, E, Readonly<{}>, { width: number; height: number }> {\n state = {\n width: 200,\n height: 100,\n };\n\n containerRef = React.createRef<HTMLDivElement>();\n\n componentDidMount() {\n this.setSizes();\n }\n\n componentDidUpdate(prevProps: P) {\n if (\n prevProps.w !== this.props.w ||\n prevProps.h !== this.props.h ||\n prevProps.data !== this.props.data\n ) {\n this.setSizes();\n }\n }\n\n get defaultWidth(): number {\n const { width, height } = this.state;\n\n return (width / height) * this.defaultHeight;\n }\n\n get defaultHeight(): number {\n return 100;\n }\n\n get svgWidth(): number {\n return this.defaultWidth;\n }\n\n get svgHeight(): number {\n return this.defaultHeight;\n }\n\n setSizes() {\n if (this.containerRef.current) {\n const boundingClientRect = this.containerRef.current.getBoundingClientRect();\n\n const { width, height } = boundingClientRect;\n\n if (width > 0 && height > 0) {\n this.setState({ width, height });\n }\n }\n }\n}\n"],"mappings":";;;;;AACA,SAASA,SAAS,QAAQ,eAAe;AACzC,OAAOC,KAAK,MAAM,OAAO;AAqBzB,WAAsBC,KAAK,0BAAAC,UAAA;EAAA,SAAAD,MAAA;IAAA,IAAAE,KAAA;IAAA,SAAAC,IAAA,GAAAC,SAAA,CAAAC,MAAA,EAAAC,IAAA,OAAAC,KAAA,CAAAJ,IAAA,GAAAK,IAAA,MAAAA,IAAA,GAAAL,IAAA,EAAAK,IAAA;MAAAF,IAAA,CAAAE,IAAA,IAAAJ,SAAA,CAAAI,IAAA;IAAA;IAAAC,eAAA,OAAAT,KAAA;IAAAE,KAAA,GAAAQ,UAAA,OAAAV,KAAA,KAAAW,MAAA,CAAAL,IAAA;IAAAM,eAAA,CAAAV,KAAA,WAIjB;MACNW,KAAK,EAAE,GAAG;MACVC,MAAM,EAAE;IACV,CAAC;IAAAF,eAAA,CAAAV,KAAA,+BAEcH,KAAK,CAACgB,SAAS,CAAiB,CAAC;IAAA,OAAAb,KAAA;EAAA;EAAAc,SAAA,CAAAhB,KAAA,EAAAC,UAAA;EAAA,OAAAgB,YAAA,CAAAjB,KAAA;IAAAkB,GAAA;IAAAC,KAAA,EAEhD,SAAAC,iBAAiBA,CAAA,EAAG;MAClB,IAAI,CAACC,QAAQ,CAAC,CAAC;IACjB;EAAC;IAAAH,GAAA;IAAAC,KAAA,EAED,SAAAG,kBAAkBA,CAACC,SAAY,EAAE;MAC/B,IACEA,SAAS,CAACC,CAAC,KAAK,IAAI,CAACC,KAAK,CAACD,CAAC,IAC5BD,SAAS,CAACG,CAAC,KAAK,IAAI,CAACD,KAAK,CAACC,CAAC,IAC5BH,SAAS,CAACI,IAAI,KAAK,IAAI,CAACF,KAAK,CAACE,IAAI,EAClC;QACA,IAAI,CAACN,QAAQ,CAAC,CAAC;MACjB;IACF;EAAC;IAAAH,GAAA;IAAAU,GAAA,EAED,SAAAA,IAAA,EAA2B;MACzB,IAAAC,WAAA,GAA0B,IAAI,CAACC,KAAK;QAA5BjB,KAAK,GAAAgB,WAAA,CAALhB,KAAK;QAAEC,MAAM,GAAAe,WAAA,CAANf,MAAM;MAErB,OAAQD,KAAK,GAAGC,MAAM,GAAI,IAAI,CAACiB,aAAa;IAC9C;EAAC;IAAAb,GAAA;IAAAU,GAAA,EAED,SAAAA,IAAA,EAA4B;MAC1B,OAAO,GAAG;IACZ;EAAC;IAAAV,GAAA;IAAAU,GAAA,EAED,SAAAA,IAAA,EAAuB;MACrB,OAAO,IAAI,CAACI,YAAY;IAC1B;EAAC;IAAAd,GAAA;IAAAU,GAAA,EAED,SAAAA,IAAA,EAAwB;MACtB,OAAO,IAAI,CAACG,aAAa;IAC3B;EAAC;IAAAb,GAAA;IAAAC,KAAA,EAED,SAAAE,QAAQA,CAAA,EAAG;MACT,IAAI,IAAI,CAACY,YAAY,CAACC,OAAO,EAAE;QAC7B,IAAMC,kBAAkB,GAAG,IAAI,CAACF,YAAY,CAACC,OAAO,CAACE,qBAAqB,CAAC,CAAC;QAE5E,IAAQvB,KAAK,GAAasB,kBAAkB,CAApCtB,KAAK;UAAEC,MAAM,GAAKqB,kBAAkB,CAA7BrB,MAAM;QAErB,IAAID,KAAK,GAAG,CAAC,IAAIC,MAAM,GAAG,CAAC,EAAE;UAC3B,IAAI,CAACuB,QAAQ,CAAC;YAAExB,KAAK,EAALA,KAAK;YAAEC,MAAM,EAANA;UAAO,CAAC,CAAC;QAClC;MACF;IACF;EAAC;AAAA,EAlDOhB,SAAS","ignoreList":[]}
|
|
@@ -4,11 +4,11 @@ import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
|
4
4
|
import _callSuper from "@babel/runtime/helpers/esm/callSuper";
|
|
5
5
|
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
6
6
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
7
|
-
import {
|
|
7
|
+
import { sstyled, assignProps, Component, createComponent } from "@semcore/core";
|
|
8
|
+
import { Box } from "@semcore/base-components";
|
|
8
9
|
import { extractAriaProps } from "@semcore/core/lib/utils/ariaProps";
|
|
9
10
|
import resolveColorEnhance from "@semcore/core/lib/utils/enhances/resolveColorEnhance";
|
|
10
11
|
import { cssVariableEnhance } from "@semcore/core/lib/utils/useCssVariable";
|
|
11
|
-
import { Box } from "@semcore/flex-box";
|
|
12
12
|
import React from "react";
|
|
13
13
|
import { ScoreDonutUtils } from "../../utils/ScoreDonutUtils.mjs";
|
|
14
14
|
/*!__reshadow-styles__:"./donut.shadow.css"*/
|
|
@@ -16,19 +16,19 @@ var style = (
|
|
|
16
16
|
/*__reshadow_css_start__*/
|
|
17
17
|
(sstyled.insert(
|
|
18
18
|
/*__inner_css_start__*/
|
|
19
|
-
"@keyframes
|
|
19
|
+
"@keyframes pulse_w54vj{0%,to{opacity:1}50%{opacity:.4}}.___SDonutContainer_w54vj_gg_.__loading_w54vj_gg_,.___SLineGauge_w54vj_gg_.__loading_w54vj_gg_,.___STrendBar_w54vj_gg_.__loading_w54vj_gg_,.___STrendLine_w54vj_gg_.__loading_w54vj_gg_{animation-name:pulse_w54vj;animation-iteration-count:infinite;animation-timing-function:ease-in-out;animation-duration:1.6s;will-change:opacity}.___SDonutContainer_w54vj_gg_.__semi_w54vj_gg_ g{transform:rotate(180deg) translate(-24px,-24px)}.___SDonutContainer_w54vj_gg_ g{transform:rotate(-90deg) translate(-24px)}.___SDonutContainer_w54vj_gg_.__animate_w54vj_gg_ circle{transition:all var(--intergalactic-duration-extra-slow, 500) ease-in-out}",
|
|
20
20
|
/*__inner_css_end__*/
|
|
21
|
-
"
|
|
21
|
+
"w54vj_gg_"
|
|
22
22
|
), /*__reshadow_css_end__*/
|
|
23
23
|
{
|
|
24
|
-
"__SLineGauge": "
|
|
25
|
-
"_loading": "
|
|
26
|
-
"__SDonutContainer": "
|
|
27
|
-
"__STrendLine": "
|
|
28
|
-
"__STrendBar": "
|
|
29
|
-
"@pulse": "
|
|
30
|
-
"_animate": "
|
|
31
|
-
"_semi": "
|
|
24
|
+
"__SLineGauge": "___SLineGauge_w54vj_gg_",
|
|
25
|
+
"_loading": "__loading_w54vj_gg_",
|
|
26
|
+
"__SDonutContainer": "___SDonutContainer_w54vj_gg_",
|
|
27
|
+
"__STrendLine": "___STrendLine_w54vj_gg_",
|
|
28
|
+
"__STrendBar": "___STrendBar_w54vj_gg_",
|
|
29
|
+
"@pulse": "pulse_w54vj",
|
|
30
|
+
"_animate": "__animate_w54vj_gg_",
|
|
31
|
+
"_semi": "__semi_w54vj_gg_"
|
|
32
32
|
})
|
|
33
33
|
);
|
|
34
34
|
var DonutRoot = /* @__PURE__ */ (function(_Component) {
|
|
@@ -4,37 +4,37 @@ import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
|
4
4
|
import _callSuper from "@babel/runtime/helpers/esm/callSuper";
|
|
5
5
|
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
6
6
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
7
|
-
import {
|
|
7
|
+
import { sstyled, assignProps, Component, createComponent } from "@semcore/core";
|
|
8
|
+
import { Box, Flex } from "@semcore/base-components";
|
|
8
9
|
import resolveColorEnhance from "@semcore/core/lib/utils/enhances/resolveColorEnhance";
|
|
9
|
-
import { Box, Flex } from "@semcore/flex-box";
|
|
10
10
|
import React from "react";
|
|
11
11
|
/*!__reshadow-styles__:"./line.shadow.css"*/
|
|
12
12
|
var style = (
|
|
13
13
|
/*__reshadow_css_start__*/
|
|
14
14
|
(sstyled.insert(
|
|
15
15
|
/*__inner_css_start__*/
|
|
16
|
-
"@keyframes
|
|
16
|
+
"@keyframes pulse_1y4lp{0%,to{opacity:1}50%{opacity:.4}}@keyframes move-line_1y4lp{0%{transform:translateX(0)}to{transform:translateX(100%)}}.___SDonutContainer_1y4lp_gg_.__loading_1y4lp_gg_,.___SLineGauge_1y4lp_gg_.__loading_1y4lp_gg_,.___STrendBar_1y4lp_gg_.__loading_1y4lp_gg_,.___STrendLine_1y4lp_gg_.__loading_1y4lp_gg_{animation-name:pulse_1y4lp;animation-iteration-count:infinite;animation-timing-function:ease-in-out;animation-duration:1.6s;will-change:opacity}.___SLineGauge_1y4lp_gg_{height:8px;background-color:var(--base-bg-color_1y4lp, var(--intergalactic-chart-grid-bar-chart-base-bg, rgb(241, 242, 242)));border-radius:var(--intergalactic-chart-rounded, 2px);overflow:hidden;position:relative}.___SLineValue_1y4lp_gg_{height:8px;border-radius:var(--intergalactic-chart-rounded, 2px)0 0 var(--intergalactic-chart-rounded, 2px)}.___SLineValue_1y4lp_gg_.__percent_1y4lp_gg_{width:var(--percent_1y4lp)}.___SLineSegmentItem_1y4lp_gg_.__color_1y4lp_gg_,.___SLineValue_1y4lp_gg_.__color_1y4lp_gg_{background-color:var(--color_1y4lp, var(--intergalactic-chart-palette-order-1, rgb(102, 107, 219)))}.___SLineGauge_1y4lp_gg_.__segments_1y4lp_gg_{border-radius:var(--intergalactic-progress-bar-rounded, 6px)}.___SAnimationLine_1y4lp_gg_,.___SLineGaugeSegment_1y4lp_gg_{position:absolute;top:0;left:0;right:0;bottom:0}.___SLineSegmentItem_1y4lp_gg_:last-child{margin-right:0;border-right:none}.___SLineSegmentItem_1y4lp_gg_{height:8px;background:0 0;border-right-color:var(--intergalactic-chart-grid-border, #fff);border-right-style:solid;border-right-width:1px;box-sizing:content-box}.___SAnimationLine_1y4lp_gg_{background-color:var(--intergalactic-chart-grid-bar-chart-base-bg, rgb(241, 242, 242));transition:all var(--intergalactic-duration-extra-slow, 500) ease-in-out;animation-name:move-line_1y4lp;animation-duration:.5s;animation-timing-function:ease-in-out;animation-fill-mode:forwards}",
|
|
17
17
|
/*__inner_css_end__*/
|
|
18
|
-
"
|
|
18
|
+
"1y4lp_gg_"
|
|
19
19
|
), /*__reshadow_css_end__*/
|
|
20
20
|
{
|
|
21
|
-
"__SLineGauge": "
|
|
22
|
-
"_loading": "
|
|
23
|
-
"__SDonutContainer": "
|
|
24
|
-
"__STrendLine": "
|
|
25
|
-
"__STrendBar": "
|
|
26
|
-
"@pulse": "
|
|
27
|
-
"__SLineValue": "
|
|
28
|
-
"_percent": "
|
|
29
|
-
"--percent": "--
|
|
30
|
-
"_color": "
|
|
31
|
-
"__SLineSegmentItem": "
|
|
32
|
-
"_segments": "
|
|
33
|
-
"__SLineGaugeSegment": "
|
|
34
|
-
"__SAnimationLine": "
|
|
35
|
-
"@move-line": "move-
|
|
36
|
-
"--base-bg-color": "--base-bg-
|
|
37
|
-
"--color": "--
|
|
21
|
+
"__SLineGauge": "___SLineGauge_1y4lp_gg_",
|
|
22
|
+
"_loading": "__loading_1y4lp_gg_",
|
|
23
|
+
"__SDonutContainer": "___SDonutContainer_1y4lp_gg_",
|
|
24
|
+
"__STrendLine": "___STrendLine_1y4lp_gg_",
|
|
25
|
+
"__STrendBar": "___STrendBar_1y4lp_gg_",
|
|
26
|
+
"@pulse": "pulse_1y4lp",
|
|
27
|
+
"__SLineValue": "___SLineValue_1y4lp_gg_",
|
|
28
|
+
"_percent": "__percent_1y4lp_gg_",
|
|
29
|
+
"--percent": "--percent_1y4lp",
|
|
30
|
+
"_color": "__color_1y4lp_gg_",
|
|
31
|
+
"__SLineSegmentItem": "___SLineSegmentItem_1y4lp_gg_",
|
|
32
|
+
"_segments": "__segments_1y4lp_gg_",
|
|
33
|
+
"__SLineGaugeSegment": "___SLineGaugeSegment_1y4lp_gg_",
|
|
34
|
+
"__SAnimationLine": "___SAnimationLine_1y4lp_gg_",
|
|
35
|
+
"@move-line": "move-line_1y4lp",
|
|
36
|
+
"--base-bg-color": "--base-bg-color_1y4lp",
|
|
37
|
+
"--color": "--color_1y4lp"
|
|
38
38
|
})
|
|
39
39
|
);
|
|
40
40
|
var LineRoot = /* @__PURE__ */ (function(_Component) {
|
|
@@ -5,10 +5,10 @@ import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
|
5
5
|
import _callSuper from "@babel/runtime/helpers/esm/callSuper";
|
|
6
6
|
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
7
7
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
8
|
-
import {
|
|
8
|
+
import { sstyled, assignProps, createComponent } from "@semcore/core";
|
|
9
|
+
import { Box } from "@semcore/base-components";
|
|
9
10
|
import { extractAriaProps } from "@semcore/core/lib/utils/ariaProps";
|
|
10
11
|
import resolveColorEnhance from "@semcore/core/lib/utils/enhances/resolveColorEnhance";
|
|
11
|
-
import { Box } from "@semcore/flex-box";
|
|
12
12
|
import React from "react";
|
|
13
13
|
import { Trend } from "./Trend.mjs";
|
|
14
14
|
/*!__reshadow-styles__:"../skeleton/skeleton.shadow.css"*/
|
|
@@ -16,17 +16,17 @@ var style = (
|
|
|
16
16
|
/*__reshadow_css_start__*/
|
|
17
17
|
(sstyled.insert(
|
|
18
18
|
/*__inner_css_start__*/
|
|
19
|
-
"@keyframes
|
|
19
|
+
"@keyframes pulse_1yrsa{0%,to{opacity:1}50%{opacity:.4}}.___SDonutContainer_1yrsa_gg_.__loading_1yrsa_gg_,.___SLineGauge_1yrsa_gg_.__loading_1yrsa_gg_,.___STrendBar_1yrsa_gg_.__loading_1yrsa_gg_,.___STrendLine_1yrsa_gg_.__loading_1yrsa_gg_{animation-name:pulse_1yrsa;animation-iteration-count:infinite;animation-timing-function:ease-in-out;animation-duration:1.6s;will-change:opacity}",
|
|
20
20
|
/*__inner_css_end__*/
|
|
21
|
-
"
|
|
21
|
+
"1yrsa_gg_"
|
|
22
22
|
), /*__reshadow_css_end__*/
|
|
23
23
|
{
|
|
24
|
-
"__SLineGauge": "
|
|
25
|
-
"_loading": "
|
|
26
|
-
"__SDonutContainer": "
|
|
27
|
-
"__STrendLine": "
|
|
28
|
-
"__STrendBar": "
|
|
29
|
-
"@pulse": "
|
|
24
|
+
"__SLineGauge": "___SLineGauge_1yrsa_gg_",
|
|
25
|
+
"_loading": "__loading_1yrsa_gg_",
|
|
26
|
+
"__SDonutContainer": "___SDonutContainer_1yrsa_gg_",
|
|
27
|
+
"__STrendLine": "___STrendLine_1yrsa_gg_",
|
|
28
|
+
"__STrendBar": "___STrendBar_1yrsa_gg_",
|
|
29
|
+
"@pulse": "pulse_1yrsa"
|
|
30
30
|
})
|
|
31
31
|
);
|
|
32
32
|
var TrendBarRoot = /* @__PURE__ */ (function(_Trend) {
|
|
@@ -112,7 +112,7 @@ var TrendHistogram = createComponent(TrendBarRoot, {}, {
|
|
|
112
112
|
};
|
|
113
113
|
}]
|
|
114
114
|
});
|
|
115
|
-
|
|
115
|
+
TrendHistogram.displayName = "MiniChart.TrendHistogram";
|
|
116
116
|
export {
|
|
117
117
|
TrendBar,
|
|
118
118
|
TrendHistogram
|
|
@@ -5,11 +5,11 @@ import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
|
5
5
|
import _callSuper from "@babel/runtime/helpers/esm/callSuper";
|
|
6
6
|
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
7
7
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
8
|
-
import {
|
|
8
|
+
import { sstyled, assignProps, createComponent } from "@semcore/core";
|
|
9
|
+
import { Box } from "@semcore/base-components";
|
|
9
10
|
import { extractAriaProps } from "@semcore/core/lib/utils/ariaProps";
|
|
10
11
|
import resolveColorEnhance from "@semcore/core/lib/utils/enhances/resolveColorEnhance";
|
|
11
12
|
import uniqueIDEnhancement from "@semcore/core/lib/utils/uniqueID";
|
|
12
|
-
import { Box } from "@semcore/flex-box";
|
|
13
13
|
import React from "react";
|
|
14
14
|
import { Trend } from "./Trend.mjs";
|
|
15
15
|
/*!__reshadow-styles__:"../skeleton/skeleton.shadow.css"*/
|
|
@@ -17,17 +17,17 @@ var style = (
|
|
|
17
17
|
/*__reshadow_css_start__*/
|
|
18
18
|
(sstyled.insert(
|
|
19
19
|
/*__inner_css_start__*/
|
|
20
|
-
"@keyframes
|
|
20
|
+
"@keyframes pulse_1yrsa{0%,to{opacity:1}50%{opacity:.4}}.___SDonutContainer_1yrsa_gg_.__loading_1yrsa_gg_,.___SLineGauge_1yrsa_gg_.__loading_1yrsa_gg_,.___STrendBar_1yrsa_gg_.__loading_1yrsa_gg_,.___STrendLine_1yrsa_gg_.__loading_1yrsa_gg_{animation-name:pulse_1yrsa;animation-iteration-count:infinite;animation-timing-function:ease-in-out;animation-duration:1.6s;will-change:opacity}",
|
|
21
21
|
/*__inner_css_end__*/
|
|
22
|
-
"
|
|
22
|
+
"1yrsa_gg_"
|
|
23
23
|
), /*__reshadow_css_end__*/
|
|
24
24
|
{
|
|
25
|
-
"__SLineGauge": "
|
|
26
|
-
"_loading": "
|
|
27
|
-
"__SDonutContainer": "
|
|
28
|
-
"__STrendLine": "
|
|
29
|
-
"__STrendBar": "
|
|
30
|
-
"@pulse": "
|
|
25
|
+
"__SLineGauge": "___SLineGauge_1yrsa_gg_",
|
|
26
|
+
"_loading": "__loading_1yrsa_gg_",
|
|
27
|
+
"__SDonutContainer": "___SDonutContainer_1yrsa_gg_",
|
|
28
|
+
"__STrendLine": "___STrendLine_1yrsa_gg_",
|
|
29
|
+
"__STrendBar": "___STrendBar_1yrsa_gg_",
|
|
30
|
+
"@pulse": "pulse_1yrsa"
|
|
31
31
|
})
|
|
32
32
|
);
|
|
33
33
|
var TrendLineRoot = /* @__PURE__ */ (function(_Trend) {
|
package/lib/esm/index.mjs
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import "./component/score/index.mjs";
|
|
2
|
+
import "./component/trend/index.mjs";
|
|
2
3
|
import { ScoreLine } from "./component/score/Line.mjs";
|
|
4
|
+
import { ScoreDonut, ScoreSemiDonut } from "./component/score/Donut.mjs";
|
|
3
5
|
import { TrendHistogram, TrendBar } from "./component/trend/Bar.mjs";
|
|
4
6
|
import { TrendArea, TrendLine } from "./component/trend/Line.mjs";
|
|
5
7
|
var miniCharts = {
|
|
@@ -1,14 +1,9 @@
|
|
|
1
|
-
import { type
|
|
2
|
-
import resolveColorEnhance from '@semcore/core/lib/utils/enhances/resolveColorEnhance';
|
|
3
|
-
import { cssVariableEnhance } from '@semcore/core/lib/utils/useCssVariable';
|
|
4
|
-
import { type BoxProps } from '@semcore/flex-box';
|
|
1
|
+
import { type BoxProps } from '@semcore/base-components';
|
|
5
2
|
import type { CommonScoreProps } from './Score';
|
|
6
3
|
export type ScoreDonutProps = BoxProps & CommonScoreProps;
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
export declare const ScoreSemiDonut: ComponentType<ScoreDonutProps, {}, {}, Enhances>;
|
|
14
|
-
export {};
|
|
4
|
+
export declare const ScoreDonut: import("@semcore/core").Intergalactic.Component<"svg", ScoreDonutProps, {}, readonly [<T extends {}>(props: T) => T & {
|
|
5
|
+
duration: string;
|
|
6
|
+
}, (props: any) => any]>;
|
|
7
|
+
export declare const ScoreSemiDonut: import("@semcore/core").Intergalactic.Component<"svg", ScoreDonutProps, {}, readonly [<T extends {}>(props: T) => T & {
|
|
8
|
+
duration: string;
|
|
9
|
+
}, (props: any) => any]>;
|