@opengeoweb/form-fields 12.1.1 → 12.2.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 +12 -8
  2. package/package.json +3 -3
package/index.esm.js CHANGED
@@ -1,8 +1,8 @@
1
1
  import { jsxs, jsx } from 'react/jsx-runtime';
2
2
  import { FormControl, FormHelperText, InputLabel, Select, RadioGroup, TextField, InputAdornment } from '@mui/material';
3
3
  import { useFormContext, useController, useForm, FormProvider } from 'react-hook-form';
4
- import { isEqual } from 'lodash';
5
4
  import { dateUtils } from '@opengeoweb/shared';
5
+ import { isEqual } from 'lodash';
6
6
  import 'i18next';
7
7
  import { useTranslation } from 'react-i18next';
8
8
  import * as React from 'react';
@@ -86,7 +86,7 @@ function _objectWithoutPropertiesLoose(r, e) {
86
86
  if (null == r) return {};
87
87
  var t = {};
88
88
  for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
89
- if (e.indexOf(n) >= 0) continue;
89
+ if (-1 !== e.indexOf(n)) continue;
90
90
  t[n] = r[n];
91
91
  }
92
92
  return t;
@@ -228,17 +228,21 @@ var isMaximumOneDrawing = function isMaximumOneDrawing(geojson) {
228
228
  return true;
229
229
  };
230
230
  var hasIntersectionWithFIR = function hasIntersectionWithFIR(geojson, intersection) {
231
+ var _geojson$features$, _geojson$features$2, _intersection$feature;
231
232
  if (!hasValidGeometry(geojson) ||
232
233
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
233
234
  // @ts-ignore
234
- !geojson.features[0].geometry.coordinates.length || geojson.features[0].geometry.type === 'Polygon' && !geojson.features[0].geometry.coordinates[0].length) {
235
+ !geojson.features[0].geometry.coordinates.length || ((_geojson$features$ = geojson.features[0]) == null || (_geojson$features$ = _geojson$features$.geometry) == null ? void 0 : _geojson$features$.type) === 'Polygon' && !((_geojson$features$2 = geojson.features[0]) != null && (_geojson$features$2 = _geojson$features$2.geometry) != null && (_geojson$features$2 = _geojson$features$2.coordinates) != null && (_geojson$features$2 = _geojson$features$2[0]) != null && _geojson$features$2.length)) {
235
236
  return true; // no need to check further when there is no drawing yet
236
237
  }
238
+ if (!(intersection != null && intersection.features) || intersection.features.length === 0 || !((_intersection$feature = intersection.features[0]) != null && _intersection$feature.geometry)) {
239
+ return false;
240
+ }
237
241
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
238
242
  // @ts-ignore
239
- var _intersection$feature = intersection.features[0].geometry,
240
- coordinates = _intersection$feature.coordinates,
241
- type = _intersection$feature.type;
243
+ var _intersection$feature2 = intersection.features[0].geometry,
244
+ coordinates = _intersection$feature2.coordinates,
245
+ type = _intersection$feature2.type;
242
246
  if (type === 'Point' && coordinates.length === 0) {
243
247
  return false;
244
248
  }
@@ -263,8 +267,8 @@ var hasMulitpleIntersections = function hasMulitpleIntersections(geojson) {
263
267
  return false;
264
268
  };
265
269
  var countIntersectionPoints = function countIntersectionPoints(geojson, intersection) {
266
- var _geojson$features$, _intersection$feature2;
267
- if (!(geojson != null && geojson.features) || !((_geojson$features$ = geojson.features[0]) != null && _geojson$features$.geometry) || !(intersection != null && intersection.features) || !((_intersection$feature2 = intersection.features[0]) != null && _intersection$feature2.geometry)) {
270
+ var _geojson$features$3, _intersection$feature3;
271
+ if (!(geojson != null && geojson.features) || !((_geojson$features$3 = geojson.features[0]) != null && _geojson$features$3.geometry) || !(intersection != null && intersection.features) || !((_intersection$feature3 = intersection.features[0]) != null && _intersection$feature3.geometry)) {
268
272
  return 0;
269
273
  }
270
274
  var geojsonGeometry = geojson.features[0].geometry;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opengeoweb/form-fields",
3
- "version": "12.1.1",
3
+ "version": "12.2.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": "12.1.1",
11
+ "@opengeoweb/theme": "12.2.0",
12
12
  "react-hook-form": "^7.50.1",
13
13
  "@mui/x-date-pickers": "^7.17.0",
14
14
  "lodash": "^4.17.21",
15
- "@opengeoweb/shared": "12.1.1",
15
+ "@opengeoweb/shared": "12.2.0",
16
16
  "react-i18next": "^15.1.1",
17
17
  "@mui/material": "^6.1.1",
18
18
  "i18next": "^23.11.5"