@daffodil/product 0.38.9 → 0.39.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/bundles/daffodil-product-driver-in-memory.umd.js +77 -160
- package/bundles/daffodil-product-driver-in-memory.umd.js.map +1 -1
- package/bundles/daffodil-product-driver-in-memory.umd.min.js +1 -1
- package/bundles/daffodil-product-driver-in-memory.umd.min.js.map +1 -1
- package/bundles/daffodil-product-driver-magento-testing.umd.js +12 -140
- package/bundles/daffodil-product-driver-magento-testing.umd.js.map +1 -1
- package/bundles/daffodil-product-driver-magento-testing.umd.min.js +1 -1
- package/bundles/daffodil-product-driver-magento-testing.umd.min.js.map +1 -1
- package/bundles/daffodil-product-driver-magento.umd.js +87 -676
- package/bundles/daffodil-product-driver-magento.umd.js.map +1 -1
- package/bundles/daffodil-product-driver-magento.umd.min.js +2 -2
- package/bundles/daffodil-product-driver-magento.umd.min.js.map +1 -1
- package/bundles/daffodil-product-driver-shopify.umd.js +14 -160
- package/bundles/daffodil-product-driver-shopify.umd.js.map +1 -1
- package/bundles/daffodil-product-driver-shopify.umd.min.js +1 -1
- package/bundles/daffodil-product-driver-shopify.umd.min.js.map +1 -1
- package/bundles/daffodil-product-driver-testing.umd.js +4 -62
- package/bundles/daffodil-product-driver-testing.umd.js.map +1 -1
- package/bundles/daffodil-product-driver-testing.umd.min.js +1 -1
- package/bundles/daffodil-product-driver-testing.umd.min.js.map +1 -1
- package/bundles/daffodil-product-driver.umd.js +12 -64
- package/bundles/daffodil-product-driver.umd.js.map +1 -1
- package/bundles/daffodil-product-routing.umd.js +4 -112
- package/bundles/daffodil-product-routing.umd.js.map +1 -1
- package/bundles/daffodil-product-routing.umd.min.js +1 -1
- package/bundles/daffodil-product-routing.umd.min.js.map +1 -1
- package/bundles/daffodil-product-state-testing.umd.js +15 -240
- package/bundles/daffodil-product-state-testing.umd.js.map +1 -1
- package/bundles/daffodil-product-state-testing.umd.min.js +1 -1
- package/bundles/daffodil-product-state-testing.umd.min.js.map +1 -1
- package/bundles/daffodil-product-state.umd.js +347 -2359
- package/bundles/daffodil-product-state.umd.js.map +1 -1
- package/bundles/daffodil-product-state.umd.min.js +1 -1
- package/bundles/daffodil-product-state.umd.min.js.map +1 -1
- package/bundles/daffodil-product-testing.umd.js +20 -230
- package/bundles/daffodil-product-testing.umd.js.map +1 -1
- package/bundles/daffodil-product-testing.umd.min.js +1 -1
- package/bundles/daffodil-product-testing.umd.min.js.map +1 -1
- package/bundles/daffodil-product.umd.js +21 -209
- package/bundles/daffodil-product.umd.js.map +1 -1
- package/bundles/daffodil-product.umd.min.js +1 -1
- package/bundles/daffodil-product.umd.min.js.map +1 -1
- package/driver/in-memory/backend/product.service.d.ts +3 -2
- package/driver/in-memory/daffodil-product-driver-in-memory.metadata.json +1 -1
- package/driver/in-memory/package.json +1 -1
- package/driver/magento/package.json +1 -1
- package/driver/magento/testing/package.json +1 -1
- package/driver/package.json +1 -1
- package/driver/shopify/package.json +1 -1
- package/driver/testing/package.json +1 -1
- package/esm2015/daffodil-product.js +2 -7
- package/esm2015/driver/daffodil-product-driver.js +2 -7
- package/esm2015/driver/in-memory/backend/product.service.js +62 -83
- package/esm2015/driver/in-memory/daffodil-product-driver-in-memory.js +2 -7
- package/esm2015/driver/in-memory/driver/product-driver.module.js +1 -9
- package/esm2015/driver/in-memory/driver/product.service.js +11 -53
- package/esm2015/driver/in-memory/index.js +2 -7
- package/esm2015/driver/in-memory/public_api.js +1 -6
- package/esm2015/driver/index.js +2 -7
- package/esm2015/driver/interfaces/product-service.interface.js +1 -39
- package/esm2015/driver/magento/config/default.js +2 -8
- package/esm2015/driver/magento/config/public_api.js +1 -6
- package/esm2015/driver/magento/daffodil-product-driver-magento.js +2 -7
- package/esm2015/driver/magento/index.js +2 -7
- package/esm2015/driver/magento/injection-tokens/fragments/product-preview.token.js +7 -22
- package/esm2015/driver/magento/injection-tokens/fragments/product.token.js +5 -20
- package/esm2015/driver/magento/injection-tokens/public_api.js +1 -6
- package/esm2015/driver/magento/injection-tokens/transforms/product-preview/preview-extra.token.js +6 -21
- package/esm2015/driver/magento/injection-tokens/transforms/product-preview/preview.token.js +4 -24
- package/esm2015/driver/magento/injection-tokens/transforms/product-response/response-extra.token.js +5 -20
- package/esm2015/driver/magento/injection-tokens/transforms/product-response/response.token.js +4 -25
- package/esm2015/driver/magento/interfaces/config.interface.js +3 -38
- package/esm2015/driver/magento/interfaces/product-preview-extra-transform.type.js +2 -6
- package/esm2015/driver/magento/interfaces/product-preview-transform.type.js +2 -6
- package/esm2015/driver/magento/interfaces/product-response-extra-transform.type.js +2 -6
- package/esm2015/driver/magento/interfaces/product-response-transform.type.js +2 -6
- package/esm2015/driver/magento/interfaces/public_api.js +6 -11
- package/esm2015/driver/magento/models/bundled-product.js +9 -65
- package/esm2015/driver/magento/models/configurable-product.js +2 -72
- package/esm2015/driver/magento/models/get-product-response.interface.js +2 -16
- package/esm2015/driver/magento/models/magento-product.js +7 -38
- package/esm2015/driver/magento/models/product-preview.interface.js +6 -40
- package/esm2015/driver/magento/models/public_api.js +4 -9
- package/esm2015/driver/magento/models/simple-product.js +2 -18
- package/esm2015/driver/magento/product-driver.module.js +3 -12
- package/esm2015/driver/magento/product.service.js +7 -78
- package/esm2015/driver/magento/public_api.js +7 -12
- package/esm2015/driver/magento/queries/fragments/bundled-product.js +2 -8
- package/esm2015/driver/magento/queries/fragments/configurable-product.js +1 -7
- package/esm2015/driver/magento/queries/fragments/product-preview.js +1 -7
- package/esm2015/driver/magento/queries/fragments/product.js +1 -7
- package/esm2015/driver/magento/queries/fragments/simple-product.js +1 -7
- package/esm2015/driver/magento/queries/get-all-products.js +3 -14
- package/esm2015/driver/magento/queries/get-product-by-url.js +3 -14
- package/esm2015/driver/magento/queries/get-product.js +3 -14
- package/esm2015/driver/magento/queries/public_api.js +4 -9
- package/esm2015/driver/magento/testing/daffodil-product-driver-magento-testing.js +2 -7
- package/esm2015/driver/magento/testing/factories/bundle/bundle.factory.js +4 -15
- package/esm2015/driver/magento/testing/factories/configurable/configurable.factory.js +3 -46
- package/esm2015/driver/magento/testing/factories/core/product-preview.factory.js +2 -29
- package/esm2015/driver/magento/testing/factories/core/product.factory.js +3 -46
- package/esm2015/driver/magento/testing/factories/public_api.js +6 -11
- package/esm2015/driver/magento/testing/factories/simple/simple.factory.js +3 -12
- package/esm2015/driver/magento/testing/index.js +2 -7
- package/esm2015/driver/magento/testing/public_api.js +2 -7
- package/esm2015/driver/magento/transforms/bundled-product-transformers.js +4 -25
- package/esm2015/driver/magento/transforms/configurable-product-transformers.js +4 -38
- package/esm2015/driver/magento/transforms/product-preview.js +5 -35
- package/esm2015/driver/magento/transforms/product-response.js +2 -23
- package/esm2015/driver/magento/transforms/product-transformers.js +5 -32
- package/esm2015/driver/magento/transforms/public_api.js +7 -12
- package/esm2015/driver/magento/transforms/simple-product-transformers.js +3 -31
- package/esm2015/driver/magento/transforms/truncate-url.js +2 -12
- package/esm2015/driver/models/public_api.js +2 -6
- package/esm2015/driver/models/response.interface.js +2 -28
- package/esm2015/driver/public_api.js +2 -7
- package/esm2015/driver/shopify/daffodil-product-driver-shopify.js +2 -7
- package/esm2015/driver/shopify/index.js +2 -7
- package/esm2015/driver/shopify/product-driver.module.js +2 -10
- package/esm2015/driver/shopify/product.service.js +12 -132
- package/esm2015/driver/shopify/public_api.js +1 -6
- package/esm2015/driver/testing/daffodil-product-driver-testing.js +2 -7
- package/esm2015/driver/testing/drivers/product-driver.module.js +2 -10
- package/esm2015/driver/testing/drivers/product.service.js +3 -39
- package/esm2015/driver/testing/index.js +2 -7
- package/esm2015/driver/testing/public_api.js +1 -6
- package/esm2015/helpers.js +7 -22
- package/esm2015/index.js +2 -7
- package/esm2015/injection-tokens/error-matcher.token.js +3 -12
- package/esm2015/injection-tokens/public_api.js +1 -6
- package/esm2015/models/composite-configuration-item.js +2 -25
- package/esm2015/models/composite-product-item.js +8 -62
- package/esm2015/models/composite-product.js +2 -25
- package/esm2015/models/configurable-product.js +2 -125
- package/esm2015/models/prices.js +2 -45
- package/esm2015/models/product-image.js +2 -18
- package/esm2015/models/product.js +8 -105
- package/esm2015/public_api.js +10 -15
- package/esm2015/routing/daffodil-product-routing.js +2 -7
- package/esm2015/routing/index.js +2 -7
- package/esm2015/routing/public_api.js +2 -7
- package/esm2015/routing/resolvers/product-page/product-page.resolver.js +2 -21
- package/esm2015/routing/resolvers/product-page-id/product-page-id.resolver.js +2 -33
- package/esm2015/routing/resolvers/product-page-url/product-page-url.resolver.js +2 -40
- package/esm2015/routing/resolvers/public_api.js +1 -6
- package/esm2015/state/actions/best-sellers.actions.js +9 -39
- package/esm2015/state/actions/composite-product.actions.js +9 -29
- package/esm2015/state/actions/configurable-product.actions.js +8 -56
- package/esm2015/state/actions/product-grid.actions.js +9 -39
- package/esm2015/state/actions/product-page.actions.js +10 -60
- package/esm2015/state/actions/product.actions.js +8 -39
- package/esm2015/state/actions/public_api.js +7 -12
- package/esm2015/state/daffodil-product-state.js +2 -7
- package/esm2015/state/effects/best-seller.effects.js +4 -52
- package/esm2015/state/effects/product-grid.effects.js +4 -52
- package/esm2015/state/effects/product-page.effects.js +6 -68
- package/esm2015/state/effects/product.effects.js +4 -52
- package/esm2015/state/effects/public_api.js +1 -6
- package/esm2015/state/facades/best-sellers/best-sellers.facade.js +4 -31
- package/esm2015/state/facades/composite-product/composite-product-facade.interface.js +2 -86
- package/esm2015/state/facades/composite-product/composite-product.facade.js +4 -61
- package/esm2015/state/facades/configurable-product/configurable-product-facade.interface.js +2 -108
- package/esm2015/state/facades/configurable-product/configurable-product.facade.js +4 -78
- package/esm2015/state/facades/product/product-facade.interface.js +2 -70
- package/esm2015/state/facades/product/product.facade.js +3 -58
- package/esm2015/state/facades/product-grid/product-grid-facade.interface.js +2 -23
- package/esm2015/state/facades/product-grid/product-grid.facade.js +3 -27
- package/esm2015/state/facades/product-page/facade.interface.js +2 -24
- package/esm2015/state/facades/product-page/facade.js +3 -32
- package/esm2015/state/facades/public_api.js +1 -6
- package/esm2015/state/index.js +2 -7
- package/esm2015/state/product-state.module.js +1 -6
- package/esm2015/state/public_api.js +6 -11
- package/esm2015/state/reducers/best-sellers/best-sellers-reducer-state.interface.js +2 -28
- package/esm2015/state/reducers/best-sellers/best-sellers.reducer.js +3 -24
- package/esm2015/state/reducers/composite-product-entities/composite-product-entities-reducer-adapter.js +5 -18
- package/esm2015/state/reducers/composite-product-entities/composite-product-entities.reducer.js +12 -46
- package/esm2015/state/reducers/composite-product-entities/composite-product-entity.js +2 -25
- package/esm2015/state/reducers/configurable-product-entities/configurable-product-entities-reducer-adapter.js +4 -17
- package/esm2015/state/reducers/configurable-product-entities/configurable-product-entities.reducer.js +11 -67
- package/esm2015/state/reducers/configurable-product-entities/configurable-product-entity.js +2 -40
- package/esm2015/state/reducers/injection-tokens/config.token.js +4 -13
- package/esm2015/state/reducers/injection-tokens/meta.token.js +5 -21
- package/esm2015/state/reducers/injection-tokens/public_api.js +1 -6
- package/esm2015/state/reducers/product/product-reducer-state.interface.js +2 -33
- package/esm2015/state/reducers/product/product.reducer.js +4 -11
- package/esm2015/state/reducers/product-entities/product-entities-reducer-adapter.js +4 -18
- package/esm2015/state/reducers/product-entities/product-entities.reducer.js +4 -11
- package/esm2015/state/reducers/product-grid/product-grid-reducer-state.interface.js +2 -29
- package/esm2015/state/reducers/product-grid/product-grid.reducer.js +4 -11
- package/esm2015/state/reducers/product-reducers-state.interface.js +1 -35
- package/esm2015/state/reducers/product-reducers.js +1 -7
- package/esm2015/state/reducers/product-store-feature-key.js +1 -7
- package/esm2015/state/reducers/public_api.js +3 -8
- package/esm2015/state/selectors/all-selectors.selectors.js +3 -19
- package/esm2015/state/selectors/best-sellers/best-sellers.selectors.js +12 -84
- package/esm2015/state/selectors/composite-product/composite-product.selectors.js +48 -254
- package/esm2015/state/selectors/composite-product-entities/composite-product-entities.selectors.js +16 -122
- package/esm2015/state/selectors/configurable-product/configurable-product.selectors.js +41 -387
- package/esm2015/state/selectors/configurable-product-entities/configurable-product-entities.selectors.js +12 -106
- package/esm2015/state/selectors/product/product.selectors.js +12 -80
- package/esm2015/state/selectors/product-entities/product-entities.selectors.js +16 -191
- package/esm2015/state/selectors/product-feature.selector.js +5 -29
- package/esm2015/state/selectors/product-grid/product-grid.selectors.js +10 -57
- package/esm2015/state/selectors/public_api.js +11 -16
- package/esm2015/state/testing/daffodil-product-state-testing.js +2 -7
- package/esm2015/state/testing/index.js +2 -7
- package/esm2015/state/testing/mock-best-sellers.facade.js +3 -18
- package/esm2015/state/testing/mock-composite-product-facade.js +4 -52
- package/esm2015/state/testing/mock-configurable-product-facade.js +4 -65
- package/esm2015/state/testing/mock-product-facade.js +3 -53
- package/esm2015/state/testing/mock-product-grid-facade.js +3 -19
- package/esm2015/state/testing/mock-product-page-facade.js +3 -19
- package/esm2015/state/testing/product-testing.module.js +1 -6
- package/esm2015/state/testing/public_api.js +1 -6
- package/esm2015/testing/daffodil-product-testing.js +2 -7
- package/esm2015/testing/factories/composite-product.factory.js +3 -14
- package/esm2015/testing/factories/configurable-product.factory.js +2 -45
- package/esm2015/testing/factories/default-product.factory.js +2 -53
- package/esm2015/testing/factories/extension.factory.js +3 -30
- package/esm2015/testing/factories/kind.factory.js +2 -23
- package/esm2015/testing/factories/product-image.factory.js +2 -16
- package/esm2015/testing/factories/public_api.js +7 -12
- package/esm2015/testing/helpers.js +2 -8
- package/esm2015/testing/index.js +2 -7
- package/esm2015/testing/injection-tokens/factories/extra.token.js +6 -22
- package/esm2015/testing/injection-tokens/factories/type.token.js +5 -21
- package/esm2015/testing/injection-tokens/public_api.js +1 -6
- package/esm2015/testing/public_api.js +4 -9
- package/esm2015/testing/testing.module.js +1 -6
- package/fesm2015/daffodil-product-driver-in-memory.js +73 -158
- package/fesm2015/daffodil-product-driver-in-memory.js.map +1 -1
- package/fesm2015/daffodil-product-driver-magento-testing.js +12 -165
- package/fesm2015/daffodil-product-driver-magento-testing.js.map +1 -1
- package/fesm2015/daffodil-product-driver-magento.js +81 -801
- package/fesm2015/daffodil-product-driver-magento.js.map +1 -1
- package/fesm2015/daffodil-product-driver-shopify.js +14 -156
- package/fesm2015/daffodil-product-driver-shopify.js.map +1 -1
- package/fesm2015/daffodil-product-driver-testing.js +5 -63
- package/fesm2015/daffodil-product-driver-testing.js.map +1 -1
- package/fesm2015/daffodil-product-driver.js +1 -59
- package/fesm2015/daffodil-product-driver.js.map +1 -1
- package/fesm2015/daffodil-product-routing.js +5 -113
- package/fesm2015/daffodil-product-routing.js.map +1 -1
- package/fesm2015/daffodil-product-state-testing.js +16 -241
- package/fesm2015/daffodil-product-state-testing.js.map +1 -1
- package/fesm2015/daffodil-product-state.js +294 -2412
- package/fesm2015/daffodil-product-state.js.map +1 -1
- package/fesm2015/daffodil-product-testing.js +20 -256
- package/fesm2015/daffodil-product-testing.js.map +1 -1
- package/fesm2015/daffodil-product.js +23 -454
- package/fesm2015/daffodil-product.js.map +1 -1
- package/package.json +3 -3
- package/routing/package.json +1 -1
- package/state/package.json +1 -1
- package/state/testing/package.json +1 -1
- package/testing/package.json +1 -1
|
@@ -2,480 +2,49 @@ import { InjectionToken } from '@angular/core';
|
|
|
2
2
|
import { daffTransformErrorToStateError } from '@daffodil/core/state';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
|
-
*
|
|
6
|
-
* Generated from: models/composite-configuration-item.ts
|
|
7
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
8
|
-
*/
|
|
9
|
-
/**
|
|
10
|
-
* An object to denote the configuration chosen for a particular {\@link DaffCompositeProductItem}.
|
|
11
|
-
*
|
|
12
|
-
* @deprecated import from \@daffodil/composite-product instead.
|
|
13
|
-
* @record
|
|
14
|
-
*/
|
|
15
|
-
function DaffCompositeConfigurationItem() { }
|
|
16
|
-
if (false) {
|
|
17
|
-
/**
|
|
18
|
-
* The quantity chosen for the configuration of the {\@link DaffCompositeProductItem}.
|
|
19
|
-
* @type {?|undefined}
|
|
20
|
-
*/
|
|
21
|
-
DaffCompositeConfigurationItem.prototype.qty;
|
|
22
|
-
/**
|
|
23
|
-
* The value of the {\@link DaffCompositeProductItemOption} chosen for the configuration of the {\@link DaffCompositeProductItem}.
|
|
24
|
-
* @type {?|undefined}
|
|
25
|
-
*/
|
|
26
|
-
DaffCompositeConfigurationItem.prototype.value;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
/**
|
|
30
|
-
* @fileoverview added by tsickle
|
|
31
|
-
* Generated from: models/composite-product.ts
|
|
32
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
33
|
-
*/
|
|
34
|
-
/**
|
|
35
|
-
* A composite product is a group of products sold together. It includes one primary product and many accessory "items".
|
|
36
|
-
* The composite product items are additional products the customer might want to purchase with the primary product,
|
|
37
|
-
* and each item has a number of options from which the user can choose. Composite product items can be optional or required.
|
|
38
|
-
* For example, a toolbox bundle might have a primary product of the toolbox. The items could be a hammer and a screw driver,
|
|
39
|
-
* and the options for these items could be two different hammers and two different screwdrivers between which the customer could choose.
|
|
40
|
-
* All of these items could have different prices/discounts/etc which would cause the composite products to have ranged prices.
|
|
41
|
-
*
|
|
42
|
-
* @deprecated import from \@daffodil/composite-product instead.
|
|
43
|
-
* @record
|
|
44
|
-
*/
|
|
45
|
-
function DaffCompositeProduct() { }
|
|
46
|
-
if (false) {
|
|
47
|
-
/**
|
|
48
|
-
* The available items for the composite product.
|
|
49
|
-
* @type {?}
|
|
50
|
-
*/
|
|
51
|
-
DaffCompositeProduct.prototype.items;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
/**
|
|
55
|
-
* @fileoverview added by tsickle
|
|
56
|
-
* Generated from: models/composite-product-item.ts
|
|
57
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
58
|
-
*/
|
|
59
|
-
/** @enum {string} */
|
|
60
|
-
const DaffCompositeProductItemInputEnum = {
|
|
61
|
-
select: "select",
|
|
62
|
-
radio: "radio",
|
|
63
|
-
};
|
|
64
|
-
/**
|
|
65
|
-
* The composite product item describes one set of product options that the user can add to the composite product.
|
|
66
|
-
* 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.
|
|
67
|
-
* If the item is optional, the product can be added to the cart without an option having been chosen.
|
|
68
|
-
* 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
|
|
69
|
-
* item might be a phillips head and a flathead. The customer could choose to add either a phillips head or a flathead to the
|
|
70
|
-
* composite product, or neither if the item is optional.
|
|
71
|
-
*
|
|
72
|
-
* @deprecated import from \@daffodil/composite-product instead.
|
|
73
|
-
* @record
|
|
74
|
-
*/
|
|
75
|
-
function DaffCompositeProductItem() { }
|
|
76
|
-
if (false) {
|
|
77
|
-
/**
|
|
78
|
-
* Whether the item is required or optional.
|
|
79
|
-
* @type {?}
|
|
80
|
-
*/
|
|
81
|
-
DaffCompositeProductItem.prototype.required;
|
|
82
|
-
/**
|
|
83
|
-
* The title label for the item.
|
|
84
|
-
* @type {?}
|
|
85
|
-
*/
|
|
86
|
-
DaffCompositeProductItem.prototype.title;
|
|
87
|
-
/**
|
|
88
|
-
* Describes how the item should be displayed.
|
|
89
|
-
* @type {?}
|
|
90
|
-
*/
|
|
91
|
-
DaffCompositeProductItem.prototype.input_type;
|
|
92
|
-
/**
|
|
93
|
-
* The options that may be chosen for the item.
|
|
94
|
-
* @type {?}
|
|
95
|
-
*/
|
|
96
|
-
DaffCompositeProductItem.prototype.options;
|
|
97
|
-
}
|
|
98
|
-
/**
|
|
99
|
-
* The composite product item option is a DaffProduct that can be added to a composite product.
|
|
5
|
+
* An enum for whether a composite product item should be displayed as a radio or select input.
|
|
100
6
|
*
|
|
101
|
-
* @deprecated import from
|
|
102
|
-
* @record
|
|
7
|
+
* @deprecated import from @daffodil/composite-product instead.
|
|
103
8
|
*/
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
*/
|
|
110
|
-
DaffCompositeProductItemOption.prototype.is_default;
|
|
111
|
-
/**
|
|
112
|
-
* The quantity chosen for the option.
|
|
113
|
-
* @type {?}
|
|
114
|
-
*/
|
|
115
|
-
DaffCompositeProductItemOption.prototype.quantity;
|
|
116
|
-
}
|
|
9
|
+
var DaffCompositeProductItemInputEnum;
|
|
10
|
+
(function (DaffCompositeProductItemInputEnum) {
|
|
11
|
+
DaffCompositeProductItemInputEnum["select"] = "select";
|
|
12
|
+
DaffCompositeProductItemInputEnum["radio"] = "radio";
|
|
13
|
+
})(DaffCompositeProductItemInputEnum || (DaffCompositeProductItemInputEnum = {}));
|
|
117
14
|
|
|
118
15
|
/**
|
|
119
|
-
*
|
|
120
|
-
* Generated from: models/configurable-product.ts
|
|
121
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
122
|
-
*/
|
|
123
|
-
/**
|
|
124
|
-
* A configurable product is a product with configurable attributes. The price of a configurable product may change based on
|
|
125
|
-
* the attributes chosen, so a configurable product can have a price range. An example of a configurable product is a T-shirt.
|
|
126
|
-
* @record
|
|
127
|
-
*/
|
|
128
|
-
function DaffConfigurableProduct() { }
|
|
129
|
-
if (false) {
|
|
130
|
-
/**
|
|
131
|
-
* The configurable attributes available.
|
|
132
|
-
* @type {?}
|
|
133
|
-
*/
|
|
134
|
-
DaffConfigurableProduct.prototype.configurableAttributes;
|
|
135
|
-
/**
|
|
136
|
-
* The possible different variants of the product.
|
|
137
|
-
* @type {?}
|
|
138
|
-
*/
|
|
139
|
-
DaffConfigurableProduct.prototype.variants;
|
|
140
|
-
}
|
|
141
|
-
/**
|
|
142
|
-
* An attribute of the configurable product that the customer must choose to add the configurable product to the cart.
|
|
143
|
-
* An example of an attribute would be size for clothing.
|
|
144
|
-
* @record
|
|
145
|
-
*/
|
|
146
|
-
function DaffConfigurableProductAttribute() { }
|
|
147
|
-
if (false) {
|
|
148
|
-
/**
|
|
149
|
-
* The identifier for the attribute type.
|
|
150
|
-
* @type {?}
|
|
151
|
-
*/
|
|
152
|
-
DaffConfigurableProductAttribute.prototype.code;
|
|
153
|
-
/**
|
|
154
|
-
* A label for the attribute type.
|
|
155
|
-
* @type {?}
|
|
156
|
-
*/
|
|
157
|
-
DaffConfigurableProductAttribute.prototype.label;
|
|
158
|
-
/**
|
|
159
|
-
* The possible attribute options that a customer can choose.
|
|
160
|
-
* @type {?}
|
|
161
|
-
*/
|
|
162
|
-
DaffConfigurableProductAttribute.prototype.values;
|
|
163
|
-
}
|
|
164
|
-
/**
|
|
165
|
-
* A variant is one version of the configurable product with all attributes chosen. Variants exist because not all versions of every configuration of
|
|
166
|
-
* the product might be in stock. For example, a shirt might have a medium, red shirt and a small,
|
|
167
|
-
* green shirt in stock, but no small, red shirts. In this case there would be two variants (mediumRed, smallGreen) rather than the maximum 4 variants
|
|
168
|
-
* (smallRed, mediumRed, smallGreen, mediumGreen). This ensures the customer can't add a configurable product to the cart that is not
|
|
169
|
-
* in stock. However, variants don't usually need to be considered by the frontend dev, because daffodil abstacts away the concept of variants into
|
|
170
|
-
* an "available attributes" selector.
|
|
171
|
-
* @record
|
|
172
|
-
*/
|
|
173
|
-
function DaffConfigurableProductVariant() { }
|
|
174
|
-
if (false) {
|
|
175
|
-
/**
|
|
176
|
-
* The attributes applied to the product to form the product variant.
|
|
177
|
-
* @type {?}
|
|
178
|
-
*/
|
|
179
|
-
DaffConfigurableProductVariant.prototype.appliedAttributes;
|
|
180
|
-
/**
|
|
181
|
-
* The price of the variant.
|
|
182
|
-
* @type {?}
|
|
183
|
-
*/
|
|
184
|
-
DaffConfigurableProductVariant.prototype.price;
|
|
185
|
-
/**
|
|
186
|
-
* The total discount for the variant.
|
|
187
|
-
* @type {?}
|
|
188
|
-
*/
|
|
189
|
-
DaffConfigurableProductVariant.prototype.discount;
|
|
190
|
-
/**
|
|
191
|
-
* An image of the product variant.
|
|
192
|
-
* @type {?|undefined}
|
|
193
|
-
*/
|
|
194
|
-
DaffConfigurableProductVariant.prototype.image;
|
|
195
|
-
/**
|
|
196
|
-
* Whether or not the variant is in stock.
|
|
197
|
-
* @type {?}
|
|
198
|
-
*/
|
|
199
|
-
DaffConfigurableProductVariant.prototype.in_stock;
|
|
200
|
-
}
|
|
201
|
-
/**
|
|
202
|
-
* The applied attributes for a particular product variant.
|
|
203
|
-
* @record
|
|
204
|
-
*/
|
|
205
|
-
function DaffProductVariantAttributesDictionary() { }
|
|
206
|
-
/**
|
|
207
|
-
* The configurable option of a configurable product attribute. For example, this could be "blue" for the attribute "color" for a T-shirt.
|
|
208
|
-
* @record
|
|
209
|
-
*/
|
|
210
|
-
function DaffConfigurableProductOptionValue() { }
|
|
211
|
-
if (false) {
|
|
212
|
-
/**
|
|
213
|
-
* The attribute option value.
|
|
214
|
-
* @type {?}
|
|
215
|
-
*/
|
|
216
|
-
DaffConfigurableProductOptionValue.prototype.value;
|
|
217
|
-
/**
|
|
218
|
-
* The attribute option label.
|
|
219
|
-
* @type {?}
|
|
220
|
-
*/
|
|
221
|
-
DaffConfigurableProductOptionValue.prototype.label;
|
|
222
|
-
/**
|
|
223
|
-
* An option for displaying a hex color. Can be used for product color attributes.
|
|
224
|
-
* @type {?|undefined}
|
|
225
|
-
*/
|
|
226
|
-
DaffConfigurableProductOptionValue.prototype.swatch;
|
|
227
|
-
}
|
|
228
|
-
/**
|
|
229
|
-
* An optional field for the hex color code for DaffConfigurableProductOptionValues that need it.
|
|
230
|
-
* @record
|
|
16
|
+
* The possible product types.
|
|
231
17
|
*/
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
DaffSwatchOption.prototype.value;
|
|
239
|
-
/** @type {?|undefined} */
|
|
240
|
-
DaffSwatchOption.prototype.thumbnail;
|
|
241
|
-
}
|
|
18
|
+
var DaffProductTypeEnum;
|
|
19
|
+
(function (DaffProductTypeEnum) {
|
|
20
|
+
DaffProductTypeEnum["Simple"] = "simple";
|
|
21
|
+
DaffProductTypeEnum["Composite"] = "composite";
|
|
22
|
+
DaffProductTypeEnum["Configurable"] = "configurable";
|
|
23
|
+
})(DaffProductTypeEnum || (DaffProductTypeEnum = {}));
|
|
242
24
|
|
|
243
|
-
/**
|
|
244
|
-
* @fileoverview added by tsickle
|
|
245
|
-
* Generated from: models/prices.ts
|
|
246
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
247
|
-
*/
|
|
248
|
-
/**
|
|
249
|
-
* A model for product prices that holds discounts, discounted price, and original price for the associated product.
|
|
250
|
-
* @record
|
|
251
|
-
*/
|
|
252
|
-
function DaffProductPrices() { }
|
|
253
|
-
if (false) {
|
|
254
|
-
/**
|
|
255
|
-
* The discounted price of the product.
|
|
256
|
-
* @type {?}
|
|
257
|
-
*/
|
|
258
|
-
DaffProductPrices.prototype.discountedPrice;
|
|
259
|
-
/**
|
|
260
|
-
* The discount of the product.
|
|
261
|
-
* @type {?}
|
|
262
|
-
*/
|
|
263
|
-
DaffProductPrices.prototype.discount;
|
|
264
|
-
/**
|
|
265
|
-
* The price of the product before discounts.
|
|
266
|
-
* @type {?}
|
|
267
|
-
*/
|
|
268
|
-
DaffProductPrices.prototype.originalPrice;
|
|
269
|
-
}
|
|
270
|
-
/**
|
|
271
|
-
* A ranged price for products that could have more than one possible price, depending on the configurations.
|
|
272
|
-
* @record
|
|
273
|
-
*/
|
|
274
|
-
function DaffPriceRange() { }
|
|
275
|
-
if (false) {
|
|
276
|
-
/**
|
|
277
|
-
* The maximum prices of the product. Includes discounts, the maximum discounted price, and the maximum original price.
|
|
278
|
-
* @type {?}
|
|
279
|
-
*/
|
|
280
|
-
DaffPriceRange.prototype.maxPrice;
|
|
281
|
-
/**
|
|
282
|
-
* The minimum prices of the product. Includes discounts, the minimum discounted price, and the minimum original price.
|
|
283
|
-
* @type {?}
|
|
284
|
-
*/
|
|
285
|
-
DaffPriceRange.prototype.minPrice;
|
|
286
|
-
}
|
|
287
|
-
|
|
288
|
-
/**
|
|
289
|
-
* @fileoverview added by tsickle
|
|
290
|
-
* Generated from: models/product.ts
|
|
291
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
292
|
-
*/
|
|
293
|
-
/** @enum {string} */
|
|
294
|
-
const DaffProductTypeEnum = {
|
|
295
|
-
Simple: "simple",
|
|
296
|
-
Composite: "composite",
|
|
297
|
-
Configurable: "configurable",
|
|
298
|
-
};
|
|
299
|
-
/**
|
|
300
|
-
* An interface for a product usable by the \@daffodil/product library.
|
|
301
|
-
* @record
|
|
302
|
-
*/
|
|
303
|
-
function DaffProduct() { }
|
|
304
|
-
if (false) {
|
|
305
|
-
/**
|
|
306
|
-
* The type of product.
|
|
307
|
-
* @type {?}
|
|
308
|
-
*/
|
|
309
|
-
DaffProduct.prototype.type;
|
|
310
|
-
/**
|
|
311
|
-
* The product name.
|
|
312
|
-
* @type {?}
|
|
313
|
-
*/
|
|
314
|
-
DaffProduct.prototype.name;
|
|
315
|
-
/**
|
|
316
|
-
* A smaller image to concisely visualize the product.
|
|
317
|
-
* @type {?}
|
|
318
|
-
*/
|
|
319
|
-
DaffProduct.prototype.thumbnail;
|
|
320
|
-
/**
|
|
321
|
-
* An array of images for the product.
|
|
322
|
-
* @type {?}
|
|
323
|
-
*/
|
|
324
|
-
DaffProduct.prototype.images;
|
|
325
|
-
/**
|
|
326
|
-
* A list of related products.
|
|
327
|
-
* @type {?|undefined}
|
|
328
|
-
*/
|
|
329
|
-
DaffProduct.prototype.related;
|
|
330
|
-
/**
|
|
331
|
-
* A list of upsell productss.
|
|
332
|
-
* @type {?|undefined}
|
|
333
|
-
*/
|
|
334
|
-
DaffProduct.prototype.upsell;
|
|
335
|
-
/**
|
|
336
|
-
* The price of the product.
|
|
337
|
-
* @type {?|undefined}
|
|
338
|
-
*/
|
|
339
|
-
DaffProduct.prototype.price;
|
|
340
|
-
/**
|
|
341
|
-
* The total discounts associated with this product.
|
|
342
|
-
* @type {?|undefined}
|
|
343
|
-
*/
|
|
344
|
-
DaffProduct.prototype.discount;
|
|
345
|
-
/**
|
|
346
|
-
* Whether or not the product is in stock.
|
|
347
|
-
* @type {?|undefined}
|
|
348
|
-
*/
|
|
349
|
-
DaffProduct.prototype.in_stock;
|
|
350
|
-
/**
|
|
351
|
-
* The product brand.
|
|
352
|
-
* @type {?|undefined}
|
|
353
|
-
*/
|
|
354
|
-
DaffProduct.prototype.brand;
|
|
355
|
-
/**
|
|
356
|
-
* Describes the product.
|
|
357
|
-
* @type {?|undefined}
|
|
358
|
-
*/
|
|
359
|
-
DaffProduct.prototype.description;
|
|
360
|
-
/**
|
|
361
|
-
* A shorter description of the product.
|
|
362
|
-
* @type {?|undefined}
|
|
363
|
-
*/
|
|
364
|
-
DaffProduct.prototype.short_description;
|
|
365
|
-
/**
|
|
366
|
-
* A title for the product to display in the browser tab title.
|
|
367
|
-
* @type {?|undefined}
|
|
368
|
-
*/
|
|
369
|
-
DaffProduct.prototype.meta_title;
|
|
370
|
-
/**
|
|
371
|
-
* A description of the product for usage in search engine results.
|
|
372
|
-
* @type {?|undefined}
|
|
373
|
-
*/
|
|
374
|
-
DaffProduct.prototype.meta_description;
|
|
375
|
-
}
|
|
376
|
-
/**
|
|
377
|
-
* The discount for a product.
|
|
378
|
-
* @record
|
|
379
|
-
*/
|
|
380
|
-
function DaffProductDiscount() { }
|
|
381
|
-
if (false) {
|
|
382
|
-
/**
|
|
383
|
-
* The discount represented as some amount of currency.
|
|
384
|
-
* @type {?}
|
|
385
|
-
*/
|
|
386
|
-
DaffProductDiscount.prototype.amount;
|
|
387
|
-
/**
|
|
388
|
-
* The discount represented as a percent of the original product price.
|
|
389
|
-
* @type {?}
|
|
390
|
-
*/
|
|
391
|
-
DaffProductDiscount.prototype.percent;
|
|
392
|
-
}
|
|
393
|
-
|
|
394
|
-
/**
|
|
395
|
-
* @fileoverview added by tsickle
|
|
396
|
-
* Generated from: models/product-image.ts
|
|
397
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
398
|
-
*/
|
|
399
|
-
/**
|
|
400
|
-
* Interface for an image on a DaffProduct.
|
|
401
|
-
* @record
|
|
402
|
-
*/
|
|
403
|
-
function DaffProductImage() { }
|
|
404
|
-
if (false) {
|
|
405
|
-
/**
|
|
406
|
-
* A label describing the image.
|
|
407
|
-
* @type {?}
|
|
408
|
-
*/
|
|
409
|
-
DaffProductImage.prototype.label;
|
|
410
|
-
}
|
|
411
|
-
|
|
412
|
-
/**
|
|
413
|
-
* @fileoverview added by tsickle
|
|
414
|
-
* Generated from: helpers.ts
|
|
415
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
416
|
-
*/
|
|
417
25
|
/**
|
|
418
26
|
* Returns whether a DaffPriceRange has a discount.
|
|
419
27
|
*
|
|
420
|
-
*
|
|
421
|
-
* @type {?}
|
|
28
|
+
* @param priceRange a DaffPriceRange
|
|
422
29
|
*/
|
|
423
|
-
const productPriceRangeHasDiscount = (
|
|
424
|
-
|
|
425
|
-
* @return {?}
|
|
426
|
-
*/
|
|
427
|
-
(priceRange) => priceRange.minPrice.originalPrice !== priceRange.minPrice.discountedPrice ||
|
|
428
|
-
priceRange.maxPrice.originalPrice !== priceRange.maxPrice.discountedPrice);
|
|
30
|
+
const productPriceRangeHasDiscount = (priceRange) => priceRange.minPrice.originalPrice !== priceRange.minPrice.discountedPrice ||
|
|
31
|
+
priceRange.maxPrice.originalPrice !== priceRange.maxPrice.discountedPrice;
|
|
429
32
|
/**
|
|
430
33
|
* Returns whether the min and max prices of a DaffPriceRange are different.
|
|
431
34
|
*
|
|
432
|
-
*
|
|
433
|
-
* @type {?}
|
|
434
|
-
*/
|
|
435
|
-
const productPriceRangeHasPriceRange = (/**
|
|
436
|
-
* @param {?} priceRange
|
|
437
|
-
* @return {?}
|
|
35
|
+
* @param priceRange a DaffPriceRange
|
|
438
36
|
*/
|
|
439
|
-
(priceRange) => priceRange.minPrice.originalPrice !== priceRange.maxPrice.originalPrice ||
|
|
440
|
-
priceRange.minPrice.discountedPrice !== priceRange.maxPrice.discountedPrice
|
|
37
|
+
const productPriceRangeHasPriceRange = (priceRange) => priceRange.minPrice.originalPrice !== priceRange.maxPrice.originalPrice ||
|
|
38
|
+
priceRange.minPrice.discountedPrice !== priceRange.maxPrice.discountedPrice;
|
|
441
39
|
|
|
442
40
|
/**
|
|
443
|
-
* @
|
|
444
|
-
* Generated from: injection-tokens/error-matcher.token.ts
|
|
445
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
446
|
-
*/
|
|
447
|
-
/**
|
|
448
|
-
* Transforms {\@link DaffError}s into {\@link DaffStateError}s before they are serialized into state.
|
|
41
|
+
* Transforms {@link DaffError}s into {@link DaffStateError}s before they are serialized into state.
|
|
449
42
|
* Can be used to further refine Daffodil errors into more specific app errors.
|
|
450
|
-
* @type {?}
|
|
451
|
-
*/
|
|
452
|
-
const DAFF_PRODUCT_ERROR_MATCHER = new InjectionToken('DAFF_PRODUCT_ERROR_MATCHER', { factory: (/**
|
|
453
|
-
* @return {?}
|
|
454
|
-
*/
|
|
455
|
-
() => daffTransformErrorToStateError) });
|
|
456
|
-
|
|
457
|
-
/**
|
|
458
|
-
* @fileoverview added by tsickle
|
|
459
|
-
* Generated from: injection-tokens/public_api.ts
|
|
460
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
461
|
-
*/
|
|
462
|
-
|
|
463
|
-
/**
|
|
464
|
-
* @fileoverview added by tsickle
|
|
465
|
-
* Generated from: public_api.ts
|
|
466
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
467
|
-
*/
|
|
468
|
-
|
|
469
|
-
/**
|
|
470
|
-
* @fileoverview added by tsickle
|
|
471
|
-
* Generated from: index.ts
|
|
472
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
473
43
|
*/
|
|
44
|
+
const DAFF_PRODUCT_ERROR_MATCHER = new InjectionToken('DAFF_PRODUCT_ERROR_MATCHER', { factory: () => daffTransformErrorToStateError });
|
|
474
45
|
|
|
475
46
|
/**
|
|
476
|
-
*
|
|
477
|
-
* Generated from: daffodil-product.ts
|
|
478
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
47
|
+
* Generated bundle index. Do not edit.
|
|
479
48
|
*/
|
|
480
49
|
|
|
481
50
|
export { DAFF_PRODUCT_ERROR_MATCHER, DaffCompositeProductItemInputEnum, DaffProductTypeEnum, productPriceRangeHasDiscount, productPriceRangeHasPriceRange };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"daffodil-product.js","sources":["../../../libs/product/src/models/composite-configuration-item.ts","../../../libs/product/src/models/composite-product.ts","../../../libs/product/src/models/composite-product-item.ts","../../../libs/product/src/models/configurable-product.ts","../../../libs/product/src/models/prices.ts","../../../libs/product/src/models/product.ts","../../../libs/product/src/models/product-image.ts","../../../libs/product/src/helpers.ts","../../../libs/product/src/injection-tokens/error-matcher.token.ts"],"sourcesContent":["import { ID } from '@daffodil/core';\n\n/**\n * An object to denote the configuration chosen for a particular {@link DaffCompositeProductItem}.\n *\n * @deprecated import from @daffodil/composite-product instead.\n */\nexport interface DaffCompositeConfigurationItem {\n\t/**\n\t * The quantity chosen for the configuration of the {@link DaffCompositeProductItem}.\n\t */\n\tqty?: number;\n\t/**\n\t * The value of the {@link DaffCompositeProductItemOption} chosen for the configuration of the {@link DaffCompositeProductItem}.\n\t */\n\tvalue?: ID;\n}\n","import { DaffCompositeProductItem } from './composite-product-item';\nimport { DaffProduct } from './product';\n\n/**\n * A composite product is a group of products sold together. It includes one primary product and many accessory \"items\".\n * The composite product items are additional products the customer might want to purchase with the primary product,\n * and each item has a number of options from which the user can choose. Composite product items can be optional or required.\n * For example, a toolbox bundle might have a primary product of the toolbox. The items could be a hammer and a screw driver,\n * and the options for these items could be two different hammers and two different screwdrivers between which the customer could choose.\n * All of these items could have different prices/discounts/etc which would cause the composite products to have ranged prices.\n *\n * @deprecated import from @daffodil/composite-product instead.\n */\nexport interface DaffCompositeProduct extends DaffProduct {\n\t/**\n\t * The available items for the composite product.\n\t */\n\titems: DaffCompositeProductItem[];\n}\n","import { DaffIdentifiable } from '@daffodil/core';\n\nimport { DaffProduct } from './product';\n\n/**\n * An enum for whether a composite product item should be displayed as a radio or select input.\n *\n * @deprecated import from @daffodil/composite-product instead.\n */\nexport enum DaffCompositeProductItemInputEnum {\n\tselect = 'select',\n\tradio = 'radio'\n}\n\n/**\n * The composite product item describes one set of product options that the user can add to the composite product.\n * 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.\n * If the item is optional, the product can be added to the cart without an option having been chosen.\n * 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\n * item might be a phillips head and a flathead. The customer could choose to add either a phillips head or a flathead to the\n * composite product, or neither if the item is optional.\n *\n * @deprecated import from @daffodil/composite-product instead.\n */\nexport interface DaffCompositeProductItem extends DaffIdentifiable {\n\t/**\n\t * Whether the item is required or optional.\n\t */\n\trequired: boolean;\n\t/**\n\t * The title label for the item.\n\t */\n\ttitle: string;\n\t/**\n\t * Describes how the item should be displayed.\n\t */\n\tinput_type: DaffCompositeProductItemInputEnum;\n\t/**\n\t * The options that may be chosen for the item.\n\t */\n\toptions: DaffCompositeProductItemOption[];\n}\n\n/**\n * The composite product item option is a DaffProduct that can be added to a composite product.\n *\n * @deprecated import from @daffodil/composite-product instead.\n */\nexport interface DaffCompositeProductItemOption extends DaffProduct {\n\t/**\n\t * Whether the option is the default option for its parent {@link DaffCompositeProductItem}.\n\t */\n\tis_default: boolean;\n\t/**\n\t * The quantity chosen for the option.\n\t */\n\tquantity: number;\n}\n","import {\n DaffOrderable,\n DaffIdentifiable,\n} from '@daffodil/core';\n\nimport {\n DaffProduct,\n DaffProductDiscount,\n} from './product';\nimport { DaffProductImage } from './product-image';\n\n/**\n * A configurable product is a product with configurable attributes. The price of a configurable product may change based on\n * the attributes chosen, so a configurable product can have a price range. An example of a configurable product is a T-shirt.\n */\nexport interface DaffConfigurableProduct extends DaffProduct {\n\t/**\n\t * The configurable attributes available.\n\t */\n\tconfigurableAttributes: DaffConfigurableProductAttribute[];\n\t/**\n\t * The possible different variants of the product.\n\t */\n\tvariants: DaffConfigurableProductVariant[];\n}\n\n/**\n * An attribute of the configurable product that the customer must choose to add the configurable product to the cart.\n * An example of an attribute would be size for clothing.\n */\nexport interface DaffConfigurableProductAttribute extends DaffOrderable {\n\t/**\n\t * The identifier for the attribute type.\n\t */\n\tcode:\tstring;\n\t/**\n\t * A label for the attribute type.\n\t */\n\tlabel: string;\n\t/**\n\t * The possible attribute options that a customer can choose.\n\t */\n\tvalues:\tDaffConfigurableProductOptionValue[];\n}\n\n/**\n * A variant is one version of the configurable product with all attributes chosen. Variants exist because not all versions of every configuration of\n * the product might be in stock. For example, a shirt might have a medium, red shirt and a small,\n * green shirt in stock, but no small, red shirts. In this case there would be two variants (mediumRed, smallGreen) rather than the maximum 4 variants\n * (smallRed, mediumRed, smallGreen, mediumGreen). This ensures the customer can't add a configurable product to the cart that is not\n * in stock. However, variants don't usually need to be considered by the frontend dev, because daffodil abstacts away the concept of variants into\n * an \"available attributes\" selector.\n */\nexport interface DaffConfigurableProductVariant extends DaffIdentifiable {\n\t/**\n\t * The attributes applied to the product to form the product variant.\n\t */\n\tappliedAttributes: DaffProductVariantAttributesDictionary;\n\t/**\n\t * The price of the variant.\n\t */\n\tprice: number;\n\t/**\n\t * The total discount for the variant.\n\t */\n\tdiscount: DaffProductDiscount;\n\t/**\n\t * An image of the product variant.\n\t */\n\timage?: DaffProductImage;\n\t/**\n\t * Whether or not the variant is in stock.\n\t */\n\tin_stock: boolean;\n}\n\n/**\n * The applied attributes for a particular product variant.\n */\nexport interface DaffProductVariantAttributesDictionary {\n\t[x: string]: DaffConfigurableProductOptionValue['value'];\n}\n\n/**\n * The configurable option of a configurable product attribute. For example, this could be \"blue\" for the attribute \"color\" for a T-shirt.\n */\nexport interface DaffConfigurableProductOptionValue {\n\t/**\n\t * The attribute option value.\n\t */\n\tvalue: string;\n\t/**\n\t * The attribute option label.\n\t */\n\tlabel: string;\n\t/**\n\t * An option for displaying a hex color. Can be used for product color attributes.\n\t */\n\tswatch?: DaffSwatchOption;\n}\n\n/**\n * An optional field for the hex color code for DaffConfigurableProductOptionValues that need it.\n */\nexport interface DaffSwatchOption {\n\t/**\n\t * A hex color value.\n\t */\n\tvalue: string;\n\tthumbnail?: string;\n}\n","import { DaffProductDiscount } from './product';\n\n/**\n * A model for product prices that holds discounts, discounted price, and original price for the associated product.\n */\nexport interface DaffProductPrices {\n\t/**\n\t * The discounted price of the product.\n\t */\n\tdiscountedPrice: number;\n\t/**\n\t * The discount of the product.\n\t */\n\tdiscount: DaffProductDiscount;\n\t/**\n\t * The price of the product before discounts.\n\t */\n\toriginalPrice: number;\n}\n\n/**\n * A ranged price for products that could have more than one possible price, depending on the configurations.\n */\nexport interface DaffPriceRange {\n\t/**\n\t * The maximum prices of the product. Includes discounts, the maximum discounted price, and the maximum original price.\n\t */\n\tmaxPrice: DaffProductPrices;\n\t/**\n\t * The minimum prices of the product. Includes discounts, the minimum discounted price, and the minimum original price.\n\t */\n\tminPrice: DaffProductPrices;\n}\n","import {\n DaffIdentifiable,\n DaffLocatable,\n DaffCanonicallyLocatable,\n} from '@daffodil/core';\n\nimport { DaffProductImage } from './product-image';\n\n/**\n * The possible product types.\n */\nexport enum DaffProductTypeEnum {\n\tSimple = 'simple',\n\tComposite = 'composite',\n\tConfigurable = 'configurable'\n}\n\n/**\n * An interface for a product usable by the @daffodil/product library.\n */\nexport interface DaffProduct extends DaffLocatable, DaffIdentifiable, Partial<DaffCanonicallyLocatable> {\n\t/**\n\t * The type of product.\n\t */\n type: DaffProductTypeEnum;\n /**\n * The product name.\n */\n name: string;\n /**\n * A smaller image to concisely visualize the product.\n */\n thumbnail: DaffProductImage;\n /**\n * An array of images for the product.\n */\n images: DaffProductImage[];\n /**\n * A list of related products.\n */\n related?: DaffProduct[];\n /**\n * A list of upsell productss.\n */\n upsell?: DaffProduct[];\n\n // TODO: move to subtypes\n /**\n * The price of the product.\n */\n\tprice?: number;\n\t/**\n\t * The total discounts associated with this product.\n\t */\n discount?: DaffProductDiscount;\n /**\n * Whether or not the product is in stock.\n */\n in_stock?: boolean;\n\n // TODO: move to meta object\n\t/**\n\t * The product brand.\n\t */\n brand?: string;\n\t/**\n\t * Describes the product.\n\t */\n description?: string;\n\t/**\n\t * A shorter description of the product.\n\t */\n\tshort_description?: string;\n\t/**\n\t * A title for the product to display in the browser tab title.\n\t */\n\tmeta_title?: string;\n\t/**\n\t * A description of the product for usage in search engine results.\n\t */\n\tmeta_description?: string;\n}\n\n/**\n * The discount for a product.\n */\nexport interface DaffProductDiscount {\n\t/**\n\t * The discount represented as some amount of currency.\n\t */\n\tamount: number;\n\t/**\n\t * The discount represented as a percent of the original product price.\n\t */\n\tpercent: number;\n}\n","import {\n DaffIdentifiable,\n DaffLocatable,\n} from '@daffodil/core';\n\n/**\n * Interface for an image on a DaffProduct.\n */\nexport interface DaffProductImage extends DaffLocatable, DaffIdentifiable {\n\t/**\n\t * A label describing the image.\n\t */\n label: string;\n}\n","import { DaffPriceRange } from './models/prices';\n\n/**\n * Returns whether a DaffPriceRange has a discount.\n *\n * @param priceRange a DaffPriceRange\n */\nexport const productPriceRangeHasDiscount = (priceRange: DaffPriceRange): boolean => priceRange.minPrice.originalPrice !== priceRange.minPrice.discountedPrice ||\n\t\tpriceRange.maxPrice.originalPrice !== priceRange.maxPrice.discountedPrice;\n\n/**\n * Returns whether the min and max prices of a DaffPriceRange are different.\n *\n * @param priceRange a DaffPriceRange\n */\nexport const productPriceRangeHasPriceRange = (priceRange: DaffPriceRange): boolean => priceRange.minPrice.originalPrice !== priceRange.maxPrice.originalPrice ||\n\t\tpriceRange.minPrice.discountedPrice !== priceRange.maxPrice.discountedPrice;\n","import { InjectionToken } from '@angular/core';\n\nimport { daffTransformErrorToStateError } from '@daffodil/core/state';\n\n/**\n * Transforms {@link DaffError}s into {@link DaffStateError}s before they are serialized into state.\n * Can be used to further refine Daffodil errors into more specific app errors.\n */\nexport const DAFF_PRODUCT_ERROR_MATCHER = new InjectionToken<typeof daffTransformErrorToStateError>(\n 'DAFF_PRODUCT_ERROR_MATCHER',\n { factory: () => daffTransformErrorToStateError },\n);\n"],"names":[],"mappings":";;;;;;;;;;;;;;6CAgBC;;;;;;IALA,6CAAa;;;;;IAIb,+CAAW;;;;;;;;;;;;;;;;;;;mCCGX;;;;;;IADA,qCAAkC;;;;;;;;;MCRvB,iCAAiC;IAC5C,MAAM,UAAW;IACjB,KAAK,SAAU;EACf;;;;;;;;;;;;uCA6BA;;;;;;IAbA,4CAAkB;;;;;IAIlB,yCAAc;;;;;IAId,8CAA8C;;;;;IAI9C,2CAA0C;;;;;;;;6CAiB1C;;;;;;IALA,oDAAoB;;;;;IAIpB,kDAAiB;;;;;;;;;;;;;sCChCjB;;;;;;IALA,yDAA2D;;;;;IAI3D,2CAA2C;;;;;;;+CAoB3C;;;;;;IATA,gDAAa;;;;;IAIb,iDAAc;;;;;IAId,kDAA6C;;;;;;;;;;;6CAgC7C;;;;;;IAjBA,2DAA0D;;;;;IAI1D,+CAAc;;;;;IAId,kDAA8B;;;;;IAI9B,+CAAyB;;;;;IAIzB,kDAAkB;;;;;;qDAQlB;;;;;iDAkBA;;;;;;IATA,mDAAc;;;;;IAId,mDAAc;;;;;IAId,oDAA0B;;;;;;+BAY1B;;;;;;IAFA,iCAAc;;IACd,qCAAmB;;;;;;;;;;;;gCC3FnB;;;;;;IATA,4CAAwB;;;;;IAIxB,qCAA8B;;;;;IAI9B,0CAAsB;;;;;;6BAetB;;;;;;IALA,kCAA4B;;;;;IAI5B,kCAA4B;;;;;;;;;MCpBjB,mBAAmB;IAC9B,MAAM,UAAW;IACjB,SAAS,aAAc;IACvB,YAAY,gBAAiB;EAC7B;;;;;0BAkEA;;;;;;IAzDC,2BAA0B;;;;;IAI1B,2BAAa;;;;;IAIb,gCAA4B;;;;;IAI5B,6BAA2B;;;;;IAI3B,8BAAwB;;;;;IAIxB,6BAAuB;;;;;IAMxB,4BAAe;;;;;IAId,+BAA+B;;;;;IAI/B,+BAAmB;;;;;IAMnB,4BAAe;;;;;IAIf,kCAAqB;;;;;IAItB,wCAA2B;;;;;IAI3B,iCAAoB;;;;;IAIpB,uCAA0B;;;;;;kCAe1B;;;;;;IALA,qCAAe;;;;;IAIf,sCAAgB;;;;;;;;;;;;+BCjFhB;;;;;;IADC,iCAAc;;;;;;;;;;;;;;MCLH,4BAA4B;;;;AAAG,CAAC,UAA0B,KAAc,UAAU,CAAC,QAAQ,CAAC,aAAa,KAAK,UAAU,CAAC,QAAQ,CAAC,eAAe;IAC5J,UAAU,CAAC,QAAQ,CAAC,aAAa,KAAK,UAAU,CAAC,QAAQ,CAAC,eAAe;;;;;;;MAO9D,8BAA8B;;;;AAAG,CAAC,UAA0B,KAAc,UAAU,CAAC,QAAQ,CAAC,aAAa,KAAK,UAAU,CAAC,QAAQ,CAAC,aAAa;IAC5J,UAAU,CAAC,QAAQ,CAAC,eAAe,KAAK,UAAU,CAAC,QAAQ,CAAC,eAAe;;;;;;;;;;;;MCRhE,0BAA0B,GAAG,IAAI,cAAc,CAC1D,4BAA4B,EAC5B,EAAE,OAAO;;;IAAE,MAAM,8BAA8B,CAAA,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"daffodil-product.js","sources":["../../../libs/product/src/models/composite-product-item.ts","../../../libs/product/src/models/product.ts","../../../libs/product/src/helpers.ts","../../../libs/product/src/injection-tokens/error-matcher.token.ts","../../../libs/product/src/daffodil-product.ts"],"sourcesContent":["import { DaffIdentifiable } from '@daffodil/core';\n\nimport { DaffProduct } from './product';\n\n/**\n * An enum for whether a composite product item should be displayed as a radio or select input.\n *\n * @deprecated import from @daffodil/composite-product instead.\n */\nexport enum DaffCompositeProductItemInputEnum {\n\tselect = 'select',\n\tradio = 'radio'\n}\n\n/**\n * The composite product item describes one set of product options that the user can add to the composite product.\n * 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.\n * If the item is optional, the product can be added to the cart without an option having been chosen.\n * 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\n * item might be a phillips head and a flathead. The customer could choose to add either a phillips head or a flathead to the\n * composite product, or neither if the item is optional.\n *\n * @deprecated import from @daffodil/composite-product instead.\n */\nexport interface DaffCompositeProductItem extends DaffIdentifiable {\n\t/**\n\t * Whether the item is required or optional.\n\t */\n\trequired: boolean;\n\t/**\n\t * The title label for the item.\n\t */\n\ttitle: string;\n\t/**\n\t * Describes how the item should be displayed.\n\t */\n\tinput_type: DaffCompositeProductItemInputEnum;\n\t/**\n\t * The options that may be chosen for the item.\n\t */\n\toptions: DaffCompositeProductItemOption[];\n}\n\n/**\n * The composite product item option is a DaffProduct that can be added to a composite product.\n *\n * @deprecated import from @daffodil/composite-product instead.\n */\nexport interface DaffCompositeProductItemOption extends DaffProduct {\n\t/**\n\t * Whether the option is the default option for its parent {@link DaffCompositeProductItem}.\n\t */\n\tis_default: boolean;\n\t/**\n\t * The quantity chosen for the option.\n\t */\n\tquantity: number;\n}\n","import {\n DaffIdentifiable,\n DaffLocatable,\n DaffCanonicallyLocatable,\n} from '@daffodil/core';\n\nimport { DaffProductImage } from './product-image';\n\n/**\n * The possible product types.\n */\nexport enum DaffProductTypeEnum {\n\tSimple = 'simple',\n\tComposite = 'composite',\n\tConfigurable = 'configurable'\n}\n\n/**\n * An interface for a product usable by the @daffodil/product library.\n */\nexport interface DaffProduct extends DaffLocatable, DaffIdentifiable, Partial<DaffCanonicallyLocatable> {\n\t/**\n\t * The type of product.\n\t */\n type: DaffProductTypeEnum;\n /**\n * The product name.\n */\n name: string;\n /**\n * A smaller image to concisely visualize the product.\n */\n thumbnail: DaffProductImage;\n /**\n * An array of images for the product.\n */\n images: DaffProductImage[];\n /**\n * A list of related products.\n */\n related?: DaffProduct[];\n /**\n * A list of upsell productss.\n */\n upsell?: DaffProduct[];\n\n // TODO: move to subtypes\n /**\n * The price of the product.\n */\n\tprice?: number;\n\t/**\n\t * The total discounts associated with this product.\n\t */\n discount?: DaffProductDiscount;\n /**\n * Whether or not the product is in stock.\n */\n in_stock?: boolean;\n\n // TODO: move to meta object\n\t/**\n\t * The product brand.\n\t */\n brand?: string;\n\t/**\n\t * Describes the product.\n\t */\n description?: string;\n\t/**\n\t * A shorter description of the product.\n\t */\n\tshort_description?: string;\n\t/**\n\t * A title for the product to display in the browser tab title.\n\t */\n\tmeta_title?: string;\n\t/**\n\t * A description of the product for usage in search engine results.\n\t */\n\tmeta_description?: string;\n}\n\n/**\n * The discount for a product.\n */\nexport interface DaffProductDiscount {\n\t/**\n\t * The discount represented as some amount of currency.\n\t */\n\tamount: number;\n\t/**\n\t * The discount represented as a percent of the original product price.\n\t */\n\tpercent: number;\n}\n","import { DaffPriceRange } from './models/prices';\n\n/**\n * Returns whether a DaffPriceRange has a discount.\n *\n * @param priceRange a DaffPriceRange\n */\nexport const productPriceRangeHasDiscount = (priceRange: DaffPriceRange): boolean => priceRange.minPrice.originalPrice !== priceRange.minPrice.discountedPrice ||\n\t\tpriceRange.maxPrice.originalPrice !== priceRange.maxPrice.discountedPrice;\n\n/**\n * Returns whether the min and max prices of a DaffPriceRange are different.\n *\n * @param priceRange a DaffPriceRange\n */\nexport const productPriceRangeHasPriceRange = (priceRange: DaffPriceRange): boolean => priceRange.minPrice.originalPrice !== priceRange.maxPrice.originalPrice ||\n\t\tpriceRange.minPrice.discountedPrice !== priceRange.maxPrice.discountedPrice;\n","import { InjectionToken } from '@angular/core';\n\nimport { daffTransformErrorToStateError } from '@daffodil/core/state';\n\n/**\n * Transforms {@link DaffError}s into {@link DaffStateError}s before they are serialized into state.\n * Can be used to further refine Daffodil errors into more specific app errors.\n */\nexport const DAFF_PRODUCT_ERROR_MATCHER = new InjectionToken<typeof daffTransformErrorToStateError>(\n 'DAFF_PRODUCT_ERROR_MATCHER',\n { factory: () => daffTransformErrorToStateError },\n);\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;AAIA;;;;;IAKY;AAAZ,WAAY,iCAAiC;IAC5C,sDAAiB,CAAA;IACjB,oDAAe,CAAA;AAChB,CAAC,EAHW,iCAAiC,KAAjC,iCAAiC;;ACD7C;;;IAGY;AAAZ,WAAY,mBAAmB;IAC9B,wCAAiB,CAAA;IACjB,8CAAuB,CAAA;IACvB,oDAA6B,CAAA;AAC9B,CAAC,EAJW,mBAAmB,KAAnB,mBAAmB;;ACT/B;;;;;MAKa,4BAA4B,GAAG,CAAC,UAA0B,KAAc,UAAU,CAAC,QAAQ,CAAC,aAAa,KAAK,UAAU,CAAC,QAAQ,CAAC,eAAe;IAC5J,UAAU,CAAC,QAAQ,CAAC,aAAa,KAAK,UAAU,CAAC,QAAQ,CAAC,gBAAgB;AAE5E;;;;;MAKa,8BAA8B,GAAG,CAAC,UAA0B,KAAc,UAAU,CAAC,QAAQ,CAAC,aAAa,KAAK,UAAU,CAAC,QAAQ,CAAC,aAAa;IAC5J,UAAU,CAAC,QAAQ,CAAC,eAAe,KAAK,UAAU,CAAC,QAAQ,CAAC;;ACZ9D;;;;MAIa,0BAA0B,GAAG,IAAI,cAAc,CAC1D,4BAA4B,EAC5B,EAAE,OAAO,EAAE,MAAM,8BAA8B,EAAE;;ACVnD;;;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@daffodil/product",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.39.0",
|
|
4
4
|
"description": "Interfaces built for daffodil/state",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"peerDependencies": {
|
|
19
19
|
"@angular/common": "^11.0.0",
|
|
20
20
|
"@angular/core": "^11.0.0",
|
|
21
|
-
"@daffodil/core": "0.
|
|
21
|
+
"@daffodil/core": "0.39.0",
|
|
22
22
|
"@ngrx/effects": "^11.0.0",
|
|
23
23
|
"@ngrx/entity": "^11.0.0",
|
|
24
24
|
"@ngrx/store": "^11.0.0",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
},
|
|
27
27
|
"optionalDependencies": {
|
|
28
28
|
"@apollo/client": "^3.0.0",
|
|
29
|
-
"@daffodil/driver": "0.
|
|
29
|
+
"@daffodil/driver": "0.39.0",
|
|
30
30
|
"angular-in-memory-web-api": "^0.11.0",
|
|
31
31
|
"apollo-angular": "^2.4.0",
|
|
32
32
|
"faker": "^5.5.3"
|
package/routing/package.json
CHANGED
package/state/package.json
CHANGED
package/testing/package.json
CHANGED