@consta/header 1.0.1 → 1.2.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/BannerBar/index.d.ts +1 -0
- package/BannerBar/index.js +1 -0
- package/GlobalMenu/index.d.ts +1 -0
- package/GlobalMenu/index.js +1 -0
- package/MegaMenu/index.d.ts +1 -0
- package/MegaMenu/index.js +1 -0
- package/NavBar/index.d.ts +1 -0
- package/NavBar/index.js +1 -0
- package/__internal__/src/components/Badges/Badges.js.map +1 -1
- package/__internal__/src/components/Badges/helpers.js.map +1 -1
- package/__internal__/src/components/Badges/types.d.ts +6 -6
- package/__internal__/src/components/BannerBar/BannerBar.css +1 -0
- package/__internal__/src/components/BannerBar/BannerBar.d.ts +3 -0
- package/__internal__/src/components/BannerBar/BannerBar.js +2 -0
- package/__internal__/src/components/BannerBar/BannerBar.js.map +1 -0
- package/__internal__/src/components/BannerBar/BannerBarItem/BannerBarItem.css +1 -0
- package/__internal__/src/components/BannerBar/BannerBarItem/BannerBarItem.d.ts +3 -0
- package/__internal__/src/components/BannerBar/BannerBarItem/BannerBarItem.js +2 -0
- package/__internal__/src/components/BannerBar/BannerBarItem/BannerBarItem.js.map +1 -0
- package/__internal__/src/components/BannerBar/BannerBarItem/index.d.ts +1 -0
- package/__internal__/src/components/BannerBar/BannerBarItem/index.js +2 -0
- package/__internal__/src/components/BannerBar/BannerBarItem/index.js.map +1 -0
- package/__internal__/src/components/BannerBar/helpers.d.ts +274 -0
- package/__internal__/src/components/BannerBar/helpers.js +2 -0
- package/__internal__/src/components/BannerBar/helpers.js.map +1 -0
- package/__internal__/src/components/BannerBar/index.d.ts +3 -0
- package/__internal__/src/components/BannerBar/index.js +2 -0
- package/__internal__/src/components/BannerBar/index.js.map +1 -0
- package/__internal__/src/components/BannerBar/types.d.ts +42 -0
- package/__internal__/src/components/BannerBar/types.js +2 -0
- package/__internal__/src/components/BannerBar/types.js.map +1 -0
- package/__internal__/src/components/ButtonMenu/ButtonMenu.js.map +1 -1
- package/__internal__/src/components/ButtonMenu/helpers.d.ts +2 -2
- package/__internal__/src/components/ButtonMenu/helpers.js.map +1 -1
- package/__internal__/src/components/ButtonMenu/types.d.ts +9 -9
- package/__internal__/src/components/GlobalMenu/GlobalMenu.css +1 -0
- package/__internal__/src/components/GlobalMenu/GlobalMenu.d.ts +3 -0
- package/__internal__/src/components/GlobalMenu/GlobalMenu.js +2 -0
- package/__internal__/src/components/GlobalMenu/GlobalMenu.js.map +1 -0
- package/__internal__/src/components/GlobalMenu/GlobalMenuGroup/GlobalMenuGroup.css +1 -0
- package/__internal__/src/components/GlobalMenu/GlobalMenuGroup/GlobalMenuGroup.d.ts +3 -0
- package/__internal__/src/components/GlobalMenu/GlobalMenuGroup/GlobalMenuGroup.js +2 -0
- package/__internal__/src/components/GlobalMenu/GlobalMenuGroup/GlobalMenuGroup.js.map +1 -0
- package/__internal__/src/components/GlobalMenu/GlobalMenuGroup/index.d.ts +1 -0
- package/__internal__/src/components/GlobalMenu/GlobalMenuGroup/index.js +2 -0
- package/__internal__/src/components/GlobalMenu/GlobalMenuGroup/index.js.map +1 -0
- package/__internal__/src/components/GlobalMenu/helper.d.ts +281 -0
- package/__internal__/src/components/GlobalMenu/helper.js +2 -0
- package/__internal__/src/components/GlobalMenu/helper.js.map +1 -0
- package/__internal__/src/components/GlobalMenu/index.d.ts +2 -0
- package/__internal__/src/components/GlobalMenu/index.js +2 -0
- package/__internal__/src/components/GlobalMenu/index.js.map +1 -0
- package/__internal__/src/components/GlobalMenu/types.d.ts +75 -0
- package/__internal__/src/components/GlobalMenu/types.js +2 -0
- package/__internal__/src/components/GlobalMenu/types.js.map +1 -0
- package/__internal__/src/components/Header/Header.js.map +1 -1
- package/__internal__/src/components/Header/HeaderLogin/HeaderLogin.d.ts +2 -2
- package/__internal__/src/components/Header/HeaderLogin/HeaderLogin.js.map +1 -1
- package/__internal__/src/components/Header/HeaderLogo/HeaderLogo.d.ts +2 -2
- package/__internal__/src/components/Header/HeaderLogo/HeaderLogo.js.map +1 -1
- package/__internal__/src/components/Header/HeaderSearch/HeaderSearch.d.ts +1 -1
- package/__internal__/src/components/Header/HeaderSearch/HeaderSearch.js.map +1 -1
- package/__internal__/src/components/Header/helpers.d.ts +1 -1
- package/__internal__/src/components/Header/helpers.js.map +1 -1
- package/__internal__/src/components/Header/types.d.ts +12 -12
- package/__internal__/src/components/Languages/Languages.js.map +1 -1
- package/__internal__/src/components/Languages/helpers.d.ts +1 -1
- package/__internal__/src/components/Languages/helpers.js.map +1 -1
- package/__internal__/src/components/Languages/types.d.ts +3 -3
- package/__internal__/src/components/Layout/Layout.d.ts +1 -1
- package/__internal__/src/components/Layout/Layout.js.map +1 -1
- package/__internal__/src/components/Layout/LayoutRow/LayoutRow.d.ts +1 -1
- package/__internal__/src/components/Layout/LayoutRow/LayoutRow.js.map +1 -1
- package/__internal__/src/components/Layout/helpers.js.map +1 -1
- package/__internal__/src/components/Layout/types.d.ts +3 -3
- package/__internal__/src/components/MegaMenu/MegaMenu.css +1 -0
- package/__internal__/src/components/MegaMenu/MegaMenu.d.ts +4 -0
- package/__internal__/src/components/MegaMenu/MegaMenu.js +2 -0
- package/__internal__/src/components/MegaMenu/MegaMenu.js.map +1 -0
- package/__internal__/src/components/MegaMenu/MegaMenuBox/MegaMenuBox.css +1 -0
- package/__internal__/src/components/MegaMenu/MegaMenuBox/MegaMenuBox.d.ts +3 -0
- package/__internal__/src/components/MegaMenu/MegaMenuBox/MegaMenuBox.js +2 -0
- package/__internal__/src/components/MegaMenu/MegaMenuBox/MegaMenuBox.js.map +1 -0
- package/__internal__/src/components/MegaMenu/MegaMenuBox/index.d.ts +2 -0
- package/__internal__/src/components/MegaMenu/MegaMenuBox/index.js +2 -0
- package/__internal__/src/components/MegaMenu/MegaMenuBox/index.js.map +1 -0
- package/__internal__/src/components/MegaMenu/MegaMenuBox/types.d.ts +10 -0
- package/__internal__/src/components/MegaMenu/MegaMenuBox/types.js +2 -0
- package/__internal__/src/components/MegaMenu/MegaMenuBox/types.js.map +1 -0
- package/__internal__/src/components/MegaMenu/helper.d.ts +301 -0
- package/__internal__/src/components/MegaMenu/helper.js +2 -0
- package/__internal__/src/components/MegaMenu/helper.js.map +1 -0
- package/__internal__/src/components/MegaMenu/index.d.ts +3 -0
- package/__internal__/src/components/MegaMenu/index.js +2 -0
- package/__internal__/src/components/MegaMenu/index.js.map +1 -0
- package/__internal__/src/components/MegaMenu/types.d.ts +65 -0
- package/__internal__/src/components/MegaMenu/types.js +2 -0
- package/__internal__/src/components/MegaMenu/types.js.map +1 -0
- package/__internal__/src/components/Menu/Menu.js.map +1 -1
- package/__internal__/src/components/Menu/helpers.d.ts +1 -1
- package/__internal__/src/components/Menu/helpers.js.map +1 -1
- package/__internal__/src/components/Menu/types.d.ts +10 -10
- package/__internal__/src/components/MobileMenu/MobileMenu.js.map +1 -1
- package/__internal__/src/components/MobileMenu/types.d.ts +2 -2
- package/__internal__/src/components/NavBar/NavBar.css +1 -0
- package/__internal__/src/components/NavBar/NavBar.d.ts +3 -0
- package/__internal__/src/components/NavBar/NavBar.js +2 -0
- package/__internal__/src/components/NavBar/NavBar.js.map +1 -0
- package/__internal__/src/components/NavBar/helper.d.ts +31 -0
- package/__internal__/src/components/NavBar/helper.js +2 -0
- package/__internal__/src/components/NavBar/helper.js.map +1 -0
- package/__internal__/src/components/NavBar/index.d.ts +1 -0
- package/__internal__/src/components/NavBar/index.js +2 -0
- package/__internal__/src/components/NavBar/index.js.map +1 -0
- package/__internal__/src/components/NavBar/types.d.ts +48 -0
- package/__internal__/src/components/NavBar/types.js +2 -0
- package/__internal__/src/components/NavBar/types.js.map +1 -0
- package/__internal__/src/components/NotificationCard/NotificationCard.d.ts +1 -1
- package/__internal__/src/components/NotificationCard/NotificationCard.js.map +1 -1
- package/__internal__/src/components/NotificationCard/helpers.js.map +1 -1
- package/__internal__/src/components/NotificationCard/types.d.ts +3 -3
- package/__internal__/src/components/Notifications/Notifications.js.map +1 -1
- package/__internal__/src/components/Notifications/types.d.ts +2 -2
- package/__internal__/src/components/NotificationsActions/NotificationsActions.js.map +1 -1
- package/__internal__/src/components/NotificationsActions/helpers.js.map +1 -1
- package/__internal__/src/components/NotificationsActions/types.d.ts +7 -7
- package/__internal__/src/components/NotificationsList/NotificationsList.js.map +1 -1
- package/__internal__/src/components/NotificationsList/helpers.d.ts +2 -2
- package/__internal__/src/components/NotificationsList/helpers.js.map +1 -1
- package/__internal__/src/components/NotificationsList/types.d.ts +23 -23
- package/__internal__/src/components/SelectMenu/SelectMenu.js.map +1 -1
- package/__internal__/src/components/SelectMenu/helpers.d.ts +1 -1
- package/__internal__/src/components/SelectMenu/helpers.js.map +1 -1
- package/__internal__/src/components/SelectMenu/types.d.ts +9 -9
- package/__internal__/src/components/Sidebar/Sidebar.d.ts +1 -1
- package/__internal__/src/components/Sidebar/Sidebar.js.map +1 -1
- package/__internal__/src/components/TileMenu/TileMenu.js.map +1 -1
- package/__internal__/src/components/TileMenu/TileMenuItem/TileMenuItem.d.ts +2 -2
- package/__internal__/src/components/TileMenu/TileMenuItem/TileMenuItem.js.map +1 -1
- package/__internal__/src/components/TileMenu/TileMenuList/TileMenuList.js.map +1 -1
- package/__internal__/src/components/TileMenu/TileMenuList/types.d.ts +8 -8
- package/__internal__/src/components/TileMenu/helpers.d.ts +3 -0
- package/__internal__/src/components/TileMenu/helpers.js.map +1 -1
- package/__internal__/src/components/TileMenu/types.d.ts +14 -14
- package/__internal__/src/components/TileMenu/types.js.map +1 -1
- package/__internal__/src/components/VerticalMenu/VerticalMenu.js.map +1 -1
- package/__internal__/src/components/VerticalMenu/VerticalMenuItem/VerticalMenuItem.js.map +1 -1
- package/__internal__/src/components/VerticalMenu/VerticalMenuLevel/VerticalMenuLevel.js.map +1 -1
- package/__internal__/src/components/VerticalMenu/helpers.d.ts +1 -1
- package/__internal__/src/components/VerticalMenu/helpers.js.map +1 -1
- package/__internal__/src/components/VerticalMenu/types.d.ts +16 -16
- package/__internal__/src/docs/start/start.stand.js.map +1 -1
- package/__internal__/src/helpers/getItemClick.d.ts +2 -2
- package/__internal__/src/helpers/getItemClick.js.map +1 -1
- package/__internal__/src/utils/bem.js.map +1 -1
- package/__internal__/src/utils/types/PropsWithHTMLAttributes.d.ts +2 -2
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NotificationsActions.js","names":["Button","ContextMenu","IconMeatball","useForkRef","useMutableRef","withTooltip","React","forwardRef","useCallback","useEffect","useRef","useState","getItemClick","withDefaultGetters","ButtonWithTooltip","NotificationsActionsRender","props","ref","items","className","children","mainButtonOnlyIcon","opened","onOpen","onOpenProp","setVisibleMenu","setVisibleMenuProp","getItemIcon","getItemLabel","getItemOnClick","onItemClick","otherProps","buttonRef","visibleMenu","closeMenu","toogleMenu","state","setVisibleMenuRef","menuRef","getOnItemClick","item","e","elementZIndex","style","zIndex","current","length","content","width","NotificationsActions"],"sources":["../../../../../src/components/NotificationsActions/NotificationsActions.tsx"],"sourcesContent":["import { Button } from '@consta/uikit/Button';\nimport { ContextMenu } from '@consta/uikit/ContextMenu';\nimport { IconMeatball } from '@consta/uikit/IconMeatball';\nimport { useForkRef } from '@consta/uikit/useForkRef';\nimport { useMutableRef } from '@consta/uikit/useMutableRef';\nimport { withTooltip } from '@consta/uikit/withTooltip';\nimport React, {\n forwardRef,\n useCallback,\n useEffect,\n useRef,\n useState,\n} from 'react';\n\nimport { getItemClick } from '##/helpers/getItemClick';\n\nimport { withDefaultGetters } from './helpers';\nimport {\n NotificationsActionsComponent,\n NotificationsActionsProps,\n} from './types';\n\nconst ButtonWithTooltip = withTooltip()(Button);\n\nconst NotificationsActionsRender = (\n props: NotificationsActionsProps,\n ref: React.Ref<HTMLButtonElement>,\n) => {\n const {\n items = [],\n className,\n children,\n mainButtonOnlyIcon,\n opened = false,\n onOpen: onOpenProp,\n setVisibleMenu: setVisibleMenuProp,\n getItemIcon,\n getItemLabel,\n getItemOnClick,\n onItemClick,\n ...otherProps\n } = withDefaultGetters(props);\n const buttonRef = useRef(null);\n\n const [visibleMenu, setVisibleMenu] = useState<boolean>(opened);\n\n const closeMenu = useCallback(() => setVisibleMenu(false), []);\n const toogleMenu = useCallback(() => setVisibleMenu((state?) => !state), []);\n const onOpen = useMutableRef(onOpenProp);\n const setVisibleMenuRef = useMutableRef(setVisibleMenuProp);\n const menuRef = useForkRef([buttonRef, ref]);\n\n const getOnItemClick =\n (item: typeof items[number]) => (e: React.MouseEvent) => {\n onItemClick?.({ e, item });\n getItemOnClick(item)?.(e);\n };\n\n const elementZIndex =\n typeof props.style?.zIndex === 'number'\n ? props.style.zIndex + 1\n : undefined;\n\n useEffect(() => {\n setVisibleMenu(opened);\n }, [opened]);\n\n useEffect(() => {\n onOpen.current?.(visibleMenu);\n }, [visibleMenu, onOpen]);\n\n useEffect(() => {\n setVisibleMenuRef.current?.(setVisibleMenu);\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n if (items.length === 1 && !mainButtonOnlyIcon) {\n return (\n <Button\n {...otherProps}\n className={className}\n size=\"xs\"\n view=\"clear\"\n iconLeft={getItemIcon(items[0])}\n onClick={getOnItemClick(items[0])}\n label={getItemLabel(items[0])}\n ref={ref}\n />\n );\n }\n\n if (items.length === 1 && getItemIcon(items[0]) && mainButtonOnlyIcon) {\n return (\n <ButtonWithTooltip\n {...otherProps}\n className={className}\n size=\"xs\"\n view=\"clear\"\n iconLeft={getItemIcon(items[0])}\n onClick={getOnItemClick(items[0])}\n tooltipProps={{\n content: getItemLabel(items[0]),\n }}\n ref={ref}\n />\n );\n }\n\n return (\n <>\n <Button\n {...otherProps}\n className={className}\n size=\"xs\"\n view=\"clear\"\n iconLeft={IconMeatball}\n ref={menuRef}\n onClick={toogleMenu}\n />\n <ContextMenu\n isOpen={visibleMenu}\n items={items}\n getItemLabel={getItemLabel}\n onItemClick={({ e, item }) =>\n getItemClick(item, getItemOnClick, onItemClick)(e)\n }\n getItemKey={getItemLabel}\n getItemLeftIcon={getItemIcon}\n anchorRef={buttonRef}\n onClickOutside={closeMenu}\n possibleDirections={['downStartRight', 'upStartRight']}\n direction=\"downStartRight\"\n style={{ width: 280, zIndex: elementZIndex }}\n />\n </>\n );\n};\n\nexport const NotificationsActions = forwardRef(\n NotificationsActionsRender,\n) as NotificationsActionsComponent;\n"],"mappings":"0PAAA,OAASA,
|
|
1
|
+
{"version":3,"file":"NotificationsActions.js","names":["Button","ContextMenu","IconMeatball","useForkRef","useMutableRef","withTooltip","React","forwardRef","useCallback","useEffect","useRef","useState","getItemClick","withDefaultGetters","ButtonWithTooltip","NotificationsActionsRender","props","ref","items","className","children","mainButtonOnlyIcon","opened","onOpen","onOpenProp","setVisibleMenu","setVisibleMenuProp","getItemIcon","getItemLabel","getItemOnClick","onItemClick","otherProps","buttonRef","visibleMenu","closeMenu","toogleMenu","state","setVisibleMenuRef","menuRef","getOnItemClick","item","e","elementZIndex","style","zIndex","current","length","content","width","NotificationsActions"],"sources":["../../../../../src/components/NotificationsActions/NotificationsActions.tsx"],"sourcesContent":["import { Button } from '@consta/uikit/Button';\nimport { ContextMenu } from '@consta/uikit/ContextMenu';\nimport { IconMeatball } from '@consta/uikit/IconMeatball';\nimport { useForkRef } from '@consta/uikit/useForkRef';\nimport { useMutableRef } from '@consta/uikit/useMutableRef';\nimport { withTooltip } from '@consta/uikit/withTooltip';\nimport React, {\n forwardRef,\n useCallback,\n useEffect,\n useRef,\n useState,\n} from 'react';\n\nimport { getItemClick } from '##/helpers/getItemClick';\n\nimport { withDefaultGetters } from './helpers';\nimport {\n NotificationsActionsComponent,\n NotificationsActionsProps,\n} from './types';\n\nconst ButtonWithTooltip = withTooltip()(Button);\n\nconst NotificationsActionsRender = (\n props: NotificationsActionsProps,\n ref: React.Ref<HTMLButtonElement>,\n) => {\n const {\n items = [],\n className,\n children,\n mainButtonOnlyIcon,\n opened = false,\n onOpen: onOpenProp,\n setVisibleMenu: setVisibleMenuProp,\n getItemIcon,\n getItemLabel,\n getItemOnClick,\n onItemClick,\n ...otherProps\n } = withDefaultGetters(props);\n const buttonRef = useRef(null);\n\n const [visibleMenu, setVisibleMenu] = useState<boolean>(opened);\n\n const closeMenu = useCallback(() => setVisibleMenu(false), []);\n const toogleMenu = useCallback(() => setVisibleMenu((state?) => !state), []);\n const onOpen = useMutableRef(onOpenProp);\n const setVisibleMenuRef = useMutableRef(setVisibleMenuProp);\n const menuRef = useForkRef([buttonRef, ref]);\n\n const getOnItemClick =\n (item: typeof items[number]) => (e: React.MouseEvent) => {\n onItemClick?.({ e, item });\n getItemOnClick(item)?.(e);\n };\n\n const elementZIndex =\n typeof props.style?.zIndex === 'number'\n ? props.style.zIndex + 1\n : undefined;\n\n useEffect(() => {\n setVisibleMenu(opened);\n }, [opened]);\n\n useEffect(() => {\n onOpen.current?.(visibleMenu);\n }, [visibleMenu, onOpen]);\n\n useEffect(() => {\n setVisibleMenuRef.current?.(setVisibleMenu);\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n if (items.length === 1 && !mainButtonOnlyIcon) {\n return (\n <Button\n {...otherProps}\n className={className}\n size=\"xs\"\n view=\"clear\"\n iconLeft={getItemIcon(items[0])}\n onClick={getOnItemClick(items[0])}\n label={getItemLabel(items[0])}\n ref={ref}\n />\n );\n }\n\n if (items.length === 1 && getItemIcon(items[0]) && mainButtonOnlyIcon) {\n return (\n <ButtonWithTooltip\n {...otherProps}\n className={className}\n size=\"xs\"\n view=\"clear\"\n iconLeft={getItemIcon(items[0])}\n onClick={getOnItemClick(items[0])}\n tooltipProps={{\n content: getItemLabel(items[0]),\n }}\n ref={ref}\n />\n );\n }\n\n return (\n <>\n <Button\n {...otherProps}\n className={className}\n size=\"xs\"\n view=\"clear\"\n iconLeft={IconMeatball}\n ref={menuRef}\n onClick={toogleMenu}\n />\n <ContextMenu\n isOpen={visibleMenu}\n items={items}\n getItemLabel={getItemLabel}\n onItemClick={({ e, item }) =>\n getItemClick(item, getItemOnClick, onItemClick)(e)\n }\n getItemKey={getItemLabel}\n getItemLeftIcon={getItemIcon}\n anchorRef={buttonRef}\n onClickOutside={closeMenu}\n possibleDirections={['downStartRight', 'upStartRight']}\n direction=\"downStartRight\"\n style={{ width: 280, zIndex: elementZIndex }}\n />\n </>\n );\n};\n\nexport const NotificationsActions = forwardRef(\n NotificationsActionsRender,\n) as NotificationsActionsComponent;\n"],"mappings":"0PAAA,OAASA,MAAM,KAAQ,sBAAsB,CAC7C,OAASC,WAAW,KAAQ,2BAA2B,CACvD,OAASC,YAAY,KAAQ,4BAA4B,CACzD,OAASC,UAAU,KAAQ,0BAA0B,CACrD,OAASC,aAAa,KAAQ,6BAA6B,CAC3D,OAASC,WAAW,KAAQ,2BAA2B,CACvD,MAAOC,MAAK,EACVC,UAAU,CACVC,WAAW,CACXC,SAAS,CACTC,MAAM,CACNC,QAAQ,KACH,OAAO,CAEd,OAASC,YAAY,kCAErB,OAASC,kBAAkB,iBAAoB,KAMzCC,kBAAiB,CAAGT,WAAW,EAAE,CAACL,MAAM,CAAC,CAEzCe,0BAA0B,CAAG,CACjCC,CAAgC,CAChCC,CAAiC,GAC9B,eAcCJ,kBAAkB,CAACG,CAAK,CAAC,CAbvB,CACJE,KAAK,CAALA,CAAK,CAAG,EAAE,CACVC,SAAS,CAATA,CAAS,CACTC,QAAQ,CAARA,CAAQ,CACRC,kBAAkB,CAAlBA,CAAkB,CAClBC,MAAM,CAANA,CAAM,GAAQ,CACdC,MAAM,CAAEC,CAAU,CAClBC,cAAc,CAAEC,CAAkB,CAClCC,WAAW,CAAXA,CAAW,CACXC,YAAY,CAAZA,CAAY,CACZC,cAAc,CAAdA,CAAc,CACdC,WAAW,CAAXA,CAEF,CAAC,GADIC,CAAU,uCAETC,CAAS,CAAGtB,MAAM,CAAC,IAAI,CAAC,CAExB,CAACuB,CAAW,CAAER,CAAc,CAAC,CAAGd,QAAQ,CAAUW,CAAM,CAAC,CAEzDY,CAAS,CAAG1B,WAAW,CAAC,IAAMiB,CAAc,IAAO,C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AK,CAAC,CAAC,CAAC,CAAE,CAClC,KAAK,CAAEU,CAAY,CAACV,CAAK,CAAC,CAAC,CAAC,CAAE,CAC9B,GAAG,CAAED,CAAI,GAkDjB,CAAC,CAED,MAAO,MAAMgC,qBAAoB,CAAG1C,UAAU,CAC5CQ,0BAA0B,CACM"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.js","names":["defaultGetItemIcon","item","icon","defaultGetItemLabel","label","defaultGetItemOnClick","onClick","withDefaultGetters","props","getItemIcon","getItemLabel","getItemOnClick"],"sources":["../../../../../src/components/NotificationsActions/helpers.tsx"],"sourcesContent":["import {\n DefaultItem,\n NotificationsActionsPropGetItemIcon,\n NotificationsActionsPropGetItemLabel,\n NotificationsActionsPropGetItemOnClick,\n NotificationsActionsProps,\n} from './types';\n\nconst defaultGetItemIcon: NotificationsActionsPropGetItemIcon<DefaultItem> = (\n item,\n) => item.icon;\nconst defaultGetItemLabel: NotificationsActionsPropGetItemLabel<DefaultItem> = (\n item,\n) => item.label;\nconst defaultGetItemOnClick: NotificationsActionsPropGetItemOnClick<\n DefaultItem\n> = (item) => item.onClick;\n\nexport function withDefaultGetters<ITEM>(\n props: NotificationsActionsProps<ITEM>,\n) {\n return {\n ...props,\n getItemIcon: props.getItemIcon || defaultGetItemIcon,\n getItemLabel: props.getItemLabel || defaultGetItemLabel,\n getItemOnClick: props.getItemOnClick || defaultGetItemOnClick,\n };\n}\n"],"mappings":"0qBAQMA,mBAAoE,CACxEC,
|
|
1
|
+
{"version":3,"file":"helpers.js","names":["defaultGetItemIcon","item","icon","defaultGetItemLabel","label","defaultGetItemOnClick","onClick","withDefaultGetters","props","getItemIcon","getItemLabel","getItemOnClick"],"sources":["../../../../../src/components/NotificationsActions/helpers.tsx"],"sourcesContent":["import {\n DefaultItem,\n NotificationsActionsPropGetItemIcon,\n NotificationsActionsPropGetItemLabel,\n NotificationsActionsPropGetItemOnClick,\n NotificationsActionsProps,\n} from './types';\n\nconst defaultGetItemIcon: NotificationsActionsPropGetItemIcon<DefaultItem> = (\n item,\n) => item.icon;\nconst defaultGetItemLabel: NotificationsActionsPropGetItemLabel<DefaultItem> = (\n item,\n) => item.label;\nconst defaultGetItemOnClick: NotificationsActionsPropGetItemOnClick<\n DefaultItem\n> = (item) => item.onClick;\n\nexport function withDefaultGetters<ITEM>(\n props: NotificationsActionsProps<ITEM>,\n) {\n return {\n ...props,\n getItemIcon: props.getItemIcon || defaultGetItemIcon,\n getItemLabel: props.getItemLabel || defaultGetItemLabel,\n getItemOnClick: props.getItemOnClick || defaultGetItemOnClick,\n };\n}\n"],"mappings":"0qBAQMA,mBAAoE,CACxEC,CAAI,EACDA,CAAI,CAACC,IAAI,CACRC,mBAAsE,CAC1EF,CAAI,EACDA,CAAI,CAACG,KAAK,CACTC,qBAEL,CAAIJ,CAAI,EAAKA,CAAI,CAACK,OAAO,CAE1B,MAAO,SAASC,mBAAkB,CAChCC,CAAsC,CACtC,CACA,sCACKA,CAAK,MACRC,WAAW,CAAED,CAAK,CAACC,WAAW,EAAIT,kBAAkB,CACpDU,YAAY,CAAEF,CAAK,CAACE,YAAY,EAAIP,mBAAmB,CACvDQ,cAAc,CAAEH,CAAK,CAACG,cAAc,EAAIN,qBAAqB,EAEjE"}
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { IconComponent } from '@consta/uikit/Icon';
|
|
3
3
|
import { PropsWithHTMLAttributes } from "../../utils/types/PropsWithHTMLAttributes";
|
|
4
|
-
export
|
|
4
|
+
export type DefaultItem = {
|
|
5
5
|
label: string;
|
|
6
6
|
onClick?: React.EventHandler<React.MouseEvent>;
|
|
7
7
|
icon?: IconComponent;
|
|
8
8
|
};
|
|
9
|
-
export
|
|
10
|
-
export
|
|
11
|
-
export
|
|
12
|
-
export
|
|
9
|
+
export type NotificationsActionsPropGetItemLabel<ITEM> = (item: ITEM) => string;
|
|
10
|
+
export type NotificationsActionsPropGetItemIcon<ITEM> = (item: ITEM) => IconComponent | undefined;
|
|
11
|
+
export type NotificationsActionsPropGetItemOnClick<ITEM> = (item: ITEM) => React.EventHandler<React.MouseEvent> | undefined;
|
|
12
|
+
export type NotificationsActionsOnItemClick<ITEM> = (props: {
|
|
13
13
|
e: React.MouseEvent;
|
|
14
14
|
item: ITEM;
|
|
15
15
|
}) => void;
|
|
16
|
-
export
|
|
16
|
+
export type NotificationsActionsProps<ITEM = DefaultItem> = PropsWithHTMLAttributes<{
|
|
17
17
|
items?: ITEM[];
|
|
18
18
|
mainButtonOnlyIcon?: boolean;
|
|
19
19
|
opened?: boolean;
|
|
@@ -29,4 +29,4 @@ export declare type NotificationsActionsProps<ITEM = DefaultItem> = PropsWithHTM
|
|
|
29
29
|
} ? {} : {
|
|
30
30
|
getItemLabel: NotificationsActionsPropGetItemLabel<ITEM>;
|
|
31
31
|
});
|
|
32
|
-
export
|
|
32
|
+
export type NotificationsActionsComponent = <ITEM = DefaultItem>(props: NotificationsActionsProps<ITEM>) => React.ReactElement | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NotificationsList.js","names":["Button","IconClose","Text","React","forwardRef","Fragment","useCallback","useEffect","useRef","NotificationCard","NotificationsActions","cn","defaultGroupLabelFormat","getGroups","withDefaultGetters","cnNotificationsList","NotificationsListRender","props","ref","className","items","groupByDay","groups","groupLabelFormat","itemDateFormat","title","actions","getItemLabel","getActionIcon","getActionLabel","getActionOnClick","getGroupId","getGroupLabel","getItemActions","getItemBadges","getItemDate","getItemDescription","getItemGroup","getItemImage","getItemRead","getItemView","onClose","otherProps","resultGroups","setVisibleMenuRef","listRef","closeAllMenu","key","current","Object","prototype","hasOwnProperty","call","addEventListener","passive","removeEventListener","elementZIndex","style","zIndex","length","map","group","groupIndex","groupLabel","item","itemIndex","value","NotificationsList"],"sources":["../../../../../src/components/NotificationsList/NotificationsList.tsx"],"sourcesContent":["import './NotificationsList.css';\n\nimport { Button } from '@consta/uikit/Button';\nimport { IconClose } from '@consta/uikit/IconClose';\nimport { Text } from '@consta/uikit/Text';\nimport React, {\n forwardRef,\n Fragment,\n useCallback,\n useEffect,\n useRef,\n} from 'react';\n\nimport { NotificationCard } from '##/components/NotificationCard';\nimport { NotificationsActions } from '##/components/NotificationsActions';\nimport { cn } from '##/utils/bem';\n\nimport {\n defaultGroupLabelFormat,\n getGroups,\n withDefaultGetters,\n} from './helpers';\nimport { NotificationsListComponent, NotificationsListProps } from './types';\n\nexport const cnNotificationsList = cn('NotificationsList');\n\nfunction NotificationsListRender(\n props: NotificationsListProps,\n ref: React.Ref<HTMLDivElement>,\n) {\n const {\n className,\n items,\n groupByDay = false,\n groups,\n groupLabelFormat = defaultGroupLabelFormat,\n itemDateFormat,\n title,\n actions,\n getItemLabel,\n getActionIcon,\n getActionLabel,\n getActionOnClick,\n getGroupId,\n getGroupLabel,\n getItemActions,\n getItemBadges,\n getItemDate,\n getItemDescription,\n getItemGroup,\n getItemImage,\n getItemRead,\n getItemView,\n onClose,\n ...otherProps\n } = withDefaultGetters(props);\n\n const resultGroups = getGroups(\n items,\n groups,\n groupByDay,\n getItemGroup,\n getItemDate,\n getGroupId,\n );\n\n const setVisibleMenuRef = useRef<Record<string, Function>>({});\n const listRef = useRef<HTMLDivElement>(null);\n\n const closeAllMenu = useCallback(() => {\n for (const key in setVisibleMenuRef.current) {\n if (\n Object.prototype.hasOwnProperty.call(setVisibleMenuRef.current, key)\n ) {\n setVisibleMenuRef.current[key](false);\n }\n }\n }, []);\n\n useEffect(() => {\n listRef.current?.addEventListener('scroll', closeAllMenu, {\n passive: true,\n });\n\n return () => listRef.current?.removeEventListener('scroll', closeAllMenu);\n }, [listRef.current]);\n\n const elementZIndex =\n typeof props.style?.zIndex === 'number'\n ? props.style.zIndex + 1\n : undefined;\n\n return (\n <div\n {...otherProps}\n ref={ref}\n className={cnNotificationsList(null, [className])}\n >\n {(title || actions) && (\n <div className={cnNotificationsList('Header')}>\n <Text\n className={cnNotificationsList('HeaderItem')}\n size=\"xl\"\n truncate\n >\n {title}\n </Text>\n {actions?.length && (\n <NotificationsActions\n className={cnNotificationsList('HeaderItem')}\n items={actions}\n getItemIcon={getActionIcon}\n getItemOnClick={getActionOnClick}\n getItemLabel={getActionLabel}\n style={{ zIndex: elementZIndex }}\n />\n )}\n {onClose && (\n <Button\n className={cnNotificationsList('HeaderItem')}\n size=\"s\"\n view=\"clear\"\n iconLeft={IconClose}\n onClick={onClose}\n />\n )}\n </div>\n )}\n <div ref={listRef} className={cnNotificationsList('List')}>\n {resultGroups.map((group, groupIndex) => {\n const groupLabel = groupByDay\n ? groupLabelFormat(Number(group.key))\n : group.group && getGroupLabel(group.group);\n return (\n <Fragment key={cnNotificationsList('Group', { groupIndex })}>\n {groupLabel && (\n <Text\n className={cnNotificationsList('GroupLabel')}\n key={cnNotificationsList('GroupLabel', { groupIndex })}\n view=\"secondary\"\n transform=\"uppercase\"\n weight=\"bold\"\n size=\"2xs\"\n >\n {groupLabel}\n </Text>\n )}\n {group.items.map((item, itemIndex) => {\n return (\n <NotificationCard\n className={cnNotificationsList('Item')}\n key={cnNotificationsList('Item', { groupIndex, itemIndex })}\n title={getItemLabel(item)}\n description={getItemDescription(item)}\n imageUrl={getItemImage(item)}\n read={getItemRead(item)}\n date={getItemDate(item)}\n dateFormat={itemDateFormat}\n badges={getItemBadges(item)}\n actions={getItemActions(item)}\n view={getItemView(item)}\n setVisibleMenu={(value) => {\n setVisibleMenuRef.current[`${groupIndex}-${itemIndex}`] =\n value;\n }}\n style={{ zIndex: elementZIndex }}\n />\n );\n })}\n </Fragment>\n );\n })}\n </div>\n </div>\n );\n}\n\nexport const NotificationsList = forwardRef(\n NotificationsListRender,\n) as NotificationsListComponent;\n\nexport * from './types';\n"],"mappings":"+aAAA,gCAEA,OAASA,MAAT,KAAuB,sBAAvB,CACA,OAASC,SAAT,KAA0B,yBAA1B,CACA,OAASC,IAAT,KAAqB,oBAArB,CACA,MAAOC,MAAP,EACEC,UADF,CAEEC,QAFF,CA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AEtC,CAAY,CAACqC,CAAD,CAHrB,CAIE,WAAW,CAAE5B,CAAkB,CAAC4B,CAAD,CAJjC,CAKE,QAAQ,CAAE1B,CAAY,CAAC0B,CAAD,CALxB,CAME,IAAI,CAAEzB,CAAW,CAACyB,CAAD,CANnB,CAOE,IAAI,CAAE7B,CAAW,CAAC6B,CAAD,CAPnB,CAQE,UAAU,CAAExC,CARd,CASE,MAAM,CAAEU,CAAa,CAAC8B,CAAD,CATvB,CAUE,OAAO,CAAE/B,CAAc,CAAC+B,CAAD,CAVzB,CAWE,IAAI,CAAExB,CAAW,CAACwB,CAAD,CAXnB,CAYE,cAAc,CAAGE,CAAD,EAAW,CACzBtB,CAAiB,CAACI,OAAlB,CAA2B,GAAEc,CAAW,IAAGG,CAAU,EAArD,EACEC,CACH,CAfH,CAgBE,KAAK,CAAE,CAAER,MAAM,CAAEF,CAAV,CAhBT,EAFH,CAbH,CAqCH,CA1CA,CADH,CAnCF,CAkFH,CAED,MAAO,MAAMW,kBAAiB,CAAG/D,UAAU,CACzCY,uBADyC,CAApC,CAIP"}
|
|
1
|
+
{"version":3,"file":"NotificationsList.js","names":["Button","IconClose","Text","React","forwardRef","Fragment","useCallback","useEffect","useRef","NotificationCard","NotificationsActions","cn","defaultGroupLabelFormat","getGroups","withDefaultGetters","cnNotificationsList","NotificationsListRender","props","ref","className","items","groupByDay","groups","groupLabelFormat","itemDateFormat","title","actions","getItemLabel","getActionIcon","getActionLabel","getActionOnClick","getGroupId","getGroupLabel","getItemActions","getItemBadges","getItemDate","getItemDescription","getItemGroup","getItemImage","getItemRead","getItemView","onClose","otherProps","resultGroups","setVisibleMenuRef","listRef","closeAllMenu","key","current","Object","prototype","hasOwnProperty","call","addEventListener","passive","removeEventListener","elementZIndex","style","zIndex","length","map","group","groupIndex","groupLabel","item","itemIndex","value","NotificationsList"],"sources":["../../../../../src/components/NotificationsList/NotificationsList.tsx"],"sourcesContent":["import './NotificationsList.css';\n\nimport { Button } from '@consta/uikit/Button';\nimport { IconClose } from '@consta/uikit/IconClose';\nimport { Text } from '@consta/uikit/Text';\nimport React, {\n forwardRef,\n Fragment,\n useCallback,\n useEffect,\n useRef,\n} from 'react';\n\nimport { NotificationCard } from '##/components/NotificationCard';\nimport { NotificationsActions } from '##/components/NotificationsActions';\nimport { cn } from '##/utils/bem';\n\nimport {\n defaultGroupLabelFormat,\n getGroups,\n withDefaultGetters,\n} from './helpers';\nimport { NotificationsListComponent, NotificationsListProps } from './types';\n\nexport const cnNotificationsList = cn('NotificationsList');\n\nfunction NotificationsListRender(\n props: NotificationsListProps,\n ref: React.Ref<HTMLDivElement>,\n) {\n const {\n className,\n items,\n groupByDay = false,\n groups,\n groupLabelFormat = defaultGroupLabelFormat,\n itemDateFormat,\n title,\n actions,\n getItemLabel,\n getActionIcon,\n getActionLabel,\n getActionOnClick,\n getGroupId,\n getGroupLabel,\n getItemActions,\n getItemBadges,\n getItemDate,\n getItemDescription,\n getItemGroup,\n getItemImage,\n getItemRead,\n getItemView,\n onClose,\n ...otherProps\n } = withDefaultGetters(props);\n\n const resultGroups = getGroups(\n items,\n groups,\n groupByDay,\n getItemGroup,\n getItemDate,\n getGroupId,\n );\n\n const setVisibleMenuRef = useRef<Record<string, Function>>({});\n const listRef = useRef<HTMLDivElement>(null);\n\n const closeAllMenu = useCallback(() => {\n for (const key in setVisibleMenuRef.current) {\n if (\n Object.prototype.hasOwnProperty.call(setVisibleMenuRef.current, key)\n ) {\n setVisibleMenuRef.current[key](false);\n }\n }\n }, []);\n\n useEffect(() => {\n listRef.current?.addEventListener('scroll', closeAllMenu, {\n passive: true,\n });\n\n return () => listRef.current?.removeEventListener('scroll', closeAllMenu);\n }, [listRef.current]);\n\n const elementZIndex =\n typeof props.style?.zIndex === 'number'\n ? props.style.zIndex + 1\n : undefined;\n\n return (\n <div\n {...otherProps}\n ref={ref}\n className={cnNotificationsList(null, [className])}\n >\n {(title || actions) && (\n <div className={cnNotificationsList('Header')}>\n <Text\n className={cnNotificationsList('HeaderItem')}\n size=\"xl\"\n truncate\n >\n {title}\n </Text>\n {actions?.length && (\n <NotificationsActions\n className={cnNotificationsList('HeaderItem')}\n items={actions}\n getItemIcon={getActionIcon}\n getItemOnClick={getActionOnClick}\n getItemLabel={getActionLabel}\n style={{ zIndex: elementZIndex }}\n />\n )}\n {onClose && (\n <Button\n className={cnNotificationsList('HeaderItem')}\n size=\"s\"\n view=\"clear\"\n iconLeft={IconClose}\n onClick={onClose}\n />\n )}\n </div>\n )}\n <div ref={listRef} className={cnNotificationsList('List')}>\n {resultGroups.map((group, groupIndex) => {\n const groupLabel = groupByDay\n ? groupLabelFormat(Number(group.key))\n : group.group && getGroupLabel(group.group);\n return (\n <Fragment key={cnNotificationsList('Group', { groupIndex })}>\n {groupLabel && (\n <Text\n className={cnNotificationsList('GroupLabel')}\n key={cnNotificationsList('GroupLabel', { groupIndex })}\n view=\"secondary\"\n transform=\"uppercase\"\n weight=\"bold\"\n size=\"2xs\"\n >\n {groupLabel}\n </Text>\n )}\n {group.items.map((item, itemIndex) => {\n return (\n <NotificationCard\n className={cnNotificationsList('Item')}\n key={cnNotificationsList('Item', { groupIndex, itemIndex })}\n title={getItemLabel(item)}\n description={getItemDescription(item)}\n imageUrl={getItemImage(item)}\n read={getItemRead(item)}\n date={getItemDate(item)}\n dateFormat={itemDateFormat}\n badges={getItemBadges(item)}\n actions={getItemActions(item)}\n view={getItemView(item)}\n setVisibleMenu={(value) => {\n setVisibleMenuRef.current[`${groupIndex}-${itemIndex}`] =\n value;\n }}\n style={{ zIndex: elementZIndex }}\n />\n );\n })}\n </Fragment>\n );\n })}\n </div>\n </div>\n );\n}\n\nexport const NotificationsList = forwardRef(\n NotificationsListRender,\n) as NotificationsListComponent;\n\nexport * from './types';\n"],"mappings":"+aAAA,gCAEA,OAASA,MAAM,KAAQ,sBAAsB,CAC7C,OAASC,SAAS,KAAQ,yBAAyB,CACnD,OAASC,IAAI,KAAQ,oBAAoB,CACzC,MAAOC,MAAK,EACVC,UA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B,WAAW,CAAE5B,CAAkB,CAAC4B,CAAI,CAAE,CACtC,QAAQ,CAAE1B,CAAY,CAAC0B,CAAI,CAAE,CAC7B,IAAI,CAAEzB,CAAW,CAACyB,CAAI,CAAE,CACxB,IAAI,CAAE7B,CAAW,CAAC6B,CAAI,CAAE,CACxB,UAAU,CAAExC,CAAe,CAC3B,MAAM,CAAEU,CAAa,CAAC8B,CAAI,CAAE,CAC5B,OAAO,CAAE/B,CAAc,CAAC+B,CAAI,CAAE,CAC9B,IAAI,CAAExB,CAAW,CAACwB,CAAI,CAAE,CACxB,cAAc,CAAGE,CAAK,EAAK,CACzBtB,CAAiB,CAACI,OAAO,CAAE,GAAEc,CAAW,IAAGG,CAAU,EAAC,CAAC,CACrDC,CACJ,CAAE,CACF,KAAK,CAAE,CAAER,MAAM,CAAEF,CAAc,CAAE,EAGtC,CAAC,CAGR,CAAC,CAAC,CACE,CAGZ,CAEA,MAAO,MAAMW,kBAAiB,CAAG/D,UAAU,CACzCY,uBAAuB,CACM,CAE/B"}
|
|
@@ -40,7 +40,7 @@ export declare function withDefaultGetters<ITEM, GROUP, ACTION>(props: Notificat
|
|
|
40
40
|
label: string;
|
|
41
41
|
} ? {} : {
|
|
42
42
|
getItemLabel: NotificationsListPropGetItemLabel<ITEM>;
|
|
43
|
-
}) & Omit<import("react").HTMLAttributes<HTMLDivElement>, "css" | "title" | "children" | "items" | "getItemLabel" | "onClose" | "
|
|
43
|
+
}) & Omit<import("react").HTMLAttributes<HTMLDivElement>, "css" | "title" | "children" | "items" | "getItemLabel" | "onClose" | "getItemDescription" | "getItemImage" | "groups" | "getGroupLabel" | "getGroupId" | "getItemGroup" | "actions" | "itemDateFormat" | "getItemRead" | "getItemDate" | "getItemBadges" | "getItemActions" | "getItemView" | "getActionLabel" | "getActionIcon" | "getActionOnClick" | "groupByDay" | "groupLabelFormat" | keyof (ACTION extends {
|
|
44
44
|
label: string;
|
|
45
45
|
} ? {} : {
|
|
46
46
|
getActionLabel: NotificationsListPropGetItemActions<ACTION>;
|
|
@@ -74,7 +74,7 @@ export declare function withDefaultGetters<ITEM, GROUP, ACTION>(props: Notificat
|
|
|
74
74
|
ref?: import("react").Ref<HTMLDivElement> | undefined;
|
|
75
75
|
key?: import("react").Key | null | undefined;
|
|
76
76
|
};
|
|
77
|
-
|
|
77
|
+
type ReturnedGroup<ITEM, GROUP> = {
|
|
78
78
|
items: ITEM[];
|
|
79
79
|
key: string | number;
|
|
80
80
|
group?: GROUP;
|
|
@@ -1 +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,
|
|
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,gBAAe,KAAQ,gDAAgD,CAC7F,OAASC,MAAM,CAAEC,OAAO,CAAEC,WAAW,CAAEC,UAAU,KAAQ,UAAU,CAAC,KAwB9DC,qBAEL,CAAIC,CAAM,EAAKA,CAAM,CAACC,IAAI,CACrBC,qBAEL,CAAIF,CAAM,EAAKA,CAAM,CAACG,KAAK,CACtBC,uBAEL,CAAIJ,CAAM,EAAKA,CA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ikit/Icon';
|
|
4
4
|
import { PropsWithHTMLAttributesAndRef } from "../../utils/types/PropsWithHTMLAttributes";
|
|
5
|
-
export
|
|
5
|
+
export type NotificationsDefaultAction = {
|
|
6
6
|
label: string;
|
|
7
7
|
onClick?: React.EventHandler<React.MouseEvent>;
|
|
8
8
|
icon?: React.FC<IconProps>;
|
|
9
9
|
};
|
|
10
|
-
export
|
|
10
|
+
export type Badge = {
|
|
11
11
|
label: string;
|
|
12
12
|
status?: BadgePropStatus;
|
|
13
13
|
};
|
|
14
|
-
export
|
|
14
|
+
export type NotificationsDefaultGroup = {
|
|
15
15
|
label: string;
|
|
16
16
|
id: string;
|
|
17
17
|
};
|
|
18
|
-
export
|
|
18
|
+
export type NotificationsDefaultItem = {
|
|
19
19
|
label: string;
|
|
20
20
|
description?: string;
|
|
21
21
|
image?: string;
|
|
@@ -27,23 +27,23 @@ export declare type NotificationsDefaultItem = {
|
|
|
27
27
|
group?: string;
|
|
28
28
|
view?: 'default' | 'user';
|
|
29
29
|
};
|
|
30
|
-
export
|
|
31
|
-
export
|
|
32
|
-
export
|
|
33
|
-
export
|
|
34
|
-
export
|
|
35
|
-
export
|
|
36
|
-
export
|
|
37
|
-
export
|
|
38
|
-
export
|
|
39
|
-
export
|
|
40
|
-
export
|
|
41
|
-
export
|
|
42
|
-
export
|
|
43
|
-
export
|
|
44
|
-
export
|
|
45
|
-
export
|
|
46
|
-
export
|
|
30
|
+
export type NotificationsListPropGetItemLabel<ITEM> = (item: ITEM) => string;
|
|
31
|
+
export type NotificationsListPropGetItemDescription<ITEM> = (item: ITEM) => string | undefined;
|
|
32
|
+
export type NotificationsListPropGetItemImage<ITEM> = (item: ITEM) => string | undefined;
|
|
33
|
+
export type NotificationsListPropGetItemRead<ITEM> = (item: ITEM) => boolean | undefined;
|
|
34
|
+
export type NotificationsListPropGetItemDate<ITEM> = (item: ITEM) => Date | undefined;
|
|
35
|
+
export type NotificationsListPropGetItemBadges<ITEM> = (item: ITEM) => Badge[] | undefined;
|
|
36
|
+
export type NotificationsListPropGetItemActions<ITEM> = (item: ITEM) => NotificationsDefaultAction[] | undefined;
|
|
37
|
+
export type NotificationsListPropGetItemGroup<ITEM> = (item: ITEM) => string | undefined;
|
|
38
|
+
export type NotificationsListPropGetItemView<ITEM> = (item: ITEM) => 'default' | 'user' | undefined;
|
|
39
|
+
export type NotificationsListPropItemDateFormat = (date: Date) => string;
|
|
40
|
+
export type NotificationsListPropGetActionLabel<ACTION> = (action: ACTION) => string;
|
|
41
|
+
export type NotificationsListPropGetActionIcon<ACTION> = (action: ACTION) => React.FC<IconProps> | undefined;
|
|
42
|
+
export type NotificationsListPropGetActionOnClick<ACTION> = (action: ACTION) => React.EventHandler<React.MouseEvent> | undefined;
|
|
43
|
+
export type NotificationsListPropGetGroupLabel<GROUP> = (group: GROUP) => string;
|
|
44
|
+
export type NotificationsListPropGetGroupId<GROUP> = (group: GROUP) => string | number;
|
|
45
|
+
export type NotificationsListPropGroupLabelFormat<GROUP_BY_DAY> = GROUP_BY_DAY extends true ? (timestamp: number) => string : never;
|
|
46
|
+
export type Props<ITEM, GROUP, ACTION, GROUP_BY_DAY extends boolean> = {
|
|
47
47
|
children?: never;
|
|
48
48
|
items: ITEM[];
|
|
49
49
|
itemDateFormat?: NotificationsListPropItemDateFormat;
|
|
@@ -84,5 +84,5 @@ export declare type Props<ITEM, GROUP, ACTION, GROUP_BY_DAY extends boolean> = {
|
|
|
84
84
|
} ? {} : {
|
|
85
85
|
getItemLabel: NotificationsListPropGetItemLabel<ITEM>;
|
|
86
86
|
});
|
|
87
|
-
export
|
|
88
|
-
export
|
|
87
|
+
export type NotificationsListProps<ITEM = NotificationsDefaultItem, GROUP = NotificationsDefaultGroup, ACTION = NotificationsDefaultAction, GROUP_BY_DAY extends boolean = false> = PropsWithHTMLAttributesAndRef<Props<ITEM, GROUP, ACTION, GROUP_BY_DAY>, HTMLDivElement>;
|
|
88
|
+
export type NotificationsListComponent = <ITEM = NotificationsDefaultItem, GROUP = NotificationsDefaultGroup, ACTION = NotificationsDefaultAction, GROUP_BY_DAY extends boolean = false>(props: NotificationsListProps<ITEM, GROUP, ACTION, GROUP_BY_DAY>) => React.ReactElement | null;
|
|
@@ -1 +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,
|
|
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,WAAW,KAAQ,2BAA2B,CACvD,OAASC,UAAU,KAAQ,0BAA0B,CACrD,OAASC,IAAI,KAAQ,oBAAoB,CACzC,OAASC,OAAO,KAAQ,uBAAuB,CAC/C,OAASC,UAAU,KAAQ,0BAA0B,CACrD,OAASC,aAAa,KAAQ,6BAA6B,CAC3D,MAAOC,MAAK,EAAIC,UAAU,CAAEC,WAAW,CAAEC,MAAM,KAAQ,OAAO,CAE9D,OAASC,YAAY,kCACrB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AAE,CACLkB,MAAM,CACqB,QAAQ,EAAjC,cAAOjB,CAAK,WAALA,CAAK,QAALA,CAAK,CAAEiB,MAAM,CAAa,CAAGjB,CAAK,CAACiB,MAAM,CAAG,CAAC,CAAG,MAC3D,CAAE,EAEL,CAGP,CAAC,CAED,MAAO,MAAMC,WAAU,CAAGvC,UAAU,CAACO,gBAAgB,CAAwB,CAE7E"}
|
|
@@ -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>, "css" | "items" | "getItemLabel" | "label" | "
|
|
30
|
+
} & Omit<import("react").HTMLAttributes<HTMLDivElement>, "css" | "items" | "getItemLabel" | "label" | "getItemOnClick" | "onItemClick" | "getItemHref" | "getItemTarget" | "getItemSubMenu"> & import("react").RefAttributes<HTMLDivElement> & (ITEM extends {
|
|
31
31
|
label: string;
|
|
32
32
|
} ? {} : {
|
|
33
33
|
getItemLabel: SelectMenuPropGetItemLabel<ITEM>;
|
|
@@ -1 +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,
|
|
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,CAAI,EAAKA,CAAI,CAACC,KAAK,CACxB,MAAO,MAAMC,mBAEZ,CAAIF,CAAI,EAAKA,CAAI,CAACG,IAAI,CACvB,MAAO,MAAMC,sBAEZ,CAAIJ,CAAI,EAAKA,CAAI,CAACK,OAAO,CAC1B,MAAO,MAAMC,qBAEZ,CAAIN,CAAI,EAAKA,CAAI,CAACO,MAAM,CACzB,MAAO,MAAMC,sBAEZ,CAAIR,CAAI,EAAKA,CAAI,CAACS,OAAO,CAE1B,MAAO,MAAMC,WAAU,CAAUC,CAMhC,GACQ,CACLC,YAAY,CAAED,CAAK,CAACC,YAAY,EAAIb,mBAAmB,CACvDc,WAAW,CAAEF,CAAK,CAACE,WAAW,EAAIX,kBAAkB,CACpDY,cAAc,CAAEH,CAAK,CAACG,cAAc,EAAIV,qBAAqB,CAC7DW,aAAa,CAAEJ,CAAK,CAACI,aAAa,EAAIT,oBAAoB,CAC1DU,cAAc,CAAEL,CAAK,CAACK,cAAc,EAAIR,qBAC1C,CAAC,CACF,CAED,MAAO,SAASS,mBAAkB,CAAON,CAA4B,CAAE,CACrE,sCACKA,CAAK,EACLD,UAAU,CAACC,CAAK,CAAC,CAExB"}
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { PropsWithHTMLAttributesAndRef } from "../../utils/types/PropsWithHTMLAttributes";
|
|
3
|
-
export
|
|
3
|
+
export type SelectMenuDefaultItem = {
|
|
4
4
|
label: string;
|
|
5
5
|
href?: string;
|
|
6
6
|
target?: string;
|
|
7
7
|
onClick?: React.EventHandler<React.MouseEvent>;
|
|
8
8
|
subMenu?: SelectMenuDefaultItem[];
|
|
9
9
|
};
|
|
10
|
-
export
|
|
11
|
-
export
|
|
12
|
-
export
|
|
13
|
-
export
|
|
14
|
-
export
|
|
10
|
+
export type SelectMenuPropGetItemLabel<ITEM> = (item: ITEM) => string;
|
|
11
|
+
export type SelectMenuPropGetItemHref<ITEM> = (item: ITEM) => string | undefined;
|
|
12
|
+
export type SelectMenuPropGetItemTarget<ITEM> = (item: ITEM) => string | undefined;
|
|
13
|
+
export type SelectMenuPropGetItemOnClick<ITEM> = (item: ITEM) => React.EventHandler<React.MouseEvent> | undefined;
|
|
14
|
+
export type SelectMenuPropOnItemClick<ITEM> = (props: {
|
|
15
15
|
e: React.MouseEvent;
|
|
16
16
|
item: ITEM;
|
|
17
17
|
}) => void;
|
|
18
|
-
export
|
|
19
|
-
export
|
|
18
|
+
export type SelectMenuPropGetItemSubMenu<ITEM> = (item: ITEM) => ITEM[] | undefined;
|
|
19
|
+
export type SelectMenuProps<ITEM = SelectMenuDefaultItem> = PropsWithHTMLAttributesAndRef<{
|
|
20
20
|
items: ITEM[];
|
|
21
21
|
onItemClick?: SelectMenuPropOnItemClick<ITEM>;
|
|
22
22
|
getItemHref?: SelectMenuPropGetItemHref<ITEM>;
|
|
@@ -30,4 +30,4 @@ export declare type SelectMenuProps<ITEM = SelectMenuDefaultItem> = PropsWithHTM
|
|
|
30
30
|
} ? {} : {
|
|
31
31
|
getItemLabel: SelectMenuPropGetItemLabel<ITEM>;
|
|
32
32
|
});
|
|
33
|
-
export
|
|
33
|
+
export type SelectMenuComponent = <ITEM = SelectMenuDefaultItem>(props: SelectMenuProps<ITEM>) => React.ReactElement | null;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import './Sidebar.css';
|
|
2
2
|
import { Sidebar as ConstaSidebar } from '@consta/uikit/Sidebar';
|
|
3
3
|
import React from 'react';
|
|
4
|
-
|
|
4
|
+
type SidebarProps = Omit<React.ComponentProps<typeof ConstaSidebar>, 'position' | 'onClose'> & {
|
|
5
5
|
title?: string;
|
|
6
6
|
onClose?: React.EventHandler<React.MouseEvent>;
|
|
7
7
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Sidebar.js","names":["Button","IconClose","Sidebar","ConstaSidebar","Text","useBreakpoints","React","cn","cnSidebar","props","children","title","onClose","className","otherProps","bigScreen"],"sources":["../../../../../src/components/Sidebar/Sidebar.tsx"],"sourcesContent":["import './Sidebar.css';\n\nimport { Button } from '@consta/uikit/Button';\nimport { IconClose } from '@consta/uikit/IconClose';\nimport { Sidebar as ConstaSidebar } from '@consta/uikit/Sidebar';\nimport { Text } from '@consta/uikit/Text';\nimport { useBreakpoints } from '@consta/uikit/useBreakpoints';\nimport React from 'react';\n\nimport { cn } from '##/utils/bem';\n\ntype SidebarProps = Omit<\n React.ComponentProps<typeof ConstaSidebar>,\n 'position' | 'onClose'\n> & {\n title?: string;\n onClose?: React.EventHandler<React.MouseEvent>;\n};\n\nconst cnSidebar = cn('Sidebar');\n\nexport const Sidebar = (props: SidebarProps) => {\n const { children, title, onClose, className, ...otherProps } = props;\n const { bigScreen } = useBreakpoints({ bigScreen: 520 });\n return (\n <ConstaSidebar\n {...otherProps}\n position={bigScreen ? 'right' : 'bottom'}\n size={bigScreen ? 'l' : 'full'}\n className={cnSidebar(null, [className])}\n >\n {(title || onClose) && (\n <div className={cnSidebar('Header')}>\n <Text className={cnSidebar('Title')} size=\"xl\" truncate>\n {title}\n </Text>\n {onClose && (\n <Button\n size=\"s\"\n view=\"clear\"\n iconLeft={IconClose}\n onClick={onClose}\n />\n )}\n </div>\n )}\n\n {children}\n </ConstaSidebar>\n );\n};\n"],"mappings":"gJAAA,sBAEA,OAASA,
|
|
1
|
+
{"version":3,"file":"Sidebar.js","names":["Button","IconClose","Sidebar","ConstaSidebar","Text","useBreakpoints","React","cn","cnSidebar","props","children","title","onClose","className","otherProps","bigScreen"],"sources":["../../../../../src/components/Sidebar/Sidebar.tsx"],"sourcesContent":["import './Sidebar.css';\n\nimport { Button } from '@consta/uikit/Button';\nimport { IconClose } from '@consta/uikit/IconClose';\nimport { Sidebar as ConstaSidebar } from '@consta/uikit/Sidebar';\nimport { Text } from '@consta/uikit/Text';\nimport { useBreakpoints } from '@consta/uikit/useBreakpoints';\nimport React from 'react';\n\nimport { cn } from '##/utils/bem';\n\ntype SidebarProps = Omit<\n React.ComponentProps<typeof ConstaSidebar>,\n 'position' | 'onClose'\n> & {\n title?: string;\n onClose?: React.EventHandler<React.MouseEvent>;\n};\n\nconst cnSidebar = cn('Sidebar');\n\nexport const Sidebar = (props: SidebarProps) => {\n const { children, title, onClose, className, ...otherProps } = props;\n const { bigScreen } = useBreakpoints({ bigScreen: 520 });\n return (\n <ConstaSidebar\n {...otherProps}\n position={bigScreen ? 'right' : 'bottom'}\n size={bigScreen ? 'l' : 'full'}\n className={cnSidebar(null, [className])}\n >\n {(title || onClose) && (\n <div className={cnSidebar('Header')}>\n <Text className={cnSidebar('Title')} size=\"xl\" truncate>\n {title}\n </Text>\n {onClose && (\n <Button\n size=\"s\"\n view=\"clear\"\n iconLeft={IconClose}\n onClick={onClose}\n />\n )}\n </div>\n )}\n\n {children}\n </ConstaSidebar>\n );\n};\n"],"mappings":"gJAAA,sBAEA,OAASA,MAAM,KAAQ,sBAAsB,CAC7C,OAASC,SAAS,KAAQ,yBAAyB,CACnD,OAASC,OAAO,GAAIC,cAAa,KAAQ,uBAAuB,CAChE,OAASC,IAAI,KAAQ,oBAAoB,CACzC,OAASC,cAAc,KAAQ,8BAA8B,CAC7D,MAAOC,MAAK,KAAM,OAAO,CAEzB,OAASC,EAAE,uBAUX,KAAMC,UAAS,CAAGD,EAAE,CAAC,SAAS,CAAC,CAE/B,MAAO,MAAML,QAAO,CAAIO,CAAmB,EAAK,MACxC,CAAEC,QAAQ,CAARA,CAAQ,CAAEC,KAAK,CAALA,CAAK,CAAEC,OAAO,CAAPA,CAAO,CAAEC,SAAS,CAATA,CAAyB,CAAC,CAAGJ,CAAK,CAApBK,CAAU,0BAAKL,CAAK,YAC9D,CAAEM,SAAS,CAATA,CAAU,CAAC,CAAGV,cAAc,CAAC,CAAEU,SAAS,CAAE,GAAI,CAAC,CAAC,CACxD,MACE,qBAAC,aAAa,kBACRD,CAAU,EACd,QAAQ,CAAEC,CAAS,CAAG,OAAO,CAAG,QAAS,CACzC,IAAI,CAAEA,CAAS,CAAG,GAAG,CAAG,MAAO,CAC/B,SAAS,CAAEP,SAAS,CAAC,IAAI,CAAE,CAACK,CAAS,CAAC,CAAE,GAEvC,CAACF,CAAK,EAAIC,CAAO,GAChB,2BAAK,SAAS,CAAEJ,SAAS,CAAC,QAAQ,CAAE,EAClC,oBAAC,IAAI,EAAC,SAAS,CAAEA,SAAS,CAAC,OAAO,CAAE,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,KACpDG,CAAK,CACD,CACNC,CAAO,EACN,oBAAC,MAAM,EACL,IAAI,CAAC,GAAG,CACR,IAAI,CAAC,OAAO,CACZ,QAAQ,CAAEX,SAAU,CACpB,OAAO,CAAEW,CAAQ,EAEpB,CAEJ,CAEAF,CAAQ,CAGf,CAAC"}
|
|
@@ -1 +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,
|
|
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,MAAM,KAAQ,sBAAsB,CAC7C,OAASC,SAAS,KAAQ,yBAAyB,CACnD,OACEC,cAAc,CACdC,mBAAmB,KACd,iCAAiC,CACxC,OAASC,iBAAiB,KAAQ,+BAA+B,CACjE,OAAoBC,OAAO,KAAQ,uBAAuB,CAC1D,OAASC,OAAO,KAAQ,uBAAuB,CAC/C,OAASC,UAAU,KAAQ,0BAA0B,CACrD,MAAOC,MAAK,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,CAAC,CAAEkC,SAAS,CAATA,CAAU,CAAC,CAAE,EAAG,CACpD,2BAAK,SAAS,CAAErB,UAAU,CAAC,aAAa,CAAE,EACxC,oBAAC,YAAY,CAAK0B,CAAS,CAAI,CAC3B,CAET,CAEJ,CAGP,CAEA,MAAO,MAAMK,SAAQ,CAAGvC,UAAU,CAACW,cAAc,CAAsB,CAEvE"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import './TileMenuItem.css';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
export declare const tileMenuItemPropView: readonly ["card", "line"];
|
|
4
|
-
export
|
|
5
|
-
|
|
4
|
+
export type TileMenuItemPropView = typeof tileMenuItemPropView[number];
|
|
5
|
+
type TileMenuItemProps = {
|
|
6
6
|
image?: string | React.FC;
|
|
7
7
|
title: string;
|
|
8
8
|
description?: string;
|
|
@@ -1 +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,
|
|
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,gBAAgB,KAAQ,kEAAkE,CACnG,OAASC,UAAU,KAAQ,wBAAwB,CACnD,OAASC,IAAI,KAAQ,oBAAoB,CACzC,MAAOC,MAAK,KAAM,OAAO,CAEzB,OAASC,EAAE,0BAEX,MAAO,MAAMC,qBAAoB,CAAG,CAAC,MAAM,CAAE,MAAM,CAAU,CAAC,KAUxDC,eAAc,CAAGF,EAAE,CAAC,cAAc,CAAC,CAEnCG,WAAW,CAAG,CAACC,CAAwB,CAAEC,CAAa,GAAK,CAC/D,GAAqB,QAAQ,EAAzB,MAAOD,EAAkB,CAC3B,MAAO,4BAAK,GAAG,CAAEA,CAAM,CAAC,GAAG,CAAEC,CAAM,EA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