@corva/ui 0.37.0-10 → 0.37.0-11

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
- import e from"@babel/runtime/helpers/slicedToArray";import{useRef as t,useState as n,useEffect as a}from"react";import{get as i}from"lodash";import s from"prop-types";import o from"classnames";import{Tooltip as r}from"@material-ui/core";import"../../Annotations/components/AnnotationsList/index.js";import l from"../../Annotations/components/LastAnnotation/index.js";import"../../Annotations/AnnotationsContext.js";import{SEGMENTS as d}from"../../../constants/segment.js";import{DEV_CENTER_CLI_APP_ID as p}from"../../../constants/devcenter.js";import"../../../constants/goals.js";import"../../../constants/alerts.js";import"../../../constants/apps.js";import"../../../constants/drillstring.js";import"../../../constants/completion.js";import"../../../constants/notifications.js";import"../../../constants/feed.js";import"../../../constants/bha.js";import{getAppName as c,getAppSegment as m}from"../../../utils/devcenter.js";import u from"./VersionBadge.js";import h from"./PadMode.js";import{getAppDimension as f}from"./utils.js";import v from"../../AssetNameLabel/SecondaryAssetNameLabel.js";import A from"../../AssetNameLabel/PrimaryAssetNameLabel.js";import g from"./AppHeader.css.js";import{jsxs as b,Fragment as L,jsx as N}from"react/jsx-runtime";var j="DevCenter_AppHeader",w="EXTRA_LARGE",C="SMALL";function S(s){var S,_,x,y,M=s.app,W=s.appLastAnnotation,I=s.appSettings,R=s.badge,z=s.classes,H=s.coordinates,P=s.currentUser,D=s.fracFleet,F=s.isMaximized,T=s.onSettingChange,q=s.openAnnotationsList,O=s.rig,k=s.showLastAnnotation,U=s.updateCurrentDashboardAppLastAnnotation,E=s.well,B=s.wells,G=s.children,V=null==H?void 0:H.pixelWidth,X=f(V),J=c(M),K=null==M||null===(S=M.package)||void 0===S||null===(_=S.manifest)||void 0===_||null===(x=_.application)||void 0===x?void 0:x.subtitle,Q=m(M),Y=Q===d.DRILLING,Z=(null==M?void 0:M.settings)||{},$=Z.wellId,ee=Z.rigId,te=Z.fracFleetId,ne=Z.padId,ae=ne&&(null==D||null===(y=D.pad_frac_fleets.find((function(e){return e.pad.id===ne})))||void 0===y?void 0:y.pad),ie=Y?null==O?void 0:O.name:null==D?void 0:D.name,se=Y?$&&(null==E?void 0:E.name):ne&&(null==ae?void 0:ae.name),oe=!!($||ee||te),re=null!=D&&D.current_pad_id?"assets/types/pad/".concat(null==D?void 0:D.current_pad_id):null,le=Y?ie&&"assets/".concat(null==E?void 0:E.asset_id):re,de=ne&&"assets/types/pad/".concat(ne),pe=M&&M.id===p,ce=t(null),me=n({width:0}),ue=e(me,2),he=ue[0],fe=ue[1],ve=n({width:0}),Ae=e(ve,2),ge=Ae[0],be=Ae[1],Le=n(0),Ne=e(Le,2),je=Ne[0],we=Ne[1],Ce=n(!1),Se=e(Ce,2),_e=Se[0],xe=Se[1];return a((function(){var e,t;we((null==he?void 0:he.width)+(null==ge?void 0:ge.width)+16),xe(Math.abs((null===(e=ce.current)||void 0===e?void 0:e.offsetWidth)-(null===(t=ce.current)||void 0===t?void 0:t.scrollWidth))>1)}),[null==he?void 0:he.width,null==ge?void 0:ge.width,V]),b(L,{children:[b("div",{className:o(g.appHeaderContainer,z.appHeader),children:[b("div",{className:g.titleBlock,children:[b("div",{className:z.appHeaderTitleWrapper,ref:ce,children:[b("div",{className:g.titleWrapper,children:[N(r,{title:_e?J:"",placement:"bottom",children:N("h6",{"data-testid":"".concat(j,"_name"),className:g.title,children:J})}),N(u,{app:M})]}),R]}),K&&N("h6",{"data-testid":"".concat(j,"_subtitle"),className:g.subtitle,children:K})]}),b("div",{className:g.headerComponents,style:{marginRight:"".concat(je,"px")},children:[X===w&&N("div",{className:g.headerChildren,children:G}),Q===d.COMPLETION&&X!==C&&N("div",{className:g.padModeSelect,children:N(h,{fracFleet:D,wells:B,well:E,onSettingChange:T,appSettings:I})})]}),M&&H&&b("div",{className:o(g.assetNameLabelContainer,F&&g.appMaximized),children:[se&&N(v,{secondaryAssetName:se,coordinatesPixelWidth:H.pixelWidth,secondaryAssetLink:!pe&&de,pageName:j,onSize:function(e){return be(e)}}),oe&&N(A,{primaryAssetName:ie,pageName:j,coordinatesPixelWidth:H.pixelWidth,primaryAssetLink:le,onSize:function(e){return fe(e)}})]}),k&&W&&N(l,{dashboardAppId:M.id,appId:i(M,["app","id"]),annotation:W,openAnnotationsList:q,updateCurrentDashboardAppLastAnnotation:U,currentUser:P})]}),X===C&&N("div",{className:o(g.padModeSelect,g.smallPadModeSelect),children:N(h,{fracFleet:D,wells:B,well:E,onSettingChange:T,appSettings:I})}),X!==w&&N("div",{className:o(g.mediumSizeContent,g.headerComponents),children:N("div",{className:g.headerChildren,children:G})})]})}S.propTypes={app:s.object.isRequired,badge:s.node,classes:s.shape({appHeader:s.string,appHeaderTitleWrapper:s.string}),showLastAnnotation:s.bool,currentUser:s.shape({}),appLastAnnotation:s.shape({}),updateCurrentDashboardAppLastAnnotation:s.func,openAnnotationsList:s.func,rig:s.shape({name:s.string,asset_id:s.number}),well:s.shape({name:s.string,asset_id:s.number}),fracFleet:s.shape({name:s.string,current_pad_id:s.number,pad_frac_fleets:s.arrayOf(s.shape({pad:s.shape({id:s.number.isRequired}).isRequired})).isRequired}),wells:s.arrayOf(s.shape({})),coordinates:s.shape({pixelWidth:s.number.isRequired}),isMaximized:s.bool,appSettings:s.shape({}),onSettingChange:s.func,children:s.arrayOf(s.node)},S.defaultProps={appLastAnnotation:null,appSettings:null,badge:null,classes:{},coordinates:void 0,currentUser:void 0,fracFleet:null,isMaximized:!1,onSettingChange:void 0,openAnnotationsList:void 0,rig:null,showLastAnnotation:!0,updateCurrentDashboardAppLastAnnotation:function(){},well:null,wells:null,children:null};export{S as default};
1
+ import e from"@babel/runtime/helpers/slicedToArray";import{useRef as t,useState as n,useEffect as a}from"react";import{get as i}from"lodash";import s from"prop-types";import o from"classnames";import{Tooltip as r}from"@material-ui/core";import"../../Annotations/components/AnnotationsList/index.js";import l from"../../Annotations/components/LastAnnotation/index.js";import"../../Annotations/AnnotationsContext.js";import{SEGMENTS as d}from"../../../constants/segment.js";import{DEV_CENTER_CLI_APP_ID as p}from"../../../constants/devcenter.js";import"../../../constants/goals.js";import"../../../constants/alerts.js";import"../../../constants/apps.js";import"../../../constants/drillstring.js";import"../../../constants/completion.js";import"../../../constants/notifications.js";import"../../../constants/feed.js";import"../../../constants/bha.js";import{getAppName as c,getAppSegment as m}from"../../../utils/devcenter.js";import u from"./VersionBadge.js";import h from"./PadMode.js";import{getAppDimension as f}from"./utils.js";import v from"../../AssetNameLabel/SecondaryAssetNameLabel.js";import A from"../../AssetNameLabel/PrimaryAssetNameLabel.js";import g from"./AppHeader.css.js";import{jsxs as b,Fragment as L,jsx as N}from"react/jsx-runtime";var j="DevCenter_AppHeader",w="EXTRA_LARGE",C="SMALL",S=function(e){return"assets/".concat(null==e?void 0:e.asset_id)};function _(s){var _,x,y,M,W=s.app,I=s.appLastAnnotation,R=s.appSettings,z=s.badge,H=s.classes,P=s.coordinates,D=s.currentUser,F=s.fracFleet,T=s.isMaximized,q=s.onSettingChange,O=s.openAnnotationsList,k=s.rig,U=s.showLastAnnotation,E=s.updateCurrentDashboardAppLastAnnotation,B=s.well,G=s.wells,V=s.children,X=null==P?void 0:P.pixelWidth,J=f(X),K=c(W),Q=null==W||null===(_=W.package)||void 0===_||null===(x=_.manifest)||void 0===x||null===(y=x.application)||void 0===y?void 0:y.subtitle,Y=m(W),Z=Y===d.DRILLING,$=(null==W?void 0:W.settings)||{},ee=$.wellId,te=$.rigId,ne=$.fracFleetId,ae=$.padId,ie=ae&&(null==F||null===(M=F.pad_frac_fleets.find((function(e){return e.pad.id===ae})))||void 0===M?void 0:M.pad),se=Z?null==k?void 0:k.name:null==F?void 0:F.name,oe=Z?ee&&(null==B?void 0:B.name):ae&&(null==ie?void 0:ie.name),re=!!(ee||te||ne),le=null!=F&&F.current_pad_id?"assets/types/pad/".concat(null==F?void 0:F.current_pad_id):null,de=Z?se&&S(B):le,pe=Z?S(B):ae&&"assets/types/pad/".concat(ae),ce=W&&W.id===p,me=t(null),ue=n({width:0}),he=e(ue,2),fe=he[0],ve=he[1],Ae=n({width:0}),ge=e(Ae,2),be=ge[0],Le=ge[1],Ne=n(0),je=e(Ne,2),we=je[0],Ce=je[1],Se=n(!1),_e=e(Se,2),xe=_e[0],ye=_e[1];return a((function(){var e,t;Ce((null==fe?void 0:fe.width)+(null==be?void 0:be.width)+16),ye(Math.abs((null===(e=me.current)||void 0===e?void 0:e.offsetWidth)-(null===(t=me.current)||void 0===t?void 0:t.scrollWidth))>1)}),[null==fe?void 0:fe.width,null==be?void 0:be.width,X]),b(L,{children:[b("div",{className:o(g.appHeaderContainer,H.appHeader),children:[b("div",{className:g.titleBlock,children:[b("div",{className:H.appHeaderTitleWrapper,ref:me,children:[b("div",{className:g.titleWrapper,children:[N(r,{title:xe?K:"",placement:"bottom",children:N("h6",{"data-testid":"".concat(j,"_name"),className:g.title,children:K})}),N(u,{app:W})]}),z]}),Q&&N("h6",{"data-testid":"".concat(j,"_subtitle"),className:g.subtitle,children:Q})]}),b("div",{className:g.headerComponents,style:{marginRight:"".concat(we,"px")},children:[J===w&&N("div",{className:g.headerChildren,children:V}),Y===d.COMPLETION&&J!==C&&N("div",{className:g.padModeSelect,children:N(h,{fracFleet:F,wells:G,well:B,onSettingChange:q,appSettings:R})})]}),W&&P&&b("div",{className:o(g.assetNameLabelContainer,T&&g.appMaximized),children:[oe&&N(v,{secondaryAssetName:oe,coordinatesPixelWidth:P.pixelWidth,secondaryAssetLink:!ce&&pe,pageName:j,onSize:function(e){return Le(e)}}),re&&N(A,{primaryAssetName:se,pageName:j,coordinatesPixelWidth:P.pixelWidth,primaryAssetLink:de,onSize:function(e){return ve(e)}})]}),U&&I&&N(l,{dashboardAppId:W.id,appId:i(W,["app","id"]),annotation:I,openAnnotationsList:O,updateCurrentDashboardAppLastAnnotation:E,currentUser:D})]}),J===C&&N("div",{className:o(g.padModeSelect,g.smallPadModeSelect),children:N(h,{fracFleet:F,wells:G,well:B,onSettingChange:q,appSettings:R})}),J!==w&&N("div",{className:o(g.mediumSizeContent,g.headerComponents),children:N("div",{className:g.headerChildren,children:V})})]})}_.propTypes={app:s.object.isRequired,badge:s.node,classes:s.shape({appHeader:s.string,appHeaderTitleWrapper:s.string}),showLastAnnotation:s.bool,currentUser:s.shape({}),appLastAnnotation:s.shape({}),updateCurrentDashboardAppLastAnnotation:s.func,openAnnotationsList:s.func,rig:s.shape({name:s.string,asset_id:s.number}),well:s.shape({name:s.string,asset_id:s.number}),fracFleet:s.shape({name:s.string,current_pad_id:s.number,pad_frac_fleets:s.arrayOf(s.shape({pad:s.shape({id:s.number.isRequired}).isRequired})).isRequired}),wells:s.arrayOf(s.shape({})),coordinates:s.shape({pixelWidth:s.number.isRequired}),isMaximized:s.bool,appSettings:s.shape({}),onSettingChange:s.func,children:s.arrayOf(s.node)},_.defaultProps={appLastAnnotation:null,appSettings:null,badge:null,classes:{},coordinates:void 0,currentUser:void 0,fracFleet:null,isMaximized:!1,onSettingChange:void 0,openAnnotationsList:void 0,rig:null,showLastAnnotation:!0,updateCurrentDashboardAppLastAnnotation:function(){},well:null,wells:null,children:null};export{_ as default};
@@ -1 +1 @@
1
- import{makeStyles as e,Tooltip as a,IconButton as c}from"@material-ui/core";import o from"classnames";import{jsx as r}from"react/jsx-runtime";var t=e((function(e){return{root:{width:36,height:36,"&:hover":{backgroundColor:e.palette.background.b7}}}}));function d(e){var d=e.pageName,i=e.isDraggableAndResizable,n=e.className,l=e.lockedIcon,s=e.onClick,m=t();return r(a,{title:i?"Lock Grid":"Unlock Grid",children:r(c,{className:o(m.root,n),color:"primary","data-testid":"".concat(d,"_").concat(i?"gridUnlocked":"gridLocked"),onClick:s,children:r("img",{src:i?"/static/media/a26b034a29631cd21c82e74f67904071.svg":l,alt:"Lock"})})})}d.defaultProps={lockedIcon:"/static/media/2d1e493e7f3afb84f4a5c8aded37a718.svg"},d.LockedWhiteIcon="/static/media/fb9a5d3233e9e3e310d6d297e6ddcc55.svg";export{d as default};
1
+ import{makeStyles as e,Tooltip as a,IconButton as o}from"@material-ui/core";import c from"classnames";import{jsx as d}from"react/jsx-runtime";var r=e((function(e){return{root:{width:36,height:36,"&:hover":{backgroundColor:e.palette.background.b7},borderRadius:"50%"},button:{width:"100%",height:"100%","&:hover":{backgroundColor:e.palette.background.b7}}}}));function t(e){var t=e.className,i=e.disabled,n=e.isDraggableAndResizable,l=e.lockedIcon,s=e.onClick,m=e.pageName,b=r();return d(a,{title:i?"Can't unlock grid":n?"Lock Grid":"Unlock Grid",children:d("div",{className:c(b.root,t),children:d(o,{className:b.button,color:"primary","data-testid":"".concat(m,"_").concat(n?"gridUnlocked":"gridLocked"),disabled:i,onClick:s,children:d("img",{src:n?"/static/media/a26b034a29631cd21c82e74f67904071.svg":l,alt:"Lock"})})})})}t.defaultProps={lockedIcon:"/static/media/2d1e493e7f3afb84f4a5c8aded37a718.svg"},t.LockedWhiteIcon="/static/media/fb9a5d3233e9e3e310d6d297e6ddcc55.svg";export{t as default};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@corva/ui",
3
- "version": "0.37.0-10",
3
+ "version": "0.37.0-11",
4
4
  "description": "Shared components/utils for Corva ui projects",
5
5
  "keywords": [
6
6
  "corva-ui"