@semcore/pagination 4.52.2-prerelease.0 → 4.53.0-prerelease.0

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.
@@ -2,11 +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 _assertThisInitialized from "@babel/runtime/helpers/assertThisInitialized";
5
+ import _callSuper from "@babel/runtime/helpers/callSuper";
6
6
  import _inherits from "@babel/runtime/helpers/inherits";
7
- import _createSuper from "@babel/runtime/helpers/createSuper";
8
7
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
9
- import { sstyled as _sstyled } from "@semcore/utils/lib/core/index";
8
+ import { sstyled as _sstyled } from "@semcore/core";
10
9
  import { assignProps as _assignProps8 } from "@semcore/core";
11
10
  import { assignProps as _assignProps7 } from "@semcore/core";
12
11
  import { assignProps as _assignProps6 } from "@semcore/core";
@@ -16,64 +15,54 @@ import { assignProps as _assignProps3 } from "@semcore/core";
16
15
  import { assignProps as _assignProps2 } from "@semcore/core";
17
16
  import { assignProps as _assignProps } from "@semcore/core";
18
17
  var _excluded = ["styles", "getI18nText", "totalPages", "isLastOrSingle", "children"];
19
- import React from 'react';
20
- import createComponent, { Component, sstyled, Root } from '@semcore/core';
21
- import { Flex } from '@semcore/flex-box';
22
- import InputNumber from '@semcore/input-number';
23
- import { Text } from '@semcore/typography';
18
+ import { Flex, ScreenReaderOnly, Hint } from '@semcore/base-components';
24
19
  import Button, { ButtonLink } from '@semcore/button';
25
- import { Hint } from '@semcore/tooltip';
20
+ import { createComponent, Component, sstyled, Root } from '@semcore/core';
21
+ import i18nEnhance from '@semcore/core/lib/utils/enhances/i18nEnhance';
22
+ import uniqueIDEnhancement from '@semcore/core/lib/utils/uniqueID';
26
23
  import ChevronDoubleLeft from '@semcore/icon/ChevronDoubleLeft/m';
27
- import uniqueIDEnhancement from '@semcore/utils/lib/uniqueID';
28
- import i18nEnhance from '@semcore/utils/lib/enhances/i18nEnhance';
29
- import { localizedMessages } from './translations/__intergalactic-dynamic-locales';
24
+ import InputNumber from '@semcore/input-number';
25
+ import { Text } from '@semcore/typography';
26
+ import React from 'react';
30
27
  /*!__reshadow-styles__:"./style/pagination.shadow.css"*/
31
- var style = ( /*__reshadow_css_start__*/_sstyled.insert( /*__inner_css_start__*/".___SPagination_xontb_gg_{justify-content:flex-start;align-items:center}.___SPagination_xontb_gg_.__withGap_xontb_gg_{gap:var(--intergalactic-spacing-4x, 16px)}.___SPagination_xontb_gg_.__withGap_xontb_gg_._size_l_xontb_gg_{gap:var(--intergalactic-spacing-5x, 20px)}.___SNextPage_xontb_gg_,.___SPrevPage_xontb_gg_{align-self:center;margin-left:var(--intergalactic-spacing-2x, 8px)}.___SNextPage_xontb_gg_._size_l_xontb_gg_,.___SPrevPage_xontb_gg_._size_l_xontb_gg_{margin-left:var(--intergalactic-spacing-3x, 12px)}.___SLabel_xontb_gg_{color:var(--intergalactic-text-primary, #191b23)}.___SLabel_xontb_gg_:not(:first-child){margin-left:var(--intergalactic-spacing-4x, 16px)}.___SLabel_xontb_gg_._size_l_xontb_gg_:not(:first-child){margin-left:var(--intergalactic-spacing-5x, 20px)}.___STotalPages_xontb_gg_{align-self:center;line-height:normal;color:var(--intergalactic-text-link, #006dca)}.___STotalPagesLabel_xontb_gg_{margin-left:var(--intergalactic-spacing-2x, 8px);margin-right:var(--intergalactic-spacing-1x, 4px);color:var(--intergalactic-text-primary, #191b23)}.___STotalLastPages_xontb_gg_{font-size:var(--intergalactic-fs-200, 14px);line-height:var(--intergalactic-lh-200, 142%);color:var(--intergalactic-text-primary, #191b23)}.___STotalLastPages_xontb_gg_._size_l_xontb_gg_{font-size:var(--intergalactic-fs-300, 16px);line-height:var(--intergalactic-lh-300, 150%)}.___SPageInput_xontb_gg_{max-width:68px;margin-left:var(--intergalactic-spacing-1x, 4px)}.___SPageInput_xontb_gg_._size_l_xontb_gg_{margin-left:var(--intergalactic-spacing-2x, 8px)}.___SPageInput_xontb_gg_:focus-within .___SPageInputAddon_xontb_gg_{opacity:1;clip:initial;position:static}.___SPageInputAddon_xontb_gg_{opacity:0;clip:rect(1px,1px,1px,1px);position:absolute}.___SLabel_xontb_gg_,.___STotalPagesLabel_xontb_gg_,.___STotalPages_xontb_gg_{font-size:var(--intergalactic-fs-200, 14px);line-height:var(--intergalactic-lh-200, 142%)}.___SLabel_xontb_gg_._size_l_xontb_gg_,.___STotalPagesLabel_xontb_gg_._size_l_xontb_gg_,.___STotalPages_xontb_gg_._size_l_xontb_gg_{font-size:var(--intergalactic-fs-300, 16px);line-height:var(--intergalactic-lh-300, 150%)}", /*__inner_css_end__*/"xontb_gg_"),
28
+ var style = (/*__reshadow_css_start__*/_sstyled.insert(/*__inner_css_start__*/".___SPagination_q6ly9_gg_{justify-content:flex-start;align-items:center}.___SPagination_q6ly9_gg_.__withGap_q6ly9_gg_{gap:var(--intergalactic-spacing-4x, 16px)}.___SPagination_q6ly9_gg_.__withGap_q6ly9_gg_._size_l_q6ly9_gg_{gap:var(--intergalactic-spacing-5x, 20px)}.___SNextPage_q6ly9_gg_,.___SPrevPage_q6ly9_gg_{align-self:center;margin-left:var(--intergalactic-spacing-2x, 8px)}.___SNextPage_q6ly9_gg_._size_l_q6ly9_gg_,.___SPrevPage_q6ly9_gg_._size_l_q6ly9_gg_{margin-left:var(--intergalactic-spacing-3x, 12px)}.___SLabel_q6ly9_gg_{color:var(--intergalactic-text-primary, rgba(1, 5, 0, 0.899))}.___SLabel_q6ly9_gg_:not(:first-child){margin-left:var(--intergalactic-spacing-4x, 16px)}.___SLabel_q6ly9_gg_._size_l_q6ly9_gg_:not(:first-child){margin-left:var(--intergalactic-spacing-5x, 20px)}.___STotalPages_q6ly9_gg_{align-self:center;line-height:normal;color:var(--intergalactic-text-link, rgb(36, 93, 229))}.___STotalPagesLabel_q6ly9_gg_{margin-left:var(--intergalactic-spacing-2x, 8px);margin-right:var(--intergalactic-spacing-1x, 4px);color:var(--intergalactic-text-primary, rgba(1, 5, 0, 0.899))}.___STotalLastPages_q6ly9_gg_{font-size:var(--intergalactic-fs-200, 14px);line-height:var(--intergalactic-lh-200, 142%);color:var(--intergalactic-text-primary, rgba(1, 5, 0, 0.899))}.___STotalLastPages_q6ly9_gg_._size_l_q6ly9_gg_{font-size:var(--intergalactic-fs-300, 16px);line-height:var(--intergalactic-lh-300, 150%)}.___SPageInput_q6ly9_gg_{max-width:68px;margin-left:var(--intergalactic-spacing-1x, 4px)}.___SPageInput_q6ly9_gg_._size_l_q6ly9_gg_{margin-left:var(--intergalactic-spacing-2x, 8px)}.___SPageInput_q6ly9_gg_:focus-within .___SPageInputAddon_q6ly9_gg_{opacity:1;clip:initial;position:static}.___SPageInputAddon_q6ly9_gg_{opacity:0;clip:rect(1px,1px,1px,1px);position:absolute}.___SLabel_q6ly9_gg_,.___STotalPagesLabel_q6ly9_gg_,.___STotalPages_q6ly9_gg_{font-size:var(--intergalactic-fs-200, 14px);line-height:var(--intergalactic-lh-200, 142%)}.___SLabel_q6ly9_gg_._size_l_q6ly9_gg_,.___STotalPagesLabel_q6ly9_gg_._size_l_q6ly9_gg_,.___STotalPages_q6ly9_gg_._size_l_q6ly9_gg_{font-size:var(--intergalactic-fs-300, 16px);line-height:var(--intergalactic-lh-300, 150%)}", /*__inner_css_end__*/"q6ly9_gg_"),
32
29
  /*__reshadow_css_end__*/
33
30
  {
34
- "__SPagination": "___SPagination_xontb_gg_",
35
- "__SLabel": "___SLabel_xontb_gg_",
36
- "_size_l": "_size_l_xontb_gg_",
37
- "__STotalPages": "___STotalPages_xontb_gg_",
38
- "__STotalPagesLabel": "___STotalPagesLabel_xontb_gg_",
39
- "__SPageInput": "___SPageInput_xontb_gg_",
40
- "__SPageInputAddon": "___SPageInputAddon_xontb_gg_",
41
- "_withGap": "__withGap_xontb_gg_",
42
- "__SNextPage": "___SNextPage_xontb_gg_",
43
- "__SPrevPage": "___SPrevPage_xontb_gg_",
44
- "__STotalLastPages": "___STotalLastPages_xontb_gg_"
31
+ "__SPagination": "___SPagination_q6ly9_gg_",
32
+ "__SLabel": "___SLabel_q6ly9_gg_",
33
+ "_size_l": "_size_l_q6ly9_gg_",
34
+ "__STotalPages": "___STotalPages_q6ly9_gg_",
35
+ "__STotalPagesLabel": "___STotalPagesLabel_q6ly9_gg_",
36
+ "__SPageInput": "___SPageInput_q6ly9_gg_",
37
+ "__SPageInputAddon": "___SPageInputAddon_q6ly9_gg_",
38
+ "_withGap": "__withGap_q6ly9_gg_",
39
+ "__SNextPage": "___SNextPage_q6ly9_gg_",
40
+ "__SPrevPage": "___SPrevPage_q6ly9_gg_",
41
+ "__STotalLastPages": "___STotalLastPages_q6ly9_gg_"
45
42
  });
46
- import { ScreenReaderOnly } from '@semcore/flex-box';
43
+ import { localizedMessages } from './translations/__intergalactic-dynamic-locales';
47
44
  var PaginationRoot = /*#__PURE__*/function (_Component) {
48
- _inherits(PaginationRoot, _Component);
49
- var _super = _createSuper(PaginationRoot);
50
45
  function PaginationRoot() {
51
46
  var _this;
52
47
  _classCallCheck(this, PaginationRoot);
53
48
  for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
54
49
  args[_key] = arguments[_key];
55
50
  }
56
- _this = _super.call.apply(_super, [this].concat(args));
57
- _defineProperty(_assertThisInitialized(_this), "nextPageButtonRef", /*#__PURE__*/React.createRef());
58
- _defineProperty(_assertThisInitialized(_this), "prevPageButtonRef", /*#__PURE__*/React.createRef());
59
- _defineProperty(_assertThisInitialized(_this), "state", {
51
+ _this = _callSuper(this, PaginationRoot, [].concat(args));
52
+ _defineProperty(_this, "nextPageButtonRef", /*#__PURE__*/React.createRef());
53
+ _defineProperty(_this, "prevPageButtonRef", /*#__PURE__*/React.createRef());
54
+ _defineProperty(_this, "state", {
60
55
  // Crutch, so as not to take out `dirtyCurrentPage` in props
61
56
  dirtyCurrentPage: undefined
62
57
  });
63
- _defineProperty(_assertThisInitialized(_this), "pageInputAddonRef", /*#__PURE__*/React.createRef());
64
- _defineProperty(_assertThisInitialized(_this), "returnLostFocus", function () {
65
- setTimeout(function () {
66
- if (document.activeElement !== document.body) return;
67
- var prevPageButton = _this.prevPageButtonRef.current;
68
- var nextPageButton = _this.nextPageButtonRef.current;
69
- if (prevPageButton && !prevPageButton.disabled) {
70
- prevPageButton.focus();
71
- } else if (nextPageButton && !nextPageButton.disabled) {
72
- nextPageButton.focus();
73
- }
74
- }, 0);
58
+ _defineProperty(_this, "pageInputAddonRef", /*#__PURE__*/React.createRef());
59
+ _defineProperty(_this, "returnLostFocusTo", function (ref) {
60
+ requestAnimationFrame(function () {
61
+ var _ref$current;
62
+ (_ref$current = ref.current) === null || _ref$current === void 0 || _ref$current.focus();
63
+ });
75
64
  });
76
- _defineProperty(_assertThisInitialized(_this), "handlePageChange", function (currentPage) {
65
+ _defineProperty(_this, "handlePageChange", function (currentPage) {
77
66
  currentPage = Number(currentPage);
78
67
  if (Number.isNaN(currentPage)) {
79
68
  return;
@@ -82,9 +71,8 @@ var PaginationRoot = /*#__PURE__*/function (_Component) {
82
71
  _this.setState({
83
72
  dirtyCurrentPage: undefined
84
73
  });
85
- _this.returnLostFocus();
86
74
  });
87
- _defineProperty(_assertThisInitialized(_this), "handlePageValueChange", function (value) {
75
+ _defineProperty(_this, "handlePageValueChange", function (value) {
88
76
  var dirtyCurrentPage = _this.state.dirtyCurrentPage;
89
77
  if (Number.isNaN(Number(value))) {
90
78
  value = dirtyCurrentPage;
@@ -93,7 +81,7 @@ var PaginationRoot = /*#__PURE__*/function (_Component) {
93
81
  dirtyCurrentPage: value
94
82
  });
95
83
  });
96
- _defineProperty(_assertThisInitialized(_this), "handlePageValueBlur", function () {
84
+ _defineProperty(_this, "handlePageValueBlur", function () {
97
85
  setTimeout(function () {
98
86
  if (_this.pageInputAddonRef.current !== document.activeElement) {
99
87
  var currentPage = _this.asProps.currentPage;
@@ -103,23 +91,18 @@ var PaginationRoot = /*#__PURE__*/function (_Component) {
103
91
  }
104
92
  }, 0);
105
93
  });
106
- _defineProperty(_assertThisInitialized(_this), "getDirtyCurrentPage", function () {
94
+ _defineProperty(_this, "getDirtyCurrentPage", function () {
107
95
  var dirtyCurrentPage = _this.state.dirtyCurrentPage;
108
96
  var totalPages = _this.asProps.totalPages;
109
97
  var finalValue = dirtyCurrentPage > totalPages ? totalPages : dirtyCurrentPage;
110
98
  return finalValue <= 0 ? 1 : finalValue;
111
99
  });
112
- /** @deprecated */
113
- _defineProperty(_assertThisInitialized(_this), "handlePageInputIconClick", function () {
114
- var dirtyCurrentPage = _this.getDirtyCurrentPage();
115
- _this.handlePageChange(dirtyCurrentPage);
116
- });
117
- _defineProperty(_assertThisInitialized(_this), "handlePageInputKeyDown", function (event) {
100
+ _defineProperty(_this, "handlePageInputKeyDown", function (event) {
118
101
  if (event.key !== 'Enter') return;
119
102
  var dirtyCurrentPage = _this.getDirtyCurrentPage();
120
103
  _this.handlePageChange(dirtyCurrentPage);
121
104
  });
122
- _defineProperty(_assertThisInitialized(_this), "getFirstPageProps", function () {
105
+ _defineProperty(_this, "getFirstPageProps", function () {
123
106
  var _this$asProps = _this.asProps,
124
107
  currentPage = _this$asProps.currentPage,
125
108
  getI18nText = _this$asProps.getI18nText,
@@ -128,13 +111,14 @@ var PaginationRoot = /*#__PURE__*/function (_Component) {
128
111
  return {
129
112
  disabled: disabled,
130
113
  onClick: function onClick() {
131
- return _this.handlePageChange(1);
114
+ _this.handlePageChange(1);
115
+ _this.returnLostFocusTo(_this.nextPageButtonRef);
132
116
  },
133
117
  getI18nText: getI18nText,
134
118
  size: size
135
119
  };
136
120
  });
137
- _defineProperty(_assertThisInitialized(_this), "getPrevPageProps", function () {
121
+ _defineProperty(_this, "getPrevPageProps", function () {
138
122
  var _this$asProps2 = _this.asProps,
139
123
  currentPage = _this$asProps2.currentPage,
140
124
  getI18nText = _this$asProps2.getI18nText,
@@ -144,32 +128,40 @@ var PaginationRoot = /*#__PURE__*/function (_Component) {
144
128
  currentPage: currentPage,
145
129
  disabled: disabled,
146
130
  onClick: function onClick() {
147
- return _this.handlePageChange(currentPage - 1);
131
+ var followingPage = currentPage - 1;
132
+ _this.handlePageChange(followingPage);
133
+ if (followingPage <= 1) {
134
+ _this.returnLostFocusTo(_this.nextPageButtonRef);
135
+ }
148
136
  },
149
137
  getI18nText: getI18nText,
150
- ref: _this.nextPageButtonRef,
138
+ ref: _this.prevPageButtonRef,
151
139
  size: size
152
140
  };
153
141
  });
154
- _defineProperty(_assertThisInitialized(_this), "getNextPageProps", function () {
142
+ _defineProperty(_this, "getNextPageProps", function () {
155
143
  var _this$asProps3 = _this.asProps,
156
144
  currentPage = _this$asProps3.currentPage,
157
145
  totalPages = _this$asProps3.totalPages,
158
146
  getI18nText = _this$asProps3.getI18nText,
159
147
  size = _this$asProps3.size;
160
- var disabled = !(currentPage < totalPages);
148
+ var disabled = currentPage >= totalPages;
161
149
  return {
162
150
  currentPage: currentPage,
163
151
  disabled: disabled,
164
152
  onClick: function onClick() {
165
- return _this.handlePageChange(currentPage + 1);
153
+ var followingPage = currentPage + 1;
154
+ _this.handlePageChange(followingPage);
155
+ if (followingPage >= totalPages) {
156
+ _this.returnLostFocusTo(_this.prevPageButtonRef);
157
+ }
166
158
  },
167
159
  getI18nText: getI18nText,
168
- ref: _this.prevPageButtonRef,
160
+ ref: _this.nextPageButtonRef,
169
161
  size: size
170
162
  };
171
163
  });
172
- _defineProperty(_assertThisInitialized(_this), "getPageInputProps", function () {
164
+ _defineProperty(_this, "getPageInputProps", function () {
173
165
  var _this$asProps4 = _this.asProps,
174
166
  getI18nText = _this$asProps4.getI18nText,
175
167
  locale = _this$asProps4.locale,
@@ -177,18 +169,17 @@ var PaginationRoot = /*#__PURE__*/function (_Component) {
177
169
  return {
178
170
  getI18nText: getI18nText,
179
171
  locale: locale,
180
- size: size
172
+ size: size,
173
+ paginationInputId: _this.paginationInputId
181
174
  };
182
175
  });
183
- /** @deprecated */
184
- _defineProperty(_assertThisInitialized(_this), "getPageInputAddonProps", function () {
176
+ _defineProperty(_this, "getPageInputAddonProps", function () {
185
177
  return {
186
- onClick: _this.handlePageInputIconClick,
187
178
  ref: _this.pageInputAddonRef,
188
179
  onBlur: _this.handlePageValueBlur
189
180
  };
190
181
  });
191
- _defineProperty(_assertThisInitialized(_this), "getPageInputValueProps", function () {
182
+ _defineProperty(_this, "getPageInputValueProps", function () {
192
183
  var dirtyCurrentPage = _this.state.dirtyCurrentPage;
193
184
  var _this$asProps5 = _this.asProps,
194
185
  currentPage = _this$asProps5.currentPage,
@@ -204,10 +195,11 @@ var PaginationRoot = /*#__PURE__*/function (_Component) {
204
195
  onChange: _this.handlePageValueChange,
205
196
  onKeyDown: _this.handlePageInputKeyDown,
206
197
  getI18nText: getI18nText,
207
- size: size
198
+ size: size,
199
+ id: _this.paginationInputId
208
200
  };
209
201
  });
210
- _defineProperty(_assertThisInitialized(_this), "getTotalPagesProps", function () {
202
+ _defineProperty(_this, "getTotalPagesProps", function () {
211
203
  var _this$asProps6 = _this.asProps,
212
204
  currentPage = _this$asProps6.currentPage,
213
205
  totalPages = _this$asProps6.totalPages,
@@ -222,7 +214,8 @@ var PaginationRoot = /*#__PURE__*/function (_Component) {
222
214
  children: formatter.format(totalPages),
223
215
  isLastOrSingle: currentPage === totalPages,
224
216
  onClick: function onClick() {
225
- return _this.handlePageChange(totalPages);
217
+ _this.handlePageChange(totalPages);
218
+ _this.returnLostFocusTo(_this.prevPageButtonRef);
226
219
  },
227
220
  getI18nText: getI18nText,
228
221
  size: size
@@ -230,7 +223,8 @@ var PaginationRoot = /*#__PURE__*/function (_Component) {
230
223
  });
231
224
  return _this;
232
225
  }
233
- _createClass(PaginationRoot, [{
226
+ _inherits(PaginationRoot, _Component);
227
+ return _createClass(PaginationRoot, [{
234
228
  key: "uncontrolledProps",
235
229
  value: function uncontrolledProps() {
236
230
  return {
@@ -247,6 +241,12 @@ var PaginationRoot = /*#__PURE__*/function (_Component) {
247
241
  });
248
242
  }
249
243
  }
244
+ }, {
245
+ key: "paginationInputId",
246
+ get: function get() {
247
+ var uid = this.asProps.uid;
248
+ return "pagination-input-".concat(uid);
249
+ }
250
250
  }, {
251
251
  key: "render",
252
252
  value: function render() {
@@ -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'), " ", currentPage));
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 () {
@@ -286,54 +285,57 @@ _defineProperty(PaginationRoot, "defaultProps", function () {
286
285
  };
287
286
  });
288
287
  _defineProperty(PaginationRoot, "style", style);
289
- _defineProperty(PaginationRoot, "enhance", [i18nEnhance(localizedMessages)]);
288
+ _defineProperty(PaginationRoot, "enhance", [i18nEnhance(localizedMessages), uniqueIDEnhancement()]);
290
289
  var FirstPage = /*#__PURE__*/function (_Component2) {
291
- _inherits(FirstPage, _Component2);
292
- var _super2 = _createSuper(FirstPage);
293
290
  function FirstPage() {
291
+ var _this2;
294
292
  _classCallCheck(this, FirstPage);
295
- return _super2.apply(this, arguments);
293
+ for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
294
+ args[_key2] = arguments[_key2];
295
+ }
296
+ _this2 = _callSuper(this, FirstPage, [].concat(args));
297
+ _defineProperty(_this2, "buttonRef", /*#__PURE__*/React.createRef());
298
+ return _this2;
296
299
  }
297
- _createClass(FirstPage, [{
300
+ _inherits(FirstPage, _Component2);
301
+ return _createClass(FirstPage, [{
298
302
  key: "render",
299
303
  value: function render() {
300
304
  var _ref2 = this.asProps;
301
- var getI18nText = this.asProps.getI18nText;
302
- return /*#__PURE__*/React.createElement(Button, _assignProps2({
303
- "aria-label": getI18nText('firstPage')
304
- }, _ref2));
305
+ var _this$asProps8 = this.asProps,
306
+ getI18nText = _this$asProps8.getI18nText,
307
+ Children = _this$asProps8.Children,
308
+ children = _this$asProps8.children,
309
+ disabled = _this$asProps8.disabled;
310
+ var hintContent = getI18nText('firstPage');
311
+ var isAdvanced = children !== undefined;
312
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Button, _assignProps2({
313
+ "aria-label": getI18nText('firstPage'),
314
+ "ref": this.buttonRef
315
+ }, _ref2), isAdvanced ? /*#__PURE__*/React.createElement(Children, null) : /*#__PURE__*/React.createElement(Button.Addon, {
316
+ tag: ChevronDoubleLeft
317
+ })), !isAdvanced && /*#__PURE__*/React.createElement(Hint, {
318
+ triggerRef: this.buttonRef,
319
+ timeout: [250, 50]
320
+ }, hintContent));
305
321
  }
306
322
  }]);
307
- return FirstPage;
308
323
  }(Component);
309
- _defineProperty(FirstPage, "defaultProps", function (props) {
310
- var hintContent = props.getI18nText('firstPage');
311
- return {
312
- children: /*#__PURE__*/React.createElement(Button.Addon, {
313
- tag: Hint,
314
- title: hintContent,
315
- timeout: [250, 50],
316
- __excludeProps: ['aria-label']
317
- }, /*#__PURE__*/React.createElement(ChevronDoubleLeft, null))
318
- };
319
- });
320
324
  var PrevPage = /*#__PURE__*/function (_Component3) {
321
- _inherits(PrevPage, _Component3);
322
- var _super3 = _createSuper(PrevPage);
323
325
  function PrevPage() {
324
326
  _classCallCheck(this, PrevPage);
325
- return _super3.apply(this, arguments);
327
+ return _callSuper(this, PrevPage, arguments);
326
328
  }
327
- _createClass(PrevPage, [{
329
+ _inherits(PrevPage, _Component3);
330
+ return _createClass(PrevPage, [{
328
331
  key: "render",
329
332
  value: function render() {
330
333
  var _ref3 = this.asProps,
331
- _ref10;
334
+ _ref0;
332
335
  var SPrevPage = Button;
333
- return _ref10 = sstyled(this.asProps.styles), /*#__PURE__*/React.createElement(SPrevPage, _ref10.cn("SPrevPage", _objectSpread({}, _assignProps3({}, _ref3))));
336
+ return _ref0 = sstyled(this.asProps.styles), /*#__PURE__*/React.createElement(SPrevPage, _ref0.cn("SPrevPage", _objectSpread({}, _assignProps3({}, _ref3))));
334
337
  }
335
338
  }]);
336
- return PrevPage;
337
339
  }(Component);
338
340
  _defineProperty(PrevPage, "defaultProps", function (props) {
339
341
  return {
@@ -341,25 +343,23 @@ _defineProperty(PrevPage, "defaultProps", function (props) {
341
343
  };
342
344
  });
343
345
  var NextPage = /*#__PURE__*/function (_Component4) {
344
- _inherits(NextPage, _Component4);
345
- var _super4 = _createSuper(NextPage);
346
346
  function NextPage() {
347
347
  _classCallCheck(this, NextPage);
348
- return _super4.apply(this, arguments);
348
+ return _callSuper(this, NextPage, arguments);
349
349
  }
350
- _createClass(NextPage, [{
350
+ _inherits(NextPage, _Component4);
351
+ return _createClass(NextPage, [{
351
352
  key: "render",
352
353
  value: function render() {
353
354
  var _ref4 = this.asProps,
354
- _ref11;
355
+ _ref1;
355
356
  var SNextPage = Button;
356
- return _ref11 = sstyled(this.asProps.styles), /*#__PURE__*/React.createElement(SNextPage, _ref11.cn("SNextPage", _objectSpread({}, _assignProps4({
357
+ return _ref1 = sstyled(this.asProps.styles), /*#__PURE__*/React.createElement(SNextPage, _ref1.cn("SNextPage", _objectSpread({}, _assignProps4({
357
358
  "use": 'primary',
358
359
  "theme": 'info'
359
360
  }, _ref4))));
360
361
  }
361
362
  }]);
362
- return NextPage;
363
363
  }(Component);
364
364
  _defineProperty(NextPage, "defaultProps", function (props) {
365
365
  return {
@@ -367,94 +367,88 @@ _defineProperty(NextPage, "defaultProps", function (props) {
367
367
  };
368
368
  });
369
369
  var TotalPages = /*#__PURE__*/function (_Component5) {
370
- _inherits(TotalPages, _Component5);
371
- var _super5 = _createSuper(TotalPages);
372
370
  function TotalPages() {
373
371
  _classCallCheck(this, TotalPages);
374
- return _super5.apply(this, arguments);
372
+ return _callSuper(this, TotalPages, arguments);
375
373
  }
376
- _createClass(TotalPages, [{
374
+ _inherits(TotalPages, _Component5);
375
+ return _createClass(TotalPages, [{
377
376
  key: "render",
378
377
  value: function render() {
379
378
  var _ref5 = this.asProps,
380
- _ref12;
379
+ _ref10;
381
380
  var STotalPages = ButtonLink;
382
381
  var STotalPagesLabel = Text;
383
382
  var STotalLastPages = Text;
384
- var _this$asProps8 = this.asProps,
385
- styles = _this$asProps8.styles,
386
- getI18nText = _this$asProps8.getI18nText,
387
- totalPages = _this$asProps8.totalPages,
388
- isLastOrSingle = _this$asProps8.isLastOrSingle,
389
- children = _this$asProps8.children,
390
- other = _objectWithoutProperties(_this$asProps8, _excluded);
383
+ var _this$asProps9 = this.asProps,
384
+ styles = _this$asProps9.styles,
385
+ getI18nText = _this$asProps9.getI18nText,
386
+ totalPages = _this$asProps9.totalPages,
387
+ isLastOrSingle = _this$asProps9.isLastOrSingle,
388
+ children = _this$asProps9.children,
389
+ other = _objectWithoutProperties(_this$asProps9, _excluded);
391
390
  var textSize = other.size === 'l' ? '300' : '200';
392
- return _ref12 = sstyled(styles), /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(STotalPagesLabel, _ref12.cn("STotalPagesLabel", {
391
+ return _ref10 = sstyled(styles), /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(STotalPagesLabel, _ref10.cn("STotalPagesLabel", {
393
392
  "size": textSize
394
- }), getI18nText('totalPagesLabel')), isLastOrSingle ? /*#__PURE__*/React.createElement(STotalLastPages, _ref12.cn("STotalLastPages", _objectSpread({
393
+ }), getI18nText('totalPagesLabel')), isLastOrSingle ? /*#__PURE__*/React.createElement(STotalLastPages, _ref10.cn("STotalLastPages", _objectSpread({
395
394
  "size": textSize,
396
395
  "aria-label": getI18nText('lastPage', {
397
396
  lastPageNumber: totalPages
398
397
  })
399
- }, other)), children) : /*#__PURE__*/React.createElement(STotalPages, _ref12.cn("STotalPages", _objectSpread({}, _assignProps5({
398
+ }, other)), children) : /*#__PURE__*/React.createElement(STotalPages, _ref10.cn("STotalPages", _objectSpread({}, _assignProps5({
400
399
  "aria-label": getI18nText('lastPage', {
401
400
  lastPageNumber: totalPages
402
401
  })
403
402
  }, _ref5)))));
404
403
  }
405
404
  }]);
406
- return TotalPages;
407
405
  }(Component);
408
- var PageInputValue = function PageInputValue(props) {
406
+ function PageInputValue(props) {
409
407
  var _ref6 = arguments[0],
410
- _ref13;
408
+ _ref11;
411
409
  var SPageInputValue = InputNumber.Value;
412
- return _ref13 = sstyled(props.styles), /*#__PURE__*/React.createElement(SPageInputValue, _ref13.cn("SPageInputValue", _objectSpread({}, _assignProps6({
410
+ return _ref11 = sstyled(props.styles), /*#__PURE__*/React.createElement(SPageInputValue, _ref11.cn("SPageInputValue", _objectSpread({}, _assignProps6({
413
411
  "onBlur": function onBlur() {
414
412
  return false;
415
413
  }
416
414
  }, _ref6))));
417
- };
418
- var PageInputAddon = function PageInputAddon(props) {
415
+ }
416
+ function PageInputAddon(props) {
419
417
  var _ref7 = arguments[0],
420
- _ref14;
418
+ _ref12;
421
419
  var SPageInputAddon = InputNumber.Addon;
422
- return _ref14 = sstyled(props.styles), /*#__PURE__*/React.createElement(SPageInputAddon, _ref14.cn("SPageInputAddon", _objectSpread({}, _assignProps7({}, _ref7))));
423
- };
420
+ return _ref12 = sstyled(props.styles), /*#__PURE__*/React.createElement(SPageInputAddon, _ref12.cn("SPageInputAddon", _objectSpread({}, _assignProps7({}, _ref7))));
421
+ }
424
422
  var PageInput = /*#__PURE__*/function (_Component6) {
425
- _inherits(PageInput, _Component6);
426
- var _super6 = _createSuper(PageInput);
427
423
  function PageInput() {
428
424
  _classCallCheck(this, PageInput);
429
- return _super6.apply(this, arguments);
425
+ return _callSuper(this, PageInput, arguments);
430
426
  }
431
- _createClass(PageInput, [{
427
+ _inherits(PageInput, _Component6);
428
+ return _createClass(PageInput, [{
432
429
  key: "render",
433
430
  value: function render() {
434
431
  var _ref8 = this.asProps,
435
- _ref15;
432
+ _ref13;
436
433
  var SPageInput = InputNumber;
437
434
  var SLabel = Text;
438
- var _this$asProps9 = this.asProps,
439
- Children = _this$asProps9.Children,
440
- getI18nText = _this$asProps9.getI18nText,
441
- styles = _this$asProps9.styles,
442
- uid = _this$asProps9.uid,
443
- locale = _this$asProps9.locale,
444
- size = _this$asProps9.size;
445
- return _ref15 = sstyled(styles), /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(SLabel, _ref15.cn("SLabel", {
435
+ var _this$asProps0 = this.asProps,
436
+ Children = _this$asProps0.Children,
437
+ getI18nText = _this$asProps0.getI18nText,
438
+ styles = _this$asProps0.styles,
439
+ locale = _this$asProps0.locale,
440
+ size = _this$asProps0.size,
441
+ paginationInputId = _this$asProps0.paginationInputId;
442
+ return _ref13 = sstyled(styles), /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(SLabel, _ref13.cn("SLabel", {
446
443
  "tag": 'label',
447
- "htmlFor": "pagination-input-".concat(uid),
444
+ "htmlFor": paginationInputId,
448
445
  "size": size
449
- }), getI18nText('pageInputLabel')), /*#__PURE__*/React.createElement(SPageInput, _ref15.cn("SPageInput", _objectSpread({}, _assignProps8({
446
+ }), getI18nText('pageInputLabel')), /*#__PURE__*/React.createElement(SPageInput, _ref13.cn("SPageInput", _objectSpread({}, _assignProps8({
450
447
  "controlsLength": Children.origin ? undefined : 2,
451
448
  "locale": locale
452
- }, _ref8))), Children.origin ? /*#__PURE__*/React.createElement(Children, _ref15.cn("Children", {})) : /*#__PURE__*/React.createElement(Pagination.PageInput.Value, {
453
- id: "pagination-input-".concat(uid)
454
- })));
449
+ }, _ref8))), Children.origin ? /*#__PURE__*/React.createElement(Children, _ref13.cn("Children", {})) : /*#__PURE__*/React.createElement(Pagination.PageInput.Value, null)));
455
450
  }
456
451
  }]);
457
- return PageInput;
458
452
  }(Component);
459
453
  _defineProperty(PageInput, "enhance", [uniqueIDEnhancement()]);
460
454
  var Pagination = createComponent(PaginationRoot, {