@eox/itemfilter 1.9.2 → 1.10.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/dist/eox-itemfilter.js +3783 -3723
- package/dist/eox-itemfilter.umd.cjs +470 -436
- package/dist/material-symbols-outlined.woff2 +0 -0
- package/dist/material-symbols-rounded.woff2 +0 -0
- package/dist/material-symbols-sharp.woff2 +0 -0
- package/dist/material-symbols-subset.woff2 +0 -0
- package/package.json +3 -2
- package/src/components/chips.js +1 -5
- package/src/components/expand-container.js +21 -9
- package/src/components/filters/range.js +12 -10
- package/src/components/filters/selector.js +22 -12
- package/src/components/filters/spatial.js +31 -29
- package/src/components/filters/text.js +5 -2
- package/src/components/itemfilter-container.js +24 -6
- package/src/components/results.js +20 -22
- package/src/helpers/chip-items.js +1 -1
- package/src/main.js +91 -64
- package/src/methods/itemfilter/create-reset.js +15 -3
- package/src/methods/results/create.js +110 -56
- package/src/style.eox.js +103 -199
- package/src/style.js +2 -1
- package/types/components/chips.d.ts.map +1 -1
- package/types/components/expand-container.d.ts.map +1 -1
- package/types/components/filters/range.d.ts.map +1 -1
- package/types/components/filters/selector.d.ts +6 -0
- package/types/components/filters/selector.d.ts.map +1 -1
- package/types/components/filters/spatial.d.ts.map +1 -1
- package/types/components/filters/text.d.ts.map +1 -1
- package/types/components/itemfilter-container.d.ts.map +1 -1
- package/types/components/results.d.ts.map +1 -1
- package/types/main.d.ts.map +1 -1
- package/types/methods/itemfilter/create-reset.d.ts.map +1 -1
- package/types/methods/results/create.d.ts.map +1 -1
- package/types/style.d.ts +1 -1
- package/types/style.d.ts.map +1 -1
- package/types/style.eox.d.ts +1 -1
- package/types/style.eox.d.ts.map +1 -1
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eox/itemfilter",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.10.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"devDependencies": {
|
|
6
6
|
"@types/geojson": "^7946.0.14",
|
|
@@ -35,7 +35,8 @@
|
|
|
35
35
|
"watch": "vite build --watch"
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@eox/elements-utils": "^0.
|
|
38
|
+
"@eox/elements-utils": "^1.0.0",
|
|
39
|
+
"@eox/ui": "^0.3.6",
|
|
39
40
|
"@floating-ui/dom": "^1.6.8",
|
|
40
41
|
"@turf/boolean-intersects": "^7.0.0",
|
|
41
42
|
"@turf/boolean-within": "^7.0.0",
|
package/src/components/chips.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { LitElement, html } from "lit";
|
|
2
2
|
import { map } from "lit/directives/map.js";
|
|
3
|
-
import { styleEOX } from "../style.eox";
|
|
4
3
|
import {
|
|
5
4
|
handleChipClickMethod,
|
|
6
5
|
keyboardEventListenerMethod,
|
|
@@ -101,14 +100,11 @@ export class EOxItemFilterChipsV2 extends LitElement {
|
|
|
101
100
|
*/
|
|
102
101
|
render() {
|
|
103
102
|
return html`
|
|
104
|
-
<style>
|
|
105
|
-
${styleEOX}
|
|
106
|
-
</style>
|
|
107
103
|
<span class="chip-container">
|
|
108
104
|
${map(
|
|
109
105
|
this.items,
|
|
110
106
|
(item) => html`
|
|
111
|
-
<span class="chip" @click=${this.#handleChipClick.bind(this)}>
|
|
107
|
+
<span class="chip tiny-margin" @click=${this.#handleChipClick.bind(this)}>
|
|
112
108
|
<span class="chip-title">${item.title}</span>
|
|
113
109
|
<span
|
|
114
110
|
class="chip-item-close hidden"
|
|
@@ -65,18 +65,30 @@ export class EOxItemFilterExpandContainer extends LitElement {
|
|
|
65
65
|
() =>
|
|
66
66
|
html`<details
|
|
67
67
|
@toggle="${this.#handleDetailsToggle}"
|
|
68
|
-
class="details-filter"
|
|
68
|
+
class="details-filter max-width"
|
|
69
69
|
?open=${this.filterObject.expanded || nothing}
|
|
70
70
|
>
|
|
71
|
-
<summary>
|
|
72
|
-
<
|
|
73
|
-
class="
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
71
|
+
<summary class="square">
|
|
72
|
+
<nav class="responsive tiny-space">
|
|
73
|
+
<i class="small">
|
|
74
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
|
|
75
|
+
<title>chevron-right</title>
|
|
76
|
+
<path
|
|
77
|
+
d="M8.59,16.58L13.17,12L8.59,7.41L10,6L16,12L10,18L8.59,16.58Z"
|
|
78
|
+
/>
|
|
79
|
+
</svg>
|
|
80
|
+
</i>
|
|
81
|
+
<span
|
|
82
|
+
class="title max"
|
|
83
|
+
style="${!this.filterObject.title &&
|
|
84
|
+
"text-transform: var(--text-transform)"}"
|
|
85
|
+
>
|
|
86
|
+
${this.filterObject.title ||
|
|
87
|
+
this.filterObject.key ||
|
|
88
|
+
"Filter"}
|
|
89
|
+
</span>
|
|
78
90
|
<slot name="reset-button"></slot>
|
|
79
|
-
</
|
|
91
|
+
</nav>
|
|
80
92
|
</summary>
|
|
81
93
|
<div>
|
|
82
94
|
<slot name="filter"></slot>
|
|
@@ -94,16 +94,18 @@ export class EOxItemFilterRange extends LitElement {
|
|
|
94
94
|
return when(
|
|
95
95
|
this.filterObject,
|
|
96
96
|
() => html`
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
97
|
+
<div style="margin-left: var(--list-padding)">
|
|
98
|
+
${this.#label("min", "before")}
|
|
99
|
+
<tc-range-slider
|
|
100
|
+
min="${this.filterObject.min}"
|
|
101
|
+
max="${this.filterObject.max}"
|
|
102
|
+
value1="${this.filterObject.state.min || this.filterObject.min}"
|
|
103
|
+
value2="${this.filterObject.state.max || this.filterObject.max}"
|
|
104
|
+
step="${this.filterObject.step || 1}"
|
|
105
|
+
@change=${this.debouncedInputHandler}
|
|
106
|
+
></tc-range-slider>
|
|
107
|
+
${this.#label("max", "after")}
|
|
108
|
+
</div>
|
|
107
109
|
`,
|
|
108
110
|
);
|
|
109
111
|
}
|
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
import { LitElement, html, nothing } from "lit";
|
|
2
|
-
import { styleEOX } from "../../style.eox.js";
|
|
3
2
|
import { when } from "lit/directives/when.js";
|
|
4
3
|
import _debounce from "lodash.debounce";
|
|
5
|
-
import checkboxStyle from "@eox/elements-utils/styles/dist/checkbox.style.js";
|
|
6
|
-
import radioStyle from "@eox/elements-utils/styles/dist/radio.style.js";
|
|
7
4
|
import {
|
|
8
5
|
resetSelectorMethod,
|
|
9
6
|
toggleItemSelectorMethod,
|
|
@@ -175,31 +172,44 @@ export class EOxSelector extends LitElement {
|
|
|
175
172
|
}
|
|
176
173
|
}
|
|
177
174
|
|
|
175
|
+
/**
|
|
176
|
+
* Overrides the default createRenderRoot method to render in the light DOM.
|
|
177
|
+
*
|
|
178
|
+
* @returns {this} - The current instance to render in the light DOM.
|
|
179
|
+
*/
|
|
180
|
+
createRenderRoot() {
|
|
181
|
+
return this;
|
|
182
|
+
}
|
|
183
|
+
|
|
178
184
|
/**
|
|
179
185
|
* Renders the HTML template for the component.
|
|
180
186
|
*/
|
|
181
187
|
render() {
|
|
182
188
|
const type = this.type.includes("multi") ? "checkbox" : "radio";
|
|
183
189
|
const selectOverflowClass =
|
|
184
|
-
this.filteredSuggestions.length > 5 ? "select-overflow" : nothing;
|
|
190
|
+
this.filteredSuggestions.length > 5 ? "select-overflow scroll" : nothing;
|
|
185
191
|
return html`
|
|
186
192
|
<style>
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
193
|
+
:host,
|
|
194
|
+
:root {
|
|
195
|
+
--select-filter-max-items: 5;
|
|
196
|
+
}
|
|
190
197
|
</style>
|
|
191
198
|
${when(
|
|
192
199
|
this.suggestions.length > 10,
|
|
193
200
|
() =>
|
|
194
201
|
html`<div class="autocomplete-container">
|
|
195
|
-
<div
|
|
202
|
+
<div
|
|
203
|
+
class="autocomplete-container-wrapper field small no-round"
|
|
204
|
+
style="margin-left: var(--list-padding)"
|
|
205
|
+
>
|
|
196
206
|
<input
|
|
197
207
|
autocomplete="off"
|
|
198
208
|
tabindex=${this.tabIndex}
|
|
199
209
|
class="autocomplete-input"
|
|
200
210
|
type="text"
|
|
201
211
|
.value=${this.query}
|
|
202
|
-
placeholder="${this.filterObject.placeholder || ""}"
|
|
212
|
+
placeholder="${this.filterObject.placeholder || "Find..."}"
|
|
203
213
|
@input=${this.#handleInput}
|
|
204
214
|
@keydown=${this.#handleKeyDown}
|
|
205
215
|
@blur=${() => (this.showSuggestions = false)}
|
|
@@ -209,14 +219,14 @@ export class EOxSelector extends LitElement {
|
|
|
209
219
|
</div>`,
|
|
210
220
|
)}
|
|
211
221
|
<div class="select-container ${selectOverflowClass}">
|
|
212
|
-
<ul class="${this.type}">
|
|
222
|
+
<ul class="${this.type} list no-space">
|
|
213
223
|
${this.filteredSuggestions.map(
|
|
214
224
|
(suggestion) => html`
|
|
215
225
|
<li
|
|
216
226
|
data-identifier="${suggestion.toString().toLowerCase()}"
|
|
217
227
|
data-title="${suggestion}"
|
|
218
228
|
>
|
|
219
|
-
<label>
|
|
229
|
+
<label class="${type} small max">
|
|
220
230
|
<input
|
|
221
231
|
type="${type}"
|
|
222
232
|
name=${suggestion}
|
|
@@ -228,7 +238,7 @@ export class EOxSelector extends LitElement {
|
|
|
228
238
|
}}
|
|
229
239
|
tabindex=${this.tabIndex + 1}
|
|
230
240
|
/>
|
|
231
|
-
<span class="title">${suggestion}</span>
|
|
241
|
+
<span class="title small-line">${suggestion}</span>
|
|
232
242
|
</label>
|
|
233
243
|
</li>
|
|
234
244
|
`,
|
|
@@ -87,35 +87,37 @@ class EOxItemFilterSpatial extends LitElement {
|
|
|
87
87
|
return when(
|
|
88
88
|
this.filterObject,
|
|
89
89
|
() => html`
|
|
90
|
-
<
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
<
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
90
|
+
<div style="margin-left: var(--list-padding)">
|
|
91
|
+
<nav class="vertical-margin small-margin wrap">
|
|
92
|
+
${map(
|
|
93
|
+
["intersects", "within"],
|
|
94
|
+
(mode) => html`
|
|
95
|
+
<label class="radio small small-text">
|
|
96
|
+
<input
|
|
97
|
+
tabindex=${this.tabIndex}
|
|
98
|
+
type="radio"
|
|
99
|
+
name="mode"
|
|
100
|
+
.checked="${(this.filterObject.state.mode || "") === mode ||
|
|
101
|
+
nothing}"
|
|
102
|
+
value="${mode}"
|
|
103
|
+
@click=${() => this.#handleClick(mode)}
|
|
104
|
+
/>
|
|
105
|
+
<span>${mode} filter geometry</span>
|
|
106
|
+
</label>
|
|
107
|
+
`,
|
|
108
|
+
)}
|
|
109
|
+
</nav>
|
|
110
|
+
<eox-itemfilter-spatial-filter
|
|
111
|
+
exportparts="map: spatial-filter-map"
|
|
112
|
+
.geometry="${this.filterObject.state?.geometry}"
|
|
113
|
+
@filter="${(e) => {
|
|
114
|
+
this.filterObject.state.geometry = e.detail.geometry;
|
|
115
|
+
this.filterObject.dirty = true;
|
|
116
|
+
this.filterObject.stringifiedState = "Polygon";
|
|
117
|
+
this.dispatchEvent(new CustomEvent("filter"));
|
|
118
|
+
}}"
|
|
119
|
+
></eox-itemfilter-spatial>
|
|
120
|
+
</div>
|
|
119
121
|
`,
|
|
120
122
|
);
|
|
121
123
|
}
|
|
@@ -84,7 +84,10 @@ export class EOxItemFilterText extends LitElement {
|
|
|
84
84
|
() => html`
|
|
85
85
|
<style></style>
|
|
86
86
|
<div class="text-container">
|
|
87
|
-
<div
|
|
87
|
+
<div
|
|
88
|
+
class="text-container-wrapper field small"
|
|
89
|
+
style="margin-left: var(--list-padding)"
|
|
90
|
+
>
|
|
88
91
|
<input
|
|
89
92
|
type="text"
|
|
90
93
|
placeholder=${this.filterObject.placeholder}
|
|
@@ -99,7 +102,7 @@ export class EOxItemFilterText extends LitElement {
|
|
|
99
102
|
/>
|
|
100
103
|
</div>
|
|
101
104
|
</div>
|
|
102
|
-
<small class="error-validation"
|
|
105
|
+
<small class="error-validation" style="margin-left: var(--list-padding)"
|
|
103
106
|
>${this.filterObject.validation && this.isValid === false
|
|
104
107
|
? this.filterObject.validation.message
|
|
105
108
|
: ""}</small
|
|
@@ -223,7 +223,7 @@ export class EOxItemFilterContainer extends LitElement {
|
|
|
223
223
|
class="inline-container-wrapper"
|
|
224
224
|
@click="${this.#handleToggleDropdown}"
|
|
225
225
|
>
|
|
226
|
-
<div class="inline-container" part="container">
|
|
226
|
+
<div class="inline-container square border" part="container">
|
|
227
227
|
<div class="chip-container">
|
|
228
228
|
<div class="chip-wrapper">
|
|
229
229
|
<eox-itemfilter-chips
|
|
@@ -238,16 +238,34 @@ export class EOxItemFilterContainer extends LitElement {
|
|
|
238
238
|
${when(
|
|
239
239
|
isFiltersDirty(this.filters),
|
|
240
240
|
() => html`
|
|
241
|
-
<
|
|
242
|
-
class="chip-close"
|
|
241
|
+
<button
|
|
242
|
+
class="chip-close circle transparent small no-margin"
|
|
243
243
|
@click=${() =>
|
|
244
244
|
this.dispatchEvent(new CustomEvent("reset"))}
|
|
245
|
-
|
|
245
|
+
>
|
|
246
|
+
${this.unstyled
|
|
247
|
+
? "x"
|
|
248
|
+
: html`
|
|
249
|
+
<i class="small">
|
|
250
|
+
<svg
|
|
251
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
252
|
+
viewBox="0 0 24 24"
|
|
253
|
+
>
|
|
254
|
+
<title>close</title>
|
|
255
|
+
<path
|
|
256
|
+
d="M19,6.41L17.59,5L12,10.59L6.41,5L5,6.41L10.59,12L5,17.59L6.41,19L12,13.41L17.59,19L19,17.59L13.41,12L19,6.41Z"
|
|
257
|
+
/>
|
|
258
|
+
</svg>
|
|
259
|
+
</i>
|
|
260
|
+
`}
|
|
261
|
+
</button>
|
|
246
262
|
`,
|
|
247
263
|
)}
|
|
248
264
|
</div>
|
|
249
265
|
<div
|
|
250
|
-
class="input-container ${isFiltersDirty(
|
|
266
|
+
class="input-container field no-margin ${isFiltersDirty(
|
|
267
|
+
this.filters,
|
|
268
|
+
)
|
|
251
269
|
? "dirty-filter-input"
|
|
252
270
|
: ""}"
|
|
253
271
|
>
|
|
@@ -266,7 +284,7 @@ export class EOxItemFilterContainer extends LitElement {
|
|
|
266
284
|
</div>
|
|
267
285
|
<div popover="manual">
|
|
268
286
|
<div
|
|
269
|
-
class="inline-content"
|
|
287
|
+
class="inline-content square border"
|
|
270
288
|
slot="content"
|
|
271
289
|
@keydown="${this.#handleKeyDown}"
|
|
272
290
|
@click="${this.#handleFormClick}"
|
|
@@ -136,30 +136,28 @@ export class EOxItemFilterResults extends LitElement {
|
|
|
136
136
|
() => html`<small class="no-results">No matching items</small>`,
|
|
137
137
|
() => nothing,
|
|
138
138
|
)}
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
(
|
|
143
|
-
|
|
144
|
-
this.resultAggregation.filter(
|
|
145
|
-
(aggregationProperty) =>
|
|
146
|
-
this.aggregateResults(this.results, aggregationProperty)
|
|
147
|
-
.length,
|
|
148
|
-
),
|
|
139
|
+
${when(
|
|
140
|
+
this.config.aggregateResults,
|
|
141
|
+
() =>
|
|
142
|
+
map(
|
|
143
|
+
this.resultAggregation.filter(
|
|
149
144
|
(aggregationProperty) =>
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
.length === 1 && this.config.autoSpreadSingle,
|
|
153
|
-
() =>
|
|
154
|
-
html`<div style="margin-left: -8px">
|
|
155
|
-
${this.#createItemList(aggregationProperty)}
|
|
156
|
-
</div>`,
|
|
157
|
-
() => this.#createItemDetails(aggregationProperty),
|
|
158
|
-
)}`,
|
|
145
|
+
this.aggregateResults(this.results, aggregationProperty)
|
|
146
|
+
.length,
|
|
159
147
|
),
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
148
|
+
(aggregationProperty) =>
|
|
149
|
+
html`${when(
|
|
150
|
+
this.aggregateResults(this.results, aggregationProperty)
|
|
151
|
+
.length === 1 && this.config.autoSpreadSingle,
|
|
152
|
+
() =>
|
|
153
|
+
html`<div style="margin-left: -8px">
|
|
154
|
+
${this.#createItemList(aggregationProperty)}
|
|
155
|
+
</div>`,
|
|
156
|
+
() => this.#createItemDetails(aggregationProperty),
|
|
157
|
+
)}`,
|
|
158
|
+
),
|
|
159
|
+
() => this.#createItemList(),
|
|
160
|
+
)}
|
|
163
161
|
</div>
|
|
164
162
|
</section>
|
|
165
163
|
`;
|
|
@@ -10,7 +10,7 @@ function getChipItems(filters) {
|
|
|
10
10
|
return Object.keys(filters)
|
|
11
11
|
.map((filter) => ({
|
|
12
12
|
title: html`${filters[filter].title || filters[filter].key}:
|
|
13
|
-
|
|
13
|
+
${filters[filter].stringifiedState}`,
|
|
14
14
|
key: filter,
|
|
15
15
|
}))
|
|
16
16
|
.filter((item) => filters[item.key].dirty);
|
package/src/main.js
CHANGED
|
@@ -4,7 +4,6 @@ import { when } from "lit/directives/when.js";
|
|
|
4
4
|
import { style } from "./style";
|
|
5
5
|
import { styleEOX } from "./style.eox";
|
|
6
6
|
|
|
7
|
-
import allStyle from "@eox/elements-utils/styles/dist/all.style";
|
|
8
7
|
import "./components/expand-container";
|
|
9
8
|
import "./components/itemfilter-container";
|
|
10
9
|
import "./components/filters/text";
|
|
@@ -257,7 +256,7 @@ export class EOxItemFilter extends LitElement {
|
|
|
257
256
|
* @type String
|
|
258
257
|
*/
|
|
259
258
|
this.resultActionIcon =
|
|
260
|
-
'<svg style="width: 24px;" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><title>click me!</title><path fill="
|
|
259
|
+
'<svg style="width: 24px;" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><title>click me!</title><path fill="currentColor" d="M11.5,11L17.88,16.37L17,16.55L16.36,16.67C15.73,16.8 15.37,17.5 15.65,18.07L15.92,18.65L17.28,21.59L15.86,22.25L14.5,19.32L14.24,18.74C13.97,18.15 13.22,17.97 12.72,18.38L12.21,18.78L11.5,19.35V11M10.76,8.69A0.76,0.76 0 0,0 10,9.45V20.9C10,21.32 10.34,21.66 10.76,21.66C10.95,21.66 11.11,21.6 11.24,21.5L13.15,19.95L14.81,23.57C14.94,23.84 15.21,24 15.5,24C15.61,24 15.72,24 15.83,23.92L18.59,22.64C18.97,22.46 19.15,22 18.95,21.63L17.28,18L19.69,17.55C19.85,17.5 20,17.43 20.12,17.29C20.39,16.97 20.35,16.5 20,16.21L11.26,8.86L11.25,8.87C11.12,8.76 10.95,8.69 10.76,8.69M15,10V8H20V10H15M13.83,4.76L16.66,1.93L18.07,3.34L15.24,6.17L13.83,4.76M10,0H12V5H10V0M3.93,14.66L6.76,11.83L8.17,13.24L5.34,16.07L3.93,14.66M3.93,3.34L5.34,1.93L8.17,4.76L6.76,6.17L3.93,3.34M7,10H2V8H7V10" /></svg>';
|
|
261
260
|
|
|
262
261
|
/** Overrides elements current CSS.
|
|
263
262
|
*
|
|
@@ -432,7 +431,6 @@ export class EOxItemFilter extends LitElement {
|
|
|
432
431
|
<style>
|
|
433
432
|
${style}
|
|
434
433
|
${!this.unstyled && styleEOX}
|
|
435
|
-
${!this.unstyled && allStyle}
|
|
436
434
|
${this.styleOverride}
|
|
437
435
|
</style>
|
|
438
436
|
<form
|
|
@@ -443,70 +441,97 @@ export class EOxItemFilter extends LitElement {
|
|
|
443
441
|
${when(
|
|
444
442
|
this.filterProperties,
|
|
445
443
|
() => html`
|
|
446
|
-
<
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
.
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
444
|
+
<div style="display: var(--filter-display);">
|
|
445
|
+
<eox-itemfilter-container
|
|
446
|
+
.filters=${this.filters}
|
|
447
|
+
.filterProperties=${this.filterProperties}
|
|
448
|
+
.inlineMode=${this.inlineMode || false}
|
|
449
|
+
@reset=${() => this.resetFilters()}
|
|
450
|
+
@filter=${() => this.search()}
|
|
451
|
+
>
|
|
452
|
+
<section
|
|
453
|
+
slot="section"
|
|
454
|
+
style="height: 100%; overflow: hidden; display: flex; flex-direction: column;"
|
|
455
|
+
>
|
|
456
|
+
${when(
|
|
457
|
+
!this.inlineMode,
|
|
458
|
+
() => html`
|
|
459
|
+
<nav class="title-nav">
|
|
460
|
+
<div class="max">
|
|
461
|
+
<slot name="filterstitle"
|
|
462
|
+
><p><strong>Filters</strong></p></slot
|
|
463
|
+
>
|
|
464
|
+
</div>
|
|
465
|
+
${when(
|
|
466
|
+
!this.inlineMode &&
|
|
467
|
+
this.#config.filterProperties &&
|
|
468
|
+
!this.inlineMode &&
|
|
469
|
+
this.#config.filterProperties &&
|
|
470
|
+
isFiltersDirty(this.filters),
|
|
471
|
+
() => html`
|
|
472
|
+
<button
|
|
473
|
+
type="button"
|
|
474
|
+
id="filter-reset"
|
|
475
|
+
class="reset-icon border small"
|
|
476
|
+
data-cy="filter-reset"
|
|
477
|
+
@click=${() => this.resetFilters()}
|
|
478
|
+
>
|
|
479
|
+
${this.unstyled
|
|
480
|
+
? nothing
|
|
481
|
+
: html`
|
|
482
|
+
<i class="small">
|
|
483
|
+
<svg
|
|
484
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
485
|
+
viewBox="0 0 24 24"
|
|
486
|
+
>
|
|
487
|
+
<title>close</title>
|
|
488
|
+
<path
|
|
489
|
+
d="M19,6.41L17.59,5L12,10.59L6.41,5L5,6.41L10.59,12L5,17.59L6.41,19L12,13.41L17.59,19L19,17.59L13.41,12L19,6.41Z"
|
|
490
|
+
/>
|
|
491
|
+
</svg>
|
|
492
|
+
</i>
|
|
493
|
+
`}
|
|
494
|
+
<span class="small-text">Reset all</span>
|
|
495
|
+
</button>
|
|
496
|
+
`,
|
|
497
|
+
)}
|
|
498
|
+
</nav>
|
|
499
|
+
`,
|
|
483
500
|
)}
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
501
|
+
<div class="scroll" style="flex: 1;">
|
|
502
|
+
<ul id="filters" class="list no-space">
|
|
503
|
+
${map(
|
|
504
|
+
Object.values(this.filters),
|
|
505
|
+
(filterObject, index) =>
|
|
506
|
+
html` <li class="no-padding">
|
|
507
|
+
<eox-itemfilter-expandcontainer
|
|
508
|
+
.filterObject=${filterObject}
|
|
509
|
+
@details-toggled=${(e) =>
|
|
510
|
+
toggleAccordion(e, this.#config, this)}
|
|
511
|
+
data-details="${filterObject.key}"
|
|
512
|
+
>
|
|
513
|
+
${this.#createReset(
|
|
514
|
+
filterObject,
|
|
515
|
+
getTabIndex(index, 1),
|
|
516
|
+
)}
|
|
517
|
+
${this.#createFilter(
|
|
518
|
+
filterObject,
|
|
519
|
+
getTabIndex(index, 2),
|
|
520
|
+
)}
|
|
521
|
+
</eox-itemfilter-expandcontainer>
|
|
522
|
+
</li>`,
|
|
523
|
+
)}
|
|
524
|
+
</ul>
|
|
525
|
+
</div>
|
|
526
|
+
</section>
|
|
527
|
+
</eox-itemfilter-container>
|
|
528
|
+
</div>
|
|
505
529
|
`,
|
|
506
530
|
)}
|
|
507
531
|
${when(
|
|
508
532
|
this.#config?.showResults && this.results,
|
|
509
533
|
() => html`
|
|
534
|
+
<div class="small-space"></div>
|
|
510
535
|
<eox-itemfilter-results
|
|
511
536
|
.config=${this.#config}
|
|
512
537
|
.results=${this.results}
|
|
@@ -519,9 +544,11 @@ export class EOxItemFilter extends LitElement {
|
|
|
519
544
|
@result=${this.updateResult}
|
|
520
545
|
@click:result-action=${this.emitResultAction}
|
|
521
546
|
>
|
|
522
|
-
<
|
|
523
|
-
|
|
524
|
-
|
|
547
|
+
<nav class="title-nav">
|
|
548
|
+
<slot name="resultstitle"
|
|
549
|
+
><p><strong>Results</strong></p></slot
|
|
550
|
+
>
|
|
551
|
+
</nav>
|
|
525
552
|
</eox-itemfilter-results>
|
|
526
553
|
`,
|
|
527
554
|
)}
|