@spscommerce/ds-react 4.29.0 → 4.30.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/lib/index.cjs.js +63 -63
- package/lib/index.es.js +12 -4
- package/package.json +9 -9
package/lib/index.es.js
CHANGED
|
@@ -22799,7 +22799,7 @@ const SimpleDateUtils = Object.freeze({
|
|
|
22799
22799
|
nextMonth(date2) {
|
|
22800
22800
|
return Object.freeze({
|
|
22801
22801
|
year: date2.month === 12 ? date2.year + 1 : date2.year,
|
|
22802
|
-
month:
|
|
22802
|
+
month: date2.month + 1 > 12 ? 1 : date2.month + 1,
|
|
22803
22803
|
date: date2.date
|
|
22804
22804
|
});
|
|
22805
22805
|
}
|
|
@@ -36371,10 +36371,11 @@ function SpsDatepickerCalendar(props2) {
|
|
|
36371
36371
|
const cal = useCalendar(viewMonth);
|
|
36372
36372
|
const [mouseoverDate, setMouseoverDate] = React.useState();
|
|
36373
36373
|
function viewPreviousMonth() {
|
|
36374
|
-
|
|
36374
|
+
const newDate = SimpleDateUtils.prevMonth(__spreadProps(__spreadValues({}, viewMonth), { date: 15 }));
|
|
36375
|
+
setViewMonth(newDate);
|
|
36375
36376
|
}
|
|
36376
36377
|
function viewNextMonth() {
|
|
36377
|
-
setViewMonth(SimpleDateUtils.nextMonth(viewMonth));
|
|
36378
|
+
setViewMonth(SimpleDateUtils.nextMonth(__spreadProps(__spreadValues({}, viewMonth), { date: 15 })));
|
|
36378
36379
|
}
|
|
36379
36380
|
function handleMouseEnter(event) {
|
|
36380
36381
|
if (event.target && event.target.classList.contains(`${CSS_ELEMENT$1}-day`)) {
|
|
@@ -36551,6 +36552,11 @@ function SpsDatepickerV2(_W) {
|
|
|
36551
36552
|
updateValue();
|
|
36552
36553
|
}
|
|
36553
36554
|
const classes = clsx(CSS_BLOCK$1, "sps-text-input", showPopup && `${CSS_BLOCK$1}--open`, className);
|
|
36555
|
+
React.useEffect(() => {
|
|
36556
|
+
if (!value || SimpleDateUtils.isValid(value)) {
|
|
36557
|
+
setStringValue(SimpleDateUtils.toString(value));
|
|
36558
|
+
}
|
|
36559
|
+
}, [value]);
|
|
36554
36560
|
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(SpsFormComponentWrapper, {
|
|
36555
36561
|
id: wrapperId,
|
|
36556
36562
|
className: classes,
|
|
@@ -36711,7 +36717,9 @@ function SpsDateRangePickerV2(_Y) {
|
|
|
36711
36717
|
if (!value) {
|
|
36712
36718
|
clear();
|
|
36713
36719
|
} else if (Array.isArray(value)) {
|
|
36714
|
-
|
|
36720
|
+
if (value.every((v2) => SimpleDateUtils.isValid(v2))) {
|
|
36721
|
+
setStringValue(SimpleDateUtils.toStringRange(value));
|
|
36722
|
+
}
|
|
36715
36723
|
setDisplayRange(null);
|
|
36716
36724
|
} else if (typeof value.definition === "function") {
|
|
36717
36725
|
setDisplayRange(value.definition());
|
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": "4.
|
|
4
|
+
"version": "4.30.1",
|
|
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,10 +28,10 @@
|
|
|
28
28
|
},
|
|
29
29
|
"peerDependencies": {
|
|
30
30
|
"@react-stately/collections": "^3.3.3",
|
|
31
|
-
"@spscommerce/ds-colors": "4.
|
|
32
|
-
"@spscommerce/ds-shared": "4.
|
|
33
|
-
"@spscommerce/positioning": "4.
|
|
34
|
-
"@spscommerce/utils": "4.
|
|
31
|
+
"@spscommerce/ds-colors": "4.30.1",
|
|
32
|
+
"@spscommerce/ds-shared": "4.30.1",
|
|
33
|
+
"@spscommerce/positioning": "4.30.1",
|
|
34
|
+
"@spscommerce/utils": "4.30.1",
|
|
35
35
|
"moment": "^2.25.3",
|
|
36
36
|
"moment-timezone": "^0.5.28",
|
|
37
37
|
"react": "^16.9.0",
|
|
@@ -39,10 +39,10 @@
|
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
41
|
"@react-stately/collections": "^3.3.3",
|
|
42
|
-
"@spscommerce/ds-colors": "4.
|
|
43
|
-
"@spscommerce/ds-shared": "4.
|
|
44
|
-
"@spscommerce/positioning": "4.
|
|
45
|
-
"@spscommerce/utils": "4.
|
|
42
|
+
"@spscommerce/ds-colors": "4.30.1",
|
|
43
|
+
"@spscommerce/ds-shared": "4.30.1",
|
|
44
|
+
"@spscommerce/positioning": "4.30.1",
|
|
45
|
+
"@spscommerce/utils": "4.30.1",
|
|
46
46
|
"@testing-library/jest-dom": "^4.2.4",
|
|
47
47
|
"@testing-library/react": "^9.3.2",
|
|
48
48
|
"@types/prop-types": "^15.7.1",
|