@daffodil/product-composite 0.78.0 → 0.80.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/esm2022/driver/in-memory/in-memory.module.mjs +3 -7
- package/esm2022/driver/magento/composite-product-driver.module.mjs +5 -5
- package/esm2022/driver/testing/testing.module.mjs +3 -7
- package/esm2022/routing/config/default.mjs +4 -1
- package/esm2022/routing/config/public_api.mjs +3 -3
- package/esm2022/routing/config/token.mjs +6 -16
- package/esm2022/routing/module.mjs +4 -11
- package/esm2022/state/reducers/injection-tokens/extra.token.mjs +5 -10
- package/esm2022/state/reducers/injection-tokens/reducers.token.mjs +9 -3
- package/fesm2022/daffodil-product-composite-driver-in-memory.mjs +2 -6
- package/fesm2022/daffodil-product-composite-driver-in-memory.mjs.map +1 -1
- package/fesm2022/daffodil-product-composite-driver-magento.mjs +4 -4
- package/fesm2022/daffodil-product-composite-driver-magento.mjs.map +1 -1
- package/fesm2022/daffodil-product-composite-driver-testing.mjs +2 -6
- package/fesm2022/daffodil-product-composite-driver-testing.mjs.map +1 -1
- package/fesm2022/daffodil-product-composite-routing.mjs +7 -21
- package/fesm2022/daffodil-product-composite-routing.mjs.map +1 -1
- package/fesm2022/daffodil-product-composite-state.mjs +11 -11
- package/fesm2022/daffodil-product-composite-state.mjs.map +1 -1
- package/package.json +1 -1
- package/routing/config/default.d.ts +2 -0
- package/routing/config/public_api.d.ts +2 -2
- package/routing/config/token.d.ts +1 -9
- package/state/reducers/injection-tokens/extra.token.d.ts +1 -20
- package/state/reducers/injection-tokens/reducers.token.d.ts +1 -7
@@ -1,6 +1,6 @@
|
|
1
1
|
import { CommonModule } from '@angular/common';
|
2
2
|
import { NgModule, } from '@angular/core';
|
3
|
-
import {
|
3
|
+
import { provideDaffProductExtraFactoryTypes } from '@daffodil/product/testing';
|
4
4
|
import { DaffCompositeProductFactory } from '@daffodil/product-composite/testing';
|
5
5
|
import * as i0 from "@angular/core";
|
6
6
|
/**
|
@@ -11,11 +11,7 @@ export class DaffCompositeProductInMemoryDriverModule {
|
|
11
11
|
return {
|
12
12
|
ngModule: DaffCompositeProductInMemoryDriverModule,
|
13
13
|
providers: [
|
14
|
-
|
15
|
-
provide: DAFF_PRODUCT_TYPE_FACTORIES,
|
16
|
-
useExisting: DaffCompositeProductFactory,
|
17
|
-
multi: true,
|
18
|
-
},
|
14
|
+
provideDaffProductExtraFactoryTypes(DaffCompositeProductFactory),
|
19
15
|
],
|
20
16
|
};
|
21
17
|
}
|
@@ -31,4 +27,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.2", ngImpor
|
|
31
27
|
],
|
32
28
|
}]
|
33
29
|
}] });
|
34
|
-
//# sourceMappingURL=data:application/json;base64,
|
30
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW4tbWVtb3J5Lm1vZHVsZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uL2xpYnMvcHJvZHVjdC1jb21wb3NpdGUvZHJpdmVyL2luLW1lbW9yeS9zcmMvaW4tbWVtb3J5Lm1vZHVsZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsWUFBWSxFQUFFLE1BQU0saUJBQWlCLENBQUM7QUFDL0MsT0FBTyxFQUNMLFFBQVEsR0FFVCxNQUFNLGVBQWUsQ0FBQztBQUV2QixPQUFPLEVBQUUsbUNBQW1DLEVBQUUsTUFBTSwyQkFBMkIsQ0FBQztBQUNoRixPQUFPLEVBQUUsMkJBQTJCLEVBQUUsTUFBTSxxQ0FBcUMsQ0FBQzs7QUFFbEY7O0dBRUc7QUFNSCxNQUFNLE9BQU8sd0NBQXdDO0lBQ25ELE1BQU0sQ0FBQyxPQUFPO1FBQ1osT0FBTztZQUNMLFFBQVEsRUFBRSx3Q0FBd0M7WUFDbEQsU0FBUyxFQUFFO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gICByZXR1cm4ge1xuICAgICAgbmdNb2R1bGU6IERhZmZDb21wb3NpdGVQcm9kdWN0SW5NZW1vcnlEcml2ZXJNb2R1bGUsXG4gICAgICBwcm92aWRlcnM6IFtcbiAgICAgICAgcHJvdmlkZURhZmZQcm9kdWN0RXh0cmFGYWN0b3J5VHlwZXMoRGFmZkNvbXBvc2l0ZVByb2R1Y3RGYWN0b3J5KSxcbiAgICAgIF0sXG4gICAgfTtcbiAgfVxufVxuIl19
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { CommonModule } from '@angular/common';
|
2
2
|
import { NgModule, } from '@angular/core';
|
3
|
-
import {
|
3
|
+
import { provideDaffProductMagentoExtraProductTransforms, MagentoProductTypeEnum, provideDaffProductMagentoExtraProductFragments, provideDaffProductMagentoExtraProductPreviewTransforms, } from '@daffodil/product/driver/magento';
|
4
4
|
import { magentoBundledProductFragment } from './fragments/bundled-product';
|
5
5
|
import { transformMagentoBundledProduct } from './transforms/bundled-product-transformers';
|
6
6
|
import * as i0 from "@angular/core";
|
@@ -12,12 +12,12 @@ export class DaffCompositeProductMagentoDriverModule {
|
|
12
12
|
return {
|
13
13
|
ngModule: DaffCompositeProductMagentoDriverModule,
|
14
14
|
providers: [
|
15
|
-
...
|
16
|
-
...
|
15
|
+
...provideDaffProductMagentoExtraProductFragments(magentoBundledProductFragment),
|
16
|
+
...provideDaffProductMagentoExtraProductTransforms((daffProduct, magentoProduct) => magentoProduct.__typename === MagentoProductTypeEnum.BundledProduct
|
17
17
|
? transformMagentoBundledProduct(daffProduct, magentoProduct)
|
18
18
|
: daffProduct),
|
19
19
|
// stub out composite fields for a preview
|
20
|
-
...
|
20
|
+
...provideDaffProductMagentoExtraProductPreviewTransforms((daffProduct, magentoProduct) => magentoProduct.__typename === MagentoProductTypeEnum.BundledProduct
|
21
21
|
? {
|
22
22
|
...daffProduct,
|
23
23
|
items: [],
|
@@ -43,4 +43,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: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gICAgICBhbW91bnQ6IDAsXG4gICAgICAgICAgICAgICAgICBwZXJjZW50OiAwLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgOiBkYWZmUHJvZHVjdCxcbiAgICAgICAgKSxcbiAgICAgIF0sXG4gICAgfTtcbiAgfVxufVxuIl19
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { CommonModule } from '@angular/common';
|
2
2
|
import { NgModule, } from '@angular/core';
|
3
|
-
import {
|
3
|
+
import { provideDaffProductExtraFactoryTypes } from '@daffodil/product/testing';
|
4
4
|
import { DaffCompositeProductFactory } from '@daffodil/product-composite/testing';
|
5
5
|
import * as i0 from "@angular/core";
|
6
6
|
/**
|
@@ -11,11 +11,7 @@ export class DaffCompositeProductTestingDriverModule {
|
|
11
11
|
return {
|
12
12
|
ngModule: DaffCompositeProductTestingDriverModule,
|
13
13
|
providers: [
|
14
|
-
|
15
|
-
provide: DAFF_PRODUCT_TYPE_FACTORIES,
|
16
|
-
useExisting: DaffCompositeProductFactory,
|
17
|
-
multi: true,
|
18
|
-
},
|
14
|
+
provideDaffProductExtraFactoryTypes(DaffCompositeProductFactory),
|
19
15
|
],
|
20
16
|
};
|
21
17
|
}
|
@@ -31,4 +27,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.2", ngImpor
|
|
31
27
|
],
|
32
28
|
}]
|
33
29
|
}] });
|
34
|
-
//# sourceMappingURL=data:application/json;base64,
|
30
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGVzdGluZy5tb2R1bGUuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi9saWJzL3Byb2R1Y3QtY29tcG9zaXRlL2RyaXZlci90ZXN0aW5nL3NyYy90ZXN0aW5nLm1vZHVsZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFP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Zm9yIHByb3ZpZGluZyB0aGUgY29tcG9zaXRlIHByb2R1Y3QgZmFjdG9yeSB0byB0aGUgcHJvZHVjdCBraW5kIGZhY3RvcnkuXG4gKi9cbkBOZ01vZHVsZSh7XG4gIGltcG9ydHM6IFtcbiAgICBDb21tb25Nb2R1bGUsXG4gIF0sXG59KVxuZXhwb3J0IGNsYXNzIERhZmZDb21wb3NpdGVQcm9kdWN0VGVzdGluZ0RyaXZlck1vZHVsZSB7XG4gIHN0YXRpYyBmb3JSb290KCk6IE1vZHVsZVdpdGhQcm92aWRlcnM8RGFmZkNvbXBvc2l0ZVByb2R1Y3RUZXN0aW5nRHJpdmVyTW9kdWxlPiB7XG4gICAgcmV0dXJuIHtcbiAgICAgIG5nTW9kdWxlOiBEYWZmQ29tcG9zaXRlUHJvZHVjdFRlc3RpbmdEcml2ZXJNb2R1bGUsXG4gICAgICBwcm92aWRlcnM6IFtcbiAgICAgICAgcHJvdmlkZURhZmZQcm9kdWN0RXh0cmFGYWN0b3J5VHlwZXMoRGFmZkNvbXBvc2l0ZVByb2R1Y3RGYWN0b3J5KSxcbiAgICAgIF0sXG4gICAgfTtcbiAgfVxufVxuIl19
|
@@ -1,3 +1,5 @@
|
|
1
|
+
import { InjectionToken, inject, } from '@angular/core';
|
2
|
+
import { DaffBase64ServiceToken, } from '@daffodil/core';
|
1
3
|
/**
|
2
4
|
* The default configuration for the {@link DaffProductCompositeRoutingConfig}.
|
3
5
|
*/
|
@@ -5,4 +7,5 @@ export const daffProductCompositeRoutingConfigDefaultFactory = (base64) => ({
|
|
5
7
|
compositeSelectionQueryParam: 'composite_selection',
|
6
8
|
compositeSelectionQueryParamDecode: (queryParam) => JSON.parse(base64.decode(queryParam)),
|
7
9
|
});
|
8
|
-
|
10
|
+
export const DAFF_PRODUCT_COMPOSITE_ROUTING_CONFIG_DEFAULT = new InjectionToken('DAFF_PRODUCT_COMPOSITE_ROUTING_CONFIG_DEFAULT', { factory: () => daffProductCompositeRoutingConfigDefaultF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@
|
|
1
|
-
export
|
2
|
-
export
|
3
|
-
//# sourceMappingURL=data:application/json;base64,
|
1
|
+
export * from './default';
|
2
|
+
export * from './token';
|
3
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHVibGljX2FwaS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uL2xpYnMvcHJvZHVjdC1jb21wb3NpdGUvcm91dGluZy9zcmMvY29uZmlnL3B1YmxpY19hcGkudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsY0FBYyxXQUFXLENBQUM7QUFFMUIsY0FBYyxTQUFTLENBQUMiLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnQgKiBmcm9tICcuL2RlZmF1bHQnO1xuZXhwb3J0IHsgRGFmZlByb2R1Y3RDb21wb3NpdGVSb3V0aW5nQ29uZmlnIH0gZnJvbSAnLi9pbnRlcmZhY2UnO1xuZXhwb3J0ICogZnJvbSAnLi90b2tlbic7XG4iXX0=
|
@@ -1,22 +1,12 @@
|
|
1
|
-
import {
|
2
|
-
import {
|
3
|
-
|
1
|
+
import { createConfigInjectionToken } from '@daffodil/core';
|
2
|
+
import { DAFF_PRODUCT_COMPOSITE_ROUTING_CONFIG_DEFAULT } from './default';
|
3
|
+
export const {
|
4
4
|
/**
|
5
5
|
* The token used to provide @daffodil/product-composite/routing config data.
|
6
6
|
*/
|
7
|
-
|
8
|
-
factory: () => daffProductCompositeRoutingConfigDefaultFactory(inject(DaffBase64ServiceToken)),
|
9
|
-
});
|
7
|
+
token: DAFF_PRODUCT_COMPOSITE_ROUTING_CONFIG,
|
10
8
|
/**
|
11
9
|
* Provides the {@link DAFF_PRODUCT_COMPOSITE_ROUTING_CONFIG} token.
|
12
10
|
*/
|
13
|
-
|
14
|
-
|
15
|
-
provide: DAFF_PRODUCT_COMPOSITE_ROUTING_CONFIG,
|
16
|
-
useFactory: () => ({
|
17
|
-
...daffProductCompositeRoutingConfigDefaultFactory(inject(DaffBase64ServiceToken)),
|
18
|
-
...config,
|
19
|
-
}),
|
20
|
-
};
|
21
|
-
}
|
22
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidG9rZW4uanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi9saWJzL3Byb2R1Y3QtY29tcG9zaXRlL3JvdXRpbmcvc3JjL2NvbmZpZy90b2tlbi50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBRUwsTUFBTSxFQUNOLGNBQWMsR0FDZixNQUFNLGVBQWUsQ0FBQztBQUV2QixPQUFPLEVBQUUsc0JBQXNCLEVBQUUsTUFBTSxnQkFBZ0IsQ0FBQztBQUV4RCxPQUFPLEVBQUUsK0NBQStDLEVBQUUsTUFBTSxXQUFXLENBQUM7QUFHNUU7O0dBRUc7QUFDSCxNQUFNLENBQUMsTUFBTSxxQ0FBcUMsR0FBRyxJQUFJLGNBQWMsQ0FBb0MsdUNBQXVDLEVBQUU7SUFDbEosT0FBTyxFQUFFLEdBQUcsRUFBRSxDQUFDLCtDQUErQyxDQUFDLE1BQU0sQ0FBQyxzQkFBc0IsQ0FBQyxDQUFDO0NBQy9GLENBQUMsQ0FBQztBQUVIOztHQUVHO0FBQ0gsTUFBTSxVQUFVLHdDQUF3QyxDQUFDLE1BQWtEO0lBQ3pHLE9BQU87UUFDTCxPQUFPLEVBQUUscUNBQXFDO1FBQzlDLFVBQVUsRUFBRSxHQUFHLEVBQUUsQ0FBQyxDQUFDO1lBQ2pCLEdBQUcsK0NBQStDLENBQUMsTUFBTSxDQUFDLHNCQUFzQixDQUFDLENBQUM7WUFDbEYsR0FBRyxNQUFNO1NBQ1YsQ0FBQztLQUNILENBQUM7QUFDSixDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHtcbiAgRmFjdG9yeVByb3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Y3RvcnlQcm92aWRlciB7XG4gIHJldHVybiB7XG4gICAgcHJvdmlkZTogREFGRl9QUk9EVUNUX0NPTVBPU0lURV9ST1VUSU5HX0NPTkZJRyxcbiAgICB1c2VGYWN0b3J5OiAoKSA9PiAoe1xuICAgICAgLi4uZGFmZlByb2R1Y3RDb21wb3NpdGVSb3V0aW5nQ29uZmlnRGVmYXVsdEZhY3RvcnkoaW5qZWN0KERhZmZCYXNlNjRTZXJ2aWNlVG9rZW4pKSxcbiAgICAgIC4uLmNvbmZpZyxcbiAgICB9KSxcbiAgfTtcbn1cbiJdfQ==
|
11
|
+
provider: provideDaffProductCompositeRoutingConfig, } = createConfigInjectionToken(DAFF_PRODUCT_COMPOSITE_ROUTING_CONFIG_DEFAULT, 'DAFF_PRODUCT_COMPOSITE_ROUTING_CONFIG');
|
12
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidG9rZW4uanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi9saWJzL3Byb2R1Y3QtY29tcG9zaXRlL3JvdXRpbmcvc3JjL2NvbmZpZy90b2tlbi50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsMEJBQTBCLEVBQUUsTUFBTSxnQkFBZ0IsQ0FBQztBQUU1RCxPQUFPLEVBQUUsNkNBQTZDLEVBQUUsTUFBTSxXQUFXLENBQUM7QUFHMUUsTUFBTSxDQUFDLE1BQU07QUFDWDs7R0FFRztBQUNILEtBQUssRUFBRSxxQ0FBcUM7QUFDNUM7O0dBRUc7QUFDSCxRQUFRLEVBQUUsd0NBQXdDLEdBQ25ELEdBQUcsMEJBQTBCLENBQW9DLDZDQUE2QyxFQUFFLHVDQUF1QyxDQUFDLENBQUMiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyBjcmVhdGVDb25maWdJbmplY3Rpb25Ub2tlbiB9IGZyb20gJ0BkYWZmb2RpbC9jb3JlJztcblxuaW1wb3J0IHsgREFGRl9QUk9EVUNUX0NPTVBPU0lURV9ST1VUSU5HX0NPTkZJR19ERUZBVUxUIH0gZnJvbSAnLi9kZWZhdWx0JztcbmltcG9ydCB7IERhZmZQcm9kdWN0Q29tcG9zaXRlUm91dGluZ0NvbmZpZyB9IGZyb20gJy4vaW50ZXJmYWNlJztcblxuZXhwb3J0IGNvbnN0IHtcbiAgLyoqXG4gICAqIFRoZSB0b2tlbiB1c2VkIHRvIHByb3ZpZGUgQGRhZmZvZGlsL3Byb2R1Y3QtY29tcG9zaXRlL3JvdXRpbmcgY29uZmlnIGRhdGEuXG4gICAqL1xuICB0b2tlbjogREFGRl9QUk9EVUNUX0NPTVBPU0lURV9ST1VUSU5HX0NPTkZJRyxcbiAgLyoqXG4gICAqIFByb3ZpZGVzIHRoZSB7QGxpbmsgREFGRl9QUk9EVUNUX0NPTVBPU0lURV9ST1VUSU5HX0NPTkZJR30gdG9rZW4uXG4gICAqL1xuICBwcm92aWRlcjogcHJvdmlkZURhZmZQcm9kdWN0Q29tcG9zaXRlUm91dGluZ0NvbmZpZyxcbn0gPSBjcmVhdGVDb25maWdJbmplY3Rpb25Ub2tlbjxEYWZmUHJvZHVjdENvbXBvc2l0ZVJvdXRpbmdDb25maWc+KERBRkZfUFJPRFVDVF9DT01QT1NJVEVfUk9VVElOR19DT05GSUdfREVGQVVMVCwgJ0RBRkZfUFJPRFVDVF9DT01QT1NJVEVfUk9VVElOR19DT05GSUcnKTtcbiJdfQ==
|
@@ -1,7 +1,6 @@
|
|
1
|
-
import {
|
1
|
+
import { NgModule, } from '@angular/core';
|
2
2
|
import { EffectsModule } from '@ngrx/effects';
|
3
|
-
import {
|
4
|
-
import { daffProductCompositeRoutingConfigDefaultFactory, DAFF_PRODUCT_COMPOSITE_ROUTING_CONFIG, } from './config/public_api';
|
3
|
+
import { provideDaffProductCompositeRoutingConfig, } from './config/public_api';
|
5
4
|
import { DaffProductCompositePageEffects } from './effects/public_api';
|
6
5
|
import { DaffProductCompositeQueryParamService } from './services/query-param.service';
|
7
6
|
import * as i0 from "@angular/core";
|
@@ -11,13 +10,7 @@ export class DaffProductCompositeRoutingModule {
|
|
11
10
|
return {
|
12
11
|
ngModule: DaffProductCompositeRoutingModule,
|
13
12
|
providers: [
|
14
|
-
|
15
|
-
provide: DAFF_PRODUCT_COMPOSITE_ROUTING_CONFIG,
|
16
|
-
useFactory: () => ({
|
17
|
-
...daffProductCompositeRoutingConfigDefaultFactory(inject(DaffBase64ServiceToken)),
|
18
|
-
...config || {},
|
19
|
-
}),
|
20
|
-
},
|
13
|
+
provideDaffProductCompositeRoutingConfig(config),
|
21
14
|
],
|
22
15
|
};
|
23
16
|
}
|
@@ -38,4 +31,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.2", ngImpor
|
|
38
31
|
],
|
39
32
|
}]
|
40
33
|
}] });
|
41
|
-
//# sourceMappingURL=data:application/json;base64,
|
34
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibW9kdWxlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vbGlicy9wcm9kdWN0LWNvbXBvc2l0ZS9yb3V0aW5nL3NyYy9tb2R1bGUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUVMLFFBQVEsR0FDVCxNQUFNLGVBQWUsQ0FBQztBQUN2QixPQUFPLEVBQUUsYUFBYSxFQUFFLE1BQU0sZUFBZSxDQUFDO0FBRTlDLE9BQU8sRUFFTCx3Q0FBd0MsR0FDekMsTUFBTSxxQkFBcUIsQ0FBQztBQUM3QixPQUFPLEVBQUUsK0JBQStCLEVBQUUsTUFBTSxzQkFBc0IsQ0FBQztBQUN2RSxPQUFPLEVBQUUscUNBQXFDLEVBQUUsTUFBTSxnQ0FBZ0MsQ0FBQzs7O0FBVXZGLE1BQU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mFtU2VydmljZSB9IGZyb20gJy4vc2VydmljZXMvcXVlcnktcGFyYW0uc2VydmljZSc7XG5cbkBOZ01vZHVsZSh7XG4gIGltcG9ydHM6IFtcbiAgICBFZmZlY3RzTW9kdWxlLmZvckZlYXR1cmUoW0RhZmZQcm9kdWN0Q29tcG9zaXRlUGFnZUVmZmVjdHNdKSxcbiAgXSxcbiAgcHJvdmlkZXJzOiBbXG4gICAgRGFmZlByb2R1Y3RDb21wb3NpdGVRdWVyeVBhcmFtU2VydmljZSxcbiAgXSxcbn0pXG5leHBvcnQgY2xhc3MgRGFmZlByb2R1Y3RDb21wb3NpdGVSb3V0aW5nTW9kdWxlIHtcbiAgc3RhdGljIHdpdGhDb25maWcoY29uZmlnPzogRGFmZlByb2R1Y3RDb21wb3NpdGVSb3V0aW5nQ29uZmlnKTogTW9kdWxlV2l0aFByb3ZpZGVyczxEYWZmUHJvZHVjdENvbXBvc2l0ZVJvdXRpbmdNb2R1bGU+IHtcbiAgICByZXR1cm4ge1xuICAgICAgbmdNb2R1bGU6IERhZmZQcm9kdWN0Q29tcG9zaXRlUm91dGluZ01vZHVsZSxcbiAgICAgIHByb3ZpZGVyczogW1xuICAgICAgICBwcm92aWRlRGFmZlByb2R1Y3RDb21wb3NpdGVSb3V0aW5nQ29uZmlnKGNvbmZpZyksXG4gICAgICBdLFxuICAgIH07XG4gIH1cbn1cbiJdfQ==
|
@@ -1,10 +1,11 @@
|
|
1
|
-
import {
|
1
|
+
import { createMultiInjectionToken } from '@daffodil/core';
|
2
|
+
export const {
|
2
3
|
/**
|
3
4
|
* A token to hold the injectable extra reducers.
|
4
5
|
*
|
5
6
|
* Prefer using {@link daffProductCompositeProvideExtraReducers}.
|
6
7
|
*/
|
7
|
-
|
8
|
+
token: DAFF_PRODUCT_COMPOSITE_EXTRA_REDUCERS,
|
8
9
|
/**
|
9
10
|
* Provides additional reducers that run after the standard Daffodil cart reducers.
|
10
11
|
*
|
@@ -17,11 +18,5 @@ export const DAFF_PRODUCT_COMPOSITE_EXTRA_REDUCERS = new InjectionToken('DAFF_PR
|
|
17
18
|
* ]
|
18
19
|
* ```
|
19
20
|
*/
|
20
|
-
|
21
|
-
|
22
|
-
provide: DAFF_PRODUCT_COMPOSITE_EXTRA_REDUCERS,
|
23
|
-
useValue: reducer,
|
24
|
-
multi: true,
|
25
|
-
}));
|
26
|
-
}
|
27
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZXh0cmEudG9rZW4uanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi9saWJzL3Byb2R1Y3QtY29tcG9zaXRlL3N0YXRlL3NyYy9yZWR1Y2Vycy9pbmplY3Rpb24tdG9rZW5zL2V4dHJhLnRva2VuLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFDTCxjQUFjLEdBRWYsTUFBTSxlQUFlLENBQUM7QUFLdkI7Ozs7R0FJRztBQUNILE1BQU0sQ0FBQyxNQUFNLHFDQUFxQyxHQUFHLElBQUksY0FBYyxDQUNyRSx1Q0FBdUMsRUFDdkMsRUFBRSxPQUFPLEVBQUUsR0FBRyxFQUFFLENBQUMsRUFBRSxFQUFDLENBQ3JCLENBQUM7QUFFRjs7Ozs7Ozs7Ozs7R0FXRztBQUNILE1BQU0sVUFBVSx3Q0FBd0MsQ0FDdEQsR0FBRyxRQUFxRTtJQUV4RSxPQUFPLFFBQVEsQ0FBQyxHQUFHLENBQUMsT0FBTyxDQUFDLEVBQUUsQ0FBQyxDQUFDO1FBQzlCLE9BQU8sRUFBRSxxQ0FBcUM7UUFDOUMsUUFBUSxFQUFFLE9BQU87UUFDakIsS0FBSyxFQUFFLElBQUk7S0FDWixDQUFDLENBQUMsQ0FBQztBQUNOLENBQUMiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQge1xuICBJbmplY3Rpb25Ub2tlbixcbiAgUHJvdmlkZXIs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lZHVjZXJzKFxuICAuLi5yZWR1Y2VyczogQWN0aW9uUmVkdWNlcjxQYXJ0aWFsPERhZmZDb21wb3NpdGVQcm9kdWN0UmVkdWNlcnNTdGF0ZT4+W11cbik6IFByb3ZpZGVyW10ge1xuICByZXR1cm4gcmVkdWNlcnMubWFwKHJlZHVjZXIgPT4gKHtcbiAgICBwcm92aWRlOiBEQUZGX1BST0RVQ1RfQ09NUE9TSVRFX0VYVFJBX1JFRFVDRVJTLFxuICAgIHVzZVZhbHVlOiByZWR1Y2VyLFxuICAgIG11bHRpOiB0cnVlLFxuICB9KSk7XG59XG4iXX0=
|
21
|
+
provider: daffProductCompositeProvideExtraReducers, } = createMultiInjectionToken('DAFF_PRODUCT_COMPOSITE_EXTRA_REDUCERS');
|
22
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZXh0cmEudG9rZW4uanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi9saWJzL3Byb2R1Y3QtY29tcG9zaXRlL3N0YXRlL3NyYy9yZWR1Y2Vycy9pbmplY3Rpb24tdG9rZW5zL2V4dHJhLnRva2VuLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUVBLE9BQU8sRUFBRSx5QkFBeUIsRUFBRSxNQUFNLGdCQUFnQixDQUFDO0FBSTNELE1BQU0sQ0FBQyxNQUFNO0FBQ1g7Ozs7R0FJRztBQUNILEtBQUssRUFBRSxxQ0FBcUM7QUFFNUM7Ozs7Ozs7Ozs7O0dBV0c7QUFDSCxRQUFRLEVBQUUsd0NBQXdDLEdBQ25ELEdBQUcseUJBQXlCLENBQW1ELHVDQUF1QyxDQUFDLENBQUMiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyBBY3Rpb25SZWR1Y2VyIH0gZnJvbSAnQG5ncngvc3RvcmUnO1xuXG5pbXBvcnQgeyBjcmVhdGVNdWx0aUluamVjdGl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@@
|
|
1
|
-
import { inject,
|
1
|
+
import { inject, } from '@angular/core';
|
2
2
|
import { combineReducers, } from '@ngrx/store';
|
3
|
+
import { createSingleInjectionToken } from '@daffodil/core';
|
3
4
|
import { daffComposeReducers } from '@daffodil/core/state';
|
4
5
|
import { DAFF_PRODUCT_COMPOSITE_EXTRA_REDUCERS } from './extra.token';
|
5
6
|
import { daffCompositeProductReducers } from '../composite-product-reducers';
|
7
|
+
export const {
|
6
8
|
/**
|
7
9
|
* An internal token to hold the Daffodil composite product reducers.
|
8
10
|
* Includes the extra and standard reducers.
|
9
11
|
*
|
10
12
|
* @docs-private
|
11
13
|
*/
|
12
|
-
|
14
|
+
token: DAFF_PRODUCT_COMPOSITE_REDUCERS,
|
15
|
+
/**
|
16
|
+
* Provider function for {@link DAFF_PRODUCT_COMPOSITE_REDUCERS}.
|
17
|
+
*/
|
18
|
+
provider: provideDaffProductCompositeReducers, } = createSingleInjectionToken('DAFF_PRODUCT_COMPOSITE_REDUCERS', {
|
13
19
|
factory: () => daffComposeReducers([
|
14
20
|
combineReducers(daffCompositeProductReducers),
|
15
21
|
...inject(DAFF_PRODUCT_COMPOSITE_EXTRA_REDUCERS),
|
16
22
|
]),
|
17
23
|
});
|
18
|
-
//# sourceMappingURL=data:application/json;base64,
|
24
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicmVkdWNlcnMudG9rZW4uanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi9saWJzL3Byb2R1Y3QtY29tcG9zaXRlL3N0YXRlL3NyYy9yZWR1Y2Vycy9pbmplY3Rpb24tdG9rZW5zL3JlZHVjZXJzLnRva2VuLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFDTCxNQUFNLEdBRVAsTUFBTSxlQUFlLENBQUM7QUFDdkIsT0FBTyxFQUVMLGVBQWUsR0FDaEIsTUFBTSx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TSVRFX0VYVFJBX1JFRFVDRVJTKSxcbiAgICBdKSxcbiAgfSxcbik7XG4iXX0=
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import { CommonModule } from '@angular/common';
|
2
2
|
import * as i0 from '@angular/core';
|
3
3
|
import { NgModule } from '@angular/core';
|
4
|
-
import {
|
4
|
+
import { provideDaffProductExtraFactoryTypes } from '@daffodil/product/testing';
|
5
5
|
import { DaffCompositeProductFactory } from '@daffodil/product-composite/testing';
|
6
6
|
|
7
7
|
/**
|
@@ -12,11 +12,7 @@ class DaffCompositeProductInMemoryDriverModule {
|
|
12
12
|
return {
|
13
13
|
ngModule: DaffCompositeProductInMemoryDriverModule,
|
14
14
|
providers: [
|
15
|
-
|
16
|
-
provide: DAFF_PRODUCT_TYPE_FACTORIES,
|
17
|
-
useExisting: DaffCompositeProductFactory,
|
18
|
-
multi: true,
|
19
|
-
},
|
15
|
+
provideDaffProductExtraFactoryTypes(DaffCompositeProductFactory),
|
20
16
|
],
|
21
17
|
};
|
22
18
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"daffodil-product-composite-driver-in-memory.mjs","sources":["../../../libs/product-composite/driver/in-memory/src/in-memory.module.ts","../../../libs/product-composite/driver/in-memory/src/daffodil-product-composite-driver-in-memory.ts"],"sourcesContent":["import { CommonModule } from '@angular/common';\nimport {\n NgModule,\n ModuleWithProviders,\n} from '@angular/core';\n\nimport {
|
1
|
+
{"version":3,"file":"daffodil-product-composite-driver-in-memory.mjs","sources":["../../../libs/product-composite/driver/in-memory/src/in-memory.module.ts","../../../libs/product-composite/driver/in-memory/src/daffodil-product-composite-driver-in-memory.ts"],"sourcesContent":["import { CommonModule } from '@angular/common';\nimport {\n NgModule,\n ModuleWithProviders,\n} from '@angular/core';\n\nimport { provideDaffProductExtraFactoryTypes } from '@daffodil/product/testing';\nimport { DaffCompositeProductFactory } from '@daffodil/product-composite/testing';\n\n/**\n * Module for providing the composite product factory to the product kind factory.\n */\n@NgModule({\n imports: [\n CommonModule,\n ],\n})\nexport class DaffCompositeProductInMemoryDriverModule {\n static forRoot(): ModuleWithProviders<DaffCompositeProductInMemoryDriverModule> {\n return {\n ngModule: DaffCompositeProductInMemoryDriverModule,\n providers: [\n provideDaffProductExtraFactoryTypes(DaffCompositeProductFactory),\n ],\n };\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;AASA;;AAEG;MAMU,wCAAwC,CAAA;AACnD,IAAA,OAAO,OAAO,GAAA;QACZ,OAAO;AACL,YAAA,QAAQ,EAAE,wCAAwC;AAClD,YAAA,SAAS,EAAE;gBACT,mCAAmC,CAAC,2BAA2B,CAAC;AACjE,aAAA;SACF,CAAC;KACH;iIARU,wCAAwC,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA,EAAA;AAAxC,uBAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,wCAAwC,YAHjD,YAAY,CAAA,EAAA,CAAA,CAAA,EAAA;AAGH,uBAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,wCAAwC,YAHjD,YAAY,CAAA,EAAA,CAAA,CAAA,EAAA;;2FAGH,wCAAwC,EAAA,UAAA,EAAA,CAAA;kBALpD,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,OAAO,EAAE;wBACP,YAAY;AACb,qBAAA;AACF,iBAAA,CAAA;;;AChBD;;AAEG;;;;"}
|
@@ -2,7 +2,7 @@ import { gql } from 'apollo-angular';
|
|
2
2
|
import { CommonModule } from '@angular/common';
|
3
3
|
import * as i0 from '@angular/core';
|
4
4
|
import { NgModule } from '@angular/core';
|
5
|
-
import { MagentoProductStockStatusEnum,
|
5
|
+
import { MagentoProductStockStatusEnum, provideDaffProductMagentoExtraProductFragments, provideDaffProductMagentoExtraProductTransforms, MagentoProductTypeEnum, provideDaffProductMagentoExtraProductPreviewTransforms } from '@daffodil/product/driver/magento';
|
6
6
|
import { DaffProductTypeEnum } from '@daffodil/product';
|
7
7
|
|
8
8
|
const magentoBundledProductFragment = gql `
|
@@ -103,12 +103,12 @@ class DaffCompositeProductMagentoDriverModule {
|
|
103
103
|
return {
|
104
104
|
ngModule: DaffCompositeProductMagentoDriverModule,
|
105
105
|
providers: [
|
106
|
-
...
|
107
|
-
...
|
106
|
+
...provideDaffProductMagentoExtraProductFragments(magentoBundledProductFragment),
|
107
|
+
...provideDaffProductMagentoExtraProductTransforms((daffProduct, magentoProduct) => magentoProduct.__typename === MagentoProductTypeEnum.BundledProduct
|
108
108
|
? transformMagentoBundledProduct(daffProduct, magentoProduct)
|
109
109
|
: daffProduct),
|
110
110
|
// stub out composite fields for a preview
|
111
|
-
...
|
111
|
+
...provideDaffProductMagentoExtraProductPreviewTransforms((daffProduct, magentoProduct) => magentoProduct.__typename === MagentoProductTypeEnum.BundledProduct
|
112
112
|
? {
|
113
113
|
...daffProduct,
|
114
114
|
items: [],
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"daffodil-product-composite-driver-magento.mjs","sources":["../../../libs/product-composite/driver/magento/src/fragments/bundled-product.ts","../../../libs/product-composite/driver/magento/src/transforms/bundled-product-transformers.ts","../../../libs/product-composite/driver/magento/src/composite-product-driver.module.ts","../../../libs/product-composite/driver/magento/src/models/bundled-product.ts","../../../libs/product-composite/driver/magento/src/daffodil-product-composite-driver-magento.ts"],"sourcesContent":["import { gql } from 'apollo-angular';\n\nexport const magentoBundledProductFragment = gql`\nfragment magentoBundledProduct on BundleProduct {\n\titems {\n\t\toption_id\n\t\trequired\n\t\ttitle\n\t\ttype\n\t\toptions {\n\t\t\tuid\n\t\t\tis_default\n\t\t\tlabel\n\t\t\tquantity\n position\n\t\t\tproduct {\n\t\t\t\tstock_status\n\t\t\t\tprice_range {\n\t\t\t\t\tmaximum_price {\n\t\t\t\t\t\tregular_price {\n\t\t\t\t\t\t\tvalue\n\t\t\t\t\t\t\tcurrency\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdiscount {\n\t\t\t\t\t\t\tamount_off\n\t\t\t\t\t\t\tpercent_off\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n`;\n","import {\n DaffProductDiscount,\n DaffProductTypeEnum,\n DaffProduct,\n} from '@daffodil/product';\nimport { MagentoProductStockStatusEnum } from '@daffodil/product/driver/magento';\nimport {\n DaffCompositeProduct,\n DaffCompositeProductItemOption,\n DaffCompositeProductItem,\n DaffCompositeProductItemInputEnum,\n} from '@daffodil/product-composite';\n\nimport {\n MagentoBundledProduct,\n MagentoBundledProductItem,\n MagentoBundledProductItemOption,\n MagentoBundledProductItemOptionProduct,\n} from '../models/bundled-product';\n\n/**\n * Transforms the magento MagentoProduct from the magento product query into a DaffProduct.\n *\n * @param response the response from a magento product query.\n */\nexport function transformMagentoBundledProduct(\n daffProduct: DaffProduct,\n { items }: MagentoBundledProduct,\n): DaffCompositeProduct {\n return {\n ...daffProduct,\n ...items.length > 0 ? {\n price: 0,\n discount: {\n amount: 0,\n percent: 0,\n },\n } : {},\n type: DaffProductTypeEnum.Composite,\n items: items.map(transformMagentoBundledProductItem),\n };\n}\n\nfunction transformMagentoBundledProductItem(item: MagentoBundledProductItem): DaffCompositeProductItem {\n return {\n id: item.option_id.toString(),\n required: item.required,\n title: item.title,\n input_type: <DaffCompositeProductItemInputEnum>item.type,\n options: Array.from(item.options).sort((a, b) => a.position - b.position).map(transformMagentoBundledProductItemOption),\n };\n}\n\nfunction transformMagentoBundledProductItemOption(option: MagentoBundledProductItemOption): DaffCompositeProductItemOption {\n return {\n id: option.uid.toString(),\n type: DaffProductTypeEnum.Simple,\n url: null,\n name: option.label,\n price: getPrice(option.product),\n images: [],\n thumbnail: null,\n discount: getDiscount(option.product),\n quantity: option.quantity,\n is_default: option.is_default,\n in_stock: option.product.stock_status === MagentoProductStockStatusEnum.InStock,\n };\n}\n\n/**\n * A function for null checking an object.\n */\nfunction getPrice(product: MagentoBundledProductItemOptionProduct): number {\n return product.price_range?.maximum_price?.regular_price?.value || null;\n}\n\nfunction getDiscount(product: MagentoBundledProductItemOptionProduct): DaffProductDiscount {\n return product.price_range?.maximum_price?.discount\n ? {\n amount: product.price_range.maximum_price.discount.amount_off,\n percent: product.price_range.maximum_price.discount.percent_off,\n } : { amount: null, percent: null };\n}\n","import { CommonModule } from '@angular/common';\nimport {\n NgModule,\n ModuleWithProviders,\n} from '@angular/core';\n\nimport {\n daffProvideProductMagentoExtraProductTransforms,\n MagentoProductTypeEnum,\n daffProvideProductMagentoExtraProductFragments,\n daffProvideProductMagentoExtraProductPreviewTransforms,\n} from '@daffodil/product/driver/magento';\n\nimport { magentoBundledProductFragment } from './fragments/bundled-product';\nimport { MagentoBundledProduct } from './public_api';\nimport { transformMagentoBundledProduct } from './transforms/bundled-product-transformers';\n\n/**\n * A module that provides the product fragment for composite products along with a composite product transformer.\n */\n@NgModule({\n imports: [\n CommonModule,\n ],\n})\nexport class DaffCompositeProductMagentoDriverModule {\n static forRoot(): ModuleWithProviders<DaffCompositeProductMagentoDriverModule> {\n return {\n ngModule: DaffCompositeProductMagentoDriverModule,\n providers: [\n ...daffProvideProductMagentoExtraProductFragments(magentoBundledProductFragment),\n ...daffProvideProductMagentoExtraProductTransforms<MagentoBundledProduct>(\n (daffProduct, magentoProduct) =>\n magentoProduct.__typename === MagentoProductTypeEnum.BundledProduct\n ? transformMagentoBundledProduct(daffProduct, magentoProduct)\n : daffProduct,\n ),\n // stub out composite fields for a preview\n ...daffProvideProductMagentoExtraProductPreviewTransforms<MagentoBundledProduct>(\n (daffProduct, magentoProduct) =>\n magentoProduct.__typename === MagentoProductTypeEnum.BundledProduct\n ? {\n ...daffProduct,\n items: [],\n price: 0,\n discount: {\n amount: 0,\n percent: 0,\n },\n }\n : daffProduct,\n ),\n ],\n };\n }\n}\n","import {\n MagentoProduct,\n MagentoProductStockStatusEnum,\n} from '@daffodil/product/driver/magento';\n\nexport enum MagentoPriceTypeEnum {\n fixed = 'FIXED',\n percent = 'PERCENT',\n dynamic = 'DYNAMIC'\n}\n\nexport interface MagentoBundledProduct extends MagentoProduct {\n items: MagentoBundledProductItem[];\n}\n\nexport interface MagentoBundledProductItem {\n required: boolean;\n title: string;\n type: string;\n options: MagentoBundledProductItemOption[];\n option_id?: number;\n}\n\nexport interface MagentoBundledProductItemOption {\n uid: string;\n label: string;\n quantity: number;\n is_default: boolean;\n position: number;\n product: MagentoBundledProductItemOptionProduct;\n}\n\nexport interface MagentoBundledProductItemOptionProduct {\n stock_status?: MagentoProductStockStatusEnum;\n price_range: {\n maximum_price: {\n regular_price: {\n value: number;\n currency: any;\n };\n discount: {\n amount_off: number;\n percent_off: number;\n };\n };\n };\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;AAEO,MAAM,6BAA6B,GAAG,GAAG,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACkBhD;;;;AAIG;SACa,8BAA8B,CAC5C,WAAwB,EACxB,EAAE,KAAK,EAAyB,EAAA;IAEhC,OAAO;AACL,QAAA,GAAG,WAAW;AACd,QAAA,GAAG,KAAK,CAAC,MAAM,GAAG,CAAC,GAAG;AACpB,YAAA,KAAK,EAAE,CAAC;AACR,YAAA,QAAQ,EAAE;AACR,gBAAA,MAAM,EAAE,CAAC;AACT,gBAAA,OAAO,EAAE,CAAC;AACX,aAAA;SACF,GAAG,EAAE;QACN,IAAI,EAAE,mBAAmB,CAAC,SAAS;AACnC,QAAA,KAAK,EAAE,KAAK,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AAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,uCAAuC,YAHhD,YAAY,CAAA,EAAA,CAAA,CAAA,EAAA;AAGH,uBAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,uCAAuC,YAHhD,YAAY,CAAA,EAAA,CAAA,CAAA,EAAA;;2FAGH,uCAAuC,EAAA,UAAA,EAAA,CAAA;kBALnD,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,OAAO,EAAE;wBACP,YAAY;AACb,qBAAA;AACF,iBAAA,CAAA;;;ICnBW,qBAIX;AAJD,CAAA,UAAY,oBAAoB,EAAA;AAC9B,IAAA,oBAAA,CAAA,OAAA,CAAA,GAAA,OAAe,CAAA;AACf,IAAA,oBAAA,CAAA,SAAA,CAAA,GAAA,SAAmB,CAAA;AACnB,IAAA,oBAAA,CAAA,SAAA,CAAA,GAAA,SAAmB,CAAA;AACrB,CAAC,EAJW,oBAAoB,KAApB,oBAAoB,GAI/B,EAAA,CAAA,CAAA;;ACTD;;AAEG;;;;"}
|
1
|
+
{"version":3,"file":"daffodil-product-composite-driver-magento.mjs","sources":["../../../libs/product-composite/driver/magento/src/fragments/bundled-product.ts","../../../libs/product-composite/driver/magento/src/transforms/bundled-product-transformers.ts","../../../libs/product-composite/driver/magento/src/composite-product-driver.module.ts","../../../libs/product-composite/driver/magento/src/models/bundled-product.ts","../../../libs/product-composite/driver/magento/src/daffodil-product-composite-driver-magento.ts"],"sourcesContent":["import { gql } from 'apollo-angular';\n\nexport const magentoBundledProductFragment = gql`\nfragment magentoBundledProduct on BundleProduct {\n\titems {\n\t\toption_id\n\t\trequired\n\t\ttitle\n\t\ttype\n\t\toptions {\n\t\t\tuid\n\t\t\tis_default\n\t\t\tlabel\n\t\t\tquantity\n position\n\t\t\tproduct {\n\t\t\t\tstock_status\n\t\t\t\tprice_range {\n\t\t\t\t\tmaximum_price {\n\t\t\t\t\t\tregular_price {\n\t\t\t\t\t\t\tvalue\n\t\t\t\t\t\t\tcurrency\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdiscount {\n\t\t\t\t\t\t\tamount_off\n\t\t\t\t\t\t\tpercent_off\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n`;\n","import {\n DaffProductDiscount,\n DaffProductTypeEnum,\n DaffProduct,\n} from '@daffodil/product';\nimport { MagentoProductStockStatusEnum } from '@daffodil/product/driver/magento';\nimport {\n DaffCompositeProduct,\n DaffCompositeProductItemOption,\n DaffCompositeProductItem,\n DaffCompositeProductItemInputEnum,\n} from '@daffodil/product-composite';\n\nimport {\n MagentoBundledProduct,\n MagentoBundledProductItem,\n MagentoBundledProductItemOption,\n MagentoBundledProductItemOptionProduct,\n} from '../models/bundled-product';\n\n/**\n * Transforms the magento MagentoProduct from the magento product query into a DaffProduct.\n *\n * @param response the response from a magento product query.\n */\nexport function transformMagentoBundledProduct(\n daffProduct: DaffProduct,\n { items }: MagentoBundledProduct,\n): DaffCompositeProduct {\n return {\n ...daffProduct,\n ...items.length > 0 ? {\n price: 0,\n discount: {\n amount: 0,\n percent: 0,\n },\n } : {},\n type: DaffProductTypeEnum.Composite,\n items: items.map(transformMagentoBundledProductItem),\n };\n}\n\nfunction transformMagentoBundledProductItem(item: MagentoBundledProductItem): DaffCompositeProductItem {\n return {\n id: item.option_id.toString(),\n required: item.required,\n title: item.title,\n input_type: <DaffCompositeProductItemInputEnum>item.type,\n options: Array.from(item.options).sort((a, b) => a.position - b.position).map(transformMagentoBundledProductItemOption),\n };\n}\n\nfunction transformMagentoBundledProductItemOption(option: MagentoBundledProductItemOption): DaffCompositeProductItemOption {\n return {\n id: option.uid.toString(),\n type: DaffProductTypeEnum.Simple,\n url: null,\n name: option.label,\n price: getPrice(option.product),\n images: [],\n thumbnail: null,\n discount: getDiscount(option.product),\n quantity: option.quantity,\n is_default: option.is_default,\n in_stock: option.product.stock_status === MagentoProductStockStatusEnum.InStock,\n };\n}\n\n/**\n * A function for null checking an object.\n */\nfunction getPrice(product: MagentoBundledProductItemOptionProduct): number {\n return product.price_range?.maximum_price?.regular_price?.value || null;\n}\n\nfunction getDiscount(product: MagentoBundledProductItemOptionProduct): DaffProductDiscount {\n return product.price_range?.maximum_price?.discount\n ? {\n amount: product.price_range.maximum_price.discount.amount_off,\n percent: product.price_range.maximum_price.discount.percent_off,\n } : { amount: null, percent: null };\n}\n","import { CommonModule } from '@angular/common';\nimport {\n NgModule,\n ModuleWithProviders,\n} from '@angular/core';\n\nimport {\n provideDaffProductMagentoExtraProductTransforms,\n MagentoProductTypeEnum,\n provideDaffProductMagentoExtraProductFragments,\n provideDaffProductMagentoExtraProductPreviewTransforms,\n} from '@daffodil/product/driver/magento';\n\nimport { magentoBundledProductFragment } from './fragments/bundled-product';\nimport { MagentoBundledProduct } from './public_api';\nimport { transformMagentoBundledProduct } from './transforms/bundled-product-transformers';\n\n/**\n * A module that provides the product fragment for composite products along with a composite product transformer.\n */\n@NgModule({\n imports: [\n CommonModule,\n ],\n})\nexport class DaffCompositeProductMagentoDriverModule {\n static forRoot(): ModuleWithProviders<DaffCompositeProductMagentoDriverModule> {\n return {\n ngModule: DaffCompositeProductMagentoDriverModule,\n providers: [\n ...provideDaffProductMagentoExtraProductFragments(magentoBundledProductFragment),\n ...provideDaffProductMagentoExtraProductTransforms<MagentoBundledProduct>(\n (daffProduct, magentoProduct) =>\n magentoProduct.__typename === MagentoProductTypeEnum.BundledProduct\n ? transformMagentoBundledProduct(daffProduct, magentoProduct)\n : daffProduct,\n ),\n // stub out composite fields for a preview\n ...provideDaffProductMagentoExtraProductPreviewTransforms<MagentoBundledProduct>(\n (daffProduct, magentoProduct) =>\n magentoProduct.__typename === MagentoProductTypeEnum.BundledProduct\n ? {\n ...daffProduct,\n items: [],\n price: 0,\n discount: {\n amount: 0,\n percent: 0,\n },\n }\n : daffProduct,\n ),\n ],\n };\n }\n}\n","import {\n MagentoProduct,\n MagentoProductStockStatusEnum,\n} from '@daffodil/product/driver/magento';\n\nexport enum MagentoPriceTypeEnum {\n fixed = 'FIXED',\n percent = 'PERCENT',\n dynamic = 'DYNAMIC'\n}\n\nexport interface MagentoBundledProduct extends MagentoProduct {\n items: MagentoBundledProductItem[];\n}\n\nexport interface MagentoBundledProductItem {\n required: boolean;\n title: string;\n type: string;\n options: MagentoBundledProductItemOption[];\n option_id?: number;\n}\n\nexport interface MagentoBundledProductItemOption {\n uid: string;\n label: string;\n quantity: number;\n is_default: boolean;\n position: number;\n product: MagentoBundledProductItemOptionProduct;\n}\n\nexport interface MagentoBundledProductItemOptionProduct {\n stock_status?: MagentoProductStockStatusEnum;\n price_range: {\n maximum_price: {\n regular_price: {\n value: number;\n currency: any;\n };\n discount: {\n amount_off: number;\n percent_off: number;\n };\n };\n };\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;AAEO,MAAM,6BAA6B,GAAG,GAAG,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACkBhD;;;;AAIG;SACa,8BAA8B,CAC5C,WAAwB,EACxB,EAAE,KAAK,EAAyB,EAAA;IAEhC,OAAO;AACL,QAAA,GAAG,WAAW;AACd,QAAA,GAAG,KAAK,CAAC,MAAM,GAAG,CAAC,GAAG;AACpB,YAAA,KAAK,EAAE,CAAC;AACR,YAAA,QAAQ,EAAE;AACR,gBAAA,MAAM,EAAE,CAAC;AACT,gBAAA,OAAO,EAAE,CAAC;AACX,aAAA;SACF,GAAG,EAAE;QACN,IAAI,EAAE,mBAAmB,CAAC,SAAS;AACnC,QAAA,KAAK,EAAE,KAAK,CAAC,GAAG,CAAC,kCAAkC,CAAC;KACrD,CAAC;AACJ,CAAC;A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,EAAA,EAAA,EAAA,IAAA,EAAA,uCAAuC,YAHhD,YAAY,CAAA,EAAA,CAAA,CAAA,EAAA;AAGH,uBAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,uCAAuC,YAHhD,YAAY,CAAA,EAAA,CAAA,CAAA,EAAA;;2FAGH,uCAAuC,EAAA,UAAA,EAAA,CAAA;kBALnD,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,OAAO,EAAE;wBACP,YAAY;AACb,qBAAA;AACF,iBAAA,CAAA;;;ICnBW,qBAIX;AAJD,CAAA,UAAY,oBAAoB,EAAA;AAC9B,IAAA,oBAAA,CAAA,OAAA,CAAA,GAAA,OAAe,CAAA;AACf,IAAA,oBAAA,CAAA,SAAA,CAAA,GAAA,SAAmB,CAAA;AACnB,IAAA,oBAAA,CAAA,SAAA,CAAA,GAAA,SAAmB,CAAA;AACrB,CAAC,EAJW,oBAAoB,KAApB,oBAAoB,GAI/B,EAAA,CAAA,CAAA;;ACTD;;AAEG;;;;"}
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import { CommonModule } from '@angular/common';
|
2
2
|
import * as i0 from '@angular/core';
|
3
3
|
import { NgModule } from '@angular/core';
|
4
|
-
import {
|
4
|
+
import { provideDaffProductExtraFactoryTypes } from '@daffodil/product/testing';
|
5
5
|
import { DaffCompositeProductFactory } from '@daffodil/product-composite/testing';
|
6
6
|
|
7
7
|
/**
|
@@ -12,11 +12,7 @@ class DaffCompositeProductTestingDriverModule {
|
|
12
12
|
return {
|
13
13
|
ngModule: DaffCompositeProductTestingDriverModule,
|
14
14
|
providers: [
|
15
|
-
|
16
|
-
provide: DAFF_PRODUCT_TYPE_FACTORIES,
|
17
|
-
useExisting: DaffCompositeProductFactory,
|
18
|
-
multi: true,
|
19
|
-
},
|
15
|
+
provideDaffProductExtraFactoryTypes(DaffCompositeProductFactory),
|
20
16
|
],
|
21
17
|
};
|
22
18
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"daffodil-product-composite-driver-testing.mjs","sources":["../../../libs/product-composite/driver/testing/src/testing.module.ts","../../../libs/product-composite/driver/testing/src/daffodil-product-composite-driver-testing.ts"],"sourcesContent":["import { CommonModule } from '@angular/common';\nimport {\n NgModule,\n ModuleWithProviders,\n} from '@angular/core';\n\nimport {
|
1
|
+
{"version":3,"file":"daffodil-product-composite-driver-testing.mjs","sources":["../../../libs/product-composite/driver/testing/src/testing.module.ts","../../../libs/product-composite/driver/testing/src/daffodil-product-composite-driver-testing.ts"],"sourcesContent":["import { CommonModule } from '@angular/common';\nimport {\n NgModule,\n ModuleWithProviders,\n} from '@angular/core';\n\nimport { provideDaffProductExtraFactoryTypes } from '@daffodil/product/testing';\nimport { DaffCompositeProductFactory } from '@daffodil/product-composite/testing';\n\n/**\n * Module for providing the composite product factory to the product kind factory.\n */\n@NgModule({\n imports: [\n CommonModule,\n ],\n})\nexport class DaffCompositeProductTestingDriverModule {\n static forRoot(): ModuleWithProviders<DaffCompositeProductTestingDriverModule> {\n return {\n ngModule: DaffCompositeProductTestingDriverModule,\n providers: [\n provideDaffProductExtraFactoryTypes(DaffCompositeProductFactory),\n ],\n };\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;AASA;;AAEG;MAMU,uCAAuC,CAAA;AAClD,IAAA,OAAO,OAAO,GAAA;QACZ,OAAO;AACL,YAAA,QAAQ,EAAE,uCAAuC;AACjD,YAAA,SAAS,EAAE;gBACT,mCAAmC,CAAC,2BAA2B,CAAC;AACjE,aAAA;SACF,CAAC;KACH;iIARU,uCAAuC,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA,EAAA;AAAvC,uBAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,uCAAuC,YAHhD,YAAY,CAAA,EAAA,CAAA,CAAA,EAAA;AAGH,uBAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,uCAAuC,YAHhD,YAAY,CAAA,EAAA,CAAA,CAAA,EAAA;;2FAGH,uCAAuC,EAAA,UAAA,EAAA,CAAA;kBALnD,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,OAAO,EAAE;wBACP,YAAY;AACb,qBAAA;AACF,iBAAA,CAAA;;;AChBD;;AAEG;;;;"}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import * as i0 from '@angular/core';
|
2
2
|
import { InjectionToken, inject, Injectable, Inject, NgModule } from '@angular/core';
|
3
|
-
import { DaffBase64ServiceToken } from '@daffodil/core';
|
3
|
+
import { DaffBase64ServiceToken, createConfigInjectionToken } from '@daffodil/core';
|
4
4
|
import * as i1 from '@ngrx/effects';
|
5
5
|
import { createEffect, ofType, EffectsModule } from '@ngrx/effects';
|
6
6
|
import { EMPTY, of } from 'rxjs';
|
@@ -17,25 +17,17 @@ const daffProductCompositeRoutingConfigDefaultFactory = (base64) => ({
|
|
17
17
|
compositeSelectionQueryParam: 'composite_selection',
|
18
18
|
compositeSelectionQueryParamDecode: (queryParam) => JSON.parse(base64.decode(queryParam)),
|
19
19
|
});
|
20
|
+
const DAFF_PRODUCT_COMPOSITE_ROUTING_CONFIG_DEFAULT = new InjectionToken('DAFF_PRODUCT_COMPOSITE_ROUTING_CONFIG_DEFAULT', { factory: () => daffProductCompositeRoutingConfigDefaultFactory(inject(DaffBase64ServiceToken)) });
|
20
21
|
|
22
|
+
const {
|
21
23
|
/**
|
22
24
|
* The token used to provide @daffodil/product-composite/routing config data.
|
23
25
|
*/
|
24
|
-
|
25
|
-
factory: () => daffProductCompositeRoutingConfigDefaultFactory(inject(DaffBase64ServiceToken)),
|
26
|
-
});
|
26
|
+
token: DAFF_PRODUCT_COMPOSITE_ROUTING_CONFIG,
|
27
27
|
/**
|
28
28
|
* Provides the {@link DAFF_PRODUCT_COMPOSITE_ROUTING_CONFIG} token.
|
29
29
|
*/
|
30
|
-
|
31
|
-
return {
|
32
|
-
provide: DAFF_PRODUCT_COMPOSITE_ROUTING_CONFIG,
|
33
|
-
useFactory: () => ({
|
34
|
-
...daffProductCompositeRoutingConfigDefaultFactory(inject(DaffBase64ServiceToken)),
|
35
|
-
...config,
|
36
|
-
}),
|
37
|
-
};
|
38
|
-
}
|
30
|
+
provider: provideDaffProductCompositeRoutingConfig, } = createConfigInjectionToken(DAFF_PRODUCT_COMPOSITE_ROUTING_CONFIG_DEFAULT, 'DAFF_PRODUCT_COMPOSITE_ROUTING_CONFIG');
|
39
31
|
|
40
32
|
class DaffProductCompositeQueryParamService {
|
41
33
|
constructor(document, config) {
|
@@ -121,13 +113,7 @@ class DaffProductCompositeRoutingModule {
|
|
121
113
|
return {
|
122
114
|
ngModule: DaffProductCompositeRoutingModule,
|
123
115
|
providers: [
|
124
|
-
|
125
|
-
provide: DAFF_PRODUCT_COMPOSITE_ROUTING_CONFIG,
|
126
|
-
useFactory: () => ({
|
127
|
-
...daffProductCompositeRoutingConfigDefaultFactory(inject(DaffBase64ServiceToken)),
|
128
|
-
...config || {},
|
129
|
-
}),
|
130
|
-
},
|
116
|
+
provideDaffProductCompositeRoutingConfig(config),
|
131
117
|
],
|
132
118
|
};
|
133
119
|
}
|
@@ -153,5 +139,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.2", ngImpor
|
|
153
139
|
* Generated bundle index. Do not edit.
|
154
140
|
*/
|
155
141
|
|
156
|
-
export { DAFF_PRODUCT_COMPOSITE_ROUTING_CONFIG, DaffProductCompositePageEffects, DaffProductCompositeRoutingModule, daffProductCompositeRoutingConfigDefaultFactory,
|
142
|
+
export { DAFF_PRODUCT_COMPOSITE_ROUTING_CONFIG, DAFF_PRODUCT_COMPOSITE_ROUTING_CONFIG_DEFAULT, DaffProductCompositePageEffects, DaffProductCompositeRoutingModule, daffProductCompositeRoutingConfigDefaultFactory, provideDaffProductCompositeRoutingConfig };
|
157
143
|
//# sourceMappingURL=daffodil-product-composite-routing.mjs.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"daffodil-product-composite-routing.mjs","sources":["../../../libs/product-composite/routing/src/config/default.ts","../../../libs/product-composite/routing/src/config/token.ts","../../../libs/product-composite/routing/src/services/query-param.service.ts","../../../libs/product-composite/routing/src/effects/product-page.effects.ts","../../../libs/product-composite/routing/src/module.ts","../../../libs/product-composite/routing/src/daffodil-product-composite-routing.ts"],"sourcesContent":["import { DaffBase64Service } from '@daffodil/core';\n\nimport { DaffProductCompositeRoutingConfig } from './interface';\n\n/**\n * The default configuration for the {@link DaffProductCompositeRoutingConfig}.\n */\nexport const daffProductCompositeRoutingConfigDefaultFactory = (base64: DaffBase64Service): DaffProductCompositeRoutingConfig => ({\n compositeSelectionQueryParam: 'composite_selection',\n compositeSelectionQueryParamDecode: (queryParam: string) => JSON.parse(base64.decode(queryParam)),\n});\n","import {\n FactoryProvider,\n inject,\n InjectionToken,\n} from '@angular/core';\n\nimport { DaffBase64ServiceToken } from '@daffodil/core';\n\nimport { daffProductCompositeRoutingConfigDefaultFactory } from './default';\nimport { DaffProductCompositeRoutingConfig } from './interface';\n\n/**\n * The token used to provide @daffodil/product-composite/routing config data.\n */\nexport const DAFF_PRODUCT_COMPOSITE_ROUTING_CONFIG = new InjectionToken<DaffProductCompositeRoutingConfig>('DAFF_PRODUCT_COMPOSITE_ROUTING_CONFIG', {\n factory: () => daffProductCompositeRoutingConfigDefaultFactory(inject(DaffBase64ServiceToken)),\n});\n\n/**\n * Provides the {@link DAFF_PRODUCT_COMPOSITE_ROUTING_CONFIG} token.\n */\nexport function daffProductCompositeRoutingProvideConfig(config: Partial<DaffProductCompositeRoutingConfig>): FactoryProvider {\n return {\n provide: DAFF_PRODUCT_COMPOSITE_ROUTING_CONFIG,\n useFactory: () => ({\n ...daffProductCompositeRoutingConfigDefaultFactory(inject(DaffBase64ServiceToken)),\n ...config,\n }),\n };\n}\n","import { DOCUMENT } from '@angular/common';\nimport {\n Inject,\n Injectable,\n} from '@angular/core';\n\nimport {\n DAFF_PRODUCT_COMPOSITE_ROUTING_CONFIG,\n DaffProductCompositeRoutingConfig,\n} from '../config/public_api';\n\n@Injectable()\nexport class DaffProductCompositeQueryParamService {\n\n constructor(\n @Inject(DOCUMENT) private document: any,\n @Inject(DAFF_PRODUCT_COMPOSITE_ROUTING_CONFIG) private config: DaffProductCompositeRoutingConfig) {\n }\n\n /**\n * Get the value of the configured composite selection query param.\n */\n public get(): string {\n return (\n new URL((<any>this.document).location.toString())\n ).searchParams.get(this.config.compositeSelectionQueryParam);\n }\n}\n","import {\n Inject,\n Injectable,\n} from '@angular/core';\nimport {\n Actions,\n createEffect,\n ofType,\n} from '@ngrx/effects';\nimport {\n EMPTY,\n Observable,\n of,\n} from 'rxjs';\nimport {\n map,\n switchMap,\n} from 'rxjs/operators';\n\nimport {\n DaffProduct,\n DaffProductTypeEnum,\n} from '@daffodil/product';\nimport {\n DaffProductPageActionTypes,\n DaffProductPageLoadSuccess,\n} from '@daffodil/product/state';\nimport {\n DaffCompositeProduct,\n DaffCompositeProductItem,\n DaffCompositeProductItemOption,\n DaffProductCompositeSelectionPayload,\n} from '@daffodil/product-composite';\nimport { DaffCompositeProductApplyOption } from '@daffodil/product-composite/state';\n\nimport {\n DaffProductCompositeRoutingConfig,\n DAFF_PRODUCT_COMPOSITE_ROUTING_CONFIG,\n} from '../config/public_api';\nimport { DaffProductCompositeQueryParamService } from '../services/query-param.service';\n\n/**\n * Builds the apply actions from the list of selected options.\n */\nfunction buildApplyActions<T extends DaffCompositeProduct = DaffCompositeProduct>(product: DaffCompositeProduct, itemId: DaffCompositeProductItem['id'], selectedOptions: DaffCompositeProductItemOption['id'][]): DaffCompositeProductApplyOption<T>[] {\n const selectionItem = product.items.find(({ id }) => id === itemId);\n\n return selectionItem\n ? selectedOptions.map(selectionOptionId => {\n // use the quantity of the referenced option\n const qty = selectionItem?.options.find(({ id }) => id === selectionOptionId)?.quantity;\n\n return new DaffCompositeProductApplyOption(product.id, itemId, selectionOptionId, qty);\n })\n : [];\n}\n\n/**\n * Handles composite product specific actions for the product page.\n */\n@Injectable()\nexport class DaffProductCompositePageEffects<T extends DaffCompositeProduct = DaffCompositeProduct> {\n constructor(\n private actions$: Actions,\n private paramGetter: DaffProductCompositeQueryParamService,\n @Inject(DAFF_PRODUCT_COMPOSITE_ROUTING_CONFIG) private config: DaffProductCompositeRoutingConfig,\n ) {}\n\n /**\n * Applies composite item options based on the value of the configured query param.\n */\n preselectCompositeOptions$: Observable<typeof EMPTY | DaffCompositeProductApplyOption<T>> = createEffect(() => this.actions$.pipe(\n ofType(DaffProductPageActionTypes.ProductPageLoadSuccessAction),\n switchMap((action: DaffProductPageLoadSuccess<T>) => {\n const queryParam = this.paramGetter.get();\n\n // get the product corresponding to the current product page\n const product: DaffCompositeProduct = action.payload.products.filter(({ id }) => id === action.payload.id)[0];\n\n // if we don't have a query param set or if the product isn't composite,\n // we have nothing to do\n if (!queryParam || product?.type !== DaffProductTypeEnum.Composite) {\n return EMPTY;\n }\n\n let selection: DaffProductCompositeSelectionPayload;\n\n try {\n selection = this.config.compositeSelectionQueryParamDecode(queryParam, product);\n } catch (error) {\n return EMPTY;\n }\n\n const applyActions = Object.keys(selection).reduce<DaffCompositeProductApplyOption<T>[]>(\n (actions, itemId) => actions.concat(buildApplyActions(product, itemId, selection[itemId])),\n [],\n );\n\n // dispatch each of the apply actions into the action stream\n return of(...applyActions);\n }),\n ));\n}\n","import {\n inject,\n ModuleWithProviders,\n NgModule,\n} from '@angular/core';\nimport { EffectsModule } from '@ngrx/effects';\n\nimport { DaffBase64ServiceToken } from '@daffodil/core';\n\nimport {\n DaffProductCompositeRoutingConfig,\n daffProductCompositeRoutingConfigDefaultFactory,\n DAFF_PRODUCT_COMPOSITE_ROUTING_CONFIG,\n} from './config/public_api';\nimport { DaffProductCompositePageEffects } from './effects/public_api';\nimport { DaffProductCompositeQueryParamService } from './services/query-param.service';\n\n@NgModule({\n imports: [\n EffectsModule.forFeature([DaffProductCompositePageEffects]),\n ],\n providers: [\n DaffProductCompositeQueryParamService,\n ],\n})\nexport class DaffProductCompositeRoutingModule {\n static withConfig(config?: DaffProductCompositeRoutingConfig): ModuleWithProviders<DaffProductCompositeRoutingModule> {\n return {\n ngModule: DaffProductCompositeRoutingModule,\n providers: [\n {\n provide: DAFF_PRODUCT_COMPOSITE_ROUTING_CONFIG,\n useFactory: () => ({\n ...daffProductCompositeRoutingConfigDefaultFactory(inject(DaffBase64ServiceToken)),\n ...config || {},\n }),\n },\n ],\n };\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;AAIA;;AAEG;MACU,+CAA+C,GAAG,CAAC,MAAyB,MAAyC;AAChI,IAAA,4BAA4B,EAAE,qBAAqB;AACnD,IAAA,kCAAkC,EAAE,CAAC,UAAkB,KAAK,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;AAClG,CAAA;;ACCD;;AAEG;MACU,qCAAqC,GAAG,IAAI,cAAc,CAAoC,uCAAuC,EAAE;IAClJ,OAAO,EAAE,MAAM,+CAA+C,CAAC,MAAM,CAAC,sBAAsB,CAAC,CAAC;AAC/F,CAAA,EAAE;AAEH;;AAEG;AACG,SAAU,wCAAwC,CAAC,MAAkD,EAAA;IACzG,OAAO;AACL,QAAA,OAAO,EAAE,qCAAqC;AAC9C,QAAA,UAAU,EAAE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C,uBAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,iCAAiC,EAJjC,SAAA,EAAA;YACT,qCAAqC;AACtC,SAAA,EAAA,OAAA,EAAA,CAJC,aAAa,CAAC,UAAU,CAAC,CAAC,+BAA+B,CAAC,CAAC,CAAA,EAAA,CAAA,CAAA,EAAA;;2FAMlD,iCAAiC,EAAA,UAAA,EAAA,CAAA;kBAR7C,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,OAAO,EAAE;AACP,wBAAA,aAAa,CAAC,UAAU,CAAC,CAAC,+BAA+B,CAAC,CAAC;AAC5D,qBAAA;AACD,oBAAA,SAAS,EAAE;wBACT,qCAAqC;AACtC,qBAAA;AACF,iBAAA,CAAA;;;ACxBD;;AAEG;;;;"}
|
1
|
+
{"version":3,"file":"daffodil-product-composite-routing.mjs","sources":["../../../libs/product-composite/routing/src/config/default.ts","../../../libs/product-composite/routing/src/config/token.ts","../../../libs/product-composite/routing/src/services/query-param.service.ts","../../../libs/product-composite/routing/src/effects/product-page.effects.ts","../../../libs/product-composite/routing/src/module.ts","../../../libs/product-composite/routing/src/daffodil-product-composite-routing.ts"],"sourcesContent":["import {\n InjectionToken,\n inject,\n} from '@angular/core';\n\nimport {\n DaffBase64Service,\n DaffBase64ServiceToken,\n} from '@daffodil/core';\n\nimport { DaffProductCompositeRoutingConfig } from './interface';\n\n/**\n * The default configuration for the {@link DaffProductCompositeRoutingConfig}.\n */\nexport const daffProductCompositeRoutingConfigDefaultFactory = (base64: DaffBase64Service): DaffProductCompositeRoutingConfig => ({\n compositeSelectionQueryParam: 'composite_selection',\n compositeSelectionQueryParamDecode: (queryParam: string) => JSON.parse(base64.decode(queryParam)),\n});\n\nexport const DAFF_PRODUCT_COMPOSITE_ROUTING_CONFIG_DEFAULT = new InjectionToken<DaffProductCompositeRoutingConfig>(\n 'DAFF_PRODUCT_COMPOSITE_ROUTING_CONFIG_DEFAULT',\n { factory: () => daffProductCompositeRoutingConfigDefaultFactory(inject(DaffBase64ServiceToken)) },\n);\n","import { createConfigInjectionToken } from '@daffodil/core';\n\nimport { DAFF_PRODUCT_COMPOSITE_ROUTING_CONFIG_DEFAULT } from './default';\nimport { DaffProductCompositeRoutingConfig } from './interface';\n\nexport const {\n /**\n * The token used to provide @daffodil/product-composite/routing config data.\n */\n token: DAFF_PRODUCT_COMPOSITE_ROUTING_CONFIG,\n /**\n * Provides the {@link DAFF_PRODUCT_COMPOSITE_ROUTING_CONFIG} token.\n */\n provider: provideDaffProductCompositeRoutingConfig,\n} = createConfigInjectionToken<DaffProductCompositeRoutingConfig>(DAFF_PRODUCT_COMPOSITE_ROUTING_CONFIG_DEFAULT, 'DAFF_PRODUCT_COMPOSITE_ROUTING_CONFIG');\n","import { DOCUMENT } from '@angular/common';\nimport {\n Inject,\n Injectable,\n} from '@angular/core';\n\nimport {\n DAFF_PRODUCT_COMPOSITE_ROUTING_CONFIG,\n DaffProductCompositeRoutingConfig,\n} from '../config/public_api';\n\n@Injectable()\nexport class DaffProductCompositeQueryParamService {\n\n constructor(\n @Inject(DOCUMENT) private document: any,\n @Inject(DAFF_PRODUCT_COMPOSITE_ROUTING_CONFIG) private config: DaffProductCompositeRoutingConfig) {\n }\n\n /**\n * Get the value of the configured composite selection query param.\n */\n public get(): string {\n return (\n new URL((<any>this.document).location.toString())\n ).searchParams.get(this.config.compositeSelectionQueryParam);\n }\n}\n","import {\n Inject,\n Injectable,\n} from '@angular/core';\nimport {\n Actions,\n createEffect,\n ofType,\n} from '@ngrx/effects';\nimport {\n EMPTY,\n Observable,\n of,\n} from 'rxjs';\nimport {\n map,\n switchMap,\n} from 'rxjs/operators';\n\nimport {\n DaffProduct,\n DaffProductTypeEnum,\n} from '@daffodil/product';\nimport {\n DaffProductPageActionTypes,\n DaffProductPageLoadSuccess,\n} from '@daffodil/product/state';\nimport {\n DaffCompositeProduct,\n DaffCompositeProductItem,\n DaffCompositeProductItemOption,\n DaffProductCompositeSelectionPayload,\n} from '@daffodil/product-composite';\nimport { DaffCompositeProductApplyOption } from '@daffodil/product-composite/state';\n\nimport {\n DaffProductCompositeRoutingConfig,\n DAFF_PRODUCT_COMPOSITE_ROUTING_CONFIG,\n} from '../config/public_api';\nimport { DaffProductCompositeQueryParamService } from '../services/query-param.service';\n\n/**\n * Builds the apply actions from the list of selected options.\n */\nfunction buildApplyActions<T extends DaffCompositeProduct = DaffCompositeProduct>(product: DaffCompositeProduct, itemId: DaffCompositeProductItem['id'], selectedOptions: DaffCompositeProductItemOption['id'][]): DaffCompositeProductApplyOption<T>[] {\n const selectionItem = product.items.find(({ id }) => id === itemId);\n\n return selectionItem\n ? selectedOptions.map(selectionOptionId => {\n // use the quantity of the referenced option\n const qty = selectionItem?.options.find(({ id }) => id === selectionOptionId)?.quantity;\n\n return new DaffCompositeProductApplyOption(product.id, itemId, selectionOptionId, qty);\n })\n : [];\n}\n\n/**\n * Handles composite product specific actions for the product page.\n */\n@Injectable()\nexport class DaffProductCompositePageEffects<T extends DaffCompositeProduct = DaffCompositeProduct> {\n constructor(\n private actions$: Actions,\n private paramGetter: DaffProductCompositeQueryParamService,\n @Inject(DAFF_PRODUCT_COMPOSITE_ROUTING_CONFIG) private config: DaffProductCompositeRoutingConfig,\n ) {}\n\n /**\n * Applies composite item options based on the value of the configured query param.\n */\n preselectCompositeOptions$: Observable<typeof EMPTY | DaffCompositeProductApplyOption<T>> = createEffect(() => this.actions$.pipe(\n ofType(DaffProductPageActionTypes.ProductPageLoadSuccessAction),\n switchMap((action: DaffProductPageLoadSuccess<T>) => {\n const queryParam = this.paramGetter.get();\n\n // get the product corresponding to the current product page\n const product: DaffCompositeProduct = action.payload.products.filter(({ id }) => id === action.payload.id)[0];\n\n // if we don't have a query param set or if the product isn't composite,\n // we have nothing to do\n if (!queryParam || product?.type !== DaffProductTypeEnum.Composite) {\n return EMPTY;\n }\n\n let selection: DaffProductCompositeSelectionPayload;\n\n try {\n selection = this.config.compositeSelectionQueryParamDecode(queryParam, product);\n } catch (error) {\n return EMPTY;\n }\n\n const applyActions = Object.keys(selection).reduce<DaffCompositeProductApplyOption<T>[]>(\n (actions, itemId) => actions.concat(buildApplyActions(product, itemId, selection[itemId])),\n [],\n );\n\n // dispatch each of the apply actions into the action stream\n return of(...applyActions);\n }),\n ));\n}\n","import {\n ModuleWithProviders,\n NgModule,\n} from '@angular/core';\nimport { EffectsModule } from '@ngrx/effects';\n\nimport {\n DaffProductCompositeRoutingConfig,\n provideDaffProductCompositeRoutingConfig,\n} from './config/public_api';\nimport { DaffProductCompositePageEffects } from './effects/public_api';\nimport { DaffProductCompositeQueryParamService } from './services/query-param.service';\n\n@NgModule({\n imports: [\n EffectsModule.forFeature([DaffProductCompositePageEffects]),\n ],\n providers: [\n DaffProductCompositeQueryParamService,\n ],\n})\nexport class DaffProductCompositeRoutingModule {\n static withConfig(config?: DaffProductCompositeRoutingConfig): ModuleWithProviders<DaffProductCompositeRoutingModule> {\n return {\n ngModule: DaffProductCompositeRoutingModule,\n providers: [\n provideDaffProductCompositeRoutingConfig(config),\n ],\n };\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;AAYA;;AAEG;MACU,+CAA+C,GAAG,CAAC,MAAyB,MAAyC;AAChI,IAAA,4BAA4B,EAAE,qBAAqB;AACnD,IAAA,kCAAkC,EAAE,CAAC,UAAkB,KAAK,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;AAClG,CAAA,EAAE;AAEU,MAAA,6CAA6C,GAAG,IAAI,cAAc,CAC7E,+CAA+C,EAC/C,EAAE,OAAO,EAAE,MAAM,+CAA+C,CAAC,MAAM,CAAC,sBAAsB,CAAC,CAAC,EAAE;;ACjBvF,MAAA;AACX;;AAEG;AACH,KA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;YACT,qCAAqC;AACtC,SAAA,EAAA,OAAA,EAAA,CAJC,aAAa,CAAC,UAAU,CAAC,CAAC,+BAA+B,CAAC,CAAC,CAAA,EAAA,CAAA,CAAA,EAAA;;2FAMlD,iCAAiC,EAAA,UAAA,EAAA,CAAA;kBAR7C,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,OAAO,EAAE;AACP,wBAAA,aAAa,CAAC,UAAU,CAAC,CAAC,+BAA+B,CAAC,CAAC;AAC5D,qBAAA;AACD,oBAAA,SAAS,EAAE;wBACT,qCAAqC;AACtC,qBAAA;AACF,iBAAA,CAAA;;;ACpBD;;AAEG;;;;"}
|
@@ -1,9 +1,9 @@
|
|
1
1
|
import * as i0 from '@angular/core';
|
2
|
-
import { Injectable,
|
2
|
+
import { Injectable, inject, NgModule } from '@angular/core';
|
3
3
|
import * as i1 from '@ngrx/store';
|
4
4
|
import { defaultMemoize, createFeatureSelector, createSelector, select, combineReducers, StoreModule } from '@ngrx/store';
|
5
5
|
import { DaffProductTypeEnum, productPriceRangeHasDiscount, productPriceRangeHasPriceRange } from '@daffodil/product';
|
6
|
-
import { daffAdd, daffMultiply, daffDivide, daffSubtract } from '@daffodil/core';
|
6
|
+
import { daffAdd, daffMultiply, daffDivide, daffSubtract, createMultiInjectionToken, createSingleInjectionToken } from '@daffodil/core';
|
7
7
|
import { getDaffProductEntitiesSelectors, DaffProductPageActionTypes, DaffProductActionTypes, DaffBestSellersActionTypes, DaffProductGridActionTypes, DaffProductLoadSuccess, DaffProductPageLoadSuccess, daffProductProvideMetaReducers } from '@daffodil/product/state';
|
8
8
|
import { createEntityAdapter } from '@ngrx/entity';
|
9
9
|
import { daffComposeReducers } from '@daffodil/core/state';
|
@@ -445,12 +445,13 @@ const daffCompositeProductReducers = {
|
|
445
445
|
compositeProductOptions: daffCompositeProductEntitiesReducer,
|
446
446
|
};
|
447
447
|
|
448
|
+
const {
|
448
449
|
/**
|
449
450
|
* A token to hold the injectable extra reducers.
|
450
451
|
*
|
451
452
|
* Prefer using {@link daffProductCompositeProvideExtraReducers}.
|
452
453
|
*/
|
453
|
-
|
454
|
+
token: DAFF_PRODUCT_COMPOSITE_EXTRA_REDUCERS,
|
454
455
|
/**
|
455
456
|
* Provides additional reducers that run after the standard Daffodil cart reducers.
|
456
457
|
*
|
@@ -463,13 +464,7 @@ const DAFF_PRODUCT_COMPOSITE_EXTRA_REDUCERS = new InjectionToken('DAFF_PRODUCT_C
|
|
463
464
|
* ]
|
464
465
|
* ```
|
465
466
|
*/
|
466
|
-
|
467
|
-
return reducers.map(reducer => ({
|
468
|
-
provide: DAFF_PRODUCT_COMPOSITE_EXTRA_REDUCERS,
|
469
|
-
useValue: reducer,
|
470
|
-
multi: true,
|
471
|
-
}));
|
472
|
-
}
|
467
|
+
provider: daffProductCompositeProvideExtraReducers, } = createMultiInjectionToken('DAFF_PRODUCT_COMPOSITE_EXTRA_REDUCERS');
|
473
468
|
|
474
469
|
/**
|
475
470
|
* Maps a list of products, ensuring that the composite products have a list of items.
|
@@ -505,13 +500,18 @@ function daffProductCompositeEnsureItemsMetaReducer(reducer) {
|
|
505
500
|
};
|
506
501
|
}
|
507
502
|
|
503
|
+
const {
|
508
504
|
/**
|
509
505
|
* An internal token to hold the Daffodil composite product reducers.
|
510
506
|
* Includes the extra and standard reducers.
|
511
507
|
*
|
512
508
|
* @docs-private
|
513
509
|
*/
|
514
|
-
|
510
|
+
token: DAFF_PRODUCT_COMPOSITE_REDUCERS,
|
511
|
+
/**
|
512
|
+
* Provider function for {@link DAFF_PRODUCT_COMPOSITE_REDUCERS}.
|
513
|
+
*/
|
514
|
+
provider: provideDaffProductCompositeReducers, } = createSingleInjectionToken('DAFF_PRODUCT_COMPOSITE_REDUCERS', {
|
515
515
|
factory: () => daffComposeReducers([
|
516
516
|
combineReducers(daffCompositeProductReducers),
|
517
517
|
...inject(DAFF_PRODUCT_COMPOSITE_EXTRA_REDUCERS),
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"daffodil-product-composite-state.mjs","sources":["../../../libs/product-composite/state/src/actions/composite-product.actions.ts","../../../libs/product-composite/state/src/reducers/composite-product-entities/composite-product-entities-reducer-adapter.ts","../../../libs/product-composite/state/src/reducers/composite-product-store-feature-key.ts","../../../libs/product-composite/state/src/selectors/feature.selector.ts","../../../libs/product-composite/state/src/selectors/composite-product-entities/composite-product-entities.selectors.ts","../../../libs/product-composite/state/src/selectors/composite-product/composite-product.selectors.ts","../../../libs/product-composite/state/src/selectors/all.selector.ts","../../../libs/product-composite/state/src/facades/composite-product/composite-product.facade.ts","../../../libs/product-composite/state/src/reducers/composite-product-entities/composite-product-entities.reducer.ts","../../../libs/product-composite/state/src/reducers/composite-product-reducers.ts","../../../libs/product-composite/state/src/reducers/injection-tokens/extra.token.ts","../../../libs/product-composite/state/src/helpers/ensure-items.ts","../../../libs/product-composite/state/src/reducers/ensure-items.meta-reducer.ts","../../../libs/product-composite/state/src/reducers/injection-tokens/reducers.token.ts","../../../libs/product-composite/state/src/composite-product-state.module.ts","../../../libs/product-composite/state/src/daffodil-product-composite-state.ts"],"sourcesContent":["import { Action } from '@ngrx/store';\n\nimport {\n DaffCompositeProduct,\n DaffCompositeProductItem,\n DaffCompositeProductItemOption,\n} from '@daffodil/product-composite';\n\n/**\n * Action types for Composite Product Actions.\n */\nexport enum DaffCompositeProductActionTypes {\n CompositeProductApplyOptionAction = '[@daffodil/product-composite] Composite Product Apply Option Action'\n}\n\n/**\n * Applies a product option to a particular composite product.\n *\n * @param id - Id of the Composite Product\n * @param itemId - Id of the product item.\n * @param optionId - Id of the option of the product item that is chosen.\n */\nexport class DaffCompositeProductApplyOption<T extends DaffCompositeProduct = DaffCompositeProduct> implements Action {\n readonly type = DaffCompositeProductActionTypes.CompositeProductApplyOptionAction;\n\n constructor(public id: T['id'], public itemId: DaffCompositeProductItem['id'], public optionId: DaffCompositeProductItemOption['id'], public qty?: number) {}\n}\n\nexport type DaffCompositeProductActions<T extends DaffCompositeProduct = DaffCompositeProduct> =\n\t| DaffCompositeProductApplyOption<T>;\n","import {\n createEntityAdapter,\n EntityState,\n} from '@ngrx/entity';\nimport { defaultMemoize } from '@ngrx/store';\n\nimport { DaffProductTypeEnum } from '@daffodil/product';\nimport {\n DaffCompositeProduct,\n DaffCompositeProductItem,\n DaffCompositeConfigurationItem,\n DaffCompositeProductItemOption,\n} from '@daffodil/product-composite';\n\nimport { DaffCompositeProductEntity } from './composite-product-entity';\n\n/**\n * Composite Product Item Options Adapter for changing/overwriting entity state.\n */\nexport class DaffCompositeProductAppliedOptionsEntitiesAdapter<T extends EntityState<DaffCompositeProductEntity> = EntityState<DaffCompositeProductEntity>> {\n /**\n * @docs-private\n */\n private _adapter = createEntityAdapter<DaffCompositeProductEntity>();\n\n /**\n * Gets the initial entity state.\n */\n getInitialState() {\n return this._adapter.getInitialState();\n }\n\n /**\n * Get the entity selectors.\n */\n getSelectors() {\n return this._adapter.getSelectors();\n }\n\n /**\n * Upserts the given composite products into state.\n */\n upsertProducts(state: T, ...products: DaffCompositeProduct[]): T {\n return this._adapter.upsertMany(\n this.mapOptionsEntities(products),\n state,\n );\n };\n\n /**\n * Apply the specified option for the given composite product item.\n */\n applyOption(state: T, productId: DaffCompositeProduct['id'], itemId: DaffCompositeProductItem['id'], optionId: DaffCompositeProductItemOption['id'], qty?: number) {\n return this._adapter.upsertOne(\n {\n id: productId,\n items: {\n ...state.entities[productId].items,\n [itemId]: {\n value: optionId,\n qty: qty ?? 1,\n },\n },\n },\n state,\n );\n }\n\n /**\n * @docs-private\n */\n private mapOptionsEntities(products: DaffCompositeProduct[]): DaffCompositeProductEntity[] {\n return products.filter(product => product.type === DaffProductTypeEnum.Composite)\n .map(product => this.buildCompositeProductAppliedOptionsEntity(product));\n }\n\n /**\n * @docs-private\n */\n private buildCompositeProductAppliedOptionsEntity(product: DaffCompositeProduct): DaffCompositeProductEntity {\n return {\n id: product.id,\n items: product.items.reduce((acc, item) => ({\n ...acc,\n [item.id]: this.getDefaultOption(item),\n }), {}),\n };\n }\n\n /**\n * Sets the default item option to the specified default option if it is in stock.\n * Does not set a default option if a default is not specified.\n * Does not set a default option but does set a default qty if the default is out of stock.\n *\n * @param item a DaffCompositeProductItem\n * @docs-private\n */\n private getDefaultOption(item: DaffCompositeProductItem): DaffCompositeConfigurationItem {\n const defaultOptionIndex = item.options.findIndex(option => option.is_default);\n\n if(defaultOptionIndex > -1) {\n return {\n value: item.options[defaultOptionIndex].in_stock ? item.options[defaultOptionIndex].id : null,\n qty: item.options[defaultOptionIndex].quantity,\n };\n } else {\n return { value: null, qty: null };\n }\n }\n}\n\n/**\n * Gets the composite product entity adapter singleton.\n */\nexport const daffCompositeProductAppliedOptionsEntitiesAdapter: () => DaffCompositeProductAppliedOptionsEntitiesAdapter = defaultMemoize(() => new DaffCompositeProductAppliedOptionsEntitiesAdapter()).memoized;\n","export const DAFF_COMPOSITE_PRODUCT_STORE_FEATURE_KEY = 'daffCompositeProduct';\n","import {\n createFeatureSelector,\n MemoizedSelector,\n} from '@ngrx/store';\n\nimport { DaffCompositeProductReducersState } from '../reducers/composite-product-reducers-state.interface';\nimport { DAFF_COMPOSITE_PRODUCT_STORE_FEATURE_KEY } from '../reducers/composite-product-store-feature-key';\n\n/**\n * An interface for the composite product feature state.\n */\nexport interface DaffCompositeProductFeatureMemoizedSelector {\n selectCompositeProductState: MemoizedSelector<Record<string, any>, DaffCompositeProductReducersState>;\n}\n\n/**\n * A function that returns a selector for the composite product feature state.\n */\nexport const getDaffCompositeProductFeatureSelector = (() => {\n let cache;\n return (): DaffCompositeProductFeatureMemoizedSelector => cache = cache\n ? cache\n : { selectCompositeProductState: createFeatureSelector<DaffCompositeProductReducersState>(DAFF_COMPOSITE_PRODUCT_STORE_FEATURE_KEY) };\n})();\n","import {\n EntityState,\n Dictionary,\n} from '@ngrx/entity';\nimport {\n createSelector,\n MemoizedSelector,\n defaultMemoize,\n} from '@ngrx/store';\n\nimport {\n DaffProduct,\n DaffProductTypeEnum,\n} from '@daffodil/product';\nimport { getDaffProductEntitiesSelectors } from '@daffodil/product/state';\nimport {\n DaffCompositeProductItemOption,\n DaffCompositeProductItem,\n DaffCompositeProduct,\n} from '@daffodil/product-composite';\n\nimport { daffCompositeProductAppliedOptionsEntitiesAdapter } from '../../reducers/composite-product-entities/composite-product-entities-reducer-adapter';\nimport { DaffCompositeProductEntity } from '../../reducers/composite-product-entities/composite-product-entity';\nimport {\n DaffCompositeProductReducersState,\n DaffCompositeProductStateRootSlice,\n} from '../../reducers/composite-product-reducers-state.interface';\nimport { getDaffCompositeProductFeatureSelector } from '../feature.selector';\n\n/**\n * An interface for selectors related to the composite product applied options.\n */\nexport interface DaffCompositeProductEntitiesMemoizedSelectors<T extends DaffProduct = DaffProduct> {\n /**\n * The ngrx entities state for composite product applied options.\n */\n selectCompositeProductAppliedOptionsEntitiesState: MemoizedSelector<DaffCompositeProductStateRootSlice<T>, EntityState<DaffCompositeProductEntity>>;\n /**\n * A selector for all composite product ids in state.\n */\n selectCompositeProductIds: MemoizedSelector<DaffCompositeProductStateRootSlice<T>, EntityState<DaffCompositeProductEntity>['ids']>;\n /**\n * The ngrx entities for the composite product appllied options.\n */\n selectCompositeProductAppliedOptionsEntities: MemoizedSelector<DaffCompositeProductStateRootSlice<T>, EntityState<DaffCompositeProductEntity>['entities']>;\n /**\n * The total number of composite products in state.\n */\n selectCompositeProductTotal: MemoizedSelector<DaffCompositeProductStateRootSlice<T>, number>;\n /**\n * Selects the applied options for a composite product.\n *\n * @param id the id of the composite product.\n */\n selectCompositeProductAppliedOptions: (id: T['id']) => MemoizedSelector<DaffCompositeProductStateRootSlice<T>, Dictionary<DaffCompositeProductItemOption>>;\n /**\n * Selects whether the particular item of a composite product is required in order for the product to be valid, i.e. addable to the cart.\n *\n * @param id the id of the composite product.\n * @param item_id the id of the composite product item.\n */\n selectIsCompositeProductItemRequired: (id: T['id'], item_id: DaffCompositeProductItem['id']) => MemoizedSelector<DaffCompositeProductStateRootSlice<T>, boolean>;\n}\n\nconst createCompositeProductAppliedOptionsEntitiesSelectors = <T extends DaffProduct>(): DaffCompositeProductEntitiesMemoizedSelectors<T> => {\n const {\n selectCompositeProductState,\n } = getDaffCompositeProductFeatureSelector();\n const {\n selectProduct,\n } = getDaffProductEntitiesSelectors<T>();\n const adapterSelectors = daffCompositeProductAppliedOptionsEntitiesAdapter().getSelectors();\n\n const selectCompositeProductAppliedOptionsEntitiesState = createSelector(\n selectCompositeProductState,\n (state: DaffCompositeProductReducersState) => state.compositeProductOptions,\n );\n\n const selectCompositeProductIds = createSelector(\n selectCompositeProductAppliedOptionsEntitiesState,\n adapterSelectors.selectIds,\n );\n\n const selectCompositeProductAppliedOptionsEntities = createSelector(\n selectCompositeProductAppliedOptionsEntitiesState,\n adapterSelectors.selectEntities,\n );\n\n const selectCompositeProductTotal = createSelector(\n selectCompositeProductAppliedOptionsEntitiesState,\n adapterSelectors.selectTotal,\n );\n\n const selectCompositeProductAppliedOptions = defaultMemoize((id: T['id']) => createSelector(\n selectProduct(id),\n selectCompositeProductAppliedOptionsEntitiesState,\n (product: T, appliedOptions) => {\n if(product.type !== DaffProductTypeEnum.Composite) {\n return undefined;\n }\n\n return (<DaffCompositeProduct><any>product).items.reduce((acc, item) => ({\n ...acc,\n [item.id]: appliedOptions.entities[product.id].items[item.id].value ? {\n ...item.options.find(option => option.id === appliedOptions.entities[product.id].items[item.id].value),\n quantity: appliedOptions.entities[product.id].items[item.id].qty,\n } : null,\n }), {});\n },\n )).memoized;\n\n const selectIsCompositeProductItemRequired = defaultMemoize((id: T['id'], item_id: DaffCompositeProductItem['id']) => createSelector(\n selectProduct(id),\n (product: T) => {\n if(product.type !== DaffProductTypeEnum.Composite) {\n return undefined;\n }\n\n const productItem = (<DaffCompositeProduct><any>product).items.find(item => item.id === item_id);\n\n return productItem ? productItem.required : null;\n },\n )).memoized;\n\n\n return {\n selectCompositeProductAppliedOptionsEntitiesState,\n selectCompositeProductIds,\n selectCompositeProductAppliedOptionsEntities,\n selectCompositeProductTotal,\n selectCompositeProductAppliedOptions,\n selectIsCompositeProductItemRequired,\n };\n};\n\n/**\n * A function that returns all selectors related to composite product applied option entities.\n * Returns {@link DaffCompositeProductEntitiesMemoizedSelectors}.\n */\nexport const getDaffCompositeProductEntitiesSelectors = (() => {\n let cache;\n return <T extends DaffProduct>(): DaffCompositeProductEntitiesMemoizedSelectors<T> => cache = cache\n ? cache\n : createCompositeProductAppliedOptionsEntitiesSelectors<T>();\n})();\n","import {\n Dictionary,\n EntityState,\n} from '@ngrx/entity';\nimport {\n createSelector,\n MemoizedSelector,\n defaultMemoize,\n} from '@ngrx/store';\n\nimport {\n daffAdd,\n daffDivide,\n daffMultiply,\n daffSubtract,\n} from '@daffodil/core';\nimport {\n DaffProduct,\n DaffProductTypeEnum,\n DaffProductPrices,\n DaffPriceRange,\n} from '@daffodil/product';\nimport { getDaffProductEntitiesSelectors } from '@daffodil/product/state';\nimport {\n DaffCompositeProduct,\n DaffCompositeConfigurationItem,\n DaffCompositeProductItem,\n DaffCompositeProductItemOption,\n} from '@daffodil/product-composite';\n\nimport { DaffCompositeProductStateRootSlice } from '../../reducers/composite-product-reducers-state.interface';\nimport { DaffCompositeProductEntity } from '../../reducers/public_api';\nimport { getDaffCompositeProductEntitiesSelectors } from '../composite-product-entities/composite-product-entities.selectors';\n\n/**\n * An interface describing selectors unique to the composite product, such as pricing and discounts.\n */\nexport interface DaffCompositeProductMemoizedSelectors<T extends DaffProduct = DaffProduct> {\n /**\n * Get a DaffPriceRange for a composite product based on the configuration provided excluding unselected, optional item prices.\n */\n selectCompositeProductRequiredItemPricesForConfiguration: ( id: DaffCompositeProduct['id'], configuration?: Dictionary<DaffCompositeConfigurationItem> ) => MemoizedSelector<DaffCompositeProductStateRootSlice<T>, DaffPriceRange>;\n /**\n * Get the broadest possible DaffPriceRange for a composite product based on the configuration provided including optional item prices.\n */\n selectCompositeProductOptionalItemPricesForConfiguration: ( id: DaffCompositeProduct['id'], configuration?: Dictionary<DaffCompositeConfigurationItem> ) => MemoizedSelector<DaffCompositeProductStateRootSlice<T>, DaffPriceRange>;\n /**\n * Get the DaffPriceRange for a composite product based on the current configuration of selected item options in redux state and\n * excluding unselected, optional item prices.\n */\n selectCompositeProductPricesAsCurrentlyConfigured: ( id: DaffCompositeProduct['id'] ) => MemoizedSelector<DaffCompositeProductStateRootSlice<T>, DaffPriceRange>;\n /**\n * Get the discount amount for a composite product. This value will be undefined if all required options are not chosen.\n */\n selectCompositeProductDiscountAmount: ( id: DaffCompositeProduct['id'] ) => MemoizedSelector<DaffCompositeProductStateRootSlice<T>, number>;\n /**\n * Get the discount percent for a composite product. This value will be undefined if all required options are not chosen.\n * Note: this percent is computed client-side and should be treated as an estimate rather than an exact value.\n */\n selectCompositeProductDiscountPercent: ( id: DaffCompositeProduct['id'] ) => MemoizedSelector<DaffCompositeProductStateRootSlice<T>, number>;\n}\n\nconst createCompositeProductSelectors = <T extends DaffProduct>(): DaffCompositeProductMemoizedSelectors<T> => {\n\n const {\n selectProduct,\n } = getDaffProductEntitiesSelectors<T>();\n\n const {\n selectCompositeProductAppliedOptionsEntities,\n } = getDaffCompositeProductEntitiesSelectors();\n\n const selectCompositeProductRequiredItemPricesForConfiguration = defaultMemoize((id: DaffCompositeProduct['id'], configuration?: Dictionary<DaffCompositeConfigurationItem>) => createSelector(\n selectProduct(id),\n (product: T) => {\n if(product.type !== DaffProductTypeEnum.Composite) {\n return undefined;\n }\n\n const appliedOptions = configuration ? getAppliedOptionsForConfiguration(<DaffCompositeProduct><any>product, configuration) : {};\n return {\n minPrice: getMinPricesForConfiguration(<DaffCompositeProduct><any>product, appliedOptions),\n maxPrice: getMaxPricesForConfiguration(<DaffCompositeProduct><any>product, appliedOptions),\n };\n },\n )).memoized;\n\n const selectCompositeProductOptionalItemPricesForConfiguration = defaultMemoize((id: DaffCompositeProduct['id'], configuration?: Dictionary<DaffCompositeConfigurationItem>) => createSelector(\n selectProduct(id),\n (product: T) => {\n if(product.type !== DaffProductTypeEnum.Composite) {\n return undefined;\n }\n\n const appliedOptions = configuration ? getAppliedOptionsForConfiguration(<DaffCompositeProduct><any>product, configuration) : {};\n return {\n minPrice: getMinPricesForConfiguration(<DaffCompositeProduct><any>product, appliedOptions),\n maxPrice: getMaxPricesForConfigurationIncludingOptionalItems(<DaffCompositeProduct><any>product, appliedOptions),\n };\n },\n )).memoized;\n\n const selectCompositeProductPricesAsCurrentlyConfigured = defaultMemoize((id: T['id']) => createSelector<DaffCompositeProductStateRootSlice<T>, [T, EntityState<DaffCompositeProductEntity>['entities']], DaffPriceRange>(\n selectProduct(id),\n selectCompositeProductAppliedOptionsEntities,\n (product: T, appliedOptionsEntities) =>\n selectCompositeProductRequiredItemPricesForConfiguration(id, appliedOptionsEntities[id]?.items || null).projector(product),\n )).memoized;\n\n const selectCompositeProductDiscountAmount = defaultMemoize((id: DaffCompositeProduct['id']) => createSelector<DaffCompositeProductStateRootSlice<T>, [T, EntityState<DaffCompositeProductEntity>['entities']], number>(\n selectProduct(id),\n selectCompositeProductAppliedOptionsEntities,\n (product: T, appliedOptionsEntities) => {\n if(product.type !== DaffProductTypeEnum.Composite) {\n return undefined;\n }\n const appliedConfigurationItem = appliedOptionsEntities[product.id].items;\n if((<DaffCompositeProduct><any>product).items.filter(item => item.required && appliedConfigurationItem[item.id].value === null).length > 0) {\n return undefined;\n }\n const appliedOptions = getAppliedOptionsForConfiguration((<DaffCompositeProduct><any>product), appliedConfigurationItem);\n\n return (<DaffCompositeProduct><any>product).items.reduce((acc, item) =>\n appliedOptions[item.id]?.discount?.amount ? daffAdd(acc, daffMultiply(appliedOptions[item.id].discount.amount, appliedOptions[item.id].quantity)) : acc,\n product.discount.amount);\n },\n )).memoized;\n\n const selectCompositeProductDiscountPercent = defaultMemoize((id: DaffCompositeProduct['id']) => createSelector<DaffCompositeProductStateRootSlice<T>, [T, EntityState<DaffCompositeProductEntity>['entities']], number>(\n selectProduct(id),\n selectCompositeProductAppliedOptionsEntities,\n (product: T, appliedOptionsEntities) => {\n if(product.type !== DaffProductTypeEnum.Composite) {\n return undefined;\n }\n const appliedOptions = appliedOptionsEntities[product.id].items;\n if((<DaffCompositeProduct><any>product).items.filter(item => item.required && appliedOptions[item.id].value === null).length > 0) {\n return undefined;\n }\n\n const prices = getMinPricesForConfiguration(\n (<DaffCompositeProduct><any>product),\n getAppliedOptionsForConfiguration((<DaffCompositeProduct><any>product), appliedOptions),\n );\n\n return daffMultiply(\n daffDivide(\n daffSubtract(prices.originalPrice, prices.discountedPrice),\n prices.originalPrice,\n ),\n 100,\n );\n },\n )).memoized;\n\n return {\n selectCompositeProductRequiredItemPricesForConfiguration,\n selectCompositeProductOptionalItemPricesForConfiguration,\n selectCompositeProductPricesAsCurrentlyConfigured,\n selectCompositeProductDiscountAmount,\n selectCompositeProductDiscountPercent,\n };\n};\n\n/**\n * A function that returns all selectors related to the composite product feature.\n *\n * Returns {@link DaffCompositeProductMemoizedSelectors}.\n */\nexport const getDaffCompositeProductPriceSelectors = (() => {\n let cache;\n return <T extends DaffProduct = DaffProduct>(): DaffCompositeProductMemoizedSelectors<T> => cache = cache\n ? cache\n : createCompositeProductSelectors<T>();\n})();\n\n/**\n * The minimum price of an item is zero if the item is optional.\n *\n * @param item DaffCompositeProductItem\n */\nfunction getMinimumRequiredCompositeItemPrice(item: DaffCompositeProductItem, qty: number): number {\n return item.required ? daffMultiply(Math.min(...item.options.map(option => option.price)), qty) : 0;\n}\n\n/**\n * The maximum price for an item is zero if the item is optional.\n *\n * @param item DaffCompositeProductItem\n */\nfunction getMaximumRequiredCompositeItemPrice(item: DaffCompositeProductItem, qty: number): number {\n return item.required ? daffMultiply(Math.max(...item.options.map(option => option.price)), qty) : 0;\n}\n\n/**\n * The minimum discounted price of an item is zero if the item is optional.\n *\n * @param item DaffCompositeProductItem\n */\nfunction getMinimumRequiredCompositeItemDiscountedPrice(item: DaffCompositeProductItem, qty: number): number {\n return item.required ? daffMultiply(Math.min(...item.options.map(getDiscountedPrice)), qty) : 0;\n}\n/**\n * The maximum discounted price of an item is zero if the item is optional.\n *\n * @param item DaffCompositeProductItem\n */\nfunction getMaximumRequiredCompositeItemDiscountedPrice(item: DaffCompositeProductItem, qty: number): number {\n return item.required ? daffMultiply(Math.max(...item.options.map(getDiscountedPrice)), qty) : 0;\n}\n\n/**\n * Gets the minimum prices of a composite product for the configuration provided excluding unselected, optional item prices.\n *\n * @param product a DaffCompositeProduct\n * @param appliedOptions a Dictionary<DaffCompositeProductItemOption> that determines the current configuration of the composite product.\n */\nfunction getMinPricesForConfiguration(product: DaffCompositeProduct, appliedOptions: Dictionary<DaffCompositeProductItemOption>): DaffProductPrices {\n return {\n discountedPrice: product.items.reduce((acc, item) => daffAdd(\n acc,\n appliedOptionHasId(appliedOptions[item.id]) ?\n daffMultiply(getDiscountedPrice(appliedOptions[item.id]), appliedOptions[item.id].quantity) :\n getMinimumRequiredCompositeItemDiscountedPrice(item, getOptionQty(appliedOptions[item.id])),\n ), getDiscountedPrice(product)),\n discount: { amount: null, percent: null },\n originalPrice: product.items.reduce((acc, item) => daffAdd(\n acc,\n appliedOptionHasId(appliedOptions[item.id]) ?\n daffMultiply(appliedOptions[item.id].price, appliedOptions[item.id].quantity) :\n getMinimumRequiredCompositeItemPrice(item, getOptionQty(appliedOptions[item.id])),\n ), product.price),\n };\n}\n\n/**\n * Gets the maximum prices of a composite product for the configuration provided excluding unselected, optional item prices.\n *\n * @param product a DaffCompositeProduct\n * @param appliedOptions a Dictionary<DaffCompositeProductItemOption> that determines the current configuration of the composite product.\n */\nfunction getMaxPricesForConfiguration(product: DaffCompositeProduct, appliedOptions: Dictionary<DaffCompositeProductItemOption>): DaffProductPrices {\n return {\n discountedPrice: product.items.reduce((acc, item) => daffAdd(\n acc,\n appliedOptionHasId(appliedOptions[item.id]) ?\n daffMultiply(getDiscountedPrice(appliedOptions[item.id]), appliedOptions[item.id].quantity) :\n getMaximumRequiredCompositeItemDiscountedPrice(item, getOptionQty(appliedOptions[item.id])),\n ), getDiscountedPrice(product)),\n discount: { amount: null, percent: null },\n originalPrice: product.items.reduce((acc, item) => daffAdd(\n acc,\n appliedOptionHasId(appliedOptions[item.id]) ?\n daffMultiply(appliedOptions[item.id].price, appliedOptions[item.id].quantity) :\n getMaximumRequiredCompositeItemPrice(item, getOptionQty(appliedOptions[item.id])),\n ), product.price),\n };\n}\n\nfunction getDiscountedPrice(product: DaffProduct): number {\n return product.discount ? daffSubtract(product.price, product.discount.amount) : product.price;\n}\n\n/**\n * Gets the maximum prices of a composite product including optional item prices.\n *\n * @param product a DaffCompositeProduct\n */\nfunction getMaxPricesForConfigurationIncludingOptionalItems(product: DaffCompositeProduct, appliedOptions: Dictionary<DaffCompositeProductItemOption>): DaffProductPrices {\n return {\n discountedPrice: product.items.reduce((acc, item) => daffAdd(\n acc,\n appliedOptionHasId(appliedOptions[item.id]) ?\n daffMultiply(getDiscountedPrice(appliedOptions[item.id]), appliedOptions[item.id].quantity) :\n appliedOptionHasQty(appliedOptions[item.id]) ?\n daffMultiply(Math.max(...item.options.map(getDiscountedPrice)), appliedOptions[item.id].quantity) :\n Math.max(...item.options.map(getDiscountedPrice)),\n ), getDiscountedPrice(product)),\n discount: { amount: null, percent: null },\n originalPrice: product.items.reduce((acc, item) => daffAdd(\n acc,\n appliedOptionHasId(appliedOptions[item.id]) ?\n daffMultiply(appliedOptions[item.id].price, appliedOptions[item.id].quantity) :\n appliedOptionHasQty(appliedOptions[item.id]) ?\n daffMultiply(Math.max(...item.options.map(option => option.price)), appliedOptions[item.id].quantity) :\n Math.max(...item.options.map(option => option.price)),\n ), product.price),\n };\n}\n\n/**\n * Takes a product and a set of option configurations and convert it into a dictionary of the full option objects.\n *\n * @param product a DaffCompositeProduct\n * @param configuration a Dictionary<DaffCompositeConfigurationItem> used to build the appliedOptions object.\n */\nfunction getAppliedOptionsForConfiguration(product: DaffCompositeProduct, configuration: Dictionary<DaffCompositeConfigurationItem>): Dictionary<DaffCompositeProductItemOption> {\n return product.items.reduce((acc, item) => ({\n ...acc,\n [item.id]: configuration[item.id] ? {\n ...item.options.find(option => option.id === configuration[item.id].value),\n quantity: (configuration[item.id].qty === null || configuration[item.id].qty === undefined) ? 1 : configuration[item.id].qty,\n } : null,\n }), {});\n}\n\nfunction appliedOptionHasId(appliedOption: DaffCompositeProductItemOption): boolean {\n return !!appliedOption?.id;\n}\n\nfunction getOptionQty(appliedOption: DaffCompositeProductItemOption): number {\n return appliedOptionHasQty(appliedOption) ? appliedOption.quantity : 1;\n}\n\nfunction appliedOptionHasQty(appliedOption: DaffCompositeProductItemOption): boolean {\n return appliedOption?.quantity !== null && appliedOption?.quantity !== undefined;\n}\n","import { DaffProduct } from '@daffodil/product';\n\nimport {\n DaffCompositeProductMemoizedSelectors,\n getDaffCompositeProductPriceSelectors,\n} from './composite-product/composite-product.selectors';\nimport {\n DaffCompositeProductEntitiesMemoizedSelectors,\n getDaffCompositeProductEntitiesSelectors,\n} from './composite-product-entities/composite-product-entities.selectors';\n\n/**\n * An interface for all selectors in the composite product feature area.\n */\nexport interface DaffCompositeProductAllSelectors<T extends DaffProduct = DaffProduct> extends\n DaffCompositeProductEntitiesMemoizedSelectors<T>,\n DaffCompositeProductMemoizedSelectors<T> { }\n\n/**\n * A function that returns all selectors in the composite product feature area.\n * Returns {@link DaffCompositeProductAllSelectors}.\n */\nexport const getDaffCompositeProductSelectors = <T extends DaffProduct>(): DaffCompositeProductAllSelectors<T> => ({\n ...getDaffCompositeProductEntitiesSelectors<T>(),\n ...getDaffCompositeProductPriceSelectors<T>(),\n});\n","import { Injectable } from '@angular/core';\nimport { Dictionary } from '@ngrx/entity';\nimport {\n Store,\n select,\n Action,\n} from '@ngrx/store';\nimport { Observable } from 'rxjs';\n\nimport {\n DaffProduct,\n DaffPriceRange,\n productPriceRangeHasDiscount,\n productPriceRangeHasPriceRange,\n} from '@daffodil/product';\nimport {\n DaffCompositeConfigurationItem,\n DaffCompositeProductItemOption,\n DaffCompositeProductItem,\n} from '@daffodil/product-composite';\n\nimport { DaffCompositeProductFacadeInterface } from './composite-product-facade.interface';\nimport { DaffCompositeProductStateRootSlice } from '../../reducers/composite-product-reducers-state.interface';\nimport { getDaffCompositeProductSelectors } from '../../selectors/public_api';\n\n/**\n * A facade for interacting with the composite product state.\n * Exposes many parts of the state for easy access and allows dispatching of actions.\n *\n * @inheritdoc\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffCompositeProductFacade<T extends DaffProduct = DaffProduct> implements DaffCompositeProductFacadeInterface {\n\n constructor(private store: Store<DaffCompositeProductStateRootSlice<T>>) {}\n\n compositeProductSelectors = getDaffCompositeProductSelectors<T>();\n\n hasDiscount = productPriceRangeHasDiscount;\n\n hasPriceRange = productPriceRangeHasPriceRange;\n\n getRequiredItemPricesForConfiguration(id: T['id'], configuration?: Dictionary<DaffCompositeConfigurationItem>): Observable<DaffPriceRange> {\n return this.store.pipe(select(this.compositeProductSelectors.selectCompositeProductRequiredItemPricesForConfiguration(id, configuration)));\n }\n\n getOptionalItemPricesForConfiguration(id: T['id'], configuration?: Dictionary<DaffCompositeConfigurationItem>): Observable<DaffPriceRange> {\n return this.store.pipe(select(this.compositeProductSelectors.selectCompositeProductOptionalItemPricesForConfiguration(id, configuration)));\n }\n\n getPricesAsCurrentlyConfigured(id: T['id']): Observable<DaffPriceRange> {\n return this.store.pipe(select(this.compositeProductSelectors.selectCompositeProductPricesAsCurrentlyConfigured(id)));\n }\n\n getAppliedOptions(id: T['id']): Observable<Dictionary<DaffCompositeProductItemOption>> {\n return this.store.pipe(select(this.compositeProductSelectors.selectCompositeProductAppliedOptions(id)));\n }\n\n getDiscountAmount(id: T['id']): Observable<number> {\n return this.store.pipe(select(this.compositeProductSelectors.selectCompositeProductDiscountAmount(id)));\n }\n\n getDiscountPercent(id: T['id']): Observable<number> {\n return this.store.pipe(select(this.compositeProductSelectors.selectCompositeProductDiscountPercent(id)));\n }\n\n isItemRequired(id: T['id'], item_id: DaffCompositeProductItem['id']) {\n return this.store.pipe(select(this.compositeProductSelectors.selectIsCompositeProductItemRequired(id, item_id)));\n }\n\n dispatch(action: Action) {\n this.store.dispatch(action);\n }\n}\n","import { EntityState } from '@ngrx/entity';\n\nimport { DaffProduct } from '@daffodil/product';\nimport {\n DaffProductPageActions,\n DaffProductPageActionTypes,\n DaffProductGridActionTypes,\n DaffProductGridActions,\n DaffBestSellersActions,\n DaffProductActions,\n DaffBestSellersActionTypes,\n DaffProductActionTypes,\n} from '@daffodil/product/state';\nimport { DaffCompositeProduct } from '@daffodil/product-composite';\n\nimport { daffCompositeProductAppliedOptionsEntitiesAdapter } from './composite-product-entities-reducer-adapter';\nimport { DaffCompositeProductEntity } from './composite-product-entity';\nimport {\n DaffCompositeProductActions,\n DaffCompositeProductActionTypes,\n} from '../../actions/public_api';\n\n/**\n * Reducer function that catches actions and changes/overwrites composite product entities state.\n *\n * @param state current State of the redux store\n * @param action ProductGrid, BestSellers, Product, or Composite Product actions\n * @returns Product entities state\n */\nexport function daffCompositeProductEntitiesReducer<T extends DaffProduct, V extends DaffCompositeProduct>(\n state = daffCompositeProductAppliedOptionsEntitiesAdapter().getInitialState(),\n action: DaffProductGridActions<T> | DaffBestSellersActions<T> | DaffProductActions<T> | DaffProductPageActions<T> | DaffCompositeProductActions<V>): EntityState<DaffCompositeProductEntity> {\n const adapter = daffCompositeProductAppliedOptionsEntitiesAdapter();\n switch (action.type) {\n case DaffProductGridActionTypes.ProductGridLoadSuccessAction:\n case DaffBestSellersActionTypes.BestSellersLoadSuccessAction:\n return adapter.upsertProducts(state, ...(<V[]><unknown>action.payload));\n\n case DaffProductActionTypes.ProductLoadSuccessAction:\n case DaffProductPageActionTypes.ProductPageLoadSuccessAction:\n return adapter.upsertProducts(state, ...(<V[]><unknown>action.payload.products));\n\n case DaffCompositeProductActionTypes.CompositeProductApplyOptionAction:\n return adapter.applyOption(state, action.id, action.itemId, action.optionId, action.qty);\n\n default:\n return state;\n }\n}\n","import { ActionReducerMap } from '@ngrx/store';\n\nimport { daffCompositeProductEntitiesReducer } from './composite-product-entities/composite-product-entities.reducer';\nimport { DaffCompositeProductReducersState } from './composite-product-reducers-state.interface';\n\n/**\n * Returns state values from all composite product related reducers.\n */\nexport const daffCompositeProductReducers: ActionReducerMap<DaffCompositeProductReducersState> = {\n compositeProductOptions: daffCompositeProductEntitiesReducer,\n};\n","import {\n InjectionToken,\n Provider,\n} from '@angular/core';\nimport { ActionReducer } from '@ngrx/store';\n\nimport { DaffCompositeProductReducersState } from '../composite-product-reducers-state.interface';\n\n/**\n * A token to hold the injectable extra reducers.\n *\n * Prefer using {@link daffProductCompositeProvideExtraReducers}.\n */\nexport const DAFF_PRODUCT_COMPOSITE_EXTRA_REDUCERS = new InjectionToken<ActionReducer<DaffCompositeProductReducersState>[]>(\n 'DAFF_PRODUCT_COMPOSITE_EXTRA_REDUCERS',\n { factory: () => []},\n);\n\n/**\n * Provides additional reducers that run after the standard Daffodil cart reducers.\n *\n * ```ts\n * providers: [\n * ...daffProductCompositeProvideExtraReducers(\n * myReducer1,\n * myReducer2\n * )\n * ]\n * ```\n */\nexport function daffProductCompositeProvideExtraReducers(\n ...reducers: ActionReducer<Partial<DaffCompositeProductReducersState>>[]\n): Provider[] {\n return reducers.map(reducer => ({\n provide: DAFF_PRODUCT_COMPOSITE_EXTRA_REDUCERS,\n useValue: reducer,\n multi: true,\n }));\n}\n","import { DaffProductTypeEnum } from '@daffodil/product';\nimport { DaffProductReducersState } from '@daffodil/product/state';\nimport { DaffCompositeProduct } from '@daffodil/product-composite';\n\n/**\n * Maps a list of products, ensuring that the composite products have a list of items.\n * If the incoming items is empty or nully, the items from state are intentionally used instead.\n */\nexport function daffProductCompositeEnsureItems<T extends DaffCompositeProduct = DaffCompositeProduct>(state: DaffProductReducersState<T>, products: T[]): T[] {\n return products.map((product) =>\n product.type === DaffProductTypeEnum.Composite\n ? {\n ...product,\n items: product.items.length > 0\n ? product.items\n : state.products.entities[product.id]?.items ?? [],\n }\n : product,\n );\n}\n","import { ActionReducer } from '@ngrx/store';\n\nimport { DaffProductTypeEnum } from '@daffodil/product';\nimport {\n DaffProductActionTypes,\n DaffProductActions,\n DaffProductLoadSuccess,\n DaffProductPageActionTypes,\n DaffProductPageActions,\n DaffProductPageLoadSuccess,\n DaffProductReducersState,\n} from '@daffodil/product/state';\nimport { DaffCompositeProduct } from '@daffodil/product-composite';\n\nimport { daffProductCompositeEnsureItems } from '../helpers/public_api';\n\ntype Reducer = ActionReducer<DaffProductReducersState<DaffCompositeProduct>, DaffProductActions<DaffCompositeProduct> | DaffProductPageActions<DaffCompositeProduct>>;\n\nexport function daffProductCompositeEnsureItemsMetaReducer(reducer: Reducer): Reducer {\n return (state, action) => {\n switch (action.type) {\n case DaffProductPageActionTypes.ProductPageLoadSuccessAction:\n return reducer(state, new DaffProductPageLoadSuccess({\n ...action.payload,\n products: daffProductCompositeEnsureItems(state, action.payload.products),\n }));\n\n case DaffProductActionTypes.ProductLoadSuccessAction:\n return reducer(state, new DaffProductLoadSuccess({\n ...action.payload,\n products: daffProductCompositeEnsureItems(state, action.payload.products),\n }));\n\n default:\n return reducer(state, action);\n }\n };\n}\n","import {\n inject,\n InjectionToken,\n} from '@angular/core';\nimport {\n ActionReducer,\n combineReducers,\n} from '@ngrx/store';\n\nimport { daffComposeReducers } from '@daffodil/core/state';\n\nimport { DAFF_PRODUCT_COMPOSITE_EXTRA_REDUCERS } from './extra.token';\nimport { daffCompositeProductReducers } from '../composite-product-reducers';\nimport { DaffCompositeProductReducersState } from '../composite-product-reducers-state.interface';\n\n/**\n * An internal token to hold the Daffodil composite product reducers.\n * Includes the extra and standard reducers.\n *\n * @docs-private\n */\nexport const DAFF_PRODUCT_COMPOSITE_REDUCERS = new InjectionToken<ActionReducer<DaffCompositeProductReducersState>>(\n 'DAFF_PRODUCT_COMPOSITE_REDUCERS',\n {\n factory: () => daffComposeReducers([\n combineReducers(daffCompositeProductReducers),\n ...inject(DAFF_PRODUCT_COMPOSITE_EXTRA_REDUCERS),\n ]),\n },\n);\n","import { NgModule } from '@angular/core';\nimport { StoreModule } from '@ngrx/store';\n\nimport { daffProductProvideMetaReducers } from '@daffodil/product/state';\n\nimport { daffProductCompositeEnsureItemsMetaReducer } from './reducers/ensure-items.meta-reducer';\nimport { DAFF_PRODUCT_COMPOSITE_REDUCERS } from './reducers/injection-tokens/reducers.token';\nimport { DAFF_COMPOSITE_PRODUCT_STORE_FEATURE_KEY } from './reducers/public_api';\n\n/**\n * A module that provides the default reducers and effects for composite product redux state.\n */\n@NgModule({\n imports: [\n StoreModule.forFeature(DAFF_COMPOSITE_PRODUCT_STORE_FEATURE_KEY, DAFF_PRODUCT_COMPOSITE_REDUCERS),\n ],\n providers: [\n ...daffProductProvideMetaReducers(daffProductCompositeEnsureItemsMetaReducer),\n ],\n})\nexport class DaffCompositeProductStateModule { }\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;AAQA;;AAEG;IACS,gCAEX;AAFD,CAAA,UAAY,+BAA+B,EAAA;AACzC,IAAA,+BAAA,CAAA,mCAAA,CAAA,GAAA,qEAAyG,CAAA;AAC3G,CAAC,EAFW,+BAA+B,KAA/B,+BAA+B,GAE1C,EAAA,CAAA,CAAA,CAAA;AAED;;;;;;AAMG;MACU,+BAA+B,CAAA;AAG1C,IAAA,WAAA,CAAmB,EAAW,EAAS,MAAsC,EAAS,QAA8C,EAAS,GAAY,EAAA;QAAtI,IAAE,CAAA,EAAA,GAAF,EAAE,CAAS;QAAS,IAAM,CAAA,MAAA,GAAN,MAAM,CAAgC;QAAS,IAAQ,CAAA,QAAA,GAAR,QAAQ,CAAsC;QAAS,IAAG,CAAA,GAAA,GAAH,GAAG,CAAS;AAFhJ,QAAA,IAAA,CAAA,IAAI,GAAG,+BAA+B,CAAC,iCAAiC,CAAC;KAE2E;AAC9J;;ACVD;;AAEG;MACU,iDAAiD,CAAA;AAA9D,IAAA,WAAA,GAAA;AACE;;AAEG;QACK,IAAQ,CAAA,QAAA,GAAG,mBAAmB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J/B,SAAA,EAAA;YACT,GAAG,8BAA8B,CAAC,0CAA0C,CAAC;AAC9E,SAAA,EAAA,OAAA,EAAA,CAJC,WAAW,CAAC,UAAU,CAAC,wCAAwC,EAAE,+BAA+B,CAAC,CAAA,EAAA,CAAA,CAAA,EAAA;;2FAMxF,+BAA+B,EAAA,UAAA,EAAA,CAAA;kBAR3C,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,OAAO,EAAE;AACP,wBAAA,WAAW,CAAC,UAAU,CAAC,wCAAwC,EAAE,+BAA+B,CAAC;AAClG,qBAAA;AACD,oBAAA,SAAS,EAAE;wBACT,GAAG,8BAA8B,CAAC,0CAA0C,CAAC;AAC9E,qBAAA;AACF,iBAAA,CAAA;;;ACnBD;;AAEG;;;;"}
|
1
|
+
{"version":3,"file":"daffodil-product-composite-state.mjs","sources":["../../../libs/product-composite/state/src/actions/composite-product.actions.ts","../../../libs/product-composite/state/src/reducers/composite-product-entities/composite-product-entities-reducer-adapter.ts","../../../libs/product-composite/state/src/reducers/composite-product-store-feature-key.ts","../../../libs/product-composite/state/src/selectors/feature.selector.ts","../../../libs/product-composite/state/src/selectors/composite-product-entities/composite-product-entities.selectors.ts","../../../libs/product-composite/state/src/selectors/composite-product/composite-product.selectors.ts","../../../libs/product-composite/state/src/selectors/all.selector.ts","../../../libs/product-composite/state/src/facades/composite-product/composite-product.facade.ts","../../../libs/product-composite/state/src/reducers/composite-product-entities/composite-product-entities.reducer.ts","../../../libs/product-composite/state/src/reducers/composite-product-reducers.ts","../../../libs/product-composite/state/src/reducers/injection-tokens/extra.token.ts","../../../libs/product-composite/state/src/helpers/ensure-items.ts","../../../libs/product-composite/state/src/reducers/ensure-items.meta-reducer.ts","../../../libs/product-composite/state/src/reducers/injection-tokens/reducers.token.ts","../../../libs/product-composite/state/src/composite-product-state.module.ts","../../../libs/product-composite/state/src/daffodil-product-composite-state.ts"],"sourcesContent":["import { Action } from '@ngrx/store';\n\nimport {\n DaffCompositeProduct,\n DaffCompositeProductItem,\n DaffCompositeProductItemOption,\n} from '@daffodil/product-composite';\n\n/**\n * Action types for Composite Product Actions.\n */\nexport enum DaffCompositeProductActionTypes {\n CompositeProductApplyOptionAction = '[@daffodil/product-composite] Composite Product Apply Option Action'\n}\n\n/**\n * Applies a product option to a particular composite product.\n *\n * @param id - Id of the Composite Product\n * @param itemId - Id of the product item.\n * @param optionId - Id of the option of the product item that is chosen.\n */\nexport class DaffCompositeProductApplyOption<T extends DaffCompositeProduct = DaffCompositeProduct> implements Action {\n readonly type = DaffCompositeProductActionTypes.CompositeProductApplyOptionAction;\n\n constructor(public id: T['id'], public itemId: DaffCompositeProductItem['id'], public optionId: DaffCompositeProductItemOption['id'], public qty?: number) {}\n}\n\nexport type DaffCompositeProductActions<T extends DaffCompositeProduct = DaffCompositeProduct> =\n\t| DaffCompositeProductApplyOption<T>;\n","import {\n createEntityAdapter,\n EntityState,\n} from '@ngrx/entity';\nimport { defaultMemoize } from '@ngrx/store';\n\nimport { DaffProductTypeEnum } from '@daffodil/product';\nimport {\n DaffCompositeProduct,\n DaffCompositeProductItem,\n DaffCompositeConfigurationItem,\n DaffCompositeProductItemOption,\n} from '@daffodil/product-composite';\n\nimport { DaffCompositeProductEntity } from './composite-product-entity';\n\n/**\n * Composite Product Item Options Adapter for changing/overwriting entity state.\n */\nexport class DaffCompositeProductAppliedOptionsEntitiesAdapter<T extends EntityState<DaffCompositeProductEntity> = EntityState<DaffCompositeProductEntity>> {\n /**\n * @docs-private\n */\n private _adapter = createEntityAdapter<DaffCompositeProductEntity>();\n\n /**\n * Gets the initial entity state.\n */\n getInitialState() {\n return this._adapter.getInitialState();\n }\n\n /**\n * Get the entity selectors.\n */\n getSelectors() {\n return this._adapter.getSelectors();\n }\n\n /**\n * Upserts the given composite products into state.\n */\n upsertProducts(state: T, ...products: DaffCompositeProduct[]): T {\n return this._adapter.upsertMany(\n this.mapOptionsEntities(products),\n state,\n );\n };\n\n /**\n * Apply the specified option for the given composite product item.\n */\n applyOption(state: T, productId: DaffCompositeProduct['id'], itemId: DaffCompositeProductItem['id'], optionId: DaffCompositeProductItemOption['id'], qty?: number) {\n return this._adapter.upsertOne(\n {\n id: productId,\n items: {\n ...state.entities[productId].items,\n [itemId]: {\n value: optionId,\n qty: qty ?? 1,\n },\n },\n },\n state,\n );\n }\n\n /**\n * @docs-private\n */\n private mapOptionsEntities(products: DaffCompositeProduct[]): DaffCompositeProductEntity[] {\n return products.filter(product => product.type === DaffProductTypeEnum.Composite)\n .map(product => this.buildCompositeProductAppliedOptionsEntity(product));\n }\n\n /**\n * @docs-private\n */\n private buildCompositeProductAppliedOptionsEntity(product: DaffCompositeProduct): DaffCompositeProductEntity {\n return {\n id: product.id,\n items: product.items.reduce((acc, item) => ({\n ...acc,\n [item.id]: this.getDefaultOption(item),\n }), {}),\n };\n }\n\n /**\n * Sets the default item option to the specified default option if it is in stock.\n * Does not set a default option if a default is not specified.\n * Does not set a default option but does set a default qty if the default is out of stock.\n *\n * @param item a DaffCompositeProductItem\n * @docs-private\n */\n private getDefaultOption(item: DaffCompositeProductItem): DaffCompositeConfigurationItem {\n const defaultOptionIndex = item.options.findIndex(option => option.is_default);\n\n if(defaultOptionIndex > -1) {\n return {\n value: item.options[defaultOptionIndex].in_stock ? item.options[defaultOptionIndex].id : null,\n qty: item.options[defaultOptionIndex].quantity,\n };\n } else {\n return { value: null, qty: null };\n }\n }\n}\n\n/**\n * Gets the composite product entity adapter singleton.\n */\nexport const daffCompositeProductAppliedOptionsEntitiesAdapter: () => DaffCompositeProductAppliedOptionsEntitiesAdapter = defaultMemoize(() => new DaffCompositeProductAppliedOptionsEntitiesAdapter()).memoized;\n","export const DAFF_COMPOSITE_PRODUCT_STORE_FEATURE_KEY = 'daffCompositeProduct';\n","import {\n createFeatureSelector,\n MemoizedSelector,\n} from '@ngrx/store';\n\nimport { DaffCompositeProductReducersState } from '../reducers/composite-product-reducers-state.interface';\nimport { DAFF_COMPOSITE_PRODUCT_STORE_FEATURE_KEY } from '../reducers/composite-product-store-feature-key';\n\n/**\n * An interface for the composite product feature state.\n */\nexport interface DaffCompositeProductFeatureMemoizedSelector {\n selectCompositeProductState: MemoizedSelector<Record<string, any>, DaffCompositeProductReducersState>;\n}\n\n/**\n * A function that returns a selector for the composite product feature state.\n */\nexport const getDaffCompositeProductFeatureSelector = (() => {\n let cache;\n return (): DaffCompositeProductFeatureMemoizedSelector => cache = cache\n ? cache\n : { selectCompositeProductState: createFeatureSelector<DaffCompositeProductReducersState>(DAFF_COMPOSITE_PRODUCT_STORE_FEATURE_KEY) };\n})();\n","import {\n EntityState,\n Dictionary,\n} from '@ngrx/entity';\nimport {\n createSelector,\n MemoizedSelector,\n defaultMemoize,\n} from '@ngrx/store';\n\nimport {\n DaffProduct,\n DaffProductTypeEnum,\n} from '@daffodil/product';\nimport { getDaffProductEntitiesSelectors } from '@daffodil/product/state';\nimport {\n DaffCompositeProductItemOption,\n DaffCompositeProductItem,\n DaffCompositeProduct,\n} from '@daffodil/product-composite';\n\nimport { daffCompositeProductAppliedOptionsEntitiesAdapter } from '../../reducers/composite-product-entities/composite-product-entities-reducer-adapter';\nimport { DaffCompositeProductEntity } from '../../reducers/composite-product-entities/composite-product-entity';\nimport {\n DaffCompositeProductReducersState,\n DaffCompositeProductStateRootSlice,\n} from '../../reducers/composite-product-reducers-state.interface';\nimport { getDaffCompositeProductFeatureSelector } from '../feature.selector';\n\n/**\n * An interface for selectors related to the composite product applied options.\n */\nexport interface DaffCompositeProductEntitiesMemoizedSelectors<T extends DaffProduct = DaffProduct> {\n /**\n * The ngrx entities state for composite product applied options.\n */\n selectCompositeProductAppliedOptionsEntitiesState: MemoizedSelector<DaffCompositeProductStateRootSlice<T>, EntityState<DaffCompositeProductEntity>>;\n /**\n * A selector for all composite product ids in state.\n */\n selectCompositeProductIds: MemoizedSelector<DaffCompositeProductStateRootSlice<T>, EntityState<DaffCompositeProductEntity>['ids']>;\n /**\n * The ngrx entities for the composite product appllied options.\n */\n selectCompositeProductAppliedOptionsEntities: MemoizedSelector<DaffCompositeProductStateRootSlice<T>, EntityState<DaffCompositeProductEntity>['entities']>;\n /**\n * The total number of composite products in state.\n */\n selectCompositeProductTotal: MemoizedSelector<DaffCompositeProductStateRootSlice<T>, number>;\n /**\n * Selects the applied options for a composite product.\n *\n * @param id the id of the composite product.\n */\n selectCompositeProductAppliedOptions: (id: T['id']) => MemoizedSelector<DaffCompositeProductStateRootSlice<T>, Dictionary<DaffCompositeProductItemOption>>;\n /**\n * Selects whether the particular item of a composite product is required in order for the product to be valid, i.e. addable to the cart.\n *\n * @param id the id of the composite product.\n * @param item_id the id of the composite product item.\n */\n selectIsCompositeProductItemRequired: (id: T['id'], item_id: DaffCompositeProductItem['id']) => MemoizedSelector<DaffCompositeProductStateRootSlice<T>, boolean>;\n}\n\nconst createCompositeProductAppliedOptionsEntitiesSelectors = <T extends DaffProduct>(): DaffCompositeProductEntitiesMemoizedSelectors<T> => {\n const {\n selectCompositeProductState,\n } = getDaffCompositeProductFeatureSelector();\n const {\n selectProduct,\n } = getDaffProductEntitiesSelectors<T>();\n const adapterSelectors = daffCompositeProductAppliedOptionsEntitiesAdapter().getSelectors();\n\n const selectCompositeProductAppliedOptionsEntitiesState = createSelector(\n selectCompositeProductState,\n (state: DaffCompositeProductReducersState) => state.compositeProductOptions,\n );\n\n const selectCompositeProductIds = createSelector(\n selectCompositeProductAppliedOptionsEntitiesState,\n adapterSelectors.selectIds,\n );\n\n const selectCompositeProductAppliedOptionsEntities = createSelector(\n selectCompositeProductAppliedOptionsEntitiesState,\n adapterSelectors.selectEntities,\n );\n\n const selectCompositeProductTotal = createSelector(\n selectCompositeProductAppliedOptionsEntitiesState,\n adapterSelectors.selectTotal,\n );\n\n const selectCompositeProductAppliedOptions = defaultMemoize((id: T['id']) => createSelector(\n selectProduct(id),\n selectCompositeProductAppliedOptionsEntitiesState,\n (product: T, appliedOptions) => {\n if(product.type !== DaffProductTypeEnum.Composite) {\n return undefined;\n }\n\n return (<DaffCompositeProduct><any>product).items.reduce((acc, item) => ({\n ...acc,\n [item.id]: appliedOptions.entities[product.id].items[item.id].value ? {\n ...item.options.find(option => option.id === appliedOptions.entities[product.id].items[item.id].value),\n quantity: appliedOptions.entities[product.id].items[item.id].qty,\n } : null,\n }), {});\n },\n )).memoized;\n\n const selectIsCompositeProductItemRequired = defaultMemoize((id: T['id'], item_id: DaffCompositeProductItem['id']) => createSelector(\n selectProduct(id),\n (product: T) => {\n if(product.type !== DaffProductTypeEnum.Composite) {\n return undefined;\n }\n\n const productItem = (<DaffCompositeProduct><any>product).items.find(item => item.id === item_id);\n\n return productItem ? productItem.required : null;\n },\n )).memoized;\n\n\n return {\n selectCompositeProductAppliedOptionsEntitiesState,\n selectCompositeProductIds,\n selectCompositeProductAppliedOptionsEntities,\n selectCompositeProductTotal,\n selectCompositeProductAppliedOptions,\n selectIsCompositeProductItemRequired,\n };\n};\n\n/**\n * A function that returns all selectors related to composite product applied option entities.\n * Returns {@link DaffCompositeProductEntitiesMemoizedSelectors}.\n */\nexport const getDaffCompositeProductEntitiesSelectors = (() => {\n let cache;\n return <T extends DaffProduct>(): DaffCompositeProductEntitiesMemoizedSelectors<T> => cache = cache\n ? cache\n : createCompositeProductAppliedOptionsEntitiesSelectors<T>();\n})();\n","import {\n Dictionary,\n EntityState,\n} from '@ngrx/entity';\nimport {\n createSelector,\n MemoizedSelector,\n defaultMemoize,\n} from '@ngrx/store';\n\nimport {\n daffAdd,\n daffDivide,\n daffMultiply,\n daffSubtract,\n} from '@daffodil/core';\nimport {\n DaffProduct,\n DaffProductTypeEnum,\n DaffProductPrices,\n DaffPriceRange,\n} from '@daffodil/product';\nimport { getDaffProductEntitiesSelectors } from '@daffodil/product/state';\nimport {\n DaffCompositeProduct,\n DaffCompositeConfigurationItem,\n DaffCompositeProductItem,\n DaffCompositeProductItemOption,\n} from '@daffodil/product-composite';\n\nimport { DaffCompositeProductStateRootSlice } from '../../reducers/composite-product-reducers-state.interface';\nimport { DaffCompositeProductEntity } from '../../reducers/public_api';\nimport { getDaffCompositeProductEntitiesSelectors } from '../composite-product-entities/composite-product-entities.selectors';\n\n/**\n * An interface describing selectors unique to the composite product, such as pricing and discounts.\n */\nexport interface DaffCompositeProductMemoizedSelectors<T extends DaffProduct = DaffProduct> {\n /**\n * Get a DaffPriceRange for a composite product based on the configuration provided excluding unselected, optional item prices.\n */\n selectCompositeProductRequiredItemPricesForConfiguration: ( id: DaffCompositeProduct['id'], configuration?: Dictionary<DaffCompositeConfigurationItem> ) => MemoizedSelector<DaffCompositeProductStateRootSlice<T>, DaffPriceRange>;\n /**\n * Get the broadest possible DaffPriceRange for a composite product based on the configuration provided including optional item prices.\n */\n selectCompositeProductOptionalItemPricesForConfiguration: ( id: DaffCompositeProduct['id'], configuration?: Dictionary<DaffCompositeConfigurationItem> ) => MemoizedSelector<DaffCompositeProductStateRootSlice<T>, DaffPriceRange>;\n /**\n * Get the DaffPriceRange for a composite product based on the current configuration of selected item options in redux state and\n * excluding unselected, optional item prices.\n */\n selectCompositeProductPricesAsCurrentlyConfigured: ( id: DaffCompositeProduct['id'] ) => MemoizedSelector<DaffCompositeProductStateRootSlice<T>, DaffPriceRange>;\n /**\n * Get the discount amount for a composite product. This value will be undefined if all required options are not chosen.\n */\n selectCompositeProductDiscountAmount: ( id: DaffCompositeProduct['id'] ) => MemoizedSelector<DaffCompositeProductStateRootSlice<T>, number>;\n /**\n * Get the discount percent for a composite product. This value will be undefined if all required options are not chosen.\n * Note: this percent is computed client-side and should be treated as an estimate rather than an exact value.\n */\n selectCompositeProductDiscountPercent: ( id: DaffCompositeProduct['id'] ) => MemoizedSelector<DaffCompositeProductStateRootSlice<T>, number>;\n}\n\nconst createCompositeProductSelectors = <T extends DaffProduct>(): DaffCompositeProductMemoizedSelectors<T> => {\n\n const {\n selectProduct,\n } = getDaffProductEntitiesSelectors<T>();\n\n const {\n selectCompositeProductAppliedOptionsEntities,\n } = getDaffCompositeProductEntitiesSelectors();\n\n const selectCompositeProductRequiredItemPricesForConfiguration = defaultMemoize((id: DaffCompositeProduct['id'], configuration?: Dictionary<DaffCompositeConfigurationItem>) => createSelector(\n selectProduct(id),\n (product: T) => {\n if(product.type !== DaffProductTypeEnum.Composite) {\n return undefined;\n }\n\n const appliedOptions = configuration ? getAppliedOptionsForConfiguration(<DaffCompositeProduct><any>product, configuration) : {};\n return {\n minPrice: getMinPricesForConfiguration(<DaffCompositeProduct><any>product, appliedOptions),\n maxPrice: getMaxPricesForConfiguration(<DaffCompositeProduct><any>product, appliedOptions),\n };\n },\n )).memoized;\n\n const selectCompositeProductOptionalItemPricesForConfiguration = defaultMemoize((id: DaffCompositeProduct['id'], configuration?: Dictionary<DaffCompositeConfigurationItem>) => createSelector(\n selectProduct(id),\n (product: T) => {\n if(product.type !== DaffProductTypeEnum.Composite) {\n return undefined;\n }\n\n const appliedOptions = configuration ? getAppliedOptionsForConfiguration(<DaffCompositeProduct><any>product, configuration) : {};\n return {\n minPrice: getMinPricesForConfiguration(<DaffCompositeProduct><any>product, appliedOptions),\n maxPrice: getMaxPricesForConfigurationIncludingOptionalItems(<DaffCompositeProduct><any>product, appliedOptions),\n };\n },\n )).memoized;\n\n const selectCompositeProductPricesAsCurrentlyConfigured = defaultMemoize((id: T['id']) => createSelector<DaffCompositeProductStateRootSlice<T>, [T, EntityState<DaffCompositeProductEntity>['entities']], DaffPriceRange>(\n selectProduct(id),\n selectCompositeProductAppliedOptionsEntities,\n (product: T, appliedOptionsEntities) =>\n selectCompositeProductRequiredItemPricesForConfiguration(id, appliedOptionsEntities[id]?.items || null).projector(product),\n )).memoized;\n\n const selectCompositeProductDiscountAmount = defaultMemoize((id: DaffCompositeProduct['id']) => createSelector<DaffCompositeProductStateRootSlice<T>, [T, EntityState<DaffCompositeProductEntity>['entities']], number>(\n selectProduct(id),\n selectCompositeProductAppliedOptionsEntities,\n (product: T, appliedOptionsEntities) => {\n if(product.type !== DaffProductTypeEnum.Composite) {\n return undefined;\n }\n const appliedConfigurationItem = appliedOptionsEntities[product.id].items;\n if((<DaffCompositeProduct><any>product).items.filter(item => item.required && appliedConfigurationItem[item.id].value === null).length > 0) {\n return undefined;\n }\n const appliedOptions = getAppliedOptionsForConfiguration((<DaffCompositeProduct><any>product), appliedConfigurationItem);\n\n return (<DaffCompositeProduct><any>product).items.reduce((acc, item) =>\n appliedOptions[item.id]?.discount?.amount ? daffAdd(acc, daffMultiply(appliedOptions[item.id].discount.amount, appliedOptions[item.id].quantity)) : acc,\n product.discount.amount);\n },\n )).memoized;\n\n const selectCompositeProductDiscountPercent = defaultMemoize((id: DaffCompositeProduct['id']) => createSelector<DaffCompositeProductStateRootSlice<T>, [T, EntityState<DaffCompositeProductEntity>['entities']], number>(\n selectProduct(id),\n selectCompositeProductAppliedOptionsEntities,\n (product: T, appliedOptionsEntities) => {\n if(product.type !== DaffProductTypeEnum.Composite) {\n return undefined;\n }\n const appliedOptions = appliedOptionsEntities[product.id].items;\n if((<DaffCompositeProduct><any>product).items.filter(item => item.required && appliedOptions[item.id].value === null).length > 0) {\n return undefined;\n }\n\n const prices = getMinPricesForConfiguration(\n (<DaffCompositeProduct><any>product),\n getAppliedOptionsForConfiguration((<DaffCompositeProduct><any>product), appliedOptions),\n );\n\n return daffMultiply(\n daffDivide(\n daffSubtract(prices.originalPrice, prices.discountedPrice),\n prices.originalPrice,\n ),\n 100,\n );\n },\n )).memoized;\n\n return {\n selectCompositeProductRequiredItemPricesForConfiguration,\n selectCompositeProductOptionalItemPricesForConfiguration,\n selectCompositeProductPricesAsCurrentlyConfigured,\n selectCompositeProductDiscountAmount,\n selectCompositeProductDiscountPercent,\n };\n};\n\n/**\n * A function that returns all selectors related to the composite product feature.\n *\n * Returns {@link DaffCompositeProductMemoizedSelectors}.\n */\nexport const getDaffCompositeProductPriceSelectors = (() => {\n let cache;\n return <T extends DaffProduct = DaffProduct>(): DaffCompositeProductMemoizedSelectors<T> => cache = cache\n ? cache\n : createCompositeProductSelectors<T>();\n})();\n\n/**\n * The minimum price of an item is zero if the item is optional.\n *\n * @param item DaffCompositeProductItem\n */\nfunction getMinimumRequiredCompositeItemPrice(item: DaffCompositeProductItem, qty: number): number {\n return item.required ? daffMultiply(Math.min(...item.options.map(option => option.price)), qty) : 0;\n}\n\n/**\n * The maximum price for an item is zero if the item is optional.\n *\n * @param item DaffCompositeProductItem\n */\nfunction getMaximumRequiredCompositeItemPrice(item: DaffCompositeProductItem, qty: number): number {\n return item.required ? daffMultiply(Math.max(...item.options.map(option => option.price)), qty) : 0;\n}\n\n/**\n * The minimum discounted price of an item is zero if the item is optional.\n *\n * @param item DaffCompositeProductItem\n */\nfunction getMinimumRequiredCompositeItemDiscountedPrice(item: DaffCompositeProductItem, qty: number): number {\n return item.required ? daffMultiply(Math.min(...item.options.map(getDiscountedPrice)), qty) : 0;\n}\n/**\n * The maximum discounted price of an item is zero if the item is optional.\n *\n * @param item DaffCompositeProductItem\n */\nfunction getMaximumRequiredCompositeItemDiscountedPrice(item: DaffCompositeProductItem, qty: number): number {\n return item.required ? daffMultiply(Math.max(...item.options.map(getDiscountedPrice)), qty) : 0;\n}\n\n/**\n * Gets the minimum prices of a composite product for the configuration provided excluding unselected, optional item prices.\n *\n * @param product a DaffCompositeProduct\n * @param appliedOptions a Dictionary<DaffCompositeProductItemOption> that determines the current configuration of the composite product.\n */\nfunction getMinPricesForConfiguration(product: DaffCompositeProduct, appliedOptions: Dictionary<DaffCompositeProductItemOption>): DaffProductPrices {\n return {\n discountedPrice: product.items.reduce((acc, item) => daffAdd(\n acc,\n appliedOptionHasId(appliedOptions[item.id]) ?\n daffMultiply(getDiscountedPrice(appliedOptions[item.id]), appliedOptions[item.id].quantity) :\n getMinimumRequiredCompositeItemDiscountedPrice(item, getOptionQty(appliedOptions[item.id])),\n ), getDiscountedPrice(product)),\n discount: { amount: null, percent: null },\n originalPrice: product.items.reduce((acc, item) => daffAdd(\n acc,\n appliedOptionHasId(appliedOptions[item.id]) ?\n daffMultiply(appliedOptions[item.id].price, appliedOptions[item.id].quantity) :\n getMinimumRequiredCompositeItemPrice(item, getOptionQty(appliedOptions[item.id])),\n ), product.price),\n };\n}\n\n/**\n * Gets the maximum prices of a composite product for the configuration provided excluding unselected, optional item prices.\n *\n * @param product a DaffCompositeProduct\n * @param appliedOptions a Dictionary<DaffCompositeProductItemOption> that determines the current configuration of the composite product.\n */\nfunction getMaxPricesForConfiguration(product: DaffCompositeProduct, appliedOptions: Dictionary<DaffCompositeProductItemOption>): DaffProductPrices {\n return {\n discountedPrice: product.items.reduce((acc, item) => daffAdd(\n acc,\n appliedOptionHasId(appliedOptions[item.id]) ?\n daffMultiply(getDiscountedPrice(appliedOptions[item.id]), appliedOptions[item.id].quantity) :\n getMaximumRequiredCompositeItemDiscountedPrice(item, getOptionQty(appliedOptions[item.id])),\n ), getDiscountedPrice(product)),\n discount: { amount: null, percent: null },\n originalPrice: product.items.reduce((acc, item) => daffAdd(\n acc,\n appliedOptionHasId(appliedOptions[item.id]) ?\n daffMultiply(appliedOptions[item.id].price, appliedOptions[item.id].quantity) :\n getMaximumRequiredCompositeItemPrice(item, getOptionQty(appliedOptions[item.id])),\n ), product.price),\n };\n}\n\nfunction getDiscountedPrice(product: DaffProduct): number {\n return product.discount ? daffSubtract(product.price, product.discount.amount) : product.price;\n}\n\n/**\n * Gets the maximum prices of a composite product including optional item prices.\n *\n * @param product a DaffCompositeProduct\n */\nfunction getMaxPricesForConfigurationIncludingOptionalItems(product: DaffCompositeProduct, appliedOptions: Dictionary<DaffCompositeProductItemOption>): DaffProductPrices {\n return {\n discountedPrice: product.items.reduce((acc, item) => daffAdd(\n acc,\n appliedOptionHasId(appliedOptions[item.id]) ?\n daffMultiply(getDiscountedPrice(appliedOptions[item.id]), appliedOptions[item.id].quantity) :\n appliedOptionHasQty(appliedOptions[item.id]) ?\n daffMultiply(Math.max(...item.options.map(getDiscountedPrice)), appliedOptions[item.id].quantity) :\n Math.max(...item.options.map(getDiscountedPrice)),\n ), getDiscountedPrice(product)),\n discount: { amount: null, percent: null },\n originalPrice: product.items.reduce((acc, item) => daffAdd(\n acc,\n appliedOptionHasId(appliedOptions[item.id]) ?\n daffMultiply(appliedOptions[item.id].price, appliedOptions[item.id].quantity) :\n appliedOptionHasQty(appliedOptions[item.id]) ?\n daffMultiply(Math.max(...item.options.map(option => option.price)), appliedOptions[item.id].quantity) :\n Math.max(...item.options.map(option => option.price)),\n ), product.price),\n };\n}\n\n/**\n * Takes a product and a set of option configurations and convert it into a dictionary of the full option objects.\n *\n * @param product a DaffCompositeProduct\n * @param configuration a Dictionary<DaffCompositeConfigurationItem> used to build the appliedOptions object.\n */\nfunction getAppliedOptionsForConfiguration(product: DaffCompositeProduct, configuration: Dictionary<DaffCompositeConfigurationItem>): Dictionary<DaffCompositeProductItemOption> {\n return product.items.reduce((acc, item) => ({\n ...acc,\n [item.id]: configuration[item.id] ? {\n ...item.options.find(option => option.id === configuration[item.id].value),\n quantity: (configuration[item.id].qty === null || configuration[item.id].qty === undefined) ? 1 : configuration[item.id].qty,\n } : null,\n }), {});\n}\n\nfunction appliedOptionHasId(appliedOption: DaffCompositeProductItemOption): boolean {\n return !!appliedOption?.id;\n}\n\nfunction getOptionQty(appliedOption: DaffCompositeProductItemOption): number {\n return appliedOptionHasQty(appliedOption) ? appliedOption.quantity : 1;\n}\n\nfunction appliedOptionHasQty(appliedOption: DaffCompositeProductItemOption): boolean {\n return appliedOption?.quantity !== null && appliedOption?.quantity !== undefined;\n}\n","import { DaffProduct } from '@daffodil/product';\n\nimport {\n DaffCompositeProductMemoizedSelectors,\n getDaffCompositeProductPriceSelectors,\n} from './composite-product/composite-product.selectors';\nimport {\n DaffCompositeProductEntitiesMemoizedSelectors,\n getDaffCompositeProductEntitiesSelectors,\n} from './composite-product-entities/composite-product-entities.selectors';\n\n/**\n * An interface for all selectors in the composite product feature area.\n */\nexport interface DaffCompositeProductAllSelectors<T extends DaffProduct = DaffProduct> extends\n DaffCompositeProductEntitiesMemoizedSelectors<T>,\n DaffCompositeProductMemoizedSelectors<T> { }\n\n/**\n * A function that returns all selectors in the composite product feature area.\n * Returns {@link DaffCompositeProductAllSelectors}.\n */\nexport const getDaffCompositeProductSelectors = <T extends DaffProduct>(): DaffCompositeProductAllSelectors<T> => ({\n ...getDaffCompositeProductEntitiesSelectors<T>(),\n ...getDaffCompositeProductPriceSelectors<T>(),\n});\n","import { Injectable } from '@angular/core';\nimport { Dictionary } from '@ngrx/entity';\nimport {\n Store,\n select,\n Action,\n} from '@ngrx/store';\nimport { Observable } from 'rxjs';\n\nimport {\n DaffProduct,\n DaffPriceRange,\n productPriceRangeHasDiscount,\n productPriceRangeHasPriceRange,\n} from '@daffodil/product';\nimport {\n DaffCompositeConfigurationItem,\n DaffCompositeProductItemOption,\n DaffCompositeProductItem,\n} from '@daffodil/product-composite';\n\nimport { DaffCompositeProductFacadeInterface } from './composite-product-facade.interface';\nimport { DaffCompositeProductStateRootSlice } from '../../reducers/composite-product-reducers-state.interface';\nimport { getDaffCompositeProductSelectors } from '../../selectors/public_api';\n\n/**\n * A facade for interacting with the composite product state.\n * Exposes many parts of the state for easy access and allows dispatching of actions.\n *\n * @inheritdoc\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffCompositeProductFacade<T extends DaffProduct = DaffProduct> implements DaffCompositeProductFacadeInterface {\n\n constructor(private store: Store<DaffCompositeProductStateRootSlice<T>>) {}\n\n compositeProductSelectors = getDaffCompositeProductSelectors<T>();\n\n hasDiscount = productPriceRangeHasDiscount;\n\n hasPriceRange = productPriceRangeHasPriceRange;\n\n getRequiredItemPricesForConfiguration(id: T['id'], configuration?: Dictionary<DaffCompositeConfigurationItem>): Observable<DaffPriceRange> {\n return this.store.pipe(select(this.compositeProductSelectors.selectCompositeProductRequiredItemPricesForConfiguration(id, configuration)));\n }\n\n getOptionalItemPricesForConfiguration(id: T['id'], configuration?: Dictionary<DaffCompositeConfigurationItem>): Observable<DaffPriceRange> {\n return this.store.pipe(select(this.compositeProductSelectors.selectCompositeProductOptionalItemPricesForConfiguration(id, configuration)));\n }\n\n getPricesAsCurrentlyConfigured(id: T['id']): Observable<DaffPriceRange> {\n return this.store.pipe(select(this.compositeProductSelectors.selectCompositeProductPricesAsCurrentlyConfigured(id)));\n }\n\n getAppliedOptions(id: T['id']): Observable<Dictionary<DaffCompositeProductItemOption>> {\n return this.store.pipe(select(this.compositeProductSelectors.selectCompositeProductAppliedOptions(id)));\n }\n\n getDiscountAmount(id: T['id']): Observable<number> {\n return this.store.pipe(select(this.compositeProductSelectors.selectCompositeProductDiscountAmount(id)));\n }\n\n getDiscountPercent(id: T['id']): Observable<number> {\n return this.store.pipe(select(this.compositeProductSelectors.selectCompositeProductDiscountPercent(id)));\n }\n\n isItemRequired(id: T['id'], item_id: DaffCompositeProductItem['id']) {\n return this.store.pipe(select(this.compositeProductSelectors.selectIsCompositeProductItemRequired(id, item_id)));\n }\n\n dispatch(action: Action) {\n this.store.dispatch(action);\n }\n}\n","import { EntityState } from '@ngrx/entity';\n\nimport { DaffProduct } from '@daffodil/product';\nimport {\n DaffProductPageActions,\n DaffProductPageActionTypes,\n DaffProductGridActionTypes,\n DaffProductGridActions,\n DaffBestSellersActions,\n DaffProductActions,\n DaffBestSellersActionTypes,\n DaffProductActionTypes,\n} from '@daffodil/product/state';\nimport { DaffCompositeProduct } from '@daffodil/product-composite';\n\nimport { daffCompositeProductAppliedOptionsEntitiesAdapter } from './composite-product-entities-reducer-adapter';\nimport { DaffCompositeProductEntity } from './composite-product-entity';\nimport {\n DaffCompositeProductActions,\n DaffCompositeProductActionTypes,\n} from '../../actions/public_api';\n\n/**\n * Reducer function that catches actions and changes/overwrites composite product entities state.\n *\n * @param state current State of the redux store\n * @param action ProductGrid, BestSellers, Product, or Composite Product actions\n * @returns Product entities state\n */\nexport function daffCompositeProductEntitiesReducer<T extends DaffProduct, V extends DaffCompositeProduct>(\n state = daffCompositeProductAppliedOptionsEntitiesAdapter().getInitialState(),\n action: DaffProductGridActions<T> | DaffBestSellersActions<T> | DaffProductActions<T> | DaffProductPageActions<T> | DaffCompositeProductActions<V>): EntityState<DaffCompositeProductEntity> {\n const adapter = daffCompositeProductAppliedOptionsEntitiesAdapter();\n switch (action.type) {\n case DaffProductGridActionTypes.ProductGridLoadSuccessAction:\n case DaffBestSellersActionTypes.BestSellersLoadSuccessAction:\n return adapter.upsertProducts(state, ...(<V[]><unknown>action.payload));\n\n case DaffProductActionTypes.ProductLoadSuccessAction:\n case DaffProductPageActionTypes.ProductPageLoadSuccessAction:\n return adapter.upsertProducts(state, ...(<V[]><unknown>action.payload.products));\n\n case DaffCompositeProductActionTypes.CompositeProductApplyOptionAction:\n return adapter.applyOption(state, action.id, action.itemId, action.optionId, action.qty);\n\n default:\n return state;\n }\n}\n","import { ActionReducerMap } from '@ngrx/store';\n\nimport { daffCompositeProductEntitiesReducer } from './composite-product-entities/composite-product-entities.reducer';\nimport { DaffCompositeProductReducersState } from './composite-product-reducers-state.interface';\n\n/**\n * Returns state values from all composite product related reducers.\n */\nexport const daffCompositeProductReducers: ActionReducerMap<DaffCompositeProductReducersState> = {\n compositeProductOptions: daffCompositeProductEntitiesReducer,\n};\n","import { ActionReducer } from '@ngrx/store';\n\nimport { createMultiInjectionToken } from '@daffodil/core';\n\nimport { DaffCompositeProductReducersState } from '../composite-product-reducers-state.interface';\n\nexport const {\n /**\n * A token to hold the injectable extra reducers.\n *\n * Prefer using {@link daffProductCompositeProvideExtraReducers}.\n */\n token: DAFF_PRODUCT_COMPOSITE_EXTRA_REDUCERS,\n\n /**\n * Provides additional reducers that run after the standard Daffodil cart reducers.\n *\n * ```ts\n * providers: [\n * ...daffProductCompositeProvideExtraReducers(\n * myReducer1,\n * myReducer2\n * )\n * ]\n * ```\n */\n provider: daffProductCompositeProvideExtraReducers,\n} = createMultiInjectionToken<ActionReducer<DaffCompositeProductReducersState>>('DAFF_PRODUCT_COMPOSITE_EXTRA_REDUCERS');\n","import { DaffProductTypeEnum } from '@daffodil/product';\nimport { DaffProductReducersState } from '@daffodil/product/state';\nimport { DaffCompositeProduct } from '@daffodil/product-composite';\n\n/**\n * Maps a list of products, ensuring that the composite products have a list of items.\n * If the incoming items is empty or nully, the items from state are intentionally used instead.\n */\nexport function daffProductCompositeEnsureItems<T extends DaffCompositeProduct = DaffCompositeProduct>(state: DaffProductReducersState<T>, products: T[]): T[] {\n return products.map((product) =>\n product.type === DaffProductTypeEnum.Composite\n ? {\n ...product,\n items: product.items.length > 0\n ? product.items\n : state.products.entities[product.id]?.items ?? [],\n }\n : product,\n );\n}\n","import { ActionReducer } from '@ngrx/store';\n\nimport { DaffProductTypeEnum } from '@daffodil/product';\nimport {\n DaffProductActionTypes,\n DaffProductActions,\n DaffProductLoadSuccess,\n DaffProductPageActionTypes,\n DaffProductPageActions,\n DaffProductPageLoadSuccess,\n DaffProductReducersState,\n} from '@daffodil/product/state';\nimport { DaffCompositeProduct } from '@daffodil/product-composite';\n\nimport { daffProductCompositeEnsureItems } from '../helpers/public_api';\n\ntype Reducer = ActionReducer<DaffProductReducersState<DaffCompositeProduct>, DaffProductActions<DaffCompositeProduct> | DaffProductPageActions<DaffCompositeProduct>>;\n\nexport function daffProductCompositeEnsureItemsMetaReducer(reducer: Reducer): Reducer {\n return (state, action) => {\n switch (action.type) {\n case DaffProductPageActionTypes.ProductPageLoadSuccessAction:\n return reducer(state, new DaffProductPageLoadSuccess({\n ...action.payload,\n products: daffProductCompositeEnsureItems(state, action.payload.products),\n }));\n\n case DaffProductActionTypes.ProductLoadSuccessAction:\n return reducer(state, new DaffProductLoadSuccess({\n ...action.payload,\n products: daffProductCompositeEnsureItems(state, action.payload.products),\n }));\n\n default:\n return reducer(state, action);\n }\n };\n}\n","import {\n inject,\n InjectionToken,\n} from '@angular/core';\nimport {\n ActionReducer,\n combineReducers,\n} from '@ngrx/store';\n\nimport { createSingleInjectionToken } from '@daffodil/core';\nimport { daffComposeReducers } from '@daffodil/core/state';\n\nimport { DAFF_PRODUCT_COMPOSITE_EXTRA_REDUCERS } from './extra.token';\nimport { daffCompositeProductReducers } from '../composite-product-reducers';\nimport { DaffCompositeProductReducersState } from '../composite-product-reducers-state.interface';\n\nexport const {\n /**\n * An internal token to hold the Daffodil composite product reducers.\n * Includes the extra and standard reducers.\n *\n * @docs-private\n */\n token: DAFF_PRODUCT_COMPOSITE_REDUCERS,\n /**\n * Provider function for {@link DAFF_PRODUCT_COMPOSITE_REDUCERS}.\n */\n provider: provideDaffProductCompositeReducers,\n} = createSingleInjectionToken<ActionReducer<DaffCompositeProductReducersState>>(\n 'DAFF_PRODUCT_COMPOSITE_REDUCERS',\n {\n factory: () => daffComposeReducers([\n combineReducers(daffCompositeProductReducers),\n ...inject(DAFF_PRODUCT_COMPOSITE_EXTRA_REDUCERS),\n ]),\n },\n);\n","import { NgModule } from '@angular/core';\nimport { StoreModule } from '@ngrx/store';\n\nimport { daffProductProvideMetaReducers } from '@daffodil/product/state';\n\nimport { daffProductCompositeEnsureItemsMetaReducer } from './reducers/ensure-items.meta-reducer';\nimport { DAFF_PRODUCT_COMPOSITE_REDUCERS } from './reducers/injection-tokens/reducers.token';\nimport { DAFF_COMPOSITE_PRODUCT_STORE_FEATURE_KEY } from './reducers/public_api';\n\n/**\n * A module that provides the default reducers and effects for composite product redux state.\n */\n@NgModule({\n imports: [\n StoreModule.forFeature(DAFF_COMPOSITE_PRODUCT_STORE_FEATURE_KEY, DAFF_PRODUCT_COMPOSITE_REDUCERS),\n ],\n providers: [\n ...daffProductProvideMetaReducers(daffProductCompositeEnsureItemsMetaReducer),\n ],\n})\nexport class DaffCompositeProductStateModule { }\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;AAQA;;AAEG;IACS,gCAEX;AAFD,CAAA,UAAY,+BAA+B,EAAA;AACzC,IAAA,+BAAA,CAAA,mCAAA,CAAA,GAAA,qEAAyG,CAAA;AAC3G,CAAC,EAFW,+BAA+B,KAA/B,+BAA+B,GAE1C,EAAA,CAAA,CAAA,CAAA;AAED;;;;;;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,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA,EAAA;kIAA/B,+BAA+B,EAAA,OAAA,EAAA,CAAA,EAAA,CAAA,kBAAA,CAAA,EAAA,CAAA,CAAA,EAAA;AAA/B,uBAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,+BAA+B,EAJ/B,SAAA,EAAA;YACT,GAAG,8BAA8B,CAAC,0CAA0C,CAAC;AAC9E,SAAA,EAAA,OAAA,EAAA,CAJC,WAAW,CAAC,UAAU,CAAC,wCAAwC,EAAE,+BAA+B,CAAC,CAAA,EAAA,CAAA,CAAA,EAAA;;2FAMxF,+BAA+B,EAAA,UAAA,EAAA,CAAA;kBAR3C,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,OAAO,EAAE;AACP,wBAAA,WAAW,CAAC,UAAU,CAAC,wCAAwC,EAAE,+BAA+B,CAAC;AAClG,qBAAA;AACD,oBAAA,SAAS,EAAE;wBACT,GAAG,8BAA8B,CAAC,0CAA0C,CAAC;AAC9E,qBAAA;AACF,iBAAA,CAAA;;;ACnBD;;AAEG;;;;"}
|
package/package.json
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"name":"@daffodil/product-composite","nx":{"targets":{"build":{"outputs":["{workspaceRoot}/dist/product-composite"]}}},"version":"0.
|
1
|
+
{"name":"@daffodil/product-composite","nx":{"targets":{"build":{"outputs":["{workspaceRoot}/dist/product-composite"]}}},"version":"0.80.0","description":"Interfaces built for daffodil/state","repository":{"type":"git","url":"https://github.com/graycoreio/daffodil"},"author":"Graycore LLC","license":"MIT","bugs":{"url":"https://github.com/graycoreio/daffodil/issues"},"publishConfig":{"directory":"../../dist/product-composite"},"homepage":"https://github.com/graycoreio/daffodil","peerDependencies":{"@angular/common":"^18.2.2","@angular/core":"^18.2.2","@daffodil/core":"0.80.0","@daffodil/product":"0.80.0","@ngrx/effects":"^18.0.2","@ngrx/entity":"^18.0.2","@ngrx/store":"^18.0.2","rxjs":"7.8.1"},"optionalDependencies":{"@apollo/client":"^3.0.0","@daffodil/driver":"0.80.0","@daffodil/product":"0.80.0","angular-in-memory-web-api":"^0.18.0","apollo-angular":"^7.1.2","@faker-js/faker":"^7.6.0"},"module":"fesm2022/daffodil-product-composite.mjs","typings":"index.d.ts","exports":{"./package.json":{"default":"./package.json"},".":{"types":"./index.d.ts","esm2022":"./esm2022/daffodil-product-composite.mjs","esm":"./esm2022/daffodil-product-composite.mjs","default":"./fesm2022/daffodil-product-composite.mjs"},"./routing":{"types":"./routing/index.d.ts","esm2022":"./esm2022/routing/daffodil-product-composite-routing.mjs","esm":"./esm2022/routing/daffodil-product-composite-routing.mjs","default":"./fesm2022/daffodil-product-composite-routing.mjs"},"./state":{"types":"./state/index.d.ts","esm2022":"./esm2022/state/daffodil-product-composite-state.mjs","esm":"./esm2022/state/daffodil-product-composite-state.mjs","default":"./fesm2022/daffodil-product-composite-state.mjs"},"./testing":{"types":"./testing/index.d.ts","esm2022":"./esm2022/testing/daffodil-product-composite-testing.mjs","esm":"./esm2022/testing/daffodil-product-composite-testing.mjs","default":"./fesm2022/daffodil-product-composite-testing.mjs"},"./driver/in-memory":{"types":"./driver/in-memory/index.d.ts","esm2022":"./esm2022/driver/in-memory/daffodil-product-composite-driver-in-memory.mjs","esm":"./esm2022/driver/in-memory/daffodil-product-composite-driver-in-memory.mjs","default":"./fesm2022/daffodil-product-composite-driver-in-memory.mjs"},"./driver/magento":{"types":"./driver/magento/index.d.ts","esm2022":"./esm2022/driver/magento/daffodil-product-composite-driver-magento.mjs","esm":"./esm2022/driver/magento/daffodil-product-composite-driver-magento.mjs","default":"./fesm2022/daffodil-product-composite-driver-magento.mjs"},"./driver/testing":{"types":"./driver/testing/index.d.ts","esm2022":"./esm2022/driver/testing/daffodil-product-composite-driver-testing.mjs","esm":"./esm2022/driver/testing/daffodil-product-composite-driver-testing.mjs","default":"./fesm2022/daffodil-product-composite-driver-testing.mjs"},"./state/testing":{"types":"./state/testing/index.d.ts","esm2022":"./esm2022/state/testing/daffodil-product-composite-state-testing.mjs","esm":"./esm2022/state/testing/daffodil-product-composite-state-testing.mjs","default":"./fesm2022/daffodil-product-composite-state-testing.mjs"},"./driver/magento/testing":{"types":"./driver/magento/testing/index.d.ts","esm2022":"./esm2022/driver/magento/testing/daffodil-product-composite-driver-magento-testing.mjs","esm":"./esm2022/driver/magento/testing/daffodil-product-composite-driver-magento-testing.mjs","default":"./fesm2022/daffodil-product-composite-driver-magento-testing.mjs"}},"sideEffects":false,"dependencies":{"tslib":"^2.3.0"}}
|
@@ -1,6 +1,8 @@
|
|
1
|
+
import { InjectionToken } from '@angular/core';
|
1
2
|
import { DaffBase64Service } from '@daffodil/core';
|
2
3
|
import { DaffProductCompositeRoutingConfig } from './interface';
|
3
4
|
/**
|
4
5
|
* The default configuration for the {@link DaffProductCompositeRoutingConfig}.
|
5
6
|
*/
|
6
7
|
export declare const daffProductCompositeRoutingConfigDefaultFactory: (base64: DaffBase64Service) => DaffProductCompositeRoutingConfig;
|
8
|
+
export declare const DAFF_PRODUCT_COMPOSITE_ROUTING_CONFIG_DEFAULT: InjectionToken<DaffProductCompositeRoutingConfig>;
|
@@ -1,3 +1,3 @@
|
|
1
|
-
export
|
1
|
+
export * from './default';
|
2
2
|
export { DaffProductCompositeRoutingConfig } from './interface';
|
3
|
-
export
|
3
|
+
export * from './token';
|
@@ -1,10 +1,2 @@
|
|
1
|
-
import { FactoryProvider, InjectionToken } from '@angular/core';
|
2
1
|
import { DaffProductCompositeRoutingConfig } from './interface';
|
3
|
-
|
4
|
-
* The token used to provide @daffodil/product-composite/routing config data.
|
5
|
-
*/
|
6
|
-
export declare const DAFF_PRODUCT_COMPOSITE_ROUTING_CONFIG: InjectionToken<DaffProductCompositeRoutingConfig>;
|
7
|
-
/**
|
8
|
-
* Provides the {@link DAFF_PRODUCT_COMPOSITE_ROUTING_CONFIG} token.
|
9
|
-
*/
|
10
|
-
export declare function daffProductCompositeRoutingProvideConfig(config: Partial<DaffProductCompositeRoutingConfig>): FactoryProvider;
|
2
|
+
export declare const DAFF_PRODUCT_COMPOSITE_ROUTING_CONFIG: import("@angular/core").InjectionToken<DaffProductCompositeRoutingConfig>, provideDaffProductCompositeRoutingConfig: <R extends DaffProductCompositeRoutingConfig = DaffProductCompositeRoutingConfig>(config: Partial<R> | import("@angular/core").InjectionToken<Partial<R>>) => import("@angular/core").FactoryProvider;
|
@@ -1,22 +1,3 @@
|
|
1
|
-
import { InjectionToken, Provider } from '@angular/core';
|
2
1
|
import { ActionReducer } from '@ngrx/store';
|
3
2
|
import { DaffCompositeProductReducersState } from '../composite-product-reducers-state.interface';
|
4
|
-
|
5
|
-
* A token to hold the injectable extra reducers.
|
6
|
-
*
|
7
|
-
* Prefer using {@link daffProductCompositeProvideExtraReducers}.
|
8
|
-
*/
|
9
|
-
export declare const DAFF_PRODUCT_COMPOSITE_EXTRA_REDUCERS: InjectionToken<ActionReducer<DaffCompositeProductReducersState, import("@ngrx/store").Action<string>>[]>;
|
10
|
-
/**
|
11
|
-
* Provides additional reducers that run after the standard Daffodil cart reducers.
|
12
|
-
*
|
13
|
-
* ```ts
|
14
|
-
* providers: [
|
15
|
-
* ...daffProductCompositeProvideExtraReducers(
|
16
|
-
* myReducer1,
|
17
|
-
* myReducer2
|
18
|
-
* )
|
19
|
-
* ]
|
20
|
-
* ```
|
21
|
-
*/
|
22
|
-
export declare function daffProductCompositeProvideExtraReducers(...reducers: ActionReducer<Partial<DaffCompositeProductReducersState>>[]): Provider[];
|
3
|
+
export declare const DAFF_PRODUCT_COMPOSITE_EXTRA_REDUCERS: import("@angular/core").InjectionToken<ActionReducer<DaffCompositeProductReducersState, import("@ngrx/store").Action<string>>[]>, daffProductCompositeProvideExtraReducers: <R extends ActionReducer<DaffCompositeProductReducersState, import("@ngrx/store").Action<string>> = ActionReducer<DaffCompositeProductReducersState, import("@ngrx/store").Action<string>>>(...values: R[]) => Array<import("@angular/core").ValueProvider>;
|
@@ -1,10 +1,4 @@
|
|
1
1
|
import { InjectionToken } from '@angular/core';
|
2
2
|
import { ActionReducer } from '@ngrx/store';
|
3
3
|
import { DaffCompositeProductReducersState } from '../composite-product-reducers-state.interface';
|
4
|
-
|
5
|
-
* An internal token to hold the Daffodil composite product reducers.
|
6
|
-
* Includes the extra and standard reducers.
|
7
|
-
*
|
8
|
-
* @docs-private
|
9
|
-
*/
|
10
|
-
export declare const DAFF_PRODUCT_COMPOSITE_REDUCERS: InjectionToken<ActionReducer<DaffCompositeProductReducersState, import("@ngrx/store").Action<string>>>;
|
4
|
+
export declare const DAFF_PRODUCT_COMPOSITE_REDUCERS: InjectionToken<ActionReducer<DaffCompositeProductReducersState, import("@ngrx/store").Action<string>>>, provideDaffProductCompositeReducers: <R extends ActionReducer<DaffCompositeProductReducersState, import("@ngrx/store").Action<string>> = ActionReducer<DaffCompositeProductReducersState, import("@ngrx/store").Action<string>>>(value: R) => import("@angular/core").ValueProvider;
|