@corva/ui 0.42.0-1 → 0.42.0-2

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'./../../../ext-esm/style-inject/dist/style-inject.es.js';var d={headerComponents:"AppHeader_headerComponents__basLj",padModeSelect:"AppHeader_padModeSelect__CP-Ia",smallPadModeSelect:"AppHeader_smallPadModeSelect__a5Xo6",mediumSizeContent:"AppHeader_mediumSizeContent__xb-Wo",headerChildren:"AppHeader_headerChildren__HJCQq",controlsContainer:"AppHeader_controlsContainer__aX0s9",appMaximized:"AppHeader_appMaximized__lT1ld",item:"AppHeader_item__uDz5N",secondaryAsset:"AppHeader_secondaryAsset__AoPAz",seccondaryAssetWrapper:"AppHeader_seccondaryAssetWrapper__OGaNa",seccondaryAssetLink:"AppHeader_seccondaryAssetLink__fZb2u"};e(".AppHeader_headerComponents__basLj{display:flex;justify-content:flex-end}.AppHeader_padModeSelect__CP-Ia{height:24px;z-index:999}.AppHeader_padModeSelect__CP-Ia>div:first-child{padding-top:0!important}.AppHeader_smallPadModeSelect__a5Xo6{height:24px;margin-top:8px}.AppHeader_smallPadModeSelect__a5Xo6>div:first-child{padding-bottom:0;padding-left:0;padding-top:8px}.AppHeader_mediumSizeContent__xb-Wo{justify-content:flex-start;margin-top:8px}.AppHeader_mediumSizeContent__xb-Wo .AppHeader_headerChildren__HJCQq{padding:0}.AppHeader_headerChildren__HJCQq{display:flex;padding:0 0 12px 16px}.AppHeader_headerChildren__HJCQq,.AppHeader_headerChildren__HJCQq>*{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.AppHeader_controlsContainer__aX0s9{align-items:center;display:flex;justify-content:flex-end;margin-top:4px;position:absolute;right:15px;top:10px;width:100%;z-index:100}.AppHeader_controlsContainer__aX0s9>:not(:last-child){padding:0 16px}.AppHeader_appMaximized__lT1ld{margin-right:28px}.AppHeader_item__uDz5N{background-color:#434343;border-radius:10px;color:var(--palette-primary-text-1);font-size:.85rem;line-height:20px;padding:0 12px}.dc-app-container__light-theme .AppHeader_item__uDz5N{background-color:#bdbdbd}.AppHeader_item__uDz5N.AppHeader_secondaryAsset__AoPAz{background-color:#d860d8;height:21px;margin-right:4px;min-width:60px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.AppHeader_seccondaryAssetWrapper__OGaNa{max-width:20%}.AppHeader_seccondaryAssetLink__fZb2u{padding:0;width:100%}");export{d as default};
1
+ import e from'./../../../ext-esm/style-inject/dist/style-inject.es.js';var d={padModeSelect:"AppHeader_padModeSelect__CP-Ia",smallPadModeSelect:"AppHeader_smallPadModeSelect__a5Xo6",mediumSizeContent:"AppHeader_mediumSizeContent__xb-Wo",headerChildren:"AppHeader_headerChildren__HJCQq",controlsContainer:"AppHeader_controlsContainer__aX0s9",appMaximized:"AppHeader_appMaximized__lT1ld",item:"AppHeader_item__uDz5N",secondaryAsset:"AppHeader_secondaryAsset__AoPAz",seccondaryAssetWrapper:"AppHeader_seccondaryAssetWrapper__OGaNa",seccondaryAssetLink:"AppHeader_seccondaryAssetLink__fZb2u"};e(".AppHeader_padModeSelect__CP-Ia{height:24px;z-index:999}.AppHeader_padModeSelect__CP-Ia>div:first-child{padding-top:0!important}.AppHeader_smallPadModeSelect__a5Xo6{height:24px;margin-top:8px}.AppHeader_smallPadModeSelect__a5Xo6>div:first-child{padding-bottom:0;padding-left:0;padding-top:8px}.AppHeader_mediumSizeContent__xb-Wo{justify-content:flex-start;margin-top:8px}.AppHeader_mediumSizeContent__xb-Wo .AppHeader_headerChildren__HJCQq{padding:0}.AppHeader_headerChildren__HJCQq{display:flex;padding:0 0 12px 16px}.AppHeader_headerChildren__HJCQq,.AppHeader_headerChildren__HJCQq>*{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.AppHeader_controlsContainer__aX0s9{align-items:center;display:flex;justify-content:flex-end;margin-top:4px;position:absolute;right:15px;top:10px;width:100%;z-index:100}.AppHeader_controlsContainer__aX0s9>:not(:last-child){padding:0 16px}.AppHeader_appMaximized__lT1ld{margin-right:28px}.AppHeader_item__uDz5N{background-color:#434343;border-radius:10px;color:var(--palette-primary-text-1);font-size:.85rem;line-height:20px;padding:0 12px}.dc-app-container__light-theme .AppHeader_item__uDz5N{background-color:#bdbdbd}.AppHeader_item__uDz5N.AppHeader_secondaryAsset__AoPAz{background-color:#d860d8;height:21px;margin-right:4px;min-width:60px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.AppHeader_seccondaryAssetWrapper__OGaNa{max-width:20%}.AppHeader_seccondaryAssetLink__fZb2u{padding:0;width:100%}");export{d as default};
@@ -1 +1 @@
1
- import e from"@babel/runtime/helpers/defineProperty";import t from"@babel/runtime/helpers/slicedToArray";import{useRef as n,useState as a,useEffect as r}from"react";import{get as i}from"lodash";import s from"prop-types";import o from"classnames";import{Tooltip as l}from"@material-ui/core";import"../../Annotations/components/AnnotationsList/index.js";import p 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 c}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 m,getAppSegment as u}from"../../../utils/devcenter.js";import f from"./VersionBadge.js";import h from"./PadMode.js";import{getAppDimension as b}from"./utils.js";import v from"../../AssetNameLabel/SecondaryAssetNameLabel.js";import g from"../../AssetNameLabel/PrimaryAssetNameLabel.js";import A from"./AppHeader.css.js";import{useStyles as j}from"./AppHeaderStyles.js";import{jsxs as L,Fragment as y,jsx as O}from"react/jsx-runtime";function w(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function N(t){for(var n=1;n<arguments.length;n++){var a=null!=arguments[n]?arguments[n]:{};n%2?w(Object(a),!0).forEach((function(n){e(t,n,a[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):w(Object(a)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(a,e))}))}return t}var S="DevCenter_AppHeader",P="SMALL",C=function(e){return"assets/".concat(null==e?void 0:e.asset_id)};function _(e){var s,w,_,x,M=e.app,W=e.appLastAnnotation,D=e.appSettings,I=e.badge,H=e.classes,z=e.coordinates,R=e.currentUser,T=e.fracFleet,k=e.isMaximized,q=e.onSettingChange,F=e.openAnnotationsList,E=e.rig,U=e.showLastAnnotation,B=e.updateCurrentDashboardAppLastAnnotation,G=e.well,V=e.wells,J=e.children,K=j(),Q=null==z?void 0:z.pixelWidth,X=b(Q),Y=m(M),Z=null==M||null===(s=M.package)||void 0===s||null===(w=s.manifest)||void 0===w||null===(_=w.application)||void 0===_?void 0:_.subtitle,$=u(M),ee=$===d.DRILLING,te=(null==M?void 0:M.settings)||{},ne=te.wellId,ae=te.rigId,re=te.fracFleetId,ie=te.padId,se=ie&&(null==T||null===(x=T.pad_frac_fleets.find((function(e){return e.pad.id===ie})))||void 0===x?void 0:x.pad),oe=ee?null==E?void 0:E.name:null==T?void 0:T.name,le=ee?ne&&(null==G?void 0:G.name):ie&&(null==se?void 0:se.name),pe=!!(ne||ae||re),de=null!=T&&T.current_pad_id?"assets/types/pad/".concat(null==T?void 0:T.current_pad_id):null,ce=ee?oe&&C(G):de,me=ee?C(G):ie&&"assets/types/pad/".concat(ie),ue=M&&M.id===c,fe={fracFleet:T,wells:V,well:G,onSettingChange:q,appSettings:D},he=n(null),be=a({width:0}),ve=t(be,2),ge=ve[0],Ae=ve[1],je=a({width:0}),Le=t(je,2),ye=Le[0],Oe=Le[1],we=a(!1),Ne=t(we,2),Se=Ne[0],Pe=Ne[1];return r((function(){var e,t;Pe(Math.abs((null===(e=he.current)||void 0===e?void 0:e.offsetWidth)-(null===(t=he.current)||void 0===t?void 0:t.scrollWidth))>1)}),[null==ge?void 0:ge.width,null==ye?void 0:ye.width,Q]),L(y,{children:[L("div",{className:o(K.appHeaderContainer,H.appHeader),children:[L("div",{className:K.titleBlock,children:[L("div",{className:H.appHeaderTitleWrapper,ref:he,children:[L("div",{className:K.titleWrapper,children:[O(l,{title:Se?Y:"",placement:"bottom",children:O("h6",{"data-testid":"".concat(S,"_name"),className:K.title,children:Y})}),O(f,{app:M})]}),I]}),Z&&O("h6",{"data-testid":"".concat(S,"_subtitle"),className:K.subtitle,children:Z})]}),O("div",{className:A.headerComponents,children:$===d.COMPLETION&&X!==P&&O("div",{className:A.padModeSelect,children:O(h,N({},fe))})}),M&&z&&L("div",{className:o(A.controlsContainer,k&&A.appMaximized),children:[J,le&&O(v,{secondaryAssetName:le,coordinatesPixelWidth:z.pixelWidth,secondaryAssetLink:!ue&&me,pageName:S,onSize:function(e){return Oe(e)}}),pe&&O(g,{primaryAssetName:oe,pageName:S,coordinatesPixelWidth:z.pixelWidth,primaryAssetLink:ce,onSize:function(e){return Ae(e)}})]}),U&&W&&O(p,{dashboardAppId:M.id,appId:i(M,["app","id"]),annotation:W,openAnnotationsList:F,updateCurrentDashboardAppLastAnnotation:B,currentUser:R})]}),$===d.COMPLETION&&X===P&&O("div",{className:o(A.padModeSelect,A.smallPadModeSelect),children:O(h,N({},fe))})]})}_.propTypes={app:s.object.isRequired,badge:s.node,classes:s.shape({appHeader:s.string,appHeaderTitleWrapper:s.string,appHeaderChildren: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
+ import e from"@babel/runtime/helpers/defineProperty";import t from"@babel/runtime/helpers/slicedToArray";import{useRef as n,useState as a,useEffect as r}from"react";import{get as i}from"lodash";import o from"prop-types";import s from"classnames";import{Tooltip as l}from"@material-ui/core";import"../../Annotations/components/AnnotationsList/index.js";import p 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 c}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 m,getAppSegment as u}from"../../../utils/devcenter.js";import f from"./VersionBadge.js";import h from"./PadMode.js";import{getAppDimension as b}from"./utils.js";import g from"../../AssetNameLabel/SecondaryAssetNameLabel.js";import v from"../../AssetNameLabel/PrimaryAssetNameLabel.js";import A from"./AppHeader.css.js";import{useStyles as j}from"./AppHeaderStyles.js";import{jsxs as L,Fragment as y,jsx as O}from"react/jsx-runtime";function w(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function N(t){for(var n=1;n<arguments.length;n++){var a=null!=arguments[n]?arguments[n]:{};n%2?w(Object(a),!0).forEach((function(n){e(t,n,a[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):w(Object(a)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(a,e))}))}return t}var P="DevCenter_AppHeader",S="SMALL",_=function(e){return"assets/".concat(null==e?void 0:e.asset_id)};function x(e){var o,w,x,C,M=e.app,W=e.appLastAnnotation,D=e.appSettings,I=e.badge,H=e.classes,z=e.coordinates,R=e.currentUser,T=e.fracFleet,k=e.isMaximized,q=e.onSettingChange,F=e.openAnnotationsList,E=e.rig,U=e.showLastAnnotation,B=e.updateCurrentDashboardAppLastAnnotation,G=e.well,V=e.wells,J=e.children,K=j(),Q=null==z?void 0:z.pixelWidth,X=b(Q),Y=m(M),Z=null==M||null===(o=M.package)||void 0===o||null===(w=o.manifest)||void 0===w||null===(x=w.application)||void 0===x?void 0:x.subtitle,$=u(M),ee=$===d.DRILLING,te=(null==M?void 0:M.settings)||{},ne=te.wellId,ae=te.rigId,re=te.fracFleetId,ie=te.padId,oe=ie&&(null==T||null===(C=T.pad_frac_fleets.find((function(e){return e.pad.id===ie})))||void 0===C?void 0:C.pad),se=ee?null==E?void 0:E.name:null==T?void 0:T.name,le=ee?ne&&(null==G?void 0:G.name):ie&&(null==oe?void 0:oe.name),pe=!!(ne||ae||re),de=null!=T&&T.current_pad_id?"assets/types/pad/".concat(null==T?void 0:T.current_pad_id):null,ce=ee?se&&_(G):de,me=ee?_(G):ie&&"assets/types/pad/".concat(ie),ue=M&&M.id===c,fe={fracFleet:T,wells:V,well:G,onSettingChange:q,appSettings:D},he=n(null),be=a({width:0}),ge=t(be,2),ve=ge[0],Ae=ge[1],je=a({width:0}),Le=t(je,2),ye=Le[0],Oe=Le[1],we=a(!1),Ne=t(we,2),Pe=Ne[0],Se=Ne[1];return r((function(){var e,t;Se(Math.abs((null===(e=he.current)||void 0===e?void 0:e.offsetWidth)-(null===(t=he.current)||void 0===t?void 0:t.scrollWidth))>1)}),[null==ve?void 0:ve.width,null==ye?void 0:ye.width,Q]),L(y,{children:[L("div",{className:s(K.appHeaderContainer,H.appHeader),children:[L("div",{className:K.titleBlock,children:[L("div",{className:H.appHeaderTitleWrapper,ref:he,children:[L("div",{className:K.titleWrapper,children:[O(l,{title:Pe?Y:"",placement:"bottom",children:O("h6",{"data-testid":"".concat(P,"_name"),className:K.title,children:Y})}),O(f,{app:M})]}),I]}),Z&&O("h6",{"data-testid":"".concat(P,"_subtitle"),className:K.subtitle,children:Z})]}),M&&z&&L("div",{className:s(A.controlsContainer,k&&A.appMaximized),children:[$===d.COMPLETION&&X!==S&&O(h,N({},fe)),J,le&&O(g,{secondaryAssetName:le,coordinatesPixelWidth:z.pixelWidth,secondaryAssetLink:!ue&&me,pageName:P,onSize:function(e){return Oe(e)}}),pe&&O(v,{primaryAssetName:se,pageName:P,coordinatesPixelWidth:z.pixelWidth,primaryAssetLink:ce,onSize:function(e){return Ae(e)}})]}),U&&W&&O(p,{dashboardAppId:M.id,appId:i(M,["app","id"]),annotation:W,openAnnotationsList:F,updateCurrentDashboardAppLastAnnotation:B,currentUser:R})]}),$===d.COMPLETION&&X===S&&O("div",{className:s(A.padModeSelect,A.smallPadModeSelect),children:O(h,N({},fe))})]})}x.propTypes={app:o.object.isRequired,badge:o.node,classes:o.shape({appHeader:o.string,appHeaderTitleWrapper:o.string,appHeaderChildren:o.string}),showLastAnnotation:o.bool,currentUser:o.shape({}),appLastAnnotation:o.shape({}),updateCurrentDashboardAppLastAnnotation:o.func,openAnnotationsList:o.func,rig:o.shape({name:o.string,asset_id:o.number}),well:o.shape({name:o.string,asset_id:o.number}),fracFleet:o.shape({name:o.string,current_pad_id:o.number,pad_frac_fleets:o.arrayOf(o.shape({pad:o.shape({id:o.number.isRequired}).isRequired})).isRequired}),wells:o.arrayOf(o.shape({})),coordinates:o.shape({pixelWidth:o.number.isRequired}),isMaximized:o.bool,appSettings:o.shape({}),onSettingChange:o.func,children:o.arrayOf(o.node)},x.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{x as default};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@corva/ui",
3
- "version": "0.42.0-1",
3
+ "version": "0.42.0-2",
4
4
  "description": "Shared components/utils for Corva ui projects",
5
5
  "keywords": [
6
6
  "corva-ui"