@gravity-ui/navigation 2.30.0 → 2.31.1-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/build/cjs/{ActionBar-3c6cdf57.js → ActionBar-_qjZ9IMA.js} +10 -14
- package/build/cjs/{ActionBar-3c6cdf57.js.map → ActionBar-_qjZ9IMA.js.map} +1 -1
- package/build/cjs/AsideFallback.js +10 -16
- package/build/cjs/AsideFallback.js.map +1 -1
- package/build/cjs/AsideHeader.js +15 -20
- package/build/cjs/AsideHeader.js.map +1 -1
- package/build/cjs/AsideHeaderContext.js +4 -10
- package/build/cjs/AsideHeaderContext.js.map +1 -1
- package/build/cjs/Content-Dy2XkiRi.js +16 -0
- package/build/cjs/{Content-64d5738a.js.map → Content-Dy2XkiRi.js.map} +1 -1
- package/build/cjs/Drawer.js +122 -823
- package/build/cjs/Drawer.js.map +1 -1
- package/build/cjs/{FooterItem-de603636.js → FooterItem-Bl_XrJ67.js} +77 -81
- package/build/cjs/FooterItem-Bl_XrJ67.js.map +1 -0
- package/build/cjs/FooterItem.js +8 -13
- package/build/cjs/FooterItem.js.map +1 -1
- package/build/cjs/{HotkeysPanel-1ed9fc32.js → HotkeysPanel-D1wI7tZj.js} +12 -16
- package/build/cjs/{HotkeysPanel-1ed9fc32.js.map → HotkeysPanel-D1wI7tZj.js.map} +1 -1
- package/build/cjs/Item-B_-IH1_h.js +295 -0
- package/build/cjs/Item-B_-IH1_h.js.map +1 -0
- package/build/cjs/PageLayout.js +13 -19
- package/build/cjs/PageLayout.js.map +1 -1
- package/build/cjs/{PageLayoutAside-4daccf5e.js → PageLayoutAside-BzYF9W7M.js} +102 -117
- package/build/cjs/PageLayoutAside-BzYF9W7M.js.map +1 -0
- package/build/cjs/PageLayoutAside.js +10 -11
- package/build/cjs/PageLayoutAside.js.map +1 -1
- package/build/cjs/{Settings-8dc2a8ee.js → Settings-D6-a2hgE.js} +110 -102
- package/build/cjs/{Settings-8dc2a8ee.js.map → Settings-D6-a2hgE.js.map} +1 -1
- package/build/cjs/{Title-54580605.js → Title-CzxcSMoP.js} +7 -13
- package/build/cjs/Title-CzxcSMoP.js.map +1 -0
- package/build/cjs/_commonjsHelpers-BJu3ubxk.js +11 -0
- package/build/cjs/_commonjsHelpers-BJu3ubxk.js.map +1 -0
- package/build/cjs/{cn-9933321a.js → cn-DSlPZbcs.js} +1 -1
- package/build/cjs/{cn-9933321a.js.map → cn-DSlPZbcs.js.map} +1 -1
- package/build/cjs/components/ActionBar/ActionBar.d.ts +3 -3
- package/build/cjs/components/ActionBar/__stories__/ActionBar.stories.d.ts +17 -0
- package/build/cjs/components/ActionBar/__stories__/ActionBarShowcase.d.ts +2 -0
- package/build/cjs/components/ActionBar/__stories__/ActionBarSingleSection.d.ts +2 -0
- package/build/cjs/components/ActionBar/__tests__/helpersPlaywright.d.ts +1 -1
- package/build/cjs/components/ActionBar/types.d.ts +1 -1
- package/build/cjs/components/AllPagesPanel/i18n/index.d.ts +5 -1
- package/build/cjs/components/AsideHeader/AsideHeaderContext.d.ts +1 -1
- package/build/cjs/components/AsideHeader/__stories__/AsideHeader.stories.d.ts +18 -0
- package/build/cjs/components/AsideHeader/__stories__/AsideHeaderShowcase.d.ts +14 -0
- package/build/cjs/components/AsideHeader/__stories__/getAsideHeaderWrapper.d.ts +3 -0
- package/build/cjs/components/AsideHeader/__stories__/moc.d.ts +6 -0
- package/build/cjs/components/AsideHeader/__tests__/helpersPlaywright.d.ts +1 -1
- package/build/cjs/components/AsideHeader/components/index.d.ts +0 -1
- package/build/cjs/components/AsideHeader/i18n/index.d.ts +5 -1
- package/build/cjs/components/AsideHeader/types.d.ts +3 -4
- package/build/cjs/components/CompositeBar/CompositeBar.d.ts +1 -1
- package/build/cjs/components/CompositeBar/HighlightedItem/HighlightedItem.d.ts +1 -1
- package/build/cjs/components/CompositeBar/Item/Item.d.ts +15 -2
- package/build/cjs/components/Drawer/__stories__/DisablePortal.d.ts +3 -0
- package/build/cjs/components/Drawer/__stories__/Drawer.stories.d.ts +7 -0
- package/build/cjs/components/Drawer/__stories__/DrawerShowcase.d.ts +3 -0
- package/build/cjs/components/Drawer/__stories__/HideVeil.d.ts +3 -0
- package/build/cjs/components/Drawer/__stories__/ResizableItem.d.ts +3 -0
- package/build/cjs/components/Drawer/__stories__/moc.d.ts +2 -0
- package/build/cjs/components/Drawer/__tests__/helpersPlaywright.d.ts +1 -1
- package/build/cjs/components/Drawer/utils.d.ts +2 -2
- package/build/cjs/components/Footer/desktop/__stories__/Footer.stories.d.ts +8 -0
- package/build/cjs/components/Footer/desktop/__stories__/FooterShowcase.d.ts +4 -0
- package/build/cjs/components/Footer/desktop/__stories__/moc.d.ts +3 -0
- package/build/cjs/components/Footer/desktop/__tests__/helpersPlaywright.d.ts +1 -1
- package/build/cjs/components/Footer/mobile/__stories__/MobileFooter.stories.d.ts +8 -0
- package/build/cjs/components/Footer/mobile/__stories__/MobileFooterShowcase.d.ts +4 -0
- package/build/cjs/components/Footer/mobile/__stories__/moc.d.ts +3 -0
- package/build/cjs/components/Footer/mobile/__tests__/helpersPlaywright.d.ts +1 -1
- package/build/cjs/components/FooterItem/__stories__/FooterItem.stories.d.ts +6 -0
- package/build/cjs/components/FooterItem/__tests__/helpersPlaywright.d.ts +1 -1
- package/build/cjs/components/HotkeysPanel/__stories__/HotkeysPanel.stories.d.ts +5 -0
- package/build/cjs/components/HotkeysPanel/__stories__/HotkeysPanelShowcase.d.ts +6 -0
- package/build/cjs/components/HotkeysPanel/__stories__/moc.d.ts +2 -0
- package/build/cjs/components/HotkeysPanel/__tests__/helpersPlaywright.d.ts +1 -1
- package/build/cjs/components/Logo/Logo.d.ts +1 -1
- package/build/cjs/components/Logo/__stories__/Logo.stories.d.ts +6 -0
- package/build/cjs/components/Logo/__tests__/helpersPlaywright.d.ts +1 -1
- package/build/cjs/components/MobileHeader/BurgerMenu/__stories__/BurgerMenu.stories.d.ts +6 -0
- package/build/cjs/components/MobileHeader/BurgerMenu/__stories__/moc.d.ts +2 -0
- package/build/cjs/components/MobileHeader/BurgerMenu/__tests__/helpersPlaywright.d.ts +1 -1
- package/build/cjs/components/MobileHeader/MobileHeader.d.ts +2 -1
- package/build/cjs/components/MobileHeader/OverlapPanel/__stories__/OverlapPanel.stories.d.ts +6 -0
- package/build/cjs/components/MobileHeader/OverlapPanel/__stories__/moc.d.ts +2 -0
- package/build/cjs/components/MobileHeader/OverlapPanel/__tests__/helpersPlaywright.d.ts +1 -1
- package/build/cjs/components/MobileHeader/__stories__/MobileHeader.stories.d.ts +4 -0
- package/build/cjs/components/MobileHeader/__stories__/MobileHeaderShowcase.d.ts +3 -0
- package/build/cjs/components/MobileHeader/__stories__/moc.d.ts +1 -0
- package/build/cjs/components/MobileHeader/__tests__/helpersPlaywright.d.ts +1 -1
- package/build/cjs/components/MobileHeader/i18n/index.d.ts +5 -1
- package/build/cjs/components/MobileHeader/types.d.ts +0 -1
- package/build/cjs/components/MobileLogo/__stories__/MobileLogo.stories.d.ts +6 -0
- package/build/cjs/components/MobileLogo/__tests__/helpersPlaywright.d.ts +1 -1
- package/build/cjs/components/Settings/__stories__/Settings.stories.d.ts +5 -0
- package/build/cjs/components/Settings/__stories__/SettingsDemo.d.ts +14 -0
- package/build/cjs/components/Settings/__stories__/SettingsMobileDemo.d.ts +8 -0
- package/build/cjs/components/Settings/__tests__/helpersPlaywright.d.ts +1 -1
- package/build/cjs/components/Settings/i18n/index.d.ts +5 -1
- package/build/cjs/components/Title/i18n/index.d.ts +5 -1
- package/build/cjs/components/TopAlert/TopAlert.d.ts +10 -0
- package/build/cjs/components/TopAlert/index.d.ts +1 -0
- package/build/cjs/components/TopAlert/useTopAlertHeight.d.ts +10 -0
- package/build/cjs/components/types.d.ts +4 -4
- package/build/cjs/{constants-d81c3867.js → constants-B0DLAQY9.js} +1 -1
- package/build/{esm/constants-b1604ff5.js.map → cjs/constants-B0DLAQY9.js.map} +1 -1
- package/build/cjs/debounce-RFF04eVR.js +660 -0
- package/build/{esm/debounce-64cd2b4c.js.map → cjs/debounce-RFF04eVR.js.map} +1 -1
- package/build/cjs/{divider-collapsed-b743122e.js → divider-collapsed-BLSp99lJ.js} +7 -9
- package/build/cjs/divider-collapsed-BLSp99lJ.js.map +1 -0
- package/build/cjs/hooks/useForwardRef.d.ts +1 -1
- package/build/cjs/index-B6c8DVdr.js +68 -0
- package/build/cjs/index-B6c8DVdr.js.map +1 -0
- package/build/cjs/index.js +4 -191
- package/build/cjs/index.js.map +1 -1
- package/build/cjs/index2.js +7 -6
- package/build/cjs/index2.js.map +1 -1
- package/build/cjs/index3.js +8 -8
- package/build/cjs/index4.js +12 -9
- package/build/cjs/index4.js.map +1 -1
- package/build/cjs/index5.js +12 -12
- package/build/cjs/index6.js +186 -15
- package/build/cjs/index6.js.map +1 -1
- package/build/cjs/{style-inject.es-dcee06b6.js → style-inject.es-CsU6UJbw.js} +2 -2
- package/build/cjs/style-inject.es-CsU6UJbw.js.map +1 -0
- package/build/cjs/{tslib.es6-705c6589.js → tslib.es6-D25eJ2i9.js} +33 -31
- package/build/cjs/tslib.es6-D25eJ2i9.js.map +1 -0
- package/build/cjs/utils-BrRoop7o.js +8 -0
- package/build/cjs/{utils-db3e03c2.js.map → utils-BrRoop7o.js.map} +1 -1
- package/build/esm/{ActionBar-834b178a.js → ActionBar-BD_roj92.js} +5 -5
- package/build/esm/{ActionBar-834b178a.js.map → ActionBar-BD_roj92.js.map} +1 -1
- package/build/esm/AsideFallback.js +5 -5
- package/build/esm/AsideFallback.js.map +1 -1
- package/build/esm/AsideHeader.js +11 -10
- package/build/esm/AsideHeader.js.map +1 -1
- package/build/esm/AsideHeaderContext.js.map +1 -1
- package/build/esm/{Content-f94ba85d.js → Content-c3e3OunO.js} +1 -1
- package/build/esm/{Content-f94ba85d.js.map → Content-c3e3OunO.js.map} +1 -1
- package/build/esm/Drawer.js +90 -784
- package/build/esm/Drawer.js.map +1 -1
- package/build/esm/{FooterItem-3cc816a3.js → FooterItem-BP7Ya02G.js} +43 -43
- package/build/esm/FooterItem-BP7Ya02G.js.map +1 -0
- package/build/esm/FooterItem.js +7 -6
- package/build/esm/FooterItem.js.map +1 -1
- package/build/esm/{HotkeysPanel-0576deee.js → HotkeysPanel-BiJ8VcX-.js} +4 -4
- package/build/esm/{HotkeysPanel-0576deee.js.map → HotkeysPanel-BiJ8VcX-.js.map} +1 -1
- package/build/esm/{Item-4d168c1c.js → Item-BnjbUb88.js} +40 -44
- package/build/esm/Item-BnjbUb88.js.map +1 -0
- package/build/esm/PageLayout.js +8 -8
- package/build/esm/PageLayout.js.map +1 -1
- package/build/esm/{PageLayoutAside-beb0d6bf.js → PageLayoutAside-DQVfkCeA.js} +45 -56
- package/build/esm/PageLayoutAside-DQVfkCeA.js.map +1 -0
- package/build/esm/PageLayoutAside.js +10 -9
- package/build/esm/PageLayoutAside.js.map +1 -1
- package/build/esm/{Settings-e660a4c5.js → Settings-BPE0n6i2.js} +36 -24
- package/build/esm/{Settings-e660a4c5.js.map → Settings-BPE0n6i2.js.map} +1 -1
- package/build/esm/{Title-03b4255a.js → Title-CRlzgg4r.js} +4 -6
- package/build/esm/Title-CRlzgg4r.js.map +1 -0
- package/build/esm/_commonjsHelpers-BFTU3MAI.js +8 -0
- package/build/esm/_commonjsHelpers-BFTU3MAI.js.map +1 -0
- package/build/esm/{cn-ffe5e9f5.js → cn-CgiqTV3v.js} +1 -1
- package/build/esm/{cn-ffe5e9f5.js.map → cn-CgiqTV3v.js.map} +1 -1
- package/build/esm/components/ActionBar/ActionBar.d.ts +3 -3
- package/build/esm/components/ActionBar/__stories__/ActionBar.stories.d.ts +17 -0
- package/build/esm/components/ActionBar/__stories__/ActionBarShowcase.d.ts +2 -0
- package/build/esm/components/ActionBar/__stories__/ActionBarSingleSection.d.ts +2 -0
- package/build/esm/components/ActionBar/__tests__/helpersPlaywright.d.ts +1 -1
- package/build/esm/components/ActionBar/types.d.ts +1 -1
- package/build/esm/components/AllPagesPanel/i18n/index.d.ts +5 -1
- package/build/esm/components/AsideHeader/AsideHeaderContext.d.ts +1 -1
- package/build/esm/components/AsideHeader/__stories__/AsideHeader.stories.d.ts +18 -0
- package/build/esm/components/AsideHeader/__stories__/AsideHeaderShowcase.d.ts +14 -0
- package/build/esm/components/AsideHeader/__stories__/getAsideHeaderWrapper.d.ts +3 -0
- package/build/esm/components/AsideHeader/__stories__/moc.d.ts +6 -0
- package/build/esm/components/AsideHeader/__tests__/helpersPlaywright.d.ts +1 -1
- package/build/esm/components/AsideHeader/components/index.d.ts +0 -1
- package/build/esm/components/AsideHeader/i18n/index.d.ts +5 -1
- package/build/esm/components/AsideHeader/types.d.ts +3 -4
- package/build/esm/components/CompositeBar/CompositeBar.d.ts +1 -1
- package/build/esm/components/CompositeBar/HighlightedItem/HighlightedItem.d.ts +1 -1
- package/build/esm/components/CompositeBar/Item/Item.d.ts +15 -2
- package/build/esm/components/Drawer/__stories__/DisablePortal.d.ts +3 -0
- package/build/esm/components/Drawer/__stories__/Drawer.stories.d.ts +7 -0
- package/build/esm/components/Drawer/__stories__/DrawerShowcase.d.ts +3 -0
- package/build/esm/components/Drawer/__stories__/HideVeil.d.ts +3 -0
- package/build/esm/components/Drawer/__stories__/ResizableItem.d.ts +3 -0
- package/build/esm/components/Drawer/__stories__/moc.d.ts +2 -0
- package/build/esm/components/Drawer/__tests__/helpersPlaywright.d.ts +1 -1
- package/build/esm/components/Drawer/utils.d.ts +2 -2
- package/build/esm/components/Footer/desktop/__stories__/Footer.stories.d.ts +8 -0
- package/build/esm/components/Footer/desktop/__stories__/FooterShowcase.d.ts +4 -0
- package/build/esm/components/Footer/desktop/__stories__/moc.d.ts +3 -0
- package/build/esm/components/Footer/desktop/__tests__/helpersPlaywright.d.ts +1 -1
- package/build/esm/components/Footer/mobile/__stories__/MobileFooter.stories.d.ts +8 -0
- package/build/esm/components/Footer/mobile/__stories__/MobileFooterShowcase.d.ts +4 -0
- package/build/esm/components/Footer/mobile/__stories__/moc.d.ts +3 -0
- package/build/esm/components/Footer/mobile/__tests__/helpersPlaywright.d.ts +1 -1
- package/build/esm/components/FooterItem/__stories__/FooterItem.stories.d.ts +6 -0
- package/build/esm/components/FooterItem/__tests__/helpersPlaywright.d.ts +1 -1
- package/build/esm/components/HotkeysPanel/__stories__/HotkeysPanel.stories.d.ts +5 -0
- package/build/esm/components/HotkeysPanel/__stories__/HotkeysPanelShowcase.d.ts +6 -0
- package/build/esm/components/HotkeysPanel/__stories__/moc.d.ts +2 -0
- package/build/esm/components/HotkeysPanel/__tests__/helpersPlaywright.d.ts +1 -1
- package/build/esm/components/Logo/Logo.d.ts +1 -1
- package/build/esm/components/Logo/__stories__/Logo.stories.d.ts +6 -0
- package/build/esm/components/Logo/__tests__/helpersPlaywright.d.ts +1 -1
- package/build/esm/components/MobileHeader/BurgerMenu/__stories__/BurgerMenu.stories.d.ts +6 -0
- package/build/esm/components/MobileHeader/BurgerMenu/__stories__/moc.d.ts +2 -0
- package/build/esm/components/MobileHeader/BurgerMenu/__tests__/helpersPlaywright.d.ts +1 -1
- package/build/esm/components/MobileHeader/MobileHeader.d.ts +2 -1
- package/build/esm/components/MobileHeader/OverlapPanel/__stories__/OverlapPanel.stories.d.ts +6 -0
- package/build/esm/components/MobileHeader/OverlapPanel/__stories__/moc.d.ts +2 -0
- package/build/esm/components/MobileHeader/OverlapPanel/__tests__/helpersPlaywright.d.ts +1 -1
- package/build/esm/components/MobileHeader/__stories__/MobileHeader.stories.d.ts +4 -0
- package/build/esm/components/MobileHeader/__stories__/MobileHeaderShowcase.d.ts +3 -0
- package/build/esm/components/MobileHeader/__stories__/moc.d.ts +1 -0
- package/build/esm/components/MobileHeader/__tests__/helpersPlaywright.d.ts +1 -1
- package/build/esm/components/MobileHeader/i18n/index.d.ts +5 -1
- package/build/esm/components/MobileHeader/types.d.ts +0 -1
- package/build/esm/components/MobileLogo/__stories__/MobileLogo.stories.d.ts +6 -0
- package/build/esm/components/MobileLogo/__tests__/helpersPlaywright.d.ts +1 -1
- package/build/esm/components/Settings/__stories__/Settings.stories.d.ts +5 -0
- package/build/esm/components/Settings/__stories__/SettingsDemo.d.ts +14 -0
- package/build/esm/components/Settings/__stories__/SettingsMobileDemo.d.ts +8 -0
- package/build/esm/components/Settings/__tests__/helpersPlaywright.d.ts +1 -1
- package/build/esm/components/Settings/i18n/index.d.ts +5 -1
- package/build/esm/components/Title/i18n/index.d.ts +5 -1
- package/build/esm/components/TopAlert/TopAlert.d.ts +10 -0
- package/build/esm/components/TopAlert/index.d.ts +1 -0
- package/build/esm/components/TopAlert/useTopAlertHeight.d.ts +10 -0
- package/build/esm/components/types.d.ts +4 -4
- package/build/esm/{constants-b1604ff5.js → constants-ChYDZ5F2.js} +2 -2
- package/build/{cjs/constants-d81c3867.js.map → esm/constants-ChYDZ5F2.js.map} +1 -1
- package/build/esm/debounce-DW3XyyUs.js +658 -0
- package/build/{cjs/debounce-8772fd80.js.map → esm/debounce-DW3XyyUs.js.map} +1 -1
- package/build/esm/{divider-collapsed-a0ef54c3.js → divider-collapsed-BgKmR8h9.js} +4 -5
- package/build/esm/divider-collapsed-BgKmR8h9.js.map +1 -0
- package/build/esm/hooks/useForwardRef.d.ts +1 -1
- package/build/esm/index-BLdwsphX.js +66 -0
- package/build/esm/index-BLdwsphX.js.map +1 -0
- package/build/esm/index.js +4 -168
- package/build/esm/index.js.map +1 -1
- package/build/esm/index2.js +6 -3
- package/build/esm/index2.js.map +1 -1
- package/build/esm/index3.js +7 -5
- package/build/esm/index3.js.map +1 -1
- package/build/esm/index4.js +9 -6
- package/build/esm/index4.js.map +1 -1
- package/build/esm/index5.js +8 -7
- package/build/esm/index5.js.map +1 -1
- package/build/esm/index6.js +168 -9
- package/build/esm/index6.js.map +1 -1
- package/build/esm/{style-inject.es-1f59c1d0.js → style-inject.es-Bff-fD1R.js} +2 -2
- package/build/esm/style-inject.es-Bff-fD1R.js.map +1 -0
- package/build/esm/{tslib.es6-3cd4e99f.js → tslib.es6-BCqiemNI.js} +33 -31
- package/build/esm/tslib.es6-BCqiemNI.js.map +1 -0
- package/build/esm/utils-D0s6YtvW.js +6 -0
- package/build/esm/{utils-117463a5.js.map → utils-D0s6YtvW.js.map} +1 -1
- package/package.json +48 -45
- package/build/cjs/Content-64d5738a.js +0 -20
- package/build/cjs/FooterItem-de603636.js.map +0 -1
- package/build/cjs/Item-57dff146.js +0 -303
- package/build/cjs/Item-57dff146.js.map +0 -1
- package/build/cjs/PageLayoutAside-4daccf5e.js.map +0 -1
- package/build/cjs/Title-54580605.js.map +0 -1
- package/build/cjs/TopPanel-c6b83157.js +0 -82
- package/build/cjs/TopPanel-c6b83157.js.map +0 -1
- package/build/cjs/components/AsideHeader/components/TopPanel.d.ts +0 -7
- package/build/cjs/components/AsideHeader/useAsideHeaderTopPanel.d.ts +0 -10
- package/build/cjs/debounce-8772fd80.js +0 -545
- package/build/cjs/divider-collapsed-b743122e.js.map +0 -1
- package/build/cjs/style-inject.es-dcee06b6.js.map +0 -1
- package/build/cjs/tslib.es6-705c6589.js.map +0 -1
- package/build/cjs/utils-db3e03c2.js +0 -8
- package/build/esm/FooterItem-3cc816a3.js.map +0 -1
- package/build/esm/Item-4d168c1c.js.map +0 -1
- package/build/esm/PageLayoutAside-beb0d6bf.js.map +0 -1
- package/build/esm/Title-03b4255a.js.map +0 -1
- package/build/esm/TopPanel-cd270f27.js +0 -76
- package/build/esm/TopPanel-cd270f27.js.map +0 -1
- package/build/esm/components/AsideHeader/components/TopPanel.d.ts +0 -7
- package/build/esm/components/AsideHeader/useAsideHeaderTopPanel.d.ts +0 -10
- package/build/esm/debounce-64cd2b4c.js +0 -543
- package/build/esm/divider-collapsed-a0ef54c3.js.map +0 -1
- package/build/esm/style-inject.es-1f59c1d0.js.map +0 -1
- package/build/esm/tslib.es6-3cd4e99f.js.map +0 -1
- package/build/esm/utils-117463a5.js +0 -6
package/build/esm/Drawer.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import React__default
|
|
3
|
-
import { useForkRef,
|
|
2
|
+
import React__default from 'react';
|
|
3
|
+
import { useForkRef, Portal } from '@gravity-ui/uikit';
|
|
4
|
+
import { b as block } from './cn-CgiqTV3v.js';
|
|
5
|
+
import { s as styleInject } from './style-inject.es-Bff-fD1R.js';
|
|
6
|
+
import { g as getDefaultExportFromCjs } from './_commonjsHelpers-BFTU3MAI.js';
|
|
4
7
|
import ReactDOM from 'react-dom';
|
|
5
|
-
import { b as block } from './cn-ffe5e9f5.js';
|
|
6
|
-
import { s as styleInject } from './style-inject.es-1f59c1d0.js';
|
|
7
8
|
import '@bem-react/classname';
|
|
8
9
|
|
|
9
10
|
function _extends() {
|
|
@@ -259,14 +260,12 @@ var hasRequiredReactIs;
|
|
|
259
260
|
function requireReactIs () {
|
|
260
261
|
if (hasRequiredReactIs) return reactIs.exports;
|
|
261
262
|
hasRequiredReactIs = 1;
|
|
262
|
-
(function (module) {
|
|
263
263
|
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
} (reactIs));
|
|
264
|
+
if (process.env.NODE_ENV === 'production') {
|
|
265
|
+
reactIs.exports = requireReactIs_production_min();
|
|
266
|
+
} else {
|
|
267
|
+
reactIs.exports = requireReactIs_development();
|
|
268
|
+
}
|
|
270
269
|
return reactIs.exports;
|
|
271
270
|
}
|
|
272
271
|
|
|
@@ -415,9 +414,9 @@ function requireCheckPropTypes () {
|
|
|
415
414
|
var printWarning = function() {};
|
|
416
415
|
|
|
417
416
|
if (process.env.NODE_ENV !== 'production') {
|
|
418
|
-
var ReactPropTypesSecret = requireReactPropTypesSecret();
|
|
417
|
+
var ReactPropTypesSecret = /*@__PURE__*/ requireReactPropTypesSecret();
|
|
419
418
|
var loggedTypeFailures = {};
|
|
420
|
-
var has = requireHas();
|
|
419
|
+
var has = /*@__PURE__*/ requireHas();
|
|
421
420
|
|
|
422
421
|
printWarning = function(text) {
|
|
423
422
|
var message = 'Warning: ' + text;
|
|
@@ -526,9 +525,9 @@ function requireFactoryWithTypeCheckers () {
|
|
|
526
525
|
var ReactIs = requireReactIs();
|
|
527
526
|
var assign = requireObjectAssign();
|
|
528
527
|
|
|
529
|
-
var ReactPropTypesSecret = requireReactPropTypesSecret();
|
|
530
|
-
var has = requireHas();
|
|
531
|
-
var checkPropTypes = requireCheckPropTypes();
|
|
528
|
+
var ReactPropTypesSecret = /*@__PURE__*/ requireReactPropTypesSecret();
|
|
529
|
+
var has = /*@__PURE__*/ requireHas();
|
|
530
|
+
var checkPropTypes = /*@__PURE__*/ requireCheckPropTypes();
|
|
532
531
|
|
|
533
532
|
var printWarning = function() {};
|
|
534
533
|
|
|
@@ -883,7 +882,7 @@ function requireFactoryWithTypeCheckers () {
|
|
|
883
882
|
|
|
884
883
|
function createUnionTypeChecker(arrayOfTypeCheckers) {
|
|
885
884
|
if (!Array.isArray(arrayOfTypeCheckers)) {
|
|
886
|
-
process.env.NODE_ENV !== 'production' ? printWarning('Invalid argument supplied to oneOfType, expected an instance of array.') :
|
|
885
|
+
process.env.NODE_ENV !== 'production' ? printWarning('Invalid argument supplied to oneOfType, expected an instance of array.') : undefined;
|
|
887
886
|
return emptyFunctionThatReturnsNull;
|
|
888
887
|
}
|
|
889
888
|
|
|
@@ -1141,7 +1140,7 @@ function requireFactoryWithThrowingShims () {
|
|
|
1141
1140
|
if (hasRequiredFactoryWithThrowingShims) return factoryWithThrowingShims;
|
|
1142
1141
|
hasRequiredFactoryWithThrowingShims = 1;
|
|
1143
1142
|
|
|
1144
|
-
var ReactPropTypesSecret = requireReactPropTypesSecret();
|
|
1143
|
+
var ReactPropTypesSecret = /*@__PURE__*/ requireReactPropTypesSecret();
|
|
1145
1144
|
|
|
1146
1145
|
function emptyFunction() {}
|
|
1147
1146
|
function emptyFunctionWithReset() {}
|
|
@@ -1205,19 +1204,29 @@ function requireFactoryWithThrowingShims () {
|
|
|
1205
1204
|
* LICENSE file in the root directory of this source tree.
|
|
1206
1205
|
*/
|
|
1207
1206
|
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1207
|
+
var hasRequiredPropTypes;
|
|
1208
|
+
|
|
1209
|
+
function requirePropTypes () {
|
|
1210
|
+
if (hasRequiredPropTypes) return propTypes.exports;
|
|
1211
|
+
hasRequiredPropTypes = 1;
|
|
1212
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
1213
|
+
var ReactIs = requireReactIs();
|
|
1214
|
+
|
|
1215
|
+
// By explicitly using `prop-types` you are opting into new development behavior.
|
|
1216
|
+
// http://fb.me/prop-types-in-prod
|
|
1217
|
+
var throwOnDirectAccess = true;
|
|
1218
|
+
propTypes.exports = /*@__PURE__*/ requireFactoryWithTypeCheckers()(ReactIs.isElement, throwOnDirectAccess);
|
|
1219
|
+
} else {
|
|
1220
|
+
// By explicitly using `prop-types` you are opting into new production behavior.
|
|
1221
|
+
// http://fb.me/prop-types-in-prod
|
|
1222
|
+
propTypes.exports = /*@__PURE__*/ requireFactoryWithThrowingShims()();
|
|
1223
|
+
}
|
|
1224
|
+
return propTypes.exports;
|
|
1219
1225
|
}
|
|
1220
1226
|
|
|
1227
|
+
var propTypesExports = /*@__PURE__*/ requirePropTypes();
|
|
1228
|
+
var PropTypes = /*@__PURE__*/getDefaultExportFromCjs(propTypesExports);
|
|
1229
|
+
|
|
1221
1230
|
/**
|
|
1222
1231
|
* Checks if a given element has a CSS class.
|
|
1223
1232
|
*
|
|
@@ -1265,22 +1274,22 @@ var config = {
|
|
|
1265
1274
|
disabled: false
|
|
1266
1275
|
};
|
|
1267
1276
|
|
|
1268
|
-
var timeoutsShape = process.env.NODE_ENV !== 'production' ?
|
|
1269
|
-
enter:
|
|
1270
|
-
exit:
|
|
1271
|
-
appear:
|
|
1277
|
+
var timeoutsShape = process.env.NODE_ENV !== 'production' ? PropTypes.oneOfType([PropTypes.number, PropTypes.shape({
|
|
1278
|
+
enter: PropTypes.number,
|
|
1279
|
+
exit: PropTypes.number,
|
|
1280
|
+
appear: PropTypes.number
|
|
1272
1281
|
}).isRequired]) : null;
|
|
1273
|
-
var classNamesShape = process.env.NODE_ENV !== 'production' ?
|
|
1274
|
-
enter:
|
|
1275
|
-
exit:
|
|
1276
|
-
active:
|
|
1277
|
-
}),
|
|
1278
|
-
enter:
|
|
1279
|
-
enterDone:
|
|
1280
|
-
enterActive:
|
|
1281
|
-
exit:
|
|
1282
|
-
exitDone:
|
|
1283
|
-
exitActive:
|
|
1282
|
+
var classNamesShape = process.env.NODE_ENV !== 'production' ? PropTypes.oneOfType([PropTypes.string, PropTypes.shape({
|
|
1283
|
+
enter: PropTypes.string,
|
|
1284
|
+
exit: PropTypes.string,
|
|
1285
|
+
active: PropTypes.string
|
|
1286
|
+
}), PropTypes.shape({
|
|
1287
|
+
enter: PropTypes.string,
|
|
1288
|
+
enterDone: PropTypes.string,
|
|
1289
|
+
enterActive: PropTypes.string,
|
|
1290
|
+
exit: PropTypes.string,
|
|
1291
|
+
exitDone: PropTypes.string,
|
|
1292
|
+
exitActive: PropTypes.string
|
|
1284
1293
|
})]) : null;
|
|
1285
1294
|
|
|
1286
1295
|
var TransitionGroupContext = React__default.createContext(null);
|
|
@@ -1499,7 +1508,7 @@ var Transition = /*#__PURE__*/function (_React$Component) {
|
|
|
1499
1508
|
};
|
|
1500
1509
|
|
|
1501
1510
|
_proto.updateStatus = function updateStatus(mounting, nextStatus) {
|
|
1502
|
-
if (mounting ===
|
|
1511
|
+
if (mounting === undefined) {
|
|
1503
1512
|
mounting = false;
|
|
1504
1513
|
}
|
|
1505
1514
|
|
|
@@ -1707,10 +1716,10 @@ Transition.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
1707
1716
|
* (see
|
|
1708
1717
|
* [test/CSSTransition-test.js](https://github.com/reactjs/react-transition-group/blob/13435f897b3ab71f6e19d724f145596f5910581c/test/CSSTransition-test.js#L362-L437)).
|
|
1709
1718
|
*/
|
|
1710
|
-
nodeRef:
|
|
1711
|
-
current: typeof Element === 'undefined' ?
|
|
1719
|
+
nodeRef: PropTypes.shape({
|
|
1720
|
+
current: typeof Element === 'undefined' ? PropTypes.any : function (propValue, key, componentName, location, propFullName, secret) {
|
|
1712
1721
|
var value = propValue[key];
|
|
1713
|
-
return
|
|
1722
|
+
return PropTypes.instanceOf(value && 'ownerDocument' in value ? value.ownerDocument.defaultView.Element : Element)(propValue, key, componentName, location, propFullName, secret);
|
|
1714
1723
|
}
|
|
1715
1724
|
}),
|
|
1716
1725
|
|
|
@@ -1728,12 +1737,12 @@ Transition.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
1728
1737
|
* </Transition>
|
|
1729
1738
|
* ```
|
|
1730
1739
|
*/
|
|
1731
|
-
children:
|
|
1740
|
+
children: PropTypes.oneOfType([PropTypes.func.isRequired, PropTypes.element.isRequired]).isRequired,
|
|
1732
1741
|
|
|
1733
1742
|
/**
|
|
1734
1743
|
* Show the component; triggers the enter or exit states
|
|
1735
1744
|
*/
|
|
1736
|
-
in:
|
|
1745
|
+
in: PropTypes.bool,
|
|
1737
1746
|
|
|
1738
1747
|
/**
|
|
1739
1748
|
* By default the child component is mounted immediately along with
|
|
@@ -1741,13 +1750,13 @@ Transition.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
1741
1750
|
* first `in={true}` you can set `mountOnEnter`. After the first enter transition the component will stay
|
|
1742
1751
|
* mounted, even on "exited", unless you also specify `unmountOnExit`.
|
|
1743
1752
|
*/
|
|
1744
|
-
mountOnEnter:
|
|
1753
|
+
mountOnEnter: PropTypes.bool,
|
|
1745
1754
|
|
|
1746
1755
|
/**
|
|
1747
1756
|
* By default the child component stays mounted after it reaches the `'exited'` state.
|
|
1748
1757
|
* Set `unmountOnExit` if you'd prefer to unmount the component after it finishes exiting.
|
|
1749
1758
|
*/
|
|
1750
|
-
unmountOnExit:
|
|
1759
|
+
unmountOnExit: PropTypes.bool,
|
|
1751
1760
|
|
|
1752
1761
|
/**
|
|
1753
1762
|
* By default the child component does not perform the enter transition when
|
|
@@ -1760,17 +1769,17 @@ Transition.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
1760
1769
|
* > additional `.appear-*` classes, that way you can choose to style it
|
|
1761
1770
|
* > differently.
|
|
1762
1771
|
*/
|
|
1763
|
-
appear:
|
|
1772
|
+
appear: PropTypes.bool,
|
|
1764
1773
|
|
|
1765
1774
|
/**
|
|
1766
1775
|
* Enable or disable enter transitions.
|
|
1767
1776
|
*/
|
|
1768
|
-
enter:
|
|
1777
|
+
enter: PropTypes.bool,
|
|
1769
1778
|
|
|
1770
1779
|
/**
|
|
1771
1780
|
* Enable or disable exit transitions.
|
|
1772
1781
|
*/
|
|
1773
|
-
exit:
|
|
1782
|
+
exit: PropTypes.bool,
|
|
1774
1783
|
|
|
1775
1784
|
/**
|
|
1776
1785
|
* The duration of the transition, in milliseconds.
|
|
@@ -1806,7 +1815,7 @@ Transition.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
1806
1815
|
args[_key - 1] = arguments[_key];
|
|
1807
1816
|
}
|
|
1808
1817
|
|
|
1809
|
-
return pt.apply(
|
|
1818
|
+
return pt.apply(undefined, [props].concat(args));
|
|
1810
1819
|
},
|
|
1811
1820
|
|
|
1812
1821
|
/**
|
|
@@ -1823,7 +1832,7 @@ Transition.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
1823
1832
|
* }}
|
|
1824
1833
|
* ```
|
|
1825
1834
|
*/
|
|
1826
|
-
addEndListener:
|
|
1835
|
+
addEndListener: PropTypes.func,
|
|
1827
1836
|
|
|
1828
1837
|
/**
|
|
1829
1838
|
* Callback fired before the "entering" status is applied. An extra parameter
|
|
@@ -1833,7 +1842,7 @@ Transition.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
1833
1842
|
*
|
|
1834
1843
|
* @type Function(node: HtmlElement, isAppearing: bool) -> void
|
|
1835
1844
|
*/
|
|
1836
|
-
onEnter:
|
|
1845
|
+
onEnter: PropTypes.func,
|
|
1837
1846
|
|
|
1838
1847
|
/**
|
|
1839
1848
|
* Callback fired after the "entering" status is applied. An extra parameter
|
|
@@ -1843,7 +1852,7 @@ Transition.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
1843
1852
|
*
|
|
1844
1853
|
* @type Function(node: HtmlElement, isAppearing: bool)
|
|
1845
1854
|
*/
|
|
1846
|
-
onEntering:
|
|
1855
|
+
onEntering: PropTypes.func,
|
|
1847
1856
|
|
|
1848
1857
|
/**
|
|
1849
1858
|
* Callback fired after the "entered" status is applied. An extra parameter
|
|
@@ -1853,7 +1862,7 @@ Transition.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
1853
1862
|
*
|
|
1854
1863
|
* @type Function(node: HtmlElement, isAppearing: bool) -> void
|
|
1855
1864
|
*/
|
|
1856
|
-
onEntered:
|
|
1865
|
+
onEntered: PropTypes.func,
|
|
1857
1866
|
|
|
1858
1867
|
/**
|
|
1859
1868
|
* Callback fired before the "exiting" status is applied.
|
|
@@ -1862,7 +1871,7 @@ Transition.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
1862
1871
|
*
|
|
1863
1872
|
* @type Function(node: HtmlElement) -> void
|
|
1864
1873
|
*/
|
|
1865
|
-
onExit:
|
|
1874
|
+
onExit: PropTypes.func,
|
|
1866
1875
|
|
|
1867
1876
|
/**
|
|
1868
1877
|
* Callback fired after the "exiting" status is applied.
|
|
@@ -1871,7 +1880,7 @@ Transition.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
1871
1880
|
*
|
|
1872
1881
|
* @type Function(node: HtmlElement) -> void
|
|
1873
1882
|
*/
|
|
1874
|
-
onExiting:
|
|
1883
|
+
onExiting: PropTypes.func,
|
|
1875
1884
|
|
|
1876
1885
|
/**
|
|
1877
1886
|
* Callback fired after the "exited" status is applied.
|
|
@@ -1880,7 +1889,7 @@ Transition.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
1880
1889
|
*
|
|
1881
1890
|
* @type Function(node: HtmlElement) -> void
|
|
1882
1891
|
*/
|
|
1883
|
-
onExited:
|
|
1892
|
+
onExited: PropTypes.func
|
|
1884
1893
|
} : {}; // Name the function so it is clearer in the documentation
|
|
1885
1894
|
|
|
1886
1895
|
function noop() {}
|
|
@@ -2254,7 +2263,7 @@ CSSTransition.propTypes = process.env.NODE_ENV !== "production" ? _extends({}, T
|
|
|
2254
2263
|
*
|
|
2255
2264
|
* @type Function(node: HtmlElement, isAppearing: bool)
|
|
2256
2265
|
*/
|
|
2257
|
-
onEnter:
|
|
2266
|
+
onEnter: PropTypes.func,
|
|
2258
2267
|
|
|
2259
2268
|
/**
|
|
2260
2269
|
* A `<Transition>` callback fired immediately after the 'enter-active' or
|
|
@@ -2264,7 +2273,7 @@ CSSTransition.propTypes = process.env.NODE_ENV !== "production" ? _extends({}, T
|
|
|
2264
2273
|
*
|
|
2265
2274
|
* @type Function(node: HtmlElement, isAppearing: bool)
|
|
2266
2275
|
*/
|
|
2267
|
-
onEntering:
|
|
2276
|
+
onEntering: PropTypes.func,
|
|
2268
2277
|
|
|
2269
2278
|
/**
|
|
2270
2279
|
* A `<Transition>` callback fired immediately after the 'enter' or
|
|
@@ -2274,7 +2283,7 @@ CSSTransition.propTypes = process.env.NODE_ENV !== "production" ? _extends({}, T
|
|
|
2274
2283
|
*
|
|
2275
2284
|
* @type Function(node: HtmlElement, isAppearing: bool)
|
|
2276
2285
|
*/
|
|
2277
|
-
onEntered:
|
|
2286
|
+
onEntered: PropTypes.func,
|
|
2278
2287
|
|
|
2279
2288
|
/**
|
|
2280
2289
|
* A `<Transition>` callback fired immediately after the 'exit' class is
|
|
@@ -2284,7 +2293,7 @@ CSSTransition.propTypes = process.env.NODE_ENV !== "production" ? _extends({}, T
|
|
|
2284
2293
|
*
|
|
2285
2294
|
* @type Function(node: HtmlElement)
|
|
2286
2295
|
*/
|
|
2287
|
-
onExit:
|
|
2296
|
+
onExit: PropTypes.func,
|
|
2288
2297
|
|
|
2289
2298
|
/**
|
|
2290
2299
|
* A `<Transition>` callback fired immediately after the 'exit-active' is applied.
|
|
@@ -2293,7 +2302,7 @@ CSSTransition.propTypes = process.env.NODE_ENV !== "production" ? _extends({}, T
|
|
|
2293
2302
|
*
|
|
2294
2303
|
* @type Function(node: HtmlElement)
|
|
2295
2304
|
*/
|
|
2296
|
-
onExiting:
|
|
2305
|
+
onExiting: PropTypes.func,
|
|
2297
2306
|
|
|
2298
2307
|
/**
|
|
2299
2308
|
* A `<Transition>` callback fired immediately after the 'exit' classes
|
|
@@ -2303,720 +2312,15 @@ CSSTransition.propTypes = process.env.NODE_ENV !== "production" ? _extends({}, T
|
|
|
2303
2312
|
*
|
|
2304
2313
|
* @type Function(node: HtmlElement)
|
|
2305
2314
|
*/
|
|
2306
|
-
onExited:
|
|
2315
|
+
onExited: PropTypes.func
|
|
2307
2316
|
}) : {};
|
|
2308
2317
|
|
|
2309
|
-
function _assertThisInitialized(e) {
|
|
2310
|
-
if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
2311
|
-
return e;
|
|
2312
|
-
}
|
|
2313
|
-
|
|
2314
|
-
/**
|
|
2315
|
-
* Given `this.props.children`, return an object mapping key to child.
|
|
2316
|
-
*
|
|
2317
|
-
* @param {*} children `this.props.children`
|
|
2318
|
-
* @return {object} Mapping of key to child
|
|
2319
|
-
*/
|
|
2320
|
-
|
|
2321
|
-
function getChildMapping(children, mapFn) {
|
|
2322
|
-
var mapper = function mapper(child) {
|
|
2323
|
-
return mapFn && isValidElement(child) ? mapFn(child) : child;
|
|
2324
|
-
};
|
|
2325
|
-
|
|
2326
|
-
var result = Object.create(null);
|
|
2327
|
-
if (children) Children.map(children, function (c) {
|
|
2328
|
-
return c;
|
|
2329
|
-
}).forEach(function (child) {
|
|
2330
|
-
// run the map function here instead so that the key is the computed one
|
|
2331
|
-
result[child.key] = mapper(child);
|
|
2332
|
-
});
|
|
2333
|
-
return result;
|
|
2334
|
-
}
|
|
2335
|
-
/**
|
|
2336
|
-
* When you're adding or removing children some may be added or removed in the
|
|
2337
|
-
* same render pass. We want to show *both* since we want to simultaneously
|
|
2338
|
-
* animate elements in and out. This function takes a previous set of keys
|
|
2339
|
-
* and a new set of keys and merges them with its best guess of the correct
|
|
2340
|
-
* ordering. In the future we may expose some of the utilities in
|
|
2341
|
-
* ReactMultiChild to make this easy, but for now React itself does not
|
|
2342
|
-
* directly have this concept of the union of prevChildren and nextChildren
|
|
2343
|
-
* so we implement it here.
|
|
2344
|
-
*
|
|
2345
|
-
* @param {object} prev prev children as returned from
|
|
2346
|
-
* `ReactTransitionChildMapping.getChildMapping()`.
|
|
2347
|
-
* @param {object} next next children as returned from
|
|
2348
|
-
* `ReactTransitionChildMapping.getChildMapping()`.
|
|
2349
|
-
* @return {object} a key set that contains all keys in `prev` and all keys
|
|
2350
|
-
* in `next` in a reasonable order.
|
|
2351
|
-
*/
|
|
2352
|
-
|
|
2353
|
-
function mergeChildMappings(prev, next) {
|
|
2354
|
-
prev = prev || {};
|
|
2355
|
-
next = next || {};
|
|
2356
|
-
|
|
2357
|
-
function getValueForKey(key) {
|
|
2358
|
-
return key in next ? next[key] : prev[key];
|
|
2359
|
-
} // For each key of `next`, the list of keys to insert before that key in
|
|
2360
|
-
// the combined list
|
|
2361
|
-
|
|
2362
|
-
|
|
2363
|
-
var nextKeysPending = Object.create(null);
|
|
2364
|
-
var pendingKeys = [];
|
|
2365
|
-
|
|
2366
|
-
for (var prevKey in prev) {
|
|
2367
|
-
if (prevKey in next) {
|
|
2368
|
-
if (pendingKeys.length) {
|
|
2369
|
-
nextKeysPending[prevKey] = pendingKeys;
|
|
2370
|
-
pendingKeys = [];
|
|
2371
|
-
}
|
|
2372
|
-
} else {
|
|
2373
|
-
pendingKeys.push(prevKey);
|
|
2374
|
-
}
|
|
2375
|
-
}
|
|
2376
|
-
|
|
2377
|
-
var i;
|
|
2378
|
-
var childMapping = {};
|
|
2379
|
-
|
|
2380
|
-
for (var nextKey in next) {
|
|
2381
|
-
if (nextKeysPending[nextKey]) {
|
|
2382
|
-
for (i = 0; i < nextKeysPending[nextKey].length; i++) {
|
|
2383
|
-
var pendingNextKey = nextKeysPending[nextKey][i];
|
|
2384
|
-
childMapping[nextKeysPending[nextKey][i]] = getValueForKey(pendingNextKey);
|
|
2385
|
-
}
|
|
2386
|
-
}
|
|
2387
|
-
|
|
2388
|
-
childMapping[nextKey] = getValueForKey(nextKey);
|
|
2389
|
-
} // Finally, add the keys which didn't appear before any key in `next`
|
|
2390
|
-
|
|
2391
|
-
|
|
2392
|
-
for (i = 0; i < pendingKeys.length; i++) {
|
|
2393
|
-
childMapping[pendingKeys[i]] = getValueForKey(pendingKeys[i]);
|
|
2394
|
-
}
|
|
2395
|
-
|
|
2396
|
-
return childMapping;
|
|
2397
|
-
}
|
|
2398
|
-
|
|
2399
|
-
function getProp(child, prop, props) {
|
|
2400
|
-
return props[prop] != null ? props[prop] : child.props[prop];
|
|
2401
|
-
}
|
|
2402
|
-
|
|
2403
|
-
function getInitialChildMapping(props, onExited) {
|
|
2404
|
-
return getChildMapping(props.children, function (child) {
|
|
2405
|
-
return cloneElement(child, {
|
|
2406
|
-
onExited: onExited.bind(null, child),
|
|
2407
|
-
in: true,
|
|
2408
|
-
appear: getProp(child, 'appear', props),
|
|
2409
|
-
enter: getProp(child, 'enter', props),
|
|
2410
|
-
exit: getProp(child, 'exit', props)
|
|
2411
|
-
});
|
|
2412
|
-
});
|
|
2413
|
-
}
|
|
2414
|
-
function getNextChildMapping(nextProps, prevChildMapping, onExited) {
|
|
2415
|
-
var nextChildMapping = getChildMapping(nextProps.children);
|
|
2416
|
-
var children = mergeChildMappings(prevChildMapping, nextChildMapping);
|
|
2417
|
-
Object.keys(children).forEach(function (key) {
|
|
2418
|
-
var child = children[key];
|
|
2419
|
-
if (!isValidElement(child)) return;
|
|
2420
|
-
var hasPrev = (key in prevChildMapping);
|
|
2421
|
-
var hasNext = (key in nextChildMapping);
|
|
2422
|
-
var prevChild = prevChildMapping[key];
|
|
2423
|
-
var isLeaving = isValidElement(prevChild) && !prevChild.props.in; // item is new (entering)
|
|
2424
|
-
|
|
2425
|
-
if (hasNext && (!hasPrev || isLeaving)) {
|
|
2426
|
-
// console.log('entering', key)
|
|
2427
|
-
children[key] = cloneElement(child, {
|
|
2428
|
-
onExited: onExited.bind(null, child),
|
|
2429
|
-
in: true,
|
|
2430
|
-
exit: getProp(child, 'exit', nextProps),
|
|
2431
|
-
enter: getProp(child, 'enter', nextProps)
|
|
2432
|
-
});
|
|
2433
|
-
} else if (!hasNext && hasPrev && !isLeaving) {
|
|
2434
|
-
// item is old (exiting)
|
|
2435
|
-
// console.log('leaving', key)
|
|
2436
|
-
children[key] = cloneElement(child, {
|
|
2437
|
-
in: false
|
|
2438
|
-
});
|
|
2439
|
-
} else if (hasNext && hasPrev && isValidElement(prevChild)) {
|
|
2440
|
-
// item hasn't changed transition states
|
|
2441
|
-
// copy over the last transition props;
|
|
2442
|
-
// console.log('unchanged', key)
|
|
2443
|
-
children[key] = cloneElement(child, {
|
|
2444
|
-
onExited: onExited.bind(null, child),
|
|
2445
|
-
in: prevChild.props.in,
|
|
2446
|
-
exit: getProp(child, 'exit', nextProps),
|
|
2447
|
-
enter: getProp(child, 'enter', nextProps)
|
|
2448
|
-
});
|
|
2449
|
-
}
|
|
2450
|
-
});
|
|
2451
|
-
return children;
|
|
2452
|
-
}
|
|
2453
|
-
|
|
2454
|
-
var values = Object.values || function (obj) {
|
|
2455
|
-
return Object.keys(obj).map(function (k) {
|
|
2456
|
-
return obj[k];
|
|
2457
|
-
});
|
|
2458
|
-
};
|
|
2459
|
-
|
|
2460
|
-
var defaultProps = {
|
|
2461
|
-
component: 'div',
|
|
2462
|
-
childFactory: function childFactory(child) {
|
|
2463
|
-
return child;
|
|
2464
|
-
}
|
|
2465
|
-
};
|
|
2466
|
-
/**
|
|
2467
|
-
* The `<TransitionGroup>` component manages a set of transition components
|
|
2468
|
-
* (`<Transition>` and `<CSSTransition>`) in a list. Like with the transition
|
|
2469
|
-
* components, `<TransitionGroup>` is a state machine for managing the mounting
|
|
2470
|
-
* and unmounting of components over time.
|
|
2471
|
-
*
|
|
2472
|
-
* Consider the example below. As items are removed or added to the TodoList the
|
|
2473
|
-
* `in` prop is toggled automatically by the `<TransitionGroup>`.
|
|
2474
|
-
*
|
|
2475
|
-
* Note that `<TransitionGroup>` does not define any animation behavior!
|
|
2476
|
-
* Exactly _how_ a list item animates is up to the individual transition
|
|
2477
|
-
* component. This means you can mix and match animations across different list
|
|
2478
|
-
* items.
|
|
2479
|
-
*/
|
|
2480
|
-
|
|
2481
|
-
var TransitionGroup = /*#__PURE__*/function (_React$Component) {
|
|
2482
|
-
_inheritsLoose(TransitionGroup, _React$Component);
|
|
2483
|
-
|
|
2484
|
-
function TransitionGroup(props, context) {
|
|
2485
|
-
var _this;
|
|
2486
|
-
|
|
2487
|
-
_this = _React$Component.call(this, props, context) || this;
|
|
2488
|
-
|
|
2489
|
-
var handleExited = _this.handleExited.bind(_assertThisInitialized(_this)); // Initial children should all be entering, dependent on appear
|
|
2490
|
-
|
|
2491
|
-
|
|
2492
|
-
_this.state = {
|
|
2493
|
-
contextValue: {
|
|
2494
|
-
isMounting: true
|
|
2495
|
-
},
|
|
2496
|
-
handleExited: handleExited,
|
|
2497
|
-
firstRender: true
|
|
2498
|
-
};
|
|
2499
|
-
return _this;
|
|
2500
|
-
}
|
|
2501
|
-
|
|
2502
|
-
var _proto = TransitionGroup.prototype;
|
|
2503
|
-
|
|
2504
|
-
_proto.componentDidMount = function componentDidMount() {
|
|
2505
|
-
this.mounted = true;
|
|
2506
|
-
this.setState({
|
|
2507
|
-
contextValue: {
|
|
2508
|
-
isMounting: false
|
|
2509
|
-
}
|
|
2510
|
-
});
|
|
2511
|
-
};
|
|
2512
|
-
|
|
2513
|
-
_proto.componentWillUnmount = function componentWillUnmount() {
|
|
2514
|
-
this.mounted = false;
|
|
2515
|
-
};
|
|
2516
|
-
|
|
2517
|
-
TransitionGroup.getDerivedStateFromProps = function getDerivedStateFromProps(nextProps, _ref) {
|
|
2518
|
-
var prevChildMapping = _ref.children,
|
|
2519
|
-
handleExited = _ref.handleExited,
|
|
2520
|
-
firstRender = _ref.firstRender;
|
|
2521
|
-
return {
|
|
2522
|
-
children: firstRender ? getInitialChildMapping(nextProps, handleExited) : getNextChildMapping(nextProps, prevChildMapping, handleExited),
|
|
2523
|
-
firstRender: false
|
|
2524
|
-
};
|
|
2525
|
-
} // node is `undefined` when user provided `nodeRef` prop
|
|
2526
|
-
;
|
|
2527
|
-
|
|
2528
|
-
_proto.handleExited = function handleExited(child, node) {
|
|
2529
|
-
var currentChildMapping = getChildMapping(this.props.children);
|
|
2530
|
-
if (child.key in currentChildMapping) return;
|
|
2531
|
-
|
|
2532
|
-
if (child.props.onExited) {
|
|
2533
|
-
child.props.onExited(node);
|
|
2534
|
-
}
|
|
2535
|
-
|
|
2536
|
-
if (this.mounted) {
|
|
2537
|
-
this.setState(function (state) {
|
|
2538
|
-
var children = _extends({}, state.children);
|
|
2539
|
-
|
|
2540
|
-
delete children[child.key];
|
|
2541
|
-
return {
|
|
2542
|
-
children: children
|
|
2543
|
-
};
|
|
2544
|
-
});
|
|
2545
|
-
}
|
|
2546
|
-
};
|
|
2547
|
-
|
|
2548
|
-
_proto.render = function render() {
|
|
2549
|
-
var _this$props = this.props,
|
|
2550
|
-
Component = _this$props.component,
|
|
2551
|
-
childFactory = _this$props.childFactory,
|
|
2552
|
-
props = _objectWithoutPropertiesLoose(_this$props, ["component", "childFactory"]);
|
|
2553
|
-
|
|
2554
|
-
var contextValue = this.state.contextValue;
|
|
2555
|
-
var children = values(this.state.children).map(childFactory);
|
|
2556
|
-
delete props.appear;
|
|
2557
|
-
delete props.enter;
|
|
2558
|
-
delete props.exit;
|
|
2559
|
-
|
|
2560
|
-
if (Component === null) {
|
|
2561
|
-
return /*#__PURE__*/React__default.createElement(TransitionGroupContext.Provider, {
|
|
2562
|
-
value: contextValue
|
|
2563
|
-
}, children);
|
|
2564
|
-
}
|
|
2565
|
-
|
|
2566
|
-
return /*#__PURE__*/React__default.createElement(TransitionGroupContext.Provider, {
|
|
2567
|
-
value: contextValue
|
|
2568
|
-
}, /*#__PURE__*/React__default.createElement(Component, props, children));
|
|
2569
|
-
};
|
|
2570
|
-
|
|
2571
|
-
return TransitionGroup;
|
|
2572
|
-
}(React__default.Component);
|
|
2573
|
-
|
|
2574
|
-
TransitionGroup.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
2575
|
-
/**
|
|
2576
|
-
* `<TransitionGroup>` renders a `<div>` by default. You can change this
|
|
2577
|
-
* behavior by providing a `component` prop.
|
|
2578
|
-
* If you use React v16+ and would like to avoid a wrapping `<div>` element
|
|
2579
|
-
* you can pass in `component={null}`. This is useful if the wrapping div
|
|
2580
|
-
* borks your css styles.
|
|
2581
|
-
*/
|
|
2582
|
-
component: propTypes.exports.any,
|
|
2583
|
-
|
|
2584
|
-
/**
|
|
2585
|
-
* A set of `<Transition>` components, that are toggled `in` and out as they
|
|
2586
|
-
* leave. the `<TransitionGroup>` will inject specific transition props, so
|
|
2587
|
-
* remember to spread them through if you are wrapping the `<Transition>` as
|
|
2588
|
-
* with our `<Fade>` example.
|
|
2589
|
-
*
|
|
2590
|
-
* While this component is meant for multiple `Transition` or `CSSTransition`
|
|
2591
|
-
* children, sometimes you may want to have a single transition child with
|
|
2592
|
-
* content that you want to be transitioned out and in when you change it
|
|
2593
|
-
* (e.g. routes, images etc.) In that case you can change the `key` prop of
|
|
2594
|
-
* the transition child as you change its content, this will cause
|
|
2595
|
-
* `TransitionGroup` to transition the child out and back in.
|
|
2596
|
-
*/
|
|
2597
|
-
children: propTypes.exports.node,
|
|
2598
|
-
|
|
2599
|
-
/**
|
|
2600
|
-
* A convenience prop that enables or disables appear animations
|
|
2601
|
-
* for all children. Note that specifying this will override any defaults set
|
|
2602
|
-
* on individual children Transitions.
|
|
2603
|
-
*/
|
|
2604
|
-
appear: propTypes.exports.bool,
|
|
2605
|
-
|
|
2606
|
-
/**
|
|
2607
|
-
* A convenience prop that enables or disables enter animations
|
|
2608
|
-
* for all children. Note that specifying this will override any defaults set
|
|
2609
|
-
* on individual children Transitions.
|
|
2610
|
-
*/
|
|
2611
|
-
enter: propTypes.exports.bool,
|
|
2612
|
-
|
|
2613
|
-
/**
|
|
2614
|
-
* A convenience prop that enables or disables exit animations
|
|
2615
|
-
* for all children. Note that specifying this will override any defaults set
|
|
2616
|
-
* on individual children Transitions.
|
|
2617
|
-
*/
|
|
2618
|
-
exit: propTypes.exports.bool,
|
|
2619
|
-
|
|
2620
|
-
/**
|
|
2621
|
-
* You may need to apply reactive updates to a child as it is exiting.
|
|
2622
|
-
* This is generally done by using `cloneElement` however in the case of an exiting
|
|
2623
|
-
* child the element has already been removed and not accessible to the consumer.
|
|
2624
|
-
*
|
|
2625
|
-
* If you do need to update a child as it leaves you can provide a `childFactory`
|
|
2626
|
-
* to wrap every child, even the ones that are leaving.
|
|
2627
|
-
*
|
|
2628
|
-
* @type Function(child: ReactElement) -> ReactElement
|
|
2629
|
-
*/
|
|
2630
|
-
childFactory: propTypes.exports.func
|
|
2631
|
-
} : {};
|
|
2632
|
-
TransitionGroup.defaultProps = defaultProps;
|
|
2633
|
-
|
|
2634
|
-
/**
|
|
2635
|
-
* The `<ReplaceTransition>` component is a specialized `Transition` component
|
|
2636
|
-
* that animates between two children.
|
|
2637
|
-
*
|
|
2638
|
-
* ```jsx
|
|
2639
|
-
* <ReplaceTransition in>
|
|
2640
|
-
* <Fade><div>I appear first</div></Fade>
|
|
2641
|
-
* <Fade><div>I replace the above</div></Fade>
|
|
2642
|
-
* </ReplaceTransition>
|
|
2643
|
-
* ```
|
|
2644
|
-
*/
|
|
2645
|
-
|
|
2646
|
-
var ReplaceTransition = /*#__PURE__*/function (_React$Component) {
|
|
2647
|
-
_inheritsLoose(ReplaceTransition, _React$Component);
|
|
2648
|
-
|
|
2649
|
-
function ReplaceTransition() {
|
|
2650
|
-
var _this;
|
|
2651
|
-
|
|
2652
|
-
for (var _len = arguments.length, _args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
2653
|
-
_args[_key] = arguments[_key];
|
|
2654
|
-
}
|
|
2655
|
-
|
|
2656
|
-
_this = _React$Component.call.apply(_React$Component, [this].concat(_args)) || this;
|
|
2657
|
-
|
|
2658
|
-
_this.handleEnter = function () {
|
|
2659
|
-
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
|
2660
|
-
args[_key2] = arguments[_key2];
|
|
2661
|
-
}
|
|
2662
|
-
|
|
2663
|
-
return _this.handleLifecycle('onEnter', 0, args);
|
|
2664
|
-
};
|
|
2665
|
-
|
|
2666
|
-
_this.handleEntering = function () {
|
|
2667
|
-
for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
|
|
2668
|
-
args[_key3] = arguments[_key3];
|
|
2669
|
-
}
|
|
2670
|
-
|
|
2671
|
-
return _this.handleLifecycle('onEntering', 0, args);
|
|
2672
|
-
};
|
|
2673
|
-
|
|
2674
|
-
_this.handleEntered = function () {
|
|
2675
|
-
for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
|
|
2676
|
-
args[_key4] = arguments[_key4];
|
|
2677
|
-
}
|
|
2678
|
-
|
|
2679
|
-
return _this.handleLifecycle('onEntered', 0, args);
|
|
2680
|
-
};
|
|
2681
|
-
|
|
2682
|
-
_this.handleExit = function () {
|
|
2683
|
-
for (var _len5 = arguments.length, args = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {
|
|
2684
|
-
args[_key5] = arguments[_key5];
|
|
2685
|
-
}
|
|
2686
|
-
|
|
2687
|
-
return _this.handleLifecycle('onExit', 1, args);
|
|
2688
|
-
};
|
|
2689
|
-
|
|
2690
|
-
_this.handleExiting = function () {
|
|
2691
|
-
for (var _len6 = arguments.length, args = new Array(_len6), _key6 = 0; _key6 < _len6; _key6++) {
|
|
2692
|
-
args[_key6] = arguments[_key6];
|
|
2693
|
-
}
|
|
2694
|
-
|
|
2695
|
-
return _this.handleLifecycle('onExiting', 1, args);
|
|
2696
|
-
};
|
|
2697
|
-
|
|
2698
|
-
_this.handleExited = function () {
|
|
2699
|
-
for (var _len7 = arguments.length, args = new Array(_len7), _key7 = 0; _key7 < _len7; _key7++) {
|
|
2700
|
-
args[_key7] = arguments[_key7];
|
|
2701
|
-
}
|
|
2702
|
-
|
|
2703
|
-
return _this.handleLifecycle('onExited', 1, args);
|
|
2704
|
-
};
|
|
2705
|
-
|
|
2706
|
-
return _this;
|
|
2707
|
-
}
|
|
2708
|
-
|
|
2709
|
-
var _proto = ReplaceTransition.prototype;
|
|
2710
|
-
|
|
2711
|
-
_proto.handleLifecycle = function handleLifecycle(handler, idx, originalArgs) {
|
|
2712
|
-
var _child$props;
|
|
2713
|
-
|
|
2714
|
-
var children = this.props.children;
|
|
2715
|
-
var child = React__default.Children.toArray(children)[idx];
|
|
2716
|
-
if (child.props[handler]) (_child$props = child.props)[handler].apply(_child$props, originalArgs);
|
|
2717
|
-
|
|
2718
|
-
if (this.props[handler]) {
|
|
2719
|
-
var maybeNode = child.props.nodeRef ? undefined : ReactDOM.findDOMNode(this);
|
|
2720
|
-
this.props[handler](maybeNode);
|
|
2721
|
-
}
|
|
2722
|
-
};
|
|
2723
|
-
|
|
2724
|
-
_proto.render = function render() {
|
|
2725
|
-
var _this$props = this.props,
|
|
2726
|
-
children = _this$props.children,
|
|
2727
|
-
inProp = _this$props.in,
|
|
2728
|
-
props = _objectWithoutPropertiesLoose(_this$props, ["children", "in"]);
|
|
2729
|
-
|
|
2730
|
-
var _React$Children$toArr = React__default.Children.toArray(children),
|
|
2731
|
-
first = _React$Children$toArr[0],
|
|
2732
|
-
second = _React$Children$toArr[1];
|
|
2733
|
-
|
|
2734
|
-
delete props.onEnter;
|
|
2735
|
-
delete props.onEntering;
|
|
2736
|
-
delete props.onEntered;
|
|
2737
|
-
delete props.onExit;
|
|
2738
|
-
delete props.onExiting;
|
|
2739
|
-
delete props.onExited;
|
|
2740
|
-
return /*#__PURE__*/React__default.createElement(TransitionGroup, props, inProp ? React__default.cloneElement(first, {
|
|
2741
|
-
key: 'first',
|
|
2742
|
-
onEnter: this.handleEnter,
|
|
2743
|
-
onEntering: this.handleEntering,
|
|
2744
|
-
onEntered: this.handleEntered
|
|
2745
|
-
}) : React__default.cloneElement(second, {
|
|
2746
|
-
key: 'second',
|
|
2747
|
-
onEnter: this.handleExit,
|
|
2748
|
-
onEntering: this.handleExiting,
|
|
2749
|
-
onEntered: this.handleExited
|
|
2750
|
-
}));
|
|
2751
|
-
};
|
|
2752
|
-
|
|
2753
|
-
return ReplaceTransition;
|
|
2754
|
-
}(React__default.Component);
|
|
2755
|
-
|
|
2756
|
-
ReplaceTransition.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
2757
|
-
in: propTypes.exports.bool.isRequired,
|
|
2758
|
-
children: function children(props, propName) {
|
|
2759
|
-
if (React__default.Children.count(props[propName]) !== 2) return new Error("\"" + propName + "\" must be exactly two transition components.");
|
|
2760
|
-
return null;
|
|
2761
|
-
}
|
|
2762
|
-
} : {};
|
|
2763
|
-
|
|
2764
|
-
var _leaveRenders, _enterRenders;
|
|
2765
|
-
|
|
2766
|
-
function areChildrenDifferent(oldChildren, newChildren) {
|
|
2767
|
-
if (oldChildren === newChildren) return false;
|
|
2768
|
-
|
|
2769
|
-
if (React__default.isValidElement(oldChildren) && React__default.isValidElement(newChildren) && oldChildren.key != null && oldChildren.key === newChildren.key) {
|
|
2770
|
-
return false;
|
|
2771
|
-
}
|
|
2772
|
-
|
|
2773
|
-
return true;
|
|
2774
|
-
}
|
|
2775
|
-
/**
|
|
2776
|
-
* Enum of modes for SwitchTransition component
|
|
2777
|
-
* @enum { string }
|
|
2778
|
-
*/
|
|
2779
|
-
|
|
2780
|
-
|
|
2781
|
-
var modes = {
|
|
2782
|
-
out: 'out-in',
|
|
2783
|
-
in: 'in-out'
|
|
2784
|
-
};
|
|
2785
|
-
|
|
2786
|
-
var callHook = function callHook(element, name, cb) {
|
|
2787
|
-
return function () {
|
|
2788
|
-
var _element$props;
|
|
2789
|
-
|
|
2790
|
-
element.props[name] && (_element$props = element.props)[name].apply(_element$props, arguments);
|
|
2791
|
-
cb();
|
|
2792
|
-
};
|
|
2793
|
-
};
|
|
2794
|
-
|
|
2795
|
-
var leaveRenders = (_leaveRenders = {}, _leaveRenders[modes.out] = function (_ref) {
|
|
2796
|
-
var current = _ref.current,
|
|
2797
|
-
changeState = _ref.changeState;
|
|
2798
|
-
return React__default.cloneElement(current, {
|
|
2799
|
-
in: false,
|
|
2800
|
-
onExited: callHook(current, 'onExited', function () {
|
|
2801
|
-
changeState(ENTERING, null);
|
|
2802
|
-
})
|
|
2803
|
-
});
|
|
2804
|
-
}, _leaveRenders[modes.in] = function (_ref2) {
|
|
2805
|
-
var current = _ref2.current,
|
|
2806
|
-
changeState = _ref2.changeState,
|
|
2807
|
-
children = _ref2.children;
|
|
2808
|
-
return [current, React__default.cloneElement(children, {
|
|
2809
|
-
in: true,
|
|
2810
|
-
onEntered: callHook(children, 'onEntered', function () {
|
|
2811
|
-
changeState(ENTERING);
|
|
2812
|
-
})
|
|
2813
|
-
})];
|
|
2814
|
-
}, _leaveRenders);
|
|
2815
|
-
var enterRenders = (_enterRenders = {}, _enterRenders[modes.out] = function (_ref3) {
|
|
2816
|
-
var children = _ref3.children,
|
|
2817
|
-
changeState = _ref3.changeState;
|
|
2818
|
-
return React__default.cloneElement(children, {
|
|
2819
|
-
in: true,
|
|
2820
|
-
onEntered: callHook(children, 'onEntered', function () {
|
|
2821
|
-
changeState(ENTERED, React__default.cloneElement(children, {
|
|
2822
|
-
in: true
|
|
2823
|
-
}));
|
|
2824
|
-
})
|
|
2825
|
-
});
|
|
2826
|
-
}, _enterRenders[modes.in] = function (_ref4) {
|
|
2827
|
-
var current = _ref4.current,
|
|
2828
|
-
children = _ref4.children,
|
|
2829
|
-
changeState = _ref4.changeState;
|
|
2830
|
-
return [React__default.cloneElement(current, {
|
|
2831
|
-
in: false,
|
|
2832
|
-
onExited: callHook(current, 'onExited', function () {
|
|
2833
|
-
changeState(ENTERED, React__default.cloneElement(children, {
|
|
2834
|
-
in: true
|
|
2835
|
-
}));
|
|
2836
|
-
})
|
|
2837
|
-
}), React__default.cloneElement(children, {
|
|
2838
|
-
in: true
|
|
2839
|
-
})];
|
|
2840
|
-
}, _enterRenders);
|
|
2841
|
-
/**
|
|
2842
|
-
* A transition component inspired by the [vue transition modes](https://vuejs.org/v2/guide/transitions.html#Transition-Modes).
|
|
2843
|
-
* You can use it when you want to control the render between state transitions.
|
|
2844
|
-
* Based on the selected mode and the child's key which is the `Transition` or `CSSTransition` component, the `SwitchTransition` makes a consistent transition between them.
|
|
2845
|
-
*
|
|
2846
|
-
* If the `out-in` mode is selected, the `SwitchTransition` waits until the old child leaves and then inserts a new child.
|
|
2847
|
-
* If the `in-out` mode is selected, the `SwitchTransition` inserts a new child first, waits for the new child to enter and then removes the old child.
|
|
2848
|
-
*
|
|
2849
|
-
* **Note**: If you want the animation to happen simultaneously
|
|
2850
|
-
* (that is, to have the old child removed and a new child inserted **at the same time**),
|
|
2851
|
-
* you should use
|
|
2852
|
-
* [`TransitionGroup`](https://reactcommunity.org/react-transition-group/transition-group)
|
|
2853
|
-
* instead.
|
|
2854
|
-
*
|
|
2855
|
-
* ```jsx
|
|
2856
|
-
* function App() {
|
|
2857
|
-
* const [state, setState] = useState(false);
|
|
2858
|
-
* return (
|
|
2859
|
-
* <SwitchTransition>
|
|
2860
|
-
* <CSSTransition
|
|
2861
|
-
* key={state ? "Goodbye, world!" : "Hello, world!"}
|
|
2862
|
-
* addEndListener={(node, done) => node.addEventListener("transitionend", done, false)}
|
|
2863
|
-
* classNames='fade'
|
|
2864
|
-
* >
|
|
2865
|
-
* <button onClick={() => setState(state => !state)}>
|
|
2866
|
-
* {state ? "Goodbye, world!" : "Hello, world!"}
|
|
2867
|
-
* </button>
|
|
2868
|
-
* </CSSTransition>
|
|
2869
|
-
* </SwitchTransition>
|
|
2870
|
-
* );
|
|
2871
|
-
* }
|
|
2872
|
-
* ```
|
|
2873
|
-
*
|
|
2874
|
-
* ```css
|
|
2875
|
-
* .fade-enter{
|
|
2876
|
-
* opacity: 0;
|
|
2877
|
-
* }
|
|
2878
|
-
* .fade-exit{
|
|
2879
|
-
* opacity: 1;
|
|
2880
|
-
* }
|
|
2881
|
-
* .fade-enter-active{
|
|
2882
|
-
* opacity: 1;
|
|
2883
|
-
* }
|
|
2884
|
-
* .fade-exit-active{
|
|
2885
|
-
* opacity: 0;
|
|
2886
|
-
* }
|
|
2887
|
-
* .fade-enter-active,
|
|
2888
|
-
* .fade-exit-active{
|
|
2889
|
-
* transition: opacity 500ms;
|
|
2890
|
-
* }
|
|
2891
|
-
* ```
|
|
2892
|
-
*/
|
|
2893
|
-
|
|
2894
|
-
var SwitchTransition = /*#__PURE__*/function (_React$Component) {
|
|
2895
|
-
_inheritsLoose(SwitchTransition, _React$Component);
|
|
2896
|
-
|
|
2897
|
-
function SwitchTransition() {
|
|
2898
|
-
var _this;
|
|
2899
|
-
|
|
2900
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
2901
|
-
args[_key] = arguments[_key];
|
|
2902
|
-
}
|
|
2903
|
-
|
|
2904
|
-
_this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;
|
|
2905
|
-
_this.state = {
|
|
2906
|
-
status: ENTERED,
|
|
2907
|
-
current: null
|
|
2908
|
-
};
|
|
2909
|
-
_this.appeared = false;
|
|
2910
|
-
|
|
2911
|
-
_this.changeState = function (status, current) {
|
|
2912
|
-
if (current === void 0) {
|
|
2913
|
-
current = _this.state.current;
|
|
2914
|
-
}
|
|
2915
|
-
|
|
2916
|
-
_this.setState({
|
|
2917
|
-
status: status,
|
|
2918
|
-
current: current
|
|
2919
|
-
});
|
|
2920
|
-
};
|
|
2921
|
-
|
|
2922
|
-
return _this;
|
|
2923
|
-
}
|
|
2924
|
-
|
|
2925
|
-
var _proto = SwitchTransition.prototype;
|
|
2926
|
-
|
|
2927
|
-
_proto.componentDidMount = function componentDidMount() {
|
|
2928
|
-
this.appeared = true;
|
|
2929
|
-
};
|
|
2930
|
-
|
|
2931
|
-
SwitchTransition.getDerivedStateFromProps = function getDerivedStateFromProps(props, state) {
|
|
2932
|
-
if (props.children == null) {
|
|
2933
|
-
return {
|
|
2934
|
-
current: null
|
|
2935
|
-
};
|
|
2936
|
-
}
|
|
2937
|
-
|
|
2938
|
-
if (state.status === ENTERING && props.mode === modes.in) {
|
|
2939
|
-
return {
|
|
2940
|
-
status: ENTERING
|
|
2941
|
-
};
|
|
2942
|
-
}
|
|
2943
|
-
|
|
2944
|
-
if (state.current && areChildrenDifferent(state.current, props.children)) {
|
|
2945
|
-
return {
|
|
2946
|
-
status: EXITING
|
|
2947
|
-
};
|
|
2948
|
-
}
|
|
2949
|
-
|
|
2950
|
-
return {
|
|
2951
|
-
current: React__default.cloneElement(props.children, {
|
|
2952
|
-
in: true
|
|
2953
|
-
})
|
|
2954
|
-
};
|
|
2955
|
-
};
|
|
2956
|
-
|
|
2957
|
-
_proto.render = function render() {
|
|
2958
|
-
var _this$props = this.props,
|
|
2959
|
-
children = _this$props.children,
|
|
2960
|
-
mode = _this$props.mode,
|
|
2961
|
-
_this$state = this.state,
|
|
2962
|
-
status = _this$state.status,
|
|
2963
|
-
current = _this$state.current;
|
|
2964
|
-
var data = {
|
|
2965
|
-
children: children,
|
|
2966
|
-
current: current,
|
|
2967
|
-
changeState: this.changeState,
|
|
2968
|
-
status: status
|
|
2969
|
-
};
|
|
2970
|
-
var component;
|
|
2971
|
-
|
|
2972
|
-
switch (status) {
|
|
2973
|
-
case ENTERING:
|
|
2974
|
-
component = enterRenders[mode](data);
|
|
2975
|
-
break;
|
|
2976
|
-
|
|
2977
|
-
case EXITING:
|
|
2978
|
-
component = leaveRenders[mode](data);
|
|
2979
|
-
break;
|
|
2980
|
-
|
|
2981
|
-
case ENTERED:
|
|
2982
|
-
component = current;
|
|
2983
|
-
}
|
|
2984
|
-
|
|
2985
|
-
return /*#__PURE__*/React__default.createElement(TransitionGroupContext.Provider, {
|
|
2986
|
-
value: {
|
|
2987
|
-
isMounting: !this.appeared
|
|
2988
|
-
}
|
|
2989
|
-
}, component);
|
|
2990
|
-
};
|
|
2991
|
-
|
|
2992
|
-
return SwitchTransition;
|
|
2993
|
-
}(React__default.Component);
|
|
2994
|
-
|
|
2995
|
-
SwitchTransition.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
2996
|
-
/**
|
|
2997
|
-
* Transition modes.
|
|
2998
|
-
* `out-in`: Current element transitions out first, then when complete, the new element transitions in.
|
|
2999
|
-
* `in-out`: New element transitions in first, then when complete, the current element transitions out.
|
|
3000
|
-
*
|
|
3001
|
-
* @type {'out-in'|'in-out'}
|
|
3002
|
-
*/
|
|
3003
|
-
mode: propTypes.exports.oneOf([modes.in, modes.out]),
|
|
3004
|
-
|
|
3005
|
-
/**
|
|
3006
|
-
* Any `Transition` or `CSSTransition` component.
|
|
3007
|
-
*/
|
|
3008
|
-
children: propTypes.exports.oneOfType([propTypes.exports.element.isRequired])
|
|
3009
|
-
} : {};
|
|
3010
|
-
SwitchTransition.defaultProps = {
|
|
3011
|
-
mode: modes.out
|
|
3012
|
-
};
|
|
3013
|
-
|
|
3014
2318
|
const DRAWER_ITEM_MIN_RESIZE_WIDTH = 200;
|
|
3015
2319
|
const DRAWER_ITEM_MAX_RESIZE_WIDTH = 800;
|
|
3016
2320
|
const DRAWER_ITEM_INITIAL_RESIZE_WIDTH = 400;
|
|
3017
2321
|
function getEventClientX(e) {
|
|
3018
2322
|
var _a, _b;
|
|
3019
|
-
return 'touches' in e ? (_b = (_a = e.touches[0]) === null || _a ===
|
|
2323
|
+
return 'touches' in e ? ((_b = (_a = e.touches[0]) === null || _a === undefined ? undefined : _a.clientX) !== null && _b !== undefined ? _b : 0) : e.clientX;
|
|
3020
2324
|
}
|
|
3021
2325
|
function useResizeHandlers({ onStart, onMove, onEnd }) {
|
|
3022
2326
|
const initialXPosition = React.useRef(0);
|
|
@@ -3063,17 +2367,17 @@ function useResizableDrawerItem(params) {
|
|
|
3063
2367
|
const { direction, width, minResizeWidth = DRAWER_ITEM_MIN_RESIZE_WIDTH, maxResizeWidth = DRAWER_ITEM_MAX_RESIZE_WIDTH, onResizeStart, onResize, } = params;
|
|
3064
2368
|
const [isResizing, setIsResizing] = React.useState(false);
|
|
3065
2369
|
const [resizeDelta, setResizeDelta] = React.useState(0);
|
|
3066
|
-
const [internalWidth, setInternalWidth] = React.useState(width !== null && width !==
|
|
2370
|
+
const [internalWidth, setInternalWidth] = React.useState(width !== null && width !== undefined ? width : DRAWER_ITEM_INITIAL_RESIZE_WIDTH);
|
|
3067
2371
|
const getClampedWidth = React.useCallback((width) => Math.min(Math.max(width, minResizeWidth), maxResizeWidth), [minResizeWidth, maxResizeWidth]);
|
|
3068
2372
|
const getResizedWidth = React.useCallback((delta) => {
|
|
3069
2373
|
const signedDelta = direction === 'right' ? delta : -delta;
|
|
3070
|
-
const newWidth = (width !== null && width !==
|
|
2374
|
+
const newWidth = (width !== null && width !== undefined ? width : internalWidth) + signedDelta;
|
|
3071
2375
|
return getClampedWidth(newWidth);
|
|
3072
2376
|
}, [width, internalWidth, direction, getClampedWidth]);
|
|
3073
2377
|
const onStart = React.useCallback(() => {
|
|
3074
2378
|
setIsResizing(true);
|
|
3075
2379
|
setResizeDelta(0);
|
|
3076
|
-
onResizeStart === null || onResizeStart ===
|
|
2380
|
+
onResizeStart === null || onResizeStart === undefined ? undefined : onResizeStart();
|
|
3077
2381
|
}, [onResizeStart]);
|
|
3078
2382
|
const onMove = React.useCallback((delta) => {
|
|
3079
2383
|
setResizeDelta(delta);
|
|
@@ -3082,11 +2386,11 @@ function useResizableDrawerItem(params) {
|
|
|
3082
2386
|
const newWidth = getResizedWidth(delta);
|
|
3083
2387
|
setIsResizing(false);
|
|
3084
2388
|
setInternalWidth(newWidth);
|
|
3085
|
-
onResize === null || onResize ===
|
|
2389
|
+
onResize === null || onResize === undefined ? undefined : onResize(newWidth);
|
|
3086
2390
|
}, [getResizedWidth, onResize]);
|
|
3087
2391
|
const displayWidth = isResizing
|
|
3088
2392
|
? getResizedWidth(resizeDelta)
|
|
3089
|
-
: getClampedWidth(width !== null && width !==
|
|
2393
|
+
: getClampedWidth(width !== null && width !== undefined ? width : internalWidth);
|
|
3090
2394
|
const handlers = useResizeHandlers({ onStart, onMove, onEnd });
|
|
3091
2395
|
return { resizedWidth: displayWidth, resizerHandlers: handlers };
|
|
3092
2396
|
}
|
|
@@ -3117,9 +2421,11 @@ const DrawerItem = React__default.forwardRef(function DrawerItem(props, ref) {
|
|
|
3117
2421
|
React__default.createElement("div", { className: b('resizer-handle') }))) : null;
|
|
3118
2422
|
return (React__default.createElement(CSSTransition, { in: visible, timeout: TIMEOUT, mountOnEnter: !keepMounted, unmountOnExit: !keepMounted, classNames: b('item-transition', { direction: cssDirection }), nodeRef: itemRef, onEnter: () => setInitialRender(false), onExit: () => setInitialRender(false) },
|
|
3119
2423
|
React__default.createElement("div", { ref: handleRef, className: b('item', { direction: cssDirection, hidden: isInitialRender && !visible }, [className]), style: { width: resizable ? `${resizedWidth}px` : undefined } },
|
|
3120
|
-
resizerElement, children !== null && children !==
|
|
2424
|
+
resizerElement, children !== null && children !== undefined ? children : content)));
|
|
3121
2425
|
});
|
|
3122
|
-
const Drawer = ({ className, veilClassName, children, style, onVeilClick, onEscape,
|
|
2426
|
+
const Drawer = ({ className, veilClassName, children, style, onVeilClick, onEscape,
|
|
2427
|
+
// preventScrollBody = true,
|
|
2428
|
+
hideVeil, disablePortal = true, keepMounted = false, }) => {
|
|
3123
2429
|
let someItemVisible = false;
|
|
3124
2430
|
React__default.Children.forEach(children, (child) => {
|
|
3125
2431
|
if (React__default.isValidElement(child) && child.type === DrawerItem) {
|
|
@@ -3132,7 +2438,7 @@ const Drawer = ({ className, veilClassName, children, style, onVeilClick, onEsca
|
|
|
3132
2438
|
React__default.useEffect(() => {
|
|
3133
2439
|
function onKeyDown(event) {
|
|
3134
2440
|
if (event.key === 'Escape') {
|
|
3135
|
-
onEscape === null || onEscape ===
|
|
2441
|
+
onEscape === null || onEscape === undefined ? undefined : onEscape();
|
|
3136
2442
|
}
|
|
3137
2443
|
}
|
|
3138
2444
|
if (someItemVisible) {
|
|
@@ -3142,7 +2448,7 @@ const Drawer = ({ className, veilClassName, children, style, onVeilClick, onEsca
|
|
|
3142
2448
|
window.removeEventListener('keydown', onKeyDown);
|
|
3143
2449
|
};
|
|
3144
2450
|
}, [onEscape, someItemVisible]);
|
|
3145
|
-
useBodyScrollLock({
|
|
2451
|
+
// useBodyScrollLock({enabled: preventScrollBody && someItemVisible});
|
|
3146
2452
|
const containerRef = React__default.useRef(null);
|
|
3147
2453
|
const veilRef = React__default.useRef(null);
|
|
3148
2454
|
const drawer = (React__default.createElement(Transition, { in: someItemVisible, timeout: { enter: 0, exit: TIMEOUT }, mountOnEnter: !keepMounted, unmountOnExit: !keepMounted, nodeRef: containerRef }, (state) => {
|