@corva/ui 0.46.0-rc.2 → 0.46.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.
- package/components/OffsetWellPickerV4/OffsetWellPickerV4.js +1 -1
- package/components/OffsetWellPickerV4/OffsetWellPickerV4.module.css.js +1 -1
- package/components/OffsetWellPickerV4/components/AppHeader/AppHeader.js +1 -1
- package/components/OffsetWellPickerV4/components/OffsetWellsTable/OffsetWellsTableRow.js +1 -1
- package/components/VirtualizedTable/VirtualizedTable.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"@babel/runtime/helpers/toConsumableArray";import t from"@babel/runtime/helpers/defineProperty";import r from"@babel/runtime/helpers/slicedToArray";import{useState as i,useMemo as n,useRef as o,useEffect as s,useCallback as l}from"react";import a from"prop-types";import p from"classnames";import{uniqBy as m,isEmpty as c,sortBy as d,isEqual as u}from"lodash";import{Typography as f}from"@material-ui/core";import{Replay as j}from"@material-ui/icons";import C from"../Modal/Modal.js";import"../IconMenu/index.js";import"../StyledMenuItem/index.js";import"../DevCenter/AppHeader/AppHeader.js";import"../DevCenter/AppSideBar/AppSideBar.js";import"../DevCenter/AppsDataProvider/AppsDataProvider.js";import"../Icons/AnnotationIcon.js";import"../Annotations/components/AnnotationsList/index.js";import"../Annotations/components/LastAnnotation/index.js";import"../Annotations/AnnotationsContext.js";import"../../utils/mobileDetect.js";import"@babel/runtime/helpers/asyncToGenerator";import"@babel/runtime/regenerator";import"querystring";import"uuid/v1";import"../../clients/jsonApi/index.js";import"../../clients/subscriptions.js";import"../../constants/goals.js";import"../../constants/segment.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"../../utils/index.js";import"../HelpCenter/HelpCenterIcon.js";import"../DevCenter/DevCenterAppContainer/components/AppActions/AppActions.css.js";import{jsx as v,jsxs as b,Fragment as g}from"react/jsx-runtime";import"../DevCenter/DevCenterAppContainer/components/AppSettingsDialog/AppSettingsDialog.js";import"../DevCenter/DevCenterAppContainer/components/AnnotationsButton/AnnotationsButton.js";import"../DevCenter/DevCenterAppContainer/components/NonPriorityMenus/NonPriorityMenus.js";import"../DevCenter/DevCenterAppContainer/components/FullscreenButton/FullscreenButton.js";import"../DevCenter/DevCenterAppContainer/components/AppInfoMessage/AppInfoMessage.js";import"../ErrorBoundary/ErrorBoundary.js";import"../ErrorBoundary/DevCenterAppErrorView/DevCenterAppErrorView.js";import h from"../LoadingIndicator/LoadingIndicator.js";import"../EmptyView/EmptyAppView/components/ErrorSubtitleWithIntercomLink.js";import"../DevCenter/DevCenterAppContainer/components/DevCenterAppView/components/ChooseAssetButton/index.js";import"../DevCenter/DevCenterAppContainer/components/DcFullscreenElemsCoordinatorProvider/DcFullscreenElemsCoordinatorProvider.js";import"../DevCenter/DevCenterAppContainer/components/DcFullscreenElemsCoordinatorProvider/IsInsideDcFullscreenElemProvider.js";import"../DevCenter/DevCenterAppContainer/components/IsInsideDcAppProvider/IsInsideDcAppProvider.js";import"../DevCenter/AppContext.js";import"../DevCenter/DevCenterAppContainer/DevCenterAppContainer.css.js";import"../DevCenter/DevCenterAppContainer/components/RestoreAppSizeButton/index.js";import"../DevCenter/DevCenterAppContainer/components/PriorityMenus/PriorityMenus.css.js";import"../DevCenter/DevCenterRouterContext/DevCenterRouterContext.js";import"../DevCenter/DevCenterRouterContext/UniversalLink/UniversalLink.js";import"@babel/runtime/helpers/objectWithoutProperties";import"react-router";import"../DevCenter/NavigationBar/NavigationBar.js";import"../DevCenter/SideBar/SideBar.js";import"../DevCenter/AppSettingsPopover/AppSettingsPopover.js";import"../DevCenter/IsolatedDevCenterAppContainer/DevCenterIsolatedAppPage.js";import"../DevCenter/IsolatedDevCenterAppContainer/DevCenterIsolatedApp.js";import"../AssetEditor/index.js";import"../AppVersionsSelect/AppVersionsSelect.js";import{Regular12 as A}from"../Typography.js";import"../CollapsableSidebar.js";import"../DateTimePicker/index.js";import"../DatePicker/index.js";import"../SlateFormattedText/SlateFormattedText.js";import"../SlateFormattedText/RenderElements.js";import"@babel/runtime/helpers/typeof";import"slate";import"../ParameterCharts/ParameterCharts.js";import"../ParameterCharts/AddEditTrack.js";import"../ChartActionsList/ChartActionsList.js";import"../CopyToClipboard/CopyToClipboard.js";import"../AssetEditor/AssetEditorAutocomplete.js";import"../AssetEditor/SingleAssetEditor.js";import"../SettingEditors/ColorEditor/index.js";import"../SettingEditors/DropdownEditor/index.js";import"../SettingEditors/RadioEditor/index.js";import"../SwitchControl/index.js";import"../ColorPicker/ColorPicker.js";import"../ColorPicker/PaletteChromePicker/PaletteChromePicker.js";import"../TruncatedText/index.js";import"../RangeSlider/RangeSlider.js";import"../Breadcrumbs/index.js";import"../VirtualizedTable/index.js";import"../EmptyView/EmptyView.js";import"../EmptyView/EmptyAppView/EmptyAppView.js";import y from"../Button/index.js";import"../ContextMenuItem/index.js";import"../FolderMenuItem/index.js";import"../EditableItem/EditableItem/index.js";import"../EditableItem/EditableItemWithBadge/index.js";import"../Checkbox/index.js";import"../FolderMenuItemWithLinks/index.js";import"../IconButton/index.js";import"../TextField/index.js";import"../Chip/index.js";import"../Counter/index.js";import"../AnchorsList/AnchorsList.js";import"../Select/index.js";import"../CustomSelect/index.js";import"../Tabs/Tabs.js";import"../Tabs/Tab.js";import"../ResizableTable/ResizableTable.js";import"../Drillstring/BHASchematic.js";import"../Drillstring/BHATable/index.js";import"../Drillstring/BHAComponentIcon.js";import"../Drillstring/BHAComponentDetail/index.js";import"../Drillstring/BHATileIcon.js";import"../Drillstring/BHATile/BHATile.js";import"../Drillstring/BHAList/BHAList.js";import"../Drillstring/BHAComponentsTable/BHAComponentsTable.js";import"../Casing/CasingTable/index.js";import"../Casing/CasingComponentIcon.js";import"../Casing/CasingTileIcon.js";import"../Casing/CasingTableV2/CasingTableV2.js";import"../Casing/CasingTile/CasingTile.js";import"../DisabledSettingsMessage/DisabledSettingsMessage.js";import"../WellSummary/WellSummaryItemLabel.js";import"../WellSummary/WellSummaryItemTitle.js";import"../WellSummary/WellSummaryItemValue.js";import"../WellSummary/ActivitySummaryChart.js";import"../WellSummary/FracWirelineTimeChart.js";import"../BICOffsetPickerDialog/index.js";import"../OffsetWellButton/OffsetWellButton.js";import"../OffsetWellPickerV2/OffsetWellPickerDialog.js";import"../OffsetWellPickerV3/index.js";import"../OffsetWellChips/Chip.js";import"../OffsetWellChips/ChipsContainer.js";import"../Notifications/Notifications.js";import"uuid";import"../ConfirmationDialog.js";import"../TextLink/index.js";import"../Avatar/index.js";import"../Template/TemplatePopover/index.js";import"../MenuItem/index.js";import"../PadModeSelect/PadModeSelect.js";import"../PinnableFilters/PinnableFilters.js";import"../HeaderLayout/HeaderLayout.js";import"../PadOffsetsPicker/PadOffsetsPicker.js";import"../PadOffsetsPicker/OffsetAssetChip.js";import"../PadOffsetsPicker/OffsetAssetsListExpander.js";import"../PadOffsetsPicker/StagesSelector.js";import"../Table/TableToolbar/TableToolbar.js";import{Tooltip as D}from"../Tooltip/Tooltip.js";import"../PriceInput/PriceInput.js";import"../LabelsCounter/LabelsCounter.js";import"../Stepper/Step.js";import"../Stepper/StepsWrapper.js";import"../Stepper/Stepper.js";import"../Comment/CommentIcon/index.js";import"../FilesLoader/FilesLoader.js";import"../FilesLoader/Icons/FileIcon.js";import"../SearchInput/index.js";import"../FeedItem/FeedItem.js";import"../FeedItem/FeedItemEditProvider/FeedItemEditProvider.js";import"../PostInput/PostInput.js";import"../KeyboardDateTimePicker.js";import"../AddComment/Popover.js";import"../AddComment/Popup.js";import"../StageDesignVActual/ComparisonBar/ComparisonBar.js";import"../StageDesignVActual/ElementsComparison/ElementsComparison.js";import"../StageDesignVActual/ComparisonHeader.js";import"../StageDesignVActual/ComparisonRow.js";import"../EmbeddedApp/DevCenterEmbeddedApp.js";import"../EmbeddedApp/EmbeddedApp.js";import"../Autocomplete/Autocomplete.js";import"../DocumentViewer/DocumentViewer.js";import"../ColorPickerPalette/ColorPickerPalette.js";import"../Search/Search.js";import"../Search/components/Listbox.js";import"../Search/components/Paper.js";import"../Search/components/RecentSearches.js";import"../Search/components/InputAdornmentLeft.js";import"../Search/components/Groups.js";import S from"../../styles/typography/index.js";import"../../styles/counter/counter.module.scss.js";import{useFetchWells as I}from"./effects/useFetchWells.js";import{useAdvancedWells as W}from"./effects/useAdvancedWells.js";import{useBicWells as x}from"./effects/useBicWells.js";import{useCompanyMetricKey as P}from"./effects/useCompanyMetricKey.js";import{useFilterOptions as T}from"./effects/useFilterOptions.js";import{useFilteredWells as O}from"./effects/useFilteredWells.js";import{useSortedWells as E}from"./effects/useSortedWells.js";import{useRadiusWells as w}from"./effects/useRadiusWells.js";import"./effects/useAssetsData.js";import{useTableColumns as B}from"./effects/useTableColumns.js";import{AppHeader as H}from"./components/AppHeader/AppHeader.js";import{Toolbar as L}from"./components/Toolbar/Toolbar.js";import{Filter as F}from"./components/Filter/Filter.js";import{WellsMap as V}from"./components/Map/WellsMap.js";import k from"./components/OffsetWellsTable/OffsetWellsTable.js";import M from"./OffsetWellPickerV4.module.css.js";import{ALL_SECTION_KEY as N,ViewType as R,ColumnType as U,FilterType as _,ROWS_PER_PAGE as z,MAX_OFFSET_SIZE as K,SMALL_SCREEN_HEIGHT as q}from"./constants.js";import{SEARCH_CATEGORIES as G}from"./components/OffsetWellsTable/AdvancedSearch/constants.js";function J(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,i)}return r}function Q(e){for(var r=1;r<arguments.length;r++){var i=null!=arguments[r]?arguments[r]:{};r%2?J(Object(i),!0).forEach((function(r){t(e,r,i[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):J(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}var X="OffsetWellPickerV4",Y=function(a){var K,J=a.open,Y=a.isWDUser,Z=a.defaultSubjectWell,$=a.currentUser,ee=a.offsetSettings,te=a.addWellsUsabilityInfo,re=a.isViewOnly,ie=a.onClose,ne=a.onSave,oe=a.maxOffsetSize,se=i(null),le=r(se,2),ae=le[0],pe=le[1],me=n((function(){return oe+1}),[oe]),ce=i(null==ee?void 0:ee.filterExpanded),de=r(ce,2),ue=de[0],fe=de[1],je=i(null==ee?void 0:ee.mapHidden),Ce=r(je,2),ve=Ce[0],be=Ce[1],ge=+(null==Z?void 0:Z.companyId)||+(null==$?void 0:$.company_id),he=null==Z?void 0:Z.asset_id,Ae=i((null==ee?void 0:ee.filters)||{}),ye=r(Ae,2),De=ye[0],Se=ye[1],Ie=i((null==ee?void 0:ee.wellSection)||N),We=r(Ie,2),xe=We[0],Pe=We[1],Te=o(!0),Oe=i([]),Ee=r(Oe,2),we=Ee[0],Be=Ee[1],He=i(null),Le=r(He,2),Fe=Le[0],Ve=Le[1],ke=i(!0),Me=r(ke,2),Ne=Me[0],Re=Me[1],Ue=i(!1),_e=r(Ue,2),ze=_e[0],Ke=_e[1],qe=i(!1),Ge=r(qe,2),Je=Ge[0],Qe=Ge[1],Xe=i(!1),Ye=r(Xe,2),Ze=Ye[0],$e=Ye[1],et=o(),tt=i(R.none),rt=r(tt,2),it=rt[0],nt=rt[1],ot=i(!1),st=r(ot,2),lt=st[0],at=st[1];s((function(){function e(){window.innerHeight<=q?nt(R.small):nt(R.normal)}return e(),window.addEventListener("resize",e),function(){window.removeEventListener("resize",e)}}),[J]);var pt=n((function(){return!ve&&ue?448:ve?ue?232:0:216}),[ve,ue]);s((function(){Te.current=!0}),[he,null==ee?void 0:ee.selectedWellIds]),s((function(){it===R.small?(be(!0),fe(!1)):(fe(!re&&(null==ee?void 0:ee.filterExpanded)),be(!re&&(null==ee?void 0:ee.mapHidden))),Se((null==ee?void 0:ee.filters)||{}),Pe((null==ee?void 0:ee.wellSection)||N)}),[ee,re,it]);var mt=I(ge,te),ct=x(Y,he),dt=r(ct,2),ut=dt[0],ft=dt[1],jt=P(ge,null==ee?void 0:ee.metricsKeys),Ct=r(jt,2),vt=Ct[0],bt=Ct[1],gt=W(ge,mt,ut,ft,he,vt),ht=T(gt);s((function(){if(gt&&ut){var e=gt.find((function(e){return e.id===he}));if(e){var r=ut.filter((function(e){return e.value!==N})).map((function(e){return e.label})),i=Q(Q({},e),r.length>0&&t({},U.wellSection,r));Ve(i)}else Ve(null)}}),[ut,gt]);var At=B(vt),yt=O(gt,De);s((function(){if(yt)if(Te.current){var e=gt.filter((function(e){return((null==ee?void 0:ee.selectedWellIds)||[]).includes(e.id)}));Fe&&(e=e.concat(Fe)),Be(m(e,"id")),Te.current=!1}else Be((function(e){var t=(yt||[]).filter((function(t){return!!e.find((function(e){var r=e.id;return t.id===r}))}));return Fe&&(t=t.concat(Fe)),m(t,"id")}))}),[gt,yt,null==ee?void 0:ee.selectedWellIds]);var Dt=E(Fe,yt,we,Re,Te.current),St=r(Dt,5),It=St[0],Wt=St[1],xt=St[2],Pt=St[3],Tt=St[4];w(De[_.radius],yt,Be,me);var Ot=l((function(e,t,r){var i;i=r===G.well.name?t:t.reduce((function(e,t){var r,i=null===(r=gt.find((function(e){return e.id===t})))||void 0===r?void 0:r.rigName,n=gt.filter((function(e){return e.rigName===i})).map((function(e){return e.id}));return e.concat(n)}),[]);var n=gt.filter((function(e){var t=e.id;return i.includes(t)}));Be(e?function(e){return m(e.concat(n),"id")}:function(e){return m(e.filter((function(e){var t=e.id;return!n.find((function(e){return e.id===t}))})))})}),[gt]),Et=l((function(){Qe(!0)}),[]),wt=l((function(e){bt(e)}),[]),Bt=l((function(t,r){Be(r?function(r){return[].concat(e(r),[t])}:function(e){return e.filter((function(e){return e.id!==t.id}))})}),[]),Ht=l((function(e){if(e){var t=Fe?yt.concat(Fe):yt,r=m(t,"id");Be(r)}else Be(Fe?[Fe]:[])}),[yt,Fe]),Lt=function(e){if(c(ft))Be(Fe?[Fe]:[]);else{var t=gt.filter((function(t){return ft[e].includes(t.id)}));Be(t)}},Ft=l((function(e){Pe(e),Lt(e)}),[Lt]),Vt=n((function(){return we.find((function(e){return e.id===he}))?we.length-1:we.length}),[we,he]),kt=n((function(){if(!ft)return!1;var e=we.map((function(e){return e.id})),t=ft[xe]||[];return(me&&t.length>me?me:t.length)===e.length&&e.every((function(e){return t.includes(e)}))}),[ft,Z,we,xe]),Mt=function(){var e=(gt||[]).filter((function(e){return((null==ee?void 0:ee.selectedWellIds)||[]).includes(e.id)}));Fe&&(e=e.concat(Fe)),Be(m(e,"id")),u(De,ee.filters)||(Te.current=!0);var t=Q(Q({},ee),{},{mapHidden:ve,filterExpanded:ue});ne(t),Se((null==ee?void 0:ee.filters)||{}),Pe((null==ee?void 0:ee.wellSection)||N),ie()},Nt=n((function(){return!kt||(!(c(De)||!De[_.sideTracks])||xe!==N)}),[kt,De,xe]);s((function(){if(!me||me>we.length)$e(!1);else if(me<we.length){var e=d(we,"distance");Be(e.slice(0,me))}else me===we.length&&$e(!0)}),[we,me]);var Rt=!gt||!ut||!Tt||it===R.none,Ut=i(!1),_t=r(Ut,2),zt=_t[0],Kt=_t[1],qt=i(z),Gt=r(qt,2),Jt=Gt[0],Qt=Gt[1],Xt=i([]),Yt=r(Xt,2),Zt=Yt[0],$t=Yt[1];s((function(){if(Tt){var e=Tt.slice(0,Jt);$t(e)}}),[Tt,Jt,Fe]);return v(C,{open:J,onClose:Mt,title:v(H,{isWDUser:Y,viewType:it,totalCount:null!==(K=null==gt?void 0:gt.length)&&void 0!==K?K:0,selectedCount:Vt,isViewOnly:re,maxOffsetSize:oe}),contentContainerClassName:M.offsetWellDialog,contentClassName:p(M.contentContainer,t({},M.smallContainer,it===R.small)),actionsClassName:M.modalActions,actions:!re&&b("div",{className:M.actionsWrapper,children:[!Rt&&Nt?v(D,{placement:"bottom-start",title:Y?"To Synced Offsets in Offset App":"To Synced Offsets in Wellhub",children:v("div",{children:v(y,{"data-testid":"".concat(X,"_reset"),onClick:function(){Se({}),Pe(N),Lt(N)},color:"primary",startIcon:v(j,{}),children:"Reset"})})}):b("div",{children:[v("span",{className:p(S.regular12,S.colors.t6),children:"The offset list is being automatically populated by "}),v("span",{className:p(S.medium12,S.colors.t6),children:Y?"Offset Selection App.":"WellHub."})]}),b("div",{className:M.buttonGap,children:[v(y,{"data-testid":"".concat(X,"_cancel"),onClick:Mt,color:"primary",children:"Cancel"}),b(y,{"data-testid":"".concat(X,"_selectedWells"),variant:"contained",color:"primary",onClick:function(){ie();var e=Q(Q({},ee),{},{companyId:ge,subjectWellId:he,selectedWellIds:we.map((function(e){return e.id})),filters:De,metricsKeys:vt,wellSection:xe,isSynced:kt,mapHidden:ve,filterExpanded:ue});ne(e,we)},children:["Select (",Vt,")"]})]})]}),children:Rt?v(h,{fullscreen:!1}):b("div",{className:p(M.contentWrapper),ref:et,children:[it===R.normal&&b(g,{children:[b("div",{className:M.countContainer,children:[v(A,{className:M.totalLabel,children:"Total:"}),v(A,{"data-testid":"".concat(X,"_totalWells"),className:M.countValue,children:gt.length}),v(A,{className:M.selectedLabel,children:"Selected:"}),v(A,{"data-testid":"".concat(X,"_selected"),className:M.countValue,children:Vt})]}),me&&me<=we.length&&v(f,{"data-testid":"".concat(X,"_no more"),className:M.viewOnlyTitleLabel,children:"This app supports no more than (".concat(oe,") offset wells at a time.")}),re&&v(f,{"data-testid":"".concat(X,"_viewOnly"),className:M.viewOnlyTitleLabel,children:"This is the view only mode. To edit offset wells, use the ".concat(Y?"Offset Well Selection app.":"Wellhub.")})]}),it!==R.small&&v(L,{isViewOnly:re,viewType:it,filters:De,setFilters:Se,isFilterExpanded:ue,setIsFilterExpanded:fe,isMapHidden:ve,setIsMapHidden:be}),lt&&v("div",{className:p(M.topGradient,t({},M.topGradientSmall,it===R.small))}),b("div",{className:p(M.content),onScroll:function(e){return function(e){e.target&&(Je&&(e.target.scrollLeft=0,Qe(!1)),e.target.scrollLeft<=5&&zt&&Kt(!1),e.target.scrollLeft>5&&!zt&&Kt(!0),e.target.scrollTop<=5&<&&at(!1),e.target.scrollTop>5&&!lt&&at(!0),e.target.scrollHeight!==e.target.offsetHeight&&Math.round(e.target.scrollTop+e.target.offsetHeight)>=e.target.scrollHeight&&Jt<Tt.length&&Qt((function(e){return e+z})))}(e)},children:[it===R.small&&v(L,{isViewOnly:re,viewType:it,filters:De,setFilters:Se,isFilterExpanded:ue,setIsFilterExpanded:fe,isMapHidden:ve,setIsMapHidden:be}),!ve&&J&&v(V,{isViewOnly:re,mapHidden:ve,companyId:ge,subjectWell:Fe,offsetWellIds:we.map((function(e){return e.id})),wells:gt,radius:De[_.radius],handleChanageOffsetWell:Bt,activeWellId:ae}),v(F,{isHidden:!ue,isWDUser:Y,filterOptions:ht,filters:De,wellSections:ut,selectedWellSection:xe,subjectWell:Fe,onChangeFilters:Se,onChangeBicWells:Ft}),v(k,{open:J,isTableLoading:Ne,companyId:ge,subjectWellId:he,sortBy:It,setSortBy:Wt,sortDirection:xt,setSortDirection:Pt,columnsWithDict:At,wells:Zt,metricsKeys:vt,setMetricsKeys:wt,handleChanageOffsetWell:Bt,handleChangeAllOffsetWells:Ht,handleAddRemoveAssets:Ot,isWellNameExpand:ze,setIsWellNameExpand:Ke,isHscrollMoved:zt,onHideAdvancedSearch:Et,isViewOnly:re,isLastWell:Tt.length<=Jt,contentRef:et,isLimitedOffsetwells:Ze,tableTop:pt,wellSections:ut,setActiveWellId:pe})]})]})})};Y.propTypes={isWDUser:a.bool,defaultSubjectWell:a.shape({asset_id:a.number,companyId:a.number}),offsetSettings:a.shape({selectedWellIds:a.arrayOf(a.number),manualWellIds:a.arrayOf(a.number),filters:a.shape({}),metricsKeys:a.arrayOf(a.string),wellSection:a.string,companyId:a.number,subjectWellId:a.number,mapHidden:a.bool,filterExpanded:a.bool,hintPopupClosed:a.bool}),currentUser:a.shape({company_id:a.number}).isRequired,open:a.bool.isRequired,addWellsUsabilityInfo:a.func,isViewOnly:a.bool,onSave:a.func.isRequired,onClose:a.func.isRequired,maxOffsetSize:a.number},Y.defaultProps={isWDUser:!1,defaultSubjectWell:null,offsetSettings:{},addWellsUsabilityInfo:void 0,isViewOnly:!1,maxOffsetSize:K};export{Y as default};
|
|
1
|
+
import e from"@babel/runtime/helpers/toConsumableArray";import t from"@babel/runtime/helpers/defineProperty";import r from"@babel/runtime/helpers/slicedToArray";import{useState as i,useMemo as n,useRef as o,useEffect as s,useCallback as l}from"react";import a from"prop-types";import p from"classnames";import{uniqBy as m,isEmpty as c,sortBy as d,isEqual as u}from"lodash";import{Typography as f}from"@material-ui/core";import{Replay as j}from"@material-ui/icons";import C from"../Modal/Modal.js";import"../IconMenu/index.js";import"../StyledMenuItem/index.js";import"../DevCenter/AppHeader/AppHeader.js";import"../DevCenter/AppSideBar/AppSideBar.js";import"../DevCenter/AppsDataProvider/AppsDataProvider.js";import"../Icons/AnnotationIcon.js";import"../Annotations/components/AnnotationsList/index.js";import"../Annotations/components/LastAnnotation/index.js";import"../Annotations/AnnotationsContext.js";import"../../utils/mobileDetect.js";import"@babel/runtime/helpers/asyncToGenerator";import"@babel/runtime/regenerator";import"querystring";import"uuid/v1";import"../../clients/jsonApi/index.js";import"../../clients/subscriptions.js";import"../../constants/goals.js";import"../../constants/segment.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"../../utils/index.js";import"../HelpCenter/HelpCenterIcon.js";import"../DevCenter/DevCenterAppContainer/components/AppActions/AppActions.css.js";import{jsx as v,jsxs as b,Fragment as g}from"react/jsx-runtime";import"../DevCenter/DevCenterAppContainer/components/AppSettingsDialog/AppSettingsDialog.js";import"../DevCenter/DevCenterAppContainer/components/AnnotationsButton/AnnotationsButton.js";import"../DevCenter/DevCenterAppContainer/components/NonPriorityMenus/NonPriorityMenus.js";import"../DevCenter/DevCenterAppContainer/components/FullscreenButton/FullscreenButton.js";import"../DevCenter/DevCenterAppContainer/components/AppInfoMessage/AppInfoMessage.js";import"../ErrorBoundary/ErrorBoundary.js";import"../ErrorBoundary/DevCenterAppErrorView/DevCenterAppErrorView.js";import h from"../LoadingIndicator/LoadingIndicator.js";import"../EmptyView/EmptyAppView/components/ErrorSubtitleWithIntercomLink.js";import"../DevCenter/DevCenterAppContainer/components/DevCenterAppView/components/ChooseAssetButton/index.js";import"../DevCenter/DevCenterAppContainer/components/DcFullscreenElemsCoordinatorProvider/DcFullscreenElemsCoordinatorProvider.js";import"../DevCenter/DevCenterAppContainer/components/DcFullscreenElemsCoordinatorProvider/IsInsideDcFullscreenElemProvider.js";import"../DevCenter/DevCenterAppContainer/components/IsInsideDcAppProvider/IsInsideDcAppProvider.js";import"../DevCenter/AppContext.js";import"../DevCenter/DevCenterAppContainer/DevCenterAppContainer.css.js";import"../DevCenter/DevCenterAppContainer/components/RestoreAppSizeButton/index.js";import"../DevCenter/DevCenterAppContainer/components/PriorityMenus/PriorityMenus.css.js";import"../DevCenter/DevCenterRouterContext/DevCenterRouterContext.js";import"../DevCenter/DevCenterRouterContext/UniversalLink/UniversalLink.js";import"@babel/runtime/helpers/objectWithoutProperties";import"react-router";import"../DevCenter/NavigationBar/NavigationBar.js";import"../DevCenter/SideBar/SideBar.js";import"../DevCenter/AppSettingsPopover/AppSettingsPopover.js";import"../DevCenter/IsolatedDevCenterAppContainer/DevCenterIsolatedAppPage.js";import"../DevCenter/IsolatedDevCenterAppContainer/DevCenterIsolatedApp.js";import"../AssetEditor/index.js";import"../AppVersionsSelect/AppVersionsSelect.js";import{Regular12 as A}from"../Typography.js";import"../CollapsableSidebar.js";import"../DateTimePicker/index.js";import"../DatePicker/index.js";import"../SlateFormattedText/SlateFormattedText.js";import"../SlateFormattedText/RenderElements.js";import"@babel/runtime/helpers/typeof";import"slate";import"../ParameterCharts/ParameterCharts.js";import"../ParameterCharts/AddEditTrack.js";import"../ChartActionsList/ChartActionsList.js";import"../CopyToClipboard/CopyToClipboard.js";import"../AssetEditor/AssetEditorAutocomplete.js";import"../AssetEditor/SingleAssetEditor.js";import"../SettingEditors/ColorEditor/index.js";import"../SettingEditors/DropdownEditor/index.js";import"../SettingEditors/RadioEditor/index.js";import"../SwitchControl/index.js";import"../ColorPicker/ColorPicker.js";import"../ColorPicker/PaletteChromePicker/PaletteChromePicker.js";import"../TruncatedText/index.js";import"../RangeSlider/RangeSlider.js";import"../Breadcrumbs/index.js";import"../VirtualizedTable/index.js";import"../EmptyView/EmptyView.js";import"../EmptyView/EmptyAppView/EmptyAppView.js";import y from"../Button/index.js";import"../ContextMenuItem/index.js";import"../FolderMenuItem/index.js";import"../EditableItem/EditableItem/index.js";import"../EditableItem/EditableItemWithBadge/index.js";import"../Checkbox/index.js";import"../FolderMenuItemWithLinks/index.js";import"../IconButton/index.js";import"../TextField/index.js";import"../Chip/index.js";import"../Counter/index.js";import"../AnchorsList/AnchorsList.js";import"../Select/index.js";import"../CustomSelect/index.js";import"../Tabs/Tabs.js";import"../Tabs/Tab.js";import"../ResizableTable/ResizableTable.js";import"../Drillstring/BHASchematic.js";import"../Drillstring/BHATable/index.js";import"../Drillstring/BHAComponentIcon.js";import"../Drillstring/BHAComponentDetail/index.js";import"../Drillstring/BHATileIcon.js";import"../Drillstring/BHATile/BHATile.js";import"../Drillstring/BHAList/BHAList.js";import"../Drillstring/BHAComponentsTable/BHAComponentsTable.js";import"../Casing/CasingTable/index.js";import"../Casing/CasingComponentIcon.js";import"../Casing/CasingTileIcon.js";import"../Casing/CasingTableV2/CasingTableV2.js";import"../Casing/CasingTile/CasingTile.js";import"../DisabledSettingsMessage/DisabledSettingsMessage.js";import"../WellSummary/WellSummaryItemLabel.js";import"../WellSummary/WellSummaryItemTitle.js";import"../WellSummary/WellSummaryItemValue.js";import"../WellSummary/ActivitySummaryChart.js";import"../WellSummary/FracWirelineTimeChart.js";import"../BICOffsetPickerDialog/index.js";import"../OffsetWellButton/OffsetWellButton.js";import"../OffsetWellPickerV2/OffsetWellPickerDialog.js";import"../OffsetWellPickerV3/index.js";import"../OffsetWellChips/Chip.js";import"../OffsetWellChips/ChipsContainer.js";import"../Notifications/Notifications.js";import"uuid";import"../ConfirmationDialog.js";import"../TextLink/index.js";import"../Avatar/index.js";import"../Template/TemplatePopover/index.js";import"../MenuItem/index.js";import"../PadModeSelect/PadModeSelect.js";import"../PinnableFilters/PinnableFilters.js";import"../HeaderLayout/HeaderLayout.js";import"../PadOffsetsPicker/PadOffsetsPicker.js";import"../PadOffsetsPicker/OffsetAssetChip.js";import"../PadOffsetsPicker/OffsetAssetsListExpander.js";import"../PadOffsetsPicker/StagesSelector.js";import"../Table/TableToolbar/TableToolbar.js";import{Tooltip as D}from"../Tooltip/Tooltip.js";import"../PriceInput/PriceInput.js";import"../LabelsCounter/LabelsCounter.js";import"../Stepper/Step.js";import"../Stepper/StepsWrapper.js";import"../Stepper/Stepper.js";import"../Comment/CommentIcon/index.js";import"../FilesLoader/FilesLoader.js";import"../FilesLoader/Icons/FileIcon.js";import"../SearchInput/index.js";import"../FeedItem/FeedItem.js";import"../FeedItem/FeedItemEditProvider/FeedItemEditProvider.js";import"../PostInput/PostInput.js";import"../KeyboardDateTimePicker.js";import"../AddComment/Popover.js";import"../AddComment/Popup.js";import"../StageDesignVActual/ComparisonBar/ComparisonBar.js";import"../StageDesignVActual/ElementsComparison/ElementsComparison.js";import"../StageDesignVActual/ComparisonHeader.js";import"../StageDesignVActual/ComparisonRow.js";import"../EmbeddedApp/DevCenterEmbeddedApp.js";import"../EmbeddedApp/EmbeddedApp.js";import"../Autocomplete/Autocomplete.js";import"../DocumentViewer/DocumentViewer.js";import"../ColorPickerPalette/ColorPickerPalette.js";import"../Search/Search.js";import"../Search/components/Listbox.js";import"../Search/components/Paper.js";import"../Search/components/RecentSearches.js";import"../Search/components/InputAdornmentLeft.js";import"../Search/components/Groups.js";import S from"../../styles/typography/index.js";import"../../styles/counter/counter.module.scss.js";import{useFetchWells as I}from"./effects/useFetchWells.js";import{useAdvancedWells as W}from"./effects/useAdvancedWells.js";import{useBicWells as x}from"./effects/useBicWells.js";import{useCompanyMetricKey as P}from"./effects/useCompanyMetricKey.js";import{useFilterOptions as T}from"./effects/useFilterOptions.js";import{useFilteredWells as O}from"./effects/useFilteredWells.js";import{useSortedWells as E}from"./effects/useSortedWells.js";import{useRadiusWells as w}from"./effects/useRadiusWells.js";import"./effects/useAssetsData.js";import{useTableColumns as B}from"./effects/useTableColumns.js";import{AppHeader as H}from"./components/AppHeader/AppHeader.js";import{Toolbar as L}from"./components/Toolbar/Toolbar.js";import{Filter as F}from"./components/Filter/Filter.js";import{WellsMap as V}from"./components/Map/WellsMap.js";import k from"./components/OffsetWellsTable/OffsetWellsTable.js";import M from"./OffsetWellPickerV4.module.css.js";import{ALL_SECTION_KEY as N,ViewType as R,ColumnType as U,FilterType as _,ROWS_PER_PAGE as z,MAX_OFFSET_SIZE as K,SMALL_SCREEN_HEIGHT as q}from"./constants.js";import{SEARCH_CATEGORIES as G}from"./components/OffsetWellsTable/AdvancedSearch/constants.js";function J(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,i)}return r}function Q(e){for(var r=1;r<arguments.length;r++){var i=null!=arguments[r]?arguments[r]:{};r%2?J(Object(i),!0).forEach((function(r){t(e,r,i[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):J(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}var X="OffsetWellPickerV4",Y=function(a){var K,J=a.open,Y=a.isWDUser,Z=a.defaultSubjectWell,$=a.currentUser,ee=a.offsetSettings,te=a.addWellsUsabilityInfo,re=a.isViewOnly,ie=a.onClose,ne=a.onSave,oe=a.maxOffsetSize,se=i(null),le=r(se,2),ae=le[0],pe=le[1],me=n((function(){return oe+1}),[oe]),ce=i(null==ee?void 0:ee.filterExpanded),de=r(ce,2),ue=de[0],fe=de[1],je=i(null==ee?void 0:ee.mapHidden),Ce=r(je,2),ve=Ce[0],be=Ce[1],ge=+(null==Z?void 0:Z.companyId)||+(null==$?void 0:$.company_id),he=null==Z?void 0:Z.asset_id,Ae=i((null==ee?void 0:ee.filters)||{}),ye=r(Ae,2),De=ye[0],Se=ye[1],Ie=i((null==ee?void 0:ee.wellSection)||N),We=r(Ie,2),xe=We[0],Pe=We[1],Te=o(!0),Oe=i([]),Ee=r(Oe,2),we=Ee[0],Be=Ee[1],He=i(null),Le=r(He,2),Fe=Le[0],Ve=Le[1],ke=i(!0),Me=r(ke,2),Ne=Me[0],Re=Me[1],Ue=i(!1),_e=r(Ue,2),ze=_e[0],Ke=_e[1],qe=i(!1),Ge=r(qe,2),Je=Ge[0],Qe=Ge[1],Xe=i(!1),Ye=r(Xe,2),Ze=Ye[0],$e=Ye[1],et=o(),tt=i(R.none),rt=r(tt,2),it=rt[0],nt=rt[1],ot=i(!1),st=r(ot,2),lt=st[0],at=st[1],pt=n((function(){return me&&me<=we.length}),[we]),mt=n((function(){return it===R.small?0:it===R.mobile?52:pt&&re?158:pt||re?120:82}),[pt,it]);s((function(){function e(){window.innerHeight<=q?nt(R.small):nt(R.normal)}return e(),window.addEventListener("resize",e),function(){window.removeEventListener("resize",e)}}),[J]);var ct=n((function(){return!ve&&ue?448:ve?ue?232:0:216}),[ve,ue]);s((function(){Te.current=!0}),[he,null==ee?void 0:ee.selectedWellIds]),s((function(){it===R.small?(be(!0),fe(!1)):(fe(!re&&(null==ee?void 0:ee.filterExpanded)),be(!re&&(null==ee?void 0:ee.mapHidden))),Se((null==ee?void 0:ee.filters)||{}),Pe((null==ee?void 0:ee.wellSection)||N)}),[ee,re,it]);var dt=I(ge,te),ut=x(Y,he),ft=r(ut,2),jt=ft[0],Ct=ft[1],vt=P(ge,null==ee?void 0:ee.metricsKeys),bt=r(vt,2),gt=bt[0],ht=bt[1],At=W(ge,dt,jt,Ct,he,gt),yt=T(At);s((function(){if(At&&jt){var e=At.find((function(e){return e.id===he}));if(e){var r=jt.filter((function(e){return e.value!==N})).map((function(e){return e.label})),i=Q(Q({},e),r.length>0&&t({},U.wellSection,r));Ve(i)}else Ve(null)}}),[jt,At]);var Dt=B(gt),St=O(At,De);s((function(){if(St)if(Te.current){var e=At.filter((function(e){return((null==ee?void 0:ee.selectedWellIds)||[]).includes(e.id)}));Fe&&(e=e.concat(Fe)),Be(m(e,"id")),Te.current=!1}else Be((function(e){var t=(St||[]).filter((function(t){return!!e.find((function(e){var r=e.id;return t.id===r}))}));return Fe&&(t=t.concat(Fe)),m(t,"id")}))}),[At,St,null==ee?void 0:ee.selectedWellIds]);var It=E(Fe,St,we,Re,Te.current),Wt=r(It,5),xt=Wt[0],Pt=Wt[1],Tt=Wt[2],Ot=Wt[3],Et=Wt[4];w(De[_.radius],St,Be,me);var wt=l((function(e,t,r){var i;i=r===G.well.name?t:t.reduce((function(e,t){var r,i=null===(r=At.find((function(e){return e.id===t})))||void 0===r?void 0:r.rigName,n=At.filter((function(e){return e.rigName===i})).map((function(e){return e.id}));return e.concat(n)}),[]);var n=At.filter((function(e){var t=e.id;return i.includes(t)}));Be(e?function(e){return m(e.concat(n),"id")}:function(e){return m(e.filter((function(e){var t=e.id;return!n.find((function(e){return e.id===t}))})))})}),[At]),Bt=l((function(){Qe(!0)}),[]),Ht=l((function(e){ht(e)}),[]),Lt=l((function(t,r){Be(r?function(r){return[].concat(e(r),[t])}:function(e){return e.filter((function(e){return e.id!==t.id}))})}),[]),Ft=l((function(e){if(e){var t=Fe?St.concat(Fe):St,r=m(t,"id");Be(r)}else Be(Fe?[Fe]:[])}),[St,Fe]),Vt=function(e){if(c(Ct))Be(Fe?[Fe]:[]);else{var t=At.filter((function(t){return Ct[e].includes(t.id)}));Be(t)}},kt=l((function(e){Pe(e),Vt(e)}),[Vt]),Mt=n((function(){return we.find((function(e){return e.id===he}))?we.length-1:we.length}),[we,he]),Nt=n((function(){if(!Ct)return!1;var e=we.map((function(e){return e.id})),t=Ct[xe]||[];return(me&&t.length>me?me:t.length)===e.length&&e.every((function(e){return t.includes(e)}))}),[Ct,Z,we,xe]),Rt=function(){var e=(At||[]).filter((function(e){return((null==ee?void 0:ee.selectedWellIds)||[]).includes(e.id)}));Fe&&(e=e.concat(Fe)),Be(m(e,"id")),u(De,ee.filters)||(Te.current=!0);var t=Q(Q({},ee),{},{mapHidden:ve,filterExpanded:ue});ne(t),Se((null==ee?void 0:ee.filters)||{}),Pe((null==ee?void 0:ee.wellSection)||N),ie()},Ut=n((function(){return!Nt||(!(c(De)||!De[_.sideTracks])||xe!==N)}),[Nt,De,xe]);s((function(){if(!me||me>we.length)$e(!1);else if(me<we.length){var e=d(we,"distance");Be(e.slice(0,me))}else me===we.length&&$e(!0)}),[we,me]);var _t=!At||!jt||!Et||it===R.none,zt=i(!1),Kt=r(zt,2),qt=Kt[0],Gt=Kt[1],Jt=i(z),Qt=r(Jt,2),Xt=Qt[0],Yt=Qt[1],Zt=i([]),$t=r(Zt,2),er=$t[0],tr=$t[1];s((function(){if(Et){var e=Et.slice(0,Xt);tr(e)}}),[Et,Xt,Fe]);return v(C,{open:J,onClose:Rt,title:v(H,{isWDUser:Y,viewType:it,totalCount:null!==(K=null==At?void 0:At.length)&&void 0!==K?K:0,selectedCount:Mt,isViewOnly:re,maxOffsetSize:oe,isMaxOffsetLabelShow:pt}),contentContainerClassName:M.offsetWellDialog,contentClassName:p(M.contentContainer,t({},M.smallContainer,it===R.small)),actionsClassName:M.modalActions,actions:!re&&b("div",{className:M.actionsWrapper,children:[!_t&&Ut?v(D,{placement:"bottom-start",title:Y?"To Synced Offsets in Offset App":"To Synced Offsets in Wellhub",children:v("div",{children:v(y,{"data-testid":"".concat(X,"_reset"),onClick:function(){Se({}),Pe(N),Vt(N)},color:"primary",startIcon:v(j,{}),children:"Reset"})})}):b("div",{children:[v("span",{className:p(S.regular12,S.colors.t6),children:"The offset list is being automatically populated by "}),v("span",{className:p(S.medium12,S.colors.t6),children:Y?"Offset Selection App.":"WellHub."})]}),b("div",{className:M.buttonGap,children:[v(y,{"data-testid":"".concat(X,"_cancel"),onClick:Rt,color:"primary",children:"Cancel"}),b(y,{"data-testid":"".concat(X,"_selectedWells"),variant:"contained",color:"primary",onClick:function(){ie();var e=Q(Q({},ee),{},{companyId:ge,subjectWellId:he,selectedWellIds:we.map((function(e){return e.id})),filters:De,metricsKeys:gt,wellSection:xe,isSynced:Nt,mapHidden:ve,filterExpanded:ue});ne(e,we)},children:["Select (",Mt,")"]})]})]}),children:_t?v(h,{fullscreen:!1}):b("div",{className:p(M.contentWrapper),ref:et,children:[it===R.normal&&b(g,{children:[b("div",{className:M.countContainer,children:[v(A,{className:M.totalLabel,children:"Total:"}),v(A,{"data-testid":"".concat(X,"_totalWells"),className:M.countValue,children:At.length}),v(A,{className:M.selectedLabel,children:"Selected:"}),v(A,{"data-testid":"".concat(X,"_selected"),className:M.countValue,children:Mt})]}),pt&&v(f,{"data-testid":"".concat(X,"_no more"),className:M.viewOnlyTitleLabel,children:"This app supports no more than (".concat(oe,") offset wells at a time.")}),re&&v(f,{"data-testid":"".concat(X,"_viewOnly"),className:M.viewOnlyTitleLabel,children:"This is the view only mode. To edit offset wells, use the ".concat(Y?"Offset Well Selection app.":"Wellhub.")})]}),it!==R.small&&v(L,{isViewOnly:re,viewType:it,filters:De,setFilters:Se,isFilterExpanded:ue,setIsFilterExpanded:fe,isMapHidden:ve,setIsMapHidden:be}),lt&&v("div",{className:M.topGradient,style:{top:mt}}),b("div",{className:p(M.content),onScroll:function(e){return function(e){e.target&&(Je&&(e.target.scrollLeft=0,Qe(!1)),e.target.scrollLeft<=5&&qt&&Gt(!1),e.target.scrollLeft>5&&!qt&&Gt(!0),e.target.scrollTop<=5&<&&at(!1),e.target.scrollTop>5&&!lt&&at(!0),e.target.scrollHeight!==e.target.offsetHeight&&Math.round(e.target.scrollTop+e.target.offsetHeight)>=e.target.scrollHeight&&Xt<Et.length&&Yt((function(e){return e+z})))}(e)},children:[it===R.small&&v(L,{isViewOnly:re,viewType:it,filters:De,setFilters:Se,isFilterExpanded:ue,setIsFilterExpanded:fe,isMapHidden:ve,setIsMapHidden:be}),!ve&&J&&v(V,{isViewOnly:re,mapHidden:ve,companyId:ge,subjectWell:Fe,offsetWellIds:we.map((function(e){return e.id})),wells:At,radius:De[_.radius],handleChanageOffsetWell:Lt,activeWellId:ae}),v(F,{isHidden:!ue,isWDUser:Y,filterOptions:yt,filters:De,wellSections:jt,selectedWellSection:xe,subjectWell:Fe,onChangeFilters:Se,onChangeBicWells:kt}),v(k,{open:J,isTableLoading:Ne,companyId:ge,subjectWellId:he,sortBy:xt,setSortBy:Pt,sortDirection:Tt,setSortDirection:Ot,columnsWithDict:Dt,wells:er,metricsKeys:gt,setMetricsKeys:Ht,handleChanageOffsetWell:Lt,handleChangeAllOffsetWells:Ft,handleAddRemoveAssets:wt,isWellNameExpand:ze,setIsWellNameExpand:Ke,isHscrollMoved:qt,onHideAdvancedSearch:Bt,isViewOnly:re,isLastWell:Et.length<=Xt,contentRef:et,isLimitedOffsetwells:Ze,tableTop:ct,wellSections:jt,setActiveWellId:pe})]})]})})};Y.propTypes={isWDUser:a.bool,defaultSubjectWell:a.shape({asset_id:a.number,companyId:a.number}),offsetSettings:a.shape({selectedWellIds:a.arrayOf(a.number),manualWellIds:a.arrayOf(a.number),filters:a.shape({}),metricsKeys:a.arrayOf(a.string),wellSection:a.string,companyId:a.number,subjectWellId:a.number,mapHidden:a.bool,filterExpanded:a.bool,hintPopupClosed:a.bool}),currentUser:a.shape({company_id:a.number}).isRequired,open:a.bool.isRequired,addWellsUsabilityInfo:a.func,isViewOnly:a.bool,onSave:a.func.isRequired,onClose:a.func.isRequired,maxOffsetSize:a.number},Y.defaultProps={isWDUser:!1,defaultSubjectWell:null,offsetSettings:{},addWellsUsabilityInfo:void 0,isViewOnly:!1,maxOffsetSize:K};export{Y as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from'./../../ext-esm/style-inject/dist/style-inject.es.js';var l={offsetWellDialog:"OffsetWellPickerV4-module_offsetWellDialog__EkSjl",viewOnlyTitleLabel:"OffsetWellPickerV4-module_viewOnlyTitleLabel__pod4c",contentWrapper:"OffsetWellPickerV4-module_contentWrapper__gVGQ-",contentContainer:"OffsetWellPickerV4-module_contentContainer__Eb9sk",smallContainer:"OffsetWellPickerV4-module_smallContainer__ngDTM",content:"OffsetWellPickerV4-module_content__mEQWD",modalActions:"OffsetWellPickerV4-module_modalActions__cShAH",actionsWrapper:"OffsetWellPickerV4-module_actionsWrapper__C0Ciz",buttonGap:"OffsetWellPickerV4-module_buttonGap__fjFT6",viewOnlyLabel:"OffsetWellPickerV4-module_viewOnlyLabel__GP44N",countContainer:"OffsetWellPickerV4-module_countContainer__p8V5A",totalLabel:"OffsetWellPickerV4-module_totalLabel__3n5bD",selectedLabel:"OffsetWellPickerV4-module_selectedLabel__BzClE",countValue:"OffsetWellPickerV4-module_countValue__dLG-K",topGradient:"OffsetWellPickerV4-module_topGradient__fAc7W"
|
|
1
|
+
import e from'./../../ext-esm/style-inject/dist/style-inject.es.js';var l={offsetWellDialog:"OffsetWellPickerV4-module_offsetWellDialog__EkSjl",viewOnlyTitleLabel:"OffsetWellPickerV4-module_viewOnlyTitleLabel__pod4c",contentWrapper:"OffsetWellPickerV4-module_contentWrapper__gVGQ-",contentContainer:"OffsetWellPickerV4-module_contentContainer__Eb9sk",smallContainer:"OffsetWellPickerV4-module_smallContainer__ngDTM",content:"OffsetWellPickerV4-module_content__mEQWD",modalActions:"OffsetWellPickerV4-module_modalActions__cShAH",actionsWrapper:"OffsetWellPickerV4-module_actionsWrapper__C0Ciz",buttonGap:"OffsetWellPickerV4-module_buttonGap__fjFT6",viewOnlyLabel:"OffsetWellPickerV4-module_viewOnlyLabel__GP44N",countContainer:"OffsetWellPickerV4-module_countContainer__p8V5A",totalLabel:"OffsetWellPickerV4-module_totalLabel__3n5bD",selectedLabel:"OffsetWellPickerV4-module_selectedLabel__BzClE",countValue:"OffsetWellPickerV4-module_countValue__dLG-K",topGradient:"OffsetWellPickerV4-module_topGradient__fAc7W"};e(".OffsetWellPickerV4-module_offsetWellDialog__EkSjl{padding-bottom:40px;width:1100px}.OffsetWellPickerV4-module_viewOnlyTitleLabel__pod4c{color:var(--palette-primary-text-6);font-size:16px!important;line-height:140.6%!important;margin-bottom:16px!important;margin-left:40px!important}.OffsetWellPickerV4-module_contentWrapper__gVGQ-{display:flex;flex-direction:column;overflow:hidden auto;position:relative}.OffsetWellPickerV4-module_contentContainer__Eb9sk{display:flex;flex-direction:column;overflow-y:hidden;padding:0;position:relative}.OffsetWellPickerV4-module_smallContainer__ngDTM{margin-top:4px}.OffsetWellPickerV4-module_content__mEQWD{flex:1;margin:0 24px 0 40px;overflow:auto;position:relative}.OffsetWellPickerV4-module_content__mEQWD::-webkit-scrollbar-corner{background-color:transparent}.OffsetWellPickerV4-module_content__mEQWD::-webkit-scrollbar{width:16px}.OffsetWellPickerV4-module_content__mEQWD::-webkit-scrollbar-thumb{background-clip:padding-box;background-color:hsla(240,2%,65%,.722);border:5px solid rgba(0,0,0,.01);border-radius:10px}.OffsetWellPickerV4-module_modalActions__cShAH{justify-content:flex-end;padding:8px 40px}.OffsetWellPickerV4-module_actionsWrapper__C0Ciz{align-items:center;display:flex;flex:1;justify-content:space-between}.OffsetWellPickerV4-module_buttonGap__fjFT6{display:flex;gap:16px}.OffsetWellPickerV4-module_viewOnlyLabel__GP44N{color:var(--palette-primary-text-6);padding-bottom:16px;padding-left:40px}.OffsetWellPickerV4-module_countContainer__p8V5A{align-items:center;display:flex;height:24px;margin:0 0 16px 40px;z-index:9}.OffsetWellPickerV4-module_totalLabel__3n5bD{color:var(--palette-primary-text-6)}.OffsetWellPickerV4-module_selectedLabel__BzClE{color:var(--palette-primary-text-6);padding-left:16px}.OffsetWellPickerV4-module_countValue__dLG-K{color:var(--palette-primary-text-1);padding-left:8px}.OffsetWellPickerV4-module_topGradient__fAc7W{background-image:linear-gradient(0deg,rgba(65,65,65,0),#414141);border-bottom:none!important;height:16px!important;padding:0!important;position:absolute;top:120px;width:100%;z-index:3}");export{l as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"prop-types";import{Divider as i,Tooltip as
|
|
1
|
+
import e from"prop-types";import{Divider as i,Tooltip as s,Badge as l,Typography as a}from"@material-ui/core";import t from"@material-ui/icons/Info";import{Regular20 as o,Regular12 as r}from"../../../Typography.js";import{ViewType as n}from"../../constants.js";import c from"./AppHeader.module.css.js";import{jsx as d,jsxs as p}from"react/jsx-runtime";var m=function(e){var i=e.sourceApp,s=e.isViewOnly,l=e.maxOffsetSize,t=e.isMaxOffsetLabelShow;return s&&t?p("div",{className:c.tooltipContainer,children:[p("div",{className:c.tooltipWrapper,children:[d(a,{className:c.tooltipLabel,children:"1."}),p(a,{className:c.tooltipLabel,children:["This application can work with no more than (",l,") Offset Wells at a time."]})]}),p("div",{className:c.tooltipWrapper,children:[d(a,{className:c.tooltipLabel,children:"2."}),p(a,{className:c.tooltipLabel,children:["The window is in the view only mode. To edit offset wells, use the ",i,"."]})]})]}):s?d("div",{className:c.tooltipContainer,children:p("span",{className:c.tooltipLabel,children:["The window is in the view only mode. To edit offset wells, use the ",i,"."]})}):t?d("div",{className:c.tooltipContainer,children:p("span",{className:c.tooltipLabel,children:["This application can work with no more than (",l,") Offset Wells at a time."]})}):null};m.propTypes={sourceApp:e.string.isRequired,isViewOnly:e.bool.isRequired,maxOffsetSize:e.number.isRequired,isMaxOffsetLabelShow:e.bool.isRequired};var f=function(e){var a=e.isWDUser,f=e.viewType,h=e.totalCount,u=e.selectedCount,b=e.isViewOnly,w=e.maxOffsetSize,N=e.isMaxOffsetLabelShow;return f===n.normal?d("div",{className:c.headerContainer,children:d(o,{children:"Select Offset Wells"})}):p("div",{className:c.headerContainer,children:[d(o,{children:"Select Offset Wells"}),d(i,{className:c.divideLine}),d(r,{className:c.totalLabel,children:"Total:"}),d(r,{"data-testid":"".concat("AppHeader","_totalWells"),className:c.countValue,children:h}),d(r,{className:c.selectedLabel,children:"Selected:"}),d(r,{"data-testid":"".concat("AppHeader","_selected"),className:c.countValue,children:u}),(b||N)&&d(s,{title:d(m,{sourceApp:a?"Offset Well Selection app":"Wellhub",isViewOnly:b,maxOffsetSize:w,isMaxOffsetLabelShow:N}),placement:"right",classes:{popper:b&&N&&c.tooltipPopper},children:p("div",{className:c.infoWrapper,children:[d(t,{className:c.infoIcon}),b&&N&&d(l,{badgeContent:2,classes:{badge:c.infoBadge}})]})})]})};f.propTypes={isWDUser:e.bool.isRequired,viewType:e.string.isRequired,totalCount:e.number.isRequired,selectedCount:e.number.isRequired,isViewOnly:e.bool.isRequired,maxOffsetSize:e.number.isRequired,isMaxOffsetLabelShow:e.bool.isRequired};export{f as AppHeader};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"@babel/runtime/helpers/slicedToArray";import t from"@babel/runtime/helpers/defineProperty";import{memo as i,useRef as l,useState as r,useCallback as n,useEffect as a,useMemo as s}from"react";import c from"prop-types";import{startCase as o,get as d}from"lodash";import u from"classnames";import m from"moment";import{TableRow as f,TableCell as h,Checkbox as y,Tooltip as
|
|
1
|
+
import e from"@babel/runtime/helpers/slicedToArray";import t from"@babel/runtime/helpers/defineProperty";import{memo as i,useRef as l,useState as r,useCallback as n,useEffect as a,useMemo as s}from"react";import c from"prop-types";import{startCase as o,get as d}from"lodash";import u from"classnames";import m from"moment";import{TableRow as f,TableCell as h,Checkbox as y,Tooltip as p,Typography as b}from"@material-ui/core";import{convertValue as v}from"../../../../utils/index.js";import{ColumnType as w,EXPANED_WELLNAME_WIDTH as N,StatusOptions as g,ROW_HEIGHT as R}from"../../constants.js";import{SubjectWellMark as W}from"./SubjectWellMark.js";import C from"./OffsetWellsTableRow.module.css.js";import q from"./ViewWellSectionsName.js";import{jsxs as T,jsx as k}from"react/jsx-runtime";var O="OffsetWellsTableRow";function S(e,t,i){var l=t.find((function(e){return e.key===i})),r=d(e,l.key);return"undefined"===r?"loading...":Number.isFinite(r)||r?l.unitType?v(r,l.unitType,l.from,l.to):r:"—"}function x(e,t){var i=d(e,w.distance);return Number.isFinite(i)?t?i:v(i,"length","mi","km"):"—"}function j(e,t){var i=e.find((function(e){return e.key===t}));return(null==i?void 0:i.width)||0}var _=function(i){var c,d,v=i.columnsWithDict,_=i.data,D=i.subjectWellId,M=i.metricsKeys,A=i.metricsColumns,I=i.handleChanageOffsetWell,L=i.isWellNameExpand,Y=i.wellNameStyle,z=i.wellNameWidth,E=i.isViewOnly,V=i.isImperial,F=i.isLimitedOffsetwells,K=i.flyTo,P=i.tableTop,H=i.wellSections,B=i.setActiveWellId,G=D===_.id,J=t({},C.subjectWellRow,G),Q=l(),U=l(),X=r(!1),Z=e(X,2),$=Z[0],ee=Z[1],te=l(),ie=!1,le=_[w.name]||"—",re=le;if(!L&&2*z<8*le.length){var ne=function(e){var t=document.createElement("span");document.body.appendChild(t),t.style.font="Roboto",t.style.fontSize="14px",t.style.letterSpacing="0.01071em",t.style.height="auto",t.style.width="auto",t.style.position="absolute",t.style.whiteSpace="nowrap",t.innerHTML=e;var i=Math.ceil(t.clientWidth);return document.body.removeChild(t),i}(le);if(ne>2*z){var ae=2*z/(ne/le.length);re="".concat(le.substring(0,ae/2-2),"\n... ").concat(le.substring(le.length-ae/2+6)),ie=!0}}var se=n((function(e,t){var i=t-e+16;Q.current.style.position="absolute",Q.current.style.top="".concat(e,"px"),Q.current.style.zIndex=3,Q.current.style.transition="transform ".concat(800,"ms ease"),Q.current.style.transform="translateY(".concat(i,"px)")}),[]),ce=n((function(){Q.current.style.position="unset",Q.current.style.zIndex=1,Q.current.style.transition="none",Q.current.style.transform="none"}),[]);a((function(){ce(),ee(!1),U.current&&(clearTimeout(U.current),U.current=null),te.current=K}),[K]);var oe,de,ue=n((function(e){if(!U.current){var t=Q.current.offsetTop,i=K;e?Math.abs(i-t)>=7*R&&(i=t-7*R):i=t+7*R,ee(!0),se(t,i),U.current=setTimeout((function(){return I(_,e)}),800)}}),[_,K,P]),me=s((function(){return _[w.wellSection]}),[_]);return T(f,{"data-testid":"".concat(O,"_row_").concat(le),className:C.bodyRow,innerRef:Q,onMouseEnter:function(){B(_.id)},onMouseLeave:function(){B(null)},children:[T(h,{"data-testid":"".concat(O,"_well"),className:u(C.bodyCell,C.wellNameCell,Y,J),style:{width:L?N:j(v,w.name)},children:[G&&k(W,{className:C.subjectWellMark}),!G&&k(y,{"data-testid":"".concat(O,"_checkbox"),size:"medium",checked:$&&te.current===K?!_.checked:_.checked,disabled:E||F&&!_.checked,onChange:function(e){return ue(e.target.checked)}}),k(p,{title:ie?le:"",children:k(b,{variant:"body2",className:u(C.wellNameCursor,(c={},t(c,C.cellDataViewOnly,G),t(c,C.wellNamePreWrap,ie),c)),children:ie?re:le})})]}),k(h,{"data-testid":"".concat(O,"_dot"),className:u(C.bodyCell,J),style:{width:j(v,w.status)},children:!G&&k(p,{title:o(_[w.status]),children:k("div",{"data-testid":"".concat(O,"_color"),className:C.status,style:{background:null===(d=g.find((function(e){return e.value===_[w.status]})))||void 0===d?void 0:d.color}})})}),k(h,{"data-testid":"".concat(O,"_rig"),className:u(C.bodyCell,J),style:{width:j(v,w.rig)},children:k(b,{variant:"body2",className:C.cellData,children:_[w.rig]&&"Null"!==_[w.rig]?_[w.rig]:"—"})}),k(h,{"data-testid":"".concat(O,"_distance"),className:u(C.bodyCell,J),style:{width:j(v,w.distance)},children:k(b,{variant:"body2",className:C.cellData,children:x(_,V)})}),k(h,{"data-testid":"".concat(O,"_lastActive"),className:u(C.bodyCell,J),style:{width:j(v,w.lastActive)},children:k(b,{variant:"body2",className:C.cellData,children:_[w.lastActive]&&Number.isFinite(_[w.lastActive])?m.unix(_[w.lastActive]).format("MM/DD/YYYY"):"—"})}),M.map((function(e){return k(h,{"data-testid":"".concat(O,"_").concat(e),className:u(C.bodyCell,J),style:{width:j(v,e)},children:k(b,{variant:"body2",className:C.cellData,children:S(_,A,e)})},e)})),k(h,{"data-testid":"".concat(O,"_wellSection"),className:u(C.bodyCell,C.lastCell,J),style:{width:j(v,w.wellSection)},children:me&&me.length>1?k(p,{classes:{tooltip:C.customTooltip},title:k(q,{wellSectionNames:me}),children:k("div",{className:C.sectionLength,children:me.length})}):k(p,{title:me||"",children:k(b,{variant:"body2",className:C.cellData,style:{color:me&&1===me.length&&(oe=me,de=e(oe,1)[0],H.find((function(e){return e.label===de})).color)},children:me})})})]})};_.propTypes={columnsWithDict:c.arrayOf(c.shape({})).isRequired,data:c.shape({id:c.number,checked:c.bool,name:c.string,status:c.string}).isRequired,subjectWellId:c.number.isRequired,metricsKeys:c.arrayOf(c.string).isRequired,metricsColumns:c.arrayOf(c.shape({})).isRequired,handleChanageOffsetWell:c.func.isRequired,isWellNameExpand:c.bool.isRequired,wellNameStyle:c.string.isRequired,wellNameWidth:c.number.isRequired,isViewOnly:c.bool.isRequired,isImperial:c.bool.isRequired,isLimitedOffsetwells:c.bool.isRequired,flyTo:c.number.isRequired,tableTop:c.number.isRequired,wellSections:c.arrayOf(c.shape({})).isRequired,setActiveWellId:c.func.isRequired};var D=i(_);export{D as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"@babel/runtime/helpers/toConsumableArray";import t from"@babel/runtime/helpers/defineProperty";import{useMemo as r,useEffect as n}from"react";import i from"prop-types";import o from"classnames";import{Table as a,Column as l,SortDirection as s}from"react-virtualized";import{withStyles as u,IconButton as c,Typography as d,Tooltip as f}from"@material-ui/core";import{Settings as m,Sort as h,ArrowUpward as p,ArrowDownward as b}from"@material-ui/icons";import{getUnitDisplay as g}from"../../utils/convert.js";import{jsx as y,
|
|
1
|
+
import e from"@babel/runtime/helpers/toConsumableArray";import t from"@babel/runtime/helpers/defineProperty";import{useMemo as r,useEffect as n}from"react";import i from"prop-types";import o from"classnames";import{Table as a,Column as l,SortDirection as s}from"react-virtualized";import{withStyles as u,IconButton as c,Typography as d,Tooltip as f}from"@material-ui/core";import{Settings as m,Sort as h,ArrowUpward as p,ArrowDownward as b}from"@material-ui/icons";import{getUnitDisplay as g}from"../../utils/convert.js";import{jsx as y,jsxs as w}from"react/jsx-runtime";function S(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function R(e){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{};r%2?S(Object(n),!0).forEach((function(r){t(e,r,n[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):S(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function x(e,t){var r=e.find((function(e){return e.key===t}))||{},n=r.unitType,i=r.customUnit;return i?"(".concat(i,")"):n?"(".concat(g(n),")"):""}function O(e,t){return(e.find((function(e){return e.key===t}))||{}).headerLabelClassName||""}function v(e,t){return(e.find((function(e){return e.key===t}))||{}).headerLabelUnitClassName||""}function C(i){var u=i.columns,g=i.data,S=i.useColumnSetting,C=i.useFixedColumnWidth,z=i.onOpenSettingDlg,_=i.classes,j=i.width,k=i.height,D=i.headerHeight,T=i.rowHeight,q=i.showTopSettingIcon,N=i.customMuiStyles,I=i.isTopSettingIconShownAlways,L=i.CustomCellRenderer,P=i.customRowStyle,H=i.sort,B=i.sortBy,A=i.sortDirection,W=R(R({},_),N),E=r((function(){return{label:"",key:"setting",width:S?25:0}}),[S]),F=r((function(){return u.filter((function(e){return e.show}))}),[u]),K=r((function(){return S?[].concat(e(F),[E]):F}),[F,S,E]),V=r((function(){if(j<=0)return{};var e=t({},E.key,E.width),r=[];return F.filter((function(e){return Number.isFinite(e.width)})).forEach((function(t){e[t.key]=t.width-1,r.push(t.width-1)})),F.filter((function(e){return!Number.isFinite(e.width)})).forEach((function(t){var n=r.reduce((function(e,t){return e+t}),0),i=Math.floor((j-n-E.width)/(F.length-r.length)),o=t.minWidth||65,a=i<o?o:i;e[t.key]=a-1,r.push(a-1)})),e}),[j,F,E]),M=r((function(){return Object.values(V).reduce((function(e,t){return e+t}),0)}),[V]),G=I||M-12.5>=j;n((function(){q(G)}),[G]);var U=function(e){var t=e.label,r=e.dataKey,n=B||A||H;return r===E.key?G?null:y(c,{size:"small","aria-label":"customize columns",className:W.settingIcon,onClick:z,children:y(m,{fontSize:"inherit"})}):w(d,{variant:"body2",className:o(W.headerLabel,O(u,r)),children:[t," ",y("span",{className:o(W.unitLabel,v(u,r)),children:x(u,r)}),n&&r!==B&&y(f,{title:"Sort A-Z",children:y(h,{fontSize:"small",className:_.sortIcon})}),n&&r===B&&(A===s.ASC?y(p,{fontSize:"small",className:_.sortIcon}):y(b,{fontSize:"small",className:_.sortIcon}))]})},Z=function(e){var t=e.dataKey,r=e.rowData;return L?y(L,{columnKey:t,value:r[t]}):y(d,{variant:"body2",className:W.cellData,children:r[t]})};return y(a,{width:C?M:j,height:k,headerHeight:D,rowClassName:function(e){var r=e.index;return o(t({},W.oddRow,r%2==1))},rowHeight:T,rowCount:g.length,rowGetter:function(e){var t=e.index;return g[t]},rowStyle:P||{},className:W.table,sort:H,sortBy:B,sortDirection:A,children:K.map((function(e){return y(l,{width:V[e.key]||0,dataKey:e.key,label:e.label,headerRenderer:U,cellRenderer:Z},e.key)}))})}C.propTypes={columns:i.arrayOf(i.shape({})).isRequired,data:i.arrayOf(i.shape({})).isRequired,useColumnSetting:i.bool.isRequired,useFixedColumnWidth:i.bool.isRequired,headerHeight:i.number.isRequired,rowHeight:i.number.isRequired,width:i.number.isRequired,height:i.number.isRequired,onOpenSettingDlg:i.func.isRequired,showTopSettingIcon:i.func.isRequired,sort:i.func,sortBy:i.string,sortDirection:i.string,classes:i.shape({}).isRequired,customMuiStyles:i.shape({table:i.string,oddRow:i.string,headerLabel:i.string,cellData:i.string,unitLabel:i.string,settingIcon:i.string}).isRequired,isTopSettingIconShownAlways:i.bool.isRequired,CustomCellRenderer:i.func,customRowStyle:i.func},C.defaultProps={CustomCellRenderer:null,customRowStyle:null,sort:null,sortBy:null,sortDirection:null};var z=u((function(e){return{table:{"& .ReactVirtualized__Table__headerRow":{textTransform:"none",borderBottom:e.isLightTheme?"1px solid rgba(224, 224, 224, 1)":"1px solid rgba(81, 81, 81, 1)"},"& .ReactVirtualized__Table__row":{borderBottom:e.isLightTheme?"1px solid rgba(224, 224, 224, 1)":"1px solid rgba(81, 81, 81, 1)"},"& .ReactVirtualized__Table__Grid":{outline:"none"},"& .ReactVirtualized__Table__headerColumn":{outline:"none"}},oddRow:{backgroundColor:e.isLightTheme?"rgba(189, 189, 189, 0.1)":"#303030"},headerLabel:{lineHeight:"14px",fontSize:"12px",fontStyle:"normal",letterSpacing:"-0.25px",display:"flex",alignItems:"center",flexWrap:"wrap"},cellData:{lineHeight:"14px",fontSize:"12px",fontWeight:"normal",fontStyle:"normal",letterSpacing:"0.15px"},unitLabel:{fontSize:"10px",opacity:.5},settingIcon:{padding:"3px",fontSize:"20px"},sortIcon:{fontSize:"16px"}}}))(C);export{C as VirtualizedTableComponent,z as default};
|