@fluid-topics/ft-search-language-filter 2.2.25 → 2.2.27
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.
|
@@ -7,7 +7,7 @@ declare const FtSearchLanguageFilter_base: typeof FtSearchComponent & import("@f
|
|
|
7
7
|
export declare class FtSearchLanguageFilter extends FtSearchLanguageFilter_base implements FtSearchLanguageFilterProperties {
|
|
8
8
|
static elementDefinitions: ElementDefinitionsMap;
|
|
9
9
|
static styles: import("lit").CSSResult;
|
|
10
|
-
|
|
10
|
+
availableContentLocales?: Array<FtSearchLocale>;
|
|
11
11
|
currentSearchLocale?: string;
|
|
12
12
|
selectedSearchLocale?: string;
|
|
13
13
|
constructor();
|
|
@@ -13,15 +13,17 @@ import { FtSelect, FtSelectOption, } from "@fluid-topics/ft-select";
|
|
|
13
13
|
import { FtSearchComponent } from "@fluid-topics/ft-search-context/build/registration";
|
|
14
14
|
import { withI18n } from "@fluid-topics/ft-i18n";
|
|
15
15
|
import { selectorContext, selectorDefaultMessages, } from "./SearchLanguageFilterMessages";
|
|
16
|
+
import { ftAppInfoStore } from "@fluid-topics/ft-app-context";
|
|
16
17
|
export class FtSearchLanguageFilter extends withI18n(FtSearchComponent) {
|
|
17
18
|
constructor() {
|
|
18
19
|
super();
|
|
19
20
|
this.addI18nContext(selectorContext, selectorDefaultMessages);
|
|
21
|
+
this.addStore(ftAppInfoStore);
|
|
20
22
|
}
|
|
21
23
|
render() {
|
|
22
24
|
var _a;
|
|
23
25
|
var _b, _c;
|
|
24
|
-
if (((_b = (_a = this.
|
|
26
|
+
if (((_b = (_a = this.availableContentLocales) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 0) <= 1) {
|
|
25
27
|
return nothing;
|
|
26
28
|
}
|
|
27
29
|
return html `
|
|
@@ -30,7 +32,7 @@ export class FtSearchLanguageFilter extends withI18n(FtSearchComponent) {
|
|
|
30
32
|
aria-labelledby="language-filter-label"
|
|
31
33
|
outlined
|
|
32
34
|
@change=${(e) => this.setContentLocale(e)}>
|
|
33
|
-
${repeat(((_c = this.
|
|
35
|
+
${repeat(((_c = this.availableContentLocales) !== null && _c !== void 0 ? _c : []), (locale) => locale.lang, (locale) => { var _a; return html `
|
|
34
36
|
<ft-select-option value="${(_a = locale.lang) !== null && _a !== void 0 ? _a : "all"}"
|
|
35
37
|
label="${locale.label}"
|
|
36
38
|
?selected=${locale.lang == this.selectedSearchLocale}
|
|
@@ -59,8 +61,8 @@ FtSearchLanguageFilter.elementDefinitions = {
|
|
|
59
61
|
};
|
|
60
62
|
FtSearchLanguageFilter.styles = styles;
|
|
61
63
|
__decorate([
|
|
62
|
-
redux({ store:
|
|
63
|
-
], FtSearchLanguageFilter.prototype, "
|
|
64
|
+
redux({ store: ftAppInfoStore.name })
|
|
65
|
+
], FtSearchLanguageFilter.prototype, "availableContentLocales", void 0);
|
|
64
66
|
__decorate([
|
|
65
67
|
redux({ store: "search", selector: (state) => state.request.contentLocale })
|
|
66
68
|
], FtSearchLanguageFilter.prototype, "currentSearchLocale", void 0);
|