@cloudtower/eagle 0.29.2 → 0.29.4-dry
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/KitStoreProvider/index.js +1 -42
- package/dist/cjs/core/ModalStack/index.js +2 -2
- package/dist/cjs/core/SimplePagination/index.js +3 -0
- package/dist/cjs/core/Table/index.js +5 -21
- package/dist/cjs/index.js +0 -3
- package/dist/cjs/stats1.html +1 -1
- package/dist/components.css +1318 -1318
- package/dist/esm/core/KitStoreProvider/index.js +4 -42
- package/dist/esm/core/ModalStack/index.js +2 -2
- package/dist/esm/core/SimplePagination/index.js +3 -0
- package/dist/esm/core/Table/index.js +5 -21
- package/dist/esm/index.js +1 -1
- package/dist/esm/stats1.html +1 -1
- package/dist/src/core/KitStoreProvider/index.d.ts +1 -4
- package/dist/src/core/SimplePagination/index.d.ts +1 -1
- package/dist/src/store/index.d.ts +0 -12
- package/dist/stories/docs/core/Table.stories.d.ts +16 -47
- package/dist/style.css +1232 -1232
- package/package.json +4 -4
- package/dist/stories/docs/core/KitStoreProvider.stories.d.ts +0 -23
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import { UIKitStore
|
|
2
|
-
import React__default, { createContext
|
|
1
|
+
import { UIKitStore } from '../../store/index.js';
|
|
2
|
+
import React__default, { createContext } from 'react';
|
|
3
3
|
import { Provider, createDispatchHook, createSelectorHook } from 'react-redux';
|
|
4
|
-
import { createStore } from 'redux';
|
|
5
|
-
import { ModalActions } from '../../store/modal.js';
|
|
6
4
|
|
|
7
5
|
const ctx = createContext({
|
|
8
6
|
store: UIKitStore,
|
|
@@ -10,46 +8,10 @@ const ctx = createContext({
|
|
|
10
8
|
});
|
|
11
9
|
const KitStoreProvider = (props) => {
|
|
12
10
|
const { children } = props;
|
|
13
|
-
|
|
14
|
-
return /* @__PURE__ */ React__default.createElement(Provider, { context: ctx, store: storeRef.current }, children);
|
|
11
|
+
return /* @__PURE__ */ React__default.createElement(Provider, { context: ctx, store: UIKitStore }, children);
|
|
15
12
|
};
|
|
16
13
|
var KitStoreProvider$1 = KitStoreProvider;
|
|
17
14
|
const useKitDispatch = createDispatchHook(ctx);
|
|
18
15
|
const useKitSelector = createSelectorHook(ctx);
|
|
19
|
-
const usePushModal = () => {
|
|
20
|
-
const dispatch = useKitDispatch();
|
|
21
|
-
const pushModal = useCallback(
|
|
22
|
-
(modal) => {
|
|
23
|
-
dispatch({
|
|
24
|
-
type: ModalActions.PUSH_MODAL,
|
|
25
|
-
payload: modal
|
|
26
|
-
});
|
|
27
|
-
},
|
|
28
|
-
[dispatch]
|
|
29
|
-
);
|
|
30
|
-
return pushModal;
|
|
31
|
-
};
|
|
32
|
-
const useCloseModal = () => {
|
|
33
|
-
const dispatch = useKitDispatch();
|
|
34
|
-
const closeModal = useCallback(
|
|
35
|
-
(id) => {
|
|
36
|
-
dispatch({
|
|
37
|
-
type: ModalActions.CLOSE_MODAL,
|
|
38
|
-
id
|
|
39
|
-
});
|
|
40
|
-
},
|
|
41
|
-
[dispatch]
|
|
42
|
-
);
|
|
43
|
-
return closeModal;
|
|
44
|
-
};
|
|
45
|
-
const usePopModal = () => {
|
|
46
|
-
const dispatch = useKitDispatch();
|
|
47
|
-
const popModal = useCallback(() => {
|
|
48
|
-
dispatch({
|
|
49
|
-
type: ModalActions.POP_MODAL
|
|
50
|
-
});
|
|
51
|
-
}, [dispatch]);
|
|
52
|
-
return popModal;
|
|
53
|
-
};
|
|
54
16
|
|
|
55
|
-
export { KitStoreProvider$1 as default,
|
|
17
|
+
export { KitStoreProvider$1 as default, useKitDispatch, useKitSelector };
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { useKitSelector
|
|
1
|
+
import { useKitSelector } from '../KitStoreProvider/index.js';
|
|
2
|
+
import { closeModal } from '../../store/index.js';
|
|
2
3
|
import React__default from 'react';
|
|
3
4
|
|
|
4
5
|
var __defProp = Object.defineProperty;
|
|
@@ -24,7 +25,6 @@ const ModalStack = () => {
|
|
|
24
25
|
const stack = useKitSelector(
|
|
25
26
|
(state) => state.modal.stack
|
|
26
27
|
);
|
|
27
|
-
const closeModal = useCloseModal();
|
|
28
28
|
return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, stack.map((modal) => /* @__PURE__ */ React__default.createElement(
|
|
29
29
|
modal.component,
|
|
30
30
|
__spreadProps(__spreadValues({}, modal.props), {
|
|
@@ -31,6 +31,9 @@ const SimplePagination = props => {
|
|
|
31
31
|
onPageChange == null ? void 0 : onPageChange(1);
|
|
32
32
|
}
|
|
33
33
|
}, [onPageChange, pageLength]);
|
|
34
|
+
if (count === 0) {
|
|
35
|
+
return null;
|
|
36
|
+
}
|
|
34
37
|
return /* @__PURE__ */React__default.createElement("div", {
|
|
35
38
|
className: cs(PaginationStyle, "pagination-wrapper", className)
|
|
36
39
|
}, /* @__PURE__ */React__default.createElement("span", {
|
|
@@ -5,7 +5,6 @@ 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';
|
|
9
8
|
import React__default, { useRef, useMemo } from 'react';
|
|
10
9
|
|
|
11
10
|
var __defProp = Object.defineProperty;
|
|
@@ -32,9 +31,9 @@ const TableContainerStyle = "E_tc97u5y";
|
|
|
32
31
|
const tableStyleCover = "E_tfzf37v";
|
|
33
32
|
const Table = props => {
|
|
34
33
|
const {
|
|
35
|
-
loading
|
|
34
|
+
loading,
|
|
36
35
|
error,
|
|
37
|
-
dataSource
|
|
36
|
+
dataSource,
|
|
38
37
|
columns,
|
|
39
38
|
onSorterChange,
|
|
40
39
|
onRowClick,
|
|
@@ -52,7 +51,7 @@ const Table = props => {
|
|
|
52
51
|
onRow
|
|
53
52
|
} = props;
|
|
54
53
|
const orderRef = useRef(null);
|
|
55
|
-
const hasScrollBard = useTableBodyHasScrollBar(wrapper,
|
|
54
|
+
const hasScrollBard = useTableBodyHasScrollBar(wrapper, dataSource);
|
|
56
55
|
const _columns = useMemo(() => columns.map(column => {
|
|
57
56
|
const _column = __spreadValues({}, column);
|
|
58
57
|
if (_column.sorter && typeof _column.title !== "function") {
|
|
@@ -66,21 +65,6 @@ const Table = props => {
|
|
|
66
65
|
}
|
|
67
66
|
return _column;
|
|
68
67
|
}), [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]);
|
|
84
68
|
return /* @__PURE__ */React__default.createElement("div", {
|
|
85
69
|
className: cx(TableContainerStyle, "table-container", !hasScrollBard && "no-scroll-bar")
|
|
86
70
|
}, /* @__PURE__ */React__default.createElement(Table$2, {
|
|
@@ -91,9 +75,9 @@ const Table = props => {
|
|
|
91
75
|
indicator: initLoading ? /* @__PURE__ */React__default.createElement(TableLoading, null) : /* @__PURE__ */React__default.createElement(Loading, null)
|
|
92
76
|
},
|
|
93
77
|
locale: {
|
|
94
|
-
emptyText
|
|
78
|
+
emptyText: error || /* @__PURE__ */React__default.createElement(React__default.Fragment, null, loading ? "" : empty)
|
|
95
79
|
},
|
|
96
|
-
dataSource,
|
|
80
|
+
dataSource: dataSource || [],
|
|
97
81
|
pagination: pagination || false,
|
|
98
82
|
columns: _columns,
|
|
99
83
|
components,
|
package/dist/esm/index.js
CHANGED
|
@@ -41,7 +41,7 @@ export { AntdIntStyled, default as InputInteger } from './core/InputInteger/inde
|
|
|
41
41
|
export { AntdInputNumberStyled, default as InputNumber } from './core/InputNumber/index.js';
|
|
42
42
|
export { AntdPasswordInputStyled, default as InputPassword } from './core/InputPassword/index.js';
|
|
43
43
|
export { default as InputTagItem } from './core/InputTagItem/index.js';
|
|
44
|
-
export { default as KitStoreProvider,
|
|
44
|
+
export { default as KitStoreProvider, useKitDispatch, useKitSelector } from './core/KitStoreProvider/index.js';
|
|
45
45
|
export { default as Link } from './core/Link/index.js';
|
|
46
46
|
export { default as Loading } from './core/Loading/index.js';
|
|
47
47
|
export { attachTypeApi, getKeyThenIncreaseKey, default as message } from './core/message/index.js';
|