@itwin/map-layers 6.0.0-dev.0 → 6.0.0-dev.2

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.
Files changed (93) hide show
  1. package/lib/cjs/ui/hooks/useCrossOriginPopup.d.ts +7 -0
  2. package/lib/cjs/ui/hooks/useCrossOriginPopup.d.ts.map +1 -0
  3. package/lib/cjs/ui/hooks/useCrossOriginPopup.js +123 -0
  4. package/lib/cjs/ui/hooks/useCrossOriginPopup.js.map +1 -0
  5. package/lib/cjs/ui/hooks/useInterval.d.ts +7 -0
  6. package/lib/cjs/ui/hooks/useInterval.d.ts.map +1 -0
  7. package/lib/cjs/ui/hooks/useInterval.js +60 -0
  8. package/lib/cjs/ui/hooks/useInterval.js.map +1 -0
  9. package/lib/cjs/ui/hooks/useResizeObserver.d.ts +2 -0
  10. package/lib/cjs/ui/hooks/useResizeObserver.d.ts.map +1 -0
  11. package/lib/cjs/ui/hooks/useResizeObserver.js +66 -0
  12. package/lib/cjs/ui/hooks/useResizeObserver.js.map +1 -0
  13. package/lib/cjs/ui/widget/AttachLayerPopupButton.d.ts.map +1 -1
  14. package/lib/cjs/ui/widget/AttachLayerPopupButton.js +26 -34
  15. package/lib/cjs/ui/widget/AttachLayerPopupButton.js.map +1 -1
  16. package/lib/cjs/ui/widget/CustomParamsSettings.d.ts +5 -1
  17. package/lib/cjs/ui/widget/CustomParamsSettings.d.ts.map +1 -1
  18. package/lib/cjs/ui/widget/CustomParamsSettings.js +30 -8
  19. package/lib/cjs/ui/widget/CustomParamsSettings.js.map +1 -1
  20. package/lib/cjs/ui/widget/FeatureInfoWidget.d.ts.map +1 -1
  21. package/lib/cjs/ui/widget/FeatureInfoWidget.js +5 -4
  22. package/lib/cjs/ui/widget/FeatureInfoWidget.js.map +1 -1
  23. package/lib/cjs/ui/widget/MapLayerDroppable.d.ts.map +1 -1
  24. package/lib/cjs/ui/widget/MapLayerDroppable.js +2 -2
  25. package/lib/cjs/ui/widget/MapLayerDroppable.js.map +1 -1
  26. package/lib/cjs/ui/widget/MapLayerSettingsPopupButton.d.ts.map +1 -1
  27. package/lib/cjs/ui/widget/MapLayerSettingsPopupButton.js +5 -25
  28. package/lib/cjs/ui/widget/MapLayerSettingsPopupButton.js.map +1 -1
  29. package/lib/cjs/ui/widget/MapLayerSettingsPopupButton.scss +2 -2
  30. package/lib/cjs/ui/widget/MapManagerSettings.d.ts +5 -1
  31. package/lib/cjs/ui/widget/MapManagerSettings.d.ts.map +1 -1
  32. package/lib/cjs/ui/widget/MapManagerSettings.js +9 -7
  33. package/lib/cjs/ui/widget/MapManagerSettings.js.map +1 -1
  34. package/lib/cjs/ui/widget/MapUrlDialog.d.ts +0 -1
  35. package/lib/cjs/ui/widget/MapUrlDialog.d.ts.map +1 -1
  36. package/lib/cjs/ui/widget/MapUrlDialog.js +2 -3
  37. package/lib/cjs/ui/widget/MapUrlDialog.js.map +1 -1
  38. package/lib/cjs/ui/widget/SubLayersPopupButton.d.ts.map +1 -1
  39. package/lib/cjs/ui/widget/SubLayersPopupButton.js +1 -13
  40. package/lib/cjs/ui/widget/SubLayersPopupButton.js.map +1 -1
  41. package/lib/cjs/ui/widget/SubLayersTree.d.ts.map +1 -1
  42. package/lib/cjs/ui/widget/SubLayersTree.js +9 -11
  43. package/lib/cjs/ui/widget/SubLayersTree.js.map +1 -1
  44. package/lib/cjs/ui/widget/TransparencyPopupButton.d.ts.map +1 -1
  45. package/lib/cjs/ui/widget/TransparencyPopupButton.js +4 -10
  46. package/lib/cjs/ui/widget/TransparencyPopupButton.js.map +1 -1
  47. package/lib/esm/ui/hooks/useCrossOriginPopup.d.ts +7 -0
  48. package/lib/esm/ui/hooks/useCrossOriginPopup.d.ts.map +1 -0
  49. package/lib/esm/ui/hooks/useCrossOriginPopup.js +96 -0
  50. package/lib/esm/ui/hooks/useCrossOriginPopup.js.map +1 -0
  51. package/lib/esm/ui/hooks/useInterval.d.ts +7 -0
  52. package/lib/esm/ui/hooks/useInterval.d.ts.map +1 -0
  53. package/lib/esm/ui/hooks/useInterval.js +33 -0
  54. package/lib/esm/ui/hooks/useInterval.js.map +1 -0
  55. package/lib/esm/ui/hooks/useResizeObserver.d.ts +2 -0
  56. package/lib/esm/ui/hooks/useResizeObserver.d.ts.map +1 -0
  57. package/lib/esm/ui/hooks/useResizeObserver.js +39 -0
  58. package/lib/esm/ui/hooks/useResizeObserver.js.map +1 -0
  59. package/lib/esm/ui/widget/AttachLayerPopupButton.d.ts.map +1 -1
  60. package/lib/esm/ui/widget/AttachLayerPopupButton.js +27 -35
  61. package/lib/esm/ui/widget/AttachLayerPopupButton.js.map +1 -1
  62. package/lib/esm/ui/widget/CustomParamsSettings.d.ts +5 -1
  63. package/lib/esm/ui/widget/CustomParamsSettings.d.ts.map +1 -1
  64. package/lib/esm/ui/widget/CustomParamsSettings.js +30 -8
  65. package/lib/esm/ui/widget/CustomParamsSettings.js.map +1 -1
  66. package/lib/esm/ui/widget/FeatureInfoWidget.d.ts.map +1 -1
  67. package/lib/esm/ui/widget/FeatureInfoWidget.js +5 -4
  68. package/lib/esm/ui/widget/FeatureInfoWidget.js.map +1 -1
  69. package/lib/esm/ui/widget/MapLayerDroppable.d.ts.map +1 -1
  70. package/lib/esm/ui/widget/MapLayerDroppable.js +2 -2
  71. package/lib/esm/ui/widget/MapLayerDroppable.js.map +1 -1
  72. package/lib/esm/ui/widget/MapLayerSettingsPopupButton.d.ts.map +1 -1
  73. package/lib/esm/ui/widget/MapLayerSettingsPopupButton.js +7 -27
  74. package/lib/esm/ui/widget/MapLayerSettingsPopupButton.js.map +1 -1
  75. package/lib/esm/ui/widget/MapLayerSettingsPopupButton.scss +2 -2
  76. package/lib/esm/ui/widget/MapManagerSettings.d.ts +5 -1
  77. package/lib/esm/ui/widget/MapManagerSettings.d.ts.map +1 -1
  78. package/lib/esm/ui/widget/MapManagerSettings.js +10 -8
  79. package/lib/esm/ui/widget/MapManagerSettings.js.map +1 -1
  80. package/lib/esm/ui/widget/MapUrlDialog.d.ts +0 -1
  81. package/lib/esm/ui/widget/MapUrlDialog.d.ts.map +1 -1
  82. package/lib/esm/ui/widget/MapUrlDialog.js +1 -2
  83. package/lib/esm/ui/widget/MapUrlDialog.js.map +1 -1
  84. package/lib/esm/ui/widget/SubLayersPopupButton.d.ts.map +1 -1
  85. package/lib/esm/ui/widget/SubLayersPopupButton.js +3 -15
  86. package/lib/esm/ui/widget/SubLayersPopupButton.js.map +1 -1
  87. package/lib/esm/ui/widget/SubLayersTree.d.ts.map +1 -1
  88. package/lib/esm/ui/widget/SubLayersTree.js +10 -12
  89. package/lib/esm/ui/widget/SubLayersTree.js.map +1 -1
  90. package/lib/esm/ui/widget/TransparencyPopupButton.d.ts.map +1 -1
  91. package/lib/esm/ui/widget/TransparencyPopupButton.js +6 -12
  92. package/lib/esm/ui/widget/TransparencyPopupButton.js.map +1 -1
  93. package/package.json +18 -56
@@ -1 +1 @@
1
- {"version":3,"file":"AttachLayerPopupButton.js","sourceRoot":"","sources":["../../../../src/ui/widget/AttachLayerPopupButton.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;gGAGgG;AAChG,6CAA+B;AAC/B,0DAAyD;AACzD,oDAAiD;AACjD,wDAAoI;AACpI,0DAA4C;AAC5C,oEAAwE;AACxE,wDAAuG;AACvG,mEAAgE;AAChE,+CAA8C;AAC9C,iEAA8D;AAC9D,uDAAwD;AACxD,uEAAoE;AACpE,iDAA8C;AAK9C,mCAAmC;AAEnC,IAAK,WAGJ;AAHD,WAAK,WAAW;IACd,2CAAG,CAAA;IACH,6CAAI,CAAA;AACN,CAAC,EAHI,WAAW,KAAX,WAAW,QAGf;AAQD,SAAS,gBAAgB,CAAC,EAAE,SAAS,EAAE,eAAe,EAAE,oBAAoB,EAAyB;IACnG,MAAM,CAAC,cAAc,EAAE,iBAAiB,CAAC,GAAG,KAAK,CAAC,QAAQ,EAAsB,CAAC;IACjF,MAAM,CAAC,kBAAkB,EAAE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AE,KAAK,EACnB,kBAAkB,EAAE,KAAK,YAEzB,gCAAK,GAAG,EAAE,QAAQ,EAAE,SAAS,EAAC,yBAAyB,YACrD,uBAAC,gBAAgB,IAAC,SAAS,EAAE,KAAK,CAAC,SAAS,EAAE,eAAe,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,qBAAqB,GAAI,GAC/H,GAEO,IACd,CACJ,CAAC;AACJ,CAAC;AAhID,wDAgIC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\nimport * as React from \"react\";\nimport { RelativePosition } from \"@itwin/appui-abstract\";\nimport { UiFramework } from \"@itwin/appui-react\";\nimport { IModelApp, MapLayerSource, MapLayerSourceStatus, NotifyMessageDetails, OutputMessagePriority } from \"@itwin/core-frontend\";\nimport * as UiCore from \"@itwin/core-react\";\nimport { SvgAdd, SvgDelete, SvgEdit } from \"@itwin/itwinui-icons-react\";\nimport { Button, IconButton, Input, List, ListItem, ProgressRadial, Text } from \"@itwin/itwinui-react\";\nimport { MapLayerPreferences } from \"../../MapLayerPreferences\";\nimport { MapLayersUI } from \"../../mapLayers\";\nimport { ConfirmMessageDialog } from \"./ConfirmMessageDialog\";\nimport { useSourceMapContext } from \"./MapLayerManager\";\nimport { MapSelectFeaturesDialog } from \"./MapSelectFeaturesDialog\";\nimport { MapUrlDialog } from \"./MapUrlDialog\";\n\nimport type { MapSubLayerProps } from \"@itwin/core-common\";\nimport type { MapLayerSourceValidation } from \"@itwin/core-frontend\";\nimport type { SourceState } from \"./MapUrlDialog\";\n// cSpell:ignore droppable Sublayer\n\nenum LayerAction {\n New,\n Edit,\n}\n\ninterface AttachLayerPanelProps {\n isOverlay: boolean;\n onLayerAttached: () => void;\n onHandleOutsideClick?: (shouldHandle: boolean) => void;\n}\n\nfunction AttachLayerPanel({ isOverlay, onLayerAttached, onHandleOutsideClick }: AttachLayerPanelProps) {\n const [layerNameToAdd, setLayerNameToAdd] = React.useState<string | undefined>();\n const [sourceFilterString, setSourceFilterString] = React.useState<string | undefined>();\n\n const {\n placeholderLabel,\n addCustomLayerLabel,\n addCustomLayerToolTip,\n loadingMapSources,\n removeLayerDefButtonTitle,\n editLayerDefButtonTitle,\n removeLayerDefDialogTitle,\n } = React.useMemo(() => {\n return {\n placeholderLabel: MapLayersUI.localization.getLocalizedString(\"mapLayers:CustomAttach.SearchPlaceholder\"),\n addCustomLayerLabel: MapLayersUI.localization.getLocalizedString(\"mapLayers:CustomAttach.Custom\"),\n addCustomLayerToolTip: MapLayersUI.localization.getLocalizedString(\"mapLayers:CustomAttach.AttachCustomLayer\"),\n loadingMapSources: MapLayersUI.localization.getLocalizedString(\"mapLayers:CustomAttach.LoadingMapSources\"),\n removeLayerDefButtonTitle: MapLayersUI.localization.getLocalizedString(\"mapLayers:CustomAttach.RemoveLayerDefButtonTitle\"),\n editLayerDefButtonTitle: MapLayersUI.localization.getLocalizedString(\"mapLayers:CustomAttach.EditLayerDefButtonTitle\"),\n removeLayerDefDialogTitle: MapLayersUI.localization.getLocalizedString(\"mapLayers:CustomAttach.RemoveLayerDefDialogTitle\"),\n };\n }, []);\n\n const [loading, setLoading] = React.useState(false);\n const [layerNameUnderCursor, setLayerNameUnderCursor] = React.useState<string | undefined>();\n\n const resumeOutsideClick = React.useCallback(() => {\n if (onHandleOutsideClick) {\n onHandleOutsideClick(true);\n }\n }, [onHandleOutsideClick]);\n\n // 'isMounted' is used to prevent any async operation once the hook has been\n // unloaded. Otherwise we get a 'Can't perform a React state update on an unmounted component.' warning in the console.\n const isMounted = React.useRef(false);\n React.useEffect(() => {\n isMounted.current = true;\n return () => {\n isMounted.current = false;\n\n // We close any open dialogs that we might have opened\n // This was added because the modal dialog remained remained displayed after the session expired.\n UiFramework.dialogs.modal.close();\n };\n }, []);\n\n const handleFilterTextChanged = React.useCallback((event: React.ChangeEvent<HTMLInputElement>) => {\n setSourceFilterString(event.target.value);\n }, []);\n\n const { loadingSources, sources, activeViewport, backgroundLayers, overlayLayers, mapLayerOptions } = useSourceMapContext();\n const iTwinId = activeViewport?.iModel?.iTwinId;\n const iModelId = activeViewport?.iModel?.iModelId;\n\n const attachLayer = React.useCallback(\n (source: MapLayerSource, subLayers: MapSubLayerProps[] | undefined, oneMapLayerPerSubLayer: boolean) => {\n if (activeViewport) {\n const generateUniqueMapLayerName = (layerName: string) => {\n let uniqueLayerName = layerName;\n let layerNameIdx = 1;\n while (\n (backgroundLayers && backgroundLayers.some((layer) => uniqueLayerName === layer.name)) ||\n (overlayLayers && overlayLayers.some((layer) => uniqueLayerName === layer.name))\n ) {\n uniqueLayerName = `${layerName} (${layerNameIdx++})`;\n }\n return { layerNameUpdate: layerNameIdx > 1, uniqueLayerName };\n };\n\n const doAttachLayer = (layerName: string, subLayer?: MapSubLayerProps) => {\n const generatedName = generateUniqueMapLayerName(layerName);\n let sourceToAdd = source;\n if (generatedName.layerNameUpdate || sourceToAdd.name !== generatedName.uniqueLayerName) {\n // create a source with a unique name\n const clonedSource = MapLayerSource.fromJSON({ ...source.toJSON(), name: generatedName.uniqueLayerName });\n if (clonedSource !== undefined) {\n clonedSource.userName = source.userName;\n clonedSource.password = source.password;\n clonedSource.unsavedQueryParams = { ...source.unsavedQueryParams };\n clonedSource.savedQueryParams = { ...source.savedQueryParams };\n sourceToAdd = clonedSource;\n }\n }\n\n const settings = sourceToAdd.toLayerSettings(subLayer ? [subLayer] : subLayers);\n if (settings) {\n activeViewport.displayStyle.attachMapLayer({ settings, mapLayerIndex: { index: -1, isOverlay } });\n return generatedName.uniqueLayerName;\n }\n return undefined;\n };\n\n if (oneMapLayerPerSubLayer && subLayers) {\n const layerNamesAttached: string[] = [];\n for (const subLayer of subLayers) {\n const attachedLayerName = doAttachLayer(`${source.name} - ${subLayer.name}`, subLayer);\n if (attachedLayerName !== undefined) {\n layerNamesAttached.push(attachedLayerName);\n }\n }\n\n if (layerNamesAttached.length > 0) {\n const msg = IModelApp.localization.getLocalizedString(\"mapLayers:Messages.MapLayersAttached\", { layerNames: layerNamesAttached.join(\", \") });\n IModelApp.notifications.outputMessage(new NotifyMessageDetails(OutputMessagePriority.Info, msg));\n }\n } else {\n const attachedLayerName = doAttachLayer(source.name, undefined);\n if (attachedLayerName !== undefined) {\n const msg = IModelApp.localization.getLocalizedString(\"mapLayers:Messages.MapLayerAttached\", { sourceName: attachedLayerName });\n IModelApp.notifications.outputMessage(new NotifyMessageDetails(OutputMessagePriority.Info, msg));\n }\n }\n\n if (isMounted.current) {\n setLoading(false);\n }\n }\n if (isMounted.current) {\n onLayerAttached();\n resumeOutsideClick();\n }\n },\n [activeViewport, backgroundLayers, isOverlay, onLayerAttached, overlayLayers, resumeOutsideClick],\n );\n\n const handleSelectFeaturesCancel = React.useCallback(() => {\n if (isMounted.current) {\n setLoading(false);\n }\n resumeOutsideClick();\n UiFramework.dialogs.modal.close();\n }, [resumeOutsideClick, setLoading]);\n\n const handleSelectFeaturesOk = React.useCallback(\n (source: MapLayerSource, sourceSubLayers: MapSubLayerProps[], selectedSubLayers: MapSubLayerProps[]) => {\n // keep only visible subLayers\n const visibleSubLayers = selectedSubLayers.filter((value) => value.visible);\n\n // Re-apply default visibility from the source validation\n visibleSubLayers.forEach((visible) => {\n const found = sourceSubLayers.find((value) => {\n visible.name === value.name;\n });\n if (found) {\n visible.visible = found?.visible;\n }\n });\n attachLayer(source, visibleSubLayers, true);\n },\n [attachLayer],\n );\n\n const openFeatureSelectionDialog = React.useCallback(\n (subLayers: MapSubLayerProps[], source: MapLayerSource) => {\n // Keep leafs sub-layers and force default visibility to false\n const noGroupLayers = subLayers.filter((value: MapSubLayerProps) => value.children === undefined);\n const visibleLayers = noGroupLayers.map((value: MapSubLayerProps) => {\n return { ...value, visible: false };\n });\n UiFramework.dialogs.modal.open(\n <MapSelectFeaturesDialog\n handleOk={(selectedLayers) => {\n handleSelectFeaturesOk(source, subLayers, selectedLayers);\n }}\n handleCancel={handleSelectFeaturesCancel}\n source={source}\n subLayers={visibleLayers}\n />,\n );\n },\n [handleSelectFeaturesCancel, handleSelectFeaturesOk],\n );\n\n const needsFeatureSelection = React.useCallback((source: MapLayerSource, validation: MapLayerSourceValidation) => {\n return (\n (source.formatId === \"ArcGISFeature\" || source.formatId === \"WMTS\") && // TODO, replace this with a flag in MapLayerSourceStatus\n validation.subLayers &&\n validation.subLayers.length > 1\n );\n }, []);\n\n const handleModalUrlDialogOk = React.useCallback(\n (action: LayerAction, sourceState?: SourceState) => {\n UiFramework.dialogs.modal.close();\n if (LayerAction.New === action && sourceState && sourceState.validation.status === MapLayerSourceStatus.Valid) {\n if (needsFeatureSelection(sourceState.source, sourceState.validation)) {\n openFeatureSelectionDialog(sourceState.validation.subLayers!, sourceState.source);\n } else {\n attachLayer(sourceState.source, sourceState.validation.subLayers, false);\n }\n } else {\n resumeOutsideClick();\n }\n },\n [attachLayer, needsFeatureSelection, openFeatureSelectionDialog, resumeOutsideClick],\n );\n\n const handleModalUrlDialogCancel = React.useCallback(() => {\n // close popup and refresh UI\n setLoading(false);\n UiFramework.dialogs.modal.close();\n resumeOutsideClick();\n }, [setLoading, resumeOutsideClick]);\n\n React.useEffect(() => {\n async function attemptToAddLayer() {\n if (layerNameToAdd && activeViewport) {\n // if the layer is not in the style add it now.\n const foundSource = sources?.find((source) => source.name === layerNameToAdd);\n if (foundSource === undefined) {\n return;\n }\n\n try {\n if (isMounted.current) {\n setLoading(true);\n }\n\n const sourceValidation = await foundSource.validateSource();\n if (sourceValidation.status === MapLayerSourceStatus.Valid || sourceValidation.status === MapLayerSourceStatus.RequireAuth) {\n if (sourceValidation.status === MapLayerSourceStatus.Valid) {\n if (sourceValidation.subLayers && needsFeatureSelection(foundSource, sourceValidation)) {\n openFeatureSelectionDialog(sourceValidation.subLayers, foundSource);\n if (onHandleOutsideClick) {\n onHandleOutsideClick(false);\n }\n } else {\n attachLayer(foundSource, sourceValidation.subLayers, false);\n }\n } else if (sourceValidation.status === MapLayerSourceStatus.RequireAuth && isMounted.current) {\n const layer = foundSource.toLayerSettings();\n if (layer) {\n UiFramework.dialogs.modal.open(\n <MapUrlDialog\n activeViewport={activeViewport}\n isOverlay={isOverlay}\n signInModeArgs={{ layer, validation: sourceValidation, source: foundSource }}\n onOkResult={(sourceState?: SourceState) => handleModalUrlDialogOk(LayerAction.New, sourceState)}\n onCancelResult={handleModalUrlDialogCancel}\n mapLayerOptions={mapLayerOptions}\n />,\n );\n }\n\n if (onHandleOutsideClick) {\n onHandleOutsideClick(false);\n }\n }\n } else {\n const msg = IModelApp.localization.getLocalizedString(\"mapLayers:Messages.MapLayerValidationFailed\", { sourceUrl: foundSource.url });\n IModelApp.notifications.outputMessage(new NotifyMessageDetails(OutputMessagePriority.Error, msg));\n if (isMounted.current) {\n setLoading(false);\n }\n }\n } catch (err) {\n if (isMounted.current) {\n setLoading(false);\n }\n const msg = IModelApp.localization.getLocalizedString(\"mapLayers:Messages.MapLayerAttachError\", { error: err, sourceName: foundSource.name });\n IModelApp.notifications.outputMessage(new NotifyMessageDetails(OutputMessagePriority.Error, msg));\n }\n }\n return;\n }\n\n attemptToAddLayer(); // eslint-disable-line @typescript-eslint/no-floating-promises\n\n if (isMounted.current) {\n setLayerNameToAdd(undefined);\n }\n }, [\n attachLayer,\n needsFeatureSelection,\n setLayerNameToAdd,\n layerNameToAdd,\n activeViewport,\n sources,\n backgroundLayers,\n isOverlay,\n overlayLayers,\n onLayerAttached,\n handleModalUrlDialogOk,\n handleSelectFeaturesCancel,\n handleSelectFeaturesOk,\n handleModalUrlDialogCancel,\n onHandleOutsideClick,\n openFeatureSelectionDialog,\n mapLayerOptions,\n ]);\n\n const options = React.useMemo(() => sources, [sources]);\n\n const filteredOptions = React.useMemo(() => {\n if (undefined === sourceFilterString || 0 === sourceFilterString.length) {\n return options;\n } else {\n return options?.filter((option) => option.name.toLowerCase().includes(sourceFilterString?.toLowerCase()));\n }\n }, [options, sourceFilterString]);\n\n const handleAddNewMapSource = React.useCallback(() => {\n UiFramework.dialogs.modal.open(\n <MapUrlDialog\n activeViewport={activeViewport}\n isOverlay={isOverlay}\n onOkResult={(result?: SourceState) => handleModalUrlDialogOk(LayerAction.New, result)}\n onCancelResult={handleModalUrlDialogCancel}\n mapLayerOptions={mapLayerOptions}\n />,\n );\n if (onHandleOutsideClick) {\n onHandleOutsideClick(false);\n }\n return;\n }, [activeViewport, handleModalUrlDialogCancel, handleModalUrlDialogOk, isOverlay, mapLayerOptions, onHandleOutsideClick]);\n\n const handleAttach = React.useCallback((mapName: string) => {\n setLayerNameToAdd(mapName);\n }, []);\n\n const handleNoConfirmation = React.useCallback(\n (_layerName: string) => {\n UiFramework.dialogs.modal.close();\n resumeOutsideClick();\n },\n [resumeOutsideClick],\n );\n\n const handleYesConfirmation = React.useCallback(\n async (source: MapLayerSource) => {\n const layerName = source.name;\n if (!!iTwinId) {\n try {\n await MapLayerPreferences.deleteByName(source, iTwinId, iModelId);\n const msg = MapLayersUI.localization.getLocalizedString(\"mapLayers:CustomAttach.RemoveLayerDefSuccess\", { layerName });\n IModelApp.notifications.outputMessage(new NotifyMessageDetails(OutputMessagePriority.Info, msg));\n } catch {\n const msg = MapLayersUI.localization.getLocalizedString(\"mapLayers:CustomAttach.RemoveLayerDefError\", { layerName });\n IModelApp.notifications.outputMessage(new NotifyMessageDetails(OutputMessagePriority.Error, msg));\n }\n }\n\n UiFramework.dialogs.modal.close();\n resumeOutsideClick();\n },\n [iTwinId, iModelId, resumeOutsideClick],\n );\n\n /*\n Handle Remove layer button clicked\n */\n const onItemRemoveButtonClicked = React.useCallback(\n (source: MapLayerSource, event: React.MouseEvent) => {\n event.stopPropagation(); // We don't want the owning ListBox to react on mouse click.\n\n const layerName = source.name;\n\n const msg = MapLayersUI.localization.getLocalizedString(\"mapLayers:CustomAttach.RemoveLayerDefDialogMessage\", { layerName });\n UiFramework.dialogs.modal.open(\n <ConfirmMessageDialog\n className=\"map-sources-delete-confirmation\"\n title={removeLayerDefDialogTitle}\n message={msg}\n maxWidth={400}\n opened\n onYesResult={async () => handleYesConfirmation(source)}\n onNoResult={() => handleNoConfirmation(layerName)}\n />,\n );\n if (onHandleOutsideClick) {\n onHandleOutsideClick(false);\n }\n },\n [handleNoConfirmation, handleYesConfirmation, onHandleOutsideClick, removeLayerDefDialogTitle],\n );\n\n /*\n Handle Edit layer button clicked\n */\n const onItemEditButtonClicked = React.useCallback(\n (event: React.MouseEvent) => {\n event.stopPropagation(); // We don't want the owning ListBox to react on mouse click.\n const targetLayerName = (event?.currentTarget?.parentNode as HTMLElement)?.textContent;\n const matchingSource = sources.find((layerSource) => layerSource.name === targetLayerName);\n\n // we expect a single layer source matching this name\n if (matchingSource === undefined) {\n return;\n }\n UiFramework.dialogs.modal.open(\n <MapUrlDialog\n activeViewport={activeViewport}\n isOverlay={isOverlay}\n mapLayerSourceToEdit={matchingSource}\n onOkResult={(result?: SourceState) => handleModalUrlDialogOk(LayerAction.Edit, result)}\n onCancelResult={handleModalUrlDialogCancel}\n mapLayerOptions={mapLayerOptions}\n />,\n );\n\n if (onHandleOutsideClick) {\n onHandleOutsideClick(false);\n }\n },\n [activeViewport, handleModalUrlDialogCancel, handleModalUrlDialogOk, isOverlay, mapLayerOptions, onHandleOutsideClick, sources],\n );\n\n return (\n <div className=\"map-manager-header\">\n {(loading || loadingSources) && (\n <ProgressRadial as=\"div\">\n <Text variant='small'>{loadingMapSources}</Text>\n </ProgressRadial>\n )}\n <div className=\"map-manager-source-listbox-header\">\n <Input\n type=\"text\"\n className=\"map-manager-source-list-filter\"\n placeholder={placeholderLabel}\n value={sourceFilterString}\n onChange={handleFilterTextChanged}\n size=\"small\"\n />\n <Button className=\"map-manager-add-source-button\" title={addCustomLayerToolTip} onClick={handleAddNewMapSource}>\n {addCustomLayerLabel}\n </Button>\n </div>\n <div className=\"map-manager-sources\">\n <List\n id=\"map-sources\"\n as=\"div\"\n className=\"map-manager-source-list\"\n >\n {filteredOptions?.map((source) => (\n <ListItem\n as=\"div\"\n key={source.name}\n className=\"map-source-list-entry\"\n actionable\n onClick={() => handleAttach(source.name)}\n onMouseEnter={() => setLayerNameUnderCursor(source.name)}\n onMouseLeave={() => setLayerNameUnderCursor(undefined)}\n >\n <ListItem.Content>{source.name}</ListItem.Content>\n {\n // Display the delete icon only when the mouse over a specific item\n // otherwise list feels cluttered.\n !!iTwinId && layerNameUnderCursor && layerNameUnderCursor === source.name && (\n <>\n <Button\n size=\"small\"\n styleType=\"borderless\"\n className=\"map-source-list-entry-button\"\n title={editLayerDefButtonTitle}\n onClick={onItemEditButtonClicked}\n >\n <SvgEdit />\n </Button>\n <Button\n size=\"small\"\n styleType=\"borderless\"\n className=\"map-source-list-entry-button\"\n title={removeLayerDefButtonTitle}\n onClick={(event: React.MouseEvent) => {\n onItemRemoveButtonClicked(source, event);\n }}\n >\n <SvgDelete />\n </Button>\n </>\n )\n }\n </ListItem>\n ))}\n </List>\n </div>\n </div>\n );\n}\n\n/** @internal */\nexport enum AttachLayerButtonType {\n Primary,\n Blue,\n Icon,\n}\nexport interface AttachLayerPopupButtonProps {\n isOverlay: boolean;\n buttonType?: AttachLayerButtonType;\n disabled?: boolean;\n}\n\n/** @internal */\nexport function AttachLayerPopupButton(props: AttachLayerPopupButtonProps) {\n const { showAttachLayerLabel, hideAttachLayerLabel, addCustomLayerButtonLabel } = React.useMemo(() => {\n return {\n showAttachLayerLabel: MapLayersUI.localization.getLocalizedString(\"mapLayers:AttachLayerPopup.Attach\"),\n hideAttachLayerLabel: MapLayersUI.localization.getLocalizedString(\"mapLayers:AttachLayerPopup.Close\"),\n addCustomLayerButtonLabel: MapLayersUI.localization.getLocalizedString(\"mapLayers:CustomAttach.AddCustomLayerButtonLabel\"),\n };\n }, []);\n\n const [handleOutsideClick, setHandleOutsideClick] = React.useState(true);\n const [popupOpen, setPopupOpen] = React.useState(false);\n const buttonRef = React.useRef<HTMLButtonElement>(null);\n const panelRef = React.useRef<HTMLDivElement>(null);\n\n // 'isMounted' is used to prevent any async operation once the hook has been\n // unloaded. Otherwise we get a 'Can't perform a React state update on an unmounted component.' warning in the console.\n const isMounted = React.useRef(false);\n React.useEffect(() => {\n isMounted.current = true;\n return () => {\n isMounted.current = false;\n };\n }, []);\n\n const togglePopup = React.useCallback(() => {\n setPopupOpen(!popupOpen);\n }, [popupOpen]);\n\n const handleClosePopup = React.useCallback(() => {\n setPopupOpen(false);\n }, []);\n\n const onHandleOutsideClick = React.useCallback(\n (event: MouseEvent) => {\n if (!handleOutsideClick) {\n return;\n }\n // If clicking on button that open panel - don't trigger outside click processing\n if (buttonRef?.current && buttonRef?.current.contains(event.target as Node)) {\n return;\n }\n\n // If clicking the panel, this is not an outside clicked\n if (panelRef.current && panelRef?.current.contains(event.target as Node)) {\n return;\n }\n\n // If we reach this point, we got an outside clicked, no close the popup\n setPopupOpen(false);\n },\n [handleOutsideClick],\n );\n\n const { refreshFromStyle } = useSourceMapContext();\n\n const handleLayerAttached = React.useCallback(() => {\n if (!isMounted.current) {\n return;\n }\n setPopupOpen(false);\n refreshFromStyle();\n }, [refreshFromStyle]);\n\n function renderButton(): React.ReactNode {\n let button: React.ReactNode;\n\n if (props.buttonType === undefined || props.buttonType === AttachLayerButtonType.Icon) {\n button = (\n <IconButton\n disabled={props.disabled}\n size=\"small\"\n styleType=\"borderless\"\n ref={buttonRef}\n className=\"map-manager-attach-layer-button\"\n label={popupOpen ? hideAttachLayerLabel : showAttachLayerLabel}\n onClick={togglePopup}\n >\n <SvgAdd />\n </IconButton>\n );\n } else {\n const determineStyleType = () => {\n switch (props.buttonType) {\n case AttachLayerButtonType.Blue:\n return \"high-visibility\";\n case AttachLayerButtonType.Primary:\n default:\n return \"cta\";\n }\n };\n const styleType = determineStyleType();\n button = (\n <Button\n disabled={props.disabled}\n ref={buttonRef}\n styleType={styleType}\n title={popupOpen ? hideAttachLayerLabel : showAttachLayerLabel}\n onClick={togglePopup}\n >\n {addCustomLayerButtonLabel}\n </Button>\n );\n }\n\n return button;\n }\n\n return (\n <>\n {renderButton()}\n {/*eslint-disable-next-line @typescript-eslint/no-deprecated */}\n <UiCore.Popup // TODO: Replace all deprecated UiCore components with iTwinUI components\n isOpen={popupOpen}\n position={RelativePosition.BottomRight}\n onClose={handleClosePopup}\n onOutsideClick={onHandleOutsideClick}\n closeOnWheel={false}\n target={buttonRef.current}\n closeOnEnter={false}\n closeOnContextMenu={false}\n >\n <div ref={panelRef} className=\"map-sources-popup-panel\">\n <AttachLayerPanel isOverlay={props.isOverlay} onLayerAttached={handleLayerAttached} onHandleOutsideClick={setHandleOutsideClick} />\n </div>\n {/*eslint-disable-next-line @typescript-eslint/no-deprecated */}\n </UiCore.Popup>\n </>\n );\n}\n"]}
1
+ {"version":3,"file":"AttachLayerPopupButton.js","sourceRoot":"","sources":["../../../../src/ui/widget/AttachLayerPopupButton.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;gGAGgG;AAChG,6CAA+B;AAC/B,oDAAiD;AACjD,wDAAoI;AACpI,oEAAwE;AACxE,wDAAgH;AAChH,mEAAgE;AAChE,+CAA8C;AAC9C,iEAA8D;AAC9D,uDAAwD;AACxD,uEAAoE;AACpE,iDAA8C;AAK9C,mCAAmC;AAEnC,IAAK,WAGJ;AAHD,WAAK,WAAW;IACd,2CAAG,CAAA;IACH,6CAAI,CAAA;AACN,CAAC,EAHI,WAAW,KAAX,WAAW,QAGf;AASD,SAAS,gBAAgB,CAAC,EAAE,SAAS,EAAE,eAAe,EAAE,oBAAoB,EAAE,kBAAkB,EAAwB;IACtH,MAAM,CAAC,cAAc,EAAE,iBAAiB,CAAC,GAAG,KAAK,CAAC,QAAQ,EAAsB,CAAC;IACjF,MAAM,CAAC,kBAAkB,EAAE,qBAAqB,CAAC,GAAG,KAAK,CAAC,QAAQ,EAAsB,CAAC;IAEzF,MAAM,EACJ,gBAAgB,EAChB,mBAAmB,EACnB,qBAAqB,EACrB,iBAAiB,EACjB,yBAAyB,EACzB,uBAAuB,EACvB,yBAA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aAAM,CAAC;YACN,MAAM,kBAAkB,GAAG,GAAG,EAAE;gBAC9B,QAAQ,KAAK,CAAC,UAAU,EAAE,CAAC;oBACzB,KAAK,qBAAqB,CAAC,IAAI;wBAC7B,OAAO,iBAAiB,CAAC;oBAC3B,KAAK,qBAAqB,CAAC,OAAO,CAAC;oBACnC;wBACE,OAAO,KAAK,CAAC;gBACjB,CAAC;YACH,CAAC,CAAC;YACF,MAAM,SAAS,GAAG,kBAAkB,EAAE,CAAC;YACvC,MAAM,GAAG,CACP,uBAAC,sBAAM,IACL,QAAQ,EAAE,KAAK,CAAC,QAAQ,EACxB,GAAG,EAAE,SAAS,EACd,SAAS,EAAE,SAAS,EACpB,KAAK,EAAE,SAAS,CAAC,CAAC,CAAC,oBAAoB,CAAC,CAAC,CAAC,oBAAoB,EAC9D,OAAO,EAAE,WAAW,YAEnB,yBAAyB,GACnB,CACV,CAAC;QACJ,CAAC;QAED,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,OAAO,CACL,2DACE,uBAAC,uBAAO,IACN,OAAO,EACL,gCAAK,GAAG,EAAE,QAAQ,EAAE,SAAS,EAAC,yBAAyB,YACrD,uBAAC,gBAAgB,IAAC,SAAS,EAAE,KAAK,CAAC,SAAS,EAAE,eAAe,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,kBAAkB,EAAE,kBAAkB,GAAI,GACvK,EAER,eAAe,QACf,OAAO,EAAE,SAAS,IAAI,eAAe,EACrC,eAAe,EAAE,YAAY,EAC7B,mBAAmB,EAAE,kBAAkB,EACvC,SAAS,EAAE,YAAY,YAEtB,YAAY,EAAE,GACP,GACT,CACJ,CAAC;AACJ,CAAC;AAtGD,wDAsGC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\nimport * as React from \"react\";\nimport { UiFramework } from \"@itwin/appui-react\";\nimport { IModelApp, MapLayerSource, MapLayerSourceStatus, NotifyMessageDetails, OutputMessagePriority } from \"@itwin/core-frontend\";\nimport { SvgAdd, SvgDelete, SvgEdit } from \"@itwin/itwinui-icons-react\";\nimport { Button, IconButton, Input, List, ListItem, Popover, ProgressRadial, Text } from \"@itwin/itwinui-react\";\nimport { MapLayerPreferences } from \"../../MapLayerPreferences\";\nimport { MapLayersUI } from \"../../mapLayers\";\nimport { ConfirmMessageDialog } from \"./ConfirmMessageDialog\";\nimport { useSourceMapContext } from \"./MapLayerManager\";\nimport { MapSelectFeaturesDialog } from \"./MapSelectFeaturesDialog\";\nimport { MapUrlDialog } from \"./MapUrlDialog\";\n\nimport type { MapSubLayerProps } from \"@itwin/core-common\";\nimport type { MapLayerSourceValidation } from \"@itwin/core-frontend\";\nimport type { SourceState } from \"./MapUrlDialog\";\n// cSpell:ignore droppable Sublayer\n\nenum LayerAction {\n New,\n Edit,\n}\n\ninterface AttachLayerPanelProps {\n isOverlay: boolean;\n onLayerAttached: () => void;\n onHandleOutsideClick?: (shouldHandle: boolean) => void;\n setMapUrlModalOpen: (open: boolean) => void;\n}\n\nfunction AttachLayerPanel({ isOverlay, onLayerAttached, onHandleOutsideClick, setMapUrlModalOpen}: AttachLayerPanelProps) {\n const [layerNameToAdd, setLayerNameToAdd] = React.useState<string | undefined>();\n const [sourceFilterString, setSourceFilterString] = React.useState<string | undefined>();\n\n const {\n placeholderLabel,\n addCustomLayerLabel,\n addCustomLayerToolTip,\n loadingMapSources,\n removeLayerDefButtonTitle,\n editLayerDefButtonTitle,\n removeLayerDefDialogTitle,\n } = React.useMemo(() => {\n return {\n placeholderLabel: MapLayersUI.localization.getLocalizedString(\"mapLayers:CustomAttach.SearchPlaceholder\"),\n addCustomLayerLabel: MapLayersUI.localization.getLocalizedString(\"mapLayers:CustomAttach.Custom\"),\n addCustomLayerToolTip: MapLayersUI.localization.getLocalizedString(\"mapLayers:CustomAttach.AttachCustomLayer\"),\n loadingMapSources: MapLayersUI.localization.getLocalizedString(\"mapLayers:CustomAttach.LoadingMapSources\"),\n removeLayerDefButtonTitle: MapLayersUI.localization.getLocalizedString(\"mapLayers:CustomAttach.RemoveLayerDefButtonTitle\"),\n editLayerDefButtonTitle: MapLayersUI.localization.getLocalizedString(\"mapLayers:CustomAttach.EditLayerDefButtonTitle\"),\n removeLayerDefDialogTitle: MapLayersUI.localization.getLocalizedString(\"mapLayers:CustomAttach.RemoveLayerDefDialogTitle\"),\n };\n }, []);\n\n const [loading, setLoading] = React.useState(false);\n const [layerNameUnderCursor, setLayerNameUnderCursor] = React.useState<string | undefined>();\n\n const resumeOutsideClick = React.useCallback(() => {\n if (onHandleOutsideClick) {\n onHandleOutsideClick(true);\n }\n }, [onHandleOutsideClick]);\n\n // 'isMounted' is used to prevent any async operation once the hook has been\n // unloaded. Otherwise we get a 'Can't perform a React state update on an unmounted component.' warning in the console.\n const isMounted = React.useRef(false);\n React.useEffect(() => {\n isMounted.current = true;\n return () => {\n isMounted.current = false;\n\n // We close any open dialogs that we might have opened\n // This was added because the modal dialog remained remained displayed after the session expired.\n UiFramework.dialogs.modal.close();\n };\n }, []);\n\n const handleFilterTextChanged = React.useCallback((event: React.ChangeEvent<HTMLInputElement>) => {\n setSourceFilterString(event.target.value);\n }, []);\n\n const { loadingSources, sources, activeViewport, backgroundLayers, overlayLayers, mapLayerOptions } = useSourceMapContext();\n const iTwinId = activeViewport?.iModel?.iTwinId;\n const iModelId = activeViewport?.iModel?.iModelId;\n\n const attachLayer = React.useCallback(\n (source: MapLayerSource, subLayers: MapSubLayerProps[] | undefined, oneMapLayerPerSubLayer: boolean) => {\n if (activeViewport) {\n const generateUniqueMapLayerName = (layerName: string) => {\n let uniqueLayerName = layerName;\n let layerNameIdx = 1;\n while (\n (backgroundLayers && backgroundLayers.some((layer) => uniqueLayerName === layer.name)) ||\n (overlayLayers && overlayLayers.some((layer) => uniqueLayerName === layer.name))\n ) {\n uniqueLayerName = `${layerName} (${layerNameIdx++})`;\n }\n return { layerNameUpdate: layerNameIdx > 1, uniqueLayerName };\n };\n\n const doAttachLayer = (layerName: string, subLayer?: MapSubLayerProps) => {\n const generatedName = generateUniqueMapLayerName(layerName);\n let sourceToAdd = source;\n if (generatedName.layerNameUpdate || sourceToAdd.name !== generatedName.uniqueLayerName) {\n // create a source with a unique name\n const clonedSource = MapLayerSource.fromJSON({ ...source.toJSON(), name: generatedName.uniqueLayerName });\n if (clonedSource !== undefined) {\n clonedSource.userName = source.userName;\n clonedSource.password = source.password;\n clonedSource.unsavedQueryParams = { ...source.unsavedQueryParams };\n clonedSource.savedQueryParams = { ...source.savedQueryParams };\n sourceToAdd = clonedSource;\n }\n }\n\n const settings = sourceToAdd.toLayerSettings(subLayer ? [subLayer] : subLayers);\n if (settings) {\n activeViewport.displayStyle.attachMapLayer({ settings, mapLayerIndex: { index: -1, isOverlay } });\n return generatedName.uniqueLayerName;\n }\n return undefined;\n };\n\n if (oneMapLayerPerSubLayer && subLayers) {\n const layerNamesAttached: string[] = [];\n for (const subLayer of subLayers) {\n const attachedLayerName = doAttachLayer(`${source.name} - ${subLayer.name}`, subLayer);\n if (attachedLayerName !== undefined) {\n layerNamesAttached.push(attachedLayerName);\n }\n }\n\n if (layerNamesAttached.length > 0) {\n const msg = IModelApp.localization.getLocalizedString(\"mapLayers:Messages.MapLayersAttached\", { layerNames: layerNamesAttached.join(\", \") });\n IModelApp.notifications.outputMessage(new NotifyMessageDetails(OutputMessagePriority.Info, msg));\n }\n } else {\n const attachedLayerName = doAttachLayer(source.name, undefined);\n if (attachedLayerName !== undefined) {\n const msg = IModelApp.localization.getLocalizedString(\"mapLayers:Messages.MapLayerAttached\", { sourceName: attachedLayerName });\n IModelApp.notifications.outputMessage(new NotifyMessageDetails(OutputMessagePriority.Info, msg));\n }\n }\n\n if (isMounted.current) {\n setLoading(false);\n }\n }\n if (isMounted.current) {\n onLayerAttached();\n resumeOutsideClick();\n }\n },\n [activeViewport, backgroundLayers, isOverlay, onLayerAttached, overlayLayers, resumeOutsideClick],\n );\n\n const handleSelectFeaturesCancel = React.useCallback(() => {\n if (isMounted.current) {\n setLoading(false);\n }\n resumeOutsideClick();\n UiFramework.dialogs.modal.close();\n }, [resumeOutsideClick, setLoading]);\n\n const handleSelectFeaturesOk = React.useCallback(\n (source: MapLayerSource, sourceSubLayers: MapSubLayerProps[], selectedSubLayers: MapSubLayerProps[]) => {\n // keep only visible subLayers\n const visibleSubLayers = selectedSubLayers.filter((value) => value.visible);\n\n // Re-apply default visibility from the source validation\n visibleSubLayers.forEach((visible) => {\n const found = sourceSubLayers.find((value) => {\n visible.name === value.name;\n });\n if (found) {\n visible.visible = found?.visible;\n }\n });\n attachLayer(source, visibleSubLayers, true);\n },\n [attachLayer],\n );\n\n const openFeatureSelectionDialog = React.useCallback(\n (subLayers: MapSubLayerProps[], source: MapLayerSource) => {\n // Keep leafs sub-layers and force default visibility to false\n const noGroupLayers = subLayers.filter((value: MapSubLayerProps) => value.children === undefined);\n const visibleLayers = noGroupLayers.map((value: MapSubLayerProps) => {\n return { ...value, visible: false };\n });\n UiFramework.dialogs.modal.open(\n <MapSelectFeaturesDialog\n handleOk={(selectedLayers) => {\n handleSelectFeaturesOk(source, subLayers, selectedLayers);\n }}\n handleCancel={handleSelectFeaturesCancel}\n source={source}\n subLayers={visibleLayers}\n />,\n );\n },\n [handleSelectFeaturesCancel, handleSelectFeaturesOk],\n );\n\n const needsFeatureSelection = React.useCallback((source: MapLayerSource, validation: MapLayerSourceValidation) => {\n return (\n (source.formatId === \"ArcGISFeature\" || source.formatId === \"WMTS\") && // TODO, replace this with a flag in MapLayerSourceStatus\n validation.subLayers &&\n validation.subLayers.length > 1\n );\n }, []);\n\n const handleModalUrlDialogOk = React.useCallback(\n (action: LayerAction, sourceState?: SourceState) => {\n setMapUrlModalOpen(false);\n UiFramework.dialogs.modal.close();\n if (LayerAction.New === action && sourceState && sourceState.validation.status === MapLayerSourceStatus.Valid) {\n if (needsFeatureSelection(sourceState.source, sourceState.validation)) {\n openFeatureSelectionDialog(sourceState.validation.subLayers!, sourceState.source);\n } else {\n attachLayer(sourceState.source, sourceState.validation.subLayers, false);\n }\n } else {\n resumeOutsideClick();\n }\n },\n [attachLayer, needsFeatureSelection, openFeatureSelectionDialog, resumeOutsideClick, setMapUrlModalOpen],\n );\n\n const handleModalUrlDialogCancel = React.useCallback(() => {\n // close popup and refresh UI\n setLoading(false);\n setMapUrlModalOpen(false);\n UiFramework.dialogs.modal.close();\n resumeOutsideClick();\n }, [setLoading, resumeOutsideClick, setMapUrlModalOpen]);\n\n React.useEffect(() => {\n async function attemptToAddLayer() {\n if (layerNameToAdd && activeViewport) {\n // if the layer is not in the style add it now.\n const foundSource = sources?.find((source) => source.name === layerNameToAdd);\n if (foundSource === undefined) {\n return;\n }\n\n try {\n if (isMounted.current) {\n setLoading(true);\n }\n\n const sourceValidation = await foundSource.validateSource();\n if (sourceValidation.status === MapLayerSourceStatus.Valid || sourceValidation.status === MapLayerSourceStatus.RequireAuth) {\n if (sourceValidation.status === MapLayerSourceStatus.Valid) {\n if (sourceValidation.subLayers && needsFeatureSelection(foundSource, sourceValidation)) {\n openFeatureSelectionDialog(sourceValidation.subLayers, foundSource);\n if (onHandleOutsideClick) {\n onHandleOutsideClick(false);\n }\n } else {\n attachLayer(foundSource, sourceValidation.subLayers, false);\n }\n } else if (sourceValidation.status === MapLayerSourceStatus.RequireAuth && isMounted.current) {\n const layer = foundSource.toLayerSettings();\n if (layer) {\n setMapUrlModalOpen(true);\n UiFramework.dialogs.modal.open(\n <MapUrlDialog\n activeViewport={activeViewport}\n signInModeArgs={{ layer, validation: sourceValidation, source: foundSource }}\n onOkResult={(sourceState?: SourceState) => handleModalUrlDialogOk(LayerAction.New, sourceState)}\n onCancelResult={handleModalUrlDialogCancel}\n mapLayerOptions={mapLayerOptions}\n />,\n );\n }\n\n if (onHandleOutsideClick) {\n onHandleOutsideClick(false);\n }\n }\n } else {\n const msg = IModelApp.localization.getLocalizedString(\"mapLayers:Messages.MapLayerValidationFailed\", { sourceUrl: foundSource.url });\n IModelApp.notifications.outputMessage(new NotifyMessageDetails(OutputMessagePriority.Error, msg));\n if (isMounted.current) {\n setLoading(false);\n }\n }\n } catch (err) {\n if (isMounted.current) {\n setLoading(false);\n }\n const msg = IModelApp.localization.getLocalizedString(\"mapLayers:Messages.MapLayerAttachError\", { error: err, sourceName: foundSource.name });\n IModelApp.notifications.outputMessage(new NotifyMessageDetails(OutputMessagePriority.Error, msg));\n }\n }\n return;\n }\n\n attemptToAddLayer(); // eslint-disable-line @typescript-eslint/no-floating-promises\n\n if (isMounted.current) {\n setLayerNameToAdd(undefined);\n }\n }, [\n attachLayer,\n needsFeatureSelection,\n setLayerNameToAdd,\n layerNameToAdd,\n activeViewport,\n sources,\n backgroundLayers,\n isOverlay,\n overlayLayers,\n onLayerAttached,\n handleModalUrlDialogOk,\n handleSelectFeaturesCancel,\n handleSelectFeaturesOk,\n handleModalUrlDialogCancel,\n onHandleOutsideClick,\n openFeatureSelectionDialog,\n mapLayerOptions,\n setMapUrlModalOpen,\n ]);\n\n const options = React.useMemo(() => sources, [sources]);\n\n const filteredOptions = React.useMemo(() => {\n if (undefined === sourceFilterString || 0 === sourceFilterString.length) {\n return options;\n } else {\n return options?.filter((option) => option.name.toLowerCase().includes(sourceFilterString?.toLowerCase()));\n }\n }, [options, sourceFilterString]);\n\n const handleAddNewMapSource = React.useCallback((event: React.MouseEvent) => {\n event.stopPropagation(); // We don't want the owning ListBox to react on mouse click.\n setMapUrlModalOpen(true);\n UiFramework.dialogs.modal.open(\n <MapUrlDialog\n activeViewport={activeViewport}\n onOkResult={(result?: SourceState) => handleModalUrlDialogOk(LayerAction.New, result)}\n onCancelResult={handleModalUrlDialogCancel}\n mapLayerOptions={mapLayerOptions}\n />,\n );\n if (onHandleOutsideClick) {\n onHandleOutsideClick(false);\n }\n}, [activeViewport, handleModalUrlDialogCancel, handleModalUrlDialogOk, mapLayerOptions, onHandleOutsideClick, setMapUrlModalOpen]);\n\n const handleAttach = React.useCallback((mapName: string) => {\n setLayerNameToAdd(mapName);\n }, []);\n\n const handleNoConfirmation = React.useCallback(\n (_layerName: string) => {\n UiFramework.dialogs.modal.close();\n resumeOutsideClick();\n },\n [resumeOutsideClick],\n );\n\n const handleYesConfirmation = React.useCallback(\n async (source: MapLayerSource) => {\n const layerName = source.name;\n if (!!iTwinId) {\n try {\n await MapLayerPreferences.deleteByName(source, iTwinId, iModelId);\n const msg = MapLayersUI.localization.getLocalizedString(\"mapLayers:CustomAttach.RemoveLayerDefSuccess\", { layerName });\n IModelApp.notifications.outputMessage(new NotifyMessageDetails(OutputMessagePriority.Info, msg));\n } catch {\n const msg = MapLayersUI.localization.getLocalizedString(\"mapLayers:CustomAttach.RemoveLayerDefError\", { layerName });\n IModelApp.notifications.outputMessage(new NotifyMessageDetails(OutputMessagePriority.Error, msg));\n }\n }\n\n UiFramework.dialogs.modal.close();\n resumeOutsideClick();\n },\n [iTwinId, iModelId, resumeOutsideClick],\n );\n\n /*\n Handle Remove layer button clicked\n */\n const onItemRemoveButtonClicked = React.useCallback(\n (source: MapLayerSource, event: React.MouseEvent) => {\n event.stopPropagation(); // We don't want the owning ListBox to react on mouse click.\n\n const layerName = source.name;\n\n const msg = MapLayersUI.localization.getLocalizedString(\"mapLayers:CustomAttach.RemoveLayerDefDialogMessage\", { layerName });\n UiFramework.dialogs.modal.open(\n <ConfirmMessageDialog\n className=\"map-sources-delete-confirmation\"\n title={removeLayerDefDialogTitle}\n message={msg}\n maxWidth={400}\n opened\n onYesResult={async () => handleYesConfirmation(source)}\n onNoResult={() => handleNoConfirmation(layerName)}\n />,\n );\n if (onHandleOutsideClick) {\n onHandleOutsideClick(false);\n }\n },\n [handleNoConfirmation, handleYesConfirmation, onHandleOutsideClick, removeLayerDefDialogTitle],\n );\n\n /*\n Handle Edit layer button clicked\n */\n const onItemEditButtonClicked = React.useCallback(\n (event: React.MouseEvent) => {\n event.stopPropagation(); // We don't want the owning ListBox to react on mouse click.\n const targetLayerName = (event?.currentTarget?.parentNode as HTMLElement)?.textContent;\n const matchingSource = sources.find((layerSource) => layerSource.name === targetLayerName);\n\n // we expect a single layer source matching this name\n if (matchingSource === undefined) {\n return;\n }\n setMapUrlModalOpen(true);\n UiFramework.dialogs.modal.open(\n <MapUrlDialog\n activeViewport={activeViewport}\n mapLayerSourceToEdit={matchingSource}\n onOkResult={(result?: SourceState) => handleModalUrlDialogOk(LayerAction.Edit, result)}\n onCancelResult={handleModalUrlDialogCancel}\n mapLayerOptions={mapLayerOptions}\n />,\n );\n\n if (onHandleOutsideClick) {\n onHandleOutsideClick(false);\n }\n },\n [activeViewport, handleModalUrlDialogCancel, handleModalUrlDialogOk, mapLayerOptions, onHandleOutsideClick,setMapUrlModalOpen, sources],\n );\n\n return (\n <div className=\"map-manager-header\">\n {(loading || loadingSources) && (\n <div style={{\n position: \"absolute\",\n inset: 0,\n display: \"grid\",\n placeItems: \"center\",\n zIndex: 100,\n }}>\n <ProgressRadial as=\"div\">\n <Text variant='small'>{loadingMapSources}</Text>\n </ProgressRadial>\n </div>\n )}\n <div className=\"map-manager-source-listbox-header\">\n <Input\n type=\"text\"\n className=\"map-manager-source-list-filter\"\n placeholder={placeholderLabel}\n value={sourceFilterString}\n onChange={handleFilterTextChanged}\n size=\"small\"\n />\n <Button className=\"map-manager-add-source-button\" title={addCustomLayerToolTip} onClick={handleAddNewMapSource}>\n {addCustomLayerLabel}\n </Button>\n </div>\n <div className=\"map-manager-sources\">\n <List\n id=\"map-sources\"\n as=\"div\"\n className=\"map-manager-source-list\"\n >\n {filteredOptions?.map((source) => (\n <ListItem\n as=\"div\"\n key={source.name}\n className=\"map-source-list-entry\"\n actionable\n onClick={() => handleAttach(source.name)}\n onMouseEnter={() => setLayerNameUnderCursor(source.name)}\n onMouseLeave={() => setLayerNameUnderCursor(undefined)}\n >\n <ListItem.Content>{source.name}</ListItem.Content>\n {\n // Display the delete icon only when the mouse over a specific item\n // otherwise list feels cluttered.\n !!iTwinId && layerNameUnderCursor && layerNameUnderCursor === source.name && (\n <>\n <Button\n size=\"small\"\n styleType=\"borderless\"\n className=\"map-source-list-entry-button\"\n title={editLayerDefButtonTitle}\n onClick={onItemEditButtonClicked}\n >\n <SvgEdit />\n </Button>\n <Button\n size=\"small\"\n styleType=\"borderless\"\n className=\"map-source-list-entry-button\"\n title={removeLayerDefButtonTitle}\n onClick={(event: React.MouseEvent) => {\n onItemRemoveButtonClicked(source, event);\n }}\n >\n <SvgDelete />\n </Button>\n </>\n )\n }\n </ListItem>\n ))}\n </List>\n </div>\n </div>\n );\n}\n\n/** @internal */\nexport enum AttachLayerButtonType {\n Primary,\n Blue,\n Icon,\n}\nexport interface AttachLayerPopupButtonProps {\n isOverlay: boolean;\n buttonType?: AttachLayerButtonType;\n disabled?: boolean;\n}\n\n/** @internal */\nexport function AttachLayerPopupButton(props: AttachLayerPopupButtonProps) {\n const { showAttachLayerLabel, hideAttachLayerLabel, addCustomLayerButtonLabel } = React.useMemo(() => {\n return {\n showAttachLayerLabel: MapLayersUI.localization.getLocalizedString(\"mapLayers:AttachLayerPopup.Attach\"),\n hideAttachLayerLabel: MapLayersUI.localization.getLocalizedString(\"mapLayers:AttachLayerPopup.Close\"),\n addCustomLayerButtonLabel: MapLayersUI.localization.getLocalizedString(\"mapLayers:CustomAttach.AddCustomLayerButtonLabel\"),\n };\n }, []);\n\n const [handleOutsideClick, setHandleOutsideClick] = React.useState(true);\n const [mapUrlModalOpen, setMapUrlModalOpen] = React.useState(false);\n const [popupOpen, setPopupOpen] = React.useState(false);\n const buttonRef = React.useRef<HTMLButtonElement>(null);\n const panelRef = React.useRef<HTMLDivElement>(null);\n\n // 'isMounted' is used to prevent any async operation once the hook has been\n // unloaded. Otherwise we get a 'Can't perform a React state update on an unmounted component.' warning in the console.\n const isMounted = React.useRef(false);\n React.useEffect(() => {\n isMounted.current = true;\n return () => {\n isMounted.current = false;\n };\n }, []);\n\n const togglePopup = React.useCallback(() => {\n setPopupOpen(!popupOpen);\n }, [popupOpen]);\n\n\n const { refreshFromStyle } = useSourceMapContext();\n\n const handleLayerAttached = React.useCallback(() => {\n if (!isMounted.current) {\n return;\n }\n setPopupOpen(false);\n refreshFromStyle();\n }, [refreshFromStyle]);\n\n function renderButton(): React.ReactNode {\n let button: React.ReactNode;\n\n if (props.buttonType === undefined || props.buttonType === AttachLayerButtonType.Icon) {\n button = (\n <IconButton\n disabled={props.disabled}\n size=\"small\"\n styleType=\"borderless\"\n ref={buttonRef}\n className=\"map-manager-attach-layer-button\"\n label={popupOpen ? hideAttachLayerLabel : showAttachLayerLabel}\n onClick={togglePopup}\n >\n <SvgAdd />\n </IconButton>\n );\n } else {\n const determineStyleType = () => {\n switch (props.buttonType) {\n case AttachLayerButtonType.Blue:\n return \"high-visibility\";\n case AttachLayerButtonType.Primary:\n default:\n return \"cta\";\n }\n };\n const styleType = determineStyleType();\n button = (\n <Button\n disabled={props.disabled}\n ref={buttonRef}\n styleType={styleType}\n title={popupOpen ? hideAttachLayerLabel : showAttachLayerLabel}\n onClick={togglePopup}\n >\n {addCustomLayerButtonLabel}\n </Button>\n );\n }\n\n return button;\n }\n\n return (\n <>\n <Popover\n content={\n <div ref={panelRef} className=\"map-sources-popup-panel\">\n <AttachLayerPanel isOverlay={props.isOverlay} onLayerAttached={handleLayerAttached} onHandleOutsideClick={setHandleOutsideClick} setMapUrlModalOpen={setMapUrlModalOpen} />\n </div>\n }\n applyBackground\n visible={popupOpen || mapUrlModalOpen} // keep the Popover open while the mapUrlModal is active\n onVisibleChange={setPopupOpen}\n closeOnOutsideClick={handleOutsideClick}\n placement={\"bottom-end\"}\n >\n {renderButton()}\n </Popover>\n </>\n );\n}\n"]}
@@ -1,3 +1,7 @@
1
1
  import "./CustomParamsSettings.scss";
2
- export declare function CustomParamsSettingsPanel(): import("react/jsx-runtime").JSX.Element;
2
+ interface CustomParamsSettingsPanelProps {
3
+ onHandleOutsideClick?: (shouldHandle: boolean) => void;
4
+ }
5
+ export declare function CustomParamsSettingsPanel({ onHandleOutsideClick }: CustomParamsSettingsPanelProps): import("react/jsx-runtime").JSX.Element;
6
+ export {};
3
7
  //# sourceMappingURL=CustomParamsSettings.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"CustomParamsSettings.d.ts","sourceRoot":"","sources":["../../../../src/ui/widget/CustomParamsSettings.tsx"],"names":[],"mappings":"AAKA,OAAO,6BAA6B,CAAC;AAerC,wBAAgB,yBAAyB,4CAmKxC"}
1
+ {"version":3,"file":"CustomParamsSettings.d.ts","sourceRoot":"","sources":["../../../../src/ui/widget/CustomParamsSettings.tsx"],"names":[],"mappings":"AAKA,OAAO,6BAA6B,CAAC;AAgBrC,UAAU,8BAA8B;IACtC,oBAAoB,CAAC,EAAE,CAAC,YAAY,EAAE,OAAO,KAAK,IAAI,CAAC;CACxD;AACD,wBAAgB,yBAAyB,CAAC,EAAE,oBAAoB,EAAE,EAAE,8BAA8B,2CAsLjG"}
@@ -39,7 +39,7 @@ const CustomParamsMappingStorage_1 = require("../../CustomParamsMappingStorage")
39
39
  const CustomParamsStorage_1 = require("../../CustomParamsStorage");
40
40
  const mapLayers_1 = require("../../mapLayers");
41
41
  const CustomParamEditDialog_1 = require("./CustomParamEditDialog");
42
- function CustomParamsSettingsPanel() {
42
+ function CustomParamsSettingsPanel({ onHandleOutsideClick }) {
43
43
  const [storage] = React.useState(() => new CustomParamsStorage_1.CustomParamsStorage());
44
44
  const [mappingStorage] = React.useState(() => new CustomParamsMappingStorage_1.CustomParamsMappingStorage());
45
45
  const [params, setParams] = React.useState(() => {
@@ -69,16 +69,26 @@ function CustomParamsSettingsPanel() {
69
69
  }
70
70
  }
71
71
  }, [mappingStorage, params, storage]);
72
+ const resumeOutsideClick = React.useCallback(() => {
73
+ if (onHandleOutsideClick) {
74
+ onHandleOutsideClick(true);
75
+ }
76
+ }, [onHandleOutsideClick]);
72
77
  /*
73
78
  Handle Remove layer button clicked
74
79
  */
75
80
  const onItemRemoveButtonClicked = React.useCallback((name, event) => {
76
81
  event.stopPropagation(); // We don't want the owning ListBox to react on mouse click.
77
82
  deleteMapping(name);
78
- }, [deleteMapping]);
83
+ if (onHandleOutsideClick) {
84
+ onHandleOutsideClick(false);
85
+ }
86
+ ;
87
+ }, [deleteMapping, onHandleOutsideClick]);
79
88
  const onCancelEdit = React.useCallback(() => {
80
89
  appui_react_1.UiFramework.dialogs.modal.close();
81
- }, []);
90
+ resumeOutsideClick();
91
+ }, [resumeOutsideClick]);
82
92
  const onOkEdit = React.useCallback((newItem, oldItem) => {
83
93
  appui_react_1.UiFramework.dialogs.modal.close();
84
94
  // If the edited item has a new name, delete the entry first.
@@ -100,20 +110,32 @@ function CustomParamsSettingsPanel() {
100
110
  }
101
111
  storage.save(newItem.name, newItem);
102
112
  tmpParams[newItem.name] = newItem;
113
+ if (onHandleOutsideClick) {
114
+ onHandleOutsideClick(false);
115
+ }
116
+ ;
103
117
  setParams(tmpParams);
104
- }, [mappingStorage, params, storage]);
118
+ }, [mappingStorage, params, storage, onHandleOutsideClick]);
105
119
  const handleAddClick = React.useCallback(() => {
120
+ if (onHandleOutsideClick) {
121
+ onHandleOutsideClick(false);
122
+ }
106
123
  appui_react_1.UiFramework.dialogs.modal.open((0, jsx_runtime_1.jsx)(CustomParamEditDialog_1.CustomParamEditDialog, { onOkResult: onOkEdit, onCancelResult: onCancelEdit }));
107
124
  return;
108
- }, [onCancelEdit, onOkEdit]);
109
- const onListboxValueChange = React.useCallback((newValue, _isControlOrCommandPressed) => {
125
+ }, [onCancelEdit, onOkEdit, onHandleOutsideClick]);
126
+ const onListboxValueChange = React.useCallback((newValue, event) => {
127
+ event.stopPropagation();
128
+ ;
110
129
  const item = params[newValue];
111
130
  if (item) {
112
131
  appui_react_1.UiFramework.dialogs.modal.open((0, jsx_runtime_1.jsx)(CustomParamEditDialog_1.CustomParamEditDialog, { item: item, onOkResult: onOkEdit, onCancelResult: onCancelEdit }));
113
132
  }
133
+ if (onHandleOutsideClick) {
134
+ onHandleOutsideClick(false);
135
+ }
114
136
  return;
115
- }, [params, onCancelEdit, onOkEdit]);
116
- return ((0, jsx_runtime_1.jsxs)("div", { className: "customParamsSettings-container", children: [(0, jsx_runtime_1.jsxs)("div", { className: "customParamsSettings-header", children: [(0, jsx_runtime_1.jsxs)("span", { className: "customParamsSettings-header-label", children: [mapLayers_1.MapLayersUI.translate("CustomParamSettings.SectionLabel"), (0, jsx_runtime_1.jsx)("div", { title: mapLayers_1.MapLayersUI.translate("Labels.TechPreviewBadgeTooltip"), className: "customParamsSettings-previewBadge", children: (0, jsx_runtime_1.jsx)(itwinui_react_1.Icon, { size: "small", children: (0, jsx_runtime_1.jsx)(itwinui_icons_color_react_1.SvgTechnicalPreviewMini, {}) }) })] }), (0, jsx_runtime_1.jsx)(itwinui_react_1.IconButton, { label: "Add", size: "small", styleType: "borderless", className: "customParamsSettings-header-add-button", onClick: handleAddClick, children: (0, jsx_runtime_1.jsx)(itwinui_icons_react_1.SvgAdd, {}) })] }), (0, jsx_runtime_1.jsx)("div", { className: "customParamsSettings-content", children: (0, jsx_runtime_1.jsx)(itwinui_react_1.List, { as: "div", className: "customParamsSettings-content-listbox", children: Object.keys(params).map((keyName) => ((0, jsx_runtime_1.jsxs)(itwinui_react_1.ListItem, { as: "div", actionable: true, className: "customParamsSettings-content-entry", onClick: () => onListboxValueChange(keyName), onMouseEnter: () => setListItemUnderCursor(keyName), onMouseLeave: () => setListItemUnderCursor(undefined), children: [(0, jsx_runtime_1.jsx)(itwinui_react_1.ListItem.Content, { className: "customParamsSettings-content-entry-name", children: keyName }),
137
+ }, [params, onCancelEdit, onOkEdit, onHandleOutsideClick]);
138
+ return ((0, jsx_runtime_1.jsxs)("div", { className: "customParamsSettings-container", children: [(0, jsx_runtime_1.jsxs)("div", { className: "customParamsSettings-header", children: [(0, jsx_runtime_1.jsxs)("span", { className: "customParamsSettings-header-label", children: [mapLayers_1.MapLayersUI.translate("CustomParamSettings.SectionLabel"), (0, jsx_runtime_1.jsx)("div", { title: mapLayers_1.MapLayersUI.translate("Labels.TechPreviewBadgeTooltip"), className: "customParamsSettings-previewBadge", children: (0, jsx_runtime_1.jsx)(itwinui_react_1.Icon, { size: "small", children: (0, jsx_runtime_1.jsx)(itwinui_icons_color_react_1.SvgTechnicalPreviewMini, {}) }) })] }), (0, jsx_runtime_1.jsx)(itwinui_react_1.IconButton, { label: "Add", size: "small", styleType: "borderless", className: "customParamsSettings-header-add-button", onClick: handleAddClick, children: (0, jsx_runtime_1.jsx)(itwinui_icons_react_1.SvgAdd, {}) })] }), (0, jsx_runtime_1.jsx)("div", { className: "customParamsSettings-content", children: (0, jsx_runtime_1.jsx)(itwinui_react_1.List, { as: "div", className: "customParamsSettings-content-listbox", children: Object.keys(params).map((keyName) => ((0, jsx_runtime_1.jsxs)(itwinui_react_1.ListItem, { as: "div", actionable: true, className: "customParamsSettings-content-entry", onClick: (e) => onListboxValueChange(keyName, e), onMouseEnter: () => setListItemUnderCursor(keyName), onMouseLeave: () => setListItemUnderCursor(undefined), children: [(0, jsx_runtime_1.jsx)(itwinui_react_1.ListItem.Content, { className: "customParamsSettings-content-entry-name", children: keyName }),
117
139
  // Display the delete icon only when the mouse over a specific item otherwise list feels cluttered.
118
140
  listItemUnderCursor && listItemUnderCursor === keyName && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(itwinui_react_1.IconButton, { size: "small", styleType: "borderless", className: "map-source-list-entry-button", label: mapLayers_1.MapLayersUI.translate("CustomParamSettings.EditButtonTitle"), children: (0, jsx_runtime_1.jsx)(itwinui_icons_react_1.SvgEdit, {}) }), (0, jsx_runtime_1.jsx)(itwinui_react_1.IconButton, { size: "small", styleType: "borderless", className: "customParamsSettings-content-entry-button", label: mapLayers_1.MapLayersUI.translate("CustomParamSettings.DeleteButtonTitle"), onClick: (event) => {
119
141
  onItemRemoveButtonClicked(keyName, event);
@@ -1 +1 @@
1
- {"version":3,"file":"CustomParamsSettings.js","sourceRoot":"","sources":["../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,8BAA8B,YAC3C,uBAAC,oBAAI,IAAC,EAAE,EAAC,KAAK,EAAC,SAAS,EAAC,sCAAsC,YAC5D,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,CACpC,wBAAC,wBAAQ,IACP,EAAE,EAAC,KAAK,EAER,UAAU,QACV,SAAS,EAAC,oCAAoC,EAC9C,OAAO,EAAE,GAAG,EAAE,CAAC,oBAAoB,CAAC,OAAO,CAAC,EAC5C,YAAY,EAAE,GAAG,EAAE,CAAC,sBAAsB,CAAC,OAAO,CAAC,EACnD,YAAY,EAAE,GAAG,EAAE,CAAC,sBAAsB,CAAC,SAAS,CAAC,aAErD,uBAAC,wBAAQ,CAAC,OAAO,IAAC,SAAS,EAAC,yCAAyC,YAClE,OAAO,GACS;4BAEjB,mGAAmG;4BACnG,mBAAmB,IAAI,mBAAmB,KAAK,OAAO,IAAI,CACxD,6DACE,uBAAC,0BAAU,IACT,IAAI,EAAC,OAAO,EACZ,SAAS,EAAC,YAAY,EACtB,SAAS,EAAC,8BAA8B,EACxC,KAAK,EAAE,uBAAW,CAAC,SAAS,CAAC,qCAAqC,CAAC,YAEnE,uBAAC,6BAAO,KAAG,GACA,EACb,uBAAC,0BAAU,IACT,IAAI,EAAC,OAAO,EACZ,SAAS,EAAC,YAAY,EACtB,SAAS,EAAC,2CAA2C,EACrD,KAAK,EAAE,uBAAW,CAAC,SAAS,CAAC,uCAAuC,CAAC,EACrE,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE;4CACjB,yBAAyB,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;wCAC5C,CAAC,YAED,uBAAC,+BAAS,KAAG,GACF,IACZ,CACJ,KAlCE,OAAO,CAoCH,CACZ,CAAC,GACG,GACH,IACF,CACP,CAAC;AACJ,CAAC;AAnKD,8DAmKC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n\nimport \"./CustomParamsSettings.scss\";\nimport * as React from \"react\";\nimport { UiFramework } from \"@itwin/appui-react\";\nimport { SvgTechnicalPreviewMini } from \"@itwin/itwinui-icons-color-react\";\nimport { SvgAdd, SvgDelete, SvgEdit } from \"@itwin/itwinui-icons-react\";\nimport { Icon, IconButton, List, ListItem } from \"@itwin/itwinui-react\";\nimport { CustomParamsMappingStorage } from \"../../CustomParamsMappingStorage\";\nimport { CustomParamsStorage } from \"../../CustomParamsStorage\";\nimport { MapLayersUI } from \"../../mapLayers\";\nimport { CustomParamEditDialog } from \"./CustomParamEditDialog\";\n\nimport type { CustomParamItem } from \"../Interfaces\";\ninterface CustomParamsMap {\n [paramName: string]: CustomParamItem;\n}\nexport function CustomParamsSettingsPanel() {\n const [storage] = React.useState(() => new CustomParamsStorage());\n const [mappingStorage] = React.useState(() => new CustomParamsMappingStorage());\n\n const [params, setParams] = React.useState<CustomParamsMap>(() => {\n const paramsMap: CustomParamsMap = {};\n const paramsList = storage.get(undefined);\n if (Array.isArray(paramsList)) {\n for (const param of paramsList) {\n paramsMap[param.name] = param;\n }\n }\n return paramsMap;\n });\n\n const [listItemUnderCursor, setListItemUnderCursor] = React.useState<string | undefined>();\n\n const deleteMapping = React.useCallback(\n (name: string) => {\n const tmpParams = { ...params };\n delete tmpParams[name];\n setParams(tmpParams);\n storage.delete(name);\n\n // Cascade delete to api key mapping\n const mappingContent = mappingStorage.getContent();\n if (mappingContent) {\n for (const itemKey of Object.keys(mappingContent)) {\n if (mappingContent[itemKey].customParamNames.includes(name)) {\n const newParamNames = mappingContent[itemKey].customParamNames.filter((value) => value !== name);\n newParamNames.length > 0 ? mappingStorage.save(itemKey, { customParamNames: newParamNames }) : mappingStorage.delete(itemKey);\n }\n }\n }\n },\n [mappingStorage, params, storage],\n );\n\n /*\n Handle Remove layer button clicked\n */\n const onItemRemoveButtonClicked = React.useCallback(\n (name: string, event: React.MouseEvent) => {\n event.stopPropagation(); // We don't want the owning ListBox to react on mouse click.\n deleteMapping(name);\n },\n [deleteMapping],\n );\n\n const onCancelEdit = React.useCallback(() => {\n UiFramework.dialogs.modal.close();\n }, []);\n\n const onOkEdit = React.useCallback(\n (newItem: CustomParamItem, oldItem?: CustomParamItem) => {\n UiFramework.dialogs.modal.close();\n\n // If the edited item has a new name, delete the entry first.\n const tmpParams = { ...params };\n if (oldItem && oldItem.name !== newItem.name) {\n delete tmpParams[oldItem.name];\n setParams(tmpParams);\n storage.delete(oldItem.name);\n\n const mappingContent = mappingStorage.getContent();\n if (mappingContent) {\n for (const itemKey of Object.keys(mappingContent)) {\n if (mappingContent[itemKey].customParamNames.includes(oldItem.name)) {\n const newParamNames = mappingContent[itemKey].customParamNames.filter((value) => value !== oldItem.name);\n newParamNames.push(newItem.name);\n mappingStorage.save(itemKey, { customParamNames: newParamNames });\n }\n }\n }\n }\n storage.save(newItem.name, newItem);\n\n tmpParams[newItem.name] = newItem;\n setParams(tmpParams);\n },\n [mappingStorage, params, storage],\n );\n\n const handleAddClick = React.useCallback(() => {\n UiFramework.dialogs.modal.open(<CustomParamEditDialog onOkResult={onOkEdit} onCancelResult={onCancelEdit} />);\n return;\n }, [onCancelEdit, onOkEdit]);\n\n const onListboxValueChange = React.useCallback(\n (newValue: string, _isControlOrCommandPressed?: boolean) => {\n const item = params[newValue];\n if (item) {\n UiFramework.dialogs.modal.open(<CustomParamEditDialog item={item} onOkResult={onOkEdit} onCancelResult={onCancelEdit} />);\n }\n\n return;\n },\n [params, onCancelEdit, onOkEdit],\n );\n\n return (\n <div className=\"customParamsSettings-container\">\n <div className=\"customParamsSettings-header\">\n <span className=\"customParamsSettings-header-label\">\n {MapLayersUI.translate(\"CustomParamSettings.SectionLabel\")}\n <div title={MapLayersUI.translate(\"Labels.TechPreviewBadgeTooltip\")} className=\"customParamsSettings-previewBadge\">\n <Icon size=\"small\">\n <SvgTechnicalPreviewMini />\n </Icon>\n </div>\n </span>\n\n <IconButton label=\"Add\" size=\"small\" styleType=\"borderless\" className=\"customParamsSettings-header-add-button\" onClick={handleAddClick}>\n <SvgAdd />\n </IconButton>\n </div>\n <div className=\"customParamsSettings-content\">\n <List as=\"div\" className=\"customParamsSettings-content-listbox\">\n {Object.keys(params).map((keyName) => (\n <ListItem\n as=\"div\"\n key={keyName}\n actionable\n className=\"customParamsSettings-content-entry\"\n onClick={() => onListboxValueChange(keyName)}\n onMouseEnter={() => setListItemUnderCursor(keyName)}\n onMouseLeave={() => setListItemUnderCursor(undefined)}\n >\n <ListItem.Content className=\"customParamsSettings-content-entry-name\">\n {keyName}\n </ListItem.Content>\n {\n // Display the delete icon only when the mouse over a specific item otherwise list feels cluttered.\n listItemUnderCursor && listItemUnderCursor === keyName && (\n <>\n <IconButton\n size=\"small\"\n styleType=\"borderless\"\n className=\"map-source-list-entry-button\"\n label={MapLayersUI.translate(\"CustomParamSettings.EditButtonTitle\")}\n >\n <SvgEdit />\n </IconButton>\n <IconButton\n size=\"small\"\n styleType=\"borderless\"\n className=\"customParamsSettings-content-entry-button\"\n label={MapLayersUI.translate(\"CustomParamSettings.DeleteButtonTitle\")}\n onClick={(event) => {\n onItemRemoveButtonClicked(keyName, event);\n }}\n >\n <SvgDelete />\n </IconButton>\n </>\n )\n }\n </ListItem>\n ))}\n </List>\n </div>\n </div>\n );\n}\n"]}
1
+ {"version":3,"file":"CustomParamsSettings.js","sourceRoot":"","sources":["../../../../src/ui/widget/CustomParamsSettings.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;gGAGgG;AAEhG,uCAAqC;AACrC,6CAA+B;AAC/B,oDAAiD;AACjD,gFAA2E;AAC3E,oEAAwE;AACxE,wDAAwE;AACxE,iFAA8E;AAC9E,mEAAgE;AAChE,+CAA8C;AAC9C,mEAAgE;AAUhE,SAAgB,yBAAyB,CAAC,EAAE,oBAAoB,EAAkC;IAChG,MAAM,CAAC,OAAO,CAAC,GAAG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EAAC,OAAO,EACZ,SAAS,EAAC,YAAY,EACtB,SAAS,EAAC,2CAA2C,EACrD,KAAK,EAAE,uBAAW,CAAC,SAAS,CAAC,uCAAuC,CAAC,EACrE,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE;4CACjB,yBAAyB,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;wCAC5C,CAAC,YAED,uBAAC,+BAAS,KAAG,GACF,IACZ,CACJ,KAlCE,OAAO,CAoCH,CACZ,CAAC,GACG,GACH,IACF,CACP,CAAC;AACJ,CAAC;AAtLD,8DAsLC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n\nimport \"./CustomParamsSettings.scss\";\nimport * as React from \"react\";\nimport { UiFramework } from \"@itwin/appui-react\";\nimport { SvgTechnicalPreviewMini } from \"@itwin/itwinui-icons-color-react\";\nimport { SvgAdd, SvgDelete, SvgEdit } from \"@itwin/itwinui-icons-react\";\nimport { Icon, IconButton, List, ListItem } from \"@itwin/itwinui-react\";\nimport { CustomParamsMappingStorage } from \"../../CustomParamsMappingStorage\";\nimport { CustomParamsStorage } from \"../../CustomParamsStorage\";\nimport { MapLayersUI } from \"../../mapLayers\";\nimport { CustomParamEditDialog } from \"./CustomParamEditDialog\";\n\nimport type { CustomParamItem } from \"../Interfaces\";\ninterface CustomParamsMap {\n [paramName: string]: CustomParamItem;\n}\n\ninterface CustomParamsSettingsPanelProps {\n onHandleOutsideClick?: (shouldHandle: boolean) => void;\n}\nexport function CustomParamsSettingsPanel({ onHandleOutsideClick }: CustomParamsSettingsPanelProps) {\n const [storage] = React.useState(() => new CustomParamsStorage());\n const [mappingStorage] = React.useState(() => new CustomParamsMappingStorage());\n\n const [params, setParams] = React.useState<CustomParamsMap>(() => {\n const paramsMap: CustomParamsMap = {};\n const paramsList = storage.get(undefined);\n if (Array.isArray(paramsList)) {\n for (const param of paramsList) {\n paramsMap[param.name] = param;\n }\n }\n return paramsMap;\n });\n\n const [listItemUnderCursor, setListItemUnderCursor] = React.useState<string | undefined>();\n\n const deleteMapping = React.useCallback(\n (name: string) => {\n const tmpParams = { ...params };\n delete tmpParams[name];\n setParams(tmpParams);\n storage.delete(name);\n\n // Cascade delete to api key mapping\n const mappingContent = mappingStorage.getContent();\n if (mappingContent) {\n for (const itemKey of Object.keys(mappingContent)) {\n if (mappingContent[itemKey].customParamNames.includes(name)) {\n const newParamNames = mappingContent[itemKey].customParamNames.filter((value) => value !== name);\n newParamNames.length > 0 ? mappingStorage.save(itemKey, { customParamNames: newParamNames }) : mappingStorage.delete(itemKey);\n }\n }\n }\n },\n [mappingStorage, params, storage],\n );\n\n const resumeOutsideClick = React.useCallback(() => {\n if (onHandleOutsideClick) {\n onHandleOutsideClick(true);\n }\n }, [onHandleOutsideClick]);\n /*\n Handle Remove layer button clicked\n */\n const onItemRemoveButtonClicked = React.useCallback(\n (name: string, event: React.MouseEvent) => {\n event.stopPropagation(); // We don't want the owning ListBox to react on mouse click.\n deleteMapping(name);\n if (onHandleOutsideClick) {\n onHandleOutsideClick(false);\n };\n },\n [deleteMapping, onHandleOutsideClick],\n );\n\n const onCancelEdit = React.useCallback(() => {\n UiFramework.dialogs.modal.close();\n resumeOutsideClick();\n }, [resumeOutsideClick]);\n\n const onOkEdit = React.useCallback(\n (newItem: CustomParamItem, oldItem?: CustomParamItem) => {\n UiFramework.dialogs.modal.close();\n\n // If the edited item has a new name, delete the entry first.\n const tmpParams = { ...params };\n if (oldItem && oldItem.name !== newItem.name) {\n delete tmpParams[oldItem.name];\n setParams(tmpParams);\n storage.delete(oldItem.name);\n\n const mappingContent = mappingStorage.getContent();\n if (mappingContent) {\n for (const itemKey of Object.keys(mappingContent)) {\n if (mappingContent[itemKey].customParamNames.includes(oldItem.name)) {\n const newParamNames = mappingContent[itemKey].customParamNames.filter((value) => value !== oldItem.name);\n newParamNames.push(newItem.name);\n mappingStorage.save(itemKey, { customParamNames: newParamNames });\n }\n }\n }\n }\n storage.save(newItem.name, newItem);\n\n tmpParams[newItem.name] = newItem;\n if (onHandleOutsideClick) {\n onHandleOutsideClick(false);\n };\n setParams(tmpParams);\n },\n [mappingStorage, params, storage, onHandleOutsideClick],\n );\n\n const handleAddClick = React.useCallback(() => {\n if (onHandleOutsideClick) {\n onHandleOutsideClick(false);\n }\n UiFramework.dialogs.modal.open(<CustomParamEditDialog onOkResult={onOkEdit} onCancelResult={onCancelEdit} />);\n\n return;\n }, [onCancelEdit, onOkEdit, onHandleOutsideClick]);\n\n const onListboxValueChange = React.useCallback(\n (newValue: string, event: React.MouseEvent) => {\n event.stopPropagation();;\n const item = params[newValue];\n if (item) {\n UiFramework.dialogs.modal.open(<CustomParamEditDialog item={item} onOkResult={onOkEdit} onCancelResult={onCancelEdit} />);\n }\n if (onHandleOutsideClick) {\n onHandleOutsideClick(false);\n }\n return;\n },\n [params, onCancelEdit, onOkEdit, onHandleOutsideClick],\n );\n\n return (\n <div className=\"customParamsSettings-container\">\n <div className=\"customParamsSettings-header\">\n <span className=\"customParamsSettings-header-label\">\n {MapLayersUI.translate(\"CustomParamSettings.SectionLabel\")}\n <div title={MapLayersUI.translate(\"Labels.TechPreviewBadgeTooltip\")} className=\"customParamsSettings-previewBadge\">\n <Icon size=\"small\">\n <SvgTechnicalPreviewMini />\n </Icon>\n </div>\n </span>\n\n <IconButton label=\"Add\" size=\"small\" styleType=\"borderless\" className=\"customParamsSettings-header-add-button\" onClick={handleAddClick}>\n <SvgAdd />\n </IconButton>\n </div>\n <div className=\"customParamsSettings-content\">\n <List as=\"div\" className=\"customParamsSettings-content-listbox\">\n {Object.keys(params).map((keyName) => (\n <ListItem\n as=\"div\"\n key={keyName}\n actionable\n className=\"customParamsSettings-content-entry\"\n onClick={(e: React.MouseEvent) => onListboxValueChange(keyName, e)}\n onMouseEnter={() => setListItemUnderCursor(keyName)}\n onMouseLeave={() => setListItemUnderCursor(undefined)}\n >\n <ListItem.Content className=\"customParamsSettings-content-entry-name\">\n {keyName}\n </ListItem.Content>\n {\n // Display the delete icon only when the mouse over a specific item otherwise list feels cluttered.\n listItemUnderCursor && listItemUnderCursor === keyName && (\n <>\n <IconButton\n size=\"small\"\n styleType=\"borderless\"\n className=\"map-source-list-entry-button\"\n label={MapLayersUI.translate(\"CustomParamSettings.EditButtonTitle\")}\n >\n <SvgEdit />\n </IconButton>\n <IconButton\n size=\"small\"\n styleType=\"borderless\"\n className=\"customParamsSettings-content-entry-button\"\n label={MapLayersUI.translate(\"CustomParamSettings.DeleteButtonTitle\")}\n onClick={(event) => {\n onItemRemoveButtonClicked(keyName, event);\n }}\n >\n <SvgDelete />\n </IconButton>\n </>\n )\n }\n </ListItem>\n ))}\n </List>\n </div>\n </div>\n );\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"FeatureInfoWidget.d.ts","sourceRoot":"","sources":["../../../../src/ui/widget/FeatureInfoWidget.tsx"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC;AAC3D,wBAAgB,oBAAoB,CAAC,EAAE,EAAE,MAAM,sDAG9C;AAGD,UAAU,yBAAyB;IACjC,eAAe,EAAE,qBAAqB,CAAC;CACxC;AAED,wBAAgB,oBAAoB,CAAC,EAAE,eAAe,EAAE,EAAE,yBAAyB,2CAgFlF"}
1
+ {"version":3,"file":"FeatureInfoWidget.d.ts","sourceRoot":"","sources":["../../../../src/ui/widget/FeatureInfoWidget.tsx"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC;AAC3D,wBAAgB,oBAAoB,CAAC,EAAE,EAAE,MAAM,sDAG9C;AAGD,UAAU,yBAAyB;IACjC,eAAe,EAAE,qBAAqB,CAAC;CACxC;AAED,wBAAgB,oBAAoB,CAAC,EAAE,eAAe,EAAE,EAAE,yBAAyB,2CAmFlF"}
@@ -32,12 +32,12 @@ const jsx_runtime_1 = require("react/jsx-runtime");
32
32
  const React = __importStar(require("react"));
33
33
  const appui_react_1 = require("@itwin/appui-react");
34
34
  const components_react_1 = require("@itwin/components-react");
35
- const core_react_1 = require("@itwin/core-react");
36
35
  const itwinui_icons_react_1 = require("@itwin/itwinui-icons-react");
37
36
  const itwinui_react_1 = require("@itwin/itwinui-react");
38
37
  const mapLayers_1 = require("../../mapLayers");
39
38
  const FeatureInfoUiItemsProvider_1 = require("../FeatureInfoUiItemsProvider");
40
39
  const FeatureInfoDataProvider_1 = require("./FeatureInfoDataProvider");
40
+ const useResizeObserver_1 = require("../hooks/useResizeObserver");
41
41
  function useSpecificWidgetDef(id) {
42
42
  const frontstageDef = (0, appui_react_1.useActiveFrontstageDef)();
43
43
  return frontstageDef?.findWidgetDef(id);
@@ -71,6 +71,9 @@ function MapFeatureInfoWidget({ featureInfoOpts }) {
71
71
  const handleResize = React.useCallback((w, h) => {
72
72
  setSize({ width: w, height: h });
73
73
  }, []);
74
+ const [elementRef] = (0, useResizeObserver_1.useResizeObserver)((size) => {
75
+ handleResize(size.width, size.height);
76
+ });
74
77
  const copyButton = React.useCallback((props) => props.isPropertyHovered && ((0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsx)(itwinui_react_1.IconButton, { styleType: "borderless", label: "Copy", onClick: () => {
75
78
  const value = props.property.value;
76
79
  if (value !== undefined && value.hasOwnProperty("displayValue")) {
@@ -78,9 +81,7 @@ function MapFeatureInfoWidget({ featureInfoOpts }) {
78
81
  }
79
82
  }, children: (0, jsx_runtime_1.jsx)(itwinui_icons_react_1.SvgCopy, {}) }) })), []);
80
83
  if (hasData && dataProvider.current) {
81
- return (
82
- // eslint-disable-next-line @typescript-eslint/no-deprecated
83
- (0, jsx_runtime_1.jsx)(core_react_1.ResizableContainerObserver, { onResize: handleResize, children: (0, jsx_runtime_1.jsx)(components_react_1.VirtualizedPropertyGridWithDataProvider, { width: width, height: height, dataProvider: dataProvider.current, orientation: components_react_1.Orientation.Vertical, isPropertySelectionEnabled: featureInfoOpts?.propertyGridOptions?.isPropertySelectionEnabled, isPropertyHoverEnabled // This need to be turned on to have the action button appears only when property hovered
84
+ return ((0, jsx_runtime_1.jsx)("div", { ref: elementRef, children: (0, jsx_runtime_1.jsx)(components_react_1.VirtualizedPropertyGridWithDataProvider, { width: width, height: height, dataProvider: dataProvider.current, orientation: components_react_1.Orientation.Vertical, isPropertySelectionEnabled: featureInfoOpts?.propertyGridOptions?.isPropertySelectionEnabled, isPropertyHoverEnabled // This need to be turned on to have the action button appears only when property hovered
84
85
  : true, actionButtonRenderers: [copyButton] }) }));
85
86
  }
86
87
  else {
@@ -1 +1 @@
1
- {"version":3,"file":"FeatureInfoWidget.js","sourceRoot":"","sources":["../../../../src/ui/widget/FeatureInfoWidget.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;gGAGgG;AAChG,6CAA+B;AAC/B,oDAAyE;AACzE,8DAA+F;AAC/F,kDAA+D;AAC/D,oEAAqD;AACrD,wDAAwD;AACxD,+CAA8C;AAC9C,8EAA2E;AAC3E,uEAAoE;AAKpE,SAAgB,oBAAoB,CAAC,EAAU;IAC7C,MAAM,aAAa,GAAG,IAAA,oCAAsB,GAAE,CAAC;IAC/C,OAAO,aAAa,EAAE,aAAa,CAAC,EAAE,CAAC,CAAC;AAC1C,CAAC;AAHD,oDAGC;AAOD,SAAgB,oBAAoB,CAAC,EAAE,eAAe,EAA6B;IACjF,MAAM,YAAY,GAAG,KAAK,CAAC,MAAM,CAAiC,IAAI,CAAC,CAAC;IACxE,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAU,KAAK,CAAC,CAAC;IAE7D,MAAM,CAAC,gBAAgB,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,uBAAW,CAAC,YAAY,CAAC,kBAAkB,CAAC,uCAAuC,CAAC,CAAC,CAAC;IAEhI,MAAM,CAAC,EAAE,KAAK,EAA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E,MAAM,EAAE,MAAM,EAAE,YACpE,2CACE,wCAAI,gBAAgB,GAAK,GACpB,GACF,CACR,CAAC;IACJ,CAAC;AACH,CAAC;AAhFD,oDAgFC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\nimport * as React from \"react\";\nimport { useActiveFrontstageDef, WidgetState } from \"@itwin/appui-react\";\nimport { Orientation, VirtualizedPropertyGridWithDataProvider } from \"@itwin/components-react\";\nimport { ResizableContainerObserver } from \"@itwin/core-react\";\nimport { SvgCopy } from \"@itwin/itwinui-icons-react\";\nimport { Flex, IconButton } from \"@itwin/itwinui-react\";\nimport { MapLayersUI } from \"../../mapLayers\";\nimport { FeatureInfoUiItemsProvider } from \"../FeatureInfoUiItemsProvider\";\nimport { FeatureInfoDataProvider } from \"./FeatureInfoDataProvider\";\n\nimport type { PrimitiveValue } from \"@itwin/appui-abstract\";\nimport type { ActionButtonRendererProps } from \"@itwin/components-react\";\nimport type { MapFeatureInfoOptions } from \"../Interfaces\";\nexport function useSpecificWidgetDef(id: string) {\n const frontstageDef = useActiveFrontstageDef();\n return frontstageDef?.findWidgetDef(id);\n}\n\n// MapFeatureInfoWidgetProps\ninterface MapFeatureInfoWidgetProps {\n featureInfoOpts: MapFeatureInfoOptions;\n}\n\nexport function MapFeatureInfoWidget({ featureInfoOpts }: MapFeatureInfoWidgetProps) {\n const dataProvider = React.useRef<FeatureInfoDataProvider | null>(null);\n const [hasData, setHasData] = React.useState<boolean>(false);\n\n const [noRecordsMessage] = React.useState(MapLayersUI.localization.getLocalizedString(\"mapLayers:FeatureInfoWidget.NoRecords\"));\n\n const [{ width, height }, setSize] = React.useState({ width: 0, height: 0 });\n\n const widgetDef = useSpecificWidgetDef(FeatureInfoUiItemsProvider.widgetId);\n const handleDataChanged = React.useCallback(() => {\n const dataAvailable = dataProvider.current !== null && dataProvider.current.hasRecords;\n setHasData(dataAvailable);\n if (widgetDef) {\n widgetDef.setWidgetState(dataAvailable ? WidgetState.Open : WidgetState.Hidden);\n }\n }, [widgetDef]);\n\n React.useEffect(() => {\n dataProvider.current = new FeatureInfoDataProvider();\n return () => {\n dataProvider?.current?.onUnload();\n };\n }, []);\n\n React.useEffect(() => {\n dataProvider.current?.onDataChanged.addListener(handleDataChanged);\n return () => {\n dataProvider.current?.onDataChanged.removeListener(handleDataChanged);\n };\n }, [handleDataChanged]);\n\n const handleResize = React.useCallback((w: number, h: number) => {\n setSize({ width: w, height: h });\n }, []);\n\n const copyButton = React.useCallback(\n (props: ActionButtonRendererProps) =>\n props.isPropertyHovered && (\n <div>\n <IconButton\n styleType=\"borderless\"\n label=\"Copy\"\n onClick={() => {\n const value = props.property.value;\n if (value !== undefined && value.hasOwnProperty(\"displayValue\")) {\n navigator.clipboard.writeText((value as PrimitiveValue).displayValue ?? \"\").catch((_) => {});\n }\n }}\n >\n <SvgCopy />\n </IconButton>\n </div>\n ),\n [],\n );\n\n if (hasData && dataProvider.current) {\n return (\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n <ResizableContainerObserver onResize={handleResize}>\n <VirtualizedPropertyGridWithDataProvider\n width={width}\n height={height}\n dataProvider={dataProvider.current}\n orientation={Orientation.Vertical}\n isPropertySelectionEnabled={featureInfoOpts?.propertyGridOptions?.isPropertySelectionEnabled}\n isPropertyHoverEnabled // This need to be turned on to have the action button appears only when property hovered\n actionButtonRenderers={[copyButton]}\n />\n </ResizableContainerObserver>\n );\n } else {\n return (\n <Flex justifyContent=\"center\" style={{ width: \"100%\", height: \"100%\" }}>\n <span>\n <i>{noRecordsMessage}</i>\n </span>\n </Flex>\n );\n }\n}\n"]}
1
+ {"version":3,"file":"FeatureInfoWidget.js","sourceRoot":"","sources":["../../../../src/ui/widget/FeatureInfoWidget.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;gGAGgG;AAChG,6CAA+B;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SAAS,IAAI,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,CAAC;oBAChE,SAAS,CAAC,SAAS,CAAC,SAAS,CAAE,KAAwB,CAAC,YAAY,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,GAAE,CAAC,CAAC,CAAC;gBAC/F,CAAC;YACH,CAAC,YAED,uBAAC,6BAAO,KAAG,GACA,GACT,CACP,EACH,EAAE,CACH,CAAC;IAEF,IAAI,OAAO,IAAI,YAAY,CAAC,OAAO,EAAE,CAAC;QACpC,OAAO,CACL,gCAAK,GAAG,EAAE,UAAU,YAClB,uBAAC,0DAAuC,IACtC,KAAK,EAAE,KAAK,EACZ,MAAM,EAAE,MAAM,EACd,YAAY,EAAE,YAAY,CAAC,OAAO,EAClC,WAAW,EAAE,8BAAW,CAAC,QAAQ,EACjC,0BAA0B,EAAE,eAAe,EAAE,mBAAmB,EAAE,0BAA0B,EAC5F,sBAAsB,CAAC,yFAAyF;wBAChH,qBAAqB,EAAE,CAAC,UAAU,CAAC,GACnC,GACE,CACP,CAAC;IACJ,CAAC;SAAM,CAAC;QACN,OAAO,CACL,uBAAC,oBAAI,IAAC,cAAc,EAAC,QAAQ,EAAC,KAAK,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,YACpE,2CACE,wCAAI,gBAAgB,GAAK,GACpB,GACF,CACR,CAAC;IACJ,CAAC;AACH,CAAC;AAnFD,oDAmFC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\nimport * as React from \"react\";\nimport { useActiveFrontstageDef, WidgetState } from \"@itwin/appui-react\";\nimport { Orientation, VirtualizedPropertyGridWithDataProvider } from \"@itwin/components-react\";\nimport { SvgCopy } from \"@itwin/itwinui-icons-react\";\nimport { Flex, IconButton } from \"@itwin/itwinui-react\";\nimport { MapLayersUI } from \"../../mapLayers\";\nimport { FeatureInfoUiItemsProvider } from \"../FeatureInfoUiItemsProvider\";\nimport { FeatureInfoDataProvider } from \"./FeatureInfoDataProvider\";\nimport { useResizeObserver } from \"../hooks/useResizeObserver\";\n\nimport type { PrimitiveValue } from \"@itwin/appui-abstract\";\nimport type { ActionButtonRendererProps } from \"@itwin/components-react\";\nimport type { MapFeatureInfoOptions } from \"../Interfaces\";\nexport function useSpecificWidgetDef(id: string) {\n const frontstageDef = useActiveFrontstageDef();\n return frontstageDef?.findWidgetDef(id);\n}\n\n// MapFeatureInfoWidgetProps\ninterface MapFeatureInfoWidgetProps {\n featureInfoOpts: MapFeatureInfoOptions;\n}\n\nexport function MapFeatureInfoWidget({ featureInfoOpts }: MapFeatureInfoWidgetProps) {\n const dataProvider = React.useRef<FeatureInfoDataProvider | null>(null);\n const [hasData, setHasData] = React.useState<boolean>(false);\n\n const [noRecordsMessage] = React.useState(MapLayersUI.localization.getLocalizedString(\"mapLayers:FeatureInfoWidget.NoRecords\"));\n\n const [{ width, height }, setSize] = React.useState({ width: 0, height: 0 });\n\n const widgetDef = useSpecificWidgetDef(FeatureInfoUiItemsProvider.widgetId);\n const handleDataChanged = React.useCallback(() => {\n const dataAvailable = dataProvider.current !== null && dataProvider.current.hasRecords;\n setHasData(dataAvailable);\n if (widgetDef) {\n widgetDef.setWidgetState(dataAvailable ? WidgetState.Open : WidgetState.Hidden);\n }\n }, [widgetDef]);\n\n React.useEffect(() => {\n dataProvider.current = new FeatureInfoDataProvider();\n return () => {\n dataProvider?.current?.onUnload();\n };\n }, []);\n\n React.useEffect(() => {\n dataProvider.current?.onDataChanged.addListener(handleDataChanged);\n return () => {\n dataProvider.current?.onDataChanged.removeListener(handleDataChanged);\n };\n }, [handleDataChanged]);\n\n const handleResize = React.useCallback((w: number, h: number) => {\n setSize({ width: w, height: h });\n }, []);\n\n const [elementRef] = useResizeObserver<HTMLDivElement>((size) => {\n handleResize(size.width, size.height);\n });\n\n const copyButton = React.useCallback(\n (props: ActionButtonRendererProps) =>\n props.isPropertyHovered && (\n <div>\n <IconButton\n styleType=\"borderless\"\n label=\"Copy\"\n onClick={() => {\n const value = props.property.value;\n if (value !== undefined && value.hasOwnProperty(\"displayValue\")) {\n navigator.clipboard.writeText((value as PrimitiveValue).displayValue ?? \"\").catch((_) => {});\n }\n }}\n >\n <SvgCopy />\n </IconButton>\n </div>\n ),\n [],\n );\n\n if (hasData && dataProvider.current) {\n return (\n <div ref={elementRef}>\n <VirtualizedPropertyGridWithDataProvider\n width={width}\n height={height}\n dataProvider={dataProvider.current}\n orientation={Orientation.Vertical}\n isPropertySelectionEnabled={featureInfoOpts?.propertyGridOptions?.isPropertySelectionEnabled}\n isPropertyHoverEnabled // This need to be turned on to have the action button appears only when property hovered\n actionButtonRenderers={[copyButton]}\n />\n </div>\n );\n } else {\n return (\n <Flex justifyContent=\"center\" style={{ width: \"100%\", height: \"100%\" }}>\n <span>\n <i>{noRecordsMessage}</i>\n </span>\n </Flex>\n );\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"MapLayerDroppable.d.ts","sourceRoot":"","sources":["../../../../src/ui/widget/MapLayerDroppable.tsx"],"names":[],"mappings":"AAQA,OAAO,wBAAwB,CAAC;AAiBhC,OAAO,KAAK,EAAiB,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAC1E,OAAO,KAAK,EAAE,eAAe,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC;AAE5E,gBAAgB;AAChB,UAAU,sBAAsB;IAC9B,SAAS,EAAE,OAAO,CAAC;IACnB,UAAU,CAAC,EAAE,qBAAqB,EAAE,CAAC;IACrC,eAAe,CAAC,EAAE,eAAe,CAAC;IAClC,oBAAoB,EAAE,MAAM,WAAW,CAAC;IACxC,cAAc,EAAE,cAAc,CAAC;IAC/B,kBAAkB,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,gBAAgB,EAAE,qBAAqB,KAAK,IAAI,CAAC;IACtF,6BAA6B,EAAE,CAAC,gBAAgB,EAAE,qBAAqB,KAAK,IAAI,CAAC;IACjF,cAAc,EAAE,CAAC,SAAS,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAC5D,YAAY,EAAE,MAAM,IAAI,CAAC;IACzB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAQD,gBAAgB;AAChB,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,sBAAsB,2CA2P9D"}
1
+ {"version":3,"file":"MapLayerDroppable.d.ts","sourceRoot":"","sources":["../../../../src/ui/widget/MapLayerDroppable.tsx"],"names":[],"mappings":"AAQA,OAAO,wBAAwB,CAAC;AAiBhC,OAAO,KAAK,EAAiB,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAC1E,OAAO,KAAK,EAAE,eAAe,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC;AAE5E,gBAAgB;AAChB,UAAU,sBAAsB;IAC9B,SAAS,EAAE,OAAO,CAAC;IACnB,UAAU,CAAC,EAAE,qBAAqB,EAAE,CAAC;IACrC,eAAe,CAAC,EAAE,eAAe,CAAC;IAClC,oBAAoB,EAAE,MAAM,WAAW,CAAC;IACxC,cAAc,EAAE,cAAc,CAAC;IAC/B,kBAAkB,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,gBAAgB,EAAE,qBAAqB,KAAK,IAAI,CAAC;IACtF,6BAA6B,EAAE,CAAC,gBAAgB,EAAE,qBAAqB,KAAK,IAAI,CAAC;IACjF,cAAc,EAAE,CAAC,SAAS,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAC5D,YAAY,EAAE,MAAM,IAAI,CAAC;IACzB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAQD,gBAAgB;AAChB,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,sBAAsB,2CAyP9D"}
@@ -110,7 +110,7 @@ function MapLayerDroppable(props) {
110
110
  const index = { index: indexInDisplayStyle, isOverlay: activeLayer.isOverlay };
111
111
  const layer = props.activeViewport.displayStyle.mapLayerAtIndex(index);
112
112
  if (layer instanceof core_common_1.ImageMapLayerSettings) {
113
- appui_react_1.UiFramework.dialogs.modal.open((0, jsx_runtime_1.jsx)(MapUrlDialog_1.MapUrlDialog, { activeViewport: props.activeViewport, isOverlay: props.isOverlay, signInModeArgs: { layer }, onOkResult: (sourceState) => handleOk(index, sourceState), onCancelResult: () => {
113
+ appui_react_1.UiFramework.dialogs.modal.open((0, jsx_runtime_1.jsx)(MapUrlDialog_1.MapUrlDialog, { activeViewport: props.activeViewport, signInModeArgs: { layer }, onOkResult: (sourceState) => handleOk(index, sourceState), onCancelResult: () => {
114
114
  appui_react_1.UiFramework.dialogs.modal.close();
115
115
  }, mapLayerOptions: props.mapLayerOptions }));
116
116
  }
@@ -123,7 +123,7 @@ function MapLayerDroppable(props) {
123
123
  const index = { index: indexInDisplayStyle, isOverlay: activeLayer.isOverlay };
124
124
  const layer = props.activeViewport.displayStyle.mapLayerAtIndex(index);
125
125
  if (layer instanceof core_common_1.ImageMapLayerSettings) {
126
- appui_react_1.UiFramework.dialogs.modal.open((0, jsx_runtime_1.jsx)(MapUrlDialog_1.MapUrlDialog, { activeViewport: props.activeViewport, isOverlay: props.isOverlay, signInModeArgs: { layer }, onOkResult: (sourceState) => handleOk(index, sourceState), onCancelResult: () => {
126
+ appui_react_1.UiFramework.dialogs.modal.open((0, jsx_runtime_1.jsx)(MapUrlDialog_1.MapUrlDialog, { activeViewport: props.activeViewport, signInModeArgs: { layer }, onOkResult: (sourceState) => handleOk(index, sourceState), onCancelResult: () => {
127
127
  appui_react_1.UiFramework.dialogs.modal.close();
128
128
  }, mapLayerOptions: props.mapLayerOptions }));
129
129
  }