@open-tender/store 1.0.5 → 1.0.7
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/kiosk.d.ts +44 -1
- package/dist/cjs/slices/kiosk.js +7 -2
- package/dist/cjs/slices/order.d.ts +132 -3
- package/dist/cjs/slices/order.js +24 -16
- package/dist/esm/slices/kiosk.d.ts +44 -1
- package/dist/esm/slices/kiosk.js +7 -1
- package/dist/esm/slices/order.d.ts +132 -3
- package/dist/esm/slices/order.js +25 -14
- package/package.json +1 -1
- package/dist/.DS_Store +0 -0
|
@@ -41,7 +41,50 @@ export declare const selectKiosk: (state: AppState) => KioskState;
|
|
|
41
41
|
export declare const selectKioskVersion: (state: AppState) => string | null | undefined;
|
|
42
42
|
export declare const selectKioskStore: (state: AppState) => Store | null;
|
|
43
43
|
export declare const selectKioskBrand: (state: AppState) => KioskBrand | null;
|
|
44
|
-
export declare const selectKioskConfig: (state:
|
|
44
|
+
export declare const selectKioskConfig: ((state: {
|
|
45
|
+
alerts: import("../types").Alerts;
|
|
46
|
+
arrivals: import("./arrivals").ArrivalsState;
|
|
47
|
+
cartSummary: import("./cartSummary").CartSummaryState;
|
|
48
|
+
checkout: import("./checkout").CheckoutState;
|
|
49
|
+
config: import("./config").ConfigState;
|
|
50
|
+
discounts: import("./discounts").DiscountsState;
|
|
51
|
+
errorAlerts: import("./errorAlerts").ErrorAlertsState;
|
|
52
|
+
kds: import("./kds").KdsState;
|
|
53
|
+
kiosk: KioskState;
|
|
54
|
+
menu: import("./menu").MenuState;
|
|
55
|
+
menuPages: import("./menuPages").MenuPagesState;
|
|
56
|
+
modal: import("./modal").ModalState;
|
|
57
|
+
notifications: import("../types").Notifications;
|
|
58
|
+
offlineAuths: import("./offlineAuths").OfflineAuthsState;
|
|
59
|
+
order: import("./order").OrderState;
|
|
60
|
+
pos: import("./pos").PosState;
|
|
61
|
+
punches: import("./punches").PunchesState;
|
|
62
|
+
refund: import("./refund").RefundState;
|
|
63
|
+
settings: import("./settings").SettingsState;
|
|
64
|
+
sidebar: import("./sidebar").SidebarState;
|
|
65
|
+
surcharges: import("./surcharges").SurchargesState;
|
|
66
|
+
taxes: import("./taxes").TaxesState;
|
|
67
|
+
}) => AppConfig) & {
|
|
68
|
+
clearCache: () => void;
|
|
69
|
+
resultsCount: () => number;
|
|
70
|
+
resetResultsCount: () => void;
|
|
71
|
+
} & {
|
|
72
|
+
resultFunc: (resultFuncArgs_0: AppConfig | null) => AppConfig;
|
|
73
|
+
memoizedResultFunc: ((resultFuncArgs_0: AppConfig | null) => AppConfig) & {
|
|
74
|
+
clearCache: () => void;
|
|
75
|
+
resultsCount: () => number;
|
|
76
|
+
resetResultsCount: () => void;
|
|
77
|
+
};
|
|
78
|
+
lastResult: () => AppConfig;
|
|
79
|
+
dependencies: [(state: AppState) => AppConfig | null];
|
|
80
|
+
recomputations: () => number;
|
|
81
|
+
resetRecomputations: () => void;
|
|
82
|
+
dependencyRecomputations: () => number;
|
|
83
|
+
resetDependencyRecomputations: () => void;
|
|
84
|
+
} & {
|
|
85
|
+
argsMemoize: typeof import("reselect").weakMapMemoize;
|
|
86
|
+
memoize: typeof import("reselect").weakMapMemoize;
|
|
87
|
+
};
|
|
45
88
|
export declare const selectKioskConfigScreen: (screen: string) => ((state: {
|
|
46
89
|
alerts: import("../types").Alerts;
|
|
47
90
|
arrivals: import("./arrivals").ArrivalsState;
|
package/dist/cjs/slices/kiosk.js
CHANGED
|
@@ -141,8 +141,13 @@ var selectKioskStore = function (state) { return state.kiosk.store; };
|
|
|
141
141
|
exports.selectKioskStore = selectKioskStore;
|
|
142
142
|
var selectKioskBrand = function (state) { return state.kiosk.brand; };
|
|
143
143
|
exports.selectKioskBrand = selectKioskBrand;
|
|
144
|
-
|
|
145
|
-
exports.selectKioskConfig =
|
|
144
|
+
// export const selectKioskConfig = (state: AppState) => state.kiosk.config || {}
|
|
145
|
+
exports.selectKioskConfig = (0, toolkit_1.createSelector)(function (state) {
|
|
146
|
+
var config = state.kiosk.config;
|
|
147
|
+
return config;
|
|
148
|
+
}, function (config) {
|
|
149
|
+
return (config || {});
|
|
150
|
+
});
|
|
146
151
|
var selectKioskConfigScreen = function (screen) {
|
|
147
152
|
return (0, toolkit_1.createSelector)(function (state) {
|
|
148
153
|
var config = state.kiosk.config;
|
|
@@ -41,9 +41,138 @@ export declare const selectCurrentVendor: (state: AppState) => MenuRevenueCenter
|
|
|
41
41
|
export declare const selectCurrentCategory: (state: AppState) => MenuCategory | null;
|
|
42
42
|
export declare const selectCurrentItem: (state: AppState) => CartItem | null;
|
|
43
43
|
export declare const selectCart: (state: AppState) => Cart;
|
|
44
|
-
export declare const selectCartIds: (state:
|
|
45
|
-
|
|
46
|
-
|
|
44
|
+
export declare const selectCartIds: ((state: {
|
|
45
|
+
alerts: import("..").Alerts;
|
|
46
|
+
arrivals: import("./arrivals").ArrivalsState;
|
|
47
|
+
cartSummary: import("./cartSummary").CartSummaryState;
|
|
48
|
+
checkout: import("./checkout").CheckoutState;
|
|
49
|
+
config: import("./config").ConfigState;
|
|
50
|
+
discounts: import("./discounts").DiscountsState;
|
|
51
|
+
errorAlerts: import("./errorAlerts").ErrorAlertsState;
|
|
52
|
+
kds: import("./kds").KdsState;
|
|
53
|
+
kiosk: import("./kiosk").KioskState;
|
|
54
|
+
menu: import("./menu").MenuState;
|
|
55
|
+
menuPages: import("./menuPages").MenuPagesState;
|
|
56
|
+
modal: import("./modal").ModalState;
|
|
57
|
+
notifications: import("..").Notifications;
|
|
58
|
+
offlineAuths: import("./offlineAuths").OfflineAuthsState;
|
|
59
|
+
order: OrderState;
|
|
60
|
+
pos: import("./pos").PosState;
|
|
61
|
+
punches: import("./punches").PunchesState;
|
|
62
|
+
refund: import("./refund").RefundState;
|
|
63
|
+
settings: import("./settings").SettingsState;
|
|
64
|
+
sidebar: import("./sidebar").SidebarState;
|
|
65
|
+
surcharges: import("./surcharges").SurchargesState;
|
|
66
|
+
taxes: import("./taxes").TaxesState;
|
|
67
|
+
}) => number[]) & {
|
|
68
|
+
clearCache: () => void;
|
|
69
|
+
resultsCount: () => number;
|
|
70
|
+
resetResultsCount: () => void;
|
|
71
|
+
} & {
|
|
72
|
+
resultFunc: (resultFuncArgs_0: Cart) => number[];
|
|
73
|
+
memoizedResultFunc: ((resultFuncArgs_0: Cart) => number[]) & {
|
|
74
|
+
clearCache: () => void;
|
|
75
|
+
resultsCount: () => number;
|
|
76
|
+
resetResultsCount: () => void;
|
|
77
|
+
};
|
|
78
|
+
lastResult: () => number[];
|
|
79
|
+
dependencies: [(state: AppState) => Cart];
|
|
80
|
+
recomputations: () => number;
|
|
81
|
+
resetRecomputations: () => void;
|
|
82
|
+
dependencyRecomputations: () => number;
|
|
83
|
+
resetDependencyRecomputations: () => void;
|
|
84
|
+
} & {
|
|
85
|
+
argsMemoize: typeof import("reselect").weakMapMemoize;
|
|
86
|
+
memoize: typeof import("reselect").weakMapMemoize;
|
|
87
|
+
};
|
|
88
|
+
export declare const selectCartQuantity: ((state: {
|
|
89
|
+
alerts: import("..").Alerts;
|
|
90
|
+
arrivals: import("./arrivals").ArrivalsState;
|
|
91
|
+
cartSummary: import("./cartSummary").CartSummaryState;
|
|
92
|
+
checkout: import("./checkout").CheckoutState;
|
|
93
|
+
config: import("./config").ConfigState;
|
|
94
|
+
discounts: import("./discounts").DiscountsState;
|
|
95
|
+
errorAlerts: import("./errorAlerts").ErrorAlertsState;
|
|
96
|
+
kds: import("./kds").KdsState;
|
|
97
|
+
kiosk: import("./kiosk").KioskState;
|
|
98
|
+
menu: import("./menu").MenuState;
|
|
99
|
+
menuPages: import("./menuPages").MenuPagesState;
|
|
100
|
+
modal: import("./modal").ModalState;
|
|
101
|
+
notifications: import("..").Notifications;
|
|
102
|
+
offlineAuths: import("./offlineAuths").OfflineAuthsState;
|
|
103
|
+
order: OrderState;
|
|
104
|
+
pos: import("./pos").PosState;
|
|
105
|
+
punches: import("./punches").PunchesState;
|
|
106
|
+
refund: import("./refund").RefundState;
|
|
107
|
+
settings: import("./settings").SettingsState;
|
|
108
|
+
sidebar: import("./sidebar").SidebarState;
|
|
109
|
+
surcharges: import("./surcharges").SurchargesState;
|
|
110
|
+
taxes: import("./taxes").TaxesState;
|
|
111
|
+
}) => number) & {
|
|
112
|
+
clearCache: () => void;
|
|
113
|
+
resultsCount: () => number;
|
|
114
|
+
resetResultsCount: () => void;
|
|
115
|
+
} & {
|
|
116
|
+
resultFunc: (resultFuncArgs_0: Cart) => number;
|
|
117
|
+
memoizedResultFunc: ((resultFuncArgs_0: Cart) => number) & {
|
|
118
|
+
clearCache: () => void;
|
|
119
|
+
resultsCount: () => number;
|
|
120
|
+
resetResultsCount: () => void;
|
|
121
|
+
};
|
|
122
|
+
lastResult: () => number;
|
|
123
|
+
dependencies: [(state: AppState) => Cart];
|
|
124
|
+
recomputations: () => number;
|
|
125
|
+
resetRecomputations: () => void;
|
|
126
|
+
dependencyRecomputations: () => number;
|
|
127
|
+
resetDependencyRecomputations: () => void;
|
|
128
|
+
} & {
|
|
129
|
+
argsMemoize: typeof import("reselect").weakMapMemoize;
|
|
130
|
+
memoize: typeof import("reselect").weakMapMemoize;
|
|
131
|
+
};
|
|
132
|
+
export declare const selectCartTotal: ((state: {
|
|
133
|
+
alerts: import("..").Alerts;
|
|
134
|
+
arrivals: import("./arrivals").ArrivalsState;
|
|
135
|
+
cartSummary: import("./cartSummary").CartSummaryState;
|
|
136
|
+
checkout: import("./checkout").CheckoutState;
|
|
137
|
+
config: import("./config").ConfigState;
|
|
138
|
+
discounts: import("./discounts").DiscountsState;
|
|
139
|
+
errorAlerts: import("./errorAlerts").ErrorAlertsState;
|
|
140
|
+
kds: import("./kds").KdsState;
|
|
141
|
+
kiosk: import("./kiosk").KioskState;
|
|
142
|
+
menu: import("./menu").MenuState;
|
|
143
|
+
menuPages: import("./menuPages").MenuPagesState;
|
|
144
|
+
modal: import("./modal").ModalState;
|
|
145
|
+
notifications: import("..").Notifications;
|
|
146
|
+
offlineAuths: import("./offlineAuths").OfflineAuthsState;
|
|
147
|
+
order: OrderState;
|
|
148
|
+
pos: import("./pos").PosState;
|
|
149
|
+
punches: import("./punches").PunchesState;
|
|
150
|
+
refund: import("./refund").RefundState;
|
|
151
|
+
settings: import("./settings").SettingsState;
|
|
152
|
+
sidebar: import("./sidebar").SidebarState;
|
|
153
|
+
surcharges: import("./surcharges").SurchargesState;
|
|
154
|
+
taxes: import("./taxes").TaxesState;
|
|
155
|
+
}) => number) & {
|
|
156
|
+
clearCache: () => void;
|
|
157
|
+
resultsCount: () => number;
|
|
158
|
+
resetResultsCount: () => void;
|
|
159
|
+
} & {
|
|
160
|
+
resultFunc: (resultFuncArgs_0: Cart) => number;
|
|
161
|
+
memoizedResultFunc: ((resultFuncArgs_0: Cart) => number) & {
|
|
162
|
+
clearCache: () => void;
|
|
163
|
+
resultsCount: () => number;
|
|
164
|
+
resetResultsCount: () => void;
|
|
165
|
+
};
|
|
166
|
+
lastResult: () => number;
|
|
167
|
+
dependencies: [(state: AppState) => Cart];
|
|
168
|
+
recomputations: () => number;
|
|
169
|
+
resetRecomputations: () => void;
|
|
170
|
+
dependencyRecomputations: () => number;
|
|
171
|
+
resetDependencyRecomputations: () => void;
|
|
172
|
+
} & {
|
|
173
|
+
argsMemoize: typeof import("reselect").weakMapMemoize;
|
|
174
|
+
memoize: typeof import("reselect").weakMapMemoize;
|
|
175
|
+
};
|
|
47
176
|
export declare const selectCartTotals: (state: AppState) => {
|
|
48
177
|
count: number;
|
|
49
178
|
total: number;
|
package/dist/cjs/slices/order.js
CHANGED
|
@@ -198,22 +198,30 @@ var selectCurrentItem = function (state) { return state.order.currentItem; };
|
|
|
198
198
|
exports.selectCurrentItem = selectCurrentItem;
|
|
199
199
|
var selectCart = function (state) { return state.order.cart; };
|
|
200
200
|
exports.selectCart = selectCart;
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
};
|
|
216
|
-
|
|
201
|
+
exports.selectCartIds = (0, toolkit_1.createSelector)(function (state) {
|
|
202
|
+
var cart = state.order.cart;
|
|
203
|
+
return cart;
|
|
204
|
+
}, function (cart) {
|
|
205
|
+
if (!cart)
|
|
206
|
+
return [];
|
|
207
|
+
return cart.map(function (i) { return i.id; });
|
|
208
|
+
});
|
|
209
|
+
exports.selectCartQuantity = (0, toolkit_1.createSelector)(function (state) {
|
|
210
|
+
var cart = state.order.cart;
|
|
211
|
+
return cart;
|
|
212
|
+
}, function (cart) {
|
|
213
|
+
if (!cart)
|
|
214
|
+
return 0;
|
|
215
|
+
return cart.reduce(function (t, i) { return (t += i.quantity); }, 0);
|
|
216
|
+
});
|
|
217
|
+
exports.selectCartTotal = (0, toolkit_1.createSelector)(function (state) {
|
|
218
|
+
var cart = state.order.cart;
|
|
219
|
+
return cart;
|
|
220
|
+
}, function (cart) {
|
|
221
|
+
if (!cart)
|
|
222
|
+
return 0.0;
|
|
223
|
+
return cart.reduce(function (t, i) { return (t += i.totalPrice || 0); }, 0.0);
|
|
224
|
+
});
|
|
217
225
|
var selectCartTotals = function (state) {
|
|
218
226
|
var count = (0, exports.selectCartQuantity)(state);
|
|
219
227
|
var total = (0, exports.selectCartTotal)(state);
|
|
@@ -41,7 +41,50 @@ export declare const selectKiosk: (state: AppState) => KioskState;
|
|
|
41
41
|
export declare const selectKioskVersion: (state: AppState) => string | null | undefined;
|
|
42
42
|
export declare const selectKioskStore: (state: AppState) => Store | null;
|
|
43
43
|
export declare const selectKioskBrand: (state: AppState) => KioskBrand | null;
|
|
44
|
-
export declare const selectKioskConfig: (state:
|
|
44
|
+
export declare const selectKioskConfig: ((state: {
|
|
45
|
+
alerts: import("../types").Alerts;
|
|
46
|
+
arrivals: import("./arrivals").ArrivalsState;
|
|
47
|
+
cartSummary: import("./cartSummary").CartSummaryState;
|
|
48
|
+
checkout: import("./checkout").CheckoutState;
|
|
49
|
+
config: import("./config").ConfigState;
|
|
50
|
+
discounts: import("./discounts").DiscountsState;
|
|
51
|
+
errorAlerts: import("./errorAlerts").ErrorAlertsState;
|
|
52
|
+
kds: import("./kds").KdsState;
|
|
53
|
+
kiosk: KioskState;
|
|
54
|
+
menu: import("./menu").MenuState;
|
|
55
|
+
menuPages: import("./menuPages").MenuPagesState;
|
|
56
|
+
modal: import("./modal").ModalState;
|
|
57
|
+
notifications: import("../types").Notifications;
|
|
58
|
+
offlineAuths: import("./offlineAuths").OfflineAuthsState;
|
|
59
|
+
order: import("./order").OrderState;
|
|
60
|
+
pos: import("./pos").PosState;
|
|
61
|
+
punches: import("./punches").PunchesState;
|
|
62
|
+
refund: import("./refund").RefundState;
|
|
63
|
+
settings: import("./settings").SettingsState;
|
|
64
|
+
sidebar: import("./sidebar").SidebarState;
|
|
65
|
+
surcharges: import("./surcharges").SurchargesState;
|
|
66
|
+
taxes: import("./taxes").TaxesState;
|
|
67
|
+
}) => AppConfig) & {
|
|
68
|
+
clearCache: () => void;
|
|
69
|
+
resultsCount: () => number;
|
|
70
|
+
resetResultsCount: () => void;
|
|
71
|
+
} & {
|
|
72
|
+
resultFunc: (resultFuncArgs_0: AppConfig | null) => AppConfig;
|
|
73
|
+
memoizedResultFunc: ((resultFuncArgs_0: AppConfig | null) => AppConfig) & {
|
|
74
|
+
clearCache: () => void;
|
|
75
|
+
resultsCount: () => number;
|
|
76
|
+
resetResultsCount: () => void;
|
|
77
|
+
};
|
|
78
|
+
lastResult: () => AppConfig;
|
|
79
|
+
dependencies: [(state: AppState) => AppConfig | null];
|
|
80
|
+
recomputations: () => number;
|
|
81
|
+
resetRecomputations: () => void;
|
|
82
|
+
dependencyRecomputations: () => number;
|
|
83
|
+
resetDependencyRecomputations: () => void;
|
|
84
|
+
} & {
|
|
85
|
+
argsMemoize: typeof import("reselect").weakMapMemoize;
|
|
86
|
+
memoize: typeof import("reselect").weakMapMemoize;
|
|
87
|
+
};
|
|
45
88
|
export declare const selectKioskConfigScreen: (screen: string) => ((state: {
|
|
46
89
|
alerts: import("../types").Alerts;
|
|
47
90
|
arrivals: import("./arrivals").ArrivalsState;
|
package/dist/esm/slices/kiosk.js
CHANGED
|
@@ -134,7 +134,13 @@ export var selectKiosk = function (state) { return state.kiosk; };
|
|
|
134
134
|
export var selectKioskVersion = function (state) { return state.kiosk.version; };
|
|
135
135
|
export var selectKioskStore = function (state) { return state.kiosk.store; };
|
|
136
136
|
export var selectKioskBrand = function (state) { return state.kiosk.brand; };
|
|
137
|
-
export
|
|
137
|
+
// export const selectKioskConfig = (state: AppState) => state.kiosk.config || {}
|
|
138
|
+
export var selectKioskConfig = createSelector(function (state) {
|
|
139
|
+
var config = state.kiosk.config;
|
|
140
|
+
return config;
|
|
141
|
+
}, function (config) {
|
|
142
|
+
return (config || {});
|
|
143
|
+
});
|
|
138
144
|
export var selectKioskConfigScreen = function (screen) {
|
|
139
145
|
return createSelector(function (state) {
|
|
140
146
|
var config = state.kiosk.config;
|
|
@@ -41,9 +41,138 @@ export declare const selectCurrentVendor: (state: AppState) => MenuRevenueCenter
|
|
|
41
41
|
export declare const selectCurrentCategory: (state: AppState) => MenuCategory | null;
|
|
42
42
|
export declare const selectCurrentItem: (state: AppState) => CartItem | null;
|
|
43
43
|
export declare const selectCart: (state: AppState) => Cart;
|
|
44
|
-
export declare const selectCartIds: (state:
|
|
45
|
-
|
|
46
|
-
|
|
44
|
+
export declare const selectCartIds: ((state: {
|
|
45
|
+
alerts: import("..").Alerts;
|
|
46
|
+
arrivals: import("./arrivals").ArrivalsState;
|
|
47
|
+
cartSummary: import("./cartSummary").CartSummaryState;
|
|
48
|
+
checkout: import("./checkout").CheckoutState;
|
|
49
|
+
config: import("./config").ConfigState;
|
|
50
|
+
discounts: import("./discounts").DiscountsState;
|
|
51
|
+
errorAlerts: import("./errorAlerts").ErrorAlertsState;
|
|
52
|
+
kds: import("./kds").KdsState;
|
|
53
|
+
kiosk: import("./kiosk").KioskState;
|
|
54
|
+
menu: import("./menu").MenuState;
|
|
55
|
+
menuPages: import("./menuPages").MenuPagesState;
|
|
56
|
+
modal: import("./modal").ModalState;
|
|
57
|
+
notifications: import("..").Notifications;
|
|
58
|
+
offlineAuths: import("./offlineAuths").OfflineAuthsState;
|
|
59
|
+
order: OrderState;
|
|
60
|
+
pos: import("./pos").PosState;
|
|
61
|
+
punches: import("./punches").PunchesState;
|
|
62
|
+
refund: import("./refund").RefundState;
|
|
63
|
+
settings: import("./settings").SettingsState;
|
|
64
|
+
sidebar: import("./sidebar").SidebarState;
|
|
65
|
+
surcharges: import("./surcharges").SurchargesState;
|
|
66
|
+
taxes: import("./taxes").TaxesState;
|
|
67
|
+
}) => number[]) & {
|
|
68
|
+
clearCache: () => void;
|
|
69
|
+
resultsCount: () => number;
|
|
70
|
+
resetResultsCount: () => void;
|
|
71
|
+
} & {
|
|
72
|
+
resultFunc: (resultFuncArgs_0: Cart) => number[];
|
|
73
|
+
memoizedResultFunc: ((resultFuncArgs_0: Cart) => number[]) & {
|
|
74
|
+
clearCache: () => void;
|
|
75
|
+
resultsCount: () => number;
|
|
76
|
+
resetResultsCount: () => void;
|
|
77
|
+
};
|
|
78
|
+
lastResult: () => number[];
|
|
79
|
+
dependencies: [(state: AppState) => Cart];
|
|
80
|
+
recomputations: () => number;
|
|
81
|
+
resetRecomputations: () => void;
|
|
82
|
+
dependencyRecomputations: () => number;
|
|
83
|
+
resetDependencyRecomputations: () => void;
|
|
84
|
+
} & {
|
|
85
|
+
argsMemoize: typeof import("reselect").weakMapMemoize;
|
|
86
|
+
memoize: typeof import("reselect").weakMapMemoize;
|
|
87
|
+
};
|
|
88
|
+
export declare const selectCartQuantity: ((state: {
|
|
89
|
+
alerts: import("..").Alerts;
|
|
90
|
+
arrivals: import("./arrivals").ArrivalsState;
|
|
91
|
+
cartSummary: import("./cartSummary").CartSummaryState;
|
|
92
|
+
checkout: import("./checkout").CheckoutState;
|
|
93
|
+
config: import("./config").ConfigState;
|
|
94
|
+
discounts: import("./discounts").DiscountsState;
|
|
95
|
+
errorAlerts: import("./errorAlerts").ErrorAlertsState;
|
|
96
|
+
kds: import("./kds").KdsState;
|
|
97
|
+
kiosk: import("./kiosk").KioskState;
|
|
98
|
+
menu: import("./menu").MenuState;
|
|
99
|
+
menuPages: import("./menuPages").MenuPagesState;
|
|
100
|
+
modal: import("./modal").ModalState;
|
|
101
|
+
notifications: import("..").Notifications;
|
|
102
|
+
offlineAuths: import("./offlineAuths").OfflineAuthsState;
|
|
103
|
+
order: OrderState;
|
|
104
|
+
pos: import("./pos").PosState;
|
|
105
|
+
punches: import("./punches").PunchesState;
|
|
106
|
+
refund: import("./refund").RefundState;
|
|
107
|
+
settings: import("./settings").SettingsState;
|
|
108
|
+
sidebar: import("./sidebar").SidebarState;
|
|
109
|
+
surcharges: import("./surcharges").SurchargesState;
|
|
110
|
+
taxes: import("./taxes").TaxesState;
|
|
111
|
+
}) => number) & {
|
|
112
|
+
clearCache: () => void;
|
|
113
|
+
resultsCount: () => number;
|
|
114
|
+
resetResultsCount: () => void;
|
|
115
|
+
} & {
|
|
116
|
+
resultFunc: (resultFuncArgs_0: Cart) => number;
|
|
117
|
+
memoizedResultFunc: ((resultFuncArgs_0: Cart) => number) & {
|
|
118
|
+
clearCache: () => void;
|
|
119
|
+
resultsCount: () => number;
|
|
120
|
+
resetResultsCount: () => void;
|
|
121
|
+
};
|
|
122
|
+
lastResult: () => number;
|
|
123
|
+
dependencies: [(state: AppState) => Cart];
|
|
124
|
+
recomputations: () => number;
|
|
125
|
+
resetRecomputations: () => void;
|
|
126
|
+
dependencyRecomputations: () => number;
|
|
127
|
+
resetDependencyRecomputations: () => void;
|
|
128
|
+
} & {
|
|
129
|
+
argsMemoize: typeof import("reselect").weakMapMemoize;
|
|
130
|
+
memoize: typeof import("reselect").weakMapMemoize;
|
|
131
|
+
};
|
|
132
|
+
export declare const selectCartTotal: ((state: {
|
|
133
|
+
alerts: import("..").Alerts;
|
|
134
|
+
arrivals: import("./arrivals").ArrivalsState;
|
|
135
|
+
cartSummary: import("./cartSummary").CartSummaryState;
|
|
136
|
+
checkout: import("./checkout").CheckoutState;
|
|
137
|
+
config: import("./config").ConfigState;
|
|
138
|
+
discounts: import("./discounts").DiscountsState;
|
|
139
|
+
errorAlerts: import("./errorAlerts").ErrorAlertsState;
|
|
140
|
+
kds: import("./kds").KdsState;
|
|
141
|
+
kiosk: import("./kiosk").KioskState;
|
|
142
|
+
menu: import("./menu").MenuState;
|
|
143
|
+
menuPages: import("./menuPages").MenuPagesState;
|
|
144
|
+
modal: import("./modal").ModalState;
|
|
145
|
+
notifications: import("..").Notifications;
|
|
146
|
+
offlineAuths: import("./offlineAuths").OfflineAuthsState;
|
|
147
|
+
order: OrderState;
|
|
148
|
+
pos: import("./pos").PosState;
|
|
149
|
+
punches: import("./punches").PunchesState;
|
|
150
|
+
refund: import("./refund").RefundState;
|
|
151
|
+
settings: import("./settings").SettingsState;
|
|
152
|
+
sidebar: import("./sidebar").SidebarState;
|
|
153
|
+
surcharges: import("./surcharges").SurchargesState;
|
|
154
|
+
taxes: import("./taxes").TaxesState;
|
|
155
|
+
}) => number) & {
|
|
156
|
+
clearCache: () => void;
|
|
157
|
+
resultsCount: () => number;
|
|
158
|
+
resetResultsCount: () => void;
|
|
159
|
+
} & {
|
|
160
|
+
resultFunc: (resultFuncArgs_0: Cart) => number;
|
|
161
|
+
memoizedResultFunc: ((resultFuncArgs_0: Cart) => number) & {
|
|
162
|
+
clearCache: () => void;
|
|
163
|
+
resultsCount: () => number;
|
|
164
|
+
resetResultsCount: () => void;
|
|
165
|
+
};
|
|
166
|
+
lastResult: () => number;
|
|
167
|
+
dependencies: [(state: AppState) => Cart];
|
|
168
|
+
recomputations: () => number;
|
|
169
|
+
resetRecomputations: () => void;
|
|
170
|
+
dependencyRecomputations: () => number;
|
|
171
|
+
resetDependencyRecomputations: () => void;
|
|
172
|
+
} & {
|
|
173
|
+
argsMemoize: typeof import("reselect").weakMapMemoize;
|
|
174
|
+
memoize: typeof import("reselect").weakMapMemoize;
|
|
175
|
+
};
|
|
47
176
|
export declare const selectCartTotals: (state: AppState) => {
|
|
48
177
|
count: number;
|
|
49
178
|
total: number;
|
package/dist/esm/slices/order.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
var _a;
|
|
2
2
|
import { __spreadArray } from "tslib";
|
|
3
|
-
import { createSlice } from '@reduxjs/toolkit';
|
|
3
|
+
import { createSelector, createSlice } from '@reduxjs/toolkit';
|
|
4
4
|
import { addItem, calcCartCounts, decrementItem, incrementItem, makeRandomNumberString, orderTypeNamesMap, removeItem, serviceTypeNamesMap } from '@open-tender/utils';
|
|
5
5
|
import { ReducerType } from './types';
|
|
6
6
|
var initialState = {
|
|
@@ -179,19 +179,30 @@ export var selectCurrentCategory = function (state) {
|
|
|
179
179
|
};
|
|
180
180
|
export var selectCurrentItem = function (state) { return state.order.currentItem; };
|
|
181
181
|
export var selectCart = function (state) { return state.order.cart; };
|
|
182
|
-
export var selectCartIds = function (state) {
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
};
|
|
190
|
-
export var
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
182
|
+
export var selectCartIds = createSelector(function (state) {
|
|
183
|
+
var cart = state.order.cart;
|
|
184
|
+
return cart;
|
|
185
|
+
}, function (cart) {
|
|
186
|
+
if (!cart)
|
|
187
|
+
return [];
|
|
188
|
+
return cart.map(function (i) { return i.id; });
|
|
189
|
+
});
|
|
190
|
+
export var selectCartQuantity = createSelector(function (state) {
|
|
191
|
+
var cart = state.order.cart;
|
|
192
|
+
return cart;
|
|
193
|
+
}, function (cart) {
|
|
194
|
+
if (!cart)
|
|
195
|
+
return 0;
|
|
196
|
+
return cart.reduce(function (t, i) { return (t += i.quantity); }, 0);
|
|
197
|
+
});
|
|
198
|
+
export var selectCartTotal = createSelector(function (state) {
|
|
199
|
+
var cart = state.order.cart;
|
|
200
|
+
return cart;
|
|
201
|
+
}, function (cart) {
|
|
202
|
+
if (!cart)
|
|
203
|
+
return 0.0;
|
|
204
|
+
return cart.reduce(function (t, i) { return (t += i.totalPrice || 0); }, 0.0);
|
|
205
|
+
});
|
|
195
206
|
export var selectCartTotals = function (state) {
|
|
196
207
|
var count = selectCartQuantity(state);
|
|
197
208
|
var total = selectCartTotal(state);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@open-tender/store",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.7",
|
|
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",
|
package/dist/.DS_Store
DELETED
|
Binary file
|