@vkontakte/vkui 4.15.0 → 4.16.2
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/.cache/.eslintcache +1 -1
- package/.cache/.stylelintcache +1 -1
- package/.cache/.tsbuildinfo +391 -282
- package/.cache/ts/src/components/AppRoot/AppRoot.d.ts +1 -0
- package/.cache/ts/src/components/ChipsSelect/ChipsSelect.d.ts +1 -1
- package/.cache/ts/src/components/CustomSelect/CustomSelect.d.ts +2 -2
- package/.cache/ts/src/components/FixedLayout/FixedLayout.d.ts +4 -9
- package/.cache/ts/src/components/ModalPage/ModalPage.d.ts +1 -2
- package/.cache/ts/src/components/Root/Root.d.ts +5 -27
- package/.cache/ts/src/components/SimpleCheckbox/SimpleCheckbox.d.ts +9 -0
- package/.cache/ts/src/components/Tappable/Tappable.d.ts +12 -9
- package/.cache/ts/src/components/Touch/Touch.d.ts +1 -2
- package/.cache/ts/src/components/UsersStack/masks.d.ts +1 -1
- package/.cache/ts/src/hooks/useEventListener.d.ts +2 -2
- package/.cache/ts/src/hooks/useKeyboard.d.ts +11 -0
- package/.cache/ts/src/index.d.ts +1 -1
- package/.cache/ts/src/lib/select.d.ts +7 -0
- package/.cache/ts/src/lib/touch.d.ts +1 -1
- package/.cache/ts/src/lib/utils.d.ts +2 -3
- package/.cache/ts/src/types.d.ts +2 -6
- package/.cache/ts/src/unstable/index.d.ts +2 -0
- package/babel.cjs.config.js +7 -1
- package/babel.config.js +7 -1
- package/dist/cjs/components/AppRoot/AppRoot.d.ts +1 -0
- package/dist/cjs/components/AppRoot/AppRoot.js +29 -1
- package/dist/cjs/components/AppRoot/AppRoot.js.map +1 -1
- package/dist/cjs/components/Banner/Banner.js +1 -1
- package/dist/cjs/components/Banner/Banner.js.map +1 -1
- package/dist/cjs/components/Cell/Cell.js +3 -3
- package/dist/cjs/components/Cell/Cell.js.map +1 -1
- package/dist/cjs/components/ChipsSelect/ChipsSelect.d.ts +1 -1
- package/dist/cjs/components/ChipsSelect/ChipsSelect.js +5 -6
- package/dist/cjs/components/ChipsSelect/ChipsSelect.js.map +1 -1
- package/dist/cjs/components/ChipsSelect/useChipsSelect.js +2 -2
- package/dist/cjs/components/ChipsSelect/useChipsSelect.js.map +1 -1
- package/dist/cjs/components/CustomSelect/CustomSelect.d.ts +2 -2
- package/dist/cjs/components/CustomSelect/CustomSelect.js +3 -3
- package/dist/cjs/components/CustomSelect/CustomSelect.js.map +1 -1
- package/dist/cjs/components/FixedLayout/FixedLayout.d.ts +4 -9
- package/dist/cjs/components/FixedLayout/FixedLayout.js +91 -179
- package/dist/cjs/components/FixedLayout/FixedLayout.js.map +1 -1
- package/dist/cjs/components/Gallery/Gallery.js +2 -2
- package/dist/cjs/components/Gallery/Gallery.js.map +1 -1
- package/dist/cjs/components/Header/Header.js +1 -1
- package/dist/cjs/components/Header/Header.js.map +1 -1
- package/dist/cjs/components/ModalCardBase/ModalCardBase.js +6 -1
- package/dist/cjs/components/ModalCardBase/ModalCardBase.js.map +1 -1
- package/dist/cjs/components/ModalPage/ModalPage.d.ts +1 -2
- package/dist/cjs/components/ModalPage/ModalPage.js.map +1 -1
- package/dist/cjs/components/ModalRoot/ModalRoot.js +2 -2
- package/dist/cjs/components/ModalRoot/ModalRoot.js.map +1 -1
- package/dist/cjs/components/Panel/Panel.js +2 -2
- package/dist/cjs/components/Panel/Panel.js.map +1 -1
- package/dist/cjs/components/PanelHeaderContent/PanelHeaderContent.js +0 -1
- package/dist/cjs/components/PanelHeaderContent/PanelHeaderContent.js.map +1 -1
- package/dist/cjs/components/PullToRefresh/PullToRefresh.js +2 -2
- package/dist/cjs/components/PullToRefresh/PullToRefresh.js.map +1 -1
- package/dist/cjs/components/RangeSlider/UniversalSlider.js +2 -2
- package/dist/cjs/components/RangeSlider/UniversalSlider.js.map +1 -1
- package/dist/cjs/components/Root/Root.d.ts +5 -27
- package/dist/cjs/components/Root/Root.js +158 -214
- package/dist/cjs/components/Root/Root.js.map +1 -1
- package/dist/cjs/components/Search/Search.js +3 -3
- package/dist/cjs/components/Search/Search.js.map +1 -1
- package/dist/cjs/components/SimpleCell/SimpleCell.js.map +1 -1
- package/dist/cjs/components/SimpleCheckbox/SimpleCheckbox.d.ts +9 -0
- package/dist/cjs/components/SimpleCheckbox/SimpleCheckbox.js +126 -0
- package/dist/cjs/components/SimpleCheckbox/SimpleCheckbox.js.map +1 -0
- package/dist/cjs/components/Snackbar/Snackbar.js +2 -2
- package/dist/cjs/components/Snackbar/Snackbar.js.map +1 -1
- package/dist/cjs/components/Tappable/Tappable.d.ts +12 -9
- package/dist/cjs/components/Tappable/Tappable.js +47 -36
- package/dist/cjs/components/Tappable/Tappable.js.map +1 -1
- package/dist/cjs/components/Touch/Touch.d.ts +1 -2
- package/dist/cjs/components/Touch/Touch.js +172 -283
- package/dist/cjs/components/Touch/Touch.js.map +1 -1
- package/dist/cjs/components/UsersStack/UsersStack.js +9 -18
- package/dist/cjs/components/UsersStack/UsersStack.js.map +1 -1
- package/dist/cjs/components/UsersStack/masks.d.ts +1 -1
- package/dist/cjs/components/UsersStack/masks.js +5 -8
- package/dist/cjs/components/UsersStack/masks.js.map +1 -1
- package/dist/cjs/components/View/View.js +2 -2
- package/dist/cjs/components/View/View.js.map +1 -1
- package/dist/cjs/components/View/ViewInfinite.js +2 -2
- package/dist/cjs/components/View/ViewInfinite.js.map +1 -1
- package/dist/cjs/hooks/useEventListener.d.ts +2 -2
- package/dist/cjs/hooks/useEventListener.js +9 -4
- package/dist/cjs/hooks/useEventListener.js.map +1 -1
- package/dist/cjs/hooks/useGlobalEventListener.js +2 -4
- package/dist/cjs/hooks/useGlobalEventListener.js.map +1 -1
- package/dist/cjs/hooks/useInsets.js +3 -10
- package/dist/cjs/hooks/useInsets.js.map +1 -1
- package/dist/cjs/hooks/useKeyboard.d.ts +11 -0
- package/dist/cjs/hooks/useKeyboard.js +78 -0
- package/dist/cjs/hooks/useKeyboard.js.map +1 -0
- package/dist/cjs/hooks/useKeyboardInputTracker.js +4 -2
- package/dist/cjs/hooks/useKeyboardInputTracker.js.map +1 -1
- package/dist/cjs/index.d.ts +1 -1
- package/dist/cjs/index.js +2 -2
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/lib/select.d.ts +7 -0
- package/dist/cjs/lib/select.js +73 -0
- package/dist/cjs/lib/select.js.map +1 -0
- package/dist/cjs/lib/touch.d.ts +1 -1
- package/dist/cjs/lib/touch.js +6 -2
- package/dist/cjs/lib/touch.js.map +1 -1
- package/dist/cjs/lib/utils.d.ts +2 -3
- package/dist/cjs/lib/utils.js.map +1 -1
- package/dist/cjs/types.d.ts +2 -6
- package/dist/cjs/unstable/index.d.ts +2 -0
- package/dist/cjs/unstable/index.js +8 -0
- package/dist/cjs/unstable/index.js.map +1 -1
- package/dist/components/AppRoot/AppRoot.d.ts +1 -0
- package/dist/components/AppRoot/AppRoot.js +29 -5
- package/dist/components/AppRoot/AppRoot.js.map +1 -1
- package/dist/components/Banner/Banner.js +1 -1
- package/dist/components/Banner/Banner.js.map +1 -1
- package/dist/components/Cell/Cell.js +1 -1
- package/dist/components/Cell/Cell.js.map +1 -1
- package/dist/components/ChipsSelect/ChipsSelect.d.ts +1 -1
- package/dist/components/ChipsSelect/ChipsSelect.js +4 -6
- package/dist/components/ChipsSelect/ChipsSelect.js.map +1 -1
- package/dist/components/ChipsSelect/useChipsSelect.js +2 -2
- package/dist/components/ChipsSelect/useChipsSelect.js.map +1 -1
- package/dist/components/CustomSelect/CustomSelect.d.ts +2 -2
- package/dist/components/CustomSelect/CustomSelect.js +2 -3
- package/dist/components/CustomSelect/CustomSelect.js.map +1 -1
- package/dist/components/FixedLayout/FixedLayout.d.ts +4 -9
- package/dist/components/FixedLayout/FixedLayout.js +84 -175
- package/dist/components/FixedLayout/FixedLayout.js.map +1 -1
- package/dist/components/Gallery/Gallery.js +1 -1
- package/dist/components/Gallery/Gallery.js.map +1 -1
- package/dist/components/Header/Header.js +1 -1
- package/dist/components/Header/Header.js.map +1 -1
- package/dist/components/ModalCardBase/ModalCardBase.js +5 -1
- package/dist/components/ModalCardBase/ModalCardBase.js.map +1 -1
- package/dist/components/ModalPage/ModalPage.d.ts +1 -2
- package/dist/components/ModalPage/ModalPage.js.map +1 -1
- package/dist/components/ModalRoot/ModalRoot.js +1 -1
- package/dist/components/ModalRoot/ModalRoot.js.map +1 -1
- package/dist/components/Panel/Panel.js +1 -1
- package/dist/components/Panel/Panel.js.map +1 -1
- package/dist/components/PanelHeaderContent/PanelHeaderContent.js +0 -1
- package/dist/components/PanelHeaderContent/PanelHeaderContent.js.map +1 -1
- package/dist/components/PullToRefresh/PullToRefresh.js +1 -1
- package/dist/components/PullToRefresh/PullToRefresh.js.map +1 -1
- package/dist/components/RangeSlider/UniversalSlider.js +1 -1
- package/dist/components/RangeSlider/UniversalSlider.js.map +1 -1
- package/dist/components/Root/Root.d.ts +5 -27
- package/dist/components/Root/Root.js +152 -207
- package/dist/components/Root/Root.js.map +1 -1
- package/dist/components/Search/Search.js +1 -1
- package/dist/components/Search/Search.js.map +1 -1
- package/dist/components/SimpleCell/SimpleCell.js.map +1 -1
- package/dist/components/SimpleCheckbox/SimpleCheckbox.d.ts +9 -0
- package/dist/components/SimpleCheckbox/SimpleCheckbox.js +97 -0
- package/dist/components/SimpleCheckbox/SimpleCheckbox.js.map +1 -0
- package/dist/components/Snackbar/Snackbar.js +1 -1
- package/dist/components/Snackbar/Snackbar.js.map +1 -1
- package/dist/components/Tappable/Tappable.d.ts +12 -9
- package/dist/components/Tappable/Tappable.js +45 -37
- package/dist/components/Tappable/Tappable.js.map +1 -1
- package/dist/components/Touch/Touch.d.ts +1 -2
- package/dist/components/Touch/Touch.js +163 -286
- package/dist/components/Touch/Touch.js.map +1 -1
- package/dist/components/UsersStack/UsersStack.js +7 -16
- package/dist/components/UsersStack/UsersStack.js.map +1 -1
- package/dist/components/UsersStack/masks.d.ts +1 -1
- package/dist/components/UsersStack/masks.js +6 -9
- package/dist/components/UsersStack/masks.js.map +1 -1
- package/dist/components/View/View.js +1 -1
- package/dist/components/View/View.js.map +1 -1
- package/dist/components/View/ViewInfinite.js +1 -1
- package/dist/components/View/ViewInfinite.js.map +1 -1
- package/dist/components.css +1 -1
- package/dist/components.css.map +1 -1
- package/dist/cssm/components/ActionSheetItem/ActionSheetItem.css +1 -1
- package/dist/cssm/components/AppRoot/AppRoot.css +1 -0
- package/dist/cssm/components/AppRoot/AppRoot.js +30 -2
- package/dist/cssm/components/AppRoot/AppRoot.js.map +1 -1
- package/dist/cssm/components/Banner/Banner.css +1 -1
- package/dist/cssm/components/Banner/Banner.js +1 -1
- package/dist/cssm/components/Banner/Banner.js.map +1 -1
- package/dist/cssm/components/Cell/Cell.js +1 -1
- package/dist/cssm/components/Cell/Cell.js.map +1 -1
- package/dist/cssm/components/ChipsSelect/ChipsSelect.js +4 -6
- package/dist/cssm/components/ChipsSelect/ChipsSelect.js.map +1 -1
- package/dist/cssm/components/ChipsSelect/useChipsSelect.js +2 -2
- package/dist/cssm/components/ChipsSelect/useChipsSelect.js.map +1 -1
- package/dist/cssm/components/CustomSelect/CustomSelect.js +2 -3
- package/dist/cssm/components/CustomSelect/CustomSelect.js.map +1 -1
- package/dist/cssm/components/FixedLayout/FixedLayout.js +84 -175
- package/dist/cssm/components/FixedLayout/FixedLayout.js.map +1 -1
- package/dist/cssm/components/Gallery/Gallery.js +1 -1
- package/dist/cssm/components/Gallery/Gallery.js.map +1 -1
- package/dist/cssm/components/Header/Header.js +1 -1
- package/dist/cssm/components/Header/Header.js.map +1 -1
- package/dist/cssm/components/ModalCardBase/ModalCardBase.css +1 -1
- package/dist/cssm/components/ModalCardBase/ModalCardBase.js +5 -1
- package/dist/cssm/components/ModalCardBase/ModalCardBase.js.map +1 -1
- package/dist/cssm/components/ModalPage/ModalPage.js.map +1 -1
- package/dist/cssm/components/ModalRoot/ModalRoot.css +1 -1
- package/dist/cssm/components/ModalRoot/ModalRoot.js +1 -1
- package/dist/cssm/components/ModalRoot/ModalRoot.js.map +1 -1
- package/dist/cssm/components/Panel/Panel.js +1 -1
- package/dist/cssm/components/Panel/Panel.js.map +1 -1
- package/dist/cssm/components/PanelHeaderContent/PanelHeaderContent.css +1 -1
- package/dist/cssm/components/PanelHeaderContent/PanelHeaderContent.js +0 -1
- package/dist/cssm/components/PanelHeaderContent/PanelHeaderContent.js.map +1 -1
- package/dist/cssm/components/PullToRefresh/PullToRefresh.js +1 -1
- package/dist/cssm/components/PullToRefresh/PullToRefresh.js.map +1 -1
- package/dist/cssm/components/RangeSlider/UniversalSlider.js +1 -1
- package/dist/cssm/components/RangeSlider/UniversalSlider.js.map +1 -1
- package/dist/cssm/components/Root/Root.js +152 -207
- package/dist/cssm/components/Root/Root.js.map +1 -1
- package/dist/cssm/components/Search/Search.js +1 -1
- package/dist/cssm/components/Search/Search.js.map +1 -1
- package/dist/cssm/components/SimpleCell/SimpleCell.js.map +1 -1
- package/dist/cssm/components/SimpleCheckbox/SimpleCheckbox.css +1 -0
- package/dist/cssm/components/SimpleCheckbox/SimpleCheckbox.js +98 -0
- package/dist/cssm/components/SimpleCheckbox/SimpleCheckbox.js.map +1 -0
- package/dist/cssm/components/Snackbar/Snackbar.js +1 -1
- package/dist/cssm/components/Snackbar/Snackbar.js.map +1 -1
- package/dist/cssm/components/Tappable/Tappable.js +45 -37
- package/dist/cssm/components/Tappable/Tappable.js.map +1 -1
- package/dist/cssm/components/Touch/Touch.js +163 -286
- package/dist/cssm/components/Touch/Touch.js.map +1 -1
- package/dist/cssm/components/UsersStack/UsersStack.css +1 -1
- package/dist/cssm/components/UsersStack/UsersStack.js +7 -16
- package/dist/cssm/components/UsersStack/UsersStack.js.map +1 -1
- package/dist/cssm/components/UsersStack/masks.js +6 -9
- package/dist/cssm/components/UsersStack/masks.js.map +1 -1
- package/dist/cssm/components/View/View.js +1 -1
- package/dist/cssm/components/View/View.js.map +1 -1
- package/dist/cssm/components/View/ViewInfinite.js +1 -1
- package/dist/cssm/components/View/ViewInfinite.js.map +1 -1
- package/dist/cssm/hooks/useEventListener.js +8 -4
- package/dist/cssm/hooks/useEventListener.js.map +1 -1
- package/dist/cssm/hooks/useGlobalEventListener.js +2 -2
- package/dist/cssm/hooks/useGlobalEventListener.js.map +1 -1
- package/dist/cssm/hooks/useInsets.js +2 -10
- package/dist/cssm/hooks/useInsets.js.map +1 -1
- package/dist/cssm/hooks/useKeyboard.js +62 -0
- package/dist/cssm/hooks/useKeyboard.js.map +1 -0
- package/dist/cssm/hooks/useKeyboardInputTracker.js +4 -2
- package/dist/cssm/hooks/useKeyboardInputTracker.js.map +1 -1
- package/dist/cssm/index.js +1 -1
- package/dist/cssm/index.js.map +1 -1
- package/dist/cssm/lib/select.js +62 -0
- package/dist/cssm/lib/select.js.map +1 -0
- package/dist/cssm/lib/touch.js +5 -2
- package/dist/cssm/lib/touch.js.map +1 -1
- package/dist/cssm/lib/utils.js.map +1 -1
- package/dist/cssm/styles/animations.css +1 -1
- package/dist/cssm/styles/common.css +1 -1
- package/dist/cssm/styles/components.css +1 -1
- package/dist/cssm/styles/constants.css +1 -1
- package/dist/cssm/styles/unstable.css +1 -1
- package/dist/cssm/unstable/index.js +1 -0
- package/dist/cssm/unstable/index.js.map +1 -1
- package/dist/hooks/useEventListener.d.ts +2 -2
- package/dist/hooks/useEventListener.js +8 -4
- package/dist/hooks/useEventListener.js.map +1 -1
- package/dist/hooks/useGlobalEventListener.js +2 -2
- package/dist/hooks/useGlobalEventListener.js.map +1 -1
- package/dist/hooks/useInsets.js +2 -10
- package/dist/hooks/useInsets.js.map +1 -1
- package/dist/hooks/useKeyboard.d.ts +11 -0
- package/dist/hooks/useKeyboard.js +62 -0
- package/dist/hooks/useKeyboard.js.map +1 -0
- package/dist/hooks/useKeyboardInputTracker.js +4 -2
- package/dist/hooks/useKeyboardInputTracker.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/lib/select.d.ts +7 -0
- package/dist/lib/select.js +62 -0
- package/dist/lib/select.js.map +1 -0
- package/dist/lib/touch.d.ts +1 -1
- package/dist/lib/touch.js +5 -2
- package/dist/lib/touch.js.map +1 -1
- package/dist/lib/utils.d.ts +2 -3
- package/dist/lib/utils.js.map +1 -1
- package/dist/types.d.ts +2 -6
- package/dist/unstable/index.d.ts +2 -0
- package/dist/unstable/index.js +1 -0
- package/dist/unstable/index.js.map +1 -1
- package/dist/unstable.css +1 -1
- package/dist/unstable.css.map +1 -1
- package/dist/vkui.css +1 -1
- package/dist/vkui.css.map +1 -1
- package/package.json +4 -2
- package/postcss.config.js +1 -1
- package/src/components/ActionSheetItem/ActionSheetItem.css +4 -8
- package/src/components/AppRoot/AppRoot.css +20 -0
- package/src/components/AppRoot/AppRoot.tsx +30 -0
- package/src/components/Banner/Banner.css +4 -0
- package/src/components/Banner/Banner.tsx +1 -1
- package/src/components/Cell/Cell.tsx +1 -1
- package/src/components/ChipsSelect/ChipsSelect.tsx +4 -7
- package/src/components/ChipsSelect/Readme.md +0 -2
- package/src/components/ChipsSelect/useChipsSelect.ts +1 -1
- package/src/components/CustomSelect/CustomSelect.tsx +3 -2
- package/src/components/FixedLayout/FixedLayout.tsx +61 -147
- package/src/components/Gallery/Gallery.tsx +1 -1
- package/src/components/Header/Header.tsx +1 -1
- package/src/components/ModalCardBase/ModalCardBase.css +4 -0
- package/src/components/ModalCardBase/ModalCardBase.tsx +5 -1
- package/src/components/ModalPage/ModalPage.tsx +1 -2
- package/src/components/ModalRoot/ModalRoot.css +10 -0
- package/src/components/ModalRoot/ModalRoot.tsx +1 -1
- package/src/components/Panel/Panel.tsx +1 -1
- package/src/components/PanelHeaderContent/PanelHeaderContent.css +2 -1
- package/src/components/PanelHeaderContent/PanelHeaderContent.tsx +2 -2
- package/src/components/PullToRefresh/PullToRefresh.tsx +1 -1
- package/src/components/RangeSlider/UniversalSlider.tsx +1 -1
- package/src/components/Root/Readme.md +27 -37
- package/src/components/Root/Root.tsx +112 -191
- package/src/components/Search/Search.tsx +1 -1
- package/src/components/Separator/Readme.md +3 -1
- package/src/components/SimpleCell/SimpleCell.tsx +1 -1
- package/src/components/SimpleCheckbox/Readme.md +17 -0
- package/src/components/SimpleCheckbox/SimpleCheckbox.css +115 -0
- package/src/components/SimpleCheckbox/SimpleCheckbox.tsx +105 -0
- package/src/components/Snackbar/Snackbar.tsx +1 -1
- package/src/components/Tappable/Tappable.tsx +28 -37
- package/src/components/Touch/Touch.tsx +100 -238
- package/src/components/UsersStack/UsersStack.css +5 -9
- package/src/components/UsersStack/UsersStack.tsx +4 -11
- package/src/components/UsersStack/masks.tsx +6 -9
- package/src/components/View/Readme.md +34 -42
- package/src/components/View/View.tsx +1 -1
- package/src/components/View/ViewInfinite.tsx +1 -1
- package/src/hooks/useEventListener.ts +11 -8
- package/src/hooks/useGlobalEventListener.ts +2 -2
- package/src/hooks/useInsets.ts +2 -8
- package/src/hooks/useKeyboard.ts +67 -0
- package/src/hooks/useKeyboardInputTracker.ts +4 -2
- package/src/index.ts +1 -1
- package/src/lib/select.ts +53 -0
- package/src/lib/touch.ts +2 -2
- package/src/lib/utils.ts +3 -4
- package/src/styles/animations.css +0 -14
- package/src/styles/common.css +0 -21
- package/src/styles/components.css +2 -0
- package/src/styles/constants.css +3 -0
- package/src/styles/unstable.css +1 -0
- package/src/types.ts +2 -8
- package/src/unstable/index.ts +3 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vkontakte/vkui",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.16.2",
|
|
4
4
|
"main": "dist/cjs/index.js",
|
|
5
5
|
"module": "dist/index.js",
|
|
6
6
|
"typings": "dist/index.d.ts",
|
|
@@ -14,6 +14,8 @@
|
|
|
14
14
|
"./dist/index.js",
|
|
15
15
|
"./dist/cjs/lib/polyfills.js",
|
|
16
16
|
"./dist/cjs/index.js",
|
|
17
|
+
"./dist/cssm/lib/polyfills.js",
|
|
18
|
+
"./dist/cssm/index.js",
|
|
17
19
|
"*.css"
|
|
18
20
|
],
|
|
19
21
|
"devDependencies": {
|
|
@@ -129,7 +131,7 @@
|
|
|
129
131
|
}
|
|
130
132
|
],
|
|
131
133
|
"scripts": {
|
|
132
|
-
"
|
|
134
|
+
"prepublishOnly": "yarn build",
|
|
133
135
|
"size": "yarn clear && concurrently 'yarn:babel' 'yarn:postcss' && size-limit",
|
|
134
136
|
"size:ci": "yarn install --frozen-lockfile --ignore-scripts && yarn build:no-types",
|
|
135
137
|
"styleguide": "cross-env NODE_ENV=development styleguidist server --config=styleguide/config.js",
|
package/postcss.config.js
CHANGED
|
@@ -8,7 +8,7 @@ const csso = require('postcss-csso');
|
|
|
8
8
|
const checkKeyframes = require('./tasks/postcss-check-keyframes');
|
|
9
9
|
const { defaultSchemeId } = require('./package.json');
|
|
10
10
|
|
|
11
|
-
const animationsSource = path.join(__dirname, 'src/styles/animations.css')
|
|
11
|
+
const animationsSource = path.join(__dirname, 'src/styles/animations.css');
|
|
12
12
|
const cssPropSources = [
|
|
13
13
|
path.join(__dirname, 'src/styles/bright_light.css'),
|
|
14
14
|
path.join(__dirname, 'src/styles/constants.css'),
|
|
@@ -106,7 +106,8 @@
|
|
|
106
106
|
border-top-right-radius: 14px;
|
|
107
107
|
}
|
|
108
108
|
|
|
109
|
-
.ActionSheetItem--ios:nth-last-child(2)
|
|
109
|
+
.ActionSheetItem--ios:not(.ActionSheetItem--desktop):nth-last-child(2),
|
|
110
|
+
.ActionSheetItem--ios:last-child {
|
|
110
111
|
border-bottom-left-radius: 14px;
|
|
111
112
|
border-bottom-right-radius: 14px;
|
|
112
113
|
}
|
|
@@ -118,7 +119,7 @@
|
|
|
118
119
|
width: 100%;
|
|
119
120
|
height: 100%;
|
|
120
121
|
background-color: var(--modal_card_background);
|
|
121
|
-
z-index: 1;
|
|
122
|
+
z-index: -1;
|
|
122
123
|
content: '';
|
|
123
124
|
transition: opacity .15s ease-out, background-color .15s ease-out;
|
|
124
125
|
}
|
|
@@ -127,7 +128,7 @@
|
|
|
127
128
|
position: absolute;
|
|
128
129
|
right: 0;
|
|
129
130
|
left: 0;
|
|
130
|
-
z-index: 1;
|
|
131
|
+
z-index: -1;
|
|
131
132
|
height: 1px;
|
|
132
133
|
content: '';
|
|
133
134
|
top: 0;
|
|
@@ -266,11 +267,6 @@
|
|
|
266
267
|
cursor: pointer;
|
|
267
268
|
}
|
|
268
269
|
|
|
269
|
-
.ActionSheetItem--desktop.ActionSheetItem--ios:nth-last-child(2) {
|
|
270
|
-
border-bottom-left-radius: 0;
|
|
271
|
-
border-bottom-right-radius: 0;
|
|
272
|
-
}
|
|
273
|
-
|
|
274
270
|
/**
|
|
275
271
|
* Disabled
|
|
276
272
|
*/
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
.vkui__root--embedded {
|
|
2
|
+
transform: translate3d(0, 0, 0);
|
|
3
|
+
overflow-x: hidden;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
.AppRoot {
|
|
7
|
+
height: 100%;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.vkui__root--embedded .AppRoot {
|
|
11
|
+
overflow: auto;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.vkui--sizeX-regular {
|
|
15
|
+
background: var(--background_page);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.AppRoot--no-mouse {
|
|
19
|
+
user-select: none;
|
|
20
|
+
}
|
|
@@ -10,6 +10,9 @@ import { elementScrollController, globalScrollController, ScrollContext, ScrollC
|
|
|
10
10
|
import { noop } from '../../lib/utils';
|
|
11
11
|
import { warnOnce } from '../../lib/warnOnce';
|
|
12
12
|
import { useKeyboardInputTracker } from '../../hooks/useKeyboardInputTracker';
|
|
13
|
+
import { useInsets } from '../../hooks/useInsets';
|
|
14
|
+
import { Insets } from '@vkontakte/vk-bridge';
|
|
15
|
+
import './AppRoot.css';
|
|
13
16
|
|
|
14
17
|
// Используйте classList, но будьте осторожны
|
|
15
18
|
/* eslint-disable no-restricted-properties */
|
|
@@ -36,6 +39,7 @@ export const AppRoot: React.FC<AppRootProps> = withAdaptivity(({
|
|
|
36
39
|
const rootRef = React.useRef<HTMLDivElement>();
|
|
37
40
|
const [portalRoot, setPortalRoot] = React.useState<HTMLDivElement>(null);
|
|
38
41
|
const { window, document } = useDOM();
|
|
42
|
+
const insets = useInsets();
|
|
39
43
|
|
|
40
44
|
const initialized = React.useRef(false);
|
|
41
45
|
if (!initialized.current) {
|
|
@@ -86,6 +90,32 @@ export const AppRoot: React.FC<AppRootProps> = withAdaptivity(({
|
|
|
86
90
|
};
|
|
87
91
|
}, []);
|
|
88
92
|
|
|
93
|
+
// setup insets
|
|
94
|
+
useIsomorphicLayoutEffect(() => {
|
|
95
|
+
if (mode === 'partial') {
|
|
96
|
+
return noop;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
const parent = rootRef.current.parentElement;
|
|
100
|
+
|
|
101
|
+
for (const key in insets) {
|
|
102
|
+
if (insets.hasOwnProperty(key) && typeof insets[key as keyof Insets] === 'number') {
|
|
103
|
+
const inset = insets[key as keyof Insets];
|
|
104
|
+
parent.style.setProperty(`--safe-area-inset-${key}`, `${inset}px`);
|
|
105
|
+
portalRoot && portalRoot.style.setProperty(`--safe-area-inset-${key}`, `${inset}px`);
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
return () => {
|
|
110
|
+
for (const key in insets) {
|
|
111
|
+
if (insets.hasOwnProperty(key)) {
|
|
112
|
+
parent.style.removeProperty(`--safe-area-inset-${key}`);
|
|
113
|
+
portalRoot && portalRoot.style.removeProperty(`--safe-area-inset-${key}`);
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
};
|
|
117
|
+
}, [insets, portalRoot]);
|
|
118
|
+
|
|
89
119
|
// adaptivity handler
|
|
90
120
|
useIsomorphicLayoutEffect(() => {
|
|
91
121
|
if (mode === 'partial' || sizeX !== SizeType.REGULAR) {
|
|
@@ -127,7 +127,7 @@ const Banner: React.FC<BannerProps> = (props: BannerProps) => {
|
|
|
127
127
|
|
|
128
128
|
<div vkuiClass="Banner__content">
|
|
129
129
|
{hasReactNode(header) && (
|
|
130
|
-
<BannerHeader size={size} Component="
|
|
130
|
+
<BannerHeader size={size} Component="span" vkuiClass="Banner__header">{header}</BannerHeader>
|
|
131
131
|
)}
|
|
132
132
|
{hasReactNode(subheader) && (
|
|
133
133
|
<BannerSubheader Component="span" size={size} vkuiClass="Banner__subheader">{subheader}</BannerSubheader>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { classNames } from '../../lib/classNames';
|
|
3
3
|
import { getClassName } from '../../helpers/getClassName';
|
|
4
|
-
import Touch,
|
|
4
|
+
import { Touch, TouchEvent } from '../Touch/Touch';
|
|
5
5
|
import { ANDROID, IOS, VKCOM } from '../../lib/platform';
|
|
6
6
|
import { Icon24Reorder, Icon24ReorderIos, Icon24CheckCircleOn, Icon24CheckCircleOff, Icon24CheckBoxOff, Icon24CheckBoxOn } from '@vkontakte/icons';
|
|
7
7
|
import SimpleCell, { SimpleCellProps } from '../SimpleCell/SimpleCell';
|
|
@@ -13,12 +13,13 @@ import Caption from '../Typography/Caption/Caption';
|
|
|
13
13
|
import { prefixClass } from '../../lib/prefixClass';
|
|
14
14
|
import { useExternRef } from '../../hooks/useExternRef';
|
|
15
15
|
import { useGlobalEventListener } from '../../hooks/useGlobalEventListener';
|
|
16
|
+
import { defaultFilterFn } from '../../lib/select';
|
|
16
17
|
import './ChipsSelect.css';
|
|
17
18
|
|
|
18
19
|
export interface ChipsSelectProps<Option extends ChipsInputOption> extends ChipsInputProps<Option>, AdaptivityProps {
|
|
19
20
|
popupDirection?: 'top' | 'bottom';
|
|
20
21
|
options?: Option[];
|
|
21
|
-
filterFn?: (value?: string, option?: Option, getOptionLabel?: Pick<ChipsInputProps<ChipsInputOption>, 'getOptionLabel'>['getOptionLabel']) => boolean;
|
|
22
|
+
filterFn?: false | ((value?: string, option?: Option, getOptionLabel?: Pick<ChipsInputProps<ChipsInputOption>, 'getOptionLabel'>['getOptionLabel']) => boolean);
|
|
22
23
|
/**
|
|
23
24
|
* Возможность создавать чипы которых нет в списке (по enter или с помощью пункта в меню, см creatableText)
|
|
24
25
|
*/
|
|
@@ -60,7 +61,7 @@ const ChipsSelect = <Option extends ChipsInputOption>(props: ChipsSelectProps<Op
|
|
|
60
61
|
style, onFocus, onKeyDown, className, fetching, renderOption, emptyText,
|
|
61
62
|
getRef, getRootRef, disabled, placeholder, tabIndex, getOptionValue, getOptionLabel, showSelected,
|
|
62
63
|
getNewOptionData, renderChip, popupDirection, creatable, filterFn, inputValue, creatableText, sizeY,
|
|
63
|
-
closeAfterSelect, onChangeStart, after, ...restProps
|
|
64
|
+
closeAfterSelect, onChangeStart, after, options, ...restProps
|
|
64
65
|
} = props;
|
|
65
66
|
|
|
66
67
|
const { document } = useDOM();
|
|
@@ -324,11 +325,7 @@ const chipsSelectDefaultProps: ChipsSelectProps<any> = {
|
|
|
324
325
|
showSelected: true,
|
|
325
326
|
closeAfterSelect: true,
|
|
326
327
|
options: [],
|
|
327
|
-
filterFn:
|
|
328
|
-
return (
|
|
329
|
-
!value || value && getOptionLabel(option)?.toLowerCase()?.startsWith(value?.toLowerCase())
|
|
330
|
-
);
|
|
331
|
-
},
|
|
328
|
+
filterFn: defaultFilterFn,
|
|
332
329
|
renderOption({ option, ...restProps }: CustomSelectOptionProps): React.ReactNode {
|
|
333
330
|
return (
|
|
334
331
|
<CustomSelectOption {...restProps} />
|
|
@@ -29,7 +29,6 @@ const Example = () => {
|
|
|
29
29
|
value: selectedColors,
|
|
30
30
|
onChange: setSelectedColors,
|
|
31
31
|
options: colors,
|
|
32
|
-
top:"Выберите или добавьте цвета",
|
|
33
32
|
placeholder:"Не выбраны",
|
|
34
33
|
creatable: true,
|
|
35
34
|
};
|
|
@@ -38,7 +37,6 @@ const Example = () => {
|
|
|
38
37
|
value: selectedColorsCopy,
|
|
39
38
|
onChange: setSelectedColorsCopy,
|
|
40
39
|
options: colors,
|
|
41
|
-
top:"Выберите или добавьте цвета",
|
|
42
40
|
placeholder:"Не выбраны",
|
|
43
41
|
creatable: true,
|
|
44
42
|
creatableText: '',
|
|
@@ -22,7 +22,7 @@ export const useChipsSelect = <Option extends ChipsInputOption>(props: Partial<C
|
|
|
22
22
|
};
|
|
23
23
|
|
|
24
24
|
let filteredOptions = React.useMemo(() => {
|
|
25
|
-
return options.filter((option: Option) => filterFn(fieldValue, option, getOptionLabel));
|
|
25
|
+
return filterFn ? options.filter((option: Option) => filterFn(fieldValue, option, getOptionLabel)) : options;
|
|
26
26
|
}, [options, filterFn, fieldValue, getOptionLabel]);
|
|
27
27
|
|
|
28
28
|
filteredOptions = React.useMemo(() => {
|
|
@@ -15,6 +15,7 @@ import { Icon20Dropdown, Icon24Dropdown } from '@vkontakte/icons';
|
|
|
15
15
|
import Caption from '../Typography/Caption/Caption';
|
|
16
16
|
import { warnOnce } from '../../lib/warnOnce';
|
|
17
17
|
import Spinner from '../Spinner/Spinner';
|
|
18
|
+
import { defaultFilterFn } from '../../lib/select';
|
|
18
19
|
import './CustomSelect.css';
|
|
19
20
|
|
|
20
21
|
const findIndexAfter = (options: CustomSelectOptionInterface[], startIndex = -1) => {
|
|
@@ -77,7 +78,7 @@ export interface CustomSelectProps extends NativeSelectProps, HasPlatform, FormF
|
|
|
77
78
|
/**
|
|
78
79
|
* Функция для кастомной фильтрации. По-умолчанию поиск производится по option.label.
|
|
79
80
|
*/
|
|
80
|
-
filterFn?: false | ((value: string, option: CustomSelectOptionInterface) => boolean);
|
|
81
|
+
filterFn?: false | ((value: string, option: CustomSelectOptionInterface, getOptionLabel?: (option: Partial<CustomSelectOptionInterface>) => string) => boolean);
|
|
81
82
|
popupDirection?: 'top' | 'bottom';
|
|
82
83
|
/**
|
|
83
84
|
* Рендер-проп для кастомного рендера опции.
|
|
@@ -112,7 +113,7 @@ class CustomSelect extends React.Component<CustomSelectProps, CustomSelectState>
|
|
|
112
113
|
},
|
|
113
114
|
options: [],
|
|
114
115
|
emptyText: 'Ничего не найдено',
|
|
115
|
-
filterFn:
|
|
116
|
+
filterFn: defaultFilterFn,
|
|
116
117
|
};
|
|
117
118
|
|
|
118
119
|
public constructor(props: CustomSelectProps) {
|
|
@@ -2,34 +2,28 @@ import * as React from 'react';
|
|
|
2
2
|
import { getClassName } from '../../helpers/getClassName';
|
|
3
3
|
import { classNames } from '../../lib/classNames';
|
|
4
4
|
import { transitionEndEventName, TransitionStartEventDetail, transitionStartEventName } from '../View/View';
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { withPlatform } from '../../hoc/withPlatform';
|
|
8
|
-
import { withPanelContext } from '../Panel/withPanelContext';
|
|
9
|
-
import { setRef } from '../../lib/utils';
|
|
10
|
-
import { SplitColContext, SplitColContextProps } from '../SplitCol/SplitCol';
|
|
5
|
+
import { HasRef, HasRootRef } from '../../types';
|
|
6
|
+
import { SplitColContext } from '../SplitCol/SplitCol';
|
|
11
7
|
import { TooltipContainer } from '../Tooltip/TooltipContainer';
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
8
|
+
import { PanelContext } from '../Panel/PanelContext';
|
|
9
|
+
import { useDOM } from '../../lib/dom';
|
|
14
10
|
import { IOS } from '../../lib/platform';
|
|
15
11
|
import { warnOnce } from '../../lib/warnOnce';
|
|
12
|
+
import { useGlobalEventListener } from '../../hooks/useGlobalEventListener';
|
|
13
|
+
import { useExternRef } from '../../hooks/useExternRef';
|
|
14
|
+
import { usePlatform } from '../../hooks/usePlatform';
|
|
16
15
|
import './FixedLayout.css';
|
|
17
16
|
|
|
18
17
|
export interface FixedLayoutProps extends
|
|
19
18
|
React.HTMLAttributes<HTMLDivElement>,
|
|
20
19
|
HasRootRef<HTMLDivElement>,
|
|
21
|
-
HasRef<HTMLDivElement
|
|
22
|
-
HasPlatform {
|
|
20
|
+
HasRef<HTMLDivElement> {
|
|
23
21
|
vertical?: 'top' | 'bottom';
|
|
24
22
|
/**
|
|
25
23
|
* Это свойство определяет, будет ли фон компонента окрашен в цвет фона контента.
|
|
26
24
|
* Это часто необходимо для фиксированных кнопок в нижней части экрана.
|
|
27
25
|
*/
|
|
28
26
|
filled?: boolean;
|
|
29
|
-
/**
|
|
30
|
-
* @ignore
|
|
31
|
-
*/
|
|
32
|
-
splitCol?: SplitColContextProps;
|
|
33
27
|
}
|
|
34
28
|
|
|
35
29
|
export interface FixedLayoutState {
|
|
@@ -41,62 +35,23 @@ export interface FixedLayoutState {
|
|
|
41
35
|
|
|
42
36
|
const warn = warnOnce('FixedLayout');
|
|
43
37
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
};
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
return this.props.window;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
get currentPanel(): HTMLElement {
|
|
65
|
-
const elem = this.props.getPanelNode();
|
|
66
|
-
|
|
67
|
-
if (process.env.NODE_ENV === 'development' && !elem) {
|
|
68
|
-
warn('Panel element not found');
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
return elem;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
get canTargetPanelScroll() {
|
|
75
|
-
const panelEl = this.currentPanel;
|
|
76
|
-
if (!panelEl) {
|
|
77
|
-
return true; // Всегда предпологаем, что может быть скролл в случае, если нет document
|
|
78
|
-
}
|
|
79
|
-
return panelEl.scrollHeight > panelEl.clientHeight;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
componentDidMount() {
|
|
83
|
-
this.onMountResizeTimeout = setTimeout(() => this.doResize());
|
|
84
|
-
this.window.addEventListener('resize', this.doResize);
|
|
85
|
-
|
|
86
|
-
this.document.addEventListener(transitionStartEventName, this.onViewTransitionStart);
|
|
87
|
-
this.document.addEventListener(transitionEndEventName, this.onViewTransitionEnd);
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
componentWillUnmount() {
|
|
91
|
-
clearTimeout(this.onMountResizeTimeout);
|
|
92
|
-
this.window.removeEventListener('resize', this.doResize);
|
|
93
|
-
|
|
94
|
-
this.document.removeEventListener(transitionStartEventName, this.onViewTransitionStart);
|
|
95
|
-
this.document.removeEventListener(transitionEndEventName, this.onViewTransitionEnd);
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
onViewTransitionStart: EventListener = (e: CustomEvent<TransitionStartEventDetail>) => {
|
|
99
|
-
let panelScroll = e.detail.scrolls[this.props.panel] || 0;
|
|
38
|
+
const FixedLayout: React.FC<FixedLayoutProps> = ({
|
|
39
|
+
children, style, vertical, getRootRef, getRef, filled,
|
|
40
|
+
...restProps
|
|
41
|
+
}) => {
|
|
42
|
+
const platform = usePlatform();
|
|
43
|
+
const { colRef } = React.useContext(SplitColContext);
|
|
44
|
+
const { window, document } = useDOM();
|
|
45
|
+
const { panel, getPanelNode } = React.useContext(PanelContext);
|
|
46
|
+
const [transitionOverrideStyle, setTransitionOverrideStyle] = React.useState<React.CSSProperties>({});
|
|
47
|
+
const [width, setWidth] = React.useState<string>(null);
|
|
48
|
+
const elRef = useExternRef(getRootRef);
|
|
49
|
+
|
|
50
|
+
const doResize = () => setWidth(colRef?.current ? `${colRef.current.offsetWidth}px` : null);
|
|
51
|
+
React.useEffect(doResize, []);
|
|
52
|
+
useGlobalEventListener(window, 'resize', doResize);
|
|
53
|
+
useGlobalEventListener(document, transitionStartEventName, (e: CustomEvent<TransitionStartEventDetail>) => {
|
|
54
|
+
let panelScroll = e.detail.scrolls[panel] || 0;
|
|
100
55
|
|
|
101
56
|
// support for unstable ViewInfinite
|
|
102
57
|
if (Array.isArray(panelScroll)) {
|
|
@@ -104,89 +59,48 @@ class FixedLayout extends React.Component<FixedLayoutProps & DOMProps & PanelCon
|
|
|
104
59
|
panelScroll = scrolls[scrolls.length - 1];
|
|
105
60
|
}
|
|
106
61
|
|
|
107
|
-
const fromPanelHasScroll =
|
|
108
|
-
const toPanelHasScroll =
|
|
62
|
+
const fromPanelHasScroll = panel === e.detail.from && panelScroll > 0;
|
|
63
|
+
const toPanelHasScroll = panel === e.detail.to && panelScroll > 0;
|
|
109
64
|
|
|
110
65
|
// если переход назад на Android - анимация только у панели с которой уходим (detail.from), и подстраиваться под скролл надо только на ней
|
|
111
66
|
// на iOS переход между панелями горизонтальный, поэтому там нужно подстраивать хедеры на обеих панелях
|
|
112
|
-
const panelAnimated =
|
|
67
|
+
const panelAnimated = platform === IOS || !(panel === e.detail.to && e.detail.isBack);
|
|
68
|
+
|
|
69
|
+
const currentPanel = getPanelNode();
|
|
70
|
+
if (process.env.NODE_ENV === 'development' && !currentPanel) {
|
|
71
|
+
warn('Panel element not found');
|
|
72
|
+
}
|
|
73
|
+
// Всегда предпологаем, что может быть скролл в случае, если нет document
|
|
74
|
+
const canTargetPanelScroll = !currentPanel || currentPanel.scrollHeight > currentPanel.clientHeight;
|
|
113
75
|
|
|
114
76
|
// Для панелей, с которых уходим всегда выставляется скролл
|
|
115
77
|
// Для панелей на которые приходим надо смотреть, есть ли браузерный скролл и применяется ли к ней анимация перехода:
|
|
116
|
-
if (fromPanelHasScroll || toPanelHasScroll &&
|
|
117
|
-
|
|
78
|
+
if (fromPanelHasScroll || toPanelHasScroll && canTargetPanelScroll && panelAnimated) {
|
|
79
|
+
setTransitionOverrideStyle({
|
|
118
80
|
position: 'absolute',
|
|
119
|
-
top:
|
|
120
|
-
bottom:
|
|
121
|
-
width: '',
|
|
81
|
+
top: vertical === 'top' || fromPanelHasScroll ? elRef.current.offsetTop + panelScroll : null,
|
|
82
|
+
bottom: vertical === 'bottom' && !fromPanelHasScroll ? -panelScroll : null,
|
|
122
83
|
});
|
|
123
84
|
}
|
|
124
|
-
};
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
}
|
|
147
|
-
};
|
|
148
|
-
|
|
149
|
-
getRef: React.RefCallback<HTMLDivElement> = (element) => {
|
|
150
|
-
this.el = element;
|
|
151
|
-
setRef(element, this.props.getRootRef);
|
|
152
|
-
};
|
|
153
|
-
|
|
154
|
-
render() {
|
|
155
|
-
const {
|
|
156
|
-
children,
|
|
157
|
-
style,
|
|
158
|
-
vertical,
|
|
159
|
-
getRootRef,
|
|
160
|
-
getRef,
|
|
161
|
-
platform,
|
|
162
|
-
filled,
|
|
163
|
-
splitCol,
|
|
164
|
-
panel,
|
|
165
|
-
getPanelNode,
|
|
166
|
-
window,
|
|
167
|
-
document,
|
|
168
|
-
...restProps
|
|
169
|
-
} = this.props;
|
|
170
|
-
|
|
171
|
-
return (
|
|
172
|
-
<TooltipContainer
|
|
173
|
-
{...restProps}
|
|
174
|
-
fixed
|
|
175
|
-
ref={this.getRef}
|
|
176
|
-
vkuiClass={classNames(getClassName('FixedLayout', platform), {
|
|
177
|
-
'FixedLayout--filled': filled,
|
|
178
|
-
[`FixedLayout--${vertical}`]: !!vertical,
|
|
179
|
-
})}
|
|
180
|
-
style={{ ...style, ...this.state }}
|
|
181
|
-
>
|
|
182
|
-
<div vkuiClass="FixedLayout__in" ref={getRef}>{children}</div>
|
|
183
|
-
</TooltipContainer>
|
|
184
|
-
);
|
|
185
|
-
}
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
export default withContext(
|
|
189
|
-
withPlatform(withPanelContext(withDOM<FixedLayoutProps>(FixedLayout))),
|
|
190
|
-
SplitColContext,
|
|
191
|
-
'splitCol',
|
|
192
|
-
);
|
|
85
|
+
});
|
|
86
|
+
useGlobalEventListener(document, transitionEndEventName, () => {
|
|
87
|
+
setTransitionOverrideStyle({});
|
|
88
|
+
doResize();
|
|
89
|
+
});
|
|
90
|
+
|
|
91
|
+
return (
|
|
92
|
+
<TooltipContainer
|
|
93
|
+
{...restProps}
|
|
94
|
+
fixed
|
|
95
|
+
ref={elRef}
|
|
96
|
+
vkuiClass={classNames(getClassName('FixedLayout', platform), {
|
|
97
|
+
'FixedLayout--filled': filled,
|
|
98
|
+
}, `FixedLayout--${vertical}`)}
|
|
99
|
+
style={{ ...style, ...transitionOverrideStyle, width }}
|
|
100
|
+
>
|
|
101
|
+
<div vkuiClass="FixedLayout__in" ref={getRef}>{children}</div>
|
|
102
|
+
</TooltipContainer>
|
|
103
|
+
);
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
export default FixedLayout;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { getClassName } from '../../helpers/getClassName';
|
|
3
|
-
import Touch,
|
|
3
|
+
import { Touch, TouchEventHandler, TouchEvent } from '../Touch/Touch';
|
|
4
4
|
import { classNames } from '../../lib/classNames';
|
|
5
5
|
import { withPlatform } from '../../hoc/withPlatform';
|
|
6
6
|
import { HasAlign, HasPlatform, HasRef, HasRootRef } from '../../types';
|
|
@@ -93,7 +93,7 @@ const Header: React.FC<HeaderProps> = ({
|
|
|
93
93
|
vkuiClass={classNames(getClassName('Header', platform), `Header--mode-${mode}`, { 'Header--pi': isPrimitiveReactNode(indicator) })}
|
|
94
94
|
>
|
|
95
95
|
<div vkuiClass="Header__main">
|
|
96
|
-
<HeaderContent vkuiClass="Header__content" Component="
|
|
96
|
+
<HeaderContent vkuiClass="Header__content" Component="span" mode={mode} platform={platform}>
|
|
97
97
|
<span vkuiClass={classNames('Header__content-in', { 'Header__content-in--multiline': multiline })}>{children}</span>
|
|
98
98
|
{hasReactNode(indicator) && (
|
|
99
99
|
<Caption
|
|
@@ -11,6 +11,7 @@ import { PanelHeaderButton } from '../PanelHeaderButton/PanelHeaderButton';
|
|
|
11
11
|
import { IOS } from '../../lib/platform';
|
|
12
12
|
import ModalDismissButton from '../ModalDismissButton/ModalDismissButton';
|
|
13
13
|
import { Icon24Dismiss } from '@vkontakte/icons';
|
|
14
|
+
import { useKeyboard } from '../../hooks/useKeyboard';
|
|
14
15
|
import './ModalCardBase.css';
|
|
15
16
|
|
|
16
17
|
export interface ModalCardBaseProps extends React.HTMLAttributes<HTMLDivElement>, HasRootRef<HTMLDivElement> {
|
|
@@ -61,6 +62,7 @@ export const ModalCardBase: React.FC<ModalCardBaseProps> = withAdaptivity(({
|
|
|
61
62
|
}: ModalCardBaseProps & AdaptivityProps) => {
|
|
62
63
|
const platform = usePlatform();
|
|
63
64
|
const isDesktop = viewWidth >= ViewWidth.SMALL_TABLET && (hasMouse || viewHeight >= ViewHeight.MEDIUM);
|
|
65
|
+
const isSoftwareKeyboardOpened = useKeyboard().isOpened;
|
|
64
66
|
|
|
65
67
|
const canShowCloseBtn = viewWidth >= ViewWidth.SMALL_TABLET;
|
|
66
68
|
const canShowCloseBtnIos = platform === IOS && !canShowCloseBtn;
|
|
@@ -73,7 +75,9 @@ export const ModalCardBase: React.FC<ModalCardBaseProps> = withAdaptivity(({
|
|
|
73
75
|
})}
|
|
74
76
|
ref={getRootRef}
|
|
75
77
|
>
|
|
76
|
-
<div vkuiClass=
|
|
78
|
+
<div vkuiClass={classNames('ModalCardBase__container', {
|
|
79
|
+
'ModalCardBase__container--softwareKeyboardOpened': isSoftwareKeyboardOpened,
|
|
80
|
+
})}>
|
|
77
81
|
{hasReactNode(icon) && <div vkuiClass="ModalCardBase__icon">{icon}</div>}
|
|
78
82
|
{hasReactNode(header) && <Title level="2" weight="semibold" vkuiClass="ModalCardBase__header">{header}</Title>}
|
|
79
83
|
{hasReactNode(subheader) && <Headline weight="regular" vkuiClass="ModalCardBase__subheader">{subheader}</Headline>}
|
|
@@ -5,7 +5,6 @@ import { ModalRootContext, useModalRegistry } from '../ModalRoot/ModalRootContex
|
|
|
5
5
|
import { usePlatform } from '../../hooks/usePlatform';
|
|
6
6
|
import { withAdaptivity, AdaptivityProps, ViewHeight, ViewWidth } from '../../hoc/withAdaptivity';
|
|
7
7
|
import ModalDismissButton from '../ModalDismissButton/ModalDismissButton';
|
|
8
|
-
import { Ref } from '../../types';
|
|
9
8
|
import { multiRef } from '../../lib/utils';
|
|
10
9
|
import { ModalType } from '../ModalRoot/types';
|
|
11
10
|
import { getNavId, NavIdProps } from '../../lib/getNavId';
|
|
@@ -26,7 +25,7 @@ export interface ModalPageProps extends React.HTMLAttributes<HTMLDivElement>, Ad
|
|
|
26
25
|
* Если высота контента в модальной странице может поменяться, нужно установить это свойство
|
|
27
26
|
*/
|
|
28
27
|
dynamicContentHeight?: boolean;
|
|
29
|
-
getModalContentRef?: Ref<HTMLDivElement>;
|
|
28
|
+
getModalContentRef?: React.Ref<HTMLDivElement>;
|
|
30
29
|
}
|
|
31
30
|
|
|
32
31
|
const warn = warnOnce('ModalPage');
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import Touch,
|
|
2
|
+
import { Touch, TouchEvent } from '../Touch/Touch';
|
|
3
3
|
import TouchRootContext from '../Touch/TouchContext';
|
|
4
4
|
import { getClassName } from '../../helpers/getClassName';
|
|
5
5
|
import { classNames } from '../../lib/classNames';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { getClassName } from '../../helpers/getClassName';
|
|
3
3
|
import { classNames } from '../../lib/classNames';
|
|
4
|
-
import Touch from '../Touch/Touch';
|
|
4
|
+
import { Touch } from '../Touch/Touch';
|
|
5
5
|
import { TooltipContainer } from '../Tooltip/TooltipContainer';
|
|
6
6
|
import { HasRootRef } from '../../types';
|
|
7
7
|
import { withAdaptivity, AdaptivityProps } from '../../hoc/withAdaptivity';
|
|
@@ -49,8 +49,8 @@ const PanelHeaderContent: React.FunctionComponent<PanelHeaderContentProps> = ({
|
|
|
49
49
|
</Caption>
|
|
50
50
|
}
|
|
51
51
|
<div vkuiClass="PanelHeaderContent__children">
|
|
52
|
-
{hasReactNode(status)
|
|
53
|
-
|
|
52
|
+
{hasReactNode(status) ?
|
|
53
|
+
<Headline Component="span" weight="medium">
|
|
54
54
|
{children}
|
|
55
55
|
</Headline>
|
|
56
56
|
: <span vkuiClass="PanelHeaderContent__children-in">{children}</span>
|