@cloudtower/eagle 0.29.7 → 0.29.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.
@@ -1,26 +1,15 @@
1
- import React__default from 'react';
2
- import useElementsSize from '../../hooks/useElementsSize.js';
1
+ import React__default, { useMemo } from 'react';
3
2
 
3
+ const TableLoadingStyle = "E_t1g36k2w";
4
4
  const TableSkeleton = props => {
5
5
  const {
6
- rows: _rowLength,
7
- scrollY = false,
6
+ rowsCount = 50,
8
7
  headerHeight = 48,
9
- itemHeight: _itemHeight
8
+ itemHeight = 40
10
9
  } = 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);
10
+ const rows = useMemo(() => Array.from({
11
+ length: rowsCount
12
+ }, (r, i) => i), [rowsCount]);
24
13
  return /* @__PURE__ */React__default.createElement("div", {
25
14
  className: `${TableLoadingStyle} table-loading`
26
15
  }, /* @__PURE__ */React__default.createElement("div", {
@@ -52,6 +41,5 @@ const TableSkeleton = props => {
52
41
  className: "td-loading"
53
42
  }))));
54
43
  };
55
- const TableLoadingStyle = "E_t1g36k2w";
56
44
 
57
45
  export { TableSkeleton };
@@ -29,9 +29,9 @@ var __spreadValues = (a, b) => {
29
29
  };
30
30
  var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
31
31
  const TableContainerStyle = "E_tc97u5y";
32
- const tableStyleCover = "E_tfzf37v";
32
+ const emptyTableStyle = "E_efzf37v";
33
+ const tableStyleCover = "E_t1fisho6";
33
34
  const Table = props => {
34
- var _a;
35
35
  const {
36
36
  loading = false,
37
37
  error,
@@ -90,13 +90,11 @@ const Table = props => {
90
90
  return /* @__PURE__ */React__default.createElement("div", {
91
91
  className: cx(TableContainerStyle, "table-container", !hasScrollBard && "no-scroll-bar")
92
92
  }, /* @__PURE__ */React__default.createElement(Table$2, {
93
- className: cs(tableStyleCover, !(dataSource == null ? void 0 : dataSource.length) && "empty-table", rowSelection && "has-selection"),
93
+ className: cs(tableStyleCover, !(dataSource == null ? void 0 : dataSource.length) && emptyTableStyle, rowSelection && "has-selection"),
94
94
  bordered,
95
95
  loading: {
96
96
  spinning: loading || initLoading,
97
- indicator: /* @__PURE__ */React__default.createElement(TableSkeleton, __spreadValues({
98
- scrollY: !!((_a = props.scroll) == null ? void 0 : _a.y)
99
- }, skeletonProps))
97
+ indicator: /* @__PURE__ */React__default.createElement(TableSkeleton, __spreadValues({}, skeletonProps))
100
98
  },
101
99
  locale: {
102
100
  emptyText
@@ -127,4 +125,4 @@ const Table = props => {
127
125
  };
128
126
  var Table$1 = Table;
129
127
 
130
- export { ColumnTitle, TableSkeleton, Table$1 as default, tableStyleCover, useTableBodyHasScrollBar };
128
+ export { ColumnTitle, TableSkeleton, Table$1 as default, emptyTableStyle, tableStyleCover, useTableBodyHasScrollBar };
package/dist/esm/index.js CHANGED
@@ -63,7 +63,7 @@ export { default as Speed } from './core/Speed/index.js';
63
63
  export { default as StatusCapsule, StatusIcon, StatusPresetColors } from './core/StatusCapsule/index.js';
64
64
  export { default as Steps } from './core/Steps/index.js';
65
65
  export { default as Switch } from './core/Switch/index.js';
66
- export { default as Table, tableStyleCover } from './core/Table/index.js';
66
+ export { default as Table, emptyTableStyle, tableStyleCover } from './core/Table/index.js';
67
67
  export { default as TableForm } from './core/TableForm/index.js';
68
68
  export { default as Tag, TagPresetColors } from './core/Tag/index.js';
69
69
  export { default as TextArea } from './core/TextArea/index.js';