@cerebruminc/cerebellum 16.0.0-beta.dangerous.aae8e29 → 16.0.0-beta.dangerous.b3c9c8c
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/DatePicker.cjs +1 -1
- package/lib/cjs/Form.cjs +2 -2
- package/lib/cjs/{FormikContainer-CY2nLsAs.js → FormikContainer-Gc8nGlEW.js} +2 -2
- package/lib/cjs/{FormikContainer-CY2nLsAs.js.map → FormikContainer-Gc8nGlEW.js.map} +1 -1
- package/lib/cjs/{InlineDatePicker-DFv_uHo9.js → InlineDatePicker-CQ9t1bfe.js} +162 -82
- package/lib/cjs/InlineDatePicker-CQ9t1bfe.js.map +1 -0
- package/lib/cjs/InlineDatePicker.cjs +1 -1
- package/lib/cjs/index.cjs +2 -2
- package/lib/esm/DatePicker.js +1 -1
- package/lib/esm/Form.js +2 -2
- package/lib/esm/{FormikContainer-SJPYfIkF.js → FormikContainer-C75cvTmz.js} +2 -2
- package/lib/esm/{FormikContainer-SJPYfIkF.js.map → FormikContainer-C75cvTmz.js.map} +1 -1
- package/lib/esm/{InlineDatePicker-ClVBWEzW.js → InlineDatePicker-BeRq7pJP.js} +162 -82
- package/lib/esm/InlineDatePicker-BeRq7pJP.js.map +1 -0
- package/lib/esm/InlineDatePicker.js +1 -1
- package/lib/esm/index.js +2 -2
- package/package.json +2 -2
- package/lib/cjs/InlineDatePicker-DFv_uHo9.js.map +0 -1
- package/lib/esm/InlineDatePicker-ClVBWEzW.js.map +0 -1
|
@@ -7497,34 +7497,40 @@ 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']);
|
|
7500
7501
|
function isOverflowElement(element) {
|
|
7501
7502
|
const {
|
|
7502
7503
|
overflow,
|
|
7503
7504
|
overflowX,
|
|
7504
7505
|
overflowY,
|
|
7505
7506
|
display
|
|
7506
|
-
} = getComputedStyle(element);
|
|
7507
|
-
return /auto|scroll|overlay|hidden|clip/.test(overflow + overflowY + overflowX) && !
|
|
7507
|
+
} = getComputedStyle$1(element);
|
|
7508
|
+
return /auto|scroll|overlay|hidden|clip/.test(overflow + overflowY + overflowX) && !invalidOverflowDisplayValues.has(display);
|
|
7508
7509
|
}
|
|
7510
|
+
const tableElements = /*#__PURE__*/new Set(['table', 'td', 'th']);
|
|
7509
7511
|
function isTableElement(element) {
|
|
7510
|
-
return
|
|
7512
|
+
return tableElements.has(getNodeName(element));
|
|
7511
7513
|
}
|
|
7514
|
+
const topLayerSelectors = [':popover-open', ':modal'];
|
|
7512
7515
|
function isTopLayer(element) {
|
|
7513
|
-
return
|
|
7516
|
+
return topLayerSelectors.some(selector => {
|
|
7514
7517
|
try {
|
|
7515
7518
|
return element.matches(selector);
|
|
7516
|
-
} catch (
|
|
7519
|
+
} catch (_e) {
|
|
7517
7520
|
return false;
|
|
7518
7521
|
}
|
|
7519
7522
|
});
|
|
7520
7523
|
}
|
|
7524
|
+
const transformProperties = ['transform', 'translate', 'scale', 'rotate', 'perspective'];
|
|
7525
|
+
const willChangeValues = ['transform', 'translate', 'scale', 'rotate', 'perspective', 'filter'];
|
|
7526
|
+
const containValues = ['paint', 'layout', 'strict', 'content'];
|
|
7521
7527
|
function isContainingBlock(elementOrCss) {
|
|
7522
7528
|
const webkit = isWebKit();
|
|
7523
|
-
const css = isElement(elementOrCss) ? getComputedStyle(elementOrCss) : elementOrCss;
|
|
7529
|
+
const css = isElement(elementOrCss) ? getComputedStyle$1(elementOrCss) : elementOrCss;
|
|
7524
7530
|
|
|
7525
7531
|
// https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block
|
|
7526
7532
|
// https://drafts.csswg.org/css-transforms-2/#individual-transforms
|
|
7527
|
-
return
|
|
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));
|
|
7528
7534
|
}
|
|
7529
7535
|
function getContainingBlock(element) {
|
|
7530
7536
|
let currentNode = getParentNode(element);
|
|
@@ -7542,10 +7548,11 @@ function isWebKit() {
|
|
|
7542
7548
|
if (typeof CSS === 'undefined' || !CSS.supports) return false;
|
|
7543
7549
|
return CSS.supports('-webkit-backdrop-filter', 'none');
|
|
7544
7550
|
}
|
|
7551
|
+
const lastTraversableNodeNames = /*#__PURE__*/new Set(['html', 'body', '#document']);
|
|
7545
7552
|
function isLastTraversableNode(node) {
|
|
7546
|
-
return
|
|
7553
|
+
return lastTraversableNodeNames.has(getNodeName(node));
|
|
7547
7554
|
}
|
|
7548
|
-
function getComputedStyle(element) {
|
|
7555
|
+
function getComputedStyle$1(element) {
|
|
7549
7556
|
return getWindow(element).getComputedStyle(element);
|
|
7550
7557
|
}
|
|
7551
7558
|
function getNodeScroll(element) {
|
|
@@ -7647,8 +7654,9 @@ function getOppositeAxis(axis) {
|
|
|
7647
7654
|
function getAxisLength(axis) {
|
|
7648
7655
|
return axis === 'y' ? 'height' : 'width';
|
|
7649
7656
|
}
|
|
7657
|
+
const yAxisSides = /*#__PURE__*/new Set(['top', 'bottom']);
|
|
7650
7658
|
function getSideAxis(placement) {
|
|
7651
|
-
return
|
|
7659
|
+
return yAxisSides.has(getSide(placement)) ? 'y' : 'x';
|
|
7652
7660
|
}
|
|
7653
7661
|
function getAlignmentAxis(placement) {
|
|
7654
7662
|
return getOppositeAxis(getSideAxis(placement));
|
|
@@ -7673,19 +7681,19 @@ function getExpandedPlacements(placement) {
|
|
|
7673
7681
|
function getOppositeAlignmentPlacement(placement) {
|
|
7674
7682
|
return placement.replace(/start|end/g, alignment => oppositeAlignmentMap[alignment]);
|
|
7675
7683
|
}
|
|
7684
|
+
const lrPlacement = ['left', 'right'];
|
|
7685
|
+
const rlPlacement = ['right', 'left'];
|
|
7686
|
+
const tbPlacement = ['top', 'bottom'];
|
|
7687
|
+
const btPlacement = ['bottom', 'top'];
|
|
7676
7688
|
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'];
|
|
7681
7689
|
switch (side) {
|
|
7682
7690
|
case 'top':
|
|
7683
7691
|
case 'bottom':
|
|
7684
|
-
if (rtl) return isStart ?
|
|
7685
|
-
return isStart ?
|
|
7692
|
+
if (rtl) return isStart ? rlPlacement : lrPlacement;
|
|
7693
|
+
return isStart ? lrPlacement : rlPlacement;
|
|
7686
7694
|
case 'left':
|
|
7687
7695
|
case 'right':
|
|
7688
|
-
return isStart ?
|
|
7696
|
+
return isStart ? tbPlacement : btPlacement;
|
|
7689
7697
|
default:
|
|
7690
7698
|
return [];
|
|
7691
7699
|
}
|
|
@@ -8137,7 +8145,7 @@ const flip$2 = function (options) {
|
|
|
8137
8145
|
if (!ignoreCrossAxisOverflow ||
|
|
8138
8146
|
// We leave the current main axis only if every placement on that axis
|
|
8139
8147
|
// overflows the main axis.
|
|
8140
|
-
overflowsData.every(d => d.overflows[0] > 0
|
|
8148
|
+
overflowsData.every(d => getSideAxis(d.placement) === initialSideAxis ? d.overflows[0] > 0 : true)) {
|
|
8141
8149
|
// Try next placement and re-run the lifecycle.
|
|
8142
8150
|
return {
|
|
8143
8151
|
data: {
|
|
@@ -8194,6 +8202,8 @@ const flip$2 = function (options) {
|
|
|
8194
8202
|
};
|
|
8195
8203
|
};
|
|
8196
8204
|
|
|
8205
|
+
const originSides = /*#__PURE__*/new Set(['left', 'top']);
|
|
8206
|
+
|
|
8197
8207
|
// For type backwards-compatibility, the `OffsetOptions` type was also
|
|
8198
8208
|
// Derivable.
|
|
8199
8209
|
|
|
@@ -8207,7 +8217,7 @@ async function convertValueToCoords(state, options) {
|
|
|
8207
8217
|
const side = getSide(placement);
|
|
8208
8218
|
const alignment = getAlignment(placement);
|
|
8209
8219
|
const isVertical = getSideAxis(placement) === 'y';
|
|
8210
|
-
const mainAxisMulti =
|
|
8220
|
+
const mainAxisMulti = originSides.has(side) ? -1 : 1;
|
|
8211
8221
|
const crossAxisMulti = rtl && isVertical ? -1 : 1;
|
|
8212
8222
|
const rawValue = evaluate(options, state);
|
|
8213
8223
|
|
|
@@ -8279,7 +8289,7 @@ const offset$2 = function (options) {
|
|
|
8279
8289
|
};
|
|
8280
8290
|
|
|
8281
8291
|
function getCssDimensions(element) {
|
|
8282
|
-
const css = getComputedStyle(element);
|
|
8292
|
+
const css = getComputedStyle$1(element);
|
|
8283
8293
|
// In testing environments, the `width` and `height` properties are empty
|
|
8284
8294
|
// strings for SVG elements, returning NaN. Fallback to `0` in this case.
|
|
8285
8295
|
let width = parseFloat(css.width) || 0;
|
|
@@ -8384,7 +8394,7 @@ function getBoundingClientRect(element, includeScale, isFixedStrategy, offsetPar
|
|
|
8384
8394
|
while (currentIFrame && offsetParent && offsetWin !== currentWin) {
|
|
8385
8395
|
const iframeScale = getScale(currentIFrame);
|
|
8386
8396
|
const iframeRect = currentIFrame.getBoundingClientRect();
|
|
8387
|
-
const css = getComputedStyle(currentIFrame);
|
|
8397
|
+
const css = getComputedStyle$1(currentIFrame);
|
|
8388
8398
|
const left = iframeRect.left + (currentIFrame.clientLeft + parseFloat(css.paddingLeft)) * iframeScale.x;
|
|
8389
8399
|
const top = iframeRect.top + (currentIFrame.clientTop + parseFloat(css.paddingTop)) * iframeScale.y;
|
|
8390
8400
|
x *= iframeScale.x;
|
|
@@ -8415,14 +8425,9 @@ function getWindowScrollBarX(element, rect) {
|
|
|
8415
8425
|
return rect.left + leftScroll;
|
|
8416
8426
|
}
|
|
8417
8427
|
|
|
8418
|
-
function getHTMLOffset(documentElement, scroll
|
|
8419
|
-
if (ignoreScrollbarX === void 0) {
|
|
8420
|
-
ignoreScrollbarX = false;
|
|
8421
|
-
}
|
|
8428
|
+
function getHTMLOffset(documentElement, scroll) {
|
|
8422
8429
|
const htmlRect = documentElement.getBoundingClientRect();
|
|
8423
|
-
const x = htmlRect.left + scroll.scrollLeft - (
|
|
8424
|
-
// RTL <body> scrollbar.
|
|
8425
|
-
getWindowScrollBarX(documentElement, htmlRect));
|
|
8430
|
+
const x = htmlRect.left + scroll.scrollLeft - getWindowScrollBarX(documentElement, htmlRect);
|
|
8426
8431
|
const y = htmlRect.top + scroll.scrollTop;
|
|
8427
8432
|
return {
|
|
8428
8433
|
x,
|
|
@@ -8461,7 +8466,7 @@ function convertOffsetParentRelativeRectToViewportRelativeRect(_ref) {
|
|
|
8461
8466
|
offsets.y = offsetRect.y + offsetParent.clientTop;
|
|
8462
8467
|
}
|
|
8463
8468
|
}
|
|
8464
|
-
const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll
|
|
8469
|
+
const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll) : createCoords(0);
|
|
8465
8470
|
return {
|
|
8466
8471
|
width: rect.width * scale.x,
|
|
8467
8472
|
height: rect.height * scale.y,
|
|
@@ -8484,7 +8489,7 @@ function getDocumentRect(element) {
|
|
|
8484
8489
|
const height = max(html.scrollHeight, html.clientHeight, body.scrollHeight, body.clientHeight);
|
|
8485
8490
|
let x = -scroll.scrollLeft + getWindowScrollBarX(element);
|
|
8486
8491
|
const y = -scroll.scrollTop;
|
|
8487
|
-
if (getComputedStyle(body).direction === 'rtl') {
|
|
8492
|
+
if (getComputedStyle$1(body).direction === 'rtl') {
|
|
8488
8493
|
x += max(html.clientWidth, body.clientWidth) - width;
|
|
8489
8494
|
}
|
|
8490
8495
|
return {
|
|
@@ -8495,6 +8500,10 @@ function getDocumentRect(element) {
|
|
|
8495
8500
|
};
|
|
8496
8501
|
}
|
|
8497
8502
|
|
|
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;
|
|
8498
8507
|
function getViewportRect(element, strategy) {
|
|
8499
8508
|
const win = getWindow(element);
|
|
8500
8509
|
const html = getDocumentElement(element);
|
|
@@ -8512,6 +8521,24 @@ function getViewportRect(element, strategy) {
|
|
|
8512
8521
|
y = visualViewport.offsetTop;
|
|
8513
8522
|
}
|
|
8514
8523
|
}
|
|
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
|
+
}
|
|
8515
8542
|
return {
|
|
8516
8543
|
width,
|
|
8517
8544
|
height,
|
|
@@ -8520,6 +8547,7 @@ function getViewportRect(element, strategy) {
|
|
|
8520
8547
|
};
|
|
8521
8548
|
}
|
|
8522
8549
|
|
|
8550
|
+
const absoluteOrFixed = /*#__PURE__*/new Set(['absolute', 'fixed']);
|
|
8523
8551
|
// Returns the inner client rect, subtracting scrollbars if present.
|
|
8524
8552
|
function getInnerBoundingClientRect(element, strategy) {
|
|
8525
8553
|
const clientRect = getBoundingClientRect(element, true, strategy === 'fixed');
|
|
@@ -8561,7 +8589,7 @@ function hasFixedPositionAncestor(element, stopNode) {
|
|
|
8561
8589
|
if (parentNode === stopNode || !isElement(parentNode) || isLastTraversableNode(parentNode)) {
|
|
8562
8590
|
return false;
|
|
8563
8591
|
}
|
|
8564
|
-
return getComputedStyle(parentNode).position === 'fixed' || hasFixedPositionAncestor(parentNode, stopNode);
|
|
8592
|
+
return getComputedStyle$1(parentNode).position === 'fixed' || hasFixedPositionAncestor(parentNode, stopNode);
|
|
8565
8593
|
}
|
|
8566
8594
|
|
|
8567
8595
|
// A "clipping ancestor" is an `overflow` element with the characteristic of
|
|
@@ -8574,17 +8602,17 @@ function getClippingElementAncestors(element, cache) {
|
|
|
8574
8602
|
}
|
|
8575
8603
|
let result = getOverflowAncestors(element, [], false).filter(el => isElement(el) && getNodeName(el) !== 'body');
|
|
8576
8604
|
let currentContainingBlockComputedStyle = null;
|
|
8577
|
-
const elementIsFixed = getComputedStyle(element).position === 'fixed';
|
|
8605
|
+
const elementIsFixed = getComputedStyle$1(element).position === 'fixed';
|
|
8578
8606
|
let currentNode = elementIsFixed ? getParentNode(element) : element;
|
|
8579
8607
|
|
|
8580
8608
|
// https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block
|
|
8581
8609
|
while (isElement(currentNode) && !isLastTraversableNode(currentNode)) {
|
|
8582
|
-
const computedStyle = getComputedStyle(currentNode);
|
|
8610
|
+
const computedStyle = getComputedStyle$1(currentNode);
|
|
8583
8611
|
const currentNodeIsContaining = isContainingBlock(currentNode);
|
|
8584
8612
|
if (!currentNodeIsContaining && computedStyle.position === 'fixed') {
|
|
8585
8613
|
currentContainingBlockComputedStyle = null;
|
|
8586
8614
|
}
|
|
8587
|
-
const shouldDropCurrentNode = elementIsFixed ? !currentNodeIsContaining && !currentContainingBlockComputedStyle : !currentNodeIsContaining && computedStyle.position === 'static' && !!currentContainingBlockComputedStyle &&
|
|
8615
|
+
const shouldDropCurrentNode = elementIsFixed ? !currentNodeIsContaining && !currentContainingBlockComputedStyle : !currentNodeIsContaining && computedStyle.position === 'static' && !!currentContainingBlockComputedStyle && absoluteOrFixed.has(currentContainingBlockComputedStyle.position) || isOverflowElement(currentNode) && !currentNodeIsContaining && hasFixedPositionAncestor(element, currentNode);
|
|
8588
8616
|
if (shouldDropCurrentNode) {
|
|
8589
8617
|
// Drop non-containing blocks.
|
|
8590
8618
|
result = result.filter(ancestor => ancestor !== currentNode);
|
|
@@ -8680,11 +8708,11 @@ function getRectRelativeToOffsetParent(element, offsetParent, strategy) {
|
|
|
8680
8708
|
}
|
|
8681
8709
|
|
|
8682
8710
|
function isStaticPositioned(element) {
|
|
8683
|
-
return getComputedStyle(element).position === 'static';
|
|
8711
|
+
return getComputedStyle$1(element).position === 'static';
|
|
8684
8712
|
}
|
|
8685
8713
|
|
|
8686
8714
|
function getTrueOffsetParent(element, polyfill) {
|
|
8687
|
-
if (!isHTMLElement(element) || getComputedStyle(element).position === 'fixed') {
|
|
8715
|
+
if (!isHTMLElement(element) || getComputedStyle$1(element).position === 'fixed') {
|
|
8688
8716
|
return null;
|
|
8689
8717
|
}
|
|
8690
8718
|
if (polyfill) {
|
|
@@ -8745,7 +8773,7 @@ const getElementRects = async function (data) {
|
|
|
8745
8773
|
};
|
|
8746
8774
|
|
|
8747
8775
|
function isRTL(element) {
|
|
8748
|
-
return getComputedStyle(element).direction === 'rtl';
|
|
8776
|
+
return getComputedStyle$1(element).direction === 'rtl';
|
|
8749
8777
|
}
|
|
8750
8778
|
|
|
8751
8779
|
const platform = {
|
|
@@ -9385,7 +9413,7 @@ const FloatingArrow = /*#__PURE__*/React.forwardRef(function FloatingArrow(props
|
|
|
9385
9413
|
// https://github.com/floating-ui/floating-ui/issues/2932
|
|
9386
9414
|
index$1(() => {
|
|
9387
9415
|
if (!floating) return;
|
|
9388
|
-
const isRTL = getComputedStyle(floating).direction === 'rtl';
|
|
9416
|
+
const isRTL = getComputedStyle$1(floating).direction === 'rtl';
|
|
9389
9417
|
if (isRTL) {
|
|
9390
9418
|
setIsRTL(true);
|
|
9391
9419
|
}
|
|
@@ -9644,7 +9672,7 @@ function useFloating(options) {
|
|
|
9644
9672
|
}
|
|
9645
9673
|
|
|
9646
9674
|
/*!
|
|
9647
|
-
react-datepicker v8.
|
|
9675
|
+
react-datepicker v8.5.0
|
|
9648
9676
|
https://github.com/Hacker0x01/react-datepicker
|
|
9649
9677
|
Released under the MIT License.
|
|
9650
9678
|
*/
|
|
@@ -9879,12 +9907,13 @@ var DATE_RANGE_SEPARATOR = " - ";
|
|
|
9879
9907
|
* @returns - The formatted date range or an empty string.
|
|
9880
9908
|
*/
|
|
9881
9909
|
function safeDateRangeFormat(startDate, endDate, props) {
|
|
9882
|
-
if (!startDate) {
|
|
9910
|
+
if (!startDate && !endDate) {
|
|
9883
9911
|
return "";
|
|
9884
9912
|
}
|
|
9885
|
-
var formattedStartDate = safeDateFormat(startDate, props);
|
|
9913
|
+
var formattedStartDate = startDate ? safeDateFormat(startDate, props) : "";
|
|
9886
9914
|
var formattedEndDate = endDate ? safeDateFormat(endDate, props) : "";
|
|
9887
|
-
|
|
9915
|
+
var dateRangeSeparator = props.rangeSeparator || DATE_RANGE_SEPARATOR;
|
|
9916
|
+
return "".concat(formattedStartDate).concat(dateRangeSeparator).concat(formattedEndDate);
|
|
9888
9917
|
}
|
|
9889
9918
|
/**
|
|
9890
9919
|
* Safely formats multiple dates.
|
|
@@ -11405,7 +11434,10 @@ var Week = /** @class */ (function (_super) {
|
|
|
11405
11434
|
"react-datepicker__week--selected": isSameDay(this.startOfWeek(), this.props.selected),
|
|
11406
11435
|
"react-datepicker__week--keyboard-selected": this.isKeyboardSelected(),
|
|
11407
11436
|
};
|
|
11408
|
-
|
|
11437
|
+
var customWeekClassName = this.props.weekClassName
|
|
11438
|
+
? this.props.weekClassName(this.startOfWeek())
|
|
11439
|
+
: undefined;
|
|
11440
|
+
return (React__default.createElement("div", { className: clsx(weekNumberClasses, customWeekClassName) }, this.renderDays()));
|
|
11409
11441
|
};
|
|
11410
11442
|
return Week;
|
|
11411
11443
|
}(Component));
|
|
@@ -12625,19 +12657,20 @@ var Year$1 = /** @class */ (function (_super) {
|
|
|
12625
12657
|
return isSameYear(_year, endDate !== null && endDate !== void 0 ? endDate : null);
|
|
12626
12658
|
};
|
|
12627
12659
|
_this.isKeyboardSelected = function (y) {
|
|
12628
|
-
if (_this.props.
|
|
12629
|
-
_this.props.
|
|
12660
|
+
if (_this.props.disabledKeyboardNavigation ||
|
|
12661
|
+
_this.props.date === undefined ||
|
|
12630
12662
|
_this.props.preSelection == null) {
|
|
12631
12663
|
return;
|
|
12632
12664
|
}
|
|
12633
|
-
var _a = _this.props, minDate = _a.minDate, maxDate = _a.maxDate, excludeDates = _a.excludeDates, includeDates = _a.includeDates, filterDate = _a.filterDate;
|
|
12665
|
+
var _a = _this.props, minDate = _a.minDate, maxDate = _a.maxDate, excludeDates = _a.excludeDates, includeDates = _a.includeDates, filterDate = _a.filterDate, selected = _a.selected;
|
|
12634
12666
|
var date = getStartOfYear(setYear(_this.props.date, y));
|
|
12635
12667
|
var isDisabled = (minDate || maxDate || excludeDates || includeDates || filterDate) &&
|
|
12636
12668
|
isYearDisabled(y, _this.props);
|
|
12637
|
-
|
|
12638
|
-
|
|
12639
|
-
|
|
12640
|
-
|
|
12669
|
+
var isSelectedDay = !!selected && isSameDay(date, getStartOfYear(selected));
|
|
12670
|
+
var isKeyboardSelectedDay = isSameDay(date, getStartOfYear(_this.props.preSelection));
|
|
12671
|
+
return (!_this.props.inline &&
|
|
12672
|
+
!isSelectedDay &&
|
|
12673
|
+
isKeyboardSelectedDay &&
|
|
12641
12674
|
!isDisabled);
|
|
12642
12675
|
};
|
|
12643
12676
|
_this.isSelectedYear = function (year) {
|
|
@@ -12986,6 +13019,7 @@ var DROPDOWN_FOCUS_CLASSNAMES = [
|
|
|
12986
13019
|
"react-datepicker__month-select",
|
|
12987
13020
|
"react-datepicker__month-year-select",
|
|
12988
13021
|
];
|
|
13022
|
+
var OUTSIDE_CLICK_IGNORE_CLASS = "react-datepicker-ignore-onclickoutside";
|
|
12989
13023
|
var isDropdownSelect = function (element) {
|
|
12990
13024
|
var classNames = (element.className || "").split(/\s+/);
|
|
12991
13025
|
return DROPDOWN_FOCUS_CLASSNAMES.some(function (testClassname) { return classNames.indexOf(testClassname) >= 0; });
|
|
@@ -13137,7 +13171,9 @@ var Calendar = /** @class */ (function (_super) {
|
|
|
13137
13171
|
var startOfWeek = getStartOfWeek(date, _this.props.locale, _this.props.calendarStartDay);
|
|
13138
13172
|
var dayNames = [];
|
|
13139
13173
|
if (_this.props.showWeekNumbers) {
|
|
13140
|
-
dayNames.push(React__default.createElement("div", { key: "W", className: "react-datepicker__day-name"
|
|
13174
|
+
dayNames.push(React__default.createElement("div", { key: "W", className: "react-datepicker__day-name", role: "columnheader" },
|
|
13175
|
+
React__default.createElement("span", { className: "sr-only" }, "Week number"),
|
|
13176
|
+
React__default.createElement("span", { "aria-hidden": "true" }, _this.props.weekLabel || "#")));
|
|
13141
13177
|
}
|
|
13142
13178
|
return dayNames.concat([0, 1, 2, 3, 4, 5, 6].map(function (offset) {
|
|
13143
13179
|
var day = addDays(startOfWeek, offset);
|
|
@@ -13145,7 +13181,9 @@ var Calendar = /** @class */ (function (_super) {
|
|
|
13145
13181
|
var weekDayClassName = _this.props.weekDayClassName
|
|
13146
13182
|
? _this.props.weekDayClassName(day)
|
|
13147
13183
|
: undefined;
|
|
13148
|
-
return (React__default.createElement("div", { key: offset,
|
|
13184
|
+
return (React__default.createElement("div", { key: offset, role: "columnheader", className: clsx("react-datepicker__day-name", weekDayClassName) },
|
|
13185
|
+
React__default.createElement("span", { className: "sr-only" }, formatDate(day, "EEEE", _this.props.locale)),
|
|
13186
|
+
React__default.createElement("span", { "aria-hidden": "true" }, weekDayName)));
|
|
13149
13187
|
}));
|
|
13150
13188
|
};
|
|
13151
13189
|
_this.formatWeekday = function (day, locale) {
|
|
@@ -13360,7 +13398,7 @@ var Calendar = /** @class */ (function (_super) {
|
|
|
13360
13398
|
_this.renderMonthDropdown(i !== 0),
|
|
13361
13399
|
_this.renderMonthYearDropdown(i !== 0),
|
|
13362
13400
|
_this.renderYearDropdown(i !== 0)),
|
|
13363
|
-
React__default.createElement("div", { className: "react-datepicker__day-names" }, _this.header(monthDate))));
|
|
13401
|
+
React__default.createElement("div", { className: "react-datepicker__day-names", role: "row" }, _this.header(monthDate))));
|
|
13364
13402
|
};
|
|
13365
13403
|
_this.renderCustomHeader = function (headerArgs) {
|
|
13366
13404
|
var _a, _b;
|
|
@@ -13369,6 +13407,15 @@ var Calendar = /** @class */ (function (_super) {
|
|
|
13369
13407
|
_this.props.showTimeSelectOnly) {
|
|
13370
13408
|
return null;
|
|
13371
13409
|
}
|
|
13410
|
+
var _c = _this.props, showYearPicker = _c.showYearPicker, yearItemNumber = _c.yearItemNumber;
|
|
13411
|
+
var visibleYearsRange;
|
|
13412
|
+
if (showYearPicker) {
|
|
13413
|
+
var _d = getYearsPeriod(monthDate, yearItemNumber), startYear = _d.startPeriod, endYear = _d.endPeriod;
|
|
13414
|
+
visibleYearsRange = {
|
|
13415
|
+
startYear: startYear,
|
|
13416
|
+
endYear: endYear,
|
|
13417
|
+
};
|
|
13418
|
+
}
|
|
13372
13419
|
var prevMonthButtonDisabled = monthDisabledBefore(_this.state.date, _this.props);
|
|
13373
13420
|
var nextMonthButtonDisabled = monthDisabledAfter(_this.state.date, _this.props);
|
|
13374
13421
|
var prevYearButtonDisabled = yearDisabledBefore(_this.state.date, _this.props);
|
|
@@ -13377,7 +13424,7 @@ var Calendar = /** @class */ (function (_super) {
|
|
|
13377
13424
|
!_this.props.showQuarterYearPicker &&
|
|
13378
13425
|
!_this.props.showYearPicker;
|
|
13379
13426
|
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 })),
|
|
13427
|
+
_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 })),
|
|
13381
13428
|
showDayNames && (React__default.createElement("div", { className: "react-datepicker__day-names" }, _this.header(monthDate)))));
|
|
13382
13429
|
};
|
|
13383
13430
|
_this.renderYearHeader = function (_a) {
|
|
@@ -13497,6 +13544,7 @@ var Calendar = /** @class */ (function (_super) {
|
|
|
13497
13544
|
return {
|
|
13498
13545
|
monthsShown: 1,
|
|
13499
13546
|
forceShowMonthNavigation: false,
|
|
13547
|
+
outsideClickIgnoreClass: OUTSIDE_CLICK_IGNORE_CLASS,
|
|
13500
13548
|
timeCaption: "Time",
|
|
13501
13549
|
previousYearButtonLabel: "Previous Year",
|
|
13502
13550
|
nextYearButtonLabel: "Next Year",
|
|
@@ -13785,7 +13833,6 @@ var PopperComponent = /** @class */ (function (_super) {
|
|
|
13785
13833
|
}(Component));
|
|
13786
13834
|
var PopperComponent$1 = withFloating(PopperComponent);
|
|
13787
13835
|
|
|
13788
|
-
var outsideClickIgnoreClass = "react-datepicker-ignore-onclickoutside";
|
|
13789
13836
|
// Compares dates year+month combinations
|
|
13790
13837
|
function hasPreSelectionChanged(date1, date2) {
|
|
13791
13838
|
if (date1 && date2) {
|
|
@@ -13851,6 +13898,35 @@ var DatePicker = /** @class */ (function (_super) {
|
|
|
13851
13898
|
wasHidden: false,
|
|
13852
13899
|
};
|
|
13853
13900
|
};
|
|
13901
|
+
_this.getInputValue = function () {
|
|
13902
|
+
var _a;
|
|
13903
|
+
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;
|
|
13904
|
+
var dateFormat = (_a = _this.props.dateFormat) !== null && _a !== void 0 ? _a : DatePicker.defaultProps.dateFormat;
|
|
13905
|
+
var inputValue = _this.state.inputValue;
|
|
13906
|
+
if (typeof value === "string") {
|
|
13907
|
+
return value;
|
|
13908
|
+
}
|
|
13909
|
+
else if (typeof inputValue === "string") {
|
|
13910
|
+
return inputValue;
|
|
13911
|
+
}
|
|
13912
|
+
else if (selectsRange) {
|
|
13913
|
+
return safeDateRangeFormat(startDate, endDate, {
|
|
13914
|
+
dateFormat: dateFormat,
|
|
13915
|
+
locale: locale,
|
|
13916
|
+
rangeSeparator: rangeSeparator,
|
|
13917
|
+
});
|
|
13918
|
+
}
|
|
13919
|
+
else if (selectsMultiple) {
|
|
13920
|
+
return safeMultipleDatesFormat(selectedDates !== null && selectedDates !== void 0 ? selectedDates : [], {
|
|
13921
|
+
dateFormat: dateFormat,
|
|
13922
|
+
locale: locale,
|
|
13923
|
+
});
|
|
13924
|
+
}
|
|
13925
|
+
return safeDateFormat(selected, {
|
|
13926
|
+
dateFormat: dateFormat,
|
|
13927
|
+
locale: locale,
|
|
13928
|
+
});
|
|
13929
|
+
};
|
|
13854
13930
|
_this.resetHiddenStatus = function () {
|
|
13855
13931
|
_this.setState(_assign(_assign({}, _this.state), { wasHidden: false }));
|
|
13856
13932
|
};
|
|
@@ -13950,11 +14026,15 @@ var DatePicker = /** @class */ (function (_super) {
|
|
|
13950
14026
|
_this.handleDropdownFocus = function () {
|
|
13951
14027
|
_this.cancelFocusInput();
|
|
13952
14028
|
};
|
|
14029
|
+
_this.resetInputValue = function () {
|
|
14030
|
+
_this.setState(_assign(_assign({}, _this.state), { inputValue: null }));
|
|
14031
|
+
};
|
|
13953
14032
|
_this.handleBlur = function (event) {
|
|
13954
14033
|
var _a, _b;
|
|
13955
14034
|
if (!_this.state.open || _this.props.withPortal || _this.props.showTimeInput) {
|
|
13956
14035
|
(_b = (_a = _this.props).onBlur) === null || _b === void 0 ? void 0 : _b.call(_a, event);
|
|
13957
14036
|
}
|
|
14037
|
+
_this.resetInputValue();
|
|
13958
14038
|
if (_this.state.open && _this.props.open === false) {
|
|
13959
14039
|
_this.setOpen(false);
|
|
13960
14040
|
}
|
|
@@ -13995,11 +14075,17 @@ var DatePicker = /** @class */ (function (_super) {
|
|
|
13995
14075
|
var strictParsing = (_b = _this.props.strictParsing) !== null && _b !== void 0 ? _b : DatePicker.defaultProps.strictParsing;
|
|
13996
14076
|
var value = (event === null || event === void 0 ? void 0 : event.target) instanceof HTMLInputElement ? event.target.value : "";
|
|
13997
14077
|
if (selectsRange) {
|
|
14078
|
+
var rangeSeparator = _this.props.rangeSeparator;
|
|
14079
|
+
var trimmedRangeSeparator = rangeSeparator.trim();
|
|
13998
14080
|
var _g = value
|
|
13999
|
-
.split(dateFormat.includes(
|
|
14081
|
+
.split(dateFormat.includes(trimmedRangeSeparator)
|
|
14082
|
+
? rangeSeparator
|
|
14083
|
+
: trimmedRangeSeparator, 2)
|
|
14000
14084
|
.map(function (val) { return val.trim(); }), valueStart = _g[0], valueEnd = _g[1];
|
|
14001
14085
|
var startDateNew = parseDate(valueStart !== null && valueStart !== void 0 ? valueStart : "", dateFormat, _this.props.locale, strictParsing);
|
|
14002
|
-
var endDateNew =
|
|
14086
|
+
var endDateNew = startDateNew
|
|
14087
|
+
? parseDate(valueEnd !== null && valueEnd !== void 0 ? valueEnd : "", dateFormat, _this.props.locale, strictParsing)
|
|
14088
|
+
: null;
|
|
14003
14089
|
var startChanged = (startDate === null || startDate === void 0 ? void 0 : startDate.getTime()) !== (startDateNew === null || startDateNew === void 0 ? void 0 : startDateNew.getTime());
|
|
14004
14090
|
var endChanged = (endDate === null || endDate === void 0 ? void 0 : endDate.getTime()) !== (endDateNew === null || endDateNew === void 0 ? void 0 : endDateNew.getTime());
|
|
14005
14091
|
if (!startChanged && !endChanged) {
|
|
@@ -14114,6 +14200,7 @@ var DatePicker = /** @class */ (function (_super) {
|
|
|
14114
14200
|
if (selectsRange) {
|
|
14115
14201
|
var noRanges = !startDate && !endDate;
|
|
14116
14202
|
var hasStartRange = startDate && !endDate;
|
|
14203
|
+
var hasOnlyEndRange = !startDate && !!endDate;
|
|
14117
14204
|
var isRangeFilled = startDate && endDate;
|
|
14118
14205
|
if (noRanges) {
|
|
14119
14206
|
onChange === null || onChange === void 0 ? void 0 : onChange([changedDate, null], event);
|
|
@@ -14134,6 +14221,14 @@ var DatePicker = /** @class */ (function (_super) {
|
|
|
14134
14221
|
onChange === null || onChange === void 0 ? void 0 : onChange([startDate, changedDate], event);
|
|
14135
14222
|
}
|
|
14136
14223
|
}
|
|
14224
|
+
else if (hasOnlyEndRange) {
|
|
14225
|
+
if (changedDate && isDateBefore(changedDate, endDate)) {
|
|
14226
|
+
onChange === null || onChange === void 0 ? void 0 : onChange([changedDate, endDate], event);
|
|
14227
|
+
}
|
|
14228
|
+
else {
|
|
14229
|
+
onChange === null || onChange === void 0 ? void 0 : onChange([changedDate, null], event);
|
|
14230
|
+
}
|
|
14231
|
+
}
|
|
14137
14232
|
if (isRangeFilled) {
|
|
14138
14233
|
onChange === null || onChange === void 0 ? void 0 : onChange([changedDate, null], event);
|
|
14139
14234
|
}
|
|
@@ -14507,10 +14602,12 @@ var DatePicker = /** @class */ (function (_super) {
|
|
|
14507
14602
|
}
|
|
14508
14603
|
return (React__default.createElement(Calendar, _assign({ showMonthYearDropdown: undefined, ref: function (elem) {
|
|
14509
14604
|
_this.calendar = elem;
|
|
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));
|
|
14605
|
+
} }, _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));
|
|
14511
14606
|
};
|
|
14512
14607
|
_this.renderAriaLiveRegion = function () {
|
|
14513
|
-
var _a
|
|
14608
|
+
var _a;
|
|
14609
|
+
var locale = _this.props.locale;
|
|
14610
|
+
var dateFormat = (_a = _this.props.dateFormat) !== null && _a !== void 0 ? _a : DatePicker.defaultProps.dateFormat;
|
|
14514
14611
|
var isContainsTime = _this.props.showTimeInput || _this.props.showTimeSelect;
|
|
14515
14612
|
var longDateFormat = isContainsTime ? "PPPPp" : "PPPP";
|
|
14516
14613
|
var ariaLiveMessage;
|
|
@@ -14553,36 +14650,17 @@ var DatePicker = /** @class */ (function (_super) {
|
|
|
14553
14650
|
};
|
|
14554
14651
|
_this.renderDateInput = function () {
|
|
14555
14652
|
var _a, _b;
|
|
14556
|
-
var _c;
|
|
14557
14653
|
var className = clsx(_this.props.className, (_a = {},
|
|
14558
|
-
_a[
|
|
14654
|
+
_a[_this.props.outsideClickIgnoreClass ||
|
|
14655
|
+
DatePicker.defaultProps.outsideClickIgnoreClass] = _this.state.open,
|
|
14559
14656
|
_a));
|
|
14560
14657
|
var customInput = _this.props.customInput || React__default.createElement("input", { type: "text" });
|
|
14561
14658
|
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
|
-
});
|
|
14581
14659
|
return cloneElement(customInput, (_b = {},
|
|
14582
14660
|
_b[customInputRef] = function (input) {
|
|
14583
14661
|
_this.input = input;
|
|
14584
14662
|
},
|
|
14585
|
-
_b.value =
|
|
14663
|
+
_b.value = _this.getInputValue(),
|
|
14586
14664
|
_b.onBlur = _this.handleBlur,
|
|
14587
14665
|
_b.onChange = _this.handleChange,
|
|
14588
14666
|
_b.onClick = _this.onInputClick,
|
|
@@ -14635,7 +14713,9 @@ var DatePicker = /** @class */ (function (_super) {
|
|
|
14635
14713
|
dropdownMode: "scroll",
|
|
14636
14714
|
preventOpenOnFocus: false,
|
|
14637
14715
|
monthsShown: 1,
|
|
14716
|
+
outsideClickIgnoreClass: OUTSIDE_CLICK_IGNORE_CLASS,
|
|
14638
14717
|
readOnly: false,
|
|
14718
|
+
rangeSeparator: DATE_RANGE_SEPARATOR,
|
|
14639
14719
|
withPortal: false,
|
|
14640
14720
|
selectsDisabledDaysInRange: false,
|
|
14641
14721
|
shouldCloseOnSelect: true,
|
|
@@ -15148,4 +15228,4 @@ var InlineDatePicker = function (props) {
|
|
|
15148
15228
|
};
|
|
15149
15229
|
|
|
15150
15230
|
export { DatePickerGroup as D, HelperText as H, InlineDatePicker as I, ValidationText as V };
|
|
15151
|
-
//# sourceMappingURL=InlineDatePicker-
|
|
15231
|
+
//# sourceMappingURL=InlineDatePicker-BeRq7pJP.js.map
|