@instructure/ui-pagination 8.17.1-snapshot.82 → 8.18.1-snapshot.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 CHANGED
@@ -3,6 +3,10 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # [8.18.0](https://github.com/instructure/instructure-ui/compare/v8.17.0...v8.18.0) (2022-02-23)
7
+
8
+ **Note:** Version bump only for package @instructure/ui-pagination
9
+
6
10
  # [8.17.0](https://github.com/instructure/instructure-ui/compare/v8.16.0...v8.17.0) (2022-02-07)
7
11
 
8
12
  ### Bug Fixes
@@ -104,11 +104,15 @@ let PaginationPageInput = (_dec = withStyle(generateStyle, generateComponentThem
104
104
  }
105
105
 
106
106
  componentDidMount() {
107
- this.props.makeStyles?.();
107
+ var _this$props$makeStyle, _this$props;
108
+
109
+ (_this$props$makeStyle = (_this$props = this.props).makeStyles) === null || _this$props$makeStyle === void 0 ? void 0 : _this$props$makeStyle.call(_this$props);
108
110
  }
109
111
 
110
112
  componentDidUpdate(prevProps) {
111
- this.props.makeStyles?.(); // when the current page changes from outside (e.g.: from arrow buttons),
113
+ var _this$props$makeStyle2, _this$props2;
114
+
115
+ (_this$props$makeStyle2 = (_this$props2 = this.props).makeStyles) === null || _this$props$makeStyle2 === void 0 ? void 0 : _this$props$makeStyle2.call(_this$props2); // when the current page changes from outside (e.g.: from arrow buttons),
112
116
  // we update the initial state
113
117
 
114
118
  if (this.props.currentPageIndex !== prevProps.currentPageIndex) {
@@ -153,31 +157,31 @@ let PaginationPageInput = (_dec = withStyle(generateStyle, generateComponentThem
153
157
  }
154
158
 
155
159
  renderLabel() {
156
- const _this$props = this.props,
157
- label = _this$props.label,
158
- numberOfPages = _this$props.numberOfPages,
159
- styles = _this$props.styles;
160
+ const _this$props3 = this.props,
161
+ label = _this$props3.label,
162
+ numberOfPages = _this$props3.numberOfPages,
163
+ styles = _this$props3.styles;
160
164
  return typeof label === 'function' && label(numberOfPages) ? jsx("span", {
161
- css: styles?.inputLabel
165
+ css: styles === null || styles === void 0 ? void 0 : styles.inputLabel
162
166
  }, label(numberOfPages)) : null;
163
167
  }
164
168
 
165
169
  renderScreenReaderLabel() {
166
- const _this$props2 = this.props,
167
- screenReaderLabel = _this$props2.screenReaderLabel,
168
- numberOfPages = _this$props2.numberOfPages;
170
+ const _this$props4 = this.props,
171
+ screenReaderLabel = _this$props4.screenReaderLabel,
172
+ numberOfPages = _this$props4.numberOfPages;
169
173
  return jsx(ScreenReaderContent, null, screenReaderLabel(this.currentPage, numberOfPages));
170
174
  }
171
175
 
172
176
  render() {
173
- const _this$props3 = this.props,
174
- styles = _this$props3.styles,
175
- disabled = _this$props3.disabled;
177
+ const _this$props5 = this.props,
178
+ styles = _this$props5.styles,
179
+ disabled = _this$props5.disabled;
176
180
  return jsx("span", {
177
- css: styles?.paginationPageInput,
181
+ css: styles === null || styles === void 0 ? void 0 : styles.paginationPageInput,
178
182
  ref: this.handleRef
179
183
  }, jsx("span", {
180
- css: styles?.numberInput
184
+ css: styles === null || styles === void 0 ? void 0 : styles.numberInput
181
185
  }, jsx(NumberInput, {
182
186
  renderLabel: this.renderScreenReaderLabel(),
183
187
  onBlur: this.handleBlur,
@@ -123,11 +123,15 @@ let Pagination = (_dec = withDeterministicId(), _dec2 = withStyle(generateStyle,
123
123
  }
124
124
 
125
125
  componentDidMount() {
126
- this.props.makeStyles?.();
126
+ var _this$props$makeStyle, _this$props;
127
+
128
+ (_this$props$makeStyle = (_this$props = this.props).makeStyles) === null || _this$props$makeStyle === void 0 ? void 0 : _this$props$makeStyle.call(_this$props);
127
129
  }
128
130
 
129
131
  componentDidUpdate(prevProps, _prevState, snapshot) {
130
- this.props.makeStyles?.();
132
+ var _this$props$makeStyle2, _this$props2;
133
+
134
+ (_this$props$makeStyle2 = (_this$props2 = this.props).makeStyles) === null || _this$props$makeStyle2 === void 0 ? void 0 : _this$props$makeStyle2.call(_this$props2);
131
135
 
132
136
  if (!this.props.shouldHandleFocus || !propsHaveCompactView(prevProps) && !propsHaveCompactView(this.props)) {
133
137
  return;
@@ -195,7 +199,9 @@ let Pagination = (_dec = withDeterministicId(), _dec2 = withStyle(generateStyle,
195
199
  }
196
200
 
197
201
  handleInputChange(event, pageIndex) {
198
- this.childPages[pageIndex].props.onClick?.(event);
202
+ var _this$childPages$page, _this$childPages$page2;
203
+
204
+ (_this$childPages$page = (_this$childPages$page2 = this.childPages[pageIndex].props).onClick) === null || _this$childPages$page === void 0 ? void 0 : _this$childPages$page.call(_this$childPages$page2, event);
199
205
  }
200
206
 
201
207
  renderPages(currentPageIndex) {
@@ -272,6 +278,8 @@ let Pagination = (_dec = withDeterministicId(), _dec2 = withStyle(generateStyle,
272
278
  }
273
279
 
274
280
  renderArrowButton(direction, currentPageIndex) {
281
+ var _page$props, _page$props2;
282
+
275
283
  const childPages = this.childPages; // We don't display the arrows in "compact" variant under 6 items
276
284
 
277
285
  if (!(propsHaveCompactView(this.props) || this.inputMode)) {
@@ -289,8 +297,8 @@ let Pagination = (_dec = withDeterministicId(), _dec2 = withStyle(generateStyle,
289
297
  handleButtonRef = _this$getArrowVariant.handleButtonRef;
290
298
 
291
299
  const page = childPages[pageIndex];
292
- const disabled = page?.props?.disabled || this.props.disabled || !shouldEnableIcon;
293
- const onClick = page?.props?.onClick;
300
+ const disabled = (page === null || page === void 0 ? void 0 : (_page$props = page.props) === null || _page$props === void 0 ? void 0 : _page$props.disabled) || this.props.disabled || !shouldEnableIcon;
301
+ const onClick = page === null || page === void 0 ? void 0 : (_page$props2 = page.props) === null || _page$props2 === void 0 ? void 0 : _page$props2.onClick;
294
302
  return shouldEnableIcon || this.showDisabledButtons ? jsx(PaginationArrowButton, {
295
303
  direction: direction,
296
304
  "data-direction": direction,
@@ -302,6 +310,8 @@ let Pagination = (_dec = withDeterministicId(), _dec2 = withStyle(generateStyle,
302
310
  }
303
311
 
304
312
  render() {
313
+ var _this$props$styles, _this$props$styles2;
314
+
305
315
  if (!this.props.children) return null;
306
316
  const currentPageIndex = fastFindIndex(this.childPages, p => p && p.props && p.props.current);
307
317
  const passthroughProps = View.omitViewProps(omitProps(this.props, Pagination.allowedProps), Pagination);
@@ -310,11 +320,11 @@ let Pagination = (_dec = withDeterministicId(), _dec2 = withStyle(generateStyle,
310
320
  as: this.props.as,
311
321
  elementRef: this.handleElementRef,
312
322
  margin: this.props.margin,
313
- css: this.props.styles?.pagination,
323
+ css: (_this$props$styles = this.props.styles) === null || _this$props$styles === void 0 ? void 0 : _this$props$styles.pagination,
314
324
  "aria-labelledby": this.props.label ? this._labelId : void 0
315
325
  }), this.props.label && this.renderLabel(), jsx(View, {
316
326
  display: "inline-block",
317
- css: this.props.styles?.pages
327
+ css: (_this$props$styles2 = this.props.styles) === null || _this$props$styles2 === void 0 ? void 0 : _this$props$styles2.pages
318
328
  }, this.renderArrowButton('first', currentPageIndex), this.renderArrowButton('prev', currentPageIndex), this.inputMode ? this.renderPageInput(currentPageIndex) : this.renderPages(currentPageIndex), this.renderArrowButton('next', currentPageIndex), this.renderArrowButton('last', currentPageIndex)));
319
329
  }
320
330
 
@@ -97,11 +97,15 @@ let PaginationPageInput = (_dec = (0, _emotion.withStyle)(_styles.default, _them
97
97
  }
98
98
 
99
99
  componentDidMount() {
100
- this.props.makeStyles?.();
100
+ var _this$props$makeStyle, _this$props;
101
+
102
+ (_this$props$makeStyle = (_this$props = this.props).makeStyles) === null || _this$props$makeStyle === void 0 ? void 0 : _this$props$makeStyle.call(_this$props);
101
103
  }
102
104
 
103
105
  componentDidUpdate(prevProps) {
104
- this.props.makeStyles?.(); // when the current page changes from outside (e.g.: from arrow buttons),
106
+ var _this$props$makeStyle2, _this$props2;
107
+
108
+ (_this$props$makeStyle2 = (_this$props2 = this.props).makeStyles) === null || _this$props$makeStyle2 === void 0 ? void 0 : _this$props$makeStyle2.call(_this$props2); // when the current page changes from outside (e.g.: from arrow buttons),
105
109
  // we update the initial state
106
110
 
107
111
  if (this.props.currentPageIndex !== prevProps.currentPageIndex) {
@@ -146,31 +150,31 @@ let PaginationPageInput = (_dec = (0, _emotion.withStyle)(_styles.default, _them
146
150
  }
147
151
 
148
152
  renderLabel() {
149
- const _this$props = this.props,
150
- label = _this$props.label,
151
- numberOfPages = _this$props.numberOfPages,
152
- styles = _this$props.styles;
153
+ const _this$props3 = this.props,
154
+ label = _this$props3.label,
155
+ numberOfPages = _this$props3.numberOfPages,
156
+ styles = _this$props3.styles;
153
157
  return typeof label === 'function' && label(numberOfPages) ? (0, _emotion.jsx)("span", {
154
- css: styles?.inputLabel
158
+ css: styles === null || styles === void 0 ? void 0 : styles.inputLabel
155
159
  }, label(numberOfPages)) : null;
156
160
  }
157
161
 
158
162
  renderScreenReaderLabel() {
159
- const _this$props2 = this.props,
160
- screenReaderLabel = _this$props2.screenReaderLabel,
161
- numberOfPages = _this$props2.numberOfPages;
163
+ const _this$props4 = this.props,
164
+ screenReaderLabel = _this$props4.screenReaderLabel,
165
+ numberOfPages = _this$props4.numberOfPages;
162
166
  return (0, _emotion.jsx)(_ScreenReaderContent.ScreenReaderContent, null, screenReaderLabel(this.currentPage, numberOfPages));
163
167
  }
164
168
 
165
169
  render() {
166
- const _this$props3 = this.props,
167
- styles = _this$props3.styles,
168
- disabled = _this$props3.disabled;
170
+ const _this$props5 = this.props,
171
+ styles = _this$props5.styles,
172
+ disabled = _this$props5.disabled;
169
173
  return (0, _emotion.jsx)("span", {
170
- css: styles?.paginationPageInput,
174
+ css: styles === null || styles === void 0 ? void 0 : styles.paginationPageInput,
171
175
  ref: this.handleRef
172
176
  }, (0, _emotion.jsx)("span", {
173
- css: styles?.numberInput
177
+ css: styles === null || styles === void 0 ? void 0 : styles.numberInput
174
178
  }, (0, _emotion.jsx)(_NumberInput.NumberInput, {
175
179
  renderLabel: this.renderScreenReaderLabel(),
176
180
  onBlur: this.handleBlur,
@@ -131,11 +131,15 @@ let Pagination = (_dec = (0, _withDeterministicId.withDeterministicId)(), _dec2
131
131
  }
132
132
 
133
133
  componentDidMount() {
134
- this.props.makeStyles?.();
134
+ var _this$props$makeStyle, _this$props;
135
+
136
+ (_this$props$makeStyle = (_this$props = this.props).makeStyles) === null || _this$props$makeStyle === void 0 ? void 0 : _this$props$makeStyle.call(_this$props);
135
137
  }
136
138
 
137
139
  componentDidUpdate(prevProps, _prevState, snapshot) {
138
- this.props.makeStyles?.();
140
+ var _this$props$makeStyle2, _this$props2;
141
+
142
+ (_this$props$makeStyle2 = (_this$props2 = this.props).makeStyles) === null || _this$props$makeStyle2 === void 0 ? void 0 : _this$props$makeStyle2.call(_this$props2);
139
143
 
140
144
  if (!this.props.shouldHandleFocus || !propsHaveCompactView(prevProps) && !propsHaveCompactView(this.props)) {
141
145
  return;
@@ -203,7 +207,9 @@ let Pagination = (_dec = (0, _withDeterministicId.withDeterministicId)(), _dec2
203
207
  }
204
208
 
205
209
  handleInputChange(event, pageIndex) {
206
- this.childPages[pageIndex].props.onClick?.(event);
210
+ var _this$childPages$page, _this$childPages$page2;
211
+
212
+ (_this$childPages$page = (_this$childPages$page2 = this.childPages[pageIndex].props).onClick) === null || _this$childPages$page === void 0 ? void 0 : _this$childPages$page.call(_this$childPages$page2, event);
207
213
  }
208
214
 
209
215
  renderPages(currentPageIndex) {
@@ -280,6 +286,8 @@ let Pagination = (_dec = (0, _withDeterministicId.withDeterministicId)(), _dec2
280
286
  }
281
287
 
282
288
  renderArrowButton(direction, currentPageIndex) {
289
+ var _page$props, _page$props2;
290
+
283
291
  const childPages = this.childPages; // We don't display the arrows in "compact" variant under 6 items
284
292
 
285
293
  if (!(propsHaveCompactView(this.props) || this.inputMode)) {
@@ -297,8 +305,8 @@ let Pagination = (_dec = (0, _withDeterministicId.withDeterministicId)(), _dec2
297
305
  handleButtonRef = _this$getArrowVariant.handleButtonRef;
298
306
 
299
307
  const page = childPages[pageIndex];
300
- const disabled = page?.props?.disabled || this.props.disabled || !shouldEnableIcon;
301
- const onClick = page?.props?.onClick;
308
+ const disabled = (page === null || page === void 0 ? void 0 : (_page$props = page.props) === null || _page$props === void 0 ? void 0 : _page$props.disabled) || this.props.disabled || !shouldEnableIcon;
309
+ const onClick = page === null || page === void 0 ? void 0 : (_page$props2 = page.props) === null || _page$props2 === void 0 ? void 0 : _page$props2.onClick;
302
310
  return shouldEnableIcon || this.showDisabledButtons ? (0, _emotion.jsx)(_PaginationArrowButton.PaginationArrowButton, {
303
311
  direction: direction,
304
312
  "data-direction": direction,
@@ -310,6 +318,8 @@ let Pagination = (_dec = (0, _withDeterministicId.withDeterministicId)(), _dec2
310
318
  }
311
319
 
312
320
  render() {
321
+ var _this$props$styles, _this$props$styles2;
322
+
313
323
  if (!this.props.children) return null;
314
324
  const currentPageIndex = fastFindIndex(this.childPages, p => p && p.props && p.props.current);
315
325
 
@@ -320,11 +330,11 @@ let Pagination = (_dec = (0, _withDeterministicId.withDeterministicId)(), _dec2
320
330
  as: this.props.as,
321
331
  elementRef: this.handleElementRef,
322
332
  margin: this.props.margin,
323
- css: this.props.styles?.pagination,
333
+ css: (_this$props$styles = this.props.styles) === null || _this$props$styles === void 0 ? void 0 : _this$props$styles.pagination,
324
334
  "aria-labelledby": this.props.label ? this._labelId : void 0
325
335
  }), this.props.label && this.renderLabel(), (0, _emotion.jsx)(_View.View, {
326
336
  display: "inline-block",
327
- css: this.props.styles?.pages
337
+ css: (_this$props$styles2 = this.props.styles) === null || _this$props$styles2 === void 0 ? void 0 : _this$props$styles2.pages
328
338
  }, this.renderArrowButton('first', currentPageIndex), this.renderArrowButton('prev', currentPageIndex), this.inputMode ? this.renderPageInput(currentPageIndex) : this.renderPages(currentPageIndex), this.renderArrowButton('next', currentPageIndex), this.renderArrowButton('last', currentPageIndex)));
329
339
  }
330
340
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@instructure/ui-pagination",
3
- "version": "8.17.1-snapshot.82+96244a097",
3
+ "version": "8.18.1-snapshot.1+669aa5892",
4
4
  "description": "A UI component library made by Instructure Inc.",
5
5
  "author": "Instructure, Inc. Engineering and Product Design",
6
6
  "module": "./es/index.js",
@@ -23,29 +23,29 @@
23
23
  },
24
24
  "license": "MIT",
25
25
  "devDependencies": {
26
- "@instructure/ui-babel-preset": "8.17.1-snapshot.82+96244a097",
27
- "@instructure/ui-test-locator": "8.17.1-snapshot.82+96244a097",
28
- "@instructure/ui-test-queries": "8.17.1-snapshot.82+96244a097",
29
- "@instructure/ui-test-utils": "8.17.1-snapshot.82+96244a097"
26
+ "@instructure/ui-babel-preset": "8.18.1-snapshot.1+669aa5892",
27
+ "@instructure/ui-test-locator": "8.18.1-snapshot.1+669aa5892",
28
+ "@instructure/ui-test-queries": "8.18.1-snapshot.1+669aa5892",
29
+ "@instructure/ui-test-utils": "8.18.1-snapshot.1+669aa5892"
30
30
  },
31
31
  "dependencies": {
32
32
  "@babel/runtime": "^7.13.10",
33
- "@instructure/emotion": "8.17.1-snapshot.82+96244a097",
34
- "@instructure/shared-types": "8.17.1-snapshot.82+96244a097",
35
- "@instructure/ui-a11y-content": "8.17.1-snapshot.82+96244a097",
36
- "@instructure/ui-a11y-utils": "8.17.1-snapshot.82+96244a097",
37
- "@instructure/ui-buttons": "8.17.1-snapshot.82+96244a097",
38
- "@instructure/ui-dom-utils": "8.17.1-snapshot.82+96244a097",
39
- "@instructure/ui-icons": "8.17.1-snapshot.82+96244a097",
40
- "@instructure/ui-number-input": "8.17.1-snapshot.82+96244a097",
41
- "@instructure/ui-portal": "8.17.1-snapshot.82+96244a097",
42
- "@instructure/ui-prop-types": "8.17.1-snapshot.82+96244a097",
43
- "@instructure/ui-react-utils": "8.17.1-snapshot.82+96244a097",
44
- "@instructure/ui-testable": "8.17.1-snapshot.82+96244a097",
45
- "@instructure/ui-tooltip": "8.17.1-snapshot.82+96244a097",
46
- "@instructure/ui-utils": "8.17.1-snapshot.82+96244a097",
47
- "@instructure/ui-view": "8.17.1-snapshot.82+96244a097",
48
- "@instructure/uid": "8.17.1-snapshot.82+96244a097",
33
+ "@instructure/emotion": "8.18.1-snapshot.1+669aa5892",
34
+ "@instructure/shared-types": "8.18.1-snapshot.1+669aa5892",
35
+ "@instructure/ui-a11y-content": "8.18.1-snapshot.1+669aa5892",
36
+ "@instructure/ui-a11y-utils": "8.18.1-snapshot.1+669aa5892",
37
+ "@instructure/ui-buttons": "8.18.1-snapshot.1+669aa5892",
38
+ "@instructure/ui-dom-utils": "8.18.1-snapshot.1+669aa5892",
39
+ "@instructure/ui-icons": "8.18.1-snapshot.1+669aa5892",
40
+ "@instructure/ui-number-input": "8.18.1-snapshot.1+669aa5892",
41
+ "@instructure/ui-portal": "8.18.1-snapshot.1+669aa5892",
42
+ "@instructure/ui-prop-types": "8.18.1-snapshot.1+669aa5892",
43
+ "@instructure/ui-react-utils": "8.18.1-snapshot.1+669aa5892",
44
+ "@instructure/ui-testable": "8.18.1-snapshot.1+669aa5892",
45
+ "@instructure/ui-tooltip": "8.18.1-snapshot.1+669aa5892",
46
+ "@instructure/ui-utils": "8.18.1-snapshot.1+669aa5892",
47
+ "@instructure/ui-view": "8.18.1-snapshot.1+669aa5892",
48
+ "@instructure/uid": "8.18.1-snapshot.1+669aa5892",
49
49
  "keycode": "^2",
50
50
  "prop-types": "^15"
51
51
  },
@@ -56,5 +56,5 @@
56
56
  "access": "public"
57
57
  },
58
58
  "sideEffects": false,
59
- "gitHead": "96244a097dffef5f10bbe7979c580581c787083e"
59
+ "gitHead": "669aa58926b123028bcb9e39427d36910b78b0d1"
60
60
  }