@cloudtower/eagle 0.32.41 → 0.32.43

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.
@@ -2,7 +2,7 @@ import React from "react";
2
2
  import { LineChartProps } from "./type";
3
3
  declare const LineChart: React.ForwardRefExoticComponent<LineChartProps & React.RefAttributes<HTMLDivElement>>;
4
4
  export default LineChart;
5
- export * from "./type";
6
- export * from "./utils";
7
5
  export { default as LineChartLegend } from "./LineChartLegend";
8
6
  export * from "./LineChartLegend";
7
+ export * from "./type";
8
+ export * from "./utils";
@@ -1,8 +1,8 @@
1
+ import { IChartProps } from "../../core/LineChart/RenderChart";
2
+ import { PickerDateRange } from "../../coreX/DateRangePicker/dateRangePicker.type";
1
3
  import { Dayjs } from "dayjs";
2
4
  import { TFunction } from "i18next";
3
5
  import { ReactElement } from "react";
4
- import { IChartProps } from "../../core/LineChart/RenderChart";
5
- import { PickerDateRange } from "../../coreX/DateRangePicker/dateRangePicker.type";
6
6
  export interface ILineChartMetricData {
7
7
  id: string;
8
8
  }
@@ -1,4 +1,4 @@
1
- import { ILineChartDateRange, ILineChartGraphType, ILineChartDataPoint, ILineChartMetric, ILineChartMetricUnit } from "../../core/LineChart/type";
1
+ import { ILineChartDataPoint, ILineChartDateRange, ILineChartGraphType, ILineChartMetric, ILineChartMetricUnit } from "../../core/LineChart/type";
2
2
  import { formatBitPerSecond, formatBps, formatBytes, formatCount, formatFrequency, formatNanoSecond, formatPercent, formatTemperature } from "../../utils/tower";
3
3
  export declare function filterLineChartPointsByDateRange(points: ILineChartDataPoint[], dateRange?: ILineChartDateRange): ILineChartDataPoint[];
4
4
  export declare const parseLineChartRange: (range: string) => {
@@ -1,17 +1,83 @@
1
1
  /// <reference types="react" />
2
2
  import { IEmptyProps } from "../Empty";
3
+ /**
4
+ * 基础数值单位展示的接口定义
5
+ * @interface RawValue
6
+ */
3
7
  export interface RawValue {
8
+ /**
9
+ * 原始数值
10
+ * @type {number | null}
11
+ * @default undefined
12
+ * @example
13
+ * rawValue={1024} // 展示为 1024
14
+ * rawValue={null} // 展示为空
15
+ */
4
16
  rawValue?: number | null;
17
+ /**
18
+ * 保留小数位数
19
+ * @type {number}
20
+ * @default undefined
21
+ * @example
22
+ * decimals={2} // 1024.00
23
+ */
5
24
  decimals?: number;
25
+ /**
26
+ * 当值为0时是否隐藏单位
27
+ * @type {boolean}
28
+ * @default false
29
+ * @example
30
+ * noUnitOnZero={true} // 0
31
+ * noUnitOnZero={false} // 0 GB
32
+ */
6
33
  noUnitOnZero?: boolean;
34
+ /**
35
+ * 是否使用缩写形式
36
+ * @type {boolean}
37
+ * @default false
38
+ * @example
39
+ * abbreviate={true} // 1 min
40
+ * abbreviate={false} // 1 minute
41
+ */
7
42
  abbreviate?: boolean;
43
+ /**
44
+ * 数值部分的自定义类名
45
+ * @type {string}
46
+ */
8
47
  valueClassName?: string;
48
+ /**
49
+ * 单位部分的自定义类名
50
+ * @type {string}
51
+ */
9
52
  unitClassName?: string;
10
53
  }
54
+ /**
55
+ * 百分比展示组件的属性类型
56
+ * @type PercentFn
57
+ */
11
58
  export type PercentFn = React.FC<RawValue & {
59
+ /**
60
+ * 是否为饱和值(超过100%)
61
+ * @type {boolean}
62
+ * @default false
63
+ * @example
64
+ * saturated={true} // 显示为饱和状态
65
+ */
12
66
  saturated?: boolean;
67
+ /**
68
+ * Empty组件的配置属性
69
+ * @type {IEmptyProps}
70
+ */
13
71
  emptyProps?: IEmptyProps;
14
72
  }>;
73
+ /**
74
+ * 通用单位展示组件的属性类型
75
+ * @type UnitFn
76
+ */
15
77
  export type UnitFn = React.FC<RawValue & {
78
+ /**
79
+ * Empty组件的配置属性
80
+ * @type {IEmptyProps}
81
+ */
16
82
  emptyProps?: IEmptyProps;
17
83
  }>;
@@ -42,9 +42,9 @@ export * from "./InputPassword";
42
42
  export * from "./InputTagItem";
43
43
  export * from "./KitStoreProvider";
44
44
  export * from "./LegacySelect";
45
- export * from "./Link";
46
45
  export * from "./LineChart";
47
46
  export * from "./LineChart";
47
+ export * from "./Link";
48
48
  export * from "./Loading";
49
49
  export * from "./message";
50
50
  export * from "./message-group";
@@ -143,8 +143,8 @@ export { default as InputPassword } from "./InputPassword";
143
143
  export { default as InputTagItem } from "./InputTagItem";
144
144
  export { default as KitStoreProvider } from "./KitStoreProvider";
145
145
  export { default as LegacySelect } from "./LegacySelect";
146
- export { default as Link } from "./Link";
147
146
  export { default as LineChart } from "./LineChart";
147
+ export { default as Link } from "./Link";
148
148
  export { default as Loading } from "./Loading";
149
149
  export { default as message } from "./message";
150
150
  export { default as Metric } from "./Metric";
@@ -1,22 +1,57 @@
1
- import React from "react";
2
- declare const _default: import("@storybook/types").ComponentAnnotations<import("@storybook/react/dist/types-0fc72a6d").R, import("../../../src").RawValue & {
3
- emptyProps?: import("../../../src").IEmptyProps | undefined;
4
- } & {
5
- children?: React.ReactNode;
6
- }>;
7
- export default _default;
8
- export declare const Simple: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0fc72a6d").R, import("../../../src").RawValue & {
9
- emptyProps?: import("../../../src").IEmptyProps | undefined;
10
- } & {
11
- children?: React.ReactNode;
12
- }>;
13
- export declare const Abbreviation: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0fc72a6d").R, import("../../../src").RawValue & {
14
- emptyProps?: import("../../../src").IEmptyProps | undefined;
15
- } & {
16
- children?: React.ReactNode;
17
- }>;
18
- export declare const Empty: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0fc72a6d").R, import("../../../src").RawValue & {
19
- emptyProps?: import("../../../src").IEmptyProps | undefined;
20
- } & {
21
- children?: React.ReactNode;
22
- }>;
1
+ import Second from "../../../src/core/Second";
2
+ import { StoryObj } from "@storybook/react";
3
+ /**
4
+ * * Second 组件
5
+ * * 用于展示秒数,支持不同的展示形式
6
+ * * 提供标准、缩写和自定义空值展示等功能
7
+ * * 继承自基础的 Units 系列组件
8
+ */
9
+ declare const meta: {
10
+ title: string;
11
+ component: import("../../../src").UnitFn;
12
+ parameters: {
13
+ docs: {
14
+ description: {
15
+ component: string;
16
+ };
17
+ };
18
+ };
19
+ tags: string[];
20
+ };
21
+ export default meta;
22
+ type Story = StoryObj<typeof Second>;
23
+ /**
24
+ * 基础秒数展示
25
+ * 展示最基本的秒数,不做任何特殊处理
26
+ */
27
+ export declare const Basic: Story;
28
+ /**
29
+ * 缩写形式展示
30
+ * 当需要节省空间时,可以使用缩写形式展示秒数
31
+ */
32
+ export declare const Abbreviated: Story;
33
+ /**
34
+ * 精确小数位展示
35
+ * 可以指定保留的小数位数,提高精确度
36
+ */
37
+ export declare const WithDecimals: Story;
38
+ /**
39
+ * 零值不带单位
40
+ * 当值为0时,可以选择不显示单位
41
+ */
42
+ export declare const ZeroWithoutUnit: Story;
43
+ /**
44
+ * 大数值展示
45
+ * 展示较大的秒数
46
+ */
47
+ export declare const LargeValue: Story;
48
+ /**
49
+ * 自定义空值展示
50
+ * 当没有有效值时的自定义展示
51
+ */
52
+ export declare const CustomEmpty: Story;
53
+ /**
54
+ * 自定义样式
55
+ * 可以通过自定义类名来调整展示样式
56
+ */
57
+ export declare const CustomStyle: Story;