@kapiuara/ui 0.12.0 → 0.14.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 +1202 -49
- package/dist/components/chat/KapiChatDivider.d.ts +8 -5
- package/dist/components/chat/KapiChatDivider.js +7 -6
- package/dist/components/chat/KapiChatList.d.ts +10 -6
- package/dist/components/chat/KapiChatList.js +12 -11
- package/dist/components/chat/KapiChatThread.d.ts +2 -3
- package/dist/components/chat/KapiChatThread.js +73 -52
- package/dist/components/chat/KapiComposer.d.ts +3 -4
- package/dist/components/chat/KapiComposer.js +2 -1
- package/dist/components/chat/KapiMessageBubble.d.ts +3 -4
- package/dist/components/chat/KapiMessageBubble.js +1 -0
- package/dist/components/chat/KapiTypingIndicator.d.ts +2 -3
- package/dist/components/chat/KapiTypingIndicator.js +1 -0
- package/dist/components/chat/chatLogic.d.ts +6 -0
- package/dist/components/chat/chatLogic.js +2 -2
- package/dist/components/chat/index.d.ts +18 -14
- package/dist/components/data/KapiBarChart.d.ts +13 -14
- package/dist/components/data/KapiBarChart.js +54 -52
- package/dist/components/data/KapiDataTable.d.ts +56 -0
- package/dist/components/data/KapiDataTable.js +143 -0
- package/dist/components/data/KapiEventCalendar.d.ts +9 -4
- package/dist/components/data/KapiEventCalendar.js +100 -96
- package/dist/components/data/KapiHeatmap.d.ts +8 -9
- package/dist/components/data/KapiHeatmap.js +64 -63
- package/dist/components/data/KapiLineChart.d.ts +9 -10
- package/dist/components/data/KapiLineChart.js +59 -56
- package/dist/components/data/KapiPagination.d.ts +6 -4
- package/dist/components/data/KapiPagination.js +2 -1
- package/dist/components/data/KapiPaginationFooter.d.ts +2 -3
- package/dist/components/data/KapiPaginationFooter.js +7 -4
- package/dist/components/data/KapiSparkline.d.ts +8 -9
- package/dist/components/data/KapiSparkline.js +1 -0
- package/dist/components/data/KapiTable.d.ts +7 -360
- package/dist/components/data/KapiTable.js +417 -692
- package/dist/components/data/KapiTableFilter.d.ts +16 -10
- package/dist/components/data/KapiTableFilter.js +50 -48
- package/dist/components/data/KapiTableRow.d.ts +55 -0
- package/dist/components/data/KapiTableRow.js +103 -0
- package/dist/components/data/KapiTableToolbar.d.ts +37 -0
- package/dist/components/data/KapiTableToolbar.js +237 -0
- package/dist/components/data/chartFrame.d.ts +1 -1
- package/dist/components/data/chartFrame.js +54 -55
- package/dist/components/data/datasetSelectionLogic.d.ts +7 -4
- package/dist/components/data/datasetSelectionLogic.js +3 -2
- package/dist/components/data/eventCalendarLogic.d.ts +7 -3
- package/dist/components/data/eventCalendarLogic.js +5 -4
- package/dist/components/data/index.d.ts +108 -30
- package/dist/components/data/rowClickLogic.d.ts +51 -0
- package/dist/components/data/rowClickLogic.js +56 -0
- package/dist/components/data/tableCells.d.ts +38 -0
- package/dist/components/data/tableCells.js +121 -0
- package/dist/components/data/tableHeaderMenu.d.ts +21 -0
- package/dist/components/data/tableHeaderMenu.js +45 -0
- package/dist/components/data/tableLabels.d.ts +76 -0
- package/dist/components/data/tableLabels.js +48 -0
- package/dist/components/data/tableLogic.d.ts +119 -21
- package/dist/components/data/tableLogic.js +121 -84
- package/dist/components/data/tablePaginationLogic.d.ts +15 -0
- package/dist/components/data/tablePaginationLogic.js +15 -0
- package/dist/components/data/tableResizeLogic.d.ts +12 -4
- package/dist/components/data/tableResizeLogic.js +14 -10
- package/dist/components/data/tableTypes.d.ts +509 -0
- package/dist/components/data/useColumnResize.d.ts +28 -0
- package/dist/components/data/useColumnResize.js +116 -0
- package/dist/components/data/useRowKeyWarning.d.ts +10 -0
- package/dist/components/data/useRowKeyWarning.js +29 -0
- package/dist/components/data/useTableEdges.d.ts +15 -0
- package/dist/components/data/useTableEdges.js +26 -0
- package/dist/components/data/useTableSelection.d.ts +51 -0
- package/dist/components/data/useTableSelection.js +80 -0
- package/dist/components/display/KapiAnnotation.d.ts +10 -9
- package/dist/components/display/KapiAnnotation.js +98 -101
- package/dist/components/display/KapiAvatar.d.ts +19 -13
- package/dist/components/display/KapiAvatar.js +26 -24
- package/dist/components/display/KapiAvatarGroup.d.ts +26 -10
- package/dist/components/display/KapiAvatarGroup.js +26 -24
- package/dist/components/display/KapiBadge.d.ts +23 -12
- package/dist/components/display/KapiBadge.js +20 -15
- package/dist/components/display/KapiComment.d.ts +1 -2
- package/dist/components/display/KapiComment.js +3 -2
- package/dist/components/display/KapiCommentComposer.d.ts +2 -3
- package/dist/components/display/KapiCommentComposer.js +3 -2
- package/dist/components/display/KapiDescriptionList.d.ts +6 -5
- package/dist/components/display/KapiDescriptionList.js +1 -0
- package/dist/components/display/KapiFileItem.d.ts +2 -3
- package/dist/components/display/KapiFileItem.js +3 -2
- package/dist/components/display/KapiFileViewer.d.ts +8 -9
- package/dist/components/display/KapiFileViewer.js +1 -0
- package/dist/components/display/KapiIconTile.d.ts +7 -6
- package/dist/components/display/KapiIconTile.js +1 -0
- package/dist/components/display/KapiStat.d.ts +9 -8
- package/dist/components/display/KapiStat.js +1 -0
- package/dist/components/display/KapiTag.d.ts +5 -4
- package/dist/components/display/KapiTag.js +1 -0
- package/dist/components/display/KapiTimeline.d.ts +6 -5
- package/dist/components/display/KapiTimeline.js +1 -0
- package/dist/components/display/KapiTruncate.d.ts +1 -2
- package/dist/components/display/KapiTruncate.js +1 -0
- package/dist/components/display/fileItemLogic.d.ts +1 -1
- package/dist/components/display/iconTileLogic.d.ts +2 -2
- package/dist/components/display/index.d.ts +86 -44
- package/dist/components/display/statLogic.d.ts +1 -1
- package/dist/components/feedback/KapiAlert.d.ts +30 -7
- package/dist/components/feedback/KapiAlert.js +47 -23
- package/dist/components/feedback/KapiBulkBar.d.ts +11 -6
- package/dist/components/feedback/KapiBulkBar.js +6 -3
- package/dist/components/feedback/KapiCountdown.d.ts +15 -12
- package/dist/components/feedback/KapiCountdown.js +17 -16
- package/dist/components/feedback/KapiEmpty.d.ts +3 -2
- package/dist/components/feedback/KapiEmpty.js +1 -0
- package/dist/components/feedback/KapiFab.d.ts +39 -9
- package/dist/components/feedback/KapiFab.js +172 -91
- package/dist/components/feedback/KapiOfflineBanner.d.ts +7 -6
- package/dist/components/feedback/KapiOfflineBanner.js +1 -0
- package/dist/components/feedback/KapiProgress.d.ts +8 -7
- package/dist/components/feedback/KapiProgress.js +1 -0
- package/dist/components/feedback/KapiSkeleton.d.ts +6 -4
- package/dist/components/feedback/KapiToastContainer.d.ts +16 -8
- package/dist/components/feedback/KapiToastContainer.js +118 -63
- package/dist/components/feedback/KapiTour.d.ts +6 -7
- package/dist/components/feedback/KapiTour.js +91 -86
- package/dist/components/feedback/KapiUnsavedBar.d.ts +15 -8
- package/dist/components/feedback/KapiUnsavedBar.js +8 -4
- package/dist/components/feedback/bulkBarLogic.d.ts +6 -1
- package/dist/components/feedback/bulkBarLogic.js +7 -4
- package/dist/components/feedback/countdownLogic.d.ts +19 -11
- package/dist/components/feedback/fabLogic.d.ts +28 -0
- package/dist/components/feedback/fabLogic.js +18 -2
- package/dist/components/feedback/index.d.ts +65 -33
- package/dist/components/feedback/toastLayer.d.ts +18 -0
- package/dist/components/feedback/toastLayer.js +22 -0
- package/dist/components/feedback/toastStore.d.ts +97 -9
- package/dist/components/feedback/toastStore.js +132 -29
- package/dist/components/feedback/tourLogic.d.ts +4 -16
- package/dist/components/feedback/unsavedBarLogic.d.ts +7 -1
- package/dist/components/feedback/unsavedBarLogic.js +9 -5
- package/dist/components/inputs/KapiAutocomplete.d.ts +73 -48
- package/dist/components/inputs/KapiAutocomplete.js +128 -146
- package/dist/components/inputs/KapiButton.d.ts +30 -11
- package/dist/components/inputs/KapiButton.js +34 -27
- package/dist/components/inputs/KapiCalendar.d.ts +14 -8
- package/dist/components/inputs/KapiCalendar.js +36 -34
- package/dist/components/inputs/KapiCalendarGrid.d.ts +11 -6
- package/dist/components/inputs/KapiCalendarGrid.js +44 -38
- package/dist/components/inputs/KapiCheckCard.d.ts +2 -3
- package/dist/components/inputs/KapiCheckCard.js +1 -0
- package/dist/components/inputs/KapiCheckbox.d.ts +1 -1
- package/dist/components/inputs/KapiChecklist.d.ts +77 -0
- package/dist/components/inputs/KapiChecklist.js +175 -0
- package/dist/components/inputs/KapiDatePicker.d.ts +60 -22
- package/dist/components/inputs/KapiDatePicker.js +124 -100
- package/dist/components/inputs/KapiDateRangePicker.d.ts +44 -10
- package/dist/components/inputs/KapiDateRangePicker.js +138 -108
- package/dist/components/inputs/KapiFacetedSearch.d.ts +7 -6
- package/dist/components/inputs/KapiFacetedSearch.js +130 -167
- package/dist/components/inputs/KapiField.d.ts +16 -8
- package/dist/components/inputs/KapiField.js +44 -43
- package/dist/components/inputs/KapiFileUpload.d.ts +15 -16
- package/dist/components/inputs/KapiFileUpload.js +1 -0
- package/dist/components/inputs/KapiIconButton.d.ts +1 -1
- package/dist/components/inputs/KapiInput.d.ts +13 -12
- package/dist/components/inputs/KapiInput.js +70 -70
- package/dist/components/inputs/KapiInputGroup.d.ts +13 -10
- package/dist/components/inputs/KapiInputGroup.js +21 -19
- package/dist/components/inputs/KapiMaskedInput.d.ts +22 -17
- package/dist/components/inputs/KapiMaskedInput.js +71 -55
- package/dist/components/inputs/KapiNumberStepper.d.ts +30 -18
- package/dist/components/inputs/KapiNumberStepper.js +80 -65
- package/dist/components/inputs/KapiRadio.d.ts +1 -1
- package/dist/components/inputs/KapiRating.d.ts +40 -23
- package/dist/components/inputs/KapiRating.js +82 -65
- package/dist/components/inputs/KapiSearchChip.d.ts +9 -8
- package/dist/components/inputs/KapiSearchChip.js +46 -42
- package/dist/components/inputs/KapiSegmented.d.ts +49 -16
- package/dist/components/inputs/KapiSegmented.js +82 -51
- package/dist/components/inputs/KapiSelect.d.ts +120 -39
- package/dist/components/inputs/KapiSelect.js +311 -371
- package/dist/components/inputs/KapiSelectMenu.d.ts +38 -0
- package/dist/components/inputs/KapiSelectMenu.js +173 -0
- package/dist/components/inputs/KapiSlider.d.ts +37 -19
- package/dist/components/inputs/KapiSlider.js +67 -54
- package/dist/components/inputs/KapiSwitch.d.ts +13 -7
- package/dist/components/inputs/KapiSwitch.js +30 -21
- package/dist/components/inputs/KapiTagInput.d.ts +35 -24
- package/dist/components/inputs/KapiTagInput.js +86 -73
- package/dist/components/inputs/KapiTextarea.d.ts +12 -11
- package/dist/components/inputs/KapiTextarea.js +71 -49
- package/dist/components/inputs/asyncSelectLogic.d.ts +8 -4
- package/dist/components/inputs/asyncSelectLogic.js +13 -12
- package/dist/components/inputs/autocompleteLogic.d.ts +2 -29
- package/dist/components/inputs/autocompleteLogic.js +6 -6
- package/dist/components/inputs/checkControl.d.ts +3 -3
- package/dist/components/inputs/checkControl.js +2 -0
- package/dist/components/inputs/checklistLogic.d.ts +33 -0
- package/dist/components/inputs/checklistLogic.js +16 -0
- package/dist/components/inputs/datePickerLogic.d.ts +63 -13
- package/dist/components/inputs/datePickerLogic.js +119 -50
- package/dist/components/inputs/dateRangeLogic.d.ts +8 -3
- package/dist/components/inputs/dateRangeLogic.js +49 -43
- package/dist/components/inputs/facetedSearchLogic.d.ts +1 -3
- package/dist/components/inputs/facetedSearchLogic.js +4 -5
- package/dist/components/inputs/fieldLogic.d.ts +37 -1
- package/dist/components/inputs/fieldLogic.js +36 -19
- package/dist/components/inputs/index.d.ts +118 -57
- package/dist/components/inputs/inputGroupLogic.d.ts +1 -1
- package/dist/components/inputs/inputLogic.d.ts +1 -1
- package/dist/components/inputs/maskLogic.d.ts +3 -2
- package/dist/components/inputs/maskLogic.js +12 -10
- package/dist/components/inputs/misuseWarnings.d.ts +37 -0
- package/dist/components/inputs/misuseWarnings.js +36 -0
- package/dist/components/inputs/numberStepLogic.d.ts +10 -0
- package/dist/components/inputs/numberStepLogic.js +16 -7
- package/dist/components/inputs/ownField.d.ts +37 -0
- package/dist/components/inputs/ownField.js +37 -0
- package/dist/components/inputs/segmentedLogic.d.ts +4 -3
- package/dist/components/inputs/segmentedLogic.js +7 -11
- package/dist/components/inputs/selectKeyLogic.d.ts +45 -0
- package/dist/components/inputs/selectKeyLogic.js +52 -0
- package/dist/components/inputs/selectLogic.d.ts +79 -22
- package/dist/components/inputs/selectLogic.js +87 -51
- package/dist/components/inputs/useCalendarFocus.js +13 -12
- package/dist/components/inputs/useSelectCreate.d.ts +22 -0
- package/dist/components/inputs/useSelectCreate.js +35 -0
- package/dist/components/inputs/useSelectSource.d.ts +39 -0
- package/dist/components/inputs/useSelectSource.js +42 -0
- package/dist/components/layout/KapiAccessCard.d.ts +11 -12
- package/dist/components/layout/KapiAccessCard.js +41 -37
- package/dist/components/layout/KapiAccountMenu.d.ts +23 -8
- package/dist/components/layout/KapiAccountMenu.js +124 -104
- package/dist/components/layout/KapiCard.d.ts +14 -7
- package/dist/components/layout/KapiCard.js +1 -0
- package/dist/components/layout/KapiCluster.d.ts +8 -7
- package/dist/components/layout/KapiCluster.js +1 -0
- package/dist/components/layout/KapiContextSlot.d.ts +10 -11
- package/dist/components/layout/KapiContextSlot.js +97 -92
- package/dist/components/layout/KapiDivider.d.ts +3 -2
- package/dist/components/layout/KapiDivider.js +1 -0
- package/dist/components/layout/KapiGrid.d.ts +8 -7
- package/dist/components/layout/KapiGrid.js +1 -0
- package/dist/components/layout/KapiMasonry.d.ts +1 -2
- package/dist/components/layout/KapiMasonry.js +1 -0
- package/dist/components/layout/KapiNotificationBell.d.ts +14 -15
- package/dist/components/layout/KapiNotificationBell.js +113 -116
- package/dist/components/layout/KapiPageHeader.d.ts +14 -6
- package/dist/components/layout/KapiPageHeader.js +99 -87
- package/dist/components/layout/KapiPanelParts.d.ts +11 -7
- package/dist/components/layout/KapiPanelParts.js +1 -0
- package/dist/components/layout/KapiRail.d.ts +17 -11
- package/dist/components/layout/KapiRail.js +96 -83
- package/dist/components/layout/KapiRailAccount.d.ts +26 -0
- package/dist/components/layout/KapiRailAccount.js +37 -0
- package/dist/components/layout/KapiRoot.d.ts +85 -0
- package/dist/components/layout/KapiRoot.js +58 -0
- package/dist/components/layout/KapiScrollArea.d.ts +2 -3
- package/dist/components/layout/KapiScrollArea.js +1 -0
- package/dist/components/layout/KapiShell.d.ts +15 -10
- package/dist/components/layout/KapiShell.js +51 -46
- package/dist/components/layout/KapiStack.d.ts +6 -5
- package/dist/components/layout/KapiStack.js +1 -0
- package/dist/components/layout/KapiThemeScript.d.ts +23 -0
- package/dist/components/layout/KapiThemeScript.js +13 -0
- package/dist/components/layout/accessCardLogic.d.ts +2 -2
- package/dist/components/layout/index.d.ts +55 -35
- package/dist/components/layout/notificationBellLogic.d.ts +1 -1
- package/dist/components/layout/railContext.d.ts +6 -0
- package/dist/components/layout/railContext.js +6 -0
- package/dist/components/layout/railLogic.d.ts +14 -14
- package/dist/components/layout/useMasonrySpans.js +31 -30
- package/dist/components/layout/useRailOverflow.js +30 -29
- package/dist/components/locale/KapiLocaleProvider.d.ts +33 -4
- package/dist/components/locale/KapiLocaleProvider.js +28 -17
- package/dist/components/locale/index.d.ts +7 -5
- package/dist/components/locale/labelRegistry.d.ts +67 -59
- package/dist/components/locale/localeLogic.d.ts +20 -0
- package/dist/components/locale/localeLogic.js +30 -0
- package/dist/components/navigation/CtxSlidingList.d.ts +5 -3
- package/dist/components/navigation/CtxSlidingList.js +16 -15
- package/dist/components/navigation/KapiAccordion.d.ts +9 -8
- package/dist/components/navigation/KapiAccordion.js +29 -29
- package/dist/components/navigation/KapiBreadcrumb.d.ts +4 -5
- package/dist/components/navigation/KapiBreadcrumb.js +1 -0
- package/dist/components/navigation/KapiCollapsiblePanel.d.ts +22 -16
- package/dist/components/navigation/KapiCollapsiblePanel.js +46 -43
- package/dist/components/navigation/KapiContextPanel.d.ts +31 -32
- package/dist/components/navigation/KapiContextPanel.js +119 -108
- package/dist/components/navigation/KapiFilterChips.d.ts +15 -10
- package/dist/components/navigation/KapiFilterChips.js +27 -22
- package/dist/components/navigation/KapiNavBadge.d.ts +7 -5
- package/dist/components/navigation/KapiNavBadge.js +12 -10
- package/dist/components/navigation/KapiPanelGroup.d.ts +22 -23
- package/dist/components/navigation/KapiPanelGroup.js +62 -60
- package/dist/components/navigation/KapiSteps.d.ts +4 -5
- package/dist/components/navigation/KapiSteps.js +1 -0
- package/dist/components/navigation/KapiTabs.d.ts +34 -16
- package/dist/components/navigation/KapiTabs.js +65 -49
- package/dist/components/navigation/KapiTree.d.ts +58 -18
- package/dist/components/navigation/KapiTree.js +135 -83
- package/dist/components/navigation/KapiWizard.d.ts +21 -11
- package/dist/components/navigation/KapiWizard.js +79 -72
- package/dist/components/navigation/MiniNavItem.d.ts +3 -4
- package/dist/components/navigation/MiniNavItem.js +1 -0
- package/dist/components/navigation/breadcrumbLogic.d.ts +1 -1
- package/dist/components/navigation/contextPanelLogic.d.ts +9 -5
- package/dist/components/navigation/filterChipsLogic.d.ts +13 -7
- package/dist/components/navigation/filterChipsLogic.js +12 -14
- package/dist/components/navigation/index.d.ts +75 -39
- package/dist/components/navigation/panelGroupLogic.d.ts +5 -1
- package/dist/components/navigation/panelMini.d.ts +1 -1
- package/dist/components/navigation/panelMini.js +1 -1
- package/dist/components/navigation/tabsLogic.d.ts +3 -2
- package/dist/components/navigation/tabsLogic.js +8 -12
- package/dist/components/navigation/treeLogic.d.ts +5 -5
- package/dist/components/navigation/treeLogic.js +3 -9
- package/dist/components/overlays/KapiCanvasForm.d.ts +8 -8
- package/dist/components/overlays/KapiCanvasForm.js +1 -1
- package/dist/components/overlays/KapiCommandPalette.d.ts +14 -10
- package/dist/components/overlays/KapiCommandPalette.js +70 -67
- package/dist/components/overlays/KapiConfirm.d.ts +16 -11
- package/dist/components/overlays/KapiConfirm.js +47 -44
- package/dist/components/overlays/KapiContextMenu.d.ts +77 -16
- package/dist/components/overlays/KapiContextMenu.js +55 -70
- package/dist/components/overlays/KapiDialogHost.d.ts +5 -7
- package/dist/components/overlays/KapiDialogHost.js +67 -64
- package/dist/components/overlays/KapiDropdown.d.ts +43 -21
- package/dist/components/overlays/KapiDropdown.js +31 -80
- package/dist/components/overlays/KapiLoading.d.ts +10 -5
- package/dist/components/overlays/KapiLoading.js +28 -25
- package/dist/components/overlays/KapiMenuButton.d.ts +48 -17
- package/dist/components/overlays/KapiMenuButton.js +73 -95
- package/dist/components/overlays/KapiModal.d.ts +16 -8
- package/dist/components/overlays/KapiModal.js +72 -65
- package/dist/components/overlays/KapiOffcanvas.d.ts +23 -13
- package/dist/components/overlays/KapiOffcanvas.js +159 -143
- package/dist/components/overlays/KapiOffcanvasStack.d.ts +4 -4
- package/dist/components/overlays/KapiOffcanvasStack.js +63 -52
- package/dist/components/overlays/KapiPhotoView.d.ts +7 -8
- package/dist/components/overlays/KapiPhotoView.js +67 -64
- package/dist/components/overlays/KapiPopover.d.ts +18 -17
- package/dist/components/overlays/KapiPopover.js +32 -42
- package/dist/components/overlays/KapiShapeSheet.d.ts +18 -12
- package/dist/components/overlays/KapiShapeSheet.js +51 -45
- package/dist/components/overlays/KapiSplitModal.d.ts +12 -11
- package/dist/components/overlays/KapiSplitModal.js +78 -68
- package/dist/components/overlays/KapiTooltip.d.ts +20 -10
- package/dist/components/overlays/KapiTooltip.js +91 -68
- package/dist/components/overlays/commandPaletteLogic.d.ts +2 -4
- package/dist/components/overlays/commandPaletteLogic.js +2 -2
- package/dist/components/overlays/dialogStore.d.ts +41 -20
- package/dist/components/overlays/dialogStore.js +4 -4
- package/dist/components/overlays/dialogUtils.d.ts +22 -0
- package/dist/components/overlays/dialogUtils.js +6 -2
- package/dist/components/overlays/index.d.ts +48 -38
- package/dist/components/overlays/menuButtonLogic.d.ts +33 -31
- package/dist/components/overlays/menuButtonLogic.js +9 -3
- package/dist/components/overlays/menuKeyboardLogic.d.ts +42 -8
- package/dist/components/overlays/menuKeyboardLogic.js +46 -15
- package/dist/components/overlays/menuList.d.ts +91 -0
- package/dist/components/overlays/menuList.js +223 -0
- package/dist/components/overlays/modalStack.d.ts +21 -0
- package/dist/components/overlays/modalStack.js +23 -0
- package/dist/components/overlays/offcanvasCompanion.d.ts +1 -1
- package/dist/components/overlays/offcanvasResize.d.ts +1 -1
- package/dist/components/overlays/offcanvasSide.d.ts +12 -1
- package/dist/components/overlays/offcanvasSide.js +4 -4
- package/dist/components/overlays/popoverLogic.d.ts +12 -12
- package/dist/components/overlays/useExitPresence.js +23 -22
- package/dist/components/overlays/useNativeDialog.d.ts +15 -4
- package/dist/components/overlays/useNativeDialog.js +52 -33
- package/dist/components/rootProps.d.ts +6 -4
- package/dist/components/tone.d.ts +55 -0
- package/dist/components/tone.js +92 -0
- package/dist/css/base.css +1 -0
- package/dist/css/components/chat/chat.css +1 -0
- package/dist/css/components/data/KapiBarChart.css +1 -0
- package/dist/css/components/data/KapiEventCalendar.css +1 -0
- package/dist/css/components/data/KapiHeatmap.css +1 -0
- package/dist/css/components/data/KapiLineChart.css +1 -0
- package/dist/css/components/data/KapiSparkline.css +1 -0
- package/dist/css/components/data/KapiTable.css +1 -0
- package/dist/css/components/data/KapiTableFilter.css +1 -0
- package/dist/css/components/display/KapiAnnotation.css +1 -0
- package/dist/css/components/display/KapiComment.css +1 -0
- package/dist/css/components/display/KapiFileItem.css +1 -0
- package/dist/css/components/display/KapiFileViewer.css +1 -0
- package/dist/css/components/display/KapiTruncate.css +1 -0
- package/dist/css/components/display/display.css +1 -0
- package/dist/css/components/feedback/KapiBulkBar.css +1 -0
- package/dist/css/components/feedback/KapiOfflineBanner.css +1 -0
- package/dist/css/components/feedback/KapiUnsavedBar.css +1 -0
- package/dist/css/components/feedback/feedback.css +1 -0
- package/dist/css/components/inputs/KapiAutocomplete.css +1 -0
- package/dist/css/components/inputs/KapiButton.css +1 -0
- package/dist/css/components/inputs/KapiChecklist.css +1 -0
- package/dist/css/components/inputs/KapiDatePicker.css +1 -0
- package/dist/css/components/inputs/KapiFacetedSearch.css +1 -0
- package/dist/css/components/inputs/KapiFileUpload.css +1 -0
- package/dist/css/components/inputs/KapiInputGroup.css +1 -0
- package/dist/css/components/inputs/KapiSearchChip.css +1 -0
- package/dist/css/components/inputs/KapiSelect.css +1 -0
- package/dist/css/components/inputs/KapiTagInput.css +1 -0
- package/dist/css/components/inputs/checkControl.css +1 -0
- package/dist/css/components/inputs/inputsExtra.css +1 -0
- package/dist/css/components/layout/KapiAccessCard.css +1 -0
- package/dist/css/components/layout/KapiAccountMenu.css +1 -0
- package/dist/css/components/layout/KapiCard.css +1 -0
- package/dist/css/components/layout/KapiDivider.css +1 -0
- package/dist/css/components/layout/KapiMasonry.css +1 -0
- package/dist/css/components/layout/KapiNotificationBell.css +1 -0
- package/dist/css/components/layout/KapiPageHeader.css +1 -0
- package/dist/css/components/layout/KapiPanelParts.css +1 -0
- package/dist/css/components/layout/KapiRail.css +1 -0
- package/dist/css/components/layout/KapiRoot.css +1 -0
- package/dist/css/components/layout/KapiScrollArea.css +1 -0
- package/dist/css/components/layout/layout-primitives.css +1 -0
- package/dist/css/components/navigation/KapiFilterChips.css +1 -0
- package/dist/css/components/navigation/KapiNavBadge.css +1 -0
- package/dist/css/components/navigation/KapiSteps.css +1 -0
- package/dist/css/components/navigation/navigation.css +1 -0
- package/dist/css/components/overlays/KapiCommandPalette.css +1 -0
- package/dist/css/components/overlays/KapiConfirm.css +1 -0
- package/dist/css/components/overlays/KapiModal.css +1 -0
- package/dist/css/components/overlays/KapiOffcanvas.css +1 -0
- package/dist/css/components/overlays/KapiPopover.css +1 -0
- package/dist/css/components/overlays/KapiSplitModal.css +1 -0
- package/dist/css/components/overlays/overlays.css +1 -0
- package/dist/css/none.js +1 -0
- package/dist/hooks/dataColorLogic.d.ts +1 -1
- package/dist/hooks/dateFormat.js +13 -13
- package/dist/hooks/directionLogic.d.ts +32 -0
- package/dist/hooks/directionLogic.js +7 -0
- package/dist/hooks/fieldErrorsLogic.d.ts +35 -0
- package/dist/hooks/fieldErrorsLogic.js +13 -0
- package/dist/hooks/focusLogic.js +8 -7
- package/dist/hooks/hotkeyLogic.d.ts +5 -1
- package/dist/hooks/hotkeyLogic.js +2 -2
- package/dist/hooks/index.d.ts +122 -57
- package/dist/hooks/kapiRoot.d.ts +11 -4
- package/dist/hooks/kapiRoot.js +18 -5
- package/dist/hooks/mergeRefs.d.ts +9 -0
- package/dist/hooks/mergeRefs.js +15 -0
- package/dist/hooks/onlineStatusLogic.d.ts +4 -4
- package/dist/hooks/ownerDocument.d.ts +26 -0
- package/dist/hooks/ownerDocument.js +24 -0
- package/dist/hooks/portalRoot.d.ts +19 -0
- package/dist/hooks/portalRoot.js +10 -0
- package/dist/hooks/rafThrottle.d.ts +12 -4
- package/dist/hooks/rafThrottle.js +43 -10
- package/dist/hooks/rangeSelectLogic.d.ts +47 -0
- package/dist/hooks/rangeSelectLogic.js +29 -0
- package/dist/hooks/recentLogic.d.ts +3 -3
- package/dist/hooks/reducedMotion.js +11 -3
- package/dist/hooks/rightClick.d.ts +5 -1
- package/dist/hooks/rightClick.js +16 -15
- package/dist/hooks/scrollCollapseLogic.d.ts +2 -2
- package/dist/hooks/seriesPaletteLogic.d.ts +1 -1
- package/dist/hooks/shallowStable.d.ts +12 -0
- package/dist/hooks/shallowStable.js +17 -0
- package/dist/hooks/slidingIndicatorLogic.d.ts +4 -0
- package/dist/hooks/themeColorsLogic.d.ts +1 -1
- package/dist/hooks/themeDeriveLogic.d.ts +1 -2
- package/dist/hooks/themeRadiiLogic.d.ts +1 -1
- package/dist/hooks/themeScript.d.ts +10 -0
- package/dist/hooks/themeScript.js +5 -0
- package/dist/hooks/useAsyncLoader.d.ts +51 -0
- package/dist/hooks/useAsyncLoader.js +77 -0
- package/dist/hooks/useAsyncTasks.d.ts +19 -0
- package/dist/hooks/useAsyncTasks.js +37 -0
- package/dist/hooks/useBottomBarInset.d.ts +7 -0
- package/dist/hooks/useBottomBarInset.js +25 -0
- package/dist/hooks/useControllableState.d.ts +25 -0
- package/dist/hooks/useControllableState.js +20 -0
- package/dist/hooks/useDismiss.d.ts +40 -0
- package/dist/hooks/useDismiss.js +42 -0
- package/dist/hooks/useDragScroll.d.ts +10 -0
- package/dist/hooks/useDragScroll.js +36 -25
- package/dist/hooks/useFieldErrors.d.ts +39 -0
- package/dist/hooks/useFieldErrors.js +29 -0
- package/dist/hooks/useFocusReturn.d.ts +25 -0
- package/dist/hooks/useFocusReturn.js +31 -0
- package/dist/hooks/useFormReset.d.ts +22 -0
- package/dist/hooks/useFormReset.js +17 -0
- package/dist/hooks/useGrowOrigin.d.ts +2 -2
- package/dist/hooks/useHotkey.d.ts +3 -3
- package/dist/hooks/useHydrated.d.ts +2 -0
- package/dist/hooks/useHydrated.js +6 -0
- package/dist/hooks/useKapiTheme.d.ts +3 -2
- package/dist/hooks/useKapiTheme.js +111 -68
- package/dist/hooks/useMediaQuery.d.ts +5 -1
- package/dist/hooks/useMediaQuery.js +5 -9
- package/dist/hooks/useOnlineStatus.d.ts +1 -1
- package/dist/hooks/useOutsidePress.d.ts +9 -0
- package/dist/hooks/useOutsidePress.js +11 -0
- package/dist/hooks/usePersistentState.d.ts +2 -2
- package/dist/hooks/usePersistentState.js +21 -21
- package/dist/hooks/usePlacement.d.ts +6 -5
- package/dist/hooks/usePlacement.js +68 -65
- package/dist/hooks/useRangeSelect.d.ts +24 -0
- package/dist/hooks/useRangeSelect.js +26 -0
- package/dist/hooks/useRecent.d.ts +3 -3
- package/dist/hooks/useScrollCollapse.d.ts +1 -1
- package/dist/hooks/useScrollEdges.d.ts +9 -8
- package/dist/hooks/useScrollEdges.js +62 -57
- package/dist/hooks/useSlidingIndicator.d.ts +1 -1
- package/dist/hooks/useSlidingIndicator.js +38 -33
- package/dist/hooks/useSubmitDraft.js +18 -19
- package/dist/hooks/useTypeahead.d.ts +9 -0
- package/dist/hooks/useTypeahead.js +20 -0
- package/dist/hooks/useUnsavedGuard.d.ts +7 -4
- package/dist/hooks/useUnsavedGuard.js +1 -0
- package/dist/hooks/useVirtualList.d.ts +36 -0
- package/dist/hooks/useVirtualList.js +126 -0
- package/dist/hooks/viewportInsetLogic.d.ts +37 -0
- package/dist/hooks/viewportInsetLogic.js +20 -0
- package/dist/hooks/virtualListLogic.d.ts +88 -0
- package/dist/hooks/virtualListLogic.js +80 -0
- package/dist/index.d.ts +13 -13
- package/dist/index.js +196 -179
- package/dist/kapi.css +1 -1
- package/dist/kapi.layered.css +1 -1
- package/package.json +18 -7
|
@@ -1,77 +1,93 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
2
|
+
import "#kapi-css/components/navigation/navigation.css";
|
|
3
|
+
import { useKapiFormatLocale as e } from "../locale/KapiLocaleProvider.js";
|
|
4
|
+
import { joinClasses as t } from "../rootProps.js";
|
|
5
|
+
import { useControllableState as n } from "../../hooks/useControllableState.js";
|
|
6
|
+
import { logicalKeyOf as r } from "../../hooks/directionLogic.js";
|
|
7
|
+
import { useDuplicateValueWarning as i, useMutedControlWarning as a } from "../inputs/misuseWarnings.js";
|
|
8
|
+
import { useMergedRefs as o } from "../../hooks/mergeRefs.js";
|
|
9
|
+
import { useSlidingIndicator as s } from "../../hooks/useSlidingIndicator.js";
|
|
10
|
+
import { formatCount as c } from "../../hooks/numberFormatLogic.js";
|
|
11
|
+
import { useScrollEdges as l } from "../../hooks/useScrollEdges.js";
|
|
6
12
|
/* empty css */
|
|
7
|
-
import { nextTabId as
|
|
8
|
-
import { Fragment as
|
|
9
|
-
import { useCallback as
|
|
13
|
+
import { nextTabId as u, tabClasses as d, tabId as f, tabPanelId as p } from "./tabsLogic.js";
|
|
14
|
+
import { Fragment as m, jsx as h, jsxs as g } from "react/jsx-runtime";
|
|
15
|
+
import { useCallback as _, useId as v, useLayoutEffect as y, useMemo as b, useRef as x } from "react";
|
|
10
16
|
//#region src/components/navigation/KapiTabs.tsx
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
17
|
+
var S = [];
|
|
18
|
+
function C({ items: C, tabs: w, value: T, defaultValue: E, onChange: D, className: O, idBase: k, disabled: A = !1, size: j = "md", onKeyDown: M, ref: N, ...P }) {
|
|
19
|
+
let F = e(), I = C ?? w ?? S, L = v(), R = k ?? L, z = x({}), [B, V] = n(T, () => E ?? I[0]?.id, D), H = b(() => I.map((e) => e.id), [I]);
|
|
20
|
+
i("KapiTabs", H), a("KapiTabs", {
|
|
21
|
+
controlled: T !== void 0,
|
|
22
|
+
hasOnChange: !!D,
|
|
23
|
+
disabled: A
|
|
24
|
+
});
|
|
25
|
+
let { containerRef: U, indicatorRef: W } = s({
|
|
26
|
+
active: B ?? null,
|
|
27
|
+
deps: [I],
|
|
15
28
|
findActive: (e) => e.querySelector("[role=\"tab\"][aria-selected=\"true\"]")
|
|
16
|
-
}), { ref:
|
|
17
|
-
|
|
18
|
-
}, [
|
|
19
|
-
|
|
20
|
-
let e =
|
|
21
|
-
e &&
|
|
29
|
+
}), { ref: G, edges: K, reveal: q } = l({ axis: "x" }), J = _((e) => {
|
|
30
|
+
U.current = e, G.current = e;
|
|
31
|
+
}, [U, G]), Y = o(J, N), X = x(!1);
|
|
32
|
+
y(() => {
|
|
33
|
+
let e = U.current?.querySelector("[role=\"tab\"][aria-selected=\"true\"]");
|
|
34
|
+
e && q(e, { instant: !X.current }), X.current = !0;
|
|
22
35
|
}, [
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
36
|
+
B,
|
|
37
|
+
U,
|
|
38
|
+
q
|
|
26
39
|
]);
|
|
27
|
-
let
|
|
28
|
-
if (
|
|
29
|
-
let t =
|
|
30
|
-
t !== void 0 && (e.preventDefault(),
|
|
40
|
+
let Z = (e) => A || I.some((t) => t.id === e && t.disabled === !0), Q = B !== void 0 && I.some((e) => e.id === B) && !Z(B) ? B : I.find((e) => !Z(e.id))?.id, $ = (e) => {
|
|
41
|
+
if (M?.(e), e.defaultPrevented || B === void 0) return;
|
|
42
|
+
let t = u(I.map((e) => e.id), B, r(e), Z);
|
|
43
|
+
t !== void 0 && (e.preventDefault(), V(t), z.current[t]?.focus());
|
|
31
44
|
};
|
|
32
|
-
return /* @__PURE__ */
|
|
33
|
-
...
|
|
34
|
-
ref:
|
|
35
|
-
className:
|
|
36
|
-
"data-edge-start":
|
|
37
|
-
"data-edge-end":
|
|
45
|
+
return /* @__PURE__ */ g("div", {
|
|
46
|
+
...P,
|
|
47
|
+
ref: Y,
|
|
48
|
+
className: t("kapi-tabs", "kapi-fade-x", j === "sm" && "kapi-tabs--sm", O),
|
|
49
|
+
"data-edge-start": K.start ? "" : void 0,
|
|
50
|
+
"data-edge-end": K.end ? "" : void 0,
|
|
38
51
|
role: "tablist",
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
52
|
+
"aria-disabled": A || void 0,
|
|
53
|
+
onKeyDown: $,
|
|
54
|
+
children: [/* @__PURE__ */ h("span", {
|
|
55
|
+
ref: W,
|
|
42
56
|
className: "kapi-tabs__indicator",
|
|
43
57
|
"aria-hidden": "true"
|
|
44
|
-
}),
|
|
45
|
-
let t = e.id ===
|
|
46
|
-
return /* @__PURE__ */
|
|
58
|
+
}), I.map((e) => {
|
|
59
|
+
let t = e.id === B;
|
|
60
|
+
return /* @__PURE__ */ g("button", {
|
|
47
61
|
ref: (t) => {
|
|
48
|
-
|
|
62
|
+
z.current[e.id] = t;
|
|
49
63
|
},
|
|
50
64
|
type: "button",
|
|
51
|
-
id:
|
|
65
|
+
id: f(R, e.id),
|
|
52
66
|
role: "tab",
|
|
53
|
-
"aria-controls":
|
|
67
|
+
"aria-controls": k ? p(k, e.id) : void 0,
|
|
54
68
|
"aria-selected": t,
|
|
55
|
-
tabIndex:
|
|
56
|
-
|
|
57
|
-
|
|
69
|
+
tabIndex: e.id === Q ? 0 : -1,
|
|
70
|
+
disabled: Z(e.id) || void 0,
|
|
71
|
+
className: d(t),
|
|
72
|
+
onClick: () => V(e.id),
|
|
58
73
|
children: [
|
|
59
74
|
e.icon,
|
|
60
75
|
e.label,
|
|
61
|
-
e.count !== void 0 && /* @__PURE__ */
|
|
76
|
+
e.count !== void 0 && /* @__PURE__ */ g(m, { children: [" ", /* @__PURE__ */ h("span", {
|
|
62
77
|
className: "kapi-tabs__count",
|
|
63
|
-
children:
|
|
78
|
+
children: c(e.count, F)
|
|
64
79
|
})] })
|
|
65
80
|
]
|
|
66
81
|
}, e.id);
|
|
67
82
|
})]
|
|
68
83
|
});
|
|
69
84
|
}
|
|
70
|
-
function
|
|
71
|
-
return /* @__PURE__ */
|
|
72
|
-
|
|
85
|
+
function w({ idBase: e, tabId: t, active: n, keepMounted: r = !1, className: i, children: a, ref: o }) {
|
|
86
|
+
return /* @__PURE__ */ h("div", {
|
|
87
|
+
ref: o,
|
|
88
|
+
id: p(e, t),
|
|
73
89
|
role: "tabpanel",
|
|
74
|
-
"aria-labelledby":
|
|
90
|
+
"aria-labelledby": f(e, t),
|
|
75
91
|
tabIndex: 0,
|
|
76
92
|
hidden: !n,
|
|
77
93
|
className: i,
|
|
@@ -79,4 +95,4 @@ function g({ idBase: e, tabId: t, active: n, keepMounted: r = !1, className: i,
|
|
|
79
95
|
});
|
|
80
96
|
}
|
|
81
97
|
//#endregion
|
|
82
|
-
export {
|
|
98
|
+
export { w as KapiTabPanel, C as KapiTabs };
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { type HTMLAttributes, type ReactNode, type Ref } from "react";
|
|
2
|
-
import { type KapiTreeNode } from "./treeLogic";
|
|
3
|
-
import "
|
|
4
|
-
import type { KapiLabelsOverride } from "../labelsLogic";
|
|
2
|
+
import { type KapiTreeNode } from "./treeLogic.js";
|
|
3
|
+
import type { KapiLabelsOverride } from "../labelsLogic.js";
|
|
5
4
|
export type KapiTreeLabels = {
|
|
6
5
|
/** Descripción de un nodo mientras carga sus hijos. */
|
|
7
6
|
loading: string;
|
|
@@ -13,28 +12,58 @@ export declare const DEFAULT_TREE_LABELS: KapiTreeLabels;
|
|
|
13
12
|
*/
|
|
14
13
|
export type KapiTreeProps<T = unknown, Id extends string = string> = Omit<HTMLAttributes<HTMLUListElement>, "children" | "onSelect" | "defaultValue" | "onChange"> & {
|
|
15
14
|
/** Nodos raíz del árbol, con sus hijos anidados (o cargados al expandir con `onExpand`). */
|
|
16
|
-
nodes: KapiTreeNode<T, Id>[];
|
|
17
|
-
/** Controlado: ids expandidos. */
|
|
18
|
-
|
|
15
|
+
nodes: readonly KapiTreeNode<T, Id>[];
|
|
16
|
+
/** Controlado: ids expandidos (mismo nombre que en `KapiTable`). */
|
|
17
|
+
expandedIds?: readonly Id[] | undefined;
|
|
19
18
|
/** Expandidos al inicio cuando no es controlado. */
|
|
20
|
-
|
|
19
|
+
defaultExpandedIds?: readonly Id[] | undefined;
|
|
21
20
|
/** Nueva lista de expandidos (controlado o no). */
|
|
22
|
-
|
|
21
|
+
onExpandedIdsChange?: ((expandedIds: Id[]) => void) | undefined;
|
|
22
|
+
/**
|
|
23
|
+
* Nombre anterior de `expandedIds`; si llegan los dos, gana `expandedIds`.
|
|
24
|
+
* @deprecated Usar `expandedIds`.
|
|
25
|
+
*/
|
|
26
|
+
expanded?: readonly Id[] | undefined;
|
|
27
|
+
/**
|
|
28
|
+
* Nombre anterior de `defaultExpandedIds`; si llegan los dos, gana `defaultExpandedIds`.
|
|
29
|
+
* @deprecated Usar `defaultExpandedIds`.
|
|
30
|
+
*/
|
|
31
|
+
defaultExpanded?: readonly Id[] | undefined;
|
|
32
|
+
/**
|
|
33
|
+
* Nombre anterior de `onExpandedIdsChange`; si llegan los dos, solo se llama a `onExpandedIdsChange`.
|
|
34
|
+
* @deprecated Usar `onExpandedIdsChange`.
|
|
35
|
+
*/
|
|
36
|
+
onExpandedChange?: ((expanded: Id[]) => void) | undefined;
|
|
23
37
|
/**
|
|
24
38
|
* Pide los hijos de un nodo diferido: se dispara al expandir un nodo con `hasChildren`, sin `children` y que
|
|
25
|
-
* no esté `loading`. No se repite para un nodo ya cargado (para seguir cada expansión, `
|
|
39
|
+
* no esté `loading`. No se repite para un nodo ya cargado (para seguir cada expansión, `onExpandedIdsChange`).
|
|
26
40
|
* Si la carga falla, el consumidor tiene que volver a poner `loading: false` (sin `children`) para que el
|
|
27
41
|
* nodo pueda reintentar al expandirse de nuevo.
|
|
28
42
|
*/
|
|
29
|
-
onExpand?: (node: KapiTreeNode<T, Id>) => void;
|
|
30
|
-
/** Controlado: ids seleccionados. */
|
|
31
|
-
|
|
43
|
+
onExpand?: ((node: KapiTreeNode<T, Id>) => void) | undefined;
|
|
44
|
+
/** Controlado: ids seleccionados (mismo nombre que en `KapiTable`). Sin `multiple` hay a lo sumo uno. */
|
|
45
|
+
selectedIds?: readonly Id[] | undefined;
|
|
32
46
|
/** Seleccionados al inicio cuando no es controlado. */
|
|
33
|
-
|
|
47
|
+
defaultSelectedIds?: readonly Id[] | undefined;
|
|
34
48
|
/** Nueva selección (controlado o no) y el nodo que la cambió. */
|
|
35
|
-
|
|
49
|
+
onSelectedIdsChange?: ((selectedIds: Id[], node: KapiTreeNode<T, Id>) => void) | undefined;
|
|
50
|
+
/**
|
|
51
|
+
* Nombre anterior de `selectedIds`; si llegan los dos, gana `selectedIds`.
|
|
52
|
+
* @deprecated Usar `selectedIds`.
|
|
53
|
+
*/
|
|
54
|
+
selected?: readonly Id[] | undefined;
|
|
55
|
+
/**
|
|
56
|
+
* Nombre anterior de `defaultSelectedIds`; si llegan los dos, gana `defaultSelectedIds`.
|
|
57
|
+
* @deprecated Usar `defaultSelectedIds`.
|
|
58
|
+
*/
|
|
59
|
+
defaultSelected?: readonly Id[] | undefined;
|
|
60
|
+
/**
|
|
61
|
+
* Nombre anterior de `onSelectedIdsChange`; si llegan los dos, solo se llama a `onSelectedIdsChange`.
|
|
62
|
+
* @deprecated Usar `onSelectedIdsChange`.
|
|
63
|
+
*/
|
|
64
|
+
onSelectedChange?: ((selected: Id[], node: KapiTreeNode<T, Id>) => void) | undefined;
|
|
36
65
|
/** Varios seleccionados a la vez (`aria-multiselectable`): Espacio/Enter/clic alternan. */
|
|
37
|
-
multiple?: boolean;
|
|
66
|
+
multiple?: boolean | undefined;
|
|
38
67
|
/**
|
|
39
68
|
* Contenido rico del nodo (ícono, contador…). El nombre accesible sale de lo que renderiza. Si incluye
|
|
40
69
|
* controles (un botón, un enlace), Enter/Espacio y el type-ahead sobre ellos no los toma el árbol: se activan
|
|
@@ -42,15 +71,26 @@ export type KapiTreeProps<T = unknown, Id extends string = string> = Omit<HTMLAt
|
|
|
42
71
|
* un control que las necesite (un input con cursor, un slider) debe frenar su propagación con `stopPropagation`.
|
|
43
72
|
* Un clic en ellos sí llega a la fila (que selecciona): usa `stopPropagation` para evitarlo.
|
|
44
73
|
*/
|
|
45
|
-
renderLabel?: (node: KapiTreeNode<T, Id>) => ReactNode;
|
|
74
|
+
renderLabel?: ((node: KapiTreeNode<T, Id>) => ReactNode) | undefined;
|
|
46
75
|
/** Textos fijos (clave `tree`). */
|
|
47
76
|
labels?: KapiLabelsOverride<KapiTreeLabels> | undefined;
|
|
48
77
|
/** Ref al `<ul role="tree">`. */
|
|
49
|
-
ref?: Ref<HTMLUListElement
|
|
78
|
+
ref?: Ref<HTMLUListElement> | undefined;
|
|
79
|
+
/**
|
|
80
|
+
* Árbol virtual: los nodos visibles se dibujan como una lista plana (con `aria-level`, `aria-setsize` y
|
|
81
|
+
* `aria-posinset`) y sólo los que están a la vista, con alto medido por fila. El `<ul role="tree">` pasa a
|
|
82
|
+
* scrollear dentro de `maxHeight`. Teclado, type-ahead y selección no cambian.
|
|
83
|
+
*/
|
|
84
|
+
virtual?: boolean | undefined;
|
|
85
|
+
/**
|
|
86
|
+
* Con `virtual`: alto máximo del árbol (px o cualquier largo CSS), donde scrollea.
|
|
87
|
+
* @default 400
|
|
88
|
+
*/
|
|
89
|
+
maxHeight?: number | string | undefined;
|
|
50
90
|
};
|
|
51
91
|
/**
|
|
52
92
|
* Árbol (WAI-ARIA APG, Tree View): `tree` / `treeitem` / `group` con nivel, posición y tabindex itinerante.
|
|
53
93
|
* Flechas recorren y abren/cierran, Home/End, Enter/Espacio seleccionan, `*` expande los hermanos y escribir
|
|
54
94
|
* salta al nodo que empieza con ese texto. Los hijos diferidos se piden en `onExpand`.
|
|
55
95
|
*/
|
|
56
|
-
export declare function KapiTree<T = unknown, Id extends string = string>({ nodes, expanded:
|
|
96
|
+
export declare function KapiTree<T = unknown, Id extends string = string>({ nodes, expandedIds, defaultExpandedIds, onExpandedIdsChange, expanded: legacyExpanded, defaultExpanded: legacyDefaultExpanded, onExpandedChange: legacyOnExpandedChange, onExpand, selectedIds, defaultSelectedIds, onSelectedIdsChange, selected: legacySelected, defaultSelected: legacyDefaultSelected, onSelectedChange: legacyOnSelectedChange, multiple, renderLabel, labels, virtual, maxHeight, className, style, ref, onKeyDown, onFocus, ...rest }: KapiTreeProps<T, Id>): import("react").JSX.Element;
|
|
@@ -1,157 +1,209 @@
|
|
|
1
1
|
"use client";
|
|
2
|
+
import "#kapi-css/components/navigation/navigation.css";
|
|
2
3
|
import { useLabels as e } from "../locale/KapiLocaleProvider.js";
|
|
3
4
|
import { joinClasses as t } from "../rootProps.js";
|
|
5
|
+
import { isTypeaheadKey as n } from "../overlays/menuKeyboardLogic.js";
|
|
6
|
+
import { useControllableState as r } from "../../hooks/useControllableState.js";
|
|
7
|
+
import { logicalKeyOf as i } from "../../hooks/directionLogic.js";
|
|
8
|
+
import { useMergedRefs as a } from "../../hooks/mergeRefs.js";
|
|
9
|
+
import { useTypeahead as o } from "../../hooks/useTypeahead.js";
|
|
10
|
+
import { useVirtualList as s } from "../../hooks/useVirtualList.js";
|
|
4
11
|
/* empty css */
|
|
5
|
-
import { TREE_KEYS as
|
|
6
|
-
import { Fragment as
|
|
7
|
-
import { useId as
|
|
8
|
-
import { ChevronRight as
|
|
12
|
+
import { TREE_KEYS as c, flattenVisible as l, isExpandable as u, matchTypeahead as ee, needsChildren as te, resolveTabStop as ne, toggleSelectedId as re, treeKeyAction as d } from "./treeLogic.js";
|
|
13
|
+
import { Fragment as f, jsx as p, jsxs as m } from "react/jsx-runtime";
|
|
14
|
+
import { useId as ie, useLayoutEffect as ae, useMemo as h, useRef as g, useState as oe } from "react";
|
|
15
|
+
import { ChevronRight as se } from "lucide-react";
|
|
9
16
|
//#region src/components/navigation/KapiTree.tsx
|
|
10
|
-
var
|
|
11
|
-
function
|
|
12
|
-
let
|
|
17
|
+
var _ = { loading: "Cargando…" }, ce = 37, v = 400;
|
|
18
|
+
function y({ nodes: y, expandedIds: le, defaultExpandedIds: ue, onExpandedIdsChange: b, expanded: x, defaultExpanded: S, onExpandedChange: de, onExpand: fe, selectedIds: pe, defaultSelectedIds: me, onSelectedIdsChange: he, selected: ge, defaultSelected: _e, onSelectedChange: ve, multiple: C = !1, renderLabel: w, labels: ye, virtual: T = !1, maxHeight: E = v, className: D, style: O, ref: k, onKeyDown: A, onFocus: j, ...M }) {
|
|
19
|
+
let N = e("tree", _, ye), P = ie(), [F, be] = r(le ?? x, () => ue ?? S ?? [], b ?? de), [I, xe] = r(pe ?? ge, () => me ?? _e ?? []), Se = he ?? ve, [Ce, L] = oe(null), R = g(/* @__PURE__ */ new Map()), z = o(500), B = h(() => l(y, F), [y, F]), V = ne(y, B, Ce, I), H = h(() => new Map(B.map((e, t) => [e.node.id, {
|
|
13
20
|
...e,
|
|
14
21
|
node: e.node,
|
|
15
22
|
index: t
|
|
16
|
-
}])), [
|
|
17
|
-
|
|
18
|
-
},
|
|
19
|
-
|
|
20
|
-
},
|
|
21
|
-
|
|
22
|
-
},
|
|
23
|
-
|
|
24
|
-
},
|
|
23
|
+
}])), [B]), U = (e, t) => {
|
|
24
|
+
be(e), t.filter(te).forEach((e) => fe?.(e));
|
|
25
|
+
}, W = (e) => !e.disabled && u(e), G = (e) => {
|
|
26
|
+
W(e) && !F.includes(e.id) && U([...F, e.id], [e]);
|
|
27
|
+
}, K = (e) => {
|
|
28
|
+
W(e) && F.includes(e.id) && U(F.filter((t) => t !== e.id), []);
|
|
29
|
+
}, we = (e) => {
|
|
30
|
+
F.includes(e.id) ? K(e) : G(e);
|
|
31
|
+
}, q = (e) => {
|
|
25
32
|
if (e.disabled) return;
|
|
26
|
-
let t =
|
|
27
|
-
|
|
28
|
-
},
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
+
let t = re(I, e.id, C);
|
|
34
|
+
xe(t), Se?.(t, e);
|
|
35
|
+
}, J = g(null), Te = a(k, J), Ee = h(() => T ? B.map((e) => e.node.id) : void 0, [T, B]), Y = s({
|
|
36
|
+
enabled: T,
|
|
37
|
+
count: B.length,
|
|
38
|
+
scrollRef: J,
|
|
39
|
+
estimate: ce,
|
|
40
|
+
measure: !0,
|
|
41
|
+
keys: Ee,
|
|
42
|
+
fallbackViewHeight: v
|
|
43
|
+
}), X = g(null);
|
|
44
|
+
ae(() => {
|
|
45
|
+
let e = X.current, t = e === null ? void 0 : R.current.get(e);
|
|
46
|
+
t && (X.current = null, t.focus());
|
|
47
|
+
});
|
|
48
|
+
let Z = (e) => {
|
|
49
|
+
L(e);
|
|
50
|
+
let t = R.current.get(e);
|
|
51
|
+
if (T) {
|
|
52
|
+
let t = H.get(e)?.index;
|
|
53
|
+
t !== void 0 && Y.scrollToIndex(t);
|
|
54
|
+
}
|
|
55
|
+
t ? t.focus() : X.current = e;
|
|
56
|
+
}, De = (e) => {
|
|
57
|
+
if (A?.(e), e.defaultPrevented || e.altKey || e.ctrlKey || e.metaKey) return;
|
|
58
|
+
let t = V;
|
|
33
59
|
if (t === null) return;
|
|
34
|
-
let r = e.target.getAttribute("role") === "treeitem",
|
|
35
|
-
if (!r && (
|
|
36
|
-
if (
|
|
60
|
+
let r = e.target.getAttribute("role") === "treeitem", a = e.key === "Enter" || e.key === " ";
|
|
61
|
+
if (!r && (a || n(e.key))) return;
|
|
62
|
+
if (c.has(e.key)) {
|
|
37
63
|
e.preventDefault();
|
|
38
|
-
let n =
|
|
39
|
-
key: e
|
|
40
|
-
nodes:
|
|
41
|
-
visible:
|
|
64
|
+
let n = d({
|
|
65
|
+
key: i(e),
|
|
66
|
+
nodes: y,
|
|
67
|
+
visible: B,
|
|
42
68
|
focusId: t,
|
|
43
|
-
expanded:
|
|
69
|
+
expanded: F
|
|
44
70
|
});
|
|
45
71
|
if (!n) return;
|
|
46
72
|
switch (n.type) {
|
|
47
73
|
case "focus":
|
|
48
|
-
|
|
74
|
+
Z(n.id);
|
|
49
75
|
break;
|
|
50
76
|
case "select": {
|
|
51
|
-
let e =
|
|
52
|
-
e &&
|
|
77
|
+
let e = H.get(n.id)?.node;
|
|
78
|
+
e && q(e);
|
|
53
79
|
break;
|
|
54
80
|
}
|
|
55
81
|
case "expand": {
|
|
56
|
-
let e =
|
|
57
|
-
e &&
|
|
82
|
+
let e = H.get(n.id)?.node;
|
|
83
|
+
e && G(e);
|
|
58
84
|
break;
|
|
59
85
|
}
|
|
60
86
|
case "collapse": {
|
|
61
|
-
let e =
|
|
62
|
-
e &&
|
|
87
|
+
let e = H.get(n.id)?.node;
|
|
88
|
+
e && K(e);
|
|
63
89
|
break;
|
|
64
90
|
}
|
|
65
91
|
case "expandMany": {
|
|
66
|
-
let e = n.ids.filter((e) => !
|
|
67
|
-
|
|
92
|
+
let e = n.ids.filter((e) => !F.includes(e)), t = e.flatMap((e) => H.get(e)?.node ?? []);
|
|
93
|
+
U([...F, ...e], t);
|
|
68
94
|
break;
|
|
69
95
|
}
|
|
70
96
|
}
|
|
71
97
|
return;
|
|
72
98
|
}
|
|
73
|
-
if (!
|
|
74
|
-
let o =
|
|
99
|
+
if (!n(e.key)) return;
|
|
100
|
+
let o = H.get(t)?.index;
|
|
75
101
|
if (o === void 0) return;
|
|
76
|
-
let s =
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
102
|
+
let s = ee(B, o, z(e.key));
|
|
103
|
+
s && (e.preventDefault(), Z(s));
|
|
104
|
+
}, Oe = (e) => {
|
|
105
|
+
if (j?.(e), T && e.target === e.currentTarget && V !== null) {
|
|
106
|
+
Z(V);
|
|
107
|
+
return;
|
|
108
|
+
}
|
|
82
109
|
let t = e.target.dataset.treeId;
|
|
83
|
-
t !== void 0 &&
|
|
84
|
-
},
|
|
85
|
-
let
|
|
86
|
-
if (!
|
|
87
|
-
let
|
|
88
|
-
return /* @__PURE__ */
|
|
110
|
+
t !== void 0 && L(t);
|
|
111
|
+
}, Q = (e, n) => {
|
|
112
|
+
let r = H.get(e.id);
|
|
113
|
+
if (!r) return null;
|
|
114
|
+
let i = u(e), a = i && F.includes(e.id), o = I.includes(e.id), s = i && e.loading === !0, c = `${P}-l-${r.index}`, l = `${P}-w-${r.index}`;
|
|
115
|
+
return /* @__PURE__ */ m("li", {
|
|
89
116
|
ref: (t) => {
|
|
90
|
-
t ?
|
|
117
|
+
t ? R.current.set(e.id, t) : R.current.delete(e.id);
|
|
91
118
|
},
|
|
92
119
|
role: "treeitem",
|
|
93
120
|
"data-tree-id": e.id,
|
|
121
|
+
"data-vindex": n,
|
|
94
122
|
className: t("kapi-tree__item", o && "kapi-tree__item--selected", a && "kapi-tree__item--open"),
|
|
95
123
|
"aria-labelledby": c,
|
|
96
124
|
"aria-describedby": s ? l : void 0,
|
|
97
|
-
"aria-level":
|
|
98
|
-
"aria-setsize":
|
|
99
|
-
"aria-posinset":
|
|
100
|
-
"aria-expanded":
|
|
125
|
+
"aria-level": r.level,
|
|
126
|
+
"aria-setsize": r.setSize,
|
|
127
|
+
"aria-posinset": r.posInSet,
|
|
128
|
+
"aria-expanded": i ? a : void 0,
|
|
101
129
|
"aria-selected": o,
|
|
102
130
|
"aria-disabled": e.disabled || void 0,
|
|
103
131
|
"aria-busy": s || void 0,
|
|
104
|
-
tabIndex:
|
|
105
|
-
children: [/* @__PURE__ */
|
|
132
|
+
tabIndex: V === e.id ? 0 : -1,
|
|
133
|
+
children: [/* @__PURE__ */ m("div", {
|
|
106
134
|
className: "kapi-tree__row",
|
|
107
|
-
style: { "--kapi-tree-level":
|
|
108
|
-
onClick: () =>
|
|
135
|
+
style: { "--kapi-tree-level": r.level },
|
|
136
|
+
onClick: () => q(e),
|
|
109
137
|
children: [
|
|
110
|
-
|
|
138
|
+
i ? /* @__PURE__ */ p("span", {
|
|
111
139
|
className: "kapi-tree__toggle",
|
|
112
140
|
"aria-hidden": "true",
|
|
113
141
|
onClick: (t) => {
|
|
114
|
-
t.stopPropagation(),
|
|
142
|
+
t.stopPropagation(), we(e);
|
|
115
143
|
},
|
|
116
|
-
children: /* @__PURE__ */
|
|
117
|
-
className: "kapi-tree__chevron",
|
|
144
|
+
children: /* @__PURE__ */ p(se, {
|
|
145
|
+
className: "kapi-tree__chevron kapi-flip-rtl",
|
|
118
146
|
size: 16,
|
|
119
147
|
strokeWidth: 2.2
|
|
120
148
|
})
|
|
121
|
-
}) : /* @__PURE__ */
|
|
149
|
+
}) : /* @__PURE__ */ p("span", {
|
|
122
150
|
className: "kapi-tree__toggle kapi-tree__toggle--leaf",
|
|
123
151
|
"aria-hidden": "true"
|
|
124
152
|
}),
|
|
125
|
-
/* @__PURE__ */
|
|
153
|
+
/* @__PURE__ */ p("span", {
|
|
126
154
|
id: c,
|
|
127
155
|
className: "kapi-tree__label",
|
|
128
|
-
children:
|
|
156
|
+
children: w ? w(e) : e.label
|
|
129
157
|
}),
|
|
130
|
-
s && /* @__PURE__ */ f
|
|
158
|
+
s && /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ p("span", {
|
|
131
159
|
className: "kapi-tree__spinner kapi-spinner kapi-spinner--sm",
|
|
132
160
|
"aria-hidden": "true"
|
|
133
|
-
}), /* @__PURE__ */
|
|
161
|
+
}), /* @__PURE__ */ p("span", {
|
|
134
162
|
id: l,
|
|
135
163
|
className: "kapi-tree__sr",
|
|
136
|
-
children:
|
|
164
|
+
children: N.loading
|
|
137
165
|
})] })
|
|
138
166
|
]
|
|
139
|
-
}), a && e.children?.length ? /* @__PURE__ */
|
|
167
|
+
}), n === void 0 && a && e.children?.length ? /* @__PURE__ */ p("ul", {
|
|
140
168
|
role: "group",
|
|
141
169
|
className: "kapi-tree__group",
|
|
142
170
|
children: $(e.children)
|
|
143
171
|
}) : null]
|
|
144
172
|
}, e.id);
|
|
145
|
-
})
|
|
146
|
-
|
|
147
|
-
|
|
173
|
+
}, $ = (e) => e.map((e) => Q(e)), ke = () => /* @__PURE__ */ m(f, { children: [
|
|
174
|
+
Y.padTop > 0 && /* @__PURE__ */ p("li", {
|
|
175
|
+
role: "none",
|
|
176
|
+
"aria-hidden": !0,
|
|
177
|
+
className: "kapi-tree__pad",
|
|
178
|
+
style: { height: Y.padTop }
|
|
179
|
+
}),
|
|
180
|
+
B.slice(Y.start, Y.end).map((e, t) => Q(e.node, Y.start + t)),
|
|
181
|
+
Y.padBottom > 0 && /* @__PURE__ */ p("li", {
|
|
182
|
+
role: "none",
|
|
183
|
+
"aria-hidden": !0,
|
|
184
|
+
className: "kapi-tree__pad",
|
|
185
|
+
style: { height: Y.padBottom }
|
|
186
|
+
})
|
|
187
|
+
] }), Ae = !T || (() => {
|
|
188
|
+
let e = V === null ? void 0 : H.get(V)?.index;
|
|
189
|
+
return e === void 0 || e >= Y.start && e < Y.end;
|
|
190
|
+
})();
|
|
191
|
+
return /* @__PURE__ */ p("ul", {
|
|
192
|
+
...M,
|
|
148
193
|
role: "tree",
|
|
149
|
-
"aria-multiselectable":
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
194
|
+
"aria-multiselectable": C || void 0,
|
|
195
|
+
ref: T ? Te : k,
|
|
196
|
+
className: t("kapi-tree", T && "kapi-tree--virtual", D),
|
|
197
|
+
style: T ? {
|
|
198
|
+
maxHeight: E,
|
|
199
|
+
...O
|
|
200
|
+
} : O,
|
|
201
|
+
...Ae ? {} : { tabIndex: 0 },
|
|
202
|
+
onKeyDown: De,
|
|
203
|
+
onFocus: Oe,
|
|
204
|
+
onScroll: T ? Y.onScroll : void 0,
|
|
205
|
+
children: T ? ke() : $(y)
|
|
154
206
|
});
|
|
155
207
|
}
|
|
156
208
|
//#endregion
|
|
157
|
-
export {
|
|
209
|
+
export { _ as DEFAULT_TREE_LABELS, y as KapiTree };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { type HTMLAttributes, type ReactNode } from "react";
|
|
2
|
-
import type { KapiLabelsOverride } from "../labelsLogic";
|
|
1
|
+
import { type HTMLAttributes, type ReactNode, type Ref } from "react";
|
|
2
|
+
import type { KapiLabelsOverride } from "../labelsLogic.js";
|
|
3
3
|
export type KapiWizardStep = {
|
|
4
4
|
title: string;
|
|
5
5
|
desc?: ReactNode | undefined;
|
|
@@ -24,14 +24,24 @@ export type KapiWizardLabels = {
|
|
|
24
24
|
export declare const DEFAULT_WIZARD_LABELS: KapiWizardLabels;
|
|
25
25
|
/** Atributos nativos (`id`, `style`, `data-*`…) van al contenedor del wizard. */
|
|
26
26
|
export type KapiWizardProps = Omit<HTMLAttributes<HTMLDivElement>, "children"> & {
|
|
27
|
+
/** Ref al `<div>` raíz del asistente. */
|
|
28
|
+
ref?: Ref<HTMLDivElement> | undefined;
|
|
27
29
|
/** Pasos, en orden; cada uno con título, contenido y `validate` opcional. */
|
|
28
|
-
steps: KapiWizardStep[];
|
|
30
|
+
steps: readonly KapiWizardStep[];
|
|
29
31
|
/** Disposición del indicador de pasos. */
|
|
30
|
-
orientation?: KapiWizardOrientation;
|
|
32
|
+
orientation?: KapiWizardOrientation | undefined;
|
|
31
33
|
/** Se dispara con el botón del último paso (si su `validate` lo permite). */
|
|
32
|
-
onFinish?: () => void;
|
|
33
|
-
/**
|
|
34
|
-
|
|
34
|
+
onFinish?: (() => void) | undefined;
|
|
35
|
+
/**
|
|
36
|
+
* Se dispara con «Cancelar» (el botón del primer paso): el consumidor cierra el flujo (p. ej. el modal
|
|
37
|
+
* que lo contiene), igual que el `onClose` de los overlays.
|
|
38
|
+
*/
|
|
39
|
+
onClose?: (() => void) | undefined;
|
|
40
|
+
/**
|
|
41
|
+
* Nombre anterior de `onClose`; si llegan los dos, solo se llama a `onClose`.
|
|
42
|
+
* @deprecated Usar `onClose` (la convención no usa `onCancel`).
|
|
43
|
+
*/
|
|
44
|
+
onCancel?: (() => void) | undefined;
|
|
35
45
|
/** Contenido del botón final; gana sobre `labels.finish`. Lo mismo `cancelLabel`, `backLabel` y `nextLabel`. */
|
|
36
46
|
finishLabel?: ReactNode;
|
|
37
47
|
/** Contenido del botón de cancelar (primer paso); gana sobre `labels.cancel`. */
|
|
@@ -43,14 +53,14 @@ export type KapiWizardProps = Omit<HTMLAttributes<HTMLDivElement>, "children"> &
|
|
|
43
53
|
/** Textos fijos de los botones (clave `wizard`). */
|
|
44
54
|
labels?: KapiLabelsOverride<KapiWizardLabels> | undefined;
|
|
45
55
|
/** Paso actual (controlado). Si se omite, el wizard maneja su propio estado. */
|
|
46
|
-
step?: number;
|
|
56
|
+
step?: number | undefined;
|
|
47
57
|
/** Paso inicial no controlado. */
|
|
48
|
-
defaultStep?: number;
|
|
58
|
+
defaultStep?: number | undefined;
|
|
49
59
|
/** Se llama en cada cambio de paso (controlado o no). */
|
|
50
|
-
onStepChange?: (step: number) => void;
|
|
60
|
+
onStepChange?: ((step: number) => void) | undefined;
|
|
51
61
|
};
|
|
52
62
|
/**
|
|
53
63
|
* Form por pasos, inline (para modal, metelo dentro de un modal). Sólo se retrocede por click
|
|
54
64
|
* en un paso; "Siguiente" respeta `validate()`; el primer paso muestra "Cancelar".
|
|
55
65
|
*/
|
|
56
|
-
export declare const KapiWizard: ({ steps, orientation, onFinish, onCancel, finishLabel, cancelLabel, backLabel, nextLabel, labels, step, defaultStep, onStepChange, className, ...rest }: KapiWizardProps) => import("react").JSX.Element | null;
|
|
66
|
+
export declare const KapiWizard: ({ steps, orientation, onFinish, onClose, onCancel, finishLabel, cancelLabel, backLabel, nextLabel, labels, step, defaultStep, onStepChange, className, ...rest }: KapiWizardProps) => import("react").JSX.Element | null;
|