@daffodil/search-product 0.94.1 → 0.95.0
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/fesm2022/daffodil-search-product-driver-in-memory.mjs +112 -96
- package/fesm2022/daffodil-search-product-driver-in-memory.mjs.map +1 -1
- package/fesm2022/daffodil-search-product-driver-magento-2.4.7.mjs +337 -0
- package/fesm2022/daffodil-search-product-driver-magento-2.4.7.mjs.map +1 -0
- package/fesm2022/daffodil-search-product-driver-magento-auto.mjs +7 -0
- package/fesm2022/daffodil-search-product-driver-magento-auto.mjs.map +1 -0
- package/fesm2022/daffodil-search-product-driver-testing.mjs +54 -36
- package/fesm2022/daffodil-search-product-driver-testing.mjs.map +1 -1
- package/fesm2022/daffodil-search-product-driver.mjs +0 -4
- package/fesm2022/daffodil-search-product-routing.mjs +141 -71
- package/fesm2022/daffodil-search-product-routing.mjs.map +1 -1
- package/fesm2022/daffodil-search-product-state-testing.mjs +97 -55
- package/fesm2022/daffodil-search-product-state-testing.mjs.map +1 -1
- package/fesm2022/daffodil-search-product-state.mjs +477 -391
- package/fesm2022/daffodil-search-product-state.mjs.map +1 -1
- package/fesm2022/daffodil-search-product-testing.mjs +87 -52
- package/fesm2022/daffodil-search-product-testing.mjs.map +1 -1
- package/fesm2022/daffodil-search-product.mjs +6 -17
- package/fesm2022/daffodil-search-product.mjs.map +1 -1
- package/package.json +1 -1
- package/types/daffodil-search-product-driver-in-memory.d.ts +14 -11
- package/types/daffodil-search-product-driver-magento-2.4.7.d.ts +112 -0
- package/types/daffodil-search-product-driver-magento-auto.d.ts +1 -0
- package/types/daffodil-search-product-driver-testing.d.ts +14 -11
- package/types/daffodil-search-product-driver.d.ts +13 -19
- package/types/daffodil-search-product-routing.d.ts +17 -11
- package/types/daffodil-search-product-state-testing.d.ts +25 -21
- package/types/daffodil-search-product-state.d.ts +144 -152
- package/types/daffodil-search-product-testing.d.ts +21 -18
- package/types/daffodil-search-product.d.ts +6 -12
- package/fesm2022/daffodil-search-product-driver-magento.mjs +0 -333
- package/fesm2022/daffodil-search-product-driver-magento.mjs.map +0 -1
- package/fesm2022/daffodil-search-product-driver.mjs.map +0 -1
- package/types/daffodil-search-product-driver-magento.d.ts +0 -102
|
@@ -1,25 +1,19 @@
|
|
|
1
|
-
import { Observable } from
|
|
2
|
-
import { DaffSearchResultCollection } from
|
|
3
|
-
import { DaffSearchDriverOptions, DaffSearchDriverResponse
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
interface
|
|
1
|
+
import { Observable } from "rxjs";
|
|
2
|
+
import { DaffSearchResultCollection } from "@daffodil/search";
|
|
3
|
+
import { DaffSearchDriverKindedInterface, DaffSearchDriverOptions, DaffSearchDriverResponse } from "@daffodil/search/driver";
|
|
4
|
+
import { DAFF_SEARCH_PRODUCT_RESULT_KIND, DaffSearchProductResult } from "@daffodil/search-product";
|
|
5
|
+
import { DaffCollectionMetadata, DaffCollectionRequest } from "@daffodil/core";
|
|
6
|
+
export interface DaffSearchProductDriverOptions extends DaffSearchDriverOptions, DaffCollectionRequest {}
|
|
7
|
+
export interface DaffSearchProductDriverResponse<T extends DaffSearchProductResult = DaffSearchProductResult> extends DaffSearchDriverResponse<T> {
|
|
8
|
+
metadata: DaffCollectionMetadata;
|
|
8
9
|
}
|
|
9
|
-
|
|
10
|
-
interface DaffSearchProductDriverResponse<T extends DaffSearchProductResult = DaffSearchProductResult> extends DaffSearchDriverResponse<T> {
|
|
11
|
-
metadata: DaffCollectionMetadata;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
10
|
/**
|
|
15
11
|
* A driver interface for searching products.
|
|
16
12
|
*
|
|
17
13
|
* @inheritdoc
|
|
18
14
|
*/
|
|
19
|
-
interface DaffSearchProductDriverInterface<T extends DaffSearchProductResult = DaffSearchProductResult> extends DaffSearchDriverKindedInterface<T> {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
export type { DaffSearchProductDriverInterface, DaffSearchProductDriverOptions, DaffSearchProductDriverResponse };
|
|
15
|
+
export interface DaffSearchProductDriverInterface<T extends DaffSearchProductResult = DaffSearchProductResult> extends DaffSearchDriverKindedInterface<T> {
|
|
16
|
+
readonly kind: typeof DAFF_SEARCH_PRODUCT_RESULT_KIND;
|
|
17
|
+
search(query: string, options?: DaffSearchProductDriverOptions): Observable<DaffSearchProductDriverResponse<T>>;
|
|
18
|
+
incremental(query: string, options?: DaffSearchDriverOptions): Observable<DaffSearchResultCollection<T>>;
|
|
19
|
+
}
|
|
@@ -1,12 +1,18 @@
|
|
|
1
|
-
import * as i0 from
|
|
2
|
-
import
|
|
3
|
-
import * as
|
|
4
|
-
import * as
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import { EnvironmentProviders } from "@angular/core";
|
|
3
|
+
import * as i1 from "@daffodil/product/routing";
|
|
4
|
+
import * as i2 from "@daffodil/search/routing";
|
|
5
|
+
import * as i3 from "@ngrx/effects";
|
|
6
|
+
/**
|
|
7
|
+
* @deprecated in favor of {@link provideDaffSearchProductRouting} Deprecated in version 0.95.0. Will be removed in version 0.98.0.
|
|
8
|
+
*/
|
|
9
|
+
export declare class DaffSearchProductRoutingModule {
|
|
10
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DaffSearchProductRoutingModule, never>;
|
|
11
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<DaffSearchProductRoutingModule, never, [typeof i1.DaffProductRoutingModule, typeof i2.DaffSearchRoutingModule, typeof i3.EffectsFeatureModule], never>;
|
|
12
|
+
static ɵinj: i0.ɵɵInjectorDeclaration<DaffSearchProductRoutingModule>;
|
|
10
13
|
}
|
|
11
|
-
|
|
12
|
-
|
|
14
|
+
/**
|
|
15
|
+
* Provides the `@daffodil/search-product/routing` effects and search routing options builder.
|
|
16
|
+
* Includes {@link provideDaffProductRouting} and {@link provideDaffSearchRouting}.
|
|
17
|
+
*/
|
|
18
|
+
export declare const provideDaffSearchProductRouting: () => EnvironmentProviders;
|
|
@@ -1,31 +1,35 @@
|
|
|
1
|
-
import { Action } from
|
|
2
|
-
import { BehaviorSubject } from
|
|
3
|
-
import { DaffFilters } from
|
|
4
|
-
import { DaffSearchProductResult } from
|
|
5
|
-
import { DaffSearchProductFacadeInterface } from
|
|
6
|
-
import * as i0 from
|
|
7
|
-
|
|
1
|
+
import { Action } from "@ngrx/store";
|
|
2
|
+
import { BehaviorSubject } from "rxjs";
|
|
3
|
+
import { DaffFilters } from "@daffodil/core";
|
|
4
|
+
import { DaffSearchProductResult } from "@daffodil/search-product";
|
|
5
|
+
import { DaffSearchProductFacadeInterface } from "@daffodil/search-product/state";
|
|
6
|
+
import * as i0 from "@angular/core";
|
|
7
|
+
import { EnvironmentProviders } from "@angular/core";
|
|
8
8
|
/**
|
|
9
9
|
* Mocks out facade fields and methods for testing purposes.
|
|
10
10
|
*
|
|
11
11
|
* @inheritdoc
|
|
12
12
|
*/
|
|
13
|
-
declare class MockDaffSearchProductFacade implements DaffSearchProductFacadeInterface {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
13
|
+
export declare class MockDaffSearchProductFacade implements DaffSearchProductFacadeInterface {
|
|
14
|
+
filters$: BehaviorSubject<DaffFilters>;
|
|
15
|
+
appliedFilters$: BehaviorSubject<DaffFilters>;
|
|
16
|
+
productResults$: BehaviorSubject<DaffSearchProductResult[]>;
|
|
17
|
+
dispatch(action: Action): void;
|
|
18
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<MockDaffSearchProductFacade, never>;
|
|
19
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
20
20
|
}
|
|
21
|
-
|
|
22
21
|
/**
|
|
23
22
|
* Provides the {@link MockDaffSearchProductFacade} for {@link DaffSearchProductFacade}.
|
|
23
|
+
*
|
|
24
|
+
* @deprecated in favor of {@link provideDaffSearchProductStateTesting} Deprecated in version 0.95.0. Will be removed in version 0.98.0.
|
|
24
25
|
*/
|
|
25
|
-
declare class DaffSearchProductStateTestingModule {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
26
|
+
export declare class DaffSearchProductStateTestingModule {
|
|
27
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DaffSearchProductStateTestingModule, never>;
|
|
28
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<DaffSearchProductStateTestingModule, never, never, never>;
|
|
29
|
+
static ɵinj: i0.ɵɵInjectorDeclaration<DaffSearchProductStateTestingModule>;
|
|
29
30
|
}
|
|
30
|
-
|
|
31
|
-
|
|
31
|
+
/**
|
|
32
|
+
* Provides the {@link MockDaffSearchProductFacade} for {@link DaffSearchProductPageFacade} and {@link DaffSearchProductIncrementalFacade},
|
|
33
|
+
* and the {@link MockDaffCollectionFacade} for {@link DaffSearchProductCollectionFacade}.
|
|
34
|
+
*/
|
|
35
|
+
export declare const provideDaffSearchProductStateTesting: () => EnvironmentProviders;
|
|
@@ -1,249 +1,241 @@
|
|
|
1
|
-
import * as i1 from
|
|
2
|
-
import { ActionReducerMap, MemoizedSelector,
|
|
3
|
-
import { DaffCollectionMetadata, DaffFilterRequest, DaffFilterToggleRequest
|
|
4
|
-
import * as i2 from
|
|
5
|
-
import {
|
|
6
|
-
import * as
|
|
7
|
-
import {
|
|
8
|
-
import
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import * as i3 from
|
|
16
|
-
|
|
1
|
+
import * as i1 from "@ngrx/store";
|
|
2
|
+
import { Action, ActionReducerMap, MemoizedSelector, Store } from "@ngrx/store";
|
|
3
|
+
import { DaffCollectionMetadata, DaffCollectionRequest, DaffFilterRequest, DaffFilterToggleRequest } from "@daffodil/core";
|
|
4
|
+
import * as i2 from "@daffodil/product/state";
|
|
5
|
+
import { DaffProductReducersState, DaffProductStateRootSlice } from "@daffodil/product/state";
|
|
6
|
+
import * as i3$1 from "@daffodil/search/state";
|
|
7
|
+
import { DaffSearchActions, DaffSearchReducerState, DaffSearchReducersState, DaffSearchSelectors, DaffSearchStateRootSlice } from "@daffodil/search/state";
|
|
8
|
+
import { DaffCollectionApplyFilters, DaffCollectionChangeCurrentPage, DaffCollectionChangePageSize, DaffCollectionChangeSortingOption, DaffCollectionClearFilters, DaffCollectionFacade, DaffCollectionFacadeInterface, DaffCollectionMemoizedSelectors, DaffCollectionRemoveFilters, DaffCollectionReplaceFilters, DaffCollectionToggleFilter, DaffStoreFacade } from "@daffodil/core/state";
|
|
9
|
+
import { Dictionary, EntityState } from "@ngrx/entity";
|
|
10
|
+
import { DaffSearchProductResult } from "@daffodil/search-product";
|
|
11
|
+
import { DaffProduct } from "@daffodil/product";
|
|
12
|
+
import { Observable } from "rxjs";
|
|
13
|
+
import * as i0 from "@angular/core";
|
|
14
|
+
import { EnvironmentProviders } from "@angular/core";
|
|
15
|
+
import * as i3 from "@ngrx/effects";
|
|
17
16
|
/**
|
|
18
17
|
* The key under which the search feature state will be stored.
|
|
19
18
|
*/
|
|
20
|
-
declare const DAFF_SEARCH_PRODUCT_STORE_FEATURE_KEY = "daffSearchProduct";
|
|
21
|
-
|
|
19
|
+
export declare const DAFF_SEARCH_PRODUCT_STORE_FEATURE_KEY = "daffSearchProduct";
|
|
22
20
|
/**
|
|
23
21
|
* The feature state for search.
|
|
24
22
|
*/
|
|
25
|
-
interface DaffSearchProductReducersState {
|
|
26
|
-
|
|
23
|
+
export interface DaffSearchProductReducersState {
|
|
24
|
+
productCollection: DaffCollectionMetadata;
|
|
27
25
|
}
|
|
28
26
|
/**
|
|
29
27
|
* The footprint of search feature state in the root application state.
|
|
30
28
|
*/
|
|
31
|
-
interface DaffSearchProductStateRootSlice extends DaffSearchStateRootSlice, DaffProductStateRootSlice {
|
|
32
|
-
|
|
29
|
+
export interface DaffSearchProductStateRootSlice extends DaffSearchStateRootSlice, DaffProductStateRootSlice {
|
|
30
|
+
[DAFF_SEARCH_PRODUCT_STORE_FEATURE_KEY]: DaffSearchProductReducersState;
|
|
33
31
|
}
|
|
34
|
-
|
|
35
32
|
/**
|
|
36
33
|
* The reducers for the entire search feature state.
|
|
37
34
|
*/
|
|
38
|
-
declare const daffSearchProductReducers: ActionReducerMap<DaffSearchProductReducersState>;
|
|
39
|
-
|
|
35
|
+
export declare const daffSearchProductReducers: ActionReducerMap<DaffSearchProductReducersState>;
|
|
40
36
|
/**
|
|
41
37
|
* The search action types enum.
|
|
42
38
|
*/
|
|
43
|
-
declare enum DaffSearchProductCollectionActionTypes {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
39
|
+
export declare enum DaffSearchProductCollectionActionTypes {
|
|
40
|
+
SearchProductReplaceFiltersAction = "[@daffodil/search-product] Search Product Replace Filters Action",
|
|
41
|
+
SearchProductApplyFiltersAction = "[@daffodil/search-product] Search Product Apply Filters Action",
|
|
42
|
+
SearchProductRemoveFiltersAction = "[@daffodil/search-product] Search Product Remove Filters Action",
|
|
43
|
+
SearchProductClearFiltersAction = "[@daffodil/search-product] Search Product Clear Filters Action",
|
|
44
|
+
SearchProductToggleFiltersAction = "[@daffodil/search-product] Search Product Toggle Filters Action",
|
|
45
|
+
SearchProductChangePageSizeAction = "[@daffodil/search-product] Search Product Change Page Size Action",
|
|
46
|
+
SearchProductChangeCurrentPageAction = "[@daffodil/search-product] Search Product Change Current Page Action",
|
|
47
|
+
SearchProductChangeSortingOptionAction = "[@daffodil/search-product] Search Product Change Sorting Option Action"
|
|
52
48
|
}
|
|
53
49
|
/**
|
|
54
50
|
* @inheritdoc
|
|
55
51
|
* @role action
|
|
56
52
|
*/
|
|
57
|
-
declare class DaffSearchProductCollectionReplaceFilters implements DaffCollectionReplaceFilters {
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
53
|
+
export declare class DaffSearchProductCollectionReplaceFilters implements DaffCollectionReplaceFilters {
|
|
54
|
+
filters: DaffFilterRequest[];
|
|
55
|
+
readonly type = DaffSearchProductCollectionActionTypes.SearchProductReplaceFiltersAction;
|
|
56
|
+
constructor(filters: DaffFilterRequest[]);
|
|
61
57
|
}
|
|
62
58
|
/**
|
|
63
59
|
* @inheritdoc
|
|
64
60
|
* @role action
|
|
65
61
|
*/
|
|
66
|
-
declare class DaffSearchProductCollectionApplyFilters implements DaffCollectionApplyFilters {
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
62
|
+
export declare class DaffSearchProductCollectionApplyFilters implements DaffCollectionApplyFilters {
|
|
63
|
+
filters: DaffFilterRequest[];
|
|
64
|
+
readonly type = DaffSearchProductCollectionActionTypes.SearchProductApplyFiltersAction;
|
|
65
|
+
constructor(filters: DaffFilterRequest[]);
|
|
70
66
|
}
|
|
71
67
|
/**
|
|
72
68
|
* @inheritdoc
|
|
73
69
|
* @role action
|
|
74
70
|
*/
|
|
75
|
-
declare class DaffSearchProductCollectionRemoveFilters implements DaffCollectionRemoveFilters {
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
71
|
+
export declare class DaffSearchProductCollectionRemoveFilters implements DaffCollectionRemoveFilters {
|
|
72
|
+
filters: DaffFilterRequest[];
|
|
73
|
+
readonly type = DaffSearchProductCollectionActionTypes.SearchProductRemoveFiltersAction;
|
|
74
|
+
constructor(filters: DaffFilterRequest[]);
|
|
79
75
|
}
|
|
80
76
|
/**
|
|
81
77
|
* @inheritdoc
|
|
82
78
|
* @role action
|
|
83
79
|
*/
|
|
84
|
-
declare class DaffSearchProductCollectionClearFilters implements DaffCollectionClearFilters {
|
|
85
|
-
|
|
80
|
+
export declare class DaffSearchProductCollectionClearFilters implements DaffCollectionClearFilters {
|
|
81
|
+
readonly type = DaffSearchProductCollectionActionTypes.SearchProductClearFiltersAction;
|
|
86
82
|
}
|
|
87
83
|
/**
|
|
88
84
|
* @inheritdoc
|
|
89
85
|
* @role action
|
|
90
86
|
*/
|
|
91
|
-
declare class DaffSearchProductCollectionToggleFilter implements DaffCollectionToggleFilter {
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
87
|
+
export declare class DaffSearchProductCollectionToggleFilter implements DaffCollectionToggleFilter {
|
|
88
|
+
filter: DaffFilterToggleRequest;
|
|
89
|
+
readonly type = DaffSearchProductCollectionActionTypes.SearchProductToggleFiltersAction;
|
|
90
|
+
constructor(filter: DaffFilterToggleRequest);
|
|
95
91
|
}
|
|
96
92
|
/**
|
|
97
93
|
* @inheritdoc
|
|
98
94
|
* @role action
|
|
99
95
|
*/
|
|
100
|
-
declare class DaffSearchProductCollectionChangePageSize implements DaffCollectionChangePageSize {
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
96
|
+
export declare class DaffSearchProductCollectionChangePageSize implements DaffCollectionChangePageSize {
|
|
97
|
+
pageSize: number;
|
|
98
|
+
readonly type = DaffSearchProductCollectionActionTypes.SearchProductChangePageSizeAction;
|
|
99
|
+
constructor(pageSize: number);
|
|
104
100
|
}
|
|
105
101
|
/**
|
|
106
102
|
* @inheritdoc
|
|
107
103
|
* @role action
|
|
108
104
|
*/
|
|
109
|
-
declare class DaffSearchProductCollectionChangeCurrentPage implements DaffCollectionChangeCurrentPage {
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
105
|
+
export declare class DaffSearchProductCollectionChangeCurrentPage implements DaffCollectionChangeCurrentPage {
|
|
106
|
+
currentPage: number;
|
|
107
|
+
readonly type = DaffSearchProductCollectionActionTypes.SearchProductChangeCurrentPageAction;
|
|
108
|
+
constructor(currentPage: number);
|
|
113
109
|
}
|
|
114
110
|
/**
|
|
115
111
|
* @inheritdoc
|
|
116
112
|
* @role action
|
|
117
113
|
*/
|
|
118
|
-
declare class DaffSearchProductCollectionChangeSortingOption implements DaffCollectionChangeSortingOption {
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
114
|
+
export declare class DaffSearchProductCollectionChangeSortingOption implements DaffCollectionChangeSortingOption {
|
|
115
|
+
sort: {
|
|
116
|
+
option: DaffCollectionRequest['appliedSortOption'];
|
|
117
|
+
direction: DaffCollectionRequest['appliedSortDirection'];
|
|
118
|
+
};
|
|
119
|
+
readonly type = DaffSearchProductCollectionActionTypes.SearchProductChangeSortingOptionAction;
|
|
120
|
+
constructor(sort: {
|
|
121
|
+
option: DaffCollectionRequest['appliedSortOption'];
|
|
122
|
+
direction: DaffCollectionRequest['appliedSortDirection'];
|
|
123
|
+
});
|
|
128
124
|
}
|
|
129
125
|
/**
|
|
130
126
|
* A union of the search product action types.
|
|
131
127
|
*/
|
|
132
|
-
type DaffSearchProductCollectionActions = DaffSearchProductCollectionReplaceFilters | DaffSearchProductCollectionApplyFilters | DaffSearchProductCollectionRemoveFilters | DaffSearchProductCollectionClearFilters | DaffSearchProductCollectionToggleFilter | DaffSearchProductCollectionChangePageSize | DaffSearchProductCollectionChangeCurrentPage | DaffSearchProductCollectionChangeSortingOption;
|
|
133
|
-
|
|
128
|
+
export type DaffSearchProductCollectionActions = DaffSearchProductCollectionReplaceFilters | DaffSearchProductCollectionApplyFilters | DaffSearchProductCollectionRemoveFilters | DaffSearchProductCollectionClearFilters | DaffSearchProductCollectionToggleFilter | DaffSearchProductCollectionChangePageSize | DaffSearchProductCollectionChangeCurrentPage | DaffSearchProductCollectionChangeSortingOption;
|
|
134
129
|
/**
|
|
135
130
|
* The reducer for handling apply product filters actions in the main search state.
|
|
136
131
|
*/
|
|
137
|
-
declare function daffSearchProductCollectionSearchReducer(state: DaffSearchReducerState<
|
|
138
|
-
|
|
139
|
-
declare const
|
|
140
|
-
|
|
141
|
-
declare const daffSearchProductCollectionReducer: (state: DaffCollectionMetadata, action: DaffSearchActions | DaffSearchProductCollectionActions) => DaffCollectionMetadata;
|
|
142
|
-
|
|
132
|
+
export declare function daffSearchProductCollectionSearchReducer(state: DaffSearchReducerState<import("@daffodil/search/types/daffodil-search").DaffSearchResult>, action: DaffSearchProductCollectionActions): DaffSearchReducerState;
|
|
133
|
+
export declare const daffSearchProductCollectionSearchReducers: ActionReducerMap<DaffSearchReducersState>;
|
|
134
|
+
export declare const daffSearchProductCollectionReducer: (state: DaffCollectionMetadata, action: DaffSearchActions | DaffSearchProductCollectionActions) => DaffCollectionMetadata;
|
|
143
135
|
/**
|
|
144
136
|
* Reducer function that catches actions and changes/overwrites search entities state.
|
|
145
137
|
*/
|
|
146
|
-
declare function daffSearchProductEntitiesReducer<T extends DaffSearchProductResult = DaffSearchProductResult>(state: EntityState<T>, action: DaffSearchActions<T>): EntityState<T>;
|
|
147
|
-
|
|
148
|
-
declare const
|
|
149
|
-
|
|
150
|
-
declare const getSearchProductCollectionSelectors: () => DaffCollectionMemoizedSelectors<DaffSearchProductStateRootSlice>;
|
|
151
|
-
|
|
138
|
+
export declare function daffSearchProductEntitiesReducer<T extends DaffSearchProductResult = DaffSearchProductResult>(state: EntityState<T>, action: DaffSearchActions<T>): EntityState<T>;
|
|
139
|
+
export declare const daffSearchProductProductReducers: ActionReducerMap<DaffProductReducersState>;
|
|
140
|
+
export declare const getSearchProductCollectionSelectors: () => DaffCollectionMemoizedSelectors<DaffSearchProductStateRootSlice>;
|
|
152
141
|
/**
|
|
153
142
|
* Selectors for product results on a search page.
|
|
154
143
|
*/
|
|
155
|
-
interface DaffSearchProductSelectors {
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
}
|
|
165
|
-
declare const daffSearchProductCreateSelectors: (selectSearchResultIds: DaffSearchSelectors["selectSearchResultIds"]) => {
|
|
166
|
-
|
|
167
|
-
|
|
144
|
+
export interface DaffSearchProductSelectors {
|
|
145
|
+
/**
|
|
146
|
+
* Select the product search result IDs from the main search state.
|
|
147
|
+
*/
|
|
148
|
+
selectProductResultIds: MemoizedSelector<DaffSearchProductStateRootSlice, Array<DaffSearchProductResult['id']>>;
|
|
149
|
+
/**
|
|
150
|
+
* Select the product search results from the main product state.
|
|
151
|
+
*/
|
|
152
|
+
selectProductResults: MemoizedSelector<DaffSearchProductStateRootSlice, Array<DaffSearchProductResult>>;
|
|
153
|
+
}
|
|
154
|
+
export declare const daffSearchProductCreateSelectors: (selectSearchResultIds: DaffSearchSelectors["selectSearchResultIds"]) => {
|
|
155
|
+
selectProductResultIds: MemoizedSelector<import("@daffodil/search/state").DaffSearchStateRootSlice<import("@daffodil/search/types/daffodil-search").DaffSearchResult>, string[], (s1: Record<string, string[]>) => string[]>;
|
|
156
|
+
selectProductResults: MemoizedSelector<DaffSearchProductStateRootSlice, DaffSearchProductResult[], (s_0: string[], s_1: Dictionary<DaffProduct>) => DaffSearchProductResult[]>;
|
|
168
157
|
};
|
|
169
|
-
|
|
170
|
-
declare const
|
|
171
|
-
|
|
172
|
-
declare const daffSearchProductGetIncrementalSelectors: () => DaffSearchProductSelectors;
|
|
173
|
-
|
|
158
|
+
export declare const daffSearchProductGetPageSelectors: () => DaffSearchProductSelectors;
|
|
159
|
+
export declare const daffSearchProductGetIncrementalSelectors: () => DaffSearchProductSelectors;
|
|
174
160
|
/**
|
|
175
161
|
* Selector for the search product feature state.
|
|
176
162
|
*/
|
|
177
|
-
interface DaffSearchProductFeatureSelector {
|
|
178
|
-
|
|
163
|
+
export interface DaffSearchProductFeatureSelector {
|
|
164
|
+
selectSearchProductFeatureState: MemoizedSelector<DaffSearchProductStateRootSlice, DaffSearchProductReducersState>;
|
|
179
165
|
}
|
|
180
|
-
declare const getDaffSearchProductReducersStateSelector: () => DaffSearchProductFeatureSelector;
|
|
181
|
-
|
|
166
|
+
export declare const getDaffSearchProductReducersStateSelector: () => DaffSearchProductFeatureSelector;
|
|
182
167
|
/**
|
|
183
168
|
* Exposes the search state selectors.
|
|
184
169
|
*/
|
|
185
|
-
interface DaffSearchProductFacadeInterface extends DaffStoreFacade<Action> {
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
170
|
+
export interface DaffSearchProductFacadeInterface extends DaffStoreFacade<Action> {
|
|
171
|
+
/**
|
|
172
|
+
* The products returned in the most recent search.
|
|
173
|
+
*/
|
|
174
|
+
productResults$: Observable<Array<DaffSearchProductResult>>;
|
|
190
175
|
}
|
|
191
|
-
|
|
192
176
|
/**
|
|
193
177
|
* @inheritdoc
|
|
194
178
|
*/
|
|
195
|
-
declare abstract class DaffSearchProductFacade implements DaffSearchProductFacadeInterface {
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
179
|
+
export declare abstract class DaffSearchProductFacade implements DaffSearchProductFacadeInterface {
|
|
180
|
+
private store;
|
|
181
|
+
productResults$: Observable<Array<DaffSearchProductResult>>;
|
|
182
|
+
constructor(store: Store<DaffSearchProductStateRootSlice>, selectors: DaffSearchProductSelectors);
|
|
183
|
+
dispatch(action: Action): void;
|
|
200
184
|
}
|
|
201
|
-
|
|
202
185
|
/**
|
|
203
186
|
* @inheritdoc
|
|
204
187
|
*
|
|
205
188
|
* A facade for the normal search state.
|
|
206
189
|
*/
|
|
207
|
-
declare class DaffSearchProductPageFacade extends DaffSearchProductFacade implements DaffSearchProductFacadeInterface {
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
190
|
+
export declare class DaffSearchProductPageFacade extends DaffSearchProductFacade implements DaffSearchProductFacadeInterface {
|
|
191
|
+
constructor(store: Store<DaffSearchProductStateRootSlice>);
|
|
192
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DaffSearchProductPageFacade, never>;
|
|
193
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
211
194
|
}
|
|
212
|
-
|
|
213
195
|
/**
|
|
214
196
|
* @inheritdoc
|
|
215
197
|
*
|
|
216
198
|
* A facade for the normal search state.
|
|
217
199
|
*/
|
|
218
|
-
declare class DaffSearchProductIncrementalFacade extends DaffSearchProductFacade implements DaffSearchProductFacadeInterface {
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
200
|
+
export declare class DaffSearchProductIncrementalFacade extends DaffSearchProductFacade implements DaffSearchProductFacadeInterface {
|
|
201
|
+
constructor(store: Store<DaffSearchProductStateRootSlice>);
|
|
202
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DaffSearchProductIncrementalFacade, never>;
|
|
203
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
222
204
|
}
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
static ɵprov: i0.ɵɵInjectableDeclaration<DaffSearchProductCollectionFacade>;
|
|
205
|
+
export declare class DaffSearchProductCollectionFacade extends DaffCollectionFacade<DaffSearchProductStateRootSlice> implements DaffCollectionFacadeInterface {
|
|
206
|
+
constructor(store: Store<DaffSearchProductStateRootSlice>);
|
|
207
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DaffSearchProductCollectionFacade, never>;
|
|
208
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
228
209
|
}
|
|
229
|
-
|
|
230
210
|
declare class DaffSearchProductStateCoreModule {
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
}
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
211
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DaffSearchProductStateCoreModule, never>;
|
|
212
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<DaffSearchProductStateCoreModule, never, [typeof i1.StoreFeatureModule, typeof i2.DaffProductStateModule, typeof i3$1.DaffSearchStateModule], never>;
|
|
213
|
+
static ɵinj: i0.ɵɵInjectorDeclaration<DaffSearchProductStateCoreModule>;
|
|
214
|
+
}
|
|
215
|
+
/**
|
|
216
|
+
* @deprecated in favor of {@link provideDaffSearchProductState} Deprecated in version 0.95.0. Will be removed in version 0.98.0.
|
|
217
|
+
*/
|
|
218
|
+
export declare class DaffSearchProductStateModule {
|
|
219
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DaffSearchProductStateModule, never>;
|
|
220
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<DaffSearchProductStateModule, never, [typeof DaffSearchProductStateCoreModule], never>;
|
|
221
|
+
static ɵinj: i0.ɵɵInjectorDeclaration<DaffSearchProductStateModule>;
|
|
222
|
+
}
|
|
223
|
+
/**
|
|
224
|
+
* @deprecated in favor of {@link provideDaffSearchProductPageState} Deprecated in version 0.95.0. Will be removed in version 0.98.0.
|
|
225
|
+
*/
|
|
226
|
+
export declare class DaffSearchProductPageStateModule {
|
|
227
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DaffSearchProductPageStateModule, never>;
|
|
228
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<DaffSearchProductPageStateModule, never, [typeof DaffSearchProductStateCoreModule, typeof i3$1.DaffSearchPageStateModule, typeof i3.EffectsFeatureModule], never>;
|
|
229
|
+
static ɵinj: i0.ɵɵInjectorDeclaration<DaffSearchProductPageStateModule>;
|
|
230
|
+
}
|
|
231
|
+
/**
|
|
232
|
+
* Provides the search product state.
|
|
233
|
+
* Includes {@link provideDaffProductState} and {@link provideDaffSearchState}.
|
|
234
|
+
*/
|
|
235
|
+
export declare const provideDaffSearchProductState: () => EnvironmentProviders;
|
|
236
|
+
/**
|
|
237
|
+
* Provides the search product state and the search product page effects.
|
|
238
|
+
* Includes {@link provideDaffProductState}, {@link provideDaffSearchState}, and {@link provideDaffSearchPageState}.
|
|
239
|
+
*/
|
|
240
|
+
export declare const provideDaffSearchProductPageState: () => EnvironmentProviders;
|
|
241
|
+
export {};
|
|
@@ -1,26 +1,29 @@
|
|
|
1
|
-
import { DaffModelFactory } from
|
|
2
|
-
import { DaffProductKindFactory } from
|
|
3
|
-
import { DaffSearchProductResult } from
|
|
4
|
-
import * as i0 from
|
|
5
|
-
|
|
1
|
+
import { DaffModelFactory } from "@daffodil/core/testing";
|
|
2
|
+
import { DaffProductKindFactory } from "@daffodil/product/testing";
|
|
3
|
+
import { DaffSearchProductResult } from "@daffodil/search-product";
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
import { EnvironmentProviders } from "@angular/core";
|
|
6
6
|
/**
|
|
7
7
|
* Factory for creating {@link DaffSearchProductResult}s.
|
|
8
8
|
*/
|
|
9
|
-
declare class DaffSearchProductResultFactory extends DaffModelFactory<DaffSearchProductResult> {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
9
|
+
export declare class DaffSearchProductResultFactory extends DaffModelFactory<DaffSearchProductResult> {
|
|
10
|
+
private productKindFactory;
|
|
11
|
+
constructor(productKindFactory: DaffProductKindFactory);
|
|
12
|
+
create(partial?: {}): DaffSearchProductResult;
|
|
13
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DaffSearchProductResultFactory, never>;
|
|
14
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
15
15
|
}
|
|
16
|
-
|
|
17
16
|
/**
|
|
18
17
|
* Provides the default search result factory as a search result type factory.
|
|
18
|
+
*
|
|
19
|
+
* @deprecated in favor of {@link provideDaffSearchProductTesting} Deprecated in version 0.95.0. Will be removed in version 0.98.0.
|
|
19
20
|
*/
|
|
20
|
-
declare class DaffSearchProductTestingModule {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
21
|
+
export declare class DaffSearchProductTestingModule {
|
|
22
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DaffSearchProductTestingModule, never>;
|
|
23
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<DaffSearchProductTestingModule, never, never, never>;
|
|
24
|
+
static ɵinj: i0.ɵɵInjectorDeclaration<DaffSearchProductTestingModule>;
|
|
24
25
|
}
|
|
25
|
-
|
|
26
|
-
|
|
26
|
+
/**
|
|
27
|
+
* Provides the default search result factory as a search result type factory.
|
|
28
|
+
*/
|
|
29
|
+
export declare const provideDaffSearchProductTesting: () => EnvironmentProviders;
|
|
@@ -1,22 +1,16 @@
|
|
|
1
|
-
import { DaffProduct } from
|
|
2
|
-
import { DaffSearchResult } from
|
|
3
|
-
|
|
1
|
+
import { DaffProduct } from "@daffodil/product";
|
|
2
|
+
import { DaffSearchResult } from "@daffodil/search";
|
|
4
3
|
/**
|
|
5
4
|
* The kind identifier for product search results.
|
|
6
5
|
*/
|
|
7
|
-
declare const DAFF_SEARCH_PRODUCT_RESULT_KIND: DaffSearchResult['kind'];
|
|
8
|
-
|
|
6
|
+
export declare const DAFF_SEARCH_PRODUCT_RESULT_KIND: DaffSearchResult['kind'];
|
|
9
7
|
/**
|
|
10
8
|
* An extension of a {@link DaffSearchResult} for products.
|
|
11
9
|
*/
|
|
12
|
-
type DaffSearchProductResult<T extends DaffProduct = DaffProduct> = DaffSearchResult & T & {
|
|
13
|
-
|
|
10
|
+
export type DaffSearchProductResult<T extends DaffProduct = DaffProduct> = DaffSearchResult & T & {
|
|
11
|
+
kind: typeof DAFF_SEARCH_PRODUCT_RESULT_KIND;
|
|
14
12
|
};
|
|
15
|
-
|
|
16
13
|
/**
|
|
17
14
|
* Transforms a list of products into a list of product search results.
|
|
18
15
|
*/
|
|
19
|
-
declare const daffTransformProductsToSearchResults: <T extends DaffProduct = DaffProduct>(products: T[]) => DaffSearchProductResult<T>[];
|
|
20
|
-
|
|
21
|
-
export { DAFF_SEARCH_PRODUCT_RESULT_KIND, daffTransformProductsToSearchResults };
|
|
22
|
-
export type { DaffSearchProductResult };
|
|
16
|
+
export declare const daffTransformProductsToSearchResults: <T extends DaffProduct = DaffProduct>(products: T[]) => DaffSearchProductResult<T>[];
|