@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
@@ -7521,40 +7521,34 @@ function isShadowRoot(value) {
7521
7521
  }
7522
7522
  return value instanceof ShadowRoot || value instanceof getWindow(value).ShadowRoot;
7523
7523
  }
7524
- const invalidOverflowDisplayValues = /*#__PURE__*/new Set(['inline', 'contents']);
7525
7524
  function isOverflowElement(element) {
7526
7525
  const {
7527
7526
  overflow,
7528
7527
  overflowX,
7529
7528
  overflowY,
7530
7529
  display
7531
- } = getComputedStyle$1(element);
7532
- return /auto|scroll|overlay|hidden|clip/.test(overflow + overflowY + overflowX) && !invalidOverflowDisplayValues.has(display);
7530
+ } = getComputedStyle(element);
7531
+ return /auto|scroll|overlay|hidden|clip/.test(overflow + overflowY + overflowX) && !['inline', 'contents'].includes(display);
7533
7532
  }
7534
- const tableElements = /*#__PURE__*/new Set(['table', 'td', 'th']);
7535
7533
  function isTableElement(element) {
7536
- return tableElements.has(getNodeName(element));
7534
+ return ['table', 'td', 'th'].includes(getNodeName(element));
7537
7535
  }
7538
- const topLayerSelectors = [':popover-open', ':modal'];
7539
7536
  function isTopLayer(element) {
7540
- return topLayerSelectors.some(selector => {
7537
+ return [':popover-open', ':modal'].some(selector => {
7541
7538
  try {
7542
7539
  return element.matches(selector);
7543
- } catch (_e) {
7540
+ } catch (e) {
7544
7541
  return false;
7545
7542
  }
7546
7543
  });
7547
7544
  }
7548
- const transformProperties = ['transform', 'translate', 'scale', 'rotate', 'perspective'];
7549
- const willChangeValues = ['transform', 'translate', 'scale', 'rotate', 'perspective', 'filter'];
7550
- const containValues = ['paint', 'layout', 'strict', 'content'];
7551
7545
  function isContainingBlock(elementOrCss) {
7552
7546
  const webkit = isWebKit();
7553
- const css = isElement(elementOrCss) ? getComputedStyle$1(elementOrCss) : elementOrCss;
7547
+ const css = isElement(elementOrCss) ? getComputedStyle(elementOrCss) : elementOrCss;
7554
7548
 
7555
7549
  // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block
7556
7550
  // https://drafts.csswg.org/css-transforms-2/#individual-transforms
7557
- 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));
7551
+ 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));
7558
7552
  }
7559
7553
  function getContainingBlock(element) {
7560
7554
  let currentNode = getParentNode(element);
@@ -7572,11 +7566,10 @@ function isWebKit() {
7572
7566
  if (typeof CSS === 'undefined' || !CSS.supports) return false;
7573
7567
  return CSS.supports('-webkit-backdrop-filter', 'none');
7574
7568
  }
7575
- const lastTraversableNodeNames = /*#__PURE__*/new Set(['html', 'body', '#document']);
7576
7569
  function isLastTraversableNode(node) {
7577
- return lastTraversableNodeNames.has(getNodeName(node));
7570
+ return ['html', 'body', '#document'].includes(getNodeName(node));
7578
7571
  }
7579
- function getComputedStyle$1(element) {
7572
+ function getComputedStyle(element) {
7580
7573
  return getWindow(element).getComputedStyle(element);
7581
7574
  }
7582
7575
  function getNodeScroll(element) {
@@ -7678,9 +7671,8 @@ function getOppositeAxis(axis) {
7678
7671
  function getAxisLength(axis) {
7679
7672
  return axis === 'y' ? 'height' : 'width';
7680
7673
  }
7681
- const yAxisSides = /*#__PURE__*/new Set(['top', 'bottom']);
7682
7674
  function getSideAxis(placement) {
7683
- return yAxisSides.has(getSide(placement)) ? 'y' : 'x';
7675
+ return ['top', 'bottom'].includes(getSide(placement)) ? 'y' : 'x';
7684
7676
  }
7685
7677
  function getAlignmentAxis(placement) {
7686
7678
  return getOppositeAxis(getSideAxis(placement));
@@ -7705,19 +7697,19 @@ function getExpandedPlacements(placement) {
7705
7697
  function getOppositeAlignmentPlacement(placement) {
7706
7698
  return placement.replace(/start|end/g, alignment => oppositeAlignmentMap[alignment]);
7707
7699
  }
7708
- const lrPlacement = ['left', 'right'];
7709
- const rlPlacement = ['right', 'left'];
7710
- const tbPlacement = ['top', 'bottom'];
7711
- const btPlacement = ['bottom', 'top'];
7712
7700
  function getSideList(side, isStart, rtl) {
7701
+ const lr = ['left', 'right'];
7702
+ const rl = ['right', 'left'];
7703
+ const tb = ['top', 'bottom'];
7704
+ const bt = ['bottom', 'top'];
7713
7705
  switch (side) {
7714
7706
  case 'top':
7715
7707
  case 'bottom':
7716
- if (rtl) return isStart ? rlPlacement : lrPlacement;
7717
- return isStart ? lrPlacement : rlPlacement;
7708
+ if (rtl) return isStart ? rl : lr;
7709
+ return isStart ? lr : rl;
7718
7710
  case 'left':
7719
7711
  case 'right':
7720
- return isStart ? tbPlacement : btPlacement;
7712
+ return isStart ? tb : bt;
7721
7713
  default:
7722
7714
  return [];
7723
7715
  }
@@ -8169,7 +8161,7 @@ const flip$2 = function (options) {
8169
8161
  if (!ignoreCrossAxisOverflow ||
8170
8162
  // We leave the current main axis only if every placement on that axis
8171
8163
  // overflows the main axis.
8172
- overflowsData.every(d => getSideAxis(d.placement) === initialSideAxis ? d.overflows[0] > 0 : true)) {
8164
+ overflowsData.every(d => d.overflows[0] > 0 && getSideAxis(d.placement) === initialSideAxis)) {
8173
8165
  // Try next placement and re-run the lifecycle.
8174
8166
  return {
8175
8167
  data: {
@@ -8226,8 +8218,6 @@ const flip$2 = function (options) {
8226
8218
  };
8227
8219
  };
8228
8220
 
8229
- const originSides = /*#__PURE__*/new Set(['left', 'top']);
8230
-
8231
8221
  // For type backwards-compatibility, the `OffsetOptions` type was also
8232
8222
  // Derivable.
8233
8223
 
@@ -8241,7 +8231,7 @@ async function convertValueToCoords(state, options) {
8241
8231
  const side = getSide(placement);
8242
8232
  const alignment = getAlignment(placement);
8243
8233
  const isVertical = getSideAxis(placement) === 'y';
8244
- const mainAxisMulti = originSides.has(side) ? -1 : 1;
8234
+ const mainAxisMulti = ['left', 'top'].includes(side) ? -1 : 1;
8245
8235
  const crossAxisMulti = rtl && isVertical ? -1 : 1;
8246
8236
  const rawValue = evaluate(options, state);
8247
8237
 
@@ -8313,7 +8303,7 @@ const offset$2 = function (options) {
8313
8303
  };
8314
8304
 
8315
8305
  function getCssDimensions(element) {
8316
- const css = getComputedStyle$1(element);
8306
+ const css = getComputedStyle(element);
8317
8307
  // In testing environments, the `width` and `height` properties are empty
8318
8308
  // strings for SVG elements, returning NaN. Fallback to `0` in this case.
8319
8309
  let width = parseFloat(css.width) || 0;
@@ -8418,7 +8408,7 @@ function getBoundingClientRect(element, includeScale, isFixedStrategy, offsetPar
8418
8408
  while (currentIFrame && offsetParent && offsetWin !== currentWin) {
8419
8409
  const iframeScale = getScale(currentIFrame);
8420
8410
  const iframeRect = currentIFrame.getBoundingClientRect();
8421
- const css = getComputedStyle$1(currentIFrame);
8411
+ const css = getComputedStyle(currentIFrame);
8422
8412
  const left = iframeRect.left + (currentIFrame.clientLeft + parseFloat(css.paddingLeft)) * iframeScale.x;
8423
8413
  const top = iframeRect.top + (currentIFrame.clientTop + parseFloat(css.paddingTop)) * iframeScale.y;
8424
8414
  x *= iframeScale.x;
@@ -8449,9 +8439,14 @@ function getWindowScrollBarX(element, rect) {
8449
8439
  return rect.left + leftScroll;
8450
8440
  }
8451
8441
 
8452
- function getHTMLOffset(documentElement, scroll) {
8442
+ function getHTMLOffset(documentElement, scroll, ignoreScrollbarX) {
8443
+ if (ignoreScrollbarX === void 0) {
8444
+ ignoreScrollbarX = false;
8445
+ }
8453
8446
  const htmlRect = documentElement.getBoundingClientRect();
8454
- const x = htmlRect.left + scroll.scrollLeft - getWindowScrollBarX(documentElement, htmlRect);
8447
+ const x = htmlRect.left + scroll.scrollLeft - (ignoreScrollbarX ? 0 :
8448
+ // RTL <body> scrollbar.
8449
+ getWindowScrollBarX(documentElement, htmlRect));
8455
8450
  const y = htmlRect.top + scroll.scrollTop;
8456
8451
  return {
8457
8452
  x,
@@ -8490,7 +8485,7 @@ function convertOffsetParentRelativeRectToViewportRelativeRect(_ref) {
8490
8485
  offsets.y = offsetRect.y + offsetParent.clientTop;
8491
8486
  }
8492
8487
  }
8493
- const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll) : createCoords(0);
8488
+ const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll, true) : createCoords(0);
8494
8489
  return {
8495
8490
  width: rect.width * scale.x,
8496
8491
  height: rect.height * scale.y,
@@ -8513,7 +8508,7 @@ function getDocumentRect(element) {
8513
8508
  const height = max(html.scrollHeight, html.clientHeight, body.scrollHeight, body.clientHeight);
8514
8509
  let x = -scroll.scrollLeft + getWindowScrollBarX(element);
8515
8510
  const y = -scroll.scrollTop;
8516
- if (getComputedStyle$1(body).direction === 'rtl') {
8511
+ if (getComputedStyle(body).direction === 'rtl') {
8517
8512
  x += max(html.clientWidth, body.clientWidth) - width;
8518
8513
  }
8519
8514
  return {
@@ -8524,10 +8519,6 @@ function getDocumentRect(element) {
8524
8519
  };
8525
8520
  }
8526
8521
 
8527
- // Safety check: ensure the scrollbar space is reasonable in case this
8528
- // calculation is affected by unusual styles.
8529
- // Most scrollbars leave 15-18px of space.
8530
- const SCROLLBAR_MAX = 25;
8531
8522
  function getViewportRect(element, strategy) {
8532
8523
  const win = getWindow(element);
8533
8524
  const html = getDocumentElement(element);
@@ -8545,24 +8536,6 @@ function getViewportRect(element, strategy) {
8545
8536
  y = visualViewport.offsetTop;
8546
8537
  }
8547
8538
  }
8548
- const windowScrollbarX = getWindowScrollBarX(html);
8549
- // <html> `overflow: hidden` + `scrollbar-gutter: stable` reduces the
8550
- // visual width of the <html> but this is not considered in the size
8551
- // of `html.clientWidth`.
8552
- if (windowScrollbarX <= 0) {
8553
- const doc = html.ownerDocument;
8554
- const body = doc.body;
8555
- const bodyStyles = getComputedStyle(body);
8556
- const bodyMarginInline = doc.compatMode === 'CSS1Compat' ? parseFloat(bodyStyles.marginLeft) + parseFloat(bodyStyles.marginRight) || 0 : 0;
8557
- const clippingStableScrollbarWidth = Math.abs(html.clientWidth - body.clientWidth - bodyMarginInline);
8558
- if (clippingStableScrollbarWidth <= SCROLLBAR_MAX) {
8559
- width -= clippingStableScrollbarWidth;
8560
- }
8561
- } else if (windowScrollbarX <= SCROLLBAR_MAX) {
8562
- // If the <body> scrollbar is on the left, the width needs to be extended
8563
- // by the scrollbar amount so there isn't extra space on the right.
8564
- width += windowScrollbarX;
8565
- }
8566
8539
  return {
8567
8540
  width,
8568
8541
  height,
@@ -8571,7 +8544,6 @@ function getViewportRect(element, strategy) {
8571
8544
  };
8572
8545
  }
8573
8546
 
8574
- const absoluteOrFixed = /*#__PURE__*/new Set(['absolute', 'fixed']);
8575
8547
  // Returns the inner client rect, subtracting scrollbars if present.
8576
8548
  function getInnerBoundingClientRect(element, strategy) {
8577
8549
  const clientRect = getBoundingClientRect(element, true, strategy === 'fixed');
@@ -8613,7 +8585,7 @@ function hasFixedPositionAncestor(element, stopNode) {
8613
8585
  if (parentNode === stopNode || !isElement(parentNode) || isLastTraversableNode(parentNode)) {
8614
8586
  return false;
8615
8587
  }
8616
- return getComputedStyle$1(parentNode).position === 'fixed' || hasFixedPositionAncestor(parentNode, stopNode);
8588
+ return getComputedStyle(parentNode).position === 'fixed' || hasFixedPositionAncestor(parentNode, stopNode);
8617
8589
  }
8618
8590
 
8619
8591
  // A "clipping ancestor" is an `overflow` element with the characteristic of
@@ -8626,17 +8598,17 @@ function getClippingElementAncestors(element, cache) {
8626
8598
  }
8627
8599
  let result = getOverflowAncestors(element, [], false).filter(el => isElement(el) && getNodeName(el) !== 'body');
8628
8600
  let currentContainingBlockComputedStyle = null;
8629
- const elementIsFixed = getComputedStyle$1(element).position === 'fixed';
8601
+ const elementIsFixed = getComputedStyle(element).position === 'fixed';
8630
8602
  let currentNode = elementIsFixed ? getParentNode(element) : element;
8631
8603
 
8632
8604
  // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block
8633
8605
  while (isElement(currentNode) && !isLastTraversableNode(currentNode)) {
8634
- const computedStyle = getComputedStyle$1(currentNode);
8606
+ const computedStyle = getComputedStyle(currentNode);
8635
8607
  const currentNodeIsContaining = isContainingBlock(currentNode);
8636
8608
  if (!currentNodeIsContaining && computedStyle.position === 'fixed') {
8637
8609
  currentContainingBlockComputedStyle = null;
8638
8610
  }
8639
- const shouldDropCurrentNode = elementIsFixed ? !currentNodeIsContaining && !currentContainingBlockComputedStyle : !currentNodeIsContaining && computedStyle.position === 'static' && !!currentContainingBlockComputedStyle && absoluteOrFixed.has(currentContainingBlockComputedStyle.position) || isOverflowElement(currentNode) && !currentNodeIsContaining && hasFixedPositionAncestor(element, currentNode);
8611
+ const shouldDropCurrentNode = elementIsFixed ? !currentNodeIsContaining && !currentContainingBlockComputedStyle : !currentNodeIsContaining && computedStyle.position === 'static' && !!currentContainingBlockComputedStyle && ['absolute', 'fixed'].includes(currentContainingBlockComputedStyle.position) || isOverflowElement(currentNode) && !currentNodeIsContaining && hasFixedPositionAncestor(element, currentNode);
8640
8612
  if (shouldDropCurrentNode) {
8641
8613
  // Drop non-containing blocks.
8642
8614
  result = result.filter(ancestor => ancestor !== currentNode);
@@ -8732,11 +8704,11 @@ function getRectRelativeToOffsetParent(element, offsetParent, strategy) {
8732
8704
  }
8733
8705
 
8734
8706
  function isStaticPositioned(element) {
8735
- return getComputedStyle$1(element).position === 'static';
8707
+ return getComputedStyle(element).position === 'static';
8736
8708
  }
8737
8709
 
8738
8710
  function getTrueOffsetParent(element, polyfill) {
8739
- if (!isHTMLElement(element) || getComputedStyle$1(element).position === 'fixed') {
8711
+ if (!isHTMLElement(element) || getComputedStyle(element).position === 'fixed') {
8740
8712
  return null;
8741
8713
  }
8742
8714
  if (polyfill) {
@@ -8797,7 +8769,7 @@ const getElementRects = async function (data) {
8797
8769
  };
8798
8770
 
8799
8771
  function isRTL(element) {
8800
- return getComputedStyle$1(element).direction === 'rtl';
8772
+ return getComputedStyle(element).direction === 'rtl';
8801
8773
  }
8802
8774
 
8803
8775
  const platform = {
@@ -9437,7 +9409,7 @@ const FloatingArrow = /*#__PURE__*/React__namespace.forwardRef(function Floating
9437
9409
  // https://github.com/floating-ui/floating-ui/issues/2932
9438
9410
  index$1(() => {
9439
9411
  if (!floating) return;
9440
- const isRTL = getComputedStyle$1(floating).direction === 'rtl';
9412
+ const isRTL = getComputedStyle(floating).direction === 'rtl';
9441
9413
  if (isRTL) {
9442
9414
  setIsRTL(true);
9443
9415
  }
@@ -9696,7 +9668,7 @@ function useFloating(options) {
9696
9668
  }
9697
9669
 
9698
9670
  /*!
9699
- react-datepicker v8.8.0
9671
+ react-datepicker v8.4.0
9700
9672
  https://github.com/Hacker0x01/react-datepicker
9701
9673
  Released under the MIT License.
9702
9674
  */
@@ -9931,13 +9903,12 @@ var DATE_RANGE_SEPARATOR = " - ";
9931
9903
  * @returns - The formatted date range or an empty string.
9932
9904
  */
9933
9905
  function safeDateRangeFormat(startDate, endDate, props) {
9934
- if (!startDate && !endDate) {
9906
+ if (!startDate) {
9935
9907
  return "";
9936
9908
  }
9937
- var formattedStartDate = startDate ? safeDateFormat(startDate, props) : "";
9909
+ var formattedStartDate = safeDateFormat(startDate, props);
9938
9910
  var formattedEndDate = endDate ? safeDateFormat(endDate, props) : "";
9939
- var dateRangeSeparator = props.rangeSeparator || DATE_RANGE_SEPARATOR;
9940
- return "".concat(formattedStartDate).concat(dateRangeSeparator).concat(formattedEndDate);
9911
+ return "".concat(formattedStartDate).concat(DATE_RANGE_SEPARATOR).concat(formattedEndDate);
9941
9912
  }
9942
9913
  /**
9943
9914
  * Safely formats multiple dates.
@@ -10273,10 +10244,7 @@ function getQuarterShortInLocale(quarter, locale) {
10273
10244
  * @returns - Returns true if the day is disabled, false otherwise.
10274
10245
  */
10275
10246
  function isDayDisabled(day, _a) {
10276
- 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;
10277
- if (disabled) {
10278
- return true;
10279
- }
10247
+ 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;
10280
10248
  return (isOutOfBounds(day, { minDate: minDate, maxDate: maxDate }) ||
10281
10249
  (excludeDates &&
10282
10250
  excludeDates.some(function (excludeDate) {
@@ -10376,10 +10344,7 @@ function isMonthYearDisabled(date, _a) {
10376
10344
  false);
10377
10345
  }
10378
10346
  function isQuarterDisabled(quarter, _a) {
10379
- var _b = _a === void 0 ? {} : _a, minDate = _b.minDate, maxDate = _b.maxDate, excludeDates = _b.excludeDates, includeDates = _b.includeDates, filterDate = _b.filterDate, disabled = _b.disabled;
10380
- if (disabled) {
10381
- return true;
10382
- }
10347
+ var _b = _a === void 0 ? {} : _a, minDate = _b.minDate, maxDate = _b.maxDate, excludeDates = _b.excludeDates, includeDates = _b.includeDates, filterDate = _b.filterDate;
10383
10348
  return (isOutOfBounds(quarter, { minDate: minDate, maxDate: maxDate }) ||
10384
10349
  (excludeDates === null || excludeDates === void 0 ? void 0 : excludeDates.some(function (excludeDate) {
10385
10350
  return isSameQuarter(quarter, excludeDate instanceof Date ? excludeDate : excludeDate.date);
@@ -10401,10 +10366,7 @@ function isYearInRange(year, start, end) {
10401
10366
  return startYear <= year && endYear >= year;
10402
10367
  }
10403
10368
  function isYearDisabled(year, _a) {
10404
- var _b = _a === void 0 ? {} : _a, minDate = _b.minDate, maxDate = _b.maxDate, excludeDates = _b.excludeDates, includeDates = _b.includeDates, filterDate = _b.filterDate, disabled = _b.disabled;
10405
- if (disabled) {
10406
- return true;
10407
- }
10369
+ var _b = _a === void 0 ? {} : _a, minDate = _b.minDate, maxDate = _b.maxDate, excludeDates = _b.excludeDates, includeDates = _b.includeDates, filterDate = _b.filterDate;
10408
10370
  var date = new Date(year, 0, 1);
10409
10371
  return (isOutOfBounds(date, {
10410
10372
  minDate: minDate ? startOfYear(minDate) : undefined,
@@ -10994,7 +10956,6 @@ var Day = /** @class */ (function (_super) {
10994
10956
  includeDateIntervals: _this.props.includeDateIntervals,
10995
10957
  includeDates: _this.props.includeDates,
10996
10958
  filterDate: _this.props.filterDate,
10997
- disabled: _this.props.disabled,
10998
10959
  });
10999
10960
  };
11000
10961
  _this.isExcluded = function () {
@@ -11049,7 +11010,7 @@ var Day = /** @class */ (function (_super) {
11049
11010
  };
11050
11011
  _this.isInSelectingRange = function () {
11051
11012
  var _a;
11052
- 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;
11013
+ 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;
11053
11014
  var selectingDate = (_a = _this.props.selectingDate) !== null && _a !== void 0 ? _a : _this.props.preSelection;
11054
11015
  if (!(selectsStart || selectsEnd || selectsRange) ||
11055
11016
  !selectingDate ||
@@ -11066,16 +11027,11 @@ var Day = /** @class */ (function (_super) {
11066
11027
  (isAfter(selectingDate, startDate) || isEqual(selectingDate, startDate))) {
11067
11028
  return isDayInRange(day, startDate, selectingDate);
11068
11029
  }
11069
- if (selectsRange && startDate && !endDate) {
11070
- if (isEqual(selectingDate, startDate)) {
11071
- return isDayInRange(day, startDate, selectingDate);
11072
- }
11073
- if (isAfter(selectingDate, startDate)) {
11074
- return isDayInRange(day, startDate, selectingDate);
11075
- }
11076
- if (swapRange && isBefore(selectingDate, startDate)) {
11077
- return isDayInRange(day, selectingDate, startDate);
11078
- }
11030
+ if (selectsRange &&
11031
+ startDate &&
11032
+ !endDate &&
11033
+ (isAfter(selectingDate, startDate) || isEqual(selectingDate, startDate))) {
11034
+ return isDayInRange(day, startDate, selectingDate);
11079
11035
  }
11080
11036
  return false;
11081
11037
  };
@@ -11084,33 +11040,28 @@ var Day = /** @class */ (function (_super) {
11084
11040
  if (!_this.isInSelectingRange()) {
11085
11041
  return false;
11086
11042
  }
11087
- var _b = _this.props, day = _b.day, startDate = _b.startDate, selectsStart = _b.selectsStart, swapRange = _b.swapRange, selectsRange = _b.selectsRange;
11043
+ var _b = _this.props, day = _b.day, startDate = _b.startDate, selectsStart = _b.selectsStart;
11088
11044
  var selectingDate = (_a = _this.props.selectingDate) !== null && _a !== void 0 ? _a : _this.props.preSelection;
11089
11045
  if (selectsStart) {
11090
11046
  return isSameDay(day, selectingDate);
11091
11047
  }
11092
- if (selectsRange && swapRange && startDate && selectingDate) {
11093
- return isSameDay(day, isBefore(selectingDate, startDate) ? selectingDate : startDate);
11048
+ else {
11049
+ return isSameDay(day, startDate);
11094
11050
  }
11095
- return isSameDay(day, startDate);
11096
11051
  };
11097
11052
  _this.isSelectingRangeEnd = function () {
11098
11053
  var _a;
11099
11054
  if (!_this.isInSelectingRange()) {
11100
11055
  return false;
11101
11056
  }
11102
- var _b = _this.props, day = _b.day, endDate = _b.endDate, selectsEnd = _b.selectsEnd, selectsRange = _b.selectsRange, swapRange = _b.swapRange, startDate = _b.startDate;
11057
+ var _b = _this.props, day = _b.day, endDate = _b.endDate, selectsEnd = _b.selectsEnd, selectsRange = _b.selectsRange;
11103
11058
  var selectingDate = (_a = _this.props.selectingDate) !== null && _a !== void 0 ? _a : _this.props.preSelection;
11104
- if (selectsEnd) {
11059
+ if (selectsEnd || selectsRange) {
11105
11060
  return isSameDay(day, selectingDate);
11106
11061
  }
11107
- if (selectsRange && swapRange && startDate && selectingDate) {
11108
- return isSameDay(day, isBefore(selectingDate, startDate) ? startDate : selectingDate);
11109
- }
11110
- if (selectsRange) {
11111
- return isSameDay(day, selectingDate);
11062
+ else {
11063
+ return isSameDay(day, endDate);
11112
11064
  }
11113
- return isSameDay(day, endDate);
11114
11065
  };
11115
11066
  _this.isRangeStart = function () {
11116
11067
  var _a = _this.props, day = _a.day, startDate = _a.startDate, endDate = _a.endDate;
@@ -11231,7 +11182,7 @@ var Day = /** @class */ (function (_super) {
11231
11182
  };
11232
11183
  _this.render = function () { return (
11233
11184
  // TODO: Use <option> instead of the "option" role to ensure accessibility across all devices.
11234
- React__namespace.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() },
11185
+ React__namespace.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() },
11235
11186
  _this.renderDayContents(),
11236
11187
  _this.getTitle() !== "" && (React__namespace.default.createElement("span", { className: "overlay" }, _this.getTitle())))); };
11237
11188
  return _this;
@@ -11369,7 +11320,7 @@ var WeekNumber = /** @class */ (function (_super) {
11369
11320
  "react-datepicker__week-number--clickable": !!onClick && !isWeekDisabled,
11370
11321
  "react-datepicker__week-number--selected": !!onClick && isSameDay(this.props.date, this.props.selected),
11371
11322
  };
11372
- return (React__namespace.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));
11323
+ return (React__namespace.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));
11373
11324
  };
11374
11325
  return WeekNumber;
11375
11326
  }(React.Component));
@@ -11478,10 +11429,7 @@ var Week = /** @class */ (function (_super) {
11478
11429
  "react-datepicker__week--selected": isSameDay(this.startOfWeek(), this.props.selected),
11479
11430
  "react-datepicker__week--keyboard-selected": this.isKeyboardSelected(),
11480
11431
  };
11481
- var customWeekClassName = this.props.weekClassName
11482
- ? this.props.weekClassName(this.startOfWeek())
11483
- : undefined;
11484
- return (React__namespace.default.createElement("div", { className: clsx(weekNumberClasses, customWeekClassName), role: "row" }, this.renderDays()));
11432
+ return React__namespace.default.createElement("div", { className: clsx(weekNumberClasses) }, this.renderDays());
11485
11433
  };
11486
11434
  return Week;
11487
11435
  }(React.Component));
@@ -11642,7 +11590,6 @@ var Month$1 = /** @class */ (function (_super) {
11642
11590
  includeDateIntervals: _this.props.includeDateIntervals,
11643
11591
  includeDates: _this.props.includeDates,
11644
11592
  filterDate: _this.props.filterDate,
11645
- disabled: _this.props.disabled,
11646
11593
  });
11647
11594
  };
11648
11595
  _this.isExcluded = function (day) {
@@ -12010,14 +11957,8 @@ var Month$1 = /** @class */ (function (_super) {
12010
11957
  };
12011
11958
  _this.isMonthDisabledForLabelDate = function (month) {
12012
11959
  var _a;
12013
- var _b = _this.props, day = _b.day, disabled = _b.disabled, minDate = _b.minDate, maxDate = _b.maxDate, excludeDates = _b.excludeDates, includeDates = _b.includeDates;
11960
+ var _b = _this.props, day = _b.day, minDate = _b.minDate, maxDate = _b.maxDate, excludeDates = _b.excludeDates, includeDates = _b.includeDates;
12014
11961
  var labelDate = setMonth(day, month);
12015
- if (disabled) {
12016
- return {
12017
- isDisabled: true,
12018
- labelDate: setMonth(day, month),
12019
- };
12020
- }
12021
11962
  return {
12022
11963
  isDisabled: (_a = ((minDate || maxDate || excludeDates || includeDates) &&
12023
11964
  isMonthDisabled(labelDate, _this.props))) !== null && _a !== void 0 ? _a : false,
@@ -12088,13 +12029,8 @@ var Month$1 = /** @class */ (function (_super) {
12088
12029
  return "".concat(prefix, " ").concat(formatDate(labelDate, "MMMM yyyy", locale));
12089
12030
  };
12090
12031
  _this.getQuarterClassNames = function (q) {
12091
- var _a = _this.props, day = _a.day, startDate = _a.startDate, endDate = _a.endDate, selected = _a.selected, minDate = _a.minDate, maxDate = _a.maxDate, excludeDates = _a.excludeDates, includeDates = _a.includeDates, filterDate = _a.filterDate, preSelection = _a.preSelection, disabledKeyboardNavigation = _a.disabledKeyboardNavigation, disabled = _a.disabled;
12092
- var isDisabled = (minDate ||
12093
- maxDate ||
12094
- excludeDates ||
12095
- includeDates ||
12096
- filterDate ||
12097
- disabled) &&
12032
+ 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;
12033
+ var isDisabled = (minDate || maxDate || excludeDates || includeDates || filterDate) &&
12098
12034
  isQuarterDisabled(setQuarter(day, q), _this.props);
12099
12035
  return clsx("react-datepicker__quarter-text", "react-datepicker__quarter-".concat(q), {
12100
12036
  "react-datepicker__quarter-text--disabled": isDisabled,
@@ -12183,14 +12119,11 @@ var Month$1 = /** @class */ (function (_super) {
12183
12119
  var formattedAriaLabelPrefix = ariaLabelPrefix
12184
12120
  ? ariaLabelPrefix.trim() + " "
12185
12121
  : "";
12186
- var shouldUseListboxRole = showMonthYearPicker || showQuarterYearPicker;
12187
- if (shouldUseListboxRole) {
12188
- return (React__namespace.default.createElement("div", { className: this.getClassNames(), onMouseLeave: !this.props.usePointerEvent ? this.handleMouseLeave : undefined, onPointerLeave: this.props.usePointerEvent ? this.handleMouseLeave : undefined, "aria-label": "".concat(formattedAriaLabelPrefix).concat(formatDate(day, "MMMM, yyyy", this.props.locale)), role: "listbox" }, showMonthYearPicker ? this.renderMonths() : this.renderQuarters()));
12189
- }
12190
- // For regular calendar view, use table structure
12191
- return (React__namespace.default.createElement("div", { role: "table" },
12192
- this.props.dayNamesHeader && (React__namespace.default.createElement("div", { role: "rowgroup" }, this.props.dayNamesHeader)),
12193
- React__namespace.default.createElement("div", { className: this.getClassNames(), onMouseLeave: !this.props.usePointerEvent ? this.handleMouseLeave : undefined, onPointerLeave: this.props.usePointerEvent ? this.handleMouseLeave : undefined, "aria-label": "".concat(formattedAriaLabelPrefix).concat(formatDate(day, "MMMM, yyyy", this.props.locale)), role: "rowgroup" }, this.renderWeeks())));
12122
+ return (React__namespace.default.createElement("div", { className: this.getClassNames(), onMouseLeave: !this.props.usePointerEvent ? this.handleMouseLeave : undefined, onPointerLeave: this.props.usePointerEvent ? this.handleMouseLeave : undefined, "aria-label": "".concat(formattedAriaLabelPrefix).concat(formatDate(day, "MMMM, yyyy", this.props.locale)), role: "listbox" }, showMonthYearPicker
12123
+ ? this.renderMonths()
12124
+ : showQuarterYearPicker
12125
+ ? this.renderQuarters()
12126
+ : this.renderWeeks()));
12194
12127
  };
12195
12128
  return Month;
12196
12129
  }(React.Component));
@@ -12199,40 +12132,11 @@ var MonthDropdownOptions = /** @class */ (function (_super) {
12199
12132
  __extends(MonthDropdownOptions, _super);
12200
12133
  function MonthDropdownOptions() {
12201
12134
  var _this = _super !== null && _super.apply(this, arguments) || this;
12202
- _this.monthOptionButtonsRef = {};
12203
12135
  _this.isSelectedMonth = function (i) { return _this.props.month === i; };
12204
- _this.handleOptionKeyDown = function (i, e) {
12205
- var _a;
12206
- switch (e.key) {
12207
- case "Enter":
12208
- e.preventDefault();
12209
- _this.onChange(i);
12210
- break;
12211
- case "Escape":
12212
- e.preventDefault();
12213
- _this.props.onCancel();
12214
- break;
12215
- case "ArrowUp":
12216
- case "ArrowDown": {
12217
- e.preventDefault();
12218
- var newMonth = (i + (e.key === "ArrowUp" ? -1 : 1) + _this.props.monthNames.length) %
12219
- _this.props.monthNames.length;
12220
- (_a = _this.monthOptionButtonsRef[newMonth]) === null || _a === void 0 ? void 0 : _a.focus();
12221
- break;
12222
- }
12223
- }
12224
- };
12225
12136
  _this.renderOptions = function () {
12226
- // Clear refs to prevent memory leaks on re-render
12227
- _this.monthOptionButtonsRef = {};
12228
- return _this.props.monthNames.map(function (month, i) { return (React__namespace.default.createElement("div", { ref: function (el) {
12229
- _this.monthOptionButtonsRef[i] = el;
12230
- if (_this.isSelectedMonth(i)) {
12231
- el === null || el === void 0 ? void 0 : el.focus();
12232
- }
12233
- }, role: "button", tabIndex: 0, className: _this.isSelectedMonth(i)
12137
+ return _this.props.monthNames.map(function (month, i) { return (React__namespace.default.createElement("div", { className: _this.isSelectedMonth(i)
12234
12138
  ? "react-datepicker__month-option react-datepicker__month-option--selected_month"
12235
- : "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 },
12139
+ : "react-datepicker__month-option", key: month, onClick: _this.onChange.bind(_this, i), "aria-selected": _this.isSelectedMonth(i) ? "true" : undefined },
12236
12140
  _this.isSelectedMonth(i) ? (React__namespace.default.createElement("span", { className: "react-datepicker__month-option--selected" }, "\u2713")) : (""),
12237
12141
  month)); });
12238
12142
  };
@@ -12257,7 +12161,7 @@ var MonthDropdown = /** @class */ (function (_super) {
12257
12161
  return monthNames.map(function (m, i) { return (React__namespace.default.createElement("option", { key: m, value: i }, m)); });
12258
12162
  };
12259
12163
  _this.renderSelectMode = function (monthNames) { return (React__namespace.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))); };
12260
- _this.renderReadView = function (visible, monthNames) { return (React__namespace.default.createElement("button", { key: "read", type: "button", style: { visibility: visible ? "visible" : "hidden" }, className: "react-datepicker__month-read-view", onClick: _this.toggleDropdown },
12164
+ _this.renderReadView = function (visible, monthNames) { return (React__namespace.default.createElement("div", { key: "read", style: { visibility: visible ? "visible" : "hidden" }, className: "react-datepicker__month-read-view", onClick: _this.toggleDropdown },
12261
12165
  React__namespace.default.createElement("span", { className: "react-datepicker__month-read-view--down-arrow" }),
12262
12166
  React__namespace.default.createElement("span", { className: "react-datepicker__month-read-view--selected-month" }, monthNames[_this.props.month]))); };
12263
12167
  _this.renderDropdown = function (monthNames) { return (React__namespace.default.createElement(MonthDropdownOptions, _assign({ key: "dropdown" }, _this.props, { monthNames: monthNames, onChange: _this.onChange, onCancel: _this.toggleDropdown }))); };
@@ -12745,20 +12649,19 @@ var Year$1 = /** @class */ (function (_super) {
12745
12649
  return isSameYear(_year, endDate !== null && endDate !== void 0 ? endDate : null);
12746
12650
  };
12747
12651
  _this.isKeyboardSelected = function (y) {
12748
- if (_this.props.disabledKeyboardNavigation ||
12749
- _this.props.date === undefined ||
12652
+ if (_this.props.date === undefined ||
12653
+ _this.props.selected == null ||
12750
12654
  _this.props.preSelection == null) {
12751
12655
  return;
12752
12656
  }
12753
- var _a = _this.props, minDate = _a.minDate, maxDate = _a.maxDate, excludeDates = _a.excludeDates, includeDates = _a.includeDates, filterDate = _a.filterDate, selected = _a.selected;
12657
+ var _a = _this.props, minDate = _a.minDate, maxDate = _a.maxDate, excludeDates = _a.excludeDates, includeDates = _a.includeDates, filterDate = _a.filterDate;
12754
12658
  var date = getStartOfYear(setYear(_this.props.date, y));
12755
12659
  var isDisabled = (minDate || maxDate || excludeDates || includeDates || filterDate) &&
12756
12660
  isYearDisabled(y, _this.props);
12757
- var isSelectedDay = !!selected && isSameDay(date, getStartOfYear(selected));
12758
- var isKeyboardSelectedDay = isSameDay(date, getStartOfYear(_this.props.preSelection));
12759
- return (!_this.props.inline &&
12760
- !isSelectedDay &&
12761
- isKeyboardSelectedDay &&
12661
+ return (!_this.props.disabledKeyboardNavigation &&
12662
+ !_this.props.inline &&
12663
+ !isSameDay(date, getStartOfYear(_this.props.selected)) &&
12664
+ isSameDay(date, getStartOfYear(_this.props.preSelection)) &&
12762
12665
  !isDisabled);
12763
12666
  };
12764
12667
  _this.isSelectedYear = function (year) {
@@ -12853,15 +12756,10 @@ var Year$1 = /** @class */ (function (_super) {
12853
12756
  handleOnKeyDown && handleOnKeyDown(event);
12854
12757
  };
12855
12758
  _this.getYearClassNames = function (y) {
12856
- 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;
12759
+ 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;
12857
12760
  return clsx("react-datepicker__year-text", "react-datepicker__year-".concat(y), date ? yearClassName === null || yearClassName === void 0 ? void 0 : yearClassName(setYear(date, y)) : undefined, {
12858
12761
  "react-datepicker__year-text--selected": _this.isSelectedYear(y),
12859
- "react-datepicker__year-text--disabled": (minDate ||
12860
- maxDate ||
12861
- excludeDates ||
12862
- includeDates ||
12863
- filterDate ||
12864
- disabled) &&
12762
+ "react-datepicker__year-text--disabled": (minDate || maxDate || excludeDates || includeDates || filterDate) &&
12865
12763
  isYearDisabled(y, _this.props),
12866
12764
  "react-datepicker__year-text--keyboard-selected": _this.isKeyboardSelected(y),
12867
12765
  "react-datepicker__year-text--range-start": _this.isRangeStart(y),
@@ -12949,42 +12847,11 @@ var YearDropdownOptions = /** @class */ (function (_super) {
12949
12847
  __extends(YearDropdownOptions, _super);
12950
12848
  function YearDropdownOptions(props) {
12951
12849
  var _this = _super.call(this, props) || this;
12952
- _this.yearOptionButtonsRef = {};
12953
- _this.handleOptionKeyDown = function (year, e) {
12954
- var _a;
12955
- switch (e.key) {
12956
- case "Enter":
12957
- e.preventDefault();
12958
- _this.onChange(year);
12959
- break;
12960
- case "Escape":
12961
- e.preventDefault();
12962
- _this.props.onCancel();
12963
- break;
12964
- case "ArrowUp":
12965
- case "ArrowDown": {
12966
- e.preventDefault();
12967
- var newYear = year + (e.key === "ArrowUp" ? 1 : -1);
12968
- // Add bounds checking to ensure the year exists in our refs
12969
- if (_this.yearOptionButtonsRef[newYear]) {
12970
- (_a = _this.yearOptionButtonsRef[newYear]) === null || _a === void 0 ? void 0 : _a.focus();
12971
- }
12972
- break;
12973
- }
12974
- }
12975
- };
12976
12850
  _this.renderOptions = function () {
12977
- // Clear refs to prevent memory leaks on re-render
12978
- _this.yearOptionButtonsRef = {};
12979
12851
  var selectedYear = _this.props.year;
12980
- var options = _this.state.yearsList.map(function (year) { return (React__namespace.default.createElement("div", { ref: function (el) {
12981
- _this.yearOptionButtonsRef[year] = el;
12982
- if (year === selectedYear) {
12983
- el === null || el === void 0 ? void 0 : el.focus();
12984
- }
12985
- }, role: "button", tabIndex: 0, className: selectedYear === year
12852
+ var options = _this.state.yearsList.map(function (year) { return (React__namespace.default.createElement("div", { className: selectedYear === year
12986
12853
  ? "react-datepicker__year-option react-datepicker__year-option--selected_year"
12987
- : "react-datepicker__year-option", key: year, onClick: _this.onChange.bind(_this, year), onKeyDown: _this.handleOptionKeyDown.bind(_this, year), "aria-selected": selectedYear === year ? "true" : undefined },
12854
+ : "react-datepicker__year-option", key: year, onClick: _this.onChange.bind(_this, year), "aria-selected": selectedYear === year ? "true" : undefined },
12988
12855
  selectedYear === year ? (React__namespace.default.createElement("span", { className: "react-datepicker__year-option--selected" }, "\u2713")) : (""),
12989
12856
  year)); });
12990
12857
  var minYear = _this.props.minDate ? getYear(_this.props.minDate) : null;
@@ -13079,7 +12946,9 @@ var YearDropdown = /** @class */ (function (_super) {
13079
12946
  _this.onChange(parseInt(event.target.value));
13080
12947
  };
13081
12948
  _this.renderSelectMode = function () { return (React__namespace.default.createElement("select", { value: _this.props.year, className: "react-datepicker__year-select", onChange: _this.onSelectChange }, _this.renderSelectOptions())); };
13082
- _this.renderReadView = function (visible) { return (React__namespace.default.createElement("button", { key: "read", type: "button", style: { visibility: visible ? "visible" : "hidden" }, className: "react-datepicker__year-read-view", onClick: _this.toggleDropdown },
12949
+ _this.renderReadView = function (visible) { return (React__namespace.default.createElement("div", { key: "read", style: { visibility: visible ? "visible" : "hidden" }, className: "react-datepicker__year-read-view", onClick: function (event) {
12950
+ return _this.toggleDropdown(event);
12951
+ } },
13083
12952
  React__namespace.default.createElement("span", { className: "react-datepicker__year-read-view--down-arrow" }),
13084
12953
  React__namespace.default.createElement("span", { className: "react-datepicker__year-read-view--selected-year" }, _this.props.year))); };
13085
12954
  _this.renderDropdown = function () { return (React__namespace.default.createElement(YearDropdownOptions, _assign({ key: "dropdown" }, _this.props, { onChange: _this.onChange, onCancel: _this.toggleDropdown }))); };
@@ -13141,7 +13010,6 @@ var DROPDOWN_FOCUS_CLASSNAMES = [
13141
13010
  "react-datepicker__month-select",
13142
13011
  "react-datepicker__month-year-select",
13143
13012
  ];
13144
- var OUTSIDE_CLICK_IGNORE_CLASS = "react-datepicker-ignore-onclickoutside";
13145
13013
  var isDropdownSelect = function (element) {
13146
13014
  var classNames = (element.className || "").split(/\s+/);
13147
13015
  return DROPDOWN_FOCUS_CLASSNAMES.some(function (testClassname) { return classNames.indexOf(testClassname) >= 0; });
@@ -13290,13 +13158,10 @@ var Calendar = /** @class */ (function (_super) {
13290
13158
  };
13291
13159
  _this.header = function (date) {
13292
13160
  if (date === void 0) { date = _this.state.date; }
13293
- var disabled = _this.props.disabled;
13294
13161
  var startOfWeek = getStartOfWeek(date, _this.props.locale, _this.props.calendarStartDay);
13295
13162
  var dayNames = [];
13296
13163
  if (_this.props.showWeekNumbers) {
13297
- dayNames.push(React__namespace.default.createElement("div", { key: "W", className: "react-datepicker__day-name ".concat(disabled ? "react-datepicker__day-name--disabled" : ""), role: "columnheader" },
13298
- React__namespace.default.createElement("span", { className: "react-datepicker__sr-only" }, "Week number"),
13299
- React__namespace.default.createElement("span", { "aria-hidden": "true" }, _this.props.weekLabel || "#")));
13164
+ dayNames.push(React__namespace.default.createElement("div", { key: "W", className: "react-datepicker__day-name" }, _this.props.weekLabel || "#"));
13300
13165
  }
13301
13166
  return dayNames.concat([0, 1, 2, 3, 4, 5, 6].map(function (offset) {
13302
13167
  var day = addDays(startOfWeek, offset);
@@ -13304,9 +13169,7 @@ var Calendar = /** @class */ (function (_super) {
13304
13169
  var weekDayClassName = _this.props.weekDayClassName
13305
13170
  ? _this.props.weekDayClassName(day)
13306
13171
  : undefined;
13307
- return (React__namespace.default.createElement("div", { key: offset, role: "columnheader", className: clsx("react-datepicker__day-name", weekDayClassName, disabled ? "react-datepicker__day-name--disabled" : "") },
13308
- React__namespace.default.createElement("span", { className: "react-datepicker__sr-only" }, formatDate(day, "EEEE", _this.props.locale)),
13309
- React__namespace.default.createElement("span", { "aria-hidden": "true" }, weekDayName)));
13172
+ return (React__namespace.default.createElement("div", { key: offset, "aria-label": formatDate(day, "EEEE", _this.props.locale), className: clsx("react-datepicker__day-name", weekDayClassName) }, weekDayName));
13310
13173
  }));
13311
13174
  };
13312
13175
  _this.formatWeekday = function (day, locale) {
@@ -13344,9 +13207,6 @@ var Calendar = /** @class */ (function (_super) {
13344
13207
  var fromMonthDate = subMonths(_this.state.date, monthSelectedIn);
13345
13208
  var allPrevDaysDisabled;
13346
13209
  switch (true) {
13347
- case _this.props.disabled:
13348
- allPrevDaysDisabled = true;
13349
- break;
13350
13210
  case _this.props.showMonthYearPicker:
13351
13211
  allPrevDaysDisabled = yearDisabledBefore(_this.state.date, _this.props);
13352
13212
  break;
@@ -13414,9 +13274,6 @@ var Calendar = /** @class */ (function (_super) {
13414
13274
  }
13415
13275
  var allNextDaysDisabled;
13416
13276
  switch (true) {
13417
- case _this.props.disabled:
13418
- allNextDaysDisabled = true;
13419
- break;
13420
13277
  case _this.props.showMonthYearPicker:
13421
13278
  allNextDaysDisabled = yearDisabledAfter(_this.state.date, _this.props);
13422
13279
  break;
@@ -13517,7 +13374,6 @@ var Calendar = /** @class */ (function (_super) {
13517
13374
  }
13518
13375
  return (React__namespace.default.createElement("div", { className: "react-datepicker__today-button", onClick: _this.handleTodayButtonClick }, _this.props.todayButton));
13519
13376
  };
13520
- _this.renderDayNamesHeader = function (monthDate) { return (React__namespace.default.createElement("div", { className: "react-datepicker__day-names", role: "row" }, _this.header(monthDate))); };
13521
13377
  _this.renderDefaultHeader = function (_a) {
13522
13378
  var monthDate = _a.monthDate, i = _a.i;
13523
13379
  return (React__namespace.default.createElement("div", { className: "react-datepicker__header ".concat(_this.props.showTimeSelect
@@ -13527,7 +13383,8 @@ var Calendar = /** @class */ (function (_super) {
13527
13383
  React__namespace.default.createElement("div", { className: "react-datepicker__header__dropdown react-datepicker__header__dropdown--".concat(_this.props.dropdownMode), onFocus: _this.handleDropdownFocus },
13528
13384
  _this.renderMonthDropdown(i !== 0),
13529
13385
  _this.renderMonthYearDropdown(i !== 0),
13530
- _this.renderYearDropdown(i !== 0))));
13386
+ _this.renderYearDropdown(i !== 0)),
13387
+ React__namespace.default.createElement("div", { className: "react-datepicker__day-names" }, _this.header(monthDate))));
13531
13388
  };
13532
13389
  _this.renderCustomHeader = function (headerArgs) {
13533
13390
  var _a, _b;
@@ -13536,20 +13393,16 @@ var Calendar = /** @class */ (function (_super) {
13536
13393
  _this.props.showTimeSelectOnly) {
13537
13394
  return null;
13538
13395
  }
13539
- var _c = _this.props, showYearPicker = _c.showYearPicker, yearItemNumber = _c.yearItemNumber;
13540
- var visibleYearsRange;
13541
- if (showYearPicker) {
13542
- var _d = getYearsPeriod(monthDate, yearItemNumber), startYear = _d.startPeriod, endYear = _d.endPeriod;
13543
- visibleYearsRange = {
13544
- startYear: startYear,
13545
- endYear: endYear,
13546
- };
13547
- }
13548
13396
  var prevMonthButtonDisabled = monthDisabledBefore(_this.state.date, _this.props);
13549
13397
  var nextMonthButtonDisabled = monthDisabledAfter(_this.state.date, _this.props);
13550
13398
  var prevYearButtonDisabled = yearDisabledBefore(_this.state.date, _this.props);
13551
13399
  var nextYearButtonDisabled = yearDisabledAfter(_this.state.date, _this.props);
13552
- return (React__namespace.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 }))));
13400
+ var showDayNames = !_this.props.showMonthYearPicker &&
13401
+ !_this.props.showQuarterYearPicker &&
13402
+ !_this.props.showYearPicker;
13403
+ return (React__namespace.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 :
13404
+ _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 })),
13405
+ showDayNames && (React__namespace.default.createElement("div", { className: "react-datepicker__day-names" }, _this.header(monthDate)))));
13553
13406
  };
13554
13407
  _this.renderYearHeader = function (_a) {
13555
13408
  var monthDate = _a.monthDate;
@@ -13597,7 +13450,7 @@ var Calendar = /** @class */ (function (_super) {
13597
13450
  _this.monthContainer = div !== null && div !== void 0 ? div : undefined;
13598
13451
  }, className: "react-datepicker__month-container" },
13599
13452
  _this.renderHeader({ monthDate: monthDate, i: i }),
13600
- React__namespace.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) }))));
13453
+ React__namespace.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 }))));
13601
13454
  }
13602
13455
  return monthList;
13603
13456
  };
@@ -13668,7 +13521,6 @@ var Calendar = /** @class */ (function (_super) {
13668
13521
  return {
13669
13522
  monthsShown: 1,
13670
13523
  forceShowMonthNavigation: false,
13671
- outsideClickIgnoreClass: OUTSIDE_CLICK_IGNORE_CLASS,
13672
13524
  timeCaption: "Time",
13673
13525
  previousYearButtonLabel: "Previous Year",
13674
13526
  nextYearButtonLabel: "Next Year",
@@ -13902,7 +13754,7 @@ var TabLoop = /** @class */ (function (_super) {
13902
13754
  * @returns A new component with floating behavior.
13903
13755
  */
13904
13756
  function withFloating(Component) {
13905
- function WithFloating(props) {
13757
+ var WithFloating = function (props) {
13906
13758
  var _a;
13907
13759
  var hidePopper = typeof props.hidePopper === "boolean" ? props.hidePopper : true;
13908
13760
  var arrowRef = React.useRef(null);
@@ -13913,35 +13765,51 @@ function withFloating(Component) {
13913
13765
  ], ((_a = props.popperModifiers) !== null && _a !== void 0 ? _a : []), true) }, props.popperProps));
13914
13766
  var componentProps = _assign(_assign({}, props), { hidePopper: hidePopper, popperProps: _assign(_assign({}, floatingProps), { arrowRef: arrowRef }) });
13915
13767
  return React__namespace.default.createElement(Component, _assign({}, componentProps));
13916
- }
13917
- WithFloating.displayName = "withFloating(".concat(Component.displayName || Component.name || "Component", ")");
13768
+ };
13918
13769
  return WithFloating;
13919
13770
  }
13920
13771
 
13921
13772
  // Exported for testing purposes
13922
- var PopperComponent = function (props) {
13923
- var className = props.className, wrapperClassName = props.wrapperClassName, _a = props.hidePopper, hidePopper = _a === void 0 ? true : _a, popperComponent = props.popperComponent, targetComponent = props.targetComponent, enableTabLoop = props.enableTabLoop, popperOnKeyDown = props.popperOnKeyDown, portalId = props.portalId, portalHost = props.portalHost, popperProps = props.popperProps, showArrow = props.showArrow;
13924
- var popper = undefined;
13925
- if (!hidePopper) {
13926
- var classes = clsx("react-datepicker-popper", className);
13927
- popper = (React__namespace.default.createElement(TabLoop, { enableTabLoop: enableTabLoop },
13928
- React__namespace.default.createElement("div", { ref: popperProps.refs.setFloating, style: popperProps.floatingStyles, className: classes, "data-placement": popperProps.placement, onKeyDown: popperOnKeyDown },
13929
- popperComponent,
13930
- showArrow && (React__namespace.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" })))));
13931
- }
13932
- if (props.popperContainer) {
13933
- popper = React.createElement(props.popperContainer, {}, popper);
13934
- }
13935
- if (portalId && !hidePopper) {
13936
- popper = (React__namespace.default.createElement(Portal, { portalId: portalId, portalHost: portalHost }, popper));
13937
- }
13938
- var wrapperClasses = clsx("react-datepicker-wrapper", wrapperClassName);
13939
- return (React__namespace.default.createElement(React__namespace.default.Fragment, null,
13940
- React__namespace.default.createElement("div", { ref: popperProps.refs.setReference, className: wrapperClasses }, targetComponent),
13941
- popper));
13942
- };
13773
+ var PopperComponent = /** @class */ (function (_super) {
13774
+ __extends(PopperComponent, _super);
13775
+ function PopperComponent() {
13776
+ return _super !== null && _super.apply(this, arguments) || this;
13777
+ }
13778
+ Object.defineProperty(PopperComponent, "defaultProps", {
13779
+ get: function () {
13780
+ return {
13781
+ hidePopper: true,
13782
+ };
13783
+ },
13784
+ enumerable: false,
13785
+ configurable: true
13786
+ });
13787
+ PopperComponent.prototype.render = function () {
13788
+ 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;
13789
+ var popper = undefined;
13790
+ if (!hidePopper) {
13791
+ var classes = clsx("react-datepicker-popper", className);
13792
+ popper = (React__namespace.default.createElement(TabLoop, { enableTabLoop: enableTabLoop },
13793
+ React__namespace.default.createElement("div", { ref: popperProps.refs.setFloating, style: popperProps.floatingStyles, className: classes, "data-placement": popperProps.placement, onKeyDown: popperOnKeyDown },
13794
+ popperComponent,
13795
+ showArrow && (React__namespace.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" })))));
13796
+ }
13797
+ if (this.props.popperContainer) {
13798
+ popper = React.createElement(this.props.popperContainer, {}, popper);
13799
+ }
13800
+ if (portalId && !hidePopper) {
13801
+ popper = (React__namespace.default.createElement(Portal, { portalId: portalId, portalHost: portalHost }, popper));
13802
+ }
13803
+ var wrapperClasses = clsx("react-datepicker-wrapper", wrapperClassName);
13804
+ return (React__namespace.default.createElement(React__namespace.default.Fragment, null,
13805
+ React__namespace.default.createElement("div", { ref: popperProps.refs.setReference, className: wrapperClasses }, targetComponent),
13806
+ popper));
13807
+ };
13808
+ return PopperComponent;
13809
+ }(React.Component));
13943
13810
  var PopperComponent$1 = withFloating(PopperComponent);
13944
13811
 
13812
+ var outsideClickIgnoreClass = "react-datepicker-ignore-onclickoutside";
13945
13813
  // Compares dates year+month combinations
13946
13814
  function hasPreSelectionChanged(date1, date2) {
13947
13815
  if (date1 && date2) {
@@ -14007,35 +13875,6 @@ var DatePicker = /** @class */ (function (_super) {
14007
13875
  wasHidden: false,
14008
13876
  };
14009
13877
  };
14010
- _this.getInputValue = function () {
14011
- var _a;
14012
- 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;
14013
- var dateFormat = (_a = _this.props.dateFormat) !== null && _a !== void 0 ? _a : DatePicker.defaultProps.dateFormat;
14014
- var inputValue = _this.state.inputValue;
14015
- if (typeof value === "string") {
14016
- return value;
14017
- }
14018
- else if (typeof inputValue === "string") {
14019
- return inputValue;
14020
- }
14021
- else if (selectsRange) {
14022
- return safeDateRangeFormat(startDate, endDate, {
14023
- dateFormat: dateFormat,
14024
- locale: locale,
14025
- rangeSeparator: rangeSeparator,
14026
- });
14027
- }
14028
- else if (selectsMultiple) {
14029
- return safeMultipleDatesFormat(selectedDates !== null && selectedDates !== void 0 ? selectedDates : [], {
14030
- dateFormat: dateFormat,
14031
- locale: locale,
14032
- });
14033
- }
14034
- return safeDateFormat(selected, {
14035
- dateFormat: dateFormat,
14036
- locale: locale,
14037
- });
14038
- };
14039
13878
  _this.resetHiddenStatus = function () {
14040
13879
  _this.setState(_assign(_assign({}, _this.state), { wasHidden: false }));
14041
13880
  };
@@ -14135,15 +13974,11 @@ var DatePicker = /** @class */ (function (_super) {
14135
13974
  _this.handleDropdownFocus = function () {
14136
13975
  _this.cancelFocusInput();
14137
13976
  };
14138
- _this.resetInputValue = function () {
14139
- _this.setState(_assign(_assign({}, _this.state), { inputValue: null }));
14140
- };
14141
13977
  _this.handleBlur = function (event) {
14142
13978
  var _a, _b;
14143
13979
  if (!_this.state.open || _this.props.withPortal || _this.props.showTimeInput) {
14144
13980
  (_b = (_a = _this.props).onBlur) === null || _b === void 0 ? void 0 : _b.call(_a, event);
14145
13981
  }
14146
- _this.resetInputValue();
14147
13982
  if (_this.state.open && _this.props.open === false) {
14148
13983
  _this.setOpen(false);
14149
13984
  }
@@ -14184,17 +14019,11 @@ var DatePicker = /** @class */ (function (_super) {
14184
14019
  var strictParsing = (_b = _this.props.strictParsing) !== null && _b !== void 0 ? _b : DatePicker.defaultProps.strictParsing;
14185
14020
  var value = (event === null || event === void 0 ? void 0 : event.target) instanceof HTMLInputElement ? event.target.value : "";
14186
14021
  if (selectsRange) {
14187
- var rangeSeparator = _this.props.rangeSeparator;
14188
- var trimmedRangeSeparator = rangeSeparator.trim();
14189
14022
  var _g = value
14190
- .split(dateFormat.includes(trimmedRangeSeparator)
14191
- ? rangeSeparator
14192
- : trimmedRangeSeparator, 2)
14023
+ .split(dateFormat.includes("-") ? DATE_RANGE_SEPARATOR : "-", 2)
14193
14024
  .map(function (val) { return val.trim(); }), valueStart = _g[0], valueEnd = _g[1];
14194
14025
  var startDateNew = parseDate(valueStart !== null && valueStart !== void 0 ? valueStart : "", dateFormat, _this.props.locale, strictParsing);
14195
- var endDateNew = startDateNew
14196
- ? parseDate(valueEnd !== null && valueEnd !== void 0 ? valueEnd : "", dateFormat, _this.props.locale, strictParsing)
14197
- : null;
14026
+ var endDateNew = parseDate(valueEnd !== null && valueEnd !== void 0 ? valueEnd : "", dateFormat, _this.props.locale, strictParsing);
14198
14027
  var startChanged = (startDate === null || startDate === void 0 ? void 0 : startDate.getTime()) !== (startDateNew === null || startDateNew === void 0 ? void 0 : startDateNew.getTime());
14199
14028
  var endChanged = (endDate === null || endDate === void 0 ? void 0 : endDate.getTime()) !== (endDateNew === null || endDateNew === void 0 ? void 0 : endDateNew.getTime());
14200
14029
  if (!startChanged && !endChanged) {
@@ -14218,26 +14047,15 @@ var DatePicker = /** @class */ (function (_super) {
14218
14047
  }
14219
14048
  };
14220
14049
  _this.handleSelect = function (date, event, monthSelectedIn) {
14221
- var _a;
14222
14050
  if (_this.props.readOnly)
14223
14051
  return;
14224
- var _b = _this.props, selectsRange = _b.selectsRange, startDate = _b.startDate, endDate = _b.endDate, locale = _b.locale, swapRange = _b.swapRange;
14225
- var dateFormat = (_a = _this.props.dateFormat) !== null && _a !== void 0 ? _a : DatePicker.defaultProps.dateFormat;
14226
- var isDateSelectionComplete = !selectsRange ||
14227
- (startDate && !endDate && (swapRange || !isDateBefore(date, startDate)));
14228
- if (_this.props.shouldCloseOnSelect &&
14229
- !_this.props.showTimeSelect &&
14230
- isDateSelectionComplete) {
14052
+ if (_this.props.shouldCloseOnSelect && !_this.props.showTimeSelect) {
14231
14053
  // Preventing onFocus event to fix issue
14232
14054
  // https://github.com/Hacker0x01/react-datepicker/issues/628
14233
14055
  _this.sendFocusBackToInput();
14234
14056
  }
14235
14057
  if (_this.props.onChangeRaw) {
14236
- var formattedDate = safeDateFormat(date, {
14237
- dateFormat: dateFormat,
14238
- locale: locale,
14239
- });
14240
- _this.props.onChangeRaw(event, { date: date, formattedDate: formattedDate });
14058
+ _this.props.onChangeRaw(event);
14241
14059
  }
14242
14060
  _this.setSelected(date, event, false, monthSelectedIn);
14243
14061
  if (_this.props.showDateSelect) {
@@ -14246,8 +14064,16 @@ var DatePicker = /** @class */ (function (_super) {
14246
14064
  if (!_this.props.shouldCloseOnSelect || _this.props.showTimeSelect) {
14247
14065
  _this.setPreSelection(date);
14248
14066
  }
14249
- else if (isDateSelectionComplete) {
14250
- _this.setOpen(false);
14067
+ else if (!_this.props.inline) {
14068
+ if (!_this.props.selectsRange) {
14069
+ _this.setOpen(false);
14070
+ }
14071
+ var _a = _this.props, startDate = _a.startDate, endDate = _a.endDate;
14072
+ if (startDate &&
14073
+ !endDate &&
14074
+ (_this.props.swapRange || !isDateBefore(date, startDate))) {
14075
+ _this.setOpen(false);
14076
+ }
14251
14077
  }
14252
14078
  };
14253
14079
  // 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)
@@ -14312,7 +14138,6 @@ var DatePicker = /** @class */ (function (_super) {
14312
14138
  if (selectsRange) {
14313
14139
  var noRanges = !startDate && !endDate;
14314
14140
  var hasStartRange = startDate && !endDate;
14315
- var hasOnlyEndRange = !startDate && !!endDate;
14316
14141
  var isRangeFilled = startDate && endDate;
14317
14142
  if (noRanges) {
14318
14143
  onChange === null || onChange === void 0 ? void 0 : onChange([changedDate, null], event);
@@ -14333,14 +14158,6 @@ var DatePicker = /** @class */ (function (_super) {
14333
14158
  onChange === null || onChange === void 0 ? void 0 : onChange([startDate, changedDate], event);
14334
14159
  }
14335
14160
  }
14336
- else if (hasOnlyEndRange) {
14337
- if (changedDate && isDateBefore(changedDate, endDate)) {
14338
- onChange === null || onChange === void 0 ? void 0 : onChange([changedDate, endDate], event);
14339
- }
14340
- else {
14341
- onChange === null || onChange === void 0 ? void 0 : onChange([changedDate, null], event);
14342
- }
14343
- }
14344
14161
  if (isRangeFilled) {
14345
14162
  onChange === null || onChange === void 0 ? void 0 : onChange([changedDate, null], event);
14346
14163
  }
@@ -14714,12 +14531,10 @@ var DatePicker = /** @class */ (function (_super) {
14714
14531
  }
14715
14532
  return (React__namespace.default.createElement(Calendar, _assign({ showMonthYearDropdown: undefined, ref: function (elem) {
14716
14533
  _this.calendar = elem;
14717
- } }, _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));
14534
+ } }, _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));
14718
14535
  };
14719
14536
  _this.renderAriaLiveRegion = function () {
14720
- var _a;
14721
- var locale = _this.props.locale;
14722
- var dateFormat = (_a = _this.props.dateFormat) !== null && _a !== void 0 ? _a : DatePicker.defaultProps.dateFormat;
14537
+ var _a = _this.props, _b = _a.dateFormat, dateFormat = _b === void 0 ? DatePicker.defaultProps.dateFormat : _b, locale = _a.locale;
14723
14538
  var isContainsTime = _this.props.showTimeInput || _this.props.showTimeSelect;
14724
14539
  var longDateFormat = isContainsTime ? "PPPPp" : "PPPP";
14725
14540
  var ariaLiveMessage;
@@ -14762,17 +14577,36 @@ var DatePicker = /** @class */ (function (_super) {
14762
14577
  };
14763
14578
  _this.renderDateInput = function () {
14764
14579
  var _a, _b;
14580
+ var _c;
14765
14581
  var className = clsx(_this.props.className, (_a = {},
14766
- _a[_this.props.outsideClickIgnoreClass ||
14767
- DatePicker.defaultProps.outsideClickIgnoreClass] = _this.state.open,
14582
+ _a[outsideClickIgnoreClass] = _this.state.open,
14768
14583
  _a));
14769
14584
  var customInput = _this.props.customInput || React__namespace.default.createElement("input", { type: "text" });
14770
14585
  var customInputRef = _this.props.customInputRef || "ref";
14586
+ var _d = _this.props, _e = _d.dateFormat, dateFormat = _e === void 0 ? DatePicker.defaultProps.dateFormat : _e, locale = _d.locale;
14587
+ var inputValue = typeof _this.props.value === "string"
14588
+ ? _this.props.value
14589
+ : typeof _this.state.inputValue === "string"
14590
+ ? _this.state.inputValue
14591
+ : _this.props.selectsRange
14592
+ ? safeDateRangeFormat(_this.props.startDate, _this.props.endDate, {
14593
+ dateFormat: dateFormat,
14594
+ locale: locale,
14595
+ })
14596
+ : _this.props.selectsMultiple
14597
+ ? safeMultipleDatesFormat((_c = _this.props.selectedDates) !== null && _c !== void 0 ? _c : [], {
14598
+ dateFormat: dateFormat,
14599
+ locale: locale,
14600
+ })
14601
+ : safeDateFormat(_this.props.selected, {
14602
+ dateFormat: dateFormat,
14603
+ locale: locale,
14604
+ });
14771
14605
  return React.cloneElement(customInput, (_b = {},
14772
14606
  _b[customInputRef] = function (input) {
14773
14607
  _this.input = input;
14774
14608
  },
14775
- _b.value = _this.getInputValue(),
14609
+ _b.value = inputValue,
14776
14610
  _b.onBlur = _this.handleBlur,
14777
14611
  _b.onChange = _this.handleChange,
14778
14612
  _b.onClick = _this.onInputClick,
@@ -14825,9 +14659,7 @@ var DatePicker = /** @class */ (function (_super) {
14825
14659
  dropdownMode: "scroll",
14826
14660
  preventOpenOnFocus: false,
14827
14661
  monthsShown: 1,
14828
- outsideClickIgnoreClass: OUTSIDE_CLICK_IGNORE_CLASS,
14829
14662
  readOnly: false,
14830
- rangeSeparator: DATE_RANGE_SEPARATOR,
14831
14663
  withPortal: false,
14832
14664
  selectsDisabledDaysInRange: false,
14833
14665
  shouldCloseOnSelect: true,
@@ -15343,4 +15175,4 @@ exports.DatePickerGroup = DatePickerGroup;
15343
15175
  exports.HelperText = HelperText;
15344
15176
  exports.InlineDatePicker = InlineDatePicker;
15345
15177
  exports.ValidationText = ValidationText;
15346
- //# sourceMappingURL=InlineDatePicker-B7DTwvhv.js.map
15178
+ //# sourceMappingURL=InlineDatePicker-DFv_uHo9.js.map