@semcore/mini-chart 0.29.1 → 16.0.0-prerelease.10

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.
@@ -1,104 +1,123 @@
1
- import x from "@babel/runtime/helpers/esm/objectSpread2";
2
- import N from "@babel/runtime/helpers/esm/classCallCheck";
3
- import R from "@babel/runtime/helpers/esm/createClass";
4
- import X from "@babel/runtime/helpers/esm/inherits";
5
- import j from "@babel/runtime/helpers/esm/createSuper";
6
- import S from "@babel/runtime/helpers/esm/defineProperty";
7
- import { sstyled as z } from "@semcore/utils/lib/core/index";
8
- import F, { sstyled as d, assignProps as G, Component as M } from "@semcore/core";
9
- import e from "react";
10
- import { Box as g, Flex as q } from "@semcore/flex-box";
11
- import H from "@semcore/utils/lib/enhances/resolveColorEnhance";
12
- var J = (
1
+ import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
2
+ import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
3
+ import _createClass from "@babel/runtime/helpers/esm/createClass";
4
+ import _inherits from "@babel/runtime/helpers/esm/inherits";
5
+ import _createSuper from "@babel/runtime/helpers/esm/createSuper";
6
+ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
7
+ import { sstyled, createComponent, assignProps, Component } from "@semcore/core";
8
+ import React from "react";
9
+ import { Box, Flex } from "@semcore/flex-box";
10
+ import resolveColorEnhance from "@semcore/core/lib/utils/enhances/resolveColorEnhance";
11
+ var style = (
13
12
  /*__reshadow_css_start__*/
14
- (z.insert(
13
+ (sstyled.insert(
15
14
  /*__inner_css_start__*/
16
- "@keyframes pulse_1b7u0{0%,to{opacity:1}50%{opacity:.4}}@keyframes move-line_1b7u0{0%{transform:translateX(0)}to{transform:translateX(100%)}}.___SDonutContainer_1b7u0_gg_.__loading_1b7u0_gg_,.___SLineGauge_1b7u0_gg_.__loading_1b7u0_gg_,.___STrendBar_1b7u0_gg_.__loading_1b7u0_gg_,.___STrendLine_1b7u0_gg_.__loading_1b7u0_gg_{animation-name:pulse_1b7u0;animation-iteration-count:infinite;animation-timing-function:ease-in-out;animation-duration:1.6s;will-change:opacity}.___SLineGauge_1b7u0_gg_{height:8px;background-color:var(--base-bg-color_1b7u0, var(--intergalactic-chart-grid-bar-chart-base-bg, #e0e1e9));border-radius:var(--intergalactic-chart-rounded, 2px);overflow:hidden;position:relative}.___SLineValue_1b7u0_gg_{height:8px;border-radius:var(--intergalactic-chart-rounded, 2px)0 0 var(--intergalactic-chart-rounded, 2px)}.___SLineValue_1b7u0_gg_.__percent_1b7u0_gg_{width:var(--percent_1b7u0)}.___SLineSegmentItem_1b7u0_gg_.__color_1b7u0_gg_,.___SLineValue_1b7u0_gg_.__color_1b7u0_gg_{background-color:var(--color_1b7u0, var(--intergalactic-chart-palette-order-1, #2bb3ff))}.___SLineGauge_1b7u0_gg_.__segments_1b7u0_gg_{border-radius:var(--intergalactic-progress-bar-rounded, 6px)}.___SAnimationLine_1b7u0_gg_,.___SLineGaugeSegment_1b7u0_gg_{position:absolute;top:0;left:0;right:0;bottom:0}.___SLineSegmentItem_1b7u0_gg_:last-child{margin-right:0;border-right:none}.___SLineSegmentItem_1b7u0_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_1b7u0_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_1b7u0;animation-duration:.5s;animation-timing-function:ease-in-out;animation-fill-mode:forwards}",
17
- "1b7u0_gg_"
15
+ "@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}",
16
+ "2vm7d_gg_"
18
17
  ), {
19
- __SLineGauge: "___SLineGauge_1b7u0_gg_",
20
- _loading: "__loading_1b7u0_gg_",
21
- __SDonutContainer: "___SDonutContainer_1b7u0_gg_",
22
- __STrendLine: "___STrendLine_1b7u0_gg_",
23
- __STrendBar: "___STrendBar_1b7u0_gg_",
24
- "@pulse": "pulse_1b7u0",
25
- "--base-bg-color": "--base-bg-color_1b7u0",
26
- __SLineValue: "___SLineValue_1b7u0_gg_",
27
- _percent: "__percent_1b7u0_gg_",
28
- "--percent": "--percent_1b7u0",
29
- _color: "__color_1b7u0_gg_",
30
- __SLineSegmentItem: "___SLineSegmentItem_1b7u0_gg_",
31
- "--color": "--color_1b7u0",
32
- _segments: "__segments_1b7u0_gg_",
33
- __SLineGaugeSegment: "___SLineGaugeSegment_1b7u0_gg_",
34
- __SAnimationLine: "___SAnimationLine_1b7u0_gg_",
35
- "@move-line": "move-line_1b7u0"
18
+ "__SLineGauge": "___SLineGauge_2vm7d_gg_",
19
+ "_loading": "__loading_2vm7d_gg_",
20
+ "__SDonutContainer": "___SDonutContainer_2vm7d_gg_",
21
+ "__STrendLine": "___STrendLine_2vm7d_gg_",
22
+ "__STrendBar": "___STrendBar_2vm7d_gg_",
23
+ "@pulse": "pulse_2vm7d",
24
+ "--base-bg-color": "--base-bg-color_2vm7d",
25
+ "__SLineValue": "___SLineValue_2vm7d_gg_",
26
+ "_percent": "__percent_2vm7d_gg_",
27
+ "--percent": "--percent_2vm7d",
28
+ "_color": "__color_2vm7d_gg_",
29
+ "__SLineSegmentItem": "___SLineSegmentItem_2vm7d_gg_",
30
+ "--color": "--color_2vm7d",
31
+ "_segments": "__segments_2vm7d_gg_",
32
+ "__SLineGaugeSegment": "___SLineGaugeSegment_2vm7d_gg_",
33
+ "__SAnimationLine": "___SAnimationLine_2vm7d_gg_",
34
+ "@move-line": "move-line_2vm7d"
36
35
  })
37
- ), l = /* @__PURE__ */ function(p) {
38
- X(n, p);
39
- var v = j(n);
40
- function n() {
41
- return N(this, n), v.apply(this, arguments);
36
+ );
37
+ var LineRoot = /* @__PURE__ */ function(_Component) {
38
+ _inherits(LineRoot2, _Component);
39
+ var _super = _createSuper(LineRoot2);
40
+ function LineRoot2() {
41
+ _classCallCheck(this, LineRoot2);
42
+ return _super.apply(this, arguments);
42
43
  }
43
- return R(n, [{
44
+ _createClass(LineRoot2, [{
44
45
  key: "getSegmentProps",
45
- value: function(t) {
46
- var _ = this.asProps, c = _.children, L = _.resolveColor, a = 0;
47
- e.Children.forEach(c, function(s) {
48
- /* @__PURE__ */ e.isValidElement(s) && (a = a + s.props.value);
46
+ value: function getSegmentProps(segmentProps) {
47
+ var _this$asProps = this.asProps, children = _this$asProps.children, resolveColor = _this$asProps.resolveColor;
48
+ var sum = 0;
49
+ React.Children.forEach(children, function(child) {
50
+ if (/* @__PURE__ */ React.isValidElement(child)) {
51
+ sum = sum + child.props.value;
52
+ }
49
53
  });
50
- var u = a > 0 ? 100 * t.value / a : 0;
54
+ var width = sum > 0 ? 100 * segmentProps.value / sum : 0;
51
55
  return {
52
- w: "".concat(u, "%"),
53
- "use:color": L(t.color)
56
+ w: "".concat(width, "%"),
57
+ "use:color": resolveColor(segmentProps.color)
54
58
  };
55
59
  }
56
60
  }, {
57
61
  key: "render",
58
- value: function() {
59
- var t = this.asProps, _, c = g, L = g, a = g, u = q, s = g, r = this.asProps, f = r.value, y = r.styles, E = r.color, P = E === void 0 ? "chart-palette-order-1" : E, k = r.baseBgColor, m = r.resolveColor, B = r.loading, T = r.children, $ = r.Children, w = r.animate;
60
- if (T !== void 0) {
61
- var i;
62
- return i = d(y), /* @__PURE__ */ e.createElement(c, i.cn("SLineGauge", x({}, G({
63
- segments: !0,
64
- "base-bg-color": m(k)
65
- }, t))), /* @__PURE__ */ e.createElement(u, i.cn("SLineGaugeSegment", {}), /* @__PURE__ */ e.createElement($, i.cn("Children", {}))), w && /* @__PURE__ */ e.createElement(a, i.cn("SAnimationLine", {})));
62
+ value: function render() {
63
+ var _ref = this.asProps, _ref5;
64
+ var SLineGauge = Box;
65
+ var SLineValue = Box;
66
+ var SAnimationLine = Box;
67
+ var SLineGaugeSegment = Flex;
68
+ var SLineSegmentItem = Box;
69
+ 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;
70
+ if (children !== void 0) {
71
+ var _ref3;
72
+ return _ref3 = sstyled(styles), /* @__PURE__ */ React.createElement(SLineGauge, _ref3.cn("SLineGauge", _objectSpread({}, assignProps({
73
+ "segments": true,
74
+ "base-bg-color": resolveColor(baseBgColor)
75
+ }, _ref))), /* @__PURE__ */ React.createElement(SLineGaugeSegment, _ref3.cn("SLineGaugeSegment", {}), /* @__PURE__ */ React.createElement(Children, _ref3.cn("Children", {}))), animate && /* @__PURE__ */ React.createElement(SAnimationLine, _ref3.cn("SAnimationLine", {})));
66
76
  }
67
- var o = this.asProps.segments, C = [];
68
- if (o)
69
- for (var b = 0; b < o; b++) {
70
- var I, D = "calc((100% - ".concat(o - 1, "px) / ").concat(o, ")");
71
- C.push((I = d(y), /* @__PURE__ */ e.createElement(s, I.cn("SLineSegmentItem", {
72
- key: b,
73
- color: b < f ? m(P) : void 0,
74
- w: D
77
+ var segments = this.asProps.segments;
78
+ var SegmentItems = [];
79
+ if (segments) {
80
+ for (var i = 0; i < segments; i++) {
81
+ var _ref4;
82
+ var width = "calc((100% - ".concat(segments - 1, "px) / ").concat(segments, ")");
83
+ SegmentItems.push((_ref4 = sstyled(styles), /* @__PURE__ */ React.createElement(SLineSegmentItem, _ref4.cn("SLineSegmentItem", {
84
+ "key": i,
85
+ "color": i < value ? resolveColor(color) : void 0,
86
+ "w": width
75
87
  }))));
76
88
  }
77
- var V = "".concat(f, "%");
78
- return o && (V = "".concat(f / o * 100, "%")), _ = d(y), /* @__PURE__ */ e.createElement(c, _.cn("SLineGauge", x({}, G({
79
- "base-bg-color": m(k)
80
- }, t))), !B && /* @__PURE__ */ e.createElement(L, _.cn("SLineValue", {
81
- w: V,
82
- color: m(P)
83
- })), !!C.length && /* @__PURE__ */ e.createElement(u, _.cn("SLineGaugeSegment", {}), C), w && /* @__PURE__ */ e.createElement(a, _.cn("SAnimationLine", {})));
89
+ }
90
+ var percent = "".concat(value, "%");
91
+ if (segments) {
92
+ percent = "".concat(value / segments * 100, "%");
93
+ }
94
+ return _ref5 = sstyled(styles), /* @__PURE__ */ React.createElement(SLineGauge, _ref5.cn("SLineGauge", _objectSpread({}, assignProps({
95
+ "base-bg-color": resolveColor(baseBgColor)
96
+ }, _ref))), !loading && /* @__PURE__ */ React.createElement(SLineValue, _ref5.cn("SLineValue", {
97
+ "w": percent,
98
+ "color": resolveColor(color)
99
+ })), Boolean(SegmentItems.length) && /* @__PURE__ */ React.createElement(SLineGaugeSegment, _ref5.cn("SLineGaugeSegment", {}), SegmentItems), animate && /* @__PURE__ */ React.createElement(SAnimationLine, _ref5.cn("SAnimationLine", {})));
84
100
  }
85
- }]), n;
86
- }(M);
87
- S(l, "enhance", [H()]);
88
- S(l, "displayName", "ScoreLine");
89
- S(l, "style", J);
90
- S(l, "defaultProps", {
91
- animate: !0
101
+ }]);
102
+ return LineRoot2;
103
+ }(Component);
104
+ _defineProperty(LineRoot, "enhance", [resolveColorEnhance()]);
105
+ _defineProperty(LineRoot, "displayName", "ScoreLine");
106
+ _defineProperty(LineRoot, "style", style);
107
+ _defineProperty(LineRoot, "defaultProps", {
108
+ animate: true
92
109
  });
93
- function A(p) {
94
- var v = arguments[0], n, h = p.styles, t = g;
95
- return n = d(h), /* @__PURE__ */ e.createElement(t, n.cn("SLineSegmentItem", x({}, G({}, v))));
110
+ function Segment(props) {
111
+ var _ref2 = arguments[0], _ref6;
112
+ var styles = props.styles;
113
+ var SLineSegmentItem = Box;
114
+ return _ref6 = sstyled(styles), /* @__PURE__ */ React.createElement(SLineSegmentItem, _ref6.cn("SLineSegmentItem", _objectSpread({}, assignProps({}, _ref2))));
96
115
  }
97
- A.displayName = "Segment";
98
- var K = F(l, {
99
- Segment: A
116
+ Segment.displayName = "Segment";
117
+ var ScoreLine = createComponent(LineRoot, {
118
+ Segment
100
119
  });
101
- K.displayName = "MiniChart.ScoreLine";
120
+ ScoreLine.displayName = "MiniChart.ScoreLine";
102
121
  export {
103
- K as ScoreLine
122
+ ScoreLine
104
123
  };
@@ -1,40 +1,41 @@
1
- import w from "@babel/runtime/helpers/esm/toConsumableArray";
2
- import h from "@babel/runtime/helpers/esm/objectSpread2";
3
- import L from "@babel/runtime/helpers/esm/classCallCheck";
4
- import A from "@babel/runtime/helpers/esm/createClass";
5
- import D from "@babel/runtime/helpers/esm/inherits";
6
- import E from "@babel/runtime/helpers/esm/createSuper";
7
- import l from "@babel/runtime/helpers/esm/defineProperty";
8
- import { sstyled as R } from "@semcore/utils/lib/core/index";
9
- import v, { assignProps as y, sstyled as G } from "@semcore/core";
10
- import _ from "react";
11
- import N from "@semcore/utils/lib/enhances/resolveColorEnhance";
12
- import { Trend as $ } from "./Trend.mjs";
13
- import { Box as M } from "@semcore/flex-box";
14
- import { extractAriaProps as W } from "@semcore/utils/lib/ariaProps";
15
- var j = (
1
+ import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
2
+ import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
3
+ import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
4
+ import _createClass from "@babel/runtime/helpers/esm/createClass";
5
+ import _inherits from "@babel/runtime/helpers/esm/inherits";
6
+ import _createSuper from "@babel/runtime/helpers/esm/createSuper";
7
+ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
8
+ import { sstyled, createComponent, assignProps } from "@semcore/core";
9
+ import React from "react";
10
+ import resolveColorEnhance from "@semcore/core/lib/utils/enhances/resolveColorEnhance";
11
+ import { Trend } from "./Trend.mjs";
12
+ import { Box } from "@semcore/flex-box";
13
+ import { extractAriaProps } from "@semcore/core/lib/utils/ariaProps";
14
+ var style = (
16
15
  /*__reshadow_css_start__*/
17
- (R.insert(
16
+ (sstyled.insert(
18
17
  /*__inner_css_start__*/
19
- "@keyframes pulse_18ffn{0%,to{opacity:1}50%{opacity:.4}}.___SDonutContainer_18ffn_gg_.__loading_18ffn_gg_,.___SLineGauge_18ffn_gg_.__loading_18ffn_gg_,.___STrendBar_18ffn_gg_.__loading_18ffn_gg_,.___STrendLine_18ffn_gg_.__loading_18ffn_gg_{animation-name:pulse_18ffn;animation-iteration-count:infinite;animation-timing-function:ease-in-out;animation-duration:1.6s;will-change:opacity}",
20
- "18ffn_gg_"
18
+ "@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}",
19
+ "7jer1_gg_"
21
20
  ), {
22
- __SLineGauge: "___SLineGauge_18ffn_gg_",
23
- _loading: "__loading_18ffn_gg_",
24
- __SDonutContainer: "___SDonutContainer_18ffn_gg_",
25
- __STrendLine: "___STrendLine_18ffn_gg_",
26
- __STrendBar: "___STrendBar_18ffn_gg_",
27
- "@pulse": "pulse_18ffn"
21
+ "__SLineGauge": "___SLineGauge_7jer1_gg_",
22
+ "_loading": "__loading_7jer1_gg_",
23
+ "__SDonutContainer": "___SDonutContainer_7jer1_gg_",
24
+ "__STrendLine": "___STrendLine_7jer1_gg_",
25
+ "__STrendBar": "___STrendBar_7jer1_gg_",
26
+ "@pulse": "pulse_7jer1"
28
27
  })
29
- ), o = /* @__PURE__ */ function(g) {
30
- D(e, g);
31
- var s = E(e);
32
- function e() {
33
- return L(this, e), s.apply(this, arguments);
28
+ );
29
+ var TrendBarRoot = /* @__PURE__ */ function(_Trend) {
30
+ _inherits(TrendBarRoot2, _Trend);
31
+ var _super = _createSuper(TrendBarRoot2);
32
+ function TrendBarRoot2() {
33
+ _classCallCheck(this, TrendBarRoot2);
34
+ return _super.apply(this, arguments);
34
35
  }
35
- return A(e, [{
36
+ _createClass(TrendBarRoot2, [{
36
37
  key: "defaultData",
37
- get: function() {
38
+ get: function get() {
38
39
  return [{
39
40
  value: 20
40
41
  }, {
@@ -47,60 +48,71 @@ var j = (
47
48
  }
48
49
  }, {
49
50
  key: "data",
50
- get: function() {
51
- var i = this.asProps, r = i.data, t = i.loading;
52
- return t ? this.defaultData : r;
51
+ get: function get() {
52
+ var _this$asProps = this.asProps, data = _this$asProps.data, loading = _this$asProps.loading;
53
+ if (loading) {
54
+ return this.defaultData;
55
+ }
56
+ return data;
53
57
  }
54
58
  }, {
55
59
  key: "render",
56
- value: function() {
57
- var i = this.asProps, r, t = this, S = M, a = this.asProps, T = a.styles, u = a.resolveColor, C = a.isHistogram, B = a.animate, x = a.loading, f = this.defaultWidth / this.data.length, p = W(this.asProps), H = p.__excludeProps, k = p.extractedAriaProps;
58
- return r = G(T), /* @__PURE__ */ _.createElement(S, r.cn("STrendBar", h({}, y({
59
- ref: this.containerRef,
60
- __excludeProps: ["data"].concat(w(H))
61
- }, i))), /* @__PURE__ */ _.createElement("svg", r.cn("svg", h({
62
- width: "100%",
63
- height: "100%",
64
- viewBox: "0 0 ".concat(this.svgWidth, " ").concat(this.svgHeight),
65
- role: "img"
66
- }, k)), this.data.map(function(n, m) {
67
- var c = u("chart-palette-order-other-data");
68
- return n.color && (c = u(n.color)), /* @__PURE__ */ _.createElement("rect", {
69
- key: m,
70
- x: f * m,
71
- y: t.defaultHeight - n.value,
72
- width: C ? f : f * 0.8,
73
- height: n.value,
74
- fill: c
75
- }, B && !x && /* @__PURE__ */ _.createElement("animate", {
60
+ value: function render() {
61
+ var _ref = this.asProps, _ref2, _this = this;
62
+ var STrendBar = Box;
63
+ 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;
64
+ var step = this.defaultWidth / this.data.length;
65
+ var _extractAriaProps = extractAriaProps(this.asProps), __excludeProps = _extractAriaProps.__excludeProps, extractedAriaProps = _extractAriaProps.extractedAriaProps;
66
+ return _ref2 = sstyled(styles), /* @__PURE__ */ React.createElement(STrendBar, _ref2.cn("STrendBar", _objectSpread({}, assignProps({
67
+ "ref": this.containerRef,
68
+ "__excludeProps": ["data"].concat(_toConsumableArray(__excludeProps))
69
+ }, _ref))), /* @__PURE__ */ React.createElement("svg", _ref2.cn("svg", _objectSpread({
70
+ "width": "100%",
71
+ "height": "100%",
72
+ "viewBox": "0 0 ".concat(this.svgWidth, " ").concat(this.svgHeight),
73
+ "role": "img"
74
+ }, extractedAriaProps)), this.data.map(function(barItem, index) {
75
+ var color = resolveColor("chart-palette-order-other-data");
76
+ if (barItem.color) {
77
+ color = resolveColor(barItem.color);
78
+ }
79
+ return /* @__PURE__ */ React.createElement("rect", {
80
+ key: index,
81
+ x: step * index,
82
+ y: _this.defaultHeight - barItem.value,
83
+ width: isHistogram ? step : step * 0.8,
84
+ height: barItem.value,
85
+ fill: color
86
+ }, animate && !loading && /* @__PURE__ */ React.createElement("animate", {
76
87
  attributeName: "y",
77
- values: "".concat(t.defaultHeight, ";").concat(t.defaultHeight - n.value),
88
+ values: "".concat(_this.defaultHeight, ";").concat(_this.defaultHeight - barItem.value),
78
89
  dur: "500ms"
79
90
  }));
80
91
  })));
81
92
  }
82
- }]), e;
83
- }($);
84
- l(o, "enhance", [N()]);
85
- l(o, "style", j);
86
- l(o, "defaultProps", {
87
- animate: !0
93
+ }]);
94
+ return TrendBarRoot2;
95
+ }(Trend);
96
+ _defineProperty(TrendBarRoot, "enhance", [resolveColorEnhance()]);
97
+ _defineProperty(TrendBarRoot, "style", style);
98
+ _defineProperty(TrendBarRoot, "defaultProps", {
99
+ animate: true
88
100
  });
89
- var P = v(o);
90
- P.displayName = "MiniChart.TrendBar";
91
- var ee = v(o, {}, {
101
+ var TrendBar = createComponent(TrendBarRoot);
102
+ TrendBar.displayName = "MiniChart.TrendBar";
103
+ var TrendHistogram = createComponent(TrendBarRoot, {}, {
92
104
  enhancements: [function() {
93
105
  return {
94
- wrapperProps: function(s) {
95
- return y(s, {
96
- isHistogram: !0
106
+ wrapperProps: function wrapperProps(props) {
107
+ return assignProps(props, {
108
+ isHistogram: true
97
109
  });
98
110
  }
99
111
  };
100
112
  }]
101
113
  });
102
- P.displayName = "MiniChart.TrendHistogram";
114
+ TrendBar.displayName = "MiniChart.TrendHistogram";
103
115
  export {
104
- P as TrendBar,
105
- ee as TrendHistogram
116
+ TrendBar,
117
+ TrendHistogram
106
118
  };