@cerebruminc/cerebellum 16.5.3-beta.dangerous.2df6625 → 16.5.3-beta.dangerous.3bc70bf

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.
Files changed (32) hide show
  1. package/README.md +3 -3
  2. package/lib/cjs/DatePicker.cjs +1 -1
  3. package/lib/cjs/Form.cjs +3 -3
  4. package/lib/cjs/FormSeparator.cjs +1 -1
  5. package/lib/cjs/{FormStyles-Cc6-_Iwt.js → FormStyles-CCsL1LJO.js} +7 -2
  6. package/lib/cjs/{FormStyles-Cc6-_Iwt.js.map → FormStyles-CCsL1LJO.js.map} +1 -1
  7. package/lib/cjs/FormWrapper.cjs +1 -1
  8. package/lib/cjs/{FormikContainer-Dn3lu30W.js → FormikContainer-BVUsbx6j.js} +3 -3
  9. package/lib/cjs/{FormikContainer-Dn3lu30W.js.map → FormikContainer-BVUsbx6j.js.map} +1 -1
  10. package/lib/cjs/{InlineDatePicker-BJZXMxnh.js → InlineDatePicker-4u82zKn2.js} +56 -206
  11. package/lib/cjs/{InlineDatePicker-BJZXMxnh.js.map → InlineDatePicker-4u82zKn2.js.map} +1 -1
  12. package/lib/cjs/InlineDatePicker.cjs +1 -1
  13. package/lib/cjs/InlineTextarea.cjs +3 -2
  14. package/lib/cjs/InlineTextarea.cjs.map +1 -1
  15. package/lib/cjs/TitleGroup.cjs +1 -1
  16. package/lib/cjs/index.cjs +3 -3
  17. package/lib/esm/DatePicker.js +1 -1
  18. package/lib/esm/Form.js +3 -3
  19. package/lib/esm/FormSeparator.js +1 -1
  20. package/lib/esm/{FormStyles-DCnDnD_Z.js → FormStyles-BSqmKCsK.js} +7 -2
  21. package/lib/esm/{FormStyles-DCnDnD_Z.js.map → FormStyles-BSqmKCsK.js.map} +1 -1
  22. package/lib/esm/FormWrapper.js +1 -1
  23. package/lib/esm/{FormikContainer-Brcmku_E.js → FormikContainer-C_iJWcIG.js} +3 -3
  24. package/lib/esm/{FormikContainer-Brcmku_E.js.map → FormikContainer-C_iJWcIG.js.map} +1 -1
  25. package/lib/esm/{InlineDatePicker-BIAcoggL.js → InlineDatePicker-RlV9iC8j.js} +57 -207
  26. package/lib/esm/{InlineDatePicker-BIAcoggL.js.map → InlineDatePicker-RlV9iC8j.js.map} +1 -1
  27. package/lib/esm/InlineDatePicker.js +1 -1
  28. package/lib/esm/InlineTextarea.js +3 -2
  29. package/lib/esm/InlineTextarea.js.map +1 -1
  30. package/lib/esm/TitleGroup.js +1 -1
  31. package/lib/esm/index.js +4 -4
  32. package/package.json +1 -1
@@ -2,7 +2,7 @@ import { b as __makeTemplateObject, f as __rest, _ as __assign } from './_tslib-
2
2
  import { jsxs, jsx } from 'react/jsx-runtime';
3
3
  import dayjs from 'dayjs';
4
4
  import * as React from 'react';
5
- import React__default, { useLayoutEffect, cloneElement, createRef, Component, useRef, useEffect, useCallback, createElement, useState, forwardRef } from 'react';
5
+ import React__default, { useLayoutEffect, cloneElement, createRef, Component, useRef, useCallback, useEffect, createElement, useState, forwardRef } from 'react';
6
6
  import * as ReactDOM from 'react-dom';
7
7
  import ReactDOM__default from 'react-dom';
8
8
  import { colors } from './colors.js';
@@ -9672,7 +9672,7 @@ function useFloating(options) {
9672
9672
  }
9673
9673
 
9674
9674
  /*!
9675
- react-datepicker v8.10.0
9675
+ react-datepicker v8.8.0
9676
9676
  https://github.com/Hacker0x01/react-datepicker
9677
9677
  Released under the MIT License.
9678
9678
  */
@@ -9736,19 +9736,17 @@ typeof SuppressedError === "function" ? SuppressedError : function (error, suppr
9736
9736
  };
9737
9737
 
9738
9738
  var CalendarContainer = function (_a) {
9739
- var _b = _a.showTimeSelectOnly, showTimeSelectOnly = _b === void 0 ? false : _b, _c = _a.showTime, showTime = _c === void 0 ? false : _c, className = _a.className, children = _a.children, inline = _a.inline;
9739
+ var _b = _a.showTimeSelectOnly, showTimeSelectOnly = _b === void 0 ? false : _b, _c = _a.showTime, showTime = _c === void 0 ? false : _c, className = _a.className, children = _a.children;
9740
9740
  var ariaLabel = showTimeSelectOnly
9741
9741
  ? "Choose Time"
9742
9742
  : "Choose Date".concat(showTime ? " and Time" : "");
9743
- return (React__default.createElement("div", { className: className, "aria-label": ariaLabel, role: inline ? undefined : "dialog", "aria-modal": inline ? undefined : "true" }, children));
9743
+ return (React__default.createElement("div", { className: className, role: "dialog", "aria-label": ariaLabel, "aria-modal": "true" }, children));
9744
9744
  };
9745
9745
 
9746
9746
  var useDetectClickOutside = function (onClickOutside, ignoreClass) {
9747
9747
  var ref = useRef(null);
9748
9748
  var onClickOutsideRef = useRef(onClickOutside);
9749
- useEffect(function () {
9750
- onClickOutsideRef.current = onClickOutside;
9751
- }, [onClickOutside]);
9749
+ onClickOutsideRef.current = onClickOutside;
9752
9750
  var handleClickOutside = useCallback(function (event) {
9753
9751
  var _a;
9754
9752
  var target = (event.composed &&
@@ -10454,7 +10452,6 @@ function isTimeInDisabledRange(time, _a) {
10454
10452
  valid = !isWithinInterval(baseTime, { start: min, end: max });
10455
10453
  }
10456
10454
  catch (err) {
10457
- /* istanbul ignore next - date-fns historically threw on invalid intervals */
10458
10455
  valid = false;
10459
10456
  }
10460
10457
  return valid;
@@ -11758,12 +11755,7 @@ var Month$1 = /** @class */ (function (_super) {
11758
11755
  });
11759
11756
  };
11760
11757
  _this.isSelectedQuarter = function (day, q, selected) {
11761
- return getQuarter(selected) === q && getYear(day) === getYear(selected);
11762
- };
11763
- _this.isSelectQuarterInList = function (day, q, selectedDates) {
11764
- return selectedDates.some(function (selectedDate) {
11765
- return _this.isSelectedQuarter(day, q, selectedDate);
11766
- });
11758
+ return getQuarter(day) === q && getYear(day) === getYear(selected);
11767
11759
  };
11768
11760
  _this.isMonthSelected = function () {
11769
11761
  var _a = _this.props, day = _a.day, selected = _a.selected, selectedDates = _a.selectedDates, selectsMultiple = _a.selectsMultiple;
@@ -11775,21 +11767,7 @@ var Month$1 = /** @class */ (function (_super) {
11775
11767
  }
11776
11768
  return !!selected && _this.isSelectedMonth(day, monthIdx, selected);
11777
11769
  };
11778
- _this.isQuarterSelected = function () {
11779
- var _a = _this.props, day = _a.day, selected = _a.selected, selectedDates = _a.selectedDates, selectsMultiple = _a.selectsMultiple;
11780
- var quarterIdx = getQuarter(day);
11781
- if (selectsMultiple) {
11782
- return selectedDates === null || selectedDates === void 0 ? void 0 : selectedDates.some(function (selectedDate) {
11783
- return _this.isSelectedQuarter(day, quarterIdx, selectedDate);
11784
- });
11785
- }
11786
- return !!selected && _this.isSelectedQuarter(day, quarterIdx, selected);
11787
- };
11788
11770
  _this.renderWeeks = function () {
11789
- // Return empty array if day is invalid
11790
- if (!isValid(_this.props.day)) {
11791
- return [];
11792
- }
11793
11771
  var weeks = [];
11794
11772
  var isFixedHeight = _this.props.fixedHeight;
11795
11773
  var i = 0;
@@ -12086,7 +12064,7 @@ var Month$1 = /** @class */ (function (_super) {
12086
12064
  return "".concat(prefix, " ").concat(formatDate(labelDate, "MMMM yyyy", locale));
12087
12065
  };
12088
12066
  _this.getQuarterClassNames = function (q) {
12089
- var _a = _this.props, day = _a.day, startDate = _a.startDate, endDate = _a.endDate, minDate = _a.minDate, maxDate = _a.maxDate, excludeDates = _a.excludeDates, includeDates = _a.includeDates, filterDate = _a.filterDate, preSelection = _a.preSelection, disabledKeyboardNavigation = _a.disabledKeyboardNavigation, disabled = _a.disabled;
12067
+ var _a = _this.props, day = _a.day, startDate = _a.startDate, endDate = _a.endDate, selected = _a.selected, minDate = _a.minDate, maxDate = _a.maxDate, excludeDates = _a.excludeDates, includeDates = _a.includeDates, filterDate = _a.filterDate, preSelection = _a.preSelection, disabledKeyboardNavigation = _a.disabledKeyboardNavigation, disabled = _a.disabled;
12090
12068
  var isDisabled = (minDate ||
12091
12069
  maxDate ||
12092
12070
  excludeDates ||
@@ -12094,16 +12072,14 @@ var Month$1 = /** @class */ (function (_super) {
12094
12072
  filterDate ||
12095
12073
  disabled) &&
12096
12074
  isQuarterDisabled(setQuarter(day, q), _this.props);
12097
- var selection = _this.getSelection();
12098
12075
  return clsx("react-datepicker__quarter-text", "react-datepicker__quarter-".concat(q), {
12099
12076
  "react-datepicker__quarter-text--disabled": isDisabled,
12100
- "react-datepicker__quarter-text--selected": selection
12101
- ? _this.isSelectQuarterInList(day, q, selection)
12077
+ "react-datepicker__quarter-text--selected": selected
12078
+ ? _this.isSelectedQuarter(day, q, selected)
12102
12079
  : undefined,
12103
12080
  "react-datepicker__quarter-text--keyboard-selected": !disabledKeyboardNavigation &&
12104
12081
  preSelection &&
12105
12082
  _this.isSelectedQuarter(day, q, preSelection) &&
12106
- !_this.isQuarterSelected() &&
12107
12083
  !isDisabled,
12108
12084
  "react-datepicker__quarter-text--in-selecting-range": _this.isInSelectingRangeQuarter(q),
12109
12085
  "react-datepicker__quarter-text--in-range": startDate && endDate
@@ -12183,18 +12159,14 @@ var Month$1 = /** @class */ (function (_super) {
12183
12159
  var formattedAriaLabelPrefix = ariaLabelPrefix
12184
12160
  ? ariaLabelPrefix.trim() + " "
12185
12161
  : "";
12186
- // Format aria-label, return empty string if date is invalid
12187
- var formattedAriaLabel = isValid(day)
12188
- ? "".concat(formattedAriaLabelPrefix).concat(formatDate(day, "MMMM, yyyy", this.props.locale))
12189
- : "";
12190
12162
  var shouldUseListboxRole = showMonthYearPicker || showQuarterYearPicker;
12191
12163
  if (shouldUseListboxRole) {
12192
- return (React__default.createElement("div", { className: this.getClassNames(), onMouseLeave: !this.props.usePointerEvent ? this.handleMouseLeave : undefined, onPointerLeave: this.props.usePointerEvent ? this.handleMouseLeave : undefined, "aria-label": formattedAriaLabel, role: "listbox" }, showMonthYearPicker ? this.renderMonths() : this.renderQuarters()));
12164
+ return (React__default.createElement("div", { className: this.getClassNames(), onMouseLeave: !this.props.usePointerEvent ? this.handleMouseLeave : undefined, onPointerLeave: this.props.usePointerEvent ? this.handleMouseLeave : undefined, "aria-label": "".concat(formattedAriaLabelPrefix).concat(formatDate(day, "MMMM, yyyy", this.props.locale)), role: "listbox" }, showMonthYearPicker ? this.renderMonths() : this.renderQuarters()));
12193
12165
  }
12194
12166
  // For regular calendar view, use table structure
12195
12167
  return (React__default.createElement("div", { role: "table" },
12196
12168
  this.props.dayNamesHeader && (React__default.createElement("div", { role: "rowgroup" }, this.props.dayNamesHeader)),
12197
- React__default.createElement("div", { className: this.getClassNames(), onMouseLeave: !this.props.usePointerEvent ? this.handleMouseLeave : undefined, onPointerLeave: this.props.usePointerEvent ? this.handleMouseLeave : undefined, "aria-label": formattedAriaLabel, role: "rowgroup" }, this.renderWeeks())));
12169
+ React__default.createElement("div", { className: this.getClassNames(), onMouseLeave: !this.props.usePointerEvent ? this.handleMouseLeave : undefined, onPointerLeave: this.props.usePointerEvent ? this.handleMouseLeave : undefined, "aria-label": "".concat(formattedAriaLabelPrefix).concat(formatDate(day, "MMMM, yyyy", this.props.locale)), role: "rowgroup" }, this.renderWeeks())));
12198
12170
  };
12199
12171
  return Month;
12200
12172
  }(Component));
@@ -13294,10 +13266,6 @@ var Calendar = /** @class */ (function (_super) {
13294
13266
  };
13295
13267
  _this.header = function (date) {
13296
13268
  if (date === void 0) { date = _this.state.date; }
13297
- // Return empty array if date is invalid
13298
- if (!isValid(date)) {
13299
- return [];
13300
- }
13301
13269
  var disabled = _this.props.disabled;
13302
13270
  var startOfWeek = getStartOfWeek(date, _this.props.locale, _this.props.calendarStartDay);
13303
13271
  var dayNames = [];
@@ -13492,9 +13460,7 @@ var Calendar = /** @class */ (function (_super) {
13492
13460
  if (_this.props.showMonthYearDropdown) {
13493
13461
  classes.push("react-datepicker__current-month--hasMonthYearDropdown");
13494
13462
  }
13495
- return (React__default.createElement("h2", { className: classes.join(" ") }, isValid(date)
13496
- ? formatDate(date, _this.props.dateFormat, _this.props.locale)
13497
- : ""));
13463
+ return (React__default.createElement("h2", { className: classes.join(" ") }, formatDate(date, _this.props.dateFormat, _this.props.locale)));
13498
13464
  };
13499
13465
  _this.renderYearDropdown = function (overrideHide) {
13500
13466
  if (overrideHide === void 0) { overrideHide = false; }
@@ -13644,10 +13610,6 @@ var Calendar = /** @class */ (function (_super) {
13644
13610
  };
13645
13611
  _this.renderAriaLiveRegion = function () {
13646
13612
  var _a;
13647
- // Don't render aria-live message if date is invalid
13648
- if (!isValid(_this.state.date)) {
13649
- return (React__default.createElement("span", { role: "alert", "aria-live": "polite", className: "react-datepicker__aria-live" }));
13650
- }
13651
13613
  var _b = getYearsPeriod(_this.state.date, (_a = _this.props.yearItemNumber) !== null && _a !== void 0 ? _a : Calendar.defaultProps.yearItemNumber), startPeriod = _b.startPeriod, endPeriod = _b.endPeriod;
13652
13614
  var ariaLiveMessage;
13653
13615
  if (_this.props.showYearPicker) {
@@ -13709,7 +13671,6 @@ var Calendar = /** @class */ (function (_super) {
13709
13671
  Calendar.prototype.componentDidUpdate = function (prevProps) {
13710
13672
  var _this = this;
13711
13673
  if (this.props.preSelection &&
13712
- isValid(this.props.preSelection) &&
13713
13674
  (!isSameDay(this.props.preSelection, prevProps.preSelection) ||
13714
13675
  this.props.monthSelectedIn !== prevProps.monthSelectedIn)) {
13715
13676
  var hasMonthChanged_1 = !isSameMonth(this.state.date, this.props.preSelection);
@@ -13730,7 +13691,7 @@ var Calendar = /** @class */ (function (_super) {
13730
13691
  React__default.createElement("div", { style: { display: "contents" }, ref: this.containerRef },
13731
13692
  React__default.createElement(Container, { className: clsx("react-datepicker", this.props.className, {
13732
13693
  "react-datepicker--time-only": this.props.showTimeSelectOnly,
13733
- }), showTime: this.props.showTimeSelect || this.props.showTimeInput, showTimeSelectOnly: this.props.showTimeSelectOnly, inline: this.props.inline },
13694
+ }), showTime: this.props.showTimeSelect || this.props.showTimeInput, showTimeSelectOnly: this.props.showTimeSelectOnly },
13734
13695
  this.renderAriaLiveRegion(),
13735
13696
  this.renderPreviousButton(),
13736
13697
  this.renderNextButton(),
@@ -13924,7 +13885,6 @@ function withFloating(Component) {
13924
13885
  var floatingProps = useFloating(_assign({ open: !hidePopper, whileElementsMounted: autoUpdate, placement: props.popperPlacement, middleware: __spreadArray([
13925
13886
  flip({ padding: 15 }),
13926
13887
  offset(10),
13927
- // eslint-disable-next-line react-hooks/refs -- Floating UI requires refs to be passed during render
13928
13888
  arrow({ element: arrowRef })
13929
13889
  ], ((_a = props.popperModifiers) !== null && _a !== void 0 ? _a : []), true) }, props.popperProps));
13930
13890
  var componentProps = _assign(_assign({}, props), { hidePopper: hidePopper, popperProps: _assign(_assign({}, floatingProps), { arrowRef: arrowRef }) });
@@ -13935,7 +13895,7 @@ function withFloating(Component) {
13935
13895
  }
13936
13896
 
13937
13897
  // Exported for testing purposes
13938
- var PopperComponent$1 = function (props) {
13898
+ var PopperComponent = function (props) {
13939
13899
  var className = props.className, wrapperClassName = props.wrapperClassName, _a = props.hidePopper, hidePopper = _a === void 0 ? true : _a, popperComponent = props.popperComponent, targetComponent = props.targetComponent, enableTabLoop = props.enableTabLoop, popperOnKeyDown = props.popperOnKeyDown, portalId = props.portalId, portalHost = props.portalHost, popperProps = props.popperProps, showArrow = props.showArrow;
13940
13900
  var popper = undefined;
13941
13901
  if (!hidePopper) {
@@ -13956,7 +13916,7 @@ var PopperComponent$1 = function (props) {
13956
13916
  React__default.createElement("div", { ref: popperProps.refs.setReference, className: wrapperClasses }, targetComponent),
13957
13917
  popper));
13958
13918
  };
13959
- var PopperComponent = withFloating(PopperComponent$1);
13919
+ var PopperComponent$1 = withFloating(PopperComponent);
13960
13920
 
13961
13921
  // Compares dates year+month combinations
13962
13922
  function hasPreSelectionChanged(date1, date2) {
@@ -14459,117 +14419,6 @@ var DatePicker = /** @class */ (function (_super) {
14459
14419
  }
14460
14420
  (_b = (_a = _this.props).onInputClick) === null || _b === void 0 ? void 0 : _b.call(_a);
14461
14421
  };
14462
- _this.handleTimeOnlyArrowKey = function (eventKey) {
14463
- var _a, _b, _c, _d;
14464
- var currentTime = _this.props.selected || _this.state.preSelection || newDate();
14465
- var timeIntervals = (_a = _this.props.timeIntervals) !== null && _a !== void 0 ? _a : 30;
14466
- var dateFormat = (_b = _this.props.dateFormat) !== null && _b !== void 0 ? _b : DatePicker.defaultProps.dateFormat;
14467
- var formatStr = Array.isArray(dateFormat) ? dateFormat[0] : dateFormat;
14468
- var baseDate = getStartOfDay(currentTime);
14469
- var currentMinutes = getHours(currentTime) * 60 + getMinutes(currentTime);
14470
- var maxMinutes = 23 * 60 + 60 - timeIntervals; // Cap at last valid interval of the day
14471
- var newTime;
14472
- if (eventKey === KeyType.ArrowUp) {
14473
- var newMinutes = Math.max(0, currentMinutes - timeIntervals);
14474
- newTime = addMinutes(baseDate, newMinutes);
14475
- }
14476
- else {
14477
- var newMinutes = Math.min(maxMinutes, currentMinutes + timeIntervals);
14478
- newTime = addMinutes(baseDate, newMinutes);
14479
- }
14480
- var formattedTime = formatDate(newTime, formatStr || DatePicker.defaultProps.dateFormat, _this.props.locale);
14481
- _this.setState({
14482
- preSelection: newTime,
14483
- inputValue: formattedTime,
14484
- });
14485
- if (_this.props.selectsRange || _this.props.selectsMultiple) {
14486
- return;
14487
- }
14488
- var selected = _this.props.selected
14489
- ? _this.props.selected
14490
- : _this.getPreSelection();
14491
- var changedDate = _this.props.selected
14492
- ? newTime
14493
- : setTime(selected, {
14494
- hour: getHours(newTime),
14495
- minute: getMinutes(newTime),
14496
- });
14497
- (_d = (_c = _this.props).onChange) === null || _d === void 0 ? void 0 : _d.call(_c, changedDate);
14498
- if (_this.props.showTimeSelectOnly || _this.props.showTimeSelect) {
14499
- _this.setState({ isRenderAriaLiveMessage: true });
14500
- }
14501
- requestAnimationFrame(function () {
14502
- _this.scrollToTimeOption(newTime);
14503
- });
14504
- };
14505
- _this.handleTimeOnlyEnterKey = function (event) {
14506
- var _a, _b, _c, _d;
14507
- var inputElement = event.target;
14508
- var inputValue = inputElement.value;
14509
- var dateFormat = (_a = _this.props.dateFormat) !== null && _a !== void 0 ? _a : DatePicker.defaultProps.dateFormat;
14510
- var timeFormat = _this.props.timeFormat || "p";
14511
- var defaultTime = _this.state.preSelection || _this.props.selected || newDate();
14512
- var parsedDate = parseDate(inputValue, dateFormat, _this.props.locale, (_b = _this.props.strictParsing) !== null && _b !== void 0 ? _b : false, defaultTime);
14513
- var timeToCommit = defaultTime;
14514
- if (parsedDate && isValid(parsedDate)) {
14515
- timeToCommit = parsedDate;
14516
- }
14517
- else {
14518
- var highlightedItem = ((_c = _this.calendar) === null || _c === void 0 ? void 0 : _c.containerRef.current) instanceof Element &&
14519
- _this.calendar.containerRef.current.querySelector(".react-datepicker__time-list-item[tabindex='0']");
14520
- if (highlightedItem instanceof HTMLElement) {
14521
- var itemText = (_d = highlightedItem.textContent) === null || _d === void 0 ? void 0 : _d.trim();
14522
- if (itemText) {
14523
- var itemTime = parseDate(itemText, timeFormat, _this.props.locale, false, defaultTime);
14524
- if (itemTime && isValid(itemTime)) {
14525
- timeToCommit = itemTime;
14526
- }
14527
- }
14528
- }
14529
- }
14530
- _this.handleTimeChange(timeToCommit);
14531
- _this.setOpen(false);
14532
- _this.sendFocusBackToInput();
14533
- };
14534
- _this.scrollToTimeOption = function (time) {
14535
- var _a, _b;
14536
- if (!((_a = _this.calendar) === null || _a === void 0 ? void 0 : _a.containerRef.current)) {
14537
- return;
14538
- }
14539
- var container = _this.calendar.containerRef.current;
14540
- var timeListItems = Array.from(container.querySelectorAll(".react-datepicker__time-list-item"));
14541
- var targetItem = null;
14542
- var closestTimeDiff = Infinity;
14543
- var timeFormat = _this.props.timeFormat || "p";
14544
- for (var _i = 0, timeListItems_1 = timeListItems; _i < timeListItems_1.length; _i++) {
14545
- var item = timeListItems_1[_i];
14546
- var itemText = (_b = item.textContent) === null || _b === void 0 ? void 0 : _b.trim();
14547
- if (itemText) {
14548
- var itemTime = parseDate(itemText, timeFormat, _this.props.locale, false, time);
14549
- if (itemTime && isValid(itemTime)) {
14550
- if (isSameMinute(itemTime, time)) {
14551
- targetItem = item;
14552
- break;
14553
- }
14554
- var timeDiff = Math.abs(itemTime.getTime() - time.getTime());
14555
- if (timeDiff < closestTimeDiff) {
14556
- closestTimeDiff = timeDiff;
14557
- targetItem = item;
14558
- }
14559
- }
14560
- }
14561
- }
14562
- if (targetItem) {
14563
- timeListItems.forEach(function (item) {
14564
- item.setAttribute("tabindex", "-1");
14565
- });
14566
- targetItem.setAttribute("tabindex", "0");
14567
- targetItem.scrollIntoView({
14568
- behavior: "smooth",
14569
- block: "center",
14570
- });
14571
- }
14572
- };
14573
14422
  _this.onInputKeyDown = function (event) {
14574
14423
  var _a, _b, _c, _d, _e, _f;
14575
14424
  (_b = (_a = _this.props).onKeyDown) === null || _b === void 0 ? void 0 : _b.call(_a, event);
@@ -14584,18 +14433,6 @@ var DatePicker = /** @class */ (function (_super) {
14584
14433
  }
14585
14434
  return;
14586
14435
  }
14587
- if (_this.state.open && _this.props.showTimeSelectOnly) {
14588
- if (eventKey === KeyType.ArrowDown || eventKey === KeyType.ArrowUp) {
14589
- event.preventDefault();
14590
- _this.handleTimeOnlyArrowKey(eventKey);
14591
- return;
14592
- }
14593
- if (eventKey === KeyType.Enter) {
14594
- event.preventDefault();
14595
- _this.handleTimeOnlyEnterKey(event);
14596
- return;
14597
- }
14598
- }
14599
14436
  // if calendar is open, these keys will focus the selected item
14600
14437
  if (_this.state.open) {
14601
14438
  if (eventKey === KeyType.ArrowDown || eventKey === KeyType.ArrowUp) {
@@ -14786,12 +14623,20 @@ var DatePicker = /** @class */ (function (_super) {
14786
14623
  _this.setSelected(newSelection);
14787
14624
  }
14788
14625
  _this.setPreSelection(newSelection);
14789
- // In inline mode, always set shouldFocusDayInline to true when navigating via keyboard.
14790
- // This ensures focus is properly transferred to the new day element regardless of
14791
- // whether the month changed. The user initiated this navigation from a focused day,
14792
- // so we should always focus the destination day.
14626
+ // need to figure out whether month has changed to focus day in inline version
14793
14627
  if (inline) {
14794
- _this.setState({ shouldFocusDayInline: true });
14628
+ var prevMonth = getMonth(copy);
14629
+ var newMonth = getMonth(newSelection);
14630
+ var prevYear = getYear(copy);
14631
+ var newYear = getYear(newSelection);
14632
+ if (prevMonth !== newMonth || prevYear !== newYear) {
14633
+ // month has changed
14634
+ _this.setState({ shouldFocusDayInline: true });
14635
+ }
14636
+ else {
14637
+ // month hasn't changed
14638
+ _this.setState({ shouldFocusDayInline: false });
14639
+ }
14795
14640
  }
14796
14641
  };
14797
14642
  // handle generic key down events in the popper that do not adjust or select dates
@@ -14893,31 +14738,39 @@ var DatePicker = /** @class */ (function (_super) {
14893
14738
  };
14894
14739
  _this.renderDateInput = function () {
14895
14740
  var _a, _b;
14896
- var _c, _d, _e, _f;
14897
14741
  var className = clsx(_this.props.className, (_a = {},
14898
14742
  _a[_this.props.outsideClickIgnoreClass ||
14899
14743
  DatePicker.defaultProps.outsideClickIgnoreClass] = _this.state.open,
14900
14744
  _a));
14901
14745
  var customInput = _this.props.customInput || React__default.createElement("input", { type: "text" });
14902
14746
  var customInputRef = _this.props.customInputRef || "ref";
14903
- // Build aria props object, only including defined values to avoid
14904
- // overwriting aria attributes that may be set on the custom input
14905
- var ariaProps = {};
14906
- var ariaDescribedBy = (_c = _this.props["aria-describedby"]) !== null && _c !== void 0 ? _c : _this.props.ariaDescribedBy;
14907
- var ariaInvalid = (_d = _this.props["aria-invalid"]) !== null && _d !== void 0 ? _d : _this.props.ariaInvalid;
14908
- var ariaLabelledBy = (_e = _this.props["aria-labelledby"]) !== null && _e !== void 0 ? _e : _this.props.ariaLabelledBy;
14909
- var ariaRequired = (_f = _this.props["aria-required"]) !== null && _f !== void 0 ? _f : _this.props.ariaRequired;
14910
- if (ariaDescribedBy != null)
14911
- ariaProps["aria-describedby"] = ariaDescribedBy;
14912
- if (ariaInvalid != null)
14913
- ariaProps["aria-invalid"] = ariaInvalid;
14914
- if (ariaLabelledBy != null)
14915
- ariaProps["aria-labelledby"] = ariaLabelledBy;
14916
- if (ariaRequired != null)
14917
- ariaProps["aria-required"] = ariaRequired;
14918
- return cloneElement(customInput, _assign((_b = {}, _b[customInputRef] = function (input) {
14919
- _this.input = input;
14920
- }, _b.value = _this.getInputValue(), _b.onBlur = _this.handleBlur, _b.onChange = _this.handleChange, _b.onClick = _this.onInputClick, _b.onFocus = _this.handleFocus, _b.onKeyDown = _this.onInputKeyDown, _b.id = _this.props.id, _b.name = _this.props.name, _b.form = _this.props.form, _b.autoFocus = _this.props.autoFocus, _b.placeholder = _this.props.placeholderText, _b.disabled = _this.props.disabled, _b.autoComplete = _this.props.autoComplete, _b.className = clsx(customInput.props.className, className), _b.title = _this.props.title, _b.readOnly = _this.props.readOnly, _b.required = _this.props.required, _b.tabIndex = _this.props.tabIndex, _b), ariaProps));
14747
+ return cloneElement(customInput, (_b = {},
14748
+ _b[customInputRef] = function (input) {
14749
+ _this.input = input;
14750
+ },
14751
+ _b.value = _this.getInputValue(),
14752
+ _b.onBlur = _this.handleBlur,
14753
+ _b.onChange = _this.handleChange,
14754
+ _b.onClick = _this.onInputClick,
14755
+ _b.onFocus = _this.handleFocus,
14756
+ _b.onKeyDown = _this.onInputKeyDown,
14757
+ _b.id = _this.props.id,
14758
+ _b.name = _this.props.name,
14759
+ _b.form = _this.props.form,
14760
+ _b.autoFocus = _this.props.autoFocus,
14761
+ _b.placeholder = _this.props.placeholderText,
14762
+ _b.disabled = _this.props.disabled,
14763
+ _b.autoComplete = _this.props.autoComplete,
14764
+ _b.className = clsx(customInput.props.className, className),
14765
+ _b.title = _this.props.title,
14766
+ _b.readOnly = _this.props.readOnly,
14767
+ _b.required = _this.props.required,
14768
+ _b.tabIndex = _this.props.tabIndex,
14769
+ _b["aria-describedby"] = _this.props.ariaDescribedBy,
14770
+ _b["aria-invalid"] = _this.props.ariaInvalid,
14771
+ _b["aria-labelledby"] = _this.props.ariaLabelledBy,
14772
+ _b["aria-required"] = _this.props.ariaRequired,
14773
+ _b));
14921
14774
  };
14922
14775
  _this.renderClearButton = function () {
14923
14776
  var _a = _this.props, isClearable = _a.isClearable, disabled = _a.disabled, selected = _a.selected, startDate = _a.startDate, endDate = _a.endDate, clearButtonTitle = _a.clearButtonTitle, _b = _a.clearButtonClassName, clearButtonClassName = _b === void 0 ? "" : _b, _c = _a.ariaLabelClose, ariaLabelClose = _c === void 0 ? "Close" : _c, selectedDates = _a.selectedDates, readOnly = _a.readOnly;
@@ -15005,9 +14858,6 @@ var DatePicker = /** @class */ (function (_super) {
15005
14858
  prevProps.monthsShown !== this.props.monthsShown) {
15006
14859
  this.setState({ monthSelectedIn: 0 });
15007
14860
  }
15008
- if (this.props.selectsRange && this.state.monthSelectedIn !== 0) {
15009
- this.setState({ monthSelectedIn: 0 });
15010
- }
15011
14861
  if (prevProps.highlightDates !== this.props.highlightDates) {
15012
14862
  this.setState({
15013
14863
  highlightDates: getHighLightDaysMap(this.props.highlightDates),
@@ -15061,7 +14911,7 @@ var DatePicker = /** @class */ (function (_super) {
15061
14911
  this.renderInputContainer(),
15062
14912
  portalContainer));
15063
14913
  }
15064
- return (React__default.createElement(PopperComponent, _assign({}, this.props, { className: this.props.popperClassName, hidePopper: !this.isCalendarOpen(), targetComponent: this.renderInputContainer(), popperComponent: calendar, popperOnKeyDown: this.onPopperKeyDown, showArrow: this.props.showPopperArrow })));
14914
+ return (React__default.createElement(PopperComponent$1, _assign({}, this.props, { className: this.props.popperClassName, hidePopper: !this.isCalendarOpen(), targetComponent: this.renderInputContainer(), popperComponent: calendar, popperOnKeyDown: this.onPopperKeyDown, showArrow: this.props.showPopperArrow })));
15065
14915
  };
15066
14916
  return DatePicker;
15067
14917
  }(Component));
@@ -15466,4 +15316,4 @@ var InlineDatePicker = function (props) {
15466
15316
  };
15467
15317
 
15468
15318
  export { DatePickerGroup as D, HelperText as H, InlineDatePicker as I, ValidationText as V };
15469
- //# sourceMappingURL=InlineDatePicker-BIAcoggL.js.map
15319
+ //# sourceMappingURL=InlineDatePicker-RlV9iC8j.js.map