@fluid-topics/ft-search-saved-searches 1.0.42 → 1.0.43
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.
|
@@ -79,7 +79,7 @@ class FtSearchSavedSearches extends withI18n(FtSearchComponent) {
|
|
|
79
79
|
const request = (_a = this.stateManager) === null || _a === void 0 ? void 0 : _a.store.getState().request;
|
|
80
80
|
return request != undefined
|
|
81
81
|
&& deepEqual(request.query, mySearchRequest.query)
|
|
82
|
-
&& deepEqual([...request.filters], [...mySearchRequest.filters])
|
|
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
85
|
&& deepEqual(request.periodFilter, mySearchRequest.periodFilter);
|
|
@@ -904,4 +904,4 @@ const it=Symbol.for(""),et=t=>{if((null==t?void 0:t.r)===it)return null==t?void
|
|
|
904
904
|
display: none !important;
|
|
905
905
|
}
|
|
906
906
|
</style>
|
|
907
|
-
`}get userHasRights(){var t;return!!(null===(t=this.user)||void 0===t?void 0:t.roles.includes(this.requiredRole))}get isEmpty(){var t;return 0==(null!==(t=this.savedSearches)&&void 0!==t?t:[]).length}isSelected(t){var e;const o=null===(e=this.stateManager)||void 0===e?void 0:e.store.getState().request;return null!=o&&i.deepEqual(o.query,t.query)&&i.deepEqual([...o.filters],[...t.filters])&&i.deepEqual([...o.sort].map(this.mapFtSearchSortCriterion),[...t.sort].map(this.mapFtSearchSortCriterion))&&i.deepEqual(o.contentLocale,t.contentLocale)&&i.deepEqual(o.periodFilter,t.periodFilter)}mapFtSearchSortCriterion(t){return{...t}}toFtSearchRequest(t){return null==this.stateManager?void 0:{...this.stateManager.store.getState().request,periodFilter:t.periodFilter,query:t.query,filters:t.filters.map(this.mapSearchFilter),sort:t.sort,contentLocale:t.contentLocale}}mapSearchFilter(t){return{key:t.key,values:t.values,negative:t.negative}}connectedCallback(){super.connectedCallback(),to.reloadMySearches()}setSearch(t){var i;const e=this.toFtSearchRequest(t);null!=e&&(null===(i=this.stateManager)||void 0===i||i.setRequest(e))}update(t){super.update(t),(t.has("user")||t.has("savedSearches"))&&null==this.savedSearches&&to.reloadMySearches()}}eo.styles=Ai,eo.elementDefinitions={"ft-search-saved-search":Ye,"ft-typography":bi},io([o.property({type:Boolean})],eo.prototype,"showDescription",void 0),io([o.property({type:Boolean})],eo.prototype,"showSearchFilters",void 0),io([o.property({type:Boolean})],eo.prototype,"showSearchButton",void 0),io([o.property({type:Boolean})],eo.prototype,"showAlertStatus",void 0),io([i.redux({store:Qe.name})],eo.prototype,"savedSearches",void 0),io([i.redux({store:Ii.name,selector:t=>{var i;return null===(i=t.session)||void 0===i?void 0:i.profile}})],eo.prototype,"user",void 0),io([i.redux({store:"search"})],eo.prototype,"request",void 0),io([i.redux({store:Ii.name})],eo.prototype,"editorMode",void 0),i.customElement("ft-search-saved-searches")(eo),t.FtSearchSavedSearches=eo,t.FtSearchSavedSearchesCssVariables=Ci,t.styles=Ai}({},ftGlobals.wcUtils,ftGlobals.lit,ftGlobals.litDecorators,ftGlobals.litClassMap,ftGlobals.litUnsafeHTML,ftGlobals.litRepeat);
|
|
907
|
+
`}get userHasRights(){var t;return!!(null===(t=this.user)||void 0===t?void 0:t.roles.includes(this.requiredRole))}get isEmpty(){var t;return 0==(null!==(t=this.savedSearches)&&void 0!==t?t:[]).length}isSelected(t){var e;const o=null===(e=this.stateManager)||void 0===e?void 0:e.store.getState().request;return null!=o&&i.deepEqual(o.query,t.query)&&i.deepEqual([...o.filters],[...t.filters].map(this.mapSearchFilter))&&i.deepEqual([...o.sort].map(this.mapFtSearchSortCriterion),[...t.sort].map(this.mapFtSearchSortCriterion))&&i.deepEqual(o.contentLocale,t.contentLocale)&&i.deepEqual(o.periodFilter,t.periodFilter)}mapFtSearchSortCriterion(t){return{...t}}toFtSearchRequest(t){return null==this.stateManager?void 0:{...this.stateManager.store.getState().request,periodFilter:t.periodFilter,query:t.query,filters:t.filters.map(this.mapSearchFilter),sort:t.sort,contentLocale:t.contentLocale}}mapSearchFilter(t){return{key:t.key,values:t.values,negative:t.negative}}connectedCallback(){super.connectedCallback(),to.reloadMySearches()}setSearch(t){var i;const e=this.toFtSearchRequest(t);null!=e&&(null===(i=this.stateManager)||void 0===i||i.setRequest(e))}update(t){super.update(t),(t.has("user")||t.has("savedSearches"))&&null==this.savedSearches&&to.reloadMySearches()}}eo.styles=Ai,eo.elementDefinitions={"ft-search-saved-search":Ye,"ft-typography":bi},io([o.property({type:Boolean})],eo.prototype,"showDescription",void 0),io([o.property({type:Boolean})],eo.prototype,"showSearchFilters",void 0),io([o.property({type:Boolean})],eo.prototype,"showSearchButton",void 0),io([o.property({type:Boolean})],eo.prototype,"showAlertStatus",void 0),io([i.redux({store:Qe.name})],eo.prototype,"savedSearches",void 0),io([i.redux({store:Ii.name,selector:t=>{var i;return null===(i=t.session)||void 0===i?void 0:i.profile}})],eo.prototype,"user",void 0),io([i.redux({store:"search"})],eo.prototype,"request",void 0),io([i.redux({store:Ii.name})],eo.prototype,"editorMode",void 0),i.customElement("ft-search-saved-searches")(eo),t.FtSearchSavedSearches=eo,t.FtSearchSavedSearchesCssVariables=Ci,t.styles=Ai}({},ftGlobals.wcUtils,ftGlobals.lit,ftGlobals.litDecorators,ftGlobals.litClassMap,ftGlobals.litUnsafeHTML,ftGlobals.litRepeat);
|