@consta/header 0.4.4 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/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 +34 -51
- 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 +2 -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 +1 -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/{__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/{__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
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"helpers.js","names":["getGroups","constaGetGroups","format","isToday","isYesterday","startOfDay","defaultGetActionIcon","action","icon","defaultGetActionLabel","label","defaultGetActionOnClick","onClick","defaultGetGroupId","group","id","defaultGetGroupLabel","defaultGetItemActions","item","actions","defaultGetItemBadges","badges","defaultGetItemDate","date","defaultGetItemDescription","description","defaultGetItemGroup","defaultGetItemImage","image","defaultGetItemLabel","defaultGetItemRead","read","defaultGetItemView","view","withDefaultGetters","props","getActionIcon","getActionLabel","getActionOnClick","getGroupId","getGroupLabel","getItemActions","getItemBadges","getItemDate","getItemDescription","getItemGroup","getItemImage","getItemLabel","getItemRead","getItemView","noGroupKey","defaultGroupLabelFormat","timestamp","sortGroup","a","b","key","items","groups","groupByDay","getTime"],"sources":["../../../../../src/components/NotificationsList/helpers.ts"],"sourcesContent":["import { getGroups as constaGetGroups } from '@consta/uikit/__internal__/src/utils/getGroups';\nimport { format, isToday, isYesterday, startOfDay } from 'date-fns';\n\nimport {\n NotificationsDefaultAction,\n NotificationsDefaultGroup,\n NotificationsDefaultItem,\n NotificationsListPropGetActionIcon,\n NotificationsListPropGetActionLabel,\n NotificationsListPropGetActionOnClick,\n NotificationsListPropGetGroupId,\n NotificationsListPropGetGroupLabel,\n NotificationsListPropGetItemActions,\n NotificationsListPropGetItemBadges,\n NotificationsListPropGetItemDate,\n NotificationsListPropGetItemDescription,\n NotificationsListPropGetItemGroup,\n NotificationsListPropGetItemImage,\n NotificationsListPropGetItemLabel,\n NotificationsListPropGetItemRead,\n NotificationsListPropGetItemView,\n NotificationsListPropGroupLabelFormat,\n NotificationsListProps,\n} from './types';\n\nconst defaultGetActionIcon: NotificationsListPropGetActionIcon<\n NotificationsDefaultAction\n> = (action) => action.icon;\nconst defaultGetActionLabel: NotificationsListPropGetActionLabel<\n NotificationsDefaultAction\n> = (action) => action.label;\nconst defaultGetActionOnClick: NotificationsListPropGetActionOnClick<\n NotificationsDefaultAction\n> = (action) => action.onClick;\nconst defaultGetGroupId: NotificationsListPropGetGroupId<\n NotificationsDefaultGroup\n> = (group) => group.id;\nconst defaultGetGroupLabel: NotificationsListPropGetGroupLabel<\n NotificationsDefaultGroup\n> = (group) => group.label;\nconst defaultGetItemActions: NotificationsListPropGetItemActions<\n NotificationsDefaultItem\n> = (item) => item.actions;\nconst defaultGetItemBadges: NotificationsListPropGetItemBadges<\n NotificationsDefaultItem\n> = (item) => item.badges;\nconst defaultGetItemDate: NotificationsListPropGetItemDate<\n NotificationsDefaultItem\n> = (item) => item.date;\nconst defaultGetItemDescription: NotificationsListPropGetItemDescription<\n NotificationsDefaultItem\n> = (item) => item.description;\nconst defaultGetItemGroup: NotificationsListPropGetItemGroup<\n NotificationsDefaultItem\n> = (item) => item.group;\nconst defaultGetItemImage: NotificationsListPropGetItemImage<\n NotificationsDefaultItem\n> = (item) => item.image;\nconst defaultGetItemLabel: NotificationsListPropGetItemLabel<\n NotificationsDefaultItem\n> = (item) => item.label;\nconst defaultGetItemRead: NotificationsListPropGetItemRead<\n NotificationsDefaultItem\n> = (item) => item.read;\nconst defaultGetItemView: NotificationsListPropGetItemView<\n NotificationsDefaultItem\n> = (item) => item.view;\n\nexport function withDefaultGetters<ITEM, GROUP, ACTION>(\n props: NotificationsListProps<ITEM, GROUP, ACTION>,\n) {\n return {\n ...props,\n getActionIcon: props.getActionIcon || defaultGetActionIcon,\n getActionLabel: props.getActionLabel || defaultGetActionLabel,\n getActionOnClick: props.getActionOnClick || defaultGetActionOnClick,\n getGroupId: props.getGroupId || defaultGetGroupId,\n getGroupLabel: props.getGroupLabel || defaultGetGroupLabel,\n getItemActions: props.getItemActions || defaultGetItemActions,\n getItemBadges: props.getItemBadges || defaultGetItemBadges,\n getItemDate: props.getItemDate || defaultGetItemDate,\n getItemDescription: props.getItemDescription || defaultGetItemDescription,\n getItemGroup: props.getItemGroup || defaultGetItemGroup,\n getItemImage: props.getItemImage || defaultGetItemImage,\n getItemLabel: props.getItemLabel || defaultGetItemLabel,\n getItemRead: props.getItemRead || defaultGetItemRead,\n getItemView: props.getItemView || defaultGetItemView,\n };\n}\n\ntype ReturnedGroup<ITEM, GROUP> = {\n items: ITEM[];\n key: string | number;\n group?: GROUP;\n groupIndex: number;\n};\n\nexport const noGroupKey = 'no-group';\n\nexport const defaultGroupLabelFormat: NotificationsListPropGroupLabelFormat<\n true\n> = (timestamp) => {\n if (isToday(timestamp)) {\n return 'Сегодня';\n }\n if (isYesterday(timestamp)) {\n return 'Вчера';\n }\n return format(timestamp, 'dd.MM.yyyy');\n};\n\nconst sortGroup = (\n a: { key: string | number },\n b: { key: string | number },\n) => {\n if (a.key < b.key) {\n return 1;\n }\n if (a.key > b.key) {\n return -1;\n }\n return 0;\n};\n\nexport const getGroups = <ITEM, GROUP>(\n items: ITEM[],\n groups: GROUP[] | undefined,\n groupByDay: boolean,\n getItemGroup: NotificationsListPropGetItemGroup<ITEM>,\n getItemDate: NotificationsListPropGetItemDate<ITEM>,\n getGroupId: NotificationsListPropGetGroupId<GROUP>,\n): Array<ReturnedGroup<ITEM, GROUP>> => {\n if (groupByDay) {\n const getItemGroupByDate = (item: ITEM) => {\n const date = getItemDate(item);\n return date ? startOfDay(date).getTime() : undefined;\n };\n\n return constaGetGroups<ITEM, GROUP>(\n items,\n getItemGroupByDate,\n undefined,\n undefined,\n sortGroup,\n noGroupKey,\n );\n }\n return constaGetGroups(\n items,\n getItemGroup,\n groups,\n getGroupId,\n undefined,\n noGroupKey,\n );\n};\n"],"mappings":"qqBAAA,OAASA,SAAS,GAAIC,gBAAtB,KAA6C,gDAA7C,CACA,OAASC,MAAT,CAAiBC,OAAjB,CAA0BC,WAA1B,CAAuCC,UAAvC,KAAyD,UAAzD,C,KAwBMC,qBAEL,CAAIC,CAAD,EAAYA,CAAM,CAACC,I,CACjBC,qBAEL,CAAIF,CAAD,EAAYA,CAAM,CAACG,K,CACjBC,uBAEL,CAAIJ,CAAD,EAAYA,CAAM,CAACK,O,CACj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YAAY,CAAEZ,CAAK,CAACY,YAAN,EAAsBlB,mBAbtC,CAcEmB,WAAW,CAAEb,CAAK,CAACa,WAAN,EAAqBlB,kBAdpC,CAeEmB,WAAW,CAAEd,CAAK,CAACc,WAAN,EAAqBjB,kBAfpC,EAiBD,CASD,MAAO,MAAMkB,WAAU,CAAG,UAAnB,CAEP,MAAO,MAAMC,wBAEZ,CAAIC,CAAD,EACEjD,OAAO,CAACiD,CAAD,CADT,CAEO,4CAFP,CAIEhD,WAAW,CAACgD,CAAD,CAJb,CAKO,gCALP,CAOKlD,MAAM,CAACkD,CAAD,CAAY,YAAZ,CATR,CAYP,KAAMC,UAAS,CAAG,CAChBC,CADgB,CAEhBC,CAFgB,GAIZD,CAAC,CAACE,GAAF,CAAQD,CAAC,CAACC,GAJE,CAKP,CALO,CAOZF,CAAC,CAACE,GAAF,CAAQD,CAAC,CAACC,GAPE,CAQP,CAAC,CARM,CAUT,CAVT,CAaA,MAAO,MAAMxD,UAAS,CAAG,CACvByD,CADuB,CAEvBC,CAFuB,CAGvBC,CAHuB,CAIvBd,CAJuB,CAKvBF,CALuB,CAMvBJ,CANuB,GAOe,CACtC,GAAIoB,CAAJ,CAAgB,CAMd,MAAO1D,gBAAe,CACpBwD,CADoB,CALMvC,CAAD,EAAgB,CACzC,KAAMK,EAAI,CAAGoB,CAAW,CAACzB,CAAD,CAAxB,CACA,MAAOK,EAAI,CAAGlB,UAAU,CAACkB,CAAD,CAAV,CAAiBqC,OAAjB,EAAH,OACZ,CAEqB,eAKpBP,SALoB,CAMpBH,UANoB,CAQvB,CACD,MAAOjD,gBAAe,CACpBwD,CADoB,CAEpBZ,CAFoB,CAGpBa,CAHoB,CAIpBnB,CAJoB,QAMpBW,UANoB,CAQvB,CA/BM"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './NotificationsList';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../../../src/components/NotificationsList/index.ts"],"sourcesContent":["export * from './NotificationsList';\n"],"mappings":"AAAA"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { BadgePropStatus } from '@consta/uikit/Badge';
|
|
3
3
|
import { IconProps } from '@consta/uikit/Icon';
|
|
4
|
-
import { PropsWithHTMLAttributesAndRef } from "
|
|
4
|
+
import { PropsWithHTMLAttributesAndRef } from "../../utils/types/PropsWithHTMLAttributes";
|
|
5
5
|
export declare type NotificationsDefaultAction = {
|
|
6
6
|
label: string;
|
|
7
7
|
onClick?: React.EventHandler<React.MouseEvent>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","names":[],"sources":["../../../../../src/components/NotificationsList/types.ts"],"sourcesContent":["import { BadgePropStatus } from '@consta/uikit/Badge';\nimport { IconProps } from '@consta/uikit/Icon';\n\nimport { PropsWithHTMLAttributesAndRef } from '##/utils/types/PropsWithHTMLAttributes';\n\nexport type NotificationsDefaultAction = {\n label: string;\n onClick?: React.EventHandler<React.MouseEvent>;\n icon?: React.FC<IconProps>;\n};\n\nexport type Badge = {\n label: string;\n status?: BadgePropStatus;\n};\n\nexport type NotificationsDefaultGroup = {\n label: string;\n id: string;\n};\n\nexport type NotificationsDefaultItem = {\n label: string;\n description?: string;\n image?: string;\n read?: boolean;\n date?: Date;\n badges?: Badge[];\n actions?: NotificationsDefaultAction[];\n onClick?: React.EventHandler<React.MouseEvent>;\n group?: string;\n view?: 'default' | 'user';\n};\n\nexport type NotificationsListPropGetItemLabel<ITEM> = (item: ITEM) => string;\nexport type NotificationsListPropGetItemDescription<ITEM> = (\n item: ITEM,\n) => string | undefined;\nexport type NotificationsListPropGetItemImage<ITEM> = (\n item: ITEM,\n) => string | undefined;\nexport type NotificationsListPropGetItemRead<ITEM> = (\n item: ITEM,\n) => boolean | undefined;\nexport type NotificationsListPropGetItemDate<ITEM> = (\n item: ITEM,\n) => Date | undefined;\nexport type NotificationsListPropGetItemBadges<ITEM> = (\n item: ITEM,\n) => Badge[] | undefined;\nexport type NotificationsListPropGetItemActions<ITEM> = (\n item: ITEM,\n) => NotificationsDefaultAction[] | undefined;\nexport type NotificationsListPropGetItemGroup<ITEM> = (\n item: ITEM,\n) => string | undefined;\nexport type NotificationsListPropGetItemView<ITEM> = (\n item: ITEM,\n) => 'default' | 'user' | undefined;\nexport type NotificationsListPropItemDateFormat = (date: Date) => string;\n\nexport type NotificationsListPropGetActionLabel<ACTION> = (\n action: ACTION,\n) => string;\nexport type NotificationsListPropGetActionIcon<ACTION> = (\n action: ACTION,\n) => React.FC<IconProps> | undefined;\nexport type NotificationsListPropGetActionOnClick<ACTION> = (\n action: ACTION,\n) => React.EventHandler<React.MouseEvent> | undefined;\n\nexport type NotificationsListPropGetGroupLabel<GROUP> = (\n group: GROUP,\n) => string;\nexport type NotificationsListPropGetGroupId<GROUP> = (\n group: GROUP,\n) => string | number;\n\nexport type NotificationsListPropGroupLabelFormat<GROUP_BY_DAY> =\n GROUP_BY_DAY extends true ? (timestamp: number) => string : never;\n\nexport type Props<ITEM, GROUP, ACTION, GROUP_BY_DAY extends boolean> = {\n children?: never;\n items: ITEM[];\n itemDateFormat?: NotificationsListPropItemDateFormat;\n title?: string;\n actions?: ACTION[];\n getItemLabel?: NotificationsListPropGetItemLabel<ITEM>;\n getItemDescription?: NotificationsListPropGetItemDescription<ITEM>;\n getItemImage?: NotificationsListPropGetItemImage<ITEM>;\n getItemRead?: NotificationsListPropGetItemRead<ITEM>;\n getItemDate?: NotificationsListPropGetItemDate<ITEM>;\n getItemBadges?: NotificationsListPropGetItemBadges<ITEM>;\n getItemActions?: NotificationsListPropGetItemActions<ITEM>;\n getItemGroup?: NotificationsListPropGetItemGroup<ITEM>;\n getItemView?: NotificationsListPropGetItemView<ITEM>;\n getActionLabel?: NotificationsListPropGetActionLabel<ACTION>;\n getActionIcon?: NotificationsListPropGetActionIcon<ACTION>;\n getActionOnClick?: NotificationsListPropGetActionOnClick<ACTION>;\n getGroupLabel?: NotificationsListPropGetGroupLabel<GROUP>;\n getGroupId?: NotificationsListPropGetGroupId<GROUP>;\n groupByDay?: GROUP_BY_DAY;\n groupLabelFormat?: NotificationsListPropGroupLabelFormat<GROUP_BY_DAY>;\n groups?: GROUP_BY_DAY extends true ? never : GROUP[];\n onClose?: React.EventHandler<React.MouseEvent>;\n} & (ACTION extends { label: NotificationsDefaultAction['label'] }\n ? {}\n : { getActionLabel: NotificationsListPropGetItemActions<ACTION> }) &\n (GROUP extends { label: NotificationsDefaultGroup['label'] }\n ? {}\n : { getGroupLabel: NotificationsListPropGetGroupLabel<GROUP> }) &\n (GROUP extends { id: NotificationsDefaultGroup['id'] }\n ? {}\n : { getGroupId: NotificationsListPropGetGroupId<GROUP> }) &\n (ITEM extends { label: NotificationsDefaultItem['label'] }\n ? {}\n : { getItemLabel: NotificationsListPropGetItemLabel<ITEM> });\n\nexport type NotificationsListProps<\n ITEM = NotificationsDefaultItem,\n GROUP = NotificationsDefaultGroup,\n ACTION = NotificationsDefaultAction,\n GROUP_BY_DAY extends boolean = false,\n> = PropsWithHTMLAttributesAndRef<\n Props<ITEM, GROUP, ACTION, GROUP_BY_DAY>,\n HTMLDivElement\n>;\n\nexport type NotificationsListComponent = <\n ITEM = NotificationsDefaultItem,\n GROUP = NotificationsDefaultGroup,\n ACTION = NotificationsDefaultAction,\n GROUP_BY_DAY extends boolean = false,\n>(\n props: NotificationsListProps<ITEM, GROUP, ACTION, GROUP_BY_DAY>,\n) => React.ReactElement | null;\n"],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.che--SelectMenu{align-items:center;cursor:pointer;display:inline-flex}.che--SelectMenu-Label{flex:1}.che--SelectMenu-ArrowBox{align-items:center;color:var(--color-control-typo-placeholder);display:flex;flex:none;height:var(--space-2xl);justify-content:center;width:var(--space-2xl)}.che--SelectMenu-ArrowBox_open{transform:rotate(180deg)}.che--SelectMenu-Menu{max-height:360px;overflow:auto}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { SelectMenuComponent } from "./types";
|
|
2
1
|
import './SelectMenu.css';
|
|
2
|
+
import { SelectMenuComponent } from './types';
|
|
3
3
|
export declare const cnSelectMenu: import("@bem-react/classname").ClassNameFormatter;
|
|
4
4
|
export declare const SelectMenu: SelectMenuComponent;
|
|
5
|
-
export * from
|
|
5
|
+
export * from './types';
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import _defineProperty from"@babel/runtime/helpers/defineProperty";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";const _excluded=["items","className","getItemHref","getItemLabel","getItemOnClick","getItemTarget","onItemClick","label","onClick","getItemSubMenu","style"];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}import"./SelectMenu.css";import{ContextMenu}from"@consta/uikit/ContextMenu";import{IconSelect}from"@consta/uikit/IconSelect";import{Text}from"@consta/uikit/Text";import{useFlag}from"@consta/uikit/useFlag";import{useForkRef}from"@consta/uikit/useForkRef";import{useMutableRef}from"@consta/uikit/useMutableRef";import React,{forwardRef,useCallback,useRef}from"react";import{getItemClick}from"../../helpers/getItemClick";import{cn}from"../../utils/bem";import{withDefaultGetters}from"./helpers";export const cnSelectMenu=cn("SelectMenu");const SelectMenuRender=(a,b)=>{const c=withDefaultGetters(a),{items:d,className:e,getItemHref:f,getItemLabel:g,getItemOnClick:h,getItemTarget:i,onItemClick:j,label:k,onClick:l,getItemSubMenu:m,style:n}=c,o=_objectWithoutProperties(c,_excluded),[p,q]=useFlag(),r=useRef(null),s=useMutableRef(f),t=useMutableRef(i),u=useMutableRef(l),v=useCallback(a=>s.current(a)?"a":"span",[]),w=useCallback(a=>{const b=s.current(a),c=t.current(a);return _objectSpread(_objectSpread({},b&&{href:s.current(a)}),c&&{href:t.current(a)})},[]),x=useCallback(a=>{var b;null===(b=u.current)||void 0===b?void 0:b.call(u,a),q.toogle()},[]);return React.createElement(React.Fragment,null,React.createElement("div",Object.assign({},o,{className:cnSelectMenu(null,[e]),ref:useForkRef([r,b]),onClick:x,style:n}),React.createElement(Text,{className:cnSelectMenu("Label"),size:"s"},k),React.createElement("span",{className:cnSelectMenu("ArrowBox",{open:p})},React.createElement(IconSelect,{size:"xs"}))),d&&React.createElement(ContextMenu,{className:cnSelectMenu("Menu"),anchorRef:r,isOpen:p,items:d,getItemLabel:g,getItemAs:v,getItemAttributes:w,onClickOutside:q.off,onItemClick:({e:a,item:b})=>getItemClick(b,h,j)(a),direction:"rightStartDown",possibleDirections:["downStartLeft","upStartLeft","downStartRight","upStartRight"],getItemSubMenu:m,style:{zIndex:"number"==typeof(null===n||void 0===n?void 0:n.zIndex)?n.zIndex+1:"auto"}}))};export const SelectMenu=forwardRef(SelectMenuRender);export*from"./types";
|
|
2
|
+
//# sourceMappingURL=SelectMenu.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SelectMenu.js","names":["ContextMenu","IconSelect","Text","useFlag","useForkRef","useMutableRef","React","forwardRef","useCallback","useRef","getItemClick","cn","withDefaultGetters","cnSelectMenu","SelectMenuRender","props","componentRef","items","className","getItemHref","getItemLabel","getItemOnClick","getItemTarget","onItemClick","label","onClick","onClickProp","getItemSubMenu","style","otherProps","open","setOpen","ref","getItemHrefRef","getItemTargetRef","onClickRef","getItemAs","item","current","getItemHTMLAttributes","href","target","e","toogle","off","zIndex","SelectMenu"],"sources":["../../../../../src/components/SelectMenu/SelectMenu.tsx"],"sourcesContent":["/* eslint-disable jsx-a11y/no-static-element-interactions */\n/* eslint-disable jsx-a11y/click-events-have-key-events */\nimport './SelectMenu.css';\n\nimport { ContextMenu } from '@consta/uikit/ContextMenu';\nimport { IconSelect } from '@consta/uikit/IconSelect';\nimport { Text } from '@consta/uikit/Text';\nimport { useFlag } from '@consta/uikit/useFlag';\nimport { useForkRef } from '@consta/uikit/useForkRef';\nimport { useMutableRef } from '@consta/uikit/useMutableRef';\nimport React, { forwardRef, useCallback, useRef } from 'react';\n\nimport { getItemClick } from '##/helpers/getItemClick';\nimport { cn } from '##/utils/bem';\n\nimport { withDefaultGetters } from './helpers';\nimport {\n SelectMenuComponent,\n SelectMenuDefaultItem,\n SelectMenuProps,\n} from './types';\n\nexport const cnSelectMenu = cn('SelectMenu');\n\nconst SelectMenuRender = (\n props: SelectMenuProps,\n componentRef: React.Ref<HTMLDivElement>,\n) => {\n const {\n items,\n className,\n getItemHref,\n getItemLabel,\n getItemOnClick,\n getItemTarget,\n onItemClick,\n label,\n onClick: onClickProp,\n getItemSubMenu,\n style,\n ...otherProps\n } = withDefaultGetters(props);\n\n const [open, setOpen] = useFlag();\n\n const ref = useRef<HTMLDivElement>(null);\n\n const getItemHrefRef = useMutableRef(getItemHref);\n const getItemTargetRef = useMutableRef(getItemTarget);\n const onClickRef = useMutableRef(onClickProp);\n\n const getItemAs = useCallback((item: SelectMenuDefaultItem) => {\n if (getItemHrefRef.current(item)) {\n return 'a';\n }\n return 'span';\n }, []);\n\n const getItemHTMLAttributes = useCallback((item: SelectMenuDefaultItem) => {\n const href = getItemHrefRef.current(item);\n const target = getItemTargetRef.current(item);\n\n return {\n ...(href && { href: getItemHrefRef.current(item) }),\n ...(target && { href: getItemTargetRef.current(item) }),\n };\n }, []);\n\n const onClick = useCallback((e: React.MouseEvent<HTMLDivElement>) => {\n onClickRef.current?.(e);\n setOpen.toogle();\n }, []);\n\n return (\n <>\n <div\n {...otherProps}\n className={cnSelectMenu(null, [className])}\n ref={useForkRef([ref, componentRef])}\n onClick={onClick}\n style={style}\n >\n <Text className={cnSelectMenu('Label')} size=\"s\">\n {label}\n </Text>\n <span className={cnSelectMenu('ArrowBox', { open })}>\n <IconSelect size=\"xs\" />\n </span>\n </div>\n {items && (\n <ContextMenu\n className={cnSelectMenu('Menu')}\n anchorRef={ref}\n isOpen={open}\n items={items}\n getItemLabel={getItemLabel}\n getItemAs={getItemAs}\n getItemAttributes={getItemHTMLAttributes}\n onClickOutside={setOpen.off}\n onItemClick={({ e, item }) =>\n getItemClick(item, getItemOnClick, onItemClick)(e)\n }\n direction=\"rightStartDown\"\n possibleDirections={[\n 'downStartLeft',\n 'upStartLeft',\n 'downStartRight',\n 'upStartRight',\n ]}\n getItemSubMenu={getItemSubMenu}\n style={{\n zIndex:\n typeof style?.zIndex === 'number' ? style.zIndex + 1 : 'auto',\n }}\n />\n )}\n </>\n );\n};\n\nexport const SelectMenu = forwardRef(SelectMenuRender) as SelectMenuComponent;\n\nexport * from './types';\n"],"mappings":"u5BAEA,yBAEA,OAASA,WAAT,KAA4B,2BAA5B,CACA,OAASC,UAAT,KAA2B,0BAA3B,CACA,OAASC,IAAT,KAAqB,oBAArB,CACA,OAASC,OAAT,KAAwB,uBAAxB,CACA,OAASC,UAAT,KAA2B,0BAA3B,CACA,OAASC,aAAT,KAA8B,6BAA9B,CACA,MAAOC,MAAP,EAAgBC,UAAhB,CAA4BC,WAA5B,CAAyCC,MAAzC,KAAuD,OAAvD,CAEA,OAASC,YAAT,kCACA,OAASC,EAAT,uBAEA,OAASC,kBAAT,iBAOA,MAAO,MAAMC,aAAY,CAAGF,EAAE,CAAC,YAAD,CAAvB,CAEP,KAAMG,iBAAgB,CAAG,CACvBC,CADuB,CAEvBC,CAFuB,GAGpB,SAcCJ,kBAAkB,CAACG,CAAD,CAdnB,CACG,CACJE,KAAK,CAALA,CADI,CAEJC,SAAS,CAATA,CAFI,CAGJC,WAAW,CAAXA,CAHI,CAIJC,YAAY,CAAZA,CAJI,CAKJC,cAA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P"}
|
|
@@ -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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|
|
@@ -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';\n"],"mappings":"gRAAA,uBAEA,OAASA,MAAT,KAAuB,sBAAvB,CACA,OAASC,SAAT,KAA0B,yBAA1B,CACA,OACEC,cADF,CAEEC,mBAFF,KAGO,iCAHP,CAI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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,CACE,MAAO,4BAAK,GAAG,CAAEA,CAAV,CAAiB,GAAG,CAAEC,CAAtB,EAAP,CAGF,MAAO,qBADgBD,CAChB,MACR,C,CAED,MAAO,MAAME,aAAY,CAAGV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lDyC,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={(e) => {\n onItemClick?.({ item, e });\n getItemOnClick(item)?.(e);\n }}\n as=\"a\"\n />\n );\n })}\n </div>\n );\n}) as TileMenuListComponent;\n"],"mappings":"6OAAA,2BAEA,OAASA,QAA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W,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
|