@open-tender/store 1.1.239 → 1.1.241

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.
@@ -1,10 +1,11 @@
1
1
  import { LoyaltyProgram } from '@open-tender/types';
2
2
  import { AccountLoyaltyProps } from '@open-tender/ui';
3
3
  import { ReactNode } from 'react';
4
- declare const AccountLoyalty: ({ loyaltyProgram, navigate, children, navigateTo }: {
4
+ declare const AccountLoyalty: ({ loyaltyProgram, navigate, children, renderRewards, navigateTo }: {
5
5
  loyaltyProgram: LoyaltyProgram;
6
6
  navigate: (route: string) => void;
7
7
  children: (props: AccountLoyaltyProps) => ReactNode;
8
+ renderRewards: () => ReactNode;
8
9
  navigateTo?: string;
9
10
  }) => ReactNode;
10
11
  export default AccountLoyalty;
@@ -4,7 +4,7 @@ var hooks_1 = require("../app/hooks");
4
4
  var slices_1 = require("../slices");
5
5
  var AccountLoyalty = function (_a) {
6
6
  var _b;
7
- var loyaltyProgram = _a.loyaltyProgram, navigate = _a.navigate, children = _a.children, navigateTo = _a.navigateTo;
7
+ var loyaltyProgram = _a.loyaltyProgram, navigate = _a.navigate, children = _a.children, renderRewards = _a.renderRewards, navigateTo = _a.navigateTo;
8
8
  var store = (0, hooks_1.useAppSelector)(slices_1.selectKiosk).store;
9
9
  var config = (0, hooks_1.useAppSelector)(slices_1.selectKioskConfig).accountLoyalty;
10
10
  var account = (0, hooks_1.useAppSelector)(slices_1.selectCustomer).account;
@@ -13,6 +13,6 @@ var AccountLoyalty = function (_a) {
13
13
  var handlers = { startOrder: startOrder };
14
14
  if (!config || !account || !loyaltyProgram || !hasLoyalty)
15
15
  return null;
16
- return children({ config: config, handlers: handlers, account: account, loyaltyProgram: loyaltyProgram });
16
+ return children({ config: config, handlers: handlers, account: account, loyaltyProgram: loyaltyProgram, renderRewards: renderRewards });
17
17
  };
18
18
  exports.default = AccountLoyalty;
@@ -216,5 +216,145 @@ export declare const selectCustomerPoints: (orderType: OrderType | null) => (sta
216
216
  name: string;
217
217
  points: `${number}.${number}` | null;
218
218
  } | null;
219
- export declare const selectPointsProgram: (state: AppState) => import("@open-tender/types").LoyaltyProgram | null;
219
+ export declare const selectPointsProgram: ((state: {
220
+ alerts: import("@open-tender/types").Alerts;
221
+ allergens: import("./allergens").AllergensState;
222
+ arrivals: import("./arrivals").ArrivalsState;
223
+ cartSummary: import("./cartSummary").CartSummaryState;
224
+ checkout: import("./checkout").CheckoutState;
225
+ config: import("./config").ConfigState;
226
+ customer: CustomerState;
227
+ customerIdentify: import("./customerIdentify").CustomerIdentifyState;
228
+ deals: import("./deals").DealsState;
229
+ discounts: import("./discounts").DiscountsState;
230
+ errorAlerts: import("./errorAlerts").ErrorAlertsState;
231
+ kds: import("./kds").KdsState;
232
+ kiosk: import("./kiosk").KioskState;
233
+ menu: import("./menu").MenuState;
234
+ menuPages: import("./menuPages").MenuPagesState;
235
+ modal: import("./modal").ModalState;
236
+ notifications: import("@open-tender/types").Notifications;
237
+ offlineAuths: import("./offlineAuths").OfflineAuthsState;
238
+ order: import("./order").OrderState;
239
+ pos: import("./pos").PosState;
240
+ punches: import("./punches").PunchesState;
241
+ refund: import("./refund").RefundState;
242
+ sendReceipt: import("./sendReceipt").SendReceiptState;
243
+ settings: import("./settings").SettingsState;
244
+ sidebar: import("./sidebar").SidebarState;
245
+ surcharges: import("./surcharges").SurchargesState;
246
+ taxes: import("./taxes").TaxesState;
247
+ idle: import("./idle").IdleState;
248
+ tags: import("./tags").TagsState;
249
+ }) => import("@open-tender/types").LoyaltyProgram | null) & {
250
+ clearCache: () => void;
251
+ resultsCount: () => number;
252
+ resetResultsCount: () => void;
253
+ } & {
254
+ resultFunc: (resultFuncArgs_0: OrderType | null, resultFuncArgs_1: {
255
+ alerts: import("@open-tender/types").Alerts;
256
+ allergens: import("./allergens").AllergensState;
257
+ arrivals: import("./arrivals").ArrivalsState;
258
+ cartSummary: import("./cartSummary").CartSummaryState;
259
+ checkout: import("./checkout").CheckoutState;
260
+ config: import("./config").ConfigState;
261
+ customer: CustomerState;
262
+ customerIdentify: import("./customerIdentify").CustomerIdentifyState;
263
+ deals: import("./deals").DealsState;
264
+ discounts: import("./discounts").DiscountsState;
265
+ errorAlerts: import("./errorAlerts").ErrorAlertsState;
266
+ kds: import("./kds").KdsState;
267
+ kiosk: import("./kiosk").KioskState;
268
+ menu: import("./menu").MenuState;
269
+ menuPages: import("./menuPages").MenuPagesState;
270
+ modal: import("./modal").ModalState;
271
+ notifications: import("@open-tender/types").Notifications;
272
+ offlineAuths: import("./offlineAuths").OfflineAuthsState;
273
+ order: import("./order").OrderState;
274
+ pos: import("./pos").PosState;
275
+ punches: import("./punches").PunchesState;
276
+ refund: import("./refund").RefundState;
277
+ sendReceipt: import("./sendReceipt").SendReceiptState;
278
+ settings: import("./settings").SettingsState;
279
+ sidebar: import("./sidebar").SidebarState;
280
+ surcharges: import("./surcharges").SurchargesState;
281
+ taxes: import("./taxes").TaxesState;
282
+ idle: import("./idle").IdleState;
283
+ tags: import("./tags").TagsState;
284
+ }) => import("@open-tender/types").LoyaltyProgram | null;
285
+ memoizedResultFunc: ((resultFuncArgs_0: OrderType | null, resultFuncArgs_1: {
286
+ alerts: import("@open-tender/types").Alerts;
287
+ allergens: import("./allergens").AllergensState;
288
+ arrivals: import("./arrivals").ArrivalsState;
289
+ cartSummary: import("./cartSummary").CartSummaryState;
290
+ checkout: import("./checkout").CheckoutState;
291
+ config: import("./config").ConfigState;
292
+ customer: CustomerState;
293
+ customerIdentify: import("./customerIdentify").CustomerIdentifyState;
294
+ deals: import("./deals").DealsState;
295
+ discounts: import("./discounts").DiscountsState;
296
+ errorAlerts: import("./errorAlerts").ErrorAlertsState;
297
+ kds: import("./kds").KdsState;
298
+ kiosk: import("./kiosk").KioskState;
299
+ menu: import("./menu").MenuState;
300
+ menuPages: import("./menuPages").MenuPagesState;
301
+ modal: import("./modal").ModalState;
302
+ notifications: import("@open-tender/types").Notifications;
303
+ offlineAuths: import("./offlineAuths").OfflineAuthsState;
304
+ order: import("./order").OrderState;
305
+ pos: import("./pos").PosState;
306
+ punches: import("./punches").PunchesState;
307
+ refund: import("./refund").RefundState;
308
+ sendReceipt: import("./sendReceipt").SendReceiptState;
309
+ settings: import("./settings").SettingsState;
310
+ sidebar: import("./sidebar").SidebarState;
311
+ surcharges: import("./surcharges").SurchargesState;
312
+ taxes: import("./taxes").TaxesState;
313
+ idle: import("./idle").IdleState;
314
+ tags: import("./tags").TagsState;
315
+ }) => import("@open-tender/types").LoyaltyProgram | null) & {
316
+ clearCache: () => void;
317
+ resultsCount: () => number;
318
+ resetResultsCount: () => void;
319
+ };
320
+ lastResult: () => import("@open-tender/types").LoyaltyProgram | null;
321
+ dependencies: [(state: AppState) => OrderType | null, (state: AppState) => {
322
+ alerts: import("@open-tender/types").Alerts;
323
+ allergens: import("./allergens").AllergensState;
324
+ arrivals: import("./arrivals").ArrivalsState;
325
+ cartSummary: import("./cartSummary").CartSummaryState;
326
+ checkout: import("./checkout").CheckoutState;
327
+ config: import("./config").ConfigState;
328
+ customer: CustomerState;
329
+ customerIdentify: import("./customerIdentify").CustomerIdentifyState;
330
+ deals: import("./deals").DealsState;
331
+ discounts: import("./discounts").DiscountsState;
332
+ errorAlerts: import("./errorAlerts").ErrorAlertsState;
333
+ kds: import("./kds").KdsState;
334
+ kiosk: import("./kiosk").KioskState;
335
+ menu: import("./menu").MenuState;
336
+ menuPages: import("./menuPages").MenuPagesState;
337
+ modal: import("./modal").ModalState;
338
+ notifications: import("@open-tender/types").Notifications;
339
+ offlineAuths: import("./offlineAuths").OfflineAuthsState;
340
+ order: import("./order").OrderState;
341
+ pos: import("./pos").PosState;
342
+ punches: import("./punches").PunchesState;
343
+ refund: import("./refund").RefundState;
344
+ sendReceipt: import("./sendReceipt").SendReceiptState;
345
+ settings: import("./settings").SettingsState;
346
+ sidebar: import("./sidebar").SidebarState;
347
+ surcharges: import("./surcharges").SurchargesState;
348
+ taxes: import("./taxes").TaxesState;
349
+ idle: import("./idle").IdleState;
350
+ tags: import("./tags").TagsState;
351
+ }];
352
+ recomputations: () => number;
353
+ resetRecomputations: () => void;
354
+ dependencyRecomputations: () => number;
355
+ resetDependencyRecomputations: () => void;
356
+ } & {
357
+ argsMemoize: typeof import("reselect").weakMapMemoize;
358
+ memoize: typeof import("reselect").weakMapMemoize;
359
+ };
220
360
  export declare const customerReducer: import("redux").Reducer<CustomerState>;
@@ -142,9 +142,7 @@ var selectCustomerPoints = function (orderType) { return function (state) {
142
142
  return { name: spend_name, points: perk.credit };
143
143
  }; };
144
144
  exports.selectCustomerPoints = selectCustomerPoints;
145
- var selectPointsProgram = function (state) {
146
- var orderType = state.order.orderType;
145
+ exports.selectPointsProgram = (0, toolkit_1.createSelector)(function (state) { return state.order.orderType; }, function (state) { return state; }, function (orderType, state) {
147
146
  return orderType ? (0, exports.selectCustomerPointsProgram)(orderType)(state) : null;
148
- };
149
- exports.selectPointsProgram = selectPointsProgram;
147
+ });
150
148
  exports.customerReducer = CustomerSlice.reducer;
@@ -1,10 +1,11 @@
1
1
  import { LoyaltyProgram } from '@open-tender/types';
2
2
  import { AccountLoyaltyProps } from '@open-tender/ui';
3
3
  import { ReactNode } from 'react';
4
- declare const AccountLoyalty: ({ loyaltyProgram, navigate, children, navigateTo }: {
4
+ declare const AccountLoyalty: ({ loyaltyProgram, navigate, children, renderRewards, navigateTo }: {
5
5
  loyaltyProgram: LoyaltyProgram;
6
6
  navigate: (route: string) => void;
7
7
  children: (props: AccountLoyaltyProps) => ReactNode;
8
+ renderRewards: () => ReactNode;
8
9
  navigateTo?: string;
9
10
  }) => ReactNode;
10
11
  export default AccountLoyalty;
@@ -2,7 +2,7 @@ import { useAppSelector } from '../app/hooks';
2
2
  import { selectCustomer, selectKiosk, selectKioskConfig } from '../slices';
3
3
  var AccountLoyalty = function (_a) {
4
4
  var _b;
5
- var loyaltyProgram = _a.loyaltyProgram, navigate = _a.navigate, children = _a.children, navigateTo = _a.navigateTo;
5
+ var loyaltyProgram = _a.loyaltyProgram, navigate = _a.navigate, children = _a.children, renderRewards = _a.renderRewards, navigateTo = _a.navigateTo;
6
6
  var store = useAppSelector(selectKiosk).store;
7
7
  var config = useAppSelector(selectKioskConfig).accountLoyalty;
8
8
  var account = useAppSelector(selectCustomer).account;
@@ -11,6 +11,6 @@ var AccountLoyalty = function (_a) {
11
11
  var handlers = { startOrder: startOrder };
12
12
  if (!config || !account || !loyaltyProgram || !hasLoyalty)
13
13
  return null;
14
- return children({ config: config, handlers: handlers, account: account, loyaltyProgram: loyaltyProgram });
14
+ return children({ config: config, handlers: handlers, account: account, loyaltyProgram: loyaltyProgram, renderRewards: renderRewards });
15
15
  };
16
16
  export default AccountLoyalty;
@@ -216,5 +216,145 @@ export declare const selectCustomerPoints: (orderType: OrderType | null) => (sta
216
216
  name: string;
217
217
  points: `${number}.${number}` | null;
218
218
  } | null;
219
- export declare const selectPointsProgram: (state: AppState) => import("@open-tender/types").LoyaltyProgram | null;
219
+ export declare const selectPointsProgram: ((state: {
220
+ alerts: import("@open-tender/types").Alerts;
221
+ allergens: import("./allergens").AllergensState;
222
+ arrivals: import("./arrivals").ArrivalsState;
223
+ cartSummary: import("./cartSummary").CartSummaryState;
224
+ checkout: import("./checkout").CheckoutState;
225
+ config: import("./config").ConfigState;
226
+ customer: CustomerState;
227
+ customerIdentify: import("./customerIdentify").CustomerIdentifyState;
228
+ deals: import("./deals").DealsState;
229
+ discounts: import("./discounts").DiscountsState;
230
+ errorAlerts: import("./errorAlerts").ErrorAlertsState;
231
+ kds: import("./kds").KdsState;
232
+ kiosk: import("./kiosk").KioskState;
233
+ menu: import("./menu").MenuState;
234
+ menuPages: import("./menuPages").MenuPagesState;
235
+ modal: import("./modal").ModalState;
236
+ notifications: import("@open-tender/types").Notifications;
237
+ offlineAuths: import("./offlineAuths").OfflineAuthsState;
238
+ order: import("./order").OrderState;
239
+ pos: import("./pos").PosState;
240
+ punches: import("./punches").PunchesState;
241
+ refund: import("./refund").RefundState;
242
+ sendReceipt: import("./sendReceipt").SendReceiptState;
243
+ settings: import("./settings").SettingsState;
244
+ sidebar: import("./sidebar").SidebarState;
245
+ surcharges: import("./surcharges").SurchargesState;
246
+ taxes: import("./taxes").TaxesState;
247
+ idle: import("./idle").IdleState;
248
+ tags: import("./tags").TagsState;
249
+ }) => import("@open-tender/types").LoyaltyProgram | null) & {
250
+ clearCache: () => void;
251
+ resultsCount: () => number;
252
+ resetResultsCount: () => void;
253
+ } & {
254
+ resultFunc: (resultFuncArgs_0: OrderType | null, resultFuncArgs_1: {
255
+ alerts: import("@open-tender/types").Alerts;
256
+ allergens: import("./allergens").AllergensState;
257
+ arrivals: import("./arrivals").ArrivalsState;
258
+ cartSummary: import("./cartSummary").CartSummaryState;
259
+ checkout: import("./checkout").CheckoutState;
260
+ config: import("./config").ConfigState;
261
+ customer: CustomerState;
262
+ customerIdentify: import("./customerIdentify").CustomerIdentifyState;
263
+ deals: import("./deals").DealsState;
264
+ discounts: import("./discounts").DiscountsState;
265
+ errorAlerts: import("./errorAlerts").ErrorAlertsState;
266
+ kds: import("./kds").KdsState;
267
+ kiosk: import("./kiosk").KioskState;
268
+ menu: import("./menu").MenuState;
269
+ menuPages: import("./menuPages").MenuPagesState;
270
+ modal: import("./modal").ModalState;
271
+ notifications: import("@open-tender/types").Notifications;
272
+ offlineAuths: import("./offlineAuths").OfflineAuthsState;
273
+ order: import("./order").OrderState;
274
+ pos: import("./pos").PosState;
275
+ punches: import("./punches").PunchesState;
276
+ refund: import("./refund").RefundState;
277
+ sendReceipt: import("./sendReceipt").SendReceiptState;
278
+ settings: import("./settings").SettingsState;
279
+ sidebar: import("./sidebar").SidebarState;
280
+ surcharges: import("./surcharges").SurchargesState;
281
+ taxes: import("./taxes").TaxesState;
282
+ idle: import("./idle").IdleState;
283
+ tags: import("./tags").TagsState;
284
+ }) => import("@open-tender/types").LoyaltyProgram | null;
285
+ memoizedResultFunc: ((resultFuncArgs_0: OrderType | null, resultFuncArgs_1: {
286
+ alerts: import("@open-tender/types").Alerts;
287
+ allergens: import("./allergens").AllergensState;
288
+ arrivals: import("./arrivals").ArrivalsState;
289
+ cartSummary: import("./cartSummary").CartSummaryState;
290
+ checkout: import("./checkout").CheckoutState;
291
+ config: import("./config").ConfigState;
292
+ customer: CustomerState;
293
+ customerIdentify: import("./customerIdentify").CustomerIdentifyState;
294
+ deals: import("./deals").DealsState;
295
+ discounts: import("./discounts").DiscountsState;
296
+ errorAlerts: import("./errorAlerts").ErrorAlertsState;
297
+ kds: import("./kds").KdsState;
298
+ kiosk: import("./kiosk").KioskState;
299
+ menu: import("./menu").MenuState;
300
+ menuPages: import("./menuPages").MenuPagesState;
301
+ modal: import("./modal").ModalState;
302
+ notifications: import("@open-tender/types").Notifications;
303
+ offlineAuths: import("./offlineAuths").OfflineAuthsState;
304
+ order: import("./order").OrderState;
305
+ pos: import("./pos").PosState;
306
+ punches: import("./punches").PunchesState;
307
+ refund: import("./refund").RefundState;
308
+ sendReceipt: import("./sendReceipt").SendReceiptState;
309
+ settings: import("./settings").SettingsState;
310
+ sidebar: import("./sidebar").SidebarState;
311
+ surcharges: import("./surcharges").SurchargesState;
312
+ taxes: import("./taxes").TaxesState;
313
+ idle: import("./idle").IdleState;
314
+ tags: import("./tags").TagsState;
315
+ }) => import("@open-tender/types").LoyaltyProgram | null) & {
316
+ clearCache: () => void;
317
+ resultsCount: () => number;
318
+ resetResultsCount: () => void;
319
+ };
320
+ lastResult: () => import("@open-tender/types").LoyaltyProgram | null;
321
+ dependencies: [(state: AppState) => OrderType | null, (state: AppState) => {
322
+ alerts: import("@open-tender/types").Alerts;
323
+ allergens: import("./allergens").AllergensState;
324
+ arrivals: import("./arrivals").ArrivalsState;
325
+ cartSummary: import("./cartSummary").CartSummaryState;
326
+ checkout: import("./checkout").CheckoutState;
327
+ config: import("./config").ConfigState;
328
+ customer: CustomerState;
329
+ customerIdentify: import("./customerIdentify").CustomerIdentifyState;
330
+ deals: import("./deals").DealsState;
331
+ discounts: import("./discounts").DiscountsState;
332
+ errorAlerts: import("./errorAlerts").ErrorAlertsState;
333
+ kds: import("./kds").KdsState;
334
+ kiosk: import("./kiosk").KioskState;
335
+ menu: import("./menu").MenuState;
336
+ menuPages: import("./menuPages").MenuPagesState;
337
+ modal: import("./modal").ModalState;
338
+ notifications: import("@open-tender/types").Notifications;
339
+ offlineAuths: import("./offlineAuths").OfflineAuthsState;
340
+ order: import("./order").OrderState;
341
+ pos: import("./pos").PosState;
342
+ punches: import("./punches").PunchesState;
343
+ refund: import("./refund").RefundState;
344
+ sendReceipt: import("./sendReceipt").SendReceiptState;
345
+ settings: import("./settings").SettingsState;
346
+ sidebar: import("./sidebar").SidebarState;
347
+ surcharges: import("./surcharges").SurchargesState;
348
+ taxes: import("./taxes").TaxesState;
349
+ idle: import("./idle").IdleState;
350
+ tags: import("./tags").TagsState;
351
+ }];
352
+ recomputations: () => number;
353
+ resetRecomputations: () => void;
354
+ dependencyRecomputations: () => number;
355
+ resetDependencyRecomputations: () => void;
356
+ } & {
357
+ argsMemoize: typeof import("reselect").weakMapMemoize;
358
+ memoize: typeof import("reselect").weakMapMemoize;
359
+ };
220
360
  export declare const customerReducer: import("redux").Reducer<CustomerState>;
@@ -129,8 +129,7 @@ export var selectCustomerPoints = function (orderType) { return function (state)
129
129
  var spend_name = program.spend_name, perk = program.perk;
130
130
  return { name: spend_name, points: perk.credit };
131
131
  }; };
132
- export var selectPointsProgram = function (state) {
133
- var orderType = state.order.orderType;
132
+ export var selectPointsProgram = createSelector(function (state) { return state.order.orderType; }, function (state) { return state; }, function (orderType, state) {
134
133
  return orderType ? selectCustomerPointsProgram(orderType)(state) : null;
135
- };
134
+ });
136
135
  export var customerReducer = CustomerSlice.reducer;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@open-tender/store",
3
- "version": "1.1.239",
3
+ "version": "1.1.241",
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",
@@ -62,7 +62,7 @@
62
62
  "peerDependencies": {
63
63
  "@emotion/react": "^11.11.1",
64
64
  "@open-tender/types": "^0.4.98",
65
- "@open-tender/ui": "^0.4.32",
65
+ "@open-tender/ui": "^0.4.33",
66
66
  "@open-tender/utils": "^0.4.71",
67
67
  "@reduxjs/toolkit": "^2.0.1",
68
68
  "date-fns": "2.30.0",