@konstructio/ui 0.1.2-alpha.101 → 0.1.2-alpha.104
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/README.md +15 -21
- package/dist/{AdditionalOptions-Cj29eeMF.js → AdditionalOptions-D0BAS2HG.js} +1 -1
- package/dist/AlertDialogTrigger-BGo_acd5.js +109 -0
- package/dist/{Breadcrumb-Bmv0vzgt.js → Breadcrumb-Cp3abB2w.js} +1 -1
- package/dist/Checkbox-B_ngk9Dj.js +249 -0
- package/dist/{Combination-cjXRJS03.js → Combination-CnMM05mt.js} +51 -45
- package/dist/{CommandInput-CYYsk_31.js → CommandInput-BLq69pOT.js} +2 -2
- package/dist/Counter-BV680M5r.js +195 -0
- package/dist/{DayPicker-CwO8Zff5.js → DayPicker-kweJz134.js} +750 -746
- package/dist/DropdownButton-DfNojmCW.js +493 -0
- package/dist/FlagSelectorList-CkTR3j6O.js +856 -0
- package/dist/{HamburgerTrigger-7a4POUaM.js → HamburgerTrigger-DRylBL2d.js} +2 -2
- package/dist/{ImageUpload-DZTm4SBB.js → ImageUpload-DiwymQcU.js} +1 -1
- package/dist/{Input-DG3snJf_.js → Input-Cf44DzfE.js} +19 -19
- package/dist/{Loading-fD0Xiyeq.js → Loading-DUh9PMJN.js} +3 -1
- package/dist/Modal-Dyn088X7.js +81 -0
- package/dist/Sidebar.css +1 -1
- package/dist/{Spinner-BegZ5yd7.js → Spinner-CUwE2bLm.js} +1 -1
- package/dist/Switch-aPhL5rNG.js +196 -0
- package/dist/Toast-3NEz7LLa.js +460 -0
- package/dist/Wrapper-BhqUVI1G.js +171 -0
- package/dist/Wrapper-CVJSuYWx.js +114 -0
- package/dist/{Wrapper-DtT29fc5.js → Wrapper-DP6Sxngx.js} +185 -180
- package/dist/components/Alert/Alert.js +22 -22
- package/dist/components/AlertDialog/AlertDialog.js +1 -1
- package/dist/components/AlertDialog/components/AlertDialogTrigger.js +1 -1
- package/dist/components/AlertDialog/components/index.js +1 -1
- package/dist/components/AlertDialog/hooks/useAlertDialog.js +14 -10
- package/dist/components/Autocomplete/components/List/List.js +22 -26
- package/dist/components/Autocomplete/components/List/List.variants.js +7 -19
- package/dist/components/Autocomplete/hooks/useAutocomplete.js +39 -38
- package/dist/components/Autocomplete/hooks/useNavigationList.js +2 -1
- package/dist/components/Badge/Badge.js +37 -36
- package/dist/components/Breadcrumb/Breadcrumb.js +1 -1
- package/dist/components/Button/Button.js +1 -1
- package/dist/components/Checkbox/Checkbox.js +1 -1
- package/dist/components/Command/Command.js +2 -2
- package/dist/components/Command/components/Command.js +6 -6
- package/dist/components/Command/components/CommandEmpty.js +1 -1
- package/dist/components/Command/components/CommandGroup.js +1 -1
- package/dist/components/Command/components/CommandInput.js +1 -1
- package/dist/components/Command/components/CommandItem.js +1 -1
- package/dist/components/Command/components/CommandList.js +2 -2
- package/dist/components/Command/components/CommandSeparator.js +1 -1
- package/dist/components/Command/components/DialogContent.js +3 -3
- package/dist/components/Command/components/DialogOverlay.js +1 -1
- package/dist/components/Command/components/index.js +1 -1
- package/dist/components/Command/contexts/Command.provider.js +16 -12
- package/dist/components/Counter/Counter.js +1 -1
- package/dist/components/DateRangePicker/components/CalendarPanel/components/CalendarMonth/CalendarMonth.js +2 -2
- package/dist/components/DateRangePicker/components/CalendarPanel/components/IndependentModeCalendar/IndependentModeCalendar.js +57 -58
- package/dist/components/DateRangePicker/components/CalendarPanel/components/TogetherModeCalendar/TogetherModeCalendar.js +42 -43
- package/dist/components/DateRangePicker/components/CalendarPanel/constants/dayPickerClassNames.js +1 -1
- package/dist/components/DateRangePicker/components/CalendarPanel/constants/index.js +1 -1
- package/dist/components/DateRangePicker/components/CalendarPanel/hooks/index.js +1 -1
- package/dist/components/DateRangePicker/components/CalendarPanel/hooks/useIndependentCarousel.js +42 -50
- package/dist/components/DateRangePicker/components/CalendarPanel/hooks/useTogetherCarousel.js +61 -79
- package/dist/components/DateRangePicker/components/CalendarPanel/utils/index.js +1 -1
- package/dist/components/DateRangePicker/components/DateTimeInputs/components/EndInputFields/EndInputFields.js +1 -1
- package/dist/components/DateRangePicker/components/DateTimeInputs/components/StartInputFields/StartInputFields.js +1 -1
- package/dist/components/DateRangePicker/components/DateTimeInputs/hooks/useDateTimeInputs.js +89 -122
- package/dist/components/Datepicker/DatePicker.js +15 -16
- package/dist/components/Drawer/Drawer.js +54 -49
- package/dist/components/Drawer/hooks/useDrawer.js +39 -44
- package/dist/components/DropdownButton/DropdownButton.js +1 -1
- package/dist/components/Filter/Filter.js +25 -23
- package/dist/components/Filter/components/BadgeDropdown/BadgeMultiSelect.hook.js +42 -57
- package/dist/components/Filter/components/BadgeDropdown/BadgeMultiSelect.js +60 -65
- package/dist/components/Filter/components/DateFilterDropdown/DateFilterDropdown.hook.js +29 -50
- package/dist/components/Filter/components/DateFilterDropdown/DateFilterDropdown.js +40 -45
- package/dist/components/Filter/components/DateRangeFilterDropdown/DateRangeFilterDropdown.hook.js +35 -49
- package/dist/components/Filter/components/DateRangeFilterDropdown/DateRangeFilterDropdown.js +45 -51
- package/dist/components/Filter/components/FilterDropdown/FilterDropdown.js +28 -0
- package/dist/components/Filter/components/ResetButton/ResetButton.js +21 -18
- package/dist/components/Filter/components/TextMultiSelect/TextMultiSelect.js +56 -61
- package/dist/components/Filter/components/TimeFilterDropdown/TimeFilterDropdown.hook.js +35 -50
- package/dist/components/Filter/components/TimeFilterDropdown/TimeFilterDropdown.js +70 -75
- package/dist/components/Filter/contexts/filter.provider.js +15 -7
- package/dist/components/Filter/events/index.js +26 -5
- package/dist/components/Filter/hooks/index.js +4 -0
- package/dist/components/Filter/hooks/useFilterDropdownSync.js +26 -0
- package/dist/components/Filter/utils/index.js +1 -1
- package/dist/components/ImageUpload/ImageUpload.js +1 -1
- package/dist/components/Input/Input.js +1 -1
- package/dist/components/LineChart/LineChart.js +1 -1
- package/dist/components/Loading/Loading.js +1 -1
- package/dist/components/Modal/Modal.js +1 -1
- package/dist/components/Modal/components/Body/Body.js +1 -1
- package/dist/components/Modal/components/Footer/Footer.js +1 -1
- package/dist/components/Modal/components/Header/Header.js +1 -1
- package/dist/components/Modal/components/Wrapper/Wrapper.js +1 -1
- package/dist/components/Modal/components/index.js +1 -1
- package/dist/components/Modal/contexts/Modal.provider.js +26 -19
- package/dist/components/MultiSelectDropdown/MultiSelectDropdown.js +1 -1
- package/dist/components/MultiSelectDropdown/components/List/List.js +1 -1
- package/dist/components/MultiSelectDropdown/components/Wrapper/Wrapper.js +1 -1
- package/dist/components/MultiSelectDropdown/components/index.js +1 -1
- package/dist/components/MultiSelectDropdown/hooks/useMultiSelectDropdown.js +14 -13
- package/dist/components/PhoneNumberInput/PhoneNumberInput.js +2 -2
- package/dist/components/PhoneNumberInput/components/FlagContent/FlagContent.js +6 -4
- package/dist/components/PhoneNumberInput/components/FlagSelectorList/FlagSelectorList.js +1 -1
- package/dist/components/PhoneNumberInput/components/FlagSelectorWrapper/FlagSelectorWrapper.js +16 -16
- package/dist/components/PhoneNumberInput/components/TruncateText/TruncateText.js +2 -2
- package/dist/components/PhoneNumberInput/components/Wrapper.js +1 -1
- package/dist/components/PhoneNumberInput/components/index.js +2 -2
- package/dist/components/PhoneNumberInput/contexts/index.js +1 -1
- package/dist/components/PhoneNumberInput/contexts/phone-number.provider.js +1 -1
- package/dist/components/PieChart/PieChart.js +33 -32
- package/dist/components/ProgressBar/ProgressBar.js +26 -20
- package/dist/components/Radio/Radio.js +28 -30
- package/dist/components/RadioCardGroup/RadioCardGroup.js +18 -18
- package/dist/components/RadioGroup/RadioGroup.js +24 -24
- package/dist/components/Range/Range.js +15 -13
- package/dist/components/Select/Select.js +2 -2
- package/dist/components/Select/components/AdditionalOptions/AdditionalOptions.js +1 -1
- package/dist/components/Select/components/List/List.js +3 -3
- package/dist/components/Select/components/ListItem/ListItem.js +30 -30
- package/dist/components/Select/components/Wrapper.js +1 -1
- package/dist/components/Select/components/index.js +2 -2
- package/dist/components/Select/hooks/useSelect.js +39 -38
- package/dist/components/Sidebar/Sidebar.js +21 -18
- package/dist/components/Sidebar/components/CollapseTrigger/CollapseTrigger.js +30 -0
- package/dist/components/Sidebar/components/CollapseTrigger/CollapseTrigger.variants.js +20 -0
- package/dist/components/Sidebar/components/HamburgerTrigger/HamburgerTrigger.js +1 -1
- package/dist/components/Sidebar/components/Logo/Logo.js +14 -10
- package/dist/components/Sidebar/components/Logo/Logo.variants.js +14 -4
- package/dist/components/Sidebar/components/NavigationOption/NavigationOption.js +41 -37
- package/dist/components/Sidebar/components/NavigationOption/NavigationOption.variants.js +4 -5
- package/dist/components/Sidebar/components/Wrapper/Wrapper.js +75 -68
- package/dist/components/Sidebar/components/index.js +17 -15
- package/dist/components/Sidebar/contexts/SidebarContext.js +8 -5
- package/dist/components/Slider/Slider.js +17 -15
- package/dist/components/Spinner/Spinner.js +1 -1
- package/dist/components/Stepper/Stepper.variants.js +6 -6
- package/dist/components/Stepper/hooks/useStepItemLogic.js +12 -17
- package/dist/components/Switch/Switch.js +1 -1
- package/dist/components/Table/components/Filter.js +1 -1
- package/dist/components/Tabs/Tabs.js +1 -1
- package/dist/components/Tabs/Tabs.variants.js +1 -1
- package/dist/components/Tabs/components/Content.js +1 -1
- package/dist/components/Tabs/components/List.js +1 -1
- package/dist/components/Tabs/components/Trigger.js +1 -1
- package/dist/components/Tag/Tag.js +1 -1
- package/dist/components/Tag/Tag.variants.js +17 -17
- package/dist/components/TagSelect/TagSelect.js +1 -1
- package/dist/components/TagSelect/components/Wrapper/Wrapper.js +1 -1
- package/dist/components/TagSelect/components/index.js +1 -1
- package/dist/components/TagSelect/hooks/useTagSelect.js +12 -11
- package/dist/components/TimePicker/components/HoursList/HoursList.js +34 -38
- package/dist/components/TimePicker/components/MeridianList/MeridianList.js +25 -29
- package/dist/components/TimePicker/components/MinutesList/MinutesList.js +33 -33
- package/dist/components/TimePicker/components/Wrapper/Wrapper.js +91 -99
- package/dist/components/TimePicker/components/WrapperList/WrapperList.js +29 -30
- package/dist/components/TimePicker/contexts/time-picker.provider.js +10 -10
- package/dist/components/Toast/Toast.js +1 -1
- package/dist/components/Toast/Toast.variants.js +1 -1
- package/dist/components/Tooltip/Tooltip.js +1 -1
- package/dist/components/VirtualizedTable/VirtualizedTable.js +92 -89
- package/dist/components/VirtualizedTable/components/Actions/Actions.js +19 -21
- package/dist/components/VirtualizedTable/components/Body/Body.js +50 -49
- package/dist/components/VirtualizedTable/components/DropdownPaginate/DropdownPaginate.js +67 -21
- package/dist/components/VirtualizedTable/components/ExpandableRow/ExpandableRow.js +1 -1
- package/dist/components/VirtualizedTable/components/Filter/Filter.js +67 -75
- package/dist/components/VirtualizedTable/components/FormPaginate/FormPaginate.js +10 -10
- package/dist/components/VirtualizedTable/components/Header/Header.js +47 -34
- package/dist/components/VirtualizedTable/components/Pagination/Pagination.js +19 -15
- package/dist/components/VirtualizedTable/components/Skeleton/Skeleton.js +10 -10
- package/dist/components/VirtualizedTable/components/TruncateText/TruncateText.js +1 -1
- package/dist/components/VirtualizedTable/components/WrapperBody/WrapperBody.js +8 -8
- package/dist/components/VirtualizedTable/contexts/index.js +1 -1
- package/dist/components/VirtualizedTable/contexts/table.context.js +1 -0
- package/dist/components/VirtualizedTable/contexts/table.provider.js +1 -1
- package/dist/components/VirtualizedTable/events/filters/filters.js +7 -0
- package/dist/components/VirtualizedTable/events/index.js +10 -25
- package/dist/components/VirtualizedTable/events/refresh/refresh.js +7 -0
- package/dist/components/VirtualizedTable/events/row/row.js +22 -0
- package/dist/components/VirtualizedTable/utils/get-table-id.js +4 -0
- package/dist/components/VirtualizedTable/utils/index.js +4 -2
- package/dist/components/index.js +96 -90
- package/dist/{components-CYt24H4n.js → components-Cf345jTv.js} +45 -41
- package/dist/constants-CxJJRVK3.js +31 -0
- package/dist/{debounce-KoeGNmnW.js → debounce-C5Ycjilj.js} +14 -14
- package/dist/dist-BUocnzkM.js +99 -0
- package/dist/{dist-DGO9opgu.js → dist-BZNE2Tnx.js} +51 -51
- package/dist/dist-BaPW7qXd2.js +166 -0
- package/dist/dist-BdobXn93.js +192 -0
- package/dist/dist-BlPTJNIm.js +118 -0
- package/dist/dist-C3YVLapk.js +194 -0
- package/dist/dist-C4j75TwZ.js +20 -0
- package/dist/dist-CCdbu9GU.js +46 -0
- package/dist/dist-CzKqHuqJ2.js +427 -0
- package/dist/dist-D-yS0HN8.js +228 -0
- package/dist/dist-D5XYRjmR.js +15 -0
- package/dist/dist-DDck_2lb.js +451 -0
- package/dist/dist-DFCz63oC2.js +1320 -0
- package/dist/dist-DGOjiAnB2.js +14 -0
- package/dist/dist-DKryKPmP.js +193 -0
- package/dist/dist-DX0sBG3Q.js +31 -0
- package/dist/dist-DYIabsrY.js +17 -0
- package/dist/dist-pWlMx4Fi2.js +36 -0
- package/dist/dist-tGUUcv8n.js +359 -0
- package/dist/dist-xCbHbMLA.js +116 -0
- package/dist/es2015-CoHq2g4y.js +231 -0
- package/dist/es2015-DigR3dar.js +795 -0
- package/dist/events.types-BG1Uh8i6.js +6 -0
- package/dist/hooks/index.js +6 -4
- package/dist/hooks/useClickOutside.js +14 -0
- package/dist/index.js +147 -139
- package/dist/{isObject-1ZmdWuhC.js → isObject-BeFFiVJK.js} +8 -8
- package/dist/lib/components/Alert/Alert.types.d.ts +1 -1
- package/dist/lib/components/AlertDialog/AlertDialog.types.d.ts +1 -1
- package/dist/lib/components/AlertDialog/components/AlertDialogTrigger.types.d.ts +2 -2
- package/dist/lib/components/Autocomplete/Autocomplete.types.d.ts +1 -1
- package/dist/lib/components/Autocomplete/components/List/List.variants.d.ts +0 -1
- package/dist/lib/components/Breadcrumb/Breadcrumb.types.d.ts +1 -1
- package/dist/lib/components/Breadcrumb/components/BackButton/BackButton.types.d.ts +1 -1
- package/dist/lib/components/Breadcrumb/components/Item/Item.types.d.ts +1 -1
- package/dist/lib/components/Button/Button.types.d.ts +1 -1
- package/dist/lib/components/ButtonGroup/ButtonGroup.types.d.ts +1 -1
- package/dist/lib/components/Card/Card.types.d.ts +1 -1
- package/dist/lib/components/Checkbox/Checkbox.types.d.ts +1 -1
- package/dist/lib/components/Command/Command.types.d.ts +1 -1
- package/dist/lib/components/Counter/Counter.types.d.ts +1 -1
- package/dist/lib/components/DateRangePicker/DateRangePicker.types.d.ts +1 -1
- package/dist/lib/components/Drawer/Drawer.types.d.ts +1 -1
- package/dist/lib/components/DropdownButton/DropdownButton.d.ts +5 -6
- package/dist/lib/components/DropdownButton/DropdownButton.types.d.ts +2 -0
- package/dist/lib/components/Filter/Filter.types.d.ts +3 -1
- package/dist/lib/components/Filter/components/BadgeDropdown/BadgeMultiSelect.hook.d.ts +2 -3
- package/dist/lib/components/Filter/components/DateFilterDropdown/DateFilterDropdown.hook.d.ts +1 -2
- package/dist/lib/components/Filter/components/DateRangeFilterDropdown/DateRangeFilterDropdown.hook.d.ts +2 -3
- package/dist/lib/components/Filter/components/DateRangeFilterDropdown/DateRangeFilterDropdown.types.d.ts +1 -1
- package/dist/lib/components/Filter/components/FilterDropdown/FilterDropdown.d.ts +3 -0
- package/dist/lib/components/Filter/components/FilterDropdown/FilterDropdown.types.d.ts +9 -0
- package/dist/lib/components/Filter/components/ResetButton/ResetButton.types.d.ts +1 -1
- package/dist/lib/components/Filter/components/TimeFilterDropdown/TimeFilterDropdown.hook.d.ts +1 -2
- package/dist/lib/components/Filter/contexts/filter.context.d.ts +2 -0
- package/dist/lib/components/Filter/events/index.d.ts +10 -2
- package/dist/lib/components/Filter/hooks/index.d.ts +1 -0
- package/dist/lib/components/Filter/hooks/useFilterDropdownSync.d.ts +2 -0
- package/dist/lib/components/Filter/hooks/useFilterDropdownSync.types.d.ts +5 -0
- package/dist/lib/components/ImageUpload/ImageUpload.types.d.ts +1 -1
- package/dist/lib/components/Input/Input.types.d.ts +1 -1
- package/dist/lib/components/LineChart/LineChart.types.d.ts +1 -1
- package/dist/lib/components/Loading/Loading.types.d.ts +1 -1
- package/dist/lib/components/Modal/Modal.types.d.ts +1 -1
- package/dist/lib/components/Modal/components/Wrapper/Wrapper.types.d.ts +1 -1
- package/dist/lib/components/MultiSelectDropdown/components/Item/Item.types.d.ts +1 -1
- package/dist/lib/components/MultiSelectDropdown/components/List/List.types.d.ts +1 -1
- package/dist/lib/components/MultiSelectDropdown/components/Wrapper/Wrapper.types.d.ts +1 -1
- package/dist/lib/components/PieChart/PieChart.types.d.ts +4 -4
- package/dist/lib/components/ProgressBar/ProgressBar.types.d.ts +3 -1
- package/dist/lib/components/Radio/Radio.types.d.ts +1 -1
- package/dist/lib/components/RadioCard/RadioCard.types.d.ts +1 -1
- package/dist/lib/components/RadioCardGroup/RadioCardGroup.types.d.ts +1 -1
- package/dist/lib/components/RadioGroup/RadioGroup.types.d.ts +1 -1
- package/dist/lib/components/Range/Range.types.d.ts +1 -1
- package/dist/lib/components/Select/Select.types.d.ts +1 -1
- package/dist/lib/components/Select/hooks/useSelect.d.ts +2 -1
- package/dist/lib/components/Sidebar/Sidebar.d.ts +2 -2
- package/dist/lib/components/Sidebar/Sidebar.types.d.ts +8 -7
- package/dist/lib/components/Sidebar/components/CollapseTrigger/CollapseTrigger.d.ts +4 -0
- package/dist/lib/components/Sidebar/components/CollapseTrigger/CollapseTrigger.types.d.ts +4 -0
- package/dist/lib/components/Sidebar/components/CollapseTrigger/CollapseTrigger.variants.d.ts +1 -0
- package/dist/lib/components/Sidebar/components/Label/Label.types.d.ts +1 -1
- package/dist/lib/components/Sidebar/components/Logo/Logo.types.d.ts +8 -0
- package/dist/lib/components/Sidebar/components/Logo/Logo.variants.d.ts +3 -1
- package/dist/lib/components/Sidebar/components/index.d.ts +2 -0
- package/dist/lib/components/Sidebar/contexts/SidebarContext.d.ts +12 -0
- package/dist/lib/components/Slider/Slider.types.d.ts +1 -1
- package/dist/lib/components/Spinner/Spinner.types.d.ts +2 -2
- package/dist/lib/components/Stepper/Stepper.types.d.ts +1 -1
- package/dist/lib/components/Stepper/components/StepItem/StepItem.types.d.ts +1 -1
- package/dist/lib/components/Switch/Switch.types.d.ts +1 -1
- package/dist/lib/components/Table/Table.types.d.ts +1 -1
- package/dist/lib/components/Tabs/Tabs.types.d.ts +1 -1
- package/dist/lib/components/TagSelect/TagSelect.types.d.ts +1 -1
- package/dist/lib/components/TagSelect/components/Item/Item.types.d.ts +2 -2
- package/dist/lib/components/TagSelect/components/List/List.types.d.ts +1 -1
- package/dist/lib/components/TagSelect/components/Wrapper/Wrapper.types.d.ts +1 -1
- package/dist/lib/components/TagSelect/contexts/TagSelect.types.d.ts +1 -1
- package/dist/lib/components/TextArea/TextArea.types.d.ts +1 -1
- package/dist/lib/components/Toast/Toast.types.d.ts +1 -1
- package/dist/lib/components/Typography/Typography.types.d.ts +1 -1
- package/dist/lib/components/VirtualizedTable/VirtualizedTable.d.ts +1 -0
- package/dist/lib/components/VirtualizedTable/VirtualizedTable.types.d.ts +27 -3
- package/dist/lib/components/VirtualizedTable/components/Body/Body.d.ts +1 -1
- package/dist/lib/components/VirtualizedTable/components/Body/Body.types.d.ts +1 -0
- package/dist/lib/components/VirtualizedTable/components/DropdownPaginate/DropdownPaginate.types.d.ts +2 -0
- package/dist/lib/components/VirtualizedTable/components/Filter/Filter.types.d.ts +1 -1
- package/dist/lib/components/VirtualizedTable/components/Header/Header.d.ts +1 -1
- package/dist/lib/components/VirtualizedTable/components/Header/Header.types.d.ts +1 -0
- package/dist/lib/components/VirtualizedTable/components/Pagination/Pagination.types.d.ts +2 -0
- package/dist/lib/components/VirtualizedTable/components/TruncateText/TruncateText.types.d.ts +1 -1
- package/dist/lib/components/VirtualizedTable/contexts/table.context.d.ts +2 -0
- package/dist/lib/components/VirtualizedTable/contexts/table.provider.d.ts +1 -1
- package/dist/lib/components/VirtualizedTable/contexts/table.types.d.ts +1 -0
- package/dist/lib/components/VirtualizedTable/events/events.types.d.ts +11 -0
- package/dist/lib/components/VirtualizedTable/events/filters/filters.d.ts +1 -0
- package/dist/lib/components/VirtualizedTable/events/index.d.ts +4 -14
- package/dist/lib/components/VirtualizedTable/events/refresh/refresh.d.ts +2 -0
- package/dist/lib/components/VirtualizedTable/events/refresh/refresh.types.d.ts +3 -0
- package/dist/lib/components/VirtualizedTable/events/row/row.d.ts +3 -0
- package/dist/lib/components/VirtualizedTable/utils/get-table-id.d.ts +1 -0
- package/dist/lib/components/VirtualizedTable/utils/index.d.ts +1 -0
- package/dist/lib/components/index.d.ts +2 -2
- package/dist/lib/contexts/theme.context.d.ts +1 -1
- package/dist/lib/contexts/theme.hook.d.ts +1 -1
- package/dist/lib/hooks/index.d.ts +1 -0
- package/dist/lib/hooks/useClickOutside.d.ts +2 -0
- package/dist/package.json +38 -37
- package/dist/{phone-number.provider-CJJOFYk-.js → phone-number.provider-BxQCTxp8.js} +457 -457
- package/dist/{prop-types-CaJpPVsa.js → prop-types-CfEYxTbR.js} +52 -52
- package/dist/styles.css +1 -1
- package/dist/{table.provider-9uUt5a-s.js → table.provider-B0BafHuU.js} +429 -388
- package/dist/ui/civo-theme.css +4 -0
- package/dist/ui/kubefirst-theme.css +4 -0
- package/dist/{utils-B6A9pnrH.js → utils-B-BTGYA5.js} +193 -193
- package/dist/{x-CESTrenk.js → x-BI9jmc7e.js} +1 -1
- package/package.json +38 -37
- package/dist/AlertDialogTrigger-HhbFOOUE.js +0 -124
- package/dist/Checkbox-B1rTwzR3.js +0 -240
- package/dist/Counter-DWKyr569.js +0 -208
- package/dist/DropdownButton-Beel5_gN.js +0 -92
- package/dist/FlagSelectorList-BARhzfj2.js +0 -848
- package/dist/Modal-Bcu6LLAp.js +0 -76
- package/dist/Switch-1RGhhTtg.js +0 -178
- package/dist/Toast-CS-igZor.js +0 -467
- package/dist/Wrapper-DNEn4fef.js +0 -161
- package/dist/Wrapper-DwxJAkNQ.js +0 -110
- package/dist/constants-DXrF9vV4.js +0 -31
- package/dist/dist-7edduNXi.js +0 -398
- package/dist/dist-B-Aoze_D.js +0 -10
- package/dist/dist-BkYHh2kH.js +0 -408
- package/dist/dist-C6Cif8-U.js +0 -28
- package/dist/dist-C8NWUTUh.js +0 -62
- package/dist/dist-CVy-ulDZ.js +0 -42
- package/dist/dist-CeuUxVmT.js +0 -13
- package/dist/dist-CfYOvauX.js +0 -125
- package/dist/dist-CktbIsHq.js +0 -264
- package/dist/dist-DGqWMRtc.js +0 -183
- package/dist/dist-DdFwUrO22.js +0 -11
- package/dist/dist-DnGj9MTf.js +0 -1692
- package/dist/dist-DqKFpce5.js +0 -98
- package/dist/dist-DvoMuWKO2.js +0 -31
- package/dist/dist-eAwtFCCA.js +0 -87
- package/dist/dist-ppXKUlVt.js +0 -10
- /package/dist/{dist-AihTpWdF2.js → dist-AihTpWdF.js} +0 -0
- /package/dist/{x-a_LpoXzG.js → x-a_LpoXzG2.js} +0 -0
|
@@ -0,0 +1,856 @@
|
|
|
1
|
+
import { t as N } from "./utils-Cx-WzRZF.js";
|
|
2
|
+
import { Typography as W } from "./components/Typography/Typography.js";
|
|
3
|
+
import { usePhoneNumberContext as K } from "./components/PhoneNumberInput/contexts/phone-number.hook.js";
|
|
4
|
+
import { TruncateText as $ } from "./components/PhoneNumberInput/components/TruncateText/TruncateText.js";
|
|
5
|
+
import * as M from "react";
|
|
6
|
+
import { useEffect as B, useMemo as H, useRef as J } from "react";
|
|
7
|
+
import { flushSync as q } from "react-dom";
|
|
8
|
+
import { jsx as x, jsxs as U } from "react/jsx-runtime";
|
|
9
|
+
function G(l, t, e) {
|
|
10
|
+
const s = new Array(l);
|
|
11
|
+
return new Proxy(s, { get(i, n, o) {
|
|
12
|
+
if (typeof n == "string") {
|
|
13
|
+
const h = n.charCodeAt(0);
|
|
14
|
+
if (h >= 48 && h <= 57) {
|
|
15
|
+
const a = +n;
|
|
16
|
+
if (Number.isInteger(a) && a >= 0 && a < l) {
|
|
17
|
+
let d = i[a];
|
|
18
|
+
if (!d) {
|
|
19
|
+
const c = t[a * 2];
|
|
20
|
+
d = i[a] = {
|
|
21
|
+
index: a,
|
|
22
|
+
key: e(a),
|
|
23
|
+
start: c,
|
|
24
|
+
size: t[a * 2 + 1],
|
|
25
|
+
end: c + t[a * 2 + 1],
|
|
26
|
+
lane: 0
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
return d;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
if (n === "length") return l;
|
|
33
|
+
}
|
|
34
|
+
return Reflect.get(i, n, o);
|
|
35
|
+
} });
|
|
36
|
+
}
|
|
37
|
+
function I(l, t, e) {
|
|
38
|
+
let s = e.initialDeps ?? [], i, n = !0;
|
|
39
|
+
function o() {
|
|
40
|
+
var h;
|
|
41
|
+
const a = process.env.NODE_ENV !== "production" && !!e.key && !!((h = e.debug) != null && h.call(e));
|
|
42
|
+
let d = 0;
|
|
43
|
+
a && (d = Date.now());
|
|
44
|
+
const c = l();
|
|
45
|
+
if (!(c.length !== s.length || c.some((f, m) => s[m] !== f))) return i;
|
|
46
|
+
s = c;
|
|
47
|
+
let r = 0;
|
|
48
|
+
if (a && (r = Date.now()), i = t(...c), a) {
|
|
49
|
+
const f = Math.round((Date.now() - d) * 100) / 100, m = Math.round((Date.now() - r) * 100) / 100, S = m / 16, p = (u, g) => {
|
|
50
|
+
for (u = String(u); u.length < g; ) u = " " + u;
|
|
51
|
+
return u;
|
|
52
|
+
};
|
|
53
|
+
console.info(`%c⏱ ${p(m, 5)} /${p(f, 5)} ms`, `
|
|
54
|
+
font-size: .6rem;
|
|
55
|
+
font-weight: bold;
|
|
56
|
+
color: hsl(${Math.max(0, Math.min(120 - 120 * S, 120))}deg 100% 31%);`, e?.key);
|
|
57
|
+
}
|
|
58
|
+
return e?.onChange && !(n && e.skipInitialOnChange) && e.onChange(i), n = !1, i;
|
|
59
|
+
}
|
|
60
|
+
return o.updateDeps = (h) => {
|
|
61
|
+
s = h;
|
|
62
|
+
}, o;
|
|
63
|
+
}
|
|
64
|
+
function L(l, t) {
|
|
65
|
+
if (l === void 0) throw new Error(`Unexpected undefined${t ? `: ${t}` : ""}`);
|
|
66
|
+
return l;
|
|
67
|
+
}
|
|
68
|
+
var Q = (l, t) => Math.abs(l - t) < 1.01, X = (l, t, e) => {
|
|
69
|
+
let s;
|
|
70
|
+
return function(...i) {
|
|
71
|
+
l.clearTimeout(s), s = l.setTimeout(() => t.apply(this, i), e);
|
|
72
|
+
};
|
|
73
|
+
}, T, D = () => {
|
|
74
|
+
if (T !== void 0) return T;
|
|
75
|
+
if (typeof navigator > "u") return T = !1;
|
|
76
|
+
if (/iP(hone|od|ad)/.test(navigator.userAgent)) return T = !0;
|
|
77
|
+
const l = navigator.maxTouchPoints;
|
|
78
|
+
return T = navigator.platform === "MacIntel" && l !== void 0 && l > 0;
|
|
79
|
+
}, V = (l) => {
|
|
80
|
+
const { offsetWidth: t, offsetHeight: e } = l;
|
|
81
|
+
return {
|
|
82
|
+
width: t,
|
|
83
|
+
height: e
|
|
84
|
+
};
|
|
85
|
+
}, Y = (l) => l, Z = (l) => {
|
|
86
|
+
const t = Math.max(l.startIndex - l.overscan, 0), e = Math.min(l.endIndex + l.overscan, l.count - 1) - t + 1, s = new Array(e);
|
|
87
|
+
for (let i = 0; i < e; i++) s[i] = t + i;
|
|
88
|
+
return s;
|
|
89
|
+
}, tt = (l, t) => {
|
|
90
|
+
const e = l.scrollElement;
|
|
91
|
+
if (!e) return;
|
|
92
|
+
const s = l.targetWindow;
|
|
93
|
+
if (!s) return;
|
|
94
|
+
const i = (o) => {
|
|
95
|
+
const { width: h, height: a } = o;
|
|
96
|
+
t({
|
|
97
|
+
width: Math.round(h),
|
|
98
|
+
height: Math.round(a)
|
|
99
|
+
});
|
|
100
|
+
};
|
|
101
|
+
if (i(V(e)), !s.ResizeObserver) return () => {
|
|
102
|
+
};
|
|
103
|
+
const n = new s.ResizeObserver((o) => {
|
|
104
|
+
const h = () => {
|
|
105
|
+
const a = o[0];
|
|
106
|
+
if (a?.borderBoxSize) {
|
|
107
|
+
const d = a.borderBoxSize[0];
|
|
108
|
+
if (d) {
|
|
109
|
+
i({
|
|
110
|
+
width: d.inlineSize,
|
|
111
|
+
height: d.blockSize
|
|
112
|
+
});
|
|
113
|
+
return;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
i(V(e));
|
|
117
|
+
};
|
|
118
|
+
l.options.useAnimationFrameWithResizeObserver ? requestAnimationFrame(h) : h();
|
|
119
|
+
});
|
|
120
|
+
return n.observe(e, { box: "border-box" }), () => {
|
|
121
|
+
n.unobserve(e);
|
|
122
|
+
};
|
|
123
|
+
}, C = { passive: !0 }, et = typeof window > "u" ? !0 : "onscrollend" in window, st = (l, t, e) => {
|
|
124
|
+
const s = l.scrollElement;
|
|
125
|
+
if (!s) return;
|
|
126
|
+
const i = l.targetWindow;
|
|
127
|
+
if (!i) return;
|
|
128
|
+
const n = l.options.useScrollendEvent && et;
|
|
129
|
+
let o = 0;
|
|
130
|
+
const h = n ? null : X(i, () => t(o, !1), l.options.isScrollingResetDelay), a = (r) => () => {
|
|
131
|
+
o = e(s), h?.(), t(o, r);
|
|
132
|
+
}, d = a(!0), c = a(!1);
|
|
133
|
+
return s.addEventListener("scroll", d, C), n && s.addEventListener("scrollend", c, C), () => {
|
|
134
|
+
s.removeEventListener("scroll", d), n && s.removeEventListener("scrollend", c);
|
|
135
|
+
};
|
|
136
|
+
}, it = (l, t) => st(l, t, (e) => {
|
|
137
|
+
const { horizontal: s, isRtl: i } = l.options;
|
|
138
|
+
return s ? e.scrollLeft * (i && -1 || 1) : e.scrollTop;
|
|
139
|
+
}), nt = (l, t, e) => {
|
|
140
|
+
if (e.options.useCachedMeasurements) {
|
|
141
|
+
const s = e.indexFromElement(l), i = e.options.getItemKey(s);
|
|
142
|
+
return e.itemSizeCache.get(i) ?? e.options.estimateSize(s);
|
|
143
|
+
}
|
|
144
|
+
if (t?.borderBoxSize) {
|
|
145
|
+
const s = t.borderBoxSize[0];
|
|
146
|
+
if (s) return Math.round(s[e.options.horizontal ? "inlineSize" : "blockSize"]);
|
|
147
|
+
}
|
|
148
|
+
if (!t) {
|
|
149
|
+
const s = e.indexFromElement(l), i = e.options.getItemKey(s), n = e.itemSizeCache.get(i);
|
|
150
|
+
if (n !== void 0) return n;
|
|
151
|
+
}
|
|
152
|
+
return l[e.options.horizontal ? "offsetWidth" : "offsetHeight"];
|
|
153
|
+
}, ot = (l, { adjustments: t = 0, behavior: e }, s) => {
|
|
154
|
+
var i, n;
|
|
155
|
+
(n = (i = s.scrollElement) == null ? void 0 : i.scrollTo) == null || n.call(i, {
|
|
156
|
+
[s.options.horizontal ? "left" : "top"]: l + t,
|
|
157
|
+
behavior: e
|
|
158
|
+
});
|
|
159
|
+
}, lt = ot, rt = class {
|
|
160
|
+
constructor(l) {
|
|
161
|
+
this.unsubs = [], this.scrollElement = null, this.targetWindow = null, this.isScrolling = !1, this.scrollState = null, this.measurementsCache = [], this._flatMeasurements = null, this.itemSizeCache = /* @__PURE__ */ new Map(), this.itemSizeCacheVersion = 0, this.laneAssignments = /* @__PURE__ */ new Map(), this.pendingMin = null, this.prevLanes = void 0, this.lanesChangedFlag = !1, this.lanesSettling = !1, this.pendingScrollAnchor = null, this.scrollRect = null, this.scrollOffset = null, this.scrollDirection = null, this.scrollAdjustments = 0, this._iosDeferredAdjustment = 0, this._iosTouching = !1, this._iosJustTouchEnded = !1, this._iosTouchEndTimerId = null, this._intendedScrollOffset = null, this.elementsCache = /* @__PURE__ */ new Map(), this.now = () => {
|
|
162
|
+
var t, e, s;
|
|
163
|
+
return ((s = (e = (t = this.targetWindow) == null ? void 0 : t.performance) == null ? void 0 : e.now) == null ? void 0 : s.call(e)) ?? Date.now();
|
|
164
|
+
}, this.observer = /* @__PURE__ */ (() => {
|
|
165
|
+
let t = null;
|
|
166
|
+
const e = () => t || (!this.targetWindow || !this.targetWindow.ResizeObserver ? null : t = new this.targetWindow.ResizeObserver((s) => {
|
|
167
|
+
s.forEach((i) => {
|
|
168
|
+
const n = () => {
|
|
169
|
+
const o = i.target, h = this.indexFromElement(o);
|
|
170
|
+
if (!o.isConnected) {
|
|
171
|
+
this.observer.unobserve(o);
|
|
172
|
+
for (const [a, d] of this.elementsCache) if (d === o) {
|
|
173
|
+
this.elementsCache.delete(a);
|
|
174
|
+
break;
|
|
175
|
+
}
|
|
176
|
+
return;
|
|
177
|
+
}
|
|
178
|
+
this.shouldMeasureDuringScroll(h) && this.resizeItem(h, this.options.measureElement(o, i, this));
|
|
179
|
+
};
|
|
180
|
+
this.options.useAnimationFrameWithResizeObserver ? requestAnimationFrame(n) : n();
|
|
181
|
+
});
|
|
182
|
+
}));
|
|
183
|
+
return {
|
|
184
|
+
disconnect: () => {
|
|
185
|
+
var s;
|
|
186
|
+
(s = e()) == null || s.disconnect(), t = null;
|
|
187
|
+
},
|
|
188
|
+
observe: (s) => {
|
|
189
|
+
var i;
|
|
190
|
+
return (i = e()) == null ? void 0 : i.observe(s, { box: "border-box" });
|
|
191
|
+
},
|
|
192
|
+
unobserve: (s) => {
|
|
193
|
+
var i;
|
|
194
|
+
return (i = e()) == null ? void 0 : i.unobserve(s);
|
|
195
|
+
}
|
|
196
|
+
};
|
|
197
|
+
})(), this.range = null, this.setOptions = (t) => {
|
|
198
|
+
var e, s;
|
|
199
|
+
const i = {
|
|
200
|
+
debug: !1,
|
|
201
|
+
initialOffset: 0,
|
|
202
|
+
overscan: 1,
|
|
203
|
+
paddingStart: 0,
|
|
204
|
+
paddingEnd: 0,
|
|
205
|
+
scrollPaddingStart: 0,
|
|
206
|
+
scrollPaddingEnd: 0,
|
|
207
|
+
horizontal: !1,
|
|
208
|
+
getItemKey: Y,
|
|
209
|
+
rangeExtractor: Z,
|
|
210
|
+
onChange: () => {
|
|
211
|
+
},
|
|
212
|
+
measureElement: nt,
|
|
213
|
+
initialRect: {
|
|
214
|
+
width: 0,
|
|
215
|
+
height: 0
|
|
216
|
+
},
|
|
217
|
+
scrollMargin: 0,
|
|
218
|
+
gap: 0,
|
|
219
|
+
indexAttribute: "data-index",
|
|
220
|
+
initialMeasurementsCache: [],
|
|
221
|
+
lanes: 1,
|
|
222
|
+
anchorTo: "start",
|
|
223
|
+
followOnAppend: !1,
|
|
224
|
+
scrollEndThreshold: 1,
|
|
225
|
+
isScrollingResetDelay: 150,
|
|
226
|
+
enabled: !0,
|
|
227
|
+
isRtl: !1,
|
|
228
|
+
useScrollendEvent: !1,
|
|
229
|
+
useAnimationFrameWithResizeObserver: !1,
|
|
230
|
+
laneAssignmentMode: "estimate",
|
|
231
|
+
useCachedMeasurements: !1
|
|
232
|
+
};
|
|
233
|
+
for (const r in t) {
|
|
234
|
+
const f = t[r];
|
|
235
|
+
f !== void 0 && (i[r] = f);
|
|
236
|
+
}
|
|
237
|
+
const n = this.options;
|
|
238
|
+
let o = null, h = null, a = !1;
|
|
239
|
+
if (n !== void 0 && n.enabled && i.enabled && i.anchorTo === "end" && this.scrollElement !== null) {
|
|
240
|
+
const r = n.count, f = i.count, m = this.getMeasurements(), S = r > 0 ? ((e = m[0]) == null ? void 0 : e.key) ?? n.getItemKey(0) : null, p = r > 0 ? ((s = m[r - 1]) == null ? void 0 : s.key) ?? n.getItemKey(r - 1) : null;
|
|
241
|
+
if (f !== r || r > 0 && f > 0 && (i.getItemKey(0) !== S || i.getItemKey(f - 1) !== p)) {
|
|
242
|
+
a = !0;
|
|
243
|
+
const u = r > 0 ? this.getVirtualItemForOffset(this.getScrollOffset()) ?? m[0] : null;
|
|
244
|
+
u && (o = [u.key, this.getScrollOffset() - u.start]);
|
|
245
|
+
const g = i.followOnAppend === !0 ? "auto" : i.followOnAppend || null;
|
|
246
|
+
g && f > r && this.isAtEnd(n.scrollEndThreshold) && (r === 0 || i.getItemKey(f - 1) !== p) && (h = g);
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
this.options = i, a && (this.pendingMin = 0, this.itemSizeCacheVersion++);
|
|
250
|
+
let d = !1, c = 0;
|
|
251
|
+
if (o && this.scrollOffset !== null) {
|
|
252
|
+
const [r, f] = o, m = this.getMeasurements(), { count: S, getItemKey: p } = this.options;
|
|
253
|
+
let u = 0;
|
|
254
|
+
for (; u < S && p(u) !== r; ) u++;
|
|
255
|
+
if (u < S) {
|
|
256
|
+
const g = m[u];
|
|
257
|
+
if (g) {
|
|
258
|
+
const E = Math.max(0, g.start + f);
|
|
259
|
+
E !== this.scrollOffset && (c = E - this.scrollOffset, this.scrollOffset = E, d = !0);
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
(d || h) && (this.pendingScrollAnchor = [
|
|
264
|
+
d ? o[0] : null,
|
|
265
|
+
d ? o[1] : 0,
|
|
266
|
+
h,
|
|
267
|
+
c
|
|
268
|
+
]);
|
|
269
|
+
}, this.notify = (t) => {
|
|
270
|
+
var e, s;
|
|
271
|
+
(s = (e = this.options).onChange) == null || s.call(e, this, t);
|
|
272
|
+
}, this.maybeNotify = I(() => (this.calculateRange(), [
|
|
273
|
+
this.isScrolling,
|
|
274
|
+
this.range ? this.range.startIndex : null,
|
|
275
|
+
this.range ? this.range.endIndex : null
|
|
276
|
+
]), (t) => {
|
|
277
|
+
this.notify(t);
|
|
278
|
+
}, {
|
|
279
|
+
key: process.env.NODE_ENV !== "production" && "maybeNotify",
|
|
280
|
+
debug: () => this.options.debug,
|
|
281
|
+
initialDeps: [
|
|
282
|
+
this.isScrolling,
|
|
283
|
+
this.range ? this.range.startIndex : null,
|
|
284
|
+
this.range ? this.range.endIndex : null
|
|
285
|
+
]
|
|
286
|
+
}), this.cleanup = () => {
|
|
287
|
+
this.unsubs.filter(Boolean).forEach((t) => t()), this.unsubs = [], this.observer.disconnect(), this.rafId != null && this.targetWindow && (this.targetWindow.cancelAnimationFrame(this.rafId), this.rafId = null), this.scrollState = null, this._iosDeferredAdjustment = 0, this._iosTouching = !1, this._iosJustTouchEnded = !1, this.scrollElement = null, this.targetWindow = null;
|
|
288
|
+
}, this._didMount = () => () => {
|
|
289
|
+
this.cleanup();
|
|
290
|
+
}, this._willUpdate = () => {
|
|
291
|
+
var t;
|
|
292
|
+
const e = this.options.enabled ? this.options.getScrollElement() : null;
|
|
293
|
+
if (this.scrollElement !== e) {
|
|
294
|
+
if (this.cleanup(), !e) {
|
|
295
|
+
this.maybeNotify();
|
|
296
|
+
return;
|
|
297
|
+
}
|
|
298
|
+
if (this.scrollElement = e, this.scrollElement && "ownerDocument" in this.scrollElement ? this.targetWindow = this.scrollElement.ownerDocument.defaultView : this.targetWindow = ((t = this.scrollElement) == null ? void 0 : t.window) ?? null, this.elementsCache.forEach((i) => {
|
|
299
|
+
this.observer.observe(i);
|
|
300
|
+
}), this.unsubs.push(this.options.observeElementRect(this, (i) => {
|
|
301
|
+
this.scrollRect = i, this.maybeNotify();
|
|
302
|
+
})), this.unsubs.push(this.options.observeElementOffset(this, (i, n) => {
|
|
303
|
+
if (n && this._intendedScrollOffset === null && i === this.scrollOffset) return;
|
|
304
|
+
this._intendedScrollOffset !== null && Math.abs(i - this._intendedScrollOffset) < 1.5 && (i = this._intendedScrollOffset), this._intendedScrollOffset = null, this.scrollAdjustments = 0;
|
|
305
|
+
const o = this.getScrollOffset();
|
|
306
|
+
this.scrollDirection = n ? o === i ? this.scrollDirection : o < i ? "forward" : "backward" : null, this.scrollOffset = i, this.isScrolling = n, this._flushIosDeferredIfReady(), this.scrollState && this.scheduleScrollReconcile(), this.maybeNotify();
|
|
307
|
+
})), "addEventListener" in this.scrollElement) {
|
|
308
|
+
const i = this.scrollElement, n = () => {
|
|
309
|
+
this._iosTouching = !0, this._iosJustTouchEnded = !1, this._iosTouchEndTimerId !== null && this.targetWindow != null && (this.targetWindow.clearTimeout(this._iosTouchEndTimerId), this._iosTouchEndTimerId = null);
|
|
310
|
+
}, o = () => {
|
|
311
|
+
this._iosTouching = !1, !(!D() || this.targetWindow == null) && (this._iosJustTouchEnded = !0, this._iosTouchEndTimerId = this.targetWindow.setTimeout(() => {
|
|
312
|
+
this._iosJustTouchEnded = !1, this._iosTouchEndTimerId = null, this._flushIosDeferredIfReady();
|
|
313
|
+
}, 150));
|
|
314
|
+
};
|
|
315
|
+
i.addEventListener("touchstart", n, C), i.addEventListener("touchend", o, C), this.unsubs.push(() => {
|
|
316
|
+
i.removeEventListener("touchstart", n), i.removeEventListener("touchend", o), this._iosTouchEndTimerId !== null && this.targetWindow != null && (this.targetWindow.clearTimeout(this._iosTouchEndTimerId), this._iosTouchEndTimerId = null);
|
|
317
|
+
});
|
|
318
|
+
}
|
|
319
|
+
this._scrollToOffset(this.getScrollOffset(), {
|
|
320
|
+
adjustments: void 0,
|
|
321
|
+
behavior: void 0
|
|
322
|
+
});
|
|
323
|
+
}
|
|
324
|
+
const s = this.pendingScrollAnchor;
|
|
325
|
+
if (this.pendingScrollAnchor = null, s && this.scrollElement && this.options.enabled) {
|
|
326
|
+
const [i, n, o, h] = s;
|
|
327
|
+
i !== null && !o && (D() && (this.isScrolling || this._iosTouching || this._iosJustTouchEnded) ? h !== 0 && (this._iosDeferredAdjustment += h) : this._scrollToOffset(this.getScrollOffset(), {
|
|
328
|
+
adjustments: void 0,
|
|
329
|
+
behavior: void 0
|
|
330
|
+
})), o && this.scrollToEnd({ behavior: o });
|
|
331
|
+
}
|
|
332
|
+
}, this._flushIosDeferredIfReady = () => {
|
|
333
|
+
if (this._iosDeferredAdjustment === 0 || this.isScrolling || this._iosTouching || this._iosJustTouchEnded) return;
|
|
334
|
+
const t = this.getScrollOffset(), e = this.getMaxScrollOffset();
|
|
335
|
+
if (t < 0 || t > e) return;
|
|
336
|
+
if (this._iosDeferredAdjustment < 0 && t >= e - 1) {
|
|
337
|
+
this._iosDeferredAdjustment = 0;
|
|
338
|
+
return;
|
|
339
|
+
}
|
|
340
|
+
const s = this._iosDeferredAdjustment;
|
|
341
|
+
this._iosDeferredAdjustment = 0, this._scrollToOffset(t, {
|
|
342
|
+
adjustments: this.scrollAdjustments += s,
|
|
343
|
+
behavior: void 0
|
|
344
|
+
});
|
|
345
|
+
}, 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.getMeasurementOptions = I(() => [
|
|
346
|
+
this.options.count,
|
|
347
|
+
this.options.paddingStart,
|
|
348
|
+
this.options.scrollMargin,
|
|
349
|
+
this.options.getItemKey,
|
|
350
|
+
this.options.enabled,
|
|
351
|
+
this.options.lanes,
|
|
352
|
+
this.options.laneAssignmentMode,
|
|
353
|
+
this.options.gap
|
|
354
|
+
], (t, e, s, i, n, o, h, a) => (this.prevLanes !== void 0 && this.prevLanes !== o && (this.lanesChangedFlag = !0), this.prevLanes = o, this.pendingMin = null, {
|
|
355
|
+
count: t,
|
|
356
|
+
paddingStart: e,
|
|
357
|
+
scrollMargin: s,
|
|
358
|
+
getItemKey: i,
|
|
359
|
+
enabled: n,
|
|
360
|
+
lanes: o,
|
|
361
|
+
laneAssignmentMode: h,
|
|
362
|
+
gap: a
|
|
363
|
+
}), { key: !1 }), this.getMeasurements = I(() => [this.getMeasurementOptions(), this.itemSizeCacheVersion], ({ count: t, paddingStart: e, scrollMargin: s, getItemKey: i, enabled: n, lanes: o, laneAssignmentMode: h, gap: a }, d) => {
|
|
364
|
+
const c = this.itemSizeCache;
|
|
365
|
+
if (!n)
|
|
366
|
+
return this.measurementsCache = [], this.itemSizeCache.clear(), this.laneAssignments.clear(), [];
|
|
367
|
+
if (this.laneAssignments.size > t)
|
|
368
|
+
for (const u of this.laneAssignments.keys()) u >= t && this.laneAssignments.delete(u);
|
|
369
|
+
this.lanesChangedFlag && (this.lanesChangedFlag = !1, this.lanesSettling = !0, this.measurementsCache = [], this.itemSizeCache.clear(), this.laneAssignments.clear(), this.pendingMin = null), this.measurementsCache.length === 0 && !this.lanesSettling && (this.measurementsCache = this.options.initialMeasurementsCache, this.measurementsCache.forEach((u) => {
|
|
370
|
+
this.itemSizeCache.set(u.key, u.size);
|
|
371
|
+
}));
|
|
372
|
+
const r = this.lanesSettling ? 0 : this.pendingMin ?? 0;
|
|
373
|
+
if (this.pendingMin = null, this.lanesSettling && this.measurementsCache.length === t && (this.lanesSettling = !1), o === 1) {
|
|
374
|
+
const u = t * 2;
|
|
375
|
+
let g = this._flatMeasurements;
|
|
376
|
+
if (!g || g.length < u) {
|
|
377
|
+
const b = new Float64Array(u);
|
|
378
|
+
g && r > 0 && b.set(g.subarray(0, r * 2)), g = b, this._flatMeasurements = g;
|
|
379
|
+
}
|
|
380
|
+
let E;
|
|
381
|
+
if (r === 0) E = e + s;
|
|
382
|
+
else {
|
|
383
|
+
const b = r - 1;
|
|
384
|
+
E = g[b * 2] + g[b * 2 + 1] + a;
|
|
385
|
+
}
|
|
386
|
+
for (let b = r; b < t; b++) {
|
|
387
|
+
const A = i(b), z = c.get(A), w = typeof z == "number" ? z : this.options.estimateSize(b);
|
|
388
|
+
g[b * 2] = E, g[b * 2 + 1] = w, E += w + a;
|
|
389
|
+
}
|
|
390
|
+
const v = G(t, g, i);
|
|
391
|
+
return this.measurementsCache = v, v;
|
|
392
|
+
}
|
|
393
|
+
const f = this.measurementsCache.slice(0, r), m = new Array(o).fill(void 0), S = new Float64Array(o);
|
|
394
|
+
let p = 0;
|
|
395
|
+
for (let u = 0; u < r; u++) {
|
|
396
|
+
const g = f[u];
|
|
397
|
+
g && (m[g.lane] === void 0 && p++, m[g.lane] = u, S[g.lane] = g.end);
|
|
398
|
+
}
|
|
399
|
+
for (let u = r; u < t; u++) {
|
|
400
|
+
const g = i(u), E = this.laneAssignments.get(u);
|
|
401
|
+
let v, b;
|
|
402
|
+
const A = h === "estimate" || c.has(g);
|
|
403
|
+
if (E !== void 0 && this.options.lanes > 1) {
|
|
404
|
+
v = E;
|
|
405
|
+
const _ = m[v], y = _ !== void 0 ? f[_] : void 0;
|
|
406
|
+
b = y ? y.end + a : e + s;
|
|
407
|
+
} else if (p === o) {
|
|
408
|
+
let _ = 0, y = S[0], j = m[0];
|
|
409
|
+
for (let O = 1; O < o; O++) {
|
|
410
|
+
const R = S[O];
|
|
411
|
+
(R < y || R === y && m[O] < j) && (_ = O, y = R, j = m[O]);
|
|
412
|
+
}
|
|
413
|
+
v = _, b = y + a, A && this.laneAssignments.set(u, v);
|
|
414
|
+
} else
|
|
415
|
+
v = u % this.options.lanes, b = e + s, A && this.laneAssignments.set(u, v);
|
|
416
|
+
const z = c.get(g), w = typeof z == "number" ? z : this.options.estimateSize(u), k = b + w;
|
|
417
|
+
f[u] = {
|
|
418
|
+
index: u,
|
|
419
|
+
start: b,
|
|
420
|
+
size: w,
|
|
421
|
+
end: k,
|
|
422
|
+
key: g,
|
|
423
|
+
lane: v
|
|
424
|
+
}, m[v] === void 0 && p++, m[v] = u, S[v] = k;
|
|
425
|
+
}
|
|
426
|
+
return this.measurementsCache = f, f;
|
|
427
|
+
}, {
|
|
428
|
+
key: process.env.NODE_ENV !== "production" && "getMeasurements",
|
|
429
|
+
debug: () => this.options.debug
|
|
430
|
+
}), this.calculateRange = I(() => [
|
|
431
|
+
this.getMeasurements(),
|
|
432
|
+
this.getSize(),
|
|
433
|
+
this.getScrollOffset(),
|
|
434
|
+
this.options.lanes
|
|
435
|
+
], (t, e, s, i) => t.length === 0 || e === 0 ? (this.range = null, null) : (this.range = ht(t, e, s, i, i === 1 && this._flatMeasurements != null ? this._flatMeasurements : null), this.range), {
|
|
436
|
+
key: process.env.NODE_ENV !== "production" && "calculateRange",
|
|
437
|
+
debug: () => this.options.debug
|
|
438
|
+
}), this.getVirtualIndexes = I(() => {
|
|
439
|
+
let t = null, e = null;
|
|
440
|
+
const s = this.calculateRange();
|
|
441
|
+
return s && (t = s.startIndex, e = s.endIndex), this.maybeNotify.updateDeps([
|
|
442
|
+
this.isScrolling,
|
|
443
|
+
t,
|
|
444
|
+
e
|
|
445
|
+
]), [
|
|
446
|
+
this.options.rangeExtractor,
|
|
447
|
+
this.options.overscan,
|
|
448
|
+
this.options.count,
|
|
449
|
+
t,
|
|
450
|
+
e
|
|
451
|
+
];
|
|
452
|
+
}, (t, e, s, i, n) => i === null || n === null ? [] : t({
|
|
453
|
+
startIndex: i,
|
|
454
|
+
endIndex: n,
|
|
455
|
+
overscan: e,
|
|
456
|
+
count: s
|
|
457
|
+
}), {
|
|
458
|
+
key: process.env.NODE_ENV !== "production" && "getVirtualIndexes",
|
|
459
|
+
debug: () => this.options.debug
|
|
460
|
+
}), this.indexFromElement = (t) => {
|
|
461
|
+
const e = this.options.indexAttribute, s = t.getAttribute(e);
|
|
462
|
+
return s ? parseInt(s, 10) : (console.warn(`Missing attribute name '${e}={index}' on measured element.`), -1);
|
|
463
|
+
}, this.shouldMeasureDuringScroll = (t) => {
|
|
464
|
+
var e;
|
|
465
|
+
if (!this.scrollState || this.scrollState.behavior !== "smooth") return !0;
|
|
466
|
+
const s = this.scrollState.index ?? ((e = this.getVirtualItemForOffset(this.scrollState.lastTargetOffset)) == null ? void 0 : e.index);
|
|
467
|
+
if (s !== void 0 && this.range) {
|
|
468
|
+
const i = Math.max(this.options.overscan, Math.ceil((this.range.endIndex - this.range.startIndex) / 2)), n = Math.max(0, s - i), o = Math.min(this.options.count - 1, s + i);
|
|
469
|
+
return t >= n && t <= o;
|
|
470
|
+
}
|
|
471
|
+
return !0;
|
|
472
|
+
}, this.measureElement = (t) => {
|
|
473
|
+
if (!t) {
|
|
474
|
+
this.elementsCache.forEach((n, o) => {
|
|
475
|
+
n.isConnected || (this.observer.unobserve(n), this.elementsCache.delete(o));
|
|
476
|
+
});
|
|
477
|
+
return;
|
|
478
|
+
}
|
|
479
|
+
const e = this.indexFromElement(t), s = this.options.getItemKey(e), i = this.elementsCache.get(s);
|
|
480
|
+
i !== t && (i && this.observer.unobserve(i), this.observer.observe(t), this.elementsCache.set(s, t)), (!this.isScrolling || this.scrollState) && this.shouldMeasureDuringScroll(e) && this.resizeItem(e, this.options.measureElement(t, void 0, this));
|
|
481
|
+
}, this.resizeItem = (t, e) => {
|
|
482
|
+
var s, i;
|
|
483
|
+
if (t < 0 || t >= this.options.count) return;
|
|
484
|
+
let n, o, h;
|
|
485
|
+
const a = this._flatMeasurements;
|
|
486
|
+
if (this.options.lanes === 1 && a !== null)
|
|
487
|
+
h = this.options.getItemKey(t), o = a[t * 2], n = a[t * 2 + 1];
|
|
488
|
+
else {
|
|
489
|
+
const r = this.measurementsCache[t];
|
|
490
|
+
if (!r) return;
|
|
491
|
+
h = r.key, o = r.start, n = r.size;
|
|
492
|
+
}
|
|
493
|
+
const d = this.itemSizeCache.get(h) ?? n, c = e - d;
|
|
494
|
+
if (c !== 0) {
|
|
495
|
+
const r = this.options.anchorTo === "end" && ((s = this.scrollState) == null ? void 0 : s.behavior) !== "smooth" && this.getVirtualDistanceFromEnd() <= this.options.scrollEndThreshold, f = r ? this.getTotalSize() : 0, m = this.getScrollOffset() + this.scrollAdjustments, S = this.itemSizeCache.has(h) ? o + d <= m && this.scrollDirection !== "backward" : o < m, p = ((i = this.scrollState) == null ? void 0 : i.behavior) !== "smooth" && (this.shouldAdjustScrollPositionOnItemSizeChange !== void 0 ? this.shouldAdjustScrollPositionOnItemSizeChange(this.measurementsCache[t] ?? {
|
|
496
|
+
index: t,
|
|
497
|
+
key: h,
|
|
498
|
+
start: o,
|
|
499
|
+
size: n,
|
|
500
|
+
end: o + n,
|
|
501
|
+
lane: 0
|
|
502
|
+
}, c, this) : S);
|
|
503
|
+
(this.pendingMin === null || t < this.pendingMin) && (this.pendingMin = t), this.itemSizeCache.set(h, e), this.itemSizeCacheVersion++, r ? this.applyScrollAdjustment(this.getTotalSize() - f) : p && this.applyScrollAdjustment(c), this.notify(!1);
|
|
504
|
+
}
|
|
505
|
+
}, this.getVirtualItems = I(() => [this.getVirtualIndexes(), this.getMeasurements()], (t, e) => {
|
|
506
|
+
const s = [];
|
|
507
|
+
for (let i = 0, n = t.length; i < n; i++) {
|
|
508
|
+
const o = e[t[i]];
|
|
509
|
+
s.push(o);
|
|
510
|
+
}
|
|
511
|
+
return s;
|
|
512
|
+
}, {
|
|
513
|
+
key: process.env.NODE_ENV !== "production" && "getVirtualItems",
|
|
514
|
+
debug: () => this.options.debug
|
|
515
|
+
}), this.getVirtualItemForOffset = (t) => {
|
|
516
|
+
const e = this.getMeasurements();
|
|
517
|
+
if (e.length === 0) return;
|
|
518
|
+
const s = this._flatMeasurements, i = this.options.lanes === 1 && s != null;
|
|
519
|
+
return L(e[P(0, e.length - 1, i ? (n) => s[n * 2] : (n) => L(e[n]).start, t)]);
|
|
520
|
+
}, this.getMaxScrollOffset = () => {
|
|
521
|
+
if (!this.scrollElement) return 0;
|
|
522
|
+
if ("scrollHeight" in this.scrollElement) return this.options.horizontal ? this.scrollElement.scrollWidth - this.scrollElement.clientWidth : this.scrollElement.scrollHeight - this.scrollElement.clientHeight;
|
|
523
|
+
{
|
|
524
|
+
const t = this.scrollElement.document.documentElement;
|
|
525
|
+
return this.options.horizontal ? t.scrollWidth - this.scrollElement.innerWidth : t.scrollHeight - this.scrollElement.innerHeight;
|
|
526
|
+
}
|
|
527
|
+
}, this.getVirtualDistanceFromEnd = () => Math.max(this.getTotalSize() - this.getSize() - this.getScrollOffset(), 0), this.getDistanceFromEnd = () => Math.max(this.getMaxScrollOffset() - this.getScrollOffset(), 0), this.isAtEnd = (t = this.options.scrollEndThreshold) => this.getDistanceFromEnd() <= t, this.getOffsetForAlignment = (t, e, s = 0) => {
|
|
528
|
+
if (!this.scrollElement) return 0;
|
|
529
|
+
const i = this.getSize(), n = this.getScrollOffset();
|
|
530
|
+
e === "auto" && (e = t >= n + i ? "end" : "start"), e === "center" ? t += (s - i) / 2 : e === "end" && (t -= i);
|
|
531
|
+
const o = this.getMaxScrollOffset();
|
|
532
|
+
return Math.max(Math.min(o, t), 0);
|
|
533
|
+
}, this.getOffsetForIndex = (t, e = "auto") => {
|
|
534
|
+
t = Math.max(0, Math.min(t, this.options.count - 1));
|
|
535
|
+
const s = this.getSize(), i = this.getScrollOffset(), n = this.measurementsCache[t];
|
|
536
|
+
if (!n) return;
|
|
537
|
+
if (e === "auto") if (n.end >= i + s - this.options.scrollPaddingEnd) e = "end";
|
|
538
|
+
else if (n.start <= i + this.options.scrollPaddingStart) e = "start";
|
|
539
|
+
else return [i, e];
|
|
540
|
+
if (e === "end" && t === this.options.count - 1) return [this.getMaxScrollOffset(), e];
|
|
541
|
+
const o = e === "end" ? n.end + this.options.scrollPaddingEnd : n.start - this.options.scrollPaddingStart;
|
|
542
|
+
return [this.getOffsetForAlignment(o, e, n.size), e];
|
|
543
|
+
}, this.scrollToOffset = (t, { align: e = "start", behavior: s = "auto" } = {}) => {
|
|
544
|
+
this._iosDeferredAdjustment = 0;
|
|
545
|
+
const i = this.getOffsetForAlignment(t, e), n = this.now();
|
|
546
|
+
this.scrollState = {
|
|
547
|
+
index: null,
|
|
548
|
+
align: e,
|
|
549
|
+
behavior: s,
|
|
550
|
+
startedAt: n,
|
|
551
|
+
lastTargetOffset: i,
|
|
552
|
+
stableFrames: 0
|
|
553
|
+
}, this._scrollToOffset(i, {
|
|
554
|
+
adjustments: void 0,
|
|
555
|
+
behavior: s
|
|
556
|
+
}), this.scheduleScrollReconcile();
|
|
557
|
+
}, this.scrollToIndex = (t, { align: e = "auto", behavior: s = "auto" } = {}) => {
|
|
558
|
+
this._iosDeferredAdjustment = 0, t = Math.max(0, Math.min(t, this.options.count - 1));
|
|
559
|
+
const i = this.getOffsetForIndex(t, e);
|
|
560
|
+
if (!i) return;
|
|
561
|
+
const [n, o] = i, h = this.now();
|
|
562
|
+
this.scrollState = {
|
|
563
|
+
index: t,
|
|
564
|
+
align: o,
|
|
565
|
+
behavior: s,
|
|
566
|
+
startedAt: h,
|
|
567
|
+
lastTargetOffset: n,
|
|
568
|
+
stableFrames: 0
|
|
569
|
+
}, this._scrollToOffset(n, {
|
|
570
|
+
adjustments: void 0,
|
|
571
|
+
behavior: s
|
|
572
|
+
}), this.scheduleScrollReconcile();
|
|
573
|
+
}, this.scrollBy = (t, { behavior: e = "auto" } = {}) => {
|
|
574
|
+
const s = this.getScrollOffset() + t, i = this.now();
|
|
575
|
+
this.scrollState = {
|
|
576
|
+
index: null,
|
|
577
|
+
align: "start",
|
|
578
|
+
behavior: e,
|
|
579
|
+
startedAt: i,
|
|
580
|
+
lastTargetOffset: s,
|
|
581
|
+
stableFrames: 0
|
|
582
|
+
}, this._scrollToOffset(s, {
|
|
583
|
+
adjustments: void 0,
|
|
584
|
+
behavior: e
|
|
585
|
+
}), this.scheduleScrollReconcile();
|
|
586
|
+
}, this.scrollToEnd = ({ behavior: t = "auto" } = {}) => {
|
|
587
|
+
if (this.options.count > 0) {
|
|
588
|
+
this.scrollToIndex(this.options.count - 1, {
|
|
589
|
+
align: "end",
|
|
590
|
+
behavior: t
|
|
591
|
+
});
|
|
592
|
+
return;
|
|
593
|
+
}
|
|
594
|
+
this.scrollToOffset(Math.max(this.getTotalSize() - this.getSize(), 0), { behavior: t });
|
|
595
|
+
}, this.getTotalSize = () => {
|
|
596
|
+
var t;
|
|
597
|
+
const e = this.getMeasurements();
|
|
598
|
+
let s;
|
|
599
|
+
if (e.length === 0) s = this.options.paddingStart;
|
|
600
|
+
else if (this.options.lanes === 1) {
|
|
601
|
+
const i = e.length - 1, n = this._flatMeasurements;
|
|
602
|
+
n != null ? s = n[i * 2] + n[i * 2 + 1] : s = ((t = e[i]) == null ? void 0 : t.end) ?? 0;
|
|
603
|
+
} else {
|
|
604
|
+
const i = Array(this.options.lanes).fill(null);
|
|
605
|
+
let n = e.length - 1;
|
|
606
|
+
for (; n >= 0 && i.some((o) => o === null); ) {
|
|
607
|
+
const o = e[n];
|
|
608
|
+
i[o.lane] === null && (i[o.lane] = o.end), n--;
|
|
609
|
+
}
|
|
610
|
+
s = Math.max(...i.filter((o) => o !== null));
|
|
611
|
+
}
|
|
612
|
+
return Math.max(s - this.options.scrollMargin + this.options.paddingEnd, 0);
|
|
613
|
+
}, this.takeSnapshot = () => {
|
|
614
|
+
const t = [];
|
|
615
|
+
if (this.itemSizeCache.size === 0) return t;
|
|
616
|
+
const e = this.getMeasurements();
|
|
617
|
+
for (const s of e) s && this.itemSizeCache.has(s.key) && t.push({
|
|
618
|
+
index: s.index,
|
|
619
|
+
key: s.key,
|
|
620
|
+
start: s.start,
|
|
621
|
+
size: s.size,
|
|
622
|
+
end: s.end,
|
|
623
|
+
lane: s.lane
|
|
624
|
+
});
|
|
625
|
+
return t;
|
|
626
|
+
}, this._scrollToOffset = (t, { adjustments: e, behavior: s }) => {
|
|
627
|
+
this._intendedScrollOffset = t + (e ?? 0), this.options.scrollToFn(t, {
|
|
628
|
+
behavior: s,
|
|
629
|
+
adjustments: e
|
|
630
|
+
}, this);
|
|
631
|
+
}, this.measure = () => {
|
|
632
|
+
this.pendingMin = null, this.itemSizeCache.clear(), this.laneAssignments.clear(), this.itemSizeCacheVersion++, this.notify(!1);
|
|
633
|
+
}, this.setOptions(l);
|
|
634
|
+
}
|
|
635
|
+
applyScrollAdjustment(l, t) {
|
|
636
|
+
l !== 0 && (process.env.NODE_ENV !== "production" && this.options.debug && console.info("correction", l), D() && (this.isScrolling || this._iosTouching || this._iosJustTouchEnded) ? this._iosDeferredAdjustment += l : (this._scrollToOffset(this.getScrollOffset(), {
|
|
637
|
+
adjustments: this.scrollAdjustments += l,
|
|
638
|
+
behavior: t
|
|
639
|
+
}), this.scrollOffset !== null && (this.scrollOffset += this.scrollAdjustments, this.scrollOffset < 0 && (this.scrollOffset = 0), this.scrollAdjustments = 0)));
|
|
640
|
+
}
|
|
641
|
+
scheduleScrollReconcile() {
|
|
642
|
+
if (!this.targetWindow) {
|
|
643
|
+
this.scrollState = null;
|
|
644
|
+
return;
|
|
645
|
+
}
|
|
646
|
+
this.rafId == null && (this.rafId = this.targetWindow.requestAnimationFrame(() => {
|
|
647
|
+
this.rafId = null, this.reconcileScroll();
|
|
648
|
+
}));
|
|
649
|
+
}
|
|
650
|
+
reconcileScroll() {
|
|
651
|
+
if (!this.scrollState || !this.scrollElement) return;
|
|
652
|
+
if (this.now() - this.scrollState.startedAt > 5e3) {
|
|
653
|
+
this.scrollState = null;
|
|
654
|
+
return;
|
|
655
|
+
}
|
|
656
|
+
const l = this.scrollState.index != null ? this.getOffsetForIndex(this.scrollState.index, this.scrollState.align) : void 0, t = l ? l[0] : this.scrollState.lastTargetOffset, e = 1, s = t !== this.scrollState.lastTargetOffset;
|
|
657
|
+
if (!s && Q(t, this.getScrollOffset())) {
|
|
658
|
+
if (this.scrollState.stableFrames++, this.scrollState.stableFrames >= e) {
|
|
659
|
+
this.getScrollOffset() !== t && this._scrollToOffset(t, {
|
|
660
|
+
adjustments: void 0,
|
|
661
|
+
behavior: "auto"
|
|
662
|
+
}), this.scrollState = null;
|
|
663
|
+
return;
|
|
664
|
+
}
|
|
665
|
+
} else if (this.scrollState.stableFrames = 0, s) {
|
|
666
|
+
const i = this.getSize() || 600, n = Math.abs(t - this.getScrollOffset()), o = this.scrollState.behavior === "smooth" && n > i;
|
|
667
|
+
this.scrollState.lastTargetOffset = t, o || (this.scrollState.behavior = "auto"), this._scrollToOffset(t, {
|
|
668
|
+
adjustments: void 0,
|
|
669
|
+
behavior: o ? "smooth" : "auto"
|
|
670
|
+
});
|
|
671
|
+
}
|
|
672
|
+
this.scheduleScrollReconcile();
|
|
673
|
+
}
|
|
674
|
+
}, P = (l, t, e, s) => {
|
|
675
|
+
for (; l <= t; ) {
|
|
676
|
+
const i = (l + t) / 2 | 0, n = e(i);
|
|
677
|
+
if (n < s) l = i + 1;
|
|
678
|
+
else if (n > s) t = i - 1;
|
|
679
|
+
else return i;
|
|
680
|
+
}
|
|
681
|
+
return l > 0 ? l - 1 : 0;
|
|
682
|
+
};
|
|
683
|
+
function at(l, t, e) {
|
|
684
|
+
let s = 0;
|
|
685
|
+
for (; s <= t; ) {
|
|
686
|
+
const i = (s + t) / 2 | 0, n = l[i * 2];
|
|
687
|
+
if (n < e) s = i + 1;
|
|
688
|
+
else if (n > e) t = i - 1;
|
|
689
|
+
else return i;
|
|
690
|
+
}
|
|
691
|
+
return s > 0 ? s - 1 : 0;
|
|
692
|
+
}
|
|
693
|
+
function ht(l, t, e, s, i) {
|
|
694
|
+
const n = l.length - 1;
|
|
695
|
+
if (l.length <= s) return {
|
|
696
|
+
startIndex: 0,
|
|
697
|
+
endIndex: n
|
|
698
|
+
};
|
|
699
|
+
if (s === 1 && i !== null) {
|
|
700
|
+
const d = at(i, n, e);
|
|
701
|
+
let c = d;
|
|
702
|
+
const r = e + t;
|
|
703
|
+
for (; c < n && i[c * 2] + i[c * 2 + 1] < r; ) c++;
|
|
704
|
+
return {
|
|
705
|
+
startIndex: d,
|
|
706
|
+
endIndex: c
|
|
707
|
+
};
|
|
708
|
+
}
|
|
709
|
+
let h = P(0, n, (d) => l[d].start, e), a = h;
|
|
710
|
+
if (s === 1) for (; a < n && l[a].end < e + t; ) a++;
|
|
711
|
+
else if (s > 1) {
|
|
712
|
+
const d = Array(s).fill(0);
|
|
713
|
+
for (; a < n && d.some((r) => r < e + t); ) {
|
|
714
|
+
const r = l[a];
|
|
715
|
+
d[r.lane] = r.end, a++;
|
|
716
|
+
}
|
|
717
|
+
const c = Array(s).fill(e + t);
|
|
718
|
+
for (; h >= 0 && c.some((r) => r >= e); ) {
|
|
719
|
+
const r = l[h];
|
|
720
|
+
c[r.lane] = r.start, h--;
|
|
721
|
+
}
|
|
722
|
+
h = Math.max(0, h - h % s), a = Math.min(n, a + (s - 1 - a % s));
|
|
723
|
+
}
|
|
724
|
+
return {
|
|
725
|
+
startIndex: h,
|
|
726
|
+
endIndex: a
|
|
727
|
+
};
|
|
728
|
+
}
|
|
729
|
+
var F = typeof document < "u" ? M.useLayoutEffect : M.useEffect;
|
|
730
|
+
function ct({ useFlushSync: l = !0, directDomUpdates: t = !1, directDomUpdatesMode: e = "transform", ...s }) {
|
|
731
|
+
const i = M.useReducer((c) => c + 1, 0)[1], n = M.useRef({
|
|
732
|
+
enabled: t,
|
|
733
|
+
mode: e,
|
|
734
|
+
container: null,
|
|
735
|
+
lastSize: null,
|
|
736
|
+
lastPositions: /* @__PURE__ */ new WeakMap(),
|
|
737
|
+
prevRange: null
|
|
738
|
+
});
|
|
739
|
+
n.current.enabled = t, n.current.mode = e;
|
|
740
|
+
const o = (c) => {
|
|
741
|
+
const r = n.current;
|
|
742
|
+
if (!r.enabled || !r.container) return;
|
|
743
|
+
const f = c.getTotalSize();
|
|
744
|
+
if (f !== r.lastSize) {
|
|
745
|
+
r.lastSize = f;
|
|
746
|
+
const m = c.options.horizontal ? "width" : "height";
|
|
747
|
+
r.container.style[m] = `${f}px`;
|
|
748
|
+
}
|
|
749
|
+
}, h = (c) => {
|
|
750
|
+
const r = n.current;
|
|
751
|
+
if (!r.enabled || !r.container) return;
|
|
752
|
+
o(c);
|
|
753
|
+
const f = !!c.options.horizontal, m = r.mode === "transform", S = f ? "left" : "top", p = c.options.scrollMargin, u = c.getVirtualItems();
|
|
754
|
+
for (const g of u) {
|
|
755
|
+
const E = g.start - p, v = c.elementsCache.get(g.key);
|
|
756
|
+
v && r.lastPositions.get(v) !== E && (r.lastPositions.set(v, E), m ? v.style.transform = f ? `translate3d(${E}px, 0, 0)` : `translate3d(0, ${E}px, 0)` : v.style[S] = `${E}px`);
|
|
757
|
+
}
|
|
758
|
+
}, a = {
|
|
759
|
+
...s,
|
|
760
|
+
onChange: (c, r) => {
|
|
761
|
+
var f;
|
|
762
|
+
const m = n.current;
|
|
763
|
+
let S = !0;
|
|
764
|
+
if (m.enabled) {
|
|
765
|
+
h(c);
|
|
766
|
+
const p = c.range, u = m.prevRange;
|
|
767
|
+
S = !u || u.isScrolling !== c.isScrolling || u.startIndex !== p?.startIndex || u.endIndex !== p?.endIndex, S && (m.prevRange = p ? {
|
|
768
|
+
startIndex: p.startIndex,
|
|
769
|
+
endIndex: p.endIndex,
|
|
770
|
+
isScrolling: c.isScrolling
|
|
771
|
+
} : null);
|
|
772
|
+
}
|
|
773
|
+
S && (l && r ? q(i) : i()), (f = s.onChange) == null || f.call(s, c, r);
|
|
774
|
+
}
|
|
775
|
+
}, [d] = M.useState(() => {
|
|
776
|
+
const c = new rt(a);
|
|
777
|
+
return Object.assign(c, { containerRef: (r) => {
|
|
778
|
+
const f = n.current;
|
|
779
|
+
if (f.container = r, f.lastSize = null, r && f.enabled) {
|
|
780
|
+
const m = c.getTotalSize();
|
|
781
|
+
f.lastSize = m;
|
|
782
|
+
const S = c.options.horizontal ? "width" : "height";
|
|
783
|
+
r.style[S] = `${m}px`;
|
|
784
|
+
}
|
|
785
|
+
} });
|
|
786
|
+
});
|
|
787
|
+
return d.setOptions(a), F(() => d._didMount(), []), F(() => (o(d), d._willUpdate())), F(() => {
|
|
788
|
+
h(d);
|
|
789
|
+
}), d;
|
|
790
|
+
}
|
|
791
|
+
function ut(l) {
|
|
792
|
+
return ct({
|
|
793
|
+
observeElementRect: tt,
|
|
794
|
+
observeElementOffset: it,
|
|
795
|
+
scrollToFn: lt,
|
|
796
|
+
...l
|
|
797
|
+
});
|
|
798
|
+
}
|
|
799
|
+
var bt = ({ showFlagOnSearch: l, showNameOnSearch: t }) => {
|
|
800
|
+
const e = J(null), { termOfSearch: s, countries: i, handleSelectCountry: n } = K(), o = H(() => i.filter((a) => a.name.toLocaleLowerCase().includes(s.toLowerCase())), [s]), h = ut({
|
|
801
|
+
count: o.length,
|
|
802
|
+
overscan: 5,
|
|
803
|
+
getScrollElement: () => e.current,
|
|
804
|
+
estimateSize: () => 40
|
|
805
|
+
});
|
|
806
|
+
return B(() => {
|
|
807
|
+
o.length > 0 && h.scrollToIndex(0);
|
|
808
|
+
}, [s, h]), o.length === 0 ? /* @__PURE__ */ x("div", {
|
|
809
|
+
className: "overflow-y-auto max-h-60 snap-y snap-mandatory",
|
|
810
|
+
children: /* @__PURE__ */ x("ul", {
|
|
811
|
+
className: "relative",
|
|
812
|
+
children: /* @__PURE__ */ x("li", {
|
|
813
|
+
className: "w-full flex items-center h-10 select-none px-6",
|
|
814
|
+
children: /* @__PURE__ */ x(W, {
|
|
815
|
+
variant: "body2",
|
|
816
|
+
component: "span",
|
|
817
|
+
className: "flex gap-2 items-center text-left",
|
|
818
|
+
children: "No options"
|
|
819
|
+
})
|
|
820
|
+
})
|
|
821
|
+
})
|
|
822
|
+
}) : /* @__PURE__ */ x("div", {
|
|
823
|
+
ref: e,
|
|
824
|
+
className: "overflow-y-auto max-h-60 snap-y snap-mandatory scrollbar",
|
|
825
|
+
children: /* @__PURE__ */ x("ul", {
|
|
826
|
+
className: "relative",
|
|
827
|
+
style: { height: h.getTotalSize() },
|
|
828
|
+
children: h.getVirtualItems().map((a) => {
|
|
829
|
+
const d = o[a.index], { flag: c, name: r, prefix: f } = d;
|
|
830
|
+
return /* @__PURE__ */ x("li", {
|
|
831
|
+
className: N("absolute", "w-full", "snap-start", "snap-always", "scroll-m-0", "flex", "items-center", "h-10"),
|
|
832
|
+
style: {
|
|
833
|
+
top: a.start,
|
|
834
|
+
height: a.size
|
|
835
|
+
},
|
|
836
|
+
children: /* @__PURE__ */ x("button", {
|
|
837
|
+
className: N("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"),
|
|
838
|
+
onClick: () => n(d),
|
|
839
|
+
children: /* @__PURE__ */ U(W, {
|
|
840
|
+
variant: "body2",
|
|
841
|
+
component: "span",
|
|
842
|
+
className: "flex gap-2 items-center text-left",
|
|
843
|
+
children: [l && /* @__PURE__ */ x(c, {}), t && /* @__PURE__ */ x($, {
|
|
844
|
+
text: r,
|
|
845
|
+
prefix: f
|
|
846
|
+
})]
|
|
847
|
+
})
|
|
848
|
+
})
|
|
849
|
+
}, a.key);
|
|
850
|
+
})
|
|
851
|
+
})
|
|
852
|
+
});
|
|
853
|
+
};
|
|
854
|
+
export {
|
|
855
|
+
bt as t
|
|
856
|
+
};
|