@openfin/ui-library 0.27.4 → 0.27.5-alpha.1731710970

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.
@@ -4,6 +4,7 @@ export interface ContentMenuColumnProps {
4
4
  entries: ContentMenuEntry[];
5
5
  depth: number;
6
6
  path: string[];
7
+ targetItemId: string | undefined;
7
8
  setCurrentlySelectedPath: Dispatch<SetStateAction<string[]>>;
8
9
  handleClickItem: (entry: ContentMenuEntry) => void;
9
10
  handleBookmarkItem: (entry: ContentMenuEntry) => void;
package/dist/index.js CHANGED
@@ -245,7 +245,7 @@ var e={8594:(e,t,n)=>{n.d(t,{Z:()=>o});var r=/^((children|dangerouslySetInnerHTM
245
245
  opacity: unset;
246
246
  }
247
247
  }
248
- `},4925: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.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),o(n(4021),t),o(n(9644),t)},9654: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.ContentMenu=t.findPathToItemWithId=void 0;const o=n(5893),i=n(6689),a=n(3137),l=r(n(7518)),c=n(1335);t.findPathToItemWithId=(e,n,r)=>{if(e.id===r)return n.pop(),n;if(e.children)for(let o=0;o<e.children.length;++o){const i=e.children[o];n.push(i.id);const a=(0,t.findPathToItemWithId)(i,n,r);if(a)return a;n.pop()}},t.ContentMenu=({structure:e,handleClickItem:n,handleBookmarkItem:r,targetId:l})=>{const[c,s]=(0,i.useState)([]),[f,d]=(0,i.useState)();return(0,i.useEffect)((()=>{if(l){const n=(0,t.findPathToItemWithId)({id:"",children:e},[],l);n&&(s(n),d(`content-menu-item-${l}`))}}),[l]),(0,i.useEffect)((()=>{var e;f&&(null===(e=document.getElementById(f))||void 0===e||e.scrollIntoView({behavior:"smooth"}))}),[f]),(0,o.jsx)(u,{children:(0,o.jsx)(a.ContentMenuColumn,{entries:e,depth:0,path:c,setCurrentlySelectedPath:s,handleClickItem:n,handleBookmarkItem:r})})};const u=(0,l.default)(c.Box)`
248
+ `},4925: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.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),o(n(4021),t),o(n(9644),t)},9654: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.ContentMenu=t.findPathToItemWithId=void 0;const o=n(5893),i=n(6689),a=n(3137),l=r(n(7518)),c=n(1335);t.findPathToItemWithId=(e,n,r)=>{if(e.id===r)return n;if(e.children)for(let o=0;o<e.children.length;++o){const i=e.children[o];n.push(i.id);const a=(0,t.findPathToItemWithId)(i,n,r);if(a)return a;n.pop()}},t.ContentMenu=({structure:e,handleClickItem:n,handleBookmarkItem:r,targetId:l})=>{const[c,s]=(0,i.useState)([]),[f,d]=(0,i.useState)(),p=(0,i.useRef)(null),h=(0,i.useCallback)((()=>{p.current&&p.current.scrollTo({left:p.current.scrollWidth,behavior:"smooth"})}),[]);return(0,i.useEffect)((()=>{if(l){const n=(0,t.findPathToItemWithId)({id:"",children:e},[],l);if(n)return s(n),void d(`content-menu-item-${l}`)}d(void 0)}),[l]),(0,i.useEffect)((()=>{h()}),[c]),(0,o.jsx)(u,Object.assign({ref:p},{children:(0,o.jsx)(a.ContentMenuColumn,{entries:e,depth:0,path:c,targetItemId:f,setCurrentlySelectedPath:s,handleClickItem:n,handleBookmarkItem:r})}))};const u=(0,l.default)(c.Box)`
249
249
  height: 100%;
250
250
  width: 100%;
251
251
 
@@ -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: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)`
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,targetItemId:i,setCurrentlySelectedPath:a,handleClickItem:f,handleBookmarkItem:d})=>{const p=(0,l.useRef)(null),h=r[n],C=h?e.find((e=>e.id===h)):void 0;(0,l.useEffect)((()=>{if(i&&C){const e=document.getElementById(`content-menu-item-${C.id}`);if(e&&p.current){const t=e.getBoundingClientRect().top-p.current.children[0].getBoundingClientRect().top;p.current.scrollTo({top:t,behavior:"smooth"})}}}),[i]);const v=(0,l.useCallback)((e=>{a((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:p},{children:e.length>0?(0,o.jsx)("div",{children:e.map((e=>(0,o.jsx)(c.ContentMenuItem,{entry:e,active:"folder"===e.type&&e.id===h,handleClick:e=>{"folder"===e.type?v(e.id):f(e)},handleBookmark:d},e.id)))}):(0,o.jsx)(s,{children:"No content available."})})),C&&"folder"===C.type&&(0,o.jsx)(t.ContentMenuColumn,{entries:C.children,depth:n+1,path:r,targetItemId:i,setCurrentlySelectedPath:a,handleClickItem:f,handleBookmarkItem:d})]})};const u=(0,i.default)(a.MenuFrame)`
258
258
  height: 100%;
259
259
  width: 241px;
260
260
  padding: ${({theme:e})=>e.px.xsmall};
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.4",
4
+ "version": "0.27.5-alpha.1731710970",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "repository": "github:openfin/ui-library",