@povio/ui 3.0.0-rc.3 → 3.1.0
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 +39 -0
- package/dist/assets/icons/AlignCenter.js +11 -26
- package/dist/assets/icons/AlignLeft.js +11 -26
- package/dist/assets/icons/AlignLeftRight.js +11 -26
- package/dist/assets/icons/AlignRight.js +11 -26
- package/dist/assets/icons/ArrowDropDown.js +11 -26
- package/dist/assets/icons/ArrowDropUp.js +11 -26
- package/dist/assets/icons/ArrowLeft.js +11 -26
- package/dist/assets/icons/ArrowRight.js +11 -26
- package/dist/assets/icons/Bold.js +11 -26
- package/dist/assets/icons/BulletedList.js +11 -26
- package/dist/assets/icons/Calendar.js +13 -28
- package/dist/assets/icons/Check.js +13 -28
- package/dist/assets/icons/CheckCircle.js +11 -26
- package/dist/assets/icons/CheckboxCheckmark.js +14 -29
- package/dist/assets/icons/CheckboxIndeterminate.js +14 -29
- package/dist/assets/icons/ChevronDown.js +13 -28
- package/dist/assets/icons/ChevronLeft.js +13 -28
- package/dist/assets/icons/ChevronRight.js +13 -28
- package/dist/assets/icons/ChevronUp.js +13 -28
- package/dist/assets/icons/ChevronsLeft.js +13 -28
- package/dist/assets/icons/ChevronsRight.js +13 -28
- package/dist/assets/icons/Clock.js +11 -26
- package/dist/assets/icons/Close.js +11 -26
- package/dist/assets/icons/DateTime.js +14 -35
- package/dist/assets/icons/DragIndicator.js +11 -26
- package/dist/assets/icons/File.js +13 -28
- package/dist/assets/icons/Highlight.js +11 -26
- package/dist/assets/icons/HighlightOn.js +15 -49
- package/dist/assets/icons/Home.js +11 -26
- package/dist/assets/icons/Info.js +16 -37
- package/dist/assets/icons/Italic.js +11 -26
- package/dist/assets/icons/Link.js +11 -26
- package/dist/assets/icons/Menu.js +11 -26
- package/dist/assets/icons/NumberedList.js +11 -26
- package/dist/assets/icons/PointerHorizontal.js +11 -26
- package/dist/assets/icons/PointerVertical.js +11 -26
- package/dist/assets/icons/Search.js +11 -26
- package/dist/assets/icons/Send.js +13 -28
- package/dist/assets/icons/Strikethrough.js +11 -26
- package/dist/assets/icons/TextColor.js +14 -48
- package/dist/assets/icons/Today.js +11 -26
- package/dist/assets/icons/Underlined.js +13 -28
- package/dist/assets/icons/Upload.js +14 -35
- package/dist/assets/icons/Visibility.js +11 -26
- package/dist/assets/icons/VisibilityOff.js +11 -26
- package/dist/assets/icons/WarningFilled.js +13 -28
- package/dist/components/Breadcrumbs/Breadcrumbs.js +56 -207
- package/dist/components/Menu/Menu.d.ts +4 -0
- package/dist/components/Menu/Menu.js +2 -18
- package/dist/components/Menu/MenuDesktop.js +7 -41
- package/dist/components/Menu/MenuItem.js +9 -32
- package/dist/components/Menu/MenuMobile.d.ts +1 -1
- package/dist/components/Menu/MenuMobile.js +39 -97
- package/dist/components/Menu/MenuPopover.js +29 -105
- package/dist/components/buttons/IconButton/IconButton.js +8 -40
- package/dist/components/buttons/InlineIconButton/InlineIconButton.d.ts +1 -2
- package/dist/components/buttons/InlineIconButton/InlineIconButton.js +9 -34
- package/dist/components/buttons/PillButton/PillButton.js +17 -55
- package/dist/components/buttons/SplitButton/SplitButton.js +18 -103
- package/dist/components/buttons/TextButton/TextButton.js +8 -30
- package/dist/components/buttons/ToggleButton/ToggleButton.js +8 -28
- package/dist/components/buttons/shared/ButtonContent.js +22 -80
- package/dist/components/inputs/Checkbox/Checkbox.d.ts +0 -1
- package/dist/components/inputs/Checkbox/Checkbox.js +35 -201
- package/dist/components/inputs/Checkbox/CheckboxCheckmark.js +10 -24
- package/dist/components/inputs/Checkbox/checkbox.cva.d.ts +0 -3
- package/dist/components/inputs/Checkbox/checkbox.cva.js +1 -2
- package/dist/components/inputs/DateTime/DatePicker/DatePicker.d.ts +5 -12
- package/dist/components/inputs/DateTime/DatePicker/DatePicker.js +75 -373
- package/dist/components/inputs/DateTime/DateRangePicker/DateRangePicker.d.ts +5 -12
- package/dist/components/inputs/DateTime/DateRangePicker/DateRangePicker.js +186 -492
- package/dist/components/inputs/DateTime/DateTimePicker/DateTimePicker.d.ts +5 -14
- package/dist/components/inputs/DateTime/DateTimePicker/DateTimePicker.js +47 -273
- package/dist/components/inputs/DateTime/TimePicker/TimePicker.d.ts +3 -7
- package/dist/components/inputs/DateTime/TimePicker/TimePicker.js +121 -611
- package/dist/components/inputs/DateTime/shared/Calendar.d.ts +3 -5
- package/dist/components/inputs/DateTime/shared/Calendar.js +120 -338
- package/dist/components/inputs/DateTime/shared/CalendarCell.d.ts +2 -4
- package/dist/components/inputs/DateTime/shared/CalendarCell.js +103 -310
- package/dist/components/inputs/DateTime/shared/CalendarGrid.d.ts +2 -4
- package/dist/components/inputs/DateTime/shared/CalendarGrid.js +33 -150
- package/dist/components/inputs/DateTime/shared/CalendarHeader.d.ts +2 -1
- package/dist/components/inputs/DateTime/shared/CalendarHeader.js +98 -249
- package/dist/components/inputs/DateTime/shared/CalendarSelectHeader.js +137 -318
- package/dist/components/inputs/DateTime/shared/DateField.js +112 -286
- package/dist/components/inputs/DateTime/shared/DatePickerInput.d.ts +3 -14
- package/dist/components/inputs/DateTime/shared/DatePickerInput.js +129 -356
- package/dist/components/inputs/DateTime/shared/DateSegmentItem.d.ts +0 -15
- package/dist/components/inputs/DateTime/shared/DateSegmentItem.js +11 -96
- package/dist/components/inputs/DateTime/shared/DateTimeDialog.d.ts +4 -1
- package/dist/components/inputs/DateTime/shared/DateTimeDialog.js +28 -81
- package/dist/components/inputs/DateTime/shared/DateTimeDialogFooter.js +10 -59
- package/dist/components/inputs/DateTime/shared/MonthPicker.js +58 -103
- package/dist/components/inputs/DateTime/shared/RangeCalendar.js +82 -193
- package/dist/components/inputs/DateTime/shared/TimeField.js +8 -27
- package/dist/components/inputs/DateTime/shared/TimePickerForm.js +110 -279
- package/dist/components/inputs/DateTime/shared/TimePickerInput.d.ts +1 -4
- package/dist/components/inputs/DateTime/shared/TimePickerInput.js +65 -210
- package/dist/components/inputs/DateTime/shared/YearPicker.js +68 -119
- package/dist/components/inputs/File/FileUpload.js +45 -88
- package/dist/components/inputs/File/FileUploadContainer.js +7 -15
- package/dist/components/inputs/File/InputUpload.js +79 -317
- package/dist/components/inputs/File/shared/FileCard.js +41 -104
- package/dist/components/inputs/File/shared/FileCardList.js +12 -47
- package/dist/components/inputs/File/shared/FileUploadContent.js +44 -175
- package/dist/components/inputs/File/shared/FileUploadContentEmpty.js +46 -149
- package/dist/components/inputs/File/shared/FileUploadContentError.js +93 -234
- package/dist/components/inputs/File/shared/FileUploadContentFilled.js +97 -230
- package/dist/components/inputs/File/shared/FileUploadContentLoading.js +55 -199
- package/dist/components/inputs/File/shared/InputUploadContent.js +34 -148
- package/dist/components/inputs/File/shared/InputUploadFilled.js +8 -49
- package/dist/components/inputs/File/shared/ProgressBar.d.ts +2 -2
- package/dist/components/inputs/File/shared/ProgressBar.js +20 -53
- package/dist/components/inputs/File/shared/fileUpload.cva.d.ts +1 -1
- package/dist/components/inputs/File/shared/fileUpload.cva.js +1 -1
- package/dist/components/inputs/File/shared/progressBar.cva.d.ts +38 -0
- package/dist/components/inputs/File/shared/progressBar.cva.js +28 -0
- package/dist/components/inputs/FormField/FormField.d.ts +3 -3
- package/dist/components/inputs/FormField/FormField.js +37 -119
- package/dist/components/inputs/FormField/FormFieldError.js +5 -25
- package/dist/components/inputs/FormField/FormFieldHeader.d.ts +2 -2
- package/dist/components/inputs/FormField/FormFieldHeader.js +22 -81
- package/dist/components/inputs/FormField/FormFieldHeaderClose.js +7 -31
- package/dist/components/inputs/FormField/FormFieldHelper.js +6 -26
- package/dist/components/inputs/FormField/FormFieldLabel.d.ts +2 -2
- package/dist/components/inputs/FormField/FormFieldLabel.js +9 -40
- package/dist/components/inputs/Input/NumberInput/NumberInput.d.ts +2 -5
- package/dist/components/inputs/Input/NumberInput/NumberInput.js +97 -447
- package/dist/components/inputs/Input/PasswordInput/PasswordInput.js +9 -48
- package/dist/components/inputs/Input/TextArea/TextArea.js +90 -305
- package/dist/components/inputs/Input/TextInput/TextInput.d.ts +1 -3
- package/dist/components/inputs/Input/TextInput/TextInput.js +90 -419
- package/dist/components/inputs/Input/shared/InputContent.js +59 -192
- package/dist/components/inputs/Inputs/Form.js +11 -40
- package/dist/components/inputs/Inputs/InputItem.d.ts +21 -15
- package/dist/components/inputs/Inputs/InputItem.js +14 -69
- package/dist/components/inputs/Inputs/Inputs.js +11 -37
- package/dist/components/inputs/RadioGroup/RadioGroup.d.ts +1 -3
- package/dist/components/inputs/RadioGroup/RadioGroup.js +61 -353
- package/dist/components/inputs/RadioGroup/radio.cva.d.ts +0 -45
- package/dist/components/inputs/RadioGroup/radio.cva.js +1 -48
- package/dist/components/inputs/Selection/Autocomplete/Autocomplete.d.ts +2 -6
- package/dist/components/inputs/Selection/Autocomplete/Autocomplete.js +22 -217
- package/dist/components/inputs/Selection/Autocomplete/QueryAutocomplete.d.ts +18 -3
- package/dist/components/inputs/Selection/Autocomplete/QueryAutocomplete.js +8 -107
- package/dist/components/inputs/Selection/Select/Select.d.ts +3 -7
- package/dist/components/inputs/Selection/Select/Select.js +18 -227
- package/dist/components/inputs/Selection/shared/SelectBase.d.ts +3 -8
- package/dist/components/inputs/Selection/shared/SelectBase.js +18 -69
- package/dist/components/inputs/Selection/shared/SelectDesktop.d.ts +1 -1
- package/dist/components/inputs/Selection/shared/SelectDesktop.js +138 -393
- package/dist/components/inputs/Selection/shared/SelectInput.d.ts +2 -2
- package/dist/components/inputs/Selection/shared/SelectInput.js +116 -397
- package/dist/components/inputs/Selection/shared/SelectInputTags.js +25 -99
- package/dist/components/inputs/Selection/shared/SelectListBox.d.ts +2 -2
- package/dist/components/inputs/Selection/shared/SelectListBox.js +52 -164
- package/dist/components/inputs/Selection/shared/SelectListBoxItem.js +35 -85
- package/dist/components/inputs/Selection/shared/SelectListBoxItemSelectAll.js +16 -69
- package/dist/components/inputs/Selection/shared/SelectListBoxLoadingItem.js +21 -70
- package/dist/components/inputs/Selection/shared/SelectListBoxSelectionBar.js +9 -58
- package/dist/components/inputs/Selection/shared/SelectMobile.d.ts +1 -1
- package/dist/components/inputs/Selection/shared/SelectMobile.js +6 -11
- package/dist/components/inputs/Selection/shared/select.context.d.ts +2 -3
- package/dist/components/inputs/Selection/shared/select.context.js +36 -67
- package/dist/components/inputs/Selection/shared/select.types.d.ts +2 -3
- package/dist/components/inputs/Selection/shared/useSelectItems.js +49 -109
- package/dist/components/inputs/Slider/Slider.d.ts +1 -2
- package/dist/components/inputs/Slider/Slider.js +76 -265
- package/dist/components/inputs/TextEditor/TextEditor.d.ts +0 -1
- package/dist/components/inputs/TextEditor/TextEditor.js +98 -447
- package/dist/components/inputs/TextEditor/Toolbar/ColorPicker.js +11 -37
- package/dist/components/inputs/TextEditor/Toolbar/ColorPickerDropdown.js +30 -102
- package/dist/components/inputs/TextEditor/Toolbar/HyperlinkAction.js +45 -194
- package/dist/components/inputs/TextEditor/Toolbar/TextAlignSelect.js +28 -88
- package/dist/components/inputs/TextEditor/Toolbar/TextColorSelect.js +14 -48
- package/dist/components/inputs/TextEditor/Toolbar/TextEditorToolbar.js +19 -66
- package/dist/components/inputs/TextEditor/Toolbar/TextHighlightSelect.js +15 -49
- package/dist/components/inputs/TextEditor/Toolbar/TextListActions.js +32 -92
- package/dist/components/inputs/TextEditor/Toolbar/TextMarksActions.js +54 -126
- package/dist/components/inputs/TextEditor/Toolbar/TextStyleSelect.js +38 -141
- package/dist/components/inputs/Toggle/Toggle.d.ts +0 -1
- package/dist/components/inputs/Toggle/Toggle.js +37 -214
- package/dist/components/inputs/Toggle/toggle.cva.d.ts +0 -3
- package/dist/components/inputs/Toggle/toggle.cva.js +1 -2
- package/dist/components/inputs/shared/CheckContent.d.ts +1 -2
- package/dist/components/inputs/shared/CheckContent.js +11 -21
- package/dist/components/inputs/shared/InputClear.d.ts +1 -2
- package/dist/components/inputs/shared/InputClear.js +12 -88
- package/dist/components/inputs/shared/TooltipWrapper.js +11 -50
- package/dist/components/inputs/shared/input.cva.d.ts +0 -28
- package/dist/components/inputs/shared/input.cva.js +4 -38
- package/dist/components/navigation/Accordion/Accordion.js +22 -69
- package/dist/components/navigation/Accordion/AccordionItem.js +41 -86
- package/dist/components/navigation/Stepper/Stepper.js +22 -67
- package/dist/components/navigation/Stepper/StepperItem.js +31 -104
- package/dist/components/navigation/Stepper/StepperSeparator.js +5 -23
- package/dist/components/overlays/ActionModal/ActionModal.js +35 -169
- package/dist/components/overlays/BottomSheet/BottomSheet.js +25 -98
- package/dist/components/overlays/BottomSheet/BottomSheetHeader.js +8 -48
- package/dist/components/overlays/Drawer/Drawer.js +22 -64
- package/dist/components/overlays/Modal/modal.cva.js +1 -1
- package/dist/components/overlays/ResponsivePopover/ResponsivePopover.d.ts +5 -1
- package/dist/components/overlays/ResponsivePopover/ResponsivePopover.js +28 -83
- package/dist/components/overlays/Tooltip/Tooltip.js +28 -137
- package/dist/components/overlays/Tooltip/TooltipEllipsis.js +12 -37
- package/dist/components/segment/Segment.js +57 -218
- package/dist/components/segment/SegmentItem.js +10 -67
- package/dist/components/shared/pagination/Pagination.js +22 -108
- package/dist/components/shared/pagination/PaginationList.js +64 -167
- package/dist/components/status/Alert/Alert.js +30 -97
- package/dist/components/status/Loader/Loader.js +22 -77
- package/dist/components/status/Toast/Toast.js +17 -22
- package/dist/components/status/Toast/toast.cva.d.ts +14 -3
- package/dist/components/status/Toast/toast.cva.js +12 -10
- package/dist/components/status/Toast/useToast.js +57 -62
- package/dist/components/table/ColumnConfig.js +54 -158
- package/dist/components/table/InfiniteTable.js +16 -67
- package/dist/components/table/PaginatedTable.js +18 -84
- package/dist/components/table/Table.js +30 -30
- package/dist/components/table/table.cva.d.ts +7 -0
- package/dist/components/table/table.cva.js +2 -1
- package/dist/components/text/Link/Link.js +7 -19
- package/dist/components/text/Pill/Pill.d.ts +15 -0
- package/dist/components/text/Pill/Pill.js +44 -0
- package/dist/components/text/Typography/Typography.js +8 -23
- package/dist/config/confirmation.context.js +1 -1
- package/dist/config/link.context.js +9 -23
- package/dist/config/router.context.js +16 -42
- package/dist/config/theme.context.js +45 -98
- package/dist/config/uiConfig.context.d.ts +10 -21
- package/dist/config/uiConfig.context.js +18 -69
- package/dist/config/uiOverrides.context.d.ts +10 -20
- package/dist/config/uiOverrides.context.js +14 -54
- package/dist/helpers/dynamicInputs.d.ts +5 -5
- package/dist/helpers/dynamicInputs.js +0 -3
- package/dist/hooks/useAutosave.d.ts +1 -2
- package/dist/hooks/useAutosave.js +4 -12
- package/dist/hooks/useBreakpoint.js +3 -16
- package/dist/hooks/useDebounceCallback.js +17 -51
- package/dist/hooks/useFilters.js +64 -125
- package/dist/hooks/useForm.js +8 -42
- package/dist/hooks/useFormAutosave.d.ts +1 -3
- package/dist/hooks/useFormAutosave.js +30 -122
- package/dist/hooks/useIntersectionObserver.d.ts +1 -1
- package/dist/hooks/useIntersectionObserver.js +24 -91
- package/dist/hooks/useLocalStorage.js +10 -43
- package/dist/hooks/useLongPressRepeat.js +20 -55
- package/dist/hooks/usePagination.js +19 -49
- package/dist/hooks/useScrollableListBox.js +16 -37
- package/dist/hooks/useSorting.js +28 -69
- package/dist/hooks/useStateAndRef.js +7 -21
- package/dist/hooks/useTableColumnConfig.js +31 -124
- package/dist/hooks/useTranslationMemo.js +5 -25
- package/dist/index.d.ts +7 -16
- package/dist/index.js +6 -13
- package/dist/tw-ui-plugin.js +0 -6
- package/dist/utils/date-time.utils.d.ts +10 -38
- package/dist/utils/date-time.utils.js +22 -136
- package/package.json +1 -1
- package/dist/components/inputs/DateTime/shared/datePicker.types.d.ts +0 -5
- package/dist/components/inputs/DateTime/shared/datePickerInput.cva.d.ts +0 -16
- package/dist/components/inputs/DateTime/shared/datePickerInput.cva.js +0 -16
- package/dist/components/inputs/DateTime/shared/datePickerTodayIcon.d.ts +0 -15
- package/dist/components/inputs/DateTime/shared/datePickerTodayIcon.js +0 -32
- package/dist/components/inputs/DateTime/shared/dateSegment.utils.d.ts +0 -2
- package/dist/components/inputs/DateTime/shared/dateSegment.utils.spec.d.ts +0 -1
- package/dist/components/inputs/DateTime/shared/staticDateTimeSegments.d.ts +0 -40
- package/dist/components/inputs/DateTime/shared/staticDateTimeSegments.js +0 -85
- package/dist/components/inputs/DateTime/shared/staticDateTimeSegments.spec.d.ts +0 -1
- package/dist/components/inputs/FormField/formFieldHeader.cva.d.ts +0 -13
- package/dist/components/inputs/FormField/formFieldHeader.cva.js +0 -14
- package/dist/components/inputs/Input/NumberRangeInput/NumberRangeField.d.ts +0 -45
- package/dist/components/inputs/Input/NumberRangeInput/NumberRangeField.js +0 -571
- package/dist/components/inputs/Input/NumberRangeInput/NumberRangeInput.d.ts +0 -35
- package/dist/components/inputs/Input/NumberRangeInput/NumberRangeInput.js +0 -575
- package/dist/components/inputs/Input/TextArea/TextArea.cva.d.ts +0 -8
- package/dist/components/inputs/Input/TextArea/TextArea.cva.js +0 -5
- package/dist/components/inputs/Input/shared/numberStatic.utils.d.ts +0 -1
- package/dist/components/inputs/Input/shared/numberStatic.utils.js +0 -7
- package/dist/components/inputs/Selection/Autocomplete/queryAutocomplete.types.d.ts +0 -37
- package/dist/components/inputs/Selection/Select/QuerySelect.d.ts +0 -14
- package/dist/components/inputs/Selection/Select/QuerySelect.js +0 -178
- package/dist/components/inputs/Selection/shared/StaticSelectTrailingContent.d.ts +0 -9
- package/dist/components/inputs/Selection/shared/StaticSelectTrailingContent.js +0 -47
- package/dist/components/inputs/Selection/shared/querySelect.utils.d.ts +0 -14
- package/dist/components/inputs/Selection/shared/querySelect.utils.js +0 -43
- package/dist/components/inputs/Selection/shared/selectDesktop.cva.d.ts +0 -6
- package/dist/components/inputs/Selection/shared/selectDesktop.cva.js +0 -5
- package/dist/components/inputs/Selection/shared/selectInput.cva.d.ts +0 -12
- package/dist/components/inputs/Selection/shared/selectInput.cva.js +0 -8
- package/dist/components/inputs/Selection/shared/staticSelect.utils.d.ts +0 -23
- package/dist/components/inputs/Selection/shared/staticSelect.utils.js +0 -54
- package/dist/components/inputs/Selection/shared/staticSelect.utils.spec.d.ts +0 -1
- package/dist/components/inputs/Skeleton/InputFrame.d.ts +0 -82
- package/dist/components/inputs/Skeleton/InputFrame.js +0 -548
- package/dist/components/inputs/shared/tooltipWrapper.cva.d.ts +0 -8
- package/dist/components/inputs/shared/tooltipWrapper.cva.js +0 -5
- package/dist/components/inputs/shared/useStaticInputHandoff.d.ts +0 -14
- package/dist/components/inputs/shared/useStaticInputHandoff.js +0 -100
- package/dist/hooks/useAutosave.spec.d.ts +0 -1
- package/dist/hooks/useFormAutosave.spec.d.ts +0 -1
- package/dist/hooks/useKeyInteractions.d.ts +0 -20
- package/dist/hooks/useKeyInteractions.js +0 -54
- package/dist/hooks/useKeyInteractions.spec.d.ts +0 -1
- package/dist/hooks/useQueryAutocomplete.d.ts +0 -14
- package/dist/hooks/useQueryAutocomplete.js +0 -72
- package/dist/utils/query.utils.d.ts +0 -4
- package/dist/utils/query.utils.js +0 -8
|
@@ -1,64 +1,29 @@
|
|
|
1
|
-
import { c } from "react/compiler-runtime";
|
|
2
1
|
import { useEffect, useRef } from "react";
|
|
3
2
|
//#region src/hooks/useLongPressRepeat.ts
|
|
4
|
-
var useLongPressRepeat = (
|
|
5
|
-
const $ = c(10);
|
|
6
|
-
const { onPress, enabled: t1, interval: t2, timeout: t3 } = t0;
|
|
7
|
-
const enabled = t1 === void 0 ? true : t1;
|
|
8
|
-
const interval = t2 === void 0 ? 85 : t2;
|
|
9
|
-
const timeout = t3 === void 0 ? 500 : t3;
|
|
3
|
+
var useLongPressRepeat = ({ onPress, enabled = true, interval = 85, timeout = 500 }) => {
|
|
10
4
|
const intervalRef = useRef(void 0);
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
14
|
-
t4 = () => () => {
|
|
5
|
+
useEffect(() => {
|
|
6
|
+
return () => {
|
|
15
7
|
clearInterval(intervalRef.current);
|
|
16
8
|
};
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
useEffect(t4, t5);
|
|
25
|
-
let t6;
|
|
26
|
-
if ($[2] !== enabled || $[3] !== interval || $[4] !== onPress || $[5] !== timeout) {
|
|
27
|
-
t6 = () => {
|
|
28
|
-
onPress(false);
|
|
29
|
-
if (!enabled) return;
|
|
30
|
-
intervalRef.current = setTimeout(() => {
|
|
9
|
+
}, []);
|
|
10
|
+
const onPressStart = () => {
|
|
11
|
+
onPress(false);
|
|
12
|
+
if (!enabled) return;
|
|
13
|
+
intervalRef.current = setTimeout(() => {
|
|
14
|
+
onPress(true);
|
|
15
|
+
intervalRef.current = setInterval(() => {
|
|
31
16
|
onPress(true);
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
} else t6 = $[6];
|
|
43
|
-
const onPressStart = t6;
|
|
44
|
-
let t7;
|
|
45
|
-
if ($[7] === Symbol.for("react.memo_cache_sentinel")) {
|
|
46
|
-
t7 = () => {
|
|
47
|
-
clearInterval(intervalRef.current);
|
|
48
|
-
};
|
|
49
|
-
$[7] = t7;
|
|
50
|
-
} else t7 = $[7];
|
|
51
|
-
const onPressEnd = t7;
|
|
52
|
-
let t8;
|
|
53
|
-
if ($[8] !== onPressStart) {
|
|
54
|
-
t8 = {
|
|
55
|
-
onPressStart,
|
|
56
|
-
onPressEnd
|
|
57
|
-
};
|
|
58
|
-
$[8] = onPressStart;
|
|
59
|
-
$[9] = t8;
|
|
60
|
-
} else t8 = $[9];
|
|
61
|
-
return t8;
|
|
17
|
+
}, interval);
|
|
18
|
+
}, timeout);
|
|
19
|
+
};
|
|
20
|
+
const onPressEnd = () => {
|
|
21
|
+
clearInterval(intervalRef.current);
|
|
22
|
+
};
|
|
23
|
+
return {
|
|
24
|
+
onPressStart,
|
|
25
|
+
onPressEnd
|
|
26
|
+
};
|
|
62
27
|
};
|
|
63
28
|
//#endregion
|
|
64
29
|
export { useLongPressRepeat };
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { UIRouter } from "../config/router.context.js";
|
|
2
2
|
import { RoutingUtils } from "../utils/routing.utils.js";
|
|
3
|
-
import { c } from "react/compiler-runtime";
|
|
4
3
|
import { useEffect, useState } from "react";
|
|
5
4
|
//#region src/hooks/usePagination.ts
|
|
6
5
|
var DEFAULT_STATE = {
|
|
@@ -8,55 +7,26 @@ var DEFAULT_STATE = {
|
|
|
8
7
|
pageSize: 20
|
|
9
8
|
};
|
|
10
9
|
function usePagination(defaultPagination) {
|
|
11
|
-
const $ = c(12);
|
|
12
10
|
const { replace, searchParams } = UIRouter.useUIRouter();
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
if (params.toString() === searchParams.toString()) return;
|
|
33
|
-
replace(".", RoutingUtils.toRouterSearch(params));
|
|
34
|
-
};
|
|
35
|
-
$[3] = pagination.pageIndex;
|
|
36
|
-
$[4] = pagination.pageSize;
|
|
37
|
-
$[5] = replace;
|
|
38
|
-
$[6] = searchParams;
|
|
39
|
-
$[7] = t1;
|
|
40
|
-
} else t1 = $[7];
|
|
41
|
-
let t2;
|
|
42
|
-
if ($[8] !== pagination) {
|
|
43
|
-
t2 = [pagination];
|
|
44
|
-
$[8] = pagination;
|
|
45
|
-
$[9] = t2;
|
|
46
|
-
} else t2 = $[9];
|
|
47
|
-
useEffect(t1, t2);
|
|
48
|
-
let t3;
|
|
49
|
-
if ($[10] !== pagination) {
|
|
50
|
-
t3 = {
|
|
51
|
-
pagination,
|
|
52
|
-
setPagination,
|
|
53
|
-
pageIndex: pagination.pageIndex,
|
|
54
|
-
pageSize: pagination.pageSize
|
|
55
|
-
};
|
|
56
|
-
$[10] = pagination;
|
|
57
|
-
$[11] = t3;
|
|
58
|
-
} else t3 = $[11];
|
|
59
|
-
return t3;
|
|
11
|
+
const [pagination, setPagination] = useState(defaultPagination ?? {
|
|
12
|
+
pageIndex: searchParams.has("page") ? Number.parseInt(searchParams.get("page") ?? "", 10) : DEFAULT_STATE.pageIndex,
|
|
13
|
+
pageSize: searchParams.has("size") ? Number.parseInt(searchParams.get("size") ?? "", 10) : DEFAULT_STATE.pageSize
|
|
14
|
+
});
|
|
15
|
+
useEffect(() => {
|
|
16
|
+
const params = new URLSearchParams(searchParams);
|
|
17
|
+
params.delete("size");
|
|
18
|
+
params.delete("page");
|
|
19
|
+
if (pagination.pageSize !== DEFAULT_STATE.pageSize) params.set("size", pagination.pageSize.toString());
|
|
20
|
+
if (pagination.pageIndex !== DEFAULT_STATE.pageIndex) params.set("page", pagination.pageIndex.toString());
|
|
21
|
+
if (params.toString() === searchParams.toString()) return;
|
|
22
|
+
replace(".", RoutingUtils.toRouterSearch(params));
|
|
23
|
+
}, [pagination]);
|
|
24
|
+
return {
|
|
25
|
+
pagination,
|
|
26
|
+
setPagination,
|
|
27
|
+
pageIndex: pagination.pageIndex,
|
|
28
|
+
pageSize: pagination.pageSize
|
|
29
|
+
};
|
|
60
30
|
}
|
|
61
31
|
//#endregion
|
|
62
32
|
export { usePagination };
|
|
@@ -1,47 +1,26 @@
|
|
|
1
1
|
import { useBreakpoint } from "./useBreakpoint.js";
|
|
2
|
-
import { c } from "react/compiler-runtime";
|
|
3
2
|
import { useEffect, useRef } from "react";
|
|
4
3
|
//#region src/hooks/useScrollableListBox.ts
|
|
5
4
|
function useScrollableListBox() {
|
|
6
|
-
const $ = c(4);
|
|
7
5
|
const ref = useRef(null);
|
|
8
6
|
const isDesktop = useBreakpoint("md");
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
if (!node || isDesktop) return;
|
|
15
|
-
const onPointerDownCapture = _temp;
|
|
16
|
-
const onClickCapture = _temp2;
|
|
17
|
-
node.addEventListener("pointerdown", onPointerDownCapture);
|
|
18
|
-
node.addEventListener("click", onClickCapture);
|
|
19
|
-
return () => {
|
|
20
|
-
node.removeEventListener("pointerdown", onPointerDownCapture);
|
|
21
|
-
node.removeEventListener("click", onClickCapture);
|
|
22
|
-
};
|
|
7
|
+
useEffect(() => {
|
|
8
|
+
const node = ref.current;
|
|
9
|
+
if (!node || isDesktop) return;
|
|
10
|
+
const onPointerDownCapture = (e) => {
|
|
11
|
+
e.stopPropagation();
|
|
23
12
|
};
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
t2 = { ref };
|
|
36
|
-
$[3] = t2;
|
|
37
|
-
} else t2 = $[3];
|
|
38
|
-
return t2;
|
|
39
|
-
}
|
|
40
|
-
function _temp2(e_0) {
|
|
41
|
-
if (e_0.currentTarget?.contains(e_0.target) && e_0.target !== e_0.currentTarget) e_0.target.click();
|
|
42
|
-
}
|
|
43
|
-
function _temp(e) {
|
|
44
|
-
e.stopPropagation();
|
|
13
|
+
const onClickCapture = (e) => {
|
|
14
|
+
if (e.currentTarget?.contains(e.target) && e.target !== e.currentTarget) e.target.click();
|
|
15
|
+
};
|
|
16
|
+
node.addEventListener("pointerdown", onPointerDownCapture);
|
|
17
|
+
node.addEventListener("click", onClickCapture);
|
|
18
|
+
return () => {
|
|
19
|
+
node.removeEventListener("pointerdown", onPointerDownCapture);
|
|
20
|
+
node.removeEventListener("click", onClickCapture);
|
|
21
|
+
};
|
|
22
|
+
}, [ref, isDesktop]);
|
|
23
|
+
return { ref };
|
|
45
24
|
}
|
|
46
25
|
//#endregion
|
|
47
26
|
export { useScrollableListBox };
|
package/dist/hooks/useSorting.js
CHANGED
|
@@ -1,79 +1,38 @@
|
|
|
1
1
|
import { UIRouter } from "../config/router.context.js";
|
|
2
2
|
import { RoutingUtils } from "../utils/routing.utils.js";
|
|
3
|
-
import {
|
|
4
|
-
import { useEffect, useState } from "react";
|
|
3
|
+
import { useEffect, useMemo, useState } from "react";
|
|
5
4
|
//#region src/hooks/useSorting.ts
|
|
6
|
-
function useSorting(defaultSorting,
|
|
7
|
-
const $ = c(16);
|
|
8
|
-
const prefix = t0 === void 0 ? "" : t0;
|
|
5
|
+
function useSorting(defaultSorting, prefix = "") {
|
|
9
6
|
const { replace, searchParams } = UIRouter.useUIRouter();
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
$[1] = prefix;
|
|
15
|
-
$[2] = searchParams;
|
|
16
|
-
$[3] = t1;
|
|
17
|
-
} else t1 = $[3];
|
|
18
|
-
const [sorting, setSorting] = useState(t1);
|
|
19
|
-
let t2;
|
|
20
|
-
if ($[4] !== sorting) {
|
|
21
|
-
t2 = sorting.map(_temp2).join(",");
|
|
22
|
-
$[4] = sorting;
|
|
23
|
-
$[5] = t2;
|
|
24
|
-
} else t2 = $[5];
|
|
25
|
-
const order = t2;
|
|
26
|
-
let t3;
|
|
27
|
-
if ($[6] !== order || $[7] !== prefix || $[8] !== replace || $[9] !== searchParams) {
|
|
28
|
-
t3 = () => {
|
|
29
|
-
const params = new URLSearchParams(searchParams);
|
|
30
|
-
const orderKey = prefix ? `order-${prefix}` : "order";
|
|
31
|
-
params.delete(orderKey);
|
|
32
|
-
if (order) params.set(orderKey, order);
|
|
33
|
-
if (params.toString() === searchParams.toString()) return;
|
|
34
|
-
replace(".", RoutingUtils.toRouterSearch(params));
|
|
7
|
+
const [sorting, setSorting] = useState(defaultSorting ?? searchParams.get(`order${prefix && `-${prefix}`}`)?.split(",").map((item) => {
|
|
8
|
+
if (item.startsWith("-")) return {
|
|
9
|
+
id: item.slice(1),
|
|
10
|
+
desc: true
|
|
35
11
|
};
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
$[9] = searchParams;
|
|
40
|
-
$[10] = t3;
|
|
41
|
-
} else t3 = $[10];
|
|
42
|
-
let t4;
|
|
43
|
-
if ($[11] !== order) {
|
|
44
|
-
t4 = [order];
|
|
45
|
-
$[11] = order;
|
|
46
|
-
$[12] = t4;
|
|
47
|
-
} else t4 = $[12];
|
|
48
|
-
useEffect(t3, t4);
|
|
49
|
-
let t5;
|
|
50
|
-
if ($[13] !== order || $[14] !== sorting) {
|
|
51
|
-
t5 = {
|
|
52
|
-
sorting,
|
|
53
|
-
setSorting,
|
|
54
|
-
order
|
|
12
|
+
if (item.startsWith("+")) return {
|
|
13
|
+
id: item.slice(1),
|
|
14
|
+
desc: false
|
|
55
15
|
};
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
desc: false
|
|
73
|
-
};
|
|
16
|
+
return {
|
|
17
|
+
id: item,
|
|
18
|
+
desc: false
|
|
19
|
+
};
|
|
20
|
+
}) ?? []);
|
|
21
|
+
const order = useMemo(() => {
|
|
22
|
+
return sorting.map((field) => `${field.desc ? "-" : "+"}${field.id}`).join(",");
|
|
23
|
+
}, [sorting]);
|
|
24
|
+
useEffect(() => {
|
|
25
|
+
const params = new URLSearchParams(searchParams);
|
|
26
|
+
const orderKey = prefix ? `order-${prefix}` : "order";
|
|
27
|
+
params.delete(orderKey);
|
|
28
|
+
if (order) params.set(orderKey, order);
|
|
29
|
+
if (params.toString() === searchParams.toString()) return;
|
|
30
|
+
replace(".", RoutingUtils.toRouterSearch(params));
|
|
31
|
+
}, [order]);
|
|
74
32
|
return {
|
|
75
|
-
|
|
76
|
-
|
|
33
|
+
sorting,
|
|
34
|
+
setSorting,
|
|
35
|
+
order
|
|
77
36
|
};
|
|
78
37
|
}
|
|
79
38
|
//#endregion
|
|
@@ -1,31 +1,17 @@
|
|
|
1
1
|
import { ObjectUtils } from "../utils/object.utils.js";
|
|
2
|
-
import {
|
|
3
|
-
import { useRef, useState } from "react";
|
|
2
|
+
import { useCallback, useRef, useState } from "react";
|
|
4
3
|
//#region src/hooks/useStateAndRef.ts
|
|
5
4
|
var useStateAndRef = (initialState) => {
|
|
6
|
-
const $ = c(3);
|
|
7
5
|
const [state, setState] = useState(initialState);
|
|
8
6
|
const ref = useRef(state);
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
7
|
+
return [
|
|
8
|
+
state,
|
|
9
|
+
ref,
|
|
10
|
+
useCallback((value) => {
|
|
12
11
|
ref.current = ObjectUtils.isFunction(value) ? value(ref.current) : value;
|
|
13
12
|
setState(ref.current);
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
} else t0 = $[0];
|
|
17
|
-
const updateValue = t0;
|
|
18
|
-
let t1;
|
|
19
|
-
if ($[1] !== state) {
|
|
20
|
-
t1 = [
|
|
21
|
-
state,
|
|
22
|
-
ref,
|
|
23
|
-
updateValue
|
|
24
|
-
];
|
|
25
|
-
$[1] = state;
|
|
26
|
-
$[2] = t1;
|
|
27
|
-
} else t1 = $[2];
|
|
28
|
-
return t1;
|
|
13
|
+
}, [setState])
|
|
14
|
+
];
|
|
29
15
|
};
|
|
30
16
|
//#endregion
|
|
31
17
|
export { useStateAndRef };
|
|
@@ -1,133 +1,40 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { useEffect, useState } from "react";
|
|
1
|
+
import { useCallback, useEffect, useMemo, useState } from "react";
|
|
3
2
|
//#region src/hooks/useTableColumnConfig.ts
|
|
4
3
|
function sortByKeyOrder(data, orderedKeys = []) {
|
|
5
4
|
return [...data].sort((a, b) => {
|
|
6
5
|
return orderedKeys.findIndex((key) => key === (a.id ?? a.accessorKey)) - orderedKeys.findIndex((key) => key === (b.id ?? b.accessorKey));
|
|
7
6
|
});
|
|
8
7
|
}
|
|
9
|
-
function useTableColumnConfig(defaultColumns,
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
$[6] = options.visibleColumns;
|
|
40
|
-
$[7] = t4;
|
|
41
|
-
$[8] = t5;
|
|
42
|
-
} else {
|
|
43
|
-
t4 = $[7];
|
|
44
|
-
t5 = $[8];
|
|
45
|
-
}
|
|
46
|
-
useEffect(t4, t5);
|
|
47
|
-
let t6;
|
|
48
|
-
let t7;
|
|
49
|
-
if ($[9] !== options.columnOrder) {
|
|
50
|
-
t6 = () => {
|
|
51
|
-
if (options.columnOrder) setInternalColumnOrder(options.columnOrder);
|
|
52
|
-
};
|
|
53
|
-
t7 = [options.columnOrder];
|
|
54
|
-
$[9] = options.columnOrder;
|
|
55
|
-
$[10] = t6;
|
|
56
|
-
$[11] = t7;
|
|
57
|
-
} else {
|
|
58
|
-
t6 = $[10];
|
|
59
|
-
t7 = $[11];
|
|
60
|
-
}
|
|
61
|
-
useEffect(t6, t7);
|
|
62
|
-
let t8;
|
|
63
|
-
if ($[12] !== options) {
|
|
64
|
-
t8 = (value) => {
|
|
65
|
-
setInternalVisibleColumns(value);
|
|
66
|
-
options?.onVisibilityChange?.(value);
|
|
67
|
-
};
|
|
68
|
-
$[12] = options;
|
|
69
|
-
$[13] = t8;
|
|
70
|
-
} else t8 = $[13];
|
|
71
|
-
const handleVisibilityChange = t8;
|
|
72
|
-
let t9;
|
|
73
|
-
if ($[14] !== options) {
|
|
74
|
-
t9 = (value_0) => {
|
|
75
|
-
setInternalColumnOrder(value_0);
|
|
76
|
-
options?.onOrderChange?.(value_0);
|
|
77
|
-
};
|
|
78
|
-
$[14] = options;
|
|
79
|
-
$[15] = t9;
|
|
80
|
-
} else t9 = $[15];
|
|
81
|
-
const handleOrderChange = t9;
|
|
82
|
-
let t10;
|
|
83
|
-
if ($[16] !== defaultColumns || $[17] !== internalColumnOrder) {
|
|
84
|
-
t10 = sortByKeyOrder(defaultColumns, internalColumnOrder);
|
|
85
|
-
$[16] = defaultColumns;
|
|
86
|
-
$[17] = internalColumnOrder;
|
|
87
|
-
$[18] = t10;
|
|
88
|
-
} else t10 = $[18];
|
|
89
|
-
const configColumns = t10;
|
|
90
|
-
let t11;
|
|
91
|
-
if ($[19] !== configColumns || $[20] !== internalVisibleColumns) {
|
|
92
|
-
let t12;
|
|
93
|
-
if ($[22] !== internalVisibleColumns) {
|
|
94
|
-
t12 = (col_1) => internalVisibleColumns?.[col_1.id ?? col_1.accessorKey] ?? true;
|
|
95
|
-
$[22] = internalVisibleColumns;
|
|
96
|
-
$[23] = t12;
|
|
97
|
-
} else t12 = $[23];
|
|
98
|
-
t11 = configColumns.filter(t12);
|
|
99
|
-
$[19] = configColumns;
|
|
100
|
-
$[20] = internalVisibleColumns;
|
|
101
|
-
$[21] = t11;
|
|
102
|
-
} else t11 = $[21];
|
|
103
|
-
const columns = t11;
|
|
104
|
-
let t12;
|
|
105
|
-
if ($[24] !== columns || $[25] !== configColumns || $[26] !== handleOrderChange || $[27] !== handleVisibilityChange || $[28] !== internalColumnOrder || $[29] !== internalVisibleColumns) {
|
|
106
|
-
t12 = {
|
|
107
|
-
configColumns,
|
|
108
|
-
columns,
|
|
109
|
-
visibleColumns: internalVisibleColumns,
|
|
110
|
-
columnOrder: internalColumnOrder,
|
|
111
|
-
onVisibilityChange: handleVisibilityChange,
|
|
112
|
-
onOrderChange: handleOrderChange
|
|
113
|
-
};
|
|
114
|
-
$[24] = columns;
|
|
115
|
-
$[25] = configColumns;
|
|
116
|
-
$[26] = handleOrderChange;
|
|
117
|
-
$[27] = handleVisibilityChange;
|
|
118
|
-
$[28] = internalColumnOrder;
|
|
119
|
-
$[29] = internalVisibleColumns;
|
|
120
|
-
$[30] = t12;
|
|
121
|
-
} else t12 = $[30];
|
|
122
|
-
return t12;
|
|
123
|
-
}
|
|
124
|
-
function _temp2(col_0) {
|
|
125
|
-
return col_0.id ?? col_0.accessorKey;
|
|
126
|
-
}
|
|
127
|
-
function _temp(acc, col) {
|
|
128
|
-
const key = col.id ?? col.accessorKey;
|
|
129
|
-
acc[key] = true;
|
|
130
|
-
return acc;
|
|
8
|
+
function useTableColumnConfig(defaultColumns, options = {}) {
|
|
9
|
+
const [internalVisibleColumns, setInternalVisibleColumns] = useState(() => defaultColumns.reduce((acc, col) => {
|
|
10
|
+
const key = col.id ?? col.accessorKey;
|
|
11
|
+
acc[key] = true;
|
|
12
|
+
return acc;
|
|
13
|
+
}, {}));
|
|
14
|
+
const [internalColumnOrder, setInternalColumnOrder] = useState(() => defaultColumns.map((col) => col.id ?? col.accessorKey));
|
|
15
|
+
useEffect(() => {
|
|
16
|
+
if (options.visibleColumns) setInternalVisibleColumns(options.visibleColumns);
|
|
17
|
+
}, [options.visibleColumns]);
|
|
18
|
+
useEffect(() => {
|
|
19
|
+
if (options.columnOrder) setInternalColumnOrder(options.columnOrder);
|
|
20
|
+
}, [options.columnOrder]);
|
|
21
|
+
const handleVisibilityChange = useCallback((value) => {
|
|
22
|
+
setInternalVisibleColumns(value);
|
|
23
|
+
options?.onVisibilityChange?.(value);
|
|
24
|
+
}, [options]);
|
|
25
|
+
const handleOrderChange = useCallback((value) => {
|
|
26
|
+
setInternalColumnOrder(value);
|
|
27
|
+
options?.onOrderChange?.(value);
|
|
28
|
+
}, [options]);
|
|
29
|
+
const configColumns = useMemo(() => sortByKeyOrder(defaultColumns, internalColumnOrder), [defaultColumns, internalColumnOrder]);
|
|
30
|
+
return {
|
|
31
|
+
configColumns,
|
|
32
|
+
columns: useMemo(() => configColumns.filter((col) => internalVisibleColumns?.[col.id ?? col.accessorKey] ?? true), [configColumns, internalVisibleColumns]),
|
|
33
|
+
visibleColumns: internalVisibleColumns,
|
|
34
|
+
columnOrder: internalColumnOrder,
|
|
35
|
+
onVisibilityChange: handleVisibilityChange,
|
|
36
|
+
onOrderChange: handleOrderChange
|
|
37
|
+
};
|
|
131
38
|
}
|
|
132
39
|
//#endregion
|
|
133
40
|
export { useTableColumnConfig };
|
|
@@ -1,32 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { useMemo } from "react";
|
|
2
2
|
import { useTranslation } from "react-i18next";
|
|
3
3
|
//#region src/hooks/useTranslationMemo.ts
|
|
4
4
|
function useTranslationMemo(func) {
|
|
5
|
-
const $ = c(5);
|
|
6
5
|
const { t } = useTranslation();
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
if ($[0] !== func || $[1] !== t) {
|
|
12
|
-
t1 = func(t);
|
|
13
|
-
$[0] = func;
|
|
14
|
-
$[1] = t;
|
|
15
|
-
$[2] = t1;
|
|
16
|
-
} else t1 = $[2];
|
|
17
|
-
t0 = t1;
|
|
18
|
-
break bb0;
|
|
19
|
-
}
|
|
20
|
-
const t1 = func;
|
|
21
|
-
let t2;
|
|
22
|
-
if ($[3] !== t1) {
|
|
23
|
-
t2 = t1();
|
|
24
|
-
$[3] = t1;
|
|
25
|
-
$[4] = t2;
|
|
26
|
-
} else t2 = $[4];
|
|
27
|
-
t0 = t2;
|
|
28
|
-
}
|
|
29
|
-
return t0;
|
|
6
|
+
return useMemo(() => {
|
|
7
|
+
if (func.length === 1) return func(t);
|
|
8
|
+
return func();
|
|
9
|
+
}, [func, t]);
|
|
30
10
|
}
|
|
31
11
|
//#endregion
|
|
32
12
|
export { useTranslationMemo };
|
package/dist/index.d.ts
CHANGED
|
@@ -78,8 +78,6 @@ export type { FormFieldProps } from './components/inputs/FormField/FormField';
|
|
|
78
78
|
export { FormField } from './components/inputs/FormField/FormField';
|
|
79
79
|
export type { ControlledNumberInputProps, NumberInputProps } from './components/inputs/Input/NumberInput/NumberInput';
|
|
80
80
|
export { NumberInput } from './components/inputs/Input/NumberInput/NumberInput';
|
|
81
|
-
export type { ControlledNumberRangeInputProps, NumberRangeInputProps, NumberRangeValue, } from './components/inputs/Input/NumberRangeInput/NumberRangeInput';
|
|
82
|
-
export { NumberRangeInput } from './components/inputs/Input/NumberRangeInput/NumberRangeInput';
|
|
83
81
|
export type { ControlledPasswordInputProps, PasswordInputProps, } from './components/inputs/Input/PasswordInput/PasswordInput';
|
|
84
82
|
export { PasswordInput } from './components/inputs/Input/PasswordInput/PasswordInput';
|
|
85
83
|
export type { ControlledTextAreaProps, TextAreaProps } from './components/inputs/Input/TextArea/TextArea';
|
|
@@ -96,16 +94,11 @@ export type { RadioVariantProps } from './components/inputs/RadioGroup/radio.cva
|
|
|
96
94
|
export type { AutocompleteProps, ControlledAutocompleteProps, } from './components/inputs/Selection/Autocomplete/Autocomplete';
|
|
97
95
|
export { Autocomplete } from './components/inputs/Selection/Autocomplete/Autocomplete';
|
|
98
96
|
export { QueryAutocomplete } from './components/inputs/Selection/Autocomplete/QueryAutocomplete';
|
|
99
|
-
export type { SelectBaseProps } from './components/inputs/Selection/shared/SelectBase';
|
|
100
|
-
export type { DefaultInitialSelectItem, SelectAsyncProps, SelectItem, } from './components/inputs/Selection/shared/select.types';
|
|
101
|
-
export type { QuerySelectProps } from './components/inputs/Selection/Select/QuerySelect';
|
|
102
|
-
export { QuerySelect } from './components/inputs/Selection/Select/QuerySelect';
|
|
103
97
|
export type { ControlledSelectProps, SelectProps } from './components/inputs/Selection/Select/Select';
|
|
104
98
|
export { Select } from './components/inputs/Selection/Select/Select';
|
|
105
99
|
export type { ControlledSliderProps, SliderProps } from './components/inputs/Slider/Slider';
|
|
106
100
|
export { Slider } from './components/inputs/Slider/Slider';
|
|
107
101
|
export type { InputVariantProps } from './components/inputs/shared/input.cva';
|
|
108
|
-
export type { TooltipWrapperTriggerVariantProps } from './components/inputs/shared/tooltipWrapper.cva';
|
|
109
102
|
export type { ControlledToggleProps, ToggleProps } from './components/inputs/Toggle/Toggle';
|
|
110
103
|
export { Toggle } from './components/inputs/Toggle/Toggle';
|
|
111
104
|
export type { MenuProps } from './components/Menu/Menu';
|
|
@@ -166,6 +159,8 @@ export type { TableRowVariantProps } from './components/table/table.cva';
|
|
|
166
159
|
export type { LinkNavigationProps, LinkProps } from './components/text/Link/Link';
|
|
167
160
|
export { Link } from './components/text/Link/Link';
|
|
168
161
|
export type { LinkVariantProps } from './components/text/Link/link.cva';
|
|
162
|
+
export type { PillProps } from './components/text/Pill/Pill';
|
|
163
|
+
export { Pill } from './components/text/Pill/Pill';
|
|
169
164
|
export type { TagProps } from './components/text/Tag/Tag';
|
|
170
165
|
export { Tag } from './components/text/Tag/Tag';
|
|
171
166
|
export type { TagVariantProps } from './components/text/Tag/tag.cva';
|
|
@@ -183,19 +178,16 @@ export { breadcrumbChevronDefinition, breadcrumbIconDefinition, breadcrumbItemDe
|
|
|
183
178
|
export { buttonContentDefinition, buttonDefinition, buttonIconSizeDefinition, buttonSizeDefinition, } from './components/buttons/Button/button.cva';
|
|
184
179
|
export { pillButtonContentDefinition, pillButtonDefinition } from './components/buttons/PillButton/pillButton.cva';
|
|
185
180
|
export { checkboxDefinition, checkboxIconDefinition } from './components/inputs/Checkbox/checkbox.cva';
|
|
186
|
-
export { datePickerInputContentRowDefinition } from './components/inputs/DateTime/shared/datePickerInput.cva';
|
|
187
181
|
export { fileCardListDefinition, fileUploadDropZoneDefinition } from './components/inputs/File/shared/fileUpload.cva';
|
|
188
182
|
export { inputUploadButtonDefinition, inputUploadDropZoneDefinition, } from './components/inputs/File/shared/inputUploadButton.cva';
|
|
189
|
-
export {
|
|
183
|
+
export { progressBarDefinition, progressBarFillDefinition, progressBarTrackDefinition, progressBarTrackWrapperDefinition, progressBarValueDefinition, } from './components/inputs/File/shared/progressBar.cva';
|
|
184
|
+
export type { ProgressBarConfig, ProgressBarTrackConfig, ProgressBarVariantProps, } from './components/inputs/File/shared/progressBar.cva';
|
|
190
185
|
export { formFieldErrorDefinition } from './components/inputs/FormField/formFieldError.cva';
|
|
191
186
|
export { formFieldHelperDefinition } from './components/inputs/FormField/formFieldHelper.cva';
|
|
192
|
-
export {
|
|
193
|
-
export {
|
|
187
|
+
export { inputBaseDefinition, inputSideDefinition, inputSizeDefinition } from './components/inputs/shared/input.cva';
|
|
188
|
+
export type { LabelBaseProps, LabelConfig } from './components/inputs/shared/label.cva';
|
|
194
189
|
export { labelDefinition } from './components/inputs/shared/label.cva';
|
|
195
|
-
export {
|
|
196
|
-
export { radioContentRowDefinition, radioContentWrapperDefinition, radioDefinition, } from './components/inputs/RadioGroup/radio.cva';
|
|
197
|
-
export { selectPopoverDefinition } from './components/inputs/Selection/shared/selectDesktop.cva';
|
|
198
|
-
export { selectInputTagsContentWrapperDefinition } from './components/inputs/Selection/shared/selectInput.cva';
|
|
190
|
+
export { radioDefinition } from './components/inputs/RadioGroup/radio.cva';
|
|
199
191
|
export { selectListBoxItemDefinition } from './components/inputs/Selection/shared/selectItem.cva';
|
|
200
192
|
export { toggleDefinition } from './components/inputs/Toggle/toggle.cva';
|
|
201
193
|
export { menuDefinition, menuItemDefinition, menuPopoverDefinition, menuPopoverWrapperDefinition, } from './components/Menu/menu.cva';
|
|
@@ -228,7 +220,6 @@ export { useForm } from './hooks/useForm';
|
|
|
228
220
|
export type { UseFormAutosaveProps } from './hooks/useFormAutosave';
|
|
229
221
|
export { useFormAutosave } from './hooks/useFormAutosave';
|
|
230
222
|
export { useIntersectionObserver } from './hooks/useIntersectionObserver';
|
|
231
|
-
export { createKeyInteractionsHandler, getKeyInteractionAction, useKeyInteractions, type KeyInteraction, type KeyInteractionAction, type KeyInteractionCallback, type KeyInteractionGroup, type KeyInteractions, type UseKeyInteractionsResult, } from './hooks/useKeyInteractions';
|
|
232
223
|
export { useLocalStorage } from './hooks/useLocalStorage';
|
|
233
224
|
export { useLongPressRepeat } from './hooks/useLongPressRepeat';
|
|
234
225
|
export { usePagination } from './hooks/usePagination';
|