@openfin/ui-library 0.25.1 → 0.25.2-alpha.1716989898
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/dist/index.js +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -270,7 +270,7 @@ var e={8594:(e,t,n)=>{n.d(t,{Z:()=>o});var r=/^((children|dangerouslySetInnerHTM
|
|
|
270
270
|
&:hover {
|
|
271
271
|
color: ${({theme:e})=>e.palette.textDefault};
|
|
272
272
|
}
|
|
273
|
-
`},9501: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(9318),t)},4740:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.useContextMenuKeyboardNavigation=void 0;const r=n(6689),o=n(9318);t.useContextMenuKeyboardNavigation=(e,t,n,i,a,l,c,u,s)=>{const f=t=>{var n,r,o;return"separator"===(null===(n=e[t])||void 0===n?void 0:n.type)||!1===(null===(r=e[t])||void 0===r?void 0:r.enabled)||!1===(null===(o=e[t])||void 0===o?void 0:o.visible)},d=(0,r.useCallback)((()=>{a((t=>{let n=t;do{if(n===(null==e?void 0:e.length)-1)break;n+=1}while(f(n));return f(n)?t:n}))}),[a,e]),p=(0,r.useCallback)((()=>{a((e=>{let t=e;do{if(n===o.BASE_CONTEXT_MENU&&0===t||-1===t)break;t-=1}while(f(t));return t}))}),[a,e]),C=(0,r.useCallback)((()=>{a(n===o.BASE_CONTEXT_MENU?0:-1)}),[a,n]),h=(0,r.useCallback)((()=>{a((t=>{for(let n=e.length-1;n>=t;n--)if(!f(n))return n;return t}))}),[null==e?void 0:e.length,a]),v=(0,r.useCallback)((()=>{var t,r;if(null===(t=e[i])||void 0===t?void 0:t.hasSubMenu)c((null===(r=e[i])||void 0===r?void 0:r.label)||"");else{if(-1===i)return void u(n,"keyboard");l(e[i].data)}a(-1)}),[a,l,c,e,i,u,n]),g=(0,r.useCallback)((()=>{var t,n;(null===(t=e[i])||void 0===t?void 0:t.hasSubMenu)&&(c((null===(n=e[i])||void 0===n?void 0:n.label)||""),a(-1))}),[a,c,e,i]),m=(0,r.useCallback)((()=>{(t.slice(1).includes(n)||(null==t?void 0:t.length)>=1)&&u(n,"keyboard")}),[u,t,n]),b=(0,r.useCallback)((()=>{t.slice(2).includes(n)||(null==t?void 0:t.length)>=2?s():l({type:"close"})}),[s,t,n]);(0,r.useEffect)((()=>{const e=e=>{switch(e.key){case"ArrowDown":d();break;case"ArrowUp":p();break;case"Home":case"PageUp":C();break;case"End":case"PageDown":h();break;case"Enter":v();break;case"ArrowRight":g();break;case"ArrowLeft":m();break;case"Escape":b()}};return document.addEventListener("keydown",e),()=>{document.removeEventListener("keydown",e)}}),[d,p,C,h,v,g,m,b])}},4725:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.useContextMenuNavigation=void 0;const r=n(6689),o=n(9318);t.useContextMenuNavigation=(e,t,n,i,a,l,c,u,s)=>{const f=(0,r.useCallback)((e=>{const t=document.getElementById(e),n=null==t?void 0:t.getBoundingClientRect();return{height:(null==n?void 0:n.height)||0,width:(null==n?void 0:n.width)||0}}),[]);return{handleNavigateToSubmenu:(0,r.useCallback)((r=>{if(s){const{height:e,width:t}=f(r);s(e,t)}e||t(o.CONTEXT_MENU_ANIMATION_DURATION),l(r),i([...n,a])}),[a,n,i,s,t,f]),handleNavigateBackToParent:(0,r.useCallback)(((e,t="click")=>{if(s){const e=1===n.length?o.BASE_CONTEXT_MENU:n[n.length-1],{height:t,width:r}=f(e);s(t,r)}const r=n,a=r.pop(),d=u.find((e=>e.parentLabel===a));l(a),i(r),c("keyboard"===t?(null==d?void 0:d.menuTemplate.findIndex((t=>t.label===e)))||0:-1)}),[n,i,c,f,s,u]),handleNavigateToBase:(0,r.useCallback)((()=>{if(s){const{height:e,width:t}=f(o.BASE_CONTEXT_MENU);s(e,t)}l(o.BASE_CONTEXT_MENU),i([]),c(0)}),[l,i,c,f,s])}}},9306:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.useResizeContextMenu=void 0;const r=n(6689),o=n(9318);t.useResizeContextMenu=(e,t)=>{const n=()=>{const e=document.getElementById(o.CONTEXT_MENU_FRAME_ID),t=document.getElementsByClassName(o.ACTIVE_CONTEXT_MENU_CLASS)[0];if(!t||!e)return{height:0,width:0};const{height:n,width:r}=t.getBoundingClientRect();return e.style.height=`${n}px`,e.style.width=`${r}px`,{height:n,width:r}};return(0,r.useEffect)((()=>{
|
|
273
|
+
`},9501: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(9318),t)},4740:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.useContextMenuKeyboardNavigation=void 0;const r=n(6689),o=n(9318);t.useContextMenuKeyboardNavigation=(e,t,n,i,a,l,c,u,s)=>{const f=t=>{var n,r,o;return"separator"===(null===(n=e[t])||void 0===n?void 0:n.type)||!1===(null===(r=e[t])||void 0===r?void 0:r.enabled)||!1===(null===(o=e[t])||void 0===o?void 0:o.visible)},d=(0,r.useCallback)((()=>{a((t=>{let n=t;do{if(n===(null==e?void 0:e.length)-1)break;n+=1}while(f(n));return f(n)?t:n}))}),[a,e]),p=(0,r.useCallback)((()=>{a((e=>{let t=e;do{if(n===o.BASE_CONTEXT_MENU&&0===t||-1===t)break;t-=1}while(f(t));return t}))}),[a,e]),C=(0,r.useCallback)((()=>{a(n===o.BASE_CONTEXT_MENU?0:-1)}),[a,n]),h=(0,r.useCallback)((()=>{a((t=>{for(let n=e.length-1;n>=t;n--)if(!f(n))return n;return t}))}),[null==e?void 0:e.length,a]),v=(0,r.useCallback)((()=>{var t,r;if(null===(t=e[i])||void 0===t?void 0:t.hasSubMenu)c((null===(r=e[i])||void 0===r?void 0:r.label)||"");else{if(-1===i)return void u(n,"keyboard");l(e[i].data)}a(-1)}),[a,l,c,e,i,u,n]),g=(0,r.useCallback)((()=>{var t,n;(null===(t=e[i])||void 0===t?void 0:t.hasSubMenu)&&(c((null===(n=e[i])||void 0===n?void 0:n.label)||""),a(-1))}),[a,c,e,i]),m=(0,r.useCallback)((()=>{(t.slice(1).includes(n)||(null==t?void 0:t.length)>=1)&&u(n,"keyboard")}),[u,t,n]),b=(0,r.useCallback)((()=>{t.slice(2).includes(n)||(null==t?void 0:t.length)>=2?s():l({type:"close"})}),[s,t,n]);(0,r.useEffect)((()=>{const e=e=>{switch(e.key){case"ArrowDown":d();break;case"ArrowUp":p();break;case"Home":case"PageUp":C();break;case"End":case"PageDown":h();break;case"Enter":v();break;case"ArrowRight":g();break;case"ArrowLeft":m();break;case"Escape":b()}};return document.addEventListener("keydown",e),()=>{document.removeEventListener("keydown",e)}}),[d,p,C,h,v,g,m,b])}},4725:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.useContextMenuNavigation=void 0;const r=n(6689),o=n(9318);t.useContextMenuNavigation=(e,t,n,i,a,l,c,u,s)=>{const f=(0,r.useCallback)((e=>{const t=document.getElementById(e),n=null==t?void 0:t.getBoundingClientRect();return{height:(null==n?void 0:n.height)||0,width:(null==n?void 0:n.width)||0}}),[]);return{handleNavigateToSubmenu:(0,r.useCallback)((r=>{if(s){const{height:e,width:t}=f(r);s(e,t)}e||t(o.CONTEXT_MENU_ANIMATION_DURATION),l(r),i([...n,a])}),[a,n,i,s,t,f]),handleNavigateBackToParent:(0,r.useCallback)(((e,t="click")=>{if(s){const e=1===n.length?o.BASE_CONTEXT_MENU:n[n.length-1],{height:t,width:r}=f(e);s(t,r)}const r=n,a=r.pop(),d=u.find((e=>e.parentLabel===a));l(a),i(r),c("keyboard"===t?(null==d?void 0:d.menuTemplate.findIndex((t=>t.label===e)))||0:-1)}),[n,i,c,f,s,u]),handleNavigateToBase:(0,r.useCallback)((()=>{if(s){const{height:e,width:t}=f(o.BASE_CONTEXT_MENU);s(e,t)}l(o.BASE_CONTEXT_MENU),i([]),c(0)}),[l,i,c,f,s])}}},9306:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.useResizeContextMenu=void 0;const r=n(6689),o=n(9318);t.useResizeContextMenu=(e,t)=>{const n=()=>{const e=document.getElementById(o.CONTEXT_MENU_FRAME_ID),t=document.getElementsByClassName(o.ACTIVE_CONTEXT_MENU_CLASS)[0];if(!t||!e)return{height:0,width:0};const{height:n,width:r}=t.getBoundingClientRect();return e.style.height=`${n}px`,e.style.width=`${r}px`,{height:n,width:r}};return(0,r.useEffect)((()=>{setTimeout((()=>{const{width:e}=n();t(e)}),100)}),[e]),{resizeContextMenuFrameToActiveMenu:n}}},7336:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getMenuNavigationOrder=t.getClassName=void 0;const r=n(9318);t.getClassName=(e,t,n)=>t===e?r.ACTIVE_CONTEXT_MENU_CLASS:n.includes(e)?r.PRIOR_CONTEXT_MENU_CLASS:"",t.getMenuNavigationOrder=e=>{if(!e)return[];const t=[{parentLabel:r.BASE_CONTEXT_MENU,template:e}],n=[];for(;t.length;){const{template:e,parentLabel:r}=t.pop();e.forEach((({submenu:n,label:r},o)=>{n&&(t.push({parentLabel:r||"",template:n}),delete e[o].submenu,e[o].hasSubMenu=!0)})),n.push({parentLabel:r,menuTemplate:e})}return n}},9644:(e,t)=>{var n;Object.defineProperty(t,"__esModule",{value:!0}),t.ExpandDirection=void 0,(n=t.ExpandDirection||(t.ExpandDirection={}))[n.Up=0]="Up",n[n.Down=1]="Down"},4021: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.ExpandableButton=void 0;const o=n(5893),i=n(6689),a=n(4130),l=r(n(7518)),c=n(9634),u=n(9141),s=n(3030),f=n(1335),d=n(9644);t.ExpandableButton=e=>{var t,n,r,l,c,p;const[w,y]=(0,i.useState)({show:!1,requestedByCollapse:!1}),x={size:e.size,kind:e.kind,disabled:e.disabled,tabIndex:e.tabIndex},_=Object.assign(Object.assign({},e),{shape:a.ButtonShape.square,"aria-label":null!==(t=e["aria-label"])&&void 0!==t?t:`Primary Button ${e.title}`}),O=null!==(n=e.expandDirection)&&void 0!==n?n:d.ExpandDirection.Down;return(0,i.useEffect)((()=>{if(!w.requestedByCollapse)return;const e=setTimeout((()=>y({requestedByCollapse:!1,show:!1})),200);return()=>clearTimeout(e)}),[w.requestedByCollapse]),(0,o.jsxs)(b,{children:[(0,o.jsxs)(m,{children:[(0,o.jsx)(h,Object.assign({},_,{children:(0,o.jsx)(v,{children:null!==(r=e.children)&&void 0!==r?r:_.title})})),e.secondaryButtons&&e.secondaryButtons.length>0&&(0,o.jsx)(f.Box,Object.assign({id:"dropdown-container"},{children:(0,o.jsxs)(g,Object.assign({},x,{role:"combobox",onClick:()=>{w.requestedByCollapse||y({requestedByCollapse:!1,show:!w.show})},"aria-label":"Expand Secondary Buttons Panel","aria-expanded":w.show},{children:[O===d.ExpandDirection.Down&&(0,o.jsx)(C,{kind:null!==(l=e.kind)&&void 0!==l?l:a.ButtonKind.primary,icon:"CaretDownIcon"}),O===d.ExpandDirection.Up&&(0,o.jsx)(C,{kind:null!==(c=e.kind)&&void 0!==c?c:a.ButtonKind.primary,icon:"CaretUpIcon"})]}))}))]}),e.secondaryButtons&&e.secondaryButtons.length>0&&(0,o.jsx)(u.AnimatePresence,{children:w.show&&(0,o.jsx)(s.ExpandablePanel,{expandDirection:O,secondaryButtons:null!==(p=e.secondaryButtons)&&void 0!==p?p:[],stretch:e.stretchExpandablePanel,closePanelOnSecondaryButtonClick:e.closePanelOnSecondaryButtonClick,onCollapseRequest:()=>y({show:!1,requestedByCollapse:!0}),buttonSize:e.size,document:e.document})})]})};const p={[a.ButtonKind.primary]:e=>e.palette.brandPrimaryText,[a.ButtonKind.secondary]:e=>e.palette.brandSecondaryText,[a.ButtonKind.textOnly]:e=>e.palette.textDefault},C=(0,l.default)(c.Icon)`
|
|
274
274
|
svg path {
|
|
275
275
|
color: ${({theme:e,kind:t})=>p[t](e)};
|
|
276
276
|
}
|
package/package.json
CHANGED