@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
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { CheckboxCheckmarkIcon } from "./CheckboxCheckmark.js";
|
|
2
|
+
import { CheckboxIndeterminateIcon } from "./CheckboxIndeterminate.js";
|
|
3
|
+
import { UIStyle } from "./uiStyle.context.js";
|
|
4
|
+
import { checkbox, checkboxIcon } from "./checkbox.cva.js";
|
|
5
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
const CheckboxCheckmark = ({ variant, className, selectedIcon: SelectedIcon = CheckboxCheckmarkIcon, indeterminateIcon: IndeterminateIcon = CheckboxIndeterminateIcon,...props }) => {
|
|
7
|
+
const uiStyle = UIStyle.useConfig();
|
|
8
|
+
const checkboxCva = uiStyle?.checkbox?.cva ?? checkbox;
|
|
9
|
+
const checkboxIconCva = uiStyle?.checkbox?.iconCva ?? checkboxIcon;
|
|
10
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
11
|
+
className: checkboxCva({
|
|
12
|
+
variant,
|
|
13
|
+
...props,
|
|
14
|
+
className
|
|
15
|
+
}),
|
|
16
|
+
children: [/* @__PURE__ */ jsx(SelectedIcon, { className: checkboxIconCva({
|
|
17
|
+
...props,
|
|
18
|
+
iconVariant: "selected"
|
|
19
|
+
}) }), /* @__PURE__ */ jsx(IndeterminateIcon, { className: checkboxIconCva({
|
|
20
|
+
...props,
|
|
21
|
+
iconVariant: "indeterminate"
|
|
22
|
+
}) })]
|
|
23
|
+
});
|
|
24
|
+
};
|
|
25
|
+
export { CheckboxCheckmark };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
const CheckboxIndeterminateIcon = (props) => /* @__PURE__ */ jsx("svg", {
|
|
3
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
4
|
+
fill: "none",
|
|
5
|
+
viewBox: "0 0 10 2",
|
|
6
|
+
className: "fill-current",
|
|
7
|
+
...props,
|
|
8
|
+
children: /* @__PURE__ */ jsx("path", {
|
|
9
|
+
stroke: "currentColor",
|
|
10
|
+
strokeLinecap: "round",
|
|
11
|
+
strokeLinejoin: "round",
|
|
12
|
+
strokeWidth: 2,
|
|
13
|
+
d: "M9 1H1"
|
|
14
|
+
})
|
|
15
|
+
});
|
|
16
|
+
export { CheckboxIndeterminateIcon };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
const ChevronDownIcon = (props) => /* @__PURE__ */ jsx("svg", {
|
|
3
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
4
|
+
fill: "none",
|
|
5
|
+
viewBox: "0 0 24 24",
|
|
6
|
+
className: "fill-current",
|
|
7
|
+
...props,
|
|
8
|
+
children: /* @__PURE__ */ jsx("path", {
|
|
9
|
+
fill: "currentColor",
|
|
10
|
+
fillRule: "evenodd",
|
|
11
|
+
d: "M5.293 8.293a1 1 0 0 1 1.414 0L12 13.586l5.293-5.293a1 1 0 1 1 1.414 1.414l-6 6a1 1 0 0 1-1.414 0l-6-6a1 1 0 0 1 0-1.414",
|
|
12
|
+
clipRule: "evenodd"
|
|
13
|
+
})
|
|
14
|
+
});
|
|
15
|
+
export { ChevronDownIcon };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
const ChevronLeftIcon = (props) => /* @__PURE__ */ jsx("svg", {
|
|
3
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
4
|
+
fill: "none",
|
|
5
|
+
viewBox: "0 0 24 24",
|
|
6
|
+
className: "fill-current",
|
|
7
|
+
...props,
|
|
8
|
+
children: /* @__PURE__ */ jsx("path", {
|
|
9
|
+
fill: "currentColor",
|
|
10
|
+
fillRule: "evenodd",
|
|
11
|
+
d: "M15.707 5.293a1 1 0 0 1 0 1.414L10.414 12l5.293 5.293a1 1 0 0 1-1.414 1.414l-6-6a1 1 0 0 1 0-1.414l6-6a1 1 0 0 1 1.414 0",
|
|
12
|
+
clipRule: "evenodd"
|
|
13
|
+
})
|
|
14
|
+
});
|
|
15
|
+
export { ChevronLeftIcon };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
const ChevronRightIcon = (props) => /* @__PURE__ */ jsx("svg", {
|
|
3
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
4
|
+
fill: "none",
|
|
5
|
+
viewBox: "0 0 24 24",
|
|
6
|
+
className: "fill-current",
|
|
7
|
+
...props,
|
|
8
|
+
children: /* @__PURE__ */ jsx("path", {
|
|
9
|
+
fill: "currentColor",
|
|
10
|
+
fillRule: "evenodd",
|
|
11
|
+
d: "M8.293 5.293a1 1 0 0 1 1.414 0l6 6a1 1 0 0 1 0 1.414l-6 6a1 1 0 0 1-1.414-1.414L13.586 12 8.293 6.707a1 1 0 0 1 0-1.414",
|
|
12
|
+
clipRule: "evenodd"
|
|
13
|
+
})
|
|
14
|
+
});
|
|
15
|
+
export { ChevronRightIcon };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
const ChevronUpIcon = (props) => /* @__PURE__ */ jsx("svg", {
|
|
3
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
4
|
+
fill: "none",
|
|
5
|
+
viewBox: "0 0 24 24",
|
|
6
|
+
className: "fill-current",
|
|
7
|
+
...props,
|
|
8
|
+
children: /* @__PURE__ */ jsx("path", {
|
|
9
|
+
fill: "currentColor",
|
|
10
|
+
fillRule: "evenodd",
|
|
11
|
+
d: "M11.293 8.293a1 1 0 0 1 1.414 0l6 6a1 1 0 0 1-1.414 1.414L12 10.414l-5.293 5.293a1 1 0 0 1-1.414-1.414z",
|
|
12
|
+
clipRule: "evenodd"
|
|
13
|
+
})
|
|
14
|
+
});
|
|
15
|
+
export { ChevronUpIcon };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
const ChevronsLeftIcon = (props) => /* @__PURE__ */ jsx("svg", {
|
|
3
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
4
|
+
fill: "none",
|
|
5
|
+
viewBox: "0 0 24 24",
|
|
6
|
+
className: "fill-current",
|
|
7
|
+
...props,
|
|
8
|
+
children: /* @__PURE__ */ jsx("path", {
|
|
9
|
+
fill: "currentColor",
|
|
10
|
+
fillRule: "evenodd",
|
|
11
|
+
d: "M11.749 17.749a.857.857 0 0 1-1.212 0l-5.143-5.143a.857.857 0 0 1 0-1.212l5.143-5.143a.857.857 0 0 1 1.212 1.212L7.212 12l4.537 4.537a.857.857 0 0 1 0 1.212M18.749 17.749a.857.857 0 0 1-1.212 0l-5.143-5.143a.857.857 0 0 1 0-1.212l5.143-5.143a.857.857 0 0 1 1.212 1.212L14.212 12l4.537 4.537a.857.857 0 0 1 0 1.212",
|
|
12
|
+
clipRule: "evenodd"
|
|
13
|
+
})
|
|
14
|
+
});
|
|
15
|
+
export { ChevronsLeftIcon };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
const ChevronsRightIcon = (props) => /* @__PURE__ */ jsx("svg", {
|
|
3
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
4
|
+
fill: "none",
|
|
5
|
+
viewBox: "0 0 24 24",
|
|
6
|
+
className: "fill-current",
|
|
7
|
+
...props,
|
|
8
|
+
children: /* @__PURE__ */ jsx("path", {
|
|
9
|
+
fill: "currentColor",
|
|
10
|
+
fillRule: "evenodd",
|
|
11
|
+
d: "M12.251 6.251a.857.857 0 0 1 1.212 0l5.143 5.143a.857.857 0 0 1 0 1.212l-5.143 5.143a.857.857 0 1 1-1.212-1.212L16.788 12 12.25 7.463a.857.857 0 0 1 0-1.212M5.251 6.251a.857.857 0 0 1 1.212 0l5.143 5.143a.857.857 0 0 1 0 1.212L6.463 17.75a.857.857 0 1 1-1.212-1.212L9.788 12 5.25 7.463a.857.857 0 0 1 0-1.212",
|
|
12
|
+
clipRule: "evenodd"
|
|
13
|
+
})
|
|
14
|
+
});
|
|
15
|
+
export { ChevronsRightIcon };
|
package/dist/Clock.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
const ClockIcon = (props) => /* @__PURE__ */ jsx("svg", {
|
|
3
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
4
|
+
fill: "none",
|
|
5
|
+
viewBox: "0 0 24 24",
|
|
6
|
+
className: "fill-current",
|
|
7
|
+
...props,
|
|
8
|
+
children: /* @__PURE__ */ jsx("path", {
|
|
9
|
+
fill: "currentColor",
|
|
10
|
+
d: "m14.75 15.917 1.167-1.167-3.083-3.083V7.834h-1.667v4.5zM12 20.334a8.1 8.1 0 0 1-3.25-.657 8.4 8.4 0 0 1-2.646-1.78 8.4 8.4 0 0 1-1.78-2.647A8.1 8.1 0 0 1 3.666 12q0-1.729.656-3.25a8.4 8.4 0 0 1 1.781-2.646 8.4 8.4 0 0 1 2.646-1.78A8.1 8.1 0 0 1 12 3.666q1.73 0 3.25.656a8.4 8.4 0 0 1 2.646 1.781 8.4 8.4 0 0 1 1.781 2.646 8.1 8.1 0 0 1 .657 3.25 8.1 8.1 0 0 1-.657 3.25 8.4 8.4 0 0 1-1.78 2.646 8.4 8.4 0 0 1-2.647 1.781 8.1 8.1 0 0 1-3.25.657m0-1.667q2.771 0 4.72-1.948 1.947-1.948 1.947-4.719 0-2.77-1.948-4.718T12 5.334 7.282 7.282 5.334 12t1.948 4.72Q9.229 18.666 12 18.666"
|
|
11
|
+
})
|
|
12
|
+
});
|
|
13
|
+
export { ClockIcon };
|
package/dist/Close.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
const CloseIcon = (props) => /* @__PURE__ */ jsx("svg", {
|
|
3
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
4
|
+
fill: "none",
|
|
5
|
+
viewBox: "0 0 24 24",
|
|
6
|
+
className: "fill-current",
|
|
7
|
+
...props,
|
|
8
|
+
children: /* @__PURE__ */ jsx("path", {
|
|
9
|
+
fill: "currentColor",
|
|
10
|
+
d: "M17.749 7.463a.857.857 0 1 0-1.212-1.212L12 10.788 7.463 6.25a.857.857 0 0 0-1.212 1.212L10.788 12 6.25 16.537a.857.857 0 1 0 1.212 1.212L12 13.212l4.537 4.537a.857.857 0 1 0 1.212-1.212L13.212 12z"
|
|
11
|
+
})
|
|
12
|
+
});
|
|
13
|
+
export { CloseIcon };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { clsx } from "clsx";
|
|
3
|
+
import { ColorSwatch, ColorSwatchPicker, ColorSwatchPickerItem } from "react-aria-components";
|
|
4
|
+
const ColorPicker = ({ colors, value, onChange }) => {
|
|
5
|
+
return /* @__PURE__ */ jsx(ColorSwatchPicker, {
|
|
6
|
+
value,
|
|
7
|
+
onChange: (color) => onChange(color.toString("hex")),
|
|
8
|
+
className: "grid w-full grid-cols-[repeat(auto-fit,minmax(1rem,1fr))] gap-1",
|
|
9
|
+
children: colors.map((color) => /* @__PURE__ */ jsx(ColorSwatchPickerItem, {
|
|
10
|
+
color,
|
|
11
|
+
className: "group",
|
|
12
|
+
children: /* @__PURE__ */ jsx(ColorSwatch, { className: clsx("size-4 rounded-xs border border-interactive-outlined-secondary-outline-idle border-solid", "group-selected:border-interactive-outlined-primary-outline-pressed group-selected:shadow-2", "cursor-pointer") })
|
|
13
|
+
}, color))
|
|
14
|
+
});
|
|
15
|
+
};
|
|
16
|
+
export { ColorPicker };
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { ArrowDropDownIcon } from "./ArrowDropDown.js";
|
|
2
|
+
import { Typography } from "./Typography.js";
|
|
3
|
+
import { useInputCva } from "./input.cva.js";
|
|
4
|
+
import { ColorPicker } from "./ColorPicker.js";
|
|
5
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
import { clsx } from "clsx";
|
|
7
|
+
import { Button, Dialog, DialogTrigger, Popover } from "react-aria-components";
|
|
8
|
+
import { useState } from "react";
|
|
9
|
+
const ColorPickerDropdown = ({ colors, value, onChange, isDisabled, children }) => {
|
|
10
|
+
const inputCva = useInputCva();
|
|
11
|
+
const [isOpen, setIsOpen] = useState(false);
|
|
12
|
+
const handleChange = (color) => {
|
|
13
|
+
onChange(color);
|
|
14
|
+
setIsOpen(false);
|
|
15
|
+
};
|
|
16
|
+
return /* @__PURE__ */ jsxs(DialogTrigger, {
|
|
17
|
+
isOpen,
|
|
18
|
+
onOpenChange: setIsOpen,
|
|
19
|
+
children: [/* @__PURE__ */ jsxs(Button, {
|
|
20
|
+
className: inputCva({
|
|
21
|
+
as: "inline",
|
|
22
|
+
className: clsx("flex items-center justify-between gap-2")
|
|
23
|
+
}),
|
|
24
|
+
isDisabled,
|
|
25
|
+
children: [/* @__PURE__ */ jsx(Typography, {
|
|
26
|
+
size: "label-1",
|
|
27
|
+
className: "truncate",
|
|
28
|
+
children
|
|
29
|
+
}), /* @__PURE__ */ jsx(ArrowDropDownIcon, {
|
|
30
|
+
className: clsx("size-6 shrink-0", isOpen && "rotate-180"),
|
|
31
|
+
"aria-hidden": "true"
|
|
32
|
+
})]
|
|
33
|
+
}), /* @__PURE__ */ jsx(Popover, {
|
|
34
|
+
className: "my-4 w-40 outline-none",
|
|
35
|
+
offset: 0,
|
|
36
|
+
placement: "bottom start",
|
|
37
|
+
children: /* @__PURE__ */ jsx(Dialog, {
|
|
38
|
+
className: "outline-none",
|
|
39
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
40
|
+
className: clsx("flex justify-center overflow-hidden p-2 shadow-5 outline-none", "rounded-input-rounding-default border border-elevation-outline-default-1 bg-elevation-fill-default-1"),
|
|
41
|
+
children: /* @__PURE__ */ jsx(ColorPicker, {
|
|
42
|
+
colors,
|
|
43
|
+
value,
|
|
44
|
+
onChange: handleChange
|
|
45
|
+
})
|
|
46
|
+
})
|
|
47
|
+
})
|
|
48
|
+
})]
|
|
49
|
+
});
|
|
50
|
+
};
|
|
51
|
+
export { ColorPickerDropdown };
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { Typography } from "./Typography.js";
|
|
2
|
+
import { Checkbox } from "./Checkbox.js";
|
|
3
|
+
import { ns } from "./i18n.js";
|
|
4
|
+
import { Modal } from "./Modal.js";
|
|
5
|
+
import { Table } from "./Table.js";
|
|
6
|
+
import { useTranslationMemo } from "./useTranslationMemo.js";
|
|
7
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
|
+
import { useCallback, useEffect, useState } from "react";
|
|
9
|
+
import { useTranslation } from "react-i18next";
|
|
10
|
+
var VisibilityCell = ({ original, onToggle }) => /* @__PURE__ */ jsx(Checkbox, {
|
|
11
|
+
isSelected: original.visible,
|
|
12
|
+
onChange: () => onToggle(original.id),
|
|
13
|
+
hideLabel: true,
|
|
14
|
+
children: original.label
|
|
15
|
+
});
|
|
16
|
+
var getColumns = (t, handleToggleVisibility) => [{
|
|
17
|
+
id: "name",
|
|
18
|
+
header: t(($) => $.ui.table.column, { ns: "ui" }),
|
|
19
|
+
meta: { width: "flex-1" },
|
|
20
|
+
accessorKey: "label"
|
|
21
|
+
}, {
|
|
22
|
+
id: "visible",
|
|
23
|
+
header: t(($) => $.ui.table.show, { ns: "ui" }),
|
|
24
|
+
meta: { width: "w-20" },
|
|
25
|
+
cell: ({ original }) => /* @__PURE__ */ jsx(VisibilityCell, {
|
|
26
|
+
original,
|
|
27
|
+
onToggle: handleToggleVisibility
|
|
28
|
+
})
|
|
29
|
+
}];
|
|
30
|
+
function ColumnConfigModal({ isOpen, onClose, configColumns, visibleColumns, onVisibilityChange, onOrderChange }) {
|
|
31
|
+
const { t } = useTranslation("ui");
|
|
32
|
+
const [data, setData] = useState([]);
|
|
33
|
+
useEffect(() => {
|
|
34
|
+
setData(configColumns.map((column) => {
|
|
35
|
+
const columnId = column.id ?? column.accessorKey;
|
|
36
|
+
return {
|
|
37
|
+
id: columnId,
|
|
38
|
+
label: column.header,
|
|
39
|
+
visible: visibleColumns?.[columnId] ?? true
|
|
40
|
+
};
|
|
41
|
+
}));
|
|
42
|
+
}, [configColumns, visibleColumns]);
|
|
43
|
+
const handleToggleVisibility = useCallback((columnId) => {
|
|
44
|
+
onVisibilityChange({
|
|
45
|
+
...visibleColumns,
|
|
46
|
+
[columnId]: !visibleColumns[columnId]
|
|
47
|
+
});
|
|
48
|
+
}, [visibleColumns, onVisibilityChange]);
|
|
49
|
+
const columns = useTranslationMemo(useCallback((translateFn) => getColumns(translateFn, handleToggleVisibility), [handleToggleVisibility]));
|
|
50
|
+
const handleReorder = useCallback((reorderedItems) => {
|
|
51
|
+
setData(reorderedItems);
|
|
52
|
+
onOrderChange(reorderedItems.map((item) => item.id));
|
|
53
|
+
}, [onOrderChange]);
|
|
54
|
+
if (!isOpen) return null;
|
|
55
|
+
return /* @__PURE__ */ jsx(Modal, {
|
|
56
|
+
isOpen,
|
|
57
|
+
onClose,
|
|
58
|
+
showCloseIcon: true,
|
|
59
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
60
|
+
className: "flex flex-col gap-2 p-4",
|
|
61
|
+
children: [/* @__PURE__ */ jsx(Typography, {
|
|
62
|
+
as: "h2",
|
|
63
|
+
variant: "prominent-1",
|
|
64
|
+
size: "title-5",
|
|
65
|
+
children: t(($) => $.ui.table.configureColumns)
|
|
66
|
+
}), /* @__PURE__ */ jsx("div", {
|
|
67
|
+
className: "max-h-96 overflow-y-auto",
|
|
68
|
+
children: /* @__PURE__ */ jsx(Table, {
|
|
69
|
+
items: data,
|
|
70
|
+
columns,
|
|
71
|
+
showCellBorder: true,
|
|
72
|
+
className: "w-full",
|
|
73
|
+
enableDragDrop: true,
|
|
74
|
+
getRowId: (row) => row.id,
|
|
75
|
+
onReorder: handleReorder
|
|
76
|
+
})
|
|
77
|
+
})]
|
|
78
|
+
})
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
export { ColumnConfigModal };
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { DateSegmentItem } from "./DateSegmentItem.js";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import { clsx } from "clsx";
|
|
4
|
+
import { useEffect, useImperativeHandle, useRef } from "react";
|
|
5
|
+
import { useDateField, useLocale } from "react-aria";
|
|
6
|
+
import { createCalendar } from "@internationalized/date";
|
|
7
|
+
import { useDateFieldState } from "react-stately";
|
|
8
|
+
const DateField = ({ ref, onClearChange, hidePlaceholder, isDisabled, disableManualEntry,...props }) => {
|
|
9
|
+
const { locale } = useLocale();
|
|
10
|
+
const state = useDateFieldState({
|
|
11
|
+
...props,
|
|
12
|
+
isDisabled,
|
|
13
|
+
isReadOnly: disableManualEntry,
|
|
14
|
+
locale,
|
|
15
|
+
createCalendar
|
|
16
|
+
});
|
|
17
|
+
const dataFieldRef = useRef(null);
|
|
18
|
+
const { fieldProps } = useDateField({
|
|
19
|
+
...props,
|
|
20
|
+
isDisabled,
|
|
21
|
+
isReadOnly: disableManualEntry
|
|
22
|
+
}, state, dataFieldRef);
|
|
23
|
+
const autoFixYear = () => {
|
|
24
|
+
const monthSegment = state.segments.find((segment) => segment.type === "month");
|
|
25
|
+
const daySegment = state.segments.find((segment) => segment.type === "day");
|
|
26
|
+
const yearSegment = state.segments.find((segment) => segment.type === "year");
|
|
27
|
+
const hourSegment = state.segments.find((segment) => segment.type === "hour");
|
|
28
|
+
const minuteSegment = state.segments.find((segment) => segment.type === "minute");
|
|
29
|
+
const isMonthFilled = monthSegment && !monthSegment.isPlaceholder;
|
|
30
|
+
const isDayFilled = daySegment && !daySegment.isPlaceholder;
|
|
31
|
+
const isYearEmpty = yearSegment && !(parseInt(yearSegment.text) && yearSegment.text?.length === 4);
|
|
32
|
+
const isHourEmpty = hourSegment && !parseInt(hourSegment.text);
|
|
33
|
+
if (minuteSegment && !parseInt(minuteSegment.text)) {
|
|
34
|
+
let minute = minuteSegment?.value || 0;
|
|
35
|
+
if (minuteSegment?.text?.length && minuteSegment?.text?.length > 0) minute = parseInt(minuteSegment?.text ?? "00");
|
|
36
|
+
state.setSegment("minute", minute);
|
|
37
|
+
}
|
|
38
|
+
if (isHourEmpty) {
|
|
39
|
+
let hour = hourSegment?.value || 0;
|
|
40
|
+
if (hourSegment?.text?.length && hourSegment?.text?.length > 0) hour = parseInt(hourSegment?.text ?? "00");
|
|
41
|
+
state.setSegment("hour", hour);
|
|
42
|
+
}
|
|
43
|
+
if (isMonthFilled && isDayFilled && isYearEmpty) {
|
|
44
|
+
let year = (/* @__PURE__ */ new Date()).getFullYear();
|
|
45
|
+
if (yearSegment?.text?.length && yearSegment?.text?.length === 2) year = parseInt(`20${yearSegment?.text}`);
|
|
46
|
+
state.setSegment("year", year);
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
const handleBlur = (e) => {
|
|
50
|
+
fieldProps.onBlur?.(e);
|
|
51
|
+
if (!state.value) return;
|
|
52
|
+
const currentValue = state.value;
|
|
53
|
+
const { year } = currentValue;
|
|
54
|
+
if (year >= 0 && year <= 99) {
|
|
55
|
+
const correctedYear = year <= 50 ? 2e3 + year : 1900 + year;
|
|
56
|
+
const correctedDate = currentValue.set({ year: correctedYear });
|
|
57
|
+
if (correctedDate) {
|
|
58
|
+
state.setValue(correctedDate);
|
|
59
|
+
props.onChange?.(correctedDate);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
useImperativeHandle(ref, () => ({
|
|
64
|
+
clearField: () => {
|
|
65
|
+
state.setValue(null);
|
|
66
|
+
for (const segment of state.segments) if (segment.type !== "literal") state.clearSegment(segment.type);
|
|
67
|
+
},
|
|
68
|
+
autoFixYear
|
|
69
|
+
}));
|
|
70
|
+
useEffect(() => {
|
|
71
|
+
onClearChange?.(state.segments.some((segment) => segment.type !== "literal" && segment.isPlaceholder === false));
|
|
72
|
+
}, [state.segments, onClearChange]);
|
|
73
|
+
return /* @__PURE__ */ jsx("div", {
|
|
74
|
+
...fieldProps,
|
|
75
|
+
ref: dataFieldRef,
|
|
76
|
+
onBlur: handleBlur,
|
|
77
|
+
className: clsx("relative w-full", disableManualEntry && "pointer-events-none"),
|
|
78
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
79
|
+
className: "flex",
|
|
80
|
+
children: state.segments.map((segment, i) => /* @__PURE__ */ jsx(DateSegmentItem, {
|
|
81
|
+
segment,
|
|
82
|
+
state,
|
|
83
|
+
isDisabled,
|
|
84
|
+
hidePlaceholder
|
|
85
|
+
}, i))
|
|
86
|
+
})
|
|
87
|
+
});
|
|
88
|
+
};
|
|
89
|
+
export { DateField };
|
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
import { UIConfig } from "./uiConfig.context.js";
|
|
2
|
+
import { Calendar } from "./Calendar2.js";
|
|
3
|
+
import { DatePickerInput } from "./DatePickerInput.js";
|
|
4
|
+
import { DateTimeDialog } from "./DateTimeDialog.js";
|
|
5
|
+
import { DateTimeDialogFooter } from "./DateTimeDialogFooter.js";
|
|
6
|
+
import { FormField } from "./FormField.js";
|
|
7
|
+
import { TooltipWrapper } from "./TooltipWrapper.js";
|
|
8
|
+
import { DateTimeUtils } from "./date-time.utils.js";
|
|
9
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
10
|
+
import { clsx } from "clsx";
|
|
11
|
+
import { useImperativeHandle, useMemo, useRef } from "react";
|
|
12
|
+
import { useDatePicker, useLocale } from "react-aria";
|
|
13
|
+
import { mergeRefs } from "@react-aria/utils";
|
|
14
|
+
import { Controller } from "react-hook-form";
|
|
15
|
+
import { CalendarDate, createCalendar, getLocalTimeZone, toCalendarDate, today } from "@internationalized/date";
|
|
16
|
+
import { DateTime } from "luxon";
|
|
17
|
+
import { useCalendarState, useDatePickerState } from "react-stately";
|
|
18
|
+
var PLACEHOLDER_VALUE = new CalendarDate(2024, 1, 1);
|
|
19
|
+
var DatePickerBase = (props) => {
|
|
20
|
+
const ui = UIConfig.useConfig();
|
|
21
|
+
const { ref, label, tooltipText, helperText, isRequired, rightContent, isDirty, isDisabled, headerClassName, errorClassName, isHeaderHidden, error, onChange, value, disableDropdown, className, placeholder, as = ui.input.as, hideLabel = ui.input.hideLabel, variant = ui.input.variant, size = ui.input.size, isClearable = ui.input.isClearable, todayIcon = ui.dateInput.todayIcon, shouldForceLeadingZeros = ui.dateInput.shouldForceLeadingZeros, disableManualEntry = ui.dateInput.disableManualEntry,...rest } = props;
|
|
22
|
+
const formFieldProps = {
|
|
23
|
+
error,
|
|
24
|
+
label,
|
|
25
|
+
tooltipText,
|
|
26
|
+
helperText,
|
|
27
|
+
isRequired,
|
|
28
|
+
rightContent,
|
|
29
|
+
isHeaderHidden: isHeaderHidden || as === "inline" || as === "filter" || as === "floating",
|
|
30
|
+
hideLabel,
|
|
31
|
+
isDisabled,
|
|
32
|
+
headerClassName,
|
|
33
|
+
errorClassName
|
|
34
|
+
};
|
|
35
|
+
const datePickerInputRef = useRef(null);
|
|
36
|
+
const datePickerRef = useMemo(() => ({ get current() {
|
|
37
|
+
return datePickerInputRef.current?.getContainer?.() || null;
|
|
38
|
+
} }), []);
|
|
39
|
+
useImperativeHandle(ref, () => ({ clear: () => {
|
|
40
|
+
datePickerInputRef.current?.clear();
|
|
41
|
+
} }));
|
|
42
|
+
const dialogState = useDatePickerState({
|
|
43
|
+
...rest,
|
|
44
|
+
defaultValue: value || rest.defaultValue,
|
|
45
|
+
shouldCloseOnSelect: false,
|
|
46
|
+
shouldForceLeadingZeros
|
|
47
|
+
});
|
|
48
|
+
const state = useDatePickerState({
|
|
49
|
+
...rest,
|
|
50
|
+
shouldForceLeadingZeros,
|
|
51
|
+
value,
|
|
52
|
+
onChange: (val) => {
|
|
53
|
+
if (val && (rest.minValue && val < rest?.minValue || rest?.maxValue && val > rest?.maxValue)) {
|
|
54
|
+
state.setValue(state.value);
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
onChange?.(val);
|
|
58
|
+
dialogState.setValue(val);
|
|
59
|
+
calendarState.setFocusedDate(val || today(getLocalTimeZone()));
|
|
60
|
+
},
|
|
61
|
+
shouldCloseOnSelect: false
|
|
62
|
+
});
|
|
63
|
+
const { groupProps, labelProps, fieldProps, buttonProps, dialogProps } = useDatePicker({
|
|
64
|
+
...rest,
|
|
65
|
+
label,
|
|
66
|
+
shouldForceLeadingZeros
|
|
67
|
+
}, state, datePickerRef);
|
|
68
|
+
const { calendarProps } = useDatePicker({
|
|
69
|
+
...rest,
|
|
70
|
+
label,
|
|
71
|
+
shouldForceLeadingZeros
|
|
72
|
+
}, dialogState, datePickerRef);
|
|
73
|
+
const { locale } = useLocale();
|
|
74
|
+
const calendarState = useCalendarState({
|
|
75
|
+
...calendarProps,
|
|
76
|
+
locale,
|
|
77
|
+
createCalendar
|
|
78
|
+
});
|
|
79
|
+
const headerProps = {
|
|
80
|
+
label,
|
|
81
|
+
tooltipText,
|
|
82
|
+
helperText,
|
|
83
|
+
isRequired,
|
|
84
|
+
rightContent,
|
|
85
|
+
isHeaderHidden: hideLabel || isHeaderHidden,
|
|
86
|
+
isDisabled,
|
|
87
|
+
className: headerClassName,
|
|
88
|
+
labelProps
|
|
89
|
+
};
|
|
90
|
+
const onApply = () => {
|
|
91
|
+
state.setValue(dialogState.value);
|
|
92
|
+
state.toggle();
|
|
93
|
+
};
|
|
94
|
+
const onTodayPress = () => {
|
|
95
|
+
dialogState.setValue(today(getLocalTimeZone()));
|
|
96
|
+
calendarState.setFocusedDate(today(getLocalTimeZone()));
|
|
97
|
+
};
|
|
98
|
+
const onOpenChange = (isOpen) => {
|
|
99
|
+
state.toggle();
|
|
100
|
+
calendarState.setFocusedDate(state.value || today(getLocalTimeZone()));
|
|
101
|
+
if (!isOpen) dialogState.setValue(state.value);
|
|
102
|
+
};
|
|
103
|
+
return /* @__PURE__ */ jsx(TooltipWrapper, {
|
|
104
|
+
as,
|
|
105
|
+
error,
|
|
106
|
+
triggerTabIndex: as === "inline" ? -1 : void 0,
|
|
107
|
+
children: /* @__PURE__ */ jsxs(FormField, {
|
|
108
|
+
...formFieldProps,
|
|
109
|
+
as,
|
|
110
|
+
labelProps,
|
|
111
|
+
className: clsx("relative inline-flex w-full flex-col text-left", className),
|
|
112
|
+
tabIndex: as === "inline" ? -1 : void 0,
|
|
113
|
+
children: [/* @__PURE__ */ jsx(DatePickerInput, {
|
|
114
|
+
ref: mergeRefs(ref, datePickerInputRef),
|
|
115
|
+
as,
|
|
116
|
+
groupProps,
|
|
117
|
+
fieldProps: {
|
|
118
|
+
...fieldProps,
|
|
119
|
+
placeholderValue: PLACEHOLDER_VALUE
|
|
120
|
+
},
|
|
121
|
+
buttonProps,
|
|
122
|
+
isDirty,
|
|
123
|
+
isDisabled,
|
|
124
|
+
disableManualEntry,
|
|
125
|
+
isInvalid: !!error,
|
|
126
|
+
disableDropdown,
|
|
127
|
+
variant,
|
|
128
|
+
size,
|
|
129
|
+
isClearable,
|
|
130
|
+
headerProps,
|
|
131
|
+
todayIcon,
|
|
132
|
+
onOpenDropdown: () => state.toggle(),
|
|
133
|
+
placeholder
|
|
134
|
+
}), (!disableDropdown || disableManualEntry) && /* @__PURE__ */ jsx(DateTimeDialog, {
|
|
135
|
+
footer: /* @__PURE__ */ jsx(DateTimeDialogFooter, {
|
|
136
|
+
isDisabled,
|
|
137
|
+
isValid: !dialogState.isInvalid && !!dialogState.value,
|
|
138
|
+
onTodayPress,
|
|
139
|
+
onApply
|
|
140
|
+
}),
|
|
141
|
+
label,
|
|
142
|
+
triggerRef: datePickerRef,
|
|
143
|
+
dialogProps,
|
|
144
|
+
isOpen: state.isOpen,
|
|
145
|
+
onOpenChange,
|
|
146
|
+
children: /* @__PURE__ */ jsx(Calendar, {
|
|
147
|
+
state: calendarState,
|
|
148
|
+
calendarProps,
|
|
149
|
+
onApply
|
|
150
|
+
})
|
|
151
|
+
})]
|
|
152
|
+
})
|
|
153
|
+
});
|
|
154
|
+
};
|
|
155
|
+
const DatePicker = ({ fullIso = true, minValue, maxValue,...props }) => {
|
|
156
|
+
const formatCalendarDate = (calendarDate) => {
|
|
157
|
+
if (calendarDate === null) return null;
|
|
158
|
+
if (fullIso) return DateTimeUtils.fromCalendarDateToUTCISO(calendarDate);
|
|
159
|
+
const date = DateTimeUtils.fromDateValueToLocal(calendarDate);
|
|
160
|
+
return DateTime.fromJSDate(date).toISODate();
|
|
161
|
+
};
|
|
162
|
+
const parseCalendarDate = (formattedDate) => {
|
|
163
|
+
if (formattedDate == null) return formattedDate;
|
|
164
|
+
if (fullIso) return DateTimeUtils.fromUTCISOToCalendarDate(formattedDate);
|
|
165
|
+
const date = DateTime.fromISO(formattedDate).toJSDate();
|
|
166
|
+
return toCalendarDate(DateTimeUtils.fromLocalToZonedDateTime(date));
|
|
167
|
+
};
|
|
168
|
+
const dateLimits = {
|
|
169
|
+
minValue: typeof minValue === "string" ? parseCalendarDate(minValue) : minValue,
|
|
170
|
+
maxValue: typeof maxValue === "string" ? parseCalendarDate(maxValue) : maxValue
|
|
171
|
+
};
|
|
172
|
+
if ("formControl" in props && props.formControl) {
|
|
173
|
+
const { formControl, ref,...innerProps } = props;
|
|
174
|
+
return /* @__PURE__ */ jsx(Controller, {
|
|
175
|
+
control: formControl.control,
|
|
176
|
+
name: formControl.name,
|
|
177
|
+
render: ({ field, fieldState: { error, isDirty } }) => /* @__PURE__ */ jsx(DatePickerBase, {
|
|
178
|
+
...innerProps,
|
|
179
|
+
...dateLimits,
|
|
180
|
+
ref: mergeRefs(ref, field.ref),
|
|
181
|
+
value: parseCalendarDate(field.value),
|
|
182
|
+
onChange: (value) => field.onChange(formatCalendarDate(value)),
|
|
183
|
+
onBlur: field.onBlur,
|
|
184
|
+
isDirty,
|
|
185
|
+
isDisabled: field.disabled || props.isDisabled,
|
|
186
|
+
error: props.error ?? error?.message
|
|
187
|
+
})
|
|
188
|
+
});
|
|
189
|
+
}
|
|
190
|
+
return /* @__PURE__ */ jsx(DatePickerBase, {
|
|
191
|
+
...props,
|
|
192
|
+
...dateLimits,
|
|
193
|
+
value: parseCalendarDate(props.value),
|
|
194
|
+
onChange: (value) => props.onChange?.(formatCalendarDate(value))
|
|
195
|
+
});
|
|
196
|
+
};
|
|
197
|
+
export { DatePicker };
|