@cloudtower/eagle 0.30.9 → 0.30.11
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/core/BytePerSecond/index.js +45 -0
- package/dist/cjs/core/index.js +15 -12
- package/dist/cjs/coreX/ChartWithTooltip/index.js +14 -12
- package/dist/cjs/coreX/UnitWithChart/index.js +14 -12
- package/dist/cjs/index.js +239 -237
- package/dist/cjs/legacy-antd.js +111 -109
- package/dist/cjs/stats1.html +1 -1
- package/dist/cjs/utils/tower.js +17 -0
- package/dist/components.css +2167 -2142
- package/dist/esm/core/BytePerSecond/index.js +39 -0
- package/dist/esm/core/index.js +3 -1
- package/dist/esm/coreX/ChartWithTooltip/index.js +2 -0
- package/dist/esm/coreX/UnitWithChart/index.js +2 -0
- package/dist/esm/index.js +1 -0
- package/dist/esm/legacy-antd.js +2 -0
- package/dist/esm/stats1.html +1 -1
- package/dist/esm/utils/tower.js +17 -1
- package/dist/src/core/BytePerSecond/index.d.ts +3 -0
- package/dist/src/core/Tooltip/EllipsisTooltipContent.d.ts +4 -0
- package/dist/src/core/Tooltip/index.d.ts +1 -0
- package/dist/src/core/Tooltip/tooltip.type.d.ts +22 -0
- package/dist/src/core/Tooltip/tooltip.widget.d.ts +5 -0
- package/dist/src/core/index.d.ts +3 -0
- package/dist/src/coreX/UnitWithChart/index.d.ts +1 -0
- package/dist/src/spec/base.d.ts +1 -0
- package/dist/src/utils/tower.d.ts +1 -0
- package/dist/stories/docs/core/BytePerSecond.stories.d.ts +17 -0
- package/dist/stories/docs/core/EllipsisTooltipContent.stories.d.ts +24 -0
- package/dist/style.css +2155 -2134
- package/package.json +4 -4
package/dist/esm/utils/tower.js
CHANGED
|
@@ -123,6 +123,22 @@ function formatBytes(bytes, decimals = 2) {
|
|
|
123
123
|
unit: units[i]
|
|
124
124
|
};
|
|
125
125
|
}
|
|
126
|
+
function formatBytePerSecond(bytes, decimals = 2) {
|
|
127
|
+
if (bytes <= 0 || bytes === MAGIC_METRIC_NULL) {
|
|
128
|
+
return {
|
|
129
|
+
value: 0,
|
|
130
|
+
unit: "B/s"
|
|
131
|
+
};
|
|
132
|
+
}
|
|
133
|
+
const k = 1024;
|
|
134
|
+
const units = ["B/s", "KiB/s", "MiB/s", "GiB/s", "TiB/s", "PiB/s"];
|
|
135
|
+
let i = Math.floor(Math.log(bytes) / Math.log(k));
|
|
136
|
+
i = i < 0 ? 0 : i > units.length - 1 ? units.length - 1 : i;
|
|
137
|
+
return {
|
|
138
|
+
value: parseFloat((bytes / Math.pow(k, i)).toFixed(decimals)),
|
|
139
|
+
unit: units[i]
|
|
140
|
+
};
|
|
141
|
+
}
|
|
126
142
|
function formatPercent(input, decimals = 2, saturated = true) {
|
|
127
143
|
if (input === MAGIC_METRIC_NULL) {
|
|
128
144
|
input = 0;
|
|
@@ -170,4 +186,4 @@ function formatSpeed(input, decimals = 0) {
|
|
|
170
186
|
};
|
|
171
187
|
}
|
|
172
188
|
|
|
173
|
-
export { DAY, HOUR, MAGIC_METRIC_NULL, MINUTE, SECOND, WEEK, formatBitPerSecond, formatBits, formatBps, formatBytes, formatFrequency, formatPercent, formatSeconds, formatSpeed };
|
|
189
|
+
export { DAY, HOUR, MAGIC_METRIC_NULL, MINUTE, SECOND, WEEK, formatBitPerSecond, formatBits, formatBps, formatBytePerSecond, formatBytes, formatFrequency, formatPercent, formatSeconds, formatSpeed };
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { LinariaClassName } from "@linaria/core";
|
|
1
3
|
import { TooltipProps as AntdTooltipProps } from "antd/lib/tooltip";
|
|
2
4
|
export type TooltipProps = AntdTooltipProps & {
|
|
3
5
|
/**
|
|
@@ -5,3 +7,23 @@ export type TooltipProps = AntdTooltipProps & {
|
|
|
5
7
|
*/
|
|
6
8
|
followMouse?: boolean;
|
|
7
9
|
};
|
|
10
|
+
export type EllipsisContentType = {
|
|
11
|
+
/**
|
|
12
|
+
* tooltip content 内容
|
|
13
|
+
*/
|
|
14
|
+
tooltip: React.ReactNode;
|
|
15
|
+
/**
|
|
16
|
+
* 内容区的最大高度
|
|
17
|
+
*
|
|
18
|
+
* e.g. 文本限制行数 = 行数 * line-height
|
|
19
|
+
*/
|
|
20
|
+
maxHeight?: number;
|
|
21
|
+
/**
|
|
22
|
+
* 自定义样式类名
|
|
23
|
+
*/
|
|
24
|
+
contentWrapperClassName?: LinariaClassName;
|
|
25
|
+
/**
|
|
26
|
+
* 多行溢出省略提示
|
|
27
|
+
*/
|
|
28
|
+
ellipsisTips?: string;
|
|
29
|
+
};
|
package/dist/src/core/index.d.ts
CHANGED
|
@@ -15,6 +15,7 @@ export * from "./Button";
|
|
|
15
15
|
export * from "./ButtonGroup";
|
|
16
16
|
export * from "./ButtonGroup";
|
|
17
17
|
export * from "./Byte";
|
|
18
|
+
export * from "./BytePerSecond";
|
|
18
19
|
export * from "./Calendar";
|
|
19
20
|
export * from "./Card";
|
|
20
21
|
export * from "./Cascader";
|
|
@@ -90,6 +91,7 @@ export * from "./Skeleton";
|
|
|
90
91
|
export declare const units: {
|
|
91
92
|
Percent: import("./Units").PercentFn;
|
|
92
93
|
Byte: import("./Units").UnitFn;
|
|
94
|
+
BytePerSecond: import("./Units").UnitFn;
|
|
93
95
|
Frequency: import("./Units").UnitFn;
|
|
94
96
|
Speed: import("./Units").UnitFn;
|
|
95
97
|
Bps: import("./Units").UnitFn;
|
|
@@ -112,6 +114,7 @@ export { default as Breadcrumb } from "./Breadcrumb";
|
|
|
112
114
|
export { default as Button } from "./Button";
|
|
113
115
|
export { default as ButtonGroup } from "./ButtonGroup";
|
|
114
116
|
export { default as Byte } from "./Byte";
|
|
117
|
+
export { default as BytePerSecond } from "./BytePerSecond";
|
|
115
118
|
export { default as Calendar } from "./Calendar";
|
|
116
119
|
export { default as Card } from "./Card";
|
|
117
120
|
export { default as Checkbox } from "./Checkbox";
|
package/dist/src/spec/base.d.ts
CHANGED
|
@@ -47,6 +47,7 @@ export declare const GBps: number;
|
|
|
47
47
|
export declare const TBps: number;
|
|
48
48
|
export declare function formatBps(input: number, decimals?: number): FormattedResult;
|
|
49
49
|
export declare function formatBytes(bytes: number, decimals?: number): FormattedResult;
|
|
50
|
+
export declare function formatBytePerSecond(bytes: number, decimals?: number): FormattedResult;
|
|
50
51
|
export declare function formatPercent(input: number, decimals?: number, saturated?: boolean): {
|
|
51
52
|
value: string;
|
|
52
53
|
numberValue: number;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
declare const _default: import("@storybook/types").ComponentAnnotations<import("@storybook/react/dist/types-0fc72a6d").R, import("../../../src").RawValue & {
|
|
3
|
+
emptyProps?: import("../../../src").IEmptyProps | undefined;
|
|
4
|
+
} & {
|
|
5
|
+
children?: React.ReactNode;
|
|
6
|
+
}>;
|
|
7
|
+
export default _default;
|
|
8
|
+
export declare const Simple: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0fc72a6d").R, import("../../../src").RawValue & {
|
|
9
|
+
emptyProps?: import("../../../src").IEmptyProps | undefined;
|
|
10
|
+
} & {
|
|
11
|
+
children?: React.ReactNode;
|
|
12
|
+
}>;
|
|
13
|
+
export declare const Empty: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0fc72a6d").R, import("../../../src").RawValue & {
|
|
14
|
+
emptyProps?: import("../../../src").IEmptyProps | undefined;
|
|
15
|
+
} & {
|
|
16
|
+
children?: React.ReactNode;
|
|
17
|
+
}>;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import EllipsisTooltipContent from "../../../src/core/Tooltip/EllipsisTooltipContent";
|
|
2
|
+
import { StoryObj } from "@storybook/react";
|
|
3
|
+
import React from "react";
|
|
4
|
+
/**
|
|
5
|
+
* * Tooltip content 组件
|
|
6
|
+
* * 搭配 Tooltip 与 OverflowTooltip 使用
|
|
7
|
+
* * 使用时,Tooltip 与 OverflowTooltip 需要配合 destroyTooltipOnHide 为 true 使用
|
|
8
|
+
* * 自定义 props 已在表格进行说明
|
|
9
|
+
*/
|
|
10
|
+
declare const meta: {
|
|
11
|
+
component: ({ tooltip, maxHeight, contentWrapperClassName, ellipsisTips, }: import("../../../src/core/Tooltip").EllipsisContentType) => React.JSX.Element;
|
|
12
|
+
title: "Core/EllipsisTooltipContent | Tooltip content 过长省略";
|
|
13
|
+
parameters: {
|
|
14
|
+
design: {
|
|
15
|
+
type: string;
|
|
16
|
+
url: string;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
export default meta;
|
|
21
|
+
type Story = StoryObj<typeof EllipsisTooltipContent>;
|
|
22
|
+
export declare const ellipsisTooltipsContentInTooltip: Story;
|
|
23
|
+
export declare const ellipsisTooltipsContentInOverflowTooltip: Story;
|
|
24
|
+
export declare const ellipsisTooltipsReactNodeContentInTooltip: Story;
|