@consta/header 3.0.1 → 3.1.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/__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/Menu.js +1 -1
- package/__internal__/src/components/Menu/Menu.js.map +1 -1
- package/__internal__/src/components/Menu/helpers.d.ts +10 -10
- package/__internal__/src/components/Menu/types.d.ts +3 -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/Navbar.d.ts +1 -0
- package/__internal__/src/components/Navbar/Navbar.js +1 -1
- package/__internal__/src/components/Navbar/Navbar.js.map +1 -1
- package/__internal__/src/components/Navbar/NavbarArrow/NavbarArrow.d.ts +1 -1
- package/__internal__/src/components/Navbar/NavbarItem/NavbarItem.d.ts +21 -0
- package/__internal__/src/components/Navbar/NavbarItem/NavbarItem.js +1 -1
- package/__internal__/src/components/Navbar/NavbarItem/NavbarItem.js.map +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 +14 -1
- package/__internal__/src/components/Navbar/NavbarRailItem/NavbarRailItem.js +1 -1
- package/__internal__/src/components/Navbar/NavbarRailItem/NavbarRailItem.js.map +1 -1
- package/__internal__/src/components/Navbar/helpers.d.ts +11 -10
- package/__internal__/src/components/Navbar/types.d.ts +13 -4
- 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/components/Navbar/NavbarItem/NavbarDrawer.d.ts +0 -2
- package/__internal__/src/components/Navbar/NavbarItem/NavbarDrawer.js +0 -2
- package/__internal__/src/components/Navbar/NavbarItem/NavbarDrawer.js.map +0 -1
- 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,3 +1,24 @@
|
|
|
1
1
|
import './NavbarItem.css';
|
|
2
2
|
import { NavbarItemComponent } from '../types';
|
|
3
|
+
export declare const cnNavbarItem: import("@bem-react/classname").ClassNameFormatter;
|
|
4
|
+
export declare const spaceMap: {
|
|
5
|
+
readonly m: {
|
|
6
|
+
readonly pV: "s";
|
|
7
|
+
readonly pH: "m";
|
|
8
|
+
readonly mB: "2xs";
|
|
9
|
+
};
|
|
10
|
+
readonly s: {
|
|
11
|
+
readonly pV: "xs";
|
|
12
|
+
readonly pH: "m";
|
|
13
|
+
readonly mB: "2xs";
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
export declare const mapLevelSpace: {
|
|
17
|
+
readonly m: "2xl";
|
|
18
|
+
readonly s: "xl";
|
|
19
|
+
};
|
|
20
|
+
export declare const bageSizeMap: {
|
|
21
|
+
readonly s: "xs";
|
|
22
|
+
readonly m: "s";
|
|
23
|
+
};
|
|
3
24
|
export declare const NavbarItem: NavbarItemComponent;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import"./NavbarItem.css";import{Badge}from"@consta/uikit/Badge";import{ListItem}from"@consta/uikit/ListCanary";import{useFlag}from"@consta/uikit/useFlag";import{useForkRef}from"@consta/uikit/useForkRef";import React,{forwardRef}from"react";import{cn}from"../../../utils/bem";import{NavbarArrow}from"../NavbarArrow";import{defaultNavbarPropSize}from"../types";const cnNavbarItem=cn("NavbarItem")
|
|
1
|
+
import"./NavbarItem.css";import{Badge}from"@consta/uikit/Badge";import{ListItem}from"@consta/uikit/ListCanary";import{useFlag}from"@consta/uikit/useFlag";import{useForkRef}from"@consta/uikit/useForkRef";import React,{forwardRef,useEffect}from"react";import{cn}from"../../../utils/bem";import{NavbarArrow}from"../NavbarArrow";import{defaultNavbarPropSize}from"../types";export const cnNavbarItem=cn("NavbarItem");export const spaceMap={m:{pV:"s",pH:"m",mB:"2xs"},s:{pV:"xs",pH:"m",mB:"2xs"}};export const mapLevelSpace={m:"2xl",s:"xl"};export const bageSizeMap={s:"xs",m:"s"};const NavbarItemRender=(a,b)=>{const{size:s=defaultNavbarPropSize,item:c,getItemLabel:d,getItemActive:e,getItemAdditionalClassName:f,getItemAs:g,getItemAttributes:h,getItemIcon:i,getItemRef:j,getItemRightSide:k,getItemSubMenu:l,onItemClick:m,className:n,getItemStatus:o,getItemSubMenuOpen:p,onSubMenuToggle:q,level:t=0,form:r}=a,[u,v]=useFlag((null===p||void 0===p?void 0:p(c))||!1),w=null===p||void 0===p?void 0:p(c),x=null===l||void 0===l?void 0:l(c),y=null===k||void 0===k?void 0:k(c),z=null===e||void 0===e?void 0:e(c),A=null===o||void 0===o?void 0:o(c),B=a=>{null!==x&&void 0!==x&&x.length&&(null===q||void 0===q?void 0:q(c,{open:!u,e:a}),v.set(!u))};return useEffect(()=>{void 0!==w&&v.set(w)},[w]),React.createElement(React.Fragment,null,React.createElement(ListItem,Object.assign({},(null===h||void 0===h?void 0:h(c))||{},{label:d(c),size:s,onClick:a=>{B(a),null===m||void 0===m?void 0:m(c,{e:a})},leftIcon:null===i||void 0===i?void 0:i(c),iconSize:s,rightSide:[...(Array.isArray(y)?y:[y]),A?React.createElement(Badge,{size:bageSizeMap[s],status:A,minified:!0}):void 0,null!==x&&void 0!==x&&x.length?React.createElement(NavbarArrow,{open:u,onClick:B}):void 0],as:null===g||void 0===g?void 0:g(c),active:z,ref:useForkRef([null===j||void 0===j?void 0:j(c),b]),className:cnNavbarItem({form:r,active:z},[n,null===f||void 0===f?void 0:f(c)]),space:spaceMap[s],style:{"--navbar-item-level":t,"--navbar-item-ph":`var(--space-${spaceMap[s].pH})`,"--navbar-item-level-space":`var(--space-${mapLevelSpace[s]})`}})),u&&(null===x||void 0===x?void 0:x.map((b,c)=>React.createElement(NavbarItem,Object.assign({},a,{key:c,level:t+1,item:b})))))};export const NavbarItem=forwardRef(NavbarItemRender);
|
|
2
2
|
//# sourceMappingURL=NavbarItem.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NavbarItem.js","names":["Badge","ListItem","useFlag","useForkRef","React","forwardRef","cn","NavbarArrow","defaultNavbarPropSize","cnNavbarItem","spaceMap","m","pV","pH","mB","s","mapLevelSpace","bageSizeMap","NavbarItemRender","props","ref","size","item","getItemLabel","getItemActive","getItemAdditionalClassName","getItemAs","getItemAttributes","getItemIcon","getItemRef","getItemRightSide","getItemSubMenu","onItemClick","className","getItemStatus","level","form","open","setOpen","subItems","rightSide","active","status","
|
|
1
|
+
{"version":3,"file":"NavbarItem.js","names":["Badge","ListItem","useFlag","useForkRef","React","forwardRef","useEffect","cn","NavbarArrow","defaultNavbarPropSize","cnNavbarItem","spaceMap","m","pV","pH","mB","s","mapLevelSpace","bageSizeMap","NavbarItemRender","props","ref","size","item","getItemLabel","getItemActive","getItemAdditionalClassName","getItemAs","getItemAttributes","getItemIcon","getItemRef","getItemRightSide","getItemSubMenu","onItemClick","className","getItemStatus","getItemSubMenuOpen","onSubMenuToggle","level","form","open","setOpen","controlledOpen","subItems","rightSide","active","status","handleToggle","e","length","set","createElement","Fragment","Object","assign","label","onClick","leftIcon","iconSize","Array","isArray","minified","as","space","style","\"--navbar-item-level\"","\"--navbar-item-ph\"","\"--navbar-item-level-space\"","map","subItem","index","NavbarItem","key"],"sources":["../../../../../../src/components/Navbar/NavbarItem/NavbarItem.tsx"],"sourcesContent":["import './NavbarItem.css';\n\nimport { Badge } from '@consta/uikit/Badge';\nimport { ListItem } from '@consta/uikit/ListCanary';\nimport { useFlag } from '@consta/uikit/useFlag';\nimport { useForkRef } from '@consta/uikit/useForkRef';\nimport React, { forwardRef, useEffect } from 'react';\n\nimport { cn } from '##/utils/bem';\n\nimport { NavbarArrow } from '../NavbarArrow';\nimport {\n defaultNavbarPropSize,\n NavbarItemComponent,\n NavbarItemProps,\n} from '../types';\n\nexport const cnNavbarItem = cn('NavbarItem');\n\nexport const spaceMap = {\n m: { pV: 's', pH: 'm', mB: '2xs' },\n s: { pV: 'xs', pH: 'm', mB: '2xs' },\n} as const;\n\nexport const mapLevelSpace = {\n m: '2xl',\n s: 'xl',\n} as const;\n\nexport const bageSizeMap = {\n s: 'xs',\n m: 's',\n} as const;\n\nconst NavbarItemRender = (\n props: NavbarItemProps,\n ref: React.Ref<HTMLDivElement>,\n) => {\n const {\n size = defaultNavbarPropSize,\n item,\n getItemLabel,\n getItemActive,\n getItemAdditionalClassName,\n getItemAs,\n getItemAttributes,\n getItemIcon,\n getItemRef,\n getItemRightSide,\n getItemSubMenu,\n onItemClick,\n className,\n getItemStatus,\n getItemSubMenuOpen,\n onSubMenuToggle,\n level = 0,\n form,\n } = props;\n\n const [open, setOpen] = useFlag(getItemSubMenuOpen?.(item) || false);\n const controlledOpen = getItemSubMenuOpen?.(item);\n\n const subItems = getItemSubMenu?.(item);\n const rightSide = getItemRightSide?.(item);\n const active = getItemActive?.(item);\n const status = getItemStatus?.(item);\n\n const handleToggle = (e: React.MouseEvent) => {\n if (subItems?.length) {\n onSubMenuToggle?.(item, { open: !open, e });\n setOpen.set(!open);\n }\n };\n\n useEffect(() => {\n if (controlledOpen !== undefined) {\n setOpen.set(controlledOpen);\n }\n }, [controlledOpen]);\n\n return (\n <>\n <ListItem\n {...(getItemAttributes?.(item) || {})}\n label={getItemLabel(item)}\n size={size}\n onClick={(e: React.MouseEvent) => {\n handleToggle(e);\n onItemClick?.(item, { e });\n }}\n leftIcon={getItemIcon?.(item)}\n iconSize={size}\n rightSide={[\n ...(Array.isArray(rightSide) ? rightSide : [rightSide]),\n status ? (\n <Badge size={bageSizeMap[size]} status={status} minified />\n ) : undefined,\n subItems?.length ? (\n <NavbarArrow open={open} onClick={handleToggle} />\n ) : undefined,\n ]}\n as={getItemAs?.(item)}\n active={active}\n ref={useForkRef([getItemRef?.(item), ref])}\n className={cnNavbarItem({ form, active }, [\n className,\n getItemAdditionalClassName?.(item),\n ])}\n space={spaceMap[size]}\n style={{\n ['--navbar-item-level' as string]: level,\n ['--navbar-item-ph' as string]: `var(--space-${spaceMap[size].pH})`,\n ['--navbar-item-level-space' as string]: `var(--space-${mapLevelSpace[size]})`,\n }}\n />\n {open &&\n subItems?.map((subItem, index) => (\n <NavbarItem {...props} key={index} level={level + 1} item={subItem} />\n ))}\n </>\n );\n};\n\nexport const NavbarItem = forwardRef(NavbarItemRender) as NavbarItemComponent;\n"],"mappings":"AAAA,yBAEA,OAASA,KAAK,KAAQ,qBAAqB,CAC3C,OAASC,QAAQ,KAAQ,0BAA0B,CACnD,OAASC,OAAO,KAAQ,uBAAuB,CAC/C,OAASC,UAAU,KAAQ,0BAA0B,CACrD,MAAO,CAAAC,KAAK,EAAIC,UAAU,CAAEC,SAAS,KAAQ,OAAO,CAEpD,OAASC,EAAE,0BAEX,OAASC,WAAW,sBACpB,OACEC,qBAAqB,gBAKvB,MAAO,MAAM,CAAAC,YAAY,CAAGH,EAAE,CAAC,YAAY,CAAC,CAE5C,MAAO,MAAM,CAAAI,QAAQ,CAAG,CACtBC,CAAC,CAAE,CAAEC,EAAE,CAAE,GAAG,CAAEC,EAAE,CAAE,GAAG,CAAEC,EAAE,CAAE,KAAM,CAAC,CAClCC,CAAC,CAAE,CAAEH,EAAE,CAAE,IAAI,CAAEC,EAAE,CAAE,GAAG,CAAEC,EAAE,CAAE,KAAM,CACpC,CAAU,CAEV,MAAO,MAAM,CAAAE,aAAa,CAAG,CAC3BL,CAAC,CAAE,KAAK,CACRI,CAAC,CAAE,IACL,CAAU,CAEV,MAAO,MAAM,CAAAE,WAAW,CAAG,CACzBF,CAAC,CAAE,IAAI,CACPJ,CAAC,CAAE,GACL,CAAU,CAEV,KAAM,CAAAO,gBAAgB,CAAGA,CACvBC,CAAsB,CACtBC,CAA8B,GAC3B,MACG,CACJC,IAAI,CAAJA,CAAI,CAAGb,qBAAqB,CAC5Bc,IAAI,CAAJA,CAAI,CACJC,YAAY,CAAZA,CAAY,CACZC,aAAa,CAAbA,CAAa,CACbC,0BAA0B,CAA1BA,CAA0B,CAC1BC,SAAS,CAATA,CAAS,CACTC,iBAAiB,CAAjBA,CAAiB,CACjBC,WAAW,CAAXA,CAAW,CACXC,UAAU,CAAVA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AS,CAAExB,YAAY,CAAC,CAAE6B,IAAI,CAAJA,CAAI,CAAEM,MAAM,CAANA,CAAO,CAAC,CAAE,CACxCX,CAAS,QACTR,CAA0B,WAA1BA,CAA0B,QAA1BA,CAA0B,CAAGH,CAAI,CAAC,CACnC,CAAE,CACHwC,KAAK,CAAEpD,QAAQ,CAACW,CAAI,CAAE,CACtB0C,KAAK,CAAE,CACLC,qBAAA,CAAmC3B,CAAK,CACxC4B,kBAAA,CAAiC,eAAcvD,QAAQ,CAACW,CAAI,CAAC,CAACR,EAAG,GAAE,CACnEqD,2BAAA,CAA0C,eAAclD,aAAa,CAACK,CAAI,CAAE,GAC9E,CAAE,EACH,CAAC,CACDkB,CAAI,UACHG,CAAQ,WAARA,CAAQ,QAARA,CAAQ,CAAEyB,GAAG,CAAC,CAACC,CAAO,CAAEC,CAAK,GAC3BlE,KAAA,CAAA+C,aAAA,CAACoB,UAAU,CAAAlB,MAAA,CAAAC,MAAA,IAAKlC,CAAK,EAAEoD,GAAG,CAAEF,CAAM,CAAChC,KAAK,CAAEA,CAAK,CAAG,CAAE,CAACf,IAAI,CAAE8C,CAAQ,EAAE,CACtE,CAAC,CACJ,CAEN,CAAC,CAED,MAAO,MAAM,CAAAE,UAAU,CAAGlE,UAAU,CAACc,gBAAgB,CAAwB"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import _defineProperty from"@babel/runtime/helpers/defineProperty";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";const _excluded=["items","onItemClick","getItemLabel","getItemIcon","getItemAs","getItemAttributes","getItemActive","getItemRef","getItemAdditionalClassName","size","form","className","getItemStatus","tooltipProps","getItemTooltip"];function ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread(a){for(var b,c=1;c<arguments.length;c++)b=null==arguments[c]?{}:arguments[c],c%2?ownKeys(Object(b),!0).forEach(function(c){_defineProperty(a,c,b[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(b)):ownKeys(Object(b)).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))});return a}import React,{forwardRef}from"react";import{withDefaultRailGetters}from"../helpers";import{NavbarRailItem}from"../NavbarRailItem";import{defaultNavbarPropForm,defaultNavbarPropSize}from"../types";const NavbarRailRender=(a,b)=>{const c=withDefaultRailGetters(a),{items:d,onItemClick:f,getItemLabel:g,getItemIcon:h,getItemAs:i,getItemAttributes:j,getItemActive:k,getItemRef:l,getItemAdditionalClassName:m,size:r=defaultNavbarPropSize,form:s=defaultNavbarPropForm,className:n,getItemStatus:o,tooltipProps:p,getItemTooltip:q}=c,t=_objectWithoutProperties(c,_excluded);return React.createElement("div",Object.assign({},t,{ref:b,className:n}),d.map((a,b)=>React.createElement(NavbarRailItem,Object.assign({},(null===j||void 0===j?void 0:j(a))||{},{key:b,as:null===i||void 0===i?void 0:i(a),size:r,form:s,onClick:b=>null===f||void 0===f?void 0:f(a,{e:b}),icon:h(a),ref:null===l||void 0===l?void 0:l(a),label:g(a),tooltipProps:_objectSpread(_objectSpread({},p),{},{
|
|
1
|
+
import _defineProperty from"@babel/runtime/helpers/defineProperty";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";const _excluded=["items","onItemClick","getItemLabel","getItemIcon","getItemAs","getItemAttributes","getItemActive","getItemRef","getItemAdditionalClassName","size","form","className","getItemStatus","tooltipProps","getItemTooltip"];function ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread(a){for(var b,c=1;c<arguments.length;c++)b=null==arguments[c]?{}:arguments[c],c%2?ownKeys(Object(b),!0).forEach(function(c){_defineProperty(a,c,b[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(b)):ownKeys(Object(b)).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))});return a}import React,{forwardRef}from"react";import{withDefaultRailGetters}from"../helpers";import{NavbarRailItem}from"../NavbarRailItem";import{defaultNavbarPropForm,defaultNavbarPropSize}from"../types";const NavbarRailRender=(a,b)=>{const c=withDefaultRailGetters(a),{items:d,onItemClick:f,getItemLabel:g,getItemIcon:h,getItemAs:i,getItemAttributes:j,getItemActive:k,getItemRef:l,getItemAdditionalClassName:m,size:r=defaultNavbarPropSize,form:s=defaultNavbarPropForm,className:n,getItemStatus:o,tooltipProps:p,getItemTooltip:q}=c,t=_objectWithoutProperties(c,_excluded);return React.createElement("div",Object.assign({},t,{ref:b,className:n}),d.map((a,b)=>React.createElement(NavbarRailItem,Object.assign({},(null===j||void 0===j?void 0:j(a))||{},{key:b,as:null===i||void 0===i?void 0:i(a),size:r,form:s,onClick:b=>null===f||void 0===f?void 0:f(a,{e:b}),icon:h(a),ref:null===l||void 0===l?void 0:l(a),label:g(a),tooltipProps:_objectSpread(_objectSpread({},p),{},{tooltipContent:q(a)}),active:k(a),status:o(a)}))))};export const NavbarRail=forwardRef(NavbarRailRender);
|
|
2
2
|
//# sourceMappingURL=NavbarRail.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NavbarRail.js","names":["React","forwardRef","withDefaultRailGetters","NavbarRailItem","defaultNavbarPropForm","defaultNavbarPropSize","NavbarRailRender","props","ref","c","items","onItemClick","getItemLabel","getItemIcon","getItemAs","getItemAttributes","getItemActive","getItemRef","getItemAdditionalClassName","size","form","className","getItemStatus","tooltipProps","getItemTooltip","otherProps","_objectWithoutProperties","_excluded","createElement","Object","assign","map","item","index","key","as","onClick","e","icon","label","_objectSpread","
|
|
1
|
+
{"version":3,"file":"NavbarRail.js","names":["React","forwardRef","withDefaultRailGetters","NavbarRailItem","defaultNavbarPropForm","defaultNavbarPropSize","NavbarRailRender","props","ref","c","items","onItemClick","getItemLabel","getItemIcon","getItemAs","getItemAttributes","getItemActive","getItemRef","getItemAdditionalClassName","size","form","className","getItemStatus","tooltipProps","getItemTooltip","otherProps","_objectWithoutProperties","_excluded","createElement","Object","assign","map","item","index","key","as","onClick","e","icon","label","_objectSpread","tooltipContent","active","status","NavbarRail"],"sources":["../../../../../../src/components/Navbar/NavbarRail/NavbarRail.tsx"],"sourcesContent":["import React, { forwardRef } from 'react';\n\nimport { withDefaultRailGetters } from '../helpers';\nimport { NavbarRailItem } from '../NavbarRailItem';\nimport {\n defaultNavbarPropForm,\n defaultNavbarPropSize,\n NavbarRailComponent,\n NavbarRailProps,\n} from '../types';\n\nconst NavbarRailRender = (\n props: NavbarRailProps,\n ref: React.Ref<HTMLDivElement>,\n) => {\n const {\n items,\n onItemClick,\n getItemLabel,\n getItemIcon,\n getItemAs,\n getItemAttributes,\n getItemActive,\n getItemRef,\n getItemAdditionalClassName,\n size = defaultNavbarPropSize,\n form = defaultNavbarPropForm,\n className,\n getItemStatus,\n tooltipProps,\n getItemTooltip,\n\n ...otherProps\n } = withDefaultRailGetters(props);\n\n return (\n <div {...otherProps} ref={ref} className={className}>\n {items.map((item, index) => {\n return (\n <NavbarRailItem\n {...((getItemAttributes?.(item) ||\n {}) as JSX.IntrinsicElements['div'])}\n key={index}\n as={getItemAs?.(item)}\n size={size}\n form={form}\n onClick={(e) => onItemClick?.(item, { e })}\n icon={getItemIcon(item)}\n ref={getItemRef?.(item) as React.RefObject<HTMLDivElement>}\n label={getItemLabel(item)}\n tooltipProps={{\n ...tooltipProps,\n tooltipContent: getItemTooltip(item),\n }}\n active={getItemActive(item)}\n status={getItemStatus(item)}\n />\n );\n })}\n </div>\n );\n};\n\nexport const NavbarRail = forwardRef(NavbarRailRender) as NavbarRailComponent;\n"],"mappings":"m+BAAA,MAAO,CAAAA,KAAK,EAAIC,UAAU,KAAQ,OAAO,CAEzC,OAASC,sB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CAAW,WAAXA,CAAW,QAAXA,CAAW,CAAGqB,CAAI,CAAE,CAAEK,CAAC,CAADA,CAAE,CAAC,CAAE,CAC3CC,IAAI,CAAEzB,CAAW,CAACmB,CAAI,CAAE,CACxBxB,GAAG,QAAES,CAAU,WAAVA,CAAU,QAAVA,CAAU,CAAGe,CAAI,CAAqC,CAC3DO,KAAK,CAAE3B,CAAY,CAACoB,CAAI,CAAE,CAC1BT,YAAY,CAAAiB,aAAA,CAAAA,aAAA,IACPjB,CAAY,MACfkB,cAAc,CAAEjB,CAAc,CAACQ,CAAI,CAAC,EACpC,CACFU,MAAM,CAAE1B,CAAa,CAACgB,CAAI,CAAE,CAC5BW,MAAM,CAAErB,CAAa,CAACU,CAAI,CAAE,EAC7B,CAEJ,CACE,CAET,CAAC,CAED,MAAO,MAAM,CAAAY,UAAU,CAAG3C,UAAU,CAACK,gBAAgB,CAAwB"}
|
|
@@ -1,6 +1,19 @@
|
|
|
1
1
|
import './NavbarRailItem.css';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { NavbarRailItemProps } from '../types';
|
|
4
|
+
export declare const cnNavbarItem: import("@bem-react/classname").ClassNameFormatter;
|
|
5
|
+
export declare const spaceMap: {
|
|
6
|
+
readonly m: {
|
|
7
|
+
readonly pV: "s";
|
|
8
|
+
readonly pH: "m";
|
|
9
|
+
readonly mB: "2xs";
|
|
10
|
+
};
|
|
11
|
+
readonly s: {
|
|
12
|
+
readonly pV: "xs";
|
|
13
|
+
readonly pH: "m";
|
|
14
|
+
readonly mB: "2xs";
|
|
15
|
+
};
|
|
16
|
+
};
|
|
4
17
|
export declare const NavbarRailItem: import("@consta/uikit/__internal__/src/utils/types/PropsWithAsAttributes").ComponentWithAs<NavbarRailItemProps, "div"> | React.ComponentType<{
|
|
5
|
-
tooltipProps?: import("@consta/uikit/withTooltip").TooltipProps
|
|
18
|
+
tooltipProps?: import("@consta/uikit/withTooltip").TooltipProps;
|
|
6
19
|
}>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";const _excluded=["size","icon","status","form","active","label","as","className"];import"./NavbarRailItem.css";import{forwardRefWithAs}from"@consta/uikit/__internal__/src/utils/types/PropsWithAsAttributes";import{Badge}from"@consta/uikit/Badge";import{cnMixSpace}from"@consta/uikit/MixSpace";import{Text}from"@consta/uikit/Text";import{withTooltip}from"@consta/uikit/withTooltip";import React from"react";import{cn}from"../../../utils/bem";import{defaultNavbarPropForm,defaultNavbarPropSize}from"../types";const cnNavbarItem=cn("NavbarRailItem")
|
|
1
|
+
import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";const _excluded=["size","icon","status","form","active","label","as","className"];import"./NavbarRailItem.css";import{forwardRefWithAs}from"@consta/uikit/__internal__/src/utils/types/PropsWithAsAttributes";import{Badge}from"@consta/uikit/Badge";import{cnMixSpace}from"@consta/uikit/MixSpace";import{Text}from"@consta/uikit/Text";import{withTooltip}from"@consta/uikit/withTooltip";import React from"react";import{cn}from"../../../utils/bem";import{defaultNavbarPropForm,defaultNavbarPropSize}from"../types";export const cnNavbarItem=cn("NavbarRailItem");export const spaceMap={m:{pV:"s",pH:"m",mB:"2xs"},s:{pV:"xs",pH:"m",mB:"2xs"}};const bageSizeMap={s:"xs",m:"s"},textSpaceMap={m:{mT:"xs"},s:{mT:"2xs"}},Item=forwardRefWithAs((a,b)=>{const{size:h=defaultNavbarPropSize,icon:c,status:d,form:i=defaultNavbarPropForm,active:e,label:f,as:j="div",className:g}=a,k=_objectWithoutProperties(a,_excluded);return React.createElement(j,Object.assign({},k,{ref:b,className:cnNavbarItem({size:h,form:i,active:e},[cnMixSpace(spaceMap[h]),g])}),React.createElement("div",{className:cnNavbarItem("IconWrapper")},c&&React.createElement(c,{size:h}),d&&React.createElement(Badge,{className:cnNavbarItem("Badge"),size:bageSizeMap[h],status:d,minified:!0})),f&&React.createElement(Text,{className:cnNavbarItem("Label",[cnMixSpace(textSpaceMap[h])]),align:"center",size:h,view:"primary",lineHeight:"m"},f))});export const NavbarRailItem=withTooltip({direction:"rightCenter",mode:"mouseover",possibleDirections:["rightCenter","rightDown","rightUp","rightStartDown","rightStartUp"],spareDirection:"rightCenter"})(Item);
|
|
2
2
|
//# sourceMappingURL=NavbarRailItem.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NavbarRailItem.js","names":["forwardRefWithAs","Badge","cnMixSpace","Text","withTooltip","React","cn","defaultNavbarPropForm","defaultNavbarPropSize","cnNavbarItem","spaceMap","m","pV","pH","mB","s","bageSizeMap","textSpaceMap","mT","Item","props","ref","size","icon","Icon","status","form","active","label","as","className","otherProps","_objectWithoutProperties","_excluded","createElement","Object","assign","c","minified","align","view","lineHeight","NavbarRailItem","direction","mode","possibleDirections","spareDirection"],"sources":["../../../../../../src/components/Navbar/NavbarRailItem/NavbarRailItem.tsx"],"sourcesContent":["import './NavbarRailItem.css';\n\nimport { forwardRefWithAs } from '@consta/uikit/__internal__/src/utils/types/PropsWithAsAttributes';\nimport { Badge } from '@consta/uikit/Badge';\nimport { cnMixSpace } from '@consta/uikit/MixSpace';\nimport { Text } from '@consta/uikit/Text';\nimport { withTooltip } from '@consta/uikit/withTooltip';\nimport React from 'react';\n\nimport { cn } from '##/utils/bem';\n\nimport {\n defaultNavbarPropForm,\n defaultNavbarPropSize,\n NavbarRailItemProps,\n} from '../types';\n\
|
|
1
|
+
{"version":3,"file":"NavbarRailItem.js","names":["forwardRefWithAs","Badge","cnMixSpace","Text","withTooltip","React","cn","defaultNavbarPropForm","defaultNavbarPropSize","cnNavbarItem","spaceMap","m","pV","pH","mB","s","bageSizeMap","textSpaceMap","mT","Item","props","ref","size","icon","Icon","status","form","active","label","as","className","otherProps","_objectWithoutProperties","_excluded","createElement","Object","assign","c","minified","align","view","lineHeight","NavbarRailItem","direction","mode","possibleDirections","spareDirection"],"sources":["../../../../../../src/components/Navbar/NavbarRailItem/NavbarRailItem.tsx"],"sourcesContent":["import './NavbarRailItem.css';\n\nimport { forwardRefWithAs } from '@consta/uikit/__internal__/src/utils/types/PropsWithAsAttributes';\nimport { Badge } from '@consta/uikit/Badge';\nimport { cnMixSpace } from '@consta/uikit/MixSpace';\nimport { Text } from '@consta/uikit/Text';\nimport { withTooltip } from '@consta/uikit/withTooltip';\nimport React from 'react';\n\nimport { cn } from '##/utils/bem';\n\nimport {\n defaultNavbarPropForm,\n defaultNavbarPropSize,\n NavbarRailItemProps,\n} from '../types';\n\nexport const cnNavbarItem = cn('NavbarRailItem');\n\nexport const spaceMap = {\n m: { pV: 's', pH: 'm', mB: '2xs' },\n s: { pV: 'xs', pH: 'm', mB: '2xs' },\n} as const;\n\nconst bageSizeMap = {\n s: 'xs',\n m: 's',\n} as const;\n\nconst textSpaceMap = {\n m: { mT: 'xs' },\n s: { mT: '2xs' },\n} as const;\n\nconst Item = forwardRefWithAs<NavbarRailItemProps, 'div'>((props, ref) => {\n const {\n size = defaultNavbarPropSize,\n icon: Icon,\n status,\n form = defaultNavbarPropForm,\n active,\n label,\n as = 'div',\n className,\n ...otherProps\n } = props;\n\n const Tag = as as string;\n\n return (\n <Tag\n {...otherProps}\n ref={ref}\n className={cnNavbarItem({ size, form, active }, [\n cnMixSpace(spaceMap[size]),\n className,\n ])}\n >\n <div className={cnNavbarItem('IconWrapper')}>\n {Icon && <Icon size={size} />}\n {status && (\n <Badge\n className={cnNavbarItem('Badge')}\n size={bageSizeMap[size]}\n status={status}\n minified\n />\n )}\n </div>\n {label && (\n <Text\n className={cnNavbarItem('Label', [cnMixSpace(textSpaceMap[size])])}\n align=\"center\"\n size={size}\n view=\"primary\"\n lineHeight=\"m\"\n >\n {label}\n </Text>\n )}\n </Tag>\n );\n});\n\nexport const NavbarRailItem = withTooltip({\n direction: 'rightCenter',\n mode: 'mouseover',\n possibleDirections: [\n 'rightCenter',\n 'rightDown',\n 'rightUp',\n 'rightStartDown',\n 'rightStartUp',\n ],\n spareDirection: 'rightCenter',\n})(Item);\n"],"m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1
|
-
/// <reference types="react" />
|
|
2
1
|
import { DefaultNavbarGroup, DefaultNavbarItem, DefaultNavbarRailItem, NavbarPropGetGroupKey, NavbarPropGetGroupLabel, NavbarPropGetGroupRightSide, NavbarPropGetItemActive, NavbarPropGetItemGroupId, NavbarPropGetItemIcon, NavbarPropGetItemLabel, NavbarPropGetItemRightSide, NavbarPropGetItemStatus, NavbarPropGetItemSubMenu, NavbarProps, NavbarRailPropGetItemTooltip, NavbarRailProps } from './types';
|
|
3
2
|
export declare function withDefaultGetters<ITEM = DefaultNavbarItem, GROUP = DefaultNavbarGroup>(props: NavbarProps<ITEM, GROUP>): {
|
|
4
3
|
items: ITEM[];
|
|
5
|
-
size?: "
|
|
6
|
-
form?: "
|
|
4
|
+
size?: import("./types").NavbarPropSize;
|
|
5
|
+
form?: import("./types").NavbarPropForm;
|
|
7
6
|
onItemClick?: import("./types").NavbarPropOnItemClick<ITEM> | undefined;
|
|
8
7
|
getItemLabel?: NavbarPropGetItemLabel<ITEM> | undefined;
|
|
9
8
|
getItemIcon?: NavbarPropGetItemIcon<ITEM> | undefined;
|
|
@@ -22,12 +21,14 @@ export declare function withDefaultGetters<ITEM = DefaultNavbarItem, GROUP = Def
|
|
|
22
21
|
getGroupRightSide?: NavbarPropGetGroupRightSide<GROUP> | undefined;
|
|
23
22
|
sortGroup?: import("./types").NavbarPropSortGroup<ITEM, GROUP> | undefined;
|
|
24
23
|
getGroupAdditionalClassName?: import("./types").NavbarPropGetGroupAdditionalClassName<GROUP> | undefined;
|
|
25
|
-
|
|
26
|
-
|
|
24
|
+
getItemSubMenuOpen?: import("./types").NavbarPropGetItemSubMenuOpen<ITEM> | undefined;
|
|
25
|
+
onSubMenuToggle?: import("./types").NavbarPropOnSubMenuToggle<ITEM> | undefined;
|
|
26
|
+
} & Omit<import("react").HTMLAttributes<HTMLDivElement>, "css" | "items" | "onItemClick" | "getItemLabel" | "getItemIcon" | "form" | "size" | "getItemAs" | "getItemAttributes" | "groups" | "getItemSubMenu" | "getItemActive" | "getGroupKey" | "getGroupLabel" | "getItemRightSide" | "getItemGroupKey" | "getItemStatus" | "getItemRef" | "getItemAdditionalClassName" | "getGroupRightSide" | "sortGroup" | "getGroupAdditionalClassName" | "getItemSubMenuOpen" | "onSubMenuToggle"> & import("react").RefAttributes<HTMLDivElement> & (ITEM extends {
|
|
27
|
+
label: DefaultNavbarItem["label"];
|
|
27
28
|
} ? {} : {
|
|
28
29
|
getItemLabel: NavbarPropGetItemLabel<ITEM>;
|
|
29
30
|
}) & (GROUP extends {
|
|
30
|
-
id:
|
|
31
|
+
id: DefaultNavbarGroup["id"];
|
|
31
32
|
} ? {} : {
|
|
32
33
|
getGroupKey: NavbarPropGetGroupKey<GROUP>;
|
|
33
34
|
}) & {
|
|
@@ -44,8 +45,8 @@ export declare function withDefaultGetters<ITEM = DefaultNavbarItem, GROUP = Def
|
|
|
44
45
|
};
|
|
45
46
|
export declare function withDefaultRailGetters<ITEM = NavbarRailProps>(props: NavbarRailProps<ITEM>): {
|
|
46
47
|
items: ITEM[];
|
|
47
|
-
size?: "
|
|
48
|
-
form?: "
|
|
48
|
+
size?: import("./types").NavbarPropSize;
|
|
49
|
+
form?: import("./types").NavbarPropForm;
|
|
49
50
|
onItemClick?: import("./types").NavbarPropOnItemClick<ITEM> | undefined;
|
|
50
51
|
getItemLabel?: import("./types").NavbarRailPropGetItemLabel<ITEM> | undefined;
|
|
51
52
|
getItemIcon?: import("./types").NavbarRailPropGetItemIcon<ITEM> | undefined;
|
|
@@ -56,9 +57,9 @@ export declare function withDefaultRailGetters<ITEM = NavbarRailProps>(props: Na
|
|
|
56
57
|
getItemRef?: import("./types").NavbarPropGetItemRef<ITEM> | undefined;
|
|
57
58
|
getItemAdditionalClassName?: import("./types").NavbarPropGetItemAdditionalClassName<ITEM> | undefined;
|
|
58
59
|
getItemTooltip?: NavbarRailPropGetItemTooltip<ITEM> | undefined;
|
|
59
|
-
tooltipProps?: Omit<import("@consta/uikit/Tooltip").TooltipProps, "children" | "position" | "
|
|
60
|
+
tooltipProps?: Omit<import("@consta/uikit/Tooltip").TooltipProps, "children" | "position" | "equalAnchorWidth" | "anchorRef">;
|
|
60
61
|
} & Omit<import("react").HTMLAttributes<HTMLDivElement>, "css" | "items" | "onItemClick" | "getItemLabel" | "getItemIcon" | "form" | "size" | "getItemAs" | "getItemAttributes" | "getItemActive" | "getItemStatus" | "getItemRef" | "getItemAdditionalClassName" | "getItemTooltip" | "tooltipProps"> & import("react").RefAttributes<HTMLDivElement> & (ITEM extends {
|
|
61
|
-
icon:
|
|
62
|
+
icon: DefaultNavbarRailItem["icon"];
|
|
62
63
|
} ? {} : {
|
|
63
64
|
getItemIcon: import("./types").NavbarRailPropGetItemIcon<ITEM>;
|
|
64
65
|
}) & {
|
|
@@ -4,7 +4,7 @@ import { AsAttributes, AsTags } from '@consta/uikit/__internal__/src/utils/types
|
|
|
4
4
|
import { PropsWithHTMLAttributesAndRef } from '@consta/uikit/__internal__/src/utils/types/PropsWithHTMLAttributes';
|
|
5
5
|
import { BadgePropStatus } from '@consta/uikit/Badge';
|
|
6
6
|
import { TooltipProps } from '@consta/uikit/Tooltip';
|
|
7
|
-
import React from 'react';
|
|
7
|
+
import * as React from 'react';
|
|
8
8
|
export declare const navbarPropSize: readonly ["s", "m"];
|
|
9
9
|
export type NavbarPropSize = (typeof navbarPropSize)[number];
|
|
10
10
|
export declare const defaultNavbarPropSize: NavbarPropSize;
|
|
@@ -49,6 +49,11 @@ export type NavbarPropGetItemRightIcon<ITEM> = (item: ITEM) => IconComponent | u
|
|
|
49
49
|
export type NavbarPropGetItemAs<ITEM> = (item: ITEM) => AsTags | undefined;
|
|
50
50
|
export type NavbarPropGetItemAttributes<ITEM> = (item: ITEM) => AsAttributes | undefined;
|
|
51
51
|
export type NavbarPropSortGroup<ITEM, GROUP> = (a: Group<ITEM, GROUP>, b: Group<ITEM, GROUP>) => number;
|
|
52
|
+
export type NavbarPropGetItemSubMenuOpen<ITEM> = (item: ITEM) => boolean;
|
|
53
|
+
export type NavbarPropOnSubMenuToggle<ITEM> = (item: ITEM, params: {
|
|
54
|
+
open: boolean;
|
|
55
|
+
e?: React.MouseEvent;
|
|
56
|
+
}) => void;
|
|
52
57
|
export type NavbarPropGetGroupKey<GROUP> = (item: GROUP) => string | number | undefined;
|
|
53
58
|
export type NavbarPropGetGroupAdditionalClassName<GROUP> = (item: GROUP) => string;
|
|
54
59
|
export type NavbarPropGetGroupLabel<GROUP> = (item: GROUP) => string | undefined;
|
|
@@ -79,6 +84,8 @@ export type NavbarProps<ITEM = DefaultNavbarItem, GROUP = DefaultNavbarGroup> =
|
|
|
79
84
|
getGroupRightSide?: NavbarPropGetGroupRightSide<GROUP>;
|
|
80
85
|
sortGroup?: NavbarPropSortGroup<ITEM, GROUP>;
|
|
81
86
|
getGroupAdditionalClassName?: NavbarPropGetGroupAdditionalClassName<GROUP>;
|
|
87
|
+
getItemSubMenuOpen?: NavbarPropGetItemSubMenuOpen<ITEM>;
|
|
88
|
+
onSubMenuToggle?: NavbarPropOnSubMenuToggle<ITEM>;
|
|
82
89
|
}, HTMLDivElement> & (ITEM extends {
|
|
83
90
|
label: DefaultNavbarItem['label'];
|
|
84
91
|
} ? {} : {
|
|
@@ -88,7 +95,7 @@ export type NavbarProps<ITEM = DefaultNavbarItem, GROUP = DefaultNavbarGroup> =
|
|
|
88
95
|
} ? {} : {
|
|
89
96
|
getGroupKey: NavbarPropGetGroupKey<GROUP>;
|
|
90
97
|
});
|
|
91
|
-
export type NavbarComponent = <ITEM = DefaultNavbarItem, GROUP = DefaultNavbarGroup>(props: NavbarProps<ITEM, GROUP>) => React.
|
|
98
|
+
export type NavbarComponent = <ITEM = DefaultNavbarItem, GROUP = DefaultNavbarGroup>(props: NavbarProps<ITEM, GROUP>) => React.ReactNode;
|
|
92
99
|
export type NavbarRailProps<ITEM = DefaultNavbarRailItem> = PropsWithHTMLAttributesAndRef<{
|
|
93
100
|
items: ITEM[];
|
|
94
101
|
size?: NavbarPropSize;
|
|
@@ -109,7 +116,7 @@ export type NavbarRailProps<ITEM = DefaultNavbarRailItem> = PropsWithHTMLAttribu
|
|
|
109
116
|
} ? {} : {
|
|
110
117
|
getItemIcon: NavbarRailPropGetItemIcon<ITEM>;
|
|
111
118
|
});
|
|
112
|
-
export type NavbarRailComponent = <ITEM = DefaultNavbarRailItem>(props: NavbarRailProps<ITEM>) => React.
|
|
119
|
+
export type NavbarRailComponent = <ITEM = DefaultNavbarRailItem>(props: NavbarRailProps<ITEM>) => React.ReactNode;
|
|
113
120
|
export type NavbarItemProps<ITEM = DefaultNavbarItem> = PropsWithHTMLAttributesAndRef<{
|
|
114
121
|
size: NavbarPropSize;
|
|
115
122
|
item: ITEM;
|
|
@@ -126,8 +133,10 @@ export type NavbarItemProps<ITEM = DefaultNavbarItem> = PropsWithHTMLAttributesA
|
|
|
126
133
|
getItemSubMenu: NavbarPropGetItemSubMenu<ITEM> | undefined;
|
|
127
134
|
getItemAdditionalClassName: NavbarPropGetItemAdditionalClassName<ITEM> | undefined;
|
|
128
135
|
level: number;
|
|
136
|
+
getItemSubMenuOpen: NavbarPropGetItemSubMenuOpen<ITEM> | undefined;
|
|
137
|
+
onSubMenuToggle: NavbarPropOnSubMenuToggle<ITEM> | undefined;
|
|
129
138
|
}, HTMLDivElement>;
|
|
130
|
-
export type NavbarItemComponent = <ITEM = DefaultNavbarItem>(props: NavbarItemProps<ITEM>) => React.
|
|
139
|
+
export type NavbarItemComponent = <ITEM = DefaultNavbarItem>(props: NavbarItemProps<ITEM>) => React.ReactNode;
|
|
131
140
|
export type NavbarRailItemProps = PropsWithHTMLAttributesAndRef<{
|
|
132
141
|
size?: NavbarPropSize;
|
|
133
142
|
form?: NavbarPropForm;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","names":["navbarPropSize","defaultNavbarPropSize","navbarPropForm","defaultNavbarPropForm"],"sources":["../../../../../src/components/Navbar/types.ts"],"sourcesContent":["import { IconComponent } from '@consta/icons/Icon';\nimport { Group } from '@consta/uikit/__internal__/src/utils/getGroups';\nimport {\n AsAttributes,\n AsTags,\n} from '@consta/uikit/__internal__/src/utils/types/AsTags';\nimport { PropsWithHTMLAttributesAndRef } from '@consta/uikit/__internal__/src/utils/types/PropsWithHTMLAttributes';\nimport { BadgePropStatus } from '@consta/uikit/Badge';\nimport { TooltipProps } from '@consta/uikit/Tooltip';\nimport React from 'react';\n\nexport const navbarPropSize = ['s', 'm'] as const;\nexport type NavbarPropSize = (typeof navbarPropSize)[number];\nexport const defaultNavbarPropSize: NavbarPropSize = 'm';\n\nexport const navbarPropForm = ['default', 'brick', 'round'] as const;\nexport type NavbarPropForm = (typeof navbarPropForm)[number];\nexport const defaultNavbarPropForm = navbarPropForm[0];\n\nexport type DefaultNavbarGroup = {\n id: string | number;\n label?: string;\n rightSide?: React.ReactNode;\n};\n\nexport type DefaultNavbarItem = {\n label: string;\n status?: BadgePropStatus;\n groupId?: string | number;\n icon?: IconComponent;\n rightSide?: React.ReactNode;\n active?: boolean;\n subMenu?: DefaultNavbarItem[];\n};\n\nexport type DefaultNavbarRailItem = {\n label: string;\n icon: IconComponent;\n status?: BadgePropStatus;\n active?: boolean;\n tooltip?: React.ReactNode;\n};\n\nexport type NavbarPropOnItemClick<ITEM> = (\n item: ITEM,\n params: {\n e: React.MouseEvent;\n },\n) => void;\n\n// ITEMS\n\nexport type NavbarPropGetItemLabel<ITEM> = (item: ITEM) => string;\nexport type NavbarRailPropGetItemLabel<ITEM> = (\n item: ITEM,\n) => string | undefined;\n\nexport type NavbarPropGetItemAdditionalClassName<ITEM> = (item: ITEM) => string;\n\nexport type NavbarPropGetItemDisabled<ITEM> = (\n item: ITEM,\n) => boolean | undefined;\n\nexport type NavbarPropGetItemActive<ITEM> = (item: ITEM) => boolean | undefined;\n\nexport type NavbarPropGetItemGroupId<ITEM> = (\n item: ITEM,\n) => string | number | undefined;\n\nexport type NavbarPropGetItemLeftSide<ITEM> = (\n item: ITEM,\n) => React.ReactNode | undefined;\n\nexport type NavbarPropGetItemIcon<ITEM> = (\n item: ITEM,\n) => IconComponent | undefined;\n\nexport type NavbarRailPropGetItemIcon<ITEM> = (item: ITEM) => IconComponent;\n\nexport type NavbarPropGetItemRightSide<ITEM> = (\n item: ITEM,\n) => React.ReactNode | undefined;\n\nexport type NavbarPropGetItemRightIcon<ITEM> = (\n item: ITEM,\n) => IconComponent | undefined;\n\nexport type NavbarPropGetItemAs<ITEM> = (item: ITEM) => AsTags | undefined;\n\nexport type NavbarPropGetItemAttributes<ITEM> = (\n item: ITEM,\n) => AsAttributes | undefined;\n\nexport type NavbarPropSortGroup<ITEM, GROUP> = (\n a: Group<ITEM, GROUP>,\n b: Group<ITEM, GROUP>,\n) => number;\n\n// GROUPS\nexport type NavbarPropGetGroupKey<GROUP> = (\n item: GROUP,\n) => string | number | undefined;\n\nexport type NavbarPropGetGroupAdditionalClassName<GROUP> = (\n item: GROUP,\n) => string;\n\nexport type NavbarPropGetGroupLabel<GROUP> = (\n item: GROUP,\n) => string | undefined;\nexport type NavbarPropGetGroupRightSide<GROUP> = (\n item: GROUP,\n) => React.ReactNode | undefined;\n\nexport type NavbarPropGetItemRef<ITEM> = (\n item: ITEM,\n) => React.RefObject<HTMLElement> | undefined;\n\nexport type NavbarPropGetItemStatus<ITEM> = (\n item: ITEM,\n) => BadgePropStatus | undefined;\n\nexport type NavbarPropGetItemSubMenu<ITEM> = (item: ITEM) => ITEM[] | undefined;\nexport type NavbarRailPropGetItemTooltip<ITEM> = (\n item: ITEM,\n) => React.ReactNode | undefined;\n\nexport type NavbarProps<\n ITEM = DefaultNavbarItem,\n GROUP = DefaultNavbarGroup,\n> = PropsWithHTMLAttributesAndRef<\n {\n items: ITEM[];\n size?: NavbarPropSize;\n form?: NavbarPropForm;\n onItemClick?: NavbarPropOnItemClick<ITEM>;\n getItemLabel?: NavbarPropGetItemLabel<ITEM>;\n getItemIcon?: NavbarPropGetItemIcon<ITEM>;\n getItemActive?: NavbarPropGetItemActive<ITEM>;\n getItemRightSide?: NavbarPropGetItemRightSide<ITEM>;\n getItemStatus?: NavbarPropGetItemStatus<ITEM>;\n getItemGroupKey?: NavbarPropGetItemGroupId<ITEM>;\n getItemAs?: NavbarPropGetItemAs<ITEM>;\n getItemAttributes?: NavbarPropGetItemAttributes<ITEM>;\n getItemRef?: NavbarPropGetItemRef<ITEM>;\n getItemSubMenu?: NavbarPropGetItemSubMenu<ITEM>;\n getItemAdditionalClassName?: NavbarPropGetItemAdditionalClassName<ITEM>;\n groups?: GROUP[];\n getGroupKey?: NavbarPropGetGroupKey<GROUP>;\n getGroupLabel?: NavbarPropGetGroupLabel<GROUP>;\n getGroupRightSide?: NavbarPropGetGroupRightSide<GROUP>;\n sortGroup?: NavbarPropSortGroup<ITEM, GROUP>;\n getGroupAdditionalClassName?: NavbarPropGetGroupAdditionalClassName<GROUP>;\n },\n HTMLDivElement\n> &\n (ITEM extends { label: DefaultNavbarItem['label'] }\n ? {}\n : { getItemLabel: NavbarPropGetItemLabel<ITEM> }) &\n (GROUP extends { id: DefaultNavbarGroup['id'] }\n ? {}\n : { getGroupKey: NavbarPropGetGroupKey<GROUP> });\n\nexport type NavbarComponent = <\n ITEM = DefaultNavbarItem,\n GROUP = DefaultNavbarGroup,\n>(\n props: NavbarProps<ITEM, GROUP>,\n) => React.
|
|
1
|
+
{"version":3,"file":"types.js","names":["navbarPropSize","defaultNavbarPropSize","navbarPropForm","defaultNavbarPropForm"],"sources":["../../../../../src/components/Navbar/types.ts"],"sourcesContent":["import { IconComponent } from '@consta/icons/Icon';\nimport { Group } from '@consta/uikit/__internal__/src/utils/getGroups';\nimport {\n AsAttributes,\n AsTags,\n} from '@consta/uikit/__internal__/src/utils/types/AsTags';\nimport { PropsWithHTMLAttributesAndRef } from '@consta/uikit/__internal__/src/utils/types/PropsWithHTMLAttributes';\nimport { BadgePropStatus } from '@consta/uikit/Badge';\nimport { TooltipProps } from '@consta/uikit/Tooltip';\nimport * as React from 'react';\n\nexport const navbarPropSize = ['s', 'm'] as const;\nexport type NavbarPropSize = (typeof navbarPropSize)[number];\nexport const defaultNavbarPropSize: NavbarPropSize = 'm';\n\nexport const navbarPropForm = ['default', 'brick', 'round'] as const;\nexport type NavbarPropForm = (typeof navbarPropForm)[number];\nexport const defaultNavbarPropForm = navbarPropForm[0];\n\nexport type DefaultNavbarGroup = {\n id: string | number;\n label?: string;\n rightSide?: React.ReactNode;\n};\n\nexport type DefaultNavbarItem = {\n label: string;\n status?: BadgePropStatus;\n groupId?: string | number;\n icon?: IconComponent;\n rightSide?: React.ReactNode;\n active?: boolean;\n subMenu?: DefaultNavbarItem[];\n};\n\nexport type DefaultNavbarRailItem = {\n label: string;\n icon: IconComponent;\n status?: BadgePropStatus;\n active?: boolean;\n tooltip?: React.ReactNode;\n};\n\nexport type NavbarPropOnItemClick<ITEM> = (\n item: ITEM,\n params: {\n e: React.MouseEvent;\n },\n) => void;\n\n// ITEMS\n\nexport type NavbarPropGetItemLabel<ITEM> = (item: ITEM) => string;\nexport type NavbarRailPropGetItemLabel<ITEM> = (\n item: ITEM,\n) => string | undefined;\n\nexport type NavbarPropGetItemAdditionalClassName<ITEM> = (item: ITEM) => string;\n\nexport type NavbarPropGetItemDisabled<ITEM> = (\n item: ITEM,\n) => boolean | undefined;\n\nexport type NavbarPropGetItemActive<ITEM> = (item: ITEM) => boolean | undefined;\n\nexport type NavbarPropGetItemGroupId<ITEM> = (\n item: ITEM,\n) => string | number | undefined;\n\nexport type NavbarPropGetItemLeftSide<ITEM> = (\n item: ITEM,\n) => React.ReactNode | undefined;\n\nexport type NavbarPropGetItemIcon<ITEM> = (\n item: ITEM,\n) => IconComponent | undefined;\n\nexport type NavbarRailPropGetItemIcon<ITEM> = (item: ITEM) => IconComponent;\n\nexport type NavbarPropGetItemRightSide<ITEM> = (\n item: ITEM,\n) => React.ReactNode | undefined;\n\nexport type NavbarPropGetItemRightIcon<ITEM> = (\n item: ITEM,\n) => IconComponent | undefined;\n\nexport type NavbarPropGetItemAs<ITEM> = (item: ITEM) => AsTags | undefined;\n\nexport type NavbarPropGetItemAttributes<ITEM> = (\n item: ITEM,\n) => AsAttributes | undefined;\n\nexport type NavbarPropSortGroup<ITEM, GROUP> = (\n a: Group<ITEM, GROUP>,\n b: Group<ITEM, GROUP>,\n) => number;\n\nexport type NavbarPropGetItemSubMenuOpen<ITEM> = (item: ITEM) => boolean;\n\nexport type NavbarPropOnSubMenuToggle<ITEM> = (\n item: ITEM,\n params: {\n open: boolean;\n e?: React.MouseEvent;\n },\n) => void;\n\n// GROUPS\nexport type NavbarPropGetGroupKey<GROUP> = (\n item: GROUP,\n) => string | number | undefined;\n\nexport type NavbarPropGetGroupAdditionalClassName<GROUP> = (\n item: GROUP,\n) => string;\n\nexport type NavbarPropGetGroupLabel<GROUP> = (\n item: GROUP,\n) => string | undefined;\nexport type NavbarPropGetGroupRightSide<GROUP> = (\n item: GROUP,\n) => React.ReactNode | undefined;\n\nexport type NavbarPropGetItemRef<ITEM> = (\n item: ITEM,\n) => React.RefObject<HTMLElement> | undefined;\n\nexport type NavbarPropGetItemStatus<ITEM> = (\n item: ITEM,\n) => BadgePropStatus | undefined;\n\nexport type NavbarPropGetItemSubMenu<ITEM> = (item: ITEM) => ITEM[] | undefined;\nexport type NavbarRailPropGetItemTooltip<ITEM> = (\n item: ITEM,\n) => React.ReactNode | undefined;\n\nexport type NavbarProps<\n ITEM = DefaultNavbarItem,\n GROUP = DefaultNavbarGroup,\n> = PropsWithHTMLAttributesAndRef<\n {\n items: ITEM[];\n size?: NavbarPropSize;\n form?: NavbarPropForm;\n onItemClick?: NavbarPropOnItemClick<ITEM>;\n getItemLabel?: NavbarPropGetItemLabel<ITEM>;\n getItemIcon?: NavbarPropGetItemIcon<ITEM>;\n getItemActive?: NavbarPropGetItemActive<ITEM>;\n getItemRightSide?: NavbarPropGetItemRightSide<ITEM>;\n getItemStatus?: NavbarPropGetItemStatus<ITEM>;\n getItemGroupKey?: NavbarPropGetItemGroupId<ITEM>;\n getItemAs?: NavbarPropGetItemAs<ITEM>;\n getItemAttributes?: NavbarPropGetItemAttributes<ITEM>;\n getItemRef?: NavbarPropGetItemRef<ITEM>;\n getItemSubMenu?: NavbarPropGetItemSubMenu<ITEM>;\n getItemAdditionalClassName?: NavbarPropGetItemAdditionalClassName<ITEM>;\n groups?: GROUP[];\n getGroupKey?: NavbarPropGetGroupKey<GROUP>;\n getGroupLabel?: NavbarPropGetGroupLabel<GROUP>;\n getGroupRightSide?: NavbarPropGetGroupRightSide<GROUP>;\n sortGroup?: NavbarPropSortGroup<ITEM, GROUP>;\n getGroupAdditionalClassName?: NavbarPropGetGroupAdditionalClassName<GROUP>;\n getItemSubMenuOpen?: NavbarPropGetItemSubMenuOpen<ITEM>;\n onSubMenuToggle?: NavbarPropOnSubMenuToggle<ITEM>;\n },\n HTMLDivElement\n> &\n (ITEM extends { label: DefaultNavbarItem['label'] }\n ? {}\n : { getItemLabel: NavbarPropGetItemLabel<ITEM> }) &\n (GROUP extends { id: DefaultNavbarGroup['id'] }\n ? {}\n : { getGroupKey: NavbarPropGetGroupKey<GROUP> });\n\nexport type NavbarComponent = <\n ITEM = DefaultNavbarItem,\n GROUP = DefaultNavbarGroup,\n>(\n props: NavbarProps<ITEM, GROUP>,\n) => React.ReactNode;\n\nexport type NavbarRailProps<ITEM = DefaultNavbarRailItem> =\n PropsWithHTMLAttributesAndRef<\n {\n items: ITEM[];\n size?: NavbarPropSize;\n form?: NavbarPropForm;\n onItemClick?: NavbarPropOnItemClick<ITEM>;\n getItemLabel?: NavbarRailPropGetItemLabel<ITEM>;\n getItemIcon?: NavbarRailPropGetItemIcon<ITEM>;\n getItemActive?: NavbarPropGetItemActive<ITEM>;\n getItemStatus?: NavbarPropGetItemStatus<ITEM>;\n getItemAs?: NavbarPropGetItemAs<ITEM>;\n getItemAttributes?: NavbarPropGetItemAttributes<ITEM>;\n getItemRef?: NavbarPropGetItemRef<ITEM>;\n getItemAdditionalClassName?: NavbarPropGetItemAdditionalClassName<ITEM>;\n getItemTooltip?: NavbarRailPropGetItemTooltip<ITEM>;\n tooltipProps?: Omit<\n TooltipProps,\n 'children' | 'position' | 'equalAnchorWidth' | 'anchorRef'\n >;\n },\n HTMLDivElement\n > &\n (ITEM extends { icon: DefaultNavbarRailItem['icon'] }\n ? {}\n : { getItemIcon: NavbarRailPropGetItemIcon<ITEM> });\n\nexport type NavbarRailComponent = <ITEM = DefaultNavbarRailItem>(\n props: NavbarRailProps<ITEM>,\n) => React.ReactNode;\n\nexport type NavbarItemProps<ITEM = DefaultNavbarItem> =\n PropsWithHTMLAttributesAndRef<\n {\n size: NavbarPropSize;\n item: ITEM;\n form: NavbarPropForm;\n onItemClick: NavbarPropOnItemClick<ITEM> | undefined;\n getItemLabel: NavbarPropGetItemLabel<ITEM>;\n getItemIcon: NavbarPropGetItemIcon<ITEM>;\n getItemActive: NavbarPropGetItemActive<ITEM>;\n getItemRightSide: NavbarPropGetItemRightSide<ITEM>;\n getItemStatus: NavbarPropGetItemStatus<ITEM> | undefined;\n getItemAs: NavbarPropGetItemAs<ITEM> | undefined;\n getItemAttributes: NavbarPropGetItemAttributes<ITEM> | undefined;\n getItemRef: NavbarPropGetItemRef<ITEM> | undefined;\n getItemSubMenu: NavbarPropGetItemSubMenu<ITEM> | undefined;\n getItemAdditionalClassName:\n | NavbarPropGetItemAdditionalClassName<ITEM>\n | undefined;\n level: number;\n getItemSubMenuOpen: NavbarPropGetItemSubMenuOpen<ITEM> | undefined;\n onSubMenuToggle: NavbarPropOnSubMenuToggle<ITEM> | undefined;\n },\n HTMLDivElement\n >;\n\nexport type NavbarItemComponent = <ITEM = DefaultNavbarItem>(\n props: NavbarItemProps<ITEM>,\n) => React.ReactNode;\n\nexport type NavbarRailItemProps = PropsWithHTMLAttributesAndRef<\n {\n size?: NavbarPropSize;\n form?: NavbarPropForm;\n icon?: IconComponent;\n active?: boolean;\n status?: BadgePropStatus;\n label?: string;\n },\n HTMLDivElement\n>;\n"],"mappings":"AAWA,MAAO,MAAM,CAAAA,cAAc,CAAG,CAAC,GAAG,CAAE,GAAG,CAAU,CAEjD,MAAO,MAAM,CAAAC,qBAAqC,CAAG,GAAG,CAExD,MAAO,MAAM,CAAAC,cAAc,CAAG,CAAC,SAAS,CAAE,OAAO,CAAE,OAAO,CAAU,CAEpE,MAAO,MAAM,CAAAC,qBAAqB,CAAGD,cAAc,CAAC,CAAC,CAAC"}
|
|
@@ -1,17 +1,16 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { ButtonMenuDefaultItem, NotificationsActionsPropGetItemIcon, NotificationsActionsPropGetItemLabel, NotificationsActionsPropGetItemOnClick, NotificationsActionsProps } from './types';
|
|
3
2
|
export declare function withDefaultGetters<ITEM>(props: NotificationsActionsProps<ITEM>): {
|
|
4
3
|
items?: ITEM[] | undefined;
|
|
5
|
-
mainButtonOnlyIcon?: boolean
|
|
6
|
-
opened?: boolean
|
|
7
|
-
onOpen?: (
|
|
4
|
+
mainButtonOnlyIcon?: boolean;
|
|
5
|
+
opened?: boolean;
|
|
6
|
+
onOpen?: (value: boolean) => void;
|
|
8
7
|
onItemClick?: import("./types").NotificationsActionsOnItemClick<ITEM> | undefined;
|
|
9
8
|
} & Omit<import("react").HTMLAttributes<HTMLButtonElement>, "css" | "items" | "onItemClick" | "opened" | "onOpen" | "mainButtonOnlyIcon"> & {
|
|
10
9
|
getItemLabel?: NotificationsActionsPropGetItemLabel<ITEM> | undefined;
|
|
11
10
|
getItemOnClick?: NotificationsActionsPropGetItemOnClick<ITEM> | undefined;
|
|
12
11
|
getItemIcon?: NotificationsActionsPropGetItemIcon<ITEM> | undefined;
|
|
13
12
|
} & (ITEM extends {
|
|
14
|
-
label:
|
|
13
|
+
label: ButtonMenuDefaultItem["label"];
|
|
15
14
|
} ? {} : {
|
|
16
15
|
getItemLabel: NotificationsActionsPropGetItemLabel<ITEM>;
|
|
17
16
|
}) & {
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { IconComponent } from '@consta/icons/Icon';
|
|
3
|
-
import { PropsWithHTMLAttributes } from
|
|
2
|
+
import { PropsWithHTMLAttributes } from '@consta/uikit/__internal__/src/utils/types/PropsWithHTMLAttributes';
|
|
4
3
|
export type ButtonMenuDefaultItem = {
|
|
5
4
|
label: string;
|
|
6
5
|
onClick?: React.EventHandler<React.MouseEvent>;
|
|
@@ -27,4 +26,4 @@ export type NotificationsActionsProps<ITEM = ButtonMenuDefaultItem> = PropsWithH
|
|
|
27
26
|
} ? {} : {
|
|
28
27
|
getItemLabel: NotificationsActionsPropGetItemLabel<ITEM>;
|
|
29
28
|
});
|
|
30
|
-
export type NotificationsActionsComponent = <ITEM = ButtonMenuDefaultItem>(props: NotificationsActionsProps<ITEM>) => React.
|
|
29
|
+
export type NotificationsActionsComponent = <ITEM = ButtonMenuDefaultItem>(props: NotificationsActionsProps<ITEM>) => React.ReactNode;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","names":[],"sources":["../../../../../../src/components/Notifications/NotificationsActions/types.ts"],"sourcesContent":["import { IconComponent } from '@consta/icons/Icon';\
|
|
1
|
+
{"version":3,"file":"types.js","names":[],"sources":["../../../../../../src/components/Notifications/NotificationsActions/types.ts"],"sourcesContent":["import { IconComponent } from '@consta/icons/Icon';\nimport { PropsWithHTMLAttributes } from '@consta/uikit/__internal__/src/utils/types/PropsWithHTMLAttributes';\n\nexport type ButtonMenuDefaultItem = {\n label: string;\n onClick?: React.EventHandler<React.MouseEvent>;\n icon?: IconComponent;\n};\n\nexport type NotificationsActionsPropGetItemLabel<ITEM> = (item: ITEM) => string;\nexport type NotificationsActionsPropGetItemIcon<ITEM> = (\n item: ITEM,\n) => IconComponent | undefined;\nexport type NotificationsActionsPropGetItemOnClick<ITEM> = (\n item: ITEM,\n) => React.EventHandler<React.MouseEvent> | undefined;\n\nexport type NotificationsActionsOnItemClick<ITEM> = (\n item: ITEM,\n props: {\n e: React.MouseEvent;\n },\n) => void;\n\nexport type NotificationsActionsProps<ITEM = ButtonMenuDefaultItem> =\n PropsWithHTMLAttributes<\n {\n items?: ITEM[];\n mainButtonOnlyIcon?: boolean;\n opened?: boolean;\n onOpen?: (value: boolean) => void;\n onItemClick?: NotificationsActionsOnItemClick<ITEM>;\n },\n HTMLButtonElement\n > & {\n getItemLabel?: NotificationsActionsPropGetItemLabel<ITEM>;\n getItemOnClick?: NotificationsActionsPropGetItemOnClick<ITEM>;\n getItemIcon?: NotificationsActionsPropGetItemIcon<ITEM>;\n } & (ITEM extends { label: ButtonMenuDefaultItem['label'] }\n ? {}\n : { getItemLabel: NotificationsActionsPropGetItemLabel<ITEM> });\n\nexport type NotificationsActionsComponent = <ITEM = ButtonMenuDefaultItem>(\n props: NotificationsActionsProps<ITEM>,\n) => React.ReactNode;\n"],"mappings":""}
|
|
@@ -2,5 +2,5 @@ import './NotificationsItem.css';
|
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { NotificationsItemProps } from './types';
|
|
4
4
|
export declare const cnNotificationsItem: import("@bem-react/classname").ClassNameFormatter;
|
|
5
|
-
export declare const NotificationsItem: React.ForwardRefExoticComponent<
|
|
5
|
+
export declare const NotificationsItem: React.ForwardRefExoticComponent<Omit<NotificationsItemProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
6
6
|
export * from './types';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { IconProps } from '@consta/icons/Icon';
|
|
2
|
+
import { PropsWithHTMLAttributesAndRef } from '@consta/uikit/__internal__/src/utils/types/PropsWithHTMLAttributes';
|
|
2
3
|
import { BadgePropStatus } from '@consta/uikit/Badge';
|
|
3
4
|
import React from 'react';
|
|
4
|
-
import { PropsWithHTMLAttributesAndRef } from "../../../utils/types/PropsWithHTMLAttributes";
|
|
5
5
|
export type NotificationsItemAction = {
|
|
6
6
|
label: string;
|
|
7
7
|
onClick?: React.EventHandler<React.MouseEvent>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","names":[],"sources":["../../../../../../src/components/Notifications/NotificationsItem/types.ts"],"sourcesContent":["import { IconProps } from '@consta/icons/Icon';\nimport {
|
|
1
|
+
{"version":3,"file":"types.js","names":[],"sources":["../../../../../../src/components/Notifications/NotificationsItem/types.ts"],"sourcesContent":["import { IconProps } from '@consta/icons/Icon';\nimport { PropsWithHTMLAttributesAndRef } from '@consta/uikit/__internal__/src/utils/types/PropsWithHTMLAttributes';\nimport { BadgePropStatus } from '@consta/uikit/Badge';\nimport React from 'react';\n\nexport type NotificationsItemAction = {\n label: string;\n onClick?: React.EventHandler<React.MouseEvent>;\n icon?: React.FC<IconProps>;\n};\n\nexport type NotificationsItemBadge = {\n label: string;\n status?: BadgePropStatus;\n};\n\nexport type NotificationsItemProps = PropsWithHTMLAttributesAndRef<\n {\n title: string;\n description?: string;\n imageUrl?: string;\n read?: boolean;\n date?: Date;\n dateFormat?: (date: Date) => string;\n badges?: NotificationsItemBadge[];\n actions?: NotificationsItemAction[];\n onClick?: React.EventHandler<React.MouseEvent>;\n children?: never;\n view?: 'user' | 'default';\n actionsMenuOpened?: boolean;\n },\n HTMLDivElement\n>;\n"],"mappings":""}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import { PropsWithHTMLAttributesAndRef } from '@consta/uikit/__internal__/src/utils/types/PropsWithHTMLAttributes';
|
|
1
2
|
import { BadgePropStatus } from '@consta/uikit/Badge';
|
|
2
|
-
import { PropsWithHTMLAttributesAndRef } from "../../../utils/types/PropsWithHTMLAttributes";
|
|
3
3
|
export type NotificationsItemBadge = {
|
|
4
4
|
label: string;
|
|
5
5
|
status?: BadgePropStatus;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","names":[],"sources":["../../../../../../src/components/Notifications/NotificationsItemFooter/types.ts"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"types.js","names":[],"sources":["../../../../../../src/components/Notifications/NotificationsItemFooter/types.ts"],"sourcesContent":["import { PropsWithHTMLAttributesAndRef } from '@consta/uikit/__internal__/src/utils/types/PropsWithHTMLAttributes';\nimport { BadgePropStatus } from '@consta/uikit/Badge';\n\nexport type NotificationsItemBadge = {\n label: string;\n status?: BadgePropStatus;\n};\n\nexport type NotificationsItemFooterProps = PropsWithHTMLAttributesAndRef<\n {\n date?: Date;\n dateFormat?: (date: Date) => string;\n badges?: NotificationsItemBadge[];\n children?: never;\n },\n HTMLDivElement\n>;\n"],"mappings":""}
|
|
@@ -1,63 +1,6 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { NotificationsItemAction } from '../NotificationsItem';
|
|
3
2
|
import { NotificationsListDefaultGroup, NotificationsListDefaultItem, NotificationsListPropGetActionIcon, NotificationsListPropGetActionLabel, NotificationsListPropGetActionOnClick, NotificationsListPropGetGroupId, NotificationsListPropGetGroupLabel, NotificationsListPropGetItemActions, NotificationsListPropGetItemBadges, NotificationsListPropGetItemDate, NotificationsListPropGetItemDescription, NotificationsListPropGetItemGroup, NotificationsListPropGetItemImage, NotificationsListPropGetItemLabel, NotificationsListPropGetItemRead, NotificationsListPropGetItemView, NotificationsListPropGroupLabelFormat, NotificationsListProps } from './types';
|
|
4
|
-
export declare function withDefaultGetters<ITEM, GROUP, ACTION>(props: NotificationsListProps<ITEM, GROUP, ACTION>): {
|
|
5
|
-
children?: undefined;
|
|
6
|
-
items: ITEM[];
|
|
7
|
-
itemDateFormat?: import("./types").NotificationsListPropItemDateFormat | undefined;
|
|
8
|
-
title?: string | undefined;
|
|
9
|
-
actions?: ACTION[] | undefined;
|
|
10
|
-
getItemLabel?: NotificationsListPropGetItemLabel<ITEM> | undefined;
|
|
11
|
-
getItemDescription?: NotificationsListPropGetItemDescription<ITEM> | undefined;
|
|
12
|
-
getItemImage?: NotificationsListPropGetItemImage<ITEM> | undefined;
|
|
13
|
-
getItemRead?: NotificationsListPropGetItemRead<ITEM> | undefined;
|
|
14
|
-
getItemDate?: NotificationsListPropGetItemDate<ITEM> | undefined;
|
|
15
|
-
getItemBadges?: NotificationsListPropGetItemBadges<ITEM> | undefined;
|
|
16
|
-
getItemActions?: NotificationsListPropGetItemActions<ITEM> | undefined;
|
|
17
|
-
getItemGroup?: NotificationsListPropGetItemGroup<ITEM> | undefined;
|
|
18
|
-
getItemView?: NotificationsListPropGetItemView<ITEM> | undefined;
|
|
19
|
-
getActionLabel?: NotificationsListPropGetActionLabel<ACTION> | undefined;
|
|
20
|
-
getActionIcon?: NotificationsListPropGetActionIcon<ACTION> | undefined;
|
|
21
|
-
getActionOnClick?: NotificationsListPropGetActionOnClick<ACTION> | undefined;
|
|
22
|
-
getGroupLabel?: NotificationsListPropGetGroupLabel<GROUP> | undefined;
|
|
23
|
-
getGroupId?: NotificationsListPropGetGroupId<GROUP> | undefined;
|
|
24
|
-
groupByDay?: false | undefined;
|
|
25
|
-
groupLabelFormat?: undefined;
|
|
26
|
-
groups?: GROUP[] | undefined;
|
|
27
|
-
onClose?: ((event: import("react").MouseEvent<Element, MouseEvent>) => void) | undefined;
|
|
28
|
-
} & (ACTION extends {
|
|
29
|
-
label: string;
|
|
30
|
-
} ? {} : {
|
|
31
|
-
getActionLabel: NotificationsListPropGetItemActions<ACTION>;
|
|
32
|
-
}) & (GROUP extends {
|
|
33
|
-
label: string;
|
|
34
|
-
} ? {} : {
|
|
35
|
-
getGroupLabel: NotificationsListPropGetGroupLabel<GROUP>;
|
|
36
|
-
}) & (GROUP extends {
|
|
37
|
-
id: string;
|
|
38
|
-
} ? {} : {
|
|
39
|
-
getGroupId: NotificationsListPropGetGroupId<GROUP>;
|
|
40
|
-
}) & (ITEM extends {
|
|
41
|
-
label: string;
|
|
42
|
-
} ? {} : {
|
|
43
|
-
getItemLabel: NotificationsListPropGetItemLabel<ITEM>;
|
|
44
|
-
}) & Omit<import("react").HTMLAttributes<HTMLDivElement>, "css" | "title" | "children" | "items" | "getItemLabel" | "onClose" | "getItemDescription" | "getItemImage" | "groups" | "getGroupLabel" | "getGroupId" | "getItemGroup" | "getItemView" | "actions" | "itemDateFormat" | "getItemRead" | "getItemDate" | "getItemBadges" | "getItemActions" | "getActionLabel" | "getActionIcon" | "getActionOnClick" | "groupByDay" | "groupLabelFormat" | keyof (ACTION extends {
|
|
45
|
-
label: string;
|
|
46
|
-
} ? {} : {
|
|
47
|
-
getActionLabel: NotificationsListPropGetItemActions<ACTION>;
|
|
48
|
-
}) | keyof (GROUP extends {
|
|
49
|
-
label: string;
|
|
50
|
-
} ? {} : {
|
|
51
|
-
getGroupLabel: NotificationsListPropGetGroupLabel<GROUP>;
|
|
52
|
-
}) | keyof (GROUP extends {
|
|
53
|
-
id: string;
|
|
54
|
-
} ? {} : {
|
|
55
|
-
getGroupId: NotificationsListPropGetGroupId<GROUP>;
|
|
56
|
-
}) | keyof (ITEM extends {
|
|
57
|
-
label: string;
|
|
58
|
-
} ? {} : {
|
|
59
|
-
getItemLabel: NotificationsListPropGetItemLabel<ITEM>;
|
|
60
|
-
})> & {
|
|
3
|
+
export declare function withDefaultGetters<ITEM, GROUP, ACTION>(props: NotificationsListProps<ITEM, GROUP, ACTION>): import("react").PropsWithoutRef<import("./types").Props<ITEM, GROUP, ACTION, false>> & Omit<import("react").HTMLAttributes<HTMLDivElement>, "css" | keyof import("react").PropsWithoutRef<import("./types").Props<ITEM, GROUP, ACTION, false>>> & {
|
|
61
4
|
getActionIcon: NotificationsListPropGetActionIcon<NotificationsItemAction> | NotificationsListPropGetActionIcon<ACTION>;
|
|
62
5
|
getActionLabel: NotificationsListPropGetActionLabel<NotificationsItemAction> | NotificationsListPropGetActionLabel<ACTION>;
|
|
63
6
|
getActionOnClick: NotificationsListPropGetActionOnClick<NotificationsItemAction> | NotificationsListPropGetActionOnClick<ACTION>;
|
|
@@ -72,7 +15,7 @@ export declare function withDefaultGetters<ITEM, GROUP, ACTION>(props: Notificat
|
|
|
72
15
|
getItemLabel: NotificationsListPropGetItemLabel<NotificationsListDefaultItem> | NotificationsListPropGetItemLabel<ITEM>;
|
|
73
16
|
getItemRead: NotificationsListPropGetItemRead<NotificationsListDefaultItem> | NotificationsListPropGetItemRead<ITEM>;
|
|
74
17
|
getItemView: NotificationsListPropGetItemView<NotificationsListDefaultItem> | NotificationsListPropGetItemView<ITEM>;
|
|
75
|
-
ref?: import("react").
|
|
18
|
+
ref?: import("react").LegacyRef<HTMLDivElement> | undefined;
|
|
76
19
|
key?: import("react").Key | null | undefined;
|
|
77
20
|
};
|
|
78
21
|
type ReturnedGroup<ITEM, GROUP> = {
|
|
@@ -83,5 +26,5 @@ type ReturnedGroup<ITEM, GROUP> = {
|
|
|
83
26
|
};
|
|
84
27
|
export declare const noGroupKey = "no-group";
|
|
85
28
|
export declare const defaultGroupLabelFormat: NotificationsListPropGroupLabelFormat<true>;
|
|
86
|
-
export declare const getGroups: <ITEM, GROUP>(items: ITEM[], groups: GROUP[] | undefined, groupByDay: boolean, getItemGroup: NotificationsListPropGetItemGroup<ITEM>, getItemDate: NotificationsListPropGetItemDate<ITEM>, getGroupId: NotificationsListPropGetGroupId<GROUP>) => ReturnedGroup<ITEM, GROUP
|
|
29
|
+
export declare const getGroups: <ITEM, GROUP>(items: ITEM[], groups: GROUP[] | undefined, groupByDay: boolean, getItemGroup: NotificationsListPropGetItemGroup<ITEM>, getItemDate: NotificationsListPropGetItemDate<ITEM>, getGroupId: NotificationsListPropGetGroupId<GROUP>) => Array<ReturnedGroup<ITEM, GROUP>>;
|
|
87
30
|
export {};
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { IconProps } from '@consta/icons/Icon';
|
|
3
|
-
import { PropsWithHTMLAttributesAndRef } from
|
|
2
|
+
import { PropsWithHTMLAttributesAndRef } from '@consta/uikit/__internal__/src/utils/types/PropsWithHTMLAttributes';
|
|
4
3
|
import { NotificationsItemAction, NotificationsItemBadge } from '../NotificationsItem';
|
|
5
4
|
export type NotificationsListDefaultGroup = {
|
|
6
5
|
label: string;
|
|
@@ -76,4 +75,4 @@ export type Props<ITEM, GROUP, ACTION, GROUP_BY_DAY extends boolean> = {
|
|
|
76
75
|
getItemLabel: NotificationsListPropGetItemLabel<ITEM>;
|
|
77
76
|
});
|
|
78
77
|
export type NotificationsListProps<ITEM = NotificationsListDefaultItem, GROUP = NotificationsListDefaultGroup, ACTION = NotificationsItemAction, GROUP_BY_DAY extends boolean = false> = PropsWithHTMLAttributesAndRef<Props<ITEM, GROUP, ACTION, GROUP_BY_DAY>, HTMLDivElement>;
|
|
79
|
-
export type NotificationsListComponent = <ITEM = NotificationsListDefaultItem, GROUP = NotificationsListDefaultGroup, ACTION = NotificationsItemAction, GROUP_BY_DAY extends boolean = false>(props: NotificationsListProps<ITEM, GROUP, ACTION, GROUP_BY_DAY>) => React.
|
|
78
|
+
export type NotificationsListComponent = <ITEM = NotificationsListDefaultItem, GROUP = NotificationsListDefaultGroup, ACTION = NotificationsItemAction, GROUP_BY_DAY extends boolean = false>(props: NotificationsListProps<ITEM, GROUP, ACTION, GROUP_BY_DAY>) => React.ReactNode;
|