@cloudtower/eagle 0.27.3-alpha.0 → 0.27.3
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/components/Metric/metric.d.ts +1 -1
- package/dist/components/index.d.ts +0 -10
- package/dist/components.css +607 -531
- package/dist/coreX/CronPlan/CronPlan.stories.d.ts +9 -0
- package/dist/coreX/CronPlan/index.d.ts +18 -0
- package/dist/coreX/NamesTooltip/NamesTooltip.stories.d.ts +7 -0
- package/dist/coreX/NamesTooltip/__test__/index.test.d.ts +1 -0
- package/dist/coreX/NamesTooltip/index.d.ts +4 -0
- package/dist/coreX/index.d.ts +1 -0
- package/dist/esm/index.js +3408 -2726
- package/dist/esm/stats1.html +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/spec/base.d.ts +21 -7
- package/dist/style.css +1294 -1218
- package/dist/umd/index.js +3413 -2731
- package/dist/umd/stats1.html +1 -1
- package/dist/utils/__test__/compute.spec.d.ts +1 -0
- package/dist/utils/__test__/cron-time.spec.d.ts +1 -0
- package/dist/utils/__test__/time.spec.d.ts +1 -0
- package/dist/utils/compute.d.ts +1 -0
- package/dist/utils/cron-time.d.ts +65 -0
- package/dist/utils/index.d.ts +3 -0
- package/dist/utils/time.d.ts +25 -0
- package/dist/utils/tower.d.ts +0 -1
- package/package.json +6 -6
- package/dist/coreX/BarChart/BarChart.stories.d.ts +0 -6
- package/dist/coreX/BarChart/index.d.ts +0 -10
- package/dist/coreX/ChartWithTooltip/ChartWithTooltip.stories.d.ts +0 -7
- package/dist/coreX/ChartWithTooltip/index.d.ts +0 -40
- package/dist/coreX/DonutChart/DonutChart.stories.d.ts +0 -6
- package/dist/coreX/DonutChart/index.d.ts +0 -12
- package/dist/coreX/UnitWithChart/UnitWithChart.stories.d.ts +0 -7
- package/dist/coreX/UnitWithChart/index.d.ts +0 -30
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function makeUUID(length?: number): string;
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import dayjs from "dayjs";
|
|
2
|
+
type PresetValidator = (args: {
|
|
3
|
+
date: dayjs.Dayjs;
|
|
4
|
+
lastSendAt: dayjs.Dayjs | null;
|
|
5
|
+
args: string[];
|
|
6
|
+
}) => boolean;
|
|
7
|
+
export declare class CronTime {
|
|
8
|
+
source: dayjs.Dayjs | string;
|
|
9
|
+
presetValidation?: PresetValidator;
|
|
10
|
+
presetArgs?: string[];
|
|
11
|
+
presetStep?: number;
|
|
12
|
+
realDate: boolean;
|
|
13
|
+
utcOffset?: number;
|
|
14
|
+
startAt?: dayjs.Dayjs;
|
|
15
|
+
unitMap: Record<string, Record<string, boolean>>;
|
|
16
|
+
lastSendAt: dayjs.Dayjs | null;
|
|
17
|
+
constructor(source: Date | string, startAt?: dayjs.Dayjs, utcOffset?: number);
|
|
18
|
+
/**
|
|
19
|
+
* Calculate the "next" scheduled time
|
|
20
|
+
*/
|
|
21
|
+
sendAt(): dayjs.Dayjs;
|
|
22
|
+
sendAt(i: number): dayjs.Dayjs[];
|
|
23
|
+
/**
|
|
24
|
+
* Get the number of milliseconds in the future at which to fire our callbacks.
|
|
25
|
+
*/
|
|
26
|
+
getTimeout(): number;
|
|
27
|
+
/**
|
|
28
|
+
* writes out a cron string
|
|
29
|
+
*/
|
|
30
|
+
toString(): string;
|
|
31
|
+
/**
|
|
32
|
+
* Json representation of the parsed cron syntax.
|
|
33
|
+
*/
|
|
34
|
+
toJSON(): string[];
|
|
35
|
+
setLastSendAt(date: dayjs.Dayjs): void;
|
|
36
|
+
private parse;
|
|
37
|
+
private parsePrestArgs;
|
|
38
|
+
private parseField;
|
|
39
|
+
private verifyParse;
|
|
40
|
+
private getNextDateFromWithValidation;
|
|
41
|
+
/**
|
|
42
|
+
* Get next date matching the specified cron time.
|
|
43
|
+
*
|
|
44
|
+
* Algorithm:
|
|
45
|
+
* - Start with a start date and a parsed crontime.
|
|
46
|
+
* - Loop until 5 seconds have passed, or we found the next date.
|
|
47
|
+
* - Within the loop:
|
|
48
|
+
* - If it took longer than 5 seconds to select a date, throw an exception.
|
|
49
|
+
* - Find the next month to run at.
|
|
50
|
+
* - Find the next day of the month to run at.
|
|
51
|
+
* - Find the next day of the week to run at.
|
|
52
|
+
* - Find the next hour to run at.
|
|
53
|
+
* - Find the next minute to run at.
|
|
54
|
+
* - Find the next second to run at.
|
|
55
|
+
* - Check that the chosen time does not equal the current execution.
|
|
56
|
+
* - Return the selected date object.
|
|
57
|
+
*/
|
|
58
|
+
private getNextDateFrom;
|
|
59
|
+
/**
|
|
60
|
+
* wildcard, or all params in array (for to string)
|
|
61
|
+
*/
|
|
62
|
+
private wcOrAll;
|
|
63
|
+
private hasAll;
|
|
64
|
+
}
|
|
65
|
+
export {};
|
package/dist/utils/index.d.ts
CHANGED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import dayjs from "dayjs";
|
|
2
|
+
import { CronTime } from "./cron-time";
|
|
3
|
+
export declare const DEFAULT_TIME: dayjs.Dayjs;
|
|
4
|
+
export declare function getTime(cronTime: CronTime, isUTC?: boolean): dayjs.Dayjs;
|
|
5
|
+
export type CronMode = "day" | "week" | "month";
|
|
6
|
+
export declare function getMode(source: string): CronMode;
|
|
7
|
+
export declare function getDaily(mode: CronMode, source: string, time: dayjs.Dayjs, defaultTime?: dayjs.Dayjs): {
|
|
8
|
+
step: number;
|
|
9
|
+
time: dayjs.Dayjs;
|
|
10
|
+
};
|
|
11
|
+
export declare function toDailyString(step: number, time: dayjs.Dayjs): string;
|
|
12
|
+
export declare function getWeekly(mode: CronMode, source: string, time: dayjs.Dayjs, defaultTime?: dayjs.Dayjs): {
|
|
13
|
+
step: number;
|
|
14
|
+
days: number[];
|
|
15
|
+
time: dayjs.Dayjs;
|
|
16
|
+
};
|
|
17
|
+
export declare function toWeeklyString(step: number, time: dayjs.Dayjs, days: number[]): string;
|
|
18
|
+
export declare function getMonthly(mode: CronMode, month: string, day: string, time: dayjs.Dayjs, defaultTime?: dayjs.Dayjs): {
|
|
19
|
+
step: number;
|
|
20
|
+
days: number[];
|
|
21
|
+
time: dayjs.Dayjs;
|
|
22
|
+
};
|
|
23
|
+
export declare function toMonthlyString(step: number, time: dayjs.Dayjs, days: number[]): string;
|
|
24
|
+
export declare function transformPeriodToLocal(period: string | undefined, start_at?: string): string;
|
|
25
|
+
export declare function transformPeriodToUTC(period: string | undefined, start_at?: string): string;
|
package/dist/utils/tower.d.ts
CHANGED
|
@@ -49,7 +49,6 @@ export declare function formatBps(input: number, decimals?: number): FormattedRe
|
|
|
49
49
|
export declare function formatBytes(bytes: number, decimals?: number): FormattedResult;
|
|
50
50
|
export declare function formatPercent(input: number, decimals?: number, saturated?: boolean): {
|
|
51
51
|
value: string;
|
|
52
|
-
numberValue: number;
|
|
53
52
|
unit: string;
|
|
54
53
|
};
|
|
55
54
|
export declare const KbE = 1000;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cloudtower/eagle",
|
|
3
|
-
"version": "0.27.3
|
|
3
|
+
"version": "0.27.3",
|
|
4
4
|
"main": "dist/umd/index.js",
|
|
5
5
|
"module": "./dist/esm/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -28,15 +28,14 @@
|
|
|
28
28
|
"build-storybook": "storybook build"
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@cloudtower/icons-react": "0.27.3
|
|
32
|
-
"@cloudtower/parrot": "0.27.3
|
|
31
|
+
"@cloudtower/icons-react": "0.27.3",
|
|
32
|
+
"@cloudtower/parrot": "0.27.3",
|
|
33
33
|
"@cloudtower/rc-notification": "^4.6.1",
|
|
34
34
|
"@linaria/core": "^4.2.2",
|
|
35
35
|
"@linaria/react": "^4.3.0",
|
|
36
36
|
"antd": "4.5.0",
|
|
37
37
|
"classnames": "^2.3.2",
|
|
38
38
|
"dayjs": "^1.11.10",
|
|
39
|
-
"lodash": "^4.17.21",
|
|
40
39
|
"react-beautiful-dnd": "^13.0.0",
|
|
41
40
|
"react-i18next": "^13.0.1",
|
|
42
41
|
"react-redux": "^7.1.3",
|
|
@@ -51,7 +50,7 @@
|
|
|
51
50
|
"@babel/preset-env": "^7.22.15",
|
|
52
51
|
"@babel/preset-react": "^7.22.15",
|
|
53
52
|
"@babel/preset-typescript": "^7.22.15",
|
|
54
|
-
"@cloudtower/icons": "0.27.3
|
|
53
|
+
"@cloudtower/icons": "0.27.3",
|
|
55
54
|
"@linaria/babel-preset": "4.4.1",
|
|
56
55
|
"@linaria/rollup": "^4.1.5",
|
|
57
56
|
"@linaria/vite": "^4.2.5",
|
|
@@ -84,6 +83,7 @@
|
|
|
84
83
|
"less": "^4.1.3",
|
|
85
84
|
"linaria": "^4.1.13",
|
|
86
85
|
"mini-css-extract-plugin": "^2.7.2",
|
|
86
|
+
"mockdate": "^3.0.5",
|
|
87
87
|
"postcss": "^8.4.20",
|
|
88
88
|
"postcss-url": "^10.1.3",
|
|
89
89
|
"react": "17.0.2",
|
|
@@ -107,5 +107,5 @@
|
|
|
107
107
|
"vite": "^3.1.7",
|
|
108
108
|
"vitest": "^0.24.1"
|
|
109
109
|
},
|
|
110
|
-
"gitHead": "
|
|
110
|
+
"gitHead": "0b58116a659f025665b7858ee4f19f43cc89930e"
|
|
111
111
|
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
-
import ChartWithTooltip from "./";
|
|
3
|
-
declare const meta: Meta<typeof ChartWithTooltip>;
|
|
4
|
-
export default meta;
|
|
5
|
-
type Story = StoryObj<typeof ChartWithTooltip>;
|
|
6
|
-
export declare const BarChart: Story;
|
|
7
|
-
export declare const DountChart: Story;
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { ChartType, IUnitWithChartProps } from "../UnitWithChart";
|
|
3
|
-
export interface ICWTProps {
|
|
4
|
-
title: {
|
|
5
|
-
label: string;
|
|
6
|
-
value?: number | null;
|
|
7
|
-
};
|
|
8
|
-
items: {
|
|
9
|
-
label: string;
|
|
10
|
-
color: string;
|
|
11
|
-
value: number;
|
|
12
|
-
saturated?: boolean;
|
|
13
|
-
}[];
|
|
14
|
-
rawValue?: number | null;
|
|
15
|
-
unit: IUnitWithChartProps["unit"];
|
|
16
|
-
chartType?: ChartType;
|
|
17
|
-
/**
|
|
18
|
-
* pass the parameter if table cell unit different with tooltip
|
|
19
|
-
*/
|
|
20
|
-
tableUnit?: IUnitWithChartProps["unit"];
|
|
21
|
-
saturated?: boolean;
|
|
22
|
-
}
|
|
23
|
-
export type IChartWithUnitProps = {
|
|
24
|
-
total: number;
|
|
25
|
-
items: {
|
|
26
|
-
label: string;
|
|
27
|
-
color: string;
|
|
28
|
-
value: number;
|
|
29
|
-
}[];
|
|
30
|
-
rawValue?: number | null;
|
|
31
|
-
unit: IUnitWithChartProps["unit"];
|
|
32
|
-
chartType?: ChartType;
|
|
33
|
-
/**
|
|
34
|
-
* pass the parameter if table cell unit different with tooltip
|
|
35
|
-
*/
|
|
36
|
-
tableUnit?: IUnitWithChartProps["unit"];
|
|
37
|
-
};
|
|
38
|
-
export declare const ChartWithUnit: React.FC<IChartWithUnitProps>;
|
|
39
|
-
declare const ChartWithTooltip: React.FunctionComponent<ICWTProps>;
|
|
40
|
-
export default ChartWithTooltip;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
export interface IDonutChartProps {
|
|
3
|
-
data: Array<object>;
|
|
4
|
-
dataKey: string;
|
|
5
|
-
width: number;
|
|
6
|
-
height: number;
|
|
7
|
-
barSize: number;
|
|
8
|
-
innerRadius: number;
|
|
9
|
-
outerRadius: number;
|
|
10
|
-
}
|
|
11
|
-
declare const DonutChart: React.FC<IDonutChartProps>;
|
|
12
|
-
export default DonutChart;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
-
import UnitWithChart from ".";
|
|
3
|
-
declare const meta: Meta<typeof UnitWithChart>;
|
|
4
|
-
export default meta;
|
|
5
|
-
type Story = StoryObj<typeof UnitWithChart>;
|
|
6
|
-
export declare const BarChart: Story;
|
|
7
|
-
export declare const DountChart: Story;
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
declare const units: {
|
|
3
|
-
Percent: import("../../spec").PercentFn;
|
|
4
|
-
Byte: import("../../spec").UnitFn;
|
|
5
|
-
Frequency: import("../../spec").UnitFn;
|
|
6
|
-
Speed: import("../../spec").UnitFn;
|
|
7
|
-
Bps: import("../../spec").UnitFn;
|
|
8
|
-
BitPerSecond: import("../../spec").UnitFn;
|
|
9
|
-
Bit: import("../../spec").UnitFn;
|
|
10
|
-
Second: import("../../spec").UnitFn;
|
|
11
|
-
};
|
|
12
|
-
type Size = "small" | "medium" | "large";
|
|
13
|
-
export type ChartType = "donutChart" | "barChart";
|
|
14
|
-
export declare const UnitWrapper: import("@linaria/core").LinariaClassName;
|
|
15
|
-
export interface IUnitWithChartProps {
|
|
16
|
-
rawValue?: number | null;
|
|
17
|
-
total?: number | null;
|
|
18
|
-
data?: {
|
|
19
|
-
label: string;
|
|
20
|
-
color: string;
|
|
21
|
-
value: number;
|
|
22
|
-
}[];
|
|
23
|
-
unit: keyof typeof units;
|
|
24
|
-
color?: string;
|
|
25
|
-
size?: Size;
|
|
26
|
-
chartType?: ChartType;
|
|
27
|
-
saturated?: boolean;
|
|
28
|
-
}
|
|
29
|
-
declare const UnitWithChart: React.FC<IUnitWithChartProps>;
|
|
30
|
-
export default UnitWithChart;
|