@corva/ui 0.68.0-4 → 0.68.0-5

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.
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require('./../../../ext-esm/tslib/tslib.es6.js'),t=require("react/jsx-runtime"),o=require("react"),i=require("classnames"),n=require("@material-ui/core"),r=require("@material-ui/icons"),a=require("../../../utils/mobileDetect.js"),l=require("../../IconButton/index.js"),s=require("../../Modal/Modal.js"),c=require("../../Button/index.js");function d(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var p=d(i),u=a.isNativeDetected||a.isMobileDetected,g=n.makeStyles((function(e){return{popoverPaper:{marginTop:function(e){return e.isScrollable?0:8},minWidth:286,width:286,overflowY:"hidden",backgroundColor:e.palette.background.b9,maxHeight:function(e){var t=e.maxHeight;return t?t-24:"calc(100% - 24px)"},"&.scrollable":{height:function(e){return e.maxHeight||"100%"}}},popoverHeader:{display:"flex",justifyContent:"space-between",alignItems:"center",height:76,padding:"24px 16px 16px 16px",position:"absolute",left:0,right:0,zIndex:1,"&.scrollable":{background:"linear-gradient(to bottom, ".concat(e.palette.background.b9,", ").concat(e.palette.background.b9," 79%, rgba(65, 65, 65, 0) 100%)")}},headerTitle:{fontSize:20},popoverContentContainer:{marginTop:60,paddingTop:16,overflowX:"hidden",overflowY:"auto","&.scrollable":{height:"calc(100% - 60px)"}},popoverContent:{width:"100%"},shadow:{position:"absolute",bottom:0,width:"100%",height:16,background:"linear-gradient(180deg, rgba(65, 65, 65, 0) 0%, ".concat(e.palette.background.b9," 100%)")},modalRoot:{"& > div:first-child":{backgroundColor:"transparent !important"}},modalActions:{display:"flex",justifyContent:"flex-end"}}}));exports.AppSettingsPopover=function(i){var d=i.Trigger,h=i.children,v=i.classes,m=i.defaultScrollable,b=void 0!==m&&m,x=i.header,f=void 0===x?"Settings":x,_=i.iconSettingsProps,C=void 0===_?{}:_,j=i.maxHeight,S=void 0===j?null:j,k=i.modalActions,P=void 0===k?null:k,q=i.modalProps,H=void 0===q?{}:q,N=i.onClose,w=void 0===N?function(){}:N,T=e.__rest(i,["Trigger","children","classes","defaultScrollable","header","iconSettingsProps","maxHeight","modalActions","modalProps","onClose"]),y=o.useState(null),A=y[0],z=y[1],D=o.useState(!0),M=D[0],O=D[1],B=g({maxHeight:S,isScrollable:M,isNativeDetected:a.isNativeDetected}),I=v||{},E=I.popoverContent,R=e.__rest(I,["popoverContent"]),Y=function(){z(null),w()},F=Boolean(A),L=function(e){return z(e.currentTarget)},W=P||t.jsx(c,e.__assign({variation:"secondary",onClick:Y},{children:"CLOSE"}));return t.jsxs(t.Fragment,{children:[d?t.jsx(d,{onClick:L}):t.jsx(l,e.__assign({isActive:F,onClick:L,size:"small",tooltipProps:{title:"Settings"},variant:"contained"},C,{children:t.jsx(r.Settings,{})})),!u&&t.jsxs(n.Popover,e.__assign({open:F,anchorEl:A,onClose:Y,anchorOrigin:{vertical:M?"top":"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},marginThreshold:12},T,{classes:e.__assign(e.__assign({},R),{paper:p.default(B.popoverPaper,M&&"scrollable",null==R?void 0:R.paper)})},{children:[t.jsxs("div",e.__assign({className:p.default(B.popoverHeader,M&&"scrollable")},{children:[t.jsx("div",e.__assign({className:B.headerTitle},{children:f})),t.jsx(l,e.__assign({tooltipProps:{title:"Close"},onClick:Y},{children:t.jsx(r.Close,{})}))]})),t.jsx("div",e.__assign({className:p.default(B.popoverContentContainer,M&&"scrollable"),ref:function(e){e&&e.scrollHeight<=e.clientHeight&&!b&&O(!1)}},{children:t.jsx("div",e.__assign({className:p.default(B.popoverContent,E)},{children:h}))})),t.jsx("div",{className:B.shadow})]})),u&&t.jsx(s,e.__assign({actions:W,onClose:Y,open:F,rootClassName:B.modalRoot,actionsClassName:B.modalActions,title:f},H,{children:h}))]})};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require('./../../../ext-esm/tslib/tslib.es6.js'),t=require("react/jsx-runtime"),o=require("react"),i=require("classnames"),n=require("@material-ui/core"),r=require("@material-ui/icons"),a=require("../../../utils/mobileDetect.js"),s=require("../../IconButton/index.js"),l=require("../../Modal/Modal.js"),c=require("../../Button/index.js");function d(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var p=d(i),u=a.isNativeDetected||a.isMobileDetected,g=n.makeStyles((function(e){return{popoverPaper:{marginTop:function(e){return e.isScrollable?0:8},minWidth:286,width:286,overflowY:"hidden",backgroundColor:e.palette.background.b9,maxHeight:function(e){var t=e.maxHeight;return t?t-24:"calc(100% - 24px)"},"&.scrollable":{height:function(e){return e.maxHeight||"100%"}}},popoverHeader:{display:"flex",justifyContent:"space-between",alignItems:"center",height:76,padding:"24px 16px 16px 16px",position:"absolute",left:0,right:0,zIndex:1,"&.scrollable":{background:"linear-gradient(to bottom, ".concat(e.palette.background.b9,", ").concat(e.palette.background.b9," 79%, rgba(65, 65, 65, 0) 100%)")}},headerTitle:{fontSize:20},popoverContentContainer:{marginTop:60,paddingTop:16,overflowX:"hidden",overflowY:"auto","&.scrollable":{height:"calc(100% - 60px)"}},popoverContent:{width:"100%"},shadow:{position:"absolute",bottom:0,width:"100%",height:16,background:"linear-gradient(180deg, rgba(65, 65, 65, 0) 0%, ".concat(e.palette.background.b9," 100%)")},modalActions:{display:"flex",justifyContent:"flex-end"}}}));exports.AppSettingsPopover=function(i){var d=i.Trigger,h=i.children,v=i.classes,m=i.defaultScrollable,b=void 0!==m&&m,x=i.header,f=void 0===x?"Settings":x,_=i.iconSettingsProps,j=void 0===_?{}:_,C=i.maxHeight,S=void 0===C?null:C,k=i.modalActions,P=void 0===k?null:k,q=i.modalProps,H=void 0===q?{}:q,w=i.onClose,N=void 0===w?function(){}:w,T=e.__rest(i,["Trigger","children","classes","defaultScrollable","header","iconSettingsProps","maxHeight","modalActions","modalProps","onClose"]),y=o.useState(null),A=y[0],z=y[1],D=o.useState(!0),M=D[0],O=D[1],B=g({maxHeight:S,isScrollable:M,isNativeDetected:a.isNativeDetected}),I=v||{},E=I.popoverContent,Y=e.__rest(I,["popoverContent"]),F=function(){z(null),N()},L=Boolean(A),W=function(e){return z(e.currentTarget)},X=P||t.jsx(c,e.__assign({variation:"secondary",onClick:F},{children:"CLOSE"}));return t.jsxs(t.Fragment,{children:[d?t.jsx(d,{onClick:W}):t.jsx(s,e.__assign({isActive:L,onClick:W,size:"small",tooltipProps:{title:"Settings"},variant:"contained"},j,{children:t.jsx(r.Settings,{})})),!u&&t.jsxs(n.Popover,e.__assign({open:L,anchorEl:A,onClose:F,anchorOrigin:{vertical:M?"top":"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},marginThreshold:12},T,{classes:e.__assign(e.__assign({},Y),{paper:p.default(B.popoverPaper,M&&"scrollable",null==Y?void 0:Y.paper)})},{children:[t.jsxs("div",e.__assign({className:p.default(B.popoverHeader,M&&"scrollable")},{children:[t.jsx("div",e.__assign({className:B.headerTitle},{children:f})),t.jsx(s,e.__assign({tooltipProps:{title:"Close"},onClick:F},{children:t.jsx(r.Close,{})}))]})),t.jsx("div",e.__assign({className:p.default(B.popoverContentContainer,M&&"scrollable"),ref:function(e){e&&e.scrollHeight<=e.clientHeight&&!b&&O(!1)}},{children:t.jsx("div",e.__assign({className:p.default(B.popoverContent,E)},{children:h}))})),t.jsx("div",{className:B.shadow})]})),u&&t.jsx(l,e.__assign({actions:X,onClose:F,open:L,actionsClassName:B.modalActions,title:f},H,{children:h}))]})};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@material-ui/core"),r=require("react/jsx-runtime"),t=e.createSvgIcon(r.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",height:"24",viewBox:"0 0 24 24",width:"24",children:[r.jsx("path",{d:"M0 0h24v24H0z",fill:"none"}),r.jsx("path",{d:"M15.73 3H8.27L3 8.27v7.46L8.27 21h7.46L21 15.73V8.27L15.73 3zM17 15.74L15.74 17 12 13.26 8.26 17 7 15.74 10.74 12 7 8.26 8.26 7 12 10.74 15.74 7 17 8.26 13.26 12 17 15.74z"})]}),"DangerousIcon");exports.DangerousIcon=t;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@material-ui/core"),r=require("react/jsx-runtime"),t=e.createSvgIcon(r.jsx("g",{transform:"scale(1.111)",children:r.jsx("path",{d:"M15.73 3H8.27L3 8.27v7.46L8.27 21h7.46L21 15.73V8.27L15.73 3zM17 15.74L15.74 17 12 13.26 8.26 17 7 15.74 10.74 12 7 8.26 8.26 7 12 10.74 15.74 7 17 8.26 13.26 12 17 15.74z",transform:"translate(-1.2 -1.2)"})}),"DangerousIcon");exports.DangerousIcon=t;
@@ -1 +1 @@
1
- "use strict";var e=require("@babel/runtime/helpers/defineProperty"),t=require("@babel/runtime/helpers/slicedToArray"),r=require("react"),n=require("@material-ui/core"),i=require("@material-ui/icons"),o=require("react/jsx-runtime");function a(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var l=a(e),c=a(t);function u(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function s(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?u(Object(r),!0).forEach((function(t){l.default(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):u(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var p=n.makeStyles((function(e){return{root:{display:"flex"},assetEditorWrapper:{width:"100%"},iconButtonWrapper:{height:36,marginTop:10,marginLeft:16},iconButton:{color:e.palette.primary.text6,width:36,height:36,"&:hover":{backgroundColor:e.palette.background.b7}}}}));module.exports=function(e){return function(t){var a=p(),l=t.onChangeEditorField,u=t.onSettingsChange,d=r.useState(!0),f=c.default(d,2),b=f[0],h=f[1],m=r.useState(!0),j=c.default(m,2),O=j[0],g=j[1],y=function(){l("assetId",null),l("replacedAssetId",null),l("replacedAssetTime",null)},v=function(){u({rigId:null,wellId:null})};r.useEffect((function(){O||g(!0)}),[O]);var x=b?i.LockOutlined:i.ReplayOutlined;return o.jsxs("div",{className:a.root,children:[o.jsx(n.Tooltip,{title:b?"This app is using current dashboard asset.":"",placement:"bottom",children:o.jsx("div",{className:a.assetEditorWrapper,children:O&&o.jsx(e,s(s({},t),{},{disabled:b}))})}),o.jsx(n.Tooltip,{title:b?"Unlock Asset":"Return default",placement:"bottom",children:o.jsx("div",{className:a.iconButtonWrapper,children:o.jsx(n.IconButton,{className:a.iconButton,onClick:function(){var e=!b;(h(e),e)&&((l?y:v)(),g(!1))},children:o.jsx(x,{})})})})]})}};
1
+ "use strict";var e=require("@babel/runtime/helpers/defineProperty"),t=require("@babel/runtime/helpers/slicedToArray"),r=require("react"),n=require("@material-ui/core"),o=require("@material-ui/icons"),i=require("react/jsx-runtime");function a(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var c=a(e),l=a(t);function u(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function s(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?u(Object(r),!0).forEach((function(t){c.default(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):u(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var d=n.makeStyles((function(e){return{root:{display:"flex"},assetEditorWrapper:{width:"100%"},iconButtonWrapper:{height:36,marginTop:10,marginLeft:16},iconButton:{color:e.palette.primary.text6,width:36,height:36,"&:hover":{backgroundColor:e.palette.background.b7}}}}));module.exports=function(e){return function(t){var a=d(),c=t.onChangeEditorField,u=t.onSettingsChange,p=r.useState(!0),f=l.default(p,2),b=f[0],h=f[1],m=r.useState(!0),j=l.default(m,2),O=j[0],g=j[1],y=function(){c("assetId",null),c("replacedAssetId",null),c("replacedAssetTime",null)},v=function(){u({rigId:null,wellId:null})};r.useEffect((function(){O||g(!0)}),[O]);var x=b?o.LockOutlined:o.ReplayOutlined;return i.jsxs("div",{className:a.root,children:[i.jsx(n.Tooltip,{title:b?"This app is using current dashboard asset.":"",placement:"bottom",children:i.jsx("div",{className:a.assetEditorWrapper,children:O&&i.jsx(e,s(s({},t),{},{disabled:b}))})}),i.jsx(n.Tooltip,{title:b?"Unlock Asset":"Return default",placement:"bottom",children:i.jsx("div",{className:a.iconButtonWrapper,children:i.jsx(n.IconButton,{className:a.iconButton,"data-testid":"".concat(b?"UnlockAsset":"ReturnDefault","_IconButton"),onClick:function(){var e=!b;(h(e),e)&&((c?y:v)(),g(!1))},children:i.jsx(x,{})})})})]})}};
@@ -1 +1 @@
1
- {"version":3,"file":"AppSettingsPopover.d.ts","sourceRoot":"","sources":["../../../../src/components/DevCenter/AppSettingsPopover/AppSettingsPopover.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAY,SAAS,EAAE,MAAM,OAAO,CAAC;AAG5C,OAAO,EAAc,YAAY,EAAW,MAAM,mBAAmB,CAAC;AA0EtE,MAAM,WAAW,uBAAwB,SAAQ,YAAY;IAC3D,OAAO,EAAE,SAAS,CAAC;IACnB,QAAQ,EAAE,SAAS,CAAC;IACpB,OAAO,EAAE,YAAY,CAAC,SAAS,CAAC,GAAG;QACjC,cAAc,CAAC,EAAE,MAAM,CAAC;KACzB,CAAC;IACF,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,iBAAiB,CAAC,EAAE;QAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,YAAY,CAAC,EAAE;YAAE,KAAK,EAAE,MAAM,CAAA;SAAE,CAAC;KAClC,CAAC;IACF,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,SAAS,CAAC;IACzB,UAAU,CAAC,EAAE,EAAE,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB;AAED,wBAAgB,kBAAkB,CAAC,EACjC,OAAO,EACP,QAAQ,EACR,OAAO,EACP,iBAAyB,EACzB,MAAmB,EACnB,iBAAsB,EACtB,SAAgB,EAChB,YAAmB,EACnB,UAAe,EACf,OAAkB,EAClB,GAAG,YAAY,EAChB,EAAE,uBAAuB,GAAG,GAAG,CAAC,OAAO,CAqGvC"}
1
+ {"version":3,"file":"AppSettingsPopover.d.ts","sourceRoot":"","sources":["../../../../src/components/DevCenter/AppSettingsPopover/AppSettingsPopover.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAY,SAAS,EAAE,MAAM,OAAO,CAAC;AAG5C,OAAO,EAAc,YAAY,EAAW,MAAM,mBAAmB,CAAC;AAoEtE,MAAM,WAAW,uBAAwB,SAAQ,YAAY;IAC3D,OAAO,EAAE,SAAS,CAAC;IACnB,QAAQ,EAAE,SAAS,CAAC;IACpB,OAAO,EAAE,YAAY,CAAC,SAAS,CAAC,GAAG;QACjC,cAAc,CAAC,EAAE,MAAM,CAAC;KACzB,CAAC;IACF,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,iBAAiB,CAAC,EAAE;QAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,YAAY,CAAC,EAAE;YAAE,KAAK,EAAE,MAAM,CAAA;SAAE,CAAC;KAClC,CAAC;IACF,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,SAAS,CAAC;IACzB,UAAU,CAAC,EAAE,EAAE,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB;AAED,wBAAgB,kBAAkB,CAAC,EACjC,OAAO,EACP,QAAQ,EACR,OAAO,EACP,iBAAyB,EACzB,MAAmB,EACnB,iBAAsB,EACtB,SAAgB,EAChB,YAAmB,EACnB,UAAe,EACf,OAAkB,EAClB,GAAG,YAAY,EAChB,EAAE,uBAAuB,GAAG,GAAG,CAAC,OAAO,CAoGvC"}
@@ -1 +1 @@
1
- import{__rest as o,__assign as e}from'./../../../ext-esm/tslib/tslib.es6.js';import{jsx as t,jsxs as i,Fragment as r}from"react/jsx-runtime";import{useState as n}from"react";import l from"classnames";import{makeStyles as a,Popover as c}from"@material-ui/core";import{Settings as s,Close as d}from"@material-ui/icons";import{isNativeDetected as p,isMobileDetected as m}from"../../../utils/mobileDetect.js";import h from"../../IconButton/index.js";import g from"../../Modal/Modal.js";import u from"../../Button/index.js";var v=p||m,f=a((function(o){return{popoverPaper:{marginTop:function(o){return o.isScrollable?0:8},minWidth:286,width:286,overflowY:"hidden",backgroundColor:o.palette.background.b9,maxHeight:function(o){var e=o.maxHeight;return e?e-24:"calc(100% - 24px)"},"&.scrollable":{height:function(o){return o.maxHeight||"100%"}}},popoverHeader:{display:"flex",justifyContent:"space-between",alignItems:"center",height:76,padding:"24px 16px 16px 16px",position:"absolute",left:0,right:0,zIndex:1,"&.scrollable":{background:"linear-gradient(to bottom, ".concat(o.palette.background.b9,", ").concat(o.palette.background.b9," 79%, rgba(65, 65, 65, 0) 100%)")}},headerTitle:{fontSize:20},popoverContentContainer:{marginTop:60,paddingTop:16,overflowX:"hidden",overflowY:"auto","&.scrollable":{height:"calc(100% - 60px)"}},popoverContent:{width:"100%"},shadow:{position:"absolute",bottom:0,width:"100%",height:16,background:"linear-gradient(180deg, rgba(65, 65, 65, 0) 0%, ".concat(o.palette.background.b9," 100%)")},modalRoot:{"& > div:first-child":{backgroundColor:"transparent !important"}},modalActions:{display:"flex",justifyContent:"flex-end"}}}));function b(a){var m=a.Trigger,b=a.children,C=a.classes,x=a.defaultScrollable,k=void 0!==x&&x,H=a.header,S=void 0===H?"Settings":H,w=a.iconSettingsProps,T=void 0===w?{}:w,j=a.maxHeight,N=void 0===j?null:j,P=a.modalActions,y=void 0===P?null:P,z=a.modalProps,A=void 0===z?{}:z,B=a.onClose,I=void 0===B?function(){}:B,O=o(a,["Trigger","children","classes","defaultScrollable","header","iconSettingsProps","maxHeight","modalActions","modalProps","onClose"]),D=n(null),E=D[0],M=D[1],R=n(!0),Y=R[0],L=R[1],W=f({maxHeight:N,isScrollable:Y,isNativeDetected:p}),X=C||{},_=X.popoverContent,q=o(X,["popoverContent"]),F=function(){M(null),I()},G=Boolean(E),J=function(o){return M(o.currentTarget)},K=y||t(u,e({variation:"secondary",onClick:F},{children:"CLOSE"}));return i(r,{children:[m?t(m,{onClick:J}):t(h,e({isActive:G,onClick:J,size:"small",tooltipProps:{title:"Settings"},variant:"contained"},T,{children:t(s,{})})),!v&&i(c,e({open:G,anchorEl:E,onClose:F,anchorOrigin:{vertical:Y?"top":"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},marginThreshold:12},O,{classes:e(e({},q),{paper:l(W.popoverPaper,Y&&"scrollable",null==q?void 0:q.paper)})},{children:[i("div",e({className:l(W.popoverHeader,Y&&"scrollable")},{children:[t("div",e({className:W.headerTitle},{children:S})),t(h,e({tooltipProps:{title:"Close"},onClick:F},{children:t(d,{})}))]})),t("div",e({className:l(W.popoverContentContainer,Y&&"scrollable"),ref:function(o){o&&o.scrollHeight<=o.clientHeight&&!k&&L(!1)}},{children:t("div",e({className:l(W.popoverContent,_)},{children:b}))})),t("div",{className:W.shadow})]})),v&&t(g,e({actions:K,onClose:F,open:G,rootClassName:W.modalRoot,actionsClassName:W.modalActions,title:S},A,{children:b}))]})}export{b as AppSettingsPopover};
1
+ import{__rest as o,__assign as e}from'./../../../ext-esm/tslib/tslib.es6.js';import{jsx as t,jsxs as i,Fragment as r}from"react/jsx-runtime";import{useState as n}from"react";import l from"classnames";import{makeStyles as a,Popover as c}from"@material-ui/core";import{Settings as s,Close as d}from"@material-ui/icons";import{isNativeDetected as p,isMobileDetected as m}from"../../../utils/mobileDetect.js";import h from"../../IconButton/index.js";import g from"../../Modal/Modal.js";import u from"../../Button/index.js";var v=p||m,f=a((function(o){return{popoverPaper:{marginTop:function(o){return o.isScrollable?0:8},minWidth:286,width:286,overflowY:"hidden",backgroundColor:o.palette.background.b9,maxHeight:function(o){var e=o.maxHeight;return e?e-24:"calc(100% - 24px)"},"&.scrollable":{height:function(o){return o.maxHeight||"100%"}}},popoverHeader:{display:"flex",justifyContent:"space-between",alignItems:"center",height:76,padding:"24px 16px 16px 16px",position:"absolute",left:0,right:0,zIndex:1,"&.scrollable":{background:"linear-gradient(to bottom, ".concat(o.palette.background.b9,", ").concat(o.palette.background.b9," 79%, rgba(65, 65, 65, 0) 100%)")}},headerTitle:{fontSize:20},popoverContentContainer:{marginTop:60,paddingTop:16,overflowX:"hidden",overflowY:"auto","&.scrollable":{height:"calc(100% - 60px)"}},popoverContent:{width:"100%"},shadow:{position:"absolute",bottom:0,width:"100%",height:16,background:"linear-gradient(180deg, rgba(65, 65, 65, 0) 0%, ".concat(o.palette.background.b9," 100%)")},modalActions:{display:"flex",justifyContent:"flex-end"}}}));function b(a){var m=a.Trigger,b=a.children,C=a.classes,x=a.defaultScrollable,k=void 0!==x&&x,H=a.header,S=void 0===H?"Settings":H,w=a.iconSettingsProps,T=void 0===w?{}:w,j=a.maxHeight,P=void 0===j?null:j,N=a.modalActions,y=void 0===N?null:N,z=a.modalProps,A=void 0===z?{}:z,B=a.onClose,I=void 0===B?function(){}:B,O=o(a,["Trigger","children","classes","defaultScrollable","header","iconSettingsProps","maxHeight","modalActions","modalProps","onClose"]),D=n(null),E=D[0],M=D[1],Y=n(!0),L=Y[0],W=Y[1],X=f({maxHeight:P,isScrollable:L,isNativeDetected:p}),_=C||{},q=_.popoverContent,F=o(_,["popoverContent"]),G=function(){M(null),I()},J=Boolean(E),K=function(o){return M(o.currentTarget)},Q=y||t(u,e({variation:"secondary",onClick:G},{children:"CLOSE"}));return i(r,{children:[m?t(m,{onClick:K}):t(h,e({isActive:J,onClick:K,size:"small",tooltipProps:{title:"Settings"},variant:"contained"},T,{children:t(s,{})})),!v&&i(c,e({open:J,anchorEl:E,onClose:G,anchorOrigin:{vertical:L?"top":"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},marginThreshold:12},O,{classes:e(e({},F),{paper:l(X.popoverPaper,L&&"scrollable",null==F?void 0:F.paper)})},{children:[i("div",e({className:l(X.popoverHeader,L&&"scrollable")},{children:[t("div",e({className:X.headerTitle},{children:S})),t(h,e({tooltipProps:{title:"Close"},onClick:G},{children:t(d,{})}))]})),t("div",e({className:l(X.popoverContentContainer,L&&"scrollable"),ref:function(o){o&&o.scrollHeight<=o.clientHeight&&!k&&W(!1)}},{children:t("div",e({className:l(X.popoverContent,q)},{children:b}))})),t("div",{className:X.shadow})]})),v&&t(g,e({actions:Q,onClose:G,open:J,actionsClassName:X.modalActions,title:S},A,{children:b}))]})}export{b as AppSettingsPopover};
@@ -1 +1 @@
1
- {"version":3,"file":"DangerousIcon.d.ts","sourceRoot":"","sources":["../../../src/components/Icons/DangerousIcon.js"],"names":[],"mappings":"AAEA,yJAME"}
1
+ {"version":3,"file":"DangerousIcon.d.ts","sourceRoot":"","sources":["../../../src/components/Icons/DangerousIcon.js"],"names":[],"mappings":"AAEA,yJAQE"}
@@ -1 +1 @@
1
- import{createSvgIcon as r}from"@material-ui/core";import{jsxs as t,jsx as o}from"react/jsx-runtime";var e=r(t("svg",{xmlns:"http://www.w3.org/2000/svg",height:"24",viewBox:"0 0 24 24",width:"24",children:[o("path",{d:"M0 0h24v24H0z",fill:"none"}),o("path",{d:"M15.73 3H8.27L3 8.27v7.46L8.27 21h7.46L21 15.73V8.27L15.73 3zM17 15.74L15.74 17 12 13.26 8.26 17 7 15.74 10.74 12 7 8.26 8.26 7 12 10.74 15.74 7 17 8.26 13.26 12 17 15.74z"})]}),"DangerousIcon");export{e as DangerousIcon};
1
+ import{createSvgIcon as r}from"@material-ui/core";import{jsx as a}from"react/jsx-runtime";var t=r(a("g",{transform:"scale(1.111)",children:a("path",{d:"M15.73 3H8.27L3 8.27v7.46L8.27 21h7.46L21 15.73V8.27L15.73 3zM17 15.74L15.74 17 12 13.26 8.26 17 7 15.74 10.74 12 7 8.26 8.26 7 12 10.74 15.74 7 17 8.26 13.26 12 17 15.74z",transform:"translate(-1.2 -1.2)"})}),"DangerousIcon");export{t as DangerousIcon};
@@ -1 +1 @@
1
- import e from"@babel/runtime/helpers/defineProperty";import r from"@babel/runtime/helpers/slicedToArray";import{useState as t,useEffect as n}from"react";import{makeStyles as o,Tooltip as i,IconButton as a}from"@material-ui/core";import{LockOutlined as c,ReplayOutlined as l}from"@material-ui/icons";import{jsxs as s,jsx as p}from"react/jsx-runtime";function u(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,n)}return t}function d(r){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?u(Object(n),!0).forEach((function(t){e(r,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(n)):u(Object(n)).forEach((function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(n,e))}))}return r}var m=o((function(e){return{root:{display:"flex"},assetEditorWrapper:{width:"100%"},iconButtonWrapper:{height:36,marginTop:10,marginLeft:16},iconButton:{color:e.palette.primary.text6,width:36,height:36,"&:hover":{backgroundColor:e.palette.background.b7}}}})),f=function(e){return function(o){var u=m(),f=o.onChangeEditorField,b=o.onSettingsChange,h=t(!0),g=r(h,2),O=g[0],y=g[1],j=t(!0),v=r(j,2),w=v[0],P=v[1],k=function(){f("assetId",null),f("replacedAssetId",null),f("replacedAssetTime",null)},E=function(){b({rigId:null,wellId:null})};n((function(){w||P(!0)}),[w]);var x=O?c:l;return s("div",{className:u.root,children:[p(i,{title:O?"This app is using current dashboard asset.":"",placement:"bottom",children:p("div",{className:u.assetEditorWrapper,children:w&&p(e,d(d({},o),{},{disabled:O}))})}),p(i,{title:O?"Unlock Asset":"Return default",placement:"bottom",children:p("div",{className:u.iconButtonWrapper,children:p(a,{className:u.iconButton,onClick:function(){var e=!O;(y(e),e)&&((f?k:E)(),P(!1))},children:p(x,{})})})})]})}};export{f as default};
1
+ import e from"@babel/runtime/helpers/defineProperty";import t from"@babel/runtime/helpers/slicedToArray";import{useState as r,useEffect as n}from"react";import{makeStyles as o,Tooltip as i,IconButton as a}from"@material-ui/core";import{LockOutlined as c,ReplayOutlined as l}from"@material-ui/icons";import{jsxs as s,jsx as u}from"react/jsx-runtime";function p(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function d(t){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{};r%2?p(Object(n),!0).forEach((function(r){e(t,r,n[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):p(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var m=o((function(e){return{root:{display:"flex"},assetEditorWrapper:{width:"100%"},iconButtonWrapper:{height:36,marginTop:10,marginLeft:16},iconButton:{color:e.palette.primary.text6,width:36,height:36,"&:hover":{backgroundColor:e.palette.background.b7}}}})),f=function(e){return function(o){var p=m(),f=o.onChangeEditorField,b=o.onSettingsChange,h=r(!0),g=t(h,2),O=g[0],y=g[1],j=r(!0),v=t(j,2),w=v[0],P=v[1],k=function(){f("assetId",null),f("replacedAssetId",null),f("replacedAssetTime",null)},A=function(){b({rigId:null,wellId:null})};n((function(){w||P(!0)}),[w]);var B=O?c:l;return s("div",{className:p.root,children:[u(i,{title:O?"This app is using current dashboard asset.":"",placement:"bottom",children:u("div",{className:p.assetEditorWrapper,children:w&&u(e,d(d({},o),{},{disabled:O}))})}),u(i,{title:O?"Unlock Asset":"Return default",placement:"bottom",children:u("div",{className:p.iconButtonWrapper,children:u(a,{className:p.iconButton,"data-testid":"".concat(O?"UnlockAsset":"ReturnDefault","_IconButton"),onClick:function(){var e=!O;(y(e),e)&&((f?k:A)(),P(!1))},children:u(B,{})})})})]})}};export{f as default};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@corva/ui",
3
- "version": "0.68.0-4",
3
+ "version": "0.68.0-5",
4
4
  "description": "Shared components/utils for Corva ui projects",
5
5
  "keywords": [
6
6
  "corva-ui"