@povio/ui 2.3.0-rc.3 → 2.3.0-rc.31
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 +97 -38
- package/dist/components/Menu/MenuPopover.js +105 -29
- package/dist/components/buttons/IconButton/IconButton.js +40 -8
- package/dist/components/buttons/InlineIconButton/InlineIconButton.js +34 -9
- package/dist/components/buttons/PillButton/PillButton.js +55 -17
- 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 +188 -34
- package/dist/components/inputs/Checkbox/CheckboxCheckmark.js +24 -10
- package/dist/components/inputs/DateTime/DatePicker/DatePicker.d.ts +1 -0
- package/dist/components/inputs/DateTime/DatePicker/DatePicker.js +267 -87
- package/dist/components/inputs/DateTime/DateRangePicker/DateRangePicker.d.ts +1 -0
- package/dist/components/inputs/DateTime/DateRangePicker/DateRangePicker.js +347 -182
- package/dist/components/inputs/DateTime/DateTimePicker/DateTimePicker.d.ts +1 -0
- package/dist/components/inputs/DateTime/DateTimePicker/DateTimePicker.js +177 -69
- package/dist/components/inputs/DateTime/TimePicker/TimePicker.d.ts +1 -0
- package/dist/components/inputs/DateTime/TimePicker/TimePicker.js +530 -157
- package/dist/components/inputs/DateTime/shared/Calendar.js +333 -137
- package/dist/components/inputs/DateTime/shared/CalendarCell.d.ts +2 -1
- package/dist/components/inputs/DateTime/shared/CalendarCell.js +301 -102
- package/dist/components/inputs/DateTime/shared/CalendarGrid.d.ts +2 -1
- package/dist/components/inputs/DateTime/shared/CalendarGrid.js +146 -33
- package/dist/components/inputs/DateTime/shared/CalendarHeader.js +245 -90
- package/dist/components/inputs/DateTime/shared/CalendarSelectHeader.js +318 -137
- package/dist/components/inputs/DateTime/shared/DateField.js +295 -112
- package/dist/components/inputs/DateTime/shared/DatePickerInput.d.ts +6 -1
- package/dist/components/inputs/DateTime/shared/DatePickerInput.js +375 -146
- package/dist/components/inputs/DateTime/shared/DateSegmentItem.js +94 -21
- package/dist/components/inputs/DateTime/shared/DateTimeDialog.js +81 -27
- 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 +3 -1
- package/dist/components/inputs/DateTime/shared/TimePickerInput.js +208 -70
- package/dist/components/inputs/DateTime/shared/YearPicker.js +119 -68
- package/dist/components/inputs/File/FileUpload.js +86 -44
- package/dist/components/inputs/File/FileUploadContainer.js +15 -7
- package/dist/components/inputs/File/InputUpload.js +317 -79
- 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 -35
- package/dist/components/inputs/File/shared/InputUploadFilled.js +49 -8
- package/dist/components/inputs/File/shared/ProgressBar.js +48 -9
- package/dist/components/inputs/FormField/FormField.js +119 -37
- package/dist/components/inputs/FormField/FormFieldError.js +25 -5
- package/dist/components/inputs/FormField/FormFieldHeader.js +79 -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.js +40 -9
- package/dist/components/inputs/Input/NumberInput/NumberInput.js +392 -123
- package/dist/components/inputs/Input/NumberRangeInput/NumberRangeField.js +541 -116
- package/dist/components/inputs/Input/NumberRangeInput/NumberRangeInput.js +463 -146
- package/dist/components/inputs/Input/PasswordInput/PasswordInput.js +48 -9
- package/dist/components/inputs/Input/TextArea/TextArea.js +298 -89
- package/dist/components/inputs/Input/TextInput/TextInput.js +370 -121
- package/dist/components/inputs/Input/shared/InputContent.js +190 -58
- package/dist/components/inputs/Inputs/Form.js +40 -11
- package/dist/components/inputs/Inputs/InputItem.d.ts +0 -1
- package/dist/components/inputs/Inputs/InputItem.js +65 -16
- package/dist/components/inputs/Inputs/Inputs.js +37 -11
- package/dist/components/inputs/RadioGroup/RadioGroup.d.ts +1 -0
- package/dist/components/inputs/RadioGroup/RadioGroup.js +333 -107
- package/dist/components/inputs/Selection/Autocomplete/Autocomplete.js +145 -50
- package/dist/components/inputs/Selection/Autocomplete/QueryAutocomplete.js +3 -2
- package/dist/components/inputs/Selection/Select/QuerySelect.js +107 -27
- package/dist/components/inputs/Selection/Select/Select.js +139 -44
- package/dist/components/inputs/Selection/shared/SelectBase.js +69 -20
- package/dist/components/inputs/Selection/shared/SelectDesktop.js +390 -143
- package/dist/components/inputs/Selection/shared/SelectInput.d.ts +2 -2
- package/dist/components/inputs/Selection/shared/SelectInput.js +326 -136
- package/dist/components/inputs/Selection/shared/SelectInputTags.js +99 -25
- package/dist/components/inputs/Selection/shared/SelectListBox.js +163 -51
- 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/StaticSelectTrailingContent.d.ts +9 -0
- package/dist/components/inputs/Selection/shared/StaticSelectTrailingContent.js +47 -0
- package/dist/components/inputs/Selection/shared/select.context.d.ts +2 -2
- package/dist/components/inputs/Selection/shared/select.context.js +44 -38
- package/dist/components/inputs/Selection/shared/selectInput.cva.d.ts +5 -0
- package/dist/components/inputs/Selection/shared/selectInput.cva.js +5 -0
- package/dist/components/inputs/Selection/shared/useSelectItems.js +109 -49
- package/dist/components/inputs/Skeleton/InputFrame.d.ts +2 -0
- package/dist/components/inputs/Skeleton/InputFrame.js +444 -124
- package/dist/components/inputs/Slider/Slider.js +247 -74
- package/dist/components/inputs/TextEditor/TextEditor.js +447 -103
- 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 +206 -41
- package/dist/components/inputs/shared/CheckContent.js +21 -10
- package/dist/components/inputs/shared/InputClear.js +78 -21
- package/dist/components/inputs/shared/TooltipWrapper.js +47 -12
- package/dist/components/inputs/shared/input.cva.js +13 -3
- package/dist/components/inputs/shared/useStaticInputHandoff.d.ts +1 -0
- package/dist/components/inputs/shared/useStaticInputHandoff.js +87 -34
- 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 +83 -27
- 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/status/Alert/Alert.js +97 -30
- package/dist/components/status/Loader/Loader.js +77 -22
- package/dist/components/status/Toast/Toast.js +21 -13
- 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 +4 -4
- package/dist/config/uiConfig.context.js +50 -11
- package/dist/config/uiStyle.context.js +15 -5
- package/dist/helpers/dynamicInputs.d.ts +1 -1
- 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.js +101 -30
- package/dist/hooks/useIntersectionObserver.js +86 -32
- 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.js +1 -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.js +2 -2
- package/dist/utils/date-time.utils.d.ts +2 -0
- package/dist/utils/date-time.utils.js +17 -13
- package/package.json +1 -1
|
@@ -2,182 +2,411 @@ import { UIStyle } from "../../../../config/uiStyle.context.js";
|
|
|
2
2
|
import { Typography } from "../../../text/Typography/Typography.js";
|
|
3
3
|
import { UIConfig } from "../../../../config/uiConfig.context.js";
|
|
4
4
|
import { InlineIconButton } from "../../../buttons/InlineIconButton/InlineIconButton.js";
|
|
5
|
+
import { DateTimeUtils } from "../../../../utils/date-time.utils.js";
|
|
5
6
|
import { DateField } from "./DateField.js";
|
|
6
7
|
import { datePickerInputContentRow } from "./datePickerInput.cva.js";
|
|
7
8
|
import { getDatePickerTodayIcon } from "./datePickerTodayIcon.js";
|
|
8
9
|
import { FormFieldLabel } from "../../FormField/FormFieldLabel.js";
|
|
9
10
|
import { InputClear } from "../../shared/InputClear.js";
|
|
10
11
|
import { inputBase, inputSize } from "../../shared/input.cva.js";
|
|
12
|
+
import { c } from "react/compiler-runtime";
|
|
11
13
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
12
14
|
import { clsx } from "clsx";
|
|
13
|
-
import {
|
|
15
|
+
import { useImperativeHandle, useRef, useState } from "react";
|
|
14
16
|
import { Button } from "react-aria-components";
|
|
15
17
|
import { useFocusVisible, useFocusWithin, useHover } from "react-aria";
|
|
16
|
-
import {
|
|
18
|
+
import { today } from "@internationalized/date";
|
|
17
19
|
//#region src/components/inputs/DateTime/shared/DatePickerInput.tsx
|
|
18
|
-
var DatePickerInput = (
|
|
20
|
+
var DatePickerInput = (t0) => {
|
|
21
|
+
const $ = c(106);
|
|
22
|
+
const { ref, as, groupProps, fieldProps, endFieldProps, fieldValue, endFieldValue, hasValue, buttonProps, isDisabled, isInvalid, disableDropdown, variant, size, isDateTime, isClearable, headerProps, todayIcon, todayIconButtonSize: t1, todayIconPlacement: t2, isDirty, isRequired, disableManualEntry, autoFixYear: t3, placeholder, className, onOpenDropdown, dateGranularity: t4, timeZone, 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;
|
|
19
28
|
const uiConfig = UIConfig.useConfig();
|
|
20
|
-
|
|
21
|
-
if (timeZone) effectiveTimeZone = timeZone;
|
|
29
|
+
const effectiveTimeZone = timeZone ?? "UTC";
|
|
22
30
|
const inputBaseCva = UIStyle.useCva("input.baseCva", inputBase);
|
|
23
31
|
const inputSizeCva = UIStyle.useCva("input.sizeCva", inputSize);
|
|
24
32
|
const datePickerInputContentRowCva = UIStyle.useCva("datePickerInput.contentRowCva", datePickerInputContentRow);
|
|
25
33
|
const [canClear, setCanClear] = useState(false);
|
|
26
|
-
|
|
34
|
+
let t6;
|
|
35
|
+
if ($[0] !== isDisabled) {
|
|
36
|
+
t6 = { isDisabled };
|
|
37
|
+
$[0] = isDisabled;
|
|
38
|
+
$[1] = t6;
|
|
39
|
+
} else t6 = $[1];
|
|
40
|
+
const { hoverProps, isHovered } = useHover(t6);
|
|
27
41
|
const [isFocused, setIsFocused] = useState(false);
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
42
|
+
let t7;
|
|
43
|
+
if ($[2] !== autoFixYear) {
|
|
44
|
+
t7 = { onFocusWithinChange: (isFocusWithin) => {
|
|
45
|
+
setIsFocused(isFocusWithin);
|
|
46
|
+
if (!isFocusWithin && autoFixYear) {
|
|
47
|
+
dateFieldRef.current?.autoFixYear();
|
|
48
|
+
endDateFieldRef.current?.autoFixYear();
|
|
49
|
+
}
|
|
50
|
+
} };
|
|
51
|
+
$[2] = autoFixYear;
|
|
52
|
+
$[3] = t7;
|
|
53
|
+
} else t7 = $[3];
|
|
54
|
+
const { focusWithinProps } = useFocusWithin(t7);
|
|
35
55
|
const { isFocusVisible } = useFocusVisible();
|
|
36
56
|
const dateFieldRef = useRef(null);
|
|
37
57
|
const endDateFieldRef = useRef(null);
|
|
38
58
|
const containerRef = useRef(null);
|
|
39
|
-
|
|
40
|
-
|
|
59
|
+
const t8 = fieldValue !== void 0 ? fieldValue : fieldProps.value ?? null;
|
|
60
|
+
let t9;
|
|
61
|
+
if ($[4] !== fieldProps || $[5] !== t8) {
|
|
62
|
+
t9 = {
|
|
63
|
+
...fieldProps,
|
|
64
|
+
value: t8
|
|
65
|
+
};
|
|
66
|
+
$[4] = fieldProps;
|
|
67
|
+
$[5] = t8;
|
|
68
|
+
$[6] = t9;
|
|
69
|
+
} else t9 = $[6];
|
|
70
|
+
const normalizedFieldProps = t9;
|
|
71
|
+
let t10;
|
|
72
|
+
if ($[7] !== endFieldProps || $[8] !== endFieldValue) {
|
|
73
|
+
t10 = endFieldProps ? {
|
|
74
|
+
...endFieldProps,
|
|
75
|
+
value: endFieldValue !== void 0 ? endFieldValue : endFieldProps.value ?? null
|
|
76
|
+
} : void 0;
|
|
77
|
+
$[7] = endFieldProps;
|
|
78
|
+
$[8] = endFieldValue;
|
|
79
|
+
$[9] = t10;
|
|
80
|
+
} else t10 = $[9];
|
|
81
|
+
const normalizedEndFieldProps = t10;
|
|
82
|
+
let t11;
|
|
83
|
+
if ($[10] !== endFieldProps || $[11] !== fieldProps || $[12] !== fireBlurOnChange || $[13] !== onClearProp) {
|
|
84
|
+
t11 = () => {
|
|
41
85
|
dateFieldRef.current?.clearField();
|
|
42
|
-
fieldProps.onChange?.(null);
|
|
43
86
|
endDateFieldRef.current?.clearField();
|
|
44
|
-
|
|
87
|
+
fieldProps.onChange?.(null);
|
|
88
|
+
endFieldProps?.onChange?.(null);
|
|
89
|
+
if (onClearProp) onClearProp();
|
|
90
|
+
else if (fireBlurOnChange) {
|
|
91
|
+
fieldProps.onBlur?.(null);
|
|
92
|
+
endFieldProps?.onBlur?.(null);
|
|
93
|
+
}
|
|
45
94
|
setCanClear(false);
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
95
|
+
};
|
|
96
|
+
$[10] = endFieldProps;
|
|
97
|
+
$[11] = fieldProps;
|
|
98
|
+
$[12] = fireBlurOnChange;
|
|
99
|
+
$[13] = onClearProp;
|
|
100
|
+
$[14] = t11;
|
|
101
|
+
} else t11 = $[14];
|
|
102
|
+
const clearInput = t11;
|
|
103
|
+
let t12;
|
|
104
|
+
let t13;
|
|
105
|
+
if ($[15] !== clearInput) {
|
|
106
|
+
t12 = () => ({
|
|
107
|
+
clear: clearInput,
|
|
108
|
+
getContainer: () => containerRef.current
|
|
109
|
+
});
|
|
110
|
+
t13 = [clearInput];
|
|
111
|
+
$[15] = clearInput;
|
|
112
|
+
$[16] = t12;
|
|
113
|
+
$[17] = t13;
|
|
114
|
+
} else {
|
|
115
|
+
t12 = $[16];
|
|
116
|
+
t13 = $[17];
|
|
117
|
+
}
|
|
118
|
+
useImperativeHandle(ref, t12, t13);
|
|
119
|
+
let t14;
|
|
120
|
+
if ($[18] === Symbol.for("react.memo_cache_sentinel")) {
|
|
121
|
+
t14 = (canClearInput) => {
|
|
122
|
+
setCanClear(canClearInput);
|
|
123
|
+
};
|
|
124
|
+
$[18] = t14;
|
|
125
|
+
} else t14 = $[18];
|
|
126
|
+
const onClearChange = t14;
|
|
127
|
+
const showClear = canClear || hasValue || normalizedFieldProps.value != null || normalizedEndFieldProps?.value != null;
|
|
128
|
+
let t15;
|
|
129
|
+
if ($[19] !== effectiveTimeZone || $[20] !== endFieldProps || $[21] !== fieldProps || $[22] !== fireBlurOnChange || $[23] !== isDateTime) {
|
|
130
|
+
t15 = () => {
|
|
131
|
+
if (isDateTime) {
|
|
132
|
+
const calendarDateTime = DateTimeUtils.getCurrentWallClockCalendarDateTime();
|
|
133
|
+
fieldProps.onChange?.(calendarDateTime);
|
|
134
|
+
if (endFieldProps) endFieldProps.onChange?.(calendarDateTime);
|
|
135
|
+
} else {
|
|
136
|
+
fieldProps.onChange?.(today(effectiveTimeZone));
|
|
137
|
+
if (endFieldProps) endFieldProps.onChange?.(today(effectiveTimeZone));
|
|
138
|
+
}
|
|
139
|
+
if (fireBlurOnChange) {
|
|
140
|
+
fieldProps.onBlur?.(null);
|
|
141
|
+
endFieldProps?.onBlur?.(null);
|
|
142
|
+
}
|
|
143
|
+
};
|
|
144
|
+
$[19] = effectiveTimeZone;
|
|
145
|
+
$[20] = endFieldProps;
|
|
146
|
+
$[21] = fieldProps;
|
|
147
|
+
$[22] = fireBlurOnChange;
|
|
148
|
+
$[23] = isDateTime;
|
|
149
|
+
$[24] = t15;
|
|
150
|
+
} else t15 = $[24];
|
|
151
|
+
const onToday = t15;
|
|
75
152
|
const hidePlaceholder = as === "floating" && !fieldProps.value && !isFocused;
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
153
|
+
let t16;
|
|
154
|
+
if ($[25] !== todayIcon) {
|
|
155
|
+
t16 = getDatePickerTodayIcon(todayIcon);
|
|
156
|
+
$[25] = todayIcon;
|
|
157
|
+
$[26] = t16;
|
|
158
|
+
} else t16 = $[26];
|
|
159
|
+
const todayIconComponent = t16;
|
|
160
|
+
let t17;
|
|
161
|
+
if ($[27] !== onToday || $[28] !== todayIconButtonSize || $[29] !== todayIconComponent) {
|
|
162
|
+
t17 = todayIconComponent ? /* @__PURE__ */ jsx(InlineIconButton, {
|
|
163
|
+
label: "",
|
|
164
|
+
icon: todayIconComponent,
|
|
165
|
+
size: todayIconButtonSize,
|
|
166
|
+
onPress: onToday,
|
|
167
|
+
className: "relative z-1 !border-none"
|
|
168
|
+
}) : null;
|
|
169
|
+
$[27] = onToday;
|
|
170
|
+
$[28] = todayIconButtonSize;
|
|
171
|
+
$[29] = todayIconComponent;
|
|
172
|
+
$[30] = t17;
|
|
173
|
+
} else t17 = $[30];
|
|
174
|
+
const todayIconButton = t17;
|
|
84
175
|
const shouldRenderTodayIconWithFieldLabel = todayIconPlacement === "fieldLabel";
|
|
85
176
|
const pickerIcon = isDateTime ? uiConfig.dateInput.dateTimeIcon : uiConfig.dateInput.calendarIcon;
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
177
|
+
const t18 = clsx("group group/date-picker-content relative flex min-w-input-width-min-width items-center justify-between gap-2", groupProps.className, inputBaseCva({
|
|
178
|
+
variant,
|
|
179
|
+
as,
|
|
180
|
+
...props
|
|
181
|
+
}), className);
|
|
182
|
+
const t19 = isHovered || void 0;
|
|
183
|
+
const t20 = isDisabled || void 0;
|
|
184
|
+
const t21 = isDisabled || void 0;
|
|
185
|
+
const t22 = isInvalid || void 0;
|
|
186
|
+
const t23 = normalizedFieldProps.value == null || void 0;
|
|
187
|
+
const t24 = isFocused || void 0;
|
|
188
|
+
const t25 = isFocused && isFocusVisible || void 0;
|
|
189
|
+
const t26 = normalizedFieldProps.value != null || void 0;
|
|
190
|
+
const t27 = isDirty || void 0;
|
|
191
|
+
const t28 = isRequired || void 0;
|
|
192
|
+
const t29 = normalizedFieldProps.value != null || void 0;
|
|
193
|
+
let t30;
|
|
194
|
+
if ($[31] !== as || $[32] !== inputSizeCva || $[33] !== size) {
|
|
195
|
+
t30 = clsx("flex w-full items-center gap-input-gap-input-text-to-elements pr-0!", inputSizeCva({
|
|
196
|
+
size,
|
|
197
|
+
as
|
|
198
|
+
}));
|
|
199
|
+
$[31] = as;
|
|
200
|
+
$[32] = inputSizeCva;
|
|
201
|
+
$[33] = size;
|
|
202
|
+
$[34] = t30;
|
|
203
|
+
} else t30 = $[34];
|
|
204
|
+
let t31;
|
|
205
|
+
if ($[35] !== as || $[36] !== headerProps) {
|
|
206
|
+
t31 = as && ["filter", "floating"].includes(as) && headerProps && /* @__PURE__ */ jsx(FormFieldLabel, {
|
|
90
207
|
as,
|
|
91
|
-
...
|
|
92
|
-
})
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
208
|
+
...headerProps
|
|
209
|
+
});
|
|
210
|
+
$[35] = as;
|
|
211
|
+
$[36] = headerProps;
|
|
212
|
+
$[37] = t31;
|
|
213
|
+
} else t31 = $[37];
|
|
214
|
+
const t32 = shouldRenderTodayIconWithFieldLabel && todayIconButton;
|
|
215
|
+
let t33;
|
|
216
|
+
if ($[38] !== datePickerInputContentRowCva || $[39] !== size) {
|
|
217
|
+
t33 = datePickerInputContentRowCva({ size });
|
|
218
|
+
$[38] = datePickerInputContentRowCva;
|
|
219
|
+
$[39] = size;
|
|
220
|
+
$[40] = t33;
|
|
221
|
+
} else t33 = $[40];
|
|
222
|
+
let t34;
|
|
223
|
+
if ($[41] !== disableManualEntry || $[42] !== isDisabled || $[43] !== onOpenDropdown) {
|
|
224
|
+
t34 = disableManualEntry && /* @__PURE__ */ jsx(Button, {
|
|
225
|
+
onPress: onOpenDropdown,
|
|
226
|
+
className: "absolute inset-0 z-0",
|
|
227
|
+
isDisabled
|
|
228
|
+
});
|
|
229
|
+
$[41] = disableManualEntry;
|
|
230
|
+
$[42] = isDisabled;
|
|
231
|
+
$[43] = onOpenDropdown;
|
|
232
|
+
$[44] = t34;
|
|
233
|
+
} else t34 = $[44];
|
|
234
|
+
const t35 = !shouldRenderTodayIconWithFieldLabel && todayIconButton;
|
|
235
|
+
let t36;
|
|
236
|
+
if ($[45] !== as || $[46] !== dateGranularity || $[47] !== disableManualEntry || $[48] !== effectiveTimeZone || $[49] !== fieldProps.value || $[50] !== format || $[51] !== hidePlaceholder || $[52] !== isDisabled || $[53] !== isInvalid || $[54] !== isTimeOptional || $[55] !== normalizedEndFieldProps || $[56] !== normalizedFieldProps || $[57] !== onClearChange || $[58] !== placeholder) {
|
|
237
|
+
t36 = disableManualEntry && placeholder && !fieldProps.value ? /* @__PURE__ */ jsx(Typography, {
|
|
238
|
+
size: "label-1",
|
|
239
|
+
className: "text-text-default-3",
|
|
240
|
+
children: placeholder
|
|
241
|
+
}) : /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(DateField, {
|
|
242
|
+
ref: dateFieldRef,
|
|
243
|
+
...normalizedFieldProps,
|
|
244
|
+
isDisabled,
|
|
245
|
+
isInvalid,
|
|
246
|
+
onClearChange,
|
|
247
|
+
hidePlaceholder,
|
|
248
|
+
disableManualEntry,
|
|
249
|
+
dateGranularity,
|
|
250
|
+
isTimeOptional,
|
|
251
|
+
format,
|
|
252
|
+
timeZone: effectiveTimeZone
|
|
253
|
+
}), normalizedEndFieldProps && /* @__PURE__ */ jsxs(Fragment, { children: [!((as === "floating" || as === "filter") && hidePlaceholder) && /* @__PURE__ */ jsx("span", {
|
|
254
|
+
className: clsx("pointer-events-none select-none", isDisabled && "text-interactive-text-secondary-disabled"),
|
|
255
|
+
children: "–"
|
|
256
|
+
}), /* @__PURE__ */ jsx(DateField, {
|
|
257
|
+
ref: endDateFieldRef,
|
|
258
|
+
...normalizedEndFieldProps,
|
|
259
|
+
isDisabled,
|
|
260
|
+
isInvalid,
|
|
261
|
+
onClearChange,
|
|
262
|
+
hidePlaceholder,
|
|
263
|
+
disableManualEntry,
|
|
264
|
+
isTimeOptional,
|
|
265
|
+
format,
|
|
266
|
+
timeZone: effectiveTimeZone
|
|
267
|
+
})] })] });
|
|
268
|
+
$[45] = as;
|
|
269
|
+
$[46] = dateGranularity;
|
|
270
|
+
$[47] = disableManualEntry;
|
|
271
|
+
$[48] = effectiveTimeZone;
|
|
272
|
+
$[49] = fieldProps.value;
|
|
273
|
+
$[50] = format;
|
|
274
|
+
$[51] = hidePlaceholder;
|
|
275
|
+
$[52] = isDisabled;
|
|
276
|
+
$[53] = isInvalid;
|
|
277
|
+
$[54] = isTimeOptional;
|
|
278
|
+
$[55] = normalizedEndFieldProps;
|
|
279
|
+
$[56] = normalizedFieldProps;
|
|
280
|
+
$[57] = onClearChange;
|
|
281
|
+
$[58] = placeholder;
|
|
282
|
+
$[59] = t36;
|
|
283
|
+
} else t36 = $[59];
|
|
284
|
+
let t37;
|
|
285
|
+
if ($[60] !== t33 || $[61] !== t34 || $[62] !== t35 || $[63] !== t36) {
|
|
286
|
+
t37 = /* @__PURE__ */ jsxs("div", {
|
|
287
|
+
className: t33,
|
|
288
|
+
children: [
|
|
289
|
+
t34,
|
|
290
|
+
t35,
|
|
291
|
+
t36
|
|
292
|
+
]
|
|
293
|
+
});
|
|
294
|
+
$[60] = t33;
|
|
295
|
+
$[61] = t34;
|
|
296
|
+
$[62] = t35;
|
|
297
|
+
$[63] = t36;
|
|
298
|
+
$[64] = t37;
|
|
299
|
+
} else t37 = $[64];
|
|
300
|
+
let t38;
|
|
301
|
+
if ($[65] !== t30 || $[66] !== t31 || $[67] !== t32 || $[68] !== t37) {
|
|
302
|
+
t38 = /* @__PURE__ */ jsxs("div", {
|
|
303
|
+
className: t30,
|
|
114
304
|
children: [
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
}),
|
|
119
|
-
shouldRenderTodayIconWithFieldLabel && todayIconButton,
|
|
120
|
-
/* @__PURE__ */ jsxs("div", {
|
|
121
|
-
className: datePickerInputContentRowCva({ size }),
|
|
122
|
-
children: [
|
|
123
|
-
disableManualEntry && /* @__PURE__ */ jsx(Button, {
|
|
124
|
-
onPress: onOpenDropdown,
|
|
125
|
-
className: "absolute inset-0 z-0",
|
|
126
|
-
isDisabled
|
|
127
|
-
}),
|
|
128
|
-
!shouldRenderTodayIconWithFieldLabel && todayIconButton,
|
|
129
|
-
disableManualEntry && placeholder && !fieldProps.value ? /* @__PURE__ */ jsx(Typography, {
|
|
130
|
-
size: "label-1",
|
|
131
|
-
className: "text-text-default-3",
|
|
132
|
-
children: placeholder
|
|
133
|
-
}) : /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(DateField, {
|
|
134
|
-
ref: dateFieldRef,
|
|
135
|
-
...fieldProps,
|
|
136
|
-
isDisabled,
|
|
137
|
-
isInvalid,
|
|
138
|
-
onClearChange,
|
|
139
|
-
hidePlaceholder,
|
|
140
|
-
disableManualEntry,
|
|
141
|
-
dateGranularity,
|
|
142
|
-
isTimeOptional,
|
|
143
|
-
format,
|
|
144
|
-
timeZone: effectiveTimeZone
|
|
145
|
-
}), endFieldProps && /* @__PURE__ */ jsxs(Fragment, { children: [!((as === "floating" || as === "filter") && hidePlaceholder) && /* @__PURE__ */ jsx("span", {
|
|
146
|
-
className: clsx("pointer-events-none select-none", isDisabled && "text-interactive-text-secondary-disabled"),
|
|
147
|
-
children: "–"
|
|
148
|
-
}), /* @__PURE__ */ jsx(DateField, {
|
|
149
|
-
ref: endDateFieldRef,
|
|
150
|
-
...endFieldProps,
|
|
151
|
-
isDisabled,
|
|
152
|
-
isInvalid,
|
|
153
|
-
onClearChange,
|
|
154
|
-
hidePlaceholder,
|
|
155
|
-
disableManualEntry,
|
|
156
|
-
isTimeOptional,
|
|
157
|
-
format,
|
|
158
|
-
timeZone: effectiveTimeZone
|
|
159
|
-
})] })] })
|
|
160
|
-
]
|
|
161
|
-
})
|
|
305
|
+
t31,
|
|
306
|
+
t32,
|
|
307
|
+
t37
|
|
162
308
|
]
|
|
163
|
-
})
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
}
|
|
309
|
+
});
|
|
310
|
+
$[65] = t30;
|
|
311
|
+
$[66] = t31;
|
|
312
|
+
$[67] = t32;
|
|
313
|
+
$[68] = t37;
|
|
314
|
+
$[69] = t38;
|
|
315
|
+
} else t38 = $[69];
|
|
316
|
+
let t39;
|
|
317
|
+
if ($[70] !== as || $[71] !== inputSizeCva || $[72] !== size) {
|
|
318
|
+
t39 = clsx(inputSizeCva({
|
|
319
|
+
size,
|
|
320
|
+
as
|
|
321
|
+
}), "flex items-center gap-input-gap-trailing-elements py-0! pl-0!");
|
|
322
|
+
$[70] = as;
|
|
323
|
+
$[71] = inputSizeCva;
|
|
324
|
+
$[72] = size;
|
|
325
|
+
$[73] = t39;
|
|
326
|
+
} else t39 = $[73];
|
|
327
|
+
let t40;
|
|
328
|
+
if ($[74] !== clearInput || $[75] !== isClearable || $[76] !== showClear) {
|
|
329
|
+
t40 = isClearable && /* @__PURE__ */ jsx(InputClear, {
|
|
330
|
+
onClear: clearInput,
|
|
331
|
+
show: showClear,
|
|
332
|
+
style: showClear ? { visibility: "visible" } : void 0
|
|
333
|
+
});
|
|
334
|
+
$[74] = clearInput;
|
|
335
|
+
$[75] = isClearable;
|
|
336
|
+
$[76] = showClear;
|
|
337
|
+
$[77] = t40;
|
|
338
|
+
} else t40 = $[77];
|
|
339
|
+
let t41;
|
|
340
|
+
if ($[78] !== buttonProps || $[79] !== disableDropdown || $[80] !== disableManualEntry || $[81] !== isDisabled || $[82] !== pickerIcon) {
|
|
341
|
+
t41 = (!disableDropdown || disableManualEntry) && /* @__PURE__ */ jsx(InlineIconButton, {
|
|
342
|
+
label: "",
|
|
343
|
+
color: "secondary",
|
|
344
|
+
...buttonProps,
|
|
345
|
+
icon: pickerIcon,
|
|
346
|
+
isDisabled,
|
|
347
|
+
className: "border-0!"
|
|
348
|
+
});
|
|
349
|
+
$[78] = buttonProps;
|
|
350
|
+
$[79] = disableDropdown;
|
|
351
|
+
$[80] = disableManualEntry;
|
|
352
|
+
$[81] = isDisabled;
|
|
353
|
+
$[82] = pickerIcon;
|
|
354
|
+
$[83] = t41;
|
|
355
|
+
} else t41 = $[83];
|
|
356
|
+
let t42;
|
|
357
|
+
if ($[84] !== t39 || $[85] !== t40 || $[86] !== t41) {
|
|
358
|
+
t42 = /* @__PURE__ */ jsxs("div", {
|
|
359
|
+
className: t39,
|
|
360
|
+
children: [t40, t41]
|
|
361
|
+
});
|
|
362
|
+
$[84] = t39;
|
|
363
|
+
$[85] = t40;
|
|
364
|
+
$[86] = t41;
|
|
365
|
+
$[87] = t42;
|
|
366
|
+
} else t42 = $[87];
|
|
367
|
+
let t43;
|
|
368
|
+
if ($[88] !== focusWithinProps || $[89] !== groupProps || $[90] !== hoverProps || $[91] !== t18 || $[92] !== t19 || $[93] !== t20 || $[94] !== t21 || $[95] !== t22 || $[96] !== t23 || $[97] !== t24 || $[98] !== t25 || $[99] !== t26 || $[100] !== t27 || $[101] !== t28 || $[102] !== t29 || $[103] !== t38 || $[104] !== t42) {
|
|
369
|
+
t43 = /* @__PURE__ */ jsxs("div", {
|
|
370
|
+
ref: containerRef,
|
|
371
|
+
...groupProps,
|
|
372
|
+
...focusWithinProps,
|
|
373
|
+
...hoverProps,
|
|
374
|
+
className: t18,
|
|
375
|
+
"data-rac": "",
|
|
376
|
+
"data-datetime-input": "",
|
|
377
|
+
"data-hovered": t19,
|
|
378
|
+
"data-disabled": t20,
|
|
379
|
+
"data-is-disabled": t21,
|
|
380
|
+
"data-invalid": t22,
|
|
381
|
+
"data-is-empty": t23,
|
|
382
|
+
"data-focus-within": t24,
|
|
383
|
+
"data-focus-visible": t25,
|
|
384
|
+
"data-has-selection": t26,
|
|
385
|
+
"data-is-dirty": t27,
|
|
386
|
+
"data-is-required": t28,
|
|
387
|
+
"data-is-filled": t29,
|
|
388
|
+
children: [t38, t42]
|
|
389
|
+
});
|
|
390
|
+
$[88] = focusWithinProps;
|
|
391
|
+
$[89] = groupProps;
|
|
392
|
+
$[90] = hoverProps;
|
|
393
|
+
$[91] = t18;
|
|
394
|
+
$[92] = t19;
|
|
395
|
+
$[93] = t20;
|
|
396
|
+
$[94] = t21;
|
|
397
|
+
$[95] = t22;
|
|
398
|
+
$[96] = t23;
|
|
399
|
+
$[97] = t24;
|
|
400
|
+
$[98] = t25;
|
|
401
|
+
$[99] = t26;
|
|
402
|
+
$[100] = t27;
|
|
403
|
+
$[101] = t28;
|
|
404
|
+
$[102] = t29;
|
|
405
|
+
$[103] = t38;
|
|
406
|
+
$[104] = t42;
|
|
407
|
+
$[105] = t43;
|
|
408
|
+
} else t43 = $[105];
|
|
409
|
+
return t43;
|
|
181
410
|
};
|
|
182
411
|
//#endregion
|
|
183
412
|
export { DatePickerInput };
|