@cloudtower/eagle 0.27.49 → 0.27.51

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,5 +1,5 @@
1
1
  import React from "react";
2
- import { PresetCascaderRenderProps, CascaderProps } from "./cascader.type";
2
+ import { CascaderProps, PresetCascaderRenderProps } from "./cascader.type";
3
3
  export declare const NotDataContent: React.FC<{
4
4
  content: React.ReactNode | string;
5
5
  }>;
@@ -10,6 +10,7 @@ export declare const CascaderDoubleRowOption: React.FC<{
10
10
  leftBottom?: React.ReactNode;
11
11
  rightTop?: React.ReactNode;
12
12
  rightBottom?: React.ReactNode;
13
+ rootClassName?: string;
13
14
  }>;
14
15
  export declare const CascaderOptionWithCount: React.FC<{
15
16
  label?: React.ReactNode;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,103 @@
1
+ import { TFunction } from "i18next";
2
+ import React from "react";
3
+ export declare enum DonutChartColor {
4
+ RED = "red",
5
+ GREEN = "green",
6
+ YeLLOW = "yellow",
7
+ BLUE = "blue",
8
+ PURPLE = "purple"
9
+ }
10
+ export type IDonutChartProps = {
11
+ /**
12
+ * 默认支持单色系展示,如果是单色系直接传入颜色类型
13
+ */
14
+ color?: DonutChartColor;
15
+ /**
16
+ * 支持自定义图形外部样式
17
+ */
18
+ className?: string;
19
+ /**
20
+ * 支持自定义 tooltip 样式
21
+ */
22
+ overlayClassName?: string;
23
+ /**
24
+ * * centerRender 对应 Donut Chart 中间的展示
25
+ * * 可直接传入 object 类型,object 中的 number 为数值, text为数值下面的文案展示
26
+ * * 支持传入 ReactNode 自定义组件
27
+ */
28
+ centerRender?: React.ReactElement | {
29
+ number: number;
30
+ text: string;
31
+ };
32
+ /**
33
+ * * 图形展示的数据
34
+ * * 数据合并展示规则:
35
+ * * 如果 data 的长度不超过 5 并且没有 otherData 时,会全部展示
36
+ * * 如果 data 的长度小于等于 4 并且有 otherData 时,会全部展示
37
+ * * 如果 data 的长度大于 4 并且有 otherData 时,会将第 3 项之后的数据合并为一项,在 tooltip 中展示,
38
+ * * 如果 data 的长度大于 5 不管是否有 otherData 会将第 4 项之后对 data 进行合并展示
39
+ * * 如果有希望合并的数据,建议在传入数据时进行排序
40
+ * * data 中每一项支持 onClick 事件,支持自定义颜色,当有自定义颜色时优先展示
41
+ */
42
+ data: {
43
+ name: string;
44
+ value: number;
45
+ color?: string;
46
+ tooltip?: string;
47
+ onClick?: (name: string) => void;
48
+ }[];
49
+ /**
50
+ * otherData中的数据会默认合并为其他,name 和 value 会在tooltip中展示详情
51
+ */
52
+ otherData?: {
53
+ name: string;
54
+ value: number;
55
+ }[];
56
+ /**
57
+ * 当 data 数据合并时展示的文案
58
+ */
59
+ collapseText?: string;
60
+ };
61
+ export declare const formatCollapse: (collapseData?: {
62
+ name: string;
63
+ value: number;
64
+ }[]) => {
65
+ tooltip: {
66
+ name: string;
67
+ value: number;
68
+ }[];
69
+ value: number;
70
+ };
71
+ export declare const formatChartData: ({ otherData, data, t, collapseText, }: IDonutChartProps & {
72
+ t: TFunction<"translation", undefined>;
73
+ }) => ({
74
+ name: string;
75
+ value: number;
76
+ color?: string | undefined;
77
+ tooltip?: string | undefined;
78
+ onClick?: ((name: string) => void) | undefined;
79
+ } | {
80
+ name: string;
81
+ value: number;
82
+ color: "#D8DEEB";
83
+ tooltip: {
84
+ name: string;
85
+ value: number;
86
+ }[];
87
+ })[] | ({
88
+ name: string;
89
+ value: number;
90
+ color?: string | undefined;
91
+ tooltip?: string | undefined;
92
+ onClick?: ((name: string) => void) | undefined;
93
+ } | {
94
+ name: string;
95
+ value: number;
96
+ color: null;
97
+ tooltip: {
98
+ name: string;
99
+ value: number;
100
+ }[];
101
+ })[];
102
+ declare const DonutChart: React.FC<IDonutChartProps>;
103
+ export default DonutChart;
@@ -2,7 +2,7 @@ import { DateRange, IDataPoint, IMetric } from "../../core/Metric/type";
2
2
  export declare function filterPointsByDateRange(points: IDataPoint[], dateRange: DateRange): IDataPoint[];
3
3
  export declare const parseRange: (range: string) => {
4
4
  span: number;
5
- unit: "h" | "d";
5
+ unit: "d" | "h";
6
6
  };
7
7
  export declare const xaxisCal: (lastTime: number, dateRange: DateRange) => number[];
8
8
  export declare const tickFormatter: (tick: number, dateRange: DateRange) => string;
@@ -1,10 +1,11 @@
1
1
  import React from "react";
2
2
  export declare function getWidth(input: number): string;
3
- declare const BarChart: React.FC<{
3
+ export interface IBarChartProps {
4
4
  data: Array<{
5
5
  value: number;
6
6
  color: string;
7
7
  }>;
8
8
  total: number;
9
- }>;
9
+ }
10
+ declare const BarChart: React.FC<IBarChartProps>;
10
11
  export default BarChart;
@@ -1,5 +1,5 @@
1
1
  import React from "react";
2
- export interface IDonutChartProps {
2
+ export interface DeprecatedIDonutChartProps {
3
3
  data: Array<object>;
4
4
  dataKey: string;
5
5
  width: number;
@@ -8,5 +8,5 @@ export interface IDonutChartProps {
8
8
  innerRadius: number;
9
9
  outerRadius: number;
10
10
  }
11
- declare const DonutChart: React.FC<IDonutChartProps>;
12
- export default DonutChart;
11
+ declare const DeprecatedDonutChart: React.FC<DeprecatedIDonutChartProps>;
12
+ export default DeprecatedDonutChart;
@@ -1,4 +1,4 @@
1
- import { OverflowTooltipProps } from "../../spec";
1
+ import type { OverflowTooltipProps } from "../../coreX/OverflowTooltip/overflowTooltip.type";
2
2
  import React from "react";
3
3
  declare const OverflowTooltip: React.FC<OverflowTooltipProps>;
4
4
  export default OverflowTooltip;
@@ -0,0 +1,23 @@
1
+ /// <reference types="react" />
2
+ export type OverflowTooltipProps = {
3
+ /**
4
+ * 文本内容
5
+ */
6
+ content: React.ReactNode;
7
+ /**
8
+ * 自定义样式类名
9
+ */
10
+ className?: string;
11
+ /**
12
+ * 当文本溢出省略时,鼠标悬停显示的 tooltip 内容,如不指定,默认展示完整的文本内容
13
+ */
14
+ tooltip?: React.ReactNode;
15
+ /**
16
+ * 多行溢出省略,指定大于 1 的数字时,会在文字超过指定的行数时省略溢出内容,并显示 tooltip
17
+ */
18
+ multiLines?: number;
19
+ /**
20
+ * 点击事件处理函数
21
+ */
22
+ onClick?: () => void;
23
+ };
@@ -1,4 +1,7 @@
1
+ export { default as BarChart } from "./BarChart";
2
+ export * from "./BarChart";
1
3
  export { default as BatchOperation, renderBatchOperationMenuItem, } from "./BatchOperation";
2
4
  export { stringifyPlan } from "./CronPlan";
3
5
  export * from "./DateRangePicker";
4
6
  export { default as DateRangePicker } from "./DateRangePicker";
7
+ export * from "./DeprecatedDonutChart";
@@ -2,6 +2,7 @@ import "./styles/index.scss";
2
2
  export type { CardProps, DateRange, GraphType, IconProps, IDataPoint, } from "./core";
3
3
  export { antdKit, BaseIcon, Button, ButtonStyle, CannotOperationInfo, ContentWrapper, createBatchMessageMethods, Desc, FailedLoad, FullView, Icon, InputTagItem, KitStoreProvider, LightDesc, ModalStack, RadioDesc, radioStyle, tableStyleCover, tickFormatter, Truncate, Typo, useKitDispatch, useKitSelector, WizardBody, } from "./core";
4
4
  export * from "./core/Cascader/cascader.style";
5
+ export * from "./core/Cascader/cascader.type";
5
6
  export * from "./core/Cascader/cascader.widget";
6
7
  export { RenderMenuItem } from "./core/DropdownMenu";
7
8
  export { default as DropdownMenu } from "./core/DropdownMenu";
@@ -4,6 +4,7 @@ import { IEmptyProps } from "../core/Empty";
4
4
  import { MessageApi } from "../core/message";
5
5
  import { TableFormHandle, TableFormProps } from "../core/TableForm/types";
6
6
  import { TruncatePropTypes } from "../core/Truncate";
7
+ import type { OverflowTooltipProps } from "../coreX/OverflowTooltip/overflowTooltip.type";
7
8
  import { SizeType } from "antd/es/config-provider/SizeContext";
8
9
  import { AlertProps } from "antd/lib/alert";
9
10
  import { AutoCompleteProps } from "antd/lib/auto-complete";
@@ -59,9 +60,10 @@ import type { Moment } from "moment";
59
60
  import React, { ForwardRefExoticComponent, PropsWithChildren, PropsWithoutRef, ReactNode, RefAttributes } from "react";
60
61
  import { Draggable } from "react-beautiful-dnd";
61
62
  import type { CloseButtonProps } from "../core/AccordionCard";
63
+ import { IDonutChartProps } from "../core/DonutChart";
62
64
  import { IChartWithUnitProps, ICWTProps } from "../coreX/ChartWithTooltip";
63
65
  import { DateRangePickerProps } from "../coreX/DateRangePicker/common";
64
- import { IDonutChartProps } from "../coreX/DonutChart";
66
+ import { DeprecatedIDonutChartProps } from "../coreX/DeprecatedDonutChart";
65
67
  import { IUnitWithChartProps } from "../coreX/UnitWithChart";
66
68
  import { SerializableObject } from "../utils/tower";
67
69
  import { FieldRenderProps } from "./react-final-form";
@@ -541,6 +543,7 @@ export interface Kit<V = any, T extends HTMLElement = HTMLElement> {
541
543
  ChartWithTooltip: React.FC<ICWTProps>;
542
544
  ChartWithUnit: React.FC<IChartWithUnitProps>;
543
545
  DonutChart: React.FC<IDonutChartProps>;
546
+ DeprecatedDonutChart: React.FC<DeprecatedIDonutChartProps>;
544
547
  UnitWithChart: React.FC<IUnitWithChartProps>;
545
548
  GoBackButton: React.FC<GoBackButtonType>;
546
549
  CronCalendar: React.FC<CronCalendarProps>;
@@ -618,13 +621,6 @@ export type TokenType = Omit<TagProps, "closeIcon"> & {
618
621
  };
619
622
  };
620
623
  export type TokenComponentType = React.ForwardRefExoticComponent<TokenType & React.RefAttributes<HTMLDivElement>>;
621
- export type OverflowTooltipProps = {
622
- content: React.ReactNode;
623
- tooltip?: React.ReactNode;
624
- className?: string;
625
- onClick?: () => void;
626
- multiLines?: number;
627
- };
628
624
  export type TruncateTextWithTooltipType = {
629
625
  text: string;
630
626
  textWrapperCls?: string;
@@ -0,0 +1,18 @@
1
+ import { IDonutChartProps } from "../../../src/core/DonutChart";
2
+ import { Meta, StoryObj } from "@storybook/react";
3
+ /**
4
+ * * 高阶业务组件, 基于 rechart PieChart 组件封装 Donut chart 组件
5
+ * * 组件 props 设计参考示例:https://recharts.org/en-US/examples/PieChartWithPaddingAngle
6
+ * * 自定义 props 已在表格进行说明
7
+ *
8
+ */
9
+ declare const story: Meta<any>;
10
+ export default story;
11
+ type IDonutChartStoryProps = IDonutChartProps & {
12
+ width: number;
13
+ };
14
+ export declare const Default: StoryObj<IDonutChartStoryProps>;
15
+ export declare const OtherDisplay: StoryObj<IDonutChartStoryProps>;
16
+ export declare const centerRender: StoryObj<IDonutChartStoryProps>;
17
+ export declare const Collapse: StoryObj<IDonutChartStoryProps>;
18
+ export declare const TextCollapse: StoryObj<IDonutChartStoryProps>;
@@ -0,0 +1,6 @@
1
+ import DeprecatedDonutChart from "../../../src/coreX/DeprecatedDonutChart";
2
+ import type { Meta, StoryObj } from "@storybook/react";
3
+ declare const meta: Meta<typeof DeprecatedDonutChart>;
4
+ export default meta;
5
+ type Story = StoryObj<typeof DeprecatedDonutChart>;
6
+ export declare const Demo: Story;
@@ -1,15 +1,30 @@
1
- import { OverflowTooltipProps } from "../../../src/spec";
1
+ import type { OverflowTooltipProps } from "../../../src/coreX/OverflowTooltip/overflowTooltip.type";
2
2
  import { Meta, StoryObj } from "@storybook/react";
3
3
  import React from "react";
4
+ /**
5
+ *
6
+ * OverflowTooltip 组件用于处理文本溢出时的省略和提示,支持单行和多行文本溢出并展示 tooltip。
7
+ *
8
+ */
4
9
  declare const meta: Meta<React.FC<OverflowTooltipProps>>;
5
10
  export default meta;
6
- export declare const Default: StoryObj<{
7
- width: string;
8
- multiLines: number;
9
- content: string;
10
- }>;
11
- export declare const MultipleLine: StoryObj<{
12
- width: string;
13
- multiLines: number;
14
- content: string;
15
- }>;
11
+ /**
12
+ *
13
+ * OverflowTooltip 组件内部会动态判断文本是否已经溢出,如果溢出会展示给定的 tooltip 内容,如果不指定 tooltip,则会展示完整的文本内容。
14
+ *
15
+ */
16
+ export declare const Default: StoryObj<OverflowTooltipProps>;
17
+ /**
18
+ *
19
+ * 通过指定 multiLines 大于 1 可以实现多行省略溢出。
20
+ *
21
+ * 比如在 multiLines 为 2 时,文字部分会在内容超过两行时省略溢出并展示 tooltip 内容。
22
+ *
23
+ */
24
+ export declare const MultipleLine: StoryObj<OverflowTooltipProps>;
25
+ /**
26
+ *
27
+ * 可以指定文本省略时要展示的 tooltip 内容,如不指定,会默认展示完整的文本内容(content)。
28
+ *
29
+ */
30
+ export declare const Tooltip: StoryObj<OverflowTooltipProps>;