@corva/ui 0.32.0-4 → 0.32.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.
- package/components/BICOffsetPickerDialog/components/WellSection/index.js +1 -1
- package/components/OffsetWellPickerV2/OffsetWellPickerDialog.js +1 -1
- package/components/OffsetWellPickerV2/components/Filter/ClearFiltersButton.js +1 -1
- package/components/OffsetWellPickerV2/components/Filter/index.js +1 -1
- package/components/OffsetWellPickerV2/effects/index.js +1 -1
- package/package.json +1 -1
- package/components/OffsetWellPickerV2/components/Filter/SidetrackSwitch.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"@babel/runtime/helpers/defineProperty";import n from"@babel/runtime/helpers/toConsumableArray";import{showSuccessNotification as t}from"../../../../utils/notificationToasts.js";import"../../../../utils/index.js";import{jsxs as r,jsx as o}from"react/jsx-runtime";import{makeStyles as i,Typography as l,Accordion as c,AccordionSummary as a,AccordionDetails as s,List as m}from"@material-ui/core";import{memo as p}from"react";import{string as d,arrayOf as u,shape as f,func as h}from"prop-types";import w from"classnames";import{ExpandMore as y}from"@material-ui/icons";import x from"./AssetSearch.js";import b from"./SectionItem.js";import g from"./WellListItem.js";function v(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function j(n){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?v(Object(r),!0).forEach((function(t){e(n,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(r)):v(Object(r)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(r,e))}))}return n}var O=i((function(e){return{content:{marginTop:"24px"},sectionItem:{display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center",padding:"8px",fontSize:"12px",fontWeight:"normal",color:e.palette.primary.text6,borderTop:"1px solid ".concat(e.palette.primary.text8),"&:last-child":{borderBottom:"1px solid ".concat(e.palette.primary.text8)}},disabledSectionItem:{color:e.palette.primary.text8},wellList:{width:"100%",margin:0,padding:0},searchContainer:{display:"flex",justifyContent:"space-between",marginBottom:"24px",alignItems:"center"},advancedSearch:{fontSize:"14px",fontWeight:500,color:"#03BCD4",cursor:"pointer","&:hover":{textDecoration:"underline"}}}}));function S(e){var i=e.company,p=e.wellSections,d=e.getWellName,u=e.onChangeWellSections,f=e.onExploreMode,h=O(),v=function(e,n){var t=p.find((function(n){return n.name===e.name})).wells.map((function(e){return e.id})),r=p.map((function(e){var r=e.wells.map((function(e){return t.includes(e.id)?j(j({},e),{},{checked:n}):j({},e)}));return j(j({},e),{},{wells:r})}));u(r)},S=function(e){var n=p.map((function(n){return n.name===e.name?j(j({},n),{},{expanded:!n.expanded}):n}));u(n)},C=function(e){var n=p.map((function(n){var t=n.wells.map((function(n){return n.id===e.id?j(j({},n),{},{checked:!n.checked}):n}));return j(j({},n),{},{wells:t})}));u(n)},N=function(e){v(e,!0)},I=function(e){v(e,!1)};return r("div",{className:h.content,children:[r("div",{className:h.searchContainer,children:[o(x,{company:+i,onClickAsset:function(e,r){var o=p.map((function(t){if("Search Results"===t.name){var o=n(t.wells);return t.wells.find((function(n){return n.id===e}))||o.push({id:e,checked:!0,name:r,kind:"manual"}),j(j({},t),{},{wells:o})}return j(j({},t),{},{wells:t.wells.map((function(n){return n.id===e?j(j({},n),{},{checked:!0}):n}))})}));u(o),t("Offset well successfully added!")},onExploreMode:f}),o(l,{className:h.advancedSearch,onClick:function(){f()},children:"Advanced Search"})]}),(p||[]).map((function(e){return 0===e.wells.length?o("div",{className:w(h.sectionItem,h.disabledSectionItem),children:o(b,{section:e,disabled:!0})},"empty-".concat(e.name)):o("div",{className:h.sectionItem,children:r(c,{
|
|
1
|
+
import e from"@babel/runtime/helpers/defineProperty";import n from"@babel/runtime/helpers/toConsumableArray";import{showSuccessNotification as t}from"../../../../utils/notificationToasts.js";import"../../../../utils/index.js";import{jsxs as r,jsx as o}from"react/jsx-runtime";import{makeStyles as i,Typography as l,Accordion as c,AccordionSummary as a,AccordionDetails as s,List as m}from"@material-ui/core";import{memo as p}from"react";import{string as d,arrayOf as u,shape as f,func as h}from"prop-types";import w from"classnames";import{ExpandMore as y}from"@material-ui/icons";import x from"./AssetSearch.js";import b from"./SectionItem.js";import g from"./WellListItem.js";function v(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function j(n){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?v(Object(r),!0).forEach((function(t){e(n,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(r)):v(Object(r)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(r,e))}))}return n}var O=i((function(e){return{content:{marginTop:"24px"},sectionItem:{display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center",padding:"8px",fontSize:"12px",fontWeight:"normal",color:e.palette.primary.text6,borderTop:"1px solid ".concat(e.palette.primary.text8),"&:last-child":{borderBottom:"1px solid ".concat(e.palette.primary.text8)}},disabledSectionItem:{color:e.palette.primary.text8},wellList:{width:"100%",margin:0,padding:0},searchContainer:{display:"flex",justifyContent:"space-between",marginBottom:"24px",alignItems:"center"},advancedSearch:{fontSize:"14px",fontWeight:500,color:"#03BCD4",cursor:"pointer","&:hover":{textDecoration:"underline"}}}}));function S(e){var i=e.company,p=e.wellSections,d=e.getWellName,u=e.onChangeWellSections,f=e.onExploreMode,h=O(),v=function(e,n){var t=p.find((function(n){return n.name===e.name})).wells.map((function(e){return e.id})),r=p.map((function(e){var r=e.wells.map((function(e){return t.includes(e.id)?j(j({},e),{},{checked:n}):j({},e)}));return j(j({},e),{},{wells:r})}));u(r)},S=function(e){var n=p.map((function(n){return n.name===e.name?j(j({},n),{},{expanded:!n.expanded}):n}));u(n)},C=function(e){var n=p.map((function(n){var t=n.wells.map((function(n){return n.id===e.id?j(j({},n),{},{checked:!n.checked}):n}));return j(j({},n),{},{wells:t})}));u(n)},N=function(e){v(e,!0)},I=function(e){v(e,!1)};return r("div",{className:h.content,children:[r("div",{className:h.searchContainer,children:[o(x,{company:+i,onClickAsset:function(e,r){var o=p.map((function(t){if("Search Results"===t.name){var o=n(t.wells);return t.wells.find((function(n){return n.id===e}))||o.push({id:e,checked:!0,name:r,kind:"manual"}),j(j({},t),{},{wells:o})}return j(j({},t),{},{wells:t.wells.map((function(n){return n.id===e?j(j({},n),{},{checked:!0}):n}))})}));u(o),t("Offset well successfully added!")},onExploreMode:f}),o(l,{className:h.advancedSearch,onClick:function(){f()},children:"Advanced Search"})]}),(p||[]).map((function(e){return 0===e.wells.length?o("div",{className:w(h.sectionItem,h.disabledSectionItem),children:o(b,{section:e,disabled:!0})},"empty-".concat(e.name)):o("div",{className:h.sectionItem,children:r(c,{expand:e.expanded,onChange:function(){return S(e)},children:[o(a,{expandIcon:o(y,{}),style:{width:"100%"},children:o(b,{section:e,onExpandCollapse:S,onSelectAll:N,onClearAll:I})}),o(s,{children:o(m,{dense:!0,className:h.wellList,children:e.wells.map((function(n){return o(g,{well:n,wellName:d(e.wells,n.id),rigName:n.rigName,onToggleWell:C},"well-".concat(e.name,"-").concat(n.id))}))})})]})},"section-".concat(e.name))}))]})}S.propTypes={company:d.isRequired,wellSections:u(f({})),getWellName:h.isRequired,onChangeWellSections:h.isRequired,onExploreMode:h.isRequired},S.defaultProps={wellSections:[]};var C=p(S);export default C;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"@babel/runtime/helpers/defineProperty";import{get as n,orderBy as t,uniq as l}from"lodash";import
|
|
1
|
+
import e from"@babel/runtime/helpers/defineProperty";import{get as n,orderBy as t,uniq as l}from"lodash";import o from"@babel/runtime/helpers/slicedToArray";import{jsxs as i,jsx as r,Fragment as c}from"react/jsx-runtime";import{makeStyles as s,Dialog as a,DialogTitle as d,Typography as u,Tooltip as f,IconButton as m,DialogContent as p,DialogActions as b,Button as g}from"@material-ui/core";import h from"@material-ui/icons/Close";import{memo as y,useState as S,useEffect as v,useMemo as W,useCallback as j}from"react";import I from"prop-types";import C from"classnames";import{useTheme as O}from"@material-ui/core/styles";import A from"../LoadingIndicator/LoadingIndicator.js";import N from"@material-ui/core/useMediaQuery";import{DEFAULT_SETTINGS as D}from"./constants.js";import x from"./components/Filter/index.js";import w from"./effects/biDirectionalFiltering.js";import{useCompanies as k,useWells as T,useCompanyMetricKey as B,useFilteredWells as P,useWellsWithCoords as R,useRadiusWells as z,useOffsetWells as L,useMetricsData as U}from"./effects/index.js";import q from"./components/Map/index.js";import E from"./components/Table/index.js";function M(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);n&&(l=l.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,l)}return t}function F(n){for(var t=1;t<arguments.length;t++){var l=null!=arguments[t]?arguments[t]:{};t%2?M(Object(l),!0).forEach((function(t){e(n,t,l[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(l)):M(Object(l)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(l,e))}))}return n}var _=s((function(e){return{dialogTitles:{display:"flex",justifyContent:"space-between",alignItems:"center"},title:{fontSize:20},subTitle:{fontSize:14,color:"#03BCD4","&:hover":{cursor:"pointer",textDecoration:"underline"}},subTitleSpace:{fontSize:14,color:"#03BCD4"},titleArea:{display:"flex",alignItems:"center"},closeIconButton:{fontSize:20,padding:4,"&:hover $closeIcon":{color:"#fff"}},closeIcon:{color:"#BDBDBD"},dialogActions:{justifyContent:"space-between",paddingTop:8,paddingBottom:8},bottomShadow:{width:"100%",height:"16px",backgroundImage:"linear-gradient(180deg, rgba(65, 65, 65, 0) 0%, ".concat(e.palette.background.b9,")"),position:"absolute",bottom:"52px",zIndex:2},dialogActionsSmallScreen:{paddingRight:"100px"},dialogContent:{display:"flex",flexDirection:"column"},tabs:{background:"#414141"},selectedWells:{display:"flex",alignItems:"center"},selected:{fontSize:16},selectedLabel:{fontSize:12,marginLeft:14,color:"rgba(255, 255, 255, 0.54)"},selectedNumber:{fontSize:12,margin:4,color:"rgba(255, 255, 255, 0.8)"}}})),K=function(s){var y=s.isOpen,I=s.defaultSubjectWellId,M=s.companyId,K=s.offsetSetting,H=s.currentUser,Q=s.addWellsUsabilityInfo,$=s.unusableWellAlarm,G=s.isAdvancedSearch,J=s.bestCount,V=s.onClose,X=s.onSave,Y=_(),Z=O(),ee=N(Z.breakpoints.down("sm")),ne=("admin"===n(H,"role")||"developeradmin"===n(H,"role"))&&"corva"===n(H,["company","provider"]),te=S(M||n(K,"companyId")||+n(H,"company_id")),le=o(te,2),oe=le[0],ie=le[1],re=S(n(K,"subjectWellId")||I),ce=o(re,2),se=ce[0],ae=ce[1],de=S(n(K,"filters")||D.filters),ue=o(de,2),fe=ue[0],me=ue[1],pe=S(n(K,"radius")||D.radius),be=o(pe,2),ge=be[0],he=be[1],ye=S([]),Se=o(ye,2),ve=Se[0],We=Se[1],je=S(D.sortInfo),Ie=o(je,2),Ce=Ie[0],Oe=Ie[1],Ae=S(!1),Ne=o(Ae,2),De=Ne[0],xe=Ne[1],we=S([]),ke=o(we,2),Te=ke[0],Be=ke[1];v((function(){y&&(Be(n(K,"selectedWellIds")||[]),ie(M||n(K,"companyId")||+n(H,"company_id")),ae(n(K,"subjectWellId")||I))}),[y,K]);var Pe=W((function(){return!!se}),[se]),Re=k(ne,G&&I,oe),ze=T(oe,Q),Le=B(oe);v((function(){We((function(e){return Le?[Le]:e}))}),[Le]);var Ue=w(fe,ze),qe=P(fe,ze),Ee=W((function(){return qe&&se?qe.find((function(e){return e.id===se})):null}),[qe,se]),Me=R(qe,Ee);z(ge,Me,Be);var Fe=L(ge,ze,Te),_e=U(oe,Me),Ke=o(_e,2),He=Ke[0],Qe=Ke[1],$e=W((function(){return Qe?t(Qe,Ce.key,1===Ce.direction?"asc":"desc"):Qe}),[Ce,Qe]),Ge=j((function(e){ie(e),ae(null),Be([]),me(D.filters)}),[]),Je=j((function(e){var n=qe.find((function(n){return n.id===e}));n&&n.is_usable&&Be(l(Te.concat(e)))}),[Te,qe]),Ve=j((function(e){Be(l(Te.filter((function(n){return n!==e}))))}),[Te]),Xe=j((function(){Be(qe.filter((function(e){return e.is_usable})).map((function(e){return e.id})))}),[qe]),Ye=j((function(){Be([])}),[qe]),Ze=j((function(e){Be([]),ae(e)}),[ze]),en=j((function(){Be([]),ae(null)}),[]),nn=j((function(e){he(e)}),[]),tn=j((function(n,t){me((function(l){return F(F({},l),{},e({},n,t))})),Be([])}),[]),ln=j((function(){me(F({},D.filters)),Be([])}),[]),on=j((function(){xe((function(e){return!e}))}),[]),rn=j((function(e){We(e)}),[]),cn=j((function(e){Oe((function(n){return n.key===e?F(F({},n),{},{direction:-1*n.direction}):{key:e,direction:1}}))}),[]),sn=function(){V()},an=!(ze&&qe&&Me&&Qe&&Fe&&$e);return i(a,{onBackdropClick:V,onEscapeKeyDown:V,maxWidth:"lg",fullWidth:!0,fullScreen:ee,open:y,children:[r(d,{children:i("div",{className:Y.dialogTitles,children:[G?i("div",{className:Y.titleArea,children:[r(u,{className:Y.subTitle,onClick:sn,children:"Select Offset Wells"}),r(u,{className:Y.subTitleSpace,children:" / "}),r(u,{className:Y.title,children:"Advanced Search"})]}):r(u,{className:Y.title,children:"Select Offset Wells"}),r(f,{title:"Close",children:r(m,{"data-not-migrated-muiiconbutton":!0,"aria-label":"close",className:Y.closeIconButton,onClick:V,children:r(h,{className:Y.closeIcon})})})]})}),r(p,{className:Y.dialogContent,children:an?r(A,{fullscreen:!1}):i(c,{children:[r(x,{companyId:oe,companies:Re,isCurrentUserCorvaAdmin:ne,radius:ge,wells:qe,subjectWell:Ee,filters:fe,filtersOptions:Ue,mapHidden:De,isRadiusEditable:Pe,onChangeCompany:Ge,onSetSubjectWell:Ze,onChangeRadius:nn,onChangeFilters:tn,onClearFilters:ln,onToggleMap:on}),r(q,{subjectWell:Ee,wells:qe,offsetWells:Fe,radius:ge,mapHidden:De,onSetSubjectWell:Ze,onRemoveSubjectWell:en,onAddOffsetWell:Je,onDeleteOffsetWell:Ve}),r(E,{subjectWell:Ee,wells:$e,offsetWells:Fe,metricsKeys:ve,sortInfo:Ce,isMetricsLoading:He,unusableWellAlarm:$,onChangeMetricsKeys:rn,onSorting:cn,onAddOffsetWell:Je,onDeleteOffsetWell:Ve,onAddAllOffsetWells:Xe,onDeleteAllOffsetWells:Ye})]})}),r("div",{className:Y.bottomShadow}),i(b,{className:C(Y.dialogActions,e({},Y.dialogActionsSmallScreen,ee)),children:[G?i("div",{className:Y.selectedWells,children:[r(u,{className:Y.selected,children:"Selected:"}),r(u,{className:Y.selectedLabel,children:"Best:"}),r(u,{className:Y.selectedNumber,children:J}),r(u,{className:Y.selectedLabel,children:"Advanced Search:"}),r(u,{className:Y.selectedNumber,children:(null==Fe?void 0:Fe.length)||0})]}):r("div",{}),i("div",{children:[r(g,{onClick:sn,color:"primary",style:{marginRight:16},children:"CANCEL"}),i(g,{variant:"contained",color:"primary",onClick:function(){var e=F(F({},K),{},{companyId:oe,subjectWellId:se,radius:ge,filters:fe,selectedWellIds:l(Fe.map((function(e){return e.id})))});X(e,Fe)},children:["ADD (",(null==Fe?void 0:Fe.length)||0,")"]})]})]})]})};K.propTypes={isOpen:I.bool.isRequired,defaultSubjectWellId:I.number,companyId:I.number,offsetSetting:I.shape({}).isRequired,currentUser:I.shape({}).isRequired,addWellsUsabilityInfo:I.func,unusableWellAlarm:I.string,isAdvancedSearch:I.bool,bestCount:I.number,onSave:I.func.isRequired,onClose:I.func.isRequired},K.defaultProps={defaultSubjectWellId:null,companyId:null,addWellsUsabilityInfo:null,unusableWellAlarm:"Unable to add",isAdvancedSearch:!1,bestCount:0};var H=y(K);export default H;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsxs as r,jsx as e}from"react/jsx-runtime";import{Typography as t}from"@material-ui/core";import a from"prop-types";import{makeStyles as
|
|
1
|
+
import{jsxs as r,jsx as e}from"react/jsx-runtime";import{Typography as t}from"@material-ui/core";import a from"prop-types";import{makeStyles as i}from"@material-ui/core/styles";import o from"@material-ui/icons/Clear";var l=i((function(r){return{wrapper:{display:"flex",alignItems:"flex-end",height:"56px",cursor:"pointer","&:hover $clearText":{color:r.palette.primary.text1},"&:hover $clearIcon":{color:r.palette.primary.text1}},clearText:{color:r.palette.primary.text6},clearIcon:{color:r.palette.primary.text6,marginLeft:"16px",marginRight:"5px"}}}));function c(a){var i=a.onClick,c=l();return r("div",{className:c.wrapper,onClick:i,children:[e(o,{className:c.clearIcon}),e(t,{className:c.clearText,children:"Clear"})]})}c.propTypes={onClick:a.func.isRequired,classes:a.shape({}).isRequired};export default c;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{get as e}from"lodash";import r from"@babel/runtime/helpers/slicedToArray";import{isNativeDetected as i,isMobileDetected as
|
|
1
|
+
import{get as e}from"lodash";import r from"@babel/runtime/helpers/slicedToArray";import{isNativeDetected as i,isMobileDetected as l}from"../../../../utils/mobileDetect.js";import{jsxs as t,jsx as n}from"react/jsx-runtime";import{makeStyles as s}from"@material-ui/core";import{memo as o,useState as a}from"react";import u from"prop-types";import p from"./SubjectWellSearch.js";import d from"./RadiusInput.js";import m from"./ToggleFiltersButton.js";import c from"./ToggleMapButton.js";import f from"./SingleSelect.js";import g from"./MultiSelect.js";import h from"./ClearFiltersButton.js";import{FILTERS_LIST as b}from"../../constants.js";var C=s({container:{display:"flex"},filters:{display:"flex",flexWrap:"wrap"},fileterSection:{display:"flex",width:"100%",alignItems:"center",flexWrap:"wrap"},subjectWellWrapper:{display:"flex",alignItems:"center",flexWrap:"wrap"}}),R=i||l;function j(i){var l=i.companyId,s=i.companies,o=i.isCurrentUserCorvaAdmin,u=i.wells,j=i.subjectWell,y=i.radius,q=i.filters,W=i.filtersOptions,v=i.mapHidden,S=i.isRadiusEditable,x=i.onChangeCompany,T=i.onSetSubjectWell,w=i.onChangeFilters,F=i.onChangeRadius,M=i.onClearFilters,I=i.onToggleMap,H=a(R),N=r(H,2),O=N[0],V=N[1],A=C({isMobile:R});return t("div",{children:[R&&n(m,{filtersHidden:O,onToggleFilters:function(){V((function(e){return!e}))}}),!O&&t("div",{className:A.container,children:[n(c,{mapHidden:v,onToggleMap:I}),n("div",{className:A.filters,children:t("div",{className:A.fileterSection,children:[n(f,{label:"Company",visible:o,items:s,currentValue:l,onChange:function(e){return x(e.target.value)}},"company"),b.map((function(r){var i=r.key,l=r.title,t=r.size,s=r.renderValue;return n(g,{title:l,size:t,options:e(W,i,[]),currentValues:e(q,i,[]),renderValue:s,onChange:function(e){return w(i,e)}},i)})),t("div",{className:A.subjectWellWrapper,children:[n(p,{wells:u,subjectWell:j,onChange:T}),n(d,{radius:y,editable:S,onChange:F}),n(h,{onClick:M})]})]})})]})]})}j.propTypes={isCurrentUserCorvaAdmin:u.bool.isRequired,companies:u.arrayOf(u.shape({})).isRequired,wells:u.arrayOf(u.shape({})).isRequired,subjectWell:u.shape({}),companyId:u.number.isRequired,radius:u.number.isRequired,isRadiusEditable:u.bool.isRequired,filters:u.shape({}).isRequired,filtersOptions:u.shape({}).isRequired,mapHidden:u.bool.isRequired,onChangeCompany:u.func.isRequired,onSetSubjectWell:u.func.isRequired,onChangeFilters:u.func.isRequired,onChangeRadius:u.func.isRequired,onClearFilters:u.func.isRequired,onToggleMap:u.func.isRequired},j.defaultProps={subjectWell:null};var y=o(j);export default y;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import t from"@babel/runtime/helpers/defineProperty";import"../../../constants/completion.js";import"../../../constants/alerts.js";import{get as n}from"lodash";import r from"@babel/runtime/helpers/slicedToArray";import{BENCHMARK_METRIC_GOAL as e}from"../../../constants/goals.js";import"../../../constants/segment.js";import"../../../constants/apps.js";import"../../../constants/drillstring.js";import"../../../constants/notifications.js";import"../../../constants/feed.js";import{getCompanyGoalSetting as i}from"../../../utils/goals.js";import o from"@babel/runtime/regenerator";import u from"@babel/runtime/helpers/asyncToGenerator";import{mapbox as c}from"../../../utils/index.js";import{useState as s,useEffect as a,useRef as f}from"react";import{FILTERS as l,METRICS_KEYS as p}from"../constants.js";import{fetchCompanies as m,fetchCompanyGoals as h,fetchWells as v,fetchMetricsData as d}from"../utils/apiCalls.js";export{default as useBidirectionalFiltering}from"./biDirectionalFiltering.js";function b(t,n){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var e=Object.getOwnPropertySymbols(t);n&&(e=e.filter((function(n){return Object.getOwnPropertyDescriptor(t,n).enumerable}))),r.push.apply(r,e)}return r}function j(n){for(var r=1;r<arguments.length;r++){var e=null!=arguments[r]?arguments[r]:{};r%2?b(Object(e),!0).forEach((function(r){t(n,r,e[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(e)):b(Object(e)).forEach((function(t){Object.defineProperty(n,t,Object.getOwnPropertyDescriptor(e,t))}))}return n}var y=c.getAssetV2Coordinates,g=c.getDistanceByCoordinates;function O(t){var n=f();return a((function(){n.current=t})),n.current}function x(t,n,e){var i=s([]),c=r(i,2),f=c[0],l=c[1];return a((function(){function r(){return(r=u(o.mark((function r(){var i;return o.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(t){r.next=3;break}return l([]),r.abrupt("return");case 3:return r.next=5,m();case 5:i=r.sent,n&&(i=i.filter((function(t){return t.id===e}))),l(i);case 8:case"end":return r.stop()}}),r)})))).apply(this,arguments)}!function(){r.apply(this,arguments)}()}),[]),f}function w(t){var n=s(null),c=r(n,2),f=c[0],l=c[1];return a((function(){function n(){return(n=u(o.mark((function n(){var r,u;return o.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,h(t);case 2:r=n.sent,u=i(r,e),l(u);case 5:case"end":return n.stop()}}),n)})))).apply(this,arguments)}l(null),function(){n.apply(this,arguments)}()}),[t]),f}function k(t,n){var e=s(null),i=r(e,2),c=i[0],f=i[1];return a((function(){function r(){return(r=u(o.mark((function r(){var e;return o.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(!t){r.next=6;break}return r.next=3,v(t,n);case 3:r.t0=r.sent,r.next=7;break;case 6:r.t0=null;case 7:e=r.t0,f(e);case 9:case"end":return r.stop()}}),r)})))).apply(this,arguments)}f(null),function(){r.apply(this,arguments)}()}),[t]),c}function E(t,n
|
|
1
|
+
import t from"@babel/runtime/helpers/defineProperty";import"../../../constants/completion.js";import"../../../constants/alerts.js";import{get as n}from"lodash";import r from"@babel/runtime/helpers/slicedToArray";import{BENCHMARK_METRIC_GOAL as e}from"../../../constants/goals.js";import"../../../constants/segment.js";import"../../../constants/apps.js";import"../../../constants/drillstring.js";import"../../../constants/notifications.js";import"../../../constants/feed.js";import{getCompanyGoalSetting as i}from"../../../utils/goals.js";import o from"@babel/runtime/regenerator";import u from"@babel/runtime/helpers/asyncToGenerator";import{mapbox as c}from"../../../utils/index.js";import{useState as s,useEffect as a,useRef as f}from"react";import{FILTERS as l,METRICS_KEYS as p}from"../constants.js";import{fetchCompanies as m,fetchCompanyGoals as h,fetchWells as v,fetchMetricsData as d}from"../utils/apiCalls.js";export{default as useBidirectionalFiltering}from"./biDirectionalFiltering.js";function b(t,n){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var e=Object.getOwnPropertySymbols(t);n&&(e=e.filter((function(n){return Object.getOwnPropertyDescriptor(t,n).enumerable}))),r.push.apply(r,e)}return r}function j(n){for(var r=1;r<arguments.length;r++){var e=null!=arguments[r]?arguments[r]:{};r%2?b(Object(e),!0).forEach((function(r){t(n,r,e[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(e)):b(Object(e)).forEach((function(t){Object.defineProperty(n,t,Object.getOwnPropertyDescriptor(e,t))}))}return n}var y=c.getAssetV2Coordinates,g=c.getDistanceByCoordinates;function O(t){var n=f();return a((function(){n.current=t})),n.current}function x(t,n,e){var i=s([]),c=r(i,2),f=c[0],l=c[1];return a((function(){function r(){return(r=u(o.mark((function r(){var i;return o.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(t){r.next=3;break}return l([]),r.abrupt("return");case 3:return r.next=5,m();case 5:i=r.sent,n&&(i=i.filter((function(t){return t.id===e}))),l(i);case 8:case"end":return r.stop()}}),r)})))).apply(this,arguments)}!function(){r.apply(this,arguments)}()}),[]),f}function w(t){var n=s(null),c=r(n,2),f=c[0],l=c[1];return a((function(){function n(){return(n=u(o.mark((function n(){var r,u;return o.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,h(t);case 2:r=n.sent,u=i(r,e),l(u);case 5:case"end":return n.stop()}}),n)})))).apply(this,arguments)}l(null),function(){n.apply(this,arguments)}()}),[t]),f}function k(t,n){var e=s(null),i=r(e,2),c=i[0],f=i[1];return a((function(){function r(){return(r=u(o.mark((function r(){var e;return o.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(!t){r.next=6;break}return r.next=3,v(t,n);case 3:r.t0=r.sent,r.next=7;break;case 6:r.t0=null;case 7:e=r.t0,f(e);case 9:case"end":return r.stop()}}),r)})))).apply(this,arguments)}f(null),function(){r.apply(this,arguments)}()}),[t]),c}function E(t,n){var e=s(null),i=r(e,2),o=i[0],u=i[1];return a((function(){u(n?Object.values(l).reduce((function(n,r){return n.filter((function(n){return!t[r]||0===t[r].length||t[r].includes(n[r])}))}),n):null)}),[n,t]),o}function P(t,n){var e=s(null),i=r(e,2),o=i[0],u=i[1];return a((function(){if(t){var r=n&&y(n,"topHole");if(r){var e=[];t.forEach((function(t){var n=y(t,"topHole");if(n){var i=parseFloat(g(r,n));e.push(j(j({},t),{},{distance:i}))}else e.push(t)})),u(e)}else u(t)}else u(t)}),[t,n]),o}function D(t,n,e){var i=s(null),o=r(i,2),u=o[0],c=o[1];return a((function(){if(n){var t=[];n.forEach((function(n){e.includes(n.id)&&n.is_usable&&t.push(n)})),c(t)}else c(null)}),[t,n,e]),u}function F(t,e){var i=f({}),c=s(!0),l=r(c,2),m=l[0],h=l[1],v=s(null),b=r(v,2),y=b[0],g=b[1];return a((function(){function r(){return(r=u(o.mark((function r(u){var c,s,a;return o.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,d(t,u);case 2:c=r.sent,s={},u.forEach((function(t){var r={},e=c.filter((function(r){return n(r,"asset_id")===t}));p.forEach((function(t){var i=e.find((function(r){return n(r,"data.key")===t})),o=n(i,"data.value");r[t]=Number.isFinite(o)?parseFloat(o).toFixed(2):null})),s[t]=r})),i.current=j(j({},i.current),s),a=[],e.forEach((function(t){a.push(j(j({},t),i.current[t.id]))})),h(!1),g(a);case 10:case"end":return r.stop()}}),r)})))).apply(this,arguments)}if(e)if(0!==e.length){var c=[];e.forEach((function(t){i.current[t.id]||c.push(t.id)})),h(!0),function(t){r.apply(this,arguments)}(c)}else g([]);else g(null)}),[e]),[m,y]}function C(t,n,r){var e=f(!1);a((function(){if(n){if(e.current){var i=[];n.forEach((function(n){n.distance<=t&&i.push(n.id)})),r(i)}e.current=!0}}),[t,n])}export{x as useCompanies,w as useCompanyMetricKey,E as useFilteredWells,F as useMetricsData,D as useOffsetWells,O as usePrevious,C as useRadiusWells,k as useWells,P as useWellsWithCoords};
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{debounce as e}from"lodash";import{jsx as r}from"react/jsx-runtime";import{withStyles as o}from"@material-ui/core";import i from"prop-types";import{SwitchControl as t}from"@corva/ui/components";var a=e((function(e){e()}),500);function c(e){var o=e.checked,i=e.onChange,c=e.classes;return r(t,{rightLabel:"Exclude Sidetracks",color:"primary",checked:o,onChange:function(e){a((function(){i(!e.target.checked)}))},size:"small",className:c.formControl})}c.propTypes={checked:i.bool.isRequired,onChange:i.func.isRequired,classes:i.shape({}).isRequired};var n=o({formControl:{display:"flex",alignItems:"flex-end",height:"56px"}})(c);export default n;
|