@povio/ui 2.3.0-rc.9 → 2.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/icons/AlignCenter.js +11 -26
- package/dist/assets/icons/AlignLeft.js +11 -26
- package/dist/assets/icons/AlignLeftRight.js +11 -26
- package/dist/assets/icons/AlignRight.js +11 -26
- package/dist/assets/icons/ArrowDropDown.js +11 -26
- package/dist/assets/icons/ArrowDropUp.js +11 -26
- package/dist/assets/icons/ArrowLeft.js +11 -26
- package/dist/assets/icons/ArrowRight.js +11 -26
- package/dist/assets/icons/Bold.js +11 -26
- package/dist/assets/icons/BulletedList.js +11 -26
- package/dist/assets/icons/Calendar.js +13 -28
- package/dist/assets/icons/Check.js +13 -28
- package/dist/assets/icons/CheckCircle.js +11 -26
- package/dist/assets/icons/CheckboxCheckmark.js +14 -29
- package/dist/assets/icons/CheckboxIndeterminate.js +14 -29
- package/dist/assets/icons/ChevronDown.js +13 -28
- package/dist/assets/icons/ChevronLeft.js +13 -28
- package/dist/assets/icons/ChevronRight.js +13 -28
- package/dist/assets/icons/ChevronUp.js +13 -28
- package/dist/assets/icons/ChevronsLeft.js +13 -28
- package/dist/assets/icons/ChevronsRight.js +13 -28
- package/dist/assets/icons/Clock.js +11 -26
- package/dist/assets/icons/Close.js +11 -26
- package/dist/assets/icons/DateTime.js +14 -35
- package/dist/assets/icons/DragIndicator.js +11 -26
- package/dist/assets/icons/File.js +13 -28
- package/dist/assets/icons/Highlight.js +11 -26
- package/dist/assets/icons/HighlightOn.js +15 -49
- package/dist/assets/icons/Home.js +11 -26
- package/dist/assets/icons/Info.js +16 -37
- package/dist/assets/icons/Italic.js +11 -26
- package/dist/assets/icons/Link.js +11 -26
- package/dist/assets/icons/Menu.js +11 -26
- package/dist/assets/icons/NumberedList.js +11 -26
- package/dist/assets/icons/PointerHorizontal.js +11 -26
- package/dist/assets/icons/PointerVertical.js +11 -26
- package/dist/assets/icons/Search.js +11 -26
- package/dist/assets/icons/Send.js +13 -28
- package/dist/assets/icons/Strikethrough.js +11 -26
- package/dist/assets/icons/TextColor.js +14 -48
- package/dist/assets/icons/Today.js +11 -26
- package/dist/assets/icons/Underlined.js +13 -28
- package/dist/assets/icons/Upload.js +14 -35
- package/dist/assets/icons/Visibility.js +11 -26
- package/dist/assets/icons/VisibilityOff.js +11 -26
- package/dist/assets/icons/WarningFilled.js +13 -28
- package/dist/components/Breadcrumbs/Breadcrumbs.js +56 -207
- package/dist/components/Menu/Menu.js +2 -18
- package/dist/components/Menu/MenuDesktop.js +7 -41
- package/dist/components/Menu/MenuItem.js +9 -32
- package/dist/components/Menu/MenuMobile.js +38 -97
- package/dist/components/Menu/MenuPopover.js +29 -105
- package/dist/components/buttons/IconButton/IconButton.js +8 -40
- package/dist/components/buttons/InlineIconButton/InlineIconButton.d.ts +1 -2
- package/dist/components/buttons/InlineIconButton/InlineIconButton.js +9 -34
- package/dist/components/buttons/PillButton/PillButton.js +17 -55
- package/dist/components/buttons/SplitButton/SplitButton.js +18 -103
- package/dist/components/buttons/TextButton/TextButton.js +8 -30
- package/dist/components/buttons/ToggleButton/ToggleButton.js +8 -28
- package/dist/components/buttons/shared/ButtonContent.js +22 -80
- package/dist/components/inputs/Checkbox/Checkbox.js +35 -172
- package/dist/components/inputs/Checkbox/CheckboxCheckmark.js +10 -24
- package/dist/components/inputs/Checkbox/checkbox.cva.d.ts +0 -3
- package/dist/components/inputs/Checkbox/checkbox.cva.js +1 -2
- package/dist/components/inputs/DateTime/DatePicker/DatePicker.d.ts +5 -10
- package/dist/components/inputs/DateTime/DatePicker/DatePicker.js +20 -121
- package/dist/components/inputs/DateTime/DateRangePicker/DateRangePicker.d.ts +5 -10
- package/dist/components/inputs/DateTime/DateRangePicker/DateRangePicker.js +111 -215
- package/dist/components/inputs/DateTime/DateTimePicker/DateTimePicker.d.ts +5 -11
- package/dist/components/inputs/DateTime/DateTimePicker/DateTimePicker.js +19 -123
- package/dist/components/inputs/DateTime/TimePicker/TimePicker.d.ts +3 -5
- package/dist/components/inputs/DateTime/TimePicker/TimePicker.js +104 -448
- package/dist/components/inputs/DateTime/shared/Calendar.d.ts +2 -5
- package/dist/components/inputs/DateTime/shared/Calendar.js +119 -330
- package/dist/components/inputs/DateTime/shared/CalendarCell.d.ts +1 -1
- package/dist/components/inputs/DateTime/shared/CalendarCell.js +102 -283
- package/dist/components/inputs/DateTime/shared/CalendarGrid.d.ts +1 -1
- package/dist/components/inputs/DateTime/shared/CalendarGrid.js +33 -142
- package/dist/components/inputs/DateTime/shared/CalendarHeader.js +93 -249
- package/dist/components/inputs/DateTime/shared/CalendarSelectHeader.js +137 -318
- package/dist/components/inputs/DateTime/shared/DateField.js +112 -296
- package/dist/components/inputs/DateTime/shared/DatePickerInput.d.ts +3 -6
- package/dist/components/inputs/DateTime/shared/DatePickerInput.js +136 -355
- package/dist/components/inputs/DateTime/shared/DateSegmentItem.d.ts +0 -14
- package/dist/components/inputs/DateTime/shared/DateSegmentItem.js +11 -97
- package/dist/components/inputs/DateTime/shared/DateTimeDialog.js +27 -81
- package/dist/components/inputs/DateTime/shared/DateTimeDialogFooter.js +10 -59
- package/dist/components/inputs/DateTime/shared/MonthPicker.js +58 -103
- package/dist/components/inputs/DateTime/shared/RangeCalendar.js +82 -193
- package/dist/components/inputs/DateTime/shared/TimeField.js +8 -27
- package/dist/components/inputs/DateTime/shared/TimePickerForm.js +110 -279
- package/dist/components/inputs/DateTime/shared/TimePickerInput.d.ts +1 -2
- package/dist/components/inputs/DateTime/shared/TimePickerInput.js +65 -207
- package/dist/components/inputs/DateTime/shared/YearPicker.js +68 -119
- package/dist/components/inputs/File/FileUpload.js +44 -87
- package/dist/components/inputs/File/FileUploadContainer.js +7 -15
- package/dist/components/inputs/File/InputUpload.js +79 -317
- package/dist/components/inputs/File/shared/FileCard.js +41 -104
- package/dist/components/inputs/File/shared/FileCardList.js +12 -47
- package/dist/components/inputs/File/shared/FileUploadContent.js +44 -175
- package/dist/components/inputs/File/shared/FileUploadContentEmpty.js +46 -149
- package/dist/components/inputs/File/shared/FileUploadContentError.js +93 -234
- package/dist/components/inputs/File/shared/FileUploadContentFilled.js +97 -230
- package/dist/components/inputs/File/shared/FileUploadContentLoading.js +55 -199
- package/dist/components/inputs/File/shared/InputUploadContent.js +34 -148
- package/dist/components/inputs/File/shared/InputUploadFilled.js +8 -49
- package/dist/components/inputs/File/shared/ProgressBar.js +9 -48
- package/dist/components/inputs/FormField/FormField.d.ts +3 -3
- package/dist/components/inputs/FormField/FormField.js +37 -119
- package/dist/components/inputs/FormField/FormFieldError.js +5 -25
- package/dist/components/inputs/FormField/FormFieldHeader.d.ts +2 -2
- package/dist/components/inputs/FormField/FormFieldHeader.js +22 -81
- package/dist/components/inputs/FormField/FormFieldHeaderClose.js +7 -31
- package/dist/components/inputs/FormField/FormFieldHelper.js +6 -26
- package/dist/components/inputs/FormField/FormFieldLabel.d.ts +2 -2
- package/dist/components/inputs/FormField/FormFieldLabel.js +9 -40
- package/dist/components/inputs/Input/NumberInput/NumberInput.d.ts +2 -5
- package/dist/components/inputs/Input/NumberInput/NumberInput.js +88 -334
- package/dist/components/inputs/Input/PasswordInput/PasswordInput.js +9 -48
- package/dist/components/inputs/Input/TextArea/TextArea.js +90 -305
- package/dist/components/inputs/Input/TextInput/TextInput.d.ts +1 -3
- package/dist/components/inputs/Input/TextInput/TextInput.js +79 -319
- package/dist/components/inputs/Input/shared/InputContent.js +59 -192
- package/dist/components/inputs/Inputs/Form.js +11 -40
- package/dist/components/inputs/Inputs/InputItem.d.ts +21 -16
- package/dist/components/inputs/Inputs/InputItem.js +14 -71
- package/dist/components/inputs/Inputs/Inputs.js +11 -37
- package/dist/components/inputs/RadioGroup/RadioGroup.d.ts +1 -2
- package/dist/components/inputs/RadioGroup/RadioGroup.js +60 -352
- package/dist/components/inputs/RadioGroup/radio.cva.d.ts +0 -17
- package/dist/components/inputs/RadioGroup/radio.cva.js +1 -42
- package/dist/components/inputs/Selection/Autocomplete/Autocomplete.d.ts +2 -6
- package/dist/components/inputs/Selection/Autocomplete/Autocomplete.js +7 -109
- package/dist/components/inputs/Selection/Autocomplete/QueryAutocomplete.d.ts +18 -3
- package/dist/components/inputs/Selection/Autocomplete/QueryAutocomplete.js +8 -34
- package/dist/components/inputs/Selection/Select/Select.d.ts +3 -7
- package/dist/components/inputs/Selection/Select/Select.js +5 -132
- package/dist/components/inputs/Selection/shared/SelectBase.d.ts +1 -8
- package/dist/components/inputs/Selection/shared/SelectBase.js +18 -69
- package/dist/components/inputs/Selection/shared/SelectDesktop.d.ts +1 -1
- package/dist/components/inputs/Selection/shared/SelectDesktop.js +138 -393
- package/dist/components/inputs/Selection/shared/SelectInput.d.ts +2 -2
- package/dist/components/inputs/Selection/shared/SelectInput.js +116 -338
- package/dist/components/inputs/Selection/shared/SelectInputTags.js +25 -99
- package/dist/components/inputs/Selection/shared/SelectListBox.d.ts +2 -2
- package/dist/components/inputs/Selection/shared/SelectListBox.js +52 -164
- package/dist/components/inputs/Selection/shared/SelectListBoxItem.js +35 -85
- package/dist/components/inputs/Selection/shared/SelectListBoxItemSelectAll.js +16 -69
- package/dist/components/inputs/Selection/shared/SelectListBoxLoadingItem.js +21 -70
- package/dist/components/inputs/Selection/shared/SelectListBoxSelectionBar.js +9 -58
- package/dist/components/inputs/Selection/shared/SelectMobile.d.ts +1 -1
- package/dist/components/inputs/Selection/shared/SelectMobile.js +3 -9
- package/dist/components/inputs/Selection/shared/select.context.d.ts +2 -3
- package/dist/components/inputs/Selection/shared/select.context.js +34 -57
- package/dist/components/inputs/Selection/shared/select.types.d.ts +2 -3
- package/dist/components/inputs/Selection/shared/useSelectItems.js +49 -109
- package/dist/components/inputs/Slider/Slider.js +74 -250
- package/dist/components/inputs/TextEditor/TextEditor.d.ts +0 -1
- package/dist/components/inputs/TextEditor/TextEditor.js +98 -447
- package/dist/components/inputs/TextEditor/Toolbar/ColorPicker.js +11 -37
- package/dist/components/inputs/TextEditor/Toolbar/ColorPickerDropdown.js +30 -102
- package/dist/components/inputs/TextEditor/Toolbar/HyperlinkAction.js +45 -194
- package/dist/components/inputs/TextEditor/Toolbar/TextAlignSelect.js +28 -88
- package/dist/components/inputs/TextEditor/Toolbar/TextColorSelect.js +14 -48
- package/dist/components/inputs/TextEditor/Toolbar/TextEditorToolbar.js +19 -66
- package/dist/components/inputs/TextEditor/Toolbar/TextHighlightSelect.js +15 -49
- package/dist/components/inputs/TextEditor/Toolbar/TextListActions.js +32 -92
- package/dist/components/inputs/TextEditor/Toolbar/TextMarksActions.js +54 -126
- package/dist/components/inputs/TextEditor/Toolbar/TextStyleSelect.js +38 -141
- package/dist/components/inputs/Toggle/Toggle.js +37 -189
- package/dist/components/inputs/Toggle/toggle.cva.d.ts +0 -3
- package/dist/components/inputs/Toggle/toggle.cva.js +1 -2
- package/dist/components/inputs/shared/CheckContent.d.ts +1 -2
- package/dist/components/inputs/shared/CheckContent.js +11 -21
- package/dist/components/inputs/shared/InputClear.d.ts +1 -2
- package/dist/components/inputs/shared/InputClear.js +13 -79
- package/dist/components/inputs/shared/TooltipWrapper.js +11 -50
- package/dist/components/inputs/shared/input.cva.d.ts +0 -10
- package/dist/components/inputs/shared/input.cva.js +4 -32
- package/dist/components/navigation/Accordion/Accordion.js +22 -69
- package/dist/components/navigation/Accordion/AccordionItem.js +41 -86
- package/dist/components/navigation/Stepper/Stepper.js +22 -67
- package/dist/components/navigation/Stepper/StepperItem.js +31 -104
- package/dist/components/navigation/Stepper/StepperSeparator.js +5 -23
- package/dist/components/overlays/ActionModal/ActionModal.js +35 -169
- package/dist/components/overlays/BottomSheet/BottomSheet.js +49 -98
- package/dist/components/overlays/BottomSheet/BottomSheetHeader.js +8 -48
- package/dist/components/overlays/Drawer/Drawer.js +20 -62
- package/dist/components/overlays/ResponsivePopover/ResponsivePopover.js +27 -83
- package/dist/components/overlays/Tooltip/Tooltip.js +28 -137
- package/dist/components/overlays/Tooltip/TooltipEllipsis.js +12 -37
- package/dist/components/segment/Segment.js +57 -218
- package/dist/components/segment/SegmentItem.js +10 -67
- package/dist/components/shared/pagination/Pagination.js +22 -108
- package/dist/components/shared/pagination/PaginationList.js +64 -167
- package/dist/components/status/Alert/Alert.js +30 -97
- package/dist/components/status/Loader/Loader.js +22 -77
- package/dist/components/status/Toast/Toast.js +13 -21
- package/dist/components/status/Toast/useToast.js +57 -62
- package/dist/components/table/ColumnConfig.js +54 -158
- package/dist/components/table/InfiniteTable.js +16 -67
- package/dist/components/table/PaginatedTable.js +18 -84
- package/dist/components/table/Table.js +27 -28
- package/dist/components/text/Link/Link.js +7 -19
- package/dist/components/text/Typography/Typography.js +8 -23
- package/dist/config/confirmation.context.js +1 -1
- package/dist/config/link.context.js +9 -23
- package/dist/config/router.context.js +16 -42
- package/dist/config/theme.context.js +45 -98
- package/dist/config/uiConfig.context.d.ts +6 -16
- package/dist/config/uiConfig.context.js +13 -56
- package/dist/config/uiStyle.context.d.ts +4 -27
- package/dist/config/uiStyle.context.js +5 -15
- package/dist/helpers/dynamicInputs.d.ts +5 -5
- package/dist/helpers/dynamicInputs.js +0 -3
- package/dist/hooks/useBreakpoint.js +3 -16
- package/dist/hooks/useDebounceCallback.js +17 -51
- package/dist/hooks/useFilters.js +64 -125
- package/dist/hooks/useForm.js +8 -42
- package/dist/hooks/useFormAutosave.js +30 -101
- package/dist/hooks/useIntersectionObserver.d.ts +1 -1
- package/dist/hooks/useIntersectionObserver.js +24 -91
- package/dist/hooks/useLocalStorage.js +10 -43
- package/dist/hooks/useLongPressRepeat.js +20 -55
- package/dist/hooks/usePagination.js +19 -49
- package/dist/hooks/useScrollableListBox.js +16 -37
- package/dist/hooks/useSorting.js +28 -69
- package/dist/hooks/useStateAndRef.js +7 -21
- package/dist/hooks/useTableColumnConfig.js +31 -124
- package/dist/hooks/useTranslationMemo.js +5 -25
- package/dist/index.d.ts +0 -7
- package/dist/index.js +3 -5
- package/dist/tw-ui-plugin.js +0 -2
- package/dist/utils/date-time.utils.d.ts +10 -31
- package/dist/utils/date-time.utils.js +22 -123
- package/dist/utils/dom.utils.js +1 -1
- package/package.json +1 -1
- package/dist/components/inputs/DateTime/shared/datePicker.types.d.ts +0 -4
- package/dist/components/inputs/DateTime/shared/datePickerInput.cva.d.ts +0 -7
- package/dist/components/inputs/DateTime/shared/datePickerInput.cva.js +0 -13
- package/dist/components/inputs/DateTime/shared/datePickerTodayIcon.d.ts +0 -6
- package/dist/components/inputs/DateTime/shared/datePickerTodayIcon.js +0 -21
- package/dist/components/inputs/DateTime/shared/dateSegment.utils.d.ts +0 -2
- package/dist/components/inputs/DateTime/shared/dateSegment.utils.spec.d.ts +0 -1
- package/dist/components/inputs/DateTime/shared/staticDateTimeSegments.d.ts +0 -31
- package/dist/components/inputs/DateTime/shared/staticDateTimeSegments.js +0 -80
- package/dist/components/inputs/DateTime/shared/staticDateTimeSegments.spec.d.ts +0 -1
- package/dist/components/inputs/FormField/formFieldHeader.cva.d.ts +0 -6
- package/dist/components/inputs/FormField/formFieldHeader.cva.js +0 -11
- package/dist/components/inputs/Input/NumberRangeInput/NumberRangeField.d.ts +0 -45
- package/dist/components/inputs/Input/NumberRangeInput/NumberRangeField.js +0 -571
- package/dist/components/inputs/Input/NumberRangeInput/NumberRangeInput.d.ts +0 -35
- package/dist/components/inputs/Input/NumberRangeInput/NumberRangeInput.js +0 -479
- package/dist/components/inputs/Input/TextArea/TextArea.cva.d.ts +0 -4
- package/dist/components/inputs/Input/TextArea/TextArea.cva.js +0 -5
- package/dist/components/inputs/Input/shared/numberStatic.utils.d.ts +0 -1
- package/dist/components/inputs/Input/shared/numberStatic.utils.js +0 -7
- package/dist/components/inputs/Selection/Autocomplete/queryAutocomplete.types.d.ts +0 -36
- package/dist/components/inputs/Selection/Select/QuerySelect.d.ts +0 -14
- package/dist/components/inputs/Selection/Select/QuerySelect.js +0 -122
- package/dist/components/inputs/Selection/shared/StaticSelectTrailingContent.d.ts +0 -9
- package/dist/components/inputs/Selection/shared/StaticSelectTrailingContent.js +0 -47
- package/dist/components/inputs/Selection/shared/querySelect.utils.d.ts +0 -6
- package/dist/components/inputs/Selection/shared/querySelect.utils.js +0 -13
- package/dist/components/inputs/Selection/shared/selectDesktop.cva.d.ts +0 -3
- package/dist/components/inputs/Selection/shared/selectDesktop.cva.js +0 -5
- package/dist/components/inputs/Selection/shared/selectInput.cva.d.ts +0 -5
- package/dist/components/inputs/Selection/shared/selectInput.cva.js +0 -5
- package/dist/components/inputs/Selection/shared/staticSelect.utils.d.ts +0 -23
- package/dist/components/inputs/Selection/shared/staticSelect.utils.js +0 -37
- package/dist/components/inputs/Selection/shared/staticSelect.utils.spec.d.ts +0 -1
- package/dist/components/inputs/Skeleton/InputFrame.d.ts +0 -79
- package/dist/components/inputs/Skeleton/InputFrame.js +0 -526
- package/dist/components/inputs/shared/StaticInput.d.ts +0 -38
- package/dist/components/inputs/shared/tooltipWrapper.cva.d.ts +0 -4
- package/dist/components/inputs/shared/tooltipWrapper.cva.js +0 -5
- package/dist/components/inputs/shared/useStaticInputHandoff.d.ts +0 -14
- package/dist/components/inputs/shared/useStaticInputHandoff.js +0 -100
- package/dist/hooks/useQueryAutocomplete.d.ts +0 -14
- package/dist/hooks/useQueryAutocomplete.js +0 -57
- package/dist/utils/query.utils.d.ts +0 -4
- package/dist/utils/query.utils.js +0 -8
|
@@ -2,98 +2,44 @@ import { UIStyle } from "../../../../config/uiStyle.context.js";
|
|
|
2
2
|
import { BottomSheet } from "../../../overlays/BottomSheet/BottomSheet.js";
|
|
3
3
|
import { useBreakpoint } from "../../../../hooks/useBreakpoint.js";
|
|
4
4
|
import { popover } from "../../../shared/popover.cva.js";
|
|
5
|
-
import { c } from "react/compiler-runtime";
|
|
6
5
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
6
|
import clsx$1 from "clsx";
|
|
8
7
|
import { Dialog, Popover } from "react-aria-components";
|
|
9
8
|
//#region src/components/inputs/DateTime/shared/DateTimeDialog.tsx
|
|
10
|
-
var DateTimeDialog = (
|
|
11
|
-
const $ = c(25);
|
|
12
|
-
const { hideSidebar, children, footer, sidebar, label, isOpen, triggerRef, dialogProps, onOpenChange } = t0;
|
|
9
|
+
var DateTimeDialog = ({ hideSidebar, children, footer, sidebar, label, isOpen, triggerRef, dialogProps, onOpenChange }) => {
|
|
13
10
|
const popoverCva = UIStyle.useCva("popover.cva", popover);
|
|
14
11
|
if (useBreakpoint("md")) {
|
|
15
12
|
if (!isOpen) return null;
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
const t2 = !hideSidebar && sidebar;
|
|
23
|
-
let t3;
|
|
24
|
-
if ($[2] !== children || $[3] !== footer) {
|
|
25
|
-
t3 = /* @__PURE__ */ jsxs("div", {
|
|
26
|
-
className: "flex flex-1 flex-col justify-between",
|
|
27
|
-
children: [children, footer]
|
|
28
|
-
});
|
|
29
|
-
$[2] = children;
|
|
30
|
-
$[3] = footer;
|
|
31
|
-
$[4] = t3;
|
|
32
|
-
} else t3 = $[4];
|
|
33
|
-
let t4;
|
|
34
|
-
if ($[5] !== t1 || $[6] !== t2 || $[7] !== t3) {
|
|
35
|
-
t4 = /* @__PURE__ */ jsxs("div", {
|
|
36
|
-
className: t1,
|
|
37
|
-
children: [t2, t3]
|
|
38
|
-
});
|
|
39
|
-
$[5] = t1;
|
|
40
|
-
$[6] = t2;
|
|
41
|
-
$[7] = t3;
|
|
42
|
-
$[8] = t4;
|
|
43
|
-
} else t4 = $[8];
|
|
44
|
-
let t5;
|
|
45
|
-
if ($[9] !== dialogProps || $[10] !== label || $[11] !== t4) {
|
|
46
|
-
t5 = /* @__PURE__ */ jsx(Dialog, {
|
|
13
|
+
return /* @__PURE__ */ jsx(Popover, {
|
|
14
|
+
triggerRef,
|
|
15
|
+
isOpen,
|
|
16
|
+
placement: "bottom start",
|
|
17
|
+
onOpenChange,
|
|
18
|
+
children: /* @__PURE__ */ jsx(Dialog, {
|
|
47
19
|
...dialogProps,
|
|
48
20
|
className: "outline-none!",
|
|
49
21
|
"aria-label": label,
|
|
50
|
-
children:
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
if ($[13] !== isOpen || $[14] !== onOpenChange || $[15] !== t5 || $[16] !== triggerRef) {
|
|
59
|
-
t6 = /* @__PURE__ */ jsx(Popover, {
|
|
60
|
-
triggerRef,
|
|
61
|
-
isOpen,
|
|
62
|
-
placement: "bottom start",
|
|
63
|
-
onOpenChange,
|
|
64
|
-
children: t5
|
|
65
|
-
});
|
|
66
|
-
$[13] = isOpen;
|
|
67
|
-
$[14] = onOpenChange;
|
|
68
|
-
$[15] = t5;
|
|
69
|
-
$[16] = triggerRef;
|
|
70
|
-
$[17] = t6;
|
|
71
|
-
} else t6 = $[17];
|
|
72
|
-
return t6;
|
|
73
|
-
}
|
|
74
|
-
const t1 = !hideSidebar && sidebar;
|
|
75
|
-
let t2;
|
|
76
|
-
if ($[18] !== children || $[19] !== footer || $[20] !== isOpen || $[21] !== label || $[22] !== onOpenChange || $[23] !== t1) {
|
|
77
|
-
t2 = /* @__PURE__ */ jsxs(BottomSheet, {
|
|
78
|
-
label,
|
|
79
|
-
footer,
|
|
80
|
-
isOpen,
|
|
81
|
-
onOpenChange,
|
|
82
|
-
sheetMarginBottom: 0,
|
|
83
|
-
isScrollable: true,
|
|
84
|
-
height: "auto",
|
|
85
|
-
isDismissable: true,
|
|
86
|
-
children: [children, t1]
|
|
22
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
23
|
+
className: clsx$1(popoverCva({}), "flex overflow-hidden"),
|
|
24
|
+
children: [!hideSidebar && sidebar, /* @__PURE__ */ jsxs("div", {
|
|
25
|
+
className: "flex flex-1 flex-col justify-between",
|
|
26
|
+
children: [children, footer]
|
|
27
|
+
})]
|
|
28
|
+
})
|
|
29
|
+
})
|
|
87
30
|
});
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
31
|
+
}
|
|
32
|
+
return /* @__PURE__ */ jsxs(BottomSheet, {
|
|
33
|
+
label,
|
|
34
|
+
footer,
|
|
35
|
+
isOpen,
|
|
36
|
+
onOpenChange,
|
|
37
|
+
sheetMarginBottom: 0,
|
|
38
|
+
isScrollable: true,
|
|
39
|
+
height: "auto",
|
|
40
|
+
isDismissable: true,
|
|
41
|
+
children: [children, !hideSidebar && sidebar]
|
|
42
|
+
});
|
|
97
43
|
};
|
|
98
44
|
//#endregion
|
|
99
45
|
export { DateTimeDialog };
|
|
@@ -1,76 +1,27 @@
|
|
|
1
1
|
import "../../../../config/i18n.js";
|
|
2
2
|
import { TextButton } from "../../../buttons/TextButton/TextButton.js";
|
|
3
|
-
import { c } from "react/compiler-runtime";
|
|
4
3
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
4
|
import { clsx } from "clsx";
|
|
6
5
|
import { useTranslation } from "react-i18next";
|
|
7
6
|
//#region src/components/inputs/DateTime/shared/DateTimeDialogFooter.tsx
|
|
8
|
-
var DateTimeDialogFooter = (
|
|
9
|
-
const $ = c(16);
|
|
10
|
-
const { isValid: t1, isDisabled: t2, onTodayPress, onApply } = t0;
|
|
11
|
-
const isValid = t1 === void 0 ? true : t1;
|
|
12
|
-
const isDisabled = t2 === void 0 ? false : t2;
|
|
7
|
+
var DateTimeDialogFooter = ({ isValid = true, isDisabled = false, onTodayPress, onApply }) => {
|
|
13
8
|
const { t } = useTranslation("ui");
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
t4 = clsx("flex shrink-0 items-center gap-2 bg-elevation-fill-default-2 px-4 py-3 md:border-elevation-outline-default-1 md:border-t md:bg-elevation-fill-default-1 md:py-1-5", t3);
|
|
18
|
-
$[0] = t3;
|
|
19
|
-
$[1] = t4;
|
|
20
|
-
} else t4 = $[1];
|
|
21
|
-
let t5;
|
|
22
|
-
if ($[2] !== isDisabled || $[3] !== onTodayPress || $[4] !== t) {
|
|
23
|
-
t5 = onTodayPress && /* @__PURE__ */ jsx(TextButton, {
|
|
9
|
+
return /* @__PURE__ */ jsxs("footer", {
|
|
10
|
+
className: clsx("flex shrink-0 items-center gap-2 bg-elevation-fill-default-2 px-4 py-3 md:border-elevation-outline-default-1 md:border-t md:bg-elevation-fill-default-1 md:py-1-5", onTodayPress ? "justify-between" : "justify-end"),
|
|
11
|
+
children: [onTodayPress && /* @__PURE__ */ jsx(TextButton, {
|
|
24
12
|
type: "button",
|
|
25
13
|
color: "primary",
|
|
26
14
|
isDisabled,
|
|
27
15
|
onPress: onTodayPress,
|
|
28
|
-
children: t(
|
|
29
|
-
})
|
|
30
|
-
$[2] = isDisabled;
|
|
31
|
-
$[3] = onTodayPress;
|
|
32
|
-
$[4] = t;
|
|
33
|
-
$[5] = t5;
|
|
34
|
-
} else t5 = $[5];
|
|
35
|
-
const t6 = !isValid;
|
|
36
|
-
let t7;
|
|
37
|
-
if ($[6] !== t) {
|
|
38
|
-
t7 = t(_temp2);
|
|
39
|
-
$[6] = t;
|
|
40
|
-
$[7] = t7;
|
|
41
|
-
} else t7 = $[7];
|
|
42
|
-
let t8;
|
|
43
|
-
if ($[8] !== onApply || $[9] !== t6 || $[10] !== t7) {
|
|
44
|
-
t8 = /* @__PURE__ */ jsx(TextButton, {
|
|
16
|
+
children: t(($) => $.ui.datePicker.today)
|
|
17
|
+
}), /* @__PURE__ */ jsx(TextButton, {
|
|
45
18
|
type: "button",
|
|
46
19
|
color: "secondary",
|
|
47
20
|
onPress: onApply,
|
|
48
|
-
isDisabled:
|
|
49
|
-
children:
|
|
50
|
-
})
|
|
51
|
-
|
|
52
|
-
$[9] = t6;
|
|
53
|
-
$[10] = t7;
|
|
54
|
-
$[11] = t8;
|
|
55
|
-
} else t8 = $[11];
|
|
56
|
-
let t9;
|
|
57
|
-
if ($[12] !== t4 || $[13] !== t5 || $[14] !== t8) {
|
|
58
|
-
t9 = /* @__PURE__ */ jsxs("footer", {
|
|
59
|
-
className: t4,
|
|
60
|
-
children: [t5, t8]
|
|
61
|
-
});
|
|
62
|
-
$[12] = t4;
|
|
63
|
-
$[13] = t5;
|
|
64
|
-
$[14] = t8;
|
|
65
|
-
$[15] = t9;
|
|
66
|
-
} else t9 = $[15];
|
|
67
|
-
return t9;
|
|
21
|
+
isDisabled: !isValid,
|
|
22
|
+
children: t(($) => $.ui.datePicker.save)
|
|
23
|
+
})]
|
|
24
|
+
});
|
|
68
25
|
};
|
|
69
|
-
function _temp($) {
|
|
70
|
-
return $.ui.datePicker.today;
|
|
71
|
-
}
|
|
72
|
-
function _temp2($_0) {
|
|
73
|
-
return $_0.ui.datePicker.save;
|
|
74
|
-
}
|
|
75
26
|
//#endregion
|
|
76
27
|
export { DateTimeDialogFooter };
|
|
@@ -1,24 +1,15 @@
|
|
|
1
1
|
import { Typography } from "../../../text/Typography/Typography.js";
|
|
2
|
-
import { c } from "react/compiler-runtime";
|
|
3
2
|
import { jsx } from "react/jsx-runtime";
|
|
4
3
|
import { clsx } from "clsx";
|
|
5
4
|
import { useRef } from "react";
|
|
6
5
|
import { ListBox, ListBoxItem } from "react-aria-components";
|
|
7
6
|
import { useDateFormatter } from "@react-aria/i18n";
|
|
8
7
|
//#region src/components/inputs/DateTime/shared/MonthPicker.tsx
|
|
9
|
-
var MonthPicker = (
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
t1 = {
|
|
15
|
-
month: "long",
|
|
16
|
-
timeZone: state.timeZone
|
|
17
|
-
};
|
|
18
|
-
$[0] = state.timeZone;
|
|
19
|
-
$[1] = t1;
|
|
20
|
-
} else t1 = $[1];
|
|
21
|
-
const formatter = useDateFormatter(t1);
|
|
8
|
+
var MonthPicker = ({ state, onSelectionChange, onDateChange, onCommit, selectedDate }) => {
|
|
9
|
+
const formatter = useDateFormatter({
|
|
10
|
+
month: "long",
|
|
11
|
+
timeZone: state.timeZone
|
|
12
|
+
});
|
|
22
13
|
const numMonths = state.focusedDate.calendar.getMonthsInYear(state.focusedDate);
|
|
23
14
|
const getMonths = () => {
|
|
24
15
|
const months = [];
|
|
@@ -33,103 +24,67 @@ var MonthPicker = (t0) => {
|
|
|
33
24
|
if (state.maxValue && state.focusedDate.set({ month }) > state.maxValue) return true;
|
|
34
25
|
return false;
|
|
35
26
|
};
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
};
|
|
42
|
-
t2 = getSelectedMonth();
|
|
43
|
-
$[2] = selectedDate;
|
|
44
|
-
$[3] = t2;
|
|
45
|
-
} else t2 = $[3];
|
|
46
|
-
const selectedMonth = t2;
|
|
27
|
+
const getSelectedMonth = () => {
|
|
28
|
+
if (!selectedDate) return null;
|
|
29
|
+
return selectedDate.month;
|
|
30
|
+
};
|
|
31
|
+
const selectedMonth = getSelectedMonth();
|
|
47
32
|
const lastPressedMonthRef = useRef(null);
|
|
48
|
-
|
|
49
|
-
if (
|
|
50
|
-
|
|
51
|
-
if (
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
33
|
+
const listBoxSelectionProps = {};
|
|
34
|
+
if (selectedMonth !== null) listBoxSelectionProps.selectedKeys = [selectedMonth];
|
|
35
|
+
const parseMonthFromKey = (key) => {
|
|
36
|
+
if (typeof key === "number") return key;
|
|
37
|
+
if (typeof key === "string") {
|
|
38
|
+
const parsedMonth = Number.parseInt(key, 10);
|
|
39
|
+
if (!Number.isNaN(parsedMonth)) return parsedMonth;
|
|
40
|
+
}
|
|
41
|
+
return null;
|
|
42
|
+
};
|
|
43
|
+
return /* @__PURE__ */ jsx(ListBox, {
|
|
44
|
+
autoFocus: true,
|
|
45
|
+
"aria-label": "Month",
|
|
46
|
+
selectionMode: "single",
|
|
47
|
+
layout: "grid",
|
|
48
|
+
...listBoxSelectionProps,
|
|
49
|
+
onSelectionChange: (key) => {
|
|
50
|
+
if (key === "all") return;
|
|
51
|
+
const selectedKey = [...key][0];
|
|
66
52
|
const selectedMonthValue = parseMonthFromKey(selectedKey);
|
|
67
53
|
if (selectedMonthValue !== null) {
|
|
68
54
|
const nextSelectedDate = state.focusedDate.set({ month: selectedMonthValue });
|
|
69
55
|
state.setFocusedDate(nextSelectedDate);
|
|
70
56
|
onDateChange?.(nextSelectedDate);
|
|
71
57
|
}
|
|
72
|
-
onSelectionChange(
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
size: "label-2",
|
|
102
|
-
children: month_0
|
|
103
|
-
})
|
|
104
|
-
}, monthNumber);
|
|
58
|
+
onSelectionChange(key);
|
|
59
|
+
},
|
|
60
|
+
className: "grid size-full min-h-72 grid-cols-3 grid-rows-4 gap-2 p-3 md:w-80",
|
|
61
|
+
children: getMonths().map((month, index) => {
|
|
62
|
+
const monthNumber = index + 1;
|
|
63
|
+
const isDisabled = isMonthDisabled(monthNumber);
|
|
64
|
+
return /* @__PURE__ */ jsx(ListBoxItem, {
|
|
65
|
+
id: monthNumber,
|
|
66
|
+
textValue: month,
|
|
67
|
+
isDisabled,
|
|
68
|
+
onPress: () => {
|
|
69
|
+
const isSecondConsecutivePress = lastPressedMonthRef.current === monthNumber;
|
|
70
|
+
lastPressedMonthRef.current = monthNumber;
|
|
71
|
+
const nextSelectedDate = state.focusedDate.set({ month: monthNumber });
|
|
72
|
+
state.setFocusedDate(nextSelectedDate);
|
|
73
|
+
onDateChange?.(nextSelectedDate);
|
|
74
|
+
if (!isSecondConsecutivePress) return;
|
|
75
|
+
if (selectedMonth === null) return;
|
|
76
|
+
if (monthNumber !== selectedMonth) return;
|
|
77
|
+
onCommit?.();
|
|
78
|
+
},
|
|
79
|
+
className: clsx("flex items-center justify-center text-interactive-text-secondary-idle", "rounded-button-rounding-m border border-elevation-outline-default-1 border-solid bg-elevation-fill-default-1", "hover:text-interactive-text-secondary-hover", "selected:border-interactive-contained-primary-idle selected:bg-interactive-contained-primary-idle selected:text-interactive-text-secondary-idle-inverted", "focus:outline-none focus-visible:outline-1 focus-visible:outline-interactive-contained-primary-focus focus-visible:outline-offset-1", isDisabled ? "cursor-default opacity-50" : "cursor-pointer"),
|
|
80
|
+
children: /* @__PURE__ */ jsx(Typography, {
|
|
81
|
+
as: "span",
|
|
82
|
+
size: "label-2",
|
|
83
|
+
children: month
|
|
84
|
+
})
|
|
85
|
+
}, monthNumber);
|
|
86
|
+
})
|
|
105
87
|
});
|
|
106
|
-
let t10;
|
|
107
|
-
if ($[10] !== T0 || $[11] !== listBoxSelectionProps || $[12] !== t7 || $[13] !== t9) {
|
|
108
|
-
t10 = /* @__PURE__ */ jsx(T0, {
|
|
109
|
-
autoFocus: t3,
|
|
110
|
-
"aria-label": t4,
|
|
111
|
-
selectionMode: t5,
|
|
112
|
-
layout: t6,
|
|
113
|
-
...listBoxSelectionProps,
|
|
114
|
-
onSelectionChange: t7,
|
|
115
|
-
className: t8,
|
|
116
|
-
children: t9
|
|
117
|
-
});
|
|
118
|
-
$[10] = T0;
|
|
119
|
-
$[11] = listBoxSelectionProps;
|
|
120
|
-
$[12] = t7;
|
|
121
|
-
$[13] = t9;
|
|
122
|
-
$[14] = t10;
|
|
123
|
-
} else t10 = $[14];
|
|
124
|
-
return t10;
|
|
125
88
|
};
|
|
126
|
-
function _temp(key) {
|
|
127
|
-
if (typeof key === "number") return key;
|
|
128
|
-
if (typeof key === "string") {
|
|
129
|
-
const parsedMonth = Number.parseInt(key, 10);
|
|
130
|
-
if (!Number.isNaN(parsedMonth)) return parsedMonth;
|
|
131
|
-
}
|
|
132
|
-
return null;
|
|
133
|
-
}
|
|
134
89
|
//#endregion
|
|
135
90
|
export { MonthPicker };
|