@fluid-topics/ft-search-saved-searches 1.0.59 → 1.0.61
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-saved-search.js +15 -8
- package/build/ft-search-saved-searches.css.js +13 -13
- package/build/ft-search-saved-searches.js +5 -1
- package/build/ft-search-saved-searches.light.js +502 -273
- package/build/ft-search-saved-searches.min.js +534 -305
- package/build/utils/SavedSearchesComponentMessages.d.ts +4 -0
- package/build/utils/SavedSearchesComponentMessages.js +4 -0
- package/package.json +5 -5
|
@@ -7,6 +7,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
7
7
|
import { css, html, nothing } from "lit";
|
|
8
8
|
import { property } from "lit/decorators.js";
|
|
9
9
|
import { FtSearchComponent } from "@fluid-topics/ft-search-context/build/registration";
|
|
10
|
+
import { FtSearchScope, FtVirtualField } from "@fluid-topics/public-api";
|
|
10
11
|
import "@fluid-topics/ft-card";
|
|
11
12
|
import "@fluid-topics/ft-icon";
|
|
12
13
|
import "@fluid-topics/ft-button";
|
|
@@ -61,20 +62,26 @@ class FtSearchSavedSearch extends withI18n(FtSearchComponent) {
|
|
|
61
62
|
}
|
|
62
63
|
// See net.antidot.fluidtopics.client.application.mylibrary.shared.MyLibraryTagWidgetFactory.createMySearchTags
|
|
63
64
|
renderSearchFilters() {
|
|
64
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
|
65
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
|
|
65
66
|
return this.showSearchFilters ? html `<div id="searchFilters" class="content">
|
|
66
67
|
${((_b = (_a = this.search) === null || _a === void 0 ? void 0 : _a.searchRequest.query.length) !== null && _b !== void 0 ? _b : 0 > 0)
|
|
67
68
|
? this.renderMetadata(savedSearches.messages.keywords(), (_c = this.search) === null || _c === void 0 ? void 0 : _c.searchRequest.query, true)
|
|
68
69
|
: nothing}
|
|
69
|
-
${(_d = this.search) === null || _d === void 0 ? void 0 : _d.searchRequest.
|
|
70
|
-
|
|
71
|
-
? this.renderMetadata(savedSearches.messages.language(), (_h = this.search) === null || _h === void 0 ? void 0 : _h.searchRequest.contentLocale, true)
|
|
70
|
+
${((_d = this.search) === null || _d === void 0 ? void 0 : _d.searchRequest.virtualField) == FtVirtualField.TITLE_ONLY
|
|
71
|
+
? this.renderMetadata(savedSearches.messages.in(), savedSearches.messages.titles(), true)
|
|
72
72
|
: nothing}
|
|
73
|
-
${((
|
|
74
|
-
? this.renderMetadata(savedSearches.messages.
|
|
73
|
+
${((_e = this.search) === null || _e === void 0 ? void 0 : _e.searchRequest.scope) == FtSearchScope.DOCUMENTS
|
|
74
|
+
? this.renderMetadata(savedSearches.messages.resultsType(), savedSearches.messages.documentsOnly(), true)
|
|
75
75
|
: nothing}
|
|
76
|
-
${(
|
|
77
|
-
|
|
76
|
+
${(_f = this.search) === null || _f === void 0 ? void 0 : _f.searchRequest.filters.map(f => this.renderMetadata(f.label, f.values))}
|
|
77
|
+
${((_j = (_h = (_g = this.search) === null || _g === void 0 ? void 0 : _g.searchRequest.contentLocale) === null || _h === void 0 ? void 0 : _h.length) !== null && _j !== void 0 ? _j : 0 > 0)
|
|
78
|
+
? this.renderMetadata(savedSearches.messages.language(), (_k = this.search) === null || _k === void 0 ? void 0 : _k.searchRequest.contentLocale, true)
|
|
79
|
+
: nothing}
|
|
80
|
+
${((_o = (_m = (_l = this.search) === null || _l === void 0 ? void 0 : _l.searchRequest.sort[0]) === null || _m === void 0 ? void 0 : _m.key.length) !== null && _o !== void 0 ? _o : 0 > 0)
|
|
81
|
+
? this.renderMetadata(savedSearches.messages.sort(), this.mapSortKey((_p = this.search) === null || _p === void 0 ? void 0 : _p.searchRequest.sort[0].key), true)
|
|
82
|
+
: nothing}
|
|
83
|
+
${((_q = this.search) === null || _q === void 0 ? void 0 : _q.searchRequest.periodFilter)
|
|
84
|
+
? this.renderMetadata(savedSearches.messages.period(), this.mapPeriodFilter((_r = this.search) === null || _r === void 0 ? void 0 : _r.searchRequest.periodFilter), true)
|
|
78
85
|
: nothing}
|
|
79
86
|
</div>` : nothing;
|
|
80
87
|
}
|
|
@@ -3,19 +3,19 @@ import { css } from "lit";
|
|
|
3
3
|
import { designSystemVariables, FtCssVariableFactory, setVariable } from "@fluid-topics/ft-wc-utils";
|
|
4
4
|
import { FtCardCssVariables } from "@fluid-topics/ft-card";
|
|
5
5
|
export const FtSearchSavedSearchesCssVariables = {
|
|
6
|
-
color: FtCssVariableFactory.extend("--ft-search-saved-searches-color", designSystemVariables.colorOnSurface),
|
|
7
|
-
activeButtonTextColor: FtCssVariableFactory.extend("--ft-search-saved-searches-active-button-text-color", designSystemVariables.colorPrimary),
|
|
8
|
-
activeSearchBackgroundColor: FtCssVariableFactory.extend("--ft-search-saved-searches-active-search-background-color", designSystemVariables.colorContent),
|
|
9
|
-
activeSearchBorderStyle: FtCssVariableFactory.create("--ft-search-saved-searches-active-search-border-style", "BORDER-STYLE", (_a = FtCardCssVariables.selectedOutlineStyle.lastResortDefaultValue()) !== null && _a !== void 0 ? _a : "solid"),
|
|
10
|
-
activeSearchBorderColor: FtCssVariableFactory.extend("--ft-search-saved-searches-active-search-border-color", designSystemVariables.colorPrimary),
|
|
11
|
-
activeSearchBorderWidth: FtCssVariableFactory.create("--ft-search-saved-searches-active-search-border-width", "SIZE", (_b = FtCardCssVariables.selectedOutlineWidth.lastResortDefaultValue()) !== null && _b !== void 0 ? _b : "2px"),
|
|
12
|
-
activeSearchBorderRadius: FtCssVariableFactory.extend("--ft-search-saved-searches-active-search-border-radius", designSystemVariables.borderRadiusM),
|
|
13
|
-
inactiveButtonTextColor: FtCssVariableFactory.extend("--ft-search-saved-searches-inactive-button-text-color", designSystemVariables.colorPrimary),
|
|
14
|
-
inactiveSearchBackgroundColor: FtCssVariableFactory.extend("--ft-search-saved-searches-inactive-search-background-color", designSystemVariables.colorContent),
|
|
15
|
-
inactiveSearchBorderStyle: FtCssVariableFactory.create("--ft-search-saved-searches-inactive-search-border-style", "BORDER-STYLE", (_c = FtCardCssVariables.outlineStyle.lastResortDefaultValue()) !== null && _c !== void 0 ? _c : "solid"),
|
|
16
|
-
inactiveSearchBorderColor: FtCssVariableFactory.extend("--ft-search-saved-searches-inactive-search-border-color", designSystemVariables.colorPrimary),
|
|
17
|
-
inactiveSearchBorderWidth: FtCssVariableFactory.create("--ft-search-saved-searches-inactive-search-border-width", "SIZE", (_d = FtCardCssVariables.outlineWidth.lastResortDefaultValue()) !== null && _d !== void 0 ? _d : "0"),
|
|
18
|
-
inactiveSearchBorderRadius: FtCssVariableFactory.extend("--ft-search-saved-searches-inactive-search-border-radius", designSystemVariables.borderRadiusM),
|
|
6
|
+
color: FtCssVariableFactory.extend("--ft-search-saved-searches-color", "", designSystemVariables.colorOnSurface),
|
|
7
|
+
activeButtonTextColor: FtCssVariableFactory.extend("--ft-search-saved-searches-active-button-text-color", "", designSystemVariables.colorPrimary),
|
|
8
|
+
activeSearchBackgroundColor: FtCssVariableFactory.extend("--ft-search-saved-searches-active-search-background-color", "", designSystemVariables.colorContent),
|
|
9
|
+
activeSearchBorderStyle: FtCssVariableFactory.create("--ft-search-saved-searches-active-search-border-style", "", "BORDER-STYLE", (_a = FtCardCssVariables.selectedOutlineStyle.lastResortDefaultValue()) !== null && _a !== void 0 ? _a : "solid"),
|
|
10
|
+
activeSearchBorderColor: FtCssVariableFactory.extend("--ft-search-saved-searches-active-search-border-color", "", designSystemVariables.colorPrimary),
|
|
11
|
+
activeSearchBorderWidth: FtCssVariableFactory.create("--ft-search-saved-searches-active-search-border-width", "", "SIZE", (_b = FtCardCssVariables.selectedOutlineWidth.lastResortDefaultValue()) !== null && _b !== void 0 ? _b : "2px"),
|
|
12
|
+
activeSearchBorderRadius: FtCssVariableFactory.extend("--ft-search-saved-searches-active-search-border-radius", "", designSystemVariables.borderRadiusM),
|
|
13
|
+
inactiveButtonTextColor: FtCssVariableFactory.extend("--ft-search-saved-searches-inactive-button-text-color", "", designSystemVariables.colorPrimary),
|
|
14
|
+
inactiveSearchBackgroundColor: FtCssVariableFactory.extend("--ft-search-saved-searches-inactive-search-background-color", "", designSystemVariables.colorContent),
|
|
15
|
+
inactiveSearchBorderStyle: FtCssVariableFactory.create("--ft-search-saved-searches-inactive-search-border-style", "", "BORDER-STYLE", (_c = FtCardCssVariables.outlineStyle.lastResortDefaultValue()) !== null && _c !== void 0 ? _c : "solid"),
|
|
16
|
+
inactiveSearchBorderColor: FtCssVariableFactory.extend("--ft-search-saved-searches-inactive-search-border-color", "", designSystemVariables.colorPrimary),
|
|
17
|
+
inactiveSearchBorderWidth: FtCssVariableFactory.create("--ft-search-saved-searches-inactive-search-border-width", "", "SIZE", (_d = FtCardCssVariables.outlineWidth.lastResortDefaultValue()) !== null && _d !== void 0 ? _d : "0"),
|
|
18
|
+
inactiveSearchBorderRadius: FtCssVariableFactory.extend("--ft-search-saved-searches-inactive-search-border-radius", "", designSystemVariables.borderRadiusM),
|
|
19
19
|
};
|
|
20
20
|
// language=CSS
|
|
21
21
|
export const styles = css `
|
|
@@ -82,7 +82,9 @@ class FtSearchSavedSearches extends withI18n(FtSearchComponent) {
|
|
|
82
82
|
&& deepEqual([...request.filters], [...mySearchRequest.filters].map(this.mapSearchFilter))
|
|
83
83
|
&& deepEqual([...request.sort].map(this.mapFtSearchSortCriterion), [...mySearchRequest.sort].map(this.mapFtSearchSortCriterion))
|
|
84
84
|
&& deepEqual(request.contentLocale, mySearchRequest.contentLocale)
|
|
85
|
-
&& deepEqual(request.periodFilter, mySearchRequest.periodFilter)
|
|
85
|
+
&& deepEqual(request.periodFilter, mySearchRequest.periodFilter)
|
|
86
|
+
&& deepEqual(request.virtualField, mySearchRequest.virtualField)
|
|
87
|
+
&& deepEqual(request.scope, mySearchRequest.scope);
|
|
86
88
|
}
|
|
87
89
|
mapFtSearchSortCriterion(s) {
|
|
88
90
|
return { ...s };
|
|
@@ -95,6 +97,8 @@ class FtSearchSavedSearches extends withI18n(FtSearchComponent) {
|
|
|
95
97
|
filters: mySearchRequest.filters.map(this.mapSearchFilter),
|
|
96
98
|
sort: mySearchRequest.sort,
|
|
97
99
|
contentLocale: mySearchRequest.contentLocale,
|
|
100
|
+
virtualField: mySearchRequest.virtualField,
|
|
101
|
+
scope: mySearchRequest.scope
|
|
98
102
|
};
|
|
99
103
|
}
|
|
100
104
|
mapSearchFilter(f) {
|