@spscommerce/ds-react 5.33.8 → 5.33.11
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/fieldset/SpsFieldset.d.ts +1 -1
- package/lib/index.cjs.js +55 -55
- package/lib/index.es.js +14 -18
- package/package.json +11 -11
package/lib/index.es.js
CHANGED
|
@@ -2415,7 +2415,7 @@ const SpsOptionList = React.forwardRef((props2, ref2) => {
|
|
|
2415
2415
|
ref: optionsRef,
|
|
2416
2416
|
"data-testid": `${testId}-options`,
|
|
2417
2417
|
style: optionsInlineStyles
|
|
2418
|
-
}, !loading && !searchState.pending && zeroState &&
|
|
2418
|
+
}, !loading && !searchState.pending && zeroState && optionList.length === 0 && /* @__PURE__ */ React.createElement("div", {
|
|
2419
2419
|
className: "sps-option-list__zero-state"
|
|
2420
2420
|
}, zeroState), (loading || searchState.pending) && /* @__PURE__ */ React.createElement("div", {
|
|
2421
2421
|
className: "sps-option-list__loading"
|
|
@@ -23060,7 +23060,7 @@ function SpsFieldset({
|
|
|
23060
23060
|
legend,
|
|
23061
23061
|
unsafelyReplaceClassName,
|
|
23062
23062
|
optional = false,
|
|
23063
|
-
enabled,
|
|
23063
|
+
enabled = false,
|
|
23064
23064
|
onToggled,
|
|
23065
23065
|
tooltip,
|
|
23066
23066
|
"data-testid": testId
|
|
@@ -23070,14 +23070,9 @@ function SpsFieldset({
|
|
|
23070
23070
|
const infoCircleElement = React.useRef(null);
|
|
23071
23071
|
const [showTip, setShowTip] = React.useState(TooltipVisibility.HIDDEN);
|
|
23072
23072
|
const [wasFocused, setWasFocused] = React.useState(false);
|
|
23073
|
-
const [isChecked,
|
|
23074
|
-
|
|
23075
|
-
|
|
23076
|
-
}, [enabled]);
|
|
23077
|
-
React.useEffect(() => {
|
|
23078
|
-
if (typeof onToggled === "function") {
|
|
23079
|
-
onToggled(isChecked);
|
|
23080
|
-
}
|
|
23073
|
+
const [isChecked, setIsChecked] = React.useState(enabled);
|
|
23074
|
+
useDidUpdateEffect(() => {
|
|
23075
|
+
onToggled == null ? void 0 : onToggled(isChecked);
|
|
23081
23076
|
}, [isChecked]);
|
|
23082
23077
|
React.useEffect(() => {
|
|
23083
23078
|
if (formControlSet || formMeta) {
|
|
@@ -23109,7 +23104,7 @@ function SpsFieldset({
|
|
|
23109
23104
|
checked: isChecked,
|
|
23110
23105
|
className: "d-inline-flex",
|
|
23111
23106
|
onChange: () => {
|
|
23112
|
-
|
|
23107
|
+
setIsChecked(!isChecked);
|
|
23113
23108
|
},
|
|
23114
23109
|
"data-testid": `${testId}__checkbox`
|
|
23115
23110
|
}), legend, tooltip && /* @__PURE__ */ React.createElement("span", {
|
|
@@ -31111,7 +31106,7 @@ function SpsPageSelector(props2) {
|
|
|
31111
31106
|
}, [pageProp]);
|
|
31112
31107
|
function updatePage(newPage) {
|
|
31113
31108
|
const constrainedPage = constrain(newPage, [1, numPages]);
|
|
31114
|
-
if (
|
|
31109
|
+
if (newPage !== page) {
|
|
31115
31110
|
setPage(constrainedPage);
|
|
31116
31111
|
setInputPage(constrainedPage);
|
|
31117
31112
|
if (onPageChange && typeof onPageChange === "function") {
|
|
@@ -31119,10 +31114,8 @@ function SpsPageSelector(props2) {
|
|
|
31119
31114
|
}
|
|
31120
31115
|
}
|
|
31121
31116
|
}
|
|
31122
|
-
const debouncedPageUpdate = debounce(updatePage, 500);
|
|
31123
31117
|
function onTextInputInput(event) {
|
|
31124
|
-
setInputPage(event.target.value);
|
|
31125
|
-
void debouncedPageUpdate(parseInt(event.target.value, 10));
|
|
31118
|
+
setInputPage(Number(event.target.value) || "");
|
|
31126
31119
|
}
|
|
31127
31120
|
const classes = clsx(unsafelyReplaceClassName || "sps-page-selector", className);
|
|
31128
31121
|
const id2 = useElementId(null);
|
|
@@ -31137,7 +31130,9 @@ function SpsPageSelector(props2) {
|
|
|
31137
31130
|
}, inputPage), /* @__PURE__ */ React.createElement("label", {
|
|
31138
31131
|
htmlFor: id2.current,
|
|
31139
31132
|
className: "sr-only"
|
|
31140
|
-
}, t2("design-system:pagination.page")), /* @__PURE__ */ React.createElement(
|
|
31133
|
+
}, t2("design-system:pagination.page")), /* @__PURE__ */ React.createElement(SpsForm, {
|
|
31134
|
+
onSubmit: () => updatePage(Number(inputPage))
|
|
31135
|
+
}, /* @__PURE__ */ React.createElement("input", {
|
|
31141
31136
|
id: id2.current,
|
|
31142
31137
|
type: "text",
|
|
31143
31138
|
value: inputPage,
|
|
@@ -31145,8 +31140,9 @@ function SpsPageSelector(props2) {
|
|
|
31145
31140
|
onChange: () => {
|
|
31146
31141
|
},
|
|
31147
31142
|
className: "sps-form-control sps-pagination__input",
|
|
31148
|
-
disabled
|
|
31149
|
-
|
|
31143
|
+
disabled,
|
|
31144
|
+
onBlur: () => updatePage(Number(inputPage))
|
|
31145
|
+
}))), /* @__PURE__ */ React.createElement("span", {
|
|
31150
31146
|
className: "sps-page-selector__total-pages",
|
|
31151
31147
|
"data-testid": `${testId}_page-count`
|
|
31152
31148
|
}, 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.11",
|
|
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.11",
|
|
32
|
+
"@spscommerce/ds-illustrations": "5.33.11",
|
|
33
|
+
"@spscommerce/ds-shared": "5.33.11",
|
|
34
|
+
"@spscommerce/positioning": "5.33.11",
|
|
35
|
+
"@spscommerce/utils": "5.33.11",
|
|
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.11",
|
|
44
|
+
"@spscommerce/ds-illustrations": "5.33.11",
|
|
45
|
+
"@spscommerce/ds-shared": "5.33.11",
|
|
46
|
+
"@spscommerce/positioning": "5.33.11",
|
|
47
|
+
"@spscommerce/utils": "5.33.11",
|
|
48
48
|
"@testing-library/react": "^9.3.2",
|
|
49
49
|
"@types/prop-types": "^15.7.1",
|
|
50
50
|
"@types/react": "^16.9.0",
|