@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,167 +1,397 @@
|
|
|
1
|
-
import { CalendarIcon } from "../../../../assets/icons/Calendar.js";
|
|
2
|
-
import { DateTimeIcon } from "../../../../assets/icons/DateTime.js";
|
|
3
1
|
import { UIOverrides } from "../../../../config/uiOverrides.context.js";
|
|
4
2
|
import { Typography } from "../../../text/Typography/Typography.js";
|
|
5
|
-
import {
|
|
3
|
+
import { UIConfig } from "../../../../config/uiConfig.context.js";
|
|
6
4
|
import { InlineIconButton } from "../../../buttons/InlineIconButton/InlineIconButton.js";
|
|
7
|
-
import {
|
|
5
|
+
import { DateTimeUtils } from "../../../../utils/date-time.utils.js";
|
|
8
6
|
import { DateField } from "./DateField.js";
|
|
7
|
+
import { datePickerInputContentRowDefinition } from "./datePickerInput.cva.js";
|
|
8
|
+
import { renderDatePickerTodayIcon } from "./datePickerTodayIcon.js";
|
|
9
9
|
import { FormFieldLabel } from "../../FormField/FormFieldLabel.js";
|
|
10
10
|
import { InputClear } from "../../shared/InputClear.js";
|
|
11
11
|
import { inputBaseDefinition, inputSizeDefinition } from "../../shared/input.cva.js";
|
|
12
|
+
import { c } from "react/compiler-runtime";
|
|
12
13
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
13
14
|
import { clsx } from "clsx";
|
|
14
|
-
import {
|
|
15
|
+
import { useImperativeHandle, useRef, useState } from "react";
|
|
15
16
|
import { Button } from "react-aria-components";
|
|
16
17
|
import { useFocusVisible, useFocusWithin, useHover } from "react-aria";
|
|
17
|
-
import { getLocalTimeZone,
|
|
18
|
+
import { getLocalTimeZone, today } from "@internationalized/date";
|
|
18
19
|
//#region src/components/inputs/DateTime/shared/DatePickerInput.tsx
|
|
19
|
-
var DatePickerInput = (
|
|
20
|
+
var DatePickerInput = (t0) => {
|
|
21
|
+
const $ = c(96);
|
|
22
|
+
const { ref, as, groupProps, fieldProps, endFieldProps, fieldValue, endFieldValue, isValueControlled, hasValue, buttonProps, isDisabled, isInvalid, disableDropdown, variant, size, isDateTime, shouldShrinkInput, isClearable, headerProps, todayIcon, todayIconButtonSize: t1, todayIconButtonComponent, todayIconPlacement: t2, isDirty, isRequired, disableManualEntry, autoFixYear: t3, placeholder, className, onOpenDropdown, dateGranularity: t4, timeZone: timeZoneProp, isTimeOptional: t5, format, fireBlurOnChange, onClear: onClearProp, ...props } = t0;
|
|
23
|
+
const todayIconButtonSize = t1 === void 0 ? "none" : t1;
|
|
24
|
+
const todayIconPlacement = t2 === void 0 ? "content" : t2;
|
|
25
|
+
const autoFixYear = t3 === void 0 ? false : t3;
|
|
26
|
+
const dateGranularity = t4 === void 0 ? "day" : t4;
|
|
27
|
+
const isTimeOptional = t5 === void 0 ? false : t5;
|
|
28
|
+
const uiConfig = UIConfig.useConfig();
|
|
29
|
+
const timeZone = timeZoneProp ?? uiConfig.dateInput.timeZone;
|
|
20
30
|
let effectiveTimeZone = getLocalTimeZone();
|
|
21
|
-
if (timeZone) effectiveTimeZone = timeZone;
|
|
31
|
+
if (timeZone !== "clientLocal") effectiveTimeZone = timeZone;
|
|
22
32
|
const inputBaseCva = UIOverrides.useCva("input.baseCva", inputBaseDefinition);
|
|
23
33
|
const inputSizeCva = UIOverrides.useCva("input.sizeCva", inputSizeDefinition);
|
|
34
|
+
const datePickerInputContentRowCva = UIOverrides.useCva("datePickerInput.contentRowCva", datePickerInputContentRowDefinition);
|
|
24
35
|
const [canClear, setCanClear] = useState(false);
|
|
25
|
-
|
|
36
|
+
let t6;
|
|
37
|
+
if ($[0] !== isDisabled) {
|
|
38
|
+
t6 = { isDisabled };
|
|
39
|
+
$[0] = isDisabled;
|
|
40
|
+
$[1] = t6;
|
|
41
|
+
} else t6 = $[1];
|
|
42
|
+
const { hoverProps, isHovered } = useHover(t6);
|
|
26
43
|
const [isFocused, setIsFocused] = useState(false);
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
44
|
+
let t7;
|
|
45
|
+
if ($[2] !== autoFixYear) {
|
|
46
|
+
t7 = { onFocusWithinChange: (isFocusWithin) => {
|
|
47
|
+
setIsFocused(isFocusWithin);
|
|
48
|
+
if (!isFocusWithin && autoFixYear) {
|
|
49
|
+
dateFieldRef.current?.autoFixYear();
|
|
50
|
+
endDateFieldRef.current?.autoFixYear();
|
|
51
|
+
}
|
|
52
|
+
} };
|
|
53
|
+
$[2] = autoFixYear;
|
|
54
|
+
$[3] = t7;
|
|
55
|
+
} else t7 = $[3];
|
|
56
|
+
const { focusWithinProps } = useFocusWithin(t7);
|
|
34
57
|
const { isFocusVisible } = useFocusVisible();
|
|
35
58
|
const dateFieldRef = useRef(null);
|
|
36
59
|
const endDateFieldRef = useRef(null);
|
|
37
60
|
const containerRef = useRef(null);
|
|
38
|
-
|
|
39
|
-
|
|
61
|
+
const t8 = isValueControlled ? fieldValue ?? null : fieldProps.value ?? null;
|
|
62
|
+
let t9;
|
|
63
|
+
if ($[4] !== fieldProps || $[5] !== t8) {
|
|
64
|
+
t9 = {
|
|
65
|
+
...fieldProps,
|
|
66
|
+
value: t8
|
|
67
|
+
};
|
|
68
|
+
$[4] = fieldProps;
|
|
69
|
+
$[5] = t8;
|
|
70
|
+
$[6] = t9;
|
|
71
|
+
} else t9 = $[6];
|
|
72
|
+
const normalizedFieldProps = t9;
|
|
73
|
+
let t10;
|
|
74
|
+
if ($[7] !== endFieldProps || $[8] !== endFieldValue || $[9] !== isValueControlled) {
|
|
75
|
+
t10 = endFieldProps ? {
|
|
76
|
+
...endFieldProps,
|
|
77
|
+
value: isValueControlled ? endFieldValue ?? null : endFieldProps.value ?? null
|
|
78
|
+
} : void 0;
|
|
79
|
+
$[7] = endFieldProps;
|
|
80
|
+
$[8] = endFieldValue;
|
|
81
|
+
$[9] = isValueControlled;
|
|
82
|
+
$[10] = t10;
|
|
83
|
+
} else t10 = $[10];
|
|
84
|
+
const normalizedEndFieldProps = t10;
|
|
85
|
+
let t11;
|
|
86
|
+
if ($[11] !== endFieldProps || $[12] !== fieldProps || $[13] !== fireBlurOnChange || $[14] !== onClearProp) {
|
|
87
|
+
t11 = () => {
|
|
40
88
|
dateFieldRef.current?.clearField();
|
|
41
|
-
fieldProps.onChange?.(null);
|
|
42
89
|
endDateFieldRef.current?.clearField();
|
|
43
|
-
if (
|
|
90
|
+
if (onClearProp) onClearProp();
|
|
91
|
+
else {
|
|
92
|
+
fieldProps.onChange?.(null);
|
|
93
|
+
endFieldProps?.onChange?.(null);
|
|
94
|
+
if (fireBlurOnChange) {
|
|
95
|
+
fieldProps.onBlur?.(null);
|
|
96
|
+
endFieldProps?.onBlur?.(null);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
44
99
|
setCanClear(false);
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
}
|
|
52
|
-
const
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
100
|
+
};
|
|
101
|
+
$[11] = endFieldProps;
|
|
102
|
+
$[12] = fieldProps;
|
|
103
|
+
$[13] = fireBlurOnChange;
|
|
104
|
+
$[14] = onClearProp;
|
|
105
|
+
$[15] = t11;
|
|
106
|
+
} else t11 = $[15];
|
|
107
|
+
const clearInput = t11;
|
|
108
|
+
let t12;
|
|
109
|
+
let t13;
|
|
110
|
+
if ($[16] !== clearInput) {
|
|
111
|
+
t12 = () => ({
|
|
112
|
+
clear: clearInput,
|
|
113
|
+
getContainer: () => containerRef.current
|
|
114
|
+
});
|
|
115
|
+
t13 = [clearInput];
|
|
116
|
+
$[16] = clearInput;
|
|
117
|
+
$[17] = t12;
|
|
118
|
+
$[18] = t13;
|
|
119
|
+
} else {
|
|
120
|
+
t12 = $[17];
|
|
121
|
+
t13 = $[18];
|
|
122
|
+
}
|
|
123
|
+
useImperativeHandle(ref, t12, t13);
|
|
124
|
+
let t14;
|
|
125
|
+
if ($[19] === Symbol.for("react.memo_cache_sentinel")) {
|
|
126
|
+
t14 = (canClearInput) => {
|
|
127
|
+
setCanClear(canClearInput);
|
|
128
|
+
};
|
|
129
|
+
$[19] = t14;
|
|
130
|
+
} else t14 = $[19];
|
|
131
|
+
const onClearChange = t14;
|
|
132
|
+
const showClear = canClear || hasValue || normalizedFieldProps.value != null || normalizedEndFieldProps?.value != null;
|
|
133
|
+
const isTodayIconDisabled = isDisabled || buttonProps.isDisabled;
|
|
58
134
|
const onToday = () => {
|
|
135
|
+
if (isTodayIconDisabled) return;
|
|
59
136
|
if (isDateTime) {
|
|
60
|
-
const calendarDateTime =
|
|
137
|
+
const calendarDateTime = DateTimeUtils.getCurrentWallClockCalendarDateTime();
|
|
61
138
|
fieldProps.onChange?.(calendarDateTime);
|
|
62
139
|
if (endFieldProps) endFieldProps.onChange?.(calendarDateTime);
|
|
63
140
|
} else {
|
|
64
141
|
fieldProps.onChange?.(today(effectiveTimeZone));
|
|
65
142
|
if (endFieldProps) endFieldProps.onChange?.(today(effectiveTimeZone));
|
|
66
143
|
}
|
|
144
|
+
if (fireBlurOnChange) {
|
|
145
|
+
fieldProps.onBlur?.(null);
|
|
146
|
+
endFieldProps?.onBlur?.(null);
|
|
147
|
+
}
|
|
67
148
|
};
|
|
68
149
|
const hidePlaceholder = as === "floating" && !fieldProps.value && !isFocused;
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
...props
|
|
75
|
-
}), "group/date-picker-content relative flex min-w-input-width-min-width items-center justify-between gap-2", className),
|
|
76
|
-
"data-rac": "",
|
|
77
|
-
"data-datetime-input": "",
|
|
78
|
-
"data-hovered": isHovered || void 0,
|
|
79
|
-
"data-disabled": isDisabled || void 0,
|
|
80
|
-
"data-invalid": isInvalid || void 0,
|
|
81
|
-
"data-is-empty": fieldProps.value === null || void 0,
|
|
82
|
-
"data-focus-within": isFocused || void 0,
|
|
83
|
-
"data-focus-visible": isFocused && isFocusVisible || void 0,
|
|
84
|
-
"data-has-selection": fieldProps.value !== null || void 0,
|
|
85
|
-
"data-is-dirty": isDirty || void 0,
|
|
86
|
-
"data-is-required": isRequired || void 0,
|
|
87
|
-
...groupProps,
|
|
88
|
-
...focusWithinProps,
|
|
89
|
-
...hoverProps,
|
|
90
|
-
children: [/* @__PURE__ */ jsxs("div", {
|
|
91
|
-
className: clsx(inputSizeCva({
|
|
92
|
-
size,
|
|
93
|
-
as
|
|
94
|
-
}), "flex w-full items-center gap-input-gap-input-text-to-elements pr-0!"),
|
|
95
|
-
children: [as && ["filter", "floating"].includes(as) && headerProps && /* @__PURE__ */ jsx(FormFieldLabel, {
|
|
96
|
-
as,
|
|
97
|
-
...headerProps
|
|
98
|
-
}), /* @__PURE__ */ jsxs("div", {
|
|
99
|
-
className: "flex items-center gap-input-gap-input-text-to-elements",
|
|
100
|
-
children: [
|
|
101
|
-
disableManualEntry && /* @__PURE__ */ jsx(Button, {
|
|
102
|
-
onPress: onOpenDropdown,
|
|
103
|
-
className: "absolute inset-0 z-base",
|
|
104
|
-
isDisabled
|
|
105
|
-
}),
|
|
106
|
-
todayIcon && /* @__PURE__ */ jsx(IconButton, {
|
|
107
|
-
label: "",
|
|
108
|
-
icon: TodayIcon,
|
|
109
|
-
size: "none",
|
|
110
|
-
onPress: onToday,
|
|
111
|
-
className: "relative z-raised",
|
|
112
|
-
isDisabled
|
|
113
|
-
}),
|
|
114
|
-
disableManualEntry && placeholder && !fieldProps.value ? /* @__PURE__ */ jsx(Typography, {
|
|
115
|
-
size: "label-1",
|
|
116
|
-
className: "text-text-default-3",
|
|
117
|
-
children: placeholder
|
|
118
|
-
}) : /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(DateField, {
|
|
119
|
-
ref: dateFieldRef,
|
|
120
|
-
...fieldProps,
|
|
121
|
-
isDisabled,
|
|
122
|
-
isInvalid,
|
|
123
|
-
onClearChange,
|
|
124
|
-
hidePlaceholder,
|
|
125
|
-
disableManualEntry,
|
|
126
|
-
dateGranularity,
|
|
127
|
-
isTimeOptional,
|
|
128
|
-
format,
|
|
129
|
-
timeZone: effectiveTimeZone
|
|
130
|
-
}), endFieldProps && /* @__PURE__ */ jsxs(Fragment, { children: [!((as === "floating" || as === "filter") && hidePlaceholder) && /* @__PURE__ */ jsx("span", {
|
|
131
|
-
className: clsx("pointer-events-none select-none", isDisabled && "text-interactive-text-secondary-disabled"),
|
|
132
|
-
children: "–"
|
|
133
|
-
}), /* @__PURE__ */ jsx(DateField, {
|
|
134
|
-
ref: endDateFieldRef,
|
|
135
|
-
...endFieldProps,
|
|
136
|
-
isDisabled,
|
|
137
|
-
isInvalid,
|
|
138
|
-
onClearChange,
|
|
139
|
-
hidePlaceholder,
|
|
140
|
-
disableManualEntry,
|
|
141
|
-
isTimeOptional,
|
|
142
|
-
format,
|
|
143
|
-
timeZone: effectiveTimeZone
|
|
144
|
-
})] })] })
|
|
145
|
-
]
|
|
146
|
-
})]
|
|
147
|
-
}), /* @__PURE__ */ jsxs("div", {
|
|
148
|
-
className: clsx(inputSizeCva({
|
|
149
|
-
size,
|
|
150
|
-
as
|
|
151
|
-
}), "flex items-center gap-input-gap-trailing-elements py-0! pl-0!"),
|
|
152
|
-
children: [isClearable && /* @__PURE__ */ jsx(InputClear, {
|
|
153
|
-
onClear,
|
|
154
|
-
show: canClear
|
|
155
|
-
}), (!disableDropdown || disableManualEntry) && /* @__PURE__ */ jsx(InlineIconButton, {
|
|
156
|
-
label: "",
|
|
157
|
-
color: "secondary",
|
|
158
|
-
...buttonProps,
|
|
159
|
-
icon: isDateTime ? DateTimeIcon : CalendarIcon,
|
|
160
|
-
isDisabled,
|
|
161
|
-
className: "border-0!"
|
|
162
|
-
})]
|
|
163
|
-
})]
|
|
150
|
+
const todayIconButton = renderDatePickerTodayIcon(todayIcon, {
|
|
151
|
+
isDisabled: isTodayIconDisabled,
|
|
152
|
+
onPress: onToday,
|
|
153
|
+
size: todayIconButtonSize,
|
|
154
|
+
todayIconButtonComponent
|
|
164
155
|
});
|
|
156
|
+
const shouldRenderTodayIconWithFieldLabel = todayIconPlacement === "fieldLabel";
|
|
157
|
+
const pickerIcon = isDateTime ? uiConfig.dateInput.dateTimeIcon : uiConfig.dateInput.calendarIcon;
|
|
158
|
+
const t15 = clsx("group group/date-picker-content relative flex items-center justify-between gap-2", shouldShrinkInput ? "min-w-0" : "min-w-input-width-min-width", groupProps.className, inputBaseCva({
|
|
159
|
+
variant,
|
|
160
|
+
as,
|
|
161
|
+
...props
|
|
162
|
+
}), className);
|
|
163
|
+
const t16 = isHovered || void 0;
|
|
164
|
+
const t17 = isDisabled || void 0;
|
|
165
|
+
const t18 = isDisabled || void 0;
|
|
166
|
+
const t19 = isInvalid || void 0;
|
|
167
|
+
const t20 = normalizedFieldProps.value == null || void 0;
|
|
168
|
+
const t21 = isFocused || void 0;
|
|
169
|
+
const t22 = isFocused && isFocusVisible || void 0;
|
|
170
|
+
const t23 = normalizedFieldProps.value != null || void 0;
|
|
171
|
+
const t24 = isDirty || void 0;
|
|
172
|
+
const t25 = isRequired || void 0;
|
|
173
|
+
const t26 = normalizedFieldProps.value != null || void 0;
|
|
174
|
+
const t27 = shouldShrinkInput ? "min-w-0 flex-1 w-full" : "w-full";
|
|
175
|
+
let t28;
|
|
176
|
+
if ($[20] !== as || $[21] !== inputSizeCva || $[22] !== size || $[23] !== t27) {
|
|
177
|
+
t28 = clsx("flex items-center gap-input-gap-input-text-to-elements pr-0!", t27, inputSizeCva({
|
|
178
|
+
size,
|
|
179
|
+
as
|
|
180
|
+
}));
|
|
181
|
+
$[20] = as;
|
|
182
|
+
$[21] = inputSizeCva;
|
|
183
|
+
$[22] = size;
|
|
184
|
+
$[23] = t27;
|
|
185
|
+
$[24] = t28;
|
|
186
|
+
} else t28 = $[24];
|
|
187
|
+
let t29;
|
|
188
|
+
if ($[25] !== as || $[26] !== headerProps) {
|
|
189
|
+
t29 = as && ["filter", "floating"].includes(as) && headerProps && /* @__PURE__ */ jsx(FormFieldLabel, {
|
|
190
|
+
as,
|
|
191
|
+
...headerProps
|
|
192
|
+
});
|
|
193
|
+
$[25] = as;
|
|
194
|
+
$[26] = headerProps;
|
|
195
|
+
$[27] = t29;
|
|
196
|
+
} else t29 = $[27];
|
|
197
|
+
const t30 = shouldRenderTodayIconWithFieldLabel && todayIconButton;
|
|
198
|
+
let t31;
|
|
199
|
+
if ($[28] !== datePickerInputContentRowCva || $[29] !== size) {
|
|
200
|
+
t31 = datePickerInputContentRowCva({ size });
|
|
201
|
+
$[28] = datePickerInputContentRowCva;
|
|
202
|
+
$[29] = size;
|
|
203
|
+
$[30] = t31;
|
|
204
|
+
} else t31 = $[30];
|
|
205
|
+
let t32;
|
|
206
|
+
if ($[31] !== disableManualEntry || $[32] !== isDisabled || $[33] !== onOpenDropdown) {
|
|
207
|
+
t32 = disableManualEntry && /* @__PURE__ */ jsx(Button, {
|
|
208
|
+
onPress: onOpenDropdown,
|
|
209
|
+
className: "absolute inset-0 z-base",
|
|
210
|
+
isDisabled
|
|
211
|
+
});
|
|
212
|
+
$[31] = disableManualEntry;
|
|
213
|
+
$[32] = isDisabled;
|
|
214
|
+
$[33] = onOpenDropdown;
|
|
215
|
+
$[34] = t32;
|
|
216
|
+
} else t32 = $[34];
|
|
217
|
+
const t33 = !shouldRenderTodayIconWithFieldLabel && todayIconButton;
|
|
218
|
+
let t34;
|
|
219
|
+
if ($[35] !== as || $[36] !== dateGranularity || $[37] !== disableManualEntry || $[38] !== effectiveTimeZone || $[39] !== fieldProps || $[40] !== format || $[41] !== hidePlaceholder || $[42] !== isDisabled || $[43] !== isInvalid || $[44] !== isTimeOptional || $[45] !== normalizedEndFieldProps || $[46] !== normalizedFieldProps || $[47] !== onClearChange || $[48] !== placeholder) {
|
|
220
|
+
t34 = disableManualEntry && placeholder && !fieldProps.value ? /* @__PURE__ */ jsx(Typography, {
|
|
221
|
+
size: "label-1",
|
|
222
|
+
className: "text-text-default-3",
|
|
223
|
+
children: placeholder
|
|
224
|
+
}) : /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(DateField, {
|
|
225
|
+
ref: dateFieldRef,
|
|
226
|
+
...normalizedFieldProps,
|
|
227
|
+
isDisabled,
|
|
228
|
+
isInvalid,
|
|
229
|
+
onClearChange,
|
|
230
|
+
hidePlaceholder,
|
|
231
|
+
disableManualEntry,
|
|
232
|
+
dateGranularity,
|
|
233
|
+
isTimeOptional,
|
|
234
|
+
format,
|
|
235
|
+
timeZone: effectiveTimeZone,
|
|
236
|
+
segmentGroup: normalizedEndFieldProps ? "start" : void 0
|
|
237
|
+
}), normalizedEndFieldProps && /* @__PURE__ */ jsxs(Fragment, { children: [!((as === "floating" || as === "filter") && hidePlaceholder) && /* @__PURE__ */ jsx("span", {
|
|
238
|
+
className: clsx("pointer-events-none select-none", isDisabled && "text-interactive-text-secondary-disabled"),
|
|
239
|
+
children: "–"
|
|
240
|
+
}), /* @__PURE__ */ jsx(DateField, {
|
|
241
|
+
ref: endDateFieldRef,
|
|
242
|
+
...normalizedEndFieldProps,
|
|
243
|
+
isDisabled,
|
|
244
|
+
isInvalid,
|
|
245
|
+
onClearChange,
|
|
246
|
+
hidePlaceholder,
|
|
247
|
+
disableManualEntry,
|
|
248
|
+
isTimeOptional,
|
|
249
|
+
format,
|
|
250
|
+
timeZone: effectiveTimeZone,
|
|
251
|
+
segmentGroup: "end"
|
|
252
|
+
})] })] });
|
|
253
|
+
$[35] = as;
|
|
254
|
+
$[36] = dateGranularity;
|
|
255
|
+
$[37] = disableManualEntry;
|
|
256
|
+
$[38] = effectiveTimeZone;
|
|
257
|
+
$[39] = fieldProps;
|
|
258
|
+
$[40] = format;
|
|
259
|
+
$[41] = hidePlaceholder;
|
|
260
|
+
$[42] = isDisabled;
|
|
261
|
+
$[43] = isInvalid;
|
|
262
|
+
$[44] = isTimeOptional;
|
|
263
|
+
$[45] = normalizedEndFieldProps;
|
|
264
|
+
$[46] = normalizedFieldProps;
|
|
265
|
+
$[47] = onClearChange;
|
|
266
|
+
$[48] = placeholder;
|
|
267
|
+
$[49] = t34;
|
|
268
|
+
} else t34 = $[49];
|
|
269
|
+
let t35;
|
|
270
|
+
if ($[50] !== t31 || $[51] !== t32 || $[52] !== t33 || $[53] !== t34) {
|
|
271
|
+
t35 = /* @__PURE__ */ jsxs("div", {
|
|
272
|
+
className: t31,
|
|
273
|
+
children: [
|
|
274
|
+
t32,
|
|
275
|
+
t33,
|
|
276
|
+
t34
|
|
277
|
+
]
|
|
278
|
+
});
|
|
279
|
+
$[50] = t31;
|
|
280
|
+
$[51] = t32;
|
|
281
|
+
$[52] = t33;
|
|
282
|
+
$[53] = t34;
|
|
283
|
+
$[54] = t35;
|
|
284
|
+
} else t35 = $[54];
|
|
285
|
+
let t36;
|
|
286
|
+
if ($[55] !== t28 || $[56] !== t29 || $[57] !== t30 || $[58] !== t35) {
|
|
287
|
+
t36 = /* @__PURE__ */ jsxs("div", {
|
|
288
|
+
className: t28,
|
|
289
|
+
children: [
|
|
290
|
+
t29,
|
|
291
|
+
t30,
|
|
292
|
+
t35
|
|
293
|
+
]
|
|
294
|
+
});
|
|
295
|
+
$[55] = t28;
|
|
296
|
+
$[56] = t29;
|
|
297
|
+
$[57] = t30;
|
|
298
|
+
$[58] = t35;
|
|
299
|
+
$[59] = t36;
|
|
300
|
+
} else t36 = $[59];
|
|
301
|
+
let t37;
|
|
302
|
+
if ($[60] !== as || $[61] !== inputSizeCva || $[62] !== size) {
|
|
303
|
+
t37 = clsx(inputSizeCva({
|
|
304
|
+
size,
|
|
305
|
+
as
|
|
306
|
+
}), "flex items-center gap-input-gap-trailing-elements py-0! pl-0!");
|
|
307
|
+
$[60] = as;
|
|
308
|
+
$[61] = inputSizeCva;
|
|
309
|
+
$[62] = size;
|
|
310
|
+
$[63] = t37;
|
|
311
|
+
} else t37 = $[63];
|
|
312
|
+
let t38;
|
|
313
|
+
if ($[64] !== clearInput || $[65] !== isClearable || $[66] !== showClear) {
|
|
314
|
+
t38 = isClearable && /* @__PURE__ */ jsx(InputClear, {
|
|
315
|
+
onClear: clearInput,
|
|
316
|
+
show: showClear
|
|
317
|
+
});
|
|
318
|
+
$[64] = clearInput;
|
|
319
|
+
$[65] = isClearable;
|
|
320
|
+
$[66] = showClear;
|
|
321
|
+
$[67] = t38;
|
|
322
|
+
} else t38 = $[67];
|
|
323
|
+
let t39;
|
|
324
|
+
if ($[68] !== buttonProps || $[69] !== disableDropdown || $[70] !== disableManualEntry || $[71] !== isDisabled || $[72] !== pickerIcon) {
|
|
325
|
+
t39 = (!disableDropdown || disableManualEntry) && /* @__PURE__ */ jsx(InlineIconButton, {
|
|
326
|
+
label: "",
|
|
327
|
+
color: "secondary",
|
|
328
|
+
...buttonProps,
|
|
329
|
+
icon: pickerIcon,
|
|
330
|
+
isDisabled,
|
|
331
|
+
className: "border-0!",
|
|
332
|
+
"data-static-press-action": ""
|
|
333
|
+
});
|
|
334
|
+
$[68] = buttonProps;
|
|
335
|
+
$[69] = disableDropdown;
|
|
336
|
+
$[70] = disableManualEntry;
|
|
337
|
+
$[71] = isDisabled;
|
|
338
|
+
$[72] = pickerIcon;
|
|
339
|
+
$[73] = t39;
|
|
340
|
+
} else t39 = $[73];
|
|
341
|
+
let t40;
|
|
342
|
+
if ($[74] !== t37 || $[75] !== t38 || $[76] !== t39) {
|
|
343
|
+
t40 = /* @__PURE__ */ jsxs("div", {
|
|
344
|
+
className: t37,
|
|
345
|
+
children: [t38, t39]
|
|
346
|
+
});
|
|
347
|
+
$[74] = t37;
|
|
348
|
+
$[75] = t38;
|
|
349
|
+
$[76] = t39;
|
|
350
|
+
$[77] = t40;
|
|
351
|
+
} else t40 = $[77];
|
|
352
|
+
let t41;
|
|
353
|
+
if ($[78] !== focusWithinProps || $[79] !== groupProps || $[80] !== hoverProps || $[81] !== t15 || $[82] !== t16 || $[83] !== t17 || $[84] !== t18 || $[85] !== t19 || $[86] !== t20 || $[87] !== t21 || $[88] !== t22 || $[89] !== t23 || $[90] !== t24 || $[91] !== t25 || $[92] !== t26 || $[93] !== t36 || $[94] !== t40) {
|
|
354
|
+
t41 = /* @__PURE__ */ jsxs("div", {
|
|
355
|
+
ref: containerRef,
|
|
356
|
+
...groupProps,
|
|
357
|
+
...focusWithinProps,
|
|
358
|
+
...hoverProps,
|
|
359
|
+
className: t15,
|
|
360
|
+
"data-rac": "",
|
|
361
|
+
"data-datetime-input": "",
|
|
362
|
+
"data-hovered": t16,
|
|
363
|
+
"data-disabled": t17,
|
|
364
|
+
"data-is-disabled": t18,
|
|
365
|
+
"data-invalid": t19,
|
|
366
|
+
"data-is-empty": t20,
|
|
367
|
+
"data-focus-within": t21,
|
|
368
|
+
"data-focus-visible": t22,
|
|
369
|
+
"data-has-selection": t23,
|
|
370
|
+
"data-is-dirty": t24,
|
|
371
|
+
"data-is-required": t25,
|
|
372
|
+
"data-is-filled": t26,
|
|
373
|
+
children: [t36, t40]
|
|
374
|
+
});
|
|
375
|
+
$[78] = focusWithinProps;
|
|
376
|
+
$[79] = groupProps;
|
|
377
|
+
$[80] = hoverProps;
|
|
378
|
+
$[81] = t15;
|
|
379
|
+
$[82] = t16;
|
|
380
|
+
$[83] = t17;
|
|
381
|
+
$[84] = t18;
|
|
382
|
+
$[85] = t19;
|
|
383
|
+
$[86] = t20;
|
|
384
|
+
$[87] = t21;
|
|
385
|
+
$[88] = t22;
|
|
386
|
+
$[89] = t23;
|
|
387
|
+
$[90] = t24;
|
|
388
|
+
$[91] = t25;
|
|
389
|
+
$[92] = t26;
|
|
390
|
+
$[93] = t36;
|
|
391
|
+
$[94] = t40;
|
|
392
|
+
$[95] = t41;
|
|
393
|
+
} else t41 = $[95];
|
|
394
|
+
return t41;
|
|
165
395
|
};
|
|
166
396
|
//#endregion
|
|
167
397
|
export { DatePickerInput };
|
|
@@ -1,11 +1,28 @@
|
|
|
1
1
|
import { DateFieldState, DateSegment } from '@react-stately/datepicker';
|
|
2
|
+
import { HTMLAttributes, ReactNode, Ref } from 'react';
|
|
2
3
|
interface DateSegmentProps {
|
|
3
4
|
state: DateFieldState;
|
|
4
5
|
segment: DateSegment;
|
|
6
|
+
segmentGroup?: string;
|
|
5
7
|
isDisabled?: boolean;
|
|
6
8
|
timePickerOnly?: boolean;
|
|
7
9
|
hidePlaceholder?: boolean;
|
|
8
10
|
}
|
|
9
11
|
export declare const getPlaceholder: (segment: DateSegment) => string | null;
|
|
10
|
-
export declare const DateSegmentItem: ({ segment, state, isDisabled, timePickerOnly, hidePlaceholder }: DateSegmentProps) => import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export declare const DateSegmentItem: ({ segment, state, segmentGroup, isDisabled, timePickerOnly, hidePlaceholder, }: DateSegmentProps) => import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
interface DateSegmentItemViewProps {
|
|
14
|
+
ref?: Ref<HTMLDivElement>;
|
|
15
|
+
segmentProps?: HTMLAttributes<HTMLDivElement>;
|
|
16
|
+
role?: HTMLAttributes<HTMLDivElement>["role"];
|
|
17
|
+
type?: DateSegment["type"] | Intl.DateTimeFormatPartTypes;
|
|
18
|
+
text: ReactNode;
|
|
19
|
+
placeholder?: ReactNode;
|
|
20
|
+
isPlaceholder?: boolean;
|
|
21
|
+
segmentGroup?: string;
|
|
22
|
+
isInputEmpty?: boolean;
|
|
23
|
+
isDisabled?: boolean;
|
|
24
|
+
timePickerOnly?: boolean;
|
|
25
|
+
hidePlaceholder?: boolean;
|
|
26
|
+
}
|
|
27
|
+
export declare const DateSegmentItemView: ({ ref, segmentProps, role, type, text, placeholder, isPlaceholder, segmentGroup, isInputEmpty, isDisabled, timePickerOnly, hidePlaceholder, }: DateSegmentItemViewProps) => import("react/jsx-runtime").JSX.Element;
|
|
11
28
|
export {};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { c } from "react/compiler-runtime";
|
|
1
2
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
3
|
import { clsx } from "clsx";
|
|
3
4
|
import { useRef } from "react";
|
|
@@ -12,20 +13,112 @@ var getPlaceholder = (segment) => {
|
|
|
12
13
|
default: return segment.placeholder;
|
|
13
14
|
}
|
|
14
15
|
};
|
|
15
|
-
var DateSegmentItem = (
|
|
16
|
+
var DateSegmentItem = (t0) => {
|
|
17
|
+
const $ = c(13);
|
|
18
|
+
const { segment, state, segmentGroup, isDisabled, timePickerOnly, hidePlaceholder } = t0;
|
|
16
19
|
const ref = useRef(null);
|
|
17
20
|
const { segmentProps } = useDateSegment(segment, state, ref);
|
|
18
|
-
const
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
21
|
+
const t1 = segment.type;
|
|
22
|
+
const t2 = segment.text;
|
|
23
|
+
let t3;
|
|
24
|
+
if ($[0] !== segment) {
|
|
25
|
+
t3 = getPlaceholder(segment);
|
|
26
|
+
$[0] = segment;
|
|
27
|
+
$[1] = t3;
|
|
28
|
+
} else t3 = $[1];
|
|
29
|
+
const t4 = !state.value;
|
|
30
|
+
let t5;
|
|
31
|
+
if ($[2] !== hidePlaceholder || $[3] !== isDisabled || $[4] !== segment.isPlaceholder || $[5] !== segment.text || $[6] !== segment.type || $[7] !== segmentGroup || $[8] !== segmentProps || $[9] !== t3 || $[10] !== t4 || $[11] !== timePickerOnly) {
|
|
32
|
+
t5 = /* @__PURE__ */ jsx(DateSegmentItemView, {
|
|
33
|
+
ref,
|
|
34
|
+
segmentProps,
|
|
35
|
+
type: t1,
|
|
36
|
+
text: t2,
|
|
37
|
+
placeholder: t3,
|
|
38
|
+
isPlaceholder: segment.isPlaceholder,
|
|
39
|
+
segmentGroup,
|
|
40
|
+
isInputEmpty: t4,
|
|
41
|
+
isDisabled,
|
|
42
|
+
timePickerOnly,
|
|
43
|
+
hidePlaceholder
|
|
44
|
+
});
|
|
45
|
+
$[2] = hidePlaceholder;
|
|
46
|
+
$[3] = isDisabled;
|
|
47
|
+
$[4] = segment.isPlaceholder;
|
|
48
|
+
$[5] = segment.text;
|
|
49
|
+
$[6] = segment.type;
|
|
50
|
+
$[7] = segmentGroup;
|
|
51
|
+
$[8] = segmentProps;
|
|
52
|
+
$[9] = t3;
|
|
53
|
+
$[10] = t4;
|
|
54
|
+
$[11] = timePickerOnly;
|
|
55
|
+
$[12] = t5;
|
|
56
|
+
} else t5 = $[12];
|
|
57
|
+
return t5;
|
|
58
|
+
};
|
|
59
|
+
var DateSegmentItemView = (t0) => {
|
|
60
|
+
const $ = c(21);
|
|
61
|
+
const { ref, segmentProps, role, type, text, placeholder, isPlaceholder, segmentGroup, isInputEmpty, isDisabled, timePickerOnly, hidePlaceholder } = t0;
|
|
62
|
+
const t1 = role ?? segmentProps?.role;
|
|
63
|
+
const t2 = type === "literal" ? void 0 : type;
|
|
64
|
+
const t3 = type === "literal" ? void 0 : segmentGroup;
|
|
65
|
+
const t4 = isDisabled && isInputEmpty && "text-interactive-text-secondary-disabled";
|
|
66
|
+
const t5 = isDisabled && !isInputEmpty && "text-text-default-3";
|
|
67
|
+
const t6 = !isDisabled && isInputEmpty && "text-text-default-3 group-focus-within:text-text-default-1";
|
|
68
|
+
const t7 = !isDisabled && !isInputEmpty && "text-text-default-1";
|
|
69
|
+
const t8 = type && (type === "hour" && !timePickerOnly || type === "dayPeriod") && "ml-1";
|
|
70
|
+
const t9 = hidePlaceholder && "opacity-0";
|
|
71
|
+
let t10;
|
|
72
|
+
if ($[0] !== t4 || $[1] !== t5 || $[2] !== t6 || $[3] !== t7 || $[4] !== t8 || $[5] !== t9) {
|
|
73
|
+
t10 = clsx("box-content rounded-input-rounding-default", t4, t5, t6, t7, "focus-within:outline-1 focus-within:outline-interactive-contained-primary-idle focus-within:outline-offset-1", t8, t9);
|
|
74
|
+
$[0] = t4;
|
|
75
|
+
$[1] = t5;
|
|
76
|
+
$[2] = t6;
|
|
77
|
+
$[3] = t7;
|
|
78
|
+
$[4] = t8;
|
|
79
|
+
$[5] = t9;
|
|
80
|
+
$[6] = t10;
|
|
81
|
+
} else t10 = $[6];
|
|
82
|
+
let t11;
|
|
83
|
+
if ($[7] !== isPlaceholder || $[8] !== placeholder) {
|
|
84
|
+
t11 = isPlaceholder && /* @__PURE__ */ jsx("span", {
|
|
24
85
|
"aria-hidden": "true",
|
|
25
86
|
className: "pointer-events-none",
|
|
26
|
-
children:
|
|
27
|
-
})
|
|
28
|
-
|
|
87
|
+
children: placeholder
|
|
88
|
+
});
|
|
89
|
+
$[7] = isPlaceholder;
|
|
90
|
+
$[8] = placeholder;
|
|
91
|
+
$[9] = t11;
|
|
92
|
+
} else t11 = $[9];
|
|
93
|
+
const t12 = isPlaceholder ? "" : text;
|
|
94
|
+
let t13;
|
|
95
|
+
if ($[10] !== t11 || $[11] !== t12) {
|
|
96
|
+
t13 = /* @__PURE__ */ jsxs(Fragment, { children: [t11, t12] });
|
|
97
|
+
$[10] = t11;
|
|
98
|
+
$[11] = t12;
|
|
99
|
+
$[12] = t13;
|
|
100
|
+
} else t13 = $[12];
|
|
101
|
+
let t14;
|
|
102
|
+
if ($[13] !== ref || $[14] !== segmentProps || $[15] !== t1 || $[16] !== t10 || $[17] !== t13 || $[18] !== t2 || $[19] !== t3) {
|
|
103
|
+
t14 = /* @__PURE__ */ jsx("div", {
|
|
104
|
+
...segmentProps,
|
|
105
|
+
role: t1,
|
|
106
|
+
ref,
|
|
107
|
+
"data-static-segment-type": t2,
|
|
108
|
+
"data-static-segment-group": t3,
|
|
109
|
+
className: t10,
|
|
110
|
+
children: t13
|
|
111
|
+
});
|
|
112
|
+
$[13] = ref;
|
|
113
|
+
$[14] = segmentProps;
|
|
114
|
+
$[15] = t1;
|
|
115
|
+
$[16] = t10;
|
|
116
|
+
$[17] = t13;
|
|
117
|
+
$[18] = t2;
|
|
118
|
+
$[19] = t3;
|
|
119
|
+
$[20] = t14;
|
|
120
|
+
} else t14 = $[20];
|
|
121
|
+
return t14;
|
|
29
122
|
};
|
|
30
123
|
//#endregion
|
|
31
|
-
export { DateSegmentItem, getPlaceholder };
|
|
124
|
+
export { DateSegmentItem, DateSegmentItemView, getPlaceholder };
|