@daffodil/checkout 0.66.1 → 0.68.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 (86) hide show
  1. package/billing/actions/billing.actions.d.ts +1 -1
  2. package/{esm2020 → esm2022}/billing/billing-state.module.mjs +5 -5
  3. package/{esm2020 → esm2022}/billing/billing.module.mjs +13 -13
  4. package/{esm2020 → esm2022}/billing/containers/billing.component.mjs +5 -5
  5. package/{esm2020 → esm2022}/billing/facades/billing.facade.mjs +5 -5
  6. package/{esm2020 → esm2022}/checkout.module.mjs +19 -19
  7. package/{esm2020 → esm2022}/order/containers/order.component.mjs +5 -5
  8. package/{esm2020 → esm2022}/order/effects/order.effects.mjs +6 -6
  9. package/{esm2020 → esm2022}/order/facades/order.facade.mjs +5 -5
  10. package/esm2022/order/order-state.module.mjs +31 -0
  11. package/{esm2020 → esm2022}/order/order.module.mjs +13 -13
  12. package/{esm2020 → esm2022}/payment/facades/payment.facade.mjs +5 -5
  13. package/{esm2020 → esm2022}/payment/payment-state.module.mjs +5 -5
  14. package/{esm2020 → esm2022}/payment/payment.module.mjs +13 -13
  15. package/{esm2020 → esm2022}/shipping/containers/shipping.component.mjs +5 -5
  16. package/{esm2020 → esm2022}/shipping/facades/shipping.facade.mjs +5 -5
  17. package/{esm2020 → esm2022}/shipping/shipping-state.module.mjs +5 -5
  18. package/{esm2020 → esm2022}/shipping/shipping.module.mjs +13 -13
  19. package/{esm2020 → esm2022}/testing/drivers/in-memory/checkout-driver.module.mjs +5 -5
  20. package/{esm2020 → esm2022}/testing/drivers/in-memory/checkout.service.mjs +5 -5
  21. package/{esm2020 → esm2022}/testing/drivers/testing/checkout-driver.module.mjs +5 -5
  22. package/{esm2020 → esm2022}/testing/drivers/testing/checkout.service.mjs +5 -5
  23. package/{esm2020 → esm2022}/testing/inmemory-backend/checkout.service.mjs +5 -5
  24. package/{esm2020 → esm2022}/testing/order/factories/order-address.factory.mjs +5 -5
  25. package/{esm2020 → esm2022}/testing/order/factories/order-item.factory.mjs +5 -5
  26. package/{esm2020 → esm2022}/testing/order/factories/order-payment.factory.mjs +5 -5
  27. package/{esm2020 → esm2022}/testing/order/factories/order-shipping-rate.factory.mjs +5 -5
  28. package/{esm2020 → esm2022}/testing/order/factories/order.factory.mjs +5 -5
  29. package/{esm2020 → esm2022}/testing/payment/factories/payment.factory.mjs +5 -5
  30. package/{esm2020 → esm2022}/testing/shipping/factories/shipping-option.factory.mjs +5 -5
  31. package/{esm2020 → esm2022}/testing/shipping/factories/shipping-rate.factory.mjs +5 -5
  32. package/{fesm2020 → fesm2022}/daffodil-checkout-testing.mjs +52 -52
  33. package/{fesm2020 → fesm2022}/daffodil-checkout-testing.mjs.map +1 -1
  34. package/{fesm2020 → fesm2022}/daffodil-checkout.mjs +118 -118
  35. package/{fesm2020 → fesm2022}/daffodil-checkout.mjs.map +1 -1
  36. package/order/actions/order.actions.d.ts +1 -1
  37. package/package.json +1 -1
  38. package/payment/actions/payment.actions.d.ts +1 -1
  39. package/shipping/actions/shipping.actions.d.ts +1 -1
  40. package/esm2020/order/order-state.module.mjs +0 -31
  41. package/fesm2015/daffodil-checkout-testing.mjs +0 -425
  42. package/fesm2015/daffodil-checkout-testing.mjs.map +0 -1
  43. package/fesm2015/daffodil-checkout.mjs +0 -722
  44. package/fesm2015/daffodil-checkout.mjs.map +0 -1
  45. /package/{esm2020 → esm2022}/billing/actions/billing.actions.mjs +0 -0
  46. /package/{esm2020 → esm2022}/billing/reducers/billing/billing-reducer.interface.mjs +0 -0
  47. /package/{esm2020 → esm2022}/billing/reducers/billing/billing.reducer.mjs +0 -0
  48. /package/{esm2020 → esm2022}/billing/reducers/billing-reducers.interface.mjs +0 -0
  49. /package/{esm2020 → esm2022}/billing/reducers/billing-reducers.mjs +0 -0
  50. /package/{esm2020 → esm2022}/billing/selectors/billing.selector.mjs +0 -0
  51. /package/{esm2020 → esm2022}/daffodil-checkout.mjs +0 -0
  52. /package/{esm2020 → esm2022}/drivers/injection-tokens/driver-checkout.token.mjs +0 -0
  53. /package/{esm2020 → esm2022}/drivers/injection-tokens/payment-driver.token.mjs +0 -0
  54. /package/{esm2020 → esm2022}/drivers/injection-tokens/payment-transformer.token.mjs +0 -0
  55. /package/{esm2020 → esm2022}/drivers/interfaces/checkout-service.interface.mjs +0 -0
  56. /package/{esm2020 → esm2022}/drivers/interfaces/order-service.interface.mjs +0 -0
  57. /package/{esm2020 → esm2022}/index.mjs +0 -0
  58. /package/{esm2020 → esm2022}/models/cart-process-request.mjs +0 -0
  59. /package/{esm2020 → esm2022}/models/order/order-address.mjs +0 -0
  60. /package/{esm2020 → esm2022}/models/order/order-item.mjs +0 -0
  61. /package/{esm2020 → esm2022}/models/order/order-payment.mjs +0 -0
  62. /package/{esm2020 → esm2022}/models/order/order-shipping-rate.mjs +0 -0
  63. /package/{esm2020 → esm2022}/models/order/order.mjs +0 -0
  64. /package/{esm2020 → esm2022}/models/payment/payment-info.mjs +0 -0
  65. /package/{esm2020 → esm2022}/models/shipping/shipping-option.mjs +0 -0
  66. /package/{esm2020 → esm2022}/models/shipping/shipping-rate.mjs +0 -0
  67. /package/{esm2020 → esm2022}/order/actions/order.actions.mjs +0 -0
  68. /package/{esm2020 → esm2022}/order/reducers/order/order-reducer.interface.mjs +0 -0
  69. /package/{esm2020 → esm2022}/order/reducers/order/order.reducer.mjs +0 -0
  70. /package/{esm2020 → esm2022}/order/reducers/order-reducers.interface.mjs +0 -0
  71. /package/{esm2020 → esm2022}/order/reducers/order-reducers.mjs +0 -0
  72. /package/{esm2020 → esm2022}/order/selectors/order.selector.mjs +0 -0
  73. /package/{esm2020 → esm2022}/payment/actions/payment.actions.mjs +0 -0
  74. /package/{esm2020 → esm2022}/payment/reducers/payment/payment-reducer.interface.mjs +0 -0
  75. /package/{esm2020 → esm2022}/payment/reducers/payment/payment.reducer.mjs +0 -0
  76. /package/{esm2020 → esm2022}/payment/reducers/payment-reducers.interface.mjs +0 -0
  77. /package/{esm2020 → esm2022}/payment/reducers/payment-reducers.mjs +0 -0
  78. /package/{esm2020 → esm2022}/payment/selectors/payment.selector.mjs +0 -0
  79. /package/{esm2020 → esm2022}/shipping/actions/shipping.actions.mjs +0 -0
  80. /package/{esm2020 → esm2022}/shipping/reducers/shipping/shipping-reducer.interface.mjs +0 -0
  81. /package/{esm2020 → esm2022}/shipping/reducers/shipping/shipping.reducer.mjs +0 -0
  82. /package/{esm2020 → esm2022}/shipping/reducers/shipping-reducers.interface.mjs +0 -0
  83. /package/{esm2020 → esm2022}/shipping/reducers/shipping-reducers.mjs +0 -0
  84. /package/{esm2020 → esm2022}/shipping/selectors/shipping.selectors.mjs +0 -0
  85. /package/{esm2020 → esm2022}/testing/daffodil-checkout-testing.mjs +0 -0
  86. /package/{esm2020 → esm2022}/testing/index.mjs +0 -0
@@ -1,722 +0,0 @@
1
- import * as i0 from '@angular/core';
2
- import { Component, NgModule, Injectable, InjectionToken, Inject } from '@angular/core';
3
- import * as i1 from '@ngrx/store';
4
- import { createFeatureSelector, createSelector, select, StoreModule } from '@ngrx/store';
5
- import { CommonModule } from '@angular/common';
6
- import * as i1$1 from '@ngrx/effects';
7
- import { createEffect, ofType, EffectsModule } from '@ngrx/effects';
8
- import { of } from 'rxjs';
9
- import { switchMap, map, catchError } from 'rxjs/operators';
10
-
11
- var DaffShippingActionTypes;
12
- (function (DaffShippingActionTypes) {
13
- DaffShippingActionTypes["UpdateShippingAddressAction"] = "[Shipping] Update Shipping Address Action";
14
- DaffShippingActionTypes["SelectShippingOptionAction"] = "[Shipping] Select Shipping Option Action";
15
- })(DaffShippingActionTypes || (DaffShippingActionTypes = {}));
16
- class DaffUpdateShippingAddress {
17
- constructor(payload) {
18
- this.payload = payload;
19
- this.type = DaffShippingActionTypes.UpdateShippingAddressAction;
20
- }
21
- }
22
- class DaffSelectShippingOption {
23
- constructor(payload) {
24
- this.payload = payload;
25
- this.type = DaffShippingActionTypes.SelectShippingOptionAction;
26
- }
27
- }
28
-
29
- /**
30
- * Shipping Feature State
31
- */
32
- const selectShippingFeatureState = createFeatureSelector('shipping');
33
- /**
34
- * Shipping State
35
- */
36
- const selectShippingState = createSelector(selectShippingFeatureState, (state) => state.shipping);
37
- const selectShippingAddress = createSelector(selectShippingState, (state) => state.shippingAddress);
38
- const selectShippingOptionId = createSelector(selectShippingState, (state) => state.selectedShippingOptionId);
39
- const selectIsShippingAddressValid = createSelector(selectShippingAddress, (state) => !!state);
40
-
41
- class ShippingContainer {
42
- constructor(store) {
43
- this.store = store;
44
- }
45
- ngOnInit() {
46
- this.shippingAddress$ = this.store.pipe(select(selectShippingAddress));
47
- this.selectedShippingOptionId$ = this.store.pipe(select(selectShippingOptionId));
48
- this.isShippingAddressValid$ = this.store.pipe(select(selectIsShippingAddressValid));
49
- }
50
- updateShippingAddress(address) {
51
- this.store.dispatch(new DaffUpdateShippingAddress(address));
52
- }
53
- selectShippingOption(optionId) {
54
- this.store.dispatch(new DaffSelectShippingOption(optionId));
55
- }
56
- }
57
- /** @nocollapse */ ShippingContainer.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ShippingContainer, deps: [{ token: i1.Store }], target: i0.ɵɵFactoryTarget.Component });
58
- /** @nocollapse */ ShippingContainer.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: ShippingContainer, selector: "[shipping-container]", exportAs: ["ShippingContainer"], ngImport: i0, template: '<ng-content></ng-content>', isInline: true });
59
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ShippingContainer, decorators: [{
60
- type: Component,
61
- args: [{
62
- selector: '[shipping-container]',
63
- template: '<ng-content></ng-content>',
64
- exportAs: 'ShippingContainer',
65
- }]
66
- }], ctorParameters: function () { return [{ type: i1.Store }]; } });
67
-
68
- /**
69
- * Order Feature State
70
- *
71
- * @deprecated
72
- */
73
- const selectOrderFeatureState = createFeatureSelector('order');
74
- /**
75
- * Order State
76
- *
77
- * @deprecated
78
- */
79
- const selectOrderState = createSelector(selectOrderFeatureState, (state) => state.order);
80
- /**
81
- * @deprecated
82
- */
83
- const selectOrder = createSelector(selectOrderState, (state) => state.order);
84
- /**
85
- * @deprecated
86
- */
87
- const selectLoading = createSelector(selectOrderState, (state) => state.loading);
88
- /**
89
- * @deprecated
90
- */
91
- const selectErrors = createSelector(selectOrderState, (state) => state.errors);
92
-
93
- /**
94
- * @deprecated
95
- */
96
- class OrderContainer {
97
- constructor(store) {
98
- this.store = store;
99
- }
100
- ngOnInit() {
101
- this.order$ = this.store.pipe(select(selectOrder));
102
- this.loading$ = this.store.pipe(select(selectLoading));
103
- }
104
- }
105
- /** @nocollapse */ OrderContainer.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: OrderContainer, deps: [{ token: i1.Store }], target: i0.ɵɵFactoryTarget.Component });
106
- /** @nocollapse */ OrderContainer.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: OrderContainer, selector: "[order-container]", exportAs: ["OrderContainer"], ngImport: i0, template: '<ng-content></ng-content>', isInline: true });
107
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: OrderContainer, decorators: [{
108
- type: Component,
109
- args: [{
110
- selector: '[order-container]',
111
- template: '<ng-content></ng-content>',
112
- exportAs: 'OrderContainer',
113
- }]
114
- }], ctorParameters: function () { return [{ type: i1.Store }]; } });
115
-
116
- var DaffPaymentActionTypes;
117
- (function (DaffPaymentActionTypes) {
118
- DaffPaymentActionTypes["UpdatePaymentInfoAction"] = "[Payment] Update Payment Info Action";
119
- })(DaffPaymentActionTypes || (DaffPaymentActionTypes = {}));
120
- let DaffUpdatePaymentInfo$1 = class DaffUpdatePaymentInfo {
121
- constructor(payload) {
122
- this.payload = payload;
123
- this.type = DaffPaymentActionTypes.UpdatePaymentInfoAction;
124
- }
125
- };
126
-
127
- const initialState$3 = {
128
- paymentInfo: null,
129
- };
130
- function daffPaymentReducer(state = initialState$3, action) {
131
- switch (action.type) {
132
- case DaffPaymentActionTypes.UpdatePaymentInfoAction:
133
- return Object.assign(Object.assign({}, state), { paymentInfo: action.payload });
134
- default:
135
- return state;
136
- }
137
- }
138
-
139
- const daffPaymentReducers = {
140
- payment: daffPaymentReducer,
141
- };
142
-
143
- class DaffPaymentStateModule {
144
- }
145
- /** @nocollapse */ DaffPaymentStateModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffPaymentStateModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
146
- /** @nocollapse */ DaffPaymentStateModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.9", ngImport: i0, type: DaffPaymentStateModule, imports: [i1.StoreFeatureModule] });
147
- /** @nocollapse */ DaffPaymentStateModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffPaymentStateModule, imports: [StoreModule.forFeature('payment', daffPaymentReducers)] });
148
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffPaymentStateModule, decorators: [{
149
- type: NgModule,
150
- args: [{
151
- imports: [
152
- StoreModule.forFeature('payment', daffPaymentReducers),
153
- ],
154
- }]
155
- }] });
156
-
157
- class DaffPaymentModule {
158
- }
159
- /** @nocollapse */ DaffPaymentModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffPaymentModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
160
- /** @nocollapse */ DaffPaymentModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.9", ngImport: i0, type: DaffPaymentModule, imports: [CommonModule,
161
- /**
162
- * Ngrx/store
163
- */
164
- DaffPaymentStateModule] });
165
- /** @nocollapse */ DaffPaymentModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffPaymentModule, imports: [CommonModule,
166
- /**
167
- * Ngrx/store
168
- */
169
- DaffPaymentStateModule] });
170
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffPaymentModule, decorators: [{
171
- type: NgModule,
172
- args: [{
173
- imports: [
174
- CommonModule,
175
- /**
176
- * Ngrx/store
177
- */
178
- DaffPaymentStateModule,
179
- ],
180
- }]
181
- }] });
182
-
183
- /**
184
- * Payment Feature State
185
- */
186
- const selectPaymentFeatureState = createFeatureSelector('payment');
187
- /**
188
- * Payment State
189
- */
190
- const selectPaymentState = createSelector(selectPaymentFeatureState, (state) => state.payment);
191
- const selectPaymentInfo$1 = createSelector(selectPaymentState, (state) => state.paymentInfo);
192
-
193
- /**
194
- * A facade for accessing state for customer payment information.
195
- */
196
- class DaffPaymentFacade {
197
- constructor(store) {
198
- this.store = store;
199
- this.paymentInfo$ = this.store.pipe(select(selectPaymentInfo$1));
200
- }
201
- /**
202
- * Dispatches the given action.
203
- *
204
- * @param action action to dispatch.
205
- */
206
- dispatch(action) {
207
- this.store.dispatch(action);
208
- }
209
- }
210
- /** @nocollapse */ DaffPaymentFacade.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffPaymentFacade, deps: [{ token: i1.Store }], target: i0.ɵɵFactoryTarget.Injectable });
211
- /** @nocollapse */ DaffPaymentFacade.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffPaymentFacade, providedIn: DaffPaymentModule });
212
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffPaymentFacade, decorators: [{
213
- type: Injectable,
214
- args: [{
215
- providedIn: DaffPaymentModule,
216
- }]
217
- }], ctorParameters: function () { return [{ type: i1.Store }]; } });
218
-
219
- const DaffPaymentDriver = new InjectionToken('DaffPaymentDriver');
220
-
221
- const DaffOrderDriver = new InjectionToken('DaffOrderDriver');
222
-
223
- const DaffPaymentTransformer = new InjectionToken('DaffPaymentTransformer');
224
-
225
- var DaffBillingActionTypes;
226
- (function (DaffBillingActionTypes) {
227
- DaffBillingActionTypes["UpdateBillingAddressAction"] = "[Billing] Update Billing Address Action";
228
- DaffBillingActionTypes["UpdatePaymentInfoAction"] = "[Billing] Update Payment Info Action";
229
- DaffBillingActionTypes["ToggleBillingAddressIsShippingAddressAction"] = "[Billing] Billing Address Is Shipping Address Action";
230
- })(DaffBillingActionTypes || (DaffBillingActionTypes = {}));
231
- class DaffUpdateBillingAddress {
232
- constructor(payload) {
233
- this.payload = payload;
234
- this.type = DaffBillingActionTypes.UpdateBillingAddressAction;
235
- }
236
- }
237
- class DaffUpdatePaymentInfo {
238
- constructor(payload) {
239
- this.payload = payload;
240
- this.type = DaffBillingActionTypes.UpdatePaymentInfoAction;
241
- }
242
- }
243
- class DaffToggleBillingAddressIsShippingAddress {
244
- constructor() {
245
- this.type = DaffBillingActionTypes.ToggleBillingAddressIsShippingAddressAction;
246
- }
247
- }
248
-
249
- /**
250
- * Billing Feature State
251
- */
252
- const selectBillingFeatureState = createFeatureSelector('billing');
253
- /**
254
- * Billing State
255
- */
256
- const selectBillingState = createSelector(selectBillingFeatureState, (state) => state.billing);
257
- const selectBillingAddress = createSelector(selectBillingState, (state) => state.billingAddress);
258
- const selectBillingAddressIsShippingAddress = createSelector(selectBillingState, (state) => state.billingAddressIsShippingAddress);
259
- const selectPaymentInfo = createSelector(selectBillingState, (state) => state.paymentInfo);
260
-
261
- const initialState$2 = {
262
- billingAddress: null,
263
- billingAddressIsShippingAddress: false,
264
- paymentInfo: null,
265
- };
266
- function daffBillingReducer(state = initialState$2, action) {
267
- switch (action.type) {
268
- case DaffBillingActionTypes.UpdateBillingAddressAction:
269
- return Object.assign(Object.assign({}, state), { billingAddress: action.payload });
270
- case DaffBillingActionTypes.ToggleBillingAddressIsShippingAddressAction:
271
- return Object.assign(Object.assign({}, state), { billingAddress: null, billingAddressIsShippingAddress: !state.billingAddressIsShippingAddress });
272
- case DaffBillingActionTypes.UpdatePaymentInfoAction:
273
- return Object.assign(Object.assign({}, state), { paymentInfo: action.payload });
274
- default:
275
- return state;
276
- }
277
- }
278
-
279
- const daffBillingReducers = {
280
- billing: daffBillingReducer,
281
- };
282
-
283
- class DaffBillingStateModule {
284
- }
285
- /** @nocollapse */ DaffBillingStateModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffBillingStateModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
286
- /** @nocollapse */ DaffBillingStateModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.9", ngImport: i0, type: DaffBillingStateModule, imports: [i1.StoreFeatureModule] });
287
- /** @nocollapse */ DaffBillingStateModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffBillingStateModule, imports: [StoreModule.forFeature('billing', daffBillingReducers)] });
288
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffBillingStateModule, decorators: [{
289
- type: NgModule,
290
- args: [{
291
- imports: [
292
- StoreModule.forFeature('billing', daffBillingReducers),
293
- ],
294
- }]
295
- }] });
296
-
297
- class BillingContainer {
298
- constructor(store) {
299
- this.store = store;
300
- }
301
- ngOnInit() {
302
- this.billingAddress$ = this.store.pipe(select(selectBillingAddress));
303
- this.billingAddressIsShippingAddress$ = this.store.pipe(select(selectBillingAddressIsShippingAddress));
304
- this.paymentInfo$ = this.store.pipe(select(selectPaymentInfo));
305
- }
306
- updateBillingAddress(address) {
307
- this.store.dispatch(new DaffUpdateBillingAddress(address));
308
- }
309
- toggleBillingAddressIsShippingAddress() {
310
- this.store.dispatch(new DaffToggleBillingAddressIsShippingAddress());
311
- }
312
- updatePaymentInfo(info) {
313
- this.store.dispatch(new DaffUpdatePaymentInfo(info));
314
- }
315
- }
316
- /** @nocollapse */ BillingContainer.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: BillingContainer, deps: [{ token: i1.Store }], target: i0.ɵɵFactoryTarget.Component });
317
- /** @nocollapse */ BillingContainer.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: BillingContainer, selector: "[billing-container]", exportAs: ["BillingContainer"], ngImport: i0, template: '<ng-content></ng-content>', isInline: true });
318
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: BillingContainer, decorators: [{
319
- type: Component,
320
- args: [{
321
- selector: '[billing-container]',
322
- template: '<ng-content></ng-content>',
323
- exportAs: 'BillingContainer',
324
- }]
325
- }], ctorParameters: function () { return [{ type: i1.Store }]; } });
326
-
327
- class DaffBillingModule {
328
- }
329
- /** @nocollapse */ DaffBillingModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffBillingModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
330
- /** @nocollapse */ DaffBillingModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.9", ngImport: i0, type: DaffBillingModule, declarations: [BillingContainer], imports: [CommonModule,
331
- /**
332
- * Ngrx/store
333
- */
334
- DaffBillingStateModule], exports: [BillingContainer] });
335
- /** @nocollapse */ DaffBillingModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffBillingModule, imports: [CommonModule,
336
- /**
337
- * Ngrx/store
338
- */
339
- DaffBillingStateModule] });
340
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffBillingModule, decorators: [{
341
- type: NgModule,
342
- args: [{
343
- imports: [
344
- CommonModule,
345
- /**
346
- * Ngrx/store
347
- */
348
- DaffBillingStateModule,
349
- ],
350
- declarations: [
351
- BillingContainer,
352
- ],
353
- exports: [
354
- BillingContainer,
355
- ],
356
- }]
357
- }] });
358
-
359
- /**
360
- * A facade for accessing state for the billing information of a customer
361
- */
362
- class DaffBillingFacade {
363
- constructor(store) {
364
- this.store = store;
365
- this.billingAddress$ = this.store.pipe(select(selectBillingAddress));
366
- this.billingAddressIsShippingAddress$ = this.store.pipe(select(selectBillingAddressIsShippingAddress));
367
- this.paymentInfo$ = this.store.pipe(select(selectPaymentInfo));
368
- }
369
- /**
370
- * Dispatches the given action.
371
- *
372
- * @param action action to dispatch.
373
- */
374
- dispatch(action) {
375
- this.store.dispatch(action);
376
- }
377
- }
378
- /** @nocollapse */ DaffBillingFacade.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffBillingFacade, deps: [{ token: i1.Store }], target: i0.ɵɵFactoryTarget.Injectable });
379
- /** @nocollapse */ DaffBillingFacade.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffBillingFacade, providedIn: DaffBillingModule });
380
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffBillingFacade, decorators: [{
381
- type: Injectable,
382
- args: [{
383
- providedIn: DaffBillingModule,
384
- }]
385
- }], ctorParameters: function () { return [{ type: i1.Store }]; } });
386
-
387
- const initialState$1 = {
388
- shippingAddress: null,
389
- selectedShippingOptionId: null,
390
- };
391
- function daffShippingReducer(state = initialState$1, action) {
392
- switch (action.type) {
393
- case DaffShippingActionTypes.UpdateShippingAddressAction:
394
- return Object.assign(Object.assign({}, state), { shippingAddress: action.payload });
395
- case DaffShippingActionTypes.SelectShippingOptionAction:
396
- return Object.assign(Object.assign({}, state), { selectedShippingOptionId: action.payload });
397
- default:
398
- return state;
399
- }
400
- }
401
-
402
- const daffShippingReducers = {
403
- shipping: daffShippingReducer,
404
- };
405
-
406
- class DaffShippingStateModule {
407
- }
408
- /** @nocollapse */ DaffShippingStateModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffShippingStateModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
409
- /** @nocollapse */ DaffShippingStateModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.9", ngImport: i0, type: DaffShippingStateModule, imports: [i1.StoreFeatureModule] });
410
- /** @nocollapse */ DaffShippingStateModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffShippingStateModule, imports: [StoreModule.forFeature('shipping', daffShippingReducers)] });
411
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffShippingStateModule, decorators: [{
412
- type: NgModule,
413
- args: [{
414
- imports: [
415
- StoreModule.forFeature('shipping', daffShippingReducers),
416
- ],
417
- }]
418
- }] });
419
-
420
- class DaffShippingModule {
421
- }
422
- /** @nocollapse */ DaffShippingModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffShippingModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
423
- /** @nocollapse */ DaffShippingModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.9", ngImport: i0, type: DaffShippingModule, declarations: [ShippingContainer], imports: [CommonModule,
424
- /**
425
- * Ngrx/store
426
- */
427
- DaffShippingStateModule], exports: [ShippingContainer] });
428
- /** @nocollapse */ DaffShippingModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffShippingModule, imports: [CommonModule,
429
- /**
430
- * Ngrx/store
431
- */
432
- DaffShippingStateModule] });
433
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffShippingModule, decorators: [{
434
- type: NgModule,
435
- args: [{
436
- imports: [
437
- CommonModule,
438
- /**
439
- * Ngrx/store
440
- */
441
- DaffShippingStateModule,
442
- ],
443
- declarations: [
444
- ShippingContainer,
445
- ],
446
- exports: [
447
- ShippingContainer,
448
- ],
449
- }]
450
- }] });
451
-
452
- /**
453
- * A facade for accessing state for shipping information.
454
- */
455
- class DaffShippingFacade {
456
- constructor(store) {
457
- this.store = store;
458
- this.shippingAddress$ = this.store.pipe(select(selectShippingAddress));
459
- this.selectedShippingOptionId$ = this.store.pipe(select(selectShippingOptionId));
460
- this.isShippingAddressValid$ = this.store.pipe(select(selectIsShippingAddressValid));
461
- }
462
- /**
463
- * Dispatches the given action.
464
- *
465
- * @param action action to dispatch.
466
- */
467
- dispatch(action) {
468
- this.store.dispatch(action);
469
- }
470
- }
471
- /** @nocollapse */ DaffShippingFacade.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffShippingFacade, deps: [{ token: i1.Store }], target: i0.ɵɵFactoryTarget.Injectable });
472
- /** @nocollapse */ DaffShippingFacade.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffShippingFacade, providedIn: DaffShippingModule });
473
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffShippingFacade, decorators: [{
474
- type: Injectable,
475
- args: [{
476
- providedIn: DaffShippingModule,
477
- }]
478
- }], ctorParameters: function () { return [{ type: i1.Store }]; } });
479
-
480
- /**
481
- * @deprecated
482
- */
483
- var DaffOrderActionTypes;
484
- (function (DaffOrderActionTypes) {
485
- DaffOrderActionTypes["PlaceOrderAction"] = "[Order] Place Order Action";
486
- DaffOrderActionTypes["PlaceOrderSuccessAction"] = "[Order] Place Order Success Action";
487
- DaffOrderActionTypes["PlaceOrderFailureAction"] = "[Order] Place Order Failure Action";
488
- })(DaffOrderActionTypes || (DaffOrderActionTypes = {}));
489
- /**
490
- * @deprecated
491
- */
492
- var OrderActionTypes;
493
- (function (OrderActionTypes) {
494
- OrderActionTypes["PlaceOrderAction"] = "[Order] Place Order Action";
495
- OrderActionTypes["PlaceOrderSuccessAction"] = "[Order] Place Order Success Action";
496
- OrderActionTypes["PlaceOrderFailureAction"] = "[Order] Place Order Failure Action";
497
- })(OrderActionTypes || (OrderActionTypes = {}));
498
- /**
499
- * @deprecated
500
- */
501
- class PlaceOrder {
502
- constructor(payload) {
503
- this.payload = payload;
504
- this.type = DaffOrderActionTypes.PlaceOrderAction;
505
- }
506
- }
507
- /**
508
- * @deprecated
509
- */
510
- class DaffPlaceOrder {
511
- constructor(payload) {
512
- this.payload = payload;
513
- this.type = DaffOrderActionTypes.PlaceOrderAction;
514
- }
515
- }
516
- /**
517
- * @deprecated
518
- */
519
- class DaffPlaceOrderSuccess {
520
- constructor(payload) {
521
- this.payload = payload;
522
- this.type = DaffOrderActionTypes.PlaceOrderSuccessAction;
523
- }
524
- }
525
- /**
526
- * @deprecated
527
- */
528
- class DaffPlaceOrderFailure {
529
- constructor(payload) {
530
- this.payload = payload;
531
- this.type = DaffOrderActionTypes.PlaceOrderFailureAction;
532
- }
533
- }
534
-
535
- /**
536
- * @deprecated
537
- */
538
- const initialState = {
539
- order: null,
540
- loading: false,
541
- errors: [],
542
- };
543
- /**
544
- * @deprecated
545
- */
546
- function daffOrderReducer(state = initialState, action) {
547
- switch (action.type) {
548
- case DaffOrderActionTypes.PlaceOrderAction:
549
- return Object.assign(Object.assign({}, state), { loading: true });
550
- case DaffOrderActionTypes.PlaceOrderSuccessAction:
551
- return Object.assign(Object.assign({}, state), { order: action.payload, loading: false });
552
- case DaffOrderActionTypes.PlaceOrderFailureAction:
553
- return Object.assign(Object.assign({}, state), { errors: [action.payload], loading: false });
554
- default:
555
- return state;
556
- }
557
- }
558
-
559
- /**
560
- * @deprecated
561
- */
562
- const daffOrderReducers = {
563
- order: daffOrderReducer,
564
- };
565
-
566
- const DaffCheckoutDriver = new InjectionToken('DaffCheckoutDriver');
567
-
568
- /**
569
- * @deprecated
570
- */
571
- class OrderEffects {
572
- constructor(actions$, checkoutDriver) {
573
- this.actions$ = actions$;
574
- this.checkoutDriver = checkoutDriver;
575
- this.onPlaceOrder$ = createEffect(() => this.actions$.pipe(ofType(DaffOrderActionTypes.PlaceOrderAction), switchMap((action) => this.checkoutDriver.placeOrder(action.payload.id.toString())
576
- .pipe(map((resp) => new DaffPlaceOrderSuccess(resp)), catchError(error => of(new DaffPlaceOrderFailure('Failed to place order')))))));
577
- }
578
- }
579
- /** @nocollapse */ OrderEffects.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: OrderEffects, deps: [{ token: i1$1.Actions }, { token: DaffCheckoutDriver }], target: i0.ɵɵFactoryTarget.Injectable });
580
- /** @nocollapse */ OrderEffects.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: OrderEffects });
581
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: OrderEffects, decorators: [{
582
- type: Injectable
583
- }], ctorParameters: function () {
584
- return [{ type: i1$1.Actions }, { type: undefined, decorators: [{
585
- type: Inject,
586
- args: [DaffCheckoutDriver]
587
- }] }];
588
- } });
589
-
590
- /**
591
- * @deprecated
592
- */
593
- class DaffOrderStateModule {
594
- }
595
- /** @nocollapse */ DaffOrderStateModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffOrderStateModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
596
- /** @nocollapse */ DaffOrderStateModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.9", ngImport: i0, type: DaffOrderStateModule, imports: [i1.StoreFeatureModule, i1$1.EffectsFeatureModule] });
597
- /** @nocollapse */ DaffOrderStateModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffOrderStateModule, imports: [StoreModule.forFeature('order', daffOrderReducers),
598
- EffectsModule.forFeature([
599
- OrderEffects,
600
- ])] });
601
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffOrderStateModule, decorators: [{
602
- type: NgModule,
603
- args: [{
604
- imports: [
605
- StoreModule.forFeature('order', daffOrderReducers),
606
- EffectsModule.forFeature([
607
- OrderEffects,
608
- ]),
609
- ],
610
- }]
611
- }] });
612
-
613
- /**
614
- * @deprecated
615
- */
616
- class DaffOrderModule {
617
- }
618
- /** @nocollapse */ DaffOrderModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffOrderModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
619
- /** @nocollapse */ DaffOrderModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.9", ngImport: i0, type: DaffOrderModule, declarations: [OrderContainer], imports: [CommonModule,
620
- /**
621
- * Ngrx/store
622
- */
623
- DaffOrderStateModule], exports: [OrderContainer] });
624
- /** @nocollapse */ DaffOrderModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffOrderModule, imports: [CommonModule,
625
- /**
626
- * Ngrx/store
627
- */
628
- DaffOrderStateModule] });
629
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffOrderModule, decorators: [{
630
- type: NgModule,
631
- args: [{
632
- imports: [
633
- CommonModule,
634
- /**
635
- * Ngrx/store
636
- */
637
- DaffOrderStateModule,
638
- ],
639
- declarations: [
640
- OrderContainer,
641
- ],
642
- exports: [
643
- OrderContainer,
644
- ],
645
- }]
646
- }] });
647
-
648
- /**
649
- * A facade for accessing state for the currently selected category.
650
- */
651
- /**
652
- * @deprecated
653
- */
654
- class DaffOrderFacade {
655
- constructor(store) {
656
- this.store = store;
657
- this.order$ = this.store.pipe(select(selectOrder));
658
- this.loading$ = this.store.pipe(select(selectLoading));
659
- this.errors$ = this.store.pipe(select(selectErrors));
660
- }
661
- /**
662
- * Dispatches the given action.
663
- *
664
- * @param action action to dispatch.
665
- */
666
- dispatch(action) {
667
- this.store.dispatch(action);
668
- }
669
- }
670
- /** @nocollapse */ DaffOrderFacade.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffOrderFacade, deps: [{ token: i1.Store }], target: i0.ɵɵFactoryTarget.Injectable });
671
- /** @nocollapse */ DaffOrderFacade.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffOrderFacade, providedIn: DaffOrderModule });
672
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffOrderFacade, decorators: [{
673
- type: Injectable,
674
- args: [{
675
- providedIn: DaffOrderModule,
676
- }]
677
- }], ctorParameters: function () { return [{ type: i1.Store }]; } });
678
-
679
- class StateCheckoutModule {
680
- }
681
- /** @nocollapse */ StateCheckoutModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: StateCheckoutModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
682
- /** @nocollapse */ StateCheckoutModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.9", ngImport: i0, type: StateCheckoutModule, imports: [CommonModule,
683
- DaffShippingModule,
684
- DaffPaymentModule,
685
- DaffBillingModule,
686
- DaffOrderModule], exports: [DaffShippingModule,
687
- DaffPaymentModule,
688
- DaffBillingModule,
689
- DaffOrderModule] });
690
- /** @nocollapse */ StateCheckoutModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: StateCheckoutModule, imports: [CommonModule,
691
- DaffShippingModule,
692
- DaffPaymentModule,
693
- DaffBillingModule,
694
- DaffOrderModule, DaffShippingModule,
695
- DaffPaymentModule,
696
- DaffBillingModule,
697
- DaffOrderModule] });
698
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: StateCheckoutModule, decorators: [{
699
- type: NgModule,
700
- args: [{
701
- imports: [
702
- CommonModule,
703
- DaffShippingModule,
704
- DaffPaymentModule,
705
- DaffBillingModule,
706
- DaffOrderModule,
707
- ],
708
- exports: [
709
- DaffShippingModule,
710
- DaffPaymentModule,
711
- DaffBillingModule,
712
- DaffOrderModule,
713
- ],
714
- }]
715
- }] });
716
-
717
- /**
718
- * Generated bundle index. Do not edit.
719
- */
720
-
721
- export { BillingContainer, DaffBillingActionTypes, DaffBillingFacade, DaffBillingModule, DaffCheckoutDriver, DaffOrderActionTypes, DaffOrderDriver, DaffOrderFacade, DaffOrderModule, DaffPaymentActionTypes, DaffPaymentDriver, DaffPaymentFacade, DaffPaymentModule, DaffPaymentTransformer, DaffPlaceOrder, DaffPlaceOrderFailure, DaffPlaceOrderSuccess, DaffSelectShippingOption, DaffShippingActionTypes, DaffShippingFacade, DaffShippingModule, DaffToggleBillingAddressIsShippingAddress, DaffUpdateBillingAddress, DaffUpdatePaymentInfo$1 as DaffUpdatePaymentInfo, DaffUpdateShippingAddress, OrderActionTypes, OrderContainer, PlaceOrder, ShippingContainer, StateCheckoutModule, daffBillingReducer, daffBillingReducers, daffOrderReducer, daffOrderReducers, daffPaymentReducers, daffShippingReducer, daffShippingReducers, selectBillingAddress, selectBillingAddressIsShippingAddress, selectBillingFeatureState, selectBillingState, selectErrors, selectIsShippingAddressValid, selectLoading, selectOrder, selectOrderFeatureState, selectOrderState, selectPaymentFeatureState, selectPaymentInfo$1 as selectPaymentInfo, selectPaymentState, selectShippingAddress, selectShippingFeatureState, selectShippingOptionId, selectShippingState };
722
- //# sourceMappingURL=daffodil-checkout.mjs.map