@cerebruminc/cerebellum 16.5.10-beta.dangerous.9f03af8 → 16.5.10-beta.dangerous.c41a159
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/DatePicker.cjs +1 -1
- package/lib/cjs/Form.cjs +2 -2
- package/lib/cjs/{FormikContainer-DY64qixC.js → FormikContainer-BVUsbx6j.js} +2 -2
- package/lib/cjs/{FormikContainer-DY64qixC.js.map → FormikContainer-BVUsbx6j.js.map} +1 -1
- package/lib/cjs/{InlineDatePicker-pT085Em_.js → InlineDatePicker-4u82zKn2.js} +140 -702
- package/lib/{esm/InlineDatePicker-XiMGS9jI.js.map → cjs/InlineDatePicker-4u82zKn2.js.map} +1 -1
- package/lib/cjs/InlineDatePicker.cjs +1 -1
- package/lib/cjs/index.cjs +2 -2
- package/lib/esm/DatePicker.js +1 -1
- package/lib/esm/Form.js +2 -2
- package/lib/esm/{FormikContainer-BjsSb293.js → FormikContainer-C_iJWcIG.js} +2 -2
- package/lib/esm/{FormikContainer-BjsSb293.js.map → FormikContainer-C_iJWcIG.js.map} +1 -1
- package/lib/esm/{InlineDatePicker-XiMGS9jI.js → InlineDatePicker-RlV9iC8j.js} +141 -703
- package/lib/esm/InlineDatePicker-RlV9iC8j.js.map +1 -0
- package/lib/esm/InlineDatePicker.js +1 -1
- package/lib/esm/index.js +2 -2
- package/package.json +2 -2
- package/lib/cjs/InlineDatePicker-pT085Em_.js.map +0 -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,
|
|
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
|
|
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
|
|
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,
|
|
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
|
-
|
|
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 &&
|
|
@@ -9784,77 +9782,6 @@ var ClickOutsideWrapper = function (_a) {
|
|
|
9784
9782
|
} }, children));
|
|
9785
9783
|
};
|
|
9786
9784
|
|
|
9787
|
-
// Cache for the date-fns-tz module
|
|
9788
|
-
var dateFnsTz = null;
|
|
9789
|
-
var dateFnsTzLoadAttempted = false;
|
|
9790
|
-
/**
|
|
9791
|
-
* Attempts to load date-fns-tz module.
|
|
9792
|
-
* Returns null if the module is not installed.
|
|
9793
|
-
*/
|
|
9794
|
-
function getDateFnsTz() {
|
|
9795
|
-
if (dateFnsTzLoadAttempted) {
|
|
9796
|
-
return dateFnsTz;
|
|
9797
|
-
}
|
|
9798
|
-
dateFnsTzLoadAttempted = true;
|
|
9799
|
-
try {
|
|
9800
|
-
// Dynamic require for date-fns-tz
|
|
9801
|
-
// Use a variable to prevent webpack from statically analyzing the require
|
|
9802
|
-
// and showing warnings when the optional dependency is not installed
|
|
9803
|
-
// See: https://github.com/Hacker0x01/react-datepicker/issues/6154
|
|
9804
|
-
var dateFnsTzModuleName = "date-fns-tz";
|
|
9805
|
-
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
9806
|
-
dateFnsTz = require(dateFnsTzModuleName);
|
|
9807
|
-
}
|
|
9808
|
-
catch (_a) {
|
|
9809
|
-
/* istanbul ignore next - only executes when date-fns-tz is not installed */
|
|
9810
|
-
dateFnsTz = null;
|
|
9811
|
-
}
|
|
9812
|
-
return dateFnsTz;
|
|
9813
|
-
}
|
|
9814
|
-
/**
|
|
9815
|
-
* Converts a date to the specified timezone.
|
|
9816
|
-
* If no timezone is specified or date-fns-tz is not installed, returns the original date.
|
|
9817
|
-
*
|
|
9818
|
-
* @param date - The date to convert
|
|
9819
|
-
* @param timeZone - The IANA timezone identifier (e.g., "America/New_York", "UTC")
|
|
9820
|
-
* @returns The date in the specified timezone
|
|
9821
|
-
*/
|
|
9822
|
-
function toZonedTime(date, timeZone) {
|
|
9823
|
-
if (!timeZone) {
|
|
9824
|
-
return date;
|
|
9825
|
-
}
|
|
9826
|
-
var tz = getDateFnsTz();
|
|
9827
|
-
if (!tz) {
|
|
9828
|
-
if (process.env.NODE_ENV !== "production") {
|
|
9829
|
-
console.warn('react-datepicker: timeZone prop requires "date-fns-tz" package. ' +
|
|
9830
|
-
"Please install it: npm install date-fns-tz");
|
|
9831
|
-
}
|
|
9832
|
-
return date;
|
|
9833
|
-
}
|
|
9834
|
-
return tz.toZonedTime(date, timeZone);
|
|
9835
|
-
}
|
|
9836
|
-
/**
|
|
9837
|
-
* Converts a date from the specified timezone to UTC.
|
|
9838
|
-
* If no timezone is specified or date-fns-tz is not installed, returns the original date.
|
|
9839
|
-
*
|
|
9840
|
-
* @param date - The date in the specified timezone
|
|
9841
|
-
* @param timeZone - The IANA timezone identifier (e.g., "America/New_York", "UTC")
|
|
9842
|
-
* @returns The date in UTC
|
|
9843
|
-
*/
|
|
9844
|
-
function fromZonedTime(date, timeZone) {
|
|
9845
|
-
if (!timeZone) {
|
|
9846
|
-
return date;
|
|
9847
|
-
}
|
|
9848
|
-
var tz = getDateFnsTz();
|
|
9849
|
-
if (!tz) {
|
|
9850
|
-
if (process.env.NODE_ENV !== "production") {
|
|
9851
|
-
console.warn('react-datepicker: timeZone prop requires "date-fns-tz" package. ' +
|
|
9852
|
-
"Please install it: npm install date-fns-tz");
|
|
9853
|
-
}
|
|
9854
|
-
return date;
|
|
9855
|
-
}
|
|
9856
|
-
return tz.fromZonedTime(date, timeZone);
|
|
9857
|
-
}
|
|
9858
9785
|
var KeyType;
|
|
9859
9786
|
(function (KeyType) {
|
|
9860
9787
|
KeyType["ArrowUp"] = "ArrowUp";
|
|
@@ -9911,72 +9838,20 @@ function parseDate(value, dateFormat, locale, strictParsing, refDate) {
|
|
|
9911
9838
|
return parsedDate;
|
|
9912
9839
|
}
|
|
9913
9840
|
}
|
|
9914
|
-
// When strictParsing is false, try native Date parsing as a fallback
|
|
9915
|
-
// This allows flexible input formats like "12/05/2025" or "2025-12-16"
|
|
9916
|
-
// even when the dateFormat prop specifies a different format.
|
|
9917
|
-
// Only attempt this for inputs that look like complete dates (minimum
|
|
9918
|
-
// length of 8 characters, e.g., "1/1/2000") to avoid parsing partial
|
|
9919
|
-
// inputs like "03/" or "2000" which should be handled by parseDateForNavigation.
|
|
9920
|
-
if (!strictParsing && value && value.length >= 8) {
|
|
9921
|
-
var nativeDate = new Date(value);
|
|
9922
|
-
if (isValid$1(nativeDate)) {
|
|
9923
|
-
return nativeDate;
|
|
9924
|
-
}
|
|
9925
|
-
}
|
|
9926
9841
|
return null;
|
|
9927
9842
|
}
|
|
9928
9843
|
/**
|
|
9929
|
-
*
|
|
9930
|
-
* Unlike parseDate, this function attempts to extract whatever date
|
|
9931
|
-
* information is available (year, month) from a partial input,
|
|
9932
|
-
* returning a date suitable for navigating the calendar view.
|
|
9933
|
-
*
|
|
9934
|
-
* @param value - The date string to parse.
|
|
9935
|
-
* @param refDate - The reference date to use for missing components.
|
|
9936
|
-
* @returns - A date for navigation or null if no date info could be extracted.
|
|
9937
|
-
*/
|
|
9938
|
-
function parseDateForNavigation(value, refDate) {
|
|
9939
|
-
if (refDate === void 0) { refDate = newDate(); }
|
|
9940
|
-
if (!value)
|
|
9941
|
-
return null;
|
|
9942
|
-
// Try to extract a 4-digit year from the input
|
|
9943
|
-
var yearMatch = value.match(/\b(1\d{3}|2\d{3})\b/);
|
|
9944
|
-
if (!yearMatch || !yearMatch[1])
|
|
9945
|
-
return null;
|
|
9946
|
-
var year = parseInt(yearMatch[1], 10);
|
|
9947
|
-
// Try to extract a month (1-12) from the input
|
|
9948
|
-
// Look for patterns like "03/", "/03", "03-", "-03" or standalone "03" at start
|
|
9949
|
-
var monthMatch = value.match(/(?:^|[/\-\s])?(0?[1-9]|1[0-2])(?:[/\-\s]|$)/);
|
|
9950
|
-
var month = monthMatch && monthMatch[1]
|
|
9951
|
-
? parseInt(monthMatch[1], 10) - 1
|
|
9952
|
-
: refDate.getMonth();
|
|
9953
|
-
// Return a date with the extracted year and month, using day 1
|
|
9954
|
-
return new Date(year, month, 1);
|
|
9955
|
-
}
|
|
9956
|
-
/**
|
|
9957
|
-
* Checks if a given date is a valid Date object.
|
|
9844
|
+
* Checks if a given date is valid and not before the minimum date.
|
|
9958
9845
|
* @param date - The date to be checked.
|
|
9959
|
-
* @
|
|
9960
|
-
|
|
9961
|
-
function isValid(date) {
|
|
9962
|
-
return isValid$1(date);
|
|
9963
|
-
}
|
|
9964
|
-
/**
|
|
9965
|
-
* Safely returns a valid Date or null.
|
|
9966
|
-
* This handles cases where a value might be passed as a string or other
|
|
9967
|
-
* invalid type at runtime, even though TypeScript expects a Date.
|
|
9968
|
-
* @param date - The value to check (typed as Date but could be anything at runtime)
|
|
9969
|
-
* @returns The date if it's a valid Date object, otherwise null
|
|
9846
|
+
* @param minDate - The minimum date allowed. If not provided, defaults to "1/1/1800".
|
|
9847
|
+
* @returns A boolean value indicating whether the date is valid and not before the minimum date.
|
|
9970
9848
|
*/
|
|
9971
|
-
function
|
|
9972
|
-
|
|
9973
|
-
|
|
9974
|
-
|
|
9975
|
-
|
|
9976
|
-
|
|
9977
|
-
return date;
|
|
9978
|
-
}
|
|
9979
|
-
return null;
|
|
9849
|
+
function isValid(date, minDate) {
|
|
9850
|
+
/* the fallback date is essential to not break test case
|
|
9851
|
+
* `should auto update calendar when the updated date text is after props.minDate`
|
|
9852
|
+
* and backward compatibility respectfully
|
|
9853
|
+
*/
|
|
9854
|
+
return isValid$1(date) && !isBefore(date, new Date("1/1/1800"));
|
|
9980
9855
|
}
|
|
9981
9856
|
// ** Date Formatting **
|
|
9982
9857
|
/**
|
|
@@ -10577,7 +10452,6 @@ function isTimeInDisabledRange(time, _a) {
|
|
|
10577
10452
|
valid = !isWithinInterval(baseTime, { start: min, end: max });
|
|
10578
10453
|
}
|
|
10579
10454
|
catch (err) {
|
|
10580
|
-
/* istanbul ignore next - date-fns historically threw on invalid intervals */
|
|
10581
10455
|
valid = false;
|
|
10582
10456
|
}
|
|
10583
10457
|
return valid;
|
|
@@ -11153,10 +11027,6 @@ var Day = /** @class */ (function (_super) {
|
|
|
11153
11027
|
var _a;
|
|
11154
11028
|
var _b = _this.props, day = _b.day, selectsStart = _b.selectsStart, selectsEnd = _b.selectsEnd, selectsRange = _b.selectsRange, selectsDisabledDaysInRange = _b.selectsDisabledDaysInRange, startDate = _b.startDate, swapRange = _b.swapRange, endDate = _b.endDate;
|
|
11155
11029
|
var selectingDate = (_a = _this.props.selectingDate) !== null && _a !== void 0 ? _a : _this.props.preSelection;
|
|
11156
|
-
// Don't highlight days outside the current month
|
|
11157
|
-
if (_this.isAfterMonth() || _this.isBeforeMonth()) {
|
|
11158
|
-
return false;
|
|
11159
|
-
}
|
|
11160
11030
|
if (!(selectsStart || selectsEnd || selectsRange) ||
|
|
11161
11031
|
!selectingDate ||
|
|
11162
11032
|
(!selectsDisabledDaysInRange && _this.isDisabled())) {
|
|
@@ -11885,12 +11755,7 @@ var Month$1 = /** @class */ (function (_super) {
|
|
|
11885
11755
|
});
|
|
11886
11756
|
};
|
|
11887
11757
|
_this.isSelectedQuarter = function (day, q, selected) {
|
|
11888
|
-
return getQuarter(
|
|
11889
|
-
};
|
|
11890
|
-
_this.isSelectQuarterInList = function (day, q, selectedDates) {
|
|
11891
|
-
return selectedDates.some(function (selectedDate) {
|
|
11892
|
-
return _this.isSelectedQuarter(day, q, selectedDate);
|
|
11893
|
-
});
|
|
11758
|
+
return getQuarter(day) === q && getYear(day) === getYear(selected);
|
|
11894
11759
|
};
|
|
11895
11760
|
_this.isMonthSelected = function () {
|
|
11896
11761
|
var _a = _this.props, day = _a.day, selected = _a.selected, selectedDates = _a.selectedDates, selectsMultiple = _a.selectsMultiple;
|
|
@@ -11902,21 +11767,7 @@ var Month$1 = /** @class */ (function (_super) {
|
|
|
11902
11767
|
}
|
|
11903
11768
|
return !!selected && _this.isSelectedMonth(day, monthIdx, selected);
|
|
11904
11769
|
};
|
|
11905
|
-
_this.isQuarterSelected = function () {
|
|
11906
|
-
var _a = _this.props, day = _a.day, selected = _a.selected, selectedDates = _a.selectedDates, selectsMultiple = _a.selectsMultiple;
|
|
11907
|
-
var quarterIdx = getQuarter(day);
|
|
11908
|
-
if (selectsMultiple) {
|
|
11909
|
-
return selectedDates === null || selectedDates === void 0 ? void 0 : selectedDates.some(function (selectedDate) {
|
|
11910
|
-
return _this.isSelectedQuarter(day, quarterIdx, selectedDate);
|
|
11911
|
-
});
|
|
11912
|
-
}
|
|
11913
|
-
return !!selected && _this.isSelectedQuarter(day, quarterIdx, selected);
|
|
11914
|
-
};
|
|
11915
11770
|
_this.renderWeeks = function () {
|
|
11916
|
-
// Return empty array if day is invalid
|
|
11917
|
-
if (!isValid(_this.props.day)) {
|
|
11918
|
-
return [];
|
|
11919
|
-
}
|
|
11920
11771
|
var weeks = [];
|
|
11921
11772
|
var isFixedHeight = _this.props.fixedHeight;
|
|
11922
11773
|
var i = 0;
|
|
@@ -12213,7 +12064,7 @@ var Month$1 = /** @class */ (function (_super) {
|
|
|
12213
12064
|
return "".concat(prefix, " ").concat(formatDate(labelDate, "MMMM yyyy", locale));
|
|
12214
12065
|
};
|
|
12215
12066
|
_this.getQuarterClassNames = function (q) {
|
|
12216
|
-
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;
|
|
12217
12068
|
var isDisabled = (minDate ||
|
|
12218
12069
|
maxDate ||
|
|
12219
12070
|
excludeDates ||
|
|
@@ -12221,16 +12072,14 @@ var Month$1 = /** @class */ (function (_super) {
|
|
|
12221
12072
|
filterDate ||
|
|
12222
12073
|
disabled) &&
|
|
12223
12074
|
isQuarterDisabled(setQuarter(day, q), _this.props);
|
|
12224
|
-
var selection = _this.getSelection();
|
|
12225
12075
|
return clsx("react-datepicker__quarter-text", "react-datepicker__quarter-".concat(q), {
|
|
12226
12076
|
"react-datepicker__quarter-text--disabled": isDisabled,
|
|
12227
|
-
"react-datepicker__quarter-text--selected":
|
|
12228
|
-
? _this.
|
|
12077
|
+
"react-datepicker__quarter-text--selected": selected
|
|
12078
|
+
? _this.isSelectedQuarter(day, q, selected)
|
|
12229
12079
|
: undefined,
|
|
12230
12080
|
"react-datepicker__quarter-text--keyboard-selected": !disabledKeyboardNavigation &&
|
|
12231
12081
|
preSelection &&
|
|
12232
12082
|
_this.isSelectedQuarter(day, q, preSelection) &&
|
|
12233
|
-
!_this.isQuarterSelected() &&
|
|
12234
12083
|
!isDisabled,
|
|
12235
12084
|
"react-datepicker__quarter-text--in-selecting-range": _this.isInSelectingRangeQuarter(q),
|
|
12236
12085
|
"react-datepicker__quarter-text--in-range": startDate && endDate
|
|
@@ -12310,20 +12159,14 @@ var Month$1 = /** @class */ (function (_super) {
|
|
|
12310
12159
|
var formattedAriaLabelPrefix = ariaLabelPrefix
|
|
12311
12160
|
? ariaLabelPrefix.trim() + " "
|
|
12312
12161
|
: "";
|
|
12313
|
-
// Format aria-label, return empty string if date is invalid
|
|
12314
|
-
var formattedAriaLabel = isValid(day)
|
|
12315
|
-
? "".concat(formattedAriaLabelPrefix).concat(formatDate(day, "MMMM, yyyy", this.props.locale))
|
|
12316
|
-
: "";
|
|
12317
12162
|
var shouldUseListboxRole = showMonthYearPicker || showQuarterYearPicker;
|
|
12318
12163
|
if (shouldUseListboxRole) {
|
|
12319
|
-
return (React__default.createElement("div", { className: this.getClassNames(), onMouseLeave: !this.props.usePointerEvent ? this.handleMouseLeave : undefined, onPointerLeave: this.props.usePointerEvent ? this.handleMouseLeave : undefined, "aria-label":
|
|
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()));
|
|
12320
12165
|
}
|
|
12321
12166
|
// For regular calendar view, use table structure
|
|
12322
12167
|
return (React__default.createElement("div", { role: "table" },
|
|
12323
12168
|
this.props.dayNamesHeader && (React__default.createElement("div", { role: "rowgroup" }, this.props.dayNamesHeader)),
|
|
12324
|
-
this.props.
|
|
12325
|
-
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()),
|
|
12326
|
-
this.props.monthFooter && (React__default.createElement("div", { role: "rowgroup" }, this.props.monthFooter))));
|
|
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())));
|
|
12327
12170
|
};
|
|
12328
12171
|
return Month;
|
|
12329
12172
|
}(Component));
|
|
@@ -12434,15 +12277,10 @@ var MonthDropdown = /** @class */ (function (_super) {
|
|
|
12434
12277
|
return MonthDropdown;
|
|
12435
12278
|
}(Component));
|
|
12436
12279
|
|
|
12437
|
-
|
|
12438
|
-
var DEFAULT_YEAR_RANGE$1 = 5;
|
|
12439
|
-
function generateMonthYears(minDate, maxDate, currentDate) {
|
|
12280
|
+
function generateMonthYears(minDate, maxDate) {
|
|
12440
12281
|
var list = [];
|
|
12441
|
-
|
|
12442
|
-
var
|
|
12443
|
-
var effectiveMaxDate = maxDate !== null && maxDate !== void 0 ? maxDate : addYears(currentDate, DEFAULT_YEAR_RANGE$1);
|
|
12444
|
-
var currDate = getStartOfMonth(effectiveMinDate);
|
|
12445
|
-
var lastDate = getStartOfMonth(effectiveMaxDate);
|
|
12282
|
+
var currDate = getStartOfMonth(minDate);
|
|
12283
|
+
var lastDate = getStartOfMonth(maxDate);
|
|
12446
12284
|
while (!isAfter(currDate, lastDate)) {
|
|
12447
12285
|
list.push(newDate(currDate));
|
|
12448
12286
|
currDate = addMonths(currDate, 1);
|
|
@@ -12470,7 +12308,7 @@ var MonthYearDropdownOptions = /** @class */ (function (_super) {
|
|
|
12470
12308
|
_this.props.onCancel();
|
|
12471
12309
|
};
|
|
12472
12310
|
_this.state = {
|
|
12473
|
-
monthYearsList: generateMonthYears(_this.props.minDate, _this.props.maxDate
|
|
12311
|
+
monthYearsList: generateMonthYears(_this.props.minDate, _this.props.maxDate),
|
|
12474
12312
|
};
|
|
12475
12313
|
return _this;
|
|
12476
12314
|
}
|
|
@@ -12484,8 +12322,6 @@ var MonthYearDropdownOptions = /** @class */ (function (_super) {
|
|
|
12484
12322
|
return MonthYearDropdownOptions;
|
|
12485
12323
|
}(Component));
|
|
12486
12324
|
|
|
12487
|
-
// Default range: 5 years before and after current date
|
|
12488
|
-
var DEFAULT_YEAR_RANGE = 5;
|
|
12489
12325
|
var MonthYearDropdown = /** @class */ (function (_super) {
|
|
12490
12326
|
__extends(MonthYearDropdown, _super);
|
|
12491
12327
|
function MonthYearDropdown() {
|
|
@@ -12494,12 +12330,8 @@ var MonthYearDropdown = /** @class */ (function (_super) {
|
|
|
12494
12330
|
dropdownVisible: false,
|
|
12495
12331
|
};
|
|
12496
12332
|
_this.renderSelectOptions = function () {
|
|
12497
|
-
var
|
|
12498
|
-
|
|
12499
|
-
var minDate = (_a = _this.props.minDate) !== null && _a !== void 0 ? _a : subYears(_this.props.date, DEFAULT_YEAR_RANGE);
|
|
12500
|
-
var maxDate = (_b = _this.props.maxDate) !== null && _b !== void 0 ? _b : addYears(_this.props.date, DEFAULT_YEAR_RANGE);
|
|
12501
|
-
var currDate = getStartOfMonth(minDate);
|
|
12502
|
-
var lastDate = getStartOfMonth(maxDate);
|
|
12333
|
+
var currDate = getStartOfMonth(_this.props.minDate);
|
|
12334
|
+
var lastDate = getStartOfMonth(_this.props.maxDate);
|
|
12503
12335
|
var options = [];
|
|
12504
12336
|
while (!isAfter(currDate, lastDate)) {
|
|
12505
12337
|
var timePoint = getTime(currDate);
|
|
@@ -12591,8 +12423,7 @@ var Time = /** @class */ (function (_super) {
|
|
|
12591
12423
|
(_b = (_a = _this.props).onChange) === null || _b === void 0 ? void 0 : _b.call(_a, time);
|
|
12592
12424
|
};
|
|
12593
12425
|
_this.isSelectedTime = function (time) {
|
|
12594
|
-
|
|
12595
|
-
return selected && isSameMinute(selected, time);
|
|
12426
|
+
return _this.props.selected && isSameMinute(_this.props.selected, time);
|
|
12596
12427
|
};
|
|
12597
12428
|
_this.isDisabledTime = function (time) {
|
|
12598
12429
|
return ((_this.props.minTime || _this.props.maxTime) &&
|
|
@@ -12653,9 +12484,7 @@ var Time = /** @class */ (function (_super) {
|
|
|
12653
12484
|
var times = [];
|
|
12654
12485
|
var format = typeof _this.props.format === "string" ? _this.props.format : "p";
|
|
12655
12486
|
var intervals = (_a = _this.props.intervals) !== null && _a !== void 0 ? _a : Time.defaultProps.intervals;
|
|
12656
|
-
var activeDate =
|
|
12657
|
-
safeToDate(_this.props.openToDate) ||
|
|
12658
|
-
newDate();
|
|
12487
|
+
var activeDate = _this.props.selected || _this.props.openToDate || newDate();
|
|
12659
12488
|
var base = getStartOfDay(activeDate);
|
|
12660
12489
|
var sortedInjectTimes = _this.props.injectTimes &&
|
|
12661
12490
|
_this.props.injectTimes.sort(function (a, b) {
|
|
@@ -12735,13 +12564,9 @@ var Time = /** @class */ (function (_super) {
|
|
|
12735
12564
|
};
|
|
12736
12565
|
Time.prototype.updateContainerHeight = function () {
|
|
12737
12566
|
if (this.props.monthRef && this.header) {
|
|
12738
|
-
|
|
12739
|
-
|
|
12740
|
-
|
|
12741
|
-
this.setState({
|
|
12742
|
-
height: newHeight,
|
|
12743
|
-
});
|
|
12744
|
-
}
|
|
12567
|
+
this.setState({
|
|
12568
|
+
height: this.props.monthRef.clientHeight - this.header.clientHeight,
|
|
12569
|
+
});
|
|
12745
12570
|
}
|
|
12746
12571
|
};
|
|
12747
12572
|
Time.prototype.render = function () {
|
|
@@ -13429,13 +13254,7 @@ var Calendar = /** @class */ (function (_super) {
|
|
|
13429
13254
|
return ({
|
|
13430
13255
|
date: setMonth(date, Number(month)),
|
|
13431
13256
|
});
|
|
13432
|
-
}, function () {
|
|
13433
|
-
var _a, _b;
|
|
13434
|
-
_this.handleMonthChange(_this.state.date);
|
|
13435
|
-
// Reset monthSelectedIn to 0 so the target month appears in the leftmost position
|
|
13436
|
-
// This ensures consistent behavior when using changeMonth in custom headers
|
|
13437
|
-
(_b = (_a = _this.props).onMonthSelectedInChange) === null || _b === void 0 ? void 0 : _b.call(_a, 0);
|
|
13438
|
-
});
|
|
13257
|
+
}, function () { return _this.handleMonthChange(_this.state.date); });
|
|
13439
13258
|
};
|
|
13440
13259
|
_this.changeMonthYear = function (monthYear) {
|
|
13441
13260
|
_this.setState(function (_a) {
|
|
@@ -13445,13 +13264,8 @@ var Calendar = /** @class */ (function (_super) {
|
|
|
13445
13264
|
});
|
|
13446
13265
|
}, function () { return _this.handleMonthYearChange(_this.state.date); });
|
|
13447
13266
|
};
|
|
13448
|
-
_this.header = function (date
|
|
13267
|
+
_this.header = function (date) {
|
|
13449
13268
|
if (date === void 0) { date = _this.state.date; }
|
|
13450
|
-
if (customDayNameCount === void 0) { customDayNameCount = 0; }
|
|
13451
|
-
// Return empty array if date is invalid
|
|
13452
|
-
if (!isValid(date)) {
|
|
13453
|
-
return [];
|
|
13454
|
-
}
|
|
13455
13269
|
var disabled = _this.props.disabled;
|
|
13456
13270
|
var startOfWeek = getStartOfWeek(date, _this.props.locale, _this.props.calendarStartDay);
|
|
13457
13271
|
var dayNames = [];
|
|
@@ -13463,24 +13277,11 @@ var Calendar = /** @class */ (function (_super) {
|
|
|
13463
13277
|
return dayNames.concat([0, 1, 2, 3, 4, 5, 6].map(function (offset) {
|
|
13464
13278
|
var day = addDays(startOfWeek, offset);
|
|
13465
13279
|
var weekDayName = _this.formatWeekday(day, _this.props.locale);
|
|
13466
|
-
var fullDayName = formatDate(day, "EEEE", _this.props.locale);
|
|
13467
13280
|
var weekDayClassName = _this.props.weekDayClassName
|
|
13468
13281
|
? _this.props.weekDayClassName(day)
|
|
13469
13282
|
: undefined;
|
|
13470
|
-
// Use custom render if provided
|
|
13471
|
-
if (_this.props.renderCustomDayName) {
|
|
13472
|
-
var customContent = _this.props.renderCustomDayName({
|
|
13473
|
-
day: day,
|
|
13474
|
-
shortName: weekDayName,
|
|
13475
|
-
fullName: fullDayName,
|
|
13476
|
-
locale: _this.props.locale,
|
|
13477
|
-
customDayNameCount: customDayNameCount,
|
|
13478
|
-
});
|
|
13479
|
-
return (React__default.createElement("div", { key: offset, role: "columnheader", className: clsx("react-datepicker__day-name", weekDayClassName, disabled ? "react-datepicker__day-name--disabled" : "") }, customContent));
|
|
13480
|
-
}
|
|
13481
|
-
// Default render
|
|
13482
13283
|
return (React__default.createElement("div", { key: offset, role: "columnheader", className: clsx("react-datepicker__day-name", weekDayClassName, disabled ? "react-datepicker__day-name--disabled" : "") },
|
|
13483
|
-
React__default.createElement("span", { className: "react-datepicker__sr-only" },
|
|
13284
|
+
React__default.createElement("span", { className: "react-datepicker__sr-only" }, formatDate(day, "EEEE", _this.props.locale)),
|
|
13484
13285
|
React__default.createElement("span", { "aria-hidden": "true" }, weekDayName)));
|
|
13485
13286
|
}));
|
|
13486
13287
|
};
|
|
@@ -13659,9 +13460,7 @@ var Calendar = /** @class */ (function (_super) {
|
|
|
13659
13460
|
if (_this.props.showMonthYearDropdown) {
|
|
13660
13461
|
classes.push("react-datepicker__current-month--hasMonthYearDropdown");
|
|
13661
13462
|
}
|
|
13662
|
-
return (React__default.createElement("h2", { className: classes.join(" ") },
|
|
13663
|
-
? formatDate(date, _this.props.dateFormat, _this.props.locale)
|
|
13664
|
-
: ""));
|
|
13463
|
+
return (React__default.createElement("h2", { className: classes.join(" ") }, formatDate(date, _this.props.dateFormat, _this.props.locale)));
|
|
13665
13464
|
};
|
|
13666
13465
|
_this.renderYearDropdown = function (overrideHide) {
|
|
13667
13466
|
if (overrideHide === void 0) { overrideHide = false; }
|
|
@@ -13694,31 +13493,17 @@ var Calendar = /** @class */ (function (_super) {
|
|
|
13694
13493
|
}
|
|
13695
13494
|
return (React__default.createElement("div", { className: "react-datepicker__today-button", onClick: _this.handleTodayButtonClick }, _this.props.todayButton));
|
|
13696
13495
|
};
|
|
13697
|
-
_this.renderDayNamesHeader = function (monthDate,
|
|
13698
|
-
if (customDayNameCount === void 0) { customDayNameCount = 0; }
|
|
13699
|
-
return (React__default.createElement("div", { className: "react-datepicker__day-names", role: "row" }, _this.header(monthDate, customDayNameCount)));
|
|
13700
|
-
};
|
|
13496
|
+
_this.renderDayNamesHeader = function (monthDate) { return (React__default.createElement("div", { className: "react-datepicker__day-names", role: "row" }, _this.header(monthDate))); };
|
|
13701
13497
|
_this.renderDefaultHeader = function (_a) {
|
|
13702
13498
|
var monthDate = _a.monthDate, i = _a.i;
|
|
13703
|
-
|
|
13704
|
-
"react-datepicker__header--has-time-select"
|
|
13705
|
-
|
|
13706
|
-
"react-datepicker__header--bottom": _this.props.monthHeaderPosition === "bottom",
|
|
13707
|
-
}) },
|
|
13499
|
+
return (React__default.createElement("div", { className: "react-datepicker__header ".concat(_this.props.showTimeSelect
|
|
13500
|
+
? "react-datepicker__header--has-time-select"
|
|
13501
|
+
: "") },
|
|
13708
13502
|
_this.renderCurrentMonth(monthDate),
|
|
13709
13503
|
React__default.createElement("div", { className: "react-datepicker__header__dropdown react-datepicker__header__dropdown--".concat(_this.props.dropdownMode), onFocus: _this.handleDropdownFocus },
|
|
13710
13504
|
_this.renderMonthDropdown(i !== 0),
|
|
13711
13505
|
_this.renderMonthYearDropdown(i !== 0),
|
|
13712
13506
|
_this.renderYearDropdown(i !== 0))));
|
|
13713
|
-
// Top position: render header directly in default location
|
|
13714
|
-
if (_this.props.monthHeaderPosition === "top") {
|
|
13715
|
-
return headerContent;
|
|
13716
|
-
}
|
|
13717
|
-
// Middle/bottom positions: wrap with navigation buttons
|
|
13718
|
-
return (React__default.createElement("div", { className: "react-datepicker__header-wrapper" },
|
|
13719
|
-
_this.renderPreviousButton() || null,
|
|
13720
|
-
_this.renderNextButton() || null,
|
|
13721
|
-
headerContent));
|
|
13722
13507
|
};
|
|
13723
13508
|
_this.renderCustomHeader = function (headerArgs) {
|
|
13724
13509
|
var _a, _b;
|
|
@@ -13787,13 +13572,8 @@ var Calendar = /** @class */ (function (_super) {
|
|
|
13787
13572
|
monthList.push(React__default.createElement("div", { key: monthKey, ref: function (div) {
|
|
13788
13573
|
_this.monthContainer = div !== null && div !== void 0 ? div : undefined;
|
|
13789
13574
|
}, className: "react-datepicker__month-container" },
|
|
13790
|
-
_this.
|
|
13791
|
-
|
|
13792
|
-
React__default.createElement(Month$1, _assign({}, Calendar.defaultProps, _this.props, { containerRef: _this.containerRef, ariaLabelPrefix: _this.props.monthAriaLabelPrefix, day: monthDate, onDayClick: _this.handleDayClick, handleOnKeyDown: _this.props.handleOnDayKeyDown, handleOnMonthKeyDown: _this.props.handleOnKeyDown, onDayMouseEnter: _this.handleDayMouseEnter, onMouseLeave: _this.handleMonthMouseLeave, orderInDisplay: i, selectingDate: _this.state.selectingDate, monthShowsDuplicateDaysEnd: monthShowsDuplicateDaysEnd, monthShowsDuplicateDaysStart: monthShowsDuplicateDaysStart, dayNamesHeader: _this.renderDayNamesHeader(monthDate, i), monthHeader: _this.props.monthHeaderPosition === "middle"
|
|
13793
|
-
? _this.renderHeader({ monthDate: monthDate, i: i })
|
|
13794
|
-
: undefined, monthFooter: _this.props.monthHeaderPosition === "bottom"
|
|
13795
|
-
? _this.renderHeader({ monthDate: monthDate, i: i })
|
|
13796
|
-
: undefined }))));
|
|
13575
|
+
_this.renderHeader({ monthDate: monthDate, i: i }),
|
|
13576
|
+
React__default.createElement(Month$1, _assign({}, Calendar.defaultProps, _this.props, { containerRef: _this.containerRef, ariaLabelPrefix: _this.props.monthAriaLabelPrefix, day: monthDate, onDayClick: _this.handleDayClick, handleOnKeyDown: _this.props.handleOnDayKeyDown, handleOnMonthKeyDown: _this.props.handleOnKeyDown, onDayMouseEnter: _this.handleDayMouseEnter, onMouseLeave: _this.handleMonthMouseLeave, orderInDisplay: i, selectingDate: _this.state.selectingDate, monthShowsDuplicateDaysEnd: monthShowsDuplicateDaysEnd, monthShowsDuplicateDaysStart: monthShowsDuplicateDaysStart, dayNamesHeader: _this.renderDayNamesHeader(monthDate) }))));
|
|
13797
13577
|
}
|
|
13798
13578
|
return monthList;
|
|
13799
13579
|
};
|
|
@@ -13816,34 +13596,6 @@ var Calendar = /** @class */ (function (_super) {
|
|
|
13816
13596
|
return;
|
|
13817
13597
|
};
|
|
13818
13598
|
_this.renderInputTimeSection = function () {
|
|
13819
|
-
var _a, _b;
|
|
13820
|
-
if (!_this.props.showTimeInput) {
|
|
13821
|
-
return;
|
|
13822
|
-
}
|
|
13823
|
-
// Handle selectsRange mode - render two time inputs
|
|
13824
|
-
if (_this.props.selectsRange) {
|
|
13825
|
-
var _c = _this.props, startDate = _c.startDate, endDate = _c.endDate;
|
|
13826
|
-
var startTime = startDate ? new Date(startDate) : undefined;
|
|
13827
|
-
var startTimeValid = startTime && isValid(startTime) && Boolean(startDate);
|
|
13828
|
-
var startTimeString = startTimeValid
|
|
13829
|
-
? "".concat(addZero(startTime.getHours()), ":").concat(addZero(startTime.getMinutes()))
|
|
13830
|
-
: "";
|
|
13831
|
-
var endTime = endDate ? new Date(endDate) : undefined;
|
|
13832
|
-
var endTimeValid = endTime && isValid(endTime) && Boolean(endDate);
|
|
13833
|
-
var endTimeString = endTimeValid
|
|
13834
|
-
? "".concat(addZero(endTime.getHours()), ":").concat(addZero(endTime.getMinutes()))
|
|
13835
|
-
: "";
|
|
13836
|
-
return (React__default.createElement(React__default.Fragment, null,
|
|
13837
|
-
React__default.createElement(InputTime, _assign({}, Calendar.defaultProps, _this.props, { date: startTime, timeString: startTimeString, onChange: function (time) {
|
|
13838
|
-
var _a, _b;
|
|
13839
|
-
(_b = (_a = _this.props).onTimeChange) === null || _b === void 0 ? void 0 : _b.call(_a, time, "start");
|
|
13840
|
-
}, timeInputLabel: ((_a = _this.props.timeInputLabel) !== null && _a !== void 0 ? _a : "Time") + " (Start)" })),
|
|
13841
|
-
React__default.createElement(InputTime, _assign({}, Calendar.defaultProps, _this.props, { date: endTime, timeString: endTimeString, onChange: function (time) {
|
|
13842
|
-
var _a, _b;
|
|
13843
|
-
(_b = (_a = _this.props).onTimeChange) === null || _b === void 0 ? void 0 : _b.call(_a, time, "end");
|
|
13844
|
-
}, timeInputLabel: ((_b = _this.props.timeInputLabel) !== null && _b !== void 0 ? _b : "Time") + " (End)" }))));
|
|
13845
|
-
}
|
|
13846
|
-
// Single date mode (original behavior)
|
|
13847
13599
|
var time = _this.props.selected
|
|
13848
13600
|
? new Date(_this.props.selected)
|
|
13849
13601
|
: undefined;
|
|
@@ -13851,17 +13603,13 @@ var Calendar = /** @class */ (function (_super) {
|
|
|
13851
13603
|
var timeString = timeValid
|
|
13852
13604
|
? "".concat(addZero(time.getHours()), ":").concat(addZero(time.getMinutes()))
|
|
13853
13605
|
: "";
|
|
13854
|
-
|
|
13855
|
-
|
|
13856
|
-
|
|
13857
|
-
|
|
13606
|
+
if (_this.props.showTimeInput) {
|
|
13607
|
+
return (React__default.createElement(InputTime, _assign({}, Calendar.defaultProps, _this.props, { date: time, timeString: timeString, onChange: _this.props.onTimeChange })));
|
|
13608
|
+
}
|
|
13609
|
+
return;
|
|
13858
13610
|
};
|
|
13859
13611
|
_this.renderAriaLiveRegion = function () {
|
|
13860
13612
|
var _a;
|
|
13861
|
-
// Don't render aria-live message if date is invalid
|
|
13862
|
-
if (!isValid(_this.state.date)) {
|
|
13863
|
-
return (React__default.createElement("span", { role: "alert", "aria-live": "polite", className: "react-datepicker__aria-live" }));
|
|
13864
|
-
}
|
|
13865
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;
|
|
13866
13614
|
var ariaLiveMessage;
|
|
13867
13615
|
if (_this.props.showYearPicker) {
|
|
@@ -13903,7 +13651,6 @@ var Calendar = /** @class */ (function (_super) {
|
|
|
13903
13651
|
previousMonthButtonLabel: "Previous Month",
|
|
13904
13652
|
nextMonthButtonLabel: "Next Month",
|
|
13905
13653
|
yearItemNumber: DEFAULT_YEAR_ITEM_NUMBER,
|
|
13906
|
-
monthHeaderPosition: "top",
|
|
13907
13654
|
};
|
|
13908
13655
|
},
|
|
13909
13656
|
enumerable: false,
|
|
@@ -13924,7 +13671,6 @@ var Calendar = /** @class */ (function (_super) {
|
|
|
13924
13671
|
Calendar.prototype.componentDidUpdate = function (prevProps) {
|
|
13925
13672
|
var _this = this;
|
|
13926
13673
|
if (this.props.preSelection &&
|
|
13927
|
-
isValid(this.props.preSelection) &&
|
|
13928
13674
|
(!isSameDay(this.props.preSelection, prevProps.preSelection) ||
|
|
13929
13675
|
this.props.monthSelectedIn !== prevProps.monthSelectedIn)) {
|
|
13930
13676
|
var hasMonthChanged_1 = !isSameMonth(this.state.date, this.props.preSelection);
|
|
@@ -13945,12 +13691,10 @@ var Calendar = /** @class */ (function (_super) {
|
|
|
13945
13691
|
React__default.createElement("div", { style: { display: "contents" }, ref: this.containerRef },
|
|
13946
13692
|
React__default.createElement(Container, { className: clsx("react-datepicker", this.props.className, {
|
|
13947
13693
|
"react-datepicker--time-only": this.props.showTimeSelectOnly,
|
|
13948
|
-
}), showTime: this.props.showTimeSelect || this.props.showTimeInput, showTimeSelectOnly: this.props.showTimeSelectOnly
|
|
13694
|
+
}), showTime: this.props.showTimeSelect || this.props.showTimeInput, showTimeSelectOnly: this.props.showTimeSelectOnly },
|
|
13949
13695
|
this.renderAriaLiveRegion(),
|
|
13950
|
-
this.
|
|
13951
|
-
|
|
13952
|
-
this.props.monthHeaderPosition === "top" &&
|
|
13953
|
-
this.renderNextButton(),
|
|
13696
|
+
this.renderPreviousButton(),
|
|
13697
|
+
this.renderNextButton(),
|
|
13954
13698
|
this.renderMonths(),
|
|
13955
13699
|
this.renderYears(),
|
|
13956
13700
|
this.renderTodayButton(),
|
|
@@ -14141,7 +13885,6 @@ function withFloating(Component) {
|
|
|
14141
13885
|
var floatingProps = useFloating(_assign({ open: !hidePopper, whileElementsMounted: autoUpdate, placement: props.popperPlacement, middleware: __spreadArray([
|
|
14142
13886
|
flip({ padding: 15 }),
|
|
14143
13887
|
offset(10),
|
|
14144
|
-
// eslint-disable-next-line react-hooks/refs -- Floating UI requires refs to be passed during render
|
|
14145
13888
|
arrow({ element: arrowRef })
|
|
14146
13889
|
], ((_a = props.popperModifiers) !== null && _a !== void 0 ? _a : []), true) }, props.popperProps));
|
|
14147
13890
|
var componentProps = _assign(_assign({}, props), { hidePopper: hidePopper, popperProps: _assign(_assign({}, floatingProps), { arrowRef: arrowRef }) });
|
|
@@ -14152,21 +13895,11 @@ function withFloating(Component) {
|
|
|
14152
13895
|
}
|
|
14153
13896
|
|
|
14154
13897
|
// Exported for testing purposes
|
|
14155
|
-
var PopperComponent
|
|
14156
|
-
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
|
|
14157
|
-
// When a custom popperTargetRef is provided, use it as the position reference
|
|
14158
|
-
// This allows the popper to be positioned relative to a specific element
|
|
14159
|
-
// within the custom input, rather than the wrapper div
|
|
14160
|
-
useEffect(function () {
|
|
14161
|
-
if (popperTargetRef === null || popperTargetRef === void 0 ? void 0 : popperTargetRef.current) {
|
|
14162
|
-
popperProps.refs.setPositionReference(popperTargetRef.current);
|
|
14163
|
-
}
|
|
14164
|
-
}, [popperTargetRef, popperProps.refs]);
|
|
13898
|
+
var PopperComponent = function (props) {
|
|
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;
|
|
14165
13900
|
var popper = undefined;
|
|
14166
13901
|
if (!hidePopper) {
|
|
14167
|
-
var classes = clsx("react-datepicker-popper",
|
|
14168
|
-
"react-datepicker-popper--header-middle", monthHeaderPosition === "bottom" &&
|
|
14169
|
-
"react-datepicker-popper--header-bottom", className);
|
|
13902
|
+
var classes = clsx("react-datepicker-popper", className);
|
|
14170
13903
|
popper = (React__default.createElement(TabLoop, { enableTabLoop: enableTabLoop },
|
|
14171
13904
|
React__default.createElement("div", { ref: popperProps.refs.setFloating, style: popperProps.floatingStyles, className: classes, "data-placement": popperProps.placement, onKeyDown: popperOnKeyDown },
|
|
14172
13905
|
popperComponent,
|
|
@@ -14183,7 +13916,7 @@ var PopperComponent$1 = function (props) {
|
|
|
14183
13916
|
React__default.createElement("div", { ref: popperProps.refs.setReference, className: wrapperClasses }, targetComponent),
|
|
14184
13917
|
popper));
|
|
14185
13918
|
};
|
|
14186
|
-
var PopperComponent = withFloating(PopperComponent
|
|
13919
|
+
var PopperComponent$1 = withFloating(PopperComponent);
|
|
14187
13920
|
|
|
14188
13921
|
// Compares dates year+month combinations
|
|
14189
13922
|
function hasPreSelectionChanged(date1, date2) {
|
|
@@ -14203,32 +13936,27 @@ var DatePicker = /** @class */ (function (_super) {
|
|
|
14203
13936
|
_this.calendar = null;
|
|
14204
13937
|
_this.input = null;
|
|
14205
13938
|
_this.getPreSelection = function () {
|
|
14206
|
-
|
|
14207
|
-
var baseDate = _this.props.openToDate
|
|
13939
|
+
return _this.props.openToDate
|
|
14208
13940
|
? _this.props.openToDate
|
|
14209
13941
|
: _this.props.selectsEnd && _this.props.startDate
|
|
14210
13942
|
? _this.props.startDate
|
|
14211
13943
|
: _this.props.selectsStart && _this.props.endDate
|
|
14212
13944
|
? _this.props.endDate
|
|
14213
13945
|
: newDate();
|
|
14214
|
-
// Convert to the specified timezone for display
|
|
14215
|
-
return timeZone ? toZonedTime(baseDate, timeZone) : baseDate;
|
|
14216
13946
|
};
|
|
14217
13947
|
// Convert the date from string format to standard Date format
|
|
14218
|
-
// Uses parseDate with ISO format to parse as local time, preventing
|
|
14219
|
-
// dates from shifting in timezones west of UTC. See issue #6105.
|
|
14220
13948
|
_this.modifyHolidays = function () {
|
|
14221
13949
|
var _a;
|
|
14222
13950
|
return (_a = _this.props.holidays) === null || _a === void 0 ? void 0 : _a.reduce(function (accumulator, holiday) {
|
|
14223
|
-
var date =
|
|
14224
|
-
if (!date) {
|
|
13951
|
+
var date = new Date(holiday.date);
|
|
13952
|
+
if (!isValid(date)) {
|
|
14225
13953
|
return accumulator;
|
|
14226
13954
|
}
|
|
14227
13955
|
return __spreadArray(__spreadArray([], accumulator, true), [_assign(_assign({}, holiday), { date: date })], false);
|
|
14228
13956
|
}, []);
|
|
14229
13957
|
};
|
|
14230
13958
|
_this.calcInitialState = function () {
|
|
14231
|
-
var
|
|
13959
|
+
var _a;
|
|
14232
13960
|
var defaultPreSelection = _this.getPreSelection();
|
|
14233
13961
|
var minDate = getEffectiveMinDate(_this.props);
|
|
14234
13962
|
var maxDate = getEffectiveMaxDate(_this.props);
|
|
@@ -14237,18 +13965,13 @@ var DatePicker = /** @class */ (function (_super) {
|
|
|
14237
13965
|
: maxDate && isAfter(defaultPreSelection, getEndOfDay(maxDate))
|
|
14238
13966
|
? maxDate
|
|
14239
13967
|
: defaultPreSelection;
|
|
14240
|
-
// Convert selected/startDate to zoned time for display if timezone is specified
|
|
14241
|
-
var initialPreSelection = _this.props.selectsRange
|
|
14242
|
-
? _this.props.startDate
|
|
14243
|
-
: _this.props.selected;
|
|
14244
|
-
if (initialPreSelection && timeZone) {
|
|
14245
|
-
initialPreSelection = toZonedTime(initialPreSelection, timeZone);
|
|
14246
|
-
}
|
|
14247
13968
|
return {
|
|
14248
13969
|
open: _this.props.startOpen || false,
|
|
14249
13970
|
preventFocus: false,
|
|
14250
13971
|
inputValue: null,
|
|
14251
|
-
preSelection:
|
|
13972
|
+
preSelection: (_a = (_this.props.selectsRange
|
|
13973
|
+
? _this.props.startDate
|
|
13974
|
+
: _this.props.selected)) !== null && _a !== void 0 ? _a : boundedPreSelection,
|
|
14252
13975
|
// transforming highlighted days (perhaps nested array)
|
|
14253
13976
|
// to flat Map for faster access in day.jsx
|
|
14254
13977
|
highlightDates: getHighLightDaysMap(_this.props.highlightDates),
|
|
@@ -14262,7 +13985,7 @@ var DatePicker = /** @class */ (function (_super) {
|
|
|
14262
13985
|
};
|
|
14263
13986
|
_this.getInputValue = function () {
|
|
14264
13987
|
var _a;
|
|
14265
|
-
var _b = _this.props, locale = _b.locale, startDate = _b.startDate, endDate = _b.endDate, rangeSeparator = _b.rangeSeparator, selected = _b.selected, selectedDates = _b.selectedDates, selectsMultiple = _b.selectsMultiple, selectsRange = _b.selectsRange,
|
|
13988
|
+
var _b = _this.props, locale = _b.locale, startDate = _b.startDate, endDate = _b.endDate, rangeSeparator = _b.rangeSeparator, selected = _b.selected, selectedDates = _b.selectedDates, selectsMultiple = _b.selectsMultiple, selectsRange = _b.selectsRange, value = _b.value;
|
|
14266
13989
|
var dateFormat = (_a = _this.props.dateFormat) !== null && _a !== void 0 ? _a : DatePicker.defaultProps.dateFormat;
|
|
14267
13990
|
var inputValue = _this.state.inputValue;
|
|
14268
13991
|
if (typeof value === "string") {
|
|
@@ -14279,12 +14002,6 @@ var DatePicker = /** @class */ (function (_super) {
|
|
|
14279
14002
|
});
|
|
14280
14003
|
}
|
|
14281
14004
|
else if (selectsMultiple) {
|
|
14282
|
-
if (formatMultipleDates) {
|
|
14283
|
-
var formatDateFn = function (date) {
|
|
14284
|
-
return safeDateFormat(date, { dateFormat: dateFormat, locale: locale });
|
|
14285
|
-
};
|
|
14286
|
-
return formatMultipleDates(selectedDates !== null && selectedDates !== void 0 ? selectedDates : [], formatDateFn);
|
|
14287
|
-
}
|
|
14288
14005
|
return safeMultipleDatesFormat(selectedDates !== null && selectedDates !== void 0 ? selectedDates : [], {
|
|
14289
14006
|
dateFormat: dateFormat,
|
|
14290
14007
|
locale: locale,
|
|
@@ -14402,19 +14119,6 @@ var DatePicker = /** @class */ (function (_super) {
|
|
|
14402
14119
|
if (!_this.state.open || _this.props.withPortal || _this.props.showTimeInput) {
|
|
14403
14120
|
(_b = (_a = _this.props).onBlur) === null || _b === void 0 ? void 0 : _b.call(_a, event);
|
|
14404
14121
|
}
|
|
14405
|
-
// If user cleared the input via a mask library (inputValue has no date-like
|
|
14406
|
-
// characters), clear the selection on blur (fixes issue #5814 with mask inputs)
|
|
14407
|
-
var inputValue = _this.state.inputValue;
|
|
14408
|
-
if (typeof inputValue === "string" && inputValue.length > 0) {
|
|
14409
|
-
// Check if input looks like a cleared mask (no alphanumeric characters)
|
|
14410
|
-
// This distinguishes between:
|
|
14411
|
-
// - "__/__/____" (cleared mask) → should clear selection
|
|
14412
|
-
// - "2025-02-45" (invalid date) → should keep previous selection
|
|
14413
|
-
var hasDateCharacters = /[a-zA-Z0-9]/.test(inputValue);
|
|
14414
|
-
if (!hasDateCharacters && _this.props.selected) {
|
|
14415
|
-
_this.setSelected(null, undefined, true);
|
|
14416
|
-
}
|
|
14417
|
-
}
|
|
14418
14122
|
_this.resetInputValue();
|
|
14419
14123
|
if (_this.state.open && _this.props.open === false) {
|
|
14420
14124
|
_this.setOpen(false);
|
|
@@ -14423,19 +14127,17 @@ var DatePicker = /** @class */ (function (_super) {
|
|
|
14423
14127
|
};
|
|
14424
14128
|
_this.handleCalendarClickOutside = function (event) {
|
|
14425
14129
|
var _a, _b;
|
|
14426
|
-
|
|
14427
|
-
(_b = (_a = _this.props).onClickOutside) === null || _b === void 0 ? void 0 : _b.call(_a, event);
|
|
14428
|
-
// Only close if not prevented and not inline
|
|
14429
|
-
if (!_this.props.inline && !event.defaultPrevented) {
|
|
14130
|
+
if (!_this.props.inline) {
|
|
14430
14131
|
_this.setOpen(false);
|
|
14431
14132
|
}
|
|
14133
|
+
(_b = (_a = _this.props).onClickOutside) === null || _b === void 0 ? void 0 : _b.call(_a, event);
|
|
14432
14134
|
if (_this.props.withPortal) {
|
|
14433
14135
|
event.preventDefault();
|
|
14434
14136
|
}
|
|
14435
14137
|
};
|
|
14436
14138
|
// handleChange is called when user types in the textbox
|
|
14437
14139
|
_this.handleChange = function () {
|
|
14438
|
-
var _a, _b, _c, _d, _e
|
|
14140
|
+
var _a, _b, _c, _d, _e;
|
|
14439
14141
|
var allArgs = [];
|
|
14440
14142
|
for (var _i = 0; _i < arguments.length; _i++) {
|
|
14441
14143
|
allArgs[_i] = arguments[_i];
|
|
@@ -14453,24 +14155,24 @@ var DatePicker = /** @class */ (function (_super) {
|
|
|
14453
14155
|
inputValue: (event === null || event === void 0 ? void 0 : event.target) instanceof HTMLInputElement ? event.target.value : null,
|
|
14454
14156
|
lastPreSelectChange: PRESELECT_CHANGE_VIA_INPUT,
|
|
14455
14157
|
});
|
|
14456
|
-
var
|
|
14158
|
+
var _f = _this.props, selectsRange = _f.selectsRange, startDate = _f.startDate, endDate = _f.endDate;
|
|
14457
14159
|
var dateFormat = (_a = _this.props.dateFormat) !== null && _a !== void 0 ? _a : DatePicker.defaultProps.dateFormat;
|
|
14458
14160
|
var strictParsing = (_b = _this.props.strictParsing) !== null && _b !== void 0 ? _b : DatePicker.defaultProps.strictParsing;
|
|
14459
14161
|
var value = (event === null || event === void 0 ? void 0 : event.target) instanceof HTMLInputElement ? event.target.value : "";
|
|
14460
14162
|
if (selectsRange) {
|
|
14461
14163
|
var rangeSeparator = _this.props.rangeSeparator;
|
|
14462
14164
|
var trimmedRangeSeparator = rangeSeparator.trim();
|
|
14463
|
-
var
|
|
14165
|
+
var _g = value
|
|
14464
14166
|
.split(dateFormat.includes(trimmedRangeSeparator)
|
|
14465
14167
|
? rangeSeparator
|
|
14466
14168
|
: trimmedRangeSeparator, 2)
|
|
14467
|
-
.map(function (val) { return val.trim(); }), valueStart =
|
|
14169
|
+
.map(function (val) { return val.trim(); }), valueStart = _g[0], valueEnd = _g[1];
|
|
14468
14170
|
var startDateNew = parseDate(valueStart !== null && valueStart !== void 0 ? valueStart : "", dateFormat, _this.props.locale, strictParsing);
|
|
14469
14171
|
var endDateNew = startDateNew
|
|
14470
14172
|
? parseDate(valueEnd !== null && valueEnd !== void 0 ? valueEnd : "", dateFormat, _this.props.locale, strictParsing)
|
|
14471
14173
|
: null;
|
|
14472
|
-
var startChanged = (
|
|
14473
|
-
var endChanged = (
|
|
14174
|
+
var startChanged = (startDate === null || startDate === void 0 ? void 0 : startDate.getTime()) !== (startDateNew === null || startDateNew === void 0 ? void 0 : startDateNew.getTime());
|
|
14175
|
+
var endChanged = (endDate === null || endDate === void 0 ? void 0 : endDate.getTime()) !== (endDateNew === null || endDateNew === void 0 ? void 0 : endDateNew.getTime());
|
|
14474
14176
|
if (!startChanged && !endChanged) {
|
|
14475
14177
|
return;
|
|
14476
14178
|
}
|
|
@@ -14480,31 +14182,15 @@ var DatePicker = /** @class */ (function (_super) {
|
|
|
14480
14182
|
if (endDateNew && isDayDisabled(endDateNew, _this.props)) {
|
|
14481
14183
|
return;
|
|
14482
14184
|
}
|
|
14483
|
-
|
|
14484
|
-
// Use startDate for preSelection to match calcInitialState behavior
|
|
14485
|
-
if (startDateNew) {
|
|
14486
|
-
_this.setState({ preSelection: startDateNew });
|
|
14487
|
-
}
|
|
14488
|
-
(_f = (_e = _this.props).onChange) === null || _f === void 0 ? void 0 : _f.call(_e, [startDateNew, endDateNew], event);
|
|
14185
|
+
(_d = (_c = _this.props).onChange) === null || _d === void 0 ? void 0 : _d.call(_c, [startDateNew, endDateNew], event);
|
|
14489
14186
|
}
|
|
14490
14187
|
else {
|
|
14491
14188
|
// not selectsRange
|
|
14492
|
-
var date = parseDate(value, dateFormat, _this.props.locale, strictParsing, (
|
|
14189
|
+
var date = parseDate(value, dateFormat, _this.props.locale, strictParsing, (_e = _this.props.selected) !== null && _e !== void 0 ? _e : undefined);
|
|
14493
14190
|
// Update selection if either (1) date was successfully parsed, or (2) input field is empty
|
|
14494
14191
|
if (date || !value) {
|
|
14495
14192
|
_this.setSelected(date, event, true);
|
|
14496
14193
|
}
|
|
14497
|
-
else if (!_this.props.inline) {
|
|
14498
|
-
// If full date parsing failed but we have partial input,
|
|
14499
|
-
// try to extract date info for calendar navigation
|
|
14500
|
-
var navDate = parseDateForNavigation(value, (_h = _this.state.preSelection) !== null && _h !== void 0 ? _h : undefined);
|
|
14501
|
-
// Only update preSelection if navDate is valid and within min/max bounds
|
|
14502
|
-
if (navDate &&
|
|
14503
|
-
(!_this.props.minDate || !isBefore(navDate, _this.props.minDate)) &&
|
|
14504
|
-
(!_this.props.maxDate || !isAfter(navDate, _this.props.maxDate))) {
|
|
14505
|
-
_this.setState({ preSelection: navDate });
|
|
14506
|
-
}
|
|
14507
|
-
}
|
|
14508
14194
|
}
|
|
14509
14195
|
};
|
|
14510
14196
|
_this.handleSelect = function (date, event, monthSelectedIn) {
|
|
@@ -14543,13 +14229,7 @@ var DatePicker = /** @class */ (function (_super) {
|
|
|
14543
14229
|
// setSelected is called either from handleChange (user typed date into textbox and it was parsed) or handleSelect (user selected date from calendar using mouse or keyboard)
|
|
14544
14230
|
_this.setSelected = function (date, event, keepInput, monthSelectedIn) {
|
|
14545
14231
|
var _a, _b;
|
|
14546
|
-
var timeZone = _this.props.timeZone;
|
|
14547
|
-
// If timezone is specified, convert the selected date from zoned time to UTC
|
|
14548
|
-
// This ensures the onChange callback receives a proper UTC Date object
|
|
14549
14232
|
var changedDate = date;
|
|
14550
|
-
if (changedDate && timeZone) {
|
|
14551
|
-
changedDate = fromZonedTime(changedDate, timeZone);
|
|
14552
|
-
}
|
|
14553
14233
|
// Early return if selected year/month/day is disabled
|
|
14554
14234
|
if (_this.props.showYearPicker) {
|
|
14555
14235
|
if (changedDate !== null &&
|
|
@@ -14606,56 +14286,54 @@ var DatePicker = /** @class */ (function (_super) {
|
|
|
14606
14286
|
}
|
|
14607
14287
|
}
|
|
14608
14288
|
if (selectsRange) {
|
|
14609
|
-
var onChangeRange = onChange;
|
|
14610
14289
|
var noRanges = !startDate && !endDate;
|
|
14611
14290
|
var hasStartRange = startDate && !endDate;
|
|
14612
14291
|
var hasOnlyEndRange = !startDate && !!endDate;
|
|
14613
14292
|
var isRangeFilled = startDate && endDate;
|
|
14614
14293
|
if (noRanges) {
|
|
14615
|
-
|
|
14294
|
+
onChange === null || onChange === void 0 ? void 0 : onChange([changedDate, null], event);
|
|
14616
14295
|
}
|
|
14617
14296
|
else if (hasStartRange) {
|
|
14618
14297
|
if (changedDate === null) {
|
|
14619
|
-
|
|
14298
|
+
onChange === null || onChange === void 0 ? void 0 : onChange([null, null], event);
|
|
14620
14299
|
}
|
|
14621
14300
|
else if (isDateBefore(changedDate, startDate)) {
|
|
14622
14301
|
if (swapRange) {
|
|
14623
|
-
|
|
14302
|
+
onChange === null || onChange === void 0 ? void 0 : onChange([changedDate, startDate], event);
|
|
14624
14303
|
}
|
|
14625
14304
|
else {
|
|
14626
|
-
|
|
14305
|
+
onChange === null || onChange === void 0 ? void 0 : onChange([changedDate, null], event);
|
|
14627
14306
|
}
|
|
14628
14307
|
}
|
|
14629
14308
|
else {
|
|
14630
|
-
|
|
14309
|
+
onChange === null || onChange === void 0 ? void 0 : onChange([startDate, changedDate], event);
|
|
14631
14310
|
}
|
|
14632
14311
|
}
|
|
14633
14312
|
else if (hasOnlyEndRange) {
|
|
14634
14313
|
if (changedDate && isDateBefore(changedDate, endDate)) {
|
|
14635
|
-
|
|
14314
|
+
onChange === null || onChange === void 0 ? void 0 : onChange([changedDate, endDate], event);
|
|
14636
14315
|
}
|
|
14637
14316
|
else {
|
|
14638
|
-
|
|
14317
|
+
onChange === null || onChange === void 0 ? void 0 : onChange([changedDate, null], event);
|
|
14639
14318
|
}
|
|
14640
14319
|
}
|
|
14641
14320
|
if (isRangeFilled) {
|
|
14642
|
-
|
|
14321
|
+
onChange === null || onChange === void 0 ? void 0 : onChange([changedDate, null], event);
|
|
14643
14322
|
}
|
|
14644
14323
|
}
|
|
14645
14324
|
else if (selectsMultiple) {
|
|
14646
|
-
var onChangeMultiple = onChange;
|
|
14647
14325
|
if (changedDate !== null) {
|
|
14648
14326
|
if (!(selectedDates === null || selectedDates === void 0 ? void 0 : selectedDates.length)) {
|
|
14649
|
-
|
|
14327
|
+
onChange === null || onChange === void 0 ? void 0 : onChange([changedDate], event);
|
|
14650
14328
|
}
|
|
14651
14329
|
else {
|
|
14652
14330
|
var isChangedDateAlreadySelected = selectedDates.some(function (selectedDate) { return isSameDay(selectedDate, changedDate); });
|
|
14653
14331
|
if (isChangedDateAlreadySelected) {
|
|
14654
14332
|
var nextDates = selectedDates.filter(function (selectedDate) { return !isSameDay(selectedDate, changedDate); });
|
|
14655
|
-
|
|
14333
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(nextDates, event);
|
|
14656
14334
|
}
|
|
14657
14335
|
else {
|
|
14658
|
-
|
|
14336
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(__spreadArray(__spreadArray([], selectedDates, true), [changedDate], false), event);
|
|
14659
14337
|
}
|
|
14660
14338
|
}
|
|
14661
14339
|
}
|
|
@@ -14704,135 +14382,24 @@ var DatePicker = /** @class */ (function (_super) {
|
|
|
14704
14382
|
_this.toggleCalendar = function () {
|
|
14705
14383
|
_this.setOpen(!_this.state.open);
|
|
14706
14384
|
};
|
|
14707
|
-
_this.handleTimeChange = function (time
|
|
14385
|
+
_this.handleTimeChange = function (time) {
|
|
14708
14386
|
var _a, _b;
|
|
14709
|
-
if (_this.props.selectsMultiple) {
|
|
14387
|
+
if (_this.props.selectsRange || _this.props.selectsMultiple) {
|
|
14710
14388
|
return;
|
|
14711
14389
|
}
|
|
14712
|
-
var
|
|
14713
|
-
|
|
14714
|
-
|
|
14715
|
-
|
|
14716
|
-
|
|
14717
|
-
|
|
14718
|
-
|
|
14719
|
-
|
|
14720
|
-
if (modifyDateType === "start") {
|
|
14721
|
-
// Explicitly modify start date
|
|
14722
|
-
if (startDate) {
|
|
14723
|
-
var changedStartDate = setTime(startDate, {
|
|
14724
|
-
hour: getHours(time),
|
|
14725
|
-
minute: getMinutes(time),
|
|
14726
|
-
});
|
|
14727
|
-
_this.setState({
|
|
14728
|
-
preSelection: changedStartDate,
|
|
14729
|
-
});
|
|
14730
|
-
// Convert from zoned time to UTC if timezone is specified
|
|
14731
|
-
if (timeZone) {
|
|
14732
|
-
changedStartDate = fromZonedTime(changedStartDate, timeZone);
|
|
14733
|
-
}
|
|
14734
|
-
onChangeRange === null || onChangeRange === void 0 ? void 0 : onChangeRange([
|
|
14735
|
-
changedStartDate,
|
|
14736
|
-
endDate
|
|
14737
|
-
? timeZone
|
|
14738
|
-
? fromZonedTime(endDate, timeZone)
|
|
14739
|
-
: endDate
|
|
14740
|
-
: null,
|
|
14741
|
-
], undefined);
|
|
14742
|
-
}
|
|
14743
|
-
}
|
|
14744
|
-
else if (modifyDateType === "end") {
|
|
14745
|
-
// Explicitly modify end date
|
|
14746
|
-
if (endDate) {
|
|
14747
|
-
var changedEndDate = setTime(endDate, {
|
|
14748
|
-
hour: getHours(time),
|
|
14749
|
-
minute: getMinutes(time),
|
|
14750
|
-
});
|
|
14751
|
-
_this.setState({
|
|
14752
|
-
preSelection: changedEndDate,
|
|
14753
|
-
});
|
|
14754
|
-
// Convert from zoned time to UTC if timezone is specified
|
|
14755
|
-
if (timeZone) {
|
|
14756
|
-
changedEndDate = fromZonedTime(changedEndDate, timeZone);
|
|
14757
|
-
}
|
|
14758
|
-
onChangeRange === null || onChangeRange === void 0 ? void 0 : onChangeRange([
|
|
14759
|
-
startDate
|
|
14760
|
-
? timeZone
|
|
14761
|
-
? fromZonedTime(startDate, timeZone)
|
|
14762
|
-
: startDate
|
|
14763
|
-
: null,
|
|
14764
|
-
changedEndDate,
|
|
14765
|
-
], undefined);
|
|
14766
|
-
}
|
|
14767
|
-
}
|
|
14768
|
-
else {
|
|
14769
|
-
// Legacy behavior for showTimeSelect (single time picker)
|
|
14770
|
-
var hasStartRange = startDate && !endDate;
|
|
14771
|
-
if (hasStartRange) {
|
|
14772
|
-
// Apply time to startDate
|
|
14773
|
-
var changedStartDate = setTime(startDate, {
|
|
14774
|
-
hour: getHours(time),
|
|
14775
|
-
minute: getMinutes(time),
|
|
14776
|
-
});
|
|
14777
|
-
_this.setState({
|
|
14778
|
-
preSelection: changedStartDate,
|
|
14779
|
-
});
|
|
14780
|
-
// Convert from zoned time to UTC if timezone is specified
|
|
14781
|
-
if (timeZone) {
|
|
14782
|
-
changedStartDate = fromZonedTime(changedStartDate, timeZone);
|
|
14783
|
-
}
|
|
14784
|
-
onChangeRange === null || onChangeRange === void 0 ? void 0 : onChangeRange([changedStartDate, null], undefined);
|
|
14785
|
-
}
|
|
14786
|
-
else if (startDate && endDate) {
|
|
14787
|
-
// Apply time to endDate
|
|
14788
|
-
var changedEndDate = setTime(endDate, {
|
|
14789
|
-
hour: getHours(time),
|
|
14790
|
-
minute: getMinutes(time),
|
|
14791
|
-
});
|
|
14792
|
-
_this.setState({
|
|
14793
|
-
preSelection: changedEndDate,
|
|
14794
|
-
});
|
|
14795
|
-
// Convert from zoned time to UTC if timezone is specified
|
|
14796
|
-
if (timeZone) {
|
|
14797
|
-
changedEndDate = fromZonedTime(changedEndDate, timeZone);
|
|
14798
|
-
}
|
|
14799
|
-
onChangeRange === null || onChangeRange === void 0 ? void 0 : onChangeRange([
|
|
14800
|
-
timeZone ? fromZonedTime(startDate, timeZone) : startDate,
|
|
14801
|
-
changedEndDate,
|
|
14802
|
-
], undefined);
|
|
14803
|
-
}
|
|
14804
|
-
else {
|
|
14805
|
-
// No dates selected yet, just update preSelection
|
|
14806
|
-
var changedDate = setTime(_this.getPreSelection(), {
|
|
14807
|
-
hour: getHours(time),
|
|
14808
|
-
minute: getMinutes(time),
|
|
14809
|
-
});
|
|
14810
|
-
_this.setState({
|
|
14811
|
-
preSelection: changedDate,
|
|
14812
|
-
});
|
|
14813
|
-
}
|
|
14814
|
-
}
|
|
14815
|
-
}
|
|
14816
|
-
else {
|
|
14817
|
-
// Single date mode (original behavior)
|
|
14818
|
-
var selected = _this.props.selected
|
|
14819
|
-
? _this.props.selected
|
|
14820
|
-
: _this.getPreSelection();
|
|
14821
|
-
var changedDate = _this.props.selected
|
|
14822
|
-
? time
|
|
14823
|
-
: setTime(selected, {
|
|
14824
|
-
hour: getHours(time),
|
|
14825
|
-
minute: getMinutes(time),
|
|
14826
|
-
});
|
|
14827
|
-
_this.setState({
|
|
14828
|
-
preSelection: changedDate,
|
|
14390
|
+
var selected = _this.props.selected
|
|
14391
|
+
? _this.props.selected
|
|
14392
|
+
: _this.getPreSelection();
|
|
14393
|
+
var changedDate = _this.props.selected
|
|
14394
|
+
? time
|
|
14395
|
+
: setTime(selected, {
|
|
14396
|
+
hour: getHours(time),
|
|
14397
|
+
minute: getMinutes(time),
|
|
14829
14398
|
});
|
|
14830
|
-
|
|
14831
|
-
|
|
14832
|
-
|
|
14833
|
-
|
|
14834
|
-
(_b = (_a = _this.props).onChange) === null || _b === void 0 ? void 0 : _b.call(_a, changedDate);
|
|
14835
|
-
}
|
|
14399
|
+
_this.setState({
|
|
14400
|
+
preSelection: changedDate,
|
|
14401
|
+
});
|
|
14402
|
+
(_b = (_a = _this.props).onChange) === null || _b === void 0 ? void 0 : _b.call(_a, changedDate);
|
|
14836
14403
|
if (_this.props.shouldCloseOnSelect && !_this.props.showTimeInput) {
|
|
14837
14404
|
_this.sendFocusBackToInput();
|
|
14838
14405
|
_this.setOpen(false);
|
|
@@ -14852,117 +14419,6 @@ var DatePicker = /** @class */ (function (_super) {
|
|
|
14852
14419
|
}
|
|
14853
14420
|
(_b = (_a = _this.props).onInputClick) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
14854
14421
|
};
|
|
14855
|
-
_this.handleTimeOnlyArrowKey = function (eventKey) {
|
|
14856
|
-
var _a, _b, _c, _d;
|
|
14857
|
-
var currentTime = safeToDate(_this.props.selected) || _this.state.preSelection || newDate();
|
|
14858
|
-
var timeIntervals = (_a = _this.props.timeIntervals) !== null && _a !== void 0 ? _a : 30;
|
|
14859
|
-
var dateFormat = (_b = _this.props.dateFormat) !== null && _b !== void 0 ? _b : DatePicker.defaultProps.dateFormat;
|
|
14860
|
-
var formatStr = Array.isArray(dateFormat) ? dateFormat[0] : dateFormat;
|
|
14861
|
-
var baseDate = getStartOfDay(currentTime);
|
|
14862
|
-
var currentMinutes = getHours(currentTime) * 60 + getMinutes(currentTime);
|
|
14863
|
-
var maxMinutes = 23 * 60 + 60 - timeIntervals; // Cap at last valid interval of the day
|
|
14864
|
-
var newTime;
|
|
14865
|
-
if (eventKey === KeyType.ArrowUp) {
|
|
14866
|
-
var newMinutes = Math.max(0, currentMinutes - timeIntervals);
|
|
14867
|
-
newTime = addMinutes(baseDate, newMinutes);
|
|
14868
|
-
}
|
|
14869
|
-
else {
|
|
14870
|
-
var newMinutes = Math.min(maxMinutes, currentMinutes + timeIntervals);
|
|
14871
|
-
newTime = addMinutes(baseDate, newMinutes);
|
|
14872
|
-
}
|
|
14873
|
-
var formattedTime = formatDate(newTime, formatStr || DatePicker.defaultProps.dateFormat, _this.props.locale);
|
|
14874
|
-
_this.setState({
|
|
14875
|
-
preSelection: newTime,
|
|
14876
|
-
inputValue: formattedTime,
|
|
14877
|
-
});
|
|
14878
|
-
if (_this.props.selectsRange || _this.props.selectsMultiple) {
|
|
14879
|
-
return;
|
|
14880
|
-
}
|
|
14881
|
-
var selected = _this.props.selected
|
|
14882
|
-
? _this.props.selected
|
|
14883
|
-
: _this.getPreSelection();
|
|
14884
|
-
var changedDate = _this.props.selected
|
|
14885
|
-
? newTime
|
|
14886
|
-
: setTime(selected, {
|
|
14887
|
-
hour: getHours(newTime),
|
|
14888
|
-
minute: getMinutes(newTime),
|
|
14889
|
-
});
|
|
14890
|
-
(_d = (_c = _this.props).onChange) === null || _d === void 0 ? void 0 : _d.call(_c, changedDate);
|
|
14891
|
-
if (_this.props.showTimeSelectOnly || _this.props.showTimeSelect) {
|
|
14892
|
-
_this.setState({ isRenderAriaLiveMessage: true });
|
|
14893
|
-
}
|
|
14894
|
-
requestAnimationFrame(function () {
|
|
14895
|
-
_this.scrollToTimeOption(newTime);
|
|
14896
|
-
});
|
|
14897
|
-
};
|
|
14898
|
-
_this.handleTimeOnlyEnterKey = function (event) {
|
|
14899
|
-
var _a, _b, _c, _d;
|
|
14900
|
-
var inputElement = event.target;
|
|
14901
|
-
var inputValue = inputElement.value;
|
|
14902
|
-
var dateFormat = (_a = _this.props.dateFormat) !== null && _a !== void 0 ? _a : DatePicker.defaultProps.dateFormat;
|
|
14903
|
-
var timeFormat = _this.props.timeFormat || "p";
|
|
14904
|
-
var defaultTime = _this.state.preSelection || safeToDate(_this.props.selected) || newDate();
|
|
14905
|
-
var parsedDate = parseDate(inputValue, dateFormat, _this.props.locale, (_b = _this.props.strictParsing) !== null && _b !== void 0 ? _b : false, defaultTime);
|
|
14906
|
-
var timeToCommit = defaultTime;
|
|
14907
|
-
if (parsedDate && isValid(parsedDate)) {
|
|
14908
|
-
timeToCommit = parsedDate;
|
|
14909
|
-
}
|
|
14910
|
-
else {
|
|
14911
|
-
var highlightedItem = ((_c = _this.calendar) === null || _c === void 0 ? void 0 : _c.containerRef.current) instanceof Element &&
|
|
14912
|
-
_this.calendar.containerRef.current.querySelector(".react-datepicker__time-list-item[tabindex='0']");
|
|
14913
|
-
if (highlightedItem instanceof HTMLElement) {
|
|
14914
|
-
var itemText = (_d = highlightedItem.textContent) === null || _d === void 0 ? void 0 : _d.trim();
|
|
14915
|
-
if (itemText) {
|
|
14916
|
-
var itemTime = parseDate(itemText, timeFormat, _this.props.locale, false, defaultTime);
|
|
14917
|
-
if (itemTime && isValid(itemTime)) {
|
|
14918
|
-
timeToCommit = itemTime;
|
|
14919
|
-
}
|
|
14920
|
-
}
|
|
14921
|
-
}
|
|
14922
|
-
}
|
|
14923
|
-
_this.handleTimeChange(timeToCommit);
|
|
14924
|
-
_this.setOpen(false);
|
|
14925
|
-
_this.sendFocusBackToInput();
|
|
14926
|
-
};
|
|
14927
|
-
_this.scrollToTimeOption = function (time) {
|
|
14928
|
-
var _a, _b;
|
|
14929
|
-
if (!((_a = _this.calendar) === null || _a === void 0 ? void 0 : _a.containerRef.current)) {
|
|
14930
|
-
return;
|
|
14931
|
-
}
|
|
14932
|
-
var container = _this.calendar.containerRef.current;
|
|
14933
|
-
var timeListItems = Array.from(container.querySelectorAll(".react-datepicker__time-list-item"));
|
|
14934
|
-
var targetItem = null;
|
|
14935
|
-
var closestTimeDiff = Infinity;
|
|
14936
|
-
var timeFormat = _this.props.timeFormat || "p";
|
|
14937
|
-
for (var _i = 0, timeListItems_1 = timeListItems; _i < timeListItems_1.length; _i++) {
|
|
14938
|
-
var item = timeListItems_1[_i];
|
|
14939
|
-
var itemText = (_b = item.textContent) === null || _b === void 0 ? void 0 : _b.trim();
|
|
14940
|
-
if (itemText) {
|
|
14941
|
-
var itemTime = parseDate(itemText, timeFormat, _this.props.locale, false, time);
|
|
14942
|
-
if (itemTime && isValid(itemTime)) {
|
|
14943
|
-
if (isSameMinute(itemTime, time)) {
|
|
14944
|
-
targetItem = item;
|
|
14945
|
-
break;
|
|
14946
|
-
}
|
|
14947
|
-
var timeDiff = Math.abs(itemTime.getTime() - time.getTime());
|
|
14948
|
-
if (timeDiff < closestTimeDiff) {
|
|
14949
|
-
closestTimeDiff = timeDiff;
|
|
14950
|
-
targetItem = item;
|
|
14951
|
-
}
|
|
14952
|
-
}
|
|
14953
|
-
}
|
|
14954
|
-
}
|
|
14955
|
-
if (targetItem) {
|
|
14956
|
-
timeListItems.forEach(function (item) {
|
|
14957
|
-
item.setAttribute("tabindex", "-1");
|
|
14958
|
-
});
|
|
14959
|
-
targetItem.setAttribute("tabindex", "0");
|
|
14960
|
-
targetItem.scrollIntoView({
|
|
14961
|
-
behavior: "smooth",
|
|
14962
|
-
block: "center",
|
|
14963
|
-
});
|
|
14964
|
-
}
|
|
14965
|
-
};
|
|
14966
14422
|
_this.onInputKeyDown = function (event) {
|
|
14967
14423
|
var _a, _b, _c, _d, _e, _f;
|
|
14968
14424
|
(_b = (_a = _this.props).onKeyDown) === null || _b === void 0 ? void 0 : _b.call(_a, event);
|
|
@@ -14977,18 +14433,6 @@ var DatePicker = /** @class */ (function (_super) {
|
|
|
14977
14433
|
}
|
|
14978
14434
|
return;
|
|
14979
14435
|
}
|
|
14980
|
-
if (_this.state.open && _this.props.showTimeSelectOnly) {
|
|
14981
|
-
if (eventKey === KeyType.ArrowDown || eventKey === KeyType.ArrowUp) {
|
|
14982
|
-
event.preventDefault();
|
|
14983
|
-
_this.handleTimeOnlyArrowKey(eventKey);
|
|
14984
|
-
return;
|
|
14985
|
-
}
|
|
14986
|
-
if (eventKey === KeyType.Enter) {
|
|
14987
|
-
event.preventDefault();
|
|
14988
|
-
_this.handleTimeOnlyEnterKey(event);
|
|
14989
|
-
return;
|
|
14990
|
-
}
|
|
14991
|
-
}
|
|
14992
14436
|
// if calendar is open, these keys will focus the selected item
|
|
14993
14437
|
if (_this.state.open) {
|
|
14994
14438
|
if (eventKey === KeyType.ArrowDown || eventKey === KeyType.ArrowUp) {
|
|
@@ -15179,12 +14623,20 @@ var DatePicker = /** @class */ (function (_super) {
|
|
|
15179
14623
|
_this.setSelected(newSelection);
|
|
15180
14624
|
}
|
|
15181
14625
|
_this.setPreSelection(newSelection);
|
|
15182
|
-
//
|
|
15183
|
-
// This ensures focus is properly transferred to the new day element regardless of
|
|
15184
|
-
// whether the month changed. The user initiated this navigation from a focused day,
|
|
15185
|
-
// so we should always focus the destination day.
|
|
14626
|
+
// need to figure out whether month has changed to focus day in inline version
|
|
15186
14627
|
if (inline) {
|
|
15187
|
-
|
|
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
|
+
}
|
|
15188
14640
|
}
|
|
15189
14641
|
};
|
|
15190
14642
|
// handle generic key down events in the popper that do not adjust or select dates
|
|
@@ -15231,9 +14683,6 @@ var DatePicker = /** @class */ (function (_super) {
|
|
|
15231
14683
|
}
|
|
15232
14684
|
}
|
|
15233
14685
|
};
|
|
15234
|
-
_this.handleMonthSelectedInChange = function (monthSelectedIn) {
|
|
15235
|
-
_this.setState({ monthSelectedIn: monthSelectedIn });
|
|
15236
|
-
};
|
|
15237
14686
|
_this.renderCalendar = function () {
|
|
15238
14687
|
var _a, _b;
|
|
15239
14688
|
if (!_this.props.inline && !_this.isCalendarOpen()) {
|
|
@@ -15241,7 +14690,7 @@ var DatePicker = /** @class */ (function (_super) {
|
|
|
15241
14690
|
}
|
|
15242
14691
|
return (React__default.createElement(Calendar, _assign({ showMonthYearDropdown: undefined, ref: function (elem) {
|
|
15243
14692
|
_this.calendar = elem;
|
|
15244
|
-
} }, _this.props, _this.state, { setOpen: _this.setOpen, dateFormat: (_a = _this.props.dateFormatCalendar) !== null && _a !== void 0 ? _a : DatePicker.defaultProps.dateFormatCalendar, onSelect: _this.handleSelect, onClickOutside: _this.handleCalendarClickOutside, holidays: getHolidaysMap(_this.modifyHolidays()), outsideClickIgnoreClass: _this.props.outsideClickIgnoreClass, onDropdownFocus: _this.handleDropdownFocus, onTimeChange: _this.handleTimeChange, className: _this.props.calendarClassName, container: _this.props.calendarContainer, handleOnKeyDown: _this.props.onKeyDown, handleOnDayKeyDown: _this.onDayKeyDown, setPreSelection: _this.setPreSelection, dropdownMode: (_b = _this.props.dropdownMode) !== null && _b !== void 0 ? _b : DatePicker.defaultProps.dropdownMode
|
|
14693
|
+
} }, _this.props, _this.state, { setOpen: _this.setOpen, dateFormat: (_a = _this.props.dateFormatCalendar) !== null && _a !== void 0 ? _a : DatePicker.defaultProps.dateFormatCalendar, onSelect: _this.handleSelect, onClickOutside: _this.handleCalendarClickOutside, holidays: getHolidaysMap(_this.modifyHolidays()), outsideClickIgnoreClass: _this.props.outsideClickIgnoreClass, onDropdownFocus: _this.handleDropdownFocus, onTimeChange: _this.handleTimeChange, className: _this.props.calendarClassName, container: _this.props.calendarContainer, handleOnKeyDown: _this.props.onKeyDown, handleOnDayKeyDown: _this.onDayKeyDown, setPreSelection: _this.setPreSelection, dropdownMode: (_b = _this.props.dropdownMode) !== null && _b !== void 0 ? _b : DatePicker.defaultProps.dropdownMode }), _this.props.children));
|
|
15245
14694
|
};
|
|
15246
14695
|
_this.renderAriaLiveRegion = function () {
|
|
15247
14696
|
var _a;
|
|
@@ -15289,34 +14738,39 @@ var DatePicker = /** @class */ (function (_super) {
|
|
|
15289
14738
|
};
|
|
15290
14739
|
_this.renderDateInput = function () {
|
|
15291
14740
|
var _a, _b;
|
|
15292
|
-
var _c, _d, _e, _f, _g;
|
|
15293
14741
|
var className = clsx(_this.props.className, (_a = {},
|
|
15294
14742
|
_a[_this.props.outsideClickIgnoreClass ||
|
|
15295
14743
|
DatePicker.defaultProps.outsideClickIgnoreClass] = _this.state.open,
|
|
15296
14744
|
_a));
|
|
15297
14745
|
var customInput = _this.props.customInput || React__default.createElement("input", { type: "text" });
|
|
15298
14746
|
var customInputRef = _this.props.customInputRef || "ref";
|
|
15299
|
-
|
|
15300
|
-
|
|
15301
|
-
|
|
15302
|
-
|
|
15303
|
-
|
|
15304
|
-
|
|
15305
|
-
|
|
15306
|
-
|
|
15307
|
-
|
|
15308
|
-
|
|
15309
|
-
|
|
15310
|
-
|
|
15311
|
-
|
|
15312
|
-
|
|
15313
|
-
|
|
15314
|
-
|
|
15315
|
-
|
|
15316
|
-
|
|
15317
|
-
|
|
15318
|
-
|
|
15319
|
-
|
|
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));
|
|
15320
14774
|
};
|
|
15321
14775
|
_this.renderClearButton = function () {
|
|
15322
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;
|
|
@@ -15396,30 +14850,14 @@ var DatePicker = /** @class */ (function (_super) {
|
|
|
15396
14850
|
};
|
|
15397
14851
|
DatePicker.prototype.componentDidUpdate = function (prevProps, prevState) {
|
|
15398
14852
|
var _a, _b, _c, _d;
|
|
15399
|
-
|
|
15400
|
-
|
|
15401
|
-
// (e.g., via "Today" or "This Week" buttons). (Fix for #3367)
|
|
15402
|
-
if (this.props.selectsRange &&
|
|
15403
|
-
hasPreSelectionChanged(prevProps.startDate, this.props.startDate)) {
|
|
15404
|
-
this.setPreSelection(this.props.startDate);
|
|
15405
|
-
}
|
|
15406
|
-
else if (hasPreSelectionChanged(prevProps.selected, this.props.selected)) {
|
|
14853
|
+
if (prevProps.inline &&
|
|
14854
|
+
hasPreSelectionChanged(prevProps.selected, this.props.selected)) {
|
|
15407
14855
|
this.setPreSelection(this.props.selected);
|
|
15408
14856
|
}
|
|
15409
14857
|
if (this.state.monthSelectedIn !== undefined &&
|
|
15410
14858
|
prevProps.monthsShown !== this.props.monthsShown) {
|
|
15411
14859
|
this.setState({ monthSelectedIn: 0 });
|
|
15412
14860
|
}
|
|
15413
|
-
// Reset monthSelectedIn when calendar opens for range selection
|
|
15414
|
-
// This ensures startDate is displayed as the first month when reopening
|
|
15415
|
-
// (Fix for #5939), but we don't reset during active selection to avoid
|
|
15416
|
-
// the view jumping when clicking dates in the second calendar (Fix for #5275)
|
|
15417
|
-
if (this.props.selectsRange &&
|
|
15418
|
-
prevState.open === false &&
|
|
15419
|
-
this.state.open === true &&
|
|
15420
|
-
this.state.monthSelectedIn !== 0) {
|
|
15421
|
-
this.setState({ monthSelectedIn: 0 });
|
|
15422
|
-
}
|
|
15423
14861
|
if (prevProps.highlightDates !== this.props.highlightDates) {
|
|
15424
14862
|
this.setState({
|
|
15425
14863
|
highlightDates: getHighLightDaysMap(this.props.highlightDates),
|
|
@@ -15469,11 +14907,11 @@ var DatePicker = /** @class */ (function (_super) {
|
|
|
15469
14907
|
if (this.state.open && this.props.portalId) {
|
|
15470
14908
|
portalContainer = (React__default.createElement(Portal, _assign({ portalId: this.props.portalId }, this.props), portalContainer));
|
|
15471
14909
|
}
|
|
15472
|
-
return (React__default.createElement(
|
|
14910
|
+
return (React__default.createElement("div", null,
|
|
15473
14911
|
this.renderInputContainer(),
|
|
15474
14912
|
portalContainer));
|
|
15475
14913
|
}
|
|
15476
|
-
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 })));
|
|
15477
14915
|
};
|
|
15478
14916
|
return DatePicker;
|
|
15479
14917
|
}(Component));
|
|
@@ -15878,4 +15316,4 @@ var InlineDatePicker = function (props) {
|
|
|
15878
15316
|
};
|
|
15879
15317
|
|
|
15880
15318
|
export { DatePickerGroup as D, HelperText as H, InlineDatePicker as I, ValidationText as V };
|
|
15881
|
-
//# sourceMappingURL=InlineDatePicker-
|
|
15319
|
+
//# sourceMappingURL=InlineDatePicker-RlV9iC8j.js.map
|