@cerebruminc/cerebellum 16.1.1-beta.dangerous.94a8f04 → 16.1.1-beta.dangerous.bc77c27

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 (80) hide show
  1. package/lib/cjs/DatePicker.cjs +1 -1
  2. package/lib/cjs/Form.cjs +4 -7
  3. package/lib/cjs/Form.cjs.map +1 -1
  4. package/lib/cjs/FormFieldTypeEnum.cjs +0 -5
  5. package/lib/cjs/FormFieldTypeEnum.cjs.map +1 -1
  6. package/lib/cjs/FormSeparator.cjs +1 -3
  7. package/lib/cjs/FormSeparator.cjs.map +1 -1
  8. package/lib/cjs/{FormStyles-CM25rbhG.js → FormStyles-CxgYRZOl.js} +21 -38
  9. package/lib/cjs/{FormStyles-CM25rbhG.js.map → FormStyles-CxgYRZOl.js.map} +1 -1
  10. package/lib/cjs/FormWrapper.cjs +1 -3
  11. package/lib/cjs/FormWrapper.cjs.map +1 -1
  12. package/lib/cjs/{FormikContainer-DVL86Jri.js → FormikContainer-CY2nLsAs.js} +3 -33
  13. package/lib/{esm/FormikContainer-uI5oe1px.js.map → cjs/FormikContainer-CY2nLsAs.js.map} +1 -1
  14. package/lib/cjs/{InlineDatePicker-B7DTwvhv.js → InlineDatePicker-DFv_uHo9.js} +176 -344
  15. package/lib/cjs/InlineDatePicker-DFv_uHo9.js.map +1 -0
  16. package/lib/cjs/InlineDatePicker.cjs +1 -1
  17. package/lib/cjs/TitleGroup.cjs +1 -3
  18. package/lib/cjs/TitleGroup.cjs.map +1 -1
  19. package/lib/cjs/cerebellumTheme.cjs +0 -5
  20. package/lib/cjs/cerebellumTheme.cjs.map +1 -1
  21. package/lib/cjs/index.cjs +3 -9
  22. package/lib/cjs/index.cjs.map +1 -1
  23. package/lib/esm/DatePicker.js +1 -1
  24. package/lib/esm/Form.js +5 -7
  25. package/lib/esm/Form.js.map +1 -1
  26. package/lib/esm/FormFieldTypeEnum.js +1 -5
  27. package/lib/esm/FormFieldTypeEnum.js.map +1 -1
  28. package/lib/esm/FormSeparator.js +1 -3
  29. package/lib/esm/FormSeparator.js.map +1 -1
  30. package/lib/esm/{FormStyles-CyqyMC1o.js → FormStyles-BQJPyTS0.js} +22 -39
  31. package/lib/esm/{FormStyles-CyqyMC1o.js.map → FormStyles-BQJPyTS0.js.map} +1 -1
  32. package/lib/esm/FormWrapper.js +1 -3
  33. package/lib/esm/FormWrapper.js.map +1 -1
  34. package/lib/esm/{FormikContainer-uI5oe1px.js → FormikContainer-SJPYfIkF.js} +4 -34
  35. package/lib/{cjs/FormikContainer-DVL86Jri.js.map → esm/FormikContainer-SJPYfIkF.js.map} +1 -1
  36. package/lib/esm/{InlineDatePicker-BuxjkoV0.js → InlineDatePicker-ClVBWEzW.js} +177 -345
  37. package/lib/esm/InlineDatePicker-ClVBWEzW.js.map +1 -0
  38. package/lib/esm/InlineDatePicker.js +1 -1
  39. package/lib/esm/TitleGroup.js +1 -3
  40. package/lib/esm/TitleGroup.js.map +1 -1
  41. package/lib/esm/cerebellumTheme.js +0 -5
  42. package/lib/esm/cerebellumTheme.js.map +1 -1
  43. package/lib/esm/index.js +4 -6
  44. package/lib/esm/index.js.map +1 -1
  45. package/lib/types/src/components/Form/fields/index.d.ts +1 -2
  46. package/lib/types/src/components/Form/index.d.ts +3 -3
  47. package/lib/types/src/components/Form/mocks/fields.d.ts +0 -62
  48. package/lib/types/src/components/Form/types.d.ts +2 -36
  49. package/lib/types/src/index.d.ts +1 -5
  50. package/lib/types/src/theme.d.ts +0 -6
  51. package/package.json +2 -2
  52. package/lib/cjs/ColorPickerInput-CBPI8IJ-.js +0 -187
  53. package/lib/cjs/ColorPickerInput-CBPI8IJ-.js.map +0 -1
  54. package/lib/cjs/ColorPickerInput.cjs +0 -25
  55. package/lib/cjs/ColorPickerInput.cjs.map +0 -1
  56. package/lib/cjs/InlineColorPickerInput.cjs +0 -25
  57. package/lib/cjs/InlineColorPickerInput.cjs.map +0 -1
  58. package/lib/cjs/InlineDatePicker-B7DTwvhv.js.map +0 -1
  59. package/lib/cjs/validateColorContrast.cjs +0 -53
  60. package/lib/cjs/validateColorContrast.cjs.map +0 -1
  61. package/lib/cjs/validateColorContrastWithMessage.cjs +0 -10
  62. package/lib/cjs/validateColorContrastWithMessage.cjs.map +0 -1
  63. package/lib/esm/ColorPickerInput-S8X2gIA5.js +0 -180
  64. package/lib/esm/ColorPickerInput-S8X2gIA5.js.map +0 -1
  65. package/lib/esm/ColorPickerInput.js +0 -18
  66. package/lib/esm/ColorPickerInput.js.map +0 -1
  67. package/lib/esm/InlineColorPickerInput.js +0 -18
  68. package/lib/esm/InlineColorPickerInput.js.map +0 -1
  69. package/lib/esm/InlineDatePicker-BuxjkoV0.js.map +0 -1
  70. package/lib/esm/validateColorContrast.js +0 -50
  71. package/lib/esm/validateColorContrast.js.map +0 -1
  72. package/lib/esm/validateColorContrastWithMessage.js +0 -3
  73. package/lib/esm/validateColorContrastWithMessage.js.map +0 -1
  74. package/lib/types/src/components/ColorPickerInput/ColorPickerInput.d.ts +0 -3
  75. package/lib/types/src/components/ColorPickerInput/InlineColorPickerInput.d.ts +0 -3
  76. package/lib/types/src/components/ColorPickerInput/index.d.ts +0 -3
  77. package/lib/types/src/components/ColorPickerInput/types.d.ts +0 -48
  78. package/lib/types/src/components/Form/fields/ColorPickerField/ColorPickerField.d.ts +0 -4
  79. package/lib/types/src/components/Form/fields/ColorPickerField/index.d.ts +0 -1
  80. package/lib/types/src/helpers/colorValidators.d.ts +0 -19
@@ -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, useCallback, useEffect, createElement, useState, forwardRef } from 'react';
5
+ import React__default, { useLayoutEffect, createElement, cloneElement, createRef, Component, useRef, useCallback, useEffect, 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';
@@ -7497,40 +7497,34 @@ function isShadowRoot(value) {
7497
7497
  }
7498
7498
  return value instanceof ShadowRoot || value instanceof getWindow(value).ShadowRoot;
7499
7499
  }
7500
- const invalidOverflowDisplayValues = /*#__PURE__*/new Set(['inline', 'contents']);
7501
7500
  function isOverflowElement(element) {
7502
7501
  const {
7503
7502
  overflow,
7504
7503
  overflowX,
7505
7504
  overflowY,
7506
7505
  display
7507
- } = getComputedStyle$1(element);
7508
- return /auto|scroll|overlay|hidden|clip/.test(overflow + overflowY + overflowX) && !invalidOverflowDisplayValues.has(display);
7506
+ } = getComputedStyle(element);
7507
+ return /auto|scroll|overlay|hidden|clip/.test(overflow + overflowY + overflowX) && !['inline', 'contents'].includes(display);
7509
7508
  }
7510
- const tableElements = /*#__PURE__*/new Set(['table', 'td', 'th']);
7511
7509
  function isTableElement(element) {
7512
- return tableElements.has(getNodeName(element));
7510
+ return ['table', 'td', 'th'].includes(getNodeName(element));
7513
7511
  }
7514
- const topLayerSelectors = [':popover-open', ':modal'];
7515
7512
  function isTopLayer(element) {
7516
- return topLayerSelectors.some(selector => {
7513
+ return [':popover-open', ':modal'].some(selector => {
7517
7514
  try {
7518
7515
  return element.matches(selector);
7519
- } catch (_e) {
7516
+ } catch (e) {
7520
7517
  return false;
7521
7518
  }
7522
7519
  });
7523
7520
  }
7524
- const transformProperties = ['transform', 'translate', 'scale', 'rotate', 'perspective'];
7525
- const willChangeValues = ['transform', 'translate', 'scale', 'rotate', 'perspective', 'filter'];
7526
- const containValues = ['paint', 'layout', 'strict', 'content'];
7527
7521
  function isContainingBlock(elementOrCss) {
7528
7522
  const webkit = isWebKit();
7529
- const css = isElement(elementOrCss) ? getComputedStyle$1(elementOrCss) : elementOrCss;
7523
+ const css = isElement(elementOrCss) ? getComputedStyle(elementOrCss) : elementOrCss;
7530
7524
 
7531
7525
  // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block
7532
7526
  // https://drafts.csswg.org/css-transforms-2/#individual-transforms
7533
- return transformProperties.some(value => css[value] ? css[value] !== 'none' : false) || (css.containerType ? css.containerType !== 'normal' : false) || !webkit && (css.backdropFilter ? css.backdropFilter !== 'none' : false) || !webkit && (css.filter ? css.filter !== 'none' : false) || willChangeValues.some(value => (css.willChange || '').includes(value)) || containValues.some(value => (css.contain || '').includes(value));
7527
+ return ['transform', 'translate', 'scale', 'rotate', 'perspective'].some(value => css[value] ? css[value] !== 'none' : false) || (css.containerType ? css.containerType !== 'normal' : false) || !webkit && (css.backdropFilter ? css.backdropFilter !== 'none' : false) || !webkit && (css.filter ? css.filter !== 'none' : false) || ['transform', 'translate', 'scale', 'rotate', 'perspective', 'filter'].some(value => (css.willChange || '').includes(value)) || ['paint', 'layout', 'strict', 'content'].some(value => (css.contain || '').includes(value));
7534
7528
  }
7535
7529
  function getContainingBlock(element) {
7536
7530
  let currentNode = getParentNode(element);
@@ -7548,11 +7542,10 @@ function isWebKit() {
7548
7542
  if (typeof CSS === 'undefined' || !CSS.supports) return false;
7549
7543
  return CSS.supports('-webkit-backdrop-filter', 'none');
7550
7544
  }
7551
- const lastTraversableNodeNames = /*#__PURE__*/new Set(['html', 'body', '#document']);
7552
7545
  function isLastTraversableNode(node) {
7553
- return lastTraversableNodeNames.has(getNodeName(node));
7546
+ return ['html', 'body', '#document'].includes(getNodeName(node));
7554
7547
  }
7555
- function getComputedStyle$1(element) {
7548
+ function getComputedStyle(element) {
7556
7549
  return getWindow(element).getComputedStyle(element);
7557
7550
  }
7558
7551
  function getNodeScroll(element) {
@@ -7654,9 +7647,8 @@ function getOppositeAxis(axis) {
7654
7647
  function getAxisLength(axis) {
7655
7648
  return axis === 'y' ? 'height' : 'width';
7656
7649
  }
7657
- const yAxisSides = /*#__PURE__*/new Set(['top', 'bottom']);
7658
7650
  function getSideAxis(placement) {
7659
- return yAxisSides.has(getSide(placement)) ? 'y' : 'x';
7651
+ return ['top', 'bottom'].includes(getSide(placement)) ? 'y' : 'x';
7660
7652
  }
7661
7653
  function getAlignmentAxis(placement) {
7662
7654
  return getOppositeAxis(getSideAxis(placement));
@@ -7681,19 +7673,19 @@ function getExpandedPlacements(placement) {
7681
7673
  function getOppositeAlignmentPlacement(placement) {
7682
7674
  return placement.replace(/start|end/g, alignment => oppositeAlignmentMap[alignment]);
7683
7675
  }
7684
- const lrPlacement = ['left', 'right'];
7685
- const rlPlacement = ['right', 'left'];
7686
- const tbPlacement = ['top', 'bottom'];
7687
- const btPlacement = ['bottom', 'top'];
7688
7676
  function getSideList(side, isStart, rtl) {
7677
+ const lr = ['left', 'right'];
7678
+ const rl = ['right', 'left'];
7679
+ const tb = ['top', 'bottom'];
7680
+ const bt = ['bottom', 'top'];
7689
7681
  switch (side) {
7690
7682
  case 'top':
7691
7683
  case 'bottom':
7692
- if (rtl) return isStart ? rlPlacement : lrPlacement;
7693
- return isStart ? lrPlacement : rlPlacement;
7684
+ if (rtl) return isStart ? rl : lr;
7685
+ return isStart ? lr : rl;
7694
7686
  case 'left':
7695
7687
  case 'right':
7696
- return isStart ? tbPlacement : btPlacement;
7688
+ return isStart ? tb : bt;
7697
7689
  default:
7698
7690
  return [];
7699
7691
  }
@@ -8145,7 +8137,7 @@ const flip$2 = function (options) {
8145
8137
  if (!ignoreCrossAxisOverflow ||
8146
8138
  // We leave the current main axis only if every placement on that axis
8147
8139
  // overflows the main axis.
8148
- overflowsData.every(d => getSideAxis(d.placement) === initialSideAxis ? d.overflows[0] > 0 : true)) {
8140
+ overflowsData.every(d => d.overflows[0] > 0 && getSideAxis(d.placement) === initialSideAxis)) {
8149
8141
  // Try next placement and re-run the lifecycle.
8150
8142
  return {
8151
8143
  data: {
@@ -8202,8 +8194,6 @@ const flip$2 = function (options) {
8202
8194
  };
8203
8195
  };
8204
8196
 
8205
- const originSides = /*#__PURE__*/new Set(['left', 'top']);
8206
-
8207
8197
  // For type backwards-compatibility, the `OffsetOptions` type was also
8208
8198
  // Derivable.
8209
8199
 
@@ -8217,7 +8207,7 @@ async function convertValueToCoords(state, options) {
8217
8207
  const side = getSide(placement);
8218
8208
  const alignment = getAlignment(placement);
8219
8209
  const isVertical = getSideAxis(placement) === 'y';
8220
- const mainAxisMulti = originSides.has(side) ? -1 : 1;
8210
+ const mainAxisMulti = ['left', 'top'].includes(side) ? -1 : 1;
8221
8211
  const crossAxisMulti = rtl && isVertical ? -1 : 1;
8222
8212
  const rawValue = evaluate(options, state);
8223
8213
 
@@ -8289,7 +8279,7 @@ const offset$2 = function (options) {
8289
8279
  };
8290
8280
 
8291
8281
  function getCssDimensions(element) {
8292
- const css = getComputedStyle$1(element);
8282
+ const css = getComputedStyle(element);
8293
8283
  // In testing environments, the `width` and `height` properties are empty
8294
8284
  // strings for SVG elements, returning NaN. Fallback to `0` in this case.
8295
8285
  let width = parseFloat(css.width) || 0;
@@ -8394,7 +8384,7 @@ function getBoundingClientRect(element, includeScale, isFixedStrategy, offsetPar
8394
8384
  while (currentIFrame && offsetParent && offsetWin !== currentWin) {
8395
8385
  const iframeScale = getScale(currentIFrame);
8396
8386
  const iframeRect = currentIFrame.getBoundingClientRect();
8397
- const css = getComputedStyle$1(currentIFrame);
8387
+ const css = getComputedStyle(currentIFrame);
8398
8388
  const left = iframeRect.left + (currentIFrame.clientLeft + parseFloat(css.paddingLeft)) * iframeScale.x;
8399
8389
  const top = iframeRect.top + (currentIFrame.clientTop + parseFloat(css.paddingTop)) * iframeScale.y;
8400
8390
  x *= iframeScale.x;
@@ -8425,9 +8415,14 @@ function getWindowScrollBarX(element, rect) {
8425
8415
  return rect.left + leftScroll;
8426
8416
  }
8427
8417
 
8428
- function getHTMLOffset(documentElement, scroll) {
8418
+ function getHTMLOffset(documentElement, scroll, ignoreScrollbarX) {
8419
+ if (ignoreScrollbarX === void 0) {
8420
+ ignoreScrollbarX = false;
8421
+ }
8429
8422
  const htmlRect = documentElement.getBoundingClientRect();
8430
- const x = htmlRect.left + scroll.scrollLeft - getWindowScrollBarX(documentElement, htmlRect);
8423
+ const x = htmlRect.left + scroll.scrollLeft - (ignoreScrollbarX ? 0 :
8424
+ // RTL <body> scrollbar.
8425
+ getWindowScrollBarX(documentElement, htmlRect));
8431
8426
  const y = htmlRect.top + scroll.scrollTop;
8432
8427
  return {
8433
8428
  x,
@@ -8466,7 +8461,7 @@ function convertOffsetParentRelativeRectToViewportRelativeRect(_ref) {
8466
8461
  offsets.y = offsetRect.y + offsetParent.clientTop;
8467
8462
  }
8468
8463
  }
8469
- const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll) : createCoords(0);
8464
+ const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll, true) : createCoords(0);
8470
8465
  return {
8471
8466
  width: rect.width * scale.x,
8472
8467
  height: rect.height * scale.y,
@@ -8489,7 +8484,7 @@ function getDocumentRect(element) {
8489
8484
  const height = max(html.scrollHeight, html.clientHeight, body.scrollHeight, body.clientHeight);
8490
8485
  let x = -scroll.scrollLeft + getWindowScrollBarX(element);
8491
8486
  const y = -scroll.scrollTop;
8492
- if (getComputedStyle$1(body).direction === 'rtl') {
8487
+ if (getComputedStyle(body).direction === 'rtl') {
8493
8488
  x += max(html.clientWidth, body.clientWidth) - width;
8494
8489
  }
8495
8490
  return {
@@ -8500,10 +8495,6 @@ function getDocumentRect(element) {
8500
8495
  };
8501
8496
  }
8502
8497
 
8503
- // Safety check: ensure the scrollbar space is reasonable in case this
8504
- // calculation is affected by unusual styles.
8505
- // Most scrollbars leave 15-18px of space.
8506
- const SCROLLBAR_MAX = 25;
8507
8498
  function getViewportRect(element, strategy) {
8508
8499
  const win = getWindow(element);
8509
8500
  const html = getDocumentElement(element);
@@ -8521,24 +8512,6 @@ function getViewportRect(element, strategy) {
8521
8512
  y = visualViewport.offsetTop;
8522
8513
  }
8523
8514
  }
8524
- const windowScrollbarX = getWindowScrollBarX(html);
8525
- // <html> `overflow: hidden` + `scrollbar-gutter: stable` reduces the
8526
- // visual width of the <html> but this is not considered in the size
8527
- // of `html.clientWidth`.
8528
- if (windowScrollbarX <= 0) {
8529
- const doc = html.ownerDocument;
8530
- const body = doc.body;
8531
- const bodyStyles = getComputedStyle(body);
8532
- const bodyMarginInline = doc.compatMode === 'CSS1Compat' ? parseFloat(bodyStyles.marginLeft) + parseFloat(bodyStyles.marginRight) || 0 : 0;
8533
- const clippingStableScrollbarWidth = Math.abs(html.clientWidth - body.clientWidth - bodyMarginInline);
8534
- if (clippingStableScrollbarWidth <= SCROLLBAR_MAX) {
8535
- width -= clippingStableScrollbarWidth;
8536
- }
8537
- } else if (windowScrollbarX <= SCROLLBAR_MAX) {
8538
- // If the <body> scrollbar is on the left, the width needs to be extended
8539
- // by the scrollbar amount so there isn't extra space on the right.
8540
- width += windowScrollbarX;
8541
- }
8542
8515
  return {
8543
8516
  width,
8544
8517
  height,
@@ -8547,7 +8520,6 @@ function getViewportRect(element, strategy) {
8547
8520
  };
8548
8521
  }
8549
8522
 
8550
- const absoluteOrFixed = /*#__PURE__*/new Set(['absolute', 'fixed']);
8551
8523
  // Returns the inner client rect, subtracting scrollbars if present.
8552
8524
  function getInnerBoundingClientRect(element, strategy) {
8553
8525
  const clientRect = getBoundingClientRect(element, true, strategy === 'fixed');
@@ -8589,7 +8561,7 @@ function hasFixedPositionAncestor(element, stopNode) {
8589
8561
  if (parentNode === stopNode || !isElement(parentNode) || isLastTraversableNode(parentNode)) {
8590
8562
  return false;
8591
8563
  }
8592
- return getComputedStyle$1(parentNode).position === 'fixed' || hasFixedPositionAncestor(parentNode, stopNode);
8564
+ return getComputedStyle(parentNode).position === 'fixed' || hasFixedPositionAncestor(parentNode, stopNode);
8593
8565
  }
8594
8566
 
8595
8567
  // A "clipping ancestor" is an `overflow` element with the characteristic of
@@ -8602,17 +8574,17 @@ function getClippingElementAncestors(element, cache) {
8602
8574
  }
8603
8575
  let result = getOverflowAncestors(element, [], false).filter(el => isElement(el) && getNodeName(el) !== 'body');
8604
8576
  let currentContainingBlockComputedStyle = null;
8605
- const elementIsFixed = getComputedStyle$1(element).position === 'fixed';
8577
+ const elementIsFixed = getComputedStyle(element).position === 'fixed';
8606
8578
  let currentNode = elementIsFixed ? getParentNode(element) : element;
8607
8579
 
8608
8580
  // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block
8609
8581
  while (isElement(currentNode) && !isLastTraversableNode(currentNode)) {
8610
- const computedStyle = getComputedStyle$1(currentNode);
8582
+ const computedStyle = getComputedStyle(currentNode);
8611
8583
  const currentNodeIsContaining = isContainingBlock(currentNode);
8612
8584
  if (!currentNodeIsContaining && computedStyle.position === 'fixed') {
8613
8585
  currentContainingBlockComputedStyle = null;
8614
8586
  }
8615
- const shouldDropCurrentNode = elementIsFixed ? !currentNodeIsContaining && !currentContainingBlockComputedStyle : !currentNodeIsContaining && computedStyle.position === 'static' && !!currentContainingBlockComputedStyle && absoluteOrFixed.has(currentContainingBlockComputedStyle.position) || isOverflowElement(currentNode) && !currentNodeIsContaining && hasFixedPositionAncestor(element, currentNode);
8587
+ const shouldDropCurrentNode = elementIsFixed ? !currentNodeIsContaining && !currentContainingBlockComputedStyle : !currentNodeIsContaining && computedStyle.position === 'static' && !!currentContainingBlockComputedStyle && ['absolute', 'fixed'].includes(currentContainingBlockComputedStyle.position) || isOverflowElement(currentNode) && !currentNodeIsContaining && hasFixedPositionAncestor(element, currentNode);
8616
8588
  if (shouldDropCurrentNode) {
8617
8589
  // Drop non-containing blocks.
8618
8590
  result = result.filter(ancestor => ancestor !== currentNode);
@@ -8708,11 +8680,11 @@ function getRectRelativeToOffsetParent(element, offsetParent, strategy) {
8708
8680
  }
8709
8681
 
8710
8682
  function isStaticPositioned(element) {
8711
- return getComputedStyle$1(element).position === 'static';
8683
+ return getComputedStyle(element).position === 'static';
8712
8684
  }
8713
8685
 
8714
8686
  function getTrueOffsetParent(element, polyfill) {
8715
- if (!isHTMLElement(element) || getComputedStyle$1(element).position === 'fixed') {
8687
+ if (!isHTMLElement(element) || getComputedStyle(element).position === 'fixed') {
8716
8688
  return null;
8717
8689
  }
8718
8690
  if (polyfill) {
@@ -8773,7 +8745,7 @@ const getElementRects = async function (data) {
8773
8745
  };
8774
8746
 
8775
8747
  function isRTL(element) {
8776
- return getComputedStyle$1(element).direction === 'rtl';
8748
+ return getComputedStyle(element).direction === 'rtl';
8777
8749
  }
8778
8750
 
8779
8751
  const platform = {
@@ -9413,7 +9385,7 @@ const FloatingArrow = /*#__PURE__*/React.forwardRef(function FloatingArrow(props
9413
9385
  // https://github.com/floating-ui/floating-ui/issues/2932
9414
9386
  index$1(() => {
9415
9387
  if (!floating) return;
9416
- const isRTL = getComputedStyle$1(floating).direction === 'rtl';
9388
+ const isRTL = getComputedStyle(floating).direction === 'rtl';
9417
9389
  if (isRTL) {
9418
9390
  setIsRTL(true);
9419
9391
  }
@@ -9672,7 +9644,7 @@ function useFloating(options) {
9672
9644
  }
9673
9645
 
9674
9646
  /*!
9675
- react-datepicker v8.8.0
9647
+ react-datepicker v8.4.0
9676
9648
  https://github.com/Hacker0x01/react-datepicker
9677
9649
  Released under the MIT License.
9678
9650
  */
@@ -9907,13 +9879,12 @@ var DATE_RANGE_SEPARATOR = " - ";
9907
9879
  * @returns - The formatted date range or an empty string.
9908
9880
  */
9909
9881
  function safeDateRangeFormat(startDate, endDate, props) {
9910
- if (!startDate && !endDate) {
9882
+ if (!startDate) {
9911
9883
  return "";
9912
9884
  }
9913
- var formattedStartDate = startDate ? safeDateFormat(startDate, props) : "";
9885
+ var formattedStartDate = safeDateFormat(startDate, props);
9914
9886
  var formattedEndDate = endDate ? safeDateFormat(endDate, props) : "";
9915
- var dateRangeSeparator = props.rangeSeparator || DATE_RANGE_SEPARATOR;
9916
- return "".concat(formattedStartDate).concat(dateRangeSeparator).concat(formattedEndDate);
9887
+ return "".concat(formattedStartDate).concat(DATE_RANGE_SEPARATOR).concat(formattedEndDate);
9917
9888
  }
9918
9889
  /**
9919
9890
  * Safely formats multiple dates.
@@ -10249,10 +10220,7 @@ function getQuarterShortInLocale(quarter, locale) {
10249
10220
  * @returns - Returns true if the day is disabled, false otherwise.
10250
10221
  */
10251
10222
  function isDayDisabled(day, _a) {
10252
- 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;
10253
- if (disabled) {
10254
- return true;
10255
- }
10223
+ 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;
10256
10224
  return (isOutOfBounds(day, { minDate: minDate, maxDate: maxDate }) ||
10257
10225
  (excludeDates &&
10258
10226
  excludeDates.some(function (excludeDate) {
@@ -10352,10 +10320,7 @@ function isMonthYearDisabled(date, _a) {
10352
10320
  false);
10353
10321
  }
10354
10322
  function isQuarterDisabled(quarter, _a) {
10355
- var _b = _a === void 0 ? {} : _a, minDate = _b.minDate, maxDate = _b.maxDate, excludeDates = _b.excludeDates, includeDates = _b.includeDates, filterDate = _b.filterDate, disabled = _b.disabled;
10356
- if (disabled) {
10357
- return true;
10358
- }
10323
+ var _b = _a === void 0 ? {} : _a, minDate = _b.minDate, maxDate = _b.maxDate, excludeDates = _b.excludeDates, includeDates = _b.includeDates, filterDate = _b.filterDate;
10359
10324
  return (isOutOfBounds(quarter, { minDate: minDate, maxDate: maxDate }) ||
10360
10325
  (excludeDates === null || excludeDates === void 0 ? void 0 : excludeDates.some(function (excludeDate) {
10361
10326
  return isSameQuarter(quarter, excludeDate instanceof Date ? excludeDate : excludeDate.date);
@@ -10377,10 +10342,7 @@ function isYearInRange(year, start, end) {
10377
10342
  return startYear <= year && endYear >= year;
10378
10343
  }
10379
10344
  function isYearDisabled(year, _a) {
10380
- var _b = _a === void 0 ? {} : _a, minDate = _b.minDate, maxDate = _b.maxDate, excludeDates = _b.excludeDates, includeDates = _b.includeDates, filterDate = _b.filterDate, disabled = _b.disabled;
10381
- if (disabled) {
10382
- return true;
10383
- }
10345
+ var _b = _a === void 0 ? {} : _a, minDate = _b.minDate, maxDate = _b.maxDate, excludeDates = _b.excludeDates, includeDates = _b.includeDates, filterDate = _b.filterDate;
10384
10346
  var date = new Date(year, 0, 1);
10385
10347
  return (isOutOfBounds(date, {
10386
10348
  minDate: minDate ? startOfYear(minDate) : undefined,
@@ -10970,7 +10932,6 @@ var Day = /** @class */ (function (_super) {
10970
10932
  includeDateIntervals: _this.props.includeDateIntervals,
10971
10933
  includeDates: _this.props.includeDates,
10972
10934
  filterDate: _this.props.filterDate,
10973
- disabled: _this.props.disabled,
10974
10935
  });
10975
10936
  };
10976
10937
  _this.isExcluded = function () {
@@ -11025,7 +10986,7 @@ var Day = /** @class */ (function (_super) {
11025
10986
  };
11026
10987
  _this.isInSelectingRange = function () {
11027
10988
  var _a;
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;
10989
+ var _b = _this.props, day = _b.day, selectsStart = _b.selectsStart, selectsEnd = _b.selectsEnd, selectsRange = _b.selectsRange, selectsDisabledDaysInRange = _b.selectsDisabledDaysInRange, startDate = _b.startDate, endDate = _b.endDate;
11029
10990
  var selectingDate = (_a = _this.props.selectingDate) !== null && _a !== void 0 ? _a : _this.props.preSelection;
11030
10991
  if (!(selectsStart || selectsEnd || selectsRange) ||
11031
10992
  !selectingDate ||
@@ -11042,16 +11003,11 @@ var Day = /** @class */ (function (_super) {
11042
11003
  (isAfter(selectingDate, startDate) || isEqual(selectingDate, startDate))) {
11043
11004
  return isDayInRange(day, startDate, selectingDate);
11044
11005
  }
11045
- if (selectsRange && startDate && !endDate) {
11046
- if (isEqual(selectingDate, startDate)) {
11047
- return isDayInRange(day, startDate, selectingDate);
11048
- }
11049
- if (isAfter(selectingDate, startDate)) {
11050
- return isDayInRange(day, startDate, selectingDate);
11051
- }
11052
- if (swapRange && isBefore(selectingDate, startDate)) {
11053
- return isDayInRange(day, selectingDate, startDate);
11054
- }
11006
+ if (selectsRange &&
11007
+ startDate &&
11008
+ !endDate &&
11009
+ (isAfter(selectingDate, startDate) || isEqual(selectingDate, startDate))) {
11010
+ return isDayInRange(day, startDate, selectingDate);
11055
11011
  }
11056
11012
  return false;
11057
11013
  };
@@ -11060,33 +11016,28 @@ var Day = /** @class */ (function (_super) {
11060
11016
  if (!_this.isInSelectingRange()) {
11061
11017
  return false;
11062
11018
  }
11063
- var _b = _this.props, day = _b.day, startDate = _b.startDate, selectsStart = _b.selectsStart, swapRange = _b.swapRange, selectsRange = _b.selectsRange;
11019
+ var _b = _this.props, day = _b.day, startDate = _b.startDate, selectsStart = _b.selectsStart;
11064
11020
  var selectingDate = (_a = _this.props.selectingDate) !== null && _a !== void 0 ? _a : _this.props.preSelection;
11065
11021
  if (selectsStart) {
11066
11022
  return isSameDay(day, selectingDate);
11067
11023
  }
11068
- if (selectsRange && swapRange && startDate && selectingDate) {
11069
- return isSameDay(day, isBefore(selectingDate, startDate) ? selectingDate : startDate);
11024
+ else {
11025
+ return isSameDay(day, startDate);
11070
11026
  }
11071
- return isSameDay(day, startDate);
11072
11027
  };
11073
11028
  _this.isSelectingRangeEnd = function () {
11074
11029
  var _a;
11075
11030
  if (!_this.isInSelectingRange()) {
11076
11031
  return false;
11077
11032
  }
11078
- var _b = _this.props, day = _b.day, endDate = _b.endDate, selectsEnd = _b.selectsEnd, selectsRange = _b.selectsRange, swapRange = _b.swapRange, startDate = _b.startDate;
11033
+ var _b = _this.props, day = _b.day, endDate = _b.endDate, selectsEnd = _b.selectsEnd, selectsRange = _b.selectsRange;
11079
11034
  var selectingDate = (_a = _this.props.selectingDate) !== null && _a !== void 0 ? _a : _this.props.preSelection;
11080
- if (selectsEnd) {
11035
+ if (selectsEnd || selectsRange) {
11081
11036
  return isSameDay(day, selectingDate);
11082
11037
  }
11083
- if (selectsRange && swapRange && startDate && selectingDate) {
11084
- return isSameDay(day, isBefore(selectingDate, startDate) ? startDate : selectingDate);
11085
- }
11086
- if (selectsRange) {
11087
- return isSameDay(day, selectingDate);
11038
+ else {
11039
+ return isSameDay(day, endDate);
11088
11040
  }
11089
- return isSameDay(day, endDate);
11090
11041
  };
11091
11042
  _this.isRangeStart = function () {
11092
11043
  var _a = _this.props, day = _a.day, startDate = _a.startDate, endDate = _a.endDate;
@@ -11207,7 +11158,7 @@ var Day = /** @class */ (function (_super) {
11207
11158
  };
11208
11159
  _this.render = function () { return (
11209
11160
  // TODO: Use <option> instead of the "option" role to ensure accessibility across all devices.
11210
- React__default.createElement("div", { ref: _this.dayEl, className: _this.getClassNames(_this.props.day), onKeyDown: _this.handleOnKeyDown, onClick: _this.handleClick, onMouseEnter: !_this.props.usePointerEvent ? _this.handleMouseEnter : undefined, onPointerEnter: _this.props.usePointerEvent ? _this.handleMouseEnter : undefined, tabIndex: _this.getTabIndex(), "aria-label": _this.getAriaLabel(), role: "gridcell", title: _this.getTitle(), "aria-disabled": _this.isDisabled(), "aria-current": _this.isCurrentDay() ? "date" : undefined, "aria-selected": _this.isSelected() || _this.isInRange() },
11161
+ React__default.createElement("div", { ref: _this.dayEl, className: _this.getClassNames(_this.props.day), onKeyDown: _this.handleOnKeyDown, onClick: _this.handleClick, onMouseEnter: !_this.props.usePointerEvent ? _this.handleMouseEnter : undefined, onPointerEnter: _this.props.usePointerEvent ? _this.handleMouseEnter : undefined, tabIndex: _this.getTabIndex(), "aria-label": _this.getAriaLabel(), role: "option", title: _this.getTitle(), "aria-disabled": _this.isDisabled(), "aria-current": _this.isCurrentDay() ? "date" : undefined, "aria-selected": _this.isSelected() || _this.isInRange() },
11211
11162
  _this.renderDayContents(),
11212
11163
  _this.getTitle() !== "" && (React__default.createElement("span", { className: "overlay" }, _this.getTitle())))); };
11213
11164
  return _this;
@@ -11345,7 +11296,7 @@ var WeekNumber = /** @class */ (function (_super) {
11345
11296
  "react-datepicker__week-number--clickable": !!onClick && !isWeekDisabled,
11346
11297
  "react-datepicker__week-number--selected": !!onClick && isSameDay(this.props.date, this.props.selected),
11347
11298
  };
11348
- return (React__default.createElement("div", { ref: this.weekNumberEl, className: clsx(weekNumberClasses), "aria-label": "".concat(ariaLabelPrefix, " ").concat(this.props.weekNumber), onClick: this.handleClick, onKeyDown: this.handleOnKeyDown, tabIndex: this.getTabIndex(), role: "gridcell" }, weekNumber));
11299
+ return (React__default.createElement("div", { ref: this.weekNumberEl, className: clsx(weekNumberClasses), "aria-label": "".concat(ariaLabelPrefix, " ").concat(this.props.weekNumber), onClick: this.handleClick, onKeyDown: this.handleOnKeyDown, tabIndex: this.getTabIndex() }, weekNumber));
11349
11300
  };
11350
11301
  return WeekNumber;
11351
11302
  }(Component));
@@ -11454,10 +11405,7 @@ var Week = /** @class */ (function (_super) {
11454
11405
  "react-datepicker__week--selected": isSameDay(this.startOfWeek(), this.props.selected),
11455
11406
  "react-datepicker__week--keyboard-selected": this.isKeyboardSelected(),
11456
11407
  };
11457
- var customWeekClassName = this.props.weekClassName
11458
- ? this.props.weekClassName(this.startOfWeek())
11459
- : undefined;
11460
- return (React__default.createElement("div", { className: clsx(weekNumberClasses, customWeekClassName), role: "row" }, this.renderDays()));
11408
+ return React__default.createElement("div", { className: clsx(weekNumberClasses) }, this.renderDays());
11461
11409
  };
11462
11410
  return Week;
11463
11411
  }(Component));
@@ -11618,7 +11566,6 @@ var Month$1 = /** @class */ (function (_super) {
11618
11566
  includeDateIntervals: _this.props.includeDateIntervals,
11619
11567
  includeDates: _this.props.includeDates,
11620
11568
  filterDate: _this.props.filterDate,
11621
- disabled: _this.props.disabled,
11622
11569
  });
11623
11570
  };
11624
11571
  _this.isExcluded = function (day) {
@@ -11986,14 +11933,8 @@ var Month$1 = /** @class */ (function (_super) {
11986
11933
  };
11987
11934
  _this.isMonthDisabledForLabelDate = function (month) {
11988
11935
  var _a;
11989
- var _b = _this.props, day = _b.day, disabled = _b.disabled, minDate = _b.minDate, maxDate = _b.maxDate, excludeDates = _b.excludeDates, includeDates = _b.includeDates;
11936
+ var _b = _this.props, day = _b.day, minDate = _b.minDate, maxDate = _b.maxDate, excludeDates = _b.excludeDates, includeDates = _b.includeDates;
11990
11937
  var labelDate = setMonth(day, month);
11991
- if (disabled) {
11992
- return {
11993
- isDisabled: true,
11994
- labelDate: setMonth(day, month),
11995
- };
11996
- }
11997
11938
  return {
11998
11939
  isDisabled: (_a = ((minDate || maxDate || excludeDates || includeDates) &&
11999
11940
  isMonthDisabled(labelDate, _this.props))) !== null && _a !== void 0 ? _a : false,
@@ -12064,13 +12005,8 @@ var Month$1 = /** @class */ (function (_super) {
12064
12005
  return "".concat(prefix, " ").concat(formatDate(labelDate, "MMMM yyyy", locale));
12065
12006
  };
12066
12007
  _this.getQuarterClassNames = function (q) {
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;
12068
- var isDisabled = (minDate ||
12069
- maxDate ||
12070
- excludeDates ||
12071
- includeDates ||
12072
- filterDate ||
12073
- disabled) &&
12008
+ 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;
12009
+ var isDisabled = (minDate || maxDate || excludeDates || includeDates || filterDate) &&
12074
12010
  isQuarterDisabled(setQuarter(day, q), _this.props);
12075
12011
  return clsx("react-datepicker__quarter-text", "react-datepicker__quarter-".concat(q), {
12076
12012
  "react-datepicker__quarter-text--disabled": isDisabled,
@@ -12159,14 +12095,11 @@ var Month$1 = /** @class */ (function (_super) {
12159
12095
  var formattedAriaLabelPrefix = ariaLabelPrefix
12160
12096
  ? ariaLabelPrefix.trim() + " "
12161
12097
  : "";
12162
- var shouldUseListboxRole = showMonthYearPicker || showQuarterYearPicker;
12163
- if (shouldUseListboxRole) {
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()));
12165
- }
12166
- // For regular calendar view, use table structure
12167
- return (React__default.createElement("div", { role: "table" },
12168
- this.props.dayNamesHeader && (React__default.createElement("div", { role: "rowgroup" }, this.props.dayNamesHeader)),
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())));
12098
+ 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
12099
+ ? this.renderMonths()
12100
+ : showQuarterYearPicker
12101
+ ? this.renderQuarters()
12102
+ : this.renderWeeks()));
12170
12103
  };
12171
12104
  return Month;
12172
12105
  }(Component));
@@ -12175,40 +12108,11 @@ var MonthDropdownOptions = /** @class */ (function (_super) {
12175
12108
  __extends(MonthDropdownOptions, _super);
12176
12109
  function MonthDropdownOptions() {
12177
12110
  var _this = _super !== null && _super.apply(this, arguments) || this;
12178
- _this.monthOptionButtonsRef = {};
12179
12111
  _this.isSelectedMonth = function (i) { return _this.props.month === i; };
12180
- _this.handleOptionKeyDown = function (i, e) {
12181
- var _a;
12182
- switch (e.key) {
12183
- case "Enter":
12184
- e.preventDefault();
12185
- _this.onChange(i);
12186
- break;
12187
- case "Escape":
12188
- e.preventDefault();
12189
- _this.props.onCancel();
12190
- break;
12191
- case "ArrowUp":
12192
- case "ArrowDown": {
12193
- e.preventDefault();
12194
- var newMonth = (i + (e.key === "ArrowUp" ? -1 : 1) + _this.props.monthNames.length) %
12195
- _this.props.monthNames.length;
12196
- (_a = _this.monthOptionButtonsRef[newMonth]) === null || _a === void 0 ? void 0 : _a.focus();
12197
- break;
12198
- }
12199
- }
12200
- };
12201
12112
  _this.renderOptions = function () {
12202
- // Clear refs to prevent memory leaks on re-render
12203
- _this.monthOptionButtonsRef = {};
12204
- return _this.props.monthNames.map(function (month, i) { return (React__default.createElement("div", { ref: function (el) {
12205
- _this.monthOptionButtonsRef[i] = el;
12206
- if (_this.isSelectedMonth(i)) {
12207
- el === null || el === void 0 ? void 0 : el.focus();
12208
- }
12209
- }, role: "button", tabIndex: 0, className: _this.isSelectedMonth(i)
12113
+ return _this.props.monthNames.map(function (month, i) { return (React__default.createElement("div", { className: _this.isSelectedMonth(i)
12210
12114
  ? "react-datepicker__month-option react-datepicker__month-option--selected_month"
12211
- : "react-datepicker__month-option", key: month, onClick: _this.onChange.bind(_this, i), onKeyDown: _this.handleOptionKeyDown.bind(_this, i), "aria-selected": _this.isSelectedMonth(i) ? "true" : undefined },
12115
+ : "react-datepicker__month-option", key: month, onClick: _this.onChange.bind(_this, i), "aria-selected": _this.isSelectedMonth(i) ? "true" : undefined },
12212
12116
  _this.isSelectedMonth(i) ? (React__default.createElement("span", { className: "react-datepicker__month-option--selected" }, "\u2713")) : (""),
12213
12117
  month)); });
12214
12118
  };
@@ -12233,7 +12137,7 @@ var MonthDropdown = /** @class */ (function (_super) {
12233
12137
  return monthNames.map(function (m, i) { return (React__default.createElement("option", { key: m, value: i }, m)); });
12234
12138
  };
12235
12139
  _this.renderSelectMode = function (monthNames) { return (React__default.createElement("select", { value: _this.props.month, className: "react-datepicker__month-select", onChange: function (e) { return _this.onChange(parseInt(e.target.value)); } }, _this.renderSelectOptions(monthNames))); };
12236
- _this.renderReadView = function (visible, monthNames) { return (React__default.createElement("button", { key: "read", type: "button", style: { visibility: visible ? "visible" : "hidden" }, className: "react-datepicker__month-read-view", onClick: _this.toggleDropdown },
12140
+ _this.renderReadView = function (visible, monthNames) { return (React__default.createElement("div", { key: "read", style: { visibility: visible ? "visible" : "hidden" }, className: "react-datepicker__month-read-view", onClick: _this.toggleDropdown },
12237
12141
  React__default.createElement("span", { className: "react-datepicker__month-read-view--down-arrow" }),
12238
12142
  React__default.createElement("span", { className: "react-datepicker__month-read-view--selected-month" }, monthNames[_this.props.month]))); };
12239
12143
  _this.renderDropdown = function (monthNames) { return (React__default.createElement(MonthDropdownOptions, _assign({ key: "dropdown" }, _this.props, { monthNames: monthNames, onChange: _this.onChange, onCancel: _this.toggleDropdown }))); };
@@ -12721,20 +12625,19 @@ var Year$1 = /** @class */ (function (_super) {
12721
12625
  return isSameYear(_year, endDate !== null && endDate !== void 0 ? endDate : null);
12722
12626
  };
12723
12627
  _this.isKeyboardSelected = function (y) {
12724
- if (_this.props.disabledKeyboardNavigation ||
12725
- _this.props.date === undefined ||
12628
+ if (_this.props.date === undefined ||
12629
+ _this.props.selected == null ||
12726
12630
  _this.props.preSelection == null) {
12727
12631
  return;
12728
12632
  }
12729
- var _a = _this.props, minDate = _a.minDate, maxDate = _a.maxDate, excludeDates = _a.excludeDates, includeDates = _a.includeDates, filterDate = _a.filterDate, selected = _a.selected;
12633
+ var _a = _this.props, minDate = _a.minDate, maxDate = _a.maxDate, excludeDates = _a.excludeDates, includeDates = _a.includeDates, filterDate = _a.filterDate;
12730
12634
  var date = getStartOfYear(setYear(_this.props.date, y));
12731
12635
  var isDisabled = (minDate || maxDate || excludeDates || includeDates || filterDate) &&
12732
12636
  isYearDisabled(y, _this.props);
12733
- var isSelectedDay = !!selected && isSameDay(date, getStartOfYear(selected));
12734
- var isKeyboardSelectedDay = isSameDay(date, getStartOfYear(_this.props.preSelection));
12735
- return (!_this.props.inline &&
12736
- !isSelectedDay &&
12737
- isKeyboardSelectedDay &&
12637
+ return (!_this.props.disabledKeyboardNavigation &&
12638
+ !_this.props.inline &&
12639
+ !isSameDay(date, getStartOfYear(_this.props.selected)) &&
12640
+ isSameDay(date, getStartOfYear(_this.props.preSelection)) &&
12738
12641
  !isDisabled);
12739
12642
  };
12740
12643
  _this.isSelectedYear = function (year) {
@@ -12829,15 +12732,10 @@ var Year$1 = /** @class */ (function (_super) {
12829
12732
  handleOnKeyDown && handleOnKeyDown(event);
12830
12733
  };
12831
12734
  _this.getYearClassNames = function (y) {
12832
- 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;
12735
+ 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;
12833
12736
  return clsx("react-datepicker__year-text", "react-datepicker__year-".concat(y), date ? yearClassName === null || yearClassName === void 0 ? void 0 : yearClassName(setYear(date, y)) : undefined, {
12834
12737
  "react-datepicker__year-text--selected": _this.isSelectedYear(y),
12835
- "react-datepicker__year-text--disabled": (minDate ||
12836
- maxDate ||
12837
- excludeDates ||
12838
- includeDates ||
12839
- filterDate ||
12840
- disabled) &&
12738
+ "react-datepicker__year-text--disabled": (minDate || maxDate || excludeDates || includeDates || filterDate) &&
12841
12739
  isYearDisabled(y, _this.props),
12842
12740
  "react-datepicker__year-text--keyboard-selected": _this.isKeyboardSelected(y),
12843
12741
  "react-datepicker__year-text--range-start": _this.isRangeStart(y),
@@ -12925,42 +12823,11 @@ var YearDropdownOptions = /** @class */ (function (_super) {
12925
12823
  __extends(YearDropdownOptions, _super);
12926
12824
  function YearDropdownOptions(props) {
12927
12825
  var _this = _super.call(this, props) || this;
12928
- _this.yearOptionButtonsRef = {};
12929
- _this.handleOptionKeyDown = function (year, e) {
12930
- var _a;
12931
- switch (e.key) {
12932
- case "Enter":
12933
- e.preventDefault();
12934
- _this.onChange(year);
12935
- break;
12936
- case "Escape":
12937
- e.preventDefault();
12938
- _this.props.onCancel();
12939
- break;
12940
- case "ArrowUp":
12941
- case "ArrowDown": {
12942
- e.preventDefault();
12943
- var newYear = year + (e.key === "ArrowUp" ? 1 : -1);
12944
- // Add bounds checking to ensure the year exists in our refs
12945
- if (_this.yearOptionButtonsRef[newYear]) {
12946
- (_a = _this.yearOptionButtonsRef[newYear]) === null || _a === void 0 ? void 0 : _a.focus();
12947
- }
12948
- break;
12949
- }
12950
- }
12951
- };
12952
12826
  _this.renderOptions = function () {
12953
- // Clear refs to prevent memory leaks on re-render
12954
- _this.yearOptionButtonsRef = {};
12955
12827
  var selectedYear = _this.props.year;
12956
- var options = _this.state.yearsList.map(function (year) { return (React__default.createElement("div", { ref: function (el) {
12957
- _this.yearOptionButtonsRef[year] = el;
12958
- if (year === selectedYear) {
12959
- el === null || el === void 0 ? void 0 : el.focus();
12960
- }
12961
- }, role: "button", tabIndex: 0, className: selectedYear === year
12828
+ var options = _this.state.yearsList.map(function (year) { return (React__default.createElement("div", { className: selectedYear === year
12962
12829
  ? "react-datepicker__year-option react-datepicker__year-option--selected_year"
12963
- : "react-datepicker__year-option", key: year, onClick: _this.onChange.bind(_this, year), onKeyDown: _this.handleOptionKeyDown.bind(_this, year), "aria-selected": selectedYear === year ? "true" : undefined },
12830
+ : "react-datepicker__year-option", key: year, onClick: _this.onChange.bind(_this, year), "aria-selected": selectedYear === year ? "true" : undefined },
12964
12831
  selectedYear === year ? (React__default.createElement("span", { className: "react-datepicker__year-option--selected" }, "\u2713")) : (""),
12965
12832
  year)); });
12966
12833
  var minYear = _this.props.minDate ? getYear(_this.props.minDate) : null;
@@ -13055,7 +12922,9 @@ var YearDropdown = /** @class */ (function (_super) {
13055
12922
  _this.onChange(parseInt(event.target.value));
13056
12923
  };
13057
12924
  _this.renderSelectMode = function () { return (React__default.createElement("select", { value: _this.props.year, className: "react-datepicker__year-select", onChange: _this.onSelectChange }, _this.renderSelectOptions())); };
13058
- _this.renderReadView = function (visible) { return (React__default.createElement("button", { key: "read", type: "button", style: { visibility: visible ? "visible" : "hidden" }, className: "react-datepicker__year-read-view", onClick: _this.toggleDropdown },
12925
+ _this.renderReadView = function (visible) { return (React__default.createElement("div", { key: "read", style: { visibility: visible ? "visible" : "hidden" }, className: "react-datepicker__year-read-view", onClick: function (event) {
12926
+ return _this.toggleDropdown(event);
12927
+ } },
13059
12928
  React__default.createElement("span", { className: "react-datepicker__year-read-view--down-arrow" }),
13060
12929
  React__default.createElement("span", { className: "react-datepicker__year-read-view--selected-year" }, _this.props.year))); };
13061
12930
  _this.renderDropdown = function () { return (React__default.createElement(YearDropdownOptions, _assign({ key: "dropdown" }, _this.props, { onChange: _this.onChange, onCancel: _this.toggleDropdown }))); };
@@ -13117,7 +12986,6 @@ var DROPDOWN_FOCUS_CLASSNAMES = [
13117
12986
  "react-datepicker__month-select",
13118
12987
  "react-datepicker__month-year-select",
13119
12988
  ];
13120
- var OUTSIDE_CLICK_IGNORE_CLASS = "react-datepicker-ignore-onclickoutside";
13121
12989
  var isDropdownSelect = function (element) {
13122
12990
  var classNames = (element.className || "").split(/\s+/);
13123
12991
  return DROPDOWN_FOCUS_CLASSNAMES.some(function (testClassname) { return classNames.indexOf(testClassname) >= 0; });
@@ -13266,13 +13134,10 @@ var Calendar = /** @class */ (function (_super) {
13266
13134
  };
13267
13135
  _this.header = function (date) {
13268
13136
  if (date === void 0) { date = _this.state.date; }
13269
- var disabled = _this.props.disabled;
13270
13137
  var startOfWeek = getStartOfWeek(date, _this.props.locale, _this.props.calendarStartDay);
13271
13138
  var dayNames = [];
13272
13139
  if (_this.props.showWeekNumbers) {
13273
- dayNames.push(React__default.createElement("div", { key: "W", className: "react-datepicker__day-name ".concat(disabled ? "react-datepicker__day-name--disabled" : ""), role: "columnheader" },
13274
- React__default.createElement("span", { className: "react-datepicker__sr-only" }, "Week number"),
13275
- React__default.createElement("span", { "aria-hidden": "true" }, _this.props.weekLabel || "#")));
13140
+ dayNames.push(React__default.createElement("div", { key: "W", className: "react-datepicker__day-name" }, _this.props.weekLabel || "#"));
13276
13141
  }
13277
13142
  return dayNames.concat([0, 1, 2, 3, 4, 5, 6].map(function (offset) {
13278
13143
  var day = addDays(startOfWeek, offset);
@@ -13280,9 +13145,7 @@ var Calendar = /** @class */ (function (_super) {
13280
13145
  var weekDayClassName = _this.props.weekDayClassName
13281
13146
  ? _this.props.weekDayClassName(day)
13282
13147
  : undefined;
13283
- return (React__default.createElement("div", { key: offset, role: "columnheader", className: clsx("react-datepicker__day-name", weekDayClassName, disabled ? "react-datepicker__day-name--disabled" : "") },
13284
- React__default.createElement("span", { className: "react-datepicker__sr-only" }, formatDate(day, "EEEE", _this.props.locale)),
13285
- React__default.createElement("span", { "aria-hidden": "true" }, weekDayName)));
13148
+ return (React__default.createElement("div", { key: offset, "aria-label": formatDate(day, "EEEE", _this.props.locale), className: clsx("react-datepicker__day-name", weekDayClassName) }, weekDayName));
13286
13149
  }));
13287
13150
  };
13288
13151
  _this.formatWeekday = function (day, locale) {
@@ -13320,9 +13183,6 @@ var Calendar = /** @class */ (function (_super) {
13320
13183
  var fromMonthDate = subMonths(_this.state.date, monthSelectedIn);
13321
13184
  var allPrevDaysDisabled;
13322
13185
  switch (true) {
13323
- case _this.props.disabled:
13324
- allPrevDaysDisabled = true;
13325
- break;
13326
13186
  case _this.props.showMonthYearPicker:
13327
13187
  allPrevDaysDisabled = yearDisabledBefore(_this.state.date, _this.props);
13328
13188
  break;
@@ -13390,9 +13250,6 @@ var Calendar = /** @class */ (function (_super) {
13390
13250
  }
13391
13251
  var allNextDaysDisabled;
13392
13252
  switch (true) {
13393
- case _this.props.disabled:
13394
- allNextDaysDisabled = true;
13395
- break;
13396
13253
  case _this.props.showMonthYearPicker:
13397
13254
  allNextDaysDisabled = yearDisabledAfter(_this.state.date, _this.props);
13398
13255
  break;
@@ -13493,7 +13350,6 @@ var Calendar = /** @class */ (function (_super) {
13493
13350
  }
13494
13351
  return (React__default.createElement("div", { className: "react-datepicker__today-button", onClick: _this.handleTodayButtonClick }, _this.props.todayButton));
13495
13352
  };
13496
- _this.renderDayNamesHeader = function (monthDate) { return (React__default.createElement("div", { className: "react-datepicker__day-names", role: "row" }, _this.header(monthDate))); };
13497
13353
  _this.renderDefaultHeader = function (_a) {
13498
13354
  var monthDate = _a.monthDate, i = _a.i;
13499
13355
  return (React__default.createElement("div", { className: "react-datepicker__header ".concat(_this.props.showTimeSelect
@@ -13503,7 +13359,8 @@ var Calendar = /** @class */ (function (_super) {
13503
13359
  React__default.createElement("div", { className: "react-datepicker__header__dropdown react-datepicker__header__dropdown--".concat(_this.props.dropdownMode), onFocus: _this.handleDropdownFocus },
13504
13360
  _this.renderMonthDropdown(i !== 0),
13505
13361
  _this.renderMonthYearDropdown(i !== 0),
13506
- _this.renderYearDropdown(i !== 0))));
13362
+ _this.renderYearDropdown(i !== 0)),
13363
+ React__default.createElement("div", { className: "react-datepicker__day-names" }, _this.header(monthDate))));
13507
13364
  };
13508
13365
  _this.renderCustomHeader = function (headerArgs) {
13509
13366
  var _a, _b;
@@ -13512,20 +13369,16 @@ var Calendar = /** @class */ (function (_super) {
13512
13369
  _this.props.showTimeSelectOnly) {
13513
13370
  return null;
13514
13371
  }
13515
- var _c = _this.props, showYearPicker = _c.showYearPicker, yearItemNumber = _c.yearItemNumber;
13516
- var visibleYearsRange;
13517
- if (showYearPicker) {
13518
- var _d = getYearsPeriod(monthDate, yearItemNumber), startYear = _d.startPeriod, endYear = _d.endPeriod;
13519
- visibleYearsRange = {
13520
- startYear: startYear,
13521
- endYear: endYear,
13522
- };
13523
- }
13524
13372
  var prevMonthButtonDisabled = monthDisabledBefore(_this.state.date, _this.props);
13525
13373
  var nextMonthButtonDisabled = monthDisabledAfter(_this.state.date, _this.props);
13526
13374
  var prevYearButtonDisabled = yearDisabledBefore(_this.state.date, _this.props);
13527
13375
  var nextYearButtonDisabled = yearDisabledAfter(_this.state.date, _this.props);
13528
- return (React__default.createElement("div", { className: "react-datepicker__header react-datepicker__header--custom", onFocus: _this.props.onDropdownFocus }, (_b = (_a = _this.props).renderCustomHeader) === null || _b === void 0 ? void 0 : _b.call(_a, _assign(_assign(_assign({}, _this.state), (showYearPicker && { visibleYearsRange: visibleYearsRange })), { customHeaderCount: i, monthDate: monthDate, changeMonth: _this.changeMonth, changeYear: _this.changeYear, decreaseMonth: _this.decreaseMonth, increaseMonth: _this.increaseMonth, decreaseYear: _this.decreaseYear, increaseYear: _this.increaseYear, prevMonthButtonDisabled: prevMonthButtonDisabled, nextMonthButtonDisabled: nextMonthButtonDisabled, prevYearButtonDisabled: prevYearButtonDisabled, nextYearButtonDisabled: nextYearButtonDisabled }))));
13376
+ var showDayNames = !_this.props.showMonthYearPicker &&
13377
+ !_this.props.showQuarterYearPicker &&
13378
+ !_this.props.showYearPicker;
13379
+ return (React__default.createElement("div", { className: "react-datepicker__header react-datepicker__header--custom", onFocus: _this.props.onDropdownFocus }, (_b = (_a = _this.props).renderCustomHeader) === null || _b === void 0 ? void 0 :
13380
+ _b.call(_a, _assign(_assign({}, _this.state), { customHeaderCount: i, monthDate: monthDate, changeMonth: _this.changeMonth, changeYear: _this.changeYear, decreaseMonth: _this.decreaseMonth, increaseMonth: _this.increaseMonth, decreaseYear: _this.decreaseYear, increaseYear: _this.increaseYear, prevMonthButtonDisabled: prevMonthButtonDisabled, nextMonthButtonDisabled: nextMonthButtonDisabled, prevYearButtonDisabled: prevYearButtonDisabled, nextYearButtonDisabled: nextYearButtonDisabled })),
13381
+ showDayNames && (React__default.createElement("div", { className: "react-datepicker__day-names" }, _this.header(monthDate)))));
13529
13382
  };
13530
13383
  _this.renderYearHeader = function (_a) {
13531
13384
  var monthDate = _a.monthDate;
@@ -13573,7 +13426,7 @@ var Calendar = /** @class */ (function (_super) {
13573
13426
  _this.monthContainer = div !== null && div !== void 0 ? div : undefined;
13574
13427
  }, className: "react-datepicker__month-container" },
13575
13428
  _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) }))));
13429
+ 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 }))));
13577
13430
  }
13578
13431
  return monthList;
13579
13432
  };
@@ -13644,7 +13497,6 @@ var Calendar = /** @class */ (function (_super) {
13644
13497
  return {
13645
13498
  monthsShown: 1,
13646
13499
  forceShowMonthNavigation: false,
13647
- outsideClickIgnoreClass: OUTSIDE_CLICK_IGNORE_CLASS,
13648
13500
  timeCaption: "Time",
13649
13501
  previousYearButtonLabel: "Previous Year",
13650
13502
  nextYearButtonLabel: "Next Year",
@@ -13878,7 +13730,7 @@ var TabLoop = /** @class */ (function (_super) {
13878
13730
  * @returns A new component with floating behavior.
13879
13731
  */
13880
13732
  function withFloating(Component) {
13881
- function WithFloating(props) {
13733
+ var WithFloating = function (props) {
13882
13734
  var _a;
13883
13735
  var hidePopper = typeof props.hidePopper === "boolean" ? props.hidePopper : true;
13884
13736
  var arrowRef = useRef(null);
@@ -13889,35 +13741,51 @@ function withFloating(Component) {
13889
13741
  ], ((_a = props.popperModifiers) !== null && _a !== void 0 ? _a : []), true) }, props.popperProps));
13890
13742
  var componentProps = _assign(_assign({}, props), { hidePopper: hidePopper, popperProps: _assign(_assign({}, floatingProps), { arrowRef: arrowRef }) });
13891
13743
  return React__default.createElement(Component, _assign({}, componentProps));
13892
- }
13893
- WithFloating.displayName = "withFloating(".concat(Component.displayName || Component.name || "Component", ")");
13744
+ };
13894
13745
  return WithFloating;
13895
13746
  }
13896
13747
 
13897
13748
  // Exported for testing purposes
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;
13900
- var popper = undefined;
13901
- if (!hidePopper) {
13902
- var classes = clsx("react-datepicker-popper", className);
13903
- popper = (React__default.createElement(TabLoop, { enableTabLoop: enableTabLoop },
13904
- React__default.createElement("div", { ref: popperProps.refs.setFloating, style: popperProps.floatingStyles, className: classes, "data-placement": popperProps.placement, onKeyDown: popperOnKeyDown },
13905
- popperComponent,
13906
- showArrow && (React__default.createElement(FloatingArrow, { ref: popperProps.arrowRef, context: popperProps.context, fill: "currentColor", strokeWidth: 1, height: 8, width: 16, style: { transform: "translateY(-1px)" }, className: "react-datepicker__triangle" })))));
13907
- }
13908
- if (props.popperContainer) {
13909
- popper = createElement(props.popperContainer, {}, popper);
13910
- }
13911
- if (portalId && !hidePopper) {
13912
- popper = (React__default.createElement(Portal, { portalId: portalId, portalHost: portalHost }, popper));
13913
- }
13914
- var wrapperClasses = clsx("react-datepicker-wrapper", wrapperClassName);
13915
- return (React__default.createElement(React__default.Fragment, null,
13916
- React__default.createElement("div", { ref: popperProps.refs.setReference, className: wrapperClasses }, targetComponent),
13917
- popper));
13918
- };
13749
+ var PopperComponent = /** @class */ (function (_super) {
13750
+ __extends(PopperComponent, _super);
13751
+ function PopperComponent() {
13752
+ return _super !== null && _super.apply(this, arguments) || this;
13753
+ }
13754
+ Object.defineProperty(PopperComponent, "defaultProps", {
13755
+ get: function () {
13756
+ return {
13757
+ hidePopper: true,
13758
+ };
13759
+ },
13760
+ enumerable: false,
13761
+ configurable: true
13762
+ });
13763
+ PopperComponent.prototype.render = function () {
13764
+ var _a = this.props, className = _a.className, wrapperClassName = _a.wrapperClassName, _b = _a.hidePopper, hidePopper = _b === void 0 ? PopperComponent.defaultProps.hidePopper : _b, popperComponent = _a.popperComponent, targetComponent = _a.targetComponent, enableTabLoop = _a.enableTabLoop, popperOnKeyDown = _a.popperOnKeyDown, portalId = _a.portalId, portalHost = _a.portalHost, popperProps = _a.popperProps, showArrow = _a.showArrow;
13765
+ var popper = undefined;
13766
+ if (!hidePopper) {
13767
+ var classes = clsx("react-datepicker-popper", className);
13768
+ popper = (React__default.createElement(TabLoop, { enableTabLoop: enableTabLoop },
13769
+ React__default.createElement("div", { ref: popperProps.refs.setFloating, style: popperProps.floatingStyles, className: classes, "data-placement": popperProps.placement, onKeyDown: popperOnKeyDown },
13770
+ popperComponent,
13771
+ showArrow && (React__default.createElement(FloatingArrow, { ref: popperProps.arrowRef, context: popperProps.context, fill: "currentColor", strokeWidth: 1, height: 8, width: 16, style: { transform: "translateY(-1px)" }, className: "react-datepicker__triangle" })))));
13772
+ }
13773
+ if (this.props.popperContainer) {
13774
+ popper = createElement(this.props.popperContainer, {}, popper);
13775
+ }
13776
+ if (portalId && !hidePopper) {
13777
+ popper = (React__default.createElement(Portal, { portalId: portalId, portalHost: portalHost }, popper));
13778
+ }
13779
+ var wrapperClasses = clsx("react-datepicker-wrapper", wrapperClassName);
13780
+ return (React__default.createElement(React__default.Fragment, null,
13781
+ React__default.createElement("div", { ref: popperProps.refs.setReference, className: wrapperClasses }, targetComponent),
13782
+ popper));
13783
+ };
13784
+ return PopperComponent;
13785
+ }(Component));
13919
13786
  var PopperComponent$1 = withFloating(PopperComponent);
13920
13787
 
13788
+ var outsideClickIgnoreClass = "react-datepicker-ignore-onclickoutside";
13921
13789
  // Compares dates year+month combinations
13922
13790
  function hasPreSelectionChanged(date1, date2) {
13923
13791
  if (date1 && date2) {
@@ -13983,35 +13851,6 @@ var DatePicker = /** @class */ (function (_super) {
13983
13851
  wasHidden: false,
13984
13852
  };
13985
13853
  };
13986
- _this.getInputValue = function () {
13987
- var _a;
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;
13989
- var dateFormat = (_a = _this.props.dateFormat) !== null && _a !== void 0 ? _a : DatePicker.defaultProps.dateFormat;
13990
- var inputValue = _this.state.inputValue;
13991
- if (typeof value === "string") {
13992
- return value;
13993
- }
13994
- else if (typeof inputValue === "string") {
13995
- return inputValue;
13996
- }
13997
- else if (selectsRange) {
13998
- return safeDateRangeFormat(startDate, endDate, {
13999
- dateFormat: dateFormat,
14000
- locale: locale,
14001
- rangeSeparator: rangeSeparator,
14002
- });
14003
- }
14004
- else if (selectsMultiple) {
14005
- return safeMultipleDatesFormat(selectedDates !== null && selectedDates !== void 0 ? selectedDates : [], {
14006
- dateFormat: dateFormat,
14007
- locale: locale,
14008
- });
14009
- }
14010
- return safeDateFormat(selected, {
14011
- dateFormat: dateFormat,
14012
- locale: locale,
14013
- });
14014
- };
14015
13854
  _this.resetHiddenStatus = function () {
14016
13855
  _this.setState(_assign(_assign({}, _this.state), { wasHidden: false }));
14017
13856
  };
@@ -14111,15 +13950,11 @@ var DatePicker = /** @class */ (function (_super) {
14111
13950
  _this.handleDropdownFocus = function () {
14112
13951
  _this.cancelFocusInput();
14113
13952
  };
14114
- _this.resetInputValue = function () {
14115
- _this.setState(_assign(_assign({}, _this.state), { inputValue: null }));
14116
- };
14117
13953
  _this.handleBlur = function (event) {
14118
13954
  var _a, _b;
14119
13955
  if (!_this.state.open || _this.props.withPortal || _this.props.showTimeInput) {
14120
13956
  (_b = (_a = _this.props).onBlur) === null || _b === void 0 ? void 0 : _b.call(_a, event);
14121
13957
  }
14122
- _this.resetInputValue();
14123
13958
  if (_this.state.open && _this.props.open === false) {
14124
13959
  _this.setOpen(false);
14125
13960
  }
@@ -14160,17 +13995,11 @@ var DatePicker = /** @class */ (function (_super) {
14160
13995
  var strictParsing = (_b = _this.props.strictParsing) !== null && _b !== void 0 ? _b : DatePicker.defaultProps.strictParsing;
14161
13996
  var value = (event === null || event === void 0 ? void 0 : event.target) instanceof HTMLInputElement ? event.target.value : "";
14162
13997
  if (selectsRange) {
14163
- var rangeSeparator = _this.props.rangeSeparator;
14164
- var trimmedRangeSeparator = rangeSeparator.trim();
14165
13998
  var _g = value
14166
- .split(dateFormat.includes(trimmedRangeSeparator)
14167
- ? rangeSeparator
14168
- : trimmedRangeSeparator, 2)
13999
+ .split(dateFormat.includes("-") ? DATE_RANGE_SEPARATOR : "-", 2)
14169
14000
  .map(function (val) { return val.trim(); }), valueStart = _g[0], valueEnd = _g[1];
14170
14001
  var startDateNew = parseDate(valueStart !== null && valueStart !== void 0 ? valueStart : "", dateFormat, _this.props.locale, strictParsing);
14171
- var endDateNew = startDateNew
14172
- ? parseDate(valueEnd !== null && valueEnd !== void 0 ? valueEnd : "", dateFormat, _this.props.locale, strictParsing)
14173
- : null;
14002
+ var endDateNew = parseDate(valueEnd !== null && valueEnd !== void 0 ? valueEnd : "", dateFormat, _this.props.locale, strictParsing);
14174
14003
  var startChanged = (startDate === null || startDate === void 0 ? void 0 : startDate.getTime()) !== (startDateNew === null || startDateNew === void 0 ? void 0 : startDateNew.getTime());
14175
14004
  var endChanged = (endDate === null || endDate === void 0 ? void 0 : endDate.getTime()) !== (endDateNew === null || endDateNew === void 0 ? void 0 : endDateNew.getTime());
14176
14005
  if (!startChanged && !endChanged) {
@@ -14194,26 +14023,15 @@ var DatePicker = /** @class */ (function (_super) {
14194
14023
  }
14195
14024
  };
14196
14025
  _this.handleSelect = function (date, event, monthSelectedIn) {
14197
- var _a;
14198
14026
  if (_this.props.readOnly)
14199
14027
  return;
14200
- var _b = _this.props, selectsRange = _b.selectsRange, startDate = _b.startDate, endDate = _b.endDate, locale = _b.locale, swapRange = _b.swapRange;
14201
- var dateFormat = (_a = _this.props.dateFormat) !== null && _a !== void 0 ? _a : DatePicker.defaultProps.dateFormat;
14202
- var isDateSelectionComplete = !selectsRange ||
14203
- (startDate && !endDate && (swapRange || !isDateBefore(date, startDate)));
14204
- if (_this.props.shouldCloseOnSelect &&
14205
- !_this.props.showTimeSelect &&
14206
- isDateSelectionComplete) {
14028
+ if (_this.props.shouldCloseOnSelect && !_this.props.showTimeSelect) {
14207
14029
  // Preventing onFocus event to fix issue
14208
14030
  // https://github.com/Hacker0x01/react-datepicker/issues/628
14209
14031
  _this.sendFocusBackToInput();
14210
14032
  }
14211
14033
  if (_this.props.onChangeRaw) {
14212
- var formattedDate = safeDateFormat(date, {
14213
- dateFormat: dateFormat,
14214
- locale: locale,
14215
- });
14216
- _this.props.onChangeRaw(event, { date: date, formattedDate: formattedDate });
14034
+ _this.props.onChangeRaw(event);
14217
14035
  }
14218
14036
  _this.setSelected(date, event, false, monthSelectedIn);
14219
14037
  if (_this.props.showDateSelect) {
@@ -14222,8 +14040,16 @@ var DatePicker = /** @class */ (function (_super) {
14222
14040
  if (!_this.props.shouldCloseOnSelect || _this.props.showTimeSelect) {
14223
14041
  _this.setPreSelection(date);
14224
14042
  }
14225
- else if (isDateSelectionComplete) {
14226
- _this.setOpen(false);
14043
+ else if (!_this.props.inline) {
14044
+ if (!_this.props.selectsRange) {
14045
+ _this.setOpen(false);
14046
+ }
14047
+ var _a = _this.props, startDate = _a.startDate, endDate = _a.endDate;
14048
+ if (startDate &&
14049
+ !endDate &&
14050
+ (_this.props.swapRange || !isDateBefore(date, startDate))) {
14051
+ _this.setOpen(false);
14052
+ }
14227
14053
  }
14228
14054
  };
14229
14055
  // 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)
@@ -14288,7 +14114,6 @@ var DatePicker = /** @class */ (function (_super) {
14288
14114
  if (selectsRange) {
14289
14115
  var noRanges = !startDate && !endDate;
14290
14116
  var hasStartRange = startDate && !endDate;
14291
- var hasOnlyEndRange = !startDate && !!endDate;
14292
14117
  var isRangeFilled = startDate && endDate;
14293
14118
  if (noRanges) {
14294
14119
  onChange === null || onChange === void 0 ? void 0 : onChange([changedDate, null], event);
@@ -14309,14 +14134,6 @@ var DatePicker = /** @class */ (function (_super) {
14309
14134
  onChange === null || onChange === void 0 ? void 0 : onChange([startDate, changedDate], event);
14310
14135
  }
14311
14136
  }
14312
- else if (hasOnlyEndRange) {
14313
- if (changedDate && isDateBefore(changedDate, endDate)) {
14314
- onChange === null || onChange === void 0 ? void 0 : onChange([changedDate, endDate], event);
14315
- }
14316
- else {
14317
- onChange === null || onChange === void 0 ? void 0 : onChange([changedDate, null], event);
14318
- }
14319
- }
14320
14137
  if (isRangeFilled) {
14321
14138
  onChange === null || onChange === void 0 ? void 0 : onChange([changedDate, null], event);
14322
14139
  }
@@ -14690,12 +14507,10 @@ var DatePicker = /** @class */ (function (_super) {
14690
14507
  }
14691
14508
  return (React__default.createElement(Calendar, _assign({ showMonthYearDropdown: undefined, ref: function (elem) {
14692
14509
  _this.calendar = elem;
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));
14510
+ } }, _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: 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));
14694
14511
  };
14695
14512
  _this.renderAriaLiveRegion = function () {
14696
- var _a;
14697
- var locale = _this.props.locale;
14698
- var dateFormat = (_a = _this.props.dateFormat) !== null && _a !== void 0 ? _a : DatePicker.defaultProps.dateFormat;
14513
+ var _a = _this.props, _b = _a.dateFormat, dateFormat = _b === void 0 ? DatePicker.defaultProps.dateFormat : _b, locale = _a.locale;
14699
14514
  var isContainsTime = _this.props.showTimeInput || _this.props.showTimeSelect;
14700
14515
  var longDateFormat = isContainsTime ? "PPPPp" : "PPPP";
14701
14516
  var ariaLiveMessage;
@@ -14738,17 +14553,36 @@ var DatePicker = /** @class */ (function (_super) {
14738
14553
  };
14739
14554
  _this.renderDateInput = function () {
14740
14555
  var _a, _b;
14556
+ var _c;
14741
14557
  var className = clsx(_this.props.className, (_a = {},
14742
- _a[_this.props.outsideClickIgnoreClass ||
14743
- DatePicker.defaultProps.outsideClickIgnoreClass] = _this.state.open,
14558
+ _a[outsideClickIgnoreClass] = _this.state.open,
14744
14559
  _a));
14745
14560
  var customInput = _this.props.customInput || React__default.createElement("input", { type: "text" });
14746
14561
  var customInputRef = _this.props.customInputRef || "ref";
14562
+ var _d = _this.props, _e = _d.dateFormat, dateFormat = _e === void 0 ? DatePicker.defaultProps.dateFormat : _e, locale = _d.locale;
14563
+ var inputValue = typeof _this.props.value === "string"
14564
+ ? _this.props.value
14565
+ : typeof _this.state.inputValue === "string"
14566
+ ? _this.state.inputValue
14567
+ : _this.props.selectsRange
14568
+ ? safeDateRangeFormat(_this.props.startDate, _this.props.endDate, {
14569
+ dateFormat: dateFormat,
14570
+ locale: locale,
14571
+ })
14572
+ : _this.props.selectsMultiple
14573
+ ? safeMultipleDatesFormat((_c = _this.props.selectedDates) !== null && _c !== void 0 ? _c : [], {
14574
+ dateFormat: dateFormat,
14575
+ locale: locale,
14576
+ })
14577
+ : safeDateFormat(_this.props.selected, {
14578
+ dateFormat: dateFormat,
14579
+ locale: locale,
14580
+ });
14747
14581
  return cloneElement(customInput, (_b = {},
14748
14582
  _b[customInputRef] = function (input) {
14749
14583
  _this.input = input;
14750
14584
  },
14751
- _b.value = _this.getInputValue(),
14585
+ _b.value = inputValue,
14752
14586
  _b.onBlur = _this.handleBlur,
14753
14587
  _b.onChange = _this.handleChange,
14754
14588
  _b.onClick = _this.onInputClick,
@@ -14801,9 +14635,7 @@ var DatePicker = /** @class */ (function (_super) {
14801
14635
  dropdownMode: "scroll",
14802
14636
  preventOpenOnFocus: false,
14803
14637
  monthsShown: 1,
14804
- outsideClickIgnoreClass: OUTSIDE_CLICK_IGNORE_CLASS,
14805
14638
  readOnly: false,
14806
- rangeSeparator: DATE_RANGE_SEPARATOR,
14807
14639
  withPortal: false,
14808
14640
  selectsDisabledDaysInRange: false,
14809
14641
  shouldCloseOnSelect: true,
@@ -15316,4 +15148,4 @@ var InlineDatePicker = function (props) {
15316
15148
  };
15317
15149
 
15318
15150
  export { DatePickerGroup as D, HelperText as H, InlineDatePicker as I, ValidationText as V };
15319
- //# sourceMappingURL=InlineDatePicker-BuxjkoV0.js.map
15151
+ //# sourceMappingURL=InlineDatePicker-ClVBWEzW.js.map