@jobber/components 7.1.2-MIKElock--7916eb4.2 → 7.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (240) hide show
  1. package/dist/AtlantisThemeContext-cjs.js +1 -1
  2. package/dist/AtlantisThemeContext-es.js +9 -9
  3. package/dist/Autocomplete/index.cjs +2 -2
  4. package/dist/Autocomplete/index.mjs +5 -5
  5. package/dist/Body-cjs.js +1 -1
  6. package/dist/Body-es.js +2 -2
  7. package/dist/BottomSheet-cjs.js +1 -1
  8. package/dist/BottomSheet-es.js +1 -1
  9. package/dist/Box-cjs.js +2 -2
  10. package/dist/Box-es.js +2 -2
  11. package/dist/Button/index.mjs +1 -1
  12. package/dist/Button-es.js +1 -1
  13. package/dist/Card-cjs.js +1 -1
  14. package/dist/Card-es.js +1 -1
  15. package/dist/Checkbox/index.cjs +1 -1
  16. package/dist/Checkbox/index.mjs +1 -1
  17. package/dist/Chip/Chip.d.ts +7 -1
  18. package/dist/Chip/Chip.types.d.ts +7 -2
  19. package/dist/Chip/index.cjs +1 -1
  20. package/dist/Chip/index.mjs +2 -2
  21. package/dist/Chip-cjs.js +42 -27
  22. package/dist/Chip-es.js +42 -27
  23. package/dist/ChipDismissible-es.js +1 -1
  24. package/dist/Chips/InternalChipDismissible/hooks/index.mjs +1 -1
  25. package/dist/Combobox/components/ComboboxTrigger/index.cjs +1 -1
  26. package/dist/Combobox/components/ComboboxTrigger/index.mjs +1 -1
  27. package/dist/Combobox-cjs.js +1 -1
  28. package/dist/Combobox-es.js +1 -1
  29. package/dist/ComboboxAction-cjs.js +1 -1
  30. package/dist/ComboboxAction-es.js +1 -1
  31. package/dist/ComboboxContent-cjs.js +1 -1
  32. package/dist/ComboboxContent-es.js +2 -2
  33. package/dist/ComboboxContentHeader-cjs.js +1 -1
  34. package/dist/ComboboxContentHeader-es.js +1 -1
  35. package/dist/ComboboxContentList-es.js +1 -1
  36. package/dist/ComboboxContentSearch-cjs.js +1 -1
  37. package/dist/ComboboxContentSearch-es.js +1 -1
  38. package/dist/ComboboxLoadMore-cjs.js +1 -1
  39. package/dist/ComboboxLoadMore-es.js +1 -1
  40. package/dist/ComboboxOption-cjs.js +1 -1
  41. package/dist/ComboboxOption-es.js +1 -1
  42. package/dist/Container-cjs.js +1 -1
  43. package/dist/Container-es.js +1 -1
  44. package/dist/Content-cjs.js +1 -1
  45. package/dist/Content-es.js +1 -1
  46. package/dist/ContentBlock-cjs.js +1 -1
  47. package/dist/ContentBlock-es.js +1 -1
  48. package/dist/Countdown-cjs.js +3 -7
  49. package/dist/Countdown-es.js +4 -8
  50. package/dist/Cover-cjs.js +1 -1
  51. package/dist/Cover-es.js +1 -1
  52. package/dist/DataList-es.js +3 -3
  53. package/dist/DataList.const-cjs.js +1 -0
  54. package/dist/DataList.const-es.js +2 -1
  55. package/dist/DataList.module-cjs.js +1 -1
  56. package/dist/DataList.module-es.js +1 -1
  57. package/dist/DataList.utils-es.js +6 -6
  58. package/dist/DataListAction-cjs.js +1 -1
  59. package/dist/DataListAction-es.js +1 -1
  60. package/dist/DataListActionsMenu-cjs.js +1 -1
  61. package/dist/DataListActionsMenu-es.js +2 -2
  62. package/dist/DataListBulkActions-cjs.js +1 -1
  63. package/dist/DataListBulkActions-es.js +1 -1
  64. package/dist/DataListEmptyState-cjs.js +1 -1
  65. package/dist/DataListEmptyState-es.js +1 -1
  66. package/dist/DataListHeaderTile-cjs.js +2 -2
  67. package/dist/DataListHeaderTile-es.js +2 -2
  68. package/dist/DataListItemActions-cjs.js +1 -1
  69. package/dist/DataListItemActions-es.js +2 -2
  70. package/dist/DataListLayoutActions-cjs.js +1 -1
  71. package/dist/DataListLayoutActions-es.js +2 -2
  72. package/dist/DataListLoadMore-cjs.js +1 -1
  73. package/dist/DataListLoadMore-es.js +1 -1
  74. package/dist/DataListLoadingState-cjs.js +1 -1
  75. package/dist/DataListLoadingState-es.js +2 -2
  76. package/dist/DataListOverflowFade-cjs.js +1 -1
  77. package/dist/DataListOverflowFade-es.js +1 -1
  78. package/dist/DataListSearch-cjs.js +1 -1
  79. package/dist/DataListSearch-es.js +1 -1
  80. package/dist/DataListSortingOptions-cjs.js +1 -1
  81. package/dist/DataListSortingOptions-es.js +1 -1
  82. package/dist/DataListStickyHeader-cjs.js +1 -1
  83. package/dist/DataListStickyHeader-es.js +1 -1
  84. package/dist/DataListTags-cjs.js +1 -1
  85. package/dist/DataListTags-es.js +1 -1
  86. package/dist/DataListTotalCount-cjs.js +1 -1
  87. package/dist/DataListTotalCount-es.js +2 -2
  88. package/dist/DataTable/index.mjs +1 -1
  89. package/dist/DataTable-cjs.js +3 -3
  90. package/dist/DataTable-es.js +5 -5
  91. package/dist/DataTableTable-cjs.js +2 -2
  92. package/dist/DataTableTable-es.js +3 -3
  93. package/dist/DatePicker-cjs.js +81 -266
  94. package/dist/DatePicker-es.js +83 -268
  95. package/dist/DayOfMonthSelect-cjs.js +5 -5
  96. package/dist/DayOfMonthSelect-es.js +6 -6
  97. package/dist/DescriptionList-cjs.js +1 -1
  98. package/dist/DescriptionList-es.js +1 -1
  99. package/dist/Disclosure-cjs.js +1 -1
  100. package/dist/Disclosure-es.js +1 -1
  101. package/dist/Divider-cjs.js +1 -1
  102. package/dist/Divider-es.js +1 -1
  103. package/dist/DrawerGrid-cjs.js +2 -2
  104. package/dist/DrawerGrid-es.js +2 -2
  105. package/dist/DrawerRoot-cjs.js +48 -10
  106. package/dist/DrawerRoot-es.js +50 -12
  107. package/dist/FeatureSwitch-cjs.js +1 -1
  108. package/dist/FeatureSwitch-es.js +1 -1
  109. package/dist/FormField/index.mjs +1 -1
  110. package/dist/FormField-cjs.js +1 -1
  111. package/dist/FormField-es.js +2 -2
  112. package/dist/FormatEmail-cjs.js +1 -1
  113. package/dist/FormatEmail-es.js +1 -1
  114. package/dist/FormatFile-cjs.js +6 -1
  115. package/dist/FormatFile-es.js +6 -1
  116. package/dist/Frame-cjs.js +1 -1
  117. package/dist/Frame-es.js +1 -1
  118. package/dist/Glimmer/index.mjs +1 -1
  119. package/dist/Glimmer-cjs.js +1 -1
  120. package/dist/Glimmer-es.js +2 -2
  121. package/dist/Grid-cjs.js +1 -1
  122. package/dist/Grid-es.js +1 -1
  123. package/dist/GridCell-cjs.js +1 -1
  124. package/dist/GridCell-es.js +1 -1
  125. package/dist/InputAvatar-cjs.js +1 -1
  126. package/dist/InputAvatar-es.js +1 -1
  127. package/dist/InputDate/index.mjs +1 -1
  128. package/dist/InputEmail/index.mjs +1 -1
  129. package/dist/InputFile-cjs.js +3 -8
  130. package/dist/InputFile-es.js +3 -8
  131. package/dist/InputNumber/index.cjs +59 -165
  132. package/dist/InputNumber/index.mjs +62 -168
  133. package/dist/InputPassword-es.js +1 -1
  134. package/dist/InputPhoneNumber/index.cjs +1 -1
  135. package/dist/InputPhoneNumber/index.mjs +2 -2
  136. package/dist/InputText/InputText.d.ts +70 -2
  137. package/dist/InputText/index.mjs +1 -1
  138. package/dist/InputTime/index.cjs +1 -0
  139. package/dist/InputTime/index.mjs +2 -1
  140. package/dist/InputValidation-cjs.js +1 -1
  141. package/dist/InputValidation-es.js +1 -1
  142. package/dist/InternalChipDismissible-cjs.js +2 -2
  143. package/dist/InternalChipDismissible-es.js +3 -3
  144. package/dist/LightBox-cjs.js +1 -1
  145. package/dist/LightBox-es.js +1 -1
  146. package/dist/Link-cjs.js +1 -1
  147. package/dist/Link-es.js +1 -1
  148. package/dist/List-cjs.js +3 -3
  149. package/dist/List-es.js +7 -7
  150. package/dist/Markdown-cjs.js +392 -466
  151. package/dist/Markdown-es.js +398 -472
  152. package/dist/Menu-cjs.js +577 -739
  153. package/dist/Menu-es.js +573 -735
  154. package/dist/Modal/index.cjs +2 -2
  155. package/dist/Modal/index.mjs +2 -2
  156. package/dist/MultiSelect-cjs.js +2 -2
  157. package/dist/MultiSelect-es.js +2 -2
  158. package/dist/OverlaySeparator-cjs.js +1 -1
  159. package/dist/OverlaySeparator-es.js +1 -1
  160. package/dist/Popover-cjs.js +1 -1
  161. package/dist/Popover-es.js +2 -2
  162. package/dist/ProgressBar-cjs.js +1 -1
  163. package/dist/ProgressBar-es.js +1 -1
  164. package/dist/RadioGroup-cjs.js +1 -1
  165. package/dist/RadioGroup-es.js +1 -1
  166. package/dist/RecurringSelect/components/index.mjs +1 -1
  167. package/dist/RecurringSelect/index.cjs +0 -1
  168. package/dist/RecurringSelect/index.mjs +0 -1
  169. package/dist/RecurringSelect-cjs.js +1 -1
  170. package/dist/RecurringSelect-es.js +2 -2
  171. package/dist/SegmentedControl-cjs.js +1 -1
  172. package/dist/SegmentedControl-es.js +2 -2
  173. package/dist/Select/index.cjs +1 -1
  174. package/dist/Select/index.mjs +2 -2
  175. package/dist/SideDrawer-cjs.js +1 -1
  176. package/dist/SideDrawer-es.js +1 -1
  177. package/dist/Spinner-cjs.js +1 -1
  178. package/dist/Spinner-es.js +1 -1
  179. package/dist/StatusIndicator-cjs.js +1 -1
  180. package/dist/StatusIndicator-es.js +1 -1
  181. package/dist/Switch-cjs.js +1 -1
  182. package/dist/Switch-es.js +1 -1
  183. package/dist/Table/index.mjs +1 -1
  184. package/dist/Tabs/index.mjs +1 -1
  185. package/dist/Tabs-cjs.js +1 -1
  186. package/dist/Tabs-es.js +6 -6
  187. package/dist/Text-cjs2.js +164 -298
  188. package/dist/Text-es2.js +164 -295
  189. package/dist/Thumbnail-cjs.js +1 -1
  190. package/dist/Thumbnail-es.js +2 -2
  191. package/dist/Tiles-cjs.js +1 -1
  192. package/dist/Tiles-es.js +1 -1
  193. package/dist/Tooltip-cjs.js +1 -1
  194. package/dist/Tooltip-es.js +2 -2
  195. package/dist/Typography-cjs.js +3 -3
  196. package/dist/Typography-es.js +3 -3
  197. package/dist/_baseEach-cjs.js +1 -1
  198. package/dist/_baseEach-es.js +7 -7
  199. package/dist/_baseFlatten-es.js +1 -1
  200. package/dist/_getAllKeys-cjs.js +8 -2
  201. package/dist/_getAllKeys-es.js +10 -4
  202. package/dist/_getTag-es.js +1 -1
  203. package/dist/_isIterateeCall-es.js +3 -3
  204. package/dist/_setToString-es.js +2 -2
  205. package/dist/debounce-es.js +4 -4
  206. package/dist/docs/Autocomplete/AutocompleteV1.md +1 -1
  207. package/dist/docs/Autocomplete/AutocompleteV2.md +1 -1
  208. package/dist/docs/Banner/Banner.md +1 -1
  209. package/dist/docs/Chip/Chip.md +4 -2
  210. package/dist/docs/DataList/DataList.md +1 -1
  211. package/dist/docs/FormField/FormField.md +2 -2
  212. package/dist/docs/InputEmail/InputEmail.md +1 -1
  213. package/dist/docs/InputNumber/InputNumber.md +2 -2
  214. package/dist/docs/InputPhoneNumber/InputPhoneNumber.md +1 -1
  215. package/dist/docs/InputText/InputText.md +2 -2
  216. package/dist/docs/Modal/Modal.md +3 -3
  217. package/dist/docs/Select/Select.md +2 -2
  218. package/dist/floating-ui.react-cjs.js +16 -35
  219. package/dist/floating-ui.react-dom-es.js +2 -2
  220. package/dist/floating-ui.react-es.js +18 -37
  221. package/dist/identity-es.js +5 -5
  222. package/dist/index-cjs.js +6 -6
  223. package/dist/index-es.js +6 -6
  224. package/dist/index.esm-es.js +1 -1
  225. package/dist/index.mjs +6 -6
  226. package/dist/isSymbol-es.js +1 -1
  227. package/dist/isTypedArray-cjs.js +4 -4
  228. package/dist/isTypedArray-es.js +6 -6
  229. package/dist/keysIn-cjs.js +2 -2
  230. package/dist/keysIn-es.js +5 -5
  231. package/dist/noop-es.js +4 -4
  232. package/dist/omit-cjs.js +5 -37
  233. package/dist/omit-es.js +14 -46
  234. package/dist/showToast-cjs.js +1 -1
  235. package/dist/showToast-es.js +1 -1
  236. package/dist/styles.css +117 -54
  237. package/dist/unstyledPrimitives/index.mjs +3 -3
  238. package/dist/useScrollToActive-cjs.js +1 -1
  239. package/dist/useScrollToActive-es.js +8 -8
  240. package/package.json +3 -4
@@ -1,9 +1,9 @@
1
- import React__default, { cloneElement, createRef, Component, useRef, useEffect, useCallback, createElement, forwardRef, isValidElement, useState, useId } from 'react';
1
+ import React__default, { cloneElement, Component, createRef, useRef, useCallback, useEffect, createElement, forwardRef, isValidElement, useState, useId } from 'react';
2
2
  import classnames from 'classnames';
3
3
  import { c as clsx } from './clsx-es.js';
4
4
  import { u as useFloating, m as FloatingArrow, b as useFloatingNodeId, a as useFloatingParentNodeId, e as FloatingTree, f as FloatingNode, F as FloatingPortal } from './floating-ui.react-es.js';
5
5
  import ReactDOM__default from 'react-dom';
6
- import { a as autoUpdate, f as flip, o as offset, b as arrow } from './floating-ui.react-dom-es.js';
6
+ import { b as autoUpdate, f as flip, o as offset, a as arrow } from './floating-ui.react-dom-es.js';
7
7
  import { useRefocusOnActivator } from '@jobber/hooks';
8
8
  import { T as Typography } from './Typography-es.js';
9
9
  import { B as Button } from './Button-es.js';
@@ -2456,6 +2456,8 @@ const lightFormatters = {
2456
2456
  };
2457
2457
 
2458
2458
  const dayPeriodEnum = {
2459
+ am: "am",
2460
+ pm: "pm",
2459
2461
  midnight: "midnight",
2460
2462
  noon: "noon",
2461
2463
  morning: "morning",
@@ -6825,7 +6827,7 @@ function isWithinInterval(date, interval, options) {
6825
6827
  * //=> Fri Aug 22 2014 00:00:00
6826
6828
  */
6827
6829
  function subDays(date, amount, options) {
6828
- return addDays(date, -1, options);
6830
+ return addDays(date, -amount, options);
6829
6831
  }
6830
6832
 
6831
6833
  /**
@@ -7376,7 +7378,7 @@ function subMonths(date, amount, options) {
7376
7378
  * //=> Sun Dec 01 2013 00:00:00
7377
7379
  */
7378
7380
  function subQuarters(date, amount, options) {
7379
- return addQuarters(date, -1, options);
7381
+ return addQuarters(date, -amount, options);
7380
7382
  }
7381
7383
 
7382
7384
  /**
@@ -7406,7 +7408,7 @@ function subQuarters(date, amount, options) {
7406
7408
  * //=> Mon Aug 04 2014 00:00:00
7407
7409
  */
7408
7410
  function subWeeks(date, amount, options) {
7409
- return addWeeks(date, -1, options);
7411
+ return addWeeks(date, -amount, options);
7410
7412
  }
7411
7413
 
7412
7414
  /**
@@ -7440,7 +7442,7 @@ function subYears(date, amount, options) {
7440
7442
  }
7441
7443
 
7442
7444
  /*!
7443
- react-datepicker v8.10.0
7445
+ react-datepicker v8.7.0
7444
7446
  https://github.com/Hacker0x01/react-datepicker
7445
7447
  Released under the MIT License.
7446
7448
  */
@@ -7504,19 +7506,17 @@ typeof SuppressedError === "function" ? SuppressedError : function (error, suppr
7504
7506
  };
7505
7507
 
7506
7508
  var CalendarContainer = function (_a) {
7507
- 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;
7509
+ 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;
7508
7510
  var ariaLabel = showTimeSelectOnly
7509
7511
  ? "Choose Time"
7510
7512
  : "Choose Date".concat(showTime ? " and Time" : "");
7511
- return (React__default.createElement("div", { className: className, "aria-label": ariaLabel, role: inline ? undefined : "dialog", "aria-modal": inline ? undefined : "true" }, children));
7513
+ return (React__default.createElement("div", { className: className, role: "dialog", "aria-label": ariaLabel, "aria-modal": "true" }, children));
7512
7514
  };
7513
7515
 
7514
7516
  var useDetectClickOutside = function (onClickOutside, ignoreClass) {
7515
7517
  var ref = useRef(null);
7516
7518
  var onClickOutsideRef = useRef(onClickOutside);
7517
- useEffect(function () {
7518
- onClickOutsideRef.current = onClickOutside;
7519
- }, [onClickOutside]);
7519
+ onClickOutsideRef.current = onClickOutside;
7520
7520
  var handleClickOutside = useCallback(function (event) {
7521
7521
  var _a;
7522
7522
  var target = (event.composed &&
@@ -7602,7 +7602,10 @@ function parseDate(value, dateFormat, locale, strictParsing, refDate) {
7602
7602
  for (var _i = 0, formats_1 = formats; _i < formats_1.length; _i++) {
7603
7603
  var format_1 = formats_1[_i];
7604
7604
  var parsedDate = parse(value, format_1, refDate, {
7605
- locale: localeObject});
7605
+ locale: localeObject,
7606
+ useAdditionalWeekYearTokens: true,
7607
+ useAdditionalDayOfYearTokens: true,
7608
+ });
7606
7609
  if (isValid(parsedDate) &&
7607
7610
  (!strictParsing || value === formatDate(parsedDate, format_1, locale))) {
7608
7611
  return parsedDate;
@@ -8019,10 +8022,7 @@ function getQuarterShortInLocale(quarter, locale) {
8019
8022
  * @returns - Returns true if the day is disabled, false otherwise.
8020
8023
  */
8021
8024
  function isDayDisabled(day, _a) {
8022
- var _b = _a === void 0 ? {} : _a, minDate = _b.minDate, maxDate = _b.maxDate, excludeDates = _b.excludeDates, excludeDateIntervals = _b.excludeDateIntervals, includeDates = _b.includeDates, includeDateIntervals = _b.includeDateIntervals, filterDate = _b.filterDate, disabled = _b.disabled;
8023
- if (disabled) {
8024
- return true;
8025
- }
8025
+ var _b = _a === void 0 ? {} : _a, minDate = _b.minDate, maxDate = _b.maxDate, excludeDates = _b.excludeDates, excludeDateIntervals = _b.excludeDateIntervals, includeDates = _b.includeDates, includeDateIntervals = _b.includeDateIntervals, filterDate = _b.filterDate;
8026
8026
  return (isOutOfBounds(day, { minDate: minDate, maxDate: maxDate }) ||
8027
8027
  (excludeDates &&
8028
8028
  excludeDates.some(function (excludeDate) {
@@ -8122,10 +8122,7 @@ function isMonthYearDisabled(date, _a) {
8122
8122
  false);
8123
8123
  }
8124
8124
  function isQuarterDisabled(quarter, _a) {
8125
- var _b = _a === void 0 ? {} : _a, minDate = _b.minDate, maxDate = _b.maxDate, excludeDates = _b.excludeDates, includeDates = _b.includeDates, filterDate = _b.filterDate, disabled = _b.disabled;
8126
- if (disabled) {
8127
- return true;
8128
- }
8125
+ var _b = _a === void 0 ? {} : _a, minDate = _b.minDate, maxDate = _b.maxDate, excludeDates = _b.excludeDates, includeDates = _b.includeDates, filterDate = _b.filterDate;
8129
8126
  return (isOutOfBounds(quarter, { minDate: minDate, maxDate: maxDate }) ||
8130
8127
  (excludeDates === null || excludeDates === void 0 ? void 0 : excludeDates.some(function (excludeDate) {
8131
8128
  return isSameQuarter(quarter, excludeDate instanceof Date ? excludeDate : excludeDate.date);
@@ -8147,10 +8144,7 @@ function isYearInRange(year, start, end) {
8147
8144
  return startYear <= year && endYear >= year;
8148
8145
  }
8149
8146
  function isYearDisabled(year, _a) {
8150
- var _b = _a === void 0 ? {} : _a, minDate = _b.minDate, maxDate = _b.maxDate, excludeDates = _b.excludeDates, includeDates = _b.includeDates, filterDate = _b.filterDate, disabled = _b.disabled;
8151
- if (disabled) {
8152
- return true;
8153
- }
8147
+ var _b = _a === void 0 ? {} : _a, minDate = _b.minDate, maxDate = _b.maxDate, excludeDates = _b.excludeDates, includeDates = _b.includeDates, filterDate = _b.filterDate;
8154
8148
  var date = new Date(year, 0, 1);
8155
8149
  return (isOutOfBounds(date, {
8156
8150
  minDate: minDate ? startOfYear(minDate) : undefined,
@@ -8222,7 +8216,6 @@ function isTimeInDisabledRange(time, _a) {
8222
8216
  valid = !isWithinInterval(baseTime, { start: min, end: max });
8223
8217
  }
8224
8218
  catch (err) {
8225
- /* istanbul ignore next - date-fns historically threw on invalid intervals */
8226
8219
  valid = false;
8227
8220
  }
8228
8221
  return valid;
@@ -8248,7 +8241,7 @@ function monthDisabledAfter(day, _a) {
8248
8241
  function quarterDisabledBefore(date, _a) {
8249
8242
  var _b = _a === void 0 ? {} : _a, minDate = _b.minDate, includeDates = _b.includeDates;
8250
8243
  var firstDateOfYear = startOfYear(date);
8251
- var previousQuarter = subQuarters(firstDateOfYear);
8244
+ var previousQuarter = subQuarters(firstDateOfYear, 1);
8252
8245
  return ((minDate && differenceInCalendarQuarters(minDate, previousQuarter) > 0) ||
8253
8246
  (includeDates &&
8254
8247
  includeDates.every(function (includeDate) {
@@ -8741,7 +8734,6 @@ var Day = /** @class */ (function (_super) {
8741
8734
  includeDateIntervals: _this.props.includeDateIntervals,
8742
8735
  includeDates: _this.props.includeDates,
8743
8736
  filterDate: _this.props.filterDate,
8744
- disabled: _this.props.disabled,
8745
8737
  });
8746
8738
  };
8747
8739
  _this.isExcluded = function () {
@@ -9389,7 +9381,6 @@ var Month = /** @class */ (function (_super) {
9389
9381
  includeDateIntervals: _this.props.includeDateIntervals,
9390
9382
  includeDates: _this.props.includeDates,
9391
9383
  filterDate: _this.props.filterDate,
9392
- disabled: _this.props.disabled,
9393
9384
  });
9394
9385
  };
9395
9386
  _this.isExcluded = function (day) {
@@ -9526,12 +9517,7 @@ var Month = /** @class */ (function (_super) {
9526
9517
  });
9527
9518
  };
9528
9519
  _this.isSelectedQuarter = function (day, q, selected) {
9529
- return getQuarter(selected) === q && getYear(day) === getYear(selected);
9530
- };
9531
- _this.isSelectQuarterInList = function (day, q, selectedDates) {
9532
- return selectedDates.some(function (selectedDate) {
9533
- return _this.isSelectedQuarter(day, q, selectedDate);
9534
- });
9520
+ return getQuarter(day) === q && getYear(day) === getYear(selected);
9535
9521
  };
9536
9522
  _this.isMonthSelected = function () {
9537
9523
  var _a = _this.props, day = _a.day, selected = _a.selected, selectedDates = _a.selectedDates, selectsMultiple = _a.selectsMultiple;
@@ -9543,21 +9529,7 @@ var Month = /** @class */ (function (_super) {
9543
9529
  }
9544
9530
  return !!selected && _this.isSelectedMonth(day, monthIdx, selected);
9545
9531
  };
9546
- _this.isQuarterSelected = function () {
9547
- var _a = _this.props, day = _a.day, selected = _a.selected, selectedDates = _a.selectedDates, selectsMultiple = _a.selectsMultiple;
9548
- var quarterIdx = getQuarter(day);
9549
- if (selectsMultiple) {
9550
- return selectedDates === null || selectedDates === void 0 ? void 0 : selectedDates.some(function (selectedDate) {
9551
- return _this.isSelectedQuarter(day, quarterIdx, selectedDate);
9552
- });
9553
- }
9554
- return !!selected && _this.isSelectedQuarter(day, quarterIdx, selected);
9555
- };
9556
9532
  _this.renderWeeks = function () {
9557
- // Return empty array if day is invalid
9558
- if (!isValid(_this.props.day)) {
9559
- return [];
9560
- }
9561
9533
  var weeks = [];
9562
9534
  var isFixedHeight = _this.props.fixedHeight;
9563
9535
  var i = 0;
@@ -9769,21 +9741,15 @@ var Month = /** @class */ (function (_super) {
9769
9741
  if (!_this.props.preSelection) {
9770
9742
  break;
9771
9743
  }
9772
- _this.handleQuarterNavigation(quarter === 1 ? 4 : quarter - 1, subQuarters(_this.props.preSelection));
9744
+ _this.handleQuarterNavigation(quarter === 1 ? 4 : quarter - 1, subQuarters(_this.props.preSelection, 1));
9773
9745
  break;
9774
9746
  }
9775
9747
  }
9776
9748
  };
9777
9749
  _this.isMonthDisabledForLabelDate = function (month) {
9778
9750
  var _a;
9779
- var _b = _this.props, day = _b.day, disabled = _b.disabled, minDate = _b.minDate, maxDate = _b.maxDate, excludeDates = _b.excludeDates, includeDates = _b.includeDates;
9751
+ var _b = _this.props, day = _b.day, minDate = _b.minDate, maxDate = _b.maxDate, excludeDates = _b.excludeDates, includeDates = _b.includeDates;
9780
9752
  var labelDate = setMonth(day, month);
9781
- if (disabled) {
9782
- return {
9783
- isDisabled: true,
9784
- labelDate: setMonth(day, month),
9785
- };
9786
- }
9787
9753
  return {
9788
9754
  isDisabled: (_a = ((minDate || maxDate || excludeDates || includeDates) &&
9789
9755
  isMonthDisabled(labelDate, _this.props))) !== null && _a !== void 0 ? _a : false,
@@ -9854,24 +9820,17 @@ var Month = /** @class */ (function (_super) {
9854
9820
  return "".concat(prefix, " ").concat(formatDate(labelDate, "MMMM yyyy", locale));
9855
9821
  };
9856
9822
  _this.getQuarterClassNames = function (q) {
9857
- 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;
9858
- var isDisabled = (minDate ||
9859
- maxDate ||
9860
- excludeDates ||
9861
- includeDates ||
9862
- filterDate ||
9863
- disabled) &&
9823
+ 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;
9824
+ var isDisabled = (minDate || maxDate || excludeDates || includeDates || filterDate) &&
9864
9825
  isQuarterDisabled(setQuarter(day, q), _this.props);
9865
- var selection = _this.getSelection();
9866
9826
  return clsx("react-datepicker__quarter-text", "react-datepicker__quarter-".concat(q), {
9867
9827
  "react-datepicker__quarter-text--disabled": isDisabled,
9868
- "react-datepicker__quarter-text--selected": selection
9869
- ? _this.isSelectQuarterInList(day, q, selection)
9828
+ "react-datepicker__quarter-text--selected": selected
9829
+ ? _this.isSelectedQuarter(day, q, selected)
9870
9830
  : undefined,
9871
9831
  "react-datepicker__quarter-text--keyboard-selected": !disabledKeyboardNavigation &&
9872
9832
  preSelection &&
9873
9833
  _this.isSelectedQuarter(day, q, preSelection) &&
9874
- !_this.isQuarterSelected() &&
9875
9834
  !isDisabled,
9876
9835
  "react-datepicker__quarter-text--in-selecting-range": _this.isInSelectingRangeQuarter(q),
9877
9836
  "react-datepicker__quarter-text--in-range": startDate && endDate
@@ -9951,18 +9910,14 @@ var Month = /** @class */ (function (_super) {
9951
9910
  var formattedAriaLabelPrefix = ariaLabelPrefix
9952
9911
  ? ariaLabelPrefix.trim() + " "
9953
9912
  : "";
9954
- // Format aria-label, return empty string if date is invalid
9955
- var formattedAriaLabel = isValid(day)
9956
- ? "".concat(formattedAriaLabelPrefix).concat(formatDate(day, "MMMM, yyyy", this.props.locale))
9957
- : "";
9958
9913
  var shouldUseListboxRole = showMonthYearPicker || showQuarterYearPicker;
9959
9914
  if (shouldUseListboxRole) {
9960
- return (React__default.createElement("div", { className: this.getClassNames(), onMouseLeave: !this.props.usePointerEvent ? this.handleMouseLeave : undefined, onPointerLeave: this.props.usePointerEvent ? this.handleMouseLeave : undefined, "aria-label": formattedAriaLabel, role: "listbox" }, showMonthYearPicker ? this.renderMonths() : this.renderQuarters()));
9915
+ 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()));
9961
9916
  }
9962
9917
  // For regular calendar view, use table structure
9963
9918
  return (React__default.createElement("div", { role: "table" },
9964
9919
  this.props.dayNamesHeader && (React__default.createElement("div", { role: "rowgroup" }, this.props.dayNamesHeader)),
9965
- 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())));
9920
+ 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())));
9966
9921
  };
9967
9922
  return Month;
9968
9923
  }(Component));
@@ -10625,15 +10580,10 @@ var Year = /** @class */ (function (_super) {
10625
10580
  handleOnKeyDown && handleOnKeyDown(event);
10626
10581
  };
10627
10582
  _this.getYearClassNames = function (y) {
10628
- var _a = _this.props, date = _a.date, disabled = _a.disabled, minDate = _a.minDate, maxDate = _a.maxDate, excludeDates = _a.excludeDates, includeDates = _a.includeDates, filterDate = _a.filterDate, yearClassName = _a.yearClassName;
10583
+ var _a = _this.props, date = _a.date, minDate = _a.minDate, maxDate = _a.maxDate, excludeDates = _a.excludeDates, includeDates = _a.includeDates, filterDate = _a.filterDate, yearClassName = _a.yearClassName;
10629
10584
  return clsx("react-datepicker__year-text", "react-datepicker__year-".concat(y), date ? yearClassName === null || yearClassName === void 0 ? void 0 : yearClassName(setYear(date, y)) : undefined, {
10630
10585
  "react-datepicker__year-text--selected": _this.isSelectedYear(y),
10631
- "react-datepicker__year-text--disabled": (minDate ||
10632
- maxDate ||
10633
- excludeDates ||
10634
- includeDates ||
10635
- filterDate ||
10636
- disabled) &&
10586
+ "react-datepicker__year-text--disabled": (minDate || maxDate || excludeDates || includeDates || filterDate) &&
10637
10587
  isYearDisabled(y, _this.props),
10638
10588
  "react-datepicker__year-text--keyboard-selected": _this.isKeyboardSelected(y),
10639
10589
  "react-datepicker__year-text--range-start": _this.isRangeStart(y),
@@ -11062,15 +11012,10 @@ var Calendar = /** @class */ (function (_super) {
11062
11012
  };
11063
11013
  _this.header = function (date) {
11064
11014
  if (date === void 0) { date = _this.state.date; }
11065
- // Return empty array if date is invalid
11066
- if (!isValid(date)) {
11067
- return [];
11068
- }
11069
- var disabled = _this.props.disabled;
11070
11015
  var startOfWeek = getStartOfWeek(date, _this.props.locale, _this.props.calendarStartDay);
11071
11016
  var dayNames = [];
11072
11017
  if (_this.props.showWeekNumbers) {
11073
- dayNames.push(React__default.createElement("div", { key: "W", className: "react-datepicker__day-name ".concat(disabled ? "react-datepicker__day-name--disabled" : ""), role: "columnheader" },
11018
+ dayNames.push(React__default.createElement("div", { key: "W", className: "react-datepicker__day-name", role: "columnheader" },
11074
11019
  React__default.createElement("span", { className: "react-datepicker__sr-only" }, "Week number"),
11075
11020
  React__default.createElement("span", { "aria-hidden": "true" }, _this.props.weekLabel || "#")));
11076
11021
  }
@@ -11080,7 +11025,7 @@ var Calendar = /** @class */ (function (_super) {
11080
11025
  var weekDayClassName = _this.props.weekDayClassName
11081
11026
  ? _this.props.weekDayClassName(day)
11082
11027
  : undefined;
11083
- return (React__default.createElement("div", { key: offset, role: "columnheader", className: clsx("react-datepicker__day-name", weekDayClassName, disabled ? "react-datepicker__day-name--disabled" : "") },
11028
+ return (React__default.createElement("div", { key: offset, role: "columnheader", className: clsx("react-datepicker__day-name", weekDayClassName) },
11084
11029
  React__default.createElement("span", { className: "react-datepicker__sr-only" }, formatDate(day, "EEEE", _this.props.locale)),
11085
11030
  React__default.createElement("span", { "aria-hidden": "true" }, weekDayName)));
11086
11031
  }));
@@ -11120,9 +11065,6 @@ var Calendar = /** @class */ (function (_super) {
11120
11065
  var fromMonthDate = subMonths(_this.state.date, monthSelectedIn);
11121
11066
  var allPrevDaysDisabled;
11122
11067
  switch (true) {
11123
- case _this.props.disabled:
11124
- allPrevDaysDisabled = true;
11125
- break;
11126
11068
  case _this.props.showMonthYearPicker:
11127
11069
  allPrevDaysDisabled = yearDisabledBefore(_this.state.date, _this.props);
11128
11070
  break;
@@ -11190,9 +11132,6 @@ var Calendar = /** @class */ (function (_super) {
11190
11132
  }
11191
11133
  var allNextDaysDisabled;
11192
11134
  switch (true) {
11193
- case _this.props.disabled:
11194
- allNextDaysDisabled = true;
11195
- break;
11196
11135
  case _this.props.showMonthYearPicker:
11197
11136
  allNextDaysDisabled = yearDisabledAfter(_this.state.date, _this.props);
11198
11137
  break;
@@ -11260,9 +11199,7 @@ var Calendar = /** @class */ (function (_super) {
11260
11199
  if (_this.props.showMonthYearDropdown) {
11261
11200
  classes.push("react-datepicker__current-month--hasMonthYearDropdown");
11262
11201
  }
11263
- return (React__default.createElement("h2", { className: classes.join(" ") }, isValid(date)
11264
- ? formatDate(date, _this.props.dateFormat, _this.props.locale)
11265
- : ""));
11202
+ return (React__default.createElement("h2", { className: classes.join(" ") }, formatDate(date, _this.props.dateFormat, _this.props.locale)));
11266
11203
  };
11267
11204
  _this.renderYearDropdown = function (overrideHide) {
11268
11205
  if (overrideHide === void 0) { overrideHide = false; }
@@ -11412,10 +11349,6 @@ var Calendar = /** @class */ (function (_super) {
11412
11349
  };
11413
11350
  _this.renderAriaLiveRegion = function () {
11414
11351
  var _a;
11415
- // Don't render aria-live message if date is invalid
11416
- if (!isValid(_this.state.date)) {
11417
- return (React__default.createElement("span", { role: "alert", "aria-live": "polite", className: "react-datepicker__aria-live" }));
11418
- }
11419
11352
  var _b = getYearsPeriod(_this.state.date, (_a = _this.props.yearItemNumber) !== null && _a !== void 0 ? _a : Calendar.defaultProps.yearItemNumber), startPeriod = _b.startPeriod, endPeriod = _b.endPeriod;
11420
11353
  var ariaLiveMessage;
11421
11354
  if (_this.props.showYearPicker) {
@@ -11477,7 +11410,6 @@ var Calendar = /** @class */ (function (_super) {
11477
11410
  Calendar.prototype.componentDidUpdate = function (prevProps) {
11478
11411
  var _this = this;
11479
11412
  if (this.props.preSelection &&
11480
- isValid(this.props.preSelection) &&
11481
11413
  (!isSameDay(this.props.preSelection, prevProps.preSelection) ||
11482
11414
  this.props.monthSelectedIn !== prevProps.monthSelectedIn)) {
11483
11415
  var hasMonthChanged_1 = !isSameMonth(this.state.date, this.props.preSelection);
@@ -11498,7 +11430,7 @@ var Calendar = /** @class */ (function (_super) {
11498
11430
  React__default.createElement("div", { style: { display: "contents" }, ref: this.containerRef },
11499
11431
  React__default.createElement(Container, { className: clsx("react-datepicker", this.props.className, {
11500
11432
  "react-datepicker--time-only": this.props.showTimeSelectOnly,
11501
- }), showTime: this.props.showTimeSelect || this.props.showTimeInput, showTimeSelectOnly: this.props.showTimeSelectOnly, inline: this.props.inline },
11433
+ }), showTime: this.props.showTimeSelect || this.props.showTimeInput, showTimeSelectOnly: this.props.showTimeSelectOnly },
11502
11434
  this.renderAriaLiveRegion(),
11503
11435
  this.renderPreviousButton(),
11504
11436
  this.renderNextButton(),
@@ -11692,7 +11624,6 @@ function withFloating(Component) {
11692
11624
  var floatingProps = useFloating(_assign({ open: !hidePopper, whileElementsMounted: autoUpdate, placement: props.popperPlacement, middleware: __spreadArray([
11693
11625
  flip({ padding: 15 }),
11694
11626
  offset(10),
11695
- // eslint-disable-next-line react-hooks/refs -- Floating UI requires refs to be passed during render
11696
11627
  arrow({ element: arrowRef })
11697
11628
  ], ((_a = props.popperModifiers) !== null && _a !== void 0 ? _a : []), true) }, props.popperProps));
11698
11629
  var componentProps = _assign(_assign({}, props), { hidePopper: hidePopper, popperProps: _assign(_assign({}, floatingProps), { arrowRef: arrowRef }) });
@@ -11703,7 +11634,7 @@ function withFloating(Component) {
11703
11634
  }
11704
11635
 
11705
11636
  // Exported for testing purposes
11706
- var PopperComponent$1 = function (props) {
11637
+ var PopperComponent = function (props) {
11707
11638
  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;
11708
11639
  var popper = undefined;
11709
11640
  if (!hidePopper) {
@@ -11724,7 +11655,7 @@ var PopperComponent$1 = function (props) {
11724
11655
  React__default.createElement("div", { ref: popperProps.refs.setReference, className: wrapperClasses }, targetComponent),
11725
11656
  popper));
11726
11657
  };
11727
- var PopperComponent = withFloating(PopperComponent$1);
11658
+ var PopperComponent$1 = withFloating(PopperComponent);
11728
11659
 
11729
11660
  // Compares dates year+month combinations
11730
11661
  function hasPreSelectionChanged(date1, date2) {
@@ -12002,11 +11933,9 @@ var DatePicker$1 = /** @class */ (function (_super) {
12002
11933
  }
12003
11934
  };
12004
11935
  _this.handleSelect = function (date, event, monthSelectedIn) {
12005
- var _a;
12006
11936
  if (_this.props.readOnly)
12007
11937
  return;
12008
- var _b = _this.props, selectsRange = _b.selectsRange, startDate = _b.startDate, endDate = _b.endDate, locale = _b.locale, swapRange = _b.swapRange;
12009
- var dateFormat = (_a = _this.props.dateFormat) !== null && _a !== void 0 ? _a : DatePicker.defaultProps.dateFormat;
11938
+ var _a = _this.props, selectsRange = _a.selectsRange, startDate = _a.startDate, endDate = _a.endDate, swapRange = _a.swapRange;
12010
11939
  var isDateSelectionComplete = !selectsRange ||
12011
11940
  (startDate && !endDate && (swapRange || !isDateBefore(date, startDate)));
12012
11941
  if (_this.props.shouldCloseOnSelect &&
@@ -12017,11 +11946,7 @@ var DatePicker$1 = /** @class */ (function (_super) {
12017
11946
  _this.sendFocusBackToInput();
12018
11947
  }
12019
11948
  if (_this.props.onChangeRaw) {
12020
- var formattedDate = safeDateFormat(date, {
12021
- dateFormat: dateFormat,
12022
- locale: locale,
12023
- });
12024
- _this.props.onChangeRaw(event, { date: date, formattedDate: formattedDate });
11949
+ _this.props.onChangeRaw(event);
12025
11950
  }
12026
11951
  _this.setSelected(date, event, false, monthSelectedIn);
12027
11952
  if (_this.props.showDateSelect) {
@@ -12227,117 +12152,6 @@ var DatePicker$1 = /** @class */ (function (_super) {
12227
12152
  }
12228
12153
  (_b = (_a = _this.props).onInputClick) === null || _b === void 0 ? void 0 : _b.call(_a);
12229
12154
  };
12230
- _this.handleTimeOnlyArrowKey = function (eventKey) {
12231
- var _a, _b, _c, _d;
12232
- var currentTime = _this.props.selected || _this.state.preSelection || newDate();
12233
- var timeIntervals = (_a = _this.props.timeIntervals) !== null && _a !== void 0 ? _a : 30;
12234
- var dateFormat = (_b = _this.props.dateFormat) !== null && _b !== void 0 ? _b : DatePicker.defaultProps.dateFormat;
12235
- var formatStr = Array.isArray(dateFormat) ? dateFormat[0] : dateFormat;
12236
- var baseDate = getStartOfDay(currentTime);
12237
- var currentMinutes = getHours(currentTime) * 60 + getMinutes(currentTime);
12238
- var maxMinutes = 23 * 60 + 60 - timeIntervals; // Cap at last valid interval of the day
12239
- var newTime;
12240
- if (eventKey === KeyType.ArrowUp) {
12241
- var newMinutes = Math.max(0, currentMinutes - timeIntervals);
12242
- newTime = addMinutes(baseDate, newMinutes);
12243
- }
12244
- else {
12245
- var newMinutes = Math.min(maxMinutes, currentMinutes + timeIntervals);
12246
- newTime = addMinutes(baseDate, newMinutes);
12247
- }
12248
- var formattedTime = formatDate(newTime, formatStr || DatePicker.defaultProps.dateFormat, _this.props.locale);
12249
- _this.setState({
12250
- preSelection: newTime,
12251
- inputValue: formattedTime,
12252
- });
12253
- if (_this.props.selectsRange || _this.props.selectsMultiple) {
12254
- return;
12255
- }
12256
- var selected = _this.props.selected
12257
- ? _this.props.selected
12258
- : _this.getPreSelection();
12259
- var changedDate = _this.props.selected
12260
- ? newTime
12261
- : setTime(selected, {
12262
- hour: getHours(newTime),
12263
- minute: getMinutes(newTime),
12264
- });
12265
- (_d = (_c = _this.props).onChange) === null || _d === void 0 ? void 0 : _d.call(_c, changedDate);
12266
- if (_this.props.showTimeSelectOnly || _this.props.showTimeSelect) {
12267
- _this.setState({ isRenderAriaLiveMessage: true });
12268
- }
12269
- requestAnimationFrame(function () {
12270
- _this.scrollToTimeOption(newTime);
12271
- });
12272
- };
12273
- _this.handleTimeOnlyEnterKey = function (event) {
12274
- var _a, _b, _c, _d;
12275
- var inputElement = event.target;
12276
- var inputValue = inputElement.value;
12277
- var dateFormat = (_a = _this.props.dateFormat) !== null && _a !== void 0 ? _a : DatePicker.defaultProps.dateFormat;
12278
- var timeFormat = _this.props.timeFormat || "p";
12279
- var defaultTime = _this.state.preSelection || _this.props.selected || newDate();
12280
- var parsedDate = parseDate(inputValue, dateFormat, _this.props.locale, (_b = _this.props.strictParsing) !== null && _b !== void 0 ? _b : false, defaultTime);
12281
- var timeToCommit = defaultTime;
12282
- if (parsedDate && isValid(parsedDate)) {
12283
- timeToCommit = parsedDate;
12284
- }
12285
- else {
12286
- var highlightedItem = ((_c = _this.calendar) === null || _c === void 0 ? void 0 : _c.containerRef.current) instanceof Element &&
12287
- _this.calendar.containerRef.current.querySelector(".react-datepicker__time-list-item[tabindex='0']");
12288
- if (highlightedItem instanceof HTMLElement) {
12289
- var itemText = (_d = highlightedItem.textContent) === null || _d === void 0 ? void 0 : _d.trim();
12290
- if (itemText) {
12291
- var itemTime = parseDate(itemText, timeFormat, _this.props.locale, false, defaultTime);
12292
- if (itemTime && isValid(itemTime)) {
12293
- timeToCommit = itemTime;
12294
- }
12295
- }
12296
- }
12297
- }
12298
- _this.handleTimeChange(timeToCommit);
12299
- _this.setOpen(false);
12300
- _this.sendFocusBackToInput();
12301
- };
12302
- _this.scrollToTimeOption = function (time) {
12303
- var _a, _b;
12304
- if (!((_a = _this.calendar) === null || _a === void 0 ? void 0 : _a.containerRef.current)) {
12305
- return;
12306
- }
12307
- var container = _this.calendar.containerRef.current;
12308
- var timeListItems = Array.from(container.querySelectorAll(".react-datepicker__time-list-item"));
12309
- var targetItem = null;
12310
- var closestTimeDiff = Infinity;
12311
- var timeFormat = _this.props.timeFormat || "p";
12312
- for (var _i = 0, timeListItems_1 = timeListItems; _i < timeListItems_1.length; _i++) {
12313
- var item = timeListItems_1[_i];
12314
- var itemText = (_b = item.textContent) === null || _b === void 0 ? void 0 : _b.trim();
12315
- if (itemText) {
12316
- var itemTime = parseDate(itemText, timeFormat, _this.props.locale, false, time);
12317
- if (itemTime && isValid(itemTime)) {
12318
- if (isSameMinute(itemTime, time)) {
12319
- targetItem = item;
12320
- break;
12321
- }
12322
- var timeDiff = Math.abs(itemTime.getTime() - time.getTime());
12323
- if (timeDiff < closestTimeDiff) {
12324
- closestTimeDiff = timeDiff;
12325
- targetItem = item;
12326
- }
12327
- }
12328
- }
12329
- }
12330
- if (targetItem) {
12331
- timeListItems.forEach(function (item) {
12332
- item.setAttribute("tabindex", "-1");
12333
- });
12334
- targetItem.setAttribute("tabindex", "0");
12335
- targetItem.scrollIntoView({
12336
- behavior: "smooth",
12337
- block: "center",
12338
- });
12339
- }
12340
- };
12341
12155
  _this.onInputKeyDown = function (event) {
12342
12156
  var _a, _b, _c, _d, _e, _f;
12343
12157
  (_b = (_a = _this.props).onKeyDown) === null || _b === void 0 ? void 0 : _b.call(_a, event);
@@ -12352,18 +12166,6 @@ var DatePicker$1 = /** @class */ (function (_super) {
12352
12166
  }
12353
12167
  return;
12354
12168
  }
12355
- if (_this.state.open && _this.props.showTimeSelectOnly) {
12356
- if (eventKey === KeyType.ArrowDown || eventKey === KeyType.ArrowUp) {
12357
- event.preventDefault();
12358
- _this.handleTimeOnlyArrowKey(eventKey);
12359
- return;
12360
- }
12361
- if (eventKey === KeyType.Enter) {
12362
- event.preventDefault();
12363
- _this.handleTimeOnlyEnterKey(event);
12364
- return;
12365
- }
12366
- }
12367
12169
  // if calendar is open, these keys will focus the selected item
12368
12170
  if (_this.state.open) {
12369
12171
  if (eventKey === KeyType.ArrowDown || eventKey === KeyType.ArrowUp) {
@@ -12444,11 +12246,11 @@ var DatePicker$1 = /** @class */ (function (_super) {
12444
12246
  break;
12445
12247
  case KeyType.ArrowLeft:
12446
12248
  newCalculatedDate = showWeekPicker
12447
- ? subWeeks(date)
12448
- : subDays(date);
12249
+ ? subWeeks(date, 1)
12250
+ : subDays(date, 1);
12449
12251
  break;
12450
12252
  case KeyType.ArrowUp:
12451
- newCalculatedDate = subWeeks(date);
12253
+ newCalculatedDate = subWeeks(date, 1);
12452
12254
  break;
12453
12255
  case KeyType.ArrowDown:
12454
12256
  newCalculatedDate = addWeeks(date, 1);
@@ -12554,12 +12356,20 @@ var DatePicker$1 = /** @class */ (function (_super) {
12554
12356
  _this.setSelected(newSelection);
12555
12357
  }
12556
12358
  _this.setPreSelection(newSelection);
12557
- // In inline mode, always set shouldFocusDayInline to true when navigating via keyboard.
12558
- // This ensures focus is properly transferred to the new day element regardless of
12559
- // whether the month changed. The user initiated this navigation from a focused day,
12560
- // so we should always focus the destination day.
12359
+ // need to figure out whether month has changed to focus day in inline version
12561
12360
  if (inline) {
12562
- _this.setState({ shouldFocusDayInline: true });
12361
+ var prevMonth = getMonth(copy);
12362
+ var newMonth = getMonth(newSelection);
12363
+ var prevYear = getYear(copy);
12364
+ var newYear = getYear(newSelection);
12365
+ if (prevMonth !== newMonth || prevYear !== newYear) {
12366
+ // month has changed
12367
+ _this.setState({ shouldFocusDayInline: true });
12368
+ }
12369
+ else {
12370
+ // month hasn't changed
12371
+ _this.setState({ shouldFocusDayInline: false });
12372
+ }
12563
12373
  }
12564
12374
  };
12565
12375
  // handle generic key down events in the popper that do not adjust or select dates
@@ -12661,31 +12471,39 @@ var DatePicker$1 = /** @class */ (function (_super) {
12661
12471
  };
12662
12472
  _this.renderDateInput = function () {
12663
12473
  var _a, _b;
12664
- var _c, _d, _e, _f;
12665
12474
  var className = clsx(_this.props.className, (_a = {},
12666
12475
  _a[_this.props.outsideClickIgnoreClass ||
12667
12476
  DatePicker.defaultProps.outsideClickIgnoreClass] = _this.state.open,
12668
12477
  _a));
12669
12478
  var customInput = _this.props.customInput || React__default.createElement("input", { type: "text" });
12670
12479
  var customInputRef = _this.props.customInputRef || "ref";
12671
- // Build aria props object, only including defined values to avoid
12672
- // overwriting aria attributes that may be set on the custom input
12673
- var ariaProps = {};
12674
- var ariaDescribedBy = (_c = _this.props["aria-describedby"]) !== null && _c !== void 0 ? _c : _this.props.ariaDescribedBy;
12675
- var ariaInvalid = (_d = _this.props["aria-invalid"]) !== null && _d !== void 0 ? _d : _this.props.ariaInvalid;
12676
- var ariaLabelledBy = (_e = _this.props["aria-labelledby"]) !== null && _e !== void 0 ? _e : _this.props.ariaLabelledBy;
12677
- var ariaRequired = (_f = _this.props["aria-required"]) !== null && _f !== void 0 ? _f : _this.props.ariaRequired;
12678
- if (ariaDescribedBy != null)
12679
- ariaProps["aria-describedby"] = ariaDescribedBy;
12680
- if (ariaInvalid != null)
12681
- ariaProps["aria-invalid"] = ariaInvalid;
12682
- if (ariaLabelledBy != null)
12683
- ariaProps["aria-labelledby"] = ariaLabelledBy;
12684
- if (ariaRequired != null)
12685
- ariaProps["aria-required"] = ariaRequired;
12686
- return cloneElement(customInput, _assign((_b = {}, _b[customInputRef] = function (input) {
12687
- _this.input = input;
12688
- }, _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));
12480
+ return cloneElement(customInput, (_b = {},
12481
+ _b[customInputRef] = function (input) {
12482
+ _this.input = input;
12483
+ },
12484
+ _b.value = _this.getInputValue(),
12485
+ _b.onBlur = _this.handleBlur,
12486
+ _b.onChange = _this.handleChange,
12487
+ _b.onClick = _this.onInputClick,
12488
+ _b.onFocus = _this.handleFocus,
12489
+ _b.onKeyDown = _this.onInputKeyDown,
12490
+ _b.id = _this.props.id,
12491
+ _b.name = _this.props.name,
12492
+ _b.form = _this.props.form,
12493
+ _b.autoFocus = _this.props.autoFocus,
12494
+ _b.placeholder = _this.props.placeholderText,
12495
+ _b.disabled = _this.props.disabled,
12496
+ _b.autoComplete = _this.props.autoComplete,
12497
+ _b.className = clsx(customInput.props.className, className),
12498
+ _b.title = _this.props.title,
12499
+ _b.readOnly = _this.props.readOnly,
12500
+ _b.required = _this.props.required,
12501
+ _b.tabIndex = _this.props.tabIndex,
12502
+ _b["aria-describedby"] = _this.props.ariaDescribedBy,
12503
+ _b["aria-invalid"] = _this.props.ariaInvalid,
12504
+ _b["aria-labelledby"] = _this.props.ariaLabelledBy,
12505
+ _b["aria-required"] = _this.props.ariaRequired,
12506
+ _b));
12689
12507
  };
12690
12508
  _this.renderClearButton = function () {
12691
12509
  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;
@@ -12773,9 +12591,6 @@ var DatePicker$1 = /** @class */ (function (_super) {
12773
12591
  prevProps.monthsShown !== this.props.monthsShown) {
12774
12592
  this.setState({ monthSelectedIn: 0 });
12775
12593
  }
12776
- if (this.props.selectsRange && this.state.monthSelectedIn !== 0) {
12777
- this.setState({ monthSelectedIn: 0 });
12778
- }
12779
12594
  if (prevProps.highlightDates !== this.props.highlightDates) {
12780
12595
  this.setState({
12781
12596
  highlightDates: getHighLightDaysMap(this.props.highlightDates),
@@ -12829,14 +12644,14 @@ var DatePicker$1 = /** @class */ (function (_super) {
12829
12644
  this.renderInputContainer(),
12830
12645
  portalContainer));
12831
12646
  }
12832
- 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 })));
12647
+ 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 })));
12833
12648
  };
12834
12649
  return DatePicker;
12835
12650
  }(Component));
12836
12651
  var PRESELECT_CHANGE_VIA_INPUT = "input";
12837
12652
  var PRESELECT_CHANGE_VIA_NAVIGATE = "navigate";
12838
12653
 
12839
- var styles = {"datePickerWrapper":"OmFI-Bfdzgw-","fullWidth":"HWDFy10kcYA-","datePicker":"Ma55F5Y-XhE-","inline":"_58kEbTu-IAA-","portalContainer":"LDxKi0E-1rg-","header":"Epg-Ub8Dn9A-","month":"Wx3NP8La95k-"};
12654
+ var styles = {"datePickerWrapper":"OmFI-Bfdzgw-","fullWidth":"HWDFy10kcYA-","datePicker":"Ma55F5Y-XhE-","inline":"_58kEbTu-IAA-","portalContainer":"LDxKi0E-1rg-","header":"Epg-Ub8Dn9A-","month":"Wx3NP8La95k-","spinning":"o0JLwNATy-M-"};
12840
12655
 
12841
12656
  function DatePickerCustomHeader({ monthDate, decreaseMonth, increaseMonth, prevMonthButtonDisabled, nextMonthButtonDisabled, }) {
12842
12657
  return (React__default.createElement("div", { className: styles.header },