@kapiuara/ui 0.23.0 → 0.23.1
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/dist/components/chat/KapiChatDivider.js +1 -2
- package/dist/components/chat/KapiChatList.js +15 -16
- package/dist/components/chat/KapiChatThread.js +21 -22
- package/dist/components/chat/KapiComposer.js +23 -24
- package/dist/components/chat/KapiMessageBubble.js +5 -6
- package/dist/components/chat/KapiTypingIndicator.js +5 -6
- package/dist/components/chat/chatLogic.js +1 -2
- package/dist/components/data/KapiBarChart.js +22 -23
- package/dist/components/data/KapiDataTable.js +92 -93
- package/dist/components/data/KapiEventCalendar.js +96 -97
- package/dist/components/data/KapiHeatmap.js +21 -22
- package/dist/components/data/KapiLineChart.js +23 -24
- package/dist/components/data/KapiPagination.js +1 -2
- package/dist/components/data/KapiPaginationFooter.js +5 -6
- package/dist/components/data/KapiScatterChart.js +18 -19
- package/dist/components/data/KapiSheet.js +2 -3
- package/dist/components/data/KapiSparkline.js +1 -2
- package/dist/components/data/KapiTable.js +107 -108
- package/dist/components/data/KapiTableFilter.js +13 -14
- package/dist/components/data/KapiTableFooter.js +21 -22
- package/dist/components/data/KapiTableRow.js +10 -11
- package/dist/components/data/KapiTableToolbar.js +95 -96
- package/dist/components/data/barChartLogic.js +1 -2
- package/dist/components/data/chartFrame.js +13 -14
- package/dist/components/data/datasetSelectionLogic.js +1 -2
- package/dist/components/data/eventCalendarLogic.js +2 -3
- package/dist/components/data/heatmapLogic.js +1 -2
- package/dist/components/data/lineChartLogic.js +1 -2
- package/dist/components/data/rowClickLogic.js +2 -17
- package/dist/components/data/scatterLogic.js +1 -2
- package/dist/components/data/sparklineLogic.js +1 -2
- package/dist/components/data/tableCells.js +14 -15
- package/dist/components/data/tableHeaderMenu.js +1 -2
- package/dist/components/data/tableLabels.js +1 -2
- package/dist/components/data/tableLogic.js +0 -1
- package/dist/components/data/tablePaginationLogic.js +1 -2
- package/dist/components/data/tableResizeLogic.js +1 -2
- package/dist/components/data/tableSlots.js +1 -2
- package/dist/components/data/tableSpanLogic.js +1 -2
- package/dist/components/data/useColumnResize.js +23 -24
- package/dist/components/data/useRowKeyWarning.js +1 -2
- package/dist/components/data/useTableEdges.js +1 -2
- package/dist/components/data/useTableSelection.js +25 -26
- package/dist/components/display/KapiAnchor.js +7 -8
- package/dist/components/display/KapiAnnotation.js +15 -16
- package/dist/components/display/KapiAvatar.js +6 -7
- package/dist/components/display/KapiAvatarGroup.js +15 -16
- package/dist/components/display/KapiBadge.js +1 -2
- package/dist/components/display/KapiCodeBlock.js +14 -15
- package/dist/components/display/KapiComment.js +10 -11
- package/dist/components/display/KapiCommentComposer.js +13 -14
- package/dist/components/display/KapiDescriptionList.js +1 -2
- package/dist/components/display/KapiDiff.js +23 -24
- package/dist/components/display/KapiFileItem.js +13 -14
- package/dist/components/display/KapiFileViewer.js +17 -18
- package/dist/components/display/KapiHighlight.js +2 -3
- package/dist/components/display/KapiIconTile.js +2 -3
- package/dist/components/display/KapiStat.js +8 -9
- package/dist/components/display/KapiTag.js +6 -7
- package/dist/components/display/KapiText.js +5 -6
- package/dist/components/display/KapiTimeline.js +2 -3
- package/dist/components/display/KapiTitle.js +1 -2
- package/dist/components/display/KapiTruncate.js +5 -6
- package/dist/components/display/annotationLogic.js +1 -2
- package/dist/components/display/avatarGroupLogic.js +1 -2
- package/dist/components/display/avatarGroupSlots.js +1 -2
- package/dist/components/display/avatarLogic.js +1 -2
- package/dist/components/display/codeBlockSlots.js +1 -2
- package/dist/components/display/commentLogic.js +1 -2
- package/dist/components/display/diffLogic.js +1 -2
- package/dist/components/display/diffSlots.js +1 -2
- package/dist/components/display/fileItemLogic.js +1 -2
- package/dist/components/display/highlightLogic.js +1 -2
- package/dist/components/display/highlightSlots.js +1 -2
- package/dist/components/display/iconTileLogic.js +1 -2
- package/dist/components/display/statLogic.js +1 -2
- package/dist/components/display/tagLogic.js +1 -2
- package/dist/components/display/textLogic.js +1 -2
- package/dist/components/display/timelineLogic.js +1 -2
- package/dist/components/display/truncateLogic.js +1 -2
- package/dist/components/feedback/KapiAlert.js +6 -7
- package/dist/components/feedback/KapiBulkBar.js +5 -6
- package/dist/components/feedback/KapiCountdown.js +16 -17
- package/dist/components/feedback/KapiEmpty.js +2 -3
- package/dist/components/feedback/KapiFab.js +96 -97
- package/dist/components/feedback/KapiOfflineBanner.js +4 -5
- package/dist/components/feedback/KapiProgress.js +1 -2
- package/dist/components/feedback/KapiSkeleton.js +1 -2
- package/dist/components/feedback/KapiSpinner.js +5 -6
- package/dist/components/feedback/KapiToastContainer.js +28 -29
- package/dist/components/feedback/KapiTour.js +24 -25
- package/dist/components/feedback/KapiUnsavedBar.js +5 -6
- package/dist/components/feedback/alertSlots.js +1 -2
- package/dist/components/feedback/bulkBarLogic.js +1 -2
- package/dist/components/feedback/countdownLogic.js +1 -2
- package/dist/components/feedback/countdownSlots.js +1 -2
- package/dist/components/feedback/emptySlots.js +1 -2
- package/dist/components/feedback/fabLogic.js +1 -2
- package/dist/components/feedback/offlineBannerLogic.js +1 -2
- package/dist/components/feedback/progressLogic.js +1 -2
- package/dist/components/feedback/toastLayer.js +1 -2
- package/dist/components/feedback/toastStore.js +2 -3
- package/dist/components/feedback/tourLogic.js +1 -2
- package/dist/components/feedback/unsavedBarLogic.js +1 -2
- package/dist/components/inputs/KapiAutocomplete.js +23 -24
- package/dist/components/inputs/KapiButton.js +1 -2
- package/dist/components/inputs/KapiCalendar.js +12 -13
- package/dist/components/inputs/KapiCalendarGrid.js +15 -16
- package/dist/components/inputs/KapiCheckCard.js +4 -5
- package/dist/components/inputs/KapiCheckbox.js +1 -2
- package/dist/components/inputs/KapiChecklist.js +62 -63
- package/dist/components/inputs/KapiCopyButton.js +6 -7
- package/dist/components/inputs/KapiDatePicker.js +33 -34
- package/dist/components/inputs/KapiDateRangePicker.js +145 -146
- package/dist/components/inputs/KapiFacetedSearch.js +55 -56
- package/dist/components/inputs/KapiField.js +5 -6
- package/dist/components/inputs/KapiFileUpload.js +26 -27
- package/dist/components/inputs/KapiIconButton.js +1 -2
- package/dist/components/inputs/KapiInput.js +46 -47
- package/dist/components/inputs/KapiInputGroup.js +1 -2
- package/dist/components/inputs/KapiMaskedInput.js +50 -51
- package/dist/components/inputs/KapiNumberStepper.js +49 -50
- package/dist/components/inputs/KapiPinInput.js +9 -10
- package/dist/components/inputs/KapiPropsForm.js +43 -44
- package/dist/components/inputs/KapiRadio.js +1 -2
- package/dist/components/inputs/KapiRating.js +38 -39
- package/dist/components/inputs/KapiSearchChip.js +10 -11
- package/dist/components/inputs/KapiSegmented.js +65 -66
- package/dist/components/inputs/KapiSelect.js +198 -199
- package/dist/components/inputs/KapiSelectMenu.js +1 -2
- package/dist/components/inputs/KapiSlider.js +11 -12
- package/dist/components/inputs/KapiSwitch.js +6 -7
- package/dist/components/inputs/KapiTagInput.js +32 -33
- package/dist/components/inputs/KapiTextarea.js +22 -23
- package/dist/components/inputs/asyncSelectLogic.js +22 -23
- package/dist/components/inputs/autocompleteLogic.js +1 -2
- package/dist/components/inputs/checkControl.js +4 -5
- package/dist/components/inputs/checklistLogic.js +1 -2
- package/dist/components/inputs/copyLogic.js +1 -2
- package/dist/components/inputs/datePickerLogic.js +1 -2
- package/dist/components/inputs/dateRangeLogic.js +1 -2
- package/dist/components/inputs/facetedSearchLogic.js +1 -2
- package/dist/components/inputs/fieldLogic.js +1 -2
- package/dist/components/inputs/fileUploadLogic.js +1 -2
- package/dist/components/inputs/formBridgeLogic.js +1 -2
- package/dist/components/inputs/inputGroupLogic.js +1 -2
- package/dist/components/inputs/inputLogic.js +1 -2
- package/dist/components/inputs/maskLogic.js +0 -1
- package/dist/components/inputs/misuseWarnings.js +1 -2
- package/dist/components/inputs/numberStepLogic.js +1 -2
- package/dist/components/inputs/ownField.js +9 -10
- package/dist/components/inputs/pinInputLogic.js +1 -2
- package/dist/components/inputs/propsFormLogic.js +1 -2
- package/dist/components/inputs/ratingLogic.js +1 -2
- package/dist/components/inputs/searchChipLogic.js +1 -2
- package/dist/components/inputs/segmentedLogic.js +1 -2
- package/dist/components/inputs/selectKeyLogic.js +1 -2
- package/dist/components/inputs/selectLogic.js +1 -2
- package/dist/components/inputs/selectSlots.js +1 -2
- package/dist/components/inputs/sliderLogic.js +1 -2
- package/dist/components/inputs/tagInputLogic.js +1 -2
- package/dist/components/inputs/textareaLogic.js +1 -2
- package/dist/components/inputs/useCalendarFocus.js +1 -2
- package/dist/components/inputs/useDatePopSide.js +1 -2
- package/dist/components/inputs/useSelectCreate.js +1 -2
- package/dist/components/inputs/useSelectSource.js +11 -12
- package/dist/components/labelsLogic.js +1 -2
- package/dist/components/layout/KapiAccessCard.js +10 -11
- package/dist/components/layout/KapiAccountMenu.js +24 -25
- package/dist/components/layout/KapiBox.js +5 -6
- package/dist/components/layout/KapiCard.js +18 -19
- package/dist/components/layout/KapiCenter.js +1 -2
- package/dist/components/layout/KapiCluster.js +1 -2
- package/dist/components/layout/KapiCol.js +1 -2
- package/dist/components/layout/KapiCollapse.js +1 -2
- package/dist/components/layout/KapiContextSlot.js +98 -99
- package/dist/components/layout/KapiDivider.js +1 -2
- package/dist/components/layout/KapiGrid.js +9 -10
- package/dist/components/layout/KapiMasonry.js +1 -2
- package/dist/components/layout/KapiNotificationBell.js +53 -54
- package/dist/components/layout/KapiPageHeader.js +42 -43
- package/dist/components/layout/KapiPanelParts.js +43 -44
- package/dist/components/layout/KapiRail.js +103 -104
- package/dist/components/layout/KapiRailAccount.js +11 -12
- package/dist/components/layout/KapiRoot.js +33 -34
- package/dist/components/layout/KapiScrollArea.js +7 -8
- package/dist/components/layout/KapiShell.js +8 -9
- package/dist/components/layout/KapiStack.js +1 -2
- package/dist/components/layout/KapiThemeScript.js +1 -2
- package/dist/components/layout/accessCardLogic.js +1 -2
- package/dist/components/layout/cardLogic.js +1 -2
- package/dist/components/layout/cardSlots.js +1 -2
- package/dist/components/layout/gridSpanLogic.js +1 -2
- package/dist/components/layout/layoutPrimitives.js +1 -2
- package/dist/components/layout/masonryLogic.js +1 -2
- package/dist/components/layout/notificationBellLogic.js +1 -2
- package/dist/components/layout/pageHeaderLogic.js +1 -2
- package/dist/components/layout/pageHeaderSlots.js +1 -2
- package/dist/components/layout/railContext.js +1 -2
- package/dist/components/layout/railLogic.js +1 -2
- package/dist/components/layout/railSlots.js +1 -2
- package/dist/components/layout/reopenBus.js +1 -2
- package/dist/components/layout/shellSlots.js +1 -2
- package/dist/components/layout/useGridBreakpoint.js +1 -2
- package/dist/components/layout/useMasonrySpans.js +6 -7
- package/dist/components/layout/useRailOverflow.js +7 -8
- package/dist/components/locale/KapiLocaleProvider.js +1 -2
- package/dist/components/locale/linkLabels.js +1 -2
- package/dist/components/locale/localeLogic.js +1 -2
- package/dist/components/navigation/CtxSlidingList.js +7 -8
- package/dist/components/navigation/KapiAccordion.js +11 -12
- package/dist/components/navigation/KapiBreadcrumb.js +11 -12
- package/dist/components/navigation/KapiCollapsiblePanel.js +13 -14
- package/dist/components/navigation/KapiContextPanel.js +138 -139
- package/dist/components/navigation/KapiFilterChips.js +25 -22
- package/dist/components/navigation/KapiNavBadge.js +6 -7
- package/dist/components/navigation/KapiPanelGroup.js +34 -35
- package/dist/components/navigation/KapiSteps.js +41 -36
- package/dist/components/navigation/KapiTabs.js +40 -41
- package/dist/components/navigation/KapiToc.js +15 -16
- package/dist/components/navigation/KapiTree.js +126 -124
- package/dist/components/navigation/KapiWizard.js +12 -13
- package/dist/components/navigation/MiniNavItem.js +11 -12
- package/dist/components/navigation/accordionLogic.js +1 -2
- package/dist/components/navigation/activeItemLogic.js +1 -2
- package/dist/components/navigation/breadcrumbLogic.js +1 -2
- package/dist/components/navigation/contextPanelLogic.js +1 -2
- package/dist/components/navigation/filterChipsLogic.d.ts +9 -1
- package/dist/components/navigation/filterChipsLogic.js +2 -3
- package/dist/components/navigation/navBadgeLogic.js +1 -2
- package/dist/components/navigation/navLink.js +1 -2
- package/dist/components/navigation/navLinkLogic.js +1 -2
- package/dist/components/navigation/panelGroupLogic.js +1 -2
- package/dist/components/navigation/panelMini.js +0 -1
- package/dist/components/navigation/panelMiniLogic.js +1 -2
- package/dist/components/navigation/stepsLogic.js +1 -2
- package/dist/components/navigation/tabsLogic.js +1 -2
- package/dist/components/navigation/tocLogic.js +1 -2
- package/dist/components/navigation/tocSlots.js +1 -2
- package/dist/components/navigation/treeLogic.js +1 -2
- package/dist/components/navigation/wizardLogic.js +1 -2
- package/dist/components/overlays/KapiCanvasForm.js +5 -6
- package/dist/components/overlays/KapiCommandPalette.js +45 -45
- package/dist/components/overlays/KapiConfirm.js +9 -10
- package/dist/components/overlays/KapiContextMenu.js +16 -17
- package/dist/components/overlays/KapiDialogHost.js +50 -51
- package/dist/components/overlays/KapiDropdown.js +2 -3
- package/dist/components/overlays/KapiImageViewer.js +8 -9
- package/dist/components/overlays/KapiLoading.js +7 -8
- package/dist/components/overlays/KapiMenuButton.js +19 -20
- package/dist/components/overlays/KapiModal.js +58 -59
- package/dist/components/overlays/KapiOffcanvas.js +146 -147
- package/dist/components/overlays/KapiOffcanvasStack.js +18 -19
- package/dist/components/overlays/KapiPhotoView.js +21 -22
- package/dist/components/overlays/KapiPopover.js +12 -13
- package/dist/components/overlays/KapiShapeSheet.js +11 -12
- package/dist/components/overlays/KapiShortcutsHelp.js +18 -19
- package/dist/components/overlays/KapiSplitModal.js +20 -21
- package/dist/components/overlays/KapiTooltip.js +46 -47
- package/dist/components/overlays/KapiViewport.js +17 -18
- package/dist/components/overlays/canvasFormLogic.js +1 -2
- package/dist/components/overlays/commandPaletteLogic.js +1 -2
- package/dist/components/overlays/dialogStore.js +3 -4
- package/dist/components/overlays/dialogUtils.js +1 -2
- package/dist/components/overlays/exitPresenceLogic.js +1 -2
- package/dist/components/overlays/menuButtonLogic.js +1 -2
- package/dist/components/overlays/menuKeyboardLogic.js +1 -2
- package/dist/components/overlays/menuList.js +94 -95
- package/dist/components/overlays/modalSlots.js +1 -2
- package/dist/components/overlays/modalStack.js +1 -2
- package/dist/components/overlays/offcanvasCompanion.js +1 -2
- package/dist/components/overlays/offcanvasResize.js +0 -1
- package/dist/components/overlays/offcanvasSide.js +1 -2
- package/dist/components/overlays/offcanvasStack.js +1 -2
- package/dist/components/overlays/overlayPortal.js +1 -2
- package/dist/components/overlays/popoverLogic.js +1 -2
- package/dist/components/overlays/shortcutsHelpSlots.js +1 -2
- package/dist/components/overlays/splitModalLayout.js +1 -2
- package/dist/components/overlays/useExitPresence.js +11 -12
- package/dist/components/overlays/useNativeDialog.js +21 -22
- package/dist/components/overlays/viewportLogic.js +1 -2
- package/dist/components/renderSlot.js +1 -2
- package/dist/components/rootProps.js +1 -2
- package/dist/components/slotCatalog.js +33 -34
- package/dist/components/slotsLogic.js +1 -2
- package/dist/components/tone.js +1 -2
- package/dist/css/components/overlays/KapiViewport.css +1 -1
- package/dist/hooks/asyncResourceLogic.js +1 -2
- package/dist/hooks/breakpointOpenLogic.js +1 -2
- package/dist/hooks/colorLogic.js +1 -2
- package/dist/hooks/dateFormat.js +1 -2
- package/dist/hooks/densityLogic.js +1 -2
- package/dist/hooks/directionLogic.js +1 -2
- package/dist/hooks/downloadLogic.js +1 -2
- package/dist/hooks/elementSizeLogic.js +1 -2
- package/dist/hooks/fieldErrorsLogic.js +1 -2
- package/dist/hooks/focusLogic.js +2 -11
- package/dist/hooks/growOriginLogic.js +1 -2
- package/dist/hooks/hotkeyLogic.js +1 -2
- package/dist/hooks/hotkeyRegistry.js +1 -2
- package/dist/hooks/kapiRoot.js +2 -3
- package/dist/hooks/mergeRefs.js +1 -2
- package/dist/hooks/numberFormatLogic.js +1 -2
- package/dist/hooks/onlineStatusLogic.js +1 -2
- package/dist/hooks/ownerDocument.js +1 -2
- package/dist/hooks/persistentStateLogic.js +1 -2
- package/dist/hooks/portalRoot.js +1 -2
- package/dist/hooks/rafThrottle.js +1 -2
- package/dist/hooks/rangeSelectLogic.js +1 -2
- package/dist/hooks/recentLogic.js +1 -2
- package/dist/hooks/reducedMotion.js +8 -9
- package/dist/hooks/rightClick.js +10 -11
- package/dist/hooks/scrollCollapseLogic.js +1 -2
- package/dist/hooks/scrollEdgesLogic.js +1 -2
- package/dist/hooks/shallowStable.js +1 -2
- package/dist/hooks/slidingIndicatorLogic.js +1 -2
- package/dist/hooks/storageLogic.js +1 -2
- package/dist/hooks/themeColorsLogic.js +1 -2
- package/dist/hooks/themeContrastLogic.js +1 -2
- package/dist/hooks/themeDeriveLogic.js +0 -1
- package/dist/hooks/themeRadiiLogic.js +1 -2
- package/dist/hooks/themeScript.js +1 -2
- package/dist/hooks/toneFamilyLogic.js +1 -2
- package/dist/hooks/unsavedGuardLogic.js +1 -2
- package/dist/hooks/useAsyncLoader.js +1 -2
- package/dist/hooks/useAsyncResource.js +5 -6
- package/dist/hooks/useAsyncTasks.js +1 -2
- package/dist/hooks/useBottomBarInset.js +9 -10
- package/dist/hooks/useControllableState.js +1 -2
- package/dist/hooks/useDebouncedValue.js +1 -2
- package/dist/hooks/useDisclosure.js +1 -2
- package/dist/hooks/useDismiss.js +10 -11
- package/dist/hooks/useDragScroll.js +12 -13
- package/dist/hooks/useElementSize.js +1 -2
- package/dist/hooks/useFieldErrors.js +1 -2
- package/dist/hooks/useFocusReturn.js +1 -2
- package/dist/hooks/useFormReset.js +1 -2
- package/dist/hooks/useGlobalRightClick.js +1 -2
- package/dist/hooks/useGrowOrigin.js +1 -2
- package/dist/hooks/useHotkey.js +1 -2
- package/dist/hooks/useHydrated.js +1 -2
- package/dist/hooks/useKapiTheme.js +55 -56
- package/dist/hooks/useMediaQuery.js +1 -2
- package/dist/hooks/useObjectUrl.js +1 -2
- package/dist/hooks/useOnlineStatus.js +1 -2
- package/dist/hooks/useOutsidePress.js +1 -2
- package/dist/hooks/usePersistentState.js +9 -10
- package/dist/hooks/usePlacement.js +15 -16
- package/dist/hooks/useRangeSelect.js +2 -3
- package/dist/hooks/useRecent.js +6 -7
- package/dist/hooks/useScrollCollapse.js +1 -2
- package/dist/hooks/useScrollEdges.js +25 -26
- package/dist/hooks/useSlidingIndicator.js +19 -20
- package/dist/hooks/useSubmitDraft.js +1 -2
- package/dist/hooks/useToneFamilies.js +0 -1
- package/dist/hooks/useTypeahead.js +1 -2
- package/dist/hooks/useUnsavedGuard.js +5 -6
- package/dist/hooks/useVirtualList.js +1 -2
- package/dist/hooks/useWheelZoom.js +1 -2
- package/dist/hooks/viewportInsetLogic.js +1 -2
- package/dist/hooks/virtualListLogic.js +0 -1
- package/dist/hooks/wheelZoomLogic.js +1 -2
- package/dist/kapi.css +1 -1
- package/dist/kapi.layered.css +1 -1
- package/dist/logic.js +45 -45
- package/package.json +16 -16
|
@@ -2,24 +2,20 @@
|
|
|
2
2
|
import "#kapi-css/components/inputs/checkControl.css";
|
|
3
3
|
import "#kapi-css/components/overlays/overlays.css";
|
|
4
4
|
import "#kapi-css/components/data/KapiTable.css";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import { KapiBulkBar as Me } from "../feedback/KapiBulkBar.js";
|
|
20
|
-
/* empty css */
|
|
21
|
-
import { KapiPaginationFooter as Ne } from "./KapiPaginationFooter.js";
|
|
22
|
-
import { TABLE_SLOTS as o } from "./tableSlots.js";
|
|
5
|
+
import { downloadBlob as e } from "../../hooks/downloadLogic.js";
|
|
6
|
+
import { useDragScroll as t } from "../../hooks/useDragScroll.js";
|
|
7
|
+
import { useAsyncTasks as n } from "../../hooks/useAsyncTasks.js";
|
|
8
|
+
import { KapiSkeleton as r } from "../feedback/KapiSkeleton.js";
|
|
9
|
+
import { KapiBulkBar as ee } from "../feedback/KapiBulkBar.js";
|
|
10
|
+
import { KapiPaginationFooter as te } from "./KapiPaginationFooter.js";
|
|
11
|
+
import { useKapiFormatLocale as ne, useKapiLocale as re, useLabels as ie } from "../locale/KapiLocaleProvider.js";
|
|
12
|
+
import { KapiContextMenu as ae } from "../overlays/KapiContextMenu.js";
|
|
13
|
+
import { KapiMenuButton as oe } from "../overlays/KapiMenuButton.js";
|
|
14
|
+
import { buildCsv as se, columnAlign as ce, computePagination as le, computeStickyOffsets as ue, computeStickyRightOffsets as de, csvFileName as fe, csvHeaderOf as pe, effectiveColumnWidth as me, filterRows as he, filterSearchColumns as ge, firstRightStickyIndex as _e, lastStickyIndex as ve, nextSortState as ye, pinColumns as be, readCell as xe, rowSelectLabel as Se, setColumnPin as Ce, sortRowsByColumn as we, stickyKeysOf as Te, stickySideOf as Ee, tableWrapClass as De, toggleAllIds as Oe, toggleColumnVisibility as ke, toggleId as Ae, visibleColumnsOf as je } from "./tableLogic.js";
|
|
15
|
+
import { useVirtualList as Me } from "../../hooks/useVirtualList.js";
|
|
16
|
+
import { joinClasses as Ne } from "../rootProps.js";
|
|
17
|
+
import { slot as i } from "../slotsLogic.js";
|
|
18
|
+
import { TABLE_SLOTS as a } from "./tableSlots.js";
|
|
23
19
|
import { DEFAULT_TABLE_LABELS as Pe } from "./tableLabels.js";
|
|
24
20
|
import { actColClass as Fe, ariaSortOf as Ie, cellClass as Le, columnBoxStyle as Re, headerContent as ze, skeletonBar as Be, stateRow as Ve, stickyInset as He } from "./tableCells.js";
|
|
25
21
|
import { useRowKeyWarning as Ue } from "./useRowKeyWarning.js";
|
|
@@ -29,19 +25,23 @@ import { useColumnResize as qe } from "./useColumnResize.js";
|
|
|
29
25
|
import { KapiTableToolbar as Je } from "./KapiTableToolbar.js";
|
|
30
26
|
import { TableDatasetNotice as Ye, useTableSelection as Xe } from "./useTableSelection.js";
|
|
31
27
|
import { headerMenuItems as Ze } from "./tableHeaderMenu.js";
|
|
28
|
+
import { useControllableState as o } from "../../hooks/useControllableState.js";
|
|
32
29
|
import { useShallowStable as s } from "../../hooks/shallowStable.js";
|
|
33
30
|
import { TableRow as Qe } from "./KapiTableRow.js";
|
|
34
31
|
import { TableFooter as $e } from "./KapiTableFooter.js";
|
|
32
|
+
/* empty css */
|
|
33
|
+
/* empty css */
|
|
34
|
+
/* empty css */
|
|
35
35
|
import { useCallback as et, useEffect as tt, useLayoutEffect as nt, useMemo as c, useRef as l, useState as u } from "react";
|
|
36
36
|
import { jsx as d, jsxs as f } from "react/jsx-runtime";
|
|
37
37
|
import { RefreshCw as rt } from "lucide-react";
|
|
38
|
-
|
|
38
|
+
// src/components/data/KapiTable.tsx
|
|
39
39
|
var it = 600, at = 46, ot = 5, st = {
|
|
40
40
|
text: "",
|
|
41
41
|
column: null
|
|
42
42
|
}, ct = [];
|
|
43
43
|
function lt({ columns: lt, rows: p, keyField: dt = "id", getRowKey: m, maxHeight: ft = "58vh", fill: pt = !1, footer: mt, bulkActionsPlacement: ht = "bottom", className: gt, classNames: h, style: _t, id: vt, ref: yt, labels: bt, actions: xt, rowMenu: g, contextMenu: _, onCopy: St, selectable: v = !1, rowSelect: Ct = !1, rowLabel: wt, selectedIds: Tt, defaultSelectedIds: Et, onSelectedIdsChange: Dt, bulkActions: Ot, rangeSelect: kt = !0, selectionPresets: At, virtual: y = !1, rowHeight: jt = at, estimatedRowHeight: Mt = at, sort: Nt, defaultSort: Pt = null, onSortChange: Ft, manualSort: It = !1, pagination: b, dataset: Lt, loading: x = !1, loadingRows: Rt, card: zt = !1, emptyMessage: Bt, loadingMessage: Vt, isRowSelectable: Ht, renderSubComponent: Ut, expandedIds: Wt, defaultExpandedIds: Gt, onExpandedIdsChange: Kt, density: qt = "default", rowHover: Jt = !1, columnToggle: Yt = !1, columnVisibility: Xt, defaultColumnVisibility: Zt, onColumnVisibilityChange: Qt, columnPinning: $t = !1, pinnedColumns: en, defaultPinnedColumns: tn, onPinnedColumnsChange: nn, headerMenu: rn = !1, resizableColumns: an = !1, columnWidths: on, defaultColumnWidths: sn, onColumnWidthsChange: cn, filterable: ln = !1, filter: un, defaultFilter: dn = st, onFilterChange: fn, manualFilter: pn = !1, filterDebounce: mn = 300, exportCsv: hn, toolbar: gn, toolbarActions: _n, onRefresh: S, mobileCards: vn = !1, onRowClick: yn, getRowProps: bn }) {
|
|
44
|
-
let C = s(lt), w =
|
|
44
|
+
let C = s(lt), w = ie("table", Pe, s(bt)), xn = Bt === void 0 ? w.empty : Bt, Sn = Vt === void 0 ? w.loading : Vt, Cn = re(), wn = ne(), [Tn, En] = u(null), [T, Dn] = u(null), [E, On] = u(null), D = t({
|
|
45
45
|
onMenu: _ || S ? (e, t) => En({
|
|
46
46
|
x: e,
|
|
47
47
|
y: t
|
|
@@ -66,31 +66,31 @@ function lt({ columns: lt, rows: p, keyField: dt = "id", getRowKey: m, maxHeight
|
|
|
66
66
|
}
|
|
67
67
|
}
|
|
68
68
|
} : void 0
|
|
69
|
-
}), kn =
|
|
69
|
+
}), kn = n(), [O, An] = o(Nt, Pt, Ft), jn = (e) => An(ye(O, e)), k = y && jt === "auto", Mn = jt === "auto" ? void 0 : jt, A = !!Ut && (!y || k), [Nn, Pn] = o(Wt, Gt ?? ct, Kt && ((e) => Kt([...e]))), Fn = c(() => new Set(Nn), [Nn]), In = (e) => Pn([...Ae(Fn, e)]), [j, Ln] = o(Xt, Zt ?? {}, Qt), Rn = (e) => Ln(ke(j, e)), zn = (e) => {
|
|
70
70
|
let t = new Set(e), n = { ...j };
|
|
71
71
|
C.forEach((e) => {
|
|
72
72
|
e.hideable !== !1 && (n[e.key] = t.has(e.key));
|
|
73
73
|
}), Ln(n);
|
|
74
|
-
}, [Bn, Vn] =
|
|
74
|
+
}, [Bn, Vn] = o(on, sn ?? {}, cn), M = s(Bn), Hn = l(null), Un = $t || en !== void 0 || tn !== void 0, [N, Wn] = o(en, () => tn ?? Te(C), nn), Gn = (e, t) => Wn(Ce(N, e, t)), Kn = c(() => Un ? be(C, N) : C, [
|
|
75
75
|
Un,
|
|
76
76
|
C,
|
|
77
77
|
N
|
|
78
|
-
]), P = s(c(() =>
|
|
78
|
+
]), P = s(c(() => je(Kn, j), [Kn, j])), [F, qn] = o(un, dn, fn), Jn = c(() => {
|
|
79
79
|
if (pn) return p;
|
|
80
|
-
let e =
|
|
81
|
-
return
|
|
80
|
+
let e = ge(P, F.column);
|
|
81
|
+
return he(p, (t) => e.map((e) => e.filterValue ? e.filterValue(t) : xe(t, e.key)), F.text);
|
|
82
82
|
}, [
|
|
83
83
|
p,
|
|
84
84
|
P,
|
|
85
85
|
F,
|
|
86
86
|
pn
|
|
87
|
-
]), I = c(() => It ? Jn :
|
|
87
|
+
]), I = c(() => It ? Jn : we(Jn, C, O, Cn), [
|
|
88
88
|
Jn,
|
|
89
89
|
C,
|
|
90
90
|
O,
|
|
91
91
|
It,
|
|
92
92
|
Cn
|
|
93
|
-
]), L = Ke(b) ? b : void 0, R = Ke(b) ? void 0 : b, [z, B] =
|
|
93
|
+
]), L = Ke(b) ? b : void 0, R = Ke(b) ? void 0 : b, [z, B] = o(L?.page, L?.defaultPage ?? 1, L?.onPageChange), [Yn, Xn] = o(L?.pageSize, L?.defaultPageSize ?? 10, L?.onPageSizeChange), V = `${F.column ?? ""}\u0000${F.text}`, Zn = l(V), Qn = L !== void 0 && Zn.current !== V, H = c(() => L ? Ge(I, Qn ? 1 : z, Yn) : null, [
|
|
94
94
|
L !== void 0,
|
|
95
95
|
I,
|
|
96
96
|
Qn,
|
|
@@ -127,16 +127,16 @@ function lt({ columns: lt, rows: p, keyField: dt = "id", getRowKey: m, maxHeight
|
|
|
127
127
|
dataset: Lt,
|
|
128
128
|
loadingLabel: w.loading,
|
|
129
129
|
locale: Cn
|
|
130
|
-
}), fr = sr ? 80 : 46, pr = c(() =>
|
|
130
|
+
}), fr = sr ? 80 : 46, pr = c(() => ue(P.map((e) => ({
|
|
131
131
|
sticky: e.sticky,
|
|
132
|
-
width:
|
|
132
|
+
width: me(e, M)
|
|
133
133
|
})), (v ? fr : 0) + (A ? 44 : 0)), [
|
|
134
134
|
P,
|
|
135
135
|
M,
|
|
136
136
|
v,
|
|
137
137
|
fr,
|
|
138
138
|
A
|
|
139
|
-
]), q = !!(xt || g), mr = c(() => P.some((e) =>
|
|
139
|
+
]), q = !!(xt || g), mr = c(() => P.some((e) => Ee(e.sticky) === "right"), [P]), hr = l(null), [gr, _r] = u(0);
|
|
140
140
|
nt(() => {
|
|
141
141
|
let e = hr.current;
|
|
142
142
|
if (!e || !mr) return;
|
|
@@ -148,9 +148,9 @@ function lt({ columns: lt, rows: p, keyField: dt = "id", getRowKey: m, maxHeight
|
|
|
148
148
|
let n = new ResizeObserver(t);
|
|
149
149
|
return n.observe(e), () => n.disconnect();
|
|
150
150
|
}, [mr, q]);
|
|
151
|
-
let vr = q ? gr : 0, yr = c(() =>
|
|
151
|
+
let vr = q ? gr : 0, yr = c(() => de(P.map((e) => ({
|
|
152
152
|
sticky: e.sticky,
|
|
153
|
-
width:
|
|
153
|
+
width: me(e, M)
|
|
154
154
|
})), vr), [
|
|
155
155
|
P,
|
|
156
156
|
M,
|
|
@@ -158,8 +158,8 @@ function lt({ columns: lt, rows: p, keyField: dt = "id", getRowKey: m, maxHeight
|
|
|
158
158
|
]), J = c(() => ({
|
|
159
159
|
lefts: pr,
|
|
160
160
|
rights: yr,
|
|
161
|
-
lastLeft:
|
|
162
|
-
firstRight:
|
|
161
|
+
lastLeft: ve(P),
|
|
162
|
+
firstRight: _e(P)
|
|
163
163
|
}), [
|
|
164
164
|
pr,
|
|
165
165
|
yr,
|
|
@@ -178,7 +178,7 @@ function lt({ columns: lt, rows: p, keyField: dt = "id", getRowKey: m, maxHeight
|
|
|
178
178
|
k,
|
|
179
179
|
U,
|
|
180
180
|
G
|
|
181
|
-
]), Sr =
|
|
181
|
+
]), Sr = Me({
|
|
182
182
|
enabled: y,
|
|
183
183
|
count: U.length,
|
|
184
184
|
scrollRef: D,
|
|
@@ -187,20 +187,20 @@ function lt({ columns: lt, rows: p, keyField: dt = "id", getRowKey: m, maxHeight
|
|
|
187
187
|
keys: xr,
|
|
188
188
|
overscan: 6,
|
|
189
189
|
fallbackViewHeight: it
|
|
190
|
-
}), { start:
|
|
190
|
+
}), { start: Cr, end: wr, padTop: Tr, padBottom: Er } = Sr, Dr = U.slice(Cr, wr), Or = Rt ?? W?.pageSize ?? ot, kr = W ? Math.max(0, W.page - 1) * W.pageSize : 0, { cortaDerecha: Ar, cortaIzquierda: jr, medirBordes: Mr } = We(D, P), { onScroll: Nr } = Sr;
|
|
191
191
|
nt(() => {
|
|
192
|
-
y &&
|
|
192
|
+
y && Nr();
|
|
193
193
|
}, [
|
|
194
194
|
y,
|
|
195
195
|
ft,
|
|
196
|
-
|
|
196
|
+
Nr
|
|
197
197
|
]);
|
|
198
|
-
let
|
|
199
|
-
y &&
|
|
200
|
-
},
|
|
198
|
+
let Pr = (e) => {
|
|
199
|
+
y && Nr(), Mr(e.currentTarget);
|
|
200
|
+
}, Fr = l(!0);
|
|
201
201
|
tt(() => {
|
|
202
|
-
if (
|
|
203
|
-
|
|
202
|
+
if (Fr.current) {
|
|
203
|
+
Fr.current = !1;
|
|
204
204
|
return;
|
|
205
205
|
}
|
|
206
206
|
let e = D.current;
|
|
@@ -210,10 +210,10 @@ function lt({ columns: lt, rows: p, keyField: dt = "id", getRowKey: m, maxHeight
|
|
|
210
210
|
F.column,
|
|
211
211
|
D
|
|
212
212
|
]);
|
|
213
|
-
let
|
|
214
|
-
let
|
|
215
|
-
|
|
216
|
-
},
|
|
213
|
+
let Ir = typeof hn == "object" ? hn : {}, Lr = () => {
|
|
214
|
+
let t = P.map(pe), n = Ir.rows, r = (n === void 0 ? I : typeof n == "function" ? n() : n).map((e) => P.map((t) => t.csvValue ? t.csvValue(e) : t.copyValue ? t.copyValue(e) : xe(e, t.key)));
|
|
215
|
+
e(new Blob([`\uFEFF${se(t, r, Ir.separator)}`], { type: "text/csv;charset=utf-8" }), fe(Ir.fileName));
|
|
216
|
+
}, Rr = vn && !y, zr = (e, t) => {
|
|
217
217
|
if (!g) return;
|
|
218
218
|
let n = e.currentTarget.getBoundingClientRect();
|
|
219
219
|
Dn({
|
|
@@ -221,29 +221,29 @@ function lt({ columns: lt, rows: p, keyField: dt = "id", getRowKey: m, maxHeight
|
|
|
221
221
|
y: n.bottom + 4,
|
|
222
222
|
items: g(t)
|
|
223
223
|
});
|
|
224
|
-
},
|
|
224
|
+
}, Z = l({
|
|
225
225
|
activateRow: dr,
|
|
226
226
|
toggleExpanded: In,
|
|
227
|
-
openRowMenu:
|
|
227
|
+
openRowMenu: zr,
|
|
228
228
|
onRowClick: yn,
|
|
229
229
|
onCopy: St
|
|
230
230
|
});
|
|
231
|
-
|
|
231
|
+
Z.current = {
|
|
232
232
|
activateRow: dr,
|
|
233
233
|
toggleExpanded: In,
|
|
234
|
-
openRowMenu:
|
|
234
|
+
openRowMenu: zr,
|
|
235
235
|
onRowClick: yn,
|
|
236
236
|
onCopy: St
|
|
237
237
|
};
|
|
238
|
-
let
|
|
239
|
-
activate: (e, t) =>
|
|
240
|
-
toggleExpanded: (e) =>
|
|
241
|
-
openMenu: (e, t) =>
|
|
242
|
-
rowClick: (e, t) =>
|
|
243
|
-
copy: (e) =>
|
|
238
|
+
let Br = c(() => ({
|
|
239
|
+
activate: (e, t) => Z.current.activateRow(e, t),
|
|
240
|
+
toggleExpanded: (e) => Z.current.toggleExpanded(e),
|
|
241
|
+
openMenu: (e, t) => Z.current.openRowMenu(e, t),
|
|
242
|
+
rowClick: (e, t) => Z.current.onRowClick?.(e, t),
|
|
243
|
+
copy: (e) => Z.current.onCopy?.(e)
|
|
244
244
|
}), []);
|
|
245
245
|
Ue("KapiTable", p, G, m ? "getRowKey" : `keyField ("${String(dt)}")`);
|
|
246
|
-
let { resizeHandle:
|
|
246
|
+
let { resizeHandle: Vr } = qe({
|
|
247
247
|
tableRef: Hn,
|
|
248
248
|
columns: P,
|
|
249
249
|
widths: M,
|
|
@@ -254,18 +254,18 @@ function lt({ columns: lt, rows: p, keyField: dt = "id", getRowKey: m, maxHeight
|
|
|
254
254
|
rightEnd: vr,
|
|
255
255
|
resizableColumns: an,
|
|
256
256
|
resizeLabel: w.resizeColumn
|
|
257
|
-
}),
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
}, [
|
|
261
|
-
let
|
|
257
|
+
}), Q = H ? H.info : R ? le(R) : null, Hr = R && Q && !x && R.total > 0 && Q.page !== R.page ? Q.page : null, Ur = l(R?.onPageChange);
|
|
258
|
+
Ur.current = R?.onPageChange, tt(() => {
|
|
259
|
+
Hr !== null && Ur.current?.(Hr);
|
|
260
|
+
}, [Hr]);
|
|
261
|
+
let Wr = Array.from({ length: Or }, (e, t) => /* @__PURE__ */ f("tr", {
|
|
262
262
|
className: "kapi-table-skrow",
|
|
263
263
|
"aria-hidden": !0,
|
|
264
264
|
children: [
|
|
265
265
|
v && /* @__PURE__ */ d("td", {
|
|
266
266
|
className: "is-sticky kapi-cbcol",
|
|
267
267
|
style: { insetInlineStart: 0 },
|
|
268
|
-
children: /* @__PURE__ */ d(
|
|
268
|
+
children: /* @__PURE__ */ d(r, {
|
|
269
269
|
width: 16,
|
|
270
270
|
height: 16,
|
|
271
271
|
radius: 5
|
|
@@ -283,7 +283,7 @@ function lt({ columns: lt, rows: p, keyField: dt = "id", getRowKey: m, maxHeight
|
|
|
283
283
|
}, e.key)),
|
|
284
284
|
q && /* @__PURE__ */ d("td", {
|
|
285
285
|
className: Fe(J),
|
|
286
|
-
children: /* @__PURE__ */ d(
|
|
286
|
+
children: /* @__PURE__ */ d(r, {
|
|
287
287
|
width: 28,
|
|
288
288
|
height: 14,
|
|
289
289
|
radius: 6,
|
|
@@ -291,7 +291,7 @@ function lt({ columns: lt, rows: p, keyField: dt = "id", getRowKey: m, maxHeight
|
|
|
291
291
|
})
|
|
292
292
|
})
|
|
293
293
|
]
|
|
294
|
-
}, `sk-${t}`)),
|
|
294
|
+
}, `sk-${t}`)), Gr = v && Ot && K.length > 0 ? /* @__PURE__ */ d(ee, {
|
|
295
295
|
count: K.length,
|
|
296
296
|
onClear: ar,
|
|
297
297
|
placement: ht,
|
|
@@ -299,7 +299,7 @@ function lt({ columns: lt, rows: p, keyField: dt = "id", getRowKey: m, maxHeight
|
|
|
299
299
|
ids: K,
|
|
300
300
|
clear: ar
|
|
301
301
|
})
|
|
302
|
-
}) : null,
|
|
302
|
+
}) : null, $ = () => ({
|
|
303
303
|
columns: [...P],
|
|
304
304
|
hiddenColumns: C.filter((e) => j[e.key] === !1).map((e) => e.key),
|
|
305
305
|
columnWidths: { ...M },
|
|
@@ -316,21 +316,21 @@ function lt({ columns: lt, rows: p, keyField: dt = "id", getRowKey: m, maxHeight
|
|
|
316
316
|
pageSize: W.pageSize,
|
|
317
317
|
total: W.total
|
|
318
318
|
} : null
|
|
319
|
-
}), Kr = (e, t) => kn.run(e, (e) => t(
|
|
319
|
+
}), Kr = (e, t) => kn.run(e, (e) => t($(), { signal: e })), qr = kn.isPending(ut), Jr = () => {
|
|
320
320
|
S && Kr(ut, S);
|
|
321
321
|
}, Yr = [..._ ?? [], ...S ? [..._ && _.length > 0 ? [{ sep: !0 }] : [], {
|
|
322
322
|
label: w.refresh,
|
|
323
323
|
icon: /* @__PURE__ */ d(rt, { size: 16 }),
|
|
324
324
|
disabled: qr,
|
|
325
325
|
onClick: Jr
|
|
326
|
-
}] : []], Xr = typeof mt == "function" ? mt(
|
|
326
|
+
}] : []], Xr = typeof mt == "function" ? mt($()) : mt, Zr = typeof gn == "function" ? gn($()) : gn;
|
|
327
327
|
return /* @__PURE__ */ f("div", {
|
|
328
328
|
ref: yt,
|
|
329
329
|
id: vt,
|
|
330
330
|
style: _t,
|
|
331
|
-
...a
|
|
331
|
+
...i(a, "root", h, Ne("kapi-table-shell", zt && "kapi-table-shell--card", pt && "kapi-table-shell--fill", Rr && "kapi-table-shell--cards", gt)),
|
|
332
332
|
children: [
|
|
333
|
-
ht === "top" &&
|
|
333
|
+
ht === "top" && Gr,
|
|
334
334
|
/* @__PURE__ */ d(Je, {
|
|
335
335
|
classNames: h,
|
|
336
336
|
text: w,
|
|
@@ -345,11 +345,11 @@ function lt({ columns: lt, rows: p, keyField: dt = "id", getRowKey: m, maxHeight
|
|
|
345
345
|
content: Zr,
|
|
346
346
|
toolbarActions: _n,
|
|
347
347
|
isPending: kn.isPending,
|
|
348
|
-
context:
|
|
348
|
+
context: $,
|
|
349
349
|
onRun: Kr,
|
|
350
350
|
refresh: S ? Jr : void 0,
|
|
351
351
|
refreshing: qr,
|
|
352
|
-
onExportCsv: hn ?
|
|
352
|
+
onExportCsv: hn ? Lr : void 0,
|
|
353
353
|
columns: C,
|
|
354
354
|
columnToggle: Yt,
|
|
355
355
|
columnPinning: $t,
|
|
@@ -368,19 +368,19 @@ function lt({ columns: lt, rows: p, keyField: dt = "id", getRowKey: m, maxHeight
|
|
|
368
368
|
locale: wn
|
|
369
369
|
}),
|
|
370
370
|
/* @__PURE__ */ f("div", {
|
|
371
|
-
...a
|
|
372
|
-
cortaDerecha:
|
|
373
|
-
cortaIzquierda:
|
|
371
|
+
...i(a, "scrollArea", h, Ne(De({
|
|
372
|
+
cortaDerecha: Ar,
|
|
373
|
+
cortaIzquierda: jr,
|
|
374
374
|
rightEdge: q || mr
|
|
375
375
|
}), k && "is-virtual-auto")),
|
|
376
376
|
ref: D,
|
|
377
377
|
tabIndex: 0,
|
|
378
378
|
style: pt ? void 0 : { maxHeight: ft },
|
|
379
|
-
onScroll:
|
|
379
|
+
onScroll: Pr,
|
|
380
380
|
children: [
|
|
381
381
|
/* @__PURE__ */ f("table", {
|
|
382
382
|
ref: Hn,
|
|
383
|
-
...a
|
|
383
|
+
...i(a, "table", h, `kapi-table2${y ? k ? " is-virtual-auto" : " is-virtual" : ""}${qt === "card" ? " kapi-table2--card" : ""}${Jt ? " kapi-table2--hover" : ""}`),
|
|
384
384
|
children: [
|
|
385
385
|
/* @__PURE__ */ d("thead", { children: /* @__PURE__ */ f("tr", { children: [
|
|
386
386
|
v && /* @__PURE__ */ f("th", {
|
|
@@ -394,10 +394,10 @@ function lt({ columns: lt, rows: p, keyField: dt = "id", getRowKey: m, maxHeight
|
|
|
394
394
|
ref: (e) => {
|
|
395
395
|
e && (e.indeterminate = lr === "some");
|
|
396
396
|
},
|
|
397
|
-
onChange: () => ir(
|
|
397
|
+
onChange: () => ir(Oe(rr, or)),
|
|
398
398
|
"aria-label": w.selectAll
|
|
399
399
|
})
|
|
400
|
-
}), sr && /* @__PURE__ */ d(
|
|
400
|
+
}), sr && /* @__PURE__ */ d(oe, {
|
|
401
401
|
label: null,
|
|
402
402
|
"aria-label": w.selectMatching,
|
|
403
403
|
variant: "ghost",
|
|
@@ -411,17 +411,17 @@ function lt({ columns: lt, rows: p, keyField: dt = "id", getRowKey: m, maxHeight
|
|
|
411
411
|
children: w.expandColumn
|
|
412
412
|
})
|
|
413
413
|
}),
|
|
414
|
-
P.map((
|
|
415
|
-
"data-col":
|
|
416
|
-
className:
|
|
417
|
-
"aria-sort": Ie(
|
|
414
|
+
P.map((e, t) => /* @__PURE__ */ f("th", {
|
|
415
|
+
"data-col": e.key,
|
|
416
|
+
className: Ne(Le(e, t, J), e.sortable && "is-sortable"),
|
|
417
|
+
"aria-sort": Ie(e, O),
|
|
418
418
|
style: {
|
|
419
|
-
...He(
|
|
420
|
-
...Re(
|
|
421
|
-
textAlign:
|
|
419
|
+
...He(t, J),
|
|
420
|
+
...Re(e, "th", M),
|
|
421
|
+
textAlign: ce(e.align)
|
|
422
422
|
},
|
|
423
|
-
children: [ze(
|
|
424
|
-
},
|
|
423
|
+
children: [ze(e, O, jn, w), Vr(e)]
|
|
424
|
+
}, e.key)),
|
|
425
425
|
q && /* @__PURE__ */ d("th", {
|
|
426
426
|
ref: hr,
|
|
427
427
|
className: Fe(J),
|
|
@@ -429,24 +429,24 @@ function lt({ columns: lt, rows: p, keyField: dt = "id", getRowKey: m, maxHeight
|
|
|
429
429
|
})
|
|
430
430
|
] }) }),
|
|
431
431
|
/* @__PURE__ */ f("tbody", { children: [
|
|
432
|
-
x && (
|
|
432
|
+
x && (Or > 0 ? Wr : Ve(X, Sn, !0)),
|
|
433
433
|
!x && U.length === 0 && Ve(X, xn),
|
|
434
|
-
!x && U.length > 0 &&
|
|
434
|
+
!x && U.length > 0 && Tr > 0 && /* @__PURE__ */ d("tr", {
|
|
435
435
|
"aria-hidden": !0,
|
|
436
|
-
style: { height:
|
|
436
|
+
style: { height: Tr },
|
|
437
437
|
children: /* @__PURE__ */ d("td", {
|
|
438
438
|
colSpan: X,
|
|
439
439
|
className: "kapi-table-pad"
|
|
440
440
|
})
|
|
441
441
|
}),
|
|
442
|
-
!x &&
|
|
443
|
-
let n = G(e), r = !Ht || Ht(e),
|
|
442
|
+
!x && Dr.map((e, t) => {
|
|
443
|
+
let n = G(e), r = !Ht || Ht(e), ee = kr + Cr + t + 1;
|
|
444
444
|
return /* @__PURE__ */ d(Qe, {
|
|
445
445
|
row: e,
|
|
446
446
|
id: n,
|
|
447
|
-
index:
|
|
447
|
+
index: Cr + t,
|
|
448
448
|
selected: rr.has(n),
|
|
449
|
-
selectLabel: v ?
|
|
449
|
+
selectLabel: v ? Se(e, P, ee, w, wt) : "",
|
|
450
450
|
open: A && Fn.has(n),
|
|
451
451
|
canSelect: r,
|
|
452
452
|
clickSelect: v && Ct && r,
|
|
@@ -456,7 +456,7 @@ function lt({ columns: lt, rows: p, keyField: dt = "id", getRowKey: m, maxHeight
|
|
|
456
456
|
selectable: v,
|
|
457
457
|
expandable: A,
|
|
458
458
|
rowHeight: y ? Mn : void 0,
|
|
459
|
-
virtualIndex: k ?
|
|
459
|
+
virtualIndex: k ? Cr + t : void 0,
|
|
460
460
|
columns: P,
|
|
461
461
|
layout: J,
|
|
462
462
|
widths: M,
|
|
@@ -466,12 +466,12 @@ function lt({ columns: lt, rows: p, keyField: dt = "id", getRowKey: m, maxHeight
|
|
|
466
466
|
hasRowMenu: g !== void 0,
|
|
467
467
|
renderSubComponent: Ut,
|
|
468
468
|
colSpan: X,
|
|
469
|
-
handlers:
|
|
469
|
+
handlers: Br
|
|
470
470
|
}, n);
|
|
471
471
|
}),
|
|
472
|
-
!x && U.length > 0 &&
|
|
472
|
+
!x && U.length > 0 && Er > 0 && /* @__PURE__ */ d("tr", {
|
|
473
473
|
"aria-hidden": !0,
|
|
474
|
-
style: { height:
|
|
474
|
+
style: { height: Er },
|
|
475
475
|
children: /* @__PURE__ */ d("td", {
|
|
476
476
|
colSpan: X,
|
|
477
477
|
className: "kapi-table-pad"
|
|
@@ -489,14 +489,14 @@ function lt({ columns: lt, rows: p, keyField: dt = "id", getRowKey: m, maxHeight
|
|
|
489
489
|
})
|
|
490
490
|
]
|
|
491
491
|
}),
|
|
492
|
-
Tn && Yr.length > 0 && /* @__PURE__ */ d(
|
|
492
|
+
Tn && Yr.length > 0 && /* @__PURE__ */ d(ae, {
|
|
493
493
|
open: !0,
|
|
494
494
|
x: Tn.x,
|
|
495
495
|
y: Tn.y,
|
|
496
496
|
items: Yr,
|
|
497
497
|
onClose: () => En(null)
|
|
498
498
|
}),
|
|
499
|
-
E && Y && br.length > 0 && /* @__PURE__ */ d(
|
|
499
|
+
E && Y && br.length > 0 && /* @__PURE__ */ d(ae, {
|
|
500
500
|
open: !0,
|
|
501
501
|
x: E.x,
|
|
502
502
|
y: E.y,
|
|
@@ -504,7 +504,7 @@ function lt({ columns: lt, rows: p, keyField: dt = "id", getRowKey: m, maxHeight
|
|
|
504
504
|
"aria-label": `${w.columnActions} ${typeof Y.label == "string" ? Y.label : Y.key}`,
|
|
505
505
|
onClose: () => On(null)
|
|
506
506
|
}),
|
|
507
|
-
T && /* @__PURE__ */ d(
|
|
507
|
+
T && /* @__PURE__ */ d(ae, {
|
|
508
508
|
open: !0,
|
|
509
509
|
x: T.x,
|
|
510
510
|
y: T.y,
|
|
@@ -513,11 +513,11 @@ function lt({ columns: lt, rows: p, keyField: dt = "id", getRowKey: m, maxHeight
|
|
|
513
513
|
})
|
|
514
514
|
]
|
|
515
515
|
}),
|
|
516
|
-
ht === "bottom" &&
|
|
517
|
-
W &&
|
|
518
|
-
...a
|
|
516
|
+
ht === "bottom" && Gr,
|
|
517
|
+
W && Q && /* @__PURE__ */ d(te, {
|
|
518
|
+
...i(a, "pagination", h),
|
|
519
519
|
as: "div",
|
|
520
|
-
info:
|
|
520
|
+
info: Q,
|
|
521
521
|
pageSize: W.pageSize,
|
|
522
522
|
total: W.total,
|
|
523
523
|
onPageChange: W.onPageChange,
|
|
@@ -530,5 +530,4 @@ function lt({ columns: lt, rows: p, keyField: dt = "id", getRowKey: m, maxHeight
|
|
|
530
530
|
});
|
|
531
531
|
}
|
|
532
532
|
var ut = "\0refresh";
|
|
533
|
-
//#endregion
|
|
534
533
|
export { Pe as DEFAULT_TABLE_LABELS, lt as KapiTable };
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import "#kapi-css/components/data/KapiTableFilter.css";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
3
|
+
import { KapiField as e } from "../inputs/KapiField.js";
|
|
4
|
+
import { KapiInput as t } from "../inputs/KapiInput.js";
|
|
5
|
+
import { KapiInputGroup as n } from "../inputs/KapiInputGroup.js";
|
|
6
|
+
import { KapiSelect as r } from "../inputs/KapiSelect.js";
|
|
7
|
+
import { useLabels as i } from "../locale/KapiLocaleProvider.js";
|
|
8
|
+
import { joinClasses as a } from "../rootProps.js";
|
|
9
9
|
import { filterColumnOptions as o, isFilterActive as s } from "./tableLogic.js";
|
|
10
10
|
import { TABLE_FILTER_REGION as c } from "./tableLabels.js";
|
|
11
11
|
/* empty css */
|
|
12
12
|
import { useEffect as l, useId as u, useMemo as d, useRef as f, useState as p } from "react";
|
|
13
13
|
import { jsx as m, jsxs as h } from "react/jsx-runtime";
|
|
14
14
|
import { Search as g } from "lucide-react";
|
|
15
|
-
|
|
15
|
+
// src/components/data/KapiTableFilter.tsx
|
|
16
16
|
var _ = {
|
|
17
17
|
filter: "Filtrar tabla",
|
|
18
18
|
filterPlaceholder: "Filtrar…",
|
|
@@ -22,7 +22,7 @@ var _ = {
|
|
|
22
22
|
region: c
|
|
23
23
|
}, v = "\0all", y = (e, t) => e.text === t.text && e.column === t.column;
|
|
24
24
|
function b({ value: c, onChange: b, columns: x, count: S, loadDelay: C, debounce: w, label: T, size: E = "sm", labels: D, className: O, "aria-label": k, ...A }) {
|
|
25
|
-
let j =
|
|
25
|
+
let j = i("tableFilter", _, D), M = C ?? w ?? 0, N = d(() => o(x), [x]), [P, F] = p(c), I = f(c), [L, R] = p(c);
|
|
26
26
|
y(L, c) || (R(c), y(I.current, c) || F(c));
|
|
27
27
|
let z = f(void 0);
|
|
28
28
|
l(() => () => clearTimeout(z.current), []);
|
|
@@ -30,10 +30,10 @@ function b({ value: c, onChange: b, columns: x, count: S, loadDelay: C, debounce
|
|
|
30
30
|
clearTimeout(z.current), I.current = e, b(e);
|
|
31
31
|
}, V = (e, t) => {
|
|
32
32
|
F(e), clearTimeout(z.current), !t && M > 0 ? z.current = setTimeout(() => B(e), M) : B(e);
|
|
33
|
-
}, H = u(), U = /* @__PURE__ */ h(
|
|
33
|
+
}, H = u(), U = /* @__PURE__ */ h(n, {
|
|
34
34
|
size: E,
|
|
35
35
|
className: "kapi-tablefilter__group",
|
|
36
|
-
children: [/* @__PURE__ */ m(
|
|
36
|
+
children: [/* @__PURE__ */ m(r, {
|
|
37
37
|
id: `${H}-col`,
|
|
38
38
|
searchable: !1,
|
|
39
39
|
"aria-label": j.filterColumn,
|
|
@@ -49,7 +49,7 @@ function b({ value: c, onChange: b, columns: x, count: S, loadDelay: C, debounce
|
|
|
49
49
|
column: e === v ? null : e
|
|
50
50
|
}, !0);
|
|
51
51
|
}
|
|
52
|
-
}), /* @__PURE__ */ m(
|
|
52
|
+
}), /* @__PURE__ */ m(t, {
|
|
53
53
|
id: H,
|
|
54
54
|
type: "search",
|
|
55
55
|
"aria-label": T == null ? j.filter : void 0,
|
|
@@ -66,10 +66,10 @@ function b({ value: c, onChange: b, columns: x, count: S, loadDelay: C, debounce
|
|
|
66
66
|
});
|
|
67
67
|
return /* @__PURE__ */ h("div", {
|
|
68
68
|
...A,
|
|
69
|
-
className:
|
|
69
|
+
className: a("kapi-tablefilter", O),
|
|
70
70
|
role: "search",
|
|
71
71
|
"aria-label": k ?? j.region,
|
|
72
|
-
children: [T == null ? U : /* @__PURE__ */ m(
|
|
72
|
+
children: [T == null ? U : /* @__PURE__ */ m(e, {
|
|
73
73
|
label: T,
|
|
74
74
|
htmlFor: H,
|
|
75
75
|
className: "kapi-tablefilter__field",
|
|
@@ -81,5 +81,4 @@ function b({ value: c, onChange: b, columns: x, count: S, loadDelay: C, debounce
|
|
|
81
81
|
})]
|
|
82
82
|
});
|
|
83
83
|
}
|
|
84
|
-
//#endregion
|
|
85
84
|
export { _ as DEFAULT_TABLE_FILTER_LABELS, b as KapiTableFilter };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
import { columnAlign as
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
2
|
+
import { actColClass as e, cellClass as t, columnBoxStyle as n, stickyInset as r } from "./tableCells.js";
|
|
3
|
+
import { columnAlign as i } from "./tableLogic.js";
|
|
4
|
+
import { layoutFooterRow as a } from "./tableSpanLogic.js";
|
|
5
|
+
import { joinClasses as o } from "../rootProps.js";
|
|
6
6
|
import { jsx as s, jsxs as c } from "react/jsx-runtime";
|
|
7
|
-
|
|
7
|
+
// src/components/data/KapiTableFooter.tsx
|
|
8
8
|
function l({ rows: l, columns: u, layout: d, widths: f, selectable: p, expandable: m, hasActions: h }) {
|
|
9
9
|
let g = u.map((e) => e.key);
|
|
10
10
|
return /* @__PURE__ */ s("tfoot", { children: l.map((l, _) => /* @__PURE__ */ c("tr", { children: [
|
|
@@ -13,28 +13,28 @@ function l({ rows: l, columns: u, layout: d, widths: f, selectable: p, expandabl
|
|
|
13
13
|
style: { insetInlineStart: 0 }
|
|
14
14
|
}),
|
|
15
15
|
m && /* @__PURE__ */ s("td", { className: "kapi-expandcol" }),
|
|
16
|
-
|
|
17
|
-
let
|
|
18
|
-
if (!
|
|
19
|
-
let o =
|
|
16
|
+
a(l, g).flatMap((e) => {
|
|
17
|
+
let a = u[e.start];
|
|
18
|
+
if (!e.cell) return u.slice(e.start, e.start + e.span).map((i, a) => {
|
|
19
|
+
let o = e.start + a;
|
|
20
20
|
return /* @__PURE__ */ s("td", {
|
|
21
|
-
className:
|
|
21
|
+
className: t(i, o, d),
|
|
22
22
|
style: {
|
|
23
|
-
...
|
|
24
|
-
...i
|
|
23
|
+
...r(o, d),
|
|
24
|
+
...n(i, "td", f)
|
|
25
25
|
}
|
|
26
|
-
},
|
|
26
|
+
}, i.key);
|
|
27
27
|
});
|
|
28
|
-
let { cell: c, start: l, span: p } =
|
|
28
|
+
let { cell: c, start: l, span: p } = e, m = i(c.align ?? a.align), h = p === 1, g = {
|
|
29
29
|
...h ? {
|
|
30
|
-
...
|
|
31
|
-
...
|
|
30
|
+
...r(l, d),
|
|
31
|
+
...n(a, "td", f)
|
|
32
32
|
} : {},
|
|
33
33
|
textAlign: m
|
|
34
|
-
}, _ = h ?
|
|
35
|
-
...
|
|
36
|
-
align: c.align ??
|
|
37
|
-
}, l, d) :
|
|
34
|
+
}, _ = h ? t({
|
|
35
|
+
...a,
|
|
36
|
+
align: c.align ?? a.align
|
|
37
|
+
}, l, d) : o(m && `is-align-${m}`), v = `${l}:${p}`, y = h ? void 0 : p;
|
|
38
38
|
return [c.header ? /* @__PURE__ */ s("th", {
|
|
39
39
|
scope: "row",
|
|
40
40
|
colSpan: y,
|
|
@@ -48,8 +48,7 @@ function l({ rows: l, columns: u, layout: d, widths: f, selectable: p, expandabl
|
|
|
48
48
|
children: c.content
|
|
49
49
|
}, v)];
|
|
50
50
|
}),
|
|
51
|
-
h && /* @__PURE__ */ s("td", { className:
|
|
51
|
+
h && /* @__PURE__ */ s("td", { className: e(d) })
|
|
52
52
|
] }, _)) });
|
|
53
53
|
}
|
|
54
|
-
//#endregion
|
|
55
54
|
export { l as TableFooter };
|