prometeo-design-system 2.8.5 → 2.8.7
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/Avatar.js +4 -0
- package/dist/Button.js +4 -0
- package/dist/CardProfile.js +5 -0
- package/dist/CheckBox.js +4 -0
- package/dist/DatePicker.js +5 -0
- package/dist/DialogModal.js +6 -0
- package/dist/DrawerDesktop.js +6 -0
- package/dist/DrawerMobile.js +6 -0
- package/dist/DropZone.js +5 -0
- package/dist/FAButton.js +4 -0
- package/dist/Header.js +4 -0
- package/dist/Icons/Icons.js +1055 -0
- package/dist/Icons.js +5 -0
- package/dist/Image.js +4 -0
- package/dist/ImageGallery.js +6 -0
- package/dist/Input.js +4 -0
- package/dist/InputMultiple.js +5 -0
- package/dist/LayoutGeneric.js +4 -0
- package/dist/Logo.js +4 -0
- package/dist/Menu.js +5 -0
- package/dist/OtpInput.js +4 -0
- package/dist/Pagination.js +4 -0
- package/dist/ProfilePictureUpload.js +5 -0
- package/dist/ProgressBar.js +4 -0
- package/dist/RadioButton.js +5 -0
- package/dist/SegmentedButton.js +5 -0
- package/dist/Select.js +4 -0
- package/dist/SelectSearch.js +4 -0
- package/dist/Skeleton.js +5 -0
- package/dist/Spinner.js +4 -0
- package/dist/Steps.js +5 -0
- package/dist/SwipeContainer.js +4 -0
- package/dist/Switch.js +5 -0
- package/dist/TabLinks.js +4 -0
- package/dist/Table.js +11 -0
- package/dist/TextArea.js +4 -0
- package/dist/Toast.js +5 -0
- package/dist/ToastProvider.js +4 -0
- package/dist/Tooltip.js +4 -0
- package/dist/components/Autocomplete/useAutocomplete.js +143 -0
- package/dist/{Avatar.es.js → components/Avatar/Avatar.js} +24 -24
- package/dist/{Button.es.js → components/Button/Button.js} +55 -55
- package/dist/{CardProfile-CsytJlKZ.js → components/CardProfile/CardProfile.js} +68 -94
- package/dist/{CheckBox.es.js → components/CheckBox/CheckBox.js} +25 -25
- package/dist/components/DatePicker/DatePicker.js +396 -0
- package/dist/components/Dialog/Dialog.js +60 -0
- package/dist/components/Dialog/useDialogControl.js +18 -0
- package/dist/components/Drawer/DrawerDesktop.js +179 -0
- package/dist/components/Drawer/DrawerMobile.js +219 -0
- package/dist/components/Drawer/useDrawerDesktop.js +18 -0
- package/dist/components/Drawer/useDrawerMobile.js +27 -0
- package/dist/components/DropZone/DropZone.js +86 -0
- package/dist/components/DropZone/useFileDropzone.js +24 -0
- package/dist/{FAButton.es.js → components/FAB/FAButton.js} +5 -5
- package/dist/components/Header/Header.js +32 -0
- package/dist/components/Image/GalleryPreview.js +40 -0
- package/dist/{Image.es.js → components/Image/Image.js} +32 -32
- package/dist/components/Image/ImageGallery.js +68 -0
- package/dist/components/Image/LightBox.js +223 -0
- package/dist/{ImageGallery.es.js → components/Image/useImageGallery.js} +0 -2
- package/dist/components/Input/Input.js +219 -0
- package/dist/components/InputMultiple/InputMultiple.js +262 -0
- package/dist/components/Layout/LayoutGeneric.js +13 -0
- package/dist/components/Logo/Logo.js +9 -0
- package/dist/{Menu.es.js → components/Menu/MenuComposable.js} +12 -13
- package/dist/components/OtpInput/OtpInput.js +112 -0
- package/dist/{Pagination.es.js → components/Pagination/Pagination.js} +32 -32
- package/dist/{ProfilePictureUpload.es.js → components/ProfilePictureUpload/ProfilePictureUpload.js} +56 -57
- package/dist/components/ProgressBar/ProgressBar.js +70 -0
- package/dist/{RadioButton.es.js → components/RadioButton/RadioButton.js} +35 -36
- package/dist/{SegmentedButton.es.js → components/SegmentedButton/SegmentedButton.js} +37 -38
- package/dist/components/Select/Select.js +1005 -0
- package/dist/components/SelectSearch/SelectSearch.js +101 -0
- package/dist/components/Shared/Chip.js +55 -0
- package/dist/components/Shared/HelperComponent.js +24 -0
- package/dist/components/Sidebar/SecondaryBar/SecondaryBar.js +62 -0
- package/dist/components/Sidebar/SecondaryBar/hooks/useSecondaryBarAnimation.js +59 -0
- package/dist/components/Sidebar/SidebarComposable.js +84 -0
- package/dist/components/Sidebar/components/NavigationLink.js +34 -0
- package/dist/components/Sidebar/components/badge.js +33 -0
- package/dist/components/Sidebar/components/changue-account.js +31 -0
- package/dist/components/Sidebar/components/collapse-button.js +18 -0
- package/dist/components/Sidebar/components/company-logo.js +12 -0
- package/dist/components/Sidebar/components/nav-actions.js +98 -0
- package/dist/components/Sidebar/components/nav-links.js +100 -0
- package/dist/components/Sidebar/context/SidebarContext.js +19 -0
- package/dist/components/Sidebar/hooks/SidebarProvider.js +33 -0
- package/dist/components/Sidebar/hooks/useNavBarActions.js +9 -0
- package/dist/components/Sidebar/hooks/useNavBarCollapse.js +11 -0
- package/dist/components/Sidebar/hooks/useSidebarHook.js +13 -0
- package/dist/components/Sidebar/ui/useNavbarAnimation.js +326 -0
- package/dist/{Skeleton.es.js → components/Skeleton/Skeleton.js} +16 -18
- package/dist/components/Spinner/Spinner.js +52 -0
- package/dist/{Steps.es.js → components/Steps/Steps.js} +61 -62
- package/dist/{SwipeContainer.es.js → components/SwipeContainer/SwipeContainer.js} +68 -68
- package/dist/{Switch.es.js → components/Switch/Switch.js} +17 -18
- package/dist/{TabLinks.es.js → components/TabLinks/TabLinks.js} +11 -11
- package/dist/components/TabSwitch/TabSwitch.js +57 -0
- package/dist/{Table.es.js → components/Table/Table.js} +38 -41
- package/dist/{TextArea.es.js → components/TextArea/TextArea.js} +24 -26
- package/dist/components/Toaster/ToastProvider.js +6 -0
- package/dist/{Toast.es.js → components/Toaster/Toaster.js} +48 -48
- package/dist/components/Tooltip/Tootip.js +62 -0
- package/dist/hooks/useClickOutside.js +24 -0
- package/dist/{useDragScroll-CHN9OMwn.js → hooks/useDragScroll.js} +1 -1
- package/dist/hooks/useLabelBackground.js +25 -0
- package/dist/index.js +119 -0
- package/dist/{cn-B6yFEsav.js → lib/cn.js} +2 -2
- package/dist/lib/utils.js +54 -0
- package/dist/node_modules/@date-fns/tz/date/index.js +61 -0
- package/dist/node_modules/@date-fns/tz/date/mini.js +69 -0
- package/dist/node_modules/@date-fns/tz/tzName/index.js +11 -0
- package/dist/node_modules/@date-fns/tz/tzOffset/index.js +22 -0
- package/dist/{index-BOQuZ0gG.js → node_modules/class-variance-authority/dist/index.js} +10 -9
- package/dist/node_modules/date-fns/_lib/addLeadingZeros.js +7 -0
- package/dist/node_modules/date-fns/_lib/defaultOptions.js +7 -0
- package/dist/node_modules/date-fns/_lib/format/formatters.js +583 -0
- package/dist/node_modules/date-fns/_lib/format/lightFormatters.js +59 -0
- package/dist/node_modules/date-fns/_lib/format/longFormatters.js +52 -0
- package/dist/node_modules/date-fns/_lib/getTimezoneOffsetInMilliseconds.js +18 -0
- package/dist/node_modules/date-fns/_lib/normalizeDates.js +11 -0
- package/dist/node_modules/date-fns/_lib/normalizeInterval.js +8 -0
- package/dist/node_modules/date-fns/_lib/protectedTokens.js +20 -0
- package/dist/node_modules/date-fns/addDays.js +10 -0
- package/dist/node_modules/date-fns/addMonths.js +20 -0
- package/dist/node_modules/date-fns/addWeeks.js +8 -0
- package/dist/node_modules/date-fns/addYears.js +8 -0
- package/dist/node_modules/date-fns/constants.js +6 -0
- package/dist/node_modules/date-fns/constructFrom.js +8 -0
- package/dist/node_modules/date-fns/differenceInCalendarDays.js +16 -0
- package/dist/node_modules/date-fns/differenceInCalendarMonths.js +13 -0
- package/dist/node_modules/date-fns/eachMonthOfInterval.js +17 -0
- package/dist/node_modules/date-fns/eachYearOfInterval.js +17 -0
- package/dist/node_modules/date-fns/endOfISOWeek.js +8 -0
- package/dist/node_modules/date-fns/endOfMonth.js +9 -0
- package/dist/node_modules/date-fns/endOfWeek.js +10 -0
- package/dist/node_modules/date-fns/endOfYear.js +9 -0
- package/dist/node_modules/date-fns/format.js +58 -0
- package/dist/node_modules/date-fns/getDayOfYear.js +11 -0
- package/dist/node_modules/date-fns/getDaysInMonth.js +10 -0
- package/dist/node_modules/date-fns/getISOWeek.js +12 -0
- package/dist/node_modules/date-fns/getISOWeekYear.js +15 -0
- package/dist/node_modules/date-fns/getMonth.js +8 -0
- package/dist/node_modules/date-fns/getWeek.js +12 -0
- package/dist/node_modules/date-fns/getWeekYear.js +16 -0
- package/dist/node_modules/date-fns/getYear.js +8 -0
- package/dist/node_modules/date-fns/isAfter.js +8 -0
- package/dist/node_modules/date-fns/isBefore.js +8 -0
- package/dist/node_modules/date-fns/isDate.js +7 -0
- package/dist/node_modules/date-fns/isSameDay.js +14 -0
- package/dist/node_modules/date-fns/isSameMonth.js +13 -0
- package/dist/node_modules/date-fns/isSameYear.js +13 -0
- package/dist/node_modules/date-fns/isValid.js +9 -0
- package/dist/node_modules/date-fns/locale/_lib/buildFormatLongFn.js +9 -0
- package/dist/node_modules/date-fns/locale/_lib/buildLocalizeFn.js +18 -0
- package/dist/node_modules/date-fns/locale/_lib/buildMatchFn.js +31 -0
- package/dist/node_modules/date-fns/locale/_lib/buildMatchPatternFn.js +15 -0
- package/dist/node_modules/date-fns/locale/en-US/_lib/formatDistance.js +70 -0
- package/dist/node_modules/date-fns/locale/en-US/_lib/formatLong.js +33 -0
- package/dist/node_modules/date-fns/locale/en-US/_lib/formatRelative.js +11 -0
- package/dist/node_modules/date-fns/locale/en-US/_lib/localize.js +155 -0
- package/dist/node_modules/date-fns/locale/en-US/_lib/match.js +110 -0
- package/dist/node_modules/date-fns/locale/en-US.js +21 -0
- package/dist/node_modules/date-fns/locale/es/_lib/formatDistance.js +70 -0
- package/dist/node_modules/date-fns/locale/es/_lib/formatLong.js +33 -0
- package/dist/node_modules/date-fns/locale/es/_lib/formatRelative.js +18 -0
- package/dist/node_modules/date-fns/locale/es/_lib/localize.js +143 -0
- package/dist/node_modules/date-fns/locale/es/_lib/match.js +116 -0
- package/dist/node_modules/date-fns/locale/es.js +21 -0
- package/dist/node_modules/date-fns/max.js +14 -0
- package/dist/node_modules/date-fns/min.js +14 -0
- package/dist/node_modules/date-fns/setMonth.js +13 -0
- package/dist/node_modules/date-fns/setYear.js +10 -0
- package/dist/node_modules/date-fns/startOfDay.js +9 -0
- package/dist/node_modules/date-fns/startOfISOWeek.js +8 -0
- package/dist/node_modules/date-fns/startOfISOWeekYear.js +11 -0
- package/dist/node_modules/date-fns/startOfMonth.js +9 -0
- package/dist/node_modules/date-fns/startOfWeek.js +10 -0
- package/dist/node_modules/date-fns/startOfWeekYear.js +12 -0
- package/dist/node_modules/date-fns/startOfYear.js +9 -0
- package/dist/node_modules/date-fns/toDate.js +8 -0
- package/dist/node_modules/input-otp/dist/index.js +194 -0
- package/dist/node_modules/react-day-picker/dist/esm/DayPicker.js +227 -0
- package/dist/node_modules/react-day-picker/dist/esm/UI.js +22 -0
- package/dist/node_modules/react-day-picker/dist/esm/classes/CalendarDay.js +19 -0
- package/dist/node_modules/react-day-picker/dist/esm/classes/CalendarMonth.js +8 -0
- package/dist/node_modules/react-day-picker/dist/esm/classes/CalendarWeek.js +8 -0
- package/dist/node_modules/react-day-picker/dist/esm/classes/DateLib.js +147 -0
- package/dist/node_modules/react-day-picker/dist/esm/components/Button.js +7 -0
- package/dist/node_modules/react-day-picker/dist/esm/components/CaptionLabel.js +7 -0
- package/dist/node_modules/react-day-picker/dist/esm/components/Chevron.js +18 -0
- package/dist/node_modules/react-day-picker/dist/esm/components/Day.js +8 -0
- package/dist/node_modules/react-day-picker/dist/esm/components/DayButton.js +10 -0
- package/dist/node_modules/react-day-picker/dist/esm/components/Dropdown.js +19 -0
- package/dist/node_modules/react-day-picker/dist/esm/components/DropdownNav.js +7 -0
- package/dist/node_modules/react-day-picker/dist/esm/components/Footer.js +7 -0
- package/dist/node_modules/react-day-picker/dist/esm/components/Month.js +8 -0
- package/dist/node_modules/react-day-picker/dist/esm/components/MonthCaption.js +8 -0
- package/dist/node_modules/react-day-picker/dist/esm/components/MonthGrid.js +7 -0
- package/dist/node_modules/react-day-picker/dist/esm/components/Months.js +7 -0
- package/dist/node_modules/react-day-picker/dist/esm/components/MonthsDropdown.js +9 -0
- package/dist/node_modules/react-day-picker/dist/esm/components/Nav.js +27 -0
- package/dist/node_modules/react-day-picker/dist/esm/components/NextMonthButton.js +9 -0
- package/dist/node_modules/react-day-picker/dist/esm/components/Option.js +7 -0
- package/dist/node_modules/react-day-picker/dist/esm/components/PreviousMonthButton.js +9 -0
- package/dist/node_modules/react-day-picker/dist/esm/components/Root.js +8 -0
- package/dist/node_modules/react-day-picker/dist/esm/components/Select.js +7 -0
- package/dist/node_modules/react-day-picker/dist/esm/components/Week.js +8 -0
- package/dist/node_modules/react-day-picker/dist/esm/components/WeekNumber.js +8 -0
- package/dist/node_modules/react-day-picker/dist/esm/components/WeekNumberHeader.js +7 -0
- package/dist/node_modules/react-day-picker/dist/esm/components/Weekday.js +7 -0
- package/dist/node_modules/react-day-picker/dist/esm/components/Weekdays.js +11 -0
- package/dist/node_modules/react-day-picker/dist/esm/components/Weeks.js +7 -0
- package/dist/node_modules/react-day-picker/dist/esm/components/YearsDropdown.js +9 -0
- package/dist/node_modules/react-day-picker/dist/esm/components/custom-components.js +54 -0
- package/dist/node_modules/react-day-picker/dist/esm/formatters/formatCaption.js +9 -0
- package/dist/node_modules/react-day-picker/dist/esm/formatters/formatDay.js +7 -0
- package/dist/node_modules/react-day-picker/dist/esm/formatters/formatMonthDropdown.js +7 -0
- package/dist/node_modules/react-day-picker/dist/esm/formatters/formatWeekNumber.js +7 -0
- package/dist/node_modules/react-day-picker/dist/esm/formatters/formatWeekNumberHeader.js +6 -0
- package/dist/node_modules/react-day-picker/dist/esm/formatters/formatWeekdayName.js +7 -0
- package/dist/node_modules/react-day-picker/dist/esm/formatters/formatYearDropdown.js +9 -0
- package/dist/node_modules/react-day-picker/dist/esm/formatters/index.js +18 -0
- package/dist/node_modules/react-day-picker/dist/esm/helpers/calculateFocusTarget.js +19 -0
- package/dist/node_modules/react-day-picker/dist/esm/helpers/createGetModifiers.js +42 -0
- package/dist/node_modules/react-day-picker/dist/esm/helpers/endOfBroadcastWeek.js +9 -0
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getBroadcastWeeksInMonth.js +7 -0
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getClassNamesForModifiers.js +7 -0
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getComponents.js +10 -0
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getDataAttributes.js +16 -0
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getDates.js +21 -0
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getDays.js +10 -0
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getDefaultClassNames.js +16 -0
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getDisplayMonths.js +13 -0
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getFocusableDate.js +15 -0
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getFormatters.js +10 -0
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getInitialMonth.js +13 -0
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getMonthOptions.js +13 -0
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getMonths.js +24 -0
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getNavMonth.js +13 -0
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getNextFocus.js +12 -0
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getNextMonth.js +12 -0
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getPreviousMonth.js +12 -0
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getStyleForModifiers.js +13 -0
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getWeekdays.js +11 -0
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getWeeks.js +7 -0
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getYearOptions.js +16 -0
- package/dist/node_modules/react-day-picker/dist/esm/helpers/startOfBroadcastWeek.js +7 -0
- package/dist/node_modules/react-day-picker/dist/esm/helpers/useControlledValue.js +8 -0
- package/dist/node_modules/react-day-picker/dist/esm/labels/index.js +26 -0
- package/dist/node_modules/react-day-picker/dist/esm/labels/labelDayButton.js +10 -0
- package/dist/node_modules/react-day-picker/dist/esm/labels/labelGrid.js +9 -0
- package/dist/node_modules/react-day-picker/dist/esm/labels/labelGridcell.js +8 -0
- package/dist/node_modules/react-day-picker/dist/esm/labels/labelMonthDropdown.js +6 -0
- package/dist/node_modules/react-day-picker/dist/esm/labels/labelNav.js +6 -0
- package/dist/node_modules/react-day-picker/dist/esm/labels/labelNext.js +6 -0
- package/dist/node_modules/react-day-picker/dist/esm/labels/labelPrevious.js +6 -0
- package/dist/node_modules/react-day-picker/dist/esm/labels/labelWeekNumber.js +6 -0
- package/dist/node_modules/react-day-picker/dist/esm/labels/labelWeekNumberHeader.js +6 -0
- package/dist/node_modules/react-day-picker/dist/esm/labels/labelWeekday.js +7 -0
- package/dist/node_modules/react-day-picker/dist/esm/labels/labelYearDropdown.js +6 -0
- package/dist/node_modules/react-day-picker/dist/esm/selection/useMulti.js +21 -0
- package/dist/node_modules/react-day-picker/dist/esm/selection/useRange.js +18 -0
- package/dist/node_modules/react-day-picker/dist/esm/selection/useSingle.js +15 -0
- package/dist/node_modules/react-day-picker/dist/esm/useAnimation.js +56 -0
- package/dist/node_modules/react-day-picker/dist/esm/useCalendar.js +44 -0
- package/dist/node_modules/react-day-picker/dist/esm/useDayPicker.js +12 -0
- package/dist/node_modules/react-day-picker/dist/esm/useFocus.js +23 -0
- package/dist/node_modules/react-day-picker/dist/esm/useSelection.js +19 -0
- package/dist/node_modules/react-day-picker/dist/esm/utils/addToRange.js +32 -0
- package/dist/node_modules/react-day-picker/dist/esm/utils/dateMatchModifiers.js +26 -0
- package/dist/node_modules/react-day-picker/dist/esm/utils/rangeContainsDayOfWeek.js +15 -0
- package/dist/node_modules/react-day-picker/dist/esm/utils/rangeContainsModifiers.js +28 -0
- package/dist/node_modules/react-day-picker/dist/esm/utils/rangeIncludesDate.js +9 -0
- package/dist/node_modules/react-day-picker/dist/esm/utils/rangeOverlaps.js +8 -0
- package/dist/node_modules/react-day-picker/dist/esm/utils/typeguards.js +26 -0
- package/dist/prometeo-design-system.css +1 -1
- package/dist/useDevice.js +4 -0
- package/package.json +114 -115
- package/dist/CardProfile.es.js +0 -5
- package/dist/DatePicker.es.js +0 -3441
- package/dist/DialogModal.es.js +0 -75
- package/dist/DrawerDesktop.es.js +0 -192
- package/dist/DrawerMobile.es.js +0 -242
- package/dist/DropZone.es.js +0 -87
- package/dist/Header.es.js +0 -32
- package/dist/HelperComponent-g_xuKWzK.js +0 -24
- package/dist/Icons-DtFC5DJ7.js +0 -1079
- package/dist/Icons.es.js +0 -5
- package/dist/ImageGallery-Ckxg9OIC.js +0 -317
- package/dist/Input-Cck37DpG.js +0 -240
- package/dist/Input.es.js +0 -4
- package/dist/InputMultiple.es.js +0 -263
- package/dist/LayoutGeneric-CbaoatQB.js +0 -26
- package/dist/LayoutGeneric.es.js +0 -4
- package/dist/Logo.es.js +0 -9
- package/dist/OtpInput.es.js +0 -301
- package/dist/ProgressBar.es.js +0 -70
- package/dist/Select-BD5FTxVw.js +0 -1100
- package/dist/Select.es.js +0 -4
- package/dist/SelectSearch.es.js +0 -237
- package/dist/Spinner.es.js +0 -52
- package/dist/ToastProvider.es.js +0 -6
- package/dist/Tooltip.es.js +0 -62
- package/dist/jsx-runtime-DKDX3adD.js +0 -281
- package/dist/prometeo-design-system.es.js +0 -1002
- /package/dist/{useDevice.es.js → hooks/useDevice.js} +0 -0
|
@@ -0,0 +1,1005 @@
|
|
|
1
|
+
import { jsxs as V, jsx as u } from "react/jsx-runtime";
|
|
2
|
+
import { Cancel as Je, ChevronDown as Re, Search as Qe } from "../../Icons/Icons.js";
|
|
3
|
+
import { cn as d } from "../../lib/cn.js";
|
|
4
|
+
import Ne, { memo as ne, useState as De, useRef as ae, useMemo as te, useCallback as W, useEffect as ge, useImperativeHandle as Xe } from "react";
|
|
5
|
+
import Ye from "../Spinner/Spinner.js";
|
|
6
|
+
import { createPortal as Ze } from "react-dom";
|
|
7
|
+
import { useDragScroll as et } from "../../hooks/useDragScroll.js";
|
|
8
|
+
import { useLabelBackground as tt } from "../../hooks/useLabelBackground.js";
|
|
9
|
+
import nt from "../Shared/HelperComponent.js";
|
|
10
|
+
import rt from "../Shared/Chip.js";
|
|
11
|
+
import lt from "../CheckBox/CheckBox.js";
|
|
12
|
+
import { getAccessorValue as O, hasCoincidences as Ue } from "../../lib/utils.js";
|
|
13
|
+
import ot from "../Input/Input.js";
|
|
14
|
+
import qe from "../Skeleton/Skeleton.js";
|
|
15
|
+
const at = (e) => {
|
|
16
|
+
const n = [], m = (b) => {
|
|
17
|
+
b.forEach((y) => {
|
|
18
|
+
const p = y.options;
|
|
19
|
+
Array.isArray(p) && p.length > 0 ? m(p) : n.push(y);
|
|
20
|
+
});
|
|
21
|
+
};
|
|
22
|
+
return m(e), n;
|
|
23
|
+
}, Be = {
|
|
24
|
+
default: {
|
|
25
|
+
container: "",
|
|
26
|
+
input: d(
|
|
27
|
+
"border-neutral-default-default text-neutral-default-default",
|
|
28
|
+
"focus:ring-primary-default-default focus:ring-[1px] focus:border-primary-default-default ",
|
|
29
|
+
"hover:border-primary-default-default"
|
|
30
|
+
),
|
|
31
|
+
label: d(
|
|
32
|
+
"text-neutral-medium-default",
|
|
33
|
+
"peer-focus:text-primary-default-default"
|
|
34
|
+
),
|
|
35
|
+
icon: d(
|
|
36
|
+
"text-neutral-medium-default",
|
|
37
|
+
"peer-focus:text-primary-default-default"
|
|
38
|
+
)
|
|
39
|
+
},
|
|
40
|
+
error: {
|
|
41
|
+
container: "",
|
|
42
|
+
input: d(
|
|
43
|
+
"border-error-default-default text-neutral-default-default hover:border-error-default-hover",
|
|
44
|
+
"focus:border-error-default focus:border-2",
|
|
45
|
+
"focus:ring-0 focus:ring-error-default/20"
|
|
46
|
+
),
|
|
47
|
+
label: d("text-error-light", "peer-focus:text-error-light"),
|
|
48
|
+
icon: d("text-error-medium-default", "peer-focus:text-error-light")
|
|
49
|
+
},
|
|
50
|
+
success: {
|
|
51
|
+
container: "",
|
|
52
|
+
input: d(
|
|
53
|
+
"border-success-default-default text-neutral-default-default",
|
|
54
|
+
"focus:border-success-default focus:border-2",
|
|
55
|
+
"focus:ring-0 focus:ring-success-default/20"
|
|
56
|
+
),
|
|
57
|
+
label: d("text-success", "peer-focus:text-success-light"),
|
|
58
|
+
icon: d("text-success-medium-default", "peer-focus:text-success-light")
|
|
59
|
+
}
|
|
60
|
+
}, Ke = {
|
|
61
|
+
input: d(
|
|
62
|
+
"border-neutral-strong-default text-neutral-default-default pointer-events-none",
|
|
63
|
+
"focus:ring-0 focus:border-primary-default-disabled ",
|
|
64
|
+
"hover:border-neutral-default-disabled"
|
|
65
|
+
),
|
|
66
|
+
label: d(
|
|
67
|
+
"text-neutral-medium-disabled",
|
|
68
|
+
"peer-focus:text-primary-default-default"
|
|
69
|
+
),
|
|
70
|
+
icon: d(
|
|
71
|
+
"text-neutral-medium-disabled",
|
|
72
|
+
"peer-focus:text-primary-default-default"
|
|
73
|
+
)
|
|
74
|
+
};
|
|
75
|
+
function st(e) {
|
|
76
|
+
const [n, m] = De(!1), [b, y] = De([]), [N, p] = De(""), T = ae(null), f = ae(null), P = ae(null), B = ae(null), K = ae(
|
|
77
|
+
() => {
|
|
78
|
+
}
|
|
79
|
+
), He = ae(null), be = ae(/* @__PURE__ */ new Set()), {
|
|
80
|
+
id: M,
|
|
81
|
+
name: S,
|
|
82
|
+
label: ye,
|
|
83
|
+
height: ve,
|
|
84
|
+
options: J,
|
|
85
|
+
controls: xe,
|
|
86
|
+
className: F,
|
|
87
|
+
placeholder: k,
|
|
88
|
+
optionValue: w,
|
|
89
|
+
optionLabel: se,
|
|
90
|
+
renderOption: j,
|
|
91
|
+
renderOptionGroupHeader: ie,
|
|
92
|
+
renderSelection: Oe,
|
|
93
|
+
renderOptionContext: Ae,
|
|
94
|
+
buttonClassName: ke,
|
|
95
|
+
dropdownClassName: re,
|
|
96
|
+
containerClassName: U,
|
|
97
|
+
dropdownOptions: D,
|
|
98
|
+
helperComponent: Q,
|
|
99
|
+
errorComponent: Ce,
|
|
100
|
+
onRemoveOption: Ee,
|
|
101
|
+
onOptionClick: q,
|
|
102
|
+
onClose: Se,
|
|
103
|
+
onClear: ue,
|
|
104
|
+
disabled: X = !1,
|
|
105
|
+
overflow: je = "wrap",
|
|
106
|
+
variant: _ = "default",
|
|
107
|
+
isLoading: ce = !1,
|
|
108
|
+
attachToParent: ze = !1,
|
|
109
|
+
displayMode: we = "compact",
|
|
110
|
+
labelVariant: le = "default",
|
|
111
|
+
disableOpenOnFocus: Te = !1,
|
|
112
|
+
emptyMessage: Le = "No hay opciones disponibles"
|
|
113
|
+
} = e, { ref: Ge } = tt(), { bind: Y, ref: Pe } = et({
|
|
114
|
+
axis: "x",
|
|
115
|
+
cursor: { idle: "default", dragging: "grabbing" }
|
|
116
|
+
}), de = e.multiple ? Array.isArray(e.value) && e.value.length > 0 : e.value !== void 0 && e.value !== null && e.value !== "", Ie = {}, _e = te(() => le === "static" && k ? k : "", [le, k]), Me = te(
|
|
117
|
+
() => D?.controledSearchValue || N,
|
|
118
|
+
[D?.controledSearchValue, N]
|
|
119
|
+
), $e = () => {
|
|
120
|
+
const t = {
|
|
121
|
+
static: {
|
|
122
|
+
active: "relative prometeo-fonts-label-large",
|
|
123
|
+
default: "relative prometeo-fonts-label-large"
|
|
124
|
+
},
|
|
125
|
+
default: {
|
|
126
|
+
active: "absolute top-0 -translate-y-1/2 left-3 px-1 prometeo-fonts-body-small",
|
|
127
|
+
default: "absolute top-1/2 -translate-y-1/2 "
|
|
128
|
+
}
|
|
129
|
+
}, a = n || de ? "active" : "default";
|
|
130
|
+
return t[le][a];
|
|
131
|
+
}, E = W(
|
|
132
|
+
(t) => ({
|
|
133
|
+
id: O(t, w),
|
|
134
|
+
value: O(t, w),
|
|
135
|
+
label: O(t, se)
|
|
136
|
+
}),
|
|
137
|
+
[w, se]
|
|
138
|
+
), R = te(() => at(J), [J]), fe = te(
|
|
139
|
+
() => R.map(E),
|
|
140
|
+
[R, E]
|
|
141
|
+
), r = te(() => {
|
|
142
|
+
const t = [];
|
|
143
|
+
if (e.multiple)
|
|
144
|
+
e.value?.forEach((a) => {
|
|
145
|
+
const l = R?.find(
|
|
146
|
+
(c) => O(c, w) === a
|
|
147
|
+
);
|
|
148
|
+
l && t.push(l);
|
|
149
|
+
});
|
|
150
|
+
else {
|
|
151
|
+
const a = R?.find(
|
|
152
|
+
(l) => O(l, w) === e.value
|
|
153
|
+
);
|
|
154
|
+
a && t.push(a);
|
|
155
|
+
}
|
|
156
|
+
return t;
|
|
157
|
+
}, [e.value, w, R, e.multiple]), o = te(
|
|
158
|
+
() => r.map(E),
|
|
159
|
+
[r, E]
|
|
160
|
+
), s = te(
|
|
161
|
+
() => new Set(o.map((t) => t.id)),
|
|
162
|
+
[o]
|
|
163
|
+
), i = te(() => {
|
|
164
|
+
const t = [];
|
|
165
|
+
return J.forEach((a, l) => {
|
|
166
|
+
const c = a, C = c.options;
|
|
167
|
+
if (Array.isArray(C) && C.length > 0) {
|
|
168
|
+
const L = c.label, G = O(a, w), ee = `__group-${String(G ?? l)}`, he = {
|
|
169
|
+
id: ee,
|
|
170
|
+
value: ee,
|
|
171
|
+
label: typeof L == "string" ? L : String(G ?? `Grupo ${l + 1}`),
|
|
172
|
+
isGroupHeader: !0,
|
|
173
|
+
groupLabelNode: L,
|
|
174
|
+
originalOption: a,
|
|
175
|
+
groupData: {
|
|
176
|
+
groupOptions: C
|
|
177
|
+
}
|
|
178
|
+
};
|
|
179
|
+
t.push(he), C.forEach((pe) => {
|
|
180
|
+
j ? t.push(pe) : t.push(E(pe));
|
|
181
|
+
});
|
|
182
|
+
} else
|
|
183
|
+
j ? t.push(a) : t.push(E(a));
|
|
184
|
+
}), t;
|
|
185
|
+
}, [J, w, j, E]), v = W(
|
|
186
|
+
(t, a) => {
|
|
187
|
+
if (!t || t.length === 0) return;
|
|
188
|
+
const l = t.map(
|
|
189
|
+
(g) => E(g)
|
|
190
|
+
);
|
|
191
|
+
if (!e.multiple) {
|
|
192
|
+
const g = l[0];
|
|
193
|
+
if (!g) return;
|
|
194
|
+
const x = s.has(g.id), z = a ?? "toggle";
|
|
195
|
+
let We;
|
|
196
|
+
z === "select" || z === "toggle" && !x ? We = g : We = void 0, e.onChange?.(We, S);
|
|
197
|
+
return;
|
|
198
|
+
}
|
|
199
|
+
const c = e.value || [], C = [];
|
|
200
|
+
c.forEach((g) => {
|
|
201
|
+
const x = fe.find((z) => z.value === g);
|
|
202
|
+
x && C.push(x);
|
|
203
|
+
});
|
|
204
|
+
const L = new Set(C.map((g) => g.id)), G = new Set(l.map((g) => g.id)), ee = l.every(
|
|
205
|
+
(g) => L.has(g.id)
|
|
206
|
+
), he = a ?? "toggle", pe = he === "select" || he === "toggle" && !ee;
|
|
207
|
+
let I;
|
|
208
|
+
if (!pe)
|
|
209
|
+
I = C.filter((g) => !G.has(g.id));
|
|
210
|
+
else {
|
|
211
|
+
const g = new Map(
|
|
212
|
+
C.map((x) => [x.id, x])
|
|
213
|
+
);
|
|
214
|
+
l.forEach((x) => {
|
|
215
|
+
g.set(x.id, x);
|
|
216
|
+
}), I = Array.from(g.values());
|
|
217
|
+
}
|
|
218
|
+
e.onChange?.(I, S);
|
|
219
|
+
},
|
|
220
|
+
[
|
|
221
|
+
e.multiple,
|
|
222
|
+
e.value,
|
|
223
|
+
e.onChange,
|
|
224
|
+
fe,
|
|
225
|
+
s,
|
|
226
|
+
E,
|
|
227
|
+
S
|
|
228
|
+
]
|
|
229
|
+
), H = W(() => {
|
|
230
|
+
m((t) => !t);
|
|
231
|
+
}, []);
|
|
232
|
+
K.current = (t) => {
|
|
233
|
+
if (!e.multiple)
|
|
234
|
+
e.onChange?.(t, S);
|
|
235
|
+
else {
|
|
236
|
+
const a = e.value || [], l = [], c = a.includes(t.value);
|
|
237
|
+
a.forEach((L) => {
|
|
238
|
+
const G = fe.find(
|
|
239
|
+
(ee) => ee.value === L
|
|
240
|
+
);
|
|
241
|
+
G && l.push(G);
|
|
242
|
+
});
|
|
243
|
+
const C = c ? l.filter((L) => L.value !== t.value) : [...l, t];
|
|
244
|
+
e.onChange?.(C, S);
|
|
245
|
+
}
|
|
246
|
+
};
|
|
247
|
+
const h = W(
|
|
248
|
+
(t, a = !1) => {
|
|
249
|
+
q?.(t, S), K.current?.(t), a && (m(!1), Se?.());
|
|
250
|
+
},
|
|
251
|
+
[q, Se, S]
|
|
252
|
+
), A = (t) => {
|
|
253
|
+
t.preventDefault(), t.stopPropagation(), t.target.blur(), ue?.(), e.multiple ? e.onChange?.([], S) : e.onChange?.(void 0, S);
|
|
254
|
+
}, $ = W(
|
|
255
|
+
(t) => {
|
|
256
|
+
e.multiple || e.onChange?.(void 0, S);
|
|
257
|
+
const a = R.find(
|
|
258
|
+
(c) => O(c, w) === t
|
|
259
|
+
);
|
|
260
|
+
if (!a) return;
|
|
261
|
+
const l = E(a);
|
|
262
|
+
q?.(l, S), K.current?.(l), Ee?.(a);
|
|
263
|
+
},
|
|
264
|
+
[
|
|
265
|
+
q,
|
|
266
|
+
Ee,
|
|
267
|
+
R,
|
|
268
|
+
S,
|
|
269
|
+
e.multiple,
|
|
270
|
+
e.onChange,
|
|
271
|
+
E,
|
|
272
|
+
w
|
|
273
|
+
]
|
|
274
|
+
), Z = W(
|
|
275
|
+
(t) => {
|
|
276
|
+
$(t);
|
|
277
|
+
},
|
|
278
|
+
[$]
|
|
279
|
+
);
|
|
280
|
+
ge(() => {
|
|
281
|
+
if (!n) return;
|
|
282
|
+
const t = (a) => {
|
|
283
|
+
const l = a.target;
|
|
284
|
+
if (a.type === "mousedown") {
|
|
285
|
+
if (T.current?.contains(l) || f.current?.contains(l)) return;
|
|
286
|
+
m(!1);
|
|
287
|
+
}
|
|
288
|
+
if (a.type === "scroll") {
|
|
289
|
+
if (f.current?.contains(l)) return;
|
|
290
|
+
m(!1);
|
|
291
|
+
}
|
|
292
|
+
a.type === "resize" && m(!1);
|
|
293
|
+
};
|
|
294
|
+
return document.addEventListener("mousedown", t), window.addEventListener("scroll", t, !0), window.addEventListener("resize", t, !0), () => {
|
|
295
|
+
document.removeEventListener("mousedown", t), window.removeEventListener("scroll", t, !0), window.removeEventListener("resize", t, !0);
|
|
296
|
+
};
|
|
297
|
+
}, [n]), ge(() => {
|
|
298
|
+
be.current.forEach((t) => {
|
|
299
|
+
try {
|
|
300
|
+
t(n);
|
|
301
|
+
} catch {
|
|
302
|
+
}
|
|
303
|
+
});
|
|
304
|
+
}, [n]), Xe(
|
|
305
|
+
xe,
|
|
306
|
+
() => ({
|
|
307
|
+
open: () => {
|
|
308
|
+
!n && m(!0);
|
|
309
|
+
},
|
|
310
|
+
close: () => {
|
|
311
|
+
n && m(!1);
|
|
312
|
+
},
|
|
313
|
+
toggle: () => m((t) => !t),
|
|
314
|
+
handleOptionSelect: h,
|
|
315
|
+
subscribeOpenChange: (t) => (be.current.add(t), () => {
|
|
316
|
+
be.current.delete(t);
|
|
317
|
+
}),
|
|
318
|
+
searchInputRef: P
|
|
319
|
+
}),
|
|
320
|
+
[n, h]
|
|
321
|
+
);
|
|
322
|
+
const me = (t) => {
|
|
323
|
+
t.preventDefault(), t.stopPropagation(), t.target.matches(":focus-visible") && !Te && !n && (m(!0), setTimeout(() => {
|
|
324
|
+
P.current?.focus();
|
|
325
|
+
}, 10));
|
|
326
|
+
}, oe = (t) => {
|
|
327
|
+
t.key === "Tab" && n && m(!1), (t.keyCode === 32 || t.key === "ArrowDown") && (m(!0), setTimeout(() => {
|
|
328
|
+
P.current?.focus();
|
|
329
|
+
}, 10));
|
|
330
|
+
};
|
|
331
|
+
return /* @__PURE__ */ V(
|
|
332
|
+
"div",
|
|
333
|
+
{
|
|
334
|
+
className: d("relative bg-inherit select-none w-full", F),
|
|
335
|
+
ref: T,
|
|
336
|
+
draggable: !1,
|
|
337
|
+
style: Ie,
|
|
338
|
+
children: [
|
|
339
|
+
/* @__PURE__ */ V("div", { className: d("relative bg-inherit ", U), children: [
|
|
340
|
+
/* @__PURE__ */ u(
|
|
341
|
+
"label",
|
|
342
|
+
{
|
|
343
|
+
htmlFor: M,
|
|
344
|
+
ref: Ge,
|
|
345
|
+
className: d(
|
|
346
|
+
"left-3 pointer-events-none bg-inherit z-10",
|
|
347
|
+
le === "default" && "transition-all duration-200 ease-in-out",
|
|
348
|
+
$e(),
|
|
349
|
+
de || n ? Be[_].label : "text-neutral-medium-default",
|
|
350
|
+
X && Ke.label
|
|
351
|
+
),
|
|
352
|
+
children: ye
|
|
353
|
+
}
|
|
354
|
+
),
|
|
355
|
+
/* @__PURE__ */ V(
|
|
356
|
+
"div",
|
|
357
|
+
{
|
|
358
|
+
id: M,
|
|
359
|
+
tabIndex: 0,
|
|
360
|
+
role: "button",
|
|
361
|
+
ref: B,
|
|
362
|
+
onFocus: me,
|
|
363
|
+
onKeyDown: oe,
|
|
364
|
+
onClick: (t) => {
|
|
365
|
+
t.preventDefault(), t.stopPropagation(), H();
|
|
366
|
+
},
|
|
367
|
+
className: d(
|
|
368
|
+
"w-full px-2 text-left border rounded-lg transition-all duration-200 ease-in-out",
|
|
369
|
+
"flex items-center justify-start bg-inherit ",
|
|
370
|
+
"focus:outline-none",
|
|
371
|
+
we === "chips" && e.multiple && de ? "min-h-12 py-2 " : !ve && "h-12 min-h-12",
|
|
372
|
+
Be[_].input,
|
|
373
|
+
X && Ke.input,
|
|
374
|
+
ke
|
|
375
|
+
),
|
|
376
|
+
children: [
|
|
377
|
+
/* @__PURE__ */ u(
|
|
378
|
+
"div",
|
|
379
|
+
{
|
|
380
|
+
className: d(
|
|
381
|
+
"flex-1 overflow-x-auto overflow-y-hidden px-1 prometeo-scrollbar-none "
|
|
382
|
+
),
|
|
383
|
+
ref: Pe,
|
|
384
|
+
onPointerUp: Y.onPointerUp,
|
|
385
|
+
onPointerDown: Y.onPointerDown,
|
|
386
|
+
onPointerMove: Y.onPointerMove,
|
|
387
|
+
onPointerLeave: Y.onPointerLeave,
|
|
388
|
+
onPointerCancel: Y.onPointerCancel,
|
|
389
|
+
onClickCapture: Y.onClickCapture,
|
|
390
|
+
children: Oe ? Ne.createElement(
|
|
391
|
+
ne(
|
|
392
|
+
Oe,
|
|
393
|
+
(t, a) => t.disabled === a.disabled && t.multiple === a.multiple
|
|
394
|
+
),
|
|
395
|
+
{
|
|
396
|
+
disabled: X,
|
|
397
|
+
multiple: e.multiple || !1,
|
|
398
|
+
placeholder: k,
|
|
399
|
+
selectedOptions: r,
|
|
400
|
+
onRemoveOption: Z
|
|
401
|
+
}
|
|
402
|
+
) : /* @__PURE__ */ u(
|
|
403
|
+
Ve,
|
|
404
|
+
{
|
|
405
|
+
displayMode: we,
|
|
406
|
+
selectedOptions: o,
|
|
407
|
+
placeholder: _e,
|
|
408
|
+
onRemoveOption: $,
|
|
409
|
+
multiple: e.multiple || !1,
|
|
410
|
+
className: d(
|
|
411
|
+
je === "scroll" ? "flex-nowrap" : "flex-wrap"
|
|
412
|
+
),
|
|
413
|
+
disabled: X
|
|
414
|
+
}
|
|
415
|
+
)
|
|
416
|
+
}
|
|
417
|
+
),
|
|
418
|
+
/* @__PURE__ */ V("div", { className: "flex items-center gap-2", children: [
|
|
419
|
+
ce && /* @__PURE__ */ u(
|
|
420
|
+
Ye,
|
|
421
|
+
{
|
|
422
|
+
size: "small",
|
|
423
|
+
variant: "clip",
|
|
424
|
+
className: " translate-y-1",
|
|
425
|
+
speedMultiplier: 0.7
|
|
426
|
+
}
|
|
427
|
+
),
|
|
428
|
+
de && ue && /* @__PURE__ */ u(
|
|
429
|
+
"button",
|
|
430
|
+
{
|
|
431
|
+
onMouseDown: (t) => {
|
|
432
|
+
t.preventDefault(), t.stopPropagation(), A(t);
|
|
433
|
+
},
|
|
434
|
+
type: "button",
|
|
435
|
+
tabIndex: -1,
|
|
436
|
+
children: /* @__PURE__ */ u(
|
|
437
|
+
Je,
|
|
438
|
+
{
|
|
439
|
+
size: 20,
|
|
440
|
+
className: d(
|
|
441
|
+
" cursor-pointer transition-all",
|
|
442
|
+
Be[_].icon
|
|
443
|
+
)
|
|
444
|
+
}
|
|
445
|
+
)
|
|
446
|
+
}
|
|
447
|
+
),
|
|
448
|
+
/* @__PURE__ */ u(
|
|
449
|
+
Re,
|
|
450
|
+
{
|
|
451
|
+
size: 20,
|
|
452
|
+
className: d(
|
|
453
|
+
"transition-transform text-neutral-default-default",
|
|
454
|
+
n ? "rotate-180" : "",
|
|
455
|
+
X && Ke.icon
|
|
456
|
+
)
|
|
457
|
+
}
|
|
458
|
+
)
|
|
459
|
+
] })
|
|
460
|
+
]
|
|
461
|
+
}
|
|
462
|
+
)
|
|
463
|
+
] }),
|
|
464
|
+
n && /* @__PURE__ */ u(
|
|
465
|
+
ct,
|
|
466
|
+
{
|
|
467
|
+
label: ye,
|
|
468
|
+
isOpen: n,
|
|
469
|
+
disabled: X,
|
|
470
|
+
optionValue: w,
|
|
471
|
+
optionLabel: se,
|
|
472
|
+
emptyMessage: Le,
|
|
473
|
+
labelVariant: le,
|
|
474
|
+
renderOption: j,
|
|
475
|
+
renderOptionGroupHeader: ie,
|
|
476
|
+
attachToParent: ze,
|
|
477
|
+
filteredOptions: b,
|
|
478
|
+
multiple: e.multiple || !1,
|
|
479
|
+
dropdownClassName: re,
|
|
480
|
+
selectedOptionsIds: s,
|
|
481
|
+
setFilteredOptions: y,
|
|
482
|
+
renderOptionContext: Ae,
|
|
483
|
+
options: i,
|
|
484
|
+
selectRef: T,
|
|
485
|
+
dropdownRef: f,
|
|
486
|
+
selectButtonRef: B,
|
|
487
|
+
helperComponentRef: He,
|
|
488
|
+
onOptionClick: h,
|
|
489
|
+
onCloseDropdown: () => m(!1),
|
|
490
|
+
searchValue: Me,
|
|
491
|
+
setSearchValue: p,
|
|
492
|
+
searchInputRef: P,
|
|
493
|
+
isLoading: D?.isLoading,
|
|
494
|
+
onSearchClear: D?.onSearchClear,
|
|
495
|
+
hideSearchBar: D?.hideSearchBar,
|
|
496
|
+
dropdownHeight: D?.dropdownHeight,
|
|
497
|
+
onSearchValueChange: D?.onSearchValueChange,
|
|
498
|
+
inputSearchPlaceholder: D?.inputSearchPlaceholder,
|
|
499
|
+
footer: D?.footer,
|
|
500
|
+
loadingComponent: D?.loadingComponent,
|
|
501
|
+
inputProps: D?.inputProps,
|
|
502
|
+
enableGroupToggle: D?.enableGroupToggle,
|
|
503
|
+
onGroupSelectChange: v
|
|
504
|
+
}
|
|
505
|
+
),
|
|
506
|
+
(Ce || Q) && /* @__PURE__ */ u("div", { className: "min-h-6", children: /* @__PURE__ */ u(
|
|
507
|
+
nt,
|
|
508
|
+
{
|
|
509
|
+
ref: He,
|
|
510
|
+
variant: _,
|
|
511
|
+
className: "absolute bottom-0 h-5 overflow-visible ",
|
|
512
|
+
children: Ce || Q
|
|
513
|
+
}
|
|
514
|
+
) })
|
|
515
|
+
]
|
|
516
|
+
}
|
|
517
|
+
);
|
|
518
|
+
}
|
|
519
|
+
const it = ne(st, (e, n) => e.value === n.value && e.options === n.options && e.isLoading === n.isLoading && e.disabled === n.disabled && e.errorComponent === n.errorComponent && e.helperComponent === n.helperComponent && e.variant === n.variant && e.label === n.label && e.id === n.id && e.name === n.name && e.placeholder === n.placeholder && e.renderOptionContext === n.renderOptionContext && e.dropdownOptions?.controledSearchValue === n.dropdownOptions?.controledSearchValue && e.dropdownOptions?.isLoading === n.dropdownOptions?.isLoading), Dt = it;
|
|
520
|
+
function ut({
|
|
521
|
+
footer: e,
|
|
522
|
+
isOpen: n,
|
|
523
|
+
label: m,
|
|
524
|
+
options: b,
|
|
525
|
+
multiple: y,
|
|
526
|
+
disabled: N,
|
|
527
|
+
selectRef: p,
|
|
528
|
+
inputProps: T,
|
|
529
|
+
dropdownRef: f,
|
|
530
|
+
optionLabel: P,
|
|
531
|
+
optionValue: B,
|
|
532
|
+
searchValue: K,
|
|
533
|
+
labelVariant: He,
|
|
534
|
+
emptyMessage: be,
|
|
535
|
+
renderOption: M,
|
|
536
|
+
renderOptionContext: S,
|
|
537
|
+
renderOptionGroupHeader: ye,
|
|
538
|
+
onOptionClick: ve,
|
|
539
|
+
onSearchClear: J,
|
|
540
|
+
searchInputRef: xe,
|
|
541
|
+
setSearchValue: F,
|
|
542
|
+
dropdownHeight: k,
|
|
543
|
+
attachToParent: w,
|
|
544
|
+
filteredOptions: se,
|
|
545
|
+
selectButtonRef: j,
|
|
546
|
+
onCloseDropdown: ie,
|
|
547
|
+
loadingComponent: Oe,
|
|
548
|
+
dropdownClassName: Ae,
|
|
549
|
+
helperComponentRef: ke,
|
|
550
|
+
selectedOptionsIds: re,
|
|
551
|
+
setFilteredOptions: U,
|
|
552
|
+
onSearchValueChange: D,
|
|
553
|
+
isLoading: Q = !1,
|
|
554
|
+
hideSearchBar: Ce = !1,
|
|
555
|
+
inputSearchPlaceholder: Ee = "Buscar opciones",
|
|
556
|
+
enableGroupToggle: q = !0,
|
|
557
|
+
onGroupSelectChange: Se
|
|
558
|
+
}) {
|
|
559
|
+
const ue = e ? 380 : 320, X = He === "static" ? m !== "" ? -20 : 4 : 7, _ = W(() => k ? k.endsWith("px") ? Number(k.replace("px", "")) : k.endsWith("vh") ? window.innerHeight * Number(k.replace("vh", "")) / 100 : k.endsWith("%") ? window.innerHeight * Number(k.replace("%", "")) / 100 : ue : ue, [k, ue])(), [ce, ze] = De({
|
|
560
|
+
direction: "down",
|
|
561
|
+
height: _
|
|
562
|
+
}), [we, le] = De(
|
|
563
|
+
() => /* @__PURE__ */ new Set()
|
|
564
|
+
), Te = W(
|
|
565
|
+
(r) => !we.has(r),
|
|
566
|
+
[we]
|
|
567
|
+
), Le = W(
|
|
568
|
+
(r, o) => {
|
|
569
|
+
le((s) => {
|
|
570
|
+
const i = new Set(s), v = i.has(r);
|
|
571
|
+
return (o === void 0 ? !v : !o) ? i.add(r) : i.delete(r), i;
|
|
572
|
+
});
|
|
573
|
+
},
|
|
574
|
+
[]
|
|
575
|
+
), Ge = (r) => {
|
|
576
|
+
if (!f.current || !p.current) return;
|
|
577
|
+
const o = p.current.getBoundingClientRect();
|
|
578
|
+
switch (r || ce.direction) {
|
|
579
|
+
case "down":
|
|
580
|
+
f.current.style.top = `${o.top + o.height - (ke?.current?.offsetHeight ? ke?.current?.offsetHeight + 4 : 0)}px`;
|
|
581
|
+
break;
|
|
582
|
+
case "up":
|
|
583
|
+
f.current.style.top = "auto", f.current.style.bottom = `${window.innerHeight - o.top + X}px`;
|
|
584
|
+
break;
|
|
585
|
+
}
|
|
586
|
+
f.current.style.left = `${o.left}px`, f.current.style.width = `${o.width}px`;
|
|
587
|
+
}, Y = (r) => {
|
|
588
|
+
f.current && (f.current.style.maxHeight = `${r}px`);
|
|
589
|
+
}, Pe = () => {
|
|
590
|
+
if (!f.current || !p.current) return ce;
|
|
591
|
+
const r = p.current.getBoundingClientRect(), o = window.innerHeight - (window.innerHeight - r.top), s = window.innerHeight - r.bottom, i = s >= _, v = o >= _;
|
|
592
|
+
let H = "down", h;
|
|
593
|
+
return i ? (H = "down", h = _) : v ? (H = "up", h = _) : s > o ? (H = "down", h = s - 16) : (H = "up", h = o - 16), { direction: H, height: h };
|
|
594
|
+
}, de = (r) => {
|
|
595
|
+
if (!(!f.current || !p.current)) {
|
|
596
|
+
if (f.current.style.transition = "max-height 0.2s ease,opacity 0.2s ease", !r) {
|
|
597
|
+
f.current.style.maxHeight = "0", f.current.style.opacity = "0", f.current.style.pointerEvents = "none";
|
|
598
|
+
return;
|
|
599
|
+
}
|
|
600
|
+
if (!w) {
|
|
601
|
+
const o = Pe();
|
|
602
|
+
ze(o), Ge(o.direction), Y(o.height);
|
|
603
|
+
}
|
|
604
|
+
f.current.style.opacity = "1", f.current.style.pointerEvents = "auto";
|
|
605
|
+
}
|
|
606
|
+
};
|
|
607
|
+
ge(() => {
|
|
608
|
+
w || !p.current || !n || Ge();
|
|
609
|
+
}, [re]), ge(() => {
|
|
610
|
+
de(n);
|
|
611
|
+
}, [n]), ge(() => {
|
|
612
|
+
b && U(b);
|
|
613
|
+
}, [b]), ge(() => {
|
|
614
|
+
if (Q || !K) return;
|
|
615
|
+
const r = Ie(b, K);
|
|
616
|
+
U(r);
|
|
617
|
+
}, [b]);
|
|
618
|
+
const Ie = (r, o) => {
|
|
619
|
+
if (!o) return r;
|
|
620
|
+
if (M) {
|
|
621
|
+
const h = [];
|
|
622
|
+
let A = null, $ = [];
|
|
623
|
+
const Z = () => {
|
|
624
|
+
A && $.length > 0 && h.push(A, ...$), A = null, $ = [];
|
|
625
|
+
};
|
|
626
|
+
return r.forEach((me) => {
|
|
627
|
+
const oe = me;
|
|
628
|
+
if (!!oe.isGroupHeader) {
|
|
629
|
+
Z(), A = oe;
|
|
630
|
+
return;
|
|
631
|
+
}
|
|
632
|
+
const a = me, l = O(
|
|
633
|
+
a,
|
|
634
|
+
P
|
|
635
|
+
), c = Ue(String(l ?? ""), o);
|
|
636
|
+
A ? c && $.push(a) : c && h.push(a);
|
|
637
|
+
}), Z(), h;
|
|
638
|
+
}
|
|
639
|
+
const s = [];
|
|
640
|
+
let i = null, v = [];
|
|
641
|
+
const H = () => {
|
|
642
|
+
i && v.length > 0 && s.push(i, ...v), i = null, v = [];
|
|
643
|
+
};
|
|
644
|
+
return r.forEach((h) => {
|
|
645
|
+
if (h.isGroupHeader) {
|
|
646
|
+
H(), i = h;
|
|
647
|
+
return;
|
|
648
|
+
}
|
|
649
|
+
const A = Ue(h.label, o);
|
|
650
|
+
i ? A && v.push(h) : A && s.push(h);
|
|
651
|
+
}), H(), s;
|
|
652
|
+
}, _e = (r) => {
|
|
653
|
+
const o = Ie(b, r);
|
|
654
|
+
if (U(o), D) {
|
|
655
|
+
if (r === "") {
|
|
656
|
+
Me();
|
|
657
|
+
return;
|
|
658
|
+
}
|
|
659
|
+
D(r);
|
|
660
|
+
return;
|
|
661
|
+
}
|
|
662
|
+
F && b && F(r);
|
|
663
|
+
}, Me = W(() => {
|
|
664
|
+
if (J) {
|
|
665
|
+
J(), U(
|
|
666
|
+
b.filter((r) => {
|
|
667
|
+
const o = M ? O(r, B) : r.id;
|
|
668
|
+
return re.has(o);
|
|
669
|
+
})
|
|
670
|
+
);
|
|
671
|
+
return;
|
|
672
|
+
}
|
|
673
|
+
F && (F(""), U(b));
|
|
674
|
+
}, [
|
|
675
|
+
b,
|
|
676
|
+
re,
|
|
677
|
+
B,
|
|
678
|
+
J,
|
|
679
|
+
U,
|
|
680
|
+
F,
|
|
681
|
+
M
|
|
682
|
+
]), $e = (r) => {
|
|
683
|
+
r.key === "ArrowDown" ? (r.preventDefault(), f.current?.querySelector(
|
|
684
|
+
"[role=listitem]"
|
|
685
|
+
)?.focus()) : (r.key === "Tab" || r.key === "Escape") && setTimeout(() => {
|
|
686
|
+
j.current?.focus(), ie();
|
|
687
|
+
}, 10);
|
|
688
|
+
}, E = (r, o) => {
|
|
689
|
+
const s = Array.from(
|
|
690
|
+
f.current?.querySelectorAll("[role=listitem]") || []
|
|
691
|
+
), i = s.indexOf(r.currentTarget);
|
|
692
|
+
if (r.key === "ArrowDown") {
|
|
693
|
+
r.preventDefault();
|
|
694
|
+
const v = i < s.length - 1 ? i + 1 : i;
|
|
695
|
+
s[v]?.focus();
|
|
696
|
+
} else if (r.key === "ArrowUp")
|
|
697
|
+
if (r.preventDefault(), i === 0)
|
|
698
|
+
xe && xe.current?.focus();
|
|
699
|
+
else {
|
|
700
|
+
const v = i - 1;
|
|
701
|
+
s[v]?.focus();
|
|
702
|
+
}
|
|
703
|
+
else if (r.key === "Enter" || r.key === " ") {
|
|
704
|
+
if (r.preventDefault(), o.isGroupHeader || N) return;
|
|
705
|
+
ve(o, !y), y || setTimeout(() => {
|
|
706
|
+
j.current?.focus(), ie();
|
|
707
|
+
}, 10);
|
|
708
|
+
} else r.key === "Escape" ? (r.preventDefault(), setTimeout(() => {
|
|
709
|
+
j.current?.focus(), ie();
|
|
710
|
+
}, 10)) : r.key === "Tab" && setTimeout(() => {
|
|
711
|
+
j.current?.focus(), ie();
|
|
712
|
+
}, 10);
|
|
713
|
+
}, R = Array.from({ length: 5 }).map(
|
|
714
|
+
(r, o) => M ? Ne.createElement(
|
|
715
|
+
ne(M, (s, i) => s.isSelected === i.isSelected && s.option === i.option && s.disabled === i.disabled && s.multiple === i.multiple && s.renderContext === i.renderContext),
|
|
716
|
+
{
|
|
717
|
+
key: `skeleton-option-${o}`,
|
|
718
|
+
option: { id: o, label: "", value: "" },
|
|
719
|
+
isSelected: !1,
|
|
720
|
+
multiple: !1,
|
|
721
|
+
onSelect: () => {
|
|
722
|
+
},
|
|
723
|
+
disabled: !1,
|
|
724
|
+
isLoading: !0,
|
|
725
|
+
renderContext: S
|
|
726
|
+
}
|
|
727
|
+
) : /* @__PURE__ */ u(
|
|
728
|
+
Fe,
|
|
729
|
+
{
|
|
730
|
+
multiple: !1,
|
|
731
|
+
isLoading: !0,
|
|
732
|
+
onSelect: () => {
|
|
733
|
+
},
|
|
734
|
+
isSelected: !1,
|
|
735
|
+
option: { id: o, label: "", value: "" }
|
|
736
|
+
},
|
|
737
|
+
`skeleton-option-${// biome-ignore lint/suspicious/noArrayIndexKey: <>
|
|
738
|
+
o}`
|
|
739
|
+
)
|
|
740
|
+
), fe = /* @__PURE__ */ u(
|
|
741
|
+
"div",
|
|
742
|
+
{
|
|
743
|
+
tabIndex: 0,
|
|
744
|
+
ref: f,
|
|
745
|
+
style: { opacity: "0" },
|
|
746
|
+
className: d(
|
|
747
|
+
" z-100! w-full mt-1 bg-neutral-default-default border border-neutral-default-default rounded-lg shadow-lg",
|
|
748
|
+
" overflow-hidden focus-visible:bg-neutral-default-hover ",
|
|
749
|
+
w ? "absolute z-50 " : "fixed z-100 top-0 left-0",
|
|
750
|
+
ce.direction === "up" ? "h-auto" : " h-max",
|
|
751
|
+
Ae
|
|
752
|
+
),
|
|
753
|
+
children: /* @__PURE__ */ V(
|
|
754
|
+
"div",
|
|
755
|
+
{
|
|
756
|
+
className: d(
|
|
757
|
+
"flex flex-col ",
|
|
758
|
+
Ce ? "p-0" : "p-2 pt-0 gap-2"
|
|
759
|
+
),
|
|
760
|
+
style: {
|
|
761
|
+
height: "auto",
|
|
762
|
+
maxHeight: ce.height
|
|
763
|
+
},
|
|
764
|
+
children: [
|
|
765
|
+
!Ce && /* @__PURE__ */ u(
|
|
766
|
+
ot,
|
|
767
|
+
{
|
|
768
|
+
name: "",
|
|
769
|
+
label: "",
|
|
770
|
+
size: "small",
|
|
771
|
+
tabIndex: 0,
|
|
772
|
+
value: K,
|
|
773
|
+
disabled: N,
|
|
774
|
+
ref: xe,
|
|
775
|
+
labelVariant: "static",
|
|
776
|
+
icon: /* @__PURE__ */ u(Qe, {}),
|
|
777
|
+
isFetching: Q,
|
|
778
|
+
onKeyDown: $e,
|
|
779
|
+
onClear: Me,
|
|
780
|
+
onChange: (r) => _e(r.target.value),
|
|
781
|
+
placeholder: Ee,
|
|
782
|
+
className: " bg-neutral-medium-pressed",
|
|
783
|
+
...T
|
|
784
|
+
}
|
|
785
|
+
),
|
|
786
|
+
/* @__PURE__ */ u("div", { className: " overflow-y-auto flex-1 max-h-max ", children: se.length === 0 ? Q ? /* @__PURE__ */ u("div", { className: "flex flex-col gap-1 overflow-hidden w-full", children: Oe || R }) : /* @__PURE__ */ u("div", { className: "px-3 py-2 text-neutral-medium-default", children: K ? `No se encontraron resultados para "${K}"` : be }) : (() => {
|
|
787
|
+
let r = !0;
|
|
788
|
+
return se.map((o) => {
|
|
789
|
+
const s = o, i = !!s.isGroupHeader, v = M && !i ? O(o, B) : s.id, H = re.has(v), h = (l) => !M || i ? l : {
|
|
790
|
+
id: v,
|
|
791
|
+
label: String(O(l, P)),
|
|
792
|
+
value: O(l, B)
|
|
793
|
+
}, A = (l) => {
|
|
794
|
+
i || ve(
|
|
795
|
+
h(o),
|
|
796
|
+
l === void 0 ? !y : l
|
|
797
|
+
);
|
|
798
|
+
}, $ = (l) => {
|
|
799
|
+
if (ve(l, !y), !y) {
|
|
800
|
+
if (!F) return;
|
|
801
|
+
F(""), U(b);
|
|
802
|
+
}
|
|
803
|
+
}, Z = (l, c) => {
|
|
804
|
+
const C = !!c.isGroupHeader;
|
|
805
|
+
return (
|
|
806
|
+
// biome-ignore lint/a11y/useSemanticElements: <>
|
|
807
|
+
/* @__PURE__ */ u(
|
|
808
|
+
"div",
|
|
809
|
+
{
|
|
810
|
+
tabIndex: 0,
|
|
811
|
+
role: "listitem",
|
|
812
|
+
onKeyDown: (L) => E(L, c),
|
|
813
|
+
className: d(
|
|
814
|
+
!C && !N && "focus-visible:bg-neutral-medium-hover outline-none hover:bg-neutral-medium-hover",
|
|
815
|
+
H && "bg-neutral-medium-selected",
|
|
816
|
+
N && "cursor-default pointer-events-none"
|
|
817
|
+
),
|
|
818
|
+
children: l
|
|
819
|
+
},
|
|
820
|
+
c.id
|
|
821
|
+
)
|
|
822
|
+
);
|
|
823
|
+
};
|
|
824
|
+
if (i) {
|
|
825
|
+
const l = s.groupLabelNode ?? s.label, c = String(s.id), C = q === !1 ? !0 : Te(c);
|
|
826
|
+
r = C;
|
|
827
|
+
const L = s.originalOption, G = s.groupData?.groupOptions ?? [], ee = (I) => {
|
|
828
|
+
q && Le(c, I);
|
|
829
|
+
}, he = (I) => {
|
|
830
|
+
!G || G.length === 0 || Se && Se(G, I);
|
|
831
|
+
}, pe = G.filter(
|
|
832
|
+
(I) => re.has(O(I, B))
|
|
833
|
+
).map((I) => String(O(I, B)));
|
|
834
|
+
if (ye) {
|
|
835
|
+
const I = ne(
|
|
836
|
+
ye,
|
|
837
|
+
(x, z) => x.label === z.label && x.group === z.group && x.groupOptions === z.groupOptions && x.disabled === z.disabled && x.multiple === z.multiple && x.expanded === z.expanded && x.renderContext === z.renderContext
|
|
838
|
+
), g = Ne.createElement(I, {
|
|
839
|
+
group: L,
|
|
840
|
+
label: l,
|
|
841
|
+
groupOptions: G,
|
|
842
|
+
multiple: y,
|
|
843
|
+
disabled: N,
|
|
844
|
+
expanded: C,
|
|
845
|
+
toggleGroup: ee,
|
|
846
|
+
selectGroup: he,
|
|
847
|
+
renderContext: S,
|
|
848
|
+
groupSelectedIds: pe
|
|
849
|
+
});
|
|
850
|
+
return Z(g, s);
|
|
851
|
+
}
|
|
852
|
+
return Z(
|
|
853
|
+
/* @__PURE__ */ V("div", { className: "px-3 py-2 text-neutral-medium-default font-medium text-sm w-full flex justify-between", children: [
|
|
854
|
+
/* @__PURE__ */ u("div", { children: l }),
|
|
855
|
+
q && /* @__PURE__ */ u(
|
|
856
|
+
"div",
|
|
857
|
+
{
|
|
858
|
+
className: "cursor-pointer",
|
|
859
|
+
onClick: () => Le(c),
|
|
860
|
+
children: /* @__PURE__ */ u(
|
|
861
|
+
Re,
|
|
862
|
+
{
|
|
863
|
+
className: d(
|
|
864
|
+
"transition-transform duration-300 ease-out",
|
|
865
|
+
C ? "rotate-180" : "rotate-0"
|
|
866
|
+
)
|
|
867
|
+
}
|
|
868
|
+
)
|
|
869
|
+
}
|
|
870
|
+
)
|
|
871
|
+
] }),
|
|
872
|
+
s
|
|
873
|
+
);
|
|
874
|
+
}
|
|
875
|
+
const me = M ? Ne.createElement(
|
|
876
|
+
ne(
|
|
877
|
+
M,
|
|
878
|
+
(l, c) => l.isSelected === c.isSelected && l.option === c.option && l.disabled === c.disabled && l.multiple === c.multiple && l.renderContext === c.renderContext
|
|
879
|
+
),
|
|
880
|
+
{
|
|
881
|
+
key: v,
|
|
882
|
+
option: o,
|
|
883
|
+
isSelected: H,
|
|
884
|
+
multiple: y,
|
|
885
|
+
onSelect: A,
|
|
886
|
+
disabled: N,
|
|
887
|
+
isLoading: Q,
|
|
888
|
+
renderContext: S
|
|
889
|
+
}
|
|
890
|
+
) : /* @__PURE__ */ u(
|
|
891
|
+
Fe,
|
|
892
|
+
{
|
|
893
|
+
disabled: N,
|
|
894
|
+
multiple: y,
|
|
895
|
+
isLoading: Q,
|
|
896
|
+
isSelected: H,
|
|
897
|
+
onSelect: $,
|
|
898
|
+
option: o
|
|
899
|
+
},
|
|
900
|
+
v
|
|
901
|
+
), oe = Z(
|
|
902
|
+
me,
|
|
903
|
+
h(o)
|
|
904
|
+
);
|
|
905
|
+
if (!q)
|
|
906
|
+
return oe;
|
|
907
|
+
const t = !r, a = oe;
|
|
908
|
+
return Ne.cloneElement(a, {
|
|
909
|
+
className: d(
|
|
910
|
+
a.props.className,
|
|
911
|
+
"overflow-hidden transition-[max-height] duration-300 ease-out",
|
|
912
|
+
t ? "max-h-0" : "max-h-[999px]"
|
|
913
|
+
)
|
|
914
|
+
});
|
|
915
|
+
});
|
|
916
|
+
})() }),
|
|
917
|
+
e && /* @__PURE__ */ u("div", { className: "border-t border-neutral-strong-default p-2", children: e })
|
|
918
|
+
]
|
|
919
|
+
}
|
|
920
|
+
)
|
|
921
|
+
}
|
|
922
|
+
);
|
|
923
|
+
return w ? fe : Ze(fe, document.body);
|
|
924
|
+
}
|
|
925
|
+
const ct = ne(
|
|
926
|
+
ut,
|
|
927
|
+
(e, n) => e.options === n.options && e.selectedOptionsIds === n.selectedOptionsIds && e.multiple === n.multiple && e.disabled === n.disabled && e.emptyMessage === n.emptyMessage && e.renderOption === n.renderOption && e.renderOptionContext === n.renderOptionContext && e.isOpen === n.isOpen && e.attachToParent === n.attachToParent && e.optionValue === n.optionValue && e.optionLabel === n.optionLabel && e.filteredOptions === n.filteredOptions && e.isLoading === n.isLoading
|
|
928
|
+
), Fe = ne(
|
|
929
|
+
({
|
|
930
|
+
option: e,
|
|
931
|
+
isSelected: n,
|
|
932
|
+
onSelect: m,
|
|
933
|
+
multiple: b,
|
|
934
|
+
disabled: y,
|
|
935
|
+
isLoading: N
|
|
936
|
+
}) => {
|
|
937
|
+
const p = e.isGroupHeader;
|
|
938
|
+
if (N)
|
|
939
|
+
return /* @__PURE__ */ V(
|
|
940
|
+
"div",
|
|
941
|
+
{
|
|
942
|
+
className: "flex gap-2 w-full px-3 py-2 cursor-wait",
|
|
943
|
+
children: [
|
|
944
|
+
/* @__PURE__ */ u(qe, { className: "size-6 aspect-square" }),
|
|
945
|
+
/* @__PURE__ */ u(qe, { className: "flex-1 h-6" })
|
|
946
|
+
]
|
|
947
|
+
},
|
|
948
|
+
e.id
|
|
949
|
+
);
|
|
950
|
+
const T = (P) => {
|
|
951
|
+
P.preventDefault(), P.stopPropagation(), !(y || p) && m?.(e);
|
|
952
|
+
}, f = p && e.groupLabelNode ? e.groupLabelNode : e.label;
|
|
953
|
+
return (
|
|
954
|
+
// biome-ignore lint/a11y/noStaticElementInteractions: no keyboard interaction needed
|
|
955
|
+
/* @__PURE__ */ V(
|
|
956
|
+
"div",
|
|
957
|
+
{
|
|
958
|
+
onMouseDown: T,
|
|
959
|
+
className: d(
|
|
960
|
+
"px-3 py-2 flex items-center transition-colors text-neutral-default-default ",
|
|
961
|
+
p ? "cursor-default text-neutral-medium-default" : "cursor-pointer",
|
|
962
|
+
!p && (n ? " text-primary-default-default" : "hover:bg-neutral-medium-hover text-neutral-default-hover"),
|
|
963
|
+
y && !p && "text-neutral-default-disabled hover:bg-neutral-default-default"
|
|
964
|
+
),
|
|
965
|
+
children: [
|
|
966
|
+
b && !p && /* @__PURE__ */ u(lt, { checked: n, disabled: y }),
|
|
967
|
+
/* @__PURE__ */ u("span", { children: f })
|
|
968
|
+
]
|
|
969
|
+
},
|
|
970
|
+
e.id
|
|
971
|
+
)
|
|
972
|
+
);
|
|
973
|
+
},
|
|
974
|
+
(e, n) => e.isSelected === n.isSelected && e.disabled === n.disabled
|
|
975
|
+
);
|
|
976
|
+
Fe.displayName = "DefaultOptionRenderer";
|
|
977
|
+
const Ve = ne(
|
|
978
|
+
({
|
|
979
|
+
selectedOptions: e,
|
|
980
|
+
placeholder: n,
|
|
981
|
+
onRemoveOption: m,
|
|
982
|
+
displayMode: b,
|
|
983
|
+
multiple: y,
|
|
984
|
+
className: N,
|
|
985
|
+
disabled: p
|
|
986
|
+
}) => e?.length === 0 ? n ? /* @__PURE__ */ u("span", { className: "text-neutral-medium-default opacity-50", children: n }) : null : b === "chips" && y ? /* @__PURE__ */ u("div", { className: d("flex items-center gap-1 ", N), children: e.map((T) => /* @__PURE__ */ u(
|
|
987
|
+
rt,
|
|
988
|
+
{
|
|
989
|
+
tabIndex: -1,
|
|
990
|
+
id: T.id,
|
|
991
|
+
label: T.label,
|
|
992
|
+
onRemove: m,
|
|
993
|
+
disabled: p
|
|
994
|
+
},
|
|
995
|
+
T.id
|
|
996
|
+
)) }) : e?.length === 1 ? /* @__PURE__ */ u("span", { children: e[0].label }) : /* @__PURE__ */ V("span", { children: [
|
|
997
|
+
e?.length,
|
|
998
|
+
" seleccionados"
|
|
999
|
+
] }),
|
|
1000
|
+
(e, n) => e.selectedOptions === n.selectedOptions && e.disabled === n.disabled
|
|
1001
|
+
);
|
|
1002
|
+
Ve.displayName = "DefaultSelectionDisplay";
|
|
1003
|
+
export {
|
|
1004
|
+
Dt as default
|
|
1005
|
+
};
|