@semcore/pagination 16.1.1-prerelease.4 → 16.1.2-prerelease.1
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/CHANGELOG.md +6 -0
- package/README.md +1 -31
- package/lib/cjs/Pagination.js +78 -89
- package/lib/cjs/Pagination.js.map +1 -1
- package/lib/cjs/index.d.js.map +1 -1
- package/lib/cjs/index.js +1 -1
- package/lib/cjs/index.js.map +1 -1
- package/lib/cjs/translations/__intergalactic-dynamic-locales.js +4 -5
- package/lib/cjs/translations/__intergalactic-dynamic-locales.js.map +1 -1
- package/lib/es6/Pagination.js +77 -88
- package/lib/es6/Pagination.js.map +1 -1
- package/lib/es6/index.d.js.map +1 -1
- package/lib/es6/index.js.map +1 -1
- package/lib/es6/translations/__intergalactic-dynamic-locales.js +2 -2
- package/lib/es6/translations/__intergalactic-dynamic-locales.js.map +1 -1
- package/lib/esm/Pagination.mjs +78 -86
- package/lib/esm/translations/__intergalactic-dynamic-locales.mjs +2 -2
- package/lib/types/index.d.ts +7 -6
- package/package.json +11 -11
package/lib/cjs/index.d.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.js","names":[],"sources":["../../src/index.d.ts"],"sourcesContent":["import { PropGetterFn, UnknownProperties, Intergalactic } from '@semcore/core';\nimport {
|
|
1
|
+
{"version":3,"file":"index.d.js","names":[],"sources":["../../src/index.d.ts"],"sourcesContent":["import type Button from '@semcore/button';\nimport type { PropGetterFn, UnknownProperties, Intergalactic } from '@semcore/core';\nimport type { WithI18nEnhanceProps } from '@semcore/core/lib/utils/enhances/i18nEnhance';\nimport type { BoxProps } from '@semcore/flex-box';\nimport type { InputProps } from '@semcore/input';\nimport type Input from '@semcore/input';\nimport type { TextProps } from '@semcore/typography';\n\n/** @deprecated */\nexport interface IPaginationProps extends PaginationProps, UnknownProperties {}\nexport type PaginationProps = BoxProps &\n WithI18nEnhanceProps & {\n /**\n * Total number of pages\n * @default 1\n */\n totalPages?: number;\n /**\n * Active page number\n * @default 1\n */\n currentPage?: number;\n /**\n * Callback for changing the active page\n * @param pageNumber\n */\n onCurrentPageChange?: (pageNumber: number) => void;\n locale?: string;\n /**\n * Sizes for pagination panel\n * @default 'm'\n */\n size?: 'm' | 'l';\n };\n\n/** @deprecated */\nexport interface ITotalPagesProps extends TotalPagesProps, UnknownProperties {}\nexport type TotalPagesProps = TextProps & WithI18nEnhanceProps & {};\n\n/** @deprecated */\nexport interface IPageInputProps extends PageInputProps, UnknownProperties {}\nexport type PageInputProps = InputProps & WithI18nEnhanceProps & {};\n\n/** @deprecated */\nexport interface IPaginationContext extends PaginationContext, UnknownProperties {}\nexport type PaginationContext = {\n getFirstPageProps: PropGetterFn;\n getPrevPageProps: PropGetterFn;\n getNextPageProps: PropGetterFn;\n getPageInputProps: PropGetterFn;\n getTotalPagesProps: PropGetterFn;\n};\n\n/** @deprecated */\nexport interface IPaginationHandlers extends PaginationHandlers, UnknownProperties {}\nexport type PaginationHandlers = {\n totalPages: (value: number) => void;\n currentPage: (value: number) => void;\n};\n\ndeclare const Pagination: Intergalactic.Component<\n 'div',\n PaginationProps,\n PaginationContext,\n [handlers: PaginationHandlers]\n> & {\n PrevPage: typeof Button;\n NextPage: typeof Button;\n FirstPage: typeof Button;\n TotalPages: Intergalactic.Component<\n 'button',\n TotalPagesProps,\n {},\n [handlers: PaginationHandlers]\n >;\n PageInput: Intergalactic.Component<'div', PageInputProps, {}, [handlers: PaginationHandlers]> & {\n Value: typeof Input.Value;\n };\n};\n\nexport default Pagination;\n"],"mappings":"","ignoreList":[]}
|
package/lib/cjs/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault")["default"];
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
package/lib/cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["_Pagination","_interopRequireDefault","require"],"sources":["../../src/index.js"],"sourcesContent":["export { default } from './Pagination';\n"],"mappings":";;;;;;;;;;;;AAAA,IAAAA,WAAA,GAAAC,sBAAA,CAAAC,OAAA"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["_Pagination","_interopRequireDefault","require"],"sources":["../../src/index.js"],"sourcesContent":["export { default } from './Pagination';\n"],"mappings":";;;;;;;;;;;;AAAA,IAAAA,WAAA,GAAAC,sBAAA,CAAAC,OAAA","ignoreList":[]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault")["default"];
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
@@ -13,14 +13,14 @@ var _it = _interopRequireDefault(require("./it.json"));
|
|
|
13
13
|
var _ja = _interopRequireDefault(require("./ja.json"));
|
|
14
14
|
var _ko = _interopRequireDefault(require("./ko.json"));
|
|
15
15
|
var _nl = _interopRequireDefault(require("./nl.json"));
|
|
16
|
+
var _pl = _interopRequireDefault(require("./pl.json"));
|
|
16
17
|
var _pt = _interopRequireDefault(require("./pt.json"));
|
|
17
18
|
var _ru = _interopRequireDefault(require("./ru.json"));
|
|
19
|
+
var _sv = _interopRequireDefault(require("./sv.json"));
|
|
18
20
|
var _tr = _interopRequireDefault(require("./tr.json"));
|
|
19
21
|
var _vi = _interopRequireDefault(require("./vi.json"));
|
|
20
22
|
var _zh = _interopRequireDefault(require("./zh.json"));
|
|
21
|
-
var
|
|
22
|
-
var _sv = _interopRequireDefault(require("./sv.json"));
|
|
23
|
-
var localizedMessages = {
|
|
23
|
+
var localizedMessages = exports.localizedMessages = {
|
|
24
24
|
de: _de["default"],
|
|
25
25
|
en: _en["default"],
|
|
26
26
|
es: _es["default"],
|
|
@@ -37,5 +37,4 @@ var localizedMessages = {
|
|
|
37
37
|
pl: _pl["default"],
|
|
38
38
|
sv: _sv["default"]
|
|
39
39
|
};
|
|
40
|
-
exports.localizedMessages = localizedMessages;
|
|
41
40
|
//# sourceMappingURL=__intergalactic-dynamic-locales.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"__intergalactic-dynamic-locales.js","names":["_de","_interopRequireDefault","require","_en","_es","_fr","_it","_ja","_ko","_nl","_pt","_ru","_tr","_vi","_zh","
|
|
1
|
+
{"version":3,"file":"__intergalactic-dynamic-locales.js","names":["_de","_interopRequireDefault","require","_en","_es","_fr","_it","_ja","_ko","_nl","_pl","_pt","_ru","_sv","_tr","_vi","_zh","localizedMessages","exports","de","en","es","fr","it","ja","ko","nl","pt","ru","tr","vi","zh","pl","sv"],"sources":["../../../src/translations/__intergalactic-dynamic-locales.ts"],"sourcesContent":["import de from './de.json';\nimport en from './en.json';\nimport es from './es.json';\nimport fr from './fr.json';\nimport it from './it.json';\nimport ja from './ja.json';\nimport ko from './ko.json';\nimport nl from './nl.json';\nimport pl from './pl.json';\nimport pt from './pt.json';\nimport ru from './ru.json';\nimport sv from './sv.json';\nimport tr from './tr.json';\nimport vi from './vi.json';\nimport zh from './zh.json';\n\nexport const localizedMessages = {\n de,\n en,\n es,\n fr,\n it,\n ja,\n ko,\n nl,\n pt,\n ru,\n tr,\n vi,\n zh,\n pl,\n sv,\n};\n"],"mappings":";;;;;;;AAAA,IAAAA,GAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,GAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,GAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,GAAA,GAAAJ,sBAAA,CAAAC,OAAA;AACA,IAAAI,GAAA,GAAAL,sBAAA,CAAAC,OAAA;AACA,IAAAK,GAAA,GAAAN,sBAAA,CAAAC,OAAA;AACA,IAAAM,GAAA,GAAAP,sBAAA,CAAAC,OAAA;AACA,IAAAO,GAAA,GAAAR,sBAAA,CAAAC,OAAA;AACA,IAAAQ,GAAA,GAAAT,sBAAA,CAAAC,OAAA;AACA,IAAAS,GAAA,GAAAV,sBAAA,CAAAC,OAAA;AACA,IAAAU,GAAA,GAAAX,sBAAA,CAAAC,OAAA;AACA,IAAAW,GAAA,GAAAZ,sBAAA,CAAAC,OAAA;AACA,IAAAY,GAAA,GAAAb,sBAAA,CAAAC,OAAA;AACA,IAAAa,GAAA,GAAAd,sBAAA,CAAAC,OAAA;AACA,IAAAc,GAAA,GAAAf,sBAAA,CAAAC,OAAA;AAEO,IAAMe,iBAAiB,GAAAC,OAAA,CAAAD,iBAAA,GAAG;EAC/BE,EAAE,EAAFA,cAAE;EACFC,EAAE,EAAFA,cAAE;EACFC,EAAE,EAAFA,cAAE;EACFC,EAAE,EAAFA,cAAE;EACFC,EAAE,EAAFA,cAAE;EACFC,EAAE,EAAFA,cAAE;EACFC,EAAE,EAAFA,cAAE;EACFC,EAAE,EAAFA,cAAE;EACFC,EAAE,EAAFA,cAAE;EACFC,EAAE,EAAFA,cAAE;EACFC,EAAE,EAAFA,cAAE;EACFC,EAAE,EAAFA,cAAE;EACFC,EAAE,EAAFA,cAAE;EACFC,EAAE,EAAFA,cAAE;EACFC,EAAE,EAAFA;AACF,CAAC","ignoreList":[]}
|
package/lib/es6/Pagination.js
CHANGED
|
@@ -2,9 +2,10 @@ import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProper
|
|
|
2
2
|
import _objectSpread from "@babel/runtime/helpers/objectSpread2";
|
|
3
3
|
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
4
4
|
import _createClass from "@babel/runtime/helpers/createClass";
|
|
5
|
-
import
|
|
5
|
+
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
6
|
+
import _isNativeReflectConstruct from "@babel/runtime/helpers/isNativeReflectConstruct";
|
|
7
|
+
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
6
8
|
import _inherits from "@babel/runtime/helpers/inherits";
|
|
7
|
-
import _createSuper from "@babel/runtime/helpers/createSuper";
|
|
8
9
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
9
10
|
import { sstyled as _sstyled } from "@semcore/core";
|
|
10
11
|
import { assignProps as _assignProps8 } from "@semcore/core";
|
|
@@ -16,52 +17,50 @@ import { assignProps as _assignProps3 } from "@semcore/core";
|
|
|
16
17
|
import { assignProps as _assignProps2 } from "@semcore/core";
|
|
17
18
|
import { assignProps as _assignProps } from "@semcore/core";
|
|
18
19
|
var _excluded = ["styles", "getI18nText", "totalPages", "isLastOrSingle", "children"];
|
|
19
|
-
|
|
20
|
+
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
21
|
+
import Button, { ButtonLink } from '@semcore/button';
|
|
20
22
|
import { createComponent, Component, sstyled, Root } from '@semcore/core';
|
|
21
|
-
import
|
|
23
|
+
import i18nEnhance from '@semcore/core/lib/utils/enhances/i18nEnhance';
|
|
24
|
+
import uniqueIDEnhancement from '@semcore/core/lib/utils/uniqueID';
|
|
25
|
+
import { Flex, ScreenReaderOnly } from '@semcore/flex-box';
|
|
26
|
+
import ChevronDoubleLeft from '@semcore/icon/ChevronDoubleLeft/m';
|
|
22
27
|
import InputNumber from '@semcore/input-number';
|
|
23
|
-
import { Text } from '@semcore/typography';
|
|
24
|
-
import Button, { ButtonLink } from '@semcore/button';
|
|
25
28
|
import { Hint } from '@semcore/tooltip';
|
|
26
|
-
import
|
|
27
|
-
import
|
|
28
|
-
import i18nEnhance from '@semcore/core/lib/utils/enhances/i18nEnhance';
|
|
29
|
-
import { localizedMessages } from './translations/__intergalactic-dynamic-locales';
|
|
29
|
+
import { Text } from '@semcore/typography';
|
|
30
|
+
import React from 'react';
|
|
30
31
|
/*!__reshadow-styles__:"./style/pagination.shadow.css"*/
|
|
31
|
-
var style = (
|
|
32
|
+
var style = (/*__reshadow_css_start__*/_sstyled.insert(/*__inner_css_start__*/".___SPagination_5hygw_gg_{justify-content:flex-start;align-items:center}.___SPagination_5hygw_gg_.__withGap_5hygw_gg_{gap:var(--intergalactic-spacing-4x, 16px)}.___SPagination_5hygw_gg_.__withGap_5hygw_gg_._size_l_5hygw_gg_{gap:var(--intergalactic-spacing-5x, 20px)}.___SNextPage_5hygw_gg_,.___SPrevPage_5hygw_gg_{align-self:center;margin-left:var(--intergalactic-spacing-2x, 8px)}.___SNextPage_5hygw_gg_._size_l_5hygw_gg_,.___SPrevPage_5hygw_gg_._size_l_5hygw_gg_{margin-left:var(--intergalactic-spacing-3x, 12px)}.___SLabel_5hygw_gg_{color:var(--intergalactic-text-primary, #191b23)}.___SLabel_5hygw_gg_:not(:first-child){margin-left:var(--intergalactic-spacing-4x, 16px)}.___SLabel_5hygw_gg_._size_l_5hygw_gg_:not(:first-child){margin-left:var(--intergalactic-spacing-5x, 20px)}.___STotalPages_5hygw_gg_{align-self:center;line-height:normal;color:var(--intergalactic-text-link, #006dca)}.___STotalPagesLabel_5hygw_gg_{margin-left:var(--intergalactic-spacing-2x, 8px);margin-right:var(--intergalactic-spacing-1x, 4px);color:var(--intergalactic-text-primary, #191b23)}.___STotalLastPages_5hygw_gg_{font-size:var(--intergalactic-fs-200, 14px);line-height:var(--intergalactic-lh-200, 142%);color:var(--intergalactic-text-primary, #191b23)}.___STotalLastPages_5hygw_gg_._size_l_5hygw_gg_{font-size:var(--intergalactic-fs-300, 16px);line-height:var(--intergalactic-lh-300, 150%)}.___SPageInput_5hygw_gg_{max-width:68px;margin-left:var(--intergalactic-spacing-1x, 4px)}.___SPageInput_5hygw_gg_._size_l_5hygw_gg_{margin-left:var(--intergalactic-spacing-2x, 8px)}.___SPageInput_5hygw_gg_:focus-within .___SPageInputAddon_5hygw_gg_{opacity:1;clip:initial;position:static}.___SPageInputAddon_5hygw_gg_{opacity:0;clip:rect(1px,1px,1px,1px);position:absolute}.___SLabel_5hygw_gg_,.___STotalPagesLabel_5hygw_gg_,.___STotalPages_5hygw_gg_{font-size:var(--intergalactic-fs-200, 14px);line-height:var(--intergalactic-lh-200, 142%)}.___SLabel_5hygw_gg_._size_l_5hygw_gg_,.___STotalPagesLabel_5hygw_gg_._size_l_5hygw_gg_,.___STotalPages_5hygw_gg_._size_l_5hygw_gg_{font-size:var(--intergalactic-fs-300, 16px);line-height:var(--intergalactic-lh-300, 150%)}", /*__inner_css_end__*/"5hygw_gg_"),
|
|
32
33
|
/*__reshadow_css_end__*/
|
|
33
34
|
{
|
|
34
|
-
"__SPagination": "
|
|
35
|
-
"__SLabel": "
|
|
36
|
-
"_size_l": "
|
|
37
|
-
"__STotalPages": "
|
|
38
|
-
"__STotalPagesLabel": "
|
|
39
|
-
"__SPageInput": "
|
|
40
|
-
"__SPageInputAddon": "
|
|
41
|
-
"_withGap": "
|
|
42
|
-
"__SNextPage": "
|
|
43
|
-
"__SPrevPage": "
|
|
44
|
-
"__STotalLastPages": "
|
|
35
|
+
"__SPagination": "___SPagination_5hygw_gg_",
|
|
36
|
+
"__SLabel": "___SLabel_5hygw_gg_",
|
|
37
|
+
"_size_l": "_size_l_5hygw_gg_",
|
|
38
|
+
"__STotalPages": "___STotalPages_5hygw_gg_",
|
|
39
|
+
"__STotalPagesLabel": "___STotalPagesLabel_5hygw_gg_",
|
|
40
|
+
"__SPageInput": "___SPageInput_5hygw_gg_",
|
|
41
|
+
"__SPageInputAddon": "___SPageInputAddon_5hygw_gg_",
|
|
42
|
+
"_withGap": "__withGap_5hygw_gg_",
|
|
43
|
+
"__SNextPage": "___SNextPage_5hygw_gg_",
|
|
44
|
+
"__SPrevPage": "___SPrevPage_5hygw_gg_",
|
|
45
|
+
"__STotalLastPages": "___STotalLastPages_5hygw_gg_"
|
|
45
46
|
});
|
|
46
|
-
import {
|
|
47
|
+
import { localizedMessages } from './translations/__intergalactic-dynamic-locales';
|
|
47
48
|
var PaginationRoot = /*#__PURE__*/function (_Component) {
|
|
48
|
-
_inherits(PaginationRoot, _Component);
|
|
49
|
-
var _super = _createSuper(PaginationRoot);
|
|
50
49
|
function PaginationRoot() {
|
|
51
50
|
var _this;
|
|
52
51
|
_classCallCheck(this, PaginationRoot);
|
|
53
52
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
54
53
|
args[_key] = arguments[_key];
|
|
55
54
|
}
|
|
56
|
-
_this =
|
|
57
|
-
_defineProperty(
|
|
58
|
-
_defineProperty(
|
|
59
|
-
_defineProperty(
|
|
55
|
+
_this = _callSuper(this, PaginationRoot, [].concat(args));
|
|
56
|
+
_defineProperty(_this, "nextPageButtonRef", /*#__PURE__*/React.createRef());
|
|
57
|
+
_defineProperty(_this, "prevPageButtonRef", /*#__PURE__*/React.createRef());
|
|
58
|
+
_defineProperty(_this, "state", {
|
|
60
59
|
// Crutch, so as not to take out `dirtyCurrentPage` in props
|
|
61
60
|
dirtyCurrentPage: undefined
|
|
62
61
|
});
|
|
63
|
-
_defineProperty(
|
|
64
|
-
_defineProperty(
|
|
62
|
+
_defineProperty(_this, "pageInputAddonRef", /*#__PURE__*/React.createRef());
|
|
63
|
+
_defineProperty(_this, "returnLostFocus", function () {
|
|
65
64
|
setTimeout(function () {
|
|
66
65
|
if (document.activeElement !== document.body) return;
|
|
67
66
|
var prevPageButton = _this.prevPageButtonRef.current;
|
|
@@ -73,7 +72,7 @@ var PaginationRoot = /*#__PURE__*/function (_Component) {
|
|
|
73
72
|
}
|
|
74
73
|
}, 0);
|
|
75
74
|
});
|
|
76
|
-
_defineProperty(
|
|
75
|
+
_defineProperty(_this, "handlePageChange", function (currentPage) {
|
|
77
76
|
currentPage = Number(currentPage);
|
|
78
77
|
if (Number.isNaN(currentPage)) {
|
|
79
78
|
return;
|
|
@@ -84,7 +83,7 @@ var PaginationRoot = /*#__PURE__*/function (_Component) {
|
|
|
84
83
|
});
|
|
85
84
|
_this.returnLostFocus();
|
|
86
85
|
});
|
|
87
|
-
_defineProperty(
|
|
86
|
+
_defineProperty(_this, "handlePageValueChange", function (value) {
|
|
88
87
|
var dirtyCurrentPage = _this.state.dirtyCurrentPage;
|
|
89
88
|
if (Number.isNaN(Number(value))) {
|
|
90
89
|
value = dirtyCurrentPage;
|
|
@@ -93,7 +92,7 @@ var PaginationRoot = /*#__PURE__*/function (_Component) {
|
|
|
93
92
|
dirtyCurrentPage: value
|
|
94
93
|
});
|
|
95
94
|
});
|
|
96
|
-
_defineProperty(
|
|
95
|
+
_defineProperty(_this, "handlePageValueBlur", function () {
|
|
97
96
|
setTimeout(function () {
|
|
98
97
|
if (_this.pageInputAddonRef.current !== document.activeElement) {
|
|
99
98
|
var currentPage = _this.asProps.currentPage;
|
|
@@ -103,23 +102,23 @@ var PaginationRoot = /*#__PURE__*/function (_Component) {
|
|
|
103
102
|
}
|
|
104
103
|
}, 0);
|
|
105
104
|
});
|
|
106
|
-
_defineProperty(
|
|
105
|
+
_defineProperty(_this, "getDirtyCurrentPage", function () {
|
|
107
106
|
var dirtyCurrentPage = _this.state.dirtyCurrentPage;
|
|
108
107
|
var totalPages = _this.asProps.totalPages;
|
|
109
108
|
var finalValue = dirtyCurrentPage > totalPages ? totalPages : dirtyCurrentPage;
|
|
110
109
|
return finalValue <= 0 ? 1 : finalValue;
|
|
111
110
|
});
|
|
112
111
|
/** @deprecated */
|
|
113
|
-
_defineProperty(
|
|
112
|
+
_defineProperty(_this, "handlePageInputIconClick", function () {
|
|
114
113
|
var dirtyCurrentPage = _this.getDirtyCurrentPage();
|
|
115
114
|
_this.handlePageChange(dirtyCurrentPage);
|
|
116
115
|
});
|
|
117
|
-
_defineProperty(
|
|
116
|
+
_defineProperty(_this, "handlePageInputKeyDown", function (event) {
|
|
118
117
|
if (event.key !== 'Enter') return;
|
|
119
118
|
var dirtyCurrentPage = _this.getDirtyCurrentPage();
|
|
120
119
|
_this.handlePageChange(dirtyCurrentPage);
|
|
121
120
|
});
|
|
122
|
-
_defineProperty(
|
|
121
|
+
_defineProperty(_this, "getFirstPageProps", function () {
|
|
123
122
|
var _this$asProps = _this.asProps,
|
|
124
123
|
currentPage = _this$asProps.currentPage,
|
|
125
124
|
getI18nText = _this$asProps.getI18nText,
|
|
@@ -134,7 +133,7 @@ var PaginationRoot = /*#__PURE__*/function (_Component) {
|
|
|
134
133
|
size: size
|
|
135
134
|
};
|
|
136
135
|
});
|
|
137
|
-
_defineProperty(
|
|
136
|
+
_defineProperty(_this, "getPrevPageProps", function () {
|
|
138
137
|
var _this$asProps2 = _this.asProps,
|
|
139
138
|
currentPage = _this$asProps2.currentPage,
|
|
140
139
|
getI18nText = _this$asProps2.getI18nText,
|
|
@@ -151,7 +150,7 @@ var PaginationRoot = /*#__PURE__*/function (_Component) {
|
|
|
151
150
|
size: size
|
|
152
151
|
};
|
|
153
152
|
});
|
|
154
|
-
_defineProperty(
|
|
153
|
+
_defineProperty(_this, "getNextPageProps", function () {
|
|
155
154
|
var _this$asProps3 = _this.asProps,
|
|
156
155
|
currentPage = _this$asProps3.currentPage,
|
|
157
156
|
totalPages = _this$asProps3.totalPages,
|
|
@@ -169,7 +168,7 @@ var PaginationRoot = /*#__PURE__*/function (_Component) {
|
|
|
169
168
|
size: size
|
|
170
169
|
};
|
|
171
170
|
});
|
|
172
|
-
_defineProperty(
|
|
171
|
+
_defineProperty(_this, "getPageInputProps", function () {
|
|
173
172
|
var _this$asProps4 = _this.asProps,
|
|
174
173
|
getI18nText = _this$asProps4.getI18nText,
|
|
175
174
|
locale = _this$asProps4.locale,
|
|
@@ -181,14 +180,14 @@ var PaginationRoot = /*#__PURE__*/function (_Component) {
|
|
|
181
180
|
};
|
|
182
181
|
});
|
|
183
182
|
/** @deprecated */
|
|
184
|
-
_defineProperty(
|
|
183
|
+
_defineProperty(_this, "getPageInputAddonProps", function () {
|
|
185
184
|
return {
|
|
186
185
|
onClick: _this.handlePageInputIconClick,
|
|
187
186
|
ref: _this.pageInputAddonRef,
|
|
188
187
|
onBlur: _this.handlePageValueBlur
|
|
189
188
|
};
|
|
190
189
|
});
|
|
191
|
-
_defineProperty(
|
|
190
|
+
_defineProperty(_this, "getPageInputValueProps", function () {
|
|
192
191
|
var dirtyCurrentPage = _this.state.dirtyCurrentPage;
|
|
193
192
|
var _this$asProps5 = _this.asProps,
|
|
194
193
|
currentPage = _this$asProps5.currentPage,
|
|
@@ -207,7 +206,7 @@ var PaginationRoot = /*#__PURE__*/function (_Component) {
|
|
|
207
206
|
size: size
|
|
208
207
|
};
|
|
209
208
|
});
|
|
210
|
-
_defineProperty(
|
|
209
|
+
_defineProperty(_this, "getTotalPagesProps", function () {
|
|
211
210
|
var _this$asProps6 = _this.asProps,
|
|
212
211
|
currentPage = _this$asProps6.currentPage,
|
|
213
212
|
totalPages = _this$asProps6.totalPages,
|
|
@@ -230,7 +229,8 @@ var PaginationRoot = /*#__PURE__*/function (_Component) {
|
|
|
230
229
|
});
|
|
231
230
|
return _this;
|
|
232
231
|
}
|
|
233
|
-
|
|
232
|
+
_inherits(PaginationRoot, _Component);
|
|
233
|
+
return _createClass(PaginationRoot, [{
|
|
234
234
|
key: "uncontrolledProps",
|
|
235
235
|
value: function uncontrolledProps() {
|
|
236
236
|
return {
|
|
@@ -270,10 +270,9 @@ var PaginationRoot = /*#__PURE__*/function (_Component) {
|
|
|
270
270
|
}), /*#__PURE__*/React.createElement(Pagination.PageInput, null), /*#__PURE__*/React.createElement(Pagination.TotalPages, null))), /*#__PURE__*/React.createElement(ScreenReaderOnly, _ref9.cn("ScreenReaderOnly", {
|
|
271
271
|
"aria-live": 'polite',
|
|
272
272
|
"role": 'status'
|
|
273
|
-
}), getI18nText('pageInputLabel'),
|
|
273
|
+
}), getI18nText('pageInputLabel'), ' ', currentPage));
|
|
274
274
|
}
|
|
275
275
|
}]);
|
|
276
|
-
return PaginationRoot;
|
|
277
276
|
}(Component);
|
|
278
277
|
_defineProperty(PaginationRoot, "displayName", 'Pagination');
|
|
279
278
|
_defineProperty(PaginationRoot, "defaultProps", function () {
|
|
@@ -288,13 +287,12 @@ _defineProperty(PaginationRoot, "defaultProps", function () {
|
|
|
288
287
|
_defineProperty(PaginationRoot, "style", style);
|
|
289
288
|
_defineProperty(PaginationRoot, "enhance", [i18nEnhance(localizedMessages)]);
|
|
290
289
|
var FirstPage = /*#__PURE__*/function (_Component2) {
|
|
291
|
-
_inherits(FirstPage, _Component2);
|
|
292
|
-
var _super2 = _createSuper(FirstPage);
|
|
293
290
|
function FirstPage() {
|
|
294
291
|
_classCallCheck(this, FirstPage);
|
|
295
|
-
return
|
|
292
|
+
return _callSuper(this, FirstPage, arguments);
|
|
296
293
|
}
|
|
297
|
-
|
|
294
|
+
_inherits(FirstPage, _Component2);
|
|
295
|
+
return _createClass(FirstPage, [{
|
|
298
296
|
key: "render",
|
|
299
297
|
value: function render() {
|
|
300
298
|
var _ref2 = this.asProps;
|
|
@@ -304,7 +302,6 @@ var FirstPage = /*#__PURE__*/function (_Component2) {
|
|
|
304
302
|
}, _ref2));
|
|
305
303
|
}
|
|
306
304
|
}]);
|
|
307
|
-
return FirstPage;
|
|
308
305
|
}(Component);
|
|
309
306
|
_defineProperty(FirstPage, "defaultProps", function (props) {
|
|
310
307
|
var hintContent = props.getI18nText('firstPage');
|
|
@@ -318,22 +315,20 @@ _defineProperty(FirstPage, "defaultProps", function (props) {
|
|
|
318
315
|
};
|
|
319
316
|
});
|
|
320
317
|
var PrevPage = /*#__PURE__*/function (_Component3) {
|
|
321
|
-
_inherits(PrevPage, _Component3);
|
|
322
|
-
var _super3 = _createSuper(PrevPage);
|
|
323
318
|
function PrevPage() {
|
|
324
319
|
_classCallCheck(this, PrevPage);
|
|
325
|
-
return
|
|
320
|
+
return _callSuper(this, PrevPage, arguments);
|
|
326
321
|
}
|
|
327
|
-
|
|
322
|
+
_inherits(PrevPage, _Component3);
|
|
323
|
+
return _createClass(PrevPage, [{
|
|
328
324
|
key: "render",
|
|
329
325
|
value: function render() {
|
|
330
326
|
var _ref3 = this.asProps,
|
|
331
|
-
|
|
327
|
+
_ref0;
|
|
332
328
|
var SPrevPage = Button;
|
|
333
|
-
return
|
|
329
|
+
return _ref0 = sstyled(this.asProps.styles), /*#__PURE__*/React.createElement(SPrevPage, _ref0.cn("SPrevPage", _objectSpread({}, _assignProps3({}, _ref3))));
|
|
334
330
|
}
|
|
335
331
|
}]);
|
|
336
|
-
return PrevPage;
|
|
337
332
|
}(Component);
|
|
338
333
|
_defineProperty(PrevPage, "defaultProps", function (props) {
|
|
339
334
|
return {
|
|
@@ -341,25 +336,23 @@ _defineProperty(PrevPage, "defaultProps", function (props) {
|
|
|
341
336
|
};
|
|
342
337
|
});
|
|
343
338
|
var NextPage = /*#__PURE__*/function (_Component4) {
|
|
344
|
-
_inherits(NextPage, _Component4);
|
|
345
|
-
var _super4 = _createSuper(NextPage);
|
|
346
339
|
function NextPage() {
|
|
347
340
|
_classCallCheck(this, NextPage);
|
|
348
|
-
return
|
|
341
|
+
return _callSuper(this, NextPage, arguments);
|
|
349
342
|
}
|
|
350
|
-
|
|
343
|
+
_inherits(NextPage, _Component4);
|
|
344
|
+
return _createClass(NextPage, [{
|
|
351
345
|
key: "render",
|
|
352
346
|
value: function render() {
|
|
353
347
|
var _ref4 = this.asProps,
|
|
354
|
-
|
|
348
|
+
_ref1;
|
|
355
349
|
var SNextPage = Button;
|
|
356
|
-
return
|
|
350
|
+
return _ref1 = sstyled(this.asProps.styles), /*#__PURE__*/React.createElement(SNextPage, _ref1.cn("SNextPage", _objectSpread({}, _assignProps4({
|
|
357
351
|
"use": 'primary',
|
|
358
352
|
"theme": 'info'
|
|
359
353
|
}, _ref4))));
|
|
360
354
|
}
|
|
361
355
|
}]);
|
|
362
|
-
return NextPage;
|
|
363
356
|
}(Component);
|
|
364
357
|
_defineProperty(NextPage, "defaultProps", function (props) {
|
|
365
358
|
return {
|
|
@@ -367,17 +360,16 @@ _defineProperty(NextPage, "defaultProps", function (props) {
|
|
|
367
360
|
};
|
|
368
361
|
});
|
|
369
362
|
var TotalPages = /*#__PURE__*/function (_Component5) {
|
|
370
|
-
_inherits(TotalPages, _Component5);
|
|
371
|
-
var _super5 = _createSuper(TotalPages);
|
|
372
363
|
function TotalPages() {
|
|
373
364
|
_classCallCheck(this, TotalPages);
|
|
374
|
-
return
|
|
365
|
+
return _callSuper(this, TotalPages, arguments);
|
|
375
366
|
}
|
|
376
|
-
|
|
367
|
+
_inherits(TotalPages, _Component5);
|
|
368
|
+
return _createClass(TotalPages, [{
|
|
377
369
|
key: "render",
|
|
378
370
|
value: function render() {
|
|
379
371
|
var _ref5 = this.asProps,
|
|
380
|
-
|
|
372
|
+
_ref10;
|
|
381
373
|
var STotalPages = ButtonLink;
|
|
382
374
|
var STotalPagesLabel = Text;
|
|
383
375
|
var STotalLastPages = Text;
|
|
@@ -389,27 +381,26 @@ var TotalPages = /*#__PURE__*/function (_Component5) {
|
|
|
389
381
|
children = _this$asProps8.children,
|
|
390
382
|
other = _objectWithoutProperties(_this$asProps8, _excluded);
|
|
391
383
|
var textSize = other.size === 'l' ? '300' : '200';
|
|
392
|
-
return
|
|
384
|
+
return _ref10 = sstyled(styles), /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(STotalPagesLabel, _ref10.cn("STotalPagesLabel", {
|
|
393
385
|
"size": textSize
|
|
394
|
-
}), getI18nText('totalPagesLabel')), isLastOrSingle ? /*#__PURE__*/React.createElement(STotalLastPages,
|
|
386
|
+
}), getI18nText('totalPagesLabel')), isLastOrSingle ? /*#__PURE__*/React.createElement(STotalLastPages, _ref10.cn("STotalLastPages", _objectSpread({
|
|
395
387
|
"size": textSize,
|
|
396
388
|
"aria-label": getI18nText('lastPage', {
|
|
397
389
|
lastPageNumber: totalPages
|
|
398
390
|
})
|
|
399
|
-
}, other)), children) : /*#__PURE__*/React.createElement(STotalPages,
|
|
391
|
+
}, other)), children) : /*#__PURE__*/React.createElement(STotalPages, _ref10.cn("STotalPages", _objectSpread({}, _assignProps5({
|
|
400
392
|
"aria-label": getI18nText('lastPage', {
|
|
401
393
|
lastPageNumber: totalPages
|
|
402
394
|
})
|
|
403
395
|
}, _ref5)))));
|
|
404
396
|
}
|
|
405
397
|
}]);
|
|
406
|
-
return TotalPages;
|
|
407
398
|
}(Component);
|
|
408
399
|
var PageInputValue = function PageInputValue(props) {
|
|
409
400
|
var _ref6 = arguments[0],
|
|
410
|
-
|
|
401
|
+
_ref11;
|
|
411
402
|
var SPageInputValue = InputNumber.Value;
|
|
412
|
-
return
|
|
403
|
+
return _ref11 = sstyled(props.styles), /*#__PURE__*/React.createElement(SPageInputValue, _ref11.cn("SPageInputValue", _objectSpread({}, _assignProps6({
|
|
413
404
|
"onBlur": function onBlur() {
|
|
414
405
|
return false;
|
|
415
406
|
}
|
|
@@ -417,22 +408,21 @@ var PageInputValue = function PageInputValue(props) {
|
|
|
417
408
|
};
|
|
418
409
|
var PageInputAddon = function PageInputAddon(props) {
|
|
419
410
|
var _ref7 = arguments[0],
|
|
420
|
-
|
|
411
|
+
_ref12;
|
|
421
412
|
var SPageInputAddon = InputNumber.Addon;
|
|
422
|
-
return
|
|
413
|
+
return _ref12 = sstyled(props.styles), /*#__PURE__*/React.createElement(SPageInputAddon, _ref12.cn("SPageInputAddon", _objectSpread({}, _assignProps7({}, _ref7))));
|
|
423
414
|
};
|
|
424
415
|
var PageInput = /*#__PURE__*/function (_Component6) {
|
|
425
|
-
_inherits(PageInput, _Component6);
|
|
426
|
-
var _super6 = _createSuper(PageInput);
|
|
427
416
|
function PageInput() {
|
|
428
417
|
_classCallCheck(this, PageInput);
|
|
429
|
-
return
|
|
418
|
+
return _callSuper(this, PageInput, arguments);
|
|
430
419
|
}
|
|
431
|
-
|
|
420
|
+
_inherits(PageInput, _Component6);
|
|
421
|
+
return _createClass(PageInput, [{
|
|
432
422
|
key: "render",
|
|
433
423
|
value: function render() {
|
|
434
424
|
var _ref8 = this.asProps,
|
|
435
|
-
|
|
425
|
+
_ref13;
|
|
436
426
|
var SPageInput = InputNumber;
|
|
437
427
|
var SLabel = Text;
|
|
438
428
|
var _this$asProps9 = this.asProps,
|
|
@@ -442,19 +432,18 @@ var PageInput = /*#__PURE__*/function (_Component6) {
|
|
|
442
432
|
uid = _this$asProps9.uid,
|
|
443
433
|
locale = _this$asProps9.locale,
|
|
444
434
|
size = _this$asProps9.size;
|
|
445
|
-
return
|
|
435
|
+
return _ref13 = sstyled(styles), /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(SLabel, _ref13.cn("SLabel", {
|
|
446
436
|
"tag": 'label',
|
|
447
437
|
"htmlFor": "pagination-input-".concat(uid),
|
|
448
438
|
"size": size
|
|
449
|
-
}), getI18nText('pageInputLabel')), /*#__PURE__*/React.createElement(SPageInput,
|
|
439
|
+
}), getI18nText('pageInputLabel')), /*#__PURE__*/React.createElement(SPageInput, _ref13.cn("SPageInput", _objectSpread({}, _assignProps8({
|
|
450
440
|
"controlsLength": Children.origin ? undefined : 2,
|
|
451
441
|
"locale": locale
|
|
452
|
-
}, _ref8))), Children.origin ? /*#__PURE__*/React.createElement(Children,
|
|
442
|
+
}, _ref8))), Children.origin ? /*#__PURE__*/React.createElement(Children, _ref13.cn("Children", {})) : /*#__PURE__*/React.createElement(Pagination.PageInput.Value, {
|
|
453
443
|
id: "pagination-input-".concat(uid)
|
|
454
444
|
})));
|
|
455
445
|
}
|
|
456
446
|
}]);
|
|
457
|
-
return PageInput;
|
|
458
447
|
}(Component);
|
|
459
448
|
_defineProperty(PageInput, "enhance", [uniqueIDEnhancement()]);
|
|
460
449
|
var Pagination = createComponent(PaginationRoot, {
|