@konstructio/ui 0.1.2-alpha.77 → 0.1.2-alpha.79
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/AdditionalOptions-Cx9wU01w.js +37 -0
- package/dist/AlertDialogTrigger-C-NMEoDd.js +146 -0
- package/dist/Breadcrumb-C95aOsYk.js +77 -0
- package/dist/CalendarPanel.css +1 -1
- package/dist/Checkbox-Cn0UWlk8.js +239 -0
- package/dist/Combination-DUTBK_qM.js +486 -0
- package/dist/CommandInput-BKv-EZ7T.js +76 -0
- package/dist/Counter-DtQu_T-D.js +191 -0
- package/dist/DayPicker-CNWQ1Oyd.js +2884 -0
- package/dist/DropdownButton-B2XkEqPt.js +92 -0
- package/dist/FlagSelectorList-C17nmEBM.js +597 -0
- package/dist/ImageUpload-BzXjGZ2w.js +181 -0
- package/dist/Input-GBMxM3Z7.js +188 -0
- package/dist/Loading-DKqxR-oV.js +16 -0
- package/dist/Modal-DbTe8PVX.js +76 -0
- package/dist/Spinner-CyuXAaC8.js +41 -0
- package/dist/StepIndicatorContent-D5z1Ziqg.js +30 -0
- package/dist/Switch-DjbC0A8y.js +136 -0
- package/dist/Toast-C3XjAvtC.js +478 -0
- package/dist/Wrapper-BWSOaT1y.js +1056 -0
- package/dist/Wrapper-CjUokv72.js +110 -0
- package/dist/Wrapper-DEJ-hyar.js +161 -0
- package/dist/assets/icons/components/Accounts.js +21 -23
- package/dist/assets/icons/components/AddChart.js +18 -20
- package/dist/assets/icons/components/AlertOutline.js +18 -20
- package/dist/assets/icons/components/AppRepo.js +18 -20
- package/dist/assets/icons/components/Apps.js +18 -20
- package/dist/assets/icons/components/Archives.js +18 -20
- package/dist/assets/icons/components/ArrowDown.js +18 -20
- package/dist/assets/icons/components/ArrowLeft.js +18 -20
- package/dist/assets/icons/components/ArrowRight.js +17 -19
- package/dist/assets/icons/components/ArrowUp.js +18 -20
- package/dist/assets/icons/components/BarChart.js +28 -24
- package/dist/assets/icons/components/BookOpen.js +22 -20
- package/dist/assets/icons/components/CalendarMonth.js +18 -20
- package/dist/assets/icons/components/Check.js +18 -20
- package/dist/assets/icons/components/CheckCircleFilled.js +28 -25
- package/dist/assets/icons/components/CheckCircleOutline.js +18 -20
- package/dist/assets/icons/components/CheckboxMarkedCircleOutline.js +18 -20
- package/dist/assets/icons/components/ClockAlert.js +18 -20
- package/dist/assets/icons/components/ClockOutline.js +18 -20
- package/dist/assets/icons/components/Close.js +18 -20
- package/dist/assets/icons/components/Cloud.js +12 -17
- package/dist/assets/icons/components/CloudLockOutline.js +18 -20
- package/dist/assets/icons/components/Clusters.js +28 -24
- package/dist/assets/icons/components/CogOutline.js +18 -20
- package/dist/assets/icons/components/Copy.js +18 -20
- package/dist/assets/icons/components/Cpu.js +25 -23
- package/dist/assets/icons/components/Cube.js +18 -20
- package/dist/assets/icons/components/Datacenter.js +18 -20
- package/dist/assets/icons/components/Delete.js +18 -20
- package/dist/assets/icons/components/DollarSign.js +20 -20
- package/dist/assets/icons/components/Download.js +17 -19
- package/dist/assets/icons/components/Edit.js +18 -20
- package/dist/assets/icons/components/Ellipses.js +18 -20
- package/dist/assets/icons/components/Environments.js +20 -20
- package/dist/assets/icons/components/Error.js +18 -20
- package/dist/assets/icons/components/ErrorOutline.js +18 -20
- package/dist/assets/icons/components/Exclamation.js +21 -20
- package/dist/assets/icons/components/Git.js +15 -17
- package/dist/assets/icons/components/GitOpsCatalog.js +25 -23
- package/dist/assets/icons/components/GridView.js +15 -20
- package/dist/assets/icons/components/Help.js +24 -25
- package/dist/assets/icons/components/HideOutline.js +21 -23
- package/dist/assets/icons/components/Home.js +18 -20
- package/dist/assets/icons/components/Home2.js +21 -20
- package/dist/assets/icons/components/Id.js +17 -19
- package/dist/assets/icons/components/InfoCircle.js +28 -25
- package/dist/assets/icons/components/InformationOutline.js +18 -20
- package/dist/assets/icons/components/InvoiceList.js +18 -20
- package/dist/assets/icons/components/Key.js +18 -20
- package/dist/assets/icons/components/LightBulb.js +27 -23
- package/dist/assets/icons/components/Loader.js +18 -20
- package/dist/assets/icons/components/Network.js +18 -20
- package/dist/assets/icons/components/PagesStack.js +24 -25
- package/dist/assets/icons/components/Pageview.js +18 -20
- package/dist/assets/icons/components/People.js +18 -20
- package/dist/assets/icons/components/PhotoLibrary.js +14 -16
- package/dist/assets/icons/components/Pipeline.js +20 -20
- package/dist/assets/icons/components/Plus.js +18 -20
- package/dist/assets/icons/components/PowerSettings.js +18 -20
- package/dist/assets/icons/components/Preview.js +18 -20
- package/dist/assets/icons/components/ReceiptLong.js +15 -20
- package/dist/assets/icons/components/Refresh.js +18 -20
- package/dist/assets/icons/components/ScatterPlot.js +15 -20
- package/dist/assets/icons/components/Search.js +30 -25
- package/dist/assets/icons/components/Server.js +18 -20
- package/dist/assets/icons/components/Start.js +18 -20
- package/dist/assets/icons/components/TabNew.js +34 -24
- package/dist/assets/icons/components/Teams.js +17 -19
- package/dist/assets/icons/components/Upload.js +18 -20
- package/dist/assets/icons/components/Warning.js +18 -20
- package/dist/assets/icons/components/WarningTriangle.js +18 -20
- package/dist/assets/icons/components/X.js +18 -20
- package/dist/assets/icons/components/index.js +82 -82
- package/dist/assets/icons/index.js +88 -88
- package/dist/chevron-down-DgssmYWu.js +8 -0
- package/dist/chevron-left-DRJXef9g.js +8 -0
- package/dist/chevron-right-BooB_b7g.js +8 -0
- package/dist/chevron-up-DuS9MUNr.js +8 -0
- package/dist/chunk-D1xtDmiO.js +31 -0
- package/dist/{clsx-OuTLNxxd.js → clsx-kDhLfUq2.js} +1 -1
- package/dist/components/Alert/Alert.js +58 -79
- package/dist/components/Alert/Alert.variants.js +86 -46
- package/dist/components/AlertDialog/AlertDialog.js +71 -103
- package/dist/components/AlertDialog/components/AlertDialogTrigger.js +2 -7
- package/dist/components/AlertDialog/components/index.js +2 -2
- package/dist/components/AlertDialog/hooks/useAlertDialog.js +12 -25
- package/dist/components/Autocomplete/Autocomplete.js +58 -54
- package/dist/components/Autocomplete/Autocomplete.variants.js +26 -2
- package/dist/components/Autocomplete/components/List/List.js +33 -48
- package/dist/components/Autocomplete/components/List/List.variants.js +33 -5
- package/dist/components/Autocomplete/components/index.js +2 -2
- package/dist/components/Autocomplete/hooks/useAutocomplete.js +32 -79
- package/dist/components/Autocomplete/hooks/useNavigationList.js +47 -65
- package/dist/components/Badge/Badge.js +62 -66
- package/dist/components/Badge/Badge.variants.js +69 -16
- package/dist/components/Breadcrumb/Breadcrumb.js +2 -97
- package/dist/components/Breadcrumb/Breadcrumb.variants.js +14 -4
- package/dist/components/Breadcrumb/components/Item/Item.js +33 -33
- package/dist/components/Breadcrumb/components/Item/Item.variants.js +47 -23
- package/dist/components/Breadcrumb/hooks/useBreadcrumb.js +2 -2
- package/dist/components/Button/Button.js +22 -37
- package/dist/components/Button/Button.variants.js +294 -75
- package/dist/components/ButtonGroup/ButtonGroup.js +84 -101
- package/dist/components/ButtonGroup/ButtonGroup.variants.js +29 -14
- package/dist/components/ButtonGroup/components/ButtonGroupItem/ButtonGroupItem.js +57 -105
- package/dist/components/ButtonGroup/components/ButtonGroupItem/ButtonGroupItem.variants.js +60 -27
- package/dist/components/ButtonGroup/components/ButtonGroupItem/index.js +2 -2
- package/dist/components/ButtonGroup/components/ButtonGroupLabel/ButtonGroupLabel.js +20 -25
- package/dist/components/ButtonGroup/components/ButtonGroupLabel/index.js +2 -2
- package/dist/components/ButtonGroup/components/ButtonGroupMessage/ButtonGroupMessage.js +16 -28
- package/dist/components/ButtonGroup/components/index.js +6 -6
- package/dist/components/ButtonGroup/hooks/index.js +2 -2
- package/dist/components/ButtonGroup/hooks/useButtonGroup.js +49 -64
- package/dist/components/Card/Card.js +22 -34
- package/dist/components/Card/Card.variants.js +26 -13
- package/dist/components/Checkbox/Checkbox.js +2 -343
- package/dist/components/Checkbox/Checkbox.variants.js +50 -13
- package/dist/components/Command/Command.js +29 -46
- package/dist/components/Command/Command.variants.js +46 -3
- package/dist/components/Command/components/Command.js +14 -19
- package/dist/components/Command/components/CommandEmpty.js +9 -10
- package/dist/components/Command/components/CommandGroup.js +10 -18
- package/dist/components/Command/components/CommandInput.js +2 -90
- package/dist/components/Command/components/CommandItem.js +17 -28
- package/dist/components/Command/components/CommandList.js +11 -19
- package/dist/components/Command/components/CommandSeparator.js +11 -19
- package/dist/components/Command/components/CommandShortcut.js +7 -16
- package/dist/components/Command/components/DialogContent.js +20 -35
- package/dist/components/Command/components/DialogOverlay.js +11 -19
- package/dist/components/Command/components/index.js +16 -16
- package/dist/components/Command/contexts/Command.context.js +1 -1
- package/dist/components/Command/contexts/Command.provider.js +15 -23
- package/dist/components/Command/contexts/index.js +2 -2
- package/dist/components/Counter/Counter.js +3 -206
- package/dist/components/Counter/Counter.variants.js +53 -19
- package/dist/components/DateRangePicker/DateRangePicker.js +77 -93
- package/dist/components/DateRangePicker/DateRangePicker.variants.js +23 -4
- package/dist/components/DateRangePicker/components/CalendarPanel/CalendarPanel.js +75 -81
- package/dist/components/DateRangePicker/components/CalendarPanel/CalendarPanel.variants.js +54 -10
- package/dist/components/DateRangePicker/components/CalendarPanel/components/CalendarDivider/CalendarDivider.js +8 -14
- package/dist/components/DateRangePicker/components/CalendarPanel/components/CalendarMonth/CalendarMonth.js +35 -50
- package/dist/components/DateRangePicker/components/CalendarPanel/components/IndependentModeCalendar/IndependentModeCalendar.js +179 -107
- package/dist/components/DateRangePicker/components/CalendarPanel/components/NavigationButton/NavigationButton.js +19 -34
- package/dist/components/DateRangePicker/components/CalendarPanel/components/TogetherModeCalendar/TogetherModeCalendar.js +78 -61
- package/dist/components/DateRangePicker/components/CalendarPanel/components/index.js +6 -6
- package/dist/components/DateRangePicker/components/CalendarPanel/constants/dayPickerClassNames.js +2 -3
- package/dist/components/DateRangePicker/components/CalendarPanel/constants/index.js +10 -31
- package/dist/components/DateRangePicker/components/CalendarPanel/hooks/index.js +19 -19
- package/dist/components/DateRangePicker/components/CalendarPanel/hooks/useIndependentCarousel.js +121 -144
- package/dist/components/DateRangePicker/components/CalendarPanel/hooks/useTogetherCarousel.js +82 -53
- package/dist/components/DateRangePicker/components/CalendarPanel/utils/index.js +8 -8
- package/dist/components/DateRangePicker/components/DateTimeInputs/DateTimeInputs.js +60 -69
- package/dist/components/DateRangePicker/components/DateTimeInputs/DateTimeInputs.variants.js +31 -5
- package/dist/components/DateRangePicker/components/DateTimeInputs/components/EndInputFields/EndInputFields.js +43 -55
- package/dist/components/DateRangePicker/components/DateTimeInputs/components/StartInputFields/StartInputFields.js +43 -55
- package/dist/components/DateRangePicker/components/DateTimeInputs/components/index.js +2 -2
- package/dist/components/DateRangePicker/components/DateTimeInputs/hooks/index.js +2 -2
- package/dist/components/DateRangePicker/components/DateTimeInputs/hooks/useDateTimeInputs.js +144 -176
- package/dist/components/DateRangePicker/components/PresetPanel/PresetPanel.js +37 -56
- package/dist/components/DateRangePicker/components/PresetPanel/PresetPanel.variants.js +20 -2
- package/dist/components/DateRangePicker/components/index.js +6 -6
- package/dist/components/DateRangePicker/constants/index.js +2 -2
- package/dist/components/DateRangePicker/constants/presets.js +22 -16
- package/dist/components/DateRangePicker/contexts/date-range-picker.context.js +3 -3
- package/dist/components/DateRangePicker/contexts/date-range-picker.hook.js +4 -5
- package/dist/components/DateRangePicker/contexts/date-range-picker.provider.js +114 -187
- package/dist/components/DateRangePicker/contexts/index.js +6 -6
- package/dist/components/DateRangePicker/utils/disabled-dates.js +25 -39
- package/dist/components/DateRangePicker/utils/index.js +20 -20
- package/dist/components/DateRangePicker/utils/presets.js +6 -8
- package/dist/components/DateRangePicker/utils/validation.js +60 -57
- package/dist/components/Datepicker/DatePicker.js +48 -81
- package/dist/components/Datepicker/DatePicker.variants.js +3 -3
- package/dist/components/Divider/Divider.js +6 -17
- package/dist/components/Divider/Divider.variants.js +9 -11
- package/dist/components/Drawer/Drawer.js +73 -109
- package/dist/components/Drawer/Drawer.variants.js +74 -24
- package/dist/components/Drawer/components/Body/Body.js +12 -18
- package/dist/components/Drawer/components/Body/index.js +2 -2
- package/dist/components/Drawer/components/Footer/Footer.js +12 -18
- package/dist/components/Drawer/components/Footer/index.js +2 -2
- package/dist/components/Drawer/components/Header/Header.js +13 -20
- package/dist/components/Drawer/components/Header/index.js +2 -2
- package/dist/components/Drawer/components/index.js +6 -6
- package/dist/components/Drawer/constants/index.js +1 -1
- package/dist/components/Drawer/contexts/Drawer.context.js +3 -3
- package/dist/components/Drawer/contexts/index.js +3 -3
- package/dist/components/Drawer/hooks/index.js +2 -2
- package/dist/components/Drawer/hooks/useDrawer.js +54 -82
- package/dist/components/DropdownButton/DropdownButton.js +2 -118
- package/dist/components/Filter/Filter.js +32 -40
- package/dist/components/Filter/Filter.variants.js +24 -4
- package/dist/components/Filter/components/BadgeDropdown/BadgeMultiSelect.hook.js +59 -127
- package/dist/components/Filter/components/BadgeDropdown/BadgeMultiSelect.js +73 -84
- package/dist/components/Filter/components/DateFilterDropdown/DateFilterDropdown.hook.js +47 -84
- package/dist/components/Filter/components/DateFilterDropdown/DateFilterDropdown.js +52 -67
- package/dist/components/Filter/components/DateRangeFilterDropdown/DateRangeFilterDropdown.hook.js +29 -39
- package/dist/components/Filter/components/DateRangeFilterDropdown/DateRangeFilterDropdown.js +55 -75
- package/dist/components/Filter/components/ResetButton/ResetButton.js +19 -25
- package/dist/components/Filter/components/TextMultiSelect/TextMultiSelect.js +73 -84
- package/dist/components/Filter/components/TimeFilterDropdown/TimeFilterDropdown.hook.js +48 -83
- package/dist/components/Filter/components/TimeFilterDropdown/TimeFilterDropdown.js +81 -81
- package/dist/components/Filter/components/index.js +6 -6
- package/dist/components/Filter/contexts/filter.context.js +2 -4
- package/dist/components/Filter/contexts/filter.hook.js +5 -6
- package/dist/components/Filter/contexts/filter.provider.js +7 -16
- package/dist/components/Filter/contexts/index.js +4 -4
- package/dist/components/Filter/events/index.js +4 -8
- package/dist/components/Filter/utils/index.js +2 -2435
- package/dist/components/ImageUpload/ImageUpload.js +2 -119
- package/dist/components/ImageUpload/ImageUpload.variants.js +86 -51
- package/dist/components/Input/Input.js +2 -161
- package/dist/components/Input/Input.variants.js +46 -11
- package/dist/components/LineChart/LineChart.js +63 -56
- package/dist/components/Loading/Loading.js +2 -22
- package/dist/components/Loading/Loading.variants.js +9 -2
- package/dist/components/Modal/Modal.js +3 -9
- package/dist/components/Modal/components/Body/Body.js +8 -16
- package/dist/components/Modal/components/Footer/Footer.js +8 -16
- package/dist/components/Modal/components/Header/Header.js +8 -16
- package/dist/components/Modal/components/Wrapper/Wrapper.js +2 -11
- package/dist/components/Modal/components/Wrapper/Wrapper.variants.js +29 -2
- package/dist/components/Modal/components/index.js +8 -8
- package/dist/components/Modal/contexts/Modal.context.js +1 -1
- package/dist/components/Modal/contexts/Modal.provider.js +20 -33
- package/dist/components/Modal/contexts/index.js +2 -2
- package/dist/components/Modal/hooks/useModal.js +20 -31
- package/dist/components/MultiSelectDropdown/MultiSelectDropdown.js +2 -26
- package/dist/components/MultiSelectDropdown/MultiSelectDropdown.variants.js +29 -5
- package/dist/components/MultiSelectDropdown/components/Item/Item.js +19 -32
- package/dist/components/MultiSelectDropdown/components/Item/Item.variants.js +21 -11
- package/dist/components/MultiSelectDropdown/components/List/List.js +2 -27
- package/dist/components/MultiSelectDropdown/components/List/List.variants.js +23 -3
- package/dist/components/MultiSelectDropdown/components/Wrapper/Wrapper.js +2 -74
- package/dist/components/MultiSelectDropdown/components/index.js +4 -5
- package/dist/components/MultiSelectDropdown/contexts/MultiSelectDropdown.context.js +4 -4
- package/dist/components/MultiSelectDropdown/contexts/MultiSelectDropdown.hook.js +3 -4
- package/dist/components/MultiSelectDropdown/contexts/MultiSelectDropdown.provider.js +94 -122
- package/dist/components/MultiSelectDropdown/contexts/index.js +2 -2
- package/dist/components/MultiSelectDropdown/hooks/useMultiSelectDropdown.js +18 -31
- package/dist/components/PhoneNumberInput/PhoneNumberInput.js +11 -18
- package/dist/components/PhoneNumberInput/PhoneNumberInput.variants.js +37 -14
- package/dist/components/PhoneNumberInput/components/FlagContent/FlagContent.js +16 -28
- package/dist/components/PhoneNumberInput/components/FlagSelectorList/FlagSelectorList.js +2 -670
- package/dist/components/PhoneNumberInput/components/FlagSelectorWrapper/FlagSelectorWrapper.js +22 -20
- package/dist/components/PhoneNumberInput/components/TruncateText/TruncateText.js +48 -52
- package/dist/components/PhoneNumberInput/components/Wrapper.js +2 -612
- package/dist/components/PhoneNumberInput/components/index.js +4 -4
- package/dist/components/PhoneNumberInput/contexts/index.js +3 -3
- package/dist/components/PhoneNumberInput/contexts/phone-number.context.js +1 -1
- package/dist/components/PhoneNumberInput/contexts/phone-number.hook.js +5 -6
- package/dist/components/PhoneNumberInput/contexts/phone-number.provider.js +2 -6092
- package/dist/components/PhoneNumberInput/utils/index.js +7 -8
- package/dist/components/PieChart/PieChart.js +49 -85
- package/dist/components/ProgressBar/ProgressBar.js +29 -47
- package/dist/components/ProgressBar/ProgressBar.variants.js +24 -14
- package/dist/components/Radio/Radio.js +50 -70
- package/dist/components/Radio/Radio.variants.js +76 -30
- package/dist/components/RadioCard/RadioCard.js +19 -32
- package/dist/components/RadioCard/RadioCard.variants.js +7 -2
- package/dist/components/RadioCardGroup/RadioCardGroup.js +25 -42
- package/dist/components/RadioCardGroup/RadioCardGroup.variants.js +8 -12
- package/dist/components/RadioGroup/RadioGroup.js +26 -48
- package/dist/components/RadioGroup/RadioGroup.variants.js +8 -12
- package/dist/components/Range/Range.js +49 -83
- package/dist/components/Range/Range.variants.js +46 -25
- package/dist/components/Select/Select.js +36 -56
- package/dist/components/Select/Select.variants.js +59 -5
- package/dist/components/Select/components/AdditionalOptions/AdditionalOptions.js +2 -10
- package/dist/components/Select/components/AdditionalOptions/AdditionalOptions.variants.js +3 -3
- package/dist/components/Select/components/EmptyList.js +3 -8
- package/dist/components/Select/components/List/List.js +113 -88
- package/dist/components/Select/components/List/List.variants.js +42 -2
- package/dist/components/Select/components/ListItem/ListItem.js +51 -49
- package/dist/components/Select/components/ListItem/ListItem.variants.js +21 -3
- package/dist/components/Select/components/Wrapper.js +2 -125
- package/dist/components/Select/components/index.js +8 -8
- package/dist/components/Select/constants/index.js +4 -4
- package/dist/components/Select/constants/list.js +2 -2
- package/dist/components/Select/constants/pagination.js +2 -2
- package/dist/components/Select/contexts/index.js +4 -4
- package/dist/components/Select/contexts/select.context.js +2 -2
- package/dist/components/Select/contexts/select.hook.js +6 -7
- package/dist/components/Select/contexts/select.provider.js +39 -42
- package/dist/components/Select/hooks/useNavigationList.js +34 -49
- package/dist/components/Select/hooks/useSelect.js +54 -100
- package/dist/components/Sidebar/Sidebar.js +22 -26
- package/dist/components/Sidebar/Sidebar.variants.js +29 -3
- package/dist/components/Sidebar/components/Footer/Footer.js +9 -18
- package/dist/components/Sidebar/components/Footer/Footer.variants.js +9 -2
- package/dist/components/Sidebar/components/Logo/Logo.js +9 -18
- package/dist/components/Sidebar/components/Logo/Logo.variants.js +20 -2
- package/dist/components/Sidebar/components/Navigation/Navigation.js +17 -26
- package/dist/components/Sidebar/components/Navigation/Navigation.variants.js +8 -3
- package/dist/components/Sidebar/components/NavigationGroup/NavigationGroup.js +14 -33
- package/dist/components/Sidebar/components/NavigationGroup/NavigationGroup.variants.js +6 -2
- package/dist/components/Sidebar/components/NavigationOption/NavigationOption.js +14 -25
- package/dist/components/Sidebar/components/NavigationOption/NavigationOption.variants.js +28 -8
- package/dist/components/Sidebar/components/NavigationSeparator/NavigationSeparator.js +6 -17
- package/dist/components/Sidebar/components/NavigationSeparator/NavigationSeparator.variants.js +6 -2
- package/dist/components/Sidebar/components/NavigationTitle/NavigationTitle.js +9 -21
- package/dist/components/Sidebar/components/NavigationTitle/NavigationTitle.variants.js +12 -3
- package/dist/components/Sidebar/components/Wrapper/Wrapper.js +27 -34
- package/dist/components/Sidebar/components/index.js +14 -14
- package/dist/components/Slider/Slider.js +38 -70
- package/dist/components/Slider/Slider.variants.js +39 -26
- package/dist/components/Spinner/Spinner.js +2 -56
- package/dist/components/Spinner/Spinner.variants.js +36 -24
- package/dist/components/Stepper/Stepper.js +45 -56
- package/dist/components/Stepper/Stepper.variants.js +174 -77
- package/dist/components/Stepper/components/HorizontalStepItem/HorizontalStepItem.js +120 -151
- package/dist/components/Stepper/components/StepConnector/StepConnector.js +15 -24
- package/dist/components/Stepper/components/StepIndicatorContent/StepIndicatorContent.js +2 -40
- package/dist/components/Stepper/components/StepItem/StepItem.js +6 -15
- package/dist/components/Stepper/components/VerticalStepItem/VerticalStepItem.js +70 -94
- package/dist/components/Stepper/constants/index.js +1 -1
- package/dist/components/Stepper/hooks/index.js +2 -2
- package/dist/components/Stepper/hooks/useStepItemLogic.js +15 -15
- package/dist/components/Stepper/utils/index.js +4 -5
- package/dist/components/Switch/Switch.js +2 -185
- package/dist/components/Switch/Switch.variants.js +41 -2
- package/dist/components/Table/Table.js +18 -29
- package/dist/components/Table/Table.variants.js +29 -12
- package/dist/components/Table/components/Body.js +9 -20
- package/dist/components/Table/components/Filter.js +13 -21
- package/dist/components/Table/components/Head.js +9 -20
- package/dist/components/Table/components/Row.js +14 -28
- package/dist/components/Table/components/index.js +6 -6
- package/dist/components/Tabs/Tabs.js +26 -34
- package/dist/components/Tabs/Tabs.variants.js +54 -42
- package/dist/components/Tabs/components/Content.js +12 -21
- package/dist/components/Tabs/components/List.js +17 -28
- package/dist/components/Tabs/components/Trigger.js +19 -25
- package/dist/components/Tabs/components/index.js +4 -4
- package/dist/components/Tag/Tag.js +26 -33
- package/dist/components/Tag/Tag.variants.js +31 -25
- package/dist/components/TagSelect/TagSelect.js +13 -18
- package/dist/components/TagSelect/TagSelect.variants.js +26 -5
- package/dist/components/TagSelect/components/Item/Item.js +14 -23
- package/dist/components/TagSelect/components/Item/Item.variants.js +16 -12
- package/dist/components/TagSelect/components/List/List.js +17 -22
- package/dist/components/TagSelect/components/List/List.variants.js +21 -3
- package/dist/components/TagSelect/components/Wrapper/Wrapper.js +2 -69
- package/dist/components/TagSelect/components/index.js +6 -6
- package/dist/components/TagSelect/contexts/TagSelect.context.js +1 -1
- package/dist/components/TagSelect/contexts/TagSelect.hook.js +6 -7
- package/dist/components/TagSelect/contexts/TagSelect.provider.js +49 -75
- package/dist/components/TagSelect/contexts/index.js +4 -4
- package/dist/components/TagSelect/hooks/useTagSelect.js +18 -31
- package/dist/components/TextArea/TextArea.js +27 -35
- package/dist/components/TextArea/TextArea.variants.js +18 -3
- package/dist/components/TimePicker/TimePicker.js +15 -23
- package/dist/components/TimePicker/TimePicker.variants.js +65 -2
- package/dist/components/TimePicker/components/HoursList/HoursList.js +88 -75
- package/dist/components/TimePicker/components/MeridianList/MeridianList.js +53 -79
- package/dist/components/TimePicker/components/MinutesList/MinutesList.js +61 -64
- package/dist/components/TimePicker/components/Wrapper/Wrapper.js +134 -143
- package/dist/components/TimePicker/components/WrapperList/WrapperList.js +38 -44
- package/dist/components/TimePicker/components/index.js +2 -2
- package/dist/components/TimePicker/contexts/index.js +6 -6
- package/dist/components/TimePicker/contexts/time-picker.context.js +1 -1
- package/dist/components/TimePicker/contexts/time-picker.hook.js +4 -5
- package/dist/components/TimePicker/contexts/time-picker.provider.js +56 -76
- package/dist/components/TimePicker/utils/index.js +17 -19
- package/dist/components/Toast/Toast.js +3 -547
- package/dist/components/Toast/Toast.variants.js +44 -14
- package/dist/components/Tooltip/Tooltip.js +16 -36
- package/dist/components/Typography/Typography.js +16 -27
- package/dist/components/Typography/Typography.variants.js +71 -26
- package/dist/components/VirtualizedTable/VirtualizedTable.js +89 -77
- package/dist/components/VirtualizedTable/VirtualizedTable.types.d.ts +1 -1
- package/dist/components/VirtualizedTable/VirtualizedTable.variants.js +2 -2
- package/dist/components/VirtualizedTable/assets/chevron-down.js +14 -13
- package/dist/components/VirtualizedTable/assets/chevron-up.js +14 -13
- package/dist/components/VirtualizedTable/assets/index.js +4 -4
- package/dist/components/VirtualizedTable/components/Actions/Actions.js +35 -63
- package/dist/components/VirtualizedTable/components/Body/Body.js +49 -57
- package/dist/components/VirtualizedTable/components/DotPaginate/DotPaginate.js +100 -105
- package/dist/components/VirtualizedTable/components/DropdownPaginate/DropdownPaginate.js +18 -20
- package/dist/components/VirtualizedTable/components/ExpandableRow/ExpandableRow.js +29 -43
- package/dist/components/VirtualizedTable/components/Filter/Filter.js +110 -117
- package/dist/components/VirtualizedTable/components/FormPaginate/FormPaginate.js +42 -32
- package/dist/components/VirtualizedTable/components/Header/Header.js +33 -58
- package/dist/components/VirtualizedTable/components/Pagination/Pagination.js +29 -65
- package/dist/components/VirtualizedTable/components/Skeleton/Skeleton.js +39 -32
- package/dist/components/VirtualizedTable/components/TruncateText/TruncateText.js +39 -52
- package/dist/components/VirtualizedTable/components/WrapperBody/WrapperBody.js +9 -19
- package/dist/components/VirtualizedTable/components/index.js +10 -10
- package/dist/components/VirtualizedTable/constants/index.js +3 -3
- package/dist/components/VirtualizedTable/constants/pagination.js +6 -1
- package/dist/components/VirtualizedTable/contexts/index.js +6 -6
- package/dist/components/VirtualizedTable/contexts/table.context.js +3 -3
- package/dist/components/VirtualizedTable/contexts/table.hook.js +7 -8
- package/dist/components/VirtualizedTable/contexts/table.provider.js +2 -239
- package/dist/components/VirtualizedTable/contexts/table.types.d.ts +1 -1
- package/dist/components/VirtualizedTable/events/index.js +19 -24
- package/dist/components/index.js +140 -140
- package/dist/components-DNFycJGm.js +120 -0
- package/dist/constants-D96yCePL.js +31 -0
- package/dist/contexts/index.js +6 -6
- package/dist/contexts/theme.context.js +2 -2
- package/dist/contexts/theme.hook.js +2 -2
- package/dist/contexts/theme.provider.js +2 -96
- package/dist/createLucideIcon-BVGkzDZC.js +42 -0
- package/dist/debounce-CzFlgg9h.js +86 -0
- package/dist/dist-B5SlrgYz.js +263 -0
- package/dist/{index-BZPx6jYI.js → dist-BL-H4bEw2.js} +5 -2
- package/dist/dist-BL8l9uRy.js +361 -0
- package/dist/{index-DLcqcWxM.js → dist-ByyYBtbL.js} +9 -11
- package/dist/dist-C8r5DW7s.js +10 -0
- package/dist/dist-CBnErrr1.js +58 -0
- package/dist/dist-COY3FRYC.js +480 -0
- package/dist/dist-CSP6X06u.js +1701 -0
- package/dist/dist-DNSmoWJp.js +469 -0
- package/dist/dist-DRmqW28Z2.js +7479 -0
- package/dist/dist-DXJSck4j.js +74 -0
- package/dist/dist-DXXHfL7M.js +132 -0
- package/dist/dist-DZNdbzbm.js +120 -0
- package/dist/dist-DZcOdXgW.js +13 -0
- package/dist/dist-DeVdyMHW2.js +31 -0
- package/dist/{index-3fEdeexs.js → dist-DpqiA4Yn.js} +25 -28
- package/dist/dist-DstQl8xY.js +10 -0
- package/dist/dist-DtEbXv47.js +34 -0
- package/dist/dist-uVUx9i0a.js +223 -0
- package/dist/ellipsis-vertical-My0S9QY5.js +24 -0
- package/dist/hooks/index.js +2 -2
- package/dist/hooks/useToggle.js +5 -10
- package/dist/icons.js +88 -88
- package/dist/index.js +150 -149
- package/dist/isObject--aYwGuhx.js +62 -0
- package/dist/libphonenumber-7uXgv7U8.js +81977 -0
- package/dist/package.json +18 -19
- package/dist/phone-number.provider-B5TfHi8y.js +6646 -0
- package/dist/prop-types-DTnODft1.js +547 -0
- package/dist/proxy-uLtw-ZML.js +4690 -0
- package/dist/style.css +1 -1
- package/dist/styles.css +1 -1
- package/dist/{index-CSWGJT-v.js → table.provider-4OQNqxH3.js} +805 -674
- package/dist/theme.provider-BgxXUOMP.js +74 -0
- package/dist/useBreadcrumb-BBm5lX0U.js +1263 -0
- package/dist/utils/index.js +5 -2920
- package/dist/utils-CQSRNcoF.js +2022 -0
- package/dist/utils-DHuiYnx1.js +1689 -0
- package/dist/x-BwIi6Wii.js +63 -0
- package/dist/x-a0ouxoIM.js +11 -0
- package/package.json +18 -19
- package/dist/AdditionalOptions-DiXvUzhu.js +0 -42
- package/dist/Combination-BtmnusWq.js +0 -480
- package/dist/DayPicker-CaeUXRCF.js +0 -2798
- package/dist/Modal-h5H4yxYg.js +0 -128
- package/dist/_commonjsHelpers-DaMA6jEr.js +0 -8
- package/dist/chevron-down-BBFYYzZq.js +0 -5
- package/dist/chevron-left-BHBf-gQY.js +0 -5
- package/dist/chevron-right-DvXGOiS_.js +0 -5
- package/dist/chevron-up-DEfvgPCw.js +0 -54
- package/dist/chevron-up-IlDPxR7j.js +0 -5
- package/dist/compiler-runtime-DA41awpA.js +0 -36
- package/dist/createLucideIcon-CP-mMPfa.js +0 -75
- package/dist/debounce-DJveWHr_.js +0 -114
- package/dist/ellipsis-vertical-Cl3yNtOy.js +0 -9
- package/dist/index--l0zux8V.js +0 -200
- package/dist/index-0g-eSmV1.js +0 -142
- package/dist/index-0ioNhtNM.js +0 -10
- package/dist/index-B9v5VxE2.js +0 -431
- package/dist/index-BKMaItIC.js +0 -13
- package/dist/index-BKjcReYh.js +0 -55
- package/dist/index-BOE_3f_Z.js +0 -646
- package/dist/index-BRXMsxSL.js +0 -27
- package/dist/index-BdMNhZnh.js +0 -9
- package/dist/index-BmVmDQGH.js +0 -662
- package/dist/index-BvEpLnOv.js +0 -144
- package/dist/index-BvoZGpli.js +0 -60
- package/dist/index-C6mt--X_.js +0 -478
- package/dist/index-CJnS4BVW.js +0 -93
- package/dist/index-CiACf4ao.js +0 -1885
- package/dist/index-D29mdTf5.js +0 -34
- package/dist/index-Dy4FVowi.js +0 -314
- package/dist/index-kTGTSLpq.js +0 -322
- package/dist/index-qDQP8rW4.js +0 -7281
- package/dist/isObject-9XxUefZH.js +0 -97
- package/dist/libphonenumber-aZ-2KWIf.js +0 -11581
- package/dist/proxy-BGrSEZuV.js +0 -5046
- package/dist/useBreadcrumb-C_Wb2cXs.js +0 -1435
- package/dist/x-B9bYxG31.js +0 -8
- package/dist/x-Eoa9FJjA.js +0 -62
|
@@ -1,672 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import * as w from "react";
|
|
3
|
-
import { useRef as T, useMemo as k, useEffect as D } from "react";
|
|
4
|
-
import { flushSync as L } from "react-dom";
|
|
5
|
-
import { Typography as y } from "../../../Typography/Typography.js";
|
|
6
|
-
import { cn as I } from "../../../../utils/index.js";
|
|
7
|
-
import { TruncateText as W } from "../TruncateText/TruncateText.js";
|
|
8
|
-
import { usePhoneNumberContext as V } from "../../contexts/phone-number.hook.js";
|
|
9
|
-
function x(l, r, e) {
|
|
10
|
-
let t = e.initialDeps ?? [], s, n = !0;
|
|
11
|
-
function o() {
|
|
12
|
-
var i, a, u;
|
|
13
|
-
let c;
|
|
14
|
-
e.key && ((i = e.debug) != null && i.call(e)) && (c = Date.now());
|
|
15
|
-
const d = l();
|
|
16
|
-
if (!(d.length !== t.length || d.some((S, f) => t[f] !== S)))
|
|
17
|
-
return s;
|
|
18
|
-
t = d;
|
|
19
|
-
let p;
|
|
20
|
-
if (e.key && ((a = e.debug) != null && a.call(e)) && (p = Date.now()), s = r(...d), e.key && ((u = e.debug) != null && u.call(e))) {
|
|
21
|
-
const S = Math.round((Date.now() - c) * 100) / 100, f = Math.round((Date.now() - p) * 100) / 100, b = f / 16, E = (g, O) => {
|
|
22
|
-
for (g = String(g); g.length < O; )
|
|
23
|
-
g = " " + g;
|
|
24
|
-
return g;
|
|
25
|
-
};
|
|
26
|
-
console.info(
|
|
27
|
-
`%c⏱ ${E(f, 5)} /${E(S, 5)} ms`,
|
|
28
|
-
`
|
|
29
|
-
font-size: .6rem;
|
|
30
|
-
font-weight: bold;
|
|
31
|
-
color: hsl(${Math.max(
|
|
32
|
-
0,
|
|
33
|
-
Math.min(120 - 120 * b, 120)
|
|
34
|
-
)}deg 100% 31%);`,
|
|
35
|
-
e?.key
|
|
36
|
-
);
|
|
37
|
-
}
|
|
38
|
-
return e?.onChange && !(n && e.skipInitialOnChange) && e.onChange(s), n = !1, s;
|
|
39
|
-
}
|
|
40
|
-
return o.updateDeps = (i) => {
|
|
41
|
-
t = i;
|
|
42
|
-
}, o;
|
|
43
|
-
}
|
|
44
|
-
function C(l, r) {
|
|
45
|
-
if (l === void 0)
|
|
46
|
-
throw new Error("Unexpected undefined");
|
|
47
|
-
return l;
|
|
48
|
-
}
|
|
49
|
-
const j = (l, r) => Math.abs(l - r) < 1.01, P = (l, r, e) => {
|
|
50
|
-
let t;
|
|
51
|
-
return function(...s) {
|
|
52
|
-
l.clearTimeout(t), t = l.setTimeout(() => r.apply(this, s), e);
|
|
53
|
-
};
|
|
54
|
-
}, z = (l) => {
|
|
55
|
-
const { offsetWidth: r, offsetHeight: e } = l;
|
|
56
|
-
return { width: r, height: e };
|
|
57
|
-
}, B = (l) => l, H = (l) => {
|
|
58
|
-
const r = Math.max(l.startIndex - l.overscan, 0), e = Math.min(l.endIndex + l.overscan, l.count - 1), t = [];
|
|
59
|
-
for (let s = r; s <= e; s++)
|
|
60
|
-
t.push(s);
|
|
61
|
-
return t;
|
|
62
|
-
}, $ = (l, r) => {
|
|
63
|
-
const e = l.scrollElement;
|
|
64
|
-
if (!e)
|
|
65
|
-
return;
|
|
66
|
-
const t = l.targetWindow;
|
|
67
|
-
if (!t)
|
|
68
|
-
return;
|
|
69
|
-
const s = (o) => {
|
|
70
|
-
const { width: i, height: a } = o;
|
|
71
|
-
r({ width: Math.round(i), height: Math.round(a) });
|
|
72
|
-
};
|
|
73
|
-
if (s(z(e)), !t.ResizeObserver)
|
|
74
|
-
return () => {
|
|
75
|
-
};
|
|
76
|
-
const n = new t.ResizeObserver((o) => {
|
|
77
|
-
const i = () => {
|
|
78
|
-
const a = o[0];
|
|
79
|
-
if (a?.borderBoxSize) {
|
|
80
|
-
const u = a.borderBoxSize[0];
|
|
81
|
-
if (u) {
|
|
82
|
-
s({ width: u.inlineSize, height: u.blockSize });
|
|
83
|
-
return;
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
s(z(e));
|
|
87
|
-
};
|
|
88
|
-
l.options.useAnimationFrameWithResizeObserver ? requestAnimationFrame(i) : i();
|
|
89
|
-
});
|
|
90
|
-
return n.observe(e, { box: "border-box" }), () => {
|
|
91
|
-
n.unobserve(e);
|
|
92
|
-
};
|
|
93
|
-
}, A = {
|
|
94
|
-
passive: !0
|
|
95
|
-
}, R = typeof window > "u" ? !0 : "onscrollend" in window, q = (l, r) => {
|
|
96
|
-
const e = l.scrollElement;
|
|
97
|
-
if (!e)
|
|
98
|
-
return;
|
|
99
|
-
const t = l.targetWindow;
|
|
100
|
-
if (!t)
|
|
101
|
-
return;
|
|
102
|
-
let s = 0;
|
|
103
|
-
const n = l.options.useScrollendEvent && R ? () => {
|
|
104
|
-
} : P(
|
|
105
|
-
t,
|
|
106
|
-
() => {
|
|
107
|
-
r(s, !1);
|
|
108
|
-
},
|
|
109
|
-
l.options.isScrollingResetDelay
|
|
110
|
-
), o = (c) => () => {
|
|
111
|
-
const { horizontal: d, isRtl: h } = l.options;
|
|
112
|
-
s = d ? e.scrollLeft * (h && -1 || 1) : e.scrollTop, n(), r(s, c);
|
|
113
|
-
}, i = o(!0), a = o(!1);
|
|
114
|
-
e.addEventListener("scroll", i, A);
|
|
115
|
-
const u = l.options.useScrollendEvent && R;
|
|
116
|
-
return u && e.addEventListener("scrollend", a, A), () => {
|
|
117
|
-
e.removeEventListener("scroll", i), u && e.removeEventListener("scrollend", a);
|
|
118
|
-
};
|
|
119
|
-
}, K = (l, r, e) => {
|
|
120
|
-
if (r?.borderBoxSize) {
|
|
121
|
-
const t = r.borderBoxSize[0];
|
|
122
|
-
if (t)
|
|
123
|
-
return Math.round(
|
|
124
|
-
t[e.options.horizontal ? "inlineSize" : "blockSize"]
|
|
125
|
-
);
|
|
126
|
-
}
|
|
127
|
-
return l[e.options.horizontal ? "offsetWidth" : "offsetHeight"];
|
|
128
|
-
}, U = (l, {
|
|
129
|
-
adjustments: r = 0,
|
|
130
|
-
behavior: e
|
|
131
|
-
}, t) => {
|
|
132
|
-
var s, n;
|
|
133
|
-
const o = l + r;
|
|
134
|
-
(n = (s = t.scrollElement) == null ? void 0 : s.scrollTo) == null || n.call(s, {
|
|
135
|
-
[t.options.horizontal ? "left" : "top"]: o,
|
|
136
|
-
behavior: e
|
|
137
|
-
});
|
|
138
|
-
};
|
|
139
|
-
class X {
|
|
140
|
-
constructor(r) {
|
|
141
|
-
this.unsubs = [], this.scrollElement = null, this.targetWindow = null, this.isScrolling = !1, this.scrollState = null, this.measurementsCache = [], this.itemSizeCache = /* @__PURE__ */ new Map(), this.laneAssignments = /* @__PURE__ */ new Map(), this.pendingMeasuredCacheIndexes = [], this.prevLanes = void 0, this.lanesChangedFlag = !1, this.lanesSettling = !1, this.scrollRect = null, this.scrollOffset = null, this.scrollDirection = null, this.scrollAdjustments = 0, this.elementsCache = /* @__PURE__ */ new Map(), this.now = () => {
|
|
142
|
-
var e, t, s;
|
|
143
|
-
return ((s = (t = (e = this.targetWindow) == null ? void 0 : e.performance) == null ? void 0 : t.now) == null ? void 0 : s.call(t)) ?? Date.now();
|
|
144
|
-
}, this.observer = /* @__PURE__ */ (() => {
|
|
145
|
-
let e = null;
|
|
146
|
-
const t = () => e || (!this.targetWindow || !this.targetWindow.ResizeObserver ? null : e = new this.targetWindow.ResizeObserver((s) => {
|
|
147
|
-
s.forEach((n) => {
|
|
148
|
-
const o = () => {
|
|
149
|
-
const i = n.target, a = this.indexFromElement(i);
|
|
150
|
-
if (!i.isConnected) {
|
|
151
|
-
this.observer.unobserve(i);
|
|
152
|
-
return;
|
|
153
|
-
}
|
|
154
|
-
this.shouldMeasureDuringScroll(a) && this.resizeItem(
|
|
155
|
-
a,
|
|
156
|
-
this.options.measureElement(i, n, this)
|
|
157
|
-
);
|
|
158
|
-
};
|
|
159
|
-
this.options.useAnimationFrameWithResizeObserver ? requestAnimationFrame(o) : o();
|
|
160
|
-
});
|
|
161
|
-
}));
|
|
162
|
-
return {
|
|
163
|
-
disconnect: () => {
|
|
164
|
-
var s;
|
|
165
|
-
(s = t()) == null || s.disconnect(), e = null;
|
|
166
|
-
},
|
|
167
|
-
observe: (s) => {
|
|
168
|
-
var n;
|
|
169
|
-
return (n = t()) == null ? void 0 : n.observe(s, { box: "border-box" });
|
|
170
|
-
},
|
|
171
|
-
unobserve: (s) => {
|
|
172
|
-
var n;
|
|
173
|
-
return (n = t()) == null ? void 0 : n.unobserve(s);
|
|
174
|
-
}
|
|
175
|
-
};
|
|
176
|
-
})(), this.range = null, this.setOptions = (e) => {
|
|
177
|
-
Object.entries(e).forEach(([t, s]) => {
|
|
178
|
-
typeof s > "u" && delete e[t];
|
|
179
|
-
}), this.options = {
|
|
180
|
-
debug: !1,
|
|
181
|
-
initialOffset: 0,
|
|
182
|
-
overscan: 1,
|
|
183
|
-
paddingStart: 0,
|
|
184
|
-
paddingEnd: 0,
|
|
185
|
-
scrollPaddingStart: 0,
|
|
186
|
-
scrollPaddingEnd: 0,
|
|
187
|
-
horizontal: !1,
|
|
188
|
-
getItemKey: B,
|
|
189
|
-
rangeExtractor: H,
|
|
190
|
-
onChange: () => {
|
|
191
|
-
},
|
|
192
|
-
measureElement: K,
|
|
193
|
-
initialRect: { width: 0, height: 0 },
|
|
194
|
-
scrollMargin: 0,
|
|
195
|
-
gap: 0,
|
|
196
|
-
indexAttribute: "data-index",
|
|
197
|
-
initialMeasurementsCache: [],
|
|
198
|
-
lanes: 1,
|
|
199
|
-
isScrollingResetDelay: 150,
|
|
200
|
-
enabled: !0,
|
|
201
|
-
isRtl: !1,
|
|
202
|
-
useScrollendEvent: !1,
|
|
203
|
-
useAnimationFrameWithResizeObserver: !1,
|
|
204
|
-
...e
|
|
205
|
-
};
|
|
206
|
-
}, this.notify = (e) => {
|
|
207
|
-
var t, s;
|
|
208
|
-
(s = (t = this.options).onChange) == null || s.call(t, this, e);
|
|
209
|
-
}, this.maybeNotify = x(
|
|
210
|
-
() => (this.calculateRange(), [
|
|
211
|
-
this.isScrolling,
|
|
212
|
-
this.range ? this.range.startIndex : null,
|
|
213
|
-
this.range ? this.range.endIndex : null
|
|
214
|
-
]),
|
|
215
|
-
(e) => {
|
|
216
|
-
this.notify(e);
|
|
217
|
-
},
|
|
218
|
-
{
|
|
219
|
-
key: process.env.NODE_ENV !== "production" && "maybeNotify",
|
|
220
|
-
debug: () => this.options.debug,
|
|
221
|
-
initialDeps: [
|
|
222
|
-
this.isScrolling,
|
|
223
|
-
this.range ? this.range.startIndex : null,
|
|
224
|
-
this.range ? this.range.endIndex : null
|
|
225
|
-
]
|
|
226
|
-
}
|
|
227
|
-
), this.cleanup = () => {
|
|
228
|
-
this.unsubs.filter(Boolean).forEach((e) => e()), this.unsubs = [], this.observer.disconnect(), this.rafId != null && this.targetWindow && (this.targetWindow.cancelAnimationFrame(this.rafId), this.rafId = null), this.scrollState = null, this.scrollElement = null, this.targetWindow = null;
|
|
229
|
-
}, this._didMount = () => () => {
|
|
230
|
-
this.cleanup();
|
|
231
|
-
}, this._willUpdate = () => {
|
|
232
|
-
var e;
|
|
233
|
-
const t = this.options.enabled ? this.options.getScrollElement() : null;
|
|
234
|
-
if (this.scrollElement !== t) {
|
|
235
|
-
if (this.cleanup(), !t) {
|
|
236
|
-
this.maybeNotify();
|
|
237
|
-
return;
|
|
238
|
-
}
|
|
239
|
-
this.scrollElement = t, this.scrollElement && "ownerDocument" in this.scrollElement ? this.targetWindow = this.scrollElement.ownerDocument.defaultView : this.targetWindow = ((e = this.scrollElement) == null ? void 0 : e.window) ?? null, this.elementsCache.forEach((s) => {
|
|
240
|
-
this.observer.observe(s);
|
|
241
|
-
}), this.unsubs.push(
|
|
242
|
-
this.options.observeElementRect(this, (s) => {
|
|
243
|
-
this.scrollRect = s, this.maybeNotify();
|
|
244
|
-
})
|
|
245
|
-
), this.unsubs.push(
|
|
246
|
-
this.options.observeElementOffset(this, (s, n) => {
|
|
247
|
-
this.scrollAdjustments = 0, this.scrollDirection = n ? this.getScrollOffset() < s ? "forward" : "backward" : null, this.scrollOffset = s, this.isScrolling = n, this.scrollState && this.scheduleScrollReconcile(), this.maybeNotify();
|
|
248
|
-
})
|
|
249
|
-
), this._scrollToOffset(this.getScrollOffset(), {
|
|
250
|
-
adjustments: void 0,
|
|
251
|
-
behavior: void 0
|
|
252
|
-
});
|
|
253
|
-
}
|
|
254
|
-
}, this.rafId = null, this.getSize = () => this.options.enabled ? (this.scrollRect = this.scrollRect ?? this.options.initialRect, this.scrollRect[this.options.horizontal ? "width" : "height"]) : (this.scrollRect = null, 0), this.getScrollOffset = () => this.options.enabled ? (this.scrollOffset = this.scrollOffset ?? (typeof this.options.initialOffset == "function" ? this.options.initialOffset() : this.options.initialOffset), this.scrollOffset) : (this.scrollOffset = null, 0), this.getFurthestMeasurement = (e, t) => {
|
|
255
|
-
const s = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new Map();
|
|
256
|
-
for (let o = t - 1; o >= 0; o--) {
|
|
257
|
-
const i = e[o];
|
|
258
|
-
if (s.has(i.lane))
|
|
259
|
-
continue;
|
|
260
|
-
const a = n.get(
|
|
261
|
-
i.lane
|
|
262
|
-
);
|
|
263
|
-
if (a == null || i.end > a.end ? n.set(i.lane, i) : i.end < a.end && s.set(i.lane, !0), s.size === this.options.lanes)
|
|
264
|
-
break;
|
|
265
|
-
}
|
|
266
|
-
return n.size === this.options.lanes ? Array.from(n.values()).sort((o, i) => o.end === i.end ? o.index - i.index : o.end - i.end)[0] : void 0;
|
|
267
|
-
}, this.getMeasurementOptions = x(
|
|
268
|
-
() => [
|
|
269
|
-
this.options.count,
|
|
270
|
-
this.options.paddingStart,
|
|
271
|
-
this.options.scrollMargin,
|
|
272
|
-
this.options.getItemKey,
|
|
273
|
-
this.options.enabled,
|
|
274
|
-
this.options.lanes
|
|
275
|
-
],
|
|
276
|
-
(e, t, s, n, o, i) => (this.prevLanes !== void 0 && this.prevLanes !== i && (this.lanesChangedFlag = !0), this.prevLanes = i, this.pendingMeasuredCacheIndexes = [], {
|
|
277
|
-
count: e,
|
|
278
|
-
paddingStart: t,
|
|
279
|
-
scrollMargin: s,
|
|
280
|
-
getItemKey: n,
|
|
281
|
-
enabled: o,
|
|
282
|
-
lanes: i
|
|
283
|
-
}),
|
|
284
|
-
{
|
|
285
|
-
key: !1
|
|
286
|
-
}
|
|
287
|
-
), this.getMeasurements = x(
|
|
288
|
-
() => [this.getMeasurementOptions(), this.itemSizeCache],
|
|
289
|
-
({ count: e, paddingStart: t, scrollMargin: s, getItemKey: n, enabled: o, lanes: i }, a) => {
|
|
290
|
-
if (!o)
|
|
291
|
-
return this.measurementsCache = [], this.itemSizeCache.clear(), this.laneAssignments.clear(), [];
|
|
292
|
-
if (this.laneAssignments.size > e)
|
|
293
|
-
for (const h of this.laneAssignments.keys())
|
|
294
|
-
h >= e && this.laneAssignments.delete(h);
|
|
295
|
-
this.lanesChangedFlag && (this.lanesChangedFlag = !1, this.lanesSettling = !0, this.measurementsCache = [], this.itemSizeCache.clear(), this.laneAssignments.clear(), this.pendingMeasuredCacheIndexes = []), this.measurementsCache.length === 0 && !this.lanesSettling && (this.measurementsCache = this.options.initialMeasurementsCache, this.measurementsCache.forEach((h) => {
|
|
296
|
-
this.itemSizeCache.set(h.key, h.size);
|
|
297
|
-
}));
|
|
298
|
-
const u = this.lanesSettling ? 0 : this.pendingMeasuredCacheIndexes.length > 0 ? Math.min(...this.pendingMeasuredCacheIndexes) : 0;
|
|
299
|
-
this.pendingMeasuredCacheIndexes = [], this.lanesSettling && this.measurementsCache.length === e && (this.lanesSettling = !1);
|
|
300
|
-
const c = this.measurementsCache.slice(0, u), d = new Array(i).fill(
|
|
301
|
-
void 0
|
|
302
|
-
);
|
|
303
|
-
for (let h = 0; h < u; h++) {
|
|
304
|
-
const p = c[h];
|
|
305
|
-
p && (d[p.lane] = h);
|
|
306
|
-
}
|
|
307
|
-
for (let h = u; h < e; h++) {
|
|
308
|
-
const p = n(h), S = this.laneAssignments.get(h);
|
|
309
|
-
let f, b;
|
|
310
|
-
if (S !== void 0 && this.options.lanes > 1) {
|
|
311
|
-
f = S;
|
|
312
|
-
const v = d[f], M = v !== void 0 ? c[v] : void 0;
|
|
313
|
-
b = M ? M.end + this.options.gap : t + s;
|
|
314
|
-
} else {
|
|
315
|
-
const v = this.options.lanes === 1 ? c[h - 1] : this.getFurthestMeasurement(c, h);
|
|
316
|
-
b = v ? v.end + this.options.gap : t + s, f = v ? v.lane : h % this.options.lanes, this.options.lanes > 1 && this.laneAssignments.set(h, f);
|
|
317
|
-
}
|
|
318
|
-
const E = a.get(p), g = typeof E == "number" ? E : this.options.estimateSize(h), O = b + g;
|
|
319
|
-
c[h] = {
|
|
320
|
-
index: h,
|
|
321
|
-
start: b,
|
|
322
|
-
size: g,
|
|
323
|
-
end: O,
|
|
324
|
-
key: p,
|
|
325
|
-
lane: f
|
|
326
|
-
}, d[f] = h;
|
|
327
|
-
}
|
|
328
|
-
return this.measurementsCache = c, c;
|
|
329
|
-
},
|
|
330
|
-
{
|
|
331
|
-
key: process.env.NODE_ENV !== "production" && "getMeasurements",
|
|
332
|
-
debug: () => this.options.debug
|
|
333
|
-
}
|
|
334
|
-
), this.calculateRange = x(
|
|
335
|
-
() => [
|
|
336
|
-
this.getMeasurements(),
|
|
337
|
-
this.getSize(),
|
|
338
|
-
this.getScrollOffset(),
|
|
339
|
-
this.options.lanes
|
|
340
|
-
],
|
|
341
|
-
(e, t, s, n) => this.range = e.length > 0 && t > 0 ? G({
|
|
342
|
-
measurements: e,
|
|
343
|
-
outerSize: t,
|
|
344
|
-
scrollOffset: s,
|
|
345
|
-
lanes: n
|
|
346
|
-
}) : null,
|
|
347
|
-
{
|
|
348
|
-
key: process.env.NODE_ENV !== "production" && "calculateRange",
|
|
349
|
-
debug: () => this.options.debug
|
|
350
|
-
}
|
|
351
|
-
), this.getVirtualIndexes = x(
|
|
352
|
-
() => {
|
|
353
|
-
let e = null, t = null;
|
|
354
|
-
const s = this.calculateRange();
|
|
355
|
-
return s && (e = s.startIndex, t = s.endIndex), this.maybeNotify.updateDeps([this.isScrolling, e, t]), [
|
|
356
|
-
this.options.rangeExtractor,
|
|
357
|
-
this.options.overscan,
|
|
358
|
-
this.options.count,
|
|
359
|
-
e,
|
|
360
|
-
t
|
|
361
|
-
];
|
|
362
|
-
},
|
|
363
|
-
(e, t, s, n, o) => n === null || o === null ? [] : e({
|
|
364
|
-
startIndex: n,
|
|
365
|
-
endIndex: o,
|
|
366
|
-
overscan: t,
|
|
367
|
-
count: s
|
|
368
|
-
}),
|
|
369
|
-
{
|
|
370
|
-
key: process.env.NODE_ENV !== "production" && "getVirtualIndexes",
|
|
371
|
-
debug: () => this.options.debug
|
|
372
|
-
}
|
|
373
|
-
), this.indexFromElement = (e) => {
|
|
374
|
-
const t = this.options.indexAttribute, s = e.getAttribute(t);
|
|
375
|
-
return s ? parseInt(s, 10) : (console.warn(
|
|
376
|
-
`Missing attribute name '${t}={index}' on measured element.`
|
|
377
|
-
), -1);
|
|
378
|
-
}, this.shouldMeasureDuringScroll = (e) => {
|
|
379
|
-
var t;
|
|
380
|
-
if (!this.scrollState || this.scrollState.behavior !== "smooth")
|
|
381
|
-
return !0;
|
|
382
|
-
const s = this.scrollState.index ?? ((t = this.getVirtualItemForOffset(this.scrollState.lastTargetOffset)) == null ? void 0 : t.index);
|
|
383
|
-
if (s !== void 0 && this.range) {
|
|
384
|
-
const n = Math.max(
|
|
385
|
-
this.options.overscan,
|
|
386
|
-
Math.ceil((this.range.endIndex - this.range.startIndex) / 2)
|
|
387
|
-
), o = Math.max(0, s - n), i = Math.min(
|
|
388
|
-
this.options.count - 1,
|
|
389
|
-
s + n
|
|
390
|
-
);
|
|
391
|
-
return e >= o && e <= i;
|
|
392
|
-
}
|
|
393
|
-
return !0;
|
|
394
|
-
}, this.measureElement = (e) => {
|
|
395
|
-
if (!e) {
|
|
396
|
-
this.elementsCache.forEach((o, i) => {
|
|
397
|
-
o.isConnected || (this.observer.unobserve(o), this.elementsCache.delete(i));
|
|
398
|
-
});
|
|
399
|
-
return;
|
|
400
|
-
}
|
|
401
|
-
const t = this.indexFromElement(e), s = this.options.getItemKey(t), n = this.elementsCache.get(s);
|
|
402
|
-
n !== e && (n && this.observer.unobserve(n), this.observer.observe(e), this.elementsCache.set(s, e)), (!this.isScrolling || this.scrollState) && this.shouldMeasureDuringScroll(t) && this.resizeItem(t, this.options.measureElement(e, void 0, this));
|
|
403
|
-
}, this.resizeItem = (e, t) => {
|
|
404
|
-
var s;
|
|
405
|
-
const n = this.measurementsCache[e];
|
|
406
|
-
if (!n) return;
|
|
407
|
-
const o = this.itemSizeCache.get(n.key) ?? n.size, i = t - o;
|
|
408
|
-
i !== 0 && (((s = this.scrollState) == null ? void 0 : s.behavior) !== "smooth" && (this.shouldAdjustScrollPositionOnItemSizeChange !== void 0 ? this.shouldAdjustScrollPositionOnItemSizeChange(n, i, this) : n.start < this.getScrollOffset() + this.scrollAdjustments) && (process.env.NODE_ENV !== "production" && this.options.debug && console.info("correction", i), this._scrollToOffset(this.getScrollOffset(), {
|
|
409
|
-
adjustments: this.scrollAdjustments += i,
|
|
410
|
-
behavior: void 0
|
|
411
|
-
})), this.pendingMeasuredCacheIndexes.push(n.index), this.itemSizeCache = new Map(this.itemSizeCache.set(n.key, t)), this.notify(!1));
|
|
412
|
-
}, this.getVirtualItems = x(
|
|
413
|
-
() => [this.getVirtualIndexes(), this.getMeasurements()],
|
|
414
|
-
(e, t) => {
|
|
415
|
-
const s = [];
|
|
416
|
-
for (let n = 0, o = e.length; n < o; n++) {
|
|
417
|
-
const i = e[n], a = t[i];
|
|
418
|
-
s.push(a);
|
|
419
|
-
}
|
|
420
|
-
return s;
|
|
421
|
-
},
|
|
422
|
-
{
|
|
423
|
-
key: process.env.NODE_ENV !== "production" && "getVirtualItems",
|
|
424
|
-
debug: () => this.options.debug
|
|
425
|
-
}
|
|
426
|
-
), this.getVirtualItemForOffset = (e) => {
|
|
427
|
-
const t = this.getMeasurements();
|
|
428
|
-
if (t.length !== 0)
|
|
429
|
-
return C(
|
|
430
|
-
t[F(
|
|
431
|
-
0,
|
|
432
|
-
t.length - 1,
|
|
433
|
-
(s) => C(t[s]).start,
|
|
434
|
-
e
|
|
435
|
-
)]
|
|
436
|
-
);
|
|
437
|
-
}, this.getMaxScrollOffset = () => {
|
|
438
|
-
if (!this.scrollElement) return 0;
|
|
439
|
-
if ("scrollHeight" in this.scrollElement)
|
|
440
|
-
return this.options.horizontal ? this.scrollElement.scrollWidth - this.scrollElement.clientWidth : this.scrollElement.scrollHeight - this.scrollElement.clientHeight;
|
|
441
|
-
{
|
|
442
|
-
const e = this.scrollElement.document.documentElement;
|
|
443
|
-
return this.options.horizontal ? e.scrollWidth - this.scrollElement.innerWidth : e.scrollHeight - this.scrollElement.innerHeight;
|
|
444
|
-
}
|
|
445
|
-
}, this.getOffsetForAlignment = (e, t, s = 0) => {
|
|
446
|
-
if (!this.scrollElement) return 0;
|
|
447
|
-
const n = this.getSize(), o = this.getScrollOffset();
|
|
448
|
-
t === "auto" && (t = e >= o + n ? "end" : "start"), t === "center" ? e += (s - n) / 2 : t === "end" && (e -= n);
|
|
449
|
-
const i = this.getMaxScrollOffset();
|
|
450
|
-
return Math.max(Math.min(i, e), 0);
|
|
451
|
-
}, this.getOffsetForIndex = (e, t = "auto") => {
|
|
452
|
-
e = Math.max(0, Math.min(e, this.options.count - 1));
|
|
453
|
-
const s = this.getSize(), n = this.getScrollOffset(), o = this.measurementsCache[e];
|
|
454
|
-
if (!o) return;
|
|
455
|
-
if (t === "auto")
|
|
456
|
-
if (o.end >= n + s - this.options.scrollPaddingEnd)
|
|
457
|
-
t = "end";
|
|
458
|
-
else if (o.start <= n + this.options.scrollPaddingStart)
|
|
459
|
-
t = "start";
|
|
460
|
-
else
|
|
461
|
-
return [n, t];
|
|
462
|
-
if (t === "end" && e === this.options.count - 1)
|
|
463
|
-
return [this.getMaxScrollOffset(), t];
|
|
464
|
-
const i = t === "end" ? o.end + this.options.scrollPaddingEnd : o.start - this.options.scrollPaddingStart;
|
|
465
|
-
return [
|
|
466
|
-
this.getOffsetForAlignment(i, t, o.size),
|
|
467
|
-
t
|
|
468
|
-
];
|
|
469
|
-
}, this.scrollToOffset = (e, { align: t = "start", behavior: s = "auto" } = {}) => {
|
|
470
|
-
const n = this.getOffsetForAlignment(e, t), o = this.now();
|
|
471
|
-
this.scrollState = {
|
|
472
|
-
index: null,
|
|
473
|
-
align: t,
|
|
474
|
-
behavior: s,
|
|
475
|
-
startedAt: o,
|
|
476
|
-
lastTargetOffset: n,
|
|
477
|
-
stableFrames: 0
|
|
478
|
-
}, this._scrollToOffset(n, { adjustments: void 0, behavior: s }), this.scheduleScrollReconcile();
|
|
479
|
-
}, this.scrollToIndex = (e, {
|
|
480
|
-
align: t = "auto",
|
|
481
|
-
behavior: s = "auto"
|
|
482
|
-
} = {}) => {
|
|
483
|
-
e = Math.max(0, Math.min(e, this.options.count - 1));
|
|
484
|
-
const n = this.getOffsetForIndex(e, t);
|
|
485
|
-
if (!n)
|
|
486
|
-
return;
|
|
487
|
-
const [o, i] = n, a = this.now();
|
|
488
|
-
this.scrollState = {
|
|
489
|
-
index: e,
|
|
490
|
-
align: i,
|
|
491
|
-
behavior: s,
|
|
492
|
-
startedAt: a,
|
|
493
|
-
lastTargetOffset: o,
|
|
494
|
-
stableFrames: 0
|
|
495
|
-
}, this._scrollToOffset(o, { adjustments: void 0, behavior: s }), this.scheduleScrollReconcile();
|
|
496
|
-
}, this.scrollBy = (e, { behavior: t = "auto" } = {}) => {
|
|
497
|
-
const s = this.getScrollOffset() + e, n = this.now();
|
|
498
|
-
this.scrollState = {
|
|
499
|
-
index: null,
|
|
500
|
-
align: "start",
|
|
501
|
-
behavior: t,
|
|
502
|
-
startedAt: n,
|
|
503
|
-
lastTargetOffset: s,
|
|
504
|
-
stableFrames: 0
|
|
505
|
-
}, this._scrollToOffset(s, { adjustments: void 0, behavior: t }), this.scheduleScrollReconcile();
|
|
506
|
-
}, this.getTotalSize = () => {
|
|
507
|
-
var e;
|
|
508
|
-
const t = this.getMeasurements();
|
|
509
|
-
let s;
|
|
510
|
-
if (t.length === 0)
|
|
511
|
-
s = this.options.paddingStart;
|
|
512
|
-
else if (this.options.lanes === 1)
|
|
513
|
-
s = ((e = t[t.length - 1]) == null ? void 0 : e.end) ?? 0;
|
|
514
|
-
else {
|
|
515
|
-
const n = Array(this.options.lanes).fill(null);
|
|
516
|
-
let o = t.length - 1;
|
|
517
|
-
for (; o >= 0 && n.some((i) => i === null); ) {
|
|
518
|
-
const i = t[o];
|
|
519
|
-
n[i.lane] === null && (n[i.lane] = i.end), o--;
|
|
520
|
-
}
|
|
521
|
-
s = Math.max(...n.filter((i) => i !== null));
|
|
522
|
-
}
|
|
523
|
-
return Math.max(
|
|
524
|
-
s - this.options.scrollMargin + this.options.paddingEnd,
|
|
525
|
-
0
|
|
526
|
-
);
|
|
527
|
-
}, this._scrollToOffset = (e, {
|
|
528
|
-
adjustments: t,
|
|
529
|
-
behavior: s
|
|
530
|
-
}) => {
|
|
531
|
-
this.options.scrollToFn(e, { behavior: s, adjustments: t }, this);
|
|
532
|
-
}, this.measure = () => {
|
|
533
|
-
this.itemSizeCache = /* @__PURE__ */ new Map(), this.laneAssignments = /* @__PURE__ */ new Map(), this.notify(!1);
|
|
534
|
-
}, this.setOptions(r);
|
|
535
|
-
}
|
|
536
|
-
scheduleScrollReconcile() {
|
|
537
|
-
if (!this.targetWindow) {
|
|
538
|
-
this.scrollState = null;
|
|
539
|
-
return;
|
|
540
|
-
}
|
|
541
|
-
this.rafId == null && (this.rafId = this.targetWindow.requestAnimationFrame(() => {
|
|
542
|
-
this.rafId = null, this.reconcileScroll();
|
|
543
|
-
}));
|
|
544
|
-
}
|
|
545
|
-
reconcileScroll() {
|
|
546
|
-
if (!this.scrollState || !this.scrollElement) return;
|
|
547
|
-
if (this.now() - this.scrollState.startedAt > 5e3) {
|
|
548
|
-
this.scrollState = null;
|
|
549
|
-
return;
|
|
550
|
-
}
|
|
551
|
-
const t = this.scrollState.index != null ? this.getOffsetForIndex(this.scrollState.index, this.scrollState.align) : void 0, s = t ? t[0] : this.scrollState.lastTargetOffset, n = 1, o = s !== this.scrollState.lastTargetOffset;
|
|
552
|
-
if (!o && j(s, this.getScrollOffset())) {
|
|
553
|
-
if (this.scrollState.stableFrames++, this.scrollState.stableFrames >= n) {
|
|
554
|
-
this.scrollState = null;
|
|
555
|
-
return;
|
|
556
|
-
}
|
|
557
|
-
} else
|
|
558
|
-
this.scrollState.stableFrames = 0, o && (this.scrollState.lastTargetOffset = s, this.scrollState.behavior = "auto", this._scrollToOffset(s, {
|
|
559
|
-
adjustments: void 0,
|
|
560
|
-
behavior: "auto"
|
|
561
|
-
}));
|
|
562
|
-
this.scheduleScrollReconcile();
|
|
563
|
-
}
|
|
564
|
-
}
|
|
565
|
-
const F = (l, r, e, t) => {
|
|
566
|
-
for (; l <= r; ) {
|
|
567
|
-
const s = (l + r) / 2 | 0, n = e(s);
|
|
568
|
-
if (n < t)
|
|
569
|
-
l = s + 1;
|
|
570
|
-
else if (n > t)
|
|
571
|
-
r = s - 1;
|
|
572
|
-
else
|
|
573
|
-
return s;
|
|
574
|
-
}
|
|
575
|
-
return l > 0 ? l - 1 : 0;
|
|
576
|
-
};
|
|
577
|
-
function G({
|
|
578
|
-
measurements: l,
|
|
579
|
-
outerSize: r,
|
|
580
|
-
scrollOffset: e,
|
|
581
|
-
lanes: t
|
|
582
|
-
}) {
|
|
583
|
-
const s = l.length - 1, n = (a) => l[a].start;
|
|
584
|
-
if (l.length <= t)
|
|
585
|
-
return {
|
|
586
|
-
startIndex: 0,
|
|
587
|
-
endIndex: s
|
|
588
|
-
};
|
|
589
|
-
let o = F(
|
|
590
|
-
0,
|
|
591
|
-
s,
|
|
592
|
-
n,
|
|
593
|
-
e
|
|
594
|
-
), i = o;
|
|
595
|
-
if (t === 1)
|
|
596
|
-
for (; i < s && l[i].end < e + r; )
|
|
597
|
-
i++;
|
|
598
|
-
else if (t > 1) {
|
|
599
|
-
const a = Array(t).fill(0);
|
|
600
|
-
for (; i < s && a.some((c) => c < e + r); ) {
|
|
601
|
-
const c = l[i];
|
|
602
|
-
a[c.lane] = c.end, i++;
|
|
603
|
-
}
|
|
604
|
-
const u = Array(t).fill(e + r);
|
|
605
|
-
for (; o >= 0 && u.some((c) => c >= e); ) {
|
|
606
|
-
const c = l[o];
|
|
607
|
-
u[c.lane] = c.start, o--;
|
|
608
|
-
}
|
|
609
|
-
o = Math.max(0, o - o % t), i = Math.min(s, i + (t - 1 - i % t));
|
|
610
|
-
}
|
|
611
|
-
return { startIndex: o, endIndex: i };
|
|
612
|
-
}
|
|
613
|
-
const _ = typeof document < "u" ? w.useLayoutEffect : w.useEffect;
|
|
614
|
-
function J({
|
|
615
|
-
useFlushSync: l = !0,
|
|
616
|
-
...r
|
|
617
|
-
}) {
|
|
618
|
-
const e = w.useReducer(() => ({}), {})[1], t = {
|
|
619
|
-
...r,
|
|
620
|
-
onChange: (n, o) => {
|
|
621
|
-
var i;
|
|
622
|
-
l && o ? L(e) : e(), (i = r.onChange) == null || i.call(r, n, o);
|
|
623
|
-
}
|
|
624
|
-
}, [s] = w.useState(
|
|
625
|
-
() => new X(t)
|
|
626
|
-
);
|
|
627
|
-
return s.setOptions(t), _(() => s._didMount(), []), _(() => s._willUpdate()), s;
|
|
628
|
-
}
|
|
629
|
-
function Q(l) {
|
|
630
|
-
return J({
|
|
631
|
-
observeElementRect: $,
|
|
632
|
-
observeElementOffset: q,
|
|
633
|
-
scrollToFn: U,
|
|
634
|
-
...l
|
|
635
|
-
});
|
|
636
|
-
}
|
|
637
|
-
const oe = ({
|
|
638
|
-
showFlagOnSearch: l,
|
|
639
|
-
showNameOnSearch: r
|
|
640
|
-
}) => {
|
|
641
|
-
const e = T(null), {
|
|
642
|
-
termOfSearch: t,
|
|
643
|
-
countries: s,
|
|
644
|
-
handleSelectCountry: n
|
|
645
|
-
} = V(), o = k(() => s.filter((a) => a.name.toLocaleLowerCase().includes(t.toLowerCase())), [t]), i = Q({
|
|
646
|
-
count: o.length,
|
|
647
|
-
overscan: 5,
|
|
648
|
-
getScrollElement: () => e.current,
|
|
649
|
-
estimateSize: () => 40
|
|
650
|
-
});
|
|
651
|
-
return D(() => {
|
|
652
|
-
o.length > 0 && i.scrollToIndex(0);
|
|
653
|
-
}, [t, i]), o.length === 0 ? /* @__PURE__ */ m("div", { className: "overflow-y-auto max-h-60 snap-y snap-mandatory", children: /* @__PURE__ */ m("ul", { className: "relative", children: /* @__PURE__ */ m("li", { className: "w-full flex items-center h-10 select-none px-6", children: /* @__PURE__ */ m(y, { variant: "body2", component: "span", className: "flex gap-2 items-center text-left", children: "No options" }) }) }) }) : /* @__PURE__ */ m("div", { ref: e, className: "overflow-y-auto max-h-60 snap-y snap-mandatory scrollbar", children: /* @__PURE__ */ m("ul", { className: "relative", style: {
|
|
654
|
-
height: i.getTotalSize()
|
|
655
|
-
}, children: i.getVirtualItems().map((a) => {
|
|
656
|
-
const u = o[a.index], {
|
|
657
|
-
flag: c,
|
|
658
|
-
name: d,
|
|
659
|
-
prefix: h
|
|
660
|
-
} = u;
|
|
661
|
-
return /* @__PURE__ */ m("li", { className: I("absolute", "w-full", "snap-start", "snap-always", "scroll-m-0", "flex", "items-center", "h-10"), style: {
|
|
662
|
-
top: a.start,
|
|
663
|
-
height: a.size
|
|
664
|
-
}, children: /* @__PURE__ */ m("button", { className: I("w-full", "h-full", "cursor-pointer", "px-6", "hover:bg-gray-50", "transition-colors", "duration-150", "focus-visible:outline-0", "hover:outline-gray-100", "focus:bg-gray-50", "dark:hover:bg-metal-700"), onClick: () => n(u), children: /* @__PURE__ */ N(y, { variant: "body2", component: "span", className: "flex gap-2 items-center text-left", children: [
|
|
665
|
-
l && /* @__PURE__ */ m(c, {}),
|
|
666
|
-
r && /* @__PURE__ */ m(W, { text: d, prefix: h })
|
|
667
|
-
] }) }) }, a.key);
|
|
668
|
-
}) }) });
|
|
669
|
-
};
|
|
1
|
+
import { t as o } from "../../../../FlagSelectorList-C17nmEBM.js";
|
|
670
2
|
export {
|
|
671
|
-
|
|
3
|
+
o as FlagSelectorList
|
|
672
4
|
};
|