@eox/itemfilter 0.0.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/package.json ADDED
@@ -0,0 +1,30 @@
1
+ {
2
+ "name": "@eox/itemfilter",
3
+ "version": "0.0.1",
4
+ "type": "module",
5
+ "devDependencies": {
6
+ "@eox/eslint-config": "^1.0.0",
7
+ "@typescript-eslint/eslint-plugin": "^5.50.0",
8
+ "@typescript-eslint/parser": "^5.50.0",
9
+ "eslint-plugin-typescript": "^0.14.0",
10
+ "typescript": "^4.9.3",
11
+ "vite": "^4.0.0"
12
+ },
13
+ "engines": {
14
+ "npm": ">=8.0.0",
15
+ "node": ">=18.0.0"
16
+ },
17
+ "files": [
18
+ "dist",
19
+ "test"
20
+ ],
21
+ "main": "./dist/eox-itemfilter.js",
22
+ "scripts": {
23
+ "start": "vite",
24
+ "build": "tsc && vite build",
25
+ "watch": "tsc && vite build --watch"
26
+ },
27
+ "dependencies": {
28
+ "fuse.js": "^6.6.2"
29
+ }
30
+ }
@@ -0,0 +1,16 @@
1
+ import { EOxItemFilter } from "../src/main";
2
+ import testItems from "./testItems.json";
3
+
4
+ describe("Item Filter", () => {
5
+ beforeEach(() => {
6
+ cy.visit("/elements/itemfilter/test/general.html");
7
+ });
8
+
9
+ it("loads the itemfilter", () => {
10
+ cy.get("eox-itemfilter").should(($el) => {
11
+ const EOxItemFilter = <EOxItemFilter>$el[0];
12
+ EOxItemFilter.filterProperties = ["themes", "code"];
13
+ EOxItemFilter.apply(testItems);
14
+ });
15
+ });
16
+ });
@@ -0,0 +1,16 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <style>
5
+ html,
6
+ body {
7
+ padding: 0;
8
+ margin: 0;
9
+ }
10
+ </style>
11
+ <script type="module" defer src="../dist/eox-itemfilter.js"></script>
12
+ </head>
13
+ <body>
14
+ <eox-itemfilter aggregateResults="themes"> Filter! </eox-itemfilter>
15
+ </body>
16
+ </html>
@@ -0,0 +1,143 @@
1
+ [
2
+ {
3
+ "archived": false,
4
+ "code": "E10a2",
5
+ "indicator": "Actively managed total area from Sentinel-2 data",
6
+ "themes": ["agriculture"],
7
+ "name": "Actively managed total area from Sentinel-2 data"
8
+ },
9
+ {
10
+ "archived": false,
11
+ "code": "E10a9",
12
+ "indicator": "Agricultural Workers",
13
+ "themes": ["agriculture"],
14
+ "name": "Agricultural Workers"
15
+ },
16
+ {
17
+ "archived": false,
18
+ "code": "N1",
19
+ "indicator": "Air Quality",
20
+ "themes": ["air"],
21
+ "name": "Air Quality"
22
+ },
23
+ {
24
+ "archived": false,
25
+ "code": "E13o",
26
+ "indicator": "Average number of vessels in a km2 cell in a given period",
27
+ "themes": ["economy"],
28
+ "name": "Average number of vessels in a km2 cell in a given period"
29
+ },
30
+ {
31
+ "archived": false,
32
+ "code": "E13p",
33
+ "indicator": "Average number of vessels in a km2 cell in a given period",
34
+ "themes": ["economy"],
35
+ "name": "Average number of vessels in a km2 cell in a given period"
36
+ },
37
+ {
38
+ "archived": false,
39
+ "code": "E13q",
40
+ "indicator": "Average number of vessels in a km2 cell in a given period",
41
+ "themes": ["economy"],
42
+ "name": "Average number of vessels in a km2 cell in a given period"
43
+ },
44
+ {
45
+ "archived": false,
46
+ "code": "E13r",
47
+ "indicator": "Average number of vessels in a km2 cell in a given period",
48
+ "themes": ["economy"],
49
+ "name": "Average number of vessels in a km2 cell in a given period"
50
+ },
51
+ {
52
+ "archived": false,
53
+ "code": "C1",
54
+ "indicator": "Boat traffic - NO2 level",
55
+ "themes": ["economy", "air"],
56
+ "indicatorOverwrite": "Ports and Shipping - impact on air quality",
57
+ "name": "Boat traffic - NO2 level"
58
+ },
59
+ {
60
+ "archived": false,
61
+ "code": "CDS1",
62
+ "indicator": "C3S Data",
63
+ "themes": ["air"],
64
+ "name": "C3S Data"
65
+ },
66
+ {
67
+ "archived": false,
68
+ "code": "N1a",
69
+ "indicator": "CAMS Air Quality",
70
+ "themes": ["air"],
71
+ "name": "CAMS Air Quality"
72
+ },
73
+ {
74
+ "archived": false,
75
+ "code": "N1b",
76
+ "indicator": "CAMS Air Quality",
77
+ "themes": ["air"],
78
+ "name": "CAMS Air Quality"
79
+ },
80
+ {
81
+ "archived": false,
82
+ "code": "N1c",
83
+ "indicator": "CAMS Air Quality",
84
+ "themes": ["air"],
85
+ "name": "CAMS Air Quality"
86
+ },
87
+ {
88
+ "archived": false,
89
+ "code": "N1d",
90
+ "indicator": "CAMS Air Quality",
91
+ "themes": ["air"],
92
+ "name": "CAMS Air Quality"
93
+ },
94
+ {
95
+ "archived": false,
96
+ "code": "E13e",
97
+ "indicator": "Cargo ships in port based on AIS data",
98
+ "themes": ["economy"],
99
+ "name": "Cargo ships in port based on AIS data"
100
+ },
101
+ {
102
+ "archived": false,
103
+ "code": "E13n",
104
+ "indicator": "Changes in traffic based on mobile data",
105
+ "themes": ["economy"],
106
+ "name": "Changes in traffic based on mobile data"
107
+ },
108
+ {
109
+ "archived": false,
110
+ "code": "N3c",
111
+ "indicator": "CMEMS product",
112
+ "themes": ["water"],
113
+ "name": "CMEMS product"
114
+ },
115
+ {
116
+ "archived": false,
117
+ "code": "CV",
118
+ "indicator": "Covid-19 cases",
119
+ "themes": ["health"],
120
+ "name": "Covid-19 cases"
121
+ },
122
+ {
123
+ "archived": false,
124
+ "code": "OW",
125
+ "indicator": "Covid-19 vaccinations",
126
+ "themes": ["health"],
127
+ "name": "Covid-19 vaccinations"
128
+ },
129
+ {
130
+ "archived": false,
131
+ "code": "E3",
132
+ "indicator": "Crude Oil and other input materials",
133
+ "themes": ["economy"],
134
+ "name": "Crude Oil and other input materials"
135
+ },
136
+ {
137
+ "archived": false,
138
+ "code": "E13l",
139
+ "indicator": "Cruise ships in port based on AIS data",
140
+ "themes": ["economy"],
141
+ "name": "Cruise ships in port based on AIS data"
142
+ }
143
+ ]