@daffodil/search-product 0.43.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/README.md +11 -0
- package/constants/public_api.d.ts +1 -0
- package/constants/search-result-kind.d.ts +5 -0
- package/daffodil-search-product.d.ts +5 -0
- package/driver/daffodil-search-product-driver.d.ts +5 -0
- package/driver/in-memory/backend/search.service.d.ts +36 -0
- package/driver/in-memory/daffodil-search-product-driver-in-memory.d.ts +5 -0
- package/driver/in-memory/in-memory.module.d.ts +12 -0
- package/driver/in-memory/index.d.ts +1 -0
- package/driver/in-memory/package.json +10 -0
- package/driver/in-memory/public_api.d.ts +1 -0
- package/driver/index.d.ts +1 -0
- package/driver/interfaces/options.interface.d.ts +4 -0
- package/driver/interfaces/public_api.d.ts +3 -0
- package/driver/interfaces/response.interface.d.ts +6 -0
- package/driver/interfaces/search-product-service.interface.d.ts +14 -0
- package/driver/magento/core.module.d.ts +10 -0
- package/driver/magento/daffodil-search-product-driver-magento.d.ts +5 -0
- package/driver/magento/driver.module.d.ts +13 -0
- package/driver/magento/errors/map.d.ts +6 -0
- package/driver/magento/errors/transform.d.ts +13 -0
- package/driver/magento/federated-driver.module.d.ts +20 -0
- package/driver/magento/index.d.ts +1 -0
- package/driver/magento/models/get-product-response.interface.d.ts +12 -0
- package/driver/magento/models/public_api.d.ts +1 -0
- package/driver/magento/package.json +10 -0
- package/driver/magento/product-search.service.d.ts +23 -0
- package/driver/magento/public_api.d.ts +5 -0
- package/driver/magento/queries/product-search.d.ts +3 -0
- package/driver/package.json +10 -0
- package/driver/public_api.d.ts +1 -0
- package/driver/testing/daffodil-search-product-driver-testing.d.ts +5 -0
- package/driver/testing/index.d.ts +1 -0
- package/driver/testing/package.json +10 -0
- package/driver/testing/public_api.d.ts +1 -0
- package/driver/testing/testing.module.d.ts +12 -0
- package/esm2020/constants/public_api.mjs +2 -0
- package/esm2020/constants/search-result-kind.mjs +5 -0
- package/esm2020/daffodil-search-product.mjs +5 -0
- package/esm2020/driver/daffodil-search-product-driver.mjs +5 -0
- package/esm2020/driver/in-memory/backend/search.service.mjs +64 -0
- package/esm2020/driver/in-memory/daffodil-search-product-driver-in-memory.mjs +5 -0
- package/esm2020/driver/in-memory/in-memory.module.mjs +36 -0
- package/esm2020/driver/in-memory/index.mjs +2 -0
- package/esm2020/driver/in-memory/public_api.mjs +2 -0
- package/esm2020/driver/index.mjs +2 -0
- package/esm2020/driver/interfaces/options.interface.mjs +2 -0
- package/esm2020/driver/interfaces/public_api.mjs +2 -0
- package/esm2020/driver/interfaces/response.interface.mjs +2 -0
- package/esm2020/driver/interfaces/search-product-service.interface.mjs +2 -0
- package/esm2020/driver/magento/core.module.mjs +37 -0
- package/esm2020/driver/magento/daffodil-search-product-driver-magento.mjs +5 -0
- package/esm2020/driver/magento/driver.module.mjs +39 -0
- package/esm2020/driver/magento/errors/map.mjs +8 -0
- package/esm2020/driver/magento/errors/transform.mjs +33 -0
- package/esm2020/driver/magento/federated-driver.module.mjs +58 -0
- package/esm2020/driver/magento/index.mjs +2 -0
- package/esm2020/driver/magento/models/get-product-response.interface.mjs +2 -0
- package/esm2020/driver/magento/models/public_api.mjs +2 -0
- package/esm2020/driver/magento/product-search.service.mjs +84 -0
- package/esm2020/driver/magento/public_api.mjs +5 -0
- package/esm2020/driver/magento/queries/product-search.mjs +36 -0
- package/esm2020/driver/public_api.mjs +2 -0
- package/esm2020/driver/testing/daffodil-search-product-driver-testing.mjs +5 -0
- package/esm2020/driver/testing/index.mjs +2 -0
- package/esm2020/driver/testing/public_api.mjs +2 -0
- package/esm2020/driver/testing/testing.module.mjs +36 -0
- package/esm2020/index.mjs +2 -0
- package/esm2020/models/product-search-result.type.mjs +2 -0
- package/esm2020/models/public_api.mjs +2 -0
- package/esm2020/public_api.mjs +4 -0
- package/esm2020/routing/daffodil-search-product-routing.mjs +5 -0
- package/esm2020/routing/effects/collection-route.effects.mjs +21 -0
- package/esm2020/routing/index.mjs +2 -0
- package/esm2020/routing/module.mjs +53 -0
- package/esm2020/routing/public_api.mjs +2 -0
- package/esm2020/state/actions/product-collection.actions.mjs +86 -0
- package/esm2020/state/core.module.mjs +35 -0
- package/esm2020/state/daffodil-search-product-state.mjs +5 -0
- package/esm2020/state/effects/collection.effects.mjs +60 -0
- package/esm2020/state/facades/collection/facade.mjs +20 -0
- package/esm2020/state/facades/public_api.mjs +5 -0
- package/esm2020/state/facades/search/incremental.facade.mjs +25 -0
- package/esm2020/state/facades/search/page.facade.mjs +25 -0
- package/esm2020/state/facades/search/search-facade.interface.mjs +2 -0
- package/esm2020/state/facades/search/search.facade.mjs +15 -0
- package/esm2020/state/index.mjs +2 -0
- package/esm2020/state/page.module.mjs +32 -0
- package/esm2020/state/public_api.mjs +7 -0
- package/esm2020/state/reducers/collection/public_api.mjs +4 -0
- package/esm2020/state/reducers/collection/reducer.mjs +33 -0
- package/esm2020/state/reducers/collection/search-reducers.mjs +7 -0
- package/esm2020/state/reducers/collection/search.reducer.mjs +24 -0
- package/esm2020/state/reducers/product/entities.reducer.mjs +17 -0
- package/esm2020/state/reducers/product/public_api.mjs +3 -0
- package/esm2020/state/reducers/product/reducers.mjs +9 -0
- package/esm2020/state/reducers/public_api.mjs +5 -0
- package/esm2020/state/reducers/reducers.interface.mjs +2 -0
- package/esm2020/state/reducers/reducers.mjs +8 -0
- package/esm2020/state/reducers/store-feature-key.mjs +5 -0
- package/esm2020/state/selectors/collection/selectors.mjs +10 -0
- package/esm2020/state/selectors/incremental/selectors.mjs +5 -0
- package/esm2020/state/selectors/page/selectors.mjs +5 -0
- package/esm2020/state/selectors/public_api.mjs +6 -0
- package/esm2020/state/selectors/search-feature.selector.mjs +9 -0
- package/esm2020/state/selectors/search.selector.mjs +13 -0
- package/esm2020/state/state.module.mjs +19 -0
- package/esm2020/state/testing/daffodil-search-product-state-testing.mjs +5 -0
- package/esm2020/state/testing/index.mjs +2 -0
- package/esm2020/state/testing/mock-search-facade.mjs +24 -0
- package/esm2020/state/testing/public_api.mjs +3 -0
- package/esm2020/state/testing/testing.module.mjs +28 -0
- package/esm2020/testing/daffodil-search-product-testing.mjs +5 -0
- package/esm2020/testing/factories/product-search-result.factory.mjs +27 -0
- package/esm2020/testing/factories/public_api.mjs +2 -0
- package/esm2020/testing/index.mjs +2 -0
- package/esm2020/testing/public_api.mjs +3 -0
- package/esm2020/testing/testing.module.mjs +31 -0
- package/esm2020/transforms/products-to-result.mjs +9 -0
- package/esm2020/transforms/public_api.mjs +2 -0
- package/fesm2015/daffodil-search-product-driver-in-memory.mjs +104 -0
- package/fesm2015/daffodil-search-product-driver-in-memory.mjs.map +1 -0
- package/fesm2015/daffodil-search-product-driver-magento.mjs +278 -0
- package/fesm2015/daffodil-search-product-driver-magento.mjs.map +1 -0
- package/fesm2015/daffodil-search-product-driver-testing.mjs +43 -0
- package/fesm2015/daffodil-search-product-driver-testing.mjs.map +1 -0
- package/fesm2015/daffodil-search-product-driver.mjs +4 -0
- package/fesm2015/daffodil-search-product-driver.mjs.map +1 -0
- package/fesm2015/daffodil-search-product-routing.mjs +74 -0
- package/fesm2015/daffodil-search-product-routing.mjs.map +1 -0
- package/fesm2015/daffodil-search-product-state-testing.mjs +56 -0
- package/fesm2015/daffodil-search-product-state-testing.mjs.map +1 -0
- package/fesm2015/daffodil-search-product-state.mjs +406 -0
- package/fesm2015/daffodil-search-product-state.mjs.map +1 -0
- package/fesm2015/daffodil-search-product-testing.mjs +61 -0
- package/fesm2015/daffodil-search-product-testing.mjs.map +1 -0
- package/fesm2015/daffodil-search-product.mjs +16 -0
- package/fesm2015/daffodil-search-product.mjs.map +1 -0
- package/fesm2020/daffodil-search-product-driver-in-memory.mjs +103 -0
- package/fesm2020/daffodil-search-product-driver-in-memory.mjs.map +1 -0
- package/fesm2020/daffodil-search-product-driver-magento.mjs +283 -0
- package/fesm2020/daffodil-search-product-driver-magento.mjs.map +1 -0
- package/fesm2020/daffodil-search-product-driver-testing.mjs +43 -0
- package/fesm2020/daffodil-search-product-driver-testing.mjs.map +1 -0
- package/fesm2020/daffodil-search-product-driver.mjs +4 -0
- package/fesm2020/daffodil-search-product-driver.mjs.map +1 -0
- package/fesm2020/daffodil-search-product-routing.mjs +74 -0
- package/fesm2020/daffodil-search-product-routing.mjs.map +1 -0
- package/fesm2020/daffodil-search-product-state-testing.mjs +56 -0
- package/fesm2020/daffodil-search-product-state-testing.mjs.map +1 -0
- package/fesm2020/daffodil-search-product-state.mjs +407 -0
- package/fesm2020/daffodil-search-product-state.mjs.map +1 -0
- package/fesm2020/daffodil-search-product-testing.mjs +61 -0
- package/fesm2020/daffodil-search-product-testing.mjs.map +1 -0
- package/fesm2020/daffodil-search-product.mjs +19 -0
- package/fesm2020/daffodil-search-product.mjs.map +1 -0
- package/index.d.ts +1 -0
- package/models/product-search-result.type.d.ts +9 -0
- package/models/public_api.d.ts +1 -0
- package/package.json +122 -0
- package/public_api.d.ts +3 -0
- package/routing/daffodil-search-product-routing.d.ts +5 -0
- package/routing/effects/collection-route.effects.d.ts +10 -0
- package/routing/index.d.ts +1 -0
- package/routing/module.d.ts +9 -0
- package/routing/package.json +10 -0
- package/routing/public_api.d.ts +1 -0
- package/state/actions/product-collection.actions.d.ts +88 -0
- package/state/core.module.d.ts +9 -0
- package/state/daffodil-search-product-state.d.ts +5 -0
- package/state/effects/collection.effects.d.ts +29 -0
- package/state/facades/collection/facade.d.ts +9 -0
- package/state/facades/public_api.d.ts +5 -0
- package/state/facades/search/incremental.facade.d.ts +15 -0
- package/state/facades/search/page.facade.d.ts +15 -0
- package/state/facades/search/search-facade.interface.d.ts +13 -0
- package/state/facades/search/search.facade.d.ts +15 -0
- package/state/index.d.ts +1 -0
- package/state/package.json +10 -0
- package/state/page.module.d.ts +9 -0
- package/state/public_api.d.ts +6 -0
- package/state/reducers/collection/public_api.d.ts +3 -0
- package/state/reducers/collection/reducer.d.ts +4 -0
- package/state/reducers/collection/search-reducers.d.ts +3 -0
- package/state/reducers/collection/search.reducer.d.ts +6 -0
- package/state/reducers/product/entities.reducer.d.ts +7 -0
- package/state/reducers/product/public_api.d.ts +2 -0
- package/state/reducers/product/reducers.d.ts +3 -0
- package/state/reducers/public_api.d.ts +5 -0
- package/state/reducers/reducers.d.ts +6 -0
- package/state/reducers/reducers.interface.d.ts +15 -0
- package/state/reducers/store-feature-key.d.ts +4 -0
- package/state/selectors/collection/selectors.d.ts +3 -0
- package/state/selectors/incremental/selectors.d.ts +2 -0
- package/state/selectors/page/selectors.d.ts +2 -0
- package/state/selectors/public_api.d.ts +5 -0
- package/state/selectors/search-feature.selector.d.ts +9 -0
- package/state/selectors/search.selector.d.ts +22 -0
- package/state/state.module.d.ts +7 -0
- package/state/testing/daffodil-search-product-state-testing.d.ts +5 -0
- package/state/testing/index.d.ts +1 -0
- package/state/testing/mock-search-facade.d.ts +18 -0
- package/state/testing/package.json +10 -0
- package/state/testing/public_api.d.ts +2 -0
- package/state/testing/testing.module.d.ts +9 -0
- package/testing/daffodil-search-product-testing.d.ts +5 -0
- package/testing/factories/product-search-result.factory.d.ts +14 -0
- package/testing/factories/public_api.d.ts +1 -0
- package/testing/index.d.ts +1 -0
- package/testing/package.json +10 -0
- package/testing/public_api.d.ts +2 -0
- package/testing/testing.module.d.ts +9 -0
- package/transforms/products-to-result.d.ts +6 -0
- package/transforms/public_api.d.ts +1 -0
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The kind identifier for product search results.
|
|
3
|
+
*/
|
|
4
|
+
const DAFF_SEARCH_PRODUCT_RESULT_KIND = 'product';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Transforms a list of products into a list of product search results.
|
|
8
|
+
*/
|
|
9
|
+
const daffTransformProductsToSearchResults = (products) => products.map(product => ({
|
|
10
|
+
...product,
|
|
11
|
+
kind: DAFF_SEARCH_PRODUCT_RESULT_KIND,
|
|
12
|
+
}));
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Generated bundle index. Do not edit.
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
export { DAFF_SEARCH_PRODUCT_RESULT_KIND, daffTransformProductsToSearchResults };
|
|
19
|
+
//# sourceMappingURL=daffodil-search-product.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"daffodil-search-product.mjs","sources":["../../../libs/search-product/src/constants/search-result-kind.ts","../../../libs/search-product/src/transforms/products-to-result.ts","../../../libs/search-product/src/daffodil-search-product.ts"],"sourcesContent":["import { DaffSearchResult } from '@daffodil/search';\n\n/**\n * The kind identifier for product search results.\n */\nexport const DAFF_SEARCH_PRODUCT_RESULT_KIND: DaffSearchResult['kind'] = 'product';\n","import { DaffProduct } from '@daffodil/product';\n\nimport { DAFF_SEARCH_PRODUCT_RESULT_KIND } from '../constants/public_api';\nimport { DaffSearchProductResult } from '../models/public_api';\n\n/**\n * Transforms a list of products into a list of product search results.\n */\nexport const daffTransformProductsToSearchResults = <T extends DaffProduct = DaffProduct>(products: T[]): DaffSearchProductResult<T>[] =>\n products.map(product => ({\n ...product,\n kind: DAFF_SEARCH_PRODUCT_RESULT_KIND,\n }));\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":"AAEA;;AAEG;AACI,MAAM,+BAA+B,GAA6B;;ACAzE;;AAEG;AACU,MAAA,oCAAoC,GAAG,CAAsC,QAAa,KACrG,QAAQ,CAAC,GAAG,CAAC,OAAO,KAAK;AACvB,IAAA,GAAG,OAAO;AACV,IAAA,IAAI,EAAE,+BAA+B;AACtC,CAAA,CAAC;;ACZJ;;AAEG;;;;"}
|
package/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './public_api';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { DaffProduct } from '@daffodil/product';
|
|
2
|
+
import { DaffSearchResult } from '@daffodil/search';
|
|
3
|
+
import { DAFF_SEARCH_PRODUCT_RESULT_KIND } from '../constants/public_api';
|
|
4
|
+
/**
|
|
5
|
+
* An extension of a {@link DaffSearchResult} for products.
|
|
6
|
+
*/
|
|
7
|
+
export declare type DaffSearchProductResult<T extends DaffProduct = DaffProduct> = DaffSearchResult & T & {
|
|
8
|
+
kind: typeof DAFF_SEARCH_PRODUCT_RESULT_KIND;
|
|
9
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { DaffSearchProductResult } from './product-search-result.type';
|
package/package.json
ADDED
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@daffodil/search-product",
|
|
3
|
+
"version": "0.43.0",
|
|
4
|
+
"description": "Interfaces built for daffodil/state",
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "https://github.com/graycoreio/daffodil"
|
|
8
|
+
},
|
|
9
|
+
"author": "Graycore LLC",
|
|
10
|
+
"license": "MIT",
|
|
11
|
+
"bugs": {
|
|
12
|
+
"url": "https://github.com/graycoreio/daffodil/issues"
|
|
13
|
+
},
|
|
14
|
+
"publishConfig": {
|
|
15
|
+
"directory": "../../dist/search-product"
|
|
16
|
+
},
|
|
17
|
+
"homepage": "https://github.com/graycoreio/daffodil",
|
|
18
|
+
"peerDependencies": {
|
|
19
|
+
"@angular/common": "^13.0.0",
|
|
20
|
+
"@angular/core": "^13.0.0",
|
|
21
|
+
"@daffodil/core": "0.43.0",
|
|
22
|
+
"@daffodil/product": "0.43.0",
|
|
23
|
+
"@daffodil/search": "0.43.0",
|
|
24
|
+
"rxjs": "7.5.5"
|
|
25
|
+
},
|
|
26
|
+
"optionalDependencies": {
|
|
27
|
+
"@apollo/client": "^3.0.0",
|
|
28
|
+
"@daffodil/driver": "0.43.0",
|
|
29
|
+
"@ngrx/effects": "^13.0.0",
|
|
30
|
+
"@ngrx/entity": "^13.0.0",
|
|
31
|
+
"@ngrx/store": "^13.0.0",
|
|
32
|
+
"apollo-angular": "^3.0.1",
|
|
33
|
+
"@faker-js/faker": "^5.5.3"
|
|
34
|
+
},
|
|
35
|
+
"module": "fesm2015/daffodil-search-product.mjs",
|
|
36
|
+
"es2020": "fesm2020/daffodil-search-product.mjs",
|
|
37
|
+
"esm2020": "esm2020/daffodil-search-product.mjs",
|
|
38
|
+
"fesm2020": "fesm2020/daffodil-search-product.mjs",
|
|
39
|
+
"fesm2015": "fesm2015/daffodil-search-product.mjs",
|
|
40
|
+
"typings": "daffodil-search-product.d.ts",
|
|
41
|
+
"exports": {
|
|
42
|
+
"./package.json": {
|
|
43
|
+
"default": "./package.json"
|
|
44
|
+
},
|
|
45
|
+
".": {
|
|
46
|
+
"types": "./daffodil-search-product.d.ts",
|
|
47
|
+
"esm2020": "./esm2020/daffodil-search-product.mjs",
|
|
48
|
+
"es2020": "./fesm2020/daffodil-search-product.mjs",
|
|
49
|
+
"es2015": "./fesm2015/daffodil-search-product.mjs",
|
|
50
|
+
"node": "./fesm2015/daffodil-search-product.mjs",
|
|
51
|
+
"default": "./fesm2020/daffodil-search-product.mjs"
|
|
52
|
+
},
|
|
53
|
+
"./driver/in-memory": {
|
|
54
|
+
"types": "./driver/in-memory/daffodil-search-product-driver-in-memory.d.ts",
|
|
55
|
+
"esm2020": "./esm2020/driver/in-memory/daffodil-search-product-driver-in-memory.mjs",
|
|
56
|
+
"es2020": "./fesm2020/daffodil-search-product-driver-in-memory.mjs",
|
|
57
|
+
"es2015": "./fesm2015/daffodil-search-product-driver-in-memory.mjs",
|
|
58
|
+
"node": "./fesm2015/daffodil-search-product-driver-in-memory.mjs",
|
|
59
|
+
"default": "./fesm2020/daffodil-search-product-driver-in-memory.mjs"
|
|
60
|
+
},
|
|
61
|
+
"./driver/magento": {
|
|
62
|
+
"types": "./driver/magento/daffodil-search-product-driver-magento.d.ts",
|
|
63
|
+
"esm2020": "./esm2020/driver/magento/daffodil-search-product-driver-magento.mjs",
|
|
64
|
+
"es2020": "./fesm2020/daffodil-search-product-driver-magento.mjs",
|
|
65
|
+
"es2015": "./fesm2015/daffodil-search-product-driver-magento.mjs",
|
|
66
|
+
"node": "./fesm2015/daffodil-search-product-driver-magento.mjs",
|
|
67
|
+
"default": "./fesm2020/daffodil-search-product-driver-magento.mjs"
|
|
68
|
+
},
|
|
69
|
+
"./driver": {
|
|
70
|
+
"types": "./driver/daffodil-search-product-driver.d.ts",
|
|
71
|
+
"esm2020": "./esm2020/driver/daffodil-search-product-driver.mjs",
|
|
72
|
+
"es2020": "./fesm2020/daffodil-search-product-driver.mjs",
|
|
73
|
+
"es2015": "./fesm2015/daffodil-search-product-driver.mjs",
|
|
74
|
+
"node": "./fesm2015/daffodil-search-product-driver.mjs",
|
|
75
|
+
"default": "./fesm2020/daffodil-search-product-driver.mjs"
|
|
76
|
+
},
|
|
77
|
+
"./driver/testing": {
|
|
78
|
+
"types": "./driver/testing/daffodil-search-product-driver-testing.d.ts",
|
|
79
|
+
"esm2020": "./esm2020/driver/testing/daffodil-search-product-driver-testing.mjs",
|
|
80
|
+
"es2020": "./fesm2020/daffodil-search-product-driver-testing.mjs",
|
|
81
|
+
"es2015": "./fesm2015/daffodil-search-product-driver-testing.mjs",
|
|
82
|
+
"node": "./fesm2015/daffodil-search-product-driver-testing.mjs",
|
|
83
|
+
"default": "./fesm2020/daffodil-search-product-driver-testing.mjs"
|
|
84
|
+
},
|
|
85
|
+
"./routing": {
|
|
86
|
+
"types": "./routing/daffodil-search-product-routing.d.ts",
|
|
87
|
+
"esm2020": "./esm2020/routing/daffodil-search-product-routing.mjs",
|
|
88
|
+
"es2020": "./fesm2020/daffodil-search-product-routing.mjs",
|
|
89
|
+
"es2015": "./fesm2015/daffodil-search-product-routing.mjs",
|
|
90
|
+
"node": "./fesm2015/daffodil-search-product-routing.mjs",
|
|
91
|
+
"default": "./fesm2020/daffodil-search-product-routing.mjs"
|
|
92
|
+
},
|
|
93
|
+
"./state": {
|
|
94
|
+
"types": "./state/daffodil-search-product-state.d.ts",
|
|
95
|
+
"esm2020": "./esm2020/state/daffodil-search-product-state.mjs",
|
|
96
|
+
"es2020": "./fesm2020/daffodil-search-product-state.mjs",
|
|
97
|
+
"es2015": "./fesm2015/daffodil-search-product-state.mjs",
|
|
98
|
+
"node": "./fesm2015/daffodil-search-product-state.mjs",
|
|
99
|
+
"default": "./fesm2020/daffodil-search-product-state.mjs"
|
|
100
|
+
},
|
|
101
|
+
"./state/testing": {
|
|
102
|
+
"types": "./state/testing/daffodil-search-product-state-testing.d.ts",
|
|
103
|
+
"esm2020": "./esm2020/state/testing/daffodil-search-product-state-testing.mjs",
|
|
104
|
+
"es2020": "./fesm2020/daffodil-search-product-state-testing.mjs",
|
|
105
|
+
"es2015": "./fesm2015/daffodil-search-product-state-testing.mjs",
|
|
106
|
+
"node": "./fesm2015/daffodil-search-product-state-testing.mjs",
|
|
107
|
+
"default": "./fesm2020/daffodil-search-product-state-testing.mjs"
|
|
108
|
+
},
|
|
109
|
+
"./testing": {
|
|
110
|
+
"types": "./testing/daffodil-search-product-testing.d.ts",
|
|
111
|
+
"esm2020": "./esm2020/testing/daffodil-search-product-testing.mjs",
|
|
112
|
+
"es2020": "./fesm2020/daffodil-search-product-testing.mjs",
|
|
113
|
+
"es2015": "./fesm2015/daffodil-search-product-testing.mjs",
|
|
114
|
+
"node": "./fesm2015/daffodil-search-product-testing.mjs",
|
|
115
|
+
"default": "./fesm2020/daffodil-search-product-testing.mjs"
|
|
116
|
+
}
|
|
117
|
+
},
|
|
118
|
+
"sideEffects": false,
|
|
119
|
+
"dependencies": {
|
|
120
|
+
"tslib": "^2.3.0"
|
|
121
|
+
}
|
|
122
|
+
}
|
package/public_api.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ActivatedRoute, Router } from '@angular/router';
|
|
2
|
+
import { Actions } from '@ngrx/effects';
|
|
3
|
+
import { DaffProductGetQueryParamsFromRequest, DaffProductRoutingCollectionEffects } from '@daffodil/product/routing';
|
|
4
|
+
import { DaffSearchProductCollectionFacade } from '@daffodil/search-product/state';
|
|
5
|
+
import * as i0 from "@angular/core";
|
|
6
|
+
export declare class DaffSearchProductRoutingCollectionEffects extends DaffProductRoutingCollectionEffects {
|
|
7
|
+
constructor(actions$: Actions, router: Router, collectionFacade: DaffSearchProductCollectionFacade, getQueryParams: DaffProductGetQueryParamsFromRequest, route: ActivatedRoute);
|
|
8
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DaffSearchProductRoutingCollectionEffects, never>;
|
|
9
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<DaffSearchProductRoutingCollectionEffects>;
|
|
10
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './public_api';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import * as i1 from "@daffodil/product/routing";
|
|
3
|
+
import * as i2 from "@daffodil/search/routing";
|
|
4
|
+
import * as i3 from "@ngrx/effects";
|
|
5
|
+
export declare class DaffSearchProductRoutingModule {
|
|
6
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DaffSearchProductRoutingModule, never>;
|
|
7
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<DaffSearchProductRoutingModule, never, [typeof i1.DaffProductRoutingModule, typeof i2.DaffSearchRoutingModule, typeof i3.EffectsFeatureModule], never>;
|
|
8
|
+
static ɵinj: i0.ɵɵInjectorDeclaration<DaffSearchProductRoutingModule>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@daffodil/search-product/routing",
|
|
3
|
+
"module": "../fesm2015/daffodil-search-product-routing.mjs",
|
|
4
|
+
"es2020": "../fesm2020/daffodil-search-product-routing.mjs",
|
|
5
|
+
"esm2020": "../esm2020/routing/daffodil-search-product-routing.mjs",
|
|
6
|
+
"fesm2020": "../fesm2020/daffodil-search-product-routing.mjs",
|
|
7
|
+
"fesm2015": "../fesm2015/daffodil-search-product-routing.mjs",
|
|
8
|
+
"typings": "daffodil-search-product-routing.d.ts",
|
|
9
|
+
"sideEffects": false
|
|
10
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { DaffSearchProductRoutingModule } from './module';
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { DaffCollectionChangePageSize, DaffCollectionChangeCurrentPage, DaffCollectionChangeSortingOption } from '@daffodil/core/state';
|
|
2
|
+
import { DaffProductCollectionRequest, DaffProductFilterRequest, DaffProductFilterToggleRequest } from '@daffodil/product';
|
|
3
|
+
import { DaffProductCollectionReplaceFilters, DaffProductCollectionApplyFilters, DaffProductCollectionRemoveFilters, DaffProductCollectionToggleFilter, DaffProductCollectionClearFilters } from '@daffodil/product/state';
|
|
4
|
+
/**
|
|
5
|
+
* The search action types enum.
|
|
6
|
+
*/
|
|
7
|
+
export declare enum DaffSearchProductCollectionActionTypes {
|
|
8
|
+
SearchProductReplaceFiltersAction = "[@daffodil/search-product] Search Product Replace Filters Action",
|
|
9
|
+
SearchProductApplyFiltersAction = "[@daffodil/search-product] Search Product Apply Filters Action",
|
|
10
|
+
SearchProductRemoveFiltersAction = "[@daffodil/search-product] Search Product Remove Filters Action",
|
|
11
|
+
SearchProductClearFiltersAction = "[@daffodil/search-product] Search Product Clear Filters Action",
|
|
12
|
+
SearchProductToggleFiltersAction = "[@daffodil/search-product] Search Product Toggle Filters Action",
|
|
13
|
+
SearchProductChangePageSizeAction = "[@daffodil/search-product] Search Product Change Page Size Action",
|
|
14
|
+
SearchProductChangeCurrentPageAction = "[@daffodil/search-product] Search Product Change Current Page Action",
|
|
15
|
+
SearchProductChangeSortingOptionAction = "[@daffodil/search-product] Search Product Change Sorting Option Action"
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* @inheritdoc
|
|
19
|
+
*/
|
|
20
|
+
export declare class DaffSearchProductCollectionReplaceFilters implements DaffProductCollectionReplaceFilters {
|
|
21
|
+
filters: DaffProductFilterRequest[];
|
|
22
|
+
readonly type = DaffSearchProductCollectionActionTypes.SearchProductReplaceFiltersAction;
|
|
23
|
+
constructor(filters: DaffProductFilterRequest[]);
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* @inheritdoc
|
|
27
|
+
*/
|
|
28
|
+
export declare class DaffSearchProductCollectionApplyFilters implements DaffProductCollectionApplyFilters {
|
|
29
|
+
filters: DaffProductFilterRequest[];
|
|
30
|
+
readonly type = DaffSearchProductCollectionActionTypes.SearchProductApplyFiltersAction;
|
|
31
|
+
constructor(filters: DaffProductFilterRequest[]);
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* @inheritdoc
|
|
35
|
+
*/
|
|
36
|
+
export declare class DaffSearchProductCollectionRemoveFilters implements DaffProductCollectionRemoveFilters {
|
|
37
|
+
filters: DaffProductFilterRequest[];
|
|
38
|
+
readonly type = DaffSearchProductCollectionActionTypes.SearchProductRemoveFiltersAction;
|
|
39
|
+
constructor(filters: DaffProductFilterRequest[]);
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* @inheritdoc
|
|
43
|
+
*/
|
|
44
|
+
export declare class DaffSearchProductCollectionClearFilters implements DaffProductCollectionClearFilters {
|
|
45
|
+
readonly type = DaffSearchProductCollectionActionTypes.SearchProductClearFiltersAction;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* @inheritdoc
|
|
49
|
+
*/
|
|
50
|
+
export declare class DaffSearchProductCollectionToggleFilter implements DaffProductCollectionToggleFilter {
|
|
51
|
+
filter: DaffProductFilterToggleRequest;
|
|
52
|
+
readonly type = DaffSearchProductCollectionActionTypes.SearchProductToggleFiltersAction;
|
|
53
|
+
constructor(filter: DaffProductFilterToggleRequest);
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* @inheritdoc
|
|
57
|
+
*/
|
|
58
|
+
export declare class DaffSearchProductCollectionChangePageSize implements DaffCollectionChangePageSize {
|
|
59
|
+
pageSize: number;
|
|
60
|
+
readonly type = DaffSearchProductCollectionActionTypes.SearchProductChangePageSizeAction;
|
|
61
|
+
constructor(pageSize: number);
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* @inheritdoc
|
|
65
|
+
*/
|
|
66
|
+
export declare class DaffSearchProductCollectionChangeCurrentPage implements DaffCollectionChangeCurrentPage {
|
|
67
|
+
currentPage: number;
|
|
68
|
+
readonly type = DaffSearchProductCollectionActionTypes.SearchProductChangeCurrentPageAction;
|
|
69
|
+
constructor(currentPage: number);
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* @inheritdoc
|
|
73
|
+
*/
|
|
74
|
+
export declare class DaffSearchProductCollectionChangeSortingOption implements DaffCollectionChangeSortingOption {
|
|
75
|
+
sort: {
|
|
76
|
+
option: DaffProductCollectionRequest['appliedSortOption'];
|
|
77
|
+
direction: DaffProductCollectionRequest['appliedSortDirection'];
|
|
78
|
+
};
|
|
79
|
+
readonly type = DaffSearchProductCollectionActionTypes.SearchProductChangeSortingOptionAction;
|
|
80
|
+
constructor(sort: {
|
|
81
|
+
option: DaffProductCollectionRequest['appliedSortOption'];
|
|
82
|
+
direction: DaffProductCollectionRequest['appliedSortDirection'];
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* A union of the search product action types.
|
|
87
|
+
*/
|
|
88
|
+
export declare type DaffSearchProductCollectionActions = DaffSearchProductCollectionReplaceFilters | DaffSearchProductCollectionApplyFilters | DaffSearchProductCollectionRemoveFilters | DaffSearchProductCollectionClearFilters | DaffSearchProductCollectionToggleFilter | DaffSearchProductCollectionChangePageSize | DaffSearchProductCollectionChangeCurrentPage | DaffSearchProductCollectionChangeSortingOption;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import * as i1 from "@ngrx/store";
|
|
3
|
+
import * as i2 from "@daffodil/product/state";
|
|
4
|
+
import * as i3 from "@daffodil/search/state";
|
|
5
|
+
export declare class DaffSearchProductStateCoreModule {
|
|
6
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DaffSearchProductStateCoreModule, never>;
|
|
7
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<DaffSearchProductStateCoreModule, never, [typeof i1.StoreFeatureModule, typeof i2.DaffProductStateModule, typeof i3.DaffSearchStateModule], never>;
|
|
8
|
+
static ɵinj: i0.ɵɵInjectorDeclaration<DaffSearchProductStateCoreModule>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { Actions } from '@ngrx/effects';
|
|
2
|
+
import { ErrorTransformer } from '@daffodil/core/state';
|
|
3
|
+
import { DaffSearchProductResult } from '@daffodil/search-product';
|
|
4
|
+
import { DaffSearchProductDriverInterface } from '@daffodil/search-product/driver';
|
|
5
|
+
import { DaffSearchPageFacade, DaffSearchLoadFailure, DaffSearchLoadSuccess } from '@daffodil/search/state';
|
|
6
|
+
import { DaffSearchProductCollectionActionTypes } from '../actions/product-collection.actions';
|
|
7
|
+
import { DaffSearchProductCollectionFacade } from '../facades/public_api';
|
|
8
|
+
import * as i0 from "@angular/core";
|
|
9
|
+
export declare const DAFF_SEARCH_PRODUCT_COLLECTION_ACTION_TYPES: DaffSearchProductCollectionActionTypes[];
|
|
10
|
+
export declare class DaffSearchProductCollectionEffects<T extends DaffSearchProductResult = DaffSearchProductResult> {
|
|
11
|
+
private actions$;
|
|
12
|
+
private collectionFacade;
|
|
13
|
+
private searchFacade;
|
|
14
|
+
private driver;
|
|
15
|
+
private errorMatcher;
|
|
16
|
+
constructor(actions$: Actions, collectionFacade: DaffSearchProductCollectionFacade, searchFacade: DaffSearchPageFacade, driver: DaffSearchProductDriverInterface<T>, errorMatcher: ErrorTransformer);
|
|
17
|
+
/**
|
|
18
|
+
* Updates the product collection according to the action.
|
|
19
|
+
* It will take the request metedata, including currently
|
|
20
|
+
* applied filters, from state, form them into a request,
|
|
21
|
+
* and pass that into the {@link DaffProductCollectionDriverCall} provided to this class.
|
|
22
|
+
*
|
|
23
|
+
* @param throttleWindow the amount of time to delay when apply/removing filters
|
|
24
|
+
* in a sequence.
|
|
25
|
+
*/
|
|
26
|
+
update$: ((throttleWindow?: any, scheduler?: any) => import("rxjs").Observable<DaffSearchLoadFailure | DaffSearchLoadSuccess<T>>) & import("@ngrx/effects").CreateEffectMetadata;
|
|
27
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DaffSearchProductCollectionEffects<any>, never>;
|
|
28
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<DaffSearchProductCollectionEffects<any>>;
|
|
29
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Store } from '@ngrx/store';
|
|
2
|
+
import { DaffProductCollectionFacade, DaffProductCollectionFacadeInterface } from '@daffodil/product/state';
|
|
3
|
+
import { DaffSearchProductStateRootSlice } from '../../reducers/public_api';
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
export declare class DaffSearchProductCollectionFacade extends DaffProductCollectionFacade<DaffSearchProductStateRootSlice> implements DaffProductCollectionFacadeInterface {
|
|
6
|
+
constructor(store: Store<DaffSearchProductStateRootSlice>);
|
|
7
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DaffSearchProductCollectionFacade, never>;
|
|
8
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<DaffSearchProductCollectionFacade>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { DaffSearchProductFacadeInterface } from './search/search-facade.interface';
|
|
2
|
+
export { DaffSearchProductFacade } from './search/search.facade';
|
|
3
|
+
export { DaffSearchProductPageFacade } from './search/page.facade';
|
|
4
|
+
export { DaffSearchProductIncrementalFacade } from './search/incremental.facade';
|
|
5
|
+
export { DaffSearchProductCollectionFacade } from './collection/facade';
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Store } from '@ngrx/store';
|
|
2
|
+
import { DaffSearchProductStateRootSlice } from '../../reducers/public_api';
|
|
3
|
+
import { DaffSearchProductFacadeInterface } from './search-facade.interface';
|
|
4
|
+
import { DaffSearchProductFacade } from './search.facade';
|
|
5
|
+
import * as i0 from "@angular/core";
|
|
6
|
+
/**
|
|
7
|
+
* @inheritdoc
|
|
8
|
+
*
|
|
9
|
+
* A facade for the normal search state.
|
|
10
|
+
*/
|
|
11
|
+
export declare class DaffSearchProductIncrementalFacade extends DaffSearchProductFacade implements DaffSearchProductFacadeInterface {
|
|
12
|
+
constructor(store: Store<DaffSearchProductStateRootSlice>);
|
|
13
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DaffSearchProductIncrementalFacade, never>;
|
|
14
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<DaffSearchProductIncrementalFacade>;
|
|
15
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Store } from '@ngrx/store';
|
|
2
|
+
import { DaffSearchProductStateRootSlice } from '../../reducers/public_api';
|
|
3
|
+
import { DaffSearchProductFacadeInterface } from './search-facade.interface';
|
|
4
|
+
import { DaffSearchProductFacade } from './search.facade';
|
|
5
|
+
import * as i0 from "@angular/core";
|
|
6
|
+
/**
|
|
7
|
+
* @inheritdoc
|
|
8
|
+
*
|
|
9
|
+
* A facade for the normal search state.
|
|
10
|
+
*/
|
|
11
|
+
export declare class DaffSearchProductPageFacade extends DaffSearchProductFacade implements DaffSearchProductFacadeInterface {
|
|
12
|
+
constructor(store: Store<DaffSearchProductStateRootSlice>);
|
|
13
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DaffSearchProductPageFacade, never>;
|
|
14
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<DaffSearchProductPageFacade>;
|
|
15
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Action } from '@ngrx/store';
|
|
2
|
+
import { Observable } from 'rxjs';
|
|
3
|
+
import { DaffStoreFacade } from '@daffodil/core/state';
|
|
4
|
+
import { DaffProduct } from '@daffodil/product';
|
|
5
|
+
/**
|
|
6
|
+
* Exposes the search state selectors.
|
|
7
|
+
*/
|
|
8
|
+
export interface DaffSearchProductFacadeInterface extends DaffStoreFacade<Action> {
|
|
9
|
+
/**
|
|
10
|
+
* The products returned in the most recent search.
|
|
11
|
+
*/
|
|
12
|
+
productResults$: Observable<DaffProduct[]>;
|
|
13
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Action, Store } from '@ngrx/store';
|
|
2
|
+
import { Observable } from 'rxjs';
|
|
3
|
+
import { DaffProduct } from '@daffodil/product';
|
|
4
|
+
import { DaffSearchProductStateRootSlice } from '../../reducers/public_api';
|
|
5
|
+
import { DaffSearchProductSelectors } from '../../selectors/public_api';
|
|
6
|
+
import { DaffSearchProductFacadeInterface } from './search-facade.interface';
|
|
7
|
+
/**
|
|
8
|
+
* @inheritdoc
|
|
9
|
+
*/
|
|
10
|
+
export declare abstract class DaffSearchProductFacade implements DaffSearchProductFacadeInterface {
|
|
11
|
+
private store;
|
|
12
|
+
productResults$: Observable<DaffProduct[]>;
|
|
13
|
+
constructor(store: Store<DaffSearchProductStateRootSlice>, selectors: DaffSearchProductSelectors);
|
|
14
|
+
dispatch(action: Action): void;
|
|
15
|
+
}
|
package/state/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './public_api';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@daffodil/search-product/state",
|
|
3
|
+
"module": "../fesm2015/daffodil-search-product-state.mjs",
|
|
4
|
+
"es2020": "../fesm2020/daffodil-search-product-state.mjs",
|
|
5
|
+
"esm2020": "../esm2020/state/daffodil-search-product-state.mjs",
|
|
6
|
+
"fesm2020": "../fesm2020/daffodil-search-product-state.mjs",
|
|
7
|
+
"fesm2015": "../fesm2015/daffodil-search-product-state.mjs",
|
|
8
|
+
"typings": "daffodil-search-product-state.d.ts",
|
|
9
|
+
"sideEffects": false
|
|
10
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import * as i1 from "./core.module";
|
|
3
|
+
import * as i2 from "@daffodil/search/state";
|
|
4
|
+
import * as i3 from "@ngrx/effects";
|
|
5
|
+
export declare class DaffSearchProductPageStateModule {
|
|
6
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DaffSearchProductPageStateModule, never>;
|
|
7
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<DaffSearchProductPageStateModule, never, [typeof i1.DaffSearchProductStateCoreModule, typeof i2.DaffSearchPageStateModule, typeof i3.EffectsFeatureModule], never>;
|
|
8
|
+
static ɵinj: i0.ɵɵInjectorDeclaration<DaffSearchProductPageStateModule>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export * from './reducers/public_api';
|
|
2
|
+
export * from './selectors/public_api';
|
|
3
|
+
export * from './facades/public_api';
|
|
4
|
+
export * from './actions/product-collection.actions';
|
|
5
|
+
export { DaffSearchProductStateModule } from './state.module';
|
|
6
|
+
export { DaffSearchProductPageStateModule } from './page.module';
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { DaffProductCollectionReducerState } from '@daffodil/product/state';
|
|
2
|
+
import { DaffSearchActions } from '@daffodil/search/state';
|
|
3
|
+
import { DaffSearchProductCollectionActions } from '../../actions/product-collection.actions';
|
|
4
|
+
export declare const daffSearchProductCollectionReducer: (state: DaffProductCollectionReducerState, action: DaffSearchActions | DaffSearchProductCollectionActions) => DaffProductCollectionReducerState;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { DaffSearchReducerState } from '@daffodil/search/state';
|
|
2
|
+
import { DaffSearchProductCollectionActions } from '../../actions/product-collection.actions';
|
|
3
|
+
/**
|
|
4
|
+
* The reducer for handling apply product filters actions in the main search state.
|
|
5
|
+
*/
|
|
6
|
+
export declare function daffSearchProductCollectionSearchReducer(state: DaffSearchReducerState<import("@daffodil/search").DaffSearchResult>, action: DaffSearchProductCollectionActions): DaffSearchReducerState;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { EntityState } from '@ngrx/entity';
|
|
2
|
+
import { DaffSearchProductResult } from '@daffodil/search-product';
|
|
3
|
+
import { DaffSearchActions } from '@daffodil/search/state';
|
|
4
|
+
/**
|
|
5
|
+
* Reducer function that catches actions and changes/overwrites search entities state.
|
|
6
|
+
*/
|
|
7
|
+
export declare function daffSearchProductEntitiesReducer<T extends DaffSearchProductResult = DaffSearchProductResult>(state: EntityState<T>, action: DaffSearchActions<T>): EntityState<T>;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { daffSearchProductReducers } from './reducers';
|
|
2
|
+
export { DaffSearchProductReducersState, DaffSearchProductStateRootSlice, } from './reducers.interface';
|
|
3
|
+
export { DAFF_SEARCH_PRODUCT_STORE_FEATURE_KEY } from './store-feature-key';
|
|
4
|
+
export * from './collection/public_api';
|
|
5
|
+
export * from './product/public_api';
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { ActionReducerMap } from '@ngrx/store';
|
|
2
|
+
import { DaffSearchProductReducersState } from './reducers.interface';
|
|
3
|
+
/**
|
|
4
|
+
* The reducers for the entire search feature state.
|
|
5
|
+
*/
|
|
6
|
+
export declare const daffSearchProductReducers: ActionReducerMap<DaffSearchProductReducersState>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { DaffProductStateRootSlice, DaffProductCollectionReducerState } from '@daffodil/product/state';
|
|
2
|
+
import { DaffSearchStateRootSlice } from '@daffodil/search/state';
|
|
3
|
+
import { DAFF_SEARCH_PRODUCT_STORE_FEATURE_KEY } from './store-feature-key';
|
|
4
|
+
/**
|
|
5
|
+
* The feature state for search.
|
|
6
|
+
*/
|
|
7
|
+
export interface DaffSearchProductReducersState {
|
|
8
|
+
productCollection: DaffProductCollectionReducerState;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* The footprint of search feature state in the root application state.
|
|
12
|
+
*/
|
|
13
|
+
export interface DaffSearchProductStateRootSlice extends DaffSearchStateRootSlice, DaffProductStateRootSlice {
|
|
14
|
+
[DAFF_SEARCH_PRODUCT_STORE_FEATURE_KEY]: DaffSearchProductReducersState;
|
|
15
|
+
}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { DaffProductCollectionMemoizedSelectors } from '@daffodil/product/state';
|
|
2
|
+
import { DaffSearchProductStateRootSlice } from '../../reducers/public_api';
|
|
3
|
+
export declare const getSearchProductCollectionSelectors: () => DaffProductCollectionMemoizedSelectors<DaffSearchProductStateRootSlice>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { MemoizedSelector } from '@ngrx/store';
|
|
2
|
+
import { DaffSearchProductStateRootSlice, DaffSearchProductReducersState } from '../reducers/public_api';
|
|
3
|
+
/**
|
|
4
|
+
* Selector for the search product feature state.
|
|
5
|
+
*/
|
|
6
|
+
export interface DaffSearchProductFeatureSelector {
|
|
7
|
+
selectSearchProductFeatureState: MemoizedSelector<DaffSearchProductStateRootSlice, DaffSearchProductReducersState>;
|
|
8
|
+
}
|
|
9
|
+
export declare const getDaffSearchProductReducersStateSelector: () => DaffSearchProductFeatureSelector;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { MemoizedSelector } from '@ngrx/store';
|
|
2
|
+
import { DaffProduct } from '@daffodil/product';
|
|
3
|
+
import { DaffSearchProductResult } from '@daffodil/search-product';
|
|
4
|
+
import { DaffSearchSelectors } from '@daffodil/search/state';
|
|
5
|
+
import { DaffSearchProductStateRootSlice } from '../reducers/public_api';
|
|
6
|
+
/**
|
|
7
|
+
* Selectors for product results on a search page.
|
|
8
|
+
*/
|
|
9
|
+
export interface DaffSearchProductSelectors {
|
|
10
|
+
/**
|
|
11
|
+
* Select the product search result IDs from the main search state.
|
|
12
|
+
*/
|
|
13
|
+
selectProductResultIds: MemoizedSelector<DaffSearchProductStateRootSlice, DaffSearchProductResult['id'][]>;
|
|
14
|
+
/**
|
|
15
|
+
* Select the product search results from the main product state.
|
|
16
|
+
*/
|
|
17
|
+
selectProductResults: MemoizedSelector<DaffSearchProductStateRootSlice, DaffProduct[]>;
|
|
18
|
+
}
|
|
19
|
+
export declare const daffSearchProductCreateSelectors: (selectSearchResultIds: DaffSearchSelectors['selectSearchResultIds']) => {
|
|
20
|
+
selectProductResultIds: MemoizedSelector<import("@daffodil/search/state").DaffSearchStateRootSlice<import("@daffodil/search").DaffSearchResult>, string[], import("@ngrx/store").DefaultProjectorFn<string[]>>;
|
|
21
|
+
selectProductResults: MemoizedSelector<DaffSearchProductStateRootSlice, DaffProduct[], import("@ngrx/store").DefaultProjectorFn<DaffProduct[]>>;
|
|
22
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import * as i1 from "./core.module";
|
|
3
|
+
export declare class DaffSearchProductStateModule {
|
|
4
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DaffSearchProductStateModule, never>;
|
|
5
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<DaffSearchProductStateModule, never, [typeof i1.DaffSearchProductStateCoreModule], never>;
|
|
6
|
+
static ɵinj: i0.ɵɵInjectorDeclaration<DaffSearchProductStateModule>;
|
|
7
|
+
}
|