@open-tender/store 1.0.7 → 1.0.8
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/dist/cjs/slices/order.d.ts +53 -1
- package/dist/cjs/slices/order.js +19 -5
- package/dist/esm/slices/order.d.ts +53 -1
- package/dist/esm/slices/order.js +19 -4
- package/package.json +1 -1
|
@@ -173,9 +173,61 @@ export declare const selectCartTotal: ((state: {
|
|
|
173
173
|
argsMemoize: typeof import("reselect").weakMapMemoize;
|
|
174
174
|
memoize: typeof import("reselect").weakMapMemoize;
|
|
175
175
|
};
|
|
176
|
-
export declare const selectCartTotals: (state:
|
|
176
|
+
export declare const selectCartTotals: ((state: {
|
|
177
|
+
alerts: import("..").Alerts;
|
|
178
|
+
arrivals: import("./arrivals").ArrivalsState;
|
|
179
|
+
cartSummary: import("./cartSummary").CartSummaryState;
|
|
180
|
+
checkout: import("./checkout").CheckoutState;
|
|
181
|
+
config: import("./config").ConfigState;
|
|
182
|
+
discounts: import("./discounts").DiscountsState;
|
|
183
|
+
errorAlerts: import("./errorAlerts").ErrorAlertsState;
|
|
184
|
+
kds: import("./kds").KdsState;
|
|
185
|
+
kiosk: import("./kiosk").KioskState;
|
|
186
|
+
menu: import("./menu").MenuState;
|
|
187
|
+
menuPages: import("./menuPages").MenuPagesState;
|
|
188
|
+
modal: import("./modal").ModalState;
|
|
189
|
+
notifications: import("..").Notifications;
|
|
190
|
+
offlineAuths: import("./offlineAuths").OfflineAuthsState;
|
|
191
|
+
order: OrderState;
|
|
192
|
+
pos: import("./pos").PosState;
|
|
193
|
+
punches: import("./punches").PunchesState;
|
|
194
|
+
refund: import("./refund").RefundState;
|
|
195
|
+
settings: import("./settings").SettingsState;
|
|
196
|
+
sidebar: import("./sidebar").SidebarState;
|
|
197
|
+
surcharges: import("./surcharges").SurchargesState;
|
|
198
|
+
taxes: import("./taxes").TaxesState;
|
|
199
|
+
}) => {
|
|
177
200
|
count: number;
|
|
178
201
|
total: number;
|
|
202
|
+
}) & {
|
|
203
|
+
clearCache: () => void;
|
|
204
|
+
resultsCount: () => number;
|
|
205
|
+
resetResultsCount: () => void;
|
|
206
|
+
} & {
|
|
207
|
+
resultFunc: (resultFuncArgs_0: Cart) => {
|
|
208
|
+
count: number;
|
|
209
|
+
total: number;
|
|
210
|
+
};
|
|
211
|
+
memoizedResultFunc: ((resultFuncArgs_0: Cart) => {
|
|
212
|
+
count: number;
|
|
213
|
+
total: number;
|
|
214
|
+
}) & {
|
|
215
|
+
clearCache: () => void;
|
|
216
|
+
resultsCount: () => number;
|
|
217
|
+
resetResultsCount: () => void;
|
|
218
|
+
};
|
|
219
|
+
lastResult: () => {
|
|
220
|
+
count: number;
|
|
221
|
+
total: number;
|
|
222
|
+
};
|
|
223
|
+
dependencies: [(state: AppState) => Cart];
|
|
224
|
+
recomputations: () => number;
|
|
225
|
+
resetRecomputations: () => void;
|
|
226
|
+
dependencyRecomputations: () => number;
|
|
227
|
+
resetDependencyRecomputations: () => void;
|
|
228
|
+
} & {
|
|
229
|
+
argsMemoize: typeof import("reselect").weakMapMemoize;
|
|
230
|
+
memoize: typeof import("reselect").weakMapMemoize;
|
|
179
231
|
};
|
|
180
232
|
export declare const selectCartCounts: (state: AppState) => CartCounts;
|
|
181
233
|
export declare const selectCanOrder: (state: AppState) => 0 | RequestedAt | null;
|
package/dist/cjs/slices/order.js
CHANGED
|
@@ -222,12 +222,26 @@ exports.selectCartTotal = (0, toolkit_1.createSelector)(function (state) {
|
|
|
222
222
|
return 0.0;
|
|
223
223
|
return cart.reduce(function (t, i) { return (t += i.totalPrice || 0); }, 0.0);
|
|
224
224
|
});
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
225
|
+
// export const selectCartTotals = createSelector(
|
|
226
|
+
// (state: AppState) => {
|
|
227
|
+
// const count = selectCartQuantity(state)
|
|
228
|
+
// const total = selectCartTotal(state)
|
|
229
|
+
// return { count, total }
|
|
230
|
+
// },
|
|
231
|
+
// ({ count, total }) => {
|
|
232
|
+
// return { count, total }
|
|
233
|
+
// }
|
|
234
|
+
// )
|
|
235
|
+
exports.selectCartTotals = (0, toolkit_1.createSelector)(function (state) {
|
|
236
|
+
var cart = state.order.cart;
|
|
237
|
+
return cart;
|
|
238
|
+
}, function (cart) {
|
|
239
|
+
if (!cart)
|
|
240
|
+
return { count: 0, total: 0.0 };
|
|
241
|
+
var count = cart.reduce(function (t, i) { return (t += i.quantity); }, 0);
|
|
242
|
+
var total = cart.reduce(function (t, i) { return (t += i.totalPrice || 0); }, 0.0);
|
|
228
243
|
return { count: count, total: total };
|
|
229
|
-
};
|
|
230
|
-
exports.selectCartTotals = selectCartTotals;
|
|
244
|
+
});
|
|
231
245
|
var selectCartCounts = function (state) {
|
|
232
246
|
return state.order.cartCounts || {};
|
|
233
247
|
};
|
|
@@ -173,9 +173,61 @@ export declare const selectCartTotal: ((state: {
|
|
|
173
173
|
argsMemoize: typeof import("reselect").weakMapMemoize;
|
|
174
174
|
memoize: typeof import("reselect").weakMapMemoize;
|
|
175
175
|
};
|
|
176
|
-
export declare const selectCartTotals: (state:
|
|
176
|
+
export declare const selectCartTotals: ((state: {
|
|
177
|
+
alerts: import("..").Alerts;
|
|
178
|
+
arrivals: import("./arrivals").ArrivalsState;
|
|
179
|
+
cartSummary: import("./cartSummary").CartSummaryState;
|
|
180
|
+
checkout: import("./checkout").CheckoutState;
|
|
181
|
+
config: import("./config").ConfigState;
|
|
182
|
+
discounts: import("./discounts").DiscountsState;
|
|
183
|
+
errorAlerts: import("./errorAlerts").ErrorAlertsState;
|
|
184
|
+
kds: import("./kds").KdsState;
|
|
185
|
+
kiosk: import("./kiosk").KioskState;
|
|
186
|
+
menu: import("./menu").MenuState;
|
|
187
|
+
menuPages: import("./menuPages").MenuPagesState;
|
|
188
|
+
modal: import("./modal").ModalState;
|
|
189
|
+
notifications: import("..").Notifications;
|
|
190
|
+
offlineAuths: import("./offlineAuths").OfflineAuthsState;
|
|
191
|
+
order: OrderState;
|
|
192
|
+
pos: import("./pos").PosState;
|
|
193
|
+
punches: import("./punches").PunchesState;
|
|
194
|
+
refund: import("./refund").RefundState;
|
|
195
|
+
settings: import("./settings").SettingsState;
|
|
196
|
+
sidebar: import("./sidebar").SidebarState;
|
|
197
|
+
surcharges: import("./surcharges").SurchargesState;
|
|
198
|
+
taxes: import("./taxes").TaxesState;
|
|
199
|
+
}) => {
|
|
177
200
|
count: number;
|
|
178
201
|
total: number;
|
|
202
|
+
}) & {
|
|
203
|
+
clearCache: () => void;
|
|
204
|
+
resultsCount: () => number;
|
|
205
|
+
resetResultsCount: () => void;
|
|
206
|
+
} & {
|
|
207
|
+
resultFunc: (resultFuncArgs_0: Cart) => {
|
|
208
|
+
count: number;
|
|
209
|
+
total: number;
|
|
210
|
+
};
|
|
211
|
+
memoizedResultFunc: ((resultFuncArgs_0: Cart) => {
|
|
212
|
+
count: number;
|
|
213
|
+
total: number;
|
|
214
|
+
}) & {
|
|
215
|
+
clearCache: () => void;
|
|
216
|
+
resultsCount: () => number;
|
|
217
|
+
resetResultsCount: () => void;
|
|
218
|
+
};
|
|
219
|
+
lastResult: () => {
|
|
220
|
+
count: number;
|
|
221
|
+
total: number;
|
|
222
|
+
};
|
|
223
|
+
dependencies: [(state: AppState) => Cart];
|
|
224
|
+
recomputations: () => number;
|
|
225
|
+
resetRecomputations: () => void;
|
|
226
|
+
dependencyRecomputations: () => number;
|
|
227
|
+
resetDependencyRecomputations: () => void;
|
|
228
|
+
} & {
|
|
229
|
+
argsMemoize: typeof import("reselect").weakMapMemoize;
|
|
230
|
+
memoize: typeof import("reselect").weakMapMemoize;
|
|
179
231
|
};
|
|
180
232
|
export declare const selectCartCounts: (state: AppState) => CartCounts;
|
|
181
233
|
export declare const selectCanOrder: (state: AppState) => 0 | RequestedAt | null;
|
package/dist/esm/slices/order.js
CHANGED
|
@@ -203,11 +203,26 @@ export var selectCartTotal = createSelector(function (state) {
|
|
|
203
203
|
return 0.0;
|
|
204
204
|
return cart.reduce(function (t, i) { return (t += i.totalPrice || 0); }, 0.0);
|
|
205
205
|
});
|
|
206
|
-
export
|
|
207
|
-
|
|
208
|
-
|
|
206
|
+
// export const selectCartTotals = createSelector(
|
|
207
|
+
// (state: AppState) => {
|
|
208
|
+
// const count = selectCartQuantity(state)
|
|
209
|
+
// const total = selectCartTotal(state)
|
|
210
|
+
// return { count, total }
|
|
211
|
+
// },
|
|
212
|
+
// ({ count, total }) => {
|
|
213
|
+
// return { count, total }
|
|
214
|
+
// }
|
|
215
|
+
// )
|
|
216
|
+
export var selectCartTotals = createSelector(function (state) {
|
|
217
|
+
var cart = state.order.cart;
|
|
218
|
+
return cart;
|
|
219
|
+
}, function (cart) {
|
|
220
|
+
if (!cart)
|
|
221
|
+
return { count: 0, total: 0.0 };
|
|
222
|
+
var count = cart.reduce(function (t, i) { return (t += i.quantity); }, 0);
|
|
223
|
+
var total = cart.reduce(function (t, i) { return (t += i.totalPrice || 0); }, 0.0);
|
|
209
224
|
return { count: count, total: total };
|
|
210
|
-
};
|
|
225
|
+
});
|
|
211
226
|
export var selectCartCounts = function (state) {
|
|
212
227
|
return state.order.cartCounts || {};
|
|
213
228
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@open-tender/store",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.8",
|
|
4
4
|
"description": "A library of hooks, reducers, utility functions, and types for use with Open Tender applications that utilize our in-store POS API",
|
|
5
5
|
"main": "./dist/cjs/index.js",
|
|
6
6
|
"module": "./dist/esm/index.js",
|