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
@@ -199,7 +199,6 @@ var AppContainerComponent = /*#__PURE__*/function (_React$Component) {
199
199
  }, {
200
200
  key: "render",
201
201
  value: function render() {
202
- // Filter 2D plugins
203
202
  var device = ConfigUtils.isMobile() ? 'mobile' : 'desktop';
204
203
  var pluginsConf = this.props.localConfig.plugins[device];
205
204
  return /*#__PURE__*/React.createElement(PluginsContainer, {
@@ -62,11 +62,13 @@ var ThemeLayersListWindow = /*#__PURE__*/function (_React$Component) {
62
62
  });
63
63
  _defineProperty(_this, "addLayers", function (sublayers) {
64
64
  _this.props.closeWindow("existinglayers");
65
- var existingLayer = _this.props.layers.find(function (l) {
66
- return l.type === 'wms' && l.url === _this.props.theme.url;
67
- });
68
- if (existingLayer) {
69
- var existingSublayers = [].concat(_toConsumableArray(LayerUtils.getSublayerNames(existingLayer)), [existingLayer.name]);
65
+ var existingSublayers = _this.props.layers.reduce(function (res, layer) {
66
+ if (layer.type === 'wms' && layer.url === _this.props.theme.url) {
67
+ return [].concat(_toConsumableArray(res), _toConsumableArray(LayerUtils.getSublayerNames(layer)), [layer.name]);
68
+ }
69
+ return res;
70
+ }, []);
71
+ if (!isEmpty(existingSublayers)) {
70
72
  var filteredSublayers = [];
71
73
  sublayers = sublayers.filter(function (sublayer) {
72
74
  if (existingSublayers.includes(sublayer.name)) {
@@ -190,8 +192,7 @@ var ThemeLayersListWindow = /*#__PURE__*/function (_React$Component) {
190
192
  onClose: this.onClose,
191
193
  title: LocaleUtils.tr("themelayerslist.addlayerstotheme")
192
194
  }, /*#__PURE__*/React.createElement("div", {
193
- className: "theme-list-window-body",
194
- role: "body"
195
+ className: "theme-list-window-body"
195
196
  }, /*#__PURE__*/React.createElement("h4", {
196
197
  className: "theme-list-window-title"
197
198
  }, this.props.theme.title), /*#__PURE__*/React.createElement("div", {
@@ -39,6 +39,7 @@ import { setCurrentTask } from '../actions/task';
39
39
  import { setCurrentTheme, setThemeLayersList } from '../actions/theme';
40
40
  import ConfigUtils from '../utils/ConfigUtils';
41
41
  import LocaleUtils from '../utils/LocaleUtils';
42
+ import MiscUtils from '../utils/MiscUtils';
42
43
  import ThemeUtils from '../utils/ThemeUtils';
43
44
  import Icon from './Icon';
44
45
  import './style/ThemeList.css';
@@ -96,7 +97,9 @@ var ThemeList = /*#__PURE__*/function (_React$Component) {
96
97
  expandedGroups: _objectSpread(_objectSpread({}, state.expandedGroups), {}, _defineProperty({}, subdir.id, !expanded))
97
98
  };
98
99
  });
99
- }
100
+ },
101
+ onKeyDown: MiscUtils.checkKeyActivate,
102
+ tabIndex: "0"
100
103
  }, _this.props.collapsibleGroups ? /*#__PURE__*/React.createElement(Icon, {
101
104
  icon: expanded ? "collapse" : "expand"
102
105
  }) : null, " ", subdir.titleMsgId ? LocaleUtils.tr(subdir.titleMsgId) : subdir.title), expanded ? _this.renderThemeGroup(subdir, filter) : null);
@@ -171,7 +174,9 @@ var ThemeList = /*#__PURE__*/function (_React$Component) {
171
174
  target: link.target
172
175
  }, link.title);
173
176
  })) : null) : null, /*#__PURE__*/React.createElement("div", {
174
- className: "theme-item-body"
177
+ className: "theme-item-body",
178
+ onKeyDown: MiscUtils.checkKeyActivate,
179
+ tabIndex: 0
175
180
  }, item.description ? /*#__PURE__*/React.createElement("div", {
176
181
  className: "theme-item-description",
177
182
  dangerouslySetInnerHTML: {
@@ -79,7 +79,6 @@ var WindowManager = /*#__PURE__*/function (_React$Component) {
79
79
  }, /*#__PURE__*/React.createElement("iframe", {
80
80
  className: "windows-iframe-dialog-body",
81
81
  name: key,
82
- role: "body",
83
82
  src: data.url
84
83
  }));
85
84
  });
@@ -23,6 +23,7 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
23
23
  import ol from 'openlayers';
24
24
  import FeatureStyles from '../../../utils/FeatureStyles';
25
25
  export function createFeatures(options, mapCrs) {
26
+ var segmentize = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
26
27
  var format = new ol.format.GeoJSON();
27
28
  return (options.features || []).reduce(function (collection, featureObj) {
28
29
  var _ref, _featureObj$crs;
@@ -41,7 +42,7 @@ export function createFeatures(options, mapCrs) {
41
42
  var featureStyleOptions = _objectSpread(_objectSpread({}, options.styleOptions), featureObj.styleOptions);
42
43
  feature.set('styleName', featureStyleName);
43
44
  feature.set('styleOptions', featureStyleOptions);
44
- if (featureObj.circleParams) {
45
+ if (featureObj.circleParams && !segmentize) {
45
46
  feature.set('circleParams', featureObj.circleParams);
46
47
  feature.setGeometry(new ol.geom.Circle(featureObj.circleParams.center, featureObj.circleParams.radius));
47
48
  }
@@ -58,6 +59,7 @@ export function createFeatures(options, mapCrs) {
58
59
  }, []);
59
60
  }
60
61
  export function updateFeatures(source, newOptions, oldOptions, mapCrs) {
62
+ var segmentize = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
61
63
  var format = new ol.format.GeoJSON();
62
64
  var oldFeaturesMap = (oldOptions.features || []).reduce(function (res, f) {
63
65
  res[f.id] = f;
@@ -118,7 +120,7 @@ export function updateFeatures(source, newOptions, oldOptions, mapCrs) {
118
120
  var _feature$getGeometry2;
119
121
  (_feature$getGeometry2 = _feature.getGeometry()) === null || _feature$getGeometry2 === void 0 || _feature$getGeometry2.transform(featureCrs, mapCrs);
120
122
  }
121
- if (featureObj.circleParams) {
123
+ if (featureObj.circleParams && !segmentize) {
122
124
  _feature.setGeometry(new ol.geom.Circle(featureObj.circleParams.center, featureObj.circleParams.radius));
123
125
  }
124
126
  var featureStyleName = featureObj.styleName || newOptions.styleName;
@@ -257,7 +257,6 @@ var HeightProfile = /*#__PURE__*/function (_React$Component) {
257
257
  return /*#__PURE__*/React.createElement("div", {
258
258
  className: "height-profile-chart-container",
259
259
  onMouseLeave: _this3.hideMarker,
260
- role: "body",
261
260
  style: {
262
261
  position: 'relative'
263
262
  }
@@ -911,7 +911,7 @@ var Map3D = /*#__PURE__*/function (_React$Component2) {
911
911
  scenePos = [scenePos];
912
912
  }
913
913
  var dtmPos = scenePos.map(function (p) {
914
- return CoordinatesUtils.reproject(p, _this2.state.sceneContext.mapCrs, _this2.state.sceneContext.dtmCrs);
914
+ return CoordinatesUtils.reproject(p, _this2.state.sceneContext.mapCrs, _this2.state.sceneContext.dtmCrs.name);
915
915
  });
916
916
  var dtmExt = [Infinity, Infinity, -Infinity, -Infinity];
917
917
  dtmPos.forEach(function (p) {
@@ -63,7 +63,8 @@ var View3DSwitcher = /*#__PURE__*/function (_React$Component) {
63
63
  },
64
64
  position: _this.props.position
65
65
  }, /*#__PURE__*/React.createElement("div", {
66
- className: "view3d-switcher-buttons" + (_this.state.expanded ? " view3d-switcher-buttons-expanded" : "")
66
+ className: "view3d-switcher-buttons" + (_this.state.expanded ? " view3d-switcher-buttons-expanded" : ""),
67
+ inert: _this.state.expanded ? undefined : "true"
67
68
  }, buttons.map(function (button) {
68
69
  return /*#__PURE__*/React.createElement("button", {
69
70
  className: "map-button" + (button.mode === _this.props.view3dMode ? " map-button-active" : ""),
@@ -212,8 +212,7 @@ var NumericInput3D = /*#__PURE__*/function (_React$Component) {
212
212
  scrollable: true,
213
213
  title: LocaleUtils.tr("draw3d.numericinput")
214
214
  }, /*#__PURE__*/React.createElement("div", {
215
- className: "draw3d-numeric-input-body",
216
- role: "body"
215
+ className: "draw3d-numeric-input-body"
217
216
  }, /*#__PURE__*/React.createElement("table", null, /*#__PURE__*/React.createElement("tbody", null, /*#__PURE__*/React.createElement("tr", null, /*#__PURE__*/React.createElement("td", null, LocaleUtils.tr("draw3d.position")), /*#__PURE__*/React.createElement("td", null, /*#__PURE__*/React.createElement(NumberInput, {
218
217
  decimals: 0,
219
218
  disabled: disabled,
@@ -25,7 +25,7 @@ export default {
25
25
  name: options.name,
26
26
  source: new VectorSource({
27
27
  dataProjection: CoordinateSystem.fromSrid(projection),
28
- data: createFeatures(options, projection),
28
+ data: createFeatures(options, projection, true),
29
29
  format: new ol.format.GeoJSON(),
30
30
  style: options.styleFunction || function (feature) {
31
31
  var styleName = options.styleName || 'default';
@@ -42,7 +42,7 @@ export default {
42
42
  layer.source.setStyle(newOptions.styleFunction);
43
43
  }
44
44
  if (newOptions.features !== oldOptions.features) {
45
- updateFeatures(layer.source, newOptions, oldOptions, projection);
45
+ updateFeatures(layer.source, newOptions, oldOptions, projection, true);
46
46
  } else if ((oldOptions.rev || 0) !== (newOptions.rev || 0)) {
47
47
  layer.source.update();
48
48
  }
@@ -111,6 +111,10 @@ button.button {
111
111
  outline: none;
112
112
  }
113
113
 
114
+ button.button:focus {
115
+ outline: var(--focus-outline);
116
+ }
117
+
114
118
  button.button:disabled {
115
119
  background-color: var(--button-bg-color-disabled);
116
120
  color: var(--button-text-color-disabled);
@@ -44,7 +44,6 @@ div.AppMenu .appmenu-icon > span.icon {
44
44
  transition: color 0.25s, border-color 0.25s, background-color 0.25s;
45
45
  }
46
46
 
47
-
48
47
  div.AppMenu.appmenu-visible .appmenu-icon > span.icon {
49
48
  color: var(--app-submenu-text-color-hover);
50
49
  border-color: var(--app-submenu-text-color-hover);
@@ -80,14 +79,15 @@ div.AppMenu.appmenu-compact div.appmenu-menu-container {
80
79
  top: 3.5em;
81
80
  }
82
81
 
83
- div.AppMenu.appmenu-compact div.appmenu-menu-container:hover {
82
+ div.AppMenu.appmenu-compact div.appmenu-menu-container:hover,
83
+ div.AppMenu.appmenu-compact div.appmenu-menu-container:focus-within {
84
84
  right: 0;
85
85
  }
86
86
 
87
- div.AppMenu ul.appmenu-menu {
88
- text-align: left;
89
- padding: 0;
87
+ div.AppMenu div.appmenu-menu {
90
88
  background-color: var(--app-menu-bg-color);
89
+ text-align: left;
90
+ font-size: small;
91
91
  }
92
92
 
93
93
  div.AppMenu.appmenu-visible div.appmenu-menu-container {
@@ -95,72 +95,57 @@ div.AppMenu.appmenu-visible div.appmenu-menu-container {
95
95
  opacity: 1;
96
96
  }
97
97
 
98
- div.AppMenu ul.appmenu-menu li {
98
+ div.appmenu-menu-item {
99
+ display: flex;
100
+ align-items: center;
99
101
  color: var(--app-menu-text-color);
100
- list-style-type: none;
101
- margin: 0;
102
- font-size: small;
103
102
  font-weight: bold;
104
103
  }
105
104
 
106
- div.AppMenu ul.appmenu-menu li:not(:last-child) {
105
+ div.appmenu-menu-item:not(:last-child) {
107
106
  border-bottom: 1px solid var(--app-menu-text-color);
108
107
  }
109
108
 
110
- div.AppMenu ul.appmenu-menu > li.appmenu-leaf-active,
111
- div.AppMenu ul.appmenu-menu > li.appmenu-submenu-active,
112
- div.AppMenu ul.appmenu-menu > li.appmenu-submenu-expanded {
113
- background-color: var(--app-menu-bg-color-hover);
114
- color: var(--app-menu-text-color-hover);
115
- }
116
-
117
- div.AppMenu ul.appmenu-menu li > .icon {
118
- vertical-align: middle;
109
+ div.appmenu-menu-item > .icon {
119
110
  width: 2em;
120
111
  margin: 0.5em 1em 0.5em 1em;
121
112
  }
122
113
 
123
- div.AppMenu ul.appmenu-menu li.appmenu-submenu > ul {
124
- background-color: var(--app-submenu-bg-color);
125
- padding: 0;
126
- display: none;
127
- }
128
-
129
- div.AppMenu ul.appmenu-menu li.appmenu-submenu-expanded > ul {
130
- display: block;
114
+ div.appmenu-menu-item-label {
115
+ margin: 0.25em 0;
131
116
  }
132
117
 
133
- div.AppMenu ul.appmenu-menu li.appmenu-submenu > ul > li {
134
- color: var(--app-submenu-text-color);
118
+ div.appmenu-menu-item-comment {
119
+ font-weight: normal;
120
+ font-size: 90%;
135
121
  }
136
122
 
137
- div.AppMenu ul.appmenu-menu li.appmenu-submenu > ul > li.appmenu-leaf-active,
138
- div.AppMenu ul.appmenu-menu li.appmenu-submenu > ul > li.appmenu-submenu-active,
139
- div.AppMenu ul.appmenu-menu li.appmenu-submenu > ul > li.appmenu-submenu-expanded {
140
- background-color: var(--app-submenu-bg-color-hover);
141
- color: var(--app-submenu-text-color-hover);
123
+ div.appmenu-submenu-active,
124
+ div.appmenu-submenu-expanded {
125
+ background-color: var(--app-menu-bg-color-hover);
126
+ color: var(--app-menu-text-color-hover);
142
127
  }
143
128
 
144
- div.AppMenu ul.appmenu-menu li.appmenu-leaf {
145
- display: flex;
146
- align-items: center;
129
+ div.appmenu-menu-item-nested {
130
+ background-color: var(--app-submenu-bg-color);
131
+ color: var(--app-submenu-text-color);
147
132
  }
148
133
 
149
- div.AppMenu ul.appmenu-menu li.appmenu-leaf > span.icon {
150
- flex: 0 0 auto;
134
+ div.appmenu-menu-item:focus-within {
135
+ background-color: var(--app-menu-bg-color-hover);
136
+ color: var(--app-menu-text-color-hover);
137
+ outline: none;
151
138
  }
152
139
 
153
- div.AppMenu ul.appmenu-menu li.appmenu-leaf > span.appmenu-leaf-label {
154
- flex: 1 1 auto;
155
- margin: 0.25em 0;
140
+ div.appmenu-menu-item-nested:focus-within {
141
+ background-color: var(--app-submenu-bg-color-hover);
142
+ color: var(--app-submenu-text-color-hover);
156
143
  }
157
144
 
158
- div.AppMenu ul.appmenu-menu li.appmenu-leaf div.appmenu-leaf-comment {
159
- font-weight: normal;
160
- font-size: 90%;
145
+ div.appmenu-menu-item-filter {
146
+ padding-right: 0.5em;
161
147
  }
162
148
 
163
- div.appmenu-filter {
164
- width: 100%;
165
- margin-right: 0.5em;
149
+ div.appmenu-menu-item-filter > div.input-container {
150
+ flex: 1 1 auto;
166
151
  }
@@ -40,6 +40,7 @@
40
40
  /* List */
41
41
  --list-bg-color: white;
42
42
  --list-section-bg-color: #ccc;
43
+ --list-section-bg-color-hover: #bbb;
43
44
  --list-section-text-color: #595959;
44
45
  --list-item-bg-color-even: #f0f0f0;
45
46
  --list-item-bg-color-hover: #dcdcdc;
@@ -1,9 +1,3 @@
1
- div.PickFeatureMenu {
2
- border: 1px solid var(--border-color);
3
- background-color: var(--list-bg-color);
4
- box-shadow: 0px 2px 4px rgba(136, 136, 136, 0.5);
5
- }
6
-
7
1
  div.PickFeatureMenu > div {
8
2
  padding: 0.25em 0.5em;
9
3
  }
@@ -102,10 +102,6 @@ div.resizeable-window-titlebar {
102
102
  flex: 0 0 2.5em;
103
103
  display: flex;
104
104
  align-items: center;
105
- -moz-user-select: none;
106
- -webkit-user-select: none;
107
- -ms-user-select: none;
108
- user-select: none;
109
105
  padding: 0 0.25em;
110
106
  }
111
107
 
@@ -27,18 +27,7 @@ div.searchbox-field > div.spinner {
27
27
  }
28
28
 
29
29
  div.searchbox-results {
30
- position: absolute;
31
- left: 0;
32
- top: 100%;
33
- width: 100%;
34
- max-height: calc(var(--plugins-container-height) - var(--topbar-height) - var(--bottombar-height));
35
- background-color: var(--list-bg-color);
36
- border-left: 1px solid var(--border-color);
37
- border-right: 1px solid var(--border-color);
38
- border-bottom: 1px solid var(--border-color);
39
- box-shadow: 0px 2px 4px rgba(136, 136, 136, 0.5);
40
30
  overflow-x: hidden;
41
- overflow-y: auto;
42
31
  }
43
32
 
44
33
  div.searchbox-results-section-title {
@@ -67,11 +56,6 @@ div.searchbox-noresults {
67
56
  color: var(--text-color-disabled);
68
57
  }
69
58
 
70
- div.searchbox-result:hover {
71
- background-color: var(--list-item-bg-color-hover);
72
- color: var(--list-item-text-color-hover);
73
- }
74
-
75
59
  div.searchbox-result-expandedinfo {
76
60
  background-color: var(--list-item-bg-color-hover);
77
61
  color: var(--list-item-text-color-hover);
@@ -116,11 +100,6 @@ div.searchbox-more-results {
116
100
  align-items: center;
117
101
  }
118
102
 
119
- div.searchbox-result-group {
120
- margin-left: 1em;
121
- border-left: 1px solid var(--list-item-bg-color-hover);
122
- }
123
-
124
103
  div.searchbox-filter-options {
125
104
  position: absolute;
126
105
  left: 0;
@@ -29,6 +29,7 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
29
29
  import React from 'react';
30
30
  import { ColorPicker } from '@vtaits/react-color-picker';
31
31
  import PropTypes from 'prop-types';
32
+ import MiscUtils from '../../utils/MiscUtils';
32
33
  import './style/ColorButton.css';
33
34
  import '@vtaits/react-color-picker/index.css';
34
35
  var defaultColors = [
@@ -119,7 +120,9 @@ var ColorButton = /*#__PURE__*/function (_React$Component) {
119
120
  className: "ColorButton"
120
121
  }, /*#__PURE__*/React.createElement("div", {
121
122
  className: "colorbutton-icon",
122
- onClick: this.togglePicker
123
+ onClick: this.togglePicker,
124
+ onKeyDown: MiscUtils.checkKeyActivate,
125
+ tabIndex: 0
123
126
  }, /*#__PURE__*/React.createElement("span", {
124
127
  style: {
125
128
  backgroundColor: this.cssColor(curColor)
@@ -141,7 +144,9 @@ var ColorButton = /*#__PURE__*/function (_React$Component) {
141
144
  },
142
145
  onContextMenu: function onContextMenu(ev) {
143
146
  return _this2.replaceDefaultColor(ev, idx);
144
- }
147
+ },
148
+ onKeyDown: MiscUtils.checkKeyActivate,
149
+ tabIndex: 0
145
150
  }, /*#__PURE__*/React.createElement("span", {
146
151
  style: {
147
152
  backgroundColor: _this2.cssColor(color)
@@ -84,7 +84,6 @@ var ComboBox = /*#__PURE__*/function (_React$Component) {
84
84
  value: function render() {
85
85
  var _this2 = this;
86
86
  var children = React.Children.toArray(this.props.children);
87
- var rect = this.el ? this.el.getBoundingClientRect() : null;
88
87
  var activeOption = children.filter(function (child) {
89
88
  return child.props.value === _this2.props.value;
90
89
  });
@@ -96,18 +95,23 @@ var ComboBox = /*#__PURE__*/function (_React$Component) {
96
95
  }
97
96
  }
98
97
  var filter = this.state.filter ? new RegExp(removeDiacritics(this.state.filter).replace(/[-[\]/{}()*+?.\\^$|]/g, "\\$&"), "i") : null;
98
+ var onClick = this.props.readOnly || isEmpty(children) ? null : function () {
99
+ return _this2.setState(function (state) {
100
+ return {
101
+ popup: !state.popup
102
+ };
103
+ });
104
+ };
99
105
  return /*#__PURE__*/React.createElement("div", {
100
- className: "combobox " + (this.props.className || ""),
101
- ref: function ref(el) {
102
- _this2.el = el;
103
- }
106
+ className: "combobox " + (this.props.className || "")
104
107
  }, /*#__PURE__*/React.createElement("div", {
105
108
  className: "combobox-button",
106
- onClick: this.props.readOnly || isEmpty(children) ? null : function () {
107
- return _this2.setState({
108
- popup: true
109
- });
110
- }
109
+ onClick: onClick,
110
+ onKeyDown: MiscUtils.checkKeyActivate,
111
+ ref: function ref(el) {
112
+ _this2.el = el;
113
+ },
114
+ tabIndex: 0
111
115
  }, /*#__PURE__*/React.createElement("span", {
112
116
  className: "combobox-button-content"
113
117
  }, activeOption), this.props.filterable && !this.props.readOnly ? /*#__PURE__*/React.createElement("input", {
@@ -118,20 +122,17 @@ var ComboBox = /*#__PURE__*/function (_React$Component) {
118
122
  }) : null, this.props.readOnly ? null : /*#__PURE__*/React.createElement(Icon, {
119
123
  icon: "chevron-down"
120
124
  })), this.el && this.state.popup ? /*#__PURE__*/React.createElement(PopupMenu, {
125
+ anchor: this.el,
121
126
  className: "combobox-menu" + (this.props.menuClassName ? " " + this.props.menuClassName : ""),
122
127
  onClose: function onClose() {
123
128
  return _this2.setState({
124
129
  popup: false
125
130
  });
126
- },
127
- width: rect.width,
128
- x: rect.left,
129
- y: rect.bottom
131
+ }
130
132
  }, children.map(function (child, idx) {
131
133
  var classNames = classnames({
132
134
  "combobox-menu-entry": true,
133
135
  "combobox-menu-entry-active": child.props.value === _this2.props.value && !child.props.disabled,
134
- "combobox-menu-entry-disabled": child.props.disabled,
135
136
  "combobox-menu-entry-group-header": child.props["data-group-header"] !== undefined
136
137
  });
137
138
  if (child.props["data-group"] !== undefined && !_this2.state.expanded.includes(child.props["data-group"])) {
@@ -143,8 +144,9 @@ var ComboBox = /*#__PURE__*/function (_React$Component) {
143
144
  var expanderIcon = _this2.state.expanded.includes(child.props["data-group-header"]) ? "collapse" : "expand";
144
145
  return /*#__PURE__*/React.createElement("div", {
145
146
  className: classNames,
147
+ disabled: child.props.disabled,
146
148
  key: "child:" + idx,
147
- onClickCapture: function onClickCapture(ev) {
149
+ onClick: function onClick(ev) {
148
150
  return _this2.onChildClicked(ev, child);
149
151
  }
150
152
  }, child.props["data-group-header"] !== undefined ? /*#__PURE__*/React.createElement(Icon, {
@@ -43,7 +43,6 @@ var EditableSelect = /*#__PURE__*/function (_React$Component) {
43
43
  popup: false
44
44
  });
45
45
  _defineProperty(_this, "renderOptions", function () {
46
- var rect = _this.el.getBoundingClientRect();
47
46
  var lvalue = _this.state.value.toLowerCase();
48
47
  var options = _this.props.options.map(function (option, idx) {
49
48
  var label = EditableSelect.optionLabel(option);
@@ -52,7 +51,7 @@ var EditableSelect = /*#__PURE__*/function (_React$Component) {
52
51
  }
53
52
  return /*#__PURE__*/React.createElement("div", {
54
53
  key: "opt" + idx,
55
- onClickCapture: function onClickCapture() {
54
+ onClick: function onClick() {
56
55
  return _this.optionSelected(option);
57
56
  },
58
57
  onMouseDown: MiscUtils.killEvent,
@@ -60,15 +59,13 @@ var EditableSelect = /*#__PURE__*/function (_React$Component) {
60
59
  }, label);
61
60
  }).filter(Boolean);
62
61
  return !isEmpty(options) ? /*#__PURE__*/React.createElement(PopupMenu, {
62
+ anchor: _this.el,
63
63
  className: "editable-select-dropdown",
64
64
  onClose: function onClose() {
65
65
  return _this.setState({
66
66
  popup: false
67
67
  });
68
- },
69
- width: rect.width,
70
- x: rect.left,
71
- y: rect.bottom
68
+ }
72
69
  }, options) : null;
73
70
  });
74
71
  _defineProperty(_this, "renderSelectedOption", function () {
@@ -116,16 +113,14 @@ var EditableSelect = /*#__PURE__*/function (_React$Component) {
116
113
  ev.target.select();
117
114
  _this.setState({
118
115
  focused: true,
119
- manualInput: false,
120
- popup: true
116
+ manualInput: false
121
117
  });
122
118
  });
123
119
  _defineProperty(_this, "onBlur", function () {
124
120
  if (!_this.props.readOnly) {
125
121
  _this.props.onChange(_this.state.value.trim());
126
122
  _this.setState({
127
- focused: false,
128
- popup: false
123
+ focused: false
129
124
  });
130
125
  }
131
126
  });