@povio/ui 3.4.0-rc.14 → 3.4.0-rc.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/assets/locales/en/{translation.json.js → translation.js} +1 -0
- package/dist/assets/locales/sl/{translation.json.js → translation.js} +1 -0
- package/dist/components/Breadcrumbs/Breadcrumbs.d.ts +17 -14
- package/dist/components/Breadcrumbs/Breadcrumbs.js +206 -55
- package/dist/components/Breadcrumbs/breadcrumbs.cva.d.ts +39 -40
- package/dist/components/Breadcrumbs/breadcrumbs.cva.js +5 -5
- package/dist/components/Menu/Menu.d.ts +20 -18
- package/dist/components/Menu/Menu.js +1 -1
- package/dist/components/Menu/MenuDesktop.js +2 -2
- package/dist/components/Menu/MenuItem.d.ts +6 -3
- package/dist/components/Menu/MenuItem.js +2 -2
- package/dist/components/Menu/MenuMobile.js +2 -2
- package/dist/components/Menu/MenuPopover.d.ts +7 -5
- package/dist/components/Menu/MenuPopover.js +2 -2
- package/dist/components/Menu/menu.cva.d.ts +35 -35
- package/dist/components/Menu/menu.cva.js +4 -4
- package/dist/components/buttons/Button/Button.d.ts +25 -23
- package/dist/components/buttons/Button/Button.js +1 -1
- package/dist/components/buttons/Button/button.cva.d.ts +89 -95
- package/dist/components/buttons/Button/button.cva.js +8 -44
- package/dist/components/buttons/IconButton/IconButton.d.ts +13 -10
- package/dist/components/buttons/IconButton/IconButton.js +1 -1
- package/dist/components/buttons/InlineIconButton/InlineIconButton.d.ts +15 -12
- package/dist/components/buttons/InlineIconButton/InlineIconButton.js +34 -9
- package/dist/components/buttons/PillButton/PillButton.d.ts +14 -11
- package/dist/components/buttons/PillButton/PillButton.js +2 -2
- package/dist/components/buttons/PillButton/pillButton.cva.d.ts +33 -38
- package/dist/components/buttons/PillButton/pillButton.cva.js +5 -5
- package/dist/components/buttons/SplitButton/SplitButton.d.ts +14 -11
- package/dist/components/buttons/SplitButton/SplitButton.js +2 -2
- package/dist/components/buttons/TextButton/TextButton.d.ts +14 -11
- package/dist/components/buttons/TextButton/TextButton.js +1 -1
- package/dist/components/buttons/ToggleButton/ToggleButton.d.ts +11 -8
- package/dist/components/buttons/ToggleButton/ToggleButton.js +1 -1
- package/dist/components/buttons/shared/ButtonContent.js +80 -22
- package/dist/components/buttons/shared/buttonContent.cva.d.ts +6 -8
- package/dist/components/buttons/shared/buttonContent.cva.js +1 -1
- package/dist/components/inputs/Checkbox/Checkbox.d.ts +22 -19
- package/dist/components/inputs/Checkbox/Checkbox.js +45 -201
- package/dist/components/inputs/Checkbox/CheckboxCheckmark.js +1 -1
- package/dist/components/inputs/Checkbox/CheckboxGroup.d.ts +27 -25
- package/dist/components/inputs/Checkbox/CheckboxGroup.js +126 -355
- package/dist/components/inputs/Checkbox/checkbox.cva.d.ts +73 -89
- package/dist/components/inputs/Checkbox/checkbox.cva.js +8 -8
- package/dist/components/inputs/DateTime/DatePicker/DatePicker.d.ts +40 -37
- package/dist/components/inputs/DateTime/DatePicker/DatePicker.js +44 -35
- package/dist/components/inputs/DateTime/DateRangePicker/DateRangePicker.d.ts +46 -43
- package/dist/components/inputs/DateTime/DateRangePicker/DateRangePicker.js +172 -168
- package/dist/components/inputs/DateTime/DateTimePicker/DateTimePicker.d.ts +41 -38
- package/dist/components/inputs/DateTime/DateTimePicker/DateTimePicker.js +21 -18
- package/dist/components/inputs/DateTime/TimePicker/TimePicker.d.ts +29 -26
- package/dist/components/inputs/DateTime/TimePicker/TimePicker.js +166 -541
- package/dist/components/inputs/DateTime/shared/Calendar.js +17 -14
- package/dist/components/inputs/DateTime/shared/CalendarCell.js +17 -17
- package/dist/components/inputs/DateTime/shared/CalendarGrid.js +5 -4
- package/dist/components/inputs/DateTime/shared/CalendarHeader.js +8 -7
- package/dist/components/inputs/DateTime/shared/CalendarSelectHeader.js +43 -43
- package/dist/components/inputs/DateTime/shared/DateField.js +19 -20
- package/dist/components/inputs/DateTime/shared/DatePickerInput.d.ts +11 -45
- package/dist/components/inputs/DateTime/shared/DatePickerInput.js +1 -1
- package/dist/components/inputs/DateTime/shared/DateSegmentItem.js +26 -102
- package/dist/components/inputs/DateTime/shared/DateTimeDialog.js +28 -83
- package/dist/components/inputs/DateTime/shared/DateTimeDialogFooter.js +2 -2
- 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 +111 -281
- package/dist/components/inputs/DateTime/shared/TimePickerInput.js +71 -214
- package/dist/components/inputs/DateTime/shared/YearPicker.js +68 -119
- package/dist/components/inputs/DateTime/shared/datePicker.types.d.ts +8 -5
- package/dist/components/inputs/DateTime/shared/datePickerInput.cva.d.ts +16 -15
- package/dist/components/inputs/DateTime/shared/datePickerInput.cva.js +1 -1
- package/dist/components/inputs/DateTime/shared/datePickerTodayIcon.js +11 -50
- package/dist/components/inputs/DateTime/shared/datePickerValue.utils.js +4 -0
- package/dist/components/inputs/DateTime/shared/staticDateTimeSegments.js +12 -11
- package/dist/components/inputs/DateTime/shared/useFirefoxDateSegmentSelectionGuard.js +12 -26
- package/dist/components/inputs/File/FileUpload.d.ts +7 -4
- package/dist/components/inputs/File/FileUpload.js +49 -88
- package/dist/components/inputs/File/FileUploadContainer.d.ts +5 -3
- package/dist/components/inputs/File/FileUploadContainer.js +10 -17
- package/dist/components/inputs/File/InputUpload.d.ts +7 -4
- package/dist/components/inputs/File/InputUpload.js +26 -65
- package/dist/components/inputs/File/fileUpload.types.d.ts +87 -84
- package/dist/components/inputs/File/inputUpload.types.d.ts +34 -32
- package/dist/components/inputs/File/inputUpload.types.js +1 -1
- package/dist/components/inputs/File/shared/FileCard.js +47 -110
- package/dist/components/inputs/File/shared/FileCardList.js +16 -54
- package/dist/components/inputs/File/shared/FileUploadContent.js +47 -188
- package/dist/components/inputs/File/shared/FileUploadContentEmpty.js +1 -1
- package/dist/components/inputs/File/shared/FileUploadContentError.js +3 -3
- package/dist/components/inputs/File/shared/FileUploadContentFilled.js +3 -3
- package/dist/components/inputs/File/shared/FileUploadContentLoading.js +1 -1
- package/dist/components/inputs/File/shared/InputUploadContent.js +36 -149
- package/dist/components/inputs/File/shared/InputUploadFilled.js +8 -48
- package/dist/components/inputs/File/shared/ProgressBar.d.ts +6 -4
- package/dist/components/inputs/File/shared/ProgressBar.js +1 -1
- package/dist/components/inputs/File/shared/fileUpload.cva.d.ts +17 -16
- package/dist/components/inputs/File/shared/fileUpload.cva.js +1 -1
- package/dist/components/inputs/File/shared/inputUploadButton.cva.d.ts +24 -25
- package/dist/components/inputs/File/shared/inputUploadButton.cva.js +5 -5
- package/dist/components/inputs/File/shared/progressBar.cva.d.ts +34 -33
- package/dist/components/inputs/File/shared/progressBar.cva.js +5 -5
- package/dist/components/inputs/FormField/FormField.d.ts +21 -17
- package/dist/components/inputs/FormField/FormField.js +39 -119
- package/dist/components/inputs/FormField/FormFieldError.d.ts +9 -6
- package/dist/components/inputs/FormField/FormFieldError.js +6 -24
- package/dist/components/inputs/FormField/FormFieldHeader.d.ts +15 -13
- package/dist/components/inputs/FormField/FormFieldHeader.js +22 -78
- package/dist/components/inputs/FormField/FormFieldHeaderClose.js +7 -31
- package/dist/components/inputs/FormField/FormFieldHelper.js +7 -25
- package/dist/components/inputs/FormField/FormFieldLabel.js +9 -40
- package/dist/components/inputs/FormField/formFieldError.cva.d.ts +13 -12
- package/dist/components/inputs/FormField/formFieldError.cva.js +1 -1
- package/dist/components/inputs/FormField/formFieldHeader.cva.d.ts +13 -12
- package/dist/components/inputs/FormField/formFieldHeader.cva.js +1 -1
- package/dist/components/inputs/FormField/formFieldHelper.cva.d.ts +13 -12
- package/dist/components/inputs/FormField/formFieldHelper.cva.js +1 -1
- package/dist/components/inputs/Input/NumberInput/NumberInput.d.ts +25 -21
- package/dist/components/inputs/Input/NumberInput/NumberInput.js +145 -394
- package/dist/components/inputs/Input/NumberRangeInput/NumberRangeField.d.ts +11 -45
- package/dist/components/inputs/Input/NumberRangeInput/NumberRangeField.js +120 -553
- package/dist/components/inputs/Input/NumberRangeInput/NumberRangeInput.d.ts +37 -34
- package/dist/components/inputs/Input/NumberRangeInput/NumberRangeInput.js +93 -164
- package/dist/components/inputs/Input/PasswordInput/PasswordInput.d.ts +10 -7
- package/dist/components/inputs/Input/PasswordInput/PasswordInput.js +12 -50
- package/dist/components/inputs/Input/TextArea/TextArea.cva.d.ts +8 -7
- package/dist/components/inputs/Input/TextArea/TextArea.cva.js +1 -1
- package/dist/components/inputs/Input/TextArea/TextArea.d.ts +20 -18
- package/dist/components/inputs/Input/TextArea/TextArea.js +96 -304
- package/dist/components/inputs/Input/TextInput/TextInput.d.ts +24 -20
- package/dist/components/inputs/Input/TextInput/TextInput.js +151 -380
- package/dist/components/inputs/Input/shared/InputContent.d.ts +25 -27
- package/dist/components/inputs/Input/shared/InputContent.js +59 -193
- package/dist/components/inputs/Input/shared/numberStatic.utils.js +1 -1
- package/dist/components/inputs/Inputs/Form.d.ts +19 -19
- package/dist/components/inputs/Inputs/Form.js +23 -51
- package/dist/components/inputs/Inputs/InputItem.d.ts +77 -58
- package/dist/components/inputs/Inputs/InputItem.js +16 -65
- package/dist/components/inputs/Inputs/Inputs.d.ts +12 -9
- package/dist/components/inputs/Inputs/Inputs.js +11 -37
- package/dist/components/inputs/RadioGroup/RadioGroup.d.ts +23 -21
- package/dist/components/inputs/RadioGroup/RadioGroup.js +114 -320
- package/dist/components/inputs/RadioGroup/radio.cva.d.ts +49 -59
- package/dist/components/inputs/RadioGroup/radio.cva.js +6 -6
- package/dist/components/inputs/Selection/Autocomplete/Autocomplete.d.ts +15 -11
- package/dist/components/inputs/Selection/Autocomplete/Autocomplete.js +25 -55
- package/dist/components/inputs/Selection/Autocomplete/QueryAutocomplete.d.ts +8 -4
- package/dist/components/inputs/Selection/Autocomplete/QueryAutocomplete.js +46 -117
- package/dist/components/inputs/Selection/Autocomplete/queryAutocomplete.types.d.ts +25 -38
- package/dist/components/inputs/Selection/Select/QuerySelect.d.ts +18 -14
- package/dist/components/inputs/Selection/Select/QuerySelect.js +58 -115
- package/dist/components/inputs/Selection/Select/Select.d.ts +15 -11
- package/dist/components/inputs/Selection/Select/Select.js +35 -111
- package/dist/components/inputs/Selection/shared/SelectBase.d.ts +39 -37
- package/dist/components/inputs/Selection/shared/SelectBase.js +26 -70
- package/dist/components/inputs/Selection/shared/SelectDesktop.js +144 -392
- package/dist/components/inputs/Selection/shared/SelectInput.js +161 -428
- package/dist/components/inputs/Selection/shared/SelectInputTags.js +26 -100
- package/dist/components/inputs/Selection/shared/SelectListBox.js +1 -1
- 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 +23 -71
- package/dist/components/inputs/Selection/shared/SelectListBoxSelectionBar.js +9 -58
- package/dist/components/inputs/Selection/shared/SelectMobile.js +1 -1
- package/dist/components/inputs/Selection/shared/StaticSelectTrailingContent.js +14 -39
- package/dist/components/inputs/Selection/shared/querySelect.utils.d.ts +8 -15
- package/dist/components/inputs/Selection/shared/querySelect.utils.js +6 -6
- package/dist/components/inputs/Selection/shared/select.context.js +52 -52
- package/dist/components/inputs/Selection/shared/select.types.d.ts +60 -62
- package/dist/components/inputs/Selection/shared/selectDesktop.cva.d.ts +8 -5
- package/dist/components/inputs/Selection/shared/selectDesktop.cva.js +1 -1
- package/dist/components/inputs/Selection/shared/selectInput.cva.d.ts +12 -11
- package/dist/components/inputs/Selection/shared/selectInput.cva.js +1 -1
- package/dist/components/inputs/Selection/shared/selectItem.cva.d.ts +16 -15
- package/dist/components/inputs/Selection/shared/selectItem.cva.js +1 -1
- package/dist/components/inputs/Selection/shared/staticSelect.utils.js +3 -3
- package/dist/components/inputs/Selection/shared/useSelectItems.js +12 -12
- package/dist/components/inputs/Skeleton/InputFrame.js +27 -27
- package/dist/components/inputs/Slider/Slider.d.ts +20 -17
- package/dist/components/inputs/Slider/Slider.js +86 -268
- package/dist/components/inputs/TextEditor/TextEditor.d.ts +24 -20
- package/dist/components/inputs/TextEditor/TextEditor.js +21 -62
- 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/TextEditor/textEditor.types.js +1 -1
- package/dist/components/inputs/Toggle/Toggle.d.ts +18 -15
- package/dist/components/inputs/Toggle/Toggle.js +50 -210
- package/dist/components/inputs/Toggle/toggle.cva.d.ts +15 -18
- package/dist/components/inputs/Toggle/toggle.cva.js +3 -3
- package/dist/components/inputs/shared/CheckContent.js +11 -21
- package/dist/components/inputs/shared/InputClear.js +30 -102
- package/dist/components/inputs/shared/TooltipWrapper.js +13 -48
- package/dist/components/inputs/shared/form.binding.d.ts +7 -27
- package/dist/components/inputs/shared/form.binding.js +8 -37
- package/dist/components/inputs/shared/form.types.d.ts +11 -11
- package/dist/components/inputs/shared/form.types.js +1 -1
- package/dist/components/inputs/shared/input.cva.d.ts +76 -85
- package/dist/components/inputs/shared/input.cva.js +9 -19
- package/dist/components/inputs/shared/label.cva.d.ts +18 -18
- package/dist/components/inputs/shared/label.cva.js +2 -2
- package/dist/components/inputs/shared/tooltipWrapper.cva.d.ts +10 -7
- package/dist/components/inputs/shared/tooltipWrapper.cva.js +1 -1
- package/dist/components/inputs/shared/useFieldAccessibility.js +19 -0
- package/dist/components/inputs/shared/useStaticInputHandoff.js +50 -105
- package/dist/components/navigation/Accordion/Accordion.d.ts +5 -3
- package/dist/components/navigation/Accordion/Accordion.js +69 -22
- package/dist/components/navigation/Accordion/AccordionItem.js +86 -41
- package/dist/components/navigation/Accordion/accordion.cva.d.ts +76 -100
- package/dist/components/navigation/Accordion/accordion.cva.js +10 -10
- package/dist/components/navigation/Accordion/accordion.types.d.ts +52 -49
- package/dist/components/navigation/Stepper/Stepper.d.ts +5 -2
- package/dist/components/navigation/Stepper/Stepper.js +67 -22
- package/dist/components/navigation/Stepper/StepperItem.js +2 -2
- package/dist/components/navigation/Stepper/StepperSeparator.js +1 -1
- package/dist/components/navigation/Stepper/stepper.cva.d.ts +73 -86
- package/dist/components/navigation/Stepper/stepper.cva.js +7 -7
- package/dist/components/navigation/Stepper/stepper.types.d.ts +29 -37
- package/dist/components/outline.clsx.d.ts +4 -2
- package/dist/components/outline.clsx.js +2 -2
- package/dist/components/overlays/ActionModal/ActionModal.d.ts +23 -21
- package/dist/components/overlays/ActionModal/ActionModal.js +170 -36
- package/dist/components/overlays/BottomSheet/BottomSheet.d.ts +30 -28
- package/dist/components/overlays/BottomSheet/BottomSheet.js +13 -10
- package/dist/components/overlays/BottomSheet/BottomSheetHeader.js +2 -2
- package/dist/components/overlays/Drawer/Drawer.d.ts +17 -14
- package/dist/components/overlays/Drawer/Drawer.js +3 -3
- package/dist/components/overlays/Modal/Modal.d.ts +18 -14
- package/dist/components/overlays/Modal/Modal.js +3 -1
- package/dist/components/overlays/Modal/modal.cva.d.ts +34 -34
- package/dist/components/overlays/Modal/modal.cva.js +4 -4
- package/dist/components/overlays/ResponsivePopover/ResponsivePopover.d.ts +16 -14
- package/dist/components/overlays/ResponsivePopover/ResponsivePopover.js +110 -29
- package/dist/components/overlays/Tooltip/Tooltip.d.ts +15 -12
- package/dist/components/overlays/Tooltip/Tooltip.js +3 -3
- package/dist/components/overlays/Tooltip/TooltipEllipsis.d.ts +10 -7
- package/dist/components/overlays/Tooltip/TooltipEllipsis.js +2 -2
- package/dist/components/overlays/Tooltip/tooltip.cva.d.ts +39 -45
- package/dist/components/overlays/Tooltip/tooltip.cva.js +4 -4
- package/dist/components/segment/Segment.d.ts +7 -4
- package/dist/components/segment/Segment.js +3 -3
- package/dist/components/segment/SegmentItem.js +2 -2
- package/dist/components/segment/segment.cva.d.ts +20 -18
- package/dist/components/segment/segment.cva.js +2 -2
- package/dist/components/segment/segment.types.d.ts +33 -30
- package/dist/components/shared/pagination/Pagination.d.ts +11 -8
- package/dist/components/shared/pagination/Pagination.js +108 -22
- package/dist/components/shared/pagination/PaginationList.d.ts +17 -14
- package/dist/components/shared/pagination/PaginationList.js +2 -2
- package/dist/components/shared/pagination/minWidth.cva.js +1 -1
- package/dist/components/shared/popover.cva.d.ts +8 -7
- package/dist/components/shared/popover.cva.js +1 -1
- package/dist/components/status/Alert/Alert.d.ts +13 -10
- package/dist/components/status/Alert/Alert.js +97 -30
- package/dist/components/status/Alert/alert.cva.d.ts +21 -18
- package/dist/components/status/Alert/alert.cva.js +1 -1
- package/dist/components/status/Loader/Loader.d.ts +7 -5
- package/dist/components/status/Loader/Loader.js +1 -1
- package/dist/components/status/Loader/loader.cva.d.ts +23 -26
- package/dist/components/status/Loader/loader.cva.js +4 -4
- package/dist/components/status/Toast/Toast.d.ts +15 -12
- package/dist/components/status/Toast/Toast.js +2 -2
- package/dist/components/status/Toast/toast.cva.d.ts +58 -77
- package/dist/components/status/Toast/toast.cva.js +6 -6
- package/dist/components/status/Toast/useToast.d.ts +14 -11
- package/dist/components/status/Toast/useToast.js +1 -1
- package/dist/components/status/shared/status.cva.d.ts +32 -28
- package/dist/components/status/shared/status.cva.js +2 -2
- package/dist/components/table/CellText.d.ts +10 -7
- package/dist/components/table/CellText.js +3 -2
- package/dist/components/table/ColumnConfig.d.ts +12 -9
- package/dist/components/table/ColumnConfig.js +6 -5
- package/dist/components/table/HeaderText.d.ts +10 -7
- package/dist/components/table/HeaderText.js +3 -2
- package/dist/components/table/InfiniteTable.d.ts +10 -8
- package/dist/components/table/InfiniteTable.js +67 -16
- package/dist/components/table/PaginatedTable.d.ts +12 -10
- package/dist/components/table/PaginatedTable.js +1 -1
- package/dist/components/table/Table.d.ts +34 -35
- package/dist/components/table/Table.js +18 -16
- package/dist/components/table/table.cva.d.ts +40 -59
- package/dist/components/table/table.cva.js +7 -7
- package/dist/components/text/Link/Link.d.ts +10 -8
- package/dist/components/text/Link/Link.js +2 -2
- package/dist/components/text/Link/link.cva.d.ts +14 -11
- package/dist/components/text/Link/link.cva.js +1 -1
- package/dist/components/text/Pill/Pill.d.ts +17 -14
- package/dist/components/text/Pill/Pill.js +1 -1
- package/dist/components/text/Tag/Tag.d.ts +17 -14
- package/dist/components/text/Tag/Tag.js +1 -1
- package/dist/components/text/Tag/tag.cva.d.ts +18 -15
- package/dist/components/text/Tag/tag.cva.js +1 -1
- package/dist/components/text/Typography/Typography.d.ts +10 -9
- package/dist/components/text/Typography/Typography.js +23 -8
- package/dist/components/text/Typography/typography.cva.d.ts +51 -48
- package/dist/components/text/Typography/typography.cva.js +1 -1
- package/dist/config/confirmation.context.d.ts +22 -19
- package/dist/config/confirmation.context.js +2 -2
- package/dist/config/i18n.d.ts +311 -308
- package/dist/config/i18n.js +4 -4
- package/dist/config/link.context.d.ts +9 -7
- package/dist/config/link.context.js +2 -2
- package/dist/config/router.context.d.ts +11 -9
- package/dist/config/router.context.js +2 -2
- package/dist/config/theme.context.d.ts +19 -16
- package/dist/config/theme.context.js +99 -46
- package/dist/config/uiConfig.context.d.ts +80 -75
- package/dist/config/uiConfig.context.js +46 -9
- package/dist/config/uiOverrides.context.d.ts +205 -204
- package/dist/config/uiOverrides.context.js +2 -2
- package/dist/helpers/dynamicColumns.d.ts +27 -28
- package/dist/helpers/dynamicColumns.js +32 -31
- package/dist/helpers/dynamicInputs.d.ts +66 -74
- package/dist/helpers/dynamicInputs.js +21 -20
- package/dist/hooks/useAutosave.d.ts +12 -9
- package/dist/hooks/useAutosave.js +1 -1
- package/dist/hooks/useBreakpoint.d.ts +4 -2
- package/dist/hooks/useBreakpoint.js +37 -10
- package/dist/hooks/useDebounceCallback.d.ts +7 -4
- package/dist/hooks/useDebounceCallback.js +51 -17
- package/dist/hooks/useDeepCompare.d.ts +7 -4
- package/dist/hooks/useDeepCompare.js +4 -4
- package/dist/hooks/useFilters.d.ts +10 -7
- package/dist/hooks/useFilters.js +8 -6
- package/dist/hooks/useForm.d.ts +35 -35
- package/dist/hooks/useForm.js +6 -6
- package/dist/hooks/useFormAutosave.d.ts +16 -13
- package/dist/hooks/useFormAutosave.js +18 -17
- package/dist/hooks/useIntersectionObserver.d.ts +7 -5
- package/dist/hooks/useIntersectionObserver.js +2 -2
- package/dist/hooks/useKeyInteractions.d.ts +19 -16
- package/dist/hooks/useKeyInteractions.js +5 -5
- package/dist/hooks/useLocalStorage.d.ts +10 -8
- package/dist/hooks/useLocalStorage.js +3 -3
- package/dist/hooks/useLongPressRepeat.d.ts +10 -7
- package/dist/hooks/useLongPressRepeat.js +55 -20
- package/dist/hooks/usePagination.d.ts +9 -6
- package/dist/hooks/usePagination.js +2 -2
- package/dist/hooks/useQueryAutocomplete.js +2 -2
- package/dist/hooks/useScrollableListBox.d.ts +5 -2
- package/dist/hooks/useScrollableListBox.js +1 -1
- package/dist/hooks/useSorting.d.ts +8 -5
- package/dist/hooks/useSorting.js +1 -1
- package/dist/hooks/useStateAndRef.d.ts +5 -3
- package/dist/hooks/useStateAndRef.js +2 -2
- package/dist/hooks/useTableColumnConfig.d.ts +15 -13
- package/dist/hooks/useTableColumnConfig.js +1 -1
- package/dist/hooks/useTableNav.d.ts +79 -77
- package/dist/hooks/useTableNav.js +19 -37
- package/dist/hooks/useTranslationMemo.d.ts +5 -3
- package/dist/index.d.ts +145 -1
- package/dist/index.js +3 -3
- package/dist/rhf/Inputs.d.ts +55 -54
- package/dist/rhf/Inputs.js +62 -17
- package/dist/rhf/components.d.ts +77 -75
- package/dist/rhf/components.js +27 -27
- package/dist/rhf/dynamicInputs.d.ts +16 -14
- package/dist/rhf/dynamicInputs.js +1 -1
- package/dist/rhf/fieldAdapter.d.ts +8 -6
- package/dist/rhf/form.types.d.ts +11 -10
- package/dist/rhf/useAutosave.d.ts +12 -9
- package/dist/rhf/useForm.d.ts +13 -13
- package/dist/rhf/useFormAutosave.d.ts +17 -14
- package/dist/rhf/useFormAutosave.js +121 -34
- package/dist/rhf.d.ts +146 -225
- package/dist/rhf.js +120 -0
- package/dist/tanstack.d.ts +151 -224
- package/dist/tanstack.js +3 -3
- package/dist/text-editor.d.ts +2 -2
- package/dist/tw-ui-plugin.d.ts +4 -2
- package/dist/tw-ui-plugin.js +1 -1
- package/dist/types/common.d.ts +11 -12
- package/dist/types/error-handling.d.ts +8 -5
- package/dist/utils/array.utils.d.ts +5 -2
- package/dist/utils/array.utils.js +1 -1
- package/dist/utils/compoundMapper.d.ts +12 -14
- package/dist/utils/compoundMapper.js +1 -1
- package/dist/utils/date-time.utils.d.ts +44 -41
- package/dist/utils/date-time.utils.js +7 -9
- package/dist/utils/date.utils.d.ts +6 -4
- package/dist/utils/date.utils.js +29 -6
- package/dist/utils/dom.utils.d.ts +7 -4
- package/dist/utils/dom.utils.js +2 -2
- package/dist/utils/file.utils.d.ts +20 -12
- package/dist/utils/file.utils.js +19 -8
- package/dist/utils/intl.utils.d.ts +7 -5
- package/dist/utils/intl.utils.js +2 -2
- package/dist/utils/isEqual.d.ts +4 -1
- package/dist/utils/isEqual.js +3 -3
- package/dist/utils/logger.d.ts +9 -6
- package/dist/utils/logger.js +1 -1
- package/dist/utils/object.utils.d.ts +12 -9
- package/dist/utils/object.utils.js +1 -1
- package/dist/utils/queries.utils.d.ts +6 -3
- package/dist/utils/queries.utils.js +1 -1
- package/dist/utils/query.utils.js +1 -1
- package/dist/utils/routing.utils.d.ts +6 -3
- package/dist/utils/routing.utils.js +1 -1
- package/dist/utils/string.utils.d.ts +6 -3
- package/dist/utils/string.utils.js +1 -1
- package/dist/utils/style-merge.util.d.ts +38 -41
- package/dist/utils/style-merge.util.js +7 -4
- package/dist/utils/zod.utils.d.ts +22 -19
- package/dist/utils/zod.utils.js +1 -1
- package/package.json +30 -8
- package/dist/assets/locales/en/translation.json.d.ts +0 -158
- package/dist/assets/locales/sl/translation.json.d.ts +0 -154
- package/dist/components/Menu/MenuDesktop.d.ts +0 -2
- package/dist/components/Menu/MenuMobile.d.ts +0 -2
- package/dist/components/buttons/shared/ButtonContent.d.ts +0 -14
- package/dist/components/inputs/Checkbox/CheckboxCheckmark.d.ts +0 -9
- package/dist/components/inputs/DateTime/shared/Calendar.d.ts +0 -29
- package/dist/components/inputs/DateTime/shared/CalendarCell.d.ts +0 -22
- package/dist/components/inputs/DateTime/shared/CalendarGrid.d.ts +0 -27
- package/dist/components/inputs/DateTime/shared/CalendarHeader.d.ts +0 -18
- package/dist/components/inputs/DateTime/shared/CalendarSelectHeader.d.ts +0 -17
- package/dist/components/inputs/DateTime/shared/DateField.d.ts +0 -21
- package/dist/components/inputs/DateTime/shared/DateSegmentItem.d.ts +0 -28
- package/dist/components/inputs/DateTime/shared/DateTimeDialog.d.ts +0 -18
- package/dist/components/inputs/DateTime/shared/DateTimeDialogFooter.d.ts +0 -8
- package/dist/components/inputs/DateTime/shared/MonthPicker.d.ts +0 -11
- package/dist/components/inputs/DateTime/shared/RangeCalendar.d.ts +0 -26
- package/dist/components/inputs/DateTime/shared/TimeField.d.ts +0 -12
- package/dist/components/inputs/DateTime/shared/TimePickerForm.d.ts +0 -10
- package/dist/components/inputs/DateTime/shared/TimePickerInput.d.ts +0 -25
- package/dist/components/inputs/DateTime/shared/YearPicker.d.ts +0 -12
- package/dist/components/inputs/DateTime/shared/datePickerTodayIcon.d.ts +0 -15
- 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 -41
- package/dist/components/inputs/DateTime/shared/staticDateTimeSegments.spec.d.ts +0 -1
- package/dist/components/inputs/DateTime/shared/useFirefoxDateSegmentSelectionGuard.d.ts +0 -2
- package/dist/components/inputs/File/index.d.ts +0 -9
- package/dist/components/inputs/File/shared/FileCard.d.ts +0 -9
- package/dist/components/inputs/File/shared/FileCardList.d.ts +0 -9
- package/dist/components/inputs/File/shared/FileUploadContent.d.ts +0 -10
- package/dist/components/inputs/File/shared/FileUploadContentEmpty.d.ts +0 -9
- package/dist/components/inputs/File/shared/FileUploadContentError.d.ts +0 -11
- package/dist/components/inputs/File/shared/FileUploadContentFilled.d.ts +0 -11
- package/dist/components/inputs/File/shared/FileUploadContentLoading.d.ts +0 -9
- package/dist/components/inputs/File/shared/InputUploadContent.d.ts +0 -9
- package/dist/components/inputs/File/shared/InputUploadFilled.d.ts +0 -8
- package/dist/components/inputs/FormField/FormFieldHeaderClose.d.ts +0 -5
- package/dist/components/inputs/FormField/FormFieldHelper.d.ts +0 -8
- package/dist/components/inputs/FormField/FormFieldLabel.d.ts +0 -13
- package/dist/components/inputs/Input/shared/numberStatic.utils.d.ts +0 -1
- package/dist/components/inputs/Selection/shared/SelectDesktop.d.ts +0 -5
- package/dist/components/inputs/Selection/shared/SelectInput.d.ts +0 -15
- package/dist/components/inputs/Selection/shared/SelectInputTags.d.ts +0 -12
- package/dist/components/inputs/Selection/shared/SelectListBox.d.ts +0 -9
- package/dist/components/inputs/Selection/shared/SelectListBoxItem.d.ts +0 -7
- package/dist/components/inputs/Selection/shared/SelectListBoxItemSelectAll.d.ts +0 -4
- package/dist/components/inputs/Selection/shared/SelectListBoxLoadingItem.d.ts +0 -6
- package/dist/components/inputs/Selection/shared/SelectListBoxSelectionBar.d.ts +0 -5
- package/dist/components/inputs/Selection/shared/SelectMobile.d.ts +0 -5
- package/dist/components/inputs/Selection/shared/StaticSelectTrailingContent.d.ts +0 -9
- package/dist/components/inputs/Selection/shared/select.context.d.ts +0 -32
- package/dist/components/inputs/Selection/shared/staticSelect.utils.d.ts +0 -23
- package/dist/components/inputs/Selection/shared/staticSelect.utils.spec.d.ts +0 -1
- package/dist/components/inputs/Selection/shared/useSelectItems.d.ts +0 -23
- package/dist/components/inputs/Skeleton/InputFrame.d.ts +0 -84
- package/dist/components/inputs/TextEditor/Toolbar/ColorPicker.d.ts +0 -7
- package/dist/components/inputs/TextEditor/Toolbar/ColorPickerDropdown.d.ts +0 -10
- package/dist/components/inputs/TextEditor/Toolbar/HyperlinkAction.d.ts +0 -2
- package/dist/components/inputs/TextEditor/Toolbar/TextAlignSelect.d.ts +0 -2
- package/dist/components/inputs/TextEditor/Toolbar/TextColorSelect.d.ts +0 -2
- package/dist/components/inputs/TextEditor/Toolbar/TextEditorToolbar.d.ts +0 -6
- package/dist/components/inputs/TextEditor/Toolbar/TextHighlightSelect.d.ts +0 -2
- package/dist/components/inputs/TextEditor/Toolbar/TextListActions.d.ts +0 -2
- package/dist/components/inputs/TextEditor/Toolbar/TextMarksActions.d.ts +0 -2
- package/dist/components/inputs/TextEditor/Toolbar/TextStyleSelect.d.ts +0 -2
- package/dist/components/inputs/TextEditor/textEditor.types.d.ts +0 -5
- package/dist/components/inputs/shared/CheckContent.d.ts +0 -9
- package/dist/components/inputs/shared/InputClear.d.ts +0 -10
- package/dist/components/inputs/shared/TooltipWrapper.d.ts +0 -10
- package/dist/components/inputs/shared/useStaticInputHandoff.d.ts +0 -15
- package/dist/components/navigation/Accordion/AccordionItem.d.ts +0 -2
- package/dist/components/navigation/Stepper/StepperItem.d.ts +0 -2
- package/dist/components/navigation/Stepper/StepperSeparator.d.ts +0 -5
- package/dist/components/overlays/BottomSheet/BottomSheetHeader.d.ts +0 -13
- package/dist/components/segment/SegmentItem.d.ts +0 -2
- package/dist/components/shared/pagination/minWidth.cva.d.ts +0 -3
- package/dist/hooks/useFormAutosave.spec.d.ts +0 -1
- package/dist/hooks/useKeyInteractions.spec.d.ts +0 -1
- package/dist/hooks/useQueryAutocomplete.d.ts +0 -13
- package/dist/rhf/entrypoints.type-test.d.ts +0 -1
- package/dist/types/react-query.d.ts +0 -6
- package/dist/utils/array.utils.spec.d.ts +0 -1
- package/dist/utils/compoundMapper.spec.d.ts +0 -1
- package/dist/utils/date-time.utils.spec.d.ts +0 -1
- package/dist/utils/date.utils.spec.d.ts +0 -1
- package/dist/utils/intl.utils.spec.d.ts +0 -1
- package/dist/utils/query.utils.d.ts +0 -4
- package/dist/utils/rest.utils.d.ts +0 -10
- package/dist/utils/rest.utils.js +0 -33
- package/dist/utils/style-merge.util.spec.d.ts +0 -1
|
@@ -1,29 +1,64 @@
|
|
|
1
|
+
import { c } from "react/compiler-runtime";
|
|
1
2
|
import { useEffect, useRef } from "react";
|
|
2
3
|
//#region src/hooks/useLongPressRepeat.ts
|
|
3
|
-
|
|
4
|
+
const useLongPressRepeat = (t0) => {
|
|
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;
|
|
4
10
|
const intervalRef = useRef(void 0);
|
|
5
|
-
|
|
6
|
-
|
|
11
|
+
let t4;
|
|
12
|
+
let t5;
|
|
13
|
+
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
14
|
+
t4 = () => () => {
|
|
7
15
|
clearInterval(intervalRef.current);
|
|
8
16
|
};
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
17
|
+
t5 = [];
|
|
18
|
+
$[0] = t4;
|
|
19
|
+
$[1] = t5;
|
|
20
|
+
} else {
|
|
21
|
+
t4 = $[0];
|
|
22
|
+
t5 = $[1];
|
|
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(() => {
|
|
16
31
|
onPress(true);
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
32
|
+
intervalRef.current = setInterval(() => {
|
|
33
|
+
onPress(true);
|
|
34
|
+
}, interval);
|
|
35
|
+
}, timeout);
|
|
36
|
+
};
|
|
37
|
+
$[2] = enabled;
|
|
38
|
+
$[3] = interval;
|
|
39
|
+
$[4] = onPress;
|
|
40
|
+
$[5] = timeout;
|
|
41
|
+
$[6] = t6;
|
|
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;
|
|
27
62
|
};
|
|
28
63
|
//#endregion
|
|
29
64
|
export { useLongPressRepeat };
|
|
@@ -1,7 +1,10 @@
|
|
|
1
|
-
import { PaginationState } from
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import { PaginationState } from "@tanstack/react-table";
|
|
2
|
+
//#region src/hooks/usePagination.d.ts
|
|
3
|
+
declare function usePagination(defaultPagination?: PaginationState): {
|
|
4
|
+
pagination: PaginationState;
|
|
5
|
+
setPagination: import("react").Dispatch<import("react").SetStateAction<PaginationState>>;
|
|
6
|
+
pageIndex: number;
|
|
7
|
+
pageSize: number;
|
|
7
8
|
};
|
|
9
|
+
//#endregion
|
|
10
|
+
export { usePagination };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { UIRouter } from "../config/router.context.js";
|
|
2
2
|
import { RoutingUtils } from "../utils/routing.utils.js";
|
|
3
|
-
import { useEffect, useState } from "react";
|
|
4
3
|
import { c } from "react/compiler-runtime";
|
|
4
|
+
import { useEffect, useState } from "react";
|
|
5
5
|
//#region src/hooks/usePagination.ts
|
|
6
|
-
|
|
6
|
+
const DEFAULT_STATE = {
|
|
7
7
|
pageIndex: 1,
|
|
8
8
|
pageSize: 20
|
|
9
9
|
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { ApiQueryUtils } from "../utils/query.utils.js";
|
|
2
2
|
import { useCallback, useEffect, useMemo, useState } from "react";
|
|
3
3
|
//#region src/hooks/useQueryAutocomplete.ts
|
|
4
|
-
|
|
4
|
+
const isFilterSearchParams = (params) => {
|
|
5
5
|
return typeof params === "object" && params !== null && "filter" in params;
|
|
6
6
|
};
|
|
7
|
-
|
|
7
|
+
const useQueryAutocomplete = ({ query, queryParams, queryOptions, mapItems, resolveSelectedItemsWithIds = false, initialQueryState, search, selectedIdsToResolve = [] }) => {
|
|
8
8
|
"use no memo";
|
|
9
9
|
const shouldResolveSelectedItems = selectedIdsToResolve.length > 0;
|
|
10
10
|
const shouldUseSelectedItemsQuery = resolveSelectedItemsWithIds && shouldResolveSelectedItems;
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
//#region src/hooks/useScrollableListBox.d.ts
|
|
2
|
+
declare function useScrollableListBox(): {
|
|
3
|
+
ref: import("react").RefObject<HTMLDivElement | null>;
|
|
3
4
|
};
|
|
5
|
+
//#endregion
|
|
6
|
+
export { useScrollableListBox };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useBreakpoint } from "./useBreakpoint.js";
|
|
2
|
-
import { useEffect, useRef } from "react";
|
|
3
2
|
import { c } from "react/compiler-runtime";
|
|
3
|
+
import { useEffect, useRef } from "react";
|
|
4
4
|
//#region src/hooks/useScrollableListBox.ts
|
|
5
5
|
function useScrollableListBox() {
|
|
6
6
|
const $ = c(4);
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
import { SortingState } from
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { SortingState } from "@tanstack/react-table";
|
|
2
|
+
//#region src/hooks/useSorting.d.ts
|
|
3
|
+
declare function useSorting(defaultSorting?: SortingState, prefix?: string): {
|
|
4
|
+
sorting: SortingState;
|
|
5
|
+
setSorting: import("react").Dispatch<import("react").SetStateAction<SortingState>>;
|
|
6
|
+
order: string;
|
|
6
7
|
};
|
|
8
|
+
//#endregion
|
|
9
|
+
export { useSorting };
|
package/dist/hooks/useSorting.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { UIRouter } from "../config/router.context.js";
|
|
2
2
|
import { RoutingUtils } from "../utils/routing.utils.js";
|
|
3
|
-
import { useEffect, useState } from "react";
|
|
4
3
|
import { c } from "react/compiler-runtime";
|
|
4
|
+
import { useEffect, useState } from "react";
|
|
5
5
|
//#region src/hooks/useSorting.ts
|
|
6
6
|
function useSorting(defaultSorting, t0) {
|
|
7
7
|
const $ = c(16);
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import { RefObject, SetStateAction } from
|
|
1
|
+
import { RefObject, SetStateAction } from "react";
|
|
2
|
+
//#region src/hooks/useStateAndRef.d.ts
|
|
2
3
|
type StateRefReturn<T> = [T, RefObject<T>, (value: SetStateAction<T>) => void];
|
|
3
|
-
|
|
4
|
-
|
|
4
|
+
declare const useStateAndRef: <T>(initialState: T | (() => T)) => StateRefReturn<T>;
|
|
5
|
+
//#endregion
|
|
6
|
+
export { useStateAndRef };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { ObjectUtils } from "../utils/object.utils.js";
|
|
2
|
-
import { useRef, useState } from "react";
|
|
3
2
|
import { c } from "react/compiler-runtime";
|
|
3
|
+
import { useRef, useState } from "react";
|
|
4
4
|
//#region src/hooks/useStateAndRef.ts
|
|
5
|
-
|
|
5
|
+
const useStateAndRef = (initialState) => {
|
|
6
6
|
const $ = c(3);
|
|
7
7
|
const [state, setState] = useState(initialState);
|
|
8
8
|
const ref = useRef(state);
|
|
@@ -1,16 +1,18 @@
|
|
|
1
|
-
import { ColumnDef, ColumnOrderState, VisibilityState } from
|
|
1
|
+
import { ColumnDef, ColumnOrderState, VisibilityState } from "@tanstack/react-table";
|
|
2
|
+
//#region src/hooks/useTableColumnConfig.d.ts
|
|
2
3
|
interface UseTableColumnConfigOptions {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
visibleColumns?: VisibilityState;
|
|
5
|
+
columnOrder?: ColumnOrderState;
|
|
6
|
+
onVisibilityChange?: (value: VisibilityState) => void;
|
|
7
|
+
onOrderChange?: (value: ColumnOrderState) => void;
|
|
7
8
|
}
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
9
|
+
declare function useTableColumnConfig<TData, TValue>(defaultColumns: ColumnDef<TData, TValue>[], options?: UseTableColumnConfigOptions): {
|
|
10
|
+
configColumns: ColumnDef<TData, TValue>[];
|
|
11
|
+
columns: ColumnDef<TData, TValue>[];
|
|
12
|
+
visibleColumns: VisibilityState;
|
|
13
|
+
columnOrder: ColumnOrderState;
|
|
14
|
+
onVisibilityChange: (value: VisibilityState) => void;
|
|
15
|
+
onOrderChange: (value: ColumnOrderState) => void;
|
|
15
16
|
};
|
|
16
|
-
|
|
17
|
+
//#endregion
|
|
18
|
+
export { useTableColumnConfig };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { useEffect, useState } from "react";
|
|
2
1
|
import { c } from "react/compiler-runtime";
|
|
2
|
+
import { useEffect, useState } from "react";
|
|
3
3
|
//#region src/hooks/useTableColumnConfig.ts
|
|
4
4
|
function sortByKeyOrder(data, orderedKeys = []) {
|
|
5
5
|
return [...data].sort((a, b) => {
|
|
@@ -1,84 +1,86 @@
|
|
|
1
|
-
import { KeyboardEvent } from
|
|
1
|
+
import { KeyboardEvent } from "react";
|
|
2
|
+
//#region src/hooks/useTableNav.d.ts
|
|
2
3
|
declare const Selectors: {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
readonly Cell: '[role="cell"],[role="gridcell"],[role="columnheader"],[role="rowheader"],td,th';
|
|
5
|
+
readonly Row: '[role="row"],tr';
|
|
6
|
+
readonly RowGroup: '[role="rowgroup"],thead,tbody,tfoot';
|
|
7
|
+
/** Selector from here: https://github.com/Shopify/polaris/blob/main/polaris-react/src/utilities/focus.ts#L10 */
|
|
8
|
+
readonly Focusable: 'a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not([aria-disabled="true"]):not([tabindex="-1"]):not(:disabled),*[tabindex]';
|
|
8
9
|
};
|
|
9
10
|
type Config = {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
11
|
+
/** Enable debug logs */
|
|
12
|
+
debug?: boolean;
|
|
13
|
+
/** CSS Selectors being used to find Rows, Row Groups, Cells and Focusable elements */
|
|
14
|
+
selectors?: Partial<typeof Selectors>;
|
|
15
|
+
/** How many rows to move when pressing page up/down - Default goes to first/last row */
|
|
16
|
+
pageUpDown?: number;
|
|
16
17
|
} | undefined;
|
|
17
18
|
declare class DataGridNav {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
19
|
+
private selectors;
|
|
20
|
+
readonly pageUpDown: number | undefined;
|
|
21
|
+
private keys;
|
|
22
|
+
private disabled;
|
|
23
|
+
readonly debug: boolean;
|
|
24
|
+
private activeCell;
|
|
25
|
+
constructor();
|
|
26
|
+
constructor(config: Config);
|
|
27
|
+
private debugLog;
|
|
28
|
+
/**
|
|
29
|
+
* Disables the keyboard listener in cases
|
|
30
|
+
* that elements inside the grid need to use
|
|
31
|
+
* arrows keys etc., like select dropdowns
|
|
32
|
+
*/
|
|
33
|
+
disable(): void;
|
|
34
|
+
/**
|
|
35
|
+
* Enables the keyboard listeners
|
|
36
|
+
*/
|
|
37
|
+
enable(): void;
|
|
38
|
+
private isFocusable;
|
|
39
|
+
getActiveCell(): HTMLElement | null;
|
|
40
|
+
/** Used as a keyboard listener for key up */
|
|
41
|
+
tableKeyUp(): void;
|
|
42
|
+
/** Used as a keyboard listener for key down */
|
|
43
|
+
tableKeyDown(e: KeyboardEvent): void;
|
|
44
|
+
/**
|
|
45
|
+
* Handles the navigation inside a cell
|
|
46
|
+
*/
|
|
47
|
+
cellNavigation(e: KeyboardEvent): void;
|
|
48
|
+
/**
|
|
49
|
+
* Handles the navigation outside a cell
|
|
50
|
+
* on the grid level
|
|
51
|
+
*/
|
|
52
|
+
gridNavigation(e: KeyboardEvent): void;
|
|
53
|
+
private pageCellNavigation;
|
|
54
|
+
private verticalCellNavigation;
|
|
55
|
+
/**
|
|
56
|
+
* Sending a row `Element` and then the first cell will be focused.
|
|
57
|
+
*
|
|
58
|
+
* If you want to focus the last cell then the row children can be passed in
|
|
59
|
+
* reversed order
|
|
60
|
+
*/
|
|
61
|
+
private focusOnFirstCell;
|
|
62
|
+
/**
|
|
63
|
+
* Get the column index of a `cell` based on the first `row` parent.
|
|
64
|
+
* `cellIndex` could be used, but it's not supported in HTML tables.
|
|
65
|
+
*/
|
|
66
|
+
private getColumnIndex;
|
|
67
|
+
/**
|
|
68
|
+
* Get the row index of a `row` based
|
|
69
|
+
* on its sibling rows
|
|
70
|
+
*/
|
|
71
|
+
private getRowIndex;
|
|
72
|
+
/**
|
|
73
|
+
* Equivalent to prevUntil/nextUntil in jQuery
|
|
74
|
+
* https://api.jquery.com/prevUntil/
|
|
75
|
+
*/
|
|
76
|
+
private findUntil;
|
|
76
77
|
}
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
78
|
+
declare function useTableNav(options?: Config): {
|
|
79
|
+
listeners: {
|
|
80
|
+
onKeyDown: (e: KeyboardEvent) => void;
|
|
81
|
+
onKeyUp: () => void;
|
|
82
|
+
};
|
|
83
|
+
tableNav: DataGridNav;
|
|
83
84
|
};
|
|
84
|
-
|
|
85
|
+
//#endregion
|
|
86
|
+
export { useTableNav };
|
|
@@ -1,28 +1,10 @@
|
|
|
1
1
|
import { logger } from "../utils/logger.js";
|
|
2
2
|
//#region src/hooks/useTableNav.ts
|
|
3
|
-
|
|
4
|
-
Keys["Enter"] = "Enter";
|
|
5
|
-
Keys["Escape"] = "Escape";
|
|
6
|
-
Keys["Shift"] = "Shift";
|
|
7
|
-
Keys["Control"] = "Control";
|
|
8
|
-
Keys["Home"] = "Home";
|
|
9
|
-
Keys["End"] = "End";
|
|
10
|
-
Keys["Backspace"] = "Backspace";
|
|
11
|
-
/** Page Keys */
|
|
12
|
-
Keys["PageUp"] = "PageUp";
|
|
13
|
-
Keys["PageDown"] = "PageDown";
|
|
14
|
-
/** Arrow Keys */
|
|
15
|
-
Keys["ArrowLeft"] = "ArrowLeft";
|
|
16
|
-
Keys["ArrowUp"] = "ArrowUp";
|
|
17
|
-
Keys["ArrowRight"] = "ArrowRight";
|
|
18
|
-
Keys["ArrowDown"] = "ArrowDown";
|
|
19
|
-
Keys["F2"] = "F2";
|
|
20
|
-
return Keys;
|
|
21
|
-
}(Keys || {});
|
|
22
|
-
var Selectors = {
|
|
3
|
+
const Selectors = {
|
|
23
4
|
Cell: "[role=\"cell\"],[role=\"gridcell\"],[role=\"columnheader\"],[role=\"rowheader\"],td,th",
|
|
24
5
|
Row: "[role=\"row\"],tr",
|
|
25
6
|
RowGroup: "[role=\"rowgroup\"],thead,tbody,tfoot",
|
|
7
|
+
/** Selector from here: https://github.com/Shopify/polaris/blob/main/polaris-react/src/utilities/focus.ts#L10 */
|
|
26
8
|
Focusable: "a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not([aria-disabled=\"true\"]):not([tabindex=\"-1\"]):not(:disabled),*[tabindex]"
|
|
27
9
|
};
|
|
28
10
|
var DataGridNav = class {
|
|
@@ -79,7 +61,7 @@ var DataGridNav = class {
|
|
|
79
61
|
* Cannot work with preventDefault as it will
|
|
80
62
|
* first capture the event from an input in cell for example
|
|
81
63
|
*/
|
|
82
|
-
if (
|
|
64
|
+
if ("ArrowDown" === e.key || "ArrowUp" === e.key || "ArrowLeft" === e.key || "ArrowRight" === e.key) e.preventDefault();
|
|
83
65
|
/**
|
|
84
66
|
* Add key to the stack if it's
|
|
85
67
|
* not the same with the last (long press)
|
|
@@ -104,7 +86,7 @@ var DataGridNav = class {
|
|
|
104
86
|
* Keys: Escape
|
|
105
87
|
* Restore grid navigation
|
|
106
88
|
*/
|
|
107
|
-
if (e.key ===
|
|
89
|
+
if (e.key === "Escape") {
|
|
108
90
|
const cell = e.target.closest(this.selectors.Cell);
|
|
109
91
|
if (cell && this.isFocusable(cell)) {
|
|
110
92
|
cell.focus();
|
|
@@ -118,7 +100,7 @@ var DataGridNav = class {
|
|
|
118
100
|
* Arrow Down disabled:
|
|
119
101
|
* https://github.com/w3c/aria-practices/issues/2739#issuecomment-1613538972
|
|
120
102
|
*/
|
|
121
|
-
if (e.key ===
|
|
103
|
+
if (e.key === "ArrowRight" || e.key === "ArrowDown") {
|
|
122
104
|
const cell = e.target.closest(this.selectors.Cell);
|
|
123
105
|
if (!cell) return;
|
|
124
106
|
const focusableWidgets = [...cell.querySelectorAll(this.selectors.Focusable)];
|
|
@@ -134,7 +116,7 @@ var DataGridNav = class {
|
|
|
134
116
|
* Arrow Up disabled:
|
|
135
117
|
* https://github.com/w3c/aria-practices/issues/2739#issuecomment-1613538972
|
|
136
118
|
*/
|
|
137
|
-
if (e.key ===
|
|
119
|
+
if (e.key === "ArrowLeft" || e.key === "ArrowUp") {
|
|
138
120
|
const cell = e.target.closest(this.selectors.Cell);
|
|
139
121
|
if (!cell) return;
|
|
140
122
|
const focusableWidgets = [...cell.querySelectorAll(this.selectors.Focusable)];
|
|
@@ -166,7 +148,7 @@ var DataGridNav = class {
|
|
|
166
148
|
}
|
|
167
149
|
return;
|
|
168
150
|
}
|
|
169
|
-
if (e.key ===
|
|
151
|
+
if (e.key === "Backspace") {
|
|
170
152
|
const cell = e.target.querySelector(this.selectors.Focusable);
|
|
171
153
|
if (cell && this.isFocusable(cell) && cell instanceof HTMLInputElement) {
|
|
172
154
|
const nativeInputValueSetter = Object.getOwnPropertyDescriptor(HTMLInputElement.prototype, "value")?.set;
|
|
@@ -178,7 +160,7 @@ var DataGridNav = class {
|
|
|
178
160
|
}
|
|
179
161
|
return;
|
|
180
162
|
}
|
|
181
|
-
if (e.key ===
|
|
163
|
+
if (e.key === "Enter") {
|
|
182
164
|
const cell = e.target.querySelector(this.selectors.Focusable);
|
|
183
165
|
if (cell && this.isFocusable(cell)) {
|
|
184
166
|
if (cell.getAttribute("data-type") === "select-trigger") {
|
|
@@ -194,8 +176,8 @@ var DataGridNav = class {
|
|
|
194
176
|
* Keys: ArrowLeft, ArrowRight
|
|
195
177
|
* Should move focus to the next/previous cell
|
|
196
178
|
*/
|
|
197
|
-
if (e.key ===
|
|
198
|
-
const direction = e.key ===
|
|
179
|
+
if (e.key === "ArrowLeft" || e.key === "ArrowRight") {
|
|
180
|
+
const direction = e.key === "ArrowLeft" ? "prev" : "next";
|
|
199
181
|
const cell = e.target.closest(this.selectors.Cell);
|
|
200
182
|
let nextCell = null;
|
|
201
183
|
if (direction === "next" && cell?.nextElementSibling instanceof HTMLElement) nextCell = cell.nextElementSibling;
|
|
@@ -209,7 +191,7 @@ var DataGridNav = class {
|
|
|
209
191
|
* Keys: Up,Down
|
|
210
192
|
* Should move focus to the same column of the next/previous row
|
|
211
193
|
*/
|
|
212
|
-
if (e.key ===
|
|
194
|
+
if (e.key === "ArrowDown" || e.key === "ArrowUp") {
|
|
213
195
|
this.verticalCellNavigation(e);
|
|
214
196
|
return;
|
|
215
197
|
}
|
|
@@ -218,7 +200,7 @@ var DataGridNav = class {
|
|
|
218
200
|
* Should move focus to the first/last row
|
|
219
201
|
* or a predefined number of rows if user provides a value
|
|
220
202
|
*/
|
|
221
|
-
if (e.key ===
|
|
203
|
+
if (e.key === "PageUp" || e.key === "PageDown") {
|
|
222
204
|
this.pageCellNavigation(e);
|
|
223
205
|
return;
|
|
224
206
|
}
|
|
@@ -226,9 +208,9 @@ var DataGridNav = class {
|
|
|
226
208
|
* Keys: Home, End
|
|
227
209
|
* Should move focus to the first/last cell of the current row
|
|
228
210
|
*/
|
|
229
|
-
if (e.key ===
|
|
211
|
+
if (e.key === "Home" || e.key === "End") {
|
|
230
212
|
const rowChildren = [...e.target.closest(this.selectors.Row)?.children || []];
|
|
231
|
-
if (e.key ===
|
|
213
|
+
if (e.key === "End") rowChildren.reverse();
|
|
232
214
|
this.focusOnFirstCell(rowChildren);
|
|
233
215
|
}
|
|
234
216
|
} else {
|
|
@@ -237,11 +219,11 @@ var DataGridNav = class {
|
|
|
237
219
|
* Should move focus to the first/last cell of the first/last row
|
|
238
220
|
*/
|
|
239
221
|
const [firstKey, secondKey] = this.keys;
|
|
240
|
-
if (firstKey === "Control" && (secondKey ===
|
|
222
|
+
if (firstKey === "Control" && (secondKey === "Home" || secondKey === "End")) {
|
|
241
223
|
const siblings = e.target.closest(this.selectors.Row).parentElement?.children;
|
|
242
224
|
if (!siblings) return;
|
|
243
|
-
const rowChildren = [...(secondKey ===
|
|
244
|
-
if (secondKey ===
|
|
225
|
+
const rowChildren = [...(secondKey === "Home" ? siblings[0] : siblings[siblings.length - 1])?.children || []];
|
|
226
|
+
if (secondKey === "End") rowChildren.reverse();
|
|
245
227
|
this.focusOnFirstCell(rowChildren);
|
|
246
228
|
}
|
|
247
229
|
}
|
|
@@ -253,7 +235,7 @@ var DataGridNav = class {
|
|
|
253
235
|
if (row && cell) {
|
|
254
236
|
const position = this.getColumnIndex(cell);
|
|
255
237
|
if (position === void 0) return;
|
|
256
|
-
const direction = e.key ===
|
|
238
|
+
const direction = e.key === "PageUp" ? "prev" : "next";
|
|
257
239
|
const siblings = row.parentElement?.children;
|
|
258
240
|
if (!siblings) return;
|
|
259
241
|
let destinationRow;
|
|
@@ -281,7 +263,7 @@ var DataGridNav = class {
|
|
|
281
263
|
const cellPosition = this.getColumnIndex(cell);
|
|
282
264
|
const rowPosition = this.getRowIndex(row);
|
|
283
265
|
if (cellPosition === void 0 || rowPosition === void 0) return;
|
|
284
|
-
const direction = e.key ===
|
|
266
|
+
const direction = e.key === "ArrowUp" ? "prev" : "next";
|
|
285
267
|
/** Find previous rowgroup and focus on the proper cell */
|
|
286
268
|
if (rowPosition === 0 && direction === "prev") {
|
|
287
269
|
const currentRowGroup = row.parentElement?.closest(this.selectors.RowGroup);
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import { TFunction } from
|
|
1
|
+
import { TFunction } from "i18next";
|
|
2
|
+
//#region src/hooks/useTranslationMemo.d.ts
|
|
2
3
|
type TranslatedFunction<T> = ((t: TFunction) => T) | (() => T);
|
|
3
|
-
|
|
4
|
-
|
|
4
|
+
declare function useTranslationMemo<T>(func: TranslatedFunction<T>): T;
|
|
5
|
+
//#endregion
|
|
6
|
+
export { useTranslationMemo };
|