@patternfly/react-core 4.202.6 → 4.202.7
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 +11 -0
- package/dist/esm/components/CalendarMonth/CalendarMonth.d.ts.map +1 -1
- package/dist/esm/components/CalendarMonth/CalendarMonth.js +2 -7
- package/dist/esm/components/CalendarMonth/CalendarMonth.js.map +1 -1
- package/dist/js/components/CalendarMonth/CalendarMonth.d.ts.map +1 -1
- package/dist/js/components/CalendarMonth/CalendarMonth.js +2 -7
- package/dist/js/components/CalendarMonth/CalendarMonth.js.map +1 -1
- package/dist/umd/react-core.css +77 -77
- package/dist/umd/react-core.js +2 -7
- package/dist/umd/react-core.min.js +1 -1
- package/package.json +5 -5
- package/src/components/CalendarMonth/CalendarMonth.tsx +2 -7
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@patternfly/react-core",
|
|
3
|
-
"version": "4.202.
|
|
3
|
+
"version": "4.202.7",
|
|
4
4
|
"description": "This library provides a set of common React components for use with the PatternFly reference implementation.",
|
|
5
5
|
"main": "dist/js/index.js",
|
|
6
6
|
"module": "dist/esm/index.js",
|
|
@@ -34,9 +34,9 @@
|
|
|
34
34
|
"generate": "node scripts/copyStyles.js"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@patternfly/react-icons": "^4.53.
|
|
38
|
-
"@patternfly/react-styles": "^4.52.
|
|
39
|
-
"@patternfly/react-tokens": "^4.54.
|
|
37
|
+
"@patternfly/react-icons": "^4.53.7",
|
|
38
|
+
"@patternfly/react-styles": "^4.52.7",
|
|
39
|
+
"@patternfly/react-tokens": "^4.54.7",
|
|
40
40
|
"focus-trap": "6.2.2",
|
|
41
41
|
"react-dropzone": "9.0.0",
|
|
42
42
|
"tippy.js": "5.1.2",
|
|
@@ -60,5 +60,5 @@
|
|
|
60
60
|
"react": "^16.8.0 || ^17.0.0",
|
|
61
61
|
"react-dom": "^16.8.0 || ^17.0.0"
|
|
62
62
|
},
|
|
63
|
-
"gitHead": "
|
|
63
|
+
"gitHead": "aa38935ea3b57607894dcc53696234838dc712d5"
|
|
64
64
|
}
|
|
@@ -110,7 +110,6 @@ export const CalendarMonth = ({
|
|
|
110
110
|
}: CalendarProps) => {
|
|
111
111
|
const longMonths = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11].map(monthNum => new Date(1990, monthNum)).map(monthFormat);
|
|
112
112
|
const [isSelectOpen, setIsSelectOpen] = React.useState(false);
|
|
113
|
-
const [selectedDate, setSelectedDate] = React.useState(new Date(dateProp));
|
|
114
113
|
// eslint-disable-next-line prefer-const
|
|
115
114
|
let [focusedDate, setFocusedDate] = React.useState(new Date(dateProp));
|
|
116
115
|
if (!isValidDate(focusedDate)) {
|
|
@@ -277,7 +276,7 @@ export const CalendarMonth = ({
|
|
|
277
276
|
{week.map(({ date, isValid }, index) => {
|
|
278
277
|
const dayFormatted = dayFormat(date);
|
|
279
278
|
const isToday = isSameDate(date, today);
|
|
280
|
-
const isSelected = isValidDate(
|
|
279
|
+
const isSelected = isValidDate(dateProp) && isSameDate(date, dateProp);
|
|
281
280
|
const isFocused = isSameDate(date, focusedDate);
|
|
282
281
|
const isAdjacentMonth = date.getMonth() !== focusedDate.getMonth();
|
|
283
282
|
let isInRange = false;
|
|
@@ -314,11 +313,7 @@ export const CalendarMonth = ({
|
|
|
314
313
|
!isValid && styles.modifiers.disabled
|
|
315
314
|
)}
|
|
316
315
|
type="button"
|
|
317
|
-
onClick={() =>
|
|
318
|
-
setSelectedDate(date);
|
|
319
|
-
setFocusedDate(date);
|
|
320
|
-
onChange(date);
|
|
321
|
-
}}
|
|
316
|
+
onClick={() => onChange(date)}
|
|
322
317
|
onMouseOver={() => setHoveredDate(date)}
|
|
323
318
|
tabIndex={isFocused ? 0 : -1}
|
|
324
319
|
disabled={!isValid}
|