@itwin/map-layers 5.4.4 → 5.6.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 (304) hide show
  1. package/CHANGELOG.md +18 -2
  2. package/README.md +7 -7
  3. package/lib/cjs/BrowserStorage.d.ts.map +1 -1
  4. package/lib/cjs/BrowserStorage.js +23 -13
  5. package/lib/cjs/BrowserStorage.js.map +1 -1
  6. package/lib/cjs/CustomParamUtils.d.ts +1 -1
  7. package/lib/cjs/CustomParamUtils.d.ts.map +1 -1
  8. package/lib/cjs/CustomParamUtils.js +6 -3
  9. package/lib/cjs/CustomParamUtils.js.map +1 -1
  10. package/lib/cjs/CustomParamsMappingStorage.d.ts +1 -1
  11. package/lib/cjs/CustomParamsMappingStorage.d.ts.map +1 -1
  12. package/lib/cjs/CustomParamsMappingStorage.js +3 -3
  13. package/lib/cjs/CustomParamsMappingStorage.js.map +1 -1
  14. package/lib/cjs/CustomParamsStorage.d.ts +1 -1
  15. package/lib/cjs/CustomParamsStorage.d.ts.map +1 -1
  16. package/lib/cjs/CustomParamsStorage.js +3 -3
  17. package/lib/cjs/CustomParamsStorage.js.map +1 -1
  18. package/lib/cjs/MapLayerPreferences.d.ts +2 -1
  19. package/lib/cjs/MapLayerPreferences.d.ts.map +1 -1
  20. package/lib/cjs/MapLayerPreferences.js +50 -25
  21. package/lib/cjs/MapLayerPreferences.js.map +1 -1
  22. package/lib/cjs/MapLayersActionIds.d.ts +5 -0
  23. package/lib/cjs/MapLayersActionIds.d.ts.map +1 -0
  24. package/lib/cjs/MapLayersActionIds.js +10 -0
  25. package/lib/cjs/MapLayersActionIds.js.map +1 -0
  26. package/lib/cjs/MapLayersPrefBrowserStorage.d.ts.map +1 -1
  27. package/lib/cjs/MapLayersPrefBrowserStorage.js +4 -5
  28. package/lib/cjs/MapLayersPrefBrowserStorage.js.map +1 -1
  29. package/lib/cjs/PreferencesBrowserStorage.d.ts +17 -17
  30. package/lib/cjs/PreferencesBrowserStorage.d.ts.map +1 -1
  31. package/lib/cjs/PreferencesBrowserStorage.js +14 -14
  32. package/lib/cjs/PreferencesBrowserStorage.js.map +1 -1
  33. package/lib/cjs/map-layers.d.ts +1 -0
  34. package/lib/cjs/map-layers.d.ts.map +1 -1
  35. package/lib/cjs/map-layers.js +4 -3
  36. package/lib/cjs/map-layers.js.map +1 -1
  37. package/lib/cjs/mapLayers.d.ts +2 -2
  38. package/lib/cjs/mapLayers.d.ts.map +1 -1
  39. package/lib/cjs/mapLayers.js.map +1 -1
  40. package/lib/cjs/public/locales/en/mapLayers.json +179 -184
  41. package/lib/cjs/ui/FeatureInfoUiItemsProvider.d.ts +3 -4
  42. package/lib/cjs/ui/FeatureInfoUiItemsProvider.d.ts.map +1 -1
  43. package/lib/cjs/ui/FeatureInfoUiItemsProvider.js +48 -18
  44. package/lib/cjs/ui/FeatureInfoUiItemsProvider.js.map +1 -1
  45. package/lib/cjs/ui/Interfaces.d.ts +3 -3
  46. package/lib/cjs/ui/Interfaces.d.ts.map +1 -1
  47. package/lib/cjs/ui/Interfaces.js.map +1 -1
  48. package/lib/cjs/ui/MapLayersUiItemsProvider.d.ts +3 -2
  49. package/lib/cjs/ui/MapLayersUiItemsProvider.d.ts.map +1 -1
  50. package/lib/cjs/ui/MapLayersUiItemsProvider.js +2 -6
  51. package/lib/cjs/ui/MapLayersUiItemsProvider.js.map +1 -1
  52. package/lib/cjs/ui/widget/AttachLayerPopupButton.d.ts.map +1 -1
  53. package/lib/cjs/ui/widget/AttachLayerPopupButton.js +81 -46
  54. package/lib/cjs/ui/widget/AttachLayerPopupButton.js.map +1 -1
  55. package/lib/cjs/ui/widget/BasemapPanel.d.ts.map +1 -1
  56. package/lib/cjs/ui/widget/BasemapPanel.js +44 -25
  57. package/lib/cjs/ui/widget/BasemapPanel.js.map +1 -1
  58. package/lib/cjs/ui/widget/BasemapPanel.scss +2 -4
  59. package/lib/cjs/ui/widget/ConfirmMessageDialog.d.ts +1 -1
  60. package/lib/cjs/ui/widget/ConfirmMessageDialog.d.ts.map +1 -1
  61. package/lib/cjs/ui/widget/ConfirmMessageDialog.js +31 -8
  62. package/lib/cjs/ui/widget/ConfirmMessageDialog.js.map +1 -1
  63. package/lib/cjs/ui/widget/CustomParamEditDialog.d.ts +1 -1
  64. package/lib/cjs/ui/widget/CustomParamEditDialog.d.ts.map +1 -1
  65. package/lib/cjs/ui/widget/CustomParamEditDialog.js +34 -20
  66. package/lib/cjs/ui/widget/CustomParamEditDialog.js.map +1 -1
  67. package/lib/cjs/ui/widget/CustomParamEditDialog.scss +1 -2
  68. package/lib/cjs/ui/widget/CustomParamsSettings.d.ts.map +1 -1
  69. package/lib/cjs/ui/widget/CustomParamsSettings.js +42 -27
  70. package/lib/cjs/ui/widget/CustomParamsSettings.js.map +1 -1
  71. package/lib/cjs/ui/widget/CustomParamsSettings.scss +7 -9
  72. package/lib/cjs/ui/widget/FeatureInfoDataProvider.d.ts +3 -2
  73. package/lib/cjs/ui/widget/FeatureInfoDataProvider.d.ts.map +1 -1
  74. package/lib/cjs/ui/widget/FeatureInfoDataProvider.js +4 -2
  75. package/lib/cjs/ui/widget/FeatureInfoDataProvider.js.map +1 -1
  76. package/lib/cjs/ui/widget/FeatureInfoWidget.d.ts +1 -1
  77. package/lib/cjs/ui/widget/FeatureInfoWidget.d.ts.map +1 -1
  78. package/lib/cjs/ui/widget/FeatureInfoWidget.js +34 -15
  79. package/lib/cjs/ui/widget/FeatureInfoWidget.js.map +1 -1
  80. package/lib/cjs/ui/widget/MapLayerActionButtons.d.ts +1 -1
  81. package/lib/cjs/ui/widget/MapLayerActionButtons.d.ts.map +1 -1
  82. package/lib/cjs/ui/widget/MapLayerActionButtons.js +30 -17
  83. package/lib/cjs/ui/widget/MapLayerActionButtons.js.map +1 -1
  84. package/lib/cjs/ui/widget/MapLayerDroppable.d.ts +2 -2
  85. package/lib/cjs/ui/widget/MapLayerDroppable.d.ts.map +1 -1
  86. package/lib/cjs/ui/widget/MapLayerDroppable.js +64 -50
  87. package/lib/cjs/ui/widget/MapLayerDroppable.js.map +1 -1
  88. package/lib/cjs/ui/widget/MapLayerManager.d.ts +2 -2
  89. package/lib/cjs/ui/widget/MapLayerManager.d.ts.map +1 -1
  90. package/lib/cjs/ui/widget/MapLayerManager.js +158 -84
  91. package/lib/cjs/ui/widget/MapLayerManager.js.map +1 -1
  92. package/lib/cjs/ui/widget/MapLayerManager.scss +3 -6
  93. package/lib/cjs/ui/widget/MapLayerSettingsMenu.d.ts +2 -2
  94. package/lib/cjs/ui/widget/MapLayerSettingsMenu.d.ts.map +1 -1
  95. package/lib/cjs/ui/widget/MapLayerSettingsMenu.js +33 -13
  96. package/lib/cjs/ui/widget/MapLayerSettingsMenu.js.map +1 -1
  97. package/lib/cjs/ui/widget/MapLayerSettingsPopupButton.d.ts.map +1 -1
  98. package/lib/cjs/ui/widget/MapLayerSettingsPopupButton.js +36 -14
  99. package/lib/cjs/ui/widget/MapLayerSettingsPopupButton.js.map +1 -1
  100. package/lib/cjs/ui/widget/MapLayerSettingsPopupButton.scss +5 -5
  101. package/lib/cjs/ui/widget/MapLayersWidget.d.ts +1 -1
  102. package/lib/cjs/ui/widget/MapLayersWidget.d.ts.map +1 -1
  103. package/lib/cjs/ui/widget/MapLayersWidget.js +34 -11
  104. package/lib/cjs/ui/widget/MapLayersWidget.js.map +1 -1
  105. package/lib/cjs/ui/widget/MapManagerMapLayersHeader.d.ts.map +1 -1
  106. package/lib/cjs/ui/widget/MapManagerMapLayersHeader.js +5 -8
  107. package/lib/cjs/ui/widget/MapManagerMapLayersHeader.js.map +1 -1
  108. package/lib/cjs/ui/widget/MapManagerSettings.d.ts.map +1 -1
  109. package/lib/cjs/ui/widget/MapManagerSettings.js +55 -56
  110. package/lib/cjs/ui/widget/MapManagerSettings.js.map +1 -1
  111. package/lib/cjs/ui/widget/MapManagerSettings.scss +1 -1
  112. package/lib/cjs/ui/widget/MapSelectFeaturesDialog.d.ts +2 -2
  113. package/lib/cjs/ui/widget/MapSelectFeaturesDialog.d.ts.map +1 -1
  114. package/lib/cjs/ui/widget/MapSelectFeaturesDialog.js +33 -18
  115. package/lib/cjs/ui/widget/MapSelectFeaturesDialog.js.map +1 -1
  116. package/lib/cjs/ui/widget/MapSelectFeaturesDialog.scss +1 -3
  117. package/lib/cjs/ui/widget/MapUrlDialog.d.ts +4 -3
  118. package/lib/cjs/ui/widget/MapUrlDialog.d.ts.map +1 -1
  119. package/lib/cjs/ui/widget/MapUrlDialog.js +104 -81
  120. package/lib/cjs/ui/widget/MapUrlDialog.js.map +1 -1
  121. package/lib/cjs/ui/widget/MapUrlDialog.scss +6 -7
  122. package/lib/cjs/ui/widget/SelectApiKey.d.ts.map +1 -1
  123. package/lib/cjs/ui/widget/SelectApiKey.js +38 -10
  124. package/lib/cjs/ui/widget/SelectApiKey.js.map +1 -1
  125. package/lib/cjs/ui/widget/SelectCustomParam.d.ts.map +1 -1
  126. package/lib/cjs/ui/widget/SelectCustomParam.js +40 -11
  127. package/lib/cjs/ui/widget/SelectCustomParam.js.map +1 -1
  128. package/lib/cjs/ui/widget/SelectMapFormat.d.ts +3 -3
  129. package/lib/cjs/ui/widget/SelectMapFormat.d.ts.map +1 -1
  130. package/lib/cjs/ui/widget/SelectMapFormat.js +36 -16
  131. package/lib/cjs/ui/widget/SelectMapFormat.js.map +1 -1
  132. package/lib/cjs/ui/widget/SubLayersDataProvider.d.ts +2 -2
  133. package/lib/cjs/ui/widget/SubLayersDataProvider.d.ts.map +1 -1
  134. package/lib/cjs/ui/widget/SubLayersDataProvider.js +13 -9
  135. package/lib/cjs/ui/widget/SubLayersDataProvider.js.map +1 -1
  136. package/lib/cjs/ui/widget/SubLayersPopupButton.d.ts +1 -1
  137. package/lib/cjs/ui/widget/SubLayersPopupButton.d.ts.map +1 -1
  138. package/lib/cjs/ui/widget/SubLayersPopupButton.js +30 -12
  139. package/lib/cjs/ui/widget/SubLayersPopupButton.js.map +1 -1
  140. package/lib/cjs/ui/widget/SubLayersTree.d.ts +2 -2
  141. package/lib/cjs/ui/widget/SubLayersTree.d.ts.map +1 -1
  142. package/lib/cjs/ui/widget/SubLayersTree.js +83 -45
  143. package/lib/cjs/ui/widget/SubLayersTree.js.map +1 -1
  144. package/lib/cjs/ui/widget/SubLayersTree.scss +4 -7
  145. package/lib/cjs/ui/widget/TransparencyPopupButton.d.ts.map +1 -1
  146. package/lib/cjs/ui/widget/TransparencyPopupButton.js +33 -16
  147. package/lib/cjs/ui/widget/TransparencyPopupButton.js.map +1 -1
  148. package/lib/cjs/ui/widget/TransparencyPopupButton.scss +1 -2
  149. package/lib/cjs/ui/widget/UserPreferencesStorageOptions.d.ts +1 -1
  150. package/lib/cjs/ui/widget/UserPreferencesStorageOptions.d.ts.map +1 -1
  151. package/lib/cjs/ui/widget/UserPreferencesStorageOptions.js +2 -8
  152. package/lib/cjs/ui/widget/UserPreferencesStorageOptions.js.map +1 -1
  153. package/lib/esm/BrowserStorage.d.ts.map +1 -1
  154. package/lib/esm/BrowserStorage.js +23 -13
  155. package/lib/esm/BrowserStorage.js.map +1 -1
  156. package/lib/esm/CustomParamUtils.d.ts +1 -1
  157. package/lib/esm/CustomParamUtils.d.ts.map +1 -1
  158. package/lib/esm/CustomParamUtils.js +6 -3
  159. package/lib/esm/CustomParamUtils.js.map +1 -1
  160. package/lib/esm/CustomParamsMappingStorage.d.ts +1 -1
  161. package/lib/esm/CustomParamsMappingStorage.d.ts.map +1 -1
  162. package/lib/esm/CustomParamsMappingStorage.js +3 -3
  163. package/lib/esm/CustomParamsMappingStorage.js.map +1 -1
  164. package/lib/esm/CustomParamsStorage.d.ts +1 -1
  165. package/lib/esm/CustomParamsStorage.d.ts.map +1 -1
  166. package/lib/esm/CustomParamsStorage.js +3 -3
  167. package/lib/esm/CustomParamsStorage.js.map +1 -1
  168. package/lib/esm/MapLayerPreferences.d.ts +2 -1
  169. package/lib/esm/MapLayerPreferences.d.ts.map +1 -1
  170. package/lib/esm/MapLayerPreferences.js +50 -25
  171. package/lib/esm/MapLayerPreferences.js.map +1 -1
  172. package/lib/esm/MapLayersActionIds.d.ts +5 -0
  173. package/lib/esm/MapLayersActionIds.d.ts.map +1 -0
  174. package/lib/esm/MapLayersActionIds.js +7 -0
  175. package/lib/esm/MapLayersActionIds.js.map +1 -0
  176. package/lib/esm/MapLayersPrefBrowserStorage.d.ts.map +1 -1
  177. package/lib/esm/MapLayersPrefBrowserStorage.js +4 -5
  178. package/lib/esm/MapLayersPrefBrowserStorage.js.map +1 -1
  179. package/lib/esm/PreferencesBrowserStorage.d.ts +17 -17
  180. package/lib/esm/PreferencesBrowserStorage.d.ts.map +1 -1
  181. package/lib/esm/PreferencesBrowserStorage.js +14 -14
  182. package/lib/esm/PreferencesBrowserStorage.js.map +1 -1
  183. package/lib/esm/map-layers.d.ts +1 -0
  184. package/lib/esm/map-layers.d.ts.map +1 -1
  185. package/lib/esm/map-layers.js +4 -3
  186. package/lib/esm/map-layers.js.map +1 -1
  187. package/lib/esm/mapLayers.d.ts +2 -2
  188. package/lib/esm/mapLayers.d.ts.map +1 -1
  189. package/lib/esm/mapLayers.js.map +1 -1
  190. package/lib/esm/public/locales/en/mapLayers.json +179 -184
  191. package/lib/esm/ui/FeatureInfoUiItemsProvider.d.ts +3 -4
  192. package/lib/esm/ui/FeatureInfoUiItemsProvider.d.ts.map +1 -1
  193. package/lib/esm/ui/FeatureInfoUiItemsProvider.js +48 -18
  194. package/lib/esm/ui/FeatureInfoUiItemsProvider.js.map +1 -1
  195. package/lib/esm/ui/Interfaces.d.ts +3 -3
  196. package/lib/esm/ui/Interfaces.d.ts.map +1 -1
  197. package/lib/esm/ui/Interfaces.js.map +1 -1
  198. package/lib/esm/ui/MapLayersUiItemsProvider.d.ts +3 -2
  199. package/lib/esm/ui/MapLayersUiItemsProvider.d.ts.map +1 -1
  200. package/lib/esm/ui/MapLayersUiItemsProvider.js +2 -6
  201. package/lib/esm/ui/MapLayersUiItemsProvider.js.map +1 -1
  202. package/lib/esm/ui/widget/AttachLayerPopupButton.d.ts.map +1 -1
  203. package/lib/esm/ui/widget/AttachLayerPopupButton.js +57 -45
  204. package/lib/esm/ui/widget/AttachLayerPopupButton.js.map +1 -1
  205. package/lib/esm/ui/widget/BasemapPanel.d.ts.map +1 -1
  206. package/lib/esm/ui/widget/BasemapPanel.js +19 -23
  207. package/lib/esm/ui/widget/BasemapPanel.js.map +1 -1
  208. package/lib/esm/ui/widget/BasemapPanel.scss +2 -4
  209. package/lib/esm/ui/widget/ConfirmMessageDialog.d.ts +1 -1
  210. package/lib/esm/ui/widget/ConfirmMessageDialog.d.ts.map +1 -1
  211. package/lib/esm/ui/widget/ConfirmMessageDialog.js +5 -5
  212. package/lib/esm/ui/widget/ConfirmMessageDialog.js.map +1 -1
  213. package/lib/esm/ui/widget/CustomParamEditDialog.d.ts +1 -1
  214. package/lib/esm/ui/widget/CustomParamEditDialog.d.ts.map +1 -1
  215. package/lib/esm/ui/widget/CustomParamEditDialog.js +9 -18
  216. package/lib/esm/ui/widget/CustomParamEditDialog.js.map +1 -1
  217. package/lib/esm/ui/widget/CustomParamEditDialog.scss +1 -2
  218. package/lib/esm/ui/widget/CustomParamsSettings.d.ts.map +1 -1
  219. package/lib/esm/ui/widget/CustomParamsSettings.js +17 -25
  220. package/lib/esm/ui/widget/CustomParamsSettings.js.map +1 -1
  221. package/lib/esm/ui/widget/CustomParamsSettings.scss +7 -9
  222. package/lib/esm/ui/widget/FeatureInfoDataProvider.d.ts +3 -2
  223. package/lib/esm/ui/widget/FeatureInfoDataProvider.d.ts.map +1 -1
  224. package/lib/esm/ui/widget/FeatureInfoDataProvider.js +4 -2
  225. package/lib/esm/ui/widget/FeatureInfoDataProvider.js.map +1 -1
  226. package/lib/esm/ui/widget/FeatureInfoWidget.d.ts +1 -1
  227. package/lib/esm/ui/widget/FeatureInfoWidget.d.ts.map +1 -1
  228. package/lib/esm/ui/widget/FeatureInfoWidget.js +10 -14
  229. package/lib/esm/ui/widget/FeatureInfoWidget.js.map +1 -1
  230. package/lib/esm/ui/widget/MapLayerActionButtons.d.ts +1 -1
  231. package/lib/esm/ui/widget/MapLayerActionButtons.d.ts.map +1 -1
  232. package/lib/esm/ui/widget/MapLayerActionButtons.js +6 -16
  233. package/lib/esm/ui/widget/MapLayerActionButtons.js.map +1 -1
  234. package/lib/esm/ui/widget/MapLayerDroppable.d.ts +2 -2
  235. package/lib/esm/ui/widget/MapLayerDroppable.d.ts.map +1 -1
  236. package/lib/esm/ui/widget/MapLayerDroppable.js +38 -47
  237. package/lib/esm/ui/widget/MapLayerDroppable.js.map +1 -1
  238. package/lib/esm/ui/widget/MapLayerManager.d.ts +2 -2
  239. package/lib/esm/ui/widget/MapLayerManager.d.ts.map +1 -1
  240. package/lib/esm/ui/widget/MapLayerManager.js +134 -83
  241. package/lib/esm/ui/widget/MapLayerManager.js.map +1 -1
  242. package/lib/esm/ui/widget/MapLayerManager.scss +3 -6
  243. package/lib/esm/ui/widget/MapLayerSettingsMenu.d.ts +2 -2
  244. package/lib/esm/ui/widget/MapLayerSettingsMenu.d.ts.map +1 -1
  245. package/lib/esm/ui/widget/MapLayerSettingsMenu.js +9 -12
  246. package/lib/esm/ui/widget/MapLayerSettingsMenu.js.map +1 -1
  247. package/lib/esm/ui/widget/MapLayerSettingsPopupButton.d.ts.map +1 -1
  248. package/lib/esm/ui/widget/MapLayerSettingsPopupButton.js +11 -12
  249. package/lib/esm/ui/widget/MapLayerSettingsPopupButton.js.map +1 -1
  250. package/lib/esm/ui/widget/MapLayerSettingsPopupButton.scss +5 -5
  251. package/lib/esm/ui/widget/MapLayersWidget.d.ts +1 -1
  252. package/lib/esm/ui/widget/MapLayersWidget.d.ts.map +1 -1
  253. package/lib/esm/ui/widget/MapLayersWidget.js +9 -9
  254. package/lib/esm/ui/widget/MapLayersWidget.js.map +1 -1
  255. package/lib/esm/ui/widget/MapManagerMapLayersHeader.d.ts.map +1 -1
  256. package/lib/esm/ui/widget/MapManagerMapLayersHeader.js +5 -8
  257. package/lib/esm/ui/widget/MapManagerMapLayersHeader.js.map +1 -1
  258. package/lib/esm/ui/widget/MapManagerSettings.d.ts.map +1 -1
  259. package/lib/esm/ui/widget/MapManagerSettings.js +29 -53
  260. package/lib/esm/ui/widget/MapManagerSettings.js.map +1 -1
  261. package/lib/esm/ui/widget/MapManagerSettings.scss +1 -1
  262. package/lib/esm/ui/widget/MapSelectFeaturesDialog.d.ts +2 -2
  263. package/lib/esm/ui/widget/MapSelectFeaturesDialog.d.ts.map +1 -1
  264. package/lib/esm/ui/widget/MapSelectFeaturesDialog.js +7 -15
  265. package/lib/esm/ui/widget/MapSelectFeaturesDialog.js.map +1 -1
  266. package/lib/esm/ui/widget/MapSelectFeaturesDialog.scss +1 -3
  267. package/lib/esm/ui/widget/MapUrlDialog.d.ts +4 -3
  268. package/lib/esm/ui/widget/MapUrlDialog.d.ts.map +1 -1
  269. package/lib/esm/ui/widget/MapUrlDialog.js +79 -79
  270. package/lib/esm/ui/widget/MapUrlDialog.js.map +1 -1
  271. package/lib/esm/ui/widget/MapUrlDialog.scss +6 -7
  272. package/lib/esm/ui/widget/SelectApiKey.d.ts.map +1 -1
  273. package/lib/esm/ui/widget/SelectApiKey.js +12 -7
  274. package/lib/esm/ui/widget/SelectApiKey.js.map +1 -1
  275. package/lib/esm/ui/widget/SelectCustomParam.d.ts.map +1 -1
  276. package/lib/esm/ui/widget/SelectCustomParam.js +14 -8
  277. package/lib/esm/ui/widget/SelectCustomParam.js.map +1 -1
  278. package/lib/esm/ui/widget/SelectMapFormat.d.ts +3 -3
  279. package/lib/esm/ui/widget/SelectMapFormat.d.ts.map +1 -1
  280. package/lib/esm/ui/widget/SelectMapFormat.js +11 -14
  281. package/lib/esm/ui/widget/SelectMapFormat.js.map +1 -1
  282. package/lib/esm/ui/widget/SubLayersDataProvider.d.ts +2 -2
  283. package/lib/esm/ui/widget/SubLayersDataProvider.d.ts.map +1 -1
  284. package/lib/esm/ui/widget/SubLayersDataProvider.js +13 -9
  285. package/lib/esm/ui/widget/SubLayersDataProvider.js.map +1 -1
  286. package/lib/esm/ui/widget/SubLayersPopupButton.d.ts +1 -1
  287. package/lib/esm/ui/widget/SubLayersPopupButton.d.ts.map +1 -1
  288. package/lib/esm/ui/widget/SubLayersPopupButton.js +6 -11
  289. package/lib/esm/ui/widget/SubLayersPopupButton.js.map +1 -1
  290. package/lib/esm/ui/widget/SubLayersTree.d.ts +2 -2
  291. package/lib/esm/ui/widget/SubLayersTree.d.ts.map +1 -1
  292. package/lib/esm/ui/widget/SubLayersTree.js +59 -44
  293. package/lib/esm/ui/widget/SubLayersTree.js.map +1 -1
  294. package/lib/esm/ui/widget/SubLayersTree.scss +4 -7
  295. package/lib/esm/ui/widget/TransparencyPopupButton.d.ts.map +1 -1
  296. package/lib/esm/ui/widget/TransparencyPopupButton.js +8 -14
  297. package/lib/esm/ui/widget/TransparencyPopupButton.js.map +1 -1
  298. package/lib/esm/ui/widget/TransparencyPopupButton.scss +1 -2
  299. package/lib/esm/ui/widget/UserPreferencesStorageOptions.d.ts +1 -1
  300. package/lib/esm/ui/widget/UserPreferencesStorageOptions.d.ts.map +1 -1
  301. package/lib/esm/ui/widget/UserPreferencesStorageOptions.js +2 -8
  302. package/lib/esm/ui/widget/UserPreferencesStorageOptions.js.map +1 -1
  303. package/lib/public/locales/en/mapLayers.json +179 -184
  304. package/package.json +9 -21
@@ -1,17 +1,39 @@
1
1
  "use strict";
2
- /*---------------------------------------------------------------------------------------------
3
- * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
4
- * See LICENSE.md in the project root for license terms and full copyright notice.
5
- *--------------------------------------------------------------------------------------------*/
6
- // cSpell:ignore Modeless WMTS
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
7
25
  Object.defineProperty(exports, "__esModule", { value: true });
8
26
  exports.SelectMapFormat = exports.MAP_TYPES = void 0;
27
+ const jsx_runtime_1 = require("react/jsx-runtime");
28
+ /*---------------------------------------------------------------------------------------------
29
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
30
+ * See LICENSE.md in the project root for license terms and full copyright notice.
31
+ *--------------------------------------------------------------------------------------------*/
32
+ // cSpell:ignore Modeless WMTS
9
33
  require("./MapUrlDialog.scss");
10
- const React = require("react");
34
+ const React = __importStar(require("react"));
11
35
  const core_frontend_1 = require("@itwin/core-frontend");
12
- const itwinui_icons_color_react_1 = require("@itwin/itwinui-icons-color-react");
13
36
  const itwinui_react_1 = require("@itwin/itwinui-react");
14
- const mapLayers_1 = require("../../mapLayers");
15
37
  // TODO:
16
38
  // Remove this structure and iterate over the registry's active formats.
17
39
  // Still need a proper way to exclude some format, like we currently do with
@@ -32,10 +54,12 @@ function SelectMapFormat(props) {
32
54
  { value: exports.MAP_TYPES.wms, label: exports.MAP_TYPES.wms },
33
55
  { value: exports.MAP_TYPES.wmts, label: exports.MAP_TYPES.wmts },
34
56
  ];
35
- if (props.mapTypesOptions?.supportTileUrl)
57
+ if (props.mapTypesOptions?.supportTileUrl) {
36
58
  formats.push({ value: exports.MAP_TYPES.tileUrl, label: exports.MAP_TYPES.tileUrl });
37
- if (core_frontend_1.IModelApp.mapLayerFormatRegistry.isRegistered(exports.MAP_TYPES.arcGisFeature))
38
- formats.push({ value: exports.MAP_TYPES.arcGisFeature, label: exports.MAP_TYPES.arcGisFeature, id: "techPreview" });
59
+ }
60
+ if (core_frontend_1.IModelApp.mapLayerFormatRegistry.isRegistered(exports.MAP_TYPES.arcGisFeature)) {
61
+ formats.push({ value: exports.MAP_TYPES.arcGisFeature, label: exports.MAP_TYPES.arcGisFeature });
62
+ }
39
63
  return formats;
40
64
  });
41
65
  const handleOnChange = React.useCallback((value) => {
@@ -44,11 +68,7 @@ function SelectMapFormat(props) {
44
68
  props.onChange(value);
45
69
  }
46
70
  }, [props]);
47
- return (React.createElement(itwinui_react_1.LabeledSelect, { className: "map-layer-source-select", options: mapFormats, value: mapFormat, disabled: props.disabled, onChange: handleOnChange, size: "small", itemRenderer: (option) => (React.createElement(itwinui_react_1.MenuItem, { badge: option.id?.includes("techPreview") ?
48
- React.createElement("div", { title: mapLayers_1.MapLayersUI.translate("Labels.TechPreviewBadgeTooltip"), className: "map-layer-source-select-previewBadge" },
49
- React.createElement(itwinui_react_1.Icon, { size: "small" },
50
- React.createElement(itwinui_icons_color_react_1.SvgTechnicalPreviewMini, null)))
51
- : undefined }, option.label)) }));
71
+ return ((0, jsx_runtime_1.jsx)(itwinui_react_1.LabeledSelect, { className: "map-layer-source-select", options: mapFormats, value: mapFormat, disabled: props.disabled, onChange: handleOnChange, size: "small", itemRenderer: (option) => (0, jsx_runtime_1.jsx)(itwinui_react_1.MenuItem, { children: option.label }) }));
52
72
  }
53
73
  exports.SelectMapFormat = SelectMapFormat;
54
74
  //# sourceMappingURL=SelectMapFormat.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"SelectMapFormat.js","sourceRoot":"","sources":["../../../../src/ui/widget/SelectMapFormat.tsx"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F,8BAA8B;;;AAE9B,+BAA6B;AAC7B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tG,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,6BAAa,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,wBAAQ,IACP,KAAK,EAAE,MAAM,CAAC,EAAE,EAAE,QAAQ,CAAC,aAAa,CAAC,CAAC,CAAC;gBACzC,6BAAK,KAAK,EAAE,uBAAW,CAAC,SAAS,CAAC,gCAAgC,CAAC,EAAE,SAAS,EAAC,sCAAsC;oBACnH,oBAAC,oBAAI,IAAC,IAAI,EAAC,OAAO;wBAAC,oBAAC,mDAAuB,OAAG,CAAO,CACjD;gBACN,CAAC,CAAC,SAAS,IACZ,MAAM,CAAC,KAAK,CACJ,CAAC,GAChB,CACH,CAAC;AACJ,CAAC;AA/CD,0CA+CC","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"]}
1
+ {"version":3,"file":"SelectMapFormat.js","sourceRoot":"","sources":["../../../../src/ui/widget/SelectMapFormat.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;gGAGgG;AAChG,8BAA8B;AAE9B,+BAA6B;AAC7B,6CAA+B;AAC/B,wDAAiD;AAEjD,wDAA+D;AAG/D,QAAQ;AACR,wEAAwE;AACxE,4EAA4E;AAC5E,wDAAwD;AAC3C,QAAA,SAAS,GAAG;IACvB,GAAG,EAAE,KAAK;IACV,MAAM,EAAE,QAAQ;IAChB,IAAI,EAAE,MAAM;IACZ,OAAO,EAAE,SAAS;IAClB,aAAa,EAAE,eAAe;CAC/B,CAAC;AAkBF,gEAAgE;AAChE,SAAgB,eAAe,CAAC,KAA2B;IACzD,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,KAAK,IAAI,iBAAS,CAAC,MAAM,CAAC,CAAC;IAElF,MAAM,CAAC,UAAU,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,GAA2B,EAAE;QAC/D,MAAM,OAAO,GAA2B;YACtC,EAAE,KAAK,EAAE,iBAAS,CAAC,MAAM,EAAE,KAAK,EAAE,iBAAS,CAAC,MAAM,EAAE;YACpD,EAAE,KAAK,EAAE,iBAAS,CAAC,GAAG,EAAE,KAAK,EAAE,iBAAS,CAAC,GAAG,EAAE;YAC9C,EAAE,KAAK,EAAE,iBAAS,CAAC,IAAI,EAAE,KAAK,EAAE,iBAAS,CAAC,IAAI,EAAE;SACjD,CAAC;QACF,IAAI,KAAK,CAAC,eAAe,EAAE,cAAc,EAAE;YACzC,OAAO,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,iBAAS,CAAC,OAAO,EAAE,KAAK,EAAE,iBAAS,CAAC,OAAO,EAAE,CAAC,CAAC;SACtE;QAED,IAAI,yBAAS,CAAC,sBAAsB,CAAC,YAAY,CAAC,iBAAS,CAAC,aAAa,CAAC,EAAE;YAC1E,OAAO,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,iBAAS,CAAC,aAAa,EAAE,KAAK,EAAE,iBAAS,CAAC,aAAa,EAAE,CAAC,CAAC;SAClF;QAED,OAAO,OAAO,CAAC;IACjB,CAAC,CAAC,CAAC;IAEH,MAAM,cAAc,GAAG,KAAK,CAAC,WAAW,CACtC,CAAC,KAAa,EAAE,EAAE;QAChB,YAAY,CAAC,KAAK,CAAC,CAAC;QACpB,IAAI,KAAK,CAAC,QAAQ,EAAE;YAClB,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;SACvB;IACH,CAAC,EACD,CAAC,KAAK,CAAC,CACR,CAAC;IAEF,OAAO,CACL,uBAAC,6BAAa,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,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,uBAAC,wBAAQ,cAAE,MAAM,CAAC,KAAK,GAAY,GAC7D,CACH,CAAC;AACJ,CAAC;AAzCD,0CAyCC","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 type { SelectOption } from \"@itwin/itwinui-react\";\nimport { LabeledSelect, MenuItem } from \"@itwin/itwinui-react\";\nimport type { 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 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\n if (IModelApp.mapLayerFormatRegistry.isRegistered(MAP_TYPES.arcGisFeature)) {\n formats.push({ value: MAP_TYPES.arcGisFeature, label: MAP_TYPES.arcGisFeature });\n }\n\n return formats;\n });\n\n const handleOnChange = React.useCallback(\n (value: string) => {\n setMapFormat(value);\n if (props.onChange) {\n props.onChange(value);\n }\n },\n [props],\n );\n\n return (\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={(option) => <MenuItem>{option.label}</MenuItem>}\n />\n );\n}\n"]}
@@ -1,5 +1,5 @@
1
- import { MapSubLayerProps } from "@itwin/core-common";
2
- import { ITreeDataProvider, TreeNodeItem } from "@itwin/components-react";
1
+ import type { MapSubLayerProps } from "@itwin/core-common";
2
+ import type { ITreeDataProvider, TreeNodeItem } from "@itwin/components-react";
3
3
  export declare type SubLayersTreeExpandMode = "full" | "rootGroupOnly";
4
4
  /**
5
5
  * Data provider that returns some fake nodes to show in tree.
@@ -1 +1 @@
1
- {"version":3,"file":"SubLayersDataProvider.d.ts","sourceRoot":"","sources":["../../../../src/ui/widget/SubLayersDataProvider.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,gBAAgB,EAAc,MAAM,oBAAoB,CAAC;AAElE,OAAO,EAA2B,iBAAiB,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAGnG,oBAAY,uBAAuB,GAAG,MAAM,GAAG,eAAe,CAAC;AAE/D;;GAEG;AACH,qBAAa,qBAAsB,YAAW,iBAAiB;IAC7D,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAqC;IAC9D,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAC;gBAEjB,SAAS,EAAE,gBAAgB,EAAE,EAAE,UAAU,GAAE,uBAAyC;WAKlF,cAAc,CAAC,QAAQ,EAAE,gBAAgB,GAAG,SAAS,GAAG,OAAO;IAO7E,OAAO,CAAC,QAAQ;IAIhB,OAAO,CAAC,UAAU;IAclB,OAAO,CAAC,cAAc;IAqBtB,OAAO,CAAC,SAAS;IAOJ,aAAa,CAAC,MAAM,CAAC,EAAE,YAAY;IAQnC,QAAQ,CAAC,MAAM,CAAC,EAAE,YAAY;CAO5C"}
1
+ {"version":3,"file":"SubLayersDataProvider.d.ts","sourceRoot":"","sources":["../../../../src/ui/widget/SubLayersDataProvider.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,gBAAgB,EAAc,MAAM,oBAAoB,CAAC;AAEvE,OAAO,KAAK,EAA2B,iBAAiB,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAGxG,oBAAY,uBAAuB,GAAG,MAAM,GAAG,eAAe,CAAC;AAE/D;;GAEG;AACH,qBAAa,qBAAsB,YAAW,iBAAiB;IAC7D,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAqC;IAC9D,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAC;gBAEjB,SAAS,EAAE,gBAAgB,EAAE,EAAE,UAAU,GAAE,uBAAyC;WAKlF,cAAc,CAAC,QAAQ,EAAE,gBAAgB,GAAG,SAAS,GAAG,OAAO;IAQ7E,OAAO,CAAC,QAAQ;IAIhB,OAAO,CAAC,UAAU;IAclB,OAAO,CAAC,cAAc;IAwBtB,OAAO,CAAC,SAAS;IAOJ,aAAa,CAAC,MAAM,CAAC,EAAE,YAAY;IASnC,QAAQ,CAAC,MAAM,CAAC,EAAE,YAAY;CAQ5C"}
@@ -2,9 +2,9 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SubLayersDataProvider = void 0;
4
4
  /*---------------------------------------------------------------------------------------------
5
- * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
6
- * See LICENSE.md in the project root for license terms and full copyright notice.
7
- *--------------------------------------------------------------------------------------------*/
5
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
6
+ * See LICENSE.md in the project root for license terms and full copyright notice.
7
+ *--------------------------------------------------------------------------------------------*/
8
8
  const core_bentley_1 = require("@itwin/core-bentley");
9
9
  const appui_abstract_1 = require("@itwin/appui-abstract");
10
10
  const core_react_1 = require("@itwin/core-react");
@@ -18,9 +18,10 @@ class SubLayersDataProvider {
18
18
  this.loadNodes(subLayers);
19
19
  }
20
20
  static isUnnamedGroup(subLayer) {
21
- if (!subLayer)
21
+ if (!subLayer) {
22
22
  return false;
23
- return (!subLayer.name || subLayer.name.length === 0) && (subLayer.children !== undefined && subLayer.children.length > 0);
23
+ }
24
+ return (!subLayer.name || subLayer.name.length === 0) && subLayer.children !== undefined && subLayer.children.length > 0;
24
25
  }
25
26
  createId(props) {
26
27
  return undefined !== props.id ? `${props.id}` : props.name ? props.name : "no-id";
@@ -44,9 +45,10 @@ class SubLayersDataProvider {
44
45
  filteredProps?.sort((a, b) => (0, core_bentley_1.compareStringsOrUndefined)(a.title, b.title));
45
46
  const treeNodes = [];
46
47
  filteredProps.forEach((props) => {
47
- treeNodes.push(this.createNode(props, (this._expandMode === "full" ? true : (!parentId && props?.children !== undefined) ? true : undefined), undefined, SubLayersDataProvider.isUnnamedGroup(props) ? "icon-folder" : "icon-layers"));
48
- if (props.children)
48
+ treeNodes.push(this.createNode(props, this._expandMode === "full" ? true : !parentId && props?.children !== undefined ? true : undefined, undefined, SubLayersDataProvider.isUnnamedGroup(props) ? "icon-folder" : "icon-layers"));
49
+ if (props.children) {
49
50
  this.loadChildNodes(allSubLayers, props.id);
51
+ }
50
52
  });
51
53
  this._nodeMap.set(undefined !== parentId ? `${parentId}` : "", treeNodes);
52
54
  }
@@ -59,14 +61,16 @@ class SubLayersDataProvider {
59
61
  }
60
62
  async getNodesCount(parent) {
61
63
  const nodeArray = parent ? this._nodeMap.get(parent.id) : this._nodeMap.get("");
62
- if (nodeArray)
64
+ if (nodeArray) {
63
65
  return nodeArray.length;
66
+ }
64
67
  return 0;
65
68
  }
66
69
  async getNodes(parent) {
67
70
  const nodeArray = parent ? this._nodeMap.get(parent.id) : this._nodeMap.get("");
68
- if (nodeArray)
71
+ if (nodeArray) {
69
72
  return nodeArray;
73
+ }
70
74
  return [];
71
75
  }
72
76
  }
@@ -1 +1 @@
1
- {"version":3,"file":"SubLayersDataProvider.js","sourceRoot":"","sources":["../../../../src/ui/widget/SubLayersDataProvider.ts"],"names":[],"mappings":";;;AAAA;;;+FAG+F;AAC/F,sDAAgE;AAEhE,0DAAuD;AAEvD,kDAAkD;AAIlD;;GAEG;AACH,MAAa,qBAAqB;IAIhC,YAAY,SAA6B,EAAE,aAAsC,eAAe;QAH/E,aAAQ,GAAG,IAAI,GAAG,EAA0B,CAAC;QAI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CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;QAC/G,IAAI,aAAa,EAAE;YACjB,IAAI,CAAC,cAAc,CAAC,aAAa,EAAE,SAAS,CAAC,CAAC;SAC/C;IACH,CAAC;IAEM,KAAK,CAAC,aAAa,CAAC,MAAqB;QAC9C,MAAM,SAAS,GAA+B,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QAC5G,IAAI,SAAS;YACX,OAAO,SAAS,CAAC,MAAM,CAAC;QAE1B,OAAO,CAAC,CAAC;IACX,CAAC;IAEM,KAAK,CAAC,QAAQ,CAAC,MAAqB;QACzC,MAAM,SAAS,GAA+B,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QAC5G,IAAI,SAAS;YACX,OAAO,SAAS,CAAC;QAEnB,OAAO,EAAE,CAAC;IACZ,CAAC;CACF;AA7ED,sDA6EC","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 { compareStringsOrUndefined } from \"@itwin/core-bentley\";\nimport { MapSubLayerProps, SubLayerId } from \"@itwin/core-common\";\nimport { PropertyRecord } from \"@itwin/appui-abstract\";\nimport { DelayLoadedTreeNodeItem, ITreeDataProvider, TreeNodeItem } from \"@itwin/components-react\";\nimport { CheckBoxState } from \"@itwin/core-react\";\n\nexport type SubLayersTreeExpandMode = \"full\" | \"rootGroupOnly\";\n\n/**\n * Data provider that returns some fake nodes to show in tree.\n */\nexport class SubLayersDataProvider implements ITreeDataProvider {\n private readonly _nodeMap = new Map<string, TreeNodeItem[]>();\n private readonly _expandMode;\n\n constructor(subLayers: MapSubLayerProps[], expandMode: SubLayersTreeExpandMode = \"rootGroupOnly\") {\n this._expandMode = expandMode;\n this.loadNodes(subLayers);\n }\n\n public static isUnnamedGroup(subLayer: MapSubLayerProps | undefined): boolean {\n if (!subLayer)\n return false;\n\n return (!subLayer.name || subLayer.name.length === 0) && (subLayer.children !== undefined && subLayer.children.length > 0);\n }\n\n private createId(props: MapSubLayerProps): string {\n return undefined !== props.id ? `${props.id}` : props.name ? props.name : \"no-id\";\n }\n\n private createNode(props: MapSubLayerProps, expanded?: boolean, isCheckboxDisabled?: boolean, icon?: string): DelayLoadedTreeNodeItem {\n return {\n id: this.createId(props),\n label: PropertyRecord.fromString(props.title ?? props.name ?? \"unknown\"),\n hasChildren: !!props.children,\n isCheckboxVisible: true,\n checkBoxState: props.visible && !isCheckboxDisabled ? CheckBoxState.On : CheckBoxState.Off,\n extendedData: { subLayerId: props.id },\n isCheckboxDisabled,\n autoExpand: expanded,\n icon,\n };\n }\n\n private loadChildNodes(allSubLayers: MapSubLayerProps[], parentId?: SubLayerId) {\n const filteredProps = allSubLayers.filter((props) => parentId === props.parent);\n if (filteredProps.length) {\n filteredProps?.sort((a: MapSubLayerProps, b: MapSubLayerProps) => compareStringsOrUndefined(a.title, b.title));\n const treeNodes: TreeNodeItem[] = [];\n\n filteredProps.forEach((props) => {\n treeNodes.push(this.createNode(props,\n (this._expandMode === \"full\" ? true : (!parentId && props?.children !== undefined) ? true : undefined),\n undefined,\n SubLayersDataProvider.isUnnamedGroup(props) ? \"icon-folder\" : \"icon-layers\"\n\n ));\n if (props.children)\n this.loadChildNodes(allSubLayers, props.id);\n });\n\n this._nodeMap.set(undefined !== parentId ? `${parentId}` : \"\", treeNodes);\n }\n }\n\n private loadNodes(subLayerNodes: MapSubLayerProps[] | undefined) {\n subLayerNodes?.sort((a: MapSubLayerProps, b: MapSubLayerProps) => compareStringsOrUndefined(a.title, b.title));\n if (subLayerNodes) {\n this.loadChildNodes(subLayerNodes, undefined);\n }\n }\n\n public async getNodesCount(parent?: TreeNodeItem) {\n const nodeArray: TreeNodeItem[] | undefined = parent ? this._nodeMap.get(parent.id) : this._nodeMap.get(\"\");\n if (nodeArray)\n return nodeArray.length;\n\n return 0;\n }\n\n public async getNodes(parent?: TreeNodeItem) {\n const nodeArray: TreeNodeItem[] | undefined = parent ? this._nodeMap.get(parent.id) : this._nodeMap.get(\"\");\n if (nodeArray)\n return nodeArray;\n\n return [];\n }\n}\n"]}
1
+ {"version":3,"file":"SubLayersDataProvider.js","sourceRoot":"","sources":["../../../../src/ui/widget/SubLayersDataProvider.ts"],"names":[],"mappings":";;;AAAA;;;gGAGgG;AAChG,sDAAgE;AAEhE,0DAAuD;AAEvD,kDAAkD;AAIlD;;GAEG;AACH,MAAa,qBAAqB;IAIhC,YAAY,SAA6B,EAAE,aAAsC,eAAe;QAH/E,aAAQ,GAAG,IAAI,GAAG,EAA0B,CAAC;QAI5D,IAAI,CAAC,WAAW,GAAG,UAAU,CAAC;QAC9B,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC;IAC5B,CAAC;IAEM,MAAM,CAAC,cAAc,CAAC,QAAsC;QACjE,IAAI,CAAC,QAAQ,EAAE;YACb,OAAO,KAAK,CAAC;SACd;QAED,OAAO,CAAC,CAAC,QAAQ,CAAC,IAAI,IAAI,QAAQ,CAAC,IAAI,CAAC,MAAM,KAAK,CAAC,CAAC,IAAI,QAAQ,CAAC,QAAQ,KAAK,SAAS,IAAI,QAAQ,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC;IAC3H,CAAC;IAEO,QAAQ,CAAC,KAAuB;QACtC,OAAO,SAAS,KAAK,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,C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GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QAC5G,IAAI,SAAS,EAAE;YACb,OAAO,SAAS,CAAC;SAClB;QAED,OAAO,EAAE,CAAC;IACZ,CAAC;CACF;AAnFD,sDAmFC","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 { compareStringsOrUndefined } from \"@itwin/core-bentley\";\nimport type { MapSubLayerProps, SubLayerId } from \"@itwin/core-common\";\nimport { PropertyRecord } from \"@itwin/appui-abstract\";\nimport type { DelayLoadedTreeNodeItem, ITreeDataProvider, TreeNodeItem } from \"@itwin/components-react\";\nimport { CheckBoxState } from \"@itwin/core-react\";\n\nexport type SubLayersTreeExpandMode = \"full\" | \"rootGroupOnly\";\n\n/**\n * Data provider that returns some fake nodes to show in tree.\n */\nexport class SubLayersDataProvider implements ITreeDataProvider {\n private readonly _nodeMap = new Map<string, TreeNodeItem[]>();\n private readonly _expandMode;\n\n constructor(subLayers: MapSubLayerProps[], expandMode: SubLayersTreeExpandMode = \"rootGroupOnly\") {\n this._expandMode = expandMode;\n this.loadNodes(subLayers);\n }\n\n public static isUnnamedGroup(subLayer: MapSubLayerProps | undefined): boolean {\n if (!subLayer) {\n return false;\n }\n\n return (!subLayer.name || subLayer.name.length === 0) && subLayer.children !== undefined && subLayer.children.length > 0;\n }\n\n private createId(props: MapSubLayerProps): string {\n return undefined !== props.id ? `${props.id}` : props.name ? props.name : \"no-id\";\n }\n\n private createNode(props: MapSubLayerProps, expanded?: boolean, isCheckboxDisabled?: boolean, icon?: string): DelayLoadedTreeNodeItem {\n return {\n id: this.createId(props),\n label: PropertyRecord.fromString(props.title ?? props.name ?? \"unknown\"),\n hasChildren: !!props.children,\n isCheckboxVisible: true,\n checkBoxState: props.visible && !isCheckboxDisabled ? CheckBoxState.On : CheckBoxState.Off,\n extendedData: { subLayerId: props.id },\n isCheckboxDisabled,\n autoExpand: expanded,\n icon,\n };\n }\n\n private loadChildNodes(allSubLayers: MapSubLayerProps[], parentId?: SubLayerId) {\n const filteredProps = allSubLayers.filter((props) => parentId === props.parent);\n if (filteredProps.length) {\n filteredProps?.sort((a: MapSubLayerProps, b: MapSubLayerProps) => compareStringsOrUndefined(a.title, b.title));\n const treeNodes: TreeNodeItem[] = [];\n\n filteredProps.forEach((props) => {\n treeNodes.push(\n this.createNode(\n props,\n this._expandMode === \"full\" ? true : !parentId && props?.children !== undefined ? true : undefined,\n undefined,\n SubLayersDataProvider.isUnnamedGroup(props) ? \"icon-folder\" : \"icon-layers\",\n ),\n );\n if (props.children) {\n this.loadChildNodes(allSubLayers, props.id);\n }\n });\n\n this._nodeMap.set(undefined !== parentId ? `${parentId}` : \"\", treeNodes);\n }\n }\n\n private loadNodes(subLayerNodes: MapSubLayerProps[] | undefined) {\n subLayerNodes?.sort((a: MapSubLayerProps, b: MapSubLayerProps) => compareStringsOrUndefined(a.title, b.title));\n if (subLayerNodes) {\n this.loadChildNodes(subLayerNodes, undefined);\n }\n }\n\n public async getNodesCount(parent?: TreeNodeItem) {\n const nodeArray: TreeNodeItem[] | undefined = parent ? this._nodeMap.get(parent.id) : this._nodeMap.get(\"\");\n if (nodeArray) {\n return nodeArray.length;\n }\n\n return 0;\n }\n\n public async getNodes(parent?: TreeNodeItem) {\n const nodeArray: TreeNodeItem[] | undefined = parent ? this._nodeMap.get(parent.id) : this._nodeMap.get(\"\");\n if (nodeArray) {\n return nodeArray;\n }\n\n return [];\n }\n}\n"]}
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
- import { SubLayersPanelProps } from "./SubLayersTree";
2
+ import type { SubLayersPanelProps } from "./SubLayersTree";
3
3
  /** @internal */
4
4
  export declare type SubLayersPopupButtonProps = SubLayersPanelProps;
5
5
  /** @internal */
@@ -1 +1 @@
1
- {"version":3,"file":"SubLayersPopupButton.d.ts","sourceRoot":"","sources":["../../../../src/ui/widget/SubLayersPopupButton.tsx"],"names":[],"mappings":";AAQA,OAAO,EAAkB,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAMtE,gBAAgB;AAEhB,oBAAY,yBAAyB,GAAG,mBAAmB,CAAC;AAE5D,gBAAgB;AAEhB,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,yBAAyB,eA0CpE"}
1
+ {"version":3,"file":"SubLayersPopupButton.d.ts","sourceRoot":"","sources":["../../../../src/ui/widget/SubLayersPopupButton.tsx"],"names":[],"mappings":";AASA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAO3D,gBAAgB;AAEhB,oBAAY,yBAAyB,GAAG,mBAAmB,CAAC;AAE5D,gBAAgB;AAEhB,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,yBAAyB,eA0CpE"}
@@ -1,11 +1,35 @@
1
1
  "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
2
25
  Object.defineProperty(exports, "__esModule", { value: true });
3
26
  exports.SubLayersPopupButton = void 0;
27
+ const jsx_runtime_1 = require("react/jsx-runtime");
4
28
  /*---------------------------------------------------------------------------------------------
5
- * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
6
- * See LICENSE.md in the project root for license terms and full copyright notice.
7
- *--------------------------------------------------------------------------------------------*/
8
- const React = require("react");
29
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
30
+ * See LICENSE.md in the project root for license terms and full copyright notice.
31
+ *--------------------------------------------------------------------------------------------*/
32
+ const React = __importStar(require("react"));
9
33
  const appui_abstract_1 = require("@itwin/appui-abstract");
10
34
  const core_react_1 = require("@itwin/core-react");
11
35
  const SubLayersTree_1 = require("./SubLayersTree");
@@ -26,16 +50,10 @@ function SubLayersPopupButton(props) {
26
50
  }, []);
27
51
  const isOutsideEvent = React.useCallback((e) => {
28
52
  // if clicking on button that open panel - don't trigger outside click processing
29
- return !!buttonRef.current && (e.target instanceof Node) && !buttonRef.current.contains(e.target);
53
+ return !!buttonRef.current && e.target instanceof Node && !buttonRef.current.contains(e.target);
30
54
  }, []);
31
55
  const panelRef = (0, core_react_1.useOnOutsideClick)(onOutsideClick, isOutsideEvent);
32
- return (React.createElement(React.Fragment, null,
33
- React.createElement(itwinui_react_1.Button, { size: "small", styleType: "borderless", ref: buttonRef, className: "map-manager-item-sub-layer-button", title: popupOpen ? hideSubLayersLabel : showSubLayersLabel, onClick: togglePopup },
34
- React.createElement(core_react_1.WebFontIcon, { iconName: "icon-layers" })),
35
- React.createElement(core_react_1.Popup, { isOpen: popupOpen, position: appui_abstract_1.RelativePosition.BottomRight, onClose: onOutsideClick, target: buttonRef.current },
36
- React.createElement("div", { className: "map-transparency-popup-panel" },
37
- React.createElement("div", { ref: panelRef, className: "map-manager-sublayer-panel" },
38
- React.createElement(SubLayersTree_1.SubLayersPanel, { ...props, width: 390, height: 350 }))))));
56
+ return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(itwinui_react_1.Button, { size: "small", styleType: "borderless", ref: buttonRef, className: "map-manager-item-sub-layer-button", title: popupOpen ? hideSubLayersLabel : showSubLayersLabel, onClick: togglePopup, children: (0, jsx_runtime_1.jsx)(core_react_1.WebFontIcon, { iconName: "icon-layers" }) }), (0, jsx_runtime_1.jsx)(core_react_1.Popup, { isOpen: popupOpen, position: appui_abstract_1.RelativePosition.BottomRight, onClose: onOutsideClick, target: buttonRef.current, children: (0, jsx_runtime_1.jsx)("div", { className: "map-transparency-popup-panel", children: (0, jsx_runtime_1.jsx)("div", { ref: panelRef, className: "map-manager-sublayer-panel", children: (0, jsx_runtime_1.jsx)(SubLayersTree_1.SubLayersPanel, { ...props, width: 390, height: 350 }) }) }) })] }));
39
57
  }
40
58
  exports.SubLayersPopupButton = SubLayersPopupButton;
41
59
  //# sourceMappingURL=SubLayersPopupButton.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"SubLayersPopupButton.js","sourceRoot":"","sources":["../../../../src/ui/widget/SubLayersPopupButton.tsx"],"names":[],"mappings":";;;AAAA;;;+FAG+F;AAC/F,+BAA+B;AAE/B,0DAAyD;AACzD,kDAA6F;AAC7F,mDAAsE;AACtE,+CAA8C;AAC9C,wDAA8C;AAQ9C,gBAAgB;AAChB,gEAAgE;AAChE,SAAgB,oBAAoB,CAAC,KAAgC;IAEnE,MAAM,CAAC,kBAAkB,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,uBAAW,CAAC,YAAY,CAAC,kBAAkB,CAAC,0BAA0B,CAAC,CAAC,CAAC;IACrH,MAAM,CAAC,kBAAkB,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,uBAAW,CAAC,YAAY,CAAC,kBAAkB,CAAC,0BAA0B,CAAC,CAAC,CAAC;IACrH,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;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,EAAE,SAAS,EAAC,4BAA4B;oBACxD,oBAAC,8BAAc,OAAK,KAAK,EAAE,KAAK,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,GAAG,CACjD,CACF,CACC,CACR,CACJ,CAAC;AACJ,CAAC;AA1CD,oDA0CC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\nimport * as React from \"react\";\n\nimport { RelativePosition } from \"@itwin/appui-abstract\";\nimport { OutsideClickEvent, Popup, useOnOutsideClick, WebFontIcon } from \"@itwin/core-react\";\nimport { SubLayersPanel, SubLayersPanelProps } from \"./SubLayersTree\";\nimport { MapLayersUI } from \"../../mapLayers\";\nimport { Button } from \"@itwin/itwinui-react\";\n\n// cSpell:ignore droppable Sublayer\n\n/** @internal */\n\nexport type SubLayersPopupButtonProps = SubLayersPanelProps;\n\n/** @internal */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function SubLayersPopupButton(props: SubLayersPopupButtonProps) {\n\n const [showSubLayersLabel] = React.useState(MapLayersUI.localization.getLocalizedString(\"mapLayers:SubLayers.Show\"));\n const [hideSubLayersLabel] = React.useState(MapLayersUI.localization.getLocalizedString(\"mapLayers:SubLayers.Hide\"));\n const [popupOpen, setPopupOpen] = React.useState(false);\n const buttonRef = React.useRef<HTMLButtonElement>(null);\n\n const togglePopup = React.useCallback(() => {\n setPopupOpen(!popupOpen);\n }, [popupOpen]);\n\n const onOutsideClick = React.useCallback(() => {\n setPopupOpen(false);\n }, []);\n\n const isOutsideEvent = React.useCallback((e: OutsideClickEvent) => {\n // if clicking on button that open panel - don't trigger outside click processing\n return !!buttonRef.current && (e.target instanceof Node) && !buttonRef.current.contains(e.target);\n }, []);\n\n const panelRef = useOnOutsideClick<HTMLDivElement>(onOutsideClick, isOutsideEvent);\n\n return (\n <>\n <Button size=\"small\" styleType=\"borderless\" ref={buttonRef} className=\"map-manager-item-sub-layer-button\" title={popupOpen ? hideSubLayersLabel : showSubLayersLabel}\n onClick={togglePopup}>\n <WebFontIcon iconName=\"icon-layers\" />\n </Button>\n <Popup\n isOpen={popupOpen}\n position={RelativePosition.BottomRight}\n onClose={onOutsideClick}\n target={buttonRef.current}\n >\n <div className=\"map-transparency-popup-panel\">\n <div ref={panelRef} className=\"map-manager-sublayer-panel\">\n <SubLayersPanel {...props} width={390} height={350}/>\n </div>\n </div>\n </Popup >\n </>\n );\n}\n"]}
1
+ {"version":3,"file":"SubLayersPopupButton.js","sourceRoot":"","sources":["../../../../src/ui/widget/SubLayersPopupButton.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;gGAGgG;AAChG,6CAA+B;AAE/B,0DAAyD;AAEzD,kDAA0E;AAE1E,mDAAiD;AACjD,+CAA8C;AAC9C,wDAA8C;AAQ9C,gBAAgB;AAChB,gEAAgE;AAChE,SAAgB,oBAAoB,CAAC,KAAgC;IACnE,MAAM,CAAC,kBAAkB,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,uBAAW,CAAC,YAAY,CAAC,kBAAkB,CAAC,0BAA0B,CAAC,CAAC,CAAC;IACrH,MAAM,CAAC,kBAAkB,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,uBAAW,CAAC,YAAY,CAAC,kBAAkB,CAAC,0BAA0B,CAAC,CAAC,CAAC;IACrH,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;IACxD,MAAM,SAAS,GAAG,KAAK,CAAC,MAAM,CAAoB,IAAI,CAAC,CAAC;IAExD,MAAM,WAAW,GAAG,KAAK,CAAC,WAAW,CAAC,GAAG,EAAE;QACzC,YAAY,CAAC,CAAC,SAAS,CAAC,CAAC;IAC3B,CAAC,EAAE,CAAC,SAAS,CAAC,CAAC,CAAC;IAEhB,MAAM,cAAc,GAAG,KAAK,CAAC,WAAW,CAAC,GAAG,EAAE;QAC5C,YAAY,CAAC,KAAK,CAAC,CAAC;IACtB,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,MAAM,cAAc,GAAG,KAAK,CAAC,WAAW,CAAC,CAAC,CAAoB,EAAE,EAAE;QAChE,iFAAiF;QACjF,OAAO,CAAC,CAAC,SAAS,CAAC,OAAO,IAAI,CAAC,CAAC,MAAM,YAAY,IAAI,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;IAClG,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,MAAM,QAAQ,GAAG,IAAA,8BAAiB,EAAiB,cAAc,EAAE,cAAc,CAAC,CAAC;IAEnF,OAAO,CACL,6DACE,uBAAC,sBAAM,IACL,IAAI,EAAC,OAAO,EACZ,SAAS,EAAC,YAAY,EACtB,GAAG,EAAE,SAAS,EACd,SAAS,EAAC,mCAAmC,EAC7C,KAAK,EAAE,SAAS,CAAC,CAAC,CAAC,kBAAkB,CAAC,CAAC,CAAC,kBAAkB,EAC1D,OAAO,EAAE,WAAW,YAEpB,uBAAC,wBAAW,IAAC,QAAQ,EAAC,aAAa,GAAG,GAC/B,EACT,uBAAC,kBAAK,IAAC,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,iCAAgB,CAAC,WAAW,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,EAAE,SAAS,CAAC,OAAO,YAClH,gCAAK,SAAS,EAAC,8BAA8B,YAC3C,gCAAK,GAAG,EAAE,QAAQ,EAAE,SAAS,EAAC,4BAA4B,YACxD,uBAAC,8BAAc,OAAK,KAAK,EAAE,KAAK,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,GAAI,GAClD,GACF,GACA,IACP,CACJ,CAAC;AACJ,CAAC;AA1CD,oDA0CC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\nimport * as React from \"react\";\n\nimport { RelativePosition } from \"@itwin/appui-abstract\";\nimport type { OutsideClickEvent } from \"@itwin/core-react\";\nimport { Popup, useOnOutsideClick, WebFontIcon } from \"@itwin/core-react\";\nimport type { SubLayersPanelProps } from \"./SubLayersTree\";\nimport { SubLayersPanel } from \"./SubLayersTree\";\nimport { MapLayersUI } from \"../../mapLayers\";\nimport { Button } from \"@itwin/itwinui-react\";\n\n// cSpell:ignore droppable Sublayer\n\n/** @internal */\n\nexport type SubLayersPopupButtonProps = SubLayersPanelProps;\n\n/** @internal */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function SubLayersPopupButton(props: SubLayersPopupButtonProps) {\n const [showSubLayersLabel] = React.useState(MapLayersUI.localization.getLocalizedString(\"mapLayers:SubLayers.Show\"));\n const [hideSubLayersLabel] = React.useState(MapLayersUI.localization.getLocalizedString(\"mapLayers:SubLayers.Hide\"));\n const [popupOpen, setPopupOpen] = React.useState(false);\n const buttonRef = React.useRef<HTMLButtonElement>(null);\n\n const togglePopup = React.useCallback(() => {\n setPopupOpen(!popupOpen);\n }, [popupOpen]);\n\n const onOutsideClick = React.useCallback(() => {\n setPopupOpen(false);\n }, []);\n\n const isOutsideEvent = React.useCallback((e: OutsideClickEvent) => {\n // if clicking on button that open panel - don't trigger outside click processing\n return !!buttonRef.current && e.target instanceof Node && !buttonRef.current.contains(e.target);\n }, []);\n\n const panelRef = useOnOutsideClick<HTMLDivElement>(onOutsideClick, isOutsideEvent);\n\n return (\n <>\n <Button\n size=\"small\"\n styleType=\"borderless\"\n ref={buttonRef}\n className=\"map-manager-item-sub-layer-button\"\n title={popupOpen ? hideSubLayersLabel : showSubLayersLabel}\n onClick={togglePopup}\n >\n <WebFontIcon iconName=\"icon-layers\" />\n </Button>\n <Popup isOpen={popupOpen} position={RelativePosition.BottomRight} onClose={onOutsideClick} target={buttonRef.current}>\n <div className=\"map-transparency-popup-panel\">\n <div ref={panelRef} className=\"map-manager-sublayer-panel\">\n <SubLayersPanel {...props} width={390} height={350} />\n </div>\n </div>\n </Popup>\n </>\n );\n}\n"]}
@@ -1,6 +1,6 @@
1
1
  /// <reference types="react" />
2
- import { MapSubLayerProps, SubLayerId } from "@itwin/core-common";
3
- import { SubLayersTreeExpandMode } from "./SubLayersDataProvider";
2
+ import type { MapSubLayerProps, SubLayerId } from "@itwin/core-common";
3
+ import type { SubLayersTreeExpandMode } from "./SubLayersDataProvider";
4
4
  import "./SubLayersTree.scss";
5
5
  export declare type OnSubLayerStateChangeType = (subLayerId: SubLayerId, isSelected: boolean) => void;
6
6
  export interface SubLayersPanelProps extends Omit<SubLayersTreeProps, "subLayers"> {
@@ -1 +1 @@
1
- {"version":3,"file":"SubLayersTree.d.ts","sourceRoot":"","sources":["../../../../src/ui/widget/SubLayersTree.tsx"],"names":[],"mappings":";AAWA,OAAO,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAIlE,OAAO,EAAyB,uBAAuB,EAAE,MAAM,yBAAyB,CAAC;AACzF,OAAO,sBAAsB,CAAC;AAuB9B,oBAAY,yBAAyB,GAAG,CAAC,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,OAAO,KAAK,IAAI,CAAC;AAC9F,MAAM,WAAW,mBAAoB,SAAQ,IAAI,CAAC,kBAAkB,EAAE,WAAW,CAAC;IAChF,SAAS,CAAC,EAAE,gBAAgB,EAAE,CAAC;CAChC;AAGD,wBAAgB,cAAc,CAAC,KAAK,EAAE,mBAAmB,eAWxD;AAED,MAAM,WAAW,kBAAkB;IACjC,aAAa,EAAE,UAAU,GAAG,KAAK,CAAC;IAClC,UAAU,EAAE,uBAAuB,CAAC;IACpC,SAAS,EAAE,gBAAgB,EAAE,CAAC;IAC9B,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC,qBAAqB,CAAC,EAAE,yBAAyB,CAAC;IAClD,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;;GAGG;AAEH,wBAAgB,aAAa,CAAC,KAAK,EAAE,kBAAkB,eAmGtD"}
1
+ {"version":3,"file":"SubLayersTree.d.ts","sourceRoot":"","sources":["../../../../src/ui/widget/SubLayersTree.tsx"],"names":[],"mappings":";AA+BA,OAAO,KAAK,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAKvE,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,yBAAyB,CAAC;AAEvE,OAAO,sBAAsB,CAAC;AAmB9B,oBAAY,yBAAyB,GAAG,CAAC,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,OAAO,KAAK,IAAI,CAAC;AAC9F,MAAM,WAAW,mBAAoB,SAAQ,IAAI,CAAC,kBAAkB,EAAE,WAAW,CAAC;IAChF,SAAS,CAAC,EAAE,gBAAgB,EAAE,CAAC;CAChC;AAGD,wBAAgB,cAAc,CAAC,KAAK,EAAE,mBAAmB,eAWxD;AAED,MAAM,WAAW,kBAAkB;IACjC,aAAa,EAAE,UAAU,GAAG,KAAK,CAAC;IAClC,UAAU,EAAE,uBAAuB,CAAC;IACpC,SAAS,EAAE,gBAAgB,EAAE,CAAC;IAC9B,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC,qBAAqB,CAAC,EAAE,yBAAyB,CAAC;IAClD,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;;GAGG;AAEH,wBAAgB,aAAa,CAAC,KAAK,EAAE,kBAAkB,eAwHtD"}
@@ -1,34 +1,55 @@
1
1
  "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
2
25
  Object.defineProperty(exports, "__esModule", { value: true });
3
26
  exports.SubLayersTree = exports.SubLayersPanel = void 0;
27
+ const jsx_runtime_1 = require("react/jsx-runtime");
4
28
  /*---------------------------------------------------------------------------------------------
5
- * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
6
- * See LICENSE.md in the project root for license terms and full copyright notice.
7
- *--------------------------------------------------------------------------------------------*/
29
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
30
+ * See LICENSE.md in the project root for license terms and full copyright notice.
31
+ *--------------------------------------------------------------------------------------------*/
8
32
  const appui_abstract_1 = require("@itwin/appui-abstract");
9
33
  const components_react_1 = require("@itwin/components-react");
10
34
  const core_react_1 = require("@itwin/core-react");
11
35
  const itwinui_react_1 = require("@itwin/itwinui-react");
12
- const React = require("react");
36
+ const React = __importStar(require("react"));
13
37
  const SubLayersDataProvider_1 = require("./SubLayersDataProvider");
14
38
  require("./SubLayersTree.scss");
15
39
  const mapLayers_1 = require("../../mapLayers");
16
40
  const itwinui_icons_react_1 = require("@itwin/itwinui-icons-react");
17
41
  // eslint-disable-next-line @typescript-eslint/naming-convention
18
42
  function Toolbar(props) {
19
- return (React.createElement("div", { className: "map-manager-sublayer-tree-toolbar" },
20
- React.createElement("div", { className: "tree-toolbar-action-buttons" }, props.children),
21
- props.searchField && React.createElement("div", { className: "tree-toolbar-searchbox" }, props.searchField)));
43
+ return ((0, jsx_runtime_1.jsxs)("div", { className: "map-manager-sublayer-tree-toolbar", children: [(0, jsx_runtime_1.jsx)("div", { className: "tree-toolbar-action-buttons", children: props.children }), props.searchField && (0, jsx_runtime_1.jsx)("div", { className: "tree-toolbar-searchbox", children: props.searchField })] }));
22
44
  }
23
45
  // eslint-disable-next-line @typescript-eslint/naming-convention
24
46
  function SubLayersPanel(props) {
25
47
  const [noneAvailableLabel] = React.useState(mapLayers_1.MapLayersUI.localization.getLocalizedString("mapLayers:SubLayers.NoSubLayers"));
26
48
  if (undefined === props.subLayers || 0 === props.subLayers.length) {
27
- return React.createElement("div", { className: "map-manager-sublayer-panel" },
28
- React.createElement("div", null, noneAvailableLabel));
49
+ return ((0, jsx_runtime_1.jsx)("div", { className: "map-manager-sublayer-panel", children: (0, jsx_runtime_1.jsx)("div", { children: noneAvailableLabel }) }));
29
50
  }
30
51
  else {
31
- return (React.createElement(SubLayersTree, { subLayers: props.subLayers, ...props }));
52
+ return (0, jsx_runtime_1.jsx)(SubLayersTree, { subLayers: props.subLayers, ...props });
32
53
  }
33
54
  }
34
55
  exports.SubLayersPanel = SubLayersPanel;
@@ -51,7 +72,7 @@ function SubLayersTree(props) {
51
72
  const dataProvider = React.useMemo(() => new SubLayersDataProvider_1.SubLayersDataProvider(subLayers, props.expandMode),
52
73
  // eslint-disable-next-line react-hooks/exhaustive-deps
53
74
  [subLayers, props.expandMode, layerFilterString]);
54
- const { modelSource, nodeLoader, nodeHighlightingProps, } = useTreeFiltering(dataProvider, layerFilterString);
75
+ const { modelSource, nodeLoader, nodeHighlightingProps } = useTreeFiltering(dataProvider, layerFilterString);
55
76
  // create custom event handler. It handles all tree event same as `TreeEventHandler` but additionally
56
77
  // it selects/deselects node when checkbox is checked/unchecked and vice versa.
57
78
  // `useDisposable` takes care of disposing old event handler when new is created in case 'nodeLoader' has changed
@@ -68,22 +89,22 @@ function SubLayersTree(props) {
68
89
  });
69
90
  setSubLayers(tmpSubLayers);
70
91
  }
71
- if (props.onSubLayerStateChange)
92
+ if (props.onSubLayerStateChange) {
72
93
  props.onSubLayerStateChange(-1, visible);
94
+ }
73
95
  }, [subLayers, props]);
74
96
  const handleFilterTextChanged = React.useCallback((event) => {
75
97
  setLayerFilterString(event.target.value);
76
98
  }, []);
77
- return React.createElement(React.Fragment, null,
78
- React.createElement("div", { className: "map-manager-sublayer-tree" },
79
- React.createElement(Toolbar, { searchField: React.createElement(itwinui_react_1.Input, { type: "text", className: "map-manager-sublayer-tree-searchbox", placeholder: placeholderLabel, value: layerFilterString, onChange: handleFilterTextChanged, size: "small" }) }, props.singleVisibleSubLayer ? undefined : [
80
- React.createElement(itwinui_react_1.IconButton, { key: "show-all-btn", size: "small", title: props.checkboxStyle === "eye" ? mapLayers_1.MapLayersUI.translate("SubLayers.AllOn") : mapLayers_1.MapLayersUI.translate("SelectFeaturesDialog.AllOn"), onClick: async () => changeAll(true) }, props.checkboxStyle === "eye" ? React.createElement(itwinui_icons_react_1.SvgVisibilityShow, null) : React.createElement(itwinui_icons_react_1.SvgCheckboxSelect, null)),
81
- React.createElement(itwinui_react_1.IconButton, { style: { marginLeft: "5px" }, key: "hide-all-btn", size: "small", title: props.checkboxStyle === "eye" ? mapLayers_1.MapLayersUI.translate("SubLayers.AllOff") : mapLayers_1.MapLayersUI.translate("SelectFeaturesDialog.AllOff"), onClick: async () => changeAll(false) }, props.checkboxStyle === "eye" ? React.createElement(itwinui_icons_react_1.SvgVisibilityHide, null) : React.createElement(itwinui_icons_react_1.SvgCheckboxDeselect, null)),
82
- ]),
83
- React.createElement("div", { className: "map-manager-sublayer-tree-content" },
84
- (props.width === undefined && props.height === undefined) && React.createElement(core_react_1.ResizableContainerObserver, { onResize: (w, h) => { setWidth(w); setHeight(h); } }),
85
- (width !== undefined && height !== undefined)
86
- && React.createElement(components_react_1.ControlledTree, { nodeLoader: nodeLoader, selectionMode: components_react_1.SelectionMode.None, eventsHandler: eventHandler, model: treeModel, treeRenderer: props.checkboxStyle === "eye" ? nodeWithEyeCheckboxTreeRenderer : undefined, nodeHighlightingProps: nodeHighlightingProps, width: width, height: height, noDataRenderer: () => (React.createElement("p", { className: "components-controlledTree-errorMessage" }, noResults)) }))));
99
+ return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsxs)("div", { className: "map-manager-sublayer-tree", children: [(0, jsx_runtime_1.jsx)(Toolbar, { searchField: (0, jsx_runtime_1.jsx)(itwinui_react_1.Input, { type: "text", className: "map-manager-sublayer-tree-searchbox", placeholder: placeholderLabel, value: layerFilterString, onChange: handleFilterTextChanged, size: "small" }), children: props.singleVisibleSubLayer
100
+ ? undefined
101
+ : [
102
+ (0, jsx_runtime_1.jsx)(itwinui_react_1.IconButton, { size: "small", title: props.checkboxStyle === "eye" ? mapLayers_1.MapLayersUI.translate("SubLayers.AllOn") : mapLayers_1.MapLayersUI.translate("SelectFeaturesDialog.AllOn"), onClick: async () => changeAll(true), children: props.checkboxStyle === "eye" ? (0, jsx_runtime_1.jsx)(itwinui_icons_react_1.SvgVisibilityShow, {}) : (0, jsx_runtime_1.jsx)(itwinui_icons_react_1.SvgCheckboxSelect, {}) }, "show-all-btn"),
103
+ (0, jsx_runtime_1.jsx)(itwinui_react_1.IconButton, { style: { marginLeft: "5px" }, size: "small", title: props.checkboxStyle === "eye" ? mapLayers_1.MapLayersUI.translate("SubLayers.AllOff") : mapLayers_1.MapLayersUI.translate("SelectFeaturesDialog.AllOff"), onClick: async () => changeAll(false), children: props.checkboxStyle === "eye" ? (0, jsx_runtime_1.jsx)(itwinui_icons_react_1.SvgVisibilityHide, {}) : (0, jsx_runtime_1.jsx)(itwinui_icons_react_1.SvgCheckboxDeselect, {}) }, "hide-all-btn"),
104
+ ] }), (0, jsx_runtime_1.jsxs)("div", { className: "map-manager-sublayer-tree-content", children: [props.width === undefined && props.height === undefined && ((0, jsx_runtime_1.jsx)(core_react_1.ResizableContainerObserver, { onResize: (w, h) => {
105
+ setWidth(w);
106
+ setHeight(h);
107
+ } })), width !== undefined && height !== undefined && ((0, jsx_runtime_1.jsx)(components_react_1.ControlledTree, { nodeLoader: nodeLoader, selectionMode: components_react_1.SelectionMode.None, eventsHandler: eventHandler, model: treeModel, treeRenderer: props.checkboxStyle === "eye" ? nodeWithEyeCheckboxTreeRenderer : undefined, nodeHighlightingProps: nodeHighlightingProps, width: width, height: height, noDataRenderer: () => (0, jsx_runtime_1.jsx)("p", { className: "components-controlledTree-errorMessage", children: noResults }) }))] })] }) }));
87
108
  }
88
109
  exports.SubLayersTree = SubLayersTree;
89
110
  /** TreeEventHandler derived class that handler processing changes to subLayer visibility */
@@ -104,8 +125,9 @@ class SubLayerCheckboxHandler extends components_react_1.TreeEventHandler {
104
125
  this.modelSource.modifyModel((model) => {
105
126
  const addedNodes = args[1].addedNodeIds.map((id) => model.getNode(id));
106
127
  addedNodes.forEach((node) => {
107
- if (!node)
128
+ if (!node) {
108
129
  return;
130
+ }
109
131
  this.syncNodeStateWithParent(model, node);
110
132
  });
111
133
  });
@@ -124,41 +146,49 @@ class SubLayerCheckboxHandler extends components_react_1.TreeEventHandler {
124
146
  // they get rendered anyway.
125
147
  cascadeStateToAllChildren(model, parentId) {
126
148
  const children = model.getChildren(parentId);
127
- if (children === undefined)
149
+ if (children === undefined) {
128
150
  return;
151
+ }
129
152
  for (const childID of children) {
130
153
  const childNode = childID ? model.getNode(childID) : undefined;
131
- if (childNode)
154
+ if (childNode) {
132
155
  this.syncNodeStateWithParent(model, childNode);
156
+ }
133
157
  // Drill down the tree.
134
158
  this.cascadeStateToAllChildren(model, childID);
135
159
  }
136
160
  }
137
161
  applyMutualExclusiveState(model, nodeId) {
138
162
  const changedNode = model.getNode(nodeId);
139
- if (changedNode?.checkbox.state === core_react_1.CheckBoxState.Off)
163
+ if (changedNode?.checkbox.state === core_react_1.CheckBoxState.Off) {
140
164
  return;
165
+ }
141
166
  for (const node of model.iterateTreeModelNodes()) {
142
- if (node.id === changedNode?.id)
167
+ if (node.id === changedNode?.id) {
143
168
  continue;
144
- if (node && node.checkbox.state === core_react_1.CheckBoxState.On)
169
+ }
170
+ if (node && node.checkbox.state === core_react_1.CheckBoxState.On) {
145
171
  node.checkbox.state = core_react_1.CheckBoxState.Off;
172
+ }
146
173
  }
147
174
  }
148
175
  static isUnnamedGroup(subLayer) {
149
- if (!subLayer)
176
+ if (!subLayer) {
150
177
  return false;
151
- return (!subLayer.name || subLayer.name.length === 0) && (subLayer.children !== undefined && subLayer.children.length > 0);
178
+ }
179
+ return (!subLayer.name || subLayer.name.length === 0) && subLayer.children !== undefined && subLayer.children.length > 0;
152
180
  }
153
181
  // Ensure the state of changed node matches the state of its parent.
154
182
  syncNodeStateWithParent(model, changedNode) {
155
183
  // Lookup node parent. If non exists, I assume thats the root node,
156
184
  // and it must have a proper initial state.
157
185
  const parentNode = changedNode.parentId ? model.getNode(changedNode.parentId) : undefined;
158
- if (!parentNode)
186
+ if (!parentNode) {
187
+ return;
188
+ }
189
+ if (!changedNode.checkbox) {
159
190
  return;
160
- if (!changedNode.checkbox)
161
- return; // don't see why this would happen, but if there is no checkbox, we cant do much here.
191
+ } // don't see why this would happen, but if there is no checkbox, we cant do much here.
162
192
  const parentLayerId = undefined !== parentNode.item.extendedData?.subLayerId ? parentNode.item.extendedData?.subLayerId : parentNode.item.id;
163
193
  const parentSubLayer = this._subLayers?.find((subLayer) => subLayer.id === parentLayerId);
164
194
  // If parent is disabled, then children must be too.
@@ -183,36 +213,41 @@ class SubLayerCheckboxHandler extends components_react_1.TreeEventHandler {
183
213
  const selectionHandling = stateChanges.subscribe({
184
214
  next: (changes) => {
185
215
  changes.forEach((change) => {
186
- const isSelected = (change.newState === core_react_1.CheckBoxState.On);
216
+ const isSelected = change.newState === core_react_1.CheckBoxState.On;
187
217
  const subLayerId = undefined !== change.nodeItem.extendedData?.subLayerId ? change.nodeItem.extendedData?.subLayerId : change.nodeItem.id;
188
218
  // Get the previously visible node if we are in 'singleVisibleSubLayer' node
189
219
  let prevVisibleSubLayers = [];
190
220
  if (this._singleVisibleSubLayer) {
191
221
  prevVisibleSubLayers = this._subLayers.reduce((filtered, subLayer) => {
192
- if (subLayer.visible && subLayer.id !== undefined)
222
+ if (subLayer.visible && subLayer.id !== undefined) {
193
223
  filtered.push(subLayer.id);
224
+ }
194
225
  return filtered;
195
226
  }, []);
196
227
  }
197
228
  // Inform caller that subLayer state is going to change (i.e. update display style state)
198
229
  if (this._onSubLayerStateChange) {
199
- for (const slId of prevVisibleSubLayers)
230
+ for (const slId of prevVisibleSubLayers) {
200
231
  this._onSubLayerStateChange(slId, false);
232
+ }
201
233
  this._onSubLayerStateChange(subLayerId, isSelected);
202
234
  }
203
235
  // Update sublayer object, otherwise state would get out of sync with DisplayStyle each time the TreeView is re-rendered
204
236
  this._subLayers?.forEach((curSubLayer) => {
205
237
  if (curSubLayer.id !== undefined) {
206
- if (curSubLayer.id === subLayerId)
238
+ if (curSubLayer.id === subLayerId) {
207
239
  curSubLayer.visible = isSelected;
208
- else if (prevVisibleSubLayers.includes(curSubLayer.id))
240
+ }
241
+ else if (prevVisibleSubLayers.includes(curSubLayer.id)) {
209
242
  curSubLayer.visible = false;
243
+ }
210
244
  }
211
245
  });
212
246
  // Cascade state
213
247
  this.modelSource.modifyModel((model) => {
214
- if (this._singleVisibleSubLayer)
248
+ if (this._singleVisibleSubLayer) {
215
249
  this.applyMutualExclusiveState(model, change.nodeItem.id);
250
+ }
216
251
  this.cascadeStateToAllChildren(model, change.nodeItem.id);
217
252
  });
218
253
  });
@@ -224,12 +259,12 @@ class SubLayerCheckboxHandler extends components_react_1.TreeEventHandler {
224
259
  }
225
260
  }
226
261
  /** Custom checkbox renderer that renders checkbox as an eye */
227
- const eyeCheckboxRenderer = (props) => (React.createElement(core_react_1.ImageCheckBox, { checked: props.checked, disabled: props.disabled, imageOn: "icon-visibility", imageOff: "icon-visibility-hide-2", onClick: props.onChange, tooltip: props.title }));
262
+ const eyeCheckboxRenderer = (props) => ((0, jsx_runtime_1.jsx)(core_react_1.ImageCheckBox, { checked: props.checked, disabled: props.disabled, imageOn: "icon-visibility", imageOff: "icon-visibility-hide-2", onClick: props.onChange, tooltip: props.title }));
228
263
  /** Custom node renderer. It uses default 'TreeNodeRenderer' but overrides default checkbox renderer to render checkbox as an eye */
229
264
  const imageLoader = new components_react_1.TreeImageLoader();
230
- const nodeWithEyeCheckboxRenderer = (props) => (React.createElement(components_react_1.TreeNodeRenderer, { ...props, checkboxRenderer: eyeCheckboxRenderer, imageLoader: imageLoader }));
265
+ const nodeWithEyeCheckboxRenderer = (props) => ((0, jsx_runtime_1.jsx)(components_react_1.TreeNodeRenderer, { ...props, checkboxRenderer: eyeCheckboxRenderer, imageLoader: imageLoader }));
231
266
  /** Custom tree renderer. It uses default `TreeRenderer` but overrides default node renderer to render node with custom checkbox */
232
- const nodeWithEyeCheckboxTreeRenderer = (props) => (React.createElement(components_react_1.TreeRenderer, { ...props, nodeRenderer: nodeWithEyeCheckboxRenderer }));
267
+ const nodeWithEyeCheckboxTreeRenderer = (props) => (0, jsx_runtime_1.jsx)(components_react_1.TreeRenderer, { ...props, nodeRenderer: nodeWithEyeCheckboxRenderer });
233
268
  function useTreeFiltering(dataProvider, filter) {
234
269
  const nodeLoader = useFilteredProvider(dataProvider, filter);
235
270
  const nodeHighlightingProps = useNodeHighlightingProps(filter);
@@ -303,8 +338,9 @@ class FilteredTreeHierarchy {
303
338
  filterNodes(hierarchy, current) {
304
339
  const matches = current ? this.matchesFilter(current) : false;
305
340
  const children = hierarchy.get(current?.id);
306
- if (!children)
341
+ if (!children) {
307
342
  return matches ? current : undefined;
343
+ }
308
344
  const matchedChildren = new Array();
309
345
  for (const child of children) {
310
346
  const matchedChild = this.filterNodes(hierarchy, child);
@@ -327,11 +363,13 @@ class FilteredTreeHierarchy {
327
363
  return filtered;
328
364
  }
329
365
  matchesFilter(node) {
330
- if (node.label.value.valueFormat !== appui_abstract_1.PropertyValueFormat.Primitive)
366
+ if (node.label.value.valueFormat !== appui_abstract_1.PropertyValueFormat.Primitive) {
331
367
  return false;
368
+ }
332
369
  const value = node.label.value.displayValue?.toLowerCase();
333
- if (!value)
370
+ if (!value) {
334
371
  return false;
372
+ }
335
373
  return value.includes(this._filter.toLowerCase());
336
374
  }
337
375
  async getHierarchy() {