@daffodil/product-composite 0.88.1 → 0.89.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.
Files changed (107) hide show
  1. package/driver/in-memory/index.d.ts +15 -1
  2. package/driver/magento/index.d.ts +133 -1
  3. package/driver/magento/testing/index.d.ts +62 -1
  4. package/driver/testing/index.d.ts +15 -1
  5. package/fesm2022/daffodil-product-composite-driver-in-memory.mjs +4 -4
  6. package/fesm2022/daffodil-product-composite-driver-in-memory.mjs.map +1 -1
  7. package/fesm2022/daffodil-product-composite-driver-magento-testing.mjs +9 -9
  8. package/fesm2022/daffodil-product-composite-driver-magento-testing.mjs.map +1 -1
  9. package/fesm2022/daffodil-product-composite-driver-magento.mjs +10 -10
  10. package/fesm2022/daffodil-product-composite-driver-magento.mjs.map +1 -1
  11. package/fesm2022/daffodil-product-composite-driver-testing.mjs +4 -4
  12. package/fesm2022/daffodil-product-composite-driver-testing.mjs.map +1 -1
  13. package/fesm2022/daffodil-product-composite-routing.mjs +11 -12
  14. package/fesm2022/daffodil-product-composite-routing.mjs.map +1 -1
  15. package/fesm2022/daffodil-product-composite-state-testing.mjs +7 -7
  16. package/fesm2022/daffodil-product-composite-state-testing.mjs.map +1 -1
  17. package/fesm2022/daffodil-product-composite-state.mjs +7 -7
  18. package/fesm2022/daffodil-product-composite-state.mjs.map +1 -1
  19. package/fesm2022/daffodil-product-composite-testing.mjs +9 -9
  20. package/fesm2022/daffodil-product-composite-testing.mjs.map +1 -1
  21. package/fesm2022/daffodil-product-composite.mjs.map +1 -1
  22. package/index.d.ts +88 -1
  23. package/package.json +1 -1
  24. package/routing/index.d.ts +75 -1
  25. package/state/index.d.ts +321 -1
  26. package/state/testing/index.d.ts +32 -1
  27. package/testing/index.d.ts +64 -1
  28. package/driver/in-memory/in-memory.module.d.ts +0 -12
  29. package/driver/in-memory/public_api.d.ts +0 -1
  30. package/driver/magento/composite-product-driver.module.d.ts +0 -12
  31. package/driver/magento/fragments/bundled-product.d.ts +0 -2
  32. package/driver/magento/injection-tokens/fragments/item.token.d.ts +0 -2
  33. package/driver/magento/injection-tokens/fragments/option.token.d.ts +0 -2
  34. package/driver/magento/injection-tokens/public_api.d.ts +0 -4
  35. package/driver/magento/injection-tokens/transforms/item/extra.token.d.ts +0 -21
  36. package/driver/magento/injection-tokens/transforms/item/token.d.ts +0 -2
  37. package/driver/magento/injection-tokens/transforms/option/extra.token.d.ts +0 -21
  38. package/driver/magento/injection-tokens/transforms/option/token.d.ts +0 -2
  39. package/driver/magento/interfaces/item-extra-transform.type.d.ts +0 -3
  40. package/driver/magento/interfaces/item-transform.type.d.ts +0 -3
  41. package/driver/magento/interfaces/option-extra-transform.type.d.ts +0 -3
  42. package/driver/magento/interfaces/option-transform.type.d.ts +0 -3
  43. package/driver/magento/interfaces/public_api.d.ts +0 -4
  44. package/driver/magento/models/bundled-product.d.ts +0 -39
  45. package/driver/magento/models/public_api.d.ts +0 -1
  46. package/driver/magento/public_api.d.ts +0 -6
  47. package/driver/magento/testing/factories/bundle/bundle-item-option.factory.d.ts +0 -24
  48. package/driver/magento/testing/factories/bundle/bundle-item.factory.d.ts +0 -22
  49. package/driver/magento/testing/factories/bundle/bundle.factory.d.ts +0 -21
  50. package/driver/magento/testing/factories/public_api.d.ts +0 -3
  51. package/driver/magento/testing/public_api.d.ts +0 -1
  52. package/driver/magento/transforms/item-transformer.service.d.ts +0 -11
  53. package/driver/magento/transforms/option.d.ts +0 -3
  54. package/driver/magento/transforms/product-transformer.service.d.ts +0 -17
  55. package/driver/magento/transforms/public_api.d.ts +0 -3
  56. package/driver/testing/public_api.d.ts +0 -1
  57. package/driver/testing/testing.module.d.ts +0 -12
  58. package/helpers/build-selection-payload.d.ts +0 -2
  59. package/helpers/public_api.d.ts +0 -1
  60. package/models/composite-configuration-item.d.ts +0 -14
  61. package/models/composite-product-item.d.ts +0 -48
  62. package/models/composite-product.d.ts +0 -16
  63. package/models/public_api.d.ts +0 -4
  64. package/models/selection-payload.type.d.ts +0 -5
  65. package/public_api.d.ts +0 -2
  66. package/routing/config/default.d.ts +0 -8
  67. package/routing/config/interface.d.ts +0 -20
  68. package/routing/config/public_api.d.ts +0 -3
  69. package/routing/config/token.d.ts +0 -2
  70. package/routing/effects/product-page.effects.d.ts +0 -22
  71. package/routing/effects/public_api.d.ts +0 -1
  72. package/routing/module.d.ts +0 -10
  73. package/routing/public_api.d.ts +0 -3
  74. package/routing/services/query-param.service.d.ts +0 -13
  75. package/state/actions/composite-product.actions.d.ts +0 -24
  76. package/state/actions/public_api.d.ts +0 -1
  77. package/state/composite-product-state.module.d.ts +0 -10
  78. package/state/facades/composite-product/composite-product-facade.interface.d.ts +0 -73
  79. package/state/facades/composite-product/composite-product.facade.d.ts +0 -31
  80. package/state/facades/public_api.d.ts +0 -2
  81. package/state/helpers/ensure-items.d.ts +0 -7
  82. package/state/helpers/public_api.d.ts +0 -1
  83. package/state/public_api.d.ts +0 -6
  84. package/state/reducers/composite-product-entities/composite-product-entities-reducer-adapter.d.ts +0 -49
  85. package/state/reducers/composite-product-entities/composite-product-entities.reducer.d.ts +0 -14
  86. package/state/reducers/composite-product-entities/composite-product-entity.d.ts +0 -16
  87. package/state/reducers/composite-product-reducers-state.interface.d.ts +0 -14
  88. package/state/reducers/composite-product-reducers.d.ts +0 -6
  89. package/state/reducers/composite-product-store-feature-key.d.ts +0 -1
  90. package/state/reducers/ensure-items.meta-reducer.d.ts +0 -6
  91. package/state/reducers/injection-tokens/extra.token.d.ts +0 -3
  92. package/state/reducers/injection-tokens/public_api.d.ts +0 -1
  93. package/state/reducers/injection-tokens/reducers.token.d.ts +0 -3
  94. package/state/reducers/public_api.d.ts +0 -7
  95. package/state/selectors/all.selector.d.ts +0 -13
  96. package/state/selectors/composite-product/composite-product.selectors.d.ts +0 -38
  97. package/state/selectors/composite-product-entities/composite-product-entities.selectors.d.ts +0 -45
  98. package/state/selectors/feature.selector.d.ts +0 -12
  99. package/state/selectors/public_api.d.ts +0 -4
  100. package/state/testing/mock-composite-product-facade.d.ts +0 -23
  101. package/state/testing/product-testing.module.d.ts +0 -6
  102. package/state/testing/public_api.d.ts +0 -2
  103. package/testing/factories/composite-product-item-option.factory.d.ts +0 -19
  104. package/testing/factories/composite-product-item.factory.d.ts +0 -25
  105. package/testing/factories/composite-product.factory.d.ts +0 -23
  106. package/testing/factories/public_api.d.ts +0 -3
  107. package/testing/public_api.d.ts +0 -1
@@ -1,12 +0,0 @@
1
- import { ModuleWithProviders } from '@angular/core';
2
- import * as i0 from "@angular/core";
3
- import * as i1 from "@angular/common";
4
- /**
5
- * A module that provides the product fragment for composite products along with a composite product transformer.
6
- */
7
- export declare class DaffCompositeProductMagentoDriverModule {
8
- static forRoot(): ModuleWithProviders<DaffCompositeProductMagentoDriverModule>;
9
- static ɵfac: i0.ɵɵFactoryDeclaration<DaffCompositeProductMagentoDriverModule, never>;
10
- static ɵmod: i0.ɵɵNgModuleDeclaration<DaffCompositeProductMagentoDriverModule, never, [typeof i1.CommonModule], never>;
11
- static ɵinj: i0.ɵɵInjectorDeclaration<DaffCompositeProductMagentoDriverModule>;
12
- }
@@ -1,2 +0,0 @@
1
- import { DocumentNode } from 'graphql';
2
- export declare const magentoBundledProductFragment: (extraItemFragments?: Array<DocumentNode>, extraOptionFragments?: Array<DocumentNode>) => import("apollo-angular").TypedDocumentNode<unknown, unknown>;
@@ -1,2 +0,0 @@
1
- import { DocumentNode } from 'graphql';
2
- export declare const DAFF_PRODUCT_COMPOSITE_MAGENTO_EXTRA_ITEM_FRAGMENTS: import("@angular/core").InjectionToken<DocumentNode[]>, provideDaffProductCompositeMagentoExtraItemFragments: <R extends DocumentNode = DocumentNode>(...values: R[]) => Array<import("@angular/core").ValueProvider>;
@@ -1,2 +0,0 @@
1
- import { DocumentNode } from 'graphql';
2
- export declare const DAFF_PRODUCT_COMPOSITE_MAGENTO_EXTRA_OPTION_FRAGMENTS: import("@angular/core").InjectionToken<DocumentNode[]>, provideDaffProductCompositeMagentoExtraOptionFragments: <R extends DocumentNode = DocumentNode>(...values: R[]) => Array<import("@angular/core").ValueProvider>;
@@ -1,4 +0,0 @@
1
- export * from './fragments/item.token';
2
- export * from './fragments/option.token';
3
- export * from './transforms/item/extra.token';
4
- export * from './transforms/option/extra.token';
@@ -1,21 +0,0 @@
1
- import { Provider } from '@angular/core';
2
- import { DaffCompositeProductItem } from '@daffodil/product-composite';
3
- import { MagentoBundleProductItemExtraTransform } from '../../../interfaces/item-extra-transform.type';
4
- import { MagentoBundledProductItem } from '../../../models/public_api';
5
- declare const DAFF_PRODUCT_COMPOSITE_MAGENTO_EXTRA_ITEM_TRANSFORMS: import("@angular/core").InjectionToken<MagentoBundleProductItemExtraTransform[]>;
6
- /**
7
- * Provides extra product preview transforms for the Magento product driver.
8
- *
9
- * See {@link DAFF_PRODUCT_COMPOSITE_MAGENTO_EXTRA_ITEM_TRANSFORMS}.
10
- *
11
- * @example
12
- * ```ts
13
- * providers: [
14
- * ...provideDaffProductCompositeMagentoExtraItemTransforms(
15
- * myExtraProductTransform
16
- * )
17
- * ]
18
- * ```
19
- */
20
- export declare function provideDaffProductCompositeMagentoExtraItemTransforms<T extends MagentoBundledProductItem = MagentoBundledProductItem, V extends DaffCompositeProductItem = DaffCompositeProductItem>(...transforms: MagentoBundleProductItemExtraTransform<T, V>[]): Provider[];
21
- export { DAFF_PRODUCT_COMPOSITE_MAGENTO_EXTRA_ITEM_TRANSFORMS };
@@ -1,2 +0,0 @@
1
- import { MagentoBundleProductItemTransform } from '../../../interfaces/public_api';
2
- export declare const DAFF_PRODUCT_COMPOSITE_MAGENTO_ITEM_TRANSFORM: import("@angular/core").InjectionToken<MagentoBundleProductItemTransform>, provideDaffProductMagentoProductTransform: <R extends MagentoBundleProductItemTransform = MagentoBundleProductItemTransform>(value: R) => import("@angular/core").ValueProvider;
@@ -1,21 +0,0 @@
1
- import { Provider } from '@angular/core';
2
- import { DaffCompositeProductItemOption } from '@daffodil/product-composite';
3
- import { MagentoBundleProductOptionExtraTransform } from '../../../interfaces/option-extra-transform.type';
4
- import { MagentoBundledProductItemOption } from '../../../models/public_api';
5
- declare const DAFF_PRODUCT_COMPOSITE_MAGENTO_EXTRA_OPTION_TRANSFORMS: import("@angular/core").InjectionToken<MagentoBundleProductOptionExtraTransform[]>;
6
- /**
7
- * Provides extra product preview transforms for the Magento product driver.
8
- *
9
- * See {@link DAFF_PRODUCT_COMPOSITE_MAGENTO_EXTRA_OPTION_TRANSFORMS}.
10
- *
11
- * @example
12
- * ```ts
13
- * providers: [
14
- * ...provideDaffProductCompositeMagentoExtraOptionTransforms(
15
- * myExtraProductTransform
16
- * )
17
- * ]
18
- * ```
19
- */
20
- export declare function provideDaffProductCompositeMagentoExtraOptionTransforms<T extends MagentoBundledProductItemOption = MagentoBundledProductItemOption, V extends DaffCompositeProductItemOption = DaffCompositeProductItemOption>(...transforms: MagentoBundleProductOptionExtraTransform<T, V>[]): Provider[];
21
- export { DAFF_PRODUCT_COMPOSITE_MAGENTO_EXTRA_OPTION_TRANSFORMS };
@@ -1,2 +0,0 @@
1
- import { MagentoBundleProductOptionTransform } from '../../../interfaces/public_api';
2
- export declare const DAFF_PRODUCT_COMPOSITE_MAGENTO_OPTION_TRANSFORM: import("@angular/core").InjectionToken<MagentoBundleProductOptionTransform>, provideDaffProductMagentoProductTransform: <R extends MagentoBundleProductOptionTransform = MagentoBundleProductOptionTransform>(value: R) => import("@angular/core").ValueProvider;
@@ -1,3 +0,0 @@
1
- import { DaffCompositeProductItem } from '@daffodil/product-composite';
2
- import { MagentoBundledProductItem } from '../models/bundled-product';
3
- export type MagentoBundleProductItemExtraTransform<T extends MagentoBundledProductItem = MagentoBundledProductItem, V extends DaffCompositeProductItem = DaffCompositeProductItem> = (daffItem: DaffCompositeProductItem, magentoItem: T) => V;
@@ -1,3 +0,0 @@
1
- import { DaffCompositeProductItem } from '@daffodil/product-composite';
2
- import { MagentoBundledProductItem } from '../models/bundled-product';
3
- export type MagentoBundleProductItemTransform<T extends MagentoBundledProductItem = MagentoBundledProductItem, V extends DaffCompositeProductItem = DaffCompositeProductItem> = (magentoItem: T) => V;
@@ -1,3 +0,0 @@
1
- import { DaffCompositeProductItemOption } from '@daffodil/product-composite';
2
- import { MagentoBundledProductItemOption } from '../models/bundled-product';
3
- export type MagentoBundleProductOptionExtraTransform<T extends MagentoBundledProductItemOption = MagentoBundledProductItemOption, V extends DaffCompositeProductItemOption = DaffCompositeProductItemOption> = (daffOption: DaffCompositeProductItemOption, magentoOption: T) => V;
@@ -1,3 +0,0 @@
1
- import { DaffCompositeProductItemOption } from '@daffodil/product-composite';
2
- import { MagentoBundledProductItemOption } from '../models/bundled-product';
3
- export type MagentoBundleProductOptionTransform<T extends MagentoBundledProductItemOption = MagentoBundledProductItemOption, V extends DaffCompositeProductItemOption = DaffCompositeProductItemOption> = (magentoOption: T) => V;
@@ -1,4 +0,0 @@
1
- export * from './item-extra-transform.type';
2
- export * from './item-transform.type';
3
- export * from './option-extra-transform.type';
4
- export * from './option-transform.type';
@@ -1,39 +0,0 @@
1
- import { MagentoProduct, MagentoProductStockStatusEnum } from '@daffodil/product/driver/magento';
2
- export declare enum MagentoPriceTypeEnum {
3
- fixed = "FIXED",
4
- percent = "PERCENT",
5
- dynamic = "DYNAMIC"
6
- }
7
- export interface MagentoBundledProduct extends MagentoProduct {
8
- items: MagentoBundledProductItem[];
9
- }
10
- export interface MagentoBundledProductItem {
11
- required: boolean;
12
- title: string;
13
- type: string;
14
- options: MagentoBundledProductItemOption[];
15
- option_id?: number;
16
- }
17
- export interface MagentoBundledProductItemOption {
18
- uid: string;
19
- label: string;
20
- quantity: number;
21
- is_default: boolean;
22
- position: number;
23
- product: MagentoBundledProductItemOptionProduct;
24
- }
25
- export interface MagentoBundledProductItemOptionProduct {
26
- stock_status?: MagentoProductStockStatusEnum;
27
- price_range: {
28
- maximum_price: {
29
- regular_price: {
30
- value: number;
31
- currency: any;
32
- };
33
- discount: {
34
- amount_off: number;
35
- percent_off: number;
36
- };
37
- };
38
- };
39
- }
@@ -1 +0,0 @@
1
- export * from './bundled-product';
@@ -1,6 +0,0 @@
1
- export { magentoBundledProductFragment } from './fragments/bundled-product';
2
- export { DaffCompositeProductMagentoDriverModule } from './composite-product-driver.module';
3
- export * from './transforms/public_api';
4
- export * from './models/public_api';
5
- export * from './injection-tokens/public_api';
6
- export * from './interfaces/public_api';
@@ -1,24 +0,0 @@
1
- import { DaffModelFactory } from '@daffodil/core/testing';
2
- import { MagentoSimpleProduct } from '@daffodil/product/driver/magento';
3
- import { MagentoSimpleProductFactory } from '@daffodil/product/driver/magento/testing';
4
- import { MagentoBundledProductItemOption } from '@daffodil/product-composite/driver/magento';
5
- import * as i0 from "@angular/core";
6
- export declare class MockMagentoBundledProductItemOption implements MagentoBundledProductItemOption {
7
- private simpleFactory;
8
- constructor(simpleFactory: MagentoSimpleProductFactory);
9
- uid: string;
10
- label: string;
11
- quantity: number;
12
- is_default: boolean;
13
- position: number;
14
- product: MagentoSimpleProduct;
15
- protected createProduct(): MagentoSimpleProduct;
16
- }
17
- /**
18
- * A factory for creating stub data for {@link MagentoBundledProduct}s.
19
- */
20
- export declare class MagentoBundledProductItemOptionFactory extends DaffModelFactory<MagentoBundledProductItemOption> {
21
- constructor(simpleFactory: MagentoSimpleProductFactory);
22
- static ɵfac: i0.ɵɵFactoryDeclaration<MagentoBundledProductItemOptionFactory, never>;
23
- static ɵprov: i0.ɵɵInjectableDeclaration<MagentoBundledProductItemOptionFactory>;
24
- }
@@ -1,22 +0,0 @@
1
- import { DaffModelFactory } from '@daffodil/core/testing';
2
- import { MagentoBundledProductItem, MagentoBundledProductItemOption } from '@daffodil/product-composite/driver/magento';
3
- import { MagentoBundledProductItemOptionFactory } from './bundle-item-option.factory';
4
- import * as i0 from "@angular/core";
5
- export declare class MockMagentoBundledProductItem implements MagentoBundledProductItem {
6
- private optionFactory;
7
- constructor(optionFactory: MagentoBundledProductItemOptionFactory);
8
- required: boolean;
9
- title: string;
10
- type: string;
11
- options: MagentoBundledProductItemOption[];
12
- option_id: number;
13
- protected createOptions(): MagentoBundledProductItemOption[];
14
- }
15
- /**
16
- * A factory for creating stub data for {@link MagentoBundledProduct}s.
17
- */
18
- export declare class MagentoBundledProductItemFactory extends DaffModelFactory<MagentoBundledProductItem> {
19
- constructor(optionFactory: MagentoBundledProductItemOptionFactory);
20
- static ɵfac: i0.ɵɵFactoryDeclaration<MagentoBundledProductItemFactory, never>;
21
- static ɵprov: i0.ɵɵInjectableDeclaration<MagentoBundledProductItemFactory>;
22
- }
@@ -1,21 +0,0 @@
1
- import { DaffModelFactory } from '@daffodil/core/testing';
2
- import { MagentoProductTypeEnum } from '@daffodil/product/driver/magento';
3
- import { MockMagentoCoreProduct } from '@daffodil/product/driver/magento/testing';
4
- import { MagentoBundledProduct, MagentoBundledProductItem } from '@daffodil/product-composite/driver/magento';
5
- import { MagentoBundledProductItemFactory } from './bundle-item.factory';
6
- import * as i0 from "@angular/core";
7
- export declare class MockMagentoBundledProduct extends MockMagentoCoreProduct implements MagentoBundledProduct {
8
- private bundleItemFactory;
9
- constructor(bundleItemFactory: MagentoBundledProductItemFactory);
10
- __typename: MagentoProductTypeEnum;
11
- items: MagentoBundledProductItem[];
12
- protected createBundleItems(): MagentoBundledProductItem[];
13
- }
14
- /**
15
- * A factory for creating stub data for {@link MagentoBundledProduct}s.
16
- */
17
- export declare class MagentoBundledProductFactory extends DaffModelFactory<MagentoBundledProduct> {
18
- constructor(bundleItemFactory: MagentoBundledProductItemFactory);
19
- static ɵfac: i0.ɵɵFactoryDeclaration<MagentoBundledProductFactory, never>;
20
- static ɵprov: i0.ɵɵInjectableDeclaration<MagentoBundledProductFactory>;
21
- }
@@ -1,3 +0,0 @@
1
- export { MagentoBundledProductFactory, MockMagentoBundledProduct, } from './bundle/bundle.factory';
2
- export { MagentoBundledProductItemFactory, MockMagentoBundledProductItem, } from './bundle/bundle-item.factory';
3
- export { MagentoBundledProductItemOptionFactory, MockMagentoBundledProductItemOption, } from './bundle/bundle-item-option.factory';
@@ -1 +0,0 @@
1
- export * from './factories/public_api';
@@ -1,11 +0,0 @@
1
- import { DaffCompositeProductItem } from '@daffodil/product-composite';
2
- import { MagentoBundleProductOptionTransform } from '../interfaces/public_api';
3
- import { MagentoBundledProductItem } from '../models/bundled-product';
4
- import * as i0 from "@angular/core";
5
- export declare class MagentoBundledProductItemTransformer {
6
- private optionTransform;
7
- constructor(optionTransform: MagentoBundleProductOptionTransform);
8
- transform(item: MagentoBundledProductItem): DaffCompositeProductItem;
9
- static ɵfac: i0.ɵɵFactoryDeclaration<MagentoBundledProductItemTransformer, never>;
10
- static ɵprov: i0.ɵɵInjectableDeclaration<MagentoBundledProductItemTransformer>;
11
- }
@@ -1,3 +0,0 @@
1
- import { DaffCompositeProductItemOption } from '@daffodil/product-composite';
2
- import { MagentoBundledProductItemOption } from '../models/bundled-product';
3
- export declare function transformMagentoBundledProductItemOption(option: MagentoBundledProductItemOption): DaffCompositeProductItemOption;
@@ -1,17 +0,0 @@
1
- import { DaffProduct } from '@daffodil/product';
2
- import { DaffCompositeProduct } from '@daffodil/product-composite';
3
- import { MagentoBundleProductItemTransform } from '../interfaces/public_api';
4
- import { MagentoBundledProduct } from '../models/bundled-product';
5
- import * as i0 from "@angular/core";
6
- export declare class MagentoBundledProductTransformer {
7
- private itemTransform;
8
- constructor(itemTransform: MagentoBundleProductItemTransform);
9
- /**
10
- * Transforms the magento MagentoProduct from the magento product query into a DaffProduct.
11
- *
12
- * @param response the response from a magento product query.
13
- */
14
- transform(daffProduct: DaffProduct, { items }: MagentoBundledProduct): DaffCompositeProduct;
15
- static ɵfac: i0.ɵɵFactoryDeclaration<MagentoBundledProductTransformer, never>;
16
- static ɵprov: i0.ɵɵInjectableDeclaration<MagentoBundledProductTransformer>;
17
- }
@@ -1,3 +0,0 @@
1
- export * from './product-transformer.service';
2
- export * from './item-transformer.service';
3
- export * from './option';
@@ -1 +0,0 @@
1
- export { DaffCompositeProductTestingDriverModule } from './testing.module';
@@ -1,12 +0,0 @@
1
- import { ModuleWithProviders } from '@angular/core';
2
- import * as i0 from "@angular/core";
3
- import * as i1 from "@angular/common";
4
- /**
5
- * Module for providing the composite product factory to the product kind factory.
6
- */
7
- export declare class DaffCompositeProductTestingDriverModule {
8
- static forRoot(): ModuleWithProviders<DaffCompositeProductTestingDriverModule>;
9
- static ɵfac: i0.ɵɵFactoryDeclaration<DaffCompositeProductTestingDriverModule, never>;
10
- static ɵmod: i0.ɵɵNgModuleDeclaration<DaffCompositeProductTestingDriverModule, never, [typeof i1.CommonModule], never>;
11
- static ɵinj: i0.ɵɵInjectorDeclaration<DaffCompositeProductTestingDriverModule>;
12
- }
@@ -1,2 +0,0 @@
1
- import { DaffCompositeProductItem, DaffCompositeProductItemOption, DaffProductCompositeSelectionPayload } from '../models/public_api';
2
- export declare function daffProductCompositeBuildSelectionPayload(appliedOptions: Record<DaffCompositeProductItem['id'], DaffCompositeProductItemOption>): DaffProductCompositeSelectionPayload;
@@ -1 +0,0 @@
1
- export { daffProductCompositeBuildSelectionPayload } from './build-selection-payload';
@@ -1,14 +0,0 @@
1
- import { ID } from '@daffodil/core';
2
- /**
3
- * An object to denote the configuration chosen for a particular {@link DaffCompositeProductItem}.
4
- */
5
- export interface DaffCompositeConfigurationItem {
6
- /**
7
- * The quantity chosen for the configuration of the {@link DaffCompositeProductItem}.
8
- */
9
- qty?: number;
10
- /**
11
- * The value of the {@link DaffCompositeProductItemOption} chosen for the configuration of the {@link DaffCompositeProductItem}.
12
- */
13
- value?: ID;
14
- }
@@ -1,48 +0,0 @@
1
- import { DaffIdentifiable } from '@daffodil/core';
2
- import { DaffProduct } from '@daffodil/product';
3
- /**
4
- * An enum for whether a composite product item should be displayed as a radio or select input.
5
- */
6
- export declare enum DaffCompositeProductItemInputEnum {
7
- select = "select",
8
- radio = "radio"
9
- }
10
- /**
11
- * The composite product item describes one set of product options that the user can add to the composite product.
12
- * A composite product item can be required or optional. If it is required, an option _must_ be chosen in order to add the product to the cart.
13
- * If the item is optional, the product can be added to the cart without an option having been chosen.
14
- * For example, if a composite product is a toolbox bundle, a composite product item might be a screw driver, and the options contained in that
15
- * item might be a phillips head and a flathead. The customer could choose to add either a phillips head or a flathead to the
16
- * composite product, or neither if the item is optional.
17
- */
18
- export interface DaffCompositeProductItem extends DaffIdentifiable {
19
- /**
20
- * Whether the item is required or optional.
21
- */
22
- required: boolean;
23
- /**
24
- * The title label for the item.
25
- */
26
- title: string;
27
- /**
28
- * Describes how the item should be displayed.
29
- */
30
- input_type: DaffCompositeProductItemInputEnum;
31
- /**
32
- * The options that may be chosen for the item.
33
- */
34
- options: DaffCompositeProductItemOption[];
35
- }
36
- /**
37
- * The composite product item option is a DaffProduct that can be added to a composite product.
38
- */
39
- export interface DaffCompositeProductItemOption extends DaffProduct {
40
- /**
41
- * Whether the option is the default option for its parent {@link DaffCompositeProductItem}.
42
- */
43
- is_default: boolean;
44
- /**
45
- * The quantity chosen for the option.
46
- */
47
- quantity: number;
48
- }
@@ -1,16 +0,0 @@
1
- import { DaffProduct } from '@daffodil/product';
2
- import { DaffCompositeProductItem } from './composite-product-item';
3
- /**
4
- * A composite product is a group of products sold together. It includes one primary product and many accessory "items".
5
- * The composite product items are additional products the customer might want to purchase with the primary product,
6
- * and each item has a number of options from which the user can choose. Composite product items can be optional or required.
7
- * For example, a toolbox bundle might have a primary product of the toolbox. The items could be a hammer and a screw driver,
8
- * and the options for these items could be two different hammers and two different screwdrivers between which the customer could choose.
9
- * All of these items could have different prices/discounts/etc which would cause the composite products to have ranged prices.
10
- */
11
- export interface DaffCompositeProduct extends DaffProduct {
12
- /**
13
- * The available items for the composite product.
14
- */
15
- items: DaffCompositeProductItem[];
16
- }
@@ -1,4 +0,0 @@
1
- export * from './composite-configuration-item';
2
- export * from './composite-product';
3
- export * from './composite-product-item';
4
- export * from './selection-payload.type';
@@ -1,5 +0,0 @@
1
- import { DaffCompositeProductItem, DaffCompositeProductItemOption } from './composite-product-item';
2
- /**
3
- * Denotes a particular configuration for a composite item.
4
- */
5
- export type DaffProductCompositeSelectionPayload = Record<DaffCompositeProductItem['id'], DaffCompositeProductItemOption['id'][]>;
package/public_api.d.ts DELETED
@@ -1,2 +0,0 @@
1
- export * from './helpers/public_api';
2
- export * from './models/public_api';
@@ -1,8 +0,0 @@
1
- import { InjectionToken } from '@angular/core';
2
- import { DaffBase64Service } from '@daffodil/core';
3
- import { DaffProductCompositeRoutingConfig } from './interface';
4
- /**
5
- * The default configuration for the {@link DaffProductCompositeRoutingConfig}.
6
- */
7
- export declare const daffProductCompositeRoutingConfigDefaultFactory: (base64: DaffBase64Service) => DaffProductCompositeRoutingConfig;
8
- export declare const DAFF_PRODUCT_COMPOSITE_ROUTING_CONFIG_DEFAULT: InjectionToken<DaffProductCompositeRoutingConfig>;
@@ -1,20 +0,0 @@
1
- import { DaffCompositeProduct, DaffProductCompositeSelectionPayload } from '@daffodil/product-composite';
2
- /**
3
- * An interface for providing `@daffodil/product-composite/routing` with necessary config values.
4
- */
5
- export interface DaffProductCompositeRoutingConfig {
6
- /**
7
- * The name of the query param for which a composite product page preselection can be defined.
8
- * The value of this query param should be a {@link DaffProductCompositeSelectionPayload} after being base64 decoded and JSON parsed.
9
- *
10
- * Defaults to `composite_selection`.
11
- */
12
- compositeSelectionQueryParam?: string;
13
- /**
14
- * The function used to decode the value of the {@link DaffProductCompositeStateConfig#compositeSelectionQueryParam}
15
- * into a {@link DaffProductCompositeSelectionPayload}.
16
- *
17
- * Defaults to `(queryParam: string) => JSON.parse(atob(queryParam))`.
18
- */
19
- compositeSelectionQueryParamDecode?: (queryParam: string, product: DaffCompositeProduct) => DaffProductCompositeSelectionPayload;
20
- }
@@ -1,3 +0,0 @@
1
- export * from './default';
2
- export { DaffProductCompositeRoutingConfig } from './interface';
3
- export * from './token';
@@ -1,2 +0,0 @@
1
- import { DaffProductCompositeRoutingConfig } from './interface';
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 +0,0 @@
1
- import { Actions } from '@ngrx/effects';
2
- import { EMPTY, Observable } from 'rxjs';
3
- import { DaffCompositeProduct } from '@daffodil/product-composite';
4
- import { DaffCompositeProductApplyOption } from '@daffodil/product-composite/state';
5
- import { DaffProductCompositeRoutingConfig } from '../config/public_api';
6
- import { DaffProductCompositeQueryParamService } from '../services/query-param.service';
7
- import * as i0 from "@angular/core";
8
- /**
9
- * Handles composite product specific actions for the product page.
10
- */
11
- export declare class DaffProductCompositePageEffects<T extends DaffCompositeProduct = DaffCompositeProduct> {
12
- private actions$;
13
- private paramGetter;
14
- private config;
15
- constructor(actions$: Actions, paramGetter: DaffProductCompositeQueryParamService, config: DaffProductCompositeRoutingConfig);
16
- /**
17
- * Applies composite item options based on the value of the configured query param.
18
- */
19
- preselectCompositeOptions$: Observable<typeof EMPTY | DaffCompositeProductApplyOption<T>>;
20
- static ɵfac: i0.ɵɵFactoryDeclaration<DaffProductCompositePageEffects<any>, never>;
21
- static ɵprov: i0.ɵɵInjectableDeclaration<DaffProductCompositePageEffects<any>>;
22
- }
@@ -1 +0,0 @@
1
- export { DaffProductCompositePageEffects } from './product-page.effects';
@@ -1,10 +0,0 @@
1
- import { ModuleWithProviders } from '@angular/core';
2
- import { DaffProductCompositeRoutingConfig } from './config/public_api';
3
- import * as i0 from "@angular/core";
4
- import * as i1 from "@ngrx/effects";
5
- export declare class DaffProductCompositeRoutingModule {
6
- static withConfig(config?: DaffProductCompositeRoutingConfig): ModuleWithProviders<DaffProductCompositeRoutingModule>;
7
- static ɵfac: i0.ɵɵFactoryDeclaration<DaffProductCompositeRoutingModule, never>;
8
- static ɵmod: i0.ɵɵNgModuleDeclaration<DaffProductCompositeRoutingModule, never, [typeof i1.EffectsFeatureModule], never>;
9
- static ɵinj: i0.ɵɵInjectorDeclaration<DaffProductCompositeRoutingModule>;
10
- }
@@ -1,3 +0,0 @@
1
- export * from './config/public_api';
2
- export * from './effects/public_api';
3
- export * from './module';
@@ -1,13 +0,0 @@
1
- import { DaffProductCompositeRoutingConfig } from '../config/public_api';
2
- import * as i0 from "@angular/core";
3
- export declare class DaffProductCompositeQueryParamService {
4
- private document;
5
- private config;
6
- constructor(document: any, config: DaffProductCompositeRoutingConfig);
7
- /**
8
- * Get the value of the configured composite selection query param.
9
- */
10
- get(): string;
11
- static ɵfac: i0.ɵɵFactoryDeclaration<DaffProductCompositeQueryParamService, never>;
12
- static ɵprov: i0.ɵɵInjectableDeclaration<DaffProductCompositeQueryParamService>;
13
- }
@@ -1,24 +0,0 @@
1
- import { Action } from '@ngrx/store';
2
- import { DaffCompositeProduct, DaffCompositeProductItem, DaffCompositeProductItemOption } from '@daffodil/product-composite';
3
- /**
4
- * Action types for Composite Product Actions.
5
- */
6
- export declare enum DaffCompositeProductActionTypes {
7
- CompositeProductApplyOptionAction = "[@daffodil/product-composite] Composite Product Apply Option Action"
8
- }
9
- /**
10
- * Applies a product option to a particular composite product.
11
- *
12
- * @param id - Id of the Composite Product
13
- * @param itemId - Id of the product item.
14
- * @param optionId - Id of the option of the product item that is chosen.
15
- */
16
- export declare class DaffCompositeProductApplyOption<T extends DaffCompositeProduct = DaffCompositeProduct> implements Action {
17
- id: T['id'];
18
- itemId: DaffCompositeProductItem['id'];
19
- optionId: DaffCompositeProductItemOption['id'];
20
- qty?: number;
21
- readonly type = DaffCompositeProductActionTypes.CompositeProductApplyOptionAction;
22
- constructor(id: T['id'], itemId: DaffCompositeProductItem['id'], optionId: DaffCompositeProductItemOption['id'], qty?: number);
23
- }
24
- export type DaffCompositeProductActions<T extends DaffCompositeProduct = DaffCompositeProduct> = DaffCompositeProductApplyOption<T>;
@@ -1 +0,0 @@
1
- export * from './composite-product.actions';
@@ -1,10 +0,0 @@
1
- import * as i0 from "@angular/core";
2
- import * as i1 from "@ngrx/store";
3
- /**
4
- * A module that provides the default reducers and effects for composite product redux state.
5
- */
6
- export declare class DaffCompositeProductStateModule {
7
- static ɵfac: i0.ɵɵFactoryDeclaration<DaffCompositeProductStateModule, never>;
8
- static ɵmod: i0.ɵɵNgModuleDeclaration<DaffCompositeProductStateModule, never, [typeof i1.StoreFeatureModule], never>;
9
- static ɵinj: i0.ɵɵInjectorDeclaration<DaffCompositeProductStateModule>;
10
- }