@itwin/map-layers 5.3.0 → 5.4.0

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 (161) hide show
  1. package/CHANGELOG.md +25 -2
  2. package/lib/cjs/BrowserStorage.d.ts +25 -0
  3. package/lib/cjs/BrowserStorage.d.ts.map +1 -0
  4. package/lib/cjs/BrowserStorage.js +80 -0
  5. package/lib/cjs/BrowserStorage.js.map +1 -0
  6. package/lib/cjs/CustomParamUtils.d.ts +5 -0
  7. package/lib/cjs/CustomParamUtils.d.ts.map +1 -0
  8. package/lib/cjs/CustomParamUtils.js +26 -0
  9. package/lib/cjs/CustomParamUtils.js.map +1 -0
  10. package/lib/cjs/CustomParamsMappingStorage.d.ts +6 -0
  11. package/lib/cjs/CustomParamsMappingStorage.d.ts.map +1 -0
  12. package/lib/cjs/CustomParamsMappingStorage.js +15 -0
  13. package/lib/cjs/CustomParamsMappingStorage.js.map +1 -0
  14. package/lib/cjs/CustomParamsStorage.d.ts +6 -0
  15. package/lib/cjs/CustomParamsStorage.d.ts.map +1 -0
  16. package/lib/cjs/CustomParamsStorage.js +15 -0
  17. package/lib/cjs/CustomParamsStorage.js.map +1 -0
  18. package/lib/cjs/MapLayerPreferences.d.ts.map +1 -1
  19. package/lib/cjs/MapLayerPreferences.js +2 -0
  20. package/lib/cjs/MapLayerPreferences.js.map +1 -1
  21. package/lib/cjs/PreferencesBrowserStorage.d.ts +9 -2
  22. package/lib/cjs/PreferencesBrowserStorage.d.ts.map +1 -1
  23. package/lib/cjs/PreferencesBrowserStorage.js +11 -51
  24. package/lib/cjs/PreferencesBrowserStorage.js.map +1 -1
  25. package/lib/cjs/public/locales/en/mapLayers.json +29 -3
  26. package/lib/cjs/ui/FeatureInfoUiItemsProvider.d.ts +1 -1
  27. package/lib/cjs/ui/FeatureInfoUiItemsProvider.js +1 -1
  28. package/lib/cjs/ui/FeatureInfoUiItemsProvider.js.map +1 -1
  29. package/lib/cjs/ui/Interfaces.d.ts +11 -0
  30. package/lib/cjs/ui/Interfaces.d.ts.map +1 -1
  31. package/lib/cjs/ui/Interfaces.js.map +1 -1
  32. package/lib/cjs/ui/widget/AttachLayerPopupButton.d.ts.map +1 -1
  33. package/lib/cjs/ui/widget/AttachLayerPopupButton.js +20 -18
  34. package/lib/cjs/ui/widget/AttachLayerPopupButton.js.map +1 -1
  35. package/lib/cjs/ui/widget/CustomParamEditDialog.d.ts +11 -0
  36. package/lib/cjs/ui/widget/CustomParamEditDialog.d.ts.map +1 -0
  37. package/lib/cjs/ui/widget/CustomParamEditDialog.js +57 -0
  38. package/lib/cjs/ui/widget/CustomParamEditDialog.js.map +1 -0
  39. package/lib/cjs/ui/widget/CustomParamEditDialog.scss +26 -0
  40. package/lib/cjs/ui/widget/CustomParamsSettings.d.ts +4 -0
  41. package/lib/cjs/ui/widget/CustomParamsSettings.d.ts.map +1 -0
  42. package/lib/cjs/ui/widget/CustomParamsSettings.js +116 -0
  43. package/lib/cjs/ui/widget/CustomParamsSettings.js.map +1 -0
  44. package/lib/cjs/ui/widget/CustomParamsSettings.scss +67 -0
  45. package/lib/cjs/ui/widget/MapLayerDroppable.d.ts +3 -3
  46. package/lib/cjs/ui/widget/MapLayerDroppable.d.ts.map +1 -1
  47. package/lib/cjs/ui/widget/MapLayerDroppable.js +23 -10
  48. package/lib/cjs/ui/widget/MapLayerDroppable.js.map +1 -1
  49. package/lib/cjs/ui/widget/MapLayerManager.d.ts +2 -2
  50. package/lib/cjs/ui/widget/MapLayerManager.d.ts.map +1 -1
  51. package/lib/cjs/ui/widget/MapLayerManager.js +19 -11
  52. package/lib/cjs/ui/widget/MapLayerManager.js.map +1 -1
  53. package/lib/cjs/ui/widget/MapLayerSettingsPopupButton.d.ts.map +1 -1
  54. package/lib/cjs/ui/widget/MapLayerSettingsPopupButton.js +1 -1
  55. package/lib/cjs/ui/widget/MapLayerSettingsPopupButton.js.map +1 -1
  56. package/lib/cjs/ui/widget/MapLayerSettingsPopupButton.scss +4 -1
  57. package/lib/cjs/ui/widget/MapManagerSettings.d.ts.map +1 -1
  58. package/lib/cjs/ui/widget/MapManagerSettings.js +37 -29
  59. package/lib/cjs/ui/widget/MapManagerSettings.js.map +1 -1
  60. package/lib/cjs/ui/widget/MapUrlDialog.d.ts +15 -5
  61. package/lib/cjs/ui/widget/MapUrlDialog.d.ts.map +1 -1
  62. package/lib/cjs/ui/widget/MapUrlDialog.js +129 -58
  63. package/lib/cjs/ui/widget/MapUrlDialog.js.map +1 -1
  64. package/lib/cjs/ui/widget/MapUrlDialog.scss +12 -1
  65. package/lib/cjs/ui/widget/SelectApiKey.d.ts +10 -0
  66. package/lib/cjs/ui/widget/SelectApiKey.d.ts.map +1 -0
  67. package/lib/cjs/ui/widget/SelectApiKey.js +39 -0
  68. package/lib/cjs/ui/widget/SelectApiKey.js.map +1 -0
  69. package/lib/cjs/ui/widget/SelectCustomParam.d.ts +10 -0
  70. package/lib/cjs/ui/widget/SelectCustomParam.d.ts.map +1 -0
  71. package/lib/cjs/ui/widget/SelectCustomParam.js +49 -0
  72. package/lib/cjs/ui/widget/SelectCustomParam.js.map +1 -0
  73. package/lib/cjs/ui/widget/SelectMapFormat.d.ts +11 -2
  74. package/lib/cjs/ui/widget/SelectMapFormat.d.ts.map +1 -1
  75. package/lib/cjs/ui/widget/SelectMapFormat.js +5 -6
  76. package/lib/cjs/ui/widget/SelectMapFormat.js.map +1 -1
  77. package/lib/cjs/ui/widget/UserPreferencesStorageOptions.d.ts +10 -0
  78. package/lib/cjs/ui/widget/UserPreferencesStorageOptions.d.ts.map +1 -0
  79. package/lib/cjs/ui/widget/UserPreferencesStorageOptions.js +17 -0
  80. package/lib/cjs/ui/widget/UserPreferencesStorageOptions.js.map +1 -0
  81. package/lib/esm/BrowserStorage.d.ts +25 -0
  82. package/lib/esm/BrowserStorage.d.ts.map +1 -0
  83. package/lib/esm/BrowserStorage.js +76 -0
  84. package/lib/esm/BrowserStorage.js.map +1 -0
  85. package/lib/esm/CustomParamUtils.d.ts +5 -0
  86. package/lib/esm/CustomParamUtils.d.ts.map +1 -0
  87. package/lib/esm/CustomParamUtils.js +22 -0
  88. package/lib/esm/CustomParamUtils.js.map +1 -0
  89. package/lib/esm/CustomParamsMappingStorage.d.ts +6 -0
  90. package/lib/esm/CustomParamsMappingStorage.d.ts.map +1 -0
  91. package/lib/esm/CustomParamsMappingStorage.js +11 -0
  92. package/lib/esm/CustomParamsMappingStorage.js.map +1 -0
  93. package/lib/esm/CustomParamsStorage.d.ts +6 -0
  94. package/lib/esm/CustomParamsStorage.d.ts.map +1 -0
  95. package/lib/esm/CustomParamsStorage.js +11 -0
  96. package/lib/esm/CustomParamsStorage.js.map +1 -0
  97. package/lib/esm/MapLayerPreferences.d.ts.map +1 -1
  98. package/lib/esm/MapLayerPreferences.js +2 -0
  99. package/lib/esm/MapLayerPreferences.js.map +1 -1
  100. package/lib/esm/PreferencesBrowserStorage.d.ts +9 -2
  101. package/lib/esm/PreferencesBrowserStorage.d.ts.map +1 -1
  102. package/lib/esm/PreferencesBrowserStorage.js +11 -51
  103. package/lib/esm/PreferencesBrowserStorage.js.map +1 -1
  104. package/lib/esm/public/locales/en/mapLayers.json +29 -3
  105. package/lib/esm/ui/FeatureInfoUiItemsProvider.d.ts +1 -1
  106. package/lib/esm/ui/FeatureInfoUiItemsProvider.js +1 -1
  107. package/lib/esm/ui/FeatureInfoUiItemsProvider.js.map +1 -1
  108. package/lib/esm/ui/Interfaces.d.ts +11 -0
  109. package/lib/esm/ui/Interfaces.d.ts.map +1 -1
  110. package/lib/esm/ui/Interfaces.js.map +1 -1
  111. package/lib/esm/ui/widget/AttachLayerPopupButton.d.ts.map +1 -1
  112. package/lib/esm/ui/widget/AttachLayerPopupButton.js +20 -18
  113. package/lib/esm/ui/widget/AttachLayerPopupButton.js.map +1 -1
  114. package/lib/esm/ui/widget/CustomParamEditDialog.d.ts +11 -0
  115. package/lib/esm/ui/widget/CustomParamEditDialog.d.ts.map +1 -0
  116. package/lib/esm/ui/widget/CustomParamEditDialog.js +53 -0
  117. package/lib/esm/ui/widget/CustomParamEditDialog.js.map +1 -0
  118. package/lib/esm/ui/widget/CustomParamEditDialog.scss +26 -0
  119. package/lib/esm/ui/widget/CustomParamsSettings.d.ts +4 -0
  120. package/lib/esm/ui/widget/CustomParamsSettings.d.ts.map +1 -0
  121. package/lib/esm/ui/widget/CustomParamsSettings.js +112 -0
  122. package/lib/esm/ui/widget/CustomParamsSettings.js.map +1 -0
  123. package/lib/esm/ui/widget/CustomParamsSettings.scss +67 -0
  124. package/lib/esm/ui/widget/MapLayerDroppable.d.ts +3 -3
  125. package/lib/esm/ui/widget/MapLayerDroppable.d.ts.map +1 -1
  126. package/lib/esm/ui/widget/MapLayerDroppable.js +24 -11
  127. package/lib/esm/ui/widget/MapLayerDroppable.js.map +1 -1
  128. package/lib/esm/ui/widget/MapLayerManager.d.ts +2 -2
  129. package/lib/esm/ui/widget/MapLayerManager.d.ts.map +1 -1
  130. package/lib/esm/ui/widget/MapLayerManager.js +20 -12
  131. package/lib/esm/ui/widget/MapLayerManager.js.map +1 -1
  132. package/lib/esm/ui/widget/MapLayerSettingsPopupButton.d.ts.map +1 -1
  133. package/lib/esm/ui/widget/MapLayerSettingsPopupButton.js +1 -1
  134. package/lib/esm/ui/widget/MapLayerSettingsPopupButton.js.map +1 -1
  135. package/lib/esm/ui/widget/MapLayerSettingsPopupButton.scss +4 -1
  136. package/lib/esm/ui/widget/MapManagerSettings.d.ts.map +1 -1
  137. package/lib/esm/ui/widget/MapManagerSettings.js +38 -30
  138. package/lib/esm/ui/widget/MapManagerSettings.js.map +1 -1
  139. package/lib/esm/ui/widget/MapUrlDialog.d.ts +15 -5
  140. package/lib/esm/ui/widget/MapUrlDialog.d.ts.map +1 -1
  141. package/lib/esm/ui/widget/MapUrlDialog.js +129 -58
  142. package/lib/esm/ui/widget/MapUrlDialog.js.map +1 -1
  143. package/lib/esm/ui/widget/MapUrlDialog.scss +12 -1
  144. package/lib/esm/ui/widget/SelectApiKey.d.ts +10 -0
  145. package/lib/esm/ui/widget/SelectApiKey.d.ts.map +1 -0
  146. package/lib/esm/ui/widget/SelectApiKey.js +35 -0
  147. package/lib/esm/ui/widget/SelectApiKey.js.map +1 -0
  148. package/lib/esm/ui/widget/SelectCustomParam.d.ts +10 -0
  149. package/lib/esm/ui/widget/SelectCustomParam.d.ts.map +1 -0
  150. package/lib/esm/ui/widget/SelectCustomParam.js +45 -0
  151. package/lib/esm/ui/widget/SelectCustomParam.js.map +1 -0
  152. package/lib/esm/ui/widget/SelectMapFormat.d.ts +11 -2
  153. package/lib/esm/ui/widget/SelectMapFormat.d.ts.map +1 -1
  154. package/lib/esm/ui/widget/SelectMapFormat.js +5 -6
  155. package/lib/esm/ui/widget/SelectMapFormat.js.map +1 -1
  156. package/lib/esm/ui/widget/UserPreferencesStorageOptions.d.ts +10 -0
  157. package/lib/esm/ui/widget/UserPreferencesStorageOptions.d.ts.map +1 -0
  158. package/lib/esm/ui/widget/UserPreferencesStorageOptions.js +13 -0
  159. package/lib/esm/ui/widget/UserPreferencesStorageOptions.js.map +1 -0
  160. package/lib/public/locales/en/mapLayers.json +29 -3
  161. package/package.json +6 -6
@@ -17,6 +17,11 @@ $default-font-size: --iui-font-size-1;
17
17
  padding-left: 5px;
18
18
  }
19
19
 
20
+ .map-layer-source-previewBadge-icon {
21
+ margin-left: 4px;
22
+ display:inline;
23
+ vertical-align: middle;
24
+ }
20
25
  .map-layer-source-select-previewBadge {
21
26
  margin-right: 10px;
22
27
  }
@@ -126,4 +131,10 @@ display: flex;
126
131
  color: var(--iui-color-icon-warning);
127
132
  background-color: transparent;
128
133
  }
129
- }
134
+ }
135
+
136
+ .map-layer-custom-param-select {
137
+ .map-layer-custom-param-select-add-button {
138
+ margin-bottom: 0.5rem;
139
+ }
140
+ }
@@ -0,0 +1,10 @@
1
+ /// <reference types="react" />
2
+ import "./MapUrlDialog.scss";
3
+ interface SelectApiKeyProps {
4
+ value?: string;
5
+ disabled?: boolean;
6
+ onChange?: (value: string) => void;
7
+ }
8
+ export declare function SelectApiKey(props: SelectApiKeyProps): JSX.Element;
9
+ export {};
10
+ //# sourceMappingURL=SelectApiKey.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SelectApiKey.d.ts","sourceRoot":"","sources":["../../../../src/ui/widget/SelectApiKey.tsx"],"names":[],"mappings":";AASA,OAAO,qBAAqB,CAAC;AAC7B,UAAU,iBAAiB;IACzB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CACpC;AAGD,wBAAgB,YAAY,CAAC,KAAK,EAAE,iBAAiB,eAyCpD"}
@@ -0,0 +1,35 @@
1
+ /*---------------------------------------------------------------------------------------------
2
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
+ * See LICENSE.md in the project root for license terms and full copyright notice.
4
+ *--------------------------------------------------------------------------------------------*/
5
+ // cSpell:ignore Modeless WMTS
6
+ import { Select } from "@itwin/itwinui-react";
7
+ import * as React from "react";
8
+ import { CustomParamsStorage } from "../../CustomParamsStorage";
9
+ import "./MapUrlDialog.scss";
10
+ // eslint-disable-next-line @typescript-eslint/naming-convention
11
+ export function SelectApiKey(props) {
12
+ const [keyValue, setKeyValue] = React.useState(props.value);
13
+ const [apiKeys] = React.useState(() => {
14
+ const storage = new CustomParamsStorage();
15
+ const keys = storage.get(undefined);
16
+ if (keys)
17
+ return keys.map((keyItem) => { return { value: keyItem.name, label: keyItem.name }; });
18
+ return [];
19
+ });
20
+ React.useEffect(() => {
21
+ setKeyValue(props.value);
22
+ }, [props.value]);
23
+ const handleOnChange = React.useCallback((value) => {
24
+ setKeyValue(value);
25
+ if (props.onChange)
26
+ props.onChange(value);
27
+ }, [props]);
28
+ const handleKeyDown = React.useCallback((e) => {
29
+ if (e.code === "Delete" || e.key === "Backspace") {
30
+ setKeyValue(undefined);
31
+ }
32
+ }, []);
33
+ return (React.createElement(Select, { className: "map-layer-source-select", options: apiKeys, value: keyValue, disabled: props.disabled, onChange: handleOnChange, size: "small", onKeyDown: handleKeyDown }));
34
+ }
35
+ //# sourceMappingURL=SelectApiKey.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SelectApiKey.js","sourceRoot":"","sources":["../../../../src/ui/widget/SelectApiKey.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F,8BAA8B;AAE9B,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC9C,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAChE,OAAO,qBAAqB,CAAC;AAO7B,gEAAgE;AAChE,MAAM,UAAU,YAAY,CAAC,KAAwB;IAEnD,MAAM,CAAC,QAAQ,EAAE,WAAW,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAmB,KAAK,CAAC,KAAK,CAAC,CAAC;IAE9E,MAAM,CAAC,OAAO,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,GAAG,EAAE;QACpC,MAAM,OAAO,GAAG,IAAI,mBAAmB,EAAE,CAAC;QAC1C,MAAM,IAAI,GAAI,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;QACrC,IAAI,IAAI;YACN,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,GAAE,OAAO,EAAC,KAAK,EAAE,OAAO,CAAC,IAAI,EAAE,KAAK,EAAE,OAAO,CAAC,IAAI,EAAC,CAAC,CAAA,CAAC,CAAC,CAAC;QACrF,OAAO,EAAE,CAAC;IACZ,CAAC,CACA,CAAC;IAEF,KAAK,CAAC,SAAS,CAAC,GAAG,EAAE;QACnB,WAAW,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IAC3B,CAAC,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC;IAElB,MAAM,cAAc,GAAG,KAAK,CAAC,WAAW,CAAC,CAAC,KAAa,EAAE,EAAE;QACzD,WAAW,CAAC,KAAK,CAAC,CAAC;QACnB,IAAI,KAAK,CAAC,QAAQ;YAChB,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;IAC1B,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC;IAEZ,MAAM,aAAa,GAAG,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,EAAE;QAC5C,IAAI,CAAC,CAAC,IAAI,KAAK,QAAQ,IAAK,CAAC,CAAC,GAAG,KAAK,WAAW,EAAE;YACjD,WAAW,CAAC,SAAS,CAAC,CAAC;SACxB;IACH,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,OAAO,CAEL,oBAAC,MAAM,IACL,SAAS,EAAC,yBAAyB,EACnC,OAAO,EAAE,OAAO,EAChB,KAAK,EAAE,QAAQ,EACf,QAAQ,EAAE,KAAK,CAAC,QAAQ,EACxB,QAAQ,EAAE,cAAc,EACxB,IAAI,EAAC,OAAO,EACZ,SAAS,EAAE,aAAa,GACxB,CACH,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 { Select } from \"@itwin/itwinui-react\";\nimport * as React from \"react\";\nimport { CustomParamsStorage } from \"../../CustomParamsStorage\";\nimport \"./MapUrlDialog.scss\";\ninterface SelectApiKeyProps {\n value?: string;\n disabled?: boolean;\n onChange?: (value: string) => void;\n}\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function SelectApiKey(props: SelectApiKeyProps) {\n\n const [keyValue, setKeyValue] = React.useState<string|undefined>(props.value);\n\n const [apiKeys] = React.useState(() => {\n const storage = new CustomParamsStorage();\n const keys = storage.get(undefined);\n if (keys)\n return keys.map((keyItem) => {return {value: keyItem.name, label: keyItem.name};});\n return [];\n }\n );\n\n React.useEffect(() => {\n setKeyValue(props.value);\n }, [props.value]);\n\n const handleOnChange = React.useCallback((value: string) => {\n setKeyValue(value);\n if (props.onChange)\n props.onChange(value);\n }, [props]);\n\n const handleKeyDown = React.useCallback((e) => {\n if (e.code === \"Delete\" || e.key === \"Backspace\") {\n setKeyValue(undefined);\n }\n }, []);\n\n return (\n\n <Select\n className=\"map-layer-source-select\"\n options={apiKeys}\n value={keyValue}\n disabled={props.disabled}\n onChange={handleOnChange}\n size=\"small\"\n onKeyDown={handleKeyDown}\n />\n );\n}\n"]}
@@ -0,0 +1,10 @@
1
+ /// <reference types="react" />
2
+ import "./MapUrlDialog.scss";
3
+ interface SelectCustomParamProps {
4
+ value?: string[];
5
+ disabled?: boolean;
6
+ onChange?: (value: string[]) => void;
7
+ }
8
+ export declare function SelectCustomParam(props: SelectCustomParamProps): JSX.Element;
9
+ export {};
10
+ //# sourceMappingURL=SelectCustomParam.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SelectCustomParam.d.ts","sourceRoot":"","sources":["../../../../src/ui/widget/SelectCustomParam.tsx"],"names":[],"mappings":";AASA,OAAO,qBAAqB,CAAC;AAE7B,UAAU,sBAAsB;IAC9B,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;CACtC;AAGD,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,sBAAsB,eAuD9D"}
@@ -0,0 +1,45 @@
1
+ /*---------------------------------------------------------------------------------------------
2
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
+ * See LICENSE.md in the project root for license terms and full copyright notice.
4
+ *--------------------------------------------------------------------------------------------*/
5
+ // cSpell:ignore Modeless WMTS
6
+ import { Select } from "@itwin/itwinui-react";
7
+ import * as React from "react";
8
+ import { CustomParamsStorage } from "../../CustomParamsStorage";
9
+ import "./MapUrlDialog.scss";
10
+ import { MapLayersUI } from "../../mapLayers";
11
+ // eslint-disable-next-line @typescript-eslint/naming-convention
12
+ export function SelectCustomParam(props) {
13
+ const [storage] = React.useState(() => new CustomParamsStorage());
14
+ const [paramValues, setParamValues] = React.useState(props.value);
15
+ const getCustomParamsFromStorage = React.useCallback(() => {
16
+ const params = storage.get(undefined);
17
+ return (params ? params.map((item) => { return { value: item.name, label: item.name }; }) : []);
18
+ }, [storage]);
19
+ const [customParams] = React.useState(() => getCustomParamsFromStorage());
20
+ React.useEffect(() => {
21
+ setParamValues(props.value);
22
+ }, [props.value]);
23
+ const handleOnChange = React.useCallback((val, event) => {
24
+ const stateSetter = (prev) => {
25
+ const getValue = () => {
26
+ if (!prev)
27
+ return [val];
28
+ return event === "removed" ? prev.filter((v) => val !== v) : [...prev, val];
29
+ };
30
+ const value = getValue();
31
+ if (props.onChange)
32
+ props.onChange(value);
33
+ return value;
34
+ };
35
+ setParamValues(stateSetter);
36
+ }, [props]);
37
+ const handleKeyDown = React.useCallback((e) => {
38
+ if (e.code === "Delete" || e.key === "Backspace") {
39
+ setParamValues(undefined);
40
+ }
41
+ }, []);
42
+ return (React.createElement("div", { className: "map-layer-custom-param-select", title: customParams.length === 0 ? MapLayersUI.translate("CustomParamSelect.DisabledTitle") : undefined },
43
+ React.createElement(Select, { className: "map-layer-source-select", options: customParams, value: paramValues, disabled: props.disabled || customParams.length === 0, onChange: handleOnChange, size: "small", onKeyDown: handleKeyDown, multiple: true })));
44
+ }
45
+ //# sourceMappingURL=SelectCustomParam.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SelectCustomParam.js","sourceRoot":"","sources":["../../../../src/ui/widget/SelectCustomParam.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F,8BAA8B;AAE9B,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC9C,OAAO,KAAK,KA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AED,CACL,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// cSpell:ignore Modeless WMTS\n\nimport { Select } from \"@itwin/itwinui-react\";\nimport * as React from \"react\";\nimport { CustomParamsStorage } from \"../../CustomParamsStorage\";\nimport \"./MapUrlDialog.scss\";\nimport { MapLayersUI } from \"../../mapLayers\";\ninterface SelectCustomParamProps {\n value?: string[];\n disabled?: boolean;\n onChange?: (value: string[]) => void;\n}\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function SelectCustomParam(props: SelectCustomParamProps) {\n const [storage] = React.useState(() => new CustomParamsStorage());\n\n const [paramValues, setParamValues] = React.useState<string[]|undefined>(props.value);\n\n const getCustomParamsFromStorage = React.useCallback(() => {\n const params = storage.get(undefined);\n return (params ? params.map((item) => {return {value: item.name, label: item.name};}) : []);\n }, [storage]);\n\n const [customParams] = React.useState(() => getCustomParamsFromStorage());\n\n React.useEffect(() => {\n setParamValues(props.value);\n }, [props.value]);\n\n const handleOnChange = React.useCallback((val, event) => {\n const stateSetter = (prev: string[] | undefined) => {\n const getValue = (): string[] => {\n if (!prev)\n return [val];\n\n return event === \"removed\" ? prev.filter((v) => val !== v) : [...prev, val];\n };\n const value = getValue();\n if (props.onChange)\n props.onChange(value);\n return value;\n\n };\n setParamValues(stateSetter);\n\n }, [props]);\n\n const handleKeyDown = React.useCallback((e) => {\n if (e.code === \"Delete\" || e.key === \"Backspace\") {\n setParamValues(undefined);\n }\n }, []);\n\n return (\n <div className=\"map-layer-custom-param-select\" title={customParams.length === 0 ? MapLayersUI.translate(\"CustomParamSelect.DisabledTitle\") : undefined}>\n <Select<string>\n className=\"map-layer-source-select\"\n options={customParams}\n value={paramValues}\n disabled={props.disabled || customParams.length === 0 }\n onChange={handleOnChange}\n size=\"small\"\n onKeyDown={handleKeyDown}\n multiple\n >\n </Select>\n </div>\n );\n}\n"]}
@@ -1,6 +1,6 @@
1
- /// <reference types="react" />
2
- import { MapTypesOptions } from "../Interfaces";
3
1
  import "./MapUrlDialog.scss";
2
+ import * as React from "react";
3
+ import { MapTypesOptions } from "../Interfaces";
4
4
  export declare const MAP_TYPES: {
5
5
  wms: string;
6
6
  arcGis: string;
@@ -13,6 +13,15 @@ interface SelectMapFormatProps {
13
13
  disabled?: boolean;
14
14
  mapTypesOptions?: MapTypesOptions;
15
15
  onChange?: (mapType: string) => void;
16
+ /**
17
+ * Message below the select. Does not apply to 'inline' select.
18
+ */
19
+ message?: React.ReactNode;
20
+ /**
21
+ * Status of the select.
22
+ * @default ''
23
+ */
24
+ status?: "positive" | "warning" | "negative";
16
25
  }
17
26
  export declare function SelectMapFormat(props: SelectMapFormatProps): JSX.Element;
18
27
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"SelectMapFormat.d.ts","sourceRoot":"","sources":["../../../../src/ui/widget/SelectMapFormat.tsx"],"names":[],"mappings":";AAQA,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,qBAAqB,CAAC;AAS7B,eAAO,MAAM,SAAS;;;;;;CAMrB,CAAC;AAEF,UAAU,oBAAoB;IAC5B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,eAAe,CAAC,EAAE,eAAe,CAAC;IAClC,QAAQ,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;CACtC;AAGD,wBAAgB,eAAe,CAAC,KAAK,EAAE,oBAAoB,eAgD1D"}
1
+ {"version":3,"file":"SelectMapFormat.d.ts","sourceRoot":"","sources":["../../../../src/ui/widget/SelectMapFormat.tsx"],"names":[],"mappings":"AAMA,OAAO,qBAAqB,CAAC;AAC7B,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAMhD,eAAO,MAAM,SAAS;;;;;;CAMrB,CAAC;AAEF,UAAU,oBAAoB;IAC5B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,eAAe,CAAC,EAAE,eAAe,CAAC;IAClC,QAAQ,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IACrC;;SAEK;IACL,OAAO,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B;;;OAGG;IACH,MAAM,CAAC,EAAE,UAAU,GAAG,SAAS,GAAG,UAAU,CAAC;CAC9C;AAGD,wBAAgB,eAAe,CAAC,KAAK,EAAE,oBAAoB,eA+C1D"}
@@ -3,12 +3,12 @@
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 { Icon, MenuItem, Select } from "@itwin/itwinui-react";
7
- import * as React from "react";
8
6
  import "./MapUrlDialog.scss";
7
+ import * as React from "react";
8
+ import { IModelApp } from "@itwin/core-frontend";
9
9
  import { SvgTechnicalPreviewMini } from "@itwin/itwinui-icons-color-react";
10
+ import { Icon, LabeledSelect, MenuItem } from "@itwin/itwinui-react";
10
11
  import { MapLayersUI } from "../../mapLayers";
11
- import { IModelApp } from "@itwin/core-frontend";
12
12
  // TODO:
13
13
  // Remove this structure and iterate over the registry's active formats.
14
14
  // Still need a proper way to exclude some format, like we currently do with
@@ -23,7 +23,6 @@ export const MAP_TYPES = {
23
23
  // eslint-disable-next-line @typescript-eslint/naming-convention
24
24
  export function SelectMapFormat(props) {
25
25
  const [mapFormat, setMapFormat] = React.useState(props.value ?? MAP_TYPES.arcGis);
26
- const [techPreviewTooltip] = React.useState(MapLayersUI.localization.getLocalizedString("mapLayers:CustomAttach.TechPreviewBadgeTooltip"));
27
26
  const [mapFormats] = React.useState(() => {
28
27
  const formats = [
29
28
  { value: MAP_TYPES.arcGis, label: MAP_TYPES.arcGis },
@@ -42,8 +41,8 @@ export function SelectMapFormat(props) {
42
41
  props.onChange(value);
43
42
  }
44
43
  }, [props]);
45
- return (React.createElement(Select, { className: "map-layer-source-select", options: mapFormats, value: mapFormat, disabled: props.disabled, onChange: handleOnChange, size: "small", itemRenderer: (option) => (React.createElement(MenuItem, { badge: option.id?.includes("techPreview") ?
46
- React.createElement("div", { title: techPreviewTooltip, className: "map-layer-source-select-previewBadge" },
44
+ return (React.createElement(LabeledSelect, { className: "map-layer-source-select", options: mapFormats, value: mapFormat, disabled: props.disabled, onChange: handleOnChange, size: "small", itemRenderer: (option) => (React.createElement(MenuItem, { badge: option.id?.includes("techPreview") ?
45
+ React.createElement("div", { title: MapLayersUI.translate("Labels.TechPreviewBadgeTooltip"), className: "map-layer-source-select-previewBadge" },
47
46
  React.createElement(Icon, { size: "small" },
48
47
  React.createElement(SvgTechnicalPreviewMini, null)))
49
48
  : undefined }, option.label)) }));
@@ -1 +1 @@
1
- {"version":3,"file":"SelectMapFormat.js","sourceRoot":"","sources":["../../../../src/ui/widget/SelectMapFormat.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F,8BAA8B;AAE9B,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAgB,MAAM,sBAAsB,CAAC;AAC5E,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,qBAAqB,CAAC;AAC7B,OAAO,EAAC,uBAAuB,EAAC,MAAM,kCAAkC,CAAC;AACzE,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAEjD,QAAQ;AACR,wEAAwE;AACxE,4EAA4E;AAC5E,wDAAwD;AACxD,MAAM,CAAC,MAAM,SAAS,GAAG;IACvB,GAAG,EAAE,KAAK;IACV,MAAM,EAAE,QAAQ;IAChB,IAAI,EAAE,MAAM;IACZ,OAAO,EAAE,SAAS;IAClB,aAAa,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AC,CAAC;QACpB,IAAI,KAAK,CAAC,QAAQ,EAAE;YAClB,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;SACvB;IACH,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC;IAEZ,OAAO,CAEL,oBAAC,MAAM,IACL,SAAS,EAAC,yBAAyB,EACnC,OAAO,EAAE,UAAU,EACnB,KAAK,EAAE,SAAS,EAChB,QAAQ,EAAE,KAAK,CAAC,QAAQ,EACxB,QAAQ,EAAE,cAAc,EACxB,IAAI,EAAC,OAAO,EACZ,YAAY,EACV,CAAC,MAAM,EAAE,EAAE,CAAC,CACV,oBAAC,QAAQ,IACP,KAAK,EAAE,MAAM,CAAC,EAAE,EAAE,QAAQ,CAAC,aAAa,CAAC,CAAC,CAAC;gBACzC,6BAAK,KAAK,EAAE,kBAAkB,EAAE,SAAS,EAAC,sCAAsC;oBAC9E,oBAAC,IAAI,IAAC,IAAI,EAAC,OAAO;wBAAC,oBAAC,uBAAuB,OAAG,CAAO,CACjD;gBACN,CAAC,CAAC,SAAS,IACZ,MAAM,CAAC,KAAK,CACJ,CAAC,GAChB,CACH,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 { Icon, MenuItem, Select, SelectOption } from \"@itwin/itwinui-react\";\nimport * as React from \"react\";\nimport { MapTypesOptions } from \"../Interfaces\";\nimport \"./MapUrlDialog.scss\";\nimport {SvgTechnicalPreviewMini} from \"@itwin/itwinui-icons-color-react\";\nimport { MapLayersUI } from \"../../mapLayers\";\nimport { IModelApp } from \"@itwin/core-frontend\";\n\n// TODO:\n// Remove this structure and iterate over the registry's active formats.\n// Still need a proper way to exclude some format, like we currently do with\n// 'TileUrl' without the need to hardcode any format Id.\nexport const MAP_TYPES = {\n wms: \"WMS\",\n arcGis: \"ArcGIS\",\n wmts: \"WMTS\",\n tileUrl: \"TileURL\",\n arcGisFeature: \"ArcGISFeature\",\n};\n\ninterface SelectMapFormatProps {\n value?: string;\n disabled?: boolean;\n mapTypesOptions?: MapTypesOptions;\n onChange?: (mapType: string) => void;\n}\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function SelectMapFormat(props: SelectMapFormatProps) {\n\n const [mapFormat, setMapFormat] = React.useState(props.value ?? MAP_TYPES.arcGis);\n const [techPreviewTooltip] = React.useState(MapLayersUI.localization.getLocalizedString(\"mapLayers:CustomAttach.TechPreviewBadgeTooltip\"));\n\n const [mapFormats] = React.useState((): SelectOption<string>[] => {\n const formats: SelectOption<string>[] = [\n { value: MAP_TYPES.arcGis, label: MAP_TYPES.arcGis },\n { value: MAP_TYPES.wms, label: MAP_TYPES.wms },\n { value: MAP_TYPES.wmts, label: MAP_TYPES.wmts },\n ];\n if (props.mapTypesOptions?.supportTileUrl)\n formats.push({ value: MAP_TYPES.tileUrl, label: MAP_TYPES.tileUrl });\n\n if (IModelApp.mapLayerFormatRegistry.isRegistered(MAP_TYPES.arcGisFeature))\n formats.push( { value: MAP_TYPES.arcGisFeature, label: MAP_TYPES.arcGisFeature, id:\"techPreview\" });\n\n return formats;\n });\n\n const handleOnChange = React.useCallback((value: string) => {\n setMapFormat(value);\n if (props.onChange) {\n props.onChange(value);\n }\n }, [props]);\n\n return (\n\n <Select\n className=\"map-layer-source-select\"\n options={mapFormats}\n value={mapFormat}\n disabled={props.disabled}\n onChange={handleOnChange}\n size=\"small\"\n itemRenderer={\n (option) => (\n <MenuItem\n badge={option.id?.includes(\"techPreview\") ?\n <div title={techPreviewTooltip} className=\"map-layer-source-select-previewBadge\">\n <Icon size=\"small\"><SvgTechnicalPreviewMini /></Icon>\n </div>\n : undefined}>\n {option.label}\n </MenuItem>) }\n />\n );\n}\n"]}
1
+ {"version":3,"file":"SelectMapFormat.js","sourceRoot":"","sources":["../../../../src/ui/widget/SelectMap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,CAAC,OAAO,EAAE,KAAK,EAAE,SAAS,CAAC,OAAO,EAAE,CAAC,CAAC;QAEvE,IAAI,SAAS,CAAC,sBAAsB,CAAC,YAAY,CAAC,SAAS,CAAC,aAAa,CAAC;YACxE,OAAO,CAAC,IAAI,CAAE,EAAE,KAAK,EAAE,SAAS,CAAC,aAAa,EAAE,KAAK,EAAE,SAAS,CAAC,aAAa,EAAE,EAAE,EAAC,aAAa,EAAE,CAAC,CAAC;QAEtG,OAAO,OAAO,CAAC;IACjB,CAAC,CAAC,CAAC;IAEH,MAAM,cAAc,GAAG,KAAK,CAAC,WAAW,CAAC,CAAC,KAAa,EAAE,EAAE;QACzD,YAAY,CAAC,KAAK,CAAC,CAAC;QACpB,IAAI,KAAK,CAAC,QAAQ,EAAE;YAClB,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;SACvB;IACH,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC;IAEZ,OAAO,CAEL,oBAAC,aAAa,IACZ,SAAS,EAAC,yBAAyB,EACnC,OAAO,EAAE,UAAU,EACnB,KAAK,EAAE,SAAS,EAChB,QAAQ,EAAE,KAAK,CAAC,QAAQ,EACxB,QAAQ,EAAE,cAAc,EACxB,IAAI,EAAC,OAAO,EACZ,YAAY,EACV,CAAC,MAAM,EAAE,EAAE,CAAC,CACV,oBAAC,QAAQ,IACP,KAAK,EAAE,MAAM,CAAC,EAAE,EAAE,QAAQ,CAAC,aAAa,CAAC,CAAC,CAAC;gBACzC,6BAAK,KAAK,EAAE,WAAW,CAAC,SAAS,CAAC,gCAAgC,CAAC,EAAE,SAAS,EAAC,sCAAsC;oBACnH,oBAAC,IAAI,IAAC,IAAI,EAAC,OAAO;wBAAC,oBAAC,uBAAuB,OAAG,CAAO,CACjD;gBACN,CAAC,CAAC,SAAS,IACZ,MAAM,CAAC,KAAK,CACJ,CAAC,GAChB,CACH,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 \"./MapUrlDialog.scss\";\nimport * as React from \"react\";\nimport { IModelApp } from \"@itwin/core-frontend\";\nimport { SvgTechnicalPreviewMini } from \"@itwin/itwinui-icons-color-react\";\nimport { Icon, LabeledSelect, MenuItem, SelectOption } from \"@itwin/itwinui-react\";\nimport { MapLayersUI } from \"../../mapLayers\";\nimport { MapTypesOptions } from \"../Interfaces\";\n\n// TODO:\n// Remove this structure and iterate over the registry's active formats.\n// Still need a proper way to exclude some format, like we currently do with\n// 'TileUrl' without the need to hardcode any format Id.\nexport const MAP_TYPES = {\n wms: \"WMS\",\n arcGis: \"ArcGIS\",\n wmts: \"WMTS\",\n tileUrl: \"TileURL\",\n arcGisFeature: \"ArcGISFeature\",\n};\n\ninterface SelectMapFormatProps {\n value?: string;\n disabled?: boolean;\n mapTypesOptions?: MapTypesOptions;\n onChange?: (mapType: string) => void;\n /**\n * Message below the select. Does not apply to 'inline' select.\n */\n message?: React.ReactNode;\n /**\n * Status of the select.\n * @default ''\n */\n status?: \"positive\" | \"warning\" | \"negative\";\n}\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function SelectMapFormat(props: SelectMapFormatProps) {\n\n const [mapFormat, setMapFormat] = React.useState(props.value ?? MAP_TYPES.arcGis);\n\n const [mapFormats] = React.useState((): SelectOption<string>[] => {\n const formats: SelectOption<string>[] = [\n { value: MAP_TYPES.arcGis, label: MAP_TYPES.arcGis },\n { value: MAP_TYPES.wms, label: MAP_TYPES.wms },\n { value: MAP_TYPES.wmts, label: MAP_TYPES.wmts },\n ];\n if (props.mapTypesOptions?.supportTileUrl)\n formats.push({ value: MAP_TYPES.tileUrl, label: MAP_TYPES.tileUrl });\n\n if (IModelApp.mapLayerFormatRegistry.isRegistered(MAP_TYPES.arcGisFeature))\n formats.push( { value: MAP_TYPES.arcGisFeature, label: MAP_TYPES.arcGisFeature, id:\"techPreview\" });\n\n return formats;\n });\n\n const handleOnChange = React.useCallback((value: string) => {\n setMapFormat(value);\n if (props.onChange) {\n props.onChange(value);\n }\n }, [props]);\n\n return (\n\n <LabeledSelect\n className=\"map-layer-source-select\"\n options={mapFormats}\n value={mapFormat}\n disabled={props.disabled}\n onChange={handleOnChange}\n size=\"small\"\n itemRenderer={\n (option) => (\n <MenuItem\n badge={option.id?.includes(\"techPreview\") ?\n <div title={MapLayersUI.translate(\"Labels.TechPreviewBadgeTooltip\")} className=\"map-layer-source-select-previewBadge\">\n <Icon size=\"small\"><SvgTechnicalPreviewMini /></Icon>\n </div>\n : undefined}>\n {option.label}\n </MenuItem>) }\n />\n );\n}\n"]}
@@ -0,0 +1,10 @@
1
+ import * as React from "react";
2
+ interface UserPreferencesStorageOptionsProps {
3
+ disabled?: boolean;
4
+ itwinChecked?: boolean;
5
+ modelChecked?: boolean;
6
+ onChange?: (event: React.ChangeEvent<HTMLInputElement>) => void;
7
+ }
8
+ export declare function UserPreferencesStorageOptions(props: UserPreferencesStorageOptionsProps): JSX.Element;
9
+ export {};
10
+ //# sourceMappingURL=UserPreferencesStorageOptions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"UserPreferencesStorageOptions.d.ts","sourceRoot":"","sources":["../../../../src/ui/widget/UserPreferencesStorageOptions.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,UAAU,kCAAkC;IAC1C,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,WAAW,CAAC,gBAAgB,CAAC,KAAK,IAAI,CAAC;CACjE;AAED,wBAAgB,6BAA6B,CAAC,KAAK,EAAE,kCAAkC,eAqBtF"}
@@ -0,0 +1,13 @@
1
+ /*---------------------------------------------------------------------------------------------
2
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
+ * See LICENSE.md in the project root for license terms and full copyright notice.
4
+ *--------------------------------------------------------------------------------------------*/
5
+ import * as React from "react";
6
+ import { Radio } from "@itwin/itwinui-react";
7
+ import { MapLayersUI } from "../../mapLayers";
8
+ export function UserPreferencesStorageOptions(props) {
9
+ return (React.createElement("div", null,
10
+ React.createElement(Radio, { disabled: props.disabled, name: "settingsStorage", value: "iTwin", label: MapLayersUI.translate("CustomAttach.StoreOnITwinSettings"), checked: props.itwinChecked, onChange: props.onChange }),
11
+ React.createElement(Radio, { disabled: props.disabled, name: "settingsStorage", value: "Model", label: MapLayersUI.translate("CustomAttach.StoreOnModelSettings"), checked: props.modelChecked, onChange: props.onChange })));
12
+ }
13
+ //# sourceMappingURL=UserPreferencesStorageOptions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"UserPreferencesStorageOptions.js","sourceRoot":"","sources":["../../../../src/ui/widget/UserPreferencesStorageOptions.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAC7C,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAS9C,MAAM,UAAU,6BAA6B,CAAC,KAAyC;IACrF,OAAO,CACL;QACE,oBAAC,KAAK,IACJ,QAAQ,EAAE,KAAK,CAAC,QAAQ,EACxB,IAAI,EAAC,iBAAiB,EACtB,KAAK,EAAC,OAAO,EACb,KAAK,EAAE,WAAW,CAAC,SAAS,CAAC,mCAAmC,CAAC,EACjE,OAAO,EAAE,KAAK,CAAC,YAAY,EAC3B,QAAQ,EAAE,KAAK,CAAC,QAAQ,GACxB;QACF,oBAAC,KAAK,IACJ,QAAQ,EAAE,KAAK,CAAC,QAAQ,EACxB,IAAI,EAAC,iBAAiB,EACtB,KAAK,EAAC,OAAO,EACb,KAAK,EAAE,WAAW,CAAC,SAAS,CAAC,mCAAmC,CAAC,EACjE,OAAO,EAAE,KAAK,CAAC,YAAY,EAC3B,QAAQ,EAAE,KAAK,CAAC,QAAQ,GACxB,CACE,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 * as React from \"react\";\nimport { Radio } from \"@itwin/itwinui-react\";\nimport { MapLayersUI } from \"../../mapLayers\";\n\ninterface UserPreferencesStorageOptionsProps {\n disabled?: boolean;\n itwinChecked?: boolean;\n modelChecked?: boolean;\n onChange?: (event: React.ChangeEvent<HTMLInputElement>) => void;\n}\n\nexport function UserPreferencesStorageOptions(props: UserPreferencesStorageOptionsProps) {\n return (\n <div>\n <Radio\n disabled={props.disabled}\n name=\"settingsStorage\"\n value=\"iTwin\"\n label={MapLayersUI.translate(\"CustomAttach.StoreOnITwinSettings\")}\n checked={props.itwinChecked}\n onChange={props.onChange}\n />\n <Radio\n disabled={props.disabled}\n name=\"settingsStorage\"\n value=\"Model\"\n label={MapLayersUI.translate(\"CustomAttach.StoreOnModelSettings\")}\n checked={props.modelChecked}\n onChange={props.onChange}\n />\n </div>\n );\n}\n"]}
@@ -23,6 +23,28 @@
23
23
  "AllOn": "Select All",
24
24
  "AllOff": "Select None"
25
25
  },
26
+ "CustomParamEditDialog":
27
+ {
28
+ "DialogTitleAdd": "Add custom query parameter",
29
+ "DialogTitleEdit": "Edit custom query parameter",
30
+ "NameExists": "Name already exists",
31
+ "ParamKeyLabel": "Key",
32
+ "ParamNameLabel": "Name",
33
+ "ParamValueLabel": "Value",
34
+ "ParamValueNonPrivateMessage": "Value should not contain sensitive data",
35
+ "PrivateToggleTooltip": "Private query parameters won't be saved part of the iTwin",
36
+ "PrivateToggleLabel": "Keep query parameter private"
37
+ },
38
+ "CustomParamSelect":
39
+ {
40
+ "DisabledTitle": "Custom query parameter can be configured in the advanced settings"
41
+ },
42
+ "CustomParamSettings":
43
+ {
44
+ "DeleteButtonTitle": "Delete custom parameter",
45
+ "EditButtonTitle": "Edit custom parameter",
46
+ "SectionLabel": "Custom parameters"
47
+ },
26
48
  "MapLayerActionButtons": {
27
49
  "ShowAllLabel": "Show all",
28
50
  "HideAllLabel": "Hide all",
@@ -38,9 +60,10 @@
38
60
  "AttachCustomLayer": "Add New Layer",
39
61
  "AttacheInfo": "Map layer attached from URL:",
40
62
  "Custom": "New",
63
+ "CustomParamsLabel": "Custom Query Parameters",
41
64
  "LoadingMapSources": "Loading Map Sources",
42
65
  "EditCustomLayer": "Edit Layer",
43
- "EditLayerDefButtonTitle": "Edit Layer Definition",
66
+ "EditLayerDefButtonTitle": "Edit layer definition",
44
67
  "ErrorLoadingLayers": "Error retrieving map layers stored in the settings service",
45
68
  "ErrorRetrieveUserModel": "Could not get saved Map Layers for user by model: {{errorMessage}}",
46
69
  "ErrorRetrieveUserITwin": "Could not get saved Map Layers for user by iTwin: {{errorMessage}}",
@@ -53,6 +76,7 @@
53
76
  "ExternalLoginWaiting": "Waiting for external login process to complete...",
54
77
  "InvalidCredentials": "Invalid credentials provided",
55
78
  "InvalidCoordinateSystem": "Map layer geographic coordinate system is not supported",
79
+ "InvalidType": "Invalid Type",
56
80
  "MissingCredentials": "This layer requires credentials to be provided",
57
81
  "Name": "Name",
58
82
  "NameInputPlaceHolder": "Enter Map Name",
@@ -66,7 +90,6 @@
66
90
  "SelectLayersToCreate": "Select Layers To Add",
67
91
  "StoreOnModelSettings": "Store on Model Settings",
68
92
  "StoreOnITwinSettings": "Store on iTwin Settings",
69
- "TechPreviewBadgeTooltip": "Technology preview",
70
93
  "TooManyLayersSelected": "{{layerCount}} layers selected; performance may be affected.",
71
94
  "Type": "Type",
72
95
  "URL": "URL",
@@ -80,6 +103,9 @@
80
103
  "Username": "Username",
81
104
  "UsernameRequired": "Username required"
82
105
  },
106
+ "Labels" : {
107
+ "TechPreviewBadgeTooltip": "Technology preview"
108
+ },
83
109
  "Messages": {
84
110
  "NotSupported": "No active viewport or geo-located iModel available.",
85
111
  "NoRangeDefined": "No range is defined for Map Layer",
@@ -155,4 +181,4 @@
155
181
  "Street" : "Bing Maps: Streets"
156
182
  }
157
183
  }
158
- }
184
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@itwin/map-layers",
3
- "version": "5.3.0",
3
+ "version": "5.4.0",
4
4
  "description": "Extension that adds a Map Layers Widget",
5
5
  "main": "lib/cjs/map-layers.js",
6
6
  "module": "lib/esm/map-layers.js",
@@ -38,6 +38,7 @@
38
38
  "dependencies": {
39
39
  "@itwin/itwinui-icons-color-react": "^2.1.0",
40
40
  "@itwin/itwinui-icons-react": "^2.6.0",
41
+ "@itwin/itwinui-react": "^2.11.2",
41
42
  "classnames": "^2.3.1",
42
43
  "react-beautiful-dnd": "^13.1.1"
43
44
  },
@@ -58,7 +59,6 @@
58
59
  "@itwin/eslint-plugin": "^4.0.0-dev.38",
59
60
  "@itwin/imodel-components-react": "^4.0.1",
60
61
  "@itwin/itwinui-variables": "^2.0.0",
61
- "@itwin/itwinui-react": "^2.11.2",
62
62
  "@itwin/map-layers-formats": "^4.3.0",
63
63
  "@itwin/webgl-compatibility": "^4.3.0",
64
64
  "@testing-library/dom": "^8.12.0",
@@ -115,10 +115,10 @@
115
115
  "@itwin/appui-layout-react": "^4.0.0",
116
116
  "@itwin/appui-react": "^4.0.0",
117
117
  "@itwin/components-react": "^4.0.0",
118
- "@itwin/core-bentley": "^4.0.0",
119
- "@itwin/core-common": "^4.0.0",
120
- "@itwin/core-frontend": "^4.1.2",
121
- "@itwin/core-react": "^4.0.0",
118
+ "@itwin/core-bentley": "^4.3.0",
119
+ "@itwin/core-common": "^4.3.0",
120
+ "@itwin/core-frontend": "^4.3.0",
121
+ "@itwin/core-react": "^4.3.0",
122
122
  "@itwin/imodel-components-react": "^4.0.0",
123
123
  "react": "^17.0.0",
124
124
  "react-dom": "^17.0.0"