@povio/ui 2.1.14 → 2.1.15
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 +74 -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 +191 -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 +200 -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,29 +0,0 @@
|
|
|
1
|
-
import { useRef, useState, useCallback, useEffect } from "react";
|
|
2
|
-
function useDebounceCallback(callback, { delay = 500 } = {}) {
|
|
3
|
-
const timeoutRef = useRef(null);
|
|
4
|
-
const [isDebouncing, setIsDebouncing] = useState(false);
|
|
5
|
-
const debouncedCallback = useCallback(
|
|
6
|
-
(...args) => {
|
|
7
|
-
if (timeoutRef.current) {
|
|
8
|
-
clearTimeout(timeoutRef.current);
|
|
9
|
-
}
|
|
10
|
-
setIsDebouncing(true);
|
|
11
|
-
timeoutRef.current = setTimeout(() => {
|
|
12
|
-
setIsDebouncing(false);
|
|
13
|
-
callback?.(...args);
|
|
14
|
-
}, delay);
|
|
15
|
-
},
|
|
16
|
-
[callback, delay]
|
|
17
|
-
);
|
|
18
|
-
useEffect(() => {
|
|
19
|
-
return () => {
|
|
20
|
-
if (timeoutRef.current) {
|
|
21
|
-
clearTimeout(timeoutRef.current);
|
|
22
|
-
}
|
|
23
|
-
};
|
|
24
|
-
}, []);
|
|
25
|
-
return { callback: debouncedCallback, isDebouncing };
|
|
26
|
-
}
|
|
27
|
-
export {
|
|
28
|
-
useDebounceCallback
|
|
29
|
-
};
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { useEffect, useLayoutEffect, useMemo, useRef } from "react";
|
|
2
|
-
import { isEqual } from "../utils/isEqual.js";
|
|
3
|
-
const useDeepCompareEffect = (callback, dependencies) => {
|
|
4
|
-
return useEffect(callback, useDeepCompareDeps(dependencies));
|
|
5
|
-
};
|
|
6
|
-
const useDeepCompareLayoutEffect = (callback, dependencies) => {
|
|
7
|
-
return useLayoutEffect(callback, useDeepCompareDeps(dependencies));
|
|
8
|
-
};
|
|
9
|
-
const useDeepCompareMemo = (factory, dependencies) => {
|
|
10
|
-
return useMemo(factory, useDeepCompareDeps(dependencies));
|
|
11
|
-
};
|
|
12
|
-
const useDeepCompareDeps = (value) => {
|
|
13
|
-
const ref = useRef(void 0);
|
|
14
|
-
const signalRef = useRef(0);
|
|
15
|
-
if (!isEqual(value, ref.current)) {
|
|
16
|
-
ref.current = value;
|
|
17
|
-
signalRef.current += 1;
|
|
18
|
-
}
|
|
19
|
-
return [signalRef.current];
|
|
20
|
-
};
|
|
21
|
-
export {
|
|
22
|
-
useDeepCompareEffect,
|
|
23
|
-
useDeepCompareLayoutEffect,
|
|
24
|
-
useDeepCompareMemo
|
|
25
|
-
};
|
package/dist/hooks/useFilters.js
DELETED
|
@@ -1,160 +0,0 @@
|
|
|
1
|
-
import { useState, useEffect, useCallback, useMemo } from "react";
|
|
2
|
-
import { z } from "zod";
|
|
3
|
-
import { UIRouter } from "../config/router.context.js";
|
|
4
|
-
function getFieldType(schema, fieldKey) {
|
|
5
|
-
if (!schema || !schema.shape) {
|
|
6
|
-
return "unknown";
|
|
7
|
-
}
|
|
8
|
-
let fieldSchema = schema.shape[fieldKey];
|
|
9
|
-
while (fieldSchema) {
|
|
10
|
-
if (fieldSchema instanceof z.ZodOptional || fieldSchema instanceof z.ZodNullable) {
|
|
11
|
-
fieldSchema = fieldSchema.unwrap();
|
|
12
|
-
} else {
|
|
13
|
-
break;
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
if (!fieldSchema) {
|
|
17
|
-
return "unknown";
|
|
18
|
-
}
|
|
19
|
-
if (fieldSchema instanceof z.ZodNumber) {
|
|
20
|
-
return "number";
|
|
21
|
-
}
|
|
22
|
-
if (fieldSchema instanceof z.ZodBoolean) {
|
|
23
|
-
return "boolean";
|
|
24
|
-
}
|
|
25
|
-
if (fieldSchema instanceof z.ZodString) {
|
|
26
|
-
return "string";
|
|
27
|
-
}
|
|
28
|
-
return "unknown";
|
|
29
|
-
}
|
|
30
|
-
const serializeFiltersToQuery = (filterData, prefix) => {
|
|
31
|
-
const query = {};
|
|
32
|
-
for (const [key, value] of Object.entries(filterData)) {
|
|
33
|
-
if (value === null || value === void 0) {
|
|
34
|
-
continue;
|
|
35
|
-
}
|
|
36
|
-
const filterKey = `filter[${prefix && `${prefix}-`}${key}]`;
|
|
37
|
-
if (Array.isArray(value) || typeof value === "object") {
|
|
38
|
-
query[filterKey] = JSON.stringify(value);
|
|
39
|
-
} else if (typeof value === "boolean") {
|
|
40
|
-
query[filterKey] = value ? "true" : "false";
|
|
41
|
-
} else {
|
|
42
|
-
query[filterKey] = value.toString();
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
return query;
|
|
46
|
-
};
|
|
47
|
-
const parseFilterFromQuery = (searchParams, schema) => {
|
|
48
|
-
const filter = {};
|
|
49
|
-
for (const [key, value] of searchParams.entries()) {
|
|
50
|
-
const match = /^filter\[(.+?)\]$/.exec(key);
|
|
51
|
-
if (!match) {
|
|
52
|
-
continue;
|
|
53
|
-
}
|
|
54
|
-
const filterKey = match[1];
|
|
55
|
-
const isArray = value.startsWith("[") && value.endsWith("]");
|
|
56
|
-
const isObject = value.startsWith("{") && value.endsWith("}");
|
|
57
|
-
const isNumber = !Number.isNaN(Number(value)) && value !== "";
|
|
58
|
-
const isBoolean = ["true", "false"].includes(value);
|
|
59
|
-
if (isArray || isObject || isNumber) {
|
|
60
|
-
filter[filterKey] = JSON.parse(value);
|
|
61
|
-
} else if (isBoolean) {
|
|
62
|
-
filter[filterKey] = value === "true";
|
|
63
|
-
} else {
|
|
64
|
-
const expectedType = getFieldType(schema, filterKey);
|
|
65
|
-
if (expectedType === "number" && !Number.isNaN(Number(value)) && value !== "" && value !== null) {
|
|
66
|
-
filter[filterKey] = Number(value);
|
|
67
|
-
} else if (expectedType === "boolean" && ["true", "false"].includes(value)) {
|
|
68
|
-
filter[filterKey] = value === "true";
|
|
69
|
-
} else {
|
|
70
|
-
filter[filterKey] = value;
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
return filter;
|
|
75
|
-
};
|
|
76
|
-
const useFilters = (defaultFilterValues, prefix = "", schema) => {
|
|
77
|
-
const { searchParams, pathname, replace } = UIRouter.useUIRouter();
|
|
78
|
-
const [filterData, setFilterData] = useState(
|
|
79
|
-
() => parseFilterFromQuery(searchParams, schema)
|
|
80
|
-
);
|
|
81
|
-
useEffect(() => {
|
|
82
|
-
const setUrlToDefaultFilters = () => {
|
|
83
|
-
const flatFilterQuery = serializeFiltersToQuery(defaultFilterValues, prefix);
|
|
84
|
-
const url = `${pathname}?${new URLSearchParams({
|
|
85
|
-
...Object.fromEntries(searchParams.entries()),
|
|
86
|
-
...flatFilterQuery
|
|
87
|
-
}).toString()}`;
|
|
88
|
-
replace(url);
|
|
89
|
-
};
|
|
90
|
-
const currentFilters = parseFilterFromQuery(searchParams, schema);
|
|
91
|
-
const hasFiltersSet = Object.keys(currentFilters).length > 0;
|
|
92
|
-
if (defaultFilterValues && !hasFiltersSet) {
|
|
93
|
-
setUrlToDefaultFilters();
|
|
94
|
-
}
|
|
95
|
-
}, [defaultFilterValues, prefix, schema]);
|
|
96
|
-
useEffect(() => {
|
|
97
|
-
const newQueryFilters = parseFilterFromQuery(searchParams, schema);
|
|
98
|
-
setFilterData(newQueryFilters);
|
|
99
|
-
}, [searchParams, schema]);
|
|
100
|
-
const setFilterValue = useCallback(
|
|
101
|
-
(data2) => {
|
|
102
|
-
let newFilters = { ...filterData };
|
|
103
|
-
const isReset = Object.keys(data2).length === 0;
|
|
104
|
-
const isResetToDefault = data2 === defaultFilterValues;
|
|
105
|
-
if (isResetToDefault) {
|
|
106
|
-
newFilters = {
|
|
107
|
-
...defaultFilterValues
|
|
108
|
-
};
|
|
109
|
-
} else if (isReset) {
|
|
110
|
-
newFilters = {};
|
|
111
|
-
} else {
|
|
112
|
-
Object.entries(data2).forEach(([key, value]) => {
|
|
113
|
-
if (value === void 0) {
|
|
114
|
-
delete newFilters[key];
|
|
115
|
-
} else {
|
|
116
|
-
newFilters[key] = value;
|
|
117
|
-
}
|
|
118
|
-
});
|
|
119
|
-
}
|
|
120
|
-
const prefixPart = prefix ? `${prefix}-` : "";
|
|
121
|
-
const cleanedQuery = searchParams.keys().reduce(
|
|
122
|
-
(acc, k) => {
|
|
123
|
-
if (!k.startsWith(`filter[${prefixPart}`)) {
|
|
124
|
-
acc[k] = searchParams.get(k) ?? "";
|
|
125
|
-
}
|
|
126
|
-
return acc;
|
|
127
|
-
},
|
|
128
|
-
{}
|
|
129
|
-
);
|
|
130
|
-
const flatFilterQuery = serializeFiltersToQuery(newFilters, prefix);
|
|
131
|
-
const url = `${pathname}?${new URLSearchParams({
|
|
132
|
-
...cleanedQuery,
|
|
133
|
-
...flatFilterQuery
|
|
134
|
-
}).toString()}`;
|
|
135
|
-
replace(url);
|
|
136
|
-
setFilterData(newFilters);
|
|
137
|
-
},
|
|
138
|
-
[filterData, prefix, pathname, replace, defaultFilterValues, searchParams]
|
|
139
|
-
);
|
|
140
|
-
const getFilterValue = useCallback(
|
|
141
|
-
(keys) => {
|
|
142
|
-
const result = {};
|
|
143
|
-
keys.forEach((key) => {
|
|
144
|
-
result[key] = filterData[key];
|
|
145
|
-
});
|
|
146
|
-
return result;
|
|
147
|
-
},
|
|
148
|
-
[filterData]
|
|
149
|
-
);
|
|
150
|
-
const clearAllFilters = useCallback(() => {
|
|
151
|
-
setFilterValue(defaultFilterValues ?? {});
|
|
152
|
-
}, [defaultFilterValues, setFilterValue]);
|
|
153
|
-
const data = useMemo(() => {
|
|
154
|
-
return { filterData, setFilterValue, getFilterValue, clearAllFilters };
|
|
155
|
-
}, [filterData, setFilterValue, getFilterValue, clearAllFilters]);
|
|
156
|
-
return data;
|
|
157
|
-
};
|
|
158
|
-
export {
|
|
159
|
-
useFilters
|
|
160
|
-
};
|
package/dist/hooks/useForm.js
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { zodResolver } from "@hookform/resolvers/zod";
|
|
2
|
-
import { useMemo } from "react";
|
|
3
|
-
import { useForm as useForm$1 } from "react-hook-form";
|
|
4
|
-
function useForm({
|
|
5
|
-
resolver,
|
|
6
|
-
zodSchema,
|
|
7
|
-
defaultValues,
|
|
8
|
-
...props
|
|
9
|
-
}) {
|
|
10
|
-
const formResolver = useMemo(
|
|
11
|
-
() => resolver ?? (zodSchema ? zodResolver(zodSchema) : void 0),
|
|
12
|
-
[resolver, zodSchema]
|
|
13
|
-
);
|
|
14
|
-
return useForm$1({
|
|
15
|
-
...props,
|
|
16
|
-
resolver: formResolver,
|
|
17
|
-
defaultValues
|
|
18
|
-
});
|
|
19
|
-
}
|
|
20
|
-
export {
|
|
21
|
-
useForm
|
|
22
|
-
};
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
import { useRef, useEffect } from "react";
|
|
2
|
-
import { useAutosave } from "./useAutosave.js";
|
|
3
|
-
import { useForm } from "./useForm.js";
|
|
4
|
-
import { ObjectUtils } from "../utils/object.utils.js";
|
|
5
|
-
const getResetTimeoutErrorMessage = (resetTimeout) => `Form Reset Timeout (${resetTimeout}ms) - Action Required
|
|
6
|
-
Problem: Form values weren't reset after submission.
|
|
7
|
-
|
|
8
|
-
Likely causes:
|
|
9
|
-
• Missing variables in reset dependency array
|
|
10
|
-
• Reset dependencies not updating after form save
|
|
11
|
-
• Async operations blocking timely reset
|
|
12
|
-
|
|
13
|
-
Solutions:
|
|
14
|
-
1. Ensure reset dependencies include all relevant state variables
|
|
15
|
-
2. Confirm your submission handler updates state properly (check query invalidation)
|
|
16
|
-
3. For slower operations, consider increasing the timeout threshold`;
|
|
17
|
-
function useFormAutosave({
|
|
18
|
-
autosaveDelay,
|
|
19
|
-
enableAutosave,
|
|
20
|
-
onAutosave,
|
|
21
|
-
getResetValues,
|
|
22
|
-
resetDeps,
|
|
23
|
-
resetTimeout = 5e3,
|
|
24
|
-
...props
|
|
25
|
-
}) {
|
|
26
|
-
const form = useForm({ ...props, defaultValues: getResetValues() });
|
|
27
|
-
const shouldResetFormValuesRef = useRef(false);
|
|
28
|
-
const resetFormValuesTimeoutRef = useRef(void 0);
|
|
29
|
-
useEffect(() => {
|
|
30
|
-
const resetValues = getResetValues();
|
|
31
|
-
if (resetValues === void 0) {
|
|
32
|
-
return;
|
|
33
|
-
}
|
|
34
|
-
const resetFormValues = async () => {
|
|
35
|
-
const keepStateOptions = shouldResetFormValuesRef.current ? { keepDirtyValues: true } : void 0;
|
|
36
|
-
shouldResetFormValuesRef.current = false;
|
|
37
|
-
let values = resetValues;
|
|
38
|
-
if (ObjectUtils.isFunction(resetValues)) {
|
|
39
|
-
values = await resetValues();
|
|
40
|
-
}
|
|
41
|
-
form.reset(values, keepStateOptions);
|
|
42
|
-
};
|
|
43
|
-
resetFormValues();
|
|
44
|
-
}, [...resetDeps]);
|
|
45
|
-
const onSaveSuccess = () => {
|
|
46
|
-
shouldResetFormValuesRef.current = true;
|
|
47
|
-
if (resetFormValuesTimeoutRef.current) {
|
|
48
|
-
clearTimeout(resetFormValuesTimeoutRef.current);
|
|
49
|
-
}
|
|
50
|
-
resetFormValuesTimeoutRef.current = setTimeout(() => {
|
|
51
|
-
if (shouldResetFormValuesRef.current) {
|
|
52
|
-
throw new Error(getResetTimeoutErrorMessage(resetTimeout));
|
|
53
|
-
}
|
|
54
|
-
}, resetTimeout);
|
|
55
|
-
};
|
|
56
|
-
useAutosave({
|
|
57
|
-
form,
|
|
58
|
-
delay: autosaveDelay,
|
|
59
|
-
enabled: enableAutosave,
|
|
60
|
-
onSave: onAutosave,
|
|
61
|
-
onSaveSuccess
|
|
62
|
-
});
|
|
63
|
-
return form;
|
|
64
|
-
}
|
|
65
|
-
export {
|
|
66
|
-
useFormAutosave
|
|
67
|
-
};
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { useState, useEffect } from "react";
|
|
2
|
-
const useIntersectionObserver = ({
|
|
3
|
-
onIntersection,
|
|
4
|
-
root,
|
|
5
|
-
rootMargin,
|
|
6
|
-
threshold
|
|
7
|
-
}) => {
|
|
8
|
-
const [ref, setRef] = useState(null);
|
|
9
|
-
useEffect(() => {
|
|
10
|
-
const observer = new IntersectionObserver(
|
|
11
|
-
(entries) => {
|
|
12
|
-
if (entries.some((entry) => entry.isIntersecting)) {
|
|
13
|
-
onIntersection?.();
|
|
14
|
-
}
|
|
15
|
-
},
|
|
16
|
-
{ root, rootMargin, threshold }
|
|
17
|
-
);
|
|
18
|
-
if (ref) {
|
|
19
|
-
observer.observe(ref);
|
|
20
|
-
}
|
|
21
|
-
return () => observer.disconnect();
|
|
22
|
-
}, [ref, root, rootMargin, threshold, onIntersection]);
|
|
23
|
-
return { setRef };
|
|
24
|
-
};
|
|
25
|
-
export {
|
|
26
|
-
useIntersectionObserver
|
|
27
|
-
};
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import { useState, useCallback } from "react";
|
|
2
|
-
const getValue = (key, schema) => {
|
|
3
|
-
if (!localStorage) {
|
|
4
|
-
return null;
|
|
5
|
-
}
|
|
6
|
-
const lsValue = localStorage.getItem(key);
|
|
7
|
-
if (!lsValue) {
|
|
8
|
-
return null;
|
|
9
|
-
}
|
|
10
|
-
let jsonOrString;
|
|
11
|
-
try {
|
|
12
|
-
jsonOrString = JSON.parse(lsValue);
|
|
13
|
-
} catch {
|
|
14
|
-
jsonOrString = lsValue;
|
|
15
|
-
}
|
|
16
|
-
const parsedValue = schema.safeParse(jsonOrString);
|
|
17
|
-
if (parsedValue.success) {
|
|
18
|
-
return parsedValue.data;
|
|
19
|
-
} else {
|
|
20
|
-
return null;
|
|
21
|
-
}
|
|
22
|
-
};
|
|
23
|
-
const useLocalStorage = ({ key, schema }) => {
|
|
24
|
-
const [value, setValue] = useState(() => getValue(key, schema));
|
|
25
|
-
const set = useCallback(
|
|
26
|
-
(newValue) => {
|
|
27
|
-
if (!localStorage) {
|
|
28
|
-
return;
|
|
29
|
-
}
|
|
30
|
-
const parsedValue = schema.safeParse(newValue);
|
|
31
|
-
if (!parsedValue.success) {
|
|
32
|
-
return;
|
|
33
|
-
}
|
|
34
|
-
if (typeof parsedValue.data === "string") {
|
|
35
|
-
localStorage.setItem(key, parsedValue.data);
|
|
36
|
-
} else {
|
|
37
|
-
localStorage.setItem(key, JSON.stringify(parsedValue.data));
|
|
38
|
-
}
|
|
39
|
-
setValue(parsedValue.data);
|
|
40
|
-
},
|
|
41
|
-
[key, schema]
|
|
42
|
-
);
|
|
43
|
-
const remove = useCallback(() => {
|
|
44
|
-
if (!localStorage) {
|
|
45
|
-
return;
|
|
46
|
-
}
|
|
47
|
-
localStorage.removeItem(key);
|
|
48
|
-
setValue(null);
|
|
49
|
-
}, [key]);
|
|
50
|
-
return { value, set, remove };
|
|
51
|
-
};
|
|
52
|
-
export {
|
|
53
|
-
useLocalStorage
|
|
54
|
-
};
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { useRef, useEffect } from "react";
|
|
2
|
-
const useLongPressRepeat = ({
|
|
3
|
-
onPress,
|
|
4
|
-
enabled = true,
|
|
5
|
-
interval = 85,
|
|
6
|
-
timeout = 500
|
|
7
|
-
}) => {
|
|
8
|
-
const intervalRef = useRef(void 0);
|
|
9
|
-
useEffect(() => {
|
|
10
|
-
return () => {
|
|
11
|
-
clearInterval(intervalRef.current);
|
|
12
|
-
};
|
|
13
|
-
}, []);
|
|
14
|
-
const onPressStart = () => {
|
|
15
|
-
onPress(false);
|
|
16
|
-
if (!enabled) {
|
|
17
|
-
return;
|
|
18
|
-
}
|
|
19
|
-
intervalRef.current = setTimeout(() => {
|
|
20
|
-
onPress(true);
|
|
21
|
-
intervalRef.current = setInterval(() => {
|
|
22
|
-
onPress(true);
|
|
23
|
-
}, interval);
|
|
24
|
-
}, timeout);
|
|
25
|
-
};
|
|
26
|
-
const onPressEnd = () => {
|
|
27
|
-
clearInterval(intervalRef.current);
|
|
28
|
-
};
|
|
29
|
-
return { onPressStart, onPressEnd };
|
|
30
|
-
};
|
|
31
|
-
export {
|
|
32
|
-
useLongPressRepeat
|
|
33
|
-
};
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { useState, useEffect } from "react";
|
|
2
|
-
import { UIRouter } from "../config/router.context.js";
|
|
3
|
-
const DEFAULT_STATE = {
|
|
4
|
-
pageIndex: 1,
|
|
5
|
-
pageSize: 20
|
|
6
|
-
};
|
|
7
|
-
function usePagination(defaultPagination) {
|
|
8
|
-
const { pathname, replace, searchParams } = UIRouter.useUIRouter();
|
|
9
|
-
const [pagination, setPagination] = useState(
|
|
10
|
-
defaultPagination ?? {
|
|
11
|
-
pageIndex: searchParams.has("page") ? Number.parseInt(searchParams.get("page") ?? "", 10) : DEFAULT_STATE.pageIndex,
|
|
12
|
-
pageSize: searchParams.has("size") ? Number.parseInt(searchParams.get("size") ?? "", 10) : DEFAULT_STATE.pageSize
|
|
13
|
-
}
|
|
14
|
-
);
|
|
15
|
-
useEffect(() => {
|
|
16
|
-
const params = new URLSearchParams(searchParams);
|
|
17
|
-
if (pagination.pageSize !== DEFAULT_STATE.pageSize) {
|
|
18
|
-
params.append("size", pagination.pageSize.toString());
|
|
19
|
-
}
|
|
20
|
-
if (pagination.pageIndex !== DEFAULT_STATE.pageIndex) {
|
|
21
|
-
params.append("page", pagination.pageIndex.toString());
|
|
22
|
-
}
|
|
23
|
-
const url = `${pathname}${params.size > 0 ? `?${params.toString()}` : ""}`;
|
|
24
|
-
replace(url);
|
|
25
|
-
}, [pagination]);
|
|
26
|
-
return {
|
|
27
|
-
pagination,
|
|
28
|
-
setPagination,
|
|
29
|
-
pageIndex: pagination.pageIndex,
|
|
30
|
-
pageSize: pagination.pageSize
|
|
31
|
-
};
|
|
32
|
-
}
|
|
33
|
-
export {
|
|
34
|
-
usePagination
|
|
35
|
-
};
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { useRef, useEffect } from "react";
|
|
2
|
-
import { useBreakpoint } from "./useBreakpoint.js";
|
|
3
|
-
function useScrollableListBox() {
|
|
4
|
-
const ref = useRef(null);
|
|
5
|
-
const isDesktop = useBreakpoint("md");
|
|
6
|
-
useEffect(() => {
|
|
7
|
-
const node = ref.current;
|
|
8
|
-
if (!node || isDesktop) {
|
|
9
|
-
return void 0;
|
|
10
|
-
}
|
|
11
|
-
const onPointerDownCapture = (e) => {
|
|
12
|
-
e.stopPropagation();
|
|
13
|
-
};
|
|
14
|
-
const onClickCapture = (e) => {
|
|
15
|
-
if (e.currentTarget?.contains(e.target) && e.target !== e.currentTarget) {
|
|
16
|
-
e.target.click();
|
|
17
|
-
}
|
|
18
|
-
};
|
|
19
|
-
node.addEventListener("pointerdown", onPointerDownCapture);
|
|
20
|
-
node.addEventListener("click", onClickCapture);
|
|
21
|
-
return () => {
|
|
22
|
-
node.removeEventListener("pointerdown", onPointerDownCapture);
|
|
23
|
-
node.removeEventListener("click", onClickCapture);
|
|
24
|
-
};
|
|
25
|
-
}, [ref, isDesktop]);
|
|
26
|
-
return { ref };
|
|
27
|
-
}
|
|
28
|
-
export {
|
|
29
|
-
useScrollableListBox
|
|
30
|
-
};
|
package/dist/hooks/useSorting.js
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { useState, useMemo, useEffect } from "react";
|
|
2
|
-
import { UIRouter } from "../config/router.context.js";
|
|
3
|
-
function useSorting(defaultSorting, prefix = "") {
|
|
4
|
-
const { pathname, replace, searchParams } = UIRouter.useUIRouter();
|
|
5
|
-
const [sorting, setSorting] = useState(
|
|
6
|
-
defaultSorting ?? searchParams.get(`order${prefix && `-${prefix}`}`)?.split(",").map((item) => {
|
|
7
|
-
if (item.startsWith("-")) {
|
|
8
|
-
return { id: item.slice(1), desc: true };
|
|
9
|
-
}
|
|
10
|
-
if (item.startsWith("+")) {
|
|
11
|
-
return { id: item.slice(1), desc: false };
|
|
12
|
-
}
|
|
13
|
-
return { id: item, desc: false };
|
|
14
|
-
}) ?? []
|
|
15
|
-
);
|
|
16
|
-
const order = useMemo(() => {
|
|
17
|
-
return sorting.map((field) => `${field.desc ? "-" : "+"}${field.id}`).join(",");
|
|
18
|
-
}, [sorting]);
|
|
19
|
-
useEffect(() => {
|
|
20
|
-
const params = new URLSearchParams(searchParams);
|
|
21
|
-
params.delete("order");
|
|
22
|
-
if (order) {
|
|
23
|
-
params.append(`order${prefix && `-${prefix}`}`, order);
|
|
24
|
-
}
|
|
25
|
-
const url = `${pathname}${params.size > 0 ? `?${params.toString()}` : ""}`;
|
|
26
|
-
replace(url);
|
|
27
|
-
}, [order]);
|
|
28
|
-
return { sorting, setSorting, order };
|
|
29
|
-
}
|
|
30
|
-
export {
|
|
31
|
-
useSorting
|
|
32
|
-
};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { useState, useRef, useCallback } from "react";
|
|
2
|
-
import { ObjectUtils } from "../utils/object.utils.js";
|
|
3
|
-
const useStateAndRef = (initialState) => {
|
|
4
|
-
const [state, setState] = useState(initialState);
|
|
5
|
-
const ref = useRef(state);
|
|
6
|
-
const updateValue = useCallback(
|
|
7
|
-
(value) => {
|
|
8
|
-
ref.current = ObjectUtils.isFunction(value) ? value(ref.current) : value;
|
|
9
|
-
setState(ref.current);
|
|
10
|
-
},
|
|
11
|
-
[setState]
|
|
12
|
-
);
|
|
13
|
-
return [state, ref, updateValue];
|
|
14
|
-
};
|
|
15
|
-
export {
|
|
16
|
-
useStateAndRef
|
|
17
|
-
};
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import { useState, useEffect, useCallback, useMemo } from "react";
|
|
2
|
-
function sortByKeyOrder(data, orderedKeys = []) {
|
|
3
|
-
return [...data].sort((a, b) => {
|
|
4
|
-
return orderedKeys.findIndex((key) => key === (a.id ?? a.accessorKey)) - orderedKeys.findIndex((key) => key === (b.id ?? b.accessorKey));
|
|
5
|
-
});
|
|
6
|
-
}
|
|
7
|
-
function useTableColumnConfig(defaultColumns, options = {}) {
|
|
8
|
-
const [internalVisibleColumns, setInternalVisibleColumns] = useState(
|
|
9
|
-
() => defaultColumns.reduce((acc, col) => {
|
|
10
|
-
const key = col.id ?? col.accessorKey;
|
|
11
|
-
acc[key] = true;
|
|
12
|
-
return acc;
|
|
13
|
-
}, {})
|
|
14
|
-
);
|
|
15
|
-
const [internalColumnOrder, setInternalColumnOrder] = useState(
|
|
16
|
-
() => defaultColumns.map((col) => col.id ?? col.accessorKey)
|
|
17
|
-
);
|
|
18
|
-
useEffect(() => {
|
|
19
|
-
if (options.visibleColumns) {
|
|
20
|
-
setInternalVisibleColumns(options.visibleColumns);
|
|
21
|
-
}
|
|
22
|
-
}, [options.visibleColumns]);
|
|
23
|
-
useEffect(() => {
|
|
24
|
-
if (options.columnOrder) {
|
|
25
|
-
setInternalColumnOrder(options.columnOrder);
|
|
26
|
-
}
|
|
27
|
-
}, [options.columnOrder]);
|
|
28
|
-
const handleVisibilityChange = useCallback(
|
|
29
|
-
(value) => {
|
|
30
|
-
setInternalVisibleColumns(value);
|
|
31
|
-
options?.onVisibilityChange?.(value);
|
|
32
|
-
},
|
|
33
|
-
[options]
|
|
34
|
-
);
|
|
35
|
-
const handleOrderChange = useCallback(
|
|
36
|
-
(value) => {
|
|
37
|
-
setInternalColumnOrder(value);
|
|
38
|
-
options?.onOrderChange?.(value);
|
|
39
|
-
},
|
|
40
|
-
[options]
|
|
41
|
-
);
|
|
42
|
-
const configColumns = useMemo(
|
|
43
|
-
() => sortByKeyOrder(defaultColumns, internalColumnOrder),
|
|
44
|
-
[defaultColumns, internalColumnOrder]
|
|
45
|
-
);
|
|
46
|
-
const columns = useMemo(
|
|
47
|
-
() => configColumns.filter(
|
|
48
|
-
(col) => internalVisibleColumns?.[col.id ?? col.accessorKey] ?? true
|
|
49
|
-
),
|
|
50
|
-
[configColumns, internalVisibleColumns]
|
|
51
|
-
);
|
|
52
|
-
return {
|
|
53
|
-
configColumns,
|
|
54
|
-
columns,
|
|
55
|
-
visibleColumns: internalVisibleColumns,
|
|
56
|
-
columnOrder: internalColumnOrder,
|
|
57
|
-
onVisibilityChange: handleVisibilityChange,
|
|
58
|
-
onOrderChange: handleOrderChange
|
|
59
|
-
};
|
|
60
|
-
}
|
|
61
|
-
export {
|
|
62
|
-
useTableColumnConfig
|
|
63
|
-
};
|