@eox/itemfilter 0.3.0 → 0.5.1
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/dist/eox-itemfilter.js +2466 -1260
- package/dist/eox-itemfilter.umd.cjs +83 -63
- package/package.json +3 -2
- package/test/config.cy.ts +3 -3
- package/test/general.cy.ts +11 -3
- package/test/inlineMode.cy.ts +1 -1
- package/test/reducedWidth.cy.ts +1 -1
- package/test/styledResults.cy.ts +1 -1
- package/test/testItems.json +120 -20
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eox/itemfilter",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"devDependencies": {
|
|
6
6
|
"@eox/eslint-config": "^1.0.0",
|
|
@@ -30,6 +30,7 @@
|
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"fuse.js": "^6.6.2",
|
|
32
32
|
"lit": "^2.7.4",
|
|
33
|
-
"lodash.debounce": "^4.0.8"
|
|
33
|
+
"lodash.debounce": "^4.0.8",
|
|
34
|
+
"toolcool-range-slider": "^4.0.27"
|
|
34
35
|
}
|
|
35
36
|
}
|
package/test/config.cy.ts
CHANGED
|
@@ -9,7 +9,7 @@ describe("Item Filter Config", () => {
|
|
|
9
9
|
// default config
|
|
10
10
|
EOxItemFilter.config = {
|
|
11
11
|
titleProperty: "title",
|
|
12
|
-
filterProperties: ["themes"],
|
|
12
|
+
filterProperties: [{ key: "themes" }],
|
|
13
13
|
aggregateResults: "themes",
|
|
14
14
|
enableSearch: true,
|
|
15
15
|
enableHighlighting: true,
|
|
@@ -70,7 +70,7 @@ describe("Item Filter Config", () => {
|
|
|
70
70
|
// have to replace the entire config, otherwise enableSearch = false doesn't work
|
|
71
71
|
EOxItemFilter.config = {
|
|
72
72
|
titleProperty: "title",
|
|
73
|
-
filterProperties: ["themes"],
|
|
73
|
+
filterProperties: [{ key: "themes" }],
|
|
74
74
|
aggregateResults: "themes",
|
|
75
75
|
enableSearch: false,
|
|
76
76
|
enableHighlighting: true,
|
|
@@ -109,7 +109,7 @@ describe("Item Filter Config", () => {
|
|
|
109
109
|
// have to replace the entire config, otherwise exclusiveFilters = true doesn't work
|
|
110
110
|
EOxItemFilter.config = {
|
|
111
111
|
titleProperty: "title",
|
|
112
|
-
filterProperties: ["themes"],
|
|
112
|
+
filterProperties: [{ key: "themes" }],
|
|
113
113
|
aggregateResults: "themes",
|
|
114
114
|
enableSearch: false,
|
|
115
115
|
enableHighlighting: true,
|
package/test/general.cy.ts
CHANGED
|
@@ -11,13 +11,21 @@ describe("Item Filter", () => {
|
|
|
11
11
|
const EOxItemFilter = <EOxItemFilter>$el[0];
|
|
12
12
|
EOxItemFilter.config = {
|
|
13
13
|
titleProperty: "title",
|
|
14
|
-
filterProperties: [
|
|
15
|
-
|
|
14
|
+
filterProperties: [
|
|
15
|
+
{ key: "themes", title: "Theme", exclusive: true },
|
|
16
|
+
// { key: "code" },
|
|
17
|
+
// { key: "likes", type: "range" },
|
|
18
|
+
// { key: "year", type: "range" },
|
|
19
|
+
{ key: "years", type: "range" },
|
|
20
|
+
{ key: "datetime", type: "range", format: "date" },
|
|
21
|
+
],
|
|
22
|
+
aggregateResults: "themes",
|
|
16
23
|
enableSearch: true,
|
|
17
24
|
enableHighlighting: true,
|
|
18
25
|
// showResults: false,
|
|
19
26
|
fuseConfig: {
|
|
20
|
-
keys: ["title", "description", "themes"],
|
|
27
|
+
// keys: ["title", "description", "themes", "code", "datetime"],
|
|
28
|
+
keys: ["title", "datetime"],
|
|
21
29
|
},
|
|
22
30
|
// onSelect: (item: any) => {
|
|
23
31
|
// console.log(item);
|
package/test/inlineMode.cy.ts
CHANGED
|
@@ -13,7 +13,7 @@ describe("Item Filter", () => {
|
|
|
13
13
|
EOxItemFilter.style.border = "1px solid grey";
|
|
14
14
|
EOxItemFilter.config = {
|
|
15
15
|
titleProperty: "title",
|
|
16
|
-
filterProperties: ["themes", "code"],
|
|
16
|
+
filterProperties: [{ key: "themes" }, { key: "code" }],
|
|
17
17
|
enableSearch: true,
|
|
18
18
|
showResults: false,
|
|
19
19
|
inlineMode: true,
|
package/test/reducedWidth.cy.ts
CHANGED
|
@@ -11,7 +11,7 @@ describe("Item Filter", () => {
|
|
|
11
11
|
const EOxItemFilter = <EOxItemFilter>$el[0];
|
|
12
12
|
EOxItemFilter.config = {
|
|
13
13
|
titleProperty: "title",
|
|
14
|
-
filterProperties: ["themes"],
|
|
14
|
+
filterProperties: [{ key: "themes" }],
|
|
15
15
|
aggregateResults: "themes",
|
|
16
16
|
enableSearch: true,
|
|
17
17
|
};
|
package/test/styledResults.cy.ts
CHANGED
|
@@ -11,7 +11,7 @@ describe("Item Filter", () => {
|
|
|
11
11
|
const EOxItemFilter = <EOxItemFilter>$el[0];
|
|
12
12
|
EOxItemFilter.config = {
|
|
13
13
|
titleProperty: "title",
|
|
14
|
-
filterProperties: ["themes", "code"],
|
|
14
|
+
filterProperties: [{ key: "themes" }, { key: "code" }],
|
|
15
15
|
enableSearch: true,
|
|
16
16
|
inlineMode: true,
|
|
17
17
|
};
|
package/test/testItems.json
CHANGED
|
@@ -6,7 +6,12 @@
|
|
|
6
6
|
"indicator": "Actively managed total area from Sentinel-2 data",
|
|
7
7
|
"themes": ["agriculture"],
|
|
8
8
|
"title": "White Asparagus area [%]",
|
|
9
|
-
"name": "Actively managed total area from Sentinel-2 data"
|
|
9
|
+
"name": "Actively managed total area from Sentinel-2 data",
|
|
10
|
+
"year": 2000,
|
|
11
|
+
"likes": 4,
|
|
12
|
+
"years": [2000, 2000],
|
|
13
|
+
"timestamp": "2023-06-14T13:56:38+00:00",
|
|
14
|
+
"datetime": ["2023-06-14T10:56:38+00:00", "2023-06-14T22:56:38+00:00"]
|
|
10
15
|
},
|
|
11
16
|
{
|
|
12
17
|
"archived": false,
|
|
@@ -15,7 +20,12 @@
|
|
|
15
20
|
"indicator": "Agricultural Workers",
|
|
16
21
|
"themes": ["agriculture"],
|
|
17
22
|
"title": "Workers availability [nr]",
|
|
18
|
-
"name": "Agricultural Workers"
|
|
23
|
+
"name": "Agricultural Workers",
|
|
24
|
+
"year": 2020,
|
|
25
|
+
"likes": 46,
|
|
26
|
+
"years": [2007, 2020],
|
|
27
|
+
"timestamp": "2023-06-13T13:56:38+00:00",
|
|
28
|
+
"datetime": ["2023-06-13T10:56:38+00:00", "2023-06-13T22:56:38+00:00"]
|
|
19
29
|
},
|
|
20
30
|
{
|
|
21
31
|
"archived": false,
|
|
@@ -24,7 +34,12 @@
|
|
|
24
34
|
"indicator": "Air Quality",
|
|
25
35
|
"themes": ["air"],
|
|
26
36
|
"title": "City level NO2 (S5p)",
|
|
27
|
-
"name": "Air Quality"
|
|
37
|
+
"name": "Air Quality",
|
|
38
|
+
"year": 2023,
|
|
39
|
+
"likes": 34,
|
|
40
|
+
"years": [2008, 2023],
|
|
41
|
+
"timestamp": "2023-06-12T13:56:38+00:00",
|
|
42
|
+
"datetime": ["2023-06-12T10:56:38+00:00", "2023-06-12T22:56:38+00:00"]
|
|
28
43
|
},
|
|
29
44
|
{
|
|
30
45
|
"archived": false,
|
|
@@ -33,7 +48,12 @@
|
|
|
33
48
|
"indicator": "Average number of vessels in a km2 cell in a given period",
|
|
34
49
|
"themes": ["economy"],
|
|
35
50
|
"title": "Vessel density (all) [h/sqkm]",
|
|
36
|
-
"name": "Average number of vessels in a km2 cell in a given period"
|
|
51
|
+
"name": "Average number of vessels in a km2 cell in a given period",
|
|
52
|
+
"year": 2022,
|
|
53
|
+
"likes": 177,
|
|
54
|
+
"years": [2021, 2022],
|
|
55
|
+
"timestamp": "2023-06-11T13:56:38+00:00",
|
|
56
|
+
"datetime": ["2023-06-11T10:56:38+00:00", "2023-06-11T22:56:38+00:00"]
|
|
37
57
|
},
|
|
38
58
|
{
|
|
39
59
|
"archived": false,
|
|
@@ -42,7 +62,12 @@
|
|
|
42
62
|
"indicator": "Average number of vessels in a km2 cell in a given period",
|
|
43
63
|
"themes": ["economy"],
|
|
44
64
|
"title": "Vessel density (cargo) [h/sqkm]",
|
|
45
|
-
"name": "Average number of vessels in a km2 cell in a given period"
|
|
65
|
+
"name": "Average number of vessels in a km2 cell in a given period",
|
|
66
|
+
"year": 2016,
|
|
67
|
+
"likes": 0,
|
|
68
|
+
"years": [2005, 2016],
|
|
69
|
+
"timestamp": "2023-06-10T13:56:38+00:00",
|
|
70
|
+
"datetime": ["2023-06-10T10:56:38+00:00", "2023-06-10T22:56:38+00:00"]
|
|
46
71
|
},
|
|
47
72
|
{
|
|
48
73
|
"archived": false,
|
|
@@ -51,7 +76,12 @@
|
|
|
51
76
|
"indicator": "Average number of vessels in a km2 cell in a given period",
|
|
52
77
|
"themes": ["economy"],
|
|
53
78
|
"title": "Vessel density (tanker) [h/sqkm]",
|
|
54
|
-
"name": "Average number of vessels in a km2 cell in a given period"
|
|
79
|
+
"name": "Average number of vessels in a km2 cell in a given period",
|
|
80
|
+
"year": 2017,
|
|
81
|
+
"likes": 0,
|
|
82
|
+
"years": [2006, 2017],
|
|
83
|
+
"timestamp": "2023-06-09T13:56:38+00:00",
|
|
84
|
+
"datetime": ["2023-06-09T10:56:38+00:00", "2023-06-09T22:56:38+00:00"]
|
|
55
85
|
},
|
|
56
86
|
{
|
|
57
87
|
"archived": false,
|
|
@@ -60,7 +90,12 @@
|
|
|
60
90
|
"indicator": "Average number of vessels in a km2 cell in a given period",
|
|
61
91
|
"themes": ["economy"],
|
|
62
92
|
"title": "Vessel density (others) [h/sqkm]",
|
|
63
|
-
"name": "Average number of vessels in a km2 cell in a given period"
|
|
93
|
+
"name": "Average number of vessels in a km2 cell in a given period",
|
|
94
|
+
"year": 2003,
|
|
95
|
+
"likes": 2,
|
|
96
|
+
"years": [2001, 2003],
|
|
97
|
+
"timestamp": "2023-06-08T13:56:38+00:00",
|
|
98
|
+
"datetime": ["2023-06-08T10:56:38+00:00", "2023-06-08T22:56:38+00:00"]
|
|
64
99
|
},
|
|
65
100
|
{
|
|
66
101
|
"archived": false,
|
|
@@ -70,7 +105,12 @@
|
|
|
70
105
|
"themes": ["economy", "air"],
|
|
71
106
|
"title": "Ships - NO2 Correlation",
|
|
72
107
|
"indicatorOverwrite": "Ports and Shipping - impact on air quality",
|
|
73
|
-
"name": "Boat traffic - NO2 level"
|
|
108
|
+
"name": "Boat traffic - NO2 level",
|
|
109
|
+
"year": 2020,
|
|
110
|
+
"likes": 65,
|
|
111
|
+
"years": [2015, 2020],
|
|
112
|
+
"timestamp": "2023-06-07T13:56:38+00:00",
|
|
113
|
+
"datetime": ["2023-06-07T10:56:38+00:00", "2023-06-07T22:56:38+00:00"]
|
|
74
114
|
},
|
|
75
115
|
{
|
|
76
116
|
"archived": false,
|
|
@@ -79,7 +119,12 @@
|
|
|
79
119
|
"indicator": "C3S Data",
|
|
80
120
|
"themes": ["air"],
|
|
81
121
|
"title": "Temperature",
|
|
82
|
-
"name": "C3S Data"
|
|
122
|
+
"name": "C3S Data",
|
|
123
|
+
"year": 2021,
|
|
124
|
+
"likes": 34,
|
|
125
|
+
"years": [2021, 2021],
|
|
126
|
+
"timestamp": "2023-06-06T13:56:38+00:00",
|
|
127
|
+
"datetime": ["2023-06-06T10:56:38+00:00", "2023-06-06T22:56:38+00:00"]
|
|
83
128
|
},
|
|
84
129
|
{
|
|
85
130
|
"archived": false,
|
|
@@ -88,7 +133,12 @@
|
|
|
88
133
|
"indicator": "CAMS Air Quality",
|
|
89
134
|
"themes": ["air"],
|
|
90
135
|
"title": "City level PM2.5 (model)",
|
|
91
|
-
"name": "CAMS Air Quality"
|
|
136
|
+
"name": "CAMS Air Quality",
|
|
137
|
+
"year": 2023,
|
|
138
|
+
"likes": 88,
|
|
139
|
+
"years": [2000, 2023],
|
|
140
|
+
"timestamp": "2023-06-05T13:56:38+00:00",
|
|
141
|
+
"datetime": ["2023-06-05T10:56:38+00:00", "2023-06-05T22:56:38+00:00"]
|
|
92
142
|
},
|
|
93
143
|
{
|
|
94
144
|
"archived": false,
|
|
@@ -97,7 +147,12 @@
|
|
|
97
147
|
"indicator": "CAMS Air Quality",
|
|
98
148
|
"themes": ["air"],
|
|
99
149
|
"title": "City level NO2 (model)",
|
|
100
|
-
"name": "CAMS Air Quality"
|
|
150
|
+
"name": "CAMS Air Quality",
|
|
151
|
+
"year": 2022,
|
|
152
|
+
"likes": 77,
|
|
153
|
+
"years": [2019, 2022],
|
|
154
|
+
"timestamp": "2023-06-04T13:56:38+00:00",
|
|
155
|
+
"datetime": ["2023-06-04T10:56:38+00:00", "2023-06-04T22:56:38+00:00"]
|
|
101
156
|
},
|
|
102
157
|
{
|
|
103
158
|
"archived": false,
|
|
@@ -106,7 +161,12 @@
|
|
|
106
161
|
"indicator": "CAMS Air Quality",
|
|
107
162
|
"themes": ["air"],
|
|
108
163
|
"title": "City level PM10 (model)",
|
|
109
|
-
"name": "CAMS Air Quality"
|
|
164
|
+
"name": "CAMS Air Quality",
|
|
165
|
+
"year": 2018,
|
|
166
|
+
"likes": 23,
|
|
167
|
+
"years": [2014, 2018],
|
|
168
|
+
"timestamp": "2023-06-03T13:56:38+00:00",
|
|
169
|
+
"datetime": ["2023-06-03T10:56:38+00:00", "2023-06-03T22:56:38+00:00"]
|
|
110
170
|
},
|
|
111
171
|
{
|
|
112
172
|
"archived": false,
|
|
@@ -115,7 +175,12 @@
|
|
|
115
175
|
"indicator": "CAMS Air Quality",
|
|
116
176
|
"themes": ["air"],
|
|
117
177
|
"title": "City level O3 (model)",
|
|
118
|
-
"name": "CAMS Air Quality"
|
|
178
|
+
"name": "CAMS Air Quality",
|
|
179
|
+
"year": 2018,
|
|
180
|
+
"likes": 56,
|
|
181
|
+
"years": [2017, 2018],
|
|
182
|
+
"timestamp": "2023-06-02T13:56:38+00:00",
|
|
183
|
+
"datetime": ["2023-06-02T10:56:38+00:00", "2023-06-02T22:56:38+00:00"]
|
|
119
184
|
},
|
|
120
185
|
{
|
|
121
186
|
"archived": false,
|
|
@@ -124,7 +189,12 @@
|
|
|
124
189
|
"indicator": "Cargo ships in port based on AIS data",
|
|
125
190
|
"themes": ["economy"],
|
|
126
191
|
"title": "Cargo Ships [nr]",
|
|
127
|
-
"name": "Cargo ships in port based on AIS data"
|
|
192
|
+
"name": "Cargo ships in port based on AIS data",
|
|
193
|
+
"year": 2019,
|
|
194
|
+
"likes": 11,
|
|
195
|
+
"years": [2018, 2019],
|
|
196
|
+
"timestamp": "2023-06-01T13:56:38+00:00",
|
|
197
|
+
"datetime": ["2023-06-01T10:56:38+00:00", "2023-06-01T22:56:38+00:00"]
|
|
128
198
|
},
|
|
129
199
|
{
|
|
130
200
|
"archived": false,
|
|
@@ -133,7 +203,12 @@
|
|
|
133
203
|
"indicator": "Changes in traffic based on mobile data",
|
|
134
204
|
"themes": ["economy"],
|
|
135
205
|
"title": "Trucks transiting ports [%]",
|
|
136
|
-
"name": "Changes in traffic based on mobile data"
|
|
206
|
+
"name": "Changes in traffic based on mobile data",
|
|
207
|
+
"year": 2017,
|
|
208
|
+
"likes": 8,
|
|
209
|
+
"years": [2015, 2017],
|
|
210
|
+
"timestamp": "2023-05-29T13:56:38+00:00",
|
|
211
|
+
"datetime": ["2023-05-29T10:56:38+00:00", "2023-05-29T22:56:38+00:00"]
|
|
137
212
|
},
|
|
138
213
|
{
|
|
139
214
|
"archived": false,
|
|
@@ -142,7 +217,12 @@
|
|
|
142
217
|
"indicator": "CMEMS product",
|
|
143
218
|
"themes": ["water"],
|
|
144
219
|
"title": "CHL-a concentration (map, 1km)",
|
|
145
|
-
"name": "CMEMS product"
|
|
220
|
+
"name": "CMEMS product",
|
|
221
|
+
"year": 2015,
|
|
222
|
+
"likes": 37,
|
|
223
|
+
"years": [2014, 2015],
|
|
224
|
+
"timestamp": "2023-05-28T13:56:38+00:00",
|
|
225
|
+
"datetime": ["2023-05-28T10:56:38+00:00", "2023-05-28T22:56:38+00:00"]
|
|
146
226
|
},
|
|
147
227
|
{
|
|
148
228
|
"archived": false,
|
|
@@ -151,7 +231,12 @@
|
|
|
151
231
|
"indicator": "Covid-19 cases",
|
|
152
232
|
"themes": ["health"],
|
|
153
233
|
"title": "Covid-19 cases",
|
|
154
|
-
"name": "Covid-19 cases"
|
|
234
|
+
"name": "Covid-19 cases",
|
|
235
|
+
"year": 2013,
|
|
236
|
+
"likes": 4,
|
|
237
|
+
"years": [2001, 2013],
|
|
238
|
+
"timestamp": "2023-05-27T13:56:38+00:00",
|
|
239
|
+
"datetime": ["2023-05-27T10:56:38+00:00", "2023-05-27T22:56:38+00:00"]
|
|
155
240
|
},
|
|
156
241
|
{
|
|
157
242
|
"archived": false,
|
|
@@ -160,7 +245,12 @@
|
|
|
160
245
|
"indicator": "Covid-19 vaccinations",
|
|
161
246
|
"themes": ["health"],
|
|
162
247
|
"title": "Covid-19 vaccinations",
|
|
163
|
-
"name": "Covid-19 vaccinations"
|
|
248
|
+
"name": "Covid-19 vaccinations",
|
|
249
|
+
"year": 2016,
|
|
250
|
+
"likes": 39,
|
|
251
|
+
"years": [2015, 2016],
|
|
252
|
+
"timestamp": "2023-05-26T13:56:38+00:00",
|
|
253
|
+
"datetime": ["2023-05-26T10:56:38+00:00", "2023-05-26T22:56:38+00:00"]
|
|
164
254
|
},
|
|
165
255
|
{
|
|
166
256
|
"archived": false,
|
|
@@ -169,7 +259,12 @@
|
|
|
169
259
|
"indicator": "Crude Oil and other input materials",
|
|
170
260
|
"themes": ["economy"],
|
|
171
261
|
"title": "Raw Material Inventory",
|
|
172
|
-
"name": "Crude Oil and other input materials"
|
|
262
|
+
"name": "Crude Oil and other input materials",
|
|
263
|
+
"year": 2020,
|
|
264
|
+
"likes": 28,
|
|
265
|
+
"years": [2014, 2020],
|
|
266
|
+
"timestamp": "2023-05-25T13:56:38+00:00",
|
|
267
|
+
"datetime": ["2023-05-25T10:56:38+00:00", "2023-05-25T22:56:38+00:00"]
|
|
173
268
|
},
|
|
174
269
|
{
|
|
175
270
|
"archived": false,
|
|
@@ -178,6 +273,11 @@
|
|
|
178
273
|
"indicator": "Cruise ships in port based on AIS data",
|
|
179
274
|
"themes": ["economy"],
|
|
180
275
|
"title": "Cruise Ships [nr]",
|
|
181
|
-
"name": "Cruise ships in port based on AIS data"
|
|
276
|
+
"name": "Cruise ships in port based on AIS data",
|
|
277
|
+
"year": 1999,
|
|
278
|
+
"likes": 17,
|
|
279
|
+
"years": [1998, 1999],
|
|
280
|
+
"timestamp": "2023-05-24T13:56:38+00:00",
|
|
281
|
+
"datetime": ["2023-05-24T10:56:38+00:00", "2023-05-24T22:56:38+00:00"]
|
|
182
282
|
}
|
|
183
283
|
]
|