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