@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,209 +1,98 @@
|
|
|
1
1
|
import { CalendarGrid } from "./CalendarGrid.js";
|
|
2
2
|
import { CalendarSelectHeader } from "./CalendarSelectHeader.js";
|
|
3
|
-
import { c } from "react/compiler-runtime";
|
|
4
3
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
4
|
import { clsx } from "clsx";
|
|
6
|
-
import { useRef } from "react";
|
|
5
|
+
import { useMemo, useRef } from "react";
|
|
7
6
|
import { useRangeCalendar } from "@react-aria/calendar";
|
|
8
7
|
//#region src/components/inputs/DateTime/shared/RangeCalendar.tsx
|
|
9
|
-
var RangeCalendar = (
|
|
10
|
-
const $ = c(56);
|
|
11
|
-
const { className, leftCalendarState, rightCalendarState, calendarProps, onApply, onDateSelection, onDateHover, rangeSelection, hoverDate, onKeyboardNavigation } = t0;
|
|
8
|
+
var RangeCalendar = ({ className, leftCalendarState, rightCalendarState, calendarProps, onApply, onRangeChange: _onRangeChange, onDateSelection, onDateHover, rangeSelection, hoverDate, onKeyboardNavigation }) => {
|
|
12
9
|
const leftRef = useRef(null);
|
|
13
10
|
const rightRef = useRef(null);
|
|
14
11
|
const { calendarProps: leftCalendarAriaProps } = useRangeCalendar(calendarProps, leftCalendarState, leftRef);
|
|
15
12
|
const { calendarProps: rightCalendarAriaProps } = useRangeCalendar(calendarProps, rightCalendarState, rightRef);
|
|
16
13
|
const leftDate = leftCalendarState.visibleRange.start;
|
|
17
14
|
const rightDate = rightCalendarState.visibleRange.start;
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
}
|
|
24
|
-
const
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
if (newDate_0.year > leftCurrentDate.year || newDate_0.year === leftCurrentDate.year && newDate_0.month > leftCurrentDate.month) rightCalendarState.setFocusedDate(newDate_0);
|
|
52
|
-
else {
|
|
53
|
-
const closestValidDate_0 = leftCurrentDate.add({ months: 1 });
|
|
54
|
-
rightCalendarState.setFocusedDate(closestValidDate_0);
|
|
55
|
-
}
|
|
56
|
-
};
|
|
57
|
-
$[7] = leftCalendarState.visibleRange.start;
|
|
58
|
-
$[8] = rightCalendarState;
|
|
59
|
-
$[9] = t4;
|
|
60
|
-
} else t4 = $[9];
|
|
61
|
-
const handleRightNavigate = t4;
|
|
62
|
-
let t5;
|
|
63
|
-
if ($[10] !== leftDate) {
|
|
64
|
-
t5 = leftDate.add({ months: 1 });
|
|
65
|
-
$[10] = leftDate;
|
|
66
|
-
$[11] = t5;
|
|
67
|
-
} else t5 = $[11];
|
|
68
|
-
const leftNextDate = t5;
|
|
69
|
-
const isNextDisabled = leftNextDate.year > rightDate.year || leftNextDate.year === rightDate.year && leftNextDate.month === rightDate.month;
|
|
70
|
-
let t6;
|
|
71
|
-
if ($[12] !== rightDate) {
|
|
72
|
-
t6 = rightDate.subtract({ months: 1 });
|
|
73
|
-
$[12] = rightDate;
|
|
74
|
-
$[13] = t6;
|
|
75
|
-
} else t6 = $[13];
|
|
76
|
-
const rightPrevDate = t6;
|
|
77
|
-
const isPrevDisabled = rightPrevDate.year < leftDate.year || rightPrevDate.year === leftDate.year && rightPrevDate.month === leftDate.month;
|
|
78
|
-
let t7;
|
|
79
|
-
if ($[14] !== className) {
|
|
80
|
-
t7 = clsx("flex w-fit flex-col items-center bg-elevation-fill-default-1", className);
|
|
81
|
-
$[14] = className;
|
|
82
|
-
$[15] = t7;
|
|
83
|
-
} else t7 = $[15];
|
|
84
|
-
let t8;
|
|
85
|
-
if ($[16] !== handleLeftNavigate || $[17] !== isNextDisabled || $[18] !== leftCalendarState || $[19] !== rightDate) {
|
|
86
|
-
t8 = /* @__PURE__ */ jsx(CalendarSelectHeader, {
|
|
87
|
-
state: leftCalendarState,
|
|
88
|
-
isNextMonthDisabled: isNextDisabled,
|
|
89
|
-
isNextYearDisabled: isNextDisabled,
|
|
90
|
-
onNavigate: handleLeftNavigate,
|
|
91
|
-
maxDate: rightDate
|
|
92
|
-
});
|
|
93
|
-
$[16] = handleLeftNavigate;
|
|
94
|
-
$[17] = isNextDisabled;
|
|
95
|
-
$[18] = leftCalendarState;
|
|
96
|
-
$[19] = rightDate;
|
|
97
|
-
$[20] = t8;
|
|
98
|
-
} else t8 = $[20];
|
|
99
|
-
let t9;
|
|
100
|
-
if ($[21] !== handleLeftKeyboardNavigation || $[22] !== hoverDate || $[23] !== leftCalendarState || $[24] !== onApply || $[25] !== onDateHover || $[26] !== onDateSelection || $[27] !== rangeSelection) {
|
|
101
|
-
t9 = /* @__PURE__ */ jsx(CalendarGrid, {
|
|
102
|
-
state: leftCalendarState,
|
|
103
|
-
onApply,
|
|
104
|
-
shouldCloseOnSelect: false,
|
|
105
|
-
onDateSelection,
|
|
106
|
-
rangeSelection,
|
|
107
|
-
onDateHover,
|
|
108
|
-
hoverDate,
|
|
109
|
-
onKeyboardNavigation: handleLeftKeyboardNavigation,
|
|
110
|
-
className: "h-64 w-[304px]!",
|
|
111
|
-
calendarSide: "left"
|
|
112
|
-
});
|
|
113
|
-
$[21] = handleLeftKeyboardNavigation;
|
|
114
|
-
$[22] = hoverDate;
|
|
115
|
-
$[23] = leftCalendarState;
|
|
116
|
-
$[24] = onApply;
|
|
117
|
-
$[25] = onDateHover;
|
|
118
|
-
$[26] = onDateSelection;
|
|
119
|
-
$[27] = rangeSelection;
|
|
120
|
-
$[28] = t9;
|
|
121
|
-
} else t9 = $[28];
|
|
122
|
-
let t10;
|
|
123
|
-
if ($[29] !== leftCalendarAriaProps || $[30] !== t8 || $[31] !== t9) {
|
|
124
|
-
t10 = /* @__PURE__ */ jsxs("div", {
|
|
125
|
-
...leftCalendarAriaProps,
|
|
126
|
-
ref: leftRef,
|
|
127
|
-
className: "flex flex-col items-center",
|
|
128
|
-
children: [t8, t9]
|
|
129
|
-
});
|
|
130
|
-
$[29] = leftCalendarAriaProps;
|
|
131
|
-
$[30] = t8;
|
|
132
|
-
$[31] = t9;
|
|
133
|
-
$[32] = t10;
|
|
134
|
-
} else t10 = $[32];
|
|
135
|
-
let t11;
|
|
136
|
-
if ($[33] !== handleRightNavigate || $[34] !== isPrevDisabled || $[35] !== leftDate || $[36] !== rightCalendarState) {
|
|
137
|
-
t11 = /* @__PURE__ */ jsx(CalendarSelectHeader, {
|
|
138
|
-
state: rightCalendarState,
|
|
139
|
-
isPrevMonthDisabled: isPrevDisabled,
|
|
140
|
-
isPrevYearDisabled: isPrevDisabled,
|
|
141
|
-
onNavigate: handleRightNavigate,
|
|
142
|
-
minDate: leftDate
|
|
143
|
-
});
|
|
144
|
-
$[33] = handleRightNavigate;
|
|
145
|
-
$[34] = isPrevDisabled;
|
|
146
|
-
$[35] = leftDate;
|
|
147
|
-
$[36] = rightCalendarState;
|
|
148
|
-
$[37] = t11;
|
|
149
|
-
} else t11 = $[37];
|
|
150
|
-
let t12;
|
|
151
|
-
if ($[38] !== handleRightKeyboardNavigation || $[39] !== hoverDate || $[40] !== onApply || $[41] !== onDateHover || $[42] !== onDateSelection || $[43] !== rangeSelection || $[44] !== rightCalendarState) {
|
|
152
|
-
t12 = /* @__PURE__ */ jsx(CalendarGrid, {
|
|
153
|
-
state: rightCalendarState,
|
|
154
|
-
onApply,
|
|
155
|
-
shouldCloseOnSelect: false,
|
|
156
|
-
onDateSelection,
|
|
157
|
-
rangeSelection,
|
|
158
|
-
onDateHover,
|
|
159
|
-
hoverDate,
|
|
160
|
-
onKeyboardNavigation: handleRightKeyboardNavigation,
|
|
161
|
-
className: "h-64 w-[304px]!",
|
|
162
|
-
calendarSide: "right"
|
|
163
|
-
});
|
|
164
|
-
$[38] = handleRightKeyboardNavigation;
|
|
165
|
-
$[39] = hoverDate;
|
|
166
|
-
$[40] = onApply;
|
|
167
|
-
$[41] = onDateHover;
|
|
168
|
-
$[42] = onDateSelection;
|
|
169
|
-
$[43] = rangeSelection;
|
|
170
|
-
$[44] = rightCalendarState;
|
|
171
|
-
$[45] = t12;
|
|
172
|
-
} else t12 = $[45];
|
|
173
|
-
let t13;
|
|
174
|
-
if ($[46] !== rightCalendarAriaProps || $[47] !== t11 || $[48] !== t12) {
|
|
175
|
-
t13 = /* @__PURE__ */ jsxs("div", {
|
|
176
|
-
...rightCalendarAriaProps,
|
|
177
|
-
ref: rightRef,
|
|
178
|
-
className: "hidden flex-col items-center md:flex",
|
|
179
|
-
children: [t11, t12]
|
|
180
|
-
});
|
|
181
|
-
$[46] = rightCalendarAriaProps;
|
|
182
|
-
$[47] = t11;
|
|
183
|
-
$[48] = t12;
|
|
184
|
-
$[49] = t13;
|
|
185
|
-
} else t13 = $[49];
|
|
186
|
-
let t14;
|
|
187
|
-
if ($[50] !== t10 || $[51] !== t13) {
|
|
188
|
-
t14 = /* @__PURE__ */ jsxs("div", {
|
|
15
|
+
const handleLeftKeyboardNavigation = (event, date) => {
|
|
16
|
+
return onKeyboardNavigation?.(event, date, "left") ?? false;
|
|
17
|
+
};
|
|
18
|
+
const handleRightKeyboardNavigation = (event, date) => {
|
|
19
|
+
return onKeyboardNavigation?.(event, date, "right") ?? false;
|
|
20
|
+
};
|
|
21
|
+
const handleLeftNavigate = (newDate) => {
|
|
22
|
+
const rightCurrentDate = rightCalendarState.visibleRange.start;
|
|
23
|
+
if (newDate.year < rightCurrentDate.year || newDate.year === rightCurrentDate.year && newDate.month < rightCurrentDate.month) leftCalendarState.setFocusedDate(newDate);
|
|
24
|
+
else {
|
|
25
|
+
const closestValidDate = rightCurrentDate.subtract({ months: 1 });
|
|
26
|
+
leftCalendarState.setFocusedDate(closestValidDate);
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
const handleRightNavigate = (newDate) => {
|
|
30
|
+
const leftCurrentDate = leftCalendarState.visibleRange.start;
|
|
31
|
+
if (newDate.year > leftCurrentDate.year || newDate.year === leftCurrentDate.year && newDate.month > leftCurrentDate.month) rightCalendarState.setFocusedDate(newDate);
|
|
32
|
+
else {
|
|
33
|
+
const closestValidDate = leftCurrentDate.add({ months: 1 });
|
|
34
|
+
rightCalendarState.setFocusedDate(closestValidDate);
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
const isNextDisabled = useMemo(() => {
|
|
38
|
+
const leftNextDate = leftDate.add({ months: 1 });
|
|
39
|
+
return leftNextDate.year > rightDate.year || leftNextDate.year === rightDate.year && leftNextDate.month === rightDate.month;
|
|
40
|
+
}, [leftDate, rightDate]);
|
|
41
|
+
const isPrevDisabled = useMemo(() => {
|
|
42
|
+
const rightPrevDate = rightDate.subtract({ months: 1 });
|
|
43
|
+
return rightPrevDate.year < leftDate.year || rightPrevDate.year === leftDate.year && rightPrevDate.month === leftDate.month;
|
|
44
|
+
}, [leftDate, rightDate]);
|
|
45
|
+
return /* @__PURE__ */ jsx("div", {
|
|
46
|
+
className: clsx("flex w-fit flex-col items-center bg-elevation-fill-default-1", className),
|
|
47
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
189
48
|
className: "flex",
|
|
190
|
-
children: [
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
49
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
50
|
+
...leftCalendarAriaProps,
|
|
51
|
+
ref: leftRef,
|
|
52
|
+
className: "flex flex-col items-center",
|
|
53
|
+
children: [/* @__PURE__ */ jsx(CalendarSelectHeader, {
|
|
54
|
+
state: leftCalendarState,
|
|
55
|
+
isNextMonthDisabled: isNextDisabled,
|
|
56
|
+
isNextYearDisabled: isNextDisabled,
|
|
57
|
+
onNavigate: handleLeftNavigate,
|
|
58
|
+
maxDate: rightDate
|
|
59
|
+
}), /* @__PURE__ */ jsx(CalendarGrid, {
|
|
60
|
+
state: leftCalendarState,
|
|
61
|
+
onApply,
|
|
62
|
+
shouldCloseOnSelect: false,
|
|
63
|
+
onDateSelection,
|
|
64
|
+
rangeSelection,
|
|
65
|
+
onDateHover,
|
|
66
|
+
hoverDate,
|
|
67
|
+
onKeyboardNavigation: handleLeftKeyboardNavigation,
|
|
68
|
+
className: "h-64 w-[304px]!",
|
|
69
|
+
calendarSide: "left"
|
|
70
|
+
})]
|
|
71
|
+
}), /* @__PURE__ */ jsxs("div", {
|
|
72
|
+
...rightCalendarAriaProps,
|
|
73
|
+
ref: rightRef,
|
|
74
|
+
className: "hidden flex-col items-center md:flex",
|
|
75
|
+
children: [/* @__PURE__ */ jsx(CalendarSelectHeader, {
|
|
76
|
+
state: rightCalendarState,
|
|
77
|
+
isPrevMonthDisabled: isPrevDisabled,
|
|
78
|
+
isPrevYearDisabled: isPrevDisabled,
|
|
79
|
+
onNavigate: handleRightNavigate,
|
|
80
|
+
minDate: leftDate
|
|
81
|
+
}), /* @__PURE__ */ jsx(CalendarGrid, {
|
|
82
|
+
state: rightCalendarState,
|
|
83
|
+
onApply,
|
|
84
|
+
shouldCloseOnSelect: false,
|
|
85
|
+
onDateSelection,
|
|
86
|
+
rangeSelection,
|
|
87
|
+
onDateHover,
|
|
88
|
+
hoverDate,
|
|
89
|
+
onKeyboardNavigation: handleRightKeyboardNavigation,
|
|
90
|
+
className: "h-64 w-[304px]!",
|
|
91
|
+
calendarSide: "right"
|
|
92
|
+
})]
|
|
93
|
+
})]
|
|
94
|
+
})
|
|
95
|
+
});
|
|
207
96
|
};
|
|
208
97
|
//#endregion
|
|
209
98
|
export { RangeCalendar };
|
|
@@ -1,38 +1,19 @@
|
|
|
1
1
|
import { DateSegmentItem } from "./DateSegmentItem.js";
|
|
2
|
-
import { c } from "react/compiler-runtime";
|
|
3
2
|
import { jsx } from "react/jsx-runtime";
|
|
4
3
|
//#region src/components/inputs/DateTime/shared/TimeField.tsx
|
|
5
|
-
var TimeField = (
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
4
|
+
var TimeField = ({ ref, fieldProps, state, isDisabled, hidePlaceholder }) => {
|
|
5
|
+
return /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx("div", {
|
|
6
|
+
...fieldProps,
|
|
7
|
+
ref,
|
|
8
|
+
className: "flex",
|
|
9
|
+
children: state.segments.map((segment, i) => /* @__PURE__ */ jsx(DateSegmentItem, {
|
|
11
10
|
segment,
|
|
12
11
|
state,
|
|
13
12
|
isDisabled,
|
|
14
13
|
timePickerOnly: true,
|
|
15
14
|
hidePlaceholder
|
|
16
|
-
}, i))
|
|
17
|
-
|
|
18
|
-
$[1] = isDisabled;
|
|
19
|
-
$[2] = state;
|
|
20
|
-
$[3] = t1;
|
|
21
|
-
} else t1 = $[3];
|
|
22
|
-
let t2;
|
|
23
|
-
if ($[4] !== fieldProps || $[5] !== ref || $[6] !== t1) {
|
|
24
|
-
t2 = /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx("div", {
|
|
25
|
-
...fieldProps,
|
|
26
|
-
ref,
|
|
27
|
-
className: "flex",
|
|
28
|
-
children: t1
|
|
29
|
-
}) });
|
|
30
|
-
$[4] = fieldProps;
|
|
31
|
-
$[5] = ref;
|
|
32
|
-
$[6] = t1;
|
|
33
|
-
$[7] = t2;
|
|
34
|
-
} else t2 = $[7];
|
|
35
|
-
return t2;
|
|
15
|
+
}, i))
|
|
16
|
+
}) });
|
|
36
17
|
};
|
|
37
18
|
//#endregion
|
|
38
19
|
export { TimeField };
|