@spscommerce/ds-react 5.33.9 → 5.33.10
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/lib/index.cjs.js +22 -22
- package/lib/index.es.js +8 -7
- package/package.json +11 -11
package/lib/index.es.js
CHANGED
|
@@ -31111,7 +31111,7 @@ function SpsPageSelector(props2) {
|
|
|
31111
31111
|
}, [pageProp]);
|
|
31112
31112
|
function updatePage(newPage) {
|
|
31113
31113
|
const constrainedPage = constrain(newPage, [1, numPages]);
|
|
31114
|
-
if (
|
|
31114
|
+
if (newPage !== page) {
|
|
31115
31115
|
setPage(constrainedPage);
|
|
31116
31116
|
setInputPage(constrainedPage);
|
|
31117
31117
|
if (onPageChange && typeof onPageChange === "function") {
|
|
@@ -31119,10 +31119,8 @@ function SpsPageSelector(props2) {
|
|
|
31119
31119
|
}
|
|
31120
31120
|
}
|
|
31121
31121
|
}
|
|
31122
|
-
const debouncedPageUpdate = debounce(updatePage, 500);
|
|
31123
31122
|
function onTextInputInput(event) {
|
|
31124
|
-
setInputPage(event.target.value);
|
|
31125
|
-
void debouncedPageUpdate(parseInt(event.target.value, 10));
|
|
31123
|
+
setInputPage(Number(event.target.value) || "");
|
|
31126
31124
|
}
|
|
31127
31125
|
const classes = clsx(unsafelyReplaceClassName || "sps-page-selector", className);
|
|
31128
31126
|
const id2 = useElementId(null);
|
|
@@ -31137,7 +31135,9 @@ function SpsPageSelector(props2) {
|
|
|
31137
31135
|
}, inputPage), /* @__PURE__ */ React.createElement("label", {
|
|
31138
31136
|
htmlFor: id2.current,
|
|
31139
31137
|
className: "sr-only"
|
|
31140
|
-
}, t2("design-system:pagination.page")), /* @__PURE__ */ React.createElement(
|
|
31138
|
+
}, t2("design-system:pagination.page")), /* @__PURE__ */ React.createElement(SpsForm, {
|
|
31139
|
+
onSubmit: () => updatePage(Number(inputPage))
|
|
31140
|
+
}, /* @__PURE__ */ React.createElement("input", {
|
|
31141
31141
|
id: id2.current,
|
|
31142
31142
|
type: "text",
|
|
31143
31143
|
value: inputPage,
|
|
@@ -31145,8 +31145,9 @@ function SpsPageSelector(props2) {
|
|
|
31145
31145
|
onChange: () => {
|
|
31146
31146
|
},
|
|
31147
31147
|
className: "sps-form-control sps-pagination__input",
|
|
31148
|
-
disabled
|
|
31149
|
-
|
|
31148
|
+
disabled,
|
|
31149
|
+
onBlur: () => updatePage(Number(inputPage))
|
|
31150
|
+
}))), /* @__PURE__ */ React.createElement("span", {
|
|
31150
31151
|
className: "sps-page-selector__total-pages",
|
|
31151
31152
|
"data-testid": `${testId}_page-count`
|
|
31152
31153
|
}, Number.isNaN(numPages) ? t2("design-system:pagination.ofMany") : t2("design-system:pagination.ofPageCount", { pageCount: numPages })), /* @__PURE__ */ React.createElement("div", {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@spscommerce/ds-react",
|
|
3
3
|
"description": "SPS Design System React components",
|
|
4
|
-
"version": "5.33.
|
|
4
|
+
"version": "5.33.10",
|
|
5
5
|
"author": "SPS Commerce",
|
|
6
6
|
"license": "UNLICENSED",
|
|
7
7
|
"repository": "https://github.com/spscommerce/design-system/tree/main/packages/@spscommerce/ds-react",
|
|
@@ -28,11 +28,11 @@
|
|
|
28
28
|
},
|
|
29
29
|
"peerDependencies": {
|
|
30
30
|
"@react-stately/collections": "^3.3.3",
|
|
31
|
-
"@spscommerce/ds-colors": "5.33.
|
|
32
|
-
"@spscommerce/ds-illustrations": "5.33.
|
|
33
|
-
"@spscommerce/ds-shared": "5.33.
|
|
34
|
-
"@spscommerce/positioning": "5.33.
|
|
35
|
-
"@spscommerce/utils": "5.33.
|
|
31
|
+
"@spscommerce/ds-colors": "5.33.10",
|
|
32
|
+
"@spscommerce/ds-illustrations": "5.33.10",
|
|
33
|
+
"@spscommerce/ds-shared": "5.33.10",
|
|
34
|
+
"@spscommerce/positioning": "5.33.10",
|
|
35
|
+
"@spscommerce/utils": "5.33.10",
|
|
36
36
|
"moment": "^2.25.3",
|
|
37
37
|
"moment-timezone": "^0.5.28",
|
|
38
38
|
"react": "^16.9.0",
|
|
@@ -40,11 +40,11 @@
|
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
42
|
"@react-stately/collections": "^3.3.3",
|
|
43
|
-
"@spscommerce/ds-colors": "5.33.
|
|
44
|
-
"@spscommerce/ds-illustrations": "5.33.
|
|
45
|
-
"@spscommerce/ds-shared": "5.33.
|
|
46
|
-
"@spscommerce/positioning": "5.33.
|
|
47
|
-
"@spscommerce/utils": "5.33.
|
|
43
|
+
"@spscommerce/ds-colors": "5.33.10",
|
|
44
|
+
"@spscommerce/ds-illustrations": "5.33.10",
|
|
45
|
+
"@spscommerce/ds-shared": "5.33.10",
|
|
46
|
+
"@spscommerce/positioning": "5.33.10",
|
|
47
|
+
"@spscommerce/utils": "5.33.10",
|
|
48
48
|
"@testing-library/react": "^9.3.2",
|
|
49
49
|
"@types/prop-types": "^15.7.1",
|
|
50
50
|
"@types/react": "^16.9.0",
|