@wix/editor-react-components 1.2769.0 → 1.2771.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/site/components/AudioPlayer/component.js +2 -2
- package/dist/site/components/Breadcrumbs/component.js +1 -1
- package/dist/site/components/DatePicker/DatePicker.types.d.ts +20 -76
- package/dist/site/components/DatePicker/component.js +232 -1240
- package/dist/site/components/DatePicker/components/DatePickerCalendar.d.ts +3 -2
- package/dist/site/components/DatePicker/components/DatePickerField.d.ts +1 -3
- package/dist/site/components/DatePicker/constants.d.ts +47 -79
- package/dist/site/components/DatePicker/css.css +60 -287
- package/dist/site/components/DatePicker/datePickerUtils.d.ts +8 -26
- package/dist/site/components/DatePicker/manifest.js +234 -207
- package/dist/site/components/Repeater/component.js +6 -6
- package/dist/site/components/TextInput/component.js +2 -2
- package/dist/site/components/TimePicker/component.js +350 -3
- package/dist/site/components/chunks/Button.js +2 -2
- package/dist/site/components/chunks/{DismissSmall.js → DateField.js} +56 -430
- package/dist/site/components/chunks/Group.js +44 -44
- package/dist/site/components/chunks/I18nProvider.js +1 -1
- package/dist/site/components/chunks/Input.js +3 -26
- package/dist/site/components/chunks/VisuallyHidden.js +1 -1
- package/dist/site/components/chunks/constants37.js +59 -90
- package/dist/site/components/chunks/filterDOMProps.js +11 -11
- package/dist/site/components/chunks/index11.js +8 -4
- package/package.json +2 -2
- package/dist/site/components/DatePicker/components/DatePickerLabel.d.ts +0 -8
- package/dist/site/components/DatePicker/components/DatePickerTooltip.d.ts +0 -5
- package/dist/site/components/DatePicker/hooks/useDateConstraints.d.ts +0 -12
- package/dist/site/components/DatePicker/hooks/useDatePickerValue.d.ts +0 -15
- package/dist/site/components/DatePicker/hooks/useUnavailableDates.d.ts +0 -3
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { jsxs,
|
|
1
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
import React__default, { createContext, useEffect, useMemo, useRef, useState, useContext, forwardRef, useCallback } from "react";
|
|
4
4
|
import { c as clsx } from "../chunks/clsx.js";
|
|
5
5
|
import { b as $d27d541f9569d26d$export$45712eceda6fad21, d as $24f9a20f226ad820$export$5165eccb35aaadb5, e as $2b2d34ff061957fb$export$2b85b721e524d74b, f as $d2b4bc8c273e7be6$export$24d547caef80ccd1, $ as $d2b4bc8c273e7be6$export$353f5b6fc5456de1 } from "../chunks/Button.js";
|
|
6
|
-
import {
|
|
7
|
-
import { c as $191c9b6d48a0a4e2$export$294aa081a6c6f55d,
|
|
8
|
-
import {
|
|
6
|
+
import { a as $8e9d2fae0ecb9001$export$457c3d6518dd4c6f, $ as $c7eafbbe1ea5834e$export$535bd6ca7f90a273, c as $64fa3d84918910a7$export$29f1550f4b0d4415, d as $64fa3d84918910a7$export$4d86445c2cf5e3, e as $65484d02dcb7eb3e$export$457c3d6518dd4c6f, b as $64fa3d84918910a7$export$2881499e37b75b9a, g as $64fa3d84918910a7$export$fabf2dc03a41866e, m as $f39a9eba43920ace$export$b5d7cc18bb8d2b59, j as $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c, n as $3ef42575df84b30b$export$9d1611c77c2fe928, o as $64fa3d84918910a7$export$c62b8e45d58ddad9, h as $64fa3d84918910a7$export$9d4c57ee4c6ffdd8, i as $64fa3d84918910a7$export$ef03459518577ad4 } from "../chunks/filterDOMProps.js";
|
|
7
|
+
import { c as $191c9b6d48a0a4e2$export$294aa081a6c6f55d, j as $fd2148440a13ec26$export$a763b9476acd3eb, b as $fd2148440a13ec26$export$fc1a364ae1f3ff10, g as $514c0188e459b4c0$export$9afb8bc826b033ea, e as $d3e0e05bdfcf66bd$export$c24727297075ec6a, h as $ee014567cb39d3f0$export$ff05c3ac10437e03, $ as $514c0188e459b4c0$export$5f1af8db9871e1d6, a as $ee014567cb39d3f0$export$f551688fc98f2e09 } from "../chunks/Input.js";
|
|
8
|
+
import { j as $60f33508b4cd9d3b$export$85fd5fdf27bacc79, k as $ad063034c8620db8$export$ea39ec197993aef0, l as $ad063034c8620db8$export$a5a3b454ada2268e, m as $ad063034c8620db8$export$a2258d9c4118825c, n as $a46cf152bb926da5$export$a9b970dcc4ae71a9, o as $9c268ab73a5d55e5$export$722debc0e56fea39, p as $ad063034c8620db8$export$91b62ebf2ba703ee, q as $ad063034c8620db8$export$629b0a497aa65267, r as $121970af65029459$export$f8aeda7b10753fa1, s as $51a3e22a5186a962$export$c826860796309d1b, t as $3578607fe3d4b096$export$cfa2225e87938781, u as $ad063034c8620db8$export$42c81a444fbfb5d4, v as $ad063034c8620db8$export$d0bdf45af03a6ea3, w as $ad063034c8620db8$export$ccc1b2479e7dd654, x as $654b97e09f2a30c1$export$4d0f8be8b12a7ef6, y as $6a440d0e2d99dd46$export$4a931266a3838b86, z as $535772f9d2c1f38d$export$c5251b9e124bf29, A as $7541913c0284d84b$export$300019f83c56d282, B as $0014db39426443c5$exports, $ as $72abaeab4d80592f$export$9fc1347d4195ccb3, C as $535772f9d2c1f38d$export$20e40289641fbbb6, D as $535772f9d2c1f38d$export$1258395f99bf9cbf, E as $901761b40e390936$export$2bb74740c4e19def, c as $b3526bc71400be8d$export$d39e1813b3bdd0e1, F as $ad063034c8620db8$export$a75f2bff57811055, G as $d07e34cce18680fd$export$93522d1a439f3617, H as $ad063034c8620db8$export$5c333a116e949cdd, I as $ad063034c8620db8$export$f91e89d3d0406102, J as $12a3c853105e5a70$export$ad991b66133851cf, K as $d07e34cce18680fd$export$b4a036af3fc0b032, L as $ad063034c8620db8$export$dbc69fd56b53d5e, M as $ad063034c8620db8$export$2061056d06d7cdf7, N as $ad063034c8620db8$export$ef8b6d9133084f4e, O as $93635573935797de$export$80ee6245ec4f29ec, a as $f11fb0bcf1b2687a$export$61c6a8c84e605fb6, P as $8b141f2f71e88f85$export$2440da353cedad43, Q as $8b141f2f71e88f85$export$f18627323ab57ac0, R as $8b141f2f71e88f85$export$7e319ea407e63bc0, S as $8b141f2f71e88f85$export$c5221a78ef73c5e9, T as $d07e34cce18680fd$export$b21e0b124e224484, U as $84102b64e5ca022f$export$dd0bbc9b26defe37, V as $ad063034c8620db8$export$a18c89cbd24170ff, b as $d3f049242431219c$export$45fda7c47f93fd48, d as $d3f049242431219c$export$6d3443f2c48bfc20, e as $44f671af83e7d9e0$export$2de4954e8ae13b9f, W as $58246871e4652552$export$588937bcd60ade55, X as $58246871e4652552$export$6b862160d295c8e, Y as $40825cdb76e74f70$export$7b3e670c86da5fe8, g as $40825cdb76e74f70$export$7edc06cf1783b30f, h as $40825cdb76e74f70$export$336ab7fa954c4b5f } from "../chunks/DateField.js";
|
|
9
9
|
import { $ as $cf2482eff2eeeec2$export$f12b703ca79dfbb1 } from "../chunks/useLocalizedStringFormatter.js";
|
|
10
|
-
import {
|
|
10
|
+
import { s as $fe16bffc7a557bf0$export$7f54fc3180508a52, T as $390e54f620492c70$export$b4cc09c592e8fdb8, O as $e8ac3c3f5d4bae7f$export$d6875122194c7b44, a as $bbaa08b3cd72f041$export$9d1611c77c2fe928, y as $1969ac565cfec8d0$export$de79e2c695e052f3, d as $8f5a2122b0992be3$export$630ff653c5ada6a9, G as $23f2114a1b82827e$export$cd4e5573fbe2b576, k as $23f2114a1b82827e$export$e58f029f0fbfdb29, q as $d447af545b77c9f1$export$f21a1ffae260145a, F as $6a20a7989e6c817a$export$98658e8c59125e6a, v as $23f2114a1b82827e$export$4282f70798064fe0, o as $d447af545b77c9f1$export$b204af158042fbac, b as $390e54f620492c70$export$f680877a34711e37, N as $2c9edc598a03d523$export$420e68273165f4ec, K as $c4867b2f328c2698$export$e5c5a5f917a5871c, Q as $23f2114a1b82827e$export$b4f377a2b6254582, J as $f192c2f16961cbe0$export$80f3e147d781571c, n as $2add3ce32c6007eb$export$fedb369cb70207f1, C as $a4e76a5424781910$export$e08e3b67e392101e, i as $3e6197669829fe11$export$40bfa8c7b0832715, $ as $e969f22b6713ca4a$export$ae780daf29e6d456, E as $0c4a58759813079a$export$4e328f61c538687f, m as $a049562f99e7db0e$export$f9c6924e160136d1, l as $01b77f81d0f07f68$export$75b6ee27786ba447, g as $a049562f99e7db0e$export$eb2fcfdbd7ba97d4, h as $01b77f81d0f07f68$export$b04be29aa201d4f5 } from "../chunks/Group.js";
|
|
11
11
|
import { a as $2eb8e6d23f3d0cb0$export$43bb16f9c6d9e3f7, $ as $2eb8e6d23f3d0cb0$export$a54013f0d02a8f82 } from "../chunks/I18nProvider.js";
|
|
12
12
|
import { $ as $ea3928288112382f$export$439d29a4e110a164, a as $ea3928288112382f$export$a966af930f325cab } from "../chunks/VisuallyHidden.js";
|
|
13
13
|
import __rspack_external_react_dom_7136dc57__default from "react-dom";
|
|
@@ -17,8 +17,7 @@ import { T as TranslationsDefinition } from "../chunks/index4.js";
|
|
|
17
17
|
import { a as getDataAttributes } from "../chunks/dataUtils.js";
|
|
18
18
|
import { d as directionStyles } from "../chunks/direction.module.js";
|
|
19
19
|
import { p as presetWrapperStyles } from "../chunks/presetWrapper.module.js";
|
|
20
|
-
import {
|
|
21
|
-
import { I as InfoCircleSmall_default, R as RequiredIndicator, u as useValidatedField } from "../chunks/RequiredIndicator.js";
|
|
20
|
+
import { T as TestIds, s as selectors, D as DesignStates, A as ARIA_LABEL_NAMESPACE, d as defaultValues, a as AriaLabels } from "../chunks/constants37.js";
|
|
22
21
|
createContext(null);
|
|
23
22
|
createContext(null);
|
|
24
23
|
createContext(null);
|
|
@@ -916,7 +915,7 @@ $e05239aa7a8d905d$exports = {
|
|
|
916
915
|
"zh-CN": $a43114bde648d07d$exports,
|
|
917
916
|
"zh-TW": $139934e8158dd341$exports
|
|
918
917
|
};
|
|
919
|
-
function $parcel$interopDefault$
|
|
918
|
+
function $parcel$interopDefault$4(a) {
|
|
920
919
|
return a && a.__esModule ? a.default : a;
|
|
921
920
|
}
|
|
922
921
|
const $9bac9bf03b87f160$export$653eddfc964b0f8a = /* @__PURE__ */ new WeakMap();
|
|
@@ -924,7 +923,7 @@ function $9bac9bf03b87f160$export$134cbb7fb09a9522(date) {
|
|
|
924
923
|
return (date == null ? void 0 : date.calendar.identifier) === "gregory" && date.era === "BC" ? "short" : void 0;
|
|
925
924
|
}
|
|
926
925
|
function $9bac9bf03b87f160$export$b6df97c887c38e1a(state) {
|
|
927
|
-
let stringFormatter = $cf2482eff2eeeec2$export$f12b703ca79dfbb1($parcel$interopDefault$
|
|
926
|
+
let stringFormatter = $cf2482eff2eeeec2$export$f12b703ca79dfbb1($parcel$interopDefault$4($e05239aa7a8d905d$exports), "@react-aria/calendar");
|
|
928
927
|
let start, end;
|
|
929
928
|
if ("highlightedRange" in state) ({ start, end } = state.highlightedRange || {});
|
|
930
929
|
else start = end = state.value ?? void 0;
|
|
@@ -962,7 +961,7 @@ function $9bac9bf03b87f160$export$b6df97c887c38e1a(state) {
|
|
|
962
961
|
]);
|
|
963
962
|
}
|
|
964
963
|
function $9bac9bf03b87f160$export$31afe65d91ef6e8(startDate, endDate, timeZone, isAria) {
|
|
965
|
-
let stringFormatter = $cf2482eff2eeeec2$export$f12b703ca79dfbb1($parcel$interopDefault$
|
|
964
|
+
let stringFormatter = $cf2482eff2eeeec2$export$f12b703ca79dfbb1($parcel$interopDefault$4($e05239aa7a8d905d$exports), "@react-aria/calendar");
|
|
966
965
|
let era = $9bac9bf03b87f160$export$134cbb7fb09a9522(startDate) || $9bac9bf03b87f160$export$134cbb7fb09a9522(endDate);
|
|
967
966
|
let monthFormatter = $60f33508b4cd9d3b$export$85fd5fdf27bacc79({
|
|
968
967
|
month: "long",
|
|
@@ -1035,11 +1034,11 @@ function $3c71b1595a147f24$export$496315a1608d9602(cb, dependencies) {
|
|
|
1035
1034
|
lastDeps.current = dependencies;
|
|
1036
1035
|
}, dependencies);
|
|
1037
1036
|
}
|
|
1038
|
-
function $parcel$interopDefault$
|
|
1037
|
+
function $parcel$interopDefault$3(a) {
|
|
1039
1038
|
return a && a.__esModule ? a.default : a;
|
|
1040
1039
|
}
|
|
1041
1040
|
function $4ca33167bdccdd26$export$d652b3ea2d672d5b(props, state) {
|
|
1042
|
-
let stringFormatter = $cf2482eff2eeeec2$export$f12b703ca79dfbb1($parcel$interopDefault$
|
|
1041
|
+
let stringFormatter = $cf2482eff2eeeec2$export$f12b703ca79dfbb1($parcel$interopDefault$3($e05239aa7a8d905d$exports), "@react-aria/calendar");
|
|
1043
1042
|
let domProps = $8e9d2fae0ecb9001$export$457c3d6518dd4c6f(props);
|
|
1044
1043
|
let title = $9bac9bf03b87f160$export$31afe65d91ef6e8(state.visibleRange.start, state.visibleRange.end, state.timeZone, false);
|
|
1045
1044
|
let visibleRangeDescription = $9bac9bf03b87f160$export$31afe65d91ef6e8(state.visibleRange.start, state.visibleRange.end, state.timeZone, true);
|
|
@@ -1112,13 +1111,13 @@ function $4ca33167bdccdd26$export$d652b3ea2d672d5b(props, state) {
|
|
|
1112
1111
|
function $a1efc3efb5426bf7$export$3ee915f8151bd4f1(props, state) {
|
|
1113
1112
|
return $4ca33167bdccdd26$export$d652b3ea2d672d5b(props, state);
|
|
1114
1113
|
}
|
|
1115
|
-
function $parcel$interopDefault$
|
|
1114
|
+
function $parcel$interopDefault$2(a) {
|
|
1116
1115
|
return a && a.__esModule ? a.default : a;
|
|
1117
1116
|
}
|
|
1118
1117
|
function $be61a22f9aa88c7c$export$136073280381448e(props, state, ref) {
|
|
1119
1118
|
let { date, isDisabled } = props;
|
|
1120
1119
|
let { errorMessageId, selectedDateDescription } = $9bac9bf03b87f160$export$653eddfc964b0f8a.get(state);
|
|
1121
|
-
let stringFormatter = $cf2482eff2eeeec2$export$f12b703ca79dfbb1($parcel$interopDefault$
|
|
1120
|
+
let stringFormatter = $cf2482eff2eeeec2$export$f12b703ca79dfbb1($parcel$interopDefault$2($e05239aa7a8d905d$exports), "@react-aria/calendar");
|
|
1122
1121
|
let dateFormatter = $60f33508b4cd9d3b$export$85fd5fdf27bacc79({
|
|
1123
1122
|
weekday: "long",
|
|
1124
1123
|
day: "numeric",
|
|
@@ -1444,42 +1443,6 @@ function $2d54ee2ec11ddab8$export$cb95147730a423f5(props, state) {
|
|
|
1444
1443
|
weeksInMonth
|
|
1445
1444
|
};
|
|
1446
1445
|
}
|
|
1447
|
-
function $be0fc2ab732b9d1a$export$87e0539f600c24e5(props, state, ref) {
|
|
1448
|
-
let { commitBehavior = "select", ...otherProps } = props;
|
|
1449
|
-
let res = $4ca33167bdccdd26$export$d652b3ea2d672d5b(otherProps, state);
|
|
1450
|
-
let isVirtualClick = useRef(false);
|
|
1451
|
-
let windowRef = useRef(typeof window !== "undefined" ? window : null);
|
|
1452
|
-
$600b3cf69ae46262$export$90fc3a17d93f704c(windowRef, "pointerdown", (e) => {
|
|
1453
|
-
isVirtualClick.current = e.width === 0 && e.height === 0;
|
|
1454
|
-
});
|
|
1455
|
-
const commitBehaviorMapping = {
|
|
1456
|
-
clear: () => state.clearSelection(),
|
|
1457
|
-
reset: () => state.setAnchorDate(null),
|
|
1458
|
-
select: () => state.selectFocusedDate()
|
|
1459
|
-
};
|
|
1460
|
-
let endDragging = (e) => {
|
|
1461
|
-
if (isVirtualClick.current) {
|
|
1462
|
-
isVirtualClick.current = false;
|
|
1463
|
-
return;
|
|
1464
|
-
}
|
|
1465
|
-
state.setDragging(false);
|
|
1466
|
-
if (!state.anchorDate) return;
|
|
1467
|
-
let target = e.target;
|
|
1468
|
-
if (ref.current && $23f2114a1b82827e$export$b4f377a2b6254582(ref.current) && (!$23f2114a1b82827e$export$4282f70798064fe0(ref.current, target) || !target.closest('button, [role="button"]'))) commitBehaviorMapping[commitBehavior]();
|
|
1469
|
-
};
|
|
1470
|
-
$600b3cf69ae46262$export$90fc3a17d93f704c(windowRef, "pointerup", endDragging);
|
|
1471
|
-
res.calendarProps.onBlur = (e) => {
|
|
1472
|
-
if (!ref.current) return;
|
|
1473
|
-
if ((!e.relatedTarget || !$23f2114a1b82827e$export$4282f70798064fe0(ref.current, e.relatedTarget)) && state.anchorDate) commitBehaviorMapping[commitBehavior]();
|
|
1474
|
-
};
|
|
1475
|
-
$600b3cf69ae46262$export$90fc3a17d93f704c(ref, "touchmove", (e) => {
|
|
1476
|
-
if (state.isDragging) e.preventDefault();
|
|
1477
|
-
}, {
|
|
1478
|
-
passive: false,
|
|
1479
|
-
capture: true
|
|
1480
|
-
});
|
|
1481
|
-
return res;
|
|
1482
|
-
}
|
|
1483
1446
|
const $58196c8d6a1f38fc$var$supportsInert = typeof HTMLElement !== "undefined" && "inert" in HTMLElement.prototype;
|
|
1484
1447
|
function $58196c8d6a1f38fc$var$isAlwaysVisibleNode(node) {
|
|
1485
1448
|
return node.dataset.liveAnnouncer === "true" || node.dataset.reactAriaTopLayer !== void 0;
|
|
@@ -1636,14 +1599,14 @@ function $58196c8d6a1f38fc$export$1020fa7f77e17884(element) {
|
|
|
1636
1599
|
};
|
|
1637
1600
|
}
|
|
1638
1601
|
}
|
|
1639
|
-
function $parcel$interopDefault$
|
|
1602
|
+
function $parcel$interopDefault$1(a) {
|
|
1640
1603
|
return a && a.__esModule ? a.default : a;
|
|
1641
1604
|
}
|
|
1642
1605
|
function $6902a2bb26917a07$export$42df105a73306d51(props, state, ref) {
|
|
1643
1606
|
let buttonId = $390e54f620492c70$export$f680877a34711e37();
|
|
1644
1607
|
let dialogId = $390e54f620492c70$export$f680877a34711e37();
|
|
1645
1608
|
let fieldId = $390e54f620492c70$export$f680877a34711e37();
|
|
1646
|
-
let stringFormatter = $cf2482eff2eeeec2$export$f12b703ca79dfbb1($parcel$interopDefault$
|
|
1609
|
+
let stringFormatter = $cf2482eff2eeeec2$export$f12b703ca79dfbb1($parcel$interopDefault$1($0014db39426443c5$exports), "@react-aria/datepicker");
|
|
1647
1610
|
let { isInvalid, validationErrors, validationDetails } = state.displayValidation;
|
|
1648
1611
|
let { labelProps, fieldProps, descriptionProps, errorMessageProps } = $191c9b6d48a0a4e2$export$294aa081a6c6f55d({
|
|
1649
1612
|
...props,
|
|
@@ -1657,10 +1620,10 @@ function $6902a2bb26917a07$export$42df105a73306d51(props, state, ref) {
|
|
|
1657
1620
|
let date = state.formatValue(locale, {
|
|
1658
1621
|
month: "long"
|
|
1659
1622
|
});
|
|
1660
|
-
let
|
|
1623
|
+
let description = date ? stringFormatter.format("selectedDateDescription", {
|
|
1661
1624
|
date
|
|
1662
1625
|
}) : "";
|
|
1663
|
-
let descProps = $121970af65029459$export$f8aeda7b10753fa1(
|
|
1626
|
+
let descProps = $121970af65029459$export$f8aeda7b10753fa1(description);
|
|
1664
1627
|
let ariaDescribedBy = [
|
|
1665
1628
|
descProps["aria-describedby"],
|
|
1666
1629
|
fieldProps["aria-describedby"]
|
|
@@ -1675,8 +1638,8 @@ function $6902a2bb26917a07$export$42df105a73306d51(props, state, ref) {
|
|
|
1675
1638
|
isDisabled: state.isOpen,
|
|
1676
1639
|
onBlurWithin: (e) => {
|
|
1677
1640
|
var _a, _b;
|
|
1678
|
-
let
|
|
1679
|
-
if (!$23f2114a1b82827e$export$4282f70798064fe0(
|
|
1641
|
+
let dialog = document.getElementById(dialogId);
|
|
1642
|
+
if (!$23f2114a1b82827e$export$4282f70798064fe0(dialog, e.relatedTarget)) {
|
|
1680
1643
|
isFocused.current = false;
|
|
1681
1644
|
(_a = props.onBlur) == null ? void 0 : _a.call(props, e);
|
|
1682
1645
|
(_b = props.onFocusChange) == null ? void 0 : _b.call(props, false);
|
|
@@ -1772,187 +1735,6 @@ function $6902a2bb26917a07$export$42df105a73306d51(props, state, ref) {
|
|
|
1772
1735
|
validationDetails
|
|
1773
1736
|
};
|
|
1774
1737
|
}
|
|
1775
|
-
function $parcel$interopDefault$1(a) {
|
|
1776
|
-
return a && a.__esModule ? a.default : a;
|
|
1777
|
-
}
|
|
1778
|
-
function $cccdba1b2bb08448$export$12fd5f0e9f4bb192(props, state, ref) {
|
|
1779
|
-
var _a, _b, _c, _d, _e;
|
|
1780
|
-
let stringFormatter = $cf2482eff2eeeec2$export$f12b703ca79dfbb1($parcel$interopDefault$1($0014db39426443c5$exports), "@react-aria/datepicker");
|
|
1781
|
-
let { isInvalid, validationErrors, validationDetails } = state.displayValidation;
|
|
1782
|
-
let { labelProps, fieldProps, descriptionProps, errorMessageProps } = $191c9b6d48a0a4e2$export$294aa081a6c6f55d({
|
|
1783
|
-
...props,
|
|
1784
|
-
labelElementType: "span",
|
|
1785
|
-
isInvalid,
|
|
1786
|
-
errorMessage: props.errorMessage || validationErrors
|
|
1787
|
-
});
|
|
1788
|
-
let labelledBy = fieldProps["aria-labelledby"] || fieldProps.id;
|
|
1789
|
-
let { locale } = $2eb8e6d23f3d0cb0$export$43bb16f9c6d9e3f7();
|
|
1790
|
-
let range = state.formatValue(locale, {
|
|
1791
|
-
month: "long"
|
|
1792
|
-
});
|
|
1793
|
-
let description2 = range ? stringFormatter.format("selectedRangeDescription", {
|
|
1794
|
-
startDate: range.start,
|
|
1795
|
-
endDate: range.end
|
|
1796
|
-
}) : "";
|
|
1797
|
-
let descProps = $121970af65029459$export$f8aeda7b10753fa1(description2);
|
|
1798
|
-
let startFieldProps = {
|
|
1799
|
-
"aria-label": stringFormatter.format("startDate"),
|
|
1800
|
-
"aria-labelledby": labelledBy
|
|
1801
|
-
};
|
|
1802
|
-
let endFieldProps = {
|
|
1803
|
-
"aria-label": stringFormatter.format("endDate"),
|
|
1804
|
-
"aria-labelledby": labelledBy
|
|
1805
|
-
};
|
|
1806
|
-
let buttonId = $390e54f620492c70$export$f680877a34711e37();
|
|
1807
|
-
let dialogId = $390e54f620492c70$export$f680877a34711e37();
|
|
1808
|
-
let groupProps = $6a440d0e2d99dd46$export$4a931266a3838b86(state, ref);
|
|
1809
|
-
let ariaDescribedBy = [
|
|
1810
|
-
descProps["aria-describedby"],
|
|
1811
|
-
fieldProps["aria-describedby"]
|
|
1812
|
-
].filter(Boolean).join(" ") || void 0;
|
|
1813
|
-
let focusManager = useMemo(() => $535772f9d2c1f38d$export$c5251b9e124bf29(ref, {
|
|
1814
|
-
// Exclude the button from the focus manager.
|
|
1815
|
-
accept: (element) => element.id !== buttonId
|
|
1816
|
-
}), [
|
|
1817
|
-
ref,
|
|
1818
|
-
buttonId
|
|
1819
|
-
]);
|
|
1820
|
-
let commonFieldProps = {
|
|
1821
|
-
[$7541913c0284d84b$export$7b3062cd49e80452]: focusManager,
|
|
1822
|
-
[$7541913c0284d84b$export$300019f83c56d282]: "presentation",
|
|
1823
|
-
"aria-describedby": ariaDescribedBy,
|
|
1824
|
-
placeholderValue: props.placeholderValue,
|
|
1825
|
-
hideTimeZone: props.hideTimeZone,
|
|
1826
|
-
hourCycle: props.hourCycle,
|
|
1827
|
-
granularity: props.granularity,
|
|
1828
|
-
shouldForceLeadingZeros: props.shouldForceLeadingZeros,
|
|
1829
|
-
isDisabled: props.isDisabled,
|
|
1830
|
-
isReadOnly: props.isReadOnly,
|
|
1831
|
-
isRequired: props.isRequired,
|
|
1832
|
-
validationBehavior: props.validationBehavior
|
|
1833
|
-
};
|
|
1834
|
-
let domProps = $8e9d2fae0ecb9001$export$457c3d6518dd4c6f(props);
|
|
1835
|
-
let isFocused = useRef(false);
|
|
1836
|
-
let { focusWithinProps } = $2c9edc598a03d523$export$420e68273165f4ec({
|
|
1837
|
-
...props,
|
|
1838
|
-
isDisabled: state.isOpen,
|
|
1839
|
-
onBlurWithin: (e) => {
|
|
1840
|
-
var _a2, _b2;
|
|
1841
|
-
let dialog2 = document.getElementById(dialogId);
|
|
1842
|
-
if (!$23f2114a1b82827e$export$4282f70798064fe0(dialog2, e.relatedTarget)) {
|
|
1843
|
-
isFocused.current = false;
|
|
1844
|
-
(_a2 = props.onBlur) == null ? void 0 : _a2.call(props, e);
|
|
1845
|
-
(_b2 = props.onFocusChange) == null ? void 0 : _b2.call(props, false);
|
|
1846
|
-
}
|
|
1847
|
-
},
|
|
1848
|
-
onFocusWithin: (e) => {
|
|
1849
|
-
var _a2, _b2;
|
|
1850
|
-
if (!isFocused.current) {
|
|
1851
|
-
isFocused.current = true;
|
|
1852
|
-
(_a2 = props.onFocus) == null ? void 0 : _a2.call(props, e);
|
|
1853
|
-
(_b2 = props.onFocusChange) == null ? void 0 : _b2.call(props, true);
|
|
1854
|
-
}
|
|
1855
|
-
}
|
|
1856
|
-
});
|
|
1857
|
-
let startFieldValidation = useRef($fd2148440a13ec26$export$dad6ae84456c676a);
|
|
1858
|
-
let endFieldValidation = useRef($fd2148440a13ec26$export$dad6ae84456c676a);
|
|
1859
|
-
return {
|
|
1860
|
-
groupProps: $bbaa08b3cd72f041$export$9d1611c77c2fe928(domProps, groupProps, fieldProps, descProps, focusWithinProps, {
|
|
1861
|
-
role: "group",
|
|
1862
|
-
"aria-disabled": props.isDisabled || null,
|
|
1863
|
-
"aria-describedby": ariaDescribedBy,
|
|
1864
|
-
onKeyDown(e) {
|
|
1865
|
-
if (state.isOpen) return;
|
|
1866
|
-
if (props.onKeyDown) props.onKeyDown(e);
|
|
1867
|
-
},
|
|
1868
|
-
onKeyUp(e) {
|
|
1869
|
-
if (state.isOpen) return;
|
|
1870
|
-
if (props.onKeyUp) props.onKeyUp(e);
|
|
1871
|
-
}
|
|
1872
|
-
}),
|
|
1873
|
-
labelProps: {
|
|
1874
|
-
...labelProps,
|
|
1875
|
-
onClick: () => {
|
|
1876
|
-
focusManager.focusFirst();
|
|
1877
|
-
}
|
|
1878
|
-
},
|
|
1879
|
-
buttonProps: {
|
|
1880
|
-
...descProps,
|
|
1881
|
-
id: buttonId,
|
|
1882
|
-
"aria-haspopup": "dialog",
|
|
1883
|
-
"aria-label": stringFormatter.format("calendar"),
|
|
1884
|
-
"aria-labelledby": `${buttonId} ${labelledBy}`,
|
|
1885
|
-
"aria-describedby": ariaDescribedBy,
|
|
1886
|
-
"aria-expanded": state.isOpen,
|
|
1887
|
-
isDisabled: props.isDisabled || props.isReadOnly,
|
|
1888
|
-
onPress: () => state.setOpen(true)
|
|
1889
|
-
},
|
|
1890
|
-
dialogProps: {
|
|
1891
|
-
id: dialogId,
|
|
1892
|
-
"aria-labelledby": `${buttonId} ${labelledBy}`
|
|
1893
|
-
},
|
|
1894
|
-
startFieldProps: {
|
|
1895
|
-
...startFieldProps,
|
|
1896
|
-
...commonFieldProps,
|
|
1897
|
-
value: ((_a = state.value) == null ? void 0 : _a.start) ?? null,
|
|
1898
|
-
defaultValue: (_b = state.defaultValue) == null ? void 0 : _b.start,
|
|
1899
|
-
onChange: (start) => state.setDateTime("start", start),
|
|
1900
|
-
autoFocus: props.autoFocus,
|
|
1901
|
-
name: props.startName,
|
|
1902
|
-
form: props.form,
|
|
1903
|
-
[$fd2148440a13ec26$export$a763b9476acd3eb]: {
|
|
1904
|
-
realtimeValidation: state.realtimeValidation,
|
|
1905
|
-
displayValidation: state.displayValidation,
|
|
1906
|
-
updateValidation(e) {
|
|
1907
|
-
startFieldValidation.current = e;
|
|
1908
|
-
state.updateValidation($fd2148440a13ec26$export$75ee7c75d68f5b0e(e, endFieldValidation.current));
|
|
1909
|
-
},
|
|
1910
|
-
resetValidation: state.resetValidation,
|
|
1911
|
-
commitValidation: state.commitValidation
|
|
1912
|
-
}
|
|
1913
|
-
},
|
|
1914
|
-
endFieldProps: {
|
|
1915
|
-
...endFieldProps,
|
|
1916
|
-
...commonFieldProps,
|
|
1917
|
-
value: ((_c = state.value) == null ? void 0 : _c.end) ?? null,
|
|
1918
|
-
defaultValue: (_d = state.defaultValue) == null ? void 0 : _d.end,
|
|
1919
|
-
onChange: (end) => state.setDateTime("end", end),
|
|
1920
|
-
name: props.endName,
|
|
1921
|
-
form: props.form,
|
|
1922
|
-
[$fd2148440a13ec26$export$a763b9476acd3eb]: {
|
|
1923
|
-
realtimeValidation: state.realtimeValidation,
|
|
1924
|
-
displayValidation: state.displayValidation,
|
|
1925
|
-
updateValidation(e) {
|
|
1926
|
-
endFieldValidation.current = e;
|
|
1927
|
-
state.updateValidation($fd2148440a13ec26$export$75ee7c75d68f5b0e(startFieldValidation.current, e));
|
|
1928
|
-
},
|
|
1929
|
-
resetValidation: state.resetValidation,
|
|
1930
|
-
commitValidation: state.commitValidation
|
|
1931
|
-
}
|
|
1932
|
-
},
|
|
1933
|
-
descriptionProps,
|
|
1934
|
-
errorMessageProps,
|
|
1935
|
-
calendarProps: {
|
|
1936
|
-
autoFocus: true,
|
|
1937
|
-
value: ((_e = state.dateRange) == null ? void 0 : _e.start) && state.dateRange.end ? state.dateRange : null,
|
|
1938
|
-
onChange: state.setDateRange,
|
|
1939
|
-
minValue: props.minValue,
|
|
1940
|
-
maxValue: props.maxValue,
|
|
1941
|
-
isDisabled: props.isDisabled,
|
|
1942
|
-
isReadOnly: props.isReadOnly,
|
|
1943
|
-
isDateUnavailable: props.isDateUnavailable,
|
|
1944
|
-
allowsNonContiguousRanges: props.allowsNonContiguousRanges,
|
|
1945
|
-
defaultFocusedValue: state.dateRange ? void 0 : props.placeholderValue,
|
|
1946
|
-
isInvalid: state.isInvalid,
|
|
1947
|
-
errorMessage: typeof props.errorMessage === "function" ? props.errorMessage(state.displayValidation) : props.errorMessage || state.displayValidation.validationErrors.join(" "),
|
|
1948
|
-
firstDayOfWeek: props.firstDayOfWeek,
|
|
1949
|
-
pageBehavior: props.pageBehavior
|
|
1950
|
-
},
|
|
1951
|
-
isInvalid,
|
|
1952
|
-
validationErrors,
|
|
1953
|
-
validationDetails
|
|
1954
|
-
};
|
|
1955
|
-
}
|
|
1956
1738
|
function $0d47b37c475c5231$export$cf75428e0b9ed1ea({ children }) {
|
|
1957
1739
|
let context = useMemo(() => ({
|
|
1958
1740
|
register: () => {
|
|
@@ -2878,157 +2660,6 @@ function $ea0ea6e62ae0d7ca$var$unitDuration(duration) {
|
|
|
2878
2660
|
for (let key in duration) unit[key] = 1;
|
|
2879
2661
|
return unit;
|
|
2880
2662
|
}
|
|
2881
|
-
function $a0a87fb6fcfb22ec$export$9a987164d97ecc90(props) {
|
|
2882
|
-
let { value: valueProp, defaultValue, onChange, createCalendar, locale, visibleDuration = {
|
|
2883
|
-
months: 1
|
|
2884
|
-
}, minValue, maxValue, ...calendarProps } = props;
|
|
2885
|
-
let [value, setValue] = $3e6197669829fe11$export$40bfa8c7b0832715(valueProp, defaultValue || null, onChange);
|
|
2886
|
-
let [anchorDate, setAnchorDateState] = useState(null);
|
|
2887
|
-
let alignment = "center";
|
|
2888
|
-
if (value && value.start && value.end) {
|
|
2889
|
-
let start = $dd602d3c757202f2$export$f4a51ff076cc9a09($d07e34cce18680fd$export$93522d1a439f3617(value.start), visibleDuration, locale, minValue, maxValue);
|
|
2890
|
-
let end = start.add(visibleDuration).subtract({
|
|
2891
|
-
days: 1
|
|
2892
|
-
});
|
|
2893
|
-
if (value.end.compare(end) > 0) alignment = "start";
|
|
2894
|
-
}
|
|
2895
|
-
let availableRangeRef = useRef(null);
|
|
2896
|
-
let [availableRange, setAvailableRange] = useState(null);
|
|
2897
|
-
let min = useMemo(() => $ad063034c8620db8$export$a75f2bff57811055(minValue, availableRange == null ? void 0 : availableRange.start), [
|
|
2898
|
-
minValue,
|
|
2899
|
-
availableRange
|
|
2900
|
-
]);
|
|
2901
|
-
let max = useMemo(() => $ad063034c8620db8$export$5c333a116e949cdd(maxValue, availableRange == null ? void 0 : availableRange.end), [
|
|
2902
|
-
maxValue,
|
|
2903
|
-
availableRange
|
|
2904
|
-
]);
|
|
2905
|
-
let calendar2 = $ea0ea6e62ae0d7ca$export$6d095e787d2b5e1f({
|
|
2906
|
-
...calendarProps,
|
|
2907
|
-
value: value && value.start,
|
|
2908
|
-
createCalendar,
|
|
2909
|
-
locale,
|
|
2910
|
-
visibleDuration,
|
|
2911
|
-
minValue: min,
|
|
2912
|
-
maxValue: max,
|
|
2913
|
-
selectionAlignment: props.selectionAlignment || alignment
|
|
2914
|
-
});
|
|
2915
|
-
let updateAvailableRange = (date) => {
|
|
2916
|
-
if (date && props.isDateUnavailable && !props.allowsNonContiguousRanges) {
|
|
2917
|
-
const nextAvailableStartDate = $a0a87fb6fcfb22ec$var$nextUnavailableDate(date, calendar2, -1);
|
|
2918
|
-
const nextAvailableEndDate = $a0a87fb6fcfb22ec$var$nextUnavailableDate(date, calendar2, 1);
|
|
2919
|
-
availableRangeRef.current = {
|
|
2920
|
-
start: nextAvailableStartDate,
|
|
2921
|
-
end: nextAvailableEndDate
|
|
2922
|
-
};
|
|
2923
|
-
setAvailableRange(availableRangeRef.current);
|
|
2924
|
-
} else {
|
|
2925
|
-
availableRangeRef.current = null;
|
|
2926
|
-
setAvailableRange(null);
|
|
2927
|
-
}
|
|
2928
|
-
};
|
|
2929
|
-
let [lastVisibleRange, setLastVisibleRange] = useState(calendar2.visibleRange);
|
|
2930
|
-
if (!$ad063034c8620db8$export$91b62ebf2ba703ee(calendar2.visibleRange.start, lastVisibleRange.start) || !$ad063034c8620db8$export$91b62ebf2ba703ee(calendar2.visibleRange.end, lastVisibleRange.end)) {
|
|
2931
|
-
updateAvailableRange(anchorDate);
|
|
2932
|
-
setLastVisibleRange(calendar2.visibleRange);
|
|
2933
|
-
}
|
|
2934
|
-
let setAnchorDate = (date) => {
|
|
2935
|
-
if (date) {
|
|
2936
|
-
setAnchorDateState(date);
|
|
2937
|
-
updateAvailableRange(date);
|
|
2938
|
-
} else {
|
|
2939
|
-
setAnchorDateState(null);
|
|
2940
|
-
updateAvailableRange(null);
|
|
2941
|
-
}
|
|
2942
|
-
};
|
|
2943
|
-
let highlightedRange = anchorDate ? $a0a87fb6fcfb22ec$var$makeRange(anchorDate, calendar2.focusedDate) : value && $a0a87fb6fcfb22ec$var$makeRange(value.start, value.end);
|
|
2944
|
-
let selectDate = (date) => {
|
|
2945
|
-
if (props.isReadOnly) return;
|
|
2946
|
-
const constrainedDate = $dd602d3c757202f2$export$4f5203c0d889109e(date, min, max);
|
|
2947
|
-
const previousAvailableConstrainedDate = $dd602d3c757202f2$export$a1d3911297b952d7(constrainedDate, calendar2.visibleRange.start, props.isDateUnavailable);
|
|
2948
|
-
if (!previousAvailableConstrainedDate) return;
|
|
2949
|
-
if (!anchorDate) setAnchorDate(previousAvailableConstrainedDate);
|
|
2950
|
-
else {
|
|
2951
|
-
let range = $a0a87fb6fcfb22ec$var$makeRange(anchorDate, previousAvailableConstrainedDate);
|
|
2952
|
-
if (range) setValue({
|
|
2953
|
-
start: $a0a87fb6fcfb22ec$var$convertValue(range.start, value == null ? void 0 : value.start),
|
|
2954
|
-
end: $a0a87fb6fcfb22ec$var$convertValue(range.end, value == null ? void 0 : value.end)
|
|
2955
|
-
});
|
|
2956
|
-
setAnchorDate(null);
|
|
2957
|
-
}
|
|
2958
|
-
};
|
|
2959
|
-
let [isDragging, setDragging] = useState(false);
|
|
2960
|
-
let { isDateUnavailable } = props;
|
|
2961
|
-
let isInvalidSelection = useMemo(() => {
|
|
2962
|
-
if (!value || anchorDate) return false;
|
|
2963
|
-
if (isDateUnavailable && (isDateUnavailable(value.start) || isDateUnavailable(value.end))) return true;
|
|
2964
|
-
return $dd602d3c757202f2$export$eac50920cf2fd59a(value.start, minValue, maxValue) || $dd602d3c757202f2$export$eac50920cf2fd59a(value.end, minValue, maxValue);
|
|
2965
|
-
}, [
|
|
2966
|
-
isDateUnavailable,
|
|
2967
|
-
value,
|
|
2968
|
-
anchorDate,
|
|
2969
|
-
minValue,
|
|
2970
|
-
maxValue
|
|
2971
|
-
]);
|
|
2972
|
-
let isValueInvalid = props.isInvalid || props.validationState === "invalid" || isInvalidSelection;
|
|
2973
|
-
let validationState = isValueInvalid ? "invalid" : null;
|
|
2974
|
-
return {
|
|
2975
|
-
...calendar2,
|
|
2976
|
-
value,
|
|
2977
|
-
setValue,
|
|
2978
|
-
anchorDate,
|
|
2979
|
-
setAnchorDate,
|
|
2980
|
-
highlightedRange,
|
|
2981
|
-
validationState,
|
|
2982
|
-
isValueInvalid,
|
|
2983
|
-
selectFocusedDate() {
|
|
2984
|
-
selectDate(calendar2.focusedDate);
|
|
2985
|
-
},
|
|
2986
|
-
selectDate,
|
|
2987
|
-
highlightDate(date) {
|
|
2988
|
-
if (anchorDate) calendar2.setFocusedDate(date);
|
|
2989
|
-
},
|
|
2990
|
-
isSelected(date) {
|
|
2991
|
-
return Boolean(highlightedRange && date.compare(highlightedRange.start) >= 0 && date.compare(highlightedRange.end) <= 0 && !calendar2.isCellDisabled(date) && !calendar2.isCellUnavailable(date));
|
|
2992
|
-
},
|
|
2993
|
-
isInvalid(date) {
|
|
2994
|
-
var _a, _b;
|
|
2995
|
-
return calendar2.isInvalid(date) || $dd602d3c757202f2$export$eac50920cf2fd59a(date, (_a = availableRangeRef.current) == null ? void 0 : _a.start, (_b = availableRangeRef.current) == null ? void 0 : _b.end);
|
|
2996
|
-
},
|
|
2997
|
-
isDragging,
|
|
2998
|
-
setDragging,
|
|
2999
|
-
clearSelection() {
|
|
3000
|
-
setAnchorDate(null);
|
|
3001
|
-
setValue(null);
|
|
3002
|
-
}
|
|
3003
|
-
};
|
|
3004
|
-
}
|
|
3005
|
-
function $a0a87fb6fcfb22ec$var$makeRange(start, end) {
|
|
3006
|
-
if (!start || !end) return null;
|
|
3007
|
-
if (end.compare(start) < 0) [start, end] = [
|
|
3008
|
-
end,
|
|
3009
|
-
start
|
|
3010
|
-
];
|
|
3011
|
-
return {
|
|
3012
|
-
start: $d07e34cce18680fd$export$93522d1a439f3617(start),
|
|
3013
|
-
end: $d07e34cce18680fd$export$93522d1a439f3617(end)
|
|
3014
|
-
};
|
|
3015
|
-
}
|
|
3016
|
-
function $a0a87fb6fcfb22ec$var$convertValue(newValue, oldValue) {
|
|
3017
|
-
newValue = $d07e34cce18680fd$export$b4a036af3fc0b032(newValue, (oldValue == null ? void 0 : oldValue.calendar) || new $93635573935797de$export$80ee6245ec4f29ec());
|
|
3018
|
-
if (oldValue && "hour" in oldValue) return oldValue.set(newValue);
|
|
3019
|
-
return newValue;
|
|
3020
|
-
}
|
|
3021
|
-
function $a0a87fb6fcfb22ec$var$nextUnavailableDate(anchorDate, state, dir) {
|
|
3022
|
-
let nextDate = anchorDate.add({
|
|
3023
|
-
days: dir
|
|
3024
|
-
});
|
|
3025
|
-
while ((dir < 0 ? nextDate.compare(state.visibleRange.start) >= 0 : nextDate.compare(state.visibleRange.end) <= 0) && !state.isCellUnavailable(nextDate)) nextDate = nextDate.add({
|
|
3026
|
-
days: dir
|
|
3027
|
-
});
|
|
3028
|
-
if (state.isCellUnavailable(nextDate)) return nextDate.add({
|
|
3029
|
-
days: -dir
|
|
3030
|
-
});
|
|
3031
|
-
}
|
|
3032
2663
|
function $28aae683a942e141$export$87194bb378cc3ac2(props) {
|
|
3033
2664
|
let overlayState = $f11fb0bcf1b2687a$export$61c6a8c84e605fb6(props);
|
|
3034
2665
|
let [value, setValue] = $3e6197669829fe11$export$40bfa8c7b0832715(props.value, props.defaultValue || null, props.onChange);
|
|
@@ -3131,245 +2762,27 @@ function $28aae683a942e141$export$87194bb378cc3ac2(props) {
|
|
|
3131
2762
|
}
|
|
3132
2763
|
};
|
|
3133
2764
|
}
|
|
3134
|
-
|
|
3135
|
-
|
|
3136
|
-
|
|
3137
|
-
|
|
3138
|
-
|
|
3139
|
-
|
|
3140
|
-
|
|
3141
|
-
|
|
2765
|
+
const $dfd62f934fc76fed$export$3b805cea1f178355 = /* @__PURE__ */ createContext(null);
|
|
2766
|
+
const $dfd62f934fc76fed$export$233dd9682e1ad64b = /* @__PURE__ */ createContext(null);
|
|
2767
|
+
const $dfd62f934fc76fed$export$9e31dcedda1dadc7 = /* @__PURE__ */ createContext(null);
|
|
2768
|
+
const $dfd62f934fc76fed$export$5e0fc348c00f87a0 = /* @__PURE__ */ createContext(null);
|
|
2769
|
+
const $dfd62f934fc76fed$export$e1aef45b828286de = /* @__PURE__ */ forwardRef(function Calendar(props, ref) {
|
|
2770
|
+
[props, ref] = $64fa3d84918910a7$export$29f1550f4b0d4415(props, ref, $dfd62f934fc76fed$export$3b805cea1f178355);
|
|
2771
|
+
let { locale } = $2eb8e6d23f3d0cb0$export$43bb16f9c6d9e3f7();
|
|
2772
|
+
let state = $ea0ea6e62ae0d7ca$export$6d095e787d2b5e1f({
|
|
2773
|
+
...props,
|
|
2774
|
+
locale,
|
|
2775
|
+
createCalendar: props.createCalendar || $84102b64e5ca022f$export$dd0bbc9b26defe37
|
|
3142
2776
|
});
|
|
3143
|
-
|
|
3144
|
-
|
|
3145
|
-
start: null,
|
|
3146
|
-
end: null
|
|
3147
|
-
};
|
|
3148
|
-
setPlaceholderValue(placeholderValue);
|
|
3149
|
-
}
|
|
3150
|
-
let value = controlledValue || placeholderValue;
|
|
3151
|
-
let setValue = (newValue) => {
|
|
3152
|
-
value = newValue || {
|
|
3153
|
-
start: null,
|
|
3154
|
-
end: null
|
|
3155
|
-
};
|
|
3156
|
-
setPlaceholderValue(value);
|
|
3157
|
-
if ($6de3e3f1a7663217$var$isCompleteRange(value)) setControlledValue(value);
|
|
3158
|
-
else setControlledValue(null);
|
|
3159
|
-
};
|
|
3160
|
-
let v = (value == null ? void 0 : value.start) || (value == null ? void 0 : value.end) || props.placeholderValue || null;
|
|
3161
|
-
let [granularity, defaultTimeZone] = $8b141f2f71e88f85$export$2440da353cedad43(v, props.granularity);
|
|
3162
|
-
let hasTime = granularity === "hour" || granularity === "minute" || granularity === "second";
|
|
3163
|
-
let shouldCloseOnSelect = props.shouldCloseOnSelect ?? true;
|
|
3164
|
-
let [dateRange, setSelectedDateRange] = useState(null);
|
|
3165
|
-
let [timeRange, setSelectedTimeRange] = useState(null);
|
|
3166
|
-
if (value && $6de3e3f1a7663217$var$isCompleteRange(value)) {
|
|
3167
|
-
dateRange = value;
|
|
3168
|
-
if ("hour" in value.start) timeRange = value;
|
|
3169
|
-
}
|
|
3170
|
-
let commitValue = (dateRange2, timeRange2) => {
|
|
3171
|
-
setValue({
|
|
3172
|
-
start: "timeZone" in timeRange2.start ? timeRange2.start.set($d07e34cce18680fd$export$93522d1a439f3617(dateRange2.start)) : $d07e34cce18680fd$export$b21e0b124e224484(dateRange2.start, timeRange2.start),
|
|
3173
|
-
end: "timeZone" in timeRange2.end ? timeRange2.end.set($d07e34cce18680fd$export$93522d1a439f3617(dateRange2.end)) : $d07e34cce18680fd$export$b21e0b124e224484(dateRange2.end, timeRange2.end)
|
|
3174
|
-
});
|
|
3175
|
-
setSelectedDateRange(null);
|
|
3176
|
-
setSelectedTimeRange(null);
|
|
3177
|
-
validation.commitValidation();
|
|
3178
|
-
};
|
|
3179
|
-
let setDateRange = (range) => {
|
|
3180
|
-
let shouldClose = typeof shouldCloseOnSelect === "function" ? shouldCloseOnSelect() : shouldCloseOnSelect;
|
|
3181
|
-
if (hasTime) {
|
|
3182
|
-
if ($6de3e3f1a7663217$var$isCompleteRange(range) && (shouldClose || (timeRange == null ? void 0 : timeRange.start) && (timeRange == null ? void 0 : timeRange.end))) commitValue(range, {
|
|
3183
|
-
start: (timeRange == null ? void 0 : timeRange.start) || $8b141f2f71e88f85$export$c5221a78ef73c5e9(props.placeholderValue),
|
|
3184
|
-
end: (timeRange == null ? void 0 : timeRange.end) || $8b141f2f71e88f85$export$c5221a78ef73c5e9(props.placeholderValue)
|
|
3185
|
-
});
|
|
3186
|
-
else setSelectedDateRange(range);
|
|
3187
|
-
} else if ($6de3e3f1a7663217$var$isCompleteRange(range)) {
|
|
3188
|
-
setValue(range);
|
|
3189
|
-
validation.commitValidation();
|
|
3190
|
-
} else setSelectedDateRange(range);
|
|
3191
|
-
if (shouldClose) overlayState.setOpen(false);
|
|
3192
|
-
};
|
|
3193
|
-
let setTimeRange = (range) => {
|
|
3194
|
-
if ($6de3e3f1a7663217$var$isCompleteRange(dateRange) && $6de3e3f1a7663217$var$isCompleteRange(range)) commitValue(dateRange, range);
|
|
3195
|
-
else setSelectedTimeRange(range);
|
|
3196
|
-
};
|
|
3197
|
-
let showEra = ((_a = value == null ? void 0 : value.start) == null ? void 0 : _a.calendar.identifier) === "gregory" && value.start.era === "BC" || ((_b = value == null ? void 0 : value.end) == null ? void 0 : _b.calendar.identifier) === "gregory" && value.end.era === "BC";
|
|
3198
|
-
let formatOpts = useMemo(() => ({
|
|
3199
|
-
granularity,
|
|
3200
|
-
timeZone: defaultTimeZone,
|
|
3201
|
-
hideTimeZone: props.hideTimeZone,
|
|
3202
|
-
hourCycle: props.hourCycle,
|
|
3203
|
-
shouldForceLeadingZeros: props.shouldForceLeadingZeros,
|
|
3204
|
-
showEra
|
|
3205
|
-
}), [
|
|
3206
|
-
granularity,
|
|
3207
|
-
props.hourCycle,
|
|
3208
|
-
props.shouldForceLeadingZeros,
|
|
3209
|
-
defaultTimeZone,
|
|
3210
|
-
props.hideTimeZone,
|
|
3211
|
-
showEra
|
|
3212
|
-
]);
|
|
3213
|
-
let { minValue, maxValue, isDateUnavailable } = props;
|
|
3214
|
-
let builtinValidation = useMemo(() => $8b141f2f71e88f85$export$80ff8fc0ae339c13(value, minValue, maxValue, isDateUnavailable, formatOpts), [
|
|
3215
|
-
value,
|
|
3216
|
-
minValue,
|
|
3217
|
-
maxValue,
|
|
3218
|
-
isDateUnavailable,
|
|
3219
|
-
formatOpts
|
|
3220
|
-
]);
|
|
3221
|
-
let validation = $fd2148440a13ec26$export$fc1a364ae1f3ff10({
|
|
2777
|
+
let { calendarProps, prevButtonProps, nextButtonProps, errorMessageProps, title } = $a1efc3efb5426bf7$export$3ee915f8151bd4f1(props, state);
|
|
2778
|
+
let renderProps = $64fa3d84918910a7$export$4d86445c2cf5e3({
|
|
3222
2779
|
...props,
|
|
3223
|
-
|
|
3224
|
-
|
|
3225
|
-
props.
|
|
3226
|
-
|
|
3227
|
-
|
|
3228
|
-
|
|
3229
|
-
props.endName
|
|
3230
|
-
]),
|
|
3231
|
-
builtinValidation
|
|
3232
|
-
});
|
|
3233
|
-
let isValueInvalid = validation.displayValidation.isInvalid;
|
|
3234
|
-
let validationState = props.validationState || (isValueInvalid ? "invalid" : null);
|
|
3235
|
-
return {
|
|
3236
|
-
...validation,
|
|
3237
|
-
value,
|
|
3238
|
-
defaultValue: props.defaultValue ?? initialValue,
|
|
3239
|
-
setValue,
|
|
3240
|
-
dateRange,
|
|
3241
|
-
timeRange,
|
|
3242
|
-
granularity,
|
|
3243
|
-
hasTime,
|
|
3244
|
-
setDate(part, date) {
|
|
3245
|
-
if (part === "start") setDateRange({
|
|
3246
|
-
start: date,
|
|
3247
|
-
end: (dateRange == null ? void 0 : dateRange.end) ?? null
|
|
3248
|
-
});
|
|
3249
|
-
else setDateRange({
|
|
3250
|
-
start: (dateRange == null ? void 0 : dateRange.start) ?? null,
|
|
3251
|
-
end: date
|
|
3252
|
-
});
|
|
3253
|
-
},
|
|
3254
|
-
setTime(part, time) {
|
|
3255
|
-
if (part === "start") setTimeRange({
|
|
3256
|
-
start: time,
|
|
3257
|
-
end: (timeRange == null ? void 0 : timeRange.end) ?? null
|
|
3258
|
-
});
|
|
3259
|
-
else setTimeRange({
|
|
3260
|
-
start: (timeRange == null ? void 0 : timeRange.start) ?? null,
|
|
3261
|
-
end: time
|
|
3262
|
-
});
|
|
3263
|
-
},
|
|
3264
|
-
setDateTime(part, dateTime) {
|
|
3265
|
-
if (part === "start") setValue({
|
|
3266
|
-
start: dateTime,
|
|
3267
|
-
end: (value == null ? void 0 : value.end) ?? null
|
|
3268
|
-
});
|
|
3269
|
-
else setValue({
|
|
3270
|
-
start: (value == null ? void 0 : value.start) ?? null,
|
|
3271
|
-
end: dateTime
|
|
3272
|
-
});
|
|
3273
|
-
},
|
|
3274
|
-
setDateRange,
|
|
3275
|
-
setTimeRange,
|
|
3276
|
-
...overlayState,
|
|
3277
|
-
setOpen(isOpen) {
|
|
3278
|
-
if (!isOpen && !((value == null ? void 0 : value.start) && (value == null ? void 0 : value.end)) && $6de3e3f1a7663217$var$isCompleteRange(dateRange) && hasTime) commitValue(dateRange, {
|
|
3279
|
-
start: (timeRange == null ? void 0 : timeRange.start) || $8b141f2f71e88f85$export$c5221a78ef73c5e9(props.placeholderValue),
|
|
3280
|
-
end: (timeRange == null ? void 0 : timeRange.end) || $8b141f2f71e88f85$export$c5221a78ef73c5e9(props.placeholderValue)
|
|
3281
|
-
});
|
|
3282
|
-
overlayState.setOpen(isOpen);
|
|
3283
|
-
},
|
|
3284
|
-
validationState,
|
|
3285
|
-
isInvalid: isValueInvalid,
|
|
3286
|
-
formatValue(locale, fieldOptions) {
|
|
3287
|
-
if (!value || !value.start || !value.end) return null;
|
|
3288
|
-
let startTimeZone = "timeZone" in value.start ? value.start.timeZone : void 0;
|
|
3289
|
-
let startGranularity = props.granularity || (value.start && "minute" in value.start ? "minute" : "day");
|
|
3290
|
-
let endTimeZone = "timeZone" in value.end ? value.end.timeZone : void 0;
|
|
3291
|
-
let endGranularity = props.granularity || (value.end && "minute" in value.end ? "minute" : "day");
|
|
3292
|
-
let startOptions = $8b141f2f71e88f85$export$7e319ea407e63bc0(fieldOptions, {
|
|
3293
|
-
granularity: startGranularity,
|
|
3294
|
-
timeZone: startTimeZone,
|
|
3295
|
-
hideTimeZone: props.hideTimeZone,
|
|
3296
|
-
hourCycle: props.hourCycle,
|
|
3297
|
-
showEra: value.start.calendar.identifier === "gregory" && value.start.era === "BC" || value.end.calendar.identifier === "gregory" && value.end.era === "BC"
|
|
3298
|
-
});
|
|
3299
|
-
let startDate = value.start.toDate(startTimeZone || "UTC");
|
|
3300
|
-
let endDate = value.end.toDate(endTimeZone || "UTC");
|
|
3301
|
-
let startFormatter = new $12a3c853105e5a70$export$ad991b66133851cf(locale, startOptions);
|
|
3302
|
-
let endFormatter;
|
|
3303
|
-
if (startTimeZone === endTimeZone && startGranularity === endGranularity && value.start.compare(value.end) !== 0) {
|
|
3304
|
-
try {
|
|
3305
|
-
let parts = startFormatter.formatRangeToParts(startDate, endDate);
|
|
3306
|
-
let separatorIndex = -1;
|
|
3307
|
-
for (let i = 0; i < parts.length; i++) {
|
|
3308
|
-
let part = parts[i];
|
|
3309
|
-
if (part.source === "shared" && part.type === "literal") separatorIndex = i;
|
|
3310
|
-
else if (part.source === "endRange") break;
|
|
3311
|
-
}
|
|
3312
|
-
let start = "";
|
|
3313
|
-
let end = "";
|
|
3314
|
-
for (let i = 0; i < parts.length; i++) {
|
|
3315
|
-
if (i < separatorIndex) start += parts[i].value;
|
|
3316
|
-
else if (i > separatorIndex) end += parts[i].value;
|
|
3317
|
-
}
|
|
3318
|
-
return {
|
|
3319
|
-
start,
|
|
3320
|
-
end
|
|
3321
|
-
};
|
|
3322
|
-
} catch {
|
|
3323
|
-
}
|
|
3324
|
-
endFormatter = startFormatter;
|
|
3325
|
-
} else {
|
|
3326
|
-
let endOptions = $8b141f2f71e88f85$export$7e319ea407e63bc0(fieldOptions, {
|
|
3327
|
-
granularity: endGranularity,
|
|
3328
|
-
timeZone: endTimeZone,
|
|
3329
|
-
hideTimeZone: props.hideTimeZone,
|
|
3330
|
-
hourCycle: props.hourCycle
|
|
3331
|
-
});
|
|
3332
|
-
endFormatter = new $12a3c853105e5a70$export$ad991b66133851cf(locale, endOptions);
|
|
3333
|
-
}
|
|
3334
|
-
return {
|
|
3335
|
-
start: startFormatter.format(startDate),
|
|
3336
|
-
end: endFormatter.format(endDate)
|
|
3337
|
-
};
|
|
3338
|
-
},
|
|
3339
|
-
getDateFormatter(locale, formatOptions) {
|
|
3340
|
-
let newOptions = {
|
|
3341
|
-
...formatOpts,
|
|
3342
|
-
...formatOptions
|
|
3343
|
-
};
|
|
3344
|
-
let newFormatOptions = $8b141f2f71e88f85$export$7e319ea407e63bc0({}, newOptions);
|
|
3345
|
-
return new $12a3c853105e5a70$export$ad991b66133851cf(locale, newFormatOptions);
|
|
3346
|
-
}
|
|
3347
|
-
};
|
|
3348
|
-
}
|
|
3349
|
-
function $6de3e3f1a7663217$var$isCompleteRange(value) {
|
|
3350
|
-
return (value == null ? void 0 : value.start) != null && value.end != null;
|
|
3351
|
-
}
|
|
3352
|
-
const $dfd62f934fc76fed$export$3b805cea1f178355 = /* @__PURE__ */ createContext(null);
|
|
3353
|
-
const $dfd62f934fc76fed$export$233dd9682e1ad64b = /* @__PURE__ */ createContext(null);
|
|
3354
|
-
const $dfd62f934fc76fed$export$9e31dcedda1dadc7 = /* @__PURE__ */ createContext(null);
|
|
3355
|
-
const $dfd62f934fc76fed$export$5e0fc348c00f87a0 = /* @__PURE__ */ createContext(null);
|
|
3356
|
-
const $dfd62f934fc76fed$export$e1aef45b828286de = /* @__PURE__ */ forwardRef(function Calendar(props, ref) {
|
|
3357
|
-
[props, ref] = $64fa3d84918910a7$export$29f1550f4b0d4415(props, ref, $dfd62f934fc76fed$export$3b805cea1f178355);
|
|
3358
|
-
let { locale } = $2eb8e6d23f3d0cb0$export$43bb16f9c6d9e3f7();
|
|
3359
|
-
let state = $ea0ea6e62ae0d7ca$export$6d095e787d2b5e1f({
|
|
3360
|
-
...props,
|
|
3361
|
-
locale,
|
|
3362
|
-
createCalendar: props.createCalendar || $84102b64e5ca022f$export$dd0bbc9b26defe37
|
|
3363
|
-
});
|
|
3364
|
-
let { calendarProps, prevButtonProps, nextButtonProps, errorMessageProps, title } = $a1efc3efb5426bf7$export$3ee915f8151bd4f1(props, state);
|
|
3365
|
-
let renderProps = $64fa3d84918910a7$export$4d86445c2cf5e3({
|
|
3366
|
-
...props,
|
|
3367
|
-
values: {
|
|
3368
|
-
state,
|
|
3369
|
-
isDisabled: props.isDisabled || false,
|
|
3370
|
-
isInvalid: state.isValueInvalid
|
|
3371
|
-
},
|
|
3372
|
-
defaultClassName: "react-aria-Calendar"
|
|
2780
|
+
values: {
|
|
2781
|
+
state,
|
|
2782
|
+
isDisabled: props.isDisabled || false,
|
|
2783
|
+
isInvalid: state.isValueInvalid
|
|
2784
|
+
},
|
|
2785
|
+
defaultClassName: "react-aria-Calendar"
|
|
3373
2786
|
});
|
|
3374
2787
|
let DOMProps = $65484d02dcb7eb3e$export$457c3d6518dd4c6f(props, {
|
|
3375
2788
|
global: true
|
|
@@ -3423,76 +2836,6 @@ const $dfd62f934fc76fed$export$e1aef45b828286de = /* @__PURE__ */ forwardRef(fun
|
|
|
3423
2836
|
tabIndex: -1
|
|
3424
2837
|
}))));
|
|
3425
2838
|
});
|
|
3426
|
-
const $dfd62f934fc76fed$export$a4f5c8b89d277a8d = /* @__PURE__ */ forwardRef(function RangeCalendar(props, ref) {
|
|
3427
|
-
[props, ref] = $64fa3d84918910a7$export$29f1550f4b0d4415(props, ref, $dfd62f934fc76fed$export$233dd9682e1ad64b);
|
|
3428
|
-
let { locale } = $2eb8e6d23f3d0cb0$export$43bb16f9c6d9e3f7();
|
|
3429
|
-
let state = $a0a87fb6fcfb22ec$export$9a987164d97ecc90({
|
|
3430
|
-
...props,
|
|
3431
|
-
locale,
|
|
3432
|
-
createCalendar: props.createCalendar || $84102b64e5ca022f$export$dd0bbc9b26defe37
|
|
3433
|
-
});
|
|
3434
|
-
let { calendarProps, prevButtonProps, nextButtonProps, errorMessageProps, title } = $be0fc2ab732b9d1a$export$87e0539f600c24e5(props, state, ref);
|
|
3435
|
-
let renderProps = $64fa3d84918910a7$export$4d86445c2cf5e3({
|
|
3436
|
-
...props,
|
|
3437
|
-
values: {
|
|
3438
|
-
state,
|
|
3439
|
-
isDisabled: props.isDisabled || false,
|
|
3440
|
-
isInvalid: state.isValueInvalid
|
|
3441
|
-
},
|
|
3442
|
-
defaultClassName: "react-aria-RangeCalendar"
|
|
3443
|
-
});
|
|
3444
|
-
let DOMProps = $65484d02dcb7eb3e$export$457c3d6518dd4c6f(props, {
|
|
3445
|
-
global: true
|
|
3446
|
-
});
|
|
3447
|
-
return /* @__PURE__ */ React__default.createElement("div", {
|
|
3448
|
-
...$bbaa08b3cd72f041$export$9d1611c77c2fe928(renderProps, DOMProps, calendarProps),
|
|
3449
|
-
ref,
|
|
3450
|
-
slot: props.slot || void 0,
|
|
3451
|
-
"data-disabled": props.isDisabled || void 0,
|
|
3452
|
-
"data-invalid": state.isValueInvalid || void 0
|
|
3453
|
-
}, /* @__PURE__ */ React__default.createElement($64fa3d84918910a7$export$2881499e37b75b9a, {
|
|
3454
|
-
values: [
|
|
3455
|
-
[
|
|
3456
|
-
$d2b4bc8c273e7be6$export$24d547caef80ccd1,
|
|
3457
|
-
{
|
|
3458
|
-
slots: {
|
|
3459
|
-
previous: prevButtonProps,
|
|
3460
|
-
next: nextButtonProps
|
|
3461
|
-
}
|
|
3462
|
-
}
|
|
3463
|
-
],
|
|
3464
|
-
[
|
|
3465
|
-
$4e85f108e88277b8$export$d688439359537581,
|
|
3466
|
-
{
|
|
3467
|
-
"aria-hidden": true,
|
|
3468
|
-
level: 2,
|
|
3469
|
-
children: title
|
|
3470
|
-
}
|
|
3471
|
-
],
|
|
3472
|
-
[
|
|
3473
|
-
$dfd62f934fc76fed$export$5e0fc348c00f87a0,
|
|
3474
|
-
state
|
|
3475
|
-
],
|
|
3476
|
-
[
|
|
3477
|
-
$dfd62f934fc76fed$export$233dd9682e1ad64b,
|
|
3478
|
-
props
|
|
3479
|
-
],
|
|
3480
|
-
[
|
|
3481
|
-
$514c0188e459b4c0$export$9afb8bc826b033ea,
|
|
3482
|
-
{
|
|
3483
|
-
slots: {
|
|
3484
|
-
errorMessage: errorMessageProps
|
|
3485
|
-
}
|
|
3486
|
-
}
|
|
3487
|
-
]
|
|
3488
|
-
]
|
|
3489
|
-
}, /* @__PURE__ */ React__default.createElement($ea3928288112382f$export$439d29a4e110a164, null, /* @__PURE__ */ React__default.createElement("h2", null, calendarProps["aria-label"])), renderProps.children, /* @__PURE__ */ React__default.createElement($ea3928288112382f$export$439d29a4e110a164, null, /* @__PURE__ */ React__default.createElement("button", {
|
|
3490
|
-
"aria-label": nextButtonProps["aria-label"],
|
|
3491
|
-
disabled: nextButtonProps.isDisabled,
|
|
3492
|
-
onClick: () => state.focusNextPage(),
|
|
3493
|
-
tabIndex: -1
|
|
3494
|
-
}))));
|
|
3495
|
-
});
|
|
3496
2839
|
const $dfd62f934fc76fed$var$InternalCalendarGridContext = /* @__PURE__ */ createContext(null);
|
|
3497
2840
|
const $dfd62f934fc76fed$export$5bd780d491cfc46c = /* @__PURE__ */ forwardRef(function CalendarGrid(props, ref) {
|
|
3498
2841
|
let calendarState = useContext($dfd62f934fc76fed$export$9e31dcedda1dadc7);
|
|
@@ -3936,9 +3279,7 @@ function $c699643d2073b351$export$eefa3e19139f00f3(props) {
|
|
|
3936
3279
|
}, /* @__PURE__ */ React__default.createElement("input", inputProps));
|
|
3937
3280
|
}
|
|
3938
3281
|
const $06d5b8ec9ee5d538$export$cf316c7f3b44c11e = /* @__PURE__ */ createContext(null);
|
|
3939
|
-
const $06d5b8ec9ee5d538$export$8282edba42ee28a = /* @__PURE__ */ createContext(null);
|
|
3940
3282
|
const $06d5b8ec9ee5d538$export$50a10c048fdcdee9 = /* @__PURE__ */ createContext(null);
|
|
3941
|
-
const $06d5b8ec9ee5d538$export$80d7ae1f804790be = /* @__PURE__ */ createContext(null);
|
|
3942
3283
|
const $06d5b8ec9ee5d538$var$CLEAR_CONTEXTS = [
|
|
3943
3284
|
$a049562f99e7db0e$export$f9c6924e160136d1,
|
|
3944
3285
|
$d2b4bc8c273e7be6$export$24d547caef80ccd1,
|
|
@@ -4075,136 +3416,6 @@ const $06d5b8ec9ee5d538$export$5109c6dd95d8fb00 = /* @__PURE__ */ forwardRef(fun
|
|
|
4075
3416
|
state
|
|
4076
3417
|
}));
|
|
4077
3418
|
});
|
|
4078
|
-
const $06d5b8ec9ee5d538$export$17334619f3ac2224 = /* @__PURE__ */ forwardRef(function DateRangePicker(props, ref) {
|
|
4079
|
-
[props, ref] = $64fa3d84918910a7$export$29f1550f4b0d4415(props, ref, $06d5b8ec9ee5d538$export$8282edba42ee28a);
|
|
4080
|
-
let { validationBehavior: formValidationBehavior } = $64fa3d84918910a7$export$fabf2dc03a41866e($d3e0e05bdfcf66bd$export$c24727297075ec6a) || {};
|
|
4081
|
-
var _props_validationBehavior, _ref;
|
|
4082
|
-
let validationBehavior = (_ref = (_props_validationBehavior = props.validationBehavior) !== null && _props_validationBehavior !== void 0 ? _props_validationBehavior : formValidationBehavior) !== null && _ref !== void 0 ? _ref : "native";
|
|
4083
|
-
let state = $6de3e3f1a7663217$export$e50a61c1de9f574({
|
|
4084
|
-
...props,
|
|
4085
|
-
validationBehavior
|
|
4086
|
-
});
|
|
4087
|
-
let groupRef = useRef(null);
|
|
4088
|
-
let [labelRef, label2] = $64fa3d84918910a7$export$9d4c57ee4c6ffdd8(!props["aria-label"] && !props["aria-labelledby"]);
|
|
4089
|
-
let { groupProps, labelProps, startFieldProps, endFieldProps, buttonProps, dialogProps, calendarProps, descriptionProps, errorMessageProps, ...validation } = $cccdba1b2bb08448$export$12fd5f0e9f4bb192({
|
|
4090
|
-
...$64fa3d84918910a7$export$ef03459518577ad4(props),
|
|
4091
|
-
label: label2,
|
|
4092
|
-
validationBehavior
|
|
4093
|
-
}, state, groupRef);
|
|
4094
|
-
let [groupWidth, setGroupWidth] = useState(null);
|
|
4095
|
-
let onResize = useCallback(() => {
|
|
4096
|
-
if (groupRef.current) setGroupWidth(groupRef.current.offsetWidth + "px");
|
|
4097
|
-
}, []);
|
|
4098
|
-
$9daab02d461809db$export$683480f191c0e3ea({
|
|
4099
|
-
ref: groupRef,
|
|
4100
|
-
onResize
|
|
4101
|
-
});
|
|
4102
|
-
let { focusProps, isFocused, isFocusVisible } = $0c4a58759813079a$export$4e328f61c538687f({
|
|
4103
|
-
within: true
|
|
4104
|
-
});
|
|
4105
|
-
let renderProps = $64fa3d84918910a7$export$4d86445c2cf5e3({
|
|
4106
|
-
...props,
|
|
4107
|
-
values: {
|
|
4108
|
-
state,
|
|
4109
|
-
isFocusWithin: isFocused,
|
|
4110
|
-
isFocusVisible,
|
|
4111
|
-
isDisabled: props.isDisabled || false,
|
|
4112
|
-
isInvalid: state.isInvalid,
|
|
4113
|
-
isOpen: state.isOpen
|
|
4114
|
-
},
|
|
4115
|
-
defaultClassName: "react-aria-DateRangePicker"
|
|
4116
|
-
});
|
|
4117
|
-
let DOMProps = $65484d02dcb7eb3e$export$457c3d6518dd4c6f(props, {
|
|
4118
|
-
global: true
|
|
4119
|
-
});
|
|
4120
|
-
delete DOMProps.id;
|
|
4121
|
-
return /* @__PURE__ */ React__default.createElement($64fa3d84918910a7$export$2881499e37b75b9a, {
|
|
4122
|
-
values: [
|
|
4123
|
-
[
|
|
4124
|
-
$06d5b8ec9ee5d538$export$80d7ae1f804790be,
|
|
4125
|
-
state
|
|
4126
|
-
],
|
|
4127
|
-
[
|
|
4128
|
-
$a049562f99e7db0e$export$f9c6924e160136d1,
|
|
4129
|
-
{
|
|
4130
|
-
...groupProps,
|
|
4131
|
-
ref: groupRef,
|
|
4132
|
-
isInvalid: state.isInvalid
|
|
4133
|
-
}
|
|
4134
|
-
],
|
|
4135
|
-
[
|
|
4136
|
-
$d2b4bc8c273e7be6$export$24d547caef80ccd1,
|
|
4137
|
-
{
|
|
4138
|
-
...buttonProps,
|
|
4139
|
-
isPressed: state.isOpen
|
|
4140
|
-
}
|
|
4141
|
-
],
|
|
4142
|
-
[
|
|
4143
|
-
$01b77f81d0f07f68$export$75b6ee27786ba447,
|
|
4144
|
-
{
|
|
4145
|
-
...labelProps,
|
|
4146
|
-
ref: labelRef,
|
|
4147
|
-
elementType: "span"
|
|
4148
|
-
}
|
|
4149
|
-
],
|
|
4150
|
-
[
|
|
4151
|
-
$dfd62f934fc76fed$export$233dd9682e1ad64b,
|
|
4152
|
-
calendarProps
|
|
4153
|
-
],
|
|
4154
|
-
[
|
|
4155
|
-
$de32f1b87079253c$export$d2f961adcb0afbe,
|
|
4156
|
-
state
|
|
4157
|
-
],
|
|
4158
|
-
[
|
|
4159
|
-
$07b14b47974efb58$export$9b9a0cd73afb7ca4,
|
|
4160
|
-
{
|
|
4161
|
-
trigger: "DateRangePicker",
|
|
4162
|
-
triggerRef: groupRef,
|
|
4163
|
-
placement: "bottom start",
|
|
4164
|
-
style: {
|
|
4165
|
-
"--trigger-width": groupWidth
|
|
4166
|
-
},
|
|
4167
|
-
clearContexts: $06d5b8ec9ee5d538$var$CLEAR_CONTEXTS
|
|
4168
|
-
}
|
|
4169
|
-
],
|
|
4170
|
-
[
|
|
4171
|
-
$de32f1b87079253c$export$8b93a07348a7730c,
|
|
4172
|
-
dialogProps
|
|
4173
|
-
],
|
|
4174
|
-
[
|
|
4175
|
-
$40825cdb76e74f70$export$7b3e670c86da5fe8,
|
|
4176
|
-
{
|
|
4177
|
-
slots: {
|
|
4178
|
-
start: startFieldProps,
|
|
4179
|
-
end: endFieldProps
|
|
4180
|
-
}
|
|
4181
|
-
}
|
|
4182
|
-
],
|
|
4183
|
-
[
|
|
4184
|
-
$514c0188e459b4c0$export$9afb8bc826b033ea,
|
|
4185
|
-
{
|
|
4186
|
-
slots: {
|
|
4187
|
-
description: descriptionProps,
|
|
4188
|
-
errorMessage: errorMessageProps
|
|
4189
|
-
}
|
|
4190
|
-
}
|
|
4191
|
-
],
|
|
4192
|
-
[
|
|
4193
|
-
$ee014567cb39d3f0$export$ff05c3ac10437e03,
|
|
4194
|
-
validation
|
|
4195
|
-
]
|
|
4196
|
-
]
|
|
4197
|
-
}, /* @__PURE__ */ React__default.createElement("div", {
|
|
4198
|
-
...$3ef42575df84b30b$export$9d1611c77c2fe928(DOMProps, renderProps, focusProps),
|
|
4199
|
-
ref,
|
|
4200
|
-
slot: props.slot || void 0,
|
|
4201
|
-
"data-focus-within": isFocused || void 0,
|
|
4202
|
-
"data-invalid": state.isInvalid || void 0,
|
|
4203
|
-
"data-focus-visible": isFocusVisible || void 0,
|
|
4204
|
-
"data-disabled": props.isDisabled || void 0,
|
|
4205
|
-
"data-open": state.isOpen || void 0
|
|
4206
|
-
}));
|
|
4207
|
-
});
|
|
4208
3419
|
const $5cb03073d3f54797$export$a8a3e93435678ff9 = /* @__PURE__ */ forwardRef(function Heading(props, ref) {
|
|
4209
3420
|
[props, ref] = $64fa3d84918910a7$export$29f1550f4b0d4415(props, ref, $4e85f108e88277b8$export$d688439359537581);
|
|
4210
3421
|
let { children, level = 3, className, ...domProps } = props;
|
|
@@ -4225,231 +3436,99 @@ const Date = ({ size, ...props }) => /* @__PURE__ */ React.createElement("svg",
|
|
|
4225
3436
|
Date.displayName = "Date";
|
|
4226
3437
|
var Date_default = Date;
|
|
4227
3438
|
const root = "root__l0Qv-";
|
|
4228
|
-
const popover = "popover__JAzkr";
|
|
4229
3439
|
const datePicker = "datePicker__n-7WW";
|
|
4230
|
-
const labelRow = "labelRow__pUSW5";
|
|
4231
3440
|
const label = "label__YTX1z";
|
|
4232
|
-
const
|
|
4233
|
-
const
|
|
4234
|
-
const tooltip = "tooltip__-Jo2K";
|
|
3441
|
+
const helperText = "helperText__CKn-5";
|
|
3442
|
+
const errorMessage = "errorMessage__b9Pp3";
|
|
4235
3443
|
const group = "group__2UIvk";
|
|
4236
3444
|
const field = "field__lHZ2g";
|
|
4237
|
-
const rangeSeparator = "rangeSeparator__jAkz-";
|
|
4238
|
-
const description = "description__nmlkW";
|
|
4239
|
-
const errorMessage = "errorMessage__b9Pp3";
|
|
4240
3445
|
const segment = "segment__w-IAO";
|
|
4241
|
-
const clearButton = "clearButton__NdcRh";
|
|
4242
|
-
const clearIcon = "clearIcon__Klxmr";
|
|
4243
3446
|
const calendarButton = "calendarButton__s-QAb";
|
|
3447
|
+
const navButton = "navButton__5nJy7";
|
|
4244
3448
|
const calendarIcon = "calendarIcon__CYg1H";
|
|
4245
|
-
const
|
|
3449
|
+
const navIcon = "navIcon__LkD1n";
|
|
3450
|
+
const positioner = "positioner__38UDd";
|
|
3451
|
+
const popover = "popover__JAzkr";
|
|
4246
3452
|
const calendar = "calendar__dQLez";
|
|
4247
3453
|
const calendarHeader = "calendarHeader__h7CtJ";
|
|
4248
3454
|
const calendarHeading = "calendarHeading__JLdsJ";
|
|
4249
|
-
const navButton = "navButton__5nJy7";
|
|
4250
|
-
const navIcon = "navIcon__LkD1n";
|
|
4251
3455
|
const calendarGrid = "calendarGrid__7hp87";
|
|
4252
3456
|
const calendarCell = "calendarCell__Pjcxr";
|
|
4253
3457
|
const styles = {
|
|
4254
3458
|
root,
|
|
4255
|
-
popover,
|
|
4256
3459
|
datePicker,
|
|
4257
|
-
labelRow,
|
|
4258
3460
|
label,
|
|
4259
|
-
|
|
4260
|
-
|
|
4261
|
-
tooltip,
|
|
3461
|
+
helperText,
|
|
3462
|
+
errorMessage,
|
|
4262
3463
|
group,
|
|
4263
3464
|
field,
|
|
4264
|
-
rangeSeparator,
|
|
4265
|
-
description,
|
|
4266
|
-
errorMessage,
|
|
4267
3465
|
segment,
|
|
4268
|
-
clearButton,
|
|
4269
|
-
clearIcon,
|
|
4270
3466
|
calendarButton,
|
|
3467
|
+
navButton,
|
|
4271
3468
|
calendarIcon,
|
|
4272
|
-
|
|
3469
|
+
navIcon,
|
|
3470
|
+
positioner,
|
|
3471
|
+
popover,
|
|
4273
3472
|
calendar,
|
|
4274
3473
|
calendarHeader,
|
|
4275
3474
|
calendarHeading,
|
|
4276
|
-
navButton,
|
|
4277
|
-
navIcon,
|
|
4278
3475
|
calendarGrid,
|
|
4279
3476
|
calendarCell
|
|
4280
3477
|
};
|
|
4281
|
-
const
|
|
4282
|
-
|
|
4283
|
-
const toDateValue = (iso, withTime) => {
|
|
4284
|
-
if (!iso) {
|
|
3478
|
+
const toCalendarDate = (value) => {
|
|
3479
|
+
if (typeof value !== "string" || !value) {
|
|
4285
3480
|
return null;
|
|
4286
3481
|
}
|
|
4287
3482
|
try {
|
|
4288
|
-
|
|
4289
|
-
const parsed = iso.includes("T") ? $58246871e4652552$export$588937bcd60ade55(iso) : $58246871e4652552$export$6b862160d295c8e(iso);
|
|
4290
|
-
return $d07e34cce18680fd$export$b21e0b124e224484(parsed);
|
|
4291
|
-
}
|
|
4292
|
-
return $58246871e4652552$export$6b862160d295c8e(iso.slice(0, 10));
|
|
3483
|
+
return $58246871e4652552$export$6b862160d295c8e(value);
|
|
4293
3484
|
} catch {
|
|
4294
3485
|
return null;
|
|
4295
3486
|
}
|
|
4296
3487
|
};
|
|
4297
|
-
const
|
|
4298
|
-
if (!date) {
|
|
4299
|
-
return EMPTY_VALUE;
|
|
4300
|
-
}
|
|
4301
|
-
const iso = date.toString();
|
|
4302
|
-
return iso.includes("T") ? iso.slice(0, 16) : iso;
|
|
4303
|
-
};
|
|
4304
|
-
const dayKey = (d) => d.year * 1e4 + d.month * 100 + d.day;
|
|
4305
|
-
const toDayKey = (iso) => {
|
|
4306
|
-
if (!iso) {
|
|
4307
|
-
return void 0;
|
|
4308
|
-
}
|
|
4309
|
-
try {
|
|
4310
|
-
return dayKey($58246871e4652552$export$6b862160d295c8e(iso.slice(0, 10)));
|
|
4311
|
-
} catch {
|
|
4312
|
-
return void 0;
|
|
4313
|
-
}
|
|
4314
|
-
};
|
|
4315
|
-
const buildIsDateUnavailable = (unavailableDates) => {
|
|
4316
|
-
const ranges = [];
|
|
4317
|
-
unavailableDates == null ? void 0 : unavailableDates.forEach(({ from, to }) => {
|
|
4318
|
-
const start = toDayKey(from ?? to);
|
|
4319
|
-
const end = toDayKey(to ?? from);
|
|
4320
|
-
if (start === void 0 || end === void 0) {
|
|
4321
|
-
return;
|
|
4322
|
-
}
|
|
4323
|
-
ranges.push(start <= end ? [start, end] : [end, start]);
|
|
4324
|
-
});
|
|
4325
|
-
if (!ranges.length) {
|
|
4326
|
-
return void 0;
|
|
4327
|
-
}
|
|
4328
|
-
return (date) => {
|
|
4329
|
-
const key = dayKey(date);
|
|
4330
|
-
return ranges.some(([lo, hi]) => key >= lo && key <= hi);
|
|
4331
|
-
};
|
|
4332
|
-
};
|
|
4333
|
-
const useDatePickerValue = (params) => {
|
|
4334
|
-
const { value, endValue, onChange, onEndChange, withTime } = params;
|
|
4335
|
-
const startStr = readString(value);
|
|
4336
|
-
const endStr = readString(endValue);
|
|
4337
|
-
const toRange = () => {
|
|
4338
|
-
const start = toDateValue(startStr, withTime);
|
|
4339
|
-
const end = toDateValue(endStr, withTime);
|
|
4340
|
-
return start && end ? { start, end } : null;
|
|
4341
|
-
};
|
|
4342
|
-
const [dateValue, setDateValue] = useState(
|
|
4343
|
-
() => toDateValue(startStr, withTime)
|
|
4344
|
-
);
|
|
4345
|
-
const [rangeValue, setRangeValue] = useState(toRange);
|
|
4346
|
-
const syncSignature = `${startStr}::${endStr}::${withTime}`;
|
|
4347
|
-
const [prevSignature, setPrevSignature] = useState(syncSignature);
|
|
4348
|
-
if (prevSignature !== syncSignature) {
|
|
4349
|
-
setPrevSignature(syncSignature);
|
|
4350
|
-
setDateValue(toDateValue(startStr, withTime));
|
|
4351
|
-
setRangeValue(toRange());
|
|
4352
|
-
}
|
|
4353
|
-
const handleSingleChange = (next) => {
|
|
4354
|
-
setDateValue(next);
|
|
4355
|
-
onChange(toIso(next));
|
|
4356
|
-
};
|
|
4357
|
-
const handleRangeChange = (next) => {
|
|
4358
|
-
setRangeValue(next);
|
|
4359
|
-
onChange(toIso((next == null ? void 0 : next.start) ?? null));
|
|
4360
|
-
onEndChange(toIso((next == null ? void 0 : next.end) ?? null));
|
|
4361
|
-
};
|
|
4362
|
-
const hasValue = (isRange) => isRange ? rangeValue !== null : dateValue !== null;
|
|
4363
|
-
return {
|
|
4364
|
-
dateValue,
|
|
4365
|
-
rangeValue,
|
|
4366
|
-
handleSingleChange,
|
|
4367
|
-
handleRangeChange,
|
|
4368
|
-
hasValue
|
|
4369
|
-
};
|
|
4370
|
-
};
|
|
4371
|
-
const useDateConstraints = (params) => {
|
|
4372
|
-
const { allowPastDates, allowFutureDates, withTime } = params;
|
|
4373
|
-
const minDateStr = readString(params.minDate);
|
|
4374
|
-
const maxDateStr = readString(params.maxDate);
|
|
4375
|
-
return useMemo(() => {
|
|
4376
|
-
const todayCal = $ad063034c8620db8$export$d0bdf45af03a6ea3($ad063034c8620db8$export$aa8b41735afcabd2());
|
|
4377
|
-
const endOfDay = (date) => withTime ? $d07e34cce18680fd$export$b21e0b124e224484(date, new $2aaf608024c21ca1$export$680ea196effce5f(23, 59, 59, 999)) : date;
|
|
4378
|
-
const startOfToday = withTime ? $d07e34cce18680fd$export$b21e0b124e224484(todayCal) : todayCal;
|
|
4379
|
-
const endOfToday = endOfDay(todayCal);
|
|
4380
|
-
let min = toDateValue(minDateStr, withTime);
|
|
4381
|
-
let max = toDateValue(maxDateStr, withTime);
|
|
4382
|
-
if (max) {
|
|
4383
|
-
max = endOfDay(max);
|
|
4384
|
-
}
|
|
4385
|
-
if (!allowPastDates) {
|
|
4386
|
-
min = min && min.compare(startOfToday) > 0 ? min : startOfToday;
|
|
4387
|
-
}
|
|
4388
|
-
if (!allowFutureDates) {
|
|
4389
|
-
max = max && max.compare(endOfToday) < 0 ? max : endOfToday;
|
|
4390
|
-
}
|
|
4391
|
-
return { minValue: min ?? void 0, maxValue: max ?? void 0 };
|
|
4392
|
-
}, [minDateStr, maxDateStr, allowPastDates, allowFutureDates, withTime]);
|
|
4393
|
-
};
|
|
4394
|
-
const useUnavailableDates = (unavailableDates) => {
|
|
4395
|
-
const key = JSON.stringify(unavailableDates ?? []);
|
|
4396
|
-
return useMemo(() => buildIsDateUnavailable(unavailableDates), [key]);
|
|
4397
|
-
};
|
|
4398
|
-
const renderSegments = (segment2) => /* @__PURE__ */ jsx($40825cdb76e74f70$export$336ab7fa954c4b5f, { segment: segment2, className: styles.segment });
|
|
3488
|
+
const toLocalDate = (date) => date ? date.toString() : void 0;
|
|
4399
3489
|
const DatePickerField = ({
|
|
4400
|
-
isRange,
|
|
4401
|
-
clearButton: clearButton2,
|
|
4402
3490
|
calendarButtonLabel,
|
|
4403
3491
|
elementProps
|
|
4404
3492
|
}) => {
|
|
3493
|
+
var _a;
|
|
4405
3494
|
const groupClassName = ({
|
|
4406
3495
|
isHovered,
|
|
4407
3496
|
isFocusWithin,
|
|
3497
|
+
isInvalid,
|
|
4408
3498
|
isDisabled
|
|
4409
3499
|
}) => {
|
|
4410
|
-
var
|
|
3500
|
+
var _a2;
|
|
4411
3501
|
return clsx(
|
|
4412
3502
|
styles.group,
|
|
4413
|
-
selectors.
|
|
3503
|
+
selectors.dateInput,
|
|
4414
3504
|
isHovered && DesignStates.dateInput.hover.className,
|
|
4415
3505
|
isFocusWithin && DesignStates.dateInput.focus.className,
|
|
3506
|
+
isInvalid && DesignStates.dateInput.error.className,
|
|
4416
3507
|
isDisabled && DesignStates.dateInput.disabled.className,
|
|
4417
|
-
(
|
|
3508
|
+
(_a2 = elementProps == null ? void 0 : elementProps.dateInput) == null ? void 0 : _a2.className
|
|
4418
3509
|
);
|
|
4419
3510
|
};
|
|
4420
|
-
const
|
|
4421
|
-
|
|
3511
|
+
const isCalendarOpen = ((_a = useContext($06d5b8ec9ee5d538$export$50a10c048fdcdee9)) == null ? void 0 : _a.isOpen) ?? false;
|
|
3512
|
+
const calendarButtonClassName = ({ isHovered, isFocusVisible }) => {
|
|
3513
|
+
var _a2;
|
|
4422
3514
|
return clsx(
|
|
4423
3515
|
styles.calendarButton,
|
|
4424
3516
|
selectors.calendarButton,
|
|
4425
3517
|
isHovered && DesignStates.calendarButton.hover.className,
|
|
4426
|
-
|
|
4427
|
-
|
|
3518
|
+
// Keyboard focus only (react-aria's focus-visible), not mouse clicks.
|
|
3519
|
+
isFocusVisible && DesignStates.calendarButton.focus.className,
|
|
3520
|
+
isCalendarOpen && DesignStates.calendarButton.selected.className,
|
|
3521
|
+
(_a2 = elementProps == null ? void 0 : elementProps.calendarButton) == null ? void 0 : _a2.className
|
|
4428
3522
|
);
|
|
4429
3523
|
};
|
|
4430
3524
|
return /* @__PURE__ */ jsxs($a049562f99e7db0e$export$eb2fcfdbd7ba97d4, { className: groupClassName, "data-testid": TestIds.group, children: [
|
|
4431
|
-
|
|
4432
|
-
|
|
4433
|
-
|
|
4434
|
-
|
|
4435
|
-
|
|
4436
|
-
|
|
4437
|
-
|
|
4438
|
-
children: renderSegments
|
|
4439
|
-
}
|
|
4440
|
-
),
|
|
4441
|
-
/* @__PURE__ */ jsx("span", { "aria-hidden": "true", className: styles.rangeSeparator, children: "–" }),
|
|
4442
|
-
/* @__PURE__ */ jsx(
|
|
4443
|
-
$40825cdb76e74f70$export$7edc06cf1783b30f,
|
|
4444
|
-
{
|
|
4445
|
-
slot: "end",
|
|
4446
|
-
className: styles.field,
|
|
4447
|
-
"data-testid": TestIds.endField,
|
|
4448
|
-
children: renderSegments
|
|
4449
|
-
}
|
|
4450
|
-
)
|
|
4451
|
-
] }) : /* @__PURE__ */ jsx($40825cdb76e74f70$export$7edc06cf1783b30f, { className: styles.field, "data-testid": TestIds.field, children: renderSegments }),
|
|
4452
|
-
clearButton2,
|
|
3525
|
+
/* @__PURE__ */ jsx($40825cdb76e74f70$export$7edc06cf1783b30f, { className: styles.field, "data-testid": TestIds.field, children: (segment2) => /* @__PURE__ */ jsx(
|
|
3526
|
+
$40825cdb76e74f70$export$336ab7fa954c4b5f,
|
|
3527
|
+
{
|
|
3528
|
+
segment: segment2,
|
|
3529
|
+
className: clsx(styles.segment, selectors.segment)
|
|
3530
|
+
}
|
|
3531
|
+
) }),
|
|
4453
3532
|
/* @__PURE__ */ jsx(
|
|
4454
3533
|
$d2b4bc8c273e7be6$export$353f5b6fc5456de1,
|
|
4455
3534
|
{
|
|
@@ -4461,120 +3540,112 @@ const DatePickerField = ({
|
|
|
4461
3540
|
)
|
|
4462
3541
|
] });
|
|
4463
3542
|
};
|
|
3543
|
+
const keepOpen = () => false;
|
|
4464
3544
|
const DatePickerCalendar = ({
|
|
4465
|
-
|
|
3545
|
+
portalContainer,
|
|
3546
|
+
isPreviewOpen,
|
|
4466
3547
|
elementProps
|
|
4467
3548
|
}) => {
|
|
4468
3549
|
var _a, _b;
|
|
4469
|
-
const
|
|
4470
|
-
|
|
4471
|
-
selectors.calendar,
|
|
4472
|
-
(_a = elementProps == null ? void 0 : elementProps.calendar) == null ? void 0 : _a.className
|
|
4473
|
-
);
|
|
4474
|
-
const dayClassName = ({ isHovered, isSelected, isDisabled, isToday }) => {
|
|
4475
|
-
var _a2, _b2;
|
|
3550
|
+
const dayClassName = ({ isHovered, isSelected, isToday, isFocusVisible }) => {
|
|
3551
|
+
var _a2;
|
|
4476
3552
|
return clsx(
|
|
4477
3553
|
styles.calendarCell,
|
|
4478
|
-
selectors.
|
|
4479
|
-
isHovered && DesignStates.
|
|
4480
|
-
isSelected && DesignStates.
|
|
4481
|
-
|
|
4482
|
-
|
|
4483
|
-
|
|
3554
|
+
selectors.date,
|
|
3555
|
+
isHovered && DesignStates.dates.hover.className,
|
|
3556
|
+
isSelected && DesignStates.dates.selected.className,
|
|
3557
|
+
isToday && DesignStates.dates.today.className,
|
|
3558
|
+
// Keyboard focus only (react-aria's focus-visible), not mouse clicks.
|
|
3559
|
+
isFocusVisible && DesignStates.dates.focus.className,
|
|
3560
|
+
(_a2 = elementProps == null ? void 0 : elementProps.dates) == null ? void 0 : _a2.className
|
|
4484
3561
|
);
|
|
4485
3562
|
};
|
|
4486
|
-
const
|
|
4487
|
-
|
|
4488
|
-
|
|
4489
|
-
|
|
4490
|
-
|
|
4491
|
-
|
|
4492
|
-
|
|
4493
|
-
|
|
3563
|
+
const calendar2 = /* @__PURE__ */ jsxs(
|
|
3564
|
+
$dfd62f934fc76fed$export$e1aef45b828286de,
|
|
3565
|
+
{
|
|
3566
|
+
className: styles.calendar,
|
|
3567
|
+
"data-testid": TestIds.calendar,
|
|
3568
|
+
autoFocus: isPreviewOpen ? false : void 0,
|
|
3569
|
+
children: [
|
|
3570
|
+
/* @__PURE__ */ jsxs(
|
|
3571
|
+
"header",
|
|
3572
|
+
{
|
|
3573
|
+
className: clsx(
|
|
3574
|
+
styles.calendarHeader,
|
|
3575
|
+
selectors.calendarHeader,
|
|
3576
|
+
(_a = elementProps == null ? void 0 : elementProps.calendarHeader) == null ? void 0 : _a.className
|
|
3577
|
+
),
|
|
3578
|
+
children: [
|
|
3579
|
+
/* @__PURE__ */ jsx(
|
|
3580
|
+
$d2b4bc8c273e7be6$export$353f5b6fc5456de1,
|
|
3581
|
+
{
|
|
3582
|
+
slot: "previous",
|
|
3583
|
+
className: clsx(styles.navButton, selectors.navButton),
|
|
3584
|
+
children: /* @__PURE__ */ jsx(ChevronLeft_default, { "aria-hidden": true, className: styles.navIcon })
|
|
3585
|
+
}
|
|
3586
|
+
),
|
|
3587
|
+
/* @__PURE__ */ jsx($5cb03073d3f54797$export$a8a3e93435678ff9, { className: styles.calendarHeading }),
|
|
3588
|
+
/* @__PURE__ */ jsx(
|
|
3589
|
+
$d2b4bc8c273e7be6$export$353f5b6fc5456de1,
|
|
3590
|
+
{
|
|
3591
|
+
slot: "next",
|
|
3592
|
+
className: clsx(styles.navButton, selectors.navButton),
|
|
3593
|
+
children: /* @__PURE__ */ jsx(ChevronRight_default, { "aria-hidden": true, className: styles.navIcon })
|
|
3594
|
+
}
|
|
3595
|
+
)
|
|
3596
|
+
]
|
|
3597
|
+
}
|
|
3598
|
+
),
|
|
3599
|
+
/* @__PURE__ */ jsxs($dfd62f934fc76fed$export$5bd780d491cfc46c, { className: styles.calendarGrid, children: [
|
|
3600
|
+
/* @__PURE__ */ jsx($dfd62f934fc76fed$export$22e2d15eaa4d2377, { children: (day) => {
|
|
3601
|
+
var _a2;
|
|
3602
|
+
return /* @__PURE__ */ jsx(
|
|
3603
|
+
$dfd62f934fc76fed$export$ad2135cac3a11b3d,
|
|
3604
|
+
{
|
|
3605
|
+
className: clsx(
|
|
3606
|
+
selectors.weekday,
|
|
3607
|
+
(_a2 = elementProps == null ? void 0 : elementProps.weekdays) == null ? void 0 : _a2.className
|
|
3608
|
+
),
|
|
3609
|
+
children: day
|
|
3610
|
+
}
|
|
3611
|
+
);
|
|
3612
|
+
} }),
|
|
3613
|
+
/* @__PURE__ */ jsx($dfd62f934fc76fed$export$e11f8ba65d857bff, { children: (date) => /* @__PURE__ */ jsx($dfd62f934fc76fed$export$5d847498420df57b, { date, className: dayClassName }) })
|
|
3614
|
+
] })
|
|
3615
|
+
]
|
|
3616
|
+
}
|
|
3617
|
+
);
|
|
3618
|
+
const boxClassName = clsx(
|
|
3619
|
+
styles.popover,
|
|
3620
|
+
selectors.popover,
|
|
3621
|
+
(_b = elementProps == null ? void 0 : elementProps.popover) == null ? void 0 : _b.className
|
|
3622
|
+
);
|
|
4494
3623
|
return (
|
|
4495
|
-
// Portals
|
|
4496
|
-
//
|
|
4497
|
-
//
|
|
4498
|
-
//
|
|
4499
|
-
//
|
|
3624
|
+
// Portals into the component root rather than <body> (react-aria's default):
|
|
3625
|
+
// the editor scopes design-panel CSS to the root, so a <body>-portaled
|
|
3626
|
+
// popover would ignore its Popover/Dates design settings.
|
|
3627
|
+
//
|
|
3628
|
+
// react-aria's Popover is only the positioner (it owns inline position,
|
|
3629
|
+
// z-index and max-height). The Popover design part is the static box inside
|
|
3630
|
+
// it — the same split as Dropdown's Combobox Positioner/Popup — so the
|
|
3631
|
+
// design panel's border and padding style a plain element.
|
|
4500
3632
|
/* @__PURE__ */ jsx(
|
|
4501
3633
|
$07b14b47974efb58$export$5b6b19405a83ff9d,
|
|
4502
3634
|
{
|
|
4503
|
-
className:
|
|
4504
|
-
|
|
4505
|
-
|
|
4506
|
-
|
|
4507
|
-
|
|
4508
|
-
children: /* @__PURE__ */ jsx(
|
|
4509
|
-
$dfd62f934fc76fed$export$a4f5c8b89d277a8d,
|
|
4510
|
-
{
|
|
4511
|
-
className: calendarClassName,
|
|
4512
|
-
"data-testid": TestIds.calendar,
|
|
4513
|
-
children: calendarBody
|
|
4514
|
-
}
|
|
4515
|
-
) : /* @__PURE__ */ jsx(
|
|
4516
|
-
$dfd62f934fc76fed$export$e1aef45b828286de,
|
|
4517
|
-
{
|
|
4518
|
-
className: calendarClassName,
|
|
4519
|
-
"data-testid": TestIds.calendar,
|
|
4520
|
-
children: calendarBody
|
|
4521
|
-
}
|
|
4522
|
-
) })
|
|
3635
|
+
className: styles.positioner,
|
|
3636
|
+
containerPadding: 0,
|
|
3637
|
+
UNSTABLE_portalContainer: portalContainer ?? void 0,
|
|
3638
|
+
isNonModal: isPreviewOpen,
|
|
3639
|
+
shouldCloseOnInteractOutside: isPreviewOpen ? keepOpen : void 0,
|
|
3640
|
+
children: isPreviewOpen ? /* @__PURE__ */ jsx("div", { className: boxClassName, children: calendar2 }) : /* @__PURE__ */ jsx($de32f1b87079253c$export$3ddf2d174ce01153, { className: boxClassName, children: calendar2 })
|
|
4523
3641
|
}
|
|
4524
3642
|
)
|
|
4525
3643
|
);
|
|
4526
3644
|
};
|
|
4527
|
-
const DatePickerTooltip = ({
|
|
4528
|
-
text,
|
|
4529
|
-
portalContainer
|
|
4530
|
-
}) => /* @__PURE__ */ jsxs($4e3b923658d69c60$export$8c610744efcf8a1d, { delay: 0, children: [
|
|
4531
|
-
/* @__PURE__ */ jsx(
|
|
4532
|
-
$d2b4bc8c273e7be6$export$353f5b6fc5456de1,
|
|
4533
|
-
{
|
|
4534
|
-
className: styles.tooltipButton,
|
|
4535
|
-
"data-testid": TestIds.tooltipButton,
|
|
4536
|
-
"aria-label": text,
|
|
4537
|
-
children: /* @__PURE__ */ jsx(InfoCircleSmall_default, { "aria-hidden": true, className: styles.infoIcon })
|
|
4538
|
-
}
|
|
4539
|
-
),
|
|
4540
|
-
/* @__PURE__ */ jsx(
|
|
4541
|
-
$4e3b923658d69c60$export$28c660c63b792dea,
|
|
4542
|
-
{
|
|
4543
|
-
className: styles.tooltip,
|
|
4544
|
-
offset: 6,
|
|
4545
|
-
UNSTABLE_portalContainer: portalContainer ?? void 0,
|
|
4546
|
-
children: text
|
|
4547
|
-
}
|
|
4548
|
-
)
|
|
4549
|
-
] });
|
|
4550
|
-
const DatePickerLabel = ({
|
|
4551
|
-
label: label2,
|
|
4552
|
-
tooltip: tooltip2,
|
|
4553
|
-
required,
|
|
4554
|
-
portalContainer,
|
|
4555
|
-
className
|
|
4556
|
-
}) => {
|
|
4557
|
-
if (!label2 && !tooltip2) {
|
|
4558
|
-
return null;
|
|
4559
|
-
}
|
|
4560
|
-
return /* @__PURE__ */ jsxs("div", { className: styles.labelRow, children: [
|
|
4561
|
-
label2 ? /* @__PURE__ */ jsxs($01b77f81d0f07f68$export$b04be29aa201d4f5, { className: clsx(styles.label, selectors.label, className), children: [
|
|
4562
|
-
label2,
|
|
4563
|
-
required && /* @__PURE__ */ jsx(
|
|
4564
|
-
RequiredIndicator,
|
|
4565
|
-
{
|
|
4566
|
-
className: selectors.requiredIndicator,
|
|
4567
|
-
"data-testid": TestIds.requiredIndicator
|
|
4568
|
-
}
|
|
4569
|
-
)
|
|
4570
|
-
] }) : null,
|
|
4571
|
-
tooltip2 ? /* @__PURE__ */ jsx(DatePickerTooltip, { text: tooltip2, portalContainer }) : null
|
|
4572
|
-
] });
|
|
4573
|
-
};
|
|
4574
3645
|
const noop = () => {
|
|
4575
3646
|
};
|
|
4576
3647
|
function DatePicker2(props) {
|
|
4577
|
-
var _a, _b;
|
|
3648
|
+
var _a, _b, _c;
|
|
4578
3649
|
const environmentService = useService(EnvironmentDefinition);
|
|
4579
3650
|
const { translate } = useService(TranslationsDefinition);
|
|
4580
3651
|
const translateAria = translate(ARIA_LABEL_NAMESPACE);
|
|
@@ -4585,153 +3656,27 @@ function DatePicker2(props) {
|
|
|
4585
3656
|
const {
|
|
4586
3657
|
id,
|
|
4587
3658
|
className = "",
|
|
4588
|
-
|
|
4589
|
-
|
|
4590
|
-
|
|
4591
|
-
|
|
3659
|
+
value,
|
|
3660
|
+
label: label2,
|
|
3661
|
+
helperText: helperText2,
|
|
3662
|
+
errorMessage: errorMessage2,
|
|
4592
3663
|
readOnly = defaultValues.readOnly,
|
|
4593
|
-
|
|
3664
|
+
disabled = defaultValues.disabled,
|
|
4594
3665
|
direction,
|
|
4595
3666
|
a11y,
|
|
4596
3667
|
previewCalendarOpen,
|
|
4597
|
-
|
|
4598
|
-
onEndChange = noop,
|
|
4599
|
-
onFocus = noop,
|
|
4600
|
-
onBlur = noop,
|
|
4601
|
-
fieldValidity,
|
|
4602
|
-
showValidityIndication,
|
|
4603
|
-
onValidate,
|
|
4604
|
-
onValidityChange,
|
|
3668
|
+
onValueChange = noop,
|
|
4605
3669
|
wix,
|
|
4606
3670
|
elementProps
|
|
4607
3671
|
} = props;
|
|
4608
|
-
const label2 = readString(props.label);
|
|
4609
|
-
const description2 = readString(props.description);
|
|
4610
|
-
const tooltip2 = readString(props.tooltip);
|
|
4611
|
-
const isDisabled = readBool(props.isDisabled, false);
|
|
4612
|
-
const isRequired = readBool(props.required, defaultValues.required);
|
|
4613
|
-
const isRange = selectionMode === SelectionModeValues.Range;
|
|
4614
|
-
const withTime = granularity !== GranularityValues.Day;
|
|
4615
|
-
const isControlled = props.value !== void 0;
|
|
4616
|
-
const sourceValue = isControlled ? props.value : props.defaultValue;
|
|
4617
|
-
const sourceEndValue = isControlled ? props.endValue : props.defaultEndValue;
|
|
4618
|
-
const {
|
|
4619
|
-
dateValue,
|
|
4620
|
-
rangeValue,
|
|
4621
|
-
handleSingleChange,
|
|
4622
|
-
handleRangeChange,
|
|
4623
|
-
hasValue
|
|
4624
|
-
} = useDatePickerValue({
|
|
4625
|
-
value: sourceValue,
|
|
4626
|
-
endValue: sourceEndValue,
|
|
4627
|
-
onChange,
|
|
4628
|
-
onEndChange,
|
|
4629
|
-
withTime
|
|
4630
|
-
});
|
|
4631
|
-
const startStr = readString(props.value);
|
|
4632
|
-
const endStr = readString(props.endValue);
|
|
4633
|
-
const intrinsic = isRequired && !hasValue(isRange) ? { valid: false, validationMessage: VALUE_MISSING_MESSAGE } : { valid: true, validationMessage: "" };
|
|
4634
|
-
const {
|
|
4635
|
-
validity,
|
|
4636
|
-
showValidityIndication: showIndication,
|
|
4637
|
-
handleBlur: validateOnBlur
|
|
4638
|
-
} = useValidatedField({
|
|
4639
|
-
value: startStr,
|
|
4640
|
-
// Range change-detection keys on both endpoints; single is a plain string.
|
|
4641
|
-
valueKey: isRange ? `${startStr}|${endStr}` : startStr,
|
|
4642
|
-
intrinsic,
|
|
4643
|
-
fieldValidity,
|
|
4644
|
-
showValidityIndication,
|
|
4645
|
-
onValidate,
|
|
4646
|
-
onValidityChange
|
|
4647
|
-
});
|
|
4648
|
-
const isInvalid = showIndication && !validity.valid;
|
|
4649
|
-
const handleBlur = (event) => {
|
|
4650
|
-
onBlur(event);
|
|
4651
|
-
validateOnBlur();
|
|
4652
|
-
};
|
|
4653
|
-
const { minValue, maxValue } = useDateConstraints({
|
|
4654
|
-
minDate: props.minDate,
|
|
4655
|
-
maxDate: props.maxDate,
|
|
4656
|
-
allowPastDates,
|
|
4657
|
-
allowFutureDates,
|
|
4658
|
-
withTime
|
|
4659
|
-
});
|
|
4660
|
-
const isDateUnavailable = useUnavailableDates(props.unavailableDates);
|
|
4661
3672
|
const [portalContainer, setPortalContainer] = useState(
|
|
4662
3673
|
null
|
|
4663
3674
|
);
|
|
4664
3675
|
const locale = environmentService.language || "en-US";
|
|
4665
|
-
const ariaLabel = (a11y == null ? void 0 : a11y.ariaLabel) || label2
|
|
4666
|
-
const
|
|
4667
|
-
|
|
4668
|
-
"button",
|
|
4669
|
-
{
|
|
4670
|
-
type: "button",
|
|
4671
|
-
className: styles.clearButton,
|
|
4672
|
-
"data-testid": TestIds.clearButton,
|
|
4673
|
-
"aria-label": t(AriaLabels.clear),
|
|
4674
|
-
onClick: () => isRange ? handleRangeChange(null) : handleSingleChange(null),
|
|
4675
|
-
children: /* @__PURE__ */ jsx(DismissSmall_default, { "aria-hidden": true, className: styles.clearIcon })
|
|
4676
|
-
}
|
|
4677
|
-
) : null;
|
|
4678
|
-
const pickerChildren = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
4679
|
-
/* @__PURE__ */ jsx(
|
|
4680
|
-
DatePickerLabel,
|
|
4681
|
-
{
|
|
4682
|
-
label: label2,
|
|
4683
|
-
tooltip: tooltip2,
|
|
4684
|
-
required: isRequired,
|
|
4685
|
-
portalContainer,
|
|
4686
|
-
className: (_a = elementProps == null ? void 0 : elementProps.label) == null ? void 0 : _a.className
|
|
4687
|
-
}
|
|
4688
|
-
),
|
|
4689
|
-
/* @__PURE__ */ jsx(
|
|
4690
|
-
DatePickerField,
|
|
4691
|
-
{
|
|
4692
|
-
isRange,
|
|
4693
|
-
clearButton: clearButton2,
|
|
4694
|
-
calendarButtonLabel: t(AriaLabels.openCalendar),
|
|
4695
|
-
elementProps
|
|
4696
|
-
}
|
|
4697
|
-
),
|
|
4698
|
-
description2 ? /* @__PURE__ */ jsx(
|
|
4699
|
-
$514c0188e459b4c0$export$5f1af8db9871e1d6,
|
|
4700
|
-
{
|
|
4701
|
-
slot: "description",
|
|
4702
|
-
className: clsx(
|
|
4703
|
-
styles.description,
|
|
4704
|
-
selectors.description,
|
|
4705
|
-
(_b = elementProps == null ? void 0 : elementProps.description) == null ? void 0 : _b.className
|
|
4706
|
-
),
|
|
4707
|
-
children: description2
|
|
4708
|
-
}
|
|
4709
|
-
) : null,
|
|
4710
|
-
isInvalid && validity.validationMessage ? /* @__PURE__ */ jsx(
|
|
4711
|
-
$ee014567cb39d3f0$export$f551688fc98f2e09,
|
|
4712
|
-
{
|
|
4713
|
-
className: clsx(styles.errorMessage, selectors.errorMessage),
|
|
4714
|
-
"data-testid": TestIds.errorMessage,
|
|
4715
|
-
children: validity.validationMessage
|
|
4716
|
-
}
|
|
4717
|
-
) : null,
|
|
4718
|
-
/* @__PURE__ */ jsx(DatePickerCalendar, { isRange, elementProps })
|
|
4719
|
-
] });
|
|
4720
|
-
const sharedProps = {
|
|
4721
|
-
granularity,
|
|
4722
|
-
minValue,
|
|
4723
|
-
maxValue,
|
|
4724
|
-
isDateUnavailable,
|
|
4725
|
-
isDisabled,
|
|
4726
|
-
isReadOnly: readOnly,
|
|
4727
|
-
isRequired,
|
|
4728
|
-
isInvalid,
|
|
4729
|
-
"aria-label": ariaLabel,
|
|
4730
|
-
onFocus,
|
|
4731
|
-
onBlur: handleBlur,
|
|
4732
|
-
isOpen: previewCalendarOpen || void 0
|
|
3676
|
+
const ariaLabel = (a11y == null ? void 0 : a11y.ariaLabel) || (label2 ? void 0 : t(AriaLabels.root));
|
|
3677
|
+
const handleChange = (date) => {
|
|
3678
|
+
onValueChange(toLocalDate(date));
|
|
4733
3679
|
};
|
|
4734
|
-
const pickerClassName = styles.datePicker;
|
|
4735
3680
|
return /* @__PURE__ */ jsx(
|
|
4736
3681
|
"div",
|
|
4737
3682
|
{
|
|
@@ -4752,23 +3697,70 @@ function DatePicker2(props) {
|
|
|
4752
3697
|
dir: direction || void 0,
|
|
4753
3698
|
lang: environmentService.language,
|
|
4754
3699
|
"data-testid": TestIds.root,
|
|
4755
|
-
children: /* @__PURE__ */ jsx($2eb8e6d23f3d0cb0$export$a54013f0d02a8f82, { locale, children:
|
|
4756
|
-
$06d5b8ec9ee5d538$export$17334619f3ac2224,
|
|
4757
|
-
{
|
|
4758
|
-
className: pickerClassName,
|
|
4759
|
-
value: rangeValue,
|
|
4760
|
-
onChange: handleRangeChange,
|
|
4761
|
-
...sharedProps,
|
|
4762
|
-
children: pickerChildren
|
|
4763
|
-
}
|
|
4764
|
-
) : /* @__PURE__ */ jsx(
|
|
3700
|
+
children: /* @__PURE__ */ jsx($2eb8e6d23f3d0cb0$export$a54013f0d02a8f82, { locale, children: /* @__PURE__ */ jsxs(
|
|
4765
3701
|
$06d5b8ec9ee5d538$export$5109c6dd95d8fb00,
|
|
4766
3702
|
{
|
|
4767
|
-
className:
|
|
4768
|
-
value:
|
|
4769
|
-
onChange:
|
|
4770
|
-
|
|
4771
|
-
|
|
3703
|
+
className: styles.datePicker,
|
|
3704
|
+
value: toCalendarDate(value),
|
|
3705
|
+
onChange: handleChange,
|
|
3706
|
+
isDisabled: disabled,
|
|
3707
|
+
isReadOnly: readOnly,
|
|
3708
|
+
isInvalid: !!errorMessage2,
|
|
3709
|
+
"aria-label": ariaLabel,
|
|
3710
|
+
isOpen: previewCalendarOpen || void 0,
|
|
3711
|
+
children: [
|
|
3712
|
+
label2 ? /* @__PURE__ */ jsx(
|
|
3713
|
+
$01b77f81d0f07f68$export$b04be29aa201d4f5,
|
|
3714
|
+
{
|
|
3715
|
+
className: clsx(
|
|
3716
|
+
styles.label,
|
|
3717
|
+
selectors.label,
|
|
3718
|
+
(_a = elementProps == null ? void 0 : elementProps.label) == null ? void 0 : _a.className
|
|
3719
|
+
),
|
|
3720
|
+
children: label2
|
|
3721
|
+
}
|
|
3722
|
+
) : null,
|
|
3723
|
+
/* @__PURE__ */ jsx(
|
|
3724
|
+
DatePickerField,
|
|
3725
|
+
{
|
|
3726
|
+
calendarButtonLabel: t(AriaLabels.openCalendar),
|
|
3727
|
+
elementProps
|
|
3728
|
+
}
|
|
3729
|
+
),
|
|
3730
|
+
helperText2 ? /* @__PURE__ */ jsx(
|
|
3731
|
+
$514c0188e459b4c0$export$5f1af8db9871e1d6,
|
|
3732
|
+
{
|
|
3733
|
+
slot: "description",
|
|
3734
|
+
className: clsx(
|
|
3735
|
+
styles.helperText,
|
|
3736
|
+
selectors.helperText,
|
|
3737
|
+
(_b = elementProps == null ? void 0 : elementProps.helperText) == null ? void 0 : _b.className
|
|
3738
|
+
),
|
|
3739
|
+
"data-testid": TestIds.helperText,
|
|
3740
|
+
children: helperText2
|
|
3741
|
+
}
|
|
3742
|
+
) : null,
|
|
3743
|
+
/* @__PURE__ */ jsx(
|
|
3744
|
+
$ee014567cb39d3f0$export$f551688fc98f2e09,
|
|
3745
|
+
{
|
|
3746
|
+
className: clsx(
|
|
3747
|
+
styles.errorMessage,
|
|
3748
|
+
selectors.errorMessage,
|
|
3749
|
+
(_c = elementProps == null ? void 0 : elementProps.errorMessage) == null ? void 0 : _c.className
|
|
3750
|
+
),
|
|
3751
|
+
"data-testid": TestIds.errorMessage,
|
|
3752
|
+
children: errorMessage2
|
|
3753
|
+
}
|
|
3754
|
+
),
|
|
3755
|
+
/* @__PURE__ */ jsx(
|
|
3756
|
+
DatePickerCalendar,
|
|
3757
|
+
{
|
|
3758
|
+
portalContainer,
|
|
3759
|
+
isPreviewOpen: previewCalendarOpen,
|
|
3760
|
+
elementProps
|
|
3761
|
+
}
|
|
3762
|
+
)
|
|
3763
|
+
]
|
|
4772
3764
|
}
|
|
4773
3765
|
) })
|
|
4774
3766
|
}
|