@vkontakte/vkui 4.34.2 → 4.35.0
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/.browserslistrc +5 -0
- package/.cache/.eslintcache +1 -1
- package/.cache/.stylelintcache +1 -1
- package/.cache/.tsbuildinfo +237 -211
- package/.cache/ts/src/components/ConfigProvider/ConfigProviderContext.d.ts +1 -0
- package/.cache/ts/src/components/CustomSelect/CustomSelect.d.ts +1 -1
- package/.cache/ts/src/components/Dropdown/Dropdown.d.ts +46 -5
- package/.cache/ts/src/components/FocusTrap/FocusTrap.d.ts +1 -1
- package/.cache/ts/src/components/ModalRoot/ModalRoot.d.ts +1 -1
- package/.cache/ts/src/components/ModalRoot/ModalRootDesktop.d.ts +1 -1
- package/.cache/ts/src/components/Popper/Popper.d.ts +18 -1
- package/.cache/ts/src/components/PopperArrow/PopperArrow.d.ts +8 -0
- package/.cache/ts/src/components/RichTooltip/RichTooltip.d.ts +7 -2
- package/.cache/ts/src/components/Snackbar/Snackbar.d.ts +5 -1
- package/.cache/ts/src/components/SplitCol/SplitCol.d.ts +1 -0
- package/.cache/ts/src/components/Tabbar/Tabbar.d.ts +8 -1
- package/.cache/ts/src/components/Tabs/Tabs.d.ts +13 -2
- package/.cache/ts/src/components/TabsItem/TabsItem.d.ts +22 -1
- package/.cache/ts/src/components/TextTooltip/TextTooltip.d.ts +5 -1
- package/.cache/ts/src/components/Tooltip/Tooltip.d.ts +18 -1
- package/.cache/ts/src/components/Typography/Headline/Headline.d.ts +3 -3
- package/.cache/ts/src/components/View/View.d.ts +2 -18
- package/.cache/ts/src/components/View/ViewInfinite.d.ts +1 -1
- package/.cache/ts/src/components/WriteBar/WriteBar.d.ts +5 -1
- package/.cache/ts/src/tokenized/index.d.ts +26 -0
- package/.eslintrc.json +14 -4
- package/dist/cjs/components/CardScroll/CardScroll.js +3 -1
- package/dist/cjs/components/CardScroll/CardScroll.js.map +1 -1
- package/dist/cjs/components/ConfigProvider/ConfigProviderContext.js +7 -1
- package/dist/cjs/components/ConfigProvider/ConfigProviderContext.js.map +1 -1
- package/dist/cjs/components/CustomSelect/CustomSelect.js +477 -554
- package/dist/cjs/components/CustomSelect/CustomSelect.js.map +1 -1
- package/dist/cjs/components/Dropdown/Dropdown.js +147 -26
- package/dist/cjs/components/Dropdown/Dropdown.js.map +1 -1
- package/dist/cjs/components/Epic/Epic.js +1 -6
- package/dist/cjs/components/Epic/Epic.js.map +1 -1
- package/dist/cjs/components/FocusTrap/FocusTrap.js +9 -10
- package/dist/cjs/components/FocusTrap/FocusTrap.js.map +1 -1
- package/dist/cjs/components/HorizontalCell/HorizontalCell.js +4 -7
- package/dist/cjs/components/HorizontalCell/HorizontalCell.js.map +1 -1
- package/dist/cjs/components/MiniInfoCell/MiniInfoCell.js +2 -2
- package/dist/cjs/components/MiniInfoCell/MiniInfoCell.js.map +1 -1
- package/dist/cjs/components/Popper/Popper.js +11 -19
- package/dist/cjs/components/Popper/Popper.js.map +1 -1
- package/dist/cjs/components/PopperArrow/PopperArrow.js +40 -0
- package/dist/cjs/components/PopperArrow/PopperArrow.js.map +1 -0
- package/dist/cjs/components/RichTooltip/RichTooltip.js +6 -15
- package/dist/cjs/components/RichTooltip/RichTooltip.js.map +1 -1
- package/dist/cjs/components/SimpleCell/SimpleCell.js +20 -31
- package/dist/cjs/components/SimpleCell/SimpleCell.js.map +1 -1
- package/dist/cjs/components/Snackbar/Snackbar.js +7 -11
- package/dist/cjs/components/Snackbar/Snackbar.js.map +1 -1
- package/dist/cjs/components/SplitCol/SplitCol.js +7 -1
- package/dist/cjs/components/SplitCol/SplitCol.js.map +1 -1
- package/dist/cjs/components/SplitLayout/SplitLayout.js +5 -8
- package/dist/cjs/components/SplitLayout/SplitLayout.js.map +1 -1
- package/dist/cjs/components/Tabbar/Tabbar.js +15 -14
- package/dist/cjs/components/Tabbar/Tabbar.js.map +1 -1
- package/dist/cjs/components/TabbarItem/TabbarItem.js +8 -10
- package/dist/cjs/components/TabbarItem/TabbarItem.js.map +1 -1
- package/dist/cjs/components/Tabs/Tabs.js +23 -5
- package/dist/cjs/components/Tabs/Tabs.js.map +1 -1
- package/dist/cjs/components/TabsItem/TabsItem.js +39 -22
- package/dist/cjs/components/TabsItem/TabsItem.js.map +1 -1
- package/dist/cjs/components/TextTooltip/TextTooltip.js +6 -9
- package/dist/cjs/components/TextTooltip/TextTooltip.js.map +1 -1
- package/dist/cjs/components/Tooltip/Tooltip.js +94 -71
- package/dist/cjs/components/Tooltip/Tooltip.js.map +1 -1
- package/dist/cjs/components/Typography/Headline/Headline.js +11 -2
- package/dist/cjs/components/Typography/Headline/Headline.js.map +1 -1
- package/dist/cjs/components/View/View.js +388 -453
- package/dist/cjs/components/View/View.js.map +1 -1
- package/dist/cjs/components/WriteBar/WriteBar.js +12 -5
- package/dist/cjs/components/WriteBar/WriteBar.js.map +1 -1
- package/dist/cjs/components/WriteBarIcon/WriteBarIcon.js +3 -8
- package/dist/cjs/components/WriteBarIcon/WriteBarIcon.js.map +1 -1
- package/dist/cjs/hooks/useOrientationChange.js +2 -1
- package/dist/cjs/hooks/useOrientationChange.js.map +1 -1
- package/dist/cjs/tokenized/index.js +104 -0
- package/dist/cjs/tokenized/index.js.map +1 -1
- package/dist/components/CardScroll/CardScroll.js +3 -1
- package/dist/components/CardScroll/CardScroll.js.map +1 -1
- package/dist/components/ConfigProvider/ConfigProviderContext.d.ts +1 -0
- package/dist/components/ConfigProvider/ConfigProviderContext.js +3 -0
- package/dist/components/ConfigProvider/ConfigProviderContext.js.map +1 -1
- package/dist/components/CustomSelect/CustomSelect.d.ts +1 -1
- package/dist/components/CustomSelect/CustomSelect.js +473 -580
- package/dist/components/CustomSelect/CustomSelect.js.map +1 -1
- package/dist/components/Dropdown/Dropdown.d.ts +46 -5
- package/dist/components/Dropdown/Dropdown.js +137 -27
- package/dist/components/Dropdown/Dropdown.js.map +1 -1
- package/dist/components/Epic/Epic.js +1 -4
- package/dist/components/Epic/Epic.js.map +1 -1
- package/dist/components/FocusTrap/FocusTrap.d.ts +1 -1
- package/dist/components/FocusTrap/FocusTrap.js +9 -9
- package/dist/components/FocusTrap/FocusTrap.js.map +1 -1
- package/dist/components/HorizontalCell/HorizontalCell.js +3 -5
- package/dist/components/HorizontalCell/HorizontalCell.js.map +1 -1
- package/dist/components/MiniInfoCell/MiniInfoCell.js +2 -2
- package/dist/components/MiniInfoCell/MiniInfoCell.js.map +1 -1
- package/dist/components/ModalRoot/ModalRoot.d.ts +1 -1
- package/dist/components/ModalRoot/ModalRootDesktop.d.ts +1 -1
- package/dist/components/Popper/Popper.d.ts +18 -1
- package/dist/components/Popper/Popper.js +10 -19
- package/dist/components/Popper/Popper.js.map +1 -1
- package/dist/components/PopperArrow/PopperArrow.d.ts +8 -0
- package/dist/components/PopperArrow/PopperArrow.js +27 -0
- package/dist/components/PopperArrow/PopperArrow.js.map +1 -0
- package/dist/components/RichTooltip/RichTooltip.d.ts +7 -2
- package/dist/components/RichTooltip/RichTooltip.js +5 -10
- package/dist/components/RichTooltip/RichTooltip.js.map +1 -1
- package/dist/components/SimpleCell/SimpleCell.js +18 -28
- package/dist/components/SimpleCell/SimpleCell.js.map +1 -1
- package/dist/components/Snackbar/Snackbar.d.ts +5 -1
- package/dist/components/Snackbar/Snackbar.js +8 -11
- package/dist/components/Snackbar/Snackbar.js.map +1 -1
- package/dist/components/SplitCol/SplitCol.d.ts +1 -0
- package/dist/components/SplitCol/SplitCol.js +3 -0
- package/dist/components/SplitCol/SplitCol.js.map +1 -1
- package/dist/components/SplitLayout/SplitLayout.js +4 -7
- package/dist/components/SplitLayout/SplitLayout.js.map +1 -1
- package/dist/components/Tabbar/Tabbar.d.ts +8 -1
- package/dist/components/Tabbar/Tabbar.js +15 -14
- package/dist/components/Tabbar/Tabbar.js.map +1 -1
- package/dist/components/TabbarItem/TabbarItem.js +7 -9
- package/dist/components/TabbarItem/TabbarItem.js.map +1 -1
- package/dist/components/Tabs/Tabs.d.ts +13 -2
- package/dist/components/Tabs/Tabs.js +23 -5
- package/dist/components/Tabs/Tabs.js.map +1 -1
- package/dist/components/TabsItem/TabsItem.d.ts +22 -1
- package/dist/components/TabsItem/TabsItem.js +40 -21
- package/dist/components/TabsItem/TabsItem.js.map +1 -1
- package/dist/components/TextTooltip/TextTooltip.d.ts +5 -1
- package/dist/components/TextTooltip/TextTooltip.js +5 -7
- package/dist/components/TextTooltip/TextTooltip.js.map +1 -1
- package/dist/components/Tooltip/Tooltip.d.ts +18 -1
- package/dist/components/Tooltip/Tooltip.js +89 -68
- package/dist/components/Tooltip/Tooltip.js.map +1 -1
- package/dist/components/Typography/Headline/Headline.d.ts +3 -3
- package/dist/components/Typography/Headline/Headline.js +10 -2
- package/dist/components/Typography/Headline/Headline.js.map +1 -1
- package/dist/components/View/View.d.ts +2 -18
- package/dist/components/View/View.js +384 -462
- package/dist/components/View/View.js.map +1 -1
- package/dist/components/View/ViewInfinite.d.ts +1 -1
- package/dist/components/WriteBar/WriteBar.d.ts +5 -1
- package/dist/components/WriteBar/WriteBar.js +10 -5
- package/dist/components/WriteBar/WriteBar.js.map +1 -1
- package/dist/components/WriteBarIcon/WriteBarIcon.js +3 -6
- package/dist/components/WriteBarIcon/WriteBarIcon.js.map +1 -1
- package/dist/components.css +143 -127
- package/dist/components.css.map +1 -1
- package/dist/cssm/components/ActionSheet/ActionSheet.css +1 -1
- package/dist/cssm/components/ActionSheetItem/ActionSheetItem.css +1 -1
- package/dist/cssm/components/Alert/Alert.css +1 -1
- package/dist/cssm/components/AppRoot/AppRoot.css +1 -1
- package/dist/cssm/components/Avatar/Avatar.css +3 -5
- package/dist/cssm/components/Badge/Badge.css +3 -3
- package/dist/cssm/components/Banner/Banner.css +5 -5
- package/dist/cssm/components/BaseGallery/BaseGallery.css +1 -1
- package/dist/cssm/components/Button/Button.css +53 -35
- package/dist/cssm/components/Calendar/Calendar.css +1 -1
- package/dist/cssm/components/CalendarDay/CalendarDay.css +1 -1
- package/dist/cssm/components/CalendarDays/CalendarDays.css +1 -1
- package/dist/cssm/components/CalendarHeader/CalendarHeader.css +1 -1
- package/dist/cssm/components/CalendarRange/CalendarRange.css +1 -1
- package/dist/cssm/components/CalendarTime/CalendarTime.css +1 -1
- package/dist/cssm/components/Card/Card.css +5 -6
- package/dist/cssm/components/CardGrid/CardGrid.css +1 -1
- package/dist/cssm/components/CardScroll/CardScroll.css +1 -1
- package/dist/cssm/components/CardScroll/CardScroll.js +3 -1
- package/dist/cssm/components/CardScroll/CardScroll.js.map +1 -1
- package/dist/cssm/components/Cell/Cell.css +3 -3
- package/dist/cssm/components/Cell/CellCheckbox/CellCheckbox.css +1 -1
- package/dist/cssm/components/Cell/CellDragger/CellDragger.css +1 -1
- package/dist/cssm/components/CellButton/CellButton.css +1 -1
- package/dist/cssm/components/Checkbox/Checkbox.css +1 -1
- package/dist/cssm/components/Chip/Chip.css +1 -1
- package/dist/cssm/components/ChipsInput/ChipsInput.css +1 -1
- package/dist/cssm/components/ChipsSelect/ChipsSelect.css +1 -1
- package/dist/cssm/components/ConfigProvider/ConfigProviderContext.d.ts +1 -0
- package/dist/cssm/components/ConfigProvider/ConfigProviderContext.js +3 -0
- package/dist/cssm/components/ConfigProvider/ConfigProviderContext.js.map +1 -1
- package/dist/cssm/components/ContentCard/ContentCard.css +1 -1
- package/dist/cssm/components/Counter/Counter.css +31 -31
- package/dist/cssm/components/CustomScrollView/CustomScrollView.css +1 -1
- package/dist/cssm/components/CustomSelect/CustomSelect.css +1 -1
- package/dist/cssm/components/CustomSelect/CustomSelect.d.ts +1 -1
- package/dist/cssm/components/CustomSelect/CustomSelect.js +473 -580
- package/dist/cssm/components/CustomSelect/CustomSelect.js.map +1 -1
- package/dist/cssm/components/CustomSelectDropdown/CustomSelectDropdown.css +3 -3
- package/dist/cssm/components/CustomSelectOption/CustomSelectOption.css +3 -3
- package/dist/cssm/components/DateInput/DateInput.css +1 -1
- package/dist/cssm/components/DatePicker/DatePicker.css +1 -1
- package/dist/cssm/components/DateRangeInput/DateRangeInput.css +1 -1
- package/dist/cssm/components/Dropdown/Dropdown.css +1 -1
- package/dist/cssm/components/Dropdown/Dropdown.d.ts +46 -5
- package/dist/cssm/components/Dropdown/Dropdown.js +137 -27
- package/dist/cssm/components/Dropdown/Dropdown.js.map +1 -1
- package/dist/cssm/components/Epic/Epic.css +1 -1
- package/dist/cssm/components/Epic/Epic.js +1 -4
- package/dist/cssm/components/Epic/Epic.js.map +1 -1
- package/dist/cssm/components/FixedLayout/FixedLayout.css +1 -1
- package/dist/cssm/components/FocusTrap/FocusTrap.d.ts +1 -1
- package/dist/cssm/components/FocusTrap/FocusTrap.js +9 -9
- package/dist/cssm/components/FocusTrap/FocusTrap.js.map +1 -1
- package/dist/cssm/components/FocusVisible/FocusVisible.css +1 -1
- package/dist/cssm/components/Footer/Footer.css +1 -1
- package/dist/cssm/components/FormField/FormField.css +9 -9
- package/dist/cssm/components/FormItem/FormItem.css +1 -1
- package/dist/cssm/components/FormLayout/FormLayout.css +1 -1
- package/dist/cssm/components/FormLayoutGroup/FormLayoutGroup.css +1 -1
- package/dist/cssm/components/FormStatus/FormStatus.css +1 -1
- package/dist/cssm/components/Gradient/Gradient.css +1 -1
- package/dist/cssm/components/GridAvatar/GridAvatar.css +1 -1
- package/dist/cssm/components/Group/Group.css +1 -1
- package/dist/cssm/components/Header/Header.css +1 -1
- package/dist/cssm/components/HorizontalCell/HorizontalCell.css +1 -1
- package/dist/cssm/components/HorizontalCell/HorizontalCell.js +3 -5
- package/dist/cssm/components/HorizontalCell/HorizontalCell.js.map +1 -1
- package/dist/cssm/components/HorizontalScroll/HorizontalScroll.css +1 -1
- package/dist/cssm/components/HorizontalScroll/HorizontalScrollArrow.css +3 -3
- package/dist/cssm/components/IconButton/IconButton.css +1 -1
- package/dist/cssm/components/InfoRow/InfoRow.css +1 -1
- package/dist/cssm/components/InitialsAvatar/InitialsAvatar.css +1 -1
- package/dist/cssm/components/Input/Input.css +1 -1
- package/dist/cssm/components/InputLike/InputLike.css +1 -1
- package/dist/cssm/components/InputLike/InputLikeDivider.css +1 -1
- package/dist/cssm/components/Link/Link.css +1 -1
- package/dist/cssm/components/MiniInfoCell/MiniInfoCell.css +1 -1
- package/dist/cssm/components/MiniInfoCell/MiniInfoCell.js +2 -2
- package/dist/cssm/components/MiniInfoCell/MiniInfoCell.js.map +1 -1
- package/dist/cssm/components/ModalCard/ModalCard.css +1 -1
- package/dist/cssm/components/ModalCardBase/ModalCardBase.css +3 -3
- package/dist/cssm/components/ModalDismissButton/ModalDismissButton.css +1 -1
- package/dist/cssm/components/ModalPage/ModalPage.css +1 -1
- package/dist/cssm/components/ModalPageHeader/ModalPageHeader.css +1 -1
- package/dist/cssm/components/ModalRoot/ModalRoot.css +1 -1
- package/dist/cssm/components/ModalRoot/ModalRoot.d.ts +1 -1
- package/dist/cssm/components/ModalRoot/ModalRootDesktop.d.ts +1 -1
- package/dist/cssm/components/Pagination/Pagination.css +1 -1
- package/dist/cssm/components/Panel/Panel.css +1 -1
- package/dist/cssm/components/PanelHeader/PanelHeader.css +1 -1
- package/dist/cssm/components/PanelHeaderButton/PanelHeaderButton.css +1 -1
- package/dist/cssm/components/PanelHeaderContent/PanelHeaderContent.css +1 -1
- package/dist/cssm/components/PanelHeaderContext/PanelHeaderContext.css +1 -1
- package/dist/cssm/components/Placeholder/Placeholder.css +3 -3
- package/dist/cssm/components/PopoutRoot/PopoutRoot.css +1 -1
- package/dist/cssm/components/PopoutWrapper/PopoutWrapper.css +1 -1
- package/dist/cssm/components/Popper/Popper.css +1 -1
- package/dist/cssm/components/Popper/Popper.d.ts +18 -1
- package/dist/cssm/components/Popper/Popper.js +10 -19
- package/dist/cssm/components/Popper/Popper.js.map +1 -1
- package/dist/cssm/components/PopperArrow/PopperArrow.css +1 -0
- package/dist/cssm/components/PopperArrow/PopperArrow.d.ts +8 -0
- package/dist/cssm/components/PopperArrow/PopperArrow.js +28 -0
- package/dist/cssm/components/PopperArrow/PopperArrow.js.map +1 -0
- package/dist/cssm/components/Progress/Progress.css +1 -1
- package/dist/cssm/components/PromoBanner/PromoBanner.css +1 -1
- package/dist/cssm/components/PullToRefresh/PullToRefresh.css +3 -3
- package/dist/cssm/components/Radio/Radio.css +1 -1
- package/dist/cssm/components/RadioGroup/RadioGroup.css +1 -1
- package/dist/cssm/components/Removable/Removable.css +1 -1
- package/dist/cssm/components/RichCell/RichCell.css +3 -3
- package/dist/cssm/components/RichTooltip/RichTooltip.css +3 -1
- package/dist/cssm/components/RichTooltip/RichTooltip.d.ts +7 -2
- package/dist/cssm/components/RichTooltip/RichTooltip.js +5 -10
- package/dist/cssm/components/RichTooltip/RichTooltip.js.map +1 -1
- package/dist/cssm/components/Root/Root.css +1 -1
- package/dist/cssm/components/ScreenSpinner/ScreenSpinner.css +1 -1
- package/dist/cssm/components/Search/Search.css +1 -1
- package/dist/cssm/components/SegmentedControl/SegmentedControl.css +1 -1
- package/dist/cssm/components/SegmentedControl/SegmentedControlOption/SegmentedControlOption.css +1 -1
- package/dist/cssm/components/Select/Select.css +1 -1
- package/dist/cssm/components/Separator/Separator.css +1 -1
- package/dist/cssm/components/SimpleCell/SimpleCell.css +1 -1
- package/dist/cssm/components/SimpleCell/SimpleCell.js +18 -28
- package/dist/cssm/components/SimpleCell/SimpleCell.js.map +1 -1
- package/dist/cssm/components/SimpleCheckbox/SimpleCheckbox.css +1 -1
- package/dist/cssm/components/Slider/Slider.css +3 -3
- package/dist/cssm/components/SliderSwitch/SliderSwitch.css +1 -1
- package/dist/cssm/components/Snackbar/Snackbar.css +1 -1
- package/dist/cssm/components/Snackbar/Snackbar.d.ts +5 -1
- package/dist/cssm/components/Snackbar/Snackbar.js +8 -11
- package/dist/cssm/components/Snackbar/Snackbar.js.map +1 -1
- package/dist/cssm/components/Spacing/Spacing.css +1 -1
- package/dist/cssm/components/Spinner/Spinner.css +1 -1
- package/dist/cssm/components/SplitCol/SplitCol.css +1 -1
- package/dist/cssm/components/SplitCol/SplitCol.d.ts +1 -0
- package/dist/cssm/components/SplitCol/SplitCol.js +3 -0
- package/dist/cssm/components/SplitCol/SplitCol.js.map +1 -1
- package/dist/cssm/components/SplitLayout/SplitLayout.css +1 -1
- package/dist/cssm/components/SplitLayout/SplitLayout.js +4 -7
- package/dist/cssm/components/SplitLayout/SplitLayout.js.map +1 -1
- package/dist/cssm/components/SubnavigationBar/SubnavigationBar.css +1 -1
- package/dist/cssm/components/SubnavigationButton/SubnavigationButton.css +1 -1
- package/dist/cssm/components/Switch/Switch.css +3 -3
- package/dist/cssm/components/Tabbar/Tabbar.css +5 -3
- package/dist/cssm/components/Tabbar/Tabbar.d.ts +8 -1
- package/dist/cssm/components/Tabbar/Tabbar.js +15 -14
- package/dist/cssm/components/Tabbar/Tabbar.js.map +1 -1
- package/dist/cssm/components/TabbarItem/TabbarItem.css +1 -1
- package/dist/cssm/components/TabbarItem/TabbarItem.js +7 -9
- package/dist/cssm/components/TabbarItem/TabbarItem.js.map +1 -1
- package/dist/cssm/components/Tabs/Tabs.css +1 -1
- package/dist/cssm/components/Tabs/Tabs.d.ts +13 -2
- package/dist/cssm/components/Tabs/Tabs.js +23 -5
- package/dist/cssm/components/Tabs/Tabs.js.map +1 -1
- package/dist/cssm/components/TabsItem/TabsItem.css +5 -1
- package/dist/cssm/components/TabsItem/TabsItem.d.ts +22 -1
- package/dist/cssm/components/TabsItem/TabsItem.js +40 -21
- package/dist/cssm/components/TabsItem/TabsItem.js.map +1 -1
- package/dist/cssm/components/Tappable/Tappable.css +5 -5
- package/dist/cssm/components/TextTooltip/TextTooltip.css +1 -1
- package/dist/cssm/components/TextTooltip/TextTooltip.d.ts +5 -1
- package/dist/cssm/components/TextTooltip/TextTooltip.js +5 -7
- package/dist/cssm/components/TextTooltip/TextTooltip.js.map +1 -1
- package/dist/cssm/components/Textarea/Textarea.css +1 -1
- package/dist/cssm/components/Tooltip/Tooltip.css +1 -1
- package/dist/cssm/components/Tooltip/Tooltip.d.ts +18 -1
- package/dist/cssm/components/Tooltip/Tooltip.js +89 -68
- package/dist/cssm/components/Tooltip/Tooltip.js.map +1 -1
- package/dist/cssm/components/Typography/Caption/Caption.css +1 -1
- package/dist/cssm/components/Typography/Footnote/Footnote.css +1 -1
- package/dist/cssm/components/Typography/Headline/Headline.css +1 -1
- package/dist/cssm/components/Typography/Headline/Headline.d.ts +3 -3
- package/dist/cssm/components/Typography/Headline/Headline.js +10 -2
- package/dist/cssm/components/Typography/Headline/Headline.js.map +1 -1
- package/dist/cssm/components/Typography/Paragraph/Paragraph.css +1 -1
- package/dist/cssm/components/Typography/Subhead/Subhead.css +1 -1
- package/dist/cssm/components/Typography/Text/Text.css +1 -1
- package/dist/cssm/components/Typography/Title/Title.css +1 -1
- package/dist/cssm/components/UsersStack/UsersStack.css +5 -5
- package/dist/cssm/components/View/View.css +1 -1
- package/dist/cssm/components/View/View.d.ts +2 -18
- package/dist/cssm/components/View/View.js +384 -462
- package/dist/cssm/components/View/View.js.map +1 -1
- package/dist/cssm/components/View/ViewIOS.css +1 -1
- package/dist/cssm/components/View/ViewInfinite.d.ts +1 -1
- package/dist/cssm/components/VisuallyHiddenInput/VisuallyHiddenInput.css +1 -1
- package/dist/cssm/components/WriteBar/WriteBar.css +3 -1
- package/dist/cssm/components/WriteBar/WriteBar.d.ts +5 -1
- package/dist/cssm/components/WriteBar/WriteBar.js +10 -5
- package/dist/cssm/components/WriteBar/WriteBar.js.map +1 -1
- package/dist/cssm/components/WriteBarIcon/WriteBarIcon.css +1 -1
- package/dist/cssm/components/WriteBarIcon/WriteBarIcon.js +3 -6
- package/dist/cssm/components/WriteBarIcon/WriteBarIcon.js.map +1 -1
- package/dist/cssm/fonts/fonts.css +1 -1
- package/dist/cssm/hooks/useOrientationChange.js +2 -1
- package/dist/cssm/hooks/useOrientationChange.js.map +1 -1
- package/dist/cssm/lib/calendar.d.ts +2 -2
- package/dist/cssm/styles/animations.css +1 -1
- package/dist/cssm/styles/bright_light.css +1 -1
- package/dist/cssm/styles/common.css +1 -1
- package/dist/cssm/styles/components.css +143 -127
- package/dist/cssm/styles/constants.css +3 -10
- package/dist/cssm/styles/space_gray.css +1 -1
- package/dist/cssm/styles/themes.css +1 -16
- package/dist/cssm/styles/unstable.css +3 -1
- package/dist/cssm/styles/vkcom_dark.css +1 -6
- package/dist/cssm/styles/vkcom_light.css +1 -11
- package/dist/cssm/tokenized/index.d.ts +26 -0
- package/dist/cssm/tokenized/index.js +13 -0
- package/dist/cssm/tokenized/index.js.map +1 -1
- package/dist/default_scheme.css +1 -1
- package/dist/default_scheme.css.map +1 -1
- package/dist/fonts.css +1 -1
- package/dist/fonts.css.map +1 -1
- package/dist/hooks/useOrientationChange.js +2 -1
- package/dist/hooks/useOrientationChange.js.map +1 -1
- package/dist/lib/calendar.d.ts +2 -2
- package/dist/tokenized/index.d.ts +26 -0
- package/dist/tokenized/index.js +13 -0
- package/dist/tokenized/index.js.map +1 -1
- package/dist/unstable.css +3 -1
- package/dist/unstable.css.map +1 -1
- package/dist/vkui.css +144 -143
- package/dist/vkui.css.map +1 -1
- package/package.json +6 -5
- package/src/components/Badge/Badge.css +0 -5
- package/src/components/CardScroll/CardScroll.tsx +1 -1
- package/src/components/Cell/Cell.css +3 -2
- package/src/components/ChipsInput/ChipsInput.css +2 -0
- package/src/components/ConfigProvider/ConfigProviderContext.tsx +2 -0
- package/src/components/Counter/Counter.css +30 -0
- package/src/components/CustomScrollView/CustomScrollView.css +10 -5
- package/src/components/CustomSelect/CustomSelect.tsx +543 -574
- package/src/components/Dropdown/Dropdown.css +12 -0
- package/src/components/Dropdown/Dropdown.tsx +174 -20
- package/src/components/Dropdown/Readme.md +1 -0
- package/src/components/Epic/Epic.tsx +1 -4
- package/src/components/FixedLayout/Readme.md +103 -109
- package/src/components/FocusTrap/FocusTrap.tsx +10 -10
- package/src/components/Group/Group.css +1 -1
- package/src/components/HorizontalCell/HorizontalCell.css +25 -43
- package/src/components/HorizontalCell/HorizontalCell.tsx +3 -9
- package/src/components/HorizontalScroll/HorizontalScroll.css +23 -0
- package/src/components/Input/Input.css +2 -0
- package/src/components/MiniInfoCell/MiniInfoCell.css +13 -3
- package/src/components/MiniInfoCell/MiniInfoCell.tsx +3 -3
- package/src/components/Popper/Popper.css +0 -35
- package/src/components/Popper/Popper.tsx +29 -23
- package/src/components/PopperArrow/PopperArrow.css +34 -0
- package/src/components/PopperArrow/PopperArrow.tsx +40 -0
- package/src/components/RichTooltip/RichTooltip.css +44 -4
- package/src/components/RichTooltip/RichTooltip.tsx +9 -11
- package/src/components/SimpleCell/Readme.md +115 -129
- package/src/components/SimpleCell/SimpleCell.css +30 -68
- package/src/components/SimpleCell/SimpleCell.tsx +21 -25
- package/src/components/Snackbar/Readme.md +95 -123
- package/src/components/Snackbar/Snackbar.css +18 -27
- package/src/components/Snackbar/Snackbar.tsx +17 -11
- package/src/components/SplitCol/SplitCol.tsx +2 -0
- package/src/components/SplitLayout/SplitLayout.css +3 -7
- package/src/components/SplitLayout/SplitLayout.tsx +9 -6
- package/src/components/Tabbar/Tabbar.css +4 -1
- package/src/components/Tabbar/Tabbar.tsx +23 -12
- package/src/components/TabbarItem/TabbarItem.css +7 -5
- package/src/components/TabbarItem/TabbarItem.tsx +13 -7
- package/src/components/Tabs/Readme.md +191 -251
- package/src/components/Tabs/Tabs.css +27 -80
- package/src/components/Tabs/Tabs.tsx +45 -7
- package/src/components/TabsItem/Readme.md +1 -0
- package/src/components/TabsItem/TabsItem.css +191 -106
- package/src/components/TabsItem/TabsItem.tsx +72 -20
- package/src/components/TextTooltip/TextTooltip.css +41 -11
- package/src/components/TextTooltip/TextTooltip.tsx +9 -13
- package/src/components/Textarea/Textarea.css +2 -0
- package/src/components/Tooltip/Readme.md +128 -101
- package/src/components/Tooltip/Tooltip.css +29 -40
- package/src/components/Tooltip/Tooltip.tsx +98 -66
- package/src/components/Typography/Headline/Headline.tsx +15 -1
- package/src/components/View/Readme.md +2 -0
- package/src/components/View/View.tsx +451 -514
- package/src/components/WriteBar/WriteBar.css +27 -33
- package/src/components/WriteBar/WriteBar.tsx +16 -5
- package/src/components/WriteBarIcon/WriteBarIcon.css +6 -19
- package/src/components/WriteBarIcon/WriteBarIcon.tsx +6 -6
- package/src/hooks/useOrientationChange.ts +1 -0
- package/src/styles/components.css +1 -0
- package/src/styles/constants.css +8 -0
- package/src/tokenized/index.ts +39 -0
- package/tsconfig.json +1 -1
- package/.cache/ts/src/components/ClickPopper/ClickPopper.d.ts +0 -21
- package/dist/cjs/components/ClickPopper/ClickPopper.js +0 -96
- package/dist/cjs/components/ClickPopper/ClickPopper.js.map +0 -1
- package/dist/components/ClickPopper/ClickPopper.d.ts +0 -21
- package/dist/components/ClickPopper/ClickPopper.js +0 -71
- package/dist/components/ClickPopper/ClickPopper.js.map +0 -1
- package/dist/cssm/components/ClickPopper/ClickPopper.d.ts +0 -21
- package/dist/cssm/components/ClickPopper/ClickPopper.js +0 -71
- package/dist/cssm/components/ClickPopper/ClickPopper.js.map +0 -1
- package/src/components/ClickPopper/ClickPopper.tsx +0 -86
|
@@ -1,29 +1,28 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
3
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
-
|
|
4
|
-
import _createClass from "@babel/runtime/helpers/createClass";
|
|
5
|
-
import _assertThisInitialized from "@babel/runtime/helpers/assertThisInitialized";
|
|
6
|
-
import _inherits from "@babel/runtime/helpers/inherits";
|
|
7
|
-
import _createSuper from "@babel/runtime/helpers/createSuper";
|
|
8
|
-
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
9
|
-
var _excluded = ["popout", "modal", "platform", "activePanel", "splitCol", "configProvider", "history", "nav", "onTransition", "onSwipeBack", "onSwipeBackStart", "onSwipeBackCancel", "window", "document", "scroll"];
|
|
4
|
+
var _excluded = ["popout", "modal", "activePanel", "history", "nav", "onTransition", "onSwipeBack", "onSwipeBackStart", "onSwipeBackCancel", "children"];
|
|
10
5
|
import { createScopedElement } from "../../lib/jsxRuntime";
|
|
11
6
|
import * as React from "react";
|
|
12
7
|
import { classNames } from "../../lib/classNames";
|
|
13
|
-
import {
|
|
8
|
+
import { animationEvent } from "../../lib/supportEvents";
|
|
14
9
|
import { IOS } from "../../lib/platform";
|
|
15
10
|
import { Touch } from "../Touch/Touch";
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import { ConfigProviderContext } from "../ConfigProvider/ConfigProviderContext";
|
|
19
|
-
import { SplitColContext } from "../SplitCol/SplitCol";
|
|
11
|
+
import { useConfigProvider } from "../ConfigProvider/ConfigProviderContext";
|
|
12
|
+
import { useSplitCol } from "../SplitCol/SplitCol";
|
|
20
13
|
import { AppRootPortal } from "../AppRoot/AppRootPortal";
|
|
21
|
-
import { canUseDOM,
|
|
22
|
-
import {
|
|
14
|
+
import { canUseDOM, useDOM, blurActiveElement } from "../../lib/dom";
|
|
15
|
+
import { useScroll } from "../AppRoot/ScrollContext";
|
|
23
16
|
import { NavTransitionProvider } from "../NavTransitionContext/NavTransitionContext";
|
|
24
17
|
import { getNavId } from "../../lib/getNavId";
|
|
25
18
|
import { warnOnce } from "../../lib/warnOnce";
|
|
19
|
+
import { usePlatform } from "../../hooks/usePlatform";
|
|
26
20
|
import { swipeBackExcluded } from "./utils";
|
|
21
|
+
import { useWaitTransitionFinish } from "../../hooks/useWaitTransitionFinish";
|
|
22
|
+
import { useTimeout } from "../../hooks/useTimeout";
|
|
23
|
+
import { usePrevious } from "../../hooks/usePrevious";
|
|
24
|
+
import { useIsomorphicLayoutEffect } from "../../lib/useIsomorphicLayoutEffect";
|
|
25
|
+
import { noop } from "../../lib/utils";
|
|
27
26
|
import "./View.css";
|
|
28
27
|
var SwipeBackResults;
|
|
29
28
|
|
|
@@ -34,505 +33,428 @@ var SwipeBackResults;
|
|
|
34
33
|
|
|
35
34
|
export var scrollsCache = {};
|
|
36
35
|
var warn = warnOnce("View");
|
|
36
|
+
/**
|
|
37
|
+
* @see https://vkcom.github.io/VKUI/#/View
|
|
38
|
+
*/
|
|
37
39
|
|
|
38
|
-
var
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
40
|
+
export var View = function View(_ref) {
|
|
41
|
+
var popout = _ref.popout,
|
|
42
|
+
modal = _ref.modal,
|
|
43
|
+
activePanelProp = _ref.activePanel,
|
|
44
|
+
history = _ref.history,
|
|
45
|
+
nav = _ref.nav,
|
|
46
|
+
onTransition = _ref.onTransition,
|
|
47
|
+
onSwipeBack = _ref.onSwipeBack,
|
|
48
|
+
onSwipeBackStart = _ref.onSwipeBackStart,
|
|
49
|
+
onSwipeBackCancelProp = _ref.onSwipeBackCancel,
|
|
50
|
+
children = _ref.children,
|
|
51
|
+
restProps = _objectWithoutProperties(_ref, _excluded);
|
|
52
|
+
|
|
53
|
+
if (process.env.NODE_ENV === "development") {
|
|
54
|
+
popout && warn("Свойство popout устарело и будет удалено в 5.0.0. Используйте одноименное свойство у SplitLayout.");
|
|
55
|
+
modal && warn("Свойство modal устарело и будет удалено в 5.0.0. Используйте одноименное свойство у SplitLayout.");
|
|
56
|
+
}
|
|
55
57
|
|
|
56
|
-
|
|
58
|
+
var scrolls = React.useRef(scrollsCache[getNavId({
|
|
59
|
+
nav: nav,
|
|
60
|
+
id: restProps.id
|
|
61
|
+
})] || {});
|
|
62
|
+
var afterTransition = React.useRef(noop);
|
|
63
|
+
React.useEffect(function () {
|
|
64
|
+
return function () {
|
|
65
|
+
var id = getNavId({
|
|
66
|
+
nav: nav,
|
|
67
|
+
id: restProps.id
|
|
68
|
+
});
|
|
57
69
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
_this.flushTransition(_this.state.prevPanel, Boolean(_this.state.isBack));
|
|
70
|
+
if (id) {
|
|
71
|
+
scrollsCache[id] = scrolls.current;
|
|
61
72
|
}
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
73
|
+
};
|
|
74
|
+
});
|
|
75
|
+
var panelNodes = React.useRef({});
|
|
76
|
+
|
|
77
|
+
var _useDOM = useDOM(),
|
|
78
|
+
window = _useDOM.window,
|
|
79
|
+
document = _useDOM.document;
|
|
80
|
+
|
|
81
|
+
var scroll = useScroll();
|
|
82
|
+
var configProvider = useConfigProvider();
|
|
83
|
+
var splitCol = useSplitCol();
|
|
84
|
+
var platform = usePlatform();
|
|
85
|
+
|
|
86
|
+
var _React$useState = React.useState(false),
|
|
87
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
88
|
+
animated = _React$useState2[0],
|
|
89
|
+
setAnimated = _React$useState2[1];
|
|
90
|
+
|
|
91
|
+
var _React$useState3 = React.useState([activePanelProp]),
|
|
92
|
+
_React$useState4 = _slicedToArray(_React$useState3, 2),
|
|
93
|
+
visiblePanels = _React$useState4[0],
|
|
94
|
+
setVisiblePanels = _React$useState4[1];
|
|
95
|
+
|
|
96
|
+
var _React$useState5 = React.useState(activePanelProp),
|
|
97
|
+
_React$useState6 = _slicedToArray(_React$useState5, 2),
|
|
98
|
+
activePanel = _React$useState6[0],
|
|
99
|
+
setActivePanel = _React$useState6[1];
|
|
100
|
+
|
|
101
|
+
var _React$useState7 = React.useState(undefined),
|
|
102
|
+
_React$useState8 = _slicedToArray(_React$useState7, 2),
|
|
103
|
+
isBack = _React$useState8[0],
|
|
104
|
+
setIsBack = _React$useState8[1];
|
|
105
|
+
|
|
106
|
+
var _React$useState9 = React.useState(null),
|
|
107
|
+
_React$useState10 = _slicedToArray(_React$useState9, 2),
|
|
108
|
+
prevPanel = _React$useState10[0],
|
|
109
|
+
setPrevPanel = _React$useState10[1];
|
|
110
|
+
|
|
111
|
+
var _React$useState11 = React.useState(null),
|
|
112
|
+
_React$useState12 = _slicedToArray(_React$useState11, 2),
|
|
113
|
+
nextPanel = _React$useState12[0],
|
|
114
|
+
setNextPanel = _React$useState12[1];
|
|
115
|
+
|
|
116
|
+
var _React$useState13 = React.useState(false),
|
|
117
|
+
_React$useState14 = _slicedToArray(_React$useState13, 2),
|
|
118
|
+
swipingBack = _React$useState14[0],
|
|
119
|
+
setSwipingBack = _React$useState14[1];
|
|
120
|
+
|
|
121
|
+
var _React$useState15 = React.useState(0),
|
|
122
|
+
_React$useState16 = _slicedToArray(_React$useState15, 2),
|
|
123
|
+
swipeBackStartX = _React$useState16[0],
|
|
124
|
+
setSwipeBackStartX = _React$useState16[1];
|
|
125
|
+
|
|
126
|
+
var _React$useState17 = React.useState(0),
|
|
127
|
+
_React$useState18 = _slicedToArray(_React$useState17, 2),
|
|
128
|
+
swipeBackShift = _React$useState18[0],
|
|
129
|
+
setSwipeBackShift = _React$useState18[1];
|
|
130
|
+
|
|
131
|
+
var _React$useState19 = React.useState(null),
|
|
132
|
+
_React$useState20 = _slicedToArray(_React$useState19, 2),
|
|
133
|
+
swipeBackNextPanel = _React$useState20[0],
|
|
134
|
+
setSwipeBackNextPanel = _React$useState20[1];
|
|
135
|
+
|
|
136
|
+
var _React$useState21 = React.useState(null),
|
|
137
|
+
_React$useState22 = _slicedToArray(_React$useState21, 2),
|
|
138
|
+
swipeBackPrevPanel = _React$useState22[0],
|
|
139
|
+
setSwipeBackPrevPanel = _React$useState22[1];
|
|
140
|
+
|
|
141
|
+
var _React$useState23 = React.useState(null),
|
|
142
|
+
_React$useState24 = _slicedToArray(_React$useState23, 2),
|
|
143
|
+
swipeBackResult = _React$useState24[0],
|
|
144
|
+
setSwipeBackResult = _React$useState24[1];
|
|
145
|
+
|
|
146
|
+
var _React$useState25 = React.useState(false),
|
|
147
|
+
_React$useState26 = _slicedToArray(_React$useState25, 2),
|
|
148
|
+
browserSwipe = _React$useState26[0],
|
|
149
|
+
setBrowserSwipe = _React$useState26[1];
|
|
150
|
+
|
|
151
|
+
var prevActivePanel = usePrevious(activePanelProp);
|
|
152
|
+
var prevSwipingBack = usePrevious(swipingBack);
|
|
153
|
+
var prevBrowserSwipe = usePrevious(browserSwipe);
|
|
154
|
+
var prevSwipeBackResult = usePrevious(swipeBackResult);
|
|
155
|
+
var prevSwipeBackPrevPanel = usePrevious(swipeBackPrevPanel);
|
|
156
|
+
var prevOnTransition = usePrevious(onTransition);
|
|
157
|
+
var hasPopout = !!popout;
|
|
158
|
+
var hasModal = !!modal;
|
|
159
|
+
var panels = React.Children.toArray(children).filter(function (panel) {
|
|
160
|
+
var panelId = getNavId(panel.props, warn);
|
|
161
|
+
return panelId !== undefined && visiblePanels.includes(panelId) || panelId === swipeBackPrevPanel || panelId === swipeBackNextPanel;
|
|
162
|
+
});
|
|
163
|
+
var disableAnimation = (configProvider === null || configProvider === void 0 ? void 0 : configProvider.transitionMotionEnabled) === false || !(splitCol !== null && splitCol !== void 0 && splitCol.animate);
|
|
164
|
+
|
|
165
|
+
var pickPanel = function pickPanel(id) {
|
|
166
|
+
if (id === null) {
|
|
167
|
+
return null;
|
|
168
|
+
}
|
|
70
169
|
|
|
71
|
-
|
|
170
|
+
return panelNodes.current[id];
|
|
171
|
+
};
|
|
72
172
|
|
|
73
|
-
|
|
74
|
-
|
|
173
|
+
var flushTransition = React.useCallback(function (prevPanel, isBackTransition) {
|
|
174
|
+
if (isBackTransition) {
|
|
175
|
+
scrolls.current[prevPanel] = 0;
|
|
176
|
+
}
|
|
75
177
|
|
|
76
|
-
|
|
178
|
+
setPrevPanel(null);
|
|
179
|
+
setNextPanel(null);
|
|
180
|
+
setVisiblePanels([activePanelProp]);
|
|
181
|
+
setActivePanel(activePanelProp);
|
|
182
|
+
setAnimated(false);
|
|
183
|
+
setIsBack(undefined);
|
|
184
|
+
|
|
185
|
+
afterTransition.current = function () {
|
|
186
|
+
scroll === null || scroll === void 0 ? void 0 : scroll.scrollTo(0, isBackTransition ? scrolls.current[activePanelProp] : 0);
|
|
187
|
+
onTransition && onTransition({
|
|
188
|
+
isBack: isBackTransition,
|
|
189
|
+
from: prevPanel,
|
|
190
|
+
to: activePanelProp
|
|
191
|
+
});
|
|
192
|
+
};
|
|
193
|
+
}, [activePanelProp, onTransition, scroll]);
|
|
194
|
+
useIsomorphicLayoutEffect(function () {
|
|
195
|
+
afterTransition.current();
|
|
196
|
+
afterTransition.current = noop;
|
|
197
|
+
}, [afterTransition.current]);
|
|
198
|
+
var transitionEndHandler = React.useCallback(function (e) {
|
|
199
|
+
if ((!e || ["vkui-animation-ios-next-forward", "vkui-animation-ios-prev-back", "vkui-animation-view-next-forward", "vkui-animation-view-prev-back"].includes(e.animationName)) && prevPanel !== null) {
|
|
200
|
+
flushTransition(prevPanel, Boolean(isBack));
|
|
201
|
+
}
|
|
202
|
+
}, [flushTransition, isBack, prevPanel]);
|
|
203
|
+
|
|
204
|
+
var _useWaitTransitionFin = useWaitTransitionFinish(),
|
|
205
|
+
waitTransitionFinish = _useWaitTransitionFin.waitTransitionFinish;
|
|
206
|
+
|
|
207
|
+
var animationFinishTimeout = useTimeout(transitionEndHandler, platform === IOS ? 600 : 300);
|
|
208
|
+
var onSwipeBackSuccess = React.useCallback(function () {
|
|
209
|
+
onSwipeBack && onSwipeBack();
|
|
210
|
+
}, [onSwipeBack]);
|
|
211
|
+
var onSwipeBackCancel = React.useCallback(function () {
|
|
212
|
+
onSwipeBackCancelProp && onSwipeBackCancelProp();
|
|
213
|
+
setSwipeBackPrevPanel(null);
|
|
214
|
+
setSwipeBackNextPanel(null);
|
|
215
|
+
setSwipingBack(false);
|
|
216
|
+
setSwipeBackResult(null);
|
|
217
|
+
setSwipeBackStartX(0);
|
|
218
|
+
setSwipeBackShift(0);
|
|
219
|
+
}, [onSwipeBackCancelProp]);
|
|
220
|
+
var swipingBackTransitionEndHandler = React.useCallback(function (e) {
|
|
221
|
+
// indexOf because of vendor prefixes in old browsers
|
|
222
|
+
if (!e || e !== null && e !== void 0 && e.propertyName.includes("transform") && (e === null || e === void 0 ? void 0 : e.target) === pickPanel(swipeBackNextPanel)) {
|
|
223
|
+
switch (swipeBackResult) {
|
|
224
|
+
case SwipeBackResults.fail:
|
|
225
|
+
onSwipeBackCancel();
|
|
226
|
+
break;
|
|
227
|
+
|
|
228
|
+
case SwipeBackResults.success:
|
|
229
|
+
onSwipeBackSuccess();
|
|
77
230
|
}
|
|
78
|
-
}
|
|
231
|
+
}
|
|
232
|
+
}, [onSwipeBackCancel, onSwipeBackSuccess, swipeBackNextPanel, swipeBackResult]);
|
|
79
233
|
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
234
|
+
var onMoveX = function onMoveX(e) {
|
|
235
|
+
if (swipeBackExcluded(e)) {
|
|
236
|
+
return;
|
|
237
|
+
}
|
|
84
238
|
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
239
|
+
if (platform === IOS && !(configProvider !== null && configProvider !== void 0 && configProvider.isWebView) && (e.startX <= 70 || e.startX >= window.innerWidth - 70) && !browserSwipe) {
|
|
240
|
+
setBrowserSwipe(true);
|
|
241
|
+
}
|
|
88
242
|
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
});
|
|
243
|
+
if (platform === IOS && configProvider !== null && configProvider !== void 0 && configProvider.isWebView && onSwipeBack) {
|
|
244
|
+
if (animated && e.startX <= 70 || !window) {
|
|
245
|
+
return;
|
|
93
246
|
}
|
|
94
247
|
|
|
95
|
-
if (
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
if (_this.state.animated && e.startX <= 70 || !_this.window) {
|
|
99
|
-
return;
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
if (e.startX <= 70 && !_this.state.swipingBack && ((_this$props$history$l = (_this$props$history = _this.props.history) === null || _this$props$history === void 0 ? void 0 : _this$props$history.length) !== null && _this$props$history$l !== void 0 ? _this$props$history$l : 0) > 1) {
|
|
103
|
-
if (_this.state.activePanel !== null) {
|
|
104
|
-
var _this$props$scroll;
|
|
105
|
-
|
|
106
|
-
_this.scrolls[_this.state.activePanel] = (_this$props$scroll = _this.props.scroll) === null || _this$props$scroll === void 0 ? void 0 : _this$props$scroll.getScroll().y;
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
_this.setState({
|
|
110
|
-
swipingBack: true,
|
|
111
|
-
swipeBackStartX: e.startX,
|
|
112
|
-
swipeBackPrevPanel: _this.state.activePanel,
|
|
113
|
-
swipeBackNextPanel: _this.props.history.slice(-2)[0]
|
|
114
|
-
});
|
|
248
|
+
if (e.startX <= 70 && !swipingBack && history && history.length > 1) {
|
|
249
|
+
if (activePanel !== null) {
|
|
250
|
+
scrolls.current[activePanel] = scroll === null || scroll === void 0 ? void 0 : scroll.getScroll().y;
|
|
115
251
|
}
|
|
116
252
|
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
} else if (e.shiftX > _this.window.innerWidth - _this.state.swipeBackStartX) {
|
|
123
|
-
var _this$window;
|
|
253
|
+
setSwipingBack(true);
|
|
254
|
+
setSwipeBackStartX(e.startX);
|
|
255
|
+
setSwipeBackPrevPanel(activePanel);
|
|
256
|
+
setSwipeBackNextPanel(history.slice(-2)[0]);
|
|
257
|
+
}
|
|
124
258
|
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
swipeBackShift = e.shiftX;
|
|
128
|
-
}
|
|
259
|
+
if (swipingBack) {
|
|
260
|
+
var _swipeBackShift = 0;
|
|
129
261
|
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
}
|
|
135
|
-
});
|
|
136
|
-
|
|
137
|
-
_defineProperty(_assertThisInitialized(_this), "onEnd", function (e) {
|
|
138
|
-
if (_this.state.swipingBack && _this.window) {
|
|
139
|
-
var _this$window$innerWid, _this$window2;
|
|
140
|
-
|
|
141
|
-
var speed = _this.state.swipeBackShift / e.duration * 1000;
|
|
142
|
-
|
|
143
|
-
if (_this.state.swipeBackShift === 0) {
|
|
144
|
-
_this.onSwipeBackCancel();
|
|
145
|
-
} else if (_this.state.swipeBackShift >= ((_this$window$innerWid = (_this$window2 = _this.window) === null || _this$window2 === void 0 ? void 0 : _this$window2.innerWidth) !== null && _this$window$innerWid !== void 0 ? _this$window$innerWid : 0)) {
|
|
146
|
-
_this.onSwipeBackSuccess();
|
|
147
|
-
} else if (speed > 250 || _this.state.swipeBackStartX + _this.state.swipeBackShift > _this.window.innerWidth / 2) {
|
|
148
|
-
_this.setState({
|
|
149
|
-
swipeBackResult: SwipeBackResults.success
|
|
150
|
-
});
|
|
262
|
+
if (e.shiftX < 0) {
|
|
263
|
+
_swipeBackShift = 0;
|
|
264
|
+
} else if (e.shiftX > window.innerWidth - swipeBackStartX) {
|
|
265
|
+
_swipeBackShift = window === null || window === void 0 ? void 0 : window.innerWidth;
|
|
151
266
|
} else {
|
|
152
|
-
|
|
153
|
-
swipeBackResult: SwipeBackResults.fail
|
|
154
|
-
});
|
|
267
|
+
_swipeBackShift = e.shiftX;
|
|
155
268
|
}
|
|
156
|
-
}
|
|
157
|
-
});
|
|
158
|
-
|
|
159
|
-
_this.state = {
|
|
160
|
-
animated: false,
|
|
161
|
-
visiblePanels: [props.activePanel],
|
|
162
|
-
activePanel: props.activePanel,
|
|
163
|
-
isBack: undefined,
|
|
164
|
-
prevPanel: null,
|
|
165
|
-
nextPanel: null,
|
|
166
|
-
swipingBack: false,
|
|
167
|
-
swipeBackStartX: 0,
|
|
168
|
-
swipeBackShift: 0,
|
|
169
|
-
swipeBackNextPanel: null,
|
|
170
|
-
swipeBackPrevPanel: null,
|
|
171
|
-
swipeBackResult: null,
|
|
172
|
-
browserSwipe: false
|
|
173
|
-
};
|
|
174
|
-
return _this;
|
|
175
|
-
}
|
|
176
269
|
|
|
177
|
-
|
|
178
|
-
key: "document",
|
|
179
|
-
get: function get() {
|
|
180
|
-
return this.props.document;
|
|
181
|
-
}
|
|
182
|
-
}, {
|
|
183
|
-
key: "window",
|
|
184
|
-
get: function get() {
|
|
185
|
-
return this.props.window;
|
|
186
|
-
}
|
|
187
|
-
}, {
|
|
188
|
-
key: "panels",
|
|
189
|
-
get: function get() {
|
|
190
|
-
return React.Children.toArray(this.props.children);
|
|
191
|
-
}
|
|
192
|
-
}, {
|
|
193
|
-
key: "componentDidMount",
|
|
194
|
-
value: function componentDidMount() {
|
|
195
|
-
if (process.env.NODE_ENV === "development") {
|
|
196
|
-
var _this$props2 = this.props,
|
|
197
|
-
popout = _this$props2.popout,
|
|
198
|
-
modal = _this$props2.modal;
|
|
199
|
-
popout && warn("Свойство popout устарело и будет удалено в 5.0.0. Используйте одноименное свойство у SplitLayout.");
|
|
200
|
-
modal && warn("Свойство modal устарело и будет удалено в 5.0.0. Используйте одноименное свойство у SplitLayout.");
|
|
270
|
+
setSwipeBackShift(_swipeBackShift);
|
|
201
271
|
}
|
|
202
272
|
}
|
|
203
|
-
}
|
|
204
|
-
key: "componentWillUnmount",
|
|
205
|
-
value: function componentWillUnmount() {
|
|
206
|
-
var id = getNavId(this.props);
|
|
273
|
+
};
|
|
207
274
|
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
275
|
+
var onEnd = React.useCallback(function (e) {
|
|
276
|
+
if (swipingBack && window) {
|
|
277
|
+
var _window$innerWidth;
|
|
211
278
|
|
|
212
|
-
|
|
213
|
-
|
|
279
|
+
var speed = swipeBackShift / e.duration * 1000;
|
|
280
|
+
|
|
281
|
+
if (swipeBackShift === 0) {
|
|
282
|
+
onSwipeBackCancel();
|
|
283
|
+
} else if (swipeBackShift >= ((_window$innerWidth = window === null || window === void 0 ? void 0 : window.innerWidth) !== null && _window$innerWidth !== void 0 ? _window$innerWidth : 0)) {
|
|
284
|
+
onSwipeBackSuccess();
|
|
285
|
+
} else if (speed > 250 || swipeBackStartX + swipeBackShift > window.innerWidth / 2) {
|
|
286
|
+
setSwipeBackResult(SwipeBackResults.success);
|
|
287
|
+
} else {
|
|
288
|
+
setSwipeBackResult(SwipeBackResults.fail);
|
|
214
289
|
}
|
|
215
290
|
}
|
|
216
|
-
},
|
|
217
|
-
key: "componentDidUpdate",
|
|
218
|
-
value: function componentDidUpdate(prevProps, prevState) {
|
|
219
|
-
var _this2 = this;
|
|
220
|
-
|
|
221
|
-
this.props.popout && !prevProps.popout && this.blurActiveElement();
|
|
222
|
-
this.props.modal && !prevProps.modal && this.blurActiveElement(); // Нужен переход
|
|
223
|
-
|
|
224
|
-
if (prevProps.activePanel !== this.props.activePanel && !prevState.swipingBack && !prevState.browserSwipe) {
|
|
225
|
-
var _this$props$scroll2;
|
|
226
|
-
|
|
227
|
-
var firstLayerId = this.panels.map(function (panel) {
|
|
228
|
-
return getNavId(panel.props, warn);
|
|
229
|
-
}).find(function (id) {
|
|
230
|
-
return id === prevProps.activePanel || id === _this2.props.activePanel;
|
|
231
|
-
});
|
|
232
|
-
var isBack = firstLayerId === this.props.activePanel;
|
|
233
|
-
this.scrolls[prevProps.activePanel] = (_this$props$scroll2 = this.props.scroll) === null || _this$props$scroll2 === void 0 ? void 0 : _this$props$scroll2.getScroll().y;
|
|
291
|
+
}, [onSwipeBackCancel, onSwipeBackSuccess, swipeBackShift, swipeBackStartX, swipingBack, window]);
|
|
234
292
|
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
this.setState({
|
|
240
|
-
visiblePanels: [prevProps.activePanel, this.props.activePanel],
|
|
241
|
-
prevPanel: prevProps.activePanel,
|
|
242
|
-
nextPanel: this.props.activePanel,
|
|
243
|
-
activePanel: null,
|
|
244
|
-
animated: true,
|
|
245
|
-
isBack: isBack
|
|
246
|
-
}); // Фолбек анимации перехода
|
|
247
|
-
|
|
248
|
-
if (!animationEvent.supported) {
|
|
249
|
-
if (this.animationFinishTimeout) {
|
|
250
|
-
clearTimeout(this.animationFinishTimeout);
|
|
251
|
-
}
|
|
252
|
-
|
|
253
|
-
this.animationFinishTimeout = setTimeout(this.transitionEndHandler, this.props.platform === IOS ? 600 : 300);
|
|
254
|
-
}
|
|
255
|
-
}
|
|
256
|
-
} // Закончилась анимация свайпа назад
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
if (prevProps.activePanel !== this.props.activePanel && prevState.swipingBack) {
|
|
260
|
-
var nextPanel = this.props.activePanel;
|
|
261
|
-
var prevPanel = prevProps.activePanel;
|
|
262
|
-
|
|
263
|
-
if (prevState.swipeBackPrevPanel !== null) {
|
|
264
|
-
this.scrolls[prevState.swipeBackPrevPanel] = 0;
|
|
265
|
-
}
|
|
266
|
-
|
|
267
|
-
this.setState({
|
|
268
|
-
swipeBackPrevPanel: null,
|
|
269
|
-
swipeBackNextPanel: null,
|
|
270
|
-
swipingBack: false,
|
|
271
|
-
swipeBackResult: null,
|
|
272
|
-
swipeBackStartX: 0,
|
|
273
|
-
swipeBackShift: 0,
|
|
274
|
-
activePanel: nextPanel,
|
|
275
|
-
visiblePanels: [nextPanel]
|
|
276
|
-
}, function () {
|
|
277
|
-
if (_this2.state.activePanel !== null) {
|
|
278
|
-
var _this2$props$scroll;
|
|
279
|
-
|
|
280
|
-
(_this2$props$scroll = _this2.props.scroll) === null || _this2$props$scroll === void 0 ? void 0 : _this2$props$scroll.scrollTo(0, _this2.scrolls[_this2.state.activePanel]);
|
|
281
|
-
}
|
|
282
|
-
|
|
283
|
-
prevProps.onTransition && prevProps.onTransition({
|
|
284
|
-
isBack: true,
|
|
285
|
-
from: prevPanel,
|
|
286
|
-
to: nextPanel
|
|
287
|
-
});
|
|
288
|
-
});
|
|
289
|
-
} // Начался свайп назад
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
if (!prevState.swipingBack && this.state.swipingBack) {
|
|
293
|
-
this.props.onSwipeBackStart && this.props.onSwipeBackStart();
|
|
294
|
-
} // Началась анимация завершения свайпа назад.
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
if (!prevState.swipeBackResult && this.state.swipeBackResult) {
|
|
298
|
-
this.waitTransitionFinish(this.pickPanel(this.state.swipeBackNextPanel), this.swipingBackTransitionEndHandler);
|
|
299
|
-
} // Если свайп назад отменился (когда пользователь недостаточно сильно свайпнул)
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
if (prevState.swipeBackResult === SwipeBackResults.fail && !this.state.swipeBackResult && this.state.activePanel !== null) {
|
|
303
|
-
var _this$props$scroll3;
|
|
304
|
-
|
|
305
|
-
(_this$props$scroll3 = this.props.scroll) === null || _this$props$scroll3 === void 0 ? void 0 : _this$props$scroll3.scrollTo(0, this.scrolls[this.state.activePanel]);
|
|
306
|
-
} // Закончился Safari свайп
|
|
293
|
+
var calcPanelSwipeStyles = function calcPanelSwipeStyles(panelId) {
|
|
294
|
+
if (!canUseDOM || !window) {
|
|
295
|
+
return {};
|
|
296
|
+
}
|
|
307
297
|
|
|
298
|
+
var isPrev = panelId === swipeBackPrevPanel;
|
|
299
|
+
var isNext = panelId === swipeBackNextPanel;
|
|
308
300
|
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
browserSwipe: false,
|
|
312
|
-
nextPanel: null,
|
|
313
|
-
prevPanel: null,
|
|
314
|
-
animated: false,
|
|
315
|
-
visiblePanels: [this.props.activePanel],
|
|
316
|
-
activePanel: this.props.activePanel
|
|
317
|
-
});
|
|
318
|
-
}
|
|
301
|
+
if (!isPrev && !isNext || swipeBackResult) {
|
|
302
|
+
return {};
|
|
319
303
|
}
|
|
320
|
-
}, {
|
|
321
|
-
key: "shouldDisableTransitionMotion",
|
|
322
|
-
value: function shouldDisableTransitionMotion() {
|
|
323
|
-
var _this$props$configPro, _this$props$splitCol;
|
|
324
304
|
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
key: "waitTransitionFinish",
|
|
329
|
-
value: function waitTransitionFinish(elem, eventHandler) {
|
|
330
|
-
if (transitionEvent.supported && transitionEvent.name && elem) {
|
|
331
|
-
elem.removeEventListener(transitionEvent.name, eventHandler);
|
|
332
|
-
elem.addEventListener(transitionEvent.name, eventHandler);
|
|
333
|
-
} else {
|
|
334
|
-
if (this.transitionFinishTimeout) {
|
|
335
|
-
clearTimeout(this.transitionFinishTimeout);
|
|
336
|
-
}
|
|
305
|
+
var prevPanelTranslate = "".concat(swipeBackShift, "px");
|
|
306
|
+
var nextPanelTranslate = "".concat(-50 + swipeBackShift * 100 / window.innerWidth / 2, "%");
|
|
307
|
+
var prevPanelShadow = 0.3 * (window.innerWidth - swipeBackShift) / window.innerWidth;
|
|
337
308
|
|
|
338
|
-
|
|
339
|
-
|
|
309
|
+
if (swipeBackResult) {
|
|
310
|
+
return isPrev ? {
|
|
311
|
+
boxShadow: "-2px 0 12px rgba(0, 0, 0, ".concat(prevPanelShadow, ")")
|
|
312
|
+
} : {};
|
|
340
313
|
}
|
|
341
|
-
}, {
|
|
342
|
-
key: "blurActiveElement",
|
|
343
|
-
value: function blurActiveElement() {
|
|
344
|
-
var _this$document;
|
|
345
314
|
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
315
|
+
if (isNext) {
|
|
316
|
+
return {
|
|
317
|
+
transform: "translate3d(".concat(nextPanelTranslate, ", 0, 0)"),
|
|
318
|
+
WebkitTransform: "translate3d(".concat(nextPanelTranslate, ", 0, 0)")
|
|
319
|
+
};
|
|
349
320
|
}
|
|
350
|
-
}, {
|
|
351
|
-
key: "pickPanel",
|
|
352
|
-
value: function pickPanel(id) {
|
|
353
|
-
if (id === null) {
|
|
354
|
-
return undefined;
|
|
355
|
-
}
|
|
356
321
|
|
|
357
|
-
|
|
322
|
+
if (isPrev) {
|
|
323
|
+
return {
|
|
324
|
+
transform: "translate3d(".concat(prevPanelTranslate, ", 0, 0)"),
|
|
325
|
+
WebkitTransform: "translate3d(".concat(prevPanelTranslate, ", 0, 0)"),
|
|
326
|
+
boxShadow: "-2px 0 12px rgba(0, 0, 0, ".concat(prevPanelShadow, ")")
|
|
327
|
+
};
|
|
358
328
|
}
|
|
359
|
-
}, {
|
|
360
|
-
key: "flushTransition",
|
|
361
|
-
value: function flushTransition(prevPanel, isBack) {
|
|
362
|
-
var _this3 = this;
|
|
363
329
|
|
|
364
|
-
|
|
330
|
+
return {};
|
|
331
|
+
};
|
|
332
|
+
|
|
333
|
+
React.useEffect(function () {
|
|
334
|
+
popout && blurActiveElement(document);
|
|
335
|
+
}, [document, popout]);
|
|
336
|
+
React.useEffect(function () {
|
|
337
|
+
modal && blurActiveElement(document);
|
|
338
|
+
}, [document, modal]);
|
|
339
|
+
React.useEffect(function () {
|
|
340
|
+
// Нужен переход
|
|
341
|
+
if (prevActivePanel && prevActivePanel !== activePanelProp && !prevSwipingBack && !prevBrowserSwipe) {
|
|
342
|
+
var firstLayerId = React.Children.toArray(children).map(function (panel) {
|
|
343
|
+
return getNavId(panel.props, warn);
|
|
344
|
+
}).find(function (id) {
|
|
345
|
+
return id === prevActivePanel || id === activePanelProp;
|
|
346
|
+
});
|
|
347
|
+
var isBackTransition = firstLayerId === activePanelProp;
|
|
348
|
+
scrolls.current[prevActivePanel] = scroll === null || scroll === void 0 ? void 0 : scroll.getScroll().y;
|
|
365
349
|
|
|
366
|
-
if (
|
|
367
|
-
|
|
350
|
+
if (disableAnimation) {
|
|
351
|
+
flushTransition(prevActivePanel, isBackTransition);
|
|
352
|
+
} else {
|
|
353
|
+
blurActiveElement(document);
|
|
354
|
+
setVisiblePanels([prevActivePanel, activePanelProp]);
|
|
355
|
+
setPrevPanel(prevActivePanel);
|
|
356
|
+
setNextPanel(activePanelProp);
|
|
357
|
+
setActivePanel(null);
|
|
358
|
+
setAnimated(true);
|
|
359
|
+
setIsBack(isBackTransition); // Фолбек анимации перехода
|
|
360
|
+
|
|
361
|
+
if (!animationEvent.supported) {
|
|
362
|
+
animationFinishTimeout.set();
|
|
363
|
+
}
|
|
368
364
|
}
|
|
365
|
+
} // Закончилась анимация свайпа назад
|
|
369
366
|
|
|
370
|
-
this.setState({
|
|
371
|
-
prevPanel: null,
|
|
372
|
-
nextPanel: null,
|
|
373
|
-
visiblePanels: [activePanel],
|
|
374
|
-
activePanel: activePanel,
|
|
375
|
-
animated: false,
|
|
376
|
-
isBack: undefined
|
|
377
|
-
}, function () {
|
|
378
|
-
var _this3$props$scroll;
|
|
379
|
-
|
|
380
|
-
(_this3$props$scroll = _this3.props.scroll) === null || _this3$props$scroll === void 0 ? void 0 : _this3$props$scroll.scrollTo(0, isBack ? _this3.scrolls[activePanel] : 0);
|
|
381
|
-
_this3.props.onTransition && _this3.props.onTransition({
|
|
382
|
-
isBack: isBack,
|
|
383
|
-
from: prevPanel,
|
|
384
|
-
to: activePanel
|
|
385
|
-
});
|
|
386
|
-
});
|
|
387
|
-
}
|
|
388
|
-
}, {
|
|
389
|
-
key: "onSwipeBackSuccess",
|
|
390
|
-
value: function onSwipeBackSuccess() {
|
|
391
|
-
this.props.onSwipeBack && this.props.onSwipeBack();
|
|
392
|
-
}
|
|
393
|
-
}, {
|
|
394
|
-
key: "onSwipeBackCancel",
|
|
395
|
-
value: function onSwipeBackCancel() {
|
|
396
|
-
this.props.onSwipeBackCancel && this.props.onSwipeBackCancel();
|
|
397
|
-
this.setState({
|
|
398
|
-
swipeBackPrevPanel: null,
|
|
399
|
-
swipeBackNextPanel: null,
|
|
400
|
-
swipingBack: false,
|
|
401
|
-
swipeBackResult: null,
|
|
402
|
-
swipeBackStartX: 0,
|
|
403
|
-
swipeBackShift: 0
|
|
404
|
-
});
|
|
405
|
-
}
|
|
406
|
-
}, {
|
|
407
|
-
key: "calcPanelSwipeStyles",
|
|
408
|
-
value: function calcPanelSwipeStyles(panelId) {
|
|
409
|
-
if (!canUseDOM || !this.window) {
|
|
410
|
-
return {};
|
|
411
|
-
}
|
|
412
367
|
|
|
413
|
-
|
|
414
|
-
var
|
|
368
|
+
if (prevActivePanel && prevActivePanel !== activePanelProp && prevSwipingBack) {
|
|
369
|
+
var _nextPanel = activePanelProp;
|
|
370
|
+
var _prevPanel = prevActivePanel;
|
|
415
371
|
|
|
416
|
-
if (
|
|
417
|
-
|
|
372
|
+
if (prevSwipeBackPrevPanel) {
|
|
373
|
+
scrolls.current[prevSwipeBackPrevPanel] = 0;
|
|
418
374
|
}
|
|
419
375
|
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
376
|
+
setSwipeBackPrevPanel(null);
|
|
377
|
+
setSwipeBackNextPanel(null);
|
|
378
|
+
setSwipingBack(false);
|
|
379
|
+
setSwipeBackResult(null);
|
|
380
|
+
setSwipeBackStartX(0);
|
|
381
|
+
setSwipeBackShift(0);
|
|
382
|
+
setActivePanel(_nextPanel);
|
|
383
|
+
setVisiblePanels([_nextPanel]);
|
|
384
|
+
|
|
385
|
+
afterTransition.current = function () {
|
|
386
|
+
if (_nextPanel !== null) {
|
|
387
|
+
scroll === null || scroll === void 0 ? void 0 : scroll.scrollTo(0, scrolls.current[_nextPanel]);
|
|
388
|
+
}
|
|
423
389
|
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
390
|
+
prevOnTransition && prevOnTransition({
|
|
391
|
+
isBack: true,
|
|
392
|
+
from: _prevPanel,
|
|
393
|
+
to: _nextPanel
|
|
394
|
+
});
|
|
395
|
+
};
|
|
396
|
+
} // Начался свайп назад
|
|
429
397
|
|
|
430
|
-
if (isNext) {
|
|
431
|
-
return {
|
|
432
|
-
transform: "translate3d(".concat(nextPanelTranslate, ", 0, 0)"),
|
|
433
|
-
WebkitTransform: "translate3d(".concat(nextPanelTranslate, ", 0, 0)")
|
|
434
|
-
};
|
|
435
|
-
}
|
|
436
398
|
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
WebkitTransform: "translate3d(".concat(prevPanelTranslate, ", 0, 0)"),
|
|
441
|
-
boxShadow: "-2px 0 12px rgba(0, 0, 0, ".concat(prevPanelShadow, ")")
|
|
442
|
-
};
|
|
443
|
-
}
|
|
399
|
+
if (!prevSwipingBack && swipingBack) {
|
|
400
|
+
onSwipeBackStart && onSwipeBackStart();
|
|
401
|
+
} // Началась анимация завершения свайпа назад.
|
|
444
402
|
|
|
445
|
-
return {};
|
|
446
|
-
}
|
|
447
|
-
}, {
|
|
448
|
-
key: "render",
|
|
449
|
-
value: function render() {
|
|
450
|
-
var _this4 = this;
|
|
451
|
-
|
|
452
|
-
var _this$props3 = this.props,
|
|
453
|
-
popout = _this$props3.popout,
|
|
454
|
-
modal = _this$props3.modal,
|
|
455
|
-
platform = _this$props3.platform,
|
|
456
|
-
_1 = _this$props3.activePanel,
|
|
457
|
-
splitCol = _this$props3.splitCol,
|
|
458
|
-
configProvider = _this$props3.configProvider,
|
|
459
|
-
history = _this$props3.history,
|
|
460
|
-
nav = _this$props3.nav,
|
|
461
|
-
onTransition = _this$props3.onTransition,
|
|
462
|
-
onSwipeBack = _this$props3.onSwipeBack,
|
|
463
|
-
onSwipeBackStart = _this$props3.onSwipeBackStart,
|
|
464
|
-
onSwipeBackCancel = _this$props3.onSwipeBackCancel,
|
|
465
|
-
window = _this$props3.window,
|
|
466
|
-
document = _this$props3.document,
|
|
467
|
-
scroll = _this$props3.scroll,
|
|
468
|
-
restProps = _objectWithoutProperties(_this$props3, _excluded);
|
|
469
|
-
|
|
470
|
-
var _this$state = this.state,
|
|
471
|
-
prevPanel = _this$state.prevPanel,
|
|
472
|
-
nextPanel = _this$state.nextPanel,
|
|
473
|
-
activePanel = _this$state.activePanel,
|
|
474
|
-
swipeBackPrevPanel = _this$state.swipeBackPrevPanel,
|
|
475
|
-
swipeBackNextPanel = _this$state.swipeBackNextPanel,
|
|
476
|
-
swipeBackResult = _this$state.swipeBackResult,
|
|
477
|
-
isBack = _this$state.isBack,
|
|
478
|
-
animated = _this$state.animated;
|
|
479
|
-
var hasPopout = !!popout;
|
|
480
|
-
var hasModal = !!modal;
|
|
481
|
-
var panels = this.panels.filter(function (panel) {
|
|
482
|
-
var panelId = getNavId(panel.props, warn);
|
|
483
|
-
return panelId !== undefined && _this4.state.visiblePanels.includes(panelId) || panelId === swipeBackPrevPanel || panelId === swipeBackNextPanel;
|
|
484
|
-
});
|
|
485
|
-
var disableAnimation = this.shouldDisableTransitionMotion();
|
|
486
|
-
return createScopedElement(Touch, _extends({
|
|
487
|
-
Component: "section"
|
|
488
|
-
}, restProps, {
|
|
489
|
-
vkuiClass: classNames("View", platform === IOS && "View--ios", !disableAnimation && animated && "View--animated", !disableAnimation && this.state.swipingBack && "View--swiping-back", disableAnimation && "View--no-motion"),
|
|
490
|
-
onMoveX: this.onMoveX,
|
|
491
|
-
onEnd: this.onEnd
|
|
492
|
-
}), createScopedElement("div", {
|
|
493
|
-
vkuiClass: "View__panels"
|
|
494
|
-
}, panels.map(function (panel) {
|
|
495
|
-
var _this4$scrolls;
|
|
496
|
-
|
|
497
|
-
var panelId = getNavId(panel.props, warn);
|
|
498
|
-
var isPrev = panelId === prevPanel || panelId === swipeBackPrevPanel;
|
|
499
|
-
var isTransitionTarget = animated && panelId === (isBack ? prevPanel : nextPanel);
|
|
500
|
-
var compensateScroll = isPrev || panelId === swipeBackNextPanel || panelId === nextPanel && isBack;
|
|
501
|
-
return createScopedElement("div", {
|
|
502
|
-
vkuiClass: classNames("View__panel", panelId === activePanel && "View__panel--active", panelId === prevPanel && "View__panel--prev", panelId === nextPanel && "View__panel--next", panelId === swipeBackPrevPanel && "View__panel--swipe-back-prev", panelId === swipeBackNextPanel && "View__panel--swipe-back-next", swipeBackResult === SwipeBackResults.success && "View__panel--swipe-back-success", swipeBackResult === SwipeBackResults.fail && "View__panel--swipe-back-failed"),
|
|
503
|
-
onAnimationEnd: isTransitionTarget ? _this4.transitionEndHandler : undefined,
|
|
504
|
-
ref: function ref(el) {
|
|
505
|
-
return panelId !== undefined && (_this4.panelNodes[panelId] = el);
|
|
506
|
-
},
|
|
507
|
-
style: _this4.calcPanelSwipeStyles(panelId),
|
|
508
|
-
key: panelId
|
|
509
|
-
}, createScopedElement("div", {
|
|
510
|
-
vkuiClass: "View__panel-in",
|
|
511
|
-
style: {
|
|
512
|
-
marginTop: compensateScroll ? -((_this4$scrolls = _this4.scrolls[panelId]) !== null && _this4$scrolls !== void 0 ? _this4$scrolls : 0) : undefined
|
|
513
|
-
}
|
|
514
|
-
}, createScopedElement(NavTransitionProvider, {
|
|
515
|
-
entering: panelId === nextPanel || panelId === swipeBackNextPanel
|
|
516
|
-
}, panel)));
|
|
517
|
-
})), createScopedElement(AppRootPortal, null, hasPopout && createScopedElement("div", {
|
|
518
|
-
vkuiClass: "View__popout"
|
|
519
|
-
}, popout), hasModal && createScopedElement("div", {
|
|
520
|
-
vkuiClass: "View__modal"
|
|
521
|
-
}, modal)));
|
|
522
|
-
}
|
|
523
|
-
}]);
|
|
524
403
|
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
* @see https://vkcom.github.io/VKUI/#/View
|
|
529
|
-
*/
|
|
404
|
+
if (!prevSwipeBackResult && swipeBackResult) {
|
|
405
|
+
waitTransitionFinish(pickPanel(swipeBackNextPanel), swipingBackTransitionEndHandler, platform === IOS ? 600 : 300);
|
|
406
|
+
} // Если свайп назад отменился (когда пользователь недостаточно сильно свайпнул)
|
|
530
407
|
|
|
531
408
|
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
}
|
|
409
|
+
if (prevSwipeBackResult === SwipeBackResults.fail && !swipeBackResult && activePanel !== null) {
|
|
410
|
+
scroll === null || scroll === void 0 ? void 0 : scroll.scrollTo(0, scrolls.current[activePanel]);
|
|
411
|
+
} // Закончился Safari свайп
|
|
535
412
|
|
|
536
|
-
|
|
537
|
-
|
|
413
|
+
|
|
414
|
+
if (prevActivePanel !== activePanelProp && browserSwipe) {
|
|
415
|
+
setBrowserSwipe(false);
|
|
416
|
+
setNextPanel(null);
|
|
417
|
+
setPrevPanel(null);
|
|
418
|
+
setAnimated(false);
|
|
419
|
+
setVisiblePanels([activePanelProp]);
|
|
420
|
+
setActivePanel(activePanelProp);
|
|
421
|
+
}
|
|
422
|
+
}, [activePanelProp, activePanel, animationFinishTimeout, browserSwipe, children, disableAnimation, document, flushTransition, onSwipeBackStart, panels, platform, prevActivePanel, prevBrowserSwipe, prevOnTransition, prevSwipeBackPrevPanel, prevSwipeBackResult, prevSwipingBack, scroll, swipeBackNextPanel, swipeBackResult, swipingBack, swipingBackTransitionEndHandler, waitTransitionFinish]);
|
|
423
|
+
return createScopedElement(Touch, _extends({
|
|
424
|
+
Component: "section"
|
|
425
|
+
}, restProps, {
|
|
426
|
+
vkuiClass: classNames("View", platform === IOS && "View--ios", !disableAnimation && animated && "View--animated", !disableAnimation && swipingBack && "View--swiping-back", disableAnimation && "View--no-motion"),
|
|
427
|
+
onMoveX: onMoveX,
|
|
428
|
+
onEnd: onEnd
|
|
429
|
+
}), createScopedElement("div", {
|
|
430
|
+
vkuiClass: "View__panels"
|
|
431
|
+
}, panels.map(function (panel) {
|
|
432
|
+
var _scrolls$current;
|
|
433
|
+
|
|
434
|
+
var panelId = getNavId(panel.props, warn);
|
|
435
|
+
var isPrev = panelId === prevPanel || panelId === swipeBackPrevPanel;
|
|
436
|
+
var isTransitionTarget = animated && panelId === (isBack ? prevPanel : nextPanel);
|
|
437
|
+
var compensateScroll = isPrev || panelId === swipeBackNextPanel || panelId === nextPanel && isBack;
|
|
438
|
+
return createScopedElement("div", {
|
|
439
|
+
vkuiClass: classNames("View__panel", panelId === activePanel && "View__panel--active", panelId === prevPanel && "View__panel--prev", panelId === nextPanel && "View__panel--next", panelId === swipeBackPrevPanel && "View__panel--swipe-back-prev", panelId === swipeBackNextPanel && "View__panel--swipe-back-next", swipeBackResult === SwipeBackResults.success && "View__panel--swipe-back-success", swipeBackResult === SwipeBackResults.fail && "View__panel--swipe-back-failed"),
|
|
440
|
+
onAnimationEnd: isTransitionTarget ? transitionEndHandler : undefined,
|
|
441
|
+
ref: function ref(el) {
|
|
442
|
+
return panelId !== undefined && (panelNodes.current[panelId] = el);
|
|
443
|
+
},
|
|
444
|
+
style: calcPanelSwipeStyles(panelId),
|
|
445
|
+
key: panelId
|
|
446
|
+
}, createScopedElement("div", {
|
|
447
|
+
vkuiClass: "View__panel-in",
|
|
448
|
+
style: {
|
|
449
|
+
marginTop: compensateScroll ? -((_scrolls$current = scrolls.current[panelId]) !== null && _scrolls$current !== void 0 ? _scrolls$current : 0) : undefined
|
|
450
|
+
}
|
|
451
|
+
}, createScopedElement(NavTransitionProvider, {
|
|
452
|
+
entering: panelId === nextPanel || panelId === swipeBackNextPanel
|
|
453
|
+
}, panel)));
|
|
454
|
+
})), createScopedElement(AppRootPortal, null, hasPopout && createScopedElement("div", {
|
|
455
|
+
vkuiClass: "View__popout"
|
|
456
|
+
}, popout), hasModal && createScopedElement("div", {
|
|
457
|
+
vkuiClass: "View__modal"
|
|
458
|
+
}, modal)));
|
|
459
|
+
};
|
|
538
460
|
//# sourceMappingURL=View.js.map
|