@konstructio/ui 0.1.2-alpha.111 → 0.1.2-alpha.113
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-D3SZ2WFJ.js → AdditionalOptions-ClcR_Kf7.js} +1 -1
- package/dist/{AlertDialogTrigger-Cdw3C2Tv.js → AlertDialogTrigger-C9xoCZrZ.js} +33 -33
- package/dist/Checkbox-DRdyrKjk.js +252 -0
- package/dist/CollapsedSteps-CR7oCTRC.js +112 -0
- package/dist/{CommandInput-DiRv6fEA.js → CommandInput-Du2o616y.js} +1 -1
- package/dist/Counter-DMkXIsOO.js +229 -0
- package/dist/DropdownButton-JilCRLJY.js +92 -0
- package/dist/FlagSelectorList-iZ3gUVpf.js +954 -0
- package/dist/{HamburgerTrigger-DjHmNEJD.js → HamburgerTrigger-BgeS_nBA.js} +15 -15
- package/dist/Modal-CysTe3zL.js +83 -0
- package/dist/Spinner-CTonkSzG.js +47 -0
- package/dist/Switch-5cdUxbhX.js +215 -0
- package/dist/{Wrapper-MmlrJppS.js → Wrapper-BCi_pLOr.js} +38 -38
- package/dist/{Wrapper-BxfB3BDa.js → Wrapper-ThpRi_Gg.js} +9 -9
- package/dist/components/Alert/Alert.js +45 -41
- package/dist/components/AlertDialog/AlertDialog.js +42 -42
- package/dist/components/AlertDialog/components/AlertDialogTrigger.js +1 -1
- package/dist/components/AlertDialog/components/index.js +1 -1
- package/dist/components/Avatar/Avatar.js +37 -0
- package/dist/components/Avatar/Avatar.variants.js +25 -0
- package/dist/components/Avatar/hooks/index.js +5 -0
- package/dist/components/Avatar/hooks/use-gravatar-url.js +25 -0
- package/dist/components/AvatarGroup/AvatarGroup.js +40 -0
- package/dist/components/Badge/Badge.js +1 -1
- package/dist/components/BadgeGroup/BadgeGroup.js +62 -0
- package/dist/components/BadgeGroup/hooks/index.js +4 -0
- package/dist/components/BadgeGroup/hooks/use-visible-badge-count/use-visible-badge-count.js +50 -0
- package/dist/components/Breadcrumb/components/CollapsedSteps/CollapsedSteps.js +4 -0
- package/dist/components/Breadcrumb/components/index.js +6 -4
- package/dist/components/Button/Button.js +25 -19
- package/dist/components/Button/Button.variants.js +4 -1
- package/dist/components/ButtonGroup/ButtonGroup.js +16 -16
- package/dist/components/ButtonGroup/components/ButtonGroupItem/ButtonGroupItem.js +8 -8
- package/dist/components/Checkbox/Checkbox.js +1 -1
- package/dist/components/CheckboxCard/CheckboxCard.js +52 -0
- package/dist/components/Collapse/Collapse.js +63 -0
- package/dist/components/Command/Command.js +5 -5
- package/dist/components/Command/components/Command.js +1 -1
- 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 +1 -1
- package/dist/components/Command/components/CommandSeparator.js +1 -1
- package/dist/components/Command/components/DialogContent.js +1 -1
- package/dist/components/Command/components/DialogOverlay.js +1 -1
- package/dist/components/Command/components/index.js +1 -1
- package/dist/components/ConfirmDialog/ConfirmDialog.js +110 -0
- package/dist/components/CopyButton/CopyButton.js +29 -29
- package/dist/components/Counter/Counter.js +1 -1
- package/dist/components/Counter/Counter.variants.js +73 -16
- package/dist/components/DateRangePicker/components/CalendarPanel/CalendarPanel.js +1 -1
- package/dist/components/DateRangePicker/components/CalendarPanel/components/CalendarMonth/CalendarMonth.js +23 -31
- package/dist/components/DateRangePicker/components/CalendarPanel/components/CalendarMonth/components/CalendarMonthContent/CalendarMonthContent.js +26 -0
- package/dist/components/DateRangePicker/components/CalendarPanel/components/IndependentModeCalendar/IndependentModeCalendar.js +8 -8
- package/dist/components/DateRangePicker/components/CalendarPanel/components/TogetherModeCalendar/TogetherModeCalendar.js +13 -13
- package/dist/components/DateRangePicker/components/RightPanel/RightPanel.js +15 -16
- package/dist/components/Datepicker/DatePicker.js +14 -49
- package/dist/components/Datepicker/components/DatePickerContent/DatePickerContent.js +51 -0
- package/dist/components/Drawer/Drawer.js +18 -18
- package/dist/components/DropdownButton/DropdownButton.js +1 -1
- package/dist/components/Filter/components/BadgeDropdown/BadgeMultiSelect.js +1 -1
- package/dist/components/Filter/components/CustomDateRangeFilterDropdown/components/Actions/Actions.js +10 -11
- package/dist/components/Filter/components/CustomDateRangeFilterDropdown/hooks/useFormattedDateRange/useFormattedDateRange.js +25 -22
- package/dist/components/Filter/components/DateFilterDropdown/hooks/useDateFilterDropdown/useDateFilterDropdown.js +16 -16
- package/dist/components/Filter/components/DateRangeFilterDropdown/hooks/useDateRangeFilterDropdown/useDateRangeFilterDropdown.js +29 -29
- package/dist/components/Filter/components/FilterDropdown/FilterDropdown.js +10 -10
- package/dist/components/Filter/components/TextMultiSelect/TextMultiSelect.js +1 -1
- package/dist/components/Filter/hooks/index.js +3 -1
- package/dist/components/Filter/hooks/useLocale.js +16 -0
- package/dist/components/Filter/utils/index.js +6 -2
- package/dist/components/LineChart/LineChart.js +18 -125
- package/dist/components/LineChart/components/LineChartContent/LineChartContent.js +127 -0
- 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/MultiSelectDropdown/MultiSelectDropdown.js +1 -1
- package/dist/components/MultiSelectDropdown/MultiSelectDropdown.variants.js +22 -3
- 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/OtpInput/OtpInput.js +103 -0
- package/dist/components/PasswordRules/PasswordRules.js +51 -0
- package/dist/components/PhoneNumberInput/PhoneNumberInput.js +39 -10
- package/dist/components/PhoneNumberInput/components/FlagSelectorList/FlagSelectorList.js +1 -1
- package/dist/components/PhoneNumberInput/components/FlagSelectorWrapper/FlagSelectorWrapper.js +4 -4
- package/dist/components/PhoneNumberInput/components/PhoneNumberInputContent.js +15 -0
- package/dist/components/PhoneNumberInput/components/TruncateText/TruncateText.js +15 -15
- 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 +4 -4
- package/dist/components/PhoneNumberInput/contexts/phone-number.provider.js +1 -1
- package/dist/components/PieChart/PieChart.js +10 -53
- package/dist/components/PieChart/components/PieChartContent/PieChartContent.js +56 -0
- package/dist/components/ProgressBar/ProgressBar.js +10 -10
- package/dist/components/RadioCard/RadioCard.js +36 -18
- package/dist/components/RadioCard/RadioCard.variants.js +9 -3
- package/dist/components/RadioGroup/RadioGroup.js +1 -1
- package/dist/components/Range/Range.js +1 -1
- 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 +10 -10
- package/dist/components/Select/components/Wrapper.js +1 -1
- package/dist/components/Select/components/index.js +2 -2
- package/dist/components/Sidebar/components/CollapseTrigger/CollapseTrigger.js +15 -15
- package/dist/components/Sidebar/components/HamburgerTrigger/HamburgerTrigger.js +1 -1
- package/dist/components/Sidebar/components/NavigationOption/NavigationOption.js +66 -42
- package/dist/components/Sidebar/components/NavigationOption/NavigationOption.variants.js +10 -4
- package/dist/components/Sidebar/components/Wrapper/Wrapper.js +91 -86
- package/dist/components/Sidebar/components/index.js +1 -1
- package/dist/components/Skeleton/Skeleton.js +18 -0
- package/dist/components/Skeleton/Skeleton.variants.js +25 -0
- package/dist/components/Slider/Slider.js +1 -1
- package/dist/components/Spinner/Spinner.js +1 -1
- package/dist/components/Stepper/Stepper.js +38 -29
- package/dist/components/Stepper/Stepper.variants.js +55 -19
- package/dist/components/Stepper/hooks/useStepItemLogic.js +1 -1
- package/dist/components/Switch/Switch.js +1 -1
- package/dist/components/Tabs/Tabs.js +52 -24
- package/dist/components/Tabs/Tabs.variants.js +15 -6
- package/dist/components/Tabs/components/Content.js +6 -6
- package/dist/components/Tabs/components/List.js +10 -10
- package/dist/components/Tabs/components/Trigger.js +11 -10
- package/dist/components/Tag/Tag.js +1 -1
- package/dist/components/TagsInput/TagsInput.js +159 -0
- package/dist/components/Toast/Toast.js +68 -2
- package/dist/components/Toast/components/ToastCard/ToastCard.js +27 -27
- package/dist/components/Tooltip/Tooltip.js +32 -16
- package/dist/components/VirtualizedTable/VirtualizedTable.js +32 -101
- package/dist/components/VirtualizedTable/components/Actions/Actions.variants.js +18 -5
- package/dist/components/VirtualizedTable/components/Actions/components/ActionsList/ActionsList.js +29 -19
- package/dist/components/VirtualizedTable/components/Actions/components/InlineActions/InlineActions.js +66 -33
- package/dist/components/VirtualizedTable/components/Actions/components/PortalActions/PortalActions.js +31 -29
- package/dist/components/VirtualizedTable/components/Actions/components/PortalActions/hooks/use-actions-menu/use-actions-menu.js +23 -20
- package/dist/components/VirtualizedTable/components/Actions/components/PortalActions/hooks/use-menu-interactions/use-menu-interactions.js +51 -45
- package/dist/components/VirtualizedTable/components/Body/Body.js +6 -6
- package/dist/components/VirtualizedTable/components/DropdownPaginate/DropdownPaginate.js +22 -22
- package/dist/components/VirtualizedTable/components/EmptyResults/EmptyResults.js +30 -0
- package/dist/components/VirtualizedTable/components/EmptyState/EmptyState.js +32 -0
- package/dist/components/VirtualizedTable/components/ErrorState/ErrorState.js +35 -0
- package/dist/components/VirtualizedTable/components/Filter/Filter.js +5 -5
- package/dist/components/VirtualizedTable/components/Header/Header.js +4 -4
- package/dist/components/VirtualizedTable/components/TruncateText/TruncateText.js +46 -39
- package/dist/components/VirtualizedTable/components/VirtualizedTableContent/VirtualizedTableContent.js +91 -0
- package/dist/components/VirtualizedTable/components/index.js +18 -12
- package/dist/components/VirtualizedTable/contexts/index.js +6 -6
- package/dist/components/VirtualizedTable/contexts/table.context.js +1 -0
- package/dist/components/VirtualizedTable/contexts/table.provider.js +1 -1
- package/dist/components/VirtualizedTable/utils/index.js +4 -4
- package/dist/components/index.js +180 -154
- package/dist/components-B_SWqhCL.js +147 -0
- package/dist/{utils-DVYdP0CJ.js → country-locale-map-DbrJ3bEE.js} +373 -373
- package/dist/{debounce-BdyZeJQk.js → debounce-dMRJxNsT.js} +3 -3
- package/dist/{dist-DcFwF4XM.js → dist-1AtWkIZ4.js} +268 -260
- package/dist/{dist-CgzF5_J6.js → dist-4IVGO6ZT.js} +4 -4
- package/dist/dist-BCoDIdCt.js +429 -0
- package/dist/{dist-Bi8Y5nEx.js → dist-BXv-jY2v.js} +60 -55
- package/dist/{dist-C4j75TwZ.js → dist-BbJP2Efh.js} +2 -2
- package/dist/dist-Bh7M0KDN.js +367 -0
- package/dist/dist-BqDJX7m1.js +209 -0
- package/dist/dist-C0OhTLFV.js +31 -0
- package/dist/dist-C1a-68Kb.js +120 -0
- package/dist/dist-CK8FUUUn.js +125 -0
- package/dist/dist-CQSCPpFc.js +196 -0
- package/dist/{dist-CCdbu9GU.js → dist-CYuWoi9I.js} +1 -1
- package/dist/{dist-DX0sBG3Q.js → dist-C_jtUTU9.js} +5 -6
- package/dist/{dist-D-yS0HN8.js → dist-DbeY0Pzx.js} +6 -6
- package/dist/dist-fPYIsxyx.js +465 -0
- package/dist/dist-rsFD9q_X.js +484 -0
- package/dist/{dist-BUocnzkM.js → dist-uuWgjOcO.js} +1 -1
- package/dist/dist-vDSmnSS_.js +41 -0
- package/dist/dist-vUCyiTQy.js +365 -0
- package/dist/es2015-ChhQTsb4.js +74 -0
- package/dist/index.js +194 -168
- package/dist/{isObject-pLoSfdr0.js → isSymbol-BG9higgO.js} +14 -14
- package/dist/lib/components/Alert/Alert.types.d.ts +4 -0
- package/dist/lib/components/Avatar/Avatar.d.ts +14 -0
- package/dist/lib/components/Avatar/Avatar.types.d.ts +21 -0
- package/dist/lib/components/Avatar/Avatar.variants.d.ts +3 -0
- package/dist/lib/components/Avatar/hooks/index.d.ts +1 -0
- package/dist/lib/components/Avatar/hooks/use-gravatar-url.d.ts +2 -0
- package/dist/lib/components/AvatarGroup/AvatarGroup.d.ts +16 -0
- package/dist/lib/components/AvatarGroup/AvatarGroup.types.d.ts +19 -0
- package/dist/lib/components/BadgeGroup/BadgeGroup.d.ts +15 -0
- package/dist/lib/components/BadgeGroup/BadgeGroup.types.d.ts +25 -0
- package/dist/lib/components/BadgeGroup/hooks/index.d.ts +1 -0
- package/dist/lib/components/BadgeGroup/hooks/use-visible-badge-count/use-visible-badge-count.d.ts +2 -0
- package/dist/lib/components/BadgeGroup/hooks/use-visible-badge-count/use-visible-badge-count.types.d.ts +10 -0
- package/dist/lib/components/Breadcrumb/Breadcrumb.types.d.ts +4 -0
- package/dist/lib/components/Breadcrumb/components/CollapsedSteps/CollapsedSteps.d.ts +3 -0
- package/dist/lib/components/Breadcrumb/components/CollapsedSteps/CollapsedSteps.types.d.ts +5 -0
- package/dist/lib/components/Breadcrumb/components/index.d.ts +1 -0
- package/dist/lib/components/Button/Button.variants.d.ts +1 -1
- package/dist/lib/components/CheckboxCard/CheckboxCard.d.ts +20 -0
- package/dist/lib/components/CheckboxCard/CheckboxCard.types.d.ts +13 -0
- package/dist/lib/components/Collapse/Collapse.d.ts +19 -0
- package/dist/lib/components/Collapse/Collapse.types.d.ts +17 -0
- package/dist/lib/components/ConfirmDialog/ConfirmDialog.d.ts +23 -0
- package/dist/lib/components/ConfirmDialog/ConfirmDialog.types.d.ts +46 -0
- package/dist/lib/components/Counter/Counter.d.ts +7 -4
- package/dist/lib/components/Counter/Counter.types.d.ts +23 -0
- package/dist/lib/components/Counter/Counter.variants.d.ts +10 -1
- package/dist/lib/components/DateRangePicker/components/CalendarPanel/components/CalendarMonth/components/CalendarMonthContent/CalendarMonthContent.d.ts +3 -0
- package/dist/lib/components/Datepicker/components/DatePickerContent/DatePickerContent.d.ts +3 -0
- package/dist/lib/components/DropdownButton/DropdownButton.types.d.ts +11 -0
- package/dist/lib/components/Filter/hooks/index.d.ts +1 -0
- package/dist/lib/components/Filter/hooks/useLocale.d.ts +1 -0
- package/dist/lib/components/Filter/utils/index.d.ts +1 -0
- package/dist/lib/components/LineChart/components/LineChartContent/LineChartContent.d.ts +3 -0
- package/dist/lib/components/Modal/Modal.types.d.ts +2 -0
- package/dist/lib/components/Modal/components/Wrapper/Wrapper.types.d.ts +2 -0
- package/dist/lib/components/MultiSelectDropdown/MultiSelectDropdown.types.d.ts +10 -0
- package/dist/lib/components/MultiSelectDropdown/MultiSelectDropdown.variants.d.ts +4 -1
- package/dist/lib/components/OtpInput/OtpInput.d.ts +19 -0
- package/dist/lib/components/OtpInput/OtpInput.types.d.ts +32 -0
- package/dist/lib/components/PasswordRules/PasswordRules.d.ts +20 -0
- package/dist/lib/components/PasswordRules/PasswordRules.types.d.ts +24 -0
- package/dist/lib/components/PhoneNumberInput/components/PhoneNumberInputContent.d.ts +18 -0
- package/dist/lib/components/PieChart/components/PieChartContent/PieChartContent.d.ts +3 -0
- package/dist/lib/components/RadioCard/RadioCard.d.ts +11 -0
- package/dist/lib/components/RadioCard/RadioCard.types.d.ts +10 -1
- package/dist/lib/components/RadioCard/RadioCard.variants.d.ts +3 -1
- package/dist/lib/components/Sidebar/Sidebar.types.d.ts +4 -0
- package/dist/lib/components/Sidebar/components/CollapseTrigger/CollapseTrigger.types.d.ts +2 -0
- package/dist/lib/components/Sidebar/components/NavigationOption/NavigationOption.types.d.ts +6 -0
- package/dist/lib/components/Sidebar/components/NavigationOption/NavigationOption.variants.d.ts +1 -0
- package/dist/lib/components/Skeleton/Skeleton.d.ts +14 -0
- package/dist/lib/components/Skeleton/Skeleton.types.d.ts +16 -0
- package/dist/lib/components/Skeleton/Skeleton.variants.d.ts +3 -0
- package/dist/lib/components/Stepper/Stepper.types.d.ts +2 -0
- package/dist/lib/components/Stepper/Stepper.variants.d.ts +7 -4
- package/dist/lib/components/Switch/Switch.types.d.ts +7 -0
- package/dist/lib/components/Tabs/Tabs.d.ts +13 -13
- package/dist/lib/components/Tabs/Tabs.types.d.ts +14 -3
- package/dist/lib/components/Tabs/Tabs.variants.d.ts +1 -1
- package/dist/lib/components/TagsInput/TagsInput.d.ts +20 -0
- package/dist/lib/components/TagsInput/TagsInput.types.d.ts +37 -0
- package/dist/lib/components/Toast/Toast.types.d.ts +5 -0
- package/dist/lib/components/Toast/components/ToastCard/ToastCard.types.d.ts +1 -0
- package/dist/lib/components/Tooltip/Tooltip.d.ts +4 -0
- package/dist/lib/components/Tooltip/Tooltip.types.d.ts +10 -0
- package/dist/lib/components/VirtualizedTable/VirtualizedTable.d.ts +8 -2
- package/dist/lib/components/VirtualizedTable/components/Actions/Actions.types.d.ts +6 -0
- package/dist/lib/components/VirtualizedTable/components/Actions/Actions.variants.d.ts +3 -1
- package/dist/lib/components/VirtualizedTable/components/Actions/components/ActionsList/ActionsList.d.ts +1 -1
- package/dist/lib/components/VirtualizedTable/components/Actions/components/ActionsList/ActionsList.types.d.ts +2 -0
- package/dist/lib/components/VirtualizedTable/components/Actions/components/InlineActions/InlineActions.d.ts +1 -1
- package/dist/lib/components/VirtualizedTable/components/Actions/components/PortalActions/PortalActions.d.ts +1 -1
- package/dist/lib/components/VirtualizedTable/components/Actions/components/PortalActions/hooks/use-actions-menu/use-actions-menu.d.ts +4 -1
- package/dist/lib/components/VirtualizedTable/components/Actions/components/PortalActions/hooks/use-actions-menu/use-actions-menu.types.d.ts +3 -0
- package/dist/lib/components/VirtualizedTable/components/Actions/components/PortalActions/hooks/use-menu-interactions/use-menu-interactions.d.ts +3 -1
- package/dist/lib/components/VirtualizedTable/components/Actions/components/PortalActions/hooks/use-menu-interactions/use-menu-interactions.types.d.ts +1 -0
- package/dist/lib/components/VirtualizedTable/components/EmptyResults/EmptyResults.d.ts +3 -0
- package/dist/lib/components/VirtualizedTable/components/EmptyResults/EmptyResults.types.d.ts +9 -0
- package/dist/lib/components/VirtualizedTable/components/EmptyState/EmptyState.d.ts +3 -0
- package/dist/lib/components/VirtualizedTable/components/EmptyState/EmptyState.types.d.ts +8 -0
- package/dist/lib/components/VirtualizedTable/components/ErrorState/ErrorState.d.ts +3 -0
- package/dist/lib/components/VirtualizedTable/components/ErrorState/ErrorState.types.d.ts +9 -0
- package/dist/lib/components/VirtualizedTable/components/TruncateText/TruncateText.d.ts +2 -1
- package/dist/lib/components/VirtualizedTable/components/TruncateText/TruncateText.types.d.ts +8 -3
- package/dist/lib/components/VirtualizedTable/components/VirtualizedTableContent/VirtualizedTableContent.d.ts +3 -0
- package/dist/lib/components/VirtualizedTable/components/index.d.ts +3 -0
- package/dist/lib/components/VirtualizedTable/contexts/table.context.d.ts +1 -0
- package/dist/lib/components/index.d.ts +10 -0
- package/dist/package.json +31 -30
- package/dist/{phone-number.provider-BASl9fGG.js → phone-number.provider-DnuL-yYF.js} +4 -4
- package/dist/styles.css +1 -1
- package/dist/{table.provider-MQ4T5Xb5.js → table.provider-CW1fpZcF.js} +80 -79
- package/package.json +31 -30
- package/dist/AnimatePresence-BsUYG9bm.js +0 -186
- package/dist/Checkbox-CrNxsm3G.js +0 -247
- package/dist/Counter-DN50BVq6.js +0 -194
- package/dist/DropdownButton-Blhkj-Oi.js +0 -490
- package/dist/FlagSelectorList-ClKGwDpS.js +0 -918
- package/dist/Modal-Bk1I_NCC.js +0 -81
- package/dist/Spinner-smR3esbL.js +0 -47
- package/dist/Switch-CPE8v6Zh.js +0 -199
- package/dist/Toast-frCWQhFC.js +0 -76
- package/dist/components-z-LYRWfq.js +0 -124
- package/dist/dist-CNui_Egg.js +0 -451
- package/dist/dist-CR3FMRzF.js +0 -118
- package/dist/dist-D5Q2IYuC.js +0 -358
- package/dist/dist-D70ZJkHf.js +0 -29
- package/dist/dist-DZ_SU77k.js +0 -437
- package/dist/dist-LRkZdylX.js +0 -174
- package/dist/dist-f8EwfITY.js +0 -194
- package/dist/dist-pWlMx4Fi.js +0 -36
- package/dist/dist-uerXivvM.js +0 -178
- package/dist/dist-xCbHbMLA.js +0 -116
- package/dist/es2015-Hhb87ipX.js +0 -231
- package/dist/react-C685EsYG.js +0 -4730
|
@@ -1,918 +0,0 @@
|
|
|
1
|
-
import { t as W } from "./utils-DnIJruo0.js";
|
|
2
|
-
import { Typography as N } from "./components/Typography/Typography.js";
|
|
3
|
-
import { usePhoneNumberContext as B } from "./components/PhoneNumberInput/contexts/phone-number.hook.js";
|
|
4
|
-
import { TruncateText as H } from "./components/PhoneNumberInput/components/TruncateText/TruncateText.js";
|
|
5
|
-
import * as z from "react";
|
|
6
|
-
import { useEffect as J, useMemo as q, useRef as U } from "react";
|
|
7
|
-
import { flushSync as G } from "react-dom";
|
|
8
|
-
import { jsx as y, jsxs as Q } from "react/jsx-runtime";
|
|
9
|
-
function X(r) {
|
|
10
|
-
return typeof r == "object" ? r.key : r;
|
|
11
|
-
}
|
|
12
|
-
function Y(r, e) {
|
|
13
|
-
const s = r.length;
|
|
14
|
-
return new Proxy(r, { get(t, n, i) {
|
|
15
|
-
if (typeof n == "string") {
|
|
16
|
-
const l = n.charCodeAt(0);
|
|
17
|
-
if (l >= 48 && l <= 57) {
|
|
18
|
-
const o = +n;
|
|
19
|
-
if (Number.isInteger(o) && o >= 0 && o < s) {
|
|
20
|
-
let a = t[o];
|
|
21
|
-
if (typeof a != "object") {
|
|
22
|
-
const f = e[o * 2];
|
|
23
|
-
a = t[o] = {
|
|
24
|
-
index: o,
|
|
25
|
-
key: a,
|
|
26
|
-
start: f,
|
|
27
|
-
size: e[o * 2 + 1],
|
|
28
|
-
end: f + e[o * 2 + 1],
|
|
29
|
-
lane: 0
|
|
30
|
-
};
|
|
31
|
-
}
|
|
32
|
-
return a;
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
if (n === "length") return s;
|
|
36
|
-
}
|
|
37
|
-
return Reflect.get(t, n, i);
|
|
38
|
-
} });
|
|
39
|
-
}
|
|
40
|
-
function w(r, e, s) {
|
|
41
|
-
let t = s.initialDeps ?? [], n, i = !0;
|
|
42
|
-
function l() {
|
|
43
|
-
var o;
|
|
44
|
-
const a = process.env.NODE_ENV !== "production" && !!s.key && !!((o = s.debug) != null && o.call(s));
|
|
45
|
-
let f = 0;
|
|
46
|
-
a && (f = Date.now());
|
|
47
|
-
const u = r();
|
|
48
|
-
if (!(u.length !== t.length || u.some((d, m) => t[m] !== d))) return n;
|
|
49
|
-
t = u;
|
|
50
|
-
let h = 0;
|
|
51
|
-
if (a && (h = Date.now()), n = e(...u), a) {
|
|
52
|
-
const d = Math.round((Date.now() - f) * 100) / 100, m = Math.round((Date.now() - h) * 100) / 100, g = m / 16, v = (p, c) => {
|
|
53
|
-
for (p = String(p); p.length < c; ) p = " " + p;
|
|
54
|
-
return p;
|
|
55
|
-
};
|
|
56
|
-
console.info(`%c⏱ ${v(m, 5)} /${v(d, 5)} ms`, `
|
|
57
|
-
font-size: .6rem;
|
|
58
|
-
font-weight: bold;
|
|
59
|
-
color: hsl(${Math.max(0, Math.min(120 - 120 * g, 120))}deg 100% 31%);`, s?.key);
|
|
60
|
-
}
|
|
61
|
-
return s?.onChange && !(i && s.skipInitialOnChange) && s.onChange(n), i = !1, n;
|
|
62
|
-
}
|
|
63
|
-
return l.updateDeps = (o) => {
|
|
64
|
-
t = o;
|
|
65
|
-
}, l;
|
|
66
|
-
}
|
|
67
|
-
function V(r, e) {
|
|
68
|
-
if (r === void 0) throw new Error(`Unexpected undefined${e ? `: ${e}` : ""}`);
|
|
69
|
-
return r;
|
|
70
|
-
}
|
|
71
|
-
var K = (r, e) => Math.abs(r - e) < 1.01, Z = (r, e, s) => {
|
|
72
|
-
let t;
|
|
73
|
-
return Object.assign(function(...n) {
|
|
74
|
-
r.clearTimeout(t), t = r.setTimeout(() => e.apply(this, n), s);
|
|
75
|
-
}, { cancel: () => {
|
|
76
|
-
r.clearTimeout(t);
|
|
77
|
-
} });
|
|
78
|
-
}, R, F = () => {
|
|
79
|
-
if (R !== void 0) return R;
|
|
80
|
-
if (typeof navigator > "u") return R = !1;
|
|
81
|
-
if (/iP(hone|od|ad)/.test(navigator.userAgent)) return R = !0;
|
|
82
|
-
const r = navigator.maxTouchPoints;
|
|
83
|
-
return R = navigator.platform === "MacIntel" && r !== void 0 && r > 0;
|
|
84
|
-
}, P = (r) => {
|
|
85
|
-
const { offsetWidth: e, offsetHeight: s } = r;
|
|
86
|
-
return {
|
|
87
|
-
width: e,
|
|
88
|
-
height: s
|
|
89
|
-
};
|
|
90
|
-
}, tt = (r) => r, et = (r) => {
|
|
91
|
-
const e = Math.max(r.startIndex - r.overscan, 0), s = Math.min(r.endIndex + r.overscan, r.count - 1) - e + 1, t = new Array(s);
|
|
92
|
-
for (let n = 0; n < s; n++) t[n] = e + n;
|
|
93
|
-
return t;
|
|
94
|
-
}, st = (r, e) => {
|
|
95
|
-
const s = r.scrollElement;
|
|
96
|
-
if (!s) return;
|
|
97
|
-
const t = r.targetWindow;
|
|
98
|
-
if (!t) return;
|
|
99
|
-
const n = (l) => {
|
|
100
|
-
const { width: o, height: a } = l;
|
|
101
|
-
e({
|
|
102
|
-
width: Math.round(o),
|
|
103
|
-
height: Math.round(a)
|
|
104
|
-
});
|
|
105
|
-
};
|
|
106
|
-
if (n(P(s)), !t.ResizeObserver) return () => {
|
|
107
|
-
};
|
|
108
|
-
const i = new t.ResizeObserver((l) => {
|
|
109
|
-
const o = () => {
|
|
110
|
-
const a = l[0];
|
|
111
|
-
if (a?.borderBoxSize) {
|
|
112
|
-
const f = a.borderBoxSize[0];
|
|
113
|
-
if (f) {
|
|
114
|
-
n({
|
|
115
|
-
width: f.inlineSize,
|
|
116
|
-
height: f.blockSize
|
|
117
|
-
});
|
|
118
|
-
return;
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
n(P(s));
|
|
122
|
-
};
|
|
123
|
-
r.options.useAnimationFrameWithResizeObserver ? requestAnimationFrame(o) : o();
|
|
124
|
-
});
|
|
125
|
-
return i.observe(s, { box: "border-box" }), () => {
|
|
126
|
-
i.unobserve(s);
|
|
127
|
-
};
|
|
128
|
-
}, j = { passive: !0 }, nt = typeof window > "u" ? !0 : "onscrollend" in window, it = (r, e, s) => {
|
|
129
|
-
const t = r.scrollElement;
|
|
130
|
-
if (!t) return;
|
|
131
|
-
const n = r.targetWindow;
|
|
132
|
-
if (!n) return;
|
|
133
|
-
const i = r.options.useScrollendEvent && nt;
|
|
134
|
-
let l = 0;
|
|
135
|
-
const o = i ? null : Z(n, () => e(s(t), !1), r.options.isScrollingResetDelay), a = (h) => () => {
|
|
136
|
-
l = s(t), o?.(), e(l, h);
|
|
137
|
-
}, f = a(!0), u = a(!1);
|
|
138
|
-
return t.addEventListener("scroll", f, j), i && t.addEventListener("scrollend", u, j), () => {
|
|
139
|
-
t.removeEventListener("scroll", f), i && t.removeEventListener("scrollend", u), o?.cancel();
|
|
140
|
-
};
|
|
141
|
-
}, lt = (r, e) => it(r, e, (s) => {
|
|
142
|
-
const { horizontal: t, isRtl: n } = r.options;
|
|
143
|
-
return t ? s.scrollLeft * (n && -1 || 1) : s.scrollTop;
|
|
144
|
-
}), ot = (r, e, s) => {
|
|
145
|
-
if (s.options.useCachedMeasurements) {
|
|
146
|
-
const t = s.indexFromElement(r), n = s.options.getItemKey(t);
|
|
147
|
-
return s.itemSizeCache.get(n) ?? s.options.estimateSize(t);
|
|
148
|
-
}
|
|
149
|
-
if (e?.borderBoxSize) {
|
|
150
|
-
const t = e.borderBoxSize[0];
|
|
151
|
-
if (t) return Math.round(t[s.options.horizontal ? "inlineSize" : "blockSize"]);
|
|
152
|
-
}
|
|
153
|
-
if (!e) {
|
|
154
|
-
const t = s.indexFromElement(r), n = s.options.getItemKey(t), i = s.itemSizeCache.get(n);
|
|
155
|
-
if (i !== void 0) return i;
|
|
156
|
-
}
|
|
157
|
-
return r[s.options.horizontal ? "offsetWidth" : "offsetHeight"];
|
|
158
|
-
}, rt = (r, { adjustments: e = 0, behavior: s }, t) => {
|
|
159
|
-
var n, i;
|
|
160
|
-
(i = (n = t.scrollElement) == null ? void 0 : n.scrollTo) == null || i.call(n, {
|
|
161
|
-
[t.options.horizontal ? "left" : "top"]: r + e,
|
|
162
|
-
behavior: s
|
|
163
|
-
});
|
|
164
|
-
}, at = rt;
|
|
165
|
-
function ht(r, e, s, t) {
|
|
166
|
-
if (e === 0) return !1;
|
|
167
|
-
const n = t(0), i = /* @__PURE__ */ new Set();
|
|
168
|
-
let l = 0;
|
|
169
|
-
for (; l < r; ) {
|
|
170
|
-
const a = s(l);
|
|
171
|
-
if (a === n) break;
|
|
172
|
-
i.add(a), l++;
|
|
173
|
-
}
|
|
174
|
-
const o = r - l;
|
|
175
|
-
if (o === 0 || o >= e) return !1;
|
|
176
|
-
for (let a = 0; a < o; a++) if (t(a) !== s(l + a)) return !1;
|
|
177
|
-
for (let a = o; a < e; a++) if (i.has(t(a))) return !1;
|
|
178
|
-
return !0;
|
|
179
|
-
}
|
|
180
|
-
var ct = class {
|
|
181
|
-
constructor(r) {
|
|
182
|
-
this.unsubs = [], this.scrollElement = null, this.targetWindow = null, this.isScrolling = !1, this.scrollState = null, this.measurementsCache = [], this._singleLaneMeasurements = 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._clampedAdjustment = null, this.elementsCache = /* @__PURE__ */ new Map(), this.now = () => {
|
|
183
|
-
var e, s, t;
|
|
184
|
-
return ((t = (s = (e = this.targetWindow) == null ? void 0 : e.performance) == null ? void 0 : s.now) == null ? void 0 : t.call(s)) ?? Date.now();
|
|
185
|
-
}, this.observer = /* @__PURE__ */ (() => {
|
|
186
|
-
let e = null;
|
|
187
|
-
const s = () => e || (!this.targetWindow || !this.targetWindow.ResizeObserver ? null : e = new this.targetWindow.ResizeObserver((t) => {
|
|
188
|
-
t.forEach((n) => {
|
|
189
|
-
const i = () => {
|
|
190
|
-
const l = n.target, o = this.indexFromElement(l);
|
|
191
|
-
if (!l.isConnected) {
|
|
192
|
-
this.observer.unobserve(l);
|
|
193
|
-
for (const [a, f] of this.elementsCache) if (f === l) {
|
|
194
|
-
this.elementsCache.delete(a);
|
|
195
|
-
break;
|
|
196
|
-
}
|
|
197
|
-
return;
|
|
198
|
-
}
|
|
199
|
-
this.isIndexInRange(o) && this.shouldMeasureDuringScroll(o) && this.resizeItem(o, this.options.measureElement(l, n, this));
|
|
200
|
-
};
|
|
201
|
-
this.options.useAnimationFrameWithResizeObserver ? requestAnimationFrame(i) : i();
|
|
202
|
-
});
|
|
203
|
-
}));
|
|
204
|
-
return {
|
|
205
|
-
disconnect: () => {
|
|
206
|
-
var t;
|
|
207
|
-
(t = s()) == null || t.disconnect(), e = null;
|
|
208
|
-
},
|
|
209
|
-
observe: (t) => {
|
|
210
|
-
var n;
|
|
211
|
-
return (n = s()) == null ? void 0 : n.observe(t, { box: "border-box" });
|
|
212
|
-
},
|
|
213
|
-
unobserve: (t) => {
|
|
214
|
-
var n;
|
|
215
|
-
return (n = s()) == null ? void 0 : n.unobserve(t);
|
|
216
|
-
}
|
|
217
|
-
};
|
|
218
|
-
})(), this.range = null, this.setOptions = (e) => {
|
|
219
|
-
var s;
|
|
220
|
-
const t = {
|
|
221
|
-
debug: !1,
|
|
222
|
-
initialOffset: 0,
|
|
223
|
-
overscan: 1,
|
|
224
|
-
paddingStart: 0,
|
|
225
|
-
paddingEnd: 0,
|
|
226
|
-
scrollPaddingStart: 0,
|
|
227
|
-
scrollPaddingEnd: 0,
|
|
228
|
-
horizontal: !1,
|
|
229
|
-
getItemKey: tt,
|
|
230
|
-
rangeExtractor: et,
|
|
231
|
-
onChange: () => {
|
|
232
|
-
},
|
|
233
|
-
measureElement: ot,
|
|
234
|
-
initialRect: {
|
|
235
|
-
width: 0,
|
|
236
|
-
height: 0
|
|
237
|
-
},
|
|
238
|
-
scrollMargin: 0,
|
|
239
|
-
gap: 0,
|
|
240
|
-
indexAttribute: "data-index",
|
|
241
|
-
initialMeasurementsCache: [],
|
|
242
|
-
lanes: 1,
|
|
243
|
-
anchorTo: "start",
|
|
244
|
-
followOnAppend: !1,
|
|
245
|
-
scrollEndThreshold: 1,
|
|
246
|
-
isScrollingResetDelay: 150,
|
|
247
|
-
enabled: !0,
|
|
248
|
-
isRtl: !1,
|
|
249
|
-
useScrollendEvent: !1,
|
|
250
|
-
useAnimationFrameWithResizeObserver: !1,
|
|
251
|
-
laneAssignmentMode: "estimate",
|
|
252
|
-
useCachedMeasurements: !1
|
|
253
|
-
};
|
|
254
|
-
for (const u in e) {
|
|
255
|
-
const h = e[u];
|
|
256
|
-
h !== void 0 && (t[u] = h);
|
|
257
|
-
}
|
|
258
|
-
const n = this.options;
|
|
259
|
-
let i = null, l = null, o = !1;
|
|
260
|
-
if (n !== void 0 && n.enabled && t.enabled && t.anchorTo === "end" && this.scrollElement !== null) {
|
|
261
|
-
const u = n.count, h = t.count, d = this.getMeasurements(), m = ((s = this._singleLaneMeasurements) == null ? void 0 : s.items) ?? d, g = (c) => X(m[c]), v = u > 0 ? g(0) : null, p = u > 0 ? g(u - 1) : null;
|
|
262
|
-
if (h !== u || u > 0 && h > 0 && (t.getItemKey(0) !== v || t.getItemKey(h - 1) !== p)) {
|
|
263
|
-
o = !0;
|
|
264
|
-
const c = u > 0 ? this.getVirtualItemForOffset(this.getScrollOffset()) ?? d[0] : null;
|
|
265
|
-
c && (i = [c.key, this.getScrollOffset() - c.start]);
|
|
266
|
-
const S = t.followOnAppend === !0 ? "auto" : t.followOnAppend || null;
|
|
267
|
-
S && h > 0 && this.isAtEnd(n.scrollEndThreshold) && (u === 0 || t.getItemKey(h - 1) !== p) && (h > u || ht(u, h, g, t.getItemKey)) && (l = S);
|
|
268
|
-
}
|
|
269
|
-
}
|
|
270
|
-
this.options = t, o && (this.pendingMin = 0, this.itemSizeCacheVersion++);
|
|
271
|
-
let a = !1, f = 0;
|
|
272
|
-
if (i && this.scrollOffset !== null) {
|
|
273
|
-
const [u, h] = i, d = this.getMeasurements(), { count: m, getItemKey: g } = this.options;
|
|
274
|
-
let v = 0;
|
|
275
|
-
for (; v < m && g(v) !== u; ) v++;
|
|
276
|
-
if (v < m) {
|
|
277
|
-
const p = d[v];
|
|
278
|
-
if (p) {
|
|
279
|
-
const c = Math.max(0, p.start + h);
|
|
280
|
-
!l && c !== this.scrollOffset && (f = c - this.scrollOffset, this.scrollOffset = c, a = !0);
|
|
281
|
-
}
|
|
282
|
-
}
|
|
283
|
-
}
|
|
284
|
-
(a || l) && (this.pendingScrollAnchor = [
|
|
285
|
-
a ? i[0] : null,
|
|
286
|
-
a ? i[1] : 0,
|
|
287
|
-
l,
|
|
288
|
-
f
|
|
289
|
-
]);
|
|
290
|
-
}, this.notify = (e) => {
|
|
291
|
-
var s, t;
|
|
292
|
-
(t = (s = this.options).onChange) == null || t.call(s, this, e);
|
|
293
|
-
}, this.maybeNotify = w(() => (this.calculateRange(), [
|
|
294
|
-
this.isScrolling,
|
|
295
|
-
this.range ? this.range.startIndex : null,
|
|
296
|
-
this.range ? this.range.endIndex : null
|
|
297
|
-
]), (e) => {
|
|
298
|
-
this.notify(e);
|
|
299
|
-
}, {
|
|
300
|
-
key: process.env.NODE_ENV !== "production" && "maybeNotify",
|
|
301
|
-
debug: () => this.options.debug,
|
|
302
|
-
initialDeps: [
|
|
303
|
-
this.isScrolling,
|
|
304
|
-
this.range ? this.range.startIndex : null,
|
|
305
|
-
this.range ? this.range.endIndex : null
|
|
306
|
-
]
|
|
307
|
-
}), this.cleanup = () => {
|
|
308
|
-
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.isScrolling = !1, this.scrollDirection = null, this._iosDeferredAdjustment = 0, this._iosTouching = !1, this._iosJustTouchEnded = !1, this._clampedAdjustment = null, this.scrollElement = null, this.targetWindow = null;
|
|
309
|
-
}, this._didMount = () => () => {
|
|
310
|
-
this.cleanup();
|
|
311
|
-
}, this._willUpdate = () => {
|
|
312
|
-
var e, s;
|
|
313
|
-
const t = this.options.enabled ? this.options.getScrollElement() : null;
|
|
314
|
-
if (this.scrollElement !== t) {
|
|
315
|
-
if (this.cleanup(), !t) {
|
|
316
|
-
this.maybeNotify();
|
|
317
|
-
return;
|
|
318
|
-
}
|
|
319
|
-
if (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((i) => {
|
|
320
|
-
this.observer.observe(i);
|
|
321
|
-
}), this.unsubs.push(this.options.observeElementRect(this, (i) => {
|
|
322
|
-
this.scrollRect = i, this.maybeNotify();
|
|
323
|
-
})), this.unsubs.push(this.options.observeElementOffset(this, (i, l) => {
|
|
324
|
-
if (l && this._intendedScrollOffset === null && i === this.scrollOffset) return;
|
|
325
|
-
this._intendedScrollOffset !== null && Math.abs(i - this._intendedScrollOffset) < 1.5 && (i = this._intendedScrollOffset), this._intendedScrollOffset = null, this._clampedAdjustment !== null && Math.abs(i - this._clampedAdjustment.maxAtWrite) >= 1.5 && (this._clampedAdjustment = null), this.scrollAdjustments = 0;
|
|
326
|
-
const o = this.getScrollOffset();
|
|
327
|
-
this.scrollDirection = l ? o === i ? this.scrollDirection : o < i ? "forward" : "backward" : null, this.scrollOffset = i, this.isScrolling = l, this._flushIosDeferredIfReady(), this.scrollState && this.scheduleScrollReconcile(), this.maybeNotify();
|
|
328
|
-
})), "addEventListener" in this.scrollElement) {
|
|
329
|
-
const i = this.scrollElement, l = () => {
|
|
330
|
-
this._iosTouching = !0, this._iosJustTouchEnded = !1, this._iosTouchEndTimerId !== null && this.targetWindow != null && (this.targetWindow.clearTimeout(this._iosTouchEndTimerId), this._iosTouchEndTimerId = null);
|
|
331
|
-
}, o = () => {
|
|
332
|
-
this._iosTouching = !1, !(!F() || this.targetWindow == null) && (this._iosJustTouchEnded = !0, this._iosTouchEndTimerId = this.targetWindow.setTimeout(() => {
|
|
333
|
-
this._iosJustTouchEnded = !1, this._iosTouchEndTimerId = null, this._flushIosDeferredIfReady();
|
|
334
|
-
}, 150));
|
|
335
|
-
};
|
|
336
|
-
i.addEventListener("touchstart", l, j), i.addEventListener("touchend", o, j), this.unsubs.push(() => {
|
|
337
|
-
i.removeEventListener("touchstart", l), i.removeEventListener("touchend", o), this._iosTouchEndTimerId !== null && this.targetWindow != null && (this.targetWindow.clearTimeout(this._iosTouchEndTimerId), this._iosTouchEndTimerId = null);
|
|
338
|
-
});
|
|
339
|
-
}
|
|
340
|
-
this._scrollToOffset(this.getScrollOffset(), {
|
|
341
|
-
adjustments: void 0,
|
|
342
|
-
behavior: void 0
|
|
343
|
-
});
|
|
344
|
-
}
|
|
345
|
-
const n = this.pendingScrollAnchor;
|
|
346
|
-
if (this.pendingScrollAnchor = null, n && this.scrollElement && this.options.enabled) {
|
|
347
|
-
const [i, l, o, a] = n;
|
|
348
|
-
i !== null && !o && (F() && (this.isScrolling || this._iosTouching || this._iosJustTouchEnded) ? a !== 0 && (this._iosDeferredAdjustment += a) : ((s = this.scrollState) == null ? void 0 : s.behavior) === "smooth" && !K(this.getScrollOffset() - a, this.scrollState.lastTargetOffset) || this._scrollToOffset(this.getScrollOffset(), {
|
|
349
|
-
adjustments: void 0,
|
|
350
|
-
behavior: void 0
|
|
351
|
-
})), o && this.scrollToEnd({ behavior: o });
|
|
352
|
-
}
|
|
353
|
-
this._retryClampedAdjustment();
|
|
354
|
-
}, this._retryClampedAdjustment = () => {
|
|
355
|
-
if (this._clampedAdjustment === null || !this.scrollElement || !this.options.enabled) return;
|
|
356
|
-
const { target: e, maxAtWrite: s } = this._clampedAdjustment, t = this.getMaxScrollOffset();
|
|
357
|
-
t > s + 0.5 && (this._clampedAdjustment = e > t + 0.5 ? {
|
|
358
|
-
target: e,
|
|
359
|
-
maxAtWrite: t
|
|
360
|
-
} : null, this._scrollToOffset(e, {
|
|
361
|
-
adjustments: void 0,
|
|
362
|
-
behavior: void 0
|
|
363
|
-
}));
|
|
364
|
-
}, this._flushIosDeferredIfReady = () => {
|
|
365
|
-
if (this._iosDeferredAdjustment === 0 || this.isScrolling || this._iosTouching || this._iosJustTouchEnded) return;
|
|
366
|
-
const e = this.getScrollOffset(), s = this.getMaxScrollOffset();
|
|
367
|
-
if (e < 0 || e > s) return;
|
|
368
|
-
if (this._iosDeferredAdjustment < 0 && e >= s - 1) {
|
|
369
|
-
this._iosDeferredAdjustment = 0;
|
|
370
|
-
return;
|
|
371
|
-
}
|
|
372
|
-
const t = this._iosDeferredAdjustment;
|
|
373
|
-
this._iosDeferredAdjustment = 0, this._scrollToOffset(e, {
|
|
374
|
-
adjustments: this.scrollAdjustments += t,
|
|
375
|
-
behavior: void 0
|
|
376
|
-
});
|
|
377
|
-
}, 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 = w(() => [
|
|
378
|
-
this.options.count,
|
|
379
|
-
this.options.paddingStart,
|
|
380
|
-
this.options.scrollMargin,
|
|
381
|
-
this.options.getItemKey,
|
|
382
|
-
this.options.enabled,
|
|
383
|
-
this.options.lanes,
|
|
384
|
-
this.options.laneAssignmentMode,
|
|
385
|
-
this.options.gap
|
|
386
|
-
], (e, s, t, n, i, l, o, a) => (this.prevLanes !== void 0 && this.prevLanes !== l && (this.lanesChangedFlag = !0), this.prevLanes = l, this.pendingMin = null, {
|
|
387
|
-
count: e,
|
|
388
|
-
paddingStart: s,
|
|
389
|
-
scrollMargin: t,
|
|
390
|
-
getItemKey: n,
|
|
391
|
-
enabled: i,
|
|
392
|
-
lanes: l,
|
|
393
|
-
laneAssignmentMode: o,
|
|
394
|
-
gap: a
|
|
395
|
-
}), { key: !1 }), this.isIndexInRange = (e) => e >= 0 && e < this.options.count, this.getMeasurements = w(() => [this.getMeasurementOptions(), this.itemSizeCacheVersion], ({ count: e, paddingStart: s, scrollMargin: t, getItemKey: n, enabled: i, lanes: l, laneAssignmentMode: o, gap: a }, f) => {
|
|
396
|
-
var u;
|
|
397
|
-
const h = this.itemSizeCache;
|
|
398
|
-
if (!i)
|
|
399
|
-
return this.measurementsCache = [], this._singleLaneMeasurements = null, this.itemSizeCache.clear(), this.laneAssignments.clear(), [];
|
|
400
|
-
if (this.laneAssignments.size > e)
|
|
401
|
-
for (const c of this.laneAssignments.keys()) c >= e && this.laneAssignments.delete(c);
|
|
402
|
-
this.lanesChangedFlag && (this.lanesChangedFlag = !1, this.lanesSettling = !0, this.measurementsCache = [], this._singleLaneMeasurements = null, this.itemSizeCache.clear(), this.laneAssignments.clear(), this.pendingMin = null), this.measurementsCache.length === 0 && !this.lanesSettling && (this.measurementsCache = this.options.initialMeasurementsCache, this.measurementsCache.forEach((c) => {
|
|
403
|
-
this.itemSizeCache.set(c.key, c.size);
|
|
404
|
-
}));
|
|
405
|
-
const d = this.lanesSettling ? 0 : this.pendingMin ?? 0;
|
|
406
|
-
if (this.pendingMin = null, this.lanesSettling && this.measurementsCache.length === e && (this.lanesSettling = !1), l === 1) {
|
|
407
|
-
const c = e * 2;
|
|
408
|
-
let S = (u = this._singleLaneMeasurements) == null ? void 0 : u.flat;
|
|
409
|
-
if (!S || S.length < c) {
|
|
410
|
-
const E = new Float64Array(c);
|
|
411
|
-
S && d > 0 && E.set(S.subarray(0, d * 2)), S = E;
|
|
412
|
-
}
|
|
413
|
-
const x = d === 0 ? new Array(e) : this._singleLaneMeasurements.items.slice();
|
|
414
|
-
let b;
|
|
415
|
-
if (d === 0) b = s + t;
|
|
416
|
-
else {
|
|
417
|
-
const E = d - 1;
|
|
418
|
-
b = S[E * 2] + S[E * 2 + 1] + a;
|
|
419
|
-
}
|
|
420
|
-
for (let E = d; E < e; E++) {
|
|
421
|
-
const A = n(E);
|
|
422
|
-
x[E] = A;
|
|
423
|
-
const T = h.get(A), M = typeof T == "number" ? T : this.options.estimateSize(E);
|
|
424
|
-
S[E * 2] = b, S[E * 2 + 1] = M, b += M + a;
|
|
425
|
-
}
|
|
426
|
-
this._singleLaneMeasurements = {
|
|
427
|
-
flat: S,
|
|
428
|
-
items: x
|
|
429
|
-
};
|
|
430
|
-
const O = Y(x, S);
|
|
431
|
-
return this.measurementsCache = O, O;
|
|
432
|
-
}
|
|
433
|
-
const m = this.measurementsCache.slice(0, d), g = new Array(l).fill(void 0), v = new Float64Array(l);
|
|
434
|
-
let p = 0;
|
|
435
|
-
for (let c = 0; c < d; c++) {
|
|
436
|
-
const S = m[c];
|
|
437
|
-
S && (g[S.lane] === void 0 && p++, g[S.lane] = c, v[S.lane] = S.end);
|
|
438
|
-
}
|
|
439
|
-
for (let c = d; c < e; c++) {
|
|
440
|
-
const S = n(c), x = this.laneAssignments.get(c);
|
|
441
|
-
let b, O;
|
|
442
|
-
const E = o === "estimate" || h.has(S);
|
|
443
|
-
if (x !== void 0 && this.options.lanes > 1) {
|
|
444
|
-
b = x;
|
|
445
|
-
const C = g[b], _ = C !== void 0 ? m[C] : void 0;
|
|
446
|
-
O = _ ? _.end + a : s + t;
|
|
447
|
-
} else if (p === l) {
|
|
448
|
-
let C = 0, _ = v[0], k = g[0];
|
|
449
|
-
for (let I = 1; I < l; I++) {
|
|
450
|
-
const D = v[I];
|
|
451
|
-
(D < _ || D === _ && g[I] < k) && (C = I, _ = D, k = g[I]);
|
|
452
|
-
}
|
|
453
|
-
b = C, O = _ + a, E && this.laneAssignments.set(c, b);
|
|
454
|
-
} else
|
|
455
|
-
b = c % this.options.lanes, O = s + t, E && this.laneAssignments.set(c, b);
|
|
456
|
-
const A = h.get(S), T = typeof A == "number" ? A : this.options.estimateSize(c), M = O + T;
|
|
457
|
-
m[c] = {
|
|
458
|
-
index: c,
|
|
459
|
-
start: O,
|
|
460
|
-
size: T,
|
|
461
|
-
end: M,
|
|
462
|
-
key: S,
|
|
463
|
-
lane: b
|
|
464
|
-
}, g[b] === void 0 && p++, g[b] = c, v[b] = M;
|
|
465
|
-
}
|
|
466
|
-
return this.measurementsCache = m, m;
|
|
467
|
-
}, {
|
|
468
|
-
key: process.env.NODE_ENV !== "production" && "getMeasurements",
|
|
469
|
-
debug: () => this.options.debug
|
|
470
|
-
}), this.calculateRange = w(() => [
|
|
471
|
-
this.getMeasurements(),
|
|
472
|
-
this.getSize(),
|
|
473
|
-
this.getScrollOffset(),
|
|
474
|
-
this.options.lanes
|
|
475
|
-
], (e, s, t, n) => e.length === 0 || s === 0 ? (this.range = null, null) : (this.range = dt(e, s, t, n, n === 1 && this._singleLaneMeasurements !== null ? this._singleLaneMeasurements.flat : null), this.range), {
|
|
476
|
-
key: process.env.NODE_ENV !== "production" && "calculateRange",
|
|
477
|
-
debug: () => this.options.debug
|
|
478
|
-
}), this.getVirtualIndexes = w(() => {
|
|
479
|
-
let e = null, s = null;
|
|
480
|
-
const t = this.calculateRange();
|
|
481
|
-
return t && (e = t.startIndex, s = t.endIndex), this.maybeNotify.updateDeps([
|
|
482
|
-
this.isScrolling,
|
|
483
|
-
e,
|
|
484
|
-
s
|
|
485
|
-
]), [
|
|
486
|
-
this.options.rangeExtractor,
|
|
487
|
-
this.options.overscan,
|
|
488
|
-
this.options.count,
|
|
489
|
-
e,
|
|
490
|
-
s
|
|
491
|
-
];
|
|
492
|
-
}, (e, s, t, n, i) => n === null || i === null ? [] : e({
|
|
493
|
-
startIndex: n,
|
|
494
|
-
endIndex: i,
|
|
495
|
-
overscan: s,
|
|
496
|
-
count: t
|
|
497
|
-
}), {
|
|
498
|
-
key: process.env.NODE_ENV !== "production" && "getVirtualIndexes",
|
|
499
|
-
debug: () => this.options.debug
|
|
500
|
-
}), this.indexFromElement = (e) => {
|
|
501
|
-
const s = this.options.indexAttribute, t = e.getAttribute(s);
|
|
502
|
-
return t ? parseInt(t, 10) : (console.warn(`Missing attribute name '${s}={index}' on measured element.`), -1);
|
|
503
|
-
}, this.shouldMeasureDuringScroll = (e) => {
|
|
504
|
-
var s;
|
|
505
|
-
if (!this.scrollState || this.scrollState.behavior !== "smooth") return !0;
|
|
506
|
-
const t = this.scrollState.index ?? ((s = this.getVirtualItemForOffset(this.scrollState.lastTargetOffset)) == null ? void 0 : s.index);
|
|
507
|
-
if (t !== void 0 && this.range) {
|
|
508
|
-
const n = Math.max(this.options.overscan, Math.ceil((this.range.endIndex - this.range.startIndex) / 2)), i = Math.max(0, t - n), l = Math.min(this.options.count - 1, t + n);
|
|
509
|
-
return e >= i && e <= l;
|
|
510
|
-
}
|
|
511
|
-
return !0;
|
|
512
|
-
}, this.measureElement = (e) => {
|
|
513
|
-
if (!e) {
|
|
514
|
-
this.elementsCache.forEach((i, l) => {
|
|
515
|
-
i.isConnected || (this.observer.unobserve(i), this.elementsCache.delete(l));
|
|
516
|
-
});
|
|
517
|
-
return;
|
|
518
|
-
}
|
|
519
|
-
const s = this.indexFromElement(e);
|
|
520
|
-
if (!this.isIndexInRange(s)) return;
|
|
521
|
-
const t = this.options.getItemKey(s), n = this.elementsCache.get(t);
|
|
522
|
-
n !== e && (n && this.observer.unobserve(n), this.observer.observe(e), this.elementsCache.set(t, e)), (!this.isScrolling || this.scrollState) && this.shouldMeasureDuringScroll(s) && this.resizeItem(s, this.options.measureElement(e, void 0, this));
|
|
523
|
-
}, this.resizeItem = (e, s) => {
|
|
524
|
-
var t, n, i;
|
|
525
|
-
if (!this.isIndexInRange(e)) return;
|
|
526
|
-
let l, o, a;
|
|
527
|
-
const f = (t = this._singleLaneMeasurements) == null ? void 0 : t.flat;
|
|
528
|
-
if (this.options.lanes === 1 && f != null)
|
|
529
|
-
a = this.options.getItemKey(e), o = f[e * 2], l = f[e * 2 + 1];
|
|
530
|
-
else {
|
|
531
|
-
const d = this.measurementsCache[e];
|
|
532
|
-
if (!d) return;
|
|
533
|
-
a = d.key, o = d.start, l = d.size;
|
|
534
|
-
}
|
|
535
|
-
const u = this.itemSizeCache.get(a) ?? l, h = s - u;
|
|
536
|
-
if (h !== 0) {
|
|
537
|
-
const d = this.options.anchorTo === "end" && ((n = this.scrollState) == null ? void 0 : n.behavior) !== "smooth" && this.getVirtualDistanceFromEnd() <= this.options.scrollEndThreshold, m = d ? this.getTotalSize() : 0, g = this.getScrollOffset() + this.scrollAdjustments, v = this.itemSizeCache.has(a) ? o + u <= g && this.scrollDirection !== "backward" : o < g, p = ((i = this.scrollState) == null ? void 0 : i.behavior) !== "smooth" && (this.shouldAdjustScrollPositionOnItemSizeChange !== void 0 ? this.shouldAdjustScrollPositionOnItemSizeChange(this.measurementsCache[e] ?? {
|
|
538
|
-
index: e,
|
|
539
|
-
key: a,
|
|
540
|
-
start: o,
|
|
541
|
-
size: l,
|
|
542
|
-
end: o + l,
|
|
543
|
-
lane: 0
|
|
544
|
-
}, h, this) : v);
|
|
545
|
-
(this.pendingMin === null || e < this.pendingMin) && (this.pendingMin = e), this.itemSizeCache.set(a, s), this.itemSizeCacheVersion++;
|
|
546
|
-
let c = !1;
|
|
547
|
-
d ? c = this.applyScrollAdjustment(this.getTotalSize() - m) : p && (c = this.applyScrollAdjustment(h)), this.notify(c), this._retryClampedAdjustment();
|
|
548
|
-
}
|
|
549
|
-
}, this.getVirtualItems = w(() => [this.getVirtualIndexes(), this.getMeasurements()], (e, s) => {
|
|
550
|
-
const t = [];
|
|
551
|
-
for (let n = 0, i = e.length; n < i; n++) {
|
|
552
|
-
const l = s[e[n]];
|
|
553
|
-
t.push(l);
|
|
554
|
-
}
|
|
555
|
-
return t;
|
|
556
|
-
}, {
|
|
557
|
-
key: process.env.NODE_ENV !== "production" && "getVirtualItems",
|
|
558
|
-
debug: () => this.options.debug
|
|
559
|
-
}), this.getVirtualItemForOffset = (e) => {
|
|
560
|
-
var s;
|
|
561
|
-
const t = this.getMeasurements();
|
|
562
|
-
if (t.length === 0) return;
|
|
563
|
-
const n = (s = this._singleLaneMeasurements) == null ? void 0 : s.flat, i = this.options.lanes === 1 && n != null, l = $(0, t.length - 1, i ? (o) => n[o * 2] : (o) => V(t[o]).start, e);
|
|
564
|
-
return V(t[l]);
|
|
565
|
-
}, this.getMaxScrollOffset = () => {
|
|
566
|
-
if (!this.scrollElement) return 0;
|
|
567
|
-
if ("scrollHeight" in this.scrollElement) return this.options.horizontal ? this.scrollElement.scrollWidth - this.scrollElement.clientWidth : this.scrollElement.scrollHeight - this.scrollElement.clientHeight;
|
|
568
|
-
{
|
|
569
|
-
const e = this.scrollElement.document.documentElement;
|
|
570
|
-
return this.options.horizontal ? e.scrollWidth - this.scrollElement.innerWidth : e.scrollHeight - this.scrollElement.innerHeight;
|
|
571
|
-
}
|
|
572
|
-
}, this.getVirtualDistanceFromEnd = () => Math.max(this.getTotalSize() - this.getSize() - this.getScrollOffset(), 0), this.getDistanceFromEnd = () => Math.max(this.getMaxScrollOffset() - this.getScrollOffset(), 0), this.isAtEnd = (e = this.options.scrollEndThreshold) => this.getDistanceFromEnd() <= e, this.getOffsetForAlignment = (e, s, t = 0) => {
|
|
573
|
-
if (!this.scrollElement) return 0;
|
|
574
|
-
const n = this.getSize(), i = this.getScrollOffset();
|
|
575
|
-
s === "auto" && (s = e >= i + n ? "end" : "start"), s === "center" ? e += (t - n) / 2 : s === "end" && (e -= n);
|
|
576
|
-
const l = this.getMaxScrollOffset();
|
|
577
|
-
return Math.max(Math.min(l, e), 0);
|
|
578
|
-
}, this.getOffsetForIndex = (e, s = "auto") => {
|
|
579
|
-
e = Math.max(0, Math.min(e, this.options.count - 1));
|
|
580
|
-
const t = this.getSize(), n = this.getScrollOffset(), i = this.measurementsCache[e];
|
|
581
|
-
if (!i) return;
|
|
582
|
-
if (s === "auto")
|
|
583
|
-
if (i.end >= n + t - this.options.scrollPaddingEnd) s = "end";
|
|
584
|
-
else if (i.start <= n + this.options.scrollPaddingStart) s = "start";
|
|
585
|
-
else return [n, s];
|
|
586
|
-
if (s === "end" && e === this.options.count - 1) return [this.getMaxScrollOffset(), s];
|
|
587
|
-
const l = s === "end" ? i.end + this.options.scrollPaddingEnd : i.start - this.options.scrollPaddingStart;
|
|
588
|
-
return [this.getOffsetForAlignment(l, s, i.size), s];
|
|
589
|
-
}, this.scrollToOffset = (e, { align: s = "start", behavior: t = "auto" } = {}) => {
|
|
590
|
-
this._iosDeferredAdjustment = 0;
|
|
591
|
-
const n = this.getOffsetForAlignment(e, s), i = this.now();
|
|
592
|
-
this.scrollState = {
|
|
593
|
-
index: null,
|
|
594
|
-
align: s,
|
|
595
|
-
behavior: t,
|
|
596
|
-
startedAt: i,
|
|
597
|
-
lastTargetOffset: n,
|
|
598
|
-
stableFrames: 0
|
|
599
|
-
}, this._scrollToOffset(n, {
|
|
600
|
-
adjustments: void 0,
|
|
601
|
-
behavior: t
|
|
602
|
-
}), this.scheduleScrollReconcile();
|
|
603
|
-
}, this.scrollToIndex = (e, { align: s = "auto", behavior: t = "auto" } = {}) => {
|
|
604
|
-
this._iosDeferredAdjustment = 0, e = Math.max(0, Math.min(e, this.options.count - 1));
|
|
605
|
-
const n = this.getOffsetForIndex(e, s);
|
|
606
|
-
if (!n) return;
|
|
607
|
-
const [i, l] = n, o = this.now();
|
|
608
|
-
this.scrollState = {
|
|
609
|
-
index: e,
|
|
610
|
-
align: l,
|
|
611
|
-
behavior: t,
|
|
612
|
-
startedAt: o,
|
|
613
|
-
lastTargetOffset: i,
|
|
614
|
-
stableFrames: 0
|
|
615
|
-
}, this._scrollToOffset(i, {
|
|
616
|
-
adjustments: void 0,
|
|
617
|
-
behavior: t
|
|
618
|
-
}), this.scheduleScrollReconcile();
|
|
619
|
-
}, this.scrollBy = (e, { behavior: s = "auto" } = {}) => {
|
|
620
|
-
const t = this.getScrollOffset() + e, n = this.now();
|
|
621
|
-
this.scrollState = {
|
|
622
|
-
index: null,
|
|
623
|
-
align: "start",
|
|
624
|
-
behavior: s,
|
|
625
|
-
startedAt: n,
|
|
626
|
-
lastTargetOffset: t,
|
|
627
|
-
stableFrames: 0
|
|
628
|
-
}, this._scrollToOffset(t, {
|
|
629
|
-
adjustments: void 0,
|
|
630
|
-
behavior: s
|
|
631
|
-
}), this.scheduleScrollReconcile();
|
|
632
|
-
}, this.scrollToEnd = ({ behavior: e = "auto" } = {}) => {
|
|
633
|
-
if (this.options.count > 0) {
|
|
634
|
-
this.scrollToIndex(this.options.count - 1, {
|
|
635
|
-
align: "end",
|
|
636
|
-
behavior: e
|
|
637
|
-
});
|
|
638
|
-
return;
|
|
639
|
-
}
|
|
640
|
-
this.scrollToOffset(Math.max(this.getTotalSize() - this.getSize(), 0), { behavior: e });
|
|
641
|
-
}, this.getTotalSize = () => {
|
|
642
|
-
var e, s;
|
|
643
|
-
const t = this.getMeasurements();
|
|
644
|
-
let n;
|
|
645
|
-
if (t.length === 0) n = this.options.paddingStart;
|
|
646
|
-
else if (this.options.lanes === 1) {
|
|
647
|
-
const i = t.length - 1, l = (e = this._singleLaneMeasurements) == null ? void 0 : e.flat;
|
|
648
|
-
l != null ? n = l[i * 2] + l[i * 2 + 1] : n = ((s = t[i]) == null ? void 0 : s.end) ?? 0;
|
|
649
|
-
} else {
|
|
650
|
-
const i = Array(this.options.lanes).fill(null);
|
|
651
|
-
let l = t.length - 1;
|
|
652
|
-
for (; l >= 0 && i.some((o) => o === null); ) {
|
|
653
|
-
const o = t[l];
|
|
654
|
-
i[o.lane] === null && (i[o.lane] = o.end), l--;
|
|
655
|
-
}
|
|
656
|
-
n = Math.max(...i.filter((o) => o !== null));
|
|
657
|
-
}
|
|
658
|
-
return Math.max(n - this.options.scrollMargin + this.options.paddingEnd, 0);
|
|
659
|
-
}, this.takeSnapshot = () => {
|
|
660
|
-
const e = [];
|
|
661
|
-
if (this.itemSizeCache.size === 0) return e;
|
|
662
|
-
const s = this.getMeasurements();
|
|
663
|
-
for (const t of s) t && this.itemSizeCache.has(t.key) && e.push({
|
|
664
|
-
index: t.index,
|
|
665
|
-
key: t.key,
|
|
666
|
-
start: t.start,
|
|
667
|
-
size: t.size,
|
|
668
|
-
end: t.end,
|
|
669
|
-
lane: t.lane
|
|
670
|
-
});
|
|
671
|
-
return e;
|
|
672
|
-
}, this._scrollToOffset = (e, { adjustments: s, behavior: t }) => {
|
|
673
|
-
this._intendedScrollOffset = e + (s ?? 0), this.options.scrollToFn(e, {
|
|
674
|
-
behavior: t,
|
|
675
|
-
adjustments: s
|
|
676
|
-
}, this);
|
|
677
|
-
}, this.measure = () => {
|
|
678
|
-
this.pendingMin = null, this.itemSizeCache.clear(), this.laneAssignments.clear(), this.itemSizeCacheVersion++, this.notify(!1);
|
|
679
|
-
}, this.setOptions(r);
|
|
680
|
-
}
|
|
681
|
-
applyScrollAdjustment(r, e) {
|
|
682
|
-
if (r === 0) return !1;
|
|
683
|
-
if (process.env.NODE_ENV !== "production" && this.options.debug && console.info("correction", r), F() && (this.isScrolling || this._iosTouching || this._iosJustTouchEnded))
|
|
684
|
-
return this._iosDeferredAdjustment += r, !1;
|
|
685
|
-
{
|
|
686
|
-
const s = this.getScrollOffset() + this.scrollAdjustments + r, t = this.scrollElement, n = t !== null && ("scrollHeight" in t || "document" in t) ? this.getMaxScrollOffset() : null;
|
|
687
|
-
return this._clampedAdjustment = n !== null && s > n + 0.5 ? {
|
|
688
|
-
target: s,
|
|
689
|
-
maxAtWrite: n
|
|
690
|
-
} : null, this._scrollToOffset(this.getScrollOffset(), {
|
|
691
|
-
adjustments: this.scrollAdjustments += r,
|
|
692
|
-
behavior: e
|
|
693
|
-
}), this.scrollOffset !== null && (this.scrollOffset += this.scrollAdjustments, this.scrollOffset < 0 && (this.scrollOffset = 0), this.scrollAdjustments = 0), !0;
|
|
694
|
-
}
|
|
695
|
-
}
|
|
696
|
-
scheduleScrollReconcile() {
|
|
697
|
-
if (!this.targetWindow) {
|
|
698
|
-
this.scrollState = null;
|
|
699
|
-
return;
|
|
700
|
-
}
|
|
701
|
-
this.rafId == null && (this.rafId = this.targetWindow.requestAnimationFrame(() => {
|
|
702
|
-
this.rafId = null, this.reconcileScroll();
|
|
703
|
-
}));
|
|
704
|
-
}
|
|
705
|
-
reconcileScroll() {
|
|
706
|
-
if (!this.scrollState || !this.scrollElement) return;
|
|
707
|
-
if (this.now() - this.scrollState.startedAt > 5e3) {
|
|
708
|
-
this.scrollState = null;
|
|
709
|
-
return;
|
|
710
|
-
}
|
|
711
|
-
const r = this.scrollState.index != null ? this.getOffsetForIndex(this.scrollState.index, this.scrollState.align) : void 0, e = r ? r[0] : this.scrollState.lastTargetOffset, s = 1, t = e !== this.scrollState.lastTargetOffset;
|
|
712
|
-
if (!t && K(e, this.getScrollOffset())) {
|
|
713
|
-
if (this.scrollState.stableFrames++, this.scrollState.stableFrames >= s) {
|
|
714
|
-
this.getScrollOffset() !== e && this._scrollToOffset(e, {
|
|
715
|
-
adjustments: void 0,
|
|
716
|
-
behavior: "auto"
|
|
717
|
-
}), this.scrollState = null;
|
|
718
|
-
return;
|
|
719
|
-
}
|
|
720
|
-
} else if (this.scrollState.stableFrames = 0, t) {
|
|
721
|
-
const n = this.getSize() || 600, i = Math.abs(e - this.getScrollOffset()), l = this.scrollState.behavior === "smooth" && i > n;
|
|
722
|
-
this.scrollState.lastTargetOffset = e, l || (this.scrollState.behavior = "auto"), this._scrollToOffset(e, {
|
|
723
|
-
adjustments: void 0,
|
|
724
|
-
behavior: l ? "smooth" : "auto"
|
|
725
|
-
});
|
|
726
|
-
}
|
|
727
|
-
this.scheduleScrollReconcile();
|
|
728
|
-
}
|
|
729
|
-
}, $ = (r, e, s, t) => {
|
|
730
|
-
for (; r <= e; ) {
|
|
731
|
-
const n = (r + e) / 2 | 0, i = s(n);
|
|
732
|
-
if (i < t) r = n + 1;
|
|
733
|
-
else if (i > t) e = n - 1;
|
|
734
|
-
else return n;
|
|
735
|
-
}
|
|
736
|
-
return r > 0 ? r - 1 : 0;
|
|
737
|
-
};
|
|
738
|
-
function ut(r, e, s) {
|
|
739
|
-
let t = 0;
|
|
740
|
-
for (; t <= e; ) {
|
|
741
|
-
const n = (t + e) / 2 | 0, i = r[n * 2];
|
|
742
|
-
if (i < s) t = n + 1;
|
|
743
|
-
else if (i > s) e = n - 1;
|
|
744
|
-
else return n;
|
|
745
|
-
}
|
|
746
|
-
return t > 0 ? t - 1 : 0;
|
|
747
|
-
}
|
|
748
|
-
function dt(r, e, s, t, n) {
|
|
749
|
-
const i = r.length - 1;
|
|
750
|
-
if (r.length <= t) return {
|
|
751
|
-
startIndex: 0,
|
|
752
|
-
endIndex: i
|
|
753
|
-
};
|
|
754
|
-
if (t === 1 && n !== null) {
|
|
755
|
-
const f = ut(n, i, s);
|
|
756
|
-
let u = f;
|
|
757
|
-
const h = s + e;
|
|
758
|
-
for (; u < i && n[u * 2] + n[u * 2 + 1] < h; ) u++;
|
|
759
|
-
return {
|
|
760
|
-
startIndex: f,
|
|
761
|
-
endIndex: u
|
|
762
|
-
};
|
|
763
|
-
}
|
|
764
|
-
let o = $(0, i, (f) => r[f].start, s), a = o;
|
|
765
|
-
if (t === 1) for (; a < i && r[a].end < s + e; ) a++;
|
|
766
|
-
else if (t > 1) {
|
|
767
|
-
const f = Array(t).fill(0);
|
|
768
|
-
for (; a < i && f.some((h) => h < s + e); ) {
|
|
769
|
-
const h = r[a];
|
|
770
|
-
f[h.lane] = h.end, a++;
|
|
771
|
-
}
|
|
772
|
-
const u = Array(t).fill(s + e);
|
|
773
|
-
for (; o >= 0 && u.some((h) => h >= s); ) {
|
|
774
|
-
const h = r[o];
|
|
775
|
-
u[h.lane] = h.start, o--;
|
|
776
|
-
}
|
|
777
|
-
o = Math.max(0, o - o % t), a = Math.min(i, a + (t - 1 - a % t));
|
|
778
|
-
}
|
|
779
|
-
return {
|
|
780
|
-
startIndex: o,
|
|
781
|
-
endIndex: a
|
|
782
|
-
};
|
|
783
|
-
}
|
|
784
|
-
var L = typeof document < "u" ? z.useLayoutEffect : z.useEffect;
|
|
785
|
-
function ft({ useFlushSync: r = !0, directDomUpdates: e = !1, directDomUpdatesMode: s = "transform", ...t }) {
|
|
786
|
-
const n = z.useReducer((h) => h + 1, 0)[1], i = z.useRef({
|
|
787
|
-
enabled: e,
|
|
788
|
-
mode: s,
|
|
789
|
-
container: null,
|
|
790
|
-
lastSize: null,
|
|
791
|
-
lastPositions: /* @__PURE__ */ new WeakMap(),
|
|
792
|
-
prevRange: null
|
|
793
|
-
});
|
|
794
|
-
i.current.enabled = e, i.current.mode = s;
|
|
795
|
-
const l = z.useRef(!1), o = (h) => {
|
|
796
|
-
const d = i.current;
|
|
797
|
-
if (!d.enabled || !d.container) return;
|
|
798
|
-
const m = h.getTotalSize();
|
|
799
|
-
if (m !== d.lastSize) {
|
|
800
|
-
d.lastSize = m;
|
|
801
|
-
const g = h.options.horizontal ? "width" : "height";
|
|
802
|
-
d.container.style[g] = `${m}px`;
|
|
803
|
-
}
|
|
804
|
-
}, a = (h) => {
|
|
805
|
-
const d = i.current;
|
|
806
|
-
if (!d.enabled || !d.container) return;
|
|
807
|
-
o(h);
|
|
808
|
-
const m = !!h.options.horizontal, g = d.mode === "transform", v = m ? "left" : "top", p = h.options.scrollMargin, c = h.getVirtualItems();
|
|
809
|
-
for (const S of c) {
|
|
810
|
-
const x = S.start - p, b = h.elementsCache.get(S.key);
|
|
811
|
-
b && d.lastPositions.get(b) !== x && (d.lastPositions.set(b, x), g ? b.style.transform = m ? `translate3d(${x}px, 0, 0)` : `translate3d(0, ${x}px, 0)` : b.style[v] = `${x}px`);
|
|
812
|
-
}
|
|
813
|
-
}, f = {
|
|
814
|
-
...t,
|
|
815
|
-
onChange: (h, d) => {
|
|
816
|
-
var m;
|
|
817
|
-
const g = i.current;
|
|
818
|
-
let v = !0;
|
|
819
|
-
if (g.enabled) {
|
|
820
|
-
a(h);
|
|
821
|
-
const p = h.range, c = g.prevRange;
|
|
822
|
-
v = !c || c.isScrolling !== h.isScrolling || c.startIndex !== p?.startIndex || c.endIndex !== p?.endIndex, v && (g.prevRange = p ? {
|
|
823
|
-
startIndex: p.startIndex,
|
|
824
|
-
endIndex: p.endIndex,
|
|
825
|
-
isScrolling: h.isScrolling
|
|
826
|
-
} : null);
|
|
827
|
-
}
|
|
828
|
-
v && (r && d && !l.current ? G(n) : n()), (m = t.onChange) == null || m.call(t, h, d);
|
|
829
|
-
}
|
|
830
|
-
}, [u] = z.useState(() => {
|
|
831
|
-
const h = new ct(f), d = h.measureElement;
|
|
832
|
-
return h.measureElement = (m) => {
|
|
833
|
-
l.current = !0;
|
|
834
|
-
try {
|
|
835
|
-
d(m);
|
|
836
|
-
} finally {
|
|
837
|
-
l.current = !1;
|
|
838
|
-
}
|
|
839
|
-
}, Object.assign(h, { containerRef: (m) => {
|
|
840
|
-
const g = i.current;
|
|
841
|
-
if (g.container = m, g.lastSize = null, m && g.enabled) {
|
|
842
|
-
const v = h.getTotalSize();
|
|
843
|
-
g.lastSize = v;
|
|
844
|
-
const p = h.options.horizontal ? "width" : "height";
|
|
845
|
-
m.style[p] = `${v}px`;
|
|
846
|
-
}
|
|
847
|
-
} });
|
|
848
|
-
});
|
|
849
|
-
return u.setOptions(f), L(() => u._didMount(), []), L(() => (o(u), u._willUpdate())), L(() => {
|
|
850
|
-
a(u);
|
|
851
|
-
}), u;
|
|
852
|
-
}
|
|
853
|
-
function mt(r) {
|
|
854
|
-
return ft({
|
|
855
|
-
observeElementRect: st,
|
|
856
|
-
observeElementOffset: lt,
|
|
857
|
-
scrollToFn: at,
|
|
858
|
-
...r
|
|
859
|
-
});
|
|
860
|
-
}
|
|
861
|
-
var yt = ({ showFlagOnSearch: r, showNameOnSearch: e }) => {
|
|
862
|
-
const s = U(null), { termOfSearch: t, countries: n, handleSelectCountry: i } = B(), l = q(() => n.filter((a) => a.name.toLocaleLowerCase().includes(t.toLowerCase())), [t]), o = mt({
|
|
863
|
-
count: l.length,
|
|
864
|
-
overscan: 5,
|
|
865
|
-
getScrollElement: () => s.current,
|
|
866
|
-
estimateSize: () => 40
|
|
867
|
-
});
|
|
868
|
-
return J(() => {
|
|
869
|
-
l.length > 0 && o.scrollToIndex(0);
|
|
870
|
-
}, [t, o]), l.length === 0 ? /* @__PURE__ */ y("div", {
|
|
871
|
-
className: "overflow-y-auto max-h-60 snap-y snap-mandatory",
|
|
872
|
-
children: /* @__PURE__ */ y("ul", {
|
|
873
|
-
className: "relative",
|
|
874
|
-
children: /* @__PURE__ */ y("li", {
|
|
875
|
-
className: "w-full flex items-center h-10 select-none px-6",
|
|
876
|
-
children: /* @__PURE__ */ y(N, {
|
|
877
|
-
variant: "body2",
|
|
878
|
-
component: "span",
|
|
879
|
-
className: "flex gap-2 items-center text-left",
|
|
880
|
-
children: "No options"
|
|
881
|
-
})
|
|
882
|
-
})
|
|
883
|
-
})
|
|
884
|
-
}) : /* @__PURE__ */ y("div", {
|
|
885
|
-
ref: s,
|
|
886
|
-
className: "overflow-y-auto max-h-60 snap-y snap-mandatory scrollbar",
|
|
887
|
-
children: /* @__PURE__ */ y("ul", {
|
|
888
|
-
className: "relative",
|
|
889
|
-
style: { height: o.getTotalSize() },
|
|
890
|
-
children: o.getVirtualItems().map((a) => {
|
|
891
|
-
const f = l[a.index], { flag: u, name: h, prefix: d } = f;
|
|
892
|
-
return /* @__PURE__ */ y("li", {
|
|
893
|
-
className: W("absolute", "w-full", "snap-start", "snap-always", "scroll-m-0", "flex", "items-center", "h-10"),
|
|
894
|
-
style: {
|
|
895
|
-
top: a.start,
|
|
896
|
-
height: a.size
|
|
897
|
-
},
|
|
898
|
-
children: /* @__PURE__ */ y("button", {
|
|
899
|
-
className: W("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"),
|
|
900
|
-
onClick: () => i(f),
|
|
901
|
-
children: /* @__PURE__ */ Q(N, {
|
|
902
|
-
variant: "body2",
|
|
903
|
-
component: "span",
|
|
904
|
-
className: "flex gap-2 items-center text-left",
|
|
905
|
-
children: [r && /* @__PURE__ */ y(u, {}), e && /* @__PURE__ */ y(H, {
|
|
906
|
-
text: h,
|
|
907
|
-
prefix: d
|
|
908
|
-
})]
|
|
909
|
-
})
|
|
910
|
-
})
|
|
911
|
-
}, a.key);
|
|
912
|
-
})
|
|
913
|
-
})
|
|
914
|
-
});
|
|
915
|
-
};
|
|
916
|
-
export {
|
|
917
|
-
yt as t
|
|
918
|
-
};
|