@eeacms/volto-cca-policy 0.2.26 → 0.2.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.
@@ -12,10 +12,10 @@
12
12
  pointer-events: all !important;
13
13
  }
14
14
 
15
- svg,
16
- svg * {
17
- pointer-events: none;
18
- }
15
+ // svg,
16
+ // svg * {
17
+ // pointer-events: none;
18
+ // }
19
19
 
20
20
  .link-active {
21
21
  .circle,
@@ -37,4 +37,5 @@
37
37
  display: flex;
38
38
  align-items: center;
39
39
  justify-content: center;
40
+ margin-bottom: 2em;
40
41
  }
@@ -69,43 +69,6 @@ export function removeTooltip() {
69
69
  }
70
70
  }
71
71
 
72
- // export const withCountriesData = (WrappedComponent) => {
73
- // function WithCountriesDataWrapped(props) {
74
- // let [cpath, setCpath] = React.useState();
75
- //
76
- // useEffect(() => {
77
- // if (!cpath) {
78
- // import('./euro-countries-simplified.js').then((mod) => {
79
- // const _cpath = mod.default;
80
- // _cpath.features = _cpath.features.map(function (c) {
81
- // //console.log(c);
82
- // var name = c.properties.SHRT_ENGL;
83
- // if (!name) {
84
- // // console.log('No flag for', c.properties);
85
- // return c;
86
- // } else if (name === 'Czechia') {
87
- // name = 'Czech Republic';
88
- // }
89
- // var cname = name.replace(' ', '_');
90
- // flags.forEach(function (f) {
91
- // if (f.indexOf(cname) > -1) {
92
- // c.url = f;
93
- // //console.log(c.url);
94
- // }
95
- // });
96
- // return c;
97
- // });
98
- //
99
- // setCpath(_cpath);
100
- // });
101
- // }
102
- // }, [cpath]);
103
- //
104
- // return cpath ? <WrappedComponent {...props} cpath={cpath} /> : null;
105
- // }
106
- // return WithCountriesDataWrapped;
107
- // };
108
-
109
72
  export function setTooltipVisibility(node, label, event, visible) {
110
73
  if (!node) return;
111
74
  if (visible) {
@@ -119,25 +82,28 @@ export function setTooltipVisibility(node, label, event, visible) {
119
82
  }
120
83
  }
121
84
 
122
- export const getClosestFeatureToCoordinate = (coordinate, features) => {
85
+ export const getClosestFeatureToCoordinate = (coordinate, features, ol) => {
123
86
  if (!features.length) return null;
124
87
  const x = coordinate[0];
125
88
  const y = coordinate[1];
126
89
  let closestFeature = null;
127
- const closestPoint = [NaN, NaN];
128
- let minSquaredDistance = Infinity;
129
90
 
130
91
  features.forEach((feature) => {
131
92
  const geometry = feature.getGeometry();
132
- const previousMinSquaredDistance = minSquaredDistance;
133
- minSquaredDistance = geometry.closestPointXY(
134
- x,
135
- y,
136
- closestPoint,
137
- minSquaredDistance,
138
- );
139
- if (minSquaredDistance < previousMinSquaredDistance) {
140
- closestFeature = feature;
93
+ const type = geometry.getType();
94
+
95
+ if (type === 'MultiPolygon') {
96
+ const polygons = geometry.getPolygons();
97
+ for (let i = 0; i < polygons.length; i++) {
98
+ if (polygons[i].containsXY(x, y)) {
99
+ closestFeature = feature;
100
+ break;
101
+ }
102
+ }
103
+ } else if (type === 'Polygon') {
104
+ if (geometry.containsXY(x, y)) {
105
+ closestFeature = feature;
106
+ }
141
107
  }
142
108
  });
143
109
 
@@ -1,5 +1,7 @@
1
1
  .relevant-acecontent-block,
2
2
  .search-acecontent-block {
3
+ margin: 1.7em 0 !important;
4
+
3
5
  .ui.list > .item a,
4
6
  .ui.list .list > .item a {
5
7
  color: @linkColor;
@@ -18,9 +20,19 @@
18
20
  color: @linkColor;
19
21
  font-size: 14px;
20
22
  }
23
+
24
+ &:first-child {
25
+ margin-top: 0 !important;
26
+ }
21
27
  }
22
28
 
23
29
  .filter-acecontent-block {
30
+ margin: 1.5em 0;
31
+
32
+ h5 {
33
+ margin-bottom: 0.3em;
34
+ margin-top: 1em;
35
+ }
24
36
  .react-select-container {
25
37
  width: 230px;
26
38
  border: 1px solid #bcbec0;