@cloudtower/eagle 0.29.0 → 0.29.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 -10
- package/dist/cjs/core/Progress/components.js +1 -1
- package/dist/cjs/core/Table/index.js +21 -5
- package/dist/cjs/index.js +3 -5
- package/dist/cjs/legacy-antd.js +33 -35
- package/dist/cjs/stats1.html +1 -1
- package/dist/components.css +3451 -3458
- package/dist/esm/core/Progress/components.js +2 -2
- package/dist/esm/core/Table/index.js +21 -5
- package/dist/esm/index.js +0 -1
- package/dist/esm/legacy-antd.js +0 -2
- package/dist/esm/stats1.html +1 -1
- package/dist/src/coreX/index.d.ts +0 -2
- package/dist/src/spec/base.d.ts +1 -2
- package/dist/stories/docs/core/KitStoreProvider.stories.d.ts +23 -0
- package/dist/stories/docs/core/Table.stories.d.ts +47 -16
- package/dist/style.css +3406 -3413
- package/package.json +4 -4
- package/dist/cjs/coreX/TruncatedTextWithTooltip/index.js +0 -73
- package/dist/esm/coreX/TruncatedTextWithTooltip/index.js +0 -67
- package/dist/src/coreX/TruncatedTextWithTooltip/index.d.ts +0 -11
- package/dist/src/coreX/TruncatedTextWithTooltip/truncatedTextWithTooltip.type.d.ts +0 -5
- package/dist/stories/docs/coreX/TruncatedTextWithTooltip.stories.d.ts +0 -7
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CheckmarkDoneSuccessCorrect16GreenIcon, XmarkFailed16RedIcon, NoticeTriangleFill16YellowIcon,
|
|
1
|
+
import { CheckmarkDoneSuccessCorrect16GreenIcon, XmarkFailed16RedIcon, NoticeTriangleFill16YellowIcon, Loading16GradientBlueIcon } from '@cloudtower/icons-react';
|
|
2
2
|
import { cx } from '@linaria/core';
|
|
3
3
|
import { styled } from '@linaria/react';
|
|
4
4
|
import Icon from '../Icon/index.js';
|
|
@@ -53,7 +53,7 @@ const StatusIconMap = {
|
|
|
53
53
|
failed: /* @__PURE__ */React__default.createElement(XmarkFailed16RedIcon, null),
|
|
54
54
|
paused: /* @__PURE__ */React__default.createElement(NoticeTriangleFill16YellowIcon, null),
|
|
55
55
|
active: /* @__PURE__ */React__default.createElement(Icon, {
|
|
56
|
-
src:
|
|
56
|
+
src: Loading16GradientBlueIcon,
|
|
57
57
|
isRotate: true
|
|
58
58
|
})
|
|
59
59
|
};
|
|
@@ -5,6 +5,7 @@ import { ColumnTitle, TableLoading } from './TableWidget.js';
|
|
|
5
5
|
export { EmptyRowMenu, KitTableContext } from './TableWidget.js';
|
|
6
6
|
import { Table as Table$2 } from 'antd';
|
|
7
7
|
import cs from 'classnames';
|
|
8
|
+
import { isNil } from 'lodash';
|
|
8
9
|
import React__default, { useRef, useMemo } from 'react';
|
|
9
10
|
|
|
10
11
|
var __defProp = Object.defineProperty;
|
|
@@ -31,9 +32,9 @@ const TableContainerStyle = "E_tc97u5y";
|
|
|
31
32
|
const tableStyleCover = "E_tfzf37v";
|
|
32
33
|
const Table = props => {
|
|
33
34
|
const {
|
|
34
|
-
loading,
|
|
35
|
+
loading = false,
|
|
35
36
|
error,
|
|
36
|
-
dataSource,
|
|
37
|
+
dataSource: _dataSource,
|
|
37
38
|
columns,
|
|
38
39
|
onSorterChange,
|
|
39
40
|
onRowClick,
|
|
@@ -51,7 +52,7 @@ const Table = props => {
|
|
|
51
52
|
onRow
|
|
52
53
|
} = props;
|
|
53
54
|
const orderRef = useRef(null);
|
|
54
|
-
const hasScrollBard = useTableBodyHasScrollBar(wrapper,
|
|
55
|
+
const hasScrollBard = useTableBodyHasScrollBar(wrapper, _dataSource);
|
|
55
56
|
const _columns = useMemo(() => columns.map(column => {
|
|
56
57
|
const _column = __spreadValues({}, column);
|
|
57
58
|
if (_column.sorter && typeof _column.title !== "function") {
|
|
@@ -65,6 +66,21 @@ const Table = props => {
|
|
|
65
66
|
}
|
|
66
67
|
return _column;
|
|
67
68
|
}), [columns]);
|
|
69
|
+
const dataSource = useMemo(() => {
|
|
70
|
+
if (!isNil(error) || loading) {
|
|
71
|
+
return [];
|
|
72
|
+
}
|
|
73
|
+
return _dataSource != null ? _dataSource : [];
|
|
74
|
+
}, [_dataSource, error, loading]);
|
|
75
|
+
const emptyText = useMemo(() => {
|
|
76
|
+
if (loading) {
|
|
77
|
+
return "";
|
|
78
|
+
}
|
|
79
|
+
if (!isNil(error)) {
|
|
80
|
+
return error;
|
|
81
|
+
}
|
|
82
|
+
return empty;
|
|
83
|
+
}, [empty, error, loading]);
|
|
68
84
|
return /* @__PURE__ */React__default.createElement("div", {
|
|
69
85
|
className: cx(TableContainerStyle, "table-container", !hasScrollBard && "no-scroll-bar")
|
|
70
86
|
}, /* @__PURE__ */React__default.createElement(Table$2, {
|
|
@@ -75,9 +91,9 @@ const Table = props => {
|
|
|
75
91
|
indicator: initLoading ? /* @__PURE__ */React__default.createElement(TableLoading, null) : /* @__PURE__ */React__default.createElement(Loading, null)
|
|
76
92
|
},
|
|
77
93
|
locale: {
|
|
78
|
-
emptyText
|
|
94
|
+
emptyText
|
|
79
95
|
},
|
|
80
|
-
dataSource
|
|
96
|
+
dataSource,
|
|
81
97
|
pagination: pagination || false,
|
|
82
98
|
columns: _columns,
|
|
83
99
|
components,
|
package/dist/esm/index.js
CHANGED
|
@@ -118,7 +118,6 @@ export { default as SortableList } from './coreX/SortableList/index.js';
|
|
|
118
118
|
export { default as SummaryTable, SummaryTableRow } from './coreX/SummaryTable/index.js';
|
|
119
119
|
export { default as SwitchWithText } from './coreX/SwitchWithText/index.js';
|
|
120
120
|
export { default as TabMenu } from './coreX/TabMenu/index.js';
|
|
121
|
-
export { default as TruncatedTextWithTooltip } from './coreX/TruncatedTextWithTooltip/index.js';
|
|
122
121
|
export { default as UnitWithChart, UnitWrapper } from './coreX/UnitWithChart/index.js';
|
|
123
122
|
export { getCalendarTitle } from './coreX/common/getCalendarTitle.js';
|
|
124
123
|
export { default as AbsoluteDate } from './coreX/DateRangePicker/AbsoluteDate.js';
|
package/dist/esm/legacy-antd.js
CHANGED
|
@@ -68,7 +68,6 @@ import SidebarSubtitle from './coreX/SidebarSubtitle/index.js';
|
|
|
68
68
|
import SortableList from './coreX/SortableList/index.js';
|
|
69
69
|
import SummaryTable from './coreX/SummaryTable/index.js';
|
|
70
70
|
import SwitchWithText from './coreX/SwitchWithText/index.js';
|
|
71
|
-
import TruncatedTextWithTooltip from './coreX/TruncatedTextWithTooltip/index.js';
|
|
72
71
|
import UnitWithChart from './coreX/UnitWithChart/index.js';
|
|
73
72
|
import DateRangePicker from './coreX/DateRangePicker/index.js';
|
|
74
73
|
|
|
@@ -178,7 +177,6 @@ function getAntdKit() {
|
|
|
178
177
|
DropdownTransition,
|
|
179
178
|
AccordionCard,
|
|
180
179
|
DetailCard,
|
|
181
|
-
TruncatedTextWithTooltip,
|
|
182
180
|
Counting,
|
|
183
181
|
Breadcrumb,
|
|
184
182
|
CircleProgress,
|