react-day-picker 8.3.1 → 8.3.3
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.js
CHANGED
|
@@ -1320,7 +1320,14 @@ displayMonth) {
|
|
|
1320
1320
|
return activeModifiers;
|
|
1321
1321
|
}
|
|
1322
1322
|
|
|
1323
|
-
/**
|
|
1323
|
+
/**
|
|
1324
|
+
* Returns the day that should be the target of the focus when DayPicker is
|
|
1325
|
+
* rendered the first time.
|
|
1326
|
+
*
|
|
1327
|
+
* TODO: this function doesn't consider if the day is outside the month. We
|
|
1328
|
+
* implemented this check in `useDayRender` but it should probably go here. See
|
|
1329
|
+
* https://github.com/gpbl/react-day-picker/pull/1576
|
|
1330
|
+
*/
|
|
1324
1331
|
function getInitialFocusTarget(displayMonths, modifiers) {
|
|
1325
1332
|
var firstDayInMonth = startOfMonth__default["default"](displayMonths[0]);
|
|
1326
1333
|
var lastDayInMonth = endOfMonth__default["default"](displayMonths[displayMonths.length - 1]);
|
|
@@ -1796,7 +1803,9 @@ buttonRef) {
|
|
|
1796
1803
|
children: children,
|
|
1797
1804
|
'aria-label': ariaLabel
|
|
1798
1805
|
};
|
|
1799
|
-
var isFocusTarget =
|
|
1806
|
+
var isFocusTarget = focusContext.focusTarget &&
|
|
1807
|
+
isSameDay__default["default"](focusContext.focusTarget, day) &&
|
|
1808
|
+
!activeModifiers.outside;
|
|
1800
1809
|
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);
|
|
1801
1810
|
var dayRender = {
|
|
1802
1811
|
isButton: isButton,
|