@kapiuara/ui 0.22.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/base.css +1 -1
- package/dist/css/components/navigation/navigation.css +1 -1
- 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 +35 -36
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import "#kapi-css/components/inputs/KapiFacetedSearch.css";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import { KapiDatePicker as
|
|
9
|
-
import { KapiDateRangePicker as
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
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";
|
|
3
|
+
import { useAsyncLoader as e } from "../../hooks/useAsyncLoader.js";
|
|
4
|
+
import { KapiTag as t } from "../display/KapiTag.js";
|
|
5
|
+
import { KapiPopover as ee } from "../overlays/KapiPopover.js";
|
|
6
|
+
import { useLabels as n } from "../locale/KapiLocaleProvider.js";
|
|
7
|
+
import { joinClasses as r } from "../rootProps.js";
|
|
8
|
+
import { KapiDatePicker as te } from "./KapiDatePicker.js";
|
|
9
|
+
import { KapiDateRangePicker as ne } from "./KapiDateRangePicker.js";
|
|
10
|
+
import { facetChipText as re, facetKeyAction as i, facetMenuItems as ie, facetOperators as a, facetOptionName as ae, isDateFacet as o, toDateRangeValue as oe, toDateValue as se } from "./facetedSearchLogic.js";
|
|
11
|
+
import { enabledIndexes as ce, nextEnabledIndex as le } from "../overlays/menuKeyboardLogic.js";
|
|
13
12
|
/* empty css */
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
|
|
18
|
-
|
|
13
|
+
import { useMergedRefs as s } from "../../hooks/mergeRefs.js";
|
|
14
|
+
import { useId as c, useRef as l, useState as u } from "react";
|
|
15
|
+
import { Fragment as d, jsx as f, jsxs as p } from "react/jsx-runtime";
|
|
16
|
+
import { Search as ue } from "lucide-react";
|
|
17
|
+
// src/components/inputs/KapiFacetedSearch.tsx
|
|
18
|
+
var m = {
|
|
19
19
|
input: "Buscar o filtrar",
|
|
20
20
|
region: "Búsqueda",
|
|
21
21
|
placeholder: "Buscar o filtrar…",
|
|
@@ -39,8 +39,8 @@ var p = {
|
|
|
39
39
|
operatorLt: "menor que",
|
|
40
40
|
operatorLte: "menor o igual que"
|
|
41
41
|
};
|
|
42
|
-
function
|
|
43
|
-
let y =
|
|
42
|
+
function h({ facets: h, chips: g, onText: de, onClearAll: _, loadDelay: fe = 300, reloadKey: pe, labels: me, className: he, onMouseDown: ge, "aria-label": v, ref: _e, ...ve }) {
|
|
43
|
+
let y = n("facetedSearch", m, me), b = c(), x = `${b}-list`, S = l(null), ye = s(S, _e), C = l(null), w = l(null), [T, E] = u(""), [D, O] = u(null), [k, A] = u(null), [j, M] = u(!1), [N, P] = u(-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
44
|
eq: y.operatorEq,
|
|
45
45
|
ne: y.operatorNe,
|
|
46
46
|
contains: y.operatorContains,
|
|
@@ -50,15 +50,15 @@ function m({ facets: m, chips: h, onText: fe, onClearAll: g, loadDelay: pe = 300
|
|
|
50
50
|
gte: y.operatorGte,
|
|
51
51
|
lt: y.operatorLt,
|
|
52
52
|
lte: y.operatorLte
|
|
53
|
-
}, B = (e) =>
|
|
53
|
+
}, B = (e) => re(e, e.operator ? z[e.operator] : void 0), V = o(D) && !I, be = e({
|
|
54
54
|
query: F,
|
|
55
55
|
key: `${D?.key ?? ""}\u0000${F}`,
|
|
56
56
|
enabled: R && j && !V,
|
|
57
57
|
load: D?.loadOptions,
|
|
58
|
-
delay:
|
|
59
|
-
reloadKey:
|
|
58
|
+
delay: fe,
|
|
59
|
+
reloadKey: pe,
|
|
60
60
|
onLoaded: () => P(-1)
|
|
61
|
-
}), H = R ? be.result : null, U = R && !H, W =
|
|
61
|
+
}), H = R ? be.result : null, U = R && !H, W = ie(h, D, T, H && !H.error ? H.data : void 0, k), G = j && !V && !(L && W.length === 0), K = () => requestAnimationFrame(() => C.current?.focus()), q = () => {
|
|
62
62
|
E(""), O(null), A(null), P(-1);
|
|
63
63
|
}, J = () => {
|
|
64
64
|
q(), M(!1), K();
|
|
@@ -67,7 +67,7 @@ function m({ facets: m, chips: h, onText: fe, onClearAll: g, loadDelay: pe = 300
|
|
|
67
67
|
}, X = () => {
|
|
68
68
|
k !== null && D && a(D).length >= 2 || O(null), A(null), P(-1), K();
|
|
69
69
|
}, Z = (e) => {
|
|
70
|
-
D?.kind === "text" ? D.apply(e, k ?? "eq") :
|
|
70
|
+
D?.kind === "text" ? D.apply(e, k ?? "eq") : de(e), J();
|
|
71
71
|
}, Q = (e) => {
|
|
72
72
|
if (e.type === "text") Z(e.text);
|
|
73
73
|
else if (e.type === "option") D?.apply(e.option.value, k ?? "eq"), J();
|
|
@@ -77,18 +77,18 @@ function m({ facets: m, chips: h, onText: fe, onClearAll: g, loadDelay: pe = 300
|
|
|
77
77
|
t.length >= 2 ? (O(e.facet), A(null), E(""), P(-1), M(!0), K()) : Y(e.facet, t[0] ?? "eq");
|
|
78
78
|
}
|
|
79
79
|
}, xe = (e) => {
|
|
80
|
-
let t =
|
|
80
|
+
let t = i(e.key, {
|
|
81
81
|
input: T,
|
|
82
82
|
pending: !!D,
|
|
83
83
|
pendingText: L,
|
|
84
84
|
active: N,
|
|
85
85
|
open: G,
|
|
86
|
-
chips:
|
|
86
|
+
chips: g.length
|
|
87
87
|
});
|
|
88
88
|
if (t) switch (e.preventDefault(), t) {
|
|
89
89
|
case "next":
|
|
90
90
|
case "prev":
|
|
91
|
-
M(!0), P((e) =>
|
|
91
|
+
M(!0), P((e) => le(G ? e : -1, t, ce(W.length)));
|
|
92
92
|
break;
|
|
93
93
|
case "select": {
|
|
94
94
|
let e = W[N];
|
|
@@ -107,28 +107,28 @@ function m({ facets: m, chips: h, onText: fe, onClearAll: g, loadDelay: pe = 300
|
|
|
107
107
|
case "dropPending":
|
|
108
108
|
X();
|
|
109
109
|
break;
|
|
110
|
-
case "removeLast":
|
|
110
|
+
case "removeLast": g[g.length - 1]?.onRemove();
|
|
111
111
|
}
|
|
112
112
|
}, Se = (e) => {
|
|
113
113
|
let t = e.target.value === "";
|
|
114
114
|
e.key === "Escape" ? (e.preventDefault(), e.stopPropagation(), q(), K()) : e.key === "Backspace" && t && (e.preventDefault(), X());
|
|
115
115
|
}, $ = (e) => `${b}-opt-${e}`;
|
|
116
|
-
return /* @__PURE__ */
|
|
117
|
-
...
|
|
116
|
+
return /* @__PURE__ */ p("div", {
|
|
117
|
+
...ve,
|
|
118
118
|
ref: ye,
|
|
119
|
-
className:
|
|
119
|
+
className: r("kapi-facets", he),
|
|
120
120
|
role: "search",
|
|
121
|
-
"aria-label":
|
|
121
|
+
"aria-label": v ?? y.region,
|
|
122
122
|
onMouseDown: (e) => {
|
|
123
|
-
|
|
123
|
+
ge?.(e), e.defaultPrevented || e.target === e.currentTarget && (e.preventDefault(), C.current?.focus(), M(!0));
|
|
124
124
|
},
|
|
125
125
|
children: [
|
|
126
|
-
/* @__PURE__ */
|
|
126
|
+
/* @__PURE__ */ f(ue, {
|
|
127
127
|
className: "kapi-facets__icon",
|
|
128
128
|
size: 15,
|
|
129
129
|
"aria-hidden": !0
|
|
130
130
|
}),
|
|
131
|
-
|
|
131
|
+
g.map((e) => /* @__PURE__ */ f(t, {
|
|
132
132
|
size: "sm",
|
|
133
133
|
onRemove: () => {
|
|
134
134
|
e.onRemove(), K();
|
|
@@ -136,7 +136,7 @@ function m({ facets: m, chips: h, onText: fe, onClearAll: g, loadDelay: pe = 300
|
|
|
136
136
|
removeLabel: `${y.remove} ${B(e)}`,
|
|
137
137
|
children: B(e)
|
|
138
138
|
}, e.key)),
|
|
139
|
-
D && /* @__PURE__ */
|
|
139
|
+
D && /* @__PURE__ */ p(t, {
|
|
140
140
|
size: "sm",
|
|
141
141
|
tone: "primary",
|
|
142
142
|
className: "kapi-facets__pending",
|
|
@@ -146,23 +146,23 @@ function m({ facets: m, chips: h, onText: fe, onClearAll: g, loadDelay: pe = 300
|
|
|
146
146
|
":"
|
|
147
147
|
]
|
|
148
148
|
}),
|
|
149
|
-
V && D ? /* @__PURE__ */
|
|
149
|
+
V && D ? /* @__PURE__ */ f("span", {
|
|
150
150
|
className: "kapi-facets__date",
|
|
151
151
|
onKeyDownCapture: Se,
|
|
152
|
-
children: D.kind === "dateRange" ? /* @__PURE__ */
|
|
152
|
+
children: D.kind === "dateRange" ? /* @__PURE__ */ f(ne, {
|
|
153
153
|
ref: w,
|
|
154
154
|
"aria-label": `${y.valuePrefix} ${D.label}`,
|
|
155
155
|
onChange: ({ from: e, to: t }) => {
|
|
156
|
-
e && t && (D.apply(
|
|
156
|
+
e && t && (D.apply(oe(e, t), k ?? "eq"), J());
|
|
157
157
|
}
|
|
158
|
-
}) : /* @__PURE__ */
|
|
158
|
+
}) : /* @__PURE__ */ f(te, {
|
|
159
159
|
ref: w,
|
|
160
160
|
"aria-label": `${y.valuePrefix} ${D.label}`,
|
|
161
161
|
onChange: (e) => {
|
|
162
|
-
e && (D.apply(
|
|
162
|
+
e && (D.apply(se(e), k ?? "eq"), J());
|
|
163
163
|
}
|
|
164
164
|
})
|
|
165
|
-
}) : /* @__PURE__ */
|
|
165
|
+
}) : /* @__PURE__ */ f("input", {
|
|
166
166
|
ref: C,
|
|
167
167
|
className: "kapi-facets__input",
|
|
168
168
|
type: "text",
|
|
@@ -173,28 +173,28 @@ function m({ facets: m, chips: h, onText: fe, onClearAll: g, loadDelay: pe = 300
|
|
|
173
173
|
"aria-controls": x,
|
|
174
174
|
"aria-autocomplete": "list",
|
|
175
175
|
"aria-activedescendant": G && N >= 0 ? $(N) : void 0,
|
|
176
|
-
placeholder: L ? y.typeValue :
|
|
176
|
+
placeholder: L ? y.typeValue : g.length === 0 && !D ? y.placeholder : void 0,
|
|
177
177
|
value: T,
|
|
178
178
|
onFocus: () => M(!0),
|
|
179
179
|
onClick: () => M(!0),
|
|
180
180
|
onBlur: (e) => {
|
|
181
181
|
let t = e.relatedTarget;
|
|
182
|
-
|
|
182
|
+
t && S.current?.contains(t) || M(!1);
|
|
183
183
|
},
|
|
184
184
|
onChange: (e) => {
|
|
185
185
|
E(e.target.value), M(!0), P(-1);
|
|
186
186
|
},
|
|
187
187
|
onKeyDown: xe
|
|
188
188
|
}),
|
|
189
|
-
|
|
189
|
+
_ && g.length > 0 && /* @__PURE__ */ f("button", {
|
|
190
190
|
type: "button",
|
|
191
191
|
className: "kapi-facets__clear",
|
|
192
192
|
onClick: () => {
|
|
193
|
-
|
|
193
|
+
_(), q(), K();
|
|
194
194
|
},
|
|
195
195
|
children: y.clearAll
|
|
196
196
|
}),
|
|
197
|
-
/* @__PURE__ */
|
|
197
|
+
/* @__PURE__ */ p(ee, {
|
|
198
198
|
open: G,
|
|
199
199
|
anchorRef: S,
|
|
200
200
|
onClose: () => M(!1),
|
|
@@ -206,40 +206,40 @@ function m({ facets: m, chips: h, onText: fe, onClearAll: g, loadDelay: pe = 300
|
|
|
206
206
|
restoreFocus: !1,
|
|
207
207
|
className: "kapi-facets__menu",
|
|
208
208
|
children: [
|
|
209
|
-
U && /* @__PURE__ */
|
|
209
|
+
U && /* @__PURE__ */ f("div", {
|
|
210
210
|
className: "kapi-facets__empty",
|
|
211
211
|
children: y.loading
|
|
212
212
|
}),
|
|
213
|
-
!U && H?.error && /* @__PURE__ */
|
|
213
|
+
!U && H?.error && /* @__PURE__ */ f("div", {
|
|
214
214
|
className: "kapi-facets__empty kapi-facets__empty--err",
|
|
215
215
|
children: y.loadError
|
|
216
216
|
}),
|
|
217
|
-
!U && !H?.error && W.length === 0 && /* @__PURE__ */
|
|
217
|
+
!U && !H?.error && W.length === 0 && /* @__PURE__ */ f("div", {
|
|
218
218
|
className: "kapi-facets__empty",
|
|
219
219
|
children: y.empty
|
|
220
220
|
}),
|
|
221
|
-
!U && !H?.error && W.map((e, t) => /* @__PURE__ */
|
|
221
|
+
!U && !H?.error && W.map((e, t) => /* @__PURE__ */ f("div", {
|
|
222
222
|
id: $(t),
|
|
223
223
|
role: "option",
|
|
224
224
|
"aria-selected": t === N,
|
|
225
|
-
"aria-label": e.type === "option" ?
|
|
225
|
+
"aria-label": e.type === "option" ? ae(e.option) : void 0,
|
|
226
226
|
className: `kapi-facets__opt${t === N ? " kapi-facets__opt--active" : ""}`,
|
|
227
227
|
onMouseDown: (e) => e.preventDefault(),
|
|
228
228
|
onMouseEnter: () => P(t),
|
|
229
229
|
onClick: () => Q(e),
|
|
230
|
-
children: e.type === "text" ? /* @__PURE__ */
|
|
230
|
+
children: e.type === "text" ? /* @__PURE__ */ p("span", { children: [
|
|
231
231
|
y.searchFor,
|
|
232
232
|
" “",
|
|
233
233
|
e.text,
|
|
234
234
|
"”"
|
|
235
|
-
] }) : e.type === "operator" ? /* @__PURE__ */
|
|
235
|
+
] }) : e.type === "operator" ? /* @__PURE__ */ f("span", { children: z[e.operator] }) : e.type === "option" ? /* @__PURE__ */ p(d, { children: [/* @__PURE__ */ f("span", { children: e.option.label }), e.option.count !== void 0 && /* @__PURE__ */ f("span", {
|
|
236
236
|
className: "kapi-facets__count",
|
|
237
237
|
"aria-hidden": "true",
|
|
238
238
|
children: e.option.count
|
|
239
|
-
})] }) : /* @__PURE__ */
|
|
239
|
+
})] }) : /* @__PURE__ */ p("span", { children: [/* @__PURE__ */ f("span", {
|
|
240
240
|
className: "kapi-facets__facet",
|
|
241
241
|
children: e.facet.label
|
|
242
|
-
}), e.facet.kind !== "flag" && /* @__PURE__ */
|
|
242
|
+
}), e.facet.kind !== "flag" && /* @__PURE__ */ p("span", {
|
|
243
243
|
className: "kapi-facets__hint",
|
|
244
244
|
children: [
|
|
245
245
|
" ",
|
|
@@ -253,5 +253,4 @@ function m({ facets: m, chips: h, onText: fe, onClearAll: g, loadDelay: pe = 300
|
|
|
253
253
|
]
|
|
254
254
|
});
|
|
255
255
|
}
|
|
256
|
-
|
|
257
|
-
export { p as DEFAULT_FACETED_SEARCH_LABELS, m as KapiFacetedSearch };
|
|
256
|
+
export { m as DEFAULT_FACETED_SEARCH_LABELS, h as KapiFacetedSearch };
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { fieldContextValue as e, fieldIds as t, resolveFieldMessage as n } from "./fieldLogic.js";
|
|
3
|
+
import { present as r } from "./inputLogic.js";
|
|
4
4
|
import { createContext as i, useContext as a, useId as o, useMemo as s } from "react";
|
|
5
5
|
import { jsx as c, jsxs as l } from "react/jsx-runtime";
|
|
6
6
|
import { AlertTriangle as u, CheckCircle2 as d, LoaderCircle as f } from "lucide-react";
|
|
7
|
-
|
|
7
|
+
// src/components/inputs/KapiField.tsx
|
|
8
8
|
var p = i(null), m = () => a(p), h = (e = "") => ["kapi-field", e].filter(Boolean).join(" "), g = (e) => ["kapi-help", e && `kapi-help--${e}`].filter(Boolean).join(" "), _ = ({ label: i, htmlFor: a, required: m = !1, help: _, error: v, helpId: y, invalid: b, status: x, readOnly: S, className: C, children: w, ...T }) => {
|
|
9
|
-
let E = o(), { message: D, status: O } =
|
|
9
|
+
let E = o(), { message: D, status: O } = n(v, _, b, x), k = r(D), { controlId: A, labelId: j, helpId: M } = t({
|
|
10
10
|
htmlFor: a,
|
|
11
11
|
autoId: E,
|
|
12
12
|
helpId: y,
|
|
13
13
|
hasHelp: k
|
|
14
|
-
}), N = i != null, P = s(() =>
|
|
14
|
+
}), N = i != null, P = s(() => e({
|
|
15
15
|
controlId: A,
|
|
16
16
|
labelId: N ? j : void 0,
|
|
17
17
|
helpId: M,
|
|
@@ -65,5 +65,4 @@ var p = i(null), m = () => a(p), h = (e = "") => ["kapi-field", e].filter(Boolea
|
|
|
65
65
|
})
|
|
66
66
|
});
|
|
67
67
|
};
|
|
68
|
-
//#endregion
|
|
69
68
|
export { _ as KapiField, h as fieldClasses, g as helpClasses, m as useKapiField };
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import "#kapi-css/components/inputs/KapiFileUpload.css";
|
|
3
|
-
import {
|
|
4
|
-
import { useLabels as t } from "../locale/KapiLocaleProvider.js";
|
|
5
|
-
import { fieldControlProps as n, joinIds as r } from "./fieldLogic.js";
|
|
6
|
-
import { useKapiField as i } from "./KapiField.js";
|
|
7
|
-
import { formatFileSize as a, isActivationKey as o, matchesAccept as s, mergeFiles as c, removeFileAt as l } from "./fileUploadLogic.js";
|
|
3
|
+
import { formatFileSize as e, isActivationKey as t, matchesAccept as n, mergeFiles as r, removeFileAt as i } from "./fileUploadLogic.js";
|
|
8
4
|
/* empty css */
|
|
9
|
-
import {
|
|
5
|
+
import { useLabels as a } from "../locale/KapiLocaleProvider.js";
|
|
6
|
+
import { KapiProgress as o } from "../feedback/KapiProgress.js";
|
|
7
|
+
import { useKapiField as s } from "./KapiField.js";
|
|
8
|
+
import { fieldControlProps as c, joinIds as l } from "./fieldLogic.js";
|
|
9
|
+
import { joinClasses as u } from "../rootProps.js";
|
|
10
10
|
import { useEffect as d, useId as f, useRef as p, useState as m } from "react";
|
|
11
11
|
import { jsx as h, jsxs as g } from "react/jsx-runtime";
|
|
12
12
|
import { FileText as _, UploadCloud as v, X as y } from "lucide-react";
|
|
13
|
-
|
|
13
|
+
// src/components/inputs/KapiFileUpload.tsx
|
|
14
14
|
var b = {
|
|
15
15
|
drop: "Arrastra archivos o",
|
|
16
16
|
choose: "elige",
|
|
@@ -18,9 +18,9 @@ var b = {
|
|
|
18
18
|
hint: "PDF, JPG, PNG · hasta 10MB",
|
|
19
19
|
uploading: "Subiendo"
|
|
20
20
|
}, x = ({ multiple: x = !0, accept: S, hint: C, onChange: w, disabled: T = !1, className: E, style: D, labels: O, name: k, id: A, onBlur: j, invalid: M, progress: N, paste: P = !1, "aria-describedby": F, ref: I }) => {
|
|
21
|
-
let L =
|
|
21
|
+
let L = a("fileUpload", b, O), R = C ?? L.hint, z = s(), [B, V] = m([]), [H, U] = m(!1), W = p(null), G = f(), K = `${G}-title`, q = `${G}-hint`, J = !!z?.labelId, Y = c(z, {
|
|
22
22
|
id: A,
|
|
23
|
-
describedBy:
|
|
23
|
+
describedBy: l(J && q, F),
|
|
24
24
|
invalid: M
|
|
25
25
|
});
|
|
26
26
|
d(() => {
|
|
@@ -33,10 +33,10 @@ var b = {
|
|
|
33
33
|
V(e), w?.(e);
|
|
34
34
|
}, Z = (e) => {
|
|
35
35
|
let t = Array.from(e ?? []);
|
|
36
|
-
t.length !== 0 && X(
|
|
36
|
+
t.length !== 0 && X(r(B, t, x));
|
|
37
37
|
}, Q = () => W.current?.click();
|
|
38
38
|
return /* @__PURE__ */ g("div", {
|
|
39
|
-
className:
|
|
39
|
+
className: u("kapi-upload-wrap", E),
|
|
40
40
|
style: D,
|
|
41
41
|
children: [
|
|
42
42
|
/* @__PURE__ */ g("div", {
|
|
@@ -44,12 +44,12 @@ var b = {
|
|
|
44
44
|
id: Y.id,
|
|
45
45
|
"aria-describedby": Y["aria-describedby"],
|
|
46
46
|
"aria-invalid": Y["aria-invalid"],
|
|
47
|
-
"aria-labelledby": J ?
|
|
47
|
+
"aria-labelledby": J ? l(z?.labelId, K) : void 0,
|
|
48
48
|
onBlur: j,
|
|
49
49
|
className: `kapi-upload${H ? " is-over" : ""}`,
|
|
50
50
|
onClick: Q,
|
|
51
51
|
onKeyDown: (e) => {
|
|
52
|
-
|
|
52
|
+
t(e.key) && (e.preventDefault(), Q());
|
|
53
53
|
},
|
|
54
54
|
onDragOver: (e) => {
|
|
55
55
|
e.preventDefault(), T || U(!0);
|
|
@@ -57,13 +57,13 @@ var b = {
|
|
|
57
57
|
onDragLeave: () => U(!1),
|
|
58
58
|
onDrop: (e) => {
|
|
59
59
|
if (e.preventDefault(), U(!1), T) return;
|
|
60
|
-
let t = Array.from(e.dataTransfer.files).filter((e) =>
|
|
61
|
-
t.length !== 0 && X(
|
|
60
|
+
let t = Array.from(e.dataTransfer.files).filter((e) => n(e, S));
|
|
61
|
+
t.length !== 0 && X(r(B, t, x));
|
|
62
62
|
},
|
|
63
63
|
onPaste: (e) => {
|
|
64
64
|
if (!P || T) return;
|
|
65
|
-
let t = Array.from(e.clipboardData?.files ?? []).filter((e) =>
|
|
66
|
-
t.length !== 0 && (e.preventDefault(), X(
|
|
65
|
+
let t = Array.from(e.clipboardData?.files ?? []).filter((e) => n(e, S));
|
|
66
|
+
t.length !== 0 && (e.preventDefault(), X(r(B, t, x)));
|
|
67
67
|
},
|
|
68
68
|
role: "button",
|
|
69
69
|
tabIndex: T ? -1 : 0,
|
|
@@ -107,7 +107,7 @@ var b = {
|
|
|
107
107
|
}),
|
|
108
108
|
B.length > 0 && /* @__PURE__ */ h("div", {
|
|
109
109
|
className: "kapi-upload__list",
|
|
110
|
-
children: B.map((
|
|
110
|
+
children: B.map((t, n) => /* @__PURE__ */ g("div", {
|
|
111
111
|
className: "kapi-upload__file",
|
|
112
112
|
children: [
|
|
113
113
|
/* @__PURE__ */ h(_, {
|
|
@@ -117,32 +117,31 @@ var b = {
|
|
|
117
117
|
}),
|
|
118
118
|
/* @__PURE__ */ h("span", {
|
|
119
119
|
className: "kapi-upload__name",
|
|
120
|
-
children:
|
|
120
|
+
children: t.name
|
|
121
121
|
}),
|
|
122
122
|
/* @__PURE__ */ h("span", {
|
|
123
123
|
className: "kapi-upload__size",
|
|
124
|
-
children:
|
|
124
|
+
children: e(t.size)
|
|
125
125
|
}),
|
|
126
126
|
/* @__PURE__ */ h("button", {
|
|
127
127
|
type: "button",
|
|
128
|
-
"aria-label": `${L.remove} ${
|
|
129
|
-
onClick: () => X(
|
|
128
|
+
"aria-label": `${L.remove} ${t.name}`,
|
|
129
|
+
onClick: () => X(i(B, n)),
|
|
130
130
|
children: /* @__PURE__ */ h(y, {
|
|
131
131
|
size: 15,
|
|
132
132
|
strokeWidth: 2.2
|
|
133
133
|
})
|
|
134
134
|
}),
|
|
135
|
-
N?.(
|
|
135
|
+
N?.(t, n) !== void 0 && /* @__PURE__ */ h(o, {
|
|
136
136
|
className: "kapi-upload__progress",
|
|
137
|
-
value: N(
|
|
137
|
+
value: N(t, n) ?? 0,
|
|
138
138
|
size: "sm",
|
|
139
|
-
label: `${L.uploading} ${
|
|
139
|
+
label: `${L.uploading} ${t.name}`
|
|
140
140
|
})
|
|
141
141
|
]
|
|
142
|
-
}, `${
|
|
142
|
+
}, `${t.name}-${n}`))
|
|
143
143
|
})
|
|
144
144
|
]
|
|
145
145
|
});
|
|
146
146
|
};
|
|
147
|
-
//#endregion
|
|
148
147
|
export { b as DEFAULT_FILE_UPLOAD_LABELS, x as KapiFileUpload };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { renderSlot as e } from "../renderSlot.js";
|
|
3
3
|
import { jsx as t } from "react/jsx-runtime";
|
|
4
|
-
|
|
4
|
+
// src/components/inputs/KapiIconButton.tsx
|
|
5
5
|
var n = (e = "") => [
|
|
6
6
|
"kapi-btn",
|
|
7
7
|
"kapi-btn--icon",
|
|
@@ -29,5 +29,4 @@ var n = (e = "") => [
|
|
|
29
29
|
children: u
|
|
30
30
|
}));
|
|
31
31
|
};
|
|
32
|
-
//#endregion
|
|
33
32
|
export { r as KapiIconButton, n as iconButtonClasses };
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import "#kapi-css/components/inputs/inputsExtra.css";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
3
|
+
import { useOwnField as e } from "./ownField.js";
|
|
4
|
+
import { fieldControlProps as t, joinIds as n, resolveFieldMessage as r } from "./fieldLogic.js";
|
|
5
|
+
import { useKapiInputGroup as ee } from "./KapiInputGroup.js";
|
|
6
|
+
import { resolveGroupSize as te } from "./inputGroupLogic.js";
|
|
7
|
+
import { hasAdornments as ne, hasValue as i, inputBoxClasses as a, present as o, tipoDeCampo as re } from "./inputLogic.js";
|
|
8
|
+
import { useLabels as ie } from "../locale/KapiLocaleProvider.js";
|
|
9
9
|
/* empty css */
|
|
10
|
-
import { useEffect as
|
|
11
|
-
import { jsx as
|
|
12
|
-
import { Eye as
|
|
13
|
-
|
|
14
|
-
var
|
|
10
|
+
import { useEffect as ae, useId as s, useRef as c, useState as l } from "react";
|
|
11
|
+
import { jsx as u, jsxs as oe } from "react/jsx-runtime";
|
|
12
|
+
import { Eye as d, EyeOff as f, X as se } from "lucide-react";
|
|
13
|
+
// src/components/inputs/KapiInput.tsx
|
|
14
|
+
var p = {
|
|
15
15
|
clear: "Limpiar",
|
|
16
16
|
show: "Mostrar la contraseña",
|
|
17
17
|
hide: "Ocultar la contraseña"
|
|
18
|
-
},
|
|
18
|
+
}, m = (e) => {
|
|
19
19
|
Object.getOwnPropertyDescriptor(HTMLInputElement.prototype, "value")?.set?.call(e, ""), e.dispatchEvent(new Event("input", { bubbles: !0 }));
|
|
20
20
|
}, h = ({ size: e = "md", status: t, num: n = !1, className: r = "" } = {}) => [
|
|
21
21
|
"kapi-input",
|
|
@@ -24,7 +24,7 @@ var m = {
|
|
|
24
24
|
t && `kapi-input--${t}`,
|
|
25
25
|
r
|
|
26
26
|
].filter(Boolean).join(" "), g = (g) => {
|
|
27
|
-
let { size:
|
|
27
|
+
let { size: ce, invalid: _, status: v, num: le, label: y, required: b, help: x, error: S, fieldClassName: ue, className: C, multiline: w, id: T, startIcon: E, endIcon: D, prefix: O, suffix: k, clearable: A, onClear: de, reveal: j, shortcut: M, labels: N, ref: P, ...F } = g, I = P, { invalid: L, status: R } = r(S, x, _, v), z = ie("input", p, N), B = te(ce, ee()?.size), V = !w && ne({
|
|
28
28
|
startIcon: E,
|
|
29
29
|
endIcon: D,
|
|
30
30
|
prefix: O,
|
|
@@ -32,109 +32,109 @@ var m = {
|
|
|
32
32
|
clearable: A,
|
|
33
33
|
reveal: j,
|
|
34
34
|
shortcut: M
|
|
35
|
-
}), [H, U] =
|
|
36
|
-
|
|
35
|
+
}), [H, U] = l(!1), W = c(null), G = F;
|
|
36
|
+
ae(() => {
|
|
37
37
|
G.disabled && U(!1);
|
|
38
38
|
}, [G.disabled]);
|
|
39
|
-
let K =
|
|
39
|
+
let K = re({
|
|
40
40
|
reveal: j,
|
|
41
41
|
revealed: H,
|
|
42
42
|
disabled: G.disabled
|
|
43
|
-
}), [fe, q] =
|
|
44
|
-
id:
|
|
45
|
-
label:
|
|
43
|
+
}), [fe, q] = l(() => i(G.defaultValue)), J = e({
|
|
44
|
+
id: T,
|
|
45
|
+
label: y,
|
|
46
46
|
help: x,
|
|
47
47
|
error: S,
|
|
48
48
|
required: b,
|
|
49
|
-
invalid:
|
|
50
|
-
status:
|
|
51
|
-
fieldClassName:
|
|
52
|
-
}), { controlId: pe, helpId: me } = J, Y =
|
|
53
|
-
...
|
|
49
|
+
invalid: _,
|
|
50
|
+
status: v,
|
|
51
|
+
fieldClassName: ue
|
|
52
|
+
}), { controlId: pe, helpId: me } = J, Y = s(), X = V && o(O) ? `${Y}-prefix` : void 0, Z = V && o(k) ? `${Y}-suffix` : void 0, Q = {
|
|
53
|
+
...t(J.outer, {
|
|
54
54
|
id: pe,
|
|
55
|
-
describedBy:
|
|
55
|
+
describedBy: n(me, F["aria-describedby"], X, Z),
|
|
56
56
|
invalid: L
|
|
57
57
|
}),
|
|
58
58
|
required: b,
|
|
59
59
|
className: V ? "kapi-inputbox__control" : h({
|
|
60
60
|
size: B,
|
|
61
61
|
status: R,
|
|
62
|
-
num:
|
|
63
|
-
className:
|
|
62
|
+
num: le,
|
|
63
|
+
className: C
|
|
64
64
|
})
|
|
65
65
|
}, he = (e) => {
|
|
66
66
|
W.current = e, typeof I == "function" ? I(e) : I && (I.current = e);
|
|
67
|
-
}, $ = G.value === void 0 ? fe :
|
|
67
|
+
}, $ = G.value === void 0 ? fe : i(G.value), ge = () => {
|
|
68
68
|
let e = W.current;
|
|
69
|
-
e && (
|
|
70
|
-
}, _e =
|
|
69
|
+
e && (m(e), q(!1), e.focus(), de?.());
|
|
70
|
+
}, _e = w ? /* @__PURE__ */ u("textarea", {
|
|
71
71
|
ref: I,
|
|
72
72
|
...F,
|
|
73
73
|
...Q
|
|
74
|
-
}) : V ? /* @__PURE__ */
|
|
75
|
-
className:
|
|
74
|
+
}) : V ? /* @__PURE__ */ oe("div", {
|
|
75
|
+
className: a({
|
|
76
76
|
size: B,
|
|
77
77
|
status: R,
|
|
78
78
|
disabled: G.disabled,
|
|
79
|
-
className:
|
|
79
|
+
className: C
|
|
80
80
|
}),
|
|
81
81
|
onMouseDown: (e) => {
|
|
82
82
|
e.target === W.current || G.disabled || (e.preventDefault(), W.current?.focus());
|
|
83
83
|
},
|
|
84
84
|
children: [
|
|
85
|
-
|
|
85
|
+
o(E) && /* @__PURE__ */ u("span", {
|
|
86
86
|
className: "kapi-inputbox__icon",
|
|
87
87
|
"aria-hidden": "true",
|
|
88
88
|
children: E
|
|
89
89
|
}),
|
|
90
|
-
|
|
90
|
+
o(O) && /* @__PURE__ */ u("span", {
|
|
91
91
|
id: X,
|
|
92
92
|
className: "kapi-inputbox__affix",
|
|
93
93
|
children: O
|
|
94
94
|
}),
|
|
95
|
-
/* @__PURE__ */
|
|
95
|
+
/* @__PURE__ */ u("input", {
|
|
96
96
|
ref: he,
|
|
97
97
|
...G,
|
|
98
98
|
...Q,
|
|
99
99
|
...K ? { type: K } : {},
|
|
100
100
|
"aria-keyshortcuts": G["aria-keyshortcuts"] ?? (M || void 0),
|
|
101
101
|
onChange: (e) => {
|
|
102
|
-
q(
|
|
102
|
+
q(i(e.target.value)), G.onChange?.(e);
|
|
103
103
|
}
|
|
104
104
|
}),
|
|
105
|
-
|
|
105
|
+
o(k) && /* @__PURE__ */ u("span", {
|
|
106
106
|
id: Z,
|
|
107
107
|
className: "kapi-inputbox__affix",
|
|
108
108
|
children: k
|
|
109
109
|
}),
|
|
110
|
-
j && !G.disabled && /* @__PURE__ */
|
|
110
|
+
j && !G.disabled && /* @__PURE__ */ u("button", {
|
|
111
111
|
type: "button",
|
|
112
112
|
className: "kapi-inputbox__reveal",
|
|
113
113
|
"aria-label": H ? z.hide : z.show,
|
|
114
114
|
"aria-pressed": H,
|
|
115
115
|
onClick: () => U((e) => !e),
|
|
116
|
-
children:
|
|
116
|
+
children: u(H ? f : d, { "aria-hidden": "true" })
|
|
117
117
|
}),
|
|
118
|
-
A && $ && !G.disabled && !G.readOnly && /* @__PURE__ */
|
|
118
|
+
A && $ && !G.disabled && !G.readOnly && /* @__PURE__ */ u("button", {
|
|
119
119
|
type: "button",
|
|
120
120
|
tabIndex: -1,
|
|
121
121
|
className: "kapi-inputbox__clear",
|
|
122
122
|
"aria-label": z.clear,
|
|
123
123
|
onClick: ge,
|
|
124
|
-
children: /* @__PURE__ */
|
|
124
|
+
children: /* @__PURE__ */ u(se, { "aria-hidden": "true" })
|
|
125
125
|
}),
|
|
126
|
-
M && !$ && /* @__PURE__ */
|
|
126
|
+
M && !$ && /* @__PURE__ */ u("kbd", {
|
|
127
127
|
className: "kapi-inputbox__kbd",
|
|
128
128
|
"aria-hidden": "true",
|
|
129
129
|
children: M
|
|
130
130
|
}),
|
|
131
|
-
|
|
131
|
+
o(D) && /* @__PURE__ */ u("span", {
|
|
132
132
|
className: "kapi-inputbox__icon",
|
|
133
133
|
"aria-hidden": "true",
|
|
134
134
|
children: D
|
|
135
135
|
})
|
|
136
136
|
]
|
|
137
|
-
}) : /* @__PURE__ */
|
|
137
|
+
}) : /* @__PURE__ */ u("input", {
|
|
138
138
|
ref: I,
|
|
139
139
|
...G,
|
|
140
140
|
...Q
|
|
@@ -142,5 +142,4 @@ var m = {
|
|
|
142
142
|
return J.wrap(_e);
|
|
143
143
|
};
|
|
144
144
|
g.displayName = "KapiInput";
|
|
145
|
-
|
|
146
|
-
export { m as DEFAULT_INPUT_LABELS, g as KapiInput, h as inputClasses };
|
|
145
|
+
export { p as DEFAULT_INPUT_LABELS, g as KapiInput, h as inputClasses };
|
|
@@ -5,7 +5,7 @@ import { inputGroupAddonClasses as t, inputGroupClasses as n } from "./inputGrou
|
|
|
5
5
|
/* empty css */
|
|
6
6
|
import { createContext as r, useContext as i, useMemo as a } from "react";
|
|
7
7
|
import { jsx as o } from "react/jsx-runtime";
|
|
8
|
-
|
|
8
|
+
// src/components/inputs/KapiInputGroup.tsx
|
|
9
9
|
var s = r(null), c = () => i(s), l = ({ decorative: e = !1, className: n, children: r }) => /* @__PURE__ */ o("span", {
|
|
10
10
|
className: t(n),
|
|
11
11
|
"aria-hidden": e || void 0,
|
|
@@ -27,5 +27,4 @@ var s = r(null), c = () => i(s), l = ({ decorative: e = !1, className: n, childr
|
|
|
27
27
|
});
|
|
28
28
|
};
|
|
29
29
|
u.Addon = l;
|
|
30
|
-
//#endregion
|
|
31
30
|
export { u as KapiInputGroup, c as useKapiInputGroup };
|