@cloudtower/eagle 0.31.7 → 0.31.9
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/TableForm/Columns/AffixColumn.js +1 -1
- package/dist/cjs/core/TableForm/Columns/CheckboxColumn.js +1 -1
- package/dist/cjs/core/TableForm/Columns/InputColumn.js +1 -0
- package/dist/cjs/core/TableForm/TableFormHeaderCell.js +40 -20
- package/dist/cjs/core/TableForm/index.js +4 -11
- 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 +2841 -2812
- package/dist/esm/core/BytePerSecond/index.js +39 -0
- package/dist/esm/core/TableForm/Columns/AffixColumn.js +1 -1
- package/dist/esm/core/TableForm/Columns/CheckboxColumn.js +1 -1
- package/dist/esm/core/TableForm/Columns/InputColumn.js +1 -0
- package/dist/esm/core/TableForm/TableFormHeaderCell.js +37 -17
- package/dist/esm/core/TableForm/index.js +5 -12
- 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/TableForm/types.d.ts +92 -1
- 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/stories/docs/core/TableForm.stories.d.ts +45 -13
- package/dist/style.css +2780 -2756
- package/package.json +4 -4
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { cx } from '@linaria/core';
|
|
2
|
+
import Empty from '../Empty/index.js';
|
|
3
|
+
import isEmpty from '../../utils/isEmpty.js';
|
|
4
|
+
import { formatBytePerSecond } from '../../utils/tower.js';
|
|
5
|
+
import React__default from 'react';
|
|
6
|
+
import { UnitStyle } from '../Styled/index.js';
|
|
7
|
+
|
|
8
|
+
var __defProp = Object.defineProperty;
|
|
9
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
10
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
11
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
12
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
13
|
+
var __spreadValues = (a, b) => {
|
|
14
|
+
for (var prop in b || (b = {}))
|
|
15
|
+
if (__hasOwnProp.call(b, prop))
|
|
16
|
+
__defNormalProp(a, prop, b[prop]);
|
|
17
|
+
if (__getOwnPropSymbols)
|
|
18
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
19
|
+
if (__propIsEnum.call(b, prop))
|
|
20
|
+
__defNormalProp(a, prop, b[prop]);
|
|
21
|
+
}
|
|
22
|
+
return a;
|
|
23
|
+
};
|
|
24
|
+
const BytePerSecond = ({
|
|
25
|
+
rawValue,
|
|
26
|
+
decimals,
|
|
27
|
+
valueClassName,
|
|
28
|
+
unitClassName,
|
|
29
|
+
emptyProps
|
|
30
|
+
}) => {
|
|
31
|
+
if (isEmpty(rawValue)) {
|
|
32
|
+
return /* @__PURE__ */ React__default.createElement(Empty, __spreadValues({}, emptyProps));
|
|
33
|
+
}
|
|
34
|
+
const { value, unit } = formatBytePerSecond(rawValue, decimals);
|
|
35
|
+
return /* @__PURE__ */ React__default.createElement("span", null, /* @__PURE__ */ React__default.createElement("span", { className: cx("value", valueClassName) }, value), /* @__PURE__ */ React__default.createElement("span", { className: cx("unit", UnitStyle, unitClassName) }, ` ${unit}`));
|
|
36
|
+
};
|
|
37
|
+
var BytePerSecond$1 = BytePerSecond;
|
|
38
|
+
|
|
39
|
+
export { BytePerSecond$1 as default };
|
|
@@ -22,7 +22,7 @@ const AffixColumnHeaderCell = ({ data, column, onChange, onBlur }) => {
|
|
|
22
22
|
},
|
|
23
23
|
[prefix, onChange]
|
|
24
24
|
);
|
|
25
|
-
return /* @__PURE__ */ React__default.createElement(Space,
|
|
25
|
+
return /* @__PURE__ */ React__default.createElement(Space, { style: { marginTop: "4px" } }, !column.disablePrefix ? /* @__PURE__ */ React__default.createElement(
|
|
26
26
|
Input,
|
|
27
27
|
{
|
|
28
28
|
value: prefix,
|
|
@@ -8,7 +8,7 @@ const CheckboxColumnHeaderCell = ({ onChange }) => {
|
|
|
8
8
|
},
|
|
9
9
|
[onChange]
|
|
10
10
|
);
|
|
11
|
-
return /* @__PURE__ */ React__default.createElement(Checkbox, { onChange: _onChange });
|
|
11
|
+
return /* @__PURE__ */ React__default.createElement(Checkbox, { style: { marginTop: "4px" }, onChange: _onChange });
|
|
12
12
|
};
|
|
13
13
|
const CheckboxColumnBodyCell = ({ data, column, index, onChange }) => {
|
|
14
14
|
const value = data[index][column.key] === void 0 ? column.defaultValue : data[index][column.key];
|
|
@@ -5,6 +5,7 @@ import { TitleStyle } from './style.js';
|
|
|
5
5
|
import { increaseLastNumber } from './utils.js';
|
|
6
6
|
import { Typo } from '../Typo/index.js';
|
|
7
7
|
import React__default, { useState, useCallback } from 'react';
|
|
8
|
+
import OverflowTooltip from '../../coreX/OverflowTooltip/index.js';
|
|
8
9
|
|
|
9
10
|
var __defProp = Object.defineProperty;
|
|
10
11
|
var __defProps = Object.defineProperties;
|
|
@@ -44,7 +45,7 @@ const BatchInputListHeaderCell = (props) => {
|
|
|
44
45
|
},
|
|
45
46
|
[onChange, data, column]
|
|
46
47
|
);
|
|
47
|
-
const
|
|
48
|
+
const headerOnBlur = useCallback(() => {
|
|
48
49
|
onBlur == null ? void 0 : onBlur(column.key, errMsg);
|
|
49
50
|
}, [column.key, onBlur, errMsg]);
|
|
50
51
|
const renderDefaultComponent = () => {
|
|
@@ -56,16 +57,42 @@ const BatchInputListHeaderCell = (props) => {
|
|
|
56
57
|
__spreadProps(__spreadValues({}, props), {
|
|
57
58
|
column,
|
|
58
59
|
onChange: headerOnChange,
|
|
59
|
-
onBlur:
|
|
60
|
+
onBlur: headerOnBlur
|
|
60
61
|
})
|
|
61
62
|
);
|
|
62
63
|
};
|
|
63
|
-
const
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
64
|
+
const renderTitle = () => {
|
|
65
|
+
const titleContent = typeof column.title === "string" ? /* @__PURE__ */ React__default.createElement(OverflowTooltip, { tooltip: column.title, content: column.title }) : column.title;
|
|
66
|
+
return /* @__PURE__ */ React__default.createElement("p", { className: cx(Typo.Label.l3_bold_title, TitleStyle) }, titleContent);
|
|
67
|
+
};
|
|
68
|
+
const renderSubTitle = () => {
|
|
69
|
+
if (column.subTitleRender) {
|
|
70
|
+
return column.subTitleRender({
|
|
71
|
+
isHeader: true,
|
|
72
|
+
disabled,
|
|
73
|
+
onChange: headerOnChange,
|
|
74
|
+
onBlur: headerOnBlur
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
if (disableBatchFilling) {
|
|
78
|
+
return null;
|
|
79
|
+
}
|
|
80
|
+
return /* @__PURE__ */ React__default.createElement(
|
|
81
|
+
FormItem,
|
|
82
|
+
{
|
|
83
|
+
validateStatus: typeof errMsg === "string" && errMsg ? "error" : "",
|
|
84
|
+
message: errMsg || void 0
|
|
85
|
+
},
|
|
86
|
+
// if the render prop is provided, use it to render the subTitle
|
|
87
|
+
// otherwise, render the default component
|
|
88
|
+
column.render ? column.render({
|
|
89
|
+
isHeader: true,
|
|
90
|
+
disabled,
|
|
91
|
+
onChange: headerOnChange,
|
|
92
|
+
onBlur: headerOnBlur
|
|
93
|
+
}) : renderDefaultComponent()
|
|
94
|
+
);
|
|
95
|
+
};
|
|
69
96
|
return /* @__PURE__ */ React__default.createElement(
|
|
70
97
|
"div",
|
|
71
98
|
{
|
|
@@ -76,15 +103,8 @@ const BatchInputListHeaderCell = (props) => {
|
|
|
76
103
|
visibility: column.hidden ? "hidden" : "visible"
|
|
77
104
|
}
|
|
78
105
|
},
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
FormItem,
|
|
82
|
-
{
|
|
83
|
-
validateStatus: typeof errMsg === "string" && errMsg ? "error" : "",
|
|
84
|
-
message: errMsg || void 0
|
|
85
|
-
},
|
|
86
|
-
renderCell()
|
|
87
|
-
)
|
|
106
|
+
renderTitle(),
|
|
107
|
+
renderSubTitle()
|
|
88
108
|
);
|
|
89
109
|
};
|
|
90
110
|
|
|
@@ -2,9 +2,8 @@ import AddRowButton from './AddRowButton.js';
|
|
|
2
2
|
import { TableFormWrapper, DraggableHandleWrapper } from './style.js';
|
|
3
3
|
import TableFormBodyRows from './TableFormBodyRows.js';
|
|
4
4
|
import { BatchInputListHeaderCell } from './TableFormHeaderCell.js';
|
|
5
|
-
import { genEmptyRow } from './utils.js';
|
|
6
5
|
import { List } from 'antd';
|
|
7
|
-
import React__default, { useState, useCallback,
|
|
6
|
+
import React__default, { useState, useCallback, useImperativeHandle, useMemo } from 'react';
|
|
8
7
|
|
|
9
8
|
var __defProp = Object.defineProperty;
|
|
10
9
|
var __defProps = Object.defineProperties;
|
|
@@ -25,7 +24,6 @@ var __spreadValues = (a, b) => {
|
|
|
25
24
|
return a;
|
|
26
25
|
};
|
|
27
26
|
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
28
|
-
const DEFAULT_ROW_COUNT = 3;
|
|
29
27
|
const TableForm = React__default.forwardRef(
|
|
30
28
|
(props, ref) => {
|
|
31
29
|
var _a, _b;
|
|
@@ -48,7 +46,8 @@ const TableForm = React__default.forwardRef(
|
|
|
48
46
|
onBodyChange,
|
|
49
47
|
onBodyBlur,
|
|
50
48
|
row,
|
|
51
|
-
errors
|
|
49
|
+
errors,
|
|
50
|
+
hideEmptyTable
|
|
52
51
|
} = props;
|
|
53
52
|
const [data, setData] = useState(defaultData || []);
|
|
54
53
|
const [passwordVisible, setPasswordVisible] = useState(false);
|
|
@@ -64,13 +63,6 @@ const TableForm = React__default.forwardRef(
|
|
|
64
63
|
},
|
|
65
64
|
[onBodyChange]
|
|
66
65
|
);
|
|
67
|
-
useLayoutEffect(() => {
|
|
68
|
-
if (!defaultData) {
|
|
69
|
-
updateData(
|
|
70
|
-
[...Array(DEFAULT_ROW_COUNT)].map(() => genEmptyRow(columns))
|
|
71
|
-
);
|
|
72
|
-
}
|
|
73
|
-
}, [columns, defaultData, updateData]);
|
|
74
66
|
const handleBatchChange = useCallback(
|
|
75
67
|
(newData, columnKey, shouldUpdateData) => {
|
|
76
68
|
setLatestData(newData);
|
|
@@ -134,9 +126,10 @@ const TableForm = React__default.forwardRef(
|
|
|
134
126
|
} : void 0,
|
|
135
127
|
[maxHeight]
|
|
136
128
|
);
|
|
137
|
-
return /* @__PURE__ */ React__default.createElement("div", { className }, /* @__PURE__ */ React__default.createElement(
|
|
129
|
+
return /* @__PURE__ */ React__default.createElement("div", { className }, hideEmptyTable && data.length < 1 ? null : /* @__PURE__ */ React__default.createElement(
|
|
138
130
|
TableFormWrapper,
|
|
139
131
|
{
|
|
132
|
+
"data-testid": "eagle-table-form-wrapper",
|
|
140
133
|
className: `table-form row-split-by-${rowSplitType}`,
|
|
141
134
|
style: tableFormWrapperStyle
|
|
142
135
|
},
|
package/dist/esm/core/index.js
CHANGED
|
@@ -2,6 +2,7 @@ import Bit from './Bit/index.js';
|
|
|
2
2
|
import BitPerSecond from './BitPerSecond/index.js';
|
|
3
3
|
import Bps from './Bps/index.js';
|
|
4
4
|
import Byte from './Byte/index.js';
|
|
5
|
+
import BytePerSecond from './BytePerSecond/index.js';
|
|
5
6
|
import Frequency from './Frequency/index.js';
|
|
6
7
|
import Percent from './Percent/index.js';
|
|
7
8
|
import Second from './Second/index.js';
|
|
@@ -10,6 +11,7 @@ import Speed from './Speed/index.js';
|
|
|
10
11
|
const units = {
|
|
11
12
|
Percent,
|
|
12
13
|
Byte,
|
|
14
|
+
BytePerSecond,
|
|
13
15
|
Frequency,
|
|
14
16
|
Speed,
|
|
15
17
|
Bps,
|
|
@@ -18,4 +20,4 @@ const units = {
|
|
|
18
20
|
Second
|
|
19
21
|
};
|
|
20
22
|
|
|
21
|
-
export { Bit, BitPerSecond, Bps, Byte, Frequency, Percent, Second, Speed, units as Units, units };
|
|
23
|
+
export { Bit, BitPerSecond, Bps, Byte, BytePerSecond, Frequency, Percent, Second, Speed, units as Units, units };
|
|
@@ -3,6 +3,7 @@ import Bit from '../../core/Bit/index.js';
|
|
|
3
3
|
import BitPerSecond from '../../core/BitPerSecond/index.js';
|
|
4
4
|
import Bps from '../../core/Bps/index.js';
|
|
5
5
|
import Byte from '../../core/Byte/index.js';
|
|
6
|
+
import BytePerSecond from '../../core/BytePerSecond/index.js';
|
|
6
7
|
import Frequency from '../../core/Frequency/index.js';
|
|
7
8
|
import Percent from '../../core/Percent/index.js';
|
|
8
9
|
import Second from '../../core/Second/index.js';
|
|
@@ -17,6 +18,7 @@ import React__default from 'react';
|
|
|
17
18
|
const units = {
|
|
18
19
|
Percent,
|
|
19
20
|
Byte,
|
|
21
|
+
BytePerSecond,
|
|
20
22
|
Frequency,
|
|
21
23
|
Speed,
|
|
22
24
|
Bps,
|
|
@@ -3,6 +3,7 @@ import Bit from '../../core/Bit/index.js';
|
|
|
3
3
|
import BitPerSecond from '../../core/BitPerSecond/index.js';
|
|
4
4
|
import Bps from '../../core/Bps/index.js';
|
|
5
5
|
import Byte from '../../core/Byte/index.js';
|
|
6
|
+
import BytePerSecond from '../../core/BytePerSecond/index.js';
|
|
6
7
|
import Empty from '../../core/Empty/index.js';
|
|
7
8
|
import Frequency from '../../core/Frequency/index.js';
|
|
8
9
|
import Percent from '../../core/Percent/index.js';
|
|
@@ -32,6 +33,7 @@ var __spreadValues = (a, b) => {
|
|
|
32
33
|
const units = {
|
|
33
34
|
Percent,
|
|
34
35
|
Byte,
|
|
36
|
+
BytePerSecond,
|
|
35
37
|
Frequency,
|
|
36
38
|
Speed,
|
|
37
39
|
Bps,
|
package/dist/esm/index.js
CHANGED
|
@@ -20,6 +20,7 @@ export { BreadWrapper, default as Breadcrumb } from './core/Breadcrumb/index.js'
|
|
|
20
20
|
export { default as Button } from './core/Button/index.js';
|
|
21
21
|
export { default as ButtonGroup, ButtonStyle } from './core/ButtonGroup/index.js';
|
|
22
22
|
export { default as Byte } from './core/Byte/index.js';
|
|
23
|
+
export { default as BytePerSecond } from './core/BytePerSecond/index.js';
|
|
23
24
|
export { default as Calendar } from './core/Calendar/index.js';
|
|
24
25
|
export { default as Card } from './core/Card/index.js';
|
|
25
26
|
export { default as Checkbox } from './core/Checkbox/index.js';
|
package/dist/esm/legacy-antd.js
CHANGED
|
@@ -11,6 +11,7 @@ import Breadcrumb from './core/Breadcrumb/index.js';
|
|
|
11
11
|
import Button from './core/Button/index.js';
|
|
12
12
|
import ButtonGroup from './core/ButtonGroup/index.js';
|
|
13
13
|
import Byte from './core/Byte/index.js';
|
|
14
|
+
import BytePerSecond from './core/BytePerSecond/index.js';
|
|
14
15
|
import Calendar from './core/Calendar/index.js';
|
|
15
16
|
import Card from './core/Card/index.js';
|
|
16
17
|
import Checkbox from './core/Checkbox/index.js';
|
|
@@ -94,6 +95,7 @@ function getAntdKit() {
|
|
|
94
95
|
units: {
|
|
95
96
|
Percent,
|
|
96
97
|
Byte,
|
|
98
|
+
BytePerSecond,
|
|
97
99
|
Frequency,
|
|
98
100
|
Speed,
|
|
99
101
|
Bps,
|