@cerebruminc/cerebellum 16.5.3-beta.dangerous.2df6625 → 16.5.3-beta.dangerous.622e24a

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-BJZXMxnh.js');
6
+ var InlineDatePicker = require('./InlineDatePicker-4u82zKn2.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-Cc6-_Iwt.js');
4
- var FormikContainer = require('./FormikContainer-Dn3lu30W.js');
4
+ var FormikContainer = require('./FormikContainer-6Ou67s1T.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-BJZXMxnh.js');
99
+ require('./InlineDatePicker-4u82zKn2.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-BJZXMxnh.js');
43
+ var InlineDatePicker = require('./InlineDatePicker-4u82zKn2.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-Dn3lu30W.js.map
1617
+ //# sourceMappingURL=FormikContainer-6Ou67s1T.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"FormikContainer-Dn3lu30W.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.10.0
9699
+ react-datepicker v8.8.0
9700
9700
  https://github.com/Hacker0x01/react-datepicker
9701
9701
  Released under the MIT License.
9702
9702
  */
@@ -9760,19 +9760,17 @@ 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, inline = _a.inline;
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;
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, "aria-label": ariaLabel, role: inline ? undefined : "dialog", "aria-modal": inline ? undefined : "true" }, children));
9767
+ return (React__namespace.default.createElement("div", { className: className, role: "dialog", "aria-label": ariaLabel, "aria-modal": "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
- React.useEffect(function () {
9774
- onClickOutsideRef.current = onClickOutside;
9775
- }, [onClickOutside]);
9773
+ onClickOutsideRef.current = onClickOutside;
9776
9774
  var handleClickOutside = React.useCallback(function (event) {
9777
9775
  var _a;
9778
9776
  var target = (event.composed &&
@@ -10478,7 +10476,6 @@ function isTimeInDisabledRange(time, _a) {
10478
10476
  valid = !isWithinInterval(baseTime, { start: min, end: max });
10479
10477
  }
10480
10478
  catch (err) {
10481
- /* istanbul ignore next - date-fns historically threw on invalid intervals */
10482
10479
  valid = false;
10483
10480
  }
10484
10481
  return valid;
@@ -11782,12 +11779,7 @@ var Month$1 = /** @class */ (function (_super) {
11782
11779
  });
11783
11780
  };
11784
11781
  _this.isSelectedQuarter = function (day, q, 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
- });
11782
+ return getQuarter(day) === q && getYear(day) === getYear(selected);
11791
11783
  };
11792
11784
  _this.isMonthSelected = function () {
11793
11785
  var _a = _this.props, day = _a.day, selected = _a.selected, selectedDates = _a.selectedDates, selectsMultiple = _a.selectsMultiple;
@@ -11799,21 +11791,7 @@ var Month$1 = /** @class */ (function (_super) {
11799
11791
  }
11800
11792
  return !!selected && _this.isSelectedMonth(day, monthIdx, selected);
11801
11793
  };
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
- };
11812
11794
  _this.renderWeeks = function () {
11813
- // Return empty array if day is invalid
11814
- if (!isValid(_this.props.day)) {
11815
- return [];
11816
- }
11817
11795
  var weeks = [];
11818
11796
  var isFixedHeight = _this.props.fixedHeight;
11819
11797
  var i = 0;
@@ -12110,7 +12088,7 @@ var Month$1 = /** @class */ (function (_super) {
12110
12088
  return "".concat(prefix, " ").concat(formatDate(labelDate, "MMMM yyyy", locale));
12111
12089
  };
12112
12090
  _this.getQuarterClassNames = function (q) {
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;
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;
12114
12092
  var isDisabled = (minDate ||
12115
12093
  maxDate ||
12116
12094
  excludeDates ||
@@ -12118,16 +12096,14 @@ var Month$1 = /** @class */ (function (_super) {
12118
12096
  filterDate ||
12119
12097
  disabled) &&
12120
12098
  isQuarterDisabled(setQuarter(day, q), _this.props);
12121
- var selection = _this.getSelection();
12122
12099
  return clsx("react-datepicker__quarter-text", "react-datepicker__quarter-".concat(q), {
12123
12100
  "react-datepicker__quarter-text--disabled": isDisabled,
12124
- "react-datepicker__quarter-text--selected": selection
12125
- ? _this.isSelectQuarterInList(day, q, selection)
12101
+ "react-datepicker__quarter-text--selected": selected
12102
+ ? _this.isSelectedQuarter(day, q, selected)
12126
12103
  : undefined,
12127
12104
  "react-datepicker__quarter-text--keyboard-selected": !disabledKeyboardNavigation &&
12128
12105
  preSelection &&
12129
12106
  _this.isSelectedQuarter(day, q, preSelection) &&
12130
- !_this.isQuarterSelected() &&
12131
12107
  !isDisabled,
12132
12108
  "react-datepicker__quarter-text--in-selecting-range": _this.isInSelectingRangeQuarter(q),
12133
12109
  "react-datepicker__quarter-text--in-range": startDate && endDate
@@ -12207,18 +12183,14 @@ var Month$1 = /** @class */ (function (_super) {
12207
12183
  var formattedAriaLabelPrefix = ariaLabelPrefix
12208
12184
  ? ariaLabelPrefix.trim() + " "
12209
12185
  : "";
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
- : "";
12214
12186
  var shouldUseListboxRole = showMonthYearPicker || showQuarterYearPicker;
12215
12187
  if (shouldUseListboxRole) {
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()));
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()));
12217
12189
  }
12218
12190
  // For regular calendar view, use table structure
12219
12191
  return (React__namespace.default.createElement("div", { role: "table" },
12220
12192
  this.props.dayNamesHeader && (React__namespace.default.createElement("div", { role: "rowgroup" }, this.props.dayNamesHeader)),
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())));
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())));
12222
12194
  };
12223
12195
  return Month;
12224
12196
  }(React.Component));
@@ -13318,10 +13290,6 @@ var Calendar = /** @class */ (function (_super) {
13318
13290
  };
13319
13291
  _this.header = function (date) {
13320
13292
  if (date === void 0) { date = _this.state.date; }
13321
- // Return empty array if date is invalid
13322
- if (!isValid(date)) {
13323
- return [];
13324
- }
13325
13293
  var disabled = _this.props.disabled;
13326
13294
  var startOfWeek = getStartOfWeek(date, _this.props.locale, _this.props.calendarStartDay);
13327
13295
  var dayNames = [];
@@ -13516,9 +13484,7 @@ var Calendar = /** @class */ (function (_super) {
13516
13484
  if (_this.props.showMonthYearDropdown) {
13517
13485
  classes.push("react-datepicker__current-month--hasMonthYearDropdown");
13518
13486
  }
13519
- return (React__namespace.default.createElement("h2", { className: classes.join(" ") }, isValid(date)
13520
- ? formatDate(date, _this.props.dateFormat, _this.props.locale)
13521
- : ""));
13487
+ return (React__namespace.default.createElement("h2", { className: classes.join(" ") }, formatDate(date, _this.props.dateFormat, _this.props.locale)));
13522
13488
  };
13523
13489
  _this.renderYearDropdown = function (overrideHide) {
13524
13490
  if (overrideHide === void 0) { overrideHide = false; }
@@ -13668,10 +13634,6 @@ var Calendar = /** @class */ (function (_super) {
13668
13634
  };
13669
13635
  _this.renderAriaLiveRegion = function () {
13670
13636
  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
- }
13675
13637
  var _b = getYearsPeriod(_this.state.date, (_a = _this.props.yearItemNumber) !== null && _a !== void 0 ? _a : Calendar.defaultProps.yearItemNumber), startPeriod = _b.startPeriod, endPeriod = _b.endPeriod;
13676
13638
  var ariaLiveMessage;
13677
13639
  if (_this.props.showYearPicker) {
@@ -13733,7 +13695,6 @@ var Calendar = /** @class */ (function (_super) {
13733
13695
  Calendar.prototype.componentDidUpdate = function (prevProps) {
13734
13696
  var _this = this;
13735
13697
  if (this.props.preSelection &&
13736
- isValid(this.props.preSelection) &&
13737
13698
  (!isSameDay(this.props.preSelection, prevProps.preSelection) ||
13738
13699
  this.props.monthSelectedIn !== prevProps.monthSelectedIn)) {
13739
13700
  var hasMonthChanged_1 = !isSameMonth(this.state.date, this.props.preSelection);
@@ -13754,7 +13715,7 @@ var Calendar = /** @class */ (function (_super) {
13754
13715
  React__namespace.default.createElement("div", { style: { display: "contents" }, ref: this.containerRef },
13755
13716
  React__namespace.default.createElement(Container, { className: clsx("react-datepicker", this.props.className, {
13756
13717
  "react-datepicker--time-only": this.props.showTimeSelectOnly,
13757
- }), showTime: this.props.showTimeSelect || this.props.showTimeInput, showTimeSelectOnly: this.props.showTimeSelectOnly, inline: this.props.inline },
13718
+ }), showTime: this.props.showTimeSelect || this.props.showTimeInput, showTimeSelectOnly: this.props.showTimeSelectOnly },
13758
13719
  this.renderAriaLiveRegion(),
13759
13720
  this.renderPreviousButton(),
13760
13721
  this.renderNextButton(),
@@ -13948,7 +13909,6 @@ function withFloating(Component) {
13948
13909
  var floatingProps = useFloating(_assign({ open: !hidePopper, whileElementsMounted: autoUpdate, placement: props.popperPlacement, middleware: __spreadArray([
13949
13910
  flip({ padding: 15 }),
13950
13911
  offset(10),
13951
- // eslint-disable-next-line react-hooks/refs -- Floating UI requires refs to be passed during render
13952
13912
  arrow({ element: arrowRef })
13953
13913
  ], ((_a = props.popperModifiers) !== null && _a !== void 0 ? _a : []), true) }, props.popperProps));
13954
13914
  var componentProps = _assign(_assign({}, props), { hidePopper: hidePopper, popperProps: _assign(_assign({}, floatingProps), { arrowRef: arrowRef }) });
@@ -13959,7 +13919,7 @@ function withFloating(Component) {
13959
13919
  }
13960
13920
 
13961
13921
  // Exported for testing purposes
13962
- var PopperComponent$1 = function (props) {
13922
+ var PopperComponent = function (props) {
13963
13923
  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;
13964
13924
  var popper = undefined;
13965
13925
  if (!hidePopper) {
@@ -13980,7 +13940,7 @@ var PopperComponent$1 = function (props) {
13980
13940
  React__namespace.default.createElement("div", { ref: popperProps.refs.setReference, className: wrapperClasses }, targetComponent),
13981
13941
  popper));
13982
13942
  };
13983
- var PopperComponent = withFloating(PopperComponent$1);
13943
+ var PopperComponent$1 = withFloating(PopperComponent);
13984
13944
 
13985
13945
  // Compares dates year+month combinations
13986
13946
  function hasPreSelectionChanged(date1, date2) {
@@ -14483,117 +14443,6 @@ var DatePicker = /** @class */ (function (_super) {
14483
14443
  }
14484
14444
  (_b = (_a = _this.props).onInputClick) === null || _b === void 0 ? void 0 : _b.call(_a);
14485
14445
  };
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
- };
14597
14446
  _this.onInputKeyDown = function (event) {
14598
14447
  var _a, _b, _c, _d, _e, _f;
14599
14448
  (_b = (_a = _this.props).onKeyDown) === null || _b === void 0 ? void 0 : _b.call(_a, event);
@@ -14608,18 +14457,6 @@ var DatePicker = /** @class */ (function (_super) {
14608
14457
  }
14609
14458
  return;
14610
14459
  }
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
- }
14623
14460
  // if calendar is open, these keys will focus the selected item
14624
14461
  if (_this.state.open) {
14625
14462
  if (eventKey === KeyType.ArrowDown || eventKey === KeyType.ArrowUp) {
@@ -14810,12 +14647,20 @@ var DatePicker = /** @class */ (function (_super) {
14810
14647
  _this.setSelected(newSelection);
14811
14648
  }
14812
14649
  _this.setPreSelection(newSelection);
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.
14650
+ // need to figure out whether month has changed to focus day in inline version
14817
14651
  if (inline) {
14818
- _this.setState({ shouldFocusDayInline: true });
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
+ }
14819
14664
  }
14820
14665
  };
14821
14666
  // handle generic key down events in the popper that do not adjust or select dates
@@ -14917,31 +14762,39 @@ var DatePicker = /** @class */ (function (_super) {
14917
14762
  };
14918
14763
  _this.renderDateInput = function () {
14919
14764
  var _a, _b;
14920
- var _c, _d, _e, _f;
14921
14765
  var className = clsx(_this.props.className, (_a = {},
14922
14766
  _a[_this.props.outsideClickIgnoreClass ||
14923
14767
  DatePicker.defaultProps.outsideClickIgnoreClass] = _this.state.open,
14924
14768
  _a));
14925
14769
  var customInput = _this.props.customInput || React__namespace.default.createElement("input", { type: "text" });
14926
14770
  var customInputRef = _this.props.customInputRef || "ref";
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));
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));
14945
14798
  };
14946
14799
  _this.renderClearButton = function () {
14947
14800
  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;
@@ -15029,9 +14882,6 @@ var DatePicker = /** @class */ (function (_super) {
15029
14882
  prevProps.monthsShown !== this.props.monthsShown) {
15030
14883
  this.setState({ monthSelectedIn: 0 });
15031
14884
  }
15032
- if (this.props.selectsRange && this.state.monthSelectedIn !== 0) {
15033
- this.setState({ monthSelectedIn: 0 });
15034
- }
15035
14885
  if (prevProps.highlightDates !== this.props.highlightDates) {
15036
14886
  this.setState({
15037
14887
  highlightDates: getHighLightDaysMap(this.props.highlightDates),
@@ -15085,7 +14935,7 @@ var DatePicker = /** @class */ (function (_super) {
15085
14935
  this.renderInputContainer(),
15086
14936
  portalContainer));
15087
14937
  }
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 })));
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 })));
15089
14939
  };
15090
14940
  return DatePicker;
15091
14941
  }(React.Component));
@@ -15493,4 +15343,4 @@ exports.DatePickerGroup = DatePickerGroup;
15493
15343
  exports.HelperText = HelperText;
15494
15344
  exports.InlineDatePicker = InlineDatePicker;
15495
15345
  exports.ValidationText = ValidationText;
15496
- //# sourceMappingURL=InlineDatePicker-BJZXMxnh.js.map
15346
+ //# sourceMappingURL=InlineDatePicker-4u82zKn2.js.map