@opengeoweb/form-fields 14.3.0 → 14.5.0

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 (2) hide show
  1. package/index.esm.js +10 -13
  2. package/package.json +3 -3
package/index.esm.js CHANGED
@@ -218,17 +218,14 @@ var isValidGeoJsonCoordinates = function isValidGeoJsonCoordinates(geojson) {
218
218
  return false;
219
219
  };
220
220
  var isMaximumOneDrawing = function isMaximumOneDrawing(geojson) {
221
- var hasGeometry = hasValidGeometry(geojson);
222
- if (!hasGeometry) {
223
- return true; // no need to check further when there is no drawing yet
221
+ if (!hasValidGeometry(geojson)) {
222
+ return true;
224
223
  }
225
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
226
- // @ts-ignore
227
- var _geojson$features$0$g3 = geojson.features[0].geometry,
228
- coordinates = _geojson$features$0$g3.coordinates,
229
- type = _geojson$features$0$g3.type;
230
- // For type POLYGON only one array of coordinates is allowed
231
- if (type === 'Polygon' && coordinates.length > 1) {
224
+ var geometry = geojson.features[0].geometry;
225
+ if (geometry.type === 'MultiPolygon') {
226
+ return false;
227
+ }
228
+ if (geometry.type === 'Polygon' && geometry.coordinates.length > 1) {
232
229
  return false;
233
230
  }
234
231
  return true;
@@ -264,9 +261,9 @@ var hasMulitpleIntersections = function hasMulitpleIntersections(geojson) {
264
261
  }
265
262
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
266
263
  // @ts-ignore
267
- var _geojson$features$0$g4 = geojson.features[0].geometry,
268
- coordinates = _geojson$features$0$g4.coordinates,
269
- type = _geojson$features$0$g4.type;
264
+ var _geojson$features$0$g3 = geojson.features[0].geometry,
265
+ coordinates = _geojson$features$0$g3.coordinates,
266
+ type = _geojson$features$0$g3.type;
270
267
  if (type === 'MultiPolygon' || coordinates.length > 1 && type !== 'Point') {
271
268
  return true;
272
269
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opengeoweb/form-fields",
3
- "version": "14.3.0",
3
+ "version": "14.5.0",
4
4
  "description": "GeoWeb form-fields library for the opengeoweb project",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -8,11 +8,11 @@
8
8
  "url": "git@gitlab.com:opengeoweb/opengeoweb.git"
9
9
  },
10
10
  "dependencies": {
11
- "@opengeoweb/theme": "14.3.0",
11
+ "@opengeoweb/theme": "14.5.0",
12
12
  "react-hook-form": "^7.50.1",
13
13
  "@mui/x-date-pickers": "^8.11.2",
14
14
  "lodash": "^4.17.21",
15
- "@opengeoweb/shared": "14.3.0",
15
+ "@opengeoweb/shared": "14.5.0",
16
16
  "react-i18next": "^15.1.1",
17
17
  "@mui/material": "^7.0.1",
18
18
  "i18next": "^25.0.1",