@corva/ui 0.50.0-rc.4 → 0.50.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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VirtualizedTable.d.ts","sourceRoot":"","sources":["../../../src/components/VirtualizedTable/VirtualizedTable.tsx"],"names":[],"mappings":";AACA,OAAO,SAAS,MAAM,YAAY,CAAC;AA4FnC,aAAK,8BAA8B,GAAG,SAAS,CAAC,UAAU,CAAC,OAAO,kCAAkC,CAAC,CAAC;AAEtG,eAAO,MAAM,yBAAyB;sQAmBnC,8BAA8B,GAAG,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"VirtualizedTable.d.ts","sourceRoot":"","sources":["../../../src/components/VirtualizedTable/VirtualizedTable.tsx"],"names":[],"mappings":";AACA,OAAO,SAAS,MAAM,YAAY,CAAC;AA4FnC,aAAK,8BAA8B,GAAG,SAAS,CAAC,UAAU,CAAC,OAAO,kCAAkC,CAAC,CAAC;AAEtG,eAAO,MAAM,yBAAyB;sQAmBnC,8BAA8B,GAAG,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6K9C,CAAA;AAED,QAAA,MAAM,kCAAkC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwCvC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAaF,wBAAgE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__assign as e,__spreadArray as t}from"../../_virtual/_tslib.js";import{jsx as r,
|
|
1
|
+
import{__assign as e,__spreadArray as t}from"../../_virtual/_tslib.js";import{jsx as r,jsxs as n}from"react/jsx-runtime";import{useMemo as i,useEffect as o}from"react";import a from"prop-types";import l from"classnames";import{Table as s,Column as u,SortDirection as c}from"react-virtualized";import{withStyles as d,IconButton as m,Typography as h,Tooltip as f}from"@material-ui/core";import{Settings as g,Sort as p,ArrowUpward as b,ArrowDownward as y}from"@material-ui/icons";import{getUnitDisplay as w}from"../../utils/convert.js";function S(e,t){var r=e.find((function(e){return e.key===t}))||{},n=r.unitType,i=r.customUnit;return i?"(".concat(i,")"):n?"(".concat(w(n),")"):""}function R(e,t){return(e.find((function(e){return e.key===t}))||{}).headerLabelClassName||""}function x(e,t){return(e.find((function(e){return e.key===t}))||{}).headerLabelUnitClassName||""}var v=function(a){var d=a.columns,w=a.data,v=a.useColumnSetting,C=a.useFixedColumnWidth,_=a.onOpenSettingDlg,z=a.classes,k=a.width,T=a.height,q=a.headerHeight,I=a.rowHeight,N=a.showTopSettingIcon,L=a.customMuiStyles,D=a.isTopSettingIconShownAlways,H=a.CustomCellRenderer,B=a.customRowStyle,W=a.sort,O=a.sortBy,j=a.sortDirection,A=e(e({},z),L),F=i((function(){return{label:"",key:"setting",width:v?25:0}}),[v]),K=i((function(){return d.filter((function(e){return e.show}))}),[d]),V=i((function(){return v?t(t([],K,!0),[F],!1):K}),[K,v,F]),M=i((function(){var e;if(k<=0)return{};var t=((e={})[F.key]=F.width,e),r=[];return K.filter((function(e){return Number.isFinite(e.width)})).forEach((function(e){t[e.key]=e.width-1,r.push(e.width-1)})),K.filter((function(e){return!Number.isFinite(e.width)})).forEach((function(e){var n=r.reduce((function(e,t){return e+t}),0),i=Math.floor((k-n-F.width)/(K.length-r.length)),o=e.minWidth||65,a=i<o?o:i;t[e.key]=a-1,r.push(a-1)})),t}),[k,K,F]),E=i((function(){return Object.values(M).reduce((function(e,t){return e+t}),0)}),[M]),G=D||E-12.5>=k;o((function(){N(G)}),[G]);var U=function(t){var i=t.label,o=t.dataKey,a=O||j||W;return o===F.key?G?null:r(m,e({size:"small","aria-label":"customize columns",className:A.settingIcon,onClick:_},{children:r(g,{fontSize:"inherit"})})):n(h,e({variant:"body2",className:l(A.headerLabel,R(d,o))},{children:[i," ",r("span",e({className:l(A.unitLabel,x(d,o))},{children:S(d,o)})),a&&o!==O&&r(f,e({title:"Sort A-Z"},{children:r(p,{fontSize:"small",className:z.sortIcon})})),a&&o===O&&(j===c.ASC?r(b,{fontSize:"small",className:z.sortIcon}):r(y,{fontSize:"small",className:z.sortIcon}))]}))},P=function(t){var n=t.dataKey,i=t.rowData;return H?r(H,{columnKey:n,value:i[n]}):r(h,e({variant:"body2",className:A.cellData},{children:i[n]}))};return r(s,e({width:C?E:k,height:T,headerHeight:q,rowClassName:function(e){var t,r=e.index;return l(((t={})[A.oddRow]=r%2==1,t))},rowHeight:I,rowCount:w.length,rowGetter:function(e){var t=e.index;return w[t]},rowStyle:B||{},className:A.table,sort:W,sortBy:O,sortDirection:j},{children:V.map((function(e){return r(u,{width:M[e.key]||0,dataKey:e.key,label:e.label,headerRenderer:U,cellRenderer:P},e.key)}))}))},C={columns:a.arrayOf(a.shape({show:a.bool,minWidth:a.number,width:a.number,key:a.string,label:a.string})).isRequired,data:a.arrayOf(a.shape({})).isRequired,useColumnSetting:a.bool.isRequired,useFixedColumnWidth:a.bool.isRequired,headerHeight:a.number.isRequired,rowHeight:a.number.isRequired,width:a.number.isRequired,height:a.number.isRequired,onOpenSettingDlg:a.func.isRequired,showTopSettingIcon:a.func.isRequired,sort:a.func,sortBy:a.string,sortDirection:a.string,classes:a.shape({sortIcon:a.string}).isRequired,customMuiStyles:a.shape({table:a.string,oddRow:a.string,headerLabel:a.string,cellData:a.string,unitLabel:a.string,settingIcon:a.string}).isRequired,isTopSettingIconShownAlways:a.bool.isRequired,CustomCellRenderer:a.func,customRowStyle:a.func};v.propTypes=C,v.defaultProps={CustomCellRenderer:null,customRowStyle:null,sort:null,sortBy:null,sortDirection:null};var _=d((function(e){return{table:{"& .ReactVirtualized__Table__headerRow":{textTransform:"none",borderBottom:e.isLightTheme?"1px solid rgba(224, 224, 224, 1)":"1px solid rgba(81, 81, 81, 1)"},"& .ReactVirtualized__Table__row":{borderBottom:e.isLightTheme?"1px solid rgba(224, 224, 224, 1)":"1px solid rgba(81, 81, 81, 1)"},"& .ReactVirtualized__Table__Grid":{outline:"none"},"& .ReactVirtualized__Table__headerColumn":{outline:"none"}},oddRow:{backgroundColor:e.isLightTheme?"rgba(189, 189, 189, 0.1)":"#303030"},headerLabel:{lineHeight:"14px",fontSize:"12px",fontStyle:"normal",letterSpacing:"-0.25px",display:"flex",alignItems:"center",flexWrap:"wrap"},cellData:{lineHeight:"14px",fontSize:"12px",fontWeight:"normal",fontStyle:"normal",letterSpacing:"0.15px"},unitLabel:{fontSize:"10px",opacity:.5},settingIcon:{padding:"3px",fontSize:"20px"},sortIcon:{fontSize:"16px"}}}))(v);export{v as VirtualizedTableComponent,_ as default};
|
package/package.json
CHANGED
package/utils/bha.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bha.d.ts","sourceRoot":"","sources":["../../src/utils/bha.js"],"names":[],"mappings":"AAwBO,uFASN;AAOM,mDAFK,MAAM,CAKjB;AAEM,
|
|
1
|
+
{"version":3,"file":"bha.d.ts","sourceRoot":"","sources":["../../src/utils/bha.js"],"names":[],"mappings":"AAwBO,uFASN;AAOM,mDAFK,MAAM,CAKjB;AAEM,uDAKN;AA0BM,yFAsCN;AAuCM,iEAkCN;AAGM,8DAEN;AAEM,iEAoFN;AAYM,gFAqBN;AAEM,wDAuBN"}
|
package/utils/bha.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"@babel/runtime/helpers/slicedToArray";import r from"@babel/runtime/helpers/asyncToGenerator";import t from"@babel/runtime/helpers/defineProperty";import a from"@babel/runtime/regenerator";import n from"lodash/get";import i from"lodash/maxBy";import{
|
|
1
|
+
import e from"@babel/runtime/helpers/slicedToArray";import r from"@babel/runtime/helpers/asyncToGenerator";import t from"@babel/runtime/helpers/defineProperty";import a from"@babel/runtime/regenerator";import n from"lodash/get";import i from"lodash/maxBy";import{convertValue as o,getUnitDisplay as s}from"./convert.js";import{getAppStorage as u}from"../clients/jsonApi/index.js";import{COLLECTIONS as l,BHA_FAMILY as c,DRILLSTRING_KEYS as m,MOTOR_CONFIG as b,PERCENTILE_KEYS as p,METRICS_KEYS as f,MAX_INC_LIMIT as d,MAX_DEPTH_LIMIT as N,NON_MAGNETIC_TYPE as h}from"../constants/bha.js";function v(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);r&&(a=a.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,a)}return t}function g(e){for(var r=1;r<arguments.length;r++){var a=null!=arguments[r]?arguments[r]:{};r%2?v(Object(a),!0).forEach((function(r){t(e,r,a[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):v(Object(a)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(a,r))}))}return e}var y,F=function(e,r,t){var a=t.filter((function(t){var a;return t.asset_id===e&&(null===(a=t.data)||void 0===a?void 0:a.id)===r}));return a.length>0?a[0]:[]},O=function(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=null===(e=r.find((function(e){return"bit"===e.family})))||void 0===e?void 0:e.size;return t?"".concat(Math.round(1e3*t)/1e3):t},k=function(e){var r=Number.isFinite(e)?o(e,"length","ft",null,3):0;return"".concat(r," ").concat(s("length"))},j=function(e,r,t,a){var n=e;return!function(e){return e&&-1!==e}(a)?null!=r&&r.company_id&&(n=g({company_id:r.company_id},n)):n=g({company_id:a},n),t&&(n["data.well_sections"]={$in:t}),n},w=(y=r(a.mark((function e(r,t){var n,i,o,s;return a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if((n=r.map((function(e){var r=Number(e._id),a=e.bha_ids||[];return j({asset_id:r,"data.id":{$in:a}},e,null,t)}))).length){e.next=3;break}return e.abrupt("return",[]);case 3:return i={$or:n},o={aggregate:JSON.stringify([{$match:i},{$limit:1e4}])},s=[],e.prev=7,e.next=10,u(l.drillstring.provider,l.drillstring.collection,null,o);case 10:s=e.sent,e.next=16;break;case 13:e.prev=13,e.t0=e.catch(7),s=[];case 16:return e.abrupt("return",s);case 17:case"end":return e.stop()}}),e,null,[[7,13]])}))),function(e,r){return y.apply(this,arguments)}),x=function(e){var r=Object.values(c),t=!1;return e.reduce((function(e,a){var n=a.family,i=a.material;if(t||r.includes(n)||i===h){if(t=!0,r.includes(n)){var o={family:n,bitType:n===c.bit?a.bit_type:""};return e.push(o),e}return e.length&&"other"===e[e.length-1].family||e.push({family:"other",bitType:""}),e}return e}),[])},P=function(e){var r;if(!e.length)return 0;var t=null===(r=i(e,(function(e){var r,t=null===(r=e.data)||void 0===r?void 0:r.components;return x(t).reduce((function(e,r){var t=r.family;return t===c.rss||t===c.pdm?e+2:Object.values(c).includes(t)?e:e+1}),0)})).data)||void 0===r?void 0:r.components;return x(t).reduce((function(e,r){var t=r.family;return t===c.rss||t===c.pdm?e+2:Object.values(c).includes(t)?e:e+1}),0)},_=function(e,r){return parseFloat(parseFloat(e).toFixed(r)).toString()},S=function(e,r){var t;switch(r){case p.ropRotary:case p.ropSlide:case f.netROP:case f.ropRotary:case f.ropSlide:t=Number.isNaN(Number.parseFloat(e))?e:Math.floor(o(e,"velocity","ft/h"));break;case f.distance:case f.holeDepth:t=Number.isNaN(Number.parseFloat(e))?e:Math.floor(o(e,"length","ft"));break;case m.bitToBend:case m.hwdpLength:case f.rotaryFootage:case f.slideFootage:t=Number.isNaN(Number.parseFloat(e))?e:parseFloat(o(e,"length","ft")).fixFloat(2);break;case f.turnRate:case f.buildRate:t=Number.isNaN(Number.parseFloat(e))?e:parseFloat(o(e,"anglePerLength","dp100f")).toFixed(2);break;case f.onBottomTime:case f.totalTime:t=Number.isNaN(Number.parseFloat(e))?e:parseFloat(e).toFixed(2);break;case p.mse:t=Number.isNaN(Number.parseFloat(e))?e:Math.floor(o(e,"msePressure","psi"));break;case p.wob:t=Number.isNaN(Number.parseFloat(e))?e:Math.floor(o(e,"force","klbf"));break;case p.diffPressure:t=Number.isNaN(Number.parseFloat(e))?e:Math.floor(o(e,"pressure","psi"));break;case p.flowIn:t=Number.isNaN(Number.parseFloat(e))?e:Math.floor(o(e,"volumeFlowRate","gal/min"));break;case m.tfa:t=Number.isNaN(parseFloat(e))?e:parseFloat(e).fixFloat(2);break;case m.holeSize:t=Number.isNaN(Number.parseFloat(e))?e:_(o(e,"shortLength","in"),3);break;case m.motorSize:t=Number.isNaN(Number.parseFloat(e))?e:_(o(e,"shortLength","in"),2);break;case b.outer_diameter:t=Number.isNaN(Number.parseFloat(e))?e:_(o(e,"shortLength","in"),1);break;case m.motorBend:t=Number.isNaN(Number.parseFloat(e))?e:_(e,2);break;default:t=Number.isNaN(Number.parseFloat(e))?e:Math.floor(e)}return t},M=function(r,t,a){var n="inc"===a?d:parseInt(o(N,"length","ft"),10),i=[r,t].reduce((function(e,r){var t;return t=Number.isFinite(r)?n>=r?null:function(e){var r="inc"===e?d:parseInt(o(N,"length","ft"),10);return"Must be within 0 ~ ".concat(r)}(a):"Invalid value",e.concat([t])}),[]),s=e(i,2),u=s[0],l=s[1];return Number.isFinite(r)&&Number.isFinite(t)&&r>=t?["Should be less than max value","Should be greater than min value"]:[u,l]},T=function(e){var r=[];return e.forEach((function(e){var t=e.family,a=e.material,i=e.stabilizer;["bit","pdm","rss","stabilizer","ur"].includes(t)?r.push({family:t,hasStabilizer:!!i,bitType:n(e,"bit_type")}):"Non Magnetic"!==a||0!==r.length&&r.slice(-1)[0].material===a||r.push({family:"other",material:a})})),r};export{P as calculateBHALengthMax,F as getBHAInformation,T as getBHASchematic,O as getBhaBitSize,k as getBhaDepthIn,M as getErrors,S as getUnitConvertedValue,w as loadDrillStringData,_ as removeZero};
|