@cerebruminc/cerebellum 16.5.3-beta.dangerous.e04d92c → 16.5.3-beta.dangerous.e1037a8

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.
@@ -3,7 +3,7 @@
3
3
  var _tslib = require('./_tslib-ByDtMVOd.js');
4
4
  var jsxRuntime = require('react/jsx-runtime');
5
5
  var React = require('react');
6
- var InlineDatePicker = require('./InlineDatePicker-4u82zKn2.js');
6
+ var InlineDatePicker = require('./InlineDatePicker-BJZXMxnh.js');
7
7
  var useMeasure = require('./useMeasure-CDq3dPfD.js');
8
8
  var showLabel = require('./showLabel-DqonEziR.js');
9
9
  var Inputs = require('./Inputs-E9lK-yCQ.js');
package/lib/cjs/Form.cjs CHANGED
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  var FormWrapper = require('./FormStyles-CCsL1LJO.js');
4
- var FormikContainer = require('./FormikContainer-BVUsbx6j.js');
4
+ var FormikContainer = require('./FormikContainer-D407RQT6.js');
5
5
  var FormFieldTypeEnum = require('./FormFieldTypeEnum.cjs');
6
6
  require('./_tslib-ByDtMVOd.js');
7
7
  require('styled-components');
@@ -96,7 +96,7 @@ require('./cardValidationStateMachine.cjs');
96
96
  require('./CurrencyInput-l3tjN6Be.js');
97
97
  require('./InlineCurrencyInput-DV0MAyaR.js');
98
98
  require('./DatePicker.cjs');
99
- require('./InlineDatePicker-4u82zKn2.js');
99
+ require('./InlineDatePicker-BJZXMxnh.js');
100
100
  require('./Calendar.cjs');
101
101
  require('./ClickOutHandler-b5mI7kuA.js');
102
102
  require('./CaretLeft.cjs');
@@ -40,7 +40,7 @@ var CurrencyInput = require('./CurrencyInput-l3tjN6Be.js');
40
40
  var InlineCurrencyInput = require('./InlineCurrencyInput-DV0MAyaR.js');
41
41
  var formatBytesToString = require('./formatBytesToString.cjs');
42
42
  var DatePicker = require('./DatePicker.cjs');
43
- var InlineDatePicker = require('./InlineDatePicker-4u82zKn2.js');
43
+ var InlineDatePicker = require('./InlineDatePicker-BJZXMxnh.js');
44
44
  require('./CheckboxStyles-CAzemGXD.js');
45
45
  require('./RadioStyles-2mVDOf96.js');
46
46
  require('./ToggleStyles-DsqemdEf.js');
@@ -1614,4 +1614,4 @@ var FormikContainer = function (props) {
1614
1614
  exports.FormikContainer = FormikContainer;
1615
1615
  exports.NationalityDropdown = NationalityDropdown;
1616
1616
  exports.nationalityList = nationalityList;
1617
- //# sourceMappingURL=FormikContainer-BVUsbx6j.js.map
1617
+ //# sourceMappingURL=FormikContainer-D407RQT6.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"FormikContainer-BVUsbx6j.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -9696,7 +9696,7 @@ function useFloating(options) {
9696
9696
  }
9697
9697
 
9698
9698
  /*!
9699
- react-datepicker v8.8.0
9699
+ react-datepicker v8.10.0
9700
9700
  https://github.com/Hacker0x01/react-datepicker
9701
9701
  Released under the MIT License.
9702
9702
  */
@@ -9760,17 +9760,19 @@ typeof SuppressedError === "function" ? SuppressedError : function (error, suppr
9760
9760
  };
9761
9761
 
9762
9762
  var CalendarContainer = function (_a) {
9763
- 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;
9763
+ 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;
9764
9764
  var ariaLabel = showTimeSelectOnly
9765
9765
  ? "Choose Time"
9766
9766
  : "Choose Date".concat(showTime ? " and Time" : "");
9767
- return (React__namespace.default.createElement("div", { className: className, role: "dialog", "aria-label": ariaLabel, "aria-modal": "true" }, children));
9767
+ return (React__namespace.default.createElement("div", { className: className, "aria-label": ariaLabel, role: inline ? undefined : "dialog", "aria-modal": inline ? undefined : "true" }, children));
9768
9768
  };
9769
9769
 
9770
9770
  var useDetectClickOutside = function (onClickOutside, ignoreClass) {
9771
9771
  var ref = React.useRef(null);
9772
9772
  var onClickOutsideRef = React.useRef(onClickOutside);
9773
- onClickOutsideRef.current = onClickOutside;
9773
+ React.useEffect(function () {
9774
+ onClickOutsideRef.current = onClickOutside;
9775
+ }, [onClickOutside]);
9774
9776
  var handleClickOutside = React.useCallback(function (event) {
9775
9777
  var _a;
9776
9778
  var target = (event.composed &&
@@ -10476,6 +10478,7 @@ function isTimeInDisabledRange(time, _a) {
10476
10478
  valid = !isWithinInterval(baseTime, { start: min, end: max });
10477
10479
  }
10478
10480
  catch (err) {
10481
+ /* istanbul ignore next - date-fns historically threw on invalid intervals */
10479
10482
  valid = false;
10480
10483
  }
10481
10484
  return valid;
@@ -11779,7 +11782,12 @@ var Month$1 = /** @class */ (function (_super) {
11779
11782
  });
11780
11783
  };
11781
11784
  _this.isSelectedQuarter = function (day, q, selected) {
11782
- return getQuarter(day) === q && getYear(day) === getYear(selected);
11785
+ return getQuarter(selected) === q && getYear(day) === getYear(selected);
11786
+ };
11787
+ _this.isSelectQuarterInList = function (day, q, selectedDates) {
11788
+ return selectedDates.some(function (selectedDate) {
11789
+ return _this.isSelectedQuarter(day, q, selectedDate);
11790
+ });
11783
11791
  };
11784
11792
  _this.isMonthSelected = function () {
11785
11793
  var _a = _this.props, day = _a.day, selected = _a.selected, selectedDates = _a.selectedDates, selectsMultiple = _a.selectsMultiple;
@@ -11791,7 +11799,21 @@ var Month$1 = /** @class */ (function (_super) {
11791
11799
  }
11792
11800
  return !!selected && _this.isSelectedMonth(day, monthIdx, selected);
11793
11801
  };
11802
+ _this.isQuarterSelected = function () {
11803
+ var _a = _this.props, day = _a.day, selected = _a.selected, selectedDates = _a.selectedDates, selectsMultiple = _a.selectsMultiple;
11804
+ var quarterIdx = getQuarter(day);
11805
+ if (selectsMultiple) {
11806
+ return selectedDates === null || selectedDates === void 0 ? void 0 : selectedDates.some(function (selectedDate) {
11807
+ return _this.isSelectedQuarter(day, quarterIdx, selectedDate);
11808
+ });
11809
+ }
11810
+ return !!selected && _this.isSelectedQuarter(day, quarterIdx, selected);
11811
+ };
11794
11812
  _this.renderWeeks = function () {
11813
+ // Return empty array if day is invalid
11814
+ if (!isValid(_this.props.day)) {
11815
+ return [];
11816
+ }
11795
11817
  var weeks = [];
11796
11818
  var isFixedHeight = _this.props.fixedHeight;
11797
11819
  var i = 0;
@@ -12088,7 +12110,7 @@ var Month$1 = /** @class */ (function (_super) {
12088
12110
  return "".concat(prefix, " ").concat(formatDate(labelDate, "MMMM yyyy", locale));
12089
12111
  };
12090
12112
  _this.getQuarterClassNames = function (q) {
12091
- 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;
12113
+ 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;
12092
12114
  var isDisabled = (minDate ||
12093
12115
  maxDate ||
12094
12116
  excludeDates ||
@@ -12096,14 +12118,16 @@ var Month$1 = /** @class */ (function (_super) {
12096
12118
  filterDate ||
12097
12119
  disabled) &&
12098
12120
  isQuarterDisabled(setQuarter(day, q), _this.props);
12121
+ var selection = _this.getSelection();
12099
12122
  return clsx("react-datepicker__quarter-text", "react-datepicker__quarter-".concat(q), {
12100
12123
  "react-datepicker__quarter-text--disabled": isDisabled,
12101
- "react-datepicker__quarter-text--selected": selected
12102
- ? _this.isSelectedQuarter(day, q, selected)
12124
+ "react-datepicker__quarter-text--selected": selection
12125
+ ? _this.isSelectQuarterInList(day, q, selection)
12103
12126
  : undefined,
12104
12127
  "react-datepicker__quarter-text--keyboard-selected": !disabledKeyboardNavigation &&
12105
12128
  preSelection &&
12106
12129
  _this.isSelectedQuarter(day, q, preSelection) &&
12130
+ !_this.isQuarterSelected() &&
12107
12131
  !isDisabled,
12108
12132
  "react-datepicker__quarter-text--in-selecting-range": _this.isInSelectingRangeQuarter(q),
12109
12133
  "react-datepicker__quarter-text--in-range": startDate && endDate
@@ -12183,14 +12207,18 @@ var Month$1 = /** @class */ (function (_super) {
12183
12207
  var formattedAriaLabelPrefix = ariaLabelPrefix
12184
12208
  ? ariaLabelPrefix.trim() + " "
12185
12209
  : "";
12210
+ // Format aria-label, return empty string if date is invalid
12211
+ var formattedAriaLabel = isValid(day)
12212
+ ? "".concat(formattedAriaLabelPrefix).concat(formatDate(day, "MMMM, yyyy", this.props.locale))
12213
+ : "";
12186
12214
  var shouldUseListboxRole = showMonthYearPicker || showQuarterYearPicker;
12187
12215
  if (shouldUseListboxRole) {
12188
- return (React__namespace.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()));
12216
+ return (React__namespace.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()));
12189
12217
  }
12190
12218
  // For regular calendar view, use table structure
12191
12219
  return (React__namespace.default.createElement("div", { role: "table" },
12192
12220
  this.props.dayNamesHeader && (React__namespace.default.createElement("div", { role: "rowgroup" }, this.props.dayNamesHeader)),
12193
- React__namespace.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())));
12221
+ React__namespace.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())));
12194
12222
  };
12195
12223
  return Month;
12196
12224
  }(React.Component));
@@ -13290,6 +13318,10 @@ var Calendar = /** @class */ (function (_super) {
13290
13318
  };
13291
13319
  _this.header = function (date) {
13292
13320
  if (date === void 0) { date = _this.state.date; }
13321
+ // Return empty array if date is invalid
13322
+ if (!isValid(date)) {
13323
+ return [];
13324
+ }
13293
13325
  var disabled = _this.props.disabled;
13294
13326
  var startOfWeek = getStartOfWeek(date, _this.props.locale, _this.props.calendarStartDay);
13295
13327
  var dayNames = [];
@@ -13484,7 +13516,9 @@ var Calendar = /** @class */ (function (_super) {
13484
13516
  if (_this.props.showMonthYearDropdown) {
13485
13517
  classes.push("react-datepicker__current-month--hasMonthYearDropdown");
13486
13518
  }
13487
- return (React__namespace.default.createElement("h2", { className: classes.join(" ") }, formatDate(date, _this.props.dateFormat, _this.props.locale)));
13519
+ return (React__namespace.default.createElement("h2", { className: classes.join(" ") }, isValid(date)
13520
+ ? formatDate(date, _this.props.dateFormat, _this.props.locale)
13521
+ : ""));
13488
13522
  };
13489
13523
  _this.renderYearDropdown = function (overrideHide) {
13490
13524
  if (overrideHide === void 0) { overrideHide = false; }
@@ -13634,6 +13668,10 @@ var Calendar = /** @class */ (function (_super) {
13634
13668
  };
13635
13669
  _this.renderAriaLiveRegion = function () {
13636
13670
  var _a;
13671
+ // Don't render aria-live message if date is invalid
13672
+ if (!isValid(_this.state.date)) {
13673
+ return (React__namespace.default.createElement("span", { role: "alert", "aria-live": "polite", className: "react-datepicker__aria-live" }));
13674
+ }
13637
13675
  var _b = getYearsPeriod(_this.state.date, (_a = _this.props.yearItemNumber) !== null && _a !== void 0 ? _a : Calendar.defaultProps.yearItemNumber), startPeriod = _b.startPeriod, endPeriod = _b.endPeriod;
13638
13676
  var ariaLiveMessage;
13639
13677
  if (_this.props.showYearPicker) {
@@ -13695,6 +13733,7 @@ var Calendar = /** @class */ (function (_super) {
13695
13733
  Calendar.prototype.componentDidUpdate = function (prevProps) {
13696
13734
  var _this = this;
13697
13735
  if (this.props.preSelection &&
13736
+ isValid(this.props.preSelection) &&
13698
13737
  (!isSameDay(this.props.preSelection, prevProps.preSelection) ||
13699
13738
  this.props.monthSelectedIn !== prevProps.monthSelectedIn)) {
13700
13739
  var hasMonthChanged_1 = !isSameMonth(this.state.date, this.props.preSelection);
@@ -13715,7 +13754,7 @@ var Calendar = /** @class */ (function (_super) {
13715
13754
  React__namespace.default.createElement("div", { style: { display: "contents" }, ref: this.containerRef },
13716
13755
  React__namespace.default.createElement(Container, { className: clsx("react-datepicker", this.props.className, {
13717
13756
  "react-datepicker--time-only": this.props.showTimeSelectOnly,
13718
- }), showTime: this.props.showTimeSelect || this.props.showTimeInput, showTimeSelectOnly: this.props.showTimeSelectOnly },
13757
+ }), showTime: this.props.showTimeSelect || this.props.showTimeInput, showTimeSelectOnly: this.props.showTimeSelectOnly, inline: this.props.inline },
13719
13758
  this.renderAriaLiveRegion(),
13720
13759
  this.renderPreviousButton(),
13721
13760
  this.renderNextButton(),
@@ -13909,6 +13948,7 @@ function withFloating(Component) {
13909
13948
  var floatingProps = useFloating(_assign({ open: !hidePopper, whileElementsMounted: autoUpdate, placement: props.popperPlacement, middleware: __spreadArray([
13910
13949
  flip({ padding: 15 }),
13911
13950
  offset(10),
13951
+ // eslint-disable-next-line react-hooks/refs -- Floating UI requires refs to be passed during render
13912
13952
  arrow({ element: arrowRef })
13913
13953
  ], ((_a = props.popperModifiers) !== null && _a !== void 0 ? _a : []), true) }, props.popperProps));
13914
13954
  var componentProps = _assign(_assign({}, props), { hidePopper: hidePopper, popperProps: _assign(_assign({}, floatingProps), { arrowRef: arrowRef }) });
@@ -13919,7 +13959,7 @@ function withFloating(Component) {
13919
13959
  }
13920
13960
 
13921
13961
  // Exported for testing purposes
13922
- var PopperComponent = function (props) {
13962
+ var PopperComponent$1 = function (props) {
13923
13963
  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;
13924
13964
  var popper = undefined;
13925
13965
  if (!hidePopper) {
@@ -13940,7 +13980,7 @@ var PopperComponent = function (props) {
13940
13980
  React__namespace.default.createElement("div", { ref: popperProps.refs.setReference, className: wrapperClasses }, targetComponent),
13941
13981
  popper));
13942
13982
  };
13943
- var PopperComponent$1 = withFloating(PopperComponent);
13983
+ var PopperComponent = withFloating(PopperComponent$1);
13944
13984
 
13945
13985
  // Compares dates year+month combinations
13946
13986
  function hasPreSelectionChanged(date1, date2) {
@@ -14443,6 +14483,117 @@ var DatePicker = /** @class */ (function (_super) {
14443
14483
  }
14444
14484
  (_b = (_a = _this.props).onInputClick) === null || _b === void 0 ? void 0 : _b.call(_a);
14445
14485
  };
14486
+ _this.handleTimeOnlyArrowKey = function (eventKey) {
14487
+ var _a, _b, _c, _d;
14488
+ var currentTime = _this.props.selected || _this.state.preSelection || newDate();
14489
+ var timeIntervals = (_a = _this.props.timeIntervals) !== null && _a !== void 0 ? _a : 30;
14490
+ var dateFormat = (_b = _this.props.dateFormat) !== null && _b !== void 0 ? _b : DatePicker.defaultProps.dateFormat;
14491
+ var formatStr = Array.isArray(dateFormat) ? dateFormat[0] : dateFormat;
14492
+ var baseDate = getStartOfDay(currentTime);
14493
+ var currentMinutes = getHours(currentTime) * 60 + getMinutes(currentTime);
14494
+ var maxMinutes = 23 * 60 + 60 - timeIntervals; // Cap at last valid interval of the day
14495
+ var newTime;
14496
+ if (eventKey === KeyType.ArrowUp) {
14497
+ var newMinutes = Math.max(0, currentMinutes - timeIntervals);
14498
+ newTime = addMinutes(baseDate, newMinutes);
14499
+ }
14500
+ else {
14501
+ var newMinutes = Math.min(maxMinutes, currentMinutes + timeIntervals);
14502
+ newTime = addMinutes(baseDate, newMinutes);
14503
+ }
14504
+ var formattedTime = formatDate(newTime, formatStr || DatePicker.defaultProps.dateFormat, _this.props.locale);
14505
+ _this.setState({
14506
+ preSelection: newTime,
14507
+ inputValue: formattedTime,
14508
+ });
14509
+ if (_this.props.selectsRange || _this.props.selectsMultiple) {
14510
+ return;
14511
+ }
14512
+ var selected = _this.props.selected
14513
+ ? _this.props.selected
14514
+ : _this.getPreSelection();
14515
+ var changedDate = _this.props.selected
14516
+ ? newTime
14517
+ : setTime(selected, {
14518
+ hour: getHours(newTime),
14519
+ minute: getMinutes(newTime),
14520
+ });
14521
+ (_d = (_c = _this.props).onChange) === null || _d === void 0 ? void 0 : _d.call(_c, changedDate);
14522
+ if (_this.props.showTimeSelectOnly || _this.props.showTimeSelect) {
14523
+ _this.setState({ isRenderAriaLiveMessage: true });
14524
+ }
14525
+ requestAnimationFrame(function () {
14526
+ _this.scrollToTimeOption(newTime);
14527
+ });
14528
+ };
14529
+ _this.handleTimeOnlyEnterKey = function (event) {
14530
+ var _a, _b, _c, _d;
14531
+ var inputElement = event.target;
14532
+ var inputValue = inputElement.value;
14533
+ var dateFormat = (_a = _this.props.dateFormat) !== null && _a !== void 0 ? _a : DatePicker.defaultProps.dateFormat;
14534
+ var timeFormat = _this.props.timeFormat || "p";
14535
+ var defaultTime = _this.state.preSelection || _this.props.selected || newDate();
14536
+ var parsedDate = parseDate(inputValue, dateFormat, _this.props.locale, (_b = _this.props.strictParsing) !== null && _b !== void 0 ? _b : false, defaultTime);
14537
+ var timeToCommit = defaultTime;
14538
+ if (parsedDate && isValid(parsedDate)) {
14539
+ timeToCommit = parsedDate;
14540
+ }
14541
+ else {
14542
+ var highlightedItem = ((_c = _this.calendar) === null || _c === void 0 ? void 0 : _c.containerRef.current) instanceof Element &&
14543
+ _this.calendar.containerRef.current.querySelector(".react-datepicker__time-list-item[tabindex='0']");
14544
+ if (highlightedItem instanceof HTMLElement) {
14545
+ var itemText = (_d = highlightedItem.textContent) === null || _d === void 0 ? void 0 : _d.trim();
14546
+ if (itemText) {
14547
+ var itemTime = parseDate(itemText, timeFormat, _this.props.locale, false, defaultTime);
14548
+ if (itemTime && isValid(itemTime)) {
14549
+ timeToCommit = itemTime;
14550
+ }
14551
+ }
14552
+ }
14553
+ }
14554
+ _this.handleTimeChange(timeToCommit);
14555
+ _this.setOpen(false);
14556
+ _this.sendFocusBackToInput();
14557
+ };
14558
+ _this.scrollToTimeOption = function (time) {
14559
+ var _a, _b;
14560
+ if (!((_a = _this.calendar) === null || _a === void 0 ? void 0 : _a.containerRef.current)) {
14561
+ return;
14562
+ }
14563
+ var container = _this.calendar.containerRef.current;
14564
+ var timeListItems = Array.from(container.querySelectorAll(".react-datepicker__time-list-item"));
14565
+ var targetItem = null;
14566
+ var closestTimeDiff = Infinity;
14567
+ var timeFormat = _this.props.timeFormat || "p";
14568
+ for (var _i = 0, timeListItems_1 = timeListItems; _i < timeListItems_1.length; _i++) {
14569
+ var item = timeListItems_1[_i];
14570
+ var itemText = (_b = item.textContent) === null || _b === void 0 ? void 0 : _b.trim();
14571
+ if (itemText) {
14572
+ var itemTime = parseDate(itemText, timeFormat, _this.props.locale, false, time);
14573
+ if (itemTime && isValid(itemTime)) {
14574
+ if (isSameMinute(itemTime, time)) {
14575
+ targetItem = item;
14576
+ break;
14577
+ }
14578
+ var timeDiff = Math.abs(itemTime.getTime() - time.getTime());
14579
+ if (timeDiff < closestTimeDiff) {
14580
+ closestTimeDiff = timeDiff;
14581
+ targetItem = item;
14582
+ }
14583
+ }
14584
+ }
14585
+ }
14586
+ if (targetItem) {
14587
+ timeListItems.forEach(function (item) {
14588
+ item.setAttribute("tabindex", "-1");
14589
+ });
14590
+ targetItem.setAttribute("tabindex", "0");
14591
+ targetItem.scrollIntoView({
14592
+ behavior: "smooth",
14593
+ block: "center",
14594
+ });
14595
+ }
14596
+ };
14446
14597
  _this.onInputKeyDown = function (event) {
14447
14598
  var _a, _b, _c, _d, _e, _f;
14448
14599
  (_b = (_a = _this.props).onKeyDown) === null || _b === void 0 ? void 0 : _b.call(_a, event);
@@ -14457,6 +14608,18 @@ var DatePicker = /** @class */ (function (_super) {
14457
14608
  }
14458
14609
  return;
14459
14610
  }
14611
+ if (_this.state.open && _this.props.showTimeSelectOnly) {
14612
+ if (eventKey === KeyType.ArrowDown || eventKey === KeyType.ArrowUp) {
14613
+ event.preventDefault();
14614
+ _this.handleTimeOnlyArrowKey(eventKey);
14615
+ return;
14616
+ }
14617
+ if (eventKey === KeyType.Enter) {
14618
+ event.preventDefault();
14619
+ _this.handleTimeOnlyEnterKey(event);
14620
+ return;
14621
+ }
14622
+ }
14460
14623
  // if calendar is open, these keys will focus the selected item
14461
14624
  if (_this.state.open) {
14462
14625
  if (eventKey === KeyType.ArrowDown || eventKey === KeyType.ArrowUp) {
@@ -14647,20 +14810,12 @@ var DatePicker = /** @class */ (function (_super) {
14647
14810
  _this.setSelected(newSelection);
14648
14811
  }
14649
14812
  _this.setPreSelection(newSelection);
14650
- // need to figure out whether month has changed to focus day in inline version
14813
+ // In inline mode, always set shouldFocusDayInline to true when navigating via keyboard.
14814
+ // This ensures focus is properly transferred to the new day element regardless of
14815
+ // whether the month changed. The user initiated this navigation from a focused day,
14816
+ // so we should always focus the destination day.
14651
14817
  if (inline) {
14652
- var prevMonth = getMonth(copy);
14653
- var newMonth = getMonth(newSelection);
14654
- var prevYear = getYear(copy);
14655
- var newYear = getYear(newSelection);
14656
- if (prevMonth !== newMonth || prevYear !== newYear) {
14657
- // month has changed
14658
- _this.setState({ shouldFocusDayInline: true });
14659
- }
14660
- else {
14661
- // month hasn't changed
14662
- _this.setState({ shouldFocusDayInline: false });
14663
- }
14818
+ _this.setState({ shouldFocusDayInline: true });
14664
14819
  }
14665
14820
  };
14666
14821
  // handle generic key down events in the popper that do not adjust or select dates
@@ -14762,39 +14917,31 @@ var DatePicker = /** @class */ (function (_super) {
14762
14917
  };
14763
14918
  _this.renderDateInput = function () {
14764
14919
  var _a, _b;
14920
+ var _c, _d, _e, _f;
14765
14921
  var className = clsx(_this.props.className, (_a = {},
14766
14922
  _a[_this.props.outsideClickIgnoreClass ||
14767
14923
  DatePicker.defaultProps.outsideClickIgnoreClass] = _this.state.open,
14768
14924
  _a));
14769
14925
  var customInput = _this.props.customInput || React__namespace.default.createElement("input", { type: "text" });
14770
14926
  var customInputRef = _this.props.customInputRef || "ref";
14771
- return React.cloneElement(customInput, (_b = {},
14772
- _b[customInputRef] = function (input) {
14773
- _this.input = input;
14774
- },
14775
- _b.value = _this.getInputValue(),
14776
- _b.onBlur = _this.handleBlur,
14777
- _b.onChange = _this.handleChange,
14778
- _b.onClick = _this.onInputClick,
14779
- _b.onFocus = _this.handleFocus,
14780
- _b.onKeyDown = _this.onInputKeyDown,
14781
- _b.id = _this.props.id,
14782
- _b.name = _this.props.name,
14783
- _b.form = _this.props.form,
14784
- _b.autoFocus = _this.props.autoFocus,
14785
- _b.placeholder = _this.props.placeholderText,
14786
- _b.disabled = _this.props.disabled,
14787
- _b.autoComplete = _this.props.autoComplete,
14788
- _b.className = clsx(customInput.props.className, className),
14789
- _b.title = _this.props.title,
14790
- _b.readOnly = _this.props.readOnly,
14791
- _b.required = _this.props.required,
14792
- _b.tabIndex = _this.props.tabIndex,
14793
- _b["aria-describedby"] = _this.props.ariaDescribedBy,
14794
- _b["aria-invalid"] = _this.props.ariaInvalid,
14795
- _b["aria-labelledby"] = _this.props.ariaLabelledBy,
14796
- _b["aria-required"] = _this.props.ariaRequired,
14797
- _b));
14927
+ // Build aria props object, only including defined values to avoid
14928
+ // overwriting aria attributes that may be set on the custom input
14929
+ var ariaProps = {};
14930
+ var ariaDescribedBy = (_c = _this.props["aria-describedby"]) !== null && _c !== void 0 ? _c : _this.props.ariaDescribedBy;
14931
+ var ariaInvalid = (_d = _this.props["aria-invalid"]) !== null && _d !== void 0 ? _d : _this.props.ariaInvalid;
14932
+ var ariaLabelledBy = (_e = _this.props["aria-labelledby"]) !== null && _e !== void 0 ? _e : _this.props.ariaLabelledBy;
14933
+ var ariaRequired = (_f = _this.props["aria-required"]) !== null && _f !== void 0 ? _f : _this.props.ariaRequired;
14934
+ if (ariaDescribedBy != null)
14935
+ ariaProps["aria-describedby"] = ariaDescribedBy;
14936
+ if (ariaInvalid != null)
14937
+ ariaProps["aria-invalid"] = ariaInvalid;
14938
+ if (ariaLabelledBy != null)
14939
+ ariaProps["aria-labelledby"] = ariaLabelledBy;
14940
+ if (ariaRequired != null)
14941
+ ariaProps["aria-required"] = ariaRequired;
14942
+ return React.cloneElement(customInput, _assign((_b = {}, _b[customInputRef] = function (input) {
14943
+ _this.input = input;
14944
+ }, _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));
14798
14945
  };
14799
14946
  _this.renderClearButton = function () {
14800
14947
  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;
@@ -14882,6 +15029,9 @@ var DatePicker = /** @class */ (function (_super) {
14882
15029
  prevProps.monthsShown !== this.props.monthsShown) {
14883
15030
  this.setState({ monthSelectedIn: 0 });
14884
15031
  }
15032
+ if (this.props.selectsRange && this.state.monthSelectedIn !== 0) {
15033
+ this.setState({ monthSelectedIn: 0 });
15034
+ }
14885
15035
  if (prevProps.highlightDates !== this.props.highlightDates) {
14886
15036
  this.setState({
14887
15037
  highlightDates: getHighLightDaysMap(this.props.highlightDates),
@@ -14935,7 +15085,7 @@ var DatePicker = /** @class */ (function (_super) {
14935
15085
  this.renderInputContainer(),
14936
15086
  portalContainer));
14937
15087
  }
14938
- return (React__namespace.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 })));
15088
+ return (React__namespace.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 })));
14939
15089
  };
14940
15090
  return DatePicker;
14941
15091
  }(React.Component));
@@ -15343,4 +15493,4 @@ exports.DatePickerGroup = DatePickerGroup;
15343
15493
  exports.HelperText = HelperText;
15344
15494
  exports.InlineDatePicker = InlineDatePicker;
15345
15495
  exports.ValidationText = ValidationText;
15346
- //# sourceMappingURL=InlineDatePicker-4u82zKn2.js.map
15496
+ //# sourceMappingURL=InlineDatePicker-BJZXMxnh.js.map