@eox/itemfilter 0.12.1 → 0.14.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.
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@eox/itemfilter",
3
- "version": "0.12.1",
3
+ "version": "0.14.0",
4
4
  "type": "module",
5
5
  "devDependencies": {
6
6
  "@eox/eslint-config": "^1.0.0",
7
7
  "@types/lodash.debounce": "^4.0.7",
8
- "@typescript-eslint/eslint-plugin": "^6.8.0",
9
- "@typescript-eslint/parser": "^6.8.0",
8
+ "@typescript-eslint/eslint-plugin": "^7.0.1",
9
+ "@typescript-eslint/parser": "^7.0.1",
10
10
  "eslint-plugin-typescript": "^0.14.0",
11
11
  "typescript": "^5.2.2",
12
12
  "vite": "^5.0.2"
@@ -13,21 +13,23 @@ describe("Item Filter Config", () => {
13
13
  .as("eox-itemfilter")
14
14
  .then(($el) => {
15
15
  const eoxItemFilter = <EOxItemFilter>$el[0];
16
- eoxItemFilter.config = {
17
- titleProperty: "title",
18
- filterProperties: [
19
- {
20
- keys: ["title", "themes"],
21
- title: "Search",
22
- type: "text",
23
- expanded: true,
24
- },
25
- { key: "themes", expanded: true },
26
- ],
27
- aggregateResults: "themes",
28
- enableHighlighting: true,
29
- };
30
- eoxItemFilter.apply(testItems);
16
+ Object.assign(eoxItemFilter, {
17
+ config: {
18
+ titleProperty: "title",
19
+ filterProperties: [
20
+ {
21
+ keys: ["title", "themes"],
22
+ title: "Search",
23
+ type: "text",
24
+ expanded: true,
25
+ },
26
+ { key: "themes", expanded: true },
27
+ ],
28
+ aggregateResults: "themes",
29
+ enableHighlighting: true,
30
+ },
31
+ items: testItems,
32
+ });
31
33
  });
32
34
  });
33
35
 
@@ -195,17 +197,19 @@ describe("Item Filter Config", () => {
195
197
  it("should show the map when spatial filter is enabled", () => {
196
198
  cy.get("eox-itemfilter").and(($el) => {
197
199
  const eoxItemFilter = <EOxItemFilter>$el[0];
198
- eoxItemFilter.config = {
199
- titleProperty: "title",
200
- filterProperties: [
201
- {
202
- key: "geometry",
203
- type: "spatial",
204
- expanded: true,
205
- },
206
- ],
207
- };
208
- eoxItemFilter.apply(testItems);
200
+ Object.assign(eoxItemFilter, {
201
+ config: {
202
+ titleProperty: "title",
203
+ filterProperties: [
204
+ {
205
+ key: "geometry",
206
+ type: "spatial",
207
+ expanded: true,
208
+ },
209
+ ],
210
+ },
211
+ items: testItems,
212
+ });
209
213
  });
210
214
  cy.get("eox-itemfilter")
211
215
  .shadow()
package/test/state.cy.ts CHANGED
@@ -19,22 +19,25 @@ describe("Item Filter Config", () => {
19
19
  .as("eox-itemfilter")
20
20
  .then(($el) => {
21
21
  const eoxItemFilter = <EOxItemFilter>$el[0];
22
- eoxItemFilter.config = {
23
- titleProperty: "title",
24
- filterProperties: [
25
- {
26
- key: "themes",
27
- type: "multiselect",
28
- expanded: true,
29
- sort: (a, b) => customOrder[a] - customOrder[b],
30
- // @ts-ignore
31
- state,
32
- },
33
- ],
34
- aggregateResults: "themes",
35
- };
36
- eoxItemFilter.apply(testItems);
37
- eoxItemFilter.selectedResult = testItems[selectedResultIndex];
22
+ Object.assign(eoxItemFilter, {
23
+ config: {
24
+ titleProperty: "title",
25
+ filterProperties: [
26
+ {
27
+ key: "themes",
28
+ type: "multiselect",
29
+ expanded: true,
30
+ // @ts-ignore
31
+ sort: (a, b) => customOrder[a] - customOrder[b],
32
+ // @ts-ignore
33
+ state,
34
+ },
35
+ ],
36
+ aggregateResults: "themes",
37
+ },
38
+ items: testItems,
39
+ selectedResult: testItems[selectedResultIndex],
40
+ });
38
41
  });
39
42
  });
40
43