@corva/ui 0.36.0-1 → 0.36.0-10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/AssetEditor/AssetEditorAutocomplete.js +1 -1
- package/components/AssetEditor/effects/index.js +1 -1
- package/components/Autocomplete/Autocomplete.js +1 -1
- package/components/Casing/CasingTable/CasingComponent.js +1 -1
- package/components/CommentInput/index.js +1 -1
- package/components/DevCenter/AppSideBar/AppSideBar.js +1 -1
- package/components/FeedItem/components/Content.js +1 -1
- package/components/FeedItem/components/FeedComments.js +1 -1
- package/components/FeedItem/components/Reactions.js +1 -1
- package/components/FeedItem/components/TypeAndAssetTitle.js +1 -1
- package/components/FeedItem/feedItemTypes/DepthCommentFeedItem.js +1 -0
- package/components/Modal/index.js +1 -1
- package/components/ParameterCharts/components/TraceSelect.js +1 -1
- package/components/RangeSlider/RangeSlider.js +1 -1
- package/config/theme/tooltipOverrides.js +1 -1
- package/constants/feed.js +1 -1
- package/package.json +6 -3
- package/utils/FluidCheckUtils.js +1 -1
- package/utils/dashboardReports.js +1 -1
- package/utils/feed.js +1 -1
- package/utils/main.js +1 -1
- package/utils/time.js +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"@babel/runtime/helpers/slicedToArray";import t from"@babel/runtime/helpers/defineProperty";import r from"@babel/runtime/helpers/objectWithoutProperties";import{forwardRef as n,useState as o,useEffect as i,useMemo as a}from"react";import l from"prop-types";import{debounce as s,identity as p}from"lodash";import{List as
|
|
1
|
+
import e from"@babel/runtime/helpers/slicedToArray";import t from"@babel/runtime/helpers/defineProperty";import r from"@babel/runtime/helpers/objectWithoutProperties";import{forwardRef as n,useState as o,useEffect as i,useMemo as a}from"react";import l from"prop-types";import{debounce as s,identity as p}from"lodash";import{List as d,withStyles as u,Typography as c,FormControl as m,InputLabel as f,Tooltip as b,Chip as y,FormHelperText as g,TextField as h,InputAdornment as v}from"@material-ui/core";import{Search as O}from"@material-ui/icons";import{Autocomplete as x}from"@material-ui/lab";import T from"../TruncatedText/index.js";import{PER_PAGE as P,SCROLL_THRESHOLD as I}from"./constants.js";import{useAssetAutoCompleteSelectData as C}from"./effects/index.js";import{jsxs as j,jsx as A}from"react/jsx-runtime";var S=["children","loading","hasMore"];function M(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function q(e){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{};r%2?M(Object(n),!0).forEach((function(r){t(e,r,n[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):M(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var w="DC_SingleAssetEditorAutocomplete",L={paddingLeft:"16px",height:36,listStyleType:"none",display:"flex",alignItems:"center"},D=function(e){var t=e.text;return A("li",{style:L,children:A(c,{variant:"body2",color:"textSecondary",children:void 0===t?"Loading...":t})},"loading")},N=n((function(e,t){var n=e.children,o=e.loading,i=e.hasMore,a=r(e,S);return j(d,q(q({},a),{},{ref:t,role:"listbox",children:[n,(i||o)&&A(D,{})]}))})),R=function(t){var r,n=t["data-testid"],l=t.appKey,d=t.assetType,u=t.classes,c=t.companyId,S=t.currentValue,M=t.disabled,L=t.disableClearable,R=t.errorText,V=t.isMultiple,E=t.isNullable,K=t.label,_=t.onChange,k=t.parentAssetId,z=t.parentAssetType,H=t.queryParams,B=t.autocompleteProps,F=void 0===B?{}:B,W=t.assetFields,G=o(V?[]:null),J=e(G,2),Q=J[0],U=J[1],X=o(""),Y=e(X,2),Z=Y[0],$=Y[1],ee=o(""),te=e(ee,2),re=te[0],ne=te[1],oe=o(!1),ie=e(oe,2),ae=ie[0],le=ie[1],se=o(1),pe=e(se,2),de=pe[0],ue=pe[1],ce=o(!0),me=e(ce,2),fe=me[0],be=me[1];i((function(){U(V?[]:null),ue(1),le(!1)}),[d]);var ye=C({appKey:l,assetType:d,companyId:c,currentValue:S,isMultiple:V,parentAssetId:k,parentAssetType:z,scrollPage:de,searchText:Z,setCurrentOption:U,queryParams:H,assetFields:W}),ge=ye.assets,he=ye.loading;i((function(){var e=ge.length>=P*de;be(e)}),[ge,de]);var ve=a((function(){return s((function(e){ue(1),$(e)}),200)}),[]),Oe=a((function(){return s((function(){return ue((function(e){return e+1}))}),250)}),[]),xe={endAdornment:u.endAdornment,inputRoot:u.inputRoot,listbox:u.listbox,noOptions:u.noOptions,option:u.option,popupIndicator:u.popupIndicator,root:u.root};return j(m,{disabled:M,error:!!R,className:u.formControl,children:[!E&&A(f,{shrink:!0,children:K}),A(b,{title:null!==(r=null==Q?void 0:Q.name)&&void 0!==r?r:"",children:A(x,q(q({disabled:M,blurOnSelect:!0,classes:xe,clearOnBlur:!0,clearOnEscape:!0,"data-testid":n,disableClearable:L,filterOptions:p,getOptionLabel:function(e){return null==e?void 0:e.name},getOptionSelected:function(e,t){return e&&t&&e.id===t.id},inputValue:ae?re:(null==Q?void 0:Q.name)||"",ListboxComponent:N,ListboxProps:{onScroll:function(e){if(fe&&!he){var t=e.currentTarget;t.scrollTop+t.clientHeight>t.scrollHeight-I&&Oe()}},loading:he,hasMore:fe},options:ge,onChange:function(e,t){var r;U(t),_(V?t.map((function(e){return e.id})):null!==(r=null==t?void 0:t.id)&&void 0!==r?r:null,t)},onClose:function(){ne(""),$(""),le(!1),ue(1)},onInputChange:function(e,t,r){"input"===r?(ne(t),le(!0),ve(t)):$("")},noOptionsText:A(D,{text:he?"Loading...":"No options"}),renderInput:function(e){return A(h,q(q({},e),{},{variant:"standard",placeholder:"Search for asset..."},!V&&{InputProps:q(q({},e.InputProps),{},{startAdornment:A(v,{children:A(O,{className:u.searchIcon})})})}))},renderOption:function(e){var t=e.id,r=e.name;return A(T,{"data-testid":"".concat(w,"_option_").concat(r,"MenuItem"),children:V&&S.includes(t)?"".concat(r," (already selected)"):r},t)},value:Q,multiple:V},V&&{renderTags:function(e,t){return e.map((function(e,r){return A(y,q({label:null==e?void 0:e.name},t({index:r})),e.id)}))},getOptionDisabled:function(e){return S.includes(e.id)}}),F))}),A(g,{children:R})]})};R.defaultProps={label:"Choose An Asset",currentValue:void 0,disableClearable:!0,isNullable:!1,parentAssetId:void 0,parentAssetType:void 0,companyId:void 0,errorText:"","data-testid":"".concat(w,"_autoComplete"),disabled:!1,isMultiple:!1,appKey:null,queryParams:{}},R.propTypes={label:l.string,currentValue:l.oneOfType([l.number,l.arrayOf(l.number)]),isNullable:l.bool,onChange:l.func.isRequired,classes:l.shape({}).isRequired,disableClearable:l.bool,parentAssetId:l.number,parentAssetType:l.string,companyId:l.number,assetType:l.string.isRequired,errorText:l.string,"data-testid":l.string,disabled:l.bool,isMultiple:l.bool,appKey:l.string,queryParams:l.shape({})};var V=u((function(e){return{formControl:{},listbox:{maxHeight:350},root:{fontSize:16},inputRoot:{paddingTop:16,padding:"8px 0",paddingBottom:0,width:350,fontSize:16},popupIndicator:{display:"none"},option:{paddingLeft:"16px !important",height:36,"&[aria-disabled=true]":{color:e.palette.primary.text9,opacity:1,backgroundColor:"unset"}},noOptions:{padding:0},searchIcon:{fontSize:"20px !important"}}}))(R);export{V as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"@babel/runtime/helpers/asyncToGenerator";import r from"@babel/runtime/helpers/slicedToArray";import t from"@babel/runtime/helpers/defineProperty";import n from"@babel/runtime/regenerator";import{useState as
|
|
1
|
+
import e from"@babel/runtime/helpers/asyncToGenerator";import r from"@babel/runtime/helpers/slicedToArray";import t from"@babel/runtime/helpers/defineProperty";import n from"@babel/runtime/helpers/toConsumableArray";import a from"@babel/runtime/regenerator";import{useState as o,useEffect as s,useRef as i}from"react";import"uuid";import"lodash";import"lodash/set";import"lodash/get";import"lodash/unset";import"moment";import{mapAssetGetRequest as p}from"../../../clients/jsonApi/index.js";import"../../../clients/subscriptions.js";import"../../../clients/api/apiCore.js";import"../../../clients/constants.js";import{PER_PAGE as c}from"../constants.js";function u(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,n)}return t}function l(e){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{};r%2?u(Object(n),!0).forEach((function(r){t(e,r,n[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):u(Object(n)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))}))}return e}var m=function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return{sort:"name",order:"asc",fields:["".concat(e,".name"),"".concat(e,".asset_id")].concat(n(r))}},f=function(e){var r,t,n;return l(l({},e.attributes),{},{id:+e.id,programId:+(null===(r=e.relationships)||void 0===r||null===(t=r.program)||void 0===t||null===(n=t.data)||void 0===n?void 0:n.id)})};function d(n){var i=n.appKey,c=n.assetType,u=n.assetId,d=n.parentAssetType,y=n.parentAssetId,b=n.queryParams,h=o([]),v=r(h,2),g=v[0],O=v[1],j=o(!0),w=r(j,2),P=w[0],x=w[1];return s((function(){function r(){return(r=e(a.mark((function e(){var r;return a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,p(c)(l(l(l({},m(c)),{},t({per_page:1e4},d,y),i&&{app_key:i}),b));case 2:r=e.sent,O(r.data.map(f)),x(!1);case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}x(!0),function(){r.apply(this,arguments)}()}),[c,u,d,y,i]),{assets:g,loading:P}}function y(t){var n=t.appKey,u=t.assetType,d=t.companyId,y=t.currentValue,b=t.isMultiple,h=t.parentAssetId,v=t.parentAssetType,g=t.scrollPage,O=t.searchText,j=t.setCurrentOption,w=t.queryParams,P=t.assetFields,x=o([]),k=r(x,2),A=k[0],T=k[1],I=o(!1),_=r(I,2),D=_[0],C=_[1],q=i(),E=i();return s((function(){function r(){return(r=e(a.mark((function e(){var r;return a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,p(u)(l(l({},m(u,P)),{},{ids:b?y:[y]},w));case 2:r=e.sent,j((function(){if(b)return r.data.map(f);var e=r.data[0];return e?f(e):null}));case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}(b?y.length:y)&&function(){r.apply(this,arguments)}()}),[]),s((function(){function r(){return(r=e(a.mark((function e(){var r,t,o,s,i;return a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,C(!0),r={per_page:c,page:g},v&&h&&(r[v]=h),d&&(r.company=d),O&&(r.search=O),n&&(r.app_key=n),t=p(u)(l(l(l({},m(u,P)),r),w)),E.current=t,e.next=11,t;case 11:if(o=e.sent,E.current===t){e.next=14;break}return e.abrupt("return");case 14:s=o.data.map(f),i=q.current!==u||1===g,T(i?s:function(e){return e.concat(s)}),q.current=u,e.next=23;break;case 20:e.prev=20,e.t0=e.catch(0),console.error(e.t0);case 23:C(!1);case 24:case"end":return e.stop()}}),e,null,[[0,20]])})))).apply(this,arguments)}!function(){r.apply(this,arguments)}()}),[u,v,h,d,O,g,n]),{assets:A,loading:D}}export{y as useAssetAutoCompleteSelectData,d as useAssetSelectData};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"@babel/runtime/helpers/defineProperty";import t from"@babel/runtime/helpers/toConsumableArray";import o from"@babel/runtime/helpers/slicedToArray";import r from"@babel/runtime/helpers/objectWithoutProperties";import{useMemo as i,useState as n,useEffect as p}from"react";import s from"prop-types";import m from"classnames";import{get as a,noop as l,identity as c}from"lodash";import{makeStyles as d}from"@material-ui/core";import j from"@material-ui/lab/Autocomplete";import C from"@material-ui/icons/Close";import"../Modal/index.js";import"../IconMenu/index.js";import"../StyledMenuItem/index.js";import"../DevCenter/AppHeader/AppHeader.js";import"../DevCenter/AppSideBar/AppSideBar.js";import"../DevCenter/AppsDataProvider/AppsDataProvider.js";import"@material-ui/icons/Help";import"../Icons/AnnotationIcon.js";import"../Annotations/components/AnnotationsList/index.js";import"../Annotations/components/LastAnnotation/index.js";import"../Annotations/AnnotationsContext.js";import"../../utils/mobileDetect.js";import"@babel/runtime/helpers/asyncToGenerator";import"@babel/runtime/regenerator";import"querystring";import"uuid/v1";import"../../clients/jsonApi/index.js";import"../../clients/subscriptions.js";import"../../constants/goals.js";import"../../constants/segment.js";import"../../constants/alerts.js";import"../../constants/apps.js";import"../../constants/drillstring.js";import"../../constants/completion.js";import"../../constants/notifications.js";import"../../constants/feed.js";import"../../constants/bha.js";import"../../utils/index.js";import"../HelpCenter/ArticleIcon.js";import"../HelpCenter/DialogLayout.js";import"../HelpCenter/HelpCenterDialog/HelpCenterDialog.js";import"../HelpCenter/ItemContent/ItemContent.js";import"../HelpCenter/SingleItemHeader.js";import"../HelpCenter/shapes/index.js";import"../DevCenter/DevCenterAppContainer/components/AppActions/AppActions.css.js";import{jsx as u}from"react/jsx-runtime";import"../DevCenter/DevCenterAppContainer/components/AppSettingsDialog/AppSettingsDialog.js";import"../DevCenter/DevCenterAppContainer/components/AnnotationsButton/AnnotationsButton.js";import"../DevCenter/DevCenterAppContainer/components/NonPriorityMenus/NonPriorityMenus.js";import"../DevCenter/DevCenterAppContainer/components/FullscreenButton/FullscreenButton.js";import"../DevCenter/DevCenterAppContainer/components/AppInfoMessage/AppInfoMessage.js";import"../ErrorBoundary/ErrorBoundary.js";import"../ErrorBoundary/DevCenterAppErrorView/DevCenterAppErrorView.js";import"../LoadingIndicator/LoadingIndicator.js";import"../EmptyView/EmptyAppView/components/ErrorSubtitleWithIntercomLink.js";import"../DevCenter/DevCenterAppContainer/components/DevCenterAppView/components/ChooseAssetButton/index.js";import"../DevCenter/DevCenterAppContainer/components/DisabledSettingsMessage/DisabledSettingsMessage.js";import"../DevCenter/DevCenterAppContainer/components/DcTooltipsCoordinatorProvider/DcTooltipsCoordinatorProvider.js";import"../DevCenter/DevCenterAppContainer/components/IsInsideDcAppProvider/IsInsideDcAppProvider.js";import"../DevCenter/AppContext.js";import"../DevCenter/DevCenterAppContainer/DevCenterAppContainer.css.js";import"../DevCenter/DevCenterAppContainer/components/RestoreAppSizeButton/index.js";import"../DevCenter/DevCenterAppContainer/components/PriorityMenus/PriorityMenus.css.js";import"../DevCenter/DevCenterRouterContext/DevCenterRouterContext.js";import"../DevCenter/DevCenterRouterContext/UniversalLink/UniversalLink.js";import"react-router";import"../DevCenter/NavigationBar/NavigationBar.js";import"../DevCenter/SideBar/SideBar.js";import"../DevCenter/AppSettingsPopover/AppSettingsPopover.js";import"../DevCenter/IsolatedDevCenterAppContainer/DevCenterIsolatedAppPage.js";import"../DevCenter/IsolatedDevCenterAppContainer/DevCenterIsolatedApp.js";import"../DevCenter/IsolatedDevCenterAppContainer/AppsGridDragHandle.js";import"../AssetEditor/index.js";import"../AppVersionsSelect/AppVersionsSelect.js";import"../Typography.js";import"../CollapsableSidebar.js";import"../DateTimePicker/index.js";import"../DatePicker/index.js";import"../SlateFormattedText/SlateFormattedText.js";import"../SlateFormattedText/RenderElements.js";import"@babel/runtime/helpers/typeof";import"slate";import"../ParameterCharts/ParameterCharts.js";import"../ParameterCharts/AddEditTrack.js";import"../ChartActionsList/ChartActionsList.js";import"../AssetEditor/AssetEditorAutocomplete.js";import"../AssetEditor/SingleAssetEditor.js";import"../SettingEditors/ColorEditor/index.js";import"../SettingEditors/DropdownEditor/index.js";import"../SettingEditors/RadioEditor/index.js";import"../SwitchControl/index.js";import"../ColorPicker/ColorPicker.js";import"../ColorPicker/PaletteChromePicker/PaletteChromePicker.js";import"../TruncatedText/index.js";import"../RangeSlider/RangeSlider.js";import"../Login/components/Login.js";import"../Login/components/PasswordField.js";import"../Login/components/Chip.js";import"../Login/components/StepFooter.js";import"../Login/components/StepContent.js";import"../Login/components/StepHeader.js";import"../Login/components/Step.js";import"../Login/components/OrDivider.js";import"../Login/components/HiddenEmailField.js";import"../Login/components/EmailField.js";import"../Breadcrumbs/index.js";import"../VirtualizedTable/index.js";import"../EmptyView/EmptyView.js";import"../EmptyView/EmptyAppView/EmptyAppView.js";import"../Button/index.js";import"../ContextMenuItem/index.js";import"../FolderMenuItem/index.js";import"../EditableItem/EditableItem/index.js";import"../EditableItem/EditableItemWithBadge/index.js";import"../Checkbox/index.js";import"../FolderMenuItemWithLinks/index.js";import"../IconButton/index.js";import"../TextField/index.js";import"../Chip/index.js";import"../Counter/index.js";import"../AnchorsList/AnchorsList.js";import"../Select/index.js";import"../CustomSelect/index.js";import"../Tabs/Tabs.js";import"../Tabs/Tab.js";import"../ResizableTable/ResizableTable.js";import"../Drillstring/BHASchematic.js";import"../Drillstring/BHATable/index.js";import"../Drillstring/BHAComponentIcon.js";import"../Drillstring/BHAComponentDetail/index.js";import"../Drillstring/BHATileIcon.js";import"../Drillstring/BHATile/BHATile.js";import"../Drillstring/BHAList/BHAList.js";import"../Casing/CasingTable/index.js";import"../Casing/CasingComponentIcon.js";import"../Casing/CasingTileIcon.js";import"../Casing/CasingTableV2/CasingTableV2.js";import"../Casing/CasingTile/CasingTile.js";import"../WellSummary/WellSummaryItemLabel.js";import"../WellSummary/WellSummaryItemTitle.js";import"../WellSummary/WellSummaryItemValue.js";import"../WellSummary/ActivitySummaryChart.js";import"../WellSummary/FracWirelineTimeChart.js";import"../BICOffsetPickerDialog/index.js";import"../OffsetWellPickerV2/OffsetWellPickerDialog.js";import"../OffsetWellPickerV3/index.js";import"../Notifications/Notifications.js";import"uuid";import"../ConfirmationDialog.js";import"../TextLink/index.js";import"../Avatar/index.js";import"../Template/TemplatePopover/index.js";import"../MenuItem/index.js";import"../PadModeSelect/PadModeSelect.js";import"../PinnableFilters/PinnableFilters.js";import"../HeaderLayout/HeaderLayout.js";import"../PadOffsetsPicker/PadOffsetsPicker.js";import"../PadOffsetsPicker/OffsetAssetChip.js";import"../PadOffsetsPicker/OffsetAssetsListExpander.js";import"../PadOffsetsPicker/StagesSelector.js";import"../Table/TableToolbar/TableToolbar.js";import{Tooltip as g}from"../Tooltip/Tooltip.js";import"../PriceInput/PriceInput.js";import"../LabelsCounter/LabelsCounter.js";import"../Stepper/Step.js";import"../Stepper/StepsWrapper.js";import"../Stepper/Stepper.js";import"../Comment/CommentIcon/index.js";import"../FilesLoader/FilesLoader.js";import"../FilesLoader/Icons/FileIcon.js";import"../SearchInput/index.js";import"../FeedItem/FeedItem.js";import"../FeedItem/FeedItemEditProvider/FeedItemEditProvider.js";import"../PostInput/PostInput.js";import"../KeyboardDateTimePicker.js";import"../AddComment/Popover.js";import"../AddComment/Popup.js";import"../StageDesignVActual/ComparisonBar/ComparisonBar.js";import"../StageDesignVActual/ElementsComparison/ElementsComparison.js";import"../StageDesignVActual/ComparisonHeader.js";import"../StageDesignVActual/ComparisonRow.js";import"../EmbeddedApp/DevCenterEmbeddedApp.js";import"../EmbeddedApp/EmbeddedApp.js";import"../DocumentViewer/DocumentViewer.js";var A=["isCreatable","options","value","getOptionLabel","onInputChange","onChange","renderOption","classes"];function v(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.push.apply(o,r)}return o}function D(t){for(var o=1;o<arguments.length;o++){var r=null!=arguments[o]?arguments[o]:{};o%2?v(Object(r),!0).forEach((function(o){e(t,o,r[o])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):v(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var b=function(e){return a(a(e.split('Create "'),"1","").split('"'),"0","")},f=d((function(e){return{root:{width:200},paper:{maxHeight:400,boxShadow:"0px 5px 5px -3px rgb(0 0 0 / 20%), 0px 8px 10px 1px rgb(0 0 0 / 14%), 0px 3px 14px 2px rgb(0 0 0 / 12%)"},createLabel:{fontSize:"16px",lineHeight:"22.5px",color:e.palette.primary.main},openIcon:{marginLeft:5},option:{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",width:"100%"},closeIcon:{width:16,height:16}}})),x=function(s){var a=s.isCreatable,l=s.options,c=s.value,d=s.getOptionLabel,v=s.onInputChange,x=s.onChange,P=s.renderOption,I=s.classes,S=r(s,A),h=f(),y=i((function(){return null==l?void 0:l.map((function(e){return a?d(e):e}))}),[l]),L=i((function(){return a?d(c)||"":c}),[c]),T=n(y),E=o(T,2),O=E[0],B=E[1],w=n(null),H=o(w,2),k=H[0],F=H[1];p((function(){B(y)}),[y]);return u(j,D({value:L,onChange:a?function(e,o){return function(e){if(null!=e&&e.includes('Create "')&&d(e)===d(k)){F(null);var o=b(k);B([].concat(t(y),[o])),x(o,!0)}else x(e,!1)}(o)}:x,onInputChange:a?function(e,o){return function(e){if(""===e)F(null),B(y);else if(y.find((function(t){return t===e}))){var o=y.filter((function(e){return!e.includes('Create "')}));B(o)}else{var r=function(e){return'Create "'.concat(e,'"')}(e);F(r),B([].concat(t(y),[r]))}}(o)}:v,options:O,getOptionLabel:a?function(e){return e}:d,renderOption:a?function(t){var o=b(t);return u(g,{title:t,children:u("div",{className:m(e({},h.createLabel,o&&t!==o),h.option,null==I?void 0:I.optionLabelClass),children:t})})}:P,classes:D({root:m(h.root,null==I?void 0:I.root),paper:m(h.paper,null==I?void 0:I.paper),popupIndicator:h.openIcon},I),closeIcon:(L||k)&&u(C,{className:h.closeIcon})},S))};x.propTypes={value:s.oneOfType([s.string,s.shape({})]).isRequired,options:s.shape([]).isRequired,isCreatable:s.bool,getOptionLabel:s.func,onChange:s.func,onInputChange:s.func,renderOption:s.func,classes:s.shape()},x.defaultProps={isCreatable:!1,onChange:l,getOptionLabel:c,onInputChange:l,renderOption:c,classes:{}};export{x as default};
|
|
1
|
+
import e from"@babel/runtime/helpers/defineProperty";import r from"@babel/runtime/helpers/toConsumableArray";import t from"@babel/runtime/helpers/slicedToArray";import n from"@babel/runtime/helpers/objectWithoutProperties";import{useMemo as o,useState as i,useEffect as p}from"react";import a from"prop-types";import l from"classnames";import{get as c,noop as u,identity as s}from"lodash";import{makeStyles as f}from"@material-ui/core";import m from"@material-ui/lab/Autocomplete";import b from"@material-ui/icons/Close";import{Tooltip as h}from"../Tooltip/Tooltip.js";import{jsx as d}from"react/jsx-runtime";var g=["isCreatable","options","value","getOptionLabel","onInputChange","onChange","renderOption","classes"];function O(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,n)}return t}function v(r){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?O(Object(n),!0).forEach((function(t){e(r,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(n)):O(Object(n)).forEach((function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(n,e))}))}return r}var C=function(e){return c(c(e.split('Create "'),"1","").split('"'),"0","")},x=f((function(e){return{root:{width:200},paper:{maxHeight:400,boxShadow:"0px 5px 5px -3px rgb(0 0 0 / 20%), 0px 8px 10px 1px rgb(0 0 0 / 14%), 0px 3px 14px 2px rgb(0 0 0 / 12%)"},createLabel:{fontSize:"16px",lineHeight:"22.5px",color:e.palette.primary.main},openIcon:{marginLeft:5},option:{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",width:"100%"},closeIcon:{width:16,height:16}}})),y=function(a){var c=a.isCreatable,u=a.options,s=a.value,f=a.getOptionLabel,O=a.onInputChange,y=a.onChange,j=a.renderOption,w=a.classes,I=n(a,g),P=x(),L=o((function(){return null==u?void 0:u.map((function(e){return c?f(e):e}))}),[u]),S=o((function(){return c?f(s)||"":s}),[s]),T=i(L),D=t(T,2),A=D[0],q=D[1],E=i(null),H=t(E,2),N=H[0],R=H[1];p((function(){q(L)}),[L]);return d(m,v({value:S,onChange:c?function(e,t){return function(e){if(null!=e&&e.includes('Create "')&&f(e)===f(N)){R(null);var t=C(N);q([].concat(r(L),[t])),y(t,!0)}else y(e,!1)}(t)}:y,onInputChange:c?function(e,t){return function(e){if(""===e)R(null),q(L);else if(L.find((function(r){return r===e}))){var t=L.filter((function(e){return!e.includes('Create "')}));q(t)}else{var n=function(e){return'Create "'.concat(e,'"')}(e);R(n),q([].concat(r(L),[n]))}}(t)}:O,options:A,getOptionLabel:c?function(e){return e}:f,renderOption:c?function(r){var t=C(r);return d(h,{title:r,children:d("div",{className:l(e({},P.createLabel,t&&r!==t),P.option,null==w?void 0:w.optionLabelClass),children:r})})}:j,classes:v({root:l(P.root,null==w?void 0:w.root),paper:l(P.paper,null==w?void 0:w.paper),popupIndicator:P.openIcon},w),closeIcon:(S||N)&&d(b,{className:P.closeIcon})},I))};y.propTypes={value:a.oneOfType([a.string,a.shape({})]).isRequired,options:a.shape([]).isRequired,isCreatable:a.bool,getOptionLabel:a.func,onChange:a.func,onInputChange:a.func,renderOption:a.func,classes:a.shape()},y.defaultProps={isCreatable:!1,onChange:u,getOptionLabel:s,onInputChange:u,renderOption:s,classes:{}};export{y as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import{memo as e}from"react";import{shape as r,number as n}from"prop-types";import{makeStyles as i,TableRow as a,TableCell as o}from"@material-ui/core";import{InfoOutlined as c}from"@material-ui/icons";import l from"../CasingComponentIcon.js";import{jsxs as t,jsx as m}from"react/jsx-runtime";var s=i({tableBodyCell:{padding:0,borderBottom:"none",height:49},componentIconCell:{padding:0,borderBottom:"none",height:49,display:"flex",alignItems:"center"},infoIcon:{fontSize:16,color:"#ccc"},iconWrapper:{width:"40px",height:"48px",display:"flex",justifyContent:"center",marginRight:"4px"}}),d=function(e){var r=e.component,n=e.order,i=s(),d=i.tableBodyCell,p=i.componentIconCell,h=i.infoIcon,f=i.iconWrapper;return t(a,{children:[m(o,{className:d,children:n}),t(o,{className:p,children:[m("div",{className:f,children:m(l,{component:r})}),m("div",{children:r.family_name||r.family})]}),m(o,{className:d,children:r.name}),m(o,{className:d,children:r.outer_diameter}),m(o,{className:d,children:r.inner_diameter}),m(o,{className:d,children:r.linear_weight}),m(o,{className:d,children:r.length}),m(o,{className:d,children:r.weight}),m(o,{className:d,children:r.cum_length}),m(o,{className:d,children:r.grade}),m(o,{className:d,children:m(c,{className:h})})]})};d.propTypes={component:r({}).isRequired,order:n.isRequired};var p=e(d);export{p as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import t from"@babel/runtime/helpers/asyncToGenerator";import e from"@babel/runtime/helpers/classCallCheck";import n from"@babel/runtime/helpers/createClass";import o from"@babel/runtime/helpers/assertThisInitialized";import i from"@babel/runtime/helpers/inherits";import a from"@babel/runtime/helpers/possibleConstructorReturn";import r from"@babel/runtime/helpers/getPrototypeOf";import s from"@babel/runtime/helpers/defineProperty";import l from"@babel/runtime/regenerator";import{PureComponent as c}from"react";import m from"prop-types";import p from"lodash/noop";import{withStyles as u}from"@material-ui/core/styles";import d from"classnames";import{get as h}from"lodash";import{Paper as f,TextField as C,InputAdornment as g,Tooltip as b,Typography as v}from"@material-ui/core";import I from"@material-ui/core/colors/grey";import x from"../Avatar/index.js";import y from"../FileUploadIconButton.js";import F from"../EmojiIconButton.js";import E from"../FailedFileUploading.js";import S from"../UserMention/index.js";import U from"../FilePreview/index.js";import N from"../IconButton/index.js";import k from"../Icons/SendIcon.js";import{isSuggestionsListOpened as A}from"../UserMention/utils/index.js";import M from"../../utils/main.js";import{isNativeDetected as R}from"../../utils/mobileDetect.js";import{notifyCommentEdit as j,notifyCommentPost as B}from"../../utils/nativeMessages.js";import{patchFeedItemComment as w}from"../../clients/jsonApi/index.js";import L from"./styles.css.js";import{jsxs as P,jsx as T}from"react/jsx-runtime";function z(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,o=r(t);if(e){var i=r(this).constructor;n=Reflect.construct(o,arguments,i)}else n=o.apply(this,arguments);return a(this,n)}}var D={chatAvatarWrapper:{display:"flex",alignItems:"center",position:"absolute",left:0,height:32},commentTextFieldContainer:{position:"relative",margin:"0"},commentTextFieldContainerSpaceAround:{position:"relative",margin:"20px 10px"}},_=function(a){i(m,c);var r=z(m);function m(n){var i,a,c;return e(this,m),i=r.call(this,n),s(o(i),"handleSelectEmoji",(function(t){return i.setState((function(e){var n=e.comment;return{comment:"".concat(n).concat(t.native)}}))})),s(o(i),"postComment",(a=t(l.mark((function t(e){var n;return l.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,i.props.postComment(e);case 3:n=t.sent,t.next=9;break;case 6:t.prev=6,t.t0=t.catch(0),console.error(t.t0.message);case 9:return t.abrupt("return",n);case 10:case"end":return t.stop()}}),t,null,[[0,6]])}))),function(t){return a.apply(this,arguments)})),s(o(i),"patchComment",(c=t(l.mark((function t(e){var n,o,a,r;return l.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=i.props,o=n.editFeedItemId,a=n.editCommentId,t.prev=1,t.next=4,w(o,a,e);case 4:r=t.sent,t.next=10;break;case 7:t.prev=7,t.t0=t.catch(1),console.error(t.t0.message);case 10:return t.abrupt("return",r);case 11:case"end":return t.stop()}}),t,null,[[1,7]])}))),function(t){return c.apply(this,arguments)})),s(o(i),"clearCommentField",(function(t){i.setState({comment:"",attachmentUrl:null,attachmentName:null,attachmentSize:null},(function(){i.focusOnRef(),t&&"function"==typeof t&&t()}))})),s(o(i),"handleKeyDown",(function(t){var e=t.key;"Escape"===e&&i.props.exitEditMode(),"Enter"===e&&(A()||(t.preventDefault(),i.handleSendComment()))})),s(o(i),"handleAttachmentLoadingError",(function(t){i.setState({attachmentUrl:null,attachmentName:null,attachmentSize:null,attachmentLoadingError:t})})),s(o(i),"handleFileUpload",(function(t,e,n){i.setState({attachmentUrl:t,attachmentName:e,attachmentSize:n,attachmentLoadingError:null})})),s(o(i),"handleNativeFileUpload",(function(){var t=i.state.comment;i.isEditMode?(j(t),i.clearCommentField(i.props.exitEditMode)):(B(t),i.clearCommentField())})),s(o(i),"handleFileDelete",(function(){return i.setState({attachmentUrl:null,attachmentName:null,attachmentSize:null})})),s(o(i),"handleSendComment",t(l.mark((function t(){var e,n,o;return l.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if((e=i.state.comment?i.state.comment.trim():null)||i.state.attachmentUrl){t.next=3;break}return t.abrupt("return");case 3:if(n={comment:{body:e,attachment:{url:i.state.attachmentUrl,size:i.state.attachmentSize,file_name:i.state.attachmentName}}},!i.isEditMode){t.next=16;break}return i.props.setIsEditting(!0),t.next=8,i.patchComment(n);case 8:return o=t.sent,t.next=11,i.props.patchCommentCallback(o);case 11:i.props.setIsEditting(!1),i.clearCommentField(),i.props.exitEditMode(),t.next=24;break;case 16:return i.props.setIsPosting(!0),t.next=19,i.postComment(n);case 19:return o=t.sent,t.next=22,i.props.postCommentCallback(o);case 22:i.props.setIsPosting(!1),i.clearCommentField();case 24:case"end":return t.stop()}}),t)})))),s(o(i),"handleCancelClick",(function(){i.setState({comment:"",attachmentUrl:null,attachmentName:null,attachmentSize:null},i.props.exitEditMode())})),i.state={comment:"",attachmentUrl:null,attachmentName:null,attachmentSize:null,attachmentLoadingError:null,isInputFocused:!1},i}return n(m,[{key:"componentDidMount",value:function(){this.isEditMode&&this.setInitialCommentValue()}},{key:"componentDidUpdate",value:function(t){(this.isEditMode&&!t.editFeedItemId||this.props.editCommentId&&this.props.editCommentId!==t.editCommentId)&&this.setInitialCommentValue()}},{key:"isEditMode",get:function(){return!!this.props.editFeedItemId}},{key:"setInitialCommentValue",value:function(){var t=this.props.editAttachment?this.props.editAttachment.url:null;this.setState({comment:this.props.editComment,attachmentUrl:t,attachmentName:t?M.getFileNameWithExtensionFromPath(t):null,attachmentSize:this.props.editAttachment?this.props.editAttachment.url:null})}},{key:"focusOnRef",value:function(){this.props.inputRef&&this.props.inputRef.current.focus()}},{key:"render",value:function(){var t=this,e=this.props,n=e.classes,o=e.currentUser,i="".concat(h(o,["attributes","first_name"])," ").concat(h(o,["attributes","last_name"]));return P("div",{style:this.props.spaceAround?D.commentTextFieldContainerSpaceAround:D.commentTextFieldContainer,children:[T("div",{style:D.chatAvatarWrapper,children:T(x,{displayName:i,size:24,imgSrc:this.props.currentUser&&this.props.currentUser.profile_photo})}),T(f,{className:this.props.classes.paperRoot,children:T(C,{"data-testid":"".concat("commentInput","_input"),placeholder:"Add Comment...",FormHelperTextProps:{component:"div",margin:"dense"},InputProps:{inputComponent:S,inputProps:{onChange:function(e){return t.setState({comment:e})},singleLine:!0,value:this.state.comment||"",inputRef:this.props.inputRef,withLightTheme:!1,onMount:this.props.onMount,companyId:this.props.companyId,autoFocus:this.props.autoFocus,disabled:this.props.disabled,onFocus:function(){return t.setState({isInputFocused:!0})},onBlur:function(){return t.setState({isInputFocused:!1})}},endAdornment:!this.props.isNative&&P(g,{position:"end",className:this.props.classes.iconsContainer,children:[!this.state.attachmentUrl&&T(b,{title:"Attach File",placement:"bottom",classes:{tooltip:n.iconTooltip},children:T("div",{className:d(L.cCommentInputIconContainer,L.cCommentInputIconUpload),children:T(y,{openPreviewDialogOnUpload:!1,disableRipple:!0,onFinish:this.handleFileUpload,onError:this.handleAttachmentLoadingError,fileUploadIconClassName:this.props.classes.additionalActionButton,htmlColor:I[400],inputId:"comment-attachment-".concat(this.props.editCommentId)})})}),T(b,{title:"Add Emoji",placement:"bottom",classes:{tooltip:n.iconTooltip},children:T("div",{className:L.cCommentInputIconContainer,children:T(F,{"data-testid":"".concat("commentInput","_emojiButton"),handleSelectEmoji:this.handleSelectEmoji,emojiIconClassName:this.props.classes.additionalActionButton,htmlColor:I[400],disableRipple:!0})})})]}),disableUnderline:!0,classes:{root:this.props.classes.inputRoot,input:this.props.classes.inputEl}},className:this.props.classes.input,onKeyDown:this.handleKeyDown})}),this.state.attachmentLoadingError&&T(E,{errorMessage:this.state.attachmentLoadingError,className:this.props.classes.fileUploadingError}),this.state.attachmentUrl&&T(U,{fileName:this.state.attachmentName,fileUrl:this.state.attachmentUrl,handleFileDelete:this.handleFileDelete,classes:this.props.classes}),(this.state.isInputFocused||this.state.attachmentUrl||this.state.comment)&&P("div",{className:L.cCommentInputSendContainer,children:[T("div",{className:L.cCommentInputSendContainerCancel,children:T(v,{variant:"caption",className:d(this.props.classes.inputMain,this.props.classes.cancelText,this.props.classes.highlightedLabel),component:"div",gutterBottom:!0,onClick:this.handleCancelClick,children:"Cancel"})}),P("div",{className:L.cCommentInputSendContainerSend,children:[P(v,{variant:"caption",className:d(this.props.classes.inputMain,this.props.classes.inputHelper),component:"div",gutterBottom:!0,children:["Press ",T(v,{variant:"caption",color:"primary",className:d(this.props.classes.inputMain,this.props.classes.highlightedLabel),children:"Enter"})," to send"]}),T(N,{size:"large",tooltipProps:{title:"Send"},"data-testid":"".concat("commentInput","_sendButton"),onClick:this.handleSendComment,classes:{root:this.props.classes.sendButton},children:T(k,{})})]})]})]})}}]),m}();_.propTypes={inputRef:m.shape({current:m.shape({focus:m.shape({})})}),editFeedItemId:m.number,editCommentId:m.number,editComment:m.string,editAttachment:m.shape({url:m.string}),spaceAround:m.bool,postComment:m.func.isRequired,postCommentCallback:m.func,patchCommentCallback:m.func,exitEditMode:m.func,setIsPosting:m.func,setIsEditting:m.func,onMount:m.func,autoFocus:m.bool,disabled:m.bool,classes:m.shape({}).isRequired,currentUser:m.shape(),isNative:m.bool,companyId:m.number},_.defaultProps={inputRef:null,editFeedItemId:null,editCommentId:null,editComment:null,editAttachment:{},spaceAround:!1,setIsPosting:p,setIsEditting:p,onMount:p,autoFocus:void 0,disabled:!1,patchCommentCallback:p,postCommentCallback:p,exitEditMode:p,companyId:null,currentUser:{},isNative:R};var O=u((function(t){return{paperRoot:{width:"calc(100% - 40px)",marginLeft:40,display:"inline-block",height:32,border:"0","&:focus-within":{boxShadow:"inset 0 0 0 2px ".concat(t.palette.primary.main)},boxShadow:"none"},input:{paddingLeft:5,width:"100%"},inputRoot:{height:32,paddingRight:"10px",lineHeight:"29px",paddingLeft:"10px"},inputEl:{padding:"0 0 0 6px",height:"100%"},additionalActionButton:{padding:"8px","&:hover":{backgroundColor:"transparent"}},nativeActionButton:{margin:"5px 10px",cursor:"pointer"},fileUploadingError:{marginTop:10,marginLeft:24},inputMain:{marginBottom:0,fontSize:"11px",color:t.palette.primary.text8},inputHelper:{display:"flex",paddingRight:5},cancelText:{cursor:"pointer"},highlightedLabel:{color:t.palette.primary.main},iconsContainer:{marginRight:"8px"},iconTooltip:{marginTop:"3px"},sendButton:{"&:hover":{backgroundColor:"rgba(3,188,212, 0.1)"},"&.MuiButtonBase-root":{padding:7}}}}))(_);export{O as default};
|
|
1
|
+
import t from"@babel/runtime/helpers/asyncToGenerator";import e from"@babel/runtime/helpers/classCallCheck";import n from"@babel/runtime/helpers/createClass";import o from"@babel/runtime/helpers/assertThisInitialized";import i from"@babel/runtime/helpers/inherits";import a from"@babel/runtime/helpers/possibleConstructorReturn";import r from"@babel/runtime/helpers/getPrototypeOf";import s from"@babel/runtime/helpers/defineProperty";import l from"@babel/runtime/regenerator";import{PureComponent as c}from"react";import p from"prop-types";import m from"lodash/noop";import{withStyles as u}from"@material-ui/core/styles";import d from"classnames";import{get as h}from"lodash";import{Paper as f,TextField as C,InputAdornment as g,Tooltip as b,Typography as I}from"@material-ui/core";import v from"@material-ui/core/colors/grey";import x from"../Avatar/index.js";import y from"../FileUploadIconButton.js";import F from"../EmojiIconButton.js";import E from"../FailedFileUploading.js";import S from"../UserMention/index.js";import U from"../FilePreview/index.js";import N from"../IconButton/index.js";import k from"../Icons/SendIcon.js";import{isSuggestionsListOpened as A}from"../UserMention/utils/index.js";import M from"../../utils/main.js";import{isNativeDetected as R}from"../../utils/mobileDetect.js";import{notifyCommentEdit as j,notifyCommentPost as B}from"../../utils/nativeMessages.js";import{patchFeedItemComment as w}from"../../clients/jsonApi/index.js";import L from"./styles.css.js";import{jsxs as P,jsx as T}from"react/jsx-runtime";function z(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,o=r(t);if(e){var i=r(this).constructor;n=Reflect.construct(o,arguments,i)}else n=o.apply(this,arguments);return a(this,n)}}var D={chatAvatarWrapper:{display:"flex",alignItems:"center",position:"absolute",left:0,height:32},commentTextFieldContainer:{position:"relative",margin:"0"},commentTextFieldContainerSpaceAround:{position:"relative",margin:"20px 10px"}},_=function(a){i(p,c);var r=z(p);function p(n){var i,a,c;return e(this,p),i=r.call(this,n),s(o(i),"handleSelectEmoji",(function(t){return i.setState((function(e){var n=e.comment;return{comment:"".concat(n).concat(t.native)}}))})),s(o(i),"postComment",(a=t(l.mark((function t(e){var n;return l.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,i.props.postComment(e);case 3:n=t.sent,t.next=9;break;case 6:t.prev=6,t.t0=t.catch(0),console.error(t.t0.message);case 9:return t.abrupt("return",n);case 10:case"end":return t.stop()}}),t,null,[[0,6]])}))),function(t){return a.apply(this,arguments)})),s(o(i),"patchComment",(c=t(l.mark((function t(e){var n,o,a,r;return l.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=i.props,o=n.editFeedItemId,a=n.editCommentId,t.prev=1,t.next=4,w(o,a,e);case 4:r=t.sent,t.next=10;break;case 7:t.prev=7,t.t0=t.catch(1),console.error(t.t0.message);case 10:return t.abrupt("return",r);case 11:case"end":return t.stop()}}),t,null,[[1,7]])}))),function(t){return c.apply(this,arguments)})),s(o(i),"clearCommentField",(function(t){i.setState({comment:"",attachmentUrl:null,attachmentName:null,attachmentSize:null},(function(){i.focusOnRef(),t&&"function"==typeof t&&t()}))})),s(o(i),"handleKeyDown",(function(t){var e=t.key;"Escape"===e&&i.props.exitEditMode(),"Enter"===e&&(A()||(t.preventDefault(),i.handleSendComment()))})),s(o(i),"handleAttachmentLoadingError",(function(t){i.setState({attachmentUrl:null,attachmentName:null,attachmentSize:null,attachmentLoadingError:t})})),s(o(i),"handleFileUpload",(function(t,e,n){i.setState({attachmentUrl:t,attachmentName:e,attachmentSize:n,attachmentLoadingError:null})})),s(o(i),"handleNativeFileUpload",(function(){var t=i.state.comment;i.isEditMode?(j(t),i.clearCommentField(i.props.exitEditMode)):(B(t),i.clearCommentField())})),s(o(i),"handleFileDelete",(function(){return i.setState({attachmentUrl:null,attachmentName:null,attachmentSize:null})})),s(o(i),"handleSendComment",t(l.mark((function t(){var e,n,o;return l.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if((e=i.state.comment?i.state.comment.trim():null)||i.state.attachmentUrl){t.next=3;break}return t.abrupt("return");case 3:if(n={comment:{body:e,attachment:{url:i.state.attachmentUrl,size:i.state.attachmentSize,file_name:i.state.attachmentName}}},!i.isEditMode){t.next=16;break}return i.props.setIsEditting(!0),t.next=8,i.patchComment(n);case 8:return o=t.sent,t.next=11,i.props.patchCommentCallback(o);case 11:i.props.setIsEditting(!1),i.clearCommentField(),i.props.exitEditMode(),t.next=24;break;case 16:return i.props.setIsPosting(!0),t.next=19,i.postComment(n);case 19:return o=t.sent,t.next=22,i.props.postCommentCallback(o);case 22:i.props.setIsPosting(!1),i.clearCommentField();case 24:case"end":return t.stop()}}),t)})))),s(o(i),"handleCancelClick",(function(){i.setState({comment:"",attachmentUrl:null,attachmentName:null,attachmentSize:null},i.props.exitEditMode())})),i.state={comment:"",attachmentUrl:null,attachmentName:null,attachmentSize:null,attachmentLoadingError:null,isInputFocused:!1},i}return n(p,[{key:"componentDidMount",value:function(){this.isEditMode&&this.setInitialCommentValue()}},{key:"componentDidUpdate",value:function(t){(this.isEditMode&&!t.editFeedItemId||this.props.editCommentId&&this.props.editCommentId!==t.editCommentId)&&this.setInitialCommentValue()}},{key:"isEditMode",get:function(){return!!this.props.editFeedItemId}},{key:"setInitialCommentValue",value:function(){var t=this.props.editAttachment?this.props.editAttachment.url:null;this.setState({comment:this.props.editComment,attachmentUrl:t,attachmentName:t?this.props.editAttachment.file_name||M.getFileNameWithExtensionFromPath(t):null,attachmentSize:this.props.editAttachment?this.props.editAttachment.size:null})}},{key:"focusOnRef",value:function(){this.props.inputRef&&this.props.inputRef.current.focus()}},{key:"render",value:function(){var t=this,e=this.props,n=e.classes,o=e.currentUser,i="".concat(h(o,["attributes","first_name"])," ").concat(h(o,["attributes","last_name"]));return P("div",{style:this.props.spaceAround?D.commentTextFieldContainerSpaceAround:D.commentTextFieldContainer,children:[T("div",{style:D.chatAvatarWrapper,children:T(x,{displayName:i,size:24,imgSrc:this.props.currentUser&&this.props.currentUser.profile_photo})}),T(f,{className:this.props.classes.paperRoot,children:T(C,{"data-testid":"".concat("commentInput","_input"),placeholder:"Add Comment...",FormHelperTextProps:{component:"div",margin:"dense"},InputProps:{inputComponent:S,inputProps:{onChange:function(e){return t.setState({comment:e})},singleLine:!0,value:this.state.comment||"",inputRef:this.props.inputRef,withLightTheme:!1,onMount:this.props.onMount,companyId:this.props.companyId,autoFocus:this.props.autoFocus,disabled:this.props.disabled,onFocus:function(){return t.setState({isInputFocused:!0})},onBlur:function(){return t.setState({isInputFocused:!1})}},endAdornment:!this.props.isNative&&P(g,{position:"end",className:this.props.classes.iconsContainer,children:[!this.state.attachmentUrl&&T(b,{title:"Attach File",placement:"bottom",classes:{tooltip:n.iconTooltip},children:T("div",{className:d(L.cCommentInputIconContainer,L.cCommentInputIconUpload),children:T(y,{openPreviewDialogOnUpload:!1,disableRipple:!0,onFinish:this.handleFileUpload,onError:this.handleAttachmentLoadingError,fileUploadIconClassName:this.props.classes.additionalActionButton,htmlColor:v[400],inputId:"comment-attachment-".concat(this.props.editCommentId||this.props.parentId)})})}),T(b,{title:"Add Emoji",placement:"bottom",classes:{tooltip:n.iconTooltip},children:T("div",{className:L.cCommentInputIconContainer,children:T(F,{"data-testid":"".concat("commentInput","_emojiButton"),handleSelectEmoji:this.handleSelectEmoji,emojiIconClassName:this.props.classes.additionalActionButton,htmlColor:v[400],disableRipple:!0})})})]}),disableUnderline:!0,classes:{root:this.props.classes.inputRoot,input:this.props.classes.inputEl}},className:this.props.classes.input,onKeyDown:this.handleKeyDown})}),this.state.attachmentLoadingError&&T(E,{errorMessage:this.state.attachmentLoadingError,className:this.props.classes.fileUploadingError}),this.state.attachmentUrl&&T(U,{fileName:this.state.attachmentName,fileUrl:this.state.attachmentUrl,handleFileDelete:this.handleFileDelete,classes:this.props.classes}),(this.state.isInputFocused||this.state.attachmentUrl||this.state.comment)&&P("div",{className:L.cCommentInputSendContainer,children:[T("div",{className:L.cCommentInputSendContainerCancel,children:T(I,{variant:"caption",className:d(this.props.classes.inputMain,this.props.classes.cancelText,this.props.classes.highlightedLabel),component:"div",gutterBottom:!0,onClick:this.handleCancelClick,children:"Cancel"})}),P("div",{className:L.cCommentInputSendContainerSend,children:[P(I,{variant:"caption",className:d(this.props.classes.inputMain,this.props.classes.inputHelper),component:"div",gutterBottom:!0,children:["Press ",T(I,{variant:"caption",color:"primary",className:d(this.props.classes.inputMain,this.props.classes.highlightedLabel),children:"Enter"})," to send"]}),T(N,{size:"large",tooltipProps:{title:"Send"},"data-testid":"".concat("commentInput","_sendButton"),onClick:this.handleSendComment,classes:{root:this.props.classes.sendButton},children:T(k,{})})]})]})]})}}]),p}();_.propTypes={inputRef:p.shape({current:p.shape({focus:p.shape({})})}),editFeedItemId:p.number,editCommentId:p.number,editComment:p.string,editAttachment:p.shape({url:p.string,size:p.number,file_name:p.string}),spaceAround:p.bool,postComment:p.func.isRequired,postCommentCallback:p.func,patchCommentCallback:p.func,exitEditMode:p.func,setIsPosting:p.func,setIsEditting:p.func,onMount:p.func,autoFocus:p.bool,disabled:p.bool,classes:p.shape({}).isRequired,currentUser:p.shape(),isNative:p.bool,companyId:p.number,parentId:p.string},_.defaultProps={inputRef:null,editFeedItemId:null,editCommentId:null,parentId:null,editComment:null,editAttachment:{},spaceAround:!1,setIsPosting:m,setIsEditting:m,onMount:m,autoFocus:void 0,disabled:!1,patchCommentCallback:m,postCommentCallback:m,exitEditMode:m,companyId:null,currentUser:{},isNative:R};var O=u((function(t){return{paperRoot:{width:"calc(100% - 40px)",marginLeft:40,display:"inline-block",height:32,border:"0","&:focus-within":{boxShadow:"inset 0 0 0 2px ".concat(t.palette.primary.main)},boxShadow:"none"},input:{paddingLeft:5,width:"100%"},inputRoot:{height:32,paddingRight:"10px",lineHeight:"29px",paddingLeft:"10px"},inputEl:{padding:"0 0 0 6px",height:"100%"},additionalActionButton:{padding:"8px","&:hover":{backgroundColor:"transparent"}},nativeActionButton:{margin:"5px 10px",cursor:"pointer"},fileUploadingError:{marginTop:10,marginLeft:24},inputMain:{marginBottom:0,fontSize:"11px",color:t.palette.primary.text8},inputHelper:{display:"flex",paddingRight:5},cancelText:{cursor:"pointer"},highlightedLabel:{color:t.palette.primary.main},iconsContainer:{marginRight:"8px"},iconTooltip:{marginTop:"3px"},sendButton:{"&:hover":{backgroundColor:"rgba(3,188,212, 0.1)"},"&.MuiButtonBase-root":{padding:7}}}}))(_);export{O as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"@babel/runtime/helpers/slicedToArray";import o from"@babel/runtime/helpers/defineProperty";import{useState as
|
|
1
|
+
import e from"@babel/runtime/helpers/slicedToArray";import o from"@babel/runtime/helpers/defineProperty";import{useState as t,useRef as r,useEffect as n}from"react";import i from"prop-types";import a from"classnames";import{noop as l}from"lodash";import{makeStyles as p,Drawer as c,Box as d,Tooltip as s}from"@material-ui/core";import h from"@material-ui/icons/ChevronLeftRounded";import m from"@material-ui/icons/ChevronRightRounded";import u from"@material-ui/icons/Sort";import f from"@material-ui/icons/Check";import g from"@material-ui/icons/Close";import x from"../../IconButton/index.js";import b from"../../Button/index.js";import{jsxs as w,Fragment as T,jsx as C}from"react/jsx-runtime";var I=p((function(e){var t,r;return{drawer:function(t){var r=t.openedDrawerWidth;return o({height:"100%",position:"relative",width:r,borderTop:"1px solid",borderTopColor:e.palette.background.b7,boxShadow:"4px 0px 8px rgba(0, 0, 0, 0.15)"},"&.".concat("closed"),{width:"48px"})},drawerPaper:(t={position:"relative",width:"100%",backgroundColor:e.palette.background.b5},o(t,"&.".concat("closed"),{cursor:"pointer","&:hover":{backgroundColor:e.palette.background.b7,"& > $header":{backgroundColor:e.palette.background.b7}}}),o(t,"&.MuiDrawer-paperAnchorDockedLeft",{borderRight:"none"}),o(t,"&.MuiDrawer-paperAnchorDockedRight",{borderLeft:"none"}),t),header:(r={height:48,borderBottom:"1px solid",borderBottomColor:e.palette.background.b7,display:"flex",justifyContent:"center",alignItems:"center",position:"absolute",top:0,left:0,right:0,letterSpacing:"1px",textTransform:"uppercase",fontSize:"14px",fontWeight:500,lineHeight:"20px",backgroundColor:e.palette.background.b5},o(r,"&.".concat("open"),{padding:e.spacing(1.5),justifyContent:"flex-start"}),o(r,"&.".concat("withShadow"),{zIndex:1,boxShadow:"-18px 12px 12px #272727"}),r),openToggleIconOpen:{transform:"rotate(180deg)"},openToggleContainer:function(e){var t,r=e.anchor;return o(t={alignItems:"center",bottom:0,display:"flex",flex:"0 0",height:48,justifyContent:"center",padding:6,position:"absolute",width:"100%"},"&.".concat("withShadow"),{zIndex:1,boxShadow:"-18px -12px 12px #272727"}),o(t,"&.".concat("open"),{justifyContent:"left"===r?"flex-end":"flex-start",paddingRight:6}),t},contentWrapper:{marginTop:48,height:"calc(100% - 96px)",overflowY:"auto"},content:{padding:"16px 12px",display:"flex",flexDirection:"column"},selectAllButton:{textTransform:"none",fontSize:"10px",lineHeight:"14px",letterSpacing:"0.4px",marginLeft:16,"& .MuiButton-startIcon":{marginRight:4}},headerIcon:{cursor:"pointer"},headerIconText:{cursor:"pointer"}}})),k=function(i){var l,p=i.anchor,k=i.children,O=i.drawerPaperClassName,v=i.expandedTooltipTitle,S=i.collapsedTooltipTitle,A=i.header,y=i.headerIcon,N=i.headerTitleIcon,B=i.isOpen,D=i.openedDrawerWidth,P=i.setIsOpen,R=i.size,W=i.allOptionsButtonShown,j=i.isAllOptionsSelected,z=i.onAllOptionsClick,H=t(!1),L=e(H,2),M=L[0],q=L[1],E=r(),Y=I({anchor:p,openedDrawerWidth:D||{small:235,medium:354,large:473}[R]});n((function(){var e=E.current,o=e.scrollHeight,t=e.clientHeight;q(o>t)}));var $="left"===p?m:h;return w(c,{onClick:function(){B||P(!0)},className:a(Y.drawer,!B&&"closed"),variant:"permanent",classes:{paper:a(Y.drawerPaper,O,!B&&"closed")},anchor:p,children:[w("div",{className:a(Y.header,B&&"open",M&&"withShadow"),onClick:function(){B&&P(!1)},children:[B&&w(T,{children:[N||C(u,{className:Y.headerIcon}),C("div",{className:Y.headerIconText,children:A}),W&&C(b,{className:Y.selectAllButton,onClick:function(e){e.stopPropagation(),z(e)},startIcon:C(j?g:f,{}),children:j?"Clear All":"Select All"})]}),!B&&y]}),C("div",{className:Y.contentWrapper,ref:E,children:C("div",{className:Y.content,children:B&&k})}),C(d,{className:a(Y.openToggleContainer,(l={},o(l,"open",B),o(l,"withShadow",M),l)),children:C(s,{title:B?v:S,placement:"bottom",children:C("div",{children:C(x,{"aria-label":"toggle sidebar",onClick:function(){P(!B)},children:C($,{className:a(B&&Y.openToggleIconOpen)})})})})})]})};k.propTypes={anchor:i.oneOf(["left","right"]),children:i.node.isRequired,drawerPaperClassName:i.string,expandedTooltipTitle:i.string,collapsedTooltipTitle:i.string,header:i.node,headerIcon:i.node,headerTitleIcon:i.node,isOpen:i.bool,openedDrawerWidth:i.oneOfType([i.string,i.number]),setIsOpen:i.func,size:i.oneOf(["small","medium","large"]),allOptionsButtonShown:i.bool,isAllOptionsSelected:i.bool,onAllOptionsClick:i.func},k.defaultProps={anchor:"left",drawerPaperClassName:"",expandedTooltipTitle:"Collapse",collapsedTooltipTitle:"Expand",header:null,headerIcon:null,headerTitleIcon:null,isOpen:!1,openedDrawerWidth:0,setIsOpen:l,size:"medium",allOptionsButtonShown:!1,isAllOptionsSelected:!1,onAllOptionsClick:l};export{k as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"@babel/runtime/helpers/defineProperty";import t from"@babel/runtime/helpers/objectWithoutProperties";import{get as r}from"lodash";import{fromJS as m}from"immutable";import{FEED_ITEM_TYPES_BY_KEY as o,FEED_ITEM_TYPES as p}from"../../../constants/feed.js";import{THEMES as n}from"../../../constants/theme.js";import s from"../feedItemTypes/AlertFeedItem.js";import a from"../feedItemTypes/PostFeedItem.js";import i from"../feedItemTypes/GeosteeringFeedItem.js";import d from"../feedItemTypes/DrillingOperationalNoteFeedItem.js";import f from"../feedItemTypes/DrillingOperationSummaryFeedItem.js";import I from"../feedItemTypes/DrillingDailyCostFeedItem.js";import c from"../feedItemTypes/DocumentFeedItem.js";import y from"../feedItemTypes/DrillerMemoFeedItem.js";import l from"../feedItemTypes/NptFeedItem.js";import u from"../feedItemTypes/SurveyStationFeedItem/index.js";import j from"../feedItemTypes/LessonsLearnedFeedItem/index.js";import T from"../feedItemTypes/TracesMemoFeedItem.js";import F from"../feedItemTypes/
|
|
1
|
+
import e from"@babel/runtime/helpers/defineProperty";import t from"@babel/runtime/helpers/objectWithoutProperties";import{get as r}from"lodash";import{fromJS as m}from"immutable";import{FEED_ITEM_TYPES_BY_KEY as o,FEED_ITEM_TYPES as p}from"../../../constants/feed.js";import{THEMES as n}from"../../../constants/theme.js";import s from"../feedItemTypes/AlertFeedItem.js";import a from"../feedItemTypes/PostFeedItem.js";import i from"../feedItemTypes/GeosteeringFeedItem.js";import d from"../feedItemTypes/DrillingOperationalNoteFeedItem.js";import f from"../feedItemTypes/DrillingOperationSummaryFeedItem.js";import I from"../feedItemTypes/DrillingDailyCostFeedItem.js";import c from"../feedItemTypes/DocumentFeedItem.js";import y from"../feedItemTypes/DrillerMemoFeedItem.js";import l from"../feedItemTypes/NptFeedItem.js";import u from"../feedItemTypes/SurveyStationFeedItem/index.js";import j from"../feedItemTypes/LessonsLearnedFeedItem/index.js";import T from"../feedItemTypes/TracesMemoFeedItem.js";import F from"../feedItemTypes/DepthCommentFeedItem.js";import _ from"../feedItemTypes/CompletionOperationalNoteFeedItem.js";import O from"../feedItemTypes/CompletionOperationSummaryFeedItem.js";import b from"../feedItemTypes/CompletionDailyCostFeedItem.js";import D from"../feedItemTypes/CompletionDocumentFeedItem.js";import g from"../feedItemTypes/CompletionNptFeedItem.js";import h from"../feedItemTypes/StageOverviewFeedItem/index.js";import v from"../feedItemTypes/AppAnnotationFeedItem/index.js";import C from"../feedItemTypes/WellPlanFeedItem/index.js";import P from"../feedItemTypes/FluidReportFeedItem.js";import w from"../feedItemTypes/BhaFeedItem/BhaFeedItem.js";import{jsx as x}from"react/jsx-runtime";var S=["feedItem","appData","customFeedItemTypeTemplates","currentUser"];function E(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var m=Object.getOwnPropertySymbols(e);t&&(m=m.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,m)}return r}function M(t){for(var r=1;r<arguments.length;r++){var m=null!=arguments[r]?arguments[r]:{};r%2?E(Object(m),!0).forEach((function(r){e(t,r,m[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(m)):E(Object(m)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(m,e))}))}return t}var A={view:"feedItem",theme:n.DARK},N=function(e){var n=e.feedItem,E=e.appData,N=e.customFeedItemTypeTemplates,R=e.currentUser,U=t(e,S);if(n.type in N){var B=N[n.type];return x(B,{"data-testid":"".concat("Feed_Content","_template"),feedItem:m(n),appData:m(E),appContext:m(A)})}switch(n.type){case r(o,"alert.type"):return x(s,{feedItem:n});case r(o,"post.type"):return x(a,{feedItem:n});case r(o,"geosteering_comments.type"):return x(i,{feedItem:n});case r(o,"operational_note.type"):return x(d,{feedItem:n});case r(o,"operation_summary.type"):return x(f,{feedItem:n});case r(o,"daily_cost.type"):return x(I,{feedItem:n});case r(o,"document.type"):return x(c,{feedItem:n});case r(o,"driller_memo.type"):return x(y,{feedItem:n});case r(o,"npt_event.type"):return x(l,{feedItem:n});case r(o,"survey_station.type"):return x(u,{feedItem:n});case r(o,"completion_operational_note.type"):return x(_,{feedItem:n});case r(o,"completion_operation_summary.type"):return x(O,{feedItem:n});case r(o,"completion_daily_cost.type"):return x(b,{feedItem:n});case r(o,"completion_document.type"):return x(D,{feedItem:n});case r(o,"completion_npt_event.type"):return x(g,{feedItem:n});case r(o,"completion_actual_stage.type"):return x(h,{feedItem:n});case p.TRACES_MEMO:return x(T,{feedItem:n});case p.DEPTH_COMMENTS:return x(F,{feedItem:n});case r(o,"lessons_learned.type"):return x(j,{feedItem:n});case r(o,"bha.type"):return x(w,{feedItem:n});case r(o,"fluid_report.type"):return x(P,{feedItem:n});case r(o,"app_annotation.type"):return x(v,M({feedItem:n,appData:E,appContext:A,currentUser:R},U));case r(o,"well_plan.type"):return x(C,M({feedItem:n,appData:E,appContext:A},U));default:return null}};export{N as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"@babel/runtime/helpers/slicedToArray";import{useState as o,useRef as t}from"react";import r from"prop-types";import n from"lodash/noop";import m from"moment";import{makeStyles as i,Button as s,Typography as a}from"@material-ui/core";import
|
|
1
|
+
import e from"@babel/runtime/helpers/slicedToArray";import{useState as o,useRef as t}from"react";import r from"prop-types";import n from"lodash/noop";import m from"moment";import{makeStyles as i,Button as s,Typography as a}from"@material-ui/core";import c from"../../Comment/index.js";import p from"../../CommentLoader.js";import d from"../../CommentInput/index.js";import{postFeedItemComment as u}from"../../../clients/jsonApi/index.js";import{isNativeDetected as l}from"../../../utils/mobileDetect.js";import{jsxs as f,jsx as C}from"react/jsx-runtime";var h=i({showMoreButtonRoot:{textTransform:"none",backgroundColor:"transparent!important"},feedCommentsContainer:{padding:"0 24px 0 32px"}});function x(r){var i,x=r.openCommentInput,I=r.feedItem,v=r.currentUser,y=o(!1),b=e(y,2),j=b[0],R=b[1],g=o(3),k=e(g,2),w=k[0],U=k[1],_=t(),q=h(),M=I.comments.length,T=M>w;return f("div",{className:(x||!!M)&&q.feedCommentsContainer,children:[x&&!l&&C(d,{inputRef:_,postComment:function(e){u(I.id,e)},setIsPosting:R,companyId:I.company_id,autoFocus:!1,currentUser:v,parentId:"".concat(I.id,"-").concat(null===(i=I.comments)||void 0===i?void 0:i.size)}),T&&C(s,{"data-testid":"".concat("FeedComments","_viewMoreComments"),classes:q.showMoreButtonRoot,onClick:function(){U((function(e){return 3===e?e+7:e+10}))},children:C(a,{variant:"caption",color:"primary",children:"View more comments"})}),I.comments.sort((function(e){return-m(e.created_at).unix()})).slice(0,w).reverse().map((function(e){return C(c,{comment:e,handleDeleteCallback:n,patchCommentCallback:n,companyId:I.company_id,currentUser:v},e.id)})),j&&C(p,{})]})}x.propTypes={openCommentInput:r.bool.isRequired,feedItem:r.shape().isRequired,currentUser:r.shape().isRequired};export{x as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"@babel/runtime/helpers/defineProperty";import t from"classnames";import
|
|
1
|
+
import e from"@babel/runtime/helpers/defineProperty";import t from"classnames";import i from"moment";import{uniq as n}from"lodash";import{makeStyles as r,useTheme as o,IconButton as m}from"@material-ui/core";import a from"@material-ui/icons/ThumbUp";import s from"@material-ui/icons/Comment";import{notifyOpenFeedCommentInput as l}from"../../../utils/nativeMessages.js";import{isNativeDetected as c}from"../../../utils/mobileDetect.js";import u from"../../CommentsInfo/index.js";import p from"../../../utils/main.js";import{jsx as d,jsxs as f}from"react/jsx-runtime";var g=r({reactionButton:{padding:8},reactions:{minHeight:48,marginTop:5,display:"flex",alignItems:"center",padding:"0 24px 16px 32px",flexWrap:"wrap"},reactionsNative:{padding:"0 16px"},actions:{display:"flex",marginRight:30,alignItems:"center"}}),h=c?2:4,C=function(r){var C=r.feedItem,k=r.currentUser,v=r.setOpenCommentInput,x=r.openCommentInput,N=r.handleToggleLike,b=o(),y=g(),I=C.likes_count,j=C.comments.length,B=(C.likes||[]).find((function(e){var t;return(null===(t=e.user)||void 0===t?void 0:t.id)===k.id})),U=(C.likes||[]).map((function(e){return p.getUserFullName(e.user)})),F=n((C.comments||[]).map((function(e){return p.getUserFullName(e.user)}))),L=n((C.comments||[]).concat(C.likes||[]).sort((function(e){return i(e.created_at).unix()})).map((function(e){return e.user}))).slice(0,h);return d("div",{className:t(y.reactions,e({},y.reactionsNative,c)),children:f("div",{className:y.actions,children:[d(m,{"data-testid":"".concat("FeedPo","_likeButton"),"aria-label":"Like",onClick:N,className:y.reactionButton,children:d(a,{htmlColor:B?b.palette.primary.main:b.palette.grey[400]})}),d(m,{"data-testid":"".concat("FeedPo","_commentButton"),"aria-label":"Comment",onClick:function(){c?l(C.id):v(!x)},className:y.reactionButton,children:d(s,{htmlColor:b.palette.grey[400]})}),d(u,{likesCount:I,usersWhoLike:U,commentsCount:j,usersWhoCommented:F,activeUsersList:L,onCommentsClick:function(){return v(!x)},small:!0})]})})};export{C as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{makeStyles as e,Typography as t}from"@material-ui/core";import{FEED_ITEM_TYPES_BY_KEY as o,FEED_ITEM_TYPES as a}from"../../../constants/feed.js";import{jsx as r}from"react/jsx-runtime";var i=[o.post.type,o.app_annotation.type,o.geosteering_comments.type,a.TRACES_MEMO],n=e((function(e){return{assetRoot:{color:e.palette.grey[400],whiteSpace:"nowrap",textOverflow:"ellipsis",overflow:"hidden",marginRight:10,fontWeight:700,letterSpacing:.25},postTitle:{color:"#fff"}}})),s=function(e){var o=e.feedItem,a=e.userFullName,s=e.typeLabel,l=n(),p=i.includes(o.type)?a:s;return r(t,{variant:"body2",className:l.assetRoot,children:r("span",{"data-testid":"".concat("FeedPo","_postTitle"),className:l.postTitle,children:p})})};export{s as default};
|
|
1
|
+
import{makeStyles as e,Typography as t}from"@material-ui/core";import{FEED_ITEM_TYPES_BY_KEY as o,FEED_ITEM_TYPES as a}from"../../../constants/feed.js";import{jsx as r}from"react/jsx-runtime";var i=[o.post.type,o.app_annotation.type,o.geosteering_comments.type,a.TRACES_MEMO,a.DEPTH_COMMENTS],n=e((function(e){return{assetRoot:{color:e.palette.grey[400],whiteSpace:"nowrap",textOverflow:"ellipsis",overflow:"hidden",marginRight:10,fontWeight:700,letterSpacing:.25},postTitle:{color:"#fff"}}})),s=function(e){var o=e.feedItem,a=e.userFullName,s=e.typeLabel,l=n(),p=i.includes(o.type)?a:s;return r(t,{variant:"body2",className:l.assetRoot,children:r("span",{"data-testid":"".concat("FeedPo","_postTitle"),className:l.postTitle,children:p})})};export{s as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import e from"@babel/runtime/helpers/defineProperty";import t from"prop-types";import r from"moment";import{makeStyles as i,Box as m,Typography as o}from"@material-ui/core";import{isNativeDetected as n}from"../../../utils/mobileDetect.js";import{Regular14 as a}from"../../Typography.js";import s from"../../Attachment/index.js";import{formatMentionText as p}from"../../UserMention/utils/index.js";import l from"../../CollapsibleContent.js";import{FEED_ITEM_TYPES as c}from"../../../constants/feed.js";import{jsxs as d,jsx as f}from"react/jsx-runtime";var u=i((function(e){return{container:{marginBottom:8},label:{color:e.palette.text.secondary}}})),h=function(e){var t=e.feedItem,i=u(),h=t.context,b=h[c.DEPTH_COMMENTS],y=b.body,T=b.commentDepth,D=b.timestamp,M=h.attachment,j=t.mentioned_users;return d(m,{whiteSpace:"pre-wrap",children:[y&&f(l,{children:f(o,{variant:"body1",gutterBottom:!0,children:p(y,j,n)})}),M&&M.url&&f(s,{fileName:M.name,attachmentSize:M.size,size:"medium"}),d(m,{mt:2,mb:2,children:[d(a,{className:i.container,children:[f("span",{className:i.label,children:"Depth: "}),Math.floor(T)," ft"]}),d(a,{className:i.container,children:[f("span",{className:i.label,children:"Time: "}),r(D).format("MM.DD.YYYY, HH:mm")]})]})]})};h.propTypes={feedItem:t.shape({context:t.shape(e({},c.DEPTH_COMMENTS,t.shape({body:t.string.isRequired,attachment:t.shape({url:t.string,size:t.number}),commentDepth:t.oneOfType(t.number).isRequired,timestamp:t.oneOfType([t.string,t.number]).isRequired}).isRequired)).isRequired,mentioned_users:t.arrayOf(t.shape({}))}).isRequired};export{h as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"@babel/runtime/helpers/objectWithoutProperties";import o from"@babel/runtime/helpers/defineProperty";import t from"prop-types";import i from"classnames";import{noop as r}from"lodash";import{withStyles as n,IconButton as s,makeStyles as l,Modal as a,Tooltip as c}from"@material-ui/core";import{Close as m,CloseRounded as d}from"@material-ui/icons";import{isNativeDetected as p,isMobileDetected as u}from"../../utils/mobileDetect.js";import b from"./Modal.css.js";import{jsx as C,jsxs as
|
|
1
|
+
import e from"@babel/runtime/helpers/objectWithoutProperties";import o from"@babel/runtime/helpers/defineProperty";import t from"prop-types";import i from"classnames";import{noop as r}from"lodash";import{withStyles as n,IconButton as s,makeStyles as l,Modal as a,Tooltip as c}from"@material-ui/core";import{Close as m,CloseRounded as d}from"@material-ui/icons";import{isNativeDetected as p,isMobileDetected as u}from"../../utils/mobileDetect.js";import b from"./Modal.css.js";import{jsx as C,jsxs as h}from"react/jsx-runtime";var f,y=["title","children","actions","open","isCloseIconHidden","onClose","isNative","isMobile","stickyFooter","contentContainerClassName","contentClassName","stickyFooterClassName","size","type","rootClassName"];function g(e,o){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);o&&(i=i.filter((function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable}))),t.push.apply(t,i)}return t}function N(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?g(Object(i),!0).forEach((function(t){o(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):g(Object(i)).forEach((function(o){Object.defineProperty(e,o,Object.getOwnPropertyDescriptor(i,o))}))}return e}var v="filters",O="settings",T=(o(f={},v,"Filters"),o(f,O,"Settings"),f),j=n({root:{position:"absolute",right:28,top:24,color:"#9E9E9E",fontSize:"14px",paddingTop:8,width:14,height:14,"&.MuiIconButton-root":{padding:0},"& svg":{transform:"scale(1.8)",width:14,height:14}}})(s),k=n((function(e){return{root:{color:e.palette.primary.text6,"&:hover":{color:"white",cursor:"pointer"}}}}))(m),M=l((function(e){return{closeTooltip:{marginTop:8},closeButton:{padding:"4px 6px",width:"36px",height:"36px","&:hover":{backgroundColor:e.palette.background.b7}}}}));function F(t){var r,n,l=t.title,m=t.children,p=t.actions,u=t.open,f=t.isCloseIconHidden,g=t.onClose,O=t.isNative,F=t.isMobile,P=t.stickyFooter,w=t.contentContainerClassName,x=t.contentClassName,S=t.stickyFooterClassName,z=t.size,D=t.type,E=t.rootClassName,I=e(t,y),H=O||F,A=M();return C(a,N(N({open:u,onClose:g,className:i((r={"c-modal":!H},o(r,b.modalWrapper,!0),o(r,E,!0),o(r,b[D],H&&D),r))},I),{},{children:h("div",{className:i((n={},o(n,b[z],!H),o(n,b.modalContainer,!H),o(n,b.modalMobileContainer,!H),o(n,b.modalStaticFooter,!H&&P),o(n,w,!0),o(n,b.modalMobileContainer,H),o(n,b.modalMobileStaticFooter,H),n)),children:[H&&h("div",{className:i(b.modalMobileTitle,D===v&&b.filtersTitle),children:[C(j,{onClick:g,children:C(d,{})}),C("div",{className:b.modalMobileTitleText,children:l||T[D]})]}),!H&&l&&h("div",{className:i(b.modalTitle,!f&&b.modalTitleWithClose),children:[C("div",{className:b.modalTitleText,children:l}),!f&&C(c,{title:"Close",classes:{tooltip:A.closeTooltip},placement:"bottom",children:C(s,{onClick:g,classes:{root:A.closeButton},children:C(k,{})})})]}),m&&C("div",{className:i(!H&&b.modalContent,H&&b.modalMobileContent,x),children:m}),p&&C("div",{className:i(H&&b.modalMobileActions,!P&&b.modalActions,P&&b.modalActionsSticky,P&&S),children:p})]})}))}F.propTypes={title:t.oneOfType([t.string,t.node]),children:t.oneOfType([t.string,t.node]),actions:t.oneOfType([t.string,t.node,t.array]),stickyFooter:t.bool,open:t.bool.isRequired,onClose:t.func,isNative:t.bool,isMobile:t.bool,isCloseIconHidden:t.bool,contentClassName:t.string,contentContainerClassName:t.string,stickyFooterClassName:t.string,rootClassName:t.string,size:t.string,type:t.string},F.defaultProps={title:"",children:null,actions:"",stickyFooter:!1,onClose:r,isNative:p,isMobile:u,isCloseIconHidden:!1,contentClassName:null,contentContainerClassName:null,stickyFooterClassName:null,size:null,type:"",rootClassName:null};export{F as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"prop-types";import{withStyles as r,FormControl as a,InputLabel as i,Select as s,MenuItem as n}from"@material-ui/core";import{jsxs as t,jsx as o}from"react/jsx-runtime";var l=function(e){var r=e.value,l=e.onChange,u=e.mapping,p=e.classes,c=e.showLabel;return t(a,{children:[o(i,{htmlFor:"traceKey",children:c?"Trace Name":r?"":"Choose a trace"}),o(s,{displayEmpty:!0,value:r,className:p.select,onChange:function(e){return l(e.target.value)},inputProps:{name:"traceKey"},children:u&&u.map((function(e){var r=e.key,a=e.name;return o(n,{value:r,children:a},r)}))})]})};l.propTypes={value:e.string
|
|
1
|
+
import e from"prop-types";import{withStyles as r,FormControl as a,InputLabel as i,Select as s,MenuItem as n}from"@material-ui/core";import{jsxs as t,jsx as o}from"react/jsx-runtime";var l=function(e){var r=e.value,l=e.onChange,u=e.mapping,p=e.classes,c=e.showLabel;return t(a,{children:[o(i,{htmlFor:"traceKey",children:c?"Trace Name":r?"":"Choose a trace"}),o(s,{displayEmpty:!0,value:r,className:p.select,onChange:function(e){return l(e.target.value)},inputProps:{name:"traceKey"},children:u&&u.map((function(e){var r=e.key,a=e.name;return o(n,{value:r,children:a},r)}))})]})};l.propTypes={value:e.string,onChange:e.func.isRequired,classes:e.shape({}).isRequired,showLabel:e.bool,mapping:e.arrayOf(e.shape({name:e.string.isRequired,key:e.string.isRequired}).isRequired).isRequired},l.defaultProps={value:"",showLabel:!1};var u=r({select:{width:200}})(l);export{u as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"@babel/runtime/helpers/defineProperty";import n from"@babel/runtime/helpers/slicedToArray";import{useState as r,useRef as t,useEffect as i}from"react";import a from"classnames";import{round as o,throttle as l}from"lodash";import u from"prop-types";import m from"./RangeSlider.css.js";import{horizontalStrategy as s}from"./strategies/horizontal.js";import{verticalStrategy as c}from"./strategies/vertical.js";import{calculatePercentForValue as p,updateFromValue as d,updateToValue as
|
|
1
|
+
import e from"@babel/runtime/helpers/defineProperty";import n from"@babel/runtime/helpers/slicedToArray";import{useState as r,useRef as t,useEffect as i}from"react";import a from"classnames";import{round as o,throttle as l}from"lodash";import u from"prop-types";import m from"./RangeSlider.css.js";import{horizontalStrategy as s}from"./strategies/horizontal.js";import{verticalStrategy as c}from"./strategies/vertical.js";import{calculatePercentForValue as p,updateFromValue as d,updateToValue as f,calculateValueFromPercent as g}from"./utils.js";import I from"./inputs/FromInput.js";import R from"./inputs/ToInput.js";import{RangeSliderControl as v,RangeSliderOrientation as T}from"./constants.js";import{jsx as O,jsxs as C}from"react/jsx-runtime";var S=function(u){var S=u.min,h=u.max,N=u.from,V=u.to,A=u.minRange,L=u.onChange,y=u.orientation,b=u.precision,B=r(null),M=n(B,2),x=M[0],E=M[1],F=r(null),P=n(F,2),H=P[0],w=P[1],j=r(null),z=n(j,2),U=z[0],Z=z[1],_=r(null),D=n(_,2),q=D[0],X=D[1],Y=r(v.FROM),k=n(Y,2),G=k[0],J=k[1],K=r({}),Q=n(K,2),W=Q[0],$=Q[1],ee=t(null),ne=t(null),re=t(null),te=t(null),ie=t(null);i((function(){y===T.HORIZONTAL&&Z(s),y===T.VERTICAL&&Z(c)}),[y]),i((function(){if(U){var n,r=o(N,b),t=o(V,b),i=o(S,b),a=o(h,b),l=p(r,i,a),u=p(t,i,a),m={};te.current&&ie.current&&(m=U.calculateInputSpacing(l,u,ee,te,ie)),y===T.HORIZONTAL&&X(m.isNotEnoughInputSpace),$((e(n={},v.FROM,U.getThumbStyles(l,G===v.FROM)),e(n,v.TO,U.getThumbStyles(u,G===v.TO)),e(n,v.BAR,U.getBarStyles(l,u)),e(n,v.FROM_INPUT,U.getInputStyles(l)),e(n,v.TO_INPUT,U.getInputStyles(u)),e(n,v.COMPACT_INPUTS,U.getInputStyles((l+u)/2)),n)),E(r.toString()),w(t.toString())}}),[U,S,h,N,V]);var ae=function(e){var n=U.getCoordinates(e,ee.current.getBoundingClientRect()),r=p(n.new,n.min,n.max),t=o(g(r,S,h),b);if(t!==N){var i=d(t,N,V,S,A);L(i)}},oe=function(e){var n=U.getCoordinates(e,ee.current.getBoundingClientRect()),r=p(n.new,n.min,n.max),t=o(g(r,S,h),b);if(t!==V){var i=f(t,N,V,h,A);L(i)}},le=function(e,n){var r=U.getBarCoordinates(e,n,ee.current.getBoundingClientRect()),t=p(r.new,r.min,r.max),i=o(g(t,S,h),b),a=o(V+(i-N),b);if(i<S){var l=S-i;i=S,a=o(a+l,b)}if(a>h){var u=a-h;a=h,i=o(i-u,b)}i!==N&&a!==V&&i>=S&&a<=h&&L({from:i,to:a})},ue=function(e,n){n.stopPropagation(),J(e);var r=n.clientX,t=n.clientY,i=n.target.getBoundingClientRect(),a=i.x,o=i.y;var u=l((function(n){!function(e){return e===v.FROM?ae:e===v.TO?oe:le}(e)(n,{clientX:r,clientY:t,x:a,y:o})}),4);document.addEventListener("mousemove",u),document.addEventListener("mouseup",(function e(){document.removeEventListener("mousemove",u),document.removeEventListener("mouseup",e)}))},me=function(e,n){var r=n.target.value;Number.isNaN(r)||function(e){return e===v.FROM?E:w}(e)(r)},se=function(e,n){var r=n.target.value,t=o(r,b);if(e===v.FROM){var i=d(t,N,V,S,A);L(i)}if(e===v.TO){var a=f(t,N,V,h,A);L(a)}};return O("div",{className:a(y===T.HORIZONTAL&&m.rangeSliderHorizontal,y===T.VERTICAL&&m.rangeSliderVertical),children:C("div",{className:a(m.rangeSliderRail,y===T.HORIZONTAL&&m.rangeSliderRailHorizontal,y===T.VERTICAL&&m.rangeSliderRailVertical),ref:ee,children:[O("div",{ref:ne,className:m.rangeSliderThumb,style:W[v.FROM],onMouseDown:function(e){return ue(v.FROM,e)},children:O("div",{className:m.rangeSliderLabel})}),O("div",{className:a(m.rangeSliderBar,y===T.HORIZONTAL&&m.rangeSliderBarHorizontal,y===T.VERTICAL&&m.rangeSliderBarVertical),style:W[v.BAR],onMouseDown:function(e){return ue(v.BAR,e)},children:O("div",{className:a(m.rangeSliderBarView,y===T.HORIZONTAL&&m.rangeSliderBarViewHorizontal,y===T.VERTICAL&&m.rangeSliderBarViewVertical)})}),O("div",{ref:re,className:m.rangeSliderThumb,style:W[v.TO],onMouseDown:function(e){return ue(v.TO,e)},children:O("div",{className:m.rangeSliderLabel})}),!q&&O(I,{compStyles:W[v.FROM_INPUT],isVerticalOrientation:y===T.VERTICAL,max:h,precision:b,fromInputRef:te,from:N,fromInputValue:x,onInputChange:me,validateInputChange:se}),!q&&O(R,{compStyles:W[v.TO_INPUT],isVerticalOrientation:y===T.VERTICAL,max:h,precision:b,toInputRef:ie,to:V,toInputValue:H,onInputChange:me,validateInputChange:se}),q&&C("div",{className:m.rangeSliderCompactInputs,style:W[v.COMPACT_INPUTS],children:[O(I,{isVerticalOrientation:y===T.VERTICAL,max:h,precision:b,fromInputRef:te,from:N,fromInputValue:x,onInputChange:me,validateInputChange:se}),O("span",{className:m.rangeSliderInputDivider,children:"-"}),O(R,{isVerticalOrientation:y===T.VERTICAL,max:h,precision:b,toInputRef:ie,to:V,toInputValue:H,onInputChange:me,validateInputChange:se})]})]})})};S.propTypes={min:u.number,max:u.number,from:u.number.isRequired,to:u.number.isRequired,orientation:u.oneOf(["horizontal","vertical"]),precision:u.number,minRange:u.number,onChange:u.func},S.defaultProps={min:0,max:100,orientation:"horizontal",precision:0,minRange:0,onChange:function(){}};export{S as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import o from"./palette.mjs.js";var t={MuiTooltip:{tooltip:{backgroundColor:o.background.b9,boxShadow:"0px 4px 4px rgb(0, 0, 0, 0.12)",fontSize:
|
|
1
|
+
import o from"./palette.mjs.js";var t={MuiTooltip:{tooltip:{backgroundColor:o.background.b9,boxShadow:"0px 4px 4px rgb(0, 0, 0, 0.12)",fontSize:12,fontWeight:400,letterSpacing:"0.4px",lineHeight:"16px",padding:4},popper:{"& .MuiTooltip-tooltip":{"&.MuiTooltip-tooltipPlacementTop":{marginBottom:8},"&.MuiTooltip-tooltipPlacementBottom":{marginTop:8},"&.MuiTooltip-tooltipPlacementRight":{marginLeft:8},"&.MuiTooltip-tooltipPlacementLeft":{marginRight:8}}}}};export{t as default};
|
package/constants/feed.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"@babel/runtime/helpers/defineProperty";import t from"@babel/runtime/helpers/toConsumableArray";function l(e,t){var l=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),l.push.apply(l,n)}return l}function n(t){for(var n=1;n<arguments.length;n++){var o=null!=arguments[n]?arguments[n]:{};n%2?l(Object(o),!0).forEach((function(l){e(t,l,o[l])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):l(Object(o)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(o,e))}))}return t}var o="feed",r="ADD_NEW_FEED_ITEMS",a="DELETE_NEW_FEED_ITEM",i="CLEAR_NEW_FEED_ITEMS",p="ADD_FEED_ITEM_TO_UPDATE_LIST",
|
|
1
|
+
import e from"@babel/runtime/helpers/defineProperty";import t from"@babel/runtime/helpers/toConsumableArray";function l(e,t){var l=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),l.push.apply(l,n)}return l}function n(t){for(var n=1;n<arguments.length;n++){var o=null!=arguments[n]?arguments[n]:{};n%2?l(Object(o),!0).forEach((function(l){e(t,l,o[l])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):l(Object(o)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(o,e))}))}return t}var o="feed",r="ADD_NEW_FEED_ITEMS",a="DELETE_NEW_FEED_ITEM",i="CLEAR_NEW_FEED_ITEMS",p="ADD_FEED_ITEM_TO_UPDATE_LIST",m="DELETE_FEED_ITEM_FROM_UPDATE_LIST",s="ADD_FEED_ITEM_TO_DELETE_LIST",c="DELETE_FEED_ITEM_FROM_DELETE_LIST",_={SUBSCRIPTIONS:[{collection:"feed"}]},E={TRACES_MEMO:"traces_memo",POST:"post",DEPTH_COMMENTS:"depth_comments"},y=[{label:"Post",type:E.POST,segment:["drilling","completion"]},{label:"Alert",type:"alert",segment:["drilling","completion"]},{label:"Operational Note",type:"operational_note",segment:["drilling"]},{label:"Operation Summary",type:"operation_summary",segment:["drilling"]},{label:"Daily Cost",type:"daily_cost",segment:["drilling"]},{label:"Document",type:"document",segment:["drilling"]},{label:"Fluid Report",type:"fluid_report",segment:["drilling"]},{label:"BHA",type:"bha",segment:["drilling"]},{label:"Survey Station",type:"survey_station",segment:["drilling"]}].concat(t("production"!==process.env.REACT_APP_ENVIRONMENT?[{label:"Well Plan",type:"well_plan",segment:["drilling"]}]:[]),[{label:"Driller Memo",type:"driller_memo",segment:["drilling"]},{label:"NPT",type:"npt_event",segment:["drilling"]},{label:"Lessons Learned",type:"lessons_learned",segment:["drilling"]},{label:"Operational Note",type:"completion_operational_note",segment:["completion"]},{label:"Operation Summary",type:"completion_operation_summary",segment:["completion"]},{label:"Daily Cost",type:"completion_daily_cost",segment:["completion"]},{label:"Document",type:"completion_document",segment:["completion"]},{label:"Stage Overview",type:"completion_actual_stage",segment:["completion"]},{label:"NPT",type:"completion_npt_event",segment:["completion"]},{label:"App Annotation",type:"app_annotation",segment:["drilling","completion"]},{label:"Traces Memo",type:E.TRACES_MEMO,segment:["drilling","completion"]},{label:"Geosteering Recommendations",type:"geosteering_comments",segment:["drilling","completion"]},{label:"Depth Comments",type:E.DEPTH_COMMENTS,segment:["drilling","completion"]}]),b=y.reduce((function(t,l){return n(n({},t),{},e({},l.type,l))}),{}),g={RIG_FILTERS:[{label:"All",value:"all"},{label:"Filter by asset",value:"filterByAsset"}],DATE_RANGE_FILTERS:[{label:"Last 24 hours",value:"last24hours"},{label:"Last 7 days",value:"last7days"},{label:"Custom",value:"custom"}],CONTENT_TYPE_FILTERS:y.map((function(e){return{label:e.label,value:e.type,segment:e.segment}})),USER_FILTERS:[{label:"All",value:"all"},{label:"Filter by user",value:"filterByUser"}]},u=y.reduce((function(e,l){var n=l.type;return[].concat(t(e),[n])}),[]),T=!0;export{s as ADD_FEED_ITEM_TO_DELETE_LIST,p as ADD_FEED_ITEM_TO_UPDATE_LIST,r as ADD_NEW_FEED_ITEMS,i as CLEAR_NEW_FEED_ITEMS,u as DEFAULT_CONTENT_TYPES_FILTER,c as DELETE_FEED_ITEM_FROM_DELETE_LIST,m as DELETE_FEED_ITEM_FROM_UPDATE_LIST,a as DELETE_NEW_FEED_ITEM,_ as FEED,y as FEED_ITEM_CONFIGS,E as FEED_ITEM_TYPES,b as FEED_ITEM_TYPES_BY_KEY,T as IS_FEED_SHOWN,o as NAME,g as SIDEBAR_FILTERS};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@corva/ui",
|
|
3
|
-
"version": "0.36.0-
|
|
3
|
+
"version": "0.36.0-10",
|
|
4
4
|
"description": "Shared components/utils for Corva ui projects",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"corva-ui"
|
|
@@ -21,7 +21,8 @@
|
|
|
21
21
|
"test-watch": "jest --watch",
|
|
22
22
|
"generate-css-themes": "node ./scripts/generateCssThemesVariables.mjs",
|
|
23
23
|
"build-storybook": "IS_STORYBOOK_BUILD=true build-storybook -c storybook --no-dll",
|
|
24
|
-
"storybook": "IS_STORYBOOK_BUILD=true start-storybook -p 6006 -c storybook --no-dll"
|
|
24
|
+
"storybook": "IS_STORYBOOK_BUILD=true start-storybook -p 6006 -c storybook --no-dll",
|
|
25
|
+
"check-duplications": "echo \"👀 Checking code duplications\" && jscpd src --silent"
|
|
25
26
|
},
|
|
26
27
|
"config": {
|
|
27
28
|
"commitizen": {
|
|
@@ -29,7 +30,8 @@
|
|
|
29
30
|
}
|
|
30
31
|
},
|
|
31
32
|
"pre-commit": [
|
|
32
|
-
"lint-staged"
|
|
33
|
+
"lint-staged",
|
|
34
|
+
"check-duplications"
|
|
33
35
|
],
|
|
34
36
|
"lint-staged": {
|
|
35
37
|
"*.js": [
|
|
@@ -118,6 +120,7 @@
|
|
|
118
120
|
"image-extensions": "1.1.0",
|
|
119
121
|
"immutable": "3.8.2",
|
|
120
122
|
"jest": "^26.4.1",
|
|
123
|
+
"jscpd": "^3.4.5",
|
|
121
124
|
"jsona": "1.5.1",
|
|
122
125
|
"lodash": "4.17.20",
|
|
123
126
|
"mapbox.js": "3.2.1",
|
package/utils/FluidCheckUtils.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import t from"@babel/runtime/helpers/toConsumableArray";import r from"@babel/runtime/helpers/defineProperty";import e from"lodash/isNumber";import n from"lodash/get";import i from"lodash/has";import a from"lodash/set";import d from"moment";import{convertValue as o,getUnitPreference as s}from"./convert.js";function p(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter((function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable}))),e.push.apply(e,n)}return e}function u(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?p(Object(n),!0).forEach((function(e){r(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):p(Object(n)).forEach((function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))}))}return t}var c=function(t){return 0!==t&&!t},l=function(t,r,n,i){return c(t)?!!i:e(t)&&t>r&&t<n},m=function(t,r,n){return e(t)?r&&n?parseFloat(o(t,r,n)):parseFloat(t):null},f=function(t,r,n){return e(t)?r&&n?o(t,r,s(r),n):parseFloat(t):null},v=function(r){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],d=m(n(r,["data","mud_density"]),"density","ppg"),o=m(n(r,["data","depth"]),"length","ft"),s=m(n(r,["data","tvd"]),"length","ft"),p=u(u({},r),{},{data:u(u({},r.data),{},{mud_density:d,depth:o,tvd:s})});return p=e.reduce((function(e,d){var o=["data"].concat(t(d.key.split(".")));if(!i(r,o))return e;var s=m(n(r,o),d.unitType,d.unit);return a(
|
|
1
|
+
import t from"@babel/runtime/helpers/toConsumableArray";import r from"@babel/runtime/helpers/defineProperty";import e from"lodash/isNumber";import n from"lodash/get";import i from"lodash/has";import a from"lodash/set";import d from"moment";import{convertValue as o,getUnitPreference as s}from"./convert.js";function p(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter((function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable}))),e.push.apply(e,n)}return e}function u(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?p(Object(n),!0).forEach((function(e){r(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):p(Object(n)).forEach((function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))}))}return t}var c=function(t){return 0!==t&&!t},l=function(t,r,n,i){return c(t)?!!i:e(t)&&t>r&&t<n},m=function(t,r,n){return e(t)?r&&n?parseFloat(o(t,r,n)):parseFloat(t):null},f=function(t,r,n){return e(t)?r&&n?o(t,r,s(r),n):parseFloat(t):null},v=function(r){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],d=m(n(r,["data","mud_density"]),"density","ppg"),o=m(n(r,["data","depth"]),"length","ft"),s=m(n(r,["data","tvd"]),"length","ft"),p=u(u({},r),{},{data:u(u({},r.data),{},{mud_density:d,depth:o,tvd:s})});return p=e.reduce((function(e,d){var o=["data"].concat(t(d.key.split(".")));if(!i(r,o))return e;var s=m(n(r,o),d.unitType,d.unit);return a(e,o,s)}),p)},y=function(r){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],o=r,s=n(r,["data","date_str"]);if(s){var p=d(new Date(s));p.isValid()&&(o=a(o,["data","date"],p.unix()))}var c=f(n(r,["data","mud_density"]),"density","ppg"),l=f(n(r,["data","depth"]),"length","ft"),m=f(n(r,["data","tvd"]),"length","ft"),v=u(u({},o),{},{data:u(u({},o.data),{},{mud_density:c,depth:l,tvd:m,date_str:null})});return v=e.reduce((function(e,d){var o=["data"].concat(t(d.key.split(".")));if(!i(r,o))return e;var s=f(n(r,o),d.unitType,d.unit);return a(e,o,s)}),v)},g=function(t){var r=t.data,e=r.date_str,n=r.mud_density,i=r.viscosity,a=i.pv,o=i.yp,s=i.rpm_readings,p=!1,u={viscosity:{rpm_readings:[]}};e&&!d(new Date(e)).isValid()&&(p=!0,u.date="Invalid Date.");var f=m(5,"density","ppg"),v=m(20,"density","ppg");l(n,f,v,!1)||(p=!0,u.mud_density="It should be ".concat(f," ~ ").concat(v)),(c(a)||c(o))&&s.length<2&&(p=!0,u.viscosity.rpm_readings_required="At least 2 paris of rpm and dial_reading required."),l(a,0,200,!u.viscosity.rpm_readings_required)||(p=!0,u["viscosity.pv"]="It should be 0~200"),l(o,0,200,!u.viscosity.rpm_readings_required)||(p=!0,u["viscosity.yp"]="It should be 0~200");for(var y=[],g=0;g<s.length;g+=1){u.viscosity.rpm_readings[g]={};var h=u.viscosity.rpm_readings[g];l(s[g].rpm,0,1e3)||(p=!0,h.rpm="It should be 0~1000"),l(s[g].dial_reading,0,300)||(p=!0,h.dial_reading="It should be 0~300"),-1!==y.indexOf(s[g].rpm)&&(p=!0,h.rpm="Duplicated RPM value"),y.push(s[g].rpm),s[g].originalIndex=g}var b=s.sort((function(t,r){return t.rpm-r.rpm}));return b.forEach((function(t,r){var e=u.viscosity.rpm_readings[t.originalIndex];b[r-1]&&t.dial_reading<b[r-1].dial_reading&&(p=!0,e.dial_reading="Dial Readings should be in increasing order")})),{hasErrors:p,errors:u}};export{y as convertToImperialUnit,v as convertToPrefUnit,f as ctoi,m as ctop,c as isValueEmpty,l as isValueValid,g as validate};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import t from"@babel/runtime/helpers/toConsumableArray";var r="SMALL",n="MEDIUM",
|
|
1
|
+
import t from"@babel/runtime/helpers/toConsumableArray";var r="SMALL",n="MEDIUM",o="LARGE",e="XLARGE",i=37.7952755906,a=18.8976377953,u=function(t){var r=t.width,n=t.height;return{pixelWidth:Math.round(18.8976377953*r),pixelHeight:Math.round(18.8976377953*n),realWidth:Math.round(2*r*18.8976377953),realHeight:Math.round(2*n*18.8976377953)}},s={NORMAL:{type:"NORMAL",columns:{min:1,max:7},rows:{min:1,max:1e3},slots:1,height:17.5,width:20.8},WIDE:{type:"WIDE",columns:{min:8,max:12},rows:{min:1,max:25},slots:2,height:17.5,width:41.8},HALFSCREEN:{type:"HALFSCREEN",columns:{min:8,max:12},rows:{min:26,max:40},slots:4,height:26.5,width:41.8},FULLSCREEN:{type:"FULLSCREEN",columns:{min:8,max:12},rows:{min:41,max:1e3},slots:6,height:53.3,width:41.8}};function l(t){return t.concat().sort((function(t,r){var n=t.coordinates.y,o=r.coordinates.y;if(n<o)return-1;if(n>o)return 1;if(n===o){var e=t.coordinates.x,i=r.coordinates.x;if(e<i)return-1;if(e>i)return 1}return 0}))}function c(t){var r=t.coordinates,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"dashboard";if("singleApp"===n)return s.FULLSCREEN;var o=r.w,e=r.h;return Object.values(s).find((function(t){return o>=t.columns.min&&o<=t.columns.max&&e>=t.rows.min&&e<=t.rows.max}))}function m(r,n){var o,e=[],i=[e],a=0;return r.reduce((function(i,u,l){o=!1;var m=c(u,(null==u?void 0:u.layout)||n),h=m.slots,d=m.type;if(d!==s.FULLSCREEN.type){var f=r[l+1];if(f){var p=c(f,(null==f?void 0:f.layout)||n);if(a%2==0&&1===h&&p.slots%2==0){var v=s.WIDE;h=v.slots,d=v.type}}else if(l%2==0){var E=s.WIDE;h=E.slots,d=E.type}}a+=h;var L={app:u,slots:h,reportAppSize:m},x=i.map((function(r){if(o)return r;var n=6-r.reduce((function(t,r){return t+r.slots}),0);return n>=h&&(o=!0),n>=h?[].concat(t(r),[L]):r}));return o?x:[].concat(t(x),[[].concat(e,[L])])}),i)}function h(t){var i=t.w,a=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return a?e:i>=5?o:i>=3?n:r}export{a as PDF_REPORT_PIXEL_RATIO,i as PIXELS_IN_CM,c as getAppType,u as getPDFAppPixelSize,h as getPDFAppSize,m as getPages,l as sortPDFDashboardApps};
|
package/utils/feed.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{get as e}from"lodash";import{FEED_ITEM_TYPES_BY_KEY as t,FEED_ITEM_TYPES as a}from"../constants/feed.js";var c="AVATAR_ICON",s=[t.post.type,t.app_annotation.type,t.geosteering_comments.type,a.TRACES_MEMO];function d(e){return s.includes(e)}function r(a){if(d(a))return"AVATAR_ICON";switch(a){case e(t,"alert.type"):return"/static/media/27836bcdc3e809b0c0f1852a4b5a7e9e.svg";case e(t,"operation_summary.type"):case e(t,"completion_operation_summary.type"):return"/static/media/c90b07a56f57b35270d42804a6610c78.svg";case e(t,"operational_note.type"):case e(t,"completion_operational_note.type"):return"/static/media/eb59357d9fdc0d3aa2556c4accf76a1e.svg";case e(t,"bha.type"):return"/static/media/2f3ed40f34ad7a7f2e6a5e1eda45c5f4.svg";case e(t,"daily_cost.type"):case e(t,"completion_daily_cost.type"):return"/static/media/27afcb4e5f3f2b6d8fc1166fe4dc5580.svg";case e(t,"document.type"):return"/static/media/b976051fc561f69a449fa6b1575a9f38.svg";case e(t,"driller_memo.type"):return"/static/media/f8311dcb5efee59526c9665598ff8916.svg";case e(t,"fluid_report.type"):return"/static/media/493f8add7c4f51e48777410e8adcd94b.svg";case e(t,"survey_station.type"):return"/static/media/48c0221a3d0faf6ab12f78c420df8e3a.svg";case e(t,"lessons_learned.type"):return"/static/media/de87fc2dd3cd91d1433e2ead8e03c691.svg";default:return"/static/media/1f460d664d596ce949f316a08308473d.svg"}}export{c as AVATAR_ICON,r as getIconForFeedItemType,d as isAvatarIcon};
|
|
1
|
+
import{get as e}from"lodash";import{FEED_ITEM_TYPES_BY_KEY as t,FEED_ITEM_TYPES as a}from"../constants/feed.js";var c="AVATAR_ICON",s=[t.post.type,t.app_annotation.type,t.geosteering_comments.type,a.TRACES_MEMO,a.DEPTH_COMMENTS];function d(e){return s.includes(e)}function r(a){if(d(a))return"AVATAR_ICON";switch(a){case e(t,"alert.type"):return"/static/media/27836bcdc3e809b0c0f1852a4b5a7e9e.svg";case e(t,"operation_summary.type"):case e(t,"completion_operation_summary.type"):return"/static/media/c90b07a56f57b35270d42804a6610c78.svg";case e(t,"operational_note.type"):case e(t,"completion_operational_note.type"):return"/static/media/eb59357d9fdc0d3aa2556c4accf76a1e.svg";case e(t,"bha.type"):return"/static/media/2f3ed40f34ad7a7f2e6a5e1eda45c5f4.svg";case e(t,"daily_cost.type"):case e(t,"completion_daily_cost.type"):return"/static/media/27afcb4e5f3f2b6d8fc1166fe4dc5580.svg";case e(t,"document.type"):return"/static/media/b976051fc561f69a449fa6b1575a9f38.svg";case e(t,"driller_memo.type"):return"/static/media/f8311dcb5efee59526c9665598ff8916.svg";case e(t,"fluid_report.type"):return"/static/media/493f8add7c4f51e48777410e8adcd94b.svg";case e(t,"survey_station.type"):return"/static/media/48c0221a3d0faf6ab12f78c420df8e3a.svg";case e(t,"lessons_learned.type"):return"/static/media/de87fc2dd3cd91d1433e2ead8e03c691.svg";default:return"/static/media/1f460d664d596ce949f316a08308473d.svg"}}export{c as AVATAR_ICON,r as getIconForFeedItemType,d as isAvatarIcon};
|
package/utils/main.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"@babel/runtime/helpers/asyncToGenerator";import t from"@babel/runtime/helpers/toConsumableArray";import r from"@babel/runtime/regenerator";import n from"file-saver";import o from"chroma-js";import i from"lodash/round";import a from"lodash/isNaN";import u from"lodash/isNumber";import c from"html2canvas";import s from"@material-ui/core/colors/grey";import m from"@material-ui/core/colors/red";import l from"@material-ui/core/colors/yellow";import f from"@material-ui/core/colors/blue";import p from"@material-ui/core/colors/green";import{SUPPORTED_DRILLING_OPERATIONS as h,DEFAULT_DRILLING_OPERATION_TYPE as d}from"../constants/apps.js";var g=s[500],v=m[500],b=l[500],N=f[500],
|
|
1
|
+
import e from"@babel/runtime/helpers/asyncToGenerator";import t from"@babel/runtime/helpers/toConsumableArray";import r from"@babel/runtime/regenerator";import n from"file-saver";import o from"chroma-js";import i from"lodash/round";import a from"lodash/isNaN";import u from"lodash/isNumber";import c from"html2canvas";import s from"@material-ui/core/colors/grey";import m from"@material-ui/core/colors/red";import l from"@material-ui/core/colors/yellow";import f from"@material-ui/core/colors/blue";import p from"@material-ui/core/colors/green";import{SUPPORTED_DRILLING_OPERATIONS as h,DEFAULT_DRILLING_OPERATION_TYPE as d}from"../constants/apps.js";var g=s[500],v=m[500],b=l[500],N=f[500],w=p[500],F={formatValuePrecision:function(e){return Number.isFinite(e)?e<100&&e>-100?e.formatNumeral("0,0.00"):e.formatNumeral("0,0.0"):e},downloadPDF:function(e,t){var r=new File([t],"".concat(e,".pdf"),{type:"application/pdf;charset=utf-8"});n.saveAs(r)},unescapeLineBreaks:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return e.replace(/\\n/g,"\n")},dataURLtoBlob:function(e){for(var t=window.atob(e.split(",")[1]),r=e.split(",")[0].split(":")[1].split(";")[0],n=new ArrayBuffer(t.length),o=new Uint8Array(n),i=0;i<t.length;i+=1)o[i]=t.charCodeAt(i);return new Blob([n],{type:r})},banchmarkTimer:function(e){var t=new Date;return{stop:function(){var r=(new Date).getTime()-t.getTime();console.info("Timer:",e,"finished in",r,"ms")}}},convertToPercent:function(e,t){return e&&Number.isFinite(t)&&0!==t?Math.round(100*e/t*100)/100:0},getAverageByColumnsForCSV:function(e){var r=this,n=e.split("\n"),o=n[0].split(","),c=n[1].split(",").map((function(e){return[r.parseNumberFromString(e)]})),s=this.getLinesFrequency(n.length);n.shift();var m=n.reduce((function(e,n,o){if(o%s==0){var i=n.split(",").map(r.parseNumberFromString);return e.map((function(e,r){var n=+i[r];return u(n)&&!a(n)&&n>0?[].concat(t(e),[n]):e}))}return e}),c).map((function(e){return e.reduce((function(e,t){return e+t}))/e.length}));return m.map((function(e,t){return{header:o[t],value:i(e,5)}}))},parseNumberFromString:function(e){var t=+e;return a(t)?0:t},getLinesFrequency:function(e){var t="".concat(e);if(t.length<=4)return 1;var r=t.slice(4).length;return 1*Math.pow(10,r)},getColorFromString:function(e){return this.intToRGB(this.hashCode(e))},intToRGB:function(e){var t=(16777215&e).toString(16).toUpperCase();return"00000".substring(0,6-t.length)+t},hashCode:function(e){for(var t=0,r=0;r<e.length;r+=1)t=e.charCodeAt(r)+((t<<5)-t);return t},throttledEventListener:function(e,t,r,n){var o=!1,i=function(){o||(o=!0,window.requestAnimationFrame((function(){r.call(n),o=!1})))};return e.addEventListener(t,i),function(){e.removeEventListener(t,i)}},getSnapshotForElement:function(t){return e(r.mark((function e(){var n,o,i,a;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=window.document.getElementById(t)){e.next=3;break}return e.abrupt("return",null);case 3:return o=n.clientHeight,i=n.clientWidth,e.next=6,c(n,{height:o,width:i,logging:!1});case 6:return a=e.sent,e.abrupt("return",a.toDataURL());case 8:case"end":return e.stop()}}),e)})))()},getAssetStatusColor:function(e){return"active"===e?w:"complete"===e?N:"paused"===e?b:"idle"===e||"unknown"===e?g:v},closest:function(e,t){return e.reduce((function(e,r){return Math.abs(r-t)<Math.abs(e-t)?r:e}))},mathMax:function(e,t){return Number.isFinite(e)?Number.isFinite(t)?Math.max(e,t):e:t},mathMin:function(e,t){return Number.isFinite(e)?Number.isFinite(t)?Math.min(e,t):e:t},getOperationByType:function(e){return Object.values(h).find((function(t){return t.value===e||d}))},getUserFullName:function(e){return e?"".concat(e.first_name," ").concat(e.last_name):""},getNameInitials:function(e){return e.split(" ").slice(0,2).map((function(e){return e.substr(0,1)})).join("")},getS3BucketName:function(){return"development"===process.env.REACT_APP_ENVIRONMENT||"qa"===process.env.REACT_APP_ENVIRONMENT?"corva-files-qa":"corva-files"},getS3FileUrl:function(e,t){return"https://".concat(e,".s3.amazonaws.com/").concat(t)},getFileNameWithExtensionFromPath:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return e.split("?")[0].replace(/^.*[\\/]/,"")},hexToRgbA:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,r=o(e).rgba();return r[r.length-1]=t,"rgba(".concat(r.join(","),")")},truncateString:function(e,t){return e.length>t?"".concat(e.substr(0,t-1),"…"):e},copyToClipboard:function(e){if(navigator.clipboard)navigator.clipboard.writeText(e);else{var t=document.createElement("textarea");t.textContent=e,document.body.appendChild(t);var r=document.getSelection(),n=document.createRange();n.selectNode(t),r.removeAllRanges(),r.addRange(n),document.execCommand("copy"),r.removeAllRanges(),document.body.removeChild(t)}}};window.getSnapshotForElement=F.getSnapshotForElement;export{F as default};
|
package/utils/time.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import r from"moment-timezone";var n=function(n,o){return r.unix(n).format(o)},o=function(r
|
|
1
|
+
import r from"moment-timezone";var n=function(n,o){return r.unix(n).format(o)},o=function(r){return n(r,"M/D/YYYY h:mm a")},u=function(r){return r-r.clone().hour(0).minute(0).second(0).millisecond(0)},t=function(n,o){var t=r.unix(n),i=r.unix(o),e=r.duration(6,"hours"),a=r.duration(12,"hours"),s=r.duration(18,"hours"),h=i-u(i),m=t-u(t),c=(r.duration(h-m).asDays()+1)*a;return t.hours()>17?c-=a:t.hours()>=6&&(c-=u(t)-e),i.hours()<=5?c-=a:i.hours()<18&&(c-=s-u(i)),Math.round(c/1e3)};export{o as formatLastDataUpdate,n as formatTimestamp,t as getDayTimeDuration,u as getDurationFromDayStart};
|