@vkontakte/vkui 4.20.0 → 4.22.1
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 +414 -116
- package/.cache/ts/src/components/Avatar/Avatar.d.ts +2 -0
- package/.cache/ts/src/components/Cell/Cell.d.ts +11 -0
- package/.cache/ts/src/components/Cell/CellCheckbox/CellCheckbox.d.ts +5 -0
- package/.cache/ts/src/components/Cell/CellDragger/CellDragger.d.ts +6 -0
- package/.cache/ts/src/components/Cell/useDraggable.d.ts +13 -0
- package/.cache/ts/src/components/CustomSelect/CustomSelect.d.ts +0 -1
- package/.cache/ts/src/components/DropdownIcon/DropdownIcon.d.ts +3 -0
- package/.cache/ts/src/components/FocusTrap/FocusTrap.d.ts +2 -3
- package/.cache/ts/src/components/FormField/FormField.d.ts +2 -3
- package/.cache/ts/src/components/FormItem/FormItem.d.ts +2 -3
- package/.cache/ts/src/components/FormLayout/FormLayout.d.ts +2 -4
- package/.cache/ts/src/components/GridAvatar/GridAvatar.d.ts +9 -0
- package/.cache/ts/src/components/HorizontalCell/HorizontalCell.d.ts +2 -3
- package/.cache/ts/src/components/HorizontalScroll/HorizontalScroll.d.ts +3 -2
- package/.cache/ts/src/components/InitialsAvatar/InitialsAvatar.d.ts +33 -0
- package/.cache/ts/src/components/Link/Link.d.ts +1 -2
- package/.cache/ts/src/components/ModalRoot/types.d.ts +0 -1
- package/.cache/ts/src/components/ModalRoot/useModalManager.d.ts +37 -0
- package/.cache/ts/src/components/Removable/Removable.d.ts +2 -1
- package/.cache/ts/src/components/SimpleCell/SimpleCell.d.ts +2 -2
- package/.cache/ts/src/components/SplitCol/SplitCol.d.ts +3 -3
- package/.cache/ts/src/components/SubnavigationBar/SubnavigationBar.d.ts +2 -1
- package/.cache/ts/src/components/Switch/Switch.d.ts +2 -3
- package/.cache/ts/src/components/TabbarItem/TabbarItem.d.ts +3 -1
- package/.cache/ts/src/components/Tappable/Tappable.d.ts +2 -3
- package/.cache/ts/src/components/Touch/Touch.d.ts +16 -17
- package/.cache/ts/src/components/Typography/Caption/Caption.d.ts +2 -2
- package/.cache/ts/src/components/Typography/Headline/Headline.d.ts +2 -2
- package/.cache/ts/src/components/Typography/Subhead/Subhead.d.ts +2 -2
- package/.cache/ts/src/components/Typography/Text/Text.d.ts +2 -3
- package/.cache/ts/src/components/Typography/Title/Title.d.ts +2 -2
- package/.cache/ts/src/components/View/utils.d.ts +2 -0
- package/.cache/ts/src/index.d.ts +4 -0
- package/.cache/ts/src/lib/accessibility.d.ts +1 -1
- package/.cache/ts/src/lib/supportEvents.d.ts +3 -1
- package/.cache/ts/src/types.d.ts +3 -0
- package/dist/cjs/components/ActionSheet/ActionSheet.js +7 -9
- package/dist/cjs/components/ActionSheet/ActionSheet.js.map +1 -1
- package/dist/cjs/components/Avatar/Avatar.d.ts +2 -0
- package/dist/cjs/components/Avatar/Avatar.js +7 -3
- package/dist/cjs/components/Avatar/Avatar.js.map +1 -1
- package/dist/cjs/components/Banner/Banner.js.map +1 -1
- package/dist/cjs/components/Button/Button.js.map +1 -1
- package/dist/cjs/components/CardScroll/CardScroll.js +1 -1
- package/dist/cjs/components/CardScroll/CardScroll.js.map +1 -1
- package/dist/cjs/components/Cell/Cell.d.ts +11 -0
- package/dist/cjs/components/Cell/Cell.js +109 -182
- package/dist/cjs/components/Cell/Cell.js.map +1 -1
- package/dist/cjs/components/Cell/CellCheckbox/CellCheckbox.d.ts +5 -0
- package/dist/cjs/components/Cell/CellCheckbox/CellCheckbox.js +50 -0
- package/dist/cjs/components/Cell/CellCheckbox/CellCheckbox.js.map +1 -0
- package/dist/cjs/components/Cell/CellDragger/CellDragger.d.ts +6 -0
- package/dist/cjs/components/Cell/CellDragger/CellDragger.js +53 -0
- package/dist/cjs/components/Cell/CellDragger/CellDragger.js.map +1 -0
- package/dist/cjs/components/Cell/useDraggable.d.ts +13 -0
- package/dist/cjs/components/Cell/useDraggable.js +142 -0
- package/dist/cjs/components/Cell/useDraggable.js.map +1 -0
- package/dist/cjs/components/ChipsSelect/ChipsSelect.js +2 -2
- package/dist/cjs/components/ChipsSelect/ChipsSelect.js.map +1 -1
- package/dist/cjs/components/Counter/Counter.js.map +1 -1
- package/dist/cjs/components/CustomSelect/CustomSelect.d.ts +0 -1
- package/dist/cjs/components/CustomSelect/CustomSelect.js +2 -3
- package/dist/cjs/components/CustomSelect/CustomSelect.js.map +1 -1
- package/dist/cjs/components/DropdownIcon/DropdownIcon.d.ts +3 -0
- package/dist/cjs/components/DropdownIcon/DropdownIcon.js +37 -0
- package/dist/cjs/components/DropdownIcon/DropdownIcon.js.map +1 -0
- package/dist/cjs/components/FocusTrap/FocusTrap.d.ts +2 -3
- package/dist/cjs/components/FocusTrap/FocusTrap.js +3 -5
- package/dist/cjs/components/FocusTrap/FocusTrap.js.map +1 -1
- package/dist/cjs/components/FormField/FormField.d.ts +2 -3
- package/dist/cjs/components/FormField/FormField.js.map +1 -1
- package/dist/cjs/components/FormItem/FormItem.d.ts +2 -3
- package/dist/cjs/components/FormItem/FormItem.js.map +1 -1
- package/dist/cjs/components/FormLayout/FormLayout.d.ts +2 -4
- package/dist/cjs/components/FormLayout/FormLayout.js.map +1 -1
- package/dist/cjs/components/FormLayoutGroup/FormLayoutGroup.js +1 -0
- package/dist/cjs/components/FormLayoutGroup/FormLayoutGroup.js.map +1 -1
- package/dist/cjs/components/GridAvatar/GridAvatar.d.ts +9 -0
- package/dist/cjs/components/GridAvatar/GridAvatar.js +61 -0
- package/dist/cjs/components/GridAvatar/GridAvatar.js.map +1 -0
- package/dist/cjs/components/Header/Header.js.map +1 -1
- package/dist/cjs/components/HorizontalCell/HorizontalCell.d.ts +2 -3
- package/dist/cjs/components/HorizontalCell/HorizontalCell.js.map +1 -1
- package/dist/cjs/components/HorizontalScroll/HorizontalScroll.d.ts +3 -2
- package/dist/cjs/components/HorizontalScroll/HorizontalScroll.js +10 -13
- package/dist/cjs/components/HorizontalScroll/HorizontalScroll.js.map +1 -1
- package/dist/cjs/components/InitialsAvatar/InitialsAvatar.d.ts +33 -0
- package/dist/cjs/components/InitialsAvatar/InitialsAvatar.js +64 -0
- package/dist/cjs/components/InitialsAvatar/InitialsAvatar.js.map +1 -0
- package/dist/cjs/components/Link/Link.d.ts +1 -2
- package/dist/cjs/components/Link/Link.js.map +1 -1
- package/dist/cjs/components/ModalRoot/ModalRoot.js +170 -373
- package/dist/cjs/components/ModalRoot/ModalRoot.js.map +1 -1
- package/dist/cjs/components/ModalRoot/ModalRootContext.js +0 -3
- package/dist/cjs/components/ModalRoot/ModalRootContext.js.map +1 -1
- package/dist/cjs/components/ModalRoot/ModalRootDesktop.js +59 -241
- package/dist/cjs/components/ModalRoot/ModalRootDesktop.js.map +1 -1
- package/dist/cjs/components/ModalRoot/types.d.ts +0 -1
- package/dist/cjs/components/ModalRoot/types.js.map +1 -1
- package/dist/cjs/components/ModalRoot/useModalManager.d.ts +37 -0
- package/dist/cjs/components/ModalRoot/useModalManager.js +213 -0
- package/dist/cjs/components/ModalRoot/useModalManager.js.map +1 -0
- package/dist/cjs/components/NativeSelect/NativeSelect.js +2 -2
- package/dist/cjs/components/NativeSelect/NativeSelect.js.map +1 -1
- package/dist/cjs/components/Removable/Removable.d.ts +2 -1
- package/dist/cjs/components/Removable/Removable.js +75 -66
- package/dist/cjs/components/Removable/Removable.js.map +1 -1
- package/dist/cjs/components/SelectMimicry/SelectMimicry.js +2 -2
- package/dist/cjs/components/SelectMimicry/SelectMimicry.js.map +1 -1
- package/dist/cjs/components/SimpleCell/SimpleCell.d.ts +2 -2
- package/dist/cjs/components/SimpleCell/SimpleCell.js.map +1 -1
- package/dist/cjs/components/SplitCol/SplitCol.d.ts +3 -3
- package/dist/cjs/components/SplitCol/SplitCol.js +2 -4
- package/dist/cjs/components/SplitCol/SplitCol.js.map +1 -1
- package/dist/cjs/components/SubnavigationBar/SubnavigationBar.d.ts +2 -1
- package/dist/cjs/components/SubnavigationBar/SubnavigationBar.js +38 -11
- package/dist/cjs/components/SubnavigationBar/SubnavigationBar.js.map +1 -1
- package/dist/cjs/components/SubnavigationButton/SubnavigationButton.js.map +1 -1
- package/dist/cjs/components/Switch/Switch.d.ts +2 -3
- package/dist/cjs/components/Switch/Switch.js +18 -8
- package/dist/cjs/components/Switch/Switch.js.map +1 -1
- package/dist/cjs/components/Tabbar/Tabbar.js +3 -1
- package/dist/cjs/components/Tabbar/Tabbar.js.map +1 -1
- package/dist/cjs/components/TabbarItem/TabbarItem.d.ts +3 -1
- package/dist/cjs/components/TabbarItem/TabbarItem.js +29 -11
- package/dist/cjs/components/TabbarItem/TabbarItem.js.map +1 -1
- package/dist/cjs/components/Tappable/Tappable.d.ts +2 -3
- package/dist/cjs/components/Tappable/Tappable.js.map +1 -1
- package/dist/cjs/components/Textarea/Textarea.js +9 -7
- package/dist/cjs/components/Textarea/Textarea.js.map +1 -1
- package/dist/cjs/components/Touch/Touch.d.ts +16 -17
- package/dist/cjs/components/Touch/Touch.js +21 -7
- package/dist/cjs/components/Touch/Touch.js.map +1 -1
- package/dist/cjs/components/Typography/Caption/Caption.d.ts +2 -2
- package/dist/cjs/components/Typography/Caption/Caption.js +4 -2
- package/dist/cjs/components/Typography/Caption/Caption.js.map +1 -1
- package/dist/cjs/components/Typography/Headline/Headline.d.ts +2 -2
- package/dist/cjs/components/Typography/Headline/Headline.js +2 -1
- package/dist/cjs/components/Typography/Headline/Headline.js.map +1 -1
- package/dist/cjs/components/Typography/Subhead/Subhead.d.ts +2 -2
- package/dist/cjs/components/Typography/Subhead/Subhead.js +2 -1
- package/dist/cjs/components/Typography/Subhead/Subhead.js.map +1 -1
- package/dist/cjs/components/Typography/Text/Text.d.ts +2 -3
- package/dist/cjs/components/Typography/Text/Text.js +2 -1
- package/dist/cjs/components/Typography/Text/Text.js.map +1 -1
- package/dist/cjs/components/Typography/Title/Title.d.ts +2 -2
- package/dist/cjs/components/Typography/Title/Title.js +9 -4
- package/dist/cjs/components/Typography/Title/Title.js.map +1 -1
- package/dist/cjs/components/View/View.js +68 -75
- package/dist/cjs/components/View/View.js.map +1 -1
- package/dist/cjs/components/View/ViewInfinite.js +78 -85
- package/dist/cjs/components/View/ViewInfinite.js.map +1 -1
- package/dist/cjs/components/View/utils.d.ts +2 -0
- package/dist/cjs/components/View/utils.js +13 -0
- package/dist/cjs/components/View/utils.js.map +1 -0
- package/dist/cjs/index.d.ts +4 -0
- package/dist/cjs/index.js +16 -0
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/lib/accessibility.d.ts +1 -1
- package/dist/cjs/lib/accessibility.js.map +1 -1
- package/dist/cjs/lib/prefixClass.js +7 -6
- package/dist/cjs/lib/prefixClass.js.map +1 -1
- package/dist/cjs/lib/supportEvents.d.ts +3 -1
- package/dist/cjs/lib/supportEvents.js +1 -4
- package/dist/cjs/lib/supportEvents.js.map +1 -1
- package/dist/cjs/types.d.ts +3 -0
- package/dist/components/ActionSheet/ActionSheet.js +6 -9
- package/dist/components/ActionSheet/ActionSheet.js.map +1 -1
- package/dist/components/Avatar/Avatar.d.ts +2 -0
- package/dist/components/Avatar/Avatar.js +4 -2
- package/dist/components/Avatar/Avatar.js.map +1 -1
- package/dist/components/Banner/Banner.js.map +1 -1
- package/dist/components/Button/Button.js.map +1 -1
- package/dist/components/CardScroll/CardScroll.js +1 -1
- package/dist/components/CardScroll/CardScroll.js.map +1 -1
- package/dist/components/Cell/Cell.d.ts +11 -0
- package/dist/components/Cell/Cell.js +103 -177
- package/dist/components/Cell/Cell.js.map +1 -1
- package/dist/components/Cell/CellCheckbox/CellCheckbox.d.ts +5 -0
- package/dist/components/Cell/CellCheckbox/CellCheckbox.js +31 -0
- package/dist/components/Cell/CellCheckbox/CellCheckbox.js.map +1 -0
- package/dist/components/Cell/CellDragger/CellDragger.d.ts +6 -0
- package/dist/components/Cell/CellDragger/CellDragger.js +30 -0
- package/dist/components/Cell/CellDragger/CellDragger.js.map +1 -0
- package/dist/components/Cell/useDraggable.d.ts +13 -0
- package/dist/components/Cell/useDraggable.js +126 -0
- package/dist/components/Cell/useDraggable.js.map +1 -0
- package/dist/components/ChipsSelect/ChipsSelect.js +2 -2
- package/dist/components/ChipsSelect/ChipsSelect.js.map +1 -1
- package/dist/components/Counter/Counter.js.map +1 -1
- package/dist/components/CustomSelect/CustomSelect.d.ts +0 -1
- package/dist/components/CustomSelect/CustomSelect.js +3 -5
- package/dist/components/CustomSelect/CustomSelect.js.map +1 -1
- package/dist/components/DropdownIcon/DropdownIcon.d.ts +3 -0
- package/dist/components/DropdownIcon/DropdownIcon.js +19 -0
- package/dist/components/DropdownIcon/DropdownIcon.js.map +1 -0
- package/dist/components/FocusTrap/FocusTrap.d.ts +2 -3
- package/dist/components/FocusTrap/FocusTrap.js +3 -5
- package/dist/components/FocusTrap/FocusTrap.js.map +1 -1
- package/dist/components/FormField/FormField.d.ts +2 -3
- package/dist/components/FormField/FormField.js.map +1 -1
- package/dist/components/FormItem/FormItem.d.ts +2 -3
- package/dist/components/FormItem/FormItem.js.map +1 -1
- package/dist/components/FormLayout/FormLayout.d.ts +2 -4
- package/dist/components/FormLayout/FormLayout.js.map +1 -1
- package/dist/components/FormLayoutGroup/FormLayoutGroup.js +1 -0
- package/dist/components/FormLayoutGroup/FormLayoutGroup.js.map +1 -1
- package/dist/components/GridAvatar/GridAvatar.d.ts +9 -0
- package/dist/components/GridAvatar/GridAvatar.js +41 -0
- package/dist/components/GridAvatar/GridAvatar.js.map +1 -0
- package/dist/components/Header/Header.js.map +1 -1
- package/dist/components/HorizontalCell/HorizontalCell.d.ts +2 -3
- package/dist/components/HorizontalCell/HorizontalCell.js.map +1 -1
- package/dist/components/HorizontalScroll/HorizontalScroll.d.ts +3 -2
- package/dist/components/HorizontalScroll/HorizontalScroll.js +10 -12
- package/dist/components/HorizontalScroll/HorizontalScroll.js.map +1 -1
- package/dist/components/InitialsAvatar/InitialsAvatar.d.ts +33 -0
- package/dist/components/InitialsAvatar/InitialsAvatar.js +46 -0
- package/dist/components/InitialsAvatar/InitialsAvatar.js.map +1 -0
- package/dist/components/Link/Link.d.ts +1 -2
- package/dist/components/Link/Link.js.map +1 -1
- package/dist/components/ModalRoot/ModalRoot.js +167 -376
- package/dist/components/ModalRoot/ModalRoot.js.map +1 -1
- package/dist/components/ModalRoot/ModalRootContext.js +0 -3
- package/dist/components/ModalRoot/ModalRootContext.js.map +1 -1
- package/dist/components/ModalRoot/ModalRootDesktop.js +58 -244
- package/dist/components/ModalRoot/ModalRootDesktop.js.map +1 -1
- package/dist/components/ModalRoot/types.d.ts +0 -1
- package/dist/components/ModalRoot/types.js.map +1 -1
- package/dist/components/ModalRoot/useModalManager.d.ts +37 -0
- package/dist/components/ModalRoot/useModalManager.js +189 -0
- package/dist/components/ModalRoot/useModalManager.js.map +1 -0
- package/dist/components/NativeSelect/NativeSelect.js +2 -2
- package/dist/components/NativeSelect/NativeSelect.js.map +1 -1
- package/dist/components/Removable/Removable.d.ts +2 -1
- package/dist/components/Removable/Removable.js +73 -64
- package/dist/components/Removable/Removable.js.map +1 -1
- package/dist/components/SelectMimicry/SelectMimicry.js +2 -2
- package/dist/components/SelectMimicry/SelectMimicry.js.map +1 -1
- package/dist/components/SimpleCell/SimpleCell.d.ts +2 -2
- package/dist/components/SimpleCell/SimpleCell.js.map +1 -1
- package/dist/components/SplitCol/SplitCol.d.ts +3 -3
- package/dist/components/SplitCol/SplitCol.js +2 -4
- package/dist/components/SplitCol/SplitCol.js.map +1 -1
- package/dist/components/SubnavigationBar/SubnavigationBar.d.ts +2 -1
- package/dist/components/SubnavigationBar/SubnavigationBar.js +38 -11
- package/dist/components/SubnavigationBar/SubnavigationBar.js.map +1 -1
- package/dist/components/SubnavigationButton/SubnavigationButton.js.map +1 -1
- package/dist/components/Switch/Switch.d.ts +2 -3
- package/dist/components/Switch/Switch.js +15 -8
- package/dist/components/Switch/Switch.js.map +1 -1
- package/dist/components/Tabbar/Tabbar.js +3 -1
- package/dist/components/Tabbar/Tabbar.js.map +1 -1
- package/dist/components/TabbarItem/TabbarItem.d.ts +3 -1
- package/dist/components/TabbarItem/TabbarItem.js +26 -10
- package/dist/components/TabbarItem/TabbarItem.js.map +1 -1
- package/dist/components/Tappable/Tappable.d.ts +2 -3
- package/dist/components/Tappable/Tappable.js.map +1 -1
- package/dist/components/Textarea/Textarea.js +9 -6
- package/dist/components/Textarea/Textarea.js.map +1 -1
- package/dist/components/Touch/Touch.d.ts +16 -17
- package/dist/components/Touch/Touch.js +21 -7
- package/dist/components/Touch/Touch.js.map +1 -1
- package/dist/components/Typography/Caption/Caption.d.ts +2 -2
- package/dist/components/Typography/Caption/Caption.js +4 -2
- package/dist/components/Typography/Caption/Caption.js.map +1 -1
- package/dist/components/Typography/Headline/Headline.d.ts +2 -2
- package/dist/components/Typography/Headline/Headline.js +2 -1
- package/dist/components/Typography/Headline/Headline.js.map +1 -1
- package/dist/components/Typography/Subhead/Subhead.d.ts +2 -2
- package/dist/components/Typography/Subhead/Subhead.js +2 -1
- package/dist/components/Typography/Subhead/Subhead.js.map +1 -1
- package/dist/components/Typography/Text/Text.d.ts +2 -3
- package/dist/components/Typography/Text/Text.js +2 -1
- package/dist/components/Typography/Text/Text.js.map +1 -1
- package/dist/components/Typography/Title/Title.d.ts +2 -2
- package/dist/components/Typography/Title/Title.js +9 -4
- package/dist/components/Typography/Title/Title.js.map +1 -1
- package/dist/components/View/View.js +67 -75
- package/dist/components/View/View.js.map +1 -1
- package/dist/components/View/ViewInfinite.js +79 -87
- package/dist/components/View/ViewInfinite.js.map +1 -1
- package/dist/components/View/utils.d.ts +2 -0
- package/dist/components/View/utils.js +6 -0
- package/dist/components/View/utils.js.map +1 -0
- package/dist/components.css +1 -1
- package/dist/components.css.map +1 -1
- package/dist/cssm/components/ActionSheet/ActionSheet.js +6 -9
- package/dist/cssm/components/ActionSheet/ActionSheet.js.map +1 -1
- package/dist/cssm/components/Avatar/Avatar.js +4 -2
- package/dist/cssm/components/Avatar/Avatar.js.map +1 -1
- package/dist/cssm/components/Banner/Banner.js.map +1 -1
- package/dist/cssm/components/Button/Button.css +1 -1
- package/dist/cssm/components/Button/Button.js.map +1 -1
- package/dist/cssm/components/CardScroll/CardScroll.js +1 -1
- package/dist/cssm/components/CardScroll/CardScroll.js.map +1 -1
- package/dist/cssm/components/Cell/Cell.css +1 -1
- package/dist/cssm/components/Cell/Cell.js +103 -177
- package/dist/cssm/components/Cell/Cell.js.map +1 -1
- package/dist/cssm/components/Cell/CellCheckbox/CellCheckbox.css +1 -0
- package/dist/cssm/components/Cell/CellCheckbox/CellCheckbox.js +32 -0
- package/dist/cssm/components/Cell/CellCheckbox/CellCheckbox.js.map +1 -0
- package/dist/cssm/components/Cell/CellDragger/CellDragger.css +1 -0
- package/dist/cssm/components/Cell/CellDragger/CellDragger.js +31 -0
- package/dist/cssm/components/Cell/CellDragger/CellDragger.js.map +1 -0
- package/dist/cssm/components/Cell/useDraggable.js +126 -0
- package/dist/cssm/components/Cell/useDraggable.js.map +1 -0
- package/dist/cssm/components/ChipsSelect/ChipsSelect.js +2 -2
- package/dist/cssm/components/ChipsSelect/ChipsSelect.js.map +1 -1
- package/dist/cssm/components/Counter/Counter.js.map +1 -1
- package/dist/cssm/components/CustomSelect/CustomSelect.js +3 -5
- package/dist/cssm/components/CustomSelect/CustomSelect.js.map +1 -1
- package/dist/cssm/components/DropdownIcon/DropdownIcon.css +1 -0
- package/dist/cssm/components/DropdownIcon/DropdownIcon.js +20 -0
- package/dist/cssm/components/DropdownIcon/DropdownIcon.js.map +1 -0
- package/dist/cssm/components/FocusTrap/FocusTrap.js +3 -5
- package/dist/cssm/components/FocusTrap/FocusTrap.js.map +1 -1
- package/dist/cssm/components/FocusVisible/FocusVisible.css +1 -1
- package/dist/cssm/components/FormField/FormField.css +1 -1
- package/dist/cssm/components/FormField/FormField.js.map +1 -1
- package/dist/cssm/components/FormItem/FormItem.css +1 -1
- package/dist/cssm/components/FormItem/FormItem.js.map +1 -1
- package/dist/cssm/components/FormLayout/FormLayout.js.map +1 -1
- package/dist/cssm/components/FormLayoutGroup/FormLayoutGroup.css +1 -1
- package/dist/cssm/components/FormLayoutGroup/FormLayoutGroup.js +1 -0
- package/dist/cssm/components/FormLayoutGroup/FormLayoutGroup.js.map +1 -1
- package/dist/cssm/components/Gallery/Gallery.css +1 -1
- package/dist/cssm/components/GridAvatar/GridAvatar.css +1 -0
- package/dist/cssm/components/GridAvatar/GridAvatar.js +42 -0
- package/dist/cssm/components/GridAvatar/GridAvatar.js.map +1 -0
- package/dist/cssm/components/Header/Header.js.map +1 -1
- package/dist/cssm/components/HorizontalCell/HorizontalCell.js.map +1 -1
- package/dist/cssm/components/HorizontalScroll/HorizontalScroll.js +10 -12
- package/dist/cssm/components/HorizontalScroll/HorizontalScroll.js.map +1 -1
- package/dist/cssm/components/HorizontalScroll/HorizontalScrollArrow.css +1 -1
- package/dist/cssm/components/IconButton/IconButton.css +1 -1
- package/dist/cssm/components/InitialsAvatar/InitialsAvatar.css +1 -0
- package/dist/cssm/components/InitialsAvatar/InitialsAvatar.js +52 -0
- package/dist/cssm/components/InitialsAvatar/InitialsAvatar.js.map +1 -0
- package/dist/cssm/components/Link/Link.js.map +1 -1
- package/dist/cssm/components/ModalRoot/ModalRoot.js +167 -376
- package/dist/cssm/components/ModalRoot/ModalRoot.js.map +1 -1
- package/dist/cssm/components/ModalRoot/ModalRootContext.js +0 -3
- package/dist/cssm/components/ModalRoot/ModalRootContext.js.map +1 -1
- package/dist/cssm/components/ModalRoot/ModalRootDesktop.js +58 -244
- package/dist/cssm/components/ModalRoot/ModalRootDesktop.js.map +1 -1
- package/dist/cssm/components/ModalRoot/types.js.map +1 -1
- package/dist/cssm/components/ModalRoot/useModalManager.js +189 -0
- package/dist/cssm/components/ModalRoot/useModalManager.js.map +1 -0
- package/dist/cssm/components/NativeSelect/NativeSelect.js +2 -2
- package/dist/cssm/components/NativeSelect/NativeSelect.js.map +1 -1
- package/dist/cssm/components/Removable/Removable.css +1 -1
- package/dist/cssm/components/Removable/Removable.js +73 -64
- package/dist/cssm/components/Removable/Removable.js.map +1 -1
- package/dist/cssm/components/Search/Search.css +1 -1
- package/dist/cssm/components/Select/Select.css +1 -1
- package/dist/cssm/components/SelectMimicry/SelectMimicry.js +2 -2
- package/dist/cssm/components/SelectMimicry/SelectMimicry.js.map +1 -1
- package/dist/cssm/components/SimpleCell/SimpleCell.css +1 -1
- package/dist/cssm/components/SimpleCell/SimpleCell.js.map +1 -1
- package/dist/cssm/components/SplitCol/SplitCol.js +2 -4
- package/dist/cssm/components/SplitCol/SplitCol.js.map +1 -1
- package/dist/cssm/components/SubnavigationBar/SubnavigationBar.js +38 -11
- package/dist/cssm/components/SubnavigationBar/SubnavigationBar.js.map +1 -1
- package/dist/cssm/components/SubnavigationButton/SubnavigationButton.js.map +1 -1
- package/dist/cssm/components/Switch/Switch.css +1 -1
- package/dist/cssm/components/Switch/Switch.js +15 -8
- package/dist/cssm/components/Switch/Switch.js.map +1 -1
- package/dist/cssm/components/Tabbar/Tabbar.css +1 -1
- package/dist/cssm/components/Tabbar/Tabbar.js +3 -1
- 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 +26 -10
- package/dist/cssm/components/TabbarItem/TabbarItem.js.map +1 -1
- package/dist/cssm/components/Tappable/Tappable.js.map +1 -1
- package/dist/cssm/components/Textarea/Textarea.js +9 -6
- package/dist/cssm/components/Textarea/Textarea.js.map +1 -1
- package/dist/cssm/components/Touch/Touch.js +21 -7
- package/dist/cssm/components/Touch/Touch.js.map +1 -1
- package/dist/cssm/components/Typography/Caption/Caption.js +4 -2
- package/dist/cssm/components/Typography/Caption/Caption.js.map +1 -1
- package/dist/cssm/components/Typography/Headline/Headline.js +2 -1
- package/dist/cssm/components/Typography/Headline/Headline.js.map +1 -1
- package/dist/cssm/components/Typography/Subhead/Subhead.js +2 -1
- package/dist/cssm/components/Typography/Subhead/Subhead.js.map +1 -1
- package/dist/cssm/components/Typography/Text/Text.js +2 -1
- package/dist/cssm/components/Typography/Text/Text.js.map +1 -1
- package/dist/cssm/components/Typography/Title/Title.js +9 -4
- package/dist/cssm/components/Typography/Title/Title.js.map +1 -1
- package/dist/cssm/components/View/View.js +67 -75
- package/dist/cssm/components/View/View.js.map +1 -1
- package/dist/cssm/components/View/ViewInfinite.js +79 -87
- package/dist/cssm/components/View/ViewInfinite.js.map +1 -1
- package/dist/cssm/components/View/utils.js +6 -0
- package/dist/cssm/components/View/utils.js.map +1 -0
- package/dist/cssm/index.js +2 -0
- package/dist/cssm/index.js.map +1 -1
- package/dist/cssm/lib/accessibility.js.map +1 -1
- package/dist/cssm/lib/prefixClass.js +7 -6
- package/dist/cssm/lib/prefixClass.js.map +1 -1
- package/dist/cssm/lib/supportEvents.js +1 -4
- package/dist/cssm/lib/supportEvents.js.map +1 -1
- package/dist/cssm/styles/components.css +1 -1
- package/dist/cssm/styles/themes.css +1 -1
- package/dist/cssm/styles/vkcom_light.css +1 -1
- package/dist/index.d.ts +4 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/lib/accessibility.d.ts +1 -1
- package/dist/lib/accessibility.js.map +1 -1
- package/dist/lib/prefixClass.js +7 -6
- package/dist/lib/prefixClass.js.map +1 -1
- package/dist/lib/supportEvents.d.ts +3 -1
- package/dist/lib/supportEvents.js +1 -4
- package/dist/lib/supportEvents.js.map +1 -1
- package/dist/types.d.ts +3 -0
- package/dist/vkui.css +2 -2
- package/dist/vkui.css.map +1 -1
- package/package.json +8 -4
- package/src/components/ActionSheet/ActionSheet.tsx +4 -5
- package/src/components/ActionSheet/Readme.md +18 -14
- package/src/components/Alert/Readme.md +15 -11
- package/src/components/Avatar/Avatar.tsx +5 -2
- package/src/components/Banner/Banner.tsx +4 -5
- package/src/components/Button/Button.css +26 -53
- package/src/components/Button/Button.tsx +2 -3
- package/src/components/Card/Readme.md +6 -6
- package/src/components/CardScroll/CardScroll.tsx +4 -1
- package/src/components/Cell/Cell.css +21 -58
- package/src/components/Cell/Cell.tsx +101 -162
- package/src/components/Cell/CellCheckbox/CellCheckbox.css +17 -0
- package/src/components/Cell/CellCheckbox/CellCheckbox.tsx +42 -0
- package/src/components/Cell/CellDragger/CellDragger.css +4 -0
- package/src/components/Cell/CellDragger/CellDragger.tsx +40 -0
- package/src/components/Cell/Readme.md +89 -51
- package/src/components/Cell/useDraggable.tsx +112 -0
- package/src/components/ChipsSelect/ChipsSelect.tsx +2 -2
- package/src/components/Counter/Counter.tsx +2 -2
- package/src/components/CustomSelect/CustomSelect.tsx +3 -4
- package/src/components/DropdownIcon/DropdownIcon.css +3 -0
- package/src/components/DropdownIcon/DropdownIcon.tsx +20 -0
- package/src/components/Epic/Readme.md +2 -1
- package/src/components/FocusTrap/FocusTrap.tsx +13 -11
- package/src/components/FocusVisible/FocusVisible.css +12 -4
- package/src/components/FormField/FormField.css +0 -1
- package/src/components/FormField/FormField.tsx +2 -2
- package/src/components/FormItem/FormItem.css +13 -14
- package/src/components/FormItem/FormItem.tsx +2 -3
- package/src/components/FormLayout/FormLayout.tsx +2 -4
- package/src/components/FormLayoutGroup/FormLayoutGroup.css +11 -7
- package/src/components/FormLayoutGroup/FormLayoutGroup.tsx +10 -1
- package/src/components/Gallery/Gallery.css +2 -3
- package/src/components/Gallery/Readme.md +89 -109
- package/src/components/GridAvatar/GridAvatar.css +37 -0
- package/src/components/GridAvatar/GridAvatar.tsx +55 -0
- package/src/components/GridAvatar/Readme.md +12 -0
- package/src/components/Group/Readme.md +18 -14
- package/src/components/Header/Header.tsx +4 -4
- package/src/components/HorizontalCell/HorizontalCell.tsx +3 -3
- package/src/components/HorizontalScroll/HorizontalScroll.tsx +14 -18
- package/src/components/HorizontalScroll/HorizontalScrollArrow.css +2 -2
- package/src/components/IconButton/IconButton.css +7 -0
- package/src/components/InitialsAvatar/InitialsAvatar.css +53 -0
- package/src/components/InitialsAvatar/InitialsAvatar.tsx +90 -0
- package/src/components/InitialsAvatar/Readme.md +14 -0
- package/src/components/Link/Link.tsx +1 -1
- package/src/components/MiniInfoCell/Readme.md +66 -62
- package/src/components/ModalDismissButton/Readme.md +13 -10
- package/src/components/ModalRoot/ModalRoot.tsx +159 -349
- package/src/components/ModalRoot/ModalRootContext.tsx +0 -1
- package/src/components/ModalRoot/ModalRootDesktop.tsx +54 -240
- package/src/components/ModalRoot/Readme.md +35 -27
- package/src/components/ModalRoot/types.ts +0 -1
- package/src/components/ModalRoot/useModalManager.tsx +174 -0
- package/src/components/NativeSelect/NativeSelect.tsx +2 -2
- package/src/components/Removable/Removable.css +16 -63
- package/src/components/Removable/Removable.tsx +84 -64
- package/src/components/ScreenSpinner/Readme.md +13 -9
- package/src/components/Search/Search.css +1 -1
- package/src/components/Select/Select.css +1 -1
- package/src/components/SelectMimicry/SelectMimicry.tsx +2 -2
- package/src/components/SimpleCell/SimpleCell.css +10 -18
- package/src/components/SimpleCell/SimpleCell.tsx +3 -5
- package/src/components/SplitCol/SplitCol.tsx +4 -8
- package/src/components/SplitLayout/Readme.md +2 -2
- package/src/components/SubnavigationBar/Readme.md +90 -86
- package/src/components/SubnavigationBar/SubnavigationBar.tsx +32 -14
- package/src/components/SubnavigationButton/SubnavigationButton.tsx +2 -3
- package/src/components/Switch/Readme.md +6 -6
- package/src/components/Switch/Switch.css +46 -15
- package/src/components/Switch/Switch.tsx +16 -8
- package/src/components/Tabbar/Tabbar.css +15 -4
- package/src/components/Tabbar/Tabbar.tsx +3 -1
- package/src/components/TabbarItem/Readme.md +72 -0
- package/src/components/TabbarItem/TabbarItem.css +65 -14
- package/src/components/TabbarItem/TabbarItem.tsx +46 -22
- package/src/components/Tappable/Tappable.tsx +2 -3
- package/src/components/Textarea/Readme.md +3 -0
- package/src/components/Textarea/Textarea.tsx +10 -6
- package/src/components/Touch/Touch.tsx +38 -25
- package/src/components/Typography/Caption/Caption.tsx +4 -4
- package/src/components/Typography/Headline/Headline.tsx +3 -3
- package/src/components/Typography/Subhead/Subhead.tsx +3 -3
- package/src/components/Typography/Text/Text.tsx +3 -4
- package/src/components/Typography/Title/Title.tsx +9 -5
- package/src/components/View/Readme.md +42 -56
- package/src/components/View/View.tsx +46 -61
- package/src/components/View/ViewInfinite.tsx +52 -67
- package/src/components/View/utils.ts +8 -0
- package/src/index.ts +4 -0
- package/src/lib/accessibility.ts +2 -2
- package/src/lib/prefixClass.ts +9 -6
- package/src/lib/supportEvents.ts +1 -4
- package/src/styles/components.css +4 -0
- package/src/styles/vkcom_light.css +3 -3
- package/src/testing/utils.tsx +34 -1
- package/src/types.ts +4 -0
|
@@ -1,42 +1,54 @@
|
|
|
1
1
|
.TabbarItem {
|
|
2
|
-
flex-shrink: 0;
|
|
3
|
-
max-width: 100%;
|
|
4
|
-
flex-grow: 1;
|
|
5
|
-
flex-basis: 0;
|
|
6
|
-
overflow: hidden;
|
|
7
2
|
display: flex;
|
|
8
3
|
align-items: center;
|
|
9
4
|
justify-content: center;
|
|
10
5
|
color: var(--tabbar_inactive_icon);
|
|
11
6
|
text-decoration: none;
|
|
7
|
+
border: none;
|
|
8
|
+
outline: none;
|
|
9
|
+
padding: 0;
|
|
10
|
+
background: transparent;
|
|
11
|
+
height: var(--tabbar_height);
|
|
12
|
+
position: relative;
|
|
12
13
|
}
|
|
13
14
|
|
|
14
|
-
.Tabbar
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
.Tabbar .TabbarItem {
|
|
16
|
+
flex-shrink: 0;
|
|
17
|
+
max-width: 100%;
|
|
18
|
+
min-width: 0;
|
|
19
|
+
flex-grow: 1;
|
|
20
|
+
flex-basis: 0;
|
|
17
21
|
}
|
|
18
22
|
|
|
19
23
|
.TabbarItem--selected {
|
|
20
24
|
color: var(--tabbar_active_icon);
|
|
21
25
|
}
|
|
22
26
|
|
|
27
|
+
.TabbarItem__tappable {
|
|
28
|
+
position: absolute;
|
|
29
|
+
}
|
|
30
|
+
|
|
23
31
|
.TabbarItem__in {
|
|
24
|
-
align-self: center;
|
|
25
32
|
display: flex;
|
|
26
|
-
max-width: 100%;
|
|
27
33
|
padding: 0 2px;
|
|
28
|
-
|
|
34
|
+
align-items: center;
|
|
35
|
+
justify-content: center;
|
|
36
|
+
pointer-events: none;
|
|
37
|
+
height: 100%;
|
|
38
|
+
overflow: hidden;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.Tabbar--l-vertical .TabbarItem--text .TabbarItem__in {
|
|
42
|
+
position: relative;
|
|
43
|
+
top: 2px;
|
|
29
44
|
}
|
|
30
45
|
|
|
31
46
|
.Tabbar--l-vertical .TabbarItem__in {
|
|
32
47
|
flex-direction: column;
|
|
33
|
-
align-items: center;
|
|
34
|
-
justify-content: center;
|
|
35
48
|
}
|
|
36
49
|
|
|
37
50
|
.Tabbar--l-horizontal .TabbarItem__in {
|
|
38
51
|
flex-direction: row;
|
|
39
|
-
align-items: center;
|
|
40
52
|
}
|
|
41
53
|
|
|
42
54
|
.TabbarItem__icon {
|
|
@@ -74,3 +86,42 @@
|
|
|
74
86
|
font-weight: 500;
|
|
75
87
|
margin-left: 8px;
|
|
76
88
|
}
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* Android
|
|
92
|
+
*/
|
|
93
|
+
|
|
94
|
+
.TabbarItem--android .TabbarItem__tappable {
|
|
95
|
+
width: calc(100% + 16px);
|
|
96
|
+
padding-bottom: calc(100% + 16px);
|
|
97
|
+
border-radius: 50%;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
.TabbarItem--android:first-child {
|
|
101
|
+
border-top-left-radius: 0;
|
|
102
|
+
border-bottom-left-radius: 0;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
.TabbarItem--android:last-child {
|
|
106
|
+
border-top-right-radius: 0;
|
|
107
|
+
border-bottom-right-radius: 0;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* iOS
|
|
112
|
+
*/
|
|
113
|
+
|
|
114
|
+
.TabbarItem--ios .TabbarItem__tappable {
|
|
115
|
+
width: 100%;
|
|
116
|
+
height: 100%;
|
|
117
|
+
top: 0;
|
|
118
|
+
left: 0;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
.TabbarItem--ios .TabbarItem__in {
|
|
122
|
+
transition: transform .07s var(--ios-easing);
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
.TabbarItem--ios .TabbarItem__tappable--active + .TabbarItem__in {
|
|
126
|
+
transform: scale(.96);
|
|
127
|
+
}
|
|
@@ -4,9 +4,15 @@ import Counter from '../Counter/Counter';
|
|
|
4
4
|
import { classNames } from '../../lib/classNames';
|
|
5
5
|
import { usePlatform } from '../../hooks/usePlatform';
|
|
6
6
|
import { hasReactNode } from '../../lib/utils';
|
|
7
|
+
import Tappable from '../Tappable/Tappable';
|
|
8
|
+
import { Platform } from '../../lib/platform';
|
|
9
|
+
import { HasComponent, HasRootRef } from '../../types';
|
|
7
10
|
import './TabbarItem.css';
|
|
8
11
|
|
|
9
|
-
export interface TabbarItemProps extends
|
|
12
|
+
export interface TabbarItemProps extends
|
|
13
|
+
Omit<React.AllHTMLAttributes<HTMLElement>, 'label'>, // TODO убрать Omit после удаления свойства label
|
|
14
|
+
HasRootRef<HTMLElement>,
|
|
15
|
+
HasComponent {
|
|
10
16
|
selected?: boolean;
|
|
11
17
|
/**
|
|
12
18
|
* Тест рядом с иконкой
|
|
@@ -22,31 +28,49 @@ export interface TabbarItemProps extends React.HTMLAttributes<HTMLElement>, Reac
|
|
|
22
28
|
label?: React.ReactNode;
|
|
23
29
|
}
|
|
24
30
|
|
|
25
|
-
const TabbarItem: React.FunctionComponent<TabbarItemProps> = (
|
|
26
|
-
|
|
31
|
+
const TabbarItem: React.FunctionComponent<TabbarItemProps> = ({
|
|
32
|
+
children,
|
|
33
|
+
selected,
|
|
34
|
+
label,
|
|
35
|
+
indicator,
|
|
36
|
+
text,
|
|
37
|
+
href,
|
|
38
|
+
Component = href ? 'a' : 'button',
|
|
39
|
+
disabled,
|
|
40
|
+
...restProps
|
|
41
|
+
}: TabbarItemProps) => {
|
|
27
42
|
const platform = usePlatform();
|
|
28
|
-
const Component: React.ElementType = restProps.href ? 'a' : 'div';
|
|
29
43
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
44
|
+
// @ts-ignore ругается на то, что у AllHTMLAttributes type это строка, а button не любую строку считает валидным значением
|
|
45
|
+
return (<Component
|
|
46
|
+
{...restProps}
|
|
47
|
+
disabled={disabled}
|
|
48
|
+
href={href}
|
|
49
|
+
vkuiClass={classNames(getClassName('TabbarItem', platform), {
|
|
50
|
+
'TabbarItem--selected': selected,
|
|
51
|
+
'TabbarItem--text': !!text,
|
|
52
|
+
})}
|
|
53
|
+
>
|
|
54
|
+
<Tappable
|
|
55
|
+
role="presentation"
|
|
56
|
+
Component="div"
|
|
57
|
+
disabled={disabled}
|
|
58
|
+
activeMode={platform === Platform.IOS ? 'TabbarItem__tappable--active' : 'background'}
|
|
59
|
+
activeEffectDelay={platform === Platform.IOS ? 0 : 300}
|
|
60
|
+
hasHover={false}
|
|
61
|
+
vkuiClass="TabbarItem__tappable"
|
|
62
|
+
/>
|
|
63
|
+
<div vkuiClass="TabbarItem__in">
|
|
64
|
+
<div vkuiClass="TabbarItem__icon">
|
|
65
|
+
{children}
|
|
66
|
+
<div vkuiClass="TabbarItem__label">
|
|
67
|
+
{hasReactNode(indicator) && indicator}
|
|
68
|
+
{!indicator && label && <Counter size="s" mode="prominent">{label}</Counter>}
|
|
45
69
|
</div>
|
|
46
|
-
{text && <div vkuiClass="TabbarItem__text">{text}</div>}
|
|
47
70
|
</div>
|
|
48
|
-
|
|
49
|
-
|
|
71
|
+
{text && <div vkuiClass="TabbarItem__text">{text}</div>}
|
|
72
|
+
</div>
|
|
73
|
+
</Component>);
|
|
50
74
|
};
|
|
51
75
|
|
|
52
76
|
export default TabbarItem;
|
|
@@ -8,7 +8,7 @@ import { getClassName } from '../../helpers/getClassName';
|
|
|
8
8
|
import { ANDROID } from '../../lib/platform';
|
|
9
9
|
import { getOffsetRect } from '../../lib/offset';
|
|
10
10
|
import { coordX, coordY } from '../../lib/touch';
|
|
11
|
-
import { HasRootRef } from '../../types';
|
|
11
|
+
import { HasComponent, HasRootRef } from '../../types';
|
|
12
12
|
import { withAdaptivity, AdaptivityProps } from '../../hoc/withAdaptivity';
|
|
13
13
|
import { shouldTriggerClickOnEnterOrSpace } from '../../lib/accessibility';
|
|
14
14
|
import { useIsomorphicLayoutEffect } from '../../lib/useIsomorphicLayoutEffect';
|
|
@@ -18,8 +18,7 @@ import { useExternRef } from '../../hooks/useExternRef';
|
|
|
18
18
|
import { usePlatform } from '../../hooks/usePlatform';
|
|
19
19
|
import './Tappable.css';
|
|
20
20
|
|
|
21
|
-
export interface TappableProps extends React.AllHTMLAttributes<HTMLElement>, HasRootRef<HTMLElement>, AdaptivityProps {
|
|
22
|
-
Component?: React.ElementType;
|
|
21
|
+
export interface TappableProps extends React.AllHTMLAttributes<HTMLElement>, HasRootRef<HTMLElement>, AdaptivityProps, HasComponent {
|
|
23
22
|
/**
|
|
24
23
|
* Длительность показа active-состояния
|
|
25
24
|
*/
|
|
@@ -10,6 +10,9 @@
|
|
|
10
10
|
<FormItem top="Любимая музыка">
|
|
11
11
|
<Textarea placeholder="Группы, исполнители, продюсеры" />
|
|
12
12
|
</FormItem>
|
|
13
|
+
<FormItem top="Увлечения">
|
|
14
|
+
<Textarea cols={4} placeholder="Музыка, спорт" defaultValue="Музыка\nСпорт\nФотография\nПлавание\nПрограммирование" />
|
|
15
|
+
</FormItem>
|
|
13
16
|
<FormItem top="Прикидываемся Input">
|
|
14
17
|
<Textarea rows={1} placeholder="Once upon a time" />
|
|
15
18
|
</FormItem>
|
|
@@ -7,7 +7,6 @@ import { getClassName } from '../../helpers/getClassName';
|
|
|
7
7
|
import { useEnsuredControl } from '../../hooks/useEnsuredControl';
|
|
8
8
|
import { useExternRef } from '../../hooks/useExternRef';
|
|
9
9
|
import { usePlatform } from '../../hooks/usePlatform';
|
|
10
|
-
import { useIsomorphicLayoutEffect } from '../../lib/useIsomorphicLayoutEffect';
|
|
11
10
|
import './Textarea.css';
|
|
12
11
|
|
|
13
12
|
export interface TextareaProps extends
|
|
@@ -33,19 +32,24 @@ const Textarea: React.FC<TextareaProps> = React.memo(({
|
|
|
33
32
|
...restProps
|
|
34
33
|
}: TextareaProps) => {
|
|
35
34
|
const [value, onChange] = useEnsuredControl(restProps, { defaultValue });
|
|
35
|
+
const currentScrollHeight = React.useRef<number>();
|
|
36
36
|
const elementRef = useExternRef(getRef);
|
|
37
37
|
const platform = usePlatform();
|
|
38
38
|
|
|
39
39
|
// autosize input
|
|
40
|
-
|
|
40
|
+
React.useEffect(() => {
|
|
41
41
|
const el = elementRef.current;
|
|
42
|
-
|
|
42
|
+
|
|
43
|
+
if (grow && el.offsetParent) {
|
|
43
44
|
el.style.height = null;
|
|
44
45
|
el.style.height = `${el.scrollHeight}px`;
|
|
45
|
-
|
|
46
|
-
|
|
46
|
+
|
|
47
|
+
if (el.scrollHeight !== currentScrollHeight.current && onResize) {
|
|
48
|
+
onResize(el);
|
|
49
|
+
currentScrollHeight.current = el.scrollHeight;
|
|
50
|
+
}
|
|
47
51
|
}
|
|
48
|
-
}, [grow, value]);
|
|
52
|
+
}, [grow, value, sizeY]);
|
|
49
53
|
|
|
50
54
|
return (
|
|
51
55
|
<FormField
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { getSupportedEvents, coordX, coordY, touchEnabled, VKUITouchEvent } from '../../lib/touch';
|
|
3
|
-
import { HasRootRef } from '../../types';
|
|
3
|
+
import { HasComponent, HasRootRef } from '../../types';
|
|
4
4
|
import { useDOM } from '../../lib/dom';
|
|
5
5
|
import { useExternRef } from '../../hooks/useExternRef';
|
|
6
6
|
import { useEventListener } from '../../hooks/useEventListener';
|
|
7
7
|
import { useIsomorphicLayoutEffect } from '../../lib/useIsomorphicLayoutEffect';
|
|
8
8
|
|
|
9
|
-
export interface TouchProps extends React.AllHTMLAttributes<HTMLElement>, HasRootRef<HTMLElement
|
|
9
|
+
export interface TouchProps extends React.AllHTMLAttributes<HTMLElement>, HasRootRef<HTMLElement>, HasComponent {
|
|
10
10
|
/**
|
|
11
11
|
* Привязать onEnter и onLeave через pointer-events - работает на disabled-инпутах
|
|
12
12
|
*/
|
|
@@ -14,7 +14,6 @@ export interface TouchProps extends React.AllHTMLAttributes<HTMLElement>, HasRoo
|
|
|
14
14
|
useCapture?: boolean;
|
|
15
15
|
slideThreshold?: number;
|
|
16
16
|
noSlideClick?: boolean;
|
|
17
|
-
Component?: React.ElementType;
|
|
18
17
|
onEnter?: HoverHandler;
|
|
19
18
|
onLeave?: HoverHandler;
|
|
20
19
|
onStart?: TouchEventHandler;
|
|
@@ -30,20 +29,20 @@ export interface TouchProps extends React.AllHTMLAttributes<HTMLElement>, HasRoo
|
|
|
30
29
|
}
|
|
31
30
|
|
|
32
31
|
export interface Gesture {
|
|
33
|
-
startX
|
|
34
|
-
startY
|
|
35
|
-
startT
|
|
36
|
-
duration
|
|
37
|
-
isPressed
|
|
38
|
-
isY
|
|
39
|
-
isX
|
|
40
|
-
isSlideX
|
|
41
|
-
isSlideY
|
|
42
|
-
isSlide
|
|
43
|
-
shiftX
|
|
44
|
-
shiftY
|
|
45
|
-
shiftXAbs
|
|
46
|
-
shiftYAbs
|
|
32
|
+
startX: number;
|
|
33
|
+
startY: number;
|
|
34
|
+
startT: Date;
|
|
35
|
+
duration: number;
|
|
36
|
+
isPressed: boolean;
|
|
37
|
+
isY: boolean;
|
|
38
|
+
isX: boolean;
|
|
39
|
+
isSlideX: boolean;
|
|
40
|
+
isSlideY: boolean;
|
|
41
|
+
isSlide: boolean;
|
|
42
|
+
shiftX: number;
|
|
43
|
+
shiftY: number;
|
|
44
|
+
shiftXAbs: number;
|
|
45
|
+
shiftYAbs: number;
|
|
47
46
|
}
|
|
48
47
|
|
|
49
48
|
export interface TouchEvent extends Gesture {
|
|
@@ -80,24 +79,19 @@ export const Touch: React.FC<TouchProps> = ({
|
|
|
80
79
|
const { document } = useDOM();
|
|
81
80
|
const events = React.useMemo(getSupportedEvents, []);
|
|
82
81
|
const didSlide = React.useRef(false);
|
|
83
|
-
const gesture = React.useRef<Partial<Gesture>>(
|
|
82
|
+
const gesture = React.useRef<Partial<Gesture>>(null);
|
|
84
83
|
const handle = (e: VKUITouchEvent, handers: TouchEventHandler[]) => {
|
|
85
84
|
stopPropagation && e.stopPropagation();
|
|
86
85
|
handers.forEach((cb) => {
|
|
87
86
|
const duration = Date.now() - gesture.current.startT.getTime();
|
|
88
|
-
cb && cb({ ...gesture.current, duration, originalEvent: e });
|
|
87
|
+
cb && cb({ ...gesture.current as Gesture, duration, originalEvent: e });
|
|
89
88
|
});
|
|
90
89
|
};
|
|
91
90
|
|
|
92
91
|
const enterHandler = useEventListener(usePointerHover ? 'pointerenter' : 'mouseenter', onEnter);
|
|
93
92
|
const leaveHandler = useEventListener(usePointerHover ? 'pointerleave' : 'mouseleave', onLeave);
|
|
94
93
|
const startHandler = useEventListener(events[0], (e: VKUITouchEvent) => {
|
|
95
|
-
gesture.current =
|
|
96
|
-
startX: coordX(e),
|
|
97
|
-
startY: coordY(e),
|
|
98
|
-
startT: new Date(),
|
|
99
|
-
isPressed: true,
|
|
100
|
-
};
|
|
94
|
+
gesture.current = initGesture(coordX(e), coordY(e));
|
|
101
95
|
|
|
102
96
|
handle(e, [onStart, onStartX, onStartY]);
|
|
103
97
|
// 1 line, 2 bad specs, 2 workarounds:
|
|
@@ -232,3 +226,22 @@ export const Touch: React.FC<TouchProps> = ({
|
|
|
232
226
|
/>
|
|
233
227
|
);
|
|
234
228
|
};
|
|
229
|
+
|
|
230
|
+
function initGesture(startX: number, startY: number): Gesture {
|
|
231
|
+
return {
|
|
232
|
+
startX,
|
|
233
|
+
startY,
|
|
234
|
+
startT: new Date(),
|
|
235
|
+
duration: 0,
|
|
236
|
+
isPressed: true,
|
|
237
|
+
isY: false,
|
|
238
|
+
isX: false,
|
|
239
|
+
isSlideX: false,
|
|
240
|
+
isSlideY: false,
|
|
241
|
+
isSlide: false,
|
|
242
|
+
shiftX: 0,
|
|
243
|
+
shiftY: 0,
|
|
244
|
+
shiftXAbs: 0,
|
|
245
|
+
shiftYAbs: 0,
|
|
246
|
+
};
|
|
247
|
+
}
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
+
import { HasComponent } from '../../../types';
|
|
2
3
|
import { usePlatform } from '../../../hooks/usePlatform';
|
|
3
4
|
import { classNames } from '../../../lib/classNames';
|
|
4
5
|
import { getClassName } from '../../../helpers/getClassName';
|
|
5
6
|
import './Caption.css';
|
|
6
7
|
|
|
7
|
-
export interface CaptionProps extends React.AllHTMLAttributes<HTMLElement
|
|
8
|
+
export interface CaptionProps extends React.AllHTMLAttributes<HTMLElement>, HasComponent {
|
|
8
9
|
weight: 'regular' | 'medium' | 'semibold' | 'bold';
|
|
9
10
|
level: '1' | '2' | '3' | '4';
|
|
10
11
|
caps?: boolean;
|
|
11
|
-
Component?: React.ElementType;
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
const Caption: React.FC<CaptionProps> = ({
|
|
15
15
|
children,
|
|
16
|
-
weight,
|
|
17
|
-
level,
|
|
16
|
+
weight = 'regular',
|
|
17
|
+
level = '1',
|
|
18
18
|
caps,
|
|
19
19
|
Component = 'span',
|
|
20
20
|
...restProps
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
+
import { HasComponent } from '../../../types';
|
|
2
3
|
import { usePlatform } from '../../../hooks/usePlatform';
|
|
3
4
|
import { classNames } from '../../../lib/classNames';
|
|
4
5
|
import { getClassName } from '../../../helpers/getClassName';
|
|
5
6
|
import './Headline.css';
|
|
6
7
|
|
|
7
|
-
export interface HeadlineProps extends React.AllHTMLAttributes<HTMLElement
|
|
8
|
+
export interface HeadlineProps extends React.AllHTMLAttributes<HTMLElement>, HasComponent {
|
|
8
9
|
weight: 'regular' | 'medium' | 'semibold';
|
|
9
|
-
Component?: React.ElementType;
|
|
10
10
|
}
|
|
11
11
|
|
|
12
12
|
const Headline: React.FC<HeadlineProps> = ({
|
|
13
13
|
children,
|
|
14
|
-
weight,
|
|
14
|
+
weight = 'regular',
|
|
15
15
|
Component = 'h3',
|
|
16
16
|
...restProps
|
|
17
17
|
}: HeadlineProps) => {
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
+
import { HasComponent } from '../../../types';
|
|
2
3
|
import { usePlatform } from '../../../hooks/usePlatform';
|
|
3
4
|
import { classNames } from '../../../lib/classNames';
|
|
4
5
|
import { getClassName } from '../../../helpers/getClassName';
|
|
5
6
|
import './Subhead.css';
|
|
6
7
|
|
|
7
|
-
export interface SubheadProps extends React.AllHTMLAttributes<HTMLElement
|
|
8
|
+
export interface SubheadProps extends React.AllHTMLAttributes<HTMLElement>, HasComponent {
|
|
8
9
|
weight: 'regular' | 'medium' | 'semibold' | 'bold';
|
|
9
|
-
Component?: React.ElementType;
|
|
10
10
|
}
|
|
11
11
|
|
|
12
12
|
const Subhead: React.FC<SubheadProps> = ({
|
|
13
13
|
children,
|
|
14
|
-
weight,
|
|
14
|
+
weight = 'regular',
|
|
15
15
|
Component = 'h4',
|
|
16
16
|
...restProps
|
|
17
17
|
}: SubheadProps) => {
|
|
@@ -2,19 +2,18 @@ import * as React from 'react';
|
|
|
2
2
|
import { usePlatform } from '../../../hooks/usePlatform';
|
|
3
3
|
import { classNames } from '../../../lib/classNames';
|
|
4
4
|
import { getClassName } from '../../../helpers/getClassName';
|
|
5
|
-
import { HasRootRef } from '../../../types';
|
|
5
|
+
import { HasComponent, HasRootRef } from '../../../types';
|
|
6
6
|
import { warnOnce } from '../../../lib/warnOnce';
|
|
7
7
|
import './Text.css';
|
|
8
8
|
|
|
9
|
-
export interface TextProps extends React.AllHTMLAttributes<HTMLElement>, HasRootRef<
|
|
9
|
+
export interface TextProps extends React.AllHTMLAttributes<HTMLElement>, HasRootRef<HTMLElement>, HasComponent {
|
|
10
10
|
weight: 'regular' | 'medium' | 'semibold';
|
|
11
|
-
Component?: React.ElementType;
|
|
12
11
|
}
|
|
13
12
|
|
|
14
13
|
const warn = warnOnce('Text');
|
|
15
14
|
const Text: React.FC<TextProps> = ({
|
|
16
15
|
children,
|
|
17
|
-
weight,
|
|
16
|
+
weight = 'regular',
|
|
18
17
|
Component = 'span',
|
|
19
18
|
getRootRef,
|
|
20
19
|
...restProps
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
+
import { HasComponent } from '../../../types';
|
|
2
3
|
import { usePlatform } from '../../../hooks/usePlatform';
|
|
3
4
|
import { classNames } from '../../../lib/classNames';
|
|
4
5
|
import { getClassName } from '../../../helpers/getClassName';
|
|
@@ -6,21 +7,24 @@ import { ANDROID } from '../../../lib/platform';
|
|
|
6
7
|
import Headline, { HeadlineProps } from '../Headline/Headline';
|
|
7
8
|
import './Title.css';
|
|
8
9
|
|
|
9
|
-
export interface TitleProps extends React.AllHTMLAttributes<HTMLElement
|
|
10
|
+
export interface TitleProps extends React.AllHTMLAttributes<HTMLElement>, HasComponent {
|
|
10
11
|
weight: 'heavy' | 'bold' | 'semibold' | 'medium' | 'regular';
|
|
11
12
|
level: '1' | '2' | '3';
|
|
12
|
-
Component?: React.ElementType;
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
const Title: React.FC<TitleProps> = ({
|
|
16
16
|
children,
|
|
17
|
-
weight,
|
|
18
|
-
level,
|
|
19
|
-
Component
|
|
17
|
+
weight = 'regular',
|
|
18
|
+
level = '1',
|
|
19
|
+
Component,
|
|
20
20
|
...restProps
|
|
21
21
|
}: TitleProps) => {
|
|
22
22
|
const platform = usePlatform();
|
|
23
23
|
|
|
24
|
+
if (!Component) {
|
|
25
|
+
Component = ('h' + level) as React.ElementType;
|
|
26
|
+
}
|
|
27
|
+
|
|
24
28
|
if (platform === ANDROID && level === '3') {
|
|
25
29
|
const headlineWeight: HeadlineProps['weight'] = weight === 'regular' ? weight : 'medium';
|
|
26
30
|
|
|
@@ -46,66 +46,52 @@ const [activePanel, setActivePanel] = useState('panel1');
|
|
|
46
46
|
В iOS есть возможность свайпнуть от левого края назад, чтобы перейти на предыдущую панель. Для того, чтобы
|
|
47
47
|
повторить такое поведение в VKUI нужно:
|
|
48
48
|
|
|
49
|
-
- Передать во `View`
|
|
50
|
-
|
|
51
|
-
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
- Убедиться, что приложение открыто внутри webview (так как внутри обычного мобильного браузера
|
|
55
|
-
как правило есть свой swipe back). Для этого достаточно обернуть ваше приложение компонентом `ConfigProvider`.
|
|
56
|
-
Он внутри себя определяет, открыто приложение внутри webview или в мобильном браузере. Для тестов в браузере
|
|
57
|
-
можно явно передать в `СonfigProvider` свойство `isWebView={true}`.
|
|
58
|
-
- При попадании на первую панель слать `vk-bridge` событие `VKWebAppEnableSwipeBack`. При уходе с первой панели –
|
|
59
|
-
слать `VKWebAppDisableSwipeBack`. Таким образом VKUI свайп не будет конфликтовать со свайпом нативного клиента.
|
|
49
|
+
- Передать во `View` коллбек `onSwipeBack` — он сработает при завершении анимации свайпа. Поменяйте в нем `activePanel` и обновите `history`.
|
|
50
|
+
- Передать во `View` проп `history` — массив из id панелей в порядке открытия. Например, если пользователь из `main` перешел в `profile`, а оттуда попал в `education`, то `history=['main', 'profile', 'education']`.
|
|
51
|
+
- Обернуть ваше приложение в `ConfigProvider` — он определит, открыто приложение в webview клиента VK или в браузере (там есть свой swipe back, который будет конфликтовать с нашим). Для проверки в браузере форсируйте определение webview: `<СonfigProvider isWebView>`.
|
|
52
|
+
- На первой панели должен включаться свайпбек нативного клиента, чтобы пользователь смог выйти из приложения — для этого используют `vk-bridge`. __Если вы не из ВК,__ при переходах отправляйте [событие `VKWebAppSetSwipeSettings`](https://vk.com/dev.php?method=vk_bridge_events_10&f=Включение%20swipe%20как%20в%20браузере) с `history: true` на первой панели или `history: false` на других. __Если вы из ВК,__ при переходе на первую панель отправляйте событие `VKWebAppEnableSwipeBack`, на любую другую — `VKWebAppDisableSwipeBack`.
|
|
53
|
+
- Компоненты, которые сами обрабатывают жесты (например, карта), могут конфликтовать со свайпбеком — повесьте на них свойство `data-vkui-swipe-back={false}`
|
|
60
54
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
```jsx static
|
|
64
|
-
import React from 'react';
|
|
65
|
-
import { View, Panel, ConfigProvider } from '@vkontakte/vkui';
|
|
55
|
+
```jsx
|
|
66
56
|
import vkBridge from '@vkontakte/vk-bridge';
|
|
67
57
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
activePanel: 'main',
|
|
72
|
-
history: ['main']
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
goBack = () => {
|
|
76
|
-
const history = [...this.state.history];
|
|
77
|
-
history.pop();
|
|
78
|
-
const activePanel = history[history.length - 1];
|
|
79
|
-
if (activePanel === 'main') {
|
|
80
|
-
vkBridge.send('VKWebAppEnableSwipeBack');
|
|
81
|
-
}
|
|
82
|
-
this.setState({ history, activePanel });
|
|
83
|
-
}
|
|
58
|
+
const [history, setHistory] = useState(['main']);
|
|
59
|
+
const activePanel = history[history.length - 1];
|
|
60
|
+
const isFirst = history.length === 1;
|
|
84
61
|
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
62
|
+
React.useEffect(() => {
|
|
63
|
+
// Если вы из ВК, делайте так
|
|
64
|
+
vkBridge.send(isFirst
|
|
65
|
+
? 'VKWebAppEnableSwipeBack'
|
|
66
|
+
: 'VKWebAppDisableSwipeBack');
|
|
67
|
+
// Если вы не из ВК, то так:
|
|
68
|
+
vkBridge.send('VKWebAppSetSwipeSettings', { history: isFirst });
|
|
69
|
+
}, [isFirst]);
|
|
93
70
|
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
<ConfigProvider isWebView={true}>
|
|
97
|
-
<View
|
|
98
|
-
onSwipeBack={this.goBack}
|
|
99
|
-
history={this.state.history}
|
|
100
|
-
activePanel={this.state.activePanel}
|
|
101
|
-
>
|
|
102
|
-
<Panel id="main"/>
|
|
103
|
-
<Panel id="profile"/>
|
|
104
|
-
<Panel id="education"/>
|
|
105
|
-
</View>
|
|
106
|
-
</ConfigProvider>
|
|
107
|
-
)
|
|
108
|
-
}
|
|
109
|
-
}
|
|
71
|
+
const goBack = () => setHistory(history.slice(0, -1));
|
|
72
|
+
const go = (panel) => setHistory([...history, panel]);
|
|
110
73
|
|
|
74
|
+
<ConfigProvider platform={IOS} isWebView>
|
|
75
|
+
<View
|
|
76
|
+
onSwipeBack={goBack}
|
|
77
|
+
history={history}
|
|
78
|
+
activePanel={activePanel}
|
|
79
|
+
>
|
|
80
|
+
<Panel id="main">
|
|
81
|
+
<PanelHeader>Main</PanelHeader>
|
|
82
|
+
<Group>
|
|
83
|
+
<CellButton onClick={() => go('profile')}>profile</CellButton>
|
|
84
|
+
</Group>
|
|
85
|
+
</Panel>
|
|
86
|
+
<Panel id="profile">
|
|
87
|
+
<PanelHeader>Профиль</PanelHeader>
|
|
88
|
+
<Group>
|
|
89
|
+
<Placeholder>Теперь свайпните от левого края направо, чтобы вернуться</Placeholder>
|
|
90
|
+
<Div style={{ height: 50, background: '#eee' }} data-vkui-swipe-back={false}>
|
|
91
|
+
Здесь свайпбек отключен
|
|
92
|
+
</Div>
|
|
93
|
+
</Group>
|
|
94
|
+
</Panel>
|
|
95
|
+
</View>
|
|
96
|
+
</ConfigProvider>
|
|
111
97
|
```
|