@corva/ui 3.6.0-0 → 3.6.0-1
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("@babel/runtime/helpers/defineProperty"),t=require("@babel/runtime/helpers/slicedToArray"),a=require("react"),s=require("lodash"),n=require("prop-types"),i=require("classnames"),r=require("@material-ui/core"),l=require("../../AssetNameLabel/SecondaryAssetNameLabel.js"),d=require("../../AssetNameLabel/AssetNameLabel.js"),o=require("./VersionBadge.js"),u=require("./PadMode.js"),p=require("./utils.js"),c=require("./PadIcon.js"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@babel/runtime/helpers/defineProperty"),t=require("@babel/runtime/helpers/slicedToArray"),a=require("react"),s=require("lodash"),n=require("prop-types"),i=require("classnames"),r=require("@material-ui/core"),l=require("../../AssetNameLabel/SecondaryAssetNameLabel.js"),d=require("../../AssetNameLabel/AssetNameLabel.js"),o=require("./VersionBadge.js"),u=require("./PadMode.js"),p=require("./utils.js"),c=require("./PadIcon.js"),m=require("./AppHeaderStyles.js"),f=require("./AppHeader.css.js"),g=require("../../Annotations/components/LastAnnotation/index.js"),v=require("../../../constants/segment.js"),A=require("../../../constants/devcenter.js");require("../../../constants/goals.js"),require("../../../constants/alerts.js"),require("../../../constants/apps.js"),require("../../../constants/drillstring.js"),require("../../../constants/completion.js"),require("../../../constants/appPackages.js"),require("../../../constants/notifications.js"),require("../../../constants/feed.js"),require("../../../constants/bha.js"),require("../../../utils/env.js"),require("../../GradientManager/configuration/constants.js");var j=require("../../../utils/devcenter.js"),h=require("../../../utils/mobileDetect.js"),b=require("../DevCenterAppContainer/components/AppCommons/AppCommonsContext.js"),y=require("react/jsx-runtime");function S(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var x=S(e),q=S(t),N=S(n),P=S(i);function L(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,s)}return a}function _(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?L(Object(a),!0).forEach((function(t){x.default(e,t,a[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):L(Object(a)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))}))}return e}var I="DevCenter_AppHeader",O=function(e){return(null==e?void 0:e.asset_id)&&"/assets/".concat(null==e?void 0:e.asset_id)};function C(e){var t,n,i,u,S,x,N,L,C,M,w,E,T,W=e.app,D=e.appLastAnnotation,k=e.appSettings,F=e.badge,B=e.children,H=e.classes,R=e.coordinates,U=e.currentUser,V=e.fracFleet,G=e.isMaximized,z=e.logoSrc,Y=e.onSettingChange,Z=e.openAnnotationsList,J=e.primaryAssetStatusBadge,K=e.rig,Q=e.showLastAnnotation,X=e.updateCurrentDashboardAppLastAnnotation,$=e.well,ee=e.wells,te=e.PadModeComponent,ae=e.activeWellName,se=(b.useAppCommons()||{}).dashboardMeta,ne=se&&se.v3&&!se.isMultiAsset&&!se.isMultiWell,ie=a.useState(!1),re=q.default(ie,2),le=re[0],de=re[1],oe=a.useRef(null),ue=null==R?void 0:R.pixelWidth;a.useEffect((function(){var e,t;de((null===(e=oe.current)||void 0===e?void 0:e.scrollWidth)>(null===(t=oe.current)||void 0===t?void 0:t.offsetWidth))}),[null===(t=oe.current)||void 0===t?void 0:t.offsetWidth,ue]);var pe=p.getAppDimension(ue),ce=j.getAppName(W),me=j.getAppSegment(W),fe=me===v.SEGMENTS.COMPLETION,ge=function(e){var t,a=e.appSettings,s=void 0===a?{}:a,n=e.well,i=e.rig,r=e.fracFleet,l=e.segment,d=l===v.SEGMENTS.DRILLING,o=l===v.SEGMENTS.COMPLETION,u=s.wellId,p=s.rigId,c=s.fracFleetId,m=s.padId,f=null==r||null===(t=r.pad_frac_fleets.find((function(e){return e.pad.id===(m||r.current_pad_id)})))||void 0===t?void 0:t.pad,g=d?u&&(null==n?void 0:n.name):null==f?void 0:f.name,A="/assets/types/pad/".concat(m||(null==r?void 0:r.current_pad_id)),j=d?null==i?void 0:i.name:null==r?void 0:r.name,h=!!(u||p||c),b=!1,y=d?j&&O(n):A;return o&&!h&&null!=n&&n.id&&null!=n&&n.name&&(b=!0,h=!0,y=O(n),j=n.name),{isPrimaryAssetStatusVisible:b,isPrimaryNameVisible:h,primaryAssetLink:y,primaryAssetName:j,secondaryAssetLink:d?O(n):"/assets/types/pad/".concat(m||(null==r?void 0:r.current_pad_id)),secondaryAssetName:g}}({appSettings:null==W?void 0:W.settings,well:$,rig:K,fracFleet:V,segment:me}),ve=ge.isPrimaryAssetStatusVisible,Ae=ge.isPrimaryNameVisible,je=ge.primaryAssetLink,he=ge.primaryAssetName,be=ge.secondaryAssetLink,ye=ge.secondaryAssetName,Se=[p.APP_LAYOUT_SIZES.MEDIUM,p.APP_LAYOUT_SIZES.SMALL].includes(pe),xe=W&&W.id===A.DEV_CENTER_CLI_APP_ID,qe={fracFleet:V,wells:ee,well:$,onSettingChange:Y,appSettings:k,disableActiveWellsInPadSelect:null==W||null===(n=W.package)||void 0===n||null===(i=n.manifest)||void 0===i||null===(u=i.application)||void 0===u||null===(S=u.ui)||void 0===S?void 0:S.disableActiveWellsInPadSelect,enableSimulFracInPadSelect:null==W||null===(x=W.package)||void 0===x||null===(N=x.manifest)||void 0===N||null===(L=N.application)||void 0===L||null===(C=L.ui)||void 0===C?void 0:C.enableSimulFracInPadSelect,completionAppType:null==W||null===(M=W.package)||void 0===M||null===(w=M.manifest)||void 0===w||null===(E=w.application)||void 0===E||null===(T=E.ui)||void 0===T?void 0:T.completionAppType},Ne=m.useStyles({isMobileSize:Se});return y.jsxs("div",{className:P.default(Ne.appHeaderWrapper,H.appHeader),children:[y.jsxs("div",{className:Ne.appHeaderContainer,children:[y.jsx("div",{className:P.default(Ne.titleBlock,H.titleBlock),children:y.jsxs("div",{className:H.appHeaderTitleWrapper,ref:oe,children:[y.jsxs("div",{className:Ne.titleWrapper,children:[z&&y.jsxs(y.Fragment,{children:[y.jsx("img",{className:Ne.logo,src:z,alt:"company logo"}),y.jsx("div",{className:Ne.separateLine})]}),y.jsx(r.Tooltip,{title:le?ce:"",placement:"bottom",children:y.jsx("h6",{"data-testid":"".concat(I,"_name"),className:Ne.title,children:ce})}),y.jsx(o.VersionBadge,{appPackage:null==W?void 0:W.package})]}),F]})}),W&&R&&y.jsxs("div",{className:P.default(f.controlsContainer,G&&f.appMaximized),children:[!Se&&y.jsxs(y.Fragment,{children:[fe&&ae&&y.jsx(r.Typography,{variant:"caption",children:ae}),fe&&y.jsx(te,_({},qe)),B]}),!h.isInsideNewMobileApp&&!ne&&y.jsxs("div",{className:f.assetLabels,children:[ye&&y.jsx(l.SecondaryAssetNameLabel,{assetName:ye,coordinatesPixelWidth:ue,dataTestId:"".concat(I,"_secondaryAsset"),href:!xe&&be,icon:fe&&y.jsx(c.PadIcon,{}),isColored:!fe||W.settings.padId&&W.settings.padId!==V.current_pad_id}),Ae&&y.jsx(d.AssetNameLabel,{assetName:he,coordinatesPixelWidth:ue,dataTestId:"".concat(I,"_primaryAsset"),href:!xe&&je,statusBadge:ve&&J})]})]}),Q&&D&&y.jsx(g,{annotation:D,appId:s.get(W,["app","id"]),currentUser:U,dashboardAppId:W.id,openAnnotationsList:Z,updateCurrentDashboardAppLastAnnotation:X})]}),Se&&y.jsxs(r.Box,{display:"flex",alignItems:"center",mt:1,children:[fe&&!$&&(ee||V)&&y.jsx("div",{className:f.padModeSelect,children:y.jsx(te,_({},qe))}),B]})]})}C.propTypes={app:N.default.object.isRequired,badge:N.default.node,classes:N.default.shape({appHeader:N.default.string,titleBlock:N.default.string,appHeaderTitleWrapper:N.default.string}),showLastAnnotation:N.default.bool,currentUser:N.default.shape({}),appLastAnnotation:N.default.shape({}),updateCurrentDashboardAppLastAnnotation:N.default.func,openAnnotationsList:N.default.func,rig:N.default.shape({name:N.default.string,asset_id:N.default.number}),well:N.default.shape({name:N.default.string,asset_id:N.default.number}),fracFleet:N.default.shape({name:N.default.string,current_pad_id:N.default.number,pad_frac_fleets:N.default.arrayOf(N.default.shape({pad:N.default.shape({id:N.default.number.isRequired,name:N.default.string}).isRequired})).isRequired}),wells:N.default.arrayOf(N.default.shape({})),coordinates:N.default.shape({pixelWidth:N.default.number.isRequired}),isMaximized:N.default.bool,appSettings:N.default.shape({}),onSettingChange:N.default.func,children:N.default.node,logoSrc:N.default.string,primaryAssetStatusBadge:N.default.node,PadModeComponent:N.default.elementType,activeWellName:N.default.string},C.defaultProps={appLastAnnotation:null,appSettings:null,badge:null,children:null,classes:{},coordinates:void 0,currentUser:void 0,fracFleet:null,isMaximized:!1,logoSrc:null,onSettingChange:void 0,openAnnotationsList:void 0,rig:null,showLastAnnotation:!0,updateCurrentDashboardAppLastAnnotation:function(){},well:null,wells:null,primaryAssetStatusBadge:null,PadModeComponent:u,activeWellName:null},exports.PAGE_NAME=I,exports.default=C;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AppHeader.d.ts","sourceRoot":"","sources":["../../../../src/components/DevCenter/AppHeader/AppHeader.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AppHeader.d.ts","sourceRoot":"","sources":["../../../../src/components/DevCenter/AppHeader/AppHeader.js"],"names":[],"mappings":"AAwBA,8CAA+C;;AA4C/C;;;;;;;;;;;;;;;;;;;;;;gBAwJC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QA8D0C,kEAAQ;;;;;;;;;;;;;sBAxR7B,YAAY;oBAQd,WAAW"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"@babel/runtime/helpers/defineProperty";import t from"@babel/runtime/helpers/slicedToArray";import{useState as a,useRef as n,useEffect as i}from"react";import{get as s}from"lodash";import r from"prop-types";import o from"classnames";import{Tooltip as l,Typography as p,Box as d}from"@material-ui/core";import{SecondaryAssetNameLabel as c}from"../../AssetNameLabel/SecondaryAssetNameLabel.js";import{AssetNameLabel as m}from"../../AssetNameLabel/AssetNameLabel.js";import{VersionBadge as u}from"./VersionBadge.js";import f from"./PadMode.js";import{APP_LAYOUT_SIZES as
|
|
1
|
+
import e from"@babel/runtime/helpers/defineProperty";import t from"@babel/runtime/helpers/slicedToArray";import{useState as a,useRef as n,useEffect as i}from"react";import{get as s}from"lodash";import r from"prop-types";import o from"classnames";import{Tooltip as l,Typography as p,Box as d}from"@material-ui/core";import{SecondaryAssetNameLabel as c}from"../../AssetNameLabel/SecondaryAssetNameLabel.js";import{AssetNameLabel as m}from"../../AssetNameLabel/AssetNameLabel.js";import{VersionBadge as u}from"./VersionBadge.js";import f from"./PadMode.js";import{APP_LAYOUT_SIZES as v,getAppDimension as g}from"./utils.js";import{PadIcon as h}from"./PadIcon.js";import{useStyles as A}from"./AppHeaderStyles.js";import b from"./AppHeader.css.js";import y from"../../Annotations/components/LastAnnotation/index.js";import{SEGMENTS as j}from"../../../constants/segment.js";import{DEV_CENTER_CLI_APP_ID as L}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/appPackages.js";import"../../../constants/notifications.js";import"../../../constants/feed.js";import"../../../constants/bha.js";import"../../../utils/env.js";import"../../GradientManager/configuration/constants.js";import{getAppName as S,getAppSegment as N}from"../../../utils/devcenter.js";import{isInsideNewMobileApp as P}from"../../../utils/mobileDetect.js";import{useAppCommons as O}from"../DevCenterAppContainer/components/AppCommons/AppCommonsContext.js";import{jsxs as C,jsx as _,Fragment as I}from"react/jsx-runtime";function w(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,n)}return a}function M(t){for(var a=1;a<arguments.length;a++){var n=null!=arguments[a]?arguments[a]:{};a%2?w(Object(n),!0).forEach((function(a){e(t,a,n[a])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):w(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var W="DevCenter_AppHeader",k=function(e){return(null==e?void 0:e.asset_id)&&"/assets/".concat(null==e?void 0:e.asset_id)};function x(e){var r,f,w,x,D,T,F,H,B,R,q,z,E,U=e.app,V=e.appLastAnnotation,G=e.appSettings,J=e.badge,K=e.children,Q=e.classes,X=e.coordinates,Y=e.currentUser,Z=e.fracFleet,$=e.isMaximized,ee=e.logoSrc,te=e.onSettingChange,ae=e.openAnnotationsList,ne=e.primaryAssetStatusBadge,ie=e.rig,se=e.showLastAnnotation,re=e.updateCurrentDashboardAppLastAnnotation,oe=e.well,le=e.wells,pe=e.PadModeComponent,de=e.activeWellName,ce=(O()||{}).dashboardMeta,me=ce&&ce.v3&&!ce.isMultiAsset&&!ce.isMultiWell,ue=a(!1),fe=t(ue,2),ve=fe[0],ge=fe[1],he=n(null),Ae=null==X?void 0:X.pixelWidth;i((function(){var e,t;ge((null===(e=he.current)||void 0===e?void 0:e.scrollWidth)>(null===(t=he.current)||void 0===t?void 0:t.offsetWidth))}),[null===(r=he.current)||void 0===r?void 0:r.offsetWidth,Ae]);var be=g(Ae),ye=S(U),je=N(U),Le=je===j.COMPLETION,Se=function(e){var t,a=e.appSettings,n=void 0===a?{}:a,i=e.well,s=e.rig,r=e.fracFleet,o=e.segment,l=o===j.DRILLING,p=o===j.COMPLETION,d=n.wellId,c=n.rigId,m=n.fracFleetId,u=n.padId,f=null==r||null===(t=r.pad_frac_fleets.find((function(e){return e.pad.id===(u||r.current_pad_id)})))||void 0===t?void 0:t.pad,v=l?d&&(null==i?void 0:i.name):null==f?void 0:f.name,g="/assets/types/pad/".concat(u||(null==r?void 0:r.current_pad_id)),h=l?null==s?void 0:s.name:null==r?void 0:r.name,A=!!(d||c||m),b=!1,y=l?h&&k(i):g;return p&&!A&&null!=i&&i.id&&null!=i&&i.name&&(b=!0,A=!0,y=k(i),h=i.name),{isPrimaryAssetStatusVisible:b,isPrimaryNameVisible:A,primaryAssetLink:y,primaryAssetName:h,secondaryAssetLink:l?k(i):"/assets/types/pad/".concat(u||(null==r?void 0:r.current_pad_id)),secondaryAssetName:v}}({appSettings:null==U?void 0:U.settings,well:oe,rig:ie,fracFleet:Z,segment:je}),Ne=Se.isPrimaryAssetStatusVisible,Pe=Se.isPrimaryNameVisible,Oe=Se.primaryAssetLink,Ce=Se.primaryAssetName,_e=Se.secondaryAssetLink,Ie=Se.secondaryAssetName,we=[v.MEDIUM,v.SMALL].includes(be),Me=U&&U.id===L,We={fracFleet:Z,wells:le,well:oe,onSettingChange:te,appSettings:G,disableActiveWellsInPadSelect:null==U||null===(f=U.package)||void 0===f||null===(w=f.manifest)||void 0===w||null===(x=w.application)||void 0===x||null===(D=x.ui)||void 0===D?void 0:D.disableActiveWellsInPadSelect,enableSimulFracInPadSelect:null==U||null===(T=U.package)||void 0===T||null===(F=T.manifest)||void 0===F||null===(H=F.application)||void 0===H||null===(B=H.ui)||void 0===B?void 0:B.enableSimulFracInPadSelect,completionAppType:null==U||null===(R=U.package)||void 0===R||null===(q=R.manifest)||void 0===q||null===(z=q.application)||void 0===z||null===(E=z.ui)||void 0===E?void 0:E.completionAppType},ke=A({isMobileSize:we});return C("div",{className:o(ke.appHeaderWrapper,Q.appHeader),children:[C("div",{className:ke.appHeaderContainer,children:[_("div",{className:o(ke.titleBlock,Q.titleBlock),children:C("div",{className:Q.appHeaderTitleWrapper,ref:he,children:[C("div",{className:ke.titleWrapper,children:[ee&&C(I,{children:[_("img",{className:ke.logo,src:ee,alt:"company logo"}),_("div",{className:ke.separateLine})]}),_(l,{title:ve?ye:"",placement:"bottom",children:_("h6",{"data-testid":"".concat(W,"_name"),className:ke.title,children:ye})}),_(u,{appPackage:null==U?void 0:U.package})]}),J]})}),U&&X&&C("div",{className:o(b.controlsContainer,$&&b.appMaximized),children:[!we&&C(I,{children:[Le&&de&&_(p,{variant:"caption",children:de}),Le&&_(pe,M({},We)),K]}),!P&&!me&&C("div",{className:b.assetLabels,children:[Ie&&_(c,{assetName:Ie,coordinatesPixelWidth:Ae,dataTestId:"".concat(W,"_secondaryAsset"),href:!Me&&_e,icon:Le&&_(h,{}),isColored:!Le||U.settings.padId&&U.settings.padId!==Z.current_pad_id}),Pe&&_(m,{assetName:Ce,coordinatesPixelWidth:Ae,dataTestId:"".concat(W,"_primaryAsset"),href:!Me&&Oe,statusBadge:Ne&&ne})]})]}),se&&V&&_(y,{annotation:V,appId:s(U,["app","id"]),currentUser:Y,dashboardAppId:U.id,openAnnotationsList:ae,updateCurrentDashboardAppLastAnnotation:re})]}),we&&C(d,{display:"flex",alignItems:"center",mt:1,children:[Le&&!oe&&(le||Z)&&_("div",{className:b.padModeSelect,children:_(pe,M({},We))}),K]})]})}x.propTypes={app:r.object.isRequired,badge:r.node,classes:r.shape({appHeader:r.string,titleBlock:r.string,appHeaderTitleWrapper:r.string}),showLastAnnotation:r.bool,currentUser:r.shape({}),appLastAnnotation:r.shape({}),updateCurrentDashboardAppLastAnnotation:r.func,openAnnotationsList:r.func,rig:r.shape({name:r.string,asset_id:r.number}),well:r.shape({name:r.string,asset_id:r.number}),fracFleet:r.shape({name:r.string,current_pad_id:r.number,pad_frac_fleets:r.arrayOf(r.shape({pad:r.shape({id:r.number.isRequired,name:r.string}).isRequired})).isRequired}),wells:r.arrayOf(r.shape({})),coordinates:r.shape({pixelWidth:r.number.isRequired}),isMaximized:r.bool,appSettings:r.shape({}),onSettingChange:r.func,children:r.node,logoSrc:r.string,primaryAssetStatusBadge:r.node,PadModeComponent:r.elementType,activeWellName:r.string},x.defaultProps={appLastAnnotation:null,appSettings:null,badge:null,children:null,classes:{},coordinates:void 0,currentUser:void 0,fracFleet:null,isMaximized:!1,logoSrc:null,onSettingChange:void 0,openAnnotationsList:void 0,rig:null,showLastAnnotation:!0,updateCurrentDashboardAppLastAnnotation:function(){},well:null,wells:null,primaryAssetStatusBadge:null,PadModeComponent:f,activeWellName:null};export{W as PAGE_NAME,x as default};
|