qwc2 2025.3.31

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 (528) hide show
  1. package/LICENSE +28 -0
  2. package/README.md +68 -0
  3. package/actions/display.js +7 -0
  4. package/actions/editing.js +7 -0
  5. package/actions/layerinfo.js +7 -0
  6. package/actions/layers.js +8 -0
  7. package/actions/localConfig.js +7 -0
  8. package/actions/locale.js +10 -0
  9. package/actions/locate.js +8 -0
  10. package/actions/logging.js +7 -0
  11. package/actions/map.js +15 -0
  12. package/actions/measurement.js +8 -0
  13. package/actions/processNotifications.js +7 -0
  14. package/actions/redlining.js +7 -0
  15. package/actions/redliningPick.js +7 -0
  16. package/actions/serviceinfo.js +7 -0
  17. package/actions/task.js +9 -0
  18. package/actions/theme.js +24 -0
  19. package/actions/windows.js +10 -0
  20. package/components/AppMenu.js +8 -0
  21. package/components/AttributeForm.js +34 -0
  22. package/components/AutoEditForm.js +8 -0
  23. package/components/CoordinateDisplayer.js +7 -0
  24. package/components/EditComboField.js +10 -0
  25. package/components/EditUploadField.js +8 -0
  26. package/components/FullscreenSwitcher.js +8 -0
  27. package/components/Icon.js +7 -0
  28. package/components/IdentifyViewer.js +16 -0
  29. package/components/ImportLayer.js +25 -0
  30. package/components/LayerInfoWindow.js +7 -0
  31. package/components/LinkFeatureForm.js +10 -0
  32. package/components/MapSelection.js +13 -0
  33. package/components/NumericInputWindow.js +7 -0
  34. package/components/PickFeature.js +7 -0
  35. package/components/PluginsContainer.js +8 -0
  36. package/components/PrintSelection.js +54 -0
  37. package/components/QtDesignerForm.js +30 -0
  38. package/components/ResizeableWindow.js +12 -0
  39. package/components/SearchBox.js +26 -0
  40. package/components/ServiceInfoWindow.js +7 -0
  41. package/components/SideBar.js +9 -0
  42. package/components/StandardApp.js +35 -0
  43. package/components/Swipeable.js +1 -0
  44. package/components/TaskBar.js +7 -0
  45. package/components/ThemeLayersListWindow.js +9 -0
  46. package/components/ThemeList.js +12 -0
  47. package/components/Toolbar.js +7 -0
  48. package/components/WindowManager.js +7 -0
  49. package/components/map/OlLayer.js +12 -0
  50. package/components/map/OlLocate.css +56 -0
  51. package/components/map/OlLocate.js +17 -0
  52. package/components/map/OlMap.js +11 -0
  53. package/components/map/layers/BingLayer.js +8 -0
  54. package/components/map/layers/GoogleLayer.js +27 -0
  55. package/components/map/layers/GraticuleLayer.js +8 -0
  56. package/components/map/layers/ImageLayer.js +8 -0
  57. package/components/map/layers/MVTLayer.js +7 -0
  58. package/components/map/layers/OSMLayer.js +8 -0
  59. package/components/map/layers/OverlayLayer.js +10 -0
  60. package/components/map/layers/VectorLayer.js +14 -0
  61. package/components/map/layers/WFSLayer.js +11 -0
  62. package/components/map/layers/WMSLayer.js +11 -0
  63. package/components/map/layers/WMTSLayer.js +9 -0
  64. package/components/map/layers/XYZLayer.js +7 -0
  65. package/components/map/layers/index.js +8 -0
  66. package/components/map3d/BottomBar3D.js +7 -0
  67. package/components/map3d/Compare3D.js +12 -0
  68. package/components/map3d/Draw3D.js +10 -0
  69. package/components/map3d/ExportObjects3D.js +17 -0
  70. package/components/map3d/HeightProfile3D.js +8 -0
  71. package/components/map3d/HideObjects3D.js +12 -0
  72. package/components/map3d/Identify3D.js +13 -0
  73. package/components/map3d/LayerTree3D.js +8 -0
  74. package/components/map3d/Map3D.js +29 -0
  75. package/components/map3d/Map3DLight.js +10 -0
  76. package/components/map3d/MapControls3D.js +20 -0
  77. package/components/map3d/MapExport3D.js +11 -0
  78. package/components/map3d/Measure3D.js +23 -0
  79. package/components/map3d/OverviewMap3D.js +9 -0
  80. package/components/map3d/SearchField3D.js +16 -0
  81. package/components/map3d/TopBar3D.js +7 -0
  82. package/components/map3d/View3DSwitcher.js +7 -0
  83. package/components/map3d/drawtool/CreateTool3D.js +9 -0
  84. package/components/map3d/drawtool/EditTool3D.js +9 -0
  85. package/components/map3d/drawtool/NumericInput3D.js +7 -0
  86. package/components/map3d/img/viewcone.svg +124 -0
  87. package/components/map3d/layers/VectorLayer3D.js +7 -0
  88. package/components/map3d/layers/WFSLayer3D.js +8 -0
  89. package/components/map3d/layers/WMSLayer3D.js +7 -0
  90. package/components/map3d/layers/WMTSLayer3D.js +9 -0
  91. package/components/map3d/layers/index.js +8 -0
  92. package/components/map3d/models/arrow.glb +0 -0
  93. package/components/map3d/models/pin.glb +0 -0
  94. package/components/map3d/slices/map3d.js +1 -0
  95. package/components/map3d/style/BottomBar3D.css +67 -0
  96. package/components/map3d/style/Compare3D.css +57 -0
  97. package/components/map3d/style/Draw3D.css +7 -0
  98. package/components/map3d/style/HideObjects3D.css +29 -0
  99. package/components/map3d/style/LayerTree3D.css +126 -0
  100. package/components/map3d/style/Map3D.css +42 -0
  101. package/components/map3d/style/Map3DLight.css +72 -0
  102. package/components/map3d/style/MapControls3D.css +56 -0
  103. package/components/map3d/style/MapExport3D.css +25 -0
  104. package/components/map3d/style/OverviewMap3D.css +37 -0
  105. package/components/map3d/style/SearchField3D.css +7 -0
  106. package/components/map3d/style/View3DSwitcher.css +27 -0
  107. package/components/map3d/utils/Tiles3DStyle.js +1 -0
  108. package/components/share/ShareLink.js +7 -0
  109. package/components/share/ShareQRCode.js +8 -0
  110. package/components/share/ShareSocials.js +9 -0
  111. package/components/share/style/ShareLink.css +13 -0
  112. package/components/share/style/ShareSocials.css +9 -0
  113. package/components/style/App.css +229 -0
  114. package/components/style/AppMenu.css +162 -0
  115. package/components/style/AttributeForm.css +57 -0
  116. package/components/style/AutoEditForm.css +64 -0
  117. package/components/style/DefaultColorScheme.css +60 -0
  118. package/components/style/EditUploadField.css +103 -0
  119. package/components/style/FullscreenSwitcher.css +25 -0
  120. package/components/style/Icon.css +26 -0
  121. package/components/style/IdentifyViewer.css +249 -0
  122. package/components/style/ImportLayer.css +28 -0
  123. package/components/style/LayerInfoWindow.css +46 -0
  124. package/components/style/LinkFeatureForm.css +48 -0
  125. package/components/style/NumericInputWindow.css +11 -0
  126. package/components/style/PickFeature.css +25 -0
  127. package/components/style/PluginsContainer.css +4 -0
  128. package/components/style/QtDesignerForm.css +225 -0
  129. package/components/style/ResizeableWindow.css +178 -0
  130. package/components/style/SearchBox.css +159 -0
  131. package/components/style/ServiceInfoWindow.css +34 -0
  132. package/components/style/SideBar.css +100 -0
  133. package/components/style/TaskBar.css +35 -0
  134. package/components/style/ThemeLayersListWindow.css +47 -0
  135. package/components/style/ThemeList.css +200 -0
  136. package/components/style/Toolbar.css +20 -0
  137. package/components/style/WindowManager.css +50 -0
  138. package/components/timeline/FixedTimeline.js +10 -0
  139. package/components/timeline/InfiniteTimeline.js +13 -0
  140. package/components/timeline/TimelineFeaturesSlider.js +10 -0
  141. package/components/timeline/style/FixedTimeline.css +76 -0
  142. package/components/timeline/style/InfiniteTimeline.css +94 -0
  143. package/components/timeline/style/TimelineFeaturesSlider.css +131 -0
  144. package/components/widgets/AccordeonWidget.js +7 -0
  145. package/components/widgets/ButtonBar.js +7 -0
  146. package/components/widgets/ColorButton.js +8 -0
  147. package/components/widgets/ComboBox.js +7 -0
  148. package/components/widgets/CopyButton.js +7 -0
  149. package/components/widgets/DateTimeInput.js +8 -0
  150. package/components/widgets/EditableSelect.js +8 -0
  151. package/components/widgets/FileSelector.js +9 -0
  152. package/components/widgets/Input.js +7 -0
  153. package/components/widgets/InputContainer.js +7 -0
  154. package/components/widgets/LayerCatalogWidget.js +3 -0
  155. package/components/widgets/MenuButton.js +1 -0
  156. package/components/widgets/ModalDialog.js +7 -0
  157. package/components/widgets/NavBar.js +7 -0
  158. package/components/widgets/NumberInput.js +9 -0
  159. package/components/widgets/PopupMenu.js +1 -0
  160. package/components/widgets/Primitives.js +7 -0
  161. package/components/widgets/ReCaptchaWidget.js +1 -0
  162. package/components/widgets/SearchWidget.js +7 -0
  163. package/components/widgets/Spinner.js +6 -0
  164. package/components/widgets/SuggestionInput.js +7 -0
  165. package/components/widgets/TextInput.js +7 -0
  166. package/components/widgets/ToggleSwitch.js +7 -0
  167. package/components/widgets/VectorLayerPicker.js +8 -0
  168. package/components/widgets/style/AccordeonWidget.css +22 -0
  169. package/components/widgets/style/ButtonBar.css +88 -0
  170. package/components/widgets/style/ColorButton.css +88 -0
  171. package/components/widgets/style/ComboBox.css +83 -0
  172. package/components/widgets/style/CopyButton.css +21 -0
  173. package/components/widgets/style/EditableSelect.css +47 -0
  174. package/components/widgets/style/FileSelector.css +14 -0
  175. package/components/widgets/style/InputContainer.css +34 -0
  176. package/components/widgets/style/LayerCatalogWidget.css +59 -0
  177. package/components/widgets/style/MenuButton.css +122 -0
  178. package/components/widgets/style/ModalDialog.css +50 -0
  179. package/components/widgets/style/NavBar.css +12 -0
  180. package/components/widgets/style/NumberInput.css +76 -0
  181. package/components/widgets/style/SearchWidget.css +43 -0
  182. package/components/widgets/style/Spinner.css +32 -0
  183. package/components/widgets/style/SuggestionInput.css +8 -0
  184. package/components/widgets/style/TextInput.css +94 -0
  185. package/components/widgets/style/ToggleSwitch.css +61 -0
  186. package/components/widgets/style/VectorLayerPicker.css +3 -0
  187. package/icons/2d.svg +70 -0
  188. package/icons/3d.svg +70 -0
  189. package/icons/3d2d.svg +92 -0
  190. package/icons/after.svg +76 -0
  191. package/icons/arrow-down.svg +60 -0
  192. package/icons/arrow-up.svg +60 -0
  193. package/icons/before.svg +76 -0
  194. package/icons/bglayer.svg +71 -0
  195. package/icons/bookmark.svg +170 -0
  196. package/icons/box.svg +63 -0
  197. package/icons/buffer.svg +67 -0
  198. package/icons/camera.svg +118 -0
  199. package/icons/catalog.svg +62 -0
  200. package/icons/checked.svg +80 -0
  201. package/icons/chevron-down.svg +60 -0
  202. package/icons/chevron-left.svg +59 -0
  203. package/icons/chevron-right.svg +60 -0
  204. package/icons/chevron-up.svg +60 -0
  205. package/icons/circle.svg +70 -0
  206. package/icons/clear.svg +62 -0
  207. package/icons/clock.svg +71 -0
  208. package/icons/cog.svg +60 -0
  209. package/icons/collapse.svg +73 -0
  210. package/icons/compare.svg +72 -0
  211. package/icons/cone.svg +58 -0
  212. package/icons/confirm.svg +62 -0
  213. package/icons/copy.svg +60 -0
  214. package/icons/cuboid.svg +58 -0
  215. package/icons/cyclomedia.svg +47 -0
  216. package/icons/cylinder.svg +58 -0
  217. package/icons/dataimport.svg +116 -0
  218. package/icons/detach.svg +79 -0
  219. package/icons/dock.svg +82 -0
  220. package/icons/dock_bottom.svg +82 -0
  221. package/icons/dock_left.svg +84 -0
  222. package/icons/dock_right.svg +84 -0
  223. package/icons/dock_top.svg +84 -0
  224. package/icons/draw.svg +78 -0
  225. package/icons/editdraw.svg +84 -0
  226. package/icons/edited.svg +78 -0
  227. package/icons/editing.svg +118 -0
  228. package/icons/ellipse.svg +72 -0
  229. package/icons/embed.svg +88 -0
  230. package/icons/expand.svg +73 -0
  231. package/icons/export.svg +126 -0
  232. package/icons/eye.svg +127 -0
  233. package/icons/featureform.svg +115 -0
  234. package/icons/fill.svg +62 -0
  235. package/icons/filter.svg +69 -0
  236. package/icons/folder-open.svg +60 -0
  237. package/icons/freehand.svg +82 -0
  238. package/icons/group.svg +76 -0
  239. package/icons/home.svg +60 -0
  240. package/icons/identify_radius.svg +71 -0
  241. package/icons/identify_region.svg +71 -0
  242. package/icons/import.svg +62 -0
  243. package/icons/info-sign.svg +60 -0
  244. package/icons/info.svg +80 -0
  245. package/icons/layers.svg +71 -0
  246. package/icons/light.svg +77 -0
  247. package/icons/line.svg +61 -0
  248. package/icons/line_buffer.svg +65 -0
  249. package/icons/link.svg +75 -0
  250. package/icons/list-alt.svg +111 -0
  251. package/icons/lock.svg +54 -0
  252. package/icons/login.svg +56 -0
  253. package/icons/logout.svg +56 -0
  254. package/icons/map3d.svg +51 -0
  255. package/icons/maximize.svg +84 -0
  256. package/icons/measure.svg +82 -0
  257. package/icons/measure_line.svg +87 -0
  258. package/icons/measure_polygon.svg +88 -0
  259. package/icons/menu-hamburger.svg +60 -0
  260. package/icons/minimize.svg +76 -0
  261. package/icons/minus-sign.svg +60 -0
  262. package/icons/minus.svg +61 -0
  263. package/icons/nav-end.svg +74 -0
  264. package/icons/nav-left.svg +74 -0
  265. package/icons/nav-right.svg +74 -0
  266. package/icons/nav-start.svg +73 -0
  267. package/icons/new.svg +84 -0
  268. package/icons/nodetool.svg +68 -0
  269. package/icons/numericinput.svg +86 -0
  270. package/icons/ok.svg +60 -0
  271. package/icons/open.svg +79 -0
  272. package/icons/open_link.svg +74 -0
  273. package/icons/paint.svg +75 -0
  274. package/icons/pen.svg +41 -0
  275. package/icons/person.svg +44 -0
  276. package/icons/pick.svg +67 -0
  277. package/icons/pick_point.svg +74 -0
  278. package/icons/pick_region.svg +71 -0
  279. package/icons/plus.svg +60 -0
  280. package/icons/point.svg +67 -0
  281. package/icons/point_buffer.svg +74 -0
  282. package/icons/polygon.svg +61 -0
  283. package/icons/print.svg +60 -0
  284. package/icons/pyramid.svg +58 -0
  285. package/icons/radio_checked.svg +78 -0
  286. package/icons/radio_tristate.svg +75 -0
  287. package/icons/radio_unchecked.svg +72 -0
  288. package/icons/rasterexport.svg +124 -0
  289. package/icons/rect.svg +63 -0
  290. package/icons/refresh.svg +44 -0
  291. package/icons/remove.svg +60 -0
  292. package/icons/report.svg +84 -0
  293. package/icons/routing-bicycle.svg +40 -0
  294. package/icons/routing-bus.svg +40 -0
  295. package/icons/routing-cablecar.svg +40 -0
  296. package/icons/routing-car.svg +40 -0
  297. package/icons/routing-ship.svg +40 -0
  298. package/icons/routing-train.svg +40 -0
  299. package/icons/routing-tram.svg +40 -0
  300. package/icons/routing-truck.svg +40 -0
  301. package/icons/routing-walking.svg +40 -0
  302. package/icons/routing.svg +68 -0
  303. package/icons/save.svg +190 -0
  304. package/icons/scale.svg +62 -0
  305. package/icons/screenshot.svg +60 -0
  306. package/icons/search.svg +60 -0
  307. package/icons/selectbox.svg +79 -0
  308. package/icons/share.svg +64 -0
  309. package/icons/snap_edge.svg +79 -0
  310. package/icons/snap_vertex.svg +79 -0
  311. package/icons/sphere.svg +58 -0
  312. package/icons/square.svg +68 -0
  313. package/icons/sync.svg +72 -0
  314. package/icons/text.svg +68 -0
  315. package/icons/themes.svg +81 -0
  316. package/icons/tilt-down.svg +67 -0
  317. package/icons/tilt-left.svg +48 -0
  318. package/icons/tilt-right.svg +48 -0
  319. package/icons/tilt-up.svg +67 -0
  320. package/icons/today.svg +45 -0
  321. package/icons/tools.svg +77 -0
  322. package/icons/transformtool.svg +74 -0
  323. package/icons/transparency.svg +132 -0
  324. package/icons/trash.svg +60 -0
  325. package/icons/tree_minus.svg +81 -0
  326. package/icons/tree_plus.svg +81 -0
  327. package/icons/triangle-down.svg +59 -0
  328. package/icons/triangle-left.svg +60 -0
  329. package/icons/triangle-right.svg +60 -0
  330. package/icons/triangle-up.svg +59 -0
  331. package/icons/tristate.svg +79 -0
  332. package/icons/unchecked.svg +74 -0
  333. package/icons/undock.svg +82 -0
  334. package/icons/undock_bottom.svg +82 -0
  335. package/icons/undock_left.svg +82 -0
  336. package/icons/undock_right.svg +84 -0
  337. package/icons/undock_top.svg +84 -0
  338. package/icons/unmaximize.svg +84 -0
  339. package/icons/unminimize.svg +76 -0
  340. package/icons/up-down-arrow.svg +66 -0
  341. package/icons/warning.svg +72 -0
  342. package/icons/wedge.svg +58 -0
  343. package/icons/zoom.svg +60 -0
  344. package/icons/zoomin.svg +71 -0
  345. package/icons/zoomout.svg +80 -0
  346. package/libs/openlayers.js +11 -0
  347. package/package.json +135 -0
  348. package/plugins/API.js +114 -0
  349. package/plugins/AttributeTable.js +25 -0
  350. package/plugins/Authentication.js +13 -0
  351. package/plugins/BackgroundSwitcher.js +10 -0
  352. package/plugins/Bookmark.js +13 -0
  353. package/plugins/BottomBar.js +10 -0
  354. package/plugins/CookiePopup.js +9 -0
  355. package/plugins/Cyclomedia.js +11 -0
  356. package/plugins/Editing.js +21 -0
  357. package/plugins/FeatureForm.js +21 -0
  358. package/plugins/FeatureSearch.js +11 -0
  359. package/plugins/GeometryDigitizer.js +43 -0
  360. package/plugins/HeightProfile.js +26 -0
  361. package/plugins/Help.js +11 -0
  362. package/plugins/HomeButton.js +9 -0
  363. package/plugins/Identify.js +18 -0
  364. package/plugins/LayerCatalog.js +45 -0
  365. package/plugins/LayerTree.js +15 -0
  366. package/plugins/LocateButton.js +10 -0
  367. package/plugins/Map.js +22 -0
  368. package/plugins/MapCompare.js +11 -0
  369. package/plugins/MapCopyright.js +11 -0
  370. package/plugins/MapExport.js +23 -0
  371. package/plugins/MapFilter.js +20 -0
  372. package/plugins/MapInfoTooltip.js +32 -0
  373. package/plugins/MapLegend.js +14 -0
  374. package/plugins/MapTip.js +15 -0
  375. package/plugins/Measure.js +10 -0
  376. package/plugins/NewsPopup.js +12 -0
  377. package/plugins/Panoramax.js +10 -0
  378. package/plugins/Portal.js +10 -0
  379. package/plugins/Print.js +22 -0
  380. package/plugins/ProcessNotifications.js +11 -0
  381. package/plugins/Redlining.js +12 -0
  382. package/plugins/Reports.js +15 -0
  383. package/plugins/Routing.js +23 -0
  384. package/plugins/ScratchDrawing.js +15 -0
  385. package/plugins/Settings.js +12 -0
  386. package/plugins/Share.js +11 -0
  387. package/plugins/StartupMarker.js +12 -0
  388. package/plugins/TaskButton.js +9 -0
  389. package/plugins/ThemeSwitcher.js +10 -0
  390. package/plugins/TimeManager.js +21 -0
  391. package/plugins/TopBar.js +13 -0
  392. package/plugins/ValueTool.js +11 -0
  393. package/plugins/View3D.js +34 -0
  394. package/plugins/ZoomButtons.js +11 -0
  395. package/plugins/map/EditingSupport.js +13 -0
  396. package/plugins/map/LocateSupport.js +14 -0
  397. package/plugins/map/MeasurementSupport.js +15 -0
  398. package/plugins/map/OverviewSupport.js +14 -0
  399. package/plugins/map/RedliningPickSupport.js +12 -0
  400. package/plugins/map/RedliningSupport.js +28 -0
  401. package/plugins/map/ScaleBarSupport.js +10 -0
  402. package/plugins/map/SnapInteraction.js +1 -0
  403. package/plugins/map/SnapSupport.js +7 -0
  404. package/plugins/map/SnappingSupport.js +23 -0
  405. package/plugins/map/style/OverviewSupport.css +42 -0
  406. package/plugins/map/style/ScaleBarSupport.css +18 -0
  407. package/plugins/map/style/SnappingSupport.css +33 -0
  408. package/plugins/redlining/RedliningBufferSupport.js +8 -0
  409. package/plugins/style/AttributeTable.css +220 -0
  410. package/plugins/style/Authentication.css +16 -0
  411. package/plugins/style/BackgroundSwitcher.css +99 -0
  412. package/plugins/style/Bookmark.css +62 -0
  413. package/plugins/style/BottomBar.css +53 -0
  414. package/plugins/style/Buttons.css +68 -0
  415. package/plugins/style/CookiePopup.css +24 -0
  416. package/plugins/style/Cyclomedia.css +66 -0
  417. package/plugins/style/Editing.css +40 -0
  418. package/plugins/style/FeatureForm.css +21 -0
  419. package/plugins/style/FeatureSearch.css +71 -0
  420. package/plugins/style/GeometryDigitizer.css +28 -0
  421. package/plugins/style/HeightProfile.css +26 -0
  422. package/plugins/style/Identify.css +4 -0
  423. package/plugins/style/LayerCatalog.css +8 -0
  424. package/plugins/style/LayerTree.css +316 -0
  425. package/plugins/style/Map.css +43 -0
  426. package/plugins/style/MapCompare.css +27 -0
  427. package/plugins/style/MapCopyright.css +17 -0
  428. package/plugins/style/MapExport.css +55 -0
  429. package/plugins/style/MapFilter.css +101 -0
  430. package/plugins/style/MapInfoTooltip.css +78 -0
  431. package/plugins/style/MapLegend.css +36 -0
  432. package/plugins/style/MapTip.css +22 -0
  433. package/plugins/style/Measure.css +23 -0
  434. package/plugins/style/NewsPopup.css +87 -0
  435. package/plugins/style/Panoramax.css +15 -0
  436. package/plugins/style/Portal.css +115 -0
  437. package/plugins/style/Print.css +116 -0
  438. package/plugins/style/ProcessNotifications.css +55 -0
  439. package/plugins/style/Redlining.css +101 -0
  440. package/plugins/style/Reports.css +11 -0
  441. package/plugins/style/Routing.css +243 -0
  442. package/plugins/style/ScratchDrawing.css +8 -0
  443. package/plugins/style/Settings.css +11 -0
  444. package/plugins/style/Share.css +59 -0
  445. package/plugins/style/ThemeSwitcher.css +7 -0
  446. package/plugins/style/TimeManager.css +91 -0
  447. package/plugins/style/TopBar.css +50 -0
  448. package/plugins/style/ValueTool.css +60 -0
  449. package/reducers/display.js +7 -0
  450. package/reducers/editing.js +8 -0
  451. package/reducers/index.js +7 -0
  452. package/reducers/layerinfo.js +7 -0
  453. package/reducers/layers.js +14 -0
  454. package/reducers/localConfig.js +8 -0
  455. package/reducers/locale.js +8 -0
  456. package/reducers/locate.js +8 -0
  457. package/reducers/map.js +11 -0
  458. package/reducers/measurement.js +8 -0
  459. package/reducers/processNotifications.js +7 -0
  460. package/reducers/redlining.js +7 -0
  461. package/reducers/redliningPick.js +7 -0
  462. package/reducers/serviceinfo.js +7 -0
  463. package/reducers/task.js +7 -0
  464. package/reducers/theme.js +7 -0
  465. package/reducers/windows.js +7 -0
  466. package/scripts/dist.sh +16 -0
  467. package/scripts/gen-plugin-docs.js +9 -0
  468. package/scripts/makeIconkit.js +7 -0
  469. package/scripts/package-commands.bat +8 -0
  470. package/scripts/package-commands.sh +22 -0
  471. package/scripts/themesConfig.js +48 -0
  472. package/scripts/themesConfig.py +659 -0
  473. package/scripts/translateui.sh +51 -0
  474. package/scripts/updateTranslations.js +17 -0
  475. package/scripts/wmts_config_generator.py +169 -0
  476. package/selectors/searchproviders.js +12 -0
  477. package/static/translations/bg-BG.json +709 -0
  478. package/static/translations/ca-ES.json +709 -0
  479. package/static/translations/cs-CZ.json +709 -0
  480. package/static/translations/de-CH.json +709 -0
  481. package/static/translations/de-DE.json +709 -0
  482. package/static/translations/en-US.json +709 -0
  483. package/static/translations/es-ES.json +709 -0
  484. package/static/translations/fi-FI.json +709 -0
  485. package/static/translations/fr-FR.json +709 -0
  486. package/static/translations/hu-HU.json +709 -0
  487. package/static/translations/it-IT.json +709 -0
  488. package/static/translations/ja-JP.json +709 -0
  489. package/static/translations/nl-NL.json +709 -0
  490. package/static/translations/no-NO.json +709 -0
  491. package/static/translations/pl-PL.json +709 -0
  492. package/static/translations/pt-BR.json +709 -0
  493. package/static/translations/pt-PT.json +709 -0
  494. package/static/translations/ro-RO.json +709 -0
  495. package/static/translations/ru-RU.json +709 -0
  496. package/static/translations/sv-SE.json +709 -0
  497. package/static/translations/tr-TR.json +709 -0
  498. package/static/translations/tsconfig.json +606 -0
  499. package/stores/StandardStore.js +8 -0
  500. package/utils/ConfigUtils.js +9 -0
  501. package/utils/CoordinatesUtils.js +29 -0
  502. package/utils/DxfUtils.js +10 -0
  503. package/utils/EditingInterface.js +67 -0
  504. package/utils/EditingUtils.js +11 -0
  505. package/utils/FeatureStyles.js +10 -0
  506. package/utils/IdentifyUtils.js +12 -0
  507. package/utils/ImageEditor.js +15 -0
  508. package/utils/LayerUtils.js +57 -0
  509. package/utils/LocaleUtils.js +9 -0
  510. package/utils/MapUtils.js +66 -0
  511. package/utils/MeasureUtils.js +9 -0
  512. package/utils/MiscUtils.js +15 -0
  513. package/utils/PermaLinkUtils.js +11 -0
  514. package/utils/ResourceRegistry.js +7 -0
  515. package/utils/RoutingInterface.js +12 -0
  516. package/utils/SearchProviders.js +19 -0
  517. package/utils/ServiceLayerUtils.js +20 -0
  518. package/utils/Signal.js +2 -0
  519. package/utils/ThemeUtils.js +12 -0
  520. package/utils/VectorLayerUtils.js +20 -0
  521. package/utils/expr_grammar/README.md +3 -0
  522. package/utils/expr_grammar/grammar.js +3 -0
  523. package/utils/expr_grammar/grammar.ne +118 -0
  524. package/utils/expr_grammar/test.js +13 -0
  525. package/utils/img/README.markers +1 -0
  526. package/utils/img/arrowhead.svg +4 -0
  527. package/utils/img/marker-icon.png +0 -0
  528. package/utils/img/measurehead.svg +4 -0
@@ -0,0 +1,71 @@
1
+ <?xml version="1.0" encoding="UTF-8" standalone="no"?>
2
+ <!-- Generated by IcoMoon.io -->
3
+
4
+ <svg
5
+ version="1.1"
6
+ width="24"
7
+ height="24"
8
+ viewBox="0 0 24 24"
9
+ id="svg6"
10
+ sodipodi:docname="zoomin.svg"
11
+ inkscape:version="1.2.1 (9c6d41e410, 2022-07-14)"
12
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
13
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
14
+ xmlns="http://www.w3.org/2000/svg"
15
+ xmlns:svg="http://www.w3.org/2000/svg"
16
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
17
+ xmlns:cc="http://creativecommons.org/ns#"
18
+ xmlns:dc="http://purl.org/dc/elements/1.1/">
19
+ <metadata
20
+ id="metadata12">
21
+ <rdf:RDF>
22
+ <cc:Work
23
+ rdf:about="">
24
+ <dc:format>image/svg+xml</dc:format>
25
+ <dc:type
26
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
27
+ <dc:title>uniE003</dc:title>
28
+ </cc:Work>
29
+ </rdf:RDF>
30
+ </metadata>
31
+ <defs
32
+ id="defs10" />
33
+ <sodipodi:namedview
34
+ pagecolor="#ffffff"
35
+ bordercolor="#666666"
36
+ borderopacity="1"
37
+ objecttolerance="10"
38
+ gridtolerance="10"
39
+ guidetolerance="10"
40
+ inkscape:pageopacity="0"
41
+ inkscape:pageshadow="2"
42
+ inkscape:window-width="1600"
43
+ inkscape:window-height="837"
44
+ id="namedview8"
45
+ showgrid="true"
46
+ inkscape:zoom="25.988957"
47
+ inkscape:cx="7.6570984"
48
+ inkscape:cy="11.139347"
49
+ inkscape:window-x="0"
50
+ inkscape:window-y="0"
51
+ inkscape:window-maximized="1"
52
+ inkscape:current-layer="svg6"
53
+ inkscape:showpageshadow="2"
54
+ inkscape:pagecheckerboard="0"
55
+ inkscape:deskcolor="#d1d1d1">
56
+ <inkscape:grid
57
+ type="xygrid"
58
+ id="grid1562" />
59
+ </sodipodi:namedview>
60
+ <title
61
+ id="title2">uniE003</title>
62
+ <path
63
+ d="m 14.113475,0.80944999 q -1.92565,0 -3.67729,0.74564201 Q 8.6845448,2.300734 7.4231615,3.5532691 6.1617783,4.8058043 5.4108692,6.5451576 4.6599601,8.2845109 4.6599601,10.196653 l 0.019496,0.038 -0.019496,0.09536 q 0,2.695782 1.5018182,5.009423 l -5.2946327,5.238852 q -0.44260314,0.496856 -0.43321704,0.851036 0.009432,0.35418 0.43321704,0.81232 l 1.1357508,1.109142 q 0.5003646,0.382141 0.8953148,0.382141 0.3949492,0 0.7602952,-0.382141 l 5.2946327,-5.238852 q 2.2909949,1.471926 5.0253159,1.471926 l 0.09603,-0.01936 0.03827,0.01936 q 1.925649,0 3.67729,-0.745642 1.75164,-0.745642 3.013023,-1.998177 1.261383,-1.252535 2.012292,-2.991889 0.750909,-1.739353 0.750909,-3.651494 0,-1.9121421 -0.75091,-3.6514954 Q 22.06445,4.8058043 20.803067,3.5532691 19.541684,2.300734 17.790044,1.555092 16.038403,0.80944999 14.112754,0.80944999 Z m 0,3.23135431 q 1.6946,0 3.119161,0.822357 1.424562,0.8223571 2.252728,2.236926 0.828167,1.4145689 0.828167,3.0972827 0,1.682713 -0.828167,3.097282 -0.828166,1.414568 -2.252728,2.236926 -1.424561,0.822357 -3.119161,0.822357 -1.694601,0 -3.119163,-0.822357 Q 9.569751,14.70922 8.7415848,13.294652 7.9134186,11.880083 7.9134186,10.19737 q 0,-1.6827138 0.8281662,-3.0972827 0.8281662,-1.4145689 2.2527272,-2.236926 1.424562,-0.822357 3.119163,-0.822357 z"
64
+ id="path4"
65
+ inkscape:connector-curvature="0"
66
+ style="stroke-width:0.69999999" />
67
+ <path
68
+ style="fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
69
+ d="m 10,9 h 3 V 6 h 2 v 3 h 3 v 2 h -3 v 3 h -2 v -3 h -3 z"
70
+ id="path632" />
71
+ </svg>
@@ -0,0 +1,80 @@
1
+ <?xml version="1.0" encoding="UTF-8" standalone="no"?>
2
+ <!-- Generated by IcoMoon.io -->
3
+
4
+ <svg
5
+ version="1.1"
6
+ width="24"
7
+ height="24"
8
+ viewBox="0 0 24 24"
9
+ id="svg6"
10
+ sodipodi:docname="zoomout.svg"
11
+ inkscape:version="1.2.1 (9c6d41e410, 2022-07-14)"
12
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
13
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
14
+ xmlns="http://www.w3.org/2000/svg"
15
+ xmlns:svg="http://www.w3.org/2000/svg"
16
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
17
+ xmlns:cc="http://creativecommons.org/ns#"
18
+ xmlns:dc="http://purl.org/dc/elements/1.1/">
19
+ <metadata
20
+ id="metadata12">
21
+ <rdf:RDF>
22
+ <cc:Work
23
+ rdf:about="">
24
+ <dc:format>image/svg+xml</dc:format>
25
+ <dc:type
26
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
27
+ <dc:title>uniE003</dc:title>
28
+ </cc:Work>
29
+ </rdf:RDF>
30
+ </metadata>
31
+ <defs
32
+ id="defs10" />
33
+ <sodipodi:namedview
34
+ pagecolor="#ffffff"
35
+ bordercolor="#666666"
36
+ borderopacity="1"
37
+ objecttolerance="10"
38
+ gridtolerance="10"
39
+ guidetolerance="10"
40
+ inkscape:pageopacity="0"
41
+ inkscape:pageshadow="2"
42
+ inkscape:window-width="1600"
43
+ inkscape:window-height="837"
44
+ id="namedview8"
45
+ showgrid="true"
46
+ inkscape:zoom="28.36463"
47
+ inkscape:cx="9.6775456"
48
+ inkscape:cy="13.449849"
49
+ inkscape:window-x="0"
50
+ inkscape:window-y="0"
51
+ inkscape:window-maximized="1"
52
+ inkscape:current-layer="svg6"
53
+ inkscape:showpageshadow="2"
54
+ inkscape:pagecheckerboard="0"
55
+ inkscape:deskcolor="#d1d1d1">
56
+ <inkscape:grid
57
+ type="xygrid"
58
+ id="grid358" />
59
+ </sodipodi:namedview>
60
+ <title
61
+ id="title2">uniE003</title>
62
+ <path
63
+ d="m 14.113475,0.80944999 q -1.92565,0 -3.67729,0.74564201 Q 8.6845448,2.300734 7.4231615,3.5532691 6.1617783,4.8058043 5.4108692,6.5451576 4.6599601,8.2845109 4.6599601,10.196653 l 0.019496,0.038 -0.019496,0.09536 q 0,2.695782 1.5018182,5.009423 l -5.2946327,5.238852 q -0.44260314,0.496856 -0.43321704,0.851036 0.009432,0.35418 0.43321704,0.81232 l 1.1357508,1.109142 q 0.5003646,0.382141 0.8953148,0.382141 0.3949492,0 0.7602952,-0.382141 l 5.2946327,-5.238852 q 2.2909949,1.471926 5.0253159,1.471926 l 0.09603,-0.01936 0.03827,0.01936 q 1.925649,0 3.67729,-0.745642 1.75164,-0.745642 3.013023,-1.998177 1.261383,-1.252535 2.012292,-2.991889 0.750909,-1.739353 0.750909,-3.651494 0,-1.9121421 -0.75091,-3.6514954 Q 22.06445,4.8058043 20.803067,3.5532691 19.541684,2.300734 17.790044,1.555092 16.038403,0.80944999 14.112754,0.80944999 Z m 0,3.23135431 q 1.6946,0 3.119161,0.822357 1.424562,0.8223571 2.252728,2.236926 0.828167,1.4145689 0.828167,3.0972827 0,1.682713 -0.828167,3.097282 -0.828166,1.414568 -2.252728,2.236926 -1.424561,0.822357 -3.119161,0.822357 -1.694601,0 -3.119163,-0.822357 Q 9.569751,14.70922 8.7415848,13.294652 7.9134186,11.880083 7.9134186,10.19737 q 0,-1.6827138 0.8281662,-3.0972827 0.8281662,-1.4145689 2.2527272,-2.236926 1.424562,-0.822357 3.119163,-0.822357 z"
64
+ id="path4"
65
+ inkscape:connector-curvature="0"
66
+ style="stroke-width:0.69999999" />
67
+ <text
68
+ xml:space="preserve"
69
+ style="font-style:normal;font-weight:normal;font-size:40px;line-height:1.25;font-family:sans-serif;fill:#000000;fill-opacity:1;stroke:none"
70
+ x="14"
71
+ y="10"
72
+ id="text414"><tspan
73
+ sodipodi:role="line"
74
+ id="tspan412"></tspan></text>
75
+ <path
76
+ style="fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
77
+ d="m 10,9 h 8 v 2 h -8 z"
78
+ id="path632"
79
+ sodipodi:nodetypes="ccccc" />
80
+ </svg>
@@ -0,0 +1,11 @@
1
+ function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}function ownKeys(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);r&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),t.push.apply(t,o)}return t}function _objectSpread(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?ownKeys(Object(t),!0).forEach(function(r){_defineProperty(e,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):ownKeys(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))})}return e}function _defineProperty(e,r,t){return(r=_toPropertyKey(r))in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+""}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}/**
2
+ * Copyright 2015 GeoSolutions Sas
3
+ * Copyright 2016-2024 Sourcepole AG
4
+ * All rights reserved.
5
+ *
6
+ * This source code is licensed under the BSD-style license found in the
7
+ * LICENSE file in the root directory of this source tree.
8
+ */import OlCollection from"ol/Collection";import OlFeature from"ol/Feature";import OlGeolocation from"ol/Geolocation";import OlKinetic from"ol/Kinetic";import OlMap from"ol/Map";import OlObject from"ol/Object";import OlOverlay from"ol/Overlay";import OlTileQueue from"ol/TileQueue";import OlView from"ol/View";import{defaults as olControlDefaults}from"ol/control";import OlControlAttribution from"ol/control/Attribution";import OlControlOverviewMap from"ol/control/OverviewMap";import OlControlScaleLine from"ol/control/ScaleLine";import OlControlZoom from"ol/control/Zoom";import*as OlEventsCondition from"ol/events/condition";import*as OlExtent from"ol/extent";import OlFormatGML2 from"ol/format/GML2";import OlFormatGML3 from"ol/format/GML3";import OlFormatGML32 from"ol/format/GML32";import OlFormatGeoJSON from"ol/format/GeoJSON";import OlFormatKML from"ol/format/KML";import OlFormatMVT from"ol/format/MVT";import OlFormatWFS from"ol/format/WFS";import OlFormatWKT from"ol/format/WKT";import OlFormatWMSCapabilities from"ol/format/WMSCapabilities";import OlFormatWMTSCapabilities from"ol/format/WMTSCapabilities";import OlGeomCircle from"ol/geom/Circle";import OlGeomGeometryCollection from"ol/geom/GeometryCollection";import OlGeomLineString from"ol/geom/LineString";import OlGeomMultiLineString from"ol/geom/MultiLineString";import OlGeomMultiPoint from"ol/geom/MultiPoint";import OlGeomMultiPolygon from"ol/geom/MultiPolygon";import OlGeomPoint from"ol/geom/Point";import OlGeomPolygon from"ol/geom/Polygon";import{fromCircle as olPolygonFromCircle,fromExtent as olPolygonFromExtent}from"ol/geom/Polygon";import{defaults as olInteractionDefaults}from"ol/interaction";import OlInteractionDoubleClickZoom from"ol/interaction/DoubleClickZoom";import OlInteractionDragBox from"ol/interaction/DragBox";import OlInteractionDragPan from"ol/interaction/DragPan";import OlInteractionDraw from"ol/interaction/Draw";import{createBox as olCreateBox}from"ol/interaction/Draw";import OlInteractionInteraction from"ol/interaction/Interaction";import OlInteractionKeyboardPan from"ol/interaction/KeyboardPan";import OlInteractionKeyboardZoom from"ol/interaction/KeyboardZoom";import OlInteractionModify from"ol/interaction/Modify";import OlInteractionMouseWheelZoom from"ol/interaction/MouseWheelZoom";import OlInteractionPointer from"ol/interaction/Pointer";import OlInteractionSelect from"ol/interaction/Select";import OlInteractionSnap from"ol/interaction/Snap";import OlInteractionTranslate from"ol/interaction/Translate";import OlGraticule from"ol/layer/Graticule";import OlLayerGroup from"ol/layer/Group";import OlLayerImage from"ol/layer/Image";import OlLayer from"ol/layer/Layer";import OlLayerTile from"ol/layer/Tile";import OlLayerVector from"ol/layer/Vector";import OlLayerVectorTile from"ol/layer/VectorTile";import*as OlLoadingstrategy from"ol/loadingstrategy";import*as OlProj from"ol/proj";import OlSourceBingMaps from"ol/source/BingMaps";import OlSourceImageStatic from"ol/source/ImageStatic";import OlSourceImageWMS from"ol/source/ImageWMS";import OlSourceOSM from"ol/source/OSM";import OlSourceTileWMS from"ol/source/TileWMS";import OlSourceVector from"ol/source/Vector";import OlSourceVectorTile from"ol/source/VectorTile";import OlSourceWMTS from"ol/source/WMTS";import OlSourceXYZ from"ol/source/XYZ";import*as OlSphere from"ol/sphere";import OlStyleCircle from"ol/style/Circle";import OlStyleFill from"ol/style/Fill";import OlStyleIcon from"ol/style/Icon";import OlStyleRegularShape from"ol/style/RegularShape";import OlStyleStroke from"ol/style/Stroke";import OlStyleStyle from"ol/style/Style";import OlStyleText from"ol/style/Text";import OlTilegridTileGrid from"ol/tilegrid/TileGrid";import OlTilegridWMTS from"ol/tilegrid/WMTS";import OlInteractionDrawRegular from"ol-ext/interaction/DrawRegular";import OlInteractionTransform from"ol-ext/interaction/Transform";import"ol/ol.css";export default{Attribution:OlControlAttribution,Collection:OlCollection,control:{defaults:olControlDefaults,OverviewMap:OlControlOverviewMap,ScaleLine:OlControlScaleLine,Zoom:OlControlZoom},events:{condition:OlEventsCondition},extent:OlExtent,Feature:OlFeature,format:{GeoJSON:OlFormatGeoJSON,GML2:OlFormatGML2,GML3:OlFormatGML3,GML32:OlFormatGML32,KML:OlFormatKML,MVT:OlFormatMVT,WFS:OlFormatWFS,WMSCapabilities:OlFormatWMSCapabilities,WMTSCapabilities:OlFormatWMTSCapabilities,WKT:OlFormatWKT},Geolocation:OlGeolocation,geom:{Circle:OlGeomCircle,GeometryCollection:OlGeomGeometryCollection,LineString:OlGeomLineString,MultiLineString:OlGeomMultiLineString,MultiPoint:OlGeomMultiPoint,MultiPolygon:OlGeomMultiPolygon,Point:OlGeomPoint,Polygon:OlGeomPolygon,polygonFromCircle:olPolygonFromCircle,polygonFromExtent:olPolygonFromExtent},Graticule:OlGraticule,interaction:{defaults:olInteractionDefaults,DoubleClickZoom:OlInteractionDoubleClickZoom,DragPan:OlInteractionDragPan,DragBox:OlInteractionDragBox,Draw:OlInteractionDraw,DrawRegular:OlInteractionDrawRegular,createBox:olCreateBox,Interaction:OlInteractionInteraction,Modify:OlInteractionModify,MouseWheelZoom:OlInteractionMouseWheelZoom,KeyboardZoom:OlInteractionKeyboardZoom,KeyboardPan:OlInteractionKeyboardPan,Pointer:OlInteractionPointer,Select:OlInteractionSelect,Snap:OlInteractionSnap,Transform:OlInteractionTransform,Translate:OlInteractionTranslate},Kinetic:OlKinetic,layer:{Layer:OlLayer,Image:OlLayerImage,Tile:OlLayerTile,Vector:OlLayerVector,VectorTile:OlLayerVectorTile,Group:OlLayerGroup},loadingstrategy:OlLoadingstrategy,Map:OlMap,Object:OlObject,Overlay:OlOverlay,proj:OlProj,source:{BingMaps:OlSourceBingMaps,ImageStatic:OlSourceImageStatic,ImageWMS:OlSourceImageWMS,OSM:OlSourceOSM,TileWMS:OlSourceTileWMS,Vector:OlSourceVector,VectorTile:OlSourceVectorTile,WMTS:OlSourceWMTS,XYZ:OlSourceXYZ},sphere:OlSphere,style:{Circle:OlStyleCircle,Fill:OlStyleFill,Icon:OlStyleIcon,RegularShape:OlStyleRegularShape,Stroke:OlStyleStroke,Style:OlStyleStyle,Text:OlStyleText},tilegrid:{TileGrid:OlTilegridTileGrid,WMTS:OlTilegridWMTS},View:OlView,TileQueue:OlTileQueue};// Overrides to inject requestsPaused into view state
9
+ OlView.prototype.superGetState=OlView.prototype.getState;OlView.prototype.getState=function(){return _objectSpread(_objectSpread({},this.superGetState()),{},{requestsPaused:this.requestsPaused_})};OlView.prototype.setRequestsPaused=function(paused){this.requestsPaused_=paused};// Overrides to pause image loading when requests are paused
10
+ OlLayer.prototype.superRender=OlLayer.prototype.render;OlLayer.prototype.render=function(frameState,target){if(!frameState.viewState.requestsPaused||!this.getRenderer().getImage){return this.superRender(frameState,target)}else if(this.getRenderer().getImage()){return this.getRenderer().renderFrame(frameState,target)}else{return null}};// Overrides to pause tile loading when requests are paused
11
+ OlTileQueue.prototype.superLoadMoreTiles=OlTileQueue.prototype.loadMoreTiles;OlTileQueue.prototype.loadMoreTiles=function(maxTotalLoading,maxNewLoads){if(!this.requestsPaused_){this.superLoadMoreTiles(maxTotalLoading,maxNewLoads)}};OlTileQueue.prototype.setRequestsPaused=function(paused){this.requestsPaused_=paused};
package/package.json ADDED
@@ -0,0 +1,135 @@
1
+ {
2
+ "name": "qwc2",
3
+ "version": "2025.03.31",
4
+ "description": "QGIS Web Client",
5
+ "author": "Sourcepole AG",
6
+ "license": "BSD-2-Clause",
7
+ "repository": "git@github.com:qgis/qwc2.git",
8
+ "homepage": "https://https://qwc-services.github.io/",
9
+ "bugs": {
10
+ "url": "https://github.com/qgis/qwc2/issues"
11
+ },
12
+ "keywords": [
13
+ "qgis",
14
+ "webgis",
15
+ "mapping",
16
+ "geospatial"
17
+ ],
18
+ "dependencies": {
19
+ "@furkot/webfonts-generator": "^2.0.2",
20
+ "@giro3d/giro3d": "^0.42.2",
21
+ "@kayahr/text-encoding": "^2.0.0",
22
+ "@loaders.gl/core": "^4.3.3",
23
+ "@loaders.gl/shapefile": "^4.3.3",
24
+ "@loaders.gl/zip": "^4.3.3",
25
+ "@panoramax/web-viewer": "^3.2.3",
26
+ "@reduxjs/toolkit": "^2.4.0",
27
+ "@turf/buffer": "^6.5.0",
28
+ "@turf/helpers": "^6.5.0",
29
+ "any-date-parser": "^1.5.4",
30
+ "axios": "^1.7.9",
31
+ "chart.js": "^4.4.7",
32
+ "classnames": "^2.5.1",
33
+ "clone": "^2.1.2",
34
+ "dayjs": "^1.11.13",
35
+ "deepmerge": "^4.3.1",
36
+ "diacritics": "^1.3.0",
37
+ "fast-xml-parser": "^4.5.0",
38
+ "file-saver": "^2.0.5",
39
+ "flat": "^6.0.1",
40
+ "formdata-json": "^1.0.0",
41
+ "geojson-bounding-box": "^0.2.0",
42
+ "html-react-parser": "^5.2.0",
43
+ "ismobilejs": "^1.1.1",
44
+ "js-yaml": "^4.1.0",
45
+ "jszip": "^3.10.1",
46
+ "lodash.isempty": "^4.4.0",
47
+ "lodash.isequal": "^4.5.0",
48
+ "lodash.omit": "^4.5.0",
49
+ "mime-to-extensions": "^1.0.2",
50
+ "mkdirp": "^3.0.1",
51
+ "mousetrap": "^1.6.5",
52
+ "nearley": "^2.20.1",
53
+ "object-path": "^0.11.8",
54
+ "ol": "^10.3.1",
55
+ "ol-ext": "^4.0.24",
56
+ "ol-mapbox-style": "^12.3.5",
57
+ "painterro": "^1.2.87",
58
+ "path-browserify": "^1.0.1",
59
+ "pdf-lib": "^1.17.1",
60
+ "pdfjs-dist": "^4.9.155",
61
+ "point-in-polygon": "^1.1.0",
62
+ "polygon-intersect-test": "^1.0.1",
63
+ "proj4": "^2.15.0",
64
+ "prop-types": "^15.8.1",
65
+ "qrcode.react": "^4.1.0",
66
+ "randomcolor": "^0.6.2",
67
+ "react": "^18.3.1",
68
+ "react-chartjs-2": "^5.2.0",
69
+ "react-dom": "^18.3.1",
70
+ "react-google-recaptcha": "^3.1.0",
71
+ "react-redux": "^9.1.2",
72
+ "react-reverse-portal": "^2.1.2",
73
+ "react-rnd": "^10.4.13",
74
+ "react-share": "^5.1.1",
75
+ "react-sortablejs": "^1.5.1",
76
+ "react-swipeable": "^7.0.2",
77
+ "redux-logger": "^3.0.6",
78
+ "reselect": "^5.1.1",
79
+ "simplepolygon": "^1.2.3",
80
+ "sortablejs": "^1.15.6",
81
+ "suncalc": "^1.9.0",
82
+ "svgpath": "^2.6.0",
83
+ "three": "^0.170.0",
84
+ "three-csg-ts": "^3.2.0",
85
+ "url": "^0.11.4",
86
+ "utif": "^3.1.0",
87
+ "uuid": "^11.0.3"
88
+ },
89
+ "devDependencies": {
90
+ "@babel/cli": "^7.27.0",
91
+ "@babel/core": "^7.26.0",
92
+ "@babel/eslint-parser": "^7.25.9",
93
+ "@babel/plugin-transform-class-properties": "^7.25.9",
94
+ "@babel/plugin-transform-object-rest-spread": "^7.25.9",
95
+ "@babel/preset-env": "^7.26.0",
96
+ "@babel/preset-react": "^7.26.3",
97
+ "@microsoft/eslint-formatter-sarif": "^3.1.0",
98
+ "@types/react": "^18.3.1",
99
+ "babel-loader": "^9.2.1",
100
+ "babel-plugin-transform-react-remove-prop-types": "^0.4.24",
101
+ "clean-webpack-plugin": "^4.0.0",
102
+ "copy-webpack-plugin": "^12.0.2",
103
+ "css-loader": "^7.1.2",
104
+ "eslint": "^8.56.0",
105
+ "eslint-plugin-perfectionist": "^2.10.0",
106
+ "eslint-plugin-react": "^7.37.2",
107
+ "html-webpack-plugin": "^5.6.3",
108
+ "react-docgen": "^5.4.3",
109
+ "source-map-loader": "^5.0.0",
110
+ "style-loader": "^4.0.0",
111
+ "typescript": "^5.7.2",
112
+ "webpack": "^5.97.1",
113
+ "webpack-bundle-size-analyzer": "^3.1.0",
114
+ "webpack-cli": "^5.1.4",
115
+ "webpack-dev-server": "^5.1.0"
116
+ },
117
+ "bin": {
118
+ "qwc_build_iconfont": "./scripts/makeIconkit.js",
119
+ "qwc_gen_themesconfig": "./scripts/themesConfig.js",
120
+ "qwc_update_translations": "./scripts/updateTranslations.js"
121
+ },
122
+ "scripts": {
123
+ "prod": "npm run tsupdate && npm run themesconfig && npm run iconfont && webpack --mode production --progress",
124
+ "start": "npm run tsupdate && npm run themesconfig && npm run iconfont && webpack serve --mode development --progress --host 0.0.0.0 --port 8081",
125
+ "iconfont": "node scripts/makeIconkit.js",
126
+ "themesconfig": "node scripts/themesConfig.js || :",
127
+ "tsupdate": "node scripts/updateTranslations.js",
128
+ "plugindoc": "node scripts/gen-plugin-docs.js",
129
+ "dist": "./scripts/dist.sh",
130
+ "build": "npm run prod",
131
+ "publish": "npx babel . --copy-files --only \"actions,components,libs,plugins,reducers,selectors,stores,utils\" --out-dir dist --extensions \".js,.jsx\" && npm publish",
132
+ "analyze": "webpack --mode production --json | webpack-bundle-size-analyzer",
133
+ "release": "node -e \"process.exit(require('os').platform() === 'win32' ? 0 : 1)\" && scripts\\package-commands.bat release || ./scripts/package-commands.sh release"
134
+ }
135
+ }
package/plugins/API.js ADDED
@@ -0,0 +1,114 @@
1
+ function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}function ownKeys(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);r&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),t.push.apply(t,o)}return t}function _objectSpread(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?ownKeys(Object(t),!0).forEach(function(r){_defineProperty(e,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):ownKeys(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))})}return e}function _slicedToArray(r,e){return _arrayWithHoles(r)||_iterableToArrayLimit(r,e)||_unsupportedIterableToArray(r,e)||_nonIterableRest()}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(r,a){if(r){if("string"==typeof r)return _arrayLikeToArray(r,a);var t={}.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(r):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(r,a):void 0}}function _arrayLikeToArray(r,a){(null==a||a>r.length)&&(a=r.length);for(var e=0,n=Array(a);e<a;e++)n[e]=r[e];return n}function _iterableToArrayLimit(r,l){var t=null==r?null:"undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(null!=t){var e,n,i,u,a=[],f=!0,o=!1;try{if(i=(t=t.call(r)).next,0===l){if(Object(t)!==t)return;f=!1}else for(;!(f=(e=i.call(t)).done)&&(a.push(e.value),a.length!==l);f=!0);}catch(r){o=!0,n=r}finally{try{if(!f&&null!=t["return"]&&(u=t["return"](),Object(u)!==u))return}finally{if(o)throw n}}return a}}function _arrayWithHoles(r){if(Array.isArray(r))return r}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o)}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function _callSuper(t,o,e){return o=_getPrototypeOf(o),_possibleConstructorReturn(t,_isNativeReflectConstruct()?Reflect.construct(o,e||[],_getPrototypeOf(t).constructor):o.apply(t,e))}function _possibleConstructorReturn(t,e){if(e&&("object"==_typeof(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(t)}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(_isNativeReflectConstruct=function _isNativeReflectConstruct(){return!!t})()}function _getPrototypeOf(t){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},_getPrototypeOf(t)}function _inherits(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_setPrototypeOf(t,e)}function _setPrototypeOf(t,e){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},_setPrototypeOf(t,e)}function _defineProperty(e,r,t){return(r=_toPropertyKey(r))in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+""}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}/**
2
+ * Copyright 2020-2024 Sourcepole AG
3
+ * All rights reserved.
4
+ *
5
+ * This source code is licensed under the BSD-style license found in the
6
+ * LICENSE file in the root directory of this source tree.
7
+ */import React from"react";import{connect}from"react-redux";import axios from"axios";import ol from"openlayers";import PropTypes from"prop-types";import*as uuid from"uuid";import*as displayActions from"../actions/display";import*as editingActions from"../actions/editing";import{LayerRole}from"../actions/layers";import*as layerActions from"../actions/layers";import{registerCustomPlugin,unregisterCustomPlugin}from"../actions/localConfig";import*as localeActions from"../actions/locale";import*as locateActions from"../actions/locate";import*as mapActions from"../actions/map";import*as taskActions from"../actions/task";import*as themeActions from"../actions/theme";import*as windowsActions from"../actions/windows";import AppMenu from"../components/AppMenu";import AttributeForm from"../components/AttributeForm";import AutoEditForm from"../components/AutoEditForm";import CoordinateDisplayer from"../components/CoordinateDisplayer";import EditComboField from"../components/EditComboField";import EditUploadField from"../components/EditUploadField";import FullscreenSwitcher from"../components/FullscreenSwitcher";import Icon from"../components/Icon";import IdentifyViewer from"../components/IdentifyViewer";import ImportLayer from"../components/ImportLayer";import LayerInfoWindow from"../components/LayerInfoWindow";import LinkFeatureForm from"../components/LinkFeatureForm";import MapSelection from"../components/MapSelection";import NumericInputWindow from"../components/NumericInputWindow";import PickFeature from"../components/PickFeature";import PluginsContainer from"../components/PluginsContainer";import PrintSelection from"../components/PrintSelection";import QtDesignerForm from"../components/QtDesignerForm";import ResizeableWindow from"../components/ResizeableWindow";import SearchBox from"../components/SearchBox";import ServiceInfoWindow from"../components/ServiceInfoWindow";import SideBar from"../components/SideBar";import{Swipeable}from"../components/Swipeable";import TaskBar from"../components/TaskBar";import ThemeLayersListWindow from"../components/ThemeLayersListWindow";import ThemeList from"../components/ThemeList";import Toolbar from"../components/Toolbar";import ShareLink from"../components/share/ShareLink";import ShareQRCode from"../components/share/ShareQRCode";import ShareSocials from"../components/share/ShareSocials";import FixedTimeline from"../components/timeline/FixedTimeline";import InfiniteTimeline from"../components/timeline/InfiniteTimeline";import TimelineFeaturesSlider from"../components/timeline/TimelineFeaturesSlider";import AccordeonWidget from"../components/widgets/AccordeonWidget";import ButtonBar from"../components/widgets/ButtonBar";import ColorButton from"../components/widgets/ColorButton";import ComboBox from"../components/widgets/ComboBox";import CopyButton from"../components/widgets/CopyButton";import DateTimeInput from"../components/widgets/DateTimeInput";import EditableSelect from"../components/widgets/EditableSelect";import FileSelector from"../components/widgets/FileSelector";import Input from"../components/widgets/Input";import InputContainer from"../components/widgets/InputContainer";import LayerCatalogWidget from"../components/widgets/LayerCatalogWidget";import MenuButton from"../components/widgets/MenuButton";import ModalDialog from"../components/widgets/ModalDialog";import NavBar from"../components/widgets/NavBar";import NumberInput from"../components/widgets/NumberInput";import PopupMenu from"../components/widgets/PopupMenu";import{Image}from"../components/widgets/Primitives";import SearchWidget from"../components/widgets/SearchWidget";import Spinner from"../components/widgets/Spinner";import SuggestionInput from"../components/widgets/SuggestionInput";import TextInput from"../components/widgets/TextInput";import ToggleSwitch from"../components/widgets/ToggleSwitch";import VectorLayerPicker from"../components/widgets/VectorLayerPicker";import ConfigUtils from"../utils/ConfigUtils";import CoordinatesUtils from"../utils/CoordinatesUtils";import EditingInterface from"../utils/EditingInterface";import*as EditingUtils from"../utils/EditingUtils";import LayerUtils from"../utils/LayerUtils";import LocaleUtils from"../utils/LocaleUtils";import MapUtils from"../utils/MapUtils";import*as PermaLinkUtils from"../utils/PermaLinkUtils";import{SearchResultType}from"../utils/SearchProviders";import ServiceLayerUtils from"../utils/ServiceLayerUtils";import VectorLayerUtils from"../utils/VectorLayerUtils";/**
8
+ * Exposes an API for interacting with QWC2 via `window.qwc2`.
9
+ *
10
+ * You can interact with the API as soon as the `QWC2ApiReady` event is dispatched.
11
+ *
12
+ * For example:
13
+ *
14
+ * ```
15
+ * window.addEventListener("QWC2ApiReady", () => {
16
+ * const {React} = window.qwc2.libs;
17
+ *
18
+ * class MyPlugin extends React.Component {
19
+ * render() {
20
+ * return React.createElement("div", {}, "Hello World");
21
+ * }
22
+ * }
23
+ *
24
+ * window.qwc2.addPlugin("MyPlugin", MyPlugin);
25
+ * });
26
+ * ```
27
+ *
28
+ * All following action functions are available:
29
+ *
30
+ * - [display](https://github.com/qgis/qwc2/blob/master/actions/display.js)
31
+ * - [editing](https://github.com/qgis/qwc2/blob/master/actions/editing.js)
32
+ * - [layers](https://github.com/qgis/qwc2/blob/master/actions/layers.js)
33
+ * - [locate](https://github.com/qgis/qwc2/blob/master/actions/locate.js)
34
+ * - [map](https://github.com/qgis/qwc2/blob/master/actions/map.js)
35
+ * - [task](https://github.com/qgis/qwc2/blob/master/actions/task.js)
36
+ * - [theme](https://github.com/qgis/qwc2/blob/master/actions/theme.js)
37
+ * - [windows](https://github.com/qgis/qwc2/blob/master/actions/windows.js)
38
+ *
39
+ * I.e. `setCurrentTask` is available via `window.qwc2.setCurrentTask`.
40
+ *
41
+ * Some of the core libraries (React, axios, ol, ...) are accessible via `window.qwc2.libs`.
42
+ *
43
+ * In addition, the following methods are available on `window.qwc2`:
44
+ */var API=/*#__PURE__*/function(_React$Component){function API(){var _this;_classCallCheck(this,API);for(var _len=arguments.length,args=new Array(_len),_key=0;_key<_len;_key++){args[_key]=arguments[_key]}_this=_callSuper(this,API,[].concat(args));/**
45
+ * Add custom plugin
46
+ *
47
+ * * `name`: An identifier
48
+ * * `plugin`: The plugin component class
49
+ * * `translations`: The plugin translation messages: `{"<lang>": {<messages>}, ...}`
50
+ */_defineProperty(_this,"addPlugin",function(name,plugin){var translations=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};window.qwc2.__customPlugins[name]=plugin;window.qwc2.addTranslations(translations);_this.props.registerCustomPlugin(name)});/**
51
+ * Remove custom plugin
52
+ *
53
+ * * `name`: The identifier
54
+ */_defineProperty(_this,"removePlugin",function(name){_this.props.unregisterCustomPlugin(name);delete window.qwc2.__customPlugins[name]});/**
55
+ * Add custom attribute calculator
56
+ * (i.e. computed attributes which are added to GetFeatureInfo responses).
57
+ *
58
+ * * `name`: An identifier
59
+ * * `calcFunc`: The calculator function with signature `function(layer, feature)`
60
+ *
61
+ * The `calcFunc` should return either a two-enty `[name, value]` pair or a one-value `[value]` array.
62
+ */_defineProperty(_this,"addIdentifyAttributeCalculator",function(name,calcFunc){window.qwc2.__attributeCalculators[name]=calcFunc});/**
63
+ * Remove custom identify attribute calculator
64
+ *
65
+ * * `name`: The identifier
66
+ */_defineProperty(_this,"removeIdentifyAttributeCalculator",function(name){delete window.qwc2.__attributeCalculators[name]});/**
67
+ * Add custom identify exporter
68
+ *
69
+ * * `name`: An identifier
70
+ * * `exporterFunc`: The exporter configuration
71
+ *
72
+ * The exporter configuration is an object of the shape
73
+ *
74
+ * ```
75
+ * {
76
+ * id: "<id>",
77
+ * title: "<title>",
78
+ * allowClipboard: <true|false>,
79
+ * export: (features, callback) => {
80
+ * callback({
81
+ * data: <blob>, type: "<mimeType>", filename: "<filename>"
82
+ * });
83
+ * }
84
+ * }
85
+ * ```
86
+ */_defineProperty(_this,"addIdentifyExporter",function(name,exporterConfig){window.qwc2.__identifyExportes[name]=exporterConfig});/**
87
+ * Remove identify exporter
88
+ *
89
+ * * `name`: The identifier
90
+ */_defineProperty(_this,"removeIdentifyExporter",function(name){delete window.qwc2.__identifyExportes[name]});/*
91
+ * Convenience method for adding an external layer.
92
+ *
93
+ * * `resource`: An external resource of the form `wms:<service_url>#<layername>` or `wmts:<capabilities_url>#<layername>`.
94
+ * * `beforeLayerName`: Insert the new layer before the layer with the specified name. If `null` or the layer does not exist, the layer is inserted on top.
95
+ * * `sublayers`: Whether to import the sublayer structure (`true`) or just a flat layer (`false`).
96
+ */_defineProperty(_this,"addExternalLayer",function(resource){var beforeLayerName=arguments.length>1&&arguments[1]!==undefined?arguments[1]:null;var sublayers=arguments.length>2&&arguments[2]!==undefined?arguments[2]:true;var params=LayerUtils.splitLayerUrlParam(resource);ServiceLayerUtils.findLayers(params.type,params.url,[params],_this.props.mapCrs,function(id,layer){if(layer){if(sublayers===false){layer.sublayers=null}_this.props.addLayer(layer,null,beforeLayerName)}})});/**
97
+ * Deprecated, use `window.qwc2.drawGeometry` instead.
98
+ */_defineProperty(_this,"drawScratch",function(geomType,message,drawMultiple,callback){var style=arguments.length>4&&arguments[4]!==undefined?arguments[4]:null;/* eslint-disable-next-line */console.warn("window.qwc2.drawScratch is deprecated, use window.qwc2.drawGeometry instead");_this.props.setCurrentTask("ScratchDrawing",null,null,{geomType:geomType,message:message,drawMultiple:drawMultiple,callback:callback,style:style})});/**
99
+ * Draw geometries, and return these as GeoJSON to the calling application.
100
+ *
101
+ * * `geomType`: `Point`, `LineString`, `Polygon`, `Circle` or `Box`.
102
+ * * `message`: A descriptive string to display in the tool taskbar.
103
+ * * `callback`: A `function(result, crs)`, the `result` being an array of GeoJSON features, and `crs` the projection of the feature coordinates.
104
+ * * `options`: Optional configuration:
105
+ * * `drawMultiple`: Whether to allow drawing multiple geometries (default: `false`).
106
+ * * `style`: A custom style object to use for the drawn features, in the same format as `DEFAULT_FEATURE_STYLE` in `qwc2/utils/FeatureStyles.js`.
107
+ * * `initialFeatures`: Array of initial geometries.
108
+ * * `snapping`: Whether snapping is available while drawing (default: `false`).
109
+ * * `snappingActive`: Whether snapping is initially active (default: `false`)
110
+ */_defineProperty(_this,"drawGeometry",function(geomType,message,callback){var options=arguments.length>3&&arguments[3]!==undefined?arguments[3]:{};_this.props.setCurrentTask("ScratchDrawing",null,null,{callback:callback,geomType:geomType,message:message,drawMultiple:options.drawMultiple||false,style:options.style,snapping:options.snapping||false,snappingActive:options.snappingActive||false,initialFeatures:options.initialFeatures})});/**
111
+ * Return the current application state.
112
+ */_defineProperty(_this,"getState",function(){return _this.props.state});return _this}_inherits(API,_React$Component);return _createClass(API,[{key:"componentDidMount",value:function componentDidMount(){window.qwc2={__customPlugins:{},__attributeCalculators:{},__identifyExportes:{}};// Auto-binded functions
113
+ for(var _i=0,_Object$keys=Object.keys(this.props);_i<_Object$keys.length;_i++){var prop=_Object$keys[_i];window.qwc2[prop]=this.props[prop]}// Additional exports
114
+ window.qwc2.LayerRole=LayerRole;window.qwc2.addPlugin=this.addPlugin;window.qwc2.removePlugin=this.removePlugin;window.qwc2.addIdentifyAttributeCalculator=this.addIdentifyAttributeCalculator;window.qwc2.removeIdentifyAttributeCalculator=this.removeIdentifyAttributeCalculator;window.qwc2.addIdentifyExporter=this.addIdentifyExporter;window.qwc2.removeIdentifyExporter=this.removeIdentifyExporter;window.qwc2.addExternalLayer=this.addExternalLayer;window.qwc2.drawScratch=this.drawScratch;window.qwc2.drawGeometry=this.drawGeometry;window.qwc2.getState=this.getState;window.qwc2.ConfigUtils=ConfigUtils;window.qwc2.CoordinatesUtils=CoordinatesUtils;window.qwc2.EditingInterface=EditingInterface;window.qwc2.EditingUtils=EditingUtils;window.qwc2.LocaleUtils=LocaleUtils;window.qwc2.MapUtils=MapUtils;window.qwc2.PermaLinkUtils=PermaLinkUtils;window.qwc2.SearchResultType=SearchResultType;window.qwc2.VectorLayerUtils=VectorLayerUtils;window.qwc2.libs={};window.qwc2.libs.axios=axios;window.qwc2.libs.React=React;window.qwc2.libs.PropTypes=PropTypes;window.qwc2.libs.connect=connect;window.qwc2.libs.ol=ol;window.qwc2.libs.uuid=uuid;window.qwc2.components={};window.qwc2.components.AppMenu=AppMenu;window.qwc2.components.AttributeForm=AttributeForm;window.qwc2.components.AutoEditForm=AutoEditForm;window.qwc2.components.CoordinateDisplayer=CoordinateDisplayer;window.qwc2.components.EditComboField=EditComboField;window.qwc2.components.EditUploadField=EditUploadField;window.qwc2.components.FullscreenSwitcher=FullscreenSwitcher;window.qwc2.components.Icon=Icon;window.qwc2.components.IdentifyViewer=IdentifyViewer;window.qwc2.components.ImportLayer=ImportLayer;window.qwc2.components.InputContainer=InputContainer;window.qwc2.components.LayerInfoWindow=LayerInfoWindow;window.qwc2.components.LinkFeatureForm=LinkFeatureForm;window.qwc2.components.MapSelection=MapSelection;window.qwc2.components.ModalDialog=ModalDialog;window.qwc2.components.NumericInputWindow=NumericInputWindow;window.qwc2.components.PickFeature=PickFeature;window.qwc2.components.PluginsContainer=PluginsContainer;window.qwc2.components.PopupMenu=PopupMenu;window.qwc2.components.PrintSelection=PrintSelection;window.qwc2.components.QtDesignerForm=QtDesignerForm;window.qwc2.components.ResizeableWindow=ResizeableWindow;window.qwc2.components.SearchBox=SearchBox;window.qwc2.components.ServiceInfoWindow=ServiceInfoWindow;window.qwc2.components.ShareLink=ShareLink;window.qwc2.components.ShareQRCode=ShareQRCode;window.qwc2.components.ShareSocials=ShareSocials;window.qwc2.components.SideBar=SideBar;window.qwc2.components.Spinner=Spinner;window.qwc2.components.Swipeable=Swipeable;window.qwc2.components.TaskBar=TaskBar;window.qwc2.components.ThemeLayersListWindow=ThemeLayersListWindow;window.qwc2.components.ThemeList=ThemeList;window.qwc2.components.FixedTimeline=FixedTimeline;window.qwc2.components.InfiniteTimeline=InfiniteTimeline;window.qwc2.components.TimelineFeaturesSlider=TimelineFeaturesSlider;window.qwc2.components.Toolbar=Toolbar;window.qwc2.components.AccordeonWidget=AccordeonWidget;window.qwc2.components.ButtonBar=ButtonBar;window.qwc2.components.ColorButton=ColorButton;window.qwc2.components.ComboBox=ComboBox;window.qwc2.components.CopyButton=CopyButton;window.qwc2.components.DateTimeInput=DateTimeInput;window.qwc2.components.EditableSelect=EditableSelect;window.qwc2.components.FileSelector=FileSelector;window.qwc2.components.Input=Input;window.qwc2.components.LayerCatalogWidget=LayerCatalogWidget;window.qwc2.components.MenuButton=MenuButton;window.qwc2.components.NavBar=NavBar;window.qwc2.components.NumberInput=NumberInput;window.qwc2.components.Image=Image;window.qwc2.components.SearchWidget=SearchWidget;window.qwc2.components.SuggestionInput=SuggestionInput;window.qwc2.components.TextInput=TextInput;window.qwc2.components.ToggleSwitch=ToggleSwitch;window.qwc2.components.VectorLayerPicker=VectorLayerPicker;window.dispatchEvent(new Event("QWC2ApiReady"))}},{key:"render",value:function render(){return null}}])}(React.Component);_defineProperty(API,"propTypes",{addLayer:PropTypes.func,mapCrs:PropTypes.string,registerCustomPlugin:PropTypes.func,setCurrentTask:PropTypes.func,state:PropTypes.object,unregisterCustomPlugin:PropTypes.func});function extractFunctions(obj){return Object.entries(obj).reduce(function(result,_ref){var _ref2=_slicedToArray(_ref,2),key=_ref2[0],value=_ref2[1];if(typeof value==="function"){result[key]=value}return result},{})}export default connect(function(state){return{mapCrs:state.map.projection,state:state}},_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({registerCustomPlugin:registerCustomPlugin,unregisterCustomPlugin:unregisterCustomPlugin},extractFunctions(displayActions)),extractFunctions(editingActions)),extractFunctions(layerActions)),extractFunctions(localeActions)),extractFunctions(locateActions)),extractFunctions(mapActions)),extractFunctions(taskActions)),extractFunctions(themeActions)),extractFunctions(windowsActions)))(API);
@@ -0,0 +1,25 @@
1
+ function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}function _slicedToArray(r,e){return _arrayWithHoles(r)||_iterableToArrayLimit(r,e)||_unsupportedIterableToArray(r,e)||_nonIterableRest()}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _iterableToArrayLimit(r,l){var t=null==r?null:"undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(null!=t){var e,n,i,u,a=[],f=!0,o=!1;try{if(i=(t=t.call(r)).next,0===l){if(Object(t)!==t)return;f=!1}else for(;!(f=(e=i.call(t)).done)&&(a.push(e.value),a.length!==l);f=!0);}catch(r){o=!0,n=r}finally{try{if(!f&&null!=t["return"]&&(u=t["return"](),Object(u)!==u))return}finally{if(o)throw n}}return a}}function _arrayWithHoles(r){if(Array.isArray(r))return r}function _toConsumableArray(r){return _arrayWithoutHoles(r)||_iterableToArray(r)||_unsupportedIterableToArray(r)||_nonIterableSpread()}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(r,a){if(r){if("string"==typeof r)return _arrayLikeToArray(r,a);var t={}.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(r):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(r,a):void 0}}function _iterableToArray(r){if("undefined"!=typeof Symbol&&null!=r[Symbol.iterator]||null!=r["@@iterator"])return Array.from(r)}function _arrayWithoutHoles(r){if(Array.isArray(r))return _arrayLikeToArray(r)}function _arrayLikeToArray(r,a){(null==a||a>r.length)&&(a=r.length);for(var e=0,n=Array(a);e<a;e++)n[e]=r[e];return n}function _extends(){return _extends=Object.assign?Object.assign.bind():function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var r in t)({}).hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},_extends.apply(null,arguments)}function ownKeys(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);r&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),t.push.apply(t,o)}return t}function _objectSpread(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?ownKeys(Object(t),!0).forEach(function(r){_defineProperty(e,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):ownKeys(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))})}return e}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o)}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function _callSuper(t,o,e){return o=_getPrototypeOf(o),_possibleConstructorReturn(t,_isNativeReflectConstruct()?Reflect.construct(o,e||[],_getPrototypeOf(t).constructor):o.apply(t,e))}function _possibleConstructorReturn(t,e){if(e&&("object"==_typeof(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(t)}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(_isNativeReflectConstruct=function _isNativeReflectConstruct(){return!!t})()}function _getPrototypeOf(t){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},_getPrototypeOf(t)}function _inherits(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_setPrototypeOf(t,e)}function _setPrototypeOf(t,e){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},_setPrototypeOf(t,e)}function _defineProperty(e,r,t){return(r=_toPropertyKey(r))in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+""}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}/**
2
+ * Copyright 2024 Sourcepole AG
3
+ * All rights reserved.
4
+ *
5
+ * This source code is licensed under the BSD-style license found in the
6
+ * LICENSE file in the root directory of this source tree.
7
+ */import React from"react";import{connect}from"react-redux";import FileSaver from"file-saver";import isEmpty from"lodash.isempty";import PropTypes from"prop-types";import{LayerRole,addLayerFeatures,removeLayer}from"../actions/layers";import{zoomToExtent,zoomToPoint}from"../actions/map";import{setCurrentTask,setCurrentTaskBlocked}from"../actions/task";import EditComboField,{KeyValCache}from"../components/EditComboField";import EditUploadField from"../components/EditUploadField";import Icon from"../components/Icon";import ResizeableWindow from"../components/ResizeableWindow";import NavBar from"../components/widgets/NavBar";import NumberInput from"../components/widgets/NumberInput";import ReCaptchaWidget from"../components/widgets/ReCaptchaWidget";import Spinner from"../components/widgets/Spinner";import TextInput from"../components/widgets/TextInput";import ConfigUtils from"../utils/ConfigUtils";import CoordinatesUtils from"../utils/CoordinatesUtils";import EditingInterface from"../utils/EditingInterface";import{ExpressionFeatureCache,parseExpression,getFeatureTemplate}from"../utils/EditingUtils";import LayerUtils from"../utils/LayerUtils";import LocaleUtils from"../utils/LocaleUtils";import MapUtils from"../utils/MapUtils";import VectorLayerUtils from"../utils/VectorLayerUtils";import"./style/AttributeTable.css";/**
8
+ * Displaying the attribute table of layers in a dialog.
9
+ *
10
+ * To make a layer available in the attribute table, create a a data resource and matching permissions for it in the `qwc-admin-gui`.
11
+ *
12
+ * The attribute table works for both read-only as well as read-write data resources.
13
+ *
14
+ * This plugin queries the dataset via the editing service specified by
15
+ * `editServiceUrl` in `config.json` (by default the `qwc-data-service`).
16
+ */var AttributeTable=/*#__PURE__*/function(_React$Component){function AttributeTable(props){var _this;_classCallCheck(this,AttributeTable);_this=_callSuper(this,AttributeTable,[props]);_defineProperty(_this,"renderSortIndicator",function(field){if(_this.state.sortField&&_this.state.sortField.field===field){return/*#__PURE__*/React.createElement(Icon,{icon:_this.state.sortField.dir>0?"chevron-down":"chevron-up"})}else{return null}});_defineProperty(_this,"renderColumnResizeHandle",function(col,pos){return/*#__PURE__*/React.createElement("span",{className:"attribtable-table-"+pos+"draghandle",onMouseDown:function onMouseDown(ev){return _this.resizeTable(ev,col,true)}})});_defineProperty(_this,"renderRowResizeHandle",function(row,pos){return/*#__PURE__*/React.createElement("span",{className:"attribtable-table-"+pos+"draghandle",onMouseDown:function onMouseDown(ev){return _this.resizeTable(ev,row,false)}})});_defineProperty(_this,"onClose",function(){if(_this.state.changedFeatureIdx===null){_this.setState(AttributeTable.defaultState);_this.props.setCurrentTask(null)}_this.props.removeLayer("__attributetablehighlight")});_defineProperty(_this,"changeSelectedLayer",function(value){_this.setState({selectedLayer:value})});_defineProperty(_this,"reload",function(){var layerName=arguments.length>0&&arguments[0]!==undefined?arguments[0]:null;_this.setState(function(state){var _this$props$filter$fi;var selectedLayer=layerName||state.selectedLayer;KeyValCache.clear();ExpressionFeatureCache.clear();var bbox=_this.state.limitToExtent?_this.props.mapBbox.bounds:null;_this.props.iface.getFeatures(_this.editLayerId(selectedLayer),_this.props.mapCrs,function(result){if(result){var features=result.features||[];_this.setState(function(state2){return{loading:false,features:features,filteredSortedFeatures:_this.filteredSortedFeatures(features,state2),loadedLayer:selectedLayer}})}else{// eslint-disable-next-line
17
+ alert(LocaleUtils.tr("attribtable.loadfailed"));_this.setState({loading:false,features:[],filteredSortedFeatures:[],loadedLayer:""})}},bbox,(_this$props$filter$fi=_this.props.filter.filterParams)===null||_this$props$filter$fi===void 0?void 0:_this$props$filter$fi[selectedLayer],_this.props.filter.filterGeom);return _objectSpread(_objectSpread({},AttributeTable.defaultState),{},{loading:true,selectedLayer:selectedLayer,limitToExtent:state.limitToExtent})})});_defineProperty(_this,"sortBy",function(field){var newState={};if(_this.state.sortField&&_this.state.sortField.field===field){newState={sortField:{field:field,dir:-_this.state.sortField.dir}}}else{newState={sortField:{field:field,dir:1}}}newState.filteredSortedFeatures=_this.filteredSortedFeatures(_this.state.features,_objectSpread(_objectSpread({},_this.state),newState));_this.setState(newState)});_defineProperty(_this,"editLayerId",function(layerId){if(_this.props.theme&&_this.props.theme.editConfig&&_this.props.theme.editConfig[layerId]){return _this.props.theme.editConfig[layerId].editDataset||layerId}return layerId});_defineProperty(_this,"renderField",function(currentEditConfig,field,featureidx,filteredIndex,fielddisabled){var feature=_this.state.features[featureidx];var value=feature.properties[field.id];if(value===undefined||value===null){value=""}var updateField=function updateField(fieldid,val){var emptynull=arguments.length>2&&arguments[2]!==undefined?arguments[2]:false;return _this.updateField(featureidx,filteredIndex,fieldid,val,emptynull)};var constraints=field.constraints||{};var disabled=constraints.readOnly||fielddisabled;var input=null;if(field.type==="boolean"||field.type==="bool"){input=/*#__PURE__*/React.createElement("input",_extends({name:field.id},constraints,{checked:value,disabled:disabled,onChange:function onChange(ev){return updateField(field.id,ev.target.checked)},type:"checkbox"}))}else if(constraints.values||constraints.keyvalrel){var filterExpr=null;if(field.filterExpression){var mapPrefix=(currentEditConfig.editDataset.match(/^[^.]+\./)||[""])[0];filterExpr=parseExpression(field.filterExpression,feature,_this.props.iface,mapPrefix,_this.props.mapCrs,function(){return _this.setState({reevaluate:+new Date})},true)}input=/*#__PURE__*/React.createElement(EditComboField,{editIface:_this.props.iface,fieldId:field.id,filterExpr:filterExpr,keyvalrel:constraints.keyvalrel,name:field.id,readOnly:constraints.readOnly||disabled,required:constraints.required,updateField:updateField,value:value,values:constraints.values})}else if(field.type==="number"){var _constraints$prec,_constraints$step;var precision=(_constraints$prec=constraints.prec)!==null&&_constraints$prec!==void 0?_constraints$prec:0;var step=(_constraints$step=constraints.step)!==null&&_constraints$step!==void 0?_constraints$step:1;input=/*#__PURE__*/React.createElement(NumberInput,{decimals:precision,disabled:disabled,max:constraints.max,min:constraints.min,name:field.id,onChange:function onChange(v){return updateField(field.id,v,true)},readOnly:constraints.readOnly,required:constraints.required,step:step,value:value})}else if(field.type==="date"){// Truncate time portion of ISO date string
18
+ value=value.substr(0,10);input=/*#__PURE__*/React.createElement("input",_extends({disabled:disabled,name:field.id,type:field.type},constraints,{onChange:function onChange(ev){return updateField(field.id,ev.target.value,true)},value:value}))}else if(field.type==="file"){return/*#__PURE__*/React.createElement(EditUploadField,{constraints:constraints,dataset:_this.editLayerId(_this.state.selectedLayer),disabled:disabled,fieldId:field.id,name:field.id,showThumbnails:false,updateField:updateField,updateFile:function updateFile(fieldId,data){_this.changedFiles[fieldId]=data},value:value})}else if(field.type==="text"){var _feature$properties$f;if(((_feature$properties$f=feature.properties[field.id])!==null&&_feature$properties$f!==void 0?_feature$properties$f:null)===null){var _ConfigUtils$getConfi;value=(_ConfigUtils$getConfi=ConfigUtils.getConfigProp("editTextNullValue"))!==null&&_ConfigUtils$getConfi!==void 0?_ConfigUtils$getConfi:""}var updateTextField=function updateTextField(val){if(val!==value){var textNullValue=ConfigUtils.getConfigProp("editTextNullValue");updateField(field.id,textNullValue!==undefined&&val===textNullValue?null:val)}};var addLinkAnchors=ConfigUtils.getConfigProp("editingAddLinkAnchors")!==false;var editTextNullValue=ConfigUtils.getConfigProp("editTextNullValue");input=/*#__PURE__*/React.createElement(TextInput,{addLinkAnchors:addLinkAnchors,clearValue:editTextNullValue,disabled:disabled,multiline:constraints.multiline,name:field.id,onChange:updateTextField,required:constraints.required,value:value})}else{input=/*#__PURE__*/React.createElement("input",_extends({disabled:disabled,name:field.id,type:field.type},constraints,{onChange:function onChange(ev){return updateField(field.id,ev.target.value)},value:value}))}return input});_defineProperty(_this,"addFeature",function(){var editConfig=_this.props.theme.editConfig||{};var currentEditConfig=editConfig[_this.state.loadedLayer];if(!currentEditConfig){return}var hasGeometry=(currentEditConfig||{}).geomType!==null;if(!_this.props.allowAddForGeometryLayers&&hasGeometry){// eslint-disable-next-line
19
+ alert(LocaleUtils.tr("attribtable.geomnoadd"));return}var featureSkel={type:"Feature",geometry:null,properties:currentEditConfig.fields.reduce(function(res,field){if(field.id!=="id"){res[field.id]=field.type==="text"?"":null}return res},{})};var mapPrefix=(currentEditConfig.editDataset.match(/^[^.]+\./)||[""])[0];getFeatureTemplate(currentEditConfig,featureSkel,_this.props.iface,mapPrefix,_this.props.mapCrs,function(feature){_this.setState(function(state){return{features:[].concat(_toConsumableArray(state.features),[feature]),filteredSortedFeatures:[].concat(_toConsumableArray(state.filteredSortedFeatures),[_objectSpread(_objectSpread({},feature),{},{originalIndex:state.features.length})]),filterVal:"",currentPage:Math.floor(state.features.length/state.pageSize),changedFeatureIdx:state.filteredSortedFeatures.length,newFeature:true}});_this.props.setCurrentTaskBlocked(true,LocaleUtils.tr("editing.unsavedchanged"))})});_defineProperty(_this,"deleteSelectedFeatured",function(){_this.setState(function(state){var features=state.filteredSortedFeatures.filter(function(feature){return state.selectedFeatures[feature.id]===true});features.forEach(function(feature){_this.props.iface.deleteFeature(_this.editLayerId(state.selectedLayer),feature.id,function(success){_this.setState(function(state2){var newState={deleteTask:_objectSpread(_objectSpread({},state2.deleteTask),{},{pending:state2.deleteTask.pending.filter(function(entry){return entry!==feature.id}),failed:success?state2.deleteTask.failed:[].concat(_toConsumableArray(state2.deleteTask.failed),[feature.id]),deleted:!success?state2.deleteTask.deleted:[].concat(_toConsumableArray(state2.deleteTask.deleted),[feature.id])})};if(isEmpty(newState.deleteTask.pending)){newState.features=state.features.filter(function(f){return!newState.deleteTask.deleted.includes(f.id)});newState.filteredSortedFeatures=_this.filteredSortedFeatures(newState.features,state);if(!isEmpty(newState.deleteTask.failed)){// eslint-disable-next-line
20
+ alert(LocaleUtils.tr("attribtable.deletefailed"))}newState.deleteTask=null;newState.currentPage=Math.floor((newState.features.length-1)/state.pageSize);newState.selectedFeatures={};newState.confirmDelete=false}return newState})},state.captchaResponse)});return{deleteTask:{pending:features.map(function(feature){return feature.id}),failed:[],deleted:[]}}})});_defineProperty(_this,"updateField",function(featureidx,filteredIdx,fieldid,value,emptynull){_this.props.setCurrentTaskBlocked(true,LocaleUtils.tr("editing.unsavedchanged"));_this.setState(function(state){value=value===""&&emptynull?null:value;var newFeatures=_toConsumableArray(state.features);newFeatures[featureidx]=_objectSpread({},newFeatures[featureidx]);newFeatures[featureidx].properties=_objectSpread(_objectSpread({},newFeatures[featureidx].properties),{},_defineProperty({},fieldid,value));var newfilteredSortedFeatures=_toConsumableArray(state.filteredSortedFeatures);newfilteredSortedFeatures[filteredIdx]=_objectSpread({},newfilteredSortedFeatures[filteredIdx]);newfilteredSortedFeatures[filteredIdx].properties=_objectSpread(_objectSpread({},newfilteredSortedFeatures[filteredIdx].properties),{},_defineProperty({},fieldid,value));var originalFeatureProps=state.originalFeatureProps||_objectSpread({},state.features[featureidx].properties);return{features:newFeatures,filteredSortedFeatures:newfilteredSortedFeatures,changedFeatureIdx:featureidx,originalFeatureProps:originalFeatureProps}})});_defineProperty(_this,"commit",function(){var feature=_objectSpread(_objectSpread({},_this.state.features[_this.state.changedFeatureIdx]),{},{crs:{type:"name",properties:{name:CoordinatesUtils.toOgcUrnCrs(_this.props.mapCrs)}}});var featureData=new FormData;featureData.set("feature",JSON.stringify(feature));Object.entries(_this.changedFiles).forEach(function(_ref){var _ref2=_slicedToArray(_ref,2),key=_ref2[0],value=_ref2[1];return featureData.set("file:"+key,value)});if(_this.state.captchaResponse){featureData.set("g-recaptcha-response",_this.state.captchaResponse)}if(_this.state.newFeature){_this.props.iface.addFeatureMultipart(_this.editLayerId(_this.state.selectedLayer),featureData,function(success,result){return _this.featureCommited(success,result)})}else{_this.props.iface.editFeatureMultipart(_this.editLayerId(_this.state.loadedLayer),feature.id,featureData,function(success,result){return _this.featureCommited(success,result)})}});_defineProperty(_this,"featureCommited",function(success,result){if(!success){// eslint-disable-next-line
21
+ alert(result)}else{_this.changedFiles={};_this.setState(function(state){var newFeatures=_toConsumableArray(state.features);newFeatures[state.changedFeatureIdx]=result;return{features:newFeatures,filteredSortedFeatures:_this.filteredSortedFeatures(newFeatures,state),changedFeatureIdx:null,originalFeatureProps:null,newFeature:false}})}_this.props.setCurrentTaskBlocked(false)});_defineProperty(_this,"discard",function(){var newFeatures=_toConsumableArray(_this.state.features);if(_this.state.newFeature){newFeatures.splice(_this.state.changedFeatureIdx,1)}else{var featureidx=_this.state.changedFeatureIdx;newFeatures[featureidx]=_objectSpread({},newFeatures[featureidx]);newFeatures[featureidx].properties=_this.state.originalFeatureProps}_this.changedFiles={};_this.setState(function(state){return{features:newFeatures,filteredSortedFeatures:_this.filteredSortedFeatures(newFeatures,state),changedFeatureIdx:null,originalFeatureProps:null,newFeature:false}});_this.props.setCurrentTaskBlocked(false)});_defineProperty(_this,"highlightFeatures",function(){var features=[];if(_this.state.highlightedFeature){features.push(_this.state.highlightedFeature)}else if(_this.state.filterVal){features.push.apply(features,_toConsumableArray(Object.values(_this.state.filteredSortedFeatures)))}var layer={id:"__attributetablehighlight",role:LayerRole.SELECTION};_this.props.addLayerFeatures(layer,features.map(function(f){return{id:f.id,geometry:f.geometry}}),true)});_defineProperty(_this,"zoomToSelection",function(){var collection={type:"FeatureCollection",features:_this.state.filteredSortedFeatures.filter(function(feature){return _this.state.selectedFeatures[feature.id]===true&&feature.geometry})};if(!isEmpty(collection.features)){if(collection.features.length===1&&collection.features[0].geometry.type==="Point"){var zoom=MapUtils.computeZoom(_this.props.mapScales,_this.props.zoomLevel);_this.props.zoomToPoint(collection.features[0].geometry.coordinates,zoom,_this.props.mapCrs)}else{_this.props.zoomToExtent(VectorLayerUtils.computeFeatureBBox(collection),_this.props.mapCrs)}}});_defineProperty(_this,"switchToFormEditMode",function(){var editConfig=_this.props.theme.editConfig||{};var currentEditConfig=editConfig[_this.state.loadedLayer];var hasGeometry=(currentEditConfig||{}).geomType!==null;if(!hasGeometry){// eslint-disable-next-line
22
+ alert(LocaleUtils.tr("attribtable.nogeomnoform"));return}var feature=_this.state.filteredSortedFeatures.find(function(f){return _this.state.selectedFeatures[f.id]===true});_this.props.setCurrentTask("Editing",null,null,{layer:_this.state.loadedLayer,feature:feature})});_defineProperty(_this,"updateFilter",function(field,val){var resetPage=arguments.length>2&&arguments[2]!==undefined?arguments[2]:false;_this.setState(function(state){return _defineProperty(_defineProperty(_defineProperty({},field,val),"currentPage",resetPage?0:state.currentPage),"filteredSortedFeatures",_this.filteredSortedFeatures(state.features,_objectSpread(_objectSpread({},state),{},_defineProperty({},field,val))))})});_defineProperty(_this,"filteredSortedFeatures",function(features,state){var filteredFeatures=[];if(!state.filterVal){filteredFeatures=features.map(function(feature,idx){return _objectSpread(_objectSpread({},feature),{},{originalIndex:idx})})}else{var filterVal=state.filterVal.toLowerCase();var test=null;if(state.filterOp==="~"){test=function test(x){return String(x).toLowerCase().includes(filterVal)}}else if(state.filterOp==="="){test=function test(x){return String(x).toLowerCase()===filterVal}}else if(state.filterOp===">"){test=function test(x){return Number(x)>Number(filterVal)}}else if(state.filterOp===">="){test=function test(x){return Number(x)>=Number(filterVal)}}else if(state.filterOp==="<="){test=function test(x){return Number(x)<=Number(filterVal)}}else if(state.filterOp==="<"){test=function test(x){return Number(x)<Number(filterVal)}}// Build value relation lookup
23
+ var editConfig=_this.props.theme.editConfig||{};var currentEditConfig=editConfig[_this.state.loadedLayer];var valueLookup=currentEditConfig.fields.reduce(function(res,field){if(field.constraints&&field.constraints.values){res[field.id]=field.constraints.values.reduce(function(res2,constraint){res2[constraint.value]=constraint.label;return res2},{})}else if(field.constraints&&field.constraints.keyvalrel){res[field.id]=KeyValCache.getSync(field.constraints.keyvalrel).reduce(function(res2,entry){res2[entry.value]=entry.label;return res2},{})}return res},{});var filterFieldValue=state.filterField==="id"?function(feature){return feature.id}:function(feature){var value=feature.properties[state.filterField];return valueLookup[state.filterField]?valueLookup[state.filterField][value]:value};filteredFeatures=features.reduce(function(res,feature,idx){if(test(filterFieldValue(feature))){res.push(_objectSpread(_objectSpread({},feature),{},{originalIndex:idx}))}return res},[])}if(state.sortField){var sortFieldValue=state.sortField.field==="id"?function(feature){return feature.id}:function(feature){return feature.properties[state.sortField.field]};return filteredFeatures.sort(function(f1,f2){var v1=String(sortFieldValue(f1));var v2=String(sortFieldValue(f2));return v1.localeCompare(v2,undefined,{numeric:true,sensitivity:"base"})*state.sortField.dir})}else{return filteredFeatures}});_defineProperty(_this,"resizeTable",function(ev,index,resizeCol){if(_this.table){var element=_this.table.getElementsByTagName(resizeCol?"th":"tr")[index];var initial=0;if(resizeCol){initial=parseFloat(element.style.minWidth.replace(/px$/,""))||element.clientWidth}else{initial=parseFloat(element.style.height.replace(/px$/,""))||element.clientHeight}var resize={anchor:resizeCol?ev.clientX:ev.clientY,element:element,initial:initial};var resizeDo=resizeCol?function(event){var delta=event.clientX-resize.anchor;resize.element.style.minWidth=Math.max(resize.initial+delta,16)+"px";resize.element.style.width=Math.max(resize.initial+delta,16)+"px"}:function(event){var delta=event.clientY-resize.anchor;resize.element.style.height=Math.max(resize.initial+delta,16)+"px"};var eventShield=ev.view.document.createElement("div");eventShield.className="__event_shield";ev.view.document.body.appendChild(eventShield);ev.view.document.body.classList.add(resizeCol?"ewresizing":"nsresizing");ev.view.addEventListener("mousemove",resizeDo);ev.view.addEventListener("mouseup",function(event){event.view.document.body.removeChild(eventShield);event.view.removeEventListener("mousemove",resizeDo);event.view.document.body.classList.remove(resizeCol?"ewresizing":"nsresizing")},{once:true})}});_defineProperty(_this,"csvExport",function(){var editConfig=_this.props.theme.editConfig||{};var currentEditConfig=editConfig[_this.state.loadedLayer];if(!currentEditConfig){return}var fields=currentEditConfig.fields.filter(function(field){return field.id!=="id"});var data="";data+="id,"+fields.map(function(field){return"\"".concat(field.name.replaceAll("\"","\"\""),"\"")}).join(",")+"\n";_this.state.features.forEach(function(feature){data+=feature.id+","+fields.map(function(field){var value=feature.properties[field.id];if(value===null||value===undefined){return"null"}else{return"\"".concat(String(feature.properties[field.id]).replaceAll("\"","\"\""),"\"")}}).join(",")+"\n"});FileSaver.saveAs(new Blob([data],{type:"text/plain;charset=utf-8"}),_this.state.loadedLayer+".csv")});_this.changedFiles={};_this.state=AttributeTable.defaultState;_this.table=null;_this.attribTableContents=null;return _this}_inherits(AttributeTable,_React$Component);return _createClass(AttributeTable,[{key:"componentDidUpdate",value:function componentDidUpdate(prevProps,prevState){if(this.state.newFeature&&!prevState.newFeature){if(this.attribTableContents){this.attribTableContents.scrollTop=this.attribTableContents.scrollHeight}}if(!this.props.active&&prevProps.active){this.setState(AttributeTable.defaultState)}else if(this.props.active&&!prevProps.active&&this.props.taskData&&this.props.taskData.layer){this.reload(this.props.taskData.layer)}// Reload conditions when limited to extent
24
+ if(this.props.active&&this.state.limitToExtent&&this.state.selectedLayer&&(!prevState.limitToExtent||this.props.mapBbox!==prevProps.mapBbox)){this.reload()}else if(this.props.active&&!this.state.limitToExtent&&prevState.limitToExtent){this.reload()}// Highlight feature
25
+ if(this.state.highlightedFeature!==prevState.highlightedFeature||this.state.filteredSortedFeatures!==prevState.filteredSortedFeatures){this.highlightFeatures()}}},{key:"render",value:function render(){var _this2=this;if(!this.props.active){return null}var captchaRequired=ConfigUtils.getConfigProp("editServiceCaptchaSiteKey")&&!ConfigUtils.getConfigProp("username");var captchaPending=captchaRequired&&!this.state.captchaResponse;var editConfig=this.props.theme.editConfig||{};var currentEditConfig=editConfig[this.state.loadedLayer];var editPermissions=(editConfig[this.state.loadedLayer]||{}).permissions||{};var readOnly=editPermissions.updatable===false;var loadOverlay=null;if(this.state.selectedLayer&&this.state.selectedLayer!==this.state.loadedLayer){if(this.state.loading){loadOverlay=/*#__PURE__*/React.createElement("div",{className:"attribtable-overlay"},/*#__PURE__*/React.createElement(Spinner,null),/*#__PURE__*/React.createElement("span",null,LocaleUtils.tr("attribtable.loading")))}else{loadOverlay=/*#__PURE__*/React.createElement("div",{className:"attribtable-overlay"},/*#__PURE__*/React.createElement("span",null,LocaleUtils.tr("attribtable.pleasereload")))}}else if(this.state.selectedLayer&&this.state.deleteTask){loadOverlay=/*#__PURE__*/React.createElement("div",{className:"attribtable-overlay"},/*#__PURE__*/React.createElement(Spinner,null),/*#__PURE__*/React.createElement("span",null,LocaleUtils.tr("attribtable.deleting")))}var table=null;var footbar=null;if(currentEditConfig&&this.state.features){var fields=currentEditConfig.fields.reduce(function(res,field){if(field.id!=="id"){res.push(field)}return res},[]);var indexOffset=this.state.currentPage*this.state.pageSize;var features=this.state.filteredSortedFeatures.slice(indexOffset,indexOffset+this.state.pageSize);table=/*#__PURE__*/React.createElement("table",{className:"attribtable-table",ref:function ref(el){_this2.table=el}},/*#__PURE__*/React.createElement("thead",null,/*#__PURE__*/React.createElement("tr",null,/*#__PURE__*/React.createElement("th",null),/*#__PURE__*/React.createElement("th",{onClick:function onClick(){return _this2.sortBy("id")}},/*#__PURE__*/React.createElement("span",null,/*#__PURE__*/React.createElement("span",{className:"attribtable-table-headername"},"id"),this.renderSortIndicator("id"),this.renderColumnResizeHandle(1,"r"))),fields.map(function(field,idx){return/*#__PURE__*/React.createElement("th",{key:field.id,onClick:function onClick(){return _this2.sortBy(field.id)},title:field.name},/*#__PURE__*/React.createElement("span",null,_this2.renderColumnResizeHandle(idx+1,"l"),/*#__PURE__*/React.createElement("span",{className:"attribtable-table-headername"},field.name),_this2.renderSortIndicator(field.id),idx<fields.length-1?_this2.renderColumnResizeHandle(idx+2,"r"):null))}))),/*#__PURE__*/React.createElement("tbody",null,features.map(function(feature,filteredIndex){var featureidx=feature.originalIndex;var disabled=readOnly||_this2.state.changedFeatureIdx!==null&&_this2.state.changedFeatureIdx!==featureidx;var key=_this2.state.changedFeatureIdx===featureidx&&_this2.state.newFeature?"newfeature":feature.id;return/*#__PURE__*/React.createElement("tr",{className:disabled?"row-disabled":"",key:key,onMouseEnter:function onMouseEnter(){return _this2.setState({highlightedFeature:feature})},onMouseLeave:function onMouseLeave(){return _this2.setState(function(state){return{highlightedFeature:state.highlightedFeature===feature?null:state.highlightedFeature}})}},/*#__PURE__*/React.createElement("td",null,/*#__PURE__*/React.createElement("span",null,filteredIndex>0?_this2.renderRowResizeHandle(filteredIndex,"t"):null,/*#__PURE__*/React.createElement("input",{checked:_this2.state.selectedFeatures[feature.id]===true,onChange:function onChange(ev){return _this2.setState(function(state){return{selectedFeatures:_objectSpread(_objectSpread({},state.selectedFeatures),{},_defineProperty({},feature.id,ev.target.checked))}})},type:"checkbox"}),_this2.renderRowResizeHandle(filteredIndex+1,"b"))),/*#__PURE__*/React.createElement("td",null,feature.id),fields.map(function(field){return/*#__PURE__*/React.createElement("td",{key:field.id},_this2.renderField(currentEditConfig,field,featureidx,indexOffset+filteredIndex,disabled||!!_this2.state.filterVal&&field.id===_this2.state.filterField))}))})));var npages=Math.ceil(this.state.filteredSortedFeatures.length/this.state.pageSize);var pages=[this.state.currentPage];var extraright=Math.max(0,2-this.state.currentPage);var extraleft=Math.max(0,this.state.currentPage-(npages-3));for(var i=0;i<3+extraleft;++i){if(this.state.currentPage-i>0){pages.unshift(this.state.currentPage-i)}}for(var _i=0;_i<3+extraright;++_i){if(this.state.currentPage+_i<npages-1){pages.push(this.state.currentPage-_i+1)}}footbar=/*#__PURE__*/React.createElement("div",{className:"attribtable-footbar"},/*#__PURE__*/React.createElement(NavBar,{currentPage:this.state.currentPage,disabled:this.state.changedFeatureIdx!==null,nPages:npages,pageChanged:function pageChanged(currentPage){return _this2.setState({currentPage:currentPage})},pageSize:this.state.pageSize,pageSizeChanged:function pageSizeChanged(pageSize){return _this2.setState({pageSize:pageSize})}}),/*#__PURE__*/React.createElement("div",{className:"attribtable-filter controlgroup"},/*#__PURE__*/React.createElement(Icon,{icon:"filter"}),/*#__PURE__*/React.createElement("select",{disabled:this.state.changedFeatureIdx!==null,onChange:function onChange(ev){return _this2.updateFilter("filterField",ev.target.value)},value:this.state.filterField},/*#__PURE__*/React.createElement("option",{value:"id"},"id"),fields.map(function(field){return/*#__PURE__*/React.createElement("option",{key:field.id,value:field.id},field.name)})),/*#__PURE__*/React.createElement("select",{disabled:this.state.changedFeatureIdx!==null,onChange:function onChange(ev){return _this2.updateFilter("filterOp",ev.target.value)},value:this.state.filterOp},/*#__PURE__*/React.createElement("option",{value:"~"},"~"),/*#__PURE__*/React.createElement("option",{value:"="},"="),/*#__PURE__*/React.createElement("option",{value:">"},">"),/*#__PURE__*/React.createElement("option",{value:">="},">="),/*#__PURE__*/React.createElement("option",{value:"<="},"<="),/*#__PURE__*/React.createElement("option",{value:"<"},"<")),/*#__PURE__*/React.createElement(TextInput,{disabled:this.state.changedFeatureIdx!==null,onChange:function onChange(value){return _this2.updateFilter("filterVal",value,true)},value:this.state.filterVal})),this.props.showLimitToExtent?/*#__PURE__*/React.createElement("div",null,/*#__PURE__*/React.createElement("label",null,/*#__PURE__*/React.createElement("input",{checked:this.state.limitToExtent,onChange:function onChange(ev){return _this2.setState({limitToExtent:ev.target.checked})},type:"checkbox"})," ",LocaleUtils.tr("attribtable.limittoextent"))):null)}var nolayer=!this.state.selectedLayer;var loading=this.state.loading;var editing=this.state.changedFeatureIdx!==null;var layerChanged=this.state.selectedLayer!==this.state.loadedLayer;var showAddButton=editPermissions.creatable!==false;var showDelButton=editPermissions.deletable!==false;var showEditButton=ConfigUtils.havePlugin("Editing")&&this.props.showEditFormButton;var deleteButton=showDelButton?/*#__PURE__*/React.createElement("button",{className:"button",disabled:layerChanged||editing||!Object.values(this.state.selectedFeatures).find(function(entry){return entry===true}),onClick:function onClick(){return _this2.setState({confirmDelete:true})},title:LocaleUtils.tr("attribtable.deletefeatures")},/*#__PURE__*/React.createElement(Icon,{icon:"trash"})):null;var captchaBar=null;if(captchaRequired&&(this.state.changedFeatureIdx!==null||this.state.confirmDelete)){captchaBar=/*#__PURE__*/React.createElement("div",null,/*#__PURE__*/React.createElement(ReCaptchaWidget,{onChange:function onChange(value){return _this2.setState({captchaResponse:value})},sitekey:ConfigUtils.getConfigProp("editServiceCaptchaSiteKey")}))}return/*#__PURE__*/React.createElement(ResizeableWindow,{dockable:"bottom",icon:"editing",initialHeight:480,initialWidth:800,onClose:this.onClose,splitScreenWhenDocked:true,title:LocaleUtils.tr("attribtable.title")},/*#__PURE__*/React.createElement("div",{className:"attribtable-body",role:"body"},loadOverlay,/*#__PURE__*/React.createElement("div",{className:"attribtable-toolbar"},/*#__PURE__*/React.createElement("select",{disabled:loading||editing,onChange:function onChange(ev){return _this2.changeSelectedLayer(ev.target.value)},value:this.state.selectedLayer||""},/*#__PURE__*/React.createElement("option",{disabled:true,value:""},LocaleUtils.tr("attribtable.selectlayer")),Object.keys(editConfig).map(function(layerId){var layerName=editConfig[layerId].layerName;var match=LayerUtils.searchLayer(_this2.props.layers,"name",layerName,[LayerRole.THEME]);return/*#__PURE__*/React.createElement("option",{key:layerId,value:layerId},match?match.sublayer.title:layerName)})),/*#__PURE__*/React.createElement("button",{className:"button",disabled:editing||nolayer||this.state.loading,onClick:function onClick(){return _this2.reload()},title:LocaleUtils.tr("attribtable.reload")},/*#__PURE__*/React.createElement(Icon,{icon:"refresh"})),showAddButton?/*#__PURE__*/React.createElement("button",{className:"button",disabled:nolayer||editing||loading||layerChanged,onClick:this.addFeature,title:LocaleUtils.tr("attribtable.addfeature")},/*#__PURE__*/React.createElement(Icon,{icon:"plus"})):null,/*#__PURE__*/React.createElement("button",{className:"button",disabled:layerChanged||!Object.values(this.state.selectedFeatures).find(function(entry){return entry===true}),onClick:this.zoomToSelection,title:LocaleUtils.tr("attribtable.zoomtoselection")},/*#__PURE__*/React.createElement(Icon,{icon:"search"})),showEditButton?/*#__PURE__*/React.createElement("button",{className:"button",disabled:layerChanged||editing||Object.values(this.state.selectedFeatures).filter(function(entry){return entry===true}).length!==1,onClick:this.switchToFormEditMode,title:LocaleUtils.tr("attribtable.formeditmode")},/*#__PURE__*/React.createElement(Icon,{icon:"editing"})):null,this.state.confirmDelete?/*#__PURE__*/React.createElement("button",{className:"button button-accept",disabled:captchaPending,onClick:this.deleteSelectedFeatured},/*#__PURE__*/React.createElement(Icon,{icon:"ok"}),/*#__PURE__*/React.createElement("span",null,LocaleUtils.tr("attribtable.delete"))):deleteButton,this.state.confirmDelete?/*#__PURE__*/React.createElement("button",{className:"button button-reject",onClick:function onClick(){return _this2.setState({confirmDelete:false,captchaResponse:null})}},/*#__PURE__*/React.createElement(Icon,{icon:"remove"}),/*#__PURE__*/React.createElement("span",null,LocaleUtils.tr("attribtable.nodelete"))):null,this.state.changedFeatureIdx!==null?/*#__PURE__*/React.createElement("button",{className:"button button-accept",disabled:captchaPending,onClick:this.commit},/*#__PURE__*/React.createElement(Icon,{icon:"ok"}),/*#__PURE__*/React.createElement("span",null,LocaleUtils.tr("attribtable.commit"))):null,this.state.changedFeatureIdx!==null?/*#__PURE__*/React.createElement("button",{className:"button button-reject",onClick:this.discard},/*#__PURE__*/React.createElement(Icon,{icon:"remove"}),/*#__PURE__*/React.createElement("span",null,LocaleUtils.tr("attribtable.discard"))):null,/*#__PURE__*/React.createElement("button",{className:"button",disabled:isEmpty(this.state.features),onClick:function onClick(){return _this2.csvExport()},title:LocaleUtils.tr("attribtable.csvexport")},/*#__PURE__*/React.createElement(Icon,{icon:"export"}))),captchaBar,/*#__PURE__*/React.createElement("div",{className:"attribtable-contents",ref:function ref(el){_this2.attribTableContents=el}},table),footbar))}}])}(React.Component);_defineProperty(AttributeTable,"propTypes",{active:PropTypes.bool,addLayerFeatures:PropTypes.func,/** Whether to allow adding records for datasets which have a geometry column. */allowAddForGeometryLayers:PropTypes.bool,filter:PropTypes.object,iface:PropTypes.object,layers:PropTypes.array,mapBbox:PropTypes.object,mapCrs:PropTypes.string,mapScales:PropTypes.array,removeLayer:PropTypes.func,setCurrentTask:PropTypes.func,setCurrentTaskBlocked:PropTypes.func,/** Whether to show a button to open the edit form for selected layer. Requires the Editing plugin to be enabled. */showEditFormButton:PropTypes.bool,/** Whether to show the "Limit to extent" checkbox */showLimitToExtent:PropTypes.bool,taskData:PropTypes.object,theme:PropTypes.object,/** The zoom level for zooming to point features. */zoomLevel:PropTypes.number,zoomToExtent:PropTypes.func,zoomToPoint:PropTypes.func});_defineProperty(AttributeTable,"defaultProps",{zoomLevel:1000,showEditFormButton:true});_defineProperty(AttributeTable,"defaultState",{loading:false,selectedLayer:"",loadedLayer:"",features:[],filteredSortedFeatures:[],selectedFeatures:{},highlightedFeature:null,changedFeatureIdx:null,originalFeatureProps:null,pageSize:50,currentPage:0,filterField:"id",filterOp:"~",filterVal:"",sortField:null,deleteTask:null,newFeature:false,confirmDelete:false,limitToExtent:false,captchaResponse:""});export default(function(){var iface=arguments.length>0&&arguments[0]!==undefined?arguments[0]:EditingInterface;return connect(function(state){return{active:state.task.id==="AttributeTable",iface:iface,layers:state.layers.flat,filter:state.layers.filter,mapBbox:state.map.bbox,mapCrs:state.map.projection,mapScales:state.map.scales,taskData:state.task.id==="AttributeTable"?state.task.data:null,theme:state.theme.current}},{addLayerFeatures:addLayerFeatures,removeLayer:removeLayer,setCurrentTask:setCurrentTask,setCurrentTaskBlocked:setCurrentTaskBlocked,zoomToExtent:zoomToExtent,zoomToPoint:zoomToPoint})(AttributeTable)});
@@ -0,0 +1,13 @@
1
+ function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o)}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function _callSuper(t,o,e){return o=_getPrototypeOf(o),_possibleConstructorReturn(t,_isNativeReflectConstruct()?Reflect.construct(o,e||[],_getPrototypeOf(t).constructor):o.apply(t,e))}function _possibleConstructorReturn(t,e){if(e&&("object"==_typeof(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(t)}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(_isNativeReflectConstruct=function _isNativeReflectConstruct(){return!!t})()}function _getPrototypeOf(t){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},_getPrototypeOf(t)}function _inherits(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_setPrototypeOf(t,e)}function _setPrototypeOf(t,e){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},_setPrototypeOf(t,e)}function _defineProperty(e,r,t){return(r=_toPropertyKey(r))in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+""}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}/**
2
+ * Copyright 2018-2024 Sourcepole AG
3
+ * All rights reserved.
4
+ *
5
+ * This source code is licensed under the BSD-style license found in the
6
+ * LICENSE file in the root directory of this source tree.
7
+ */import React from"react";import{connect}from"react-redux";import PropTypes from"prop-types";import url from"url";import Icon from"../components/Icon";import ConfigUtils from"../utils/ConfigUtils";import"./style/Authentication.css";/**
8
+ * Handles authentication
9
+ *
10
+ * Invokes the the authentication service specified by `authServiceUrl` in `config.json`.
11
+ */var Authentication=/*#__PURE__*/function(_React$Component){function Authentication(props){var _this;_classCallCheck(this,Authentication);_this=_callSuper(this,Authentication,[props]);_defineProperty(_this,"showLogin",function(){var urlObj=url.parse(window.location.href,true);if(_this.props.clearLayerParam){delete urlObj.query.l}urlObj.search=undefined;window.location.href=ConfigUtils.getConfigProp("authServiceUrl")+"login?url="+encodeURIComponent(url.format(urlObj))});_defineProperty(_this,"resetIdleTimer",function(){if(_this.idleTimer){clearTimeout(_this.idleTimer);_this.idleTimer=setTimeout(_this.idleAutologout,_this.props.idleTimeout*1000)}});_defineProperty(_this,"idleAutologout",function(){var urlObj=url.parse(window.location.href,true);urlObj.search=undefined;var loginUrl=ConfigUtils.getConfigProp("authServiceUrl")+"login?url="+encodeURIComponent(url.format(urlObj));window.location.href=ConfigUtils.getConfigProp("authServiceUrl")+"logout?url="+encodeURIComponent(loginUrl)});_this.idleTimer=null;return _this}_inherits(Authentication,_React$Component);return _createClass(Authentication,[{key:"componentDidMount",value:function componentDidMount(){var username=ConfigUtils.getConfigProp("username");if(this.props.requireLogin&&!username){this.showLogin()}if(this.props.idleTimeout&&username){this.idleTimer=setTimeout(this.idleAutologout,this.props.idleTimeout*1000);window.addEventListener("keydown",this.resetIdleTimer,{passive:true});window.addEventListener("mousedown",this.resetIdleTimer,{passive:true});window.addEventListener("wheel",this.resetIdleTimer,{passive:true})}}},{key:"componentDidUpdate",value:function componentDidUpdate(prevProps){var task=this.props.task;if(task!==prevProps.task){// "Login" and "Logout" task ids are legacy
12
+ if(task.id==="Login"||task.id==="Authentication"&&task.mode==="Login"){this.showLogin()}else if(task==="Logout"||task.id==="Authentication"&&task.mode==="Logout"){// logout and redirect to custom logoutTargetUrl or current location if not set
13
+ window.location.href=ConfigUtils.getConfigProp("authServiceUrl")+"logout?url="+encodeURIComponent(this.props.logoutTargetUrl||window.location.href)}}}},{key:"render",value:function render(){if(!this.props.showLoginUser){return null}var username=ConfigUtils.getConfigProp("username");var style={right:this.props.mapMargins.right};if(!username){return null}return/*#__PURE__*/React.createElement("div",{className:"login-user",style:style},/*#__PURE__*/React.createElement(Icon,{icon:"login"}),/*#__PURE__*/React.createElement("span",null,username))}}])}(React.Component);_defineProperty(Authentication,"availableIn3D",true);_defineProperty(Authentication,"propTypes",{/** Whether to clear the layer parameter from the URL on login. */clearLayerParam:PropTypes.bool,/** An idle timeout in seconds after which the user is automatically logged of. */idleTimeout:PropTypes.number,/** An URL to redirect to on logout, instead of the viewer URL. */logoutTargetUrl:PropTypes.string,mapMargins:PropTypes.object,/** Whether authentication is required, i.e. the viewer automatically redirects to the login page if no user is authenticated. */requireLogin:PropTypes.bool,/** Whether to display the currently logged in user below the application menu button. */showLoginUser:PropTypes.bool,task:PropTypes.object});export default connect(function(state){return{mapMargins:state.windows.mapMargins,task:state.task}},{})(Authentication);