@corva/ui 3.67.0-5 → 3.67.0-7
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/MCP_README.md +4 -0
- package/cjs-bundle/components/Casing/CasingTableV2/components/SortableComponent.js +1 -1
- package/cjs-bundle/components/Casing/CasingTableV2/components/SortableComponent.js.map +1 -1
- package/cjs-bundle/components/Casing/CasingTableV2/components/SortableComponents.js +1 -1
- package/cjs-bundle/components/Casing/CasingTableV2/components/SortableComponents.js.map +1 -1
- package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/SortableComponent.js +1 -1
- package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/SortableComponent.js.map +1 -1
- package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/SortableComponents.js +1 -1
- package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/SortableComponents.js.map +1 -1
- package/cjs-bundle/components/NewDocumentViewer/components/CsvViewer.js +1 -1
- package/cjs-bundle/components/OffsetWellPickerV2/components/Table/index.js +1 -1
- package/cjs-bundle/components/OffsetWellPickerV2/components/Table/index.js.map +1 -1
- package/cjs-bundle/components/OffsetWellPickerV3/components/CustomSelectionView/components/Table/index.js +1 -1
- package/cjs-bundle/components/OffsetWellPickerV3/components/CustomSelectionView/components/Table/index.js.map +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/components/Filter/components/VirtualizedListBox/VirtualizedListBox.js +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/components/Filter/components/VirtualizedListBox/VirtualizedListBox.module.css.js +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/components/OffsetWellPickerV5WithStore/components/CompanySafeguardWrapper/CompanySafeguardWrapper.js +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/components/OffsetWellsTable/components/MetricsHeaderCells/MetricsHeaderCells.js +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/components/OffsetWellsTable/components/OffsetWellsTableHead/OffsetWellsTableHead.js +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/components/OffsetWellsTable/components/SortableHeaderCell/SortableHeaderCell.js +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/components/OffsetWellsTable/components/WellNameHeaderCell/WellNameHeaderCell.js +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/constants.js +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/hooks/useSortedWells.js +1 -1
- package/cjs-bundle/components/VirtualizedTable/DraggableList.js +1 -1
- package/cjs-bundle/components/VirtualizedTable/DraggableList.js.map +1 -1
- package/cjs-bundle/components/VirtualizedTable/VirtualizedTable.js +1 -1
- package/cjs-bundle/components/VirtualizedTable/index.js +1 -1
- package/components/Casing/CasingTableV2/components/SortableComponent.d.ts +31 -1
- package/components/Casing/CasingTableV2/components/SortableComponent.d.ts.map +1 -1
- package/components/Casing/CasingTableV2/components/SortableComponent.js +1 -1
- package/components/Casing/CasingTableV2/components/SortableComponent.js.map +1 -1
- package/components/Casing/CasingTableV2/components/SortableComponents.d.ts +28 -1
- package/components/Casing/CasingTableV2/components/SortableComponents.js +1 -1
- package/components/Casing/CasingTableV2/components/SortableComponents.js.map +1 -1
- package/components/Drillstring/BHAComponentsTable/components/SortableComponent.d.ts +36 -1
- package/components/Drillstring/BHAComponentsTable/components/SortableComponent.d.ts.map +1 -1
- package/components/Drillstring/BHAComponentsTable/components/SortableComponent.js +1 -1
- package/components/Drillstring/BHAComponentsTable/components/SortableComponent.js.map +1 -1
- package/components/Drillstring/BHAComponentsTable/components/SortableComponents.d.ts +32 -1
- package/components/Drillstring/BHAComponentsTable/components/SortableComponents.js +1 -1
- package/components/Drillstring/BHAComponentsTable/components/SortableComponents.js.map +1 -1
- package/components/NewDocumentViewer/components/CsvViewer.d.ts.map +1 -1
- package/components/NewDocumentViewer/components/CsvViewer.js +1 -1
- package/components/OffsetWellPickerV2/components/Table/index.d.ts +81 -1
- package/components/OffsetWellPickerV2/components/Table/index.d.ts.map +1 -1
- package/components/OffsetWellPickerV2/components/Table/index.js +1 -1
- package/components/OffsetWellPickerV2/components/Table/index.js.map +1 -1
- package/components/OffsetWellPickerV3/components/CustomSelectionView/components/Table/index.d.ts.map +1 -1
- package/components/OffsetWellPickerV3/components/CustomSelectionView/components/Table/index.js +1 -1
- package/components/OffsetWellPickerV3/components/CustomSelectionView/components/Table/index.js.map +1 -1
- package/components/OffsetWellPickerV4/constants.d.ts +4 -0
- package/components/OffsetWellPickerV4/effects/useSortedWells.d.ts +1 -1
- package/components/OffsetWellPickerV4/effects/useSortedWells.d.ts.map +1 -1
- package/components/OffsetWellPickerV5/components/Filter/components/VirtualizedListBox/VirtualizedListBox.d.ts.map +1 -1
- package/components/OffsetWellPickerV5/components/Filter/components/VirtualizedListBox/VirtualizedListBox.js +1 -1
- package/components/OffsetWellPickerV5/components/Filter/components/VirtualizedListBox/VirtualizedListBox.module.css.js +1 -1
- package/components/OffsetWellPickerV5/components/OffsetWellPickerContent/OffsetWellPickerContent.types.d.ts +1 -1
- package/components/OffsetWellPickerV5/components/OffsetWellPickerContent/OffsetWellPickerContent.types.d.ts.map +1 -1
- package/components/OffsetWellPickerV5/components/OffsetWellPickerV5WithStore/components/CompanySafeguardWrapper/CompanySafeguardWrapper.js +1 -1
- package/components/OffsetWellPickerV5/components/OffsetWellsTable/components/MetricsHeaderCells/MetricsHeaderCells.d.ts +1 -1
- package/components/OffsetWellPickerV5/components/OffsetWellsTable/components/MetricsHeaderCells/MetricsHeaderCells.d.ts.map +1 -1
- package/components/OffsetWellPickerV5/components/OffsetWellsTable/components/MetricsHeaderCells/MetricsHeaderCells.js +1 -1
- package/components/OffsetWellPickerV5/components/OffsetWellsTable/components/OffsetWellsTableHead/OffsetWellsTableHead.d.ts +1 -1
- package/components/OffsetWellPickerV5/components/OffsetWellsTable/components/OffsetWellsTableHead/OffsetWellsTableHead.d.ts.map +1 -1
- package/components/OffsetWellPickerV5/components/OffsetWellsTable/components/OffsetWellsTableHead/OffsetWellsTableHead.js +1 -1
- package/components/OffsetWellPickerV5/components/OffsetWellsTable/components/SortableHeaderCell/SortableHeaderCell.d.ts +1 -1
- package/components/OffsetWellPickerV5/components/OffsetWellsTable/components/SortableHeaderCell/SortableHeaderCell.d.ts.map +1 -1
- package/components/OffsetWellPickerV5/components/OffsetWellsTable/components/SortableHeaderCell/SortableHeaderCell.js +1 -1
- package/components/OffsetWellPickerV5/components/OffsetWellsTable/components/WellNameHeaderCell/WellNameHeaderCell.d.ts +1 -1
- package/components/OffsetWellPickerV5/components/OffsetWellsTable/components/WellNameHeaderCell/WellNameHeaderCell.d.ts.map +1 -1
- package/components/OffsetWellPickerV5/components/OffsetWellsTable/components/WellNameHeaderCell/WellNameHeaderCell.js +1 -1
- package/components/OffsetWellPickerV5/components/TableSection/TableSection.d.ts +1 -1
- package/components/OffsetWellPickerV5/components/TableSection/TableSection.d.ts.map +1 -1
- package/components/OffsetWellPickerV5/constants.d.ts +6 -0
- package/components/OffsetWellPickerV5/constants.d.ts.map +1 -1
- package/components/OffsetWellPickerV5/constants.js +1 -1
- package/components/OffsetWellPickerV5/hooks/useSortedWells.d.ts +1 -1
- package/components/OffsetWellPickerV5/hooks/useSortedWells.d.ts.map +1 -1
- package/components/OffsetWellPickerV5/hooks/useSortedWells.js +1 -1
- package/components/VirtualizedTable/DraggableList.d.ts.map +1 -1
- package/components/VirtualizedTable/DraggableList.js +1 -1
- package/components/VirtualizedTable/DraggableList.js.map +1 -1
- package/components/VirtualizedTable/VirtualizedTable.d.ts.map +1 -1
- package/components/VirtualizedTable/VirtualizedTable.js +1 -1
- package/components/VirtualizedTable/index.d.ts +4 -2
- package/components/VirtualizedTable/index.d.ts.map +1 -1
- package/components/VirtualizedTable/index.js +1 -1
- package/mcp-server/server.mjs +12524 -268490
- package/package.json +7 -2
- package/tsconfig.tsbuildinfo +1 -1
|
@@ -1,3 +1,33 @@
|
|
|
1
|
-
declare const _default: import("react").MemoExoticComponent<
|
|
1
|
+
declare const _default: import("react").MemoExoticComponent<{
|
|
2
|
+
({ component, isTopComponent, isLastCompnent, isSortable, sortableIndex, validate, onDelete, onSave, isMobile, viewColumnsPerRow, editColumnsPerRow, }: {
|
|
3
|
+
component: any;
|
|
4
|
+
isTopComponent: any;
|
|
5
|
+
isLastCompnent: any;
|
|
6
|
+
isSortable: any;
|
|
7
|
+
sortableIndex: any;
|
|
8
|
+
validate: any;
|
|
9
|
+
onDelete: any;
|
|
10
|
+
onSave: any;
|
|
11
|
+
isMobile: any;
|
|
12
|
+
viewColumnsPerRow: any;
|
|
13
|
+
editColumnsPerRow: any;
|
|
14
|
+
}): JSX.Element;
|
|
15
|
+
propTypes: {
|
|
16
|
+
isMobile: PropTypes.Validator<boolean>;
|
|
17
|
+
component: PropTypes.Validator<NonNullable<PropTypes.InferProps<{
|
|
18
|
+
id: PropTypes.Validator<string>;
|
|
19
|
+
}>>>;
|
|
20
|
+
isTopComponent: PropTypes.Validator<boolean>;
|
|
21
|
+
isLastCompnent: PropTypes.Validator<boolean>;
|
|
22
|
+
isSortable: PropTypes.Validator<boolean>;
|
|
23
|
+
sortableIndex: PropTypes.Validator<number>;
|
|
24
|
+
validate: PropTypes.Validator<(...args: any[]) => any>;
|
|
25
|
+
onDelete: PropTypes.Validator<(...args: any[]) => any>;
|
|
26
|
+
onSave: PropTypes.Validator<(...args: any[]) => any>;
|
|
27
|
+
viewColumnsPerRow: PropTypes.Validator<number>;
|
|
28
|
+
editColumnsPerRow: PropTypes.Validator<number>;
|
|
29
|
+
};
|
|
30
|
+
}>;
|
|
2
31
|
export default _default;
|
|
32
|
+
import PropTypes from 'prop-types';
|
|
3
33
|
//# sourceMappingURL=SortableComponent.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SortableComponent.d.ts","sourceRoot":"","sources":["../../../../../src/components/Casing/CasingTableV2/components/SortableComponent.js"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"SortableComponent.d.ts","sourceRoot":"","sources":["../../../../../src/components/Casing/CasingTableV2/components/SortableComponent.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;sBACsB,YAAY"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import
|
|
1
|
+
import e from"@babel/runtime/helpers/slicedToArray";import o from"@babel/runtime/helpers/defineProperty";import{memo as r,useState as t}from"react";import n from"prop-types";import i from"classnames";import{useSortable as a}from"@dnd-kit/sortable";import{makeStyles as s,Tooltip as p,IconButton as l}from"@material-ui/core";import c from"@material-ui/icons/DragIndicator";import d from"./Component.js";import{jsxs as u,jsx as m}from"react/jsx-runtime";function b(e,o){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);o&&(t=t.filter((function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable}))),r.push.apply(r,t)}return r}function f(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?b(Object(t),!0).forEach((function(r){o(e,r,t[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):b(Object(t)).forEach((function(o){Object.defineProperty(e,o,Object.getOwnPropertyDescriptor(t,o))}))}return e}var g=s((function(e){return{sortableComponent:{position:"relative","&:hover":{"& $dragButton":{display:"block"}},zIndex:"99999999 !important",background:function(o){return o.isSortable&&e.palette.background.b5},boxShadow:function(e){return e.isSortable&&"0px 0px 6px rgba(0, 0, 0, 0.5)"}},topComponent:{marginTop:"16px"},bottomComponent:{marginBottom:"8px"},dragInidicationHidden:{"&:hover":{"& $dragButton":{display:"none"}}},dragIndicatorWrapper:{position:"absolute",left:function(e){return e.isMobile?"8px":0},top:function(e){return e.isMobile?"20px":"8px"}},dragButton:{display:function(e){return e.isMobile?"block":"none"},padding:"8px",background:function(o){return o.isMobile?"none":e.palette.background.b9},"&:hover":{background:e.palette.background.b7,"& $dragIndicatorIcon":{color:e.palette.primary.text1}}},dragIndicatorIcon:{cursor:"pointer",color:e.palette.primary.text6,fontSize:"16px"}}})),v=function(e){return e?"translate3d(".concat(e.x,"px, ").concat(e.y,"px, 0)"):void 0},y=function(e){var o=e.isMobile,r=e.attributes,t=e.listeners,n=g({isMobile:o});return m("div",{className:n.dragIndicatorWrapper,children:m(p,{title:o?"":"Click & Drag to reorder",children:m(l,f(f(f({className:n.dragButton},r),t),{},{children:m(c,{className:n.dragIndicatorIcon})}))})})},x=function(r){var n,s=r.component,p=r.isTopComponent,l=r.isLastCompnent,c=r.isSortable,b=r.sortableIndex,f=r.validate,x=r.onDelete,C=r.onSave,R=r.isMobile,O=r.viewColumnsPerRow,h=r.editColumnsPerRow,w=g({isMobile:R,isSortable:c}),P=t(!1),I=e(P,2),j=I[0],q=I[1],S=a({id:s.id}),k=S.attributes,M=S.listeners,D=S.setNodeRef,B=S.transform,N=S.transition,T={transform:v(B),transition:N};return u("div",{ref:D,style:T,className:i(w.sortableComponent,(n={},o(n,w.topComponent,!R&&p),o(n,w.bottomComponent,!R&&l),o(n,w.dragInidicationHidden,!c&&-1!==b),n)),children:[!j&&m(y,{isMobile:R,attributes:k,listeners:M}),m(d,{isMobile:R,viewColumnsPerRow:O,editColumnsPerRow:h,component:s,validate:f,onSave:C,onDelete:x,onChangeEditing:q,isDragComponent:-1!==b})]})};x.propTypes={isMobile:n.bool.isRequired,component:n.shape({id:n.string.isRequired}).isRequired,isTopComponent:n.bool.isRequired,isLastCompnent:n.bool.isRequired,isSortable:n.bool.isRequired,sortableIndex:n.number.isRequired,validate:n.func.isRequired,onDelete:n.func.isRequired,onSave:n.func.isRequired,viewColumnsPerRow:n.number.isRequired,editColumnsPerRow:n.number.isRequired};var C=r(x);export{C as default};
|
|
2
2
|
//# sourceMappingURL=SortableComponent.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SortableComponent.js","sources":["../../../../../src/components/Casing/CasingTableV2/components/SortableComponent.js"],"sourcesContent":["import { memo, useState } from 'react';\nimport PropTypes from 'prop-types';\nimport classNames from 'classnames';\
|
|
1
|
+
{"version":3,"file":"SortableComponent.js","sources":["../../../../../src/components/Casing/CasingTableV2/components/SortableComponent.js"],"sourcesContent":["import { memo, useState } from 'react';\nimport PropTypes from 'prop-types';\nimport classNames from 'classnames';\nimport { useSortable } from '@dnd-kit/sortable';\nimport { IconButton, Tooltip, makeStyles } from '@material-ui/core';\nimport DragIndicatorIcon from '@material-ui/icons/DragIndicator';\n\nimport Component from './Component';\n\nconst useStyles = makeStyles(theme => ({\n sortableComponent: {\n position: 'relative',\n '&:hover': {\n '& $dragButton': {\n display: 'block',\n },\n },\n zIndex: '99999999 !important',\n background: ({ isSortable }) => isSortable && theme.palette.background.b5,\n boxShadow: ({ isSortable }) => isSortable && '0px 0px 6px rgba(0, 0, 0, 0.5)',\n },\n topComponent: {\n marginTop: '16px',\n },\n bottomComponent: {\n marginBottom: '8px',\n },\n dragInidicationHidden: {\n '&:hover': {\n '& $dragButton': {\n display: 'none',\n },\n },\n },\n dragIndicatorWrapper: {\n position: 'absolute',\n left: ({ isMobile }) => (isMobile ? '8px' : 0),\n top: ({ isMobile }) => (isMobile ? '20px' : '8px'),\n },\n dragButton: {\n display: ({ isMobile }) => (isMobile ? 'block' : 'none'),\n padding: '8px',\n background: ({ isMobile }) => (isMobile ? 'none' : theme.palette.background.b9),\n '&:hover': {\n background: theme.palette.background.b7,\n '& $dragIndicatorIcon': {\n color: theme.palette.primary.text1,\n },\n },\n },\n dragIndicatorIcon: {\n cursor: 'pointer',\n color: theme.palette.primary.text6,\n fontSize: '16px',\n },\n}));\n\nconst transformToCss = transform =>\n transform ? `translate3d(${transform.x}px, ${transform.y}px, 0)` : undefined;\n\nconst DragHandle = ({ isMobile, attributes, listeners }) => {\n const classes = useStyles({ isMobile });\n\n return (\n <div className={classes.dragIndicatorWrapper}>\n <Tooltip title={isMobile ? '' : 'Click & Drag to reorder'}>\n <IconButton className={classes.dragButton} {...attributes} {...listeners}>\n <DragIndicatorIcon className={classes.dragIndicatorIcon} />\n </IconButton>\n </Tooltip>\n </div>\n );\n};\n\nconst SortableComponent = ({\n component,\n isTopComponent,\n isLastCompnent,\n isSortable,\n sortableIndex,\n validate,\n onDelete,\n onSave,\n isMobile,\n viewColumnsPerRow,\n editColumnsPerRow,\n}) => {\n const classes = useStyles({ isMobile, isSortable });\n const [isEditing, setIsEditing] = useState(false);\n\n const { attributes, listeners, setNodeRef, transform, transition } = useSortable({\n id: component.id,\n });\n\n const style = {\n transform: transformToCss(transform),\n transition,\n };\n\n return (\n <div\n ref={setNodeRef}\n style={style}\n className={classNames(classes.sortableComponent, {\n [classes.topComponent]: !isMobile && isTopComponent,\n [classes.bottomComponent]: !isMobile && isLastCompnent,\n [classes.dragInidicationHidden]: !isSortable && sortableIndex !== -1,\n })}\n >\n {!isEditing && (\n <DragHandle isMobile={isMobile} attributes={attributes} listeners={listeners} />\n )}\n <Component\n isMobile={isMobile}\n viewColumnsPerRow={viewColumnsPerRow}\n editColumnsPerRow={editColumnsPerRow}\n component={component}\n validate={validate}\n onSave={onSave}\n onDelete={onDelete}\n onChangeEditing={setIsEditing}\n isDragComponent={sortableIndex !== -1}\n />\n </div>\n );\n};\n\nSortableComponent.propTypes = {\n isMobile: PropTypes.bool.isRequired,\n component: PropTypes.shape({ id: PropTypes.string.isRequired }).isRequired,\n isTopComponent: PropTypes.bool.isRequired,\n isLastCompnent: PropTypes.bool.isRequired,\n isSortable: PropTypes.bool.isRequired,\n sortableIndex: PropTypes.number.isRequired,\n validate: PropTypes.func.isRequired,\n onDelete: PropTypes.func.isRequired,\n onSave: PropTypes.func.isRequired,\n viewColumnsPerRow: PropTypes.number.isRequired,\n editColumnsPerRow: PropTypes.number.isRequired,\n};\n\nexport default memo(SortableComponent);\n"],"names":["useStyles","makeStyles","theme","sortableComponent","position","display","zIndex","background","_ref","isSortable","palette","b5","boxShadow","_ref2","topComponent","marginTop","bottomComponent","marginBottom","dragInidicationHidden","dragIndicatorWrapper","left","_ref3","isMobile","top","_ref4","dragButton","_ref5","padding","_ref6","b9","b7","color","primary","text1","dragIndicatorIcon","cursor","text6","fontSize","transformToCss","transform","x","y","undefined","DragHandle","_ref7","attributes","listeners","classes","_jsx","className","children","Tooltip","title","IconButton","_objectSpread","DragIndicatorIcon","SortableComponent","_ref8","_classNames","component","isTopComponent","isLastCompnent","sortableIndex","validate","onDelete","onSave","viewColumnsPerRow","editColumnsPerRow","useState","_useState2","_slicedToArray","_useState","isEditing","setIsEditing","_useSortable","useSortable","id","setNodeRef","transition","style","_jsxs","ref","classNames","_defineProperty","Component","onChangeEditing","isDragComponent","propTypes","PropTypes","bool","isRequired","shape","string","number","func","memo"],"mappings":"mgCASA,IAAMA,EAAYC,GAAW,SAAAC,GAAK,MAAK,CACrCC,kBAAmB,CACjBC,SAAU,WACV,UAAW,CACT,gBAAiB,CACfC,QAAS,UAGbC,OAAQ,sBACRC,WAAY,SAAAC,GAAa,SAAVC,YAA+BP,EAAMQ,QAAQH,WAAWI,EAAE,EACzEC,UAAW,SAAAC,GAAa,SAAVJ,YAA+B,gCAAgC,GAE/EK,aAAc,CACZC,UAAW,QAEbC,gBAAiB,CACfC,aAAc,OAEhBC,sBAAuB,CACrB,UAAW,CACT,gBAAiB,CACfb,QAAS,UAIfc,qBAAsB,CACpBf,SAAU,WACVgB,KAAM,SAAAC,GAAW,SAARC,SAA2B,MAAQ,CAAE,EAC9CC,IAAK,SAAAC,GAAW,SAARF,SAA2B,OAAS,KAAK,GAEnDG,WAAY,CACVpB,QAAS,SAAAqB,GAAW,SAARJ,SAA2B,QAAU,MAAO,EACxDK,QAAS,MACTpB,WAAY,SAAAqB,GAAW,SAARN,SAA2B,OAASpB,EAAMQ,QAAQH,WAAWsB,EAAG,EAC/E,UAAW,CACTtB,WAAYL,EAAMQ,QAAQH,WAAWuB,GACrC,uBAAwB,CACtBC,MAAO7B,EAAMQ,QAAQsB,QAAQC,SAInCC,kBAAmB,CACjBC,OAAQ,UACRJ,MAAO7B,EAAMQ,QAAQsB,QAAQI,MAC7BC,SAAU,QAEb,IAEKC,EAAiB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D,GAC/CJ,IAAAR,SAAA,EAEDsB,GACAxB,EAACL,EAAU,CAACrB,SAAUA,EAAUuB,WAAYA,EAAYC,UAAWA,IAErEE,EAACoC,EAAS,CACR9D,SAAUA,EACV4C,kBAAmBA,EACnBC,kBAAmBA,EACnBR,UAAWA,EACXI,SAAUA,EACVE,OAAQA,EACRD,SAAUA,EACVqB,gBAAiBZ,EACjBa,iBAAoC,IAAnBxB,MAIzB,EAEAN,EAAkB+B,UAAY,CAC5BjE,SAAUkE,EAAUC,KAAKC,WACzB/B,UAAW6B,EAAUG,MAAM,CAAEf,GAAIY,EAAUI,OAAOF,aAAcA,WAChE9B,eAAgB4B,EAAUC,KAAKC,WAC/B7B,eAAgB2B,EAAUC,KAAKC,WAC/BjF,WAAY+E,EAAUC,KAAKC,WAC3B5B,cAAe0B,EAAUK,OAAOH,WAChC3B,SAAUyB,EAAUM,KAAKJ,WACzB1B,SAAUwB,EAAUM,KAAKJ,WACzBzB,OAAQuB,EAAUM,KAAKJ,WACvBxB,kBAAmBsB,EAAUK,OAAOH,WACpCvB,kBAAmBqB,EAAUK,OAAOH,YAGtC,IAAeK,EAAAA,EAAKvC"}
|
|
@@ -1,3 +1,30 @@
|
|
|
1
|
-
declare const _default: import("react").MemoExoticComponent<
|
|
1
|
+
declare const _default: import("react").MemoExoticComponent<{
|
|
2
|
+
({ components, validate, sortableIndex, onDeleteComponent, onSaveComponent, isMobile, viewColumnsPerRow, editColumnsPerRow, onSortStart, onSortEnd, lockAxis, lockToContainerEdges, }: {
|
|
3
|
+
components: any;
|
|
4
|
+
validate: any;
|
|
5
|
+
sortableIndex: any;
|
|
6
|
+
onDeleteComponent: any;
|
|
7
|
+
onSaveComponent: any;
|
|
8
|
+
isMobile: any;
|
|
9
|
+
viewColumnsPerRow: any;
|
|
10
|
+
editColumnsPerRow: any;
|
|
11
|
+
onSortStart: any;
|
|
12
|
+
onSortEnd: any;
|
|
13
|
+
lockAxis: any;
|
|
14
|
+
lockToContainerEdges: any;
|
|
15
|
+
}): JSX.Element;
|
|
16
|
+
propTypes: {
|
|
17
|
+
components: import("prop-types").Requireable<(import("prop-types").InferProps<{
|
|
18
|
+
id: import("prop-types").Validator<string>;
|
|
19
|
+
}> | null | undefined)[]>;
|
|
20
|
+
validate: import("prop-types").Validator<(...args: any[]) => any>;
|
|
21
|
+
sortableIndex: import("prop-types").Validator<number>;
|
|
22
|
+
onSaveComponent: import("prop-types").Validator<(...args: any[]) => any>;
|
|
23
|
+
onDeleteComponent: import("prop-types").Validator<(...args: any[]) => any>;
|
|
24
|
+
isMobile: import("prop-types").Validator<boolean>;
|
|
25
|
+
viewColumnsPerRow: import("prop-types").Validator<number>;
|
|
26
|
+
editColumnsPerRow: import("prop-types").Validator<number>;
|
|
27
|
+
};
|
|
28
|
+
}>;
|
|
2
29
|
export default _default;
|
|
3
30
|
//# sourceMappingURL=SortableComponents.d.ts.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{memo as e}from"react";import{arrayOf as o,shape as i,string as
|
|
1
|
+
import{memo as e}from"react";import{arrayOf as o,shape as i,string as n,func as r,number as t,bool as d}from"prop-types";import{useSensors as s,useSensor as a,PointerSensor as m,DndContext as l,closestCenter as u}from"@dnd-kit/core";import{SortableContext as p,verticalListSortingStrategy as f}from"@dnd-kit/sortable";import{restrictToVerticalAxis as c,restrictToParentElement as v}from"@dnd-kit/modifiers";import{makeStyles as C}from"@material-ui/core";import R from"./SortableComponent.js";import{jsx as x}from"react/jsx-runtime";var b=C({body:{flex:1,minHeight:0,zIndex:0,position:"relative"}}),w=function(e){var o=e.components,i=e.validate,n=e.sortableIndex,r=e.onDeleteComponent,t=e.onSaveComponent,d=e.isMobile,C=e.viewColumnsPerRow,w=e.editColumnsPerRow,S=e.onSortStart,q=e.onSortEnd,I=e.lockAxis,g=e.lockToContainerEdges,y=b(),D=s(a(m)),P=["y"===I&&c,g&&v].filter(Boolean);return x(l,{sensors:D,collisionDetection:u,modifiers:P,onDragStart:function(e){var i=e.active;if(S){var n=o.findIndex((function(e){return e.id===i.id}));S({index:n})}},onDragEnd:function(e){var i=e.active,n=e.over;if(q){var r=o.findIndex((function(e){return e.id===i.id})),t=n?o.findIndex((function(e){return e.id===n.id})):r;q(r,t)}},children:x(p,{items:o.map((function(e){return e.id})),strategy:f,children:x("div",{className:y.body,children:o.map((function(e,s){return x(R,{isSortable:n===s,sortableIndex:n,component:e,isTopComponent:0===s,isLastCompnent:s===o.length-1,validate:i,onDelete:r,onSave:t,isMobile:d,viewColumnsPerRow:C,editColumnsPerRow:w},e.id)}))})})})};w.propTypes={components:o(i({id:n.isRequired})),validate:r.isRequired,sortableIndex:t.isRequired,onSaveComponent:r.isRequired,onDeleteComponent:r.isRequired,isMobile:d.isRequired,viewColumnsPerRow:t.isRequired,editColumnsPerRow:t.isRequired};var S=e(w);export{S as default};
|
|
2
2
|
//# sourceMappingURL=SortableComponents.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SortableComponents.js","sources":["../../../../../src/components/Casing/CasingTableV2/components/SortableComponents.js"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"SortableComponents.js","sources":["../../../../../src/components/Casing/CasingTableV2/components/SortableComponents.js"],"sourcesContent":["/* eslint-disable react/require-default-props */\nimport { memo } from 'react';\nimport { arrayOf, bool, func, number, shape, string } from 'prop-types';\nimport { closestCenter, DndContext, PointerSensor, useSensor, useSensors } from '@dnd-kit/core';\nimport { SortableContext, verticalListSortingStrategy } from '@dnd-kit/sortable';\nimport { restrictToParentElement, restrictToVerticalAxis } from '@dnd-kit/modifiers';\nimport { makeStyles } from '@material-ui/core';\n\nimport SortableComponent from './SortableComponent';\n\nconst useStyles = makeStyles({\n body: {\n flex: 1,\n minHeight: 0,\n zIndex: 0,\n position: 'relative',\n },\n});\n\nconst SortableComponents = ({\n components,\n validate,\n sortableIndex,\n onDeleteComponent,\n onSaveComponent,\n isMobile,\n viewColumnsPerRow,\n editColumnsPerRow,\n onSortStart,\n onSortEnd,\n lockAxis,\n lockToContainerEdges,\n}) => {\n const classes = useStyles();\n const sensors = useSensors(useSensor(PointerSensor));\n\n const modifiers = [\n lockAxis === 'y' && restrictToVerticalAxis,\n lockToContainerEdges && restrictToParentElement,\n ].filter(Boolean);\n\n const handleDragStart = ({ active }) => {\n if (!onSortStart) {\n return;\n }\n const index = components.findIndex(item => item.id === active.id);\n onSortStart({ index });\n };\n\n const handleDragEnd = ({ active, over }) => {\n if (!onSortEnd) {\n return;\n }\n const oldIndex = components.findIndex(item => item.id === active.id);\n const newIndex = over ? components.findIndex(item => item.id === over.id) : oldIndex;\n onSortEnd(oldIndex, newIndex);\n };\n\n return (\n <DndContext\n sensors={sensors}\n collisionDetection={closestCenter}\n modifiers={modifiers}\n onDragStart={handleDragStart}\n onDragEnd={handleDragEnd}\n >\n <SortableContext\n items={components.map(component => component.id)}\n strategy={verticalListSortingStrategy}\n >\n <div className={classes.body}>\n {components.map((component, index) => (\n <SortableComponent\n key={component.id}\n isSortable={sortableIndex === index}\n sortableIndex={sortableIndex}\n component={component}\n isTopComponent={index === 0}\n isLastCompnent={index === components.length - 1}\n validate={validate}\n onDelete={onDeleteComponent}\n onSave={onSaveComponent}\n isMobile={isMobile}\n viewColumnsPerRow={viewColumnsPerRow}\n editColumnsPerRow={editColumnsPerRow}\n />\n ))}\n </div>\n </SortableContext>\n </DndContext>\n );\n};\n\nSortableComponents.propTypes = {\n components: arrayOf(shape({ id: string.isRequired })),\n validate: func.isRequired,\n sortableIndex: number.isRequired,\n onSaveComponent: func.isRequired,\n onDeleteComponent: func.isRequired,\n isMobile: bool.isRequired,\n viewColumnsPerRow: number.isRequired,\n editColumnsPerRow: number.isRequired,\n};\n\nexport default memo(SortableComponents);\n"],"names":["useStyles","makeStyles","body","flex","minHeight","zIndex","position","SortableComponents","_ref","components","validate","sortableIndex","onDeleteComponent","onSaveComponent","isMobile","viewColumnsPerRow","editColumnsPerRow","onSortStart","onSortEnd","lockAxis","lockToContainerEdges","classes","sensors","useSensors","useSensor","PointerSensor","modifiers","restrictToVerticalAxis","restrictToParentElement","filter","Boolean","_jsx","DndContext","collisionDetection","closestCenter","onDragStart","_ref2","active","index","findIndex","item","id","onDragEnd","_ref3","over","oldIndex","newIndex","children","SortableContext","items","map","component","strategy","verticalListSortingStrategy","className","SortableComponent","isSortable","isTopComponent","isLastCompnent","length","onDelete","onSave","propTypes","arrayOf","shape","string","isRequired","func","number","bool","memo"],"mappings":"ohBAUA,IAAMA,EAAYC,EAAW,CAC3BC,KAAM,CACJC,KAAM,EACNC,UAAW,EACXC,OAAQ,EACRC,SAAU,cAIRC,EAAqB,SAarBC,GAAA,IAZJC,IAAAA,WACAC,IAAAA,SACAC,IAAAA,cACAC,IAAAA,kBACAC,IAAAA,gBACAC,IAAAA,SACAC,IAAAA,kBACAC,IAAAA,kBACAC,IAAAA,YACAC,IAAAA,UACAC,IAAAA,SACAC,IAAAA,qBAEMC,EAAUrB,IACVsB,EAAUC,EAAWC,EAAUC,IAE/BC,EAAY,CACH,MAAbP,GAAoBQ,EACpBP,GAAwBQ,GACxBC,OAAOC,SAmBT,OACEC,EAACC,EAAU,CACTV,QAASA,EACTW,mBAAoBC,EACpBR,UAAWA,EACXS,YAtBoB,SAAgBC,GAAA,IAAbC,IAAAA,OACzB,GAAKpB,EAAL,CAGA,IAAMqB,EAAQ7B,EAAW8B,WAAU,SAAAC,GAAI,OAAIA,EAAKC,KAAOJ,EAAOI,MAC9DxB,EAAY,CAAEqB,MAAAA,GAFd,GAoBEI,UAfkB,SAAsBC,GAAA,IAAnBN,IAAAA,OAAQO,IAAAA,KAC/B,GAAK1B,EAAL,CAGA,IAAM2B,EAAWpC,EAAW8B,WAAU,SAAAC,GAAI,OAAIA,EAAKC,KAAOJ,EAAOI,MAC3DK,EAAWF,EAAOnC,EAAW8B,WAAU,SAAAC,GAAI,OAAIA,EAAKC,KAAOG,EAAKH,EAAE,IAAII,EAC5E3B,EAAU2B,EAAUC,EAHpB,GAY2BC,SAEzBhB,EAACiB,EAAe,CACdC,MAAOxC,EAAWyC,KAAI,SAAAC,GAAS,OAAIA,EAAUV,MAC7CW,SAAUC,EAA4BN,SAEtChB,EAAA,MAAA,CAAKuB,UAAWjC,EAAQnB,KAAK6C,SAC1BtC,EAAWyC,KAAI,SAACC,EAAWb,GAAK,OAC/BP,EAACwB,EAAiB,CAEhBC,WAAY7C,IAAkB2B,EAC9B3B,cAAeA,EACfwC,UAAWA,EACXM,eAA0B,IAAVnB,EAChBoB,eAAgBpB,IAAU7B,EAAWkD,OAAS,EAC9CjD,SAAUA,EACVkD,SAAUhD,EACViD,OAAQhD,EACRC,SAAUA,EACVC,kBAAmBA,EACnBC,kBAAmBA,GAXdmC,EAAUV,YAkB7B,EAEAlC,EAAmBuD,UAAY,CAC7BrD,WAAYsD,EAAQC,EAAM,CAAEvB,GAAIwB,EAAOC,cACvCxD,SAAUyD,EAAKD,WACfvD,cAAeyD,EAAOF,WACtBrD,gBAAiBsD,EAAKD,WACtBtD,kBAAmBuD,EAAKD,WACxBpD,SAAUuD,EAAKH,WACfnD,kBAAmBqD,EAAOF,WAC1BlD,kBAAmBoD,EAAOF,YAG5B,IAAeI,EAAAA,EAAK/D"}
|
|
@@ -1,3 +1,38 @@
|
|
|
1
|
-
declare const _default: import("react").MemoExoticComponent<
|
|
1
|
+
declare const _default: import("react").MemoExoticComponent<{
|
|
2
|
+
({ isActualBha, component, isTopComponent, isLastCompnent, isSortable, sortableIndex, validate, onDelete, onSave, isMobile, viewColumnsPerRow, editColumnsPerRow, onAutocompleteApplied, }: {
|
|
3
|
+
isActualBha: any;
|
|
4
|
+
component: any;
|
|
5
|
+
isTopComponent: any;
|
|
6
|
+
isLastCompnent: any;
|
|
7
|
+
isSortable: any;
|
|
8
|
+
sortableIndex: any;
|
|
9
|
+
validate: any;
|
|
10
|
+
onDelete: any;
|
|
11
|
+
onSave: any;
|
|
12
|
+
isMobile: any;
|
|
13
|
+
viewColumnsPerRow: any;
|
|
14
|
+
editColumnsPerRow: any;
|
|
15
|
+
onAutocompleteApplied: any;
|
|
16
|
+
}): JSX.Element;
|
|
17
|
+
propTypes: {
|
|
18
|
+
isActualBha: PropTypes.Validator<boolean>;
|
|
19
|
+
isMobile: PropTypes.Validator<boolean>;
|
|
20
|
+
component: PropTypes.Validator<NonNullable<PropTypes.InferProps<{
|
|
21
|
+
id: PropTypes.Validator<string>;
|
|
22
|
+
family: PropTypes.Requireable<string>;
|
|
23
|
+
}>>>;
|
|
24
|
+
isTopComponent: PropTypes.Validator<boolean>;
|
|
25
|
+
isLastCompnent: PropTypes.Validator<boolean>;
|
|
26
|
+
isSortable: PropTypes.Validator<boolean>;
|
|
27
|
+
sortableIndex: PropTypes.Validator<number>;
|
|
28
|
+
validate: PropTypes.Validator<(...args: any[]) => any>;
|
|
29
|
+
onDelete: PropTypes.Validator<(...args: any[]) => any>;
|
|
30
|
+
onSave: PropTypes.Validator<(...args: any[]) => any>;
|
|
31
|
+
viewColumnsPerRow: PropTypes.Validator<number>;
|
|
32
|
+
editColumnsPerRow: PropTypes.Validator<number>;
|
|
33
|
+
onAutocompleteApplied: PropTypes.Validator<(...args: any[]) => any>;
|
|
34
|
+
};
|
|
35
|
+
}>;
|
|
2
36
|
export default _default;
|
|
37
|
+
import PropTypes from 'prop-types';
|
|
3
38
|
//# sourceMappingURL=SortableComponent.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SortableComponent.d.ts","sourceRoot":"","sources":["../../../../../src/components/Drillstring/BHAComponentsTable/components/SortableComponent.js"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"SortableComponent.d.ts","sourceRoot":"","sources":["../../../../../src/components/Drillstring/BHAComponentsTable/components/SortableComponent.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;sBACsB,YAAY"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import
|
|
1
|
+
import e from"@babel/runtime/helpers/slicedToArray";import o from"@babel/runtime/helpers/defineProperty";import{memo as t,useState as r}from"react";import i from"prop-types";import n from"classnames";import{useSortable as a}from"@dnd-kit/sortable";import{makeStyles as s,Tooltip as l,IconButton as p}from"@material-ui/core";import c from"@material-ui/icons/DragIndicator";import d from"./Component.js";import{BHA_FAMILY as u}from"../../../../constants/bha.js";import{jsxs as m,jsx as b}from"react/jsx-runtime";function f(e,o){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);o&&(r=r.filter((function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable}))),t.push.apply(t,r)}return t}function g(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?f(Object(r),!0).forEach((function(t){o(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):f(Object(r)).forEach((function(o){Object.defineProperty(e,o,Object.getOwnPropertyDescriptor(r,o))}))}return e}var v=s((function(e){return{sortableComponent:{position:"relative","&:hover":{"& $dragIndicatorButton":{visibility:"visible"}},zIndex:"99999999 !important",background:function(o){return o.isSortable&&e.palette.background.b5},boxShadow:function(e){return e.isSortable&&"0px 0px 6px rgba(0, 0, 0, 0.5)"}},topComponent:{marginTop:"16px"},bottomComponent:{marginBottom:"8px"},dragInidicationHidden:{"&:hover":{"& $dragIndicatorButton":{visibility:"hidden"}}},dragIndicatorWrapper:{position:"absolute",left:function(e){return e.isMobile?"8px":0},top:function(e){return e.isMobile?"20px":"8px"}},dragIndicatorButton:{visibility:function(e){return e.isMobile?"visible":"hidden"},padding:"8px",background:function(o){return o.isMobile?"none":e.palette.background.b9},"&:hover":{background:e.palette.background.b7,"& $dragIndicatorIcon":{color:e.palette.primary.text1}}},dragIndicatorIcon:{cursor:"pointer",color:e.palette.primary.text6,fontSize:"16px"}}})),y=function(e){return e?"translate3d(".concat(e.x,"px, ").concat(e.y,"px, 0)"):void 0},h=function(e){var o=e.isMobile,t=e.attributes,r=e.listeners,i=v({isMobile:o});return b("div",{className:i.dragIndicatorWrapper,children:b(l,{title:o?"":"Click & Drag to reorder",children:b(p,g(g(g({className:i.dragIndicatorButton},t),r),{},{children:b(c,{className:i.dragIndicatorIcon})}))})})},x=function(t){var i,s=t.isActualBha,l=t.component,p=t.isTopComponent,c=t.isLastCompnent,f=t.isSortable,g=t.sortableIndex,x=t.validate,R=t.onDelete,C=t.onSave,I=t.isMobile,O=t.viewColumnsPerRow,w=t.editColumnsPerRow,P=t.onAutocompleteApplied,j=v({isMobile:I,isSortable:f}),q=r(!1),S=e(q,2),M=S[0],A=S[1],D=a({id:l.id}),k=D.attributes,B=D.listeners,N=D.setNodeRef,T=D.transform,E=D.transition,$={transform:y(T),transition:E};return m("div",{ref:N,style:$,className:n(j.sortableComponent,(i={},o(i,j.topComponent,!I&&p),o(i,j.bottomComponent,!I&&c),o(i,j.dragInidicationHidden,!f&&-1!==g),i)),children:[l.family!==u.bit&&!M&&b(h,{isMobile:I,attributes:k,listeners:B}),b(d,{isMobile:I,isActualBha:s,viewColumnsPerRow:O,editColumnsPerRow:w,component:l,validate:x,onSave:C,onDelete:R,onChangeEditing:A,onAutocompleteApplied:P,isDragComponent:-1!==g})]})};x.propTypes={isActualBha:i.bool.isRequired,isMobile:i.bool.isRequired,component:i.shape({id:i.string.isRequired,family:i.string}).isRequired,isTopComponent:i.bool.isRequired,isLastCompnent:i.bool.isRequired,isSortable:i.bool.isRequired,sortableIndex:i.number.isRequired,validate:i.func.isRequired,onDelete:i.func.isRequired,onSave:i.func.isRequired,viewColumnsPerRow:i.number.isRequired,editColumnsPerRow:i.number.isRequired,onAutocompleteApplied:i.func.isRequired};var R=t(x);export{R as default};
|
|
2
2
|
//# sourceMappingURL=SortableComponent.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SortableComponent.js","sources":["../../../../../src/components/Drillstring/BHAComponentsTable/components/SortableComponent.js"],"sourcesContent":["import { memo, useState } from 'react';\nimport PropTypes from 'prop-types';\nimport classNames from 'classnames';\
|
|
1
|
+
{"version":3,"file":"SortableComponent.js","sources":["../../../../../src/components/Drillstring/BHAComponentsTable/components/SortableComponent.js"],"sourcesContent":["import { memo, useState } from 'react';\nimport PropTypes from 'prop-types';\nimport classNames from 'classnames';\nimport { useSortable } from '@dnd-kit/sortable';\nimport { IconButton, Tooltip, makeStyles } from '@material-ui/core';\nimport DragIndicatorIcon from '@material-ui/icons/DragIndicator';\n\nimport Component from './Component';\n\nimport { BHA_FAMILY } from '~/constants/bha';\n\nconst useStyles = makeStyles(theme => ({\n sortableComponent: {\n position: 'relative',\n '&:hover': {\n '& $dragIndicatorButton': {\n visibility: 'visible',\n },\n },\n zIndex: '99999999 !important',\n background: ({ isSortable }) => isSortable && theme.palette.background.b5,\n boxShadow: ({ isSortable }) => isSortable && '0px 0px 6px rgba(0, 0, 0, 0.5)',\n },\n topComponent: {\n marginTop: '16px',\n },\n bottomComponent: {\n marginBottom: '8px',\n },\n dragInidicationHidden: {\n '&:hover': {\n '& $dragIndicatorButton': {\n visibility: 'hidden',\n },\n },\n },\n dragIndicatorWrapper: {\n position: 'absolute',\n left: ({ isMobile }) => (isMobile ? '8px' : 0),\n top: ({ isMobile }) => (isMobile ? '20px' : '8px'),\n },\n dragIndicatorButton: {\n visibility: ({ isMobile }) => (isMobile ? 'visible' : 'hidden'),\n padding: '8px',\n background: ({ isMobile }) => (isMobile ? 'none' : theme.palette.background.b9),\n '&:hover': {\n background: theme.palette.background.b7,\n '& $dragIndicatorIcon': {\n color: theme.palette.primary.text1,\n },\n },\n },\n dragIndicatorIcon: {\n cursor: 'pointer',\n color: theme.palette.primary.text6,\n fontSize: '16px',\n },\n}));\n\nconst transformToCss = transform =>\n transform ? `translate3d(${transform.x}px, ${transform.y}px, 0)` : undefined;\n\nconst DragHandle = ({ isMobile, attributes, listeners }) => {\n const classes = useStyles({ isMobile });\n\n return (\n <div className={classes.dragIndicatorWrapper}>\n <Tooltip title={isMobile ? '' : 'Click & Drag to reorder'}>\n <IconButton className={classes.dragIndicatorButton} {...attributes} {...listeners}>\n <DragIndicatorIcon className={classes.dragIndicatorIcon} />\n </IconButton>\n </Tooltip>\n </div>\n );\n};\n\nconst SortableComponent = ({\n isActualBha,\n component,\n isTopComponent,\n isLastCompnent,\n isSortable,\n sortableIndex,\n validate,\n onDelete,\n onSave,\n isMobile,\n viewColumnsPerRow,\n editColumnsPerRow,\n onAutocompleteApplied,\n}) => {\n const classes = useStyles({ isMobile, isSortable });\n const [isEditing, setIsEditing] = useState(false);\n\n const { attributes, listeners, setNodeRef, transform, transition } = useSortable({\n id: component.id,\n });\n\n const style = {\n transform: transformToCss(transform),\n transition,\n };\n\n return (\n <div\n ref={setNodeRef}\n style={style}\n className={classNames(classes.sortableComponent, {\n [classes.topComponent]: !isMobile && isTopComponent,\n [classes.bottomComponent]: !isMobile && isLastCompnent,\n [classes.dragInidicationHidden]: !isSortable && sortableIndex !== -1,\n })}\n >\n {component.family !== BHA_FAMILY.bit && !isEditing && (\n <DragHandle isMobile={isMobile} attributes={attributes} listeners={listeners} />\n )}\n <Component\n isMobile={isMobile}\n isActualBha={isActualBha}\n viewColumnsPerRow={viewColumnsPerRow}\n editColumnsPerRow={editColumnsPerRow}\n component={component}\n validate={validate}\n onSave={onSave}\n onDelete={onDelete}\n onChangeEditing={setIsEditing}\n onAutocompleteApplied={onAutocompleteApplied}\n isDragComponent={sortableIndex !== -1}\n />\n </div>\n );\n};\n\nSortableComponent.propTypes = {\n isActualBha: PropTypes.bool.isRequired,\n isMobile: PropTypes.bool.isRequired,\n component: PropTypes.shape({\n id: PropTypes.string.isRequired,\n family: PropTypes.string,\n }).isRequired,\n isTopComponent: PropTypes.bool.isRequired,\n isLastCompnent: PropTypes.bool.isRequired,\n isSortable: PropTypes.bool.isRequired,\n sortableIndex: PropTypes.number.isRequired,\n validate: PropTypes.func.isRequired,\n onDelete: PropTypes.func.isRequired,\n onSave: PropTypes.func.isRequired,\n viewColumnsPerRow: PropTypes.number.isRequired,\n editColumnsPerRow: PropTypes.number.isRequired,\n onAutocompleteApplied: PropTypes.func.isRequired,\n};\n\nexport default memo(SortableComponent);\n"],"names":["useStyles","makeStyles","theme","sortableComponent","position","visibility","zIndex","background","_ref","isSortable","palette","b5","boxShadow","_ref2","topComponent","marginTop","bottomComponent","marginBottom","dragInidicationHidden","dragIndicatorWrapper","left","_ref3","isMobile","top","_ref4","dragIndicatorButton","_ref5","padding","_ref6","b9","b7","color","primary","text1","dragIndicatorIcon","cursor","text6","fontSize","transformToCss","transform","x","y","undefined","DragHandle","_ref7","attributes","listeners","classes","_jsx","className","children","Tooltip","title","IconButton","_objectSpread","DragIndicatorIcon","SortableComponent","_ref8","_classNames","isActualBha","component","isTopComponent","isLastCompnent","sortableIndex","validate","onDelete","onSave","viewColumnsPerRow","editColumnsPerRow","onAutocompleteApplied","useState","_useState2","_slicedToArray","_useState","isEditing","setIsEditing","_useSortable","useSortable","id","setNodeRef","transition","style","_jsxs","ref","classNames","_defineProperty","family","BHA_FAMILY","bit","Component","onChangeEditing","isDragComponent","propTypes","PropTypes","bool","isRequired","shape","string","number","func","memo"],"mappings":"6jCAWA,IAAMA,EAAYC,GAAW,SAAAC,GAAK,MAAK,CACrCC,kBAAmB,CACjBC,SAAU,WACV,UAAW,CACT,yBAA0B,CACxBC,WAAY,YAGhBC,OAAQ,sBACRC,WAAY,SAAAC,GAAa,SAAVC,YAA+BP,EAAMQ,QAAQH,WAAWI,EAAE,EACzEC,UAAW,SAAAC,GAAa,SAAVJ,YAA+B,gCAAgC,GAE/EK,aAAc,CACZC,UAAW,QAEbC,gBAAiB,CACfC,aAAc,OAEhBC,sBAAuB,CACrB,UAAW,CACT,yBAA0B,CACxBb,WAAY,YAIlBc,qBAAsB,CACpBf,SAAU,WACVgB,KAAM,SAAAC,GAAW,SAARC,SAA2B,MAAQ,CAAE,EAC9CC,IAAK,SAAAC,GAAW,SAARF,SAA2B,OAAS,KAAK,GAEnDG,oBAAqB,CACnBpB,WAAY,SAAAqB,G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
|
|
@@ -1,3 +1,34 @@
|
|
|
1
|
-
declare const _default: import("react").MemoExoticComponent<
|
|
1
|
+
declare const _default: import("react").MemoExoticComponent<{
|
|
2
|
+
({ isActualBha, components, validate, sortableIndex, onDeleteComponent, onSaveComponent, isMobile, viewColumnsPerRow, editColumnsPerRow, onAutocompleteApplied, onSortStart, onSortEnd, lockAxis, lockToContainerEdges, }: {
|
|
3
|
+
isActualBha: any;
|
|
4
|
+
components: any;
|
|
5
|
+
validate: any;
|
|
6
|
+
sortableIndex: any;
|
|
7
|
+
onDeleteComponent: any;
|
|
8
|
+
onSaveComponent: any;
|
|
9
|
+
isMobile: any;
|
|
10
|
+
viewColumnsPerRow: any;
|
|
11
|
+
editColumnsPerRow: any;
|
|
12
|
+
onAutocompleteApplied: any;
|
|
13
|
+
onSortStart: any;
|
|
14
|
+
onSortEnd: any;
|
|
15
|
+
lockAxis: any;
|
|
16
|
+
lockToContainerEdges: any;
|
|
17
|
+
}): JSX.Element;
|
|
18
|
+
propTypes: {
|
|
19
|
+
isActualBha: import("prop-types").Validator<boolean>;
|
|
20
|
+
components: import("prop-types").Requireable<(import("prop-types").InferProps<{
|
|
21
|
+
id: import("prop-types").Validator<string>;
|
|
22
|
+
}> | null | undefined)[]>;
|
|
23
|
+
validate: import("prop-types").Validator<(...args: any[]) => any>;
|
|
24
|
+
sortableIndex: import("prop-types").Validator<number>;
|
|
25
|
+
onSaveComponent: import("prop-types").Validator<(...args: any[]) => any>;
|
|
26
|
+
onDeleteComponent: import("prop-types").Validator<(...args: any[]) => any>;
|
|
27
|
+
isMobile: import("prop-types").Validator<boolean>;
|
|
28
|
+
viewColumnsPerRow: import("prop-types").Validator<number>;
|
|
29
|
+
editColumnsPerRow: import("prop-types").Validator<number>;
|
|
30
|
+
onAutocompleteApplied: import("prop-types").Validator<(...args: any[]) => any>;
|
|
31
|
+
};
|
|
32
|
+
}>;
|
|
2
33
|
export default _default;
|
|
3
34
|
//# sourceMappingURL=SortableComponents.d.ts.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{memo as e}from"react";import{bool as o,arrayOf as i,shape as
|
|
1
|
+
import{memo as e}from"react";import{bool as o,arrayOf as i,shape as n,string as t,func as r,number as d}from"prop-types";import{useSensors as s,useSensor as a,PointerSensor as l,DndContext as m,closestCenter as u}from"@dnd-kit/core";import{SortableContext as p,verticalListSortingStrategy as c}from"@dnd-kit/sortable";import{restrictToVerticalAxis as f,restrictToParentElement as v}from"@dnd-kit/modifiers";import{makeStyles as R}from"@material-ui/core";import C from"./SortableComponent.js";import{jsx as x}from"react/jsx-runtime";var b=R({body:{flex:1,minHeight:0,zIndex:0,position:"relative"}}),q=function(e){var o=e.isActualBha,i=e.components,n=e.validate,t=e.sortableIndex,r=e.onDeleteComponent,d=e.onSaveComponent,R=e.isMobile,q=e.viewColumnsPerRow,A=e.editColumnsPerRow,w=e.onAutocompleteApplied,S=e.onSortStart,h=e.onSortEnd,I=e.lockAxis,g=e.lockToContainerEdges,y=b(),D=s(a(l)),P=["y"===I&&f,g&&v].filter(Boolean);return x(m,{sensors:D,collisionDetection:u,modifiers:P,onDragStart:function(e){var o=e.active;if(S){var n=i.findIndex((function(e){return e.id===o.id}));S({index:n})}},onDragEnd:function(e){var o=e.active,n=e.over;if(h){var t=i.findIndex((function(e){return e.id===o.id})),r=n?i.findIndex((function(e){return e.id===n.id})):t;h(t,r)}},children:x(p,{items:i.map((function(e){return e.id})),strategy:c,children:x("div",{className:y.body,children:i.map((function(e,s){return x(C,{isSortable:t===s,sortableIndex:t,component:e,isActualBha:o,isTopComponent:0===s,isLastCompnent:s===i.length-1,validate:n,onDelete:r,onSave:d,isMobile:R,viewColumnsPerRow:q,editColumnsPerRow:A,onAutocompleteApplied:w},e.id)}))})})})};q.propTypes={isActualBha:o.isRequired,components:i(n({id:t.isRequired})),validate:r.isRequired,sortableIndex:d.isRequired,onSaveComponent:r.isRequired,onDeleteComponent:r.isRequired,isMobile:o.isRequired,viewColumnsPerRow:d.isRequired,editColumnsPerRow:d.isRequired,onAutocompleteApplied:r.isRequired};var A=e(q);export{A as default};
|
|
2
2
|
//# sourceMappingURL=SortableComponents.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SortableComponents.js","sources":["../../../../../src/components/Drillstring/BHAComponentsTable/components/SortableComponents.js"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"SortableComponents.js","sources":["../../../../../src/components/Drillstring/BHAComponentsTable/components/SortableComponents.js"],"sourcesContent":["/* eslint-disable react/require-default-props */\nimport { memo } from 'react';\nimport { arrayOf, bool, func, number, shape, string } from 'prop-types';\nimport { closestCenter, DndContext, PointerSensor, useSensor, useSensors } from '@dnd-kit/core';\nimport { SortableContext, verticalListSortingStrategy } from '@dnd-kit/sortable';\nimport { restrictToParentElement, restrictToVerticalAxis } from '@dnd-kit/modifiers';\nimport { makeStyles } from '@material-ui/core';\n\nimport SortableComponent from './SortableComponent';\n\nconst useStyles = makeStyles({\n body: {\n flex: 1,\n minHeight: 0,\n zIndex: 0,\n position: 'relative',\n },\n});\n\nconst SortableComponents = ({\n isActualBha,\n components,\n validate,\n sortableIndex,\n onDeleteComponent,\n onSaveComponent,\n isMobile,\n viewColumnsPerRow,\n editColumnsPerRow,\n onAutocompleteApplied,\n onSortStart,\n onSortEnd,\n lockAxis,\n lockToContainerEdges,\n}) => {\n const classes = useStyles();\n const sensors = useSensors(useSensor(PointerSensor));\n\n const modifiers = [\n lockAxis === 'y' && restrictToVerticalAxis,\n lockToContainerEdges && restrictToParentElement,\n ].filter(Boolean);\n\n const handleDragStart = ({ active }) => {\n if (!onSortStart) {\n return;\n }\n const index = components.findIndex(item => item.id === active.id);\n onSortStart({ index });\n };\n\n const handleDragEnd = ({ active, over }) => {\n if (!onSortEnd) {\n return;\n }\n const oldIndex = components.findIndex(item => item.id === active.id);\n const newIndex = over ? components.findIndex(item => item.id === over.id) : oldIndex;\n onSortEnd(oldIndex, newIndex);\n };\n\n return (\n <DndContext\n sensors={sensors}\n collisionDetection={closestCenter}\n modifiers={modifiers}\n onDragStart={handleDragStart}\n onDragEnd={handleDragEnd}\n >\n <SortableContext\n items={components.map(component => component.id)}\n strategy={verticalListSortingStrategy}\n >\n <div className={classes.body}>\n {components.map((component, index) => (\n <SortableComponent\n key={component.id}\n isSortable={sortableIndex === index}\n sortableIndex={sortableIndex}\n component={component}\n isActualBha={isActualBha}\n isTopComponent={index === 0}\n isLastCompnent={index === components.length - 1}\n validate={validate}\n onDelete={onDeleteComponent}\n onSave={onSaveComponent}\n isMobile={isMobile}\n viewColumnsPerRow={viewColumnsPerRow}\n editColumnsPerRow={editColumnsPerRow}\n onAutocompleteApplied={onAutocompleteApplied}\n />\n ))}\n </div>\n </SortableContext>\n </DndContext>\n );\n};\n\nSortableComponents.propTypes = {\n isActualBha: bool.isRequired,\n components: arrayOf(shape({ id: string.isRequired })),\n validate: func.isRequired,\n sortableIndex: number.isRequired,\n onSaveComponent: func.isRequired,\n onDeleteComponent: func.isRequired,\n isMobile: bool.isRequired,\n viewColumnsPerRow: number.isRequired,\n editColumnsPerRow: number.isRequired,\n onAutocompleteApplied: func.isRequired,\n};\n\nexport default memo(SortableComponents);\n"],"names":["useStyles","makeStyles","body","flex","minHeight","zIndex","position","SortableComponents","_ref","isActualBha","components","validate","sortableIndex","onDeleteComponent","onSaveComponent","isMobile","viewColumnsPerRow","editColumnsPerRow","onAutocompleteApplied","onSortStart","onSortEnd","lockAxis","lockToContainerEdges","classes","sensors","useSensors","useSensor","PointerSensor","modifiers","restrictToVerticalAxis","restrictToParentElement","filter","Boolean","_jsx","DndContext","collisionDetection","closestCenter","onDragStart","_ref2","active","index","findIndex","item","id","onDragEnd","_ref3","over","oldIndex","newIndex","children","SortableContext","items","map","component","strategy","verticalListSortingStrategy","className","SortableComponent","isSortable","isTopComponent","isLastCompnent","length","onDelete","onSave","propTypes","bool","isRequired","arrayOf","shape","string","func","number","memo"],"mappings":"ohBAUA,IAAMA,EAAYC,EAAW,CAC3BC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EACbkD,eAA0B,IAAVnB,EAChBoB,eAAgBpB,IAAU9B,EAAWmD,OAAS,EAC9ClD,SAAUA,EACVmD,SAAUjD,EACVkD,OAAQjD,EACRC,SAAUA,EACVC,kBAAmBA,EACnBC,kBAAmBA,EACnBC,sBAAuBA,GAblBmC,EAAUV,YAoB7B,EAEApC,EAAmByD,UAAY,CAC7BvD,YAAawD,EAAKC,WAClBxD,WAAYyD,EAAQC,EAAM,CAAEzB,GAAI0B,EAAOH,cACvCvD,SAAU2D,EAAKJ,WACftD,cAAe2D,EAAOL,WACtBpD,gBAAiBwD,EAAKJ,WACtBrD,kBAAmByD,EAAKJ,WACxBnD,SAAUkD,EAAKC,WACflD,kBAAmBuD,EAAOL,WAC1BjD,kBAAmBsD,EAAOL,WAC1BhD,sBAAuBoD,EAAKJ,YAG9B,IAAeM,EAAAA,EAAKjE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CsvViewer.d.ts","sourceRoot":"","sources":["../../../../src/components/NewDocumentViewer/components/CsvViewer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"CsvViewer.d.ts","sourceRoot":"","sources":["../../../../src/components/NewDocumentViewer/components/CsvViewer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAmG1B,UAAU,cAAc;IACtB,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,CAAC;CACjC;AAED,QAAA,MAAM,SAAS,EAAE,KAAK,CAAC,EAAE,CAAC,cAAc,CAyBvC,CAAC;AAEF,OAAO,EAAE,SAAS,EAAE,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import
|
|
1
|
+
import e from"@babel/runtime/helpers/defineProperty";import{jsx as r,jsxs as t}from"react/jsx-runtime";import{List as o}from"react-window";import{makeStyles as i}from"@material-ui/core";import{isDate as n}from"lodash";function l(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);r&&(o=o.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,o)}return t}function a(r){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?l(Object(o),!0).forEach((function(t){e(r,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(o)):l(Object(o)).forEach((function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(o,e))}))}return r}var c="1px solid #5C5C5C",s=i({tableWrapper:{borderTop:c,borderBottom:c,width:"100%",height:"100%",overflow:"scroll",position:"relative"},wrapper:{position:"absolute",inset:0},list:{position:"absolute !important",inset:"".concat(40,"px 0 0 0")},header:{display:"flex",flexFlow:"row nowrap",height:40,top:0,zIndex:1,background:"inherit",border:c,fontWeight:700},headerCell:{flex:"0 0 auto",width:200,display:"flex",alignItems:"center",padding:"0 8px"},row:{display:"flex",flexFlow:"row nowrap"},cell:{flex:"0 0 auto",width:200,display:"flex",alignItems:"center",padding:"0 8px",border:c,"&:not(:first-child)":{borderLeft:"none"},"&:not(:last-child)":{borderRight:"none"}}}),p=function(e){var t=e.index,o=e.style,i=e.ariaAttributes,l=e.columns,c=e.fileData,p=s(),d=c[t];return r("div",a(a({className:p.row,style:o},i),{},{children:l.map((function(e){var t=null==d?void 0:d[e];return r("div",{className:p.cell,children:n(t)?t.toISOString():t},e)}))}))},d=function(e){var i=e.fileData,n=s(),l=Object.keys(i[0]||{}),a=200*(l.length||10);return r("div",{className:n.tableWrapper,children:t("div",{style:{width:a},className:n.wrapper,children:[r("div",{className:n.header,children:l.map((function(e){return r("div",{className:n.headerCell,children:e},e)}))}),r(o,{rowCount:i.length,rowHeight:50,rowComponent:p,rowProps:{columns:l,fileData:i},className:n.list})]})})};export{d as CsvViewer};
|
|
2
2
|
//# sourceMappingURL=CsvViewer.js.map
|
|
@@ -1,5 +1,85 @@
|
|
|
1
1
|
export const ROW_HEIGHT: 48;
|
|
2
2
|
export const HEADER_HEIGHT: 44;
|
|
3
|
-
declare const _default: import("react").ComponentType<Pick<
|
|
3
|
+
declare const _default: import("react").ComponentType<Pick<Pick<Pick<{
|
|
4
|
+
subjectWell: any;
|
|
5
|
+
wells: any;
|
|
6
|
+
offsetWells: any;
|
|
7
|
+
metricsKeys: any;
|
|
8
|
+
isMetricsLoading: any;
|
|
9
|
+
sortInfo: any;
|
|
10
|
+
unusableWellAlarm: any;
|
|
11
|
+
classes: any;
|
|
12
|
+
onChangeMetricsKeys: any;
|
|
13
|
+
onAddOffsetWell: any;
|
|
14
|
+
onDeleteOffsetWell: any;
|
|
15
|
+
onAddAllOffsetWells: any;
|
|
16
|
+
onDeleteAllOffsetWells: any;
|
|
17
|
+
onSorting: any;
|
|
18
|
+
}, never> & Pick<PropTypes.InferProps<{
|
|
19
|
+
subjectWell: PropTypes.Requireable<PropTypes.InferProps<{
|
|
20
|
+
id: PropTypes.Requireable<number>;
|
|
21
|
+
}>>;
|
|
22
|
+
wells: PropTypes.Validator<(PropTypes.InferProps<{}> | null | undefined)[]>;
|
|
23
|
+
offsetWells: PropTypes.Validator<(PropTypes.InferProps<{}> | null | undefined)[]>;
|
|
24
|
+
metricsKeys: PropTypes.Validator<(string | null | undefined)[]>;
|
|
25
|
+
isMetricsLoading: PropTypes.Validator<boolean>;
|
|
26
|
+
sortInfo: PropTypes.Validator<NonNullable<PropTypes.InferProps<{
|
|
27
|
+
key: PropTypes.Validator<string>;
|
|
28
|
+
direction: PropTypes.Validator<number>;
|
|
29
|
+
}>>>;
|
|
30
|
+
classes: PropTypes.Validator<NonNullable<PropTypes.InferProps<{}>>>;
|
|
31
|
+
onChangeMetricsKeys: PropTypes.Validator<(...args: any[]) => any>;
|
|
32
|
+
onAddOffsetWell: PropTypes.Validator<(...args: any[]) => any>;
|
|
33
|
+
onDeleteOffsetWell: PropTypes.Validator<(...args: any[]) => any>;
|
|
34
|
+
onAddAllOffsetWells: PropTypes.Validator<(...args: any[]) => any>;
|
|
35
|
+
onDeleteAllOffsetWells: PropTypes.Validator<(...args: any[]) => any>;
|
|
36
|
+
onSorting: PropTypes.Validator<(...args: any[]) => any>;
|
|
37
|
+
unusableWellAlarm: PropTypes.Validator<string>;
|
|
38
|
+
}>, "subjectWell" | PropTypes.RequiredKeys<{
|
|
39
|
+
subjectWell: PropTypes.Requireable<PropTypes.InferProps<{
|
|
40
|
+
id: PropTypes.Requireable<number>;
|
|
41
|
+
}>>;
|
|
42
|
+
wells: PropTypes.Validator<(PropTypes.InferProps<{}> | null | undefined)[]>;
|
|
43
|
+
offsetWells: PropTypes.Validator<(PropTypes.InferProps<{}> | null | undefined)[]>;
|
|
44
|
+
metricsKeys: PropTypes.Validator<(string | null | undefined)[]>;
|
|
45
|
+
isMetricsLoading: PropTypes.Validator<boolean>;
|
|
46
|
+
sortInfo: PropTypes.Validator<NonNullable<PropTypes.InferProps<{
|
|
47
|
+
key: PropTypes.Validator<string>;
|
|
48
|
+
direction: PropTypes.Validator<number>;
|
|
49
|
+
}>>>;
|
|
50
|
+
classes: PropTypes.Validator<NonNullable<PropTypes.InferProps<{}>>>;
|
|
51
|
+
onChangeMetricsKeys: PropTypes.Validator<(...args: any[]) => any>;
|
|
52
|
+
onAddOffsetWell: PropTypes.Validator<(...args: any[]) => any>;
|
|
53
|
+
onDeleteOffsetWell: PropTypes.Validator<(...args: any[]) => any>;
|
|
54
|
+
onAddAllOffsetWells: PropTypes.Validator<(...args: any[]) => any>;
|
|
55
|
+
onDeleteAllOffsetWells: PropTypes.Validator<(...args: any[]) => any>;
|
|
56
|
+
onSorting: PropTypes.Validator<(...args: any[]) => any>;
|
|
57
|
+
unusableWellAlarm: PropTypes.Validator<string>;
|
|
58
|
+
}>>, PropTypes.RequiredKeys<{
|
|
59
|
+
subjectWell: PropTypes.Requireable<PropTypes.InferProps<{
|
|
60
|
+
id: PropTypes.Requireable<number>;
|
|
61
|
+
}>>;
|
|
62
|
+
wells: PropTypes.Validator<(PropTypes.InferProps<{}> | null | undefined)[]>;
|
|
63
|
+
offsetWells: PropTypes.Validator<(PropTypes.InferProps<{}> | null | undefined)[]>;
|
|
64
|
+
metricsKeys: PropTypes.Validator<(string | null | undefined)[]>;
|
|
65
|
+
isMetricsLoading: PropTypes.Validator<boolean>;
|
|
66
|
+
sortInfo: PropTypes.Validator<NonNullable<PropTypes.InferProps<{
|
|
67
|
+
key: PropTypes.Validator<string>;
|
|
68
|
+
direction: PropTypes.Validator<number>;
|
|
69
|
+
}>>>;
|
|
70
|
+
classes: PropTypes.Validator<NonNullable<PropTypes.InferProps<{}>>>;
|
|
71
|
+
onChangeMetricsKeys: PropTypes.Validator<(...args: any[]) => any>;
|
|
72
|
+
onAddOffsetWell: PropTypes.Validator<(...args: any[]) => any>;
|
|
73
|
+
onDeleteOffsetWell: PropTypes.Validator<(...args: any[]) => any>;
|
|
74
|
+
onAddAllOffsetWells: PropTypes.Validator<(...args: any[]) => any>;
|
|
75
|
+
onDeleteAllOffsetWells: PropTypes.Validator<(...args: any[]) => any>;
|
|
76
|
+
onSorting: PropTypes.Validator<(...args: any[]) => any>;
|
|
77
|
+
unusableWellAlarm: PropTypes.Validator<string>;
|
|
78
|
+
}>> & {
|
|
79
|
+
subjectWell?: PropTypes.InferProps<{
|
|
80
|
+
id: PropTypes.Requireable<number>;
|
|
81
|
+
}> | null | undefined;
|
|
82
|
+
} & {}, "wells" | "subjectWell" | "offsetWells" | "unusableWellAlarm" | "onAddOffsetWell" | "onDeleteOffsetWell" | "metricsKeys" | "isMetricsLoading" | "sortInfo" | "onChangeMetricsKeys" | "onAddAllOffsetWells" | "onDeleteAllOffsetWells" | "onSorting"> & import("@material-ui/styles").StyledComponentProps<"header" | "table" | "title" | "cell" | "row" | "tableWrapper" | "headerCell" | "sortIcon" | "rowCell" | "nameWrapper" | "nameCell" | "unitCell" | "tableRowHoverEnabled" | "settingsCell" | "rigReleaseCell" | "nameCheckBox" | "bodyCell" | "metricsCellWrapper" | "tableTitle" | "tableTitleItems" | "addWellInput" | "sortIconButton" | "ascendingSortIcon" | "metricsColumn" | "tableCellLabel" | "tableCellLabelDisabled" | "errorMsg">>;
|
|
4
83
|
export default _default;
|
|
84
|
+
import PropTypes from 'prop-types';
|
|
5
85
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/OffsetWellPickerV2/components/Table/index.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/OffsetWellPickerV2/components/Table/index.js"],"names":[],"mappings":"AAkBA,yBAA0B,EAAE,CAAC;AAC7B,4BAA6B,EAAE,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;sBAlBV,YAAY"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import e from"@babel/runtime/helpers/defineProperty";import t from"@babel/runtime/helpers/toConsumableArray";import{memo as r,useMemo as
|
|
1
|
+
import e from"@babel/runtime/helpers/defineProperty";import t from"@babel/runtime/helpers/toConsumableArray";import{memo as r,useMemo as i}from"react";import n from"prop-types";import{isEqual as l,get as a,clone as o}from"lodash";import s from"moment";import c from"classnames";import{withStyles as d,Checkbox as f,Typography as u,IconButton as m}from"@material-ui/core";import p from"@material-ui/icons/Sort";import h from"@material-ui/icons/NotInterested";import{List as b}from"react-window";import{METRICS_LIST as g,TABLE_COLUMNS as y,SETTINGS_COLUMN as w,METRICS_KEYS as x}from"../../constants.js";import C from"./SubjectIndicator.js";import v from"./MetricsAddMenu.js";import W from"./MetricsSelect.js";import{getUnitDisplay as k,convertValue as O}from"../../../../utils/index.js";import{jsx as N,Fragment as j,jsxs as I}from"react/jsx-runtime";function S(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 R(t){for(var r=1;r<arguments.length;r++){var i=null!=arguments[r]?arguments[r]:{};r%2?S(Object(i),!0).forEach((function(r){e(t,r,i[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):S(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}var D=48,A="WellsTable";function _(e,t){var r,i=a(e,t);switch(t){case"distance":r=Number.isFinite(i)?parseFloat(i).toFixed(2):"N/A";break;case"rigReleaseDate":r=Number.isFinite(i)?s.unix(i).format("MM/DD/YYYY"):"N/A";break;default:r=i||""}return r}function q(r){var n=r.subjectWell,s=r.wells,d=r.offsetWells,S=r.metricsKeys,D=r.isMetricsLoading,q=r.sortInfo,T=r.unusableWellAlarm,B=r.classes,L=r.onChangeMetricsKeys,M=r.onAddOffsetWell,P=r.onDeleteOffsetWell,K=r.onAddAllOffsetWells,z=r.onDeleteAllOffsetWells,F=r.onSorting,Y=i((function(){return s.filter((function(e){return e.is_usable}))}),[s]),H=i((function(){var e=Y.map((function(e){return e.id})).sort(),t=d.map((function(e){return e.id})).sort();return e.length&&l(e,t)}),[Y,d]),E=i((function(){return S.reduce((function(e,t){return e.concat(g.filter((function(e){return e.key===t})))}),[])}),[S]),G=i((function(){return[].concat(t(y),t(E.map((function(e){return R(R({},e),{},{width:240})}))),[w])}),[E]),V=function(e){L(e)},X=function(e){e.target.checked?K():z()},$=function(t){return N(m,{"data-testid":"".concat(A,"_sortRemove"),"data-not-migrated-muiiconbutton":!0,className:B.sortIconButton,onClick:function(){return function(e){F(e)}(t)},children:t!==q.key?N(h,{className:B.sortIcon}):N(p,{className:c(B.sortIcon,e({},B.ascendingSortIcon,1===q.direction))})})},J=function(e){var t,r=e.label,i=e.dataKey;if("name"===i)return I("div",{"data-testid":"".concat(A,"_wellHeader"),className:B.nameWrapper,children:[N(f,{"data-testid":"".concat(A,"_selectAll"),classes:{checked:B.nameCheckBox,indeterminate:B.nameCheckBox},onClick:X,checked:H,indeterminate:d.length>0&&!H,size:"small"}),N(u,{className:c(B.cell,B.nameCell),children:r}),$(i)]});if(S.includes(i)){var n=E.find((function(e){return e.key===i})),l=E.findIndex((function(e){return e.key===i}));return I("div",{"data-testid":"".concat(A,"_header_").concat(i),className:B.metricsColumn,children:[N(W,{items:g,currentValue:i,onChange:(t=l,function(e){var r=o(S);r[t]=e,L(r)})}),N(u,{className:c(B.cell,B.unitCell),children:n.unitType?"(".concat(k(n.unitType,n.to),")"):""}),$(i)]})}return i===w.key?N("div",{className:B.settingsCell,children:N(v,{metricsKeys:S,onChange:V})}):I("div",{"data-testid":"".concat(A,"_header_").concat(r),className:B.nameWrapper,children:[N(u,{className:B.cell,children:r}),$(i)]})},Q=function(t){var r=t.well,i=t.dataKey;if("name"===i)return I("div",{"data-testid":"".concat(A,"_row_").concat(r.name),className:B.nameWrapper,children:[N(f,{"data-testid":"".concat(A,"_wellCheckbox"),color:"primary",checked:d.findIndex((function(e){return e.id===r.id}))>-1,onChange:function(e){return t=r.id,void(e.target.checked?M(t):P(t));var t},size:"small",disabled:!r.is_usable}),N(u,{"data-testid":"".concat(A,"_wellName"),className:c(B.tableCellLabel,e({},B.tableCellLabelDisabled,!r.is_usable)),children:_(r,i)}),n&&r.id===n.id&&N(C,{})]});if(i===w.key)return N("div",{className:B.settingsCell,children:!r.is_usable&&N(u,{className:B.errorMsg,children:T})});var l=null;if(S.includes(i)){var o=E.find((function(e){return e.key===i}));l=function(e,t,r){var i=a(e,t.key);if(x.includes(t.key)){if(Number.isFinite(i)||i)return t.unitType?O(i,t.unitType,t.from,t.to):i;if(r)return"loading..."}return""}(r,o,D)}else l=_(r,i);return N(u,{"data-testid":"".concat(A,"_cell}"),className:c(B.cell,B.tableCellLabel,e({},B.tableCellLabelDisabled,!r.is_usable)),children:l})};return N(j,{children:I("div",{className:B.tableWrapper,children:[N("div",{className:B.header,children:G.map((function(e){return N("div",{className:B.headerCell,style:{flexBasis:e.width,minWidth:e.minWidth,flexGrow:e.minWidth?1:0},children:J({label:e.label,dataKey:e.key})},e.key)}))}),N("div",{className:B.table,children:N(b,{rowCount:s.length,rowHeight:48,rowComponent:function(e){var t=e.index,r=e.style,i=e.ariaAttributes,n=e.wells;return N("div",R(R({style:R({},r)},i),{},{className:B.row,children:G.map((function(e){return N("div",{style:{flexBasis:e.width,minWidth:e.minWidth,flexGrow:e.minWidth?1:0},className:B.rowCell,children:Q({well:n[t],dataKey:e.key})},e.key)}))}))},rowProps:{wells:s,tableColumns:G}})})]})})}q.propTypes={subjectWell:n.shape({id:n.number}),wells:n.arrayOf(n.shape({})).isRequired,offsetWells:n.arrayOf(n.shape({})).isRequired,metricsKeys:n.arrayOf(n.string).isRequired,isMetricsLoading:n.bool.isRequired,sortInfo:n.shape({key:n.string.isRequired,direction:n.number.isRequired}).isRequired,classes:n.shape({}).isRequired,onChangeMetricsKeys:n.func.isRequired,onAddOffsetWell:n.func.isRequired,onDeleteOffsetWell:n.func.isRequired,onAddAllOffsetWells:n.func.isRequired,onDeleteAllOffsetWells:n.func.isRequired,onSorting:n.func.isRequired,unusableWellAlarm:n.string.isRequired},q.defaultProps={subjectWell:null};var T=d((function(e){return{title:{display:"flex",justifyContent:"space-between",alignItems:"center",flexWrap:"wrap",marginBottom:"15px",marginTop:"16px"},tableWrapper:{marginTop:"24px",overflowX:"auto",overflowY:"hidden",position:"relative",minHeight:150,borderTop:"1px solid rgba(81, 81, 81, 1)",height:"100vh"},table:{position:"absolute!important",inset:"44px 0 0"},header:{display:"flex",flexFlow:"row nowrap",borderBottom:e.isLightTheme?"1px solid rgba(224, 224, 224, 1)":"1px solid rgba(81, 81, 81, 1)",height:44,alignItems:"center"},headerCell:{flex:"0 0",alignSelf:"center",paddingRight:10,"&:first-child":{marginLeft:10}},row:{display:"flex",flexFlow:"row nowrap",borderBottom:e.isLightTheme?"1px solid rgba(224, 224, 224, 1)":"1px solid rgba(81, 81, 81, 1)",height:48,alignItems:"center"},rowCell:{flex:"0 0",alignSelf:"center",paddingRight:10,"&:first-child":{paddingLeft:10}},cell:{color:"rgba(255, 255, 255, 0.54)",padding:"5px 10px",fontSize:"12px",whiteSpace:"nowrap"},nameWrapper:{display:"flex",alignItems:"center"},nameCell:{padding:0},unitCell:{padding:0},tableRowHoverEnabled:{"&:hover":{backgroundColor:"rgba(255, 255, 255, 0.1)"}},settingsCell:{textAlign:"right"},rigReleaseCell:{whiteSpace:"nowrap"},nameCheckBox:{color:e.palette.primary.main},bodyCell:{fontSize:"0.90rem",padding:"5px 10px"},metricsCellWrapper:{display:"flex",flexDirection:"row",alignContent:"center"},tableTitle:{fontSize:"16px",lineHeight:"140.6%",marginTop:10},tableTitleItems:{display:"flex",flexDirection:"row",alignItems:"center"},addWellInput:{width:300,marginTop:10},sortIconButton:{padding:"8px","&:hover $sortIcon":{color:"#fff"}},ascendingSortIcon:{transform:"scaleY(-1)"},sortIcon:{fontSize:"14px",color:"#BDBDBD"},metricsColumn:{display:"flex",alignItems:"center"},tableCellLabel:{fontSize:"0.90rem",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",color:"#fff"},tableCellLabelDisabled:{color:"#C4C4C4"},errorMsg:{color:"#C4C4C4",fontStyle:"italic",fontSize:"14px",padding:"0 16px",whiteSpace:"nowrap"}}}))(r(q));export{D as ROW_HEIGHT,T as default};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|