@eeacms/volto-arcgis-block 0.1.377 → 0.1.378

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/CHANGELOG.md CHANGED
@@ -4,8 +4,13 @@ All notable changes to this project will be documented in this file. Dates are d
4
4
 
5
5
  Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
6
6
 
7
+ ### [0.1.378](https://github.com/eea/volto-arcgis-block/compare/0.1.377...0.1.378) - 11 August 2025
8
+
7
9
  ### [0.1.377](https://github.com/eea/volto-arcgis-block/compare/0.1.376...0.1.377) - 30 July 2025
8
10
 
11
+ #### :hammer_and_wrench: Others
12
+
13
+ - Merge pull request #995 from eea/develop [Unai Bolivar - [`194ef38`](https://github.com/eea/volto-arcgis-block/commit/194ef385764f9d153fb46ac121bdc0f55d75ce20)]
9
14
  ### [0.1.376](https://github.com/eea/volto-arcgis-block/compare/0.1.375...0.1.376) - 17 July 2025
10
15
 
11
16
  ### [0.1.375](https://github.com/eea/volto-arcgis-block/compare/0.1.374...0.1.375) - 14 July 2025
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eeacms/volto-arcgis-block",
3
- "version": "0.1.377",
3
+ "version": "0.1.378",
4
4
  "description": "volto-arcgis-block: Volto add-on",
5
5
  "main": "src/index.js",
6
6
  "author": "European Environment Agency: CodeSyntax",
@@ -34,6 +34,12 @@ class AreaWidget extends React.Component {
34
34
  showMapMenu: false,
35
35
  showInfoPopup: this.props.download ? true : false,
36
36
  infoPopupType: 'area',
37
+ coordinates: {
38
+ north: '',
39
+ south: '',
40
+ east: '',
41
+ west: '',
42
+ },
37
43
  };
38
44
  this.menuClass =
39
45
  'esri-icon-cursor-marquee esri-widget--button esri-widget esri-interactive';
@@ -245,18 +251,14 @@ class AreaWidget extends React.Component {
245
251
  document
246
252
  .querySelector('.closeCoordinates')
247
253
  .classList.replace('esri-icon-up-arrow', 'esri-icon-close');
248
- if (document.getElementById('menu-north')) {
249
- document.getElementById('menu-north').value = null;
250
- }
251
- if (document.getElementById('menu-south')) {
252
- document.getElementById('menu-south').value = null;
253
- }
254
- if (document.getElementById('menu-east')) {
255
- document.getElementById('menu-east').value = null;
256
- }
257
- if (document.getElementById('menu-west')) {
258
- document.getElementById('menu-west').value = null;
259
- }
254
+ this.setState({
255
+ coordinates: {
256
+ north: '',
257
+ south: '',
258
+ east: '',
259
+ west: '',
260
+ },
261
+ });
260
262
  }
261
263
  }
262
264
  nuts0handler(e) {
@@ -1020,41 +1022,45 @@ class AreaWidget extends React.Component {
1020
1022
  addCoordinates() {
1021
1023
  this.clearWidget();
1022
1024
  let valid = true;
1023
- let pointNorth = document.getElementById('menu-north');
1025
+ let pointNorth = this.state.coordinates.north;
1024
1026
  if (
1025
- pointNorth.value > 90 ||
1026
- pointNorth.value < -90 ||
1027
- pointNorth.value == null
1027
+ pointNorth > 90 ||
1028
+ pointNorth < -90 ||
1029
+ pointNorth === null ||
1030
+ pointNorth === ''
1028
1031
  ) {
1029
1032
  valid = false;
1030
1033
  }
1031
- let pointSouth = document.getElementById('menu-south');
1034
+ let pointSouth = this.state.coordinates.south;
1032
1035
  if (
1033
- pointSouth.value > 90 ||
1034
- pointSouth.value < -90 ||
1035
- pointSouth.value == null
1036
+ pointSouth > 90 ||
1037
+ pointSouth < -90 ||
1038
+ pointSouth === null ||
1039
+ pointSouth === ''
1036
1040
  ) {
1037
1041
  valid = false;
1038
1042
  }
1039
- let pointEast = document.getElementById('menu-east');
1043
+ let pointEast = this.state.coordinates.east;
1040
1044
  if (
1041
- pointEast.value > 180 ||
1042
- pointEast.value < -180 ||
1043
- pointEast.value == null
1045
+ pointEast > 180 ||
1046
+ pointEast < -180 ||
1047
+ pointEast === null ||
1048
+ pointEast === ''
1044
1049
  ) {
1045
1050
  valid = false;
1046
1051
  }
1047
- let pointWest = document.getElementById('menu-west');
1052
+ let pointWest = this.state.coordinates.west;
1048
1053
  if (
1049
- pointWest.value > 180 ||
1050
- pointWest.value < -180 ||
1051
- pointWest.value == null
1054
+ pointWest > 180 ||
1055
+ pointWest < -180 ||
1056
+ pointWest === null ||
1057
+ pointWest === ''
1052
1058
  ) {
1053
1059
  valid = false;
1054
1060
  }
1055
1061
  if (valid) {
1056
- let pointNW = [pointNorth.value, pointWest.value];
1057
- let pointSE = [pointSouth.value, pointEast.value];
1062
+ let pointNW = [pointNorth, pointWest];
1063
+ let pointSE = [pointSouth, pointEast];
1058
1064
  var fillSymbol = {
1059
1065
  type: 'simple-fill',
1060
1066
  color: [255, 255, 255, 0.5],
@@ -1107,6 +1113,17 @@ class AreaWidget extends React.Component {
1107
1113
  });
1108
1114
  }
1109
1115
  }
1116
+ handleCoordinateChange = (e) => {
1117
+ const { id, value } = e.target;
1118
+ // id will be "menu-north", "menu-south", "menu-east", or "menu-west"
1119
+ const key = id.replace('menu-', ''); // gives you 'north', 'south', etc.
1120
+ this.setState((prevState) => ({
1121
+ coordinates: {
1122
+ ...prevState.coordinates,
1123
+ [key]: value,
1124
+ },
1125
+ }));
1126
+ };
1110
1127
  openCoordinates(event) {
1111
1128
  this.clearWidget();
1112
1129
  this.nutsRadioButton(event.target.value);
@@ -1823,6 +1840,8 @@ class AreaWidget extends React.Component {
1823
1840
  max="90"
1824
1841
  placeholder="00.000000"
1825
1842
  className="coordinateInput"
1843
+ value={this.state.coordinates.north}
1844
+ onChange={this.handleCoordinateChange}
1826
1845
  />
1827
1846
  </div>
1828
1847
  <div>
@@ -1834,6 +1853,8 @@ class AreaWidget extends React.Component {
1834
1853
  max="180"
1835
1854
  placeholder="00.000000"
1836
1855
  className="coordinateInput"
1856
+ value={this.state.coordinates.west}
1857
+ onChange={this.handleCoordinateChange}
1837
1858
  />
1838
1859
  </div>
1839
1860
  </div>
@@ -1848,6 +1869,8 @@ class AreaWidget extends React.Component {
1848
1869
  max="90"
1849
1870
  placeholder="00.000000"
1850
1871
  className="coordinateInput"
1872
+ value={this.state.coordinates.south}
1873
+ onChange={this.handleCoordinateChange}
1851
1874
  />
1852
1875
  </div>
1853
1876
  <div>
@@ -1859,6 +1882,8 @@ class AreaWidget extends React.Component {
1859
1882
  max="180"
1860
1883
  placeholder="00.000000"
1861
1884
  className="coordinateInput"
1885
+ value={this.state.coordinates.east}
1886
+ onChange={this.handleCoordinateChange}
1862
1887
  />
1863
1888
  </div>
1864
1889
  </div>
@@ -1093,6 +1093,7 @@ class MenuWidget extends React.Component {
1093
1093
  let button = familyDropdown.querySelector(
1094
1094
  '.ccl-expandable__button',
1095
1095
  );
1096
+ scrollPosition = familyDropdown.offsetTop;
1096
1097
  if (button) {
1097
1098
  button.setAttribute('aria-expanded', 'true');
1098
1099
  }