@fluid-topics/ft-search-context 2.2.52 → 2.2.53
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-context.d.ts +8 -7
- package/build/ft-search-context.js +7 -4
- package/build/ft-search-context.light.js +15 -5
- package/build/ft-search-context.min.js +18 -17
- package/build/store/FtSearchStateManager.d.ts +7 -2
- package/build/store/FtSearchStateManager.js +14 -4
- package/build/utils.d.ts +7 -1
- package/build/utils.js +17 -0
- package/package.json +4 -4
|
@@ -2,7 +2,7 @@ import { PropertyValues } from "lit";
|
|
|
2
2
|
import { ElementDefinitionsMap, FtLitElementRedux, FtRegistrationContext } from "@fluid-topics/ft-wc-utils";
|
|
3
3
|
import { FtSearchContextProperties } from "./ft-search-context.properties";
|
|
4
4
|
import { FtSearchComponentInterface, FtSearchStateManager } from "./registration";
|
|
5
|
-
import { FtMetadataFilter, FtSearchKeywordMatch, FtSearchScope, FtSearchSortCriterion, FtSession, FtVirtualField } from "@fluid-topics/public-api";
|
|
5
|
+
import { FtMetadataFilter, FtSearchKeywordMatch, FtSearchRequest, FtSearchResultsPageInfo, FtSearchScope, FtSearchSortCriterion, FtSession, FtSpellcheck, FtVirtualField } from "@fluid-topics/public-api";
|
|
6
6
|
import { FtSearchService } from "./store/utils/FtSearchService";
|
|
7
7
|
import { FtAnalyticsSearchEventManager } from "./store/FtAnalyticsSearchEventManager";
|
|
8
8
|
export declare class FtSearchContext extends FtLitElementRedux implements FtSearchContextProperties, FtRegistrationContext<FtSearchComponentInterface> {
|
|
@@ -24,17 +24,18 @@ export declare class FtSearchContext extends FtLitElementRedux implements FtSear
|
|
|
24
24
|
sortId?: string;
|
|
25
25
|
sort: FtSearchSortCriterion[];
|
|
26
26
|
otherQueryParams: Record<string, string>;
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
27
|
+
protected request?: FtSearchRequest;
|
|
28
|
+
protected paging?: FtSearchResultsPageInfo;
|
|
29
|
+
protected spellcheckAutocorrect?: FtSpellcheck;
|
|
30
|
+
protected _appIntegrationInfoReady: boolean;
|
|
31
31
|
searchServiceProvider?: () => FtSearchService;
|
|
32
|
-
|
|
32
|
+
protected _stateManager?: FtSearchStateManager;
|
|
33
33
|
disableAnalyticsEvents: boolean;
|
|
34
|
-
|
|
34
|
+
protected _eventManager?: FtAnalyticsSearchEventManager;
|
|
35
35
|
get stateManager(): FtSearchStateManager;
|
|
36
36
|
get eventManager(): FtAnalyticsSearchEventManager;
|
|
37
37
|
constructor();
|
|
38
|
+
protected buildStateManager(): void;
|
|
38
39
|
protected render(): import("lit").TemplateResult<1>;
|
|
39
40
|
protected willUpdate(props: PropertyValues): void;
|
|
40
41
|
connectedCallback(): void;
|
|
@@ -15,10 +15,7 @@ import { LoadErrorEvent, SearchRequestChangeEvent, SearchResultsChangeEvent, } f
|
|
|
15
15
|
export class FtSearchContext extends FtLitElementRedux {
|
|
16
16
|
get stateManager() {
|
|
17
17
|
if (this._stateManager == null) {
|
|
18
|
-
|
|
19
|
-
this._stateManager = FtSearchStateManager.build(this.id || ("" + Math.round(Math.random() * 999000)).padStart(6, "0"), service);
|
|
20
|
-
this._stateManager.errorHandler = (e) => this.handleLoadError(e);
|
|
21
|
-
this.addStore(this.stateManager.store, "search");
|
|
18
|
+
this.buildStateManager();
|
|
22
19
|
}
|
|
23
20
|
return this._stateManager;
|
|
24
21
|
}
|
|
@@ -43,6 +40,12 @@ export class FtSearchContext extends FtLitElementRedux {
|
|
|
43
40
|
this.disableAnalyticsEvents = false;
|
|
44
41
|
this.addStore(ftAppInfoStore);
|
|
45
42
|
}
|
|
43
|
+
buildStateManager() {
|
|
44
|
+
const service = this.searchServiceProvider ? this.searchServiceProvider() : undefined;
|
|
45
|
+
this._stateManager = FtSearchStateManager.build(this.id || ("" + Math.round(Math.random() * 999000)).padStart(6, "0"), service);
|
|
46
|
+
this._stateManager.errorHandler = (e) => this.handleLoadError(e);
|
|
47
|
+
this.addStore(this.stateManager.store, "search");
|
|
48
|
+
}
|
|
46
49
|
render() {
|
|
47
50
|
return html `
|
|
48
51
|
<slot @register-ft-search-component=${this.registerComponent} @ft-search-result-click=${this.onResultClicked}
|