@consta/header 0.4.4 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Badges/index.d.ts +1 -1
- package/Badges/index.js +1 -2
- package/ButtonMenu/index.d.ts +1 -1
- package/ButtonMenu/index.js +1 -2
- package/Header/index.d.ts +1 -1
- package/Header/index.js +1 -2
- package/Languages/index.d.ts +1 -1
- package/Languages/index.js +1 -2
- package/Layout/index.d.ts +1 -1
- package/Layout/index.js +1 -2
- package/Menu/index.d.ts +1 -1
- package/Menu/index.js +1 -2
- package/MobileMenu/index.d.ts +1 -1
- package/MobileMenu/index.js +1 -2
- package/Notifications/index.d.ts +1 -1
- package/Notifications/index.js +1 -2
- package/NotificationsList/index.d.ts +1 -1
- package/NotificationsList/index.js +1 -2
- package/README.md +11 -16
- package/SelectMenu/index.d.ts +1 -1
- package/SelectMenu/index.js +1 -2
- package/TileMenu/index.d.ts +1 -1
- package/TileMenu/index.js +1 -2
- package/VerticalMenu/index.d.ts +1 -1
- package/VerticalMenu/index.js +1 -2
- package/__internal__/src/common.d.js +2 -0
- package/__internal__/src/common.d.js.map +1 -0
- package/__internal__/src/components/Badges/Badges.css +1 -0
- package/{Badges → __internal__/src/components/Badges}/Badges.d.ts +2 -2
- package/__internal__/src/components/Badges/Badges.js +2 -0
- package/__internal__/src/components/Badges/Badges.js.map +1 -0
- package/{Badges → __internal__/src/components/Badges}/helpers.d.ts +3 -3
- package/__internal__/src/components/Badges/helpers.js +2 -0
- package/__internal__/src/components/Badges/helpers.js.map +1 -0
- package/__internal__/src/components/Badges/index.d.ts +1 -0
- package/__internal__/src/components/Badges/index.js +2 -0
- package/__internal__/src/components/Badges/index.js.map +1 -0
- package/{Badges → __internal__/src/components/Badges}/types.d.ts +2 -2
- package/__internal__/src/components/Badges/types.js +2 -0
- package/__internal__/src/components/Badges/types.js.map +1 -0
- package/__internal__/src/components/ButtonMenu/ButtonMenu.css +1 -0
- package/{ButtonMenu → __internal__/src/components/ButtonMenu}/ButtonMenu.d.ts +2 -2
- package/__internal__/src/components/ButtonMenu/ButtonMenu.js +2 -0
- package/__internal__/src/components/ButtonMenu/ButtonMenu.js.map +1 -0
- package/{ButtonMenu → __internal__/src/components/ButtonMenu}/helpers.d.ts +4 -4
- package/__internal__/src/components/ButtonMenu/helpers.js +2 -0
- package/__internal__/src/components/ButtonMenu/helpers.js.map +1 -0
- package/__internal__/src/components/ButtonMenu/index.d.ts +1 -0
- package/__internal__/src/components/ButtonMenu/index.js +2 -0
- package/__internal__/src/components/ButtonMenu/index.js.map +1 -0
- package/{ButtonMenu → __internal__/src/components/ButtonMenu}/types.d.ts +2 -2
- package/__internal__/src/components/ButtonMenu/types.js +2 -0
- package/__internal__/src/components/ButtonMenu/types.js.map +1 -0
- package/__internal__/src/components/Header/Header.css +1 -0
- package/{Header → __internal__/src/components/Header}/Header.d.ts +2 -2
- package/__internal__/src/components/Header/Header.js +2 -0
- package/__internal__/src/components/Header/Header.js.map +1 -0
- package/{Header → __internal__/src/components/Header}/HeaderLogin/HeaderLogin.d.ts +0 -0
- package/__internal__/src/components/Header/HeaderLogin/HeaderLogin.js +2 -0
- package/__internal__/src/components/Header/HeaderLogin/HeaderLogin.js.map +1 -0
- package/__internal__/src/components/Header/HeaderLogin/index.d.ts +1 -0
- package/{Header → __internal__/src/components/Header}/HeaderLogin/index.js +0 -0
- package/__internal__/src/components/Header/HeaderLogin/index.js.map +1 -0
- package/{Header → __internal__/src/components/Header}/HeaderLogo/HeaderLogo.d.ts +0 -0
- package/__internal__/src/components/Header/HeaderLogo/HeaderLogo.js +2 -0
- package/__internal__/src/components/Header/HeaderLogo/HeaderLogo.js.map +1 -0
- package/__internal__/src/components/Header/HeaderLogo/index.d.ts +1 -0
- package/{Header → __internal__/src/components/Header}/HeaderLogo/index.js +0 -0
- package/__internal__/src/components/Header/HeaderLogo/index.js.map +1 -0
- package/{Header → __internal__/src/components/Header}/HeaderSearch/HeaderSearch.css +0 -0
- package/{Header → __internal__/src/components/Header}/HeaderSearch/HeaderSearch.d.ts +2 -2
- package/__internal__/src/components/Header/HeaderSearch/HeaderSearch.js +2 -0
- package/__internal__/src/components/Header/HeaderSearch/HeaderSearch.js.map +1 -0
- package/__internal__/src/components/Header/HeaderSearch/index.d.ts +1 -0
- package/{Header → __internal__/src/components/Header}/HeaderSearch/index.js +0 -0
- package/__internal__/src/components/Header/HeaderSearch/index.js.map +1 -0
- package/{Header → __internal__/src/components/Header}/helpers.d.ts +2 -2
- package/__internal__/src/components/Header/helpers.js +2 -0
- package/__internal__/src/components/Header/helpers.js.map +1 -0
- package/__internal__/src/components/Header/index.d.ts +1 -0
- package/__internal__/src/components/Header/index.js +2 -0
- package/__internal__/src/components/Header/index.js.map +1 -0
- package/{Header → __internal__/src/components/Header}/types.d.ts +11 -11
- package/__internal__/src/components/Header/types.js +2 -0
- package/__internal__/src/components/Header/types.js.map +1 -0
- package/__internal__/src/components/Languages/Languages.d.ts +3 -0
- package/__internal__/src/components/Languages/Languages.js +2 -0
- package/__internal__/src/components/Languages/Languages.js.map +1 -0
- package/__internal__/src/components/Languages/helpers.d.ts +20 -0
- package/__internal__/src/components/Languages/helpers.js +2 -0
- package/__internal__/src/components/Languages/helpers.js.map +1 -0
- package/__internal__/src/components/Languages/index.d.ts +1 -0
- package/__internal__/src/components/Languages/index.js +2 -0
- package/__internal__/src/components/Languages/index.js.map +1 -0
- package/{Languages → __internal__/src/components/Languages}/types.d.ts +2 -2
- package/__internal__/src/components/Languages/types.js +2 -0
- package/__internal__/src/components/Languages/types.js.map +1 -0
- package/{Layout → __internal__/src/components/Layout}/Layout.css +0 -0
- package/__internal__/src/components/Layout/Layout.d.ts +5 -0
- package/__internal__/src/components/Layout/Layout.js +2 -0
- package/__internal__/src/components/Layout/Layout.js.map +1 -0
- package/__internal__/src/components/Layout/LayoutRow/LayoutRow.css +1 -0
- package/{Layout → __internal__/src/components/Layout}/LayoutRow/LayoutRow.d.ts +3 -3
- package/__internal__/src/components/Layout/LayoutRow/LayoutRow.js +2 -0
- package/__internal__/src/components/Layout/LayoutRow/LayoutRow.js.map +1 -0
- package/{Layout → __internal__/src/components/Layout}/helpers.d.ts +1 -1
- package/{Layout → __internal__/src/components/Layout}/helpers.js +0 -0
- package/__internal__/src/components/Layout/helpers.js.map +1 -0
- package/__internal__/src/components/Layout/index.d.ts +1 -0
- package/__internal__/src/components/Layout/index.js +2 -0
- package/__internal__/src/components/Layout/index.js.map +1 -0
- package/__internal__/src/components/Layout/types.d.ts +14 -0
- package/__internal__/src/components/Layout/types.js +2 -0
- package/__internal__/src/components/Layout/types.js.map +1 -0
- package/__internal__/src/components/Menu/Menu.css +1 -0
- package/{Menu → __internal__/src/components/Menu}/Menu.d.ts +2 -2
- package/__internal__/src/components/Menu/Menu.js +2 -0
- package/__internal__/src/components/Menu/Menu.js.map +1 -0
- package/{Menu → __internal__/src/components/Menu}/helpers.d.ts +3 -2
- package/__internal__/src/components/Menu/helpers.js +2 -0
- package/__internal__/src/components/Menu/helpers.js.map +1 -0
- package/__internal__/src/components/Menu/index.d.ts +1 -0
- package/__internal__/src/components/Menu/index.js +2 -0
- package/__internal__/src/components/Menu/index.js.map +1 -0
- package/{Menu → __internal__/src/components/Menu}/types.d.ts +2 -1
- package/__internal__/src/components/Menu/types.js +2 -0
- package/__internal__/src/components/Menu/types.js.map +1 -0
- package/__internal__/src/components/MobileMenu/MobileMenu.css +1 -0
- package/{MobileMenu → __internal__/src/components/MobileMenu}/MobileMenu.d.ts +2 -2
- package/__internal__/src/components/MobileMenu/MobileMenu.js +2 -0
- package/__internal__/src/components/MobileMenu/MobileMenu.js.map +1 -0
- package/__internal__/src/components/MobileMenu/index.d.ts +1 -0
- package/__internal__/src/components/MobileMenu/index.js +2 -0
- package/__internal__/src/components/MobileMenu/index.js.map +1 -0
- package/{MobileMenu → __internal__/src/components/MobileMenu}/types.d.ts +3 -3
- package/__internal__/src/components/MobileMenu/types.js +2 -0
- package/__internal__/src/components/MobileMenu/types.js.map +1 -0
- package/{__private__ → __internal__/src}/components/NotificationCard/NotificationCard.css +1 -1
- package/__internal__/src/components/NotificationCard/NotificationCard.d.ts +6 -0
- package/__internal__/src/components/NotificationCard/NotificationCard.js +2 -0
- package/__internal__/src/components/NotificationCard/NotificationCard.js.map +1 -0
- package/{__private__ → __internal__/src}/components/NotificationCard/helpers.d.ts +0 -0
- package/{__private__ → __internal__/src}/components/NotificationCard/helpers.js +0 -0
- package/__internal__/src/components/NotificationCard/helpers.js.map +1 -0
- package/__internal__/src/components/NotificationCard/index.d.ts +1 -0
- package/{__private__ → __internal__/src}/components/NotificationCard/index.js +0 -0
- package/__internal__/src/components/NotificationCard/index.js.map +1 -0
- package/{__private__ → __internal__/src}/components/NotificationCard/types.d.ts +1 -1
- package/__internal__/src/components/NotificationCard/types.js +2 -0
- package/__internal__/src/components/NotificationCard/types.js.map +1 -0
- package/__internal__/src/components/Notifications/Notifications.css +1 -0
- package/{Notifications → __internal__/src/components/Notifications}/Notifications.d.ts +1 -1
- package/__internal__/src/components/Notifications/Notifications.js +2 -0
- package/__internal__/src/components/Notifications/Notifications.js.map +1 -0
- package/__internal__/src/components/Notifications/index.d.ts +1 -0
- package/__internal__/src/components/Notifications/index.js +2 -0
- package/__internal__/src/components/Notifications/index.js.map +1 -0
- package/{Notifications → __internal__/src/components/Notifications}/types.d.ts +2 -2
- package/__internal__/src/components/Notifications/types.js +2 -0
- package/__internal__/src/components/Notifications/types.js.map +1 -0
- package/{__private__ → __internal__/src}/components/NotificationsActions/NotificationsActions.d.ts +1 -1
- package/__internal__/src/components/NotificationsActions/NotificationsActions.js +2 -0
- package/__internal__/src/components/NotificationsActions/NotificationsActions.js.map +1 -0
- package/{__private__ → __internal__/src}/components/NotificationsActions/helpers.d.ts +4 -5
- package/__internal__/src/components/NotificationsActions/helpers.js +2 -0
- package/__internal__/src/components/NotificationsActions/helpers.js.map +1 -0
- package/__internal__/src/components/NotificationsActions/index.d.ts +1 -0
- package/{__private__ → __internal__/src}/components/NotificationsActions/index.js +0 -0
- package/__internal__/src/components/NotificationsActions/index.js.map +1 -0
- package/{__private__ → __internal__/src}/components/NotificationsActions/types.d.ts +1 -1
- package/__internal__/src/components/NotificationsActions/types.js +2 -0
- package/__internal__/src/components/NotificationsActions/types.js.map +1 -0
- package/__internal__/src/components/NotificationsList/NotificationsList.css +1 -0
- package/{NotificationsList → __internal__/src/components/NotificationsList}/NotificationsList.d.ts +2 -2
- package/__internal__/src/components/NotificationsList/NotificationsList.js +2 -0
- package/__internal__/src/components/NotificationsList/NotificationsList.js.map +1 -0
- package/{NotificationsList → __internal__/src/components/NotificationsList}/helpers.d.ts +3 -3
- package/__internal__/src/components/NotificationsList/helpers.js +2 -0
- package/__internal__/src/components/NotificationsList/helpers.js.map +1 -0
- package/__internal__/src/components/NotificationsList/index.d.ts +1 -0
- package/__internal__/src/components/NotificationsList/index.js +2 -0
- package/__internal__/src/components/NotificationsList/index.js.map +1 -0
- package/{NotificationsList → __internal__/src/components/NotificationsList}/types.d.ts +1 -1
- package/__internal__/src/components/NotificationsList/types.js +2 -0
- package/__internal__/src/components/NotificationsList/types.js.map +1 -0
- package/__internal__/src/components/SelectMenu/SelectMenu.css +1 -0
- package/{SelectMenu → __internal__/src/components/SelectMenu}/SelectMenu.d.ts +2 -2
- package/__internal__/src/components/SelectMenu/SelectMenu.js +2 -0
- package/__internal__/src/components/SelectMenu/SelectMenu.js.map +1 -0
- package/{SelectMenu → __internal__/src/components/SelectMenu}/helpers.d.ts +2 -2
- package/__internal__/src/components/SelectMenu/helpers.js +2 -0
- package/__internal__/src/components/SelectMenu/helpers.js.map +1 -0
- package/__internal__/src/components/SelectMenu/index.d.ts +1 -0
- package/__internal__/src/components/SelectMenu/index.js +2 -0
- package/__internal__/src/components/SelectMenu/index.js.map +1 -0
- package/{SelectMenu → __internal__/src/components/SelectMenu}/types.d.ts +1 -1
- package/__internal__/src/components/SelectMenu/types.js +2 -0
- package/__internal__/src/components/SelectMenu/types.js.map +1 -0
- package/__internal__/src/components/Sidebar/Sidebar.css +1 -0
- package/{__private__ → __internal__/src}/components/Sidebar/Sidebar.d.ts +1 -1
- package/__internal__/src/components/Sidebar/Sidebar.js +2 -0
- package/__internal__/src/components/Sidebar/Sidebar.js.map +1 -0
- package/__internal__/src/components/Sidebar/index.d.ts +1 -0
- package/{__private__ → __internal__/src}/components/Sidebar/index.js +0 -0
- package/__internal__/src/components/Sidebar/index.js.map +1 -0
- package/__internal__/src/components/TileMenu/TileMenu.css +1 -0
- package/{TileMenu → __internal__/src/components/TileMenu}/TileMenu.d.ts +2 -2
- package/__internal__/src/components/TileMenu/TileMenu.js +2 -0
- package/__internal__/src/components/TileMenu/TileMenu.js.map +1 -0
- package/__internal__/src/components/TileMenu/TileMenuItem/TileMenuItem.css +1 -0
- package/{TileMenu → __internal__/src/components/TileMenu}/TileMenuItem/TileMenuItem.d.ts +0 -0
- package/__internal__/src/components/TileMenu/TileMenuItem/TileMenuItem.js +2 -0
- package/__internal__/src/components/TileMenu/TileMenuItem/TileMenuItem.js.map +1 -0
- package/__internal__/src/components/TileMenu/TileMenuList/TileMenuList.css +1 -0
- package/{TileMenu → __internal__/src/components/TileMenu}/TileMenuList/TileMenuList.d.ts +1 -1
- package/__internal__/src/components/TileMenu/TileMenuList/TileMenuList.js +2 -0
- package/__internal__/src/components/TileMenu/TileMenuList/TileMenuList.js.map +1 -0
- package/{TileMenu → __internal__/src/components/TileMenu}/TileMenuList/types.d.ts +1 -1
- package/__internal__/src/components/TileMenu/TileMenuList/types.js +2 -0
- package/__internal__/src/components/TileMenu/TileMenuList/types.js.map +1 -0
- package/{TileMenu → __internal__/src/components/TileMenu}/helpers.d.ts +42 -42
- package/__internal__/src/components/TileMenu/helpers.js +2 -0
- package/__internal__/src/components/TileMenu/helpers.js.map +1 -0
- package/__internal__/src/components/TileMenu/index.d.ts +1 -0
- package/__internal__/src/components/TileMenu/index.js +2 -0
- package/__internal__/src/components/TileMenu/index.js.map +1 -0
- package/{TileMenu → __internal__/src/components/TileMenu}/types.d.ts +1 -1
- package/{TileMenu → __internal__/src/components/TileMenu}/types.js +0 -0
- package/__internal__/src/components/TileMenu/types.js.map +1 -0
- package/{VerticalMenu → __internal__/src/components/VerticalMenu}/VerticalMenu.css +1 -1
- package/{VerticalMenu → __internal__/src/components/VerticalMenu}/VerticalMenu.d.ts +2 -2
- package/__internal__/src/components/VerticalMenu/VerticalMenu.js +2 -0
- package/__internal__/src/components/VerticalMenu/VerticalMenu.js.map +1 -0
- package/__internal__/src/components/VerticalMenu/VerticalMenuItem/VerticalMenuItem.css +1 -0
- package/{VerticalMenu → __internal__/src/components/VerticalMenu}/VerticalMenuItem/VerticalMenuItem.d.ts +1 -1
- package/__internal__/src/components/VerticalMenu/VerticalMenuItem/VerticalMenuItem.js +2 -0
- package/__internal__/src/components/VerticalMenu/VerticalMenuItem/VerticalMenuItem.js.map +1 -0
- package/__internal__/src/components/VerticalMenu/VerticalMenuLevel/VerticalMenuLevel.css +1 -0
- package/{VerticalMenu → __internal__/src/components/VerticalMenu}/VerticalMenuLevel/VerticalMenuLevel.d.ts +1 -2
- package/__internal__/src/components/VerticalMenu/VerticalMenuLevel/VerticalMenuLevel.js +2 -0
- package/__internal__/src/components/VerticalMenu/VerticalMenuLevel/VerticalMenuLevel.js.map +1 -0
- package/{VerticalMenu → __internal__/src/components/VerticalMenu}/helpers.d.ts +2 -2
- package/__internal__/src/components/VerticalMenu/helpers.js +2 -0
- package/__internal__/src/components/VerticalMenu/helpers.js.map +1 -0
- package/__internal__/src/components/VerticalMenu/index.d.ts +1 -0
- package/__internal__/src/components/VerticalMenu/index.js +2 -0
- package/__internal__/src/components/VerticalMenu/index.js.map +1 -0
- package/{VerticalMenu → __internal__/src/components/VerticalMenu}/types.d.ts +1 -1
- package/__internal__/src/components/VerticalMenu/types.js +2 -0
- package/__internal__/src/components/VerticalMenu/types.js.map +1 -0
- package/__internal__/src/docs/start/start.stand.d.ts +2 -0
- package/__internal__/src/docs/start/start.stand.js +2 -0
- package/__internal__/src/docs/start/start.stand.js.map +1 -0
- package/{__private__ → __internal__/src}/helpers/getItemClick.d.ts +0 -0
- package/{__private__ → __internal__/src}/helpers/getItemClick.js +0 -0
- package/__internal__/src/helpers/getItemClick.js.map +1 -0
- package/__internal__/src/stand/components/RemadeInfo/RemadeInfo.css +1 -0
- package/__internal__/src/stand/standConfig.d.ts +1 -0
- package/{__private__ → __internal__/src}/utils/bem.d.ts +0 -0
- package/{__private__ → __internal__/src}/utils/bem.js +0 -0
- package/__internal__/src/utils/bem.js.map +1 -0
- package/{__private__ → __internal__/src}/utils/types/PropsWithHTMLAttributes.d.ts +0 -0
- package/__internal__/src/utils/types/PropsWithHTMLAttributes.js +2 -0
- package/__internal__/src/utils/types/PropsWithHTMLAttributes.js.map +1 -0
- package/package.json +9 -27
- package/Badges/Badges.css +0 -1
- package/Badges/Badges.js +0 -2
- package/Badges/Badges.js.map +0 -1
- package/Badges/helpers.js +0 -2
- package/Badges/helpers.js.map +0 -1
- package/Badges/index.js.map +0 -1
- package/Badges/types.js +0 -2
- package/Badges/types.js.map +0 -1
- package/ButtonMenu/ButtonMenu.css +0 -1
- package/ButtonMenu/ButtonMenu.js +0 -2
- package/ButtonMenu/ButtonMenu.js.map +0 -1
- package/ButtonMenu/helpers.js +0 -2
- package/ButtonMenu/helpers.js.map +0 -1
- package/ButtonMenu/index.js.map +0 -1
- package/ButtonMenu/types.js +0 -2
- package/ButtonMenu/types.js.map +0 -1
- package/Header/Header.css +0 -1
- package/Header/Header.js +0 -2
- package/Header/Header.js.map +0 -1
- package/Header/HeaderLogin/HeaderLogin.js +0 -2
- package/Header/HeaderLogin/HeaderLogin.js.map +0 -1
- package/Header/HeaderLogin/index.d.ts +0 -1
- package/Header/HeaderLogin/index.js.map +0 -1
- package/Header/HeaderLogo/HeaderLogo.js +0 -2
- package/Header/HeaderLogo/HeaderLogo.js.map +0 -1
- package/Header/HeaderLogo/index.d.ts +0 -1
- package/Header/HeaderLogo/index.js.map +0 -1
- package/Header/HeaderSearch/HeaderSearch.js +0 -2
- package/Header/HeaderSearch/HeaderSearch.js.map +0 -1
- package/Header/HeaderSearch/index.d.ts +0 -1
- package/Header/HeaderSearch/index.js.map +0 -1
- package/Header/helpers.js +0 -2
- package/Header/helpers.js.map +0 -1
- package/Header/index.js.map +0 -1
- package/Header/types.js +0 -2
- package/Header/types.js.map +0 -1
- package/Languages/Languages.d.ts +0 -3
- package/Languages/Languages.js +0 -2
- package/Languages/Languages.js.map +0 -1
- package/Languages/helpers.d.ts +0 -20
- package/Languages/helpers.js +0 -2
- package/Languages/helpers.js.map +0 -1
- package/Languages/index.js.map +0 -1
- package/Languages/types.js +0 -2
- package/Languages/types.js.map +0 -1
- package/Layout/Layout.d.ts +0 -8
- package/Layout/Layout.js +0 -2
- package/Layout/Layout.js.map +0 -1
- package/Layout/LayoutRow/LayoutRow.css +0 -1
- package/Layout/LayoutRow/LayoutRow.js +0 -2
- package/Layout/LayoutRow/LayoutRow.js.map +0 -1
- package/Layout/helpers.js.map +0 -1
- package/Layout/index.js.map +0 -1
- package/Layout/types.d.ts +0 -17
- package/Layout/types.js +0 -2
- package/Layout/types.js.map +0 -1
- package/Menu/Menu.css +0 -1
- package/Menu/Menu.js +0 -2
- package/Menu/Menu.js.map +0 -1
- package/Menu/helpers.js +0 -2
- package/Menu/helpers.js.map +0 -1
- package/Menu/index.js.map +0 -1
- package/Menu/types.js +0 -2
- package/Menu/types.js.map +0 -1
- package/MobileMenu/MobileMenu.css +0 -1
- package/MobileMenu/MobileMenu.js +0 -2
- package/MobileMenu/MobileMenu.js.map +0 -1
- package/MobileMenu/index.js.map +0 -1
- package/MobileMenu/types.js +0 -2
- package/MobileMenu/types.js.map +0 -1
- package/Notifications/Notifications.css +0 -1
- package/Notifications/Notifications.js +0 -2
- package/Notifications/Notifications.js.map +0 -1
- package/Notifications/index.js.map +0 -1
- package/Notifications/types.js +0 -2
- package/Notifications/types.js.map +0 -1
- package/NotificationsList/NotificationsList.css +0 -1
- package/NotificationsList/NotificationsList.js +0 -2
- package/NotificationsList/NotificationsList.js.map +0 -1
- package/NotificationsList/helpers.js +0 -2
- package/NotificationsList/helpers.js.map +0 -1
- package/NotificationsList/index.js.map +0 -1
- package/NotificationsList/types.js +0 -2
- package/NotificationsList/types.js.map +0 -1
- package/SelectMenu/SelectMenu.css +0 -1
- package/SelectMenu/SelectMenu.js +0 -2
- package/SelectMenu/SelectMenu.js.map +0 -1
- package/SelectMenu/helpers.js +0 -2
- package/SelectMenu/helpers.js.map +0 -1
- package/SelectMenu/index.js.map +0 -1
- package/SelectMenu/types.js +0 -2
- package/SelectMenu/types.js.map +0 -1
- package/TileMenu/TileMenu.css +0 -1
- package/TileMenu/TileMenu.js +0 -2
- package/TileMenu/TileMenu.js.map +0 -1
- package/TileMenu/TileMenuItem/TileMenuItem.css +0 -1
- package/TileMenu/TileMenuItem/TileMenuItem.js +0 -2
- package/TileMenu/TileMenuItem/TileMenuItem.js.map +0 -1
- package/TileMenu/TileMenuList/TileMenuList.css +0 -1
- package/TileMenu/TileMenuList/TileMenuList.js +0 -2
- package/TileMenu/TileMenuList/TileMenuList.js.map +0 -1
- package/TileMenu/TileMenuList/types.js +0 -2
- package/TileMenu/TileMenuList/types.js.map +0 -1
- package/TileMenu/helpers.js +0 -2
- package/TileMenu/helpers.js.map +0 -1
- package/TileMenu/index.js.map +0 -1
- package/TileMenu/types.js.map +0 -1
- package/VerticalMenu/VerticalMenu.js +0 -2
- package/VerticalMenu/VerticalMenu.js.map +0 -1
- package/VerticalMenu/VerticalMenuItem/VerticalMenuItem.css +0 -1
- package/VerticalMenu/VerticalMenuItem/VerticalMenuItem.js +0 -2
- package/VerticalMenu/VerticalMenuItem/VerticalMenuItem.js.map +0 -1
- package/VerticalMenu/VerticalMenuLevel/VerticalMenuLevel.css +0 -1
- package/VerticalMenu/VerticalMenuLevel/VerticalMenuLevel.js +0 -2
- package/VerticalMenu/VerticalMenuLevel/VerticalMenuLevel.js.map +0 -1
- package/VerticalMenu/helpers.js +0 -2
- package/VerticalMenu/helpers.js.map +0 -1
- package/VerticalMenu/index.js.map +0 -1
- package/VerticalMenu/types.js +0 -2
- package/VerticalMenu/types.js.map +0 -1
- package/__private__/AnimatedContextMenu/AnimatedContextMenu.css +0 -1
- package/__private__/AnimatedContextMenu/AnimatedContextMenu.d.ts +0 -8
- package/__private__/AnimatedContextMenu/AnimatedContextMenu.js +0 -2
- package/__private__/AnimatedContextMenu/AnimatedContextMenu.js.map +0 -1
- package/__private__/components/NotificationCard/NotificationCard.d.ts +0 -19
- package/__private__/components/NotificationCard/NotificationCard.js +0 -2
- package/__private__/components/NotificationCard/NotificationCard.js.map +0 -1
- package/__private__/components/NotificationCard/helpers.js.map +0 -1
- package/__private__/components/NotificationCard/index.d.ts +0 -1
- package/__private__/components/NotificationCard/index.js.map +0 -1
- package/__private__/components/NotificationCard/types.js +0 -2
- package/__private__/components/NotificationCard/types.js.map +0 -1
- package/__private__/components/NotificationsActions/NotificationsActions.js +0 -2
- package/__private__/components/NotificationsActions/NotificationsActions.js.map +0 -1
- package/__private__/components/NotificationsActions/helpers.js +0 -2
- package/__private__/components/NotificationsActions/helpers.js.map +0 -1
- package/__private__/components/NotificationsActions/index.d.ts +0 -1
- package/__private__/components/NotificationsActions/index.js.map +0 -1
- package/__private__/components/NotificationsActions/types.js +0 -2
- package/__private__/components/NotificationsActions/types.js.map +0 -1
- package/__private__/components/Sidebar/Sidebar.css +0 -1
- package/__private__/components/Sidebar/Sidebar.js +0 -2
- package/__private__/components/Sidebar/Sidebar.js.map +0 -1
- package/__private__/components/Sidebar/index.d.ts +0 -1
- package/__private__/components/Sidebar/index.js.map +0 -1
- package/__private__/helpers/getItemClick.js.map +0 -1
- package/__private__/mixs/MixPopoverArrow/MixPopoverArrow.css +0 -1
- package/__private__/mixs/MixPopoverArrow/MixPopoverArrow.d.ts +0 -8
- package/__private__/mixs/MixPopoverArrow/MixPopoverArrow.js +0 -2
- package/__private__/mixs/MixPopoverArrow/MixPopoverArrow.js.map +0 -1
- package/__private__/utils/bem.js.map +0 -1
- package/__private__/utils/types/PropsWithHTMLAttributes.js +0 -2
- package/__private__/utils/types/PropsWithHTMLAttributes.js.map +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { SelectMenuDefaultItem,
|
|
2
|
+
import { SelectMenuDefaultItem, SelectMenuPropGetItemHref, SelectMenuPropGetItemLabel, SelectMenuPropGetItemOnClick, SelectMenuPropGetItemSubMenu, SelectMenuPropGetItemTarget, SelectMenuProps } from './types';
|
|
3
3
|
export declare const defaultGetItemLabel: SelectMenuPropGetItemLabel<SelectMenuDefaultItem>;
|
|
4
4
|
export declare const defaultGetItemHref: SelectMenuPropGetItemHref<SelectMenuDefaultItem>;
|
|
5
5
|
export declare const defaultGetItemOnClick: SelectMenuPropGetItemOnClick<SelectMenuDefaultItem>;
|
|
@@ -27,7 +27,7 @@ export declare function withDefaultGetters<ITEM>(props: SelectMenuProps<ITEM>):
|
|
|
27
27
|
getItemOnClick?: SelectMenuPropGetItemOnClick<ITEM> | undefined;
|
|
28
28
|
getItemSubMenu?: SelectMenuPropGetItemSubMenu<ITEM> | undefined;
|
|
29
29
|
label: string;
|
|
30
|
-
} & Omit<import("react").HTMLAttributes<HTMLDivElement>, "
|
|
30
|
+
} & Omit<import("react").HTMLAttributes<HTMLDivElement>, "css" | "items" | "getItemLabel" | "label" | "onItemClick" | "getItemHref" | "getItemTarget" | "getItemOnClick" | "getItemSubMenu"> & import("react").RefAttributes<HTMLDivElement> & (ITEM extends {
|
|
31
31
|
label: string;
|
|
32
32
|
} ? {} : {
|
|
33
33
|
getItemLabel: SelectMenuPropGetItemLabel<ITEM>;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import _defineProperty from"@babel/runtime/helpers/defineProperty";function ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread(a){for(var b,c=1;c<arguments.length;c++)b=null==arguments[c]?{}:arguments[c],c%2?ownKeys(Object(b),!0).forEach(function(c){_defineProperty(a,c,b[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(b)):ownKeys(Object(b)).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))});return a}export const defaultGetItemLabel=a=>a.label;export const defaultGetItemHref=a=>a.href;export const defaultGetItemOnClick=a=>a.onClick;export const defaultGetItemTarget=a=>a.target;export const defaultGetItemSubMenu=a=>a.subMenu;export const getGetters=a=>({getItemLabel:a.getItemLabel||defaultGetItemLabel,getItemHref:a.getItemHref||defaultGetItemHref,getItemOnClick:a.getItemOnClick||defaultGetItemOnClick,getItemTarget:a.getItemTarget||defaultGetItemTarget,getItemSubMenu:a.getItemSubMenu||defaultGetItemSubMenu});export function withDefaultGetters(a){return _objectSpread(_objectSpread({},a),getGetters(a))}
|
|
2
|
+
//# sourceMappingURL=helpers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"helpers.js","names":["defaultGetItemLabel","item","label","defaultGetItemHref","href","defaultGetItemOnClick","onClick","defaultGetItemTarget","target","defaultGetItemSubMenu","subMenu","getGetters","props","getItemLabel","getItemHref","getItemOnClick","getItemTarget","getItemSubMenu","withDefaultGetters"],"sources":["../../../../../src/components/SelectMenu/helpers.ts"],"sourcesContent":["import {\n SelectMenuDefaultItem,\n SelectMenuPropGetItemHref,\n SelectMenuPropGetItemLabel,\n SelectMenuPropGetItemOnClick,\n SelectMenuPropGetItemSubMenu,\n SelectMenuPropGetItemTarget,\n SelectMenuProps,\n} from './types';\n\nexport const defaultGetItemLabel: SelectMenuPropGetItemLabel<\n SelectMenuDefaultItem\n> = (item) => item.label;\nexport const defaultGetItemHref: SelectMenuPropGetItemHref<\n SelectMenuDefaultItem\n> = (item) => item.href;\nexport const defaultGetItemOnClick: SelectMenuPropGetItemOnClick<\n SelectMenuDefaultItem\n> = (item) => item.onClick;\nexport const defaultGetItemTarget: SelectMenuPropGetItemTarget<\n SelectMenuDefaultItem\n> = (item) => item.target;\nexport const defaultGetItemSubMenu: SelectMenuPropGetItemSubMenu<\n SelectMenuDefaultItem\n> = (item) => item.subMenu;\n\nexport const getGetters = <ITEM>(props: {\n getItemLabel?: SelectMenuPropGetItemLabel<ITEM>;\n getItemHref?: SelectMenuPropGetItemHref<ITEM>;\n getItemOnClick?: SelectMenuPropGetItemOnClick<ITEM>;\n getItemTarget?: SelectMenuPropGetItemTarget<ITEM>;\n getItemSubMenu?: SelectMenuPropGetItemSubMenu<ITEM>;\n}) => {\n return {\n getItemLabel: props.getItemLabel || defaultGetItemLabel,\n getItemHref: props.getItemHref || defaultGetItemHref,\n getItemOnClick: props.getItemOnClick || defaultGetItemOnClick,\n getItemTarget: props.getItemTarget || defaultGetItemTarget,\n getItemSubMenu: props.getItemSubMenu || defaultGetItemSubMenu,\n };\n};\n\nexport function withDefaultGetters<ITEM>(props: SelectMenuProps<ITEM>) {\n return {\n ...props,\n ...getGetters(props),\n };\n}\n"],"mappings":"qqBAUA,MAAO,MAAMA,oBAEZ,CAAIC,CAAD,EAAUA,CAAI,CAACC,KAFZ,CAGP,MAAO,MAAMC,mBAEZ,CAAIF,CAAD,EAAUA,CAAI,CAACG,IAFZ,CAGP,MAAO,MAAMC,sBAEZ,CAAIJ,CAAD,EAAUA,CAAI,CAACK,OAFZ,CAGP,MAAO,MAAMC,qBAEZ,CAAIN,CAAD,EAAUA,CAAI,CAACO,MAFZ,CAGP,MAAO,MAAMC,sBAEZ,CAAIR,CAAD,EAAUA,CAAI,CAACS,OAFZ,CAIP,MAAO,MAAMC,WAAU,CAAUC,CAAP,GAOjB,CACLC,YAAY,CAAED,CAAK,CAACC,YAAN,EAAsBb,mBAD/B,CAELc,WAAW,CAAEF,CAAK,CAACE,WAAN,EAAqBX,kBAF7B,CAGLY,cAAc,CAAEH,CAAK,CAACG,cAAN,EAAwBV,qBAHnC,CAILW,aAAa,CAAEJ,CAAK,CAACI,aAAN,EAAuBT,oBAJjC,CAKLU,cAAc,CAAEL,CAAK,CAACK,cAAN,EAAwBR,qBALnC,CAPiB,CAAnB,CAgBP,MAAO,SAASS,mBAAT,CAAkCN,CAAlC,CAAgE,CACrE,sCACKA,CADL,EAEKD,UAAU,CAACC,CAAD,CAFf,CAID"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './SelectMenu';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../../../src/components/SelectMenu/index.ts"],"sourcesContent":["export * from './SelectMenu';\n"],"mappings":"AAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { PropsWithHTMLAttributesAndRef } from "
|
|
2
|
+
import { PropsWithHTMLAttributesAndRef } from "../../utils/types/PropsWithHTMLAttributes";
|
|
3
3
|
export declare type SelectMenuDefaultItem = {
|
|
4
4
|
label: string;
|
|
5
5
|
href?: string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","names":[],"sources":["../../../../../src/components/SelectMenu/types.ts"],"sourcesContent":["import { PropsWithHTMLAttributesAndRef } from '##/utils/types/PropsWithHTMLAttributes';\n\nexport type SelectMenuDefaultItem = {\n label: string;\n href?: string;\n target?: string;\n onClick?: React.EventHandler<React.MouseEvent>;\n subMenu?: SelectMenuDefaultItem[];\n};\n\nexport type SelectMenuPropGetItemLabel<ITEM> = (item: ITEM) => string;\nexport type SelectMenuPropGetItemHref<ITEM> = (\n item: ITEM,\n) => string | undefined;\nexport type SelectMenuPropGetItemTarget<ITEM> = (\n item: ITEM,\n) => string | undefined;\nexport type SelectMenuPropGetItemOnClick<ITEM> = (\n item: ITEM,\n) => React.EventHandler<React.MouseEvent> | undefined;\nexport type SelectMenuPropOnItemClick<ITEM> = (props: {\n e: React.MouseEvent;\n item: ITEM;\n}) => void;\nexport type SelectMenuPropGetItemSubMenu<ITEM> = (\n item: ITEM,\n) => ITEM[] | undefined;\n\nexport type SelectMenuProps<ITEM = SelectMenuDefaultItem> =\n PropsWithHTMLAttributesAndRef<\n {\n items: ITEM[];\n onItemClick?: SelectMenuPropOnItemClick<ITEM>;\n getItemHref?: SelectMenuPropGetItemHref<ITEM>;\n getItemLabel?: SelectMenuPropGetItemLabel<ITEM>;\n getItemTarget?: SelectMenuPropGetItemTarget<ITEM>;\n getItemOnClick?: SelectMenuPropGetItemOnClick<ITEM>;\n getItemSubMenu?: SelectMenuPropGetItemSubMenu<ITEM>;\n label: string;\n },\n HTMLDivElement\n > &\n (ITEM extends { label: SelectMenuDefaultItem['label'] }\n ? {}\n : { getItemLabel: SelectMenuPropGetItemLabel<ITEM> });\n\nexport type SelectMenuComponent = <ITEM = SelectMenuDefaultItem>(\n props: SelectMenuProps<ITEM>,\n) => React.ReactElement | null;\n"],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.che--Sidebar-Header{align-items:flex-end;border-bottom:1px solid var(--color-bg-border);display:flex;flex:none;justify-content:space-between;padding:var(--space-l) var(--space-xl)}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import './Sidebar.css';
|
|
2
|
-
import React from 'react';
|
|
3
2
|
import { Sidebar as ConstaSidebar } from '@consta/uikit/Sidebar';
|
|
3
|
+
import React from 'react';
|
|
4
4
|
declare type SidebarProps = Omit<React.ComponentProps<typeof ConstaSidebar>, 'position' | 'onClose'> & {
|
|
5
5
|
title?: string;
|
|
6
6
|
onClose?: React.EventHandler<React.MouseEvent>;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";const _excluded=["children","title","onClose","className"];import"./Sidebar.css";import{Button}from"@consta/uikit/Button";import{IconClose}from"@consta/uikit/IconClose";import{Sidebar as ConstaSidebar}from"@consta/uikit/Sidebar";import{Text}from"@consta/uikit/Text";import{useBreakpoints}from"@consta/uikit/useBreakpoints";import React from"react";import{cn}from"../../utils/bem";const cnSidebar=cn("Sidebar");export const Sidebar=a=>{const{children:b,title:c,onClose:d,className:e}=a,f=_objectWithoutProperties(a,_excluded),{bigScreen:g}=useBreakpoints({bigScreen:520});return React.createElement(ConstaSidebar,Object.assign({},f,{position:g?"right":"bottom",size:g?"l":"full",className:cnSidebar(null,[e])}),(c||d)&&React.createElement("div",{className:cnSidebar("Header")},React.createElement(Text,{className:cnSidebar("Title"),size:"xl",truncate:!0},c),d&&React.createElement(Button,{size:"s",view:"clear",iconLeft:IconClose,onClick:d})),b)};
|
|
2
|
+
//# sourceMappingURL=Sidebar.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Sidebar.js","names":["Button","IconClose","Sidebar","ConstaSidebar","Text","useBreakpoints","React","cn","cnSidebar","props","children","title","onClose","className","otherProps","bigScreen"],"sources":["../../../../../src/components/Sidebar/Sidebar.tsx"],"sourcesContent":["import './Sidebar.css';\n\nimport { Button } from '@consta/uikit/Button';\nimport { IconClose } from '@consta/uikit/IconClose';\nimport { Sidebar as ConstaSidebar } from '@consta/uikit/Sidebar';\nimport { Text } from '@consta/uikit/Text';\nimport { useBreakpoints } from '@consta/uikit/useBreakpoints';\nimport React from 'react';\n\nimport { cn } from '##/utils/bem';\n\ntype SidebarProps = Omit<\n React.ComponentProps<typeof ConstaSidebar>,\n 'position' | 'onClose'\n> & {\n title?: string;\n onClose?: React.EventHandler<React.MouseEvent>;\n};\n\nconst cnSidebar = cn('Sidebar');\n\nexport const Sidebar = (props: SidebarProps) => {\n const { children, title, onClose, className, ...otherProps } = props;\n const { bigScreen } = useBreakpoints({ bigScreen: 520 });\n return (\n <ConstaSidebar\n {...otherProps}\n position={bigScreen ? 'right' : 'bottom'}\n size={bigScreen ? 'l' : 'full'}\n className={cnSidebar(null, [className])}\n >\n {(title || onClose) && (\n <div className={cnSidebar('Header')}>\n <Text className={cnSidebar('Title')} size=\"xl\" truncate>\n {title}\n </Text>\n {onClose && (\n <Button\n size=\"s\"\n view=\"clear\"\n iconLeft={IconClose}\n onClick={onClose}\n />\n )}\n </div>\n )}\n\n {children}\n </ConstaSidebar>\n );\n};\n"],"mappings":"gJAAA,sBAEA,OAASA,MAAT,KAAuB,sBAAvB,CACA,OAASC,SAAT,KAA0B,yBAA1B,CACA,OAASC,OAAO,GAAIC,cAApB,KAAyC,uBAAzC,CACA,OAASC,IAAT,KAAqB,oBAArB,CACA,OAASC,cAAT,KAA+B,8BAA/B,CACA,MAAOC,MAAP,KAAkB,OAAlB,CAEA,OAASC,EAAT,uBAUA,KAAMC,UAAS,CAAGD,EAAE,CAAC,SAAD,CAApB,CAEA,MAAO,MAAML,QAAO,CAAIO,CAAD,EAAyB,MACxC,CAAEC,QAAQ,CAARA,CAAF,CAAYC,KAAK,CAALA,CAAZ,CAAmBC,OAAO,CAAPA,CAAnB,CAA4BC,SAAS,CAATA,CAA5B,EAAyDJ,CADjB,CACEK,CADF,0BACiBL,CADjB,YAExC,CAAEM,SAAS,CAATA,CAAF,EAAgBV,cAAc,CAAC,CAAEU,SAAS,CAAE,GAAb,CAAD,CAFU,CAG9C,MACE,qBAAC,aAAD,kBACMD,CADN,EAEE,QAAQ,CAAEC,CAAS,CAAG,OAAH,CAAa,QAFlC,CAGE,IAAI,CAAEA,CAAS,CAAG,GAAH,CAAS,MAH1B,CAIE,SAAS,CAAEP,SAAS,CAAC,IAAD,CAAO,CAACK,CAAD,CAAP,CAJtB,GAMG,CAACF,CAAK,EAAIC,CAAV,GACC,2BAAK,SAAS,CAAEJ,SAAS,CAAC,QAAD,CAAzB,EACE,oBAAC,IAAD,EAAM,SAAS,CAAEA,SAAS,CAAC,OAAD,CAA1B,CAAqC,IAAI,CAAC,IAA1C,CAA+C,QAAQ,GAAvD,EACGG,CADH,CADF,CAIGC,CAAO,EACN,oBAAC,MAAD,EACE,IAAI,CAAC,GADP,CAEE,IAAI,CAAC,OAFP,CAGE,QAAQ,CAAEX,SAHZ,CAIE,OAAO,CAAEW,CAJX,EALJ,CAPJ,CAsBGF,CAtBH,CAyBH,CA7BM"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Sidebar';
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../../../src/components/Sidebar/index.ts"],"sourcesContent":["export * from './Sidebar';\n"],"mappings":"AAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.che--TileMenu-List{display:grid}.che--TileMenu-List_view_cards{grid-row-gap:var(--space-2xs);grid-column-gap:var(--space-2xs);grid-template-columns:repeat(3,1fr)}.che--TileMenu-List_view_lines{grid-template-columns:repeat(1,1fr)}.che--TileMenu-List_view_twoLines{grid-column-gap:calc(var(--space-xl) + var(--space-2xs));grid-template-columns:repeat(2,1fr)}.che--TileMenu-Popover{--popover-bg-color:var(--color-bg-default);--popover-arrow-bg-color:var(--popover-bg-color);background:var(--popover-bg-color);border-radius:var(--control-radius);box-shadow:var(--shadow-layer);max-width:var(--popover-max-width);width:calc(100vw - var(--space-l))}.che--TileMenu-Popover_view_cards{--popover-max-width:320px}.che--TileMenu-Popover_view_lines{--popover-max-width:520px}.che--TileMenu-Popover_view_twoLines{--popover-max-width:1000px}.che--TileMenu-ListWrapper{border-radius:var(--control-radius);overflow:hidden}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { TileMenuComponent } from "./types";
|
|
2
1
|
import './TileMenu.css';
|
|
2
|
+
import { TileMenuComponent } from './types';
|
|
3
3
|
export declare const cnTileMenu: import("@bem-react/classname").ClassNameFormatter;
|
|
4
4
|
export declare const TileMenu: TileMenuComponent;
|
|
5
|
-
export * from
|
|
5
|
+
export * from './types';
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";const _excluded=["view","items","isMobile","className","children","listClassName","getItemDescription","getItemHref","getItemImage","getItemOnClick","getItemLabel","title","onItemClick"];import"./TileMenu.css";import{Button}from"@consta/uikit/Button";import{IconBento}from"@consta/uikit/IconBento";import{animateTimeout,cnMixPopoverAnimate}from"@consta/uikit/MixPopoverAnimate";import{cnMixPopoverArrow}from"@consta/uikit/MixPopoverArrow";import{Popover}from"@consta/uikit/Popover";import{useFlag}from"@consta/uikit/useFlag";import{useForkRef}from"@consta/uikit/useForkRef";import React,{forwardRef,useRef,useState}from"react";import{Transition}from"react-transition-group";import{Sidebar}from"../Sidebar";import{cn}from"../../utils/bem";import{TileMenuList}from"./TileMenuList/TileMenuList";import{tileMenuPropViewDefault}from"./types";export const cnTileMenu=cn("TileMenu");const ARROW_SIZE=6,ARROW_OFFSET=10;function TileMenuRender(a,b){var c;const{view:p=tileMenuPropViewDefault,items:d,isMobile:e,className:f,children:g,listClassName:h,getItemDescription:i,getItemHref:j,getItemImage:k,getItemOnClick:l,getItemLabel:m,title:n,onItemClick:o}=a,q=_objectWithoutProperties(a,_excluded),r=useRef(null),[s,t]=useState(void 0),[u,{toogle:v,off:w}]=useFlag(),x={className:h,getItemDescription:i,getItemHref:j,getItemImage:k,getItemOnClick:l,getItemLabel:m,items:d,view:p,onItemClick:o},y="number"==typeof(null===(c=a.style)||void 0===c?void 0:c.zIndex)?a.style.zIndex+1:void 0;return React.createElement(React.Fragment,null,React.createElement(Button,Object.assign({},q,{size:"s",view:"clear",className:cnTileMenu(null,[f]),iconLeft:IconBento,ref:useForkRef([b,r]),onClick:v})),e?React.createElement(Sidebar,{isOpen:u,onClickOutside:w,onClose:w,title:n,style:{zIndex:y}},React.createElement(TileMenuList,x)):React.createElement(Transition,{timeout:animateTimeout,unmountOnExit:!0,in:u},a=>React.createElement(Popover,{className:cnTileMenu("Popover",{view:p},[cnMixPopoverAnimate({animate:a,direction:s})]),anchorRef:r,arrowOffset:ARROW_OFFSET+ARROW_SIZE,offset:10,onSetDirection:t,style:{"--popover-arrow-size":`${ARROW_SIZE}px`,"--popover-arrow-offset":`${ARROW_OFFSET}px`,zIndex:y},onClickOutside:w},React.createElement("div",{className:cnMixPopoverArrow({direction:s})}),React.createElement("div",{className:cnTileMenu("ListWrapper")},React.createElement(TileMenuList,x)))))}export const TileMenu=forwardRef(TileMenuRender);export*from"./types";
|
|
2
|
+
//# sourceMappingURL=TileMenu.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TileMenu.js","names":["Button","IconBento","animateTimeout","cnMixPopoverAnimate","cnMixPopoverArrow","Popover","useFlag","useForkRef","React","forwardRef","useRef","useState","Transition","Sidebar","cn","TileMenuList","tileMenuPropViewDefault","cnTileMenu","ARROW_SIZE","ARROW_OFFSET","TileMenuRender","props","ref","view","items","isMobile","className","children","listClassName","getItemDescription","getItemHref","getItemImage","getItemOnClick","getItemLabel","title","onItemClick","otherProps","buttonRef","direction","setDirection","visibleMenu","toogle","off","listProps","elementZIndex","style","zIndex","animate","TileMenu"],"sources":["../../../../../src/components/TileMenu/TileMenu.tsx"],"sourcesContent":["import './TileMenu.css';\n\nimport { Button } from '@consta/uikit/Button';\nimport { IconBento } from '@consta/uikit/IconBento';\nimport {\n animateTimeout,\n cnMixPopoverAnimate,\n} from '@consta/uikit/MixPopoverAnimate';\nimport { cnMixPopoverArrow } from '@consta/uikit/MixPopoverArrow';\nimport { Direction, Popover } from '@consta/uikit/Popover';\nimport { useFlag } from '@consta/uikit/useFlag';\nimport { useForkRef } from '@consta/uikit/useForkRef';\nimport React, { forwardRef, useRef, useState } from 'react';\nimport { Transition } from 'react-transition-group';\n\nimport { Sidebar } from '##/components/Sidebar';\nimport { cn } from '##/utils/bem';\n\nimport { TileMenuList } from './TileMenuList/TileMenuList';\nimport {\n TileMenuComponent,\n TileMenuProps,\n tileMenuPropViewDefault,\n} from './types';\n\nexport const cnTileMenu = cn('TileMenu');\n\nconst ARROW_SIZE = 6;\nconst ARROW_OFFSET = 10;\n\nfunction TileMenuRender(\n props: TileMenuProps,\n ref: React.Ref<HTMLButtonElement>,\n) {\n const {\n view = tileMenuPropViewDefault,\n items,\n isMobile,\n className,\n children,\n listClassName,\n getItemDescription,\n getItemHref,\n getItemImage,\n getItemOnClick,\n getItemLabel,\n title,\n onItemClick,\n ...otherProps\n } = props;\n\n const buttonRef = useRef<HTMLButtonElement>(null);\n\n const [direction, setDirection] = useState<Direction | undefined>(undefined);\n\n const [visibleMenu, { toogle, off }] = useFlag();\n\n const listProps = {\n className: listClassName,\n getItemDescription,\n getItemHref,\n getItemImage,\n getItemOnClick,\n getItemLabel,\n items,\n view,\n onItemClick,\n };\n\n const elementZIndex =\n typeof props.style?.zIndex === 'number'\n ? props.style.zIndex + 1\n : undefined;\n\n return (\n <>\n <Button\n {...otherProps}\n size=\"s\"\n view=\"clear\"\n className={cnTileMenu(null, [className])}\n iconLeft={IconBento}\n ref={useForkRef([ref, buttonRef])}\n onClick={toogle}\n />\n {isMobile ? (\n <Sidebar\n isOpen={visibleMenu}\n onClickOutside={off}\n onClose={off}\n title={title}\n style={{ zIndex: elementZIndex }}\n >\n <TileMenuList {...listProps} />\n </Sidebar>\n ) : (\n <Transition timeout={animateTimeout} unmountOnExit in={visibleMenu}>\n {(animate) => (\n <Popover\n className={cnTileMenu('Popover', { view }, [\n cnMixPopoverAnimate({ animate, direction }),\n ])}\n anchorRef={buttonRef}\n arrowOffset={ARROW_OFFSET + ARROW_SIZE}\n offset={ARROW_SIZE + 4}\n onSetDirection={setDirection}\n style={{\n ['--popover-arrow-size' as string]: `${ARROW_SIZE}px`,\n ['--popover-arrow-offset' as string]: `${ARROW_OFFSET}px`,\n zIndex: elementZIndex,\n }}\n onClickOutside={off}\n >\n <div className={cnMixPopoverArrow({ direction })} />\n <div className={cnTileMenu('ListWrapper')}>\n <TileMenuList {...listProps} />\n </div>\n </Popover>\n )}\n </Transition>\n )}\n </>\n );\n}\n\nexport const TileMenu = forwardRef(TileMenuRender) as TileMenuComponent;\n\nexport * from './types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ADvB,CAIE,SAAS,CAAED,CAJb,CAKE,WAAW,CAAElB,YAAY,CAAGD,UAL9B,CAME,MAAM,GANR,CAOE,cAAc,CAAEqB,CAPlB,CAQE,KAAK,CAAE,CACL,uBAAqC,GAAErB,UAAW,IAD7C,CAEL,yBAAuC,GAAEC,YAAa,IAFjD,CAGL2B,MAAM,CAAEF,CAHH,CART,CAaE,cAAc,CAAEF,CAblB,EAeE,2BAAK,SAAS,CAAEtC,iBAAiB,CAAC,CAAEkC,SAAS,CAATA,CAAF,CAAD,CAAjC,EAfF,CAgBE,2BAAK,SAAS,CAAErB,UAAU,CAAC,aAAD,CAA1B,EACE,oBAAC,YAAD,CAAkB0B,CAAlB,CADF,CAhBF,CAFJ,CArBJ,CAgDH,CAED,MAAO,MAAMK,SAAQ,CAAGvC,UAAU,CAACW,cAAD,CAA3B,CAEP"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.che--TileMenuItem{--tile-menu-item-image-size:calc(var(--space-4xl) - var(--space-2xs));color:var(--color-typo-primary);cursor:pointer;display:flex;text-decoration:none}.che--TileMenuItem_view_card{--tile-menu-item-image-margin:0 auto var(--space-xs) auto;border-radius:var(--control-radius);flex-direction:column;transition:background .2s}.che--TileMenuItem_view_card:hover{background:var(--color-control-bg-clear-hover)}.che--TileMenuItem_view_line{--tile-menu-item-image-margin:0 var(--space-xs) 0 0}.che--TileMenuItem_view_line:hover{--tile-menu-item-title-color:var(--color-typo-link-hover)}.che--TileMenuItem-ImageWrapper{border-radius:50%;flex:none;height:var(--tile-menu-item-image-size);margin:var(--tile-menu-item-image-margin);overflow:hidden;width:var(--tile-menu-item-image-size)}.che--TileMenuItem-ImageWrapper>*{height:100%;width:100%}.che--TileMenuItem-Title{color:var(--tile-menu-item-title-color);transition:color .2s}
|
|
File without changes
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";const _excluded=["image","className","title","description","view","as"];import"./TileMenuItem.css";import{forwardRefWithAs}from"@consta/uikit/__internal__/src/utils/types/PropsWithAsAttributes";import{cnMixSpace}from"@consta/uikit/MixSpace";import{Text}from"@consta/uikit/Text";import React from"react";import{cn}from"../../../utils/bem";export const tileMenuItemPropView=["card","line"];const cnTileMenuItem=cn("TileMenuItem"),renderImage=(a,b)=>{if("string"==typeof a)return React.createElement("img",{src:a,alt:b});return React.createElement(a,null)};export const TileMenuItem=forwardRefWithAs((a,b)=>{const{image:c,className:d,title:e,description:f,view:g="line",as:h="div"}=a,i=_objectWithoutProperties(a,_excluded),j="card"===g,k="line"===g;return React.createElement(h,Object.assign({},i,{ref:b,className:cnTileMenuItem({view:g},[j?cnMixSpace({p:"s",pT:"m"}):cnMixSpace({pV:"s"}),d])}),c&&React.createElement("div",{className:cnTileMenuItem("ImageWrapper")},renderImage(c,e)),React.createElement("div",{className:cnTileMenuItem("ContentWrapper")},React.createElement(Text,{weight:k?"bold":void 0,align:j?"center":void 0,className:cnTileMenuItem("Title",[k?cnMixSpace({pB:"2xs"}):void 0])},e),f&&k&&React.createElement(Text,{view:"secondary",className:cnTileMenuItem("Description")},f)))});
|
|
2
|
+
//# sourceMappingURL=TileMenuItem.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TileMenuItem.js","names":["forwardRefWithAs","cnMixSpace","Text","React","cn","tileMenuItemPropView","cnTileMenuItem","renderImage","image","title","TileMenuItem","props","ref","className","description","view","as","otherProps","viewIsCard","viewIsLine","p","pT","pV","pB"],"sources":["../../../../../../src/components/TileMenu/TileMenuItem/TileMenuItem.tsx"],"sourcesContent":["import './TileMenuItem.css';\n\nimport { forwardRefWithAs } from '@consta/uikit/__internal__/src/utils/types/PropsWithAsAttributes';\nimport { cnMixSpace } from '@consta/uikit/MixSpace';\nimport { Text } from '@consta/uikit/Text';\nimport React from 'react';\n\nimport { cn } from '##/utils/bem';\n\nexport const tileMenuItemPropView = ['card', 'line'] as const;\nexport type TileMenuItemPropView = typeof tileMenuItemPropView[number];\n\ntype TileMenuItemProps = {\n image?: string | React.FC;\n title: string;\n description?: string;\n view?: TileMenuItemPropView;\n};\n\nconst cnTileMenuItem = cn('TileMenuItem');\n\nconst renderImage = (image: string | React.FC, title: string) => {\n if (typeof image === 'string') {\n return <img src={image} alt={title} />;\n }\n const ImageComponent = image;\n return <ImageComponent />;\n};\n\nexport const TileMenuItem = forwardRefWithAs<TileMenuItemProps>(\n (props, ref) => {\n const {\n image,\n className,\n title,\n description,\n view = 'line',\n as = 'div',\n ...otherProps\n } = props;\n\n const Tag = as as string;\n const viewIsCard = view === 'card';\n const viewIsLine = view === 'line';\n\n return (\n <Tag\n {...otherProps}\n ref={ref}\n className={cnTileMenuItem({ view }, [\n viewIsCard\n ? cnMixSpace({ p: 's', pT: 'm' })\n : cnMixSpace({ pV: 's' }),\n className,\n ])}\n >\n {image && (\n <div className={cnTileMenuItem('ImageWrapper')}>\n {renderImage(image, title)}\n </div>\n )}\n <div className={cnTileMenuItem('ContentWrapper')}>\n <Text\n weight={viewIsLine ? 'bold' : undefined}\n align={viewIsCard ? 'center' : undefined}\n className={cnTileMenuItem('Title', [\n viewIsLine ? cnMixSpace({ pB: '2xs' }) : undefined,\n ])}\n >\n {title}\n </Text>\n {description && viewIsLine && (\n <Text view=\"secondary\" className={cnTileMenuItem('Description')}>\n {description}\n </Text>\n )}\n </div>\n </Tag>\n );\n },\n);\n"],"mappings":"6JAAA,2BAEA,OAASA,gBAAT,KAAiC,kEAAjC,CACA,OAASC,UAAT,KAA2B,wBAA3B,CACA,OAASC,IAAT,KAAqB,oBAArB,CACA,MAAOC,MAAP,KAAkB,OAAlB,CAEA,OAASC,EAAT,0BAEA,MAAO,MAAMC,qBAAoB,CAAG,CAAC,MAAD,CAAS,MAAT,CAA7B,C,KAUDC,eAAc,CAAGF,EAAE,CAAC,cAAD,C,CAEnBG,WAAW,CAAG,CAACC,CAAD,CAA2BC,CAA3B,GAA6C,CAC/D,GAAqB,QAAjB,QAAOD,EAAX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AAIK,CAAf,EACC,oBAAC,IAAD,EAAM,IAAI,CAAC,WAAX,CAAuB,SAAS,CAAEb,cAAc,CAAC,aAAD,CAAhD,EACGQ,CADH,CAXJ,CAfF,CAiCH,CAlDyC,CAArC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.che--TileMenuList{display:grid;overflow:auto}.che--TileMenuList_view_cards{grid-row-gap:var(--space-2xs);grid-column-gap:var(--space-2xs);grid-template-columns:repeat(3,1fr)}.che--TileMenuList_view_lines{grid-template-columns:repeat(1,1fr)}.che--TileMenuList_view_twoLines{grid-column-gap:calc(var(--space-xl) + var(--space-2xs));grid-template-columns:repeat(2,1fr)}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { TileMenuListComponent } from "../types";
|
|
2
1
|
import './TileMenuList.css';
|
|
2
|
+
import { TileMenuListComponent } from '../types';
|
|
3
3
|
export declare const cnTileMenuList: import("@bem-react/classname").ClassNameFormatter;
|
|
4
4
|
export declare const TileMenuList: TileMenuListComponent;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";const _excluded=["items","view","className","children","getItemDescription","getItemImage","getItemLabel","getItemHref","getItemOnClick","onItemClick"];import"./TileMenuList.css";import{getByMap}from"@consta/uikit/__internal__/src/utils/getByMap";import{cnMixSpace}from"@consta/uikit/MixSpace";import React from"react";import{cn}from"../../../utils/bem";import{withDefaultGetters}from"../helpers";import{TileMenuItem}from"../TileMenuItem/TileMenuItem";export const cnTileMenuList=cn("TileMenuList");const itemViewMap={lines:"line",twoLines:"line",cards:"card"};export const TileMenuList=a=>{const b=withDefaultGetters(a),{items:c,view:l="lines",className:d,children:e,getItemDescription:f,getItemImage:g,getItemLabel:h,getItemHref:i,getItemOnClick:j,onItemClick:k}=b,m=_objectWithoutProperties(b,_excluded);return React.createElement("div",Object.assign({},m,{className:cnTileMenuList({view:l},[cnMixSpace({p:"xl"}),d])}),c.map((a,b)=>React.createElement(TileMenuItem,{className:cnTileMenuList("Item"),key:cnTileMenuList("Item",{index:b}),view:getByMap(itemViewMap,l),image:g(a),title:h(a),description:f(a),href:i(a),onClick:b=>{var c;null===k||void 0===k?void 0:k({item:a,e:b}),null===(c=j(a))||void 0===c?void 0:c(b)},as:"a"})))};
|
|
2
|
+
//# sourceMappingURL=TileMenuList.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TileMenuList.js","names":["getByMap","cnMixSpace","React","cn","withDefaultGetters","TileMenuItem","cnTileMenuList","itemViewMap","lines","twoLines","cards","TileMenuList","props","items","view","className","children","getItemDescription","getItemImage","getItemLabel","getItemHref","getItemOnClick","onItemClick","otherProps","p","map","item","index","e"],"sources":["../../../../../../src/components/TileMenu/TileMenuList/TileMenuList.tsx"],"sourcesContent":["import './TileMenuList.css';\n\nimport { getByMap } from '@consta/uikit/__internal__/src/utils/getByMap';\nimport { cnMixSpace } from '@consta/uikit/MixSpace';\nimport React from 'react';\n\nimport { cn } from '##/utils/bem';\n\nimport { withDefaultGetters } from '../helpers';\nimport { TileMenuItem } from '../TileMenuItem/TileMenuItem';\nimport { TileMenuListComponent, TileMenuListProps } from '../types';\n\nexport const cnTileMenuList = cn('TileMenuList');\n\nconst itemViewMap = {\n lines: 'line',\n twoLines: 'line',\n cards: 'card',\n} as const;\n\nexport const TileMenuList = ((props: TileMenuListProps) => {\n const {\n items,\n view = 'lines',\n className,\n children,\n getItemDescription,\n getItemImage,\n getItemLabel,\n getItemHref,\n getItemOnClick,\n onItemClick,\n ...otherProps\n } = withDefaultGetters(props);\n\n return (\n <div\n {...otherProps}\n className={cnTileMenuList({ view }, [cnMixSpace({ p: 'xl' }), className])}\n >\n {items.map((item, index) => {\n return (\n <TileMenuItem\n className={cnTileMenuList('Item')}\n key={cnTileMenuList('Item', { index })}\n view={getByMap(itemViewMap, view)}\n image={getItemImage(item)}\n title={getItemLabel(item)}\n description={getItemDescription(item)}\n href={getItemHref(item)}\n onClick={(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AQ,CAACO,WAAD,CAAcO,CAAd,CAHhB,CAIE,KAAK,CAAEI,CAAY,CAACQ,CAAD,CAJrB,CAKE,KAAK,CAAEP,CAAY,CAACO,CAAD,CALrB,CAME,WAAW,CAAET,CAAkB,CAACS,CAAD,CANjC,CAOE,IAAI,CAAEN,CAAW,CAACM,CAAD,CAPnB,CAQE,OAAO,CAAGE,CAAD,EAAO,cACdN,CADc,WACdA,CADc,QACdA,CAAW,CAAG,CAAEI,IAAI,CAAJA,CAAF,CAAQE,CAAC,CAADA,CAAR,CAAH,CADG,WAEdP,CAAc,CAACK,CAAD,CAFA,qBAEd,EAAuBE,CAAvB,CACD,CAXH,CAYE,EAAE,CAAC,GAZL,EAFH,CAJH,CAwBH,CAxCM"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { PropsWithHTMLAttributesAndRef } from "
|
|
2
|
+
import { PropsWithHTMLAttributesAndRef } from "../../../utils/types/PropsWithHTMLAttributes";
|
|
3
3
|
export declare type TileMenuPropView = 'lines' | 'twoLines' | 'cards';
|
|
4
4
|
export declare type TileMenuPropItem = {
|
|
5
5
|
title: string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","names":[],"sources":["../../../../../../src/components/TileMenu/TileMenuList/types.ts"],"sourcesContent":["import { PropsWithHTMLAttributesAndRef } from '##/utils/types/PropsWithHTMLAttributes';\n\nexport type TileMenuPropView = 'lines' | 'twoLines' | 'cards';\n\nexport type TileMenuPropItem = {\n title: string;\n description?: string;\n image?: string;\n} & (\n | {\n href: string;\n onClick?: React.MouseEventHandler<HTMLAnchorElement>;\n }\n | { href: undefined; onClick?: React.MouseEventHandler<HTMLDivElement> }\n);\n\nexport type DefaultItem = {\n image?: string | React.FC;\n title: string;\n description?: string;\n};\n\ntype GetItemImage<ITEM> = (item: ITEM) => string | React.FC | undefined;\ntype GetItemTitle<ITEM> = (item: ITEM) => string;\ntype GetItemDescription<ITEM> = (item: ITEM) => string;\n\nexport type TileMenuListProps<ITEM> = PropsWithHTMLAttributesAndRef<\n {\n view?: TileMenuPropView;\n items: ITEM[];\n isMobile?: boolean;\n getItemImage: GetItemImage<ITEM>;\n getItemTitle: GetItemTitle<ITEM>;\n getItemDescription: GetItemDescription<ITEM>;\n },\n HTMLDivElement\n>;\n\nexport type TileMenuListComponent = <ITEM = DefaultItem>(\n props: TileMenuListProps<ITEM>,\n) => React.ReactElement | null;\n"],"mappings":""}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import {
|
|
2
|
+
import { TileMenuDefaultItem, TileMenuListProps, TileMenuPropGetItemDescription, TileMenuPropGetItemHref, TileMenuPropGetItemImage, TileMenuPropGetItemLabel, TileMenuPropGetItemOnClick } from './types';
|
|
3
3
|
export declare const defaultGetItemImage: TileMenuPropGetItemImage<TileMenuDefaultItem>;
|
|
4
4
|
export declare const defaultGetItemLabel: TileMenuPropGetItemLabel<TileMenuDefaultItem>;
|
|
5
5
|
export declare const defaultGetItemHref: TileMenuPropGetItemHref<TileMenuDefaultItem>;
|
|
@@ -15,35 +15,32 @@ export declare function withDefaultGetters<ITEM>(props: TileMenuListProps<ITEM>)
|
|
|
15
15
|
items: ITEM[];
|
|
16
16
|
isMobile?: boolean | undefined;
|
|
17
17
|
onItemClick?: import("./types").TileMenuOnItemClick<ITEM> | undefined;
|
|
18
|
-
id?: string | undefined;
|
|
19
|
-
color?: string | undefined;
|
|
20
|
-
translate?: "yes" | "no" | undefined;
|
|
21
|
-
hidden?: boolean | undefined;
|
|
22
|
-
dir?: string | undefined;
|
|
23
|
-
slot?: string | undefined;
|
|
24
|
-
style?: import("react").CSSProperties | undefined;
|
|
25
|
-
title?: string | undefined;
|
|
26
|
-
accessKey?: string | undefined;
|
|
27
|
-
draggable?: (boolean | "false" | "true") | undefined;
|
|
28
|
-
lang?: string | undefined;
|
|
29
|
-
className?: string | undefined;
|
|
30
|
-
prefix?: string | undefined;
|
|
31
|
-
children?: import("react").ReactNode;
|
|
32
|
-
contentEditable?: "inherit" | (boolean | "false" | "true") | undefined;
|
|
33
|
-
inputMode?: "search" | "numeric" | "none" | "url" | "text" | "decimal" | "tel" | "email" | undefined;
|
|
34
|
-
tabIndex?: number | undefined;
|
|
35
18
|
defaultChecked?: boolean | undefined;
|
|
36
|
-
defaultValue?: string | number | string[] | undefined;
|
|
19
|
+
defaultValue?: string | number | readonly string[] | undefined;
|
|
37
20
|
suppressContentEditableWarning?: boolean | undefined;
|
|
38
21
|
suppressHydrationWarning?: boolean | undefined;
|
|
22
|
+
accessKey?: string | undefined;
|
|
23
|
+
className?: string | undefined;
|
|
24
|
+
contentEditable?: (boolean | "true" | "false") | "inherit" | undefined;
|
|
39
25
|
contextMenu?: string | undefined;
|
|
26
|
+
dir?: string | undefined;
|
|
27
|
+
draggable?: (boolean | "true" | "false") | undefined;
|
|
28
|
+
hidden?: boolean | undefined;
|
|
29
|
+
id?: string | undefined;
|
|
30
|
+
lang?: string | undefined;
|
|
40
31
|
placeholder?: string | undefined;
|
|
41
|
-
|
|
32
|
+
slot?: string | undefined;
|
|
33
|
+
spellCheck?: (boolean | "true" | "false") | undefined;
|
|
34
|
+
style?: import("react").CSSProperties | undefined;
|
|
35
|
+
tabIndex?: number | undefined;
|
|
36
|
+
title?: string | undefined;
|
|
37
|
+
translate?: "yes" | "no" | undefined;
|
|
42
38
|
radioGroup?: string | undefined;
|
|
43
|
-
role?:
|
|
39
|
+
role?: import("react").AriaRole | undefined;
|
|
44
40
|
about?: string | undefined;
|
|
45
41
|
datatype?: string | undefined;
|
|
46
42
|
inlist?: any;
|
|
43
|
+
prefix?: string | undefined;
|
|
47
44
|
property?: string | undefined;
|
|
48
45
|
resource?: string | undefined;
|
|
49
46
|
typeof?: string | undefined;
|
|
@@ -51,6 +48,7 @@ export declare function withDefaultGetters<ITEM>(props: TileMenuListProps<ITEM>)
|
|
|
51
48
|
autoCapitalize?: string | undefined;
|
|
52
49
|
autoCorrect?: string | undefined;
|
|
53
50
|
autoSave?: string | undefined;
|
|
51
|
+
color?: string | undefined;
|
|
54
52
|
itemProp?: string | undefined;
|
|
55
53
|
itemScope?: boolean | undefined;
|
|
56
54
|
itemType?: string | undefined;
|
|
@@ -59,55 +57,57 @@ export declare function withDefaultGetters<ITEM>(props: TileMenuListProps<ITEM>)
|
|
|
59
57
|
results?: number | undefined;
|
|
60
58
|
security?: string | undefined;
|
|
61
59
|
unselectable?: "on" | "off" | undefined;
|
|
60
|
+
inputMode?: "search" | "none" | "text" | "tel" | "url" | "email" | "numeric" | "decimal" | undefined;
|
|
62
61
|
is?: string | undefined;
|
|
63
62
|
'aria-activedescendant'?: string | undefined;
|
|
64
|
-
'aria-atomic'?: boolean | "
|
|
65
|
-
'aria-autocomplete'?: "
|
|
66
|
-
'aria-busy'?: boolean | "
|
|
67
|
-
'aria-checked'?: boolean | "
|
|
63
|
+
'aria-atomic'?: (boolean | "true" | "false") | undefined;
|
|
64
|
+
'aria-autocomplete'?: "list" | "none" | "inline" | "both" | undefined;
|
|
65
|
+
'aria-busy'?: (boolean | "true" | "false") | undefined;
|
|
66
|
+
'aria-checked'?: boolean | "true" | "false" | "mixed" | undefined;
|
|
68
67
|
'aria-colcount'?: number | undefined;
|
|
69
68
|
'aria-colindex'?: number | undefined;
|
|
70
69
|
'aria-colspan'?: number | undefined;
|
|
71
70
|
'aria-controls'?: string | undefined;
|
|
72
|
-
'aria-current'?: boolean | "
|
|
71
|
+
'aria-current'?: boolean | "true" | "false" | "page" | "step" | "location" | "date" | "time" | undefined;
|
|
73
72
|
'aria-describedby'?: string | undefined;
|
|
74
73
|
'aria-details'?: string | undefined;
|
|
75
|
-
'aria-disabled'?: boolean | "
|
|
76
|
-
'aria-dropeffect'?: "link" | "none" | "copy" | "
|
|
74
|
+
'aria-disabled'?: (boolean | "true" | "false") | undefined;
|
|
75
|
+
'aria-dropeffect'?: "link" | "none" | "copy" | "execute" | "move" | "popup" | undefined;
|
|
77
76
|
'aria-errormessage'?: string | undefined;
|
|
78
|
-
'aria-expanded'?: boolean | "
|
|
77
|
+
'aria-expanded'?: (boolean | "true" | "false") | undefined;
|
|
79
78
|
'aria-flowto'?: string | undefined;
|
|
80
|
-
'aria-grabbed'?: boolean | "
|
|
81
|
-
'aria-haspopup'?: boolean | "
|
|
82
|
-
'aria-hidden'?: boolean | "
|
|
83
|
-
'aria-invalid'?: boolean | "
|
|
79
|
+
'aria-grabbed'?: (boolean | "true" | "false") | undefined;
|
|
80
|
+
'aria-haspopup'?: boolean | "true" | "false" | "dialog" | "grid" | "listbox" | "menu" | "tree" | undefined;
|
|
81
|
+
'aria-hidden'?: (boolean | "true" | "false") | undefined;
|
|
82
|
+
'aria-invalid'?: boolean | "true" | "false" | "grammar" | "spelling" | undefined;
|
|
84
83
|
'aria-keyshortcuts'?: string | undefined;
|
|
85
84
|
'aria-label'?: string | undefined;
|
|
86
85
|
'aria-labelledby'?: string | undefined;
|
|
87
86
|
'aria-level'?: number | undefined;
|
|
88
87
|
'aria-live'?: "off" | "assertive" | "polite" | undefined;
|
|
89
|
-
'aria-modal'?: boolean | "
|
|
90
|
-
'aria-multiline'?: boolean | "
|
|
91
|
-
'aria-multiselectable'?: boolean | "
|
|
88
|
+
'aria-modal'?: (boolean | "true" | "false") | undefined;
|
|
89
|
+
'aria-multiline'?: (boolean | "true" | "false") | undefined;
|
|
90
|
+
'aria-multiselectable'?: (boolean | "true" | "false") | undefined;
|
|
92
91
|
'aria-orientation'?: "horizontal" | "vertical" | undefined;
|
|
93
92
|
'aria-owns'?: string | undefined;
|
|
94
93
|
'aria-placeholder'?: string | undefined;
|
|
95
94
|
'aria-posinset'?: number | undefined;
|
|
96
|
-
'aria-pressed'?: boolean | "
|
|
97
|
-
'aria-readonly'?: boolean | "
|
|
98
|
-
'aria-relevant'?: "
|
|
99
|
-
'aria-required'?: boolean | "
|
|
95
|
+
'aria-pressed'?: boolean | "true" | "false" | "mixed" | undefined;
|
|
96
|
+
'aria-readonly'?: (boolean | "true" | "false") | undefined;
|
|
97
|
+
'aria-relevant'?: "text" | "additions" | "additions removals" | "additions text" | "all" | "removals" | "removals additions" | "removals text" | "text additions" | "text removals" | undefined;
|
|
98
|
+
'aria-required'?: (boolean | "true" | "false") | undefined;
|
|
100
99
|
'aria-roledescription'?: string | undefined;
|
|
101
100
|
'aria-rowcount'?: number | undefined;
|
|
102
101
|
'aria-rowindex'?: number | undefined;
|
|
103
102
|
'aria-rowspan'?: number | undefined;
|
|
104
|
-
'aria-selected'?: boolean | "
|
|
103
|
+
'aria-selected'?: (boolean | "true" | "false") | undefined;
|
|
105
104
|
'aria-setsize'?: number | undefined;
|
|
106
|
-
'aria-sort'?: "none" | "
|
|
105
|
+
'aria-sort'?: "none" | "ascending" | "descending" | "other" | undefined;
|
|
107
106
|
'aria-valuemax'?: number | undefined;
|
|
108
107
|
'aria-valuemin'?: number | undefined;
|
|
109
108
|
'aria-valuenow'?: number | undefined;
|
|
110
109
|
'aria-valuetext'?: string | undefined;
|
|
110
|
+
children?: import("react").ReactNode;
|
|
111
111
|
dangerouslySetInnerHTML?: {
|
|
112
112
|
__html: string;
|
|
113
113
|
} | undefined;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import _defineProperty from"@babel/runtime/helpers/defineProperty";function ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread(a){for(var b,c=1;c<arguments.length;c++)b=null==arguments[c]?{}:arguments[c],c%2?ownKeys(Object(b),!0).forEach(function(c){_defineProperty(a,c,b[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(b)):ownKeys(Object(b)).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))});return a}export const defaultGetItemImage=a=>a.image;export const defaultGetItemLabel=a=>a.label;export const defaultGetItemHref=a=>a.href;export const defaultGetItemOnClick=a=>a.onClick;export const defaultGetItemDescription=a=>a.description;export function withDefaultGetters(a){return _objectSpread(_objectSpread({},a),{},{getItemDescription:a.getItemDescription||defaultGetItemDescription,getItemLabel:a.getItemLabel||defaultGetItemLabel,getItemImage:a.getItemImage||defaultGetItemImage,getItemHref:a.getItemHref||defaultGetItemHref,getItemOnClick:a.getItemOnClick||defaultGetItemOnClick})}
|
|
2
|
+
//# sourceMappingURL=helpers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"helpers.js","names":["defaultGetItemImage","item","image","defaultGetItemLabel","label","defaultGetItemHref","href","defaultGetItemOnClick","onClick","defaultGetItemDescription","description","withDefaultGetters","props","getItemDescription","getItemLabel","getItemImage","getItemHref","getItemOnClick"],"sources":["../../../../../src/components/TileMenu/helpers.ts"],"sourcesContent":["import {\n TileMenuDefaultItem,\n TileMenuListProps,\n TileMenuPropGetItemDescription,\n TileMenuPropGetItemHref,\n TileMenuPropGetItemImage,\n TileMenuPropGetItemLabel,\n TileMenuPropGetItemOnClick,\n} from './types';\n\nexport const defaultGetItemImage: TileMenuPropGetItemImage<\n TileMenuDefaultItem\n> = (item) => item.image;\nexport const defaultGetItemLabel: TileMenuPropGetItemLabel<\n TileMenuDefaultItem\n> = (item) => item.label;\nexport const defaultGetItemHref: TileMenuPropGetItemHref<\n TileMenuDefaultItem\n> = (item) => item.href;\nexport const defaultGetItemOnClick: TileMenuPropGetItemOnClick<\n TileMenuDefaultItem\n> = (item) => item.onClick;\nexport const defaultGetItemDescription: TileMenuPropGetItemDescription<\n TileMenuDefaultItem\n> = (item) => item.description;\n\nexport function withDefaultGetters<ITEM>(props: TileMenuListProps<ITEM>) {\n return {\n ...props,\n getItemDescription: props.getItemDescription || defaultGetItemDescription,\n getItemLabel: props.getItemLabel || defaultGetItemLabel,\n getItemImage: props.getItemImage || defaultGetItemImage,\n getItemHref: props.getItemHref || defaultGetItemHref,\n getItemOnClick: props.getItemOnClick || defaultGetItemOnClick,\n };\n}\n"],"mappings":"qqBAUA,MAAO,MAAMA,oBAEZ,CAAIC,CAAD,EAAUA,CAAI,CAACC,KAFZ,CAGP,MAAO,MAAMC,oBAEZ,CAAIF,CAAD,EAAUA,CAAI,CAACG,KAFZ,CAGP,MAAO,MAAMC,mBAEZ,CAAIJ,CAAD,EAAUA,CAAI,CAACK,IAFZ,CAGP,MAAO,MAAMC,sBAEZ,CAAIN,CAAD,EAAUA,CAAI,CAACO,OAFZ,CAGP,MAAO,MAAMC,0BAEZ,CAAIR,CAAD,EAAUA,CAAI,CAACS,WAFZ,CAIP,MAAO,SAASC,mBAAT,CAAkCC,CAAlC,CAAkE,CACvE,sCACKA,CADL,MAEEC,kBAAkB,CAAED,CAAK,CAACC,kBAAN,EAA4BJ,yBAFlD,CAGEK,YAAY,CAAEF,CAAK,CAACE,YAAN,EAAsBX,mBAHtC,CAIEY,YAAY,CAAEH,CAAK,CAACG,YAAN,EAAsBf,mBAJtC,CAKEgB,WAAW,CAAEJ,CAAK,CAACI,WAAN,EAAqBX,kBALpC,CAMEY,cAAc,CAAEL,CAAK,CAACK,cAAN,EAAwBV,qBAN1C,EAQD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './TileMenu';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../../../src/components/TileMenu/index.ts"],"sourcesContent":["export * from './TileMenu';\n"],"mappings":"AAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import {
|
|
2
|
+
import { PropsWithHTMLAttributes, PropsWithHTMLAttributesAndRef } from "../../utils/types/PropsWithHTMLAttributes";
|
|
3
3
|
export declare const tileMenuPropView: readonly ["lines", "twoLines", "cards"];
|
|
4
4
|
export declare type TileMenuPropView = typeof tileMenuPropView[number];
|
|
5
5
|
export declare const tileMenuPropViewDefault: "lines";
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","names":["tileMenuPropView","tileMenuPropViewDefault"],"sources":["../../../../../src/components/TileMenu/types.ts"],"sourcesContent":["import {\n PropsWithHTMLAttributes,\n PropsWithHTMLAttributesAndRef,\n} from '##/utils/types/PropsWithHTMLAttributes';\n\nexport const tileMenuPropView = ['lines', 'twoLines', 'cards'] as const;\nexport type TileMenuPropView = typeof tileMenuPropView[number];\nexport const tileMenuPropViewDefault = tileMenuPropView[0];\n\nexport type TileMenuDefaultItem = {\n label: string;\n image?: string;\n description?: string;\n href?: string;\n onClick?: React.MouseEventHandler<HTMLAnchorElement>;\n};\n\nexport type TileMenuPropGetItemImage<ITEM> = (\n item: ITEM,\n) => string | React.FC | undefined;\nexport type TileMenuPropGetItemLabel<ITEM> = (item: ITEM) => string;\nexport type TileMenuPropGetItemDescription<ITEM> = (\n item: ITEM,\n) => string | undefined;\nexport type TileMenuPropGetItemHref<ITEM> = (item: ITEM) => string | undefined;\nexport type TileMenuPropGetItemOnClick<ITEM> = (\n item: ITEM,\n) => React.MouseEventHandler<HTMLAnchorElement> | undefined;\nexport type TileMenuPropOnItemClick<ITEM> = (props: {\n e: React.MouseEvent<HTMLAnchorElement>;\n item: ITEM;\n}) => void;\nexport type TileMenuOnItemClick<ITEM> = (props: {\n e: React.MouseEvent<HTMLAnchorElement>;\n item: ITEM;\n}) => void;\n\ntype CommonProps<ITEM> = {\n view?: TileMenuPropView;\n items: ITEM[];\n isMobile?: boolean;\n onItemClick?: TileMenuOnItemClick<ITEM>;\n getItemImage?: TileMenuPropGetItemImage<ITEM>;\n getItemLabel?: TileMenuPropGetItemLabel<ITEM>;\n getItemDescription?: TileMenuPropGetItemDescription<ITEM>;\n getItemHref?: TileMenuPropGetItemHref<ITEM>;\n getItemOnClick?: TileMenuPropGetItemOnClick<ITEM>;\n};\n\nexport type TileMenuProps<ITEM = TileMenuDefaultItem> =\n PropsWithHTMLAttributesAndRef<\n CommonProps<ITEM> & { listClassName?: string; title?: string },\n HTMLButtonElement\n > &\n (ITEM extends { label: TileMenuDefaultItem['label'] }\n ? {}\n : { getItemLabel: TileMenuPropGetItemLabel<ITEM> });\n\nexport type TileMenuListProps<ITEM = TileMenuDefaultItem> =\n PropsWithHTMLAttributes<CommonProps<ITEM>, HTMLDivElement>;\n\nexport type TileMenuListComponent = <ITEM = TileMenuDefaultItem>(\n props: TileMenuListProps<ITEM>,\n) => React.ReactElement | null;\n\nexport type TileMenuComponent = <ITEM = TileMenuDefaultItem>(\n props: TileMenuProps<ITEM>,\n) => React.ReactElement | null;\n"],"mappings":"AAKA,MAAO,MAAMA,iBAAgB,CAAG,CAAC,OAAD,CAAU,UAAV,CAAsB,OAAtB,CAAzB,CAEP,MAAO,MAAMC,wBAAuB,CAAGD,gBAAgB,CAAC,CAAD,CAAhD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.che--VerticalMenu{position:relative}.che--VerticalMenu_animationBack .che--VerticalMenu-Level_animate_enter{transform:translate(-100%)}.che--VerticalMenu_animationBack .che--VerticalMenu-Level_animate_enterActive,.che--VerticalMenu_animationBack .che--VerticalMenu-Level_animate_exit{transform:translate(0)}.che--VerticalMenu_animationBack .che--VerticalMenu-Level_animate_exitActive{transform:translate(100%)}.che--VerticalMenu-Level{
|
|
1
|
+
.che--VerticalMenu{position:relative}.che--VerticalMenu_animationBack .che--VerticalMenu-Level_animate_enter{transform:translate(-100%)}.che--VerticalMenu_animationBack .che--VerticalMenu-Level_animate_enterActive,.che--VerticalMenu_animationBack .che--VerticalMenu-Level_animate_exit{transform:translate(0)}.che--VerticalMenu_animationBack .che--VerticalMenu-Level_animate_exitActive{transform:translate(100%)}.che--VerticalMenu-Level{bottom:0;left:0;pointer-events:none;position:absolute;right:0;top:0}.che--VerticalMenu-Level_current{pointer-events:all}.che--VerticalMenu-Level_animate_enter,.che--VerticalMenu-Level_animate_enterActive,.che--VerticalMenu-Level_animate_exit,.che--VerticalMenu-Level_animate_exitActive{transition:transform .25s,opacity .25s}.che--VerticalMenu-Level_animate_enter{opacity:0;transform:translate(100%)}.che--VerticalMenu-Level_animate_enterActive,.che--VerticalMenu-Level_animate_exit{opacity:1;transform:translate(0)}.che--VerticalMenu-Level_animate_exitActive{opacity:0;transform:translate(-100%)}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { VerticalMenuComponent } from "./types";
|
|
2
1
|
import './VerticalMenu.css';
|
|
2
|
+
import { VerticalMenuComponent } from './types';
|
|
3
3
|
export declare const cnVerticalMenu: import("@bem-react/classname").ClassNameFormatter;
|
|
4
4
|
export declare const VerticalMenu: VerticalMenuComponent;
|
|
5
|
-
export * from
|
|
5
|
+
export * from './types';
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";const _excluded=["items","className","getItemActive","getItemHref","getItemLabel","getItemOnClick","getItemTarget","getItemSubMenu","header","onItemClick","getItemGroup","footer"];import"./VerticalMenu.css";import{cnForCssTransition}from"@consta/uikit/__internal__/src/utils/cnForCssTransition";import{useDebounce}from"@consta/uikit/useDebounce";import{useMutableRef}from"@consta/uikit/useMutableRef";import{useRefs}from"@consta/uikit/useRefs";import React,{forwardRef,useCallback,useEffect,useState}from"react";import{CSSTransition,TransitionGroup}from"react-transition-group";import{getItemClick}from"../../helpers/getItemClick";import{cn}from"../../utils/bem";import{withDefaultGetters}from"./helpers";import{VerticalMenuLevel}from"./VerticalMenuLevel/VerticalMenuLevel";export const cnVerticalMenu=cn("VerticalMenu");const transitionCn=cnForCssTransition(cnVerticalMenu,"Level"),VerticalMenuRender=(a,b)=>{const c=withDefaultGetters(a),{items:d,className:e,getItemActive:f,getItemHref:g,getItemLabel:h,getItemOnClick:i,getItemTarget:j,getItemSubMenu:k,header:l,onItemClick:m,getItemGroup:n,footer:o}=c,p=_objectWithoutProperties(c,_excluded),[q,r]=useState([{items:d,id:"0"}]),[s,t]=useState(!1),u=useRefs(q.length),v=useDebounce(()=>t(!1),250),w=useCallback(a=>r(b=>{const c=Array.from(b);return c.push(a),c}),[]),x=useCallback(()=>{t(!0),r(a=>{const b=Array.from(a);return b.pop(),b}),v()},[]),y=useMutableRef(k),z=useMutableRef(h);return useEffect(()=>{const a=q[q.length-1].id.split("-").slice(1);let b="0";const c=[{items:d,id:b}];a.forEach(a=>{const d=c[c.length-1].items[+a];if(!d)return;const e=y.current(d),f=z.current(d);b=`${b}-${a}`,e&&c.push({items:e,label:f,id:b})}),r(c)},[d]),React.createElement("div",Object.assign({},p,{className:cnVerticalMenu({animationBack:s},[e]),ref:b}),React.createElement(TransitionGroup,{enter:!0,exit:!0,className:cnVerticalMenu("Levels")},q.map((a,b)=>{const c=b+1;if(c>=q.length)return React.createElement(CSSTransition,{classNames:transitionCn,key:c,timeout:250,nodeRef:u[b]},React.createElement(VerticalMenuLevel,{ref:u[b],id:a.id,items:a.items,label:a.label,addLevel:w,removeLevel:x,className:cnVerticalMenu("Level",{current:c===q.length}),key:c,header:0===b&&l,footer:0===b&&o,getItemActive:f,getItemHref:g,getItemLabel:h,getItemOnClick:a=>getItemClick(a,i,m),getItemTarget:j,getItemSubMenu:k,getItemGroup:n}))})))};export const VerticalMenu=forwardRef(VerticalMenuRender);export*from"./types";
|
|
2
|
+
//# sourceMappingURL=VerticalMenu.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"VerticalMenu.js","names":["cnForCssTransition","useDebounce","useMutableRef","useRefs","React","forwardRef","useCallback","useEffect","useState","CSSTransition","TransitionGroup","getItemClick","cn","withDefaultGetters","VerticalMenuLevel","cnVerticalMenu","transitionCn","VerticalMenuRender","props","ref","items","className","getItemActive","getItemHref","getItemLabel","getItemOnClick","getItemTarget","getItemSubMenu","header","onItemClick","getItemGroup","footer","otherProps","levels","setLevels","id","animationBack","setAnimationBack","levelRefs","length","disableAnimationBack","addLevel","level","l","newLevels","Array","from","push","removeLevel","pop","getItemSubMenuRef","getItemLabelRef","keys","split","slice","forEach","index","item","levelItems","current","levelLabel","label","map","levelNum","menuItem","VerticalMenu"],"sources":["../../../../../src/components/VerticalMenu/VerticalMenu.tsx"],"sourcesContent":["import './VerticalMenu.css';\n\nimport { cnForCssTransition } from '@consta/uikit/__internal__/src/utils/cnForCssTransition';\nimport { useDebounce } from '@consta/uikit/useDebounce';\nimport { useMutableRef } from '@consta/uikit/useMutableRef';\nimport { useRefs } from '@consta/uikit/useRefs';\nimport React, { forwardRef, useCallback, useEffect, useState } from 'react';\nimport { CSSTransition, TransitionGroup } from 'react-transition-group';\n\nimport { getItemClick } from '##/helpers/getItemClick';\nimport { cn } from '##/utils/bem';\n\nimport { withDefaultGetters } from './helpers';\nimport {\n DefaultItem,\n Level,\n VerticalMenuComponent,\n VerticalMenuProps,\n} from './types';\nimport { VerticalMenuLevel } from './VerticalMenuLevel/VerticalMenuLevel';\n\nexport const cnVerticalMenu = cn('VerticalMenu');\n\nconst transitionCn = cnForCssTransition(cnVerticalMenu, 'Level');\n\nconst VerticalMenuRender = (\n props: VerticalMenuProps,\n ref: React.Ref<HTMLDivElement>,\n) => {\n const {\n items,\n className,\n getItemActive,\n getItemHref,\n getItemLabel,\n getItemOnClick,\n getItemTarget,\n getItemSubMenu,\n header,\n onItemClick,\n getItemGroup,\n footer,\n ...otherProps\n } = withDefaultGetters(props);\n\n const [levels, setLevels] = useState<Array<Level<DefaultItem>>>([\n { items, id: '0' },\n ]);\n const [animationBack, setAnimationBack] = useState<boolean>(false);\n\n const levelRefs = useRefs<HTMLDivElement>(levels.length);\n\n const disableAnimationBack = useDebounce(() => setAnimationBack(false), 250);\n\n const addLevel = useCallback(\n (level: Level<typeof items[number]>) =>\n setLevels((l) => {\n const newLevels = Array.from(l);\n newLevels.push(level);\n return newLevels;\n }),\n [],\n );\n\n const removeLevel = useCallback(() => {\n setAnimationBack(true);\n setLevels((l) => {\n const newLevels = Array.from(l);\n newLevels.pop();\n return newLevels;\n });\n disableAnimationBack();\n }, []);\n\n const getItemSubMenuRef = useMutableRef(getItemSubMenu);\n const getItemLabelRef = useMutableRef(getItemLabel);\n\n useEffect(() => {\n // обновляем уровни при смене items\n const keys = levels[levels.length - 1].id.split('-').slice(1);\n\n let id = '0';\n\n const newLevels: Array<Level<DefaultItem>> = [{ items, id }];\n\n keys.forEach((index) => {\n const item = newLevels[newLevels.length - 1].items[Number(index)];\n\n if (!item) {\n return;\n }\n\n const levelItems = getItemSubMenuRef.current(item);\n const levelLabel = getItemLabelRef.current(item);\n id = `${id}-${index}`;\n\n if (!levelItems) {\n return;\n }\n\n newLevels.push({ items: levelItems, label: levelLabel, id });\n });\n\n setLevels(newLevels);\n }, [items]);\n\n return (\n <div\n {...otherProps}\n className={cnVerticalMenu({ animationBack }, [className])}\n ref={ref}\n >\n <TransitionGroup enter exit className={cnVerticalMenu('Levels')}>\n {levels.map((level, index) => {\n const levelNum = index + 1;\n if (levelNum >= levels.length) {\n return (\n <CSSTransition\n classNames={transitionCn}\n key={levelNum}\n timeout={250}\n nodeRef={levelRefs[index]}\n >\n <VerticalMenuLevel\n ref={levelRefs[index]}\n id={level.id}\n items={level.items}\n label={level.label}\n addLevel={addLevel}\n removeLevel={removeLevel}\n className={cnVerticalMenu('Level', {\n current: levelNum === levels.length,\n })}\n key={levelNum}\n header={index === 0 && header}\n footer={index === 0 && footer}\n getItemActive={getItemActive}\n getItemHref={getItemHref}\n getItemLabel={getItemLabel}\n getItemOnClick={(menuItem) =>\n getItemClick(menuItem, getItemOnClick, onItemClick)\n }\n getItemTarget={getItemTarget}\n getItemSubMenu={getItemSubMenu}\n getItemGroup={getItemGroup}\n />\n </CSSTransition>\n );\n }\n })}\n </TransitionGroup>\n </div>\n );\n};\n\nexport const VerticalMenu = forwardRef(\n VerticalMenuRender,\n) as VerticalMenuComponent;\n\nexport * from './types';\n"],"mappings":"yQAAA,2BAEA,OAASA,kBAAT,KAAmC,yDAAnC,CACA,OAASC,WAAT,KAA4B,2BAA5B,CACA,OAASC,aAAT,KAA8B,6BAA9B,CACA,O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AZzB,CAaE,aAAa,CAAET,CAbjB,CAcE,WAAW,CAAEC,CAdf,CAeE,YAAY,CAAEC,CAfhB,CAgBE,cAAc,CAAGwC,CAAD,EACdrD,YAAY,CAACqD,CAAD,CAAWvC,CAAX,CAA2BI,CAA3B,CAjBhB,CAmBE,aAAa,CAAEH,CAnBjB,CAoBE,cAAc,CAAEC,CApBlB,CAqBE,YAAY,CAAEG,CArBhB,EANF,CAgCL,CApCA,CADH,CALF,CA8CH,C,CAED,MAAO,MAAMmC,aAAY,CAAG5D,UAAU,CACpCY,kBADoC,CAA/B,CAIP"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.che--VerticalMenuItem{align-items:center;box-sizing:border-box;cursor:pointer;display:flex;justify-content:space-between;position:relative;text-decoration:none;width:100%}.che--VerticalMenuItem_active:before{background:var(--color-typo-link);content:"";height:100%;left:0;position:absolute;top:0;width:var(--space-3xs)}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { VerticalMenuItemComponent } from "../types";
|
|
2
1
|
import './VerticalMenuItem.css';
|
|
2
|
+
import { VerticalMenuItemComponent } from '../types';
|
|
3
3
|
export declare const cnVerticalMenuItem: import("@bem-react/classname").ClassNameFormatter;
|
|
4
4
|
export declare const VerticalMenuItem: VerticalMenuItemComponent;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";const _excluded=["className","label","href","target","active","onClick","withSubMenu"];import"./VerticalMenuItem.css";import{IconArrowRight}from"@consta/uikit/IconArrowRight";import{Text}from"@consta/uikit/Text";import React from"react";import{cn}from"../../../utils/bem";export const cnVerticalMenuItem=cn("VerticalMenuItem");export const VerticalMenuItem=a=>{const{className:b,label:c,href:d,target:e,active:f,onClick:g,withSubMenu:h}=a,i=_objectWithoutProperties(a,_excluded),j=d?{as:"a",href:d,target:e}:{as:"span"};return React.createElement(Text,Object.assign({},i,j,{className:cnVerticalMenuItem({active:f},[b]),onClick:g}),c,h&&React.createElement(IconArrowRight,{className:cnVerticalMenuItem("Icon"),size:"xs"}))};
|
|
2
|
+
//# sourceMappingURL=VerticalMenuItem.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"VerticalMenuItem.js","names":["IconArrowRight","Text","React","cn","cnVerticalMenuItem","VerticalMenuItem","props","className","label","href","target","active","onClick","withSubMenu","otherProps","propsLink","as"],"sources":["../../../../../../src/components/VerticalMenu/VerticalMenuItem/VerticalMenuItem.tsx"],"sourcesContent":["import './VerticalMenuItem.css';\n\nimport { IconArrowRight } from '@consta/uikit/IconArrowRight';\nimport { Text } from '@consta/uikit/Text';\nimport React from 'react';\n\nimport { cn } from '##/utils/bem';\n\nimport { VerticalMenuItemComponent } from '../types';\n\nexport const cnVerticalMenuItem = cn('VerticalMenuItem');\n\nexport const VerticalMenuItem: VerticalMenuItemComponent = (props) => {\n const {\n className,\n label,\n href,\n target,\n active,\n onClick,\n withSubMenu,\n ...otherProps\n } = props;\n\n const propsLink = href\n ? ({\n as: 'a',\n href,\n target,\n } as const)\n : ({\n as: 'span',\n } as const);\n\n return (\n <Text\n {...otherProps}\n {...propsLink}\n className={cnVerticalMenuItem({ active }, [className])}\n onClick={onClick}\n >\n {label}\n {withSubMenu && (\n <IconArrowRight className={cnVerticalMenuItem('Icon')} size=\"xs\" />\n )}\n </Text>\n );\n};\n"],"mappings":"4KAAA,+BAEA,OAASA,cAAT,KAA+B,8BAA/B,CACA,OAASC,IAAT,KAAqB,oBAArB,CACA,MAAOC,MAAP,KAAkB,OAAlB,CAEA,OAASC,EAAT,0BAIA,MAAO,MAAMC,mBAAkB,CAAGD,EAAE,CAAC,kBAAD,CAA7B,CAEP,MAAO,MAAME,iBAA2C,CAAIC,CAAD,EAAW,MAC9D,CACJC,SAAS,CAATA,CADI,CAEJC,KAAK,CAALA,CAFI,CAGJC,IAAI,CAAJA,CAHI,CAIJC,MAAM,CAANA,CAJI,CAKJC,MAAM,CAANA,CALI,CAMJC,OAAO,CAAPA,CANI,CAOJC,WAAW,CAAXA,CAPI,EASFP,CAVgE,CAS/DQ,CAT+D,0BAUhER,CAVgE,YAY9DS,CAAS,CAAGN,CAAI,CACjB,CACCO,EAAE,CAAE,GADL,CAECP,IAAI,CAAJA,CAFD,CAGCC,MAAM,CAANA,CAHD,CADiB,CAMjB,CACCM,EAAE,CAAE,MADL,CAlB+D,CAsBpE,MACE,qBAAC,IAAD,kBACMF,CADN,CAEMC,CAFN,EAGE,SAAS,CAAEX,kBAAkB,CAAC,CAAEO,MAAM,CAANA,CAAF,CAAD,CAAa,CAACJ,CAAD,CAAb,CAH/B,CAIE,OAAO,CAAEK,CAJX,GAMGJ,CANH,CAOGK,CAAW,EACV,oBAAC,cAAD,EAAgB,SAAS,CAAET,kBAAkB,CAAC,MAAD,CAA7C,CAAuD,IAAI,CAAC,IAA5D,EARJ,CAYH,CAnCM"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.che--VerticalMenuLevel{display:flex;flex-direction:column}.che--VerticalMenuLevel-Label{align-items:center;border-bottom:1px solid var(--color-bg-border);display:flex;flex:none}.che--VerticalMenuLevel-Divider{background:var(--color-control-bg-border-default);height:var(--control-border-width)}.che--VerticalMenuLevel-Nav{flex:1}.che--VerticalMenuLevel-Footer{flex:none}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { VerticalMenuLevelComponent } from "../types";
|
|
2
|
-
import './VerticalMenuLevel.css';
|
|
3
1
|
import './VerticalMenuLevel.css';
|
|
2
|
+
import { VerticalMenuLevelComponent } from '../types';
|
|
4
3
|
export declare const cnVerticalMenuLevel: import("@bem-react/classname").ClassNameFormatter;
|
|
5
4
|
export declare const VerticalMenuLevel: VerticalMenuLevelComponent;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";const _excluded=["items","className","getItemActive","getItemHref","getItemLabel","getItemOnClick","getItemTarget","getItemSubMenu","addLevel","removeLevel","label","header","getItemGroup","id","footer"];import"./VerticalMenuLevel.css";import{fabricIndex}from"@consta/uikit/__internal__/src/utils/fabricIndex";import{getGroups}from"@consta/uikit/__internal__/src/utils/getGroups";import{Button}from"@consta/uikit/Button";import{IconArrowLeft}from"@consta/uikit/IconArrowLeft";import{cnMixSpace}from"@consta/uikit/MixSpace";import{Text}from"@consta/uikit/Text";import React,{forwardRef}from"react";import{cn}from"../../../utils/bem";import{VerticalMenuItem}from"../VerticalMenuItem/VerticalMenuItem";export const cnVerticalMenuLevel=cn("VerticalMenuLevel");export const VerticalMenuLevel=forwardRef((a,b)=>{const{items:c,className:d,getItemActive:e,getItemHref:f,getItemLabel:g,getItemOnClick:h,getItemTarget:i,getItemSubMenu:j,addLevel:k,removeLevel:l,label:m,header:n,getItemGroup:o,id:p,footer:q}=a,r=_objectWithoutProperties(a,_excluded),s=getGroups(c,o,void 0,void 0,void 0),t=fabricIndex(-1);return React.createElement("div",Object.assign({},r,{ref:b,className:cnVerticalMenuLevel(null,[d])}),m&&React.createElement("div",{className:cnVerticalMenuLevel("Label",[cnMixSpace({pV:"s",pH:"xl"})])},React.createElement(Button,{iconLeft:IconArrowLeft,view:"clear",size:"s",onClick:l}),React.createElement(Text,{className:cnMixSpace({mL:"s"}),truncate:!0},m)),n&&React.createElement("div",{className:cnVerticalMenuLevel("Header")},n),React.createElement("nav",{className:cnVerticalMenuLevel("Nav")},s.map((a,b)=>React.createElement(React.Fragment,null,b?React.createElement("div",{className:cnVerticalMenuLevel("Divider",[cnMixSpace({mV:"s",mH:"xl"})])}):void 0,a.items.map((a,c)=>{const d=t(),l=j(a),m=l&&0<l.length||!1,n=h(a),o=g(a),q=m?a=>{null===n||void 0===n?void 0:n(a),l&&k({items:l,label:o,id:`${p}-${d}`})}:n;return React.createElement(VerticalMenuItem,{key:cnVerticalMenuLevel("Item",{groupIndex:b,index:c}),label:o,href:f(a),active:e(a),onClick:q,target:i(a),withSubMenu:m,className:cnMixSpace({pV:"s",pH:"xl"})})})))),q&&React.createElement("div",{className:cnVerticalMenuLevel("Footer")},React.createElement("div",{className:cnVerticalMenuLevel("Divider",[cnMixSpace({mV:"s",mH:"xl"})])}),q))});
|
|
2
|
+
//# sourceMappingURL=VerticalMenuLevel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"VerticalMenuLevel.js","names":["fabricIndex","getGroups","Button","IconArrowLeft","cnMixSpace","Text","React","forwardRef","cn","VerticalMenuItem","cnVerticalMenuLevel","VerticalMenuLevel","props","ref","items","className","getItemActive","getItemHref","getItemLabel","getItemOnClick","getItemTarget","getItemSubMenu","addLevel","removeLevel","label","levelLabel","header","getItemGroup","id","footer","otherProps","groups","getIndex","pV","pH","mL","map","group","groupIndex","mV","mH","item","index","levelId","subMenu","withSubMenu","length","itemClick","onClick","e"],"sources":["../../../../../../src/components/VerticalMenu/VerticalMenuLevel/VerticalMenuLevel.tsx"],"sourcesContent":["import './VerticalMenuLevel.css';\n\nimport { fabricIndex } from '@consta/uikit/__internal__/src/utils/fabricIndex';\nimport { getGroups } from '@consta/uikit/__internal__/src/utils/getGroups';\nimport { Button } from '@consta/uikit/Button';\nimport { IconArrowLeft } from '@consta/uikit/IconArrowLeft';\nimport { cnMixSpace } from '@consta/uikit/MixSpace';\nimport { Text } from '@consta/uikit/Text';\nimport React, { forwardRef } from 'react';\n\nimport { cn } from '##/utils/bem';\n\nimport { VerticalMenuLevelComponent } from '../types';\nimport { VerticalMenuItem } from '../VerticalMenuItem/VerticalMenuItem';\n\nexport const cnVerticalMenuLevel = cn('VerticalMenuLevel');\n\nexport const VerticalMenuLevel: VerticalMenuLevelComponent = forwardRef(\n (props, ref) => {\n const {\n items,\n className,\n getItemActive,\n getItemHref,\n getItemLabel,\n getItemOnClick,\n getItemTarget,\n getItemSubMenu,\n addLevel,\n removeLevel,\n label: levelLabel,\n header,\n getItemGroup,\n id,\n footer,\n ...otherProps\n } = props;\n\n const groups = getGroups(\n items,\n getItemGroup,\n undefined,\n undefined,\n undefined,\n );\n const getIndex = fabricIndex(-1);\n\n return (\n <div\n {...otherProps}\n ref={ref}\n className={cnVerticalMenuLevel(null, [className])}\n >\n {levelLabel && (\n <div\n className={cnVerticalMenuLevel('Label', [\n cnMixSpace({ pV: 's', pH: 'xl' }),\n ])}\n >\n <Button\n iconLeft={IconArrowLeft}\n view=\"clear\"\n size=\"s\"\n onClick={removeLevel}\n />\n <Text className={cnMixSpace({ mL: 's' })} truncate>\n {levelLabel}\n </Text>\n </div>\n )}\n {header && (\n <div className={cnVerticalMenuLevel('Header')}>{header}</div>\n )}\n <nav className={cnVerticalMenuLevel('Nav')}>\n {groups.map((group, groupIndex) => {\n return (\n <>\n {groupIndex ? (\n <div\n className={cnVerticalMenuLevel('Divider', [\n cnMixSpace({ mV: 's', mH: 'xl' }),\n ])}\n />\n ) : undefined}\n {group.items.map((item, index) => {\n const levelId = getIndex();\n const subMenu = getItemSubMenu(item);\n const withSubMenu = (subMenu && subMenu.length > 0) || false;\n const itemClick = getItemOnClick(item);\n const label = getItemLabel(item);\n const onClick = withSubMenu\n ? (e: React.MouseEvent<Element, MouseEvent>) => {\n itemClick?.(e);\n subMenu &&\n addLevel({\n items: subMenu,\n label,\n id: `${id}-${levelId}`,\n });\n }\n : itemClick;\n return (\n <VerticalMenuItem\n key={cnVerticalMenuLevel('Item', { groupIndex, index })}\n label={label}\n href={getItemHref(item)}\n active={getItemActive(item)}\n onClick={onClick}\n target={getItemTarget(item)}\n withSubMenu={withSubMenu}\n className={cnMixSpace({ pV: 's', pH: 'xl' })}\n />\n );\n })}\n </>\n );\n })}\n </nav>\n {footer && (\n <div className={cnVerticalMenuLevel('Footer')}>\n <div\n className={cnVerticalMenuLevel('Divider', [\n cnMixSpace({ mV: 's', mH: 'xl' }),\n ])}\n />\n {footer}\n </div>\n )}\n </div>\n );\n },\n);\n"],"mappings":"iSAAA,gCAEA,OAASA,WAAT,KAA4B,kDAA5B,CACA,OAASC,SAAT,KAA0B,gDAA1B,CACA,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,CAiBhC,MACE,qBAAC,gBAAD,EACE,GAAG,CAAErC,mBAAmB,CAAC,MAAD,CAAS,CAAE4B,UAAU,CAAVA,CAAF,CAAcI,KAAK,CAALA,CAAd,CAAT,CAD1B,CAEE,KAAK,CAAElB,CAFT,CAGE,IAAI,CAAEP,CAAW,CAACwB,CAAD,CAHnB,CAIE,MAAM,CAAEzB,CAAa,CAACyB,CAAD,CAJvB,CAKE,OAAO,CAAEO,CALX,CAME,MAAM,CAAE5B,CAAa,CAACqB,CAAD,CANvB,CAOE,WAAW,CAAEI,CAPf,CAQE,SAAS,CAAEzC,UAAU,CAAC,CAAE6B,EAAE,CAAE,GAAN,CAAWC,EAAE,CAAE,IAAf,CAAD,CARvB,EAWH,CA7BA,CARH,CAFH,CADH,CAzBF,CAsEGL,CAAM,EACL,2BAAK,SAAS,CAAEnB,mBAAmB,CAAC,QAAD,CAAnC,EACE,2BACE,SAAS,CAAEA,mBAAmB,CAAC,SAAD,CAAY,CACxCN,UAAU,CAAC,CAAEmC,EAAE,CAAE,GAAN,CAAWC,EAAE,CAAE,IAAf,CAAD,CAD8B,CAAZ,CADhC,EADF,CAMGX,CANH,CAvEJ,CAkFH,CAjHoE,CAAhE"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { DefaultItem,
|
|
2
|
+
import { DefaultItem, VerticalMenuPropGetItemActive, VerticalMenuPropGetItemGroup, VerticalMenuPropGetItemHref, VerticalMenuPropGetItemLabel, VerticalMenuPropGetItemOnClick, VerticalMenuPropGetItemSubMenu, VerticalMenuPropGetItemTarget, VerticalMenuProps } from './types';
|
|
3
3
|
export declare const defaultGetItemLabel: VerticalMenuPropGetItemLabel<DefaultItem>;
|
|
4
4
|
export declare const defaultGetItemActive: VerticalMenuPropGetItemActive<DefaultItem>;
|
|
5
5
|
export declare const defaultGetItemHref: VerticalMenuPropGetItemHref<DefaultItem>;
|
|
@@ -19,7 +19,7 @@ export declare function withDefaultGetters<ITEM>(props: VerticalMenuProps<ITEM>)
|
|
|
19
19
|
getItemGroup?: VerticalMenuPropGetItemGroup<ITEM> | undefined;
|
|
20
20
|
header?: import("react").ReactNode;
|
|
21
21
|
footer?: import("react").ReactNode;
|
|
22
|
-
} & Omit<import("react").HTMLAttributes<HTMLDivElement>, "
|
|
22
|
+
} & Omit<import("react").HTMLAttributes<HTMLDivElement>, "css" | "items" | "getItemLabel" | "footer" | "header" | "onItemClick" | "getItemHref" | "getItemTarget" | "getItemOnClick" | "getItemSubMenu" | "getItemActive" | "getItemGroup"> & (ITEM extends {
|
|
23
23
|
label: string;
|
|
24
24
|
} ? {} : {
|
|
25
25
|
getItemLabel: VerticalMenuPropGetItemLabel<ITEM>;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import _defineProperty from"@babel/runtime/helpers/defineProperty";function ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread(a){for(var b,c=1;c<arguments.length;c++)b=null==arguments[c]?{}:arguments[c],c%2?ownKeys(Object(b),!0).forEach(function(c){_defineProperty(a,c,b[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(b)):ownKeys(Object(b)).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))});return a}export const defaultGetItemLabel=a=>a.label;export const defaultGetItemActive=a=>a.active;export const defaultGetItemHref=a=>a.href;export const defaultGetItemOnClick=a=>a.onClick;export const defaultGetItemTarget=a=>a.target;export const defaultGetItemSubMenu=a=>a.subMenu;export const defaultGetItemGroup=a=>a.groupId;export function withDefaultGetters(a){return _objectSpread(_objectSpread({},a),{},{getItemLabel:a.getItemLabel||defaultGetItemLabel,getItemActive:a.getItemActive||defaultGetItemActive,getItemHref:a.getItemHref||defaultGetItemHref,getItemOnClick:a.getItemOnClick||defaultGetItemOnClick,getItemTarget:a.getItemTarget||defaultGetItemTarget,getItemSubMenu:a.getItemSubMenu||defaultGetItemSubMenu,getItemGroup:a.getItemGroup||defaultGetItemGroup})}
|
|
2
|
+
//# sourceMappingURL=helpers.js.map
|