@gravity-ui/navigation 2.31.1-beta.0 → 2.32.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-_qjZ9IMA.js → ActionBar-3c6cdf57.js} +14 -10
- package/build/cjs/{ActionBar-_qjZ9IMA.js.map → ActionBar-3c6cdf57.js.map} +1 -1
- package/build/cjs/AsideFallback.js +16 -10
- package/build/cjs/AsideFallback.js.map +1 -1
- package/build/cjs/AsideHeader.js +20 -15
- package/build/cjs/AsideHeader.js.map +1 -1
- package/build/cjs/AsideHeaderContext.js +10 -4
- package/build/cjs/AsideHeaderContext.js.map +1 -1
- package/build/cjs/Content-64d5738a.js +20 -0
- package/build/cjs/{Content-Dy2XkiRi.js.map → Content-64d5738a.js.map} +1 -1
- package/build/cjs/Drawer.js +823 -122
- package/build/cjs/Drawer.js.map +1 -1
- package/build/cjs/{FooterItem-Bl_XrJ67.js → FooterItem-de603636.js} +81 -77
- package/build/cjs/FooterItem-de603636.js.map +1 -0
- package/build/cjs/FooterItem.js +13 -8
- package/build/cjs/FooterItem.js.map +1 -1
- package/build/cjs/{HotkeysPanel-D1wI7tZj.js → HotkeysPanel-1ed9fc32.js} +16 -12
- package/build/cjs/{HotkeysPanel-D1wI7tZj.js.map → HotkeysPanel-1ed9fc32.js.map} +1 -1
- package/build/cjs/Item-ff6bc440.js +303 -0
- package/build/cjs/Item-ff6bc440.js.map +1 -0
- package/build/cjs/PageLayout.js +19 -13
- package/build/cjs/PageLayout.js.map +1 -1
- package/build/cjs/{PageLayoutAside-BzYF9W7M.js → PageLayoutAside-30f2015c.js} +165 -110
- package/build/cjs/PageLayoutAside-30f2015c.js.map +1 -0
- package/build/cjs/PageLayoutAside.js +11 -10
- package/build/cjs/PageLayoutAside.js.map +1 -1
- package/build/cjs/{Settings-D6-a2hgE.js → Settings-8dc2a8ee.js} +102 -110
- package/build/cjs/{Settings-D6-a2hgE.js.map → Settings-8dc2a8ee.js.map} +1 -1
- package/build/cjs/{Title-CzxcSMoP.js → Title-54580605.js} +13 -7
- package/build/cjs/Title-54580605.js.map +1 -0
- package/build/cjs/TopPanel-c6b83157.js +82 -0
- package/build/cjs/TopPanel-c6b83157.js.map +1 -0
- package/build/cjs/{cn-DSlPZbcs.js → cn-9933321a.js} +1 -1
- package/build/cjs/{cn-DSlPZbcs.js.map → cn-9933321a.js.map} +1 -1
- package/build/cjs/components/ActionBar/ActionBar.d.ts +3 -3
- 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/AllPagesListItem/AllPagesListItem.d.ts +3 -0
- package/build/cjs/components/AllPagesPanel/i18n/index.d.ts +1 -5
- package/build/cjs/components/AsideHeader/AsideHeaderContext.d.ts +2 -1
- package/build/cjs/components/AsideHeader/__tests__/helpersPlaywright.d.ts +1 -1
- package/build/cjs/components/AsideHeader/components/TopPanel.d.ts +7 -0
- package/build/cjs/components/AsideHeader/components/index.d.ts +1 -0
- package/build/cjs/components/AsideHeader/i18n/index.d.ts +1 -5
- package/build/cjs/components/AsideHeader/types.d.ts +7 -3
- package/build/cjs/components/AsideHeader/useAsideHeaderTopPanel.d.ts +10 -0
- 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 +2 -15
- 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/__tests__/helpersPlaywright.d.ts +1 -1
- package/build/cjs/components/Footer/mobile/__tests__/helpersPlaywright.d.ts +1 -1
- package/build/cjs/components/FooterItem/__tests__/helpersPlaywright.d.ts +1 -1
- 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/__tests__/helpersPlaywright.d.ts +1 -1
- package/build/cjs/components/MobileHeader/BurgerMenu/__tests__/helpersPlaywright.d.ts +1 -1
- package/build/cjs/components/MobileHeader/MobileHeader.d.ts +1 -2
- package/build/cjs/components/MobileHeader/OverlapPanel/__tests__/helpersPlaywright.d.ts +1 -1
- package/build/cjs/components/MobileHeader/__tests__/helpersPlaywright.d.ts +1 -1
- package/build/cjs/components/MobileHeader/i18n/index.d.ts +1 -5
- package/build/cjs/components/MobileHeader/types.d.ts +1 -0
- package/build/cjs/components/MobileLogo/__tests__/helpersPlaywright.d.ts +1 -1
- package/build/cjs/components/Settings/__tests__/helpersPlaywright.d.ts +1 -1
- package/build/cjs/components/Settings/i18n/index.d.ts +1 -5
- package/build/cjs/components/Title/i18n/index.d.ts +1 -5
- package/build/cjs/components/types.d.ts +4 -4
- package/build/cjs/{constants-B0DLAQY9.js → constants-d81c3867.js} +1 -1
- package/build/{esm/constants-ChYDZ5F2.js.map → cjs/constants-d81c3867.js.map} +1 -1
- package/build/cjs/debounce-8772fd80.js +545 -0
- package/build/{esm/debounce-DW3XyyUs.js.map → cjs/debounce-8772fd80.js.map} +1 -1
- package/build/cjs/{divider-collapsed-BLSp99lJ.js → divider-collapsed-b743122e.js} +9 -7
- package/build/cjs/divider-collapsed-b743122e.js.map +1 -0
- package/build/cjs/hooks/useForwardRef.d.ts +1 -1
- package/build/cjs/index.js +191 -4
- package/build/cjs/index.js.map +1 -1
- package/build/cjs/index2.js +6 -7
- package/build/cjs/index2.js.map +1 -1
- package/build/cjs/index3.js +8 -8
- package/build/cjs/index4.js +9 -12
- package/build/cjs/index4.js.map +1 -1
- package/build/cjs/index5.js +12 -12
- package/build/cjs/index6.js +15 -186
- package/build/cjs/index6.js.map +1 -1
- package/build/cjs/{style-inject.es-CsU6UJbw.js → style-inject.es-dcee06b6.js} +2 -2
- package/build/cjs/style-inject.es-dcee06b6.js.map +1 -0
- package/build/cjs/{tslib.es6-D25eJ2i9.js → tslib.es6-705c6589.js} +31 -33
- package/build/cjs/tslib.es6-705c6589.js.map +1 -0
- package/build/cjs/utils-db3e03c2.js +8 -0
- package/build/cjs/{utils-BrRoop7o.js.map → utils-db3e03c2.js.map} +1 -1
- package/build/esm/{ActionBar-BD_roj92.js → ActionBar-834b178a.js} +5 -5
- package/build/esm/{ActionBar-BD_roj92.js.map → ActionBar-834b178a.js.map} +1 -1
- package/build/esm/AsideFallback.js +5 -5
- package/build/esm/AsideFallback.js.map +1 -1
- package/build/esm/AsideHeader.js +10 -11
- package/build/esm/AsideHeader.js.map +1 -1
- package/build/esm/AsideHeaderContext.js.map +1 -1
- package/build/esm/{Content-c3e3OunO.js → Content-f94ba85d.js} +1 -1
- package/build/esm/{Content-c3e3OunO.js.map → Content-f94ba85d.js.map} +1 -1
- package/build/esm/Drawer.js +784 -90
- package/build/esm/Drawer.js.map +1 -1
- package/build/esm/{FooterItem-BP7Ya02G.js → FooterItem-3cc816a3.js} +43 -43
- package/build/esm/FooterItem-3cc816a3.js.map +1 -0
- package/build/esm/FooterItem.js +6 -7
- package/build/esm/FooterItem.js.map +1 -1
- package/build/esm/{HotkeysPanel-BiJ8VcX-.js → HotkeysPanel-0576deee.js} +4 -4
- package/build/esm/{HotkeysPanel-BiJ8VcX-.js.map → HotkeysPanel-0576deee.js.map} +1 -1
- package/build/esm/{Item-BnjbUb88.js → Item-55899ec8.js} +44 -40
- package/build/esm/Item-55899ec8.js.map +1 -0
- package/build/esm/PageLayout.js +8 -8
- package/build/esm/PageLayout.js.map +1 -1
- package/build/esm/{PageLayoutAside-DQVfkCeA.js → PageLayoutAside-5d010e96.js} +108 -57
- package/build/esm/PageLayoutAside-5d010e96.js.map +1 -0
- package/build/esm/PageLayoutAside.js +9 -10
- package/build/esm/PageLayoutAside.js.map +1 -1
- package/build/esm/{Settings-BPE0n6i2.js → Settings-e660a4c5.js} +24 -36
- package/build/esm/{Settings-BPE0n6i2.js.map → Settings-e660a4c5.js.map} +1 -1
- package/build/esm/{Title-CRlzgg4r.js → Title-03b4255a.js} +6 -4
- package/build/esm/Title-03b4255a.js.map +1 -0
- package/build/esm/TopPanel-cd270f27.js +76 -0
- package/build/esm/TopPanel-cd270f27.js.map +1 -0
- package/build/esm/{cn-CgiqTV3v.js → cn-ffe5e9f5.js} +1 -1
- package/build/esm/{cn-CgiqTV3v.js.map → cn-ffe5e9f5.js.map} +1 -1
- package/build/esm/components/ActionBar/ActionBar.d.ts +3 -3
- 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/AllPagesListItem/AllPagesListItem.d.ts +3 -0
- package/build/esm/components/AllPagesPanel/i18n/index.d.ts +1 -5
- package/build/esm/components/AsideHeader/AsideHeaderContext.d.ts +2 -1
- package/build/esm/components/AsideHeader/__tests__/helpersPlaywright.d.ts +1 -1
- package/build/esm/components/AsideHeader/components/TopPanel.d.ts +7 -0
- package/build/esm/components/AsideHeader/components/index.d.ts +1 -0
- package/build/esm/components/AsideHeader/i18n/index.d.ts +1 -5
- package/build/esm/components/AsideHeader/types.d.ts +7 -3
- package/build/esm/components/AsideHeader/useAsideHeaderTopPanel.d.ts +10 -0
- 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 +2 -15
- 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/__tests__/helpersPlaywright.d.ts +1 -1
- package/build/esm/components/Footer/mobile/__tests__/helpersPlaywright.d.ts +1 -1
- package/build/esm/components/FooterItem/__tests__/helpersPlaywright.d.ts +1 -1
- 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/__tests__/helpersPlaywright.d.ts +1 -1
- package/build/esm/components/MobileHeader/BurgerMenu/__tests__/helpersPlaywright.d.ts +1 -1
- package/build/esm/components/MobileHeader/MobileHeader.d.ts +1 -2
- package/build/esm/components/MobileHeader/OverlapPanel/__tests__/helpersPlaywright.d.ts +1 -1
- package/build/esm/components/MobileHeader/__tests__/helpersPlaywright.d.ts +1 -1
- package/build/esm/components/MobileHeader/i18n/index.d.ts +1 -5
- package/build/esm/components/MobileHeader/types.d.ts +1 -0
- package/build/esm/components/MobileLogo/__tests__/helpersPlaywright.d.ts +1 -1
- package/build/esm/components/Settings/__tests__/helpersPlaywright.d.ts +1 -1
- package/build/esm/components/Settings/i18n/index.d.ts +1 -5
- package/build/esm/components/Title/i18n/index.d.ts +1 -5
- package/build/esm/components/types.d.ts +4 -4
- package/build/esm/{constants-ChYDZ5F2.js → constants-b1604ff5.js} +2 -2
- package/build/{cjs/constants-B0DLAQY9.js.map → esm/constants-b1604ff5.js.map} +1 -1
- package/build/esm/debounce-64cd2b4c.js +543 -0
- package/build/{cjs/debounce-RFF04eVR.js.map → esm/debounce-64cd2b4c.js.map} +1 -1
- package/build/esm/{divider-collapsed-BgKmR8h9.js → divider-collapsed-a0ef54c3.js} +5 -4
- package/build/esm/divider-collapsed-a0ef54c3.js.map +1 -0
- package/build/esm/hooks/useForwardRef.d.ts +1 -1
- package/build/esm/index.js +168 -4
- package/build/esm/index.js.map +1 -1
- package/build/esm/index2.js +3 -6
- package/build/esm/index2.js.map +1 -1
- package/build/esm/index3.js +5 -7
- package/build/esm/index3.js.map +1 -1
- package/build/esm/index4.js +6 -9
- package/build/esm/index4.js.map +1 -1
- package/build/esm/index5.js +7 -8
- package/build/esm/index5.js.map +1 -1
- package/build/esm/index6.js +9 -168
- package/build/esm/index6.js.map +1 -1
- package/build/esm/{style-inject.es-Bff-fD1R.js → style-inject.es-1f59c1d0.js} +2 -2
- package/build/esm/style-inject.es-1f59c1d0.js.map +1 -0
- package/build/esm/{tslib.es6-BCqiemNI.js → tslib.es6-3cd4e99f.js} +31 -33
- package/build/esm/tslib.es6-3cd4e99f.js.map +1 -0
- package/build/esm/utils-117463a5.js +6 -0
- package/build/esm/{utils-D0s6YtvW.js.map → utils-117463a5.js.map} +1 -1
- package/package.json +45 -48
- package/build/cjs/Content-Dy2XkiRi.js +0 -16
- package/build/cjs/FooterItem-Bl_XrJ67.js.map +0 -1
- package/build/cjs/Item-B_-IH1_h.js +0 -295
- package/build/cjs/Item-B_-IH1_h.js.map +0 -1
- package/build/cjs/PageLayoutAside-BzYF9W7M.js.map +0 -1
- package/build/cjs/Title-CzxcSMoP.js.map +0 -1
- package/build/cjs/_commonjsHelpers-BJu3ubxk.js +0 -11
- package/build/cjs/_commonjsHelpers-BJu3ubxk.js.map +0 -1
- package/build/cjs/components/ActionBar/__stories__/ActionBar.stories.d.ts +0 -17
- package/build/cjs/components/ActionBar/__stories__/ActionBarShowcase.d.ts +0 -2
- package/build/cjs/components/ActionBar/__stories__/ActionBarSingleSection.d.ts +0 -2
- package/build/cjs/components/AsideHeader/__stories__/AsideHeader.stories.d.ts +0 -18
- package/build/cjs/components/AsideHeader/__stories__/AsideHeaderShowcase.d.ts +0 -14
- package/build/cjs/components/AsideHeader/__stories__/getAsideHeaderWrapper.d.ts +0 -3
- package/build/cjs/components/AsideHeader/__stories__/moc.d.ts +0 -6
- package/build/cjs/components/Drawer/__stories__/DisablePortal.d.ts +0 -3
- package/build/cjs/components/Drawer/__stories__/Drawer.stories.d.ts +0 -7
- package/build/cjs/components/Drawer/__stories__/DrawerShowcase.d.ts +0 -3
- package/build/cjs/components/Drawer/__stories__/HideVeil.d.ts +0 -3
- package/build/cjs/components/Drawer/__stories__/ResizableItem.d.ts +0 -3
- package/build/cjs/components/Drawer/__stories__/moc.d.ts +0 -2
- package/build/cjs/components/Footer/desktop/__stories__/Footer.stories.d.ts +0 -8
- package/build/cjs/components/Footer/desktop/__stories__/FooterShowcase.d.ts +0 -4
- package/build/cjs/components/Footer/desktop/__stories__/moc.d.ts +0 -3
- package/build/cjs/components/Footer/mobile/__stories__/MobileFooter.stories.d.ts +0 -8
- package/build/cjs/components/Footer/mobile/__stories__/MobileFooterShowcase.d.ts +0 -4
- package/build/cjs/components/Footer/mobile/__stories__/moc.d.ts +0 -3
- package/build/cjs/components/FooterItem/__stories__/FooterItem.stories.d.ts +0 -6
- package/build/cjs/components/HotkeysPanel/__stories__/HotkeysPanel.stories.d.ts +0 -5
- package/build/cjs/components/HotkeysPanel/__stories__/HotkeysPanelShowcase.d.ts +0 -6
- package/build/cjs/components/HotkeysPanel/__stories__/moc.d.ts +0 -2
- package/build/cjs/components/Logo/__stories__/Logo.stories.d.ts +0 -6
- package/build/cjs/components/MobileHeader/BurgerMenu/__stories__/BurgerMenu.stories.d.ts +0 -6
- package/build/cjs/components/MobileHeader/BurgerMenu/__stories__/moc.d.ts +0 -2
- package/build/cjs/components/MobileHeader/OverlapPanel/__stories__/OverlapPanel.stories.d.ts +0 -6
- package/build/cjs/components/MobileHeader/OverlapPanel/__stories__/moc.d.ts +0 -2
- package/build/cjs/components/MobileHeader/__stories__/MobileHeader.stories.d.ts +0 -4
- package/build/cjs/components/MobileHeader/__stories__/MobileHeaderShowcase.d.ts +0 -3
- package/build/cjs/components/MobileHeader/__stories__/moc.d.ts +0 -1
- package/build/cjs/components/MobileLogo/__stories__/MobileLogo.stories.d.ts +0 -6
- package/build/cjs/components/Settings/__stories__/Settings.stories.d.ts +0 -5
- package/build/cjs/components/Settings/__stories__/SettingsDemo.d.ts +0 -14
- package/build/cjs/components/Settings/__stories__/SettingsMobileDemo.d.ts +0 -8
- package/build/cjs/components/TopAlert/TopAlert.d.ts +0 -10
- package/build/cjs/components/TopAlert/index.d.ts +0 -1
- package/build/cjs/components/TopAlert/useTopAlertHeight.d.ts +0 -10
- package/build/cjs/debounce-RFF04eVR.js +0 -660
- package/build/cjs/divider-collapsed-BLSp99lJ.js.map +0 -1
- package/build/cjs/index-B6c8DVdr.js +0 -68
- package/build/cjs/index-B6c8DVdr.js.map +0 -1
- package/build/cjs/style-inject.es-CsU6UJbw.js.map +0 -1
- package/build/cjs/tslib.es6-D25eJ2i9.js.map +0 -1
- package/build/cjs/utils-BrRoop7o.js +0 -8
- package/build/esm/FooterItem-BP7Ya02G.js.map +0 -1
- package/build/esm/Item-BnjbUb88.js.map +0 -1
- package/build/esm/PageLayoutAside-DQVfkCeA.js.map +0 -1
- package/build/esm/Title-CRlzgg4r.js.map +0 -1
- package/build/esm/_commonjsHelpers-BFTU3MAI.js +0 -8
- package/build/esm/_commonjsHelpers-BFTU3MAI.js.map +0 -1
- package/build/esm/components/ActionBar/__stories__/ActionBar.stories.d.ts +0 -17
- package/build/esm/components/ActionBar/__stories__/ActionBarShowcase.d.ts +0 -2
- package/build/esm/components/ActionBar/__stories__/ActionBarSingleSection.d.ts +0 -2
- package/build/esm/components/AsideHeader/__stories__/AsideHeader.stories.d.ts +0 -18
- package/build/esm/components/AsideHeader/__stories__/AsideHeaderShowcase.d.ts +0 -14
- package/build/esm/components/AsideHeader/__stories__/getAsideHeaderWrapper.d.ts +0 -3
- package/build/esm/components/AsideHeader/__stories__/moc.d.ts +0 -6
- package/build/esm/components/Drawer/__stories__/DisablePortal.d.ts +0 -3
- package/build/esm/components/Drawer/__stories__/Drawer.stories.d.ts +0 -7
- package/build/esm/components/Drawer/__stories__/DrawerShowcase.d.ts +0 -3
- package/build/esm/components/Drawer/__stories__/HideVeil.d.ts +0 -3
- package/build/esm/components/Drawer/__stories__/ResizableItem.d.ts +0 -3
- package/build/esm/components/Drawer/__stories__/moc.d.ts +0 -2
- package/build/esm/components/Footer/desktop/__stories__/Footer.stories.d.ts +0 -8
- package/build/esm/components/Footer/desktop/__stories__/FooterShowcase.d.ts +0 -4
- package/build/esm/components/Footer/desktop/__stories__/moc.d.ts +0 -3
- package/build/esm/components/Footer/mobile/__stories__/MobileFooter.stories.d.ts +0 -8
- package/build/esm/components/Footer/mobile/__stories__/MobileFooterShowcase.d.ts +0 -4
- package/build/esm/components/Footer/mobile/__stories__/moc.d.ts +0 -3
- package/build/esm/components/FooterItem/__stories__/FooterItem.stories.d.ts +0 -6
- package/build/esm/components/HotkeysPanel/__stories__/HotkeysPanel.stories.d.ts +0 -5
- package/build/esm/components/HotkeysPanel/__stories__/HotkeysPanelShowcase.d.ts +0 -6
- package/build/esm/components/HotkeysPanel/__stories__/moc.d.ts +0 -2
- package/build/esm/components/Logo/__stories__/Logo.stories.d.ts +0 -6
- package/build/esm/components/MobileHeader/BurgerMenu/__stories__/BurgerMenu.stories.d.ts +0 -6
- package/build/esm/components/MobileHeader/BurgerMenu/__stories__/moc.d.ts +0 -2
- package/build/esm/components/MobileHeader/OverlapPanel/__stories__/OverlapPanel.stories.d.ts +0 -6
- package/build/esm/components/MobileHeader/OverlapPanel/__stories__/moc.d.ts +0 -2
- package/build/esm/components/MobileHeader/__stories__/MobileHeader.stories.d.ts +0 -4
- package/build/esm/components/MobileHeader/__stories__/MobileHeaderShowcase.d.ts +0 -3
- package/build/esm/components/MobileHeader/__stories__/moc.d.ts +0 -1
- package/build/esm/components/MobileLogo/__stories__/MobileLogo.stories.d.ts +0 -6
- package/build/esm/components/Settings/__stories__/Settings.stories.d.ts +0 -5
- package/build/esm/components/Settings/__stories__/SettingsDemo.d.ts +0 -14
- package/build/esm/components/Settings/__stories__/SettingsMobileDemo.d.ts +0 -8
- package/build/esm/components/TopAlert/TopAlert.d.ts +0 -10
- package/build/esm/components/TopAlert/index.d.ts +0 -1
- package/build/esm/components/TopAlert/useTopAlertHeight.d.ts +0 -10
- package/build/esm/debounce-DW3XyyUs.js +0 -658
- package/build/esm/divider-collapsed-BgKmR8h9.js.map +0 -1
- package/build/esm/index-BLdwsphX.js +0 -66
- package/build/esm/index-BLdwsphX.js.map +0 -1
- package/build/esm/style-inject.es-Bff-fD1R.js.map +0 -1
- package/build/esm/tslib.es6-BCqiemNI.js.map +0 -1
- package/build/esm/utils-D0s6YtvW.js +0 -6
package/build/esm/Drawer.js
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
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';
|
|
2
|
+
import React__default, { Children, isValidElement, cloneElement } from 'react';
|
|
3
|
+
import { useForkRef, useBodyScrollLock, Portal } from '@gravity-ui/uikit';
|
|
7
4
|
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';
|
|
8
7
|
import '@bem-react/classname';
|
|
9
8
|
|
|
10
9
|
function _extends() {
|
|
@@ -260,12 +259,14 @@ var hasRequiredReactIs;
|
|
|
260
259
|
function requireReactIs () {
|
|
261
260
|
if (hasRequiredReactIs) return reactIs.exports;
|
|
262
261
|
hasRequiredReactIs = 1;
|
|
262
|
+
(function (module) {
|
|
263
263
|
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
264
|
+
if (process.env.NODE_ENV === 'production') {
|
|
265
|
+
module.exports = requireReactIs_production_min();
|
|
266
|
+
} else {
|
|
267
|
+
module.exports = requireReactIs_development();
|
|
268
|
+
}
|
|
269
|
+
} (reactIs));
|
|
269
270
|
return reactIs.exports;
|
|
270
271
|
}
|
|
271
272
|
|
|
@@ -414,9 +415,9 @@ function requireCheckPropTypes () {
|
|
|
414
415
|
var printWarning = function() {};
|
|
415
416
|
|
|
416
417
|
if (process.env.NODE_ENV !== 'production') {
|
|
417
|
-
var ReactPropTypesSecret =
|
|
418
|
+
var ReactPropTypesSecret = requireReactPropTypesSecret();
|
|
418
419
|
var loggedTypeFailures = {};
|
|
419
|
-
var has =
|
|
420
|
+
var has = requireHas();
|
|
420
421
|
|
|
421
422
|
printWarning = function(text) {
|
|
422
423
|
var message = 'Warning: ' + text;
|
|
@@ -525,9 +526,9 @@ function requireFactoryWithTypeCheckers () {
|
|
|
525
526
|
var ReactIs = requireReactIs();
|
|
526
527
|
var assign = requireObjectAssign();
|
|
527
528
|
|
|
528
|
-
var ReactPropTypesSecret =
|
|
529
|
-
var has =
|
|
530
|
-
var checkPropTypes =
|
|
529
|
+
var ReactPropTypesSecret = requireReactPropTypesSecret();
|
|
530
|
+
var has = requireHas();
|
|
531
|
+
var checkPropTypes = requireCheckPropTypes();
|
|
531
532
|
|
|
532
533
|
var printWarning = function() {};
|
|
533
534
|
|
|
@@ -882,7 +883,7 @@ function requireFactoryWithTypeCheckers () {
|
|
|
882
883
|
|
|
883
884
|
function createUnionTypeChecker(arrayOfTypeCheckers) {
|
|
884
885
|
if (!Array.isArray(arrayOfTypeCheckers)) {
|
|
885
|
-
process.env.NODE_ENV !== 'production' ? printWarning('Invalid argument supplied to oneOfType, expected an instance of array.') :
|
|
886
|
+
process.env.NODE_ENV !== 'production' ? printWarning('Invalid argument supplied to oneOfType, expected an instance of array.') : void 0;
|
|
886
887
|
return emptyFunctionThatReturnsNull;
|
|
887
888
|
}
|
|
888
889
|
|
|
@@ -1140,7 +1141,7 @@ function requireFactoryWithThrowingShims () {
|
|
|
1140
1141
|
if (hasRequiredFactoryWithThrowingShims) return factoryWithThrowingShims;
|
|
1141
1142
|
hasRequiredFactoryWithThrowingShims = 1;
|
|
1142
1143
|
|
|
1143
|
-
var ReactPropTypesSecret =
|
|
1144
|
+
var ReactPropTypesSecret = requireReactPropTypesSecret();
|
|
1144
1145
|
|
|
1145
1146
|
function emptyFunction() {}
|
|
1146
1147
|
function emptyFunctionWithReset() {}
|
|
@@ -1204,29 +1205,19 @@ function requireFactoryWithThrowingShims () {
|
|
|
1204
1205
|
* LICENSE file in the root directory of this source tree.
|
|
1205
1206
|
*/
|
|
1206
1207
|
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
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;
|
|
1208
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
1209
|
+
var ReactIs = requireReactIs();
|
|
1210
|
+
|
|
1211
|
+
// By explicitly using `prop-types` you are opting into new development behavior.
|
|
1212
|
+
// http://fb.me/prop-types-in-prod
|
|
1213
|
+
var throwOnDirectAccess = true;
|
|
1214
|
+
propTypes.exports = requireFactoryWithTypeCheckers()(ReactIs.isElement, throwOnDirectAccess);
|
|
1215
|
+
} else {
|
|
1216
|
+
// By explicitly using `prop-types` you are opting into new production behavior.
|
|
1217
|
+
// http://fb.me/prop-types-in-prod
|
|
1218
|
+
propTypes.exports = requireFactoryWithThrowingShims()();
|
|
1225
1219
|
}
|
|
1226
1220
|
|
|
1227
|
-
var propTypesExports = /*@__PURE__*/ requirePropTypes();
|
|
1228
|
-
var PropTypes = /*@__PURE__*/getDefaultExportFromCjs(propTypesExports);
|
|
1229
|
-
|
|
1230
1221
|
/**
|
|
1231
1222
|
* Checks if a given element has a CSS class.
|
|
1232
1223
|
*
|
|
@@ -1274,22 +1265,22 @@ var config = {
|
|
|
1274
1265
|
disabled: false
|
|
1275
1266
|
};
|
|
1276
1267
|
|
|
1277
|
-
var timeoutsShape = process.env.NODE_ENV !== 'production' ?
|
|
1278
|
-
enter:
|
|
1279
|
-
exit:
|
|
1280
|
-
appear:
|
|
1268
|
+
var timeoutsShape = process.env.NODE_ENV !== 'production' ? propTypes.exports.oneOfType([propTypes.exports.number, propTypes.exports.shape({
|
|
1269
|
+
enter: propTypes.exports.number,
|
|
1270
|
+
exit: propTypes.exports.number,
|
|
1271
|
+
appear: propTypes.exports.number
|
|
1281
1272
|
}).isRequired]) : null;
|
|
1282
|
-
var classNamesShape = process.env.NODE_ENV !== 'production' ?
|
|
1283
|
-
enter:
|
|
1284
|
-
exit:
|
|
1285
|
-
active:
|
|
1286
|
-
}),
|
|
1287
|
-
enter:
|
|
1288
|
-
enterDone:
|
|
1289
|
-
enterActive:
|
|
1290
|
-
exit:
|
|
1291
|
-
exitDone:
|
|
1292
|
-
exitActive:
|
|
1273
|
+
var classNamesShape = process.env.NODE_ENV !== 'production' ? propTypes.exports.oneOfType([propTypes.exports.string, propTypes.exports.shape({
|
|
1274
|
+
enter: propTypes.exports.string,
|
|
1275
|
+
exit: propTypes.exports.string,
|
|
1276
|
+
active: propTypes.exports.string
|
|
1277
|
+
}), propTypes.exports.shape({
|
|
1278
|
+
enter: propTypes.exports.string,
|
|
1279
|
+
enterDone: propTypes.exports.string,
|
|
1280
|
+
enterActive: propTypes.exports.string,
|
|
1281
|
+
exit: propTypes.exports.string,
|
|
1282
|
+
exitDone: propTypes.exports.string,
|
|
1283
|
+
exitActive: propTypes.exports.string
|
|
1293
1284
|
})]) : null;
|
|
1294
1285
|
|
|
1295
1286
|
var TransitionGroupContext = React__default.createContext(null);
|
|
@@ -1508,7 +1499,7 @@ var Transition = /*#__PURE__*/function (_React$Component) {
|
|
|
1508
1499
|
};
|
|
1509
1500
|
|
|
1510
1501
|
_proto.updateStatus = function updateStatus(mounting, nextStatus) {
|
|
1511
|
-
if (mounting ===
|
|
1502
|
+
if (mounting === void 0) {
|
|
1512
1503
|
mounting = false;
|
|
1513
1504
|
}
|
|
1514
1505
|
|
|
@@ -1716,10 +1707,10 @@ Transition.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
1716
1707
|
* (see
|
|
1717
1708
|
* [test/CSSTransition-test.js](https://github.com/reactjs/react-transition-group/blob/13435f897b3ab71f6e19d724f145596f5910581c/test/CSSTransition-test.js#L362-L437)).
|
|
1718
1709
|
*/
|
|
1719
|
-
nodeRef:
|
|
1720
|
-
current: typeof Element === 'undefined' ?
|
|
1710
|
+
nodeRef: propTypes.exports.shape({
|
|
1711
|
+
current: typeof Element === 'undefined' ? propTypes.exports.any : function (propValue, key, componentName, location, propFullName, secret) {
|
|
1721
1712
|
var value = propValue[key];
|
|
1722
|
-
return
|
|
1713
|
+
return propTypes.exports.instanceOf(value && 'ownerDocument' in value ? value.ownerDocument.defaultView.Element : Element)(propValue, key, componentName, location, propFullName, secret);
|
|
1723
1714
|
}
|
|
1724
1715
|
}),
|
|
1725
1716
|
|
|
@@ -1737,12 +1728,12 @@ Transition.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
1737
1728
|
* </Transition>
|
|
1738
1729
|
* ```
|
|
1739
1730
|
*/
|
|
1740
|
-
children:
|
|
1731
|
+
children: propTypes.exports.oneOfType([propTypes.exports.func.isRequired, propTypes.exports.element.isRequired]).isRequired,
|
|
1741
1732
|
|
|
1742
1733
|
/**
|
|
1743
1734
|
* Show the component; triggers the enter or exit states
|
|
1744
1735
|
*/
|
|
1745
|
-
in:
|
|
1736
|
+
in: propTypes.exports.bool,
|
|
1746
1737
|
|
|
1747
1738
|
/**
|
|
1748
1739
|
* By default the child component is mounted immediately along with
|
|
@@ -1750,13 +1741,13 @@ Transition.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
1750
1741
|
* first `in={true}` you can set `mountOnEnter`. After the first enter transition the component will stay
|
|
1751
1742
|
* mounted, even on "exited", unless you also specify `unmountOnExit`.
|
|
1752
1743
|
*/
|
|
1753
|
-
mountOnEnter:
|
|
1744
|
+
mountOnEnter: propTypes.exports.bool,
|
|
1754
1745
|
|
|
1755
1746
|
/**
|
|
1756
1747
|
* By default the child component stays mounted after it reaches the `'exited'` state.
|
|
1757
1748
|
* Set `unmountOnExit` if you'd prefer to unmount the component after it finishes exiting.
|
|
1758
1749
|
*/
|
|
1759
|
-
unmountOnExit:
|
|
1750
|
+
unmountOnExit: propTypes.exports.bool,
|
|
1760
1751
|
|
|
1761
1752
|
/**
|
|
1762
1753
|
* By default the child component does not perform the enter transition when
|
|
@@ -1769,17 +1760,17 @@ Transition.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
1769
1760
|
* > additional `.appear-*` classes, that way you can choose to style it
|
|
1770
1761
|
* > differently.
|
|
1771
1762
|
*/
|
|
1772
|
-
appear:
|
|
1763
|
+
appear: propTypes.exports.bool,
|
|
1773
1764
|
|
|
1774
1765
|
/**
|
|
1775
1766
|
* Enable or disable enter transitions.
|
|
1776
1767
|
*/
|
|
1777
|
-
enter:
|
|
1768
|
+
enter: propTypes.exports.bool,
|
|
1778
1769
|
|
|
1779
1770
|
/**
|
|
1780
1771
|
* Enable or disable exit transitions.
|
|
1781
1772
|
*/
|
|
1782
|
-
exit:
|
|
1773
|
+
exit: propTypes.exports.bool,
|
|
1783
1774
|
|
|
1784
1775
|
/**
|
|
1785
1776
|
* The duration of the transition, in milliseconds.
|
|
@@ -1815,7 +1806,7 @@ Transition.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
1815
1806
|
args[_key - 1] = arguments[_key];
|
|
1816
1807
|
}
|
|
1817
1808
|
|
|
1818
|
-
return pt.apply(
|
|
1809
|
+
return pt.apply(void 0, [props].concat(args));
|
|
1819
1810
|
},
|
|
1820
1811
|
|
|
1821
1812
|
/**
|
|
@@ -1832,7 +1823,7 @@ Transition.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
1832
1823
|
* }}
|
|
1833
1824
|
* ```
|
|
1834
1825
|
*/
|
|
1835
|
-
addEndListener:
|
|
1826
|
+
addEndListener: propTypes.exports.func,
|
|
1836
1827
|
|
|
1837
1828
|
/**
|
|
1838
1829
|
* Callback fired before the "entering" status is applied. An extra parameter
|
|
@@ -1842,7 +1833,7 @@ Transition.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
1842
1833
|
*
|
|
1843
1834
|
* @type Function(node: HtmlElement, isAppearing: bool) -> void
|
|
1844
1835
|
*/
|
|
1845
|
-
onEnter:
|
|
1836
|
+
onEnter: propTypes.exports.func,
|
|
1846
1837
|
|
|
1847
1838
|
/**
|
|
1848
1839
|
* Callback fired after the "entering" status is applied. An extra parameter
|
|
@@ -1852,7 +1843,7 @@ Transition.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
1852
1843
|
*
|
|
1853
1844
|
* @type Function(node: HtmlElement, isAppearing: bool)
|
|
1854
1845
|
*/
|
|
1855
|
-
onEntering:
|
|
1846
|
+
onEntering: propTypes.exports.func,
|
|
1856
1847
|
|
|
1857
1848
|
/**
|
|
1858
1849
|
* Callback fired after the "entered" status is applied. An extra parameter
|
|
@@ -1862,7 +1853,7 @@ Transition.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
1862
1853
|
*
|
|
1863
1854
|
* @type Function(node: HtmlElement, isAppearing: bool) -> void
|
|
1864
1855
|
*/
|
|
1865
|
-
onEntered:
|
|
1856
|
+
onEntered: propTypes.exports.func,
|
|
1866
1857
|
|
|
1867
1858
|
/**
|
|
1868
1859
|
* Callback fired before the "exiting" status is applied.
|
|
@@ -1871,7 +1862,7 @@ Transition.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
1871
1862
|
*
|
|
1872
1863
|
* @type Function(node: HtmlElement) -> void
|
|
1873
1864
|
*/
|
|
1874
|
-
onExit:
|
|
1865
|
+
onExit: propTypes.exports.func,
|
|
1875
1866
|
|
|
1876
1867
|
/**
|
|
1877
1868
|
* Callback fired after the "exiting" status is applied.
|
|
@@ -1880,7 +1871,7 @@ Transition.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
1880
1871
|
*
|
|
1881
1872
|
* @type Function(node: HtmlElement) -> void
|
|
1882
1873
|
*/
|
|
1883
|
-
onExiting:
|
|
1874
|
+
onExiting: propTypes.exports.func,
|
|
1884
1875
|
|
|
1885
1876
|
/**
|
|
1886
1877
|
* Callback fired after the "exited" status is applied.
|
|
@@ -1889,7 +1880,7 @@ Transition.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
1889
1880
|
*
|
|
1890
1881
|
* @type Function(node: HtmlElement) -> void
|
|
1891
1882
|
*/
|
|
1892
|
-
onExited:
|
|
1883
|
+
onExited: propTypes.exports.func
|
|
1893
1884
|
} : {}; // Name the function so it is clearer in the documentation
|
|
1894
1885
|
|
|
1895
1886
|
function noop() {}
|
|
@@ -2263,7 +2254,7 @@ CSSTransition.propTypes = process.env.NODE_ENV !== "production" ? _extends({}, T
|
|
|
2263
2254
|
*
|
|
2264
2255
|
* @type Function(node: HtmlElement, isAppearing: bool)
|
|
2265
2256
|
*/
|
|
2266
|
-
onEnter:
|
|
2257
|
+
onEnter: propTypes.exports.func,
|
|
2267
2258
|
|
|
2268
2259
|
/**
|
|
2269
2260
|
* A `<Transition>` callback fired immediately after the 'enter-active' or
|
|
@@ -2273,7 +2264,7 @@ CSSTransition.propTypes = process.env.NODE_ENV !== "production" ? _extends({}, T
|
|
|
2273
2264
|
*
|
|
2274
2265
|
* @type Function(node: HtmlElement, isAppearing: bool)
|
|
2275
2266
|
*/
|
|
2276
|
-
onEntering:
|
|
2267
|
+
onEntering: propTypes.exports.func,
|
|
2277
2268
|
|
|
2278
2269
|
/**
|
|
2279
2270
|
* A `<Transition>` callback fired immediately after the 'enter' or
|
|
@@ -2283,7 +2274,7 @@ CSSTransition.propTypes = process.env.NODE_ENV !== "production" ? _extends({}, T
|
|
|
2283
2274
|
*
|
|
2284
2275
|
* @type Function(node: HtmlElement, isAppearing: bool)
|
|
2285
2276
|
*/
|
|
2286
|
-
onEntered:
|
|
2277
|
+
onEntered: propTypes.exports.func,
|
|
2287
2278
|
|
|
2288
2279
|
/**
|
|
2289
2280
|
* A `<Transition>` callback fired immediately after the 'exit' class is
|
|
@@ -2293,7 +2284,7 @@ CSSTransition.propTypes = process.env.NODE_ENV !== "production" ? _extends({}, T
|
|
|
2293
2284
|
*
|
|
2294
2285
|
* @type Function(node: HtmlElement)
|
|
2295
2286
|
*/
|
|
2296
|
-
onExit:
|
|
2287
|
+
onExit: propTypes.exports.func,
|
|
2297
2288
|
|
|
2298
2289
|
/**
|
|
2299
2290
|
* A `<Transition>` callback fired immediately after the 'exit-active' is applied.
|
|
@@ -2302,7 +2293,7 @@ CSSTransition.propTypes = process.env.NODE_ENV !== "production" ? _extends({}, T
|
|
|
2302
2293
|
*
|
|
2303
2294
|
* @type Function(node: HtmlElement)
|
|
2304
2295
|
*/
|
|
2305
|
-
onExiting:
|
|
2296
|
+
onExiting: propTypes.exports.func,
|
|
2306
2297
|
|
|
2307
2298
|
/**
|
|
2308
2299
|
* A `<Transition>` callback fired immediately after the 'exit' classes
|
|
@@ -2312,15 +2303,720 @@ CSSTransition.propTypes = process.env.NODE_ENV !== "production" ? _extends({}, T
|
|
|
2312
2303
|
*
|
|
2313
2304
|
* @type Function(node: HtmlElement)
|
|
2314
2305
|
*/
|
|
2315
|
-
onExited:
|
|
2306
|
+
onExited: propTypes.exports.func
|
|
2316
2307
|
}) : {};
|
|
2317
2308
|
|
|
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
|
+
|
|
2318
3014
|
const DRAWER_ITEM_MIN_RESIZE_WIDTH = 200;
|
|
2319
3015
|
const DRAWER_ITEM_MAX_RESIZE_WIDTH = 800;
|
|
2320
3016
|
const DRAWER_ITEM_INITIAL_RESIZE_WIDTH = 400;
|
|
2321
3017
|
function getEventClientX(e) {
|
|
2322
3018
|
var _a, _b;
|
|
2323
|
-
return 'touches' in e ? (
|
|
3019
|
+
return 'touches' in e ? (_b = (_a = e.touches[0]) === null || _a === void 0 ? void 0 : _a.clientX) !== null && _b !== void 0 ? _b : 0 : e.clientX;
|
|
2324
3020
|
}
|
|
2325
3021
|
function useResizeHandlers({ onStart, onMove, onEnd }) {
|
|
2326
3022
|
const initialXPosition = React.useRef(0);
|
|
@@ -2367,17 +3063,17 @@ function useResizableDrawerItem(params) {
|
|
|
2367
3063
|
const { direction, width, minResizeWidth = DRAWER_ITEM_MIN_RESIZE_WIDTH, maxResizeWidth = DRAWER_ITEM_MAX_RESIZE_WIDTH, onResizeStart, onResize, } = params;
|
|
2368
3064
|
const [isResizing, setIsResizing] = React.useState(false);
|
|
2369
3065
|
const [resizeDelta, setResizeDelta] = React.useState(0);
|
|
2370
|
-
const [internalWidth, setInternalWidth] = React.useState(width !== null && width !==
|
|
3066
|
+
const [internalWidth, setInternalWidth] = React.useState(width !== null && width !== void 0 ? width : DRAWER_ITEM_INITIAL_RESIZE_WIDTH);
|
|
2371
3067
|
const getClampedWidth = React.useCallback((width) => Math.min(Math.max(width, minResizeWidth), maxResizeWidth), [minResizeWidth, maxResizeWidth]);
|
|
2372
3068
|
const getResizedWidth = React.useCallback((delta) => {
|
|
2373
3069
|
const signedDelta = direction === 'right' ? delta : -delta;
|
|
2374
|
-
const newWidth = (width !== null && width !==
|
|
3070
|
+
const newWidth = (width !== null && width !== void 0 ? width : internalWidth) + signedDelta;
|
|
2375
3071
|
return getClampedWidth(newWidth);
|
|
2376
3072
|
}, [width, internalWidth, direction, getClampedWidth]);
|
|
2377
3073
|
const onStart = React.useCallback(() => {
|
|
2378
3074
|
setIsResizing(true);
|
|
2379
3075
|
setResizeDelta(0);
|
|
2380
|
-
onResizeStart === null || onResizeStart ===
|
|
3076
|
+
onResizeStart === null || onResizeStart === void 0 ? void 0 : onResizeStart();
|
|
2381
3077
|
}, [onResizeStart]);
|
|
2382
3078
|
const onMove = React.useCallback((delta) => {
|
|
2383
3079
|
setResizeDelta(delta);
|
|
@@ -2386,11 +3082,11 @@ function useResizableDrawerItem(params) {
|
|
|
2386
3082
|
const newWidth = getResizedWidth(delta);
|
|
2387
3083
|
setIsResizing(false);
|
|
2388
3084
|
setInternalWidth(newWidth);
|
|
2389
|
-
onResize === null || onResize ===
|
|
3085
|
+
onResize === null || onResize === void 0 ? void 0 : onResize(newWidth);
|
|
2390
3086
|
}, [getResizedWidth, onResize]);
|
|
2391
3087
|
const displayWidth = isResizing
|
|
2392
3088
|
? getResizedWidth(resizeDelta)
|
|
2393
|
-
: getClampedWidth(width !== null && width !==
|
|
3089
|
+
: getClampedWidth(width !== null && width !== void 0 ? width : internalWidth);
|
|
2394
3090
|
const handlers = useResizeHandlers({ onStart, onMove, onEnd });
|
|
2395
3091
|
return { resizedWidth: displayWidth, resizerHandlers: handlers };
|
|
2396
3092
|
}
|
|
@@ -2421,11 +3117,9 @@ const DrawerItem = React__default.forwardRef(function DrawerItem(props, ref) {
|
|
|
2421
3117
|
React__default.createElement("div", { className: b('resizer-handle') }))) : null;
|
|
2422
3118
|
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) },
|
|
2423
3119
|
React__default.createElement("div", { ref: handleRef, className: b('item', { direction: cssDirection, hidden: isInitialRender && !visible }, [className]), style: { width: resizable ? `${resizedWidth}px` : undefined } },
|
|
2424
|
-
resizerElement, children !== null && children !==
|
|
3120
|
+
resizerElement, children !== null && children !== void 0 ? children : content)));
|
|
2425
3121
|
});
|
|
2426
|
-
const Drawer = ({ className, veilClassName, children, style, onVeilClick, onEscape,
|
|
2427
|
-
// preventScrollBody = true,
|
|
2428
|
-
hideVeil, disablePortal = true, keepMounted = false, }) => {
|
|
3122
|
+
const Drawer = ({ className, veilClassName, children, style, onVeilClick, onEscape, preventScrollBody = true, hideVeil, disablePortal = true, keepMounted = false, }) => {
|
|
2429
3123
|
let someItemVisible = false;
|
|
2430
3124
|
React__default.Children.forEach(children, (child) => {
|
|
2431
3125
|
if (React__default.isValidElement(child) && child.type === DrawerItem) {
|
|
@@ -2438,7 +3132,7 @@ hideVeil, disablePortal = true, keepMounted = false, }) => {
|
|
|
2438
3132
|
React__default.useEffect(() => {
|
|
2439
3133
|
function onKeyDown(event) {
|
|
2440
3134
|
if (event.key === 'Escape') {
|
|
2441
|
-
onEscape === null || onEscape ===
|
|
3135
|
+
onEscape === null || onEscape === void 0 ? void 0 : onEscape();
|
|
2442
3136
|
}
|
|
2443
3137
|
}
|
|
2444
3138
|
if (someItemVisible) {
|
|
@@ -2448,7 +3142,7 @@ hideVeil, disablePortal = true, keepMounted = false, }) => {
|
|
|
2448
3142
|
window.removeEventListener('keydown', onKeyDown);
|
|
2449
3143
|
};
|
|
2450
3144
|
}, [onEscape, someItemVisible]);
|
|
2451
|
-
|
|
3145
|
+
useBodyScrollLock({ enabled: preventScrollBody && someItemVisible });
|
|
2452
3146
|
const containerRef = React__default.useRef(null);
|
|
2453
3147
|
const veilRef = React__default.useRef(null);
|
|
2454
3148
|
const drawer = (React__default.createElement(Transition, { in: someItemVisible, timeout: { enter: 0, exit: TIMEOUT }, mountOnEnter: !keepMounted, unmountOnExit: !keepMounted, nodeRef: containerRef }, (state) => {
|