@cloudtower/eagle 0.33.1 → 0.33.2

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.
Files changed (78) hide show
  1. package/dist/cjs/antd.js +6 -6
  2. package/dist/cjs/core/BitPerSecond/index.js +3 -3
  3. package/dist/cjs/core/KitStoreProvider/index.js +10 -0
  4. package/dist/cjs/core/Modal/index.js +53 -42
  5. package/dist/cjs/core/ModalStack/index.js +6 -0
  6. package/dist/cjs/core/Progress/progress.widgets.js +2 -5
  7. package/dist/cjs/core/SearchInput/index.js +21 -11
  8. package/dist/cjs/core/Timeline/Timeline.style.js +13 -0
  9. package/dist/cjs/core/Timeline/Timeline.widget.js +114 -0
  10. package/dist/cjs/core/Timeline/index.js +122 -0
  11. package/dist/cjs/coreX/CheckPointList/checkpointlist.style.js +9 -0
  12. package/dist/cjs/coreX/CheckPointList/index.js +90 -0
  13. package/dist/cjs/coreX/DateRangePicker/common.js +7 -5
  14. package/dist/cjs/coreX/DateRangePicker/index.js +10 -5
  15. package/dist/cjs/coreX/InfoRowList/InfoRow.js +31 -0
  16. package/dist/cjs/coreX/InfoRowList/InfoRowList.js +60 -0
  17. package/dist/cjs/coreX/Show/index.js +20 -0
  18. package/dist/cjs/index.js +122 -112
  19. package/dist/cjs/stats1.html +1 -1
  20. package/dist/cjs/store/modal.js +3 -0
  21. package/dist/cjs/utils/constants.js +11 -0
  22. package/dist/components.css +1800 -1552
  23. package/dist/esm/antd.js +3 -3
  24. package/dist/esm/core/BitPerSecond/index.js +3 -3
  25. package/dist/esm/core/KitStoreProvider/index.js +10 -1
  26. package/dist/esm/core/Modal/index.js +53 -42
  27. package/dist/esm/core/ModalStack/index.js +7 -1
  28. package/dist/esm/core/Progress/progress.widgets.js +1 -4
  29. package/dist/esm/core/SearchInput/index.js +21 -11
  30. package/dist/esm/core/Timeline/Timeline.style.js +7 -0
  31. package/dist/esm/core/Timeline/Timeline.widget.js +107 -0
  32. package/dist/esm/core/Timeline/index.js +115 -0
  33. package/dist/esm/coreX/CheckPointList/checkpointlist.style.js +5 -0
  34. package/dist/esm/coreX/CheckPointList/index.js +83 -0
  35. package/dist/esm/coreX/DateRangePicker/common.js +7 -5
  36. package/dist/esm/coreX/DateRangePicker/index.js +10 -5
  37. package/dist/esm/coreX/InfoRowList/InfoRow.js +25 -0
  38. package/dist/esm/coreX/InfoRowList/InfoRowList.js +54 -0
  39. package/dist/esm/coreX/Show/index.js +14 -0
  40. package/dist/esm/index.js +8 -4
  41. package/dist/esm/stats1.html +1 -1
  42. package/dist/esm/store/modal.js +3 -0
  43. package/dist/esm/utils/constants.js +7 -1
  44. package/dist/src/antd.d.ts +2 -2
  45. package/dist/src/core/Alert/alert.type.d.ts +5 -4
  46. package/dist/src/core/BitPerSecond/index.d.ts +2 -2
  47. package/dist/src/core/KitStoreProvider/index.d.ts +1 -0
  48. package/dist/src/core/Modal/modal.type.d.ts +25 -2
  49. package/dist/src/core/SearchInput/searchInput.type.d.ts +33 -0
  50. package/dist/src/core/Timeline/Timeline.style.d.ts +5 -0
  51. package/dist/src/core/Timeline/Timeline.type.d.ts +209 -0
  52. package/dist/src/core/Timeline/Timeline.widget.d.ts +5 -0
  53. package/dist/src/core/Timeline/index.d.ts +10 -0
  54. package/dist/src/core/index.d.ts +1 -0
  55. package/dist/src/coreX/CheckPointList/checkpointlist.style.d.ts +3 -0
  56. package/dist/src/coreX/CheckPointList/checkpointlist.type.d.ts +93 -0
  57. package/dist/src/coreX/CheckPointList/index.d.ts +8 -0
  58. package/dist/src/coreX/DateRangePicker/dateRangePicker.type.d.ts +6 -1
  59. package/dist/src/coreX/InfoRowList/InfoRow.d.ts +7 -0
  60. package/dist/src/coreX/InfoRowList/InfoRowList.d.ts +3 -0
  61. package/dist/src/coreX/InfoRowList/InfoRowList.type.d.ts +63 -0
  62. package/dist/src/coreX/InfoRowList/index.d.ts +1 -0
  63. package/dist/src/coreX/Show/index.d.ts +3 -0
  64. package/dist/src/coreX/Show/show.type.d.ts +13 -0
  65. package/dist/src/coreX/index.d.ts +5 -2
  66. package/dist/src/store/modal.d.ts +8 -2
  67. package/dist/src/utils/constants.d.ts +2 -0
  68. package/dist/stories/docs/core/Button.stories.d.ts +11 -0
  69. package/dist/stories/docs/core/KitStoreProvider.stories.d.ts +1 -1
  70. package/dist/stories/docs/core/Modal.stories.d.ts +4 -0
  71. package/dist/stories/docs/core/Timeline.stories.d.ts +38 -0
  72. package/dist/stories/docs/coreX/CheckPointList.stories.d.ts +67 -0
  73. package/dist/stories/docs/coreX/DateRangePicker.stories.d.ts +1 -0
  74. package/dist/stories/docs/coreX/I18nNameTag.stories.d.ts +8 -0
  75. package/dist/stories/docs/coreX/InfoRowList.stories.d.ts +36 -0
  76. package/dist/stories/docs/coreX/Show.stories.d.ts +31 -0
  77. package/dist/style.css +1294 -1075
  78. package/package.json +4 -4
@@ -22,6 +22,7 @@ var ModalActions = /* @__PURE__ */ ((ModalActions2) => {
22
22
  ModalActions2["POP_MODAL"] = "POP_MODAL";
23
23
  ModalActions2["REMOVE_MODAL"] = "REMOVE_MODAL";
24
24
  ModalActions2["CLOSE_MODAL"] = "CLOSE_MODAL";
25
+ ModalActions2["RESET_MODAL"] = "RESET_MODAL";
25
26
  return ModalActions2;
26
27
  })(ModalActions || {});
27
28
  const initialModalState = {
@@ -55,6 +56,8 @@ const modalReducer = (state = initialModalState, action) => {
55
56
  return __spreadProps(__spreadValues({}, state), {
56
57
  closeId: action.id
57
58
  });
59
+ case "RESET_MODAL" /* RESET_MODAL */:
60
+ return initialModalState;
58
61
  default:
59
62
  return state;
60
63
  }
@@ -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 };
@@ -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 TimelineItem: FC<import("antd/lib/timeline").TimeLineItemProps>;
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;
@@ -1,6 +1,7 @@
1
1
  /// <reference types="react" />
2
- import { AlertProps } from "antd/lib/alert";
3
- export type AlertComponentType = React.FunctionComponent<Omit<AlertProps, "type"> & {
4
- type?: AlertProps["type"] | "normal";
2
+ import { AlertProps as AntdAlertProps } from "antd/lib/alert";
3
+ export type AlertProps = Omit<AntdAlertProps, "type"> & {
4
+ type?: AntdAlertProps["type"] | "normal";
5
5
  action?: React.ReactNode;
6
- }>;
6
+ };
7
+ export type AlertComponentType = React.FunctionComponent<AlertProps>;
@@ -1,3 +1,3 @@
1
1
  import { UnitFn } from "../Units/units.type";
2
- declare const BitPerSeconds: UnitFn;
3
- export default BitPerSeconds;
2
+ declare const BitPerSecond: UnitFn;
3
+ export default BitPerSecond;
@@ -9,3 +9,4 @@ export declare const useKitSelector: <Selected extends unknown>(selector: (state
9
9
  export declare const usePushModal: () => <K extends string | number>(modal: ModalType<IModalProps[K]>) => void;
10
10
  export declare const useCloseModal: () => (id: number) => void;
11
11
  export declare const usePopModal: () => () => void;
12
+ export declare const useResetModal: () => () => void;
@@ -1,37 +1,60 @@
1
1
  /// <reference types="react" />
2
2
  import { ModalProps as AntdModalProps } from "antd/lib/modal";
3
3
  export type WizardSteps = {
4
+ /** 步骤标题 */
4
5
  title: string;
6
+ /** 步骤内容渲染 */
5
7
  render: React.ReactNode;
6
8
  /**
7
- * custom prev button text
9
+ * 自定义上一步按钮文本
8
10
  */
9
11
  prevText?: string | React.ReactNode;
10
12
  /**
11
- * custom prev button event handler
13
+ * 自定义上一步按钮事件处理
12
14
  * @returns void
13
15
  */
14
16
  onPrev?: () => void;
17
+ /** 自定义确认按钮文本 */
15
18
  okText?: string | React.ReactNode;
19
+ /** 确认按钮点击事件处理 */
16
20
  onOk?: (e: React.MouseEvent<HTMLElement>) => void;
21
+ /** 是否禁用当前步骤 */
17
22
  disabled?: boolean;
18
23
  }[];
19
24
  export type ModalProps = Omit<AntdModalProps, "okType"> & {
25
+ /** 确认按钮加载状态 */
20
26
  confirmLoading?: boolean;
27
+ /** 是否全屏显示 */
21
28
  fullscreen?: boolean;
29
+ /** 错误信息展示 */
22
30
  error?: string | React.ReactNode;
31
+ /** 是否使用普通模式 */
23
32
  normal?: boolean;
33
+ /** 模态框内容 */
24
34
  children?: React.ReactNode;
35
+ /** 是否显示取消按钮 */
25
36
  showCancel?: boolean;
37
+ /** 是否显示确认按钮 */
26
38
  showOk?: boolean;
39
+ /** 自定义关闭图标 */
27
40
  closeIcon?: React.ReactNode;
41
+ /** 向导模式配置 */
28
42
  wizard?: {
43
+ /** 当前步骤 */
29
44
  step: number;
45
+ /** 步骤改变时的回调 */
30
46
  onStepChange?: (step: number) => void;
47
+ /** 步骤配置数组 */
31
48
  steps: WizardSteps;
49
+ /** 是否隐藏左侧区域 */
32
50
  hideLeft?: boolean;
51
+ /** 右侧自定义内容 */
33
52
  right?: React.ReactNode;
53
+ /** 是否销毁其他步骤内容 */
34
54
  destroyOtherStep?: boolean;
55
+ /** 是否禁用上一步操作 */
35
56
  disablePrevStep?: boolean;
36
57
  } | boolean;
58
+ /** 是否隐藏底部按钮边框 */
59
+ hideFooterButtonBorder?: boolean;
37
60
  };
@@ -1,5 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  import { InputProps } from "antd/lib/input";
3
+ import { SrcType } from "../BaseIcon";
3
4
  export type SearchInputProps = Omit<InputProps, "onChange"> & {
4
5
  /**
5
6
  * 防抖延迟的时间,单位为毫秒
@@ -21,5 +22,37 @@ export type SearchInputProps = Omit<InputProps, "onChange"> & {
21
22
  * 输入内容改变时的回调函数
22
23
  */
23
24
  onChange: (value: string) => void;
25
+ /**
26
+ * 搜索的图标
27
+ */
28
+ searchIcon?: SrcType;
29
+ /**
30
+ * 上一个图标
31
+ */
32
+ prefixIcon?: SrcType;
33
+ /**
34
+ * 上一个 hover 时的图标
35
+ */
36
+ prefixHoverIcon?: SrcType;
37
+ /**
38
+ * 下一个图标
39
+ */
40
+ nextIcon?: SrcType;
41
+ /**
42
+ * 下一个 hover 时的图标
43
+ */
44
+ nextHoverIcon?: SrcType;
45
+ /**
46
+ * 清空图标
47
+ */
48
+ clearIcon?: SrcType;
49
+ /**
50
+ * 清空 hover 时的图标
51
+ */
52
+ clearHoverIcon?: SrcType;
53
+ /**
54
+ * 搜索框高度,默认为 276
55
+ */
56
+ width?: number | string;
24
57
  };
25
58
  export type SearchInputComponentType = React.FC<SearchInputProps>;
@@ -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,5 @@
1
+ import React from "react";
2
+ import { TimelineAreaProps } from "./Timeline.type";
3
+ export declare const TimelineArea: React.FC<TimelineAreaProps & {
4
+ compact?: boolean;
5
+ }>;
@@ -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";
@@ -1,3 +1,4 @@
1
+ export * from "./Timeline";
1
2
  export * from "./AccordionCard";
2
3
  export * from "./Alert";
3
4
  export * from "./Antd5Anchor";
@@ -0,0 +1,3 @@
1
+ export declare const CheckPointListStyle: import("@linaria/core").LinariaClassName;
2
+ export declare const CheckPointItemStyle: import("@linaria/core").LinariaClassName;
3
+ export declare const EmptyWrapper: import("@linaria/core").LinariaClassName;
@@ -0,0 +1,93 @@
1
+ import { AlertProps } from "../../core/Alert";
2
+ import { TagProps } from "../../core/Tag";
3
+ import React from "react";
4
+ /**
5
+ * 检查点项的属性
6
+ * @property {React.ReactNode} description - 检查点项的描述文本,用于展示检查内容,支持传入 React 节点
7
+ * @property {'success' | 'failed' | 'loading' | 'warning'} status - 检查点状态,success 表示通过,failed 表示失败,loading 表示加载中,warning 表示警告
8
+ * @property {TagProps} [tagProps] - 标签的自定义属性,可以自定义标签的颜色、图标等
9
+ * @property {AlertProps} [alertProps] - 警告组件的自定义属性,用于展示失败信息及其样式
10
+ * @example
11
+ * {
12
+ * description: "存储空间检查",
13
+ * status: "success",
14
+ * tagProps: {
15
+ * color: "green",
16
+ * children: "通过"
17
+ * }
18
+ * }
19
+ * @example
20
+ * {
21
+ * description: <span>网络连接检查 <b>(重要)</b></span>,
22
+ * status: "failed",
23
+ * tagProps: {
24
+ * color: "red",
25
+ * children: "失败"
26
+ * },
27
+ * alertProps: {
28
+ * message: "网络连接失败",
29
+ * type: "error"
30
+ * }
31
+ * }
32
+ */
33
+ export interface CheckPointItem {
34
+ description: React.ReactNode;
35
+ status: "success" | "failed" | "loading" | "warning";
36
+ tagProps?: TagProps;
37
+ alertProps?: AlertProps;
38
+ }
39
+ /**
40
+ * 检查点列表的属性
41
+ * @property {CheckPointItem[]} items - 检查点列表的项,包含检查项的描述、状态等信息
42
+ * @property {boolean} [showSwitchControl=true] - 是否显示切换控制来过滤未通过的项
43
+ * @property {(checked: boolean) => void} [onClickSwitch] - 切换开关时的回调函数
44
+ * @property {string | React.ReactNode} title - 自定义检查点列表的标题
45
+ * @property {string} [switchText] - 自定义开关按钮的文本描述
46
+ * @property {string | React.ReactNode} [emptyText] - 列表为空时显示的文本
47
+ * @property {string} [emptyTextClassName] - 空状态文本的自定义类名
48
+ * @property {(emptyText: string | React.ReactNode) => React.ReactNode} [emptyRender] - 自定义渲染空状态的函数
49
+ * @example
50
+ * {
51
+ * title: "系统检查项",
52
+ * items: [
53
+ * {
54
+ * description: "存储空间检查",
55
+ * status: "success",
56
+ * tagProps: { color: "green", children: "通过" }
57
+ * },
58
+ * {
59
+ * description: "权限检查",
60
+ * status: "failed",
61
+ * tagProps: { color: "red", children: "失败" },
62
+ * alertProps: { message: "当前用户没有管理员权限", type: "error" }
63
+ * }
64
+ * ],
65
+ * showSwitchControl: true,
66
+ * switchText: "只显示失败项"
67
+ * }
68
+ * @example
69
+ * {
70
+ * title: "系统检查项",
71
+ * items: [],
72
+ * emptyText: "暂无检查项",
73
+ * emptyTextClassName: "custom-empty-class"
74
+ * }
75
+ */
76
+ export interface CheckPointListProps {
77
+ items: CheckPointItem[];
78
+ emptyText?: string | React.ReactNode;
79
+ emptyTextClassName?: string;
80
+ emptyRender?: (emptyText: string | React.ReactNode) => React.ReactNode;
81
+ showSwitchControl?: boolean;
82
+ onClickSwitch?: (checked: boolean) => void;
83
+ title: string | React.ReactNode;
84
+ switchText?: string;
85
+ }
86
+ /**
87
+ * CheckPointItem 组件的属性
88
+ * @extends CheckPointItem
89
+ * @property {string} [key] - React 列表项的唯一标识符
90
+ */
91
+ export interface CheckPointItemProps extends CheckPointItem {
92
+ key?: string;
93
+ }
@@ -0,0 +1,8 @@
1
+ import React from "react";
2
+ import { CheckPointListProps, CheckPointItemProps } from "./checkpointlist.type";
3
+ export declare const CheckPointItem: React.FC<CheckPointItemProps>;
4
+ /**
5
+ * CheckPointList displays a list of checkpoint items with filtering capability
6
+ */
7
+ export declare const CheckPointList: React.FC<CheckPointListProps>;
8
+ export * from "./checkpointlist.type";
@@ -56,9 +56,14 @@ export type DateRangePickerProps = {
56
56
  minDate?: string | Dayjs | undefined;
57
57
  maxDate?: string | Dayjs | undefined;
58
58
  onChange?: (type: "relative" | "absolute", time: DateRangePickerValue, range: PickerDateRange) => void;
59
+ onAbsoluteTimeChange?: (range: PickerDateRange) => void;
60
+ /**
61
+ * Customize an array of relative time select options
62
+ */
63
+ relativeTimeSelectOptions?: PastTime[];
59
64
  };
60
65
  export type PastTime = {
61
- unit: "h" | "m" | "d";
66
+ unit: "h" | "m" | "d" | "M";
62
67
  value: number;
63
68
  disabled?: boolean;
64
69
  };
@@ -0,0 +1,7 @@
1
+ import React from "react";
2
+ export declare const InfoRow: React.FC<{
3
+ label: React.ReactNode;
4
+ content: boolean | {} | string | number | JSX.Element;
5
+ className?: string;
6
+ onClick?: () => void;
7
+ }>;
@@ -0,0 +1,3 @@
1
+ import React from "react";
2
+ import { InfoListProps } from "./InfoRowList.type";
3
+ export declare const InfoRowList: React.ForwardRefExoticComponent<InfoListProps & React.RefAttributes<HTMLDivElement>>;
@@ -0,0 +1,63 @@
1
+ /// <reference types="react" />
2
+ /**
3
+ * InfoRowList 组件的属性定义
4
+ */
5
+ export type InfoListProps = {
6
+ /**
7
+ * 容器的自定义类名
8
+ */
9
+ className?: string;
10
+ /**
11
+ * 每一行的自定义类名
12
+ */
13
+ rowClassName?: string;
14
+ /**
15
+ * 是否处于加载状态
16
+ * @default false
17
+ */
18
+ loading: boolean;
19
+ /**
20
+ * 信息列表数据
21
+ * @example
22
+ * ```tsx
23
+ * const data = [
24
+ * {
25
+ * key: 'name',
26
+ * name: '名称',
27
+ * value: '示例名称',
28
+ * action: <Button>编辑</Button>,
29
+ * hidden: false
30
+ * }
31
+ * ]
32
+ * ```
33
+ */
34
+ data: {
35
+ /**
36
+ * 行的唯一标识
37
+ */
38
+ key: string;
39
+ /**
40
+ * 行标签名称
41
+ */
42
+ name: React.ReactNode;
43
+ /**
44
+ * 行内容值
45
+ */
46
+ value: React.ReactNode;
47
+ /**
48
+ * 可选的操作按钮
49
+ */
50
+ action?: React.ReactNode;
51
+ /**
52
+ * 是否隐藏该行
53
+ * @default false
54
+ */
55
+ hidden?: boolean;
56
+ }[];
57
+ /**
58
+ * 是否使用紧凑模式
59
+ * 紧凑模式一般用于详情页面,普通模式用于设置页面
60
+ * @default false
61
+ */
62
+ compact?: boolean;
63
+ };
@@ -0,0 +1 @@
1
+ export * from "./InfoRowList";
@@ -0,0 +1,3 @@
1
+ import React from "react";
2
+ import { ShowProps } from "./show.type";
3
+ export declare const Show: React.FC<ShowProps>;
@@ -0,0 +1,13 @@
1
+ /// <reference types="react" />
2
+ export type ShowProps = React.PropsWithChildren<{
3
+ /**
4
+ *
5
+ * 检查的条件。可以是布尔值或返回布尔值的函数。
6
+ */
7
+ condition: boolean | (() => boolean);
8
+ /**
9
+ *
10
+ * 当条件为假时显示的备用内容。
11
+ */
12
+ fallback?: React.ReactElement;
13
+ }>;