@openfin/ui-library 0.27.3-alpha.1731433592 → 0.27.3-alpha.1731443979

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.
@@ -21,11 +21,11 @@ export interface ContentMenuProps {
21
21
  /**
22
22
  * Callback to handle a click on a content menu item.
23
23
  */
24
- handleClickItem: (id: string) => void;
24
+ handleClickItem: (entry: ContentMenuEntry) => void;
25
25
  /**
26
26
  * Callback to handle a click on the bookmark icon of a content menu item.
27
27
  */
28
- handleBookmarkItem: (id: string) => void;
28
+ handleBookmarkItem: (entry: ContentMenuEntry) => void;
29
29
  /**
30
30
  * The ID of the target content menu item to search for and be navigated to within the content menu.
31
31
  */
@@ -5,7 +5,7 @@ export interface ContentMenuColumnProps {
5
5
  depth: number;
6
6
  path: string[];
7
7
  setCurrentlySelectedPath: Dispatch<SetStateAction<string[]>>;
8
- handleClickItem: (id: string) => void;
9
- handleBookmarkItem: (id: string) => void;
8
+ handleClickItem: (entry: ContentMenuEntry) => void;
9
+ handleBookmarkItem: (entry: ContentMenuEntry) => void;
10
10
  }
11
11
  export declare const ContentMenuColumn: React.FC<PropsWithChildren<ContentMenuColumnProps>>;
@@ -13,10 +13,10 @@ export interface ContentMenuItemProps {
13
13
  /**
14
14
  * Callback to handle a click on the content menu item.
15
15
  */
16
- handleClick: (id: string) => void;
16
+ handleClick: (entry: ContentMenuEntry) => void;
17
17
  /**
18
18
  * Callback to handle a click on the bookmark icon of the content menu item.
19
19
  */
20
- handleBookmark?: (id: string) => void;
20
+ handleBookmark?: (entry: ContentMenuEntry) => void;
21
21
  }
22
22
  export declare const ContentMenuItem: React.FC<ContentMenuItemProps>;
package/dist/index.js CHANGED
@@ -254,7 +254,7 @@ var e={8594:(e,t,n)=>{n.d(t,{Z:()=>o});var r=/^((children|dangerouslySetInnerHTM
254
254
 
255
255
  overflow-x: auto;
256
256
  overflow-y: hidden;
257
- `},3137:function(e,t,n){var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.ContentMenuColumn=void 0;const o=n(5893),i=r(n(7518)),a=n(6758),l=n(6689),c=n(2659);t.ContentMenuColumn=({entries:e,depth:n,path:r,setCurrentlySelectedPath:i,handleClickItem:a,handleBookmarkItem:f})=>{const d=(0,l.useRef)(null),p=r[n],h=p?e.find((e=>e.id===p)):void 0;(0,l.useEffect)((()=>{var e;p||null===(e=d.current)||void 0===e||e.scrollIntoView({behavior:"smooth"})}),[]);const C=(0,l.useCallback)((e=>{i((t=>e?(t[n]=e,t.slice(0,n+1)):t.slice(0,n)))}),[]);return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(u,Object.assign({ref:d},{children:e.length>0?(0,o.jsx)("div",{children:e.map((e=>(0,o.jsx)(c.ContentMenuItem,{entry:e,active:e.id===p,handleClick:t=>{"folder"===e.type?C(t):a(t)},handleBookmark:f},e.id)))}):(0,o.jsx)(s,{children:"No content available."})})),h&&"folder"===h.type&&(0,o.jsx)(t.ContentMenuColumn,{entries:h.children,depth:n+1,path:r,setCurrentlySelectedPath:i,handleClickItem:a,handleBookmarkItem:f})]})};const u=(0,i.default)(a.MenuFrame)`
257
+ `},3137:function(e,t,n){var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.ContentMenuColumn=void 0;const o=n(5893),i=r(n(7518)),a=n(6758),l=n(6689),c=n(2659);t.ContentMenuColumn=({entries:e,depth:n,path:r,setCurrentlySelectedPath:i,handleClickItem:a,handleBookmarkItem:f})=>{const d=(0,l.useRef)(null),p=r[n],h=p?e.find((e=>e.id===p)):void 0;(0,l.useEffect)((()=>{var e;p||null===(e=d.current)||void 0===e||e.scrollIntoView({behavior:"smooth"})}),[]);const C=(0,l.useCallback)((e=>{i((t=>e?(t[n]=e,t.slice(0,n+1)):t.slice(0,n)))}),[]);return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(u,Object.assign({ref:d},{children:e.length>0?(0,o.jsx)("div",{children:e.map((e=>(0,o.jsx)(c.ContentMenuItem,{entry:e,active:e.id===p,handleClick:e=>{"folder"===e.type?C(e.id):a(e)},handleBookmark:f},e.id)))}):(0,o.jsx)(s,{children:"No content available."})})),h&&"folder"===h.type&&(0,o.jsx)(t.ContentMenuColumn,{entries:h.children,depth:n+1,path:r,setCurrentlySelectedPath:i,handleClickItem:a,handleBookmarkItem:f})]})};const u=(0,i.default)(a.MenuFrame)`
258
258
  height: 100%;
259
259
  width: 241px;
260
260
  padding: ${({theme:e})=>e.px.xsmall};
@@ -272,7 +272,7 @@ var e={8594:(e,t,n)=>{n.d(t,{Z:()=>o});var r=/^((children|dangerouslySetInnerHTM
272
272
  align-items: center;
273
273
 
274
274
  user-select: none;
275
- `},2659:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return o(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.ContentMenuItem=void 0;const a=n(5893),l=i(n(7518)),c=n(6758),u=n(9634),s=n(1009);t.ContentMenuItem=({entry:e,active:t,handleClick:n,handleBookmark:r})=>{const{label:o,type:i}=e;return(0,a.jsxs)(p,Object.assign({id:`content-menu-item-${e.id}`,onClick:()=>n(e.id),active:t},{children:["item"===i&&(0,a.jsx)(s.IconWithFallback,{iconUrl:e.icon}),(0,a.jsx)(f,Object.assign({size:"base",weight:"normal"},{children:o})),(0,a.jsx)(d,Object.assign({side:"right",bookmarked:e.bookmarked,onClick:t=>{null==t||t.stopPropagation(),r&&r(e.id)},"data-testid":`content-menu-item-${e.id}-bookmark-icon`},{children:e.bookmarked?(0,a.jsx)(u.Icon,{icon:"StarFilledIcon"}):(0,a.jsx)(u.Icon,{icon:"StarIcon"})})),"folder"===i&&(0,a.jsx)(c.MenuItemIconContainer,Object.assign({side:"right","data-testid":`content-menu-item-${e.id}-chevron-icon`},{children:(0,a.jsx)(c.MenuItemRightIcon,{icon:"ChevronRightIcon"})}))]}))};const f=(0,l.default)(c.MenuItemText)`
275
+ `},2659:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return o(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.ContentMenuItem=void 0;const a=n(5893),l=i(n(7518)),c=n(6758),u=n(9634),s=n(1009);t.ContentMenuItem=({entry:e,active:t,handleClick:n,handleBookmark:r})=>{const{label:o,type:i}=e;return(0,a.jsxs)(p,Object.assign({id:`content-menu-item-${e.id}`,onClick:()=>n(e),active:t},{children:["item"===i&&(0,a.jsx)(s.IconWithFallback,{iconUrl:e.icon}),(0,a.jsx)(f,Object.assign({size:"base",weight:"normal"},{children:o})),(0,a.jsx)(d,Object.assign({side:"right",bookmarked:e.bookmarked,onClick:t=>{null==t||t.stopPropagation(),r&&r(e)},"data-testid":`content-menu-item-${e.id}-bookmark-icon`},{children:e.bookmarked?(0,a.jsx)(u.Icon,{icon:"StarFilledIcon"}):(0,a.jsx)(u.Icon,{icon:"StarIcon"})})),"folder"===i&&(0,a.jsx)(c.MenuItemIconContainer,Object.assign({side:"right","data-testid":`content-menu-item-${e.id}-chevron-icon`},{children:(0,a.jsx)(c.MenuItemRightIcon,{icon:"ChevronRightIcon"})}))]}))};const f=(0,l.default)(c.MenuItemText)`
276
276
  padding-right: ${({theme:e})=>e.px.large};
277
277
  `,d=(0,l.default)(c.MenuItemIconContainer)`
278
278
  ${({bookmarked:e})=>e?l.css`
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@openfin/ui-library",
3
3
  "description": "OpenFin UI Component Library",
4
- "version": "0.27.3-alpha.1731433592",
4
+ "version": "0.27.3-alpha.1731443979",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "repository": "github:openfin/ui-library",