musae 1.3.1-beta.23 → 1.3.1-beta.24
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/components/table/hooks/use-pagination.hook.cjs +2 -2
- package/dist/components/table/hooks/use-pagination.hook.d.ts +1 -0
- package/dist/components/table/hooks/use-pagination.hook.mjs +2 -2
- package/dist/components/table/table.cjs +5 -3
- package/dist/components/table/table.mjs +5 -3
- package/package.json +1 -1
|
@@ -45,7 +45,6 @@ var usePagination = function usePagination(_ref) {
|
|
|
45
45
|
var changePageSize = relax.useEvent(function (_pageSize) {
|
|
46
46
|
var _pagination$onPageSiz;
|
|
47
47
|
setPageSize(_pageSize);
|
|
48
|
-
console.log("_pageSize=======", _pageSize);
|
|
49
48
|
if (_pageSize === pageSize) {
|
|
50
49
|
return;
|
|
51
50
|
}
|
|
@@ -55,7 +54,8 @@ var usePagination = function usePagination(_ref) {
|
|
|
55
54
|
pagination: paginationState,
|
|
56
55
|
changeAt: changeAt,
|
|
57
56
|
changePageSize: changePageSize,
|
|
58
|
-
isPaginationHidden: isPaginationHidden
|
|
57
|
+
isPaginationHidden: isPaginationHidden,
|
|
58
|
+
paginationProps: _pagination
|
|
59
59
|
};
|
|
60
60
|
};
|
|
61
61
|
|
|
@@ -6,5 +6,6 @@ declare const usePagination: ({ pagination }: UsingPagination) => {
|
|
|
6
6
|
changeAt: (_at: number) => void;
|
|
7
7
|
changePageSize: (_pageSize: number) => void;
|
|
8
8
|
isPaginationHidden: boolean;
|
|
9
|
+
paginationProps: import("../../../types/pagination").PagiantionProps | null;
|
|
9
10
|
};
|
|
10
11
|
export { usePagination };
|
|
@@ -43,7 +43,6 @@ var usePagination = function usePagination(_ref) {
|
|
|
43
43
|
var changePageSize = useEvent(function (_pageSize) {
|
|
44
44
|
var _pagination$onPageSiz;
|
|
45
45
|
setPageSize(_pageSize);
|
|
46
|
-
console.log("_pageSize=======", _pageSize);
|
|
47
46
|
if (_pageSize === pageSize) {
|
|
48
47
|
return;
|
|
49
48
|
}
|
|
@@ -53,7 +52,8 @@ var usePagination = function usePagination(_ref) {
|
|
|
53
52
|
pagination: paginationState,
|
|
54
53
|
changeAt: changeAt,
|
|
55
54
|
changePageSize: changePageSize,
|
|
56
|
-
isPaginationHidden: isPaginationHidden
|
|
55
|
+
isPaginationHidden: isPaginationHidden,
|
|
56
|
+
paginationProps: _pagination
|
|
57
57
|
};
|
|
58
58
|
};
|
|
59
59
|
|
|
@@ -20,6 +20,7 @@ var pagination = require('../pagination/pagination.cjs');
|
|
|
20
20
|
var usePagination_hook = require('./hooks/use-pagination.hook.cjs');
|
|
21
21
|
|
|
22
22
|
var Table = function Table(_ref) {
|
|
23
|
+
var _paginationProps$tota;
|
|
23
24
|
var _ref$bordered = _ref.bordered,
|
|
24
25
|
bordered = _ref$bordered === void 0 ? false : _ref$bordered,
|
|
25
26
|
_ref$dataSource = _ref.dataSource,
|
|
@@ -59,7 +60,8 @@ var Table = function Table(_ref) {
|
|
|
59
60
|
pagination$1 = _usePagination.pagination,
|
|
60
61
|
isPaginationHidden = _usePagination.isPaginationHidden,
|
|
61
62
|
changeAt = _usePagination.changeAt,
|
|
62
|
-
changePageSize = _usePagination.changePageSize
|
|
63
|
+
changePageSize = _usePagination.changePageSize,
|
|
64
|
+
paginationProps = _usePagination.paginationProps;
|
|
63
65
|
var expanded = React.useMemo(function () {
|
|
64
66
|
return relax.isUndefined(expandedKeys) ? uncontrolledExpanded : Object.fromEntries(expandedKeys.map(function (key) {
|
|
65
67
|
return [String(key), true];
|
|
@@ -119,11 +121,11 @@ var Table = function Table(_ref) {
|
|
|
119
121
|
}, /*#__PURE__*/React.createElement("table", {
|
|
120
122
|
className: className.stringify(classNames.table, className$1, styled.table.className),
|
|
121
123
|
style: _objectSpread(_objectSpread({}, styled.table.style), style)
|
|
122
|
-
}, /*#__PURE__*/React.createElement(header.default, null), /*#__PURE__*/React.createElement(body.default, null)),
|
|
124
|
+
}, /*#__PURE__*/React.createElement(header.default, null), /*#__PURE__*/React.createElement(body.default, null)), !isPaginationHidden && (/*#__PURE__*/React.createElement("div", {
|
|
123
125
|
className: styled.pagination.className,
|
|
124
126
|
style: styled.pagination.style
|
|
125
127
|
}, /*#__PURE__*/React.createElement(pagination.default, {
|
|
126
|
-
total: dataSource.length,
|
|
128
|
+
total: (_paginationProps$tota = paginationProps === null || paginationProps === void 0 ? void 0 : paginationProps.total) !== null && _paginationProps$tota !== void 0 ? _paginationProps$tota : dataSource.length,
|
|
127
129
|
at: pagination$1.pageIndex - 1,
|
|
128
130
|
pageSize: pagination$1.pageSize,
|
|
129
131
|
onChange: changeAt,
|
|
@@ -16,6 +16,7 @@ import Pagination from '../pagination/pagination.mjs';
|
|
|
16
16
|
import { usePagination } from './hooks/use-pagination.hook.mjs';
|
|
17
17
|
|
|
18
18
|
var Table = function Table(_ref) {
|
|
19
|
+
var _paginationProps$tota;
|
|
19
20
|
var _ref$bordered = _ref.bordered,
|
|
20
21
|
bordered = _ref$bordered === void 0 ? false : _ref$bordered,
|
|
21
22
|
_ref$dataSource = _ref.dataSource,
|
|
@@ -55,7 +56,8 @@ var Table = function Table(_ref) {
|
|
|
55
56
|
pagination = _usePagination.pagination,
|
|
56
57
|
isPaginationHidden = _usePagination.isPaginationHidden,
|
|
57
58
|
changeAt = _usePagination.changeAt,
|
|
58
|
-
changePageSize = _usePagination.changePageSize
|
|
59
|
+
changePageSize = _usePagination.changePageSize,
|
|
60
|
+
paginationProps = _usePagination.paginationProps;
|
|
59
61
|
var expanded = useMemo(function () {
|
|
60
62
|
return isUndefined(expandedKeys) ? uncontrolledExpanded : Object.fromEntries(expandedKeys.map(function (key) {
|
|
61
63
|
return [String(key), true];
|
|
@@ -115,11 +117,11 @@ var Table = function Table(_ref) {
|
|
|
115
117
|
}, /*#__PURE__*/React.createElement("table", {
|
|
116
118
|
className: stringify(classNames.table, className, styled.table.className),
|
|
117
119
|
style: _objectSpread(_objectSpread({}, styled.table.style), style)
|
|
118
|
-
}, /*#__PURE__*/React.createElement(Header, null), /*#__PURE__*/React.createElement(Body, null)),
|
|
120
|
+
}, /*#__PURE__*/React.createElement(Header, null), /*#__PURE__*/React.createElement(Body, null)), !isPaginationHidden && (/*#__PURE__*/React.createElement("div", {
|
|
119
121
|
className: styled.pagination.className,
|
|
120
122
|
style: styled.pagination.style
|
|
121
123
|
}, /*#__PURE__*/React.createElement(Pagination, {
|
|
122
|
-
total: dataSource.length,
|
|
124
|
+
total: (_paginationProps$tota = paginationProps === null || paginationProps === void 0 ? void 0 : paginationProps.total) !== null && _paginationProps$tota !== void 0 ? _paginationProps$tota : dataSource.length,
|
|
123
125
|
at: pagination.pageIndex - 1,
|
|
124
126
|
pageSize: pagination.pageSize,
|
|
125
127
|
onChange: changeAt,
|