react-day-picker 8.3.2 → 8.3.4
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/dist/index.esm.js +11 -2
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +11 -2
- package/dist/index.js.map +1 -1
- package/dist/react-day-picker.min.js +1 -1
- package/dist/style.module.css.d.ts +35 -35
- package/package.json +1 -1
- package/src/contexts/Focus/utils/{getInitialFocusTarget.test.tsx → getInitialFocusTarget.test.ts} +0 -0
- package/src/contexts/Focus/utils/{getInitialFocusTarget.tsx → getInitialFocusTarget.ts} +8 -1
- package/src/contexts/Focus/utils/{getNextFocus.test.tsx → getNextFocus.test.ts} +0 -0
- package/src/contexts/Focus/utils/{getNextFocus.tsx → getNextFocus.ts} +0 -0
- package/src/hooks/useDayRender/useDayRender.test.tsx +19 -0
- package/src/hooks/useDayRender/useDayRender.tsx +5 -3
package/dist/index.esm.js
CHANGED
|
@@ -1262,7 +1262,14 @@ displayMonth) {
|
|
|
1262
1262
|
return activeModifiers;
|
|
1263
1263
|
}
|
|
1264
1264
|
|
|
1265
|
-
/**
|
|
1265
|
+
/**
|
|
1266
|
+
* Returns the day that should be the target of the focus when DayPicker is
|
|
1267
|
+
* rendered the first time.
|
|
1268
|
+
*
|
|
1269
|
+
* TODO: this function doesn't consider if the day is outside the month. We
|
|
1270
|
+
* implemented this check in `useDayRender` but it should probably go here. See
|
|
1271
|
+
* https://github.com/gpbl/react-day-picker/pull/1576
|
|
1272
|
+
*/
|
|
1266
1273
|
function getInitialFocusTarget(displayMonths, modifiers) {
|
|
1267
1274
|
var firstDayInMonth = startOfMonth(displayMonths[0]);
|
|
1268
1275
|
var lastDayInMonth = endOfMonth(displayMonths[displayMonths.length - 1]);
|
|
@@ -1738,7 +1745,9 @@ buttonRef) {
|
|
|
1738
1745
|
children: children,
|
|
1739
1746
|
'aria-label': ariaLabel
|
|
1740
1747
|
};
|
|
1741
|
-
var isFocusTarget =
|
|
1748
|
+
var isFocusTarget = focusContext.focusTarget &&
|
|
1749
|
+
isSameDay(focusContext.focusTarget, day) &&
|
|
1750
|
+
!activeModifiers.outside;
|
|
1742
1751
|
var buttonProps = __assign(__assign(__assign({}, divProps), (_a = { disabled: activeModifiers.disabled }, _a['aria-pressed'] = activeModifiers.selected, _a['aria-label'] = ariaLabel, _a.tabIndex = isFocusTarget ? 0 : -1, _a)), eventHandlers);
|
|
1743
1752
|
var dayRender = {
|
|
1744
1753
|
isButton: isButton,
|