@povio/ui 2.1.14 → 2.1.16
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 +80 -0
- package/dist/AclGuard.js +12 -0
- package/dist/ActionModal.js +51 -0
- package/dist/Alert.js +46 -0
- package/dist/AlignCenter.js +13 -0
- package/dist/AlignLeft.js +13 -0
- package/dist/AlignLeftRight.js +13 -0
- package/dist/AlignRight.js +13 -0
- package/dist/ArrowDropDown.js +13 -0
- package/dist/ArrowDropUp.js +13 -0
- package/dist/ArrowLeft.js +13 -0
- package/dist/ArrowRight.js +13 -0
- package/dist/AuthGuard.js +22 -0
- package/dist/Autocomplete.js +28 -0
- package/dist/Bold.js +13 -0
- package/dist/BottomSheet.js +191 -0
- package/dist/BulletedList.js +13 -0
- package/dist/Button.js +54 -0
- package/dist/ButtonContent.js +28 -0
- package/dist/Calendar.js +15 -0
- package/dist/Calendar2.js +54 -0
- package/dist/CalendarCell.js +130 -0
- package/dist/CalendarGrid.js +50 -0
- package/dist/CalendarHeader.js +75 -0
- package/dist/CalendarSelectHeader.js +170 -0
- package/dist/Can.js +13 -0
- package/dist/CellText.js +13 -0
- package/dist/Check.js +15 -0
- package/dist/CheckCircle.js +13 -0
- package/dist/CheckContent.js +16 -0
- package/dist/Checkbox.js +61 -0
- package/dist/CheckboxCheckmark.js +16 -0
- package/dist/CheckboxCheckmark2.js +25 -0
- package/dist/CheckboxIndeterminate.js +16 -0
- package/dist/ChevronDown.js +15 -0
- package/dist/ChevronLeft.js +15 -0
- package/dist/ChevronRight.js +15 -0
- package/dist/ChevronUp.js +15 -0
- package/dist/ChevronsLeft.js +15 -0
- package/dist/ChevronsRight.js +15 -0
- package/dist/Clock.js +13 -0
- package/dist/Close.js +13 -0
- package/dist/ColorPicker.js +16 -0
- package/dist/ColorPickerDropdown.js +51 -0
- package/dist/ColumnConfig.js +81 -0
- package/dist/DateField.js +89 -0
- package/dist/DatePicker.js +197 -0
- package/dist/DatePickerInput.js +158 -0
- package/dist/DateRangePicker.js +601 -0
- package/dist/DateSegmentItem.js +29 -0
- package/dist/DateTime.js +18 -0
- package/dist/DateTimeDialog.js +49 -0
- package/dist/DateTimeDialogFooter.js +25 -0
- package/dist/DateTimePicker.js +209 -0
- package/dist/Drag.js +13 -0
- package/dist/Drawer.js +43 -0
- package/dist/File.js +15 -0
- package/dist/FileCard.js +50 -0
- package/dist/FileCardList.js +17 -0
- package/dist/FileUpload.js +189 -0
- package/dist/FileUploadContainer.js +12 -0
- package/dist/FileUploadContent.js +61 -0
- package/dist/FileUploadContentEmpty.js +54 -0
- package/dist/FileUploadContentError.js +109 -0
- package/dist/FileUploadContentFilled.js +112 -0
- package/dist/FileUploadContentLoading.js +76 -0
- package/dist/Form.js +42 -0
- package/dist/FormField.js +35 -0
- package/dist/FormFieldError.js +11 -0
- package/dist/FormFieldHeader.js +36 -0
- package/dist/FormFieldHeaderClose.js +15 -0
- package/dist/FormFieldLabel.js +32 -0
- package/dist/HeaderText.js +10 -0
- package/dist/Highlight.js +13 -0
- package/dist/HighlightOn.js +19 -0
- package/dist/HyperlinkAction.js +70 -0
- package/dist/IconButton.js +12 -0
- package/dist/InfiniteTable.js +31 -0
- package/dist/Info.js +18 -0
- package/dist/InlineIconButton.js +13 -0
- package/dist/InputClear.js +19 -0
- package/dist/InputContent.js +94 -0
- package/dist/InputItem.js +54 -0
- package/dist/InputUpload.js +111 -0
- package/dist/InputUploadContent.js +52 -0
- package/dist/InputUploadFilled.js +26 -0
- package/dist/Inputs.js +15 -0
- package/dist/Italic.js +13 -0
- package/dist/Link.js +13 -0
- package/dist/Link2.js +19 -0
- package/dist/Loader.js +32 -0
- package/dist/Menu.js +13 -0
- package/dist/Menu2.js +9 -0
- package/dist/MenuDesktop.js +53 -0
- package/dist/MenuItem.js +21 -0
- package/dist/MenuMobile.js +64 -0
- package/dist/MenuPopover.js +30 -0
- package/dist/Modal.js +49 -0
- package/dist/MonthPicker.js +56 -0
- package/dist/NumberInput.js +132 -0
- package/dist/NumberedList.js +13 -0
- package/dist/PaginatedTable.js +26 -0
- package/dist/Pagination.js +43 -0
- package/dist/PaginationList.js +105 -0
- package/dist/PasswordInput.js +21 -0
- package/dist/PillButton.js +37 -0
- package/dist/PointerHorizontal.js +13 -0
- package/dist/PointerVertical.js +13 -0
- package/dist/ProgressBar.js +25 -0
- package/dist/QueryAutocomplete.js +18 -0
- package/dist/RadioGroup.js +81 -0
- package/dist/RangeCalendar.js +96 -0
- package/dist/ResponsivePopover.js +41 -0
- package/dist/Segment.js +82 -0
- package/dist/SegmentItem.js +23 -0
- package/dist/Select.js +24 -0
- package/dist/SelectBase.js +28 -0
- package/dist/SelectDesktop.js +147 -0
- package/dist/SelectInput.js +159 -0
- package/dist/SelectInputTags.js +29 -0
- package/dist/SelectListBox.js +73 -0
- package/dist/SelectListBoxItem.js +48 -0
- package/dist/SelectListBoxItemSelectAll.js +31 -0
- package/dist/SelectListBoxLoadingItem.js +41 -0
- package/dist/SelectListBoxSelectionBar.js +25 -0
- package/dist/SelectMobile.js +111 -0
- package/dist/Send.js +15 -0
- package/dist/Slider.js +93 -0
- package/dist/SplitButton.js +36 -0
- package/dist/Strikethrough.js +13 -0
- package/dist/Table.js +248 -0
- package/dist/Tag.js +42 -0
- package/dist/TextAlignSelect.js +44 -0
- package/dist/TextArea.js +120 -0
- package/dist/TextButton.js +13 -0
- package/dist/TextColor.js +16 -0
- package/dist/TextColorSelect.js +22 -0
- package/dist/TextEditor.js +143 -0
- package/dist/TextEditorToolbar.js +30 -0
- package/dist/TextHighlightSelect.js +24 -0
- package/dist/TextInput.js +125 -0
- package/dist/TextListActions.js +42 -0
- package/dist/TextMarksActions.js +67 -0
- package/dist/TextStyleSelect.js +52 -0
- package/dist/TimeField.js +17 -0
- package/dist/TimePicker.js +158 -0
- package/dist/TimePickerForm.js +158 -0
- package/dist/TimePickerInput.js +92 -0
- package/dist/Toast.js +58 -0
- package/dist/Today.js +13 -0
- package/dist/Toggle.js +60 -0
- package/dist/ToggleButton.js +13 -0
- package/dist/Tooltip.js +49 -0
- package/dist/TooltipEllipsis.js +18 -0
- package/dist/TooltipWrapper.js +19 -0
- package/dist/Typography.js +14 -0
- package/dist/Underlined.js +15 -0
- package/dist/Upload.js +16 -0
- package/dist/View.js +13 -0
- package/dist/ViewOff.js +13 -0
- package/dist/WarningFilled.js +15 -0
- package/dist/YearPicker.js +64 -0
- package/dist/ability.context.js +35 -0
- package/dist/alert.cva.js +62 -0
- package/dist/array.utils.js +8 -0
- package/dist/auth.context.js +37 -0
- package/dist/auth.js +6 -12
- package/dist/button.cva.js +656 -0
- package/dist/buttonContent.cva.js +10 -0
- package/dist/checkbox.cva.js +47 -0
- package/dist/components/inputs/Checkbox/Checkbox.d.ts +1 -0
- package/dist/components/inputs/Checkbox/CheckboxCheckmark.d.ts +2 -2
- package/dist/components/inputs/Checkbox/checkbox.cva.d.ts +5 -0
- package/dist/components/inputs/DateTime/DatePicker/DatePicker.d.ts +3 -1
- package/dist/components/inputs/DateTime/DateRangePicker/DateRangePicker.d.ts +3 -1
- package/dist/components/inputs/DateTime/DateTimePicker/DateTimePicker.d.ts +3 -1
- package/dist/components/inputs/DateTime/TimePicker/TimePicker.d.ts +1 -0
- package/dist/components/inputs/DateTime/shared/DateField.d.ts +1 -0
- package/dist/components/inputs/DateTime/shared/DatePickerInput.d.ts +8 -2
- package/dist/components/inputs/DateTime/shared/TimePickerInput.d.ts +2 -1
- package/dist/components/inputs/File/fileUpload.types.d.ts +1 -0
- package/dist/components/inputs/FormField/FormField.d.ts +4 -1
- package/dist/components/inputs/Input/NumberInput/NumberInput.d.ts +4 -2
- package/dist/components/inputs/Input/TextArea/TextArea.d.ts +1 -0
- package/dist/components/inputs/Input/TextInput/TextInput.d.ts +2 -1
- package/dist/components/inputs/Input/shared/InputContent.d.ts +4 -3
- package/dist/components/inputs/RadioGroup/RadioGroup.d.ts +3 -0
- package/dist/components/inputs/TextEditor/TextEditor.d.ts +1 -0
- package/dist/components/inputs/Toggle/Toggle.d.ts +2 -0
- package/dist/components/inputs/shared/CheckContent.d.ts +2 -1
- package/dist/compoundMapper.js +11 -0
- package/dist/config/uiStyle.context.d.ts +2 -1
- package/dist/confirmation.context.js +78 -0
- package/dist/date-time.utils.js +50 -0
- package/dist/date.utils.js +17 -0
- package/dist/dom.utils.js +17 -0
- package/dist/dynamicColumns.js +272 -0
- package/dist/dynamicInputs.js +186 -0
- package/dist/error-handling.js +87 -0
- package/dist/file.utils.js +43 -0
- package/dist/fileUpload.cva.js +49 -0
- package/dist/i18n.js +8 -0
- package/dist/index.js +136 -278
- package/dist/input.cva.js +210 -0
- package/dist/inputUploadButton.cva.js +27 -0
- package/dist/isEqual.js +57 -0
- package/dist/label.cva.js +104 -0
- package/dist/link.context.js +17 -0
- package/dist/link.cva.js +7 -0
- package/dist/loader.cva.js +16 -0
- package/dist/logger.js +17 -0
- package/dist/menu.cva.js +27 -0
- package/dist/minWidth.cva.js +9 -0
- package/dist/modal.cva.js +31 -0
- package/dist/object.utils.js +36 -0
- package/dist/outline.clsx.js +4 -0
- package/dist/pillButton.cva.js +254 -0
- package/dist/queries.utils.js +7 -0
- package/dist/radio.cva.js +42 -0
- package/dist/react.js +6 -0
- package/dist/rest-interceptor.js +22 -0
- package/dist/rest.utils.js +31 -0
- package/dist/rolldown_runtime.js +16 -0
- package/dist/router.context.js +37 -0
- package/dist/routing.utils.js +9 -0
- package/dist/segment.cva.js +25 -0
- package/dist/select.context.js +190 -0
- package/dist/status.cva.js +57 -0
- package/dist/string.utils.js +10 -0
- package/dist/table.cva.js +35 -0
- package/dist/tag.cva.js +50 -0
- package/dist/text-editor.js +2 -4
- package/dist/textEditor.types.js +38 -0
- package/dist/theme.context.js +65 -0
- package/dist/toast.cva.js +158 -0
- package/dist/toggle.cva.js +27 -0
- package/dist/tooltip.cva.js +30 -0
- package/dist/translation.js +147 -0
- package/dist/translation2.js +145 -0
- package/dist/typography.cva.js +124 -0
- package/dist/uiConfig.context.js +58 -0
- package/dist/uiStyle.context.js +16 -0
- package/dist/useAutosave.js +62 -0
- package/dist/useBreakpoint.js +28 -0
- package/dist/useDebounceCallback.js +23 -0
- package/dist/useDeepCompare.js +21 -0
- package/dist/useFilters.js +121 -0
- package/dist/useForm.js +12 -0
- package/dist/useFormAutosave.js +52 -0
- package/dist/useIntersectionObserver.js +23 -0
- package/dist/useLocalStorage.js +35 -0
- package/dist/useLongPressRepeat.js +27 -0
- package/dist/usePagination.js +26 -0
- package/dist/useScrollableListBox.js +24 -0
- package/dist/useSelectItems.js +82 -0
- package/dist/useSorting.js +34 -0
- package/dist/useStateAndRef.js +15 -0
- package/dist/useTableColumnConfig.js +38 -0
- package/dist/useTableNav.js +279 -0
- package/dist/useToast.js +63 -0
- package/dist/useTranslationMemo.js +10 -0
- package/dist/zod.utils.js +17 -0
- package/package.json +14 -14
- package/dist/assets/icons/AlignCenter.js +0 -21
- package/dist/assets/icons/AlignLeft.js +0 -21
- package/dist/assets/icons/AlignLeftRight.js +0 -21
- package/dist/assets/icons/AlignRight.js +0 -21
- package/dist/assets/icons/ArrowDropDown.js +0 -21
- package/dist/assets/icons/ArrowDropUp.js +0 -21
- package/dist/assets/icons/ArrowLeft.js +0 -21
- package/dist/assets/icons/ArrowRight.js +0 -21
- package/dist/assets/icons/Bold.js +0 -21
- package/dist/assets/icons/BulletedList.js +0 -21
- package/dist/assets/icons/Calendar.js +0 -23
- package/dist/assets/icons/Check.js +0 -23
- package/dist/assets/icons/CheckCircle.js +0 -21
- package/dist/assets/icons/CheckboxCheckmark.js +0 -24
- package/dist/assets/icons/CheckboxIndeterminate.js +0 -24
- package/dist/assets/icons/ChevronDown.js +0 -23
- package/dist/assets/icons/ChevronLeft.js +0 -23
- package/dist/assets/icons/ChevronRight.js +0 -23
- package/dist/assets/icons/ChevronUp.js +0 -23
- package/dist/assets/icons/ChevronsLeft.js +0 -23
- package/dist/assets/icons/ChevronsRight.js +0 -23
- package/dist/assets/icons/Clock.js +0 -21
- package/dist/assets/icons/Close.js +0 -21
- package/dist/assets/icons/DateTime.js +0 -32
- package/dist/assets/icons/Drag.js +0 -21
- package/dist/assets/icons/File.js +0 -23
- package/dist/assets/icons/Highlight.js +0 -21
- package/dist/assets/icons/HighlightOn.js +0 -30
- package/dist/assets/icons/Info.js +0 -32
- package/dist/assets/icons/Italic.js +0 -21
- package/dist/assets/icons/Link.js +0 -21
- package/dist/assets/icons/Menu.js +0 -21
- package/dist/assets/icons/NumberedList.js +0 -21
- package/dist/assets/icons/PointerHorizontal.js +0 -21
- package/dist/assets/icons/PointerVertical.js +0 -21
- package/dist/assets/icons/Send.js +0 -23
- package/dist/assets/icons/Strikethrough.js +0 -21
- package/dist/assets/icons/TextColor.js +0 -30
- package/dist/assets/icons/Today.js +0 -21
- package/dist/assets/icons/Underlined.js +0 -23
- package/dist/assets/icons/Upload.js +0 -30
- package/dist/assets/icons/View.js +0 -18
- package/dist/assets/icons/ViewOff.js +0 -18
- package/dist/assets/icons/WarningFilled.js +0 -23
- package/dist/assets/locales/en/translation.json.js +0 -14
- package/dist/assets/locales/sl/translation.json.js +0 -14
- package/dist/components/Menu/Menu.js +0 -14
- package/dist/components/Menu/MenuDesktop.js +0 -74
- package/dist/components/Menu/MenuItem.js +0 -27
- package/dist/components/Menu/MenuMobile.js +0 -83
- package/dist/components/Menu/MenuPopover.js +0 -43
- package/dist/components/Menu/menu.cva.js +0 -45
- package/dist/components/buttons/Button/Button.js +0 -73
- package/dist/components/buttons/Button/button.cva.js +0 -666
- package/dist/components/buttons/IconButton/IconButton.js +0 -17
- package/dist/components/buttons/InlineIconButton/InlineIconButton.js +0 -18
- package/dist/components/buttons/PillButton/PillButton.js +0 -44
- package/dist/components/buttons/PillButton/pillButton.cva.js +0 -268
- package/dist/components/buttons/SplitButton/SplitButton.js +0 -65
- package/dist/components/buttons/TextButton/TextButton.js +0 -18
- package/dist/components/buttons/ToggleButton/ToggleButton.js +0 -21
- package/dist/components/buttons/shared/ButtonContent.js +0 -53
- package/dist/components/buttons/shared/buttonContent.cva.js +0 -16
- package/dist/components/inputs/Checkbox/Checkbox.js +0 -81
- package/dist/components/inputs/Checkbox/CheckboxCheckmark.js +0 -32
- package/dist/components/inputs/Checkbox/checkbox.cva.js +0 -51
- package/dist/components/inputs/DateTime/DatePicker/DatePicker.js +0 -251
- package/dist/components/inputs/DateTime/DateRangePicker/DateRangePicker.js +0 -689
- package/dist/components/inputs/DateTime/DateTimePicker/DateTimePicker.js +0 -265
- package/dist/components/inputs/DateTime/TimePicker/TimePicker.js +0 -217
- package/dist/components/inputs/DateTime/shared/Calendar.js +0 -85
- package/dist/components/inputs/DateTime/shared/CalendarCell.js +0 -160
- package/dist/components/inputs/DateTime/shared/CalendarGrid.js +0 -67
- package/dist/components/inputs/DateTime/shared/CalendarHeader.js +0 -89
- package/dist/components/inputs/DateTime/shared/CalendarSelectHeader.js +0 -203
- package/dist/components/inputs/DateTime/shared/DateField.js +0 -77
- package/dist/components/inputs/DateTime/shared/DatePickerInput.js +0 -206
- package/dist/components/inputs/DateTime/shared/DateSegmentItem.js +0 -55
- package/dist/components/inputs/DateTime/shared/DateTimeDialog.js +0 -76
- package/dist/components/inputs/DateTime/shared/DateTimeDialogFooter.js +0 -47
- package/dist/components/inputs/DateTime/shared/MonthPicker.js +0 -82
- package/dist/components/inputs/DateTime/shared/RangeCalendar.js +0 -133
- package/dist/components/inputs/DateTime/shared/TimeField.js +0 -26
- package/dist/components/inputs/DateTime/shared/TimePickerForm.js +0 -186
- package/dist/components/inputs/DateTime/shared/TimePickerInput.js +0 -125
- package/dist/components/inputs/DateTime/shared/YearPicker.js +0 -89
- package/dist/components/inputs/File/FileUpload.js +0 -257
- package/dist/components/inputs/File/FileUploadContainer.js +0 -17
- package/dist/components/inputs/File/InputUpload.js +0 -174
- package/dist/components/inputs/File/shared/FileCard.js +0 -67
- package/dist/components/inputs/File/shared/FileCardList.js +0 -20
- package/dist/components/inputs/File/shared/FileUploadContent.js +0 -92
- package/dist/components/inputs/File/shared/FileUploadContentEmpty.js +0 -92
- package/dist/components/inputs/File/shared/FileUploadContentError.js +0 -167
- package/dist/components/inputs/File/shared/FileUploadContentFilled.js +0 -173
- package/dist/components/inputs/File/shared/FileUploadContentLoading.js +0 -128
- package/dist/components/inputs/File/shared/InputUploadContent.js +0 -73
- package/dist/components/inputs/File/shared/InputUploadFilled.js +0 -45
- package/dist/components/inputs/File/shared/ProgressBar.js +0 -42
- package/dist/components/inputs/File/shared/fileUpload.cva.js +0 -58
- package/dist/components/inputs/File/shared/inputUploadButton.cva.js +0 -49
- package/dist/components/inputs/FormField/FormField.js +0 -54
- package/dist/components/inputs/FormField/FormFieldError.js +0 -16
- package/dist/components/inputs/FormField/FormFieldHeader.js +0 -57
- package/dist/components/inputs/FormField/FormFieldHeaderClose.js +0 -20
- package/dist/components/inputs/FormField/FormFieldLabel.js +0 -37
- package/dist/components/inputs/Input/NumberInput/NumberInput.js +0 -166
- package/dist/components/inputs/Input/PasswordInput/PasswordInput.js +0 -26
- package/dist/components/inputs/Input/TextArea/TextArea.js +0 -155
- package/dist/components/inputs/Input/TextInput/TextInput.js +0 -162
- package/dist/components/inputs/Input/shared/InputContent.js +0 -114
- package/dist/components/inputs/Inputs/Form.js +0 -68
- package/dist/components/inputs/Inputs/InputItem.js +0 -61
- package/dist/components/inputs/Inputs/Inputs.js +0 -32
- package/dist/components/inputs/RadioGroup/RadioGroup.js +0 -103
- package/dist/components/inputs/RadioGroup/radio.cva.js +0 -57
- package/dist/components/inputs/Selection/Autocomplete/Autocomplete.js +0 -39
- package/dist/components/inputs/Selection/Autocomplete/QueryAutocomplete.js +0 -25
- package/dist/components/inputs/Selection/Select/Select.js +0 -32
- package/dist/components/inputs/Selection/shared/SelectBase.js +0 -27
- package/dist/components/inputs/Selection/shared/SelectDesktop.js +0 -223
- package/dist/components/inputs/Selection/shared/SelectInput.js +0 -234
- package/dist/components/inputs/Selection/shared/SelectInputTags.js +0 -49
- package/dist/components/inputs/Selection/shared/SelectListBox.js +0 -127
- package/dist/components/inputs/Selection/shared/SelectListBoxItem.js +0 -78
- package/dist/components/inputs/Selection/shared/SelectListBoxItemSelectAll.js +0 -45
- package/dist/components/inputs/Selection/shared/SelectListBoxLoadingItem.js +0 -47
- package/dist/components/inputs/Selection/shared/SelectListBoxSelectionBar.js +0 -42
- package/dist/components/inputs/Selection/shared/SelectMobile.js +0 -165
- package/dist/components/inputs/Selection/shared/select.context.js +0 -244
- package/dist/components/inputs/Selection/shared/useSelectItems.js +0 -94
- package/dist/components/inputs/Slider/Slider.js +0 -137
- package/dist/components/inputs/TextEditor/TextEditor.js +0 -223
- package/dist/components/inputs/TextEditor/Toolbar/ColorPicker.js +0 -34
- package/dist/components/inputs/TextEditor/Toolbar/ColorPickerDropdown.js +0 -80
- package/dist/components/inputs/TextEditor/Toolbar/HyperlinkAction.js +0 -92
- package/dist/components/inputs/TextEditor/Toolbar/TextAlignSelect.js +0 -56
- package/dist/components/inputs/TextEditor/Toolbar/TextColorSelect.js +0 -33
- package/dist/components/inputs/TextEditor/Toolbar/TextEditorToolbar.js +0 -31
- package/dist/components/inputs/TextEditor/Toolbar/TextHighlightSelect.js +0 -37
- package/dist/components/inputs/TextEditor/Toolbar/TextListActions.js +0 -51
- package/dist/components/inputs/TextEditor/Toolbar/TextMarksActions.js +0 -73
- package/dist/components/inputs/TextEditor/Toolbar/TextStyleSelect.js +0 -61
- package/dist/components/inputs/TextEditor/textEditor.types.js +0 -40
- package/dist/components/inputs/Toggle/Toggle.js +0 -65
- package/dist/components/inputs/Toggle/toggle.cva.js +0 -44
- package/dist/components/inputs/shared/CheckContent.js +0 -22
- package/dist/components/inputs/shared/InputClear.js +0 -27
- package/dist/components/inputs/shared/TooltipWrapper.js +0 -23
- package/dist/components/inputs/shared/input.cva.js +0 -174
- package/dist/components/inputs/shared/label.cva.js +0 -128
- package/dist/components/outline.clsx.js +0 -11
- package/dist/components/overlays/ActionModal/ActionModal.js +0 -80
- package/dist/components/overlays/BottomSheet/BottomSheet.js +0 -261
- package/dist/components/overlays/Drawer/Drawer.js +0 -84
- package/dist/components/overlays/Modal/Modal.js +0 -64
- package/dist/components/overlays/Modal/modal.cva.js +0 -53
- package/dist/components/overlays/ResponsivePopover/ResponsivePopover.js +0 -71
- package/dist/components/overlays/Tooltip/Tooltip.js +0 -92
- package/dist/components/overlays/Tooltip/TooltipEllipsis.js +0 -27
- package/dist/components/overlays/Tooltip/tooltip.cva.js +0 -60
- package/dist/components/segment/Segment.js +0 -118
- package/dist/components/segment/SegmentItem.js +0 -35
- package/dist/components/segment/segment.cva.js +0 -35
- package/dist/components/shared/pagination/Pagination.js +0 -75
- package/dist/components/shared/pagination/PaginationList.js +0 -145
- package/dist/components/shared/pagination/minWidth.cva.js +0 -15
- package/dist/components/status/Alert/Alert.js +0 -41
- package/dist/components/status/Alert/alert.cva.js +0 -64
- package/dist/components/status/Loader/Loader.js +0 -37
- package/dist/components/status/Loader/loader.cva.js +0 -27
- package/dist/components/status/Toast/Toast.js +0 -65
- package/dist/components/status/Toast/toast.cva.js +0 -150
- package/dist/components/status/Toast/useToast.js +0 -94
- package/dist/components/status/shared/status.cva.js +0 -62
- package/dist/components/table/CellText.js +0 -18
- package/dist/components/table/ColumnConfig.js +0 -124
- package/dist/components/table/HeaderText.js +0 -15
- package/dist/components/table/InfiniteTable.js +0 -40
- package/dist/components/table/PaginatedTable.js +0 -33
- package/dist/components/table/Table.js +0 -370
- package/dist/components/table/table.cva.js +0 -63
- package/dist/components/text/Link/Link.js +0 -24
- package/dist/components/text/Link/link.cva.js +0 -18
- package/dist/components/text/Tag/Tag.js +0 -49
- package/dist/components/text/Tag/tag.cva.js +0 -59
- package/dist/components/text/Typography/Typography.js +0 -22
- package/dist/components/text/Typography/typography.cva.js +0 -100
- package/dist/config/confirmation.context.js +0 -107
- package/dist/config/i18n.js +0 -15
- package/dist/config/link.context.js +0 -19
- package/dist/config/router.context.js +0 -39
- package/dist/config/theme.context.js +0 -73
- package/dist/config/uiConfig.context.js +0 -69
- package/dist/config/uiStyle.context.js +0 -16
- package/dist/helpers/dynamicColumns.js +0 -359
- package/dist/helpers/dynamicInputs.js +0 -212
- package/dist/hooks/useAutosave.js +0 -83
- package/dist/hooks/useBreakpoint.js +0 -33
- package/dist/hooks/useDebounceCallback.js +0 -29
- package/dist/hooks/useDeepCompare.js +0 -25
- package/dist/hooks/useFilters.js +0 -160
- package/dist/hooks/useForm.js +0 -22
- package/dist/hooks/useFormAutosave.js +0 -67
- package/dist/hooks/useIntersectionObserver.js +0 -27
- package/dist/hooks/useLocalStorage.js +0 -54
- package/dist/hooks/useLongPressRepeat.js +0 -33
- package/dist/hooks/usePagination.js +0 -35
- package/dist/hooks/useScrollableListBox.js +0 -30
- package/dist/hooks/useSorting.js +0 -32
- package/dist/hooks/useStateAndRef.js +0 -17
- package/dist/hooks/useTableColumnConfig.js +0 -63
- package/dist/hooks/useTableNav.js +0 -394
- package/dist/hooks/useTranslationMemo.js +0 -14
- package/dist/utils/array.utils.js +0 -12
- package/dist/utils/compoundMapper.js +0 -14
- package/dist/utils/date-time.utils.js +0 -77
- package/dist/utils/date.utils.js +0 -23
- package/dist/utils/dom.utils.js +0 -13
- package/dist/utils/file.utils.js +0 -63
- package/dist/utils/isEqual.js +0 -95
- package/dist/utils/logger.js +0 -19
- package/dist/utils/object.utils.js +0 -53
- package/dist/utils/queries.utils.js +0 -9
- package/dist/utils/rest.utils.js +0 -51
- package/dist/utils/routing.utils.js +0 -15
- package/dist/utils/string.utils.js +0 -12
- package/dist/utils/vendor/acl/AclGuard.js +0 -14
- package/dist/utils/vendor/acl/Can.js +0 -18
- package/dist/utils/vendor/acl/ability.context.js +0 -37
- package/dist/utils/vendor/auth/AuthGuard.js +0 -26
- package/dist/utils/vendor/auth/auth.context.js +0 -41
- package/dist/utils/vendor/error-handling.js +0 -119
- package/dist/utils/vendor/rest-interceptor.js +0 -21
- package/dist/utils/zod.utils.js +0 -21
|
@@ -1,265 +0,0 @@
|
|
|
1
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Time, today, getLocalTimeZone, createCalendar, CalendarDateTime, now } from "@internationalized/date";
|
|
3
|
-
import { mergeRefs } from "@react-aria/utils";
|
|
4
|
-
import { useEffect, useRef } from "react";
|
|
5
|
-
import { useDatePicker, useLocale } from "react-aria";
|
|
6
|
-
import { Controller } from "react-hook-form";
|
|
7
|
-
import { useDatePickerState, useCalendarState } from "react-stately";
|
|
8
|
-
import { Calendar } from "../shared/Calendar.js";
|
|
9
|
-
import { DatePickerInput } from "../shared/DatePickerInput.js";
|
|
10
|
-
import { DateTimeDialog } from "../shared/DateTimeDialog.js";
|
|
11
|
-
import { DateTimeDialogFooter } from "../shared/DateTimeDialogFooter.js";
|
|
12
|
-
import { FormField } from "../../FormField/FormField.js";
|
|
13
|
-
import { TooltipWrapper } from "../../shared/TooltipWrapper.js";
|
|
14
|
-
import { UIConfig } from "../../../../config/uiConfig.context.js";
|
|
15
|
-
import { DateTimeUtils } from "../../../../utils/date-time.utils.js";
|
|
16
|
-
const PLACEHOLDER_VALUE = new CalendarDateTime(2024, 1, 1);
|
|
17
|
-
const DateTimePickerBase = (props) => {
|
|
18
|
-
const ui = UIConfig.useConfig();
|
|
19
|
-
const {
|
|
20
|
-
ref,
|
|
21
|
-
label,
|
|
22
|
-
tooltipText,
|
|
23
|
-
helperText,
|
|
24
|
-
isRequired,
|
|
25
|
-
rightContent,
|
|
26
|
-
isDisabled,
|
|
27
|
-
headerClassName,
|
|
28
|
-
errorClassName,
|
|
29
|
-
isHeaderHidden,
|
|
30
|
-
error,
|
|
31
|
-
onChange,
|
|
32
|
-
value,
|
|
33
|
-
disableDropdown,
|
|
34
|
-
isTimeOptional,
|
|
35
|
-
placeholder,
|
|
36
|
-
hideLabel = ui.input.hideLabel,
|
|
37
|
-
variant = ui.input.variant,
|
|
38
|
-
as = ui.input.as,
|
|
39
|
-
size = ui.input.size,
|
|
40
|
-
isClearable = ui.input.isClearable,
|
|
41
|
-
todayIcon = ui.dateInput.todayIcon,
|
|
42
|
-
shouldForceLeadingZeros = ui.dateInput.shouldForceLeadingZeros,
|
|
43
|
-
disableManualEntry = ui.dateInput.disableManualEntry,
|
|
44
|
-
...rest
|
|
45
|
-
} = props;
|
|
46
|
-
const formFieldProps = {
|
|
47
|
-
error,
|
|
48
|
-
label,
|
|
49
|
-
tooltipText,
|
|
50
|
-
helperText,
|
|
51
|
-
isRequired,
|
|
52
|
-
rightContent,
|
|
53
|
-
isHeaderHidden: isHeaderHidden || as === "inline" || as === "filter" || as === "floating",
|
|
54
|
-
hideLabel,
|
|
55
|
-
isDisabled,
|
|
56
|
-
headerClassName,
|
|
57
|
-
errorClassName
|
|
58
|
-
};
|
|
59
|
-
const dialogState = useDatePickerState({
|
|
60
|
-
...rest,
|
|
61
|
-
defaultValue: value || rest.defaultValue,
|
|
62
|
-
shouldCloseOnSelect: false,
|
|
63
|
-
granularity: "minute",
|
|
64
|
-
hideTimeZone: true,
|
|
65
|
-
shouldForceLeadingZeros
|
|
66
|
-
});
|
|
67
|
-
useEffect(() => {
|
|
68
|
-
if (isTimeOptional && !dialogState.timeValue) {
|
|
69
|
-
dialogState.setTimeValue(new Time(0, 0));
|
|
70
|
-
}
|
|
71
|
-
}, [isTimeOptional, dialogState]);
|
|
72
|
-
const state = useDatePickerState({
|
|
73
|
-
...rest,
|
|
74
|
-
shouldForceLeadingZeros,
|
|
75
|
-
value,
|
|
76
|
-
onChange: (val) => {
|
|
77
|
-
onChange?.(val);
|
|
78
|
-
dialogState.setValue(val);
|
|
79
|
-
calendarState.setFocusedDate(val || today(getLocalTimeZone()));
|
|
80
|
-
},
|
|
81
|
-
shouldCloseOnSelect: false,
|
|
82
|
-
granularity: "minute",
|
|
83
|
-
hideTimeZone: true
|
|
84
|
-
});
|
|
85
|
-
const datePickerRef = useRef(null);
|
|
86
|
-
const { groupProps, labelProps, fieldProps, buttonProps, dialogProps } = useDatePicker(
|
|
87
|
-
{ ...rest, label, granularity: "minute", hideTimeZone: true, shouldForceLeadingZeros },
|
|
88
|
-
state,
|
|
89
|
-
datePickerRef
|
|
90
|
-
);
|
|
91
|
-
const { calendarProps } = useDatePicker({ ...rest, label, shouldForceLeadingZeros }, dialogState, datePickerRef);
|
|
92
|
-
const { locale } = useLocale();
|
|
93
|
-
const calendarState = useCalendarState({
|
|
94
|
-
...calendarProps,
|
|
95
|
-
locale,
|
|
96
|
-
createCalendar
|
|
97
|
-
});
|
|
98
|
-
const headerProps = {
|
|
99
|
-
label,
|
|
100
|
-
tooltipText,
|
|
101
|
-
helperText,
|
|
102
|
-
isRequired,
|
|
103
|
-
rightContent,
|
|
104
|
-
isHeaderHidden: hideLabel || isHeaderHidden,
|
|
105
|
-
isDisabled,
|
|
106
|
-
className: headerClassName,
|
|
107
|
-
labelProps
|
|
108
|
-
};
|
|
109
|
-
const onApply = () => {
|
|
110
|
-
state.setValue(dialogState.value);
|
|
111
|
-
state.toggle();
|
|
112
|
-
};
|
|
113
|
-
const onTodayPress = () => {
|
|
114
|
-
dialogState.setValue(now(getLocalTimeZone()));
|
|
115
|
-
calendarState.setFocusedDate(today(getLocalTimeZone()));
|
|
116
|
-
};
|
|
117
|
-
const onOpenChange = (isOpen) => {
|
|
118
|
-
state.toggle();
|
|
119
|
-
calendarState.setFocusedDate(state.value || today(getLocalTimeZone()));
|
|
120
|
-
if (!isOpen) {
|
|
121
|
-
dialogState.setValue(state.value);
|
|
122
|
-
}
|
|
123
|
-
};
|
|
124
|
-
const onInputBlur = (e) => {
|
|
125
|
-
if (!isTimeOptional) {
|
|
126
|
-
return;
|
|
127
|
-
}
|
|
128
|
-
const textValue = e.currentTarget.textContent;
|
|
129
|
-
const dateTimeValue = DateTimeUtils.formatTextDateToCalendarDateTime(textValue);
|
|
130
|
-
if (dateTimeValue) {
|
|
131
|
-
state.setValue(dateTimeValue);
|
|
132
|
-
dialogState.setValue(dateTimeValue);
|
|
133
|
-
dialogState.setTimeValue(new Time(0, 0));
|
|
134
|
-
}
|
|
135
|
-
};
|
|
136
|
-
return /* @__PURE__ */ jsx(
|
|
137
|
-
TooltipWrapper,
|
|
138
|
-
{
|
|
139
|
-
as,
|
|
140
|
-
error,
|
|
141
|
-
children: /* @__PURE__ */ jsxs(
|
|
142
|
-
FormField,
|
|
143
|
-
{
|
|
144
|
-
...formFieldProps,
|
|
145
|
-
as,
|
|
146
|
-
labelProps,
|
|
147
|
-
className: "relative inline-flex w-full flex-col text-left",
|
|
148
|
-
children: [
|
|
149
|
-
/* @__PURE__ */ jsx(
|
|
150
|
-
DatePickerInput,
|
|
151
|
-
{
|
|
152
|
-
ref: mergeRefs(ref, datePickerRef),
|
|
153
|
-
as,
|
|
154
|
-
groupProps,
|
|
155
|
-
fieldProps: {
|
|
156
|
-
...fieldProps,
|
|
157
|
-
placeholderValue: PLACEHOLDER_VALUE,
|
|
158
|
-
onBlur: (e) => {
|
|
159
|
-
fieldProps.onBlur?.(e);
|
|
160
|
-
onInputBlur(e);
|
|
161
|
-
}
|
|
162
|
-
},
|
|
163
|
-
buttonProps,
|
|
164
|
-
isDisabled,
|
|
165
|
-
isInvalid: !!error,
|
|
166
|
-
disableDropdown,
|
|
167
|
-
variant,
|
|
168
|
-
size,
|
|
169
|
-
isDateTime: true,
|
|
170
|
-
isClearable,
|
|
171
|
-
headerProps,
|
|
172
|
-
todayIcon,
|
|
173
|
-
disableManualEntry,
|
|
174
|
-
placeholder,
|
|
175
|
-
onOpenDropdown: () => state.toggle()
|
|
176
|
-
}
|
|
177
|
-
),
|
|
178
|
-
(!disableDropdown || disableManualEntry) && /* @__PURE__ */ jsx(
|
|
179
|
-
DateTimeDialog,
|
|
180
|
-
{
|
|
181
|
-
footer: /* @__PURE__ */ jsx(
|
|
182
|
-
DateTimeDialogFooter,
|
|
183
|
-
{
|
|
184
|
-
isDisabled,
|
|
185
|
-
isValid: !dialogState.isInvalid && !!dialogState.value,
|
|
186
|
-
onTodayPress,
|
|
187
|
-
onApply
|
|
188
|
-
}
|
|
189
|
-
),
|
|
190
|
-
label,
|
|
191
|
-
triggerRef: datePickerRef,
|
|
192
|
-
dialogProps,
|
|
193
|
-
isOpen: state.isOpen,
|
|
194
|
-
onOpenChange,
|
|
195
|
-
children: /* @__PURE__ */ jsx(
|
|
196
|
-
Calendar,
|
|
197
|
-
{
|
|
198
|
-
state: calendarState,
|
|
199
|
-
calendarProps,
|
|
200
|
-
includesTime: true,
|
|
201
|
-
datePickerState: dialogState,
|
|
202
|
-
onApply
|
|
203
|
-
}
|
|
204
|
-
)
|
|
205
|
-
}
|
|
206
|
-
)
|
|
207
|
-
]
|
|
208
|
-
}
|
|
209
|
-
)
|
|
210
|
-
}
|
|
211
|
-
);
|
|
212
|
-
};
|
|
213
|
-
const DateTimePicker = ({
|
|
214
|
-
fullIso = true,
|
|
215
|
-
...props
|
|
216
|
-
}) => {
|
|
217
|
-
const formatDateValue = (dateValue) => {
|
|
218
|
-
if (dateValue === null) {
|
|
219
|
-
return null;
|
|
220
|
-
}
|
|
221
|
-
if (fullIso) {
|
|
222
|
-
return DateTimeUtils.fromCalendarDateTimeToUTCISO(dateValue);
|
|
223
|
-
}
|
|
224
|
-
return DateTimeUtils.fromDateValueToISO(dateValue);
|
|
225
|
-
};
|
|
226
|
-
const parseDateValue = (isoString) => {
|
|
227
|
-
if (isoString == null) {
|
|
228
|
-
return isoString;
|
|
229
|
-
}
|
|
230
|
-
return DateTimeUtils.fromISOtoZonedDateTime(isoString);
|
|
231
|
-
};
|
|
232
|
-
if ("formControl" in props && props.formControl) {
|
|
233
|
-
const { formControl, ref, ...innerProps } = props;
|
|
234
|
-
return /* @__PURE__ */ jsx(
|
|
235
|
-
Controller,
|
|
236
|
-
{
|
|
237
|
-
control: formControl.control,
|
|
238
|
-
name: formControl.name,
|
|
239
|
-
render: ({ field, fieldState: { error } }) => /* @__PURE__ */ jsx(
|
|
240
|
-
DateTimePickerBase,
|
|
241
|
-
{
|
|
242
|
-
...innerProps,
|
|
243
|
-
ref: mergeRefs(ref, field.ref),
|
|
244
|
-
value: parseDateValue(field.value),
|
|
245
|
-
onChange: (value) => field.onChange(formatDateValue(value)),
|
|
246
|
-
onBlur: field.onBlur,
|
|
247
|
-
isDisabled: field.disabled || props.isDisabled,
|
|
248
|
-
error: props.error ?? error?.message
|
|
249
|
-
}
|
|
250
|
-
)
|
|
251
|
-
}
|
|
252
|
-
);
|
|
253
|
-
}
|
|
254
|
-
return /* @__PURE__ */ jsx(
|
|
255
|
-
DateTimePickerBase,
|
|
256
|
-
{
|
|
257
|
-
...props,
|
|
258
|
-
value: parseDateValue(props.value),
|
|
259
|
-
onChange: (value) => props.onChange?.(formatDateValue(value))
|
|
260
|
-
}
|
|
261
|
-
);
|
|
262
|
-
};
|
|
263
|
-
export {
|
|
264
|
-
DateTimePicker
|
|
265
|
-
};
|
|
@@ -1,217 +0,0 @@
|
|
|
1
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { toTime, now, getLocalTimeZone } from "@internationalized/date";
|
|
3
|
-
import { mergeRefs } from "@react-aria/utils";
|
|
4
|
-
import { DateTime } from "luxon";
|
|
5
|
-
import { useState, useRef, useEffect } from "react";
|
|
6
|
-
import { useLocale, useTimeField } from "react-aria";
|
|
7
|
-
import { Controller } from "react-hook-form";
|
|
8
|
-
import { useTimeFieldState } from "react-stately";
|
|
9
|
-
import { DateTimeDialog } from "../shared/DateTimeDialog.js";
|
|
10
|
-
import { DateTimeDialogFooter } from "../shared/DateTimeDialogFooter.js";
|
|
11
|
-
import { TimePickerForm } from "../shared/TimePickerForm.js";
|
|
12
|
-
import { TimePickerInput } from "../shared/TimePickerInput.js";
|
|
13
|
-
import { FormField } from "../../FormField/FormField.js";
|
|
14
|
-
import { TooltipWrapper } from "../../shared/TooltipWrapper.js";
|
|
15
|
-
import { UIConfig } from "../../../../config/uiConfig.context.js";
|
|
16
|
-
import { DateTimeUtils } from "../../../../utils/date-time.utils.js";
|
|
17
|
-
const TimePickerBase = (props) => {
|
|
18
|
-
const ui = UIConfig.useConfig();
|
|
19
|
-
const {
|
|
20
|
-
ref,
|
|
21
|
-
label,
|
|
22
|
-
tooltipText,
|
|
23
|
-
helperText,
|
|
24
|
-
isRequired,
|
|
25
|
-
rightContent,
|
|
26
|
-
isDisabled,
|
|
27
|
-
headerClassName,
|
|
28
|
-
errorClassName,
|
|
29
|
-
isHeaderHidden,
|
|
30
|
-
error,
|
|
31
|
-
onChange,
|
|
32
|
-
value,
|
|
33
|
-
disableDropdown,
|
|
34
|
-
placeholder,
|
|
35
|
-
variant = ui.input.variant,
|
|
36
|
-
as = ui.input.as,
|
|
37
|
-
size = ui.input.size,
|
|
38
|
-
hideLabel = ui.input.hideLabel,
|
|
39
|
-
isClearable = ui.input.isClearable,
|
|
40
|
-
disableManualEntry = ui.dateInput.disableManualEntry,
|
|
41
|
-
...rest
|
|
42
|
-
} = props;
|
|
43
|
-
const formFieldProps = {
|
|
44
|
-
error,
|
|
45
|
-
label,
|
|
46
|
-
tooltipText,
|
|
47
|
-
helperText,
|
|
48
|
-
isRequired,
|
|
49
|
-
rightContent,
|
|
50
|
-
isHeaderHidden: isHeaderHidden || as === "inline" || as === "filter" || as === "floating",
|
|
51
|
-
hideLabel,
|
|
52
|
-
isDisabled,
|
|
53
|
-
headerClassName,
|
|
54
|
-
errorClassName
|
|
55
|
-
};
|
|
56
|
-
const [isOpen, setIsOpen] = useState(false);
|
|
57
|
-
const initialDateEmitRef = useRef(true);
|
|
58
|
-
const { locale } = useLocale();
|
|
59
|
-
const dialogState = useTimeFieldState({
|
|
60
|
-
...rest,
|
|
61
|
-
defaultValue: value || rest.defaultValue,
|
|
62
|
-
locale
|
|
63
|
-
});
|
|
64
|
-
const state = useTimeFieldState({
|
|
65
|
-
...rest,
|
|
66
|
-
isDisabled,
|
|
67
|
-
value,
|
|
68
|
-
onChange,
|
|
69
|
-
locale
|
|
70
|
-
});
|
|
71
|
-
useEffect(() => {
|
|
72
|
-
if (initialDateEmitRef.current) {
|
|
73
|
-
initialDateEmitRef.current = false;
|
|
74
|
-
return;
|
|
75
|
-
}
|
|
76
|
-
if (state.timeValue) {
|
|
77
|
-
onChange?.(state.timeValue);
|
|
78
|
-
}
|
|
79
|
-
}, [rest.date]);
|
|
80
|
-
const timeFieldRef = useRef(null);
|
|
81
|
-
const { labelProps, fieldProps } = useTimeField(
|
|
82
|
-
{ ...rest, label, isReadOnly: disableManualEntry },
|
|
83
|
-
state,
|
|
84
|
-
timeFieldRef
|
|
85
|
-
);
|
|
86
|
-
const headerProps = {
|
|
87
|
-
label,
|
|
88
|
-
tooltipText,
|
|
89
|
-
helperText,
|
|
90
|
-
isRequired,
|
|
91
|
-
rightContent,
|
|
92
|
-
isHeaderHidden: hideLabel || isHeaderHidden,
|
|
93
|
-
isDisabled,
|
|
94
|
-
className: headerClassName,
|
|
95
|
-
labelProps
|
|
96
|
-
};
|
|
97
|
-
const onApply = () => {
|
|
98
|
-
state.setValue(dialogState.value);
|
|
99
|
-
setIsOpen(false);
|
|
100
|
-
};
|
|
101
|
-
const onOpenChange = (open) => {
|
|
102
|
-
setIsOpen(open);
|
|
103
|
-
if (!isOpen) {
|
|
104
|
-
dialogState.setValue(state.value);
|
|
105
|
-
}
|
|
106
|
-
};
|
|
107
|
-
const onOpen = () => {
|
|
108
|
-
dialogState.setValue(state.value);
|
|
109
|
-
setIsOpen(true);
|
|
110
|
-
};
|
|
111
|
-
return /* @__PURE__ */ jsx(
|
|
112
|
-
TooltipWrapper,
|
|
113
|
-
{
|
|
114
|
-
as,
|
|
115
|
-
error,
|
|
116
|
-
children: /* @__PURE__ */ jsxs(
|
|
117
|
-
FormField,
|
|
118
|
-
{
|
|
119
|
-
...formFieldProps,
|
|
120
|
-
as,
|
|
121
|
-
labelProps,
|
|
122
|
-
className: "relative inline-flex w-full flex-col text-left",
|
|
123
|
-
children: [
|
|
124
|
-
/* @__PURE__ */ jsx(
|
|
125
|
-
TimePickerInput,
|
|
126
|
-
{
|
|
127
|
-
ref: mergeRefs(ref, timeFieldRef),
|
|
128
|
-
as,
|
|
129
|
-
fieldProps,
|
|
130
|
-
state,
|
|
131
|
-
onPress: onOpen,
|
|
132
|
-
isDisabled,
|
|
133
|
-
isInvalid: !!error,
|
|
134
|
-
disableDropdown,
|
|
135
|
-
variant,
|
|
136
|
-
size,
|
|
137
|
-
isClearable,
|
|
138
|
-
headerProps,
|
|
139
|
-
disableManualEntry,
|
|
140
|
-
placeholder
|
|
141
|
-
}
|
|
142
|
-
),
|
|
143
|
-
(!disableDropdown || disableManualEntry) && /* @__PURE__ */ jsx(
|
|
144
|
-
DateTimeDialog,
|
|
145
|
-
{
|
|
146
|
-
footer: /* @__PURE__ */ jsx(
|
|
147
|
-
DateTimeDialogFooter,
|
|
148
|
-
{
|
|
149
|
-
isDisabled,
|
|
150
|
-
onApply,
|
|
151
|
-
isValid: !dialogState.isInvalid && !!dialogState.value
|
|
152
|
-
}
|
|
153
|
-
),
|
|
154
|
-
label,
|
|
155
|
-
triggerRef: timeFieldRef,
|
|
156
|
-
isOpen,
|
|
157
|
-
onOpenChange,
|
|
158
|
-
children: /* @__PURE__ */ jsx(TimePickerForm, { state: dialogState })
|
|
159
|
-
}
|
|
160
|
-
)
|
|
161
|
-
]
|
|
162
|
-
}
|
|
163
|
-
)
|
|
164
|
-
}
|
|
165
|
-
);
|
|
166
|
-
};
|
|
167
|
-
const TimePicker = (props) => {
|
|
168
|
-
const formatTimeValue = (timeValue) => {
|
|
169
|
-
if (timeValue === null) {
|
|
170
|
-
return null;
|
|
171
|
-
}
|
|
172
|
-
const parsedDate = props.date ? DateTime.fromISO(props.date).toJSDate() : void 0;
|
|
173
|
-
const dateValue = parsedDate ? DateTimeUtils.fromLocalToZonedDateTime(parsedDate) : now(getLocalTimeZone());
|
|
174
|
-
const dateTimeValue = dateValue.set(timeValue);
|
|
175
|
-
return DateTimeUtils.fromDateValueToISO(dateTimeValue);
|
|
176
|
-
};
|
|
177
|
-
const parseTimeValue = (isoString) => {
|
|
178
|
-
if (isoString == null) {
|
|
179
|
-
return isoString;
|
|
180
|
-
}
|
|
181
|
-
const zonedDateTime = DateTimeUtils.fromISOtoZonedDateTime(isoString);
|
|
182
|
-
return toTime(zonedDateTime);
|
|
183
|
-
};
|
|
184
|
-
if ("formControl" in props && props.formControl) {
|
|
185
|
-
const { formControl, ref, ...innerProps } = props;
|
|
186
|
-
return /* @__PURE__ */ jsx(
|
|
187
|
-
Controller,
|
|
188
|
-
{
|
|
189
|
-
control: formControl.control,
|
|
190
|
-
name: formControl.name,
|
|
191
|
-
render: ({ field, fieldState: { error } }) => /* @__PURE__ */ jsx(
|
|
192
|
-
TimePickerBase,
|
|
193
|
-
{
|
|
194
|
-
...innerProps,
|
|
195
|
-
ref: mergeRefs(ref, field.ref),
|
|
196
|
-
value: parseTimeValue(field.value),
|
|
197
|
-
onChange: (value) => field.onChange(formatTimeValue(value)),
|
|
198
|
-
onBlur: field.onBlur,
|
|
199
|
-
isDisabled: field.disabled || props.isDisabled,
|
|
200
|
-
error: props.error ?? error?.message
|
|
201
|
-
}
|
|
202
|
-
)
|
|
203
|
-
}
|
|
204
|
-
);
|
|
205
|
-
}
|
|
206
|
-
return /* @__PURE__ */ jsx(
|
|
207
|
-
TimePickerBase,
|
|
208
|
-
{
|
|
209
|
-
...props,
|
|
210
|
-
value: parseTimeValue(props.value),
|
|
211
|
-
onChange: (value) => props.onChange?.(formatTimeValue(value))
|
|
212
|
-
}
|
|
213
|
-
);
|
|
214
|
-
};
|
|
215
|
-
export {
|
|
216
|
-
TimePicker
|
|
217
|
-
};
|
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
-
import { useCalendar } from "@react-aria/calendar";
|
|
3
|
-
import { clsx } from "clsx";
|
|
4
|
-
import { useState } from "react";
|
|
5
|
-
import { CalendarGrid } from "./CalendarGrid.js";
|
|
6
|
-
import { CalendarHeader } from "./CalendarHeader.js";
|
|
7
|
-
import { MonthPicker } from "./MonthPicker.js";
|
|
8
|
-
import { TimePickerForm } from "./TimePickerForm.js";
|
|
9
|
-
import { YearPicker } from "./YearPicker.js";
|
|
10
|
-
const Calendar = ({ className, includesTime, datePickerState, hourCycle, onApply, ...props }) => {
|
|
11
|
-
const [toggleState, setToggleState] = useState(null);
|
|
12
|
-
const { calendarProps, prevButtonProps, nextButtonProps } = useCalendar(props.calendarProps, props.state);
|
|
13
|
-
const handleDateChange = () => {
|
|
14
|
-
if (includesTime && !datePickerState.value) {
|
|
15
|
-
setToggleState("time");
|
|
16
|
-
} else {
|
|
17
|
-
onApply();
|
|
18
|
-
}
|
|
19
|
-
};
|
|
20
|
-
const getContent = () => {
|
|
21
|
-
if (!toggleState) {
|
|
22
|
-
return /* @__PURE__ */ jsx(
|
|
23
|
-
CalendarGrid,
|
|
24
|
-
{
|
|
25
|
-
state: props.state,
|
|
26
|
-
onApply: handleDateChange
|
|
27
|
-
}
|
|
28
|
-
);
|
|
29
|
-
}
|
|
30
|
-
if (toggleState === "month") {
|
|
31
|
-
return /* @__PURE__ */ jsx(
|
|
32
|
-
MonthPicker,
|
|
33
|
-
{
|
|
34
|
-
state: props.state,
|
|
35
|
-
onSelectionChange: () => setToggleState(null)
|
|
36
|
-
}
|
|
37
|
-
);
|
|
38
|
-
}
|
|
39
|
-
if (toggleState === "year") {
|
|
40
|
-
return /* @__PURE__ */ jsx(
|
|
41
|
-
YearPicker,
|
|
42
|
-
{
|
|
43
|
-
state: props.state,
|
|
44
|
-
onSelectionChange: () => setToggleState(null)
|
|
45
|
-
}
|
|
46
|
-
);
|
|
47
|
-
}
|
|
48
|
-
if (toggleState === "time" && includesTime) {
|
|
49
|
-
return /* @__PURE__ */ jsx("div", { className: "flex h-72 w-80 items-center justify-center", children: /* @__PURE__ */ jsx(TimePickerForm, { datePickerState }) });
|
|
50
|
-
}
|
|
51
|
-
return null;
|
|
52
|
-
};
|
|
53
|
-
return /* @__PURE__ */ jsxs(
|
|
54
|
-
"div",
|
|
55
|
-
{
|
|
56
|
-
...calendarProps,
|
|
57
|
-
className: clsx("flex min-h-0 w-full flex-col items-center", className),
|
|
58
|
-
children: [
|
|
59
|
-
/* @__PURE__ */ jsx(
|
|
60
|
-
CalendarHeader,
|
|
61
|
-
{
|
|
62
|
-
calendarState: props.state,
|
|
63
|
-
datePickerState,
|
|
64
|
-
prevButtonProps,
|
|
65
|
-
nextButtonProps,
|
|
66
|
-
includesTime,
|
|
67
|
-
hourCycle,
|
|
68
|
-
toggleState,
|
|
69
|
-
setToggleState
|
|
70
|
-
}
|
|
71
|
-
),
|
|
72
|
-
/* @__PURE__ */ jsx(
|
|
73
|
-
"div",
|
|
74
|
-
{
|
|
75
|
-
className: clsx("flex min-h-0 w-full flex-1 flex-col items-center", toggleState !== "year" && "pb-8 md:pb-0"),
|
|
76
|
-
children: getContent()
|
|
77
|
-
}
|
|
78
|
-
)
|
|
79
|
-
]
|
|
80
|
-
}
|
|
81
|
-
);
|
|
82
|
-
};
|
|
83
|
-
export {
|
|
84
|
-
Calendar
|
|
85
|
-
};
|