@vkontakte/vkui 5.9.1 → 5.9.3
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/cjs/components/ActionSheet/ActionSheet.js +1 -1
- package/dist/cjs/components/ActionSheet/ActionSheet.js.map +1 -1
- package/dist/cjs/components/Alert/Alert.d.ts +3 -3
- package/dist/cjs/components/Alert/Alert.d.ts.map +1 -1
- package/dist/cjs/components/Alert/Alert.js +5 -3
- package/dist/cjs/components/Alert/Alert.js.map +1 -1
- package/dist/cjs/components/CalendarRange/CalendarRange.d.ts +1 -1
- package/dist/cjs/components/CalendarRange/CalendarRange.d.ts.map +1 -1
- package/dist/cjs/components/CalendarRange/CalendarRange.js +1 -2
- package/dist/cjs/components/CalendarRange/CalendarRange.js.map +1 -1
- package/dist/cjs/components/ChipsSelect/ChipsSelect.js +1 -1
- package/dist/cjs/components/ChipsSelect/ChipsSelect.js.map +1 -1
- package/dist/cjs/components/CustomScrollView/CustomScrollView.d.ts +4 -2
- package/dist/cjs/components/CustomScrollView/CustomScrollView.d.ts.map +1 -1
- package/dist/cjs/components/CustomScrollView/CustomScrollView.js +17 -5
- package/dist/cjs/components/CustomScrollView/CustomScrollView.js.map +1 -1
- package/dist/cjs/components/CustomSelect/CustomSelect.d.ts +4 -1
- package/dist/cjs/components/CustomSelect/CustomSelect.d.ts.map +1 -1
- package/dist/cjs/components/CustomSelect/CustomSelect.js.map +1 -1
- package/dist/cjs/components/FormLayout/FormLayout.d.ts +3 -3
- package/dist/cjs/components/FormLayout/FormLayout.d.ts.map +1 -1
- package/dist/cjs/components/FormLayout/FormLayout.js +5 -2
- package/dist/cjs/components/FormLayout/FormLayout.js.map +1 -1
- package/dist/cjs/components/Gallery/Gallery.d.ts.map +1 -1
- package/dist/cjs/components/Gallery/Gallery.js +3 -10
- package/dist/cjs/components/Gallery/Gallery.js.map +1 -1
- package/dist/cjs/components/Gallery/hooks.d.ts +2 -0
- package/dist/cjs/components/Gallery/hooks.d.ts.map +1 -0
- package/dist/cjs/components/Gallery/hooks.js +52 -0
- package/dist/cjs/components/Gallery/hooks.js.map +1 -0
- package/dist/cjs/components/Header/Header.d.ts +3 -3
- package/dist/cjs/components/Header/Header.d.ts.map +1 -1
- package/dist/cjs/components/Header/Header.js +4 -5
- package/dist/cjs/components/Header/Header.js.map +1 -1
- package/dist/cjs/components/HorizontalScroll/HorizontalScroll.d.ts.map +1 -1
- package/dist/cjs/components/HorizontalScroll/HorizontalScroll.js +4 -0
- package/dist/cjs/components/HorizontalScroll/HorizontalScroll.js.map +1 -1
- package/dist/cjs/components/ModalPageHeader/ModalPageHeader.d.ts +3 -3
- package/dist/cjs/components/ModalPageHeader/ModalPageHeader.d.ts.map +1 -1
- package/dist/cjs/components/ModalPageHeader/ModalPageHeader.js +5 -2
- package/dist/cjs/components/ModalPageHeader/ModalPageHeader.js.map +1 -1
- package/dist/cjs/components/ModalRoot/ModalRoot.js +6 -8
- package/dist/cjs/components/ModalRoot/ModalRoot.js.map +1 -1
- package/dist/cjs/components/PullToRefresh/PullToRefresh.d.ts.map +1 -1
- package/dist/cjs/components/PullToRefresh/PullToRefresh.js +22 -7
- package/dist/cjs/components/PullToRefresh/PullToRefresh.js.map +1 -1
- package/dist/cjs/components/Typography/Caption/Caption.d.ts +2 -0
- package/dist/cjs/components/Typography/Caption/Caption.d.ts.map +1 -1
- package/dist/cjs/components/Typography/Caption/Caption.js.map +1 -1
- package/dist/cjs/components/Typography/Footnote/Footnote.d.ts +2 -0
- package/dist/cjs/components/Typography/Footnote/Footnote.d.ts.map +1 -1
- package/dist/cjs/components/Typography/Footnote/Footnote.js.map +1 -1
- package/dist/cjs/components/Typography/Headline/Headline.d.ts +2 -0
- package/dist/cjs/components/Typography/Headline/Headline.d.ts.map +1 -1
- package/dist/cjs/components/Typography/Headline/Headline.js.map +1 -1
- package/dist/cjs/components/Typography/Paragraph/Paragraph.d.ts +2 -0
- package/dist/cjs/components/Typography/Paragraph/Paragraph.d.ts.map +1 -1
- package/dist/cjs/components/Typography/Paragraph/Paragraph.js.map +1 -1
- package/dist/cjs/components/Typography/Subhead/Subhead.d.ts +2 -0
- package/dist/cjs/components/Typography/Subhead/Subhead.d.ts.map +1 -1
- package/dist/cjs/components/Typography/Subhead/Subhead.js.map +1 -1
- package/dist/cjs/components/Typography/Text/Text.d.ts +2 -0
- package/dist/cjs/components/Typography/Text/Text.d.ts.map +1 -1
- package/dist/cjs/components/Typography/Text/Text.js.map +1 -1
- package/dist/cjs/components/Typography/Title/Title.d.ts +2 -0
- package/dist/cjs/components/Typography/Title/Title.d.ts.map +1 -1
- package/dist/cjs/components/Typography/Title/Title.js.map +1 -1
- package/dist/cjs/components/VisuallyHiddenInput/VisuallyHiddenInput.d.ts +3 -3
- package/dist/cjs/components/VisuallyHiddenInput/VisuallyHiddenInput.d.ts.map +1 -1
- package/dist/cjs/components/VisuallyHiddenInput/VisuallyHiddenInput.js +6 -3
- package/dist/cjs/components/VisuallyHiddenInput/VisuallyHiddenInput.js.map +1 -1
- package/dist/cjs/lib/floating/adapters.d.ts +1 -1
- package/dist/cjs/lib/floating/adapters.d.ts.map +1 -1
- package/dist/cjs/lib/floating/adapters.js +1 -1
- package/dist/cjs/lib/floating/adapters.js.map +1 -1
- package/dist/cjs/lib/floating/index.d.ts +1 -1
- package/dist/cjs/lib/floating/index.d.ts.map +1 -1
- package/dist/cjs/lib/floating/index.js +1 -1
- package/dist/cjs/lib/floating/index.js.map +1 -1
- package/dist/cjs/lib/floating/types.d.ts +2 -2
- package/dist/cjs/lib/floating/types.d.ts.map +1 -1
- package/dist/components/ActionSheet/ActionSheet.js +1 -1
- package/dist/components/ActionSheet/ActionSheet.js.map +1 -1
- package/dist/components/Alert/Alert.d.ts +3 -3
- package/dist/components/Alert/Alert.d.ts.map +1 -1
- package/dist/components/Alert/Alert.js +5 -3
- package/dist/components/Alert/Alert.js.map +1 -1
- package/dist/components/CalendarRange/CalendarRange.d.ts +1 -1
- package/dist/components/CalendarRange/CalendarRange.d.ts.map +1 -1
- package/dist/components/CalendarRange/CalendarRange.js +1 -2
- package/dist/components/CalendarRange/CalendarRange.js.map +1 -1
- package/dist/components/ChipsSelect/ChipsSelect.js +1 -1
- package/dist/components/ChipsSelect/ChipsSelect.js.map +1 -1
- package/dist/components/CustomScrollView/CustomScrollView.d.ts +4 -2
- package/dist/components/CustomScrollView/CustomScrollView.d.ts.map +1 -1
- package/dist/components/CustomScrollView/CustomScrollView.js +17 -5
- package/dist/components/CustomScrollView/CustomScrollView.js.map +1 -1
- package/dist/components/CustomSelect/CustomSelect.d.ts +4 -1
- package/dist/components/CustomSelect/CustomSelect.d.ts.map +1 -1
- package/dist/components/CustomSelect/CustomSelect.js.map +1 -1
- package/dist/components/FormLayout/FormLayout.d.ts +3 -3
- package/dist/components/FormLayout/FormLayout.d.ts.map +1 -1
- package/dist/components/FormLayout/FormLayout.js +5 -2
- package/dist/components/FormLayout/FormLayout.js.map +1 -1
- package/dist/components/Gallery/Gallery.d.ts.map +1 -1
- package/dist/components/Gallery/Gallery.js +3 -10
- package/dist/components/Gallery/Gallery.js.map +1 -1
- package/dist/components/Gallery/hooks.d.ts +2 -0
- package/dist/components/Gallery/hooks.d.ts.map +1 -0
- package/dist/components/Gallery/hooks.js +41 -0
- package/dist/components/Gallery/hooks.js.map +1 -0
- package/dist/components/Header/Header.d.ts +3 -3
- package/dist/components/Header/Header.d.ts.map +1 -1
- package/dist/components/Header/Header.js +4 -5
- package/dist/components/Header/Header.js.map +1 -1
- package/dist/components/HorizontalScroll/HorizontalScroll.d.ts.map +1 -1
- package/dist/components/HorizontalScroll/HorizontalScroll.js +4 -0
- package/dist/components/HorizontalScroll/HorizontalScroll.js.map +1 -1
- package/dist/components/ModalPageHeader/ModalPageHeader.d.ts +3 -3
- package/dist/components/ModalPageHeader/ModalPageHeader.d.ts.map +1 -1
- package/dist/components/ModalPageHeader/ModalPageHeader.js +5 -2
- package/dist/components/ModalPageHeader/ModalPageHeader.js.map +1 -1
- package/dist/components/ModalRoot/ModalRoot.js +6 -8
- package/dist/components/ModalRoot/ModalRoot.js.map +1 -1
- package/dist/components/PullToRefresh/PullToRefresh.d.ts.map +1 -1
- package/dist/components/PullToRefresh/PullToRefresh.js +22 -7
- package/dist/components/PullToRefresh/PullToRefresh.js.map +1 -1
- package/dist/components/Typography/Caption/Caption.d.ts +2 -0
- package/dist/components/Typography/Caption/Caption.d.ts.map +1 -1
- package/dist/components/Typography/Caption/Caption.js +2 -0
- package/dist/components/Typography/Caption/Caption.js.map +1 -1
- package/dist/components/Typography/Footnote/Footnote.d.ts +2 -0
- package/dist/components/Typography/Footnote/Footnote.d.ts.map +1 -1
- package/dist/components/Typography/Footnote/Footnote.js +2 -0
- package/dist/components/Typography/Footnote/Footnote.js.map +1 -1
- package/dist/components/Typography/Headline/Headline.d.ts +2 -0
- package/dist/components/Typography/Headline/Headline.d.ts.map +1 -1
- package/dist/components/Typography/Headline/Headline.js +2 -0
- package/dist/components/Typography/Headline/Headline.js.map +1 -1
- package/dist/components/Typography/Paragraph/Paragraph.d.ts +2 -0
- package/dist/components/Typography/Paragraph/Paragraph.d.ts.map +1 -1
- package/dist/components/Typography/Paragraph/Paragraph.js +2 -0
- package/dist/components/Typography/Paragraph/Paragraph.js.map +1 -1
- package/dist/components/Typography/Subhead/Subhead.d.ts +2 -0
- package/dist/components/Typography/Subhead/Subhead.d.ts.map +1 -1
- package/dist/components/Typography/Subhead/Subhead.js +2 -0
- package/dist/components/Typography/Subhead/Subhead.js.map +1 -1
- package/dist/components/Typography/Text/Text.d.ts +2 -0
- package/dist/components/Typography/Text/Text.d.ts.map +1 -1
- package/dist/components/Typography/Text/Text.js +2 -0
- package/dist/components/Typography/Text/Text.js.map +1 -1
- package/dist/components/Typography/Title/Title.d.ts +2 -0
- package/dist/components/Typography/Title/Title.d.ts.map +1 -1
- package/dist/components/Typography/Title/Title.js +2 -0
- package/dist/components/Typography/Title/Title.js.map +1 -1
- package/dist/components/VisuallyHiddenInput/VisuallyHiddenInput.d.ts +3 -3
- package/dist/components/VisuallyHiddenInput/VisuallyHiddenInput.d.ts.map +1 -1
- package/dist/components/VisuallyHiddenInput/VisuallyHiddenInput.js +6 -3
- package/dist/components/VisuallyHiddenInput/VisuallyHiddenInput.js.map +1 -1
- package/dist/components.css +6 -6
- package/dist/components.css.map +1 -1
- package/dist/components.js.tmp +3783 -2492
- package/dist/cssm/components/ActionSheet/ActionSheet.js +1 -1
- package/dist/cssm/components/ActionSheet/ActionSheet.js.map +1 -1
- package/dist/cssm/components/Alert/Alert.d.ts +3 -3
- package/dist/cssm/components/Alert/Alert.d.ts.map +1 -1
- package/dist/cssm/components/Alert/Alert.js +3 -2
- package/dist/cssm/components/Alert/Alert.js.map +1 -1
- package/dist/cssm/components/Alert/Alert.module.css +5 -0
- package/dist/cssm/components/Button/Button.module.css +3 -1
- package/dist/cssm/components/CalendarRange/CalendarRange.d.ts +1 -1
- package/dist/cssm/components/CalendarRange/CalendarRange.d.ts.map +1 -1
- package/dist/cssm/components/CalendarRange/CalendarRange.js +1 -1
- package/dist/cssm/components/CalendarRange/CalendarRange.js.map +1 -1
- package/dist/cssm/components/ChipsSelect/ChipsSelect.js +1 -1
- package/dist/cssm/components/ChipsSelect/ChipsSelect.js.map +1 -1
- package/dist/cssm/components/CustomScrollView/CustomScrollView.d.ts +4 -2
- package/dist/cssm/components/CustomScrollView/CustomScrollView.d.ts.map +1 -1
- package/dist/cssm/components/CustomScrollView/CustomScrollView.js +4 -2
- package/dist/cssm/components/CustomScrollView/CustomScrollView.js.map +1 -1
- package/dist/cssm/components/CustomSelect/CustomSelect.d.ts +4 -1
- package/dist/cssm/components/CustomSelect/CustomSelect.d.ts.map +1 -1
- package/dist/cssm/components/CustomSelect/CustomSelect.js.map +1 -1
- package/dist/cssm/components/CustomSelectOption/CustomSelectOption.module.css +0 -5
- package/dist/cssm/components/FormLayout/FormLayout.d.ts +3 -3
- package/dist/cssm/components/FormLayout/FormLayout.d.ts.map +1 -1
- package/dist/cssm/components/FormLayout/FormLayout.js +4 -2
- package/dist/cssm/components/FormLayout/FormLayout.js.map +1 -1
- package/dist/cssm/components/Gallery/Gallery.d.ts.map +1 -1
- package/dist/cssm/components/Gallery/Gallery.js +2 -7
- package/dist/cssm/components/Gallery/Gallery.js.map +1 -1
- package/dist/cssm/components/Gallery/hooks.d.ts +2 -0
- package/dist/cssm/components/Gallery/hooks.d.ts.map +1 -0
- package/dist/cssm/components/Gallery/hooks.js +39 -0
- package/dist/cssm/components/Gallery/hooks.js.map +1 -0
- package/dist/cssm/components/Header/Header.d.ts +3 -3
- package/dist/cssm/components/Header/Header.d.ts.map +1 -1
- package/dist/cssm/components/Header/Header.js +2 -3
- package/dist/cssm/components/Header/Header.js.map +1 -1
- package/dist/cssm/components/HorizontalScroll/HorizontalScroll.d.ts.map +1 -1
- package/dist/cssm/components/HorizontalScroll/HorizontalScroll.js +4 -0
- package/dist/cssm/components/HorizontalScroll/HorizontalScroll.js.map +1 -1
- package/dist/cssm/components/ModalPage/ModalPage.module.css +1 -4
- package/dist/cssm/components/ModalPageHeader/ModalPageHeader.d.ts +3 -3
- package/dist/cssm/components/ModalPageHeader/ModalPageHeader.d.ts.map +1 -1
- package/dist/cssm/components/ModalPageHeader/ModalPageHeader.js +4 -2
- package/dist/cssm/components/ModalPageHeader/ModalPageHeader.js.map +1 -1
- package/dist/cssm/components/ModalRoot/ModalRoot.js +6 -8
- package/dist/cssm/components/ModalRoot/ModalRoot.js.map +1 -1
- package/dist/cssm/components/PanelHeaderButton/PanelHeaderButton.module.css +7 -1
- package/dist/cssm/components/PullToRefresh/PullToRefresh.d.ts.map +1 -1
- package/dist/cssm/components/PullToRefresh/PullToRefresh.js +22 -7
- package/dist/cssm/components/PullToRefresh/PullToRefresh.js.map +1 -1
- package/dist/cssm/components/Snackbar/Snackbar.module.css +1 -1
- package/dist/cssm/components/Typography/Caption/Caption.d.ts +2 -0
- package/dist/cssm/components/Typography/Caption/Caption.d.ts.map +1 -1
- package/dist/cssm/components/Typography/Caption/Caption.js +2 -0
- package/dist/cssm/components/Typography/Caption/Caption.js.map +1 -1
- package/dist/cssm/components/Typography/Footnote/Footnote.d.ts +2 -0
- package/dist/cssm/components/Typography/Footnote/Footnote.d.ts.map +1 -1
- package/dist/cssm/components/Typography/Footnote/Footnote.js +2 -0
- package/dist/cssm/components/Typography/Footnote/Footnote.js.map +1 -1
- package/dist/cssm/components/Typography/Headline/Headline.d.ts +2 -0
- package/dist/cssm/components/Typography/Headline/Headline.d.ts.map +1 -1
- package/dist/cssm/components/Typography/Headline/Headline.js +2 -0
- package/dist/cssm/components/Typography/Headline/Headline.js.map +1 -1
- package/dist/cssm/components/Typography/Paragraph/Paragraph.d.ts +2 -0
- package/dist/cssm/components/Typography/Paragraph/Paragraph.d.ts.map +1 -1
- package/dist/cssm/components/Typography/Paragraph/Paragraph.js +2 -0
- package/dist/cssm/components/Typography/Paragraph/Paragraph.js.map +1 -1
- package/dist/cssm/components/Typography/Subhead/Subhead.d.ts +2 -0
- package/dist/cssm/components/Typography/Subhead/Subhead.d.ts.map +1 -1
- package/dist/cssm/components/Typography/Subhead/Subhead.js +2 -0
- package/dist/cssm/components/Typography/Subhead/Subhead.js.map +1 -1
- package/dist/cssm/components/Typography/Text/Text.d.ts +2 -0
- package/dist/cssm/components/Typography/Text/Text.d.ts.map +1 -1
- package/dist/cssm/components/Typography/Text/Text.js +2 -0
- package/dist/cssm/components/Typography/Text/Text.js.map +1 -1
- package/dist/cssm/components/Typography/Title/Title.d.ts +2 -0
- package/dist/cssm/components/Typography/Title/Title.d.ts.map +1 -1
- package/dist/cssm/components/Typography/Title/Title.js +2 -0
- package/dist/cssm/components/Typography/Title/Title.js.map +1 -1
- package/dist/cssm/components/VisuallyHiddenInput/VisuallyHiddenInput.d.ts +3 -3
- package/dist/cssm/components/VisuallyHiddenInput/VisuallyHiddenInput.d.ts.map +1 -1
- package/dist/cssm/components/VisuallyHiddenInput/VisuallyHiddenInput.js +4 -2
- package/dist/cssm/components/VisuallyHiddenInput/VisuallyHiddenInput.js.map +1 -1
- package/dist/cssm/lib/floating/adapters.d.ts +1 -1
- package/dist/cssm/lib/floating/adapters.d.ts.map +1 -1
- package/dist/cssm/lib/floating/adapters.js +1 -1
- package/dist/cssm/lib/floating/adapters.js.map +1 -1
- package/dist/cssm/lib/floating/index.d.ts +1 -1
- package/dist/cssm/lib/floating/index.d.ts.map +1 -1
- package/dist/cssm/lib/floating/index.js +1 -1
- package/dist/cssm/lib/floating/index.js.map +1 -1
- package/dist/cssm/lib/floating/types.d.ts +2 -2
- package/dist/cssm/lib/floating/types.d.ts.map +1 -1
- package/dist/cssm/lib/floating/types.js.map +1 -1
- package/dist/lib/floating/adapters.d.ts +1 -1
- package/dist/lib/floating/adapters.d.ts.map +1 -1
- package/dist/lib/floating/adapters.js +1 -1
- package/dist/lib/floating/adapters.js.map +1 -1
- package/dist/lib/floating/index.d.ts +1 -1
- package/dist/lib/floating/index.d.ts.map +1 -1
- package/dist/lib/floating/index.js +1 -1
- package/dist/lib/floating/index.js.map +1 -1
- package/dist/lib/floating/types.d.ts +2 -2
- package/dist/lib/floating/types.d.ts.map +1 -1
- package/dist/lib/floating/types.js.map +1 -1
- package/dist/vkui.css +6 -6
- package/dist/vkui.css.map +1 -1
- package/dist/vkui.js.tmp +3783 -2492
- package/package.json +2 -2
- package/src/components/ActionSheet/ActionSheet.tsx +2 -2
- package/src/components/Alert/Alert.module.css +5 -0
- package/src/components/Alert/Alert.tsx +10 -3
- package/src/components/Button/Button.module.css +3 -1
- package/src/components/CalendarRange/CalendarRange.tsx +0 -1
- package/src/components/ChipsSelect/ChipsSelect.tsx +1 -1
- package/src/components/CustomScrollView/CustomScrollView.tsx +13 -2
- package/src/components/CustomSelect/CustomSelect.tsx +5 -1
- package/src/components/CustomSelectOption/CustomSelectOption.module.css +0 -5
- package/src/components/FormLayout/FormLayout.tsx +8 -3
- package/src/components/Gallery/Gallery.tsx +2 -6
- package/src/components/Gallery/hooks.ts +39 -0
- package/src/components/Header/Header.tsx +3 -3
- package/src/components/HorizontalScroll/HorizontalScroll.tsx +4 -0
- package/src/components/ModalPage/ModalPage.module.css +1 -4
- package/src/components/ModalPageHeader/ModalPageHeader.tsx +8 -4
- package/src/components/ModalRoot/ModalRoot.tsx +6 -5
- package/src/components/PanelHeaderButton/PanelHeaderButton.module.css +6 -1
- package/src/components/PullToRefresh/PullToRefresh.tsx +28 -9
- package/src/components/Snackbar/Snackbar.module.css +1 -1
- package/src/components/Typography/Caption/Caption.tsx +2 -0
- package/src/components/Typography/Footnote/Footnote.tsx +2 -0
- package/src/components/Typography/Headline/Headline.tsx +2 -0
- package/src/components/Typography/Paragraph/Paragraph.tsx +2 -0
- package/src/components/Typography/Subhead/Subhead.tsx +2 -0
- package/src/components/Typography/Text/Text.tsx +2 -0
- package/src/components/Typography/Title/Title.tsx +2 -0
- package/src/components/VisuallyHiddenInput/VisuallyHiddenInput.tsx +6 -2
- package/src/lib/floating/adapters.ts +1 -1
- package/src/lib/floating/index.ts +1 -1
- package/src/lib/floating/types.ts +2 -2
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "5.9.
|
|
2
|
+
"version": "5.9.3",
|
|
3
3
|
"name": "@vkontakte/vkui",
|
|
4
4
|
"description": "VKUI library",
|
|
5
5
|
"main": "dist/cjs/index.js",
|
|
@@ -70,10 +70,10 @@
|
|
|
70
70
|
"react-dom": "^17.0.0 || ^18.1.0"
|
|
71
71
|
},
|
|
72
72
|
"dependencies": {
|
|
73
|
-
"@floating-ui/react-dom": "^2.0.2",
|
|
74
73
|
"@swc/helpers": "^0.5.2",
|
|
75
74
|
"@vkontakte/icons": "^2.62.0",
|
|
76
75
|
"@vkontakte/vkjs": "^1.1.0",
|
|
76
|
+
"@vkontakte/vkui-floating-ui": "^0.1.0",
|
|
77
77
|
"dayjs": "^1.11.10",
|
|
78
78
|
"mitt": "^3.0.1"
|
|
79
79
|
},
|
|
@@ -130,14 +130,14 @@ export const ActionSheet = ({
|
|
|
130
130
|
>
|
|
131
131
|
<div className={styles['ActionSheet__content-wrapper']}>
|
|
132
132
|
{(header || text) && (
|
|
133
|
-
<
|
|
133
|
+
<div className={styles['ActionSheet__header']}>
|
|
134
134
|
{header && (
|
|
135
135
|
<Footnote weight="2" className={styles['ActionSheet__title']}>
|
|
136
136
|
{header}
|
|
137
137
|
</Footnote>
|
|
138
138
|
)}
|
|
139
139
|
{text && <Footnote className={styles['ActionSheet__text']}>{text}</Footnote>}
|
|
140
|
-
</
|
|
140
|
+
</div>
|
|
141
141
|
)}
|
|
142
142
|
{children}
|
|
143
143
|
</div>
|
|
@@ -7,7 +7,7 @@ import { usePlatform } from '../../hooks/usePlatform';
|
|
|
7
7
|
import { useWaitTransitionFinish } from '../../hooks/useWaitTransitionFinish';
|
|
8
8
|
import { Platform } from '../../lib/platform';
|
|
9
9
|
import { stopPropagation } from '../../lib/utils';
|
|
10
|
-
import { AlignType, AnchorHTMLAttributesOnly, HasDataAttribute } from '../../types';
|
|
10
|
+
import { AlignType, AnchorHTMLAttributesOnly, HasDataAttribute, HasRootRef } from '../../types';
|
|
11
11
|
import { useScrollLock } from '../AppRoot/ScrollContext';
|
|
12
12
|
import { ButtonProps } from '../Button/Button';
|
|
13
13
|
import { FocusTrap } from '../FocusTrap/FocusTrap';
|
|
@@ -31,7 +31,7 @@ export interface AlertActionInterface
|
|
|
31
31
|
mode: AlertActionMode;
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
-
export interface AlertProps extends React.HTMLAttributes<HTMLElement> {
|
|
34
|
+
export interface AlertProps extends React.HTMLAttributes<HTMLElement>, HasRootRef<HTMLDivElement> {
|
|
35
35
|
actionsLayout?: 'vertical' | 'horizontal';
|
|
36
36
|
actionsAlign?: AlignType;
|
|
37
37
|
actions?: AlertActionInterface[];
|
|
@@ -67,6 +67,7 @@ export const Alert = ({
|
|
|
67
67
|
renderAction,
|
|
68
68
|
actionsAlign,
|
|
69
69
|
dismissButtonMode = 'outside',
|
|
70
|
+
getRootRef,
|
|
70
71
|
...restProps
|
|
71
72
|
}: AlertProps) => {
|
|
72
73
|
const generatedId = useId();
|
|
@@ -124,7 +125,13 @@ export const Alert = ({
|
|
|
124
125
|
useScrollLock();
|
|
125
126
|
|
|
126
127
|
return (
|
|
127
|
-
<PopoutWrapper
|
|
128
|
+
<PopoutWrapper
|
|
129
|
+
className={className}
|
|
130
|
+
closing={closing}
|
|
131
|
+
style={style}
|
|
132
|
+
onClick={close}
|
|
133
|
+
getRootRef={getRootRef}
|
|
134
|
+
>
|
|
128
135
|
<FocusTrap
|
|
129
136
|
{...restProps}
|
|
130
137
|
getRootRef={elementRef}
|
|
@@ -185,7 +185,9 @@
|
|
|
185
185
|
.Button--mode-link .Button__after,
|
|
186
186
|
.Button--mode-link .Button__before,
|
|
187
187
|
.Button--mode-link .Button__content:first-child,
|
|
188
|
-
.Button--mode-link .Button__content:last-child
|
|
188
|
+
.Button--mode-link .Button__content:last-child,
|
|
189
|
+
.Button--stretched .Button__after:only-child,
|
|
190
|
+
.Button--stretched .Button__before:only-child {
|
|
189
191
|
padding-left: 0;
|
|
190
192
|
padding-right: 0;
|
|
191
193
|
}
|
|
@@ -137,7 +137,7 @@ export const ChipsSelect = <Option extends ChipOption>(props: ChipsSelectProps<O
|
|
|
137
137
|
const [popperPlacement, setPopperPlacement] = React.useState<Placement | undefined>(undefined);
|
|
138
138
|
|
|
139
139
|
const scrollBoxRef = React.useRef<HTMLDivElement>(null);
|
|
140
|
-
const rootRef = useExternRef(
|
|
140
|
+
const rootRef = useExternRef(getRootRef);
|
|
141
141
|
const {
|
|
142
142
|
fieldValue,
|
|
143
143
|
selectedOptions = [],
|
|
@@ -5,10 +5,15 @@ import { useExternRef } from '../../hooks/useExternRef';
|
|
|
5
5
|
import { DOMProps, useDOM } from '../../lib/dom';
|
|
6
6
|
import { useIsomorphicLayoutEffect } from '../../lib/useIsomorphicLayoutEffect';
|
|
7
7
|
import { stopPropagation } from '../../lib/utils';
|
|
8
|
+
import type { HasRootRef } from '../../types';
|
|
8
9
|
import { TrackerOptionsProps, useTrackerVisibility } from './useTrackerVisibility';
|
|
9
10
|
import styles from './CustomScrollView.module.css';
|
|
10
11
|
|
|
11
|
-
export interface CustomScrollViewProps
|
|
12
|
+
export interface CustomScrollViewProps
|
|
13
|
+
extends React.AllHTMLAttributes<HTMLDivElement>,
|
|
14
|
+
DOMProps, // TODO [>=6]: remove
|
|
15
|
+
HasRootRef<HTMLDivElement>,
|
|
16
|
+
TrackerOptionsProps {
|
|
12
17
|
windowResize?: boolean;
|
|
13
18
|
boxRef?: React.Ref<HTMLDivElement>;
|
|
14
19
|
className?: HTMLDivElement['className'];
|
|
@@ -24,6 +29,8 @@ export const CustomScrollView = ({
|
|
|
24
29
|
autoHideScrollbar = false,
|
|
25
30
|
autoHideScrollbarDelay,
|
|
26
31
|
onScroll,
|
|
32
|
+
getRootRef,
|
|
33
|
+
...restProps
|
|
27
34
|
}: CustomScrollViewProps) => {
|
|
28
35
|
const { document, window } = useDOM();
|
|
29
36
|
|
|
@@ -174,7 +181,11 @@ export const CustomScrollView = ({
|
|
|
174
181
|
};
|
|
175
182
|
|
|
176
183
|
return (
|
|
177
|
-
<div
|
|
184
|
+
<div
|
|
185
|
+
className={classNames(styles['CustomScrollView'], className)}
|
|
186
|
+
ref={getRootRef}
|
|
187
|
+
{...restProps}
|
|
188
|
+
>
|
|
178
189
|
<div className={styles['CustomScrollView__box']} tabIndex={-1} ref={boxRef} onScroll={scroll}>
|
|
179
190
|
{children}
|
|
180
191
|
</div>
|
|
@@ -111,6 +111,10 @@ export interface CustomSelectOptionInterface {
|
|
|
111
111
|
[index: string]: any;
|
|
112
112
|
}
|
|
113
113
|
|
|
114
|
+
interface CustomSelectRenderOption extends CustomSelectOptionProps {
|
|
115
|
+
option: CustomSelectOptionInterface;
|
|
116
|
+
}
|
|
117
|
+
|
|
114
118
|
export interface SelectProps extends NativeSelectProps, FormFieldProps, TrackerOptionsProps {
|
|
115
119
|
/**
|
|
116
120
|
* Если `true`, то при клике на селект в нём появится текстовое поле для поиска по `options`. По умолчанию поиск
|
|
@@ -149,7 +153,7 @@ export interface SelectProps extends NativeSelectProps, FormFieldProps, TrackerO
|
|
|
149
153
|
* > Запрещается выставлять `disabled` проп опциям в обход `options`, иначе селект не будет знать об актуальном состоянии
|
|
150
154
|
* опции.
|
|
151
155
|
*/
|
|
152
|
-
renderOption?: (props:
|
|
156
|
+
renderOption?: (props: CustomSelectRenderOption) => React.ReactNode;
|
|
153
157
|
/**
|
|
154
158
|
* Рендер-проп для кастомного рендера содержимого дропдауна.
|
|
155
159
|
* В `defaultDropdownContent` содержится список опций в виде скроллящегося блока.
|
|
@@ -5,7 +5,6 @@
|
|
|
5
5
|
position: relative;
|
|
6
6
|
box-sizing: border-box;
|
|
7
7
|
padding: 8px 12px;
|
|
8
|
-
white-space: nowrap;
|
|
9
8
|
user-select: none;
|
|
10
9
|
cursor: pointer;
|
|
11
10
|
color: var(--vkui--color_text_primary);
|
|
@@ -52,8 +51,6 @@
|
|
|
52
51
|
|
|
53
52
|
.CustomSelectOption__children {
|
|
54
53
|
min-width: 0;
|
|
55
|
-
overflow: hidden;
|
|
56
|
-
text-overflow: ellipsis;
|
|
57
54
|
}
|
|
58
55
|
|
|
59
56
|
.CustomSelectOption__after {
|
|
@@ -65,8 +62,6 @@
|
|
|
65
62
|
|
|
66
63
|
.CustomSelectOption__description {
|
|
67
64
|
color: var(--vkui--color_text_secondary);
|
|
68
|
-
text-overflow: ellipsis;
|
|
69
|
-
overflow: hidden;
|
|
70
65
|
}
|
|
71
66
|
|
|
72
67
|
.CustomSelectOption__selectedIcon {
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { classNames } from '@vkontakte/vkjs';
|
|
3
|
-
import {
|
|
3
|
+
import { useExternRef } from '../../hooks/useExternRef';
|
|
4
|
+
import { HasComponent, HasRef, HasRootRef } from '../../types';
|
|
4
5
|
import styles from './FormLayout.module.css';
|
|
5
6
|
|
|
6
7
|
const preventDefault = (e: React.FormEvent) => e.preventDefault();
|
|
7
8
|
|
|
8
9
|
export type FormLayoutProps = React.AllHTMLAttributes<HTMLElement> &
|
|
9
10
|
HasRef<HTMLElement> &
|
|
11
|
+
HasRootRef<HTMLElement> &
|
|
10
12
|
HasComponent;
|
|
11
13
|
|
|
12
14
|
/**
|
|
@@ -15,17 +17,20 @@ export type FormLayoutProps = React.AllHTMLAttributes<HTMLElement> &
|
|
|
15
17
|
export const FormLayout = ({
|
|
16
18
|
children,
|
|
17
19
|
Component = 'form',
|
|
18
|
-
getRef,
|
|
20
|
+
getRef, // TOOD [>=6]: remove
|
|
21
|
+
getRootRef,
|
|
19
22
|
onSubmit = preventDefault,
|
|
20
23
|
className,
|
|
21
24
|
...restProps
|
|
22
25
|
}: FormLayoutProps) => {
|
|
26
|
+
const formLayoutRef = useExternRef(getRef, getRootRef);
|
|
27
|
+
|
|
23
28
|
return (
|
|
24
29
|
<Component
|
|
25
30
|
{...restProps}
|
|
26
31
|
className={classNames(styles['FormLayout'], className)}
|
|
27
32
|
onSubmit={onSubmit}
|
|
28
|
-
ref={
|
|
33
|
+
ref={formLayoutRef}
|
|
29
34
|
>
|
|
30
35
|
{children}
|
|
31
36
|
{Component === 'form' && (
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { clamp } from '../../helpers/math';
|
|
3
3
|
import { useIsClient } from '../../hooks/useIsClient';
|
|
4
|
-
import { useTimeout } from '../../hooks/useTimeout';
|
|
5
4
|
import { BaseGallery } from '../BaseGallery/BaseGallery';
|
|
6
5
|
import { CarouselBase } from '../BaseGallery/CarouselBase/CarouselBase';
|
|
7
6
|
import { BaseGalleryProps } from '../BaseGallery/types';
|
|
7
|
+
import { useAutoPlay } from './hooks';
|
|
8
8
|
|
|
9
9
|
export interface GalleryProps extends BaseGalleryProps {
|
|
10
10
|
initialSlideIndex?: number;
|
|
@@ -47,11 +47,7 @@ export const Gallery = ({
|
|
|
47
47
|
[isControlled, onChange, slideIndex],
|
|
48
48
|
);
|
|
49
49
|
|
|
50
|
-
|
|
51
|
-
React.useEffect(
|
|
52
|
-
() => (timeout ? autoplay.set() : autoplay.clear()),
|
|
53
|
-
[timeout, slideIndex, autoplay],
|
|
54
|
-
);
|
|
50
|
+
useAutoPlay(timeout, slideIndex, () => handleChange((slideIndex + 1) % childCount));
|
|
55
51
|
|
|
56
52
|
// prevent invalid slideIndex
|
|
57
53
|
// any slide index is invalid with no slides, just keep it as is
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { useTimeout } from '../../hooks/useTimeout';
|
|
3
|
+
import { useDOM } from '../../lib/dom';
|
|
4
|
+
|
|
5
|
+
export function useAutoPlay(timeout: number, slideIndex: number, callbackFn: VoidFunction) {
|
|
6
|
+
const { clear: clearAutoPlay, set: setAutoPlay } = useTimeout(callbackFn, timeout);
|
|
7
|
+
const { document } = useDOM();
|
|
8
|
+
|
|
9
|
+
React.useEffect(
|
|
10
|
+
() => (timeout ? setAutoPlay() : clearAutoPlay()),
|
|
11
|
+
[timeout, slideIndex, clearAutoPlay, setAutoPlay],
|
|
12
|
+
);
|
|
13
|
+
|
|
14
|
+
// Отключаем прокрутку слайдов при неактивной вкладке
|
|
15
|
+
React.useEffect(
|
|
16
|
+
function preventSlideChange() {
|
|
17
|
+
if (!document || !timeout) {
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
const changeAutoPlay = () => {
|
|
22
|
+
if (document.visibilityState === 'visible') {
|
|
23
|
+
clearAutoPlay();
|
|
24
|
+
setAutoPlay();
|
|
25
|
+
}
|
|
26
|
+
if (document.visibilityState === 'hidden') {
|
|
27
|
+
clearAutoPlay();
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
document.addEventListener('visibilitychange', changeAutoPlay);
|
|
32
|
+
|
|
33
|
+
return () => {
|
|
34
|
+
document.removeEventListener('visibilitychange', changeAutoPlay);
|
|
35
|
+
};
|
|
36
|
+
},
|
|
37
|
+
[document, timeout, clearAutoPlay, setAutoPlay],
|
|
38
|
+
);
|
|
39
|
+
}
|
|
@@ -11,7 +11,7 @@ import { Subhead } from '../Typography/Subhead/Subhead';
|
|
|
11
11
|
import { Title } from '../Typography/Title/Title';
|
|
12
12
|
import styles from './Header.module.css';
|
|
13
13
|
|
|
14
|
-
export interface HeaderProps extends HTMLAttributesWithRootRef<HTMLElement
|
|
14
|
+
export interface HeaderProps extends HTMLAttributesWithRootRef<HTMLElement>, HasComponent {
|
|
15
15
|
mode?: 'primary' | 'secondary' | 'tertiary';
|
|
16
16
|
size?: 'regular' | 'large';
|
|
17
17
|
subtitle?: React.ReactNode;
|
|
@@ -75,6 +75,7 @@ const stylesMode = {
|
|
|
75
75
|
export const Header = ({
|
|
76
76
|
mode = 'primary',
|
|
77
77
|
size = 'regular',
|
|
78
|
+
Component = 'h2',
|
|
78
79
|
children,
|
|
79
80
|
subtitle,
|
|
80
81
|
indicator,
|
|
@@ -84,7 +85,6 @@ export const Header = ({
|
|
|
84
85
|
}: HeaderProps) => {
|
|
85
86
|
return (
|
|
86
87
|
<RootComponent
|
|
87
|
-
Component="header"
|
|
88
88
|
{...restProps}
|
|
89
89
|
baseClassName={classNames(
|
|
90
90
|
styles['Header'],
|
|
@@ -97,7 +97,7 @@ export const Header = ({
|
|
|
97
97
|
<div className={styles['Header__main']}>
|
|
98
98
|
<HeaderContent
|
|
99
99
|
className={styles['Header__content']}
|
|
100
|
-
Component=
|
|
100
|
+
Component={Component}
|
|
101
101
|
mode={mode}
|
|
102
102
|
size={size}
|
|
103
103
|
>
|
|
@@ -288,9 +288,11 @@ export const HorizontalScroll = ({
|
|
|
288
288
|
>
|
|
289
289
|
{showArrows && (hasPointer || hasPointer === undefined) && canScrollLeft && (
|
|
290
290
|
<ScrollArrow
|
|
291
|
+
data-testid={process.env.NODE_ENV === 'test' ? 'ScrollArrow' : undefined}
|
|
291
292
|
size={arrowSize}
|
|
292
293
|
offsetY={arrowOffsetY}
|
|
293
294
|
direction="left"
|
|
295
|
+
aria-hidden
|
|
294
296
|
className={classNames(
|
|
295
297
|
styles['HorizontalScroll__arrow'],
|
|
296
298
|
styles['HorizontalScroll__arrowLeft'],
|
|
@@ -300,9 +302,11 @@ export const HorizontalScroll = ({
|
|
|
300
302
|
)}
|
|
301
303
|
{showArrows && (hasPointer || hasPointer === undefined) && canScrollRight && (
|
|
302
304
|
<ScrollArrow
|
|
305
|
+
data-testid={process.env.NODE_ENV === 'test' ? 'ScrollArrow' : undefined}
|
|
303
306
|
size={arrowSize}
|
|
304
307
|
offsetY={arrowOffsetY}
|
|
305
308
|
direction="right"
|
|
309
|
+
aria-hidden
|
|
306
310
|
className={classNames(
|
|
307
311
|
styles['HorizontalScroll__arrow'],
|
|
308
312
|
styles['HorizontalScroll__arrowRight'],
|
|
@@ -116,10 +116,7 @@
|
|
|
116
116
|
}
|
|
117
117
|
|
|
118
118
|
.ModalPage--desktop .ModalPage__content-in,
|
|
119
|
-
:global(.vkuiInternalModalRoot__modal--expandable)
|
|
120
|
-
:global(.vkuiInternalModalRoot__modal--collapsed)
|
|
121
|
-
)
|
|
122
|
-
.ModalPage__content-in {
|
|
119
|
+
:global(.vkuiInternalModalRoot__modal--expandable) .ModalPage__content-in {
|
|
123
120
|
height: 100%;
|
|
124
121
|
}
|
|
125
122
|
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { classNames } from '@vkontakte/vkjs';
|
|
3
3
|
import { useAdaptivityWithJSMediaQueries } from '../../hooks/useAdaptivityWithJSMediaQueries';
|
|
4
|
+
import { useExternRef } from '../../hooks/useExternRef';
|
|
4
5
|
import { usePlatform } from '../../hooks/usePlatform';
|
|
5
6
|
import { Platform } from '../../lib/platform';
|
|
6
|
-
import { HasRef } from '../../types';
|
|
7
|
+
import { HasRef, HasRootRef } from '../../types';
|
|
7
8
|
import { ModalPageContext } from '../ModalPage/ModalPageContext';
|
|
8
9
|
import { PanelHeader, PanelHeaderProps } from '../PanelHeader/PanelHeader';
|
|
9
10
|
import { Separator } from '../Separator/Separator';
|
|
@@ -12,7 +13,8 @@ import styles from './ModalPageHeader.module.css';
|
|
|
12
13
|
export interface ModalPageHeaderProps
|
|
13
14
|
extends React.HTMLAttributes<HTMLDivElement>,
|
|
14
15
|
Omit<PanelHeaderProps, 'fixed' | 'shadow'>,
|
|
15
|
-
HasRef<HTMLDivElement
|
|
16
|
+
HasRef<HTMLDivElement>,
|
|
17
|
+
HasRootRef<HTMLDivElement> {}
|
|
16
18
|
|
|
17
19
|
/**
|
|
18
20
|
* @see https://vkcom.github.io/VKUI/#/ModalPageHeader
|
|
@@ -20,7 +22,8 @@ export interface ModalPageHeaderProps
|
|
|
20
22
|
export const ModalPageHeader = ({
|
|
21
23
|
children,
|
|
22
24
|
separator = true,
|
|
23
|
-
getRef,
|
|
25
|
+
getRef, // TODO [>=6]: remove
|
|
26
|
+
getRootRef,
|
|
24
27
|
className,
|
|
25
28
|
typographyProps,
|
|
26
29
|
...restProps
|
|
@@ -29,6 +32,7 @@ export const ModalPageHeader = ({
|
|
|
29
32
|
const hasSeparator = separator && platform === Platform.VKCOM;
|
|
30
33
|
const { isDesktop } = useAdaptivityWithJSMediaQueries();
|
|
31
34
|
const { labelId } = React.useContext(ModalPageContext);
|
|
35
|
+
const modalPageHeaderRef = useExternRef(getRef, getRootRef);
|
|
32
36
|
|
|
33
37
|
return (
|
|
34
38
|
<div
|
|
@@ -37,7 +41,7 @@ export const ModalPageHeader = ({
|
|
|
37
41
|
platform !== Platform.VKCOM && styles['ModalPageHeader--withGaps'],
|
|
38
42
|
isDesktop && styles['ModalPageHeader--desktop'],
|
|
39
43
|
)}
|
|
40
|
-
ref={
|
|
44
|
+
ref={modalPageHeaderRef}
|
|
41
45
|
>
|
|
42
46
|
<PanelHeader
|
|
43
47
|
className={classNames('vkuiInternalModalPageHeader__in', className)}
|
|
@@ -402,7 +402,7 @@ class ModalRootTouchComponent extends React.Component<
|
|
|
402
402
|
|
|
403
403
|
modalState.translateY = translateY;
|
|
404
404
|
modalState.translateYCurrent = translateY;
|
|
405
|
-
modalState.collapsed = translateY
|
|
405
|
+
modalState.collapsed = numberInRange(translateY, modalState.collapsedRange);
|
|
406
406
|
modalState.expanded = translateY === 0;
|
|
407
407
|
modalState.hidden = translateY === 100;
|
|
408
408
|
|
|
@@ -661,9 +661,10 @@ function initPageModal(modalState: ModalsStateEntry) {
|
|
|
661
661
|
let translateYFrom;
|
|
662
662
|
let translateY;
|
|
663
663
|
let expandedRange: TranslateRange;
|
|
664
|
-
let collapsedRange: TranslateRange;
|
|
664
|
+
let collapsedRange: TranslateRange | undefined;
|
|
665
665
|
let hiddenRange: TranslateRange;
|
|
666
666
|
|
|
667
|
+
const hasCollapsedState = Boolean(modalState.expandable && modalState.settlingHeight !== 100);
|
|
667
668
|
if (modalState.expandable) {
|
|
668
669
|
translateYFrom = 100 - (modalState.settlingHeight ?? 0);
|
|
669
670
|
|
|
@@ -671,10 +672,10 @@ function initPageModal(modalState: ModalsStateEntry) {
|
|
|
671
672
|
const visiblePart = 100 - translateYFrom;
|
|
672
673
|
|
|
673
674
|
expandedRange = [0, shiftHalf];
|
|
674
|
-
collapsedRange = [shiftHalf, translateYFrom + visiblePart / 4];
|
|
675
|
+
collapsedRange = hasCollapsedState ? [shiftHalf, translateYFrom + visiblePart / 4] : undefined;
|
|
675
676
|
hiddenRange = [translateYFrom + visiblePart / 4, 100];
|
|
676
677
|
|
|
677
|
-
collapsed = translateYFrom > 0;
|
|
678
|
+
collapsed = hasCollapsedState && translateYFrom > 0;
|
|
678
679
|
expanded = translateYFrom <= 0;
|
|
679
680
|
translateY = translateYFrom;
|
|
680
681
|
} else {
|
|
@@ -686,7 +687,7 @@ function initPageModal(modalState: ModalsStateEntry) {
|
|
|
686
687
|
translateY = translateYFrom;
|
|
687
688
|
|
|
688
689
|
expandedRange = [translateY, translateY + 25];
|
|
689
|
-
collapsedRange =
|
|
690
|
+
collapsedRange = undefined;
|
|
690
691
|
hiddenRange = [translateY + 25, translateY + 100];
|
|
691
692
|
}
|
|
692
693
|
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
.PanelHeaderButton--primitive {
|
|
18
18
|
height: 48px;
|
|
19
19
|
line-height: 48px;
|
|
20
|
-
padding: 0
|
|
20
|
+
padding: 0 10px;
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
/*
|
|
@@ -44,6 +44,11 @@
|
|
|
44
44
|
padding: 8px;
|
|
45
45
|
}
|
|
46
46
|
|
|
47
|
+
/* stylelint-disable-next-line @project-tools/stylelint-atomic -- фикс для иконки назад */
|
|
48
|
+
.PanelHeaderBack--ios :global(.vkuiIcon--w-20) {
|
|
49
|
+
padding-left: 4px;
|
|
50
|
+
}
|
|
51
|
+
|
|
47
52
|
/*
|
|
48
53
|
* Android
|
|
49
54
|
*/
|
|
@@ -8,6 +8,7 @@ import { useTimeout } from '../../hooks/useTimeout';
|
|
|
8
8
|
import { DOMProps, useDOM } from '../../lib/dom';
|
|
9
9
|
import { Platform } from '../../lib/platform';
|
|
10
10
|
import { runTapticImpactOccurred } from '../../lib/taptic';
|
|
11
|
+
import { coordY, VKUITouchEvent } from '../../lib/touch';
|
|
11
12
|
import { useIsomorphicLayoutEffect } from '../../lib/useIsomorphicLayoutEffect';
|
|
12
13
|
import { AnyFunction, HasChildren } from '../../types';
|
|
13
14
|
import { ScrollContextInterface, useScroll } from '../AppRoot/ScrollContext';
|
|
@@ -113,15 +114,6 @@ export const PullToRefresh = ({
|
|
|
113
114
|
const [contentShift, setContentShift] = React.useState(0);
|
|
114
115
|
const [spinnerProgress, setSpinnerProgress] = React.useState(0);
|
|
115
116
|
|
|
116
|
-
const onWindowTouchMove = (event: Event) => {
|
|
117
|
-
if (refreshing) {
|
|
118
|
-
event.preventDefault();
|
|
119
|
-
event.stopPropagation();
|
|
120
|
-
}
|
|
121
|
-
};
|
|
122
|
-
|
|
123
|
-
useGlobalEventListener(document, 'touchmove', onWindowTouchMove, TOUCH_MOVE_EVENT_PARAMS);
|
|
124
|
-
|
|
125
117
|
const resetRefreshingState = React.useCallback(() => {
|
|
126
118
|
setWatching(false);
|
|
127
119
|
setCanRefresh(false);
|
|
@@ -199,13 +191,40 @@ export const PullToRefresh = ({
|
|
|
199
191
|
runRefreshing,
|
|
200
192
|
]);
|
|
201
193
|
|
|
194
|
+
const startYRef = React.useRef(0);
|
|
195
|
+
|
|
202
196
|
const onTouchStart = (e: TouchEvent) => {
|
|
203
197
|
if (refreshing) {
|
|
204
198
|
cancelEvent(e);
|
|
205
199
|
}
|
|
206
200
|
setTouchDown(true);
|
|
201
|
+
startYRef.current = e.startY;
|
|
207
202
|
};
|
|
208
203
|
|
|
204
|
+
const shouldPreventTouchMove = (event: VKUITouchEvent) => {
|
|
205
|
+
if (watching || refreshing) {
|
|
206
|
+
return true;
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
/* Нам нужно запретить touchmove у документа как только стало понятно, что
|
|
210
|
+
* начинается pull.
|
|
211
|
+
* состояния watching и refreshing устанавливаются слишком поздно и браузер
|
|
212
|
+
* может успеть начать нативный pull to refresh. */
|
|
213
|
+
const shiftY = coordY(event) - startYRef.current;
|
|
214
|
+
const pageYOffset = scroll?.getScroll().y;
|
|
215
|
+
const isRefreshGestureStarted = pageYOffset === 0 && shiftY > 0 && touchDown;
|
|
216
|
+
return isRefreshGestureStarted;
|
|
217
|
+
};
|
|
218
|
+
|
|
219
|
+
const onWindowTouchMove = (event: VKUITouchEvent) => {
|
|
220
|
+
if (shouldPreventTouchMove(event)) {
|
|
221
|
+
event.preventDefault();
|
|
222
|
+
event.stopPropagation();
|
|
223
|
+
}
|
|
224
|
+
};
|
|
225
|
+
|
|
226
|
+
useGlobalEventListener(document, 'touchmove', onWindowTouchMove, TOUCH_MOVE_EVENT_PARAMS);
|
|
227
|
+
|
|
209
228
|
const onTouchMove = (e: TouchEvent) => {
|
|
210
229
|
const { isY, shiftY } = e;
|
|
211
230
|
const { start, max } = initParams;
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
align-items: center;
|
|
43
43
|
background: var(--vkui--color_background_modal);
|
|
44
44
|
box-shadow: var(--vkui--elevation4);
|
|
45
|
-
border-radius: var(--vkui--
|
|
45
|
+
border-radius: var(--vkui--size_card_border_radius--regular);
|
|
46
46
|
}
|
|
47
47
|
|
|
48
48
|
.Snackbar--mode-dark .Snackbar__body {
|