@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
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
import "#kapi-css/components/inputs/inputsExtra.css";
|
|
3
3
|
import { useToneLook as e } from "../../hooks/useToneFamilies.js";
|
|
4
4
|
import { isFamilyTone as t } from "../tone.js";
|
|
5
|
-
import { nativeFieldProps as n, resolveFieldClassName as r, resolveReadOnly as i } from "./fieldLogic.js";
|
|
6
|
-
import { useOwnField as a } from "./ownField.js";
|
|
7
5
|
/* empty css */
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
6
|
+
import { clampToStep as n, percentOf as r } from "./sliderLogic.js";
|
|
7
|
+
import { useOwnField as i } from "./ownField.js";
|
|
8
|
+
import { useControllableState as a } from "../../hooks/useControllableState.js";
|
|
9
|
+
import { nativeFieldProps as o, resolveFieldClassName as s, resolveReadOnly as c } from "./fieldLogic.js";
|
|
10
10
|
import "react";
|
|
11
11
|
import { jsx as l, jsxs as u } from "react/jsx-runtime";
|
|
12
|
-
|
|
12
|
+
// src/components/inputs/KapiSlider.tsx
|
|
13
13
|
var d = ({ tone: e = "primary", disabled: n = !1, readOnly: r = !1, className: i = "" } = {}) => [
|
|
14
14
|
"kapi-slider",
|
|
15
15
|
t(e) ? "kapi-slider--family" : e !== "primary" && `kapi-slider--${e}`,
|
|
@@ -17,31 +17,31 @@ var d = ({ tone: e = "primary", disabled: n = !1, readOnly: r = !1, className: i
|
|
|
17
17
|
r && "kapi-slider--readonly",
|
|
18
18
|
i
|
|
19
19
|
].filter(Boolean).join(" "), f = ({ value: t, defaultValue: f, onChange: p, min: m = 0, max: h = 100, step: g = 1, tone: _, label: v, help: y, error: b, readOnly: x, showValue: S, formatValue: C, fieldClassName: w, wrapperClassName: T, className: E, style: D, disabled: O, id: k, ref: A, invalid: j, required: M, "aria-describedby": N, "aria-invalid": P, "aria-required": F, ...I }) => {
|
|
20
|
-
let L =
|
|
20
|
+
let L = i({
|
|
21
21
|
id: k,
|
|
22
22
|
help: y,
|
|
23
23
|
error: b,
|
|
24
24
|
required: M,
|
|
25
25
|
invalid: j,
|
|
26
26
|
readOnly: x
|
|
27
|
-
}), R = L.autoId, z =
|
|
27
|
+
}), R = L.autoId, z = c(x, L.field), [B, V] = a(t, f ?? m, p), H = o(L.wraps || v == null ? L.field : null, {
|
|
28
28
|
id: k,
|
|
29
29
|
describedBy: N,
|
|
30
30
|
invalid: j,
|
|
31
31
|
required: M,
|
|
32
32
|
ariaInvalid: P,
|
|
33
33
|
ariaRequired: F
|
|
34
|
-
}), U = H.id ?? R, W =
|
|
34
|
+
}), U = H.id ?? R, W = n(B, {
|
|
35
35
|
min: m,
|
|
36
36
|
max: h,
|
|
37
37
|
step: g
|
|
38
|
-
}), G = e("KapiSlider", _), K = { "--kapi-slider-pct": `${
|
|
38
|
+
}), G = e("KapiSlider", _), K = { "--kapi-slider-pct": `${r(W, m, h)}%` }, q = v != null || S, J = C ? C(W) : void 0;
|
|
39
39
|
return L.wrap(/* @__PURE__ */ u("div", {
|
|
40
40
|
className: d({
|
|
41
41
|
tone: G.tone,
|
|
42
42
|
disabled: O,
|
|
43
43
|
readOnly: z,
|
|
44
|
-
className:
|
|
44
|
+
className: s(w, T)
|
|
45
45
|
}),
|
|
46
46
|
children: [q && /* @__PURE__ */ u("div", {
|
|
47
47
|
className: "kapi-slider__head",
|
|
@@ -74,7 +74,7 @@ var d = ({ tone: e = "primary", disabled: n = !1, readOnly: r = !1, className: i
|
|
|
74
74
|
...K
|
|
75
75
|
},
|
|
76
76
|
onChange: (e) => {
|
|
77
|
-
z || V(
|
|
77
|
+
z || V(n(Number(e.target.value), {
|
|
78
78
|
min: m,
|
|
79
79
|
max: h,
|
|
80
80
|
step: g
|
|
@@ -83,5 +83,4 @@ var d = ({ tone: e = "primary", disabled: n = !1, readOnly: r = !1, className: i
|
|
|
83
83
|
})]
|
|
84
84
|
}));
|
|
85
85
|
};
|
|
86
|
-
//#endregion
|
|
87
86
|
export { f as KapiSlider, d as sliderClasses };
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import "#kapi-css/components/inputs/checkControl.css";
|
|
3
|
-
import {
|
|
3
|
+
import { useKapiField as e } from "./KapiField.js";
|
|
4
4
|
import { nativeFieldProps as t } from "./fieldLogic.js";
|
|
5
|
-
import {
|
|
5
|
+
import { joinClasses as n } from "../rootProps.js";
|
|
6
6
|
/* empty css */
|
|
7
7
|
import { Fragment as r, jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
8
|
-
|
|
8
|
+
// src/components/inputs/KapiSwitch.tsx
|
|
9
9
|
var o = ({ label: o, className: s, ref: c, invalid: l, id: u, required: d, "aria-describedby": f, "aria-invalid": p, "aria-required": m, ...h }) => {
|
|
10
|
-
let g = t(
|
|
10
|
+
let g = t(e(), {
|
|
11
11
|
id: u,
|
|
12
12
|
describedBy: f,
|
|
13
13
|
invalid: l,
|
|
@@ -23,15 +23,14 @@ var o = ({ label: o, className: s, ref: c, invalid: l, id: u, required: d, "aria
|
|
|
23
23
|
required: d
|
|
24
24
|
}), /* @__PURE__ */ i("span", { className: "kapi-switch__track" })] });
|
|
25
25
|
return o == null ? /* @__PURE__ */ i("label", {
|
|
26
|
-
className:
|
|
26
|
+
className: n("kapi-switch", s),
|
|
27
27
|
children: _
|
|
28
28
|
}) : /* @__PURE__ */ a("label", {
|
|
29
|
-
className:
|
|
29
|
+
className: n("kapi-switchfield", s),
|
|
30
30
|
children: [/* @__PURE__ */ i("span", {
|
|
31
31
|
className: "kapi-switch",
|
|
32
32
|
children: _
|
|
33
33
|
}), o]
|
|
34
34
|
});
|
|
35
35
|
};
|
|
36
|
-
//#endregion
|
|
37
36
|
export { o as KapiSwitch };
|
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import "#kapi-css/components/inputs/KapiTagInput.css";
|
|
3
|
-
import {
|
|
3
|
+
import { useControllableState as e } from "../../hooks/useControllableState.js";
|
|
4
4
|
import { useMergedRefs as t } from "../../hooks/mergeRefs.js";
|
|
5
|
-
import {
|
|
6
|
-
import { assignRef as r, fieldControlProps as i, focusLeaves as a, joinIds as o, resolveReadOnly as ee } from "./fieldLogic.js";
|
|
7
|
-
import { useOwnField as s } from "./ownField.js";
|
|
8
|
-
import { useControllableState as te } from "../../hooks/useControllableState.js";
|
|
9
|
-
import { useFormReset as ne } from "../../hooks/useFormReset.js";
|
|
5
|
+
import { useFormReset as n } from "../../hooks/useFormReset.js";
|
|
10
6
|
/* empty css */
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
7
|
+
import { useOwnField as r } from "./ownField.js";
|
|
8
|
+
import { assignRef as i, fieldControlProps as ee, focusLeaves as a, joinIds as te, resolveReadOnly as o } from "./fieldLogic.js";
|
|
9
|
+
import { addTags as ne, hasSeparator as s, removeTagAt as c, spliceText as re, splitDraft as ie, splitTags as l } from "./tagInputLogic.js";
|
|
10
|
+
import { KapiTag as ae } from "../display/KapiTag.js";
|
|
11
|
+
import { joinClasses as u } from "../rootProps.js";
|
|
12
|
+
import { useLabels as oe } from "../locale/KapiLocaleProvider.js";
|
|
13
13
|
import { useCallback as d, useId as se, useRef as f, useState as p } from "react";
|
|
14
14
|
import { jsx as m, jsxs as h } from "react/jsx-runtime";
|
|
15
|
-
|
|
15
|
+
// src/components/inputs/KapiTagInput.tsx
|
|
16
16
|
var g = {
|
|
17
17
|
remove: "Quitar",
|
|
18
18
|
duplicate: "Ya está en la lista:",
|
|
19
19
|
max: "Llegaste al máximo de"
|
|
20
|
-
}, _ = ({ size:
|
|
21
|
-
function v({ value:
|
|
22
|
-
let z =
|
|
20
|
+
}, _ = ({ size: e = "md", invalid: t, disabled: n, readOnly: r, className: i }) => u("kapi-taginput", e !== "md" && `kapi-taginput--${e}`, t && "kapi-taginput--err", n && "kapi-taginput--disabled", r && "kapi-taginput--readonly", i);
|
|
21
|
+
function v({ value: u, defaultValue: v = [], onChange: ce, validate: le, maxTags: y, allowDuplicates: ue, caseSensitive: b, placeholder: x, disabled: S = !1, size: C = "md", name: w, id: T, invalid: E, required: D, label: de, help: fe, error: pe, fieldClassName: O, readOnly: k, "aria-label": A, "aria-labelledby": j, "aria-describedby": M, onBlur: N, ref: P, labels: F, className: I, onClick: L, ...R }) {
|
|
22
|
+
let z = oe("tagInput", g, F), B = r({
|
|
23
23
|
id: T,
|
|
24
24
|
label: de,
|
|
25
25
|
help: fe,
|
|
@@ -28,39 +28,39 @@ function v({ value: e, defaultValue: v = [], onChange: ce, validate: y, maxTags:
|
|
|
28
28
|
invalid: E,
|
|
29
29
|
readOnly: k,
|
|
30
30
|
fieldClassName: O
|
|
31
|
-
}), V = B.field, H =
|
|
32
|
-
Z.current = e,
|
|
33
|
-
}, [P]), _e = (e) => e.reason === "invalid" ? e.message : e.reason === "duplicate" ? `${z.duplicate} ${e.tag}` : `${z.max} ${
|
|
34
|
-
let { values: n, rejected: r } =
|
|
35
|
-
validate:
|
|
36
|
-
maxTags:
|
|
37
|
-
allowDuplicates:
|
|
38
|
-
caseSensitive:
|
|
31
|
+
}), V = B.field, H = o(k, V), U = se(), [W, G, , me] = e(u, v, ce), [K, q] = p(""), [J, Y] = p(null), X = f(null), he = t(X, n(me)), Z = f(null), ge = d((e) => {
|
|
32
|
+
Z.current = e, i(P, e);
|
|
33
|
+
}, [P]), _e = (e) => e.reason === "invalid" ? e.message : e.reason === "duplicate" ? `${z.duplicate} ${e.tag}` : `${z.max} ${y}`, Q = (e, t = "") => {
|
|
34
|
+
let { values: n, rejected: r } = ne(W, e, {
|
|
35
|
+
validate: le,
|
|
36
|
+
maxTags: y,
|
|
37
|
+
allowDuplicates: ue,
|
|
38
|
+
caseSensitive: b
|
|
39
39
|
});
|
|
40
40
|
n.length !== W.length && G(n), Y(r[0] ? _e(r[0]) : null), q([...r.map((e) => e.tag), t].filter(Boolean).join(", "));
|
|
41
41
|
}, ve = (e) => {
|
|
42
42
|
let t = e.target.value;
|
|
43
|
-
if (Y(null), !
|
|
43
|
+
if (Y(null), !s(t)) {
|
|
44
44
|
q(t);
|
|
45
45
|
return;
|
|
46
46
|
}
|
|
47
|
-
let { complete: n, tail: r } =
|
|
47
|
+
let { complete: n, tail: r } = ie(t);
|
|
48
48
|
Q(n, r);
|
|
49
49
|
}, ye = (e) => {
|
|
50
|
-
S || H || (e.key === "Enter" && K.trim() ? (e.preventDefault(), Q(
|
|
50
|
+
S || H || (e.key === "Enter" && K.trim() ? (e.preventDefault(), Q(l(K))) : e.key === "Backspace" && K === "" && W.length > 0 && (e.preventDefault(), Y(null), G(c(W, W.length - 1))));
|
|
51
51
|
}, be = (e) => {
|
|
52
52
|
if (H) return;
|
|
53
53
|
let t = e.clipboardData.getData("text");
|
|
54
|
-
if (!
|
|
54
|
+
if (!s(t)) return;
|
|
55
55
|
e.preventDefault();
|
|
56
|
-
let n = e.currentTarget, r =
|
|
57
|
-
Q(
|
|
56
|
+
let n = e.currentTarget, r = re(K, n.selectionStart ?? K.length, n.selectionEnd ?? K.length, t);
|
|
57
|
+
Q(l(r));
|
|
58
58
|
}, xe = (e) => {
|
|
59
|
-
a(e.relatedTarget, X.current) && (K.trim() && !H && Q(
|
|
59
|
+
a(e.relatedTarget, X.current) && (K.trim() && !H && Q(l(K)), N?.(e));
|
|
60
60
|
}, Se = (e) => {
|
|
61
|
-
L?.(e),
|
|
61
|
+
L?.(e), e.defaultPrevented || S || e.target.closest("button, input") || Z.current?.focus();
|
|
62
62
|
}, Ce = (e) => {
|
|
63
|
-
Y(null), G(
|
|
63
|
+
Y(null), G(c(W, e)), Z.current?.focus();
|
|
64
64
|
}, $ = J !== null || (E ?? V?.invalid ?? !1);
|
|
65
65
|
return B.wrap(/* @__PURE__ */ h("div", {
|
|
66
66
|
...R,
|
|
@@ -81,7 +81,7 @@ function v({ value: e, defaultValue: v = [], onChange: ce, validate: y, maxTags:
|
|
|
81
81
|
className: "kapi-taginput__tags",
|
|
82
82
|
children: W.map((e, t) => /* @__PURE__ */ m("li", {
|
|
83
83
|
className: "kapi-taginput__item",
|
|
84
|
-
children: /* @__PURE__ */ m(
|
|
84
|
+
children: /* @__PURE__ */ m(ae, {
|
|
85
85
|
tone: "primary",
|
|
86
86
|
size: C === "sm" ? "sm" : "md",
|
|
87
87
|
onRemove: S || H ? void 0 : () => Ce(t),
|
|
@@ -93,9 +93,9 @@ function v({ value: e, defaultValue: v = [], onChange: ce, validate: y, maxTags:
|
|
|
93
93
|
ref: ge,
|
|
94
94
|
type: "text",
|
|
95
95
|
className: "kapi-taginput__input",
|
|
96
|
-
...
|
|
96
|
+
...ee(V, {
|
|
97
97
|
id: T,
|
|
98
|
-
describedBy:
|
|
98
|
+
describedBy: te(J !== null && U, M),
|
|
99
99
|
invalid: $,
|
|
100
100
|
required: D
|
|
101
101
|
}),
|
|
@@ -125,5 +125,4 @@ function v({ value: e, defaultValue: v = [], onChange: ce, validate: y, maxTags:
|
|
|
125
125
|
]
|
|
126
126
|
}));
|
|
127
127
|
}
|
|
128
|
-
//#endregion
|
|
129
128
|
export { g as DEFAULT_TAG_INPUT_LABELS, v as KapiTagInput, _ as tagInputClasses };
|
|
@@ -1,46 +1,46 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import "#kapi-css/components/inputs/inputsExtra.css";
|
|
3
|
-
import { computedStyleOf as e } from "../../hooks/ownerDocument.js";
|
|
4
|
-
import { fieldControlProps as t, joinIds as n, resolveFieldMessage as r } from "./fieldLogic.js";
|
|
5
|
-
import { useOwnField as i } from "./ownField.js";
|
|
6
3
|
/* empty css */
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
4
|
+
import { useOwnField as e } from "./ownField.js";
|
|
5
|
+
import { fieldControlProps as t, joinIds as n, resolveFieldMessage as r } from "./fieldLogic.js";
|
|
6
|
+
import { inputClasses as i } from "./KapiInput.js";
|
|
7
|
+
import { autosizeHeight as a, rowsToHeight as o } from "./textareaLogic.js";
|
|
8
|
+
import { computedStyleOf as s } from "../../hooks/ownerDocument.js";
|
|
9
|
+
import { rafThrottle as c } from "../../hooks/rafThrottle.js";
|
|
10
10
|
import { useCallback as l, useEffect as u, useLayoutEffect as d, useRef as f } from "react";
|
|
11
11
|
import { jsx as p } from "react/jsx-runtime";
|
|
12
|
-
|
|
13
|
-
var m = ({ status: e, autosize: t = !1, className: n = "" } = {}) =>
|
|
12
|
+
// src/components/inputs/KapiTextarea.tsx
|
|
13
|
+
var m = ({ status: e, autosize: t = !1, className: n = "" } = {}) => i({
|
|
14
14
|
status: e,
|
|
15
15
|
className: [
|
|
16
16
|
"kapi-textarea",
|
|
17
17
|
t && "kapi-textarea--auto",
|
|
18
18
|
n
|
|
19
19
|
].filter(Boolean).join(" ")
|
|
20
|
-
}), h = ({ invalid:
|
|
21
|
-
let { invalid: k, status: A } = r(y, v,
|
|
20
|
+
}), h = ({ invalid: i, status: h, label: g, required: _, help: v, error: y, fieldClassName: b, autosize: x, maxRows: S, className: C, id: w, rows: T = 3, onInput: E, ref: D, ...O }) => {
|
|
21
|
+
let { invalid: k, status: A } = r(y, v, i, h), j = e({
|
|
22
22
|
id: w,
|
|
23
23
|
label: g,
|
|
24
24
|
help: v,
|
|
25
25
|
error: y,
|
|
26
26
|
required: _,
|
|
27
|
-
invalid:
|
|
27
|
+
invalid: i,
|
|
28
28
|
status: h,
|
|
29
29
|
fieldClassName: b
|
|
30
30
|
}), { controlId: M, helpId: N } = j, P = f(null), F = l((e) => {
|
|
31
31
|
P.current = e, typeof D == "function" ? D(e) : D && (D.current = e);
|
|
32
32
|
}, [D]), I = f(null), L = l(() => {
|
|
33
|
-
let
|
|
34
|
-
if (!
|
|
35
|
-
let
|
|
36
|
-
I.current = Math.max(0,
|
|
37
|
-
let
|
|
38
|
-
|
|
39
|
-
let { height: l, overflowing: u } =
|
|
40
|
-
minHeight:
|
|
41
|
-
maxHeight: S ?
|
|
33
|
+
let e = P.current;
|
|
34
|
+
if (!e || !x) return;
|
|
35
|
+
let t = s(e), n = (e) => parseFloat(e) || 0;
|
|
36
|
+
I.current = Math.max(0, e.clientWidth - n(t.paddingLeft) - n(t.paddingRight));
|
|
37
|
+
let r = n(t.lineHeight) || n(t.fontSize) * 1.5, i = n(t.borderTopWidth) + n(t.borderBottomWidth), c = n(t.paddingTop) + n(t.paddingBottom) + i;
|
|
38
|
+
e.style.height = "auto";
|
|
39
|
+
let { height: l, overflowing: u } = a(e.scrollHeight + i, {
|
|
40
|
+
minHeight: o(T, r, c),
|
|
41
|
+
maxHeight: S ? o(S, r, c) : void 0
|
|
42
42
|
});
|
|
43
|
-
|
|
43
|
+
e.style.height = `${l}px`, e.style.overflowY = u ? "auto" : "hidden";
|
|
44
44
|
}, [
|
|
45
45
|
x,
|
|
46
46
|
S,
|
|
@@ -53,7 +53,7 @@ var m = ({ status: e, autosize: t = !1, className: n = "" } = {}) => a({
|
|
|
53
53
|
z.current = L, u(() => {
|
|
54
54
|
let e = P.current;
|
|
55
55
|
if (!e || !x || typeof ResizeObserver > "u") return;
|
|
56
|
-
let t = null, n =
|
|
56
|
+
let t = null, n = c(() => z.current()), r = new ResizeObserver((e) => {
|
|
57
57
|
let r = e[e.length - 1]?.contentRect.width;
|
|
58
58
|
if (r === void 0 || r === t) return;
|
|
59
59
|
let i = t === null;
|
|
@@ -86,5 +86,4 @@ var m = ({ status: e, autosize: t = !1, className: n = "" } = {}) => a({
|
|
|
86
86
|
});
|
|
87
87
|
return j.wrap(V);
|
|
88
88
|
};
|
|
89
|
-
//#endregion
|
|
90
89
|
export { h as KapiTextarea, m as textareaClasses };
|
|
@@ -1,47 +1,46 @@
|
|
|
1
1
|
import { normalizeText as e } from "../overlays/menuKeyboardLogic.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
var a = (e, t) => e === t || e.label === t.label && e.disabled === t.disabled && e.data === t.data, o = (e,
|
|
2
|
+
import { createRequestTracker as t } from "./autocompleteLogic.js";
|
|
3
|
+
import { flattenOptions as n, normalizeValue as r, toggleValue as i } from "./selectLogic.js";
|
|
4
|
+
// src/components/inputs/asyncSelectLogic.ts
|
|
5
|
+
var a = (e, t) => e === t || e.label === t.label && e.disabled === t.disabled && e.data === t.data, o = (e, t) => {
|
|
6
6
|
let r = null;
|
|
7
|
-
for (let i of t
|
|
7
|
+
for (let i of n(t)) {
|
|
8
8
|
let t = (r ?? e).get(i.value);
|
|
9
9
|
t && a(t, i) || (r ??= new Map(e), r.set(i.value, i));
|
|
10
10
|
}
|
|
11
11
|
return r ?? e;
|
|
12
12
|
}, s = (e, t) => {
|
|
13
|
-
let
|
|
14
|
-
for (let i of
|
|
13
|
+
let n = [];
|
|
14
|
+
for (let i of r(t, !0)) {
|
|
15
15
|
let t = e.get(i);
|
|
16
|
-
t &&
|
|
16
|
+
t && n.push(t);
|
|
17
17
|
}
|
|
18
|
-
return
|
|
19
|
-
}, c = (
|
|
18
|
+
return n;
|
|
19
|
+
}, c = (t, r) => {
|
|
20
20
|
let i = e(r.trim());
|
|
21
|
-
return i ? !t
|
|
22
|
-
}, l = (e, t,
|
|
23
|
-
let e =
|
|
21
|
+
return i ? !n(t).some((t) => e(t.label.trim()) === i) : !1;
|
|
22
|
+
}, l = (e, t, n) => n && r(e, !0).includes(t) ? [...r(e, !0)] : i(e, t, n), u = () => {
|
|
23
|
+
let e = t(), n = null;
|
|
24
24
|
return {
|
|
25
25
|
start: () => {
|
|
26
|
-
|
|
27
|
-
let
|
|
28
|
-
|
|
26
|
+
n?.abort();
|
|
27
|
+
let t = new AbortController();
|
|
28
|
+
n = t;
|
|
29
29
|
let r = e.next();
|
|
30
30
|
return {
|
|
31
|
-
signal:
|
|
32
|
-
isCurrent: () => e.isCurrent(r) && !
|
|
31
|
+
signal: t.signal,
|
|
32
|
+
isCurrent: () => e.isCurrent(r) && !t.signal.aborted
|
|
33
33
|
};
|
|
34
34
|
},
|
|
35
35
|
cancel: () => {
|
|
36
|
-
|
|
36
|
+
n?.abort(), n = null, e.cancel();
|
|
37
37
|
}
|
|
38
38
|
};
|
|
39
|
-
}, d = "\0kapisel-create", f = (e) => e.value === d, p = (e,
|
|
40
|
-
let a =
|
|
41
|
-
return r && c(e,
|
|
39
|
+
}, d = "\0kapisel-create", f = (e) => e.value === d, p = (e, t, r, i) => {
|
|
40
|
+
let a = n(e);
|
|
41
|
+
return r && c(e, t) ? [...a, {
|
|
42
42
|
value: d,
|
|
43
43
|
label: i
|
|
44
44
|
}] : a;
|
|
45
45
|
};
|
|
46
|
-
//#endregion
|
|
47
46
|
export { d as CREATE_VALUE, u as createLoadSequencer, f as isCreateRow, p as menuItems, o as mergeKnownOptions, s as selectedFromKnown, c as showCreateOption, l as withCreated };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/components/inputs/autocompleteLogic.ts
|
|
2
2
|
var e = (e) => e.normalize("NFD").replace(/[̀-ͯ]/g, "").toLowerCase(), t = (t, n, r, i = Infinity) => {
|
|
3
3
|
let a = e(n.trim()), o = i > 0 ? i : Infinity;
|
|
4
4
|
if (!a) return t.slice(0, o);
|
|
@@ -63,5 +63,4 @@ var e = (e) => e.normalize("NFD").replace(/[̀-ͯ]/g, "").toLowerCase(), t = (t,
|
|
|
63
63
|
}
|
|
64
64
|
return String(e);
|
|
65
65
|
};
|
|
66
|
-
//#endregion
|
|
67
66
|
export { s as AUTOCOMPLETE_MENU_PLACEMENT, n as clampActiveIndex, o as createRequestTracker, c as defaultGetLabel, t as filterOptions, i as highlightParts, a as isLatestRequest, e as normalizeText, r as shouldOpen };
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import "#kapi-css/components/inputs/checkControl.css";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { useKapiField as e } from "./KapiField.js";
|
|
4
|
+
import { nativeFieldProps as t } from "./fieldLogic.js";
|
|
5
5
|
/* empty css */
|
|
6
6
|
import { jsx as n, jsxs as r } from "react/jsx-runtime";
|
|
7
|
-
|
|
7
|
+
// src/components/inputs/checkControl.tsx
|
|
8
8
|
var i = (e = "") => ["kapi-check", e].filter(Boolean).join(" "), a = (a, o) => {
|
|
9
9
|
let s = ({ label: o, className: s, ref: c, invalid: l, id: u, required: d, "aria-describedby": f, "aria-invalid": p, "aria-required": m, ...h }) => {
|
|
10
|
-
let g = e(
|
|
10
|
+
let g = t(e(), {
|
|
11
11
|
id: u,
|
|
12
12
|
describedBy: f,
|
|
13
13
|
invalid: l,
|
|
@@ -29,5 +29,4 @@ var i = (e = "") => ["kapi-check", e].filter(Boolean).join(" "), a = (a, o) => {
|
|
|
29
29
|
};
|
|
30
30
|
return s.displayName = o, s;
|
|
31
31
|
};
|
|
32
|
-
//#endregion
|
|
33
32
|
export { i as checkClasses, a as createCheckControl };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { normalizeText as e } from "../overlays/menuKeyboardLogic.js";
|
|
2
|
-
|
|
2
|
+
// src/components/inputs/checklistLogic.ts
|
|
3
3
|
var t = (e) => e.text === void 0 ? typeof e.label == "string" || typeof e.label == "number" ? String(e.label) : "" : e.text, n = (n, r) => {
|
|
4
4
|
let i = e(r.trim());
|
|
5
5
|
return i ? n.filter((n) => e(t(n)).includes(i)) : [...n];
|
|
@@ -12,5 +12,4 @@ var t = (e) => e.text === void 0 ? typeof e.label == "string" || typeof e.label
|
|
|
12
12
|
let n = e.filter((e) => !e.disabled), r = n.filter((e) => t.has(e.id)).length;
|
|
13
13
|
return r === 0 ? "none" : r === n.length ? "all" : "some";
|
|
14
14
|
};
|
|
15
|
-
//#endregion
|
|
16
15
|
export { a as checklistBulkState, t as checklistItemText, n as filterChecklistItems, r as orderedChecklistValue, i as setChecklistItems };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { winOf as e } from "../../hooks/ownerDocument.js";
|
|
2
|
-
|
|
2
|
+
// src/components/inputs/copyLogic.ts
|
|
3
3
|
var t = async (t, n) => {
|
|
4
4
|
try {
|
|
5
5
|
let r = (n ? e(n) : globalThis.window)?.navigator?.clipboard;
|
|
@@ -8,5 +8,4 @@ var t = async (t, n) => {
|
|
|
8
8
|
return !1;
|
|
9
9
|
}
|
|
10
10
|
};
|
|
11
|
-
//#endregion
|
|
12
11
|
export { t as copyText };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "../locale/localeLogic.js";
|
|
2
|
-
|
|
2
|
+
// src/components/inputs/datePickerLogic.ts
|
|
3
3
|
var e = [
|
|
4
4
|
"enero",
|
|
5
5
|
"febrero",
|
|
@@ -239,5 +239,4 @@ var e = [
|
|
|
239
239
|
}
|
|
240
240
|
return u;
|
|
241
241
|
}, V = ({ variant: e, icon: t, chipLabel: n, label: r }) => e === void 0 ? !!t || !!n || !!r : e === "chip";
|
|
242
|
-
//#endregion
|
|
243
242
|
export { r as DEFAULT_CALENDAR_LABELS, A as DEFAULT_DATE_PATTERN, e as MESES, t as WEEKDAYS, n as WEEKDAY_NAMES, k as buildDays, w as calendarDayLabel, l as calendarNames, T as calendarRows, m as chipFieldSize, P as datePatternFor, I as formDateValue, F as formatValue, h as hasCalendar, g as hasTime, u as localizedCalendarLabels, L as maskInput, p as minuteOptions, d as monthTitle, O as moveCalendarFocus, f as pad, B as parseText, V as pickerIsChip, _ as sameDay, v as sameMonth, R as validDateOrNull, x as weekdayOrder };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { DEFAULT_DATE_PATTERN as e, formatValue as t, maskInput as n, parseText as r, sameDay as i, validDateOrNull as a } from "./datePickerLogic.js";
|
|
2
|
-
|
|
2
|
+
// src/components/inputs/dateRangeLogic.ts
|
|
3
3
|
var o = {
|
|
4
4
|
from: null,
|
|
5
5
|
to: null
|
|
@@ -72,5 +72,4 @@ var o = {
|
|
|
72
72
|
};
|
|
73
73
|
}
|
|
74
74
|
};
|
|
75
|
-
//#endregion
|
|
76
75
|
export { o as EMPTY_RANGE, s as RANGE_SEPARATOR, x as formatRange, g as isCompleteRange, S as maskRangeInput, y as openEndedDay, w as parseRangeText, v as pickRangeDay, b as rangeDayState, p as rangePlaceholder, _ as sameRange, C as validRange };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { normalizeFilterText as e } from "../data/tableLogic.js";
|
|
2
|
-
|
|
2
|
+
// src/components/inputs/facetedSearchLogic.ts
|
|
3
3
|
var t = (e) => e.operators && e.operators.length > 0 ? e.operators : ["eq"], n = (e, t) => {
|
|
4
4
|
let n = e.operator && e.operator !== "eq" && t ? `${e.label} ${t}` : e.label;
|
|
5
5
|
return e.value !== void 0 && e.value.trim() !== "" ? `${n}: ${e.value}` : n;
|
|
@@ -55,5 +55,4 @@ var o = (e) => `${e.getFullYear()}-${String(e.getMonth() + 1).padStart(2, "0")}-
|
|
|
55
55
|
to: t[2]
|
|
56
56
|
} : null;
|
|
57
57
|
}, l = (e) => e.count === void 0 ? e.label : `${e.label}, ${e.count}`, u = (e) => e?.kind === "date" || e?.kind === "dateRange";
|
|
58
|
-
//#endregion
|
|
59
58
|
export { n as facetChipText, a as facetKeyAction, i as facetMenuItems, t as facetOperators, l as facetOptionName, u as isDateFacet, c as parseDateRangeValue, s as toDateRangeValue, o as toDateValue };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { present as e } from "./inputLogic.js";
|
|
2
|
-
|
|
2
|
+
// src/components/inputs/fieldLogic.ts
|
|
3
3
|
var t = ({ controlId: e, labelId: t, helpId: n, required: r, status: i, readOnly: a }) => ({
|
|
4
4
|
controlId: e,
|
|
5
5
|
labelId: t,
|
|
@@ -58,5 +58,4 @@ var t = ({ controlId: e, labelId: t, helpId: n, required: r, status: i, readOnly
|
|
|
58
58
|
message: n,
|
|
59
59
|
...l(r, i)
|
|
60
60
|
}, d = (e, t) => e ?? t;
|
|
61
|
-
//#endregion
|
|
62
61
|
export { c as assignRef, t as fieldContextValue, a as fieldControlProps, i as fieldIds, s as focusLeaves, r as joinIds, o as nativeFieldProps, d as resolveFieldClassName, u as resolveFieldMessage, n as resolveReadOnly, l as resolveValidation };
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
// src/components/inputs/fileUploadLogic.ts
|
|
2
2
|
var e = (e) => `${e > 0 ? Math.max(1, Math.round(e / 1024)) : 0} KB`, t = (e, t) => {
|
|
3
3
|
let n = (t ?? "").split(",").map((e) => e.trim().toLowerCase()).filter(Boolean);
|
|
4
4
|
if (n.length === 0) return !0;
|
|
5
5
|
let r = e.name.toLowerCase(), i = e.type.toLowerCase();
|
|
6
6
|
return n.some((e) => e.startsWith(".") ? r.endsWith(e) : e.endsWith("/*") ? i.startsWith(e.slice(0, -1)) : i === e);
|
|
7
7
|
}, n = (e, t, n) => n ? [...e, ...t] : t.slice(0, 1), r = (e, t) => e.filter((e, n) => n !== t), i = (e) => e === "Enter" || e === " " || e === "Spacebar";
|
|
8
|
-
//#endregion
|
|
9
8
|
export { e as formatFileSize, i as isActivationKey, t as matchesAccept, n as mergeFiles, r as removeFileAt };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { present as e } from "./inputLogic.js";
|
|
2
|
-
|
|
2
|
+
// src/components/inputs/formBridgeLogic.ts
|
|
3
3
|
var t = (e, t) => t === void 0 ? {} : { [e]: t };
|
|
4
4
|
function n(n, r = "event") {
|
|
5
5
|
let i = n.onChange, a = {
|
|
@@ -21,5 +21,4 @@ function n(n, r = "event") {
|
|
|
21
21
|
...t("error", n.error)
|
|
22
22
|
};
|
|
23
23
|
}
|
|
24
|
-
//#endregion
|
|
25
24
|
export { n as bindField };
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
// src/components/inputs/inputGroupLogic.ts
|
|
2
2
|
var e = ({ size: e = "md", status: t, className: n = "" } = {}) => [
|
|
3
3
|
"kapi-inputgroup",
|
|
4
4
|
e !== "md" && `kapi-inputgroup--${e}`,
|
|
5
5
|
t && `kapi-inputgroup--${t}`,
|
|
6
6
|
n
|
|
7
7
|
].filter(Boolean).join(" "), t = (e = "") => ["kapi-inputgroup__addon", e].filter(Boolean).join(" "), n = (e, t) => e ?? t, r = ({ id: e, fieldControlId: t, autoId: n, inGroup: r }) => e ?? (r ? void 0 : t) ?? n;
|
|
8
|
-
//#endregion
|
|
9
8
|
export { t as inputGroupAddonClasses, e as inputGroupClasses, n as resolveGroupSize, r as selectControlId };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/components/inputs/inputLogic.ts
|
|
2
2
|
var e = (e) => e != null && typeof e != "boolean" && e !== "", t = ({ startIcon: t, endIcon: n, prefix: r, suffix: i, clearable: a, reveal: o, shortcut: s }) => e(t) || e(n) || e(r) || e(i) || !!a || !!o || !!s, n = (e) => e == null ? !1 : Array.isArray(e) ? e.length > 0 : String(e) !== "", r = ({ size: e = "md", status: t, disabled: n = !1, className: r = "" } = {}) => [
|
|
3
3
|
"kapi-inputbox",
|
|
4
4
|
e !== "md" && `kapi-inputbox--${e}`,
|
|
@@ -6,5 +6,4 @@ var e = (e) => e != null && typeof e != "boolean" && e !== "", t = ({ startIcon:
|
|
|
6
6
|
n && "is-disabled",
|
|
7
7
|
r
|
|
8
8
|
].filter(Boolean).join(" "), i = ({ reveal: e, revealed: t, disabled: n }) => e && t && !n ? "text" : void 0;
|
|
9
|
-
//#endregion
|
|
10
9
|
export { t as hasAdornments, n as hasValue, r as inputBoxClasses, e as present, i as tipoDeCampo };
|
|
@@ -55,5 +55,4 @@ var e = [
|
|
|
55
55
|
for (let r = 0; r < e.length; r += 1) if (f(e[r]) && (n += 1, n === t)) return r + 1;
|
|
56
56
|
return e.length;
|
|
57
57
|
};
|
|
58
|
-
//#endregion
|
|
59
58
|
export { m as caretForSignificant, p as countSignificant, a as cuitCheckDigit, i as formatCuit, d as formatCurrency, r as formatDni, o as isValidCuit, l as maskCurrencyInput, t as onlyDigits, u as parseCurrency };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { useEffect as e, useRef as t } from "react";
|
|
3
|
-
|
|
3
|
+
// src/components/inputs/misuseWarnings.ts
|
|
4
4
|
var n = (e) => {
|
|
5
5
|
let t = /* @__PURE__ */ new Set();
|
|
6
6
|
for (let n of e) {
|
|
@@ -32,5 +32,4 @@ var n = (e) => {
|
|
|
32
32
|
l
|
|
33
33
|
]);
|
|
34
34
|
};
|
|
35
|
-
//#endregion
|
|
36
35
|
export { n as firstDuplicate, i as isMuted, r as useDuplicateValueWarning, a as useMutedControlWarning };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/components/inputs/numberStepLogic.ts
|
|
2
2
|
var e = (e) => {
|
|
3
3
|
let t = String(e), n = /e-(\d+)$/i.exec(t);
|
|
4
4
|
if (n) {
|
|
@@ -26,5 +26,4 @@ var e = (e) => {
|
|
|
26
26
|
max: a
|
|
27
27
|
});
|
|
28
28
|
}, o = (e, { min: t } = {}) => t === void 0 || e > t, s = (e, { max: t } = {}) => t === void 0 || e < t;
|
|
29
|
-
//#endregion
|
|
30
29
|
export { o as canDecrement, s as canIncrement, i as clampNumber, n as parseTypedNumber, r as snapToStep, a as stepValue };
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
import { fieldContextValue as
|
|
4
|
-
import {
|
|
2
|
+
import { KapiField as e, useKapiField as t } from "./KapiField.js";
|
|
3
|
+
import { fieldContextValue as n, resolveFieldMessage as r } from "./fieldLogic.js";
|
|
4
|
+
import { present as i } from "./inputLogic.js";
|
|
5
5
|
import { useId as a } from "react";
|
|
6
6
|
import { jsx as o } from "react/jsx-runtime";
|
|
7
|
-
|
|
7
|
+
// src/components/inputs/ownField.tsx
|
|
8
8
|
var s = ({ id: s, label: c, help: l, error: u, required: d, invalid: f, status: p, readOnly: m, fieldClassName: h }) => {
|
|
9
|
-
let g =
|
|
9
|
+
let g = t(), _ = a(), { message: v, status: y } = r(u, l, f, p), b = c != null || i(v), x = s ?? (b ? _ : g?.controlId), S = i(v) ? `${x}-help` : void 0;
|
|
10
10
|
return {
|
|
11
11
|
wraps: b,
|
|
12
|
-
field: b ?
|
|
12
|
+
field: b ? n({
|
|
13
13
|
controlId: x ?? _,
|
|
14
14
|
labelId: c == null ? void 0 : `${x}-label`,
|
|
15
15
|
helpId: S,
|
|
@@ -21,7 +21,7 @@ var s = ({ id: s, label: c, help: l, error: u, required: d, invalid: f, status:
|
|
|
21
21
|
controlId: x,
|
|
22
22
|
autoId: _,
|
|
23
23
|
helpId: S,
|
|
24
|
-
wrap: (
|
|
24
|
+
wrap: (t) => b ? /* @__PURE__ */ o(e, {
|
|
25
25
|
label: c,
|
|
26
26
|
htmlFor: x,
|
|
27
27
|
required: d,
|
|
@@ -30,9 +30,8 @@ var s = ({ id: s, label: c, help: l, error: u, required: d, invalid: f, status:
|
|
|
30
30
|
status: y,
|
|
31
31
|
readOnly: m,
|
|
32
32
|
className: h,
|
|
33
|
-
children:
|
|
34
|
-
}) :
|
|
33
|
+
children: t
|
|
34
|
+
}) : t
|
|
35
35
|
};
|
|
36
36
|
};
|
|
37
|
-
//#endregion
|
|
38
37
|
export { s as useOwnField };
|