qwc2 2026.8.6 → 2026.8.9
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.
- package/components/AttributeForm.js +8 -0
- package/components/EditUploadField.js +7 -6
- package/components/IdentifyViewer.js +59 -34
- package/components/LinkFeatureForm.js +7 -2
- package/components/QtDesignerForm.js +99 -84
- package/components/style/QtDesignerForm.css +11 -13
- package/components/style/SearchBox.css +7 -4
- package/components/widgets/TextInput.js +3 -9
- package/package.json +1 -1
- package/plugins/Identify.js +110 -23
- package/scripts/themesConfig.js +4 -0
- package/scripts/themesConfig.py +2 -0
- package/static/translations/bg-BG.json +3 -0
- package/static/translations/ca-ES.json +3 -0
- package/static/translations/cs-CZ.json +3 -0
- package/static/translations/de-CH.json +3 -0
- package/static/translations/de-DE.json +3 -0
- package/static/translations/en-US.json +3 -0
- package/static/translations/es-ES.json +3 -0
- package/static/translations/fi-FI.json +3 -0
- package/static/translations/fr-FR.json +3 -0
- package/static/translations/hu-HU.json +3 -0
- package/static/translations/it-IT.json +3 -0
- package/static/translations/ja-JP.json +3 -0
- package/static/translations/nl-NL.json +3 -0
- package/static/translations/no-NO.json +3 -0
- package/static/translations/pl-PL.json +3 -0
- package/static/translations/pt-BR.json +3 -0
- package/static/translations/pt-PT.json +3 -0
- package/static/translations/ro-RO.json +3 -0
- package/static/translations/ru-RU.json +3 -0
- package/static/translations/sv-SE.json +3 -0
- package/static/translations/tr-TR.json +3 -0
- package/static/translations/tsconfig.json +3 -0
- package/static/translations/uk-UA.json +3 -0
- package/utils/ServiceLayerUtils.js +2 -0
|
@@ -575,6 +575,10 @@ var AttributeForm = /*#__PURE__*/function (_React$Component) {
|
|
|
575
575
|
// Ensure numeric values are numbers and not strings
|
|
576
576
|
value = Number(value);
|
|
577
577
|
}
|
|
578
|
+
if (nrelFieldConfig.type === 'boolean' && value !== null && typeof value === "string") {
|
|
579
|
+
// Ensure boolean values are bools
|
|
580
|
+
value = value.trim().toLowerCase() === "true";
|
|
581
|
+
}
|
|
578
582
|
|
|
579
583
|
// relationValues for table must exist as rows are either pre-existing or were added
|
|
580
584
|
if (!(field in relationValues[datasetname].features[index].properties)) {
|
|
@@ -621,6 +625,10 @@ var AttributeForm = /*#__PURE__*/function (_React$Component) {
|
|
|
621
625
|
// Ensure numeric values are numbers and not strings
|
|
622
626
|
value = Number(value);
|
|
623
627
|
}
|
|
628
|
+
if (fieldConfig.type === 'boolean' && value !== null && typeof value === "string") {
|
|
629
|
+
// Ensure boolean values are bools
|
|
630
|
+
value = value.trim().toLowerCase() === "true";
|
|
631
|
+
}
|
|
624
632
|
if (!(name in feature.properties)) {
|
|
625
633
|
feature.defaultedProperties = [].concat(_toConsumableArray(feature.defaultedProperties || []), [name]);
|
|
626
634
|
}
|
|
@@ -1,7 +1,5 @@
|
|
|
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
2
|
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); }
|
|
3
|
-
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; }
|
|
4
|
-
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; }
|
|
5
3
|
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
6
4
|
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); } }
|
|
7
5
|
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
@@ -210,18 +208,21 @@ var EditUploadField = /*#__PURE__*/function (_React$Component) {
|
|
|
210
208
|
}, {
|
|
211
209
|
key: "render",
|
|
212
210
|
value: function render() {
|
|
213
|
-
var _this$
|
|
211
|
+
var _this$props$constrain,
|
|
212
|
+
_this$props$constrain2,
|
|
213
|
+
_this$state$imageData2,
|
|
214
214
|
_fileType$startsWith2,
|
|
215
215
|
_this2 = this;
|
|
216
216
|
var isAttachment = this.props.value.startsWith("attachment:");
|
|
217
217
|
var fileValue = isAttachment ? this.props.value.replace(/attachment:\/\//, '') : this.props.value;
|
|
218
218
|
var fileType = mime.lookup(fileValue);
|
|
219
219
|
var fileUrl = isAttachment ? this.props.iface.resolveAttachmentUrl(this.props.dataset, fileValue) : fileValue;
|
|
220
|
-
var constraints =
|
|
221
|
-
|
|
220
|
+
var constraints = {
|
|
221
|
+
required: (_this$props$constrain = this.props.constraints) === null || _this$props$constrain === void 0 ? void 0 : _this$props$constrain.required,
|
|
222
|
+
accept: (((_this$props$constrain2 = this.props.constraints) === null || _this$props$constrain2 === void 0 ? void 0 : _this$props$constrain2.accept) || "").split(",").map(function (ext) {
|
|
222
223
|
return mime.lookup(ext);
|
|
223
224
|
}).join(",")
|
|
224
|
-
}
|
|
225
|
+
};
|
|
225
226
|
var mediaSupport = 'mediaDevices' in navigator && constraints.accept.split(",").includes("image/jpeg");
|
|
226
227
|
var imageData = (_this$state$imageData2 = this.state.imageData) !== null && _this$state$imageData2 !== void 0 ? _this$state$imageData2 : fileType !== null && fileType !== void 0 && (_fileType$startsWith2 = fileType.startsWith) !== null && _fileType$startsWith2 !== void 0 && _fileType$startsWith2.call(fileType, 'image/') ? fileUrl : null;
|
|
227
228
|
if (imageData) {
|
|
@@ -363,11 +363,33 @@ var IdentifyViewer = /*#__PURE__*/function (_React$Component) {
|
|
|
363
363
|
_defineProperty(_this, "storeIdentifyResults", function () {
|
|
364
364
|
return new Promise(function (resolve) {
|
|
365
365
|
return resolve({
|
|
366
|
-
identifyResults: _this.
|
|
366
|
+
identifyResults: _this.serializeResults(),
|
|
367
367
|
currentResultDisplayMode: _this.props.resultDisplayMode
|
|
368
368
|
});
|
|
369
369
|
});
|
|
370
370
|
});
|
|
371
|
+
_defineProperty(_this, "serializeResults", function () {
|
|
372
|
+
return Object.fromEntries(Object.entries(_this.state.resultTree).map(function (_ref10) {
|
|
373
|
+
var _ref11 = _slicedToArray(_ref10, 2),
|
|
374
|
+
layerid = _ref11[0],
|
|
375
|
+
features = _ref11[1];
|
|
376
|
+
var _layerid$split = layerid.split("#", 2),
|
|
377
|
+
_layerid$split2 = _slicedToArray(_layerid$split, 2),
|
|
378
|
+
layerUrl = _layerid$split2[0],
|
|
379
|
+
layerName = _layerid$split2[1];
|
|
380
|
+
var match = LayerUtils.searchLayer(_this.props.layers, 'url', layerUrl, 'name', layerName);
|
|
381
|
+
if (match && match.sublayer.primary_key) {
|
|
382
|
+
return [layerid, {
|
|
383
|
+
key: match.sublayer.primary_key,
|
|
384
|
+
values: features.map(function (feature) {
|
|
385
|
+
return MiscUtils.isNumeric(feature.id) ? Number(feature.id) : feature.id;
|
|
386
|
+
})
|
|
387
|
+
}];
|
|
388
|
+
} else {
|
|
389
|
+
return [layerid, features];
|
|
390
|
+
}
|
|
391
|
+
}));
|
|
392
|
+
});
|
|
371
393
|
_defineProperty(_this, "getCurrentResultFeature", function () {
|
|
372
394
|
var _this$state$resultTre, _this$state$resultTre2, _this$state$resultTre3, _this$state$currentRe;
|
|
373
395
|
return (_this$state$resultTre = (_this$state$resultTre2 = _this.state.resultTree[(_this$state$currentRe = _this.state.currentResult) === null || _this$state$currentRe === void 0 ? void 0 : _this$state$currentRe.layerid]) === null || _this$state$resultTre2 === void 0 || (_this$state$resultTre3 = _this$state$resultTre2.find) === null || _this$state$resultTre3 === void 0 ? void 0 : _this$state$resultTre3.call(_this$state$resultTre2, function (feature) {
|
|
@@ -490,10 +512,10 @@ var IdentifyViewer = /*#__PURE__*/function (_React$Component) {
|
|
|
490
512
|
});
|
|
491
513
|
if (exporter) {
|
|
492
514
|
if (!_this.props.exportGeometry) {
|
|
493
|
-
json = Object.entries(json).reduce(function (res,
|
|
494
|
-
var
|
|
495
|
-
layerId =
|
|
496
|
-
features =
|
|
515
|
+
json = Object.entries(json).reduce(function (res, _ref14) {
|
|
516
|
+
var _ref15 = _slicedToArray(_ref14, 2),
|
|
517
|
+
layerId = _ref15[0],
|
|
518
|
+
features = _ref15[1];
|
|
497
519
|
return _objectSpread(_objectSpread({}, res), {}, _defineProperty({}, layerId, features.map(function (feature) {
|
|
498
520
|
return MiscUtils.objectOmit(feature, ['geometry']);
|
|
499
521
|
})));
|
|
@@ -521,10 +543,10 @@ var IdentifyViewer = /*#__PURE__*/function (_React$Component) {
|
|
|
521
543
|
style: {
|
|
522
544
|
maxHeight: _this.state.currentResult ? '10em' : 'initial'
|
|
523
545
|
}
|
|
524
|
-
}, Object.entries(_this.state.resultTree).map(function (
|
|
525
|
-
var
|
|
526
|
-
layerid =
|
|
527
|
-
features =
|
|
546
|
+
}, Object.entries(_this.state.resultTree).map(function (_ref16) {
|
|
547
|
+
var _ref17 = _slicedToArray(_ref16, 2),
|
|
548
|
+
layerid = _ref17[0],
|
|
549
|
+
features = _ref17[1];
|
|
528
550
|
if (features.length === 0) {
|
|
529
551
|
return null;
|
|
530
552
|
}
|
|
@@ -805,20 +827,20 @@ var IdentifyViewer = /*#__PURE__*/function (_React$Component) {
|
|
|
805
827
|
_defineProperty(_this, "renderResultsTable", function () {
|
|
806
828
|
return /*#__PURE__*/React.createElement("div", {
|
|
807
829
|
className: "identify-results-tables"
|
|
808
|
-
}, Object.entries(_this.state.resultTree).map(function (
|
|
809
|
-
var
|
|
810
|
-
layerid =
|
|
811
|
-
features =
|
|
830
|
+
}, Object.entries(_this.state.resultTree).map(function (_ref18) {
|
|
831
|
+
var _ref19 = _slicedToArray(_ref18, 2),
|
|
832
|
+
layerid = _ref19[0],
|
|
833
|
+
features = _ref19[1];
|
|
812
834
|
if (features.length === 0 || _this.state.selectedLayer && layerid !== _this.state.selectedLayer) {
|
|
813
835
|
return null;
|
|
814
836
|
}
|
|
815
837
|
var fields = {};
|
|
816
838
|
features.map(function (feature) {
|
|
817
|
-
Object.entries(feature.properties).map(function (
|
|
818
|
-
var
|
|
819
|
-
attr =
|
|
820
|
-
value =
|
|
821
|
-
if (!(attr in fields)) {
|
|
839
|
+
Object.entries(feature.properties).map(function (_ref20) {
|
|
840
|
+
var _ref21 = _slicedToArray(_ref20, 2),
|
|
841
|
+
attr = _ref21[0],
|
|
842
|
+
value = _ref21[1];
|
|
843
|
+
if (!(attr in fields) && !['htmlContent', 'htmlContentInline'].includes(attr)) {
|
|
822
844
|
fields[attr] = {
|
|
823
845
|
id: attr,
|
|
824
846
|
name: attr
|
|
@@ -1061,10 +1083,10 @@ var IdentifyViewer = /*#__PURE__*/function (_React$Component) {
|
|
|
1061
1083
|
}, /*#__PURE__*/React.createElement("option", {
|
|
1062
1084
|
disabled: true,
|
|
1063
1085
|
value: ""
|
|
1064
|
-
}, LocaleUtils.tr("identify.selectreport")), Object.entries(_this.state.reports).map(function (
|
|
1065
|
-
var
|
|
1066
|
-
layername =
|
|
1067
|
-
reports =
|
|
1086
|
+
}, LocaleUtils.tr("identify.selectreport")), Object.entries(_this.state.reports).map(function (_ref23) {
|
|
1087
|
+
var _ref24 = _slicedToArray(_ref23, 2),
|
|
1088
|
+
layername = _ref24[0],
|
|
1089
|
+
reports = _ref24[1];
|
|
1068
1090
|
return reports.map(function (report, idx) {
|
|
1069
1091
|
return /*#__PURE__*/React.createElement("option", {
|
|
1070
1092
|
key: layername + "::" + idx,
|
|
@@ -1328,6 +1350,7 @@ var IdentifyViewer = /*#__PURE__*/function (_React$Component) {
|
|
|
1328
1350
|
key: "componentDidMount",
|
|
1329
1351
|
value: function componentDidMount() {
|
|
1330
1352
|
this.updateResultTree();
|
|
1353
|
+
this.props.innerRef(this);
|
|
1331
1354
|
}
|
|
1332
1355
|
}, {
|
|
1333
1356
|
key: "componentDidUpdate",
|
|
@@ -1360,6 +1383,7 @@ var IdentifyViewer = /*#__PURE__*/function (_React$Component) {
|
|
|
1360
1383
|
}, {
|
|
1361
1384
|
key: "componentWillUnmount",
|
|
1362
1385
|
value: function componentWillUnmount() {
|
|
1386
|
+
this.props.innerRef(null);
|
|
1363
1387
|
this.props.removeLayer("__identifyviewerhighlight");
|
|
1364
1388
|
unregisterPermalinkDataStoreHook("identifyresultstate");
|
|
1365
1389
|
}
|
|
@@ -1369,10 +1393,10 @@ var IdentifyViewer = /*#__PURE__*/function (_React$Component) {
|
|
|
1369
1393
|
var _this2 = this;
|
|
1370
1394
|
var body = null;
|
|
1371
1395
|
var resultTree = this.state.selectedLayer !== '' ? _defineProperty({}, this.state.selectedLayer, this.state.resultTree[this.state.selectedLayer]) : this.state.resultTree;
|
|
1372
|
-
var flatResults = Object.entries(resultTree).map(function (
|
|
1373
|
-
var
|
|
1374
|
-
layerid =
|
|
1375
|
-
features =
|
|
1396
|
+
var flatResults = Object.entries(resultTree).map(function (_ref27) {
|
|
1397
|
+
var _ref28 = _slicedToArray(_ref27, 2),
|
|
1398
|
+
layerid = _ref28[0],
|
|
1399
|
+
features = _ref28[1];
|
|
1376
1400
|
return features.map(function (feature) {
|
|
1377
1401
|
return [layerid, feature];
|
|
1378
1402
|
});
|
|
@@ -1400,10 +1424,10 @@ var IdentifyViewer = /*#__PURE__*/function (_React$Component) {
|
|
|
1400
1424
|
} else if (this.props.resultDisplayMode === 'flat') {
|
|
1401
1425
|
body = /*#__PURE__*/React.createElement("div", {
|
|
1402
1426
|
className: "identify-flat-results-list"
|
|
1403
|
-
}, Object.entries(resultTree).map(function (
|
|
1404
|
-
var
|
|
1405
|
-
layerid =
|
|
1406
|
-
features =
|
|
1427
|
+
}, Object.entries(resultTree).map(function (_ref29) {
|
|
1428
|
+
var _ref30 = _slicedToArray(_ref29, 2),
|
|
1429
|
+
layerid = _ref30[0],
|
|
1430
|
+
features = _ref30[1];
|
|
1407
1431
|
return features.map(function (feature) {
|
|
1408
1432
|
return _this2.renderResultAttributes(layerid, feature, 'identify-result-frame');
|
|
1409
1433
|
});
|
|
@@ -1417,10 +1441,10 @@ var IdentifyViewer = /*#__PURE__*/function (_React$Component) {
|
|
|
1417
1441
|
body = /*#__PURE__*/React.createElement("div", {
|
|
1418
1442
|
className: "identify-compare-results",
|
|
1419
1443
|
style: _style
|
|
1420
|
-
}, results.map(function (
|
|
1421
|
-
var
|
|
1422
|
-
layerid =
|
|
1423
|
-
feature =
|
|
1444
|
+
}, results.map(function (_ref31) {
|
|
1445
|
+
var _ref32 = _slicedToArray(_ref31, 2),
|
|
1446
|
+
layerid = _ref32[0],
|
|
1447
|
+
feature = _ref32[1];
|
|
1424
1448
|
return _this2.renderResultAttributes(layerid, feature, 'identify-result-frame');
|
|
1425
1449
|
}));
|
|
1426
1450
|
} else if (this.state.currentPage < flatResults.length) {
|
|
@@ -1455,6 +1479,7 @@ _defineProperty(IdentifyViewer, "propTypes", {
|
|
|
1455
1479
|
highlightAllResults: PropTypes.bool,
|
|
1456
1480
|
identifyResults: PropTypes.object,
|
|
1457
1481
|
iframeDialogsInitiallyDocked: PropTypes.bool,
|
|
1482
|
+
innerRef: PropTypes.func,
|
|
1458
1483
|
layers: PropTypes.array,
|
|
1459
1484
|
longAttributesDisplay: PropTypes.oneOf(['ellipsis', 'wrap']),
|
|
1460
1485
|
map: PropTypes.object,
|
|
@@ -31,6 +31,7 @@ import { getFeatureTemplate } from '../utils/EditingUtils';
|
|
|
31
31
|
import LocaleUtils from '../utils/LocaleUtils';
|
|
32
32
|
import MapUtils from '../utils/MapUtils';
|
|
33
33
|
import AttributeForm from './AttributeForm';
|
|
34
|
+
import Icon from './Icon';
|
|
34
35
|
import './style/LinkFeatureForm.css';
|
|
35
36
|
var LinkFeatureForm = /*#__PURE__*/function (_React$Component) {
|
|
36
37
|
function LinkFeatureForm() {
|
|
@@ -203,7 +204,9 @@ var LinkFeatureForm = /*#__PURE__*/function (_React$Component) {
|
|
|
203
204
|
}, /*#__PURE__*/React.createElement("button", {
|
|
204
205
|
className: "button",
|
|
205
206
|
onClick: this.close
|
|
206
|
-
},
|
|
207
|
+
}, /*#__PURE__*/React.createElement(Icon, {
|
|
208
|
+
icon: "remove"
|
|
209
|
+
}), LocaleUtils.tr("common.close"))));
|
|
207
210
|
} else if (editContext.feature) {
|
|
208
211
|
var drawing = editContext.action === 'Draw' && !editContext.feature.geometry && this.props.editConfig.geomType;
|
|
209
212
|
return /*#__PURE__*/React.createElement("div", {
|
|
@@ -223,7 +226,9 @@ var LinkFeatureForm = /*#__PURE__*/function (_React$Component) {
|
|
|
223
226
|
}, /*#__PURE__*/React.createElement("button", {
|
|
224
227
|
className: "button",
|
|
225
228
|
onClick: this.close
|
|
226
|
-
},
|
|
229
|
+
}, /*#__PURE__*/React.createElement(Icon, {
|
|
230
|
+
icon: "remove"
|
|
231
|
+
}), editContext.action === 'Draw' ? LocaleUtils.tr("common.cancel") : LocaleUtils.tr("common.close"))));
|
|
227
232
|
} else {
|
|
228
233
|
return null;
|
|
229
234
|
}
|