@povio/ui 3.1.0 → 3.2.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/assets/icons/AlignCenter.js +26 -11
- package/dist/assets/icons/AlignLeft.js +26 -11
- package/dist/assets/icons/AlignLeftRight.js +26 -11
- package/dist/assets/icons/AlignRight.js +26 -11
- package/dist/assets/icons/ArrowDropDown.js +26 -11
- package/dist/assets/icons/ArrowDropUp.js +26 -11
- package/dist/assets/icons/ArrowLeft.js +26 -11
- package/dist/assets/icons/ArrowRight.js +26 -11
- package/dist/assets/icons/Bold.js +26 -11
- package/dist/assets/icons/BulletedList.js +26 -11
- package/dist/assets/icons/Calendar.js +28 -13
- package/dist/assets/icons/Check.js +28 -13
- package/dist/assets/icons/CheckCircle.js +26 -11
- package/dist/assets/icons/CheckboxCheckmark.js +29 -14
- package/dist/assets/icons/CheckboxIndeterminate.js +29 -14
- package/dist/assets/icons/ChevronDown.js +28 -13
- package/dist/assets/icons/ChevronLeft.js +28 -13
- package/dist/assets/icons/ChevronRight.js +28 -13
- package/dist/assets/icons/ChevronUp.js +28 -13
- package/dist/assets/icons/ChevronsLeft.js +28 -13
- package/dist/assets/icons/ChevronsRight.js +28 -13
- package/dist/assets/icons/Clock.js +26 -11
- package/dist/assets/icons/Close.js +26 -11
- package/dist/assets/icons/DateTime.js +35 -14
- package/dist/assets/icons/DragIndicator.js +26 -11
- package/dist/assets/icons/File.js +28 -13
- package/dist/assets/icons/Highlight.js +26 -11
- package/dist/assets/icons/HighlightOn.js +49 -15
- package/dist/assets/icons/Home.js +26 -11
- package/dist/assets/icons/Info.js +37 -16
- package/dist/assets/icons/Italic.js +26 -11
- package/dist/assets/icons/Link.js +26 -11
- package/dist/assets/icons/Menu.js +26 -11
- package/dist/assets/icons/NumberedList.js +26 -11
- package/dist/assets/icons/PointerHorizontal.js +26 -11
- package/dist/assets/icons/PointerVertical.js +26 -11
- package/dist/assets/icons/Search.js +26 -11
- package/dist/assets/icons/Send.js +28 -13
- package/dist/assets/icons/Strikethrough.js +26 -11
- package/dist/assets/icons/TextColor.js +48 -14
- package/dist/assets/icons/Today.js +26 -11
- package/dist/assets/icons/Underlined.js +28 -13
- package/dist/assets/icons/Upload.js +35 -14
- package/dist/assets/icons/Visibility.js +26 -11
- package/dist/assets/icons/VisibilityOff.js +26 -11
- package/dist/assets/icons/WarningFilled.js +28 -13
- package/dist/components/Breadcrumbs/Breadcrumbs.js +207 -56
- package/dist/components/Menu/Menu.js +18 -2
- package/dist/components/Menu/MenuDesktop.js +41 -7
- package/dist/components/Menu/MenuItem.js +32 -9
- package/dist/components/Menu/MenuMobile.js +102 -39
- package/dist/components/Menu/MenuPopover.js +105 -29
- package/dist/components/buttons/Button/button.cva.d.ts +3 -3
- package/dist/components/buttons/IconButton/IconButton.js +40 -8
- package/dist/components/buttons/InlineIconButton/InlineIconButton.d.ts +2 -1
- package/dist/components/buttons/InlineIconButton/InlineIconButton.js +34 -9
- package/dist/components/buttons/PillButton/PillButton.js +55 -17
- package/dist/components/buttons/PillButton/pillButton.cva.d.ts +1 -1
- package/dist/components/buttons/SplitButton/SplitButton.js +103 -18
- package/dist/components/buttons/TextButton/TextButton.js +30 -8
- package/dist/components/buttons/ToggleButton/ToggleButton.js +28 -8
- package/dist/components/buttons/shared/ButtonContent.js +80 -22
- package/dist/components/inputs/Checkbox/Checkbox.d.ts +1 -0
- package/dist/components/inputs/Checkbox/Checkbox.js +201 -35
- package/dist/components/inputs/Checkbox/CheckboxCheckmark.js +24 -10
- package/dist/components/inputs/Checkbox/checkbox.cva.d.ts +3 -0
- package/dist/components/inputs/Checkbox/checkbox.cva.js +2 -1
- package/dist/components/inputs/DateTime/DatePicker/DatePicker.d.ts +12 -5
- package/dist/components/inputs/DateTime/DatePicker/DatePicker.js +380 -75
- package/dist/components/inputs/DateTime/DateRangePicker/DateRangePicker.d.ts +12 -5
- package/dist/components/inputs/DateTime/DateRangePicker/DateRangePicker.js +499 -186
- package/dist/components/inputs/DateTime/DateTimePicker/DateTimePicker.d.ts +14 -5
- package/dist/components/inputs/DateTime/DateTimePicker/DateTimePicker.js +280 -46
- package/dist/components/inputs/DateTime/TimePicker/TimePicker.d.ts +7 -3
- package/dist/components/inputs/DateTime/TimePicker/TimePicker.js +616 -121
- package/dist/components/inputs/DateTime/shared/Calendar.d.ts +5 -2
- package/dist/components/inputs/DateTime/shared/Calendar.js +342 -119
- package/dist/components/inputs/DateTime/shared/CalendarCell.d.ts +4 -2
- package/dist/components/inputs/DateTime/shared/CalendarCell.js +310 -103
- package/dist/components/inputs/DateTime/shared/CalendarGrid.d.ts +4 -2
- package/dist/components/inputs/DateTime/shared/CalendarGrid.js +150 -33
- package/dist/components/inputs/DateTime/shared/CalendarHeader.js +233 -98
- package/dist/components/inputs/DateTime/shared/CalendarSelectHeader.js +318 -137
- package/dist/components/inputs/DateTime/shared/DateField.d.ts +2 -1
- package/dist/components/inputs/DateTime/shared/DateField.js +288 -112
- package/dist/components/inputs/DateTime/shared/DatePickerInput.d.ts +14 -3
- package/dist/components/inputs/DateTime/shared/DatePickerInput.js +359 -129
- package/dist/components/inputs/DateTime/shared/DateSegmentItem.d.ts +18 -1
- package/dist/components/inputs/DateTime/shared/DateSegmentItem.js +104 -11
- package/dist/components/inputs/DateTime/shared/DateTimeDialog.js +83 -28
- package/dist/components/inputs/DateTime/shared/DateTimeDialogFooter.js +59 -10
- package/dist/components/inputs/DateTime/shared/MonthPicker.js +103 -58
- package/dist/components/inputs/DateTime/shared/RangeCalendar.js +193 -82
- package/dist/components/inputs/DateTime/shared/TimeField.js +27 -8
- package/dist/components/inputs/DateTime/shared/TimePickerForm.js +279 -110
- package/dist/components/inputs/DateTime/shared/TimePickerInput.d.ts +4 -1
- package/dist/components/inputs/DateTime/shared/TimePickerInput.js +211 -65
- package/dist/components/inputs/DateTime/shared/YearPicker.js +119 -68
- package/dist/components/inputs/DateTime/shared/datePicker.types.d.ts +5 -0
- package/dist/components/inputs/DateTime/shared/datePickerInput.cva.d.ts +16 -0
- package/dist/components/inputs/DateTime/shared/datePickerInput.cva.js +16 -0
- package/dist/components/inputs/DateTime/shared/datePickerTodayIcon.d.ts +15 -0
- package/dist/components/inputs/DateTime/shared/datePickerTodayIcon.js +32 -0
- package/dist/components/inputs/DateTime/shared/dateSegment.utils.d.ts +2 -0
- package/dist/components/inputs/DateTime/shared/dateSegment.utils.spec.d.ts +1 -0
- package/dist/components/inputs/DateTime/shared/staticDateTimeSegments.d.ts +41 -0
- package/dist/components/inputs/DateTime/shared/staticDateTimeSegments.js +99 -0
- package/dist/components/inputs/DateTime/shared/staticDateTimeSegments.spec.d.ts +1 -0
- package/dist/components/inputs/File/FileUpload.js +91 -46
- package/dist/components/inputs/File/FileUploadContainer.js +15 -7
- package/dist/components/inputs/File/InputUpload.js +317 -79
- package/dist/components/inputs/File/index.d.ts +1 -1
- package/dist/components/inputs/File/shared/FileCard.js +104 -41
- package/dist/components/inputs/File/shared/FileCardList.js +47 -12
- package/dist/components/inputs/File/shared/FileUploadContent.js +175 -44
- package/dist/components/inputs/File/shared/FileUploadContentEmpty.js +149 -46
- package/dist/components/inputs/File/shared/FileUploadContentError.js +234 -93
- package/dist/components/inputs/File/shared/FileUploadContentFilled.js +230 -97
- package/dist/components/inputs/File/shared/FileUploadContentLoading.js +199 -55
- package/dist/components/inputs/File/shared/InputUploadContent.js +148 -34
- package/dist/components/inputs/File/shared/InputUploadFilled.js +49 -8
- package/dist/components/inputs/File/shared/ProgressBar.js +102 -15
- package/dist/components/inputs/File/shared/fileUpload.cva.d.ts +0 -11
- package/dist/components/inputs/File/shared/fileUpload.cva.js +1 -18
- package/dist/components/inputs/FormField/FormField.d.ts +3 -3
- package/dist/components/inputs/FormField/FormField.js +119 -37
- package/dist/components/inputs/FormField/FormFieldError.js +25 -5
- package/dist/components/inputs/FormField/FormFieldHeader.d.ts +2 -2
- package/dist/components/inputs/FormField/FormFieldHeader.js +81 -22
- package/dist/components/inputs/FormField/FormFieldHeaderClose.js +31 -7
- package/dist/components/inputs/FormField/FormFieldHelper.js +26 -6
- package/dist/components/inputs/FormField/FormFieldLabel.d.ts +2 -2
- package/dist/components/inputs/FormField/FormFieldLabel.js +40 -9
- package/dist/components/inputs/FormField/formFieldHeader.cva.d.ts +13 -0
- package/dist/components/inputs/FormField/formFieldHeader.cva.js +14 -0
- package/dist/components/inputs/Input/NumberInput/NumberInput.d.ts +5 -2
- package/dist/components/inputs/Input/NumberInput/NumberInput.js +446 -97
- package/dist/components/inputs/Input/NumberRangeInput/NumberRangeField.d.ts +45 -0
- package/dist/components/inputs/Input/NumberRangeInput/NumberRangeField.js +571 -0
- package/dist/components/inputs/Input/NumberRangeInput/NumberRangeInput.d.ts +35 -0
- package/dist/components/inputs/Input/NumberRangeInput/NumberRangeInput.js +574 -0
- package/dist/components/inputs/Input/PasswordInput/PasswordInput.js +48 -9
- package/dist/components/inputs/Input/TextArea/TextArea.cva.d.ts +8 -0
- package/dist/components/inputs/Input/TextArea/TextArea.cva.js +5 -0
- package/dist/components/inputs/Input/TextArea/TextArea.js +305 -90
- package/dist/components/inputs/Input/TextInput/TextInput.d.ts +3 -1
- package/dist/components/inputs/Input/TextInput/TextInput.js +429 -90
- package/dist/components/inputs/Input/shared/InputContent.js +193 -59
- package/dist/components/inputs/Input/shared/numberStatic.utils.d.ts +1 -0
- package/dist/components/inputs/Input/shared/numberStatic.utils.js +7 -0
- package/dist/components/inputs/Inputs/Form.js +40 -11
- package/dist/components/inputs/Inputs/InputItem.d.ts +15 -21
- package/dist/components/inputs/Inputs/InputItem.js +69 -14
- package/dist/components/inputs/Inputs/Inputs.js +37 -11
- package/dist/components/inputs/RadioGroup/RadioGroup.d.ts +3 -1
- package/dist/components/inputs/RadioGroup/RadioGroup.js +353 -61
- package/dist/components/inputs/RadioGroup/radio.cva.d.ts +45 -0
- package/dist/components/inputs/RadioGroup/radio.cva.js +48 -1
- package/dist/components/inputs/Selection/Autocomplete/Autocomplete.d.ts +6 -2
- package/dist/components/inputs/Selection/Autocomplete/Autocomplete.js +217 -22
- package/dist/components/inputs/Selection/Autocomplete/QueryAutocomplete.d.ts +3 -18
- package/dist/components/inputs/Selection/Autocomplete/QueryAutocomplete.js +107 -8
- package/dist/components/inputs/Selection/Autocomplete/queryAutocomplete.types.d.ts +37 -0
- package/dist/components/inputs/Selection/Select/QuerySelect.d.ts +14 -0
- package/dist/components/inputs/Selection/Select/QuerySelect.js +178 -0
- package/dist/components/inputs/Selection/Select/Select.d.ts +7 -3
- package/dist/components/inputs/Selection/Select/Select.js +227 -18
- package/dist/components/inputs/Selection/shared/SelectBase.d.ts +8 -1
- package/dist/components/inputs/Selection/shared/SelectBase.js +69 -18
- package/dist/components/inputs/Selection/shared/SelectDesktop.d.ts +1 -1
- package/dist/components/inputs/Selection/shared/SelectDesktop.js +393 -138
- package/dist/components/inputs/Selection/shared/SelectInput.d.ts +2 -2
- package/dist/components/inputs/Selection/shared/SelectInput.js +397 -116
- package/dist/components/inputs/Selection/shared/SelectInputTags.js +99 -25
- package/dist/components/inputs/Selection/shared/SelectListBox.d.ts +2 -2
- package/dist/components/inputs/Selection/shared/SelectListBox.js +164 -52
- package/dist/components/inputs/Selection/shared/SelectListBoxItem.js +85 -35
- package/dist/components/inputs/Selection/shared/SelectListBoxItemSelectAll.js +69 -16
- package/dist/components/inputs/Selection/shared/SelectListBoxLoadingItem.js +70 -21
- package/dist/components/inputs/Selection/shared/SelectListBoxSelectionBar.js +58 -9
- package/dist/components/inputs/Selection/shared/SelectMobile.d.ts +1 -1
- package/dist/components/inputs/Selection/shared/SelectMobile.js +9 -3
- package/dist/components/inputs/Selection/shared/StaticSelectTrailingContent.d.ts +9 -0
- package/dist/components/inputs/Selection/shared/StaticSelectTrailingContent.js +47 -0
- package/dist/components/inputs/Selection/shared/querySelect.utils.d.ts +14 -0
- package/dist/components/inputs/Selection/shared/querySelect.utils.js +43 -0
- package/dist/components/inputs/Selection/shared/select.context.d.ts +3 -2
- package/dist/components/inputs/Selection/shared/select.context.js +67 -36
- package/dist/components/inputs/Selection/shared/select.types.d.ts +3 -2
- package/dist/components/inputs/Selection/shared/selectDesktop.cva.d.ts +6 -0
- package/dist/components/inputs/Selection/shared/selectDesktop.cva.js +5 -0
- package/dist/components/inputs/Selection/shared/selectInput.cva.d.ts +12 -0
- package/dist/components/inputs/Selection/shared/selectInput.cva.js +8 -0
- package/dist/components/inputs/Selection/shared/staticSelect.utils.d.ts +23 -0
- package/dist/components/inputs/Selection/shared/staticSelect.utils.js +54 -0
- package/dist/components/inputs/Selection/shared/staticSelect.utils.spec.d.ts +1 -0
- package/dist/components/inputs/Selection/shared/useSelectItems.js +109 -49
- package/dist/components/inputs/Skeleton/InputFrame.d.ts +83 -0
- package/dist/components/inputs/Skeleton/InputFrame.js +612 -0
- package/dist/components/inputs/Slider/Slider.d.ts +2 -1
- package/dist/components/inputs/Slider/Slider.js +265 -76
- package/dist/components/inputs/TextEditor/TextEditor.d.ts +1 -0
- package/dist/components/inputs/TextEditor/TextEditor.js +447 -98
- package/dist/components/inputs/TextEditor/Toolbar/ColorPicker.js +37 -11
- package/dist/components/inputs/TextEditor/Toolbar/ColorPickerDropdown.js +102 -30
- package/dist/components/inputs/TextEditor/Toolbar/HyperlinkAction.js +194 -45
- package/dist/components/inputs/TextEditor/Toolbar/TextAlignSelect.js +88 -28
- package/dist/components/inputs/TextEditor/Toolbar/TextColorSelect.js +48 -14
- package/dist/components/inputs/TextEditor/Toolbar/TextEditorToolbar.js +66 -19
- package/dist/components/inputs/TextEditor/Toolbar/TextHighlightSelect.js +49 -15
- package/dist/components/inputs/TextEditor/Toolbar/TextListActions.js +92 -32
- package/dist/components/inputs/TextEditor/Toolbar/TextMarksActions.js +126 -54
- package/dist/components/inputs/TextEditor/Toolbar/TextStyleSelect.js +141 -38
- package/dist/components/inputs/Toggle/Toggle.d.ts +1 -0
- package/dist/components/inputs/Toggle/Toggle.js +214 -37
- package/dist/components/inputs/Toggle/toggle.cva.d.ts +3 -0
- package/dist/components/inputs/Toggle/toggle.cva.js +2 -1
- package/dist/components/inputs/shared/CheckContent.d.ts +2 -1
- package/dist/components/inputs/shared/CheckContent.js +21 -11
- package/dist/components/inputs/shared/InputClear.d.ts +2 -1
- package/dist/components/inputs/shared/InputClear.js +88 -12
- package/dist/components/inputs/shared/TooltipWrapper.js +50 -11
- package/dist/components/inputs/shared/input.cva.d.ts +28 -0
- package/dist/components/inputs/shared/input.cva.js +38 -4
- package/dist/components/inputs/shared/tooltipWrapper.cva.d.ts +8 -0
- package/dist/components/inputs/shared/tooltipWrapper.cva.js +5 -0
- package/dist/components/inputs/shared/useStaticInputHandoff.d.ts +15 -0
- package/dist/components/inputs/shared/useStaticInputHandoff.js +112 -0
- package/dist/components/navigation/Accordion/Accordion.js +69 -22
- package/dist/components/navigation/Accordion/AccordionItem.js +86 -41
- package/dist/components/navigation/Stepper/Stepper.js +67 -22
- package/dist/components/navigation/Stepper/StepperItem.js +104 -31
- package/dist/components/navigation/Stepper/StepperSeparator.js +23 -5
- package/dist/components/overlays/ActionModal/ActionModal.js +169 -35
- package/dist/components/overlays/BottomSheet/BottomSheet.js +96 -23
- package/dist/components/overlays/BottomSheet/BottomSheetHeader.js +48 -8
- package/dist/components/overlays/Drawer/Drawer.js +62 -20
- package/dist/components/overlays/ResponsivePopover/ResponsivePopover.js +85 -28
- package/dist/components/overlays/Tooltip/Tooltip.js +137 -28
- package/dist/components/overlays/Tooltip/TooltipEllipsis.js +37 -12
- package/dist/components/segment/Segment.js +218 -57
- package/dist/components/segment/SegmentItem.js +67 -10
- package/dist/components/shared/pagination/Pagination.js +108 -22
- package/dist/components/shared/pagination/PaginationList.js +167 -64
- package/dist/components/shared/pagination/minWidth.cva.d.ts +1 -1
- package/dist/components/status/Alert/Alert.js +97 -30
- package/dist/components/status/Loader/Loader.js +77 -22
- package/dist/components/status/Toast/Toast.js +28 -14
- package/dist/components/status/Toast/toast.cva.d.ts +1 -1
- package/dist/components/status/Toast/useToast.js +62 -57
- package/dist/components/table/ColumnConfig.js +158 -54
- package/dist/components/table/InfiniteTable.js +67 -16
- package/dist/components/table/PaginatedTable.js +84 -18
- package/dist/components/table/Table.js +28 -27
- package/dist/components/text/Link/Link.js +19 -7
- package/dist/components/text/Typography/Typography.js +23 -8
- package/dist/config/confirmation.context.js +1 -1
- package/dist/config/link.context.js +23 -9
- package/dist/config/router.context.js +42 -16
- package/dist/config/theme.context.js +98 -45
- package/dist/config/uiConfig.context.d.ts +20 -6
- package/dist/config/uiConfig.context.js +68 -14
- package/dist/config/uiOverrides.context.d.ts +30 -11
- package/dist/config/uiOverrides.context.js +54 -14
- package/dist/helpers/dynamicInputs.d.ts +12 -9
- package/dist/helpers/dynamicInputs.js +13 -8
- package/dist/hooks/useAutosave.d.ts +2 -1
- package/dist/hooks/useAutosave.js +12 -4
- package/dist/hooks/useAutosave.spec.d.ts +1 -0
- package/dist/hooks/useBreakpoint.js +16 -3
- package/dist/hooks/useDebounceCallback.js +51 -17
- package/dist/hooks/useFilters.js +125 -64
- package/dist/hooks/useForm.js +42 -8
- package/dist/hooks/useFormAutosave.d.ts +3 -1
- package/dist/hooks/useFormAutosave.js +122 -30
- package/dist/hooks/useFormAutosave.spec.d.ts +1 -0
- package/dist/hooks/useIntersectionObserver.d.ts +1 -1
- package/dist/hooks/useIntersectionObserver.js +91 -24
- package/dist/hooks/useKeyInteractions.d.ts +20 -0
- package/dist/hooks/useKeyInteractions.js +54 -0
- package/dist/hooks/useKeyInteractions.spec.d.ts +1 -0
- package/dist/hooks/useLocalStorage.js +43 -10
- package/dist/hooks/useLongPressRepeat.js +55 -20
- package/dist/hooks/usePagination.js +49 -19
- package/dist/hooks/useQueryAutocomplete.d.ts +14 -0
- package/dist/hooks/useQueryAutocomplete.js +72 -0
- package/dist/hooks/useScrollableListBox.js +37 -16
- package/dist/hooks/useSorting.js +69 -28
- package/dist/hooks/useStateAndRef.js +21 -7
- package/dist/hooks/useTableColumnConfig.js +124 -31
- package/dist/hooks/useTranslationMemo.js +25 -5
- package/dist/index.d.ts +18 -3
- package/dist/index.js +15 -5
- package/dist/tw-ui-plugin.js +6 -0
- package/dist/utils/date-time.utils.d.ts +38 -10
- package/dist/utils/date-time.utils.js +136 -22
- package/dist/utils/query.utils.d.ts +4 -0
- package/dist/utils/query.utils.js +8 -0
- package/dist/utils/zod.utils.d.ts +2 -0
- package/dist/utils/zod.utils.js +5 -0
- package/package.json +2 -2
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { Typography } from "../../../text/Typography/Typography.js";
|
|
2
|
+
import { c } from "react/compiler-runtime";
|
|
2
3
|
import { jsx } from "react/jsx-runtime";
|
|
3
4
|
import { clsx } from "clsx";
|
|
4
|
-
import {
|
|
5
|
+
import { useRef } from "react";
|
|
5
6
|
import { mergeProps } from "@react-aria/utils";
|
|
6
7
|
import { isSameDay } from "@internationalized/date";
|
|
7
8
|
import { useCalendarCell } from "@react-aria/calendar";
|
|
@@ -10,63 +11,172 @@ import { useFocusRing } from "@react-aria/focus";
|
|
|
10
11
|
var isRange = (state) => {
|
|
11
12
|
return "highlightedRange" in state;
|
|
12
13
|
};
|
|
13
|
-
var CalendarCell = (
|
|
14
|
+
var CalendarCell = (t0) => {
|
|
15
|
+
const $ = c(108);
|
|
16
|
+
let hoverDate;
|
|
17
|
+
let onApply;
|
|
18
|
+
let onDateHover;
|
|
19
|
+
let onDateSelection;
|
|
20
|
+
let onDoubleClickApply;
|
|
21
|
+
let onKeyboardNavigation;
|
|
22
|
+
let props;
|
|
23
|
+
let rangeSelection;
|
|
24
|
+
let state;
|
|
25
|
+
let t1;
|
|
26
|
+
let t2;
|
|
27
|
+
if ($[0] !== t0) {
|
|
28
|
+
({state, onApply, onDoubleClickApply, shouldApplyOnDateSelection: t1, shouldCloseOnSelect: t2, onDateSelection, onDateHover, rangeSelection, hoverDate, onKeyboardNavigation, ...props} = t0);
|
|
29
|
+
$[0] = t0;
|
|
30
|
+
$[1] = hoverDate;
|
|
31
|
+
$[2] = onApply;
|
|
32
|
+
$[3] = onDateHover;
|
|
33
|
+
$[4] = onDateSelection;
|
|
34
|
+
$[5] = onDoubleClickApply;
|
|
35
|
+
$[6] = onKeyboardNavigation;
|
|
36
|
+
$[7] = props;
|
|
37
|
+
$[8] = rangeSelection;
|
|
38
|
+
$[9] = state;
|
|
39
|
+
$[10] = t1;
|
|
40
|
+
$[11] = t2;
|
|
41
|
+
} else {
|
|
42
|
+
hoverDate = $[1];
|
|
43
|
+
onApply = $[2];
|
|
44
|
+
onDateHover = $[3];
|
|
45
|
+
onDateSelection = $[4];
|
|
46
|
+
onDoubleClickApply = $[5];
|
|
47
|
+
onKeyboardNavigation = $[6];
|
|
48
|
+
props = $[7];
|
|
49
|
+
rangeSelection = $[8];
|
|
50
|
+
state = $[9];
|
|
51
|
+
t1 = $[10];
|
|
52
|
+
t2 = $[11];
|
|
53
|
+
}
|
|
54
|
+
const shouldApplyOnDateSelection = t1 === void 0 ? true : t1;
|
|
55
|
+
const shouldCloseOnSelect = t2 === void 0 ? true : t2;
|
|
14
56
|
const ref = useRef(null);
|
|
15
|
-
const { cellProps, buttonProps, formattedDate, isSelected, isDisabled, isOutsideVisibleRange } = useCalendarCell(props, state, ref);
|
|
57
|
+
const { cellProps, buttonProps, formattedDate, isSelected, isDisabled, isOutsideVisibleRange, isFocused } = useCalendarCell(props, state, ref);
|
|
16
58
|
const { focusProps } = useFocusRing();
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
onApply
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
59
|
+
let t3;
|
|
60
|
+
if ($[12] !== buttonProps || $[13] !== isDisabled || $[14] !== isSelected || $[15] !== onApply || $[16] !== onDateSelection || $[17] !== props.date || $[18] !== shouldApplyOnDateSelection || $[19] !== shouldCloseOnSelect) {
|
|
61
|
+
t3 = (event) => {
|
|
62
|
+
buttonProps.onClick?.(event);
|
|
63
|
+
if (onDateSelection) onDateSelection(props.date);
|
|
64
|
+
if (shouldCloseOnSelect && !isDisabled && (shouldApplyOnDateSelection || isSelected)) onApply?.(props.date);
|
|
65
|
+
};
|
|
66
|
+
$[12] = buttonProps;
|
|
67
|
+
$[13] = isDisabled;
|
|
68
|
+
$[14] = isSelected;
|
|
69
|
+
$[15] = onApply;
|
|
70
|
+
$[16] = onDateSelection;
|
|
71
|
+
$[17] = props.date;
|
|
72
|
+
$[18] = shouldApplyOnDateSelection;
|
|
73
|
+
$[19] = shouldCloseOnSelect;
|
|
74
|
+
$[20] = t3;
|
|
75
|
+
} else t3 = $[20];
|
|
76
|
+
const onClick = t3;
|
|
77
|
+
let t4;
|
|
78
|
+
if ($[21] !== isDisabled || $[22] !== onDoubleClickApply || $[23] !== props.date) {
|
|
79
|
+
t4 = (event_0) => {
|
|
80
|
+
if (isDisabled) return;
|
|
81
|
+
event_0.preventDefault();
|
|
82
|
+
onDoubleClickApply?.(props.date);
|
|
83
|
+
};
|
|
84
|
+
$[21] = isDisabled;
|
|
85
|
+
$[22] = onDoubleClickApply;
|
|
86
|
+
$[23] = props.date;
|
|
87
|
+
$[24] = t4;
|
|
88
|
+
} else t4 = $[24];
|
|
89
|
+
const onDoubleClick = t4;
|
|
90
|
+
let isSelectionStart;
|
|
91
|
+
let isSelectionEnd;
|
|
92
|
+
let isSelectedCell;
|
|
93
|
+
let isInRange = false;
|
|
94
|
+
let isHoverRange = false;
|
|
95
|
+
let isSelectingMode = false;
|
|
96
|
+
if (rangeSelection?.start) {
|
|
97
|
+
let t5;
|
|
98
|
+
if ($[25] !== props.date || $[26] !== rangeSelection.start) {
|
|
99
|
+
t5 = isSameDay(props.date, rangeSelection.start);
|
|
100
|
+
$[25] = props.date;
|
|
101
|
+
$[26] = rangeSelection.start;
|
|
102
|
+
$[27] = t5;
|
|
103
|
+
} else t5 = $[27];
|
|
104
|
+
isSelectionStart = t5;
|
|
105
|
+
let t6;
|
|
106
|
+
if ($[28] !== props.date || $[29] !== rangeSelection.end) {
|
|
107
|
+
t6 = rangeSelection.end ? isSameDay(props.date, rangeSelection.end) : false;
|
|
108
|
+
$[28] = props.date;
|
|
109
|
+
$[29] = rangeSelection.end;
|
|
110
|
+
$[30] = t6;
|
|
111
|
+
} else t6 = $[30];
|
|
112
|
+
isSelectionEnd = t6;
|
|
113
|
+
isSelectedCell = isSelectionStart || isSelectionEnd;
|
|
114
|
+
isSelectingMode = rangeSelection.isSelecting && !rangeSelection.end;
|
|
115
|
+
if (rangeSelection.start && rangeSelection.end) {
|
|
116
|
+
const dateValue = props.date;
|
|
117
|
+
const isAfterStart = dateValue.compare(rangeSelection.start) > 0;
|
|
118
|
+
const isBeforeEnd = dateValue.compare(rangeSelection.end) < 0;
|
|
119
|
+
isInRange = isAfterStart && isBeforeEnd;
|
|
120
|
+
}
|
|
121
|
+
if (rangeSelection.isSelecting && rangeSelection.start && hoverDate && !rangeSelection.end) {
|
|
122
|
+
const dateValue_0 = props.date;
|
|
123
|
+
const { start } = rangeSelection;
|
|
124
|
+
const end = hoverDate;
|
|
125
|
+
const earlierDate = start.compare(end) <= 0 ? start : end;
|
|
126
|
+
const laterDate = start.compare(end) <= 0 ? end : start;
|
|
127
|
+
const isAfterStart_0 = dateValue_0.compare(earlierDate) > 0;
|
|
128
|
+
const isBeforeEnd_0 = dateValue_0.compare(laterDate) < 0;
|
|
129
|
+
isHoverRange = isAfterStart_0 && isBeforeEnd_0;
|
|
68
130
|
}
|
|
69
|
-
|
|
131
|
+
} else {
|
|
132
|
+
let t5;
|
|
133
|
+
if ($[31] !== isSelected || $[32] !== props.date || $[33] !== state) {
|
|
134
|
+
t5 = isRange(state) && state.highlightedRange ? isSameDay(props.date, state.highlightedRange.start) : isSelected;
|
|
135
|
+
$[31] = isSelected;
|
|
136
|
+
$[32] = props.date;
|
|
137
|
+
$[33] = state;
|
|
138
|
+
$[34] = t5;
|
|
139
|
+
} else t5 = $[34];
|
|
140
|
+
isSelectionStart = t5;
|
|
141
|
+
let t6;
|
|
142
|
+
if ($[35] !== isSelected || $[36] !== props.date || $[37] !== state) {
|
|
143
|
+
t6 = isRange(state) && state.highlightedRange ? isSameDay(props.date, state.highlightedRange.end) : isSelected;
|
|
144
|
+
$[35] = isSelected;
|
|
145
|
+
$[36] = props.date;
|
|
146
|
+
$[37] = state;
|
|
147
|
+
$[38] = t6;
|
|
148
|
+
} else t6 = $[38];
|
|
149
|
+
isSelectionEnd = t6;
|
|
150
|
+
let t7;
|
|
151
|
+
if ($[39] !== isSelected || $[40] !== isSelectionEnd || $[41] !== isSelectionStart || $[42] !== state) {
|
|
152
|
+
t7 = isSelectionStart || isSelectionEnd || !isRange(state) && isSelected;
|
|
153
|
+
$[39] = isSelected;
|
|
154
|
+
$[40] = isSelectionEnd;
|
|
155
|
+
$[41] = isSelectionStart;
|
|
156
|
+
$[42] = state;
|
|
157
|
+
$[43] = t7;
|
|
158
|
+
} else t7 = $[43];
|
|
159
|
+
isSelectedCell = t7;
|
|
160
|
+
let t8;
|
|
161
|
+
if ($[44] !== isSelected || $[45] !== isSelectionEnd || $[46] !== isSelectionStart || $[47] !== state) {
|
|
162
|
+
t8 = isRange(state) && isSelected && !isSelectionStart && !isSelectionEnd;
|
|
163
|
+
$[44] = isSelected;
|
|
164
|
+
$[45] = isSelectionEnd;
|
|
165
|
+
$[46] = isSelectionStart;
|
|
166
|
+
$[47] = state;
|
|
167
|
+
$[48] = t8;
|
|
168
|
+
} else t8 = $[48];
|
|
169
|
+
isInRange = t8;
|
|
170
|
+
if (isRange(state) && state.highlightedRange && !isSelected) {
|
|
171
|
+
const dateValue_1 = props.date;
|
|
172
|
+
const isAfterStart_1 = dateValue_1.compare(state.highlightedRange.start) > 0;
|
|
173
|
+
const isBeforeEnd_1 = dateValue_1.compare(state.highlightedRange.end) < 0;
|
|
174
|
+
isHoverRange = isAfterStart_1 && isBeforeEnd_1;
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
let t5;
|
|
178
|
+
if ($[49] !== isHoverRange || $[50] !== isInRange || $[51] !== isSelectedCell || $[52] !== isSelectingMode || $[53] !== isSelectionEnd || $[54] !== isSelectionStart) {
|
|
179
|
+
t5 = {
|
|
70
180
|
isSelectionStart,
|
|
71
181
|
isSelectionEnd,
|
|
72
182
|
isSelectedCell,
|
|
@@ -74,59 +184,156 @@ var CalendarCell = ({ state, onApply, shouldCloseOnSelect = true, onDateSelectio
|
|
|
74
184
|
isHoverRange,
|
|
75
185
|
isSelectingMode
|
|
76
186
|
};
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
187
|
+
$[49] = isHoverRange;
|
|
188
|
+
$[50] = isInRange;
|
|
189
|
+
$[51] = isSelectedCell;
|
|
190
|
+
$[52] = isSelectingMode;
|
|
191
|
+
$[53] = isSelectionEnd;
|
|
192
|
+
$[54] = isSelectionStart;
|
|
193
|
+
$[55] = t5;
|
|
194
|
+
} else t5 = $[55];
|
|
195
|
+
const selectionState = t5;
|
|
196
|
+
let t6;
|
|
197
|
+
if ($[56] !== isOutsideVisibleRange || $[57] !== isSelected || $[58] !== onApply || $[59] !== props.date || $[60] !== shouldCloseOnSelect || $[61] !== state) {
|
|
198
|
+
t6 = (event_1, eventHandler) => {
|
|
199
|
+
if (isOutsideVisibleRange) {
|
|
200
|
+
state.selectDate(props.date);
|
|
201
|
+
state.setFocusedDate(props.date);
|
|
202
|
+
}
|
|
203
|
+
eventHandler?.(event_1);
|
|
204
|
+
if (isSelected && shouldCloseOnSelect) onApply?.(props.date);
|
|
205
|
+
};
|
|
206
|
+
$[56] = isOutsideVisibleRange;
|
|
207
|
+
$[57] = isSelected;
|
|
208
|
+
$[58] = onApply;
|
|
209
|
+
$[59] = props.date;
|
|
210
|
+
$[60] = shouldCloseOnSelect;
|
|
211
|
+
$[61] = state;
|
|
212
|
+
$[62] = t6;
|
|
213
|
+
} else t6 = $[62];
|
|
214
|
+
const handleEvent = t6;
|
|
215
|
+
let t7;
|
|
216
|
+
if ($[63] !== onDateHover || $[64] !== props.date || $[65] !== selectionState.isSelectingMode) {
|
|
217
|
+
t7 = () => {
|
|
218
|
+
if (onDateHover && selectionState.isSelectingMode) onDateHover(props.date);
|
|
219
|
+
};
|
|
220
|
+
$[63] = onDateHover;
|
|
221
|
+
$[64] = props.date;
|
|
222
|
+
$[65] = selectionState.isSelectingMode;
|
|
223
|
+
$[66] = t7;
|
|
224
|
+
} else t7 = $[66];
|
|
225
|
+
const onMouseEnter = t7;
|
|
226
|
+
let t8;
|
|
227
|
+
if ($[67] !== onDateHover || $[68] !== selectionState.isSelectingMode) {
|
|
228
|
+
t8 = () => {
|
|
229
|
+
if (onDateHover && selectionState.isSelectingMode) onDateHover(null);
|
|
230
|
+
};
|
|
231
|
+
$[67] = onDateHover;
|
|
232
|
+
$[68] = selectionState.isSelectingMode;
|
|
233
|
+
$[69] = t8;
|
|
234
|
+
} else t8 = $[69];
|
|
235
|
+
const onMouseLeave = t8;
|
|
236
|
+
const { isSelectedCell: isSelectedCell_0, isInRange: isInRange_0, isHoverRange: isHoverRange_0, isSelectingMode: isSelectingMode_0, isSelectionStart: isSelectionStart_0, isSelectionEnd: isSelectionEnd_0 } = selectionState;
|
|
237
|
+
const t9 = !isSelectedCell_0 && !isOutsideVisibleRange && "bg-elevation-fill-default-1 text-interactive-text-secondary-idle";
|
|
238
|
+
const t10 = !isSelectedCell_0 && isOutsideVisibleRange && "bg-elevation-fill-default-1 text-interactive-text-secondary-disabled";
|
|
239
|
+
const t11 = isSelectedCell_0 && !isOutsideVisibleRange && "bg-interactive-contained-primary-idle text-interactive-contained-primary-on-idle";
|
|
240
|
+
const t12 = isSelectedCell_0 && !isOutsideVisibleRange && rangeSelection && !rangeSelection.isSelecting && isSelectionStart_0 && !isSelectionEnd_0 && "rounded-r-none";
|
|
241
|
+
const t13 = isSelectedCell_0 && !isOutsideVisibleRange && rangeSelection && !rangeSelection.isSelecting && isSelectionEnd_0 && !isSelectionStart_0 && "rounded-l-none";
|
|
242
|
+
const t14 = isDisabled && !isOutsideVisibleRange && "cursor-default";
|
|
243
|
+
const t15 = isDisabled && "opacity-20";
|
|
244
|
+
const t16 = !isSelectedCell_0 && !isInRange_0 && !isHoverRange_0 && !isSelectingMode_0 && !isDisabled && !isOutsideVisibleRange && "[@media(pointer:fine)]:hover:border-elevation-outline-default-1 [@media(pointer:fine)]:hover:text-interactive-text-secondary-hover";
|
|
245
|
+
const t17 = isInRange_0 && !isOutsideVisibleRange && "!rounded-none !bg-elevation-fill-default-2 text-interactive-text-secondary-hover";
|
|
246
|
+
const t18 = isHoverRange_0 && !isOutsideVisibleRange && "!rounded-none !bg-elevation-fill-default-2 text-interactive-text-secondary-hover";
|
|
247
|
+
const t19 = !isInRange_0 && !isSelectedCell_0 && isSelectingMode_0 && "hover:bg-interactive-contained-primary-idle hover:text-interactive-text-primary-idle-inverted";
|
|
248
|
+
const t20 = isSelectingMode_0 && !isSelectedCell_0 && !isInRange_0 && !isHoverRange_0 && !isDisabled && !isOutsideVisibleRange && "transition-all duration-75 hover:border-elevation-outline-default-1";
|
|
249
|
+
const t21 = isFocused && !isSelectedCell_0 && !isDisabled && !isOutsideVisibleRange && "ring-2 ring-inset ring-interactive-contained-primary-focus";
|
|
250
|
+
let t22;
|
|
251
|
+
if ($[70] !== t10 || $[71] !== t11 || $[72] !== t12 || $[73] !== t13 || $[74] !== t14 || $[75] !== t15 || $[76] !== t16 || $[77] !== t17 || $[78] !== t18 || $[79] !== t19 || $[80] !== t20 || $[81] !== t21 || $[82] !== t9) {
|
|
252
|
+
t22 = clsx("mx-auto flex h-10 w-full max-w-10 items-center justify-center rounded-button-rounding-m p-2", "focus:outline-none focus-visible:outline-1 focus-visible:outline-interactive-contained-primary-focus focus-visible:outline-offset-1", "border border-transparent border-solid", t9, t10, t11, t12, t13, t14, t15, t16, t17, t18, t19, t20, t21);
|
|
253
|
+
$[70] = t10;
|
|
254
|
+
$[71] = t11;
|
|
255
|
+
$[72] = t12;
|
|
256
|
+
$[73] = t13;
|
|
257
|
+
$[74] = t14;
|
|
258
|
+
$[75] = t15;
|
|
259
|
+
$[76] = t16;
|
|
260
|
+
$[77] = t17;
|
|
261
|
+
$[78] = t18;
|
|
262
|
+
$[79] = t19;
|
|
263
|
+
$[80] = t20;
|
|
264
|
+
$[81] = t21;
|
|
265
|
+
$[82] = t9;
|
|
266
|
+
$[83] = t22;
|
|
267
|
+
} else t22 = $[83];
|
|
268
|
+
const cellClassName = t22;
|
|
269
|
+
let t23;
|
|
270
|
+
if ($[84] !== buttonProps || $[85] !== focusProps) {
|
|
271
|
+
t23 = mergeProps(buttonProps, focusProps);
|
|
272
|
+
$[84] = buttonProps;
|
|
273
|
+
$[85] = focusProps;
|
|
274
|
+
$[86] = t23;
|
|
275
|
+
} else t23 = $[86];
|
|
276
|
+
let t24;
|
|
277
|
+
if ($[87] !== handleEvent || $[88] !== onClick) {
|
|
278
|
+
t24 = (e) => handleEvent(e, onClick);
|
|
279
|
+
$[87] = handleEvent;
|
|
280
|
+
$[88] = onClick;
|
|
281
|
+
$[89] = t24;
|
|
282
|
+
} else t24 = $[89];
|
|
283
|
+
let t25;
|
|
284
|
+
if ($[90] !== handleEvent || $[91] !== onKeyboardNavigation || $[92] !== props.date) {
|
|
285
|
+
t25 = (e_0) => handleEvent(e_0, () => onKeyboardNavigation?.(e_0, props.date));
|
|
286
|
+
$[90] = handleEvent;
|
|
287
|
+
$[91] = onKeyboardNavigation;
|
|
288
|
+
$[92] = props.date;
|
|
289
|
+
$[93] = t25;
|
|
290
|
+
} else t25 = $[93];
|
|
291
|
+
let t26;
|
|
292
|
+
if ($[94] !== formattedDate) {
|
|
293
|
+
t26 = /* @__PURE__ */ jsx(Typography, {
|
|
294
|
+
as: "span",
|
|
295
|
+
size: "label-2",
|
|
296
|
+
className: "block w-6 overflow-hidden text-ellipsis text-center",
|
|
297
|
+
children: formattedDate
|
|
298
|
+
});
|
|
299
|
+
$[94] = formattedDate;
|
|
300
|
+
$[95] = t26;
|
|
301
|
+
} else t26 = $[95];
|
|
302
|
+
let t27;
|
|
303
|
+
if ($[96] !== cellClassName || $[97] !== onDoubleClick || $[98] !== onMouseEnter || $[99] !== onMouseLeave || $[100] !== t23 || $[101] !== t24 || $[102] !== t25 || $[103] !== t26) {
|
|
304
|
+
t27 = /* @__PURE__ */ jsx("div", {
|
|
114
305
|
ref,
|
|
115
|
-
...
|
|
306
|
+
...t23,
|
|
116
307
|
"aria-disabled": void 0,
|
|
117
308
|
onMouseEnter,
|
|
118
309
|
onMouseLeave,
|
|
119
310
|
className: cellClassName,
|
|
120
|
-
onClick:
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
311
|
+
onClick: t24,
|
|
312
|
+
onDoubleClick,
|
|
313
|
+
onKeyDown: t25,
|
|
314
|
+
children: t26
|
|
315
|
+
});
|
|
316
|
+
$[96] = cellClassName;
|
|
317
|
+
$[97] = onDoubleClick;
|
|
318
|
+
$[98] = onMouseEnter;
|
|
319
|
+
$[99] = onMouseLeave;
|
|
320
|
+
$[100] = t23;
|
|
321
|
+
$[101] = t24;
|
|
322
|
+
$[102] = t25;
|
|
323
|
+
$[103] = t26;
|
|
324
|
+
$[104] = t27;
|
|
325
|
+
} else t27 = $[104];
|
|
326
|
+
let t28;
|
|
327
|
+
if ($[105] !== cellProps || $[106] !== t27) {
|
|
328
|
+
t28 = /* @__PURE__ */ jsx("td", {
|
|
329
|
+
...cellProps,
|
|
330
|
+
children: t27
|
|
331
|
+
});
|
|
332
|
+
$[105] = cellProps;
|
|
333
|
+
$[106] = t27;
|
|
334
|
+
$[107] = t28;
|
|
335
|
+
} else t28 = $[107];
|
|
336
|
+
return t28;
|
|
130
337
|
};
|
|
131
338
|
//#endregion
|
|
132
339
|
export { CalendarCell };
|
|
@@ -4,7 +4,9 @@ import { KeyboardEvent } from 'react';
|
|
|
4
4
|
import { DateValue } from 'react-aria';
|
|
5
5
|
interface CalendarGridProps extends AriaCalendarGridProps {
|
|
6
6
|
state: CalendarState | RangeCalendarState;
|
|
7
|
-
onApply?: () => void;
|
|
7
|
+
onApply?: (selectedDate?: DateValue) => void;
|
|
8
|
+
onDoubleClickApply?: (selectedDate?: DateValue) => void;
|
|
9
|
+
shouldApplyOnDateSelection?: boolean;
|
|
8
10
|
offset?: {
|
|
9
11
|
months?: number;
|
|
10
12
|
};
|
|
@@ -21,5 +23,5 @@ interface CalendarGridProps extends AriaCalendarGridProps {
|
|
|
21
23
|
onKeyboardNavigation?: (event: KeyboardEvent, date: DateValue) => boolean;
|
|
22
24
|
calendarSide?: "left" | "right";
|
|
23
25
|
}
|
|
24
|
-
export declare const CalendarGrid: ({ state, onApply, shouldCloseOnSelect, offset, onDateSelection, onDateHover, rangeSelection, hoverDate, onKeyboardNavigation, className, calendarSide, ...props }: CalendarGridProps) => import("react/jsx-runtime").JSX.Element;
|
|
26
|
+
export declare const CalendarGrid: ({ state, onApply, onDoubleClickApply, shouldApplyOnDateSelection, shouldCloseOnSelect, offset, onDateSelection, onDateHover, rangeSelection, hoverDate, onKeyboardNavigation, className, calendarSide, ...props }: CalendarGridProps) => import("react/jsx-runtime").JSX.Element;
|
|
25
27
|
export {};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Typography } from "../../../text/Typography/Typography.js";
|
|
2
2
|
import { CalendarCell } from "./CalendarCell.js";
|
|
3
|
+
import { c } from "react/compiler-runtime";
|
|
3
4
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
5
|
import { clsx } from "clsx";
|
|
5
6
|
import { useCalendarGrid } from "@react-aria/calendar";
|
|
@@ -12,41 +13,157 @@ var WEEK_INDICES = [
|
|
|
12
13
|
4,
|
|
13
14
|
5
|
|
14
15
|
];
|
|
15
|
-
var CalendarGrid = (
|
|
16
|
-
const
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
16
|
+
var CalendarGrid = (t0) => {
|
|
17
|
+
const $ = c(38);
|
|
18
|
+
let calendarSide;
|
|
19
|
+
let className;
|
|
20
|
+
let hoverDate;
|
|
21
|
+
let onApply;
|
|
22
|
+
let onDateHover;
|
|
23
|
+
let onDateSelection;
|
|
24
|
+
let onDoubleClickApply;
|
|
25
|
+
let onKeyboardNavigation;
|
|
26
|
+
let props;
|
|
27
|
+
let rangeSelection;
|
|
28
|
+
let shouldApplyOnDateSelection;
|
|
29
|
+
let shouldCloseOnSelect;
|
|
30
|
+
let state;
|
|
31
|
+
let t1;
|
|
32
|
+
if ($[0] !== t0) {
|
|
33
|
+
({state, onApply, onDoubleClickApply, shouldApplyOnDateSelection, shouldCloseOnSelect, offset: t1, onDateSelection, onDateHover, rangeSelection, hoverDate, onKeyboardNavigation, className, calendarSide, ...props} = t0);
|
|
34
|
+
$[0] = t0;
|
|
35
|
+
$[1] = calendarSide;
|
|
36
|
+
$[2] = className;
|
|
37
|
+
$[3] = hoverDate;
|
|
38
|
+
$[4] = onApply;
|
|
39
|
+
$[5] = onDateHover;
|
|
40
|
+
$[6] = onDateSelection;
|
|
41
|
+
$[7] = onDoubleClickApply;
|
|
42
|
+
$[8] = onKeyboardNavigation;
|
|
43
|
+
$[9] = props;
|
|
44
|
+
$[10] = rangeSelection;
|
|
45
|
+
$[11] = shouldApplyOnDateSelection;
|
|
46
|
+
$[12] = shouldCloseOnSelect;
|
|
47
|
+
$[13] = state;
|
|
48
|
+
$[14] = t1;
|
|
49
|
+
} else {
|
|
50
|
+
calendarSide = $[1];
|
|
51
|
+
className = $[2];
|
|
52
|
+
hoverDate = $[3];
|
|
53
|
+
onApply = $[4];
|
|
54
|
+
onDateHover = $[5];
|
|
55
|
+
onDateSelection = $[6];
|
|
56
|
+
onDoubleClickApply = $[7];
|
|
57
|
+
onKeyboardNavigation = $[8];
|
|
58
|
+
props = $[9];
|
|
59
|
+
rangeSelection = $[10];
|
|
60
|
+
shouldApplyOnDateSelection = $[11];
|
|
61
|
+
shouldCloseOnSelect = $[12];
|
|
62
|
+
state = $[13];
|
|
63
|
+
t1 = $[14];
|
|
64
|
+
}
|
|
65
|
+
const offset = t1 === void 0 ? {} : t1;
|
|
66
|
+
let t2;
|
|
67
|
+
if ($[15] !== props) {
|
|
68
|
+
t2 = {
|
|
69
|
+
...props,
|
|
70
|
+
weekdayStyle: "short"
|
|
71
|
+
};
|
|
72
|
+
$[15] = props;
|
|
73
|
+
$[16] = t2;
|
|
74
|
+
} else t2 = $[16];
|
|
75
|
+
const { gridProps, headerProps, weekDays } = useCalendarGrid(t2, state);
|
|
20
76
|
const startDate = state.visibleRange.start.add(offset);
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
77
|
+
let t3;
|
|
78
|
+
if ($[17] !== calendarSide || $[18] !== onDateSelection) {
|
|
79
|
+
t3 = (date) => {
|
|
80
|
+
onDateSelection?.(date, calendarSide);
|
|
81
|
+
};
|
|
82
|
+
$[17] = calendarSide;
|
|
83
|
+
$[18] = onDateSelection;
|
|
84
|
+
$[19] = t3;
|
|
85
|
+
} else t3 = $[19];
|
|
86
|
+
const handleDateSelection = t3;
|
|
87
|
+
let t4;
|
|
88
|
+
if ($[20] !== className) {
|
|
89
|
+
t4 = clsx("h-72 w-full px-3 py-1 md:w-80", className);
|
|
90
|
+
$[20] = className;
|
|
91
|
+
$[21] = t4;
|
|
92
|
+
} else t4 = $[21];
|
|
93
|
+
const t5 = "0";
|
|
94
|
+
const t6 = "w-full";
|
|
95
|
+
let t7;
|
|
96
|
+
if ($[22] !== weekDays) {
|
|
97
|
+
t7 = weekDays.map(_temp);
|
|
98
|
+
$[22] = weekDays;
|
|
99
|
+
$[23] = t7;
|
|
100
|
+
} else t7 = $[23];
|
|
101
|
+
let t8;
|
|
102
|
+
if ($[24] !== t7) {
|
|
103
|
+
t8 = /* @__PURE__ */ jsx("tr", { children: t7 });
|
|
104
|
+
$[24] = t7;
|
|
105
|
+
$[25] = t8;
|
|
106
|
+
} else t8 = $[25];
|
|
107
|
+
let t9;
|
|
108
|
+
if ($[26] !== headerProps || $[27] !== t8) {
|
|
109
|
+
t9 = /* @__PURE__ */ jsx("thead", {
|
|
110
|
+
...headerProps,
|
|
111
|
+
children: t8
|
|
112
|
+
});
|
|
113
|
+
$[26] = headerProps;
|
|
114
|
+
$[27] = t8;
|
|
115
|
+
$[28] = t9;
|
|
116
|
+
} else t9 = $[28];
|
|
117
|
+
const t10 = WEEK_INDICES.map((weekIndex) => /* @__PURE__ */ jsx("tr", { children: state.getDatesInWeek(weekIndex, startDate).map((date_0, i) => date_0 ? /* @__PURE__ */ jsx(CalendarCell, {
|
|
118
|
+
state,
|
|
119
|
+
date: date_0,
|
|
120
|
+
onApply,
|
|
121
|
+
onDoubleClickApply,
|
|
122
|
+
shouldApplyOnDateSelection,
|
|
123
|
+
shouldCloseOnSelect,
|
|
124
|
+
onDateSelection: handleDateSelection,
|
|
125
|
+
onDateHover,
|
|
126
|
+
rangeSelection,
|
|
127
|
+
hoverDate,
|
|
128
|
+
onKeyboardNavigation
|
|
129
|
+
}, i) : /* @__PURE__ */ jsx("td", {}, i)) }, weekIndex));
|
|
130
|
+
let t11;
|
|
131
|
+
if ($[29] !== t10) {
|
|
132
|
+
t11 = /* @__PURE__ */ jsx("tbody", { children: t10 });
|
|
133
|
+
$[29] = t10;
|
|
134
|
+
$[30] = t11;
|
|
135
|
+
} else t11 = $[30];
|
|
136
|
+
let t12;
|
|
137
|
+
if ($[31] !== gridProps || $[32] !== t11 || $[33] !== t9) {
|
|
138
|
+
t12 = /* @__PURE__ */ jsxs("table", {
|
|
27
139
|
...gridProps,
|
|
28
|
-
cellPadding:
|
|
29
|
-
className:
|
|
30
|
-
children: [
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
})
|
|
49
|
-
});
|
|
140
|
+
cellPadding: t5,
|
|
141
|
+
className: t6,
|
|
142
|
+
children: [t9, t11]
|
|
143
|
+
});
|
|
144
|
+
$[31] = gridProps;
|
|
145
|
+
$[32] = t11;
|
|
146
|
+
$[33] = t9;
|
|
147
|
+
$[34] = t12;
|
|
148
|
+
} else t12 = $[34];
|
|
149
|
+
let t13;
|
|
150
|
+
if ($[35] !== t12 || $[36] !== t4) {
|
|
151
|
+
t13 = /* @__PURE__ */ jsx("div", {
|
|
152
|
+
className: t4,
|
|
153
|
+
children: t12
|
|
154
|
+
});
|
|
155
|
+
$[35] = t12;
|
|
156
|
+
$[36] = t4;
|
|
157
|
+
$[37] = t13;
|
|
158
|
+
} else t13 = $[37];
|
|
159
|
+
return t13;
|
|
50
160
|
};
|
|
161
|
+
function _temp(day) {
|
|
162
|
+
return /* @__PURE__ */ jsx("th", { children: /* @__PURE__ */ jsx(Typography, {
|
|
163
|
+
size: "label-2",
|
|
164
|
+
className: "bg-elevation-fill-default-1 py-2 text-interactive-text-secondary-idle",
|
|
165
|
+
children: day.substring(0, 2)
|
|
166
|
+
}) }, day);
|
|
167
|
+
}
|
|
51
168
|
//#endregion
|
|
52
169
|
export { CalendarGrid };
|