@openfin/ui-library 0.23.6-alpha.1704924358 → 0.23.6-alpha.1705957134

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.
Files changed (2) hide show
  1. package/dist/index.js +1 -1
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -475,7 +475,7 @@ var e={8594:(e,t,n)=>{n.d(t,{Z:()=>o});var r=/^((children|dangerouslySetInnerHTM
475
475
  outline: 0;
476
476
  border-color: ${({theme:e,status:t})=>(0,d.getStatusColor)(e,t,"inputFocused")};
477
477
  }
478
- `},6062: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.DropdownMenu=void 0;const o=n(5893),i=n(6689),a=n(1335),l=r(n(7518)),c=n(7261),s=n(279),u=n(347),d=n(162);t.DropdownMenu=(0,i.forwardRef)((({label:e,options:t=[[]],placeholder:n="Select an option",selected:r,onOptionHover:l,onChange:p,renderLabel:h,fitContent:v},g)=>{if(r&&!((e,t)=>e.some((e=>e.some((e=>e.value===t.value)))))(t,r))throw new Error(`The selected option ${r.value} is not present in the options array`);const[m,w]=(0,i.useState)(!1);(0,i.useEffect)((()=>{1===t[0].length&&b(!1)}),[t]);const b=e=>{w(null!=e?e:!m)},{focusedOption:y,handleKeyDown:x}=(0,u.useDropdownKeyboardNavigation)(t,r,m,b,p);return(0,o.jsx)(f,Object.assign({ref:g,flexDirection:"column",onBlur:e=>{e.currentTarget.contains(e.relatedTarget)||w(!1)},onKeyDown:x},{children:(0,o.jsxs)(a.Box,Object.assign({gap:"small",flexDirection:"column",style:{width:"100%"}},{children:[e&&(0,o.jsx)("label",Object.assign({htmlFor:"dropdown-button"},{children:(0,o.jsx)(c.OptionTitle,{children:e})})),(0,o.jsxs)(C,{children:[h?h(r||{title:n,value:null},m,b,y):(0,o.jsx)(d.DropdownButton,{tabIndex:0,activeDescendant:`menu-option-${null==y?void 0:y.value}`,expanded:m&&t[0].length>1,handleClick:()=>b(),selected:r,placeholder:n}),t.length&&t[0].length>1&&m&&(0,o.jsx)(s.Menu,{menuId:"dropdown-listbox",options:t,selected:r,handleExpandMenu:b,onOptionHover:l,onChange:p,fitContent:v,focusedOption:y,absolutePosition:!0})]})]}))}))})),t.DropdownMenu.displayName="DropdownMenu";const f=(0,l.default)(a.Box)`
478
+ `},6062: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.DropdownMenu=void 0;const o=n(5893),i=n(6689),a=n(1335),l=r(n(7518)),c=n(7261),s=n(279),u=n(347),d=n(162);t.DropdownMenu=(0,i.forwardRef)((({label:e,options:t=[[]],placeholder:n="Select an option",selected:r,onOptionHover:l,onChange:p,renderLabel:h,fitContent:v},g)=>{if(r&&!((e,t)=>e.some((e=>e.some((e=>e.value===t.value)))))(t,r))throw new Error(`The selected option ${r.value} is not present in the options array`);const[m,w]=(0,i.useState)(!1);(0,i.useEffect)((()=>{1===t[0].length&&b(!1)}),[t]);const b=e=>{w(null!=e?e:!m)},{focusedOption:y,handleKeyDown:x}=(0,u.useDropdownKeyboardNavigation)(t,r,m,b,p);return(0,o.jsx)(f,Object.assign({ref:g,flexDirection:"column",onBlur:e=>{e.currentTarget.contains(e.relatedTarget)||w(!1)},onKeyDown:x},{children:(0,o.jsxs)(a.Box,Object.assign({gap:"small",flexDirection:"column",style:{width:"100%"}},{children:[e&&(0,o.jsx)("label",Object.assign({htmlFor:"dropdown-button"},{children:(0,o.jsx)(c.OptionTitle,{children:e})})),(0,o.jsxs)(C,{children:[h?(0,o.jsx)(i.Fragment,{children:h(r||{title:n,value:null},m,b,y)},`render-label-${r}`):(0,o.jsx)(d.DropdownButton,{tabIndex:0,activeDescendant:`menu-option-${null==y?void 0:y.value}`,expanded:m&&t[0].length>1,handleClick:()=>b(),selected:r,placeholder:n}),t.length&&t[0].length>1&&m&&(0,o.jsx)(s.Menu,{menuId:"dropdown-listbox",options:t,selected:r,handleExpandMenu:b,onOptionHover:l,onChange:p,fitContent:v,focusedOption:y,absolutePosition:!0})]})]}))}))})),t.DropdownMenu.displayName="DropdownMenu";const f=(0,l.default)(a.Box)`
479
479
  user-select: none;
480
480
  position: relative;
481
481
  `,C=(0,l.default)(a.Box)``},6026: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(6062),t),o(n(279),t),o(n(162),t)},279: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.ButtonImage=t.Menu=void 0;const o=n(5893),i=r(n(6689)),a=r(n(7518)),l=n(9634),c=n(1335),s=n(7261);t.Menu=({options:e,selected:n,menuId:r,handleExpandMenu:a,onOptionHover:l,onChange:c,width:h,height:v,header:g,focusedOption:m,absolutePosition:w,fitContent:b})=>{const y=e=>{null==l||l(e)};return(0,o.jsxs)(u,Object.assign({role:"listbox",flexDirection:"column",onMouseLeave:()=>{y(null)},"data-testid":"menu",id:r,width:h,height:v,absolutePosition:w,fitContent:b},{children:[g&&(0,o.jsxs)(i.default.Fragment,{children:[(0,o.jsx)(f,{children:(0,o.jsx)(s.OptionTitle,{children:g})}),(0,o.jsx)(p,{})]}),e.map(((e,r)=>(0,o.jsxs)(i.default.Fragment,{children:[0!==r&&(0,o.jsx)(p,{}),e.map(((e,r)=>(0,o.jsxs)(d,Object.assign({role:"option",isFocused:(null==m?void 0:m.value)===e.value,"aria-selected":(null==n?void 0:n.value)===e.value,alignItems:"center",as:"button","data-testid":`menu-option-${r}`,id:`menu-option-${e.value}`,title:e.title,onClick:()=>{e.overrideOnClick?e.overrideOnClick(e):c(e),null==a||a()},onMouseOver:()=>y(e.value)},{children:[(null==e?void 0:e.iconUrl)&&(0,o.jsx)(t.ButtonImage,{src:e.iconUrl,style:{marginRight:"8px"}}),(0,o.jsx)(s.OptionTitle,{children:e.title}),(null==n?void 0:n.value)===e.value?(0,o.jsx)(C,{icon:"CheckIcon"}):(0,o.jsx)(C,{children:(0,o.jsx)(o.Fragment,{})})]}),r)))]},r)))]}))};const u=(0,a.default)(c.Box)`
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.23.6-alpha.1704924358",
4
+ "version": "0.23.6-alpha.1705957134",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "repository": "github:openfin/ui-library",