@povio/ui 3.0.0-rc.3 → 3.1.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/README.md +39 -0
- 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.d.ts +4 -0
- 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.d.ts +1 -1
- package/dist/components/Menu/MenuMobile.js +39 -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.d.ts +0 -1
- package/dist/components/inputs/Checkbox/Checkbox.js +35 -201
- 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 -12
- package/dist/components/inputs/DateTime/DatePicker/DatePicker.js +75 -373
- package/dist/components/inputs/DateTime/DateRangePicker/DateRangePicker.d.ts +5 -12
- package/dist/components/inputs/DateTime/DateRangePicker/DateRangePicker.js +186 -492
- package/dist/components/inputs/DateTime/DateTimePicker/DateTimePicker.d.ts +5 -14
- package/dist/components/inputs/DateTime/DateTimePicker/DateTimePicker.js +47 -273
- package/dist/components/inputs/DateTime/TimePicker/TimePicker.d.ts +3 -7
- package/dist/components/inputs/DateTime/TimePicker/TimePicker.js +121 -611
- package/dist/components/inputs/DateTime/shared/Calendar.d.ts +3 -5
- package/dist/components/inputs/DateTime/shared/Calendar.js +120 -338
- package/dist/components/inputs/DateTime/shared/CalendarCell.d.ts +2 -4
- package/dist/components/inputs/DateTime/shared/CalendarCell.js +103 -310
- package/dist/components/inputs/DateTime/shared/CalendarGrid.d.ts +2 -4
- package/dist/components/inputs/DateTime/shared/CalendarGrid.js +33 -150
- package/dist/components/inputs/DateTime/shared/CalendarHeader.d.ts +2 -1
- package/dist/components/inputs/DateTime/shared/CalendarHeader.js +98 -249
- package/dist/components/inputs/DateTime/shared/CalendarSelectHeader.js +137 -318
- package/dist/components/inputs/DateTime/shared/DateField.js +112 -286
- package/dist/components/inputs/DateTime/shared/DatePickerInput.d.ts +3 -14
- package/dist/components/inputs/DateTime/shared/DatePickerInput.js +129 -356
- package/dist/components/inputs/DateTime/shared/DateSegmentItem.d.ts +0 -15
- package/dist/components/inputs/DateTime/shared/DateSegmentItem.js +11 -96
- package/dist/components/inputs/DateTime/shared/DateTimeDialog.d.ts +4 -1
- package/dist/components/inputs/DateTime/shared/DateTimeDialog.js +28 -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 -4
- package/dist/components/inputs/DateTime/shared/TimePickerInput.js +65 -210
- package/dist/components/inputs/DateTime/shared/YearPicker.js +68 -119
- package/dist/components/inputs/File/FileUpload.js +45 -88
- 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.d.ts +2 -2
- package/dist/components/inputs/File/shared/ProgressBar.js +20 -53
- package/dist/components/inputs/File/shared/fileUpload.cva.d.ts +1 -1
- package/dist/components/inputs/File/shared/fileUpload.cva.js +1 -1
- package/dist/components/inputs/File/shared/progressBar.cva.d.ts +38 -0
- package/dist/components/inputs/File/shared/progressBar.cva.js +28 -0
- 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 +97 -447
- 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 +90 -419
- 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 -15
- package/dist/components/inputs/Inputs/InputItem.js +14 -69
- package/dist/components/inputs/Inputs/Inputs.js +11 -37
- package/dist/components/inputs/RadioGroup/RadioGroup.d.ts +1 -3
- package/dist/components/inputs/RadioGroup/RadioGroup.js +61 -353
- package/dist/components/inputs/RadioGroup/radio.cva.d.ts +0 -45
- package/dist/components/inputs/RadioGroup/radio.cva.js +1 -48
- package/dist/components/inputs/Selection/Autocomplete/Autocomplete.d.ts +2 -6
- package/dist/components/inputs/Selection/Autocomplete/Autocomplete.js +22 -217
- package/dist/components/inputs/Selection/Autocomplete/QueryAutocomplete.d.ts +18 -3
- package/dist/components/inputs/Selection/Autocomplete/QueryAutocomplete.js +8 -107
- package/dist/components/inputs/Selection/Select/Select.d.ts +3 -7
- package/dist/components/inputs/Selection/Select/Select.js +18 -227
- package/dist/components/inputs/Selection/shared/SelectBase.d.ts +3 -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 -397
- 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 +6 -11
- package/dist/components/inputs/Selection/shared/select.context.d.ts +2 -3
- package/dist/components/inputs/Selection/shared/select.context.js +36 -67
- 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.d.ts +1 -2
- package/dist/components/inputs/Slider/Slider.js +76 -265
- 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.d.ts +0 -1
- package/dist/components/inputs/Toggle/Toggle.js +37 -214
- 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 +12 -88
- package/dist/components/inputs/shared/TooltipWrapper.js +11 -50
- package/dist/components/inputs/shared/input.cva.d.ts +0 -28
- package/dist/components/inputs/shared/input.cva.js +4 -38
- 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 +25 -98
- package/dist/components/overlays/BottomSheet/BottomSheetHeader.js +8 -48
- package/dist/components/overlays/Drawer/Drawer.js +22 -64
- package/dist/components/overlays/Modal/modal.cva.js +1 -1
- package/dist/components/overlays/ResponsivePopover/ResponsivePopover.d.ts +5 -1
- package/dist/components/overlays/ResponsivePopover/ResponsivePopover.js +28 -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 +17 -22
- package/dist/components/status/Toast/toast.cva.d.ts +14 -3
- package/dist/components/status/Toast/toast.cva.js +12 -10
- 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 +30 -30
- package/dist/components/table/table.cva.d.ts +7 -0
- package/dist/components/table/table.cva.js +2 -1
- package/dist/components/text/Link/Link.js +7 -19
- package/dist/components/text/Pill/Pill.d.ts +15 -0
- package/dist/components/text/Pill/Pill.js +44 -0
- 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 +10 -21
- package/dist/config/uiConfig.context.js +18 -69
- package/dist/config/uiOverrides.context.d.ts +10 -20
- package/dist/config/uiOverrides.context.js +14 -54
- package/dist/helpers/dynamicInputs.d.ts +5 -5
- package/dist/helpers/dynamicInputs.js +0 -3
- package/dist/hooks/useAutosave.d.ts +1 -2
- package/dist/hooks/useAutosave.js +4 -12
- 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.d.ts +1 -3
- package/dist/hooks/useFormAutosave.js +30 -122
- 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 +7 -16
- package/dist/index.js +6 -13
- package/dist/tw-ui-plugin.js +0 -6
- package/dist/utils/date-time.utils.d.ts +10 -38
- package/dist/utils/date-time.utils.js +22 -136
- package/package.json +1 -1
- package/dist/components/inputs/DateTime/shared/datePicker.types.d.ts +0 -5
- package/dist/components/inputs/DateTime/shared/datePickerInput.cva.d.ts +0 -16
- package/dist/components/inputs/DateTime/shared/datePickerInput.cva.js +0 -16
- package/dist/components/inputs/DateTime/shared/datePickerTodayIcon.d.ts +0 -15
- package/dist/components/inputs/DateTime/shared/datePickerTodayIcon.js +0 -32
- 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 -40
- package/dist/components/inputs/DateTime/shared/staticDateTimeSegments.js +0 -85
- package/dist/components/inputs/DateTime/shared/staticDateTimeSegments.spec.d.ts +0 -1
- package/dist/components/inputs/FormField/formFieldHeader.cva.d.ts +0 -13
- package/dist/components/inputs/FormField/formFieldHeader.cva.js +0 -14
- 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 -575
- package/dist/components/inputs/Input/TextArea/TextArea.cva.d.ts +0 -8
- 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 -37
- package/dist/components/inputs/Selection/Select/QuerySelect.d.ts +0 -14
- package/dist/components/inputs/Selection/Select/QuerySelect.js +0 -178
- 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 -14
- package/dist/components/inputs/Selection/shared/querySelect.utils.js +0 -43
- package/dist/components/inputs/Selection/shared/selectDesktop.cva.d.ts +0 -6
- package/dist/components/inputs/Selection/shared/selectDesktop.cva.js +0 -5
- package/dist/components/inputs/Selection/shared/selectInput.cva.d.ts +0 -12
- package/dist/components/inputs/Selection/shared/selectInput.cva.js +0 -8
- package/dist/components/inputs/Selection/shared/staticSelect.utils.d.ts +0 -23
- package/dist/components/inputs/Selection/shared/staticSelect.utils.js +0 -54
- package/dist/components/inputs/Selection/shared/staticSelect.utils.spec.d.ts +0 -1
- package/dist/components/inputs/Skeleton/InputFrame.d.ts +0 -82
- package/dist/components/inputs/Skeleton/InputFrame.js +0 -548
- package/dist/components/inputs/shared/tooltipWrapper.cva.d.ts +0 -8
- 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/useAutosave.spec.d.ts +0 -1
- package/dist/hooks/useFormAutosave.spec.d.ts +0 -1
- package/dist/hooks/useKeyInteractions.d.ts +0 -20
- package/dist/hooks/useKeyInteractions.js +0 -54
- package/dist/hooks/useKeyInteractions.spec.d.ts +0 -1
- package/dist/hooks/useQueryAutocomplete.d.ts +0 -14
- package/dist/hooks/useQueryAutocomplete.js +0 -72
- package/dist/utils/query.utils.d.ts +0 -4
- package/dist/utils/query.utils.js +0 -8
|
@@ -1,394 +1,167 @@
|
|
|
1
|
+
import { CalendarIcon } from "../../../../assets/icons/Calendar.js";
|
|
2
|
+
import { DateTimeIcon } from "../../../../assets/icons/DateTime.js";
|
|
1
3
|
import { UIOverrides } from "../../../../config/uiOverrides.context.js";
|
|
2
4
|
import { Typography } from "../../../text/Typography/Typography.js";
|
|
3
|
-
import {
|
|
5
|
+
import { IconButton } from "../../../buttons/IconButton/IconButton.js";
|
|
4
6
|
import { InlineIconButton } from "../../../buttons/InlineIconButton/InlineIconButton.js";
|
|
5
|
-
import {
|
|
7
|
+
import { TodayIcon } from "../../../../assets/icons/Today.js";
|
|
6
8
|
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";
|
|
13
12
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
14
13
|
import { clsx } from "clsx";
|
|
15
|
-
import { useImperativeHandle, useRef, useState } from "react";
|
|
14
|
+
import { useCallback, useImperativeHandle, useRef, useState } from "react";
|
|
16
15
|
import { Button } from "react-aria-components";
|
|
17
16
|
import { useFocusVisible, useFocusWithin, useHover } from "react-aria";
|
|
18
|
-
import { getLocalTimeZone, today } from "@internationalized/date";
|
|
17
|
+
import { getLocalTimeZone, now, toCalendarDateTime, today } from "@internationalized/date";
|
|
19
18
|
//#region src/components/inputs/DateTime/shared/DatePickerInput.tsx
|
|
20
|
-
var DatePickerInput = (
|
|
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;
|
|
19
|
+
var DatePickerInput = ({ ref, as, groupProps, fieldProps, endFieldProps, buttonProps, isDisabled, isInvalid, disableDropdown, variant, size, isDateTime, isClearable, headerProps, todayIcon, isDirty, isRequired, disableManualEntry, placeholder, className, onOpenDropdown, dateGranularity = "day", timeZone, autoFixYear, isTimeOptional = false, format, ...props }) => {
|
|
30
20
|
let effectiveTimeZone = getLocalTimeZone();
|
|
31
|
-
if (timeZone
|
|
21
|
+
if (timeZone) effectiveTimeZone = timeZone;
|
|
32
22
|
const inputBaseCva = UIOverrides.useCva("input.baseCva", inputBaseDefinition);
|
|
33
23
|
const inputSizeCva = UIOverrides.useCva("input.sizeCva", inputSizeDefinition);
|
|
34
|
-
const datePickerInputContentRowCva = UIOverrides.useCva("datePickerInput.contentRowCva", datePickerInputContentRowDefinition);
|
|
35
24
|
const [canClear, setCanClear] = useState(false);
|
|
36
|
-
|
|
37
|
-
if ($[0] !== isDisabled) {
|
|
38
|
-
t6 = { isDisabled };
|
|
39
|
-
$[0] = isDisabled;
|
|
40
|
-
$[1] = t6;
|
|
41
|
-
} else t6 = $[1];
|
|
42
|
-
const { hoverProps, isHovered } = useHover(t6);
|
|
25
|
+
const { hoverProps, isHovered } = useHover({ isDisabled });
|
|
43
26
|
const [isFocused, setIsFocused] = useState(false);
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
}
|
|
52
|
-
} };
|
|
53
|
-
$[2] = autoFixYear;
|
|
54
|
-
$[3] = t7;
|
|
55
|
-
} else t7 = $[3];
|
|
56
|
-
const { focusWithinProps } = useFocusWithin(t7);
|
|
27
|
+
const { focusWithinProps } = useFocusWithin({ onFocusWithinChange: (isFocusWithin) => {
|
|
28
|
+
setIsFocused(isFocusWithin);
|
|
29
|
+
if (!isFocusWithin && autoFixYear) {
|
|
30
|
+
dateFieldRef.current?.autoFixYear();
|
|
31
|
+
endDateFieldRef.current?.autoFixYear();
|
|
32
|
+
}
|
|
33
|
+
} });
|
|
57
34
|
const { isFocusVisible } = useFocusVisible();
|
|
58
35
|
const dateFieldRef = useRef(null);
|
|
59
36
|
const endDateFieldRef = useRef(null);
|
|
60
37
|
const containerRef = useRef(null);
|
|
61
|
-
|
|
62
|
-
|
|
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 = () => {
|
|
38
|
+
useImperativeHandle(ref, () => ({
|
|
39
|
+
clear: () => {
|
|
88
40
|
dateFieldRef.current?.clearField();
|
|
41
|
+
fieldProps.onChange?.(null);
|
|
89
42
|
endDateFieldRef.current?.clearField();
|
|
90
|
-
if (
|
|
91
|
-
else {
|
|
92
|
-
fieldProps.onChange?.(null);
|
|
93
|
-
endFieldProps?.onChange?.(null);
|
|
94
|
-
if (fireBlurOnChange) {
|
|
95
|
-
fieldProps.onBlur?.(null);
|
|
96
|
-
endFieldProps?.onBlur?.(null);
|
|
97
|
-
}
|
|
98
|
-
}
|
|
43
|
+
if (endFieldProps) endFieldProps.onChange?.(null);
|
|
99
44
|
setCanClear(false);
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
}
|
|
107
|
-
const
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
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;
|
|
45
|
+
fieldProps.onBlur?.(null);
|
|
46
|
+
},
|
|
47
|
+
getContainer: () => containerRef.current
|
|
48
|
+
}));
|
|
49
|
+
const onClearChange = useCallback((canClearInput) => {
|
|
50
|
+
setCanClear(canClearInput);
|
|
51
|
+
}, []);
|
|
52
|
+
const onClear = () => {
|
|
53
|
+
dateFieldRef.current?.clearField();
|
|
54
|
+
fieldProps.onChange?.(null);
|
|
55
|
+
endDateFieldRef.current?.clearField();
|
|
56
|
+
setCanClear(false);
|
|
57
|
+
};
|
|
134
58
|
const onToday = () => {
|
|
135
|
-
if (isTodayIconDisabled) return;
|
|
136
59
|
if (isDateTime) {
|
|
137
|
-
const calendarDateTime =
|
|
60
|
+
const calendarDateTime = toCalendarDateTime(now(effectiveTimeZone));
|
|
138
61
|
fieldProps.onChange?.(calendarDateTime);
|
|
139
62
|
if (endFieldProps) endFieldProps.onChange?.(calendarDateTime);
|
|
140
63
|
} else {
|
|
141
64
|
fieldProps.onChange?.(today(effectiveTimeZone));
|
|
142
65
|
if (endFieldProps) endFieldProps.onChange?.(today(effectiveTimeZone));
|
|
143
66
|
}
|
|
144
|
-
if (fireBlurOnChange) {
|
|
145
|
-
fieldProps.onBlur?.(null);
|
|
146
|
-
endFieldProps?.onBlur?.(null);
|
|
147
|
-
}
|
|
148
67
|
};
|
|
149
68
|
const hidePlaceholder = as === "floating" && !fieldProps.value && !isFocused;
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
todayIconButtonComponent
|
|
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, {
|
|
69
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
70
|
+
ref: containerRef,
|
|
71
|
+
className: clsx(inputBaseCva({
|
|
72
|
+
variant,
|
|
190
73
|
as,
|
|
191
|
-
...
|
|
192
|
-
})
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
} else t35 = $[54];
|
|
283
|
-
let t36;
|
|
284
|
-
if ($[55] !== t28 || $[56] !== t29 || $[57] !== t30 || $[58] !== t35) {
|
|
285
|
-
t36 = /* @__PURE__ */ jsxs("div", {
|
|
286
|
-
className: t28,
|
|
287
|
-
children: [
|
|
288
|
-
t29,
|
|
289
|
-
t30,
|
|
290
|
-
t35
|
|
291
|
-
]
|
|
292
|
-
});
|
|
293
|
-
$[55] = t28;
|
|
294
|
-
$[56] = t29;
|
|
295
|
-
$[57] = t30;
|
|
296
|
-
$[58] = t35;
|
|
297
|
-
$[59] = t36;
|
|
298
|
-
} else t36 = $[59];
|
|
299
|
-
let t37;
|
|
300
|
-
if ($[60] !== as || $[61] !== inputSizeCva || $[62] !== size) {
|
|
301
|
-
t37 = clsx(inputSizeCva({
|
|
302
|
-
size,
|
|
303
|
-
as
|
|
304
|
-
}), "flex items-center gap-input-gap-trailing-elements py-0! pl-0!");
|
|
305
|
-
$[60] = as;
|
|
306
|
-
$[61] = inputSizeCva;
|
|
307
|
-
$[62] = size;
|
|
308
|
-
$[63] = t37;
|
|
309
|
-
} else t37 = $[63];
|
|
310
|
-
let t38;
|
|
311
|
-
if ($[64] !== clearInput || $[65] !== isClearable || $[66] !== showClear) {
|
|
312
|
-
t38 = isClearable && /* @__PURE__ */ jsx(InputClear, {
|
|
313
|
-
onClear: clearInput,
|
|
314
|
-
show: showClear
|
|
315
|
-
});
|
|
316
|
-
$[64] = clearInput;
|
|
317
|
-
$[65] = isClearable;
|
|
318
|
-
$[66] = showClear;
|
|
319
|
-
$[67] = t38;
|
|
320
|
-
} else t38 = $[67];
|
|
321
|
-
let t39;
|
|
322
|
-
if ($[68] !== buttonProps || $[69] !== disableDropdown || $[70] !== disableManualEntry || $[71] !== isDisabled || $[72] !== pickerIcon) {
|
|
323
|
-
t39 = (!disableDropdown || disableManualEntry) && /* @__PURE__ */ jsx(InlineIconButton, {
|
|
324
|
-
label: "",
|
|
325
|
-
color: "secondary",
|
|
326
|
-
...buttonProps,
|
|
327
|
-
icon: pickerIcon,
|
|
328
|
-
isDisabled,
|
|
329
|
-
className: "border-0!"
|
|
330
|
-
});
|
|
331
|
-
$[68] = buttonProps;
|
|
332
|
-
$[69] = disableDropdown;
|
|
333
|
-
$[70] = disableManualEntry;
|
|
334
|
-
$[71] = isDisabled;
|
|
335
|
-
$[72] = pickerIcon;
|
|
336
|
-
$[73] = t39;
|
|
337
|
-
} else t39 = $[73];
|
|
338
|
-
let t40;
|
|
339
|
-
if ($[74] !== t37 || $[75] !== t38 || $[76] !== t39) {
|
|
340
|
-
t40 = /* @__PURE__ */ jsxs("div", {
|
|
341
|
-
className: t37,
|
|
342
|
-
children: [t38, t39]
|
|
343
|
-
});
|
|
344
|
-
$[74] = t37;
|
|
345
|
-
$[75] = t38;
|
|
346
|
-
$[76] = t39;
|
|
347
|
-
$[77] = t40;
|
|
348
|
-
} else t40 = $[77];
|
|
349
|
-
let t41;
|
|
350
|
-
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) {
|
|
351
|
-
t41 = /* @__PURE__ */ jsxs("div", {
|
|
352
|
-
ref: containerRef,
|
|
353
|
-
...groupProps,
|
|
354
|
-
...focusWithinProps,
|
|
355
|
-
...hoverProps,
|
|
356
|
-
className: t15,
|
|
357
|
-
"data-rac": "",
|
|
358
|
-
"data-datetime-input": "",
|
|
359
|
-
"data-hovered": t16,
|
|
360
|
-
"data-disabled": t17,
|
|
361
|
-
"data-is-disabled": t18,
|
|
362
|
-
"data-invalid": t19,
|
|
363
|
-
"data-is-empty": t20,
|
|
364
|
-
"data-focus-within": t21,
|
|
365
|
-
"data-focus-visible": t22,
|
|
366
|
-
"data-has-selection": t23,
|
|
367
|
-
"data-is-dirty": t24,
|
|
368
|
-
"data-is-required": t25,
|
|
369
|
-
"data-is-filled": t26,
|
|
370
|
-
children: [t36, t40]
|
|
371
|
-
});
|
|
372
|
-
$[78] = focusWithinProps;
|
|
373
|
-
$[79] = groupProps;
|
|
374
|
-
$[80] = hoverProps;
|
|
375
|
-
$[81] = t15;
|
|
376
|
-
$[82] = t16;
|
|
377
|
-
$[83] = t17;
|
|
378
|
-
$[84] = t18;
|
|
379
|
-
$[85] = t19;
|
|
380
|
-
$[86] = t20;
|
|
381
|
-
$[87] = t21;
|
|
382
|
-
$[88] = t22;
|
|
383
|
-
$[89] = t23;
|
|
384
|
-
$[90] = t24;
|
|
385
|
-
$[91] = t25;
|
|
386
|
-
$[92] = t26;
|
|
387
|
-
$[93] = t36;
|
|
388
|
-
$[94] = t40;
|
|
389
|
-
$[95] = t41;
|
|
390
|
-
} else t41 = $[95];
|
|
391
|
-
return t41;
|
|
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
|
+
})]
|
|
164
|
+
});
|
|
392
165
|
};
|
|
393
166
|
//#endregion
|
|
394
167
|
export { DatePickerInput };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { DateFieldState, DateSegment } from '@react-stately/datepicker';
|
|
2
|
-
import { HTMLAttributes, ReactNode, Ref } from 'react';
|
|
3
2
|
interface DateSegmentProps {
|
|
4
3
|
state: DateFieldState;
|
|
5
4
|
segment: DateSegment;
|
|
@@ -9,18 +8,4 @@ interface DateSegmentProps {
|
|
|
9
8
|
}
|
|
10
9
|
export declare const getPlaceholder: (segment: DateSegment) => string | null;
|
|
11
10
|
export declare const DateSegmentItem: ({ segment, state, isDisabled, timePickerOnly, hidePlaceholder }: DateSegmentProps) => import("react/jsx-runtime").JSX.Element;
|
|
12
|
-
interface DateSegmentItemViewProps {
|
|
13
|
-
ref?: Ref<HTMLDivElement>;
|
|
14
|
-
segmentProps?: HTMLAttributes<HTMLDivElement>;
|
|
15
|
-
role?: HTMLAttributes<HTMLDivElement>["role"];
|
|
16
|
-
type?: DateSegment["type"] | Intl.DateTimeFormatPartTypes;
|
|
17
|
-
text: ReactNode;
|
|
18
|
-
placeholder?: ReactNode;
|
|
19
|
-
isPlaceholder?: boolean;
|
|
20
|
-
isInputEmpty?: boolean;
|
|
21
|
-
isDisabled?: boolean;
|
|
22
|
-
timePickerOnly?: boolean;
|
|
23
|
-
hidePlaceholder?: boolean;
|
|
24
|
-
}
|
|
25
|
-
export declare const DateSegmentItemView: ({ ref, segmentProps, role, type, text, placeholder, isPlaceholder, isInputEmpty, isDisabled, timePickerOnly, hidePlaceholder, }: DateSegmentItemViewProps) => import("react/jsx-runtime").JSX.Element;
|
|
26
11
|
export {};
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { c } from "react/compiler-runtime";
|
|
2
1
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
3
2
|
import { clsx } from "clsx";
|
|
4
3
|
import { useRef } from "react";
|
|
@@ -13,104 +12,20 @@ var getPlaceholder = (segment) => {
|
|
|
13
12
|
default: return segment.placeholder;
|
|
14
13
|
}
|
|
15
14
|
};
|
|
16
|
-
var DateSegmentItem = (
|
|
17
|
-
const $ = c(12);
|
|
18
|
-
const { segment, state, isDisabled, timePickerOnly, hidePlaceholder } = t0;
|
|
15
|
+
var DateSegmentItem = ({ segment, state, isDisabled, timePickerOnly, hidePlaceholder }) => {
|
|
19
16
|
const ref = useRef(null);
|
|
20
17
|
const { segmentProps } = useDateSegment(segment, state, ref);
|
|
21
|
-
const
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
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] !== segmentProps || $[8] !== t3 || $[9] !== t4 || $[10] !== timePickerOnly) {
|
|
32
|
-
t5 = /* @__PURE__ */ jsx(DateSegmentItemView, {
|
|
33
|
-
ref,
|
|
34
|
-
segmentProps,
|
|
35
|
-
type: t1,
|
|
36
|
-
text: t2,
|
|
37
|
-
placeholder: t3,
|
|
38
|
-
isPlaceholder: segment.isPlaceholder,
|
|
39
|
-
isInputEmpty: t4,
|
|
40
|
-
isDisabled,
|
|
41
|
-
timePickerOnly,
|
|
42
|
-
hidePlaceholder
|
|
43
|
-
});
|
|
44
|
-
$[2] = hidePlaceholder;
|
|
45
|
-
$[3] = isDisabled;
|
|
46
|
-
$[4] = segment.isPlaceholder;
|
|
47
|
-
$[5] = segment.text;
|
|
48
|
-
$[6] = segment.type;
|
|
49
|
-
$[7] = segmentProps;
|
|
50
|
-
$[8] = t3;
|
|
51
|
-
$[9] = t4;
|
|
52
|
-
$[10] = timePickerOnly;
|
|
53
|
-
$[11] = t5;
|
|
54
|
-
} else t5 = $[11];
|
|
55
|
-
return t5;
|
|
56
|
-
};
|
|
57
|
-
var DateSegmentItemView = (t0) => {
|
|
58
|
-
const $ = c(19);
|
|
59
|
-
const { ref, segmentProps, role, type, text, placeholder, isPlaceholder, isInputEmpty, isDisabled, timePickerOnly, hidePlaceholder } = t0;
|
|
60
|
-
const t1 = role ?? segmentProps?.role;
|
|
61
|
-
const t2 = isDisabled && isInputEmpty && "text-interactive-text-secondary-disabled";
|
|
62
|
-
const t3 = isDisabled && !isInputEmpty && "text-text-default-3";
|
|
63
|
-
const t4 = !isDisabled && isInputEmpty && "text-text-default-3 group-focus-within:text-text-default-1";
|
|
64
|
-
const t5 = !isDisabled && !isInputEmpty && "text-text-default-1";
|
|
65
|
-
const t6 = type && (type === "hour" && !timePickerOnly || type === "dayPeriod") && "ml-1";
|
|
66
|
-
const t7 = hidePlaceholder && "opacity-0";
|
|
67
|
-
let t8;
|
|
68
|
-
if ($[0] !== t2 || $[1] !== t3 || $[2] !== t4 || $[3] !== t5 || $[4] !== t6 || $[5] !== t7) {
|
|
69
|
-
t8 = clsx("box-content rounded-input-rounding-default", t2, t3, t4, t5, "focus-within:outline-1 focus-within:outline-interactive-contained-primary-idle focus-within:outline-offset-1", t6, t7);
|
|
70
|
-
$[0] = t2;
|
|
71
|
-
$[1] = t3;
|
|
72
|
-
$[2] = t4;
|
|
73
|
-
$[3] = t5;
|
|
74
|
-
$[4] = t6;
|
|
75
|
-
$[5] = t7;
|
|
76
|
-
$[6] = t8;
|
|
77
|
-
} else t8 = $[6];
|
|
78
|
-
let t9;
|
|
79
|
-
if ($[7] !== isPlaceholder || $[8] !== placeholder) {
|
|
80
|
-
t9 = isPlaceholder && /* @__PURE__ */ jsx("span", {
|
|
18
|
+
const isInputEmpty = !state.value;
|
|
19
|
+
return /* @__PURE__ */ jsx("div", {
|
|
20
|
+
...segmentProps,
|
|
21
|
+
ref,
|
|
22
|
+
className: clsx("box-content rounded-input-rounding-default", isDisabled && isInputEmpty && "text-interactive-text-secondary-disabled", isDisabled && !isInputEmpty && "text-text-default-3", !isDisabled && isInputEmpty && "text-text-default-3 group-focus-within:text-text-default-1", !isDisabled && !isInputEmpty && "text-text-default-1", "focus-within:outline-1 focus-within:outline-interactive-contained-primary-idle focus-within:outline-offset-1", ["hour", "dayPeriod"].includes(segment.type) && !timePickerOnly && "ml-1", hidePlaceholder && "opacity-0"),
|
|
23
|
+
children: /* @__PURE__ */ jsxs(Fragment, { children: [segment.isPlaceholder && /* @__PURE__ */ jsx("span", {
|
|
81
24
|
"aria-hidden": "true",
|
|
82
25
|
className: "pointer-events-none",
|
|
83
|
-
children:
|
|
84
|
-
})
|
|
85
|
-
|
|
86
|
-
$[8] = placeholder;
|
|
87
|
-
$[9] = t9;
|
|
88
|
-
} else t9 = $[9];
|
|
89
|
-
const t10 = isPlaceholder ? "" : text;
|
|
90
|
-
let t11;
|
|
91
|
-
if ($[10] !== t10 || $[11] !== t9) {
|
|
92
|
-
t11 = /* @__PURE__ */ jsxs(Fragment, { children: [t9, t10] });
|
|
93
|
-
$[10] = t10;
|
|
94
|
-
$[11] = t9;
|
|
95
|
-
$[12] = t11;
|
|
96
|
-
} else t11 = $[12];
|
|
97
|
-
let t12;
|
|
98
|
-
if ($[13] !== ref || $[14] !== segmentProps || $[15] !== t1 || $[16] !== t11 || $[17] !== t8) {
|
|
99
|
-
t12 = /* @__PURE__ */ jsx("div", {
|
|
100
|
-
...segmentProps,
|
|
101
|
-
role: t1,
|
|
102
|
-
ref,
|
|
103
|
-
className: t8,
|
|
104
|
-
children: t11
|
|
105
|
-
});
|
|
106
|
-
$[13] = ref;
|
|
107
|
-
$[14] = segmentProps;
|
|
108
|
-
$[15] = t1;
|
|
109
|
-
$[16] = t11;
|
|
110
|
-
$[17] = t8;
|
|
111
|
-
$[18] = t12;
|
|
112
|
-
} else t12 = $[18];
|
|
113
|
-
return t12;
|
|
26
|
+
children: getPlaceholder(segment)
|
|
27
|
+
}), segment.isPlaceholder ? "" : segment.text] })
|
|
28
|
+
});
|
|
114
29
|
};
|
|
115
30
|
//#endregion
|
|
116
|
-
export { DateSegmentItem,
|
|
31
|
+
export { DateSegmentItem, getPlaceholder };
|