@easypost/easy-ui 1.0.0-alpha.60 → 1.0.0-alpha.61
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/Badge/index.js +14 -14
- package/Badge/index.mjs +14 -14
- package/Banner/index.js +5 -5
- package/Banner/index.mjs +5 -5
- package/Button/index.js +1 -1
- package/Button/index.mjs +1 -1
- package/CHANGELOG.md +6 -0
- package/Calendar/CalendarCell.d.ts.map +1 -1
- package/Calendar/index.js +2 -40
- package/Calendar/index.mjs +2 -40
- package/Card/index.js +1 -1
- package/Card/index.mjs +1 -1
- package/Checkbox/index.js +1 -1
- package/Checkbox/index.mjs +1 -1
- package/CodeBlock/index.js +13 -13
- package/CodeBlock/index.mjs +15 -15
- package/CodeSnippet/index.js +1 -1
- package/CodeSnippet/index.mjs +1 -1
- package/DataGrid/index.js +63 -62
- package/DataGrid/index.mjs +72 -71
- package/DatePicker/DateField.d.ts +14 -0
- package/DatePicker/DateField.d.ts.map +1 -0
- package/DatePicker/DatePicker.d.ts +91 -0
- package/DatePicker/DatePicker.d.ts.map +1 -0
- package/DatePicker/DatePicker.stories.d.ts +14 -0
- package/DatePicker/DatePicker.stories.d.ts.map +1 -0
- package/DatePicker/DatePicker.test.d.ts +2 -0
- package/DatePicker/DatePicker.test.d.ts.map +1 -0
- package/DatePicker/DatePickerBase.d.ts +32 -0
- package/DatePicker/DatePickerBase.d.ts.map +1 -0
- package/DatePicker/DatePickerOverlay.d.ts +12 -0
- package/DatePicker/DatePickerOverlay.d.ts.map +1 -0
- package/DatePicker/DatePickerTrigger.d.ts +20 -0
- package/DatePicker/DatePickerTrigger.d.ts.map +1 -0
- package/DatePicker/index.d.ts +2 -0
- package/DatePicker/index.d.ts.map +1 -0
- package/DatePicker/index.js +275 -0
- package/DatePicker/index.mjs +275 -0
- package/DateRangePicker/DateRangePicker.d.ts +89 -0
- package/DateRangePicker/DateRangePicker.d.ts.map +1 -0
- package/DateRangePicker/DateRangePicker.stories.d.ts +14 -0
- package/DateRangePicker/DateRangePicker.stories.d.ts.map +1 -0
- package/DateRangePicker/DateRangePicker.test.d.ts +2 -0
- package/DateRangePicker/DateRangePicker.test.d.ts.map +1 -0
- package/DateRangePicker/index.d.ts +2 -0
- package/DateRangePicker/index.d.ts.map +1 -0
- package/DateRangePicker/index.js +434 -0
- package/DateRangePicker/index.mjs +434 -0
- package/Drawer/index.js +22 -22
- package/Drawer/index.mjs +21 -21
- package/DropdownButton/index.js +12 -12
- package/DropdownButton/index.mjs +13 -13
- package/EmptyStateCard/index.js +8 -8
- package/EmptyStateCard/index.mjs +8 -8
- package/FocusedProductLayout/index.js +23 -23
- package/FocusedProductLayout/index.mjs +23 -23
- package/ForgeLayout/index.js +27 -27
- package/ForgeLayout/index.mjs +30 -30
- package/FormLayout/index.js +5 -5
- package/FormLayout/index.mjs +5 -5
- package/HorizontalGrid/index.js +1 -1
- package/HorizontalGrid/index.mjs +1 -1
- package/HorizontalStack/index.js +1 -1
- package/HorizontalStack/index.mjs +1 -1
- package/Icon/index.js +1 -1
- package/Icon/index.mjs +1 -1
- package/IconButton/index.js +12 -12
- package/IconButton/index.mjs +13 -13
- package/InputField/index.js +1 -1
- package/InputField/index.mjs +1 -1
- package/KebabButton/index.js +1 -1
- package/KebabButton/index.mjs +1 -1
- package/Menu/index.js +1 -1
- package/Menu/index.mjs +1 -1
- package/Modal/index.js +23 -23
- package/Modal/index.mjs +22 -22
- package/NexusLayout/index.js +28 -28
- package/NexusLayout/index.mjs +31 -31
- package/Notification/index.js +1 -1
- package/Notification/index.mjs +1 -1
- package/Pagination/index.js +7 -7
- package/Pagination/index.mjs +8 -8
- package/PillGroup/index.js +9 -9
- package/PillGroup/index.mjs +19 -19
- package/ProductLayout/index.js +24 -24
- package/ProductLayout/index.mjs +25 -25
- package/Provider/index.js +1 -1
- package/Provider/index.mjs +2 -2
- package/RadioButtonGroup/index.js +2 -2
- package/RadioButtonGroup/index.mjs +5 -5
- package/RadioGroup/index.js +16 -16
- package/RadioGroup/index.mjs +21 -21
- package/RangeCalendar/RangeCalendar.test.d.ts +2 -1
- package/RangeCalendar/RangeCalendar.test.d.ts.map +1 -1
- package/RangeCalendar/index.js +2 -226
- package/RangeCalendar/index.mjs +2 -226
- package/SearchNav/index.js +29 -29
- package/SearchNav/index.mjs +30 -30
- package/SectionCard/index.js +7 -7
- package/SectionCard/index.mjs +7 -7
- package/Select/index.js +7 -6
- package/Select/index.mjs +6 -5
- package/SelectorErrorTooltip/index.js +1 -1
- package/SelectorErrorTooltip/index.mjs +1 -1
- package/Spinner/index.js +1 -1
- package/Spinner/index.mjs +1 -1
- package/SplitToggleCard/index.js +4 -4
- package/SplitToggleCard/index.mjs +4 -4
- package/Stepper/index.js +1 -1
- package/Stepper/index.mjs +1 -1
- package/TabNav/index.js +1 -1
- package/TabNav/index.mjs +1 -1
- package/TabPanels/index.js +1 -1
- package/TabPanels/index.mjs +7 -7
- package/Tabs/index.js +1 -1
- package/Tabs/index.mjs +1 -1
- package/Text/index.js +1 -1
- package/Text/index.mjs +1 -1
- package/TextField/index.js +1 -1
- package/TextField/index.mjs +1 -1
- package/Textarea/index.js +1 -1
- package/Textarea/index.mjs +1 -1
- package/Toggle/index.js +1 -1
- package/Toggle/index.mjs +1 -1
- package/ToggleCard/index.js +2 -2
- package/ToggleCard/index.mjs +2 -2
- package/Tooltip/index.js +1 -1
- package/Tooltip/index.mjs +1 -1
- package/UnstyledButton/index.mjs +1 -1
- package/VerticalNav/index.js +24 -24
- package/VerticalNav/index.mjs +27 -27
- package/VerticalStack/index.js +1 -1
- package/VerticalStack/index.mjs +1 -1
- package/__chunks__/{Button-DuqSI9GS.js → Button-BzB8v2mS.js} +17 -17
- package/__chunks__/{Button-D0YAQvKG.mjs → Button-DcYNVtp7.mjs} +3 -3
- package/__chunks__/{Button-bGGT-c6v.mjs → Button-gxCTl22H.mjs} +18 -18
- package/__chunks__/{Button-D8vjHIx8.js → Button-jgkOum0d.js} +1 -1
- package/__chunks__/Calendar-BS8zgZK8.js +41 -0
- package/__chunks__/Calendar-C9hD67Rz.mjs +42 -0
- package/__chunks__/{CalendarBase-DbXh9rhk.mjs → CalendarBase-4iGD1mPK.mjs} +99 -27
- package/__chunks__/{CalendarBase-CiBPzvL4.js → CalendarBase-saNix6u1.js} +94 -22
- package/__chunks__/{Card-DdHvpDEw.mjs → Card-Cr-bIjoN.mjs} +12 -12
- package/__chunks__/{Card-93kQP9IL.js → Card-DaFTIHZD.js} +12 -12
- package/__chunks__/{Checkbox-BRrfKcFE.mjs → Checkbox-BR4RBHLp.mjs} +23 -23
- package/__chunks__/{Checkbox-MbPCVxqs.js → Checkbox-BY4UkCg7.js} +20 -20
- package/__chunks__/{CodeSnippet-xb-psm_O.mjs → CodeSnippet-ChZIz_CO.mjs} +2 -2
- package/__chunks__/{CodeSnippet-D9ZZXVs3.js → CodeSnippet-H-6ta_Y8.js} +2 -2
- package/__chunks__/DatePickerBase-DlbnqBLN.mjs +3152 -0
- package/__chunks__/DatePickerBase-vorBKIfJ.js +3166 -0
- package/__chunks__/{FocusScope-CEeqhVmO.mjs → FocusScope-CjcZn1Rq.mjs} +4 -4
- package/__chunks__/{HelpMenu-E6z6tRl8.js → HelpMenu-BzUSoyPi.js} +6 -6
- package/__chunks__/{HelpMenu-CCHBb1Kr.mjs → HelpMenu-yEjZgR1V.mjs} +7 -7
- package/__chunks__/{HorizontalGrid-B7ijxURd.js → HorizontalGrid-Bhj16LbM.js} +1 -1
- package/__chunks__/{HorizontalGrid-vw7R2Tld.mjs → HorizontalGrid-D4bJqbQV.mjs} +1 -1
- package/__chunks__/{HorizontalStack-Dx9zYaH0.mjs → HorizontalStack-BDZp8p9E.mjs} +1 -1
- package/__chunks__/{HorizontalStack-1g4N72TF.js → HorizontalStack-_DnrRlDb.js} +1 -1
- package/__chunks__/{Icon-QGDwoR1f.mjs → Icon-BdtOD2WX.mjs} +2 -2
- package/__chunks__/{Icon-oPEVg2C8.js → Icon-DJ8CpeVT.js} +2 -2
- package/__chunks__/InputCaption-BBbxPdvJ.mjs +61 -0
- package/__chunks__/InputCaption-CEIuQ6BY.js +60 -0
- package/__chunks__/{InputField-BGBRvVMR.js → InputField-BUU9HZ1I.js} +7 -6
- package/__chunks__/{InputField-BI73lSp6.mjs → InputField-CPxOg_cd.mjs} +8 -7
- package/__chunks__/InputIcon-MHt_XLtO.mjs +112 -0
- package/__chunks__/InputIcon-nUumrcJ5.js +111 -0
- package/__chunks__/{KebabButton-DBLcfQI6.mjs → KebabButton-BapJTvS6.mjs} +5 -5
- package/__chunks__/{KebabButton-C15-V-k2.js → KebabButton-C3KI5LDA.js} +4 -4
- package/__chunks__/{LiveAnnouncer-Bi_Y3tfX.mjs → LiveAnnouncer-BSV5-C0m.mjs} +5 -1
- package/__chunks__/{LiveAnnouncer-Dwkwacle.js → LiveAnnouncer-CzeNwq2D.js} +4 -0
- package/__chunks__/{Menu-Cuqxc1iw.js → Menu-CkQaJJAH.js} +31 -30
- package/__chunks__/{Menu-BELtbX2b.mjs → Menu-LzJveIa-.mjs} +21 -20
- package/__chunks__/{Notification-D90-75ZN.js → Notification-C5_bwXj4.js} +15 -15
- package/__chunks__/{Notification-lqESwByD.mjs → Notification-CAmvbAK1.mjs} +18 -18
- package/__chunks__/{Spinner-D3LMSY80.js → NumberFormatter-CXW1Iqpu.js} +1 -79
- package/__chunks__/{Spinner-tHEG0z1g.mjs → NumberFormatter-p5KNJNTT.mjs} +1 -79
- package/__chunks__/{Overlay-CuhLUuXt.mjs → Overlay-d3z5W5Nn.mjs} +6 -6
- package/__chunks__/RangeCalendar-5enltd2P.js +227 -0
- package/__chunks__/RangeCalendar-Bhk32GB_.mjs +228 -0
- package/__chunks__/{SelectOverlay-pFcbx7UM.js → SelectOverlay-DKJvzJJ7.js} +35 -33
- package/__chunks__/{SelectOverlay-CadnQpV0.mjs → SelectOverlay-MLWWpDpl.mjs} +32 -30
- package/__chunks__/{SelectionManager-IO4G_cI2.mjs → SelectionManager-DCO_d3m1.mjs} +2 -2
- package/__chunks__/{SelectorErrorTooltip-CFlgzXu5.mjs → SelectorErrorTooltip-DLyZgeUf.mjs} +4 -4
- package/__chunks__/{SelectorErrorTooltip-Cfzpo7X3.js → SelectorErrorTooltip-DowQ2whn.js} +4 -4
- package/__chunks__/Spinner-BFydR08g.js +100 -0
- package/__chunks__/Spinner-hJoFNoHJ.mjs +101 -0
- package/__chunks__/{Stepper-B0w3sKYh.mjs → Stepper-BY8zQdW2.mjs} +27 -27
- package/__chunks__/{Stepper-Bbihngk4.js → Stepper-CxWpMLEW.js} +25 -25
- package/__chunks__/{TabNav-BHETvib0.js → TabNav-1cTg6TWo.js} +1 -1
- package/__chunks__/{TabNav-2W0d3JQ0.mjs → TabNav-burpvHrg.mjs} +1 -1
- package/__chunks__/{Tabs-C-D794Gi.mjs → Tabs-BzZ9w82m.mjs} +18 -18
- package/__chunks__/{Tabs-9dihRp0n.js → Tabs-DHXJckwb.js} +17 -17
- package/__chunks__/{Text-D8wg72pq.mjs → Text-CQ_8wg0t.mjs} +34 -34
- package/__chunks__/{Text-CEI17LPu.js → Text-Dfbyoxsz.js} +34 -34
- package/__chunks__/{Toggle-DlIBs_Za.mjs → Toggle-BiaALtul.mjs} +13 -13
- package/__chunks__/{Toggle-4oQhSggV.js → Toggle-CYKsPbEK.js} +11 -11
- package/__chunks__/{Tooltip-Cxv7qnVD.mjs → Tooltip-5ZgKkdk8.mjs} +12 -12
- package/__chunks__/{Tooltip-7wXzqEZl.js → Tooltip-Bzqm5boz.js} +8 -8
- package/__chunks__/{UnstyledButton-B7BScs8i.mjs → UnstyledButton-BlB066YT.mjs} +1 -1
- package/__chunks__/{VerticalStack-BTB8fX9P.js → VerticalStack-_gyNJbOa.js} +3 -3
- package/__chunks__/{VerticalStack-HnwP17N3.mjs → VerticalStack-eKUWFHU3.mjs} +3 -3
- package/__chunks__/{VisuallyHidden-BttNIgVC.mjs → VisuallyHidden-DmDK0fH3.mjs} +1 -1
- package/__chunks__/{ariaHideOutside-DcIkumuG.mjs → ariaHideOutside-B-UoCW1g.mjs} +5 -29
- package/__chunks__/{ariaHideOutside-DNGR3Fo6.js → ariaHideOutside-a1MUBVQF.js} +0 -24
- package/__chunks__/{focusSafely-Dw7K4rnX.mjs → focusSafely-DcMa3q3g.mjs} +2 -2
- package/__chunks__/{isVirtualEvent-BFRy7P_p.mjs → isVirtualEvent-BPCuFO54.mjs} +2 -2
- package/__chunks__/{useButton-B1CurEpI.mjs → useButton-BoMy_zYC.mjs} +2 -2
- package/__chunks__/useCollator-DGrSWVh4.js +12 -0
- package/__chunks__/useCollator-DXoNI6C-.mjs +13 -0
- package/__chunks__/{useDialog-Dsqz1M_N.js → useDialog-DILXRLSs.js} +1 -1
- package/__chunks__/{useDialog-DAYxqkKY.mjs → useDialog-o0QWfg2a.mjs} +3 -3
- package/__chunks__/{useEdgeInterceptors-BCHFmpf_.js → useEdgeInterceptors-DfiAHAYW.js} +5 -5
- package/__chunks__/{useEdgeInterceptors-CVxwDmQ0.mjs → useEdgeInterceptors-wWqxCUZX.mjs} +5 -5
- package/__chunks__/{useFocus-DDj4i8Xy.mjs → useFocus-BEhCbr7O.mjs} +2 -2
- package/__chunks__/{useFocusRing-BE_dgxH5.mjs → useFocusRing-BUwbt1Yv.mjs} +3 -3
- package/__chunks__/{useFocusVisible-CXSIZSY_.mjs → useFocusVisible-8tH_I2iV.mjs} +1 -1
- package/__chunks__/{useFocusWithin-CDX8m0Wu.mjs → useFocusWithin-CfhMwfXS.mjs} +1 -1
- package/__chunks__/{useFocusable-DD5dAIXt.mjs → useFocusable-DoNt-Wd3.mjs} +2 -2
- package/__chunks__/{useFormValidation-gwcVryr8.mjs → useFormValidation-D5Y_7NR2.mjs} +25 -3
- package/__chunks__/{useFormValidation-C2DoIczP.js → useFormValidation-DYz5WFze.js} +22 -0
- package/__chunks__/{useHasTabbableChild-CRCY1COZ.mjs → useHasTabbableChild-DUcbkV37.mjs} +1 -1
- package/__chunks__/{useHighlightSelectionDescription-CsB-ufoX.js → useHighlightSelectionDescription-CT5XKTz0.js} +2 -2
- package/__chunks__/{useHighlightSelectionDescription-DnW5KkSs.mjs → useHighlightSelectionDescription-DWm7Wr6h.mjs} +3 -3
- package/__chunks__/{useLink-B__d3N9L.mjs → useLink-B_g4ae9e.mjs} +2 -2
- package/__chunks__/{useListState-CH1PXfc5.mjs → useListState-AFrlkW73.mjs} +1 -1
- package/__chunks__/{useLocalizedStringFormatter-B5ons_mh.mjs → useLocalizedStringFormatter-CLrYoOi9.mjs} +4 -1
- package/__chunks__/{useLocalizedStringFormatter-D74_5d4h.js → useLocalizedStringFormatter-CaF1VsOH.js} +3 -0
- package/__chunks__/{useOverlayPosition-B31NgShQ.mjs → useOverlayPosition-B_X4JGFp.mjs} +2 -2
- package/__chunks__/useOverlayTrigger-Do68TGFi.mjs +28 -0
- package/__chunks__/useOverlayTrigger-MyMg5wFE.js +27 -0
- package/__chunks__/{usePress-lFMUra6S.mjs → usePress-BAsZaqDB.mjs} +1 -1
- package/__chunks__/{useSelectableItem-BdD2_J2D.mjs → useSelectableItem-DL-4kc1g.mjs} +5 -5
- package/__chunks__/{useSelectableList-D0uxeze4.mjs → useSelectableList-BQ06AmlV.mjs} +4 -14
- package/__chunks__/{useSelectableList-DlkRkps4.js → useSelectableList-F8fB4Dtg.js} +2 -12
- package/__chunks__/{useSingleSelectListState-BuqfjUxj.mjs → useSingleSelectListState-DuCUY6dR.mjs} +1 -1
- package/__chunks__/{useToggle-b0GY9dCM.mjs → useToggle-CU6aSiOx.mjs} +2 -2
- package/__chunks__/{useTreeState-BZxhJy4m.mjs → useTreeState-w_raYfy2.mjs} +1 -1
- package/__chunks__/{useTriggerWidth-DEToHKD3.mjs → useTriggerWidth-DA668KiC.mjs} +6 -335
- package/__chunks__/{useTriggerWidth-C7OT3WI9.js → useTriggerWidth-ROE4ZhGv.js} +3 -332
- package/__chunks__/utilities-DKvHenAr.js +353 -0
- package/__chunks__/utilities-DmLL16up.mjs +354 -0
- package/package.json +1 -1
- package/style.css +1249 -1104
- package/__chunks__/InputIcon-BGgFAA4L.mjs +0 -168
- package/__chunks__/InputIcon-CUOJRoq8.js +0 -167
|
@@ -0,0 +1,227 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __defProps = Object.defineProperties;
|
|
4
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
5
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
8
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
9
|
+
var __spreadValues = (a, b) => {
|
|
10
|
+
for (var prop in b || (b = {}))
|
|
11
|
+
if (__hasOwnProp.call(b, prop))
|
|
12
|
+
__defNormalProp(a, prop, b[prop]);
|
|
13
|
+
if (__getOwnPropSymbols)
|
|
14
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
15
|
+
if (__propIsEnum.call(b, prop))
|
|
16
|
+
__defNormalProp(a, prop, b[prop]);
|
|
17
|
+
}
|
|
18
|
+
return a;
|
|
19
|
+
};
|
|
20
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
21
|
+
var __objRest = (source, exclude) => {
|
|
22
|
+
var target = {};
|
|
23
|
+
for (var prop in source)
|
|
24
|
+
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
25
|
+
target[prop] = source[prop];
|
|
26
|
+
if (source != null && __getOwnPropSymbols)
|
|
27
|
+
for (var prop of __getOwnPropSymbols(source)) {
|
|
28
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
29
|
+
target[prop] = source[prop];
|
|
30
|
+
}
|
|
31
|
+
return target;
|
|
32
|
+
};
|
|
33
|
+
const React = require("react");
|
|
34
|
+
const CalendarBase = require("./CalendarBase-saNix6u1.js");
|
|
35
|
+
const context = require("./context-D3NeXov7.js");
|
|
36
|
+
const useControlledState = require("./useControlledState-mnKBd6Uc.js");
|
|
37
|
+
const useEvent = require("./useEvent-DY7dR7Mi.js");
|
|
38
|
+
function $9a36b6ba2fb1a7c5$export$9a987164d97ecc90(props) {
|
|
39
|
+
let _a = props, { value: valueProp, defaultValue, onChange, createCalendar, locale, visibleDuration = {
|
|
40
|
+
months: 1
|
|
41
|
+
}, minValue, maxValue } = _a, calendarProps = __objRest(_a, ["value", "defaultValue", "onChange", "createCalendar", "locale", "visibleDuration", "minValue", "maxValue"]);
|
|
42
|
+
let [value, setValue] = useControlledState.$458b0a5536c1a7cf$export$40bfa8c7b0832715(valueProp, defaultValue || null, onChange);
|
|
43
|
+
let [anchorDate, setAnchorDateState] = React.useState(null);
|
|
44
|
+
let alignment = "center";
|
|
45
|
+
if (value && value.start && value.end) {
|
|
46
|
+
let start = CalendarBase.$f62d864046160412$export$f4a51ff076cc9a09(CalendarBase.$11d87f3f76e88657$export$93522d1a439f3617(value.start), visibleDuration, locale, minValue, maxValue);
|
|
47
|
+
let end = start.add(visibleDuration).subtract({
|
|
48
|
+
days: 1
|
|
49
|
+
});
|
|
50
|
+
if (value.end.compare(end) > 0) alignment = "start";
|
|
51
|
+
}
|
|
52
|
+
let availableRangeRef = React.useRef(null);
|
|
53
|
+
let [availableRange, setAvailableRange] = React.useState(null);
|
|
54
|
+
let min = React.useMemo(() => CalendarBase.$14e0f24ef4ac5c92$export$a75f2bff57811055(minValue, availableRange === null || availableRange === void 0 ? void 0 : availableRange.start), [
|
|
55
|
+
minValue,
|
|
56
|
+
availableRange
|
|
57
|
+
]);
|
|
58
|
+
let max = React.useMemo(() => CalendarBase.$14e0f24ef4ac5c92$export$5c333a116e949cdd(maxValue, availableRange === null || availableRange === void 0 ? void 0 : availableRange.end), [
|
|
59
|
+
maxValue,
|
|
60
|
+
availableRange
|
|
61
|
+
]);
|
|
62
|
+
let calendar = CalendarBase.$131cf43a05231e1e$export$6d095e787d2b5e1f(__spreadProps(__spreadValues({}, calendarProps), {
|
|
63
|
+
value: value && value.start,
|
|
64
|
+
createCalendar,
|
|
65
|
+
locale,
|
|
66
|
+
visibleDuration,
|
|
67
|
+
minValue: min,
|
|
68
|
+
maxValue: max,
|
|
69
|
+
selectionAlignment: alignment
|
|
70
|
+
}));
|
|
71
|
+
let updateAvailableRange = (date) => {
|
|
72
|
+
if (date && props.isDateUnavailable && !props.allowsNonContiguousRanges) {
|
|
73
|
+
const nextAvailableStartDate = $9a36b6ba2fb1a7c5$var$nextUnavailableDate(date, calendar, -1);
|
|
74
|
+
const nextAvailableEndDate = $9a36b6ba2fb1a7c5$var$nextUnavailableDate(date, calendar, 1);
|
|
75
|
+
availableRangeRef.current = {
|
|
76
|
+
start: nextAvailableStartDate,
|
|
77
|
+
end: nextAvailableEndDate
|
|
78
|
+
};
|
|
79
|
+
setAvailableRange(availableRangeRef.current);
|
|
80
|
+
} else {
|
|
81
|
+
availableRangeRef.current = null;
|
|
82
|
+
setAvailableRange(null);
|
|
83
|
+
}
|
|
84
|
+
};
|
|
85
|
+
let [lastVisibleRange, setLastVisibleRange] = React.useState(calendar.visibleRange);
|
|
86
|
+
if (!CalendarBase.$14e0f24ef4ac5c92$export$91b62ebf2ba703ee(calendar.visibleRange.start, lastVisibleRange.start) || !CalendarBase.$14e0f24ef4ac5c92$export$91b62ebf2ba703ee(calendar.visibleRange.end, lastVisibleRange.end)) {
|
|
87
|
+
updateAvailableRange(anchorDate);
|
|
88
|
+
setLastVisibleRange(calendar.visibleRange);
|
|
89
|
+
}
|
|
90
|
+
let setAnchorDate = (date) => {
|
|
91
|
+
if (date) {
|
|
92
|
+
setAnchorDateState(date);
|
|
93
|
+
updateAvailableRange(date);
|
|
94
|
+
} else {
|
|
95
|
+
setAnchorDateState(null);
|
|
96
|
+
updateAvailableRange(null);
|
|
97
|
+
}
|
|
98
|
+
};
|
|
99
|
+
let highlightedRange = anchorDate ? $9a36b6ba2fb1a7c5$var$makeRange(anchorDate, calendar.focusedDate) : value && $9a36b6ba2fb1a7c5$var$makeRange(value.start, value.end);
|
|
100
|
+
let selectDate = (date) => {
|
|
101
|
+
if (props.isReadOnly) return;
|
|
102
|
+
const constrainedDate = CalendarBase.$f62d864046160412$export$4f5203c0d889109e(date, min, max);
|
|
103
|
+
const previousAvailableConstrainedDate = CalendarBase.$f62d864046160412$export$a1d3911297b952d7(constrainedDate, calendar.visibleRange.start, props.isDateUnavailable);
|
|
104
|
+
if (!previousAvailableConstrainedDate) return;
|
|
105
|
+
if (!anchorDate) setAnchorDate(previousAvailableConstrainedDate);
|
|
106
|
+
else {
|
|
107
|
+
let range = $9a36b6ba2fb1a7c5$var$makeRange(anchorDate, previousAvailableConstrainedDate);
|
|
108
|
+
if (range) setValue({
|
|
109
|
+
start: $9a36b6ba2fb1a7c5$var$convertValue(range.start, value === null || value === void 0 ? void 0 : value.start),
|
|
110
|
+
end: $9a36b6ba2fb1a7c5$var$convertValue(range.end, value === null || value === void 0 ? void 0 : value.end)
|
|
111
|
+
});
|
|
112
|
+
setAnchorDate(null);
|
|
113
|
+
}
|
|
114
|
+
};
|
|
115
|
+
let [isDragging, setDragging] = React.useState(false);
|
|
116
|
+
let { isDateUnavailable } = props;
|
|
117
|
+
let isInvalidSelection = React.useMemo(() => {
|
|
118
|
+
if (!value || anchorDate) return false;
|
|
119
|
+
if (isDateUnavailable && (isDateUnavailable(value.start) || isDateUnavailable(value.end))) return true;
|
|
120
|
+
return CalendarBase.$f62d864046160412$export$eac50920cf2fd59a(value.start, minValue, maxValue) || CalendarBase.$f62d864046160412$export$eac50920cf2fd59a(value.end, minValue, maxValue);
|
|
121
|
+
}, [
|
|
122
|
+
isDateUnavailable,
|
|
123
|
+
value,
|
|
124
|
+
anchorDate,
|
|
125
|
+
minValue,
|
|
126
|
+
maxValue
|
|
127
|
+
]);
|
|
128
|
+
let isValueInvalid = props.isInvalid || props.validationState === "invalid" || isInvalidSelection;
|
|
129
|
+
let validationState = isValueInvalid ? "invalid" : null;
|
|
130
|
+
return __spreadProps(__spreadValues({}, calendar), {
|
|
131
|
+
value,
|
|
132
|
+
setValue,
|
|
133
|
+
anchorDate,
|
|
134
|
+
setAnchorDate,
|
|
135
|
+
highlightedRange,
|
|
136
|
+
validationState,
|
|
137
|
+
isValueInvalid,
|
|
138
|
+
selectFocusedDate() {
|
|
139
|
+
selectDate(calendar.focusedDate);
|
|
140
|
+
},
|
|
141
|
+
selectDate,
|
|
142
|
+
highlightDate(date) {
|
|
143
|
+
if (anchorDate) calendar.setFocusedDate(date);
|
|
144
|
+
},
|
|
145
|
+
isSelected(date) {
|
|
146
|
+
return Boolean(highlightedRange && date.compare(highlightedRange.start) >= 0 && date.compare(highlightedRange.end) <= 0 && !calendar.isCellDisabled(date) && !calendar.isCellUnavailable(date));
|
|
147
|
+
},
|
|
148
|
+
isInvalid(date) {
|
|
149
|
+
var _availableRangeRef_current, _availableRangeRef_current1;
|
|
150
|
+
return calendar.isInvalid(date) || CalendarBase.$f62d864046160412$export$eac50920cf2fd59a(date, (_availableRangeRef_current = availableRangeRef.current) === null || _availableRangeRef_current === void 0 ? void 0 : _availableRangeRef_current.start, (_availableRangeRef_current1 = availableRangeRef.current) === null || _availableRangeRef_current1 === void 0 ? void 0 : _availableRangeRef_current1.end);
|
|
151
|
+
},
|
|
152
|
+
isDragging,
|
|
153
|
+
setDragging
|
|
154
|
+
});
|
|
155
|
+
}
|
|
156
|
+
function $9a36b6ba2fb1a7c5$var$makeRange(start, end) {
|
|
157
|
+
if (!start || !end) return null;
|
|
158
|
+
if (end.compare(start) < 0) [start, end] = [
|
|
159
|
+
end,
|
|
160
|
+
start
|
|
161
|
+
];
|
|
162
|
+
return {
|
|
163
|
+
start: CalendarBase.$11d87f3f76e88657$export$93522d1a439f3617(start),
|
|
164
|
+
end: CalendarBase.$11d87f3f76e88657$export$93522d1a439f3617(end)
|
|
165
|
+
};
|
|
166
|
+
}
|
|
167
|
+
function $9a36b6ba2fb1a7c5$var$convertValue(newValue, oldValue) {
|
|
168
|
+
newValue = CalendarBase.$11d87f3f76e88657$export$b4a036af3fc0b032(newValue, (oldValue === null || oldValue === void 0 ? void 0 : oldValue.calendar) || new CalendarBase.$3b62074eb05584b2$export$80ee6245ec4f29ec());
|
|
169
|
+
if (oldValue && "hour" in oldValue) return oldValue.set(newValue);
|
|
170
|
+
return newValue;
|
|
171
|
+
}
|
|
172
|
+
function $9a36b6ba2fb1a7c5$var$nextUnavailableDate(anchorDate, state, dir) {
|
|
173
|
+
let nextDate = anchorDate.add({
|
|
174
|
+
days: dir
|
|
175
|
+
});
|
|
176
|
+
while ((dir < 0 ? nextDate.compare(state.visibleRange.start) >= 0 : nextDate.compare(state.visibleRange.end) <= 0) && !state.isCellUnavailable(nextDate)) nextDate = nextDate.add({
|
|
177
|
+
days: dir
|
|
178
|
+
});
|
|
179
|
+
if (state.isCellUnavailable(nextDate)) return nextDate.add({
|
|
180
|
+
days: -dir
|
|
181
|
+
});
|
|
182
|
+
}
|
|
183
|
+
function $46a4342aab3d8076$export$87e0539f600c24e5(props, state, ref) {
|
|
184
|
+
let res = CalendarBase.$c4acc1de3ab169cf$export$d652b3ea2d672d5b(props, state);
|
|
185
|
+
let isVirtualClick = React.useRef(false);
|
|
186
|
+
let windowRef = React.useRef(typeof window !== "undefined" ? window : null);
|
|
187
|
+
useEvent.$e9faafb641e167db$export$90fc3a17d93f704c(windowRef, "pointerdown", (e) => {
|
|
188
|
+
isVirtualClick.current = e.width === 0 && e.height === 0;
|
|
189
|
+
});
|
|
190
|
+
let endDragging = (e) => {
|
|
191
|
+
if (isVirtualClick.current) {
|
|
192
|
+
isVirtualClick.current = false;
|
|
193
|
+
return;
|
|
194
|
+
}
|
|
195
|
+
state.setDragging(false);
|
|
196
|
+
if (!state.anchorDate) return;
|
|
197
|
+
let target = e.target;
|
|
198
|
+
if (ref.current && ref.current.contains(document.activeElement) && (!ref.current.contains(target) || !target.closest('button, [role="button"]'))) state.selectFocusedDate();
|
|
199
|
+
};
|
|
200
|
+
useEvent.$e9faafb641e167db$export$90fc3a17d93f704c(windowRef, "pointerup", endDragging);
|
|
201
|
+
res.calendarProps.onBlur = (e) => {
|
|
202
|
+
if (!ref.current) return;
|
|
203
|
+
if ((!e.relatedTarget || !ref.current.contains(e.relatedTarget)) && state.anchorDate) state.selectFocusedDate();
|
|
204
|
+
};
|
|
205
|
+
useEvent.$e9faafb641e167db$export$90fc3a17d93f704c(ref, "touchmove", (e) => {
|
|
206
|
+
if (state.isDragging) e.preventDefault();
|
|
207
|
+
}, {
|
|
208
|
+
passive: false,
|
|
209
|
+
capture: true
|
|
210
|
+
});
|
|
211
|
+
return res;
|
|
212
|
+
}
|
|
213
|
+
function RangeCalendar(props) {
|
|
214
|
+
const { locale } = context.$18f2051aff69b9bf$export$43bb16f9c6d9e3f7();
|
|
215
|
+
const calendarRef = React.useRef(null);
|
|
216
|
+
const state = $9a36b6ba2fb1a7c5$export$9a987164d97ecc90(__spreadProps(__spreadValues({}, props), {
|
|
217
|
+
locale,
|
|
218
|
+
createCalendar: CalendarBase.$64244302c3013299$export$dd0bbc9b26defe37
|
|
219
|
+
}));
|
|
220
|
+
const rangeCalendarProps = $46a4342aab3d8076$export$87e0539f600c24e5(props, state, calendarRef);
|
|
221
|
+
return React.createElement(CalendarBase.CalendarBase, __spreadProps(__spreadValues(__spreadValues({}, props), rangeCalendarProps), {
|
|
222
|
+
state,
|
|
223
|
+
calendarRef
|
|
224
|
+
}));
|
|
225
|
+
}
|
|
226
|
+
RangeCalendar.displayName = "RangeCalendar";
|
|
227
|
+
exports.RangeCalendar = RangeCalendar;
|
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __defProps = Object.defineProperties;
|
|
3
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
7
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
+
var __spreadValues = (a, b) => {
|
|
9
|
+
for (var prop in b || (b = {}))
|
|
10
|
+
if (__hasOwnProp.call(b, prop))
|
|
11
|
+
__defNormalProp(a, prop, b[prop]);
|
|
12
|
+
if (__getOwnPropSymbols)
|
|
13
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
14
|
+
if (__propIsEnum.call(b, prop))
|
|
15
|
+
__defNormalProp(a, prop, b[prop]);
|
|
16
|
+
}
|
|
17
|
+
return a;
|
|
18
|
+
};
|
|
19
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
+
var __objRest = (source, exclude) => {
|
|
21
|
+
var target = {};
|
|
22
|
+
for (var prop in source)
|
|
23
|
+
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
24
|
+
target[prop] = source[prop];
|
|
25
|
+
if (source != null && __getOwnPropSymbols)
|
|
26
|
+
for (var prop of __getOwnPropSymbols(source)) {
|
|
27
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
28
|
+
target[prop] = source[prop];
|
|
29
|
+
}
|
|
30
|
+
return target;
|
|
31
|
+
};
|
|
32
|
+
import React__default, { useState, useRef, useMemo } from "react";
|
|
33
|
+
import { c as $f62d864046160412$export$f4a51ff076cc9a09, d as $11d87f3f76e88657$export$93522d1a439f3617, e as $14e0f24ef4ac5c92$export$a75f2bff57811055, f as $14e0f24ef4ac5c92$export$5c333a116e949cdd, a as $131cf43a05231e1e$export$6d095e787d2b5e1f, g as $14e0f24ef4ac5c92$export$91b62ebf2ba703ee, h as $f62d864046160412$export$eac50920cf2fd59a, i as $f62d864046160412$export$4f5203c0d889109e, j as $f62d864046160412$export$a1d3911297b952d7, k as $11d87f3f76e88657$export$b4a036af3fc0b032, l as $3b62074eb05584b2$export$80ee6245ec4f29ec, $ as $c4acc1de3ab169cf$export$d652b3ea2d672d5b, b as $64244302c3013299$export$dd0bbc9b26defe37, C as CalendarBase } from "./CalendarBase-4iGD1mPK.mjs";
|
|
34
|
+
import { $ as $18f2051aff69b9bf$export$43bb16f9c6d9e3f7 } from "./context-DEwqildc.mjs";
|
|
35
|
+
import { $ as $458b0a5536c1a7cf$export$40bfa8c7b0832715 } from "./useControlledState-CFWhSD5C.mjs";
|
|
36
|
+
import { $ as $e9faafb641e167db$export$90fc3a17d93f704c } from "./useEvent-C5RCZjKr.mjs";
|
|
37
|
+
function $9a36b6ba2fb1a7c5$export$9a987164d97ecc90(props) {
|
|
38
|
+
let _a = props, { value: valueProp, defaultValue, onChange, createCalendar, locale, visibleDuration = {
|
|
39
|
+
months: 1
|
|
40
|
+
}, minValue, maxValue } = _a, calendarProps = __objRest(_a, ["value", "defaultValue", "onChange", "createCalendar", "locale", "visibleDuration", "minValue", "maxValue"]);
|
|
41
|
+
let [value, setValue] = $458b0a5536c1a7cf$export$40bfa8c7b0832715(valueProp, defaultValue || null, onChange);
|
|
42
|
+
let [anchorDate, setAnchorDateState] = useState(null);
|
|
43
|
+
let alignment = "center";
|
|
44
|
+
if (value && value.start && value.end) {
|
|
45
|
+
let start = $f62d864046160412$export$f4a51ff076cc9a09($11d87f3f76e88657$export$93522d1a439f3617(value.start), visibleDuration, locale, minValue, maxValue);
|
|
46
|
+
let end = start.add(visibleDuration).subtract({
|
|
47
|
+
days: 1
|
|
48
|
+
});
|
|
49
|
+
if (value.end.compare(end) > 0) alignment = "start";
|
|
50
|
+
}
|
|
51
|
+
let availableRangeRef = useRef(null);
|
|
52
|
+
let [availableRange, setAvailableRange] = useState(null);
|
|
53
|
+
let min = useMemo(() => $14e0f24ef4ac5c92$export$a75f2bff57811055(minValue, availableRange === null || availableRange === void 0 ? void 0 : availableRange.start), [
|
|
54
|
+
minValue,
|
|
55
|
+
availableRange
|
|
56
|
+
]);
|
|
57
|
+
let max = useMemo(() => $14e0f24ef4ac5c92$export$5c333a116e949cdd(maxValue, availableRange === null || availableRange === void 0 ? void 0 : availableRange.end), [
|
|
58
|
+
maxValue,
|
|
59
|
+
availableRange
|
|
60
|
+
]);
|
|
61
|
+
let calendar = $131cf43a05231e1e$export$6d095e787d2b5e1f(__spreadProps(__spreadValues({}, calendarProps), {
|
|
62
|
+
value: value && value.start,
|
|
63
|
+
createCalendar,
|
|
64
|
+
locale,
|
|
65
|
+
visibleDuration,
|
|
66
|
+
minValue: min,
|
|
67
|
+
maxValue: max,
|
|
68
|
+
selectionAlignment: alignment
|
|
69
|
+
}));
|
|
70
|
+
let updateAvailableRange = (date) => {
|
|
71
|
+
if (date && props.isDateUnavailable && !props.allowsNonContiguousRanges) {
|
|
72
|
+
const nextAvailableStartDate = $9a36b6ba2fb1a7c5$var$nextUnavailableDate(date, calendar, -1);
|
|
73
|
+
const nextAvailableEndDate = $9a36b6ba2fb1a7c5$var$nextUnavailableDate(date, calendar, 1);
|
|
74
|
+
availableRangeRef.current = {
|
|
75
|
+
start: nextAvailableStartDate,
|
|
76
|
+
end: nextAvailableEndDate
|
|
77
|
+
};
|
|
78
|
+
setAvailableRange(availableRangeRef.current);
|
|
79
|
+
} else {
|
|
80
|
+
availableRangeRef.current = null;
|
|
81
|
+
setAvailableRange(null);
|
|
82
|
+
}
|
|
83
|
+
};
|
|
84
|
+
let [lastVisibleRange, setLastVisibleRange] = useState(calendar.visibleRange);
|
|
85
|
+
if (!$14e0f24ef4ac5c92$export$91b62ebf2ba703ee(calendar.visibleRange.start, lastVisibleRange.start) || !$14e0f24ef4ac5c92$export$91b62ebf2ba703ee(calendar.visibleRange.end, lastVisibleRange.end)) {
|
|
86
|
+
updateAvailableRange(anchorDate);
|
|
87
|
+
setLastVisibleRange(calendar.visibleRange);
|
|
88
|
+
}
|
|
89
|
+
let setAnchorDate = (date) => {
|
|
90
|
+
if (date) {
|
|
91
|
+
setAnchorDateState(date);
|
|
92
|
+
updateAvailableRange(date);
|
|
93
|
+
} else {
|
|
94
|
+
setAnchorDateState(null);
|
|
95
|
+
updateAvailableRange(null);
|
|
96
|
+
}
|
|
97
|
+
};
|
|
98
|
+
let highlightedRange = anchorDate ? $9a36b6ba2fb1a7c5$var$makeRange(anchorDate, calendar.focusedDate) : value && $9a36b6ba2fb1a7c5$var$makeRange(value.start, value.end);
|
|
99
|
+
let selectDate = (date) => {
|
|
100
|
+
if (props.isReadOnly) return;
|
|
101
|
+
const constrainedDate = $f62d864046160412$export$4f5203c0d889109e(date, min, max);
|
|
102
|
+
const previousAvailableConstrainedDate = $f62d864046160412$export$a1d3911297b952d7(constrainedDate, calendar.visibleRange.start, props.isDateUnavailable);
|
|
103
|
+
if (!previousAvailableConstrainedDate) return;
|
|
104
|
+
if (!anchorDate) setAnchorDate(previousAvailableConstrainedDate);
|
|
105
|
+
else {
|
|
106
|
+
let range = $9a36b6ba2fb1a7c5$var$makeRange(anchorDate, previousAvailableConstrainedDate);
|
|
107
|
+
if (range) setValue({
|
|
108
|
+
start: $9a36b6ba2fb1a7c5$var$convertValue(range.start, value === null || value === void 0 ? void 0 : value.start),
|
|
109
|
+
end: $9a36b6ba2fb1a7c5$var$convertValue(range.end, value === null || value === void 0 ? void 0 : value.end)
|
|
110
|
+
});
|
|
111
|
+
setAnchorDate(null);
|
|
112
|
+
}
|
|
113
|
+
};
|
|
114
|
+
let [isDragging, setDragging] = useState(false);
|
|
115
|
+
let { isDateUnavailable } = props;
|
|
116
|
+
let isInvalidSelection = useMemo(() => {
|
|
117
|
+
if (!value || anchorDate) return false;
|
|
118
|
+
if (isDateUnavailable && (isDateUnavailable(value.start) || isDateUnavailable(value.end))) return true;
|
|
119
|
+
return $f62d864046160412$export$eac50920cf2fd59a(value.start, minValue, maxValue) || $f62d864046160412$export$eac50920cf2fd59a(value.end, minValue, maxValue);
|
|
120
|
+
}, [
|
|
121
|
+
isDateUnavailable,
|
|
122
|
+
value,
|
|
123
|
+
anchorDate,
|
|
124
|
+
minValue,
|
|
125
|
+
maxValue
|
|
126
|
+
]);
|
|
127
|
+
let isValueInvalid = props.isInvalid || props.validationState === "invalid" || isInvalidSelection;
|
|
128
|
+
let validationState = isValueInvalid ? "invalid" : null;
|
|
129
|
+
return __spreadProps(__spreadValues({}, calendar), {
|
|
130
|
+
value,
|
|
131
|
+
setValue,
|
|
132
|
+
anchorDate,
|
|
133
|
+
setAnchorDate,
|
|
134
|
+
highlightedRange,
|
|
135
|
+
validationState,
|
|
136
|
+
isValueInvalid,
|
|
137
|
+
selectFocusedDate() {
|
|
138
|
+
selectDate(calendar.focusedDate);
|
|
139
|
+
},
|
|
140
|
+
selectDate,
|
|
141
|
+
highlightDate(date) {
|
|
142
|
+
if (anchorDate) calendar.setFocusedDate(date);
|
|
143
|
+
},
|
|
144
|
+
isSelected(date) {
|
|
145
|
+
return Boolean(highlightedRange && date.compare(highlightedRange.start) >= 0 && date.compare(highlightedRange.end) <= 0 && !calendar.isCellDisabled(date) && !calendar.isCellUnavailable(date));
|
|
146
|
+
},
|
|
147
|
+
isInvalid(date) {
|
|
148
|
+
var _availableRangeRef_current, _availableRangeRef_current1;
|
|
149
|
+
return calendar.isInvalid(date) || $f62d864046160412$export$eac50920cf2fd59a(date, (_availableRangeRef_current = availableRangeRef.current) === null || _availableRangeRef_current === void 0 ? void 0 : _availableRangeRef_current.start, (_availableRangeRef_current1 = availableRangeRef.current) === null || _availableRangeRef_current1 === void 0 ? void 0 : _availableRangeRef_current1.end);
|
|
150
|
+
},
|
|
151
|
+
isDragging,
|
|
152
|
+
setDragging
|
|
153
|
+
});
|
|
154
|
+
}
|
|
155
|
+
function $9a36b6ba2fb1a7c5$var$makeRange(start, end) {
|
|
156
|
+
if (!start || !end) return null;
|
|
157
|
+
if (end.compare(start) < 0) [start, end] = [
|
|
158
|
+
end,
|
|
159
|
+
start
|
|
160
|
+
];
|
|
161
|
+
return {
|
|
162
|
+
start: $11d87f3f76e88657$export$93522d1a439f3617(start),
|
|
163
|
+
end: $11d87f3f76e88657$export$93522d1a439f3617(end)
|
|
164
|
+
};
|
|
165
|
+
}
|
|
166
|
+
function $9a36b6ba2fb1a7c5$var$convertValue(newValue, oldValue) {
|
|
167
|
+
newValue = $11d87f3f76e88657$export$b4a036af3fc0b032(newValue, (oldValue === null || oldValue === void 0 ? void 0 : oldValue.calendar) || new $3b62074eb05584b2$export$80ee6245ec4f29ec());
|
|
168
|
+
if (oldValue && "hour" in oldValue) return oldValue.set(newValue);
|
|
169
|
+
return newValue;
|
|
170
|
+
}
|
|
171
|
+
function $9a36b6ba2fb1a7c5$var$nextUnavailableDate(anchorDate, state, dir) {
|
|
172
|
+
let nextDate = anchorDate.add({
|
|
173
|
+
days: dir
|
|
174
|
+
});
|
|
175
|
+
while ((dir < 0 ? nextDate.compare(state.visibleRange.start) >= 0 : nextDate.compare(state.visibleRange.end) <= 0) && !state.isCellUnavailable(nextDate)) nextDate = nextDate.add({
|
|
176
|
+
days: dir
|
|
177
|
+
});
|
|
178
|
+
if (state.isCellUnavailable(nextDate)) return nextDate.add({
|
|
179
|
+
days: -dir
|
|
180
|
+
});
|
|
181
|
+
}
|
|
182
|
+
function $46a4342aab3d8076$export$87e0539f600c24e5(props, state, ref) {
|
|
183
|
+
let res = $c4acc1de3ab169cf$export$d652b3ea2d672d5b(props, state);
|
|
184
|
+
let isVirtualClick = useRef(false);
|
|
185
|
+
let windowRef = useRef(typeof window !== "undefined" ? window : null);
|
|
186
|
+
$e9faafb641e167db$export$90fc3a17d93f704c(windowRef, "pointerdown", (e) => {
|
|
187
|
+
isVirtualClick.current = e.width === 0 && e.height === 0;
|
|
188
|
+
});
|
|
189
|
+
let endDragging = (e) => {
|
|
190
|
+
if (isVirtualClick.current) {
|
|
191
|
+
isVirtualClick.current = false;
|
|
192
|
+
return;
|
|
193
|
+
}
|
|
194
|
+
state.setDragging(false);
|
|
195
|
+
if (!state.anchorDate) return;
|
|
196
|
+
let target = e.target;
|
|
197
|
+
if (ref.current && ref.current.contains(document.activeElement) && (!ref.current.contains(target) || !target.closest('button, [role="button"]'))) state.selectFocusedDate();
|
|
198
|
+
};
|
|
199
|
+
$e9faafb641e167db$export$90fc3a17d93f704c(windowRef, "pointerup", endDragging);
|
|
200
|
+
res.calendarProps.onBlur = (e) => {
|
|
201
|
+
if (!ref.current) return;
|
|
202
|
+
if ((!e.relatedTarget || !ref.current.contains(e.relatedTarget)) && state.anchorDate) state.selectFocusedDate();
|
|
203
|
+
};
|
|
204
|
+
$e9faafb641e167db$export$90fc3a17d93f704c(ref, "touchmove", (e) => {
|
|
205
|
+
if (state.isDragging) e.preventDefault();
|
|
206
|
+
}, {
|
|
207
|
+
passive: false,
|
|
208
|
+
capture: true
|
|
209
|
+
});
|
|
210
|
+
return res;
|
|
211
|
+
}
|
|
212
|
+
function RangeCalendar(props) {
|
|
213
|
+
const { locale } = $18f2051aff69b9bf$export$43bb16f9c6d9e3f7();
|
|
214
|
+
const calendarRef = React__default.useRef(null);
|
|
215
|
+
const state = $9a36b6ba2fb1a7c5$export$9a987164d97ecc90(__spreadProps(__spreadValues({}, props), {
|
|
216
|
+
locale,
|
|
217
|
+
createCalendar: $64244302c3013299$export$dd0bbc9b26defe37
|
|
218
|
+
}));
|
|
219
|
+
const rangeCalendarProps = $46a4342aab3d8076$export$87e0539f600c24e5(props, state, calendarRef);
|
|
220
|
+
return React__default.createElement(CalendarBase, __spreadProps(__spreadValues(__spreadValues({}, props), rangeCalendarProps), {
|
|
221
|
+
state,
|
|
222
|
+
calendarRef
|
|
223
|
+
}));
|
|
224
|
+
}
|
|
225
|
+
RangeCalendar.displayName = "RangeCalendar";
|
|
226
|
+
export {
|
|
227
|
+
RangeCalendar as R
|
|
228
|
+
};
|
|
@@ -18,24 +18,26 @@ var __spreadValues = (a, b) => {
|
|
|
18
18
|
return a;
|
|
19
19
|
};
|
|
20
20
|
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
21
|
-
const useFormValidation = require("./useFormValidation-
|
|
21
|
+
const useFormValidation = require("./useFormValidation-DYz5WFze.js");
|
|
22
22
|
const Overlay = require("./Overlay-ZinDp2HW.js");
|
|
23
23
|
const useSingleSelectListState = require("./useSingleSelectListState-5RB1w9vv.js");
|
|
24
24
|
const React = require("react");
|
|
25
25
|
const mergeProps = require("./mergeProps-DniMwM6P.js");
|
|
26
26
|
const filterDOMProps = require("./filterDOMProps-D3iOHP0H.js");
|
|
27
|
-
const useSelectableList = require("./useSelectableList-
|
|
27
|
+
const useSelectableList = require("./useSelectableList-F8fB4Dtg.js");
|
|
28
28
|
const useSelectableItem = require("./useSelectableItem-BGvBbIwY.js");
|
|
29
29
|
const useFocusVisible = require("./useFocusVisible-PBQuklI8.js");
|
|
30
|
+
const useCollator = require("./useCollator-DGrSWVh4.js");
|
|
30
31
|
const useField = require("./useField-BJW_bXVD.js");
|
|
31
|
-
const useTriggerWidth = require("./useTriggerWidth-
|
|
32
|
+
const useTriggerWidth = require("./useTriggerWidth-ROE4ZhGv.js");
|
|
32
33
|
const useFormReset = require("./useFormReset-Bgj93eR3.js");
|
|
33
34
|
const VisuallyHidden = require("./VisuallyHidden-CVfjb1YY.js");
|
|
34
|
-
const Text = require("./Text-
|
|
35
|
+
const Text = require("./Text-Dfbyoxsz.js");
|
|
35
36
|
const Item = require("./Item-CfWjPrxx.js");
|
|
36
37
|
const usePress = require("./usePress-Dz8YYpge.js");
|
|
37
38
|
const isVirtualEvent = require("./isVirtualEvent-DwoP1rNI.js");
|
|
38
39
|
const useHover = require("./useHover-BIKwjrCT.js");
|
|
40
|
+
const utilities = require("./utilities-DKvHenAr.js");
|
|
39
41
|
const utilities_useScrollbar = require("../utilities/useScrollbar.js");
|
|
40
42
|
const useFocusWithin = require("./useFocusWithin-C1ioGWec.js");
|
|
41
43
|
const useLabel = require("./useLabel-t-N6anB8.js");
|
|
@@ -231,7 +233,7 @@ function $af383d3bef1cfdc9$export$c3f9f39876e4bc7(props) {
|
|
|
231
233
|
const $58aed456727eb0f3$export$703601b7e90536f8 = /* @__PURE__ */ new WeakMap();
|
|
232
234
|
function $58aed456727eb0f3$export$e64b2f635402ca43(props, state, ref) {
|
|
233
235
|
let { keyboardDelegate, isDisabled, isRequired, name, validationBehavior = "aria" } = props;
|
|
234
|
-
let collator =
|
|
236
|
+
let collator = useCollator.$325a3faab7a68acd$export$a16aca283550c30d({
|
|
235
237
|
usage: "search",
|
|
236
238
|
sensitivity: "base"
|
|
237
239
|
});
|
|
@@ -423,24 +425,24 @@ function useInternalSelectContext() {
|
|
|
423
425
|
}
|
|
424
426
|
return selectContext;
|
|
425
427
|
}
|
|
426
|
-
const underlay = "
|
|
427
|
-
const listboxRoot = "
|
|
428
|
-
const listbox = "
|
|
429
|
-
const listboxList = "
|
|
430
|
-
const sectionList = "
|
|
431
|
-
const optionContent = "
|
|
432
|
-
const separator = "
|
|
433
|
-
const option = "
|
|
434
|
-
const fieldRoot = "
|
|
435
|
-
const selectField = "
|
|
436
|
-
const selectSizeSm = "
|
|
437
|
-
const selectSizeLg = "
|
|
438
|
-
const selectFieldError = "
|
|
439
|
-
const selectFieldIconStart = "
|
|
440
|
-
const selectFieldIconEnd = "
|
|
441
|
-
const selectFieldIconContainer = "
|
|
442
|
-
const selectFieldText = "
|
|
443
|
-
const listboxOpen = "
|
|
428
|
+
const underlay = "_underlay_173y3_5";
|
|
429
|
+
const listboxRoot = "_listboxRoot_173y3_10";
|
|
430
|
+
const listbox = "_listbox_173y3_10";
|
|
431
|
+
const listboxList = "_listboxList_173y3_79";
|
|
432
|
+
const sectionList = "_sectionList_173y3_80";
|
|
433
|
+
const optionContent = "_optionContent_173y3_86";
|
|
434
|
+
const separator = "_separator_173y3_87";
|
|
435
|
+
const option = "_option_173y3_86";
|
|
436
|
+
const fieldRoot = "_fieldRoot_173y3_130";
|
|
437
|
+
const selectField = "_selectField_173y3_151";
|
|
438
|
+
const selectSizeSm = "_selectSizeSm_173y3_188";
|
|
439
|
+
const selectSizeLg = "_selectSizeLg_173y3_200";
|
|
440
|
+
const selectFieldError = "_selectFieldError_173y3_206";
|
|
441
|
+
const selectFieldIconStart = "_selectFieldIconStart_173y3_214";
|
|
442
|
+
const selectFieldIconEnd = "_selectFieldIconEnd_173y3_218";
|
|
443
|
+
const selectFieldIconContainer = "_selectFieldIconContainer_173y3_222";
|
|
444
|
+
const selectFieldText = "_selectFieldText_173y3_228";
|
|
445
|
+
const listboxOpen = "_listboxOpen_173y3_232";
|
|
444
446
|
const styles = {
|
|
445
447
|
underlay,
|
|
446
448
|
listboxRoot,
|
|
@@ -517,18 +519,18 @@ function SelectOverlayContent() {
|
|
|
517
519
|
const { selectState, triggerRef, listBoxPropsFromSelect, triggerWidth } = useInternalSelectContext();
|
|
518
520
|
const popoverRef = React.useRef(null);
|
|
519
521
|
const listBoxRef = React.useRef(null);
|
|
520
|
-
const { popoverProps, underlayProps } =
|
|
521
|
-
containerPadding:
|
|
522
|
-
maxHeight:
|
|
523
|
-
offset:
|
|
524
|
-
placement:
|
|
522
|
+
const { popoverProps, underlayProps } = utilities.$f2f8a6077418541e$export$542a6fd13ac93354({
|
|
523
|
+
containerPadding: utilities.OVERLAY_PADDING_FROM_CONTAINER,
|
|
524
|
+
maxHeight: utilities.ITEM_HEIGHT * utilities.DEFAULT_MAX_ITEMS_UNTIL_SCROLL + utilities.Y_PADDING_INSIDE_OVERLAY * 2 + 2,
|
|
525
|
+
offset: utilities.OVERLAY_OFFSET,
|
|
526
|
+
placement: utilities.DEFAULT_PLACEMENT,
|
|
525
527
|
popoverRef,
|
|
526
528
|
scrollRef: listBoxRef,
|
|
527
529
|
triggerRef
|
|
528
530
|
}, selectState);
|
|
529
531
|
const { listBoxProps } = $c132121280ec012d$export$50eacbbf140a3141(listBoxPropsFromSelect, selectState, listBoxRef);
|
|
530
532
|
utilities_useScrollbar.useScrollbar(listBoxRef, "ezui-os-theme-overlay");
|
|
531
|
-
const style = __spreadValues(__spreadValues({}, popoverProps.style),
|
|
533
|
+
const style = __spreadValues(__spreadValues({}, popoverProps.style), utilities.getUnmergedPopoverStyles(utilities.DEFAULT_WIDTH, triggerWidth));
|
|
532
534
|
return React.createElement(Overlay.$337b884510726a0d$export$c6fdb837b070b4ff, null, React.createElement("div", __spreadProps(__spreadValues({}, underlayProps), {
|
|
533
535
|
className: styles.underlay
|
|
534
536
|
})), React.createElement("div", __spreadProps(__spreadValues({}, mergeProps.$3ef42575df84b30b$export$9d1611c77c2fe928(popoverProps, {
|
|
@@ -536,13 +538,13 @@ function SelectOverlayContent() {
|
|
|
536
538
|
})), {
|
|
537
539
|
ref: popoverRef,
|
|
538
540
|
className: styles.listboxRoot
|
|
539
|
-
}), React.createElement(
|
|
541
|
+
}), React.createElement(utilities.$86ea4cb521eb2e37$export$2317d149ed6f78c4, {
|
|
540
542
|
onDismiss: selectState.close
|
|
541
543
|
}), React.createElement("div", __spreadProps(__spreadValues({}, listBoxProps), {
|
|
542
544
|
ref: listBoxRef,
|
|
543
545
|
className: styles.listbox,
|
|
544
|
-
"data-width":
|
|
545
|
-
"data-max-items-until-scroll":
|
|
546
|
+
"data-width": utilities.DEFAULT_WIDTH,
|
|
547
|
+
"data-max-items-until-scroll": utilities.DEFAULT_MAX_ITEMS_UNTIL_SCROLL,
|
|
546
548
|
"data-overlayscrollbars-initialize": true
|
|
547
549
|
}), React.createElement("ul", {
|
|
548
550
|
className: styles.listboxList
|
|
@@ -556,7 +558,7 @@ function SelectOverlayContent() {
|
|
|
556
558
|
item,
|
|
557
559
|
state: selectState
|
|
558
560
|
});
|
|
559
|
-
}))), React.createElement(
|
|
561
|
+
}))), React.createElement(utilities.$86ea4cb521eb2e37$export$2317d149ed6f78c4, {
|
|
560
562
|
onDismiss: selectState.close
|
|
561
563
|
})));
|
|
562
564
|
}
|