@cloudtower/eagle 0.29.4 → 0.29.6
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/Table/TableSkeleton.js +63 -0
- package/dist/cjs/core/Table/index.js +12 -4
- package/dist/cjs/index.js +2 -0
- package/dist/cjs/stats1.html +1 -1
- package/dist/components.css +1214 -1174
- package/dist/esm/core/Table/TableSkeleton.js +57 -0
- package/dist/esm/core/Table/index.js +14 -7
- package/dist/esm/index.js +1 -0
- package/dist/esm/stats1.html +1 -1
- package/dist/src/core/Table/TableSkeleton.d.ts +24 -0
- package/dist/src/core/Table/TableWidget.d.ts +4 -0
- package/dist/src/core/Table/index.d.ts +1 -0
- package/dist/src/core/Table/table.type.d.ts +2 -0
- package/dist/stories/docs/core/Table.stories.d.ts +4 -0
- package/dist/style.css +1009 -975
- package/package.json +4 -4
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import React__default from 'react';
|
|
2
|
+
import useElementsSize from '../../hooks/useElementsSize.js';
|
|
3
|
+
|
|
4
|
+
const TableSkeleton = props => {
|
|
5
|
+
const {
|
|
6
|
+
rows: _rowLength,
|
|
7
|
+
scrollY = false,
|
|
8
|
+
headerHeight = 48,
|
|
9
|
+
itemHeight: _itemHeight
|
|
10
|
+
} = props;
|
|
11
|
+
const sizes = useElementsSize({
|
|
12
|
+
loading: ".ant-table-container .ant-table-content .ant-table-tbody",
|
|
13
|
+
scrollYLoading: ".ant-table-container .ant-table-tbody"
|
|
14
|
+
}, {});
|
|
15
|
+
const itemSizes = useElementsSize({
|
|
16
|
+
loading: ".ant-table-container .ant-table-content .ant-table-tbody > tr:not(:first-child)",
|
|
17
|
+
scrollYLoading: ".ant-table-container .ant-table-tbody > tr:not(:first-child)"
|
|
18
|
+
}, {});
|
|
19
|
+
const itemHeight = (_itemHeight != null ? _itemHeight : itemSizes[scrollY ? "scrollYLoading" : "loading"].height) || 40;
|
|
20
|
+
const rowLength = (_rowLength != null ? _rowLength : Math.ceil(sizes[scrollY ? "scrollYLoading" : "loading"].height / itemHeight)) || 20;
|
|
21
|
+
const rows = Array.from({
|
|
22
|
+
length: rowLength
|
|
23
|
+
}, (r, i) => i);
|
|
24
|
+
return /* @__PURE__ */React__default.createElement("div", {
|
|
25
|
+
className: `${TableLoadingStyle} table-loading`
|
|
26
|
+
}, /* @__PURE__ */React__default.createElement("div", {
|
|
27
|
+
className: "table-loading-header table-loading-item",
|
|
28
|
+
style: {
|
|
29
|
+
height: headerHeight
|
|
30
|
+
}
|
|
31
|
+
}, /* @__PURE__ */React__default.createElement("div", {
|
|
32
|
+
className: "checkbox-loading"
|
|
33
|
+
}), /* @__PURE__ */React__default.createElement("div", {
|
|
34
|
+
className: "td-loading"
|
|
35
|
+
}), /* @__PURE__ */React__default.createElement("div", {
|
|
36
|
+
className: "td-loading"
|
|
37
|
+
}), /* @__PURE__ */React__default.createElement("div", {
|
|
38
|
+
className: "td-loading"
|
|
39
|
+
})), rows.map(i => /* @__PURE__ */React__default.createElement("div", {
|
|
40
|
+
key: i,
|
|
41
|
+
className: "table-loading-item",
|
|
42
|
+
style: {
|
|
43
|
+
height: itemHeight
|
|
44
|
+
}
|
|
45
|
+
}, /* @__PURE__ */React__default.createElement("div", {
|
|
46
|
+
className: "checkbox-loading"
|
|
47
|
+
}), /* @__PURE__ */React__default.createElement("div", {
|
|
48
|
+
className: "td-loading"
|
|
49
|
+
}), /* @__PURE__ */React__default.createElement("div", {
|
|
50
|
+
className: "td-loading"
|
|
51
|
+
}), /* @__PURE__ */React__default.createElement("div", {
|
|
52
|
+
className: "td-loading"
|
|
53
|
+
}))));
|
|
54
|
+
};
|
|
55
|
+
const TableLoadingStyle = "E_t1g36k2w";
|
|
56
|
+
|
|
57
|
+
export { TableSkeleton };
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { cx } from '@linaria/core';
|
|
2
|
-
import Loading from '../Loading/index.js';
|
|
3
2
|
import { useTableBodyHasScrollBar } from './common.js';
|
|
4
|
-
import { ColumnTitle
|
|
5
|
-
export { EmptyRowMenu, KitTableContext } from './TableWidget.js';
|
|
3
|
+
import { ColumnTitle } from './TableWidget.js';
|
|
4
|
+
export { EmptyRowMenu, KitTableContext, TableLoading } from './TableWidget.js';
|
|
6
5
|
import { Table as Table$2 } from 'antd';
|
|
7
6
|
import cs from 'classnames';
|
|
8
7
|
import { isNil } from 'lodash';
|
|
9
8
|
import React__default, { useRef, useMemo } from 'react';
|
|
9
|
+
import { TableSkeleton } from './TableSkeleton.js';
|
|
10
10
|
|
|
11
11
|
var __defProp = Object.defineProperty;
|
|
12
12
|
var __defProps = Object.defineProperties;
|
|
@@ -31,6 +31,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
31
31
|
const TableContainerStyle = "E_tc97u5y";
|
|
32
32
|
const tableStyleCover = "E_tfzf37v";
|
|
33
33
|
const Table = props => {
|
|
34
|
+
var _a;
|
|
34
35
|
const {
|
|
35
36
|
loading = false,
|
|
36
37
|
error,
|
|
@@ -49,7 +50,8 @@ const Table = props => {
|
|
|
49
50
|
rowKey,
|
|
50
51
|
wrapper,
|
|
51
52
|
pagination,
|
|
52
|
-
onRow
|
|
53
|
+
onRow,
|
|
54
|
+
skeletonProps
|
|
53
55
|
} = props;
|
|
54
56
|
const orderRef = useRef(null);
|
|
55
57
|
const hasScrollBard = useTableBodyHasScrollBar(wrapper, _dataSource);
|
|
@@ -67,7 +69,10 @@ const Table = props => {
|
|
|
67
69
|
return _column;
|
|
68
70
|
}), [columns]);
|
|
69
71
|
const dataSource = useMemo(() => {
|
|
70
|
-
if (
|
|
72
|
+
if (loading) {
|
|
73
|
+
return _dataSource;
|
|
74
|
+
}
|
|
75
|
+
if (!isNil(error)) {
|
|
71
76
|
return [];
|
|
72
77
|
}
|
|
73
78
|
return _dataSource != null ? _dataSource : [];
|
|
@@ -88,7 +93,9 @@ const Table = props => {
|
|
|
88
93
|
bordered,
|
|
89
94
|
loading: {
|
|
90
95
|
spinning: loading,
|
|
91
|
-
indicator:
|
|
96
|
+
indicator: /* @__PURE__ */React__default.createElement(TableSkeleton, __spreadValues({
|
|
97
|
+
scrollY: !!((_a = props.scroll) == null ? void 0 : _a.y)
|
|
98
|
+
}, skeletonProps))
|
|
92
99
|
},
|
|
93
100
|
locale: {
|
|
94
101
|
emptyText
|
|
@@ -119,4 +126,4 @@ const Table = props => {
|
|
|
119
126
|
};
|
|
120
127
|
var Table$1 = Table;
|
|
121
128
|
|
|
122
|
-
export { ColumnTitle,
|
|
129
|
+
export { ColumnTitle, TableSkeleton, Table$1 as default, tableStyleCover, useTableBodyHasScrollBar };
|
package/dist/esm/index.js
CHANGED
|
@@ -97,6 +97,7 @@ export { SidebarMenu } from './core/SidebarMenu/SidebarMenu.js';
|
|
|
97
97
|
export { CircleProgress } from './core/StepProgress/index.js';
|
|
98
98
|
export { CannotOperationInfo, CommonContent, ContentWrapper, Desc, Description, Divider, Dot, ErrorSpan, ExpandArrow, FieldTitle, FormField, FormItemDiv, FormSectionTitle, FormWrapper, FullView, HorizontalWizardModalCompactStyle, HorizontalWizardModalLooseStyle, InfoAlert, InputStyle, KitInputStyle, LeftEndInputStyle, LeftEndSelectStyle, LightDesc, LoadingWrapper, ModalBody, ModalWrapper, NameTag, NormalAlert, NoticeAlert, OperationWraper, RadioDesc, RightEndInputStyle, RightEndSelectStyle, SelectOptionDisabledText, TagSpan, TertiaryText, WarningAlert, WizardBody, radioStyle } from './core/Styled/index.js';
|
|
99
99
|
export { useTableBodyHasScrollBar } from './core/Table/common.js';
|
|
100
|
+
export { TableSkeleton } from './core/Table/TableSkeleton.js';
|
|
100
101
|
export { ColumnTitle, EmptyRowMenu, KitTableContext, TableLoading } from './core/Table/TableWidget.js';
|
|
101
102
|
export { ValidateTriggerType } from './core/TableForm/types.js';
|
|
102
103
|
export { Typo } from './core/Typo/index.js';
|