@cloudtower/eagle 0.32.32 → 0.32.34
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/dist/cjs/antd.js +6 -6
- package/dist/cjs/core/Progress/progress.widgets.js +2 -5
- package/dist/cjs/core/Timeline/Timeline.style.js +13 -0
- package/dist/cjs/core/Timeline/Timeline.widget.js +114 -0
- package/dist/cjs/core/Timeline/index.js +122 -0
- package/dist/cjs/index.js +119 -117
- package/dist/cjs/stats1.html +1 -1
- package/dist/cjs/utils/constants.js +11 -0
- package/dist/components.css +3481 -3425
- package/dist/esm/antd.js +3 -3
- package/dist/esm/core/Progress/progress.widgets.js +1 -4
- package/dist/esm/core/Timeline/Timeline.style.js +7 -0
- package/dist/esm/core/Timeline/Timeline.widget.js +107 -0
- package/dist/esm/core/Timeline/index.js +115 -0
- package/dist/esm/index.js +3 -2
- package/dist/esm/stats1.html +1 -1
- package/dist/esm/utils/constants.js +7 -1
- package/dist/src/antd.d.ts +2 -2
- package/dist/src/core/Timeline/Timeline.style.d.ts +5 -0
- package/dist/src/core/Timeline/Timeline.type.d.ts +209 -0
- package/dist/src/core/Timeline/Timeline.widget.d.ts +5 -0
- package/dist/src/core/Timeline/index.d.ts +10 -0
- package/dist/src/core/index.d.ts +1 -0
- package/dist/src/utils/constants.d.ts +2 -0
- package/dist/stories/docs/core/Timeline.stories.d.ts +38 -0
- package/dist/style.css +3141 -3091
- package/package.json +4 -4
|
@@ -1,5 +1,11 @@
|
|
|
1
|
+
import React__default from 'react';
|
|
2
|
+
import { DotIntervalSeparation16TertiaryIcon } from '@cloudtower/icons-react';
|
|
3
|
+
|
|
1
4
|
const EMPTY_FUNCTION = () => {
|
|
2
5
|
};
|
|
3
6
|
const Antd5PrefixCls = "antd5";
|
|
7
|
+
const splitMap = {
|
|
8
|
+
dot: /* @__PURE__ */ React__default.createElement(DotIntervalSeparation16TertiaryIcon, null)
|
|
9
|
+
};
|
|
4
10
|
|
|
5
|
-
export { Antd5PrefixCls, EMPTY_FUNCTION };
|
|
11
|
+
export { Antd5PrefixCls, EMPTY_FUNCTION, splitMap };
|
package/dist/src/antd.d.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { MenuItemGroupProps } from "antd/lib/menu";
|
|
3
3
|
import { ModalProps as AntdModalProps } from "antd/lib/modal";
|
|
4
4
|
import { FC } from "react";
|
|
5
|
-
export { Badge as AntdBadge, Button as AntdButton, Checkbox as AntdCheckbox, Collapse as AntdCollapse, Divider as AntdDivider, Drawer as AntdDrawer, Empty as AntdEmpty, Input as AntdInput, message as AntdMessage, Select as AntdSelect, Steps as AntdSteps, Switch as AntdSwitch, Table as AntdTable, TimePicker as AntdTimePicker, Tooltip as AntdTooltip, TreeSelect as AntdTreeSelect, AutoComplete, Col, DatePicker, Dropdown, Layout, List, Menu, Popover, Row, Skeleton as AntdSkeleton, Tabs, Timeline, Tree, Typography, Upload, } from "antd";
|
|
5
|
+
export { Badge as AntdBadge, Button as AntdButton, Checkbox as AntdCheckbox, Collapse as AntdCollapse, Divider as AntdDivider, Drawer as AntdDrawer, Empty as AntdEmpty, Input as AntdInput, message as AntdMessage, Select as AntdSelect, Steps as AntdSteps, Switch as AntdSwitch, Table as AntdTable, TimePicker as AntdTimePicker, Tooltip as AntdTooltip, TreeSelect as AntdTreeSelect, AutoComplete, Col, DatePicker, Dropdown, Layout, List, Menu, Popover, Row, Skeleton as AntdSkeleton, Tabs, Timeline as AntdTimeline, Tree, Typography, Upload, } from "antd";
|
|
6
6
|
export declare const DatePickerRangePicker: import("react").ComponentClass<import("antd/lib/date-picker/generatePicker").RangePickerProps<import("moment").Moment>, any>;
|
|
7
7
|
export declare const ListItem: import("antd/lib/list/Item").ListItemTypeProps;
|
|
8
8
|
export declare const MenuItemGroup: import("react").ComponentType<MenuItemGroupProps>;
|
|
@@ -13,7 +13,7 @@ export declare const SkeletonButton: {
|
|
|
13
13
|
};
|
|
14
14
|
};
|
|
15
15
|
export declare const TabsTabPane: typeof import("rc-tabs").TabPane;
|
|
16
|
-
export declare const
|
|
16
|
+
export declare const AntdTimelineItem: FC<import("antd/lib/timeline").TimeLineItemProps>;
|
|
17
17
|
export declare const TypographyText: FC<import("antd/lib/typography/Text").TextProps>;
|
|
18
18
|
export declare const UploadDragger: typeof import("antd/lib/upload/Dragger").default;
|
|
19
19
|
export declare const AntdOption: import("rc-select/lib/Option").OptionFC;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare const TimelineWrapper: import("@linaria/core").LinariaClassName;
|
|
2
|
+
export declare const TimelineItemWrapper: import("@linaria/core").LinariaClassName;
|
|
3
|
+
export declare const EmptyWrapper: import("@linaria/core").LinariaClassName;
|
|
4
|
+
export declare const SubInfoTextWrapper: import("@linaria/core").LinariaClassName;
|
|
5
|
+
export declare const InfoTextWrapper: import("@linaria/core").LinariaClassName;
|
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
import { AlertProps } from "../../core/Alert";
|
|
2
|
+
import { ReactNode } from "react";
|
|
3
|
+
import { TagProps } from "../../core/Tag";
|
|
4
|
+
import { LinkProps } from "../../core/Link";
|
|
5
|
+
/**
|
|
6
|
+
* 标签属性,扩展自基础Tag组件属性
|
|
7
|
+
* @property {string} category - 固定为 'tag',标识这是一个标签元素
|
|
8
|
+
*/
|
|
9
|
+
export type TimelineTagProps = TagProps & {
|
|
10
|
+
category: "tag";
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* 信息文本属性
|
|
14
|
+
* @property {string} category - 文本类型,决定样式和用途
|
|
15
|
+
* @property {React.ReactNode} children - 文本内容
|
|
16
|
+
* @property {number} multiLines - 多行文本显示行数限制,超出将被省略
|
|
17
|
+
* @property {string} className - 自定义CSS类名
|
|
18
|
+
*/
|
|
19
|
+
export type TimelineInfoProps = {
|
|
20
|
+
category: "subinfo_label" | "info" | "info_bold";
|
|
21
|
+
children?: React.ReactNode;
|
|
22
|
+
multiLines?: number;
|
|
23
|
+
className?: string;
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* 链接属性,扩展自基础Link组件属性
|
|
27
|
+
* @property {string} category - 固定为 'link',标识这是一个链接元素
|
|
28
|
+
*/
|
|
29
|
+
export type TimelineLinkProps = LinkProps & {
|
|
30
|
+
category: "link";
|
|
31
|
+
};
|
|
32
|
+
/**
|
|
33
|
+
* 时间线信息区域属性
|
|
34
|
+
* @property {number} gap - 元素之间的间距,控制项目间的空白
|
|
35
|
+
* @property {React.ReactNode} split - 分隔符,用于在项目之间显示分隔符,如点、线等
|
|
36
|
+
* @property {string} className - 自定义CSS类名,用于自定义区域样式
|
|
37
|
+
* @property {Array} items - 区域中包含的元素列表,可以是标签、文本、链接
|
|
38
|
+
* @property {React.ReactNode} suffix - 后缀内容,通常用于放置操作按钮
|
|
39
|
+
*/
|
|
40
|
+
export type TimelineAreaProps = {
|
|
41
|
+
gap?: number;
|
|
42
|
+
split?: React.ReactNode;
|
|
43
|
+
className?: string;
|
|
44
|
+
items: Array<TimelineInfoProps | TimelineLinkProps | TimelineTagProps>;
|
|
45
|
+
suffix?: React.ReactNode;
|
|
46
|
+
};
|
|
47
|
+
/**
|
|
48
|
+
* 时间线项目数据结构
|
|
49
|
+
* 定义单个时间线项目的所有属性和配置
|
|
50
|
+
*/
|
|
51
|
+
export interface TimelineItemData {
|
|
52
|
+
/**
|
|
53
|
+
* 条目的状态,影响图标和颜色样式
|
|
54
|
+
* - success: 成功状态,显示绿色对勾图标
|
|
55
|
+
* - failed: 失败状态,显示红色错误图标
|
|
56
|
+
* - pending: 等待状态,显示黄色等待图标
|
|
57
|
+
* - notice: 通知状态,显示黄色警告图标
|
|
58
|
+
* - progress: 进行中状态,显示蓝色加载图标(带旋转动画)
|
|
59
|
+
* - idle: 空闲状态,显示灰色图标
|
|
60
|
+
*/
|
|
61
|
+
status: "success" | "failed" | "pending" | "notice" | "progress" | "idle";
|
|
62
|
+
/**
|
|
63
|
+
* 详情信息,通常用于显示错误详情或额外说明
|
|
64
|
+
* 默认使用Alert组件展示,样式会根据status自动匹配
|
|
65
|
+
* @example
|
|
66
|
+
* detailMessage: {
|
|
67
|
+
* message: "升级失败,请检查网络连接",
|
|
68
|
+
* action: <Button>重试</Button>
|
|
69
|
+
* }
|
|
70
|
+
*/
|
|
71
|
+
detailMessage?: AlertProps;
|
|
72
|
+
/**
|
|
73
|
+
* 自定义详情信息渲染函数,优先级高于detailMessage
|
|
74
|
+
* 可以完全自定义详情区域的展示内容和样式
|
|
75
|
+
* @param detailMessage - 默认的详情信息配置
|
|
76
|
+
* @returns 自定义渲染的React节点
|
|
77
|
+
* @example
|
|
78
|
+
* detailMessageRender: (message) => (
|
|
79
|
+
* <div style={{ padding: "8px" }}>
|
|
80
|
+
* <div>{message?.message}</div>
|
|
81
|
+
* <Button>重试</Button>
|
|
82
|
+
* </div>
|
|
83
|
+
* )
|
|
84
|
+
*/
|
|
85
|
+
detailMessageRender?: (detailMessage?: AlertProps) => ReactNode;
|
|
86
|
+
/**
|
|
87
|
+
* 主要信息区域,展示操作标题、版本号等重要信息
|
|
88
|
+
* 支持多行信息,每行可以包含多个不同类型的元素(标签、文本、链接等)
|
|
89
|
+
* 注意:标签元素(tag)应放在文本前面,以符合设计规范
|
|
90
|
+
* @example
|
|
91
|
+
* infos: [
|
|
92
|
+
* {
|
|
93
|
+
* items: [
|
|
94
|
+
* { category: 'tag', color: 'blue', children: '升级' },
|
|
95
|
+
* { category: 'info', children: 'v1.0.0' }
|
|
96
|
+
* ]
|
|
97
|
+
* }
|
|
98
|
+
* ]
|
|
99
|
+
*/
|
|
100
|
+
infos: TimelineAreaProps[];
|
|
101
|
+
/**
|
|
102
|
+
* 自定义主要信息渲染函数,优先级高于infos
|
|
103
|
+
* 可以完全自定义主要信息区域的展示内容和样式
|
|
104
|
+
* @param infos - 默认的主要信息配置
|
|
105
|
+
* @returns 自定义渲染的React节点
|
|
106
|
+
* @example
|
|
107
|
+
* infosRender: (infos) => (
|
|
108
|
+
* <div style={{ display: "flex", alignItems: "center" }}>
|
|
109
|
+
* <span style={{ fontWeight: "bold" }}>
|
|
110
|
+
* {infos[0].items.find(i => i.category.includes("info"))?.children}
|
|
111
|
+
* </span>
|
|
112
|
+
* <Tag color="green">稳定版</Tag>
|
|
113
|
+
* </div>
|
|
114
|
+
* )
|
|
115
|
+
*/
|
|
116
|
+
infosRender?: (infos: TimelineAreaProps[]) => ReactNode;
|
|
117
|
+
/**
|
|
118
|
+
* 主要信息区域的操作按钮,通常用于放置查看详情等操作
|
|
119
|
+
* 会显示在主要信息区域的右侧
|
|
120
|
+
* @example
|
|
121
|
+
* infoAction: <Link onClick={() => console.log("查看详情")}>查看详情</Link>
|
|
122
|
+
*/
|
|
123
|
+
infoAction?: ReactNode;
|
|
124
|
+
/**
|
|
125
|
+
* 次要信息区域,通常用于展示时间、状态等辅助信息
|
|
126
|
+
* 支持多种元素类型和分隔符
|
|
127
|
+
* @example
|
|
128
|
+
* subInfo: {
|
|
129
|
+
* split: 'dot',
|
|
130
|
+
* items: [
|
|
131
|
+
* { category: 'subinfo_label', children: '2023-06-01 10:00:00' },
|
|
132
|
+
* { category: 'subinfo_label', children: '用时30分钟' }
|
|
133
|
+
* ]
|
|
134
|
+
* }
|
|
135
|
+
*/
|
|
136
|
+
subInfo?: TimelineAreaProps;
|
|
137
|
+
/**
|
|
138
|
+
* 自定义次要信息渲染函数,优先级高于subInfo
|
|
139
|
+
* 可以完全自定义次要信息区域的展示内容和样式
|
|
140
|
+
* @param subInfo - 默认的次要信息配置
|
|
141
|
+
* @returns 自定义渲染的React节点
|
|
142
|
+
* @example
|
|
143
|
+
* subInfoRender: (subInfo) => {
|
|
144
|
+
* const startTime = String(subInfo?.items[0].children || "");
|
|
145
|
+
* const endTime = String(subInfo?.items[1].children || "");
|
|
146
|
+
* return (
|
|
147
|
+
* <div>
|
|
148
|
+
* <div>开始时间: {startTime}</div>
|
|
149
|
+
* <div>结束时间: {endTime}</div>
|
|
150
|
+
* </div>
|
|
151
|
+
* );
|
|
152
|
+
* }
|
|
153
|
+
*/
|
|
154
|
+
subInfoRender?: (subInfo?: TimelineAreaProps) => ReactNode;
|
|
155
|
+
}
|
|
156
|
+
/**
|
|
157
|
+
* Timeline组件属性
|
|
158
|
+
* 定义Timeline组件接收的所有属性
|
|
159
|
+
*/
|
|
160
|
+
export interface TimelineProps {
|
|
161
|
+
/**
|
|
162
|
+
* 是否启用紧凑模式,启用后时间线项目之间的间距会减小
|
|
163
|
+
* 适合在有限空间内展示更多时间线项目
|
|
164
|
+
* @default false
|
|
165
|
+
* @example
|
|
166
|
+
* compact={true}
|
|
167
|
+
*/
|
|
168
|
+
compact?: boolean;
|
|
169
|
+
/**
|
|
170
|
+
* 时间线项目数据数组,包含要显示的所有时间线条目
|
|
171
|
+
* 数组中的每个项目定义一个时间线条目的全部内容和样式
|
|
172
|
+
* @example
|
|
173
|
+
* items={[
|
|
174
|
+
* {
|
|
175
|
+
* status: "success",
|
|
176
|
+
* infos: [{ items: [{ category: "info", children: "操作成功" }] }],
|
|
177
|
+
* subInfo: { items: [{ category: "subinfo_label", children: "2023-06-01" }] }
|
|
178
|
+
* }
|
|
179
|
+
* ]}
|
|
180
|
+
*/
|
|
181
|
+
items: TimelineItemData[];
|
|
182
|
+
/**
|
|
183
|
+
* 空状态显示文本,当items为空数组时显示
|
|
184
|
+
* @default "暂无数据"
|
|
185
|
+
* @example
|
|
186
|
+
* emptyText="暂无历史记录"
|
|
187
|
+
*/
|
|
188
|
+
emptyText?: string;
|
|
189
|
+
/**
|
|
190
|
+
* 空状态文本的样式类名,可用于自定义空状态文本的样式
|
|
191
|
+
* @example
|
|
192
|
+
* emptyTextClassName={Typo.Label.l2_bold_title}
|
|
193
|
+
*/
|
|
194
|
+
emptyTextClassName?: string;
|
|
195
|
+
/**
|
|
196
|
+
* 自定义空状态渲染函数,优先级高于emptyText
|
|
197
|
+
* 可以完全自定义空状态的展示内容和样式
|
|
198
|
+
* @param emptyText - 默认的空状态文本
|
|
199
|
+
* @returns 自定义渲染的React节点
|
|
200
|
+
* @example
|
|
201
|
+
* emptyRender={(text) => (
|
|
202
|
+
* <div>
|
|
203
|
+
* <div>{text}</div>
|
|
204
|
+
* <Button type="primary">刷新数据</Button>
|
|
205
|
+
* </div>
|
|
206
|
+
* )}
|
|
207
|
+
*/
|
|
208
|
+
emptyRender?: (emptyText?: string) => ReactNode;
|
|
209
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ReactElement } from "react";
|
|
2
|
+
import { TimelineProps } from "./Timeline.type";
|
|
3
|
+
/**
|
|
4
|
+
* Timeline 组件:展示时间线
|
|
5
|
+
*
|
|
6
|
+
* @param props - 组件属性
|
|
7
|
+
* @returns React 组件
|
|
8
|
+
*/
|
|
9
|
+
export declare const Timeline: ({ items, emptyText, emptyRender, compact, emptyTextClassName, }: TimelineProps) => ReactElement;
|
|
10
|
+
export * from "./Timeline.type";
|
package/dist/src/core/index.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
import React from "react";
|
|
1
2
|
export declare const EMPTY_FUNCTION: () => void;
|
|
2
3
|
export declare const EMPTY_ARRAY: never[];
|
|
3
4
|
export declare const EMPTY_OBJECT: {};
|
|
4
5
|
export declare const EMPTY_COMPONENT: () => null;
|
|
5
6
|
export declare const DAYJS_I18N_MAP: Record<string, string>;
|
|
6
7
|
export declare const Antd5PrefixCls = "antd5";
|
|
8
|
+
export declare const splitMap: Record<string, React.ReactElement>;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { StoryObj } from "@storybook/react";
|
|
3
|
+
import { Timeline } from "../../../src/core/Timeline";
|
|
4
|
+
/**
|
|
5
|
+
* * Timeline 时间线组件
|
|
6
|
+
* * 用于展示操作记录、系统事件的时间线
|
|
7
|
+
* * 支持多种状态展示:成功、失败、进行中、通知、空闲
|
|
8
|
+
* * 支持自定义标签和操作按钮
|
|
9
|
+
* * 支持使用 Area 组件灵活自定义辅助信息展示
|
|
10
|
+
*/
|
|
11
|
+
declare const meta: {
|
|
12
|
+
component: ({ items, emptyText, emptyRender, compact, emptyTextClassName, }: import("../../../src/core/Timeline").TimelineProps) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
|
|
13
|
+
title: string;
|
|
14
|
+
parameters: {
|
|
15
|
+
docs: {
|
|
16
|
+
description: {
|
|
17
|
+
component: string;
|
|
18
|
+
};
|
|
19
|
+
source: {
|
|
20
|
+
type: string;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
controls: {
|
|
24
|
+
sort: string;
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
export default meta;
|
|
29
|
+
type Story = StoryObj<typeof Timeline>;
|
|
30
|
+
export declare const SuccessTimeline: Story;
|
|
31
|
+
export declare const FailedTimeline: Story;
|
|
32
|
+
export declare const EmptyTimeline: Story;
|
|
33
|
+
export declare const CustomEmptyState: Story;
|
|
34
|
+
export declare const CustomSecondaryTextStyle: Story;
|
|
35
|
+
export declare const CustomErrorMessage: Story;
|
|
36
|
+
export declare const CustomTags: Story;
|
|
37
|
+
export declare const CustomInfoRender: Story;
|
|
38
|
+
export declare const CustomSubInfoRender: Story;
|