@eox/itemfilter 1.17.3 → 1.17.5

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,6 +1,6 @@
1
1
  {
2
2
  "name": "@eox/itemfilter",
3
- "version": "1.17.3",
3
+ "version": "1.17.5",
4
4
  "type": "module",
5
5
  "repository": {
6
6
  "type": "git",
@@ -9,7 +9,7 @@
9
9
  "devDependencies": {
10
10
  "@types/geojson": "^7946.0.14",
11
11
  "@types/lodash.debounce": "^4.0.7",
12
- "vite": "^8.0.13"
12
+ "vite": "^8.1.3"
13
13
  },
14
14
  "engines": {
15
15
  "npm": ">=8.0.0",
@@ -39,13 +39,13 @@
39
39
  "watch": "vite build --watch"
40
40
  },
41
41
  "dependencies": {
42
- "@eox/elements-utils": "^1.1.0",
42
+ "@eox/elements-utils": "^1.2.0",
43
43
  "@eox/ui": "^1.1.0",
44
44
  "@floating-ui/dom": "^1.6.8",
45
45
  "@turf/boolean-intersects": "^7.3.5",
46
46
  "@turf/boolean-within": "^7.3.5",
47
- "dayjs": "^1.11.9",
48
- "fuse.js": "^7.3.0",
47
+ "dayjs": "^1.11.21",
48
+ "fuse.js": "^7.4.2",
49
49
  "lit": "^3.3.3",
50
50
  "lodash.debounce": "^4.0.8",
51
51
  "lodash.flatmap": "^4.5.0",
@@ -8,6 +8,7 @@ import {
8
8
  handleKeyDownSelectorMethod,
9
9
  updatedSelectorMethod,
10
10
  } from "../../methods/filters";
11
+ import { capitalize } from "../../helpers";
11
12
 
12
13
  /**
13
14
  * EOxSelector is a custom web component that provides a flexible selector interface for filtering items.
@@ -231,7 +232,10 @@ export class EOxSelector extends LitElement {
231
232
  data-identifier="${suggestion.toString().toLowerCase()}"
232
233
  data-title="${suggestion}"
233
234
  >
234
- <label class="${type} small max">
235
+ <label
236
+ class="${type} small max"
237
+ title="${capitalize(suggestion.toString())}"
238
+ >
235
239
  <input
236
240
  type="${type}"
237
241
  name=${suggestion}
@@ -243,7 +247,12 @@ export class EOxSelector extends LitElement {
243
247
  }}
244
248
  tabindex=${this.tabIndex + 1}
245
249
  />
246
- <span class="title small-line">${suggestion}</span>
250
+ <span
251
+ class="title small-line"
252
+ title="${capitalize(suggestion.toString())}"
253
+ >
254
+ <span class="title-text">${suggestion}</span>
255
+ </span>
247
256
  </label>
248
257
  </li>
249
258
  `,
@@ -162,6 +162,7 @@ function updateSuggestions(EOxItemFilterSelector) {
162
162
  if (EOxItemFilterSelector.query) {
163
163
  const fuse = new Fuse(items, {
164
164
  threshold: 0.4,
165
+ ignoreLocation: true,
165
166
  });
166
167
  filteredSuggestion = fuse
167
168
  .search(EOxItemFilterSelector.query)
@@ -3,7 +3,7 @@ import { html as staticHtml, unsafeStatic } from "lit/static-html.js";
3
3
  import { repeat } from "lit/directives/repeat.js";
4
4
  import { when } from "lit/directives/when.js";
5
5
  import { unsafeHTML } from "lit/directives/unsafe-html.js";
6
- import { getValue } from "../../helpers";
6
+ import { capitalize, getValue } from "../../helpers";
7
7
 
8
8
  /**
9
9
  * Creates the item details view for the aggregation property in the EOxItemFilterResults component.
@@ -80,9 +80,16 @@ export function createItemListMethod(
80
80
  ${repeat(
81
81
  items,
82
82
  (item) => item.id,
83
- (item) => staticHtml`
83
+ (item) => {
84
+ const itemTitleRaw =
85
+ getValue(config.titleProperty, item)?.toString() || "";
86
+ const itemTitle = item.highlightedText
87
+ ? itemTitleRaw
88
+ : capitalize(itemTitleRaw);
89
+ return staticHtml`
84
90
  ${EOxItemFilterResults.resultType === "cards" ? unsafeStatic(`<eox-layout-item`) : unsafeStatic(`<li`)}
85
91
  class="${className(item)}"
92
+ title="${itemTitle}"
86
93
  @click=${() => {
87
94
  if (EOxItemFilterResults.selectedResult === item) {
88
95
  EOxItemFilterResults.selectedResult = null;
@@ -173,6 +180,7 @@ export function createItemListMethod(
173
180
  class="title truncate ${item.highlightedText
174
181
  ? "highlight-enabled"
175
182
  : ""}"
183
+ title="${itemTitle}"
176
184
  >${unsafeHTML(
177
185
  item.highlightedText ||
178
186
  getValue(config.titleProperty, item).toString(),
@@ -196,6 +204,7 @@ export function createItemListMethod(
196
204
  class="title truncate ${item.highlightedText
197
205
  ? "highlight-enabled"
198
206
  : ""}"
207
+ title="${itemTitle}"
199
208
  >${unsafeHTML(
200
209
  item.highlightedText || item[config.titleProperty],
201
210
  )}</span
@@ -227,7 +236,8 @@ export function createItemListMethod(
227
236
  )}
228
237
  </nav>
229
238
  </li>
230
- `,
239
+ `;
240
+ },
231
241
  )}
232
242
  ${EOxItemFilterResults.resultType === "cards" ? unsafeStatic(`</eox-layout>`) : unsafeStatic(`</ul>`)}
233
243
  `;
package/src/style.eox.js CHANGED
@@ -418,6 +418,30 @@ eox-itemfilter-results li {
418
418
  display: flex;
419
419
  justify-content: space-between;
420
420
  min-block-size: 32px !important;
421
+ height: auto;
422
+ }
423
+ .select li label,
424
+ .multiselect li label {
425
+ min-width: 0;
426
+ max-width: 100%;
427
+ }
428
+ .select li label .title,
429
+ .multiselect li label .title {
430
+ flex: 1;
431
+ min-width: 0;
432
+ max-width: 100%;
433
+ width: 100%;
434
+ overflow: visible;
435
+ }
436
+ .select li label .title .title-text,
437
+ .multiselect li label .title .title-text {
438
+ display: block;
439
+ overflow: hidden;
440
+ text-overflow: ellipsis;
441
+ white-space: nowrap;
442
+ min-width: 0;
443
+ max-width: 100%;
444
+ width: 100%;
421
445
  }
422
446
  .select li:hover,
423
447
  .multiselect li:hover,
@@ -1 +1 @@
1
- {"version":3,"file":"selector.d.ts","sourceRoot":"","sources":["../../../src/components/filters/selector.js"],"names":[],"mappings":"AAWA;;;;;;;;;;;;;;;;;;GAkBG;AACH;IAEE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAYE;IAKA;;OAEG;IACH,kBAAsB;IAEtB;;OAEG;IACH,mBAAqB;IAErB;;OAEG;IACH,qBAAuB;IAEvB;;OAEG;IACH,cAAe;IAEf;;OAEG;IACH,yBAA4B;IAE5B;;OAEG;IACH,yBAA0B;IAE1B;;OAEG;IACH,2BAA6B;IAE7B;;OAEG;IACH,aAAoB;IAEpB;;OAEG;IACH,kBAAqB;IAOrB;;OAEG;IACH,oBAAuB;IAGzB;;;;OAIG;IACH,gDAOC;IA6BD;;OAEG;IACH,cAEC;IAED;;;;;OAKG;IACH,8BAEG;IAEH;;;OAGG;IACH,qBAUC;IAED;;;;OAIG;IACH,oBAFa,IAAI,CAIhB;IAED;;OAEG;IACH,+CA8DC;;CACF;2BA9PyC,KAAK"}
1
+ {"version":3,"file":"selector.d.ts","sourceRoot":"","sources":["../../../src/components/filters/selector.js"],"names":[],"mappings":"AAYA;;;;;;;;;;;;;;;;;;GAkBG;AACH;IAEE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAYE;IAKA;;OAEG;IACH,kBAAsB;IAEtB;;OAEG;IACH,mBAAqB;IAErB;;OAEG;IACH,qBAAuB;IAEvB;;OAEG;IACH,cAAe;IAEf;;OAEG;IACH,yBAA4B;IAE5B;;OAEG;IACH,yBAA0B;IAE1B;;OAEG;IACH,2BAA6B;IAE7B;;OAEG;IACH,aAAoB;IAEpB;;OAEG;IACH,kBAAqB;IAOrB;;OAEG;IACH,oBAAuB;IAGzB;;;;OAIG;IACH,gDAOC;IA6BD;;OAEG;IACH,cAEC;IAED;;;;;OAKG;IACH,8BAEG;IAEH;;;OAGG;IACH,qBAUC;IAED;;;;OAIG;IACH,oBAFa,IAAI,CAIhB;IAED;;OAEG;IACH,+CAsEC;;CACF;2BAvQyC,KAAK"}
@@ -1 +1 @@
1
- {"version":3,"file":"create.d.ts","sourceRoot":"","sources":["../../../src/methods/results/create.js"],"names":[],"mappings":"AAOA;;;;;;GAMG;AACH,6DAJW,MAAM,8BAEJ,OAAO,KAAK,EAAE,kBAAkB,CAuC5C;AAED;;;;;;GAMG;AACH,sFAHW,MAAM,GACJ,OAAO,KAAK,EAAE,cAAc,CA+KxC"}
1
+ {"version":3,"file":"create.d.ts","sourceRoot":"","sources":["../../../src/methods/results/create.js"],"names":[],"mappings":"AAOA;;;;;;GAMG;AACH,6DAJW,MAAM,8BAEJ,OAAO,KAAK,EAAE,kBAAkB,CAuC5C;AAED;;;;;;GAMG;AACH,sFAHW,MAAM,GACJ,OAAO,KAAK,EAAE,cAAc,CAyLxC"}
@@ -1 +1 @@
1
- {"version":3,"file":"style.eox.d.ts","sourceRoot":"","sources":["../src/style.eox.js"],"names":[],"mappings":"AAKA,8BAwfE"}
1
+ {"version":3,"file":"style.eox.d.ts","sourceRoot":"","sources":["../src/style.eox.js"],"names":[],"mappings":"AAKA,8BAghBE"}