@itwin/map-layers 5.2.1 → 5.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (53) hide show
  1. package/CHANGELOG.md +8 -1
  2. package/lib/cjs/mapLayers.d.ts +2 -1
  3. package/lib/cjs/mapLayers.d.ts.map +1 -1
  4. package/lib/cjs/mapLayers.js +3 -0
  5. package/lib/cjs/mapLayers.js.map +1 -1
  6. package/lib/cjs/public/locales/en/mapLayers.json +14 -3
  7. package/lib/cjs/ui/widget/MapLayerDroppable.d.ts.map +1 -1
  8. package/lib/cjs/ui/widget/MapLayerDroppable.js +7 -4
  9. package/lib/cjs/ui/widget/MapLayerDroppable.js.map +1 -1
  10. package/lib/cjs/ui/widget/MapLayerSettingsPopupButton.d.ts.map +1 -1
  11. package/lib/cjs/ui/widget/MapLayerSettingsPopupButton.js +3 -2
  12. package/lib/cjs/ui/widget/MapLayerSettingsPopupButton.js.map +1 -1
  13. package/lib/cjs/ui/widget/MapSelectFeaturesDialog.d.ts.map +1 -1
  14. package/lib/cjs/ui/widget/MapSelectFeaturesDialog.js +17 -18
  15. package/lib/cjs/ui/widget/MapSelectFeaturesDialog.js.map +1 -1
  16. package/lib/cjs/ui/widget/MapUrlDialog.d.ts.map +1 -1
  17. package/lib/cjs/ui/widget/MapUrlDialog.js +15 -6
  18. package/lib/cjs/ui/widget/MapUrlDialog.js.map +1 -1
  19. package/lib/cjs/ui/widget/MapUrlDialog.scss +39 -10
  20. package/lib/cjs/ui/widget/SelectMapFormat.d.ts.map +1 -1
  21. package/lib/cjs/ui/widget/SelectMapFormat.js +2 -2
  22. package/lib/cjs/ui/widget/SelectMapFormat.js.map +1 -1
  23. package/lib/cjs/ui/widget/SubLayersTree.d.ts.map +1 -1
  24. package/lib/cjs/ui/widget/SubLayersTree.js +8 -7
  25. package/lib/cjs/ui/widget/SubLayersTree.js.map +1 -1
  26. package/lib/cjs/ui/widget/SubLayersTree.scss +27 -31
  27. package/lib/esm/mapLayers.d.ts +2 -1
  28. package/lib/esm/mapLayers.d.ts.map +1 -1
  29. package/lib/esm/mapLayers.js +3 -0
  30. package/lib/esm/mapLayers.js.map +1 -1
  31. package/lib/esm/public/locales/en/mapLayers.json +14 -3
  32. package/lib/esm/ui/widget/MapLayerDroppable.d.ts.map +1 -1
  33. package/lib/esm/ui/widget/MapLayerDroppable.js +7 -4
  34. package/lib/esm/ui/widget/MapLayerDroppable.js.map +1 -1
  35. package/lib/esm/ui/widget/MapLayerSettingsPopupButton.d.ts.map +1 -1
  36. package/lib/esm/ui/widget/MapLayerSettingsPopupButton.js +5 -4
  37. package/lib/esm/ui/widget/MapLayerSettingsPopupButton.js.map +1 -1
  38. package/lib/esm/ui/widget/MapSelectFeaturesDialog.d.ts.map +1 -1
  39. package/lib/esm/ui/widget/MapSelectFeaturesDialog.js +18 -19
  40. package/lib/esm/ui/widget/MapSelectFeaturesDialog.js.map +1 -1
  41. package/lib/esm/ui/widget/MapUrlDialog.d.ts.map +1 -1
  42. package/lib/esm/ui/widget/MapUrlDialog.js +18 -9
  43. package/lib/esm/ui/widget/MapUrlDialog.js.map +1 -1
  44. package/lib/esm/ui/widget/MapUrlDialog.scss +39 -10
  45. package/lib/esm/ui/widget/SelectMapFormat.d.ts.map +1 -1
  46. package/lib/esm/ui/widget/SelectMapFormat.js +3 -3
  47. package/lib/esm/ui/widget/SelectMapFormat.js.map +1 -1
  48. package/lib/esm/ui/widget/SubLayersTree.d.ts.map +1 -1
  49. package/lib/esm/ui/widget/SubLayersTree.js +10 -9
  50. package/lib/esm/ui/widget/SubLayersTree.js.map +1 -1
  51. package/lib/esm/ui/widget/SubLayersTree.scss +27 -31
  52. package/lib/public/locales/en/mapLayers.json +14 -3
  53. package/package.json +1 -1
@@ -4,27 +4,39 @@
4
4
  *--------------------------------------------------------------------------------------------*/
5
5
  @import "~@itwin/core-react/lib/cjs/core-react/index";
6
6
 
7
- .map-manager-sublayer-tree {
8
- height: 100%;
9
- width: 100%;
10
- display: flex;
11
- flex-direction: column;
7
+ .map-manager-sublayer-panel {
8
+ .map-manager-sublayer-tree {
9
+ height: 100%;
10
+ width: 100%;
11
+ display: flex;
12
+ flex-direction: column;
12
13
 
13
- .core-tree-node {
14
- >.contents {
15
- padding-left: 31px;
14
+ .core-tree-node {
15
+ >.contents {
16
+ padding-left: 31px;
16
17
 
17
- >.core-image-checkbox {
18
- top: 5px;
18
+ >.core-image-checkbox {
19
+ top: 5px;
20
+ }
19
21
  }
20
22
  }
23
+
24
+ .core-image-checkbox {
25
+ position: absolute;
26
+ left: 5px;
27
+ padding: 0;
28
+ margin: -2px 0px 0px 5px;
29
+ }
21
30
  }
31
+ }
32
+
33
+ .map-layer-select-features-dialog {
34
+ .map-manager-sublayer-tree-content {
35
+ .core-tree-node {
36
+ // Revert margin added by ControlledTree on each node (there is no options to disable it)
37
+ margin-left: -28px;
38
+ }
22
39
 
23
- .core-image-checkbox {
24
- position: absolute;
25
- left: 5px;
26
- padding: 0;
27
- margin: -2px 0px 0px 5px;
28
40
  }
29
41
  }
30
42
 
@@ -38,22 +50,6 @@
38
50
  flex-direction: row;
39
51
  flex-wrap: nowrap;
40
52
 
41
- button {
42
- height: 32px;
43
- width: 32px;
44
- background-color: transparent;
45
- color: var(--buic-foreground-body);
46
- border: 1px solid var(--buic-background-toolbutton-stroke);
47
-
48
- &:hover {
49
- color: var(--buic-accessory-primary-tint);
50
- }
51
-
52
- &:focus {
53
- box-shadow: rgba(var(--iui-color-border-accent), var(--iui-opacity-4)) 0px 0px 0px 2px;
54
- outline: none;
55
- }
56
- }
57
53
  }
58
54
 
59
55
  .tree-toolbar-searchbox {
@@ -1,4 +1,4 @@
1
- import { Localization } from "@itwin/core-common";
1
+ import { Localization, TranslationOptions } from "@itwin/core-common";
2
2
  import { UserPreferencesAccess } from "@itwin/core-frontend";
3
3
  export interface MapLayersConfig {
4
4
  localization?: Localization;
@@ -23,5 +23,6 @@ export declare class MapLayersUI {
23
23
  static terminate(): void;
24
24
  /** The internationalization service namespace. */
25
25
  static get localizationNamespace(): string;
26
+ static translate(key: string | string[], options?: TranslationOptions): string;
26
27
  }
27
28
  //# sourceMappingURL=mapLayers.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"mapLayers.d.ts","sourceRoot":"","sources":["../../src/mapLayers.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAa,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAIxE,MAAM,WAAW,eAAe;IAC9B,YAAY,CAAC,EAAE,YAAY,CAAC;IAC5B,kGAAkG;IAClG,WAAW,CAAC,EAAE,qBAAqB,CAAC;CACrC;AAED;;;;;GAKG;AACH,qBAAa,WAAW;IACtB,OAAO,CAAC,MAAM,CAAC,UAAU,CAAe;IACxC,OAAc,YAAY,EAAE,YAAY,CAAC;IACzC,OAAO,CAAC,MAAM,CAAC,mBAAmB,CAAgB;IAClD,OAAO,CAAC,MAAM,CAAC,YAAY,CAAC,CAAwB;IAEpD,WAAkB,WAAW,IAAI,qBAAqB,GAAG,SAAS,CAEjE;IAED,wCAAwC;WACpB,UAAU,CAAC,MAAM,CAAC,EAAE,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC;IAUvE,4EAA4E;WAC9D,SAAS;IAIvB,kDAAkD;IAClD,WAAkB,qBAAqB,IAAI,MAAM,CAEhD;CACF"}
1
+ {"version":3,"file":"mapLayers.d.ts","sourceRoot":"","sources":["../../src/mapLayers.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AACtE,OAAO,EAAa,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAExE,MAAM,WAAW,eAAe;IAC9B,YAAY,CAAC,EAAE,YAAY,CAAC;IAC5B,kGAAkG;IAClG,WAAW,CAAC,EAAE,qBAAqB,CAAC;CACrC;AAED;;;;;GAKG;AACH,qBAAa,WAAW;IACtB,OAAO,CAAC,MAAM,CAAC,UAAU,CAAe;IACxC,OAAc,YAAY,EAAE,YAAY,CAAC;IACzC,OAAO,CAAC,MAAM,CAAC,mBAAmB,CAAgB;IAClD,OAAO,CAAC,MAAM,CAAC,YAAY,CAAC,CAAwB;IAEpD,WAAkB,WAAW,IAAI,qBAAqB,GAAG,SAAS,CAEjE;IAED,wCAAwC;WACpB,UAAU,CAAC,MAAM,CAAC,EAAE,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC;IAUvE,4EAA4E;WAC9D,SAAS;IAIvB,kDAAkD;IAClD,WAAkB,qBAAqB,IAAI,MAAM,CAEhD;WAEa,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,EAAE,EAAE,OAAO,CAAC,EAAE,kBAAkB,GAAG,MAAM;CAGtF"}
@@ -24,6 +24,9 @@ export class MapLayersUI {
24
24
  static get localizationNamespace() {
25
25
  return MapLayersUI._defaultNs;
26
26
  }
27
+ static translate(key, options) {
28
+ return MapLayersUI.localization.getLocalizedString(key, { ...options, ns: MapLayersUI._defaultNs });
29
+ }
27
30
  }
28
31
  MapLayersUI._defaultNs = "mapLayers";
29
32
  MapLayersUI._uiItemsProvidersId = [];
@@ -1 +1 @@
1
- {"version":3,"file":"mapLayers.js","sourceRoot":"","sources":["../../src/mapLayers.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,SAAS,EAAyB,MAAM,sBAAsB,CAAC;AAUxE;;;;;GAKG;AACH,MAAM,OAAO,WAAW;IAMf,MAAM,KAAK,WAAW;QAC3B,OAAO,IAAI,CAAC,YAAY,CAAC;IAC3B,CAAC;IAED,wCAAwC;IACjC,MAAM,CAAC,KAAK,CAAC,UAAU,CAAC,MAAwB;QACrD,mEAAmE;QACnE,WAAW,CAAC,YAAY,GAAG,MAAM,EAAE,YAAY,IAAI,SAAS,CAAC,YAAY,CAAC;QAC1E,MAAM,WAAW,CAAC,YAAY,CAAC,iBAAiB,CAC9C,WAAW,CAAC,qBAAqB,CAClC,CAAC;QAEF,WAAW,CAAC,YAAY,GAAG,MAAM,EAAE,WAAW,CAAC;IACjD,CAAC;IAED,4EAA4E;IACrE,MAAM,CAAC,SAAS;QACrB,SAAS,CAAC,YAAY,CAAC,mBAAmB,CAAC,WAAW,CAAC,qBAAqB,CAAC,CAAC;IAChF,CAAC;IAED,kDAAkD;IAC3C,MAAM,KAAK,qBAAqB;QACrC,OAAO,WAAW,CAAC,UAAU,CAAC;IAChC,CAAC;;AA5Bc,sBAAU,GAAG,WAAW,CAAC;AAEzB,+BAAmB,GAAa,EAAE,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 { Localization } from \"@itwin/core-common\";\nimport { IModelApp, UserPreferencesAccess } from \"@itwin/core-frontend\";\n// import { MapLayersUiItemsProvider } from \"./ui/MapLayersUiItemsProvider\";\n// import { FeatureInfoUiItemsProvider } from \"./ui/FeatureInfoUiItemsProvider\";\n\nexport interface MapLayersConfig {\n localization?: Localization;\n /** If an iTwinConfig is provided, it will be used to load the MapLayerSources that are stored. */\n iTwinConfig?: UserPreferencesAccess;\n}\n\n/** MapLayersUI is use when the package is used as a dependency to another app.\n * '''ts\n * await MapLayersUI.initialize({...MapLayersInitProps});\n * '''\n * @beta\n */\nexport class MapLayersUI {\n private static _defaultNs = \"mapLayers\";\n public static localization: Localization;\n private static _uiItemsProvidersId: string[] = [];\n private static _iTwinConfig?: UserPreferencesAccess;\n\n public static get iTwinConfig(): UserPreferencesAccess | undefined {\n return this._iTwinConfig;\n }\n\n /** Used to initialize the Map Layers */\n public static async initialize(config?: MapLayersConfig): Promise<void> {\n // register namespace containing localized strings for this package\n MapLayersUI.localization = config?.localization ?? IModelApp.localization;\n await MapLayersUI.localization.registerNamespace(\n MapLayersUI.localizationNamespace\n );\n\n MapLayersUI._iTwinConfig = config?.iTwinConfig;\n }\n\n /** Unregisters internationalization service namespace and UiItemManager */\n public static terminate() {\n IModelApp.localization.unregisterNamespace(MapLayersUI.localizationNamespace);\n }\n\n /** The internationalization service namespace. */\n public static get localizationNamespace(): string {\n return MapLayersUI._defaultNs;\n }\n}\n"]}
1
+ {"version":3,"file":"mapLayers.js","sourceRoot":"","sources":["../../src/mapLayers.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,SAAS,EAAyB,MAAM,sBAAsB,CAAC;AAQxE;;;;;GAKG;AACH,MAAM,OAAO,WAAW;IAMf,MAAM,KAAK,WAAW;QAC3B,OAAO,IAAI,CAAC,YAAY,CAAC;IAC3B,CAAC;IAED,wCAAwC;IACjC,MAAM,CAAC,KAAK,CAAC,UAAU,CAAC,MAAwB;QACrD,mEAAmE;QACnE,WAAW,CAAC,YAAY,GAAG,MAAM,EAAE,YAAY,IAAI,SAAS,CAAC,YAAY,CAAC;QAC1E,MAAM,WAAW,CAAC,YAAY,CAAC,iBAAiB,CAC9C,WAAW,CAAC,qBAAqB,CAClC,CAAC;QAEF,WAAW,CAAC,YAAY,GAAG,MAAM,EAAE,WAAW,CAAC;IACjD,CAAC;IAED,4EAA4E;IACrE,MAAM,CAAC,SAAS;QACrB,SAAS,CAAC,YAAY,CAAC,mBAAmB,CAAC,WAAW,CAAC,qBAAqB,CAAC,CAAC;IAChF,CAAC;IAED,kDAAkD;IAC3C,MAAM,KAAK,qBAAqB;QACrC,OAAO,WAAW,CAAC,UAAU,CAAC;IAChC,CAAC;IAEM,MAAM,CAAC,SAAS,CAAC,GAAsB,EAAE,OAA4B;QAC1E,OAAO,WAAW,CAAC,YAAY,CAAC,kBAAkB,CAAC,GAAG,EAAE,EAAC,GAAG,OAAO,EAAE,EAAE,EAAE,WAAW,CAAC,UAAU,EAAC,CAAC,CAAC;IACpG,CAAC;;AAhCc,sBAAU,GAAG,WAAW,CAAC;AAEzB,+BAAmB,GAAa,EAAE,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 { Localization, TranslationOptions } from \"@itwin/core-common\";\nimport { IModelApp, UserPreferencesAccess } from \"@itwin/core-frontend\";\n\nexport interface MapLayersConfig {\n localization?: Localization;\n /** If an iTwinConfig is provided, it will be used to load the MapLayerSources that are stored. */\n iTwinConfig?: UserPreferencesAccess;\n}\n\n/** MapLayersUI is use when the package is used as a dependency to another app.\n * '''ts\n * await MapLayersUI.initialize({...MapLayersInitProps});\n * '''\n * @beta\n */\nexport class MapLayersUI {\n private static _defaultNs = \"mapLayers\";\n public static localization: Localization;\n private static _uiItemsProvidersId: string[] = [];\n private static _iTwinConfig?: UserPreferencesAccess;\n\n public static get iTwinConfig(): UserPreferencesAccess | undefined {\n return this._iTwinConfig;\n }\n\n /** Used to initialize the Map Layers */\n public static async initialize(config?: MapLayersConfig): Promise<void> {\n // register namespace containing localized strings for this package\n MapLayersUI.localization = config?.localization ?? IModelApp.localization;\n await MapLayersUI.localization.registerNamespace(\n MapLayersUI.localizationNamespace\n );\n\n MapLayersUI._iTwinConfig = config?.iTwinConfig;\n }\n\n /** Unregisters internationalization service namespace and UiItemManager */\n public static terminate() {\n IModelApp.localization.unregisterNamespace(MapLayersUI.localizationNamespace);\n }\n\n /** The internationalization service namespace. */\n public static get localizationNamespace(): string {\n return MapLayersUI._defaultNs;\n }\n\n public static translate(key: string | string[], options?: TranslationOptions): string {\n return MapLayersUI.localization.getLocalizedString(key, {...options, ns: MapLayersUI._defaultNs});\n }\n}\n"]}
@@ -12,6 +12,17 @@
12
12
  "ColorDialog": {
13
13
  "Title": "Specify Base Color"
14
14
  },
15
+ "Dialog":
16
+ {
17
+ "Add" : "Add",
18
+ "Cancel" : "Cancel",
19
+ "Edit" : "Edit"
20
+ },
21
+ "SelectFeaturesDialog":
22
+ {
23
+ "AllOn": "Select All",
24
+ "AllOff": "Select None"
25
+ },
15
26
  "MapLayerActionButtons": {
16
27
  "ShowAllLabel": "Show all",
17
28
  "HideAllLabel": "Hide all",
@@ -24,7 +35,7 @@
24
35
  "LayerExistsOverwriting": "Map layer {{layer}} already exists, overwriting info for that layer.",
25
36
  "LayerExistsAsITwinSetting": "Map layer {{layer}} already exists as a iTwin setting. Cannot overwrite with a model setting!",
26
37
  "AddCustomLayerButtonLabel": "Add Layer",
27
- "AttachCustomLayer": "Attach New Layer",
38
+ "AttachCustomLayer": "Add New Layer",
28
39
  "AttacheInfo": "Map layer attached from URL:",
29
40
  "Custom": "New",
30
41
  "LoadingMapSources": "Loading Map Sources",
@@ -52,11 +63,11 @@
52
63
  "RemoveLayerDefError": "Could not delete map layer definition: {{layerName}}",
53
64
  "RemoveLayerDefSuccess": "Successfully deleted map layer definition: {{layerName}}",
54
65
  "SearchPlaceholder": "Search...",
55
- "SelectLayersToCreate": "Select layers to be created",
66
+ "SelectLayersToCreate": "Select Layers To Add",
56
67
  "StoreOnModelSettings": "Store on Model Settings",
57
68
  "StoreOnITwinSettings": "Store on iTwin Settings",
58
69
  "TechPreviewBadgeTooltip": "Technology preview",
59
- "TooManyLayersSelected": "There are currently {{layerCount}} layers selected; Adding too many layers may impact performance.",
70
+ "TooManyLayersSelected": "{{layerCount}} layers selected; performance may be affected.",
60
71
  "Type": "Type",
61
72
  "URL": "URL",
62
73
  "UrlInputPlaceHolder": "Enter Map Source URL",
@@ -1 +1 @@
1
- {"version":3,"file":"MapLayerDroppable.d.ts","sourceRoot":"","sources":["../../../../src/ui/widget/MapLayerDroppable.tsx"],"names":[],"mappings":"AAWA,OAAO,EAAyI,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAO7L,OAAO,EAAE,eAAe,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC;AAGvE,OAAO,wBAAwB,CAAC;AAIhC,gBAAgB;AAChB,UAAU,sBAAsB;IAC9B,SAAS,EAAE,OAAO,CAAC;IACnB,UAAU,CAAC,EAAE,qBAAqB,EAAE,CAAC;IAC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I,CAAC;IAC1B,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAOD,gBAAgB;AAEhB,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,sBAAsB,eAmL9D"}
@@ -19,6 +19,10 @@ import { MapUrlDialog } from "./MapUrlDialog";
19
19
  import "./MapLayerManager.scss";
20
20
  import { MapLayersUI } from "../../mapLayers";
21
21
  import { ImageMapLayerSettings } from "@itwin/core-common";
22
+ const changeVisibilityByElementId = (element, visible) => {
23
+ if (element)
24
+ element.setAttribute("style", `visibility: ${visible ? "visible" : "hidden"}`);
25
+ };
22
26
  /** @internal */
23
27
  // eslint-disable-next-line @typescript-eslint/naming-convention
24
28
  export function MapLayerDroppable(props) {
@@ -58,9 +62,8 @@ export function MapLayerDroppable(props) {
58
62
  props.onItemEdited();
59
63
  }, [props]);
60
64
  const changeSettingsMenuVisibility = (event, visible) => {
61
- const menuDiv = event.currentTarget.querySelector("#MapLayerSettingsMenuWrapper");
62
- if (menuDiv)
63
- menuDiv.setAttribute("style", `visibility: ${visible ? "visible" : "hidden"}`);
65
+ changeVisibilityByElementId(event.currentTarget.querySelector("#MapLayerSettingsMenuWrapper"), visible);
66
+ changeVisibilityByElementId(event.currentTarget.querySelector("#MapLayerSettingsSubLayersMenu"), visible);
64
67
  };
65
68
  const renderItem = (dragProvided, _, rubric) => {
66
69
  assert(props.layersList !== undefined);
@@ -74,7 +77,7 @@ export function MapLayerDroppable(props) {
74
77
  React.createElement(Button, { disabled: props.disabled, size: "small", styleType: "borderless", className: "map-manager-item-visibility map-manager-visibility-icon", title: toggleVisibility, onClick: () => { props.onItemVisibilityToggleClicked(activeLayer); } },
75
78
  React.createElement(Icon, { iconSpec: activeLayer.visible ? "icon-visibility" : "icon-visibility-hide-2" })),
76
79
  React.createElement("span", { className: props.disabled || outOfRange ? "map-manager-item-label-disabled" : "map-manager-item-label", title: outOfRange ? outOfRangeTitle : undefined, ...dragProvided.dragHandleProps }, activeLayer.name),
77
- React.createElement("div", { className: "map-manager-item-sub-layer-container" }, activeLayer.subLayers && activeLayer.subLayers.length > 1 &&
80
+ React.createElement("div", { id: "MapLayerSettingsSubLayersMenu", style: { visibility: "hidden" }, className: "map-manager-item-sub-layer-container" }, activeLayer.subLayers && activeLayer.subLayers.length > 1 &&
78
81
  React.createElement(SubLayersPopupButton, { checkboxStyle: "eye", expandMode: "rootGroupOnly", subLayers: props.activeViewport ? activeLayer.subLayers : undefined, singleVisibleSubLayer: activeLayer.provider?.mutualExclusiveSubLayer, onSubLayerStateChange: (subLayerId, isSelected) => { onSubLayerStateChange(activeLayer, subLayerId, isSelected); } })),
79
82
  activeLayer.provider?.status === MapLayerImageryProviderStatus.RequireAuth &&
80
83
  React.createElement(Button, { disabled: props.disabled, size: "small", styleType: "borderless", onClick: () => {
@@ -1 +1 @@
1
- {"version":3,"file":"MapLayerDroppable.js","sourceRoot":"","sources":["../../../../src/ui/widget/MapLayerDroppable.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F,2CAA2C;AAE3C,oEAAoE;AACpE,sDAAsD;AAEtD,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,SAAS,EAAuB,SAAS,EAA6C,MAAM,qBAAqB,CAAC;AAC3H,OAAO,EAAE,SAAS,EAAE,6BAA6B,EAAiB,+BAA+B,EAAE,oBAAoB,EAAE,qBAAqB,EAAkB,MAAM,sBAAsB,CAAC;AAC7L,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AACzC,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,qBAAqB,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAEzF,OAAO,E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C,yBAAyB,CAAC,CAAC,CAAC,8BAA8B,CAAC;YAC3F,IAAI;gBACF,6BAAK,KAAK,EAAE,KAAK,EAAE,SAAS,EAAC,iCAAiC,IAC3D,QAAQ,CAAC,cAAc,CAAC,CAAC;oBACxB,8BAAM,SAAS,EAAC,6BAA6B,IAAE,cAAc,CAAQ;oBACrE,CAAC;wBACD;4BACE,8BAAM,SAAS,EAAC,6BAA6B,IAAE,KAAK,CAAQ;4BAC5D,oBAAC,sBAAsB,IAAC,QAAQ,EAAE,KAAK,CAAC,QAAQ,EAAE,UAAU,EAAE,qBAAqB,CAAC,IAAI,EAAE,SAAS,EAAE,KAAK,CAAC,SAAS,GAAI,CACvH,CAED,CAAC;SACV;QACD,OAAO,IAAI,CAAC;IACd,CAAC;IAED,SAAS,eAAe,CAAC,YAA+B,EAAE,YAAoC;QAC5F,OAAO,CACL,6BAAK,SAAS,EAAE,0BAA0B,YAAY,CAAC,cAAc,IAAI,aAAa,CAAC,CAAC,CAAC,uBAAuB,CAAC,CAAC,CAAC,EAAE,EAAE,EAAE,GAAG,EAAE,YAAY,CAAC,QAAQ,KAAM,YAAY,CAAC,cAAc;YAEjL,sBAAsB,CAAC,YAAY,CAAC;YAOrC,6BAAK,KAAK,EAAE,aAAa,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,IAAG,YAAY,CAAC,WAAW,CAAO,CACzF,CAAC,CAAC;IACZ,CAAC;IAED,OAAO,CACL,oBAAC,SAAS,IACR,WAAW,EAAE,WAAW,EACxB,WAAW,EAAE,UAAU,EACvB,oBAAoB,EAAE,KAAK,CAAC,oBAA2B,IAEtD,eAAe,CACN,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/* eslint-disable @typescript-eslint/unbound-method */\n\nimport * as React from \"react\";\nimport { Draggable, DraggableChildrenFn, Droppable, DroppableProvided, DroppableStateSnapshot } from \"react-beautiful-dnd\";\nimport { IModelApp, MapLayerImageryProviderStatus, MapLayerIndex, MapTileTreeScaleRangeVisibility, NotifyMessageDetails, OutputMessagePriority, ScreenViewport } from \"@itwin/core-frontend\";\nimport { Icon } from \"@itwin/core-react\";\nimport { assert } from \"@itwin/core-bentley\";\nimport { UiFramework } from \"@itwin/appui-react\";\nimport { Button, Checkbox } from \"@itwin/itwinui-react\";\nimport { SubLayersPopupButton } from \"./SubLayersPopupButton\";\nimport { AttachLayerButtonType, AttachLayerPopupButton } from \"./AttachLayerPopupButton\";\nimport { MapTypesOptions, StyleMapLayerSettings } from \"../Interfaces\";\nimport { MapLayerSettingsMenu } from \"./MapLayerSettingsMenu\";\nimport { MapUrlDialog, SourceState } from \"./MapUrlDialog\";\nimport \"./MapLayerManager.scss\";\nimport { MapLayersUI } from \"../../mapLayers\";\nimport { ImageMapLayerSettings, SubLayerId } from \"@itwin/core-common\";\n\n/** @internal */\ninterface MapLayerDroppableProps {\n isOverlay: boolean;\n layersList?: StyleMapLayerSettings[];\n mapTypesOptions?: MapTypesOptions;\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\n/** @internal */\n// eslint-disable-next-line @typescript-eslint/naming-convention\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, { index: mapLayerStyleIdx, isOverlay: activeLayer.isOverlay });\n };\n\n const handleOk = React.useCallback((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 }, [props]);\n\n const changeSettingsMenuVisibility = (event: React.MouseEvent<HTMLDivElement, MouseEvent>, visible: boolean)=>{\n const menuDiv = event.currentTarget.querySelector(\"#MapLayerSettingsMenuWrapper\");\n if (menuDiv)\n menuDiv.setAttribute(\"style\", `visibility: ${visible ? \"visible\" : \"hidden\"}`);\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 className=\"map-manager-source-item\" data-id={rubric.source.index} 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 data-testid={\"select-item-checkbox\"} checked={activeLayer.selected} onChange={(event: React.ChangeEvent<HTMLInputElement>) => {\n activeLayer.selected = event.target.checked;\n props.onItemSelected(props.isOverlay, rubric.source.index);\n }\n\n }></Checkbox>\n {/* Visibility icon */}\n <Button disabled={props.disabled} size=\"small\" styleType=\"borderless\" className=\"map-manager-item-visibility map-manager-visibility-icon\" title={toggleVisibility} onClick={() => { props.onItemVisibilityToggleClicked(activeLayer); }}>\n <Icon iconSpec={activeLayer.visible ? \"icon-visibility\" : \"icon-visibility-hide-2\"} />\n </Button>\n\n {/* Label */}\n <span className={props.disabled || outOfRange ? \"map-manager-item-label-disabled\" : \"map-manager-item-label\"}\n title={outOfRange ? outOfRangeTitle : undefined}\n {...dragProvided.dragHandleProps}\n\n >\n {activeLayer.name}\n </span>\n\n {/* SubLayersPopupButton */}\n <div 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) => { onSubLayerStateChange(activeLayer, subLayerId, isSelected); }\n\n } />\n }\n </div>\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(activeLayer.name, activeLayer.source, activeLayer.isOverlay);\n if (indexInDisplayStyle !== undefined && indexInDisplayStyle >= 0) {\n const index = { index: indexInDisplayStyle, isOverlay: activeLayer.isOverlay };\n const layerSettings = props.activeViewport.displayStyle.mapLayerAtIndex(index);\n if (layerSettings instanceof ImageMapLayerSettings) {\n UiFramework.dialogs.modal.open(<MapUrlDialog activeViewport={props.activeViewport}\n isOverlay={props.isOverlay}\n layerRequiringCredentials={layerSettings?.toJSON()}\n onOkResult={(sourceState?: SourceState) => handleOk(index, sourceState)}\n onCancelResult={() => {UiFramework.dialogs.modal.close();}}\n mapTypesOptions={props.mapTypesOptions}></MapUrlDialog>);\n }\n }\n\n }}\n title={requireAuthTooltip}\n >\n <Icon className=\"map-layer-source-item-warnMessage-icon\" iconSpec=\"icon-status-warning\" />\n </Button>\n }\n <div id=\"MapLayerSettingsMenuWrapper\" style={{visibility: \"hidden\"}} >\n <MapLayerSettingsMenu activeViewport={props.activeViewport} mapLayerSettings={activeLayer} onMenuItemSelection={props.onMenuItemSelected} disabled={props.disabled} />\n </div>\n\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 } 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 return node;\n }\n\n function renderDraggable(dropProvided: DroppableProvided, dropSnapshot: DroppableStateSnapshot): React.ReactElement<HTMLElement> {\n return (\n <div className={`map-manager-attachments${dropSnapshot.isDraggingOver && containsLayer ? \" is-dragging-map-over\" : \"\"}`} ref={dropProvided.innerRef} {...dropProvided.droppableProps} >\n\n {renderDraggableContent(dropSnapshot)}\n\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 }\n <div style={containsLayer ? undefined : { display: \"none\" }}>{dropProvided.placeholder}</div>\n </div>);\n }\n\n return (\n <Droppable\n droppableId={droppableId}\n renderClone={renderItem}\n getContainerForClone={props.getContainerForClone as any}\n >\n {renderDraggable}\n </Droppable>\n );\n}\n"]}
1
+ {"version":3,"file":"MapLayerDroppable.js","sourceRoot":"","sources":["../../../../src/ui/widget/MapLayerDroppable.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F,2CAA2C;AAE3C,oEAAoE;AACpE,sDAAsD;AAEtD,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,SAAS,EAAuB,SAAS,EAA6C,MAAM,qBAAqB,CAAC;AAC3H,OAAO,EAAE,SAAS,EAAE,6BAA6B,EAAiB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AAK,SAAS,EAAE,0BAA0B,YAAY,CAAC,cAAc,IAAI,aAAa,CAAC,CAAC,CAAC,uBAAuB,CAAC,CAAC,CAAC,EAAE,EAAE,EAAE,GAAG,EAAE,YAAY,CAAC,QAAQ,KAAM,YAAY,CAAC,cAAc;YAEjL,sBAAsB,CAAC,YAAY,CAAC;YAOrC,6BAAK,KAAK,EAAE,aAAa,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,IAAG,YAAY,CAAC,WAAW,CAAO,CACzF,CAAC,CAAC;IACZ,CAAC;IAED,OAAO,CACL,oBAAC,SAAS,IACR,WAAW,EAAE,WAAW,EACxB,WAAW,EAAE,UAAU,EACvB,oBAAoB,EAAE,KAAK,CAAC,oBAA2B,IAEtD,eAAe,CACN,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/* eslint-disable @typescript-eslint/unbound-method */\n\nimport * as React from \"react\";\nimport { Draggable, DraggableChildrenFn, Droppable, DroppableProvided, DroppableStateSnapshot } from \"react-beautiful-dnd\";\nimport { IModelApp, MapLayerImageryProviderStatus, MapLayerIndex, MapTileTreeScaleRangeVisibility, NotifyMessageDetails, OutputMessagePriority, ScreenViewport } from \"@itwin/core-frontend\";\nimport { Icon } from \"@itwin/core-react\";\nimport { assert } from \"@itwin/core-bentley\";\nimport { UiFramework } from \"@itwin/appui-react\";\nimport { Button, Checkbox } from \"@itwin/itwinui-react\";\nimport { SubLayersPopupButton } from \"./SubLayersPopupButton\";\nimport { AttachLayerButtonType, AttachLayerPopupButton } from \"./AttachLayerPopupButton\";\nimport { MapTypesOptions, StyleMapLayerSettings } from \"../Interfaces\";\nimport { MapLayerSettingsMenu } from \"./MapLayerSettingsMenu\";\nimport { MapUrlDialog, SourceState } from \"./MapUrlDialog\";\nimport \"./MapLayerManager.scss\";\nimport { MapLayersUI } from \"../../mapLayers\";\nimport { ImageMapLayerSettings, SubLayerId } from \"@itwin/core-common\";\n\n/** @internal */\ninterface MapLayerDroppableProps {\n isOverlay: boolean;\n layersList?: StyleMapLayerSettings[];\n mapTypesOptions?: MapTypesOptions;\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/** @internal */\n// eslint-disable-next-line @typescript-eslint/naming-convention\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, { index: mapLayerStyleIdx, isOverlay: activeLayer.isOverlay });\n };\n\n const handleOk = React.useCallback((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 }, [props]);\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 className=\"map-manager-source-item\" data-id={rubric.source.index} 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 data-testid={\"select-item-checkbox\"} checked={activeLayer.selected} onChange={(event: React.ChangeEvent<HTMLInputElement>) => {\n activeLayer.selected = event.target.checked;\n props.onItemSelected(props.isOverlay, rubric.source.index);\n }\n\n }></Checkbox>\n {/* Visibility icon */}\n <Button disabled={props.disabled} size=\"small\" styleType=\"borderless\" className=\"map-manager-item-visibility map-manager-visibility-icon\" title={toggleVisibility} onClick={() => { props.onItemVisibilityToggleClicked(activeLayer); }}>\n <Icon iconSpec={activeLayer.visible ? \"icon-visibility\" : \"icon-visibility-hide-2\"} />\n </Button>\n\n {/* Label */}\n <span className={props.disabled || outOfRange ? \"map-manager-item-label-disabled\" : \"map-manager-item-label\"}\n title={outOfRange ? outOfRangeTitle : undefined}\n {...dragProvided.dragHandleProps}\n\n >\n {activeLayer.name}\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) => { onSubLayerStateChange(activeLayer, subLayerId, isSelected); }\n\n } />\n }\n </div>\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(activeLayer.name, activeLayer.source, activeLayer.isOverlay);\n if (indexInDisplayStyle !== undefined && indexInDisplayStyle >= 0) {\n const index = { index: indexInDisplayStyle, isOverlay: activeLayer.isOverlay };\n const layerSettings = props.activeViewport.displayStyle.mapLayerAtIndex(index);\n if (layerSettings instanceof ImageMapLayerSettings) {\n UiFramework.dialogs.modal.open(<MapUrlDialog activeViewport={props.activeViewport}\n isOverlay={props.isOverlay}\n layerRequiringCredentials={layerSettings?.toJSON()}\n onOkResult={(sourceState?: SourceState) => handleOk(index, sourceState)}\n onCancelResult={() => {UiFramework.dialogs.modal.close();}}\n mapTypesOptions={props.mapTypesOptions}></MapUrlDialog>);\n }\n }\n\n }}\n title={requireAuthTooltip}\n >\n <Icon className=\"map-layer-source-item-warnMessage-icon\" iconSpec=\"icon-status-warning\" />\n </Button>\n }\n <div id=\"MapLayerSettingsMenuWrapper\" style={{visibility: \"hidden\"}} >\n <MapLayerSettingsMenu activeViewport={props.activeViewport} mapLayerSettings={activeLayer} onMenuItemSelection={props.onMenuItemSelected} disabled={props.disabled} />\n </div>\n\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 } 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 return node;\n }\n\n function renderDraggable(dropProvided: DroppableProvided, dropSnapshot: DroppableStateSnapshot): React.ReactElement<HTMLElement> {\n return (\n <div className={`map-manager-attachments${dropSnapshot.isDraggingOver && containsLayer ? \" is-dragging-map-over\" : \"\"}`} ref={dropProvided.innerRef} {...dropProvided.droppableProps} >\n\n {renderDraggableContent(dropSnapshot)}\n\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 }\n <div style={containsLayer ? undefined : { display: \"none\" }}>{dropProvided.placeholder}</div>\n </div>);\n }\n\n return (\n <Droppable\n droppableId={droppableId}\n renderClone={renderItem}\n getContainerForClone={props.getContainerForClone as any}\n >\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":"AAUA,OAAO,oCAAoC,CAAC;AAG5C,MAAM,WAAW,gCAAgC;IAC/C,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,aAAa;AAEb,wBAAgB,2BAA2B,CAAC,KAAK,EAAE,gCAAgC,eAoElF"}
1
+ {"version":3,"file":"MapLayerSettingsPopupButton.d.ts","sourceRoot":"","sources":["../../../../src/ui/widget/MapLayerSettingsPopupButton.tsx"],"names":[],"mappings":"AAUA,OAAO,oCAAoC,CAAC;AAI5C,MAAM,WAAW,gCAAgC;IAC/C,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,aAAa;AAEb,wBAAgB,2BAA2B,CAAC,KAAK,EAAE,gCAAgC,eAoElF"}
@@ -4,11 +4,12 @@
4
4
  *--------------------------------------------------------------------------------------------*/
5
5
  import * as React from "react";
6
6
  import { RelativePosition } from "@itwin/appui-abstract";
7
- import { Popup, WebFontIcon } from "@itwin/core-react";
7
+ import { Popup } from "@itwin/core-react";
8
8
  import { MapManagerSettings } from "./MapManagerSettings";
9
9
  import "./MapLayerSettingsPopupButton.scss";
10
10
  import { MapLayersUI } from "../../mapLayers";
11
- import { Button } from "@itwin/itwinui-react";
11
+ import { IconButton } from "@itwin/itwinui-react";
12
+ import { SvgSettings } from "@itwin/itwinui-icons-react";
12
13
  /** @alpha */
13
14
  // eslint-disable-next-line @typescript-eslint/naming-convention
14
15
  export function MapLayerSettingsPopupButton(props) {
@@ -53,8 +54,8 @@ export function MapLayerSettingsPopupButton(props) {
53
54
  setIsSettingsOpen(false);
54
55
  }, [isInsideCoreDialog]);
55
56
  return (React.createElement(React.Fragment, null,
56
- React.createElement(Button, { disabled: props.disabled, styleType: "borderless", title: buttonTooltip, className: "maplayers-settings-popup-button", onClick: togglePopupDisplay, ref: buttonRef },
57
- React.createElement(WebFontIcon, { iconName: "icon-settings" })),
57
+ React.createElement(IconButton, { disabled: props.disabled, styleType: "borderless", title: buttonTooltip, className: "maplayers-settings-popup-button", onClick: togglePopupDisplay, ref: buttonRef },
58
+ React.createElement(SvgSettings, null)),
58
59
  React.createElement(Popup, { isOpen: isSettingsOpen, position: RelativePosition.BottomRight, onClose: handleCloseSetting, target: buttonRef.current, onOutsideClick: handleOutsideClick, repositionOnResize: true },
59
60
  React.createElement("div", { ref: panelRef, className: "maplayers-settings-popup-panel" },
60
61
  React.createElement(MapManagerSettings, null)))));
@@ -1 +1 @@
1
- {"version":3,"file":"MapLayerSettingsPopupButton.js","sourceRoot":"","sources":["../../../../src/ui/widget/MapLayerSettingsPopupButton.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAA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AAK,GAAG,EAAE,QAAQ,EAAE,SAAS,EAAC,gCAAgC;gBAC5D,oBAAC,kBAAkB,OAAG,CAClB,CACC,CACP,CACL,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 * as React from \"react\";\nimport { RelativePosition } from \"@itwin/appui-abstract\";\nimport { Popup, WebFontIcon } from \"@itwin/core-react\";\nimport { MapManagerSettings } from \"./MapManagerSettings\";\n\nimport \"./MapLayerSettingsPopupButton.scss\";\nimport { MapLayersUI } from \"../../mapLayers\";\nimport { Button } from \"@itwin/itwinui-react\";\nexport interface MapLayerSettingsPopupButtonProps {\n disabled?: boolean;\n}\n\n/** @alpha */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function MapLayerSettingsPopupButton(props: MapLayerSettingsPopupButtonProps) {\n const panelRef = React.useRef<HTMLDivElement>(null);\n const [isSettingsOpen, setIsSettingsOpen] = React.useState(false);\n const [buttonTooltip] = React.useState(MapLayersUI.localization.getLocalizedString(\"mapLayers:Widget.SettingsButtonTooltip\"));\n\n const buttonRef = React.useRef<HTMLButtonElement>(null);\n const togglePopupDisplay = React.useCallback((event: React.MouseEvent<HTMLButtonElement, MouseEvent>) => {\n event.preventDefault();\n setIsSettingsOpen((prev) => !prev);\n }, [setIsSettingsOpen]);\n\n const handleCloseSetting = React.useCallback(() => {\n setIsSettingsOpen(false);\n }, [setIsSettingsOpen]);\n\n const isInsideCoreDialog = React.useCallback((element: HTMLElement) => {\n if (element.nodeName === \"DIV\") {\n if (element.classList && element.classList.contains(\"core-dialog\"))\n return true;\n if (element.parentElement && isInsideCoreDialog(element.parentElement))\n return true;\n } else {\n // istanbul ignore else\n if (element.parentElement && isInsideCoreDialog(element.parentElement))\n return true;\n }\n return false;\n }, []);\n\n const handleOutsideClick = React.useCallback((event: MouseEvent) => {\n if (isInsideCoreDialog(event.target as HTMLElement)) {\n return;\n }\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 setIsSettingsOpen(false);\n\n }, [isInsideCoreDialog]);\n\n return (\n <>\n <Button disabled={props.disabled} styleType=\"borderless\" title={buttonTooltip} className=\"maplayers-settings-popup-button\" onClick={togglePopupDisplay} ref={buttonRef}>\n <WebFontIcon iconName=\"icon-settings\" />\n </Button>\n <Popup\n isOpen={isSettingsOpen}\n position={RelativePosition.BottomRight}\n onClose={handleCloseSetting}\n target={buttonRef.current}\n onOutsideClick={handleOutsideClick}\n repositionOnResize={true}\n >\n <div ref={panelRef} className=\"maplayers-settings-popup-panel\">\n <MapManagerSettings />\n </div>\n </Popup >\n </ >\n );\n}\n"]}
1
+ {"version":3,"file":"MapLayerSettingsPopupButton.js","sourceRoot":"","sources":["../../../../src/ui/widget/MapLayerSettingsPopupButton.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC1C,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAE1D,OAAO,oCAAoC,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAKzD,aAAa;AACb,gEAAgE;AAChE,MAAM,UAAU,2BAA2B,CAAC,KAAuC;IACjF,MAAM,QAAQ,GAAG,KAAK,CAAC,MAAM,CAAiB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kBAAkB,GAAG,KAAK,CAAC,WAAW,CAAC,CAAC,KAAiB,EAAE,EAAE;QACjE,IAAI,kBAAkB,CAAC,KAAK,CAAC,MAAqB,CAAC,EAAE;YACnD,OAAO;SACR;QAED,kFAAkF;QAClF,IAAI,SAAS,EAAE,OAAO,IAAI,SAAS,EAAE,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,MAAc,CAAC,EAAE;YAC3E,OAAO;SACR;QAED,wDAAwD;QACxD,IAAI,QAAQ,CAAC,OAAO,IAAI,QAAQ,EAAE,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,MAAc,CAAC,EAAE;YACxE,OAAO;SACR;QAED,wEAAwE;QACxE,iBAAiB,CAAC,KAAK,CAAC,CAAC;IAE3B,CAAC,EAAE,CAAC,kBAAkB,CAAC,CAAC,CAAC;IAEzB,OAAO,CACL;QACE,oBAAC,UAAU,IAAC,QAAQ,EAAE,KAAK,CAAC,QAAQ,EAAE,SAAS,EAAC,YAAY,EAAC,KAAK,EAAE,aAAa,EAAE,SAAS,EAAC,iCAAiC,EAAC,OAAO,EAAE,kBAAkB,EAAE,GAAG,EAAE,SAAS;YACxK,oBAAC,WAAW,OAAE,CACH;QACb,oBAAC,KAAK,IACJ,MAAM,EAAE,cAAc,EACtB,QAAQ,EAAE,gBAAgB,CAAC,WAAW,EACtC,OAAO,EAAE,kBAAkB,EAC3B,MAAM,EAAE,SAAS,CAAC,OAAO,EACzB,cAAc,EAAE,kBAAkB,EAClC,kBAAkB,EAAE,IAAI;YAExB,6BAAK,GAAG,EAAE,QAAQ,EAAE,SAAS,EAAC,gCAAgC;gBAC5D,oBAAC,kBAAkB,OAAG,CAClB,CACC,CACP,CACL,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 * as React from \"react\";\nimport { RelativePosition } from \"@itwin/appui-abstract\";\nimport { Popup } from \"@itwin/core-react\";\nimport { MapManagerSettings } from \"./MapManagerSettings\";\n\nimport \"./MapLayerSettingsPopupButton.scss\";\nimport { MapLayersUI } from \"../../mapLayers\";\nimport { IconButton } from \"@itwin/itwinui-react\";\nimport { SvgSettings } from \"@itwin/itwinui-icons-react\";\nexport interface MapLayerSettingsPopupButtonProps {\n disabled?: boolean;\n}\n\n/** @alpha */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function MapLayerSettingsPopupButton(props: MapLayerSettingsPopupButtonProps) {\n const panelRef = React.useRef<HTMLDivElement>(null);\n const [isSettingsOpen, setIsSettingsOpen] = React.useState(false);\n const [buttonTooltip] = React.useState(MapLayersUI.localization.getLocalizedString(\"mapLayers:Widget.SettingsButtonTooltip\"));\n\n const buttonRef = React.useRef<HTMLButtonElement>(null);\n const togglePopupDisplay = React.useCallback((event: React.MouseEvent<HTMLButtonElement, MouseEvent>) => {\n event.preventDefault();\n setIsSettingsOpen((prev) => !prev);\n }, [setIsSettingsOpen]);\n\n const handleCloseSetting = React.useCallback(() => {\n setIsSettingsOpen(false);\n }, [setIsSettingsOpen]);\n\n const isInsideCoreDialog = React.useCallback((element: HTMLElement) => {\n if (element.nodeName === \"DIV\") {\n if (element.classList && element.classList.contains(\"core-dialog\"))\n return true;\n if (element.parentElement && isInsideCoreDialog(element.parentElement))\n return true;\n } else {\n // istanbul ignore else\n if (element.parentElement && isInsideCoreDialog(element.parentElement))\n return true;\n }\n return false;\n }, []);\n\n const handleOutsideClick = React.useCallback((event: MouseEvent) => {\n if (isInsideCoreDialog(event.target as HTMLElement)) {\n return;\n }\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 setIsSettingsOpen(false);\n\n }, [isInsideCoreDialog]);\n\n return (\n <>\n <IconButton disabled={props.disabled} styleType=\"borderless\" title={buttonTooltip} className=\"maplayers-settings-popup-button\" onClick={togglePopupDisplay} ref={buttonRef}>\n <SvgSettings/>\n </IconButton>\n <Popup\n isOpen={isSettingsOpen}\n position={RelativePosition.BottomRight}\n onClose={handleCloseSetting}\n target={buttonRef.current}\n onOutsideClick={handleOutsideClick}\n repositionOnResize={true}\n >\n <div ref={panelRef} className=\"maplayers-settings-popup-panel\">\n <MapManagerSettings />\n </div>\n </Popup >\n </ >\n );\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"MapSelectFeaturesDialog.d.ts","sourceRoot":"","sources":["../../../../src/ui/widget/MapSelectFeaturesDialog.tsx"],"names":[],"mappings":"AAQA,OAAO,gCAAgC,CAAC;AAIxC,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAGtD,MAAM,WAAW,sBAAsB;IACrC,MAAM,EAAE,cAAc,CAAC;IACvB,SAAS,EAAE,gBAAgB,EAAE,CAAC;IAC9B,QAAQ,EAAE,CAAC,SAAS,EAAE,gBAAgB,EAAE,KAAK,IAAI,CAAC;IAClD,YAAY,EAAE,MAAM,IAAI,CAAC;CAC1B;AAKD,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,sBAAsB,eAqEpE"}
1
+ {"version":3,"file":"MapSelectFeaturesDialog.d.ts","sourceRoot":"","sources":["../../../../src/ui/widget/MapSelectFeaturesDialog.tsx"],"names":[],"mappings":"AAQA,OAAO,gCAAgC,CAAC;AAGxC,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAKtD,MAAM,WAAW,sBAAsB;IACrC,MAAM,EAAE,cAAc,CAAC;IACvB,SAAS,EAAE,gBAAgB,EAAE,CAAC;IAC9B,QAAQ,EAAE,CAAC,SAAS,EAAE,gBAAgB,EAAE,KAAK,IAAI,CAAC;IAClD,YAAY,EAAE,MAAM,IAAI,CAAC;CAC1B;AAKD,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,sBAAsB,eAyFpE"}
@@ -3,19 +3,18 @@
3
3
  * See LICENSE.md in the project root for license terms and full copyright notice.
4
4
  *--------------------------------------------------------------------------------------------*/
5
5
  // cSpell:ignore Modeless WMTS
6
- import { Dialog, Icon } from "@itwin/core-react";
6
+ import { Dialog } from "@itwin/core-react";
7
7
  import * as React from "react";
8
8
  import "./MapSelectFeaturesDialog.scss";
9
- import { DialogButtonType } from "@itwin/appui-abstract";
10
9
  import { MapLayersUI } from "../../mapLayers";
11
10
  import { SubLayersTree } from "./SubLayersTree";
11
+ import { Button, Icon } from "@itwin/itwinui-react";
12
+ import { SvgStatusWarning } from "@itwin/itwinui-icons-color-react";
12
13
  const minHeight = 250;
13
14
  const maxSubLayers = 30;
14
15
  // eslint-disable-next-line @typescript-eslint/naming-convention
15
16
  export function MapSelectFeaturesDialog(props) {
16
17
  const [subLayers, setSubLayers] = React.useState(props.subLayers);
17
- const [NoLayersSelectedMsg] = React.useState(() => MapLayersUI.localization.getLocalizedString("mapLayers:CustomAttach.NoLayersSelected"));
18
- const [dialogTitle] = React.useState(MapLayersUI.localization.getLocalizedString("mapLayers:CustomAttach.SelectLayersToCreate"));
19
18
  const dialogContainer = React.useRef(null);
20
19
  const handleOk = React.useCallback(() => {
21
20
  props.handleOk(subLayers);
@@ -26,29 +25,29 @@ export function MapSelectFeaturesDialog(props) {
26
25
  const hasVisibleLayers = () => subLayers.some((entry) => entry.visible);
27
26
  const hasTooManyVisibleLayers = () => subLayers.filter((entry) => entry.visible).length > maxSubLayers;
28
27
  const readyToSave = () => hasVisibleLayers();
29
- const buttonCluster = [
30
- { type: DialogButtonType.OK, onClick: handleOk, disabled: !readyToSave() },
31
- { type: DialogButtonType.Cancel, onClick: handleCancel },
32
- ];
33
28
  function renderWarningMessage() {
34
29
  let warningMessage;
35
30
  // Get the proper warning message
36
31
  if (!hasVisibleLayers()) {
37
- warningMessage = NoLayersSelectedMsg;
32
+ warningMessage = MapLayersUI.translate("CustomAttach.NoLayersSelected");
38
33
  }
39
34
  else if (hasTooManyVisibleLayers()) {
40
- warningMessage = MapLayersUI.localization.getLocalizedString("mapLayers:CustomAttach.TooManyLayersSelected", { layerCount: subLayers.filter((entry) => entry.visible).length });
35
+ warningMessage = MapLayersUI.translate("CustomAttach.TooManyLayersSelected", { layerCount: subLayers.filter((entry) => entry.visible).length });
41
36
  }
42
- if (warningMessage !== undefined) {
43
- return (React.createElement("div", { className: "map-layer-source-warnMessage" },
44
- React.createElement(Icon, { className: "map-layer-source-warnMessage-icon", iconSpec: "icon-status-warning" }),
45
- React.createElement("span", { className: "map-layer-source-warnMessage-label" }, warningMessage)));
46
- }
47
- return React.createElement(React.Fragment, null);
37
+ return (React.createElement("div", { className: "map-layer-source-warnMessage" }, warningMessage !== undefined && React.createElement(React.Fragment, null,
38
+ React.createElement(Icon, { size: "small" },
39
+ React.createElement(SvgStatusWarning, null)),
40
+ React.createElement("span", { className: "map-layer-source-warnMessage-label" }, warningMessage))));
41
+ }
42
+ function getFooter() {
43
+ return (React.createElement("div", { className: "map-layer-features-footer" },
44
+ React.createElement("div", { className: "map-layer-features-footer-warnMessage" }, renderWarningMessage()),
45
+ React.createElement("div", { className: "map-layer-features-footer-buttons" },
46
+ React.createElement(Button, { className: "map-layer-features-footer-button", styleType: 'high-visibility', onClick: handleOk, disabled: !readyToSave() }, MapLayersUI.translate("Dialog.Add")),
47
+ React.createElement(Button, { className: "map-layer-features-footer-button", styleType: 'default', onClick: handleCancel }, MapLayersUI.translate("Dialog.Cancel")))));
48
48
  }
49
49
  return (React.createElement("div", { ref: dialogContainer },
50
- React.createElement(Dialog, { className: "map-layer-select-features-dialog", title: dialogTitle, opened: true, resizable: true, movable: true, modal: true, buttonCluster: buttonCluster, onClose: handleCancel, onEscape: handleCancel, minHeight: minHeight, maxWidth: 600, titleStyle: { paddingLeft: "10px" }, footerStyle: { paddingBottom: "10px", paddingRight: "10px" }, trapFocus: false },
51
- React.createElement(SubLayersTree, { expandMode: "full", checkboxStyle: "standard", subLayers: subLayers, onSubLayerStateChange: () => setSubLayers([...subLayers]) }),
52
- renderWarningMessage())));
50
+ React.createElement(Dialog, { className: "map-layer-select-features-dialog", title: MapLayersUI.translate("CustomAttach.SelectLayersToCreate"), opened: true, resizable: true, movable: true, modal: true, footer: getFooter(), onClose: handleCancel, onEscape: handleCancel, minHeight: minHeight, maxWidth: 600, titleStyle: { paddingLeft: "10px" }, footerStyle: { paddingBottom: "10px", paddingRight: "10px" }, trapFocus: false },
51
+ React.createElement(SubLayersTree, { expandMode: "full", checkboxStyle: "standard", subLayers: subLayers, onSubLayerStateChange: () => setSubLayers([...subLayers]) }))));
53
52
  }
54
53
  //# sourceMappingURL=MapSelectFeaturesDialog.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"MapSelectFeaturesDialog.js","sourceRoot":"","sources":["../../../../src/ui/widget/MapSelectFeaturesDialog.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F,8BAA8B;AAE9B,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,gCAAgC,CAAC;AAExC,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAG9C,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAQhD,MAAM,SAAS,GAAG,GAAG,CAAC;AACtB,MAAM,YAAY,GAAG,EAAE,CAAC;AAExB,gEAAgE;AAChE,MAAM,UAAU,uBAAuB,CAAC,KAA6B;IACnE,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,SAAS,CAAC,CA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EAAE,GAAG,EAAE,CAAC,YAAY,CAAC,CAAC,GAAG,SAAS,CAAC,CAAC,GAAG;YAG3I,oBAAoB,EAAE,CAChB,CACJ,CACR,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 Modeless WMTS\n\nimport { Dialog, Icon } from \"@itwin/core-react\";\nimport * as React from \"react\";\nimport \"./MapSelectFeaturesDialog.scss\";\n\nimport { DialogButtonType } from \"@itwin/appui-abstract\";\nimport { MapLayersUI } from \"../../mapLayers\";\nimport { MapLayerSource } from \"@itwin/core-frontend\";\nimport { MapSubLayerProps } from \"@itwin/core-common\";\nimport { SubLayersTree } from \"./SubLayersTree\";\n\nexport interface MapSelectFeaturesProps {\n source: MapLayerSource;\n subLayers: MapSubLayerProps[];\n handleOk: (subLayers: MapSubLayerProps[]) => void;\n handleCancel: () => void;\n}\nconst minHeight = 250;\nconst maxSubLayers = 30;\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function MapSelectFeaturesDialog(props: MapSelectFeaturesProps) {\n const [subLayers, setSubLayers] = React.useState(props.subLayers);\n const [NoLayersSelectedMsg] = React.useState(()=>MapLayersUI.localization.getLocalizedString(\"mapLayers:CustomAttach.NoLayersSelected\"));\n const [dialogTitle] = React.useState(MapLayersUI.localization.getLocalizedString(\"mapLayers:CustomAttach.SelectLayersToCreate\"));\n\n const dialogContainer = React.useRef<HTMLDivElement>(null);\n\n const handleOk = React.useCallback(() => {\n props.handleOk(subLayers);\n }, [props, subLayers]);\n\n const handleCancel = React.useCallback(() => {\n props.handleCancel();\n }, [props]);\n\n const hasVisibleLayers = () => subLayers.some((entry)=>entry.visible);\n const hasTooManyVisibleLayers = () => subLayers.filter((entry)=>entry.visible).length > maxSubLayers;\n const readyToSave = () => hasVisibleLayers();\n const buttonCluster = [\n { type: DialogButtonType.OK, onClick: handleOk, disabled: !readyToSave() },\n { type: DialogButtonType.Cancel, onClick: handleCancel },\n ];\n\n function renderWarningMessage(): React.ReactNode {\n let warningMessage: string | undefined;\n\n // Get the proper warning message\n if (!hasVisibleLayers()) {\n warningMessage = NoLayersSelectedMsg;\n } else if (hasTooManyVisibleLayers()) {\n warningMessage = MapLayersUI.localization.getLocalizedString(\"mapLayers:CustomAttach.TooManyLayersSelected\", { layerCount: subLayers.filter((entry)=>entry.visible).length});\n }\n\n if (warningMessage !== undefined) {\n return (\n <div className=\"map-layer-source-warnMessage\">\n <Icon className=\"map-layer-source-warnMessage-icon\" iconSpec=\"icon-status-warning\" />\n <span className=\"map-layer-source-warnMessage-label\">{warningMessage}</span >\n </div>);\n }\n return <></>;\n }\n\n return (\n <div ref={dialogContainer}>\n <Dialog\n className=\"map-layer-select-features-dialog\"\n title={dialogTitle}\n opened={true}\n resizable={true}\n movable={true}\n modal={true}\n buttonCluster={buttonCluster}\n onClose={handleCancel}\n onEscape={handleCancel}\n minHeight={minHeight}\n maxWidth={600}\n titleStyle={{ paddingLeft: \"10px\" }}\n footerStyle={{ paddingBottom: \"10px\", paddingRight: \"10px\" }}\n trapFocus={false}\n >\n {/* 'onSubLayerStateChange' is used to trigger hook state change only, no need to update subLayer objects */}\n <SubLayersTree expandMode=\"full\" checkboxStyle=\"standard\" subLayers={subLayers} onSubLayerStateChange={() => setSubLayers([...subLayers])}/>\n\n {/* Warning message */}\n {renderWarningMessage()}\n </Dialog>\n </div >\n );\n}\n"]}
1
+ {"version":3,"file":"MapSelectFeaturesDialog.js","sourceRoot":"","sources":["../../../../src/ui/widget/MapSelectFeaturesDialog.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F,8BAA8B;AAE9B,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,gCAAgC,CAAC;AAExC,OAAO,EAAE,WAAW,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MAAM,EAAE,IAAI,EACZ,SAAS,EAAE,IAAI,EACf,OAAO,EAAE,IAAI,EACb,KAAK,EAAE,IAAI,EACX,MAAM,EAAE,SAAS,EAAE,EACnB,OAAO,EAAE,YAAY,EACrB,QAAQ,EAAE,YAAY,EACtB,SAAS,EAAE,SAAS,EACpB,QAAQ,EAAE,GAAG,EACb,UAAU,EAAE,EAAE,WAAW,EAAE,MAAM,EAAE,EACnC,WAAW,EAAE,EAAE,aAAa,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,EAC5D,SAAS,EAAE,KAAK;YAGhB,oBAAC,aAAa,IAAC,UAAU,EAAC,MAAM,EAAC,aAAa,EAAC,UAAU,EAAC,SAAS,EAAE,SAAS,EAAE,qBAAqB,EAAE,GAAG,EAAE,CAAC,YAAY,CAAC,CAAC,GAAG,SAAS,CAAC,CAAC,GAAG,CAErI,CACJ,CACR,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 Modeless WMTS\n\nimport { Dialog } from \"@itwin/core-react\";\nimport * as React from \"react\";\nimport \"./MapSelectFeaturesDialog.scss\";\n\nimport { MapLayersUI } from \"../../mapLayers\";\nimport { MapLayerSource } from \"@itwin/core-frontend\";\nimport { MapSubLayerProps } from \"@itwin/core-common\";\nimport { SubLayersTree } from \"./SubLayersTree\";\nimport { Button, Icon } from \"@itwin/itwinui-react\";\nimport { SvgStatusWarning } from \"@itwin/itwinui-icons-color-react\";\n\nexport interface MapSelectFeaturesProps {\n source: MapLayerSource;\n subLayers: MapSubLayerProps[];\n handleOk: (subLayers: MapSubLayerProps[]) => void;\n handleCancel: () => void;\n}\nconst minHeight = 250;\nconst maxSubLayers = 30;\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function MapSelectFeaturesDialog(props: MapSelectFeaturesProps) {\n const [subLayers, setSubLayers] = React.useState(props.subLayers);\n\n const dialogContainer = React.useRef<HTMLDivElement>(null);\n\n const handleOk = React.useCallback(() => {\n props.handleOk(subLayers);\n }, [props, subLayers]);\n\n const handleCancel = React.useCallback(() => {\n props.handleCancel();\n }, [props]);\n\n const hasVisibleLayers = () => subLayers.some((entry)=>entry.visible);\n const hasTooManyVisibleLayers = () => subLayers.filter((entry)=>entry.visible).length > maxSubLayers;\n const readyToSave = () => hasVisibleLayers();\n\n function renderWarningMessage(): React.ReactNode {\n let warningMessage: string | undefined;\n\n // Get the proper warning message\n if (!hasVisibleLayers()) {\n warningMessage = MapLayersUI.translate(\"CustomAttach.NoLayersSelected\");\n } else if (hasTooManyVisibleLayers()) {\n warningMessage = MapLayersUI.translate(\"CustomAttach.TooManyLayersSelected\", { layerCount: subLayers.filter((entry)=>entry.visible).length});\n }\n\n return (\n <div className=\"map-layer-source-warnMessage\">\n {warningMessage !== undefined && <>\n <Icon size=\"small\"><SvgStatusWarning></SvgStatusWarning></Icon>\n <span className=\"map-layer-source-warnMessage-label\">{warningMessage}</span >\n </>}\n </div>);\n\n }\n\n function getFooter() {\n return (\n <div className=\"map-layer-features-footer\">\n <div className=\"map-layer-features-footer-warnMessage\">\n {renderWarningMessage()}\n </div>\n\n <div className=\"map-layer-features-footer-buttons\">\n <Button\n className=\"map-layer-features-footer-button\"\n styleType='high-visibility'\n onClick={handleOk}\n disabled={!readyToSave()}\n >\n {MapLayersUI.translate(\"Dialog.Add\")}\n </Button>\n <Button\n className=\"map-layer-features-footer-button\"\n styleType='default'\n onClick={handleCancel}\n >\n {MapLayersUI.translate(\"Dialog.Cancel\")}\n </Button>\n </div>\n </div>\n );\n }\n\n return (\n <div ref={dialogContainer}>\n <Dialog\n className=\"map-layer-select-features-dialog\"\n title={MapLayersUI.translate(\"CustomAttach.SelectLayersToCreate\")}\n opened={true}\n resizable={true}\n movable={true}\n modal={true}\n footer={getFooter()}\n onClose={handleCancel}\n onEscape={handleCancel}\n minHeight={minHeight}\n maxWidth={600}\n titleStyle={{ paddingLeft: \"10px\" }}\n footerStyle={{ paddingBottom: \"10px\", paddingRight: \"10px\" }}\n trapFocus={false}\n >\n {/* 'onSubLayerStateChange' is used to trigger hook state change only, no need to update subLayer objects */}\n <SubLayersTree expandMode=\"full\" checkboxStyle=\"standard\" subLayers={subLayers} onSubLayerStateChange={() => setSubLayers([...subLayers])}/>\n\n </Dialog>\n </div >\n );\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"MapUrlDialog.d.ts","sourceRoot":"","sources":["../../../../src/ui/widget/MapUrlDialog.tsx"],"names":[],"mappings":"AAQA,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,EAC4B,cAAc,EACzB,wBAAwB,EAA+C,cAAc,EAC5G,MAAM,sBAAsB,CAAC;AAK9B,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAGhD,OAAO,qBAAqB,CAAC;AAE7B,eAAO,MAAM,SAAS;;;;;;CAMrB,CAAC;AAEF,oBAAY,iBAAiB,GAAG,QAAQ,GAAC,UAAU,CAAC;AACpD,UAAU,iBAAiB;IACzB,cAAc,CAAC,EAAE,cAAc,CAAC;IAChC,SAAS,EAAE,OAAO,CAAC;IACnB,UAAU,EAAE,CAAC,MAAM,CAAC,EAAE,WAAW,KAAK,IAAI,CAAC;IAC3C,cAAc,CAAC,EAAE,MAAM,IAAI,CAAC;IAC5B,eAAe,CAAC,EAAE,eAAe,CAAC;IAGlC,yBAAyB,CAAC,EAAE,kBAAkB,CAAC;IAE/C,oBAAoB,CAAC,EAAE,cAAc,CAAC;CACvC;AAED,MAAM,WAAW,WAAW;IAC1B,MAAM,EAAE,cAAc,CAAC;IACvB,UAAU,EAAE,wBAAwB,CAAC;CACtC;AAGD,wBAAgB,YAAY,CAAC,KAAK,EAAE,iBAAiB,eA+fpD"}
1
+ {"version":3,"file":"MapUrlDialog.d.ts","sourceRoot":"","sources":["../../../../src/ui/widget/MapUrlDialog.tsx"],"names":[],"mappings":"AAQA,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,EAC4B,cAAc,EACzB,wBAAwB,EAA+C,cAAc,EAC5G,MAAM,sBAAsB,CAAC;AAK9B,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAGhD,OAAO,qBAAqB,CAAC;AAG7B,eAAO,MAAM,SAAS;;;;;;CAMrB,CAAC;AAEF,oBAAY,iBAAiB,GAAG,QAAQ,GAAC,UAAU,CAAC;AACpD,UAAU,iBAAiB;IACzB,cAAc,CAAC,EAAE,cAAc,CAAC;IAChC,SAAS,EAAE,OAAO,CAAC;IACnB,UAAU,EAAE,CAAC,MAAM,CAAC,EAAE,WAAW,KAAK,IAAI,CAAC;IAC3C,cAAc,CAAC,EAAE,MAAM,IAAI,CAAC;IAC5B,eAAe,CAAC,EAAE,eAAe,CAAC;IAGlC,yBAAyB,CAAC,EAAE,kBAAkB,CAAC;IAE/C,oBAAoB,CAAC,EAAE,cAAc,CAAC;CACvC;AAED,MAAM,WAAW,WAAW;IAC1B,MAAM,EAAE,cAAc,CAAC;IACvB,UAAU,EAAE,wBAAwB,CAAC;CACtC;AAGD,wBAAgB,YAAY,CAAC,KAAK,EAAE,iBAAiB,eA0hBpD"}
@@ -3,16 +3,17 @@
3
3
  * See LICENSE.md in the project root for license terms and full copyright notice.
4
4
  *--------------------------------------------------------------------------------------------*/
5
5
  // cSpell:ignore Modeless WMTS
6
- import { DialogButtonType, SpecialKey } from "@itwin/appui-abstract";
7
- import { Button, Input, LabeledInput, ProgressLinear, Radio } from "@itwin/itwinui-react";
6
+ import { SpecialKey } from "@itwin/appui-abstract";
7
+ import { Button, Icon, Input, LabeledInput, ProgressLinear, Radio } from "@itwin/itwinui-react";
8
8
  import { IModelApp, MapLayerSource, MapLayerSourceStatus, NotifyMessageDetails, OutputMessagePriority, } from "@itwin/core-frontend";
9
- import { Dialog, Icon, useCrossOriginPopup } from "@itwin/core-react";
9
+ import { Dialog, useCrossOriginPopup } from "@itwin/core-react";
10
10
  import * as React from "react";
11
11
  import { MapLayerPreferences } from "../../MapLayerPreferences";
12
12
  import { MapLayersUI } from "../../mapLayers";
13
13
  import { BeEvent, Guid } from "@itwin/core-bentley";
14
14
  import { SelectMapFormat } from "./SelectMapFormat";
15
15
  import "./MapUrlDialog.scss";
16
+ import { SvgStatusWarning } from "@itwin/itwinui-icons-color-react";
16
17
  export const MAP_TYPES = {
17
18
  wms: "WMS",
18
19
  arcGis: "ArcGIS",
@@ -312,10 +313,10 @@ export function MapUrlDialog(props) {
312
313
  && !invalidCredentialsProvided
313
314
  && (externalLoginUrl === undefined || (externalLoginUrl !== undefined && oauthProcessSucceeded));
314
315
  }, [userName, password, mapUrl, mapName, serverRequireCredentials, layerAttachPending, invalidCredentialsProvided, externalLoginUrl, oauthProcessSucceeded]);
315
- const buttonCluster = React.useMemo(() => [
316
- { type: DialogButtonType.OK, onClick: handleOk, disabled: !readyToSave() },
317
- { type: DialogButtonType.Cancel, onClick: handleCancel },
318
- ], [readyToSave, handleCancel, handleOk]);
316
+ // const buttonCluster = React.useMemo(() => [
317
+ // { type: DialogButtonType.OK, onClick: handleOk, disabled: !readyToSave() },
318
+ // { type: DialogButtonType.Cancel, onClick: handleCancel },
319
+ // ], [readyToSave, handleCancel, handleOk]);
319
320
  const handleOnKeyDown = React.useCallback((event) => {
320
321
  if (event.key === SpecialKey.Enter) {
321
322
  if (readyToSave())
@@ -385,7 +386,8 @@ export function MapUrlDialog(props) {
385
386
  }
386
387
  if (warningMessage !== undefined) {
387
388
  return (React.createElement("div", { className: "map-layer-source-warnMessage" },
388
- React.createElement(Icon, { className: "map-layer-source-warnMessage-icon", iconSpec: "icon-status-warning" }),
389
+ React.createElement(Icon, { size: "small" },
390
+ React.createElement(SvgStatusWarning, null)),
389
391
  React.createElement("span", { className: "map-layer-source-warnMessage-label" }, warningMessage),
390
392
  extraNode));
391
393
  }
@@ -397,8 +399,15 @@ export function MapUrlDialog(props) {
397
399
  // Use a hook to display the popup.
398
400
  // The display of the popup is controlled by the 'showOauthPopup' state variable.
399
401
  useCrossOriginPopup(showOauthPopup, externalLoginUrl, externalLoginTitle, 450, 450, handleOAuthPopupClose);
402
+ function getFooter() {
403
+ return (React.createElement("div", { className: "map-layer-source-footer" },
404
+ React.createElement("div", { className: "map-layer-source-footer-status" }),
405
+ React.createElement("div", null,
406
+ React.createElement(Button, { className: "map-layer-features-footer-button", styleType: 'high-visibility', onClick: handleOk, disabled: !readyToSave() }, props?.mapLayerSourceToEdit ? MapLayersUI.translate("Dialog.Edit") : MapLayersUI.translate("Dialog.Add")),
407
+ React.createElement(Button, { className: "map-layer-source-footer-button", styleType: 'default', onClick: handleCancel }, MapLayersUI.translate("Dialog.Cancel")))));
408
+ }
400
409
  return (React.createElement("div", { ref: dialogContainer },
401
- React.createElement(Dialog, { className: "map-layer-url-dialog", title: dialogTitle, opened: true, resizable: true, movable: true, modal: true, buttonCluster: buttonCluster, onClose: handleCancel, onEscape: handleCancel, minHeight: 120, maxWidth: 600, titleStyle: { paddingLeft: "10px" }, footerStyle: { paddingBottom: "10px", paddingRight: "10px" }, trapFocus: false },
410
+ React.createElement(Dialog, { className: "map-layer-url-dialog", title: dialogTitle, opened: true, resizable: true, movable: true, modal: true, footer: getFooter(), onClose: handleCancel, onEscape: handleCancel, minHeight: 120, maxWidth: 600, titleStyle: { paddingLeft: "10px" }, footerStyle: { paddingBottom: "10px", paddingRight: "10px" }, trapFocus: false },
402
411
  React.createElement("div", { className: "map-layer-url-dialog-content" },
403
412
  React.createElement("div", { className: "map-layer-source-url" },
404
413
  React.createElement("span", { className: "map-layer-source-label" }, typeLabel),