qwc2 2025.11.19 → 2025.11.27

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 (68) hide show
  1. package/components/AppMenu.js +141 -204
  2. package/components/AttributeTableWidget.js +5 -0
  3. package/components/FeatureAttributesWindow.js +1 -2
  4. package/components/FullscreenSwitcher.js +3 -0
  5. package/components/Icon.js +6 -0
  6. package/components/ImportLayer.js +3 -9
  7. package/components/LayerInfoWindow.js +1 -2
  8. package/components/MapButton.js +2 -0
  9. package/components/NumericInputWindow.js +1 -2
  10. package/components/PickFeature.js +1 -1
  11. package/components/PluginsContainer.js +54 -9
  12. package/components/ResizeableWindow.js +18 -9
  13. package/components/SearchBox.js +117 -124
  14. package/components/ServiceInfoWindow.js +1 -2
  15. package/components/StandardApp.js +0 -1
  16. package/components/ThemeLayersListWindow.js +8 -7
  17. package/components/ThemeList.js +7 -2
  18. package/components/WindowManager.js +0 -1
  19. package/components/map/layers/VectorLayer.js +4 -2
  20. package/components/map3d/HeightProfile3D.js +0 -1
  21. package/components/map3d/Map3D.js +1 -1
  22. package/components/map3d/View3DSwitcher.js +2 -1
  23. package/components/map3d/drawtool/NumericInput3D.js +1 -2
  24. package/components/map3d/layers/VectorLayer3D.js +2 -2
  25. package/components/style/App.css +4 -0
  26. package/components/style/AppMenu.css +33 -48
  27. package/components/style/DefaultColorScheme.css +1 -0
  28. package/components/style/PickFeature.css +0 -6
  29. package/components/style/ResizeableWindow.css +0 -4
  30. package/components/style/SearchBox.css +0 -21
  31. package/components/widgets/ColorButton.js +7 -2
  32. package/components/widgets/ComboBox.js +18 -16
  33. package/components/widgets/EditableSelect.js +5 -10
  34. package/components/widgets/LayerCatalogWidget.js +66 -16
  35. package/components/widgets/MenuButton.js +16 -15
  36. package/components/widgets/PopupMenu.js +153 -13
  37. package/components/widgets/ToggleSwitch.js +5 -2
  38. package/components/widgets/style/ComboBox.css +7 -20
  39. package/components/widgets/style/EditableSelect.css +0 -2
  40. package/components/widgets/style/MenuButton.css +1 -17
  41. package/components/widgets/style/PopupMenu.css +20 -0
  42. package/package.json +1 -1
  43. package/plugins/AttributeTable.js +0 -1
  44. package/plugins/BackgroundSwitcher.js +104 -8
  45. package/plugins/Cyclomedia.js +1 -2
  46. package/plugins/FeatureForm.js +3 -6
  47. package/plugins/GeometryDigitizer.js +1 -2
  48. package/plugins/HeightProfile.js +2 -5
  49. package/plugins/Identify.js +2 -5
  50. package/plugins/LayerCatalog.js +2 -13
  51. package/plugins/LayerTree.js +30 -17
  52. package/plugins/MapLegend.js +1 -2
  53. package/plugins/ObjectList.js +0 -1
  54. package/plugins/Panoramax.js +1 -2
  55. package/plugins/Print.js +1 -2
  56. package/plugins/Routing.js +1 -2
  57. package/plugins/TimeManager.js +2 -5
  58. package/plugins/ValueTool.js +1 -2
  59. package/plugins/View3D.js +0 -1
  60. package/plugins/map/MeasurementSupport.js +2 -2
  61. package/plugins/map3d/Identify3D.js +1 -2
  62. package/plugins/map3d/Measure3D.js +21 -12
  63. package/plugins/style/BackgroundSwitcher.css +2 -1
  64. package/plugins/style/LayerTree.css +3 -18
  65. package/static/translations/ca-ES.json +29 -29
  66. package/static/translations/es-ES.json +34 -34
  67. package/utils/MapUtils.js +6 -0
  68. package/utils/MiscUtils.js +12 -0
@@ -1,4 +1,10 @@
1
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); }
2
+ function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }
3
+ 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."); }
4
+ 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; } }
5
+ function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); }
6
+ function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }
7
+ 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; }
2
8
  function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
3
9
  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); } }
4
10
  function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
@@ -30,19 +36,17 @@ import Icon from '../components/Icon';
30
36
  import MapButton from '../components/MapButton';
31
37
  import ConfigUtils from '../utils/ConfigUtils';
32
38
  import LocaleUtils from '../utils/LocaleUtils';
39
+ import MiscUtils from '../utils/MiscUtils';
33
40
  import './style/BackgroundSwitcher.css';
34
41
 
35
42
  /**
36
43
  * Map button for switching the background layer.
37
44
  */
38
45
  export var BackgroundSwitcher = /*#__PURE__*/function (_React$Component) {
39
- function BackgroundSwitcher() {
46
+ function BackgroundSwitcher(props) {
40
47
  var _this;
41
48
  _classCallCheck(this, BackgroundSwitcher);
42
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
43
- args[_key] = arguments[_key];
44
- }
45
- _this = _callSuper(this, BackgroundSwitcher, [].concat(args));
49
+ _this = _callSuper(this, BackgroundSwitcher, [props]);
46
50
  _defineProperty(_this, "state", {
47
51
  visible: false
48
52
  });
@@ -61,10 +65,13 @@ export var BackgroundSwitcher = /*#__PURE__*/function (_React$Component) {
61
65
  key: layer ? layer.name : "empty",
62
66
  onClick: function onClick() {
63
67
  return _this.backgroundLayerClicked(layer);
64
- }
68
+ },
69
+ onKeyDown: _this.KeyNav,
70
+ tabIndex: _this.state.visible ? 0 : -1
65
71
  }, /*#__PURE__*/React.createElement("div", {
66
72
  className: "background-switcher-item-title"
67
73
  }, layer ? /*#__PURE__*/React.createElement("span", {
74
+ tabIndex: -1,
68
75
  title: _this.itemTitle(layer)
69
76
  }, _this.itemTitle(layer)) : /*#__PURE__*/React.createElement("span", null, LocaleUtils.tr("bgswitcher.nobg"))), /*#__PURE__*/React.createElement("div", {
70
77
  className: "background-switcher-item-thumbnail"
@@ -85,10 +92,13 @@ export var BackgroundSwitcher = /*#__PURE__*/function (_React$Component) {
85
92
  });
86
93
  return /*#__PURE__*/React.createElement("div", {
87
94
  className: itemclasses,
88
- key: layer.name
95
+ key: layer.name,
96
+ onKeyDown: _this.KeyNav,
97
+ tabIndex: _this.state.visible ? 0 : -1
89
98
  }, /*#__PURE__*/React.createElement("div", {
90
99
  className: "background-switcher-item-title"
91
100
  }, /*#__PURE__*/React.createElement("span", {
101
+ tabIndex: "-1",
92
102
  title: _this.itemTitle(layer)
93
103
  }, _this.itemTitle(layer)), /*#__PURE__*/React.createElement(Icon, {
94
104
  icon: "chevron-down"
@@ -109,15 +119,23 @@ export var BackgroundSwitcher = /*#__PURE__*/function (_React$Component) {
109
119
  return /*#__PURE__*/React.createElement("div", {
110
120
  className: menuitemclasses,
111
121
  key: l.name,
122
+ onBlur: function onBlur(ev) {
123
+ return _this.updateGroupItem(ev, layer);
124
+ },
112
125
  onClick: function onClick() {
113
126
  return _this.backgroundLayerClicked(l);
114
127
  },
128
+ onFocus: function onFocus(ev) {
129
+ return _this.updateGroupItem(ev, l);
130
+ },
131
+ onKeyDown: _this.KeyNav,
115
132
  onMouseEnter: function onMouseEnter(ev) {
116
133
  return _this.updateGroupItem(ev, l);
117
134
  },
118
135
  onMouseLeave: function onMouseLeave(ev) {
119
136
  return _this.updateGroupItem(ev, layer);
120
137
  },
138
+ tabIndex: 0,
121
139
  title: _this.itemTitle(l)
122
140
  }, _this.itemTitle(l));
123
141
  })));
@@ -127,6 +145,60 @@ export var BackgroundSwitcher = /*#__PURE__*/function (_React$Component) {
127
145
  ev.target.parentElement.parentElement.childNodes[0].firstChild.innerText = _this.itemTitle(layer);
128
146
  ev.target.parentElement.parentElement.childNodes[1].firstChild.src = assetsPath + "/" + layer.thumbnail;
129
147
  });
148
+ _defineProperty(_this, "KeyNav", function (ev) {
149
+ if (ev.key === "ArrowUp" || ev.key === "ArrowDown") {
150
+ var group = null;
151
+ if (ev.target.parentElement.classList.contains("background-switcher-group")) {
152
+ group = ev.target.parentElement;
153
+ } else {
154
+ group = ev.target.getElementsByClassName("background-switcher-group")[0];
155
+ }
156
+ if (!group) {
157
+ return;
158
+ }
159
+ var childCount = group.children.length;
160
+ var delta = ev.key === 'ArrowUp' ? -1 : 1;
161
+ var currentIndex = Array.from(group.children).findIndex(function (el) {
162
+ return document.activeElement === el || el.contains(document.activeElement);
163
+ });
164
+ if (currentIndex === -1) {
165
+ currentIndex = Array.from(group.children).findIndex(function (el) {
166
+ return el.classList.contains("background-switcher-group-item-active");
167
+ });
168
+ }
169
+ var next = (currentIndex + childCount + delta) % childCount;
170
+ while (group.children[next].tabIndex !== 0 && next !== currentIndex) {
171
+ next = (next + childCount + delta) % childCount;
172
+ }
173
+ if (next !== currentIndex) {
174
+ group.children[next].focus();
175
+ }
176
+ MiscUtils.killEvent(ev);
177
+ } else if (ev.key === "Tab") {
178
+ // Move to next tile
179
+ var current = _toConsumableArray(_this.listEl.children).find(function (el) {
180
+ return el === document.activeElement || el.contains(document.activeElement);
181
+ });
182
+ if (current) {
183
+ if (ev.shiftKey) {
184
+ if (current.previousElementSibling) {
185
+ current.previousElementSibling.focus();
186
+ } else {
187
+ _this.listEl.children[_this.listEl.children.length - 1].focus();
188
+ }
189
+ } else {
190
+ if (current.nextElementSibling) {
191
+ current.nextElementSibling.focus();
192
+ } else {
193
+ _this.listEl.children[0].focus();
194
+ }
195
+ }
196
+ }
197
+ MiscUtils.killEvent(ev);
198
+ } else {
199
+ MiscUtils.checkKeyActivate(ev, _this.hide);
200
+ }
201
+ });
130
202
  _defineProperty(_this, "buttonClicked", function () {
131
203
  _this.setState(function (state) {
132
204
  return {
@@ -149,10 +221,28 @@ export var BackgroundSwitcher = /*#__PURE__*/function (_React$Component) {
149
221
  visible: false
150
222
  });
151
223
  });
224
+ _defineProperty(_this, "hide", function () {
225
+ _this.setState({
226
+ visible: false
227
+ });
228
+ });
229
+ _this.buttonEl = null;
230
+ _this.listEl = null;
152
231
  return _this;
153
232
  }
154
233
  _inherits(BackgroundSwitcher, _React$Component);
155
234
  return _createClass(BackgroundSwitcher, [{
235
+ key: "componentDidUpdate",
236
+ value: function componentDidUpdate(prevProps, prevState) {
237
+ if (this.state.visible && !prevState.visible) {
238
+ var _this$listEl, _this$listEl$focus;
239
+ (_this$listEl = this.listEl) === null || _this$listEl === void 0 || (_this$listEl = _this$listEl.firstElementChild) === null || _this$listEl === void 0 || (_this$listEl$focus = _this$listEl.focus) === null || _this$listEl$focus === void 0 || _this$listEl$focus.call(_this$listEl);
240
+ } else if (!this.state.visible && prevState.visible) {
241
+ var _this$buttonEl, _this$buttonEl$focus;
242
+ (_this$buttonEl = this.buttonEl) === null || _this$buttonEl === void 0 || (_this$buttonEl$focus = _this$buttonEl.focus) === null || _this$buttonEl$focus === void 0 || _this$buttonEl$focus.call(_this$buttonEl);
243
+ }
244
+ }
245
+ }, {
156
246
  key: "render",
157
247
  value: function render() {
158
248
  var _this2 = this;
@@ -185,12 +275,18 @@ export var BackgroundSwitcher = /*#__PURE__*/function (_React$Component) {
185
275
  if (entries.length > 0) {
186
276
  return /*#__PURE__*/React.createElement(MapButton, {
187
277
  active: this.state.visible,
278
+ buttonRef: function buttonRef(el) {
279
+ _this2.buttonEl = el;
280
+ },
188
281
  icon: "bglayer",
189
282
  onClick: this.buttonClicked,
190
283
  position: this.props.position,
191
284
  tooltip: LocaleUtils.tr("tooltip.background")
192
285
  }, /*#__PURE__*/React.createElement("div", {
193
- className: "background-switcher " + (this.state.visible ? 'background-switcher-active' : '')
286
+ className: "background-switcher " + (this.state.visible ? 'background-switcher-active' : ''),
287
+ ref: function ref(el) {
288
+ _this2.listEl = el;
289
+ }
194
290
  }, this.renderLayerItem(null, backgroundLayers.filter(function (layer) {
195
291
  return layer.visibility === true;
196
292
  }).length === 0), entries.map(function (entry) {
@@ -358,8 +358,7 @@ var Cyclomedia = /*#__PURE__*/function (_React$Component) {
358
358
  title: LocaleUtils.tr("cyclomedia.title"),
359
359
  usePortal: false
360
360
  }, /*#__PURE__*/React.createElement("div", {
361
- className: "cyclomedia-body",
362
- role: "body"
361
+ className: "cyclomedia-body"
363
362
  }, this.props.mapScale > this.props.maxMapScale && this.state.status > Status.LOGIN ? /*#__PURE__*/React.createElement("div", {
364
363
  className: "cyclomedia-scale-hint"
365
364
  }, LocaleUtils.tr("cyclomedia.scalehint", this.props.maxMapScale)) : null, this.state.status > Status.LOGIN ? /*#__PURE__*/React.createElement("iframe", {
@@ -224,15 +224,13 @@ var FeatureForm = /*#__PURE__*/function (_React$Component) {
224
224
  var body = null;
225
225
  if (this.state.pendingRequests > 0) {
226
226
  body = /*#__PURE__*/React.createElement("div", {
227
- className: "feature-query-body",
228
- role: "body"
227
+ className: "feature-query-body"
229
228
  }, /*#__PURE__*/React.createElement("span", {
230
229
  className: "identify-body-message"
231
230
  }, LocaleUtils.tr("featureform.querying")));
232
231
  } else if (isEmpty(this.state.pickedFeatures)) {
233
232
  body = /*#__PURE__*/React.createElement("div", {
234
- className: "feature-query-body",
235
- role: "body"
233
+ className: "feature-query-body"
236
234
  }, /*#__PURE__*/React.createElement("span", {
237
235
  className: "identify-body-message"
238
236
  }, LocaleUtils.tr("featureform.noresults")));
@@ -252,8 +250,7 @@ var FeatureForm = /*#__PURE__*/function (_React$Component) {
252
250
  });
253
251
  }
254
252
  body = /*#__PURE__*/React.createElement("div", {
255
- className: "feature-query-body",
256
- role: "body"
253
+ className: "feature-query-body"
257
254
  }, Object.keys(this.state.pickedFeatures).length > 1 ? /*#__PURE__*/React.createElement("div", {
258
255
  className: "feature-query-selection"
259
256
  }, /*#__PURE__*/React.createElement("select", {
@@ -332,8 +332,7 @@ var GeometryDigitizer = /*#__PURE__*/function (_React$Component) {
332
332
  title: _this.state.outputWindowTitle,
333
333
  visible: _this.state.outputWindowVisible
334
334
  }, /*#__PURE__*/React.createElement("div", {
335
- className: "geomdigitizer-output-window-body",
336
- role: "body"
335
+ className: "geomdigitizer-output-window-body"
337
336
  }, !_this.state.outputLoaded ? /*#__PURE__*/React.createElement("span", {
338
337
  className: "geomdigitizer-output-window-wait"
339
338
  }, /*#__PURE__*/React.createElement(Spinner, null), " ", /*#__PURE__*/React.createElement("span", null, LocaleUtils.tr("geomdigitizer.wait"))) : null, /*#__PURE__*/React.createElement("iframe", {
@@ -299,8 +299,7 @@ var HeightProfile = /*#__PURE__*/function (_React$Component) {
299
299
  }
300
300
  if (_this3.state.data.error) {
301
301
  return /*#__PURE__*/React.createElement("div", {
302
- className: "height-profile-error",
303
- role: "body"
302
+ className: "height-profile-error"
304
303
  }, LocaleUtils.tr("heightprofile.error") + ": " + _this3.state.data.error);
305
304
  }
306
305
  var distanceStr = LocaleUtils.tr("heightprofile.distance");
@@ -449,7 +448,6 @@ var HeightProfile = /*#__PURE__*/function (_React$Component) {
449
448
  }
450
449
  return /*#__PURE__*/React.createElement("div", {
451
450
  className: "height-profile-chart-container",
452
- role: "body",
453
451
  style: {
454
452
  position: 'relative'
455
453
  }
@@ -735,8 +733,7 @@ var HeightProfile = /*#__PURE__*/function (_React$Component) {
735
733
  title: LocaleUtils.tr("heightprofile.title"),
736
734
  usePortal: false
737
735
  }, this.state.isloading ? /*#__PURE__*/React.createElement("div", {
738
- className: "height-profile-loading-indicator",
739
- role: "body"
736
+ className: "height-profile-loading-indicator"
740
737
  }, /*#__PURE__*/React.createElement(Spinner, {
741
738
  className: "spinner"
742
739
  }), " ", LocaleUtils.tr("heightprofile.loading")) : this.renderHeightProfile(function (el) {
@@ -389,15 +389,13 @@ var Identify = /*#__PURE__*/function (_React$Component) {
389
389
  if (isEmpty(this.state.identifyResults)) {
390
390
  if (this.state.pendingRequests > 0) {
391
391
  body = /*#__PURE__*/React.createElement("div", {
392
- className: "identify-body",
393
- role: "body"
392
+ className: "identify-body"
394
393
  }, /*#__PURE__*/React.createElement("span", {
395
394
  className: "identify-body-message"
396
395
  }, LocaleUtils.tr("identify.querying")));
397
396
  } else {
398
397
  body = /*#__PURE__*/React.createElement("div", {
399
- className: "identify-body",
400
- role: "body"
398
+ className: "identify-body"
401
399
  }, /*#__PURE__*/React.createElement("span", {
402
400
  className: "identify-body-message"
403
401
  }, LocaleUtils.tr("identify.noresults")));
@@ -417,7 +415,6 @@ var Identify = /*#__PURE__*/function (_React$Component) {
417
415
  longAttributesDisplay: this.props.longAttributesDisplay,
418
416
  replaceImageUrls: this.props.replaceImageUrls,
419
417
  resultDisplayMode: this.props.resultDisplayMode,
420
- role: "body",
421
418
  showLayerSelector: this.props.showLayerSelector
422
419
  });
423
420
  }
@@ -25,7 +25,6 @@ import { connect } from 'react-redux';
25
25
  import axios from 'axios';
26
26
  import { remove as removeDiacritics } from 'diacritics';
27
27
  import PropTypes from 'prop-types';
28
- import { addLayer, removeLayer, replacePlaceholderLayer } from '../actions/layers';
29
28
  import { setCurrentTask } from '../actions/task';
30
29
  import ResizeableWindow from '../components/ResizeableWindow';
31
30
  import LayerCatalogWidget from '../components/widgets/LayerCatalogWidget';
@@ -197,22 +196,17 @@ var LayerCatalog = /*#__PURE__*/function (_React$Component) {
197
196
  onClose: this.onClose,
198
197
  title: LocaleUtils.tr("layercatalog.windowtitle")
199
198
  }, /*#__PURE__*/React.createElement("div", {
200
- className: "layer-catalog",
201
- role: "body"
199
+ className: "layer-catalog"
202
200
  }, /*#__PURE__*/React.createElement(LayerCatalogWidget, {
203
- addLayer: this.props.addLayer,
204
201
  catalog: this.state.catalog,
205
202
  levelBasedIndentSize: this.props.levelBasedIndentSize,
206
- pendingRequests: 0,
207
- removeLayer: this.props.removeLayer,
208
- replacePlaceholderLayer: this.props.replacePlaceholderLayer
203
+ pendingRequests: 0
209
204
  })));
210
205
  }
211
206
  }]);
212
207
  }(React.Component);
213
208
  _defineProperty(LayerCatalog, "propTypes", {
214
209
  active: PropTypes.bool,
215
- addLayer: PropTypes.func,
216
210
  /** The URL to the catalog JSON file. */
217
211
  catalogUrl: PropTypes.string,
218
212
  /** Default window geometry with size, position and docking status. Positive position values (including '0') are related to top (InitialY) and left (InitialX), negative values (including '-0') to bottom (InitialY) and right (InitialX). */
@@ -228,8 +222,6 @@ _defineProperty(LayerCatalog, "propTypes", {
228
222
  levelBasedIndentSize: PropTypes.bool,
229
223
  /** Whether to register a search provider which allows searching catalog layers through the global search field. */
230
224
  registerCatalogSearchProvider: PropTypes.bool,
231
- removeLayer: PropTypes.func,
232
- replacePlaceholderLayer: PropTypes.func,
233
225
  setCurrentTask: PropTypes.func
234
226
  });
235
227
  _defineProperty(LayerCatalog, "defaultProps", {
@@ -249,8 +241,5 @@ export default connect(function (state) {
249
241
  active: state.task.id === "LayerCatalog"
250
242
  };
251
243
  }, {
252
- addLayer: addLayer,
253
- removeLayer: removeLayer,
254
- replacePlaceholderLayer: replacePlaceholderLayer,
255
244
  setCurrentTask: setCurrentTask
256
245
  })(LayerCatalog);
@@ -51,6 +51,7 @@ import LayerInfoWindow from '../components/LayerInfoWindow';
51
51
  import ResizeableWindow from '../components/ResizeableWindow';
52
52
  import ServiceInfoWindow from '../components/ServiceInfoWindow';
53
53
  import SideBar from '../components/SideBar';
54
+ import PopupMenu from '../components/widgets/PopupMenu';
54
55
  import { Image } from '../components/widgets/Primitives';
55
56
  import Spinner from '../components/widgets/Spinner';
56
57
  import ConfigUtils from '../utils/ConfigUtils';
@@ -165,7 +166,7 @@ var LayerTree = /*#__PURE__*/function (_React$Component) {
165
166
  "layertree-item-menubutton": true,
166
167
  "layertree-item-menubutton-active": _this.state.activestylemenu === groupId
167
168
  });
168
- var allowRemove = ConfigUtils.getConfigProp("allowRemovingThemeLayers", _this.props.theme) === true || layer.role !== LayerRole.THEME;
169
+ var allowRemove = _this.props.allowRemovingThemeLayers || ConfigUtils.getConfigProp("allowRemovingThemeLayers", _this.props.theme) === true || layer.role !== LayerRole.THEME;
169
170
  var allowReordering = ConfigUtils.getConfigProp("allowReorderingLayers", _this.props.theme) === true && !_this.state.filterinvisiblelayers;
170
171
  var sortable = allowReordering && ConfigUtils.getConfigProp("preventSplittingGroupsWhenReordering", _this.props.theme) === true;
171
172
  var styles = layer.type === "wms" && path.length === 0 ? _this.getLayerStyles(layer) : null;
@@ -251,7 +252,7 @@ var LayerTree = /*#__PURE__*/function (_React$Component) {
251
252
  return null;
252
253
  }
253
254
  var sublayerId = layer.id + ":" + sublayer.name;
254
- var allowRemove = ConfigUtils.getConfigProp("allowRemovingThemeLayers", _this.props.theme) === true || layer.role !== LayerRole.THEME;
255
+ var allowRemove = _this.props.allowRemovingThemeLayers || ConfigUtils.getConfigProp("allowRemovingThemeLayers", _this.props.theme) === true || layer.role !== LayerRole.THEME;
255
256
  var allowReordering = ConfigUtils.getConfigProp("allowReorderingLayers", _this.props.theme) === true;
256
257
  var checkboxstate = sublayer.visibility === true ? 'checked' : 'unchecked';
257
258
  if (inMutuallyExclusiveGroup) {
@@ -354,7 +355,7 @@ var LayerTree = /*#__PURE__*/function (_React$Component) {
354
355
  }
355
356
  var allowOptions = layer.type !== "placeholder" && layer.type !== "separator";
356
357
  var flattenGroups = ConfigUtils.getConfigProp("flattenLayerTreeGroups", _this.props.theme) || _this.props.flattenGroups;
357
- var allowSeparators = flattenGroups && allowReordering && ConfigUtils.getConfigProp("allowLayerTreeSeparators", _this.props.theme);
358
+ var allowSeparators = allowReordering && (_this.props.allowLayerTreeSeparators || ConfigUtils.getConfigProp("allowLayerTreeSeparators", _this.props.theme));
358
359
  var separatorTitle = LocaleUtils.tr("layertree.separator");
359
360
  var separatorTooltip = LocaleUtils.tr("layertree.separatortooltip");
360
361
  return /*#__PURE__*/React.createElement("div", {
@@ -505,7 +506,9 @@ var LayerTree = /*#__PURE__*/function (_React$Component) {
505
506
  key: name,
506
507
  onClick: function onClick() {
507
508
  return onStyleChange(name);
508
- }
509
+ },
510
+ onKeyDown: MiscUtils.checkKeyActivate,
511
+ tabIndex: 0
509
512
  }, /*#__PURE__*/React.createElement(Icon, {
510
513
  icon: selectedStyles.includes(name) ? checkedIcon : "radio_unchecked"
511
514
  }), /*#__PURE__*/React.createElement("div", null, title));
@@ -588,7 +591,9 @@ var LayerTree = /*#__PURE__*/function (_React$Component) {
588
591
  if (_this.props.allowImport) {
589
592
  layerImportExpander = /*#__PURE__*/React.createElement("div", {
590
593
  className: "layertree-option",
591
- onClick: _this.toggleImportLayers
594
+ onClick: _this.toggleImportLayers,
595
+ onKeyDown: MiscUtils.checkKeyActivate,
596
+ tabIndex: 0
592
597
  }, /*#__PURE__*/React.createElement(Icon, {
593
598
  icon: _this.state.importvisible ? 'collapse' : 'expand'
594
599
  }), " ", LocaleUtils.tr("layertree.importlayer"));
@@ -663,12 +668,6 @@ var LayerTree = /*#__PURE__*/function (_React$Component) {
663
668
  "layertree-visibility-button": true,
664
669
  "layertree-visibility-button-active": _this.state.visibilityMenu
665
670
  });
666
- var style = {};
667
- if (_this.props.side === 'left') {
668
- style.left = 0;
669
- } else {
670
- style.right = 0;
671
- }
672
671
  return /*#__PURE__*/React.createElement("span", {
673
672
  className: buttonClasses,
674
673
  onClick: function onClick() {
@@ -677,14 +676,24 @@ var LayerTree = /*#__PURE__*/function (_React$Component) {
677
676
  visibilityMenu: !state.visibilityMenu
678
677
  };
679
678
  });
680
- }
679
+ },
680
+ onKeyDown: MiscUtils.checkKeyActivate,
681
+ ref: function ref(el) {
682
+ _this.visibilityButton = el;
683
+ },
684
+ tabIndex: 0
681
685
  }, /*#__PURE__*/React.createElement(Icon, {
682
686
  icon: "eye"
683
687
  }), /*#__PURE__*/React.createElement(Icon, {
684
688
  icon: "chevron-down"
685
- }), _this.state.visibilityMenu ? /*#__PURE__*/React.createElement("div", {
689
+ }), _this.state.visibilityMenu ? /*#__PURE__*/React.createElement(PopupMenu, {
690
+ anchor: _this.visibilityButton,
686
691
  className: "layertree-visibility-menu",
687
- style: style
692
+ onClose: function onClose() {
693
+ return _this.setState({
694
+ visibilityMenu: false
695
+ });
696
+ }
688
697
  }, _this.props.showToggleAllLayersCheckbox ? /*#__PURE__*/React.createElement("div", {
689
698
  onClick: function onClick() {
690
699
  return _this.toggleLayerTreeVisibility(vis === 0);
@@ -760,8 +769,7 @@ var LayerTree = /*#__PURE__*/function (_React$Component) {
760
769
  },
761
770
  title: LocaleUtils.tr("layertree.printlegend")
762
771
  }, /*#__PURE__*/React.createElement("div", {
763
- className: "layertree-legend-print-body",
764
- role: "body"
772
+ className: "layertree-legend-print-body"
765
773
  }, /*#__PURE__*/React.createElement("iframe", {
766
774
  ref: setLegendPrintContents,
767
775
  src: MiscUtils.resolveAssetsPath(_this.props.templatePath)
@@ -966,6 +974,7 @@ var LayerTree = /*#__PURE__*/function (_React$Component) {
966
974
  }
967
975
  });
968
976
  });
977
+ _this.visibilityButton = null;
969
978
  _this.legendPrintWindow = null;
970
979
  window.addEventListener('beforeunload', function () {
971
980
  if (_this.legendPrintWindow && !_this.legendPrintWindow.closed) {
@@ -1022,7 +1031,7 @@ var LayerTree = /*#__PURE__*/function (_React$Component) {
1022
1031
  });
1023
1032
  }
1024
1033
  var deleteAllLayersIcon = null;
1025
- if (ConfigUtils.getConfigProp("allowRemovingThemeLayers") === true) {
1034
+ if (this.props.allowRemovingThemeLayers || ConfigUtils.getConfigProp("allowRemovingThemeLayers") === true) {
1026
1035
  var deleteAllLayersTooltip = LocaleUtils.tr("layertree.deletealllayers");
1027
1036
  deleteAllLayersIcon = /*#__PURE__*/React.createElement(Icon, {
1028
1037
  className: "layertree-delete-legend",
@@ -1073,8 +1082,12 @@ _defineProperty(LayerTree, "propTypes", {
1073
1082
  allowCompare: PropTypes.bool,
1074
1083
  /** Whether to allow importing external layers. */
1075
1084
  allowImport: PropTypes.bool,
1085
+ /** Whether to allow adding layer tree separators. */
1086
+ allowLayerTreeSeparators: PropTypes.bool,
1076
1087
  /** Whether to allow enabling map tips. */
1077
1088
  allowMapTips: PropTypes.bool,
1089
+ /** Whether to allow removing theme layers. */
1090
+ allowRemovingThemeLayers: PropTypes.bool,
1078
1091
  /** Whether to allow selection of identifyable layers. The `showQueryableIcon` property should be `true` to be able to select identifyable layers. */
1079
1092
  allowSelectIdentifyableLayers: PropTypes.bool,
1080
1093
  /** Whether to display a BBOX dependent legend. Can be `true|false|"theme"`, latter means only for theme layers. */
@@ -179,8 +179,7 @@ var MapLegend = /*#__PURE__*/function (_React$Component) {
179
179
  onClose: this.props.lockedWindow ? null : this.onClose,
180
180
  title: LocaleUtils.tr("maplegend.windowtitle")
181
181
  }, /*#__PURE__*/React.createElement("div", {
182
- className: "map-legend",
183
- role: "body"
182
+ className: "map-legend"
184
183
  }, this.props.layers.map(function (layer) {
185
184
  if (_this2.state.onlyVisibleLegend && !layer.visibility) {
186
185
  return null;
@@ -74,7 +74,6 @@ var ObjectList = /*#__PURE__*/function (_React$Component) {
74
74
  initialLayer: (_this$props$taskData = this.props.taskData) === null || _this$props$taskData === void 0 ? void 0 : _this$props$taskData.layer,
75
75
  limitToExtent: this.props.limitToExtent,
76
76
  readOnly: true,
77
- role: "body",
78
77
  showDisplayFieldOnly: true,
79
78
  showEditFormButton: false,
80
79
  showHiddenFields: false,
@@ -237,8 +237,7 @@ var Panoramax = /*#__PURE__*/function (_React$Component) {
237
237
  splitScreenWhenDocked: true,
238
238
  title: LocaleUtils.tr("panoramax.title")
239
239
  }, /*#__PURE__*/React.createElement("div", {
240
- className: "panoramax-body",
241
- role: "body"
240
+ className: "panoramax-body"
242
241
  }, !queryData ? /*#__PURE__*/React.createElement("div", {
243
242
  style: {
244
243
  display: 'flex',
package/plugins/Print.js CHANGED
@@ -582,8 +582,7 @@ var Print = /*#__PURE__*/function (_React$Component) {
582
582
  title: LocaleUtils.tr("print.output"),
583
583
  visible: _this.state.printOutputVisible
584
584
  }, /*#__PURE__*/React.createElement("div", {
585
- className: "print-output-window-body",
586
- role: "body"
585
+ className: "print-output-window-body"
587
586
  }, !_this.state.outputLoaded ? /*#__PURE__*/React.createElement("span", {
588
587
  className: "print-output-window-wait"
589
588
  }, /*#__PURE__*/React.createElement(Spinner, null), " ", LocaleUtils.tr("print.wait")) : null, /*#__PURE__*/React.createElement("iframe", {
@@ -1172,8 +1172,7 @@ var Routing = /*#__PURE__*/function (_React$Component) {
1172
1172
  },
1173
1173
  title: LocaleUtils.tr("routing.windowtitle")
1174
1174
  }, /*#__PURE__*/React.createElement("div", {
1175
- className: "routing-body",
1176
- role: "body"
1175
+ className: "routing-body"
1177
1176
  }, /*#__PURE__*/React.createElement(ButtonBar, {
1178
1177
  active: this.state.currentTab,
1179
1178
  buttons: tabButtons,
@@ -240,8 +240,7 @@ var TimeManager = /*#__PURE__*/function (_React$Component) {
240
240
  enddate = dayjs(_this.props.filter.timeRange.tend);
241
241
  }
242
242
  return /*#__PURE__*/React.createElement("div", {
243
- className: "time-manager-body",
244
- role: "body"
243
+ className: "time-manager-body"
245
244
  }, /*#__PURE__*/React.createElement("div", {
246
245
  className: "time-manager-toolbar"
247
246
  }, /*#__PURE__*/React.createElement("div", {
@@ -821,9 +820,7 @@ var TimeManager = /*#__PURE__*/function (_React$Component) {
821
820
  var timeValues = this.state.timeData.values;
822
821
  var body = null;
823
822
  if (timeValues.length < 2) {
824
- body = /*#__PURE__*/React.createElement("div", {
825
- role: "body"
826
- }, /*#__PURE__*/React.createElement("div", {
823
+ body = /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
827
824
  className: "time-manager-notemporaldata"
828
825
  }, LocaleUtils.tr("timemanager.notemporaldata")));
829
826
  } else {
@@ -363,8 +363,7 @@ var ValueTool = /*#__PURE__*/function (_React$Component) {
363
363
  onClose: this.onWindowClose,
364
364
  title: LocaleUtils.tr("valuetool.title")
365
365
  }, /*#__PURE__*/React.createElement("div", {
366
- className: "valuetool-body",
367
- role: "body"
366
+ className: "valuetool-body"
368
367
  }, /*#__PURE__*/React.createElement(ButtonBar, {
369
368
  active: this.state.activeTab,
370
369
  buttons: buttons,
package/plugins/View3D.js CHANGED
@@ -108,7 +108,6 @@ var View3D = /*#__PURE__*/function (_React$Component) {
108
108
  splitTopAndBottomBar: true,
109
109
  title: LocaleUtils.tr("map3d.title")
110
110
  }, _this.state.componentLoaded ? /*#__PURE__*/React.createElement(Provider, {
111
- role: "body",
112
111
  store: _this.store
113
112
  }, /*#__PURE__*/React.createElement(PluginsContainer, {
114
113
  pluginsConfig: pluginsConfig
@@ -174,10 +174,10 @@ var MeasurementSupport = /*#__PURE__*/function (_React$Component) {
174
174
  var opts = {};
175
175
  if (_this.props.measurement.geomType === 'LineString') {
176
176
  opts.headmarker = _this.props.measurement.lineHeadMarker;
177
- opts.tailmarker = _this.props.measurement.lineHeadMarker;
177
+ opts.tailmarker = _this.props.measurement.lineTailMarker;
178
178
  } else if (_this.props.measurement.geomType === 'Bearing') {
179
179
  opts.headmarker = _this.props.measurement.bearingHeadMarker;
180
- opts.tailmarker = _this.props.measurement.bearingHeadMarker;
180
+ opts.tailmarker = _this.props.measurement.bearingTailMarker;
181
181
  }
182
182
  return [].concat(_toConsumableArray(FeatureStyles.measureInteraction(feature, opts)), [FeatureStyles.measureInteractionVertex({
183
183
  geometryFunction: geometryFunction
@@ -234,8 +234,7 @@ var Identify3D = /*#__PURE__*/function (_React$Component) {
234
234
  onClose: this.clear,
235
235
  title: LocaleUtils.tr("identify.title")
236
236
  }, /*#__PURE__*/React.createElement("div", {
237
- className: "identify-body",
238
- role: "body"
237
+ className: "identify-body"
239
238
  }, isEmpty(this.state.pickAttrs) ? /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement("i", null, LocaleUtils.tr("identify.noattributes"))) : /*#__PURE__*/React.createElement("div", {
240
239
  className: "identify-result-box"
241
240
  }, /*#__PURE__*/React.createElement("table", {