@fluid-topics/ft-search-bar 2.2.17 → 2.2.19
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/build/ft-search-bar.d.ts +1 -1
- package/build/ft-search-bar.js +9 -11
- package/build/ft-search-bar.light.js +123 -123
- package/build/ft-search-bar.min.js +363 -363
- package/build/managers/MobileSearchBarManager.js +3 -6
- package/package.json +16 -16
package/build/ft-search-bar.d.ts
CHANGED
|
@@ -20,7 +20,7 @@ export declare class SearchStateChangeEvent extends CustomEvent<FtSearchRequest>
|
|
|
20
20
|
}
|
|
21
21
|
export declare class FtSearchBar extends FtLitElement implements FtSearchBarProperties {
|
|
22
22
|
static elementDefinitions: ElementDefinitionsMap;
|
|
23
|
-
static styles: (import("lit").CSSResult | import("lit").CSSResult
|
|
23
|
+
static styles: (import("lit").CSSResult[] | import("lit").CSSResult)[];
|
|
24
24
|
dense: boolean;
|
|
25
25
|
mode?: DisplayMode;
|
|
26
26
|
forceMobileMenuOpen: boolean;
|
package/build/ft-search-bar.js
CHANGED
|
@@ -159,7 +159,7 @@ export class FtSearchBar extends FtLitElement {
|
|
|
159
159
|
};
|
|
160
160
|
}
|
|
161
161
|
get facetsRequest() {
|
|
162
|
-
const fromFilters = this.metadataFilters.filter((f) => { var _a
|
|
162
|
+
const fromFilters = this.metadataFilters.filter((f) => { var _a; var _b; return ((_b = (_a = f.valueFilter) === null || _a === void 0 ? void 0 : _a.values.length) !== null && _b !== void 0 ? _b : 0) > 0 && !this.displayedFilters.includes(f.key); })
|
|
163
163
|
.map((f) => ({ id: f.key }));
|
|
164
164
|
return [...this.displayedFilters.map((id) => ({ id })), ...fromFilters];
|
|
165
165
|
}
|
|
@@ -301,15 +301,12 @@ export class FtSearchBar extends FtLitElement {
|
|
|
301
301
|
this.contentLocale = (e.detail === "all" ? undefined : e.detail);
|
|
302
302
|
this.clearFilters();
|
|
303
303
|
}}>
|
|
304
|
-
${repeat(((_a = this.availableContentLocales) !== null && _a !== void 0 ? _a : []), (locale) => locale.lang, (locale) => {
|
|
305
|
-
var _a;
|
|
306
|
-
return html `
|
|
304
|
+
${repeat(((_a = this.availableContentLocales) !== null && _a !== void 0 ? _a : []), (locale) => locale.lang, (locale) => { var _a; return html `
|
|
307
305
|
<ft-radio value="${(_a = locale.lang) !== null && _a !== void 0 ? _a : "all"}"
|
|
308
306
|
?checked=${locale.lang == this.contentLocale}>
|
|
309
307
|
${locale.label}
|
|
310
308
|
</ft-radio>
|
|
311
|
-
`;
|
|
312
|
-
})}
|
|
309
|
+
`; })}
|
|
313
310
|
</ft-radio-group>
|
|
314
311
|
`;
|
|
315
312
|
}
|
|
@@ -385,7 +382,7 @@ export class FtSearchBar extends FtLitElement {
|
|
|
385
382
|
` : nothing}
|
|
386
383
|
${repeat(this.facets, (facet) => facet.key, (facet) => {
|
|
387
384
|
const filter = facetToFilter(facet);
|
|
388
|
-
const hierachical = filter.options.some((o) => { var _a
|
|
385
|
+
const hierachical = filter.options.some((o) => { var _a; var _b; return ((_b = (_a = o.subOptions) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 0) > 0; });
|
|
389
386
|
const keyWithNoColumn = facet.key.replace(":", "-");
|
|
390
387
|
return html `
|
|
391
388
|
<ft-filter
|
|
@@ -419,7 +416,8 @@ export class FtSearchBar extends FtLitElement {
|
|
|
419
416
|
});
|
|
420
417
|
}
|
|
421
418
|
update(props) {
|
|
422
|
-
var _a, _b
|
|
419
|
+
var _a, _b;
|
|
420
|
+
var _c, _d, _e;
|
|
423
421
|
if (props.has("labels")) {
|
|
424
422
|
this.labelResolver = new ParametrizedLabelResolver(DEFAULT_LABELS, this.labels);
|
|
425
423
|
}
|
|
@@ -443,14 +441,14 @@ export class FtSearchBar extends FtLitElement {
|
|
|
443
441
|
this.initRecentSearches();
|
|
444
442
|
}
|
|
445
443
|
if (props.has("presets")) {
|
|
446
|
-
((
|
|
444
|
+
((_c = this.presets) !== null && _c !== void 0 ? _c : []).forEach((preset) => preset.metadataFilters.forEach((filter) => {
|
|
447
445
|
if (filter.valueFilter) {
|
|
448
446
|
filter.valueFilter.values = filter.valueFilter.values.map((v) => unquote(v));
|
|
449
447
|
}
|
|
450
448
|
}));
|
|
451
449
|
}
|
|
452
450
|
if (props.has("presets") || props.has("selectedPreset")) {
|
|
453
|
-
const currentPreset = ((
|
|
451
|
+
const currentPreset = ((_d = this.presets) !== null && _d !== void 0 ? _d : []).find((p) => p.name === this.selectedPreset);
|
|
454
452
|
if (currentPreset && !this.compareRequests(this.request, currentPreset)) {
|
|
455
453
|
this.setFiltersFromPreset(currentPreset);
|
|
456
454
|
}
|
|
@@ -459,7 +457,7 @@ export class FtSearchBar extends FtLitElement {
|
|
|
459
457
|
this.knownFacetLabels = new Map();
|
|
460
458
|
}
|
|
461
459
|
if (["contentLocale", "metadataFilters"].some((p) => props.has(p))) {
|
|
462
|
-
this.selectedPreset = (
|
|
460
|
+
this.selectedPreset = (_b = ((_e = this.presets) !== null && _e !== void 0 ? _e : []).find((p) => this.compareRequests(p, this.request))) === null || _b === void 0 ? void 0 : _b.name;
|
|
463
461
|
}
|
|
464
462
|
if (["baseUrl", "apiIntegrationIdentifier"].some((p) => props.has(p))) {
|
|
465
463
|
this.api = undefined;
|