@corva/ui 0.37.0-9 → 0.37.0-rc.0
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
|
|
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 e from"@babel/runtime/helpers/defineProperty";import r from"prop-types";import t from"moment";import{makeStyles as i,Box as
|
|
1
|
+
import e from"@babel/runtime/helpers/defineProperty";import r from"prop-types";import t from"moment";import{makeStyles as i,Box as n,Typography as s}from"@material-ui/core";import{isNativeDetected as m}from"../../../utils/mobileDetect.js";import{Regular14 as a}from"../../Typography.js";import o from"../../Attachment/index.js";import{formatMentionText as l}from"../../UserMention/utils/index.js";import p from"../../CollapsibleContent.js";import{FEED_ITEM_TYPES as c}from"../../../constants/feed.js";import{jsxs as d,jsx as h}from"react/jsx-runtime";var u=i({label:{color:"#bbbbbb"},container:{marginRight:16}}),b=function(e){var r=e.feedItem,i=r.context[c.TRACES_MEMO],b=i.body,f=i.attachment,y=void 0===f?{}:f,g=i.bitDepth,R=i.holeDepth,D=i.timestamp,T=r.mentioned_users,j=u();return d(n,{whiteSpace:"pre-wrap",children:[b&&h(p,{children:h(s,{variant:"body1",gutterBottom:!0,children:l(b,T,m)})}),y&&(y.signed_url||y.url)&&h(o,{attachmentUrl:y.signed_url||y.url,attachmentSize:y.size,size:"medium"}),d(n,{display:"flex",mt:2,children:[d(a,{className:j.container,children:[h("span",{className:j.label,children:"Time: "}),t(1e3*D).format("MM.DD.YYYY, HH:mm")]}),d(a,{className:j.container,children:[h("span",{className:j.label,children:"Hole Depth: "}),R,"’"]}),d(a,{className:j.container,children:[h("span",{className:j.label,children:"Bit Depth: "}),g,"’"]})]})]})};b.propTypes={feedItem:r.shape({context:r.shape(e({},c.TRACES_MEMO,r.shape({body:r.string.isRequired,attachment:r.shape({url:r.string,size:r.number}),bitDepth:r.oneOfType([r.string,r.number]).isRequired,holeDepth:r.oneOfType([r.string,r.number]).isRequired,timestamp:r.oneOfType([r.string,r.number]).isRequired}).isRequired)).isRequired,mentioned_users:r.arrayOf(r.shape({}))}).isRequired};export{b as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{makeStyles as
|
|
1
|
+
import{makeStyles as a,Tooltip as o,IconButton as e}from"@material-ui/core";import t from"classnames";import{jsx as d}from"react/jsx-runtime";var c=a((function(a){return{root:{width:36,height:36,"&:hover":{backgroundColor:a.palette.background.b7},borderRadius:"50%"},button:{width:"100%",height:"100%","&:hover":{backgroundColor:a.palette.background.b7}}}}));function r(a){var r=a.className,i=a.disabled,l=a.isDraggableAndResizable,n=a.lockedIcon,s=a.onClick,b=a.pageName,u=c();return d(o,{title:i?"Can't unlock dashboard layout":l?"Lock Dashboard Layout":"Unlock Dashboard Layout",children:d("div",{className:t(u.root,r),children:d(e,{className:u.button,color:"primary","data-testid":"".concat(b,"_").concat(l?"gridUnlocked":"gridLocked"),disabled:i,onClick:s,children:d("img",{src:l?"/static/media/a26b034a29631cd21c82e74f67904071.svg":n,alt:"Lock"})})})})}r.defaultProps={lockedIcon:"/static/media/2d1e493e7f3afb84f4a5c8aded37a718.svg"},r.LockedWhiteIcon="/static/media/fb9a5d3233e9e3e310d6d297e6ddcc55.svg";export{r as default};
|