@eox/itemfilter 1.18.0 → 1.19.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.
Files changed (117) hide show
  1. package/dist/eox-itemfilter.js +1714 -1694
  2. package/dist/eox-itemfilter.umd.cjs +125 -121
  3. package/package.json +3 -3
  4. package/src/components/chips.js +3 -3
  5. package/src/components/expand-container.js +27 -4
  6. package/src/components/filters/range.js +8 -5
  7. package/src/components/filters/selector.js +10 -10
  8. package/src/components/filters/spatial.js +8 -8
  9. package/src/components/filters/text.js +4 -4
  10. package/src/components/itemfilter-container.js +6 -6
  11. package/src/components/results.js +5 -5
  12. package/src/helpers/chip-items.js +2 -2
  13. package/src/helpers/filter-client.js +6 -6
  14. package/src/helpers/filter-external.js +4 -4
  15. package/src/helpers/get-value.js +1 -1
  16. package/src/helpers/highlighting.js +2 -2
  17. package/src/helpers/is-date.js +1 -1
  18. package/src/helpers/is-filters-dirty.js +1 -1
  19. package/src/helpers/map-layers.js +2 -2
  20. package/src/helpers/merge-highlight-indices.js +1 -1
  21. package/src/helpers/reset-filter.js +2 -2
  22. package/src/helpers/spatial.js +4 -4
  23. package/src/helpers/toggle-accordion.js +1 -1
  24. package/src/main.js +48 -40
  25. package/src/methods/chips/handler.js +4 -4
  26. package/src/methods/container/handler.js +6 -6
  27. package/src/methods/container/init-popver.js +2 -2
  28. package/src/methods/container/inline-search.js +4 -4
  29. package/src/methods/container/reset-filter.js +1 -1
  30. package/src/methods/container/reset-search.js +1 -1
  31. package/src/methods/container/search-filter.js +1 -1
  32. package/src/methods/filters/range.js +2 -2
  33. package/src/methods/filters/selector.js +26 -18
  34. package/src/methods/filters/spatial.js +5 -5
  35. package/src/methods/filters/text.js +3 -3
  36. package/src/methods/itemfilter/create-filter.js +6 -6
  37. package/src/methods/itemfilter/create-reset.js +3 -3
  38. package/src/methods/itemfilter/filter-apply.js +3 -3
  39. package/src/methods/itemfilter/reset-filter.js +4 -3
  40. package/src/methods/itemfilter/search.js +3 -3
  41. package/src/methods/itemfilter/sort-results.js +4 -4
  42. package/src/methods/results/aggregate-results.js +3 -3
  43. package/src/methods/results/create.js +2 -2
  44. package/types/components/chips.d.ts +3 -3
  45. package/types/components/expand-container.d.ts +3 -3
  46. package/types/components/expand-container.d.ts.map +1 -1
  47. package/types/components/filters/range.d.ts +3 -3
  48. package/types/components/filters/range.d.ts.map +1 -1
  49. package/types/components/filters/selector.d.ts +9 -9
  50. package/types/components/filters/spatial.d.ts +7 -7
  51. package/types/components/filters/spatial.d.ts.map +1 -1
  52. package/types/components/filters/text.d.ts +4 -4
  53. package/types/components/itemfilter-container.d.ts +6 -6
  54. package/types/components/results.d.ts +5 -5
  55. package/types/helpers/chip-items.d.ts +3 -3
  56. package/types/helpers/chip-items.d.ts.map +1 -1
  57. package/types/helpers/filter-client.d.ts +2 -2
  58. package/types/helpers/filter-client.d.ts.map +1 -1
  59. package/types/helpers/filter-external.d.ts +5 -5
  60. package/types/helpers/filter-external.d.ts.map +1 -1
  61. package/types/helpers/get-value.d.ts +2 -2
  62. package/types/helpers/get-value.d.ts.map +1 -1
  63. package/types/helpers/highlighting.d.ts +3 -3
  64. package/types/helpers/highlighting.d.ts.map +1 -1
  65. package/types/helpers/is-date.d.ts +2 -2
  66. package/types/helpers/is-date.d.ts.map +1 -1
  67. package/types/helpers/is-filters-dirty.d.ts +2 -2
  68. package/types/helpers/is-filters-dirty.d.ts.map +1 -1
  69. package/types/helpers/map-layers.d.ts +3 -3
  70. package/types/helpers/map-layers.d.ts.map +1 -1
  71. package/types/helpers/merge-highlight-indices.d.ts +1 -1
  72. package/types/helpers/reset-filter.d.ts +3 -3
  73. package/types/helpers/reset-filter.d.ts.map +1 -1
  74. package/types/helpers/spatial.d.ts +2 -2
  75. package/types/helpers/spatial.d.ts.map +1 -1
  76. package/types/helpers/toggle-accordion.d.ts +2 -2
  77. package/types/helpers/toggle-accordion.d.ts.map +1 -1
  78. package/types/main.d.ts +15 -11
  79. package/types/main.d.ts.map +1 -1
  80. package/types/methods/chips/handler.d.ts +6 -6
  81. package/types/methods/chips/handler.d.ts.map +1 -1
  82. package/types/methods/container/handler.d.ts +12 -12
  83. package/types/methods/container/handler.d.ts.map +1 -1
  84. package/types/methods/container/init-popver.d.ts +3 -3
  85. package/types/methods/container/init-popver.d.ts.map +1 -1
  86. package/types/methods/container/inline-search.d.ts +7 -7
  87. package/types/methods/container/inline-search.d.ts.map +1 -1
  88. package/types/methods/container/reset-filter.d.ts +2 -2
  89. package/types/methods/container/reset-filter.d.ts.map +1 -1
  90. package/types/methods/container/reset-search.d.ts +2 -2
  91. package/types/methods/container/reset-search.d.ts.map +1 -1
  92. package/types/methods/container/search-filter.d.ts +2 -2
  93. package/types/methods/container/search-filter.d.ts.map +1 -1
  94. package/types/methods/filters/range.d.ts +4 -4
  95. package/types/methods/filters/range.d.ts.map +1 -1
  96. package/types/methods/filters/selector.d.ts +15 -14
  97. package/types/methods/filters/selector.d.ts.map +1 -1
  98. package/types/methods/filters/spatial.d.ts +8 -8
  99. package/types/methods/filters/spatial.d.ts.map +1 -1
  100. package/types/methods/filters/text.d.ts +6 -6
  101. package/types/methods/filters/text.d.ts.map +1 -1
  102. package/types/methods/itemfilter/create-filter.d.ts +3 -3
  103. package/types/methods/itemfilter/create-filter.d.ts.map +1 -1
  104. package/types/methods/itemfilter/create-reset.d.ts +3 -3
  105. package/types/methods/itemfilter/create-reset.d.ts.map +1 -1
  106. package/types/methods/itemfilter/filter-apply.d.ts +4 -4
  107. package/types/methods/itemfilter/filter-apply.d.ts.map +1 -1
  108. package/types/methods/itemfilter/reset-filter.d.ts +3 -2
  109. package/types/methods/itemfilter/reset-filter.d.ts.map +1 -1
  110. package/types/methods/itemfilter/search.d.ts +4 -4
  111. package/types/methods/itemfilter/search.d.ts.map +1 -1
  112. package/types/methods/itemfilter/sort-results.d.ts +6 -6
  113. package/types/methods/itemfilter/sort-results.d.ts.map +1 -1
  114. package/types/methods/results/aggregate-results.d.ts +4 -4
  115. package/types/methods/results/aggregate-results.d.ts.map +1 -1
  116. package/types/methods/results/create.d.ts +4 -4
  117. package/types/methods/results/create.d.ts.map +1 -1
@@ -2,7 +2,7 @@
2
2
  * Handles the click event on a chip, highlighting the clicked chip and updating the component.
3
3
  *
4
4
  * @param {Event} evt - The click event.
5
- * @param {Object} EOxItemFilterChips - The EOxItemFilterChips component instance.
5
+ * @param {object} EOxItemFilterChips - The EOxItemFilterChips component instance.
6
6
  */
7
7
  export function handleChipClickMethod(evt, EOxItemFilterChips) {
8
8
  // Remove the 'highlighted' class from all chips
@@ -21,7 +21,7 @@ export function handleChipClickMethod(evt, EOxItemFilterChips) {
21
21
  *
22
22
  * @param {Event} event - The close event.
23
23
  * @param {number} index - The index of the chip to be removed.
24
- * @param {Object} EOxItemFilterChips - The EOxItemFilterChips component instance.
24
+ * @param {object} EOxItemFilterChips - The EOxItemFilterChips component instance.
25
25
  */
26
26
  export function handleCloseMethod(event, index, EOxItemFilterChips) {
27
27
  // Remove the chip from the controller
@@ -32,7 +32,7 @@ export function handleCloseMethod(event, index, EOxItemFilterChips) {
32
32
  * Handles keyboard events for the EOxItemFilterChips component.
33
33
  *
34
34
  * @param {KeyboardEvent} event - The keyboard event.
35
- * @param {Object} EOxItemFilterChips - The EOxItemFilterChips component instance.
35
+ * @param {object} EOxItemFilterChips - The EOxItemFilterChips component instance.
36
36
  */
37
37
  export function keyboardEventListenerMethod(event, EOxItemFilterChips) {
38
38
  const { code, target } = event;
@@ -68,7 +68,7 @@ export function keyboardEventListenerMethod(event, EOxItemFilterChips) {
68
68
  *
69
69
  * @param {string} key - The key pressed.
70
70
  * @param {string} textValue - The current value of the input field.
71
- * @param {Object} that - The EOxItemFilterChips component instance.
71
+ * @param {object} that - The EOxItemFilterChips component instance.
72
72
  */
73
73
  function handleKeyboard(key, textValue, that) {
74
74
  const highlightedChip = that.renderRoot.querySelector(".chip.highlighted");
@@ -5,7 +5,7 @@ import searchFilterMethod from "./search-filter.js";
5
5
  * Handles the click event on the form, stopping propagation if in inline mode.
6
6
  *
7
7
  * @param {Event} event - The click event.
8
- * @param {Object} EOxItemFilterContainer - The EOxItemFilterContainer component instance.
8
+ * @param {object} EOxItemFilterContainer - The EOxItemFilterContainer component instance.
9
9
  */
10
10
  export function handleFormClickMethod(event, EOxItemFilterContainer) {
11
11
  if (EOxItemFilterContainer.inlineMode) event.stopPropagation();
@@ -14,7 +14,7 @@ export function handleFormClickMethod(event, EOxItemFilterContainer) {
14
14
  /**
15
15
  * Shows the dropdown when the component is focused, if in inline mode.
16
16
  *
17
- * @param {Object} EOxItemFilterContainer - The EOxItemFilterContainer component instance.
17
+ * @param {object} EOxItemFilterContainer - The EOxItemFilterContainer component instance.
18
18
  */
19
19
  export function handleShowDropdownOnFocusMethod(EOxItemFilterContainer) {
20
20
  if (EOxItemFilterContainer.inlineMode) {
@@ -27,7 +27,7 @@ export function handleShowDropdownOnFocusMethod(EOxItemFilterContainer) {
27
27
  * by title and keeps the text for the inline search action.
28
28
  *
29
29
  * @param {Event} event - The input event.
30
- * @param {Object} EOxItemFilterContainer - The EOxItemFilterContainer component instance.
30
+ * @param {object} EOxItemFilterContainer - The EOxItemFilterContainer component instance.
31
31
  */
32
32
  export function handleSearchInputMethod(event, EOxItemFilterContainer) {
33
33
  if (!(event.target instanceof HTMLInputElement)) return;
@@ -41,7 +41,7 @@ export function handleSearchInputMethod(event, EOxItemFilterContainer) {
41
41
  * Toggles the dropdown visibility when an event occurs, stopping propagation if in inline mode.
42
42
  *
43
43
  * @param {Event} event - The event that triggers the toggle.
44
- * @param {Object} EOxItemFilterContainer - The EOxItemFilterContainer component instance.
44
+ * @param {object} EOxItemFilterContainer - The EOxItemFilterContainer component instance.
45
45
  */
46
46
  export function handleToggleDropdownMethod(event, EOxItemFilterContainer) {
47
47
  if (EOxItemFilterContainer.inlineMode) {
@@ -54,7 +54,7 @@ export function handleToggleDropdownMethod(event, EOxItemFilterContainer) {
54
54
  * Handles the keydown event, resetting the search and hiding the dropdown if Escape is pressed in inline mode.
55
55
  *
56
56
  * @param {KeyboardEvent} event - The keydown event.
57
- * @param {Object} EOxItemFilterContainer - The EOxItemFilterContainer component instance.
57
+ * @param {object} EOxItemFilterContainer - The EOxItemFilterContainer component instance.
58
58
  */
59
59
  export function handleKeyDownMethod(event, EOxItemFilterContainer) {
60
60
  if (
@@ -71,7 +71,7 @@ export function handleKeyDownMethod(event, EOxItemFilterContainer) {
71
71
  * Handles clicks outside the component, resetting the search and hiding the dropdown if in inline mode.
72
72
  *
73
73
  * @param {Event} event - The click event.
74
- * @param {Object} EOxItemFilterContainer - The EOxItemFilterContainer component instance.
74
+ * @param {object} EOxItemFilterContainer - The EOxItemFilterContainer component instance.
75
75
  */
76
76
  export function handleClickOutsideMethod(event, EOxItemFilterContainer) {
77
77
  if (
@@ -3,8 +3,8 @@ import { autoUpdate, computePosition } from "@floating-ui/dom";
3
3
  /**
4
4
  * Init popover autoUpdate and position
5
5
  *
6
- * @param {Object} EOxItemFilterContainer - The EOxItemFilterContainer component instance.
7
- * @return {() => void}
6
+ * @param {object} EOxItemFilterContainer - The EOxItemFilterContainer component instance.
7
+ * @returns {() => void}
8
8
  */
9
9
  function initPopover(EOxItemFilterContainer) {
10
10
  const trigger = EOxItemFilterContainer.renderRoot.querySelector(
@@ -4,7 +4,7 @@ import resetSearchMethod from "./reset-search.js";
4
4
  * Adds the inline search box text to every text filter with `inlineSearch` enabled,
5
5
  * then clears the box and closes the dropdown.
6
6
  *
7
- * @param {Object} EOxItemFilterContainer - The EOxItemFilterContainer component instance.
7
+ * @param {object} EOxItemFilterContainer - The EOxItemFilterContainer component instance.
8
8
  */
9
9
  export function applyInlineSearchMethod(EOxItemFilterContainer) {
10
10
  const input = EOxItemFilterContainer.renderRoot.querySelector(
@@ -33,7 +33,7 @@ export function applyInlineSearchMethod(EOxItemFilterContainer) {
33
33
  * Handles the keydown event of the inline search box, applying the inline search on Enter.
34
34
  *
35
35
  * @param {KeyboardEvent} event - The keydown event.
36
- * @param {Object} EOxItemFilterContainer - The EOxItemFilterContainer component instance.
36
+ * @param {object} EOxItemFilterContainer - The EOxItemFilterContainer component instance.
37
37
  */
38
38
  export function handleInlineSearchKeyDownMethod(event, EOxItemFilterContainer) {
39
39
  // Enter that confirms an IME composition (e.g. Japanese input) is not a search
@@ -44,8 +44,8 @@ export function handleInlineSearchKeyDownMethod(event, EOxItemFilterContainer) {
44
44
  /**
45
45
  * Returns the text filters that receive the text of the inline search box.
46
46
  *
47
- * @param {Object} EOxItemFilterContainer - The EOxItemFilterContainer component instance.
48
- * @returns {Array<Object>} The text filters with `inlineSearch` enabled.
47
+ * @param {object} EOxItemFilterContainer - The EOxItemFilterContainer component instance.
48
+ * @returns {Array<object>} The text filters with `inlineSearch` enabled.
49
49
  */
50
50
  export function getInlineSearchFilters(EOxItemFilterContainer) {
51
51
  return Object.values(EOxItemFilterContainer.filters).filter(
@@ -2,7 +2,7 @@
2
2
  * Resets a specific filter in the EOxItemFilterContainer based on the event target.
3
3
  *
4
4
  * @param {Event} event - The event that triggers the filter reset.
5
- * @param {Object} EOxItemFilterContainer - The EOxItemFilterContainer component instance.
5
+ * @param {object} EOxItemFilterContainer - The EOxItemFilterContainer component instance.
6
6
  */
7
7
  function resetFilterMethod(event, EOxItemFilterContainer) {
8
8
  if (!(event.target instanceof HTMLElement)) {
@@ -3,7 +3,7 @@ import searchFilterMethod from "./search-filter.js";
3
3
  /**
4
4
  * Resets the search input in the EOxItemFilterContainer and triggers a search filter update.
5
5
  *
6
- * @param {Object} EOxItemFilterContainer - The EOxItemFilterContainer component instance.
6
+ * @param {object} EOxItemFilterContainer - The EOxItemFilterContainer component instance.
7
7
  */
8
8
  function resetSearchMethod(EOxItemFilterContainer) {
9
9
  const input = EOxItemFilterContainer.renderRoot.querySelector(
@@ -5,7 +5,7 @@ import { INLINE_SEARCH_TITLE_THRESHOLD } from "../../enums/index.js";
5
5
  * Filters the items in the EOxItemFilterContainer based on the search input.
6
6
  *
7
7
  * @param {Event} event - The input event that triggers the search.
8
- * @param {Object} EOxItemFilterContainer - The EOxItemFilterContainer component instance.
8
+ * @param {object} EOxItemFilterContainer - The EOxItemFilterContainer component instance.
9
9
  */
10
10
  function searchFilterMethod(event, EOxItemFilterContainer) {
11
11
  const isInlineSearch = (filter) =>
@@ -42,7 +42,7 @@ export function resetRangeMethod(EOxItemFilterRange) {
42
42
  * Handles input changes for the range filter and updates the filter state accordingly.
43
43
  *
44
44
  * @param {CustomEvent} evt - The input event that triggers the update.
45
- * @param {Object} EOxItemFilterRange - The EOxItemFilterRange component instance.
45
+ * @param {object} EOxItemFilterRange - The EOxItemFilterRange component instance.
46
46
  */
47
47
  export function rangeInputHandlerMethod(evt, EOxItemFilterRange) {
48
48
  const parseVal = (val) => {
@@ -115,7 +115,7 @@ export function rangeInputHandlerMethod(evt, EOxItemFilterRange) {
115
115
  *
116
116
  * @param {number|string} val - The value of the range label.
117
117
  * @param {string} pos - The position of the range label (e.g., "min" or "max").
118
- * @param {Object} EOxItemFilterRange - The EOxItemFilterRange component instance.
118
+ * @param {object} EOxItemFilterRange - The EOxItemFilterRange component instance.
119
119
  * @returns {import("lit").HTMLTemplateResult}
120
120
  */
121
121
  export function rangeLabelMethod(val, pos, EOxItemFilterRange) {
@@ -4,10 +4,10 @@ import Fuse from "fuse.js";
4
4
  /**
5
5
  * Resets the selector filter to its default state and updates the component.
6
6
  *
7
- * @param {Object} EOxItemFilterSelector - The EOxItemFilterSelector component instance.
7
+ * @param {object} EOxItemFilterSelector - The EOxItemFilterSelector component instance.
8
8
  */
9
9
  export function resetSelectorMethod(EOxItemFilterSelector) {
10
- removeItemSelectorMethod(-1, EOxItemFilterSelector);
10
+ removeItemSelectorMethod(-1, EOxItemFilterSelector, false);
11
11
 
12
12
  resetFilter(EOxItemFilterSelector.filterObject);
13
13
  EOxItemFilterSelector.requestUpdate();
@@ -17,23 +17,28 @@ export function resetSelectorMethod(EOxItemFilterSelector) {
17
17
  * Removes an item from the selected items list and updates suggestions and filter list.
18
18
  *
19
19
  * @param {number} index - The index of the item to remove, or -1 to remove all items.
20
- * @param {Object} EOxItemFilterSelector - The EOxItemFilterSelector component instance.
20
+ * @param {object} EOxItemFilterSelector - The EOxItemFilterSelector component instance.
21
+ * @param {boolean} [emitEvent=true] - Whether to emit the filter event.
21
22
  */
22
- export function removeItemSelectorMethod(index, EOxItemFilterSelector) {
23
+ export function removeItemSelectorMethod(
24
+ index,
25
+ EOxItemFilterSelector,
26
+ emitEvent = true,
27
+ ) {
23
28
  EOxItemFilterSelector.selectedItems =
24
29
  index === -1
25
30
  ? []
26
31
  : EOxItemFilterSelector.selectedItems.filter((_, i) => i !== index);
27
32
 
28
33
  updateSuggestions(EOxItemFilterSelector);
29
- updateFilterList(EOxItemFilterSelector);
34
+ updateFilterList(EOxItemFilterSelector, emitEvent);
30
35
  }
31
36
 
32
37
  /**
33
38
  * Toggles the selection of an item and updates the component.
34
39
  *
35
- * @param {Object} item - The item to toggle.
36
- * @param {Object} EOxItemFilterSelector - The EOxItemFilterSelector component instance.
40
+ * @param {object} item - The item to toggle.
41
+ * @param {object} EOxItemFilterSelector - The EOxItemFilterSelector component instance.
37
42
  */
38
43
  export function toggleItemSelectorMethod(item, EOxItemFilterSelector) {
39
44
  const itemIndex = EOxItemFilterSelector.selectedItems.indexOf(item);
@@ -64,7 +69,7 @@ export function toggleItemSelectorMethod(item, EOxItemFilterSelector) {
64
69
  * Handles input changes for the selector and updates the query and suggestions.
65
70
  *
66
71
  * @param {Event} event - The input event.
67
- * @param {Object} EOxItemFilterSelector - The EOxItemFilterSelector component instance.
72
+ * @param {object} EOxItemFilterSelector - The EOxItemFilterSelector component instance.
68
73
  */
69
74
  export function handleInputSelectorMethod(event, EOxItemFilterSelector) {
70
75
  if (!(event.target instanceof HTMLInputElement)) {
@@ -78,7 +83,7 @@ export function handleInputSelectorMethod(event, EOxItemFilterSelector) {
78
83
  * Handles keydown events for the selector and navigates or selects items based on the key pressed.
79
84
  *
80
85
  * @param {KeyboardEvent} event - The keydown event.
81
- * @param {Object} EOxItemFilterSelector - The EOxItemFilterSelector component instance.
86
+ * @param {object} EOxItemFilterSelector - The EOxItemFilterSelector component instance.
82
87
  */
83
88
  export function handleKeyDownSelectorMethod(event, EOxItemFilterSelector) {
84
89
  switch (event.key) {
@@ -119,8 +124,8 @@ export function handleKeyDownSelectorMethod(event, EOxItemFilterSelector) {
119
124
  /**
120
125
  * Updates the Fuse.js instance and suggestions when properties change.
121
126
  *
122
- * @param {Object} changedProperties - The properties that changed.
123
- * @param {Object} EOxItemFilterSelector - The EOxItemFilterSelector component instance.
127
+ * @param {object} changedProperties - The properties that changed.
128
+ * @param {object} EOxItemFilterSelector - The EOxItemFilterSelector component instance.
124
129
  */
125
130
  export function updatedSelectorMethod(
126
131
  changedProperties,
@@ -134,9 +139,9 @@ export function updatedSelectorMethod(
134
139
  /**
135
140
  * Sorts and returns the suggestions based on the filter's sort method or default string comparison.
136
141
  *
137
- * @param {Object} EOxItemFilterSelector - The EOxItemFilterSelector component instance.
138
- * @param {Array<Object>} suggestion - The suggestions to sort.
139
- * @returns {Array<Object>} The sorted suggestions.
142
+ * @param {object} EOxItemFilterSelector - The EOxItemFilterSelector component instance.
143
+ * @param {Array<object>} suggestion - The suggestions to sort.
144
+ * @returns {Array<object>} The sorted suggestions.
140
145
  */
141
146
  function getSortedSuggestions(EOxItemFilterSelector, suggestion) {
142
147
  const sortCallback =
@@ -150,7 +155,7 @@ function getSortedSuggestions(EOxItemFilterSelector, suggestion) {
150
155
  /**
151
156
  * Updates the filtered suggestions based on the current query.
152
157
  *
153
- * @param {Object} EOxItemFilterSelector - The EOxItemFilterSelector component instance.
158
+ * @param {object} EOxItemFilterSelector - The EOxItemFilterSelector component instance.
154
159
  */
155
160
  function updateSuggestions(EOxItemFilterSelector) {
156
161
  const items = (
@@ -190,9 +195,10 @@ function updateSuggestions(EOxItemFilterSelector) {
190
195
  /**
191
196
  * Updates the filter list based on the selected items.
192
197
  *
193
- * @param {Object} EOxItemFilterSelector - The EOxItemFilterSelector component instance.
198
+ * @param {object} EOxItemFilterSelector - The EOxItemFilterSelector component instance.
199
+ * @param {boolean} [emitEvent=true] - Whether to dispatch the filter custom event.
194
200
  */
195
- function updateFilterList(EOxItemFilterSelector) {
201
+ function updateFilterList(EOxItemFilterSelector, emitEvent = true) {
196
202
  // Update the state of the filter object based on the selected items
197
203
  Object.keys(EOxItemFilterSelector.filterObject.state).forEach((k) => {
198
204
  EOxItemFilterSelector.filterObject.state[k] =
@@ -211,6 +217,8 @@ function updateFilterList(EOxItemFilterSelector) {
211
217
  );
212
218
 
213
219
  // Dispatch a custom event named "filter" and request an update
214
- EOxItemFilterSelector.dispatchEvent(new CustomEvent("filter"));
220
+ if (emitEvent) {
221
+ EOxItemFilterSelector.dispatchEvent(new CustomEvent("filter"));
222
+ }
215
223
  EOxItemFilterSelector.requestUpdate();
216
224
  }
@@ -3,7 +3,7 @@ import { getMapLayers, resetFilter } from "../../helpers/index.js";
3
3
  /**
4
4
  * Resets the spatial filter to its default state and updates the component.
5
5
  *
6
- * @param {Object} EOxItemFilterSpatial - The EOxItemFilterSpatial component instance.
6
+ * @param {object} EOxItemFilterSpatial - The EOxItemFilterSpatial component instance.
7
7
  */
8
8
  export function resetSpatialMethod(EOxItemFilterSpatial) {
9
9
  resetFilter(EOxItemFilterSpatial.filterObject);
@@ -18,7 +18,7 @@ export function resetSpatialMethod(EOxItemFilterSpatial) {
18
18
  /**
19
19
  * Resets the spatial filter map and re-initializes it.
20
20
  *
21
- * @param {Object} EOxItemFilterSpatial - The EOxItemFilterSpatial component instance.
21
+ * @param {object} EOxItemFilterSpatial - The EOxItemFilterSpatial component instance.
22
22
  */
23
23
  export function resetSpatialFilterMethod(EOxItemFilterSpatial) {
24
24
  EOxItemFilterSpatial.renderRoot.querySelector("#eox-map").innerHTML = "";
@@ -29,7 +29,7 @@ export function resetSpatialFilterMethod(EOxItemFilterSpatial) {
29
29
  * Handles the click event for spatial mode buttons and updates the filter state.
30
30
  *
31
31
  * @param {string} mode - The selected spatial mode.
32
- * @param {Object} EOxItemFilterSpatial - The EOxItemFilterSpatial component instance.
32
+ * @param {object} EOxItemFilterSpatial - The EOxItemFilterSpatial component instance.
33
33
  */
34
34
  export function handleClickSpatialMethod(mode, EOxItemFilterSpatial) {
35
35
  EOxItemFilterSpatial.filterObject.state.mode = mode;
@@ -44,7 +44,7 @@ export function handleClickSpatialMethod(mode, EOxItemFilterSpatial) {
44
44
  /**
45
45
  * Sets up the spatial filter map and its interactions.
46
46
  *
47
- * @param {Object} that - The EOxItemFilterSpatial component instance.
47
+ * @param {object} that - The EOxItemFilterSpatial component instance.
48
48
  */
49
49
  export function setupSpatialMethod(that) {
50
50
  const parentEOxMap = that.renderRoot.querySelector("#eox-map");
@@ -94,7 +94,7 @@ export function setupSpatialMethod(that) {
94
94
  /**
95
95
  * Creates a URL for a GeoJSON feature collection from the given geometry.
96
96
  *
97
- * @param {Object} geometry - The geometry to include in the feature collection.
97
+ * @param {object} geometry - The geometry to include in the feature collection.
98
98
  * @returns {string} The URL for the GeoJSON feature collection.
99
99
  */
100
100
  function createFeatureUrl(geometry) {
@@ -3,7 +3,7 @@ import { resetFilter } from "../../helpers/index.js";
3
3
  /**
4
4
  * Resets the text filter to its default state and updates the component.
5
5
  *
6
- * @param {Object} EOxItemFilterText - The EOxItemFilterText component instance.
6
+ * @param {object} EOxItemFilterText - The EOxItemFilterText component instance.
7
7
  */
8
8
  export function resetTextMethod(EOxItemFilterText) {
9
9
  const searchInput =
@@ -17,7 +17,7 @@ export function resetTextMethod(EOxItemFilterText) {
17
17
  * Appends text to the text filter input and applies it.
18
18
  *
19
19
  * @param {string} text - The text to append.
20
- * @param {Object} EOxItemFilterText - The EOxItemFilterText component instance.
20
+ * @param {object} EOxItemFilterText - The EOxItemFilterText component instance.
21
21
  */
22
22
  export function appendTextMethod(text, EOxItemFilterText) {
23
23
  const searchInput =
@@ -29,7 +29,7 @@ export function appendTextMethod(text, EOxItemFilterText) {
29
29
  /**
30
30
  * Handles input changes for the text filter and updates the filter state accordingly.
31
31
  *
32
- * @param {Object} EOxItemFilterText - The EOxItemFilterText component instance.
32
+ * @param {object} EOxItemFilterText - The EOxItemFilterText component instance.
33
33
  */
34
34
  export function textInputHandlerMethod(EOxItemFilterText) {
35
35
  const searchInput =
@@ -5,9 +5,9 @@ import flatMap from "lodash.flatmap";
5
5
  /**
6
6
  * Creates a filter element based on the filter object type.
7
7
  *
8
- * @param {Object} filterObject - The filter object containing filter details.
8
+ * @param {object} filterObject - The filter object containing filter details.
9
9
  * @param {number} tabIndex - The tab index for the filter element.
10
- * @param {Object} EOxItemFilter - The EOxItemFilter component instance.
10
+ * @param {object} EOxItemFilter - The EOxItemFilter component instance.
11
11
  * @returns {import("lit").HTMLTemplateResult} The HTML template for the filter element.
12
12
  */
13
13
  function createFilterMethod(filterObject, tabIndex, EOxItemFilter) {
@@ -28,7 +28,7 @@ function createFilterMethod(filterObject, tabIndex, EOxItemFilter) {
28
28
  .results=${EOxItemFilter.results}
29
29
  .unstyled=${EOxItemFilter.unstyled}
30
30
  @result=${EOxItemFilter.updateResult}
31
- @filter=${() => EOxItemFilter.search()}
31
+ @filter=${() => EOxItemFilter.search(true)}
32
32
  ></eox-itemfilter-text>`;
33
33
 
34
34
  case "multiselect":
@@ -47,7 +47,7 @@ function createFilterMethod(filterObject, tabIndex, EOxItemFilter) {
47
47
  ).filter((i) => i)}"
48
48
  type="${filterObject.type}"
49
49
  .unstyled=${EOxItemFilter.unstyled}
50
- @filter=${() => EOxItemFilter.search()}
50
+ @filter=${() => EOxItemFilter.search(true)}
51
51
  ></eox-itemfilter-select>
52
52
  `;
53
53
  case "range":
@@ -64,7 +64,7 @@ function createFilterMethod(filterObject, tabIndex, EOxItemFilter) {
64
64
  flatMap(EOxItemFilter.items, filterObject.key),
65
65
  ).filter((i) => i)}"
66
66
  .unstyled=${EOxItemFilter.unstyled}
67
- @filter=${() => EOxItemFilter.search()}
67
+ @filter=${() => EOxItemFilter.search(true)}
68
68
  ></eox-itemfilter-range>
69
69
  `;
70
70
  case "spatial":
@@ -76,7 +76,7 @@ function createFilterMethod(filterObject, tabIndex, EOxItemFilter) {
76
76
  .tabIndex=${tabIndex}
77
77
  .filterObject=${filterObject}
78
78
  slot="filter"
79
- @filter=${() => EOxItemFilter.search()}
79
+ @filter=${() => EOxItemFilter.search(true)}
80
80
  ></eox-itemfilter-spatial>
81
81
  `;
82
82
 
@@ -4,9 +4,9 @@ import { when } from "lit/directives/when.js";
4
4
  /**
5
5
  * Creates a reset button for the filter object if it is dirty.
6
6
  *
7
- * @param {Object} filterObject - The filter object containing filter details.
7
+ * @param {object} filterObject - The filter object containing filter details.
8
8
  * @param {number} tabIndex - The tab index for the reset button.
9
- * @param {Object} EOxItemFilter - The EOxItemFilter component instance.
9
+ * @param {object} EOxItemFilter - The EOxItemFilter component instance.
10
10
  * @returns {import("lit").HTMLTemplateResult} The HTML template for the reset button.
11
11
  */
12
12
  function createResetMethod(filterObject, tabIndex, EOxItemFilter) {
@@ -25,7 +25,7 @@ function createResetMethod(filterObject, tabIndex, EOxItemFilter) {
25
25
  if (filterElement && typeof filterElement.reset === "function") {
26
26
  filterElement.reset();
27
27
  }
28
- EOxItemFilter.search();
28
+ EOxItemFilter.search(true);
29
29
  EOxItemFilter.requestUpdate();
30
30
  }}
31
31
  >
@@ -7,9 +7,9 @@ import { DATE_TIME_FORMAT } from "../../enums/index.js";
7
7
  /**
8
8
  * Applies filters to the provided items based on the given configuration and updates the EOxItemFilter instance.
9
9
  *
10
- * @param {Object} config - The configuration object for the filters.
11
- * @param {Array<Object>} items - The items to be filtered.
12
- * @param {Object} EOxItemFilter - The EOxItemFilter component instance.
10
+ * @param {object} config - The configuration object for the filters.
11
+ * @param {Array<object>} items - The items to be filtered.
12
+ * @param {object} EOxItemFilter - The EOxItemFilter component instance.
13
13
  * @returns {Array<string>} The aggregated results if config.aggregateResults is specified, otherwise an empty array.
14
14
  */
15
15
  function filterApplyMethod(config, items, EOxItemFilter) {
@@ -1,13 +1,14 @@
1
1
  /**
2
2
  * Resets all filters in the EOxItemFilter component and triggers a search update.
3
3
  *
4
- * @param {Object} EOxItemFilter - The EOxItemFilter component instance.
4
+ * @param {object} EOxItemFilter - The EOxItemFilter component instance.
5
+ * @param {boolean} [isUser=false] - Whether the reset was triggered by user interaction.
5
6
  */
6
- export default function resetFilterMethod(EOxItemFilter) {
7
+ export default function resetFilterMethod(EOxItemFilter, isUser = false) {
7
8
  EOxItemFilter.renderRoot
8
9
  .querySelectorAll("[data-type='filter']")
9
10
  .forEach((filter) => {
10
11
  if (typeof filter.reset === "function") filter.reset();
11
12
  });
12
- EOxItemFilter.search();
13
+ EOxItemFilter.search(isUser);
13
14
  }
@@ -4,9 +4,9 @@ import { filterExternal } from "../../helpers";
4
4
  /**
5
5
  * Executes a search based on the provided configuration, items, and filters in the EOxItemFilter component.
6
6
  *
7
- * @param {Object} config - The configuration object for the search.
8
- * @param {Array<Object>} items - The items to be filtered.
9
- * @param {Object} EOxItemFilter - The EOxItemFilter component instance.
7
+ * @param {object} config - The configuration object for the search.
8
+ * @param {Array<object>} items - The items to be filtered.
9
+ * @param {object} EOxItemFilter - The EOxItemFilter component instance.
10
10
  * @returns {Promise<void>} A promise that resolves when the search is complete.
11
11
  */
12
12
  async function searchMethod(config, items, EOxItemFilter) {
@@ -9,11 +9,11 @@ import { getValue } from "../../helpers";
9
9
  * - function: custom comparator function (a, b) => number
10
10
  * - object: { key: string, order?: 'asc' | 'desc' }
11
11
  *
12
- * @param {Array<Object>} items - The items to be sorted.
13
- * @param {Object} config - The configuration object containing sorting options.
14
- * @param {Object} [options] - Optional sorting parameters.
12
+ * @param {Array<object>} items - The items to be sorted.
13
+ * @param {object} config - The configuration object containing sorting options.
14
+ * @param {object} [options] - Optional sorting parameters.
15
15
  * @param {boolean} [options.isExternalResult] - Flag for results from external filter.
16
- * @returns {Array<Object>} The sorted array of items.
16
+ * @returns {Array<object>} The sorted array of items.
17
17
  */
18
18
  function sortResultsMethod(items, config, options = {}) {
19
19
  const { resultSorting } = config;
@@ -1,10 +1,10 @@
1
1
  /**
2
2
  * Filters and aggregates results based on a specified property in the EOxItemFilterResults component.
3
3
  *
4
- * @param {Array<Object>} items - The items to be filtered and aggregated.
4
+ * @param {Array<object>} items - The items to be filtered and aggregated.
5
5
  * @param {string} property - The property used for aggregation.
6
- * @param {Object} EOxItemFilterResults - The EOxItemFilterResults component instance.
7
- * @returns {Array<Object>} The filtered and aggregated items.
6
+ * @param {object} EOxItemFilterResults - The EOxItemFilterResults component instance.
7
+ * @returns {Array<object>} The filtered and aggregated items.
8
8
  */
9
9
  export function aggregateResultsMethod(items, property, EOxItemFilterResults) {
10
10
  // If the category itself is an empty string, return nothing immediately.
@@ -9,7 +9,7 @@ import { capitalize, getValue } from "../../helpers";
9
9
  * Creates the item details view for the aggregation property in the EOxItemFilterResults component.
10
10
  *
11
11
  * @param {string} aggregationProperty - The property used for aggregation.
12
- * @param {Object} EOxItemFilterResults - The EOxItemFilterResults component instance.
12
+ * @param {object} EOxItemFilterResults - The EOxItemFilterResults component instance.
13
13
  * @returns {import("lit").HTMLTemplateResult} The HTML template for the item details view.
14
14
  */
15
15
  export function createItemDetailsMethod(
@@ -54,7 +54,7 @@ export function createItemDetailsMethod(
54
54
  /**
55
55
  * Creates the item list view for the aggregation property in the EOxItemFilterResults component.
56
56
  *
57
- * @param {Object} EOxItemFilterResults - The EOxItemFilterResults component instance.
57
+ * @param {object} EOxItemFilterResults - The EOxItemFilterResults component instance.
58
58
  * @param {string} [aggregationProperty] - The property used for aggregation.
59
59
  * @returns {import("lit").TemplateResult} The HTML template for the item list view.
60
60
  */
@@ -4,9 +4,9 @@
4
4
  * close events, and keyboard events.
5
5
  *
6
6
  * @module EOxItemFilterChips
7
- * @extends LitElement
8
- * @property {Object} items - The items to be displayed as chips.
9
- * @property {Object} controller - The controller object to manage chip actions.
7
+ * @augments LitElement
8
+ * @property {object} items - The items to be displayed as chips.
9
+ * @property {object} controller - The controller object to manage chip actions.
10
10
  */
11
11
  export class EOxItemFilterChipsV2 extends LitElement {
12
12
  static get properties(): {
@@ -3,9 +3,9 @@
3
3
  * The component supports a featured view and an expandable details view.
4
4
  *
5
5
  * @module EOxItemFilterExpandContainer
6
- * @extends LitElement
7
- * @property {Object} filterObject - The filter object containing state and properties such as title and expanded state.
8
- * @property {Boolean} unstyled - Flag to determine if default styles should be applied.
6
+ * @augments LitElement
7
+ * @property {object} filterObject - The filter object containing state and properties such as title and expanded state.
8
+ * @property {boolean} unstyled - Flag to determine if default styles should be applied.
9
9
  */
10
10
  export class EOxItemFilterExpandContainer extends LitElement {
11
11
  static get properties(): {
@@ -1 +1 @@
1
- {"version":3,"file":"expand-container.d.ts","sourceRoot":"","sources":["../../src/components/expand-container.js"],"names":[],"mappings":"AAIA;;;;;;;;GAQG;AACH;IAEE;;;;;;;;MAKC;IAKC;;OAEG;IACH,kBAAsB;IAEtB;;OAEG;IACH,kBAAqB;IAmBvB;;OAEG;IACH,+CA2CC;;CACF;2BAnGyC,KAAK"}
1
+ {"version":3,"file":"expand-container.d.ts","sourceRoot":"","sources":["../../src/components/expand-container.js"],"names":[],"mappings":"AAKA;;;;;;;;GAQG;AACH;IAEE;;;;;;;;MAKC;IAKC;;OAEG;IACH,kBAAsB;IAEtB;;OAEG;IACH,kBAAqB;IAoCvB;;OAEG;IACH,+CAgDC;;CACF;2BA1HyC,KAAK"}
@@ -4,10 +4,10 @@
4
4
  * generating labels, and resetting the range filter.
5
5
  *
6
6
  * @module EOxItemFilterRange
7
- * @extends LitElement
8
- * @property {Object} filterObject - The filter object containing state and range limits.
7
+ * @augments LitElement
8
+ * @property {object} filterObject - The filter object containing state and range limits.
9
9
  * @property {Array} suggestions - The list of suggestions for the selector.
10
- * @property {Number} tabIndex - The tab index for the input elements.
10
+ * @property {number} tabIndex - The tab index for the input elements.
11
11
  */
12
12
  export class EOxItemFilterRange extends LitElement {
13
13
  static properties: {
@@ -1 +1 @@
1
- {"version":3,"file":"range.d.ts","sourceRoot":"","sources":["../../../src/components/filters/range.js"],"names":[],"mappings":"AAaA;;;;;;;;;;GAUG;AACH;IAEE;;;;;;;;;;;;;;;;;MAKE;IAKA;;OAEG;IACH,kBAAsB;IAEtB;;OAEG;IACH,mBAAqB;IAOrB;;OAEG;IACH,oBAAuB;IAEvB;;OAEG;IACH,cAFU,CAAC,GAAG,EAAE,WAAW,CAAC,GAAG,CAAC,KAAK,IAAI,CAEQ;IAEjD;;OAEG;IACH,gCAEE;IAuBJ;;OAEG;IACH,cAEC;IAED;;;;OAIG;IACH,oBAFa,IAAI,CAIhB;IAED;;OAEG;IACH,oBAyEC;;CACF;2BAtLgC,KAAK"}
1
+ {"version":3,"file":"range.d.ts","sourceRoot":"","sources":["../../../src/components/filters/range.js"],"names":[],"mappings":"AAaA;;;;;;;;;;GAUG;AACH;IAEE;;;;;;;;;;;;;;;;;MAKE;IAKA;;OAEG;IACH,kBAAsB;IAEtB;;OAEG;IACH,mBAAqB;IAOrB;;OAEG;IACH,oBAAuB;IAEvB;;OAEG;IACH,cAFU,CAAC,GAAG,EAAE,WAAW,CAAC,GAAG,CAAC,KAAK,IAAI,CAEQ;IAEjD;;OAEG;IACH,gCAEE;IAuBJ;;OAEG;IACH,cAEC;IAED;;;;OAIG;IACH,oBAFa,IAAI,CAIhB;IAED;;OAEG;IACH,oBA4EC;;CACF;2BAzLgC,KAAK"}
@@ -4,18 +4,18 @@
4
4
  * key events, and selection updates.
5
5
  *
6
6
  * @module EOxSelector
7
- * @extends LitElement
8
- * @property {Object} filterObject - The filter object containing state and placeholder.
7
+ * @augments LitElement
8
+ * @property {object} filterObject - The filter object containing state and placeholder.
9
9
  * @property {Array} suggestions - The list of suggestions for the selector.
10
10
  * @property {Array} selectedItems - The list of currently selected items.
11
- * @property {String} query - The current input query for autocomplete.
12
- * @property {Boolean} showSuggestions - Flag to control the display of suggestions in autocomplete mode.
13
- * @property {Number} highlightedIndex - The index of the currently highlighted suggestion.
11
+ * @property {string} query - The current input query for autocomplete.
12
+ * @property {boolean} showSuggestions - Flag to control the display of suggestions in autocomplete mode.
13
+ * @property {number} highlightedIndex - The index of the currently highlighted suggestion.
14
14
  * @property {Array} filteredSuggestions - The list of suggestions filtered based on the query.
15
- * @property {String} type - The type of selector ("select", "multi-select", etc.).
16
- * @property {Boolean} unstyled - Flag to determine if default styles should be applied.
17
- * @property {Number} tabIndex - The tab index for the input elements.
18
- * @property {Boolean} inlineMode - State whether to enable or disable inline mode
15
+ * @property {string} type - The type of selector ("select", "multi-select", etc.).
16
+ * @property {boolean} unstyled - Flag to determine if default styles should be applied.
17
+ * @property {number} tabIndex - The tab index for the input elements.
18
+ * @property {boolean} inlineMode - State whether to enable or disable inline mode
19
19
  */
20
20
  export class EOxSelector extends LitElement {
21
21
  static properties: {