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