@itwin/map-layers 6.0.0-dev.0 → 6.0.0-dev.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/ui/widget/AttachLayerPopupButton.d.ts.map +1 -1
- package/lib/cjs/ui/widget/AttachLayerPopupButton.js +19 -33
- package/lib/cjs/ui/widget/AttachLayerPopupButton.js.map +1 -1
- package/lib/cjs/ui/widget/CustomParamsSettings.d.ts +5 -1
- package/lib/cjs/ui/widget/CustomParamsSettings.d.ts.map +1 -1
- package/lib/cjs/ui/widget/CustomParamsSettings.js +30 -8
- package/lib/cjs/ui/widget/CustomParamsSettings.js.map +1 -1
- package/lib/cjs/ui/widget/MapLayerDroppable.d.ts.map +1 -1
- package/lib/cjs/ui/widget/MapLayerDroppable.js +2 -2
- package/lib/cjs/ui/widget/MapLayerDroppable.js.map +1 -1
- package/lib/cjs/ui/widget/MapLayerSettingsPopupButton.d.ts.map +1 -1
- package/lib/cjs/ui/widget/MapLayerSettingsPopupButton.js +5 -25
- package/lib/cjs/ui/widget/MapLayerSettingsPopupButton.js.map +1 -1
- package/lib/cjs/ui/widget/MapManagerSettings.d.ts +5 -1
- package/lib/cjs/ui/widget/MapManagerSettings.d.ts.map +1 -1
- package/lib/cjs/ui/widget/MapManagerSettings.js +2 -2
- package/lib/cjs/ui/widget/MapManagerSettings.js.map +1 -1
- package/lib/cjs/ui/widget/MapUrlDialog.d.ts +0 -1
- package/lib/cjs/ui/widget/MapUrlDialog.d.ts.map +1 -1
- package/lib/cjs/ui/widget/MapUrlDialog.js.map +1 -1
- package/lib/cjs/ui/widget/SubLayersPopupButton.d.ts.map +1 -1
- package/lib/cjs/ui/widget/SubLayersPopupButton.js +1 -13
- package/lib/cjs/ui/widget/SubLayersPopupButton.js.map +1 -1
- package/lib/cjs/ui/widget/TransparencyPopupButton.d.ts.map +1 -1
- package/lib/cjs/ui/widget/TransparencyPopupButton.js +4 -10
- package/lib/cjs/ui/widget/TransparencyPopupButton.js.map +1 -1
- package/lib/esm/ui/widget/AttachLayerPopupButton.d.ts.map +1 -1
- package/lib/esm/ui/widget/AttachLayerPopupButton.js +20 -34
- package/lib/esm/ui/widget/AttachLayerPopupButton.js.map +1 -1
- package/lib/esm/ui/widget/CustomParamsSettings.d.ts +5 -1
- package/lib/esm/ui/widget/CustomParamsSettings.d.ts.map +1 -1
- package/lib/esm/ui/widget/CustomParamsSettings.js +30 -8
- package/lib/esm/ui/widget/CustomParamsSettings.js.map +1 -1
- package/lib/esm/ui/widget/MapLayerDroppable.d.ts.map +1 -1
- package/lib/esm/ui/widget/MapLayerDroppable.js +2 -2
- package/lib/esm/ui/widget/MapLayerDroppable.js.map +1 -1
- package/lib/esm/ui/widget/MapLayerSettingsPopupButton.d.ts.map +1 -1
- package/lib/esm/ui/widget/MapLayerSettingsPopupButton.js +7 -27
- package/lib/esm/ui/widget/MapLayerSettingsPopupButton.js.map +1 -1
- package/lib/esm/ui/widget/MapManagerSettings.d.ts +5 -1
- package/lib/esm/ui/widget/MapManagerSettings.d.ts.map +1 -1
- package/lib/esm/ui/widget/MapManagerSettings.js +2 -2
- package/lib/esm/ui/widget/MapManagerSettings.js.map +1 -1
- package/lib/esm/ui/widget/MapUrlDialog.d.ts +0 -1
- package/lib/esm/ui/widget/MapUrlDialog.d.ts.map +1 -1
- package/lib/esm/ui/widget/MapUrlDialog.js.map +1 -1
- package/lib/esm/ui/widget/SubLayersPopupButton.d.ts.map +1 -1
- package/lib/esm/ui/widget/SubLayersPopupButton.js +3 -15
- package/lib/esm/ui/widget/SubLayersPopupButton.js.map +1 -1
- package/lib/esm/ui/widget/TransparencyPopupButton.d.ts.map +1 -1
- package/lib/esm/ui/widget/TransparencyPopupButton.js +6 -12
- package/lib/esm/ui/widget/TransparencyPopupButton.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AttachLayerPopupButton.js","sourceRoot":"","sources":["../../../../src/ui/wid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AK,CAAC,SAAS,EAAE,eAAe,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,qBAAqB,GAAI,GAC/H,GAEO,IACd,CACJ,CAAC;AACJ,CAAC","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,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AACpI,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AACxE,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,cAAc,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAChH,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAChE,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AACpE,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAK9C,mCAAmC;AAEnC,IAAK,WAGJ;AAHD,WAAK,WAAW;IACd,2CAAG,CAAA;IACH,6CAAI,CAAA;AACN,CAAC,EAHI,WA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EAAE,SAAS,CAAC,CAAC,CAAC,oBAAoB,CAAC,CAAC,CAAC,oBAAoB,EAC9D,OAAO,EAAE,WAAW,YAEpB,KAAC,MAAM,KAAG,GACC,CACd,CAAC;QACJ,CAAC;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,KAAC,MAAM,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,4BACE,KAAC,OAAO,IACN,OAAO,EACL,cAAK,GAAG,EAAE,QAAQ,EAAE,SAAS,EAAC,yBAAyB,YACrD,KAAC,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","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 <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 [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
|
-
|
|
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;
|
|
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"}
|
|
@@ -13,7 +13,7 @@ import { CustomParamsMappingStorage } from "../../CustomParamsMappingStorage";
|
|
|
13
13
|
import { CustomParamsStorage } from "../../CustomParamsStorage";
|
|
14
14
|
import { MapLayersUI } from "../../mapLayers";
|
|
15
15
|
import { CustomParamEditDialog } from "./CustomParamEditDialog";
|
|
16
|
-
export function CustomParamsSettingsPanel() {
|
|
16
|
+
export function CustomParamsSettingsPanel({ onHandleOutsideClick }) {
|
|
17
17
|
const [storage] = React.useState(() => new CustomParamsStorage());
|
|
18
18
|
const [mappingStorage] = React.useState(() => new CustomParamsMappingStorage());
|
|
19
19
|
const [params, setParams] = React.useState(() => {
|
|
@@ -43,16 +43,26 @@ export function CustomParamsSettingsPanel() {
|
|
|
43
43
|
}
|
|
44
44
|
}
|
|
45
45
|
}, [mappingStorage, params, storage]);
|
|
46
|
+
const resumeOutsideClick = React.useCallback(() => {
|
|
47
|
+
if (onHandleOutsideClick) {
|
|
48
|
+
onHandleOutsideClick(true);
|
|
49
|
+
}
|
|
50
|
+
}, [onHandleOutsideClick]);
|
|
46
51
|
/*
|
|
47
52
|
Handle Remove layer button clicked
|
|
48
53
|
*/
|
|
49
54
|
const onItemRemoveButtonClicked = React.useCallback((name, event) => {
|
|
50
55
|
event.stopPropagation(); // We don't want the owning ListBox to react on mouse click.
|
|
51
56
|
deleteMapping(name);
|
|
52
|
-
|
|
57
|
+
if (onHandleOutsideClick) {
|
|
58
|
+
onHandleOutsideClick(false);
|
|
59
|
+
}
|
|
60
|
+
;
|
|
61
|
+
}, [deleteMapping, onHandleOutsideClick]);
|
|
53
62
|
const onCancelEdit = React.useCallback(() => {
|
|
54
63
|
UiFramework.dialogs.modal.close();
|
|
55
|
-
|
|
64
|
+
resumeOutsideClick();
|
|
65
|
+
}, [resumeOutsideClick]);
|
|
56
66
|
const onOkEdit = React.useCallback((newItem, oldItem) => {
|
|
57
67
|
UiFramework.dialogs.modal.close();
|
|
58
68
|
// If the edited item has a new name, delete the entry first.
|
|
@@ -74,20 +84,32 @@ export function CustomParamsSettingsPanel() {
|
|
|
74
84
|
}
|
|
75
85
|
storage.save(newItem.name, newItem);
|
|
76
86
|
tmpParams[newItem.name] = newItem;
|
|
87
|
+
if (onHandleOutsideClick) {
|
|
88
|
+
onHandleOutsideClick(false);
|
|
89
|
+
}
|
|
90
|
+
;
|
|
77
91
|
setParams(tmpParams);
|
|
78
|
-
}, [mappingStorage, params, storage]);
|
|
92
|
+
}, [mappingStorage, params, storage, onHandleOutsideClick]);
|
|
79
93
|
const handleAddClick = React.useCallback(() => {
|
|
94
|
+
if (onHandleOutsideClick) {
|
|
95
|
+
onHandleOutsideClick(false);
|
|
96
|
+
}
|
|
80
97
|
UiFramework.dialogs.modal.open(_jsx(CustomParamEditDialog, { onOkResult: onOkEdit, onCancelResult: onCancelEdit }));
|
|
81
98
|
return;
|
|
82
|
-
}, [onCancelEdit, onOkEdit]);
|
|
83
|
-
const onListboxValueChange = React.useCallback((newValue,
|
|
99
|
+
}, [onCancelEdit, onOkEdit, onHandleOutsideClick]);
|
|
100
|
+
const onListboxValueChange = React.useCallback((newValue, event) => {
|
|
101
|
+
event.stopPropagation();
|
|
102
|
+
;
|
|
84
103
|
const item = params[newValue];
|
|
85
104
|
if (item) {
|
|
86
105
|
UiFramework.dialogs.modal.open(_jsx(CustomParamEditDialog, { item: item, onOkResult: onOkEdit, onCancelResult: onCancelEdit }));
|
|
87
106
|
}
|
|
107
|
+
if (onHandleOutsideClick) {
|
|
108
|
+
onHandleOutsideClick(false);
|
|
109
|
+
}
|
|
88
110
|
return;
|
|
89
|
-
}, [params, onCancelEdit, onOkEdit]);
|
|
90
|
-
return (_jsxs("div", { className: "customParamsSettings-container", children: [_jsxs("div", { className: "customParamsSettings-header", children: [_jsxs("span", { className: "customParamsSettings-header-label", children: [MapLayersUI.translate("CustomParamSettings.SectionLabel"), _jsx("div", { title: MapLayersUI.translate("Labels.TechPreviewBadgeTooltip"), className: "customParamsSettings-previewBadge", children: _jsx(Icon, { size: "small", children: _jsx(SvgTechnicalPreviewMini, {}) }) })] }), _jsx(IconButton, { label: "Add", size: "small", styleType: "borderless", className: "customParamsSettings-header-add-button", onClick: handleAddClick, children: _jsx(SvgAdd, {}) })] }), _jsx("div", { className: "customParamsSettings-content", children: _jsx(List, { as: "div", className: "customParamsSettings-content-listbox", children: Object.keys(params).map((keyName) => (_jsxs(ListItem, { as: "div", actionable: true, className: "customParamsSettings-content-entry", onClick: () => onListboxValueChange(keyName), onMouseEnter: () => setListItemUnderCursor(keyName), onMouseLeave: () => setListItemUnderCursor(undefined), children: [_jsx(ListItem.Content, { className: "customParamsSettings-content-entry-name", children: keyName }),
|
|
111
|
+
}, [params, onCancelEdit, onOkEdit, onHandleOutsideClick]);
|
|
112
|
+
return (_jsxs("div", { className: "customParamsSettings-container", children: [_jsxs("div", { className: "customParamsSettings-header", children: [_jsxs("span", { className: "customParamsSettings-header-label", children: [MapLayersUI.translate("CustomParamSettings.SectionLabel"), _jsx("div", { title: MapLayersUI.translate("Labels.TechPreviewBadgeTooltip"), className: "customParamsSettings-previewBadge", children: _jsx(Icon, { size: "small", children: _jsx(SvgTechnicalPreviewMini, {}) }) })] }), _jsx(IconButton, { label: "Add", size: "small", styleType: "borderless", className: "customParamsSettings-header-add-button", onClick: handleAddClick, children: _jsx(SvgAdd, {}) })] }), _jsx("div", { className: "customParamsSettings-content", children: _jsx(List, { as: "div", className: "customParamsSettings-content-listbox", children: Object.keys(params).map((keyName) => (_jsxs(ListItem, { as: "div", actionable: true, className: "customParamsSettings-content-entry", onClick: (e) => onListboxValueChange(keyName, e), onMouseEnter: () => setListItemUnderCursor(keyName), onMouseLeave: () => setListItemUnderCursor(undefined), children: [_jsx(ListItem.Content, { className: "customParamsSettings-content-entry-name", children: keyName }),
|
|
91
113
|
// Display the delete icon only when the mouse over a specific item otherwise list feels cluttered.
|
|
92
114
|
listItemUnderCursor && listItemUnderCursor === keyName && (_jsxs(_Fragment, { children: [_jsx(IconButton, { size: "small", styleType: "borderless", className: "map-source-list-entry-button", label: MapLayersUI.translate("CustomParamSettings.EditButtonTitle"), children: _jsx(SvgEdit, {}) }), _jsx(IconButton, { size: "small", styleType: "borderless", className: "customParamsSettings-content-entry-button", label: MapLayersUI.translate("CustomParamSettings.DeleteButtonTitle"), onClick: (event) => {
|
|
93
115
|
onItemRemoveButtonClicked(keyName, event);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CustomParamsSettings.js","sourceRoot":"","sources":["../../../../src/ui/widget/CustomParamsSettings.tsx"],"names":[],"mappings":";AAAA;;;gGAGgG;AAEhG,OAAO,6BAA6B,CAAC;AACrC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,uBAAuB,EAAE,MAAM,kCAAkC,CAAC;AAC3E,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,4BAA4B,C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MAAM,KAAG,GACC,IACT,EACN,cAAK,SAAS,EAAC,8BAA8B,YAC3C,KAAC,IAAI,IAAC,EAAE,EAAC,KAAK,EAAC,SAAS,EAAC,sCAAsC,YAC5D,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,CACpC,MAAC,QAAQ,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,KAAC,QAAQ,CAAC,OAAO,IAAC,SAAS,EAAC,yCAAyC,YAClE,OAAO,GACS;4BAEjB,mGAAmG;4BACnG,mBAAmB,IAAI,mBAAmB,KAAK,OAAO,IAAI,CACxD,8BACE,KAAC,UAAU,IACT,IAAI,EAAC,OAAO,EACZ,SAAS,EAAC,YAAY,EACtB,SAAS,EAAC,8BAA8B,EACxC,KAAK,EAAE,WAAW,CAAC,SAAS,CAAC,qCAAqC,CAAC,YAEnE,KAAC,OAAO,KAAG,GACA,EACb,KAAC,UAAU,IACT,IAAI,EAAC,OAAO,EACZ,SAAS,EAAC,YAAY,EACtB,SAAS,EAAC,2CAA2C,EACrD,KAAK,EAAE,WAAW,CAAC,SAAS,CAAC,uCAAuC,CAAC,EACrE,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE;4CACjB,yBAAyB,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;wCAC5C,CAAC,YAED,KAAC,SAAS,KAAG,GACF,IACZ,CACJ,KAlCE,OAAO,CAoCH,CACZ,CAAC,GACG,GACH,IACF,CACP,CAAC;AACJ,CAAC","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,OAAO,6BAA6B,CAAC;AACrC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,uBAAuB,EAAE,MAAM,kCAAkC,CAAC;AAC3E,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;A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AErD,KAAC,QAAQ,CAAC,OAAO,IAAC,SAAS,EAAC,yCAAyC,YAClE,OAAO,GACS;4BAEjB,mGAAmG;4BACnG,mBAAmB,IAAI,mBAAmB,KAAK,OAAO,IAAI,CACxD,8BACE,KAAC,UAAU,IACT,IAAI,EAAC,OAAO,EACZ,SAAS,EAAC,YAAY,EACtB,SAAS,EAAC,8BAA8B,EACxC,KAAK,EAAE,WAAW,CAAC,SAAS,CAAC,qCAAqC,CAAC,YAEnE,KAAC,OAAO,KAAG,GACA,EACb,KAAC,UAAU,IACT,IAAI,EAAC,OAAO,EACZ,SAAS,EAAC,YAAY,EACtB,SAAS,EAAC,2CAA2C,EACrD,KAAK,EAAE,WAAW,CAAC,SAAS,CAAC,uCAAuC,CAAC,EACrE,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE;4CACjB,yBAAyB,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;wCAC5C,CAAC,YAED,KAAC,SAAS,KAAG,GACF,IACZ,CACJ,KAlCE,OAAO,CAoCH,CACZ,CAAC,GACG,GACH,IACF,CACP,CAAC;AACJ,CAAC","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":"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;IACr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AAM,IAAI,CAAC;IACzB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAQD,gBAAgB;AAChB,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,sBAAsB,2CAyP9D"}
|
|
@@ -84,7 +84,7 @@ export function MapLayerDroppable(props) {
|
|
|
84
84
|
const index = { index: indexInDisplayStyle, isOverlay: activeLayer.isOverlay };
|
|
85
85
|
const layer = props.activeViewport.displayStyle.mapLayerAtIndex(index);
|
|
86
86
|
if (layer instanceof ImageMapLayerSettings) {
|
|
87
|
-
UiFramework.dialogs.modal.open(_jsx(MapUrlDialog, { activeViewport: props.activeViewport,
|
|
87
|
+
UiFramework.dialogs.modal.open(_jsx(MapUrlDialog, { activeViewport: props.activeViewport, signInModeArgs: { layer }, onOkResult: (sourceState) => handleOk(index, sourceState), onCancelResult: () => {
|
|
88
88
|
UiFramework.dialogs.modal.close();
|
|
89
89
|
}, mapLayerOptions: props.mapLayerOptions }));
|
|
90
90
|
}
|
|
@@ -97,7 +97,7 @@ export function MapLayerDroppable(props) {
|
|
|
97
97
|
const index = { index: indexInDisplayStyle, isOverlay: activeLayer.isOverlay };
|
|
98
98
|
const layer = props.activeViewport.displayStyle.mapLayerAtIndex(index);
|
|
99
99
|
if (layer instanceof ImageMapLayerSettings) {
|
|
100
|
-
UiFramework.dialogs.modal.open(_jsx(MapUrlDialog, { activeViewport: props.activeViewport,
|
|
100
|
+
UiFramework.dialogs.modal.open(_jsx(MapUrlDialog, { activeViewport: props.activeViewport, signInModeArgs: { layer }, onOkResult: (sourceState) => handleOk(index, sourceState), onCancelResult: () => {
|
|
101
101
|
UiFramework.dialogs.modal.close();
|
|
102
102
|
}, mapLayerOptions: props.mapLayerOptions }));
|
|
103
103
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MapLayerDroppable.js","sourceRoot":"","sources":["../../../../src/ui/widget/MapLayerDroppable.tsx"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG,2CAA2C;AA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,qBAAqB,CAAC,IAAI,EAAE,SAAS,EAAE,KAAK,CAAC,SAAS,GAAI,IACvH,CACJ,GACG,CACP,CAAC;QACJ,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC;IAED,SAAS,eAAe,CAAC,YAA+B,EAAE,YAAoC;QAC5F,OAAO,CACL,eACE,SAAS,EAAE,0BAA0B,YAAY,CAAC,cAAc,IAAI,aAAa,CAAC,CAAC,CAAC,uBAAuB,CAAC,CAAC,CAAC,EAAE,EAAE,EAClH,GAAG,EAAE,YAAY,CAAC,QAAQ,KACtB,YAAY,CAAC,cAAc,aAE9B,sBAAsB,CAAC,YAAY,CAAC,EAKrC,cAAK,KAAK,EAAE,aAAa,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,YAAG,YAAY,CAAC,WAAW,GAAO,IACzF,CACP,CAAC;IACJ,CAAC;IAED,OAAO,CACL,KAAC,SAAS,IAAC,WAAW,EAAE,WAAW,EAAE,WAAW,EAAE,UAAU,EAAE,oBAAoB,EAAE,KAAK,CAAC,oBAA2B,YAClH,eAAe,GACN,CACb,CAAC;AACJ,CAAC","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// cSpell:ignore droppable Sublayer Basemap\n\n// the following quiet warning caused by react-beautiful-dnd package\n\nimport \"./MapLayerManager.scss\";\nimport * as React from \"react\";\nimport { Draggable, Droppable } from \"react-beautiful-dnd\";\nimport { UiFramework } from \"@itwin/appui-react\";\nimport { assert } from \"@itwin/core-bentley\";\nimport { ImageMapLayerSettings } from \"@itwin/core-common\";\nimport { IModelApp, MapLayerImageryProviderStatus, MapTileTreeScaleRangeVisibility, NotifyMessageDetails, OutputMessagePriority } from \"@itwin/core-frontend\";\nimport { SvgStatusWarning, SvgVisibilityHide, SvgVisibilityShow } from \"@itwin/itwinui-icons-react\";\nimport { Button, Checkbox } from \"@itwin/itwinui-react\";\nimport { MapLayersUI } from \"../../mapLayers\";\nimport { AttachLayerButtonType, AttachLayerPopupButton } from \"./AttachLayerPopupButton\";\nimport { MapLayerSettingsMenu } from \"./MapLayerSettingsMenu\";\nimport { MapUrlDialog } from \"./MapUrlDialog\";\nimport { SubLayersPopupButton } from \"./SubLayersPopupButton\";\n\nimport type { DraggableChildrenFn, DroppableProvided, DroppableStateSnapshot } from \"react-beautiful-dnd\";\nimport type { SubLayerId } from \"@itwin/core-common\";\nimport type { MapLayerIndex, ScreenViewport } from \"@itwin/core-frontend\";\nimport type { MapLayerOptions, StyleMapLayerSettings } from \"../Interfaces\";\nimport type { SourceState } from \"./MapUrlDialog\";\n/** @internal */\ninterface MapLayerDroppableProps {\n isOverlay: boolean;\n layersList?: StyleMapLayerSettings[];\n mapLayerOptions?: MapLayerOptions;\n getContainerForClone: () => HTMLElement;\n activeViewport: ScreenViewport;\n onMenuItemSelected: (action: string, mapLayerSettings: StyleMapLayerSettings) => void;\n onItemVisibilityToggleClicked: (mapLayerSettings: StyleMapLayerSettings) => void;\n onItemSelected: (isOverlay: boolean, index: number) => void;\n onItemEdited: () => void;\n disabled?: boolean;\n}\n\nconst changeVisibilityByElementId = (element: Element | null, visible: boolean) => {\n if (element) {\n element.setAttribute(\"style\", `visibility: ${visible ? \"visible\" : \"hidden\"}`);\n }\n};\n\n/** @internal */\nexport function MapLayerDroppable(props: MapLayerDroppableProps) {\n const containsLayer = props.layersList && props.layersList.length > 0;\n const droppableId = props.isOverlay ? \"overlayMapLayers\" : \"backgroundMapLayers\";\n const [toggleVisibility] = React.useState(MapLayersUI.localization.getLocalizedString(\"mapLayers:Widget.ToggleVisibility\"));\n const [requireAuthTooltip] = React.useState(MapLayersUI.localization.getLocalizedString(\"mapLayers:Widget.RequireAuthTooltip\"));\n const [noBackgroundMapsSpecifiedLabel] = React.useState(MapLayersUI.localization.getLocalizedString(\"mapLayers:Widget.NoBackgroundLayers\"));\n const [noUnderlaysSpecifiedLabel] = React.useState(MapLayersUI.localization.getLocalizedString(\"mapLayers:Widget.NoOverlayLayers\"));\n const [dropLayerLabel] = React.useState(MapLayersUI.localization.getLocalizedString(\"mapLayers:Widget.DropLayerLabel\"));\n const [outOfRangeTitle] = React.useState(MapLayersUI.localization.getLocalizedString(\"mapLayers:Widget.layerOutOfRange\"));\n\n const onSubLayerStateChange = (activeLayer: StyleMapLayerSettings, subLayerId: SubLayerId, isSelected: boolean) => {\n const mapLayerStyleIdx = props.activeViewport.displayStyle.findMapLayerIndexByNameAndSource(activeLayer.name, activeLayer.source, activeLayer.isOverlay);\n if (mapLayerStyleIdx !== -1 && activeLayer.subLayers) {\n props.activeViewport.displayStyle.changeMapSubLayerProps({ visible: isSelected }, subLayerId, {\n index: mapLayerStyleIdx,\n isOverlay: activeLayer.isOverlay,\n });\n }\n };\n\n const handleOk = React.useCallback(\n (index: MapLayerIndex, sourceState?: SourceState) => {\n UiFramework.dialogs.modal.close();\n\n const source = sourceState?.source;\n const vp = props?.activeViewport;\n if (vp === undefined || sourceState === undefined || source === undefined) {\n const error = MapLayersUI.localization.getLocalizedString(\"mapLayers:Messages.MapLayerAttachMissingViewOrSource\");\n const msg = MapLayersUI.localization.getLocalizedString(\"mapLayers:Messages.MapLayerAttachError\", { error, sourceName: source?.name ?? \"\" });\n IModelApp.notifications.outputMessage(new NotifyMessageDetails(OutputMessagePriority.Error, msg));\n return;\n }\n\n const validation = sourceState.validation;\n\n // Layer is already attached,\n // This calls invalidateRenderPlan()\n vp.displayStyle.changeMapLayerProps({ subLayers: validation.subLayers }, index);\n vp.displayStyle.changeMapLayerCredentials(index, source.userName, source.password);\n\n // Either initial attach/initialize failed or the layer failed to load at least one tile\n // because of an invalid token; in both cases tile tree needs to be fully reset\n const provider = vp.getMapLayerImageryProvider(index);\n provider?.resetStatus();\n vp.resetMapLayer(index);\n\n props.onItemEdited();\n },\n [props],\n );\n\n const changeSettingsMenuVisibility = (event: React.MouseEvent<HTMLDivElement, MouseEvent>, visible: boolean) => {\n changeVisibilityByElementId(event.currentTarget.querySelector(\"#MapLayerSettingsMenuWrapper\"), visible);\n changeVisibilityByElementId(event.currentTarget.querySelector(\"#MapLayerSettingsSubLayersMenu\"), visible);\n };\n\n const renderItem: DraggableChildrenFn = (dragProvided, _, rubric) => {\n assert(props.layersList !== undefined);\n const activeLayer = props.layersList[rubric.source.index];\n const outOfRange = activeLayer.treeVisibility === MapTileTreeScaleRangeVisibility.Hidden;\n\n return (\n <div\n className=\"map-manager-source-item\"\n data-id={rubric.source.index}\n key={activeLayer.name}\n {...dragProvided.draggableProps}\n ref={dragProvided.innerRef}\n onMouseEnter={(event) => changeSettingsMenuVisibility(event, true)}\n onMouseLeave={(event) => changeSettingsMenuVisibility(event, false)}\n >\n {/* Checkbox */}\n <Checkbox\n data-testid={\"select-item-checkbox\"}\n checked={activeLayer.selected}\n onChange={(event: React.ChangeEvent<HTMLInputElement>) => {\n activeLayer.selected = event.target.checked;\n props.onItemSelected(props.isOverlay, rubric.source.index);\n }}\n ></Checkbox>\n {/* Visibility icon */}\n <Button\n disabled={props.disabled}\n size=\"small\"\n styleType=\"borderless\"\n className=\"map-manager-item-visibility map-manager-visibility-icon\"\n title={toggleVisibility}\n onClick={() => {\n props.onItemVisibilityToggleClicked(activeLayer);\n }}\n >\n {activeLayer.visible ? <SvgVisibilityShow data-testid=\"layer-visibility-icon-show\" /> : <SvgVisibilityHide data-testid=\"layer-visibility-icon-hide\" />}\n </Button>\n\n {/* Label */}\n <span\n className={props.disabled || outOfRange ? \"map-manager-item-label-disabled\" : \"map-manager-item-label\"}\n title={outOfRange ? outOfRangeTitle : undefined}\n {...dragProvided.dragHandleProps}\n >\n {activeLayer.name}\n {/* eslint-disable-next-line @itwin/no-internal */}\n {activeLayer.provider?.status === MapLayerImageryProviderStatus.RequireAuth && (\n <Button\n disabled={props.disabled}\n size=\"small\"\n styleType=\"borderless\"\n onClick={() => {\n const indexInDisplayStyle = props.activeViewport?.displayStyle.findMapLayerIndexByNameAndSource(\n activeLayer.name,\n activeLayer.source,\n activeLayer.isOverlay,\n );\n if (indexInDisplayStyle !== undefined && indexInDisplayStyle >= 0) {\n const index = { index: indexInDisplayStyle, isOverlay: activeLayer.isOverlay };\n const layer = props.activeViewport.displayStyle.mapLayerAtIndex(index);\n if (layer instanceof ImageMapLayerSettings) {\n UiFramework.dialogs.modal.open(\n <MapUrlDialog\n activeViewport={props.activeViewport}\n isOverlay={props.isOverlay}\n signInModeArgs={{ layer }}\n onOkResult={(sourceState?: SourceState) => handleOk(index, sourceState)}\n onCancelResult={() => {\n UiFramework.dialogs.modal.close();\n }}\n mapLayerOptions={props.mapLayerOptions}\n />,\n );\n }\n }\n }}\n title={requireAuthTooltip}\n >\n <SvgStatusWarning />\n </Button>\n )}\n </span>\n\n {/* SubLayersPopupButton */}\n <div id=\"MapLayerSettingsSubLayersMenu\" style={{ visibility: \"hidden\" }} className=\"map-manager-item-sub-layer-container\">\n {activeLayer.subLayers && activeLayer.subLayers.length > 1 && (\n <SubLayersPopupButton\n checkboxStyle=\"eye\"\n expandMode=\"rootGroupOnly\"\n subLayers={props.activeViewport ? activeLayer.subLayers : undefined}\n singleVisibleSubLayer={activeLayer.provider?.mutualExclusiveSubLayer}\n onSubLayerStateChange={(subLayerId: SubLayerId, isSelected: boolean) => {\n onSubLayerStateChange(activeLayer, subLayerId, isSelected);\n }}\n />\n )}\n </div>\n {/* eslint-disable-next-line @itwin/no-internal */}\n {activeLayer.provider?.status === MapLayerImageryProviderStatus.RequireAuth && (\n <Button\n disabled={props.disabled}\n size=\"small\"\n styleType=\"borderless\"\n onClick={() => {\n const indexInDisplayStyle = props.activeViewport?.displayStyle.findMapLayerIndexByNameAndSource(\n activeLayer.name,\n activeLayer.source,\n activeLayer.isOverlay,\n );\n if (indexInDisplayStyle !== undefined && indexInDisplayStyle >= 0) {\n const index = { index: indexInDisplayStyle, isOverlay: activeLayer.isOverlay };\n const layer = props.activeViewport.displayStyle.mapLayerAtIndex(index);\n if (layer instanceof ImageMapLayerSettings) {\n UiFramework.dialogs.modal.open(\n <MapUrlDialog\n activeViewport={props.activeViewport}\n isOverlay={props.isOverlay}\n signInModeArgs={{ layer }}\n onOkResult={(sourceState?: SourceState) => handleOk(index, sourceState)}\n onCancelResult={() => {\n UiFramework.dialogs.modal.close();\n }}\n mapLayerOptions={props.mapLayerOptions}\n />,\n );\n }\n }\n }}\n title={requireAuthTooltip}\n >\n <SvgStatusWarning />\n </Button>\n )}\n <div id=\"MapLayerSettingsMenuWrapper\" style={{ visibility: \"hidden\" }}>\n <MapLayerSettingsMenu\n activeViewport={props.activeViewport}\n mapLayerSettings={activeLayer}\n onMenuItemSelection={props.onMenuItemSelected}\n disabled={props.disabled}\n />\n </div>\n </div>\n );\n };\n\n function renderDraggableContent(snapshot: DroppableStateSnapshot): React.ReactNode {\n let node: React.ReactNode;\n if (containsLayer) {\n // Render a <Draggable>\n node = props.layersList?.map((mapLayerSettings, i) => (\n <Draggable isDragDisabled={props.disabled} key={mapLayerSettings.name} draggableId={mapLayerSettings.name} index={i}>\n {renderItem}\n </Draggable>\n ));\n } else {\n // Render a label that provide a 'Drop here' hint\n const label = props.isOverlay ? noUnderlaysSpecifiedLabel : noBackgroundMapsSpecifiedLabel;\n node = (\n <div title={label} className=\"map-manager-no-layers-container\">\n {snapshot.isDraggingOver ? (\n <span className=\"map-manager-no-layers-label\">{dropLayerLabel}</span>\n ) : (\n <>\n <span className=\"map-manager-no-layers-label\">{label}</span>\n <AttachLayerPopupButton disabled={props.disabled} buttonType={AttachLayerButtonType.Blue} isOverlay={props.isOverlay} />\n </>\n )}\n </div>\n );\n }\n return node;\n }\n\n function renderDraggable(dropProvided: DroppableProvided, dropSnapshot: DroppableStateSnapshot): React.ReactElement<HTMLElement> {\n return (\n <div\n className={`map-manager-attachments${dropSnapshot.isDraggingOver && containsLayer ? \" is-dragging-map-over\" : \"\"}`}\n ref={dropProvided.innerRef}\n {...dropProvided.droppableProps}\n >\n {renderDraggableContent(dropSnapshot)}\n\n {/* We don't want a placeholder when displaying the 'Drop here' message\n Unfortunately, if don't add it, 'react-beautiful-dnd' show an error message in the console.\n So I simply make it hidden. See https://github.com/atlassian/react-beautiful-dnd/issues/518 */}\n <div style={containsLayer ? undefined : { display: \"none\" }}>{dropProvided.placeholder}</div>\n </div>\n );\n }\n\n return (\n <Droppable droppableId={droppableId} renderClone={renderItem} getContainerForClone={props.getContainerForClone as any}>\n {renderDraggable}\n </Droppable>\n );\n}\n"]}
|
|
1
|
+
{"version":3,"file":"MapLayerDroppable.js","sourceRoot":"","sources":["../../../../src/ui/widget/MapLayerDroppable.tsx"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG,2CAA2C;AAE3C,oEAAoE;AAEpE,OAAO,wBAAwB,CAAC;AAChC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAC3D,OAAO,EAAE,SAAS,EAAE,6BAA6B,EAAE,+BAA+B,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAC9J,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AACpG,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAE,qBAAqB,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AACzF,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,YAAY,EAAE,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,SAAS,CAAC,CAAC,CAAC,yBAAyB,CAAC,CAAC,CAAC,8BAA8B,CAAC;YAC3F,IAAI,GAAG,CACL,cAAK,KAAK,EAAE,KAAK,EAAE,SAAS,EAAC,iCAAiC,YAC3D,QAAQ,CAAC,cAAc,CAAC,CAAC,CAAC,CACzB,eAAM,SAAS,EAAC,6BAA6B,YAAE,cAAc,GAAQ,CACtE,CAAC,CAAC,CAAC,CACF,8BACE,eAAM,SAAS,EAAC,6BAA6B,YAAE,KAAK,GAAQ,EAC5D,KAAC,sBAAsB,IAAC,QAAQ,EAAE,KAAK,CAAC,QAAQ,EAAE,UAAU,EAAE,qBAAqB,CAAC,IAAI,EAAE,SAAS,EAAE,KAAK,CAAC,SAAS,GAAI,IACvH,CACJ,GACG,CACP,CAAC;QACJ,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC;IAED,SAAS,eAAe,CAAC,YAA+B,EAAE,YAAoC;QAC5F,OAAO,CACL,eACE,SAAS,EAAE,0BAA0B,YAAY,CAAC,cAAc,IAAI,aAAa,CAAC,CAAC,CAAC,uBAAuB,CAAC,CAAC,CAAC,EAAE,EAAE,EAClH,GAAG,EAAE,YAAY,CAAC,QAAQ,KACtB,YAAY,CAAC,cAAc,aAE9B,sBAAsB,CAAC,YAAY,CAAC,EAKrC,cAAK,KAAK,EAAE,aAAa,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,YAAG,YAAY,CAAC,WAAW,GAAO,IACzF,CACP,CAAC;IACJ,CAAC;IAED,OAAO,CACL,KAAC,SAAS,IAAC,WAAW,EAAE,WAAW,EAAE,WAAW,EAAE,UAAU,EAAE,oBAAoB,EAAE,KAAK,CAAC,oBAA2B,YAClH,eAAe,GACN,CACb,CAAC;AACJ,CAAC","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// cSpell:ignore droppable Sublayer Basemap\n\n// the following quiet warning caused by react-beautiful-dnd package\n\nimport \"./MapLayerManager.scss\";\nimport * as React from \"react\";\nimport { Draggable, Droppable } from \"react-beautiful-dnd\";\nimport { UiFramework } from \"@itwin/appui-react\";\nimport { assert } from \"@itwin/core-bentley\";\nimport { ImageMapLayerSettings } from \"@itwin/core-common\";\nimport { IModelApp, MapLayerImageryProviderStatus, MapTileTreeScaleRangeVisibility, NotifyMessageDetails, OutputMessagePriority } from \"@itwin/core-frontend\";\nimport { SvgStatusWarning, SvgVisibilityHide, SvgVisibilityShow } from \"@itwin/itwinui-icons-react\";\nimport { Button, Checkbox } from \"@itwin/itwinui-react\";\nimport { MapLayersUI } from \"../../mapLayers\";\nimport { AttachLayerButtonType, AttachLayerPopupButton } from \"./AttachLayerPopupButton\";\nimport { MapLayerSettingsMenu } from \"./MapLayerSettingsMenu\";\nimport { MapUrlDialog } from \"./MapUrlDialog\";\nimport { SubLayersPopupButton } from \"./SubLayersPopupButton\";\n\nimport type { DraggableChildrenFn, DroppableProvided, DroppableStateSnapshot } from \"react-beautiful-dnd\";\nimport type { SubLayerId } from \"@itwin/core-common\";\nimport type { MapLayerIndex, ScreenViewport } from \"@itwin/core-frontend\";\nimport type { MapLayerOptions, StyleMapLayerSettings } from \"../Interfaces\";\nimport type { SourceState } from \"./MapUrlDialog\";\n/** @internal */\ninterface MapLayerDroppableProps {\n isOverlay: boolean;\n layersList?: StyleMapLayerSettings[];\n mapLayerOptions?: MapLayerOptions;\n getContainerForClone: () => HTMLElement;\n activeViewport: ScreenViewport;\n onMenuItemSelected: (action: string, mapLayerSettings: StyleMapLayerSettings) => void;\n onItemVisibilityToggleClicked: (mapLayerSettings: StyleMapLayerSettings) => void;\n onItemSelected: (isOverlay: boolean, index: number) => void;\n onItemEdited: () => void;\n disabled?: boolean;\n}\n\nconst changeVisibilityByElementId = (element: Element | null, visible: boolean) => {\n if (element) {\n element.setAttribute(\"style\", `visibility: ${visible ? \"visible\" : \"hidden\"}`);\n }\n};\n\n/** @internal */\nexport function MapLayerDroppable(props: MapLayerDroppableProps) {\n const containsLayer = props.layersList && props.layersList.length > 0;\n const droppableId = props.isOverlay ? \"overlayMapLayers\" : \"backgroundMapLayers\";\n const [toggleVisibility] = React.useState(MapLayersUI.localization.getLocalizedString(\"mapLayers:Widget.ToggleVisibility\"));\n const [requireAuthTooltip] = React.useState(MapLayersUI.localization.getLocalizedString(\"mapLayers:Widget.RequireAuthTooltip\"));\n const [noBackgroundMapsSpecifiedLabel] = React.useState(MapLayersUI.localization.getLocalizedString(\"mapLayers:Widget.NoBackgroundLayers\"));\n const [noUnderlaysSpecifiedLabel] = React.useState(MapLayersUI.localization.getLocalizedString(\"mapLayers:Widget.NoOverlayLayers\"));\n const [dropLayerLabel] = React.useState(MapLayersUI.localization.getLocalizedString(\"mapLayers:Widget.DropLayerLabel\"));\n const [outOfRangeTitle] = React.useState(MapLayersUI.localization.getLocalizedString(\"mapLayers:Widget.layerOutOfRange\"));\n\n const onSubLayerStateChange = (activeLayer: StyleMapLayerSettings, subLayerId: SubLayerId, isSelected: boolean) => {\n const mapLayerStyleIdx = props.activeViewport.displayStyle.findMapLayerIndexByNameAndSource(activeLayer.name, activeLayer.source, activeLayer.isOverlay);\n if (mapLayerStyleIdx !== -1 && activeLayer.subLayers) {\n props.activeViewport.displayStyle.changeMapSubLayerProps({ visible: isSelected }, subLayerId, {\n index: mapLayerStyleIdx,\n isOverlay: activeLayer.isOverlay,\n });\n }\n };\n\n const handleOk = React.useCallback(\n (index: MapLayerIndex, sourceState?: SourceState) => {\n UiFramework.dialogs.modal.close();\n\n const source = sourceState?.source;\n const vp = props?.activeViewport;\n if (vp === undefined || sourceState === undefined || source === undefined) {\n const error = MapLayersUI.localization.getLocalizedString(\"mapLayers:Messages.MapLayerAttachMissingViewOrSource\");\n const msg = MapLayersUI.localization.getLocalizedString(\"mapLayers:Messages.MapLayerAttachError\", { error, sourceName: source?.name ?? \"\" });\n IModelApp.notifications.outputMessage(new NotifyMessageDetails(OutputMessagePriority.Error, msg));\n return;\n }\n\n const validation = sourceState.validation;\n\n // Layer is already attached,\n // This calls invalidateRenderPlan()\n vp.displayStyle.changeMapLayerProps({ subLayers: validation.subLayers }, index);\n vp.displayStyle.changeMapLayerCredentials(index, source.userName, source.password);\n\n // Either initial attach/initialize failed or the layer failed to load at least one tile\n // because of an invalid token; in both cases tile tree needs to be fully reset\n const provider = vp.getMapLayerImageryProvider(index);\n provider?.resetStatus();\n vp.resetMapLayer(index);\n\n props.onItemEdited();\n },\n [props],\n );\n\n const changeSettingsMenuVisibility = (event: React.MouseEvent<HTMLDivElement, MouseEvent>, visible: boolean) => {\n changeVisibilityByElementId(event.currentTarget.querySelector(\"#MapLayerSettingsMenuWrapper\"), visible);\n changeVisibilityByElementId(event.currentTarget.querySelector(\"#MapLayerSettingsSubLayersMenu\"), visible);\n };\n\n const renderItem: DraggableChildrenFn = (dragProvided, _, rubric) => {\n assert(props.layersList !== undefined);\n const activeLayer = props.layersList[rubric.source.index];\n const outOfRange = activeLayer.treeVisibility === MapTileTreeScaleRangeVisibility.Hidden;\n\n return (\n <div\n className=\"map-manager-source-item\"\n data-id={rubric.source.index}\n key={activeLayer.name}\n {...dragProvided.draggableProps}\n ref={dragProvided.innerRef}\n onMouseEnter={(event) => changeSettingsMenuVisibility(event, true)}\n onMouseLeave={(event) => changeSettingsMenuVisibility(event, false)}\n >\n {/* Checkbox */}\n <Checkbox\n data-testid={\"select-item-checkbox\"}\n checked={activeLayer.selected}\n onChange={(event: React.ChangeEvent<HTMLInputElement>) => {\n activeLayer.selected = event.target.checked;\n props.onItemSelected(props.isOverlay, rubric.source.index);\n }}\n ></Checkbox>\n {/* Visibility icon */}\n <Button\n disabled={props.disabled}\n size=\"small\"\n styleType=\"borderless\"\n className=\"map-manager-item-visibility map-manager-visibility-icon\"\n title={toggleVisibility}\n onClick={() => {\n props.onItemVisibilityToggleClicked(activeLayer);\n }}\n >\n {activeLayer.visible ? <SvgVisibilityShow data-testid=\"layer-visibility-icon-show\" /> : <SvgVisibilityHide data-testid=\"layer-visibility-icon-hide\" />}\n </Button>\n\n {/* Label */}\n <span\n className={props.disabled || outOfRange ? \"map-manager-item-label-disabled\" : \"map-manager-item-label\"}\n title={outOfRange ? outOfRangeTitle : undefined}\n {...dragProvided.dragHandleProps}\n >\n {activeLayer.name}\n {/* eslint-disable-next-line @itwin/no-internal */}\n {activeLayer.provider?.status === MapLayerImageryProviderStatus.RequireAuth && (\n <Button\n disabled={props.disabled}\n size=\"small\"\n styleType=\"borderless\"\n onClick={() => {\n const indexInDisplayStyle = props.activeViewport?.displayStyle.findMapLayerIndexByNameAndSource(\n activeLayer.name,\n activeLayer.source,\n activeLayer.isOverlay,\n );\n if (indexInDisplayStyle !== undefined && indexInDisplayStyle >= 0) {\n const index = { index: indexInDisplayStyle, isOverlay: activeLayer.isOverlay };\n const layer = props.activeViewport.displayStyle.mapLayerAtIndex(index);\n if (layer instanceof ImageMapLayerSettings) {\n UiFramework.dialogs.modal.open(\n <MapUrlDialog\n activeViewport={props.activeViewport}\n signInModeArgs={{ layer }}\n onOkResult={(sourceState?: SourceState) => handleOk(index, sourceState)}\n onCancelResult={() => {\n UiFramework.dialogs.modal.close();\n }}\n mapLayerOptions={props.mapLayerOptions}\n />,\n );\n }\n }\n }}\n title={requireAuthTooltip}\n >\n <SvgStatusWarning />\n </Button>\n )}\n </span>\n\n {/* SubLayersPopupButton */}\n <div id=\"MapLayerSettingsSubLayersMenu\" style={{ visibility: \"hidden\" }} className=\"map-manager-item-sub-layer-container\">\n {activeLayer.subLayers && activeLayer.subLayers.length > 1 && (\n <SubLayersPopupButton\n checkboxStyle=\"eye\"\n expandMode=\"rootGroupOnly\"\n subLayers={props.activeViewport ? activeLayer.subLayers : undefined}\n singleVisibleSubLayer={activeLayer.provider?.mutualExclusiveSubLayer}\n onSubLayerStateChange={(subLayerId: SubLayerId, isSelected: boolean) => {\n onSubLayerStateChange(activeLayer, subLayerId, isSelected);\n }}\n />\n )}\n </div>\n {/* eslint-disable-next-line @itwin/no-internal */}\n {activeLayer.provider?.status === MapLayerImageryProviderStatus.RequireAuth && (\n <Button\n disabled={props.disabled}\n size=\"small\"\n styleType=\"borderless\"\n onClick={() => {\n const indexInDisplayStyle = props.activeViewport?.displayStyle.findMapLayerIndexByNameAndSource(\n activeLayer.name,\n activeLayer.source,\n activeLayer.isOverlay,\n );\n if (indexInDisplayStyle !== undefined && indexInDisplayStyle >= 0) {\n const index = { index: indexInDisplayStyle, isOverlay: activeLayer.isOverlay };\n const layer = props.activeViewport.displayStyle.mapLayerAtIndex(index);\n if (layer instanceof ImageMapLayerSettings) {\n UiFramework.dialogs.modal.open(\n <MapUrlDialog\n activeViewport={props.activeViewport}\n signInModeArgs={{ layer }}\n onOkResult={(sourceState?: SourceState) => handleOk(index, sourceState)}\n onCancelResult={() => {\n UiFramework.dialogs.modal.close();\n }}\n mapLayerOptions={props.mapLayerOptions}\n />,\n );\n }\n }\n }}\n title={requireAuthTooltip}\n >\n <SvgStatusWarning />\n </Button>\n )}\n <div id=\"MapLayerSettingsMenuWrapper\" style={{ visibility: \"hidden\" }}>\n <MapLayerSettingsMenu\n activeViewport={props.activeViewport}\n mapLayerSettings={activeLayer}\n onMenuItemSelection={props.onMenuItemSelected}\n disabled={props.disabled}\n />\n </div>\n </div>\n );\n };\n\n function renderDraggableContent(snapshot: DroppableStateSnapshot): React.ReactNode {\n let node: React.ReactNode;\n if (containsLayer) {\n // Render a <Draggable>\n node = props.layersList?.map((mapLayerSettings, i) => (\n <Draggable isDragDisabled={props.disabled} key={mapLayerSettings.name} draggableId={mapLayerSettings.name} index={i}>\n {renderItem}\n </Draggable>\n ));\n } else {\n // Render a label that provide a 'Drop here' hint\n const label = props.isOverlay ? noUnderlaysSpecifiedLabel : noBackgroundMapsSpecifiedLabel;\n node = (\n <div title={label} className=\"map-manager-no-layers-container\">\n {snapshot.isDraggingOver ? (\n <span className=\"map-manager-no-layers-label\">{dropLayerLabel}</span>\n ) : (\n <>\n <span className=\"map-manager-no-layers-label\">{label}</span>\n <AttachLayerPopupButton disabled={props.disabled} buttonType={AttachLayerButtonType.Blue} isOverlay={props.isOverlay} />\n </>\n )}\n </div>\n );\n }\n return node;\n }\n\n function renderDraggable(dropProvided: DroppableProvided, dropSnapshot: DroppableStateSnapshot): React.ReactElement<HTMLElement> {\n return (\n <div\n className={`map-manager-attachments${dropSnapshot.isDraggingOver && containsLayer ? \" is-dragging-map-over\" : \"\"}`}\n ref={dropProvided.innerRef}\n {...dropProvided.droppableProps}\n >\n {renderDraggableContent(dropSnapshot)}\n\n {/* We don't want a placeholder when displaying the 'Drop here' message\n Unfortunately, if don't add it, 'react-beautiful-dnd' show an error message in the console.\n So I simply make it hidden. See https://github.com/atlassian/react-beautiful-dnd/issues/518 */}\n <div style={containsLayer ? undefined : { display: \"none\" }}>{dropProvided.placeholder}</div>\n </div>\n );\n }\n\n return (\n <Droppable droppableId={droppableId} renderClone={renderItem} getContainerForClone={props.getContainerForClone as any}>\n {renderDraggable}\n </Droppable>\n );\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MapLayerSettingsPopupButton.d.ts","sourceRoot":"","sources":["../../../../src/ui/widget/MapLayerSettingsPopupButton.tsx"],"names":[],"mappings":"AAKA,OAAO,oCAAoC,CAAC;
|
|
1
|
+
{"version":3,"file":"MapLayerSettingsPopupButton.d.ts","sourceRoot":"","sources":["../../../../src/ui/widget/MapLayerSettingsPopupButton.tsx"],"names":[],"mappings":"AAKA,OAAO,oCAAoC,CAAC;AAO5C,MAAM,WAAW,gCAAgC;IAC/C,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,aAAa;AACb,wBAAgB,2BAA2B,CAAC,KAAK,EAAE,gCAAgC,2CA4DlF"}
|
|
@@ -1,14 +1,12 @@
|
|
|
1
|
-
import { jsx as _jsx, Fragment as _Fragment
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
/*---------------------------------------------------------------------------------------------
|
|
3
3
|
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
4
4
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
5
5
|
*--------------------------------------------------------------------------------------------*/
|
|
6
6
|
import "./MapLayerSettingsPopupButton.scss";
|
|
7
7
|
import * as React from "react";
|
|
8
|
-
import { RelativePosition } from "@itwin/appui-abstract";
|
|
9
|
-
import { Popup } from "@itwin/core-react";
|
|
10
8
|
import { SvgSettings } from "@itwin/itwinui-icons-react";
|
|
11
|
-
import { IconButton } from "@itwin/itwinui-react";
|
|
9
|
+
import { IconButton, Popover } from "@itwin/itwinui-react";
|
|
12
10
|
import { MapLayersUI } from "../../mapLayers";
|
|
13
11
|
import { MapManagerSettings } from "./MapManagerSettings";
|
|
14
12
|
/** @alpha */
|
|
@@ -16,14 +14,11 @@ export function MapLayerSettingsPopupButton(props) {
|
|
|
16
14
|
const panelRef = React.useRef(null);
|
|
17
15
|
const [isSettingsOpen, setIsSettingsOpen] = React.useState(false);
|
|
18
16
|
const [buttonTooltip] = React.useState(MapLayersUI.localization.getLocalizedString("mapLayers:Widget.SettingsButtonTooltip"));
|
|
17
|
+
const [handleOutsideClick, setHandleOutsideClick] = React.useState(true);
|
|
19
18
|
const buttonRef = React.useRef(null);
|
|
20
|
-
const togglePopupDisplay = React.useCallback((
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
}, [setIsSettingsOpen]);
|
|
24
|
-
const handleCloseSetting = React.useCallback(() => {
|
|
25
|
-
setIsSettingsOpen(false);
|
|
26
|
-
}, [setIsSettingsOpen]);
|
|
19
|
+
const togglePopupDisplay = React.useCallback(() => {
|
|
20
|
+
setIsSettingsOpen(!isSettingsOpen);
|
|
21
|
+
}, [isSettingsOpen]);
|
|
27
22
|
const isInsideCoreDialog = React.useCallback((element) => {
|
|
28
23
|
if (element.nodeName === "DIV") {
|
|
29
24
|
if (element.classList && element.classList.contains("core-dialog")) {
|
|
@@ -41,21 +36,6 @@ export function MapLayerSettingsPopupButton(props) {
|
|
|
41
36
|
}
|
|
42
37
|
return false;
|
|
43
38
|
}, []);
|
|
44
|
-
|
|
45
|
-
if (isInsideCoreDialog(event.target)) {
|
|
46
|
-
return;
|
|
47
|
-
}
|
|
48
|
-
// If clicking on button that open panel - don't trigger outside click processing
|
|
49
|
-
if (buttonRef?.current && buttonRef?.current.contains(event.target)) {
|
|
50
|
-
return;
|
|
51
|
-
}
|
|
52
|
-
// If clicking the panel, this is not an outside clicked
|
|
53
|
-
if (panelRef.current && panelRef?.current.contains(event.target)) {
|
|
54
|
-
return;
|
|
55
|
-
}
|
|
56
|
-
// If we reach this point, we got an outside clicked, no close the popup
|
|
57
|
-
setIsSettingsOpen(false);
|
|
58
|
-
}, [isInsideCoreDialog]);
|
|
59
|
-
return (_jsxs(_Fragment, { children: [_jsx(IconButton, { disabled: props.disabled, styleType: "borderless", label: buttonTooltip, className: "maplayers-settings-popup-button", onClick: togglePopupDisplay, ref: buttonRef, children: _jsx(SvgSettings, {}) }), _jsx(Popup, { className: "maplayers-settings-popup", isOpen: isSettingsOpen, position: RelativePosition.BottomRight, onClose: handleCloseSetting, target: buttonRef.current, onOutsideClick: handleOutsideClick, repositionOnResize: true, children: _jsx("div", { ref: panelRef, className: "maplayers-settings-popup-panel", children: _jsx(MapManagerSettings, {}) }) })] }));
|
|
39
|
+
return (_jsx(_Fragment, { children: _jsx(Popover, { className: "maplayers-settings-popup", content: _jsx("div", { ref: panelRef, className: "maplayers-settings-popup-panel", children: _jsx(MapManagerSettings, { onHandleOutsideClick: setHandleOutsideClick }) }), visible: isSettingsOpen, onVisibleChange: setIsSettingsOpen, placement: "bottom-end", closeOnOutsideClick: handleOutsideClick, applyBackground: true, children: _jsx(IconButton, { disabled: props.disabled, styleType: "borderless", label: buttonTooltip, className: "maplayers-settings-popup-button", onClick: togglePopupDisplay, ref: buttonRef, children: _jsx(SvgSettings, {}) }) }) }));
|
|
60
40
|
}
|
|
61
41
|
//# sourceMappingURL=MapLayerSettingsPopupButton.js.map
|