@kapiuara/ui 0.12.0 → 0.13.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 +1197 -49
- package/dist/components/chat/KapiChatDivider.d.ts +1 -2
- package/dist/components/chat/KapiChatDivider.js +1 -0
- 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 +122 -100
- package/dist/components/inputs/KapiDateRangePicker.d.ts +44 -10
- package/dist/components/inputs/KapiDateRangePicker.js +148 -120
- 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 +15 -15
- package/dist/components/inputs/KapiMaskedInput.js +51 -48
- 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 +80 -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 +72 -51
- package/dist/components/inputs/KapiSelect.d.ts +120 -39
- package/dist/components/inputs/KapiSelect.js +309 -379
- 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 +77 -66
- 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/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 +15 -14
- 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 +58 -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 +21 -0
- package/dist/hooks/useControllableState.js +17 -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/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 +14 -6
|
@@ -1,18 +1,21 @@
|
|
|
1
1
|
"use client";
|
|
2
|
+
import "#kapi-css/components/inputs/KapiFacetedSearch.css";
|
|
2
3
|
import { useLabels as e } from "../locale/KapiLocaleProvider.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
4
|
+
import { joinClasses as t } from "../rootProps.js";
|
|
5
|
+
import { enabledIndexes as ee, nextEnabledIndex as n } from "../overlays/menuKeyboardLogic.js";
|
|
6
|
+
import { useAsyncLoader as r } from "../../hooks/useAsyncLoader.js";
|
|
7
|
+
import { KapiDatePicker as te } from "./KapiDatePicker.js";
|
|
8
|
+
import { KapiDateRangePicker as ne } from "./KapiDateRangePicker.js";
|
|
9
|
+
import { useMergedRefs as re } from "../../hooks/mergeRefs.js";
|
|
7
10
|
import { KapiTag as i } from "../display/KapiTag.js";
|
|
8
|
-
import { KapiPopover as
|
|
9
|
-
import { facetChipText as
|
|
11
|
+
import { KapiPopover as ie } from "../overlays/KapiPopover.js";
|
|
12
|
+
import { facetChipText as ae, facetKeyAction as oe, facetMenuItems as se, facetOperators as a, facetOptionName as ce, isDateFacet as o, toDateRangeValue as le, toDateValue as ue } from "./facetedSearchLogic.js";
|
|
10
13
|
/* empty css */
|
|
11
|
-
import { Fragment as
|
|
12
|
-
import {
|
|
14
|
+
import { Fragment as s, jsx as c, jsxs as l } from "react/jsx-runtime";
|
|
15
|
+
import { useId as u, useRef as d, useState as f } from "react";
|
|
13
16
|
import { Search as de } from "lucide-react";
|
|
14
17
|
//#region src/components/inputs/KapiFacetedSearch.tsx
|
|
15
|
-
var
|
|
18
|
+
var p = {
|
|
16
19
|
input: "Buscar o filtrar",
|
|
17
20
|
region: "Búsqueda",
|
|
18
21
|
placeholder: "Buscar o filtrar…",
|
|
@@ -36,252 +39,212 @@ var f = {
|
|
|
36
39
|
operatorLt: "menor que",
|
|
37
40
|
operatorLte: "menor o igual que"
|
|
38
41
|
};
|
|
39
|
-
function
|
|
40
|
-
let
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
options: t,
|
|
73
|
-
error: !1
|
|
74
|
-
}), M(-1));
|
|
75
|
-
}, () => {
|
|
76
|
-
n.isCurrent() && P({
|
|
77
|
-
key: e,
|
|
78
|
-
query: L,
|
|
79
|
-
options: [],
|
|
80
|
-
error: !0
|
|
81
|
-
});
|
|
82
|
-
});
|
|
83
|
-
}, g);
|
|
84
|
-
return () => clearTimeout(t);
|
|
85
|
-
}, [
|
|
86
|
-
B,
|
|
87
|
-
q,
|
|
88
|
-
U,
|
|
89
|
-
L,
|
|
90
|
-
g,
|
|
91
|
-
E?.key,
|
|
92
|
-
F
|
|
93
|
-
]), l(() => ((!q || !E) && (F.cancel(), P((e) => e?.error ? null : e)), () => F.cancel()), [
|
|
94
|
-
q,
|
|
95
|
-
E,
|
|
96
|
-
F
|
|
97
|
-
]);
|
|
98
|
-
let Y = () => requestAnimationFrame(() => S.current?.focus()), X = () => {
|
|
99
|
-
T(""), D(null), k(null), M(-1);
|
|
100
|
-
}, Z = () => {
|
|
101
|
-
X(), A(!1), Y();
|
|
102
|
-
}, Q = (e, t) => {
|
|
103
|
-
e.kind === "flag" ? (e.apply("true", t), Z()) : (D(e), k(t), T(""), M(-1), A(!0), o(e) ? requestAnimationFrame(() => C.current?.focus()) : Y());
|
|
104
|
-
}, ye = () => {
|
|
105
|
-
O !== null && E && a(E).length >= 2 || D(null), k(null), M(-1), Y();
|
|
106
|
-
}, be = (e) => {
|
|
107
|
-
E?.kind === "text" ? E.apply(e, O ?? "eq") : fe(e), Z();
|
|
108
|
-
}, xe = (e) => {
|
|
109
|
-
if (e.type === "text") be(e.text);
|
|
110
|
-
else if (e.type === "option") E?.apply(e.option.value, O ?? "eq"), Z();
|
|
111
|
-
else if (e.type === "operator") Q(e.facet, e.operator);
|
|
42
|
+
function m({ facets: m, chips: h, onText: fe, onClearAll: g, loadDelay: pe = 300, reloadKey: me, labels: he, className: ge, onMouseDown: _e, "aria-label": _, ref: ve, ...v }) {
|
|
43
|
+
let y = e("facetedSearch", p, he), b = u(), x = `${b}-list`, S = d(null), ye = re(S, ve), C = d(null), w = d(null), [T, E] = f(""), [D, O] = f(null), [k, A] = f(null), [j, M] = f(!1), [N, P] = f(-1), F = T.trim(), I = !!D && a(D).length >= 2 && k === null, L = D?.kind === "text" && !I, R = typeof D?.loadOptions == "function" && D.kind !== "text" && !I, z = {
|
|
44
|
+
eq: y.operatorEq,
|
|
45
|
+
ne: y.operatorNe,
|
|
46
|
+
contains: y.operatorContains,
|
|
47
|
+
startsWith: y.operatorStartsWith,
|
|
48
|
+
endsWith: y.operatorEndsWith,
|
|
49
|
+
gt: y.operatorGt,
|
|
50
|
+
gte: y.operatorGte,
|
|
51
|
+
lt: y.operatorLt,
|
|
52
|
+
lte: y.operatorLte
|
|
53
|
+
}, B = (e) => ae(e, e.operator ? z[e.operator] : void 0), V = o(D) && !I, be = r({
|
|
54
|
+
query: F,
|
|
55
|
+
key: `${D?.key ?? ""}\u0000${F}`,
|
|
56
|
+
enabled: R && j && !V,
|
|
57
|
+
load: D?.loadOptions,
|
|
58
|
+
delay: pe,
|
|
59
|
+
reloadKey: me,
|
|
60
|
+
onLoaded: () => P(-1)
|
|
61
|
+
}), H = R ? be.result : null, U = R && !H, W = se(m, D, T, H && !H.error ? H.data : void 0, k), G = j && !V && !(L && W.length === 0), K = () => requestAnimationFrame(() => C.current?.focus()), q = () => {
|
|
62
|
+
E(""), O(null), A(null), P(-1);
|
|
63
|
+
}, J = () => {
|
|
64
|
+
q(), M(!1), K();
|
|
65
|
+
}, Y = (e, t) => {
|
|
66
|
+
e.kind === "flag" ? (e.apply("true", t), J()) : (O(e), A(t), E(""), P(-1), M(!0), o(e) ? requestAnimationFrame(() => w.current?.focus()) : K());
|
|
67
|
+
}, X = () => {
|
|
68
|
+
k !== null && D && a(D).length >= 2 || O(null), A(null), P(-1), K();
|
|
69
|
+
}, Z = (e) => {
|
|
70
|
+
D?.kind === "text" ? D.apply(e, k ?? "eq") : fe(e), J();
|
|
71
|
+
}, Q = (e) => {
|
|
72
|
+
if (e.type === "text") Z(e.text);
|
|
73
|
+
else if (e.type === "option") D?.apply(e.option.value, k ?? "eq"), J();
|
|
74
|
+
else if (e.type === "operator") Y(e.facet, e.operator);
|
|
112
75
|
else {
|
|
113
76
|
let t = a(e.facet);
|
|
114
|
-
t.length >= 2 ? (
|
|
77
|
+
t.length >= 2 ? (O(e.facet), A(null), E(""), P(-1), M(!0), K()) : Y(e.facet, t[0] ?? "eq");
|
|
115
78
|
}
|
|
116
|
-
},
|
|
117
|
-
let t =
|
|
118
|
-
input:
|
|
119
|
-
pending: !!
|
|
120
|
-
pendingText:
|
|
121
|
-
active:
|
|
122
|
-
open:
|
|
123
|
-
chips:
|
|
79
|
+
}, xe = (e) => {
|
|
80
|
+
let t = oe(e.key, {
|
|
81
|
+
input: T,
|
|
82
|
+
pending: !!D,
|
|
83
|
+
pendingText: L,
|
|
84
|
+
active: N,
|
|
85
|
+
open: G,
|
|
86
|
+
chips: h.length
|
|
124
87
|
});
|
|
125
88
|
if (t) switch (e.preventDefault(), t) {
|
|
126
89
|
case "next":
|
|
127
90
|
case "prev":
|
|
128
|
-
|
|
91
|
+
M(!0), P((e) => n(G ? e : -1, t, ee(W.length)));
|
|
129
92
|
break;
|
|
130
93
|
case "select": {
|
|
131
|
-
let e =
|
|
132
|
-
e &&
|
|
94
|
+
let e = W[N];
|
|
95
|
+
e && Q(e);
|
|
133
96
|
break;
|
|
134
97
|
}
|
|
135
98
|
case "text":
|
|
136
|
-
|
|
99
|
+
Z(T.trim());
|
|
137
100
|
break;
|
|
138
101
|
case "cancel":
|
|
139
|
-
|
|
102
|
+
q();
|
|
140
103
|
break;
|
|
141
104
|
case "close":
|
|
142
|
-
|
|
105
|
+
M(!1), P(-1);
|
|
143
106
|
break;
|
|
144
107
|
case "dropPending":
|
|
145
|
-
|
|
108
|
+
X();
|
|
146
109
|
break;
|
|
147
|
-
case "removeLast":
|
|
110
|
+
case "removeLast": h[h.length - 1]?.onRemove();
|
|
148
111
|
}
|
|
149
|
-
},
|
|
112
|
+
}, Se = (e) => {
|
|
150
113
|
let t = e.target.value === "";
|
|
151
|
-
e.key === "Escape" ? (e.preventDefault(),
|
|
152
|
-
}, $ = (e) => `${
|
|
153
|
-
return /* @__PURE__ */
|
|
154
|
-
...
|
|
155
|
-
ref:
|
|
156
|
-
className:
|
|
114
|
+
e.key === "Escape" ? (e.preventDefault(), e.stopPropagation(), q(), K()) : e.key === "Backspace" && t && (e.preventDefault(), X());
|
|
115
|
+
}, $ = (e) => `${b}-opt-${e}`;
|
|
116
|
+
return /* @__PURE__ */ l("div", {
|
|
117
|
+
...v,
|
|
118
|
+
ref: ye,
|
|
119
|
+
className: t("kapi-facets", ge),
|
|
157
120
|
role: "search",
|
|
158
|
-
"aria-label":
|
|
121
|
+
"aria-label": _ ?? y.region,
|
|
159
122
|
onMouseDown: (e) => {
|
|
160
|
-
|
|
123
|
+
_e?.(e), !e.defaultPrevented && e.target === e.currentTarget && (e.preventDefault(), C.current?.focus(), M(!0));
|
|
161
124
|
},
|
|
162
125
|
children: [
|
|
163
|
-
/* @__PURE__ */
|
|
126
|
+
/* @__PURE__ */ c(de, {
|
|
164
127
|
className: "kapi-facets__icon",
|
|
165
128
|
size: 15,
|
|
166
129
|
"aria-hidden": !0
|
|
167
130
|
}),
|
|
168
|
-
|
|
131
|
+
h.map((e) => /* @__PURE__ */ c(i, {
|
|
169
132
|
size: "sm",
|
|
170
133
|
onRemove: () => {
|
|
171
|
-
e.onRemove(),
|
|
134
|
+
e.onRemove(), K();
|
|
172
135
|
},
|
|
173
|
-
removeLabel: `${
|
|
174
|
-
children:
|
|
136
|
+
removeLabel: `${y.remove} ${B(e)}`,
|
|
137
|
+
children: B(e)
|
|
175
138
|
}, e.key)),
|
|
176
|
-
|
|
139
|
+
D && /* @__PURE__ */ l(i, {
|
|
177
140
|
size: "sm",
|
|
178
141
|
tone: "primary",
|
|
179
142
|
className: "kapi-facets__pending",
|
|
180
143
|
children: [
|
|
181
|
-
|
|
182
|
-
|
|
144
|
+
D.label,
|
|
145
|
+
k && k !== "eq" ? ` ${z[k]}` : "",
|
|
183
146
|
":"
|
|
184
147
|
]
|
|
185
148
|
}),
|
|
186
|
-
|
|
149
|
+
V && D ? /* @__PURE__ */ c("span", {
|
|
187
150
|
className: "kapi-facets__date",
|
|
188
|
-
|
|
189
|
-
children:
|
|
190
|
-
ref:
|
|
191
|
-
"aria-label": `${
|
|
151
|
+
onKeyDownCapture: Se,
|
|
152
|
+
children: D.kind === "dateRange" ? /* @__PURE__ */ c(ne, {
|
|
153
|
+
ref: w,
|
|
154
|
+
"aria-label": `${y.valuePrefix} ${D.label}`,
|
|
192
155
|
onChange: ({ from: e, to: t }) => {
|
|
193
|
-
e && t && (
|
|
156
|
+
e && t && (D.apply(le(e, t), k ?? "eq"), J());
|
|
194
157
|
}
|
|
195
|
-
}) : /* @__PURE__ */
|
|
196
|
-
ref:
|
|
197
|
-
"aria-label": `${
|
|
158
|
+
}) : /* @__PURE__ */ c(te, {
|
|
159
|
+
ref: w,
|
|
160
|
+
"aria-label": `${y.valuePrefix} ${D.label}`,
|
|
198
161
|
onChange: (e) => {
|
|
199
|
-
e && (
|
|
162
|
+
e && (D.apply(ue(e), k ?? "eq"), J());
|
|
200
163
|
}
|
|
201
164
|
})
|
|
202
|
-
}) : /* @__PURE__ */
|
|
203
|
-
ref:
|
|
165
|
+
}) : /* @__PURE__ */ c("input", {
|
|
166
|
+
ref: C,
|
|
204
167
|
className: "kapi-facets__input",
|
|
205
168
|
type: "text",
|
|
206
169
|
role: "combobox",
|
|
207
170
|
autoComplete: "off",
|
|
208
|
-
"aria-label":
|
|
209
|
-
"aria-expanded":
|
|
210
|
-
"aria-controls":
|
|
171
|
+
"aria-label": y.input,
|
|
172
|
+
"aria-expanded": G,
|
|
173
|
+
"aria-controls": x,
|
|
211
174
|
"aria-autocomplete": "list",
|
|
212
|
-
"aria-activedescendant":
|
|
213
|
-
placeholder:
|
|
214
|
-
value:
|
|
215
|
-
onFocus: () =>
|
|
216
|
-
onClick: () =>
|
|
175
|
+
"aria-activedescendant": G && N >= 0 ? $(N) : void 0,
|
|
176
|
+
placeholder: L ? y.typeValue : h.length === 0 && !D ? y.placeholder : void 0,
|
|
177
|
+
value: T,
|
|
178
|
+
onFocus: () => M(!0),
|
|
179
|
+
onClick: () => M(!0),
|
|
217
180
|
onBlur: (e) => {
|
|
218
181
|
let t = e.relatedTarget;
|
|
219
|
-
(!t || !
|
|
182
|
+
(!t || !S.current?.contains(t)) && M(!1);
|
|
220
183
|
},
|
|
221
184
|
onChange: (e) => {
|
|
222
|
-
|
|
185
|
+
E(e.target.value), M(!0), P(-1);
|
|
223
186
|
},
|
|
224
|
-
onKeyDown:
|
|
187
|
+
onKeyDown: xe
|
|
225
188
|
}),
|
|
226
|
-
|
|
189
|
+
g && h.length > 0 && /* @__PURE__ */ c("button", {
|
|
227
190
|
type: "button",
|
|
228
191
|
className: "kapi-facets__clear",
|
|
229
192
|
onClick: () => {
|
|
230
|
-
|
|
193
|
+
g(), q(), K();
|
|
231
194
|
},
|
|
232
|
-
children:
|
|
195
|
+
children: y.clearAll
|
|
233
196
|
}),
|
|
234
|
-
/* @__PURE__ */
|
|
235
|
-
open:
|
|
236
|
-
anchorRef:
|
|
237
|
-
onClose: () =>
|
|
197
|
+
/* @__PURE__ */ l(ie, {
|
|
198
|
+
open: G,
|
|
199
|
+
anchorRef: S,
|
|
200
|
+
onClose: () => M(!1),
|
|
238
201
|
matchAnchorWidth: !0,
|
|
239
202
|
role: "listbox",
|
|
240
|
-
id:
|
|
241
|
-
"aria-label":
|
|
203
|
+
id: x,
|
|
204
|
+
"aria-label": D ? I ? `${D.label}: ${y.pickOperator}` : D.label : y.input,
|
|
242
205
|
closeOnEscape: !1,
|
|
243
206
|
restoreFocus: !1,
|
|
244
207
|
className: "kapi-facets__menu",
|
|
245
208
|
children: [
|
|
246
|
-
|
|
209
|
+
U && /* @__PURE__ */ c("div", {
|
|
247
210
|
className: "kapi-facets__empty",
|
|
248
|
-
children:
|
|
211
|
+
children: y.loading
|
|
249
212
|
}),
|
|
250
|
-
!
|
|
213
|
+
!U && H?.error && /* @__PURE__ */ c("div", {
|
|
251
214
|
className: "kapi-facets__empty kapi-facets__empty--err",
|
|
252
|
-
children:
|
|
215
|
+
children: y.loadError
|
|
253
216
|
}),
|
|
254
|
-
!
|
|
217
|
+
!U && !H?.error && W.length === 0 && /* @__PURE__ */ c("div", {
|
|
255
218
|
className: "kapi-facets__empty",
|
|
256
|
-
children:
|
|
219
|
+
children: y.empty
|
|
257
220
|
}),
|
|
258
|
-
!
|
|
221
|
+
!U && !H?.error && W.map((e, t) => /* @__PURE__ */ c("div", {
|
|
259
222
|
id: $(t),
|
|
260
223
|
role: "option",
|
|
261
|
-
"aria-selected": t ===
|
|
262
|
-
"aria-label": e.type === "option" ?
|
|
263
|
-
className: `kapi-facets__opt${t ===
|
|
224
|
+
"aria-selected": t === N,
|
|
225
|
+
"aria-label": e.type === "option" ? ce(e.option) : void 0,
|
|
226
|
+
className: `kapi-facets__opt${t === N ? " kapi-facets__opt--active" : ""}`,
|
|
264
227
|
onMouseDown: (e) => e.preventDefault(),
|
|
265
|
-
onMouseEnter: () =>
|
|
266
|
-
onClick: () =>
|
|
267
|
-
children: e.type === "text" ? /* @__PURE__ */
|
|
268
|
-
|
|
228
|
+
onMouseEnter: () => P(t),
|
|
229
|
+
onClick: () => Q(e),
|
|
230
|
+
children: e.type === "text" ? /* @__PURE__ */ l("span", { children: [
|
|
231
|
+
y.searchFor,
|
|
269
232
|
" “",
|
|
270
233
|
e.text,
|
|
271
234
|
"”"
|
|
272
|
-
] }) : e.type === "operator" ? /* @__PURE__ */
|
|
235
|
+
] }) : e.type === "operator" ? /* @__PURE__ */ c("span", { children: z[e.operator] }) : e.type === "option" ? /* @__PURE__ */ l(s, { children: [/* @__PURE__ */ c("span", { children: e.option.label }), e.option.count !== void 0 && /* @__PURE__ */ c("span", {
|
|
273
236
|
className: "kapi-facets__count",
|
|
274
237
|
"aria-hidden": "true",
|
|
275
238
|
children: e.option.count
|
|
276
|
-
})] }) : /* @__PURE__ */
|
|
239
|
+
})] }) : /* @__PURE__ */ l("span", { children: [/* @__PURE__ */ c("span", {
|
|
277
240
|
className: "kapi-facets__facet",
|
|
278
241
|
children: e.facet.label
|
|
279
|
-
}), e.facet.kind !== "flag" && /* @__PURE__ */
|
|
242
|
+
}), e.facet.kind !== "flag" && /* @__PURE__ */ l("span", {
|
|
280
243
|
className: "kapi-facets__hint",
|
|
281
244
|
children: [
|
|
282
245
|
" ",
|
|
283
246
|
"· ",
|
|
284
|
-
e.facet.kind === "text" ?
|
|
247
|
+
e.facet.kind === "text" ? y.typeValue : y.pickValue
|
|
285
248
|
]
|
|
286
249
|
})] })
|
|
287
250
|
}, e.type === "facet" ? `f-${e.facet.key}` : e.type === "option" ? `o-${e.option.value}` : e.type === "operator" ? `op-${e.operator}` : "t"))
|
|
@@ -291,4 +254,4 @@ function p({ facets: p, chips: m, onText: fe, onClearAll: h, loadDelay: g = 300,
|
|
|
291
254
|
});
|
|
292
255
|
}
|
|
293
256
|
//#endregion
|
|
294
|
-
export {
|
|
257
|
+
export { p as DEFAULT_FACETED_SEARCH_LABELS, m as KapiFacetedSearch };
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import { type HTMLAttributes, type ReactNode } from "react";
|
|
2
|
-
import { type KapiFieldContextValue } from "./fieldLogic";
|
|
1
|
+
import { type HTMLAttributes, type ReactNode, type Ref } from "react";
|
|
2
|
+
import { type KapiFieldContextValue, type KapiFieldStatus } from "./fieldLogic.js";
|
|
3
3
|
/**
|
|
4
4
|
* `pending` es para mientras una validación asíncrona resuelve: el campo se marca ocupado pero NO
|
|
5
5
|
* inválido, porque pintarlo en rojo antes de saber el resultado le miente a quien lo está usando.
|
|
6
6
|
*/
|
|
7
|
-
export type
|
|
8
|
-
export type { KapiFieldContextValue };
|
|
7
|
+
export type { KapiFieldContextValue, KapiFieldStatus };
|
|
9
8
|
/** Atributos nativos (`id`, `style`, `data-*`…) van al contenedor; el `id` del control es `htmlFor`. */
|
|
10
9
|
export type KapiFieldProps = Omit<HTMLAttributes<HTMLDivElement>, "children"> & {
|
|
10
|
+
/** Ref al `<div>` raíz del campo. */
|
|
11
|
+
ref?: Ref<HTMLDivElement> | undefined;
|
|
11
12
|
/** Texto de la etiqueta. */
|
|
12
13
|
label?: ReactNode | undefined;
|
|
13
14
|
/** `id` del control que etiqueta. Opcional: sin él se genera uno y el control lo toma del contexto. */
|
|
@@ -19,11 +20,18 @@ export type KapiFieldProps = Omit<HTMLAttributes<HTMLDivElement>, "children"> &
|
|
|
19
20
|
/** `id` del texto de ayuda. Opcional: sin él se deriva del id del control. */
|
|
20
21
|
helpId?: string | undefined;
|
|
21
22
|
/**
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
|
|
23
|
+
* Marca el campo inválido: el control queda `aria-invalid`, la ayuda se pinta de error con ícono e
|
|
24
|
+
* interrumpe (`role="alert"`). Gana sobre `status`.
|
|
25
|
+
*/
|
|
26
|
+
invalid?: boolean | undefined;
|
|
27
|
+
/**
|
|
28
|
+
* Estado de validación no erróneo: `ok` pinta la ayuda en verde con ícono; `pending` deja el control
|
|
29
|
+
* `aria-busy` y anuncia la ayuda sin interrumpir (`aria-live="polite"`), que es lo que corresponde
|
|
30
|
+
* cuando todavía no pasó nada. El valor `err` está deprecado: usa `invalid`.
|
|
25
31
|
*/
|
|
26
32
|
status?: KapiFieldStatus | undefined;
|
|
33
|
+
/** Solo lectura: el control que va adentro se enfoca y se copia, pero no se edita ni se abre. */
|
|
34
|
+
readOnly?: boolean | undefined;
|
|
27
35
|
/** El control del campo (input, select…); recibe `id`, `aria-describedby` y estado del contexto. */
|
|
28
36
|
children: ReactNode;
|
|
29
37
|
};
|
|
@@ -38,4 +46,4 @@ export declare const helpClasses: (status?: KapiFieldStatus) => string;
|
|
|
38
46
|
* Los controles del design system que van adentro toman del contexto su id, la ayuda (`aria-describedby`),
|
|
39
47
|
* `aria-invalid` y `aria-required`; no hace falta cablear ids a mano.
|
|
40
48
|
*/
|
|
41
|
-
export declare const KapiField: ({ label, htmlFor, required, help, helpId: helpIdProp, status, className, children, ...rest }: KapiFieldProps) => import("react").JSX.Element;
|
|
49
|
+
export declare const KapiField: ({ label, htmlFor, required, help, helpId: helpIdProp, invalid: invalidProp, status: statusProp, readOnly, className, children, ...rest }: KapiFieldProps) => import("react").JSX.Element;
|
|
@@ -1,62 +1,63 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
import { jsx as
|
|
4
|
-
import { createContext as
|
|
5
|
-
import { AlertTriangle as
|
|
2
|
+
import { fieldContextValue as e, fieldIds as t, resolveValidation as n } from "./fieldLogic.js";
|
|
3
|
+
import { jsx as r, jsxs as i } from "react/jsx-runtime";
|
|
4
|
+
import { createContext as a, useContext as o, useId as s, useMemo as c } from "react";
|
|
5
|
+
import { AlertTriangle as l, CheckCircle2 as u, LoaderCircle as d } from "lucide-react";
|
|
6
6
|
//#region src/components/inputs/KapiField.tsx
|
|
7
|
-
var
|
|
8
|
-
let
|
|
9
|
-
htmlFor:
|
|
10
|
-
autoId:
|
|
11
|
-
helpId:
|
|
12
|
-
hasHelp:
|
|
13
|
-
}),
|
|
14
|
-
controlId:
|
|
15
|
-
labelId:
|
|
16
|
-
helpId:
|
|
17
|
-
required:
|
|
18
|
-
|
|
19
|
-
|
|
7
|
+
var f = a(null), p = () => o(f), m = (e = "") => ["kapi-field", e].filter(Boolean).join(" "), h = (e) => ["kapi-help", e && `kapi-help--${e}`].filter(Boolean).join(" "), g = ({ label: a, htmlFor: o, required: p = !1, help: g, helpId: _, invalid: v, status: y, readOnly: b, className: x, children: S, ...C }) => {
|
|
8
|
+
let w = s(), T = !!g, { controlId: E, labelId: D, helpId: O } = t({
|
|
9
|
+
htmlFor: o,
|
|
10
|
+
autoId: w,
|
|
11
|
+
helpId: _,
|
|
12
|
+
hasHelp: T
|
|
13
|
+
}), { status: k } = n(v, y), A = a != null, j = c(() => e({
|
|
14
|
+
controlId: E,
|
|
15
|
+
labelId: A ? D : void 0,
|
|
16
|
+
helpId: O,
|
|
17
|
+
required: p,
|
|
18
|
+
status: k,
|
|
19
|
+
readOnly: b
|
|
20
20
|
}), [
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
21
|
+
E,
|
|
22
|
+
D,
|
|
23
|
+
A,
|
|
24
|
+
O,
|
|
25
|
+
p,
|
|
26
|
+
k,
|
|
27
|
+
b
|
|
27
28
|
]);
|
|
28
|
-
return /* @__PURE__ */
|
|
29
|
-
value:
|
|
30
|
-
children: /* @__PURE__ */
|
|
31
|
-
...
|
|
32
|
-
className:
|
|
29
|
+
return /* @__PURE__ */ r(f.Provider, {
|
|
30
|
+
value: j,
|
|
31
|
+
children: /* @__PURE__ */ i("div", {
|
|
32
|
+
...C,
|
|
33
|
+
className: m(x),
|
|
33
34
|
children: [
|
|
34
|
-
|
|
35
|
-
id:
|
|
36
|
-
htmlFor:
|
|
37
|
-
children: [
|
|
35
|
+
a != null && /* @__PURE__ */ i("label", {
|
|
36
|
+
id: D,
|
|
37
|
+
htmlFor: E,
|
|
38
|
+
children: [a, p && " *"]
|
|
38
39
|
}),
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
id:
|
|
42
|
-
className:
|
|
43
|
-
role:
|
|
44
|
-
"aria-live":
|
|
40
|
+
S,
|
|
41
|
+
T ? /* @__PURE__ */ i("span", {
|
|
42
|
+
id: O,
|
|
43
|
+
className: h(k),
|
|
44
|
+
role: k === "err" ? "alert" : void 0,
|
|
45
|
+
"aria-live": k === "pending" ? "polite" : void 0,
|
|
45
46
|
children: [
|
|
46
|
-
|
|
47
|
+
k === "ok" && /* @__PURE__ */ r(u, {
|
|
47
48
|
size: 13,
|
|
48
49
|
strokeWidth: 2.2
|
|
49
50
|
}),
|
|
50
|
-
|
|
51
|
+
k === "err" && /* @__PURE__ */ r(l, {
|
|
51
52
|
size: 13,
|
|
52
53
|
strokeWidth: 2.2
|
|
53
54
|
}),
|
|
54
|
-
|
|
55
|
+
k === "pending" && /* @__PURE__ */ r(d, {
|
|
55
56
|
size: 13,
|
|
56
57
|
strokeWidth: 2.2,
|
|
57
58
|
className: "kapi-spinner"
|
|
58
59
|
}),
|
|
59
|
-
|
|
60
|
+
g
|
|
60
61
|
]
|
|
61
62
|
}) : null
|
|
62
63
|
]
|
|
@@ -64,4 +65,4 @@ var u = r(null), d = () => i(u), f = (e = "") => ["kapi-field", e].filter(Boolea
|
|
|
64
65
|
});
|
|
65
66
|
};
|
|
66
67
|
//#endregion
|
|
67
|
-
export {
|
|
68
|
+
export { g as KapiField, m as fieldClasses, h as helpClasses, p as useKapiField };
|
|
@@ -1,21 +1,20 @@
|
|
|
1
1
|
import { type CSSProperties, type FocusEvent, type Ref } from "react";
|
|
2
|
-
import "
|
|
3
|
-
import type { KapiLabelsOverride } from "../labelsLogic";
|
|
2
|
+
import type { KapiLabelsOverride } from "../labelsLogic.js";
|
|
4
3
|
export type KapiFileUploadProps = {
|
|
5
4
|
/** Permite varios archivos (agrega) o uno solo (reemplaza). */
|
|
6
|
-
multiple?: boolean;
|
|
5
|
+
multiple?: boolean | undefined;
|
|
7
6
|
/** Como el atributo nativo `accept` (p. ej. `.pdf,image/*`). */
|
|
8
|
-
accept?: string;
|
|
7
|
+
accept?: string | undefined;
|
|
9
8
|
/** Texto de ayuda bajo el título. Gana sobre `labels.hint`. */
|
|
10
|
-
hint?: string;
|
|
9
|
+
hint?: string | undefined;
|
|
11
10
|
/** Emite la lista completa de archivos cada vez que cambia (agregar o quitar). */
|
|
12
|
-
onChange?: (files: File[]) => void;
|
|
11
|
+
onChange?: ((files: File[]) => void) | undefined;
|
|
13
12
|
/** Deshabilita la zona de carga (no abre el selector ni acepta archivos soltados). */
|
|
14
|
-
disabled?: boolean;
|
|
13
|
+
disabled?: boolean | undefined;
|
|
15
14
|
/** Clase del envoltorio (zona + lista). */
|
|
16
|
-
className?: string;
|
|
15
|
+
className?: string | undefined;
|
|
17
16
|
/** Estilo del envoltorio (zona + lista). */
|
|
18
|
-
style?: CSSProperties;
|
|
17
|
+
style?: CSSProperties | undefined;
|
|
19
18
|
/** Textos fijos de la zona y del botón quitar. */
|
|
20
19
|
labels?: KapiLabelsOverride<KapiFileUploadLabels> | undefined;
|
|
21
20
|
/**
|
|
@@ -23,20 +22,20 @@ export type KapiFileUploadProps = {
|
|
|
23
22
|
* (también lo arrastrado) vía `DataTransfer`. Sin `DataTransfer` (navegadores viejos, jsdom) el input
|
|
24
23
|
* sólo lleva la última elección: en ese caso el host arma el `FormData` con lo que emite `onChange`.
|
|
25
24
|
*/
|
|
26
|
-
name?: string;
|
|
25
|
+
name?: string | undefined;
|
|
27
26
|
/**
|
|
28
27
|
* `id` de la zona (el control). Sin él, lo toma del `KapiField` que la envuelve. Por eso el
|
|
29
28
|
* passthrough de la raíz no incluye `id`: `className`/`style` van al envoltorio.
|
|
30
29
|
*/
|
|
31
|
-
id?: string;
|
|
30
|
+
id?: string | undefined;
|
|
32
31
|
/** Se dispara cuando el foco sale de la zona. */
|
|
33
|
-
onBlur?: (event: FocusEvent<HTMLDivElement>) => void;
|
|
34
|
-
/** Marca la zona como inválida (`aria-invalid`). Sin la prop, lo toma del `KapiField` (`
|
|
35
|
-
invalid?: boolean;
|
|
32
|
+
onBlur?: ((event: FocusEvent<HTMLDivElement>) => void) | undefined;
|
|
33
|
+
/** Marca la zona como inválida (`aria-invalid`). Sin la prop, lo toma del `KapiField` (`invalid`). */
|
|
34
|
+
invalid?: boolean | undefined;
|
|
36
35
|
/** `id`s extra para `aria-describedby` (se suman a la ayuda del campo y al hint). */
|
|
37
|
-
"aria-describedby"?: string;
|
|
36
|
+
"aria-describedby"?: string | undefined;
|
|
38
37
|
/** Ref a la zona (el elemento enfocable, `role="button"`). */
|
|
39
|
-
ref?: Ref<HTMLDivElement
|
|
38
|
+
ref?: Ref<HTMLDivElement> | undefined;
|
|
40
39
|
};
|
|
41
40
|
export type KapiFileUploadLabels = {
|
|
42
41
|
/** Texto de la zona, antes del enlace. */
|