@daffodil/product-composite 0.70.0 → 0.72.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 +5 -5
- package/esm2022/driver/magento/composite-product-driver.module.mjs +5 -5
- package/esm2022/driver/magento/testing/factories/bundle/bundle-item-option.factory.mjs +4 -4
- package/esm2022/driver/magento/testing/factories/bundle/bundle-item.factory.mjs +4 -4
- package/esm2022/driver/magento/testing/factories/bundle/bundle.factory.mjs +4 -4
- package/esm2022/driver/testing/testing.module.mjs +5 -5
- package/esm2022/routing/effects/product-page.effects.mjs +4 -4
- package/esm2022/routing/module.mjs +5 -5
- package/esm2022/routing/services/query-param.service.mjs +4 -4
- package/esm2022/state/composite-product-state.module.mjs +5 -5
- package/esm2022/state/facades/composite-product/composite-product.facade.mjs +4 -4
- package/esm2022/state/testing/mock-composite-product-facade.mjs +4 -4
- package/esm2022/state/testing/product-testing.module.mjs +5 -5
- package/esm2022/testing/factories/composite-product-item-option.factory.mjs +4 -4
- package/esm2022/testing/factories/composite-product-item.factory.mjs +4 -4
- package/esm2022/testing/factories/composite-product.factory.mjs +4 -4
- package/fesm2022/daffodil-product-composite-driver-in-memory.mjs +4 -4
- package/fesm2022/daffodil-product-composite-driver-in-memory.mjs.map +1 -1
- package/fesm2022/daffodil-product-composite-driver-magento-testing.mjs +9 -9
- package/fesm2022/daffodil-product-composite-driver-magento-testing.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 +4 -4
- package/fesm2022/daffodil-product-composite-driver-testing.mjs.map +1 -1
- package/fesm2022/daffodil-product-composite-routing.mjs +10 -10
- package/fesm2022/daffodil-product-composite-routing.mjs.map +1 -1
- package/fesm2022/daffodil-product-composite-state-testing.mjs +7 -7
- package/fesm2022/daffodil-product-composite-state-testing.mjs.map +1 -1
- package/fesm2022/daffodil-product-composite-state.mjs +7 -7
- package/fesm2022/daffodil-product-composite-state.mjs.map +1 -1
- package/fesm2022/daffodil-product-composite-testing.mjs +9 -9
- package/fesm2022/daffodil-product-composite-testing.mjs.map +1 -1
- package/package.json +1 -1
@@ -24,13 +24,13 @@ export class DaffCompositeProductFactory extends DaffModelFactory {
|
|
24
24
|
constructor(itemFactory, imageFactory) {
|
25
25
|
super(MockCompositeProduct, itemFactory, imageFactory);
|
26
26
|
}
|
27
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.
|
28
|
-
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.
|
27
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.10", ngImport: i0, type: DaffCompositeProductFactory, deps: [{ token: i1.DaffCompositeProductItemFactory }, { token: i2.DaffProductImageFactory }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
28
|
+
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.10", ngImport: i0, type: DaffCompositeProductFactory, providedIn: 'root' }); }
|
29
29
|
}
|
30
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.
|
30
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.10", ngImport: i0, type: DaffCompositeProductFactory, decorators: [{
|
31
31
|
type: Injectable,
|
32
32
|
args: [{
|
33
33
|
providedIn: 'root',
|
34
34
|
}]
|
35
35
|
}], ctorParameters: () => [{ type: i1.DaffCompositeProductItemFactory }, { type: i2.DaffProductImageFactory }] });
|
36
|
-
//# sourceMappingURL=data:application/json;base64,
|
36
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29tcG9zaXRlLXByb2R1Y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Y3RvcnkuY3JlYXRlTWFueSgyKTtcblxuICBjb25zdHJ1Y3RvcihcbiAgICBwcm90ZWN0ZWQgaXRlbUZhY3Rvcnk6IERhZmZDb21wb3NpdGVQcm9kdWN0SXRlbUZhY3RvcnksXG4gICAgaW1hZ2VGYWN0b3J5OiBEYWZmUHJvZHVjdEltYWdlRmFjdG9yeSxcbiAgKSB7XG4gICAgc3VwZXIoaW1hZ2VGYWN0b3J5KTtcbiAgfVxufVxuXG4vKipcbiAqIEZhY3RvcnkgZm9yIGNyZWF0aW5nIERhZmZDb21wb3NpdGVQcm9kdWN0cy5cbiAqL1xuQEluamVjdGFibGUoe1xuICBwcm92aWRlZEluOiAncm9vdCcsXG59KVxuZXhwb3J0IGNsYXNzIERhZmZDb21wb3NpdGVQcm9kdWN0RmFjdG9yeSBleHRlbmRzIERhZmZNb2RlbEZhY3Rvcnk8RGFmZkNvbXBvc2l0ZVByb2R1Y3Q+e1xuICBjb25zdHJ1Y3RvcihcbiAgICBpdGVtRmFjdG9yeTogRGFmZkNvbXBvc2l0ZVByb2R1Y3RJdGVtRmFjdG9yeSxcbiAgICBpbWFnZUZhY3Rvcnk6IERhZmZQcm9kdWN0SW1hZ2VGYWN0b3J5LFxuICApIHtcbiAgICBzdXBlcihNb2NrQ29tcG9zaXRlUHJvZHVjdCwgaXRlbUZhY3RvcnksIGltYWdlRmFjdG9yeSk7XG4gIH1cbn1cbiJdfQ==
|
@@ -20,11 +20,11 @@ class DaffCompositeProductInMemoryDriverModule {
|
|
20
20
|
],
|
21
21
|
};
|
22
22
|
}
|
23
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.
|
24
|
-
/** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.
|
25
|
-
/** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.
|
23
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.10", ngImport: i0, type: DaffCompositeProductInMemoryDriverModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
24
|
+
/** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.3.10", ngImport: i0, type: DaffCompositeProductInMemoryDriverModule, imports: [CommonModule] }); }
|
25
|
+
/** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.3.10", ngImport: i0, type: DaffCompositeProductInMemoryDriverModule, imports: [CommonModule] }); }
|
26
26
|
}
|
27
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.
|
27
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.10", ngImport: i0, type: DaffCompositeProductInMemoryDriverModule, decorators: [{
|
28
28
|
type: NgModule,
|
29
29
|
args: [{
|
30
30
|
imports: [
|
@@ -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 { DAFF_PRODUCT_TYPE_FACTORIES } 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 {\n provide: DAFF_PRODUCT_TYPE_FACTORIES,\n useExisting: DaffCompositeProductFactory,\n multi: true,\n },\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;AACT,gBAAA;AACE,oBAAA,OAAO,EAAE,2BAA2B;AACpC,oBAAA,WAAW,EAAE,2BAA2B;AACxC,oBAAA,KAAK,EAAE,IAAI;AACZ,iBAAA;AACF,aAAA;SACF,CAAC;KACH;
|
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 { DAFF_PRODUCT_TYPE_FACTORIES } 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 {\n provide: DAFF_PRODUCT_TYPE_FACTORIES,\n useExisting: DaffCompositeProductFactory,\n multi: true,\n },\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;AACT,gBAAA;AACE,oBAAA,OAAO,EAAE,2BAA2B;AACpC,oBAAA,WAAW,EAAE,2BAA2B;AACxC,oBAAA,KAAK,EAAE,IAAI;AACZ,iBAAA;AACF,aAAA;SACF,CAAC;KACH;kIAZU,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,SAAA,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,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,wCAAwC,YAHjD,YAAY,CAAA,EAAA,CAAA,CAAA,EAAA;;4FAGH,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;;;;"}
|
@@ -27,10 +27,10 @@ class MagentoBundledProductItemOptionFactory extends DaffModelFactory {
|
|
27
27
|
constructor(simpleFactory) {
|
28
28
|
super(MockMagentoBundledProductItemOption, simpleFactory);
|
29
29
|
}
|
30
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.
|
31
|
-
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.
|
30
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.10", ngImport: i0, type: MagentoBundledProductItemOptionFactory, deps: [{ token: i1.MagentoSimpleProductFactory }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
31
|
+
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.10", ngImport: i0, type: MagentoBundledProductItemOptionFactory, providedIn: 'root' }); }
|
32
32
|
}
|
33
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.
|
33
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.10", ngImport: i0, type: MagentoBundledProductItemOptionFactory, decorators: [{
|
34
34
|
type: Injectable,
|
35
35
|
args: [{
|
36
36
|
providedIn: 'root',
|
@@ -57,10 +57,10 @@ class MagentoBundledProductItemFactory extends DaffModelFactory {
|
|
57
57
|
constructor(optionFactory) {
|
58
58
|
super(MockMagentoBundledProductItem, optionFactory);
|
59
59
|
}
|
60
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.
|
61
|
-
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.
|
60
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.10", ngImport: i0, type: MagentoBundledProductItemFactory, deps: [{ token: MagentoBundledProductItemOptionFactory }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
61
|
+
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.10", ngImport: i0, type: MagentoBundledProductItemFactory, providedIn: 'root' }); }
|
62
62
|
}
|
63
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.
|
63
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.10", ngImport: i0, type: MagentoBundledProductItemFactory, decorators: [{
|
64
64
|
type: Injectable,
|
65
65
|
args: [{
|
66
66
|
providedIn: 'root',
|
@@ -85,10 +85,10 @@ class MagentoBundledProductFactory extends DaffModelFactory {
|
|
85
85
|
constructor(bundleItemFactory) {
|
86
86
|
super(MockMagentoBundledProduct, bundleItemFactory);
|
87
87
|
}
|
88
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.
|
89
|
-
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.
|
88
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.10", ngImport: i0, type: MagentoBundledProductFactory, deps: [{ token: MagentoBundledProductItemFactory }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
89
|
+
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.10", ngImport: i0, type: MagentoBundledProductFactory, providedIn: 'root' }); }
|
90
90
|
}
|
91
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.
|
91
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.10", ngImport: i0, type: MagentoBundledProductFactory, decorators: [{
|
92
92
|
type: Injectable,
|
93
93
|
args: [{
|
94
94
|
providedIn: 'root',
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"daffodil-product-composite-driver-magento-testing.mjs","sources":["../../../libs/product-composite/driver/magento/testing/src/factories/bundle/bundle-item-option.factory.ts","../../../libs/product-composite/driver/magento/testing/src/factories/bundle/bundle-item.factory.ts","../../../libs/product-composite/driver/magento/testing/src/factories/bundle/bundle.factory.ts","../../../libs/product-composite/driver/magento/testing/src/daffodil-product-composite-driver-magento-testing.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\nimport { faker } from '@faker-js/faker/locale/en_US';\n\nimport { DaffModelFactory } from '@daffodil/core/testing';\nimport { MagentoSimpleProduct } from '@daffodil/product/driver/magento';\nimport { MagentoSimpleProductFactory } from '@daffodil/product/driver/magento/testing';\nimport { MagentoBundledProductItemOption } from '@daffodil/product-composite/driver/magento';\n\n\nexport class MockMagentoBundledProductItemOption implements MagentoBundledProductItemOption {\n constructor(\n private simpleFactory: MagentoSimpleProductFactory,\n ) {}\n\n uid = faker.datatype.uuid();\n label = faker.random.word();\n quantity = faker.datatype.number({ min: 1, max: 20 });\n is_default = faker.datatype.boolean();\n position = faker.datatype.number({ min: 1, max: 10 });\n product = this.createProduct();\n\n protected createProduct(): MagentoSimpleProduct {\n return this.simpleFactory.create();\n }\n}\n\n/**\n * A factory for creating stub data for {@link MagentoBundledProduct}s.\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class MagentoBundledProductItemOptionFactory extends DaffModelFactory<MagentoBundledProductItemOption> {\n constructor(\n simpleFactory: MagentoSimpleProductFactory,\n ) {\n super(MockMagentoBundledProductItemOption, simpleFactory);\n }\n}\n","import { Injectable } from '@angular/core';\nimport { faker } from '@faker-js/faker/locale/en_US';\n\nimport { DaffModelFactory } from '@daffodil/core/testing';\nimport {\n MagentoBundledProductItem,\n MagentoBundledProductItemOption,\n} from '@daffodil/product-composite/driver/magento';\n\nimport { MagentoBundledProductItemOptionFactory } from './bundle-item-option.factory';\n\n\nexport class MockMagentoBundledProductItem implements MagentoBundledProductItem {\n constructor(\n private optionFactory: MagentoBundledProductItemOptionFactory,\n ) {}\n required = faker.datatype.boolean();\n title = faker.random.word();\n type = faker.random.word();\n options = this.createOptions();\n option_id = faker.datatype.number({ min: 1, max: 9999 });\n\n protected createOptions(): MagentoBundledProductItemOption[] {\n\t return this.optionFactory.createMany(faker.datatype.number({ min: 1, max: 5 }));\n }\n}\n\n/**\n * A factory for creating stub data for {@link MagentoBundledProduct}s.\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class MagentoBundledProductItemFactory extends DaffModelFactory<MagentoBundledProductItem> {\n constructor(\n optionFactory: MagentoBundledProductItemOptionFactory,\n ) {\n super(MockMagentoBundledProductItem, optionFactory);\n }\n}\n","import { Injectable } from '@angular/core';\nimport { faker } from '@faker-js/faker/locale/en_US';\n\nimport { DaffModelFactory } from '@daffodil/core/testing';\nimport { MagentoProductTypeEnum } from '@daffodil/product/driver/magento';\nimport { MockMagentoCoreProduct } from '@daffodil/product/driver/magento/testing';\nimport {\n MagentoBundledProduct,\n MagentoBundledProductItem,\n} from '@daffodil/product-composite/driver/magento';\n\nimport { MagentoBundledProductItemFactory } from './bundle-item.factory';\n\n\nexport class MockMagentoBundledProduct extends MockMagentoCoreProduct implements MagentoBundledProduct {\n constructor(\n private bundleItemFactory: MagentoBundledProductItemFactory,\n ) {\n super();\n }\n\n __typename = MagentoProductTypeEnum.BundledProduct;\n items = this.createBundleItems();\n\n protected createBundleItems(): MagentoBundledProductItem[] {\n return this.bundleItemFactory.createMany(faker.datatype.number({ min: 1, max: 5 }));\n }\n}\n\n/**\n * A factory for creating stub data for {@link MagentoBundledProduct}s.\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class MagentoBundledProductFactory extends DaffModelFactory<MagentoBundledProduct> {\n constructor(\n bundleItemFactory: MagentoBundledProductItemFactory,\n ) {\n super(MockMagentoBundledProduct, bundleItemFactory);\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i1.MagentoBundledProductItemOptionFactory","i1.MagentoBundledProductItemFactory"],"mappings":";;;;;;;;MASa,mCAAmC,CAAA;AAC9C,IAAA,WAAA,CACU,aAA0C,EAAA;QAA1C,IAAa,CAAA,aAAA,GAAb,aAAa,CAA6B;AAGpD,QAAA,IAAA,CAAA,GAAG,GAAG,KAAK,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC;AAC5B,QAAA,IAAA,CAAA,KAAK,GAAG,KAAK,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC;AAC5B,QAAA,IAAA,CAAA,QAAQ,GAAG,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,EAAE,EAAE,CAAC,CAAC;AACtD,QAAA,IAAA,CAAA,UAAU,GAAG,KAAK,CAAC,QAAQ,CAAC,OAAO,EAAE,CAAC;AACtC,QAAA,IAAA,CAAA,QAAQ,GAAG,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,EAAE,EAAE,CAAC,CAAC;AACtD,QAAA,IAAA,CAAA,OAAO,GAAG,IAAI,CAAC,aAAa,EAAE,CAAC;KAP3B;IASM,aAAa,GAAA;AACrB,QAAA,OAAO,IAAI,CAAC,aAAa,CAAC,MAAM,EAAE,CAAC;KACpC;AACF,CAAA;AAED;;AAEG;AAIG,MAAO,sCAAuC,SAAQ,gBAAiD,CAAA;AAC3G,IAAA,WAAA,CACE,aAA0C,EAAA;AAE1C,QAAA,KAAK,CAAC,mCAAmC,EAAE,aAAa,CAAC,CAAC;KAC3D;
|
1
|
+
{"version":3,"file":"daffodil-product-composite-driver-magento-testing.mjs","sources":["../../../libs/product-composite/driver/magento/testing/src/factories/bundle/bundle-item-option.factory.ts","../../../libs/product-composite/driver/magento/testing/src/factories/bundle/bundle-item.factory.ts","../../../libs/product-composite/driver/magento/testing/src/factories/bundle/bundle.factory.ts","../../../libs/product-composite/driver/magento/testing/src/daffodil-product-composite-driver-magento-testing.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\nimport { faker } from '@faker-js/faker/locale/en_US';\n\nimport { DaffModelFactory } from '@daffodil/core/testing';\nimport { MagentoSimpleProduct } from '@daffodil/product/driver/magento';\nimport { MagentoSimpleProductFactory } from '@daffodil/product/driver/magento/testing';\nimport { MagentoBundledProductItemOption } from '@daffodil/product-composite/driver/magento';\n\n\nexport class MockMagentoBundledProductItemOption implements MagentoBundledProductItemOption {\n constructor(\n private simpleFactory: MagentoSimpleProductFactory,\n ) {}\n\n uid = faker.datatype.uuid();\n label = faker.random.word();\n quantity = faker.datatype.number({ min: 1, max: 20 });\n is_default = faker.datatype.boolean();\n position = faker.datatype.number({ min: 1, max: 10 });\n product = this.createProduct();\n\n protected createProduct(): MagentoSimpleProduct {\n return this.simpleFactory.create();\n }\n}\n\n/**\n * A factory for creating stub data for {@link MagentoBundledProduct}s.\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class MagentoBundledProductItemOptionFactory extends DaffModelFactory<MagentoBundledProductItemOption> {\n constructor(\n simpleFactory: MagentoSimpleProductFactory,\n ) {\n super(MockMagentoBundledProductItemOption, simpleFactory);\n }\n}\n","import { Injectable } from '@angular/core';\nimport { faker } from '@faker-js/faker/locale/en_US';\n\nimport { DaffModelFactory } from '@daffodil/core/testing';\nimport {\n MagentoBundledProductItem,\n MagentoBundledProductItemOption,\n} from '@daffodil/product-composite/driver/magento';\n\nimport { MagentoBundledProductItemOptionFactory } from './bundle-item-option.factory';\n\n\nexport class MockMagentoBundledProductItem implements MagentoBundledProductItem {\n constructor(\n private optionFactory: MagentoBundledProductItemOptionFactory,\n ) {}\n required = faker.datatype.boolean();\n title = faker.random.word();\n type = faker.random.word();\n options = this.createOptions();\n option_id = faker.datatype.number({ min: 1, max: 9999 });\n\n protected createOptions(): MagentoBundledProductItemOption[] {\n\t return this.optionFactory.createMany(faker.datatype.number({ min: 1, max: 5 }));\n }\n}\n\n/**\n * A factory for creating stub data for {@link MagentoBundledProduct}s.\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class MagentoBundledProductItemFactory extends DaffModelFactory<MagentoBundledProductItem> {\n constructor(\n optionFactory: MagentoBundledProductItemOptionFactory,\n ) {\n super(MockMagentoBundledProductItem, optionFactory);\n }\n}\n","import { Injectable } from '@angular/core';\nimport { faker } from '@faker-js/faker/locale/en_US';\n\nimport { DaffModelFactory } from '@daffodil/core/testing';\nimport { MagentoProductTypeEnum } from '@daffodil/product/driver/magento';\nimport { MockMagentoCoreProduct } from '@daffodil/product/driver/magento/testing';\nimport {\n MagentoBundledProduct,\n MagentoBundledProductItem,\n} from '@daffodil/product-composite/driver/magento';\n\nimport { MagentoBundledProductItemFactory } from './bundle-item.factory';\n\n\nexport class MockMagentoBundledProduct extends MockMagentoCoreProduct implements MagentoBundledProduct {\n constructor(\n private bundleItemFactory: MagentoBundledProductItemFactory,\n ) {\n super();\n }\n\n __typename = MagentoProductTypeEnum.BundledProduct;\n items = this.createBundleItems();\n\n protected createBundleItems(): MagentoBundledProductItem[] {\n return this.bundleItemFactory.createMany(faker.datatype.number({ min: 1, max: 5 }));\n }\n}\n\n/**\n * A factory for creating stub data for {@link MagentoBundledProduct}s.\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class MagentoBundledProductFactory extends DaffModelFactory<MagentoBundledProduct> {\n constructor(\n bundleItemFactory: MagentoBundledProductItemFactory,\n ) {\n super(MockMagentoBundledProduct, bundleItemFactory);\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i1.MagentoBundledProductItemOptionFactory","i1.MagentoBundledProductItemFactory"],"mappings":";;;;;;;;MASa,mCAAmC,CAAA;AAC9C,IAAA,WAAA,CACU,aAA0C,EAAA;QAA1C,IAAa,CAAA,aAAA,GAAb,aAAa,CAA6B;AAGpD,QAAA,IAAA,CAAA,GAAG,GAAG,KAAK,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC;AAC5B,QAAA,IAAA,CAAA,KAAK,GAAG,KAAK,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC;AAC5B,QAAA,IAAA,CAAA,QAAQ,GAAG,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,EAAE,EAAE,CAAC,CAAC;AACtD,QAAA,IAAA,CAAA,UAAU,GAAG,KAAK,CAAC,QAAQ,CAAC,OAAO,EAAE,CAAC;AACtC,QAAA,IAAA,CAAA,QAAQ,GAAG,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,EAAE,EAAE,CAAC,CAAC;AACtD,QAAA,IAAA,CAAA,OAAO,GAAG,IAAI,CAAC,aAAa,EAAE,CAAC;KAP3B;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A;QACzB,OAAO,IAAI,CAAC,iBAAiB,CAAC,UAAU,CAAC,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;KACrF;AACF,CAAA;AAED;;AAEG;AAIG,MAAO,4BAA6B,SAAQ,gBAAuC,CAAA;AACvF,IAAA,WAAA,CACE,iBAAmD,EAAA;AAEnD,QAAA,KAAK,CAAC,yBAAyB,EAAE,iBAAiB,CAAC,CAAC;KACrD;kIALU,4BAA4B,EAAA,IAAA,EAAA,CAAA,EAAA,KAAA,EAAAC,gCAAA,EAAA,CAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA,EAAA;AAA5B,uBAAA,SAAA,IAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,4BAA4B,cAF3B,MAAM,EAAA,CAAA,CAAA,EAAA;;4FAEP,4BAA4B,EAAA,UAAA,EAAA,CAAA;kBAHxC,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,UAAU,EAAE,MAAM;AACnB,iBAAA,CAAA;;;AClCD;;AAEG;;;;"}
|
@@ -122,11 +122,11 @@ class DaffCompositeProductMagentoDriverModule {
|
|
122
122
|
],
|
123
123
|
};
|
124
124
|
}
|
125
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.
|
126
|
-
/** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.
|
127
|
-
/** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.
|
125
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.10", ngImport: i0, type: DaffCompositeProductMagentoDriverModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
126
|
+
/** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.3.10", ngImport: i0, type: DaffCompositeProductMagentoDriverModule, imports: [CommonModule] }); }
|
127
|
+
/** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.3.10", ngImport: i0, type: DaffCompositeProductMagentoDriverModule, imports: [CommonModule] }); }
|
128
128
|
}
|
129
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.
|
129
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.10", ngImport: i0, type: DaffCompositeProductMagentoDriverModule, decorators: [{
|
130
130
|
type: NgModule,
|
131
131
|
args: [{
|
132
132
|
imports: [
|
@@ -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,CAAC,GAAG,CAAC,kCAAkC,CAAC;KACrD,CAAC;AACJ,CAAC;AAED,SAAS,kCAAkC,CAAC,IAA+B,EAAA;IACzE,OAAO;AACL,QAAA,EAAE,EAAE,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE;QAC7B,QAAQ,EAAE,IAAI,CAAC,QAAQ;QACvB,KAAK,EAAE,IAAI,CAAC,KAAK;QACjB,UAAU,EAAqC,IAAI,CA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AAA,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 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,CAAC,GAAG,CAAC,kCAAkC,CAAC;KACrD,CAAC;AACJ,CAAC;AAED,SAAS,kCAAkC,CAAC,IAA+B,EAAA;IACzE,OAAO;AACL,QAAA,EAAE,EAAE,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE;QAC7B,QAAQ,EAAE,IAAI,CAAC,QAAQ;QACvB,KAAK,EAAE,IAAI,CAAC,KAAK;QACjB,UAAU,EAAqC,IAAI,CAAC,IAAI;AACxD,QAAA,OAAO,EAAE,KAAK,CAAC,IAAI,CAAC,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AAA,CAAA,CAAA,EAAA;;4FAGH,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;;;;"}
|
@@ -20,11 +20,11 @@ class DaffCompositeProductTestingDriverModule {
|
|
20
20
|
],
|
21
21
|
};
|
22
22
|
}
|
23
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.
|
24
|
-
/** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.
|
25
|
-
/** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.
|
23
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.10", ngImport: i0, type: DaffCompositeProductTestingDriverModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
24
|
+
/** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.3.10", ngImport: i0, type: DaffCompositeProductTestingDriverModule, imports: [CommonModule] }); }
|
25
|
+
/** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.3.10", ngImport: i0, type: DaffCompositeProductTestingDriverModule, imports: [CommonModule] }); }
|
26
26
|
}
|
27
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.
|
27
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.10", ngImport: i0, type: DaffCompositeProductTestingDriverModule, decorators: [{
|
28
28
|
type: NgModule,
|
29
29
|
args: [{
|
30
30
|
imports: [
|
@@ -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 { DAFF_PRODUCT_TYPE_FACTORIES } 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 {\n provide: DAFF_PRODUCT_TYPE_FACTORIES,\n useExisting: DaffCompositeProductFactory,\n multi: true,\n },\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;AACT,gBAAA;AACE,oBAAA,OAAO,EAAE,2BAA2B;AACpC,oBAAA,WAAW,EAAE,2BAA2B;AACxC,oBAAA,KAAK,EAAE,IAAI;AACZ,iBAAA;AACF,aAAA;SACF,CAAC;KACH;
|
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 { DAFF_PRODUCT_TYPE_FACTORIES } 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 {\n provide: DAFF_PRODUCT_TYPE_FACTORIES,\n useExisting: DaffCompositeProductFactory,\n multi: true,\n },\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;AACT,gBAAA;AACE,oBAAA,OAAO,EAAE,2BAA2B;AACpC,oBAAA,WAAW,EAAE,2BAA2B;AACxC,oBAAA,KAAK,EAAE,IAAI;AACZ,iBAAA;AACF,aAAA;SACF,CAAC;KACH;kIAZU,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,SAAA,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,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,uCAAuC,YAHhD,YAAY,CAAA,EAAA,CAAA,CAAA,EAAA;;4FAGH,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;;;;"}
|
@@ -48,10 +48,10 @@ class DaffProductCompositeQueryParamService {
|
|
48
48
|
get() {
|
49
49
|
return (new URL(this.document.location.toString())).searchParams.get(this.config.compositeSelectionQueryParam);
|
50
50
|
}
|
51
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.
|
52
|
-
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.
|
51
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.10", ngImport: i0, type: DaffProductCompositeQueryParamService, deps: [{ token: DOCUMENT }, { token: DAFF_PRODUCT_COMPOSITE_ROUTING_CONFIG }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
52
|
+
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.10", ngImport: i0, type: DaffProductCompositeQueryParamService }); }
|
53
53
|
}
|
54
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.
|
54
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.10", ngImport: i0, type: DaffProductCompositeQueryParamService, decorators: [{
|
55
55
|
type: Injectable
|
56
56
|
}], ctorParameters: () => [{ type: undefined, decorators: [{
|
57
57
|
type: Inject,
|
@@ -106,10 +106,10 @@ class DaffProductCompositePageEffects {
|
|
106
106
|
return of(...applyActions);
|
107
107
|
})));
|
108
108
|
}
|
109
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.
|
110
|
-
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.
|
109
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.10", ngImport: i0, type: DaffProductCompositePageEffects, deps: [{ token: i1.Actions }, { token: DaffProductCompositeQueryParamService }, { token: DAFF_PRODUCT_COMPOSITE_ROUTING_CONFIG }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
110
|
+
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.10", ngImport: i0, type: DaffProductCompositePageEffects }); }
|
111
111
|
}
|
112
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.
|
112
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.10", ngImport: i0, type: DaffProductCompositePageEffects, decorators: [{
|
113
113
|
type: Injectable
|
114
114
|
}], ctorParameters: () => [{ type: i1.Actions }, { type: DaffProductCompositeQueryParamService }, { type: undefined, decorators: [{
|
115
115
|
type: Inject,
|
@@ -131,13 +131,13 @@ class DaffProductCompositeRoutingModule {
|
|
131
131
|
],
|
132
132
|
};
|
133
133
|
}
|
134
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.
|
135
|
-
/** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.
|
136
|
-
/** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.
|
134
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.10", ngImport: i0, type: DaffProductCompositeRoutingModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
135
|
+
/** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.3.10", ngImport: i0, type: DaffProductCompositeRoutingModule, imports: [i1.EffectsFeatureModule] }); }
|
136
|
+
/** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.3.10", ngImport: i0, type: DaffProductCompositeRoutingModule, providers: [
|
137
137
|
DaffProductCompositeQueryParamService,
|
138
138
|
], imports: [EffectsModule.forFeature([DaffProductCompositePageEffects])] }); }
|
139
139
|
}
|
140
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.
|
140
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.10", ngImport: i0, type: DaffProductCompositeRoutingModule, decorators: [{
|
141
141
|
type: NgModule,
|
142
142
|
args: [{
|
143
143
|
imports: [
|
@@ -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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AAI,EAAE;qBAChB,CAAC;AACH,iBAAA;AACF,aAAA;SACF,CAAC;KACH;iIAdU,iCAAiC,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA,EAAA;kIAAjC,iCAAiC,EAAA,OAAA,EAAA,CAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,CAAA,CAAA,EAAA;AAAjC,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 { 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":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ac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.
|
42
|
-
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.
|
41
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.10", ngImport: i0, type: MockDaffCompositeProductFacade, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
42
|
+
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.10", ngImport: i0, type: MockDaffCompositeProductFacade, providedIn: 'root' }); }
|
43
43
|
}
|
44
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.
|
44
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.10", ngImport: i0, type: MockDaffCompositeProductFacade, decorators: [{
|
45
45
|
type: Injectable,
|
46
46
|
args: [{ providedIn: 'root' }]
|
47
47
|
}] });
|
48
48
|
|
49
49
|
class DaffCompositeProductStateTestingModule {
|
50
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.
|
51
|
-
/** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.
|
52
|
-
/** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.
|
50
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.10", ngImport: i0, type: DaffCompositeProductStateTestingModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
51
|
+
/** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.3.10", ngImport: i0, type: DaffCompositeProductStateTestingModule }); }
|
52
|
+
/** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.3.10", ngImport: i0, type: DaffCompositeProductStateTestingModule, providers: [
|
53
53
|
{ provide: DaffCompositeProductFacade, useExisting: MockDaffCompositeProductFacade },
|
54
54
|
] }); }
|
55
55
|
}
|
56
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.
|
56
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.10", ngImport: i0, type: DaffCompositeProductStateTestingModule, decorators: [{
|
57
57
|
type: NgModule,
|
58
58
|
args: [{
|
59
59
|
providers: [
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"daffodil-product-composite-state-testing.mjs","sources":["../../../libs/product-composite/state/testing/src/mock-composite-product-facade.ts","../../../libs/product-composite/state/testing/src/product-testing.module.ts","../../../libs/product-composite/state/testing/src/daffodil-product-composite-state-testing.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\nimport { Dictionary } from '@ngrx/entity';\nimport { BehaviorSubject } from 'rxjs';\n\nimport { DaffPriceRange } from '@daffodil/product';\nimport {\n DaffCompositeProductItemOption,\n DaffCompositeProduct,\n DaffCompositeProductItem,\n DaffCompositeConfigurationItem,\n} from '@daffodil/product-composite';\nimport { DaffCompositeProductFacadeInterface } from '@daffodil/product-composite/state';\n\n/**\n * @inheritdoc\n */\n@Injectable({ providedIn: 'root' })\nexport class MockDaffCompositeProductFacade implements DaffCompositeProductFacadeInterface {\n getRequiredItemPricesForConfiguration(id: DaffCompositeProduct['id'], configuration?: Dictionary<DaffCompositeConfigurationItem>): BehaviorSubject<DaffPriceRange> {\n return new BehaviorSubject(null);\n }\n getOptionalItemPricesForConfiguration(id: DaffCompositeProduct['id'], configuration?: Dictionary<DaffCompositeConfigurationItem>): BehaviorSubject<DaffPriceRange> {\n return new BehaviorSubject(null);\n }\n getPricesAsCurrentlyConfigured(id: DaffCompositeProduct['id']): BehaviorSubject<DaffPriceRange> {\n return new BehaviorSubject(null);\n }\n getAppliedOptions(id: DaffCompositeProduct['id']): BehaviorSubject<Dictionary<DaffCompositeProductItemOption>> {\n return new BehaviorSubject({});\n }\n getDiscountAmount(id: DaffCompositeProduct['id']): BehaviorSubject<number> {\n return new BehaviorSubject(null);\n }\n getDiscountPercent(id: DaffCompositeProduct['id']): BehaviorSubject<number> {\n return new BehaviorSubject(null);\n }\n isItemRequired(id: DaffCompositeProduct['id'], item_id: DaffCompositeProductItem['id']): BehaviorSubject<boolean> {\n return new BehaviorSubject(false);\n }\n dispatch(action) {};\n hasDiscount(priceRange: DaffPriceRange): boolean {\n return false;\n };\n hasPriceRange(priceRange: DaffPriceRange): boolean {\n return false;\n };\n}\n","import { NgModule } from '@angular/core';\n\nimport { DaffCompositeProductFacade } from '@daffodil/product-composite/state';\n\nimport { MockDaffCompositeProductFacade } from './mock-composite-product-facade';\n\n@NgModule({\n providers: [\n { provide: DaffCompositeProductFacade, useExisting: MockDaffCompositeProductFacade },\n ],\n})\nexport class DaffCompositeProductStateTestingModule { }\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;AAaA;;AAEG;MAEU,8BAA8B,CAAA;IACzC,qCAAqC,CAAC,EAA8B,EAAE,aAA0D,EAAA;AAC9H,QAAA,OAAO,IAAI,eAAe,CAAC,IAAI,CAAC,CAAC;KAClC;IACD,qCAAqC,CAAC,EAA8B,EAAE,aAA0D,EAAA;AAC9H,QAAA,OAAO,IAAI,eAAe,CAAC,IAAI,CAAC,CAAC;KAClC;AACD,IAAA,8BAA8B,CAAC,EAA8B,EAAA;AAC3D,QAAA,OAAO,IAAI,eAAe,CAAC,IAAI,CAAC,CAAC;KAClC;AACD,IAAA,iBAAiB,CAAC,EAA8B,EAAA;AAC9C,QAAA,OAAO,IAAI,eAAe,CAAC,EAAE,CAAC,CAAC;KAChC;AACD,IAAA,iBAAiB,CAAC,EAA8B,EAAA;AAC9C,QAAA,OAAO,IAAI,eAAe,CAAC,IAAI,CAAC,CAAC;KAClC;AACD,IAAA,kBAAkB,CAAC,EAA8B,EAAA;AAC/C,QAAA,OAAO,IAAI,eAAe,CAAC,IAAI,CAAC,CAAC;KAClC;IACD,cAAc,CAAC,EAA8B,EAAE,OAAuC,EAAA;AACpF,QAAA,OAAO,IAAI,eAAe,CAAC,KAAK,CAAC,CAAC;KACnC;IACD,QAAQ,CAAC,MAAM,EAAA,GAAI;;AACnB,IAAA,WAAW,CAAC,UAA0B,EAAA;AACpC,QAAA,OAAO,KAAK,CAAC;KACd;;AACD,IAAA,aAAa,CAAC,UAA0B,EAAA;AACtC,QAAA,OAAO,KAAK,CAAC;KACd;;
|
1
|
+
{"version":3,"file":"daffodil-product-composite-state-testing.mjs","sources":["../../../libs/product-composite/state/testing/src/mock-composite-product-facade.ts","../../../libs/product-composite/state/testing/src/product-testing.module.ts","../../../libs/product-composite/state/testing/src/daffodil-product-composite-state-testing.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\nimport { Dictionary } from '@ngrx/entity';\nimport { BehaviorSubject } from 'rxjs';\n\nimport { DaffPriceRange } from '@daffodil/product';\nimport {\n DaffCompositeProductItemOption,\n DaffCompositeProduct,\n DaffCompositeProductItem,\n DaffCompositeConfigurationItem,\n} from '@daffodil/product-composite';\nimport { DaffCompositeProductFacadeInterface } from '@daffodil/product-composite/state';\n\n/**\n * @inheritdoc\n */\n@Injectable({ providedIn: 'root' })\nexport class MockDaffCompositeProductFacade implements DaffCompositeProductFacadeInterface {\n getRequiredItemPricesForConfiguration(id: DaffCompositeProduct['id'], configuration?: Dictionary<DaffCompositeConfigurationItem>): BehaviorSubject<DaffPriceRange> {\n return new BehaviorSubject(null);\n }\n getOptionalItemPricesForConfiguration(id: DaffCompositeProduct['id'], configuration?: Dictionary<DaffCompositeConfigurationItem>): BehaviorSubject<DaffPriceRange> {\n return new BehaviorSubject(null);\n }\n getPricesAsCurrentlyConfigured(id: DaffCompositeProduct['id']): BehaviorSubject<DaffPriceRange> {\n return new BehaviorSubject(null);\n }\n getAppliedOptions(id: DaffCompositeProduct['id']): BehaviorSubject<Dictionary<DaffCompositeProductItemOption>> {\n return new BehaviorSubject({});\n }\n getDiscountAmount(id: DaffCompositeProduct['id']): BehaviorSubject<number> {\n return new BehaviorSubject(null);\n }\n getDiscountPercent(id: DaffCompositeProduct['id']): BehaviorSubject<number> {\n return new BehaviorSubject(null);\n }\n isItemRequired(id: DaffCompositeProduct['id'], item_id: DaffCompositeProductItem['id']): BehaviorSubject<boolean> {\n return new BehaviorSubject(false);\n }\n dispatch(action) {};\n hasDiscount(priceRange: DaffPriceRange): boolean {\n return false;\n };\n hasPriceRange(priceRange: DaffPriceRange): boolean {\n return false;\n };\n}\n","import { NgModule } from '@angular/core';\n\nimport { DaffCompositeProductFacade } from '@daffodil/product-composite/state';\n\nimport { MockDaffCompositeProductFacade } from './mock-composite-product-facade';\n\n@NgModule({\n providers: [\n { provide: DaffCompositeProductFacade, useExisting: MockDaffCompositeProductFacade },\n ],\n})\nexport class DaffCompositeProductStateTestingModule { }\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;AAaA;;AAEG;MAEU,8BAA8B,CAAA;IACzC,qCAAqC,CAAC,EAA8B,EAAE,aAA0D,EAAA;AAC9H,QAAA,OAAO,IAAI,eAAe,CAAC,IAAI,CAAC,CAAC;KAClC;IACD,qCAAqC,CAAC,EAA8B,EAAE,aAA0D,EAAA;AAC9H,QAAA,OAAO,IAAI,eAAe,CAAC,IAAI,CAAC,CAAC;KAClC;AACD,IAAA,8BAA8B,CAAC,EAA8B,EAAA;AAC3D,QAAA,OAAO,IAAI,eAAe,CAAC,IAAI,CAAC,CAAC;KAClC;AACD,IAAA,iBAAiB,CAAC,EAA8B,EAAA;AAC9C,QAAA,OAAO,IAAI,eAAe,CAAC,EAAE,CAAC,CAAC;KAChC;AACD,IAAA,iBAAiB,CAAC,EAA8B,EAAA;AAC9C,QAAA,OAAO,IAAI,eAAe,CAAC,IAAI,CAAC,CAAC;KAClC;AACD,I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AACrF,SAAA,EAAA,CAAA,CAAA,EAAA;;4FAEU,sCAAsC,EAAA,UAAA,EAAA,CAAA;kBALlD,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,SAAS,EAAE;AACT,wBAAA,EAAE,OAAO,EAAE,0BAA0B,EAAE,WAAW,EAAE,8BAA8B,EAAE;AACrF,qBAAA;AACF,iBAAA,CAAA;;;ACVD;;AAEG;;;;"}
|
@@ -405,10 +405,10 @@ class DaffCompositeProductFacade {
|
|
405
405
|
dispatch(action) {
|
406
406
|
this.store.dispatch(action);
|
407
407
|
}
|
408
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.
|
409
|
-
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.
|
408
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.10", ngImport: i0, type: DaffCompositeProductFacade, deps: [{ token: i1.Store }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
409
|
+
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.10", ngImport: i0, type: DaffCompositeProductFacade, providedIn: 'root' }); }
|
410
410
|
}
|
411
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.
|
411
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.10", ngImport: i0, type: DaffCompositeProductFacade, decorators: [{
|
412
412
|
type: Injectable,
|
413
413
|
args: [{
|
414
414
|
providedIn: 'root',
|
@@ -522,13 +522,13 @@ const DAFF_PRODUCT_COMPOSITE_REDUCERS = new InjectionToken('DAFF_PRODUCT_COMPOSI
|
|
522
522
|
* A module that provides the default reducers and effects for composite product redux state.
|
523
523
|
*/
|
524
524
|
class DaffCompositeProductStateModule {
|
525
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.
|
526
|
-
/** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.
|
527
|
-
/** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.
|
525
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.10", ngImport: i0, type: DaffCompositeProductStateModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
526
|
+
/** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.3.10", ngImport: i0, type: DaffCompositeProductStateModule, imports: [i1.StoreFeatureModule] }); }
|
527
|
+
/** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.3.10", ngImport: i0, type: DaffCompositeProductStateModule, providers: [
|
528
528
|
...daffProductProvideMetaReducers(daffProductCompositeEnsureItemsMetaReducer),
|
529
529
|
], imports: [StoreModule.forFeature(DAFF_COMPOSITE_PRODUCT_STORE_FEATURE_KEY, DAFF_PRODUCT_COMPOSITE_REDUCERS)] }); }
|
530
530
|
}
|
531
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.
|
531
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.10", ngImport: i0, type: DaffCompositeProductStateModule, decorators: [{
|
532
532
|
type: NgModule,
|
533
533
|
args: [{
|
534
534
|
imports: [
|