@cloudtower/eagle 0.34.0 → 0.34.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/dist/cjs/UIKitProvider/index.js +13 -18
- package/dist/cjs/core/Banner/banner.style.js +11 -0
- package/dist/cjs/core/Banner/index.js +32 -0
- package/dist/cjs/core/BasicCTError/BasicCTError.style.js +5 -0
- package/dist/cjs/core/BasicCTError/index.js +40 -0
- package/dist/cjs/core/ConfigProvider/index.js +8 -2
- package/dist/cjs/core/Fields/FieldsDateTimeRange/index.js +20 -3
- package/dist/cjs/core/ImmersiveDialog/index.js +188 -0
- package/dist/cjs/core/ImmersiveDialog/styles.js +31 -0
- package/dist/cjs/core/LineChart/LineChartLegend.js +7 -5
- package/dist/cjs/core/LineChart/TooltipFormatter.js +7 -6
- package/dist/cjs/core/MediumDialog/MediumDialog.js +54 -0
- package/dist/cjs/core/SmallDialog/SmallDialog.js +144 -0
- package/dist/cjs/core/SmallDialog/SmallDialog.style.js +11 -0
- package/dist/cjs/core/TableForm/AddRowButton.js +2 -2
- package/dist/cjs/core/TableForm/index.js +21 -6
- package/dist/cjs/core/Timeline/index.js +13 -7
- package/dist/cjs/core/WizardDialog/index.js +170 -0
- package/dist/cjs/core/WizardDialog/styles.js +11 -0
- package/dist/cjs/core/index.js +9 -9
- package/dist/cjs/core/message/index.js +5 -215
- package/dist/cjs/core/message/message.js +222 -0
- package/dist/cjs/core/message/useMessage.js +12 -0
- package/dist/cjs/core/message-group/index.js +2 -2
- package/dist/cjs/coreX/DateRangePicker/AbsoluteDate.js +2 -1
- package/dist/cjs/coreX/DateRangePicker/Calendar.js +78 -58
- package/dist/cjs/coreX/DateRangePicker/index.js +13 -1
- package/dist/cjs/coreX/DateRangePicker/utils.js +5 -0
- package/dist/cjs/coreX/Dialogs/DeleteDialog/DeleteDialog.js +5 -3
- package/dist/cjs/coreX/Dialogs/RejectDialog/RejectDialog.js +1 -1
- package/dist/cjs/coreX/KubeConfigModal/KubeConfigModal.style.js +29 -0
- package/dist/cjs/coreX/KubeConfigModal/index.js +102 -0
- package/dist/cjs/coreX/KubeConfigModal/utils.js +25 -0
- package/dist/cjs/hooks/useCTErrorMsg.js +25 -0
- package/dist/cjs/index.js +225 -197
- package/dist/cjs/legacy-antd.js +81 -81
- package/dist/cjs/stats1.html +1 -1
- package/dist/cjs/utils/cterror.js +64 -0
- package/dist/cjs/utils/unit.js +19 -0
- package/dist/components.css +3147 -3859
- package/dist/esm/UIKitProvider/index.js +3 -6
- package/dist/esm/core/Banner/banner.style.js +6 -0
- package/dist/esm/core/Banner/index.js +25 -0
- package/dist/esm/core/BasicCTError/BasicCTError.style.js +3 -0
- package/dist/esm/core/BasicCTError/index.js +34 -0
- package/dist/esm/core/ConfigProvider/index.js +9 -4
- package/dist/esm/core/Fields/FieldsDateTimeRange/index.js +20 -3
- package/dist/esm/core/ImmersiveDialog/index.js +182 -0
- package/dist/esm/core/ImmersiveDialog/styles.js +16 -0
- package/dist/esm/core/LineChart/LineChartLegend.js +4 -2
- package/dist/esm/core/LineChart/TooltipFormatter.js +7 -6
- package/dist/esm/core/MediumDialog/MediumDialog.js +48 -0
- package/dist/esm/core/SmallDialog/SmallDialog.js +137 -0
- package/dist/esm/core/SmallDialog/SmallDialog.style.js +6 -0
- package/dist/esm/core/TableForm/AddRowButton.js +2 -2
- package/dist/esm/core/TableForm/index.js +21 -6
- package/dist/esm/core/Timeline/index.js +13 -7
- package/dist/esm/core/WizardDialog/index.js +164 -0
- package/dist/esm/core/WizardDialog/styles.js +6 -0
- package/dist/esm/core/message/index.js +4 -184
- package/dist/esm/core/message/message.js +186 -0
- package/dist/esm/core/message/useMessage.js +9 -0
- package/dist/esm/core/message-group/index.js +1 -1
- package/dist/esm/coreX/DateRangePicker/AbsoluteDate.js +2 -1
- package/dist/esm/coreX/DateRangePicker/Calendar.js +79 -59
- package/dist/esm/coreX/DateRangePicker/index.js +13 -1
- package/dist/esm/coreX/DateRangePicker/utils.js +3 -0
- package/dist/esm/coreX/Dialogs/DeleteDialog/DeleteDialog.js +5 -3
- package/dist/esm/coreX/Dialogs/RejectDialog/RejectDialog.js +1 -1
- package/dist/esm/coreX/KubeConfigModal/KubeConfigModal.style.js +20 -0
- package/dist/esm/coreX/KubeConfigModal/index.js +96 -0
- package/dist/esm/coreX/KubeConfigModal/utils.js +22 -0
- package/dist/esm/hooks/useCTErrorMsg.js +23 -0
- package/dist/esm/index.js +14 -5
- package/dist/esm/legacy-antd.js +1 -1
- package/dist/esm/stats1.html +1 -1
- package/dist/esm/utils/cterror.js +58 -0
- package/dist/esm/utils/unit.js +17 -0
- package/dist/linaria.merged.scss +3157 -2720
- package/dist/src/UIKitProvider/index.d.ts +1 -3
- package/dist/src/core/Antd5Flex/index.d.ts +2 -0
- package/dist/src/core/Antd5Tree/Antd5Tree.d.ts +1 -0
- package/dist/src/core/Antd5Tree/Antd5Tree.type.d.ts +4 -0
- package/dist/src/core/Antd5Tree/index.d.ts +2 -0
- package/dist/src/core/Banner/banner.style.d.ts +4 -0
- package/dist/src/core/Banner/banner.types.d.ts +28 -0
- package/dist/src/core/Banner/index.d.ts +3 -0
- package/dist/src/core/BasicCTError/BasicCTError.style.d.ts +1 -0
- package/dist/src/core/BasicCTError/BasicCTError.type.d.ts +56 -0
- package/dist/src/core/BasicCTError/index.d.ts +3 -0
- package/dist/src/core/ConfigProvider/index.d.ts +6 -1
- package/dist/src/core/ImmersiveDialog/index.d.ts +3 -0
- package/dist/src/core/ImmersiveDialog/styles.d.ts +14 -0
- package/dist/src/core/ImmersiveDialog/type.d.ts +37 -0
- package/dist/src/core/Input/index.d.ts +2 -4
- package/dist/src/core/Input/input.type.d.ts +4 -0
- package/dist/src/core/LineChart/type.d.ts +1 -0
- package/dist/src/core/MediumDialog/MediumDialog.d.ts +3 -0
- package/dist/src/core/MediumDialog/index.d.ts +1 -0
- package/dist/src/core/SmallDialog/SmallDialog.d.ts +3 -0
- package/dist/src/core/SmallDialog/SmallDialog.style.d.ts +4 -0
- package/dist/src/{coreX/Dialogs/SmallDialog.d.ts → core/SmallDialog/SmallDialog.type.d.ts} +12 -4
- package/dist/src/core/SmallDialog/index.d.ts +3 -0
- package/dist/src/core/TableForm/types.d.ts +7 -2
- package/dist/src/core/Timeline/Timeline.type.d.ts +27 -7
- package/dist/src/core/Timeline/index.d.ts +5 -1
- package/dist/src/core/WizardDialog/index.d.ts +3 -0
- package/dist/src/core/WizardDialog/styles.d.ts +4 -0
- package/dist/src/core/WizardDialog/type.d.ts +31 -0
- package/dist/src/core/index.d.ts +10 -14
- package/dist/src/core/message/index.d.ts +4 -53
- package/dist/src/core/message/message.d.ts +53 -0
- package/dist/src/core/message/useMessage.d.ts +4 -0
- package/dist/src/coreX/DateRangePicker/__tests__/utils.test.d.ts +1 -0
- package/dist/src/coreX/DateRangePicker/dateRangePicker.type.d.ts +10 -2
- package/dist/src/coreX/DateRangePicker/utils.d.ts +7 -0
- package/dist/src/coreX/Dialogs/DeleteDialog/DeleteDialog.type.d.ts +2 -0
- package/dist/src/coreX/Dialogs/index.d.ts +0 -1
- package/dist/src/coreX/KubeConfigModal/KubeConfigModal.style.d.ts +9 -0
- package/dist/src/coreX/KubeConfigModal/KubeConfigModal.type.d.ts +21 -0
- package/dist/src/coreX/KubeConfigModal/index.d.ts +4 -0
- package/dist/src/coreX/KubeConfigModal/utils.d.ts +2 -0
- package/dist/src/coreX/index.d.ts +2 -0
- package/dist/src/hooks/__tests__/useCTErrorMsg.test.d.ts +1 -0
- package/dist/src/hooks/index.d.ts +1 -0
- package/dist/src/hooks/useCTErrorMsg.d.ts +7 -0
- package/dist/src/utils/__test__/cterror.test.d.ts +1 -0
- package/dist/src/utils/__test__/unit.spec.d.ts +1 -0
- package/dist/src/utils/cterror.d.ts +29 -0
- package/dist/src/utils/index.d.ts +1 -0
- package/dist/src/utils/type.d.ts +32 -0
- package/dist/src/utils/unit.d.ts +14 -0
- package/dist/stories/docs/core/Antd5Tree.stories.d.ts +44 -0
- package/dist/stories/docs/core/Banner.stories.d.ts +53 -0
- package/dist/stories/docs/core/BasicCTError.stories.d.ts +47 -0
- package/dist/stories/docs/core/FieldsDateTimeRange.stories.d.ts +1 -0
- package/dist/stories/docs/core/ImmersiveDialog.stories.d.ts +96 -0
- package/dist/stories/docs/core/Input.simple.stories.d.ts +1 -3
- package/dist/stories/docs/core/LineChart.stories.d.ts +1 -0
- package/dist/stories/docs/core/MediumDialog.stories.d.ts +35 -0
- package/dist/stories/docs/core/Modal.stories.d.ts +0 -2
- package/dist/stories/docs/core/SmallDialog.stories.d.ts +37 -0
- package/dist/stories/docs/core/Timeline.stories.d.ts +4 -1
- package/dist/stories/docs/core/WizardDialog.stories.d.ts +109 -0
- package/dist/stories/docs/coreX/DateRangePicker.stories.d.ts +1 -0
- package/dist/stories/docs/coreX/Dialogs/DeleteDialog.stories.d.ts +5 -0
- package/dist/stories/docs/coreX/KubeConfigModal.stories.d.ts +83 -0
- package/dist/style.css +2867 -2469
- package/package.json +8 -7
- package/dist/cjs/coreX/Dialogs/SmallDialog.js +0 -86
- package/dist/esm/coreX/Dialogs/SmallDialog.js +0 -80
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
type NoticeType = "info" | "success" | "error" | "warning" | "loading";
|
|
3
|
+
export declare const DEFAULT_DURATION = 3;
|
|
4
|
+
export declare function getKeyThenIncreaseKey(): number;
|
|
5
|
+
export interface ConfigOptions {
|
|
6
|
+
top?: number;
|
|
7
|
+
duration?: number;
|
|
8
|
+
prefixCls?: string;
|
|
9
|
+
getContainer?: () => HTMLElement;
|
|
10
|
+
transitionName?: string;
|
|
11
|
+
maxCount?: number;
|
|
12
|
+
rtl?: boolean;
|
|
13
|
+
}
|
|
14
|
+
export interface ThenableArgument {
|
|
15
|
+
(val: any): void;
|
|
16
|
+
}
|
|
17
|
+
export interface MessageType {
|
|
18
|
+
(): void;
|
|
19
|
+
then: (fill: ThenableArgument, reject: ThenableArgument) => Promise<void>;
|
|
20
|
+
promise: Promise<void>;
|
|
21
|
+
}
|
|
22
|
+
export interface ArgsProps {
|
|
23
|
+
content: React.ReactNode;
|
|
24
|
+
duration: number | null;
|
|
25
|
+
type?: NoticeType;
|
|
26
|
+
prefixCls?: string;
|
|
27
|
+
onClose?: () => void;
|
|
28
|
+
icon?: React.ReactNode;
|
|
29
|
+
key?: string | number;
|
|
30
|
+
style?: React.CSSProperties;
|
|
31
|
+
className?: string;
|
|
32
|
+
}
|
|
33
|
+
type ConfigContent = React.ReactNode | string;
|
|
34
|
+
type ConfigDuration = number | (() => void);
|
|
35
|
+
type JointContent = ConfigContent | ArgsProps;
|
|
36
|
+
export type ConfigOnClose = () => void;
|
|
37
|
+
export declare function attachTypeApi(originalApi: any, type: string): void;
|
|
38
|
+
export interface MessageInstance {
|
|
39
|
+
info(content: JointContent, duration?: ConfigDuration, onClose?: ConfigOnClose): MessageType;
|
|
40
|
+
success(content: JointContent, duration?: ConfigDuration, onClose?: ConfigOnClose): MessageType;
|
|
41
|
+
error(content: JointContent, duration?: ConfigDuration, onClose?: ConfigOnClose): MessageType;
|
|
42
|
+
warning(content: JointContent, duration?: ConfigDuration, onClose?: ConfigOnClose): MessageType;
|
|
43
|
+
loading(content: JointContent, duration?: ConfigDuration, onClose?: ConfigOnClose): MessageType;
|
|
44
|
+
open(args: ArgsProps): MessageType;
|
|
45
|
+
}
|
|
46
|
+
export interface MessageApi extends MessageInstance {
|
|
47
|
+
warn(content: JointContent, duration?: ConfigDuration, onClose?: ConfigOnClose): MessageType;
|
|
48
|
+
config(options: ConfigOptions): void;
|
|
49
|
+
destroy(): void;
|
|
50
|
+
useMessage(): [MessageInstance, React.ReactElement];
|
|
51
|
+
}
|
|
52
|
+
declare const _default: MessageApi;
|
|
53
|
+
export default _default;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -11,6 +11,7 @@ export type CalendarProps = {
|
|
|
11
11
|
range?: PickerDateRange;
|
|
12
12
|
minDate?: string | Dayjs | undefined;
|
|
13
13
|
maxDate?: string | Dayjs | undefined;
|
|
14
|
+
maxRange?: string;
|
|
14
15
|
onChange?: (range: PickerDateRange) => void;
|
|
15
16
|
};
|
|
16
17
|
export type InputTimeProps = {
|
|
@@ -25,6 +26,7 @@ export type AbsoluteTimeProps = {
|
|
|
25
26
|
range: PickerDateRange;
|
|
26
27
|
minDate?: string | Dayjs | undefined;
|
|
27
28
|
maxDate?: string | Dayjs | undefined;
|
|
29
|
+
maxRange?: string;
|
|
28
30
|
onChange: (range: PickerDateRange) => void;
|
|
29
31
|
onOk: (range: PickerDateRange) => void;
|
|
30
32
|
};
|
|
@@ -55,11 +57,17 @@ export type DateRangePickerProps = {
|
|
|
55
57
|
mode?: ("relative" | "absolute")[] | "relative" | "absolute" | undefined;
|
|
56
58
|
minDate?: string | Dayjs | undefined;
|
|
57
59
|
maxDate?: string | Dayjs | undefined;
|
|
60
|
+
/**
|
|
61
|
+
* The maximum range of the absolute time range selected by the user
|
|
62
|
+
* the maxRange only limit the date selection, not the time selection
|
|
63
|
+
* example: 1d, 1w, 1m, 1y
|
|
64
|
+
*/
|
|
65
|
+
maxRange?: string;
|
|
58
66
|
onChange?: (type: "relative" | "absolute", time: DateRangePickerValue, range: PickerDateRange) => void;
|
|
59
67
|
onAbsoluteTimeChange?: (range: PickerDateRange) => void;
|
|
60
68
|
/**
|
|
61
|
-
|
|
62
|
-
|
|
69
|
+
* Customize an array of relative time select options
|
|
70
|
+
*/
|
|
63
71
|
relativeTimeSelectOptions?: PastTime[];
|
|
64
72
|
};
|
|
65
73
|
export type PastTime = {
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { Dayjs } from "dayjs";
|
|
2
|
+
/**
|
|
3
|
+
* @param date - the date of the month
|
|
4
|
+
* @param weekStartOnMonday - if true, the first day of the week is monday, otherwise it is sunday
|
|
5
|
+
* @returns the first day's Date of weeks
|
|
6
|
+
*/
|
|
7
|
+
export declare const getFirstDateOfMonth: (date: Dayjs, weekStartOnMonday?: boolean) => number;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const KubeConfigModalStyle: import("@linaria/core").LinariaClassName;
|
|
3
|
+
export declare const KubeConfigWrapperStyle: import("@linaria/core").LinariaClassName;
|
|
4
|
+
export declare const KubeConfigTitleStyle: import("@linaria/core").LinariaClassName;
|
|
5
|
+
export declare const KubeConfigTipStyle: import("@linaria/core").LinariaClassName;
|
|
6
|
+
export declare const KubeConfigContentStyle: import("@linaria/core").LinariaClassName;
|
|
7
|
+
export declare const KubeConfigFooterStyle: import("@linaria/core").LinariaClassName;
|
|
8
|
+
export declare const ErrorWrapper: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
|
|
9
|
+
export declare const ErrorContentWrapper: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export interface KubeConfigModalProps {
|
|
3
|
+
/** 下载文件的名称,不包含文件扩展名,会自动添加 .yaml 后缀 */
|
|
4
|
+
downloadName: string;
|
|
5
|
+
/** 自定义描述文本,如果不提供则使用默认的下载提示文案 */
|
|
6
|
+
customDesc?: string;
|
|
7
|
+
/** 是否显示加载状态,当为 true 时会显示 Loading 组件 */
|
|
8
|
+
loading?: boolean;
|
|
9
|
+
/** kubeconfig 配置数据内容,通常是 YAML 格式的字符串 */
|
|
10
|
+
data: string;
|
|
11
|
+
/** 错误信息,当有错误时会禁用下载按钮 */
|
|
12
|
+
error?: string;
|
|
13
|
+
/** 重新获取数据的回调函数,用于刷新 kubeconfig 内容 */
|
|
14
|
+
refetch?: () => void;
|
|
15
|
+
}
|
|
16
|
+
export type ErrorContentProps = {
|
|
17
|
+
className?: string;
|
|
18
|
+
style?: React.CSSProperties;
|
|
19
|
+
errorText?: string;
|
|
20
|
+
refetch?: () => void;
|
|
21
|
+
};
|
|
@@ -24,6 +24,7 @@ export * from "./SummaryTable";
|
|
|
24
24
|
export * from "./SwitchWithText";
|
|
25
25
|
export * from "./TabMenu";
|
|
26
26
|
export * from "./UnitWithChart";
|
|
27
|
+
export * from "./KubeConfigModal";
|
|
27
28
|
export { default as BarChart } from "./BarChart";
|
|
28
29
|
export { default as BatchOperation } from "./BatchOperation";
|
|
29
30
|
export { default as ChartWithTooltip } from "./ChartWithTooltip";
|
|
@@ -45,3 +46,4 @@ export { default as SummaryTable } from "./SummaryTable";
|
|
|
45
46
|
export { default as SwitchWithText } from "./SwitchWithText";
|
|
46
47
|
export { default as TabMenu } from "./TabMenu";
|
|
47
48
|
export { default as UnitWithChart } from "./UnitWithChart";
|
|
49
|
+
export { default as KubeConfigModal } from "./KubeConfigModal";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { CTError } from "../utils/cterror";
|
|
2
|
+
import { TOptions } from "i18next";
|
|
3
|
+
export type UseCTErrorMsgOptions = {
|
|
4
|
+
CTErrorI18nNs?: string;
|
|
5
|
+
tOptions?: TOptions;
|
|
6
|
+
};
|
|
7
|
+
export declare const useCTErrorMsg: (error: CTError, options?: UseCTErrorMsgOptions) => (string | undefined)[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { CTErrorType as CloudTowerErrorResponse } from "../utils/type";
|
|
2
|
+
import { AxiosError } from "axios";
|
|
3
|
+
type ParsedCTErrorItem = {
|
|
4
|
+
code?: string | number;
|
|
5
|
+
params?: CloudTowerErrorResponse["params"];
|
|
6
|
+
message?: string;
|
|
7
|
+
} | {
|
|
8
|
+
message: string;
|
|
9
|
+
};
|
|
10
|
+
type ParsedCTError = ParsedCTErrorItem[];
|
|
11
|
+
export type CTError = AxiosError<CloudTowerErrorResponse> | CloudTowerErrorResponse;
|
|
12
|
+
export declare const isResponseCTError: (error: unknown) => error is CloudTowerErrorResponse;
|
|
13
|
+
/**
|
|
14
|
+
* 处理响应错误
|
|
15
|
+
*/
|
|
16
|
+
export declare const handleResponseCTError: (error: CloudTowerErrorResponse) => ParsedCTError;
|
|
17
|
+
type AxiosCTError = AxiosError<CloudTowerErrorResponse>;
|
|
18
|
+
export declare const isAxiosCTError: (error: unknown) => error is AxiosCTError;
|
|
19
|
+
/**
|
|
20
|
+
* 处理 Axios 错误
|
|
21
|
+
*/
|
|
22
|
+
export declare const handleAxiosCTError: (error: AxiosCTError) => ParsedCTError;
|
|
23
|
+
/**
|
|
24
|
+
* 统一错误处理函数
|
|
25
|
+
* @param error - 各种类型的错误对象
|
|
26
|
+
* @returns 解析后的错误信息,包含 code 或 message
|
|
27
|
+
*/
|
|
28
|
+
export declare const parseCTError: (error: CTError) => ParsedCTError;
|
|
29
|
+
export {};
|
package/dist/src/utils/type.d.ts
CHANGED
|
@@ -1 +1,33 @@
|
|
|
1
1
|
export type { SizeType as Antd5SizeType } from "antd5/lib/config-provider/SizeContext";
|
|
2
|
+
export type CTErrorType = {
|
|
3
|
+
code?: string | number;
|
|
4
|
+
/**
|
|
5
|
+
* @type array | undefined
|
|
6
|
+
*/
|
|
7
|
+
details?: {
|
|
8
|
+
/**
|
|
9
|
+
* @type string | undefined
|
|
10
|
+
*/
|
|
11
|
+
message?: string;
|
|
12
|
+
/**
|
|
13
|
+
* @type object | undefined
|
|
14
|
+
*/
|
|
15
|
+
params?: {
|
|
16
|
+
[key: string]: any;
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* @type string | number | undefined
|
|
20
|
+
*/
|
|
21
|
+
reason?: string | number;
|
|
22
|
+
}[];
|
|
23
|
+
/**
|
|
24
|
+
* @type string
|
|
25
|
+
*/
|
|
26
|
+
message?: string;
|
|
27
|
+
/**
|
|
28
|
+
* @type object | undefined
|
|
29
|
+
*/
|
|
30
|
+
params?: {
|
|
31
|
+
[key: string]: any;
|
|
32
|
+
};
|
|
33
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 解析字符串中的数字和单位
|
|
3
|
+
* @param str 要解析的字符串
|
|
4
|
+
* @returns 包含数字和单位的对象,如果解析失败返回 null
|
|
5
|
+
* @example
|
|
6
|
+
* parseNumberAndUnit("123px") // { number: 123, unit: "px" }
|
|
7
|
+
* parseNumberAndUnit("45.67%") // { number: 45.67, unit: "%" }
|
|
8
|
+
* parseNumberAndUnit("100") // { number: 100, unit: "" }
|
|
9
|
+
* parseNumberAndUnit("abc") // null
|
|
10
|
+
*/
|
|
11
|
+
export declare function parseNumberAndUnit(str: string): {
|
|
12
|
+
number: number;
|
|
13
|
+
unit: string;
|
|
14
|
+
} | null;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { Antd5Tree } from "../../../src/core";
|
|
2
|
+
import type { StoryObj } from "@storybook/react";
|
|
3
|
+
import React from "react";
|
|
4
|
+
/**
|
|
5
|
+
* * Antd5Tree 组件
|
|
6
|
+
* * 基于 antd5 的 Tree 组件封装
|
|
7
|
+
* * 支持树形结构的展示、选择、展开等功能
|
|
8
|
+
* * 更多 props 请参考:https://ant.design/components/tree-cn#API
|
|
9
|
+
*/
|
|
10
|
+
declare const meta: {
|
|
11
|
+
component: (<T extends import("rc-tree").BasicDataNode | import("antd5").TreeDataNode = import("antd5").TreeDataNode>(props: import("antd5").TreeProps<T> & {
|
|
12
|
+
children?: React.ReactNode;
|
|
13
|
+
} & React.RefAttributes<import("rc-tree/lib/Tree").default<import("antd5").TreeDataNode>>) => React.ReactElement<any, string | React.JSXElementConstructor<any>>) & {
|
|
14
|
+
TreeNode: React.FC<import("rc-tree").TreeNodeProps<import("antd5").TreeDataNode>>;
|
|
15
|
+
DirectoryTree: (<T_1 extends import("rc-tree").BasicDataNode | import("antd5").TreeDataNode = import("antd5").TreeDataNode>(props: import("antd5/es/tree").DirectoryTreeProps<T_1> & {
|
|
16
|
+
children?: React.ReactNode;
|
|
17
|
+
} & React.RefAttributes<import("rc-tree/lib/Tree").default<import("antd5").TreeDataNode>>) => React.ReactElement<any, string | React.JSXElementConstructor<any>>) & Pick<React.FC<{}>, "displayName">;
|
|
18
|
+
};
|
|
19
|
+
title: "Core/Antd5Tree | 树形控件";
|
|
20
|
+
parameters: {
|
|
21
|
+
design: {
|
|
22
|
+
type: string;
|
|
23
|
+
url: string;
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
export default meta;
|
|
28
|
+
type Story = StoryObj<typeof Antd5Tree>;
|
|
29
|
+
/**
|
|
30
|
+
* 基础用法
|
|
31
|
+
*/
|
|
32
|
+
export declare const Basic: Story;
|
|
33
|
+
/**
|
|
34
|
+
* 可选择节点
|
|
35
|
+
*/
|
|
36
|
+
export declare const Checkable: Story;
|
|
37
|
+
/**
|
|
38
|
+
* 默认展开部分节点
|
|
39
|
+
*/
|
|
40
|
+
export declare const DefaultExpanded: Story;
|
|
41
|
+
/**
|
|
42
|
+
* 使用 TreeNode 组件手动构建树
|
|
43
|
+
*/
|
|
44
|
+
export declare const TreeNodeUsage: Story;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { StoryObj } from "@storybook/react";
|
|
3
|
+
import { Banner } from "../../../src/core/Banner";
|
|
4
|
+
/**
|
|
5
|
+
* * Banner 组件
|
|
6
|
+
* * 用于在页面顶部显示重要的系统通知或警告信息
|
|
7
|
+
* * 支持三种不同类型:错误(error)、信息(info)和警告(warning)
|
|
8
|
+
* * 可配置按钮文本和点击事件
|
|
9
|
+
*/
|
|
10
|
+
declare const meta: {
|
|
11
|
+
title: string;
|
|
12
|
+
component: React.FC<import("../../../src/core/Banner/banner.types").BannerProps>;
|
|
13
|
+
parameters: {
|
|
14
|
+
docs: {
|
|
15
|
+
description: {
|
|
16
|
+
component: string;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
tags: string[];
|
|
21
|
+
};
|
|
22
|
+
export default meta;
|
|
23
|
+
type Story = StoryObj<typeof Banner>;
|
|
24
|
+
/**
|
|
25
|
+
* 错误类型横幅
|
|
26
|
+
* 用于显示系统错误、严重问题或操作失败等紧急信息
|
|
27
|
+
*/
|
|
28
|
+
export declare const Error: Story;
|
|
29
|
+
/**
|
|
30
|
+
* 信息类型横幅
|
|
31
|
+
* 用于显示一般性的系统通知或提示信息
|
|
32
|
+
*/
|
|
33
|
+
export declare const Info: Story;
|
|
34
|
+
/**
|
|
35
|
+
* 警告类型横幅
|
|
36
|
+
* 用于显示需要用户注意的警告信息
|
|
37
|
+
*/
|
|
38
|
+
export declare const Warning: Story;
|
|
39
|
+
/**
|
|
40
|
+
* 无按钮横幅
|
|
41
|
+
* 展示不带操作按钮的纯通知横幅
|
|
42
|
+
*/
|
|
43
|
+
export declare const WithoutButton: Story;
|
|
44
|
+
/**
|
|
45
|
+
* 长文本横幅
|
|
46
|
+
* 展示包含较长文本内容的横幅
|
|
47
|
+
*/
|
|
48
|
+
export declare const LongMessage: Story;
|
|
49
|
+
/**
|
|
50
|
+
* 自定义样式
|
|
51
|
+
* 展示如何为Banner添加自定义样式
|
|
52
|
+
*/
|
|
53
|
+
export declare const CustomStyle: Story;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import { BasicCTError } from "../../../src/core/BasicCTError";
|
|
3
|
+
/**
|
|
4
|
+
* BasicCTError 用于接受 cloudtower 通用错误并解析
|
|
5
|
+
*
|
|
6
|
+
* - 支持多种错误格式(Axios 错误、服务端响应错误等)
|
|
7
|
+
* - 内置 i18n 支持
|
|
8
|
+
* - 支持自定义容器和详情渲染器
|
|
9
|
+
*/
|
|
10
|
+
declare const meta: Meta<typeof BasicCTError>;
|
|
11
|
+
export default meta;
|
|
12
|
+
type Story = StoryObj<typeof BasicCTError>;
|
|
13
|
+
/**
|
|
14
|
+
* 基本用法 - 显示简单的错误消息
|
|
15
|
+
*
|
|
16
|
+
* 传入一个简单的 Error 对象,组件会自动提取并显示错误消息。
|
|
17
|
+
*/
|
|
18
|
+
export declare const Basic: Story;
|
|
19
|
+
/**
|
|
20
|
+
* 显示来自服务端的结构化错误,传入一个包含错误代码和消息的服务端响应错误对象,组件会自动提取并显示错误消息。
|
|
21
|
+
*/
|
|
22
|
+
export declare const ServerError: Story;
|
|
23
|
+
/**
|
|
24
|
+
* 多条错误 - 显示包含多个错误详情的错误
|
|
25
|
+
*/
|
|
26
|
+
export declare const MultipleErrors: Story;
|
|
27
|
+
/**
|
|
28
|
+
* Axios 请求错误
|
|
29
|
+
*/
|
|
30
|
+
export declare const NetworkError: Story;
|
|
31
|
+
/**
|
|
32
|
+
* 自定义容器渲染器
|
|
33
|
+
*/
|
|
34
|
+
export declare const CustomContainer: Story;
|
|
35
|
+
/**
|
|
36
|
+
* 自定义错误详情渲染器
|
|
37
|
+
*/
|
|
38
|
+
export declare const CustomErrorDetail: Story;
|
|
39
|
+
/**
|
|
40
|
+
* 空错误处理
|
|
41
|
+
* 当传入 null 或 undefined 时,组件会自动处理并显示默认信息。
|
|
42
|
+
*/
|
|
43
|
+
export declare const EmptyError: Story;
|
|
44
|
+
/**
|
|
45
|
+
* 可以通过 ConfigProvider 配置 i18n 命名空间和组件 options 配置 i18n 的命名空间。 优先使用组件 options 配置的命名空间。都不配置时,默认使用 CTError 命名空间。
|
|
46
|
+
*/
|
|
47
|
+
export declare const Intl: Story;
|
|
@@ -3,3 +3,4 @@ import { StoryObj } from "@storybook/react";
|
|
|
3
3
|
declare const _default: import("@storybook/types").ComponentAnnotations<import("@storybook/react/dist/types-0fc72a6d").R, import("@storybook/types").Args>;
|
|
4
4
|
export default _default;
|
|
5
5
|
export declare const Simple: StoryObj<typeof FieldsDateTimeRange>;
|
|
6
|
+
export declare const With48HourLimit: StoryObj<typeof FieldsDateTimeRange>;
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { ImmersiveDialog } from "../../../src/core/ImmersiveDialog";
|
|
2
|
+
import React from "react";
|
|
3
|
+
export declare const CenterImmersiveDialog: () => React.JSX.Element;
|
|
4
|
+
export declare const FullContentImmersiveDialog: () => React.JSX.Element;
|
|
5
|
+
export declare const ScrollableImmersiveDialog: () => React.JSX.Element;
|
|
6
|
+
declare const story: {
|
|
7
|
+
title: "Core/ImmersiveDialog | 全屏弹窗";
|
|
8
|
+
component: typeof ImmersiveDialog;
|
|
9
|
+
decorators: ((Story: import("@storybook/types").PartialStoryFn<import("@storybook/react/dist/types-0fc72a6d").R, {
|
|
10
|
+
visible?: boolean | undefined;
|
|
11
|
+
confirmLoading?: boolean | undefined;
|
|
12
|
+
title?: React.ReactNode;
|
|
13
|
+
closable?: boolean | undefined;
|
|
14
|
+
onOk?: (((e: React.MouseEvent<HTMLElement, MouseEvent>) => void) & ((e: React.MouseEvent<HTMLElement, MouseEvent>) => void)) | undefined;
|
|
15
|
+
onCancel?: ((e: React.MouseEvent<HTMLElement, MouseEvent>) => void) | undefined;
|
|
16
|
+
afterClose?: (() => void) | undefined;
|
|
17
|
+
centered?: boolean | undefined;
|
|
18
|
+
width?: string | number | undefined;
|
|
19
|
+
footer?: React.ReactNode;
|
|
20
|
+
okText?: ((boolean | React.ReactChild | React.ReactFragment | React.ReactPortal | null) & string) | undefined;
|
|
21
|
+
okType?: import("antd/lib/button/button").LegacyButtonType | undefined;
|
|
22
|
+
cancelText?: ((boolean | React.ReactChild | React.ReactFragment | React.ReactPortal | null) & string) | undefined;
|
|
23
|
+
maskClosable?: boolean | undefined;
|
|
24
|
+
forceRender?: boolean | undefined;
|
|
25
|
+
okButtonProps?: (Partial<{
|
|
26
|
+
href: string;
|
|
27
|
+
target?: string | undefined;
|
|
28
|
+
onClick?: React.MouseEventHandler<HTMLElement> | undefined;
|
|
29
|
+
} & import("antd/lib/button/button").BaseButtonProps & import("antd/lib/_util/type").Omit<React.AnchorHTMLAttributes<any>, "onClick" | "type"> & {
|
|
30
|
+
htmlType?: "button" | "reset" | "submit" | undefined;
|
|
31
|
+
onClick?: React.MouseEventHandler<HTMLElement> | undefined;
|
|
32
|
+
} & import("antd/lib/_util/type").Omit<React.ButtonHTMLAttributes<any>, "onClick" | "type">> & {
|
|
33
|
+
prefixIcon?: JSX.Element | undefined;
|
|
34
|
+
hoverPrefixIcon?: JSX.Element | undefined;
|
|
35
|
+
suffixIcon?: JSX.Element | undefined;
|
|
36
|
+
hoverSuffixIcon?: JSX.Element | undefined;
|
|
37
|
+
type?: "link" | "text" | "dashed" | "default" | "primary" | "ghost" | "secondary" | "tertiary" | "ordinary" | "ordinary-onTint" | "quiet" | undefined;
|
|
38
|
+
} & Omit<Partial<{
|
|
39
|
+
href: string;
|
|
40
|
+
target?: string | undefined;
|
|
41
|
+
onClick?: React.MouseEventHandler<HTMLElement> | undefined;
|
|
42
|
+
} & import("antd/lib/button/button").BaseButtonProps & import("antd/lib/_util/type").Omit<React.AnchorHTMLAttributes<any>, "onClick" | "type"> & {
|
|
43
|
+
htmlType?: "button" | "reset" | "submit" | undefined;
|
|
44
|
+
onClick?: React.MouseEventHandler<HTMLElement> | undefined;
|
|
45
|
+
} & import("antd/lib/_util/type").Omit<React.ButtonHTMLAttributes<any>, "onClick" | "type">>, "icon" | "type">) | undefined;
|
|
46
|
+
cancelButtonProps?: (Partial<{
|
|
47
|
+
href: string;
|
|
48
|
+
target?: string | undefined;
|
|
49
|
+
onClick?: React.MouseEventHandler<HTMLElement> | undefined;
|
|
50
|
+
} & import("antd/lib/button/button").BaseButtonProps & import("antd/lib/_util/type").Omit<React.AnchorHTMLAttributes<any>, "onClick" | "type"> & {
|
|
51
|
+
htmlType?: "button" | "reset" | "submit" | undefined;
|
|
52
|
+
onClick?: React.MouseEventHandler<HTMLElement> | undefined;
|
|
53
|
+
} & import("antd/lib/_util/type").Omit<React.ButtonHTMLAttributes<any>, "onClick" | "type">> & {
|
|
54
|
+
prefixIcon?: JSX.Element | undefined;
|
|
55
|
+
hoverPrefixIcon?: JSX.Element | undefined;
|
|
56
|
+
suffixIcon?: JSX.Element | undefined;
|
|
57
|
+
hoverSuffixIcon?: JSX.Element | undefined;
|
|
58
|
+
type?: "link" | "text" | "dashed" | "default" | "primary" | "ghost" | "secondary" | "tertiary" | "ordinary" | "ordinary-onTint" | "quiet" | undefined;
|
|
59
|
+
} & Omit<Partial<{
|
|
60
|
+
href: string;
|
|
61
|
+
target?: string | undefined;
|
|
62
|
+
onClick?: React.MouseEventHandler<HTMLElement> | undefined;
|
|
63
|
+
} & import("antd/lib/button/button").BaseButtonProps & import("antd/lib/_util/type").Omit<React.AnchorHTMLAttributes<any>, "onClick" | "type"> & {
|
|
64
|
+
htmlType?: "button" | "reset" | "submit" | undefined;
|
|
65
|
+
onClick?: React.MouseEventHandler<HTMLElement> | undefined;
|
|
66
|
+
} & import("antd/lib/_util/type").Omit<React.ButtonHTMLAttributes<any>, "onClick" | "type">>, "icon" | "type">) | undefined;
|
|
67
|
+
destroyOnClose?: boolean | undefined;
|
|
68
|
+
style?: React.CSSProperties | undefined;
|
|
69
|
+
wrapClassName?: string | undefined;
|
|
70
|
+
maskTransitionName?: string | undefined;
|
|
71
|
+
transitionName?: string | undefined;
|
|
72
|
+
className?: string | undefined;
|
|
73
|
+
getContainer?: string | false | HTMLElement | (() => HTMLElement) | null | undefined;
|
|
74
|
+
zIndex?: number | undefined;
|
|
75
|
+
bodyStyle?: React.CSSProperties | undefined;
|
|
76
|
+
maskStyle?: React.CSSProperties | undefined;
|
|
77
|
+
mask?: boolean | undefined;
|
|
78
|
+
keyboard?: boolean | undefined;
|
|
79
|
+
wrapProps?: any;
|
|
80
|
+
prefixCls?: string | undefined;
|
|
81
|
+
closeIcon?: React.ReactNode;
|
|
82
|
+
focusTriggerAfterClose?: boolean | undefined;
|
|
83
|
+
showCancel?: boolean | undefined;
|
|
84
|
+
showOk?: boolean | undefined;
|
|
85
|
+
okLoading?: boolean | undefined;
|
|
86
|
+
error?: React.ReactNode;
|
|
87
|
+
isContentFull?: boolean | undefined;
|
|
88
|
+
left?: React.ReactNode;
|
|
89
|
+
leftClassName?: string | undefined;
|
|
90
|
+
right?: React.ReactNode;
|
|
91
|
+
rightClassName?: string | undefined;
|
|
92
|
+
footerLeftAction?: React.ReactNode;
|
|
93
|
+
children?: React.ReactNode;
|
|
94
|
+
}>) => React.JSX.Element)[];
|
|
95
|
+
};
|
|
96
|
+
export default story;
|
|
@@ -2,9 +2,7 @@
|
|
|
2
2
|
import Input from "../../../src/core/Input";
|
|
3
3
|
import { CoreMeta } from "../../types";
|
|
4
4
|
import { StoryObj } from "@storybook/react";
|
|
5
|
-
declare const _default: CoreMeta<import("react").FC<import("
|
|
6
|
-
error?: boolean | undefined;
|
|
7
|
-
}>>;
|
|
5
|
+
declare const _default: CoreMeta<import("react").FC<import("../../../src/core/Input").InputProps>>;
|
|
8
6
|
export default _default;
|
|
9
7
|
type Story = StoryObj<typeof Input>;
|
|
10
8
|
export declare const NumberInput: Story;
|
|
@@ -14,3 +14,4 @@ export declare const EmptyWithCustomText: import("@storybook/types").AnnotatedSt
|
|
|
14
14
|
export declare const DifferentUnits: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0fc72a6d").R, import("../../../src/core").LineChartProps & React.RefAttributes<HTMLDivElement>>;
|
|
15
15
|
export declare const ZeroDataChart: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0fc72a6d").R, import("../../../src/core").LineChartProps & React.RefAttributes<HTMLDivElement>>;
|
|
16
16
|
export declare const DynamicTimeRange: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0fc72a6d").R, import("../../../src/core").LineChartProps & React.RefAttributes<HTMLDivElement>>;
|
|
17
|
+
export declare const LegendWithIconSuffix: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0fc72a6d").R, import("../../../src/core").LineChartProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { MediumDialog } from "../../../src/core";
|
|
3
|
+
import { CoreMeta } from "../../types";
|
|
4
|
+
/**
|
|
5
|
+
* MediumDialog 组件
|
|
6
|
+
*
|
|
7
|
+
* 一个中等尺寸的对话框组件,适用于需要更多内容展示空间的场景。
|
|
8
|
+
*
|
|
9
|
+
* ### 特性
|
|
10
|
+
* - 固定宽度 720px,提供更多内容展示空间
|
|
11
|
+
* - 最小高度 200px,适合展示更丰富的内容
|
|
12
|
+
* - 继承 SmallDialog 的所有功能特性
|
|
13
|
+
* - 支持自定义标题、按钮文案和样式
|
|
14
|
+
* - 支持在底部显示错误信息
|
|
15
|
+
* - 可配置是否显示确认按钮、关闭按钮等
|
|
16
|
+
* - 支持点击遮罩层关闭
|
|
17
|
+
*/
|
|
18
|
+
declare const meta: CoreMeta<typeof MediumDialog>;
|
|
19
|
+
export default meta;
|
|
20
|
+
/**
|
|
21
|
+
* 基础用法
|
|
22
|
+
*/
|
|
23
|
+
export declare const Basic: () => React.JSX.Element;
|
|
24
|
+
/**
|
|
25
|
+
* 表单配置对话框
|
|
26
|
+
*/
|
|
27
|
+
export declare const FormConfiguration: () => React.JSX.Element;
|
|
28
|
+
/**
|
|
29
|
+
* 数据展示对话框
|
|
30
|
+
*/
|
|
31
|
+
export declare const DataDisplay: () => React.JSX.Element;
|
|
32
|
+
/**
|
|
33
|
+
* 带错误信息的对话框
|
|
34
|
+
*/
|
|
35
|
+
export declare const WithError: () => React.JSX.Element;
|
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
import Button from "../../../src/core/Button";
|
|
2
1
|
import { ModalProps } from "../../../src/core/Modal";
|
|
3
2
|
import { Meta } from "@storybook/react";
|
|
4
3
|
import React from "react";
|
|
5
4
|
declare const story: Meta<ModalProps>;
|
|
6
5
|
export default story;
|
|
7
|
-
export declare const ImmersiveDialog: (args: Parameters<typeof Button>) => React.JSX.Element;
|
|
8
6
|
export declare const WithAside: {
|
|
9
7
|
(): React.JSX.Element;
|
|
10
8
|
args: {};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { SmallDialog } from "../../../src/core";
|
|
3
|
+
import { CoreMeta } from "../../types";
|
|
4
|
+
/**
|
|
5
|
+
* SmallDialog 组件
|
|
6
|
+
*
|
|
7
|
+
* 一个轻量级的小尺寸对话框组件,适用于简单的确认、提示等场景。
|
|
8
|
+
*
|
|
9
|
+
* ### 特性
|
|
10
|
+
* - 固定宽度 492px,适合移动端和桌面端使用
|
|
11
|
+
* - 支持自定义标题、按钮文案和样式
|
|
12
|
+
* - 支持在底部显示错误信息
|
|
13
|
+
* - 可配置是否显示确认按钮、关闭按钮等
|
|
14
|
+
* - 支持点击遮罩层关闭
|
|
15
|
+
*/
|
|
16
|
+
declare const meta: CoreMeta<typeof SmallDialog>;
|
|
17
|
+
export default meta;
|
|
18
|
+
/**
|
|
19
|
+
* 基础用法
|
|
20
|
+
*/
|
|
21
|
+
export declare const Basic: () => React.JSX.Element;
|
|
22
|
+
/**
|
|
23
|
+
* 确认删除对话框
|
|
24
|
+
*/
|
|
25
|
+
export declare const DeleteConfirmation: () => React.JSX.Element;
|
|
26
|
+
/**
|
|
27
|
+
* 只有取消按钮
|
|
28
|
+
*/
|
|
29
|
+
export declare const CancelOnly: () => React.JSX.Element;
|
|
30
|
+
/**
|
|
31
|
+
* 带错误信息的对话框
|
|
32
|
+
*/
|
|
33
|
+
export declare const WithError: () => React.JSX.Element;
|
|
34
|
+
/**
|
|
35
|
+
* 长内容对话框
|
|
36
|
+
*/
|
|
37
|
+
export declare const LongContent: () => React.JSX.Element;
|