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