@corva/ui 0.53.0-6 → 0.53.0-rc.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. package/assets/1aa187dca9a802ede389885e43aff155.svg +9 -0
  2. package/assets/5124c957601b1a0ef1f0b93bce1ae0de.svg +13 -0
  3. package/assets/66745cf3868fdb983d0a2180a43b0720.svg +11 -0
  4. package/components/OffsetWellMap/OffsetWellMap.d.ts.map +1 -1
  5. package/components/OffsetWellMap/OffsetWellMap.js +1 -1
  6. package/components/OffsetWellPickerV4/OffsetWellPickerV4.d.ts.map +1 -1
  7. package/components/OffsetWellPickerV4/OffsetWellPickerV4.js +1 -1
  8. package/components/OffsetWellPickerV4/OffsetWellPickerV4.module.css.js +1 -1
  9. package/components/OffsetWellPickerV4/components/AppHeader/AppHeader.d.ts +3 -1
  10. package/components/OffsetWellPickerV4/components/AppHeader/AppHeader.d.ts.map +1 -1
  11. package/components/OffsetWellPickerV4/components/AppHeader/AppHeader.js +1 -1
  12. package/components/OffsetWellPickerV4/components/CustomInfoIcon/CustomInfoIcon.d.ts +2 -9
  13. package/components/OffsetWellPickerV4/components/CustomInfoIcon/CustomInfoIcon.d.ts.map +1 -1
  14. package/components/OffsetWellPickerV4/components/CustomInfoIcon/CustomInfoIcon.js +1 -0
  15. package/components/OffsetWellPickerV4/components/CustomInfoIcon/CustomInfoIcon.module.css.js +1 -0
  16. package/components/OffsetWellPickerV4/components/OffsetWellsTable/OffsetWellsTable.d.ts +3 -1
  17. package/components/OffsetWellPickerV4/components/OffsetWellsTable/OffsetWellsTable.js +1 -1
  18. package/components/OffsetWellPickerV4/components/OffsetWellsTable/OffsetWellsTableRow.d.ts +3 -1
  19. package/components/OffsetWellPickerV4/components/OffsetWellsTable/OffsetWellsTableRow.js +1 -1
  20. package/components/StatusBadge/DQChip.d.ts +9 -0
  21. package/components/StatusBadge/DQChip.d.ts.map +1 -0
  22. package/components/StatusBadge/DQChip.js +1 -0
  23. package/components/StatusBadge/DQStatusIcon.d.ts +13 -0
  24. package/components/StatusBadge/DQStatusIcon.d.ts.map +1 -0
  25. package/components/StatusBadge/DQStatusIcon.js +1 -0
  26. package/components/StatusBadge/DQUnvalidatedContent.d.ts +8 -0
  27. package/components/StatusBadge/DQUnvalidatedContent.d.ts.map +1 -0
  28. package/components/StatusBadge/DQUnvalidatedContent.js +1 -0
  29. package/components/StatusBadge/constants.d.ts +24 -6
  30. package/components/StatusBadge/constants.d.ts.map +1 -1
  31. package/components/StatusBadge/constants.js +1 -1
  32. package/components/StatusBadge/index.d.ts +4 -2
  33. package/components/StatusBadge/index.d.ts.map +1 -1
  34. package/components/StatusBadge/index.js +1 -1
  35. package/package.json +1 -1
@@ -0,0 +1,9 @@
1
+ <svg width="69" height="8" viewBox="0 0 69 8" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M1.224 5.65909V0.022727H0V5.95455C0 7.25 0.804 8 2.268 8H4.512C5.976 8 6.78 7.25 6.78 5.95455V0.022727H5.556V5.65909C5.556 6.53409 5.16 6.89773 4.224 6.89773H2.556C1.62 6.89773 1.224 6.53409 1.224 5.65909Z" fill="white"/>
3
+ <path d="M16.7895 0.022727H15.5775V6.05682H15.5295C15.3375 5.77273 11.1015 0.215909 11.0655 0.159091C11.0055 0.0681816 10.9815 0.022727 10.7175 0.022727H9.7455V7.97727H10.9695V2.07955H11.0175C11.1135 2.21591 15.1935 7.60227 15.3135 7.77273C15.4095 7.90909 15.5055 7.97727 15.7215 7.97727H16.7895V0.022727Z" fill="white"/>
4
+ <path d="M21.0875 0.022727H19.8635V7.97727H21.0875V4.52273H22.7555L25.2995 7.97727H26.6915L23.7515 3.96591L26.7035 0.022727H25.3235L22.6835 3.45455H21.0875V0.022727Z" fill="white"/>
5
+ <path d="M36.0293 0.022727H34.8173V6.05682H34.7693C34.5773 5.77273 30.3413 0.215909 30.3053 0.159091C30.2453 0.0681816 30.2213 0.022727 29.9573 0.022727H28.9853V7.97727H30.2093V2.07955H30.2573C30.3533 2.21591 34.4333 7.60227 34.5533 7.77273C34.6493 7.90909 34.7453 7.97727 34.9613 7.97727H36.0293V0.022727Z" fill="white"/>
6
+ <path d="M41.2153 8H43.6753C45.1153 8 45.9313 7.25 45.9313 5.95455V2.04545C45.9313 0.738636 45.1153 0 43.6753 0H41.2153C39.7753 0 38.9593 0.738636 38.9593 2.04545V5.95455C38.9593 7.25 39.7753 8 41.2153 8ZM41.5273 1H43.3633C44.2873 1 44.6953 1.28409 44.6953 2.14773V5.73864C44.6953 6.60227 44.2873 6.97727 43.3633 6.97727H41.5273C40.6033 6.97727 40.1953 6.60227 40.1953 5.73864V2.14773C40.1953 1.28409 40.6033 1 41.5273 1Z" fill="white"/>
7
+ <path d="M56.2556 6.86364H55.7876L54.4916 0.022727H52.5716L51.2876 6.86364H50.8076L49.4036 0.022727H48.0476C48.0476 0.022727 49.7276 7.5 49.7876 7.80682C49.8116 7.92045 49.8836 8 50.0036 8H52.1756C52.2836 8 52.3796 7.93182 52.3916 7.82955C52.4276 7.625 53.4716 1.59091 53.4716 1.59091H53.6036C53.6036 1.59091 54.6476 7.625 54.6836 7.82955C54.6956 7.93182 54.7916 8 54.8876 8H57.0716C57.1916 8 57.2636 7.92045 57.2876 7.80682C57.3476 7.5 59.0276 0.022727 59.0276 0.022727H57.6716L56.2556 6.86364Z" fill="white"/>
8
+ <path d="M68.5629 0.022727H67.3509V6.05682H67.3029C67.1109 5.77273 62.8749 0.215909 62.8389 0.159091C62.7789 0.0681816 62.7549 0.022727 62.4909 0.022727H61.5189V7.97727H62.7429V2.07955H62.7909C62.8869 2.21591 66.9669 7.60227 67.0869 7.77273C67.1829 7.90909 67.2789 7.97727 67.4949 7.97727H68.5629V0.022727Z" fill="white"/>
9
+ </svg>
@@ -0,0 +1,13 @@
1
+ <svg width="94" height="8" viewBox="0 0 94 8" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M1.224 5.65242V0H0V5.94872C0 7.24786 0.804 8 2.268 8H4.512C5.976 8 6.78 7.24786 6.78 5.94872V0H5.556V5.65242C5.556 6.52991 5.16 6.89459 4.224 6.89459H2.556C1.62 6.89459 1.224 6.52991 1.224 5.65242Z" fill="white"/>
3
+ <path d="M16.7895 0H15.5775V6.05128H15.5295C15.3375 5.76638 11.1015 0.193732 11.0655 0.136752C11.0055 0.0455841 10.9815 0 10.7175 0H9.7455V7.97721H10.9695V2.06268H11.0175C11.1135 2.19943 15.1935 7.60114 15.3135 7.77208C15.4095 7.90883 15.5055 7.97721 15.7215 7.97721H16.7895V0Z" fill="white"/>
4
+ <path d="M23.2835 6.849H22.8635L20.6195 0H19.2395C19.2395 0 21.7475 7.45299 21.8555 7.78348C21.8915 7.92023 21.9515 8 22.0835 8H24.0635C24.1835 8 24.2555 7.92023 24.2915 7.78348C24.3875 7.45299 26.9075 0 26.9075 0H25.5155L23.2835 6.849Z" fill="white"/>
5
+ <path d="M34.763 7.97721H36.143C36.143 7.97721 33.491 0.433048 33.407 0.193732C33.359 0.0455841 33.323 0 33.071 0H31.211C30.959 0 30.923 0.0455841 30.887 0.193732C30.803 0.433048 28.151 7.97721 28.151 7.97721H29.531L30.323 5.68661H33.971L34.763 7.97721ZM31.895 0.968661H32.399L33.659 4.5698H30.623L31.895 0.968661Z" fill="white"/>
6
+ <path d="M38.5994 7.97721H44.2274V6.94017H39.8234V0H38.5994V7.97721Z" fill="white"/>
7
+ <path d="M47.7751 0H46.5631V7.97721H47.7751V0Z" fill="white"/>
8
+ <path d="M50.9369 7.97721H55.3049C56.7569 7.97721 57.7289 7.15669 57.7289 5.84615V2.11966C57.7289 0.809117 56.7569 0 55.3049 0H50.9369V7.97721ZM56.5049 5.56125C56.5049 6.66667 55.9409 6.96296 55.0169 6.96296H52.1609V1.01425H55.0169C55.9409 1.01425 56.5049 1.31054 56.5049 2.41595V5.56125Z" fill="white"/>
9
+ <path d="M66.1762 7.97721H67.5563C67.5563 7.97721 64.9043 0.433048 64.8203 0.193732C64.7723 0.0455841 64.7362 0 64.4842 0H62.6243C62.3723 0 62.3363 0.0455841 62.3003 0.193732C62.2163 0.433048 59.5643 7.97721 59.5643 7.97721H60.9443L61.7363 5.68661H65.3842L66.1762 7.97721ZM63.3083 0.968661H63.8123L65.0723 4.5698H62.0363L63.3083 0.968661Z" fill="white"/>
10
+ <path d="M75.1143 0H68.4063V0.991453H71.1543V7.97721H72.3783V0.991453H75.1143V0Z" fill="white"/>
11
+ <path d="M77.6463 7.97721H83.3823V6.90598H78.8703V4.43305H82.8903V3.39601H78.8703V1.01425H83.3943V0H77.6463V7.97721Z" fill="white"/>
12
+ <path d="M86.2408 7.97721H90.6088C92.0608 7.97721 93.0328 7.15669 93.0328 5.84615V2.11966C93.0328 0.809117 92.0608 0 90.6088 0H86.2408V7.97721ZM91.8088 5.56125C91.8088 6.66667 91.2448 6.96296 90.3208 6.96296H87.4648V1.01425H90.3208C91.2448 1.01425 91.8088 1.31054 91.8088 2.41595V5.56125Z" fill="white"/>
13
+ </svg>
@@ -0,0 +1,11 @@
1
+ <svg width="74" height="8" viewBox="0 0 74 8" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M4.05532 6.849H3.63415L1.38386 0H0C0 0 2.51502 7.45299 2.62333 7.78348C2.65943 7.92023 2.71959 8 2.85196 8H4.83751C4.95785 8 5.03005 7.92023 5.06615 7.78348C5.16242 7.45299 7.68947 0 7.68947 0H6.29358L4.05532 6.849Z" fill="white"/>
3
+ <path d="M15.567 7.97721H16.9508C16.9508 7.97721 14.2914 0.433048 14.2072 0.193732C14.159 0.0455841 14.1229 0 13.8702 0H12.005C11.7523 0 11.7162 0.0455841 11.6801 0.193732C11.5959 0.433048 8.93646 7.97721 8.93646 7.97721H10.3203L11.1145 5.68661H14.7728L15.567 7.97721ZM12.6909 0.968661H13.1964L14.4599 4.5698H11.4154L12.6909 0.968661Z" fill="white"/>
4
+ <path d="M19.4142 7.97721H25.0579V6.94017H20.6416V0H19.4142V7.97721Z" fill="white"/>
5
+ <path d="M28.6155 0H27.4001V7.97721H28.6155V0Z" fill="white"/>
6
+ <path d="M31.7862 7.97721H36.1664C37.6225 7.97721 38.5972 7.15669 38.5972 5.84615V2.11966C38.5972 0.809117 37.6225 0 36.1664 0H31.7862V7.97721ZM37.3698 5.56125C37.3698 6.66667 36.8042 6.96296 35.8776 6.96296H33.0136V1.01425H35.8776C36.8042 1.01425 37.3698 1.31054 37.3698 2.41595V5.56125Z" fill="white"/>
7
+ <path d="M47.0682 7.97721H48.4521C48.4521 7.97721 45.7927 0.433048 45.7084 0.193732C45.6603 0.0455841 45.6242 0 45.3715 0H43.5063C43.2536 0 43.2175 0.0455841 43.1814 0.193732C43.0971 0.433048 40.4377 7.97721 40.4377 7.97721H41.8216L42.6158 5.68661H46.274L47.0682 7.97721ZM44.1922 0.968661H44.6976L45.9611 4.5698H42.9166L44.1922 0.968661Z" fill="white"/>
8
+ <path d="M56.0313 0H49.3045V0.991453H52.0602V7.97721H53.2876V0.991453H56.0313V0Z" fill="white"/>
9
+ <path d="M58.5704 7.97721H64.3224V6.90598H59.7978V4.43305H63.8291V3.39601H59.7978V1.01425H64.3345V0H58.5704V7.97721Z" fill="white"/>
10
+ <path d="M67.189 7.97721H71.5692C73.0253 7.97721 74 7.15669 74 5.84615V2.11966C74 0.809117 73.0253 0 71.5692 0H67.189V7.97721ZM72.7726 5.56125C72.7726 6.66667 72.207 6.96296 71.2804 6.96296H68.4164V1.01425H71.2804C72.207 1.01425 72.7726 1.31054 72.7726 2.41595V5.56125Z" fill="white"/>
11
+ </svg>
@@ -1 +1 @@
1
- {"version":3,"file":"OffsetWellMap.d.ts","sourceRoot":"","sources":["../../../src/components/OffsetWellMap/OffsetWellMap.js"],"names":[],"mappings":";AA+BA;;;;;;;;;gBAoXC"}
1
+ {"version":3,"file":"OffsetWellMap.d.ts","sourceRoot":"","sources":["../../../src/components/OffsetWellMap/OffsetWellMap.js"],"names":[],"mappings":";AAgCA;;;;;;;;;gBAyXC"}
@@ -1 +1 @@
1
- import r from"@babel/runtime/helpers/defineProperty";import e from"@babel/runtime/helpers/slicedToArray";import{useMemo as t,useRef as n,useState as o,useEffect as c,createElement as i}from"react";import u from"react-dom";import{get as l}from"lodash";import a from"prop-types";import s from"classnames";import{Tooltip as d}from"@material-ui/core";import{Add as m,Remove as f}from"@material-ui/icons";import p from"mapbox.js";import{mapbox as v}from"../../utils/index.js";import b from"./OffsetWellMap.module.css.js";import{usePreviousWells as h}from"./effects/usePreviousWells.js";import{WellTooltip as y}from"./WellTooltip.js";import{getAllFormations as C}from"./utils.js";import{jsx as k,jsxs as B,Fragment as g}from"react/jsx-runtime";var O=v.isValidCoordinates,W=[29.749907,-95.358421],T=["_renderer","_bounds","min"],D=function(a){var v=a.isViewOnly,D=a.subjectWell,x=a.wells,N=a.offsetWellIds,j=a.radius,F=a.handleChanageOffsetWell,z=a.activeWellId,E=a.isClickable,L=t((function(){return D&&l(D,"topHole.coordinates")}),[D]),w=t((function(){return C(x)}),[x]),I=n(),Z=n(),_=n(),q=n(),M=n(null),P=o(!1),R=e(P,2),V=R[0],G=R[1],S=n(),A=n(),H=(null==D?void 0:D.id)===z,U=h(x),J=o(null),K=e(J,2),Q=K[0],X=K[1],Y=o(3),$=e(Y,2),rr=$[0],er=$[1];c((function(){I.current=p.mapbox.map(I.current,null,{attributionControl:!1,scrollWheelZoom:!1,zoomControl:!1}).setView(W,3).on("zoomend",(function(){return er(I.current.getZoom())})),I.current.doubleClickZoom.disable(),p.mapbox.styleLayer("mapbox://styles/mapbox/dark-v9").addTo(I.current)}),[]),c((function(){if(I.current){if(Z.current&&(I.current.removeLayer(Z.current),Z.current=null),_.current&&I.current.removeLayer(_.current),!L)return Z.current=null,void(_.current=null);j&&(Z.current=p.circle(L,1609.34*j,{stroke:!1,fill:!0,fillOpacity:.2,fillColor:"#03BCD4",className:"circle_500"}),Z.current.addTo(I.current))}}),[j,L]);var tr=function(r,e,t,n,o,c){c&&(r.setStyle({fillColor:"#63EFFF"}),G(!0)),M.current=p.circleMarker(e,{radius:c?5:12,stroke:!1,fill:!0,fillOpacity:.24,fillColor:c?"#63EFFF":t,className:"circle_highlight"}),M.current.addEventListener("mouseout",(function(){q.current.removeFrom(I.current),q.current=p.featureGroup(S.current),q.current.addTo(I.current),I.current.closePopup(),c&&(r.setStyle({fillColor:"#03BCD4"}),G(!1))})),M.current.addEventListener("click",(function(){v||F(n,!o)}));var i=S.current.concat(M.current);q.current.removeFrom(I.current),q.current=p.featureGroup(i),q.current.addTo(I.current)},nr=function(r,e,t,n,o){var c=document.createElement("div"),a=i(y(),{isViewOnly:v,well:r,color:l(w,r.formation,"#BDBDBD"),isOffsetWell:e,isSubjectWell:t,offset:o,isClickable:E});u.render(k(g,{children:a}),c),p.popup().setLatLng(n).setContent(c).openOn(I.current)};c((function(){if(I.current&&x&&N){I.current.closePopup(),q.current&&q.current.removeFrom(I.current);var r=[],e=[],t=[];x.forEach((function(r){r.id!==(null==D?void 0:D.id)&&(N.includes(r.id)?e.push(r):t.push(r))})),[].concat(t,e,[D]).forEach((function(e){var t,n=null==e||null===(t=e.topHole)||void 0===t?void 0:t.coordinates;if(n&&O(n)){var o=(null==D?void 0:D.id)===e.id,c=N.includes(e.id)&&!o,i=o?"#03BCD4":l(w,e.formation,"#BDBDBD"),u=c?.7:.3;if(c){var a=p.circleMarker(n,{radius:12,stroke:!1,fill:!0,fillColor:i,calssname:"circle_500",fillOpacity:.08});r.push(a)}var s=p.circleMarker(n,{radius:5,stroke:!1,fill:!0,fillOpacity:o?1:u,fillColor:i,className:"circle_500"});if(s.addEventListener("mouseover",(function(r){var t=[0,0];Q&&l(r.target,T)&&(t=[l(r.target,T).x-Q.x,l(r.target,T).y-Q.y]),nr(e,c,o,n,t),tr(s,n,i,e,c,o)})),o&&(A.current=s),r.push(s),e.id===z&&!H){var d=p.circleMarker(n,{radius:12,stroke:!1,fill:!0,fillOpacity:.24,fillColor:i,className:"circle_1200"});r.push(d)}}})),r.length&&(q.current=p.featureGroup(r),q.current.addTo(I.current)),S.current=r,setTimeout((function(){Z.current&&Z.current.bringToBack(),I.current&&Z.current&&x!==U&&I.current.fitBounds(Z.current.getBounds(),{padding:[5,5]})}),500)}}),[D,x,N,Q]),c((function(){if(V&&l(I.current,T)){var r=[l(I.current,T).x-Q.x,l(I.current,T).y-Q.y];nr(D,!1,!0,L,r)}}),[V,Q,D,L]),c((function(){if(I.current&&L){_.current&&_.current.removeFrom(I.current);var r=p.icon({iconUrl:V||H?"/static/media/5e9c4959259cb12c11b2c5eaf27eb3ad.svg":"/static/media/9efe5882f31d2f22bd57af92069d0a3e.svg",iconSize:V||H?[70,20]:[62,12],iconAnchor:V||H?[35,29]:[31,25],className:"dot"});_.current=p.marker(L,{icon:r}),_.current.addTo(I.current),A.current&&(_.current.addEventListener("mouseover",(function(){G(!0),tr(A.current,L,"#03BCD4",D,!0,!0)})),_.current.addEventListener("mouseout",(function(){q.current.removeFrom(I.current),q.current=p.featureGroup(S.current),q.current.addTo(I.current),I.current.closePopup(),A.current.setStyle({fillColor:"#03BCD4"}),G(!1)})))}}),[V,L,j,D,H,Q]),c((function(){setTimeout((function(){Z.current&&Z.current.bringToBack(),D?I.current&&Z.current&&j&&I.current.fitBounds(Z.current.getBounds(),{padding:[5,5]}):I.current&&q.current&&I.current.fitBounds(q.current.getBounds()),l(I.current,T)&&X(l(I.current,T))}),500)}),[j,D]);return k("div",{className:b.mapView,children:k("div",{className:b.mapMain,ref:I,children:B("div",{className:b.zoomGroup,children:[k(d,{title:rr<18?"Zoom in":"",placement:"left",children:k("div",{className:s(b.zoomButton,r({},b.zoomDisabled,18===rr)),onClick:function(){I.current.setZoom(rr+1)},children:k(m,{className:b.zoomInOutIcon})})}),k(d,{title:rr>1?"Zoom out":"",placement:"left",children:k("div",{className:s(b.zoomButton,r({},b.zoomDisabled,1===rr)),onClick:function(){rr>1&&I.current.setZoom(rr-1)},children:k(f,{className:b.zoomInOutIcon})})})]})})})};D.propTypes={isViewOnly:a.bool.isRequired,subjectWell:a.shape({id:a.number,formation:a.string}),wells:a.arrayOf(a.shape({})).isRequired,offsetWellIds:a.arrayOf(a.number).isRequired,radius:a.number.isRequired,handleChanageOffsetWell:a.func.isRequired,activeWellId:a.number.isRequired,isClickable:a.bool},D.defaultProps={subjectWell:null,isClickable:!0};export{D as default};
1
+ import r from"@babel/runtime/helpers/defineProperty";import e from"@babel/runtime/helpers/slicedToArray";import{useMemo as t,useRef as n,useState as o,useEffect as c,createElement as i}from"react";import u from"react-dom";import{get as l}from"lodash";import a from"prop-types";import s from"classnames";import{Tooltip as d}from"@material-ui/core";import{Add as m,Remove as f}from"@material-ui/icons";import p from"mapbox.js";import{mapbox as v}from"../../utils/index.js";import b from"./OffsetWellMap.module.css.js";import{usePreviousWells as h}from"./effects/usePreviousWells.js";import{WellTooltip as y}from"./WellTooltip.js";import{getAllFormations as C}from"./utils.js";import{jsx as k,jsxs as B,Fragment as g}from"react/jsx-runtime";var O=v.isValidCoordinates,W=[29.749907,-95.358421],T=["_renderer","_bounds","min"],D=function(a){var v=a.isViewOnly,D=a.subjectWell,x=a.wells,N=a.offsetWellIds,j=a.radius,F=a.handleChanageOffsetWell,z=a.activeWellId,E=a.isClickable,L=t((function(){return D&&l(D,"topHole.coordinates")}),[D]),w=t((function(){return C(x)}),[x]),I=n(),Z=n(),_=n(),q=n(),M=n(null),P=o(!1),R=e(P,2),V=R[0],G=R[1],S=n(),A=n(),H=(null==D?void 0:D.id)===z,U=h(x),J=o(null),K=e(J,2),Q=K[0],X=K[1],Y=o(3),$=e(Y,2),rr=$[0],er=$[1];c((function(){I.current=p.mapbox.map(I.current,null,{attributionControl:!1,scrollWheelZoom:!1,zoomControl:!1}).setView(W,3).on("zoomend",(function(){return er(I.current.getZoom())})),I.current.doubleClickZoom.disable(),p.mapbox.styleLayer("mapbox://styles/mapbox/dark-v9").addTo(I.current)}),[]),c((function(){if(I.current){if(Z.current&&(I.current.removeLayer(Z.current),Z.current=null),_.current&&I.current.removeLayer(_.current),!L)return Z.current=null,void(_.current=null);j&&(Z.current=p.circle(L,1609.34*j,{stroke:!1,fill:!0,fillOpacity:.2,fillColor:"#03BCD4",className:"circle_500"}),Z.current.addTo(I.current))}}),[j,L]);var tr=function(r,e,t,n,o,c){c&&(r.setStyle({fillColor:"#63EFFF"}),G(!0)),M.current=p.circleMarker(e,{radius:c?5:12,stroke:!1,fill:!0,fillOpacity:.24,fillColor:c?"#63EFFF":t,className:"circle_highlight"}),M.current.addEventListener("mouseout",(function(){q.current.removeFrom(I.current),q.current=p.featureGroup(S.current),q.current.addTo(I.current),I.current.closePopup(),c&&(r.setStyle({fillColor:"#03BCD4"}),G(!1))})),M.current.addEventListener("click",(function(){v||F(n,!o)}));var i=S.current.concat(M.current);q.current.removeFrom(I.current),q.current=p.featureGroup(i),q.current.addTo(I.current)},nr=function(r,e,t,n,o){var c=document.createElement("div"),a=i(y(),{isViewOnly:v,well:r,color:l(w,r.formation,"#BDBDBD"),isOffsetWell:e,isSubjectWell:t,offset:o,isClickable:E});u.render(k(g,{children:a}),c),p.popup().setLatLng(n).setContent(c).openOn(I.current)};c((function(){if(I.current&&x&&N){I.current.closePopup(),q.current&&q.current.removeFrom(I.current);var r=[],e=[],t=[];x.forEach((function(r){r.id!==(null==D?void 0:D.id)&&(N.includes(r.id)?e.push(r):t.push(r))})),[].concat(t,e,[D]).forEach((function(e){var t,n=null==e||null===(t=e.topHole)||void 0===t?void 0:t.coordinates;if(n&&O(n)){var o=(null==D?void 0:D.id)===e.id,c=N.includes(e.id)&&!o,i=o?"#03BCD4":l(w,e.formation,"#BDBDBD"),u=c?.7:.3;if(c){var a=p.circleMarker(n,{radius:12,stroke:!1,fill:!0,fillColor:i,calssname:"circle_500",fillOpacity:.08});r.push(a)}var s=p.circleMarker(n,{radius:5,stroke:!1,fill:!0,fillOpacity:o?1:u,fillColor:i,className:"circle_500"});if(s.addEventListener("mouseover",(function(r){var t=[0,0];Q&&l(r.target,T)&&(t=[l(r.target,T).x-Q.x,l(r.target,T).y-Q.y]),nr(e,c,o,n,t),tr(s,n,i,e,c,o)})),o&&(A.current=s),r.push(s),e.id===z&&!H){var d=p.circleMarker(n,{radius:12,stroke:!1,fill:!0,fillOpacity:.24,fillColor:i,className:"circle_1200"});r.push(d)}}})),r.length&&(q.current=p.featureGroup(r),q.current.addTo(I.current)),S.current=r,setTimeout((function(){Z.current&&Z.current.bringToBack(),j<3e3&&I.current&&Z.current&&x!==U&&I.current.fitBounds(Z.current.getBounds(),{padding:[5,5]})}),500)}}),[D,x,N,Q]),c((function(){if(V&&l(I.current,T)){var r=[l(I.current,T).x-Q.x,l(I.current,T).y-Q.y];nr(D,!1,!0,L,r)}}),[V,Q,D,L]),c((function(){if(I.current&&L){_.current&&_.current.removeFrom(I.current);var r=p.icon({iconUrl:V||H?"/static/media/5e9c4959259cb12c11b2c5eaf27eb3ad.svg":"/static/media/9efe5882f31d2f22bd57af92069d0a3e.svg",iconSize:V||H?[70,20]:[62,12],iconAnchor:V||H?[35,29]:[31,25],className:"dot"});_.current=p.marker(L,{icon:r}),_.current.addTo(I.current),A.current&&(_.current.addEventListener("mouseover",(function(){G(!0),tr(A.current,L,"#03BCD4",D,!0,!0)})),_.current.addEventListener("mouseout",(function(){q.current.removeFrom(I.current),q.current=p.featureGroup(S.current),q.current.addTo(I.current),I.current.closePopup(),A.current.setStyle({fillColor:"#03BCD4"}),G(!1)})))}}),[V,L,j,D,H,Q]),c((function(){j>3e3?I.current.setZoom(1):setTimeout((function(){Z.current&&Z.current.bringToBack(),D?I.current&&Z.current&&j&&I.current.fitBounds(Z.current.getBounds(),{padding:[5,5]}):I.current&&q.current&&I.current.fitBounds(q.current.getBounds()),l(I.current,T)&&X(l(I.current,T))}),500)}),[j,D]);return k("div",{className:b.mapView,children:k("div",{className:b.mapMain,ref:I,children:B("div",{className:b.zoomGroup,children:[k(d,{title:rr<18?"Zoom in":"",placement:"left",children:k("div",{className:s(b.zoomButton,r({},b.zoomDisabled,18===rr)),onClick:function(){I.current.setZoom(rr+1)},children:k(m,{className:b.zoomInOutIcon})})}),k(d,{title:rr>1?"Zoom out":"",placement:"left",children:k("div",{className:s(b.zoomButton,r({},b.zoomDisabled,1===rr)),onClick:function(){rr>1&&I.current.setZoom(rr-1)},children:k(f,{className:b.zoomInOutIcon})})})]})})})};D.propTypes={isViewOnly:a.bool.isRequired,subjectWell:a.shape({id:a.number,formation:a.string}),wells:a.arrayOf(a.shape({})).isRequired,offsetWellIds:a.arrayOf(a.number).isRequired,radius:a.number.isRequired,handleChanageOffsetWell:a.func.isRequired,activeWellId:a.number.isRequired,isClickable:a.bool},D.defaultProps={subjectWell:null,isClickable:!0};export{D as default};
@@ -1 +1 @@
1
- {"version":3,"file":"OffsetWellPickerV4.d.ts","sourceRoot":"","sources":["../../../src/components/OffsetWellPickerV4/OffsetWellPickerV4.js"],"names":[],"mappings":";AA+CA;;;;;;;;;;;;gBA0kBC"}
1
+ {"version":3,"file":"OffsetWellPickerV4.d.ts","sourceRoot":"","sources":["../../../src/components/OffsetWellPickerV4/OffsetWellPickerV4.js"],"names":[],"mappings":";AA+CA;;;;;;;;;;;;gBAqlBC"}
@@ -1 +1 @@
1
- import e from"@babel/runtime/helpers/toConsumableArray";import t from"@babel/runtime/helpers/defineProperty";import i from"@babel/runtime/helpers/slicedToArray";import{useState as o,useRef as r,useMemo as n,useEffect as s,useCallback as l}from"react";import a from"prop-types";import p from"classnames";import{uniqBy as m,sortBy as c,isEmpty as d}from"lodash";import{Replay as u,InfoOutlined as f}from"@material-ui/icons";import j from"../Modal/Modal.js";import"../IconMenu/index.js";import"../StyledMenuItem/index.js";import"../ImagesGrid/index.js";import"../DevCenter/AppHeader/AppHeader.js";import"../DevCenter/AppSideBar/AppSideBar.js";import"../DevCenter/AppsDataProvider/AppsDataProvider.js";import"../DevCenter/DevCenterAppContainer/DevCenterAppContainer.js";import"../DevCenter/NavigationBar/NavigationBar.js";import"../DevCenter/SideBar/SideBar.js";import"../DevCenter/AppSettingsPopover/AppSettingsPopover.js";import"../DevCenter/AppFilterPanelLayout/AppFilterPanelLayout.js";import"../DevCenter/DevCenterRouterContext/DevCenterRouterContext.js";import"../DevCenter/DevCenterRouterContext/UniversalLink/UniversalLink.js";import"@babel/runtime/helpers/objectWithoutProperties";import"react-router";import{jsx as C,jsxs as b,Fragment as v}from"react/jsx-runtime";import"../DevCenter/IsolatedDevCenterAppContainer/DevCenterIsolatedAppPage.js";import"../DevCenter/IsolatedDevCenterAppContainer/DevCenterIsolatedApp.js";import"../DevCenter/AppContext.js";import"../AssetEditor/index.js";import"../AppVersionsSelect/AppVersionsSelect.js";import h from"../LoadingIndicator/LoadingIndicator.js";import{Regular14 as g,Regular12 as A}from"../Typography.js";import"../CollapsableSidebar.js";import"../DateTimePicker/index.js";import"../DatePicker/index.js";import"../ErrorBoundary/ErrorBoundary.js";import"../ErrorBoundary/DevCenterAppErrorView/DevCenterAppErrorView.js";import"../Annotations/components/AnnotationsList/index.js";import"../Annotations/components/LastAnnotation/index.js";import"../Annotations/AnnotationsContext.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"../Chart/components/ChartButton.js";import"../Chart/components/ChartButtons.js";import"../Chart/components/ChartWrapper.js";import"../Chart/components/AxisDropdown.js";import"../Chart/components/buttons/DragToZoomButton.js";import"../Chart/components/buttons/ZoomInButton.js";import"../Chart/components/buttons/ZoomOutButton.js";import"../Chart/components/buttons/PanButton.js";import"../Chart/components/buttons/ResetZoomButton.js";import"../Chart/components/buttons/HideAxesButton.js";import"../ColorPicker/PaletteChromePicker/PaletteChromePicker.js";import"../TruncatedText/index.js";import"../RangeSlider/RangeSlider.js";import"../AdvancedSlider/AdvancedSlider.js";import"../DevCenter/DevCenterAppContainer/components/AppSettingsDialog/AppSettingsDialog.js";import"../Breadcrumbs/index.js";import"../VirtualizedTable/index.js";import"../EmptyView/EmptyView.js";import"../EmptyView/EmptyAppView/EmptyAppView.js";import S 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"@babel/runtime/helpers/asyncToGenerator";import"@babel/runtime/regenerator";import"../../clients/jsonApi/index.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"../BICOffsetPickerDialog/index.js";import"../OffsetWellButton/OffsetWellButton.js";import"../OffsetWellPickerV2/OffsetWellPickerDialog.js";import"../OffsetWellPickerV3/index.js";import"../OffsetWellChips/Chip.js";import"../OffsetWellChips/ChipsContainer.js";import"../OffsetWellMap/OffsetWellMap.js";import"../Notifications/Notifications.js";import"uuid";import"../Toaster/Toaster.js";import"../ConfirmationDialog.js";import"../TextLink/index.js";import"../Avatar/index.js";import"../Template/TemplatePopover/index.js";import"../Template/TemplateSharingDialog/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"@material-ui/core";import"../Table/TableToolbar/TableToolbar.js";import"../Table/TableContainer/TableContainer.js";import"../Table/TableCell/TableCell.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"../HelpCenter/HelpCenterIcon.js";import"../Autocomplete/Autocomplete.js";import"../DocumentViewer/DocumentViewer.js";import"../DevCenter/DevCenterAppContainer/components/AppActions/AppActions.css.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"../DevCenter/DevCenterAppContainer/components/DevCenterAppView/DevCenterAppView.js";import"../DevCenter/DevCenterAppContainer/components/DcFullscreenElemsCoordinatorProvider/DcFullscreenElemsCoordinatorProvider.js";import"../DevCenter/DevCenterAppContainer/components/DcFullscreenElemsCoordinatorProvider/IsInsideDcFullscreenElemProvider.js";import"../DevCenter/DevCenterAppContainer/components/IsInsideDcAppProvider/IsInsideDcAppProvider.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"../StatusBadge/index.js";import"../Attachment/index.js";import"../EmojiIconButton.js";import"../FileUploadIconButton.js";import"../FilePreview/index.js";import"../FailedFileUploading.js";import"../UserMention/index.js";import"../CommentsInfo/index.js";import"../CommentInput/index.js";import"../Comment/index.js";import"../CommentLoader.js";import"../../utils/index.js";import y from"../../styles/typography/index.js";import"../../styles/counter/counter.module.scss.js";import{isMobileDetected as x,isNativeDetected as I}from"../../utils/mobileDetect.js";import{useFetchWells as W}from"./effects/useFetchWells.js";import{useAdvancedWells as T}from"./effects/useAdvancedWells.js";import{useBicWells as P}from"./effects/useBicWells.js";import{useCompanyMetricKey as O}from"./effects/useCompanyMetricKey.js";import{useFilterOptions as w}from"./effects/useFilterOptions.js";import{useFilteredWells as E}from"./effects/useFilteredWells.js";import{useSortedWells as B}from"./effects/useSortedWells.js";import{useRadiusWells as M}from"./effects/useRadiusWells.js";import"./effects/useAssetsData.js";import{useTableColumns as F}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 V}from"./components/Filter/Filter.js";import{WellsMap as k}from"./components/Map/WellsMap.js";import N from"./components/OffsetWellsTable/OffsetWellsTable.js";import R from"./OffsetWellPickerV4.module.css.js";import{ALL_SECTION_KEY as U,ViewType as z,ColumnType as _,FilterType as K,ROWS_PER_PAGE as G,LEAVE_TOUCH_DELAY as q,IOS_DEVICE as Z,DEFAULT_BIC_OFFSET_SIZE as J,DEFAULT_LOCAL_OFFSET_SIZE as Q,MAX_OFFSET_SIZE as X,SMALL_SCREEN_WIDTH as Y,SMALL_SCREEN_HEIGHT as $}from"./constants.js";import{SEARCH_CATEGORIES as ee}from"./components/OffsetWellsTable/AdvancedSearch/constants.js";import{getMobileOperatingSystem as te}from"./utils/index.js";import{showInfoNotification as ie}from"../../utils/notificationToasts.js";function oe(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,o)}return i}function re(e){for(var i=1;i<arguments.length;i++){var o=null!=arguments[i]?arguments[i]:{};i%2?oe(Object(o),!0).forEach((function(i){t(e,i,o[i])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):oe(Object(o)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(o,t))}))}return e}var ne="OffsetWellPickerV4",se=function(a){var J,Q,oe,se=a.open,le=a.isWDUser,ae=a.defaultSubjectWell,pe=a.currentUser,me=a.offsetSettings,ce=a.addWellsUsabilityInfo,de=a.isViewOnly,ue=a.onClose,fe=a.onSave,je=a.maxOffsetSize,Ce=a.localMaxOffsetSize,be=o(null),ve=i(be,2),he=ve[0],ge=ve[1],Ae=Math.min(je+1,Ce+1,X+1),Se=Math.min(Math.max(Ae,Ce+1),X+1),De=o(null==me?void 0:me.filterExpanded),ye=i(De,2),xe=ye[0],Ie=ye[1],We=o(null==me?void 0:me.mapHidden),Te=i(We,2),Pe=Te[0],Oe=Te[1],we=+(null==ae?void 0:ae.companyId)||+(null==pe?void 0:pe.company_id),Ee=null==ae?void 0:ae.asset_id,Be=o((null==me?void 0:me.filters)||{}),Me=i(Be,2),Fe=Me[0],He=Me[1],Le=o((null==me?void 0:me.wellSection)||U),Ve=i(Le,2),ke=Ve[0],Ne=Ve[1],Re=r(!0),Ue=o([]),ze=i(Ue,2),_e=ze[0],Ke=ze[1],Ge=o(null),qe=i(Ge,2),Ze=qe[0],Je=qe[1],Qe=o(!0),Xe=i(Qe,2),Ye=Xe[0],$e=Xe[1],et=o(!1),tt=i(et,2),it=tt[0],ot=tt[1],rt=o(!1),nt=i(rt,2),st=nt[0],lt=nt[1],at=r(),pt=o(z.none),mt=i(pt,2),ct=mt[0],dt=mt[1],ut=r(),ft=o(!1),jt=i(ft,2),Ct=jt[0],bt=jt[1],vt=n((function(){return Se<=_e.length}),[_e,Se]),ht=n((function(){return ct===z.small?0:ct===z.mobile?52:48}),[ct]);s((function(){se&&vt&&ie("App can’t process more than (".concat(Se-1,") Offset Wells."))}),[vt,se,me]),s((function(){function e(){window.innerWidth<=Y||x||I?dt(z.mobile):window.innerHeight<=$?dt(z.small):dt(z.normal)}return e(),window.addEventListener("resize",e),function(){window.removeEventListener("resize",e)}}),[se]),s((function(){ut.current&&ct===ut.current||(ut.current=ct,ct===z.small||ct===z.mobile?(Oe(!0),Ie(!1)):(Ie(!de&&(null==me?void 0:me.filterExpanded)),Oe(!de&&(null==me?void 0:me.mapHidden))),He((null==me?void 0:me.filters)||{}),Ne((null==me?void 0:me.wellSection)||U))}),[me,de,ct]);var gt=W(we,ce),At=P(le,Ee,gt),St=i(At,2),Dt=St[0],yt=St[1],xt=O(we,null==me?void 0:me.metricsKeys),It=i(xt,2),Wt=It[0],Tt=It[1],Pt=T(we,gt,Dt,yt,Ee),Ot=w(Pt);s((function(){if(Pt&&Dt){var e=Pt.find((function(e){return e.id===Ee}));if(e){var i=Dt.filter((function(e){return e.value!==U})).map((function(e){return e.label})),o=re(re({},e),i.length>0&&t({},_.wellSection,i));Je(o)}else Je(null)}}),[Dt,Pt]);var wt=F(Wt),Et=E(Pt,Fe);s((function(){if(Et)if(Re.current){var e=Pt.filter((function(e){return((null==me?void 0:me.selectedWellIds)||[]).includes(e.id)}));Ze&&(e=e.concat(Ze)),Ke(m(e,"id")),Re.current=!1}else Ke((function(e){var t=(Et||[]).filter((function(t){return!!e.find((function(e){var i=e.id;return t.id===i}))}));return Ze&&(t=t.concat(Ze)),m(t,"id")}))}),[Pt,Et,null==me?void 0:me.selectedWellIds]);var Bt=B(Ze,Et,_e,$e,Re.current),Mt=i(Bt,5),Ft=Mt[0],Ht=Mt[1],Lt=Mt[2],Vt=Mt[3],kt=Mt[4];M(Fe[K.radius],Et,Ke,Se);var Nt=l((function(e,t,i){var o;o=i===ee.well.name?t:t.reduce((function(e,t){var i,o=null===(i=Pt.find((function(e){return e.id===t})))||void 0===i?void 0:i.rigName,r=Pt.filter((function(e){return e.rigName===o})).map((function(e){return e.id}));return e.concat(r)}),[]);var r=Pt.filter((function(e){var t=e.id;return o.includes(t)}));e?(r=r.slice(0,Math.min(r.length,Se-_e.length)),Ke((function(e){return m(e.concat(r),"id")}))):Ke((function(e){return m(e.filter((function(e){var t=e.id;return!r.find((function(e){return e.id===t}))})))}))}),[Pt,_e]),Rt=l((function(){lt(!0)}),[]),Ut=l((function(e){Tt(e)}),[]),zt=l((function(t,i){Ke(i?function(i){return[].concat(e(i),[t])}:function(e){return e.filter((function(e){return e.id!==t.id}))})}),[]),_t=l((function(e){if(e){var t=Ze?Et.concat(Ze):Et,i=c(m(t,"id"),"distance");Ke(i.slice(0,Se))}else Ke(Ze?[Ze]:[])}),[Et,Ze,Se]),Kt=function(e){if(d(yt))Ke(Ze?[Ze]:[]);else{var t=Pt.filter((function(t){return yt[e].includes(t.id)})),i=c(t,"distance");Ke(i.slice(0,Ae))}},Gt=l((function(e){Ne(e),Kt(e)}),[Kt]),qt=n((function(){return _e.find((function(e){return e.id===Ee}))?_e.length-1:_e.length}),[_e,Ee]),Zt=n((function(){if(!yt)return!1;var e=_e.map((function(e){return e.id})),t=yt[ke]||[];return Math.min(t.length,Ae)===e.length&&e.every((function(e){return t.includes(e)}))}),[yt,_e,ke,Ae]),Jt=function(){var e=(Pt||[]).filter((function(e){return((null==me?void 0:me.selectedWellIds)||[]).includes(e.id)}));Ze&&(e=e.concat(Ze)),Ke(m(e,"id"));var t=re(re({},me),{},{mapHidden:Pe,filterExpanded:xe});fe(t),He((null==me?void 0:me.filters)||{}),Ne((null==me?void 0:me.wellSection)||U),ue()},Qt=n((function(){return!Zt||(!(d(Fe)||!Fe[K.sideTracks])||ke!==U)}),[Zt,Fe,ke]),Xt=!Pt||!Dt||!kt||ct===z.none,Yt=o(!1),$t=i(Yt,2),ei=$t[0],ti=$t[1],ii=o(G),oi=i(ii,2),ri=oi[0],ni=oi[1],si=o([]),li=i(si,2),ai=li[0],pi=li[1];s((function(){if(kt){var e=kt.slice(0,ri);pi(e)}}),[kt,ri,Ze]);return C(j,{open:se,onClose:Jt,title:C(H,{isWDUser:le,viewType:ct,totalCount:null!==(J=null==Pt?void 0:Pt.length)&&void 0!==J?J:0,selectedCount:qt,isViewOnly:de,maxOffsetwellNumber:Se}),isMobile:ct===z.mobile,contentContainerClassName:p(R.offsetWellDialog,t({},R.offsetWellDialogMobile,ct===z.mobile)),contentClassName:p(R.contentContainer,(Q={},t(Q,R.smallContainer,ct===z.small),t(Q,R.contentContainerMobile,ct===z.mobile),Q)),actionsClassName:p(R.modalActions,t({},R.modalActionsMobile,ct===z.mobile)),actions:!de&&b("div",{className:R.actionsWrapper,children:[!Xt&&Qt?C(D,{placement:"bottom-start",title:"Reset to Synced Offsets in ".concat(le?"Offset App":"Wellhub"),children:C("div",{children:C(S,{"data-testid":"".concat(ne,"_reset"),onClick:function(){He({}),Ne(U),Kt(U)},color:"primary",startIcon:ct!==z.mobile&&C(u,{}),classes:ct===z.mobile&&{root:R.resetButtonMobile},children:ct!==z.mobile?"Reset":C(u,{})})})}):C("div",{className:ct===z.mobile&&R.infoIconContainer,children:ct!==z.mobile?b(v,{children:[C("span",{className:p(y.regular12,y.colors.t6),children:"The offset list is being automatically populated by "}),C("span",{className:p(y.medium12,y.colors.t6),children:le?"Offset Selection App.":"WellHub."})]}):C(D,{title:b("div",{children:[C("span",{className:p(y.regular12,y.colors.t1),children:"The offset list is being automatically populated by "}),C("span",{className:p(y.medium12,y.colors.t1),children:le?"Offset Selection App.":"WellHub."})]}),enterTouchDelay:0,leaveTouchDelay:q,children:C(f,{className:R.infoIcon})})}),b("div",{className:R.buttonGap,children:[C(S,{"data-testid":"".concat(ne,"_cancel"),onClick:Jt,color:"primary",children:"Cancel"}),b(S,{"data-testid":"".concat(ne,"_selectedWells"),variant:"contained",color:"primary",onClick:function(){ue();var e=re(re({},me),{},{companyId:we,subjectWellId:Ee,selectedWellIds:_e.map((function(e){return e.id})),filters:Fe,metricsKeys:Wt,wellSection:ke,isSynced:Zt,mapHidden:Pe,filterExpanded:xe,offsetWellsLimited:vt});fe(e,_e)},children:["Select (",qt,")"]})]})]}),children:Xt?C(h,{fullscreen:!1}):b("div",{className:p(R.contentWrapper),ref:at,children:[ct===z.mobile&&b("div",{className:p(R.countContainer,t({},R.countContainerMobile,ct===z.mobile)),children:[C(g,{className:R.totalLabel,children:"Total:"}),C(g,{"data-testid":"".concat(ne,"_totalWells"),className:R.countValue,children:Pt.length}),C(g,{className:R.selectedLabel,children:"Selected:"}),C(g,{"data-testid":"".concat(ne,"_selected"),className:R.countValue,children:qt}),C(D,{title:"App can’t process more than (".concat(Se-1,") Offset Wells."),placement:"right",children:b(A,{"data-testid":"".concat(ne,"_maxOffsetSize"),className:R.maxOffsetSize,children:["/",Se-1]})})]}),ct===z.normal&&C(L,{isViewOnly:de,viewType:ct,filters:Fe,setFilters:He,isFilterExpanded:xe,setIsFilterExpanded:Ie,isMapHidden:Pe,setIsMapHidden:Oe}),Ct&&C("div",{className:R.topGradient,style:{top:ht}}),b("div",{className:p(R.content,(oe={},t(oe,R.contentMobile,ct===z.mobile),t(oe,R.contentiOSMobile,te()===Z),oe)),onScroll:function(e){return function(e){e.target&&(st&&(e.target.scrollLeft=0,lt(!1)),e.target.scrollLeft<=5&&ei&&ti(!1),e.target.scrollLeft>5&&!ei&&ti(!0),e.target.scrollTop<=5&&Ct&&bt(!1),e.target.scrollTop>5&&!Ct&&bt(!0),e.target.scrollHeight!==e.target.offsetHeight&&Math.round(e.target.scrollTop+e.target.offsetHeight+2)>=e.target.scrollHeight&&ri<kt.length&&ni((function(e){return e+G})))}(e)},children:[ct!==z.normal&&C(L,{isViewOnly:de,viewType:ct,filters:Fe,setFilters:He,isFilterExpanded:xe,setIsFilterExpanded:Ie,isMapHidden:Pe,setIsMapHidden:Oe}),!Pe&&se&&C(k,{isViewOnly:de,mapHidden:Pe,companyId:we,subjectWell:Ze,offsetWellIds:_e.map((function(e){return e.id})),wells:Pt,radius:Fe[K.radius],handleChanageOffsetWell:zt,activeWellId:he,viewType:ct}),C(V,{isHidden:!xe,isWDUser:le,filterOptions:Ot,filters:Fe,wellSections:Dt,selectedWellSection:ke,subjectWell:Ze,onChangeFilters:function(e){$e(!0),setTimeout((function(){return He(e)}),0)},onChangeBicWells:Gt}),C(N,{open:se,isTableLoading:Ye,companyId:we,subjectWellId:Ee,sortBy:Ft,setSortBy:Ht,sortDirection:Lt,setSortDirection:Vt,columnsWithDict:wt,wells:ai,metricsKeys:Wt,setMetricsKeys:Ut,handleChanageOffsetWell:zt,handleChangeAllOffsetWells:_t,handleAddRemoveAssets:Nt,isWellNameExpand:it,setIsWellNameExpand:ot,isHscrollMoved:ei,onHideAdvancedSearch:Rt,isViewOnly:de,isLastWell:kt.length<=ri,contentRef:at,isLimitedOffsetwells:vt,maxOffsetwellNumber:Se,wellSections:Dt,setActiveWellId:ge,viewType:ct})]})]})})};se.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,localMaxOffsetSize:a.number},se.defaultProps={isWDUser:!1,defaultSubjectWell:null,offsetSettings:{},addWellsUsabilityInfo:void 0,isViewOnly:!1,maxOffsetSize:J,localMaxOffsetSize:Q};export{se as default};
1
+ import e from"@babel/runtime/helpers/toConsumableArray";import t from"@babel/runtime/helpers/defineProperty";import i from"@babel/runtime/helpers/slicedToArray";import{useState as o,useRef as r,useMemo as n,useEffect as s,useCallback as l}from"react";import a from"prop-types";import p from"classnames";import{uniqBy as m,sortBy as c,isEmpty as d}from"lodash";import{Replay as u,InfoOutlined as f}from"@material-ui/icons";import j from"../Modal/Modal.js";import"../IconMenu/index.js";import"../StyledMenuItem/index.js";import"../ImagesGrid/index.js";import"../DevCenter/AppHeader/AppHeader.js";import"../DevCenter/AppSideBar/AppSideBar.js";import"../DevCenter/AppsDataProvider/AppsDataProvider.js";import"../DevCenter/DevCenterAppContainer/DevCenterAppContainer.js";import"../DevCenter/NavigationBar/NavigationBar.js";import"../DevCenter/SideBar/SideBar.js";import"../DevCenter/AppSettingsPopover/AppSettingsPopover.js";import"../DevCenter/AppFilterPanelLayout/AppFilterPanelLayout.js";import"../DevCenter/DevCenterRouterContext/DevCenterRouterContext.js";import"../DevCenter/DevCenterRouterContext/UniversalLink/UniversalLink.js";import"@babel/runtime/helpers/objectWithoutProperties";import"react-router";import{jsx as C,jsxs as b,Fragment as v}from"react/jsx-runtime";import"../DevCenter/IsolatedDevCenterAppContainer/DevCenterIsolatedAppPage.js";import"../DevCenter/IsolatedDevCenterAppContainer/DevCenterIsolatedApp.js";import"../DevCenter/AppContext.js";import"../AssetEditor/index.js";import"../AppVersionsSelect/AppVersionsSelect.js";import h from"../LoadingIndicator/LoadingIndicator.js";import{Regular14 as g,Regular12 as A}from"../Typography.js";import"../CollapsableSidebar.js";import"../DateTimePicker/index.js";import"../DatePicker/index.js";import"../ErrorBoundary/ErrorBoundary.js";import"../ErrorBoundary/DevCenterAppErrorView/DevCenterAppErrorView.js";import"../Annotations/components/AnnotationsList/index.js";import"../Annotations/components/LastAnnotation/index.js";import"../Annotations/AnnotationsContext.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"../Chart/components/ChartButton.js";import"../Chart/components/ChartButtons.js";import"../Chart/components/ChartWrapper.js";import"../Chart/components/AxisDropdown.js";import"../Chart/components/buttons/DragToZoomButton.js";import"../Chart/components/buttons/ZoomInButton.js";import"../Chart/components/buttons/ZoomOutButton.js";import"../Chart/components/buttons/PanButton.js";import"../Chart/components/buttons/ResetZoomButton.js";import"../Chart/components/buttons/HideAxesButton.js";import"../ColorPicker/PaletteChromePicker/PaletteChromePicker.js";import"../TruncatedText/index.js";import"../RangeSlider/RangeSlider.js";import"../AdvancedSlider/AdvancedSlider.js";import"../DevCenter/DevCenterAppContainer/components/AppSettingsDialog/AppSettingsDialog.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"@babel/runtime/helpers/asyncToGenerator";import"@babel/runtime/regenerator";import"../../clients/jsonApi/index.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"../BICOffsetPickerDialog/index.js";import"../OffsetWellButton/OffsetWellButton.js";import"../OffsetWellPickerV2/OffsetWellPickerDialog.js";import"../OffsetWellPickerV3/index.js";import"../OffsetWellChips/Chip.js";import"../OffsetWellChips/ChipsContainer.js";import"../OffsetWellMap/OffsetWellMap.js";import"../Notifications/Notifications.js";import"uuid";import"../Toaster/Toaster.js";import"../ConfirmationDialog.js";import"../TextLink/index.js";import"../Avatar/index.js";import"../Template/TemplatePopover/index.js";import"../Template/TemplateSharingDialog/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"@material-ui/core";import"../Table/TableToolbar/TableToolbar.js";import"../Table/TableContainer/TableContainer.js";import"../Table/TableCell/TableCell.js";import{Tooltip as S}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"../HelpCenter/HelpCenterIcon.js";import"../Autocomplete/Autocomplete.js";import"../DocumentViewer/DocumentViewer.js";import"../DevCenter/DevCenterAppContainer/components/AppActions/AppActions.css.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"../DevCenter/DevCenterAppContainer/components/DevCenterAppView/DevCenterAppView.js";import"../DevCenter/DevCenterAppContainer/components/DcFullscreenElemsCoordinatorProvider/DcFullscreenElemsCoordinatorProvider.js";import"../DevCenter/DevCenterAppContainer/components/DcFullscreenElemsCoordinatorProvider/IsInsideDcFullscreenElemProvider.js";import"../DevCenter/DevCenterAppContainer/components/IsInsideDcAppProvider/IsInsideDcAppProvider.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"../StatusBadge/index.js";import"../Attachment/index.js";import"../EmojiIconButton.js";import"../FileUploadIconButton.js";import"../FilePreview/index.js";import"../FailedFileUploading.js";import"../UserMention/index.js";import"../CommentsInfo/index.js";import"../CommentInput/index.js";import"../Comment/index.js";import"../CommentLoader.js";import"../../utils/index.js";import D from"../../styles/typography/index.js";import"../../styles/counter/counter.module.scss.js";import{isMobileDetected as x,isNativeDetected as I}from"../../utils/mobileDetect.js";import{useFetchWells as W}from"./effects/useFetchWells.js";import{useAdvancedWells as T}from"./effects/useAdvancedWells.js";import{useBicWells as O}from"./effects/useBicWells.js";import{useCompanyMetricKey as P}from"./effects/useCompanyMetricKey.js";import{useFilterOptions as w}from"./effects/useFilterOptions.js";import{useFilteredWells as E}from"./effects/useFilteredWells.js";import{useSortedWells as B}from"./effects/useSortedWells.js";import{useRadiusWells as M}from"./effects/useRadiusWells.js";import"./effects/useAssetsData.js";import{useTableColumns as F}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 N}from"./components/Filter/Filter.js";import{WellsMap as V}from"./components/Map/WellsMap.js";import k from"./components/OffsetWellsTable/OffsetWellsTable.js";import R from"./OffsetWellPickerV4.module.css.js";import{ALL_SECTION_KEY as U,ViewType as z,ColumnType as _,FilterType as K,ROWS_PER_PAGE as G,LEAVE_TOUCH_DELAY as q,IOS_DEVICE as Z,DEFAULT_BIC_OFFSET_SIZE as J,DEFAULT_LOCAL_OFFSET_SIZE as Q,MAX_OFFSET_SIZE as X,SMALL_SCREEN_WIDTH as Y,SMALL_SCREEN_HEIGHT as $}from"./constants.js";import{SEARCH_CATEGORIES as ee}from"./components/OffsetWellsTable/AdvancedSearch/constants.js";import{getMobileOperatingSystem as te}from"./utils/index.js";import{showInfoNotification as ie}from"../../utils/notificationToasts.js";function oe(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,o)}return i}function re(e){for(var i=1;i<arguments.length;i++){var o=null!=arguments[i]?arguments[i]:{};i%2?oe(Object(o),!0).forEach((function(i){t(e,i,o[i])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):oe(Object(o)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(o,t))}))}return e}var ne="OffsetWellPickerV4",se=function(a){var J,Q,oe,se=a.open,le=a.isWDUser,ae=a.defaultSubjectWell,pe=a.currentUser,me=a.offsetSettings,ce=a.addWellsUsabilityInfo,de=a.isViewOnly,ue=a.onClose,fe=a.onSave,je=a.maxOffsetSize,Ce=a.localMaxOffsetSize,be=o(null),ve=i(be,2),he=ve[0],ge=ve[1],Ae=Math.min(je+1,Ce+1,X+1),ye=Math.min(Math.max(Ae,Ce+1),X+1),Se=o(null==me?void 0:me.filterExpanded),De=i(Se,2),xe=De[0],Ie=De[1],We=o(null==me?void 0:me.mapHidden),Te=i(We,2),Oe=Te[0],Pe=Te[1],we=+(null==ae?void 0:ae.companyId)||+(null==pe?void 0:pe.company_id),Ee=null==ae?void 0:ae.asset_id,Be=o((null==me?void 0:me.filters)||{}),Me=i(Be,2),Fe=Me[0],He=Me[1],Le=o((null==me?void 0:me.wellSection)||U),Ne=i(Le,2),Ve=Ne[0],ke=Ne[1],Re=r(!0),Ue=o([]),ze=i(Ue,2),_e=ze[0],Ke=ze[1],Ge=o(null),qe=i(Ge,2),Ze=qe[0],Je=qe[1],Qe=o(!0),Xe=i(Qe,2),Ye=Xe[0],$e=Xe[1],et=o(!1),tt=i(et,2),it=tt[0],ot=tt[1],rt=o(!1),nt=i(rt,2),st=nt[0],lt=nt[1],at=r(),pt=o(z.none),mt=i(pt,2),ct=mt[0],dt=mt[1],ut=r(),ft=o(!1),jt=i(ft,2),Ct=jt[0],bt=jt[1],vt=n((function(){return ye<=_e.length}),[_e,ye]),ht=n((function(){return ct===z.small?0:ct===z.mobile?52:48}),[ct]);s((function(){se&&vt&&ie("App can’t process more than (".concat(ye-1,") Offset Wells."))}),[vt,se,me]),s((function(){function e(){window.innerWidth<=Y||x||I?dt(z.mobile):window.innerHeight<=$?dt(z.small):dt(z.normal)}return e(),window.addEventListener("resize",e),function(){window.removeEventListener("resize",e)}}),[se]),s((function(){ut.current&&ct===ut.current||(ut.current=ct,ct===z.small||ct===z.mobile?(Pe(!0),Ie(!1)):(Ie(!de&&(null==me?void 0:me.filterExpanded)),Pe(!de&&(null==me?void 0:me.mapHidden))),He((null==me?void 0:me.filters)||{}),ke((null==me?void 0:me.wellSection)||U))}),[me,de,ct]);var gt=W(we,ce),At=O(le,Ee,gt),yt=i(At,2),St=yt[0],Dt=yt[1],xt=P(we,null==me?void 0:me.metricsKeys),It=i(xt,2),Wt=It[0],Tt=It[1],Ot=T(we,gt,St,Dt,Ee),Pt=w(Ot);s((function(){if(Ot&&St){var e=Ot.find((function(e){return e.id===Ee}));if(e){var i=St.filter((function(e){return e.value!==U})).map((function(e){return e.label})),o=re(re({},e),i.length>0&&t({},_.wellSection,i));Je(o)}else Je(null)}}),[St,Ot]);var wt=F(Wt),Et=E(Ot,Fe);s((function(){if(Et)if(Re.current){var e=Ot.filter((function(e){return((null==me?void 0:me.selectedWellIds)||[]).includes(e.id)}));Ze&&(e=e.concat(Ze)),Ke(m(e,"id")),Re.current=!1}else Ke((function(e){var t=(Et||[]).filter((function(t){return!!e.find((function(e){var i=e.id;return t.id===i}))}));return Ze&&(t=t.concat(Ze)),m(t,"id")}))}),[Ot,Et,null==me?void 0:me.selectedWellIds]);var Bt=B(Ze,Et,_e,$e,Re.current),Mt=i(Bt,5),Ft=Mt[0],Ht=Mt[1],Lt=Mt[2],Nt=Mt[3],Vt=Mt[4];M(Fe[K.radius],Et,Ke,ye);var kt=l((function(e,t,i){var o;o=i===ee.well.name?t:t.reduce((function(e,t){var i,o=null===(i=Ot.find((function(e){return e.id===t})))||void 0===i?void 0:i.rigName,r=Ot.filter((function(e){return e.rigName===o})).map((function(e){return e.id}));return e.concat(r)}),[]);var r=Ot.filter((function(e){var t=e.id;return o.includes(t)}));e?(r=r.slice(0,Math.min(r.length,ye-_e.length)),Ke((function(e){return m(e.concat(r),"id")}))):Ke((function(e){return m(e.filter((function(e){var t=e.id;return!r.find((function(e){return e.id===t}))})))}))}),[Ot,_e]),Rt=l((function(){lt(!0)}),[]),Ut=l((function(e){Tt(e)}),[]),zt=l((function(t,i){Ke(i?function(i){return[].concat(e(i),[t])}:function(e){return e.filter((function(e){return e.id!==t.id}))})}),[]),_t=l((function(e){if(e){var t=Ze?Et.concat(Ze):Et,i=c(m(t,"id"),"distance");Ke(i.slice(0,ye))}else Ke(Ze?[Ze]:[])}),[Et,Ze,ye]),Kt=function(e){if(d(Dt))Ke(Ze?[Ze]:[]);else{var t=Ot.filter((function(t){return Dt[e].includes(t.id)})),i=c(t,"distance");Ke(i.slice(0,Ae))}},Gt=l((function(e){ke(e),Kt(e)}),[Kt]),qt=n((function(){return _e.find((function(e){return e.id===Ee}))?_e.length-1:_e.length}),[_e,Ee]),Zt=n((function(){if(!Dt)return!1;var e=_e.map((function(e){return e.id})),t=Dt[Ve]||[];return Math.min(t.length,Ae)===e.length&&e.every((function(e){return t.includes(e)}))}),[Dt,_e,Ve,Ae]),Jt=function(){var e=(Ot||[]).filter((function(e){return((null==me?void 0:me.selectedWellIds)||[]).includes(e.id)}));Ze&&(e=e.concat(Ze)),Ke(m(e,"id"));var t=re(re({},me),{},{mapHidden:Oe,filterExpanded:xe});fe(t),He((null==me?void 0:me.filters)||{}),ke((null==me?void 0:me.wellSection)||U),ue()},Qt=n((function(){return!Zt||(!(d(Fe)||!Fe[K.sideTracks])||Ve!==U)}),[Zt,Fe,Ve]),Xt=!Ot||!St||!Vt||ct===z.none,Yt=o(!1),$t=i(Yt,2),ei=$t[0],ti=$t[1],ii=o(G),oi=i(ii,2),ri=oi[0],ni=oi[1],si=o([]),li=i(si,2),ai=li[0],pi=li[1];s((function(){if(Vt){var e=Vt.slice(0,ri);pi(e)}}),[Vt,ri,Ze]);return C(j,{open:se,onClose:Jt,title:C(H,{isWDUser:le,viewType:ct,totalCount:null!==(J=null==Ot?void 0:Ot.length)&&void 0!==J?J:0,selectedCount:qt,isViewOnly:de,maxOffsetwellNumber:ye}),isMobile:ct===z.mobile,contentContainerClassName:p(R.offsetWellDialog,t({},R.offsetWellDialogMobile,ct===z.mobile)),contentClassName:p(R.contentContainer,(Q={},t(Q,R.smallContainer,ct===z.small),t(Q,R.contentContainerMobile,ct===z.mobile),Q)),actionsClassName:p(R.modalActions,t({},R.modalActionsMobile,ct===z.mobile)),actions:!de&&b("div",{className:R.actionsWrapper,children:[!Xt&&Qt?C(S,{placement:"bottom-start",title:"Reset to Synced Offsets in ".concat(le?"Offset App":"Wellhub"),children:C("div",{children:C(y,{"data-testid":"".concat(ne,"_reset"),onClick:function(){He({}),ke(U),Kt(U)},color:"primary",startIcon:ct!==z.mobile&&C(u,{}),classes:ct===z.mobile&&{root:R.resetButtonMobile},children:ct!==z.mobile?"Reset":C(u,{})})})}):C("div",{className:ct===z.mobile&&R.infoIconContainer,children:ct!==z.mobile?b(v,{children:[C("span",{className:p(D.regular12,D.colors.t6),children:"The offset list is being automatically populated by "}),C("span",{className:p(D.medium12,D.colors.t6),children:le?"Offset Selection App.":"WellHub."})]}):C(S,{title:b("div",{children:[C("span",{className:p(D.regular12,D.colors.t1),children:"The offset list is being automatically populated by "}),C("span",{className:p(D.medium12,D.colors.t1),children:le?"Offset Selection App.":"WellHub."})]}),enterTouchDelay:0,leaveTouchDelay:q,children:C(f,{className:R.infoIcon})})}),b("div",{className:R.buttonGap,children:[C(y,{"data-testid":"".concat(ne,"_cancel"),onClick:Jt,color:"primary",children:"Cancel"}),b(y,{"data-testid":"".concat(ne,"_selectedWells"),variant:"contained",color:"primary",onClick:function(){ue();var e=re(re({},me),{},{companyId:we,subjectWellId:Ee,selectedWellIds:_e.map((function(e){return e.id})),filters:Fe,metricsKeys:Wt,wellSection:Ve,isSynced:Zt,mapHidden:Oe,filterExpanded:xe,offsetWellsLimited:vt});fe(e,_e)},children:["Select (",qt,")"]})]})]}),children:Xt?C(h,{fullscreen:!1}):b("div",{className:p(R.contentWrapper),ref:at,children:[ct===z.mobile&&b("div",{className:p(R.countContainer,t({},R.countContainerMobile,ct===z.mobile)),children:[C(g,{className:R.totalLabel,children:"Total:"}),C(g,{"data-testid":"".concat(ne,"_totalWells"),className:R.countValue,children:Ot.length}),C(g,{className:R.selectedLabel,children:"Selected:"}),C(g,{"data-testid":"".concat(ne,"_selected"),className:R.countValue,children:qt}),C(S,{title:"App can’t process more than (".concat(ye-1,") Offset Wells."),placement:"right",children:b(A,{"data-testid":"".concat(ne,"_maxOffsetSize"),className:R.maxOffsetSize,children:["/",ye-1]})})]}),ct===z.normal&&C(L,{isViewOnly:de,viewType:ct,filters:Fe,setFilters:He,isFilterExpanded:xe,setIsFilterExpanded:Ie,isMapHidden:Oe,setIsMapHidden:Pe}),Ct&&C("div",{className:R.topGradient,style:{top:ht}}),b("div",{className:p(R.content,(oe={},t(oe,R.contentMobile,ct===z.mobile),t(oe,R.contentiOSMobile,te()===Z),oe)),onScroll:function(e){return function(e){e.target&&(st&&(e.target.scrollLeft=0,lt(!1)),e.target.scrollLeft<=5&&ei&&ti(!1),e.target.scrollLeft>5&&!ei&&ti(!0),e.target.scrollTop<=5&&Ct&&bt(!1),e.target.scrollTop>5&&!Ct&&bt(!0),e.target.scrollHeight!==e.target.offsetHeight&&Math.round(e.target.scrollTop+e.target.offsetHeight+2)>=e.target.scrollHeight&&ri<Vt.length&&ni((function(e){return e+G})))}(e)},children:[ct!==z.normal&&C(L,{isViewOnly:de,viewType:ct,filters:Fe,setFilters:He,isFilterExpanded:xe,setIsFilterExpanded:Ie,isMapHidden:Oe,setIsMapHidden:Pe}),!Oe&&se&&C(V,{isViewOnly:de,mapHidden:Oe,companyId:we,subjectWell:Ze,offsetWellIds:_e.map((function(e){return e.id})),wells:Ot,radius:Fe[K.radius],handleChanageOffsetWell:zt,activeWellId:he,viewType:ct}),C(N,{isHidden:!xe,isWDUser:le,filterOptions:Pt,filters:Fe,wellSections:St,selectedWellSection:Ve,subjectWell:Ze,onChangeFilters:function(e){$e(!0),setTimeout((function(){return He(e)}),0)},onChangeBicWells:Gt}),C(k,{open:se,isTableLoading:Ye,companyId:we,subjectWellId:Ee,sortBy:Ft,setSortBy:Ht,sortDirection:Lt,setSortDirection:Nt,columnsWithDict:wt,wells:ai,metricsKeys:Wt,setMetricsKeys:Ut,handleChanageOffsetWell:zt,handleChangeAllOffsetWells:_t,handleAddRemoveAssets:kt,isWellNameExpand:it,setIsWellNameExpand:ot,isHscrollMoved:ei,onHideAdvancedSearch:Rt,isViewOnly:de,isLastWell:Vt.length<=ri,contentRef:at,isLimitedOffsetwells:vt,maxOffsetwellNumber:ye,wellSections:St,setActiveWellId:ge,viewType:ct,isWDUser:le})]}),de&&b("div",{className:R.viewOnlyInfoContainer,children:[C("span",{className:p(D.regular12,D.colors.t6),children:"The offset list is being automatically populated by "}),C("span",{className:p(D.medium12,D.colors.t6),children:le?"Offset Selection App.":"WellHub."})]})]})})};se.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,localMaxOffsetSize:a.number},se.defaultProps={isWDUser:!1,defaultSubjectWell:null,offsetSettings:{},addWellsUsabilityInfo:void 0,isViewOnly:!1,maxOffsetSize:J,localMaxOffsetSize:Q};export{se as default};
@@ -1 +1 @@
1
- import e from'./../../ext-esm/style-inject/dist/style-inject.es.js';var l={offsetWellDialog:"OffsetWellPickerV4-module_offsetWellDialog__EkSjl",offsetWellDialogMobile:"OffsetWellPickerV4-module_offsetWellDialogMobile__ng66x",viewOnlyTitleLabel:"OffsetWellPickerV4-module_viewOnlyTitleLabel__pod4c",contentWrapper:"OffsetWellPickerV4-module_contentWrapper__gVGQ-",contentContainer:"OffsetWellPickerV4-module_contentContainer__Eb9sk",smallContainer:"OffsetWellPickerV4-module_smallContainer__ngDTM",contentContainerMobile:"OffsetWellPickerV4-module_contentContainerMobile__0VZNE",content:"OffsetWellPickerV4-module_content__mEQWD",contentMobile:"OffsetWellPickerV4-module_contentMobile__jM5ou",contentiOSMobile:"OffsetWellPickerV4-module_contentiOSMobile__e4Coq",modalActions:"OffsetWellPickerV4-module_modalActions__cShAH",modalActionsMobile:"OffsetWellPickerV4-module_modalActionsMobile__ttUJ0",actionsWrapper:"OffsetWellPickerV4-module_actionsWrapper__C0Ciz",buttonGap:"OffsetWellPickerV4-module_buttonGap__fjFT6",viewOnlyLabel:"OffsetWellPickerV4-module_viewOnlyLabel__GP44N",countContainer:"OffsetWellPickerV4-module_countContainer__p8V5A",countContainerMobile:"OffsetWellPickerV4-module_countContainerMobile__HPiI2",totalLabel:"OffsetWellPickerV4-module_totalLabel__3n5bD",selectedLabel:"OffsetWellPickerV4-module_selectedLabel__BzClE",countValue:"OffsetWellPickerV4-module_countValue__dLG-K",maxOffsetSize:"OffsetWellPickerV4-module_maxOffsetSize__MBfqm",resetButtonMobile:"OffsetWellPickerV4-module_resetButtonMobile__dCDdg",infoIconContainer:"OffsetWellPickerV4-module_infoIconContainer__olAOe",infoIcon:"OffsetWellPickerV4-module_infoIcon__8tuGL",topGradient:"OffsetWellPickerV4-module_topGradient__fAc7W"};e(".OffsetWellPickerV4-module_offsetWellDialog__EkSjl{max-height:calc(100% - 32px);padding-bottom:40px;width:1100px}.OffsetWellPickerV4-module_offsetWellDialogMobile__ng66x{margin-top:50px;overflow-y:hidden;padding-bottom:0}.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_contentContainerMobile__0VZNE{height:calc(100% - 104px)}.OffsetWellPickerV4-module_content__mEQWD{flex:1;margin:0 24px 0 40px;overflow:auto;position:relative}.OffsetWellPickerV4-module_contentMobile__jM5ou{margin:0 0 0 16px}.OffsetWellPickerV4-module_contentiOSMobile__e4Coq{margin:0 16px}.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_modalActionsMobile__ttUJ0{padding:10px 16px}.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_countContainerMobile__HPiI2{margin-left:16px;margin-top:14px}.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_maxOffsetSize__MBfqm{color:var(--palette-primary-text-6);cursor:default;padding-left:4px}.OffsetWellPickerV4-module_resetButtonMobile__dCDdg{max-height:40px;max-width:40px;min-height:40px;min-width:40px!important}.OffsetWellPickerV4-module_infoIconContainer__olAOe{height:40px}.OffsetWellPickerV4-module_infoIcon__8tuGL{color:#dadada;height:40px!important;padding:10px;width:40px!important}.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
+ import e from'./../../ext-esm/style-inject/dist/style-inject.es.js';var l={offsetWellDialog:"OffsetWellPickerV4-module_offsetWellDialog__EkSjl",offsetWellDialogMobile:"OffsetWellPickerV4-module_offsetWellDialogMobile__ng66x",viewOnlyTitleLabel:"OffsetWellPickerV4-module_viewOnlyTitleLabel__pod4c",contentWrapper:"OffsetWellPickerV4-module_contentWrapper__gVGQ-",contentContainer:"OffsetWellPickerV4-module_contentContainer__Eb9sk",smallContainer:"OffsetWellPickerV4-module_smallContainer__ngDTM",contentContainerMobile:"OffsetWellPickerV4-module_contentContainerMobile__0VZNE",content:"OffsetWellPickerV4-module_content__mEQWD",contentMobile:"OffsetWellPickerV4-module_contentMobile__jM5ou",contentiOSMobile:"OffsetWellPickerV4-module_contentiOSMobile__e4Coq",modalActions:"OffsetWellPickerV4-module_modalActions__cShAH",modalActionsMobile:"OffsetWellPickerV4-module_modalActionsMobile__ttUJ0",actionsWrapper:"OffsetWellPickerV4-module_actionsWrapper__C0Ciz",buttonGap:"OffsetWellPickerV4-module_buttonGap__fjFT6",viewOnlyLabel:"OffsetWellPickerV4-module_viewOnlyLabel__GP44N",countContainer:"OffsetWellPickerV4-module_countContainer__p8V5A",countContainerMobile:"OffsetWellPickerV4-module_countContainerMobile__HPiI2",totalLabel:"OffsetWellPickerV4-module_totalLabel__3n5bD",selectedLabel:"OffsetWellPickerV4-module_selectedLabel__BzClE",countValue:"OffsetWellPickerV4-module_countValue__dLG-K",maxOffsetSize:"OffsetWellPickerV4-module_maxOffsetSize__MBfqm",resetButtonMobile:"OffsetWellPickerV4-module_resetButtonMobile__dCDdg",infoIconContainer:"OffsetWellPickerV4-module_infoIconContainer__olAOe",viewOnlyInfoContainer:"OffsetWellPickerV4-module_viewOnlyInfoContainer__Fr4nL",infoIcon:"OffsetWellPickerV4-module_infoIcon__8tuGL",topGradient:"OffsetWellPickerV4-module_topGradient__fAc7W"};e(".OffsetWellPickerV4-module_offsetWellDialog__EkSjl{max-height:calc(100% - 32px);padding-bottom:40px;width:1100px}.OffsetWellPickerV4-module_offsetWellDialogMobile__ng66x{margin-top:50px;overflow-y:hidden;padding-bottom:0}.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_contentContainerMobile__0VZNE{height:calc(100% - 104px)}.OffsetWellPickerV4-module_content__mEQWD{flex:1;margin:0 24px 0 40px;overflow:auto;position:relative}.OffsetWellPickerV4-module_contentMobile__jM5ou{margin:0 0 0 16px}.OffsetWellPickerV4-module_contentiOSMobile__e4Coq{margin:0 16px}.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_modalActionsMobile__ttUJ0{padding:10px 16px}.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_countContainerMobile__HPiI2{margin-left:16px;margin-top:14px}.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_maxOffsetSize__MBfqm{color:var(--palette-primary-text-6);cursor:default;padding-left:4px}.OffsetWellPickerV4-module_resetButtonMobile__dCDdg{max-height:40px;max-width:40px;min-height:40px;min-width:40px!important}.OffsetWellPickerV4-module_infoIconContainer__olAOe{height:40px}.OffsetWellPickerV4-module_viewOnlyInfoContainer__Fr4nL{padding:24px 40px 0}.OffsetWellPickerV4-module_infoIcon__8tuGL{color:#dadada;height:40px!important;padding:10px;width:40px!important}.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,7 +1,9 @@
1
- export function AppHeader({ viewType, totalCount, selectedCount, maxOffsetwellNumber }: {
1
+ export function AppHeader({ isWDUser, viewType, totalCount, selectedCount, isViewOnly, maxOffsetwellNumber, }: {
2
+ isWDUser: any;
2
3
  viewType: any;
3
4
  totalCount: any;
4
5
  selectedCount: any;
6
+ isViewOnly: any;
5
7
  maxOffsetwellNumber: any;
6
8
  }): JSX.Element;
7
9
  export namespace AppHeader {
@@ -1 +1 @@
1
- {"version":3,"file":"AppHeader.d.ts","sourceRoot":"","sources":["../../../../../src/components/OffsetWellPickerV4/components/AppHeader/AppHeader.js"],"names":[],"mappings":"AAQO;;;;;gBA+BN"}
1
+ {"version":3,"file":"AppHeader.d.ts","sourceRoot":"","sources":["../../../../../src/components/OffsetWellPickerV4/components/AppHeader/AppHeader.js"],"names":[],"mappings":"AASO;;;;;;;gBAuCN"}
@@ -1 +1 @@
1
- import e from"prop-types";import{Divider as t,Tooltip as a}from"@material-ui/core";import{Regular20 as r,Regular14 as l,Regular12 as s}from"../../../Typography.js";import{ViewType as i}from"../../constants.js";import c from"./AppHeader.module.css.js";import{jsx as o,jsxs as n}from"react/jsx-runtime";var d=function(e){var d=e.viewType,m=e.totalCount,p=e.selectedCount,u=e.maxOffsetwellNumber;return d===i.mobile?o("div",{className:c.headerContainer,children:o(r,{children:"Select Offset Wells"})}):n("div",{className:c.headerContainer,children:[o(r,{children:"Select Offset Wells"}),o(t,{className:c.divideLine}),o(l,{className:c.totalLabel,children:"Total:"}),o(l,{"data-testid":"".concat("AppHeader","_totalWells"),className:c.countValue,children:m}),o(l,{className:c.selectedLabel,children:"Selected:"}),o(l,{"data-testid":"".concat("AppHeader","_selected"),className:c.countValue,children:p}),o(a,{title:"App can’t process more than (".concat(u-1,") Offset Wells."),placement:"right",children:n(s,{"data-testid":"".concat("AppHeader","_maxOffsetSize"),className:c.maxOffsetSize,children:["/",u-1]})})]})};d.propTypes={viewType:e.string.isRequired,totalCount:e.number.isRequired,selectedCount:e.number.isRequired,maxOffsetwellNumber:e.number.isRequired};export{d as AppHeader};
1
+ import e from"prop-types";import{Divider as t,Tooltip as r}from"@material-ui/core";import{Regular20 as s,Regular14 as a,Regular12 as i}from"../../../Typography.js";import{ViewType as l}from"../../constants.js";import{CustomInfoIcon as o}from"../CustomInfoIcon/CustomInfoIcon.js";import c from"./AppHeader.module.css.js";import{jsx as n,jsxs as m}from"react/jsx-runtime";var d=function(e){var d=e.isWDUser,p=e.viewType,f=e.totalCount,u=e.selectedCount,h=e.isViewOnly,N=e.maxOffsetwellNumber;return p===l.mobile?n("div",{className:c.headerContainer,children:n(s,{children:"Select Offset Wells"})}):m("div",{className:c.headerContainer,children:[n(s,{children:"Select Offset Wells"}),n(t,{className:c.divideLine}),n(a,{className:c.totalLabel,children:"Total:"}),n(a,{"data-testid":"".concat("AppHeader","_totalWells"),className:c.countValue,children:f}),n(a,{className:c.selectedLabel,children:"Selected:"}),n(a,{"data-testid":"".concat("AppHeader","_selected"),className:c.countValue,children:u}),n(r,{title:"App can’t process more than (".concat(N-1,") Offset Wells."),placement:"right",children:m(i,{"data-testid":"".concat("AppHeader","_maxOffsetSize"),className:c.maxOffsetSize,children:["/",N-1]})}),h&&n(o,{viewType:p,isWDUser:d})]})};d.propTypes={viewType:e.string.isRequired,totalCount:e.number.isRequired,selectedCount:e.number.isRequired,maxOffsetwellNumber:e.number.isRequired};export{d as AppHeader};
@@ -1,16 +1,9 @@
1
- export function CustomInfoIcon({ isWDUser, isViewOnly, maxOffsetwellNumber, selectedCount, viewType, }: {
2
- isWDUser: any;
3
- isViewOnly: any;
4
- maxOffsetwellNumber: any;
5
- selectedCount: any;
1
+ export function CustomInfoIcon({ viewType, isWDUser }: {
6
2
  viewType: any;
3
+ isWDUser: any;
7
4
  }): JSX.Element;
8
5
  export namespace CustomInfoIcon {
9
6
  namespace propTypes {
10
- const isWDUser: PropTypes.Validator<boolean>;
11
- const selectedCount: PropTypes.Validator<number>;
12
- const isViewOnly: PropTypes.Validator<boolean>;
13
- const maxOffsetwellNumber: PropTypes.Validator<number>;
14
7
  const viewType: PropTypes.Validator<string>;
15
8
  }
16
9
  }
@@ -1 +1 @@
1
- {"version":3,"file":"CustomInfoIcon.d.ts","sourceRoot":"","sources":["../../../../../src/components/OffsetWellPickerV4/components/CustomInfoIcon/CustomInfoIcon.js"],"names":[],"mappings":"AAuDA;;;;;;gBAgCC"}
1
+ {"version":3,"file":"CustomInfoIcon.d.ts","sourceRoot":"","sources":["../../../../../src/components/OffsetWellPickerV4/components/CustomInfoIcon/CustomInfoIcon.js"],"names":[],"mappings":"AAOA;;;gBAeC"}
@@ -0,0 +1 @@
1
+ import e from"prop-types";import{Tooltip as o}from"@material-ui/core";import i from"@material-ui/icons/Info";import r from"./CustomInfoIcon.module.css.js";import{ViewType as t,LEAVE_TOUCH_DELAY as m}from"../../constants.js";import{jsx as s}from"react/jsx-runtime";function l(e){var l=e.viewType,n=e.isWDUser;return s(o,{title:"View only mode. To edit offsets, use ".concat(n?"Offset Well Selection app.":"Wellhub."),enterTouchDelay:l===t.mobile&&0,leaveTouchDelay:l===t.mobile&&m,placement:l===t.mobile?"":"right",children:s("div",{className:r.infoWrapper,children:s(i,{className:r.infoIcon})})})}l.propTypes={viewType:e.string.isRequired};export{l as CustomInfoIcon};
@@ -0,0 +1 @@
1
+ import o from'./../../../../ext-esm/style-inject/dist/style-inject.es.js';var n={infoWrapper:"CustomInfoIcon-module_infoWrapper__uxAjc",infoIcon:"CustomInfoIcon-module_infoIcon__VAE52"};o(".CustomInfoIcon-module_infoWrapper__uxAjc{align-items:center;display:flex;margin-left:8px;position:relative}.CustomInfoIcon-module_infoIcon__VAE52{color:var(--palette-info-light);font-size:20px!important}");export{n as default};
@@ -1,5 +1,5 @@
1
1
  declare const _default: import("react").MemoExoticComponent<{
2
- ({ open, isTableLoading, companyId, subjectWellId, sortBy, setSortBy, sortDirection, setSortDirection, columnsWithDict, wells: updatedWells, metricsKeys, setMetricsKeys, handleChanageOffsetWell, handleChangeAllOffsetWells, handleAddRemoveAssets, isWellNameExpand, setIsWellNameExpand, isHscrollMoved, onHideAdvancedSearch, isViewOnly, isLastWell, contentRef, isLimitedOffsetwells, maxOffsetwellNumber, wellSections, setActiveWellId, viewType, }: {
2
+ ({ open, isTableLoading, companyId, subjectWellId, sortBy, setSortBy, sortDirection, setSortDirection, columnsWithDict, wells: updatedWells, metricsKeys, setMetricsKeys, handleChanageOffsetWell, handleChangeAllOffsetWells, handleAddRemoveAssets, isWellNameExpand, setIsWellNameExpand, isHscrollMoved, onHideAdvancedSearch, isViewOnly, isLastWell, contentRef, isLimitedOffsetwells, maxOffsetwellNumber, wellSections, setActiveWellId, viewType, isWDUser, }: {
3
3
  open: any;
4
4
  isTableLoading: any;
5
5
  companyId: any;
@@ -27,6 +27,7 @@ declare const _default: import("react").MemoExoticComponent<{
27
27
  wellSections: any;
28
28
  setActiveWellId: any;
29
29
  viewType: any;
30
+ isWDUser: any;
30
31
  }): JSX.Element;
31
32
  propTypes: {
32
33
  open: PropTypes.Validator<boolean>;
@@ -56,6 +57,7 @@ declare const _default: import("react").MemoExoticComponent<{
56
57
  wellSections: PropTypes.Validator<PropTypes.InferProps<{}>[]>;
57
58
  setActiveWellId: PropTypes.Validator<(...args: any[]) => any>;
58
59
  viewType: PropTypes.Validator<string>;
60
+ isWDUser: PropTypes.Validator<boolean>;
59
61
  };
60
62
  }>;
61
63
  export default _default;
@@ -1 +1 @@
1
- import e from"@babel/runtime/helpers/slicedToArray";import t from"@babel/runtime/helpers/defineProperty";import{memo as r,useState as i,useRef as o,useEffect as n,useMemo as s,useCallback as a,Fragment as p}from"react";import l from"classnames";import m from"prop-types";import{Table as d,TableHead as c,TableBody as u,TableRow as j,TableCell as C}from"@material-ui/core";import{jsxs as f,jsx as h}from"react/jsx-runtime";import"../../../DevCenter/DevCenterAppContainer/components/AppActions/AppActions.css.js";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"../../../DevCenter/DevCenterAppContainer/components/DevCenterAppView/DevCenterAppView.js";import"../../../DevCenter/DevCenterAppContainer/components/DcFullscreenElemsCoordinatorProvider/DcFullscreenElemsCoordinatorProvider.js";import"../../../DevCenter/DevCenterAppContainer/components/DcFullscreenElemsCoordinatorProvider/IsInsideDcFullscreenElemProvider.js";import"../../../DevCenter/DevCenterAppContainer/components/IsInsideDcAppProvider/IsInsideDcAppProvider.js";import"../../../Modal/CorvaModal.js";import"uuid";import"../../../IconMenu/index.js";import"../../../StyledMenuItem/index.js";import"../../../ImagesGrid/index.js";import"../../../DevCenter/AppHeader/AppHeader.js";import"../../../DevCenter/AppSideBar/AppSideBar.js";import"../../../DevCenter/AppsDataProvider/AppsDataProvider.js";import"../../../DevCenter/DevCenterAppContainer/DevCenterAppContainer.js";import"../../../DevCenter/NavigationBar/NavigationBar.js";import"../../../DevCenter/SideBar/SideBar.js";import"../../../DevCenter/AppSettingsPopover/AppSettingsPopover.js";import"../../../DevCenter/AppFilterPanelLayout/AppFilterPanelLayout.js";import"../../../DevCenter/DevCenterRouterContext/DevCenterRouterContext.js";import"../../../DevCenter/DevCenterRouterContext/UniversalLink/UniversalLink.js";import"@babel/runtime/helpers/objectWithoutProperties";import"react-router";import"../../../DevCenter/IsolatedDevCenterAppContainer/DevCenterIsolatedAppPage.js";import"../../../DevCenter/IsolatedDevCenterAppContainer/DevCenterIsolatedApp.js";import"../../../DevCenter/AppContext.js";import"../../../AssetEditor/index.js";import"../../../AppVersionsSelect/AppVersionsSelect.js";import b from"../../../LoadingIndicator/LoadingIndicator.js";import"../../../Typography.js";import"../../../CollapsableSidebar.js";import"../../../DateTimePicker/index.js";import"../../../DatePicker/index.js";import"../../../ErrorBoundary/ErrorBoundary.js";import"../../../ErrorBoundary/DevCenterAppErrorView/DevCenterAppErrorView.js";import"../../../Annotations/components/AnnotationsList/index.js";import"../../../Annotations/components/LastAnnotation/index.js";import"../../../Annotations/AnnotationsContext.js";import"../../../SlateFormattedText/SlateFormattedText.js";import"../../../SlateFormattedText/RenderElements.js";import"@babel/runtime/helpers/typeof";import"lodash";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"../../../Chart/components/ChartButton.js";import"../../../Chart/components/ChartButtons.js";import"../../../Chart/components/ChartWrapper.js";import"../../../Chart/components/AxisDropdown.js";import"../../../Chart/components/buttons/DragToZoomButton.js";import"../../../Chart/components/buttons/ZoomInButton.js";import"../../../Chart/components/buttons/ZoomOutButton.js";import"../../../Chart/components/buttons/PanButton.js";import"../../../Chart/components/buttons/ResetZoomButton.js";import"../../../Chart/components/buttons/HideAxesButton.js";import"../../../ColorPicker/PaletteChromePicker/PaletteChromePicker.js";import"../../../TruncatedText/index.js";import"../../../RangeSlider/RangeSlider.js";import"../../../AdvancedSlider/AdvancedSlider.js";import"../../../Breadcrumbs/index.js";import"../../../VirtualizedTable/index.js";import"../../../EmptyView/EmptyView.js";import"../../../EmptyView/EmptyAppView/EmptyAppView.js";import"../../../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"@babel/runtime/helpers/asyncToGenerator";import"@babel/runtime/regenerator";import"../../../../clients/jsonApi/index.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"../../../BICOffsetPickerDialog/index.js";import"../../../OffsetWellButton/OffsetWellButton.js";import"../../../OffsetWellPickerV2/OffsetWellPickerDialog.js";import"../../../OffsetWellPickerV3/index.js";import"../../../OffsetWellChips/Chip.js";import"../../../OffsetWellChips/ChipsContainer.js";import"../../OffsetWellPickerV4.js";import"../../../OffsetWellMap/OffsetWellMap.js";import"../../../Notifications/Notifications.js";import"@babel/runtime/helpers/toConsumableArray";import"../../../Toaster/Toaster.js";import"../../../ConfirmationDialog.js";import"../../../TextLink/index.js";import"../../../Avatar/index.js";import"../../../Template/TemplatePopover/index.js";import"../../../Template/TemplateSharingDialog/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"../../../Table/TableContainer/TableContainer.js";import"../../../Table/TableCell/TableCell.js";import"../../../Tooltip/MuiTooltipDcWrapper.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"../../../HelpCenter/HelpCenterIcon.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"../../../StatusBadge/index.js";import"../../../Attachment/index.js";import"../../../EmojiIconButton.js";import"../../../FileUploadIconButton.js";import"../../../FilePreview/index.js";import"../../../FailedFileUploading.js";import"../../../UserMention/index.js";import"../../../CommentsInfo/index.js";import"../../../CommentInput/index.js";import"../../../Comment/index.js";import"../../../CommentLoader.js";import{AdvancedSearch as v}from"./AdvancedSearch/AdvancedSearch.js";import A from"./OffsetWellsTableHead.js";import g from"./OffsetWellsTableRow.js";import{METRICS_LIST as D,EXPANED_WELLNAME_WIDTH as S,TableColumns as y,ViewType as x,ROW_HEIGHT as T}from"../../constants.js";import I from"./OffsetWellsTable.module.css.js";import{getIsImperial as P}from"../../utils/unitSystem.js";function w(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 O(e){for(var r=1;r<arguments.length;r++){var i=null!=arguments[r]?arguments[r]:{};r%2?w(Object(i),!0).forEach((function(r){t(e,r,i[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):w(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}var W=function(r){var m,w=r.open,W=r.isTableLoading,E=r.companyId,B=r.subjectWellId,R=r.sortBy,L=r.setSortBy,F=r.sortDirection,M=r.setSortDirection,k=r.columnsWithDict,N=r.wells,q=r.metricsKeys,V=r.setMetricsKeys,H=r.handleChanageOffsetWell,K=r.handleChangeAllOffsetWells,U=r.handleAddRemoveAssets,Z=r.isWellNameExpand,z=r.setIsWellNameExpand,G=r.isHscrollMoved,J=r.onHideAdvancedSearch,Q=r.isViewOnly,X=r.isLastWell,Y=r.contentRef,$=r.isLimitedOffsetwells,_=r.maxOffsetwellNumber,ee=r.wellSections,te=r.setActiveWellId,re=r.viewType,ie=i([]),oe=e(ie,2),ne=oe[0],se=oe[1],ae=i(null),pe=e(ae,2),le=pe[0],me=pe[1],de=i(0),ce=e(de,2),ue=ce[0],je=ce[1],Ce=i(0),fe=e(Ce,2),he=fe[0],be=fe[1],ve=o(),Ae=o(),ge=o();n((function(){if(!le)return se(N),void be(0);var t=function(e,t,r,i){var o,n=e.findIndex((function(e){return t===e.id})),s=r.findIndex((function(e){return t===e.id}));-1===s&&(s=r.length);var a=Math.round(((null===(o=i.current)||void 0===o?void 0:o.clientHeight)-145)/T+1),p=s-n;Math.abs(p)>a&&(s=n+a*Math.sign(p));var l=s-n;return[n,s,l,200*(.4*Math.abs(l)+2),Math.min(n,s),(Math.abs(l)+1)*T]}(ne,le,N,Y),r=e(t,6),i=r[0],o=r[1],n=r[2],s=r[3],a=r[4],p=r[5];if(ge.current=s,o===i)se(N);else{je(a),be(p);var l=function(e,t,r,i){return e.map((function(e,o){var n=r<o&&o<=i||i<=o&&o<r;return o===r?O(O({},e),{},{moveTo:t}):n?O(O({},e),{},{moveTo:r<i?-1:1,delayTime:Math.abs(o-r)}):e}))}(ne,n,i,o);se(l),setTimeout((function(){se(N),be(0),me(null)}),s)}}),[N]);var De=s((function(){var e=ne.filter((function(e){return e.checked}));return[e,ne.length!==e.length&&e.length&&!$,e.length===ne.length||$]}),[ne,$]),Se=e(De,3),ye=Se[0],xe=Se[1],Te=Se[2],Ie=s((function(){return P()}),[]),Pe=s((function(){return(q||[]).reduce((function(e,t){return e.concat(D.filter((function(e){return e.key===t})))}),[])}),[q]),we=s((function(){return Z?S-58:y[0].width[q.length]-58}),[Z,null==q?void 0:q.length]);n((function(){if(re!==x.mobile&&ve.current&&Ae.current){var e=ve.current.querySelector(".".concat(I.wellNameFixed));G?e.classList.remove(I.noShadow):e.classList.add(I.noShadow);var t=Ae.current.querySelectorAll(".".concat(I.wellNameFixed));G?t.forEach((function(e){return e.classList.remove(I.noShadow)})):t.forEach((function(e){return e.classList.add(I.noShadow)}))}}),[G,Ae.current,ve.current,ne]);var Oe=a((function(e,t){L(e),M(t)}),[]),We=a((function(e){V(e)}),[]),Ee=a((function(e,t){V((function(r){return r.map((function(r){return r===e?t:r}))}))}),[]);return k&&ne?f("div",{className:I.offsetWellsTable,children:[h("div",{className:I.stickyTable,children:h(d,{"aria-label":"ows table head",innerRef:ve,children:h(c,{children:h(A,{open:w,columnsWithDict:k,metricsKeys:q,sortBy:R,sortDirection:F,indeterminate:xe,isAllWellsSelected:Te,onChangeSort:Oe,onChangeMetricsKeys:We,onUpdateMetricsKey:Ee,isWellNameExpand:Z,setIsWellNameExpand:z,handleChangeAllOffsetWells:K,wellNameStyle:I.wellNameFixed,isViewOnly:Q,isImperial:Ie,contentRef:Y,viewType:re})})})}),!Q&&h("div",{className:I.searchCell,children:h(v,{companyId:E,subjectWellId:B,wells:ne,onChange:U,selectedWellIds:ye.map((function(e){return e.id})),onHideAdvancedSearch:J,width:null===(m=Y.current)||void 0===m?void 0:m.getBoundingClientRect().width})}),h(d,{"aria-label":"ows table body",innerRef:Ae,className:I.bodyTable,children:f(u,{children:[h(j,{children:h(C,{className:l(I.topShadow,t({},I.viewOnlyShadow,Q))})}),ne.map((function(e,t){return f(p,{children:[h(j,{children:le&&he>0&&t===ue&&h(C,{style:{height:he}})}),h(g,{columnsWithDict:k,subjectWellId:B,data:e,metricsKeys:q,metricsColumns:Pe,handleChanageOffsetWell:H,isWellNameExpand:Z,wellNameStyle:I.wellNameFixed,wellNameWidth:we,isViewOnly:Q,isImperial:Ie,isLimitedOffsetwells:$,maxOffsetwellNumber:_,wellSections:ee,setActiveWellId:te,viewType:re,newCheckedWellId:null!=e&&e.moveTo?le:0,setNewCheckedWellId:me,index:null!=e&&e.moveTo?t:0,flyDuration:null!=e&&e.moveTo?ge.current:0})]},e.id)})),!X&&h(j,{children:h(C,{className:I.loadingCell,children:h("span",{children:"Loading..."})})}),h(j,{children:h(C,{className:I.bottomShadow})})]})}),W&&h(b,{fullscreen:!1,className:I.loadingContainer})]}):null};W.propTypes={open:m.bool.isRequired,isTableLoading:m.bool.isRequired,companyId:m.number.isRequired,subjectWellId:m.number.isRequired,sortBy:m.string.isRequired,setSortBy:m.func.isRequired,sortDirection:m.string.isRequired,setSortDirection:m.func.isRequired,columnsWithDict:m.arrayOf(m.shape({})).isRequired,wells:m.arrayOf(m.shape({})).isRequired,metricsKeys:m.arrayOf(m.string).isRequired,setMetricsKeys:m.func.isRequired,handleChanageOffsetWell:m.func.isRequired,handleChangeAllOffsetWells:m.func.isRequired,handleAddRemoveAssets:m.func.isRequired,setIsWellNameExpand:m.func.isRequired,isWellNameExpand:m.bool.isRequired,isHscrollMoved:m.bool.isRequired,onHideAdvancedSearch:m.func.isRequired,isViewOnly:m.bool.isRequired,isLastWell:m.bool.isRequired,isLimitedOffsetwells:m.bool.isRequired,maxOffsetwellNumber:m.number.isRequired,contentRef:m.shape().isRequired,wellSections:m.arrayOf(m.shape({})).isRequired,setActiveWellId:m.func.isRequired,viewType:m.string.isRequired};var E=r(W);export{E as default};
1
+ import e from"@babel/runtime/helpers/slicedToArray";import t from"@babel/runtime/helpers/defineProperty";import{memo as r,useState as i,useRef as o,useEffect as n,useMemo as s,useCallback as a,Fragment as p}from"react";import l from"classnames";import m from"prop-types";import{Table as d,TableHead as c,TableBody as u,TableRow as j,TableCell as C}from"@material-ui/core";import{jsxs as f,jsx as h}from"react/jsx-runtime";import"../../../DevCenter/DevCenterAppContainer/components/AppActions/AppActions.css.js";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"../../../DevCenter/DevCenterAppContainer/components/DevCenterAppView/DevCenterAppView.js";import"../../../DevCenter/DevCenterAppContainer/components/DcFullscreenElemsCoordinatorProvider/DcFullscreenElemsCoordinatorProvider.js";import"../../../DevCenter/DevCenterAppContainer/components/DcFullscreenElemsCoordinatorProvider/IsInsideDcFullscreenElemProvider.js";import"../../../DevCenter/DevCenterAppContainer/components/IsInsideDcAppProvider/IsInsideDcAppProvider.js";import"../../../Modal/CorvaModal.js";import"uuid";import"../../../IconMenu/index.js";import"../../../StyledMenuItem/index.js";import"../../../ImagesGrid/index.js";import"../../../DevCenter/AppHeader/AppHeader.js";import"../../../DevCenter/AppSideBar/AppSideBar.js";import"../../../DevCenter/AppsDataProvider/AppsDataProvider.js";import"../../../DevCenter/DevCenterAppContainer/DevCenterAppContainer.js";import"../../../DevCenter/NavigationBar/NavigationBar.js";import"../../../DevCenter/SideBar/SideBar.js";import"../../../DevCenter/AppSettingsPopover/AppSettingsPopover.js";import"../../../DevCenter/AppFilterPanelLayout/AppFilterPanelLayout.js";import"../../../DevCenter/DevCenterRouterContext/DevCenterRouterContext.js";import"../../../DevCenter/DevCenterRouterContext/UniversalLink/UniversalLink.js";import"@babel/runtime/helpers/objectWithoutProperties";import"react-router";import"../../../DevCenter/IsolatedDevCenterAppContainer/DevCenterIsolatedAppPage.js";import"../../../DevCenter/IsolatedDevCenterAppContainer/DevCenterIsolatedApp.js";import"../../../DevCenter/AppContext.js";import"../../../AssetEditor/index.js";import"../../../AppVersionsSelect/AppVersionsSelect.js";import b from"../../../LoadingIndicator/LoadingIndicator.js";import"../../../Typography.js";import"../../../CollapsableSidebar.js";import"../../../DateTimePicker/index.js";import"../../../DatePicker/index.js";import"../../../ErrorBoundary/ErrorBoundary.js";import"../../../ErrorBoundary/DevCenterAppErrorView/DevCenterAppErrorView.js";import"../../../Annotations/components/AnnotationsList/index.js";import"../../../Annotations/components/LastAnnotation/index.js";import"../../../Annotations/AnnotationsContext.js";import"../../../SlateFormattedText/SlateFormattedText.js";import"../../../SlateFormattedText/RenderElements.js";import"@babel/runtime/helpers/typeof";import"lodash";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"../../../Chart/components/ChartButton.js";import"../../../Chart/components/ChartButtons.js";import"../../../Chart/components/ChartWrapper.js";import"../../../Chart/components/AxisDropdown.js";import"../../../Chart/components/buttons/DragToZoomButton.js";import"../../../Chart/components/buttons/ZoomInButton.js";import"../../../Chart/components/buttons/ZoomOutButton.js";import"../../../Chart/components/buttons/PanButton.js";import"../../../Chart/components/buttons/ResetZoomButton.js";import"../../../Chart/components/buttons/HideAxesButton.js";import"../../../ColorPicker/PaletteChromePicker/PaletteChromePicker.js";import"../../../TruncatedText/index.js";import"../../../RangeSlider/RangeSlider.js";import"../../../AdvancedSlider/AdvancedSlider.js";import"../../../Breadcrumbs/index.js";import"../../../VirtualizedTable/index.js";import"../../../EmptyView/EmptyView.js";import"../../../EmptyView/EmptyAppView/EmptyAppView.js";import"../../../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"@babel/runtime/helpers/asyncToGenerator";import"@babel/runtime/regenerator";import"../../../../clients/jsonApi/index.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"../../../BICOffsetPickerDialog/index.js";import"../../../OffsetWellButton/OffsetWellButton.js";import"../../../OffsetWellPickerV2/OffsetWellPickerDialog.js";import"../../../OffsetWellPickerV3/index.js";import"../../../OffsetWellChips/Chip.js";import"../../../OffsetWellChips/ChipsContainer.js";import"../../OffsetWellPickerV4.js";import"../../../OffsetWellMap/OffsetWellMap.js";import"../../../Notifications/Notifications.js";import"@babel/runtime/helpers/toConsumableArray";import"../../../Toaster/Toaster.js";import"../../../ConfirmationDialog.js";import"../../../TextLink/index.js";import"../../../Avatar/index.js";import"../../../Template/TemplatePopover/index.js";import"../../../Template/TemplateSharingDialog/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"../../../Table/TableContainer/TableContainer.js";import"../../../Table/TableCell/TableCell.js";import"../../../Tooltip/MuiTooltipDcWrapper.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"../../../HelpCenter/HelpCenterIcon.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"../../../StatusBadge/index.js";import"../../../Attachment/index.js";import"../../../EmojiIconButton.js";import"../../../FileUploadIconButton.js";import"../../../FilePreview/index.js";import"../../../FailedFileUploading.js";import"../../../UserMention/index.js";import"../../../CommentsInfo/index.js";import"../../../CommentInput/index.js";import"../../../Comment/index.js";import"../../../CommentLoader.js";import{AdvancedSearch as v}from"./AdvancedSearch/AdvancedSearch.js";import A from"./OffsetWellsTableHead.js";import g from"./OffsetWellsTableRow.js";import{METRICS_LIST as D,EXPANED_WELLNAME_WIDTH as S,TableColumns as y,ViewType as x,ROW_HEIGHT as T}from"../../constants.js";import I from"./OffsetWellsTable.module.css.js";import{getIsImperial as P}from"../../utils/unitSystem.js";function w(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 W(e){for(var r=1;r<arguments.length;r++){var i=null!=arguments[r]?arguments[r]:{};r%2?w(Object(i),!0).forEach((function(r){t(e,r,i[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):w(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}var O=function(r){var m,w=r.open,O=r.isTableLoading,E=r.companyId,B=r.subjectWellId,R=r.sortBy,L=r.setSortBy,F=r.sortDirection,M=r.setSortDirection,k=r.columnsWithDict,N=r.wells,q=r.metricsKeys,V=r.setMetricsKeys,H=r.handleChanageOffsetWell,K=r.handleChangeAllOffsetWells,U=r.handleAddRemoveAssets,Z=r.isWellNameExpand,z=r.setIsWellNameExpand,G=r.isHscrollMoved,J=r.onHideAdvancedSearch,Q=r.isViewOnly,X=r.isLastWell,Y=r.contentRef,$=r.isLimitedOffsetwells,_=r.maxOffsetwellNumber,ee=r.wellSections,te=r.setActiveWellId,re=r.viewType,ie=r.isWDUser,oe=i([]),ne=e(oe,2),se=ne[0],ae=ne[1],pe=i(null),le=e(pe,2),me=le[0],de=le[1],ce=i(0),ue=e(ce,2),je=ue[0],Ce=ue[1],fe=i(0),he=e(fe,2),be=he[0],ve=he[1],Ae=o(),ge=o(),De=o();n((function(){if(!me)return ae(N),void ve(0);var t=function(e,t,r,i){var o,n=e.findIndex((function(e){return t===e.id})),s=r.findIndex((function(e){return t===e.id}));-1===s&&(s=r.length);var a=Math.round(((null===(o=i.current)||void 0===o?void 0:o.clientHeight)-145)/T+1),p=s-n;Math.abs(p)>a&&(s=n+a*Math.sign(p));var l=s-n;return[n,s,l,200*(.4*Math.abs(l)+2),Math.min(n,s),(Math.abs(l)+1)*T]}(se,me,N,Y),r=e(t,6),i=r[0],o=r[1],n=r[2],s=r[3],a=r[4],p=r[5];if(De.current=s,o===i)ae(N);else{Ce(a),ve(p);var l=function(e,t,r,i){return e.map((function(e,o){var n=r<o&&o<=i||i<=o&&o<r;return o===r?W(W({},e),{},{moveTo:t}):n?W(W({},e),{},{moveTo:r<i?-1:1,delayTime:Math.abs(o-r)}):e}))}(se,n,i,o);ae(l),setTimeout((function(){ae(N),ve(0),de(null)}),s)}}),[N]);var Se=s((function(){var e=se.filter((function(e){return e.checked}));return[e,se.length!==e.length&&e.length&&!$,e.length===se.length||$]}),[se,$]),ye=e(Se,3),xe=ye[0],Te=ye[1],Ie=ye[2],Pe=s((function(){return P()}),[]),we=s((function(){return(q||[]).reduce((function(e,t){return e.concat(D.filter((function(e){return e.key===t})))}),[])}),[q]),We=s((function(){return Z?S-58:y[0].width[q.length]-58}),[Z,null==q?void 0:q.length]);n((function(){if(re!==x.mobile&&Ae.current&&ge.current){var e=Ae.current.querySelector(".".concat(I.wellNameFixed));G?e.classList.remove(I.noShadow):e.classList.add(I.noShadow);var t=ge.current.querySelectorAll(".".concat(I.wellNameFixed));G?t.forEach((function(e){return e.classList.remove(I.noShadow)})):t.forEach((function(e){return e.classList.add(I.noShadow)}))}}),[G,ge.current,Ae.current,se]);var Oe=a((function(e,t){L(e),M(t)}),[]),Ee=a((function(e){V(e)}),[]),Be=a((function(e,t){V((function(r){return r.map((function(r){return r===e?t:r}))}))}),[]);return k&&se?f("div",{className:I.offsetWellsTable,children:[h("div",{className:I.stickyTable,children:h(d,{"aria-label":"ows table head",innerRef:Ae,children:h(c,{children:h(A,{open:w,columnsWithDict:k,metricsKeys:q,sortBy:R,sortDirection:F,indeterminate:Te,isAllWellsSelected:Ie,onChangeSort:Oe,onChangeMetricsKeys:Ee,onUpdateMetricsKey:Be,isWellNameExpand:Z,setIsWellNameExpand:z,handleChangeAllOffsetWells:K,wellNameStyle:I.wellNameFixed,isViewOnly:Q,isImperial:Pe,contentRef:Y,viewType:re})})})}),!Q&&h("div",{className:I.searchCell,children:h(v,{companyId:E,subjectWellId:B,wells:se,onChange:U,selectedWellIds:xe.map((function(e){return e.id})),onHideAdvancedSearch:J,width:null===(m=Y.current)||void 0===m?void 0:m.getBoundingClientRect().width})}),h(d,{"aria-label":"ows table body",innerRef:ge,className:I.bodyTable,children:f(u,{children:[h(j,{children:h(C,{className:l(I.topShadow,t({},I.viewOnlyShadow,Q))})}),se.map((function(e,t){return f(p,{children:[h(j,{children:me&&be>0&&t===je&&h(C,{style:{height:be}})}),h(g,{columnsWithDict:k,subjectWellId:B,data:e,metricsKeys:q,metricsColumns:we,handleChanageOffsetWell:H,isWellNameExpand:Z,wellNameStyle:I.wellNameFixed,wellNameWidth:We,isViewOnly:Q,isImperial:Pe,isLimitedOffsetwells:$,maxOffsetwellNumber:_,wellSections:ee,setActiveWellId:te,viewType:re,newCheckedWellId:null!=e&&e.moveTo?me:0,setNewCheckedWellId:de,index:null!=e&&e.moveTo?t:0,flyDuration:null!=e&&e.moveTo?De.current:0,isWDUser:ie})]},e.id)})),!X&&h(j,{children:h(C,{className:I.loadingCell,children:h("span",{children:"Loading..."})})}),h(j,{children:h(C,{className:I.bottomShadow})})]})}),O&&h(b,{fullscreen:!1,className:I.loadingContainer})]}):null};O.propTypes={open:m.bool.isRequired,isTableLoading:m.bool.isRequired,companyId:m.number.isRequired,subjectWellId:m.number.isRequired,sortBy:m.string.isRequired,setSortBy:m.func.isRequired,sortDirection:m.string.isRequired,setSortDirection:m.func.isRequired,columnsWithDict:m.arrayOf(m.shape({})).isRequired,wells:m.arrayOf(m.shape({})).isRequired,metricsKeys:m.arrayOf(m.string).isRequired,setMetricsKeys:m.func.isRequired,handleChanageOffsetWell:m.func.isRequired,handleChangeAllOffsetWells:m.func.isRequired,handleAddRemoveAssets:m.func.isRequired,setIsWellNameExpand:m.func.isRequired,isWellNameExpand:m.bool.isRequired,isHscrollMoved:m.bool.isRequired,onHideAdvancedSearch:m.func.isRequired,isViewOnly:m.bool.isRequired,isLastWell:m.bool.isRequired,isLimitedOffsetwells:m.bool.isRequired,maxOffsetwellNumber:m.number.isRequired,contentRef:m.shape().isRequired,wellSections:m.arrayOf(m.shape({})).isRequired,setActiveWellId:m.func.isRequired,viewType:m.string.isRequired,isWDUser:m.bool.isRequired};var E=r(O);export{E as default};
@@ -1,5 +1,5 @@
1
1
  declare const _default: import("react").MemoExoticComponent<{
2
- ({ columnsWithDict, data, subjectWellId, metricsKeys, metricsColumns, handleChanageOffsetWell, isWellNameExpand, wellNameStyle, wellNameWidth, isViewOnly, isImperial, isLimitedOffsetwells, maxOffsetwellNumber, wellSections, setActiveWellId, viewType, newCheckedWellId, setNewCheckedWellId, index, flyDuration, }: {
2
+ ({ columnsWithDict, data, subjectWellId, metricsKeys, metricsColumns, handleChanageOffsetWell, isWellNameExpand, wellNameStyle, wellNameWidth, isViewOnly, isImperial, isLimitedOffsetwells, maxOffsetwellNumber, wellSections, setActiveWellId, viewType, newCheckedWellId, setNewCheckedWellId, index, flyDuration, isWDUser, }: {
3
3
  columnsWithDict: any;
4
4
  data: any;
5
5
  subjectWellId: any;
@@ -20,6 +20,7 @@ declare const _default: import("react").MemoExoticComponent<{
20
20
  setNewCheckedWellId: any;
21
21
  index: any;
22
22
  flyDuration: any;
23
+ isWDUser: any;
23
24
  }): JSX.Element;
24
25
  propTypes: {
25
26
  columnsWithDict: PropTypes.Validator<PropTypes.InferProps<{}>[]>;
@@ -49,6 +50,7 @@ declare const _default: import("react").MemoExoticComponent<{
49
50
  setNewCheckedWellId: PropTypes.Validator<(...args: any[]) => any>;
50
51
  index: PropTypes.Validator<number>;
51
52
  flyDuration: PropTypes.Validator<number>;
53
+ isWDUser: PropTypes.Validator<boolean>;
52
54
  };
53
55
  }>;
54
56
  export default _default;
@@ -1 +1 @@
1
- import e from"@babel/runtime/helpers/slicedToArray";import t from"@babel/runtime/helpers/defineProperty";import{memo as l,useState as i,useRef as a,useCallback as n,useEffect as s,useMemo as r}from"react";import o from"prop-types";import{omit as c,startCase as d,get as m}from"lodash";import u from"classnames";import h from"moment";import{TableRow as f,TableCell as b,Tooltip as y,Checkbox as p,Typography as v}from"@material-ui/core";import{convertValue as w}from"../../../../utils/index.js";import{ColumnType as N,ROW_HEIGHT as g,ViewType as R,EXPANED_WELLNAME_WIDTH as W,LEAVE_TOUCH_DELAY as k,StatusOptions as C}from"../../constants.js";import{SubjectWellMark as T}from"./SubjectWellMark.js";import q from"./OffsetWellsTableRow.module.css.js";import x from"./ViewWellSectionsName.js";import{jsxs as O,jsx as D}from"react/jsx-runtime";var S="OffsetWellsTableRow";function j(e,t,l){var i=t.find((function(e){return e.key===l})),a=m(e,i.key);return"undefined"===a?"loading...":Number.isFinite(a)||a?i.unitType?w(a,i.unitType,i.from,i.to):a:"—"}function I(e,t){var l=m(e,N.distance);return Number.isFinite(l)?t?l:w(l,"length","mi","km"):"—"}function M(e,t){var l=e.find((function(e){return e.key===t}));return(null==l?void 0:l.width)||0}var _=function(l){var o,m,w,_=l.columnsWithDict,A=l.data,L=l.subjectWellId,Y=l.metricsKeys,z=l.metricsColumns,E=l.handleChanageOffsetWell,V=l.isWellNameExpand,F=l.wellNameStyle,P=l.wellNameWidth,K=l.isViewOnly,B=l.isImperial,H=l.isLimitedOffsetwells,G=l.maxOffsetwellNumber,J=l.wellSections,Q=l.setActiveWellId,U=l.viewType,X=l.newCheckedWellId,Z=l.setNewCheckedWellId,$=l.index,ee=l.flyDuration,te=L===A.id,le=t({},q.subjectWellRow,te),ie=i(A.checked),ae=e(ie,2),ne=ae[0],se=ae[1],re=a(),oe=!1,ce=A[N.name]||"—",de=ce;if(!V&&2*P<8*ce.length){var me=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 l=Math.ceil(t.clientWidth);return document.body.removeChild(t),l}(ce);if(me>2*P){var ue=2*P/(me/ce.length);de="".concat(ce.substring(0,ue/2-2),"\n... ").concat(ce.substring(ce.length-ue/2+6)),oe=!0}}var he=n((function(e,t,l,i,a){var n=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0,s=t-e;re.current.style.position="absolute",re.current.style.top="".concat(e,"px"),re.current.style.zIndex=l===i?4:3,re.current.style.transition="transform ".concat(a,"ms ease ").concat(50*n,"ms"),re.current.style.transform="translateY(".concat(s,"px)")}),[]),fe=n((function(){re.current.style.position="unset",re.current.style.zIndex=1,re.current.style.transition="none",re.current.style.transform="none"}),[]),be=n((function(e){Z(A.id);var t=c(A,"moveTo");E(t,e),se(e)}),[A,Z,E]);s((function(){if(X){var e=$*g+16;if(A.moveTo){var t=e+g*A.moveTo;he(e,t,X,A.id,ee,A.delayTime)}}else fe()}),[A.moveTo,X]),s((function(){se(A.checked)}),[A.checked]);var ye,pe,ve=r((function(){return A[N.wellSection]}),[A]);return O(f,{"data-testid":"".concat(S,"_row_").concat(ce),className:u(q.bodyRow,t({},q.moveRow,1===Math.abs(A.moveTo)&&X!==A.id)),innerRef:re,onMouseEnter:function(){Q(A.id)},onMouseLeave:function(){Q(null)},children:[O(b,{"data-testid":"".concat(S,"_well"),className:u(q.bodyCell,q.wellNameCell,le,(o={},t(o,F,U!==R.mobile),t(o,q.wellNameCellMobile,U===R.mobile),o)),style:{width:V?W:M(_,N.name)},children:[te&&D(T,{className:u(q.subjectWellMark,t({},q.subjectWellMarkMobile,U===R.mobile))}),!te&&D(y,{title:H&&!A.checked?"App can’t process more than (".concat(G-1,") Offset Wells."):"",placement:"bottom-start",classes:{tooltipPlacementBottom:q.checkboxTooltip},children:D("div",{children:D(p,{"data-testid":"".concat(S,"_checkbox"),size:"medium",checked:ne,classes:{disabled:q.checkboxDisabled},disabled:K||H&&!A.checked,onChange:function(e){return be(e.target.checked)}})})}),D(y,{title:oe?ce:"",children:D(v,{variant:"body2",className:u(q.wellNameCursor,(m={},t(m,q.cellDataViewOnly,te),t(m,q.wellNamePreWrap,oe),m)),children:oe?de:ce})})]}),D(b,{"data-testid":"".concat(S,"_dot"),className:u(q.bodyCell,le),style:{width:M(_,N.status)},children:!te&&D(y,{title:d(A[N.status]),enterTouchDelay:U===R.mobile&&0,leaveTouchDelay:U===R.mobile&&k,children:D("div",{className:q.statusContainer,children:D("div",{"data-testid":"".concat(S,"_color"),className:q.status,style:{background:null===(w=C.find((function(e){return e.value===A[N.status]})))||void 0===w?void 0:w.color}})})})}),D(b,{"data-testid":"".concat(S,"_rig"),className:u(q.bodyCell,le),style:{width:M(_,N.rig)},children:D(v,{variant:"body2",className:q.cellData,children:A[N.rig]&&"Null"!==A[N.rig]?A[N.rig]:"—"})}),D(b,{"data-testid":"".concat(S,"_distance"),className:u(q.bodyCell,le),style:{width:M(_,N.distance)},children:D(v,{variant:"body2",className:q.cellData,children:I(A,B)})}),D(b,{"data-testid":"".concat(S,"_lastActive"),className:u(q.bodyCell,le),style:{width:M(_,N.lastActive)},children:D(v,{variant:"body2",className:q.cellData,children:A[N.lastActive]&&Number.isFinite(A[N.lastActive])?h.unix(A[N.lastActive]).format("MM/DD/YYYY"):"—"})}),Y.map((function(e){return D(b,{"data-testid":"".concat(S,"_").concat(e),className:u(q.bodyCell,le),style:{width:M(_,e)},children:D(v,{variant:"body2",className:q.cellData,children:j(A,z,e)})},e)})),D(b,{"data-testid":"".concat(S,"_wellSection"),className:u(q.bodyCell,q.lastCell,le),style:{width:M(_,N.wellSection)},children:ve&&ve.length>1?D(y,{classes:{tooltip:q.customTooltip},title:D(x,{wellSectionNames:ve}),children:D("div",{className:q.sectionLength,children:ve.length})}):D(y,{title:ve||"",children:D(v,{variant:"body2",className:q.cellData,style:{color:ve&&1===ve.length&&(ye=ve,pe=e(ye,1)[0],J.find((function(e){return e.label===pe})).color)},children:ve})})})]})};_.propTypes={columnsWithDict:o.arrayOf(o.shape({})).isRequired,data:o.shape({id:o.number,checked:o.bool,name:o.string,status:o.string,moveTo:o.number,delayTime:o.number}).isRequired,subjectWellId:o.number.isRequired,metricsKeys:o.arrayOf(o.string).isRequired,metricsColumns:o.arrayOf(o.shape({})).isRequired,handleChanageOffsetWell:o.func.isRequired,isWellNameExpand:o.bool.isRequired,wellNameStyle:o.string.isRequired,wellNameWidth:o.number.isRequired,isViewOnly:o.bool.isRequired,isImperial:o.bool.isRequired,isLimitedOffsetwells:o.bool.isRequired,maxOffsetwellNumber:o.number.isRequired,wellSections:o.arrayOf(o.shape({})).isRequired,setActiveWellId:o.func.isRequired,viewType:o.string.isRequired,newCheckedWellId:o.number.isRequired,setNewCheckedWellId:o.func.isRequired,index:o.number.isRequired,flyDuration:o.number.isRequired};var A=l(_);export{A as default};
1
+ import e from"@babel/runtime/helpers/slicedToArray";import t from"@babel/runtime/helpers/defineProperty";import{memo as i,useState as l,useRef as n,useCallback as a,useEffect as s,useMemo as r}from"react";import o from"prop-types";import{omit as c,startCase as d,get as m}from"lodash";import u from"classnames";import f from"moment";import{TableRow as h,TableCell as b,Tooltip as y,Checkbox as p,Typography as v}from"@material-ui/core";import{convertValue as w}from"../../../../utils/index.js";import{ColumnType as N,ROW_HEIGHT as g,ViewType as W,EXPANED_WELLNAME_WIDTH as R,LEAVE_TOUCH_DELAY as k,StatusOptions as C}from"../../constants.js";import{SubjectWellMark as T}from"./SubjectWellMark.js";import q from"./OffsetWellsTableRow.module.css.js";import x from"./ViewWellSectionsName.js";import{jsxs as D,jsx as O}from"react/jsx-runtime";var S="OffsetWellsTableRow";function j(e,t,i){var l=t.find((function(e){return e.key===i})),n=m(e,l.key);return"undefined"===n?"loading...":Number.isFinite(n)||n?l.unitType?w(n,l.unitType,l.from,l.to):n:"—"}function I(e,t){var i=m(e,N.distance);return Number.isFinite(i)?t?i:w(i,"length","mi","km"):"—"}function M(e,t){var i=e.find((function(e){return e.key===t}));return(null==i?void 0:i.width)||0}var _=function(i){var o,m,w,_=i.columnsWithDict,A=i.data,L=i.subjectWellId,V=i.metricsKeys,Y=i.metricsColumns,z=i.handleChanageOffsetWell,E=i.isWellNameExpand,F=i.wellNameStyle,P=i.wellNameWidth,H=i.isViewOnly,K=i.isImperial,U=i.isLimitedOffsetwells,B=i.maxOffsetwellNumber,G=i.wellSections,J=i.setActiveWellId,Q=i.viewType,X=i.newCheckedWellId,Z=i.setNewCheckedWellId,$=i.index,ee=i.flyDuration,te=i.isWDUser,ie=L===A.id,le=t({},q.subjectWellRow,ie),ne=l(A.checked),ae=e(ne,2),se=ae[0],re=ae[1],oe=n(),ce=!1,de=A[N.name]||"—",me=de;if(!E&&2*P<8*de.length){var ue=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}(de);if(ue>2*P){var fe=2*P/(ue/de.length);me="".concat(de.substring(0,fe/2-2),"\n... ").concat(de.substring(de.length-fe/2+6)),ce=!0}}var he=a((function(e,t,i,l,n){var a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0,s=t-e;oe.current.style.position="absolute",oe.current.style.top="".concat(e,"px"),oe.current.style.zIndex=i===l?4:3,oe.current.style.transition="transform ".concat(n,"ms ease ").concat(50*a,"ms"),oe.current.style.transform="translateY(".concat(s,"px)")}),[]),be=a((function(){oe.current.style.position="unset",oe.current.style.zIndex=1,oe.current.style.transition="none",oe.current.style.transform="none"}),[]),ye=a((function(e){Z(A.id);var t=c(A,"moveTo");z(t,e),re(e)}),[A,Z,z]);s((function(){if(X){var e=$*g+16;if(A.moveTo){var t=e+g*A.moveTo;he(e,t,X,A.id,ee,A.delayTime)}}else be()}),[A.moveTo,X]),s((function(){re(A.checked)}),[A.checked]);var pe,ve,we=r((function(){return A[N.wellSection]}),[A]),Ne=r((function(){return H?"View only mode. To edit offsets, use ".concat(te?"Offset Selection App":"WellHub","."):U&&!A.checked?"App can’t process more than (".concat(B-1,") Offset Wells."):""}),[H,U,A.checked]);return D(h,{"data-testid":"".concat(S,"_row_").concat(de),className:u(q.bodyRow,t({},q.moveRow,1===Math.abs(A.moveTo)&&X!==A.id)),innerRef:oe,onMouseEnter:function(){J(A.id)},onMouseLeave:function(){J(null)},children:[D(b,{"data-testid":"".concat(S,"_well"),className:u(q.bodyCell,q.wellNameCell,le,(o={},t(o,F,Q!==W.mobile),t(o,q.wellNameCellMobile,Q===W.mobile),o)),style:{width:E?R:M(_,N.name)},children:[ie&&O(T,{className:u(q.subjectWellMark,t({},q.subjectWellMarkMobile,Q===W.mobile))}),!ie&&O(y,{title:Ne,placement:"bottom-start",classes:{tooltipPlacementBottom:q.checkboxTooltip},children:O("div",{children:O(p,{"data-testid":"".concat(S,"_checkbox"),size:"medium",checked:se,classes:{disabled:q.checkboxDisabled},disabled:H||U&&!A.checked,onChange:function(e){return ye(e.target.checked)}})})}),O(y,{title:ce?de:"",children:O(v,{variant:"body2",className:u(q.wellNameCursor,(m={},t(m,q.cellDataViewOnly,ie),t(m,q.wellNamePreWrap,ce),m)),children:ce?me:de})})]}),O(b,{"data-testid":"".concat(S,"_dot"),className:u(q.bodyCell,le),style:{width:M(_,N.status)},children:!ie&&O(y,{title:d(A[N.status]),enterTouchDelay:Q===W.mobile&&0,leaveTouchDelay:Q===W.mobile&&k,children:O("div",{className:q.statusContainer,children:O("div",{"data-testid":"".concat(S,"_color"),className:q.status,style:{background:null===(w=C.find((function(e){return e.value===A[N.status]})))||void 0===w?void 0:w.color}})})})}),O(b,{"data-testid":"".concat(S,"_rig"),className:u(q.bodyCell,le),style:{width:M(_,N.rig)},children:O(v,{variant:"body2",className:q.cellData,children:A[N.rig]&&"Null"!==A[N.rig]?A[N.rig]:"—"})}),O(b,{"data-testid":"".concat(S,"_distance"),className:u(q.bodyCell,le),style:{width:M(_,N.distance)},children:O(v,{variant:"body2",className:q.cellData,children:I(A,K)})}),O(b,{"data-testid":"".concat(S,"_lastActive"),className:u(q.bodyCell,le),style:{width:M(_,N.lastActive)},children:O(v,{variant:"body2",className:q.cellData,children:A[N.lastActive]&&Number.isFinite(A[N.lastActive])?f.unix(A[N.lastActive]).format("MM/DD/YYYY"):"—"})}),V.map((function(e){return O(b,{"data-testid":"".concat(S,"_").concat(e),className:u(q.bodyCell,le),style:{width:M(_,e)},children:O(v,{variant:"body2",className:q.cellData,children:j(A,Y,e)})},e)})),O(b,{"data-testid":"".concat(S,"_wellSection"),className:u(q.bodyCell,q.lastCell,le),style:{width:M(_,N.wellSection)},children:we&&we.length>1?O(y,{classes:{tooltip:q.customTooltip},title:O(x,{wellSectionNames:we}),children:O("div",{className:q.sectionLength,children:we.length})}):O(y,{title:we||"",children:O(v,{variant:"body2",className:q.cellData,style:{color:we&&1===we.length&&(pe=we,ve=e(pe,1)[0],G.find((function(e){return e.label===ve})).color)},children:we})})})]})};_.propTypes={columnsWithDict:o.arrayOf(o.shape({})).isRequired,data:o.shape({id:o.number,checked:o.bool,name:o.string,status:o.string,moveTo:o.number,delayTime:o.number}).isRequired,subjectWellId:o.number.isRequired,metricsKeys:o.arrayOf(o.string).isRequired,metricsColumns:o.arrayOf(o.shape({})).isRequired,handleChanageOffsetWell:o.func.isRequired,isWellNameExpand:o.bool.isRequired,wellNameStyle:o.string.isRequired,wellNameWidth:o.number.isRequired,isViewOnly:o.bool.isRequired,isImperial:o.bool.isRequired,isLimitedOffsetwells:o.bool.isRequired,maxOffsetwellNumber:o.number.isRequired,wellSections:o.arrayOf(o.shape({})).isRequired,setActiveWellId:o.func.isRequired,viewType:o.string.isRequired,newCheckedWellId:o.number.isRequired,setNewCheckedWellId:o.func.isRequired,index:o.number.isRequired,flyDuration:o.number.isRequired,isWDUser:o.bool.isRequired};var A=i(_);export{A as default};
@@ -0,0 +1,9 @@
1
+ /// <reference types="react" />
2
+ import { BadgeIconStatus } from './constants';
3
+ declare type DQChipProps = {
4
+ className?: string;
5
+ type: BadgeIconStatus;
6
+ };
7
+ export declare const DQChip: ({ type, className }: DQChipProps) => JSX.Element;
8
+ export {};
9
+ //# sourceMappingURL=DQChip.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DQChip.d.ts","sourceRoot":"","sources":["../../../src/components/StatusBadge/DQChip.tsx"],"names":[],"mappings":";AASA,OAAO,EAAa,eAAe,EAAuB,MAAM,aAAa,CAAC;AAyC9E,aAAK,WAAW,GAAG;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,eAAe,CAAC;CACvB,CAAC;AAEF,eAAO,MAAM,MAAM,wBAAuD,WAAW,KAAG,WAoBvF,CAAC"}
@@ -0,0 +1 @@
1
+ import{__assign as a}from'./../../ext-esm/tslib/tslib.es6.js';import{jsx as r}from"react/jsx-runtime";import t from"classnames";import{makeStyles as o}from"@material-ui/core";import i from"../Chip/index.js";import{Tooltip as n}from"../Tooltip/Tooltip.js";import{DQStatusIcon as e}from"./DQStatusIcon.js";import{BADGE_ICON_STATUSES as c,ICON_SIZE as s}from"./constants.js";var m,p,l=((m={})[c.error]="/static/media/5124c957601b1a0ef1f0b93bce1ae0de.svg",m[c.warning]="/static/media/1aa187dca9a802ede389885e43aff155.svg",m[c.success]="/static/media/66745cf3868fdb983d0a2180a43b0720.svg",m),u=((p={})[c.error]="Data has not been checked",p[c.warning]="Unknown Quality Control status",p[c.success]="Automated and Manual Quality Control process in Corva",p),d=o((function(a){return{chipWrapper:{maxWidth:129},chip:{height:20},warning:{background:"rgba(255, 193, 7, 0.16) !important","& .MuiChip-icon":{color:"".concat(a.palette.warning.main," !important")}},error:{background:"rgba(244, 67, 54, 0.16) !important","& .MuiChip-icon":{color:"".concat(a.palette.error.main," !important")}},success:{background:"rgba(156, 255, 56, 0.16) !important","& .MuiChip-icon":{color:"".concat(a.palette.success.bright," !important")}}}})),g=function(o){var m=o.type,p=void 0===m?c.warning:m,g=o.className,b=d();return r(n,a({title:u[p],placement:"bottom-start"},{children:r("div",a({className:t(b.chipWrapper,g)},{children:r(i,{className:t(b.chip,b[p]),icon:r(e,{color:p,iconType:p===c.warning?"DQWarning":p,size:s.small}),label:r("img",{src:l[p],alt:p})})}))}))};export{g as DQChip};
@@ -0,0 +1,13 @@
1
+ /// <reference types="react" />
2
+ import { BadgeIconStatus } from './constants';
3
+ declare type IconTypes = BadgeIconStatus | 'DQWarning';
4
+ declare type SizeTypes = 'small' | 'large';
5
+ declare type iconProps = {
6
+ color: IconTypes;
7
+ className?: string;
8
+ iconType: IconTypes;
9
+ size: SizeTypes;
10
+ };
11
+ export declare const DQStatusIcon: ({ color, className, iconType, size }: iconProps) => JSX.Element;
12
+ export {};
13
+ //# sourceMappingURL=DQStatusIcon.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DQStatusIcon.d.ts","sourceRoot":"","sources":["../../../src/components/StatusBadge/DQStatusIcon.tsx"],"names":[],"mappings":";AAGA,OAAO,EAAe,eAAe,EAAE,MAAM,aAAa,CAAC;AAU3D,aAAK,SAAS,GAAG,eAAe,GAAG,WAAW,CAAC;AAC/C,aAAK,SAAS,GAAG,OAAO,GAAG,OAAO,CAAC;AAEnC,aAAK,SAAS,GAAG;IACf,KAAK,EAAE,SAAS,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,SAAS,CAAC;IACpB,IAAI,EAAE,SAAS,CAAC;CACjB,CAAC;AAEF,eAAO,MAAM,YAAY,yCAA0C,SAAS,KAAG,WAO9E,CAAC"}
@@ -0,0 +1 @@
1
+ import{jsx as r}from"react/jsx-runtime";import{makeStyles as o}from"@material-ui/core";import e from"classnames";import{BADGE_ICONS as t}from"./constants.js";var a=o((function(r){return{small:{fontSize:"16px"},large:{fontSize:"26px"},warning:{color:r.palette.warning.main},error:{color:r.palette.error.main},success:{color:r.palette.success.bright}}})),n=function(o){var n=o.color,s=o.className,i=o.iconType,c=o.size,m=t[i],l=a();return r(m,{className:e(l[c],l[n],s)})};export{n as DQStatusIcon};
@@ -0,0 +1,8 @@
1
+ /// <reference types="react" />
2
+ import { AssetData } from '~/components/StatusBadge/constants';
3
+ declare type DQUnvalidatedContentProps = {
4
+ assetsData?: AssetData[];
5
+ };
6
+ export declare const DQUnvalidatedContent: ({ assetsData }: DQUnvalidatedContentProps) => JSX.Element;
7
+ export {};
8
+ //# sourceMappingURL=DQUnvalidatedContent.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DQUnvalidatedContent.d.ts","sourceRoot":"","sources":["../../../src/components/StatusBadge/DQUnvalidatedContent.tsx"],"names":[],"mappings":";AAIA,OAAO,EAAkC,SAAS,EAAE,MAAM,oCAAoC,CAAC;AAkE/F,aAAK,yBAAyB,GAAG;IAC/B,UAAU,CAAC,EAAE,SAAS,EAAE,CAAC;CAC1B,CAAA;AAED,eAAO,MAAM,oBAAoB,mBAAoB,yBAAyB,KAAG,WAoChF,CAAC"}
@@ -0,0 +1 @@
1
+ import{__assign as e}from'./../../ext-esm/tslib/tslib.es6.js';import{jsxs as t,jsx as i}from"react/jsx-runtime";import a from"classnames";import r from"moment";import{makeStyles as n,Typography as o}from"@material-ui/core";import s from"@material-ui/icons/InfoOutlined";import{BADGE_ICON_STATUSES as l,ICON_SIZE as m}from"./constants.js";import{DQStatusIcon as c}from"./DQStatusIcon.js";import{DQChip as p}from"./DQChip.js";var d=n((function(e){return{assetsContainer:{maxHeight:140,marginTop:4,marginBottom:16,overflowX:"auto"},assetWrapper:{display:"flex",whiteSpace:"nowrap",alignItems:"center",marginTop:8},assetName:{maxWidth:160,textOverflow:"ellipsis",overflow:"hidden",flex:1},container:{padding:"8px 4px 16px 4px"},chip:{marginLeft:6,flex:1},datetime:{color:e.palette.primary.text6,marginLeft:12},infoBlock:{alignItems:"center",display:"flex"},infoText:{marginLeft:9,fontSize:12,letterSpacing:"0.4px",lineHeight:"17px"},infoIcon:{color:e.palette.primary.text6},headerContainer:{alignItems:"center",display:"flex"},headerText:{marginLeft:8,lineHeight:"16px",fontSize:"14px",fontWeight:500},text:{lineHeight:"14px",fontSize:"12px",fontWeight:500,letterSpacing:"0.4px"}}})),f=function(n){var f=n.assetsData,x=d();return t("div",e({className:x.container},{children:[t("div",e({className:x.headerContainer},{children:[i(c,{color:l.error,iconType:l.error,size:m.large}),i(o,e({className:a(x.headerText)},{children:"Data Quality: Unvalidated"}))]})),i("div",e({className:x.assetsContainer},{children:null==f?void 0:f.map((function(n){var o=n.status,s=n.id,l=n.name,m=n.datetime;return t("div",e({className:x.assetWrapper},{children:[i("div",e({className:a(x.assetName,x.text)},{children:l})),i(p,{className:x.chip,type:o}),i("div",e({className:a(x.text,x.datetime)},{children:r.unix(m).format("M/D/YYYY h:mm")}))]}),s)}))})),t("div",e({className:x.infoBlock},{children:[i(s,{className:x.infoIcon}),i(o,e({className:x.infoText},{children:"Click on badge to see more details and report problem"}))]}))]}))};export{f as DQUnvalidatedContent};
@@ -1,13 +1,31 @@
1
- export declare const BADGE_ICON_STATUSES: {
2
- success: string;
3
- warning: string;
4
- error: string;
1
+ export declare type BadgeIconStatus = 'warning' | 'error' | 'success';
2
+ export declare type AssetData = {
3
+ status: BadgeIconStatus;
4
+ name: string;
5
+ datetime: number;
6
+ id: number;
7
+ };
8
+ declare type BadgeIconStatuses = {
9
+ success: 'success';
10
+ warning: 'warning';
11
+ error: 'error';
5
12
  };
13
+ export declare const BADGE_ICON_STATUSES: BadgeIconStatuses;
6
14
  export declare const BADGE_ICONS: {
7
- [x: string]: import("@material-ui/core/OverridableComponent").OverridableComponent<import("@material-ui/core").SvgIconTypeMap<{}, "svg">>;
15
+ success: import("@material-ui/core/OverridableComponent").OverridableComponent<import("@material-ui/core").SvgIconTypeMap<{}, "svg">>;
16
+ warning: import("@material-ui/core/OverridableComponent").OverridableComponent<import("@material-ui/core").SvgIconTypeMap<{}, "svg">>;
17
+ DQWarning: import("@material-ui/core/OverridableComponent").OverridableComponent<import("@material-ui/core").SvgIconTypeMap<{}, "svg">>;
18
+ error: import("@material-ui/core/OverridableComponent").OverridableComponent<import("@material-ui/core").SvgIconTypeMap<{}, "svg">>;
8
19
  };
9
20
  export declare const WARNING = "Recommendations may be incorrect based on data quality errors";
10
21
  export declare const TOOLTIPS: {
11
- [x: string]: string;
22
+ success: string;
23
+ warning: string;
24
+ };
25
+ declare type IconSizeType = {
26
+ small: 'small';
27
+ large: 'large';
12
28
  };
29
+ export declare const ICON_SIZE: IconSizeType;
30
+ export {};
13
31
  //# sourceMappingURL=constants.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/components/StatusBadge/constants.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,mBAAmB;;;;CAI/B,CAAC;AAEF,eAAO,MAAM,WAAW;;CAIvB,CAAC;AAEF,eAAO,MAAM,OAAO,kEAAkE,CAAC;AAEvF,eAAO,MAAM,QAAQ;;CAIpB,CAAA"}
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/components/StatusBadge/constants.ts"],"names":[],"mappings":"AAIA,oBAAY,eAAe,GAAG,SAAS,GAAG,OAAO,GAAG,SAAS,CAAC;AAE9D,oBAAY,SAAS,GAAG;IACtB,MAAM,EAAE,eAAe,CAAC;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,EAAE,EAAE,MAAM,CAAC;CACZ,CAAC;AAEF,aAAK,iBAAiB,GAAG;IACvB,OAAO,EAAE,SAAS,CAAC;IACnB,OAAO,EAAE,SAAS,CAAC;IACnB,KAAK,EAAE,OAAO,CAAC;CAChB,CAAC;AAEF,eAAO,MAAM,mBAAmB,EAAE,iBAIjC,CAAC;AAEF,eAAO,MAAM,WAAW;;;;;CAKvB,CAAC;AAEF,eAAO,MAAM,OAAO,kEAAkE,CAAC;AAEvF,eAAO,MAAM,QAAQ;;;CAGpB,CAAA;AAED,aAAK,YAAY,GAAG;IAAE,KAAK,EAAE,OAAO,CAAC;IAAC,KAAK,EAAE,OAAO,CAAA;CAAE,CAAC;AAEvD,eAAO,MAAM,SAAS,EAAE,YAGvB,CAAC"}
@@ -1 +1 @@
1
- import r from"@material-ui/icons/Warning";import{GppGoodIcon as o}from"../Icons/GppGoodIcon.js";import{GppBadIcon as s}from"../Icons/GppBadIcon.js";var n,e,a={success:"success",warning:"warning",error:"error"},i=((n={})[a.success]=o,n[a.warning]=r,n[a.error]=s,n),c="Recommendations may be incorrect based on data quality errors",t=((e={})[a.success]="Everything is Validated",e[a.warning]=c,e[a.error]="",e);export{i as BADGE_ICONS,a as BADGE_ICON_STATUSES,t as TOOLTIPS,c as WARNING};
1
+ import r from"@material-ui/icons/Warning";import{GppGoodIcon as s}from"../Icons/GppGoodIcon.js";import{GppBadIcon as a}from"../Icons/GppBadIcon.js";var n,o,e={success:"success",warning:"warning",error:"error"},i=((n={})[e.success]=s,n[e.warning]=r,n.DQWarning=a,n[e.error]=a,n),c="Recommendations may be incorrect based on data quality errors",m=((o={})[e.success]="Everything is Validated",o[e.warning]=c,o),t={small:"small",large:"large"};export{i as BADGE_ICONS,e as BADGE_ICON_STATUSES,t as ICON_SIZE,m as TOOLTIPS,c as WARNING};
@@ -1,10 +1,12 @@
1
1
  /// <reference types="react" />
2
+ import { BadgeIconStatus, AssetData } from '~/components/StatusBadge/constants';
2
3
  declare type StatusBadgeProps = {
3
- iconType?: 'success' | 'warning' | 'error';
4
+ assetsData?: AssetData[];
5
+ iconType?: BadgeIconStatus;
4
6
  isMobile: boolean;
5
7
  lastTimestamp: number;
6
8
  warningMessage?: string;
7
9
  };
8
- export declare const StatusBadge: ({ iconType, lastTimestamp, warningMessage, isMobile, }: StatusBadgeProps) => JSX.Element;
10
+ export declare const StatusBadge: ({ assetsData, iconType, isMobile, lastTimestamp, warningMessage, }: StatusBadgeProps) => JSX.Element;
9
11
  export {};
10
12
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/StatusBadge/index.tsx"],"names":[],"mappings":";AA+CA,aAAK,gBAAgB,GAAG;IACtB,QAAQ,CAAC,EAAE,SAAS,GAAG,SAAS,GAAG,OAAO,CAAC;IAC3C,QAAQ,EAAE,OAAO,CAAC;IAClB,aAAa,EAAE,MAAM,CAAC;IACtB,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB,CAAC;AAEF,eAAO,MAAM,WAAW,2DAKrB,gBAAgB,KAAG,WA4BrB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/StatusBadge/index.tsx"],"names":[],"mappings":";AAIA,OAAO,EAKL,eAAe,EACf,SAAS,EACV,MAAM,oCAAoC,CAAC;AA2D5C,aAAK,gBAAgB,GAAG;IACtB,UAAU,CAAC,EAAE,SAAS,EAAE,CAAC;IACzB,QAAQ,CAAC,EAAE,eAAe,CAAC;IAC3B,QAAQ,EAAE,OAAO,CAAC;IAClB,aAAa,EAAE,MAAM,CAAC;IACtB,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB,CAAC;AAEF,eAAO,MAAM,WAAW,uEAMrB,gBAAgB,KAAG,WA6CrB,CAAC"}
@@ -1 +1 @@
1
- import{__assign as e}from'./../../ext-esm/tslib/tslib.es6.js';import{jsx as t,jsxs as n}from"react/jsx-runtime";import a from"moment";import r from"classnames";import{makeStyles as i,Typography as o}from"@material-ui/core";import{Tooltip as s}from"../Tooltip/Tooltip.js";import{BADGE_ICONS as c,TOOLTIPS as p,WARNING as l,BADGE_ICON_STATUSES as m}from"./constants.js";var g=i((function(e){return{statusBadgeWrapper:{backgroundColor:e.palette.background.b4,display:"flex",height:30},statusBadgeContent:{display:"flex",flexDirection:function(e){return e.isWarningTypeIcon?"row-reverse":"initial"},justifyContent:function(e){return e.isWarningTypeIcon&&"flex-end"},padding:"12px 0 2px 2px",whiteSpace:"nowrap",width:"calc(100% - 140px)"},text:{fontSize:"10px",lineHeight:"12px",alignSelf:"center"},timestamp:{color:e.palette.primary.text6,marginLeft:function(e){var t=e.isWarningTypeIcon,n=e.isIconType;return!t&&n&&8}},warningMessage:{color:e.palette.primary.text1,marginLeft:4,textOverflow:"ellipsis",overflow:"hidden",fontSize:"12px"},badgeIcon:{fontSize:"16px"},warning:{color:e.palette.warning.main,marginLeft:8},error:{color:e.palette.error.main},success:{color:e.palette.success.bright}}})),d=function(i){var d=i.iconType,f=i.lastTimestamp,u=i.warningMessage,x=i.isMobile,y=d==m.warning,h=g({isWarningTypeIcon:y,isIconType:!!d}),w=c[d],b=p[d];return u&&(b="".concat(p[d],". ").concat(u)),t("div",e({className:h.statusBadgeWrapper},{children:n("div",e({className:h.statusBadgeContent},{children:[y&&!x&&t(o,e({variant:"body1",className:r(h.text,h.warningMessage)},{children:u?"".concat(l,". ").concat(u):l})),d&&t(s,e({title:b,placement:"top"},{children:t(w,{className:r(h.badgeIcon,h[d])})})),n(o,e({variant:"body1",className:r(h.text,h.timestamp)},{children:["Last Update: ",a.unix(f).format("M/D/YYYY h:mm a")]}))]}))}))};export{d as StatusBadge};
1
+ import{__assign as e}from'./../../ext-esm/tslib/tslib.es6.js';import{jsx as t,jsxs as n}from"react/jsx-runtime";import a from"moment";import i from"classnames";import{makeStyles as o,Typography as r}from"@material-ui/core";import{Tooltip as s}from"../Tooltip/Tooltip.js";import{TOOLTIPS as p,WARNING as l,ICON_SIZE as c,BADGE_ICON_STATUSES as m}from"./constants.js";import{DQStatusIcon as d}from"./DQStatusIcon.js";import{DQUnvalidatedContent as g}from"./DQUnvalidatedContent.js";var f=o((function(e){return{statusBadgeWrapper:{backgroundColor:e.palette.background.b4,display:"flex",height:30},statusBadgeContent:{display:"flex",flexDirection:function(e){return e.isWarningTypeIcon?"row-reverse":"initial"},justifyContent:function(e){return e.isWarningTypeIcon&&"flex-end"},padding:"12px 0 2px 2px",whiteSpace:"nowrap",width:"calc(100% - 140px)"},text:{fontSize:"10px",lineHeight:"12px",alignSelf:"center"},timestamp:{color:e.palette.primary.text6,marginLeft:function(e){var t=e.isWarningTypeIcon,n=e.isIconType;return!t&&n&&8}},warningMessage:{color:e.palette.primary.text1,marginLeft:4,textOverflow:"ellipsis",overflow:"hidden",fontSize:"12px"},badgeIconWarning:{marginLeft:8},popper:function(t){return{"& .MuiTooltip-tooltip":{maxWidth:455,width:t.isScrollable?455:439,padding:4,fontSize:12,boxShadow:"0px 0px 4px 2px rgb(0 0 0 / 12%)",fontWeight:400,lineHeight:"16px",letterSpacing:"0.4px",backgroundColor:e.palette.background.b9}}}}})),u=function(o){var u,x=o.assetsData,h=void 0===x?[]:x,b=o.iconType,y=o.isMobile,v=o.lastTimestamp,w=o.warningMessage,T=b==m.warning,S=b==m.error,W=f({isWarningTypeIcon:T,isIconType:!!b,isScrollable:(null==h?void 0:h.length)>5}),I=p[b];return T&&w&&(I="".concat(p[b],". ").concat(w)),S&&(I=t(g,{assetsData:h})),t("div",e({className:W.statusBadgeWrapper},{children:n("div",e({className:W.statusBadgeContent},{children:[T&&!y&&t(r,e({className:i(W.text,W.warningMessage),variant:"body1"},{children:w?"".concat(l,". ").concat(w):l})),b&&t(s,e({PopperProps:S&&{className:W.popper},placement:"top",title:I},{children:t("div",{children:t(d,{className:i((u={},u[W.badgeIconWarning]=T,u)),color:b,iconType:b,size:c.small})})})),n(r,e({className:i(W.text,W.timestamp),variant:"body1"},{children:["Last Update: ",a.unix(v).format("M/D/YYYY h:mm a")]}))]}))}))};export{u as StatusBadge};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@corva/ui",
3
- "version": "0.53.0-6",
3
+ "version": "0.53.0-rc.0",
4
4
  "description": "Shared components/utils for Corva ui projects",
5
5
  "keywords": [
6
6
  "corva-ui"