@open-tender/store 1.1.237 → 1.1.239

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,8 +1,9 @@
1
1
  import { Discount as DiscountType } from '@open-tender/types';
2
2
  import { DiscountProps } from '@open-tender/ui';
3
3
  import { ReactNode } from 'react';
4
- declare const Discount: ({ discount, children }: {
4
+ declare const Discount: ({ discount, children, isSmall }: {
5
5
  discount: DiscountType;
6
6
  children: (props: DiscountProps) => ReactNode;
7
+ isSmall?: boolean;
7
8
  }) => ReactNode;
8
9
  export default Discount;
@@ -3,11 +3,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  var hooks_1 = require("../app/hooks");
4
4
  var slices_1 = require("../slices");
5
5
  var Discount = function (_a) {
6
- var discount = _a.discount, children = _a.children;
6
+ var discount = _a.discount, children = _a.children, isSmall = _a.isSmall;
7
7
  var apiUrl = (0, hooks_1.useAppSelector)(slices_1.selectKioskApi);
8
8
  var _b = (0, hooks_1.useAppSelector)(slices_1.selectKioskConfig), config = _b.discount, cardConfig = _b.card;
9
9
  if (!config)
10
10
  return null;
11
- return children({ config: config, discount: discount, cardConfig: cardConfig, apiUrl: apiUrl });
11
+ return children({ config: config, discount: discount, cardConfig: cardConfig, apiUrl: apiUrl, isSmall: isSmall });
12
12
  };
13
13
  exports.default = Discount;
@@ -127,20 +127,12 @@ export declare const selectCustomerLoyaltyProgram: ((state: {
127
127
  resultsCount: () => number;
128
128
  resetResultsCount: () => void;
129
129
  } & {
130
- resultFunc: (resultFuncArgs_0: {
131
- entities: LoyaltyPrograms;
132
- loading: RequestStatus;
133
- error: RequestError;
134
- }) => {
130
+ resultFunc: (resultFuncArgs_0: CustomerState) => {
135
131
  program: import("@open-tender/types").LoyaltyProgram | null;
136
132
  loading: RequestStatus;
137
133
  error: RequestError;
138
134
  };
139
- memoizedResultFunc: ((resultFuncArgs_0: {
140
- entities: LoyaltyPrograms;
141
- loading: RequestStatus;
142
- error: RequestError;
143
- }) => {
135
+ memoizedResultFunc: ((resultFuncArgs_0: CustomerState) => {
144
136
  program: import("@open-tender/types").LoyaltyProgram | null;
145
137
  loading: RequestStatus;
146
138
  error: RequestError;
@@ -154,11 +146,7 @@ export declare const selectCustomerLoyaltyProgram: ((state: {
154
146
  loading: RequestStatus;
155
147
  error: RequestError;
156
148
  };
157
- dependencies: [(state: AppState) => {
158
- entities: LoyaltyPrograms;
159
- loading: RequestStatus;
160
- error: RequestError;
161
- }];
149
+ dependencies: [(state: AppState) => CustomerState];
162
150
  recomputations: () => number;
163
151
  resetRecomputations: () => void;
164
152
  dependencyRecomputations: () => number;
@@ -111,11 +111,8 @@ exports.selectCustomerLoyaltySummary = (0, toolkit_1.createSelector)(function (s
111
111
  });
112
112
  var selectCustomerLoyalty = function (state) { return state.customer.loyalty; };
113
113
  exports.selectCustomerLoyalty = selectCustomerLoyalty;
114
- exports.selectCustomerLoyaltyProgram = (0, toolkit_1.createSelector)(function (state) {
115
- var _a = state.customer, entities = _a.loyalty, loading = _a.loading, error = _a.error;
116
- return { entities: entities, loading: loading, error: error };
117
- }, function (_a) {
118
- var entities = _a.entities, loading = _a.loading, error = _a.error;
114
+ exports.selectCustomerLoyaltyProgram = (0, toolkit_1.createSelector)(function (state) { return state.customer; }, function (_a) {
115
+ var entities = _a.loyalty, loading = _a.loading, error = _a.error;
119
116
  var programs = entities.filter(function (i) { return i.earn_order_type === null || i.earn_order_type === 'OLO'; });
120
117
  var program = programs.length ? programs[0] : null;
121
118
  return { program: program, loading: loading, error: error };
@@ -1,8 +1,9 @@
1
1
  import { Discount as DiscountType } from '@open-tender/types';
2
2
  import { DiscountProps } from '@open-tender/ui';
3
3
  import { ReactNode } from 'react';
4
- declare const Discount: ({ discount, children }: {
4
+ declare const Discount: ({ discount, children, isSmall }: {
5
5
  discount: DiscountType;
6
6
  children: (props: DiscountProps) => ReactNode;
7
+ isSmall?: boolean;
7
8
  }) => ReactNode;
8
9
  export default Discount;
@@ -1,11 +1,11 @@
1
1
  import { useAppSelector } from '../app/hooks';
2
2
  import { selectKioskApi, selectKioskConfig } from '../slices';
3
3
  var Discount = function (_a) {
4
- var discount = _a.discount, children = _a.children;
4
+ var discount = _a.discount, children = _a.children, isSmall = _a.isSmall;
5
5
  var apiUrl = useAppSelector(selectKioskApi);
6
6
  var _b = useAppSelector(selectKioskConfig), config = _b.discount, cardConfig = _b.card;
7
7
  if (!config)
8
8
  return null;
9
- return children({ config: config, discount: discount, cardConfig: cardConfig, apiUrl: apiUrl });
9
+ return children({ config: config, discount: discount, cardConfig: cardConfig, apiUrl: apiUrl, isSmall: isSmall });
10
10
  };
11
11
  export default Discount;
@@ -127,20 +127,12 @@ export declare const selectCustomerLoyaltyProgram: ((state: {
127
127
  resultsCount: () => number;
128
128
  resetResultsCount: () => void;
129
129
  } & {
130
- resultFunc: (resultFuncArgs_0: {
131
- entities: LoyaltyPrograms;
132
- loading: RequestStatus;
133
- error: RequestError;
134
- }) => {
130
+ resultFunc: (resultFuncArgs_0: CustomerState) => {
135
131
  program: import("@open-tender/types").LoyaltyProgram | null;
136
132
  loading: RequestStatus;
137
133
  error: RequestError;
138
134
  };
139
- memoizedResultFunc: ((resultFuncArgs_0: {
140
- entities: LoyaltyPrograms;
141
- loading: RequestStatus;
142
- error: RequestError;
143
- }) => {
135
+ memoizedResultFunc: ((resultFuncArgs_0: CustomerState) => {
144
136
  program: import("@open-tender/types").LoyaltyProgram | null;
145
137
  loading: RequestStatus;
146
138
  error: RequestError;
@@ -154,11 +146,7 @@ export declare const selectCustomerLoyaltyProgram: ((state: {
154
146
  loading: RequestStatus;
155
147
  error: RequestError;
156
148
  };
157
- dependencies: [(state: AppState) => {
158
- entities: LoyaltyPrograms;
159
- loading: RequestStatus;
160
- error: RequestError;
161
- }];
149
+ dependencies: [(state: AppState) => CustomerState];
162
150
  recomputations: () => number;
163
151
  resetRecomputations: () => void;
164
152
  dependencyRecomputations: () => number;
@@ -100,11 +100,8 @@ export var selectCustomerLoyaltySummary = createSelector(function (state) {
100
100
  };
101
101
  });
102
102
  export var selectCustomerLoyalty = function (state) { return state.customer.loyalty; };
103
- export var selectCustomerLoyaltyProgram = createSelector(function (state) {
104
- var _a = state.customer, entities = _a.loyalty, loading = _a.loading, error = _a.error;
105
- return { entities: entities, loading: loading, error: error };
106
- }, function (_a) {
107
- var entities = _a.entities, loading = _a.loading, error = _a.error;
103
+ export var selectCustomerLoyaltyProgram = createSelector(function (state) { return state.customer; }, function (_a) {
104
+ var entities = _a.loyalty, loading = _a.loading, error = _a.error;
108
105
  var programs = entities.filter(function (i) { return i.earn_order_type === null || i.earn_order_type === 'OLO'; });
109
106
  var program = programs.length ? programs[0] : null;
110
107
  return { program: program, loading: loading, error: error };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@open-tender/store",
3
- "version": "1.1.237",
3
+ "version": "1.1.239",
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.31",
65
+ "@open-tender/ui": "^0.4.32",
66
66
  "@open-tender/utils": "^0.4.71",
67
67
  "@reduxjs/toolkit": "^2.0.1",
68
68
  "date-fns": "2.30.0",