@corva/ui 0.84.0-17 → 0.84.0-19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs-bundle/components/AdvancedSlider/AdvancedSlider.js +1 -1
- package/cjs-bundle/components/AdvancedSlider/styles/sliderStyles.js +1 -1
- package/cjs-bundle/components/AdvancedSlider/utils.js +1 -1
- package/cjs-bundle/components/PadModeSelect/PadModeSelect.js +1 -1
- package/components/AdvancedSlider/AdvancedSlider.d.ts.map +1 -1
- package/components/AdvancedSlider/AdvancedSlider.js +1 -1
- package/components/AdvancedSlider/styles/sliderStyles.d.ts +1 -1
- package/components/AdvancedSlider/styles/sliderStyles.d.ts.map +1 -1
- package/components/AdvancedSlider/styles/sliderStyles.js +1 -1
- package/components/AdvancedSlider/utils.d.ts +13 -0
- package/components/AdvancedSlider/utils.d.ts.map +1 -1
- package/components/AdvancedSlider/utils.js +1 -1
- package/components/PadModeSelect/PadModeSelect.d.ts.map +1 -1
- package/components/PadModeSelect/PadModeSelect.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@babel/runtime/helpers/slicedToArray"),t=require("@babel/runtime/helpers/defineProperty"),i=require("react"),n=require("re-resizable"),r=require("react-sizeme"),a=require("classnames"),o=require("lodash"),l=require("../shared/useThrottledCallback.js"),d=require("./Handle.js"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@babel/runtime/helpers/slicedToArray"),t=require("@babel/runtime/helpers/defineProperty"),i=require("react"),n=require("re-resizable"),r=require("react-sizeme"),a=require("classnames"),o=require("lodash"),l=require("../shared/useThrottledCallback.js"),d=require("./Handle.js"),s=require("./icons/HandleIcon.js"),u=require("./utils.js"),h=require("./styles/sliderStyles.js");require("./styles/handleStyles.js");var c=require("./constants.js"),f=require("react/jsx-runtime");function m(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var v=m(e),p=m(t),g=m(a);function b(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function y(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?b(Object(i),!0).forEach((function(t){p.default(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):b(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}var w="twoValuesSliderDefault",O=function(e){var t,r,a=e.min,o=e.max,m=e.value,b=e.size,O=e.orientation,j=e.valueFormatter,I=e.displayFormatter,R=e.editableHandles,x=e.onChange,H=e.onStop,A=e.reversed,T=e.handlePosition,_=e.handleClasses,N=e.minimal,P=h.useSliderStyles(),M=i.useRef(null),C=i.useRef(null),E=O===c.HORIZONTAL_ORIENTATION,S=O===c.VERTICAL_ORIENTATION,z=N?b:y(y({},b),{},{width:E?b.width-2*c.INPUT_WIDTH:b.width,height:S?b.height-2*c.INPUT_HEIGHT:b.height}),q=i.useState([j(null==m?void 0:m.at(0)),j(null==m?void 0:m.at(1))]),L=v.default(q,2),W=L[0],k=L[1],G=i.useRef(null),D=i.useState(!1),B=v.default(D,2),F=B[0],V=B[1],X=v.default(W,2),Y=X[0],Z=X[1],U=u.getSizedControls({isHorizontalOrientation:E,size:z,max:o,min:a,tail:Z,head:Y}),J=U.headMaxWidth,K=U.tailMaxWidth,Q=U.headMaxHeight,$=U.tailMaxHeight;i.useEffect((function(){if(!G.current){var e=[j(null==m?void 0:m.at(0)),j(null==m?void 0:m.at(1))],t=Math.min.apply(Math,e),i=Math.max.apply(Math,e);k([t,i])}}),[null==m?void 0:m.at(0),null==m?void 0:m.at(1)]),i.useEffect((function(){if(E){var e=z.width/(o-a)*(Y-a),t=z.width/(o-a)*(o-Z);M.current.updateSize({width:A?t:e,height:z.height}),C.current.updateSize({width:A?e:t,height:z.height})}else if(S){var i=z.height/(o-a)*(Y-a),n=z.height/(o-a)*(o-Z);M.current.updateSize({width:z.width,height:A?n:i}),C.current.updateSize({width:z.width,height:A?i:n})}}),[a,o,Y,Z,z.width,z.height,O]),i.useEffect((function(){var e=function(){document.removeEventListener("mousemove",re),document.removeEventListener("mouseup",ae),document.removeEventListener("touchmove",oe),document.removeEventListener("touchend",le)};return F?(document.addEventListener("mousemove",re),document.addEventListener("mouseup",ae),document.addEventListener("touchmove",oe),document.addEventListener("touchend",le)):(e(),H()),function(){e()}}),[F]);var ee=l.useThrottledCallback((function(e,t,i){G.current="onResize Event";var n=i.clientWidth,r=i.clientHeight,l=Y,d=Z;"right"===t?A?d=j(o-n/z.width*(o-a)):l=j(a+n/z.width*(o-a)):"left"===t?A?l=j(a+n/z.width*(o-a)):d=j(o-n/z.width*(o-a)):"bottom"===t?A?d=j(o-r/z.height*(o-a)):l=j(a+r/z.height*(o-a)):"top"===t&&(A?l=j(a+r/z.height*(o-a)):d=j(o-r/z.height*(o-a))),l=Math.min(l,Z),d=Math.max(d,Y),k([l,d]),x([l,d])})),te=l.useThrottledCallback((function(){G.current=null,H()})),ie=function(e,t){G.current={xPos:e,yPos:t,head:Y,tail:Z}},ne=function(e,t){if(G.current){var i;E?i=(G.current.xPos-e)/z.width*(o-a):S&&(i=(G.current.yPos-t)/z.height*(o-a));var n,r,l=G.current.head-i*(A?-1:1),d=G.current.tail-i*(A?-1:1),s=G.current.tail-G.current.head;l<=a?(n=a,r=a+s):d>=o?(n=o-s,r=o):(n=l,r=d),n=j(n),r=j(r),k([n,r]),x([n,r])}},re=l.useThrottledCallback((function(e){ne(e.clientX,e.clientY)})),ae=l.useThrottledCallback((function(){G.current=null,V(!1)})),oe=l.useThrottledCallback((function(e){ne(e.touches[0].pageX,e.touches[0].pageY)})),le=l.useThrottledCallback((function(){G.current=null,V(!1)})),de=l.useThrottledCallback((function(e){k([e,Z]),x([e,Z])})),se=l.useThrottledCallback((function(e){k([Y,e]),x([Y,e])})),ue=i.useMemo((function(){return(Z-Y)/(o-a)*(S?z.height:z.width)<30}),[a,o,Y,Z]),he=i.useMemo((function(){return(Z-Y)/(o-a)*(S?z.height:z.width)<c.INNER_GAP}),[a,o,Y,Z]),ce=function(e,t){return e/t*(S?z.height:z.width)},fe=i.useMemo((function(){if(N)return{};var e=E?c.HORIZONTAL_MIN_GAP:c.VERTICAL_MIN_GAP;return A?{isRightArrowInvisible:ce(Y,o)<c.MIN_ARROW_GAP,isLeftArrowInvisible:ce(o-Z,o)<c.MIN_ARROW_GAP,distance:(Z-Y)/(o-a)*(S?z.height:z.width)-e}:{isRightArrowInvisible:ce(o-Z,o)<c.MIN_ARROW_GAP,isLeftArrowInvisible:ce(Y,o)<c.MIN_ARROW_GAP,distance:(Z-Y)/(o-a)*(S?z.height:z.width)-e}}),[a,o,Y,Z,A]),me=function(e){var t={min:a,max:Z,value:Y,onChange:de},i={min:Y,max:o,value:Z,onChange:se};return"head"===e?f.jsx(d.Handle,y({"data-testid":"".concat(w,"_handle_top"),placement:"head",readOnly:!R,isInsideArrowsVisible:he,arrowsOutsideConfig:fe,displayFormatter:I,orientation:O,classes:_,minimal:N},A?i:t)):"tail"===e?f.jsx(d.Handle,y({"data-testid":"".concat(w,"_handle_bottom"),placement:"tail",readOnly:!R,isInsideArrowsVisible:he,arrowsOutsideConfig:fe,displayFormatter:I,orientation:O,classes:_,minimal:N},A?t:i)):null};return f.jsx("div",{className:g.default(P.rootWrapper,p.default({},P.rootMinimal,N)),children:f.jsxs("div",{className:g.default(P.root,(t={},p.default(t,P.horizontalRoot,E),p.default(t,P.verticalRoot,S),p.default(t,P.minimal,N),t)),children:[f.jsx(n.Resizable,{ref:M,minHeight:0,minWidth:0,maxWidth:A?K:J,maxHeight:A?$:Q,enable:{right:E,bottom:S},handleComponent:{right:me("head"),bottom:me("head")},onResize:ee,onResizeStop:te}),f.jsx("div",{className:P.body,"data-testid":"slider-body",onMouseDown:function(e){ie(e.clientX,e.clientY),V(!0)},onTouchStart:function(e){ie(e.touches[0].pageX,e.touches[0].pageY),V(!0)},children:ue?f.jsx("div",{className:g.default((r={},p.default(r,P.horizontalBodyHandle,E),p.default(r,P.verticalBodyHandle,S),p.default(r,P.leftBodyHandle,"left"===T),p.default(r,P.rightBodyHandle,"right"===T),p.default(r,P.topBodyHandle,"top"===T),p.default(r,P.bottomBodyHandle,"bottom"===T),r)),children:f.jsx("div",{className:P.bodyHandle,"data-testid":"".concat(w,"_handle"),children:f.jsx(s.HandleIcon,{orientation:"vertical",minimal:N})})}):f.jsx("div",{className:P.bodyHandleIcon,"data-testid":"".concat(w,"_handle"),children:f.jsx(s.HandleIcon,{orientation:O,minimal:N})})}),f.jsx(n.Resizable,{ref:C,minHeight:0,minWidth:0,enable:{left:E,top:S},handleComponent:{left:me("tail"),top:me("tail")},onResize:ee,onResizeStop:te})]})})};O.defaultProps={orientation:c.HORIZONTAL_ORIENTATION,valueFormatter:Math.floor,displayFormatter:function(e){return e},onChange:o.noop,onStop:o.noop,reversed:!1,editableHandles:!0,handleClasses:{},minimal:!1};var j=r.withSize({monitorWidth:!0,monitorHeight:!0})(O);exports.AdvancedSlider=O,exports.default=j;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@material-ui/core"),t=e.makeStyles((function(t){return{rootWrapper:{position:"relative",width:"100%",height:"100%",zIndex:100},root:{position:"absolute",width:"100%",height:"100%",zIndex:100,"&:hover $bodyHandle":{visibility:"visible"}},horizontalRoot:{width:"calc(100% - 94px)",left:"47px",display:"flex",alignItems:"center","&::before, &::after":{zIndex:-1,position:"absolute",top:0,content:'""',backgroundColor:t.palette.background.b7,width:1,height:"100%"},"&::before":{left:0},"&::after":{right:0}},verticalRoot:{height:"calc(100% - 40px)",top:20,display:"flex",alignItems:"center",flexDirection:"column","&::before, &::after":{zIndex:-1,position:"absolute",left:0,content:'""',backgroundColor:t.palette.background.b7,width:"100%",height:1},"&::before":{top:0},"&::after":{bottom:0}},body:{position:"relative",flex:1,width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center",userSelect:"none",background:"#3B3B3B66",color:"#BDBDBD","& svg":{fill:"currentColor"},"&:hover":{cursor:"grab",background:"#008BA366",color:"#FFFFFF"},"&:active":{cursor:"grabbing",background:"#008BA366"},"&:active $bodyHandleIcon":{visibility:"visible"},"&:hover $bodyHandleIcon":{visibility:"visible"}},horizontalBodyHandle:{position:"absolute",bottom:-24},verticalBodyHandle:{position:"absolute",left:-24,zIndex:111},leftBodyHandle:{position:"absolute",left:-24,right:"auto"},rightBodyHandle:{position:"absolute",right:-24,left:"auto"},topBodyHandle:{position:"absolute",top:-24,bottom:"auto"},bottomBodyHandle:{position:"absolute",bottom:-24,top:"auto"},bodyHandle:{zIndex:101,width:24,height:24,borderRadius:"50%",background:"#03BCD4",color:"#FFFFFF",display:"flex",alignItems:"center",justifyContent:"center",visibility:"hidden","&:before":{position:"absolute",left:"50%",top:"50%",height:32,width:24,content:'""',transform:"translate(-50%, -50%)",zIndex:1e3}},bodyHandleIcon:{visibility:"hidden"},
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@material-ui/core"),t=e.makeStyles((function(t){return{rootWrapper:{position:"relative",width:"100%",height:"100%",zIndex:100},root:{position:"absolute",width:"100%",height:"100%",zIndex:100,"&:hover $bodyHandle":{visibility:"visible"}},horizontalRoot:{width:"calc(100% - 94px)",left:"47px",display:"flex",alignItems:"center","&::before, &::after":{zIndex:-1,position:"absolute",top:0,content:'""',backgroundColor:t.palette.background.b7,width:1,height:"100%"},"&::before":{left:0},"&::after":{right:0}},verticalRoot:{height:"calc(100% - 40px)",top:20,display:"flex",alignItems:"center",flexDirection:"column","&::before, &::after":{zIndex:-1,position:"absolute",left:0,content:'""',backgroundColor:t.palette.background.b7,width:"100%",height:1},"&::before":{top:0},"&::after":{bottom:0}},body:{position:"relative",flex:1,width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center",userSelect:"none",background:"#3B3B3B66",color:"#BDBDBD","& svg":{fill:"currentColor"},"&:hover":{cursor:"grab",background:"#008BA366",color:"#FFFFFF"},"&:active":{cursor:"grabbing",background:"#008BA366"},"&:active $bodyHandleIcon":{visibility:"visible"},"&:hover $bodyHandleIcon":{visibility:"visible"}},horizontalBodyHandle:{position:"absolute",bottom:-24},verticalBodyHandle:{position:"absolute",left:-24,zIndex:111},leftBodyHandle:{position:"absolute",left:-24,right:"auto"},rightBodyHandle:{position:"absolute",right:-24,left:"auto"},topBodyHandle:{position:"absolute",top:-24,bottom:"auto"},bottomBodyHandle:{position:"absolute",bottom:-24,top:"auto"},bodyHandle:{zIndex:101,width:24,height:24,borderRadius:"50%",background:"#03BCD4",color:"#FFFFFF",display:"flex",alignItems:"center",justifyContent:"center",visibility:"hidden","&:before":{position:"absolute",left:"50%",top:"50%",height:32,width:24,content:'""',transform:"translate(-50%, -50%)",zIndex:1e3}},bodyHandleIcon:{visibility:"hidden"},rootMinimal:{border:"1px solid ".concat(t.palette.background.b9),borderRadius:4},minimal:{width:"100%",height:"100%",top:0,left:0,"&::before, &::after":{display:"none"},"& $body":{"&:hover":{background:"#008BA366"},margin:-1,width:"calc(100% + 2px)",height:"calc(100% + 2px)",backgroundColor:e.fade(t.palette.background.b7,.1),border:"1px solid ".concat(t.palette.primary.text9),borderRadius:4}}}}));exports.useSliderStyles=t;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("./constants.js");exports.getHoverAreaSize=function(t){var e=t.inititalSize,i=t.distance;return i<0?e-Math.abs(i/2):e},exports.getIsInputValueValid=function(e){return t.INPUT_VALUE_REGEX.test(e)&&!Number.isNaN(Number(e))},exports.getSizedControls=function(t){var e=t.isHorizontalOrientation,i=t.size,a=t.max,r=t.min,n=t.head,h=t.tail;return{headMaxWidth:e?i.width/(a-r)*(h-r):i.width,tailMaxWidth:e?i.width/(a-r)*(a-n):i.width,headMaxHeight:e?i.height:i.height/(a-r)*(h-r),tailMaxHeight:e?i.height:i.height/(a-r)*(a-n)}},exports.getValidatedValue=function(t,e,i){return Math.min(Math.max(t,e),i)};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("@babel/runtime/helpers/toConsumableArray"),t=require("@babel/runtime/helpers/slicedToArray"),s=require("react"),a=require("prop-types"),r=require("lodash"),n=require("@material-ui/core"),
|
|
1
|
+
"use strict";var e=require("@babel/runtime/helpers/toConsumableArray"),t=require("@babel/runtime/helpers/slicedToArray"),s=require("react"),a=require("prop-types"),r=require("lodash"),n=require("@material-ui/core"),i=require("../../constants/completion.js"),o=require("../MiddleTruncate/MiddleTruncate.js"),u=require("./WellStreamActivityStatus.js"),l=require("../../utils/completion.js"),d=require("./types.js"),c=require("./effects/useWellStreamActivityTypeSubscription.js"),m=require("react/jsx-runtime");function p(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var f=p(e),S=p(t),v=p(a),h=n.makeStyles({selectFormControl:{maxWidth:"320px",padding:"5px 8px",marginLeft:"auto"},padSelect:{fontSize:"14px","&:before":{borderBottom:0},"&:after":{borderBottom:0},"& .MuiSelect-root":{alignItems:"center",display:"flex"}},menuItem:{display:"flex",justifyContent:"space-between"},menuItemName:{textOverflow:"ellipsis",overflow:"hidden",width:"100%",fontSize:12,lineHeight:"16px"},activeAsset:{fontSize:12,lineHeight:"16px",minWidth:78,display:"flex",alignItems:"center"}}),y=function(e){var t=e.completionAppType,a=e.padModeSetting,p=e.assets,v=e.onChange,y=e.disableActiveWellsInPadSelect,x=s.useState(!1),A=S.default(x,2),b=A[0],I=A[1],M=s.useRef(),g=h(),j=a.mode===d.PadMode.custom?"".concat(d.PadMode.custom,"--").concat(r.first(a.selectedAssets)):a.mode,q=s.useMemo((function(){return p.reduce((function(e,t){return[].concat(f.default(e),[{key:"".concat(d.PadMode.custom,"--").concat(t.id),label:"".concat(t.name),assetId:t.asset_id,wellId:t.id,status:t.status}])}),[])}),[p,t]),P=i.DEFAULT_SUPPORTED_PAD_MODES.concat(r.flatten(r.partition(q,{status:d.AssetStatus.active}))),T=function(e){var t=e.split("--"),s=S.default(t,2),a=s[0],r=s[1],n={mode:a};a===d.PadMode.custom&&(n.mode=d.PadMode.custom,n.selectedAssets=[parseInt(r,10)]),v(n)},O=function(e){return a.mode===d.PadMode.custom&&+r.first(a.selectedAssets)==+e||b},w=P.find((function(e){return e.key===j}));null!=w&&w.assetId&&(M.current=null==w?void 0:w.assetId);var C=c.useWellStreamActivityTypeSubscription({currentWellId:M.current,isStatusShown:!0,withSubscription:!0}),W=l.resolveActiveFracAsset(p)||r.first(p),D=W.status===d.AssetStatus.active,N=s.useState(W.name),E=S.default(N,2),F=E[0],_=E[1];return m.jsxs(m.Fragment,{children:[a.mode!==d.PadMode.custom&&m.jsx(n.Tooltip,{title:F&&F!==W.name?W.name:"",children:m.jsxs("div",{className:g.activeAsset,children:[m.jsx(o,{onTruncate:function(e){_(e)},truncatedText:F,maxWidth:130,children:W.name}),D&&m.jsx(u,{isStatusShown:!0,currentWellId:W.asset_id,subData:r.isEmpty(C)?void 0:C})]})}),m.jsx(n.FormControl,{classes:{root:g.selectFormControl},children:j&&m.jsx(n.Select,{value:j,onChange:function(e){return T(e.target.value)},inputProps:{name:"padModeSelect",id:"pad-mode-select"},className:g.padSelect,onClose:function(){return I(!1)},onOpen:function(){return I(!0)},MenuProps:{anchorOrigin:{vertical:"top",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"center"}},children:P.map((function(e){var t,s=e.key,a=e.label,r=e.assetId,o=e.wellId,l=e.status,c=O(o)&&l===d.AssetStatus.active;return m.jsxs(n.MenuItem,{value:s,className:g.menuItem,disabled:y&&l!==d.AssetStatus.active&&s!==i.COMPLETION_MODES.pad,children:[m.jsx("span",{className:g.menuItemName,children:a}),c&&m.jsx(u,{isStatusShown:O(o),currentWellId:r,subData:(null===(t=M.current)||void 0===t?void 0:t.assetId)===s?C:void 0})]},s)}))})})]})};y.propTypes={padModeSetting:v.default.shape({mode:v.default.string,selectedAssets:v.default.oneOfType([v.default.arrayOf(v.default.string),v.default.arrayOf(v.default.number)])}),assets:v.default.arrayOf(v.default.shape()),completionAppType:v.default.string.isRequired,onChange:v.default.func.isRequired},y.defaultProps={padModeSetting:{},assets:[]},module.exports=y;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AdvancedSlider.d.ts","sourceRoot":"","sources":["../../../src/components/AdvancedSlider/AdvancedSlider.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AdvancedSlider.d.ts","sourceRoot":"","sources":["../../../src/components/AdvancedSlider/AdvancedSlider.js"],"names":[],"mappings":"AAyCO,wDAkZN;;;;;QAKmB,kDAAc"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import t from"@babel/runtime/helpers/slicedToArray";import e from"@babel/runtime/helpers/defineProperty";import{useRef as i,useState as n,useEffect as r,useMemo as o}from"react";import{Resizable as a}from"re-resizable";import{withSize as l}from"react-sizeme";import d from"classnames";import{noop as h}from"lodash";import{useThrottledCallback as s}from"../shared/useThrottledCallback.js";import{Handle as c}from"./Handle.js";import{HandleIcon as u}from"./icons/HandleIcon.js";import{
|
|
1
|
+
import t from"@babel/runtime/helpers/slicedToArray";import e from"@babel/runtime/helpers/defineProperty";import{useRef as i,useState as n,useEffect as r,useMemo as o}from"react";import{Resizable as a}from"re-resizable";import{withSize as l}from"react-sizeme";import d from"classnames";import{noop as h}from"lodash";import{useThrottledCallback as s}from"../shared/useThrottledCallback.js";import{Handle as c}from"./Handle.js";import{HandleIcon as u}from"./icons/HandleIcon.js";import{getSizedControls as m}from"./utils.js";import{useSliderStyles as f}from"./styles/sliderStyles.js";import"./styles/handleStyles.js";import{HORIZONTAL_ORIENTATION as p,INPUT_WIDTH as v,INPUT_HEIGHT as g,INNER_GAP as b,MIN_ARROW_GAP as w,VERTICAL_ORIENTATION as y,HORIZONTAL_MIN_GAP as O,VERTICAL_MIN_GAP as H}from"./constants.js";import{jsx as j,jsxs as x}from"react/jsx-runtime";function z(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function P(t){for(var i=1;i<arguments.length;i++){var n=null!=arguments[i]?arguments[i]:{};i%2?z(Object(n),!0).forEach((function(i){e(t,i,n[i])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):z(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var S="twoValuesSliderDefault",M=function(l){var h,z,M=l.min,C=l.max,E=l.value,L=l.size,R=l.orientation,I=l.valueFormatter,W=l.displayFormatter,A=l.editableHandles,B=l.onChange,D=l.onStop,F=l.reversed,N=l.handlePosition,_=l.handleClasses,X=l.minimal,Y=f(),T=i(null),V=i(null),k=R===p,q=R===y,G=X?L:P(P({},L),{},{width:k?L.width-2*v:L.width,height:q?L.height-2*g:L.height}),J=n([I(null==E?void 0:E.at(0)),I(null==E?void 0:E.at(1))]),K=t(J,2),Q=K[0],U=K[1],Z=i(null),$=n(!1),tt=t($,2),et=tt[0],it=tt[1],nt=t(Q,2),rt=nt[0],ot=nt[1],at=m({isHorizontalOrientation:k,size:G,max:C,min:M,tail:ot,head:rt}),lt=at.headMaxWidth,dt=at.tailMaxWidth,ht=at.headMaxHeight,st=at.tailMaxHeight;r((function(){if(!Z.current){var t=[I(null==E?void 0:E.at(0)),I(null==E?void 0:E.at(1))],e=Math.min.apply(Math,t),i=Math.max.apply(Math,t);U([e,i])}}),[null==E?void 0:E.at(0),null==E?void 0:E.at(1)]),r((function(){if(k){var t=G.width/(C-M)*(rt-M),e=G.width/(C-M)*(C-ot);T.current.updateSize({width:F?e:t,height:G.height}),V.current.updateSize({width:F?t:e,height:G.height})}else if(q){var i=G.height/(C-M)*(rt-M),n=G.height/(C-M)*(C-ot);T.current.updateSize({width:G.width,height:F?n:i}),V.current.updateSize({width:G.width,height:F?i:n})}}),[M,C,rt,ot,G.width,G.height,R]),r((function(){var t=function(){document.removeEventListener("mousemove",pt),document.removeEventListener("mouseup",vt),document.removeEventListener("touchmove",gt),document.removeEventListener("touchend",bt)};return et?(document.addEventListener("mousemove",pt),document.addEventListener("mouseup",vt),document.addEventListener("touchmove",gt),document.addEventListener("touchend",bt)):(t(),D()),function(){t()}}),[et]);var ct=s((function(t,e,i){Z.current="onResize Event";var n=i.clientWidth,r=i.clientHeight,o=rt,a=ot;"right"===e?F?a=I(C-n/G.width*(C-M)):o=I(M+n/G.width*(C-M)):"left"===e?F?o=I(M+n/G.width*(C-M)):a=I(C-n/G.width*(C-M)):"bottom"===e?F?a=I(C-r/G.height*(C-M)):o=I(M+r/G.height*(C-M)):"top"===e&&(F?o=I(M+r/G.height*(C-M)):a=I(C-r/G.height*(C-M))),o=Math.min(o,ot),a=Math.max(a,rt),U([o,a]),B([o,a])})),ut=s((function(){Z.current=null,D()})),mt=function(t,e){Z.current={xPos:t,yPos:e,head:rt,tail:ot}},ft=function(t,e){if(Z.current){var i;k?i=(Z.current.xPos-t)/G.width*(C-M):q&&(i=(Z.current.yPos-e)/G.height*(C-M));var n,r,o=Z.current.head-i*(F?-1:1),a=Z.current.tail-i*(F?-1:1),l=Z.current.tail-Z.current.head;o<=M?(n=M,r=M+l):a>=C?(n=C-l,r=C):(n=o,r=a),n=I(n),r=I(r),U([n,r]),B([n,r])}},pt=s((function(t){ft(t.clientX,t.clientY)})),vt=s((function(){Z.current=null,it(!1)})),gt=s((function(t){ft(t.touches[0].pageX,t.touches[0].pageY)})),bt=s((function(){Z.current=null,it(!1)})),wt=s((function(t){U([t,ot]),B([t,ot])})),yt=s((function(t){U([rt,t]),B([rt,t])})),Ot=o((function(){return(ot-rt)/(C-M)*(q?G.height:G.width)<30}),[M,C,rt,ot]),Ht=o((function(){return(ot-rt)/(C-M)*(q?G.height:G.width)<b}),[M,C,rt,ot]),jt=function(t,e){return t/e*(q?G.height:G.width)},xt=o((function(){if(X)return{};var t=k?O:H;return F?{isRightArrowInvisible:jt(rt,C)<w,isLeftArrowInvisible:jt(C-ot,C)<w,distance:(ot-rt)/(C-M)*(q?G.height:G.width)-t}:{isRightArrowInvisible:jt(C-ot,C)<w,isLeftArrowInvisible:jt(rt,C)<w,distance:(ot-rt)/(C-M)*(q?G.height:G.width)-t}}),[M,C,rt,ot,F]),zt=function(t){var e={min:M,max:ot,value:rt,onChange:wt},i={min:rt,max:C,value:ot,onChange:yt};return"head"===t?j(c,P({"data-testid":"".concat(S,"_handle_top"),placement:"head",readOnly:!A,isInsideArrowsVisible:Ht,arrowsOutsideConfig:xt,displayFormatter:W,orientation:R,classes:_,minimal:X},F?i:e)):"tail"===t?j(c,P({"data-testid":"".concat(S,"_handle_bottom"),placement:"tail",readOnly:!A,isInsideArrowsVisible:Ht,arrowsOutsideConfig:xt,displayFormatter:W,orientation:R,classes:_,minimal:X},F?e:i)):null};return j("div",{className:d(Y.rootWrapper,e({},Y.rootMinimal,X)),children:x("div",{className:d(Y.root,(h={},e(h,Y.horizontalRoot,k),e(h,Y.verticalRoot,q),e(h,Y.minimal,X),h)),children:[j(a,{ref:T,minHeight:0,minWidth:0,maxWidth:F?dt:lt,maxHeight:F?st:ht,enable:{right:k,bottom:q},handleComponent:{right:zt("head"),bottom:zt("head")},onResize:ct,onResizeStop:ut}),j("div",{className:Y.body,"data-testid":"slider-body",onMouseDown:function(t){mt(t.clientX,t.clientY),it(!0)},onTouchStart:function(t){mt(t.touches[0].pageX,t.touches[0].pageY),it(!0)},children:j("div",Ot?{className:d((z={},e(z,Y.horizontalBodyHandle,k),e(z,Y.verticalBodyHandle,q),e(z,Y.leftBodyHandle,"left"===N),e(z,Y.rightBodyHandle,"right"===N),e(z,Y.topBodyHandle,"top"===N),e(z,Y.bottomBodyHandle,"bottom"===N),z)),children:j("div",{className:Y.bodyHandle,"data-testid":"".concat(S,"_handle"),children:j(u,{orientation:"vertical",minimal:X})})}:{className:Y.bodyHandleIcon,"data-testid":"".concat(S,"_handle"),children:j(u,{orientation:R,minimal:X})})}),j(a,{ref:V,minHeight:0,minWidth:0,enable:{left:k,top:q},handleComponent:{left:zt("tail"),top:zt("tail")},onResize:ct,onResizeStop:ut})]})})};M.defaultProps={orientation:p,valueFormatter:Math.floor,displayFormatter:function(t){return t},onChange:h,onStop:h,reversed:!1,editableHandles:!0,handleClasses:{},minimal:!1};var C=l({monitorWidth:!0,monitorHeight:!0})(M);export{M as AdvancedSlider,C as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const useSliderStyles: (props?: any) => import("@material-ui/styles").ClassNameMap<"body" | "root" | "rootWrapper" | "horizontalRoot" | "verticalRoot" | "horizontalBodyHandle" | "verticalBodyHandle" | "leftBodyHandle" | "rightBodyHandle" | "topBodyHandle" | "bottomBodyHandle" | "bodyHandle" | "bodyHandleIcon" | "minimal">;
|
|
1
|
+
export const useSliderStyles: (props?: any) => import("@material-ui/styles").ClassNameMap<"body" | "root" | "rootWrapper" | "horizontalRoot" | "verticalRoot" | "horizontalBodyHandle" | "verticalBodyHandle" | "leftBodyHandle" | "rightBodyHandle" | "topBodyHandle" | "bottomBodyHandle" | "bodyHandle" | "bodyHandleIcon" | "rootMinimal" | "minimal">;
|
|
2
2
|
//# sourceMappingURL=sliderStyles.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sliderStyles.d.ts","sourceRoot":"","sources":["../../../../src/components/AdvancedSlider/styles/sliderStyles.js"],"names":[],"mappings":"AAIA,
|
|
1
|
+
{"version":3,"file":"sliderStyles.d.ts","sourceRoot":"","sources":["../../../../src/components/AdvancedSlider/styles/sliderStyles.js"],"names":[],"mappings":"AAIA,2VAyKI"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{makeStyles as
|
|
1
|
+
import{makeStyles as o,fade as t}from"@material-ui/core";var e=o((function(o){return{rootWrapper:{position:"relative",width:"100%",height:"100%",zIndex:100},root:{position:"absolute",width:"100%",height:"100%",zIndex:100,"&:hover $bodyHandle":{visibility:"visible"}},horizontalRoot:{width:"calc(100% - 94px)",left:"47px",display:"flex",alignItems:"center","&::before, &::after":{zIndex:-1,position:"absolute",top:0,content:'""',backgroundColor:o.palette.background.b7,width:1,height:"100%"},"&::before":{left:0},"&::after":{right:0}},verticalRoot:{height:"calc(100% - 40px)",top:20,display:"flex",alignItems:"center",flexDirection:"column","&::before, &::after":{zIndex:-1,position:"absolute",left:0,content:'""',backgroundColor:o.palette.background.b7,width:"100%",height:1},"&::before":{top:0},"&::after":{bottom:0}},body:{position:"relative",flex:1,width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center",userSelect:"none",background:"#3B3B3B66",color:"#BDBDBD","& svg":{fill:"currentColor"},"&:hover":{cursor:"grab",background:"#008BA366",color:"#FFFFFF"},"&:active":{cursor:"grabbing",background:"#008BA366"},"&:active $bodyHandleIcon":{visibility:"visible"},"&:hover $bodyHandleIcon":{visibility:"visible"}},horizontalBodyHandle:{position:"absolute",bottom:-24},verticalBodyHandle:{position:"absolute",left:-24,zIndex:111},leftBodyHandle:{position:"absolute",left:-24,right:"auto"},rightBodyHandle:{position:"absolute",right:-24,left:"auto"},topBodyHandle:{position:"absolute",top:-24,bottom:"auto"},bottomBodyHandle:{position:"absolute",bottom:-24,top:"auto"},bodyHandle:{zIndex:101,width:24,height:24,borderRadius:"50%",background:"#03BCD4",color:"#FFFFFF",display:"flex",alignItems:"center",justifyContent:"center",visibility:"hidden","&:before":{position:"absolute",left:"50%",top:"50%",height:32,width:24,content:'""',transform:"translate(-50%, -50%)",zIndex:1e3}},bodyHandleIcon:{visibility:"hidden"},rootMinimal:{border:"1px solid ".concat(o.palette.background.b9),borderRadius:4},minimal:{width:"100%",height:"100%",top:0,left:0,"&::before, &::after":{display:"none"},"& $body":{"&:hover":{background:"#008BA366"},margin:-1,width:"calc(100% + 2px)",height:"calc(100% + 2px)",backgroundColor:t(o.palette.background.b7,.1),border:"1px solid ".concat(o.palette.primary.text9),borderRadius:4}}}}));export{e as useSliderStyles};
|
|
@@ -4,4 +4,17 @@ export function getHoverAreaSize({ inititalSize, distance }: {
|
|
|
4
4
|
inititalSize: any;
|
|
5
5
|
distance: any;
|
|
6
6
|
}): any;
|
|
7
|
+
export function getSizedControls({ isHorizontalOrientation, size, max, min, head, tail }: {
|
|
8
|
+
isHorizontalOrientation: any;
|
|
9
|
+
size: any;
|
|
10
|
+
max: any;
|
|
11
|
+
min: any;
|
|
12
|
+
head: any;
|
|
13
|
+
tail: any;
|
|
14
|
+
}): {
|
|
15
|
+
headMaxWidth: any;
|
|
16
|
+
tailMaxWidth: any;
|
|
17
|
+
headMaxHeight: any;
|
|
18
|
+
tailMaxHeight: any;
|
|
19
|
+
};
|
|
7
20
|
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/components/AdvancedSlider/utils.js"],"names":[],"mappings":"AAEO,0EAAkF;AAElF,+DACkE;AAElE;;;QAC8D"}
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/components/AdvancedSlider/utils.js"],"names":[],"mappings":"AAEO,0EAAkF;AAElF,+DACkE;AAElE;;;QAC8D;AAE9D;;;;;;;;;;;;EASL"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{INPUT_VALUE_REGEX as t}from"./constants.js";var
|
|
1
|
+
import{INPUT_VALUE_REGEX as t}from"./constants.js";var i=function(t,i,a){return Math.min(Math.max(t,i),a)},a=function(i){return t.test(i)&&!Number.isNaN(Number(i))},h=function(t){var i=t.inititalSize,a=t.distance;return a<0?i-Math.abs(a/2):i},e=function(t){var i=t.isHorizontalOrientation,a=t.size,h=t.max,e=t.min,n=t.head,r=t.tail;return{headMaxWidth:i?a.width/(h-e)*(r-e):a.width,tailMaxWidth:i?a.width/(h-e)*(h-n):a.width,headMaxHeight:i?a.height:a.height/(h-e)*(r-e),tailMaxHeight:i?a.height:a.height/(h-e)*(h-n)}};export{h as getHoverAreaSize,a as getIsInputValueValid,e as getSizedControls,i as getValidatedValue};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PadModeSelect.d.ts","sourceRoot":"","sources":["../../../src/components/PadModeSelect/PadModeSelect.js"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"PadModeSelect.d.ts","sourceRoot":"","sources":["../../../src/components/PadModeSelect/PadModeSelect.js"],"names":[],"mappings":";AAiDA,wDA4JC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"@babel/runtime/helpers/toConsumableArray";import t from"@babel/runtime/helpers/slicedToArray";import{useState as r,useRef as
|
|
1
|
+
import e from"@babel/runtime/helpers/toConsumableArray";import t from"@babel/runtime/helpers/slicedToArray";import{useState as r,useRef as n,useMemo as o}from"react";import s from"prop-types";import{first as a,flatten as i,partition as c,isEmpty as l}from"lodash";import{makeStyles as m,Tooltip as d,FormControl as u,Select as p,MenuItem as f}from"@material-ui/core";import{DEFAULT_SUPPORTED_PAD_MODES as h,COMPLETION_MODES as v}from"../../constants/completion.js";import S from"../MiddleTruncate/MiddleTruncate.js";import y from"./WellStreamActivityStatus.js";import{resolveActiveFracAsset as b}from"../../utils/completion.js";import{PadMode as g,AssetStatus as I}from"./types.js";import{useWellStreamActivityTypeSubscription as x}from"./effects/useWellStreamActivityTypeSubscription.js";import{jsxs as A,Fragment as w,jsx as T}from"react/jsx-runtime";var W=m({selectFormControl:{maxWidth:"320px",padding:"5px 8px",marginLeft:"auto"},padSelect:{fontSize:"14px","&:before":{borderBottom:0},"&:after":{borderBottom:0},"& .MuiSelect-root":{alignItems:"center",display:"flex"}},menuItem:{display:"flex",justifyContent:"space-between"},menuItemName:{textOverflow:"ellipsis",overflow:"hidden",width:"100%",fontSize:12,lineHeight:"16px"},activeAsset:{fontSize:12,lineHeight:"16px",minWidth:78,display:"flex",alignItems:"center"}}),j=function(s){var m=s.completionAppType,j=s.padModeSetting,C=s.assets,M=s.onChange,O=s.disableActiveWellsInPadSelect,N=r(!1),z=t(N,2),P=z[0],k=z[1],q=n(),B=W(),D=j.mode===g.custom?"".concat(g.custom,"--").concat(a(j.selectedAssets)):j.mode,F=o((function(){return C.reduce((function(t,r){return[].concat(e(t),[{key:"".concat(g.custom,"--").concat(r.id),label:"".concat(r.name),assetId:r.asset_id,wellId:r.id,status:r.status}])}),[])}),[C,m]),H=h.concat(i(c(F,{status:I.active}))),R=function(e){var r=e.split("--"),n=t(r,2),o=n[0],s=n[1],a={mode:o};o===g.custom&&(a.mode=g.custom,a.selectedAssets=[parseInt(s,10)]),M(a)},_=function(e){return j.mode===g.custom&&+a(j.selectedAssets)==+e||P},L=H.find((function(e){return e.key===D}));null!=L&&L.assetId&&(q.current=null==L?void 0:L.assetId);var E=x({currentWellId:q.current,isStatusShown:!0,withSubscription:!0}),G=b(C)||a(C),J=G.status===I.active,K=r(G.name),Q=t(K,2),U=Q[0],V=Q[1];return A(w,{children:[j.mode!==g.custom&&T(d,{title:U&&U!==G.name?G.name:"",children:A("div",{className:B.activeAsset,children:[T(S,{onTruncate:function(e){V(e)},truncatedText:U,maxWidth:130,children:G.name}),J&&T(y,{isStatusShown:!0,currentWellId:G.asset_id,subData:l(E)?void 0:E})]})}),T(u,{classes:{root:B.selectFormControl},children:D&&T(p,{value:D,onChange:function(e){return R(e.target.value)},inputProps:{name:"padModeSelect",id:"pad-mode-select"},className:B.padSelect,onClose:function(){return k(!1)},onOpen:function(){return k(!0)},MenuProps:{anchorOrigin:{vertical:"top",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"center"}},children:H.map((function(e){var t,r=e.key,n=e.label,o=e.assetId,s=e.wellId,a=e.status,i=_(s)&&a===I.active;return A(f,{value:r,className:B.menuItem,disabled:O&&a!==I.active&&r!==v.pad,children:[T("span",{className:B.menuItemName,children:n}),i&&T(y,{isStatusShown:_(s),currentWellId:o,subData:(null===(t=q.current)||void 0===t?void 0:t.assetId)===r?E:void 0})]},r)}))})})]})};j.propTypes={padModeSetting:s.shape({mode:s.string,selectedAssets:s.oneOfType([s.arrayOf(s.string),s.arrayOf(s.number)])}),assets:s.arrayOf(s.shape()),completionAppType:s.string.isRequired,onChange:s.func.isRequired},j.defaultProps={padModeSetting:{},assets:[]};export{j as default};
|