react-bootstrap-table-ng-paginator 5.19.2 → 5.19.3
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/react-bootstrap-table-ng-paginator.js +2 -2
- package/dist/react-bootstrap-table-ng-paginator.min.js +2 -2
- package/lib/index.d.ts +4 -72
- package/lib/index.js +45 -5
- package/lib/index.js.map +1 -1
- package/lib/src/data-context.d.ts +1 -77
- package/lib/src/data-context.js +76 -99
- package/lib/src/data-context.js.map +1 -1
- package/lib/src/hooks/usePagination.d.ts +33 -0
- package/lib/src/hooks/usePagination.js +213 -0
- package/lib/src/hooks/usePagination.js.map +1 -0
- package/lib/src/hooks/usePaginationState.d.ts +16 -0
- package/lib/src/hooks/usePaginationState.js +167 -0
- package/lib/src/hooks/usePaginationState.js.map +1 -0
- package/lib/src/page-button.d.ts +2 -6
- package/lib/src/page-button.js +26 -95
- package/lib/src/page-button.js.map +1 -1
- package/lib/src/pagination-handler.d.ts +1 -42
- package/lib/src/pagination-handler.js +44 -152
- package/lib/src/pagination-handler.js.map +1 -1
- package/lib/src/pagination-list-adapter.d.ts +2 -152
- package/lib/src/pagination-list-adapter.js +54 -83
- package/lib/src/pagination-list-adapter.js.map +1 -1
- package/lib/src/pagination-list-standalone.d.ts +1 -1
- package/lib/src/pagination-total-adapter.d.ts +2 -152
- package/lib/src/pagination-total-adapter.js +50 -78
- package/lib/src/pagination-total-adapter.js.map +1 -1
- package/lib/src/pagination-total-standalone.d.ts +1 -1
- package/lib/src/pagination.d.ts +2 -43
- package/lib/src/pagination.js +135 -199
- package/lib/src/pagination.js.map +1 -1
- package/lib/src/size-per-page-dropdown-adapter.d.ts +2 -92
- package/lib/src/size-per-page-dropdown-adapter.js +94 -88
- package/lib/src/size-per-page-dropdown-adapter.js.map +1 -1
- package/lib/src/size-per-page-dropdown-standalone.d.ts +1 -1
- package/lib/src/size-per-page-dropdown.js +2 -1
- package/lib/src/size-per-page-dropdown.js.map +1 -1
- package/lib/src/size-per-page-option.js +6 -0
- package/lib/src/size-per-page-option.js.map +1 -1
- package/lib/src/standalone-adapter.d.ts +1 -1
- package/lib/src/standalone-adapter.js +52 -13
- package/lib/src/standalone-adapter.js.map +1 -1
- package/lib/src/state-context.d.ts +3 -52
- package/lib/src/state-context.js +26 -195
- package/lib/src/state-context.js.map +1 -1
- package/package.json +3 -3
- package/lib/src/page-resolver.d.ts +0 -78
- package/lib/src/page-resolver.js +0 -199
- package/lib/src/page-resolver.js.map +0 -1
|
@@ -4,59 +4,8 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
4
4
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
5
5
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
6
6
|
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
7
|
-
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
8
|
-
function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
|
|
9
|
-
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
10
7
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
11
8
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
12
|
-
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
13
|
-
function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); }
|
|
14
|
-
function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; }
|
|
15
|
-
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
16
|
-
function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }
|
|
17
|
-
function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); }
|
|
18
|
-
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
|
|
19
|
-
var __createBinding = void 0 && (void 0).__createBinding || (Object.create ? function (o, m, k, k2) {
|
|
20
|
-
if (k2 === undefined) k2 = k;
|
|
21
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
22
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
23
|
-
desc = {
|
|
24
|
-
enumerable: true,
|
|
25
|
-
get: function get() {
|
|
26
|
-
return m[k];
|
|
27
|
-
}
|
|
28
|
-
};
|
|
29
|
-
}
|
|
30
|
-
Object.defineProperty(o, k2, desc);
|
|
31
|
-
} : function (o, m, k, k2) {
|
|
32
|
-
if (k2 === undefined) k2 = k;
|
|
33
|
-
o[k2] = m[k];
|
|
34
|
-
});
|
|
35
|
-
var __setModuleDefault = void 0 && (void 0).__setModuleDefault || (Object.create ? function (o, v) {
|
|
36
|
-
Object.defineProperty(o, "default", {
|
|
37
|
-
enumerable: true,
|
|
38
|
-
value: v
|
|
39
|
-
});
|
|
40
|
-
} : function (o, v) {
|
|
41
|
-
o["default"] = v;
|
|
42
|
-
});
|
|
43
|
-
var __importStar = void 0 && (void 0).__importStar || function () {
|
|
44
|
-
var _ownKeys = function ownKeys(o) {
|
|
45
|
-
_ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
46
|
-
var ar = [];
|
|
47
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
48
|
-
return ar;
|
|
49
|
-
};
|
|
50
|
-
return _ownKeys(o);
|
|
51
|
-
};
|
|
52
|
-
return function (mod) {
|
|
53
|
-
if (mod && mod.__esModule) return mod;
|
|
54
|
-
var result = {};
|
|
55
|
-
if (mod != null) for (var k = _ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
56
|
-
__setModuleDefault(result, mod);
|
|
57
|
-
return result;
|
|
58
|
-
};
|
|
59
|
-
}();
|
|
60
9
|
var __importDefault = void 0 && (void 0).__importDefault || function (mod) {
|
|
61
10
|
return mod && mod.__esModule ? mod : {
|
|
62
11
|
"default": mod
|
|
@@ -65,106 +14,49 @@ var __importDefault = void 0 && (void 0).__importDefault || function (mod) {
|
|
|
65
14
|
Object.defineProperty(exports, "__esModule", {
|
|
66
15
|
value: true
|
|
67
16
|
});
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
var react_1 = __importStar(require("react"));
|
|
71
|
-
var page_resolver_1 = __importDefault(require("./page-resolver"));
|
|
17
|
+
var react_1 = __importDefault(require("react"));
|
|
18
|
+
var usePagination_1 = require("./hooks/usePagination");
|
|
72
19
|
exports["default"] = function (WrappedComponent) {
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
var _this$props = this.props,
|
|
116
|
-
currSizePerPage = _this$props.currSizePerPage,
|
|
117
|
-
onSizePerPageChange = _this$props.onSizePerPageChange;
|
|
118
|
-
var selectedSize = typeof sizePerPage === "string" ? parseInt(sizePerPage, 10) : sizePerPage;
|
|
119
|
-
var currPage = this.props.currPage;
|
|
120
|
-
if (selectedSize !== currSizePerPage) {
|
|
121
|
-
var newTotalPages = this.calculateTotalPage(selectedSize);
|
|
122
|
-
var newLastPage = this.calculateLastPage(newTotalPages);
|
|
123
|
-
if (currPage > newLastPage) currPage = newLastPage;
|
|
124
|
-
onSizePerPageChange(selectedSize, currPage);
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
}, {
|
|
128
|
-
key: "handleChangePage",
|
|
129
|
-
value: function handleChangePage(newPage) {
|
|
130
|
-
var page;
|
|
131
|
-
var _this$props2 = this.props,
|
|
132
|
-
currPage = _this$props2.currPage,
|
|
133
|
-
pageStartIndex = _this$props2.pageStartIndex,
|
|
134
|
-
prePageText = _this$props2.prePageText,
|
|
135
|
-
nextPageText = _this$props2.nextPageText,
|
|
136
|
-
lastPageText = _this$props2.lastPageText,
|
|
137
|
-
firstPageText = _this$props2.firstPageText,
|
|
138
|
-
onPageChange = _this$props2.onPageChange;
|
|
139
|
-
// @ts-ignore
|
|
140
|
-
var lastPage = this.state.lastPage;
|
|
141
|
-
if (newPage === prePageText) {
|
|
142
|
-
page = this.backToPrevPage();
|
|
143
|
-
} else if (newPage === nextPageText) {
|
|
144
|
-
page = currPage + 1 > lastPage ? lastPage : currPage + 1;
|
|
145
|
-
} else if (newPage === lastPageText) {
|
|
146
|
-
page = lastPage;
|
|
147
|
-
} else if (newPage === firstPageText) {
|
|
148
|
-
page = pageStartIndex;
|
|
149
|
-
} else {
|
|
150
|
-
page = parseInt(newPage, 10);
|
|
151
|
-
}
|
|
152
|
-
if (page !== currPage) {
|
|
153
|
-
onPageChange(page);
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
}, {
|
|
157
|
-
key: "render",
|
|
158
|
-
value: function render() {
|
|
159
|
-
return react_1["default"].createElement(WrappedComponent, _objectSpread(_objectSpread({}, this.props), {}, {
|
|
160
|
-
// @ts-ignore
|
|
161
|
-
lastPage: this.state.lastPage,
|
|
162
|
-
// @ts-ignore
|
|
163
|
-
totalPages: this.state.totalPages,
|
|
164
|
-
onPageChange: this.handleChangePage,
|
|
165
|
-
onSizePerPageChange: this.handleChangeSizePerPage
|
|
166
|
-
}));
|
|
167
|
-
}
|
|
168
|
-
}]);
|
|
169
|
-
}((0, page_resolver_1["default"])(react_1.Component));
|
|
20
|
+
var PaginationHandler = function PaginationHandler(props) {
|
|
21
|
+
var currPage = props.currPage,
|
|
22
|
+
currSizePerPage = props.currSizePerPage,
|
|
23
|
+
dataSize = props.dataSize,
|
|
24
|
+
totalSize = props.totalSize,
|
|
25
|
+
pageStartIndex = props.pageStartIndex,
|
|
26
|
+
paginationSize = props.paginationSize,
|
|
27
|
+
withFirstAndLast = props.withFirstAndLast,
|
|
28
|
+
firstPageText = props.firstPageText,
|
|
29
|
+
prePageText = props.prePageText,
|
|
30
|
+
nextPageText = props.nextPageText,
|
|
31
|
+
lastPageText = props.lastPageText,
|
|
32
|
+
alwaysShowAllBtns = props.alwaysShowAllBtns,
|
|
33
|
+
onPageChange = props.onPageChange,
|
|
34
|
+
onSizePerPageChange = props.onSizePerPageChange;
|
|
35
|
+
var _ref = (0, usePagination_1.usePagination)({
|
|
36
|
+
currPage: currPage,
|
|
37
|
+
currSizePerPage: currSizePerPage,
|
|
38
|
+
dataSize: totalSize !== null && totalSize !== void 0 ? totalSize : dataSize,
|
|
39
|
+
pageStartIndex: pageStartIndex,
|
|
40
|
+
paginationSize: paginationSize,
|
|
41
|
+
withFirstAndLast: withFirstAndLast,
|
|
42
|
+
firstPageText: firstPageText,
|
|
43
|
+
prePageText: prePageText,
|
|
44
|
+
nextPageText: nextPageText,
|
|
45
|
+
lastPageText: lastPageText,
|
|
46
|
+
alwaysShowAllBtns: alwaysShowAllBtns,
|
|
47
|
+
onPageChange: onPageChange,
|
|
48
|
+
onSizePerPageChange: onSizePerPageChange
|
|
49
|
+
}),
|
|
50
|
+
totalPages = _ref.totalPages,
|
|
51
|
+
lastPage = _ref.lastPage,
|
|
52
|
+
handleChangePage = _ref.handleChangePage,
|
|
53
|
+
handleChangeSizePerPage = _ref.handleChangeSizePerPage;
|
|
54
|
+
return react_1["default"].createElement(WrappedComponent, _objectSpread(_objectSpread({}, props), {}, {
|
|
55
|
+
lastPage: lastPage,
|
|
56
|
+
totalPages: totalPages,
|
|
57
|
+
onPageChange: handleChangePage,
|
|
58
|
+
onSizePerPageChange: handleChangeSizePerPage
|
|
59
|
+
}));
|
|
60
|
+
};
|
|
61
|
+
return PaginationHandler;
|
|
170
62
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pagination-handler.js","sourceRoot":"","sources":["pagination-handler.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"pagination-handler.js","sourceRoot":"","sources":["pagination-handler.tsx"],"names":[],"mappings":";;;;;AAAA,kDAAkC;AAClC,yDAAsD;AAEtD,kBAAe,CAAC,gBAAqB,EAAE,EAAE;IACvC,MAAM,iBAAiB,GAAY,CAAC,KAAK,EAAE,EAAE;QAC3C,MAAM,EACJ,QAAQ,EACR,eAAe,EACf,QAAQ,EACR,SAAS,EACT,cAAc,EACd,cAAc,EACd,gBAAgB,EAChB,aAAa,EACb,WAAW,EACX,YAAY,EACZ,YAAY,EACZ,iBAAiB,EACjB,YAAY,EACZ,mBAAmB,GACpB,GAAG,KAAK,CAAC;QAEV,MAAM,EACJ,UAAU,EACV,QAAQ,EACR,gBAAgB,EAChB,uBAAuB,GACxB,GAAG,IAAA,6BAAa,EAAC;YAChB,QAAQ;YACR,eAAe;YACf,QAAQ,EAAE,SAAS,IAAI,QAAQ;YAC/B,cAAc;YACd,cAAc;YACd,gBAAgB;YAChB,aAAa;YACb,WAAW;YACX,YAAY;YACZ,YAAY;YACZ,iBAAiB;YACjB,YAAY;YACZ,mBAAmB;SACb,CAAC,CAAC;QAEV,OAAO,CACL,8BAAC,gBAAgB,OACX,KAAK,EACT,QAAQ,EAAE,QAAQ,EAClB,UAAU,EAAE,UAAU,EACtB,YAAY,EAAE,gBAAgB,EAC9B,mBAAmB,EAAE,uBAAuB,GAC5C,CACH,CAAC;IACJ,CAAC,CAAC;IAEF,OAAO,iBAAiB,CAAC;AAC3B,CAAC,CAAC"}
|
|
@@ -1,154 +1,4 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
declare const paginationListAdapter: (WrappedComponent: any) =>
|
|
3
|
-
|
|
4
|
-
render(): React.JSX.Element | null;
|
|
5
|
-
backToPrevPage(): any;
|
|
6
|
-
initialState(): {
|
|
7
|
-
totalPages: number;
|
|
8
|
-
lastPage: number;
|
|
9
|
-
};
|
|
10
|
-
calculateTotalPage(sizePerPage?: any, dataSize?: any): number;
|
|
11
|
-
calculateLastPage(totalPages: any): number;
|
|
12
|
-
calculateFromTo(): number[];
|
|
13
|
-
calculatePages(totalPages: any, lastPage: any): any;
|
|
14
|
-
calculatePageStatus(pages: never[] | undefined, lastPage: any, disablePageTitle?: boolean): {
|
|
15
|
-
page: never;
|
|
16
|
-
active: boolean;
|
|
17
|
-
disabled: boolean;
|
|
18
|
-
title: any;
|
|
19
|
-
}[];
|
|
20
|
-
calculateSizePerPageStatus(): any;
|
|
21
|
-
context: unknown;
|
|
22
|
-
setState<K extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<any>) => {} | Pick<{}, K> | null) | Pick<{}, K> | null, callback?: (() => void) | undefined): void;
|
|
23
|
-
forceUpdate(callback?: (() => void) | undefined): void;
|
|
24
|
-
readonly props: Readonly<any>;
|
|
25
|
-
state: Readonly<{}>;
|
|
26
|
-
componentDidMount?(): void;
|
|
27
|
-
shouldComponentUpdate?(nextProps: Readonly<any>, nextState: Readonly<{}>, nextContext: any): boolean;
|
|
28
|
-
componentWillUnmount?(): void;
|
|
29
|
-
componentDidCatch?(error: Error, errorInfo: React.ErrorInfo): void;
|
|
30
|
-
getSnapshotBeforeUpdate?(prevProps: Readonly<any>, prevState: Readonly<{}>): any;
|
|
31
|
-
componentDidUpdate?(prevProps: Readonly<any>, prevState: Readonly<{}>, snapshot?: any): void;
|
|
32
|
-
componentWillMount?(): void;
|
|
33
|
-
UNSAFE_componentWillMount?(): void;
|
|
34
|
-
componentWillReceiveProps?(nextProps: Readonly<any>, nextContext: any): void;
|
|
35
|
-
UNSAFE_componentWillReceiveProps?(nextProps: Readonly<any>, nextContext: any): void;
|
|
36
|
-
componentWillUpdate?(nextProps: Readonly<any>, nextState: Readonly<{}>, nextContext: any): void;
|
|
37
|
-
UNSAFE_componentWillUpdate?(nextProps: Readonly<any>, nextState: Readonly<{}>, nextContext: any): void;
|
|
38
|
-
};
|
|
39
|
-
new (props: any, context: any): {
|
|
40
|
-
render(): React.JSX.Element | null;
|
|
41
|
-
backToPrevPage(): any;
|
|
42
|
-
initialState(): {
|
|
43
|
-
totalPages: number;
|
|
44
|
-
lastPage: number;
|
|
45
|
-
};
|
|
46
|
-
calculateTotalPage(sizePerPage?: any, dataSize?: any): number;
|
|
47
|
-
calculateLastPage(totalPages: any): number;
|
|
48
|
-
calculateFromTo(): number[];
|
|
49
|
-
calculatePages(totalPages: any, lastPage: any): any;
|
|
50
|
-
calculatePageStatus(pages: never[] | undefined, lastPage: any, disablePageTitle?: boolean): {
|
|
51
|
-
page: never;
|
|
52
|
-
active: boolean;
|
|
53
|
-
disabled: boolean;
|
|
54
|
-
title: any;
|
|
55
|
-
}[];
|
|
56
|
-
calculateSizePerPageStatus(): any;
|
|
57
|
-
context: unknown;
|
|
58
|
-
setState<K extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<any>) => {} | Pick<{}, K> | null) | Pick<{}, K> | null, callback?: (() => void) | undefined): void;
|
|
59
|
-
forceUpdate(callback?: (() => void) | undefined): void;
|
|
60
|
-
readonly props: Readonly<any>;
|
|
61
|
-
state: Readonly<{}>;
|
|
62
|
-
componentDidMount?(): void;
|
|
63
|
-
shouldComponentUpdate?(nextProps: Readonly<any>, nextState: Readonly<{}>, nextContext: any): boolean;
|
|
64
|
-
componentWillUnmount?(): void;
|
|
65
|
-
componentDidCatch?(error: Error, errorInfo: React.ErrorInfo): void;
|
|
66
|
-
getSnapshotBeforeUpdate?(prevProps: Readonly<any>, prevState: Readonly<{}>): any;
|
|
67
|
-
componentDidUpdate?(prevProps: Readonly<any>, prevState: Readonly<{}>, snapshot?: any): void;
|
|
68
|
-
componentWillMount?(): void;
|
|
69
|
-
UNSAFE_componentWillMount?(): void;
|
|
70
|
-
componentWillReceiveProps?(nextProps: Readonly<any>, nextContext: any): void;
|
|
71
|
-
UNSAFE_componentWillReceiveProps?(nextProps: Readonly<any>, nextContext: any): void;
|
|
72
|
-
componentWillUpdate?(nextProps: Readonly<any>, nextState: Readonly<{}>, nextContext: any): void;
|
|
73
|
-
UNSAFE_componentWillUpdate?(nextProps: Readonly<any>, nextState: Readonly<{}>, nextContext: any): void;
|
|
74
|
-
};
|
|
75
|
-
contextType?: React.Context<any> | undefined;
|
|
76
|
-
propTypes?: any;
|
|
77
|
-
};
|
|
78
|
-
export declare const PaginationListWithAdapter: {
|
|
79
|
-
new (props: any): {
|
|
80
|
-
render(): React.JSX.Element | null;
|
|
81
|
-
backToPrevPage(): any;
|
|
82
|
-
initialState(): {
|
|
83
|
-
totalPages: number;
|
|
84
|
-
lastPage: number;
|
|
85
|
-
};
|
|
86
|
-
calculateTotalPage(sizePerPage?: any, dataSize?: any): number;
|
|
87
|
-
calculateLastPage(totalPages: any): number;
|
|
88
|
-
calculateFromTo(): number[];
|
|
89
|
-
calculatePages(totalPages: any, lastPage: any): any;
|
|
90
|
-
calculatePageStatus(pages: never[] | undefined, lastPage: any, disablePageTitle?: boolean): {
|
|
91
|
-
page: never;
|
|
92
|
-
active: boolean;
|
|
93
|
-
disabled: boolean;
|
|
94
|
-
title: any;
|
|
95
|
-
}[];
|
|
96
|
-
calculateSizePerPageStatus(): any;
|
|
97
|
-
context: unknown;
|
|
98
|
-
setState<K extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<any>) => {} | Pick<{}, K> | null) | Pick<{}, K> | null, callback?: (() => void) | undefined): void;
|
|
99
|
-
forceUpdate(callback?: (() => void) | undefined): void;
|
|
100
|
-
readonly props: Readonly<any>;
|
|
101
|
-
state: Readonly<{}>;
|
|
102
|
-
componentDidMount?(): void;
|
|
103
|
-
shouldComponentUpdate?(nextProps: Readonly<any>, nextState: Readonly<{}>, nextContext: any): boolean;
|
|
104
|
-
componentWillUnmount?(): void;
|
|
105
|
-
componentDidCatch?(error: Error, errorInfo: React.ErrorInfo): void;
|
|
106
|
-
getSnapshotBeforeUpdate?(prevProps: Readonly<any>, prevState: Readonly<{}>): any;
|
|
107
|
-
componentDidUpdate?(prevProps: Readonly<any>, prevState: Readonly<{}>, snapshot?: any): void;
|
|
108
|
-
componentWillMount?(): void;
|
|
109
|
-
UNSAFE_componentWillMount?(): void;
|
|
110
|
-
componentWillReceiveProps?(nextProps: Readonly<any>, nextContext: any): void;
|
|
111
|
-
UNSAFE_componentWillReceiveProps?(nextProps: Readonly<any>, nextContext: any): void;
|
|
112
|
-
componentWillUpdate?(nextProps: Readonly<any>, nextState: Readonly<{}>, nextContext: any): void;
|
|
113
|
-
UNSAFE_componentWillUpdate?(nextProps: Readonly<any>, nextState: Readonly<{}>, nextContext: any): void;
|
|
114
|
-
};
|
|
115
|
-
new (props: any, context: any): {
|
|
116
|
-
render(): React.JSX.Element | null;
|
|
117
|
-
backToPrevPage(): any;
|
|
118
|
-
initialState(): {
|
|
119
|
-
totalPages: number;
|
|
120
|
-
lastPage: number;
|
|
121
|
-
};
|
|
122
|
-
calculateTotalPage(sizePerPage?: any, dataSize?: any): number;
|
|
123
|
-
calculateLastPage(totalPages: any): number;
|
|
124
|
-
calculateFromTo(): number[];
|
|
125
|
-
calculatePages(totalPages: any, lastPage: any): any;
|
|
126
|
-
calculatePageStatus(pages: never[] | undefined, lastPage: any, disablePageTitle?: boolean): {
|
|
127
|
-
page: never;
|
|
128
|
-
active: boolean;
|
|
129
|
-
disabled: boolean;
|
|
130
|
-
title: any;
|
|
131
|
-
}[];
|
|
132
|
-
calculateSizePerPageStatus(): any;
|
|
133
|
-
context: unknown;
|
|
134
|
-
setState<K extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<any>) => {} | Pick<{}, K> | null) | Pick<{}, K> | null, callback?: (() => void) | undefined): void;
|
|
135
|
-
forceUpdate(callback?: (() => void) | undefined): void;
|
|
136
|
-
readonly props: Readonly<any>;
|
|
137
|
-
state: Readonly<{}>;
|
|
138
|
-
componentDidMount?(): void;
|
|
139
|
-
shouldComponentUpdate?(nextProps: Readonly<any>, nextState: Readonly<{}>, nextContext: any): boolean;
|
|
140
|
-
componentWillUnmount?(): void;
|
|
141
|
-
componentDidCatch?(error: Error, errorInfo: React.ErrorInfo): void;
|
|
142
|
-
getSnapshotBeforeUpdate?(prevProps: Readonly<any>, prevState: Readonly<{}>): any;
|
|
143
|
-
componentDidUpdate?(prevProps: Readonly<any>, prevState: Readonly<{}>, snapshot?: any): void;
|
|
144
|
-
componentWillMount?(): void;
|
|
145
|
-
UNSAFE_componentWillMount?(): void;
|
|
146
|
-
componentWillReceiveProps?(nextProps: Readonly<any>, nextContext: any): void;
|
|
147
|
-
UNSAFE_componentWillReceiveProps?(nextProps: Readonly<any>, nextContext: any): void;
|
|
148
|
-
componentWillUpdate?(nextProps: Readonly<any>, nextState: Readonly<{}>, nextContext: any): void;
|
|
149
|
-
UNSAFE_componentWillUpdate?(nextProps: Readonly<any>, nextState: Readonly<{}>, nextContext: any): void;
|
|
150
|
-
};
|
|
151
|
-
contextType?: React.Context<any> | undefined;
|
|
152
|
-
propTypes?: any;
|
|
153
|
-
};
|
|
2
|
+
declare const paginationListAdapter: (WrappedComponent: any) => (props: any) => React.JSX.Element | null;
|
|
3
|
+
export declare const PaginationListWithAdapter: (props: any) => React.JSX.Element | null;
|
|
154
4
|
export default paginationListAdapter;
|
|
@@ -1,59 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
4
|
-
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
5
|
-
function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
|
|
6
|
-
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
7
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
8
|
-
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
9
|
-
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
10
|
-
function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); }
|
|
11
|
-
function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; }
|
|
12
|
-
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
13
|
-
function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }
|
|
14
|
-
function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); }
|
|
15
|
-
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
|
|
16
|
-
var __createBinding = void 0 && (void 0).__createBinding || (Object.create ? function (o, m, k, k2) {
|
|
17
|
-
if (k2 === undefined) k2 = k;
|
|
18
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
19
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
20
|
-
desc = {
|
|
21
|
-
enumerable: true,
|
|
22
|
-
get: function get() {
|
|
23
|
-
return m[k];
|
|
24
|
-
}
|
|
25
|
-
};
|
|
26
|
-
}
|
|
27
|
-
Object.defineProperty(o, k2, desc);
|
|
28
|
-
} : function (o, m, k, k2) {
|
|
29
|
-
if (k2 === undefined) k2 = k;
|
|
30
|
-
o[k2] = m[k];
|
|
31
|
-
});
|
|
32
|
-
var __setModuleDefault = void 0 && (void 0).__setModuleDefault || (Object.create ? function (o, v) {
|
|
33
|
-
Object.defineProperty(o, "default", {
|
|
34
|
-
enumerable: true,
|
|
35
|
-
value: v
|
|
36
|
-
});
|
|
37
|
-
} : function (o, v) {
|
|
38
|
-
o["default"] = v;
|
|
39
|
-
});
|
|
40
|
-
var __importStar = void 0 && (void 0).__importStar || function () {
|
|
41
|
-
var _ownKeys = function ownKeys(o) {
|
|
42
|
-
_ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
43
|
-
var ar = [];
|
|
44
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
45
|
-
return ar;
|
|
46
|
-
};
|
|
47
|
-
return _ownKeys(o);
|
|
48
|
-
};
|
|
49
|
-
return function (mod) {
|
|
50
|
-
if (mod && mod.__esModule) return mod;
|
|
51
|
-
var result = {};
|
|
52
|
-
if (mod != null) for (var k = _ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
53
|
-
__setModuleDefault(result, mod);
|
|
54
|
-
return result;
|
|
55
|
-
};
|
|
56
|
-
}();
|
|
57
3
|
var __importDefault = void 0 && (void 0).__importDefault || function (mod) {
|
|
58
4
|
return mod && mod.__esModule ? mod : {
|
|
59
5
|
"default": mod
|
|
@@ -64,38 +10,63 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
64
10
|
});
|
|
65
11
|
exports.PaginationListWithAdapter = void 0;
|
|
66
12
|
/* eslint react/prop-types: 0 */
|
|
67
|
-
var react_1 =
|
|
68
|
-
var
|
|
13
|
+
var react_1 = __importDefault(require("react"));
|
|
14
|
+
var usePagination_1 = require("./hooks/usePagination");
|
|
69
15
|
var pagination_list_1 = __importDefault(require("./pagination-list"));
|
|
70
16
|
var paginationListAdapter = function paginationListAdapter(WrappedComponent) {
|
|
71
|
-
return
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
17
|
+
return function (props) {
|
|
18
|
+
var lastPage = props.lastPage,
|
|
19
|
+
totalPages = props.totalPages,
|
|
20
|
+
pageButtonRenderer = props.pageButtonRenderer,
|
|
21
|
+
onPageChange = props.onPageChange,
|
|
22
|
+
disablePageTitle = props.disablePageTitle,
|
|
23
|
+
hidePageListOnlyOnePage = props.hidePageListOnlyOnePage,
|
|
24
|
+
currPage = props.currPage,
|
|
25
|
+
currSizePerPage = props.currSizePerPage,
|
|
26
|
+
dataSize = props.dataSize,
|
|
27
|
+
pageStartIndex = props.pageStartIndex,
|
|
28
|
+
paginationSize = props.paginationSize,
|
|
29
|
+
withFirstAndLast = props.withFirstAndLast,
|
|
30
|
+
alwaysShowAllBtns = props.alwaysShowAllBtns,
|
|
31
|
+
firstPageText = props.firstPageText,
|
|
32
|
+
prePageText = props.prePageText,
|
|
33
|
+
nextPageText = props.nextPageText,
|
|
34
|
+
lastPageText = props.lastPageText,
|
|
35
|
+
nextPageTitle = props.nextPageTitle,
|
|
36
|
+
prePageTitle = props.prePageTitle,
|
|
37
|
+
firstPageTitle = props.firstPageTitle,
|
|
38
|
+
lastPageTitle = props.lastPageTitle;
|
|
39
|
+
var _ref = (0, usePagination_1.usePagination)({
|
|
40
|
+
currPage: currPage,
|
|
41
|
+
currSizePerPage: currSizePerPage,
|
|
42
|
+
dataSize: dataSize,
|
|
43
|
+
pageStartIndex: pageStartIndex,
|
|
44
|
+
paginationSize: paginationSize,
|
|
45
|
+
withFirstAndLast: withFirstAndLast,
|
|
46
|
+
alwaysShowAllBtns: alwaysShowAllBtns,
|
|
47
|
+
firstPageText: firstPageText,
|
|
48
|
+
prePageText: prePageText,
|
|
49
|
+
nextPageText: nextPageText,
|
|
50
|
+
lastPageText: lastPageText,
|
|
51
|
+
sizePerPageList: props.sizePerPageList || [],
|
|
52
|
+
onPageChange: onPageChange,
|
|
53
|
+
nextPageTitle: nextPageTitle,
|
|
54
|
+
prePageTitle: prePageTitle,
|
|
55
|
+
firstPageTitle: firstPageTitle,
|
|
56
|
+
lastPageTitle: lastPageTitle,
|
|
57
|
+
disablePageTitle: disablePageTitle
|
|
58
|
+
}),
|
|
59
|
+
getPageStatus = _ref.getPageStatus;
|
|
60
|
+
var pages = getPageStatus();
|
|
61
|
+
if (totalPages === 1 && hidePageListOnlyOnePage) {
|
|
62
|
+
return null;
|
|
75
63
|
}
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
totalPages = _this$props.totalPages,
|
|
83
|
-
pageButtonRenderer = _this$props.pageButtonRenderer,
|
|
84
|
-
onPageChange = _this$props.onPageChange,
|
|
85
|
-
disablePageTitle = _this$props.disablePageTitle,
|
|
86
|
-
hidePageListOnlyOnePage = _this$props.hidePageListOnlyOnePage;
|
|
87
|
-
var pages = this.calculatePageStatus(this.calculatePages(totalPages, lastPage), lastPage, disablePageTitle);
|
|
88
|
-
if (totalPages === 1 && hidePageListOnlyOnePage) {
|
|
89
|
-
return null;
|
|
90
|
-
}
|
|
91
|
-
return react_1["default"].createElement(WrappedComponent, {
|
|
92
|
-
pageButtonRenderer: pageButtonRenderer,
|
|
93
|
-
onPageChange: onPageChange,
|
|
94
|
-
pages: pages
|
|
95
|
-
});
|
|
96
|
-
}
|
|
97
|
-
}]);
|
|
98
|
-
}((0, page_resolver_1["default"])(react_1.Component));
|
|
64
|
+
return react_1["default"].createElement(WrappedComponent, {
|
|
65
|
+
pageButtonRenderer: pageButtonRenderer,
|
|
66
|
+
onPageChange: onPageChange,
|
|
67
|
+
pages: pages
|
|
68
|
+
});
|
|
69
|
+
};
|
|
99
70
|
};
|
|
100
71
|
exports.PaginationListWithAdapter = paginationListAdapter(pagination_list_1["default"]);
|
|
101
72
|
exports["default"] = paginationListAdapter;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pagination-list-adapter.js","sourceRoot":"","sources":["pagination-list-adapter.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"pagination-list-adapter.js","sourceRoot":"","sources":["pagination-list-adapter.tsx"],"names":[],"mappings":";;;;;;AAAA,gCAAgC;AAChC,kDAAyC;AAEzC,yDAAsD;AACtD,wEAA+C;AAE/C,MAAM,qBAAqB,GAAG,CAAC,gBAAqB,EAAE,EAAE;IACtD,OAAO,CAAC,KAAU,EAAE,EAAE;QACpB,MAAM,EACJ,QAAQ,EACR,UAAU,EACV,kBAAkB,EAClB,YAAY,EACZ,gBAAgB,EAChB,uBAAuB,EACvB,QAAQ,EACR,eAAe,EACf,QAAQ,EACR,cAAc,EACd,cAAc,EACd,gBAAgB,EAChB,iBAAiB,EACjB,aAAa,EACb,WAAW,EACX,YAAY,EACZ,YAAY,EACZ,aAAa,EACb,YAAY,EACZ,cAAc,EACd,aAAa,GACd,GAAG,KAAK,CAAC;QAEV,MAAM,EAAE,aAAa,EAAE,GAAG,IAAA,6BAAa,EAAC;YACtC,QAAQ;YACR,eAAe;YACf,QAAQ;YACR,cAAc;YACd,cAAc;YACd,gBAAgB;YAChB,iBAAiB;YACjB,aAAa;YACb,WAAW;YACX,YAAY;YACZ,YAAY;YACZ,eAAe,EAAE,KAAK,CAAC,eAAe,IAAI,EAAE;YAC5C,YAAY;YACZ,aAAa;YACb,YAAY;YACZ,cAAc;YACd,aAAa;YACb,gBAAgB;SACjB,CAAC,CAAC;QAEH,MAAM,KAAK,GAAG,aAAa,EAAE,CAAC;QAE9B,IAAI,UAAU,KAAK,CAAC,IAAI,uBAAuB,EAAE,CAAC;YAChD,OAAO,IAAI,CAAC;QACd,CAAC;QAED,OAAO,CACL,8BAAC,gBAAgB,IACf,kBAAkB,EAAE,kBAAkB,EACtC,YAAY,EAAE,YAAY,EAC1B,KAAK,EAAE,KAAK,GACZ,CACH,CAAC;IACJ,CAAC,CAAC;AACJ,CAAC,CAAC;AAEW,QAAA,yBAAyB,GAAG,qBAAqB,CAAC,yBAAc,CAAC,CAAC;AAC/E,kBAAe,qBAAqB,CAAC"}
|