@sinequa/atomic-angular 0.0.140
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/assets/tailwind.css +248 -0
- package/esm2022/lib/assistant/index.mjs +2 -0
- package/esm2022/lib/assistant/signalR.web.service.mjs +81 -0
- package/esm2022/lib/components/dropdown.mjs +127 -0
- package/esm2022/lib/components/index.mjs +5 -0
- package/esm2022/lib/components/menu/index.mjs +3 -0
- package/esm2022/lib/components/menu/menu-item.mjs +22 -0
- package/esm2022/lib/components/menu/menu.mjs +99 -0
- package/esm2022/lib/components/metadata/index.mjs +2 -0
- package/esm2022/lib/components/metadata/metadata.component.mjs +65 -0
- package/esm2022/lib/components/theme/index.mjs +3 -0
- package/esm2022/lib/components/theme/theme-selector.component.mjs +67 -0
- package/esm2022/lib/components/theme/theme-toggle.component.mjs +67 -0
- package/esm2022/lib/directives/index.mjs +5 -0
- package/esm2022/lib/directives/infinite-scroll.directive.mjs +47 -0
- package/esm2022/lib/directives/select-article-on-click.directive.mjs +39 -0
- package/esm2022/lib/directives/show-bookmark.directive.mjs +55 -0
- package/esm2022/lib/directives/theme-provider.directive.mjs +31 -0
- package/esm2022/lib/guards/auth.guard.mjs +27 -0
- package/esm2022/lib/guards/index.mjs +3 -0
- package/esm2022/lib/guards/initialization.guard.mjs +41 -0
- package/esm2022/lib/interceptors/audit.interceptor.mjs +23 -0
- package/esm2022/lib/interceptors/auth.interceptor.mjs +49 -0
- package/esm2022/lib/interceptors/body.interceptor.mjs +24 -0
- package/esm2022/lib/interceptors/error.interceptor.mjs +35 -0
- package/esm2022/lib/interceptors/index.mjs +7 -0
- package/esm2022/lib/interceptors/toast.interceptor.mjs +27 -0
- package/esm2022/lib/models/aggregation.mjs +2 -0
- package/esm2022/lib/models/article-metadata.mjs +2 -0
- package/esm2022/lib/models/autocomplete.mjs +2 -0
- package/esm2022/lib/models/custom-json.mjs +2 -0
- package/esm2022/lib/models/filter-dropdown.mjs +2 -0
- package/esm2022/lib/models/index.mjs +7 -0
- package/esm2022/lib/models/user-settings.mjs +2 -0
- package/esm2022/lib/pipes/highlight-word.pipe.mjs +33 -0
- package/esm2022/lib/pipes/index.mjs +3 -0
- package/esm2022/lib/pipes/source-icon.pipe.mjs +43 -0
- package/esm2022/lib/providers/eager-provider.mjs +24 -0
- package/esm2022/lib/providers/index.mjs +2 -0
- package/esm2022/lib/public-api.mjs +19 -0
- package/esm2022/lib/resolvers/index.mjs +2 -0
- package/esm2022/lib/resolvers/query-name-resolver.mjs +14 -0
- package/esm2022/lib/resources/index.mjs +2 -0
- package/esm2022/lib/resources/themes.mjs +53 -0
- package/esm2022/lib/services/application.service.mjs +245 -0
- package/esm2022/lib/services/autocomplete.service.mjs +85 -0
- package/esm2022/lib/services/drawer/backdrop.service.mjs +23 -0
- package/esm2022/lib/services/drawer/drawer-stack.service.mjs +152 -0
- package/esm2022/lib/services/drawer/drawer.service.mjs +38 -0
- package/esm2022/lib/services/index.mjs +12 -0
- package/esm2022/lib/services/label.service.mjs +161 -0
- package/esm2022/lib/services/navigation.service.mjs +59 -0
- package/esm2022/lib/services/saved-searches.service.mjs +75 -0
- package/esm2022/lib/services/search.service.mjs +89 -0
- package/esm2022/lib/services/selection-history.service.mjs +92 -0
- package/esm2022/lib/services/selection.service.mjs +87 -0
- package/esm2022/lib/stores/aggregations.store.mjs +62 -0
- package/esm2022/lib/stores/app.store.mjs +265 -0
- package/esm2022/lib/stores/application.store.mjs +93 -0
- package/esm2022/lib/stores/index.mjs +9 -0
- package/esm2022/lib/stores/principal.store.mjs +47 -0
- package/esm2022/lib/stores/query-params.store.mjs +208 -0
- package/esm2022/lib/stores/selection.store.mjs +46 -0
- package/esm2022/lib/stores/theme.store.mjs +116 -0
- package/esm2022/lib/stores/user-settings.store.mjs +272 -0
- package/esm2022/lib/tokens/highlights.mjs +32 -0
- package/esm2022/lib/tokens/index.mjs +2 -0
- package/esm2022/lib/utils/debounced-signal.mjs +38 -0
- package/esm2022/lib/utils/index.mjs +8 -0
- package/esm2022/lib/utils/inline-worker.mjs +40 -0
- package/esm2022/lib/utils/query.mjs +58 -0
- package/esm2022/lib/utils/routes.mjs +28 -0
- package/esm2022/lib/utils/tailwind-utils.mjs +6 -0
- package/esm2022/lib/utils/theme-body-hook.mjs +18 -0
- package/esm2022/lib/utils/theme-registry.mjs +6 -0
- package/esm2022/lib/web-services/aggregations.service.mjs +104 -0
- package/esm2022/lib/web-services/app.service.mjs +48 -0
- package/esm2022/lib/web-services/audit.service.mjs +122 -0
- package/esm2022/lib/web-services/index.mjs +10 -0
- package/esm2022/lib/web-services/json-method-plugin.service.mjs +54 -0
- package/esm2022/lib/web-services/preview.service.mjs +327 -0
- package/esm2022/lib/web-services/principal.service.mjs +46 -0
- package/esm2022/lib/web-services/query.service.mjs +123 -0
- package/esm2022/lib/web-services/text-chunck.service.mjs +46 -0
- package/esm2022/public-api.mjs +5 -0
- package/esm2022/sinequa-atomic-angular.mjs +5 -0
- package/fesm2022/sinequa-atomic-angular.mjs +4204 -0
- package/fesm2022/sinequa-atomic-angular.mjs.map +1 -0
- package/index.d.ts +5 -0
- package/lib/assistant/index.d.ts +1 -0
- package/lib/assistant/signalR.web.service.d.ts +46 -0
- package/lib/components/dropdown.d.ts +50 -0
- package/lib/components/index.d.ts +4 -0
- package/lib/components/menu/index.d.ts +2 -0
- package/lib/components/menu/menu-item.d.ts +8 -0
- package/lib/components/menu/menu.d.ts +24 -0
- package/lib/components/metadata/index.d.ts +1 -0
- package/lib/components/metadata/metadata.component.d.ts +24 -0
- package/lib/components/theme/index.d.ts +2 -0
- package/lib/components/theme/theme-selector.component.d.ts +70 -0
- package/lib/components/theme/theme-toggle.component.d.ts +10 -0
- package/lib/directives/index.d.ts +4 -0
- package/lib/directives/infinite-scroll.directive.d.ts +30 -0
- package/lib/directives/select-article-on-click.directive.d.ts +14 -0
- package/lib/directives/show-bookmark.directive.d.ts +52 -0
- package/lib/directives/theme-provider.directive.d.ts +20 -0
- package/lib/guards/auth.guard.d.ts +7 -0
- package/lib/guards/index.d.ts +2 -0
- package/lib/guards/initialization.guard.d.ts +20 -0
- package/lib/interceptors/audit.interceptor.d.ts +13 -0
- package/lib/interceptors/auth.interceptor.d.ts +14 -0
- package/lib/interceptors/body.interceptor.d.ts +11 -0
- package/lib/interceptors/error.interceptor.d.ts +9 -0
- package/lib/interceptors/index.d.ts +5 -0
- package/lib/interceptors/toast.interceptor.d.ts +13 -0
- package/lib/models/aggregation.d.ts +12 -0
- package/lib/models/article-metadata.d.ts +5 -0
- package/lib/models/autocomplete.d.ts +5 -0
- package/lib/models/custom-json.d.ts +58 -0
- package/lib/models/filter-dropdown.d.ts +10 -0
- package/lib/models/index.d.ts +6 -0
- package/lib/models/user-settings.d.ts +32 -0
- package/lib/pipes/highlight-word.pipe.d.ts +22 -0
- package/lib/pipes/index.d.ts +2 -0
- package/lib/pipes/source-icon.pipe.d.ts +54 -0
- package/lib/providers/eager-provider.d.ts +11 -0
- package/lib/providers/index.d.ts +1 -0
- package/lib/public-api.d.ts +15 -0
- package/lib/resolvers/index.d.ts +1 -0
- package/lib/resolvers/query-name-resolver.d.ts +9 -0
- package/lib/resources/index.d.ts +1 -0
- package/lib/resources/themes.d.ts +51 -0
- package/lib/services/application.service.d.ts +178 -0
- package/lib/services/autocomplete.service.d.ts +91 -0
- package/lib/services/drawer/backdrop.service.d.ts +9 -0
- package/lib/services/drawer/drawer-stack.service.d.ts +70 -0
- package/lib/services/drawer/drawer.service.d.ts +15 -0
- package/lib/services/index.d.ts +11 -0
- package/lib/services/label.service.d.ts +117 -0
- package/lib/services/navigation.service.d.ts +33 -0
- package/lib/services/saved-searches.service.d.ts +145 -0
- package/lib/services/search.service.d.ts +155 -0
- package/lib/services/selection-history.service.d.ts +50 -0
- package/lib/services/selection.service.d.ts +127 -0
- package/lib/stores/aggregations.store.d.ts +50 -0
- package/lib/stores/app.store.d.ts +208 -0
- package/lib/stores/application.store.d.ts +106 -0
- package/lib/stores/index.d.ts +8 -0
- package/lib/stores/principal.store.d.ts +53 -0
- package/lib/stores/query-params.store.d.ts +187 -0
- package/lib/stores/selection.store.d.ts +62 -0
- package/lib/stores/theme.store.d.ts +55 -0
- package/lib/stores/user-settings.store.d.ts +161 -0
- package/lib/tokens/highlights.d.ts +8 -0
- package/lib/tokens/index.d.ts +1 -0
- package/lib/utils/debounced-signal.d.ts +25 -0
- package/lib/utils/index.d.ts +7 -0
- package/lib/utils/inline-worker.d.ts +11 -0
- package/lib/utils/query.d.ts +26 -0
- package/lib/utils/routes.d.ts +16 -0
- package/lib/utils/tailwind-utils.d.ts +2 -0
- package/lib/utils/theme-body-hook.d.ts +6 -0
- package/lib/utils/theme-registry.d.ts +3 -0
- package/lib/web-services/aggregations.service.d.ts +60 -0
- package/lib/web-services/app.service.d.ts +30 -0
- package/lib/web-services/audit.service.d.ts +75 -0
- package/lib/web-services/index.d.ts +9 -0
- package/lib/web-services/json-method-plugin.service.d.ts +41 -0
- package/lib/web-services/preview.service.d.ts +295 -0
- package/lib/web-services/principal.service.d.ts +28 -0
- package/lib/web-services/query.service.d.ts +29 -0
- package/lib/web-services/text-chunck.service.d.ts +22 -0
- package/package.json +28 -0
- package/public-api.d.ts +1 -0
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { Aggregation } from "@sinequa/atomic";
|
|
2
|
+
type AggregationsState = {
|
|
3
|
+
aggregations: Aggregation[];
|
|
4
|
+
};
|
|
5
|
+
export declare const AggregationsStore: import("@angular/core").Type<{
|
|
6
|
+
aggregations: import("@angular/core").Signal<Aggregation[]>;
|
|
7
|
+
update: (aggregations: Aggregation[]) => void;
|
|
8
|
+
updateAggregation: (aggregation: Aggregation) => void;
|
|
9
|
+
clear: () => void;
|
|
10
|
+
getAggregation: (name: string, kind?: "column" | "name") => Aggregation | undefined;
|
|
11
|
+
} & import("@ngrx/signals").StateSignal<{
|
|
12
|
+
aggregations: Aggregation[];
|
|
13
|
+
}>>;
|
|
14
|
+
export declare function WithAggregationsFeatures(): import("@ngrx/signals").SignalStoreFeature<import("@ngrx/signals/src/signal-store-models").EmptyFeatureResult, {
|
|
15
|
+
state: Omit<AggregationsState, "update" | "clear" | "updateAggregation" | "getAggregation">;
|
|
16
|
+
signals: Omit<{}, "update" | "clear" | "updateAggregation" | "getAggregation">;
|
|
17
|
+
methods: Omit<{}, "update" | "clear" | "updateAggregation" | "getAggregation">;
|
|
18
|
+
} & import("@ngrx/signals/src/signal-store-models").EmptyFeatureResult & {
|
|
19
|
+
methods: {
|
|
20
|
+
/**
|
|
21
|
+
* Updates the state with the provided aggregations.
|
|
22
|
+
*
|
|
23
|
+
* @param {Aggregation[]} aggregations - The new aggregations to update the state with.
|
|
24
|
+
*/
|
|
25
|
+
update(aggregations: Aggregation[]): void;
|
|
26
|
+
/**
|
|
27
|
+
* Updates an existing aggregation in the store.
|
|
28
|
+
*
|
|
29
|
+
* @param aggregation - The aggregation object to update.
|
|
30
|
+
* @returns void
|
|
31
|
+
*/
|
|
32
|
+
updateAggregation(aggregation: Aggregation): void;
|
|
33
|
+
/**
|
|
34
|
+
* Clears the aggregations in the store by setting the `aggregations` property to an empty array.
|
|
35
|
+
*
|
|
36
|
+
* @remarks
|
|
37
|
+
* This method uses the `patchState` function to update the state of the store.
|
|
38
|
+
*/
|
|
39
|
+
clear(): void;
|
|
40
|
+
/**
|
|
41
|
+
* Retrieves an aggregation by name or column.
|
|
42
|
+
*
|
|
43
|
+
* @param name - The name or column of the aggregation to retrieve.
|
|
44
|
+
* @param kind - The kind of aggregation to retrieve. Defaults to "name".
|
|
45
|
+
* @returns The matching aggregation, or undefined if not found.
|
|
46
|
+
*/
|
|
47
|
+
getAggregation(name: string, kind?: "column" | "name"): Aggregation | undefined;
|
|
48
|
+
};
|
|
49
|
+
}>;
|
|
50
|
+
export {};
|
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
import { InjectionToken } from '@angular/core';
|
|
2
|
+
import { ActivatedRoute } from '@angular/router';
|
|
3
|
+
import { Aggregation, CCApp, CCQuery, CCWebService } from '@sinequa/atomic';
|
|
4
|
+
import { CFilter, CFilterItem, CJ, CJson } from '../models/custom-json';
|
|
5
|
+
/**
|
|
6
|
+
* Injection token for a list of facet names to display in the application.
|
|
7
|
+
*
|
|
8
|
+
* This token provides a default list of facet names including:
|
|
9
|
+
* - Geo
|
|
10
|
+
* - Company
|
|
11
|
+
* - Person
|
|
12
|
+
* - DocFormat
|
|
13
|
+
* - Modified
|
|
14
|
+
* - Size
|
|
15
|
+
* - DocumentLanguages
|
|
16
|
+
* - Concepts
|
|
17
|
+
*
|
|
18
|
+
* @constant
|
|
19
|
+
* @type {InjectionToken<string[]>}
|
|
20
|
+
*/
|
|
21
|
+
export declare const AGGREGATIONS_NAMES_PRESET_DEFAULT: string[];
|
|
22
|
+
export declare const AGGREGATIONS_NAMES: InjectionToken<string[]>;
|
|
23
|
+
export type CCAppState = {
|
|
24
|
+
webServices: Record<string, CCWebService>;
|
|
25
|
+
data: CJson;
|
|
26
|
+
queries: Record<string, CCQuery>;
|
|
27
|
+
customJSONs: CJ[];
|
|
28
|
+
};
|
|
29
|
+
export declare const AppStore: import("@angular/core").Type<{
|
|
30
|
+
webServices: import("@angular/core").Signal<Record<string, CCWebService>>;
|
|
31
|
+
data: import("@ngrx/signals/src/deep-signal").DeepSignal<CJson>;
|
|
32
|
+
queries: import("@angular/core").Signal<Record<string, CCQuery>>;
|
|
33
|
+
customJSONs: import("@angular/core").Signal<CJ[]>;
|
|
34
|
+
filters: import("@angular/core").Signal<CFilter[]>;
|
|
35
|
+
sources: import("@angular/core").Signal<import("../models/custom-json").CSources | {
|
|
36
|
+
routes?: [];
|
|
37
|
+
filters?: CFilter[];
|
|
38
|
+
}>;
|
|
39
|
+
customizationJson: import("@angular/core").Signal<CJson>;
|
|
40
|
+
update: (app: CCApp) => void;
|
|
41
|
+
initialize: () => Promise<void>;
|
|
42
|
+
initializeWithAppName: (appName: string) => Promise<void>;
|
|
43
|
+
getWebServiceByType: (type: CCWebService["webServiceType"]) => CCWebService | undefined;
|
|
44
|
+
getLabels: () => {
|
|
45
|
+
private: string;
|
|
46
|
+
public: string;
|
|
47
|
+
};
|
|
48
|
+
getQueryByName: (name: string) => CCQuery | undefined;
|
|
49
|
+
getQueryByIndex: (index: number) => CCQuery | undefined;
|
|
50
|
+
getDefaultQuery: () => CCQuery | undefined;
|
|
51
|
+
allowEmptySearch: (queryName: string) => boolean;
|
|
52
|
+
getNamedCustomizationJson: (name: string) => any | undefined;
|
|
53
|
+
getColumnAlias: (column: string) => string;
|
|
54
|
+
getAggregationIcon: (column: string) => string | undefined;
|
|
55
|
+
getAggregationItemsCustomization: (column: string) => CFilterItem[] | undefined;
|
|
56
|
+
getAggregationCustomization: (column: string) => CFilter | undefined;
|
|
57
|
+
getAuthorizedFilters: (route: ActivatedRoute) => Aggregation[];
|
|
58
|
+
} & import("@ngrx/signals").StateSignal<{
|
|
59
|
+
webServices: Record<string, CCWebService>;
|
|
60
|
+
data: CJson;
|
|
61
|
+
queries: Record<string, CCQuery>;
|
|
62
|
+
customJSONs: CJ[];
|
|
63
|
+
}>>;
|
|
64
|
+
/**
|
|
65
|
+
* Enhances the application store with various features and methods.
|
|
66
|
+
*
|
|
67
|
+
* This function integrates state management, computed properties, and methods
|
|
68
|
+
* to interact with the CCApp state, including initialization, updates,
|
|
69
|
+
* and retrieval of specific data such as web services, queries, and customization JSONs.
|
|
70
|
+
*
|
|
71
|
+
* Features:
|
|
72
|
+
* - State management with initial data.
|
|
73
|
+
* - Computed properties for customization JSON, sources, and filters.
|
|
74
|
+
* - Methods for initializing and updating the application state.
|
|
75
|
+
* - Methods for retrieving web services, labels, queries, and customization JSONs.
|
|
76
|
+
* - Methods for retrieving aggregation icons and customization items.
|
|
77
|
+
*
|
|
78
|
+
* @returns The enhanced application store with additional features and methods.
|
|
79
|
+
*/
|
|
80
|
+
export declare function withAppFeatures(): import("@ngrx/signals").SignalStoreFeature<import("@ngrx/signals/src/signal-store-models").EmptyFeatureResult, {
|
|
81
|
+
state: Omit<Omit<Omit<CCAppState, "filters" | "sources" | "customizationJson">, "update" | "initialize" | "initializeWithAppName" | "getWebServiceByType" | "getLabels" | "getQueryByName" | "getQueryByIndex" | "getDefaultQuery" | "allowEmptySearch" | "getNamedCustomizationJson" | "getColumnAlias">, "getAggregationIcon" | "getAggregationItemsCustomization" | "getAggregationCustomization" | "getAuthorizedFilters">;
|
|
82
|
+
signals: Omit<Omit<Omit<{}, "filters" | "sources" | "customizationJson"> & {
|
|
83
|
+
customizationJson: import("@angular/core").Signal<CJson>;
|
|
84
|
+
sources: import("@angular/core").Signal<import("../models/custom-json").CSources | {
|
|
85
|
+
routes?: [];
|
|
86
|
+
filters?: CFilter[];
|
|
87
|
+
}>;
|
|
88
|
+
filters: import("@angular/core").Signal<CFilter[]>;
|
|
89
|
+
}, "update" | "initialize" | "initializeWithAppName" | "getWebServiceByType" | "getLabels" | "getQueryByName" | "getQueryByIndex" | "getDefaultQuery" | "allowEmptySearch" | "getNamedCustomizationJson" | "getColumnAlias">, "getAggregationIcon" | "getAggregationItemsCustomization" | "getAggregationCustomization" | "getAuthorizedFilters">;
|
|
90
|
+
methods: Omit<Omit<Omit<{}, "filters" | "sources" | "customizationJson">, "update" | "initialize" | "initializeWithAppName" | "getWebServiceByType" | "getLabels" | "getQueryByName" | "getQueryByIndex" | "getDefaultQuery" | "allowEmptySearch" | "getNamedCustomizationJson" | "getColumnAlias"> & {
|
|
91
|
+
/**
|
|
92
|
+
* Initializes the application state by fetching the app data from the appService
|
|
93
|
+
* and updating the store with the retrieved data.
|
|
94
|
+
*
|
|
95
|
+
* @returns A promise that resolves when the app data has been fetched and the store has been updated.
|
|
96
|
+
*/
|
|
97
|
+
initialize(): Promise<void>;
|
|
98
|
+
/**
|
|
99
|
+
* Initializes the application state with the provided app name.
|
|
100
|
+
*
|
|
101
|
+
* @param appName - The name of the application to fetch the configuration for.
|
|
102
|
+
*
|
|
103
|
+
* @returns A promise that resolves when the app data has been fetched and the store has been updated.
|
|
104
|
+
*/
|
|
105
|
+
initializeWithAppName(appName: string): Promise<void>;
|
|
106
|
+
/**
|
|
107
|
+
* Updates the application state with the provided CCApp object.
|
|
108
|
+
*
|
|
109
|
+
* @param {CCApp} app - The application object containing the new state values.
|
|
110
|
+
*/
|
|
111
|
+
update(app: CCApp): void;
|
|
112
|
+
/**
|
|
113
|
+
* Returns the web service by type name
|
|
114
|
+
*
|
|
115
|
+
* @param type Web service type name
|
|
116
|
+
* @returns A {@link CCWebService} object or undefined if not found
|
|
117
|
+
*/
|
|
118
|
+
getWebServiceByType(type: CCWebService["webServiceType"]): CCWebService | undefined;
|
|
119
|
+
/**
|
|
120
|
+
* Retrieves the labels from the web service of type 'Labels'.
|
|
121
|
+
*
|
|
122
|
+
* @returns An object containing the private and public labels.
|
|
123
|
+
* If the labels are not found, returns an object with empty strings for both fields.
|
|
124
|
+
*/
|
|
125
|
+
getLabels(): {
|
|
126
|
+
private: string;
|
|
127
|
+
public: string;
|
|
128
|
+
};
|
|
129
|
+
/**
|
|
130
|
+
* Retrieves a query by its name from the store.
|
|
131
|
+
*
|
|
132
|
+
* @param name - The name of the query to retrieve.
|
|
133
|
+
* @returns The query object if found, otherwise `undefined`.
|
|
134
|
+
*/
|
|
135
|
+
getQueryByName(name: string): CCQuery | undefined;
|
|
136
|
+
/**
|
|
137
|
+
* Retrieves a query by its index from the store.
|
|
138
|
+
*
|
|
139
|
+
* @param index - The index of the query to retrieve.
|
|
140
|
+
* @returns The query at the specified index, or `undefined` if the index is out of bounds.
|
|
141
|
+
*/
|
|
142
|
+
getQueryByIndex(index: number): CCQuery | undefined;
|
|
143
|
+
/**
|
|
144
|
+
* Retrieves the default query.
|
|
145
|
+
* The default query is always the first query in the list of queries.
|
|
146
|
+
*
|
|
147
|
+
* @returns {CCQuery | undefined} The default query if it exists, otherwise undefined.
|
|
148
|
+
*/
|
|
149
|
+
getDefaultQuery(): CCQuery | undefined;
|
|
150
|
+
/**
|
|
151
|
+
* Retrieves the allowEmptySearch property for a specific query.
|
|
152
|
+
* @param queryName - The name of the query for which to retrieve allow empty serach property.
|
|
153
|
+
* @returns The allowEmptySearch property for the specified query, or false if not found.
|
|
154
|
+
*/
|
|
155
|
+
allowEmptySearch(queryName: string): boolean;
|
|
156
|
+
/**
|
|
157
|
+
* Retrieves the customization json by name
|
|
158
|
+
* @param name - The name of the customization json
|
|
159
|
+
* @returns The customization json object or undefined if not found
|
|
160
|
+
*/
|
|
161
|
+
getNamedCustomizationJson(name: string): any | undefined;
|
|
162
|
+
/**
|
|
163
|
+
* Retrieves the alias for a given column name from the application's state.
|
|
164
|
+
* If the column has aliases defined, the first alias is returned. Otherwise,
|
|
165
|
+
* the original column name is returned.
|
|
166
|
+
*
|
|
167
|
+
* @param column - The name of the column for which to retrieve the alias.
|
|
168
|
+
* @returns The alias of the column if it exists, otherwise the original column name.
|
|
169
|
+
*/
|
|
170
|
+
getColumnAlias(column: string): string;
|
|
171
|
+
}, "getAggregationIcon" | "getAggregationItemsCustomization" | "getAggregationCustomization" | "getAuthorizedFilters">;
|
|
172
|
+
} & import("@ngrx/signals/src/signal-store-models").EmptyFeatureResult & {
|
|
173
|
+
methods: {
|
|
174
|
+
/**
|
|
175
|
+
* Retrieves the icon associated with a given column's aggregation.
|
|
176
|
+
*
|
|
177
|
+
* This method searches through the store's filters to find an aggregation
|
|
178
|
+
* that matches the specified column. If a matching aggregation is found,
|
|
179
|
+
* its associated icon is returned. If no matching aggregation is found in
|
|
180
|
+
* the store's filters, the method falls back to searching in the
|
|
181
|
+
* customizationJson's filters.
|
|
182
|
+
*
|
|
183
|
+
* @param column - The name of the column for which to retrieve the aggregation icon.
|
|
184
|
+
* @returns The icon associated with the specified column's aggregation, or undefined if no matching aggregation is found.
|
|
185
|
+
*/
|
|
186
|
+
getAggregationIcon(column: string): string | undefined;
|
|
187
|
+
/**
|
|
188
|
+
* Retrieves the customization items for a given column from the store's filters.
|
|
189
|
+
* If no items are found in the store's filters, it falls back to the customization JSON.
|
|
190
|
+
*
|
|
191
|
+
* @param column - The name of the column for which to retrieve customization items.
|
|
192
|
+
* @returns An array of `CFilterItem` objects if found, otherwise `undefined`.
|
|
193
|
+
*/
|
|
194
|
+
getAggregationItemsCustomization(column: string): CFilterItem[] | undefined;
|
|
195
|
+
/**
|
|
196
|
+
* Retrieves the customization for a specific aggregation column.
|
|
197
|
+
* @param column - The column name for which to retrieve the customization.
|
|
198
|
+
* @returns The customization object for the specified column, or undefined if not found.
|
|
199
|
+
*/
|
|
200
|
+
getAggregationCustomization(column: string): CFilter | undefined;
|
|
201
|
+
/**
|
|
202
|
+
* Retrieves the sorted aggregations based on the provided query name.
|
|
203
|
+
* @param queryName - The name of the query.
|
|
204
|
+
* @returns An array of sorted aggregations.
|
|
205
|
+
*/
|
|
206
|
+
getAuthorizedFilters(route: ActivatedRoute): Aggregation[];
|
|
207
|
+
};
|
|
208
|
+
}>;
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { SafeHtml } from '@angular/platform-browser';
|
|
2
|
+
export type Extract = {
|
|
3
|
+
id: string;
|
|
4
|
+
text: SafeHtml;
|
|
5
|
+
startIndex: number;
|
|
6
|
+
relevanceIndex: number;
|
|
7
|
+
textIndex: number;
|
|
8
|
+
};
|
|
9
|
+
export type ApplicationState = {
|
|
10
|
+
assistantReady: boolean;
|
|
11
|
+
ready: boolean;
|
|
12
|
+
extracts: Map<string, Extract[]>;
|
|
13
|
+
hasLabelsAccess: boolean;
|
|
14
|
+
};
|
|
15
|
+
export declare const ApplicationStore: import("@angular/core").Type<{
|
|
16
|
+
assistantReady: import("@angular/core").Signal<boolean>;
|
|
17
|
+
ready: import("@angular/core").Signal<boolean>;
|
|
18
|
+
extracts: import("@angular/core").Signal<Map<string, Extract[]>>;
|
|
19
|
+
hasLabelsAccess: import("@angular/core").Signal<boolean>;
|
|
20
|
+
extractsCount: import("@angular/core").Signal<number>;
|
|
21
|
+
updateAssistantReady: () => void;
|
|
22
|
+
updateReadyState: (value?: boolean) => void;
|
|
23
|
+
updateHasLabelsAccess: (value?: boolean) => void;
|
|
24
|
+
updateExtracts: (id: string, extracts: Extract[]) => void;
|
|
25
|
+
getExtracts: (id: string) => Extract[] | undefined;
|
|
26
|
+
} & import("@ngrx/signals").StateSignal<{
|
|
27
|
+
assistantReady: boolean;
|
|
28
|
+
ready: boolean;
|
|
29
|
+
extracts: Map<string, Extract[]>;
|
|
30
|
+
hasLabelsAccess: boolean;
|
|
31
|
+
}>>;
|
|
32
|
+
/**
|
|
33
|
+
* Enhances the application store with additional features.
|
|
34
|
+
*
|
|
35
|
+
* This function integrates several features into the application store, including state management,
|
|
36
|
+
* computed properties, and various methods for updating and retrieving application state.
|
|
37
|
+
*
|
|
38
|
+
* Features included:
|
|
39
|
+
* - State initialization with `intialState`.
|
|
40
|
+
* - Methods for updating the application state:
|
|
41
|
+
* - `updateAssistantReady`: Marks the assistant as ready.
|
|
42
|
+
* - `updateReadyState`: Sets the application store's ready state to true.
|
|
43
|
+
*
|
|
44
|
+
* @returns A configured signal store feature with state, computed properties, and methods.
|
|
45
|
+
*/
|
|
46
|
+
export declare function withApplicationFeatures(): import("@ngrx/signals").SignalStoreFeature<import("@ngrx/signals/src/signal-store-models").EmptyFeatureResult, {
|
|
47
|
+
state: Omit<ApplicationState, "updateAssistantReady" | "updateReadyState" | "updateHasLabelsAccess">;
|
|
48
|
+
signals: Omit<{}, "updateAssistantReady" | "updateReadyState" | "updateHasLabelsAccess">;
|
|
49
|
+
methods: Omit<{}, "updateAssistantReady" | "updateReadyState" | "updateHasLabelsAccess">;
|
|
50
|
+
} & import("@ngrx/signals/src/signal-store-models").EmptyFeatureResult & {
|
|
51
|
+
methods: {
|
|
52
|
+
/**
|
|
53
|
+
* Updates the application state to indicate that the assistant is ready.
|
|
54
|
+
* This function patches the current state by setting the `assistantReady` property to `true`.
|
|
55
|
+
*/
|
|
56
|
+
updateAssistantReady(): void;
|
|
57
|
+
/**
|
|
58
|
+
* Updates the ready state of the application store to true.
|
|
59
|
+
* This function patches the current state of the store by setting the `ready` property to `true`.
|
|
60
|
+
*/
|
|
61
|
+
updateReadyState(value?: boolean): void;
|
|
62
|
+
/**
|
|
63
|
+
* Updates the `hasLabelsAccess` property in the application store state.
|
|
64
|
+
*
|
|
65
|
+
* @param value - A boolean value indicating whether the user has access to labels. Defaults to `true`.
|
|
66
|
+
*/
|
|
67
|
+
updateHasLabelsAccess(value?: boolean): void;
|
|
68
|
+
};
|
|
69
|
+
}>;
|
|
70
|
+
/**
|
|
71
|
+
* Provides features related to extracts within the application store.
|
|
72
|
+
*
|
|
73
|
+
* This function integrates state management, computed properties, and methods
|
|
74
|
+
* for handling extracts in the application store.
|
|
75
|
+
*
|
|
76
|
+
* Features:
|
|
77
|
+
* - State management for extracts.
|
|
78
|
+
* - Computed property to get the count of extracts.
|
|
79
|
+
* - Methods to update and retrieve extracts.
|
|
80
|
+
*
|
|
81
|
+
* @returns A configured signal store feature with state, computed properties, and methods for extracts.
|
|
82
|
+
*/
|
|
83
|
+
export declare function withExtractsFeatures(): import("@ngrx/signals").SignalStoreFeature<import("@ngrx/signals/src/signal-store-models").EmptyFeatureResult, {
|
|
84
|
+
state: Omit<Omit<ApplicationState, "extractsCount">, "updateExtracts" | "getExtracts">;
|
|
85
|
+
signals: Omit<Omit<{}, "extractsCount"> & {
|
|
86
|
+
extractsCount: import("@angular/core").Signal<number>;
|
|
87
|
+
}, "updateExtracts" | "getExtracts">;
|
|
88
|
+
methods: Omit<Omit<{}, "extractsCount">, "updateExtracts" | "getExtracts">;
|
|
89
|
+
} & import("@ngrx/signals/src/signal-store-models").EmptyFeatureResult & {
|
|
90
|
+
methods: {
|
|
91
|
+
/**
|
|
92
|
+
* Updates the extracts for a given ID in the application store.
|
|
93
|
+
*
|
|
94
|
+
* @param id - The unique identifier for the extracts to be updated.
|
|
95
|
+
* @param extracts - An array of Extract objects to be associated with the given ID.
|
|
96
|
+
*/
|
|
97
|
+
updateExtracts(id: string, extracts: Extract[]): void;
|
|
98
|
+
/**
|
|
99
|
+
* Retrieves extracts from the store based on the provided ID.
|
|
100
|
+
*
|
|
101
|
+
* @param id - The unique identifier for the extracts to retrieve.
|
|
102
|
+
* @returns The extracts associated with the given ID.
|
|
103
|
+
*/
|
|
104
|
+
getExtracts(id: string): Extract[] | undefined;
|
|
105
|
+
};
|
|
106
|
+
}>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export * from "./aggregations.store";
|
|
2
|
+
export * from "./app.store";
|
|
3
|
+
export * from "./application.store";
|
|
4
|
+
export * from "./principal.store";
|
|
5
|
+
export * from "./query-params.store";
|
|
6
|
+
export * from "./selection.store";
|
|
7
|
+
export * from "./theme.store";
|
|
8
|
+
export * from "./user-settings.store";
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { Principal } from "@sinequa/atomic";
|
|
2
|
+
type PrincipalState = {
|
|
3
|
+
principal: Principal;
|
|
4
|
+
userOverrideActive: boolean;
|
|
5
|
+
};
|
|
6
|
+
export declare const PrincipalStore: import("@angular/core").Type<{
|
|
7
|
+
userOverrideActive: import("@angular/core").Signal<boolean>;
|
|
8
|
+
principal: import("@ngrx/signals/src/deep-signal").DeepSignal<Principal>;
|
|
9
|
+
allowUserOverride: import("@angular/core").Signal<boolean>;
|
|
10
|
+
isOverridingUser: import("@angular/core").Signal<boolean>;
|
|
11
|
+
initialize: () => Promise<void>;
|
|
12
|
+
} & import("@ngrx/signals").StateSignal<{
|
|
13
|
+
userOverrideActive: boolean;
|
|
14
|
+
principal: Principal;
|
|
15
|
+
}>>;
|
|
16
|
+
/**
|
|
17
|
+
* Enhances the store with principal-related features.
|
|
18
|
+
*
|
|
19
|
+
* This function integrates state, methods, and computed properties related to the principal.
|
|
20
|
+
*
|
|
21
|
+
* @returns A feature that can be added to a signal store.
|
|
22
|
+
*
|
|
23
|
+
* @feature
|
|
24
|
+
* - State:
|
|
25
|
+
* - `principal`: An object representing the principal.
|
|
26
|
+
* - `userOverrideActive`: A boolean indicating if user override is active.
|
|
27
|
+
*
|
|
28
|
+
* - Methods:
|
|
29
|
+
* - `initialize()`: Initializes the principal state by fetching the principal data from the `PrincipalService`.
|
|
30
|
+
*
|
|
31
|
+
* - Computed Properties:
|
|
32
|
+
* - `allowUserOverride`: A computed boolean indicating if user override is allowed based on the principal's administrator status and the `userOverrideActive` state.
|
|
33
|
+
* - `isOverridingUser`: A computed boolean indicating if the user override is currently active.
|
|
34
|
+
*/
|
|
35
|
+
export declare function withPrincipalFeatures(): import("@ngrx/signals").SignalStoreFeature<import("@ngrx/signals/src/signal-store-models").EmptyFeatureResult, {
|
|
36
|
+
state: Omit<Omit<PrincipalState, "initialize">, "allowUserOverride" | "isOverridingUser">;
|
|
37
|
+
signals: Omit<Omit<{}, "initialize">, "allowUserOverride" | "isOverridingUser">;
|
|
38
|
+
methods: Omit<Omit<{}, "initialize"> & {
|
|
39
|
+
/**
|
|
40
|
+
* Initializes the principal store by fetching the principal data from the principal service.
|
|
41
|
+
* It patches the store with the fetched principal data and a user override active flag from the global configuration.
|
|
42
|
+
*
|
|
43
|
+
* @returns A promise that resolves when the principal data has been fetched and the store has been patched.
|
|
44
|
+
*/
|
|
45
|
+
initialize(): Promise<void>;
|
|
46
|
+
}, "allowUserOverride" | "isOverridingUser">;
|
|
47
|
+
} & import("@ngrx/signals/src/signal-store-models").EmptyFeatureResult & {
|
|
48
|
+
signals: {
|
|
49
|
+
allowUserOverride: import("@angular/core").Signal<boolean>;
|
|
50
|
+
isOverridingUser: import("@angular/core").Signal<boolean>;
|
|
51
|
+
};
|
|
52
|
+
}>;
|
|
53
|
+
export {};
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
import { LegacyFilter, Query, SpellingCorrectionMode } from '@sinequa/atomic';
|
|
2
|
+
type QueryParamsState = Partial<Omit<Query, "filters">> & {
|
|
3
|
+
path?: string;
|
|
4
|
+
filters?: LegacyFilter[];
|
|
5
|
+
id?: string;
|
|
6
|
+
};
|
|
7
|
+
export declare const QueryParamsStore: import("@angular/core").Type<{
|
|
8
|
+
id?: import("@angular/core").Signal<string | undefined> | undefined;
|
|
9
|
+
text?: import("@angular/core").Signal<string | undefined> | undefined;
|
|
10
|
+
filters?: import("@angular/core").Signal<LegacyFilter[] | undefined> | undefined;
|
|
11
|
+
name?: import("@angular/core").Signal<string | undefined> | undefined;
|
|
12
|
+
action?: import("@angular/core").Signal<"" | "open" | "search" | "aggregate" | undefined> | undefined;
|
|
13
|
+
select?: import("@angular/core").Signal<import("@sinequa/atomic").Select[] | undefined> | undefined;
|
|
14
|
+
open?: import("@angular/core").Signal<import("@sinequa/atomic").Open[] | undefined> | undefined;
|
|
15
|
+
page?: import("@angular/core").Signal<number | undefined> | undefined;
|
|
16
|
+
pageSize?: import("@angular/core").Signal<number | undefined> | undefined;
|
|
17
|
+
tab?: import("@angular/core").Signal<string | undefined> | undefined;
|
|
18
|
+
scope?: import("@angular/core").Signal<string | undefined> | undefined;
|
|
19
|
+
sort?: import("@angular/core").Signal<string | undefined> | undefined;
|
|
20
|
+
basket?: import("@angular/core").Signal<string | undefined> | undefined;
|
|
21
|
+
isFirstPage?: import("@angular/core").Signal<boolean | undefined> | undefined;
|
|
22
|
+
strictRefine?: import("@angular/core").Signal<boolean | undefined> | undefined;
|
|
23
|
+
globalRelevance?: import("@angular/core").Signal<number | undefined> | undefined;
|
|
24
|
+
questionLanguage?: import("@angular/core").Signal<string | undefined> | undefined;
|
|
25
|
+
questionDefaultLanguage?: import("@angular/core").Signal<string | undefined> | undefined;
|
|
26
|
+
spellingCorrectionMode?: import("@angular/core").Signal<SpellingCorrectionMode | undefined> | undefined;
|
|
27
|
+
spellingCorrectionFilter?: import("@angular/core").Signal<string | undefined> | undefined;
|
|
28
|
+
documentWeight?: import("@angular/core").Signal<string | undefined> | undefined;
|
|
29
|
+
textPartWeights?: import("@angular/core").Signal<string | undefined> | undefined;
|
|
30
|
+
relevanceTransforms?: import("@angular/core").Signal<string | undefined> | undefined;
|
|
31
|
+
removeDuplicates?: import("@angular/core").Signal<boolean | undefined> | undefined;
|
|
32
|
+
queryId?: import("@angular/core").Signal<string | undefined> | undefined;
|
|
33
|
+
aggregations?: import("@angular/core").Signal<Record<string, import("@sinequa/atomic").AggregationOptions> | string[] | undefined> | undefined;
|
|
34
|
+
orderBy?: import("@angular/core").Signal<string | undefined> | undefined;
|
|
35
|
+
groupBy?: import("@angular/core").Signal<string | undefined> | undefined;
|
|
36
|
+
neuralSearch?: import("@angular/core").Signal<boolean | undefined> | undefined;
|
|
37
|
+
path?: import("@angular/core").Signal<string | undefined> | undefined;
|
|
38
|
+
setFromUrl: (url: string) => void;
|
|
39
|
+
addFilter: (filter: LegacyFilter) => void;
|
|
40
|
+
updateFilter: (filter: LegacyFilter) => void;
|
|
41
|
+
removeFilter: (field?: string) => void;
|
|
42
|
+
removeFilterByName: (name?: string) => void;
|
|
43
|
+
clearFilters: () => void;
|
|
44
|
+
patch: (params: Partial<QueryParamsState>) => void;
|
|
45
|
+
getFilter: (fieldOrName?: string) => Partial<LegacyFilter & {
|
|
46
|
+
count: number;
|
|
47
|
+
}> | null;
|
|
48
|
+
getQuery: () => Query;
|
|
49
|
+
} & import("@ngrx/signals").StateSignal<{
|
|
50
|
+
id?: string | undefined;
|
|
51
|
+
text?: string | undefined;
|
|
52
|
+
filters?: LegacyFilter[] | undefined;
|
|
53
|
+
name?: string | undefined;
|
|
54
|
+
action?: ("" | "search" | "open" | "aggregate") | undefined;
|
|
55
|
+
select?: import("@sinequa/atomic").Select[] | undefined;
|
|
56
|
+
open?: import("@sinequa/atomic").Open[] | undefined;
|
|
57
|
+
page?: number | undefined;
|
|
58
|
+
pageSize?: number | undefined;
|
|
59
|
+
tab?: string | undefined;
|
|
60
|
+
scope?: string | undefined;
|
|
61
|
+
sort?: string | undefined;
|
|
62
|
+
basket?: string | undefined;
|
|
63
|
+
isFirstPage?: boolean | undefined;
|
|
64
|
+
strictRefine?: boolean | undefined;
|
|
65
|
+
globalRelevance?: number | undefined;
|
|
66
|
+
questionLanguage?: string | undefined;
|
|
67
|
+
questionDefaultLanguage?: string | undefined;
|
|
68
|
+
spellingCorrectionMode?: SpellingCorrectionMode | undefined;
|
|
69
|
+
spellingCorrectionFilter?: string | undefined;
|
|
70
|
+
documentWeight?: string | undefined;
|
|
71
|
+
textPartWeights?: string | undefined;
|
|
72
|
+
relevanceTransforms?: string | undefined;
|
|
73
|
+
removeDuplicates?: boolean | undefined;
|
|
74
|
+
queryId?: string | undefined;
|
|
75
|
+
aggregations?: (Record<string, import("@sinequa/atomic").AggregationOptions> | string[]) | undefined;
|
|
76
|
+
orderBy?: string | undefined;
|
|
77
|
+
groupBy?: string | undefined;
|
|
78
|
+
neuralSearch?: boolean | undefined;
|
|
79
|
+
path?: string | undefined;
|
|
80
|
+
}>>;
|
|
81
|
+
export declare function withQueryParamsFeatures(): import("@ngrx/signals").SignalStoreFeature<import("@ngrx/signals/src/signal-store-models").EmptyFeatureResult, {
|
|
82
|
+
state: Omit<Partial<Omit<Query, "filters">> & {
|
|
83
|
+
path?: string;
|
|
84
|
+
filters?: LegacyFilter[];
|
|
85
|
+
id?: string;
|
|
86
|
+
}, "setFromUrl" | "addFilter" | "updateFilter" | "removeFilter" | "removeFilterByName" | "clearFilters" | "patch" | "getFilter" | "getQuery">;
|
|
87
|
+
signals: Omit<{}, "setFromUrl" | "addFilter" | "updateFilter" | "removeFilter" | "removeFilterByName" | "clearFilters" | "patch" | "getFilter" | "getQuery">;
|
|
88
|
+
methods: Omit<{}, "setFromUrl" | "addFilter" | "updateFilter" | "removeFilter" | "removeFilterByName" | "clearFilters" | "patch" | "getFilter" | "getQuery">;
|
|
89
|
+
} & import("@ngrx/signals/src/signal-store-models").EmptyFeatureResult & {
|
|
90
|
+
methods: {
|
|
91
|
+
/**
|
|
92
|
+
* Sets the state from the given URL by extracting query parameters and updating the store.
|
|
93
|
+
*
|
|
94
|
+
* @param url - The URL containing query parameters to set the state from.
|
|
95
|
+
*
|
|
96
|
+
* The function performs the following steps:
|
|
97
|
+
* 1. Extracts the path from the URL.
|
|
98
|
+
* 2. Parses the query parameters from the URL.
|
|
99
|
+
* 3. Decodes and parses the filters from the query parameters.
|
|
100
|
+
* 4. Converts the page parameter to a number if it exists.
|
|
101
|
+
* 5. Updates the store state with the extracted and parsed values.
|
|
102
|
+
*/
|
|
103
|
+
setFromUrl(url: string): void;
|
|
104
|
+
/**
|
|
105
|
+
* Adds a filter to the store's state.
|
|
106
|
+
*
|
|
107
|
+
* @param filter - The filter to be added to the state.
|
|
108
|
+
*
|
|
109
|
+
* The function calls the `updateFilter` method to add the filter to the state.
|
|
110
|
+
*/
|
|
111
|
+
addFilter(filter: LegacyFilter): void;
|
|
112
|
+
/**
|
|
113
|
+
* Updates the filter in the store's state.
|
|
114
|
+
*
|
|
115
|
+
* @param filter - The filter to be updated. If the filter is `undefined`, the state remains unchanged.
|
|
116
|
+
*
|
|
117
|
+
* The function performs the following operations:
|
|
118
|
+
* - Adds the filter to the state if it doesn't already exist and has values.
|
|
119
|
+
* - Removes the filter if the 'between' operator is selected but no values are provided.
|
|
120
|
+
* - Removes the filter if no values are selected and the operator is not 'between'.
|
|
121
|
+
* - Updates the filter values if the filter already exists.
|
|
122
|
+
*
|
|
123
|
+
* @remarks
|
|
124
|
+
* - If the filter is `undefined`, the state remains unchanged.
|
|
125
|
+
* - If the filter's operator is 'between' and both `start` and `end` are `undefined`, the filter is removed.
|
|
126
|
+
* - If the filter's operator is not 'between' and `filters`, `value`, and `values` are all `undefined`, the filter is removed.
|
|
127
|
+
* - If the filter already exists, its values are updated.
|
|
128
|
+
*/
|
|
129
|
+
updateFilter(filter: LegacyFilter): void;
|
|
130
|
+
/**
|
|
131
|
+
* Removes a filter from the store based on the specified field.
|
|
132
|
+
*
|
|
133
|
+
* @param field - The field of the filter to be removed.
|
|
134
|
+
*/
|
|
135
|
+
removeFilter(field?: string): void;
|
|
136
|
+
/**
|
|
137
|
+
* Removes a filter from the state by its name.
|
|
138
|
+
*
|
|
139
|
+
* @param name - The name of the filter to be removed.
|
|
140
|
+
*/
|
|
141
|
+
removeFilterByName(name?: string): void;
|
|
142
|
+
/**
|
|
143
|
+
* Clears all filters from the state.
|
|
144
|
+
*
|
|
145
|
+
* This method updates the state by setting the `filters` property to an empty array.
|
|
146
|
+
* It uses the `patchState` function to apply the state change.
|
|
147
|
+
*/
|
|
148
|
+
clearFilters(): void;
|
|
149
|
+
/**
|
|
150
|
+
* Updates the current state with the provided query parameters.
|
|
151
|
+
*
|
|
152
|
+
* @param params - A partial object containing the query parameters to be updated.
|
|
153
|
+
*/
|
|
154
|
+
patch(params: Partial<QueryParamsState>): void;
|
|
155
|
+
/**
|
|
156
|
+
* Retrieves a filter object based on the provided field or name.
|
|
157
|
+
*
|
|
158
|
+
* @param {string} fieldOrName - The field or name to search for in the filters.
|
|
159
|
+
* @returns {Partial<LegacyFilter & {count: number}> | null} - The filter object with an additional count property, or null if not found.
|
|
160
|
+
*
|
|
161
|
+
* The method performs the following steps:
|
|
162
|
+
* 1. Checks if the `fieldOrName` parameter is provided. If not, returns null.
|
|
163
|
+
* 2. Searches for a filter with a matching field in the store's filters.
|
|
164
|
+
* 3. If no filter is found by field, searches for a filter with a matching name.
|
|
165
|
+
* 4. If a filter is found and has a `value` property, returns the filter with a count of 1.
|
|
166
|
+
* 5. If a filter is found and does not have an array of filters, returns the filter with a count of 1.
|
|
167
|
+
* 6. If a filter is found and has a `values` property, returns the filter with the count set to the length of the `values` array.
|
|
168
|
+
* 7. If a filter is found and has an array of filters, returns the filter with the count set to the length of the `filters` array.
|
|
169
|
+
* 8. If none of the above conditions are met, returns the filter with a count of 0.
|
|
170
|
+
*/
|
|
171
|
+
getFilter(fieldOrName?: string): Partial<LegacyFilter & {
|
|
172
|
+
count: number;
|
|
173
|
+
}> | null;
|
|
174
|
+
/**
|
|
175
|
+
* Constructs and returns a query object based on the current state of the store.
|
|
176
|
+
*
|
|
177
|
+
* This method retrieves various parameters from the store's state, such as filters, sort order, tab, query text, query name, and spelling correction mode.
|
|
178
|
+
* It processes the filters to separate out "concepts" filters and incorporates them into the query text.
|
|
179
|
+
* The remaining filters are combined appropriately.
|
|
180
|
+
* Finally, it builds and returns the query object using the processed parameters.
|
|
181
|
+
*
|
|
182
|
+
* @returns Query The constructed query object.
|
|
183
|
+
*/
|
|
184
|
+
getQuery(): Query;
|
|
185
|
+
};
|
|
186
|
+
}>;
|
|
187
|
+
export {};
|