@primer/react 37.19.0 → 37.19.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
@@ -1,5 +1,13 @@
1
1
  # @primer/react
2
2
 
3
+ ## 37.19.1
4
+
5
+ ### Patch Changes
6
+
7
+ - Update data table pagination pageEnd to handle zero based index
8
+
9
+ - [`b926c08`](https://github.com/primer/react/commit/b926c08f8e3a2c6578014edd6bf0ee0d095065c7) Thanks [@AAugustine](https://github.com/AAugustine)! - Update data table pagination pageEnd to handle zero based index
10
+
3
11
  ## 37.19.0
4
12
 
5
13
  ### Minor Changes
@@ -205,7 +205,7 @@ function Range({
205
205
  totalCount
206
206
  }) {
207
207
  const start = pageStart + 1;
208
- const end = pageEnd === totalCount - 1 ? totalCount : pageEnd;
208
+ const end = pageEnd;
209
209
  return /*#__PURE__*/React__default.default.createElement(React__default.default.Fragment, null, /*#__PURE__*/React__default.default.createElement(LiveRegion.Message, {
210
210
  value: `Showing ${start} through ${end} of ${totalCount}`
211
211
  }), /*#__PURE__*/React__default.default.createElement("p", {
@@ -272,7 +272,7 @@ function usePagination(config) {
272
272
  });
273
273
  }
274
274
  const pageStart = pageIndex * pageSize;
275
- const pageEnd = Math.min(pageIndex * pageSize + pageSize, totalCount - 1);
275
+ const pageEnd = Math.min((pageIndex + 1) * pageSize, totalCount);
276
276
  const hasNextPage = pageIndex + 1 < pageCount;
277
277
  const hasPreviousPage = pageIndex > 0;
278
278
  function selectPage(newPageIndex) {
@@ -198,7 +198,7 @@ function Range({
198
198
  totalCount
199
199
  }) {
200
200
  const start = pageStart + 1;
201
- const end = pageEnd === totalCount - 1 ? totalCount : pageEnd;
201
+ const end = pageEnd;
202
202
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Message, {
203
203
  value: `Showing ${start} through ${end} of ${totalCount}`
204
204
  }), /*#__PURE__*/React.createElement("p", {
@@ -265,7 +265,7 @@ function usePagination(config) {
265
265
  });
266
266
  }
267
267
  const pageStart = pageIndex * pageSize;
268
- const pageEnd = Math.min(pageIndex * pageSize + pageSize, totalCount - 1);
268
+ const pageEnd = Math.min((pageIndex + 1) * pageSize, totalCount);
269
269
  const hasNextPage = pageIndex + 1 < pageCount;
270
270
  const hasPreviousPage = pageIndex > 0;
271
271
  function selectPage(newPageIndex) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@primer/react",
3
- "version": "37.19.0",
3
+ "version": "37.19.1",
4
4
  "description": "An implementation of GitHub's Primer Design System using React",
5
5
  "main": "lib/index.js",
6
6
  "module": "lib-esm/index.js",
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=disabled.ActionBar.Figma.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"disabled.ActionBar.Figma.d.ts","sourceRoot":"","sources":["../../src/ActionBar/disabled.ActionBar.Figma.tsx"],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=disabled.ActionBar.Figma.d.ts.map