qwc2 2026.8.22 → 2026.8.28

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 (52) hide show
  1. package/components/AttributeForm.js +70 -60
  2. package/components/AttributeTableWidget.js +26 -25
  3. package/components/IdentifyViewer.js +75 -334
  4. package/components/ImportLayer.js +56 -9
  5. package/components/LinkFeatureForm.js +3 -8
  6. package/components/QtDesignerForm.js +111 -80
  7. package/components/ResizeableWindow.js +2 -1
  8. package/components/style/ImportLayer.css +22 -0
  9. package/components/style/QtDesignerForm.css +3 -2
  10. package/components/style/ResizeableWindow.css +10 -16
  11. package/components/widgets/ComboBox.js +10 -5
  12. package/components/widgets/NavBar.js +5 -4
  13. package/components/widgets/PopupMenu.js +17 -4
  14. package/components/widgets/SearchWidget.js +28 -15
  15. package/components/widgets/style/ComboBox.css +6 -1
  16. package/package.json +3 -2
  17. package/plugins/Identify.js +250 -83
  18. package/plugins/MapDropImport.js +3 -1
  19. package/plugins/MapExport.js +10 -6
  20. package/plugins/MapFilter.js +2 -8
  21. package/plugins/Redlining.js +45 -14
  22. package/plugins/map/LocateSupport.js +1 -1
  23. package/static/translations/bg-BG.json +6 -3
  24. package/static/translations/ca-ES.json +6 -3
  25. package/static/translations/cs-CZ.json +5 -2
  26. package/static/translations/de-CH.json +7 -4
  27. package/static/translations/de-DE.json +7 -4
  28. package/static/translations/en-US.json +7 -4
  29. package/static/translations/es-ES.json +6 -3
  30. package/static/translations/fi-FI.json +5 -2
  31. package/static/translations/fr-FR.json +7 -4
  32. package/static/translations/hu-HU.json +5 -2
  33. package/static/translations/it-IT.json +7 -4
  34. package/static/translations/ja-JP.json +6 -3
  35. package/static/translations/nl-NL.json +5 -2
  36. package/static/translations/no-NO.json +5 -2
  37. package/static/translations/pl-PL.json +5 -2
  38. package/static/translations/pt-BR.json +5 -2
  39. package/static/translations/pt-PT.json +5 -2
  40. package/static/translations/ro-RO.json +6 -3
  41. package/static/translations/ru-RU.json +5 -2
  42. package/static/translations/sv-SE.json +5 -2
  43. package/static/translations/tr-TR.json +6 -3
  44. package/static/translations/tsconfig.json +5 -2
  45. package/static/translations/uk-UA.json +5 -2
  46. package/utils/DataServiceExprUtils.js +38 -10
  47. package/utils/DxfUtils.js +192 -36
  48. package/utils/FileImportUtils.js +137 -43
  49. package/utils/IdentifyExporters.js +305 -0
  50. package/utils/IdentifyUtils.js +98 -7
  51. package/utils/LayerUtils.js +27 -7
  52. package/utils/PermaLinkUtils.js +33 -50
@@ -257,49 +257,67 @@ var AttributeForm = /*#__PURE__*/function (_React$Component) {
257
257
  }
258
258
  }
259
259
  });
260
- _defineProperty(_this, "addRelationRecord", function (table) {
261
- var newRelationValues = _objectSpread({}, _this.props.editContext.feature.relationValues);
262
- var editConfig = _this.props.editConfigs[_this.props.editContext.mapPrefix][table.split('.').slice(-1)];
260
+ _defineProperty(_this, "addRelationRecord", function (dataset) {
261
+ var initialProperties = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
262
+ var action = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
263
+ var layer = dataset.slice(_this.props.editContext.mapPrefix.length + 1);
264
+ var editConfig = _this.props.editConfigs[_this.props.editContext.mapPrefix][layer];
263
265
  getFeatureTemplate(editConfig, {
264
266
  type: "Feature",
265
- properties: {}
267
+ properties: _objectSpread({}, initialProperties)
266
268
  }, _this.props.iface, _this.props.editContext.mapPrefix, _this.props.map.projection, function (newRelFeature) {
267
- newRelFeature.__status__ = "empty";
269
+ newRelFeature.__status__ = "new";
268
270
  if (editConfig.geomType === null) {
269
271
  newRelFeature.geometry = null;
270
272
  }
271
273
  // If feature id is known, i.e. not when drawing new feature, set foreign key
272
274
  if (_this.props.editContext.action !== "Draw") {
273
- var relTable = _this.state.relationTables[table];
275
+ var relTable = _this.state.relationTables[dataset];
274
276
  var fkVal = relTable.pkField ? _this.props.editContext.feature.properties[relTable.pkField] : _this.props.editContext.feature.id;
275
277
  newRelFeature.properties[relTable.fkField] = fkVal;
276
278
  }
277
- newRelationValues[table] = _objectSpread({}, newRelationValues[table]);
278
- newRelationValues[table].features = newRelationValues[table].features.concat([newRelFeature]);
279
- var newFeature = _objectSpread(_objectSpread({}, _this.props.editContext.feature), {}, {
280
- relationValues: newRelationValues
281
- });
282
- _this.props.setEditContext(_this.props.editContext.id, {
283
- feature: newFeature,
284
- changed: true
285
- });
279
+ if (action) {
280
+ var childEdit = {
281
+ action: action,
282
+ editConfig: editConfig,
283
+ editContextId: ':' + dataset,
284
+ idx: null,
285
+ feature: newRelFeature,
286
+ finishCallback: _this.finishEditRelationRecord,
287
+ hideDelete: true
288
+ };
289
+ _this.setState({
290
+ childEdit: childEdit
291
+ });
292
+ } else {
293
+ var newRelationValues = _objectSpread({}, _this.props.editContext.feature.relationValues);
294
+ newRelationValues[dataset] = _objectSpread({}, newRelationValues[dataset]);
295
+ newRelationValues[dataset].features = newRelationValues[dataset].features.concat([newRelFeature]);
296
+ var newFeature = _objectSpread(_objectSpread({}, _this.props.editContext.feature), {}, {
297
+ relationValues: newRelationValues
298
+ });
299
+ _this.props.setEditContext(_this.props.editContext.id, {
300
+ feature: newFeature,
301
+ changed: true
302
+ });
303
+ }
286
304
  });
287
305
  });
288
- _defineProperty(_this, "reorderRelationRecord", function (table, idx, dir) {
289
- var nFeatures = _this.props.editContext.feature.relationValues[table].features.length;
306
+ _defineProperty(_this, "reorderRelationRecord", function (dataset, idx, dir) {
307
+ var nFeatures = _this.props.editContext.feature.relationValues[dataset].features.length;
290
308
  if (dir < 0 && idx === 0 || dir > 0 && idx >= nFeatures - 1) {
291
309
  return;
292
310
  }
293
311
  var newRelationValues = _objectSpread({}, _this.props.editContext.feature.relationValues);
294
- newRelationValues[table] = _objectSpread({}, newRelationValues[table]);
295
- var newFeatures = newRelationValues[table].features.slice(0);
312
+ newRelationValues[dataset] = _objectSpread({}, newRelationValues[dataset]);
313
+ var newFeatures = newRelationValues[dataset].features.slice(0);
296
314
  var offset = dir < 0 ? 0 : 1;
297
315
  newFeatures.splice(idx - 1 + offset, 2, newFeatures[idx + offset], newFeatures[idx - 1 + offset]);
298
316
  newFeatures[idx - 1 + offset].properties = _objectSpread({}, newFeatures[idx - 1 + offset].properties);
299
317
  newFeatures[idx + offset].properties = _objectSpread({}, newFeatures[idx + offset].properties);
300
- newFeatures[idx - 1 + offset].__status__ = ["new", "empty"].includes(newFeatures[idx - 1 + offset].__status__) ? "new" : "changed";
301
- newFeatures[idx + offset].__status__ = ["new", "empty"].includes(newFeatures[idx + offset].__status__) ? "new" : "changed";
302
- newRelationValues[table].features = newFeatures;
318
+ newFeatures[idx - 1 + offset].__status__ = newFeatures[idx - 1 + offset].__status__ === "new" ? "new" : "changed";
319
+ newFeatures[idx + offset].__status__ = newFeatures[idx + offset].__status__ === "new" ? "new" : "changed";
320
+ newRelationValues[dataset].features = newFeatures;
303
321
  var newFeature = _objectSpread(_objectSpread({}, _this.props.editContext.feature), {}, {
304
322
  relationValues: newRelationValues
305
323
  });
@@ -308,16 +326,16 @@ var AttributeForm = /*#__PURE__*/function (_React$Component) {
308
326
  changed: true
309
327
  });
310
328
  });
311
- _defineProperty(_this, "removeRelationRecord", function (table, idx) {
329
+ _defineProperty(_this, "removeRelationRecord", function (dataset, idx) {
312
330
  var newRelationValues = _objectSpread({}, _this.props.editContext.feature.relationValues);
313
- newRelationValues[table] = _objectSpread({}, newRelationValues[table]);
314
- newRelationValues[table].features = newRelationValues[table].features.slice(0);
315
- var fieldStatus = newRelationValues[table].features[idx].__status__ || "";
331
+ newRelationValues[dataset] = _objectSpread({}, newRelationValues[dataset]);
332
+ newRelationValues[dataset].features = newRelationValues[dataset].features.slice(0);
333
+ var fieldStatus = newRelationValues[dataset].features[idx].__status__ || "";
316
334
  // If field was new, delete it directly, else mark it as deleted
317
- if (["new", "empty"].includes(fieldStatus)) {
318
- newRelationValues[table].features.splice(idx, 1);
335
+ if (fieldStatus === "new") {
336
+ newRelationValues[dataset].features.splice(idx, 1);
319
337
  } else {
320
- newRelationValues[table].features[idx] = _objectSpread(_objectSpread({}, newRelationValues[table].features[idx]), {}, {
338
+ newRelationValues[dataset].features[idx] = _objectSpread(_objectSpread({}, newRelationValues[dataset].features[idx]), {}, {
321
339
  __status__: fieldStatus.startsWith("deleted") ? fieldStatus.substr(8) : "deleted:" + fieldStatus
322
340
  });
323
341
  }
@@ -329,13 +347,13 @@ var AttributeForm = /*#__PURE__*/function (_React$Component) {
329
347
  changed: true
330
348
  });
331
349
  });
332
- _defineProperty(_this, "updateRelationField", function (table, idx, key, value) {
350
+ _defineProperty(_this, "updateRelationField", function (dataset, idx, key, value) {
333
351
  var newRelationValues = _objectSpread({}, _this.props.editContext.feature.relationValues);
334
- newRelationValues[table] = _objectSpread({}, newRelationValues[table]);
335
- newRelationValues[table].features = newRelationValues[table].features.slice(0);
336
- newRelationValues[table].features[idx] = _objectSpread(_objectSpread({}, newRelationValues[table].features[idx]), {}, {
337
- properties: _objectSpread(_objectSpread({}, newRelationValues[table].features[idx].properties), {}, _defineProperty({}, key, value)),
338
- __status__: ["new", "empty"].includes(newRelationValues[table].features[idx].__status__) ? "new" : "changed"
352
+ newRelationValues[dataset] = _objectSpread({}, newRelationValues[dataset]);
353
+ newRelationValues[dataset].features = newRelationValues[dataset].features.slice(0);
354
+ newRelationValues[dataset].features[idx] = _objectSpread(_objectSpread({}, newRelationValues[dataset].features[idx]), {}, {
355
+ properties: _objectSpread(_objectSpread({}, newRelationValues[dataset].features[idx].properties), {}, _defineProperty({}, key, value)),
356
+ __status__: newRelationValues[dataset].features[idx].__status__ === "new" ? "new" : "changed"
339
357
  });
340
358
  var newFeature = _objectSpread(_objectSpread({}, _this.props.editContext.feature), {}, {
341
359
  relationValues: newRelationValues
@@ -345,19 +363,17 @@ var AttributeForm = /*#__PURE__*/function (_React$Component) {
345
363
  changed: true
346
364
  });
347
365
  });
348
- _defineProperty(_this, "editRelationRecord", function (action, layer, idx, displayField) {
349
- var dataset = _this.props.editContext.mapPrefix + "." + layer;
366
+ _defineProperty(_this, "editRelationRecord", function (dataset, idx) {
367
+ var layer = dataset.slice(_this.props.editContext.mapPrefix.length + 1);
350
368
  var editConfig = _this.props.editConfigs[_this.props.editContext.mapPrefix][layer];
351
- var feature = _this.props.editContext.feature.relationValues[dataset].features[idx];
369
+ var feature = _this.props.editContext.feature.relationValues[editConfig.editDataset].features[idx];
352
370
  var childEdit = {
353
- action: action,
371
+ action: feature.__status__ === 'new' ? 'Create' : 'Edit',
354
372
  editConfig: editConfig,
355
- editContextId: ':' + layer,
356
- dataset: dataset,
373
+ editContextId: ':' + dataset,
357
374
  idx: idx,
358
375
  feature: feature,
359
376
  finishCallback: _this.finishEditRelationRecord,
360
- displayField: displayField,
361
377
  hideDelete: true
362
378
  };
363
379
  _this.setState({
@@ -367,22 +383,22 @@ var AttributeForm = /*#__PURE__*/function (_React$Component) {
367
383
  _defineProperty(_this, "finishEditRelationRecord", function (feature) {
368
384
  _this.props.clearEditContext(_this.state.childEdit.editContextId, _this.props.editContext.id);
369
385
  if (feature) {
370
- var table = _this.state.childEdit.dataset;
371
- var idx = _this.state.childEdit.idx;
386
+ var _this$state$childEdit;
387
+ var dataset = _this.state.childEdit.editConfig.editDataset;
372
388
  var newRelationValues = _objectSpread({}, _this.props.editContext.feature.relationValues);
373
- newRelationValues[table] = _objectSpread({}, newRelationValues[table]);
374
- newRelationValues[table].features = newRelationValues[table].features.slice(0);
375
- newRelationValues[table].features[idx] = _objectSpread(_objectSpread({}, feature), {}, {
376
- properties: _objectSpread({}, feature.properties)
389
+ var idx = (_this$state$childEdit = _this.state.childEdit.idx) !== null && _this$state$childEdit !== void 0 ? _this$state$childEdit : newRelationValues[dataset].features.length;
390
+ newRelationValues[dataset] = _objectSpread({}, newRelationValues[dataset]);
391
+ newRelationValues[dataset].features = newRelationValues[dataset].features.slice(0);
392
+ newRelationValues[dataset].features[idx] = _objectSpread(_objectSpread({}, feature), {}, {
393
+ __status__: "changed"
377
394
  });
378
395
  // If feature id is known, i.e. not when drawing new feature, set foreign key
379
396
  var changed = _this.props.editContext.changed;
380
- var relTable = _this.state.relationTables[table];
397
+ var relTable = _this.state.relationTables[dataset];
381
398
  var fkVal = relTable.pkField ? _this.props.editContext.feature.properties[relTable.pkField] : _this.props.editContext.feature.id;
382
- var fkField = _this.state.relationTables[table].fkField;
399
+ var fkField = _this.state.relationTables[dataset].fkField;
383
400
  if (_this.props.editContext.action !== "Draw" && feature.properties[fkField] !== fkVal) {
384
- newRelationValues[table].features[idx].properties[fkField] = fkVal;
385
- newRelationValues[table].features[idx].__status__ = "changed";
401
+ newRelationValues[dataset].features[idx].properties = _objectSpread(_objectSpread({}, newRelationValues[dataset].features[idx].properties), {}, _defineProperty({}, fkField, fkVal));
386
402
  changed = true;
387
403
  }
388
404
  var newFeature = _objectSpread(_objectSpread({}, _this.props.editContext.feature), {}, {
@@ -585,9 +601,6 @@ var AttributeForm = /*#__PURE__*/function (_React$Component) {
585
601
  relationValues[datasetname].features[index].defaultedProperties = [].concat(_toConsumableArray(relationValues[datasetname].features[index].defaultedProperties || []), [field]);
586
602
  }
587
603
  relationValues[datasetname].features[index].properties[field] = value;
588
- if (relationValues[datasetname].features[index].__status__ === "empty") {
589
- relationValues[datasetname].features[index].__status__ = "new";
590
- }
591
604
  if (element.type === "file" && element.files.length > 0) {
592
605
  relationUploads[name] = element.files[0];
593
606
  relationValues[datasetname].features[index].properties[field] = "";
@@ -683,9 +696,7 @@ var AttributeForm = /*#__PURE__*/function (_React$Component) {
683
696
 
684
697
  // Set relation values CRS and sort index if necessary
685
698
  Object.keys(relationValues).forEach(function (relTable) {
686
- relationValues[relTable].features = relationValues[relTable].features.filter(function (relFeature) {
687
- return relFeature.__status__ !== "empty";
688
- }).map(function (relFeature, idx) {
699
+ relationValues[relTable].features = relationValues[relTable].features.map(function (relFeature, idx) {
689
700
  var newRelFeature = _objectSpread(_objectSpread({}, relFeature), {}, {
690
701
  crs: {
691
702
  type: "name",
@@ -856,7 +867,7 @@ var AttributeForm = /*#__PURE__*/function (_React$Component) {
856
867
  type: mimeString
857
868
  });
858
869
  });
859
- _defineProperty(_this, "startChildEdit", function (action, layer, featureId, updateField, displayField) {
870
+ _defineProperty(_this, "startChildEdit", function (action, layer, featureId, updateField) {
860
871
  var editConfig = _this.props.editConfigs[_this.props.editContext.mapPrefix][layer];
861
872
  if (!editConfig) {
862
873
  // eslint-disable-next-line
@@ -866,7 +877,6 @@ var AttributeForm = /*#__PURE__*/function (_React$Component) {
866
877
  action: action,
867
878
  editConfig: editConfig,
868
879
  editContextId: ':' + layer,
869
- displayField: displayField,
870
880
  featureId: featureId,
871
881
  updateField: updateField,
872
882
  finishCallback: _this.finishChildEdit,
@@ -56,6 +56,7 @@ import LayerUtils from '../utils/LayerUtils';
56
56
  import LocaleUtils from '../utils/LocaleUtils';
57
57
  import MapUtils from '../utils/MapUtils';
58
58
  import VectorLayerUtils from '../utils/VectorLayerUtils';
59
+ import ComboBox from './widgets/ComboBox';
59
60
  import FeaturesTable from './widgets/FeaturesTable';
60
61
  import './style/AttributeTableWidget.css';
61
62
  var AttributeTableWidget = /*#__PURE__*/function (_React$Component) {
@@ -827,17 +828,17 @@ var AttributeTableWidget = /*#__PURE__*/function (_React$Component) {
827
828
  if (fieldConfig.constraints.keyvalrel) {
828
829
  values = KeyValCache.getSync(this.props.iface, fieldConfig.constraints.keyvalrel);
829
830
  }
830
- valueInput = /*#__PURE__*/React.createElement("select", {
831
+ valueInput = /*#__PURE__*/React.createElement(ComboBox, {
831
832
  className: "attribtable-filter-value",
832
833
  disabled: footbarDisabled,
833
- onChange: function onChange(ev) {
834
- return _this2.updateFilter("filterVal", ev.target.value);
834
+ onChange: function onChange(value) {
835
+ return _this2.updateFilter("filterVal", value);
835
836
  },
836
837
  value: this.state.filterVal
837
- }, /*#__PURE__*/React.createElement("option", {
838
+ }, /*#__PURE__*/React.createElement("div", {
838
839
  value: ""
839
840
  }, LocaleUtils.tr("common.select")), values.map(function (entry) {
840
- return /*#__PURE__*/React.createElement("option", {
841
+ return /*#__PURE__*/React.createElement("div", {
841
842
  key: entry.value,
842
843
  value: entry.value
843
844
  }, entry.label);
@@ -874,16 +875,16 @@ var AttributeTableWidget = /*#__PURE__*/function (_React$Component) {
874
875
  className: "attribtable-filter controlgroup"
875
876
  }, /*#__PURE__*/React.createElement(Icon, {
876
877
  icon: "filter"
877
- }), /*#__PURE__*/React.createElement("select", {
878
+ }), /*#__PURE__*/React.createElement(ComboBox, {
878
879
  disabled: footbarDisabled,
879
- onChange: function onChange(ev) {
880
- return _this2.updateFilter("filterField", ev.target.value);
880
+ onChange: function onChange(value) {
881
+ return _this2.updateFilter("filterField", value);
881
882
  },
882
883
  value: this.state.filterField
883
- }, /*#__PURE__*/React.createElement("option", {
884
+ }, /*#__PURE__*/React.createElement("div", {
884
885
  disabled: true,
885
886
  value: ""
886
- }, LocaleUtils.tr("common.select")), showIdColumn ? /*#__PURE__*/React.createElement("option", {
887
+ }, LocaleUtils.tr("common.select")), showIdColumn ? /*#__PURE__*/React.createElement("div", {
887
888
  value: "<id>"
888
889
  }, this.translateFieldName(primaryKey)) : null, this.state.curFields.map(function (field) {
889
890
  if (field.id !== primaryKey) {
@@ -893,25 +894,25 @@ var AttributeTableWidget = /*#__PURE__*/function (_React$Component) {
893
894
  }, _this2.translateFieldName(field.name));
894
895
  }
895
896
  return null;
896
- })), /*#__PURE__*/React.createElement("select", {
897
+ })), /*#__PURE__*/React.createElement(ComboBox, {
897
898
  disabled: footbarDisabled,
898
- onChange: function onChange(ev) {
899
- return _this2.updateFilter("filterOp", ev.target.value);
899
+ onChange: function onChange(value) {
900
+ return _this2.updateFilter("filterOp", value);
900
901
  },
901
902
  value: this.state.filterOp
902
- }, /*#__PURE__*/React.createElement("option", {
903
+ }, /*#__PURE__*/React.createElement("div", {
903
904
  value: "~"
904
- }, "~"), /*#__PURE__*/React.createElement("option", {
905
+ }, "~"), /*#__PURE__*/React.createElement("div", {
905
906
  value: "="
906
- }, "="), /*#__PURE__*/React.createElement("option", {
907
+ }, "="), /*#__PURE__*/React.createElement("div", {
907
908
  value: "!="
908
- }, "!="), /*#__PURE__*/React.createElement("option", {
909
+ }, "!="), /*#__PURE__*/React.createElement("div", {
909
910
  value: ">"
910
- }, ">"), /*#__PURE__*/React.createElement("option", {
911
+ }, ">"), /*#__PURE__*/React.createElement("div", {
911
912
  value: ">="
912
- }, ">="), /*#__PURE__*/React.createElement("option", {
913
+ }, ">="), /*#__PURE__*/React.createElement("div", {
913
914
  value: "<="
914
- }, "<="), /*#__PURE__*/React.createElement("option", {
915
+ }, "<="), /*#__PURE__*/React.createElement("div", {
915
916
  value: "<"
916
917
  }, "<")), valueInput), this.props.showLimitToExtent ? /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("label", null, /*#__PURE__*/React.createElement("input", {
917
918
  checked: this.state.limitToExtent,
@@ -988,19 +989,19 @@ var AttributeTableWidget = /*#__PURE__*/function (_React$Component) {
988
989
  className: "AttributeTable"
989
990
  }, /*#__PURE__*/React.createElement("div", {
990
991
  className: "attribtable-toolbar"
991
- }, this.props.showLayerSelection ? /*#__PURE__*/React.createElement("select", {
992
+ }, this.props.showLayerSelection ? /*#__PURE__*/React.createElement(ComboBox, {
992
993
  disabled: loading || editing,
993
- onChange: function onChange(ev) {
994
+ onChange: function onChange(value) {
994
995
  return _this2.setState({
995
- selectedLayer: ev.target.value
996
+ selectedLayer: value
996
997
  });
997
998
  },
998
999
  value: this.state.selectedLayer || ""
999
- }, /*#__PURE__*/React.createElement("option", {
1000
+ }, /*#__PURE__*/React.createElement("div", {
1000
1001
  disabled: true,
1001
1002
  value: ""
1002
1003
  }, LocaleUtils.tr("common.selectlayer")), editLayers.map(function (entry) {
1003
- return /*#__PURE__*/React.createElement("option", {
1004
+ return /*#__PURE__*/React.createElement("div", {
1004
1005
  key: entry.value,
1005
1006
  value: entry.value
1006
1007
  }, entry.title);