@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
|
@@ -5,8 +5,6 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
var index = require('../../store/index.js');
|
|
6
6
|
var React = require('react');
|
|
7
7
|
var reactRedux = require('react-redux');
|
|
8
|
-
var redux = require('redux');
|
|
9
|
-
var modal = require('../../store/modal.js');
|
|
10
8
|
|
|
11
9
|
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
12
10
|
|
|
@@ -18,51 +16,12 @@ const ctx = React.createContext({
|
|
|
18
16
|
});
|
|
19
17
|
const KitStoreProvider = (props) => {
|
|
20
18
|
const { children } = props;
|
|
21
|
-
|
|
22
|
-
return /* @__PURE__ */ React__default.default.createElement(reactRedux.Provider, { context: ctx, store: storeRef.current }, children);
|
|
19
|
+
return /* @__PURE__ */ React__default.default.createElement(reactRedux.Provider, { context: ctx, store: index.UIKitStore }, children);
|
|
23
20
|
};
|
|
24
21
|
var KitStoreProvider$1 = KitStoreProvider;
|
|
25
22
|
const useKitDispatch = reactRedux.createDispatchHook(ctx);
|
|
26
23
|
const useKitSelector = reactRedux.createSelectorHook(ctx);
|
|
27
|
-
const usePushModal = () => {
|
|
28
|
-
const dispatch = useKitDispatch();
|
|
29
|
-
const pushModal = React.useCallback(
|
|
30
|
-
(modal$1) => {
|
|
31
|
-
dispatch({
|
|
32
|
-
type: modal.ModalActions.PUSH_MODAL,
|
|
33
|
-
payload: modal$1
|
|
34
|
-
});
|
|
35
|
-
},
|
|
36
|
-
[dispatch]
|
|
37
|
-
);
|
|
38
|
-
return pushModal;
|
|
39
|
-
};
|
|
40
|
-
const useCloseModal = () => {
|
|
41
|
-
const dispatch = useKitDispatch();
|
|
42
|
-
const closeModal = React.useCallback(
|
|
43
|
-
(id) => {
|
|
44
|
-
dispatch({
|
|
45
|
-
type: modal.ModalActions.CLOSE_MODAL,
|
|
46
|
-
id
|
|
47
|
-
});
|
|
48
|
-
},
|
|
49
|
-
[dispatch]
|
|
50
|
-
);
|
|
51
|
-
return closeModal;
|
|
52
|
-
};
|
|
53
|
-
const usePopModal = () => {
|
|
54
|
-
const dispatch = useKitDispatch();
|
|
55
|
-
const popModal = React.useCallback(() => {
|
|
56
|
-
dispatch({
|
|
57
|
-
type: modal.ModalActions.POP_MODAL
|
|
58
|
-
});
|
|
59
|
-
}, [dispatch]);
|
|
60
|
-
return popModal;
|
|
61
|
-
};
|
|
62
24
|
|
|
63
25
|
exports.default = KitStoreProvider$1;
|
|
64
|
-
exports.useCloseModal = useCloseModal;
|
|
65
26
|
exports.useKitDispatch = useKitDispatch;
|
|
66
27
|
exports.useKitSelector = useKitSelector;
|
|
67
|
-
exports.usePopModal = usePopModal;
|
|
68
|
-
exports.usePushModal = usePushModal;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var index = require('../KitStoreProvider/index.js');
|
|
4
|
+
var index$1 = require('../../store/index.js');
|
|
4
5
|
var React = require('react');
|
|
5
6
|
|
|
6
7
|
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
@@ -30,7 +31,6 @@ const ModalStack = () => {
|
|
|
30
31
|
const stack = index.useKitSelector(
|
|
31
32
|
(state) => state.modal.stack
|
|
32
33
|
);
|
|
33
|
-
const closeModal = index.useCloseModal();
|
|
34
34
|
return /* @__PURE__ */ React__default.default.createElement(React__default.default.Fragment, null, stack.map((modal) => /* @__PURE__ */ React__default.default.createElement(
|
|
35
35
|
modal.component,
|
|
36
36
|
__spreadProps(__spreadValues({}, modal.props), {
|
|
@@ -40,7 +40,7 @@ const ModalStack = () => {
|
|
|
40
40
|
if ((_a = modal.props) == null ? void 0 : _a.onClose) {
|
|
41
41
|
modal.props.onClose();
|
|
42
42
|
}
|
|
43
|
-
closeModal(modal.id);
|
|
43
|
+
index$1.closeModal(modal.id);
|
|
44
44
|
},
|
|
45
45
|
key: modal.id
|
|
46
46
|
})
|
|
@@ -38,6 +38,9 @@ const SimplePagination = props => {
|
|
|
38
38
|
onPageChange == null ? void 0 : onPageChange(1);
|
|
39
39
|
}
|
|
40
40
|
}, [onPageChange, pageLength]);
|
|
41
|
+
if (count === 0) {
|
|
42
|
+
return null;
|
|
43
|
+
}
|
|
41
44
|
return /* @__PURE__ */React__default.default.createElement("div", {
|
|
42
45
|
className: cs__default.default(index.PaginationStyle, "pagination-wrapper", className)
|
|
43
46
|
}, /* @__PURE__ */React__default.default.createElement("span", {
|
|
@@ -8,7 +8,6 @@ var common = require('./common.js');
|
|
|
8
8
|
var TableWidget = require('./TableWidget.js');
|
|
9
9
|
var antd = require('antd');
|
|
10
10
|
var cs = require('classnames');
|
|
11
|
-
var _ = require('lodash');
|
|
12
11
|
var React = require('react');
|
|
13
12
|
|
|
14
13
|
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
@@ -40,9 +39,9 @@ const TableContainerStyle = "E_tc97u5y";
|
|
|
40
39
|
const tableStyleCover = "E_tfzf37v";
|
|
41
40
|
const Table = props => {
|
|
42
41
|
const {
|
|
43
|
-
loading
|
|
42
|
+
loading,
|
|
44
43
|
error,
|
|
45
|
-
dataSource
|
|
44
|
+
dataSource,
|
|
46
45
|
columns,
|
|
47
46
|
onSorterChange,
|
|
48
47
|
onRowClick,
|
|
@@ -60,7 +59,7 @@ const Table = props => {
|
|
|
60
59
|
onRow
|
|
61
60
|
} = props;
|
|
62
61
|
const orderRef = React.useRef(null);
|
|
63
|
-
const hasScrollBard = common.useTableBodyHasScrollBar(wrapper,
|
|
62
|
+
const hasScrollBard = common.useTableBodyHasScrollBar(wrapper, dataSource);
|
|
64
63
|
const _columns = React.useMemo(() => columns.map(column => {
|
|
65
64
|
const _column = __spreadValues({}, column);
|
|
66
65
|
if (_column.sorter && typeof _column.title !== "function") {
|
|
@@ -74,21 +73,6 @@ const Table = props => {
|
|
|
74
73
|
}
|
|
75
74
|
return _column;
|
|
76
75
|
}), [columns]);
|
|
77
|
-
const dataSource = React.useMemo(() => {
|
|
78
|
-
if (!_.isNil(error) || loading) {
|
|
79
|
-
return [];
|
|
80
|
-
}
|
|
81
|
-
return _dataSource != null ? _dataSource : [];
|
|
82
|
-
}, [_dataSource, error, loading]);
|
|
83
|
-
const emptyText = React.useMemo(() => {
|
|
84
|
-
if (loading) {
|
|
85
|
-
return "";
|
|
86
|
-
}
|
|
87
|
-
if (!_.isNil(error)) {
|
|
88
|
-
return error;
|
|
89
|
-
}
|
|
90
|
-
return empty;
|
|
91
|
-
}, [empty, error, loading]);
|
|
92
76
|
return /* @__PURE__ */React__default.default.createElement("div", {
|
|
93
77
|
className: core.cx(TableContainerStyle, "table-container", !hasScrollBard && "no-scroll-bar")
|
|
94
78
|
}, /* @__PURE__ */React__default.default.createElement(antd.Table, {
|
|
@@ -99,9 +83,9 @@ const Table = props => {
|
|
|
99
83
|
indicator: initLoading ? /* @__PURE__ */React__default.default.createElement(TableWidget.TableLoading, null) : /* @__PURE__ */React__default.default.createElement(index, null)
|
|
100
84
|
},
|
|
101
85
|
locale: {
|
|
102
|
-
emptyText
|
|
86
|
+
emptyText: error || /* @__PURE__ */React__default.default.createElement(React__default.default.Fragment, null, loading ? "" : empty)
|
|
103
87
|
},
|
|
104
|
-
dataSource,
|
|
88
|
+
dataSource: dataSource || [],
|
|
105
89
|
pagination: pagination || false,
|
|
106
90
|
columns: _columns,
|
|
107
91
|
components,
|
package/dist/cjs/index.js
CHANGED
|
@@ -203,11 +203,8 @@ exports.AntdPasswordInputStyled = index$A.AntdPasswordInputStyled;
|
|
|
203
203
|
exports.InputPassword = index$A.default;
|
|
204
204
|
exports.InputTagItem = index$B;
|
|
205
205
|
exports.KitStoreProvider = index$C.default;
|
|
206
|
-
exports.useCloseModal = index$C.useCloseModal;
|
|
207
206
|
exports.useKitDispatch = index$C.useKitDispatch;
|
|
208
207
|
exports.useKitSelector = index$C.useKitSelector;
|
|
209
|
-
exports.usePopModal = index$C.usePopModal;
|
|
210
|
-
exports.usePushModal = index$C.usePushModal;
|
|
211
208
|
exports.Link = index$D;
|
|
212
209
|
exports.Loading = index$E;
|
|
213
210
|
exports.attachTypeApi = index$F.attachTypeApi;
|