@consta/header 3.0.1 → 3.0.2
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/__internal__/src/components/ButtonMenu/helpers.d.ts +10 -11
- package/__internal__/src/components/ButtonMenu/types.d.ts +2 -3
- package/__internal__/src/components/ButtonMenu/types.js.map +1 -1
- package/__internal__/src/components/Layout/Layout.d.ts +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/types.d.ts +1 -1
- package/__internal__/src/components/Layout/types.js.map +1 -1
- package/__internal__/src/components/MegaMenu/MegaMenu.d.ts +1 -1
- package/__internal__/src/components/MegaMenu/MegaMenuBannerBar/helpers.d.ts +103 -97
- package/__internal__/src/components/MegaMenu/MegaMenuBannerBar/types.d.ts +3 -3
- package/__internal__/src/components/MegaMenu/MegaMenuBannerBar/types.js.map +1 -1
- package/__internal__/src/components/MegaMenu/MegaMenuBox/MegaMenuBox.d.ts +1 -1
- package/__internal__/src/components/MegaMenu/MegaMenuBox/MegaMenuBox.js.map +1 -1
- package/__internal__/src/components/MegaMenu/MegaMenuBox/types.d.ts +1 -2
- package/__internal__/src/components/MegaMenu/MegaMenuBox/types.js.map +1 -1
- package/__internal__/src/components/MegaMenu/MegaMenuGlobal/helper.d.ts +106 -100
- package/__internal__/src/components/MegaMenu/MegaMenuGlobal/types.d.ts +4 -4
- package/__internal__/src/components/MegaMenu/MegaMenuGlobal/types.js.map +1 -1
- package/__internal__/src/components/MegaMenu/MegaMenuNavBar/helper.d.ts +14 -5
- package/__internal__/src/components/MegaMenu/MegaMenuNavBar/types.d.ts +3 -3
- package/__internal__/src/components/MegaMenu/MegaMenuNavBar/types.js.map +1 -1
- package/__internal__/src/components/MegaMenu/helper.d.ts +108 -102
- package/__internal__/src/components/MegaMenu/types.d.ts +2 -2
- package/__internal__/src/components/MegaMenu/types.js.map +1 -1
- package/__internal__/src/components/Menu/helpers.d.ts +8 -9
- package/__internal__/src/components/Menu/types.d.ts +2 -3
- package/__internal__/src/components/Menu/types.js.map +1 -1
- package/__internal__/src/components/MobileMenu/types.d.ts +3 -3
- package/__internal__/src/components/MobileMenu/types.js.map +1 -1
- package/__internal__/src/components/Navbar/NavbarArrow/NavbarArrow.d.ts +1 -1
- package/__internal__/src/components/Navbar/NavbarRail/NavbarRail.js +1 -1
- package/__internal__/src/components/Navbar/NavbarRail/NavbarRail.js.map +1 -1
- package/__internal__/src/components/Navbar/NavbarRailItem/NavbarRailItem.d.ts +1 -1
- package/__internal__/src/components/Navbar/helpers.d.ts +8 -9
- package/__internal__/src/components/Navbar/types.d.ts +3 -3
- package/__internal__/src/components/Navbar/types.js.map +1 -1
- package/__internal__/src/components/Notifications/NotificationsActions/helpers.d.ts +4 -5
- package/__internal__/src/components/Notifications/NotificationsActions/types.d.ts +2 -3
- package/__internal__/src/components/Notifications/NotificationsActions/types.js.map +1 -1
- package/__internal__/src/components/Notifications/NotificationsItem/NotificationsItem.d.ts +1 -1
- package/__internal__/src/components/Notifications/NotificationsItem/types.d.ts +1 -1
- package/__internal__/src/components/Notifications/NotificationsItem/types.js.map +1 -1
- package/__internal__/src/components/Notifications/NotificationsItemFooter/types.d.ts +1 -1
- package/__internal__/src/components/Notifications/NotificationsItemFooter/types.js.map +1 -1
- package/__internal__/src/components/Notifications/NotificationsList/helpers.d.ts +3 -60
- package/__internal__/src/components/Notifications/NotificationsList/types.d.ts +2 -3
- package/__internal__/src/components/Notifications/NotificationsList/types.js.map +1 -1
- package/__internal__/src/components/Notifications/types.d.ts +2 -3
- package/__internal__/src/components/Notifications/types.js.map +1 -1
- package/__internal__/src/components/PopoverButton/PopoverButton.d.ts +1 -1
- package/__internal__/src/components/SelectMenu/helpers.d.ts +6 -7
- package/__internal__/src/components/SelectMenu/types.d.ts +2 -3
- package/__internal__/src/components/SelectMenu/types.js.map +1 -1
- package/__internal__/src/components/Sidebar/Sidebar.d.ts +1 -1
- package/__internal__/src/components/TileMenu/TileMenuItem/types.d.ts +0 -1
- package/__internal__/src/components/TileMenu/TileMenuList/helpers.d.ts +1 -2
- package/__internal__/src/components/TileMenu/TileMenuList/types.d.ts +2 -3
- package/__internal__/src/components/TileMenu/TileMenuList/types.js.map +1 -1
- package/__internal__/src/components/TileMenu/types.d.ts +2 -3
- package/__internal__/src/components/TileMenu/types.js.map +1 -1
- package/__internal__/src/components/VerticalMenu/helpers.d.ts +3 -4
- package/__internal__/src/components/VerticalMenu/types.d.ts +4 -4
- package/__internal__/src/components/VerticalMenu/types.js.map +1 -1
- package/__internal__/src/helpers/getItemClick.d.ts +1 -2
- package/package.json +6 -3
- package/__internal__/src/utils/types/PropsWithHTMLAttributes.d.ts +0 -3
- package/__internal__/src/utils/types/PropsWithHTMLAttributes.js +0 -2
- package/__internal__/src/utils/types/PropsWithHTMLAttributes.js.map +0 -1
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { ButtonMenuDefaultItem, ButtonMenuPropGetItemHref, ButtonMenuPropGetItemIcon, ButtonMenuPropGetItemLabel, ButtonMenuPropGetItemOnClick, ButtonMenuPropGetItemTarget, ButtonMenuProps } from './types';
|
|
3
2
|
export declare const defaultGetItemLabel: ButtonMenuPropGetItemLabel<ButtonMenuDefaultItem>;
|
|
4
3
|
export declare const defaultGetItemHref: ButtonMenuPropGetItemHref<ButtonMenuDefaultItem>;
|
|
@@ -6,11 +5,11 @@ export declare const defaultGetItemOnClick: ButtonMenuPropGetItemOnClick<ButtonM
|
|
|
6
5
|
export declare const defaultGetItemTarget: ButtonMenuPropGetItemTarget<ButtonMenuDefaultItem>;
|
|
7
6
|
export declare const defaultGetItemIcon: ButtonMenuPropGetItemIcon<ButtonMenuDefaultItem>;
|
|
8
7
|
export declare const getGetters: <ITEM>(props: {
|
|
9
|
-
getItemLabel?: ButtonMenuPropGetItemLabel<ITEM
|
|
10
|
-
getItemHref?: ButtonMenuPropGetItemHref<ITEM
|
|
11
|
-
getItemOnClick?: ButtonMenuPropGetItemOnClick<ITEM
|
|
12
|
-
getItemTarget?: ButtonMenuPropGetItemTarget<ITEM
|
|
13
|
-
getItemIcon?: ButtonMenuPropGetItemIcon<ITEM
|
|
8
|
+
getItemLabel?: ButtonMenuPropGetItemLabel<ITEM>;
|
|
9
|
+
getItemHref?: ButtonMenuPropGetItemHref<ITEM>;
|
|
10
|
+
getItemOnClick?: ButtonMenuPropGetItemOnClick<ITEM>;
|
|
11
|
+
getItemTarget?: ButtonMenuPropGetItemTarget<ITEM>;
|
|
12
|
+
getItemIcon?: ButtonMenuPropGetItemIcon<ITEM>;
|
|
14
13
|
}) => {
|
|
15
14
|
getItemLabel: ButtonMenuPropGetItemLabel<ButtonMenuDefaultItem> | ButtonMenuPropGetItemLabel<ITEM>;
|
|
16
15
|
getItemHref: ButtonMenuPropGetItemHref<ButtonMenuDefaultItem> | ButtonMenuPropGetItemHref<ITEM>;
|
|
@@ -26,12 +25,12 @@ export declare function withDefaultGetters<ITEM>(props: ButtonMenuProps<ITEM>):
|
|
|
26
25
|
getItemTarget?: ButtonMenuPropGetItemTarget<ITEM> | undefined;
|
|
27
26
|
getItemOnClick?: ButtonMenuPropGetItemOnClick<ITEM> | undefined;
|
|
28
27
|
getItemIcon?: ButtonMenuPropGetItemIcon<ITEM> | undefined;
|
|
29
|
-
form?: "
|
|
30
|
-
size?: "
|
|
31
|
-
view?: "
|
|
32
|
-
onlyIcon?: boolean
|
|
28
|
+
form?: import("@consta/uikit/Button").ButtonPropForm;
|
|
29
|
+
size?: import("@consta/uikit/Button").ButtonPropSize;
|
|
30
|
+
view?: import("@consta/uikit/Button").ButtonPropView;
|
|
31
|
+
onlyIcon?: boolean;
|
|
33
32
|
} & Omit<import("react").HTMLAttributes<HTMLDivElement>, "css" | "items" | "onItemClick" | "getItemHref" | "getItemLabel" | "getItemTarget" | "getItemOnClick" | "getItemIcon" | "form" | "size" | "view" | "onlyIcon"> & import("react").RefAttributes<HTMLDivElement> & (ITEM extends {
|
|
34
|
-
label:
|
|
33
|
+
label: ButtonMenuDefaultItem["label"];
|
|
35
34
|
} ? {} : {
|
|
36
35
|
getItemLabel: ButtonMenuPropGetItemLabel<ITEM>;
|
|
37
36
|
}) & {
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { IconComponent } from '@consta/icons/Icon';
|
|
2
|
+
import { PropsWithHTMLAttributesAndRef } from '@consta/uikit/__internal__/src/utils/types/PropsWithHTMLAttributes';
|
|
3
3
|
import { ButtonPropForm, ButtonPropSize, ButtonPropView } from '@consta/uikit/Button';
|
|
4
|
-
import { PropsWithHTMLAttributesAndRef } from "../../utils/types/PropsWithHTMLAttributes";
|
|
5
4
|
export type ButtonMenuDefaultItem = {
|
|
6
5
|
label: string;
|
|
7
6
|
href?: string;
|
|
@@ -34,4 +33,4 @@ export type ButtonMenuProps<ITEM = ButtonMenuDefaultItem> = PropsWithHTMLAttribu
|
|
|
34
33
|
} ? {} : {
|
|
35
34
|
getItemLabel: ButtonMenuPropGetItemLabel<ITEM>;
|
|
36
35
|
});
|
|
37
|
-
export type ButtonMenuComponent = <ITEM = ButtonMenuDefaultItem>(props: ButtonMenuProps<ITEM>) => React.
|
|
36
|
+
export type ButtonMenuComponent = <ITEM = ButtonMenuDefaultItem>(props: ButtonMenuProps<ITEM>) => React.ReactNode;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","names":[],"sources":["../../../../../src/components/ButtonMenu/types.ts"],"sourcesContent":["import { IconComponent } from '@consta/icons/Icon';\nimport {\n ButtonPropForm,\n ButtonPropSize,\n ButtonPropView,\n} from '@consta/uikit/Button';\n\
|
|
1
|
+
{"version":3,"file":"types.js","names":[],"sources":["../../../../../src/components/ButtonMenu/types.ts"],"sourcesContent":["import { IconComponent } from '@consta/icons/Icon';\nimport { PropsWithHTMLAttributesAndRef } from '@consta/uikit/__internal__/src/utils/types/PropsWithHTMLAttributes';\nimport {\n ButtonPropForm,\n ButtonPropSize,\n ButtonPropView,\n} from '@consta/uikit/Button';\n\nexport type ButtonMenuDefaultItem = {\n label: string;\n href?: string;\n target?: string;\n icon?: IconComponent;\n onClick?: React.EventHandler<React.MouseEvent>;\n};\n\nexport type ButtonMenuPropGetItemLabel<ITEM> = (item: ITEM) => string;\nexport type ButtonMenuPropGetItemHref<ITEM> = (\n item: ITEM,\n) => string | undefined;\nexport type ButtonMenuPropGetItemTarget<ITEM> = (\n item: ITEM,\n) => string | undefined;\nexport type ButtonMenuPropGetItemIcon<ITEM> = (\n item: ITEM,\n) => IconComponent | undefined;\nexport type ButtonMenuPropGetItemOnClick<ITEM> = (\n item: ITEM,\n) => React.EventHandler<React.MouseEvent> | undefined;\nexport type ButtonMenuPropOnItemClick<ITEM> = (\n item: ITEM,\n props: {\n e: React.MouseEvent;\n },\n) => void;\n\nexport type ButtonMenuProps<ITEM = ButtonMenuDefaultItem> =\n PropsWithHTMLAttributesAndRef<\n {\n items: ITEM[];\n onItemClick?: ButtonMenuPropOnItemClick<ITEM>;\n getItemHref?: ButtonMenuPropGetItemHref<ITEM>;\n getItemLabel?: ButtonMenuPropGetItemLabel<ITEM>;\n getItemTarget?: ButtonMenuPropGetItemTarget<ITEM>;\n getItemOnClick?: ButtonMenuPropGetItemOnClick<ITEM>;\n getItemIcon?: ButtonMenuPropGetItemIcon<ITEM>;\n form?: ButtonPropForm;\n size?: ButtonPropSize;\n view?: ButtonPropView;\n onlyIcon?: boolean;\n },\n HTMLDivElement\n > &\n (ITEM extends { label: ButtonMenuDefaultItem['label'] }\n ? {}\n : { getItemLabel: ButtonMenuPropGetItemLabel<ITEM> });\n\nexport type ButtonMenuComponent = <ITEM = ButtonMenuDefaultItem>(\n props: ButtonMenuProps<ITEM>,\n) => React.ReactNode;\n"],"mappings":""}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import './Layout.css';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { LayoutProps } from './types';
|
|
4
|
-
export declare const Layout: React.ForwardRefExoticComponent<
|
|
4
|
+
export declare const Layout: React.ForwardRefExoticComponent<Omit<LayoutProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
5
5
|
export * from './types';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import './LayoutRow.css';
|
|
2
|
+
import { PropsWithHTMLAttributes } from '@consta/uikit/__internal__/src/utils/types/PropsWithHTMLAttributes';
|
|
2
3
|
import React from 'react';
|
|
3
|
-
import { PropsWithHTMLAttributes } from "../../../utils/types/PropsWithHTMLAttributes";
|
|
4
4
|
import { LayoutRow as LayoutRowType, LayoutSlotHeight } from '../types';
|
|
5
5
|
type LayoutRowProps = PropsWithHTMLAttributes<{
|
|
6
6
|
content?: React.ReactNode | LayoutRowType;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LayoutRow.js","names":["cnMixSpace","React","cn","LayoutRowIsObject","cnLayoutRow","LayoutRow","props","className","content","height","left","center","right","createElement","pH","position"],"sources":["../../../../../../src/components/Layout/LayoutRow/LayoutRow.tsx"],"sourcesContent":["import './LayoutRow.css';\n\nimport { cnMixSpace } from '@consta/uikit/MixSpace';\nimport React from 'react';\n\nimport { cn } from '##/utils/bem';\
|
|
1
|
+
{"version":3,"file":"LayoutRow.js","names":["cnMixSpace","React","cn","LayoutRowIsObject","cnLayoutRow","LayoutRow","props","className","content","height","left","center","right","createElement","pH","position"],"sources":["../../../../../../src/components/Layout/LayoutRow/LayoutRow.tsx"],"sourcesContent":["import './LayoutRow.css';\n\nimport { PropsWithHTMLAttributes } from '@consta/uikit/__internal__/src/utils/types/PropsWithHTMLAttributes';\nimport { cnMixSpace } from '@consta/uikit/MixSpace';\nimport React from 'react';\n\nimport { cn } from '##/utils/bem';\n\nimport { LayoutRowIsObject } from '../helpers';\nimport { LayoutRow as LayoutRowType, LayoutSlotHeight } from '../types';\n\nconst cnLayoutRow = cn('LayoutRow');\n\ntype LayoutRowProps = PropsWithHTMLAttributes<\n {\n content?: React.ReactNode | LayoutRowType;\n children?: never;\n height?: LayoutSlotHeight;\n },\n HTMLDivElement\n>;\n\nexport const LayoutRow: React.FC<LayoutRowProps> = (props) => {\n const { className, content, height = 'm' } = props;\n if (!content) {\n return null;\n }\n if (LayoutRowIsObject(content)) {\n const { left, center, right } = content;\n return (\n <div\n className={cnLayoutRow({ height }, [\n className,\n cnMixSpace({ pH: 'xl' }),\n ])}\n >\n {left && (\n <div className={cnLayoutRow('Side', { position: 'left' })}>\n {left}\n </div>\n )}\n {center && (\n <div className={cnLayoutRow('Side', { position: 'center' })}>\n {center}\n </div>\n )}\n {right && (\n <div className={cnLayoutRow('Side', { position: 'right' })}>\n {right}\n </div>\n )}\n </div>\n );\n }\n return (\n <div className={cnLayoutRow({ height }, [className])}>\n <div className={cnLayoutRow('Side', { position: 'left' })}>{content}</div>\n </div>\n );\n};\n"],"mappings":"AAAA,wBAGA,OAASA,UAAU,KAAQ,wBAAwB,CACnD,MAAO,CAAAC,KAAK,KAAM,OAAO,CAEzB,OAASC,EAAE,0BAEX,OAASC,iBAAiB,kBAG1B,KAAM,CAAAC,WAAW,CAAGF,EAAE,CAAC,WAAW,CAAC,CAWnC,MAAO,MAAM,CAAAG,SAAmC,CAAIC,CAAK,EAAK,CAC5D,KAAM,CAAEC,SAAS,CAATA,CAAS,CAAEC,OAAO,CAAPA,CAAO,CAAEC,MAAM,CAANA,CAAM,CAAG,GAAI,CAAC,CAAGH,CAAK,CAClD,GAAI,CAACE,CAAO,CACV,MAAO,KAAI,CAEb,GAAIL,iBAAiB,CAACK,CAAO,CAAC,CAAE,CAC9B,KAAM,CAAEE,IAAI,CAAJA,CAAI,CAAEC,MAAM,CAANA,CAAM,CAAEC,KAAK,CAALA,CAAM,CAAC,CAAGJ,CAAO,CACvC,MACE,CAAAP,KAAA,CAAAY,aAAA,QACEN,SAAS,CAAEH,WAAW,CAAC,CAAEK,MAAM,CAANA,CAAO,CAAC,CAAE,CACjCF,CAAS,CACTP,UAAU,CAAC,CAAEc,EAAE,CAAE,IAAK,CAAC,CAAC,CACzB,CAAE,EAEFJ,CAAI,EACHT,KAAA,CAAAY,aAAA,QAAKN,SAAS,CAAEH,WAAW,CAAC,MAAM,CAAE,CAAEW,QAAQ,CAAE,MAAO,CAAC,CAAE,EACvDL,CACE,CACN,CACAC,CAAM,EACLV,KAAA,CAAAY,aAAA,QAAKN,SAAS,CAAEH,WAAW,CAAC,MAAM,CAAE,CAAEW,QAAQ,CAAE,QAAS,CAAC,CAAE,EACzDJ,CACE,CACN,CACAC,CAAK,EACJX,KAAA,CAAAY,aAAA,QAAKN,SAAS,CAAEH,WAAW,CAAC,MAAM,CAAE,CAAEW,QAAQ,CAAE,OAAQ,CAAC,CAAE,EACxDH,CACE,CAEJ,CAET,CACA,MACE,CAAAX,KAAA,CAAAY,aAAA,QAAKN,SAAS,CAAEH,WAAW,CAAC,CAAEK,MAAM,CAANA,CAAO,CAAC,CAAE,CAACF,CAAS,CAAC,CAAE,EACnDN,KAAA,CAAAY,aAAA,QAAKN,SAAS,CAAEH,WAAW,CAAC,MAAM,CAAE,CAAEW,QAAQ,CAAE,MAAO,CAAC,CAAE,EAAEP,CAAa,CACtE,CAET,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import { PropsWithHTMLAttributesAndRef } from '@consta/uikit/__internal__/src/utils/types/PropsWithHTMLAttributes';
|
|
1
2
|
import React from 'react';
|
|
2
|
-
import { PropsWithHTMLAttributesAndRef } from "../../utils/types/PropsWithHTMLAttributes";
|
|
3
3
|
export type LayoutSlotHeight = 'm' | 's';
|
|
4
4
|
export type LayoutRow = {
|
|
5
5
|
left: React.ReactNode;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","names":[],"sources":["../../../../../src/components/Layout/types.ts"],"sourcesContent":["import
|
|
1
|
+
{"version":3,"file":"types.js","names":[],"sources":["../../../../../src/components/Layout/types.ts"],"sourcesContent":["import { PropsWithHTMLAttributesAndRef } from '@consta/uikit/__internal__/src/utils/types/PropsWithHTMLAttributes';\nimport React from 'react';\n\nexport type LayoutSlotHeight = 'm' | 's';\n\nexport type LayoutRow = {\n left: React.ReactNode;\n right: React.ReactNode;\n center: React.ReactNode;\n height?: LayoutSlotHeight;\n};\n\nexport type LayoutProps = PropsWithHTMLAttributesAndRef<\n {\n rowCenter?: React.ReactNode | LayoutRow;\n rowTop?: React.ReactNode | Omit<LayoutRow, 'height'>;\n rowBottom?: React.ReactNode | Omit<LayoutRow, 'height'>;\n },\n HTMLDivElement\n>;\n"],"mappings":""}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { MegaMenuBannerBarDefaultItem, MegaMenuBannerBarPropGetItemAs, MegaMenuBannerBarPropGetItemAttributes, MegaMenuBannerBarPropGetItemDescription, MegaMenuBannerBarPropGetItemImage, MegaMenuBannerBarPropGetItemLabel, MegaMenuBannerBarPropGetItemOnClick, MegaMenuBannerBarProps } from './types';
|
|
3
2
|
export declare const withDefaultGetters: <ITEM>(props: MegaMenuBannerBarProps<ITEM>) => {
|
|
4
3
|
getItemLabel: MegaMenuBannerBarPropGetItemLabel<MegaMenuBannerBarDefaultItem> | MegaMenuBannerBarPropGetItemLabel<ITEM>;
|
|
@@ -9,104 +8,115 @@ export declare const withDefaultGetters: <ITEM>(props: MegaMenuBannerBarProps<IT
|
|
|
9
8
|
getItemAttributes: MegaMenuBannerBarPropGetItemAttributes<MegaMenuBannerBarDefaultItem> | MegaMenuBannerBarPropGetItemAttributes<ITEM>;
|
|
10
9
|
items: ITEM[];
|
|
11
10
|
onItemClick?: import("./types").MegaMenuBannerBarPropOnItemClick<ITEM> | undefined;
|
|
12
|
-
view?: import("./types").MegaMenuBannerBarPropView
|
|
13
|
-
defaultChecked?: boolean | undefined;
|
|
11
|
+
view?: import("./types").MegaMenuBannerBarPropView;
|
|
12
|
+
defaultChecked?: boolean | undefined | undefined;
|
|
14
13
|
defaultValue?: string | number | readonly string[] | undefined;
|
|
15
|
-
suppressContentEditableWarning?: boolean | undefined;
|
|
16
|
-
suppressHydrationWarning?: boolean | undefined;
|
|
17
|
-
accessKey?: string | undefined;
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
14
|
+
suppressContentEditableWarning?: boolean | undefined | undefined;
|
|
15
|
+
suppressHydrationWarning?: boolean | undefined | undefined;
|
|
16
|
+
accessKey?: string | undefined | undefined;
|
|
17
|
+
autoCapitalize?: "off" | "none" | "on" | "sentences" | "words" | "characters" | undefined | (string & {}) | undefined;
|
|
18
|
+
autoFocus?: boolean | undefined | undefined;
|
|
19
|
+
className?: string | undefined | undefined;
|
|
20
|
+
contentEditable?: (boolean | "true" | "false") | "inherit" | "plaintext-only" | undefined;
|
|
21
|
+
contextMenu?: string | undefined | undefined;
|
|
22
|
+
dir?: string | undefined | undefined;
|
|
22
23
|
draggable?: (boolean | "true" | "false") | undefined;
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
slot?: string | undefined;
|
|
24
|
+
enterKeyHint?: "enter" | "done" | "go" | "next" | "previous" | "search" | "send" | undefined | undefined;
|
|
25
|
+
hidden?: boolean | undefined | undefined;
|
|
26
|
+
id?: string | undefined | undefined;
|
|
27
|
+
lang?: string | undefined | undefined;
|
|
28
|
+
nonce?: string | undefined | undefined;
|
|
29
|
+
slot?: string | undefined | undefined;
|
|
29
30
|
spellCheck?: (boolean | "true" | "false") | undefined;
|
|
30
31
|
style?: import("react").CSSProperties | undefined;
|
|
31
|
-
tabIndex?: number | undefined;
|
|
32
|
-
title?: string | undefined;
|
|
33
|
-
translate?: "yes" | "no" | undefined;
|
|
34
|
-
radioGroup?: string | undefined;
|
|
32
|
+
tabIndex?: number | undefined | undefined;
|
|
33
|
+
title?: string | undefined | undefined;
|
|
34
|
+
translate?: "yes" | "no" | undefined | undefined;
|
|
35
|
+
radioGroup?: string | undefined | undefined;
|
|
35
36
|
role?: import("react").AriaRole | undefined;
|
|
36
|
-
about?: string | undefined;
|
|
37
|
-
|
|
37
|
+
about?: string | undefined | undefined;
|
|
38
|
+
content?: string | undefined | undefined;
|
|
39
|
+
datatype?: string | undefined | undefined;
|
|
38
40
|
inlist?: any;
|
|
39
|
-
prefix?: string | undefined;
|
|
40
|
-
property?: string | undefined;
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
41
|
+
prefix?: string | undefined | undefined;
|
|
42
|
+
property?: string | undefined | undefined;
|
|
43
|
+
rel?: string | undefined | undefined;
|
|
44
|
+
resource?: string | undefined | undefined;
|
|
45
|
+
rev?: string | undefined | undefined;
|
|
46
|
+
typeof?: string | undefined | undefined;
|
|
47
|
+
vocab?: string | undefined | undefined;
|
|
48
|
+
autoCorrect?: string | undefined | undefined;
|
|
49
|
+
autoSave?: string | undefined | undefined;
|
|
50
|
+
color?: string | undefined | undefined;
|
|
51
|
+
itemProp?: string | undefined | undefined;
|
|
52
|
+
itemScope?: boolean | undefined | undefined;
|
|
53
|
+
itemType?: string | undefined | undefined;
|
|
54
|
+
itemID?: string | undefined | undefined;
|
|
55
|
+
itemRef?: string | undefined | undefined;
|
|
56
|
+
results?: number | undefined | undefined;
|
|
57
|
+
security?: string | undefined | undefined;
|
|
58
|
+
unselectable?: "on" | "off" | undefined | undefined;
|
|
59
|
+
inputMode?: "none" | "text" | "tel" | "url" | "email" | "numeric" | "decimal" | "search" | undefined | undefined;
|
|
60
|
+
is?: string | undefined | undefined;
|
|
61
|
+
exportparts?: string | undefined | undefined;
|
|
62
|
+
part?: string | undefined | undefined;
|
|
63
|
+
"aria-activedescendant"?: string | undefined | undefined;
|
|
64
|
+
"aria-atomic"?: (boolean | "true" | "false") | undefined;
|
|
65
|
+
"aria-autocomplete"?: "none" | "inline" | "list" | "both" | undefined | undefined;
|
|
66
|
+
"aria-braillelabel"?: string | undefined | undefined;
|
|
67
|
+
"aria-brailleroledescription"?: string | undefined | undefined;
|
|
68
|
+
"aria-busy"?: (boolean | "true" | "false") | undefined;
|
|
69
|
+
"aria-checked"?: boolean | "false" | "mixed" | "true" | undefined | undefined;
|
|
70
|
+
"aria-colcount"?: number | undefined | undefined;
|
|
71
|
+
"aria-colindex"?: number | undefined | undefined;
|
|
72
|
+
"aria-colindextext"?: string | undefined | undefined;
|
|
73
|
+
"aria-colspan"?: number | undefined | undefined;
|
|
74
|
+
"aria-controls"?: string | undefined | undefined;
|
|
75
|
+
"aria-current"?: boolean | "false" | "true" | "page" | "step" | "location" | "date" | "time" | undefined | undefined;
|
|
76
|
+
"aria-describedby"?: string | undefined | undefined;
|
|
77
|
+
"aria-description"?: string | undefined | undefined;
|
|
78
|
+
"aria-details"?: string | undefined | undefined;
|
|
79
|
+
"aria-disabled"?: (boolean | "true" | "false") | undefined;
|
|
80
|
+
"aria-dropeffect"?: "none" | "copy" | "execute" | "link" | "move" | "popup" | undefined | undefined;
|
|
81
|
+
"aria-errormessage"?: string | undefined | undefined;
|
|
82
|
+
"aria-expanded"?: (boolean | "true" | "false") | undefined;
|
|
83
|
+
"aria-flowto"?: string | undefined | undefined;
|
|
84
|
+
"aria-grabbed"?: (boolean | "true" | "false") | undefined;
|
|
85
|
+
"aria-haspopup"?: boolean | "false" | "true" | "menu" | "listbox" | "tree" | "grid" | "dialog" | undefined | undefined;
|
|
86
|
+
"aria-hidden"?: (boolean | "true" | "false") | undefined;
|
|
87
|
+
"aria-invalid"?: boolean | "false" | "true" | "grammar" | "spelling" | undefined | undefined;
|
|
88
|
+
"aria-keyshortcuts"?: string | undefined | undefined;
|
|
89
|
+
"aria-label"?: string | undefined | undefined;
|
|
90
|
+
"aria-labelledby"?: string | undefined | undefined;
|
|
91
|
+
"aria-level"?: number | undefined | undefined;
|
|
92
|
+
"aria-live"?: "off" | "assertive" | "polite" | undefined | undefined;
|
|
93
|
+
"aria-modal"?: (boolean | "true" | "false") | undefined;
|
|
94
|
+
"aria-multiline"?: (boolean | "true" | "false") | undefined;
|
|
95
|
+
"aria-multiselectable"?: (boolean | "true" | "false") | undefined;
|
|
96
|
+
"aria-orientation"?: "horizontal" | "vertical" | undefined | undefined;
|
|
97
|
+
"aria-owns"?: string | undefined | undefined;
|
|
98
|
+
"aria-placeholder"?: string | undefined | undefined;
|
|
99
|
+
"aria-posinset"?: number | undefined | undefined;
|
|
100
|
+
"aria-pressed"?: boolean | "false" | "mixed" | "true" | undefined | undefined;
|
|
101
|
+
"aria-readonly"?: (boolean | "true" | "false") | undefined;
|
|
102
|
+
"aria-relevant"?: "additions" | "additions removals" | "additions text" | "all" | "removals" | "removals additions" | "removals text" | "text" | "text additions" | "text removals" | undefined | undefined;
|
|
103
|
+
"aria-required"?: (boolean | "true" | "false") | undefined;
|
|
104
|
+
"aria-roledescription"?: string | undefined | undefined;
|
|
105
|
+
"aria-rowcount"?: number | undefined | undefined;
|
|
106
|
+
"aria-rowindex"?: number | undefined | undefined;
|
|
107
|
+
"aria-rowindextext"?: string | undefined | undefined;
|
|
108
|
+
"aria-rowspan"?: number | undefined | undefined;
|
|
109
|
+
"aria-selected"?: (boolean | "true" | "false") | undefined;
|
|
110
|
+
"aria-setsize"?: number | undefined | undefined;
|
|
111
|
+
"aria-sort"?: "none" | "ascending" | "descending" | "other" | undefined | undefined;
|
|
112
|
+
"aria-valuemax"?: number | undefined | undefined;
|
|
113
|
+
"aria-valuemin"?: number | undefined | undefined;
|
|
114
|
+
"aria-valuenow"?: number | undefined | undefined;
|
|
115
|
+
"aria-valuetext"?: string | undefined | undefined;
|
|
106
116
|
children?: import("react").ReactNode;
|
|
107
117
|
dangerouslySetInnerHTML?: {
|
|
108
|
-
__html: string;
|
|
109
|
-
} | undefined;
|
|
118
|
+
__html: string | TrustedHTML;
|
|
119
|
+
} | undefined | undefined;
|
|
110
120
|
onCopy?: import("react").ClipboardEventHandler<HTMLDivElement> | undefined;
|
|
111
121
|
onCopyCapture?: import("react").ClipboardEventHandler<HTMLDivElement> | undefined;
|
|
112
122
|
onCut?: import("react").ClipboardEventHandler<HTMLDivElement> | undefined;
|
|
@@ -125,7 +135,7 @@ export declare const withDefaultGetters: <ITEM>(props: MegaMenuBannerBarProps<IT
|
|
|
125
135
|
onBlurCapture?: import("react").FocusEventHandler<HTMLDivElement> | undefined;
|
|
126
136
|
onChange?: import("react").FormEventHandler<HTMLDivElement> | undefined;
|
|
127
137
|
onChangeCapture?: import("react").FormEventHandler<HTMLDivElement> | undefined;
|
|
128
|
-
onBeforeInput?: import("react").
|
|
138
|
+
onBeforeInput?: import("react").InputEventHandler<HTMLDivElement> | undefined;
|
|
129
139
|
onBeforeInputCapture?: import("react").FormEventHandler<HTMLDivElement> | undefined;
|
|
130
140
|
onInput?: import("react").FormEventHandler<HTMLDivElement> | undefined;
|
|
131
141
|
onInputCapture?: import("react").FormEventHandler<HTMLDivElement> | undefined;
|
|
@@ -175,8 +185,6 @@ export declare const withDefaultGetters: <ITEM>(props: MegaMenuBannerBarProps<IT
|
|
|
175
185
|
onProgressCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
176
186
|
onRateChange?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
177
187
|
onRateChangeCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
178
|
-
onResize?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
179
|
-
onResizeCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
180
188
|
onSeeked?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
181
189
|
onSeekedCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
182
190
|
onSeeking?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
@@ -246,9 +254,7 @@ export declare const withDefaultGetters: <ITEM>(props: MegaMenuBannerBarProps<IT
|
|
|
246
254
|
onPointerCancel?: import("react").PointerEventHandler<HTMLDivElement> | undefined;
|
|
247
255
|
onPointerCancelCapture?: import("react").PointerEventHandler<HTMLDivElement> | undefined;
|
|
248
256
|
onPointerEnter?: import("react").PointerEventHandler<HTMLDivElement> | undefined;
|
|
249
|
-
onPointerEnterCapture?: import("react").PointerEventHandler<HTMLDivElement> | undefined;
|
|
250
257
|
onPointerLeave?: import("react").PointerEventHandler<HTMLDivElement> | undefined;
|
|
251
|
-
onPointerLeaveCapture?: import("react").PointerEventHandler<HTMLDivElement> | undefined;
|
|
252
258
|
onPointerOver?: import("react").PointerEventHandler<HTMLDivElement> | undefined;
|
|
253
259
|
onPointerOverCapture?: import("react").PointerEventHandler<HTMLDivElement> | undefined;
|
|
254
260
|
onPointerOut?: import("react").PointerEventHandler<HTMLDivElement> | undefined;
|
|
@@ -269,6 +275,6 @@ export declare const withDefaultGetters: <ITEM>(props: MegaMenuBannerBarProps<IT
|
|
|
269
275
|
onAnimationIterationCapture?: import("react").AnimationEventHandler<HTMLDivElement> | undefined;
|
|
270
276
|
onTransitionEnd?: import("react").TransitionEventHandler<HTMLDivElement> | undefined;
|
|
271
277
|
onTransitionEndCapture?: import("react").TransitionEventHandler<HTMLDivElement> | undefined;
|
|
272
|
-
ref?: import("react").
|
|
278
|
+
ref?: import("react").LegacyRef<HTMLDivElement> | undefined;
|
|
273
279
|
key?: import("react").Key | null | undefined;
|
|
274
280
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { AsAttributes, AsTags } from '@consta/uikit/__internal__/src/utils/types/AsTags';
|
|
2
2
|
import { PropsWithAsAttributes } from '@consta/uikit/__internal__/src/utils/types/PropsWithAsAttributes';
|
|
3
|
+
import { PropsWithHTMLAttributesAndRef } from '@consta/uikit/__internal__/src/utils/types/PropsWithHTMLAttributes';
|
|
3
4
|
import React from 'react';
|
|
4
|
-
import { PropsWithHTMLAttributesAndRef } from "../../../utils/types/PropsWithHTMLAttributes";
|
|
5
5
|
export type MegaMenuBannerBarDefaultItem = {
|
|
6
6
|
onClick?: React.MouseEventHandler;
|
|
7
7
|
label: string;
|
|
@@ -31,7 +31,7 @@ export type MegaMenuBannerBarProps<ITEM = MegaMenuBannerBarDefaultItem> = PropsW
|
|
|
31
31
|
onItemClick?: MegaMenuBannerBarPropOnItemClick<ITEM>;
|
|
32
32
|
view?: MegaMenuBannerBarPropView;
|
|
33
33
|
}, HTMLDivElement>;
|
|
34
|
-
export type MegaMenuBannerBarComponent = <ITEM = MegaMenuBannerBarDefaultItem>(props: MegaMenuBannerBarProps<ITEM>, ref: React.Ref<HTMLDivElement>) => React.
|
|
34
|
+
export type MegaMenuBannerBarComponent = <ITEM = MegaMenuBannerBarDefaultItem>(props: MegaMenuBannerBarProps<ITEM>, ref: React.Ref<HTMLDivElement>) => React.ReactNode;
|
|
35
35
|
export type MegaMenuBannerBarItemProps<AS extends AsTags = 'div'> = PropsWithAsAttributes<{
|
|
36
36
|
label: string;
|
|
37
37
|
description?: string;
|
|
@@ -39,4 +39,4 @@ export type MegaMenuBannerBarItemProps<AS extends AsTags = 'div'> = PropsWithAsA
|
|
|
39
39
|
onClick?: React.MouseEventHandler;
|
|
40
40
|
view?: MegaMenuBannerBarPropView;
|
|
41
41
|
}, AS>;
|
|
42
|
-
export type MegaMenuBannerBarItemComponent = <AS extends AsTags = 'div'>(props: MegaMenuBannerBarItemProps<AS>, ref: React.Ref<HTMLElement>) => React.
|
|
42
|
+
export type MegaMenuBannerBarItemComponent = <AS extends AsTags = 'div'>(props: MegaMenuBannerBarItemProps<AS>, ref: React.Ref<HTMLElement>) => React.ReactNode;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","names":[],"sources":["../../../../../../src/components/MegaMenu/MegaMenuBannerBar/types.ts"],"sourcesContent":["import {\n AsAttributes,\n AsTags,\n} from '@consta/uikit/__internal__/src/utils/types/AsTags';\nimport { PropsWithAsAttributes } from '@consta/uikit/__internal__/src/utils/types/PropsWithAsAttributes';\nimport
|
|
1
|
+
{"version":3,"file":"types.js","names":[],"sources":["../../../../../../src/components/MegaMenu/MegaMenuBannerBar/types.ts"],"sourcesContent":["import {\n AsAttributes,\n AsTags,\n} from '@consta/uikit/__internal__/src/utils/types/AsTags';\nimport { PropsWithAsAttributes } from '@consta/uikit/__internal__/src/utils/types/PropsWithAsAttributes';\nimport { PropsWithHTMLAttributesAndRef } from '@consta/uikit/__internal__/src/utils/types/PropsWithHTMLAttributes';\nimport React from 'react';\n\nexport type MegaMenuBannerBarDefaultItem = {\n onClick?: React.MouseEventHandler;\n label: string;\n description?: string;\n image?: string;\n as?: AsTags;\n attributes?: AsAttributes;\n};\n\nexport type MegaMenuBannerBarPropView = 'vertical' | 'horizontal';\n\nexport type MegaMenuBannerBarPropGetItemLabel<ITEM> = (item: ITEM) => string;\nexport type MegaMenuBannerBarPropGetItemDescription<ITEM> = (\n item: ITEM,\n) => string | undefined;\nexport type MegaMenuBannerBarPropGetItemImage<ITEM> = (\n item: ITEM,\n) => string | undefined;\nexport type MegaMenuBannerBarPropGetItemOnClick<ITEM> = (\n item: ITEM,\n) => React.MouseEventHandler | undefined;\nexport type MegaMenuBannerBarPropGetItemAs<ITEM> = (\n item: ITEM,\n) => AsTags | undefined;\nexport type MegaMenuBannerBarPropGetItemAttributes<ITEM> = (\n item: ITEM,\n) => AsAttributes | undefined;\n\nexport type MegaMenuBannerBarPropOnItemClick<ITEM> = (\n item: ITEM,\n props: {\n e: React.MouseEvent;\n },\n) => void;\n\nexport type MegaMenuBannerBarProps<ITEM = MegaMenuBannerBarDefaultItem> =\n PropsWithHTMLAttributesAndRef<\n {\n items: ITEM[];\n getItemLabel?: MegaMenuBannerBarPropGetItemLabel<ITEM>;\n getItemDescription?: MegaMenuBannerBarPropGetItemDescription<ITEM>;\n getItemImage?: MegaMenuBannerBarPropGetItemImage<ITEM>;\n getItemOnClick?: MegaMenuBannerBarPropGetItemOnClick<ITEM>;\n getItemAs?: MegaMenuBannerBarPropGetItemAs<ITEM>;\n getItemAttributes?: MegaMenuBannerBarPropGetItemAttributes<ITEM>;\n onItemClick?: MegaMenuBannerBarPropOnItemClick<ITEM>;\n view?: MegaMenuBannerBarPropView;\n },\n HTMLDivElement\n >;\n\nexport type MegaMenuBannerBarComponent = <ITEM = MegaMenuBannerBarDefaultItem>(\n props: MegaMenuBannerBarProps<ITEM>,\n ref: React.Ref<HTMLDivElement>,\n) => React.ReactNode;\n\nexport type MegaMenuBannerBarItemProps<AS extends AsTags = 'div'> =\n PropsWithAsAttributes<\n {\n label: string;\n description?: string;\n image?: string;\n onClick?: React.MouseEventHandler;\n view?: MegaMenuBannerBarPropView;\n },\n AS\n >;\n\nexport type MegaMenuBannerBarItemComponent = <AS extends AsTags = 'div'>(\n props: MegaMenuBannerBarItemProps<AS>,\n ref: React.Ref<HTMLElement>,\n) => React.ReactNode;\n"],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MegaMenuBox.js","names":["PortalWithTheme","usePortalContext","useTheme","useClickOutside","React","useMemo","useRef","Transition","cn","cnMegaMenuBox","ContextConsumer","onClickOutside","children","ignoreClicksInsideRefs","refs","isActive","handler","MegaMenuBox","props","isOpen","onEsc","offset","offsetProp","style","anchorRef","className","maxContentWidth","otherProps","_objectWithoutProperties","_excluded","containerRef","menuRef","theme","a","b","c","d","current","offsetTop","offsetHeight","createElement","in","unmountOnExit","timeout","nodeRef","animate","Object","assign","preset","_objectSpread","\"--mega-menu-offset\"","ref","\"--mega-menu-content-width\""],"sources":["../../../../../../src/components/MegaMenu/MegaMenuBox/MegaMenuBox.tsx"],"sourcesContent":["import './MegaMenuBox.css';\n\nimport {\n PortalWithTheme,\n usePortalContext,\n} from '@consta/uikit/PortalWithTheme';\nimport { useTheme } from '@consta/uikit/Theme';\nimport { useClickOutside } from '@consta/uikit/useClickOutside';\nimport React, { useMemo, useRef } from 'react';\nimport { Transition } from 'react-transition-group';\n\nimport { cn } from '##/utils/bem';\n\nimport { MegaMenuBoxProps } from './types';\n\nconst cnMegaMenuBox = cn('MegaMenuBox');\n\nconst ContextConsumer: React.FC<{\n onClickOutside?: (event: MouseEvent) => void;\n ignoreClicksInsideRefs?: ReadonlyArray<React.RefObject<HTMLElement>>;\n children: React.ReactNode;\n}> = ({ onClickOutside, children, ignoreClicksInsideRefs }) => {\n const { refs } = usePortalContext();\n\n useClickOutside({\n isActive: !!onClickOutside,\n ignoreClicksInsideRefs: [\n ...(ignoreClicksInsideRefs || []),\n ...(refs || []),\n ],\n handler: onClickOutside,\n });\n\n return children
|
|
1
|
+
{"version":3,"file":"MegaMenuBox.js","names":["PortalWithTheme","usePortalContext","useTheme","useClickOutside","React","useMemo","useRef","Transition","cn","cnMegaMenuBox","ContextConsumer","onClickOutside","children","ignoreClicksInsideRefs","refs","isActive","handler","MegaMenuBox","props","isOpen","onEsc","offset","offsetProp","style","anchorRef","className","maxContentWidth","otherProps","_objectWithoutProperties","_excluded","containerRef","menuRef","theme","a","b","c","d","current","offsetTop","offsetHeight","createElement","in","unmountOnExit","timeout","nodeRef","animate","Object","assign","preset","_objectSpread","\"--mega-menu-offset\"","ref","\"--mega-menu-content-width\""],"sources":["../../../../../../src/components/MegaMenu/MegaMenuBox/MegaMenuBox.tsx"],"sourcesContent":["import './MegaMenuBox.css';\n\nimport {\n PortalWithTheme,\n usePortalContext,\n} from '@consta/uikit/PortalWithTheme';\nimport { useTheme } from '@consta/uikit/Theme';\nimport { useClickOutside } from '@consta/uikit/useClickOutside';\nimport React, { useMemo, useRef } from 'react';\nimport { Transition } from 'react-transition-group';\n\nimport { cn } from '##/utils/bem';\n\nimport { MegaMenuBoxProps } from './types';\n\nconst cnMegaMenuBox = cn('MegaMenuBox');\n\nconst ContextConsumer: React.FC<{\n onClickOutside?: (event: MouseEvent) => void;\n ignoreClicksInsideRefs?: ReadonlyArray<React.RefObject<HTMLElement>>;\n children: React.ReactNode;\n}> = ({ onClickOutside, children, ignoreClicksInsideRefs }) => {\n const { refs } = usePortalContext();\n\n useClickOutside({\n isActive: !!onClickOutside,\n ignoreClicksInsideRefs: [\n ...(ignoreClicksInsideRefs || []),\n ...(refs || []),\n ],\n handler: onClickOutside,\n });\n\n return children;\n};\n\nexport const MegaMenuBox = (props: MegaMenuBoxProps) => {\n const {\n isOpen,\n onClickOutside,\n onEsc,\n offset: offsetProp = 0,\n style,\n anchorRef,\n className,\n children,\n maxContentWidth,\n ...otherProps\n } = props;\n\n const containerRef = useRef<HTMLDivElement>(null);\n const menuRef = useRef<HTMLDivElement>(null);\n\n const { theme } = useTheme();\n\n const offset = useMemo(() => {\n return (\n (anchorRef?.current?.offsetTop ?? 0) +\n (anchorRef?.current?.offsetHeight ?? 0) +\n offsetProp\n );\n }, [offsetProp, anchorRef?.current]);\n\n return (\n <Transition in={isOpen} unmountOnExit timeout={240} nodeRef={containerRef}>\n {(animate) => (\n <PortalWithTheme\n preset={theme}\n style={{\n ['--mega-menu-offset' as string]: `${offset}px`,\n ...style,\n }}\n className={cnMegaMenuBox(null, [className])}\n ref={containerRef}\n {...otherProps}\n >\n <div className={cnMegaMenuBox('Overlay', { animate })} />\n <ContextConsumer\n onClickOutside={onClickOutside}\n ignoreClicksInsideRefs={[menuRef]}\n >\n <div ref={menuRef} className={cnMegaMenuBox('Window', { animate })}>\n <div\n className={cnMegaMenuBox('Wrapper')}\n style={{\n ['--mega-menu-content-width' as string]: maxContentWidth\n ? `${maxContentWidth}px`\n : '100%',\n }}\n >\n {children}\n </div>\n </div>\n </ContextConsumer>\n </PortalWithTheme>\n )}\n </Transition>\n );\n};\n"],"mappings":"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"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
import { PropsWithHTMLAttributesAndRef } from "../../../utils/types/PropsWithHTMLAttributes";
|
|
1
|
+
import { PropsWithHTMLAttributesAndRef } from '@consta/uikit/__internal__/src/utils/types/PropsWithHTMLAttributes';
|
|
3
2
|
export type MegaMenuBoxProps = PropsWithHTMLAttributesAndRef<{
|
|
4
3
|
offset?: number;
|
|
5
4
|
isOpen?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","names":[],"sources":["../../../../../../src/components/MegaMenu/MegaMenuBox/types.ts"],"sourcesContent":["import { PropsWithHTMLAttributesAndRef } from '
|
|
1
|
+
{"version":3,"file":"types.js","names":[],"sources":["../../../../../../src/components/MegaMenu/MegaMenuBox/types.ts"],"sourcesContent":["import { PropsWithHTMLAttributesAndRef } from '@consta/uikit/__internal__/src/utils/types/PropsWithHTMLAttributes';\n\nexport type MegaMenuBoxProps = PropsWithHTMLAttributesAndRef<\n {\n offset?: number;\n isOpen?: boolean;\n onClickOutside?: (event: MouseEvent) => void;\n onEsc?: (event: KeyboardEvent) => void;\n anchorRef?: React.RefObject<HTMLElement>;\n maxContentWidth?: number;\n },\n HTMLDivElement\n>;\n"],"mappings":""}
|