@openfin/ui-library 0.13.4 → 0.13.5-alpha.1679493105
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 +8 -32
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -351,7 +351,7 @@ var e={8594:(e,t,n)=>{n.d(t,{Z:()=>o});var r=/^((children|dangerouslySetInnerHTM
|
|
|
351
351
|
border-radius: 100px;
|
|
352
352
|
}
|
|
353
353
|
}
|
|
354
|
-
`},9734: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(6895),t)},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=n(9634),c=r(n(7518)),s=n(7261),u=n(279),d=n(347);t.DropdownMenu=({label:e,options:t=[[]],placeholder:n="Select an option",selected:r,onOptionHover:c,onChange:v,renderLabel:h,fitContent:g})=>{var m;const[
|
|
354
|
+
`},9734: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(6895),t)},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=n(9634),c=r(n(7518)),s=n(7261),u=n(279),d=n(347);t.DropdownMenu=({label:e,options:t=[[]],placeholder:n="Select an option",selected:r,onOptionHover:c,onChange:v,renderLabel:h,fitContent:g})=>{var m,w;const[b,y]=(0,i.useState)(!1);(0,i.useEffect)((()=>{1===t[0].length&&x(!1)}),[t]);const x=e=>{y(null!=e?e:!b)},{focusedOption:L,handleKeyDown:O}=(0,d.useDropdownKeyboardNavigation)(t,r,b,x,v);return(0,o.jsx)(f,Object.assign({flexDirection:"column",onBlur:e=>{e.currentTarget.contains(e.relatedTarget)||y(!1)},onKeyDown:O},{children:(0,o.jsxs)(a.Box,Object.assign({gap:"base",flexDirection:"column",style:{width:"100%"}},{children:[e&&(0,o.jsx)("label",Object.assign({htmlFor:"dropdown-button"},{children:(0,o.jsx)(s.OptionTitle,{children:e})})),(0,o.jsxs)(C,{children:[h?h(r||{title:n,value:null},b,x):(0,o.jsxs)(p,Object.assign({role:"comboxbox",tabIndex:0,"aria-activedescendant":`menu-option-${null==L?void 0:L.value}`,"aria-expanded":b,"aria-haspopup":"listbox","aria-controls":"dropdown-listbox",onClick:()=>x(),as:"button","data-testid":"dropdown-button",title:null!==(m=null==r?void 0:r.title)&&void 0!==m?m:n},{children:[(null==r?void 0:r.iconUrl)&&(0,o.jsx)(u.ButtonImage,{src:r.iconUrl}),(0,o.jsx)(s.OptionTitle,Object.assign({"aria-live":"polite","data-testid":"selected-option"},{children:null!==(w=null==r?void 0:r.title)&&void 0!==w?w:n})),(0,o.jsx)(l.Icon,{icon:b&&t[0].length>1?"ChevronUpIcon":"ChevronDownIcon"})]})),t.length&&t[0].length>1&&b&&(0,o.jsx)(u.Menu,{menuId:"dropdown-listbox",options:t,selected:r,handleExpandMenu:x,onOptionHover:c,onChange:v,fitContent:g,focusedOption:L,absolutePosition:!0})]})]}))}))};const f=(0,c.default)(a.Box)`
|
|
355
355
|
user-select: none;
|
|
356
356
|
position: relative;
|
|
357
357
|
`,C=(0,c.default)(a.Box)``,p=(0,c.default)(a.Box)`
|
|
@@ -381,7 +381,7 @@ var e={8594:(e,t,n)=>{n.d(t,{Z:()=>o});var r=/^((children|dangerouslySetInnerHTM
|
|
|
381
381
|
&:focus-within {
|
|
382
382
|
border-color: ${({theme:e})=>e.palette.inputFocused};
|
|
383
383
|
}
|
|
384
|
-
`},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)},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:v,height:h,header:g,focusedOption:m,absolutePosition:w})=>{const b=e=>{null==l||l(e)};return(0,o.jsxs)(u,Object.assign({role:"listbox",flexDirection:"column",onMouseLeave:()=>{b(null)},"data-testid":"menu",id:r,width:v,height:h,absolutePosition:w},{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}`,onClick:()=>{e.overrideOnClick?e.overrideOnClick(e):c(e),null==a||a()},onMouseOver:()=>b(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)`
|
|
384
|
+
`},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)},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:v,height:h,header:g,focusedOption:m,absolutePosition:w})=>{const b=e=>{null==l||l(e)};return(0,o.jsxs)(u,Object.assign({role:"listbox",flexDirection:"column",onMouseLeave:()=>{b(null)},"data-testid":"menu",id:r,width:v,height:h,absolutePosition:w},{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:()=>b(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)`
|
|
385
385
|
width: ${({width:e,fitContent:t})=>e||(t?"fit-content":"100%")};
|
|
386
386
|
max-height: ${({height:e})=>null!=e?e:"fit-content"};
|
|
387
387
|
top: ${({theme:e})=>`calc(100% + ${e.px.xsmall})`};
|
|
@@ -628,18 +628,11 @@ var e={8594:(e,t,n)=>{n.d(t,{Z:()=>o});var r=/^((children|dangerouslySetInnerHTM
|
|
|
628
628
|
&:disabled + ${v} {
|
|
629
629
|
opacity: 0.5;
|
|
630
630
|
}
|
|
631
|
-
`},8051: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(1),t)},9368:function(e,t,n){var r=this&&this.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.DateInput=void 0;const i=n(5893),a=n(6689),l=o(n(7518)),c=n(9634),s=n(1335),u=n(9507),d=n(8878);t.DateInput=(0,a.forwardRef)(((e,t)=>{var{value:n="",type:o="date",expanded:l=!1,
|
|
632
|
-
background: ${({theme:e})=>e.palette.background5};
|
|
633
|
-
border: 1px solid ${({theme:e})=>e.palette.background6};
|
|
634
|
-
border-color: ${({theme:e,status:t})=>(0,u.getStatusColor)(e,t,"inputBackground")};
|
|
631
|
+
`},8051: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(1),t)},9368:function(e,t,n){var r=this&&this.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.DateInput=void 0;const i=n(5893),a=n(6689),l=o(n(7518)),c=n(9634),s=n(1335),u=n(9507),d=n(8878);t.DateInput=(0,a.forwardRef)(((e,t)=>{var{value:n="",type:o="date",expanded:l=!1,onChange:c}=e,s=r(e,["value","type","expanded","onChange"]);const[u,C]=(0,a.useState)(n);return(0,a.useEffect)((()=>C(n)),[]),(0,i.jsx)(d.BaseInput,Object.assign({type:o},s,{renderInput:e=>{var n=r(e,[]);return(0,i.jsx)(f,Object.assign({ref:t,type:o,onChange:e=>{const{value:t}=e.target;t&&C(t),null==c||c(e)},value:u,expanded:l},n))}}))})),t.DateInput.displayName="DateInput";const f=(0,a.forwardRef)(((e,t)=>{var{type:n,expanded:o,onExpand:a}=e,l=r(e,["type","expanded","onExpand"]);return(0,i.jsxs)(C,{children:[(0,i.jsx)(v,{children:(0,i.jsx)(c.Icon,{icon:"time"===n?"ClockIcon":"CalendarIcon"})}),(0,i.jsx)(g,Object.assign({ref:t,type:n,onKeyDown:e=>{" "===e.key&&e.preventDefault()}},l)),(0,i.jsx)(h,Object.assign({flexDirection:"column",disabled:l.disabled,onClick:a},{children:(0,i.jsx)(c.Icon,{icon:o?"ChevronUpIcon":"ChevronDownIcon"})}))]})}));f.displayName="StyledDateInput";const C=l.default.div`
|
|
635
632
|
position: relative;
|
|
636
633
|
overflow: hidden;
|
|
637
634
|
border-radius: ${({theme:e})=>e.radius.small};
|
|
638
635
|
width: 100%;
|
|
639
|
-
|
|
640
|
-
&:focus {
|
|
641
|
-
border-color: ${({theme:e,status:t})=>(0,u.getStatusColor)(e,t,"inputFocused")};
|
|
642
|
-
}
|
|
643
636
|
`,p=(0,l.default)(s.Box)`
|
|
644
637
|
flex-direction: column;
|
|
645
638
|
justify-content: center;
|
|
@@ -654,35 +647,18 @@ var e={8594:(e,t,n)=>{n.d(t,{Z:()=>o});var r=/^((children|dangerouslySetInnerHTM
|
|
|
654
647
|
`,h=(0,l.default)(p)`
|
|
655
648
|
right: ${({theme:e})=>e.px.small};
|
|
656
649
|
pointer-events: ${({disabled:e})=>e?"none":void 0};
|
|
657
|
-
|
|
650
|
+
border-left: 1px solid ${({theme:e})=>e.palette.background6};
|
|
651
|
+
padding-left: ${({theme:e})=>e.px.small};
|
|
652
|
+
`,g=(0,l.default)(d.StyledInputField)`
|
|
658
653
|
appearance: textfield;
|
|
659
654
|
font-family: ${u.FontStack};
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
border: none;
|
|
663
|
-
padding: 0;
|
|
664
|
-
transition: border-color var(--openfin-ui-globalTransition);
|
|
665
|
-
color: ${({theme:e})=>e.palette.inputColor};
|
|
666
|
-
|
|
667
|
-
&:focus {
|
|
668
|
-
outline: 0;
|
|
669
|
-
}
|
|
670
|
-
|
|
671
|
-
&:disabled {
|
|
672
|
-
cursor: not-allowed;
|
|
673
|
-
}
|
|
674
|
-
|
|
675
|
-
&:disabled::placeholder {
|
|
676
|
-
color: ${({theme:e})=>e.palette.inputDisabled};
|
|
677
|
-
}
|
|
678
|
-
|
|
655
|
+
padding-right: ${({theme:e})=>e.px.xxxlarge};
|
|
656
|
+
padding-left: ${({theme:e})=>e.px.xxxlarge};
|
|
679
657
|
::-webkit-inner-spin-button,
|
|
680
658
|
::-webkit-calendar-picker-indicator {
|
|
681
659
|
display: none;
|
|
682
660
|
appearance: none;
|
|
683
661
|
}
|
|
684
|
-
`,m=(0,l.default)(s.Box)`
|
|
685
|
-
padding: ${({theme:e})=>`${e.px.small} ${e.px.xxxlarge}`};
|
|
686
662
|
`},9654: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(9368),t)},1978: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(6884),t)},6884:function(e,t,n){var r=this&&this.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.NumberInput=void 0;const i=n(5893),a=n(6689),l=o(n(7518)),c=n(6606),s=n(9634),u=n(1335),d=n(8878);var f;!function(e){e[e.Up=1]="Up",e[e.Down=-1]="Down"}(f||(f={})),t.NumberInput=(0,a.forwardRef)(((e,t)=>{var{min:n,max:o,onChange:l,step:s=1,value:u}=e,p=r(e,["min","max","onChange","step","value"]);const v=Number(s),[h,g]=(0,a.useState)(Number(u));(0,a.useEffect)((()=>g(Number(u))),[]);const m=e=>{const t=h?Number(h):0,r=n?Number(n):void 0,i=o?Number(o):void 0,a=(0,c.clamp)(t+v*e,r,i);g(a)};return(0,i.jsx)(d.BaseInput,Object.assign({type:"number"},p,{renderInput:e=>{var a=r(e,[]);return(0,i.jsx)(C,Object.assign({ref:t,onIncrement:()=>m(f.Up),onDecrement:()=>m(f.Down),onChange:e=>{const{value:t}=e.target;t&&g(Number(t)),l&&l(e)},min:n,max:o,step:s},a,{value:h}))}}))})),t.NumberInput.displayName="NumberInput";const C=(0,a.forwardRef)(((e,t)=>{var{onIncrement:n,onDecrement:o}=e,a=r(e,["onIncrement","onDecrement"]);return(0,i.jsxs)(p,{children:[(0,i.jsx)(g,Object.assign({ref:t},a)),(0,i.jsxs)(v,Object.assign({flexDirection:"column",disabled:a.disabled},{children:[(0,i.jsx)(h,Object.assign({onClick:n,disabled:a.disabled},{children:(0,i.jsx)(s.Icon,{icon:"TriangleUpIcon"})})),(0,i.jsx)(h,Object.assign({onClick:o,disabled:a.disabled},{children:(0,i.jsx)(s.Icon,{icon:"TriangleDownIcon"})}))]}))]})}));C.displayName="StyledNumberInput";const p=l.default.div`
|
|
687
663
|
position: relative;
|
|
688
664
|
overflow: hidden;
|
package/package.json
CHANGED