@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,33 +1,33 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import "#kapi-css/components/inputs/KapiSelect.css";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { useOwnField as
|
|
7
|
-
import {
|
|
8
|
-
import { useKapiInputGroup as ie } from "./KapiInputGroup.js";
|
|
9
|
-
import { useControllableState as ae } from "../../hooks/useControllableState.js";
|
|
10
|
-
import { useRangeSelect as oe } from "../../hooks/useRangeSelect.js";
|
|
11
|
-
import { SELECT_MENU_PLACEMENT as se, displayLabel as ce, filterOptions as le, findTypeaheadIndex as ue, flattenOptions as de, indexEntries as fe, initialActiveIndex as pe, nextActiveIndex as me, normalizeValue as a, resolveChipLabel as he, resolveVirtualMenu as ge, toggleValue as _e, withUnknownValues as ve } from "./selectLogic.js";
|
|
12
|
-
import { resolveKapiRoot as ye } from "../../hooks/kapiRoot.js";
|
|
13
|
-
import { isCreateRow as be, menuItems as xe, withCreated as Se } from "./asyncSelectLogic.js";
|
|
3
|
+
import { resolveKapiRoot as e } from "../../hooks/kapiRoot.js";
|
|
4
|
+
import { SELECT_MENU_PLACEMENT as t, displayLabel as n, filterOptions as r, findTypeaheadIndex as ee, flattenOptions as i, indexEntries as te, initialActiveIndex as ne, nextActiveIndex as re, normalizeValue as ie, resolveChipLabel as ae, resolveVirtualMenu as oe, toggleValue as se, withUnknownValues as ce } from "./selectLogic.js";
|
|
5
|
+
import { isCreateRow as a, menuItems as le, withCreated as ue } from "./asyncSelectLogic.js";
|
|
6
|
+
import { useOwnField as de } from "./ownField.js";
|
|
7
|
+
import { assignRef as fe, fieldControlProps as pe, focusLeaves as me, resolveReadOnly as he } from "./fieldLogic.js";
|
|
14
8
|
/* empty css */
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
9
|
+
import { useLabels as ge } from "../locale/KapiLocaleProvider.js";
|
|
10
|
+
import { useKapiInputGroup as _e } from "./KapiInputGroup.js";
|
|
11
|
+
import { resolveGroupSize as ve, selectControlId as ye } from "./inputGroupLogic.js";
|
|
12
|
+
import { usePlacement as be } from "../../hooks/usePlacement.js";
|
|
13
|
+
import { useControllableState as xe } from "../../hooks/useControllableState.js";
|
|
14
|
+
import { useDuplicateValueWarning as Se, useMutedControlWarning as Ce } from "./misuseWarnings.js";
|
|
15
|
+
import { useFormReset as we } from "../../hooks/useFormReset.js";
|
|
16
|
+
import { useMergedRefs as Te } from "../../hooks/mergeRefs.js";
|
|
17
|
+
import { useOutsidePress as Ee } from "../../hooks/useOutsidePress.js";
|
|
18
|
+
import { useTypeahead as De } from "../../hooks/useTypeahead.js";
|
|
19
|
+
import { selectKeyAction as Oe } from "./selectKeyLogic.js";
|
|
20
|
+
import { useSelectSource as ke } from "./useSelectSource.js";
|
|
21
|
+
import { useSelectCreate as Ae } from "./useSelectCreate.js";
|
|
22
|
+
import { KapiSelectMenu as je } from "./KapiSelectMenu.js";
|
|
23
|
+
import { useRangeSelect as Me } from "../../hooks/useRangeSelect.js";
|
|
23
24
|
import { slot as o } from "../slotsLogic.js";
|
|
24
25
|
import { SELECT_SLOTS as s } from "./selectSlots.js";
|
|
25
|
-
import { KapiSelectMenu as Me } from "./KapiSelectMenu.js";
|
|
26
26
|
import { useCallback as Ne, useEffect as Pe, useId as Fe, useLayoutEffect as Ie, useMemo as c, useRef as l, useState as Le } from "react";
|
|
27
27
|
import { jsx as u, jsxs as d } from "react/jsx-runtime";
|
|
28
28
|
import { ChevronDown as Re, X as ze } from "lucide-react";
|
|
29
|
-
|
|
30
|
-
var Be = 6, Ve = [], f = "\0kapisel-all",
|
|
29
|
+
// src/components/inputs/KapiSelect.tsx
|
|
30
|
+
var Be = 6, Ve = [], f = "\0kapisel-all", p = (e, t) => `${e} “${t.trim()}”`, He = ({ size: e = "md", open: t, disabled: n, readOnly: r, multi: ee, chip: i, invalid: te, className: ne }) => [
|
|
31
31
|
...i ? ["kapi-filterchip", "kapisel--chip"] : ["kapisel", `kapisel--${e}`],
|
|
32
32
|
t && "kapisel--open",
|
|
33
33
|
n && "kapisel--disabled",
|
|
@@ -35,7 +35,7 @@ var Be = 6, Ve = [], f = "\0kapisel-all", He = (e, t) => `${e} “${t.trim()}”
|
|
|
35
35
|
ee && "kapisel--multi",
|
|
36
36
|
te && "kapisel--err",
|
|
37
37
|
ne
|
|
38
|
-
].filter(Boolean).join(" "),
|
|
38
|
+
].filter(Boolean).join(" "), Ue = {
|
|
39
39
|
clear: "Limpiar selección",
|
|
40
40
|
remove: "Quitar",
|
|
41
41
|
placeholder: "Seleccionar…",
|
|
@@ -45,138 +45,138 @@ var Be = 6, Ve = [], f = "\0kapisel-all", He = (e, t) => `${e} “${t.trim()}”
|
|
|
45
45
|
createError: "No se pudo crear la opción",
|
|
46
46
|
create: "Crear",
|
|
47
47
|
all: "Todas"
|
|
48
|
-
},
|
|
49
|
-
let { options:
|
|
48
|
+
}, m = (m) => {
|
|
49
|
+
let { options: h = Ve, loadOptions: We, loadDelay: Ge = 300, reloadKey: Ke, onCreate: qe, value: Je, defaultValue: Ye, multiple: g = !1, variant: Xe = "field", icon: Ze, label: Qe, chipLabel: $e, help: et, error: tt, fieldClassName: nt, clearable: rt = !1, disabled: _ = !1, invalid: it, required: at, readOnly: ot, loading: v = !1, placeholder: st, size: ct, renderOption: lt, renderValue: ut, virtual: dt, emptyMessage: ft, noOptionsMessage: pt, loadingMessage: mt, name: ht, id: gt, className: _t, classNames: y, style: vt, "aria-label": yt, labels: bt, ref: b, onBlur: xt } = m, x = Xe === "chip", S = m.searchable ?? !x, St = m.onChange, C = ge("select", Ue, bt), Ct = st ?? C.placeholder, w = g ? void 0 : m.allOption, T = w !== void 0 && w !== !1, wt = typeof w == "string" ? w : C.all, E = c(() => ({
|
|
50
50
|
value: f,
|
|
51
|
-
label:
|
|
52
|
-
}), [
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
]),
|
|
58
|
-
chip:
|
|
59
|
-
chipLabel:
|
|
60
|
-
label:
|
|
61
|
-
}), Mt =
|
|
62
|
-
id:
|
|
51
|
+
label: wt
|
|
52
|
+
}), [wt]), Tt = c(() => T && !(We && h.length === 0) ? [E, ...h] : h, [
|
|
53
|
+
T,
|
|
54
|
+
We,
|
|
55
|
+
h,
|
|
56
|
+
E
|
|
57
|
+
]), Et = ft ?? pt ?? C.noOptions, Dt = mt ?? C.loading, Ot = _e(), kt = ve(ct, Ot?.size) ?? "md", { chipLabel: At, fieldLabel: jt } = ae({
|
|
58
|
+
chip: x,
|
|
59
|
+
chipLabel: $e,
|
|
60
|
+
label: Qe
|
|
61
|
+
}), Mt = de({
|
|
62
|
+
id: gt,
|
|
63
63
|
label: jt,
|
|
64
|
-
help:
|
|
65
|
-
error:
|
|
66
|
-
required:
|
|
67
|
-
invalid:
|
|
68
|
-
readOnly:
|
|
69
|
-
fieldClassName:
|
|
70
|
-
}), D = Mt.field, O =
|
|
71
|
-
id:
|
|
64
|
+
help: et,
|
|
65
|
+
error: tt,
|
|
66
|
+
required: at,
|
|
67
|
+
invalid: it,
|
|
68
|
+
readOnly: ot,
|
|
69
|
+
fieldClassName: nt
|
|
70
|
+
}), D = Mt.field, O = he(ot, D), Nt = it ?? D?.invalid ?? !1, Pt = yt ?? (x && !D ? At : void 0), Ft = Fe(), k = ye({
|
|
71
|
+
id: gt,
|
|
72
72
|
fieldControlId: D?.controlId,
|
|
73
73
|
autoId: Ft,
|
|
74
|
-
inGroup:
|
|
75
|
-
}), It = `${k}-listbox`, Lt = `${k}-value`, Rt = (e) => `${k}-opt-${e}`, [zt, Bt, , Vt] =
|
|
76
|
-
|
|
77
|
-
controlled:
|
|
78
|
-
hasOnChange: !!
|
|
74
|
+
inGroup: Ot !== null
|
|
75
|
+
}), It = `${k}-listbox`, Lt = `${k}-value`, Rt = (e) => `${k}-opt-${e}`, [zt, Bt, , Vt] = xe(Je, () => ie(Ye, g), St), Ht = c(() => i(h).map((e) => e.value), [h]);
|
|
76
|
+
Se("KapiSelect", Ht), Ce("KapiSelect", {
|
|
77
|
+
controlled: Je !== void 0,
|
|
78
|
+
hasOnChange: !!St,
|
|
79
79
|
readOnly: O,
|
|
80
|
-
disabled:
|
|
80
|
+
disabled: _
|
|
81
81
|
});
|
|
82
|
-
let A = (e) => Bt(
|
|
83
|
-
|
|
84
|
-
}, [
|
|
85
|
-
|
|
86
|
-
}, [
|
|
87
|
-
options:
|
|
88
|
-
loadOptions:
|
|
89
|
-
loadDelay:
|
|
90
|
-
reloadKey:
|
|
91
|
-
creatable:
|
|
92
|
-
searchable:
|
|
82
|
+
let A = (e) => Bt(T && e === f ? null : e), Ut = ie(zt, g), j = T && Ut === null ? f : Ut, M = j === f, N = c(() => ie(j, !0), [j]), [P, F] = Le(!1), [I, L] = Le(""), [R, z] = Le(-1), B = l(null), Wt = Te(B, we(Vt)), V = l(null), Gt = l(null), Kt = Ne((e) => {
|
|
83
|
+
V.current = e, fe(b, e);
|
|
84
|
+
}, [b]), qt = Ne((e) => {
|
|
85
|
+
Gt.current = e, fe(b, e);
|
|
86
|
+
}, [b]), H = l(null), Jt = De(500), Yt = c(() => new Set(N), [N]), Xt = Me(), Zt = I.trim(), U = P && !_ && !O, W = ke({
|
|
87
|
+
options: Tt,
|
|
88
|
+
loadOptions: We,
|
|
89
|
+
loadDelay: Ge,
|
|
90
|
+
reloadKey: Ke,
|
|
91
|
+
creatable: qe !== void 0,
|
|
92
|
+
searchable: S,
|
|
93
93
|
query: I,
|
|
94
|
-
open:
|
|
94
|
+
open: U,
|
|
95
95
|
current: j,
|
|
96
|
-
onLoaded: (e, t) =>
|
|
97
|
-
}), { isAsync:
|
|
96
|
+
onLoaded: (e, t) => z(re(-1, "first", le(e, t, J, p(C.create, t))))
|
|
97
|
+
}), { isAsync: Qt, filtered: G, asyncLoading: $t, loadError: en } = W, K = c(() => M ? [E] : v ? W.selected : ce(W.selected, j), [
|
|
98
98
|
M,
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
99
|
+
E,
|
|
100
|
+
W.selected,
|
|
101
|
+
v,
|
|
102
102
|
j
|
|
103
|
-
]),
|
|
104
|
-
onCreate:
|
|
105
|
-
open:
|
|
103
|
+
]), q = Ae({
|
|
104
|
+
onCreate: qe,
|
|
105
|
+
open: U,
|
|
106
106
|
onSettled: (e, t) => {
|
|
107
|
-
e && (
|
|
107
|
+
e && (W.remember([e]), A(ue(j, e.value, g))), I.trim() === t && un(e ? e.value : null);
|
|
108
108
|
}
|
|
109
|
-
}),
|
|
110
|
-
|
|
109
|
+
}), tn = v || $t, nn = tn || q.creating, J = qe !== void 0 && S && !v && !q.creating, Y = c(() => le(G, I, J && !$t, p(C.create, I)), [
|
|
110
|
+
G,
|
|
111
111
|
I,
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
]),
|
|
112
|
+
J,
|
|
113
|
+
$t,
|
|
114
|
+
C.create
|
|
115
|
+
]), rn = c(() => te(G), [G]), an = Y.length > 0 && a(Y[Y.length - 1]) ? Y[Y.length - 1] : null, X = R >= 0 && R < Y.length ? R : -1, Z = K.length > 0, on = S && I !== "", sn = tn ? Dt : q.failed ? C.createError : en ? C.loadError : Y.length === 0 ? Et : null, cn = () => (S ? V.current : Gt.current)?.focus();
|
|
116
116
|
Pe(() => {
|
|
117
|
-
|
|
118
|
-
}, [
|
|
119
|
-
let
|
|
120
|
-
F(!1), L(""),
|
|
121
|
-
}, []),
|
|
122
|
-
|
|
123
|
-
},
|
|
124
|
-
|
|
117
|
+
_ && (F(!1), L(""));
|
|
118
|
+
}, [_]);
|
|
119
|
+
let Q = Ne(() => {
|
|
120
|
+
F(!1), L(""), z(-1);
|
|
121
|
+
}, []), ln = (e = "selected") => {
|
|
122
|
+
_ || O || (F(!0), z(ne(Y, N, e)));
|
|
123
|
+
}, un = (e) => {
|
|
124
|
+
g ? (L(""), z(e === null ? -1 : ne(i(h), [e], "selected")), V.current?.focus()) : Q();
|
|
125
125
|
}, dn = (e, t = !1) => {
|
|
126
126
|
if (e.disabled) return;
|
|
127
|
-
if (
|
|
128
|
-
|
|
127
|
+
if (a(e)) {
|
|
128
|
+
q.create(Zt);
|
|
129
129
|
return;
|
|
130
130
|
}
|
|
131
|
-
if (
|
|
132
|
-
let n =
|
|
133
|
-
selected: new Set(
|
|
131
|
+
if (g) {
|
|
132
|
+
let n = Y.filter((e) => !a(e)), r = n.map((e) => e.value), ee = new Set(n.filter((e) => !e.disabled).map((e) => e.value)), i = Xt.toggle({
|
|
133
|
+
selected: new Set(Yt),
|
|
134
134
|
ids: r,
|
|
135
135
|
target: e.value,
|
|
136
136
|
shift: t,
|
|
137
137
|
isSelectable: (e) => ee.has(e)
|
|
138
138
|
});
|
|
139
|
-
A([...N.filter((e) => i.has(e)), ...r.filter((e) => i.has(e) && !
|
|
139
|
+
A([...N.filter((e) => i.has(e)), ...r.filter((e) => i.has(e) && !Yt.has(e))]), un(e.value);
|
|
140
140
|
return;
|
|
141
141
|
}
|
|
142
|
-
let n =
|
|
143
|
-
n === j ?
|
|
142
|
+
let n = se(j, e.value, g);
|
|
143
|
+
n === j ? Q() : (A(n), un(e.value));
|
|
144
144
|
}, fn = (e) => A(N.filter((t) => t !== e)), pn = () => {
|
|
145
|
-
A(
|
|
146
|
-
}, { placement: mn, style: hn, update: gn } =
|
|
147
|
-
open:
|
|
148
|
-
anchor:
|
|
149
|
-
floatingRef:
|
|
150
|
-
...
|
|
145
|
+
A(g ? [] : null), L(""), cn();
|
|
146
|
+
}, { placement: mn, style: hn, update: gn } = be({
|
|
147
|
+
open: U,
|
|
148
|
+
anchor: B,
|
|
149
|
+
floatingRef: H,
|
|
150
|
+
...t,
|
|
151
151
|
offset: Be
|
|
152
152
|
});
|
|
153
153
|
Ie(() => {
|
|
154
|
-
|
|
154
|
+
U && gn();
|
|
155
155
|
}, [
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
156
|
+
U,
|
|
157
|
+
Y.length,
|
|
158
|
+
sn,
|
|
159
159
|
gn
|
|
160
|
-
]),
|
|
161
|
-
if (!
|
|
162
|
-
let e =
|
|
160
|
+
]), Ee(U, [B, H], Q), Pe(() => {
|
|
161
|
+
if (!U || X < 0) return;
|
|
162
|
+
let e = H.current?.querySelector(`[data-kapisel-index="${X}"]`);
|
|
163
163
|
e && typeof e.scrollIntoView == "function" && e.scrollIntoView({ block: "nearest" });
|
|
164
|
-
}, [
|
|
164
|
+
}, [U, X]);
|
|
165
165
|
let _n = (e) => {
|
|
166
|
-
if (
|
|
166
|
+
if (_) return;
|
|
167
167
|
let t = e.target;
|
|
168
|
-
|
|
168
|
+
H.current?.contains(t) || (t.closest("[data-kapisel-action]") ? e.preventDefault() : t === V.current ? P || ln() : (e.preventDefault(), cn(), P ? Q() : ln()));
|
|
169
169
|
}, vn = (e) => {
|
|
170
|
-
L(e), F(!0),
|
|
170
|
+
L(e), F(!0), q.resetError(), z(Qt ? -1 : re(-1, "first", le(r(Tt, e), e, J, p(C.create, e))));
|
|
171
171
|
}, yn = (e) => {
|
|
172
|
-
let t =
|
|
173
|
-
t < 0 || (P || F(!0),
|
|
172
|
+
let t = ee(Y, Jt(e), P ? X : Y.findIndex((e) => Yt.has(e.value)));
|
|
173
|
+
t < 0 || (P || F(!0), z(t));
|
|
174
174
|
}, bn = (e) => {
|
|
175
|
-
if (
|
|
176
|
-
let t =
|
|
175
|
+
if (_ || O) return;
|
|
176
|
+
let t = Oe(e, {
|
|
177
177
|
open: P,
|
|
178
|
-
searchable:
|
|
179
|
-
multiple:
|
|
178
|
+
searchable: S,
|
|
179
|
+
multiple: g,
|
|
180
180
|
query: I,
|
|
181
181
|
valueCount: N.length
|
|
182
182
|
});
|
|
@@ -185,18 +185,18 @@ var Be = 6, Ve = [], f = "\0kapisel-all", He = (e, t) => `${e} “${t.trim()}”
|
|
|
185
185
|
let { intent: n } = t;
|
|
186
186
|
switch (n.type) {
|
|
187
187
|
case "open":
|
|
188
|
-
|
|
188
|
+
ln(n.edge);
|
|
189
189
|
break;
|
|
190
190
|
case "move":
|
|
191
|
-
|
|
191
|
+
z(re(X, n.to, Y));
|
|
192
192
|
break;
|
|
193
193
|
case "choose": {
|
|
194
|
-
let e =
|
|
194
|
+
let e = X >= 0 ? Y[X] : void 0;
|
|
195
195
|
e && dn(e);
|
|
196
196
|
break;
|
|
197
197
|
}
|
|
198
198
|
case "close":
|
|
199
|
-
|
|
199
|
+
Q();
|
|
200
200
|
break;
|
|
201
201
|
case "removeLast":
|
|
202
202
|
fn(N[N.length - 1]);
|
|
@@ -204,79 +204,79 @@ var Be = 6, Ve = [], f = "\0kapisel-all", He = (e, t) => `${e} “${t.trim()}”
|
|
|
204
204
|
case "typeahead": yn(n.key);
|
|
205
205
|
}
|
|
206
206
|
}, xn = (e) => {
|
|
207
|
-
|
|
208
|
-
}, Sn =
|
|
209
|
-
virtual:
|
|
210
|
-
count:
|
|
207
|
+
me(e.relatedTarget, B.current, H.current) && (P && Q(), xt?.(e));
|
|
208
|
+
}, Sn = U ? e(B.current) : null, Cn = Ot !== null || x, wn = oe({
|
|
209
|
+
virtual: dt,
|
|
210
|
+
count: Y.length,
|
|
211
211
|
contentSized: Cn,
|
|
212
|
-
customRows:
|
|
212
|
+
customRows: lt !== void 0
|
|
213
213
|
}), Tn = {
|
|
214
214
|
role: "combobox",
|
|
215
|
-
...
|
|
215
|
+
...pe(D, {
|
|
216
216
|
id: k,
|
|
217
217
|
describedBy: Lt,
|
|
218
|
-
invalid:
|
|
219
|
-
required:
|
|
220
|
-
labelable:
|
|
218
|
+
invalid: it,
|
|
219
|
+
required: at,
|
|
220
|
+
labelable: S,
|
|
221
221
|
ariaLabel: Pt
|
|
222
222
|
}),
|
|
223
223
|
"aria-haspopup": "listbox",
|
|
224
|
-
"aria-expanded":
|
|
225
|
-
"aria-controls":
|
|
226
|
-
"aria-activedescendant":
|
|
224
|
+
"aria-expanded": U,
|
|
225
|
+
"aria-controls": U ? It : void 0,
|
|
226
|
+
"aria-activedescendant": U && X >= 0 ? Rt(X) : void 0,
|
|
227
227
|
"aria-label": Pt,
|
|
228
|
-
"aria-disabled":
|
|
228
|
+
"aria-disabled": _ || void 0,
|
|
229
229
|
"aria-readonly": O || void 0,
|
|
230
|
-
"aria-busy":
|
|
231
|
-
}, $ =
|
|
232
|
-
...o(s, "placeholder",
|
|
230
|
+
"aria-busy": nn || void 0
|
|
231
|
+
}, $ = ut && Z && !M ? ut(K) : null, En = !Z && !on && /* @__PURE__ */ u("span", {
|
|
232
|
+
...o(s, "placeholder", y),
|
|
233
233
|
"aria-hidden": "true",
|
|
234
|
-
children:
|
|
234
|
+
children: Ct
|
|
235
235
|
});
|
|
236
236
|
return Mt.wrap(/* @__PURE__ */ d("div", {
|
|
237
|
-
ref:
|
|
238
|
-
...o(s, "root",
|
|
237
|
+
ref: Wt,
|
|
238
|
+
...o(s, "root", y, He({
|
|
239
239
|
size: kt,
|
|
240
|
-
open:
|
|
241
|
-
disabled:
|
|
240
|
+
open: U,
|
|
241
|
+
disabled: _,
|
|
242
242
|
readOnly: O,
|
|
243
|
-
multi:
|
|
244
|
-
chip:
|
|
243
|
+
multi: g,
|
|
244
|
+
chip: x,
|
|
245
245
|
invalid: Nt,
|
|
246
|
-
className:
|
|
246
|
+
className: _t
|
|
247
247
|
})),
|
|
248
|
-
style:
|
|
248
|
+
style: vt,
|
|
249
249
|
onMouseDown: _n,
|
|
250
250
|
children: [
|
|
251
|
-
|
|
252
|
-
...o(s, "icon",
|
|
253
|
-
children:
|
|
251
|
+
x && Ze ? /* @__PURE__ */ u("span", {
|
|
252
|
+
...o(s, "icon", y),
|
|
253
|
+
children: Ze
|
|
254
254
|
}) : null,
|
|
255
|
-
|
|
256
|
-
...o(s, "label",
|
|
255
|
+
x && At && /* @__PURE__ */ d("span", {
|
|
256
|
+
...o(s, "label", y),
|
|
257
257
|
"aria-hidden": "true",
|
|
258
258
|
children: [At, ":"]
|
|
259
259
|
}),
|
|
260
260
|
/* @__PURE__ */ d("div", {
|
|
261
|
-
...o(s, "values",
|
|
261
|
+
...o(s, "values", y),
|
|
262
262
|
children: [
|
|
263
|
-
|
|
264
|
-
...o(s, "single",
|
|
263
|
+
g && $ !== null && /* @__PURE__ */ u("span", {
|
|
264
|
+
...o(s, "single", y),
|
|
265
265
|
"aria-hidden": "true",
|
|
266
266
|
children: $
|
|
267
267
|
}),
|
|
268
|
-
|
|
269
|
-
...o(s, "tag",
|
|
268
|
+
g && $ === null && K.map((e) => /* @__PURE__ */ d("span", {
|
|
269
|
+
...o(s, "tag", y),
|
|
270
270
|
children: [/* @__PURE__ */ u("span", {
|
|
271
|
-
...o(s, "tagLabel",
|
|
271
|
+
...o(s, "tagLabel", y),
|
|
272
272
|
children: e.label
|
|
273
273
|
}), /* @__PURE__ */ u("button", {
|
|
274
274
|
type: "button",
|
|
275
275
|
tabIndex: -1,
|
|
276
276
|
"data-kapisel-action": !0,
|
|
277
|
-
...o(s, "tagRemove",
|
|
278
|
-
"aria-label": `${
|
|
279
|
-
disabled:
|
|
277
|
+
...o(s, "tagRemove", y),
|
|
278
|
+
"aria-label": `${C.remove} ${e.label}`,
|
|
279
|
+
disabled: _,
|
|
280
280
|
hidden: O || void 0,
|
|
281
281
|
onClick: () => fn(e.value),
|
|
282
282
|
children: /* @__PURE__ */ u(ze, {
|
|
@@ -286,23 +286,23 @@ var Be = 6, Ve = [], f = "\0kapisel-all", He = (e, t) => `${e} “${t.trim()}”
|
|
|
286
286
|
})
|
|
287
287
|
})]
|
|
288
288
|
}, e.value)),
|
|
289
|
-
|
|
289
|
+
S ? /* @__PURE__ */ d("div", {
|
|
290
290
|
className: "kapisel__inputwrap",
|
|
291
291
|
children: [
|
|
292
|
-
!
|
|
293
|
-
...o(s, "single",
|
|
292
|
+
!g && Z && !on && /* @__PURE__ */ u("span", {
|
|
293
|
+
...o(s, "single", y),
|
|
294
294
|
"aria-hidden": "true",
|
|
295
|
-
children: $ ??
|
|
295
|
+
children: $ ?? K[0]?.label
|
|
296
296
|
}),
|
|
297
297
|
En,
|
|
298
298
|
/* @__PURE__ */ u("input", {
|
|
299
299
|
...Tn,
|
|
300
|
-
ref:
|
|
300
|
+
ref: Kt,
|
|
301
301
|
type: "text",
|
|
302
|
-
...o(s, "input",
|
|
302
|
+
...o(s, "input", y),
|
|
303
303
|
autoComplete: "off",
|
|
304
304
|
"aria-autocomplete": "list",
|
|
305
|
-
disabled:
|
|
305
|
+
disabled: _,
|
|
306
306
|
readOnly: O || void 0,
|
|
307
307
|
value: I,
|
|
308
308
|
onChange: (e) => vn(e.target.value),
|
|
@@ -312,15 +312,15 @@ var Be = 6, Ve = [], f = "\0kapisel-all", He = (e, t) => `${e} “${t.trim()}”
|
|
|
312
312
|
]
|
|
313
313
|
}) : /* @__PURE__ */ d("div", {
|
|
314
314
|
...Tn,
|
|
315
|
-
ref:
|
|
316
|
-
...o(s, "combo",
|
|
317
|
-
tabIndex:
|
|
315
|
+
ref: qt,
|
|
316
|
+
...o(s, "combo", y),
|
|
317
|
+
tabIndex: _ ? -1 : 0,
|
|
318
318
|
onKeyDown: bn,
|
|
319
319
|
onBlur: xn,
|
|
320
|
-
children: [!
|
|
321
|
-
...o(s, "single",
|
|
320
|
+
children: [!g && Z && /* @__PURE__ */ u("span", {
|
|
321
|
+
...o(s, "single", y),
|
|
322
322
|
"aria-hidden": "true",
|
|
323
|
-
children: $ ??
|
|
323
|
+
children: $ ?? K[0]?.label
|
|
324
324
|
}), En]
|
|
325
325
|
})
|
|
326
326
|
]
|
|
@@ -328,18 +328,18 @@ var Be = 6, Ve = [], f = "\0kapisel-all", He = (e, t) => `${e} “${t.trim()}”
|
|
|
328
328
|
/* @__PURE__ */ u("span", {
|
|
329
329
|
id: Lt,
|
|
330
330
|
className: "kapisel__sr",
|
|
331
|
-
children:
|
|
331
|
+
children: n(K, Ct)
|
|
332
332
|
}),
|
|
333
|
-
|
|
334
|
-
...o(s, "spinner",
|
|
333
|
+
nn && /* @__PURE__ */ u("span", {
|
|
334
|
+
...o(s, "spinner", y, "kapi-spinner kapi-spinner--sm"),
|
|
335
335
|
"aria-hidden": "true"
|
|
336
336
|
}),
|
|
337
|
-
|
|
337
|
+
rt && Z && !M && !_ && !O && /* @__PURE__ */ u("button", {
|
|
338
338
|
type: "button",
|
|
339
339
|
tabIndex: -1,
|
|
340
340
|
"data-kapisel-action": !0,
|
|
341
|
-
...o(s, "clear",
|
|
342
|
-
"aria-label":
|
|
341
|
+
...o(s, "clear", y),
|
|
342
|
+
"aria-label": C.clear,
|
|
343
343
|
onClick: pn,
|
|
344
344
|
children: /* @__PURE__ */ u(ze, {
|
|
345
345
|
size: 15,
|
|
@@ -348,49 +348,48 @@ var Be = 6, Ve = [], f = "\0kapisel-all", He = (e, t) => `${e} “${t.trim()}”
|
|
|
348
348
|
})
|
|
349
349
|
}),
|
|
350
350
|
/* @__PURE__ */ u("span", {
|
|
351
|
-
...o(s, "caret",
|
|
351
|
+
...o(s, "caret", y),
|
|
352
352
|
"aria-hidden": "true",
|
|
353
353
|
children: /* @__PURE__ */ u(Re, {
|
|
354
|
-
size:
|
|
354
|
+
size: x ? 14 : 17,
|
|
355
355
|
strokeWidth: 2.2
|
|
356
356
|
})
|
|
357
357
|
}),
|
|
358
|
-
|
|
358
|
+
ht && (g ? N.map((e) => /* @__PURE__ */ u("input", {
|
|
359
359
|
type: "hidden",
|
|
360
|
-
name:
|
|
360
|
+
name: ht,
|
|
361
361
|
value: e
|
|
362
362
|
}, e)) : /* @__PURE__ */ u("input", {
|
|
363
363
|
type: "hidden",
|
|
364
|
-
name:
|
|
364
|
+
name: ht,
|
|
365
365
|
value: M ? "" : j ?? ""
|
|
366
366
|
})),
|
|
367
|
-
Sn && /* @__PURE__ */ u(
|
|
367
|
+
Sn && /* @__PURE__ */ u(je, {
|
|
368
368
|
root: Sn,
|
|
369
|
-
classNames:
|
|
370
|
-
ref:
|
|
369
|
+
classNames: y,
|
|
370
|
+
ref: H,
|
|
371
371
|
side: mn?.side === "top" ? "top" : "bottom",
|
|
372
372
|
hug: Cn,
|
|
373
373
|
style: hn,
|
|
374
374
|
listboxId: It,
|
|
375
375
|
optionId: Rt,
|
|
376
|
-
multiple:
|
|
376
|
+
multiple: g,
|
|
377
377
|
"aria-label": Pt,
|
|
378
|
-
rows:
|
|
379
|
-
createRow:
|
|
380
|
-
createIndex:
|
|
381
|
-
loading:
|
|
382
|
-
empty:
|
|
383
|
-
message:
|
|
384
|
-
active:
|
|
378
|
+
rows: rn,
|
|
379
|
+
createRow: an,
|
|
380
|
+
createIndex: Y.length - 1,
|
|
381
|
+
loading: tn,
|
|
382
|
+
empty: Y.length === 0,
|
|
383
|
+
message: sn,
|
|
384
|
+
active: X,
|
|
385
385
|
values: N,
|
|
386
|
-
renderOption:
|
|
386
|
+
renderOption: lt,
|
|
387
387
|
query: I,
|
|
388
388
|
virtual: wn,
|
|
389
|
-
onHover:
|
|
389
|
+
onHover: z,
|
|
390
390
|
onChoose: dn
|
|
391
391
|
})
|
|
392
392
|
]
|
|
393
393
|
}));
|
|
394
394
|
};
|
|
395
|
-
|
|
396
|
-
export { We as DEFAULT_SELECT_LABELS, p as KapiSelect, Ue as selectClasses };
|
|
395
|
+
export { Ue as DEFAULT_SELECT_LABELS, m as KapiSelect, He as selectClasses };
|
|
@@ -7,7 +7,7 @@ import { memo as i, useCallback as a, useLayoutEffect as o, useMemo as s, useRef
|
|
|
7
7
|
import { jsx as l, jsxs as u } from "react/jsx-runtime";
|
|
8
8
|
import { Check as d } from "lucide-react";
|
|
9
9
|
import { createPortal as f } from "react-dom";
|
|
10
|
-
|
|
10
|
+
// src/components/inputs/KapiSelectMenu.tsx
|
|
11
11
|
var p = 38, m = 264, h = 4, g = i(({ optionClass: e, checkClass: t, option: i, index: a, id: o, selected: s, active: c, create: f, vindex: p, setSize: m, renderOption: h, query: g, onHover: _, onChoose: v }) => /* @__PURE__ */ u("li", {
|
|
12
12
|
id: o,
|
|
13
13
|
role: "option",
|
|
@@ -167,5 +167,4 @@ var p = 38, m = 264, h = 4, g = i(({ optionClass: e, checkClass: t, option: i, i
|
|
|
167
167
|
})]
|
|
168
168
|
}), d);
|
|
169
169
|
};
|
|
170
|
-
//#endregion
|
|
171
170
|
export { _ as KapiSelectMenu };
|