@cloudtower/eagle 0.33.0 → 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.
- package/README.md +6 -0
- package/dist/cjs/UIKitProvider/index.js +3 -4
- package/dist/cjs/antd.js +6 -6
- package/dist/cjs/core/Alert/index.js +10 -4
- package/dist/cjs/core/BitPerSecond/index.js +3 -3
- package/dist/cjs/core/KitStoreProvider/index.js +10 -0
- package/dist/cjs/core/Modal/index.js +53 -42
- package/dist/cjs/core/ModalStack/index.js +6 -0
- package/dist/cjs/core/Progress/progress.widgets.js +2 -5
- package/dist/cjs/core/SearchInput/index.js +21 -11
- package/dist/cjs/core/TableForm/TableFormBodyCell.js +2 -1
- package/dist/cjs/core/TableForm/TableFormHeaderCell.js +4 -2
- 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/core/message/index.js +7 -2
- package/dist/cjs/core/message-group/index.js +3 -1
- package/dist/cjs/coreX/CheckPointList/checkpointlist.style.js +9 -0
- package/dist/cjs/coreX/CheckPointList/index.js +90 -0
- package/dist/cjs/coreX/DateRangePicker/common.js +7 -5
- package/dist/cjs/coreX/DateRangePicker/index.js +10 -5
- package/dist/cjs/coreX/InfoRowList/InfoRow.js +31 -0
- package/dist/cjs/coreX/InfoRowList/InfoRowList.js +60 -0
- package/dist/cjs/coreX/Show/index.js +20 -0
- package/dist/cjs/index.js +123 -112
- package/dist/cjs/stats1.html +1 -1
- package/dist/cjs/store/modal.js +3 -0
- package/dist/cjs/styles/token/color.js +24 -0
- package/dist/cjs/utils/constants.js +11 -0
- package/dist/components.css +2098 -1744
- package/dist/esm/UIKitProvider/index.js +3 -4
- package/dist/esm/antd.js +3 -3
- package/dist/esm/core/Alert/index.js +10 -4
- package/dist/esm/core/BitPerSecond/index.js +3 -3
- package/dist/esm/core/KitStoreProvider/index.js +10 -1
- package/dist/esm/core/Modal/index.js +53 -42
- package/dist/esm/core/ModalStack/index.js +7 -1
- package/dist/esm/core/Progress/progress.widgets.js +1 -4
- package/dist/esm/core/SearchInput/index.js +21 -11
- package/dist/esm/core/TableForm/TableFormBodyCell.js +2 -1
- package/dist/esm/core/TableForm/TableFormHeaderCell.js +4 -2
- 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/core/message/index.js +7 -3
- package/dist/esm/core/message-group/index.js +3 -1
- package/dist/esm/coreX/CheckPointList/checkpointlist.style.js +5 -0
- package/dist/esm/coreX/CheckPointList/index.js +83 -0
- package/dist/esm/coreX/DateRangePicker/common.js +7 -5
- package/dist/esm/coreX/DateRangePicker/index.js +10 -5
- package/dist/esm/coreX/InfoRowList/InfoRow.js +25 -0
- package/dist/esm/coreX/InfoRowList/InfoRowList.js +54 -0
- package/dist/esm/coreX/Show/index.js +14 -0
- package/dist/esm/index.js +9 -5
- package/dist/esm/stats1.html +1 -1
- package/dist/esm/store/modal.js +3 -0
- package/dist/esm/styles/token/color.js +24 -0
- package/dist/esm/utils/constants.js +7 -1
- package/dist/src/UIKitProvider/index.d.ts +4 -4
- package/dist/src/antd.d.ts +2 -2
- package/dist/src/core/Alert/alert.type.d.ts +5 -4
- package/dist/src/core/BitPerSecond/index.d.ts +2 -2
- package/dist/src/core/KitStoreProvider/index.d.ts +1 -0
- package/dist/src/core/Legend/__test__/h5_css.test.d.ts +1 -0
- package/dist/src/core/Legend/index.d.ts +9 -0
- package/dist/src/core/Legend/legend.type.d.ts +25 -0
- package/dist/src/core/Modal/modal.type.d.ts +25 -2
- package/dist/src/core/SearchInput/searchInput.type.d.ts +33 -0
- package/dist/src/core/TableForm/types.d.ts +1 -0
- 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/core/message/index.d.ts +1 -0
- package/dist/src/coreX/CheckPointList/checkpointlist.style.d.ts +3 -0
- package/dist/src/coreX/CheckPointList/checkpointlist.type.d.ts +93 -0
- package/dist/src/coreX/CheckPointList/index.d.ts +8 -0
- package/dist/src/coreX/DateRangePicker/dateRangePicker.type.d.ts +6 -1
- package/dist/src/coreX/InfoRowList/InfoRow.d.ts +7 -0
- package/dist/src/coreX/InfoRowList/InfoRowList.d.ts +3 -0
- package/dist/src/coreX/InfoRowList/InfoRowList.type.d.ts +63 -0
- package/dist/src/coreX/InfoRowList/index.d.ts +1 -0
- package/dist/src/coreX/Show/index.d.ts +3 -0
- package/dist/src/coreX/Show/show.type.d.ts +13 -0
- package/dist/src/coreX/index.d.ts +5 -2
- package/dist/src/store/modal.d.ts +8 -2
- package/dist/src/styles/token/color.d.ts +24 -0
- package/dist/src/utils/constants.d.ts +2 -0
- package/dist/stories/docs/core/Button.stories.d.ts +11 -0
- package/dist/stories/docs/core/KitStoreProvider.stories.d.ts +1 -1
- package/dist/stories/docs/core/Legend.stories.d.ts +19 -0
- package/dist/stories/docs/core/Modal.stories.d.ts +4 -0
- package/dist/stories/docs/core/SearchInput.stories.d.ts +20 -20
- package/dist/stories/docs/core/Select.stories.d.ts +94 -13
- package/dist/stories/docs/core/StatusCapsule.stories.d.ts +8 -0
- package/dist/stories/docs/core/Timeline.stories.d.ts +38 -0
- package/dist/stories/docs/core/message-group.stories.d.ts +4 -0
- package/dist/stories/docs/coreX/CheckPointList.stories.d.ts +67 -0
- package/dist/stories/docs/coreX/DateRangePicker.stories.d.ts +1 -0
- package/dist/stories/docs/coreX/I18nNameTag.stories.d.ts +8 -0
- package/dist/stories/docs/coreX/InfoRowList.stories.d.ts +36 -0
- package/dist/stories/docs/coreX/Show.stories.d.ts +31 -0
- package/dist/style.css +1592 -1271
- package/dist/token.css +20 -26
- package/dist/variables.scss +21 -0
- package/package.json +7 -7
|
@@ -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";
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export * from "./BarChart";
|
|
2
2
|
export * from "./BatchOperation";
|
|
3
3
|
export * from "./ChartWithTooltip";
|
|
4
|
+
export * from "./CircleLoading";
|
|
4
5
|
export * from "./common";
|
|
5
6
|
export * from "./Counting";
|
|
6
7
|
export * from "./CronCalendar";
|
|
@@ -10,8 +11,10 @@ export * from "./DeprecatedDonutChart";
|
|
|
10
11
|
export * from "./DropdownTransition";
|
|
11
12
|
export * from "./GoBackButton";
|
|
12
13
|
export * from "./I18nNameTag";
|
|
14
|
+
export * from "./InfoRowList";
|
|
13
15
|
export * from "./NamesTooltip";
|
|
14
16
|
export * from "./OverflowTooltip";
|
|
17
|
+
export * from "./Show";
|
|
15
18
|
export * from "./SidebarSubtitle";
|
|
16
19
|
export * from "./Sider";
|
|
17
20
|
export * from "./SortableList";
|
|
@@ -19,10 +22,11 @@ export * from "./SummaryTable";
|
|
|
19
22
|
export * from "./SwitchWithText";
|
|
20
23
|
export * from "./TabMenu";
|
|
21
24
|
export * from "./UnitWithChart";
|
|
22
|
-
export * from "./
|
|
25
|
+
export * from "./CheckPointList";
|
|
23
26
|
export { default as BarChart } from "./BarChart";
|
|
24
27
|
export { default as BatchOperation } from "./BatchOperation";
|
|
25
28
|
export { default as ChartWithTooltip } from "./ChartWithTooltip";
|
|
29
|
+
export { default as CircleLoading } from "./CircleLoading";
|
|
26
30
|
export { default as Counting } from "./Counting";
|
|
27
31
|
export { default as CronCalendar } from "./CronCalendar";
|
|
28
32
|
export { default as CronPlan } from "./CronPlan";
|
|
@@ -40,4 +44,3 @@ export { default as SummaryTable } from "./SummaryTable";
|
|
|
40
44
|
export { default as SwitchWithText } from "./SwitchWithText";
|
|
41
45
|
export { default as TabMenu } from "./TabMenu";
|
|
42
46
|
export { default as UnitWithChart } from "./UnitWithChart";
|
|
43
|
-
export { default as CircleLoading } from "./CircleLoading";
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
export type CloseCb = {
|
|
3
3
|
onClose: () => void;
|
|
4
|
+
closeAllModal: () => void;
|
|
4
5
|
modalId: number;
|
|
5
6
|
};
|
|
6
7
|
export type ModalType<TProps> = TProps extends void ? {
|
|
@@ -9,6 +10,7 @@ export type ModalType<TProps> = TProps extends void ? {
|
|
|
9
10
|
component: React.FC<TProps & CloseCb>;
|
|
10
11
|
props: TProps & {
|
|
11
12
|
onClose?: () => void;
|
|
13
|
+
closeAllModal?: () => void;
|
|
12
14
|
};
|
|
13
15
|
};
|
|
14
16
|
export type ModalState = {
|
|
@@ -21,7 +23,8 @@ export declare enum ModalActions {
|
|
|
21
23
|
PUSH_MODAL = "PUSH_MODAL",
|
|
22
24
|
POP_MODAL = "POP_MODAL",
|
|
23
25
|
REMOVE_MODAL = "REMOVE_MODAL",
|
|
24
|
-
CLOSE_MODAL = "CLOSE_MODAL"
|
|
26
|
+
CLOSE_MODAL = "CLOSE_MODAL",
|
|
27
|
+
RESET_MODAL = "RESET_MODAL"
|
|
25
28
|
}
|
|
26
29
|
type PUSH_MODAL<TProps> = {
|
|
27
30
|
type: ModalActions.PUSH_MODAL;
|
|
@@ -38,7 +41,10 @@ type CLOSE_MODAL = {
|
|
|
38
41
|
type: ModalActions.CLOSE_MODAL;
|
|
39
42
|
id: number;
|
|
40
43
|
};
|
|
41
|
-
|
|
44
|
+
type RESET_MODAL = {
|
|
45
|
+
type: ModalActions.RESET_MODAL;
|
|
46
|
+
};
|
|
47
|
+
export type Actions = PUSH_MODAL<unknown> | POP_MODAL | REMOVE_MODAL | CLOSE_MODAL | RESET_MODAL;
|
|
42
48
|
export declare const initialModalState: ModalState;
|
|
43
49
|
export declare const modalReducer: (state: ModalState | undefined, action: Actions) => ModalState;
|
|
44
50
|
export interface IModalProps {
|
|
@@ -189,6 +189,30 @@ export declare const Color: {
|
|
|
189
189
|
readonly "yellow-9": "#6B4803";
|
|
190
190
|
readonly "yellow-10": "#483100";
|
|
191
191
|
};
|
|
192
|
+
readonly pink: {
|
|
193
|
+
readonly "pink-1": "#FED1FE";
|
|
194
|
+
readonly "pink-2": "#FDBCFD";
|
|
195
|
+
readonly "pink-3": "#F99BF8";
|
|
196
|
+
readonly "pink-4": "#F573F2";
|
|
197
|
+
readonly "pink-5": "#ED5BE5";
|
|
198
|
+
readonly "pink-6": "#E136C6";
|
|
199
|
+
readonly "pink-7": "#CF23A9";
|
|
200
|
+
readonly "pink-8": "#B5158D";
|
|
201
|
+
readonly "pink-9": "#910B6E";
|
|
202
|
+
readonly "pink-10": "#64054B";
|
|
203
|
+
};
|
|
204
|
+
readonly cyan: {
|
|
205
|
+
readonly "cyan-1": "#A0ECEC";
|
|
206
|
+
readonly "cyan-2": "#83E2E3";
|
|
207
|
+
readonly "cyan-3": "#67D8D9";
|
|
208
|
+
readonly "cyan-4": "#3AC4C6";
|
|
209
|
+
readonly "cyan-5": "#1AACB4";
|
|
210
|
+
readonly "cyan-6": "#048BA1";
|
|
211
|
+
readonly "cyan-7": "#00728E";
|
|
212
|
+
readonly "cyan-8": "#00607B";
|
|
213
|
+
readonly "cyan-9": "#005068";
|
|
214
|
+
readonly "cyan-10": "#004155";
|
|
215
|
+
};
|
|
192
216
|
};
|
|
193
217
|
readonly white: {
|
|
194
218
|
readonly white: "#FFFFFF";
|
|
@@ -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>;
|
|
@@ -21,3 +21,14 @@ export declare const CustomChildren: Story;
|
|
|
21
21
|
* * 这里仅对已有的用法进行展示
|
|
22
22
|
*/
|
|
23
23
|
export declare const Link: Story;
|
|
24
|
+
/**
|
|
25
|
+
* * 禁用按钮示例
|
|
26
|
+
* * 当 disabled 设置为 true 时,按钮将变为禁用状态
|
|
27
|
+
* * 禁用状态下按钮不可点击,且样式会有相应变化
|
|
28
|
+
*/
|
|
29
|
+
export declare const Disabled: Story;
|
|
30
|
+
/**
|
|
31
|
+
* 按钮有三种尺寸:large、middle、small
|
|
32
|
+
* 可以在不同场景下选择合适的按钮尺寸
|
|
33
|
+
*/
|
|
34
|
+
export declare const ButtonSizes: Story;
|
|
@@ -12,7 +12,7 @@ declare const Demo: (props: {
|
|
|
12
12
|
*
|
|
13
13
|
* ModalStack 会向上查找 KitStoreContext, 如果未查找到,会使用 eagle 提供的默认 store。
|
|
14
14
|
*
|
|
15
|
-
* usePushModal,usePopModal,useCloseModal 与 ModalStack 同理。
|
|
15
|
+
* usePushModal,usePopModal,useCloseModal, useResetModal 与 ModalStack 同理。
|
|
16
16
|
*/
|
|
17
17
|
declare const meta: Meta<typeof Demo>;
|
|
18
18
|
export default meta;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { LegendColor, LegendComponentType } from "../../../src/core/Legend/legend.type";
|
|
2
|
+
import { Meta, StoryObj } from "@storybook/react";
|
|
3
|
+
/**
|
|
4
|
+
* 图例组件,用于展示状态。
|
|
5
|
+
*
|
|
6
|
+
* 圆形:作为"状态灯"表示状态,用法类似[**状态胶囊**](/docs/core-statuscapsule-状态胶囊--docs)
|
|
7
|
+
*
|
|
8
|
+
* 方形:用作图例使用常配合 Charts、多颜色计数等使用
|
|
9
|
+
*/
|
|
10
|
+
declare const story: Meta<LegendComponentType>;
|
|
11
|
+
export declare const Basic: StoryObj<LegendComponentType>;
|
|
12
|
+
export declare const Default: StoryObj<{
|
|
13
|
+
content: string;
|
|
14
|
+
color: LegendColor;
|
|
15
|
+
hoverable: boolean;
|
|
16
|
+
offWhiteMode?: boolean;
|
|
17
|
+
number?: number;
|
|
18
|
+
}>;
|
|
19
|
+
export default story;
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
1
|
+
import SearchInput from "../../../src/core/SearchInput";
|
|
2
|
+
import type { StoryObj } from "@storybook/react";
|
|
3
|
+
/**
|
|
4
|
+
* * tower legacy 组件, 带 debounce 的搜索框
|
|
5
|
+
* * MR: http://gitlab.smartx.com/frontend/tower/-/merge_requests/930
|
|
6
|
+
*/
|
|
7
|
+
declare const meta: {
|
|
8
|
+
component: import("../../../src/core/SearchInput").SearchInputComponentType;
|
|
9
|
+
title: "Core/SearchInput | 搜索框";
|
|
10
|
+
args: {
|
|
11
|
+
debounceWait: number;
|
|
12
|
+
onSearchPrev: undefined;
|
|
13
|
+
onSearchNext: undefined;
|
|
14
|
+
total: undefined;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
export default meta;
|
|
18
|
+
type Story = StoryObj<typeof SearchInput>;
|
|
19
|
+
export declare const Basic: Story;
|
|
20
|
+
export declare const withTotal: Story;
|
|
@@ -1,16 +1,97 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
1
|
+
import Select from "../../../src/core/Select";
|
|
2
|
+
import type { StoryObj } from "@storybook/react";
|
|
3
|
+
/**
|
|
4
|
+
* Select 组件是基于 antd Select 的封装,提供了更符合设计规范的样式和交互。
|
|
5
|
+
*
|
|
6
|
+
* ### 参数说明
|
|
7
|
+
*
|
|
8
|
+
* | 参数 | 说明 | 类型 | 默认值 |
|
|
9
|
+
* | --- | --- | --- | --- |
|
|
10
|
+
* | size | 选择器大小,large 用于表单场景,small 用于表格等紧凑场景 | 'large' \| 'middle' \| 'small' | 'middle' |
|
|
11
|
+
* | loading | 加载状态,显示加载中的动画效果 | boolean | false |
|
|
12
|
+
* | isLoadingValue | 是否正在加载选项值,用于异步加载选项时的加载状态 | boolean | false |
|
|
13
|
+
* | disabled | 是否禁用选择器,禁用后不可点击选择 | boolean | false |
|
|
14
|
+
* | mode | 设置选择模式,multiple 为多选,tags 为自由输入多选 | 'multiple' \| 'tags' | - |
|
|
15
|
+
* | showSearch | 是否可搜索,开启后可通过输入关键字过滤选项 | boolean | false |
|
|
16
|
+
* | danger | 错误状态,用于表单校验失败等场景 | boolean | false |
|
|
17
|
+
* | placeholder | 选择框默认文本 | string | - |
|
|
18
|
+
* | value | 指定当前选中的条目 | string \| string[] | - |
|
|
19
|
+
* | defaultValue | 指定默认选中的条目 | string \| string[] | - |
|
|
20
|
+
* | onChange | 选中值发生变化时的回调 | function(value, option) | - |
|
|
21
|
+
*
|
|
22
|
+
* 更多属性请参考 antd Select 组件文档
|
|
23
|
+
*/
|
|
24
|
+
declare const meta: {
|
|
25
|
+
component: import("../../../src/core").SelectComponentType<any, HTMLElement>;
|
|
26
|
+
title: "Core/Select | 选择器";
|
|
27
|
+
args: {
|
|
28
|
+
placeholder: string;
|
|
29
|
+
options: ({
|
|
30
|
+
value: string;
|
|
31
|
+
label: string;
|
|
32
|
+
disabled?: undefined;
|
|
33
|
+
} | {
|
|
34
|
+
value: string;
|
|
35
|
+
label: string;
|
|
36
|
+
disabled: true;
|
|
37
|
+
})[];
|
|
38
|
+
input: {
|
|
39
|
+
value: string;
|
|
14
40
|
};
|
|
15
41
|
};
|
|
16
42
|
};
|
|
43
|
+
export default meta;
|
|
44
|
+
type Story = StoryObj<typeof Select>;
|
|
45
|
+
/**
|
|
46
|
+
* Select 组件提供了三种尺寸:
|
|
47
|
+
* - large: 适用于表单中的主要选择器
|
|
48
|
+
* - middle: 默认尺寸,适用于大多数场景
|
|
49
|
+
* - small: 适用于表格等紧凑型界面
|
|
50
|
+
*/
|
|
51
|
+
export declare const Basic: Story;
|
|
52
|
+
/**
|
|
53
|
+
* Select 组件支持在选项中添加前缀和后缀图标:
|
|
54
|
+
* - prefix: 在选项文本前显示图标,常用于表示状态或类型
|
|
55
|
+
* - suffix: 在选项文本后显示图标,常用于显示额外信息
|
|
56
|
+
*/
|
|
57
|
+
export declare const WithIcons: Story;
|
|
58
|
+
/**
|
|
59
|
+
* 多选模式下可以选择多个选项,选中的选项会以 Tag 的形式展示。
|
|
60
|
+
* 支持以下特性:
|
|
61
|
+
* - 可以通过点击 Tag 的关闭按钮删除已选项
|
|
62
|
+
* - 可以通过键盘删除键(Backspace)删除最后一个已选项
|
|
63
|
+
* - 支持通过搜索快速定位选项
|
|
64
|
+
*/
|
|
65
|
+
export declare const Multiple: Story;
|
|
66
|
+
/**
|
|
67
|
+
* Select 组件提供了两种加载状态:
|
|
68
|
+
* 1. loading: 原生的加载中
|
|
69
|
+
* 2. isLoadingValue: value 在加载,select 不能点击
|
|
70
|
+
*/
|
|
71
|
+
export declare const Loading: Story;
|
|
72
|
+
/**
|
|
73
|
+
* 可搜索模式下,用户可以输入关键字过滤选项。
|
|
74
|
+
* 可以通过 filterOption 属性自定义搜索逻辑。
|
|
75
|
+
*/
|
|
76
|
+
export declare const SearchSelect: Story;
|
|
77
|
+
/**
|
|
78
|
+
* Select 支持自定义触发器,可以替换默认的下拉箭头图标。
|
|
79
|
+
* 常见用法是使用自定义图标来表达特定的筛选含义。
|
|
80
|
+
*/
|
|
81
|
+
export declare const CustomTrigger: Story;
|
|
82
|
+
/**
|
|
83
|
+
* 错误状态有两种实现方式:
|
|
84
|
+
* 1. 使用 className="select-error" 添加错误样式
|
|
85
|
+
* 2. 使用 danger 属性(推荐)
|
|
86
|
+
*/
|
|
87
|
+
export declare const Error: Story;
|
|
88
|
+
/**
|
|
89
|
+
* 禁用状态下,选择器不可点击,显示为灰色。
|
|
90
|
+
*/
|
|
91
|
+
export declare const Disabled: Story;
|
|
92
|
+
/**
|
|
93
|
+
* Select 组件可以通过特定的样式类实现组合效果:
|
|
94
|
+
* - LeftEndSelectStyle: 左侧圆角
|
|
95
|
+
* - RightEndSelectStyle: 右侧圆角
|
|
96
|
+
*/
|
|
97
|
+
export declare const Combined: Story;
|
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
import { StatusCapsuleColor, StatusCapsuleComponentType } from "../../../src/core/StatusCapsule/statusCapsule.type";
|
|
2
2
|
import { Meta, StoryObj } from "@storybook/react";
|
|
3
|
+
/**
|
|
4
|
+
* 状态胶囊,用于展示状态。
|
|
5
|
+
*
|
|
6
|
+
* 根据使用场景,可选:
|
|
7
|
+
*
|
|
8
|
+
* - 是否带计数
|
|
9
|
+
* - 背景色是否突出:Colorful 较突出、Off-White 较不突出
|
|
10
|
+
*/
|
|
3
11
|
declare const story: Meta<StatusCapsuleComponentType>;
|
|
4
12
|
export declare const Basic: StoryObj<StatusCapsuleComponentType>;
|
|
5
13
|
export declare const Default: StoryObj<{
|
|
@@ -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;
|
|
@@ -15,6 +15,9 @@ declare const meta: {
|
|
|
15
15
|
maxCount: {
|
|
16
16
|
name: "boolean";
|
|
17
17
|
};
|
|
18
|
+
top: {
|
|
19
|
+
name: "number";
|
|
20
|
+
};
|
|
18
21
|
};
|
|
19
22
|
};
|
|
20
23
|
description: string;
|
|
@@ -27,4 +30,5 @@ export declare const BasicInfo: Story;
|
|
|
27
30
|
export declare const BasicWarning: Story;
|
|
28
31
|
export declare const BasicError: Story;
|
|
29
32
|
export declare const MaxCount: Story;
|
|
33
|
+
export declare const CustomTopPosition: Story;
|
|
30
34
|
export declare const BatchMessage: Story;
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { type StoryObj } from "@storybook/react";
|
|
2
|
+
import { CheckPointList } from "../../../src/coreX/CheckPointList";
|
|
3
|
+
import React from "react";
|
|
4
|
+
/**
|
|
5
|
+
* CheckPointList 组件
|
|
6
|
+
* 用于展示检查点列表,支持通过切换开关筛选未通过的检查项
|
|
7
|
+
* 适用于各种预检查、健康检查等场景
|
|
8
|
+
*
|
|
9
|
+
* 组件特点:
|
|
10
|
+
* 1. 支持四种状态展示:成功、失败、加载中、警告
|
|
11
|
+
* 2. 可自定义标签样式
|
|
12
|
+
* 3. 可自定义告警样式
|
|
13
|
+
* 4. 支持筛选控制
|
|
14
|
+
* 5. 自定义空状态展示
|
|
15
|
+
*/
|
|
16
|
+
declare const meta: {
|
|
17
|
+
component: React.FC<import("../../../src/coreX/CheckPointList").CheckPointListProps>;
|
|
18
|
+
title: string;
|
|
19
|
+
parameters: {
|
|
20
|
+
design: {
|
|
21
|
+
type: string;
|
|
22
|
+
url: string;
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
export default meta;
|
|
27
|
+
type Story = StoryObj<typeof CheckPointList>;
|
|
28
|
+
/**
|
|
29
|
+
* 基础用法
|
|
30
|
+
* 展示检查点列表的基础用法,包含成功和失败的检查项
|
|
31
|
+
*/
|
|
32
|
+
export declare const Basic: Story;
|
|
33
|
+
/**
|
|
34
|
+
* 自定义标签和告警样式
|
|
35
|
+
* 展示如何使用自定义标签和告警样式来增强视觉效果
|
|
36
|
+
*/
|
|
37
|
+
export declare const CustomStyle: Story;
|
|
38
|
+
/**
|
|
39
|
+
* 所有状态类型
|
|
40
|
+
* 展示所有可能的状态类型:成功、失败、加载中、警告
|
|
41
|
+
*/
|
|
42
|
+
export declare const AllStatusTypes: Story;
|
|
43
|
+
/**
|
|
44
|
+
* 禁用筛选控件
|
|
45
|
+
* 展示禁用筛选控件的情况,适用于不需要筛选功能的场景
|
|
46
|
+
*/
|
|
47
|
+
export declare const DisableFilterControl: Story;
|
|
48
|
+
/**
|
|
49
|
+
* 自定义筛选开关文案
|
|
50
|
+
* 展示如何自定义筛选开关的文案
|
|
51
|
+
*/
|
|
52
|
+
export declare const CustomSwitchText: Story;
|
|
53
|
+
/**
|
|
54
|
+
* 空状态提示
|
|
55
|
+
* 展示自定义空状态提示的使用方法
|
|
56
|
+
*/
|
|
57
|
+
export declare const EmptyState: Story;
|
|
58
|
+
/**
|
|
59
|
+
* 自定义空状态渲染
|
|
60
|
+
* 展示如何使用自定义渲染函数来创建空状态
|
|
61
|
+
*/
|
|
62
|
+
export declare const CustomEmptyRender: Story;
|
|
63
|
+
/**
|
|
64
|
+
* 复杂描述内容
|
|
65
|
+
* 展示如何在描述中使用复杂的ReactNode内容
|
|
66
|
+
*/
|
|
67
|
+
export declare const ComplexDescription: Story;
|
|
@@ -3,6 +3,14 @@ import { Meta } from "@storybook/react";
|
|
|
3
3
|
import React from "react";
|
|
4
4
|
declare const meta: Meta<typeof I18nNameTag>;
|
|
5
5
|
export default meta;
|
|
6
|
+
/**
|
|
7
|
+
*
|
|
8
|
+
* 请注意,由于 I18nNameTag 存在 typo, 使用 I18nNameTag 的词条使用的 html tag index 都需要从 1 开始用起
|
|
9
|
+
*
|
|
10
|
+
* 例如: "delete_alert_group_policy_desc": "确认要删除通知聚合策略 <1>{name}</1> 吗?",
|
|
11
|
+
*
|
|
12
|
+
* slack: https://smartx1.slack.com/archives/GD3UU318A/p1700202217700279
|
|
13
|
+
*/
|
|
6
14
|
export declare const Default: {
|
|
7
15
|
name: string;
|
|
8
16
|
render: ({ name }: {
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { InfoRowList } from "../../../src/coreX";
|
|
2
|
+
import type { StoryObj } from "@storybook/react";
|
|
3
|
+
import React from "react";
|
|
4
|
+
/**
|
|
5
|
+
* InfoRowList 组件用于展示一组键值对信息,支持自定义操作按钮和加载状态。
|
|
6
|
+
* 支持普通模式(适用于设置页面)和紧凑模式(适用于详情页面)两种展示方式。
|
|
7
|
+
*/
|
|
8
|
+
declare const meta: {
|
|
9
|
+
component: React.ForwardRefExoticComponent<import("../../../src/coreX/InfoRowList/InfoRowList.type").InfoListProps & React.RefAttributes<HTMLDivElement>>;
|
|
10
|
+
title: string;
|
|
11
|
+
parameters: {
|
|
12
|
+
layout: string;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
export default meta;
|
|
16
|
+
type Story = StoryObj<typeof InfoRowList>;
|
|
17
|
+
/**
|
|
18
|
+
* 基础用法展示了最简单的信息列表展示方式,适用于设置页面
|
|
19
|
+
*/
|
|
20
|
+
export declare const Basic: Story;
|
|
21
|
+
/**
|
|
22
|
+
* 带操作按钮的用法,每行右侧可以添加自定义的操作按钮
|
|
23
|
+
*/
|
|
24
|
+
export declare const WithActions: Story;
|
|
25
|
+
/**
|
|
26
|
+
* 紧凑模式的展示方式,适用于详情页面
|
|
27
|
+
*/
|
|
28
|
+
export declare const Compact: Story;
|
|
29
|
+
/**
|
|
30
|
+
* 加载状态展示
|
|
31
|
+
*/
|
|
32
|
+
export declare const Loading: Story;
|
|
33
|
+
/**
|
|
34
|
+
* 空值和隐藏行的展示
|
|
35
|
+
*/
|
|
36
|
+
export declare const EmptyAndHidden: Story;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { StoryObj } from "@storybook/react";
|
|
3
|
+
import { Show } from "../../../src/coreX/Show";
|
|
4
|
+
/**
|
|
5
|
+
* * Show 条件渲染组件
|
|
6
|
+
* * 根据条件决定显示内容还是备用内容
|
|
7
|
+
* * 提供了一种声明式的方式来替代 JSX 中的条件渲染
|
|
8
|
+
* * 支持布尔值条件和函数条件
|
|
9
|
+
*/
|
|
10
|
+
declare const meta: {
|
|
11
|
+
component: React.FC<import("../../../src/coreX/Show/show.type").ShowProps>;
|
|
12
|
+
title: string;
|
|
13
|
+
};
|
|
14
|
+
export default meta;
|
|
15
|
+
type Story = StoryObj<typeof Show>;
|
|
16
|
+
export declare const BasicTrue: Story;
|
|
17
|
+
export declare const BasicFalse: Story;
|
|
18
|
+
export declare const FunctionCondition: Story;
|
|
19
|
+
export declare const NoFallback: Story;
|
|
20
|
+
export declare const Interactive: {
|
|
21
|
+
name: string;
|
|
22
|
+
render: () => React.JSX.Element;
|
|
23
|
+
};
|
|
24
|
+
export declare const NestedShows: {
|
|
25
|
+
name: string;
|
|
26
|
+
render: () => React.JSX.Element;
|
|
27
|
+
};
|
|
28
|
+
export declare const CombinedWithOtherComponents: {
|
|
29
|
+
name: string;
|
|
30
|
+
render: () => React.JSX.Element;
|
|
31
|
+
};
|