@corva/ui 3.79.0-1 → 3.79.0-3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs-bundle/components/AddComment/Popover.js +1 -1
- package/cjs-bundle/components/AddComment/Popover.js.map +1 -1
- package/cjs-bundle/components/AddComment/components/Content.js +1 -1
- package/cjs-bundle/components/AddComment/components/Content.js.map +1 -1
- package/cjs-bundle/components/AssetEditor/AssetEditorAutocomplete.js +1 -1
- package/cjs-bundle/components/AssetEditor/AssetEditorAutocomplete.js.map +1 -1
- package/cjs-bundle/components/AssetEditorV2/components/MultipleAssetsToggle.js +1 -1
- package/cjs-bundle/components/AssetEditorV2/components/MultipleAssetsToggle.js.map +1 -1
- package/cjs-bundle/components/AssetEditorV2/components/SelectItem.js +1 -1
- package/cjs-bundle/components/AssetEditorV2/components/SelectItem.js.map +1 -1
- package/cjs-bundle/components/BICOffsetPickerDialog/components/WellSection/AssetSearch.js +1 -1
- package/cjs-bundle/components/BICOffsetPickerDialog/components/WellSection/AssetSearch.js.map +1 -1
- package/cjs-bundle/components/BICOffsetPickerDialog/components/WellSection/SectionItem.js +1 -1
- package/cjs-bundle/components/BICOffsetPickerDialog/components/WellSection/SectionItem.js.map +1 -1
- package/cjs-bundle/components/BICOffsetPickerDialog/components/WellSection/index.js +1 -1
- package/cjs-bundle/components/BICOffsetPickerDialog/components/WellSection/index.js.map +1 -1
- package/cjs-bundle/components/BICOffsetPickerDialog/index.js +1 -1
- package/cjs-bundle/components/BICOffsetPickerDialog/index.js.map +1 -1
- package/cjs-bundle/components/Casing/CasingTable/CasingComponent.js +1 -1
- package/cjs-bundle/components/Casing/CasingTable/CasingComponent.js.map +1 -1
- package/cjs-bundle/components/Casing/CasingTableV2/components/CasingJoints/Editor.js +1 -1
- package/cjs-bundle/components/Casing/CasingTableV2/components/CasingJoints/Editor.js.map +1 -1
- package/cjs-bundle/components/Casing/CasingTableV2/components/Component.js +1 -1
- package/cjs-bundle/components/Casing/CasingTableV2/components/Component.js.map +1 -1
- package/cjs-bundle/components/Casing/CasingTableV2/components/DrillPipe/Editor.js +1 -1
- package/cjs-bundle/components/Casing/CasingTableV2/components/DrillPipe/Editor.js.map +1 -1
- package/cjs-bundle/components/Casing/CasingTableV2/components/EditComponentDialog.js +1 -1
- package/cjs-bundle/components/Casing/CasingTableV2/components/EditComponentDialog.js.map +1 -1
- package/cjs-bundle/components/CollapsableSidebar.js +1 -1
- package/cjs-bundle/components/CollapsableSidebar.js.map +1 -1
- package/cjs-bundle/components/DevCenter/DevCenterAppContainer/components/AppSettingsDialog/AppSettingsDialog.js +1 -1
- package/cjs-bundle/components/DevCenter/DevCenterAppContainer/components/AppSettingsDialog/AppSettingsDialog.js.map +1 -1
- package/cjs-bundle/components/DevCenter/DevCenterAppContainer/components/AppSettingsDialog/components/SettingsAccordion.js +1 -1
- package/cjs-bundle/components/DevCenter/DevCenterAppContainer/components/AppSettingsDialog/components/SettingsAccordion.js.map +1 -1
- package/cjs-bundle/components/DevCenter/DevCenterAppContainer/components/FullscreenButton/FullscreenButton.js +1 -1
- package/cjs-bundle/components/DevCenter/DevCenterAppContainer/components/FullscreenButton/FullscreenButton.js.map +1 -1
- package/cjs-bundle/components/DevCenter/DevCenterAppContainer/components/LegacyAppActions.js +1 -1
- package/cjs-bundle/components/DevCenter/DevCenterAppContainer/components/LegacyAppActions.js.map +1 -1
- package/cjs-bundle/components/DocumentViewer/DocumentViewer.js +1 -1
- package/cjs-bundle/components/DocumentViewer/DocumentViewer.js.map +1 -1
- package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Agitator/Editor.js +1 -1
- package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Agitator/Editor.js.map +1 -1
- package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Bit/Editor.js +1 -1
- package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Bit/Editor.js.map +1 -1
- package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Component.js +1 -1
- package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Component.js.map +1 -1
- package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/DrillCollar/Editor.js +1 -1
- package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/DrillCollar/Editor.js.map +1 -1
- package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/DrillPipe/Editor.js +1 -1
- package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/DrillPipe/Editor.js.map +1 -1
- package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/EditComponentDialog.js +1 -1
- package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/EditComponentDialog.js.map +1 -1
- package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Jar/Editor.js +1 -1
- package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Jar/Editor.js.map +1 -1
- package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Lwd/Editor.js +1 -1
- package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Lwd/Editor.js.map +1 -1
- package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Mwd/Editor.js +1 -1
- package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Mwd/Editor.js.map +1 -1
- package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Pdm/Editor.js +1 -1
- package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Pdm/Editor.js.map +1 -1
- package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Rss/Editor.js +1 -1
- package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Rss/Editor.js.map +1 -1
- package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Stabilizer/Editor.js +1 -1
- package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Stabilizer/Editor.js.map +1 -1
- package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Sub/Editor.js +1 -1
- package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Sub/Editor.js.map +1 -1
- package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Ur/Editor.js +1 -1
- package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Ur/Editor.js.map +1 -1
- package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/shared/CancelButton.js +1 -1
- package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/shared/CancelButton.js.map +1 -1
- package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/shared/ConfirmationPopup.js +1 -1
- package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/shared/ConfirmationPopup.js.map +1 -1
- package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/shared/ExpandCollapseButton.js +1 -1
- package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/shared/ExpandCollapseButton.js.map +1 -1
- package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/shared/MoreButton.js +1 -1
- package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/shared/MoreButton.js.map +1 -1
- package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/shared/SaveButton.js +1 -1
- package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/shared/SaveButton.js.map +1 -1
- package/cjs-bundle/components/Drillstring/BHATable/BHAComponent.js +1 -1
- package/cjs-bundle/components/Drillstring/BHATable/BHAComponent.js.map +1 -1
- package/cjs-bundle/components/FeedItem/FeedItem.js +1 -1
- package/cjs-bundle/components/FeedItem/FeedItem.js.map +1 -1
- package/cjs-bundle/components/IconMenu/index.js +1 -1
- package/cjs-bundle/components/IconMenu/index.js.map +1 -1
- package/cjs-bundle/components/OffsetWellChips/Chip.js +1 -1
- package/cjs-bundle/components/OffsetWellChips/Chip.js.map +1 -1
- package/cjs-bundle/components/OffsetWellMap/OffsetWellMap.js +1 -1
- package/cjs-bundle/components/OffsetWellMap/OffsetWellMap.js.map +1 -1
- package/cjs-bundle/components/OffsetWellPickerV2/components/Filter/NonEngineeredWellsSwitch.js +1 -1
- package/cjs-bundle/components/OffsetWellPickerV2/components/Filter/NonEngineeredWellsSwitch.js.map +1 -1
- package/cjs-bundle/components/OffsetWellPickerV2/components/Filter/ToggleFiltersButton.js +1 -1
- package/cjs-bundle/components/OffsetWellPickerV2/components/Filter/ToggleFiltersButton.js.map +1 -1
- package/cjs-bundle/components/OffsetWellPickerV2/components/Filter/ToggleMapButton.js +1 -1
- package/cjs-bundle/components/OffsetWellPickerV2/components/Filter/ToggleMapButton.js.map +1 -1
- package/cjs-bundle/components/OffsetWellPickerV2/components/Table/MetricsAddMenu.js +1 -1
- package/cjs-bundle/components/OffsetWellPickerV2/components/Table/MetricsAddMenu.js.map +1 -1
- package/cjs-bundle/components/OffsetWellPickerV3/components/CustomSelectionView/components/Filter/index.js +1 -1
- package/cjs-bundle/components/OffsetWellPickerV3/components/CustomSelectionView/components/Filter/index.js.map +1 -1
- package/cjs-bundle/components/OffsetWellPickerV3/components/CustomSelectionView/components/Table/AssetSearch.js +1 -1
- package/cjs-bundle/components/OffsetWellPickerV3/components/CustomSelectionView/components/Table/AssetSearch.js.map +1 -1
- package/cjs-bundle/components/OffsetWellPickerV3/components/CustomSelectionView/components/Table/MetricsAddMenu.js +1 -1
- package/cjs-bundle/components/OffsetWellPickerV3/components/CustomSelectionView/components/Table/MetricsAddMenu.js.map +1 -1
- package/cjs-bundle/components/OffsetWellPickerV3/components/CustomSelectionView/index.js +1 -1
- package/cjs-bundle/components/OffsetWellPickerV3/components/CustomSelectionView/index.js.map +1 -1
- package/cjs-bundle/components/OffsetWellPickerV3/components/OffsetWellSelectionView/index.js +1 -1
- package/cjs-bundle/components/OffsetWellPickerV3/components/OffsetWellSelectionView/index.js.map +1 -1
- package/cjs-bundle/components/OffsetWellPickerV3/components/TabSelection/ToggleMapButton.js +1 -1
- package/cjs-bundle/components/OffsetWellPickerV3/components/TabSelection/ToggleMapButton.js.map +1 -1
- package/cjs-bundle/components/OffsetWellPickerV3/components/TabSelection/index.js +1 -1
- package/cjs-bundle/components/OffsetWellPickerV3/components/TabSelection/index.js.map +1 -1
- package/cjs-bundle/components/OffsetWellPickerV3/components/WellHubView/index.js +1 -1
- package/cjs-bundle/components/OffsetWellPickerV3/components/WellHubView/index.js.map +1 -1
- package/cjs-bundle/components/OffsetWellPickerV3/components/shared/OffsetWellTableHead.js +1 -1
- package/cjs-bundle/components/OffsetWellPickerV3/components/shared/OffsetWellTableHead.js.map +1 -1
- package/cjs-bundle/components/OffsetWellPickerV3/components/shared/OffsetWellTableRows.js +1 -1
- package/cjs-bundle/components/OffsetWellPickerV3/components/shared/OffsetWellTableRows.js.map +1 -1
- package/cjs-bundle/components/OffsetWellPickerV3/index.js +1 -1
- package/cjs-bundle/components/OffsetWellPickerV3/index.js.map +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/components/Filter/components/CustomDateFields/CustomDateFields.js +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/components/Filter/components/CustomDateFields/CustomDateFields.js.map +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/components/OffsetWellPickerContent/OffsetWellPickerContent.js +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/components/OffsetWellPickerContent/OffsetWellPickerContent.js.map +1 -1
- package/cjs-bundle/components/PadOffsetsPicker/OffsetAssetChip.js +1 -1
- package/cjs-bundle/components/PadOffsetsPicker/OffsetAssetChip.js.map +1 -1
- package/cjs-bundle/components/PadOffsetsPicker/OffsetAssetsListExpander.js +1 -1
- package/cjs-bundle/components/PadOffsetsPicker/OffsetAssetsListExpander.js.map +1 -1
- package/cjs-bundle/components/PadOffsetsPicker/PadOffsetsPicker.js +1 -1
- package/cjs-bundle/components/PadOffsetsPicker/PadOffsetsPicker.js.map +1 -1
- package/cjs-bundle/components/PadOffsetsPicker/StagesSelector.js +1 -1
- package/cjs-bundle/components/PadOffsetsPicker/StagesSelector.js.map +1 -1
- package/cjs-bundle/components/PadOffsetsPickerV2/PadOffsetsPickerV2.js +1 -1
- package/cjs-bundle/components/PadOffsetsPickerV2/PadOffsetsPickerV2.js.map +1 -1
- package/cjs-bundle/components/Search/Search.js +1 -1
- package/cjs-bundle/components/Search/Search.js.map +1 -1
- package/cjs-bundle/components/StatusBadge/components/DQAccordionDetailsContent.js +1 -1
- package/cjs-bundle/components/StatusBadge/components/DQAccordionDetailsContent.js.map +1 -1
- package/cjs-bundle/components/Template/TemplatePopover/index.js +1 -1
- package/cjs-bundle/components/Template/TemplatePopover/index.js.map +1 -1
- package/cjs-bundle/components/VirtualizedTable/VirtualizedTable.js +1 -1
- package/cjs-bundle/components/VirtualizedTable/VirtualizedTable.js.map +1 -1
- package/cjs-bundle/hocs/withAssetEditorLockHOC.js +1 -1
- package/cjs-bundle/hocs/withAssetEditorLockHOC.js.map +1 -1
- package/components/AddComment/Popover.js +1 -1
- package/components/AddComment/Popover.js.map +1 -1
- package/components/AddComment/components/Content.js +1 -1
- package/components/AddComment/components/Content.js.map +1 -1
- package/components/AssetEditor/AssetEditorAutocomplete.js +1 -1
- package/components/AssetEditor/AssetEditorAutocomplete.js.map +1 -1
- package/components/AssetEditorV2/components/MultipleAssetsToggle.js +1 -1
- package/components/AssetEditorV2/components/MultipleAssetsToggle.js.map +1 -1
- package/components/AssetEditorV2/components/SelectItem.d.ts.map +1 -1
- package/components/AssetEditorV2/components/SelectItem.js +1 -1
- package/components/AssetEditorV2/components/SelectItem.js.map +1 -1
- package/components/BICOffsetPickerDialog/components/WellSection/AssetSearch.js +1 -1
- package/components/BICOffsetPickerDialog/components/WellSection/AssetSearch.js.map +1 -1
- package/components/BICOffsetPickerDialog/components/WellSection/SectionItem.js +1 -1
- package/components/BICOffsetPickerDialog/components/WellSection/SectionItem.js.map +1 -1
- package/components/BICOffsetPickerDialog/components/WellSection/index.js +1 -1
- package/components/BICOffsetPickerDialog/components/WellSection/index.js.map +1 -1
- package/components/BICOffsetPickerDialog/index.js +1 -1
- package/components/BICOffsetPickerDialog/index.js.map +1 -1
- package/components/Casing/CasingTable/CasingComponent.js +1 -1
- package/components/Casing/CasingTable/CasingComponent.js.map +1 -1
- package/components/Casing/CasingTableV2/components/CasingJoints/Editor.js +1 -1
- package/components/Casing/CasingTableV2/components/CasingJoints/Editor.js.map +1 -1
- package/components/Casing/CasingTableV2/components/Component.js +1 -1
- package/components/Casing/CasingTableV2/components/Component.js.map +1 -1
- package/components/Casing/CasingTableV2/components/DrillPipe/Editor.js +1 -1
- package/components/Casing/CasingTableV2/components/DrillPipe/Editor.js.map +1 -1
- package/components/Casing/CasingTableV2/components/EditComponentDialog.d.ts.map +1 -1
- package/components/Casing/CasingTableV2/components/EditComponentDialog.js +1 -1
- package/components/Casing/CasingTableV2/components/EditComponentDialog.js.map +1 -1
- package/components/CollapsableSidebar.js +1 -1
- package/components/CollapsableSidebar.js.map +1 -1
- package/components/DevCenter/DevCenterAppContainer/components/AppSettingsDialog/AppSettingsDialog.js +1 -1
- package/components/DevCenter/DevCenterAppContainer/components/AppSettingsDialog/AppSettingsDialog.js.map +1 -1
- package/components/DevCenter/DevCenterAppContainer/components/AppSettingsDialog/components/SettingsAccordion.js +1 -1
- package/components/DevCenter/DevCenterAppContainer/components/AppSettingsDialog/components/SettingsAccordion.js.map +1 -1
- package/components/DevCenter/DevCenterAppContainer/components/FullscreenButton/FullscreenButton.js +1 -1
- package/components/DevCenter/DevCenterAppContainer/components/FullscreenButton/FullscreenButton.js.map +1 -1
- package/components/DevCenter/DevCenterAppContainer/components/LegacyAppActions.js +1 -1
- package/components/DevCenter/DevCenterAppContainer/components/LegacyAppActions.js.map +1 -1
- package/components/DocumentViewer/DocumentViewer.js +1 -1
- package/components/DocumentViewer/DocumentViewer.js.map +1 -1
- package/components/Drillstring/BHAComponentsTable/components/Agitator/Editor.js +1 -1
- package/components/Drillstring/BHAComponentsTable/components/Agitator/Editor.js.map +1 -1
- package/components/Drillstring/BHAComponentsTable/components/Bit/Editor.js +1 -1
- package/components/Drillstring/BHAComponentsTable/components/Bit/Editor.js.map +1 -1
- package/components/Drillstring/BHAComponentsTable/components/Component.js +1 -1
- package/components/Drillstring/BHAComponentsTable/components/Component.js.map +1 -1
- package/components/Drillstring/BHAComponentsTable/components/DrillCollar/Editor.js +1 -1
- package/components/Drillstring/BHAComponentsTable/components/DrillCollar/Editor.js.map +1 -1
- package/components/Drillstring/BHAComponentsTable/components/DrillPipe/Editor.js +1 -1
- package/components/Drillstring/BHAComponentsTable/components/DrillPipe/Editor.js.map +1 -1
- package/components/Drillstring/BHAComponentsTable/components/EditComponentDialog.d.ts.map +1 -1
- package/components/Drillstring/BHAComponentsTable/components/EditComponentDialog.js +1 -1
- package/components/Drillstring/BHAComponentsTable/components/EditComponentDialog.js.map +1 -1
- package/components/Drillstring/BHAComponentsTable/components/Jar/Editor.js +1 -1
- package/components/Drillstring/BHAComponentsTable/components/Jar/Editor.js.map +1 -1
- package/components/Drillstring/BHAComponentsTable/components/Lwd/Editor.js +1 -1
- package/components/Drillstring/BHAComponentsTable/components/Lwd/Editor.js.map +1 -1
- package/components/Drillstring/BHAComponentsTable/components/Mwd/Editor.js +1 -1
- package/components/Drillstring/BHAComponentsTable/components/Mwd/Editor.js.map +1 -1
- package/components/Drillstring/BHAComponentsTable/components/Pdm/Editor.js +1 -1
- package/components/Drillstring/BHAComponentsTable/components/Pdm/Editor.js.map +1 -1
- package/components/Drillstring/BHAComponentsTable/components/Rss/Editor.js +1 -1
- package/components/Drillstring/BHAComponentsTable/components/Rss/Editor.js.map +1 -1
- package/components/Drillstring/BHAComponentsTable/components/Stabilizer/Editor.js +1 -1
- package/components/Drillstring/BHAComponentsTable/components/Stabilizer/Editor.js.map +1 -1
- package/components/Drillstring/BHAComponentsTable/components/Sub/Editor.js +1 -1
- package/components/Drillstring/BHAComponentsTable/components/Sub/Editor.js.map +1 -1
- package/components/Drillstring/BHAComponentsTable/components/Ur/Editor.js +1 -1
- package/components/Drillstring/BHAComponentsTable/components/Ur/Editor.js.map +1 -1
- package/components/Drillstring/BHAComponentsTable/components/shared/CancelButton.js +1 -1
- package/components/Drillstring/BHAComponentsTable/components/shared/CancelButton.js.map +1 -1
- package/components/Drillstring/BHAComponentsTable/components/shared/ConfirmationPopup.js +1 -1
- package/components/Drillstring/BHAComponentsTable/components/shared/ConfirmationPopup.js.map +1 -1
- package/components/Drillstring/BHAComponentsTable/components/shared/ExpandCollapseButton.d.ts.map +1 -1
- package/components/Drillstring/BHAComponentsTable/components/shared/ExpandCollapseButton.js +1 -1
- package/components/Drillstring/BHAComponentsTable/components/shared/ExpandCollapseButton.js.map +1 -1
- package/components/Drillstring/BHAComponentsTable/components/shared/MoreButton.js +1 -1
- package/components/Drillstring/BHAComponentsTable/components/shared/MoreButton.js.map +1 -1
- package/components/Drillstring/BHAComponentsTable/components/shared/SaveButton.js +1 -1
- package/components/Drillstring/BHAComponentsTable/components/shared/SaveButton.js.map +1 -1
- package/components/Drillstring/BHATable/BHAComponent.js +1 -1
- package/components/Drillstring/BHATable/BHAComponent.js.map +1 -1
- package/components/FeedItem/FeedItem.js +1 -1
- package/components/FeedItem/FeedItem.js.map +1 -1
- package/components/IconMenu/index.js +1 -1
- package/components/IconMenu/index.js.map +1 -1
- package/components/OffsetWellChips/Chip.js +1 -1
- package/components/OffsetWellChips/Chip.js.map +1 -1
- package/components/OffsetWellMap/OffsetWellMap.d.ts.map +1 -1
- package/components/OffsetWellMap/OffsetWellMap.js +1 -1
- package/components/OffsetWellMap/OffsetWellMap.js.map +1 -1
- package/components/OffsetWellPickerV2/components/Filter/NonEngineeredWellsSwitch.js +1 -1
- package/components/OffsetWellPickerV2/components/Filter/NonEngineeredWellsSwitch.js.map +1 -1
- package/components/OffsetWellPickerV2/components/Filter/ToggleFiltersButton.d.ts.map +1 -1
- package/components/OffsetWellPickerV2/components/Filter/ToggleFiltersButton.js +1 -1
- package/components/OffsetWellPickerV2/components/Filter/ToggleFiltersButton.js.map +1 -1
- package/components/OffsetWellPickerV2/components/Filter/ToggleMapButton.d.ts.map +1 -1
- package/components/OffsetWellPickerV2/components/Filter/ToggleMapButton.js +1 -1
- package/components/OffsetWellPickerV2/components/Filter/ToggleMapButton.js.map +1 -1
- package/components/OffsetWellPickerV2/components/Table/MetricsAddMenu.js +1 -1
- package/components/OffsetWellPickerV2/components/Table/MetricsAddMenu.js.map +1 -1
- package/components/OffsetWellPickerV3/components/CustomSelectionView/components/Filter/index.js +1 -1
- package/components/OffsetWellPickerV3/components/CustomSelectionView/components/Filter/index.js.map +1 -1
- package/components/OffsetWellPickerV3/components/CustomSelectionView/components/Table/AssetSearch.d.ts.map +1 -1
- package/components/OffsetWellPickerV3/components/CustomSelectionView/components/Table/AssetSearch.js +1 -1
- package/components/OffsetWellPickerV3/components/CustomSelectionView/components/Table/AssetSearch.js.map +1 -1
- package/components/OffsetWellPickerV3/components/CustomSelectionView/components/Table/MetricsAddMenu.js +1 -1
- package/components/OffsetWellPickerV3/components/CustomSelectionView/components/Table/MetricsAddMenu.js.map +1 -1
- package/components/OffsetWellPickerV3/components/CustomSelectionView/index.js +1 -1
- package/components/OffsetWellPickerV3/components/CustomSelectionView/index.js.map +1 -1
- package/components/OffsetWellPickerV3/components/OffsetWellSelectionView/index.js +1 -1
- package/components/OffsetWellPickerV3/components/OffsetWellSelectionView/index.js.map +1 -1
- package/components/OffsetWellPickerV3/components/TabSelection/ToggleMapButton.d.ts.map +1 -1
- package/components/OffsetWellPickerV3/components/TabSelection/ToggleMapButton.js +1 -1
- package/components/OffsetWellPickerV3/components/TabSelection/ToggleMapButton.js.map +1 -1
- package/components/OffsetWellPickerV3/components/TabSelection/index.js +1 -1
- package/components/OffsetWellPickerV3/components/TabSelection/index.js.map +1 -1
- package/components/OffsetWellPickerV3/components/WellHubView/index.js +1 -1
- package/components/OffsetWellPickerV3/components/WellHubView/index.js.map +1 -1
- package/components/OffsetWellPickerV3/components/shared/OffsetWellTableHead.js +1 -1
- package/components/OffsetWellPickerV3/components/shared/OffsetWellTableHead.js.map +1 -1
- package/components/OffsetWellPickerV3/components/shared/OffsetWellTableRows.js +1 -1
- package/components/OffsetWellPickerV3/components/shared/OffsetWellTableRows.js.map +1 -1
- package/components/OffsetWellPickerV3/index.js +1 -1
- package/components/OffsetWellPickerV3/index.js.map +1 -1
- package/components/OffsetWellPickerV4/OffsetWellPickerV4.d.ts.map +1 -1
- package/components/OffsetWellPickerV5/components/Filter/components/CustomDateFields/CustomDateFields.js +1 -1
- package/components/OffsetWellPickerV5/components/Filter/components/CustomDateFields/CustomDateFields.js.map +1 -1
- package/components/OffsetWellPickerV5/components/OffsetWellPickerContent/OffsetWellPickerContent.js +1 -1
- package/components/OffsetWellPickerV5/components/OffsetWellPickerContent/OffsetWellPickerContent.js.map +1 -1
- package/components/PadOffsetsPicker/OffsetAssetChip.js +1 -1
- package/components/PadOffsetsPicker/OffsetAssetChip.js.map +1 -1
- package/components/PadOffsetsPicker/OffsetAssetsListExpander.d.ts.map +1 -1
- package/components/PadOffsetsPicker/OffsetAssetsListExpander.js +1 -1
- package/components/PadOffsetsPicker/OffsetAssetsListExpander.js.map +1 -1
- package/components/PadOffsetsPicker/PadOffsetsPicker.js +1 -1
- package/components/PadOffsetsPicker/PadOffsetsPicker.js.map +1 -1
- package/components/PadOffsetsPicker/StagesSelector.js +1 -1
- package/components/PadOffsetsPicker/StagesSelector.js.map +1 -1
- package/components/PadOffsetsPickerV2/PadOffsetsPickerV2.js +1 -1
- package/components/PadOffsetsPickerV2/PadOffsetsPickerV2.js.map +1 -1
- package/components/Search/Search.js +1 -1
- package/components/Search/Search.js.map +1 -1
- package/components/StatusBadge/components/DQAccordionDetailsContent.d.ts.map +1 -1
- package/components/StatusBadge/components/DQAccordionDetailsContent.js +1 -1
- package/components/StatusBadge/components/DQAccordionDetailsContent.js.map +1 -1
- package/components/Template/TemplatePopover/index.d.ts.map +1 -1
- package/components/Template/TemplatePopover/index.js +1 -1
- package/components/Template/TemplatePopover/index.js.map +1 -1
- package/components/VirtualizedTable/VirtualizedTable.d.ts.map +1 -1
- package/components/VirtualizedTable/VirtualizedTable.js +1 -1
- package/components/VirtualizedTable/VirtualizedTable.js.map +1 -1
- package/hocs/withAssetEditorLockHOC.d.ts.map +1 -1
- package/hocs/withAssetEditorLockHOC.js +1 -1
- package/hocs/withAssetEditorLockHOC.js.map +1 -1
- package/mcp-server/server.mjs +11 -9
- package/package.json +1 -1
- package/tsconfig.tsbuildinfo +1 -1
- package/cjs-bundle/ext-esm/@material-ui/icons/esm/ExpandLess.js +0 -2
- package/cjs-bundle/ext-esm/@material-ui/icons/esm/ExpandLess.js.map +0 -1
- package/cjs-bundle/ext-esm/@material-ui/icons/esm/ExpandMore.js +0 -2
- package/cjs-bundle/ext-esm/@material-ui/icons/esm/ExpandMore.js.map +0 -1
- package/cjs-bundle/ext-esm/@material-ui/icons/esm/Map.js +0 -2
- package/cjs-bundle/ext-esm/@material-ui/icons/esm/Map.js.map +0 -1
- package/cjs-bundle/ext-esm/@material-ui/icons/esm/UnfoldLess.js +0 -2
- package/cjs-bundle/ext-esm/@material-ui/icons/esm/UnfoldLess.js.map +0 -1
- package/cjs-bundle/ext-esm/@material-ui/icons/esm/UnfoldMore.js +0 -2
- package/cjs-bundle/ext-esm/@material-ui/icons/esm/UnfoldMore.js.map +0 -1
- package/cjs-bundle/ext-esm/@material-ui/icons/esm/utils/createSvgIcon.js +0 -2
- package/cjs-bundle/ext-esm/@material-ui/icons/esm/utils/createSvgIcon.js.map +0 -1
- package/ext-esm/@material-ui/icons/esm/ExpandLess.js +0 -2
- package/ext-esm/@material-ui/icons/esm/ExpandLess.js.map +0 -1
- package/ext-esm/@material-ui/icons/esm/ExpandMore.js +0 -2
- package/ext-esm/@material-ui/icons/esm/ExpandMore.js.map +0 -1
- package/ext-esm/@material-ui/icons/esm/Map.js +0 -2
- package/ext-esm/@material-ui/icons/esm/Map.js.map +0 -1
- package/ext-esm/@material-ui/icons/esm/UnfoldLess.js +0 -2
- package/ext-esm/@material-ui/icons/esm/UnfoldLess.js.map +0 -1
- package/ext-esm/@material-ui/icons/esm/UnfoldMore.js +0 -2
- package/ext-esm/@material-ui/icons/esm/UnfoldMore.js.map +0 -1
- package/ext-esm/@material-ui/icons/esm/utils/createSvgIcon.js +0 -2
- package/ext-esm/@material-ui/icons/esm/utils/createSvgIcon.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FeedItem.js","sources":["../../../../src/components/FeedItem/FeedItem.js"],"sourcesContent":["import { Divider, makeStyles, Paper, Typography } from '@material-ui/core';\nimport grey from '@material-ui/core/colors/grey';\nimport classNames from 'classnames';\nimport { includes, noop, startCase } from 'lodash';\nimport { useRef, useState } from 'react';\n\nimport { useDevCenterRouter } from '../DevCenter';\n\nimport Actions from './components/Actions';\nimport CompletionDateTimestamp from './components/CompletionDateTimestamp';\nimport Content from './components/Content';\nimport CreatedAt from './components/CreatedAt';\nimport FeedComments from './components/FeedComments';\nimport Icon from './components/Icon';\nimport Reactions from './components/Reactions';\nimport RigAndWell from './components/RigAndWell';\nimport TypeAndAssetTitle from './components/TypeAndAssetTitle';\n\nimport styles from './FeedItem.css';\n\nimport { deleteFeedItem, toggleFeedItemLike } from '~/clients/jsonApi';\nimport ConfirmationDialog from '~/components/ConfirmationDialog';\nimport { useIsInsideIsolatedDcApp } from '~/components/DevCenter/DevCenterAppContainer/components/IsInsideIsolatedDcAppProvider';\nimport ErrorBoundary from '~/components/ErrorBoundary';\nimport LoadingIndicator from '~/components/LoadingIndicator';\nimport { OPEN_ALERT_DETAILS_ID_STORAGE_KEY } from '~/constants/alerts';\nimport { FEED_ITEM_TYPES, FEED_ITEM_TYPES_BY_KEY } from '~/constants/feed';\nimport { showSuccessNotification } from '~/utils';\nimport utils from '~/utils/main';\nimport { isNativeDetected } from '~/utils/mobileDetect';\n\nconst PAGE_NAME = 'FeedPo';\n\nconst useStyles = makeStyles(theme => ({\n paperRoot: {\n position: 'relative',\n marginBottom: 10,\n paddingBottom: 16,\n backgroundColor: ({ isInsideDcApp }) =>\n isInsideDcApp ? 'rgba(65, 65, 65, 0.9)' : theme.palette.background.b8,\n width: ({ isInsideDcApp }) => (isInsideDcApp ? 360 : '100%'),\n boxShadow: ({ isInsideDcApp }) =>\n isInsideDcApp &&\n '0px 8px 10px rgba(0, 0, 0, 0.14), 0px 3px 14px rgba(0, 0, 0, 0.12), 0px 5px 5px rgba(0, 0, 0, 0.2)',\n },\n clickablePaperRoot: {\n '&:hover': {\n filter: 'brightness(90%)',\n transition: 'filter 0.3s',\n },\n },\n headerDividerRoot: {\n margin: '8px 0 8px 0',\n backgroundColor: '#595959',\n },\n dateTimestamp: {\n color: theme.palette.primary.text6,\n '& span': {\n color: theme.palette.primary.contrastText,\n },\n },\n}));\n\n/**\n * @typedef {object} ActivityItem\n * @property {number} id\n * @property {string} type\n * @property {Record<string, any>} [context]\n * @property {Array<'update' | 'destroy' | 'like'>} [allowed_actions]\n * @property {number} [company_id]\n * @property {number} [asset_id] is not received from the back but have to be provided while saving activities\n * @property {any} [rig]\n * @property {any} [well]\n * @property {string} [updated_at]\n * @property {any} [segment]\n * @property {boolean} [liked]\n * @property {any[]} [likes]\n * @property {number} [likes_count]\n * @property {any[]} [mentioned_users]\n */\n\n/**\n * @param {object} props\n * @param {ActivityItem} props.feedItem\n * @param {string[]} [props.editableFeedItemTypes]\n * @param {(feedItemId: number) => void} [props.removeFeedItem] called after a feed item was removed by a user\n * @param {(feedItem: ActivityItem) => void} [props.enterEditMode] called when a used clicks \"Edit\" menu item\n * @param {any} [props.router] used for alert navigation by host applications\n * @param {any} props.currentUser used to display Avatar and to determine the ability to edit comments\n * @param {any} [props.appData] passed to body Template\n * @param {Record<string, any>} [props.customFeedItemTypeTemplates]\n * @param {string} [props.paperClassName]\n * @param {any} [props.getFeedItemMessage] used only to create a data-testid attribute\n * @param {(feedItem: ActivityItem) => void} [props.onFeedItemClick]\n * used to override built-in navigation for clickable alert feed items\n * @param {ReactNode} [props.extraActions] additional action nodes rendered inside the reactions/actions row, after the built-in like and comment buttons\n */\nfunction FeedItem({\n feedItem,\n editableFeedItemTypes = [FEED_ITEM_TYPES.POST],\n removeFeedItem = noop,\n enterEditMode = noop,\n router,\n currentUser,\n appData,\n customFeedItemTypeTemplates = {},\n paperClassName,\n getFeedItemMessage = ({ context }) => context?.post?.body || context?.dvd_comment?.body,\n onFeedItemClick,\n extraActions,\n ...props\n}) {\n const canDeleteFeedItem = includes(feedItem.allowed_actions, 'destroy');\n\n const isInsideDcApp = useIsInsideIsolatedDcApp();\n const classes = useStyles({ isInsideDcApp });\n const [isLoading, setIsLoading] = useState(false);\n const [openCommentInput, setOpenCommentInput] = useState(true);\n const [openCommentList, setOpenCommentList] = useState(true);\n const [openDeleteDialog, setOpenDeleteDialog] = useState(false);\n\n const isPost = feedItem.type === FEED_ITEM_TYPES_BY_KEY.post.type;\n const isEditableItem = editableFeedItemTypes.includes(feedItem.type);\n\n const isGeosteering = feedItem.type === FEED_ITEM_TYPES_BY_KEY.geosteering_comments.type;\n const isRecommended =\n isGeosteering && feedItem.context?.geosteering_comments?.data?.isRecommendation;\n\n const typeCategory = FEED_ITEM_TYPES_BY_KEY[feedItem.type]?.category || 'post';\n\n const userFullName = utils.getUserFullName(feedItem.user);\n const typeLabel = FEED_ITEM_TYPES_BY_KEY[feedItem.type]?.showCreatorToLabel\n ? userFullName\n : FEED_ITEM_TYPES_BY_KEY[feedItem.type]?.label || startCase(feedItem.type);\n\n const feedItemSourceLink =\n feedItem.type === FEED_ITEM_TYPES_BY_KEY.alert.type && `/alerts/${feedItem.context?.alert?.id}`;\n\n const isFeedItemClickable =\n feedItem.type === FEED_ITEM_TYPES_BY_KEY.alert.type && feedItemSourceLink;\n\n const handleDeleteFeedItem = async () => {\n setIsLoading(true);\n\n try {\n await deleteFeedItem(feedItem.id);\n } catch (e) {\n return;\n } finally {\n setIsLoading(false);\n }\n\n showSuccessNotification('Item was deleted');\n\n removeFeedItem(feedItem.id);\n };\n\n const isBeingLikedRef = useRef(false);\n\n const handleToggleLike = async () => {\n if (!isBeingLikedRef.current) {\n const feedItemId = feedItem.id;\n isBeingLikedRef.current = true;\n try {\n await toggleFeedItemLike(feedItemId); // NOTE: Received through subscription\n } catch (e) {\n // NOTE: Do nothing\n }\n isBeingLikedRef.current = false;\n }\n };\n\n const handleEditMenuItem = () => {\n enterEditMode(feedItem);\n };\n\n const handleDeleteMenuItem = () => {\n setOpenDeleteDialog(true);\n };\n\n const copyFeedItemLink = () => {\n const feedId = feedItem.id;\n const text = `${window.location.host}/feed/${feedId}`;\n\n utils.copyToClipboard(text);\n };\n\n const handleDelete = () => {\n handleDeleteFeedItem();\n };\n\n const devCenterRouter = useDevCenterRouter();\n\n const handleMainContainerClick = () => {\n if (!isFeedItemClickable) return;\n\n if (onFeedItemClick) {\n onFeedItemClick(feedItem);\n return;\n }\n\n const alertRouter = router || devCenterRouter;\n\n if (alertRouter) {\n alertRouter.push(feedItemSourceLink);\n return;\n }\n\n localStorage.setItem(OPEN_ALERT_DETAILS_ID_STORAGE_KEY, feedItem.context.alert.id);\n };\n\n const getRigName = feedItem => {\n const isRigBasedItem = !!feedItem.rig;\n return isRigBasedItem ? feedItem.rig?.name : feedItem.well?.parent_asset?.name;\n };\n\n return (\n <Paper\n data-testid={`${PAGE_NAME}_post_${getFeedItemMessage(feedItem)}_rigName_${getRigName(\n feedItem\n )}`}\n className={classNames(classes.paperRoot, paperClassName, {\n [classes.clickablePaperRoot]: isFeedItemClickable,\n [styles.hideOverflow]: isLoading,\n })}\n elevation={0}\n >\n <div\n onClick={handleMainContainerClick}\n className={classNames(styles.mainContainer, {\n [styles.mainContainerClickable]: isFeedItemClickable,\n [styles.mainContainerNative]: isNativeDetected,\n })}\n >\n <Icon\n feedItem={feedItem}\n classes={classes}\n displayName={userFullName}\n isRecommended={isRecommended}\n currentUser={currentUser}\n />\n <div\n className={classNames(styles.mainContainerTop, {\n [styles.mainContainerTopNative]: isNativeDetected,\n })}\n >\n <div className={styles.mainContainerTopLine}>\n <TypeAndAssetTitle\n feedItem={feedItem}\n userFullName={userFullName}\n typeLabel={typeLabel}\n classes={classes}\n isPost={isPost}\n />\n <div className={styles.mainContainerTopMenu}>\n <CreatedAt feedItem={feedItem} classes={classes} />\n\n <Actions\n data-testid={`${PAGE_NAME}_actionsDropdown`}\n isPost={isPost}\n isEditableItem={isEditableItem}\n canDeleteFeedItem={canDeleteFeedItem}\n handleEditMenuItem={handleEditMenuItem}\n handleDeleteMenuItem={handleDeleteMenuItem}\n copyFeedItemLink={copyFeedItemLink}\n feedItem={feedItem}\n currentUser={currentUser}\n />\n </div>\n </div>\n\n <RigAndWell feedItem={feedItem} isPost={isPost} />\n </div>\n <Divider className={classes.headerDividerRoot} />\n <CompletionDateTimestamp feedItem={feedItem} />\n <ErrorBoundary ErrorView={() => <Typography>Feed Item loading failed</Typography>}>\n <Content\n feedItem={feedItem}\n appData={appData}\n customFeedItemTypeTemplates={customFeedItemTypeTemplates}\n currentUser={currentUser}\n onFeedItemClick={onFeedItemClick}\n {...props}\n />\n </ErrorBoundary>\n </div>\n <Reactions\n feedItem={feedItem}\n handleToggleLike={handleToggleLike}\n setOpenCommentInput={setOpenCommentInput}\n setOpenCommentList={setOpenCommentList}\n openCommentInput={openCommentInput}\n openCommentList={openCommentList}\n currentUser={currentUser}\n extraActions={extraActions}\n />\n <FeedComments\n openCommentInput={openCommentInput}\n openCommentList={openCommentList}\n feedItem={feedItem}\n currentUser={currentUser}\n />\n {isLoading && ( // NOTE: Avoids feed item height change\n <div className={styles.loadingContainer} style={{ backgroundColor: grey[800] }}>\n <LoadingIndicator />\n </div>\n )}\n {openDeleteDialog && (\n <ConfirmationDialog\n open={openDeleteDialog}\n title={`Delete ${typeCategory}`}\n text={`Are you sure you want to delete ${typeCategory} and all attachments?`}\n handleClose={() => setOpenDeleteDialog(false)}\n handleOk={handleDelete}\n okText=\"Delete\"\n />\n )}\n </Paper>\n );\n}\n\nexport default FeedItem;\n"],"names":["useStyles","makeStyles","theme","paperRoot","position","marginBottom","paddingBottom","backgroundColor","_ref","isInsideDcApp","palette","background","b8","width","_ref2","boxShadow","_ref3","clickablePaperRoot","filter","transition","headerDividerRoot","margin","dateTimestamp","color","primary","text6","contrastText","_ref4","_feedItem$context","_feedItem$context$geo","_feedItem$context$geo2","_FEED_ITEM_TYPES_BY_K","_FEED_ITEM_TYPES_BY_K2","_FEED_ITEM_TYPES_BY_K3","_feedItem$context2","_feedItem$context2$al","_classNames","_classNames2","_ref6","_ref7","feedItem","_ref4$editableFeedIte","editableFeedItemTypes","FEED_ITEM_TYPES","POST","_ref4$removeFeedItem","removeFeedItem","noop","_ref4$enterEditMode","enterEditMode","router","currentUser","appData","_ref4$customFeedItemT","customFeedItemTypeTemplates","paperClassName","_ref4$getFeedItemMess","getFeedItemMessage","_ref5","_context$post","_context$dvd_comment","context","post","body","dvd_comment","onFeedItemClick","extraActions","props","_objectWithoutProperties","_excluded","canDeleteFeedItem","includes","allowed_actions","useIsInsideIsolatedDcApp","classes","useState","_useState2","_slicedToArray","_useState","isLoading","setIsLoading","_useState4","_useState3","openCommentInput","setOpenCommentInput","_useState6","_useState5","openCommentList","setOpenCommentList","_useState8","_useState7","openDeleteDialog","setOpenDeleteDialog","isPost","type","FEED_ITEM_TYPES_BY_KEY","isEditableItem","isRecommended","geosteering_comments","data","isRecommendation","typeCategory","category","userFullName","utils","getUserFullName","user","typeLabel","showCreatorToLabel","label","startCase","feedItemSourceLink","alert","id","isFeedItemClickable","handleDeleteFeedItem","_asyncToGenerator","_regeneratorRuntime","mark","_callee","wrap","_context","prev","next","deleteFeedItem","t0","abrupt","finish","showSuccessNotification","stop","apply","this","arguments","isBeingLikedRef","useRef","handleToggleLike","_callee2","feedItemId","_context2","current","toggleFeedItemLike","devCenterRouter","useDevCenterRouter","_jsxs","Paper","PAGE_NAME","concat","_feedItem$rig","_feedItem$well","_feedItem$well$parent","rig","name","well","parent_asset","getRigName","className","classNames","styles","hideOverflow","elevation","children","jsxs","onClick","alertRouter","push","localStorage","setItem","OPEN_ALERT_DETAILS_ID_STORAGE_KEY","mainContainer","mainContainerClickable","mainContainerNative","isNativeDetected","_jsx","Icon","displayName","mainContainerTop","mainContainerTopNative","mainContainerTopLine","TypeAndAssetTitle","mainContainerTopMenu","CreatedAt","Actions","handleEditMenuItem","handleDeleteMenuItem","copyFeedItemLink","feedId","text","window","location","host","copyToClipboard","RigAndWell","Divider","CompletionDateTimestamp","ErrorBoundary","ErrorView","Typography","Content","_objectSpread","Reactions","FeedComments","loadingContainer","style","grey","LoadingIndicator","jsx","ConfirmationDialog","open","title","handleClose","handleOk","okText"],"mappings":"0hmBA+BA,IAEMA,EAAYC,EAAAA,YAAW,SAAAC,GAAK,MAAK,CACrCC,UAAW,CACTC,SAAU,WACVC,aAAc,GACdC,cAAe,GACfC,gBAAiB,SAAAC,GAAgB,SAAbC,cACF,wBAA0BP,EAAMQ,QAAQC,WAAWC,EAAE,EACvEC,MAAO,SAAAC,GAAgB,SAAbL,cAAqC,IAAM,MAAO,EAC5DM,UAAW,SAAAC,GAAgB,SAAbP,eAEZ,oGAAoG,GAExGQ,mBAAoB,CAClB,UAAW,CACTC,OAAQ,kBACRC,WAAY,gBAGhBC,kBAAmB,CACjBC,OAAQ,cACRd,gBAAiB,WAEnBe,cAAe,CACbC,MAAOrB,EAAMQ,QAAQc,QAAQC,MAC7B,SAAU,CACRF,MAAOrB,EAAMQ,QAAQc,QAAQE,eAGlC,mBAoCD,SAcGC,GAAA,IAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EA8B4BC,EAkBJC,EA7DzBC,IAAAA,SAAQC,EAAAd,EACRe,sBAAAA,OAAwB,IAAAD,EAAA,CAACE,EAAeA,gBAACC,MAAKH,EAAAI,EAAAlB,EAC9CmB,eAAAA,aAAiBC,EAAIA,KAAAF,EAAAG,EAAArB,EACrBsB,cAAAA,cAAgBF,EAAIA,KAAAC,EACpBE,KAAAA,OACAC,KAAAA,YACAC,KAAAA,QAAOC,GAAA1B,EACP2B,4BAAAA,QAA2B,IAAAD,GAAG,CAAE,EAAAA,GAChCE,KAAAA,eAAcC,GAAA7B,EACd8B,mBAAAA,QAAqB,IAAAD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5BwJ,MAACqB,EAAuB,CAACzJ,SAAUA,IACnCoI,MAACsB,EAAa,CAACC,UAAW,WAAA,OAAMvB,EAAAA,IAACwB,EAAAA,WAAU,CAAApC,SAAA,4BAAuC,EAAAA,SAChFY,EAAAA,IAACyB,EAAOC,EAAA,CACN9J,SAAUA,EACVY,QAASA,GACTE,4BAA6BA,GAC7BH,YAAaA,GACbc,gBAAiBA,IACbE,UAIVyG,MAAC2B,EAAS,CACR/J,SAAUA,EACV+F,iBAAkBA,GAClBnD,oBAAqBA,GACrBI,mBAAoBA,GACpBL,iBAAkBA,GAClBI,gBAAiBA,GACjBpC,YAAaA,GACbe,aAAcA,KAEhB0G,MAAC4B,EAAY,CACXrH,iBAAkBA,GAClBI,gBAAiBA,GACjB/C,SAAUA,EACVW,YAAaA,KAEd4B,IACC6F,EAAAA,IAAA,MAAA,CAAKjB,UAAWE,EAAO4C,iBAAkBC,MAAO,CAAEnM,gBAAiBoM,EAAI,QAAC,MAAO3C,SAC7EY,EAAAA,IAACgC,EAAgB,MAGpBjH,IACCiF,EAAAiC,IAACC,EAAkB,CACjBC,KAAMpH,GACNqH,MAAK,UAAA9D,OAAY7C,IACjBqF,KAAI,mCAAAxC,OAAqC7C,GAAoC,yBAC7E4G,YAAa,WAAA,OAAMrH,IAAoB,EAAO,EAC9CsH,SA9Ha,WACnB/F,MA8HMgG,OAAO,aAKjB"}
|
|
1
|
+
{"version":3,"file":"FeedItem.js","sources":["../../../../src/components/FeedItem/FeedItem.js"],"sourcesContent":["import { Divider, makeStyles, Paper, Typography } from '@material-ui/core';\nimport grey from '@material-ui/core/colors/grey';\nimport classNames from 'classnames';\nimport { includes, noop, startCase } from 'lodash';\nimport { useRef, useState } from 'react';\n\nimport { useDevCenterRouter } from '../DevCenter';\n\nimport Actions from './components/Actions';\nimport CompletionDateTimestamp from './components/CompletionDateTimestamp';\nimport Content from './components/Content';\nimport CreatedAt from './components/CreatedAt';\nimport FeedComments from './components/FeedComments';\nimport Icon from './components/Icon';\nimport Reactions from './components/Reactions';\nimport RigAndWell from './components/RigAndWell';\nimport TypeAndAssetTitle from './components/TypeAndAssetTitle';\n\nimport styles from './FeedItem.css';\n\nimport { deleteFeedItem, toggleFeedItemLike } from '~/clients/jsonApi';\nimport ConfirmationDialog from '~/components/ConfirmationDialog';\nimport { useIsInsideIsolatedDcApp } from '~/components/DevCenter/DevCenterAppContainer/components/IsInsideIsolatedDcAppProvider';\nimport ErrorBoundary from '~/components/ErrorBoundary';\nimport LoadingIndicator from '~/components/LoadingIndicator';\nimport { OPEN_ALERT_DETAILS_ID_STORAGE_KEY } from '~/constants/alerts';\nimport { FEED_ITEM_TYPES, FEED_ITEM_TYPES_BY_KEY } from '~/constants/feed';\nimport { showSuccessNotification } from '~/utils';\nimport utils from '~/utils/main';\nimport { isNativeDetected } from '~/utils/mobileDetect';\n\nconst PAGE_NAME = 'FeedPo';\n\nconst useStyles = makeStyles(theme => ({\n paperRoot: {\n position: 'relative',\n marginBottom: 10,\n paddingBottom: 16,\n backgroundColor: ({ isInsideDcApp }) =>\n isInsideDcApp ? 'rgba(65, 65, 65, 0.9)' : theme.palette.background.b8,\n width: ({ isInsideDcApp }) => (isInsideDcApp ? 360 : '100%'),\n boxShadow: ({ isInsideDcApp }) =>\n isInsideDcApp &&\n '0px 8px 10px rgba(0, 0, 0, 0.14), 0px 3px 14px rgba(0, 0, 0, 0.12), 0px 5px 5px rgba(0, 0, 0, 0.2)',\n },\n clickablePaperRoot: {\n '&:hover': {\n filter: 'brightness(90%)',\n transition: 'filter 0.3s',\n },\n },\n headerDividerRoot: {\n margin: '8px 0 8px 0',\n backgroundColor: '#595959',\n },\n dateTimestamp: {\n color: theme.palette.primary.text6,\n '& span': {\n color: theme.palette.primary.contrastText,\n },\n },\n}));\n\n/**\n * @typedef {object} ActivityItem\n * @property {number} id\n * @property {string} type\n * @property {Record<string, any>} [context]\n * @property {Array<'update' | 'destroy' | 'like'>} [allowed_actions]\n * @property {number} [company_id]\n * @property {number} [asset_id] is not received from the back but have to be provided while saving activities\n * @property {any} [rig]\n * @property {any} [well]\n * @property {string} [updated_at]\n * @property {any} [segment]\n * @property {boolean} [liked]\n * @property {any[]} [likes]\n * @property {number} [likes_count]\n * @property {any[]} [mentioned_users]\n */\n\n/**\n * @param {object} props\n * @param {ActivityItem} props.feedItem\n * @param {string[]} [props.editableFeedItemTypes]\n * @param {(feedItemId: number) => void} [props.removeFeedItem] called after a feed item was removed by a user\n * @param {(feedItem: ActivityItem) => void} [props.enterEditMode] called when a used clicks \"Edit\" menu item\n * @param {any} [props.router] used for alert navigation by host applications\n * @param {any} props.currentUser used to display Avatar and to determine the ability to edit comments\n * @param {any} [props.appData] passed to body Template\n * @param {Record<string, any>} [props.customFeedItemTypeTemplates]\n * @param {string} [props.paperClassName]\n * @param {any} [props.getFeedItemMessage] used only to create a data-testid attribute\n * @param {(feedItem: ActivityItem) => void} [props.onFeedItemClick]\n * used to override built-in navigation for clickable alert feed items\n * @param {ReactNode} [props.extraActions] additional action nodes rendered inside the reactions/actions row, after the built-in like and comment buttons\n */\nfunction FeedItem({\n feedItem,\n editableFeedItemTypes = [FEED_ITEM_TYPES.POST],\n removeFeedItem = noop,\n enterEditMode = noop,\n router,\n currentUser,\n appData,\n customFeedItemTypeTemplates = {},\n paperClassName,\n getFeedItemMessage = ({ context }) => context?.post?.body || context?.dvd_comment?.body,\n onFeedItemClick,\n extraActions,\n ...props\n}) {\n const canDeleteFeedItem = includes(feedItem.allowed_actions, 'destroy');\n\n const isInsideDcApp = useIsInsideIsolatedDcApp();\n const classes = useStyles({ isInsideDcApp });\n const [isLoading, setIsLoading] = useState(false);\n const [openCommentInput, setOpenCommentInput] = useState(true);\n const [openCommentList, setOpenCommentList] = useState(true);\n const [openDeleteDialog, setOpenDeleteDialog] = useState(false);\n\n const isPost = feedItem.type === FEED_ITEM_TYPES_BY_KEY.post.type;\n const isEditableItem = editableFeedItemTypes.includes(feedItem.type);\n\n const isGeosteering = feedItem.type === FEED_ITEM_TYPES_BY_KEY.geosteering_comments.type;\n const isRecommended =\n isGeosteering && feedItem.context?.geosteering_comments?.data?.isRecommendation;\n\n const typeCategory = FEED_ITEM_TYPES_BY_KEY[feedItem.type]?.category || 'post';\n\n const userFullName = utils.getUserFullName(feedItem.user);\n const typeLabel = FEED_ITEM_TYPES_BY_KEY[feedItem.type]?.showCreatorToLabel\n ? userFullName\n : FEED_ITEM_TYPES_BY_KEY[feedItem.type]?.label || startCase(feedItem.type);\n\n const feedItemSourceLink =\n feedItem.type === FEED_ITEM_TYPES_BY_KEY.alert.type && `/alerts/${feedItem.context?.alert?.id}`;\n\n const isFeedItemClickable =\n feedItem.type === FEED_ITEM_TYPES_BY_KEY.alert.type && feedItemSourceLink;\n\n const handleDeleteFeedItem = async () => {\n setIsLoading(true);\n\n try {\n await deleteFeedItem(feedItem.id);\n } catch (e) {\n return;\n } finally {\n setIsLoading(false);\n }\n\n showSuccessNotification('Item was deleted');\n\n removeFeedItem(feedItem.id);\n };\n\n const isBeingLikedRef = useRef(false);\n\n const handleToggleLike = async () => {\n if (!isBeingLikedRef.current) {\n const feedItemId = feedItem.id;\n isBeingLikedRef.current = true;\n try {\n await toggleFeedItemLike(feedItemId); // NOTE: Received through subscription\n } catch (e) {\n // NOTE: Do nothing\n }\n isBeingLikedRef.current = false;\n }\n };\n\n const handleEditMenuItem = () => {\n enterEditMode(feedItem);\n };\n\n const handleDeleteMenuItem = () => {\n setOpenDeleteDialog(true);\n };\n\n const copyFeedItemLink = () => {\n const feedId = feedItem.id;\n const text = `${window.location.host}/feed/${feedId}`;\n\n utils.copyToClipboard(text);\n };\n\n const handleDelete = () => {\n handleDeleteFeedItem();\n };\n\n const devCenterRouter = useDevCenterRouter();\n\n const handleMainContainerClick = () => {\n if (!isFeedItemClickable) return;\n\n if (onFeedItemClick) {\n onFeedItemClick(feedItem);\n return;\n }\n\n const alertRouter = router || devCenterRouter;\n\n if (alertRouter) {\n alertRouter.push(feedItemSourceLink);\n return;\n }\n\n localStorage.setItem(OPEN_ALERT_DETAILS_ID_STORAGE_KEY, feedItem.context.alert.id);\n };\n\n const getRigName = feedItem => {\n const isRigBasedItem = !!feedItem.rig;\n return isRigBasedItem ? feedItem.rig?.name : feedItem.well?.parent_asset?.name;\n };\n\n return (\n <Paper\n data-testid={`${PAGE_NAME}_post_${getFeedItemMessage(feedItem)}_rigName_${getRigName(\n feedItem\n )}`}\n className={classNames(classes.paperRoot, paperClassName, {\n [classes.clickablePaperRoot]: isFeedItemClickable,\n [styles.hideOverflow]: isLoading,\n })}\n elevation={0}\n >\n <div\n onClick={handleMainContainerClick}\n className={classNames(styles.mainContainer, {\n [styles.mainContainerClickable]: isFeedItemClickable,\n [styles.mainContainerNative]: isNativeDetected,\n })}\n >\n <Icon\n feedItem={feedItem}\n classes={classes}\n displayName={userFullName}\n isRecommended={isRecommended}\n currentUser={currentUser}\n />\n <div\n className={classNames(styles.mainContainerTop, {\n [styles.mainContainerTopNative]: isNativeDetected,\n })}\n >\n <div className={styles.mainContainerTopLine}>\n <TypeAndAssetTitle\n feedItem={feedItem}\n userFullName={userFullName}\n typeLabel={typeLabel}\n classes={classes}\n isPost={isPost}\n />\n <div className={styles.mainContainerTopMenu}>\n <CreatedAt feedItem={feedItem} classes={classes} />\n\n <Actions\n data-testid={`${PAGE_NAME}_actionsDropdown`}\n isPost={isPost}\n isEditableItem={isEditableItem}\n canDeleteFeedItem={canDeleteFeedItem}\n handleEditMenuItem={handleEditMenuItem}\n handleDeleteMenuItem={handleDeleteMenuItem}\n copyFeedItemLink={copyFeedItemLink}\n feedItem={feedItem}\n currentUser={currentUser}\n />\n </div>\n </div>\n\n <RigAndWell feedItem={feedItem} isPost={isPost} />\n </div>\n <Divider className={classes.headerDividerRoot} />\n <CompletionDateTimestamp feedItem={feedItem} />\n <ErrorBoundary ErrorView={() => <Typography>Feed Item loading failed</Typography>}>\n <Content\n feedItem={feedItem}\n appData={appData}\n customFeedItemTypeTemplates={customFeedItemTypeTemplates}\n currentUser={currentUser}\n onFeedItemClick={onFeedItemClick}\n {...props}\n />\n </ErrorBoundary>\n </div>\n <Reactions\n feedItem={feedItem}\n handleToggleLike={handleToggleLike}\n setOpenCommentInput={setOpenCommentInput}\n setOpenCommentList={setOpenCommentList}\n openCommentInput={openCommentInput}\n openCommentList={openCommentList}\n currentUser={currentUser}\n extraActions={extraActions}\n />\n <FeedComments\n openCommentInput={openCommentInput}\n openCommentList={openCommentList}\n feedItem={feedItem}\n currentUser={currentUser}\n />\n {isLoading && ( // NOTE: Avoids feed item height change\n <div className={styles.loadingContainer} style={{ backgroundColor: grey[800] }}>\n <LoadingIndicator />\n </div>\n )}\n {openDeleteDialog && (\n <ConfirmationDialog\n open={openDeleteDialog}\n title={`Delete ${typeCategory}`}\n text={`Are you sure you want to delete ${typeCategory} and all attachments?`}\n handleClose={() => setOpenDeleteDialog(false)}\n handleOk={handleDelete}\n okText=\"Delete\"\n />\n )}\n </Paper>\n );\n}\n\nexport default FeedItem;\n"],"names":["useStyles","makeStyles","theme","paperRoot","position","marginBottom","paddingBottom","backgroundColor","_ref","isInsideDcApp","palette","background","b8","width","_ref2","boxShadow","_ref3","clickablePaperRoot","filter","transition","headerDividerRoot","margin","dateTimestamp","color","primary","text6","contrastText","_ref4","_feedItem$context","_feedItem$context$geo","_feedItem$context$geo2","_FEED_ITEM_TYPES_BY_K","_FEED_ITEM_TYPES_BY_K2","_FEED_ITEM_TYPES_BY_K3","_feedItem$context2","_feedItem$context2$al","_classNames","_classNames2","_ref6","_ref7","feedItem","_ref4$editableFeedIte","editableFeedItemTypes","FEED_ITEM_TYPES","POST","_ref4$removeFeedItem","removeFeedItem","noop","_ref4$enterEditMode","enterEditMode","router","currentUser","appData","_ref4$customFeedItemT","customFeedItemTypeTemplates","paperClassName","_ref4$getFeedItemMess","getFeedItemMessage","_ref5","_context$post","_context$dvd_comment","context","post","body","dvd_comment","onFeedItemClick","extraActions","props","_objectWithoutProperties","_excluded","canDeleteFeedItem","includes","allowed_actions","useIsInsideIsolatedDcApp","classes","useState","_useState2","_slicedToArray","_useState","isLoading","setIsLoading","_useState4","_useState3","openCommentInput","setOpenCommentInput","_useState6","_useState5","openCommentList","setOpenCommentList","_useState8","_useState7","openDeleteDialog","setOpenDeleteDialog","isPost","type","FEED_ITEM_TYPES_BY_KEY","isEditableItem","isRecommended","geosteering_comments","data","isRecommendation","typeCategory","category","userFullName","utils","getUserFullName","user","typeLabel","showCreatorToLabel","label","startCase","feedItemSourceLink","alert","id","isFeedItemClickable","handleDeleteFeedItem","_asyncToGenerator","_regeneratorRuntime","mark","_callee","wrap","_context","prev","next","deleteFeedItem","t0","abrupt","finish","showSuccessNotification","stop","apply","this","arguments","isBeingLikedRef","useRef","handleToggleLike","_callee2","feedItemId","_context2","current","toggleFeedItemLike","devCenterRouter","useDevCenterRouter","_jsxs","Paper","PAGE_NAME","concat","_feedItem$rig","_feedItem$well","_feedItem$well$parent","rig","name","well","parent_asset","getRigName","className","classNames","styles","hideOverflow","elevation","children","jsxs","onClick","alertRouter","push","localStorage","setItem","OPEN_ALERT_DETAILS_ID_STORAGE_KEY","mainContainer","mainContainerClickable","mainContainerNative","isNativeDetected","_jsx","Icon","displayName","mainContainerTop","mainContainerTopNative","mainContainerTopLine","TypeAndAssetTitle","mainContainerTopMenu","CreatedAt","Actions","handleEditMenuItem","handleDeleteMenuItem","copyFeedItemLink","feedId","text","window","location","host","copyToClipboard","RigAndWell","Divider","CompletionDateTimestamp","ErrorBoundary","ErrorView","Typography","Content","_objectSpread","Reactions","FeedComments","loadingContainer","style","grey","LoadingIndicator","jsx","ConfirmationDialog","open","title","handleClose","handleOk","okText"],"mappings":"onmBA+BA,IAEMA,EAAYC,EAAAA,YAAW,SAAAC,GAAK,MAAK,CACrCC,UAAW,CACTC,SAAU,WACVC,aAAc,GACdC,cAAe,GACfC,gBAAiB,SAAAC,GAAgB,SAAbC,cACF,wBAA0BP,EAAMQ,QAAQC,WAAWC,EAAE,EACvEC,MAAO,SAAAC,GAAgB,SA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GACjB/C,SAAUA,EACVW,YAAaA,KAEd4B,IACC6F,EAAAA,IAAA,MAAA,CAAKjB,UAAWE,EAAO4C,iBAAkBC,MAAO,CAAEnM,gBAAiBoM,EAAI,QAAC,MAAO3C,SAC7EY,EAAAA,IAACgC,EAAgB,MAGpBjH,IACCiF,EAAAiC,IAACC,EAAkB,CACjBC,KAAMpH,GACNqH,MAAK,UAAA9D,OAAY7C,IACjBqF,KAAI,mCAAAxC,OAAqC7C,GAAoC,yBAC7E4G,YAAa,WAAA,OAAMrH,IAAoB,EAAO,EAC9CsH,SA9Ha,WACnB/F,MA8HMgG,OAAO,aAKjB"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var e=require("@babel/runtime/helpers/defineProperty"),t=require("@babel/runtime/helpers/slicedToArray"),r=require("react"),o=require("prop-types"),n=require("@material-ui/core"),a=require("@material-ui/icons"),i=require("../IconButton/index.js"),l=require("react/jsx-runtime");function s(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var u=s(e),c=s(t),p=s(o);function
|
|
1
|
+
"use strict";var e=require("@babel/runtime/helpers/defineProperty"),t=require("@babel/runtime/helpers/slicedToArray"),r=require("react"),o=require("prop-types"),n=require("@material-ui/core"),a=require("@material-ui/icons/MoreVert"),i=require("../IconButton/index.js"),l=require("react/jsx-runtime");function s(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var u=s(e),c=s(t),p=s(o),d=s(a);function f(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,o)}return r}function h(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?f(Object(r),!0).forEach((function(t){u.default(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):f(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function m(e){var t=e.classes,o=e["data-testid"],a=e.iconButtonStyle,i=e.color,s=e.disableRipple,u=e.className,p=e.IconElement,d=e.IconButtonComponent,f=e.disabled,m=e.iconButtonProps,b=e.children,g=e.anchorOrigin,O=e.transformOrigin,y=e.marginThreshold,v=e.menuProps,P=e.tooltipProps,j=e.paperClassName,B=r.useState(null),T=c.default(B,2),x=T[0],C=T[1],w=!!x,q=r.useState(!1),I=c.default(q,2),N=I[0],S=I[1];r.useEffect((function(){var e;return w&&setTimeout((function(){e=S(w)}),500),function(){e&&clearTimeout(e)}}),[w]);var E=function(e){e.stopPropagation(),C(null),S(!1)},R=l.jsx(d,h(h({"aria-label":"IconMenu","aria-owns":w?"icon-menu":void 0,"aria-haspopup":"true","data-testid":o,onClick:function(e){e.stopPropagation(),e.preventDefault(),C(e.currentTarget)},classes:{root:t.iconButton},className:u,style:a,color:i,disableRipple:s,disabled:f},m),{},{children:p}));return l.jsxs(l.Fragment,{children:[P?l.jsx(n.Tooltip,h(h({},P),{},{children:R})):R,l.jsx(n.Menu,h(h({id:"icon-menu",anchorEl:x,open:w,MenuListProps:{"data-testid":"".concat(o,"Dropdown")},disableAutoFocus:!N,autoFocus:N,onClose:E,onClick:E,anchorOrigin:g,transformOrigin:O,classes:{paper:t.paper},elevation:0,marginThreshold:y,PaperProps:{className:t[j]}},v),{},{children:b}))]})}m.propTypes={children:p.default.oneOfType([p.default.string,p.default.node,p.default.array]),classes:p.default.shape({iconButton:p.default.string,paper:p.default.string}),className:p.default.string,color:p.default.string,IconElement:p.default.element,IconButtonComponent:p.default.any,iconButtonStyle:p.default.shape({}),anchorOrigin:p.default.shape({horizontal:p.default.oneOf(["left","center","right"]),vertical:p.default.oneOf(["top","center","bottom"])}),transformOrigin:p.default.shape({horizontal:p.default.oneOf(["left","center","right"]),vertical:p.default.oneOf(["top","center","bottom"])}),disableRipple:p.default.bool,"data-testid":p.default.string,marginThreshold:p.default.number,disabled:p.default.bool,tooltipProps:p.default.shape({}),menuProps:p.default.shape({}),iconButtonProps:p.default.shape({}),paperClassName:p.default.string},m.defaultProps={children:void 0,classes:{},className:void 0,color:void 0,"data-testid":void 0,IconElement:l.jsx(d.default,{}),iconButtonStyle:void 0,IconButtonComponent:i,disableRipple:!1,anchorOrigin:{horizontal:"right",vertical:"top"},transformOrigin:{horizontal:"right",vertical:"bottom"},marginThreshold:void 0,disabled:!1,tooltipProps:void 0,menuProps:{},iconButtonProps:{},paperClassName:""};var b=n.withStyles((function(e){return{iconButton:{borderRadius:8,padding:"10px",color:e.palette.primary.text6,"&:hover":{color:e.palette.primary.text1,backgroundColor:"rgba(255, 255, 255, 0.16)"},"& .MuiTouchRipple-child":{borderRadius:8}},paper:{}}}))(m);module.exports=b;
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../src/components/IconMenu/index.js"],"sourcesContent":["import { useState, useEffect } from 'react';\nimport PropTypes from 'prop-types';\nimport { Menu, withStyles, Tooltip } from '@material-ui/core';\nimport
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../src/components/IconMenu/index.js"],"sourcesContent":["import { useState, useEffect } from 'react';\nimport PropTypes from 'prop-types';\nimport { Menu, withStyles, Tooltip } from '@material-ui/core';\nimport MoreVert from '@material-ui/icons/MoreVert';\n\nimport IconButton from '../IconButton';\n\nconst muiStyles = theme => ({\n iconButton: {\n borderRadius: 8,\n padding: '10px',\n color: theme.palette.primary.text6,\n '&:hover': {\n color: theme.palette.primary.text1,\n backgroundColor: 'rgba(255, 255, 255, 0.16)',\n },\n '& .MuiTouchRipple-child': {\n borderRadius: 8,\n },\n },\n paper: {},\n});\n\nfunction IconMenu({\n classes,\n // IconButtonComponentProps\n 'data-testid': testId,\n iconButtonStyle,\n color,\n disableRipple,\n className,\n IconElement,\n IconButtonComponent,\n disabled,\n iconButtonProps,\n // MenuProps\n children,\n anchorOrigin,\n transformOrigin,\n marginThreshold,\n menuProps,\n // Tooltip\n tooltipProps,\n paperClassName,\n}) {\n const [anchorEl, setAnchorEl] = useState(null);\n const isOpen = !!anchorEl;\n\n /*\n A fix of the issue: https://corvaqa.atlassian.net/browse/DC-3713\n\n When Material Menu is rendered, at first it's displayed at the top of the container\n and only then moves to the anchor element. When the focus is enabled, and the element is\n inside of an iframe but outside the view - browsers scroll the page to it. Because of this, we set focus in async\n manner, to wait for correct position - and then set focus.\n\n https://github.dev/mui/material-ui/blob/v4.x/packages/material-ui/src/Popover/Popover.js#L323-L331\n */\n const [isMenuAutofocus, setIsMenuAutofocus] = useState(false);\n useEffect(() => {\n let timerId;\n\n if (isOpen) {\n setTimeout(() => {\n timerId = setIsMenuAutofocus(isOpen);\n // Why 500? The lower delay doesn't actually work, so this is the lowest value I could get to make it work\n }, 500);\n }\n\n return () => {\n if (timerId) {\n clearTimeout(timerId);\n }\n };\n }, [isOpen]);\n\n const handleClose = event => {\n event.stopPropagation();\n setAnchorEl(null);\n setIsMenuAutofocus(false);\n };\n const handleOpen = event => {\n event.stopPropagation();\n event.preventDefault();\n setAnchorEl(event.currentTarget);\n };\n\n const iconButtonElement = (\n <IconButtonComponent\n aria-label=\"IconMenu\"\n aria-owns={isOpen ? 'icon-menu' : undefined}\n aria-haspopup=\"true\"\n data-testid={testId}\n onClick={handleOpen}\n classes={{ root: classes.iconButton }}\n className={className}\n style={iconButtonStyle}\n color={color}\n disableRipple={disableRipple}\n disabled={disabled}\n {...iconButtonProps}\n >\n {IconElement}\n </IconButtonComponent>\n );\n\n return (\n <>\n {tooltipProps ? <Tooltip {...tooltipProps}>{iconButtonElement}</Tooltip> : iconButtonElement}\n <Menu\n id=\"icon-menu\"\n anchorEl={anchorEl}\n open={isOpen}\n MenuListProps={{ 'data-testid': `${testId}Dropdown` }}\n disableAutoFocus={!isMenuAutofocus}\n autoFocus={isMenuAutofocus}\n onClose={handleClose}\n onClick={handleClose}\n anchorOrigin={anchorOrigin}\n transformOrigin={transformOrigin}\n classes={{ paper: classes.paper }}\n elevation={0}\n marginThreshold={marginThreshold}\n PaperProps={{\n className: classes[paperClassName],\n }}\n {...menuProps}\n >\n {children}\n </Menu>\n </>\n );\n}\n\nIconMenu.propTypes = {\n children: PropTypes.oneOfType([PropTypes.string, PropTypes.node, PropTypes.array]),\n classes: PropTypes.shape({\n iconButton: PropTypes.string,\n paper: PropTypes.string,\n }),\n className: PropTypes.string,\n color: PropTypes.string,\n IconElement: PropTypes.element,\n // eslint-disable-next-line react/forbid-prop-types\n IconButtonComponent: PropTypes.any,\n iconButtonStyle: PropTypes.shape({}),\n anchorOrigin: PropTypes.shape({\n horizontal: PropTypes.oneOf(['left', 'center', 'right']),\n vertical: PropTypes.oneOf(['top', 'center', 'bottom']),\n }),\n transformOrigin: PropTypes.shape({\n horizontal: PropTypes.oneOf(['left', 'center', 'right']),\n vertical: PropTypes.oneOf(['top', 'center', 'bottom']),\n }),\n disableRipple: PropTypes.bool,\n 'data-testid': PropTypes.string,\n marginThreshold: PropTypes.number,\n disabled: PropTypes.bool,\n tooltipProps: PropTypes.shape({}),\n menuProps: PropTypes.shape({}),\n iconButtonProps: PropTypes.shape({}),\n paperClassName: PropTypes.string,\n};\n\nIconMenu.defaultProps = {\n children: undefined,\n classes: {},\n className: undefined,\n color: undefined,\n 'data-testid': undefined,\n IconElement: <MoreVert />,\n iconButtonStyle: undefined,\n IconButtonComponent: IconButton,\n disableRipple: false,\n anchorOrigin: { horizontal: 'right', vertical: 'top' },\n transformOrigin: { horizontal: 'right', vertical: 'bottom' },\n marginThreshold: undefined,\n disabled: false,\n tooltipProps: undefined,\n menuProps: {},\n iconButtonProps: {},\n paperClassName: '',\n};\n\nexport default withStyles(muiStyles)(IconMenu);\n"],"names":["IconMenu","_ref","classes","testId","iconButtonStyle","color","disableRipple","className","IconElement","IconButtonComponent","disabled","iconButtonProps","children","anchorOrigin","transformOrigin","marginThreshold","menuProps","tooltipProps","paperClassName","useState","_useState2","_slicedToArray","_useState","anchorEl","setAnchorEl","isOpen","_useState4","_useState3","isMenuAutofocus","setIsMenuAutofocus","useEffect","timerId","setTimeout","clearTimeout","handleClose","event","stopPropagation","iconButtonElement","_jsx","jsx","_objectSpread","undefined","onClick","preventDefault","currentTarget","root","iconButton","style","_jsxs","_Fragment","Tooltip","Menu","id","open","MenuListProps","disableAutoFocus","autoFocus","onClose","paper","elevation","PaperProps","propTypes","PropTypes","oneOfType","string","node","array","shape","element","any","horizontal","oneOf","vertical","bool","number","defaultProps","MoreVert","IconButton","index","withStyles","theme","borderRadius","padding","palette","primary","text6","text1","backgroundColor"],"mappings":"29BAuBA,SAASA,EAqBNC,GAAA,IApBDC,IAAAA,QAEeC,IAAf,eACAC,IAAAA,gBACAC,IAAAA,MACAC,IAAAA,cACAC,IAAAA,UACAC,IAAAA,YACAC,IAAAA,oBACAC,IAAAA,SACAC,IAAAA,gBAEAC,IAAAA,SACAC,IAAAA,aACAC,IAAAA,gBACAC,IAAAA,gBACAC,IAAAA,UAEAC,IAAAA,aACAC,IAAAA,eAEgCC,EAAAA,EAAQA,SAAC,MAAKC,EAAAC,EAAAA,QAAAC,EAAA,GAAvCC,EAAQH,EAAA,GAAEI,EAAWJ,EAAA,GACtBK,IAAWF,EAY6BJ,EAAAA,EAAQA,UAAC,GAAMO,EAAAL,EAAAA,QAAAM,EAAA,GAAtDC,EAAeF,EAAA,GAAEG,EAAkBH,EAAA,GAC1CI,EAAAA,WAAU,WACR,IAAIC,EASJ,OAPIN,GACFO,YAAW,WACTD,EAAUF,EAAmBJ,EAE9B,GAAE,KAGE,WACDM,GACFE,aAAaF,GAGnB,GAAG,CAACN,IAEJ,IAAMS,EAAc,SAAAC,GAClBA,EAAMC,kBACNZ,EAAY,MACZK,GAAmB,IAQfQ,EACJC,EAAAC,IAAC9B,EAAmB+B,EAAAA,EAAA,CAClB,aAAW,WACX,YAAWf,EAAS,iBAAcgB,EAClC,gBAAc,OACd,cAAatC,EACbuC,QAZe,SAAAP,GACjBA,EAAMC,kBAC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C/BG,WAAYR,EAAS,QAACS,MAAM,CAAC,OAAQ,SAAU,UAC/CC,SAAUV,EAAS,QAACS,MAAM,CAAC,MAAO,SAAU,aAE9CjE,cAAewD,EAAS,QAACW,KACzB,cAAeX,EAAS,QAACE,OACzBjD,gBAAiB+C,EAAS,QAACY,OAC3BhE,SAAUoD,EAAS,QAACW,KACpBxD,aAAc6C,EAAAA,QAAUK,MAAM,IAC9BnD,UAAW8C,EAAAA,QAAUK,MAAM,IAC3BxD,gBAAiBmD,EAAAA,QAAUK,MAAM,IACjCjD,eAAgB4C,EAAS,QAACE,QAG5BhE,EAAS2E,aAAe,CACtB/D,cAAU6B,EACVvC,QAAS,CAAE,EACXK,eAAWkC,EACXpC,WAAOoC,EACP,mBAAeA,EACfjC,YAAa8B,EAAAA,IAACsC,EAAQ,QAAG,IACzBxE,qBAAiBqC,EACjBhC,oBAAqBoE,EACrBvE,eAAe,EACfO,aAAc,CAAEyD,WAAY,QAASE,SAAU,OAC/C1D,gBAAiB,CAAEwD,WAAY,QAASE,SAAU,UAClDzD,qBAAiB0B,EACjB/B,UAAU,EACVO,kBAAcwB,EACdzB,UAAW,CAAE,EACbL,gBAAiB,CAAE,EACnBO,eAAgB,IAGlB,IAAA4D,EAAeC,cAjLG,SAAAC,GAAK,MAAK,CAC1BlC,WAAY,CACVmC,aAAc,EACdC,QAAS,OACT7E,MAAO2E,EAAMG,QAAQC,QAAQC,MAC7B,UAAW,CACThF,MAAO2E,EAAMG,QAAQC,QAAQE,MAC7BC,gBAAiB,6BAEnB,0BAA2B,CACzBN,aAAc,IAGlBvB,MAAO,CAAC,EACT,GAmKcqB,CAAsB/E"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var e=require("@babel/runtime/helpers/slicedToArray"),t=require("react"),i=require("@material-ui/core"),o=require("@material-ui/icons"),r=require("../MiddleTruncate/MiddleTruncate.js"),l=require("../../utils/main.js"),a=require("./icons/SubjectIcon.js"),n=require("react/jsx-runtime");function s(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var c=s(e),u=i.makeStyles((function(e){return{chipRoot:{position:"relative",height:30,padding:"7px 12px",fontSize:12,color:e.palette.primary.text6,margin:"2px 4px","&:hover":{cursor:"pointer",backgroundColor:"rgba(255, 255, 255, 0.1)",color:e.palette.primary.contrastText}},root:{width:"100%",display:"flex",alignItems:"center"},label:{padding:0},mark:{marginRight:4,width:8,height:8,borderRadius:8},subject:{display:"flex",marginRight:4},closeIcon:{fontSize:"1rem",marginLeft:"4px"},closeArea:{position:"absolute",top:0,right:0,width:32,height:30},tooltip:{marginTop:"8px"},titleContainer:{display:"flex",alignItems:"center"}}}));module.exports=function(e){var
|
|
1
|
+
"use strict";var e=require("@babel/runtime/helpers/slicedToArray"),t=require("react"),i=require("@material-ui/core"),o=require("@material-ui/icons/Close"),r=require("../MiddleTruncate/MiddleTruncate.js"),l=require("../../utils/main.js"),a=require("./icons/SubjectIcon.js"),n=require("react/jsx-runtime");function s(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var c=s(e),u=s(o),d=i.makeStyles((function(e){return{chipRoot:{position:"relative",height:30,padding:"7px 12px",fontSize:12,color:e.palette.primary.text6,margin:"2px 4px","&:hover":{cursor:"pointer",backgroundColor:"rgba(255, 255, 255, 0.1)",color:e.palette.primary.contrastText}},root:{width:"100%",display:"flex",alignItems:"center"},label:{padding:0},mark:{marginRight:4,width:8,height:8,borderRadius:8},subject:{display:"flex",marginRight:4},closeIcon:{fontSize:"1rem",marginLeft:"4px"},closeArea:{position:"absolute",top:0,right:0,width:32,height:30},tooltip:{marginTop:"8px"},titleContainer:{display:"flex",alignItems:"center"}}}));module.exports=function(e){var o=e.title,s=e.onClick,p=void 0===s?null:s,m=e.markColor,h=void 0===m?null:m,x=e.isSubject,g=e.rigName,f=void 0===g?null:g,j=e.maxWidth,b=void 0===j?200:j,v=e.wellId,C=e.onRemoveOffsetWell,k=void 0===C?null:C,y=e.isShowMark,S=void 0===y||y,T=t.useState(null),q=c.default(T,2),N=q[0],R=q[1],w=d({isShowMark:S}),I=!!N,M=f?"".concat(o," | ").concat(f):o,W=h||"#".concat(l.default.getColorFromString(o)),z=n.jsxs("div",{className:w.root,children:[n.jsx(i.Tooltip,{title:I?M:null!=f?f:"",classes:{popper:w.tooltip},children:n.jsxs("div",{className:w.titleContainer,children:[x?n.jsx("span",{className:w.subject,children:n.jsx(a,{})}):n.jsx("span",{style:{backgroundColor:W,display:S?"block":"none"},className:w.mark}),n.jsx(r,{onTruncate:function(e){R(e)},truncatedText:N,maxWidth:b,children:o})]})}),!x&&!!k&&n.jsxs(n.Fragment,{children:[n.jsx(u.default,{className:w.closeIcon}),n.jsx(i.Tooltip,{title:"Remove",classes:{popper:w.tooltip},children:n.jsx("div",{className:w.closeArea,onClick:function(e){e.stopPropagation(),k&&k(v)}})})]})]});return n.jsx(i.Chip,{"data-not-migrated-MuiChip":!0,variant:"outlined",size:"medium",label:z,classes:{root:w.chipRoot,label:w.label},onClick:function(e){return p&&p(e,v)},"data-testid":"".concat(o,"_offsetWellChip")})};
|
|
2
2
|
//# sourceMappingURL=Chip.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Chip.js","sources":["../../../../src/components/OffsetWellChips/Chip.tsx"],"sourcesContent":["import { type MouseEvent, useState } from 'react';\nimport { Chip, Tooltip, makeStyles } from '@material-ui/core';\nimport
|
|
1
|
+
{"version":3,"file":"Chip.js","sources":["../../../../src/components/OffsetWellChips/Chip.tsx"],"sourcesContent":["import { type MouseEvent, useState } from 'react';\nimport { Chip, Tooltip, makeStyles } from '@material-ui/core';\nimport Close from '@material-ui/icons/Close';\nimport MiddleTruncate from '../MiddleTruncate';\nimport { ChipProps } from './types';\nimport utils from '~/utils/main';\nimport SubjectIcon from './icons/SubjectIcon';\n\nconst useStyles = makeStyles(theme => ({\n chipRoot: {\n position: 'relative',\n height: 30,\n padding: '7px 12px',\n fontSize: 12,\n color: theme.palette.primary.text6,\n margin: '2px 4px',\n '&:hover': {\n cursor: 'pointer',\n backgroundColor: 'rgba(255, 255, 255, 0.1)',\n color: theme.palette.primary.contrastText,\n },\n },\n root: {\n width: '100%',\n display: 'flex',\n alignItems: 'center',\n },\n label: {\n padding: 0,\n },\n mark: {\n marginRight: 4,\n width: 8,\n height: 8,\n borderRadius: 8,\n },\n subject: {\n display: 'flex',\n marginRight: 4,\n },\n closeIcon: {\n fontSize: '1rem',\n marginLeft: '4px',\n },\n closeArea: {\n position: 'absolute',\n top: 0,\n right: 0,\n width: 32,\n height: 30,\n },\n tooltip: {\n marginTop: '8px',\n },\n titleContainer: {\n display: 'flex',\n alignItems: 'center',\n },\n}));\n\nconst OffsetWellChip = <T extends unknown>({\n title,\n onClick = null,\n markColor = null,\n isSubject,\n rigName = null,\n maxWidth = 200,\n wellId,\n onRemoveOffsetWell = null,\n isShowMark = true,\n}: ChipProps<T>): JSX.Element => {\n const [truncatedText, setTruncatedText] = useState<string | null>(null);\n\n const styles = useStyles({\n isShowMark,\n });\n const isTruncated = !!truncatedText;\n const fullTooltip = rigName ? `${title} | ${rigName}` : title;\n\n const handleTruncatedText = (truncatedText: string) => {\n setTruncatedText(truncatedText);\n };\n\n const handleRemoveWell = (e: MouseEvent) => {\n e.stopPropagation();\n if (onRemoveOffsetWell) onRemoveOffsetWell(wellId);\n };\n\n const markBackgroundColor = markColor || `#${utils.getColorFromString(title)}`;\n\n const label = (\n <div className={styles.root}>\n <Tooltip\n title={isTruncated ? fullTooltip : rigName ?? ''}\n classes={{ popper: styles.tooltip }}\n >\n <div className={styles.titleContainer}>\n {isSubject ? (\n <span className={styles.subject}>\n <SubjectIcon />\n </span>\n ) : (\n <span\n style={{\n backgroundColor: markBackgroundColor,\n display: isShowMark ? 'block' : 'none',\n }}\n className={styles.mark}\n />\n )}\n <MiddleTruncate\n onTruncate={handleTruncatedText}\n truncatedText={truncatedText}\n maxWidth={maxWidth}\n >\n {title}\n </MiddleTruncate>\n </div>\n </Tooltip>\n {!isSubject && !!onRemoveOffsetWell && (\n <>\n <Close className={styles.closeIcon} />\n <Tooltip title=\"Remove\" classes={{ popper: styles.tooltip }}>\n <div className={styles.closeArea} onClick={handleRemoveWell}></div>\n </Tooltip>\n </>\n )}\n </div>\n );\n\n return (\n <Chip\n data-not-migrated-MuiChip\n variant=\"outlined\"\n size=\"medium\"\n label={label}\n classes={{ root: styles.chipRoot, label: styles.label }}\n onClick={e => onClick && onClick(e, wellId)}\n data-testid={`${title}_offsetWellChip`}\n />\n );\n};\n\nexport default OffsetWellChip;\n"],"names":["useStyles","makeStyles","theme","chipRoot","position","height","padding","fontSize","color","palette","primary","text6","margin","cursor","backgroundColor","contrastText","root","width","display","alignItems","label","mark","marginRight","borderRadius","subject","closeIcon","marginLeft","closeArea","top","right","tooltip","marginTop","titleContainer","_ref","title","_ref$onClick","onClick","_ref$markColor","markColor","isSubject","_ref$rigName","rigName","_ref$maxWidth","maxWidth","wellId","_ref$onRemoveOffsetWe","onRemoveOffsetWell","_ref$isShowMark","isShowMark","useState","_useState2","_slicedToArray","_useState","truncatedText","setTruncatedText","styles","isTruncated","fullTooltip","concat","markBackgroundColor","utils","getColorFromString","_jsxs","jsxs","className","children","_jsx","Tooltip","classes","popper","jsx","SubjectIcon","style","MiddleTruncate","onTruncate","_Fragment","Close","e","stopPropagation","Chip","variant","size"],"mappings":"0YAQMA,EAAYC,EAAAA,YAAW,SAAAC,GAAK,MAAK,CACrCC,SAAU,CACRC,SAAU,WACVC,OAAQ,GACRC,QAAS,WACTC,SAAU,GACVC,MAAON,EAAMO,QAAQC,QAAQC,MAC7BC,OAAQ,UACR,UAAW,CACTC,OAAQ,UACRC,gBAAiB,2BACjBN,MAAON,EAAMO,QAAQC,QAAQK,eAGjCC,KAAM,CACJC,MAAO,OACPC,QAAS,OACTC,WAAY,UAEdC,MAAO,CACLd,QAAS,GAEXe,KAAM,CACJC,YAAa,EACbL,MAAO,EACPZ,OAAQ,EACRkB,aAAc,GAEhBC,QAAS,CACPN,QAAS,OACTI,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ElCgB,UAAWT,EAAOlC,OAGtB6C,MAACO,EAAc,CACbC,WAhCkB,SAACrB,GAC3BC,EAAiBD,IAgCTA,cAAeA,EACfV,SAAUA,EAASsB,SAElB/B,UAILK,KAAeO,GACfgB,EAAAA,KAAAa,EAAAA,SAAA,CAAAV,SAAA,CACEC,MAACU,UAAK,CAACZ,UAAWT,EAAO9B,YACzByC,MAACC,UAAO,CAACjC,MAAM,SAASkC,QAAS,CAAEC,OAAQd,EAAOzB,SAAUmC,SAC1DC,EAAAI,IAAA,MAAA,CAAKN,UAAWT,EAAO5B,UAAWS,QAxCnB,SAACyC,GACxBA,EAAEC,kBACEhC,GAAoBA,EAAmBF,cA6C7C,OACEsB,EAAAA,IAACa,EAAAA,KAAI,CACH,6BAAyB,EACzBC,QAAQ,WACRC,KAAK,SACL7D,MAAOA,EACPgD,QAAS,CAAEpD,KAAMuC,EAAOpD,SAAUiB,MAAOmC,EAAOnC,OAChDgB,QAAS,SAAAyC,GAAC,OAAIzC,GAAWA,EAAQyC,EAAGjC,EAAQ,EAC5C,cAAA,GAAAc,OAAgBxB,EAAK,oBAG3B"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var e=require("@babel/runtime/helpers/defineProperty"),r=require("@babel/runtime/helpers/slicedToArray"),t=require("react"),l=require("lodash"),i=require("classnames"),s=require("@material-ui/core"),u=require("@material-ui/icons");require("mapbox-gl/dist/mapbox-gl.css");var o=require("./effects/usePreviousWells.js"),n=require("./WellTooltip.js"),c=require("./utils.js"),a=require("./OffsetWellMap.module.css.js");require("../../config/mapboxGl/index.js");var d=require("../../config/mapbox/index.js");require("../UserMention/utils/index.js"),require("../../utils/convert.js"),require("../../constants/completion.js"),require("moment"),require("../../constants/alerts.js"),require("@babel/runtime/helpers/asyncToGenerator"),require("@babel/runtime/regenerator"),require("../../utils/casing/validation.js"),require("lodash/mean"),require("../../constants/streamSourceType.js"),require("lodash/get"),require("file-saver"),require("query-string"),require("../../constants/goals.js"),require("../../constants/segment.js"),require("../../constants/apps.js"),require("../../constants/drillstring.js"),require("../../constants/appPackages.js"),require("../../constants/notifications.js"),require("../../constants/feed.js"),require("../../constants/bha.js"),require("../../constants/corvaCompanyId.js"),require("../GradientManager/configuration/constants.js"),require("../../utils/drillstring/conversion.js"),require("lodash/set"),require("lodash/cloneDeep"),require("@babel/runtime/helpers/toConsumableArray"),require("lodash/isNumber"),require("lodash/has"),require("../../utils/ga.js"),require("../../utils/goalsConfig/goalsConfig.js"),require("../../utils/lasParser.js"),require("../../utils/main.js");var f=require("../../utils/mapbox.js");require("../../utils/metrics/metricsConfig.js"),require("../../utils/mobileDetect.js"),require("../../utils/feed.js"),require("../../utils/reports.js"),require("moment-timezone"),require("@babel/runtime/helpers/typeof"),require("../../utils/dashboardReports.js"),require("../../utils/env.js"),require("file-extension"),require("image-extensions"),require("video-extensions"),require("../../utils/jsonaDataFormatter.js"),require("../../utils/bha.js"),require("jsona"),require("../../clients/jsonApi/index.js"),require("@babel/runtime/helpers/objectWithoutProperties"),require("../../utils/charts/Styles.scss.js"),require("../../utils/getSingleAsset.js");var v=require("../../utils/createAdaptiveRoot.js"),m=require("react/jsx-runtime"),h=require("mapbox-gl");function g(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var p=g(e),q=g(r),j=g(i),y=g(h),b=[29.749907,-95.358421],w={type:"FeatureCollection",features:[]},x=["==",["id"],-1],W=function(e){var r=q.default(e,2),t=r[0];return[r[1],t]},C=function(e,r){for(var t=q.default(e,2),l=t[0],i=t[1],s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:64,u=r/(111320*Math.cos(l*Math.PI/180)),o=r/110574,n=[],c=0;c<=s;c+=1){var a=c/s*2*Math.PI;n.push([i+u*Math.cos(a),l+o*Math.sin(a)])}return{type:"Polygon",coordinates:[n]}};module.exports=function(e){var r=e.isViewOnly,i=e.subjectWell,h=void 0===i?null:i,g=e.wells,F=e.offsetWellIds,M=e.radius,S=e.handleChanageOffsetWell,D=e.handleChangeOffsetWell,B=void 0===D?S:D,E=e.activeWellId,L=e.isClickable,O=void 0===L||L,P=e.classes,R=void 0===P?{}:P,k=t.useMemo((function(){return h&&l.get(h,"topHole.coordinates")}),[h]),A=t.useMemo((function(){return c.getAllFormations(g)}),[g]),T=t.useRef(),I=t.useRef(),z=t.useRef(),N=t.useRef(null),Z=t.useRef(null),G=t.useRef(),V=t.useRef(new Map),H=t.useRef(null),_=t.useRef(null),U=t.useRef(null),X=t.useState(!1),J=q.default(X,2),K=J[0],Q=J[1],Y=(null==h?void 0:h.id)===E,$=o.usePreviousWells(g),ee=t.useState(!1),re=q.default(ee,2),te=re[0],le=re[1],ie=t.useState(3),se=q.default(ie,2),ue=se[0],oe=se[1];t.useEffect((function(){if(d.IS_MAPBOX_ENABLED){var e=new y.default.Map({container:T.current,style:"mapbox://styles/mapbox/dark-v9",center:W(b),zoom:3,maxZoom:18,attributionControl:!1,scrollZoom:!1,doubleClickZoom:!1});return I.current=e,e.on("zoomend",(function(){return oe(Math.round(e.getZoom()))})),e.on("load",(function(){e.addSource("radius-circle",{type:"geojson",data:w}),e.addLayer({id:"radius-circle-fill",type:"fill",source:"radius-circle",paint:{"fill-color":"#03BCD4","fill-opacity":.2}}),e.addSource("wells",{type:"geojson",data:w}),e.addLayer({id:"wells-halo",type:"circle",source:"wells",filter:["==",["get","isOffsetWell"],!0],paint:{"circle-radius":12,"circle-color":["get","color"],"circle-opacity":.08}}),e.addLayer({id:"wells-circle",type:"circle",source:"wells",layout:{"circle-sort-key":["get","order"]},paint:{"circle-radius":5,"circle-color":["get","color"],"circle-opacity":["get","opacity"]}}),e.addLayer({id:"wells-active-highlight",type:"circle",source:"wells",filter:["==",["get","isActive"],!0],paint:{"circle-radius":12,"circle-color":["get","color"],"circle-opacity":.24}}),e.addLayer({id:"wells-hover-highlight",type:"circle",source:"wells",filter:x,paint:{"circle-radius":["case",["get","isSubjectWell"],5,12],"circle-color":["case",["get","isSubjectWell"],"#63EFFF",["get","color"]],"circle-opacity":.24}}),le(!0)})),function(){var r;null===(r=U.current)||void 0===r||r.unmount(),U.current=null,e.remove(),I.current=null,z.current=null,G.current=null,N.current=null,Z.current=null}}}),[]),t.useEffect((function(){var e,r,t,l,i,s,u;N.current=k&&M?(e=k,r=1609.34*M,t=q.default(e,2),l=t[0],i=t[1],s=r/(111320*Math.cos(l*Math.PI/180)),[[i-s,l-(u=r/110574)],[i+s,l+u]]):null;var o=I.current;o&&te&&o.getSource("radius-circle").setData(k&&M?{type:"Feature",properties:{},geometry:C(k,1609.34*M)}:w)}),[M,k,te]);var ne=function(e,i,s,u){var o;null===(o=U.current)||void 0===o||o.unmount();var c=document.createElement("div"),a=t.createElement(n.WellTooltip(),{isViewOnly:r,well:e,color:l.get(A,e.formation,"#BDBDBD"),isOffsetWell:i,isSubjectWell:s,isClickable:O});U.current=v.createAdaptiveRoot(c),U.current.render(m.jsx(m.Fragment,{children:a})),z.current||(z.current=new y.default.Popup({closeButton:!1,offset:12})),z.current.setLngLat(W(u)).setDOMContent(c).addTo(I.current)};t.useEffect((function(){var e=I.current;e&&te&&e.setPaintProperty("wells-circle","circle-color",K?["case",["get","isSubjectWell"],"#63EFFF",["get","color"]]:["get","color"])}),[K,te]),t.useEffect((function(){var e;if(g&&F){null===(e=z.current)||void 0===e||e.remove();var t=[],i=[];g.forEach((function(e){e.id!==(null==h?void 0:h.id)&&(F.includes(e.id)?t.push(e):i.push(e))}));var s=[].concat(i,t,[h]),u=[],o=new y.default.LngLatBounds;V.current.clear(),H.current=null,s.forEach((function(e,r){var t,i=null==e||null===(t=e.topHole)||void 0===t?void 0:t.coordinates;if(i&&f.isValidCoordinates(i)){var s=(null==h?void 0:h.id)===e.id,n=F.includes(e.id)&&!s,c=s?"#03BCD4":l.get(A,e.formation,"#BDBDBD"),a=n?.7:.3;u.push({type:"Feature",id:r,geometry:{type:"Point",coordinates:W(i)},properties:{color:c,opacity:s?1:a,isSubjectWell:s,isOffsetWell:n,isActive:e.id===E&&!Y,order:r}}),V.current.set(r,{well:e,coords:i,isOffsetWell:n,isSubjectWell:s}),s&&(H.current=r),o.extend(W(i))}})),Z.current=u.length?o:null;var n=I.current;if(n&&te){n.getSource("wells").setData({type:"FeatureCollection",features:u}),n.setFilter("wells-hover-highlight",x),_.current=null;var c=function(e){var r,t=null===(r=e.features)||void 0===r?void 0:r[0];if(t&&_.current!==t.id){var l=V.current.get(t.id);l&&(_.current=t.id,n.getCanvas().style.cursor="pointer",n.setFilter("wells-hover-highlight",["==",["id"],t.id]),ne(l.well,l.isOffsetWell,l.isSubjectWell,l.coords),l.isSubjectWell&&Q(!0))}},a=function(e){var r;if(null==e||!e.point||!n.queryRenderedFeatures(e.point,{layers:["wells-circle","wells-hover-highlight"]}).length){var t=null!==_.current&&_.current===H.current;_.current=null,n.getCanvas().style.cursor="",n.setFilter("wells-hover-highlight",x),null===(r=z.current)||void 0===r||r.remove(),t&&Q(!1)}},d=function(e){var t,l;if(!r){var i=V.current.get(null===(t=e.features)||void 0===t||null===(l=t[0])||void 0===l?void 0:l.id);i&&B(i.well,!i.isOffsetWell)}};return n.on("mousemove","wells-circle",c),n.on("mouseleave","wells-circle",a),n.on("mouseleave","wells-hover-highlight",a),n.on("click","wells-circle",d),setTimeout((function(){M<3e3&&I.current&&N.current&&g!==$&&I.current.fitBounds(N.current,{padding:5})}),500),function(){n.off("mousemove","wells-circle",c),n.off("mouseleave","wells-circle",a),n.off("mouseleave","wells-hover-highlight",a),n.off("click","wells-circle",d)}}}}),[h,g,F,E,te]),t.useEffect((function(){var e=I.current;if(G.current&&(G.current.remove(),G.current=null),e&&k){var r=K||Y,t=document.createElement("img");t.src=r?"/static/media/5e9c4959259cb12c11b2c5eaf27eb3ad.svg":"/static/media/9efe5882f31d2f22bd57af92069d0a3e.svg";var l=r?[70,20]:[62,12],i=q.default(l,2),s=i[0],u=i[1],o=r?[35,29]:[31,25],n=q.default(o,2),c=n[0],a=n[1];t.width=s,t.height=u,t.addEventListener("mouseover",(function(){Q(!0),null!==H.current&&e.getLayer("wells-hover-highlight")&&(_.current=H.current,e.setFilter("wells-hover-highlight",["==",["id"],H.current])),ne(h,!1,!0,k)})),t.addEventListener("mouseout",(function(){var r;_.current=null,e.getLayer("wells-hover-highlight")&&e.setFilter("wells-hover-highlight",x),null===(r=z.current)||void 0===r||r.remove(),Q(!1)})),G.current=new y.default.Marker({element:t,anchor:"center",offset:[s/2-c,u/2-a]}).setLngLat(W(k)).addTo(e)}}),[K,k,M,h,Y]),t.useEffect((function(){var e;M>3e3?null===(e=I.current)||void 0===e||e.setZoom(1):setTimeout((function(){h?I.current&&N.current&&M&&I.current.fitBounds(N.current,{padding:5}):I.current&&Z.current&&I.current.fitBounds(Z.current),k&&I.current&&I.current.easeTo({center:W(k),duration:700})}),500)}),[M,h,k]);var ce=function(){var e;null===(e=I.current)||void 0===e||e.setZoom(ue+1)};return m.jsx("div",{className:j.default(a.mapView,R.root),children:m.jsx("div",{className:j.default(a.mapMain,R.map),ref:T,onDoubleClick:ce,children:m.jsxs("div",{className:a.zoomGroup,children:[m.jsx(s.Tooltip,{title:ue<18?"Zoom in":"",placement:"left",children:m.jsx("div",{className:j.default(a.zoomButton,p.default({},a.zoomDisabled,18===ue)),onClick:ce,children:m.jsx(u.Add,{className:a.zoomInOutIcon})})}),m.jsx(s.Tooltip,{title:ue>1?"Zoom out":"",placement:"left",children:m.jsx("div",{className:j.default(a.zoomButton,p.default({},a.zoomDisabled,1===ue)),onClick:function(){var e;ue>1&&(null===(e=I.current)||void 0===e||e.setZoom(ue-1))},children:m.jsx(u.Remove,{className:a.zoomInOutIcon})})})]})})})};
|
|
1
|
+
"use strict";var e=require("@babel/runtime/helpers/defineProperty"),r=require("@babel/runtime/helpers/slicedToArray"),t=require("react"),l=require("lodash"),i=require("classnames"),u=require("@material-ui/core"),s=require("@material-ui/icons/Add"),o=require("@material-ui/icons/Remove");require("mapbox-gl/dist/mapbox-gl.css");var n=require("./effects/usePreviousWells.js"),c=require("./WellTooltip.js"),a=require("./utils.js"),d=require("./OffsetWellMap.module.css.js");require("../../config/mapboxGl/index.js");var f=require("../../config/mapbox/index.js");require("../UserMention/utils/index.js"),require("../../utils/convert.js"),require("../../constants/completion.js"),require("moment"),require("../../constants/alerts.js"),require("@babel/runtime/helpers/asyncToGenerator"),require("@babel/runtime/regenerator"),require("../../utils/casing/validation.js"),require("lodash/mean"),require("../../constants/streamSourceType.js"),require("lodash/get"),require("file-saver"),require("query-string"),require("../../constants/goals.js"),require("../../constants/segment.js"),require("../../constants/apps.js"),require("../../constants/drillstring.js"),require("../../constants/appPackages.js"),require("../../constants/notifications.js"),require("../../constants/feed.js"),require("../../constants/bha.js"),require("../../constants/corvaCompanyId.js"),require("../GradientManager/configuration/constants.js"),require("../../utils/drillstring/conversion.js"),require("lodash/set"),require("lodash/cloneDeep"),require("@babel/runtime/helpers/toConsumableArray"),require("lodash/isNumber"),require("lodash/has"),require("../../utils/ga.js"),require("../../utils/goalsConfig/goalsConfig.js"),require("../../utils/lasParser.js"),require("../../utils/main.js");var v=require("../../utils/mapbox.js");require("../../utils/metrics/metricsConfig.js"),require("../../utils/mobileDetect.js"),require("../../utils/feed.js"),require("../../utils/reports.js"),require("moment-timezone"),require("@babel/runtime/helpers/typeof"),require("../../utils/dashboardReports.js"),require("../../utils/env.js"),require("file-extension"),require("image-extensions"),require("video-extensions"),require("../../utils/jsonaDataFormatter.js"),require("../../utils/bha.js"),require("jsona"),require("../../clients/jsonApi/index.js"),require("@babel/runtime/helpers/objectWithoutProperties"),require("../../utils/charts/Styles.scss.js"),require("../../utils/getSingleAsset.js");var m=require("../../utils/createAdaptiveRoot.js"),h=require("react/jsx-runtime"),g=require("mapbox-gl");function p(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var q=p(e),j=p(r),y=p(i),b=p(s),w=p(o),x=p(g),W=[29.749907,-95.358421],C={type:"FeatureCollection",features:[]},F=["==",["id"],-1],M=function(e){var r=j.default(e,2),t=r[0];return[r[1],t]},S=function(e,r){for(var t=j.default(e,2),l=t[0],i=t[1],u=arguments.length>2&&void 0!==arguments[2]?arguments[2]:64,s=r/(111320*Math.cos(l*Math.PI/180)),o=r/110574,n=[],c=0;c<=u;c+=1){var a=c/u*2*Math.PI;n.push([i+s*Math.cos(a),l+o*Math.sin(a)])}return{type:"Polygon",coordinates:[n]}};module.exports=function(e){var r=e.isViewOnly,i=e.subjectWell,s=void 0===i?null:i,o=e.wells,g=e.offsetWellIds,p=e.radius,D=e.handleChanageOffsetWell,B=e.handleChangeOffsetWell,E=void 0===B?D:B,L=e.activeWellId,O=e.isClickable,P=void 0===O||O,R=e.classes,k=void 0===R?{}:R,A=t.useMemo((function(){return s&&l.get(s,"topHole.coordinates")}),[s]),T=t.useMemo((function(){return a.getAllFormations(o)}),[o]),I=t.useRef(),z=t.useRef(),N=t.useRef(),Z=t.useRef(null),G=t.useRef(null),V=t.useRef(),H=t.useRef(new Map),_=t.useRef(null),U=t.useRef(null),X=t.useRef(null),J=t.useState(!1),K=j.default(J,2),Q=K[0],Y=K[1],$=(null==s?void 0:s.id)===L,ee=n.usePreviousWells(o),re=t.useState(!1),te=j.default(re,2),le=te[0],ie=te[1],ue=t.useState(3),se=j.default(ue,2),oe=se[0],ne=se[1];t.useEffect((function(){if(f.IS_MAPBOX_ENABLED){var e=new x.default.Map({container:I.current,style:"mapbox://styles/mapbox/dark-v9",center:M(W),zoom:3,maxZoom:18,attributionControl:!1,scrollZoom:!1,doubleClickZoom:!1});return z.current=e,e.on("zoomend",(function(){return ne(Math.round(e.getZoom()))})),e.on("load",(function(){e.addSource("radius-circle",{type:"geojson",data:C}),e.addLayer({id:"radius-circle-fill",type:"fill",source:"radius-circle",paint:{"fill-color":"#03BCD4","fill-opacity":.2}}),e.addSource("wells",{type:"geojson",data:C}),e.addLayer({id:"wells-halo",type:"circle",source:"wells",filter:["==",["get","isOffsetWell"],!0],paint:{"circle-radius":12,"circle-color":["get","color"],"circle-opacity":.08}}),e.addLayer({id:"wells-circle",type:"circle",source:"wells",layout:{"circle-sort-key":["get","order"]},paint:{"circle-radius":5,"circle-color":["get","color"],"circle-opacity":["get","opacity"]}}),e.addLayer({id:"wells-active-highlight",type:"circle",source:"wells",filter:["==",["get","isActive"],!0],paint:{"circle-radius":12,"circle-color":["get","color"],"circle-opacity":.24}}),e.addLayer({id:"wells-hover-highlight",type:"circle",source:"wells",filter:F,paint:{"circle-radius":["case",["get","isSubjectWell"],5,12],"circle-color":["case",["get","isSubjectWell"],"#63EFFF",["get","color"]],"circle-opacity":.24}}),ie(!0)})),function(){var r;null===(r=X.current)||void 0===r||r.unmount(),X.current=null,e.remove(),z.current=null,N.current=null,V.current=null,Z.current=null,G.current=null}}}),[]),t.useEffect((function(){var e,r,t,l,i,u,s;Z.current=A&&p?(e=A,r=1609.34*p,t=j.default(e,2),l=t[0],i=t[1],u=r/(111320*Math.cos(l*Math.PI/180)),[[i-u,l-(s=r/110574)],[i+u,l+s]]):null;var o=z.current;o&&le&&o.getSource("radius-circle").setData(A&&p?{type:"Feature",properties:{},geometry:S(A,1609.34*p)}:C)}),[p,A,le]);var ce=function(e,i,u,s){var o;null===(o=X.current)||void 0===o||o.unmount();var n=document.createElement("div"),a=t.createElement(c.WellTooltip(),{isViewOnly:r,well:e,color:l.get(T,e.formation,"#BDBDBD"),isOffsetWell:i,isSubjectWell:u,isClickable:P});X.current=m.createAdaptiveRoot(n),X.current.render(h.jsx(h.Fragment,{children:a})),N.current||(N.current=new x.default.Popup({closeButton:!1,offset:12})),N.current.setLngLat(M(s)).setDOMContent(n).addTo(z.current)};t.useEffect((function(){var e=z.current;e&&le&&e.setPaintProperty("wells-circle","circle-color",Q?["case",["get","isSubjectWell"],"#63EFFF",["get","color"]]:["get","color"])}),[Q,le]),t.useEffect((function(){var e;if(o&&g){null===(e=N.current)||void 0===e||e.remove();var t=[],i=[];o.forEach((function(e){e.id!==(null==s?void 0:s.id)&&(g.includes(e.id)?t.push(e):i.push(e))}));var u=[].concat(i,t,[s]),n=[],c=new x.default.LngLatBounds;H.current.clear(),_.current=null,u.forEach((function(e,r){var t,i=null==e||null===(t=e.topHole)||void 0===t?void 0:t.coordinates;if(i&&v.isValidCoordinates(i)){var u=(null==s?void 0:s.id)===e.id,o=g.includes(e.id)&&!u,a=u?"#03BCD4":l.get(T,e.formation,"#BDBDBD"),d=o?.7:.3;n.push({type:"Feature",id:r,geometry:{type:"Point",coordinates:M(i)},properties:{color:a,opacity:u?1:d,isSubjectWell:u,isOffsetWell:o,isActive:e.id===L&&!$,order:r}}),H.current.set(r,{well:e,coords:i,isOffsetWell:o,isSubjectWell:u}),u&&(_.current=r),c.extend(M(i))}})),G.current=n.length?c:null;var a=z.current;if(a&&le){a.getSource("wells").setData({type:"FeatureCollection",features:n}),a.setFilter("wells-hover-highlight",F),U.current=null;var d=function(e){var r,t=null===(r=e.features)||void 0===r?void 0:r[0];if(t&&U.current!==t.id){var l=H.current.get(t.id);l&&(U.current=t.id,a.getCanvas().style.cursor="pointer",a.setFilter("wells-hover-highlight",["==",["id"],t.id]),ce(l.well,l.isOffsetWell,l.isSubjectWell,l.coords),l.isSubjectWell&&Y(!0))}},f=function(e){var r;if(null==e||!e.point||!a.queryRenderedFeatures(e.point,{layers:["wells-circle","wells-hover-highlight"]}).length){var t=null!==U.current&&U.current===_.current;U.current=null,a.getCanvas().style.cursor="",a.setFilter("wells-hover-highlight",F),null===(r=N.current)||void 0===r||r.remove(),t&&Y(!1)}},m=function(e){var t,l;if(!r){var i=H.current.get(null===(t=e.features)||void 0===t||null===(l=t[0])||void 0===l?void 0:l.id);i&&E(i.well,!i.isOffsetWell)}};return a.on("mousemove","wells-circle",d),a.on("mouseleave","wells-circle",f),a.on("mouseleave","wells-hover-highlight",f),a.on("click","wells-circle",m),setTimeout((function(){p<3e3&&z.current&&Z.current&&o!==ee&&z.current.fitBounds(Z.current,{padding:5})}),500),function(){a.off("mousemove","wells-circle",d),a.off("mouseleave","wells-circle",f),a.off("mouseleave","wells-hover-highlight",f),a.off("click","wells-circle",m)}}}}),[s,o,g,L,le]),t.useEffect((function(){var e=z.current;if(V.current&&(V.current.remove(),V.current=null),e&&A){var r=Q||$,t=document.createElement("img");t.src=r?"/static/media/5e9c4959259cb12c11b2c5eaf27eb3ad.svg":"/static/media/9efe5882f31d2f22bd57af92069d0a3e.svg";var l=r?[70,20]:[62,12],i=j.default(l,2),u=i[0],o=i[1],n=r?[35,29]:[31,25],c=j.default(n,2),a=c[0],d=c[1];t.width=u,t.height=o,t.addEventListener("mouseover",(function(){Y(!0),null!==_.current&&e.getLayer("wells-hover-highlight")&&(U.current=_.current,e.setFilter("wells-hover-highlight",["==",["id"],_.current])),ce(s,!1,!0,A)})),t.addEventListener("mouseout",(function(){var r;U.current=null,e.getLayer("wells-hover-highlight")&&e.setFilter("wells-hover-highlight",F),null===(r=N.current)||void 0===r||r.remove(),Y(!1)})),V.current=new x.default.Marker({element:t,anchor:"center",offset:[u/2-a,o/2-d]}).setLngLat(M(A)).addTo(e)}}),[Q,A,p,s,$]),t.useEffect((function(){var e;p>3e3?null===(e=z.current)||void 0===e||e.setZoom(1):setTimeout((function(){s?z.current&&Z.current&&p&&z.current.fitBounds(Z.current,{padding:5}):z.current&&G.current&&z.current.fitBounds(G.current),A&&z.current&&z.current.easeTo({center:M(A),duration:700})}),500)}),[p,s,A]);var ae=function(){var e;null===(e=z.current)||void 0===e||e.setZoom(oe+1)};return h.jsx("div",{className:y.default(d.mapView,k.root),children:h.jsx("div",{className:y.default(d.mapMain,k.map),ref:I,onDoubleClick:ae,children:h.jsxs("div",{className:d.zoomGroup,children:[h.jsx(u.Tooltip,{title:oe<18?"Zoom in":"",placement:"left",children:h.jsx("div",{className:y.default(d.zoomButton,q.default({},d.zoomDisabled,18===oe)),onClick:ae,children:h.jsx(b.default,{className:d.zoomInOutIcon})})}),h.jsx(u.Tooltip,{title:oe>1?"Zoom out":"",placement:"left",children:h.jsx("div",{className:y.default(d.zoomButton,q.default({},d.zoomDisabled,1===oe)),onClick:function(){var e;oe>1&&(null===(e=z.current)||void 0===e||e.setZoom(oe-1))},children:h.jsx(w.default,{className:d.zoomInOutIcon})})})]})})})};
|
|
2
2
|
//# sourceMappingURL=OffsetWellMap.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OffsetWellMap.js","sources":["../../../../src/components/OffsetWellMap/OffsetWellMap.js"],"sourcesContent":["import { createElement, useRef, useEffect, useState, useMemo } from 'react';\nimport { get } from 'lodash';\nimport classNames from 'classnames';\nimport { Tooltip } from '@material-ui/core';\nimport { Add as ZoomInIcon, Remove as ZoomOutIcon } from '@material-ui/icons';\nimport 'mapbox-gl/dist/mapbox-gl.css';\n\nimport SubjectWellIcon from './CustomIcon/SubjectWellIcon.svg';\nimport SubjectHighlightWellIcon from './CustomIcon/SubjectHighlightWellIcon.svg';\nimport { usePreviousWells } from './effects';\nimport { WellTooltip } from './WellTooltip';\nimport { getAllFormations } from './utils';\n\nimport styles from './OffsetWellMap.module.css';\n\nimport mapboxgl from '~/config/mapboxGl';\nimport { IS_MAPBOX_ENABLED } from '~/config/mapbox';\nimport { mapbox } from '~/utils';\nimport { createAdaptiveRoot } from '~/utils/createAdaptiveRoot';\n\nconst DEFAULT_COORDS = [29.749907, -95.358421];\nconst WELL_MARKER_SIZE = 5;\nconst HIGHLIGHT_MARKER_SIZE = 12;\nconst OFFSET_WELL_COLOR = '#03BCD4';\nconst RADIUS_CIRCLE_COLOR = '#03BCD4';\nconst HIGHLIGHT_WELL_COLOR = '#63EFFF';\nconst METERS_IN_MILE = 1609.34;\nconst ZOOM_INIT_VALUE = 3;\nconst ZOOM_MAX_VALUE = 18;\nconst ZOOM_MIN_VALUE = 1;\nconst MAX_RADIUS = 3000;\n\nconst RADIUS_SOURCE_ID = 'radius-circle';\nconst RADIUS_LAYER_ID = 'radius-circle-fill';\nconst WELLS_SOURCE_ID = 'wells';\nconst WELLS_HALO_LAYER_ID = 'wells-halo';\nconst WELLS_LAYER_ID = 'wells-circle';\nconst WELLS_ACTIVE_LAYER_ID = 'wells-active-highlight';\nconst WELLS_HOVER_LAYER_ID = 'wells-hover-highlight';\nconst EMPTY_FEATURE_COLLECTION = { type: 'FeatureCollection', features: [] };\nconst NO_HOVER_FILTER = ['==', ['id'], -1];\n\n// NOTE: Props keep the Leaflet [lat, lng] convention; mapbox-gl expects [lng, lat]\nconst toLngLat = ([lat, lng]) => [lng, lat];\n\n// NOTE: mapbox-gl circle layers are pixel-radius, so approximate the meter radius with a polygon\nconst makeCirclePolygon = ([lat, lng], radiusMeters, points = 64) => {\n const degreesLng = radiusMeters / (111320 * Math.cos((lat * Math.PI) / 180));\n const degreesLat = radiusMeters / 110574;\n const ring = [];\n for (let i = 0; i <= points; i += 1) {\n const theta = (i / points) * 2 * Math.PI;\n ring.push([lng + degreesLng * Math.cos(theta), lat + degreesLat * Math.sin(theta)]);\n }\n return { type: 'Polygon', coordinates: [ring] };\n};\n\nconst getCircleBounds = ([lat, lng], radiusMeters) => {\n const degreesLng = radiusMeters / (111320 * Math.cos((lat * Math.PI) / 180));\n const degreesLat = radiusMeters / 110574;\n return [\n [lng - degreesLng, lat - degreesLat],\n [lng + degreesLng, lat + degreesLat],\n ];\n};\n\n/** @type {React.FC<import('./OffsetWellMapProps').OffsetWellMapProps>} */\nconst OffsetWellMap = ({\n isViewOnly,\n subjectWell = null,\n wells,\n offsetWellIds,\n radius,\n handleChanageOffsetWell,\n handleChangeOffsetWell = handleChanageOffsetWell,\n activeWellId,\n isClickable = true,\n classes = {},\n}) => {\n const subjectWellCoords = useMemo(() => {\n return subjectWell && get(subjectWell, 'topHole.coordinates');\n }, [subjectWell]);\n const formationColors = useMemo(() => getAllFormations(wells), [wells]);\n\n const containerRef = useRef();\n const mapRef = useRef();\n const popupRef = useRef();\n const radiusBoundsRef = useRef(null);\n const wellsBoundsRef = useRef(null);\n const subjectIconRef = useRef();\n const wellByFeatureIdRef = useRef(new Map());\n const subjectFeatureIdRef = useRef(null);\n const hoveredFeatureIdRef = useRef(null);\n const tooltipRootRef = useRef(null);\n const [isSubjectWellHovered, setIsSubjectWellHovered] = useState(false);\n const isActiveWellIsSubjectWell = subjectWell?.id === activeWellId;\n const prevWells = usePreviousWells(wells);\n const [isMapReady, setIsMapReady] = useState(false);\n const [zoom, setZoom] = useState(ZOOM_INIT_VALUE);\n\n // NOTE: Initialize map\n useEffect(() => {\n if (!IS_MAPBOX_ENABLED) return undefined;\n\n const map = new mapboxgl.Map({\n container: containerRef.current,\n style: 'mapbox://styles/mapbox/dark-v9',\n center: toLngLat(DEFAULT_COORDS),\n zoom: ZOOM_INIT_VALUE,\n // NOTE: keep the zoom buttons' disable logic (zoom === ZOOM_MAX_VALUE) reachable\n maxZoom: ZOOM_MAX_VALUE,\n attributionControl: false,\n scrollZoom: false,\n doubleClickZoom: false,\n });\n mapRef.current = map;\n\n // NOTE: GL zoom is fractional where Leaflet was integer\n map.on('zoomend', () => setZoom(Math.round(map.getZoom())));\n\n // NOTE: Sources/layers can only be added after the style loads\n map.on('load', () => {\n map.addSource(RADIUS_SOURCE_ID, { type: 'geojson', data: EMPTY_FEATURE_COLLECTION });\n map.addLayer({\n id: RADIUS_LAYER_ID,\n type: 'fill',\n source: RADIUS_SOURCE_ID,\n paint: {\n 'fill-color': RADIUS_CIRCLE_COLOR,\n 'fill-opacity': 0.2,\n },\n });\n\n map.addSource(WELLS_SOURCE_ID, { type: 'geojson', data: EMPTY_FEATURE_COLLECTION });\n map.addLayer({\n id: WELLS_HALO_LAYER_ID,\n type: 'circle',\n source: WELLS_SOURCE_ID,\n filter: ['==', ['get', 'isOffsetWell'], true],\n paint: {\n 'circle-radius': HIGHLIGHT_MARKER_SIZE,\n 'circle-color': ['get', 'color'],\n 'circle-opacity': 0.08,\n },\n });\n map.addLayer({\n id: WELLS_LAYER_ID,\n type: 'circle',\n source: WELLS_SOURCE_ID,\n layout: {\n 'circle-sort-key': ['get', 'order'],\n },\n paint: {\n 'circle-radius': WELL_MARKER_SIZE,\n 'circle-color': ['get', 'color'],\n 'circle-opacity': ['get', 'opacity'],\n },\n });\n map.addLayer({\n id: WELLS_ACTIVE_LAYER_ID,\n type: 'circle',\n source: WELLS_SOURCE_ID,\n filter: ['==', ['get', 'isActive'], true],\n paint: {\n 'circle-radius': HIGHLIGHT_MARKER_SIZE,\n 'circle-color': ['get', 'color'],\n 'circle-opacity': 0.24,\n },\n });\n map.addLayer({\n id: WELLS_HOVER_LAYER_ID,\n type: 'circle',\n source: WELLS_SOURCE_ID,\n filter: NO_HOVER_FILTER,\n paint: {\n 'circle-radius': [\n 'case',\n ['get', 'isSubjectWell'],\n WELL_MARKER_SIZE,\n HIGHLIGHT_MARKER_SIZE,\n ],\n 'circle-color': [\n 'case',\n ['get', 'isSubjectWell'],\n HIGHLIGHT_WELL_COLOR,\n ['get', 'color'],\n ],\n 'circle-opacity': 0.24,\n },\n });\n\n setIsMapReady(true);\n });\n\n return () => {\n tooltipRootRef.current?.unmount();\n tooltipRootRef.current = null;\n\n map.remove();\n mapRef.current = null;\n popupRef.current = null;\n subjectIconRef.current = null;\n radiusBoundsRef.current = null;\n wellsBoundsRef.current = null;\n };\n }, []);\n\n // NOTE: Radius circle\n useEffect(() => {\n radiusBoundsRef.current =\n subjectWellCoords && radius\n ? getCircleBounds(subjectWellCoords, radius * METERS_IN_MILE)\n : null;\n\n const map = mapRef.current;\n if (!map || !isMapReady) {\n return;\n }\n\n map.getSource(RADIUS_SOURCE_ID).setData(\n subjectWellCoords && radius\n ? {\n type: 'Feature',\n properties: {},\n geometry: makeCirclePolygon(subjectWellCoords, radius * METERS_IN_MILE),\n }\n : EMPTY_FEATURE_COLLECTION\n );\n }, [radius, subjectWellCoords, isMapReady]);\n\n const showTooltip = (well, isOffsetWell, isSubjectWell, coords) => {\n tooltipRootRef.current?.unmount();\n\n const popUpContainer = document.createElement('div');\n const popUpContent = createElement(WellTooltip(), {\n isViewOnly,\n well,\n color: get(formationColors, well.formation, '#BDBDBD'),\n isOffsetWell,\n isSubjectWell,\n isClickable,\n });\n tooltipRootRef.current = createAdaptiveRoot(popUpContainer);\n tooltipRootRef.current.render(<>{popUpContent}</>);\n if (!popupRef.current) {\n popupRef.current = new mapboxgl.Popup({\n closeButton: false,\n offset: HIGHLIGHT_MARKER_SIZE,\n });\n }\n popupRef.current\n .setLngLat(toLngLat(coords))\n .setDOMContent(popUpContainer)\n .addTo(mapRef.current);\n };\n\n // NOTE: Subject well hover swaps the subject marker color\n useEffect(() => {\n const map = mapRef.current;\n if (!map || !isMapReady) {\n return;\n }\n\n map.setPaintProperty(\n WELLS_LAYER_ID,\n 'circle-color',\n isSubjectWellHovered\n ? ['case', ['get', 'isSubjectWell'], HIGHLIGHT_WELL_COLOR, ['get', 'color']]\n : ['get', 'color']\n );\n }, [isSubjectWellHovered, isMapReady]);\n\n // NOTE: Well markers\n useEffect(() => {\n if (!wells || !offsetWellIds) {\n return undefined;\n }\n\n popupRef.current?.remove();\n\n const offsetWells = [];\n const unSelectedWells = [];\n wells.forEach(well => {\n if (well.id !== subjectWell?.id) {\n if (offsetWellIds.includes(well.id)) {\n offsetWells.push(well);\n } else {\n unSelectedWells.push(well);\n }\n }\n });\n const sortedWells = [...unSelectedWells, ...offsetWells, subjectWell];\n\n const features = [];\n const wellsBounds = new mapboxgl.LngLatBounds();\n wellByFeatureIdRef.current.clear();\n subjectFeatureIdRef.current = null;\n sortedWells.forEach((well, index) => {\n const coords = well?.topHole?.coordinates;\n\n if (coords && mapbox.isValidCoordinates(coords)) {\n const isSubjectWell = subjectWell?.id === well.id;\n const isOffsetWell = offsetWellIds.includes(well.id) && !isSubjectWell;\n const color = isSubjectWell\n ? OFFSET_WELL_COLOR\n : get(formationColors, well.formation, '#BDBDBD');\n const opacity = isOffsetWell ? 0.7 : 0.3;\n\n features.push({\n type: 'Feature',\n id: index,\n geometry: { type: 'Point', coordinates: toLngLat(coords) },\n properties: {\n color,\n opacity: isSubjectWell ? 1 : opacity,\n isSubjectWell,\n isOffsetWell,\n isActive: well.id === activeWellId && !isActiveWellIsSubjectWell,\n order: index,\n },\n });\n wellByFeatureIdRef.current.set(index, { well, coords, isOffsetWell, isSubjectWell });\n if (isSubjectWell) {\n subjectFeatureIdRef.current = index;\n }\n wellsBounds.extend(toLngLat(coords));\n }\n });\n wellsBoundsRef.current = features.length ? wellsBounds : null;\n\n const map = mapRef.current;\n if (!map || !isMapReady) {\n return undefined;\n }\n\n map.getSource(WELLS_SOURCE_ID).setData({ type: 'FeatureCollection', features });\n map.setFilter(WELLS_HOVER_LAYER_ID, NO_HOVER_FILTER);\n hoveredFeatureIdRef.current = null;\n\n const handleMouseMove = e => {\n const feature = e.features?.[0];\n if (!feature || hoveredFeatureIdRef.current === feature.id) {\n return;\n }\n const entry = wellByFeatureIdRef.current.get(feature.id);\n if (!entry) {\n return;\n }\n\n hoveredFeatureIdRef.current = feature.id;\n map.getCanvas().style.cursor = 'pointer';\n\n // Highlight\n map.setFilter(WELLS_HOVER_LAYER_ID, ['==', ['id'], feature.id]);\n showTooltip(entry.well, entry.isOffsetWell, entry.isSubjectWell, entry.coords);\n if (entry.isSubjectWell) {\n setIsSubjectWellHovered(true);\n }\n };\n\n const handleMouseLeave = e => {\n // NOTE: Leaflet cleared hover on leaving the ENLARGED highlight marker, so keep the\n // hover while the cursor is still over the hover halo (or another well marker)\n if (\n e?.point &&\n map.queryRenderedFeatures(e.point, { layers: [WELLS_LAYER_ID, WELLS_HOVER_LAYER_ID] })\n .length\n ) {\n return;\n }\n const wasSubjectWell =\n hoveredFeatureIdRef.current !== null &&\n hoveredFeatureIdRef.current === subjectFeatureIdRef.current;\n hoveredFeatureIdRef.current = null;\n map.getCanvas().style.cursor = '';\n map.setFilter(WELLS_HOVER_LAYER_ID, NO_HOVER_FILTER);\n popupRef.current?.remove();\n if (wasSubjectWell) {\n setIsSubjectWellHovered(false);\n }\n };\n\n const handleClick = e => {\n if (isViewOnly) return;\n const entry = wellByFeatureIdRef.current.get(e.features?.[0]?.id);\n if (!entry) {\n return;\n }\n handleChangeOffsetWell(entry.well, !entry.isOffsetWell);\n };\n\n map.on('mousemove', WELLS_LAYER_ID, handleMouseMove);\n map.on('mouseleave', WELLS_LAYER_ID, handleMouseLeave);\n map.on('mouseleave', WELLS_HOVER_LAYER_ID, handleMouseLeave);\n map.on('click', WELLS_LAYER_ID, handleClick);\n\n setTimeout(() => {\n if (radius < MAX_RADIUS && mapRef.current && radiusBoundsRef.current && wells !== prevWells) {\n mapRef.current.fitBounds(radiusBoundsRef.current, { padding: 5 });\n }\n }, 500);\n\n return () => {\n map.off('mousemove', WELLS_LAYER_ID, handleMouseMove);\n map.off('mouseleave', WELLS_LAYER_ID, handleMouseLeave);\n map.off('mouseleave', WELLS_HOVER_LAYER_ID, handleMouseLeave);\n map.off('click', WELLS_LAYER_ID, handleClick);\n };\n }, [subjectWell, wells, offsetWellIds, activeWellId, isMapReady]);\n\n // NOTE: Subject Well Icon\n\n useEffect(() => {\n const map = mapRef.current;\n\n if (subjectIconRef.current) {\n subjectIconRef.current.remove();\n subjectIconRef.current = null;\n }\n\n if (!map || !subjectWellCoords) return;\n\n const isHighlighted = isSubjectWellHovered || isActiveWellIsSubjectWell;\n const icon = document.createElement('img');\n icon.src = isHighlighted ? SubjectHighlightWellIcon : SubjectWellIcon;\n const [iconWidth, iconHeight] = isHighlighted ? [70, 20] : [62, 12];\n const [anchorX, anchorY] = isHighlighted ? [35, 29] : [31, 25];\n icon.width = iconWidth;\n icon.height = iconHeight;\n\n icon.addEventListener('mouseover', () => {\n setIsSubjectWellHovered(true);\n\n // Highlight\n if (subjectFeatureIdRef.current !== null && map.getLayer(WELLS_HOVER_LAYER_ID)) {\n hoveredFeatureIdRef.current = subjectFeatureIdRef.current;\n map.setFilter(WELLS_HOVER_LAYER_ID, ['==', ['id'], subjectFeatureIdRef.current]);\n }\n showTooltip(subjectWell, false, true, subjectWellCoords);\n });\n\n icon.addEventListener('mouseout', () => {\n hoveredFeatureIdRef.current = null;\n if (map.getLayer(WELLS_HOVER_LAYER_ID)) {\n map.setFilter(WELLS_HOVER_LAYER_ID, NO_HOVER_FILTER);\n }\n popupRef.current?.remove();\n setIsSubjectWellHovered(false);\n });\n\n subjectIconRef.current = new mapboxgl.Marker({\n element: icon,\n anchor: 'center',\n // NOTE: Leaflet anchored the icon at [anchorX, anchorY] from its top-left corner\n offset: [iconWidth / 2 - anchorX, iconHeight / 2 - anchorY],\n })\n .setLngLat(toLngLat(subjectWellCoords))\n .addTo(map);\n }, [isSubjectWellHovered, subjectWellCoords, radius, subjectWell, isActiveWellIsSubjectWell]);\n\n // NOTE: Map Update\n useEffect(() => {\n if (radius > MAX_RADIUS) {\n mapRef.current?.setZoom(1);\n return;\n }\n setTimeout(() => {\n if (subjectWell) {\n if (mapRef.current && radiusBoundsRef.current && radius) {\n mapRef.current.fitBounds(radiusBoundsRef.current, { padding: 5 });\n }\n } else if (mapRef.current && wellsBoundsRef.current) {\n mapRef.current.fitBounds(wellsBoundsRef.current);\n }\n if (subjectWellCoords && mapRef.current) {\n mapRef.current.easeTo({ center: toLngLat(subjectWellCoords), duration: 700 });\n }\n }, 500);\n }, [radius, subjectWell, subjectWellCoords]);\n\n const handleZoomIn = () => {\n mapRef.current?.setZoom(zoom + 1);\n };\n\n const handleZoomOut = () => {\n if (zoom > 1) {\n mapRef.current?.setZoom(zoom - 1);\n }\n };\n\n return (\n <div className={classNames(styles.mapView, classes.root)}>\n <div\n className={classNames(styles.mapMain, classes.map)}\n ref={containerRef}\n onDoubleClick={handleZoomIn}\n >\n <div className={styles.zoomGroup}>\n <Tooltip title={zoom < ZOOM_MAX_VALUE ? 'Zoom in' : ''} placement=\"left\">\n <div\n className={classNames(styles.zoomButton, {\n [styles.zoomDisabled]: zoom === ZOOM_MAX_VALUE,\n })}\n onClick={handleZoomIn}\n >\n <ZoomInIcon className={styles.zoomInOutIcon} />\n </div>\n </Tooltip>\n <Tooltip title={zoom > ZOOM_MIN_VALUE ? 'Zoom out' : ''} placement=\"left\">\n <div\n className={classNames(styles.zoomButton, {\n [styles.zoomDisabled]: zoom === ZOOM_MIN_VALUE,\n })}\n onClick={handleZoomOut}\n >\n <ZoomOutIcon className={styles.zoomInOutIcon} />\n </div>\n </Tooltip>\n </div>\n </div>\n </div>\n );\n};\n\nexport default OffsetWellMap;\n"],"names":["DEFAULT_COORDS","EMPTY_FEATURE_COLLECTION","type","features","NO_HOVER_FILTER","toLngLat","_ref","_ref2","_slicedToArray","lat","makeCirclePolygon","_ref3","radiusMeters","_ref4","lng","points","degreesLng","Math","cos","PI","degreesLat","ring","i","theta","push","sin","coordinates","_ref7","isViewOnly","_ref7$subjectWell","subjectWell","wells","offsetWellIds","radius","handleChanageOffsetWell","_ref7$handleChangeOff","handleChangeOffsetWell","activeWellId","_ref7$isClickable","isClickable","_ref7$classes","classes","subjectWellCoords","useMemo","get","formationColors","getAllFormations","containerRef","useRef","mapRef","popupRef","radiusBoundsRef","wellsBoundsRef","subjectIconRef","wellByFeatureIdRef","Map","subjectFeatureIdRef","hoveredFeatureIdRef","tooltipRootRef","useState","_useState2","_useState","isSubjectWellHovered","setIsSubjectWellHovered","isActiveWellIsSubjectWell","id","prevWells","usePreviousWells","_useState4","_useState3","isMapReady","setIsMapReady","_useState6","_useState5","zoom","setZoom","useEffect","IS_MAPBOX_ENABLED","map","mapboxgl","container","current","style","center","maxZoom","attributionControl","scrollZoom","doubleClickZoom","on","round","getZoom","addSource","data","addLayer","source","paint","filter","layout","_tooltipRootRef$curre","unmount","remove","_ref5","_ref6","getSource","setData","properties","geometry","showTooltip","well","isOffsetWell","isSubjectWell","coords","_tooltipRootRef$curre2","popUpContainer","document","createElement","popUpContent","WellTooltip","color","formation","createAdaptiveRoot","render","_jsx","_Fragment","children","Popup","closeButton","offset","setLngLat","setDOMContent","addTo","setPaintProperty","_popupRef$current","offsetWells","unSelectedWells","forEach","includes","sortedWells","wellsBounds","LngLatBounds","clear","index","_well$topHole","topHole","mapbox","opacity","isActive","order","set","extend","length","setFilter","handleMouseMove","e","_e$features","feature","entry","getCanvas","cursor","handleMouseLeave","_popupRef$current2","point","queryRenderedFeatures","layers","wasSubjectWell","handleClick","_e$features2","_e$features2$","setTimeout","fitBounds","padding","off","isHighlighted","icon","src","_ref8","_ref9","iconWidth","iconHeight","_ref10","_ref11","anchorX","anchorY","width","height","addEventListener","getLayer","_popupRef$current3","Marker","element","anchor","_mapRef$current","easeTo","duration","handleZoomIn","_mapRef$current2","className","classNames","styles","mapView","root","jsx","mapMain","ref","onDoubleClick","_jsxs","jsxs","zoomGroup","Tooltip","title","placement","zoomButton","_defineProperty","zoomDisabled","onClick","ZoomInIcon","zoomInOutIcon","_mapRef$current3","ZoomOutIcon"],"mappings":"qjFAoBMA,EAAiB,CAAC,WAAY,WAmB9BC,EAA2B,CAAEC,KAAM,oBAAqBC,SAAU,IAClEC,EAAkB,CAAC,KAAM,CAAC,OAAQ,GAGlCC,EAAW,SAAHC,GAAA,IAAAC,EAAAC,EAAAA,QAAAF,EAAA,GAAKG,EAAGF,EAAA,GAAK,MAAM,CAANA,EAAA,GAAYE,EAAI,EAGrCC,EAAoB,SAAHC,EAAgBC,GAIrC,IAJmE,IAAAC,EAAAL,EAAAA,QAAAG,EAAA,GAAzCF,EAAGI,EAAA,GAAEC,EAAGD,EAAA,GAAiBE,yDAAS,GACtDC,EAAaJ,GAAgB,OAASK,KAAKC,IAAKT,EAAMQ,KAAKE,GAAM,MACjEC,EAAaR,EAAe,OAC5BS,EAAO,GACJC,EAAI,EAAGA,GAAKP,EAAQO,GAAK,EAAG,CACnC,IAAMC,EAASD,EAAIP,EAAU,EAAIE,KAAKE,GACtCE,EAAKG,KAAK,CAACV,EAAME,EAAaC,KAAKC,IAAIK,GAAQd,EAAMW,EAAaH,KAAKQ,IAAIF,IAC7E,CACA,MAAO,CAAErB,KAAM,UAAWwB,YAAa,CAACL,GAC1C,iBAYsB,SAWhBM,GAAA,IAVJC,IAAAA,WAAUC,EAAAF,EACVG,YAAAA,aAAc,KAAID,EAClBE,IAAAA,MACAC,IAAAA,cACAC,IAAAA,OACAC,IAA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C,EAAU,QAACC,EAAOa,WAAUC,EAAA,QAAA,GACpCd,EAAOe,aAleD,IAkegB3I,KAEzB4I,QA7BU,WACN,IAAAG,EAAV/I,GAAO,IACT,QAAAzB,EAAAA,EAAOgC,eAAP,IAAAwI,GAAAA,EAAgB9I,QAAQD,GAAO,KA2BAkD,SAEvBF,MAACgG,SAAW,CAACtB,UAAWE,EAAOkB,0BAO7C"}
|
|
1
|
+
{"version":3,"file":"OffsetWellMap.js","sources":["../../../../src/components/OffsetWellMap/OffsetWellMap.js"],"sourcesContent":["import { createElement, useRef, useEffect, useState, useMemo } from 'react';\nimport { get } from 'lodash';\nimport classNames from 'classnames';\nimport { Tooltip } from '@material-ui/core';\nimport ZoomInIcon from '@material-ui/icons/Add';\nimport ZoomOutIcon from '@material-ui/icons/Remove';\nimport 'mapbox-gl/dist/mapbox-gl.css';\n\nimport SubjectWellIcon from './CustomIcon/SubjectWellIcon.svg';\nimport SubjectHighlightWellIcon from './CustomIcon/SubjectHighlightWellIcon.svg';\nimport { usePreviousWells } from './effects';\nimport { WellTooltip } from './WellTooltip';\nimport { getAllFormations } from './utils';\n\nimport styles from './OffsetWellMap.module.css';\n\nimport mapboxgl from '~/config/mapboxGl';\nimport { IS_MAPBOX_ENABLED } from '~/config/mapbox';\nimport { mapbox } from '~/utils';\nimport { createAdaptiveRoot } from '~/utils/createAdaptiveRoot';\n\nconst DEFAULT_COORDS = [29.749907, -95.358421];\nconst WELL_MARKER_SIZE = 5;\nconst HIGHLIGHT_MARKER_SIZE = 12;\nconst OFFSET_WELL_COLOR = '#03BCD4';\nconst RADIUS_CIRCLE_COLOR = '#03BCD4';\nconst HIGHLIGHT_WELL_COLOR = '#63EFFF';\nconst METERS_IN_MILE = 1609.34;\nconst ZOOM_INIT_VALUE = 3;\nconst ZOOM_MAX_VALUE = 18;\nconst ZOOM_MIN_VALUE = 1;\nconst MAX_RADIUS = 3000;\n\nconst RADIUS_SOURCE_ID = 'radius-circle';\nconst RADIUS_LAYER_ID = 'radius-circle-fill';\nconst WELLS_SOURCE_ID = 'wells';\nconst WELLS_HALO_LAYER_ID = 'wells-halo';\nconst WELLS_LAYER_ID = 'wells-circle';\nconst WELLS_ACTIVE_LAYER_ID = 'wells-active-highlight';\nconst WELLS_HOVER_LAYER_ID = 'wells-hover-highlight';\nconst EMPTY_FEATURE_COLLECTION = { type: 'FeatureCollection', features: [] };\nconst NO_HOVER_FILTER = ['==', ['id'], -1];\n\n// NOTE: Props keep the Leaflet [lat, lng] convention; mapbox-gl expects [lng, lat]\nconst toLngLat = ([lat, lng]) => [lng, lat];\n\n// NOTE: mapbox-gl circle layers are pixel-radius, so approximate the meter radius with a polygon\nconst makeCirclePolygon = ([lat, lng], radiusMeters, points = 64) => {\n const degreesLng = radiusMeters / (111320 * Math.cos((lat * Math.PI) / 180));\n const degreesLat = radiusMeters / 110574;\n const ring = [];\n for (let i = 0; i <= points; i += 1) {\n const theta = (i / points) * 2 * Math.PI;\n ring.push([lng + degreesLng * Math.cos(theta), lat + degreesLat * Math.sin(theta)]);\n }\n return { type: 'Polygon', coordinates: [ring] };\n};\n\nconst getCircleBounds = ([lat, lng], radiusMeters) => {\n const degreesLng = radiusMeters / (111320 * Math.cos((lat * Math.PI) / 180));\n const degreesLat = radiusMeters / 110574;\n return [\n [lng - degreesLng, lat - degreesLat],\n [lng + degreesLng, lat + degreesLat],\n ];\n};\n\n/** @type {React.FC<import('./OffsetWellMapProps').OffsetWellMapProps>} */\nconst OffsetWellMap = ({\n isViewOnly,\n subjectWell = null,\n wells,\n offsetWellIds,\n radius,\n handleChanageOffsetWell,\n handleChangeOffsetWell = handleChanageOffsetWell,\n activeWellId,\n isClickable = true,\n classes = {},\n}) => {\n const subjectWellCoords = useMemo(() => {\n return subjectWell && get(subjectWell, 'topHole.coordinates');\n }, [subjectWell]);\n const formationColors = useMemo(() => getAllFormations(wells), [wells]);\n\n const containerRef = useRef();\n const mapRef = useRef();\n const popupRef = useRef();\n const radiusBoundsRef = useRef(null);\n const wellsBoundsRef = useRef(null);\n const subjectIconRef = useRef();\n const wellByFeatureIdRef = useRef(new Map());\n const subjectFeatureIdRef = useRef(null);\n const hoveredFeatureIdRef = useRef(null);\n const tooltipRootRef = useRef(null);\n const [isSubjectWellHovered, setIsSubjectWellHovered] = useState(false);\n const isActiveWellIsSubjectWell = subjectWell?.id === activeWellId;\n const prevWells = usePreviousWells(wells);\n const [isMapReady, setIsMapReady] = useState(false);\n const [zoom, setZoom] = useState(ZOOM_INIT_VALUE);\n\n // NOTE: Initialize map\n useEffect(() => {\n if (!IS_MAPBOX_ENABLED) return undefined;\n\n const map = new mapboxgl.Map({\n container: containerRef.current,\n style: 'mapbox://styles/mapbox/dark-v9',\n center: toLngLat(DEFAULT_COORDS),\n zoom: ZOOM_INIT_VALUE,\n // NOTE: keep the zoom buttons' disable logic (zoom === ZOOM_MAX_VALUE) reachable\n maxZoom: ZOOM_MAX_VALUE,\n attributionControl: false,\n scrollZoom: false,\n doubleClickZoom: false,\n });\n mapRef.current = map;\n\n // NOTE: GL zoom is fractional where Leaflet was integer\n map.on('zoomend', () => setZoom(Math.round(map.getZoom())));\n\n // NOTE: Sources/layers can only be added after the style loads\n map.on('load', () => {\n map.addSource(RADIUS_SOURCE_ID, { type: 'geojson', data: EMPTY_FEATURE_COLLECTION });\n map.addLayer({\n id: RADIUS_LAYER_ID,\n type: 'fill',\n source: RADIUS_SOURCE_ID,\n paint: {\n 'fill-color': RADIUS_CIRCLE_COLOR,\n 'fill-opacity': 0.2,\n },\n });\n\n map.addSource(WELLS_SOURCE_ID, { type: 'geojson', data: EMPTY_FEATURE_COLLECTION });\n map.addLayer({\n id: WELLS_HALO_LAYER_ID,\n type: 'circle',\n source: WELLS_SOURCE_ID,\n filter: ['==', ['get', 'isOffsetWell'], true],\n paint: {\n 'circle-radius': HIGHLIGHT_MARKER_SIZE,\n 'circle-color': ['get', 'color'],\n 'circle-opacity': 0.08,\n },\n });\n map.addLayer({\n id: WELLS_LAYER_ID,\n type: 'circle',\n source: WELLS_SOURCE_ID,\n layout: {\n 'circle-sort-key': ['get', 'order'],\n },\n paint: {\n 'circle-radius': WELL_MARKER_SIZE,\n 'circle-color': ['get', 'color'],\n 'circle-opacity': ['get', 'opacity'],\n },\n });\n map.addLayer({\n id: WELLS_ACTIVE_LAYER_ID,\n type: 'circle',\n source: WELLS_SOURCE_ID,\n filter: ['==', ['get', 'isActive'], true],\n paint: {\n 'circle-radius': HIGHLIGHT_MARKER_SIZE,\n 'circle-color': ['get', 'color'],\n 'circle-opacity': 0.24,\n },\n });\n map.addLayer({\n id: WELLS_HOVER_LAYER_ID,\n type: 'circle',\n source: WELLS_SOURCE_ID,\n filter: NO_HOVER_FILTER,\n paint: {\n 'circle-radius': [\n 'case',\n ['get', 'isSubjectWell'],\n WELL_MARKER_SIZE,\n HIGHLIGHT_MARKER_SIZE,\n ],\n 'circle-color': [\n 'case',\n ['get', 'isSubjectWell'],\n HIGHLIGHT_WELL_COLOR,\n ['get', 'color'],\n ],\n 'circle-opacity': 0.24,\n },\n });\n\n setIsMapReady(true);\n });\n\n return () => {\n tooltipRootRef.current?.unmount();\n tooltipRootRef.current = null;\n\n map.remove();\n mapRef.current = null;\n popupRef.current = null;\n subjectIconRef.current = null;\n radiusBoundsRef.current = null;\n wellsBoundsRef.current = null;\n };\n }, []);\n\n // NOTE: Radius circle\n useEffect(() => {\n radiusBoundsRef.current =\n subjectWellCoords && radius\n ? getCircleBounds(subjectWellCoords, radius * METERS_IN_MILE)\n : null;\n\n const map = mapRef.current;\n if (!map || !isMapReady) {\n return;\n }\n\n map.getSource(RADIUS_SOURCE_ID).setData(\n subjectWellCoords && radius\n ? {\n type: 'Feature',\n properties: {},\n geometry: makeCirclePolygon(subjectWellCoords, radius * METERS_IN_MILE),\n }\n : EMPTY_FEATURE_COLLECTION\n );\n }, [radius, subjectWellCoords, isMapReady]);\n\n const showTooltip = (well, isOffsetWell, isSubjectWell, coords) => {\n tooltipRootRef.current?.unmount();\n\n const popUpContainer = document.createElement('div');\n const popUpContent = createElement(WellTooltip(), {\n isViewOnly,\n well,\n color: get(formationColors, well.formation, '#BDBDBD'),\n isOffsetWell,\n isSubjectWell,\n isClickable,\n });\n tooltipRootRef.current = createAdaptiveRoot(popUpContainer);\n tooltipRootRef.current.render(<>{popUpContent}</>);\n if (!popupRef.current) {\n popupRef.current = new mapboxgl.Popup({\n closeButton: false,\n offset: HIGHLIGHT_MARKER_SIZE,\n });\n }\n popupRef.current\n .setLngLat(toLngLat(coords))\n .setDOMContent(popUpContainer)\n .addTo(mapRef.current);\n };\n\n // NOTE: Subject well hover swaps the subject marker color\n useEffect(() => {\n const map = mapRef.current;\n if (!map || !isMapReady) {\n return;\n }\n\n map.setPaintProperty(\n WELLS_LAYER_ID,\n 'circle-color',\n isSubjectWellHovered\n ? ['case', ['get', 'isSubjectWell'], HIGHLIGHT_WELL_COLOR, ['get', 'color']]\n : ['get', 'color']\n );\n }, [isSubjectWellHovered, isMapReady]);\n\n // NOTE: Well markers\n useEffect(() => {\n if (!wells || !offsetWellIds) {\n return undefined;\n }\n\n popupRef.current?.remove();\n\n const offsetWells = [];\n const unSelectedWells = [];\n wells.forEach(well => {\n if (well.id !== subjectWell?.id) {\n if (offsetWellIds.includes(well.id)) {\n offsetWells.push(well);\n } else {\n unSelectedWells.push(well);\n }\n }\n });\n const sortedWells = [...unSelectedWells, ...offsetWells, subjectWell];\n\n const features = [];\n const wellsBounds = new mapboxgl.LngLatBounds();\n wellByFeatureIdRef.current.clear();\n subjectFeatureIdRef.current = null;\n sortedWells.forEach((well, index) => {\n const coords = well?.topHole?.coordinates;\n\n if (coords && mapbox.isValidCoordinates(coords)) {\n const isSubjectWell = subjectWell?.id === well.id;\n const isOffsetWell = offsetWellIds.includes(well.id) && !isSubjectWell;\n const color = isSubjectWell\n ? OFFSET_WELL_COLOR\n : get(formationColors, well.formation, '#BDBDBD');\n const opacity = isOffsetWell ? 0.7 : 0.3;\n\n features.push({\n type: 'Feature',\n id: index,\n geometry: { type: 'Point', coordinates: toLngLat(coords) },\n properties: {\n color,\n opacity: isSubjectWell ? 1 : opacity,\n isSubjectWell,\n isOffsetWell,\n isActive: well.id === activeWellId && !isActiveWellIsSubjectWell,\n order: index,\n },\n });\n wellByFeatureIdRef.current.set(index, { well, coords, isOffsetWell, isSubjectWell });\n if (isSubjectWell) {\n subjectFeatureIdRef.current = index;\n }\n wellsBounds.extend(toLngLat(coords));\n }\n });\n wellsBoundsRef.current = features.length ? wellsBounds : null;\n\n const map = mapRef.current;\n if (!map || !isMapReady) {\n return undefined;\n }\n\n map.getSource(WELLS_SOURCE_ID).setData({ type: 'FeatureCollection', features });\n map.setFilter(WELLS_HOVER_LAYER_ID, NO_HOVER_FILTER);\n hoveredFeatureIdRef.current = null;\n\n const handleMouseMove = e => {\n const feature = e.features?.[0];\n if (!feature || hoveredFeatureIdRef.current === feature.id) {\n return;\n }\n const entry = wellByFeatureIdRef.current.get(feature.id);\n if (!entry) {\n return;\n }\n\n hoveredFeatureIdRef.current = feature.id;\n map.getCanvas().style.cursor = 'pointer';\n\n // Highlight\n map.setFilter(WELLS_HOVER_LAYER_ID, ['==', ['id'], feature.id]);\n showTooltip(entry.well, entry.isOffsetWell, entry.isSubjectWell, entry.coords);\n if (entry.isSubjectWell) {\n setIsSubjectWellHovered(true);\n }\n };\n\n const handleMouseLeave = e => {\n // NOTE: Leaflet cleared hover on leaving the ENLARGED highlight marker, so keep the\n // hover while the cursor is still over the hover halo (or another well marker)\n if (\n e?.point &&\n map.queryRenderedFeatures(e.point, { layers: [WELLS_LAYER_ID, WELLS_HOVER_LAYER_ID] })\n .length\n ) {\n return;\n }\n const wasSubjectWell =\n hoveredFeatureIdRef.current !== null &&\n hoveredFeatureIdRef.current === subjectFeatureIdRef.current;\n hoveredFeatureIdRef.current = null;\n map.getCanvas().style.cursor = '';\n map.setFilter(WELLS_HOVER_LAYER_ID, NO_HOVER_FILTER);\n popupRef.current?.remove();\n if (wasSubjectWell) {\n setIsSubjectWellHovered(false);\n }\n };\n\n const handleClick = e => {\n if (isViewOnly) return;\n const entry = wellByFeatureIdRef.current.get(e.features?.[0]?.id);\n if (!entry) {\n return;\n }\n handleChangeOffsetWell(entry.well, !entry.isOffsetWell);\n };\n\n map.on('mousemove', WELLS_LAYER_ID, handleMouseMove);\n map.on('mouseleave', WELLS_LAYER_ID, handleMouseLeave);\n map.on('mouseleave', WELLS_HOVER_LAYER_ID, handleMouseLeave);\n map.on('click', WELLS_LAYER_ID, handleClick);\n\n setTimeout(() => {\n if (radius < MAX_RADIUS && mapRef.current && radiusBoundsRef.current && wells !== prevWells) {\n mapRef.current.fitBounds(radiusBoundsRef.current, { padding: 5 });\n }\n }, 500);\n\n return () => {\n map.off('mousemove', WELLS_LAYER_ID, handleMouseMove);\n map.off('mouseleave', WELLS_LAYER_ID, handleMouseLeave);\n map.off('mouseleave', WELLS_HOVER_LAYER_ID, handleMouseLeave);\n map.off('click', WELLS_LAYER_ID, handleClick);\n };\n }, [subjectWell, wells, offsetWellIds, activeWellId, isMapReady]);\n\n // NOTE: Subject Well Icon\n\n useEffect(() => {\n const map = mapRef.current;\n\n if (subjectIconRef.current) {\n subjectIconRef.current.remove();\n subjectIconRef.current = null;\n }\n\n if (!map || !subjectWellCoords) return;\n\n const isHighlighted = isSubjectWellHovered || isActiveWellIsSubjectWell;\n const icon = document.createElement('img');\n icon.src = isHighlighted ? SubjectHighlightWellIcon : SubjectWellIcon;\n const [iconWidth, iconHeight] = isHighlighted ? [70, 20] : [62, 12];\n const [anchorX, anchorY] = isHighlighted ? [35, 29] : [31, 25];\n icon.width = iconWidth;\n icon.height = iconHeight;\n\n icon.addEventListener('mouseover', () => {\n setIsSubjectWellHovered(true);\n\n // Highlight\n if (subjectFeatureIdRef.current !== null && map.getLayer(WELLS_HOVER_LAYER_ID)) {\n hoveredFeatureIdRef.current = subjectFeatureIdRef.current;\n map.setFilter(WELLS_HOVER_LAYER_ID, ['==', ['id'], subjectFeatureIdRef.current]);\n }\n showTooltip(subjectWell, false, true, subjectWellCoords);\n });\n\n icon.addEventListener('mouseout', () => {\n hoveredFeatureIdRef.current = null;\n if (map.getLayer(WELLS_HOVER_LAYER_ID)) {\n map.setFilter(WELLS_HOVER_LAYER_ID, NO_HOVER_FILTER);\n }\n popupRef.current?.remove();\n setIsSubjectWellHovered(false);\n });\n\n subjectIconRef.current = new mapboxgl.Marker({\n element: icon,\n anchor: 'center',\n // NOTE: Leaflet anchored the icon at [anchorX, anchorY] from its top-left corner\n offset: [iconWidth / 2 - anchorX, iconHeight / 2 - anchorY],\n })\n .setLngLat(toLngLat(subjectWellCoords))\n .addTo(map);\n }, [isSubjectWellHovered, subjectWellCoords, radius, subjectWell, isActiveWellIsSubjectWell]);\n\n // NOTE: Map Update\n useEffect(() => {\n if (radius > MAX_RADIUS) {\n mapRef.current?.setZoom(1);\n return;\n }\n setTimeout(() => {\n if (subjectWell) {\n if (mapRef.current && radiusBoundsRef.current && radius) {\n mapRef.current.fitBounds(radiusBoundsRef.current, { padding: 5 });\n }\n } else if (mapRef.current && wellsBoundsRef.current) {\n mapRef.current.fitBounds(wellsBoundsRef.current);\n }\n if (subjectWellCoords && mapRef.current) {\n mapRef.current.easeTo({ center: toLngLat(subjectWellCoords), duration: 700 });\n }\n }, 500);\n }, [radius, subjectWell, subjectWellCoords]);\n\n const handleZoomIn = () => {\n mapRef.current?.setZoom(zoom + 1);\n };\n\n const handleZoomOut = () => {\n if (zoom > 1) {\n mapRef.current?.setZoom(zoom - 1);\n }\n };\n\n return (\n <div className={classNames(styles.mapView, classes.root)}>\n <div\n className={classNames(styles.mapMain, classes.map)}\n ref={containerRef}\n onDoubleClick={handleZoomIn}\n >\n <div className={styles.zoomGroup}>\n <Tooltip title={zoom < ZOOM_MAX_VALUE ? 'Zoom in' : ''} placement=\"left\">\n <div\n className={classNames(styles.zoomButton, {\n [styles.zoomDisabled]: zoom === ZOOM_MAX_VALUE,\n })}\n onClick={handleZoomIn}\n >\n <ZoomInIcon className={styles.zoomInOutIcon} />\n </div>\n </Tooltip>\n <Tooltip title={zoom > ZOOM_MIN_VALUE ? 'Zoom out' : ''} placement=\"left\">\n <div\n className={classNames(styles.zoomButton, {\n [styles.zoomDisabled]: zoom === ZOOM_MIN_VALUE,\n })}\n onClick={handleZoomOut}\n >\n <ZoomOutIcon className={styles.zoomInOutIcon} />\n </div>\n </Tooltip>\n </div>\n </div>\n </div>\n );\n};\n\nexport default OffsetWellMap;\n"],"names":["DEFAULT_COORDS","EMPTY_FEATURE_COLLECTION","type","features","NO_HOVER_FILTER","toLngLat","_ref","_ref2","_slicedToArray","lat","makeCirclePolygon","_ref3","radiusMeters","_ref4","lng","points","degreesLng","Math","cos","PI","degreesLat","ring","i","theta","push","sin","coordinates","_ref7","isViewOnly","_ref7$subjectWell","subjectWell","wells","offsetWellIds","radius","handleChanageOffsetWell","_ref7$handleChangeOff","handleChangeOffsetWell","activeWellId","_ref7$isClickable","isClickable","_ref7$classes","classes","subjectWellCoords","useMemo","get","formationColors","getAllFormations","containerRef","useRef","mapRef","popupRef","radiusBoundsRef","wellsBoundsRef","subjectIconRef","wellByFeatureIdRef","Map","subjectFeatureIdRef","hoveredFeatureIdRef","tooltipRootRef","useState","_useState2","_useState","isSubjectWellHovered","setIsSubjectWellHovered","isActiveWellIsSubjectWell","id","prevWells","usePreviousWells","_useState4","_useState3","isMapReady","setIsMapReady","_useState6","_useState5","zoom","setZoom","useEffect","IS_MAPBOX_ENABLED","map","mapboxgl","container","current","style","center","maxZoom","attributionControl","scrollZoom","doubleClickZoom","on","round","getZoom","addSource","data","addLayer","source","paint","filter","layout","_tooltipRootRef$curre","unmount","remove","_ref5","_ref6","getSource","setData","properties","geometry","showTooltip","well","isOffsetWell","isSubjectWell","coords","_tooltipRootRef$curre2","popUpContainer","document","createElement","popUpContent","WellTooltip","color","formation","createAdaptiveRoot","render","_jsx","_Fragment","children","Popup","closeButton","offset","setLngLat","setDOMContent","addTo","setPaintProperty","_popupRef$current","offsetWells","unSelectedWells","forEach","includes","sortedWells","wellsBounds","LngLatBounds","clear","index","_well$topHole","topHole","mapbox","opacity","isActive","order","set","extend","length","setFilter","handleMouseMove","e","_e$features","feature","entry","getCanvas","cursor","handleMouseLeave","_popupRef$current2","point","queryRenderedFeatures","layers","wasSubjectWell","handleClick","_e$features2","_e$features2$","setTimeout","fitBounds","padding","off","isHighlighted","icon","src","_ref8","_ref9","iconWidth","iconHeight","_ref10","_ref11","anchorX","anchorY","width","height","addEventListener","getLayer","_popupRef$current3","Marker","element","anchor","_mapRef$current","easeTo","duration","handleZoomIn","_mapRef$current2","className","classNames","styles","mapView","root","jsx","mapMain","ref","onDoubleClick","_jsxs","jsxs","zoomGroup","Tooltip","title","placement","zoomButton","_defineProperty","zoomDisabled","onClick","ZoomInIcon","zoomInOutIcon","_mapRef$current3","ZoomOutIcon"],"mappings":"8mFAqBMA,EAAiB,CAAC,WAAY,WAmB9BC,EAA2B,CAAEC,KAAM,oBAAqBC,SAAU,IAClEC,EAAkB,CAAC,KAAM,CAAC,OAAQ,GAGlCC,EAAW,SAAHC,GAAA,IAAAC,EAAAC,EAAAA,QAAAF,EAAA,GAAKG,EAAGF,EAAA,GAAK,MAAM,CAANA,EAAA,GAAYE,EAAI,EAGrCC,EAAoB,SAAHC,EAAgBC,GAIrC,IAJmE,IAAAC,EAAAL,EAAAA,QAAAG,EAAA,GAAzCF,EAAGI,EAAA,GAAEC,EAAGD,EAAA,GAAiBE,yDAAS,GACtDC,EAAaJ,GAAgB,OAASK,KAAKC,IAAKT,EAAMQ,KAAKE,GAAM,MACjEC,EAAaR,EAAe,OAC5BS,EAAO,GACJC,EAAI,EAAGA,GAAKP,EAAQO,GAAK,EAAG,CACnC,IAAMC,EAASD,EAAIP,EAAU,EAAIE,KAAKE,GACtCE,EAAKG,KAAK,CAACV,EAAME,EAAaC,KAAKC,IAAIK,GAAQd,EAAMW,EAAaH,KAAKQ,IAAIF,IAC7E,CACA,MAAO,CAAErB,KAAM,UAAWwB,YAAa,CAACL,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AWE,EAAOkB,oBAGlC9F,MAACsF,UAAO,CAACC,MAAOvI,GA/dH,EA+d2B,WAAa,GAAIwI,UAAU,OAAMtF,SACvEF,EAAA+E,IAAA,MAAA,CACEL,UAAWC,EAAU,QAACC,EAAOa,WAAUC,EAAA,QAAA,GACpCd,EAAOe,aAleD,IAkegB3I,KAEzB4I,QA7BU,WACN,IAAAG,EAAV/I,GAAO,IACT,QAAAzB,EAAAA,EAAOgC,eAAP,IAAAwI,GAAAA,EAAgB9I,QAAQD,GAAO,KA2BAkD,SAEvBF,MAACgG,UAAW,CAACtB,UAAWE,EAAOkB,0BAO7C"}
|
package/cjs-bundle/components/OffsetWellPickerV2/components/Filter/NonEngineeredWellsSwitch.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var e=require("prop-types"),t=require("@material-ui/core"),i=require("@material-ui/icons"),n=require("../../../../componentsV2/Switch/Switch.js"),
|
|
1
|
+
"use strict";var e=require("prop-types"),t=require("@material-ui/core"),i=require("@material-ui/icons/InfoOutlined"),n=require("../../../../componentsV2/Switch/Switch.js"),l=require("react/jsx-runtime");function r(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var a=r(e),o=r(i);function s(e){var i=e.value,r=e.onChange,a=e.classes,s=e["data-testid"],c=void 0===s?"NonEngineeredWellsSwitch":s;return l.jsxs("div",{className:a.nonEngineeredWrapper,children:[l.jsx(n.Switch,{testId:c,onLabel:"Include Non-Verified Reference Wells",checked:i,onChange:function(e){r(e)},size:"small",className:a.formControl}),l.jsx(t.Tooltip,{title:l.jsxs("div",{className:a.tooltipContent,children:[l.jsx("span",{children:"Non-Verified Reference Wells have minimal data and are used for displaying drilling parameters only."}),l.jsx("span",{children:"Metrics & models from these wells can be inaccurate."})]}),placement:"bottom-start",classes:{tooltip:a.infoTooltip},children:l.jsx(o.default,{fontSize:"small",className:a.infoIcon})})]})}s.propTypes={value:a.default.bool.isRequired,onChange:a.default.func.isRequired,classes:a.default.shape({}).isRequired,"data-testid":a.default.string};var c=t.withStyles((function(e){return{formControl:{display:"flex",alignItems:"flex-end",height:"100%"},nonEngineeredWrapper:{display:"flex",height:"56px",alignItems:"flex-end",marginLeft:"8px"},infoIcon:{marginLeft:"8px",marginBottom:"12px",fontSize:"13px",color:e.palette.primary.text6,"&:hover":{color:e.palette.primary.text1}},infoTooltip:{fontSize:"12px",lineHeight:"16px",letterSpacing:"0.4px",color:e.palette.primary.text1,minWidth:"314px"},tooltipContent:{display:"flex",flexDirection:"column"}}}))(s);module.exports=c;
|
|
2
2
|
//# sourceMappingURL=NonEngineeredWellsSwitch.js.map
|
package/cjs-bundle/components/OffsetWellPickerV2/components/Filter/NonEngineeredWellsSwitch.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NonEngineeredWellsSwitch.js","sources":["../../../../../../src/components/OffsetWellPickerV2/components/Filter/NonEngineeredWellsSwitch.js"],"sourcesContent":["import PropTypes from 'prop-types';\nimport { withStyles, Tooltip } from '@material-ui/core';\nimport
|
|
1
|
+
{"version":3,"file":"NonEngineeredWellsSwitch.js","sources":["../../../../../../src/components/OffsetWellPickerV2/components/Filter/NonEngineeredWellsSwitch.js"],"sourcesContent":["import PropTypes from 'prop-types';\nimport { withStyles, Tooltip } from '@material-ui/core';\nimport InfoOutlinedIcon from '@material-ui/icons/InfoOutlined';\n\nimport { Switch } from '~/componentsV2/Switch';\n\nconst muiStyles = theme => ({\n formControl: {\n display: 'flex',\n alignItems: 'flex-end',\n height: '100%',\n },\n nonEngineeredWrapper: {\n display: 'flex',\n height: '56px',\n alignItems: 'flex-end',\n marginLeft: '8px',\n },\n infoIcon: {\n marginLeft: '8px',\n marginBottom: '12px',\n fontSize: '13px',\n color: theme.palette.primary.text6,\n '&:hover': {\n color: theme.palette.primary.text1,\n },\n },\n infoTooltip: {\n fontSize: '12px',\n lineHeight: '16px',\n letterSpacing: '0.4px',\n color: theme.palette.primary.text1,\n minWidth: '314px',\n },\n tooltipContent: {\n display: 'flex',\n flexDirection: 'column',\n },\n});\n\nfunction NonEngineeredWellsSwitch({\n value,\n onChange,\n classes,\n 'data-testid': dataTestId = 'NonEngineeredWellsSwitch',\n}) {\n const handleChangeValue = checked => {\n onChange(checked);\n };\n\n return (\n <div className={classes.nonEngineeredWrapper}>\n <Switch\n testId={dataTestId}\n onLabel=\"Include Non-Verified Reference Wells\"\n checked={value}\n onChange={handleChangeValue}\n size=\"small\"\n className={classes.formControl}\n />\n <Tooltip\n title={\n <div className={classes.tooltipContent}>\n <span>\n Non-Verified Reference Wells have minimal data and are used for displaying drilling\n parameters only.\n </span>\n <span>Metrics & models from these wells can be inaccurate.</span>\n </div>\n }\n placement=\"bottom-start\"\n classes={{\n tooltip: classes.infoTooltip,\n }}\n >\n <InfoOutlinedIcon fontSize=\"small\" className={classes.infoIcon} />\n </Tooltip>\n </div>\n );\n}\n\nNonEngineeredWellsSwitch.propTypes = {\n value: PropTypes.bool.isRequired,\n onChange: PropTypes.func.isRequired,\n classes: PropTypes.shape({}).isRequired,\n 'data-testid': PropTypes.string,\n};\n\nexport default withStyles(muiStyles)(NonEngineeredWellsSwitch);\n"],"names":["NonEngineeredWellsSwitch","_ref","value","onChange","classes","_ref$dataTestid","dataTestId","_jsxs","className","nonEngineeredWrapper","children","_jsx","Switch","testId","onLabel","checked","size","formControl","Tooltip","title","jsxs","tooltipContent","jsx","placement","tooltip","infoTooltip","InfoOutlinedIcon","fontSize","infoIcon","propTypes","PropTypes","bool","isRequired","func","shape","string","NonEngineeredWellsSwitch$1","withStyles","theme","display","alignItems","height","marginLeft","marginBottom","color","palette","primary","text6","text1","lineHeight","letterSpacing","minWidth","flexDirection"],"mappings":"qSAwCA,SAASA,EAKNC,GAAA,IAJDC,IAAAA,MACAC,IAAAA,SACAC,IAAAA,QAAOC,EAAAJ,EACP,eAAeK,aAAa,2BAA0BD,EAMtD,OACEE,EAAAA,KAAA,MAAA,CAAKC,UAAWJ,EAAQK,qBAAqBC,SAAA,CAC3CC,MAACC,SAAM,CACLC,OAAQP,EACRQ,QAAQ,uCACRC,QAASb,EACTC,SAVoB,SAAAY,GACxBZ,EAASY,IAULC,KAAK,QACLR,UAAWJ,EAAQa,cAErBN,MAACO,UAAO,CACNC,MACEZ,EAAAa,KAAA,MAAA,CAAKZ,UAAWJ,EAAQiB,eAAeX,SACrC,CAAAC,EAAAW,IAAA,OAAA,CAAAZ,SAAA,yGAIAC,EAAAW,IAAA,OAAA,CAAAZ,SAAA,4DAGJa,UAAU,eACVnB,QAAS,CACPoB,QAASpB,EAAQqB,aACjBf,SAEFC,MAACe,UAAgB,CAACC,SAAS,QAAQnB,UAAWJ,EAAQwB,eAI9D,CAEA5B,EAAyB6B,UAAY,CACnC3B,MAAO4B,EAAAA,QAAUC,KAAKC,WACtB7B,SAAU2B,EAAAA,QAAUG,KAAKD,WACzB5B,QAAS0B,EAAS,QAACI,MAAM,CAAA,GAAIF,WAC7B,cAAeF,EAAS,QAACK,QAG3B,IAAAC,EAAeC,cAlFG,SAAAC,GAAK,MAAK,CAC1BrB,YAAa,CACXsB,QAAS,OACTC,WAAY,WACZC,OAAQ,QAEVhC,qBAAsB,CACpB8B,QAAS,OACTE,OAAQ,OACRD,WAAY,WACZE,WAAY,OAEdd,SAAU,CACRc,WAAY,MACZC,aAAc,OACdhB,SAAU,OACViB,MAAON,EAAMO,QAAQC,QAAQC,MAC7B,UAAW,CACTH,MAAON,EAAMO,QAAQC,QAAQE,QAGjCvB,YAAa,CACXE,SAAU,OACVsB,WAAY,OACZC,cAAe,QACfN,MAAON,EAAMO,QAAQC,QAAQE,MAC7BG,SAAU,SAEZ9B,eAAgB,CACdkB,QAAS,OACTa,cAAe,UAElB,GAkDcf,CAAsBrC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var e=require("react"),r=require("prop-types"),i=require("@material-ui/core"),
|
|
1
|
+
"use strict";var e=require("react"),r=require("prop-types"),i=require("@material-ui/core"),t=require("@material-ui/icons/ExpandMore"),u=require("@material-ui/icons/ExpandLess"),n=require("react/jsx-runtime");function o(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var l=o(r),s=o(t),a=o(u),d=function(e){var r=e.filtersHidden,t=e.onToggleFilters;return n.jsx("div",{children:n.jsx(i.Button,{endIcon:r?n.jsx(s.default,{}):n.jsx(a.default,{}),onClick:t,children:"Filters"})})};d.propTypes={filtersHidden:l.default.bool.isRequired,onToggleFilters:l.default.func.isRequired};var c=e.memo(d);module.exports=c;
|
|
2
2
|
//# sourceMappingURL=ToggleFiltersButton.js.map
|
package/cjs-bundle/components/OffsetWellPickerV2/components/Filter/ToggleFiltersButton.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":
|
|
1
|
+
{"version":3,"file":"ToggleFiltersButton.js","sources":["../../../../../../src/components/OffsetWellPickerV2/components/Filter/ToggleFiltersButton.js"],"sourcesContent":["import { memo } from 'react';\nimport PropTypes from 'prop-types';\nimport { Button } from '@material-ui/core';\nimport ExpandMoreIcon from '@material-ui/icons/ExpandMore';\nimport ExpandLessIcon from '@material-ui/icons/ExpandLess';\n\nconst ToggleFiltersButton = ({ filtersHidden, onToggleFilters }) => {\n return (\n <div>\n <Button\n endIcon={filtersHidden ? <ExpandMoreIcon /> : <ExpandLessIcon />}\n onClick={onToggleFilters}\n >\n Filters\n </Button>\n </div>\n );\n};\n\nToggleFiltersButton.propTypes = {\n filtersHidden: PropTypes.bool.isRequired,\n onToggleFilters: PropTypes.func.isRequired,\n};\n\nexport default memo(ToggleFiltersButton);\n"],"names":["ToggleFiltersButton","_ref","filtersHidden","onToggleFilters","_jsx","children","Button","endIcon","ExpandMoreIcon","jsx","ExpandLessIcon","onClick","propTypes","PropTypes","bool","isRequired","func","memo"],"mappings":"iTAMMA,EAAsB,SAAwCC,GAAA,IAArCC,IAAAA,cAAeC,IAAAA,gBAC5C,OACEC,EAAAA,IAAA,MAAA,CAAAC,SACED,MAACE,SAAM,CACLC,QAASL,EAAgBE,EAAAA,IAACI,EAAc,QAAG,CAAA,GAAGJ,EAACK,IAAAC,EAAc,QAAI,IACjEC,QAASR,EAAgBE,SAAA,aAMjC,EAEAL,EAAoBY,UAAY,CAC9BV,cAAeW,EAAAA,QAAUC,KAAKC,WAC9BZ,gBAAiBU,EAAAA,QAAUG,KAAKD,YAGlC,IAAeE,EAAAA,EAAAA,KAAKjB"}
|