@lobehub/charts 1.9.9 → 1.9.11

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,4 +1,5 @@
1
1
  import React, { HTMLAttributes, ReactNode } from 'react';
2
+ import { NoDataProps } from "../common/NoData";
2
3
  import { ValueFormatter } from "../types/charts";
3
4
  export interface Bar {
4
5
  [key: string]: any;
@@ -16,6 +17,7 @@ export interface BarListProps extends HTMLAttributes<HTMLDivElement> {
16
17
  height?: string | number;
17
18
  leftLabel?: ReactNode;
18
19
  loading?: boolean;
20
+ noDataText?: NoDataProps['noDataText'];
19
21
  onValueChange?: (payload: Bar) => void;
20
22
  rightLabel?: ReactNode;
21
23
  showAnimation?: boolean;
@@ -3,11 +3,12 @@
3
3
  import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
4
4
  import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
5
5
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
6
- var _excluded = ["data", "color", "valueFormatter", "showAnimation", "onValueChange", "sortOrder", "className", "leftLabel", "rightLabel", "style", "loading", "width", "height"];
6
+ var _excluded = ["data", "color", "valueFormatter", "showAnimation", "onValueChange", "sortOrder", "className", "leftLabel", "rightLabel", "style", "loading", "width", "height", "noDataText"];
7
7
  import A from '@lobehub/ui/es/A';
8
8
  import { Skeleton } from 'antd';
9
9
  import React, { forwardRef, useMemo } from 'react';
10
10
  import { Flexbox } from 'react-layout-kit';
11
+ import NoData from "../common/NoData";
11
12
  import { useThemeColorRange } from "../hooks/useThemeColorRange";
12
13
  import { defaultValueFormatter } from "../utils";
13
14
  import { useStyles } from "./styles";
@@ -37,6 +38,7 @@ var BarList = /*#__PURE__*/forwardRef(function (props, ref) {
37
38
  _props$width = props.width,
38
39
  width = _props$width === void 0 ? '100%' : _props$width,
39
40
  height = props.height,
41
+ noDataText = props.noDataText,
40
42
  rest = _objectWithoutProperties(props, _excluded);
41
43
  var sortedData = useMemo(function () {
42
44
  if (sortOrder === 'none') {
@@ -136,6 +138,8 @@ var BarList = /*#__PURE__*/forwardRef(function (props, ref) {
136
138
  })]
137
139
  })]
138
140
  }, (_item$key = item.key) !== null && _item$key !== void 0 ? _item$key : index);
141
+ }), !(data !== null && data !== void 0 && data.length) && /*#__PURE__*/_jsx(NoData, {
142
+ noDataText: noDataText
139
143
  })]
140
144
  }), /*#__PURE__*/_jsxs(Flexbox, {
141
145
  gap: 8,
@@ -86,7 +86,7 @@ var Heatmaps = /*#__PURE__*/forwardRef(function (props, ref) {
86
86
  }
87
87
  case 4:
88
88
  {
89
- return [theme.colorFillSecondary, isDarkMode ? theme.lime4 : theme.green4, isDarkMode ? theme.lime6 : theme.green6, isDarkMode ? theme.lime8 : theme.green8, isDarkMode ? theme.lime10 : theme.green10];
89
+ return [theme.colorFillSecondary, isDarkMode ? theme.lime2 : theme.green2, isDarkMode ? theme.lime4 : theme.green4, isDarkMode ? theme.lime6 : theme.green6, isDarkMode ? theme.lime8 : theme.green8];
90
90
  }
91
91
  default:
92
92
  {
@@ -9,6 +9,6 @@ export var useStyles = createStyles(function (_ref) {
9
9
  container: css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n display: flex;\n flex-direction: column;\n gap: 8px;\n\n width: max-content;\n max-width: 100%;\n\n rect {\n stroke: ", ";\n stroke-width: 1px;\n shape-rendering: geometricprecision;\n }\n "])), token.colorFillTertiary),
10
10
  footer: css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n display: flex;\n flex-wrap: wrap;\n gap: 4px 16px;\n white-space: nowrap;\n "]))),
11
11
  legendColors: css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n display: flex;\n gap: 3px;\n align-items: center;\n margin-left: auto;\n "]))),
12
- scrollContainer: css(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n overflow: auto hidden;\n max-width: 100%;\n "])))
12
+ scrollContainer: css(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n overflow: auto hidden;\n max-width: 100%;\n padding-block: 2px;\n "])))
13
13
  };
14
14
  });
@@ -1,4 +1,5 @@
1
1
  import { HTMLAttributes } from 'react';
2
+ import { NoDataProps } from "./NoData";
2
3
  import BaseAnimationTimingProps from './BaseAnimationTimingProps';
3
4
  interface BaseSparkChartProps extends BaseAnimationTimingProps, HTMLAttributes<HTMLDivElement> {
4
5
  autoMinValue?: boolean;
@@ -8,6 +9,6 @@ interface BaseSparkChartProps extends BaseAnimationTimingProps, HTMLAttributes<H
8
9
  index: string;
9
10
  maxValue?: number;
10
11
  minValue?: number;
11
- noDataText?: string;
12
+ noDataText?: NoDataProps['noDataText'];
12
13
  }
13
14
  export default BaseSparkChartProps;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lobehub/charts",
3
- "version": "1.9.9",
3
+ "version": "1.9.11",
4
4
  "description": "React modern charts components built on recharts",
5
5
  "keywords": [
6
6
  "lobehub",