@open-tender/store 1.1.175 → 1.1.177
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/app/hooks.d.ts +0 -1
- package/dist/cjs/app/store.d.ts +0 -4
- package/dist/cjs/app/store.js +1 -2
- package/dist/cjs/components/SignInPhone.js +1 -0
- package/dist/cjs/components/index.d.ts +1 -4
- package/dist/cjs/components/index.js +1 -7
- package/dist/cjs/services/api.d.ts +1 -2
- package/dist/cjs/services/api.js +0 -3
- package/dist/cjs/slices/customer.d.ts +0 -1
- package/dist/cjs/slices/index.d.ts +0 -1
- package/dist/cjs/slices/index.js +0 -1
- package/dist/cjs/slices/kiosk.d.ts +0 -7
- package/dist/cjs/slices/menuPages.d.ts +0 -1
- package/dist/cjs/slices/order.d.ts +0 -4
- package/dist/cjs/slices/types.d.ts +1 -2
- package/dist/cjs/slices/types.js +0 -1
- package/dist/esm/app/hooks.d.ts +0 -1
- package/dist/esm/app/store.d.ts +0 -4
- package/dist/esm/app/store.js +2 -3
- package/dist/esm/components/SignInPhone.js +1 -0
- package/dist/esm/components/index.d.ts +1 -4
- package/dist/esm/components/index.js +1 -4
- package/dist/esm/services/api.d.ts +1 -2
- package/dist/esm/services/api.js +0 -3
- package/dist/esm/slices/customer.d.ts +0 -1
- package/dist/esm/slices/index.d.ts +0 -1
- package/dist/esm/slices/index.js +0 -1
- package/dist/esm/slices/kiosk.d.ts +0 -7
- package/dist/esm/slices/menuPages.d.ts +0 -1
- package/dist/esm/slices/order.d.ts +0 -4
- package/dist/esm/slices/types.d.ts +1 -2
- package/dist/esm/slices/types.js +0 -1
- package/package.json +1 -1
- package/dist/cjs/components/Switch.d.ts +0 -15
- package/dist/cjs/components/Switch.js +0 -23
- package/dist/cjs/components/TagsButton.d.ts +0 -6
- package/dist/cjs/components/TagsButton.js +0 -18
- package/dist/cjs/components/TagsFilter.d.ts +0 -7
- package/dist/cjs/components/TagsFilter.js +0 -48
- package/dist/cjs/slices/tags.d.ts +0 -86
- package/dist/cjs/slices/tags.js +0 -87
- package/dist/esm/components/Switch.d.ts +0 -15
- package/dist/esm/components/Switch.js +0 -21
- package/dist/esm/components/TagsButton.d.ts +0 -6
- package/dist/esm/components/TagsButton.js +0 -16
- package/dist/esm/components/TagsFilter.d.ts +0 -7
- package/dist/esm/components/TagsFilter.js +0 -46
- package/dist/esm/slices/tags.d.ts +0 -86
- package/dist/esm/slices/tags.js +0 -81
package/dist/cjs/app/hooks.d.ts
CHANGED
|
@@ -28,6 +28,5 @@ export declare const useAppDispatch: () => import("redux-thunk").ThunkDispatch<{
|
|
|
28
28
|
surcharges: import("..").SurchargesState;
|
|
29
29
|
taxes: import("..").TaxesState;
|
|
30
30
|
idle: import("..").IdleState;
|
|
31
|
-
tags: import("..").TagsState;
|
|
32
31
|
}, undefined, import("redux").UnknownAction> & import("redux").Dispatch<import("redux").Action>;
|
|
33
32
|
export declare const useAppSelector: TypedUseSelectorHook<RootState>;
|
package/dist/cjs/app/store.d.ts
CHANGED
|
@@ -27,7 +27,6 @@ export declare const appReducer: import("redux").Reducer<{
|
|
|
27
27
|
surcharges: import("../slices").SurchargesState;
|
|
28
28
|
taxes: import("../slices").TaxesState;
|
|
29
29
|
idle: import("../slices").IdleState;
|
|
30
|
-
tags: import("../slices").TagsState;
|
|
31
30
|
}, import("redux").UnknownAction, Partial<{
|
|
32
31
|
alerts: import("@open-tender/types").Alerts | undefined;
|
|
33
32
|
arrivals: import("../slices").ArrivalsState | undefined;
|
|
@@ -56,7 +55,6 @@ export declare const appReducer: import("redux").Reducer<{
|
|
|
56
55
|
surcharges: import("../slices").SurchargesState | undefined;
|
|
57
56
|
taxes: import("../slices").TaxesState | undefined;
|
|
58
57
|
idle: import("../slices").IdleState | undefined;
|
|
59
|
-
tags: import("../slices").TagsState | undefined;
|
|
60
58
|
}>>;
|
|
61
59
|
export type AppState = ReturnType<typeof appReducer>;
|
|
62
60
|
declare const store: import("@reduxjs/toolkit").EnhancedStore<{
|
|
@@ -87,7 +85,6 @@ declare const store: import("@reduxjs/toolkit").EnhancedStore<{
|
|
|
87
85
|
surcharges: import("../slices").SurchargesState;
|
|
88
86
|
taxes: import("../slices").TaxesState;
|
|
89
87
|
idle: import("../slices").IdleState;
|
|
90
|
-
tags: import("../slices").TagsState;
|
|
91
88
|
}, Action, import("@reduxjs/toolkit").Tuple<[import("redux").StoreEnhancer<{
|
|
92
89
|
dispatch: import("redux-thunk").ThunkDispatch<{
|
|
93
90
|
alerts: import("@open-tender/types").Alerts;
|
|
@@ -117,7 +114,6 @@ declare const store: import("@reduxjs/toolkit").EnhancedStore<{
|
|
|
117
114
|
surcharges: import("../slices").SurchargesState;
|
|
118
115
|
taxes: import("../slices").TaxesState;
|
|
119
116
|
idle: import("../slices").IdleState;
|
|
120
|
-
tags: import("../slices").TagsState;
|
|
121
117
|
}, undefined, import("redux").UnknownAction>;
|
|
122
118
|
}>, import("redux").StoreEnhancer]>>;
|
|
123
119
|
export type AppDispatch = typeof store.dispatch;
|
package/dist/cjs/app/store.js
CHANGED
|
@@ -30,8 +30,7 @@ exports.appReducer = (0, toolkit_1.combineReducers)({
|
|
|
30
30
|
sidebar: slices_1.sidebarReducer,
|
|
31
31
|
surcharges: slices_1.surchargesReducer,
|
|
32
32
|
taxes: slices_1.taxesReducer,
|
|
33
|
-
idle: slices_1.idleReducer
|
|
34
|
-
tags: slices_1.tagsReducer
|
|
33
|
+
idle: slices_1.idleReducer
|
|
35
34
|
});
|
|
36
35
|
var rootReducer = function (state, action) {
|
|
37
36
|
if (action.type === 'clearState') {
|
|
@@ -63,11 +63,8 @@ import SignInPhone from './SignInPhone';
|
|
|
63
63
|
import SignInQr from './SignInQr';
|
|
64
64
|
import SignUp from './SignUp';
|
|
65
65
|
import SuccessMessage from './SuccessMessage';
|
|
66
|
-
import Switch from './Switch';
|
|
67
66
|
import Tag from './Tag';
|
|
68
|
-
import TagsButton from './TagsButton';
|
|
69
|
-
import TagsFilter from './TagsFilter';
|
|
70
67
|
import TextArea from './TextArea';
|
|
71
68
|
import UpsellItem from './UpsellItem';
|
|
72
69
|
import Upsells from './Upsells';
|
|
73
|
-
export { AccountLoyalty, AccountSection, Allergen, Applied, ButtonLink, CancelButton, Card, Cart, CartButton, CartItem, CartUpsellItem, CartUpsells, CategoryItem, CategoryNav, CategoryNavItem, CategoryNavOther, Checkout, CheckoutCart, CheckoutContent, CheckoutFooter, CheckoutHeader, CheckoutPromoCode, CheckoutTotals, CheckTotals, Discount, ErrorMessage, FavsButton, Header, Ingredients, Input, InputButton, ItemGroup, ItemGroups, ItemOption, ItemOptionSelected, ItemSize, ItemSelections, Keypad, Loader, MadeForName, MadeForNotes, MenuCategory, MenuOther, ModalContent, ModalHeader, NutritionalInfo, Option, OrderCard, OrderDetails, OrderDetailsItem, PointsReward, PointsRewards, PromoCode, Quantity, Reward, Rewards, SignIn, SignInButton, SignInCheckout, SignInOptionsModal, SignInPhone, SignInQr, SignUp, SuccessMessage, Tag, TextArea, UpsellItem, Upsells, IdleModal
|
|
70
|
+
export { AccountLoyalty, AccountSection, Allergen, Applied, ButtonLink, CancelButton, Card, Cart, CartButton, CartItem, CartUpsellItem, CartUpsells, CategoryItem, CategoryNav, CategoryNavItem, CategoryNavOther, Checkout, CheckoutCart, CheckoutContent, CheckoutFooter, CheckoutHeader, CheckoutPromoCode, CheckoutTotals, CheckTotals, Discount, ErrorMessage, FavsButton, Header, Ingredients, Input, InputButton, ItemGroup, ItemGroups, ItemOption, ItemOptionSelected, ItemSize, ItemSelections, Keypad, Loader, MadeForName, MadeForNotes, MenuCategory, MenuOther, ModalContent, ModalHeader, NutritionalInfo, Option, OrderCard, OrderDetails, OrderDetailsItem, PointsReward, PointsRewards, PromoCode, Quantity, Reward, Rewards, SignIn, SignInButton, SignInCheckout, SignInOptionsModal, SignInPhone, SignInQr, SignUp, SuccessMessage, Tag, TextArea, UpsellItem, Upsells, IdleModal };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.OrderDetailsItem = exports.OrderDetails = exports.OrderCard = exports.Option = exports.NutritionalInfo = exports.ModalHeader = exports.ModalContent = exports.MenuOther = exports.MenuCategory = exports.MadeForNotes = exports.MadeForName = exports.Loader = exports.Keypad = exports.ItemSelections = exports.ItemSize = exports.ItemOptionSelected = exports.ItemOption = exports.ItemGroups = exports.ItemGroup = exports.InputButton = exports.Input = exports.Ingredients = exports.Header = exports.FavsButton = exports.ErrorMessage = exports.Discount = exports.CheckTotals = exports.CheckoutTotals = exports.CheckoutPromoCode = exports.CheckoutHeader = exports.CheckoutFooter = exports.CheckoutContent = exports.CheckoutCart = exports.Checkout = exports.CategoryNavOther = exports.CategoryNavItem = exports.CategoryNav = exports.CategoryItem = exports.CartUpsells = exports.CartUpsellItem = exports.CartItem = exports.CartButton = exports.Cart = exports.Card = exports.CancelButton = exports.ButtonLink = exports.Applied = exports.Allergen = exports.AccountSection = exports.AccountLoyalty = void 0;
|
|
4
|
-
exports.
|
|
4
|
+
exports.IdleModal = exports.Upsells = exports.UpsellItem = exports.TextArea = exports.Tag = exports.SuccessMessage = exports.SignUp = exports.SignInQr = exports.SignInPhone = exports.SignInOptionsModal = exports.SignInCheckout = exports.SignInButton = exports.SignIn = exports.Rewards = exports.Reward = exports.Quantity = exports.PromoCode = exports.PointsRewards = exports.PointsReward = void 0;
|
|
5
5
|
var tslib_1 = require("tslib");
|
|
6
6
|
var AccountLoyalty_1 = tslib_1.__importDefault(require("./AccountLoyalty"));
|
|
7
7
|
exports.AccountLoyalty = AccountLoyalty_1.default;
|
|
@@ -133,14 +133,8 @@ var SignUp_1 = tslib_1.__importDefault(require("./SignUp"));
|
|
|
133
133
|
exports.SignUp = SignUp_1.default;
|
|
134
134
|
var SuccessMessage_1 = tslib_1.__importDefault(require("./SuccessMessage"));
|
|
135
135
|
exports.SuccessMessage = SuccessMessage_1.default;
|
|
136
|
-
var Switch_1 = tslib_1.__importDefault(require("./Switch"));
|
|
137
|
-
exports.Switch = Switch_1.default;
|
|
138
136
|
var Tag_1 = tslib_1.__importDefault(require("./Tag"));
|
|
139
137
|
exports.Tag = Tag_1.default;
|
|
140
|
-
var TagsButton_1 = tslib_1.__importDefault(require("./TagsButton"));
|
|
141
|
-
exports.TagsButton = TagsButton_1.default;
|
|
142
|
-
var TagsFilter_1 = tslib_1.__importDefault(require("./TagsFilter"));
|
|
143
|
-
exports.TagsFilter = TagsFilter_1.default;
|
|
144
138
|
var TextArea_1 = tslib_1.__importDefault(require("./TextArea"));
|
|
145
139
|
exports.TextArea = TextArea_1.default;
|
|
146
140
|
var UpsellItem_1 = tslib_1.__importDefault(require("./UpsellItem"));
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Arrivals, CheckoutTender, CustomerEndpoints, CustomerIdentifier, CustomerIdentify, Discount, Discounts, ItemTypes, Menu, Order, Orders, OrderCreatePos, OrderTender, OrderUpdate, OrderType, RequestedAt, RevenueCenter, SelectOptions, ServiceType, TicketUpdate, TicketsUpdate, TicketStatusUpdate, EntityType, KioskConfig, Store, Settings, InternalSettings, GiftCardCredit, GiftCardBalance, Employee, Punch, Employees, CashEvent, CashSummary, ErrorAlerts, ErrorAlert, OfflineAuths, OfflineAuthsResult, MenuColors, MenuPages, Surcharges, Taxes, CheckoutTenderPos, Refund, DeviceRead, OrderCreateSendReceipt
|
|
1
|
+
import { Arrivals, CheckoutTender, CustomerEndpoints, CustomerIdentifier, CustomerIdentify, Discount, Discounts, ItemTypes, Menu, Order, Orders, OrderCreatePos, OrderTender, OrderUpdate, OrderType, RequestedAt, RevenueCenter, SelectOptions, ServiceType, TicketUpdate, TicketsUpdate, TicketStatusUpdate, EntityType, KioskConfig, Store, Settings, InternalSettings, GiftCardCredit, GiftCardBalance, Employee, Punch, Employees, CashEvent, CashSummary, ErrorAlerts, ErrorAlert, OfflineAuths, OfflineAuthsResult, MenuColors, MenuPages, Surcharges, Taxes, CheckoutTenderPos, Refund, DeviceRead, OrderCreateSendReceipt } from '@open-tender/types';
|
|
2
2
|
import { OrdersParams } from '../slices';
|
|
3
3
|
export interface InitAPI {
|
|
4
4
|
apiUrl: string;
|
|
@@ -79,6 +79,5 @@ declare class PosAPI {
|
|
|
79
79
|
postAcknowledgeArrival(orderId: string): Promise<Order>;
|
|
80
80
|
postRefundValidate(orderId: string, refund: Refund): Promise<Order>;
|
|
81
81
|
postRefund(orderId: string, refund: Refund): Promise<Order>;
|
|
82
|
-
getTags(): Promise<Tags>;
|
|
83
82
|
}
|
|
84
83
|
export default PosAPI;
|
package/dist/cjs/services/api.js
CHANGED
|
@@ -372,9 +372,6 @@ var PosAPI = /** @class */ (function () {
|
|
|
372
372
|
PosAPI.prototype.postRefund = function (orderId, refund) {
|
|
373
373
|
return this.request("/orders/".concat(orderId, "/refund"), 'POST', refund);
|
|
374
374
|
};
|
|
375
|
-
PosAPI.prototype.getTags = function () {
|
|
376
|
-
return this.request("/tags");
|
|
377
|
-
};
|
|
378
375
|
return PosAPI;
|
|
379
376
|
}());
|
|
380
377
|
exports.default = PosAPI;
|
|
@@ -63,7 +63,6 @@ export declare const selectCustomerLoyalty: ((state: {
|
|
|
63
63
|
surcharges: import("./surcharges").SurchargesState;
|
|
64
64
|
taxes: import("./taxes").TaxesState;
|
|
65
65
|
idle: import("./idle").IdleState;
|
|
66
|
-
tags: import("./tags").TagsState;
|
|
67
66
|
}) => LoyaltyProgramSummary | null) & {
|
|
68
67
|
clearCache: () => void;
|
|
69
68
|
resultsCount: () => number;
|
package/dist/cjs/slices/index.js
CHANGED
|
@@ -28,4 +28,3 @@ tslib_1.__exportStar(require("./sidebar"), exports);
|
|
|
28
28
|
tslib_1.__exportStar(require("./surcharges"), exports);
|
|
29
29
|
tslib_1.__exportStar(require("./taxes"), exports);
|
|
30
30
|
tslib_1.__exportStar(require("./idle"), exports);
|
|
31
|
-
tslib_1.__exportStar(require("./tags"), exports);
|
|
@@ -70,7 +70,6 @@ export declare const selectStoreSettings: ((state: {
|
|
|
70
70
|
surcharges: import("./surcharges").SurchargesState;
|
|
71
71
|
taxes: import("./taxes").TaxesState;
|
|
72
72
|
idle: import("./idle").IdleState;
|
|
73
|
-
tags: import("./tags").TagsState;
|
|
74
73
|
}) => Store) & {
|
|
75
74
|
clearCache: () => void;
|
|
76
75
|
resultsCount: () => number;
|
|
@@ -120,7 +119,6 @@ export declare const selectKioskTerminal: ((state: {
|
|
|
120
119
|
surcharges: import("./surcharges").SurchargesState;
|
|
121
120
|
taxes: import("./taxes").TaxesState;
|
|
122
121
|
idle: import("./idle").IdleState;
|
|
123
|
-
tags: import("./tags").TagsState;
|
|
124
122
|
}) => import("@open-tender/types").PosTerminal | null) & {
|
|
125
123
|
clearCache: () => void;
|
|
126
124
|
resultsCount: () => number;
|
|
@@ -170,7 +168,6 @@ export declare const selectKioskHasPrinter: ((state: {
|
|
|
170
168
|
surcharges: import("./surcharges").SurchargesState;
|
|
171
169
|
taxes: import("./taxes").TaxesState;
|
|
172
170
|
idle: import("./idle").IdleState;
|
|
173
|
-
tags: import("./tags").TagsState;
|
|
174
171
|
}) => boolean) & {
|
|
175
172
|
clearCache: () => void;
|
|
176
173
|
resultsCount: () => number;
|
|
@@ -220,7 +217,6 @@ export declare const selectKioskHasScanner: ((state: {
|
|
|
220
217
|
surcharges: import("./surcharges").SurchargesState;
|
|
221
218
|
taxes: import("./taxes").TaxesState;
|
|
222
219
|
idle: import("./idle").IdleState;
|
|
223
|
-
tags: import("./tags").TagsState;
|
|
224
220
|
}) => boolean) & {
|
|
225
221
|
clearCache: () => void;
|
|
226
222
|
resultsCount: () => number;
|
|
@@ -270,7 +266,6 @@ export declare const selectKioskApi: ((state: {
|
|
|
270
266
|
surcharges: import("./surcharges").SurchargesState;
|
|
271
267
|
taxes: import("./taxes").TaxesState;
|
|
272
268
|
idle: import("./idle").IdleState;
|
|
273
|
-
tags: import("./tags").TagsState;
|
|
274
269
|
}) => string) & {
|
|
275
270
|
clearCache: () => void;
|
|
276
271
|
resultsCount: () => number;
|
|
@@ -320,7 +315,6 @@ export declare const selectKioskConfig: ((state: {
|
|
|
320
315
|
surcharges: import("./surcharges").SurchargesState;
|
|
321
316
|
taxes: import("./taxes").TaxesState;
|
|
322
317
|
idle: import("./idle").IdleState;
|
|
323
|
-
tags: import("./tags").TagsState;
|
|
324
318
|
}) => AppConfig) & {
|
|
325
319
|
clearCache: () => void;
|
|
326
320
|
resultsCount: () => number;
|
|
@@ -370,7 +364,6 @@ export declare const selectKioskConfigScreen: (screen: string) => ((state: {
|
|
|
370
364
|
surcharges: import("./surcharges").SurchargesState;
|
|
371
365
|
taxes: import("./taxes").TaxesState;
|
|
372
366
|
idle: import("./idle").IdleState;
|
|
373
|
-
tags: import("./tags").TagsState;
|
|
374
367
|
}) => import("@open-tender/ui").ScreenConfig | null) & {
|
|
375
368
|
clearCache: () => void;
|
|
376
369
|
resultsCount: () => number;
|
|
@@ -48,7 +48,6 @@ export declare const selectMenuPagesFiltered: ((state: {
|
|
|
48
48
|
surcharges: import("./surcharges").SurchargesState;
|
|
49
49
|
taxes: import("./taxes").TaxesState;
|
|
50
50
|
idle: import("./idle").IdleState;
|
|
51
|
-
tags: import("./tags").TagsState;
|
|
52
51
|
}) => {
|
|
53
52
|
order_type: import("@open-tender/types").FullOrderType;
|
|
54
53
|
name: string;
|
|
@@ -91,7 +91,6 @@ export declare const selectCartIds: ((state: {
|
|
|
91
91
|
surcharges: import("./surcharges").SurchargesState;
|
|
92
92
|
taxes: import("./taxes").TaxesState;
|
|
93
93
|
idle: import("./idle").IdleState;
|
|
94
|
-
tags: import("./tags").TagsState;
|
|
95
94
|
}) => number[]) & {
|
|
96
95
|
clearCache: () => void;
|
|
97
96
|
resultsCount: () => number;
|
|
@@ -141,7 +140,6 @@ export declare const selectCartQuantity: ((state: {
|
|
|
141
140
|
surcharges: import("./surcharges").SurchargesState;
|
|
142
141
|
taxes: import("./taxes").TaxesState;
|
|
143
142
|
idle: import("./idle").IdleState;
|
|
144
|
-
tags: import("./tags").TagsState;
|
|
145
143
|
}) => number) & {
|
|
146
144
|
clearCache: () => void;
|
|
147
145
|
resultsCount: () => number;
|
|
@@ -191,7 +189,6 @@ export declare const selectCartTotal: ((state: {
|
|
|
191
189
|
surcharges: import("./surcharges").SurchargesState;
|
|
192
190
|
taxes: import("./taxes").TaxesState;
|
|
193
191
|
idle: import("./idle").IdleState;
|
|
194
|
-
tags: import("./tags").TagsState;
|
|
195
192
|
}) => number) & {
|
|
196
193
|
clearCache: () => void;
|
|
197
194
|
resultsCount: () => number;
|
|
@@ -241,7 +238,6 @@ export declare const selectCartTotals: ((state: {
|
|
|
241
238
|
surcharges: import("./surcharges").SurchargesState;
|
|
242
239
|
taxes: import("./taxes").TaxesState;
|
|
243
240
|
idle: import("./idle").IdleState;
|
|
244
|
-
tags: import("./tags").TagsState;
|
|
245
241
|
}) => {
|
|
246
242
|
count: number;
|
|
247
243
|
total: number;
|
package/dist/cjs/slices/types.js
CHANGED
package/dist/esm/app/hooks.d.ts
CHANGED
|
@@ -28,6 +28,5 @@ export declare const useAppDispatch: () => import("redux-thunk").ThunkDispatch<{
|
|
|
28
28
|
surcharges: import("..").SurchargesState;
|
|
29
29
|
taxes: import("..").TaxesState;
|
|
30
30
|
idle: import("..").IdleState;
|
|
31
|
-
tags: import("..").TagsState;
|
|
32
31
|
}, undefined, import("redux").UnknownAction> & import("redux").Dispatch<import("redux").Action>;
|
|
33
32
|
export declare const useAppSelector: TypedUseSelectorHook<RootState>;
|
package/dist/esm/app/store.d.ts
CHANGED
|
@@ -27,7 +27,6 @@ export declare const appReducer: import("redux").Reducer<{
|
|
|
27
27
|
surcharges: import("../slices").SurchargesState;
|
|
28
28
|
taxes: import("../slices").TaxesState;
|
|
29
29
|
idle: import("../slices").IdleState;
|
|
30
|
-
tags: import("../slices").TagsState;
|
|
31
30
|
}, import("redux").UnknownAction, Partial<{
|
|
32
31
|
alerts: import("@open-tender/types").Alerts | undefined;
|
|
33
32
|
arrivals: import("../slices").ArrivalsState | undefined;
|
|
@@ -56,7 +55,6 @@ export declare const appReducer: import("redux").Reducer<{
|
|
|
56
55
|
surcharges: import("../slices").SurchargesState | undefined;
|
|
57
56
|
taxes: import("../slices").TaxesState | undefined;
|
|
58
57
|
idle: import("../slices").IdleState | undefined;
|
|
59
|
-
tags: import("../slices").TagsState | undefined;
|
|
60
58
|
}>>;
|
|
61
59
|
export type AppState = ReturnType<typeof appReducer>;
|
|
62
60
|
declare const store: import("@reduxjs/toolkit").EnhancedStore<{
|
|
@@ -87,7 +85,6 @@ declare const store: import("@reduxjs/toolkit").EnhancedStore<{
|
|
|
87
85
|
surcharges: import("../slices").SurchargesState;
|
|
88
86
|
taxes: import("../slices").TaxesState;
|
|
89
87
|
idle: import("../slices").IdleState;
|
|
90
|
-
tags: import("../slices").TagsState;
|
|
91
88
|
}, Action, import("@reduxjs/toolkit").Tuple<[import("redux").StoreEnhancer<{
|
|
92
89
|
dispatch: import("redux-thunk").ThunkDispatch<{
|
|
93
90
|
alerts: import("@open-tender/types").Alerts;
|
|
@@ -117,7 +114,6 @@ declare const store: import("@reduxjs/toolkit").EnhancedStore<{
|
|
|
117
114
|
surcharges: import("../slices").SurchargesState;
|
|
118
115
|
taxes: import("../slices").TaxesState;
|
|
119
116
|
idle: import("../slices").IdleState;
|
|
120
|
-
tags: import("../slices").TagsState;
|
|
121
117
|
}, undefined, import("redux").UnknownAction>;
|
|
122
118
|
}>, import("redux").StoreEnhancer]>>;
|
|
123
119
|
export type AppDispatch = typeof store.dispatch;
|
package/dist/esm/app/store.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { combineReducers, configureStore } from '@reduxjs/toolkit';
|
|
2
|
-
import { alertsReducer, arrivalsReducer, cartSummaryReducer, checkoutReducer, configReducer, customerReducer, customerIdentifyReducer, dealsReducer, discountsReducer, errorAlertsReducer, kdsReducer, kioskReducer, menuReducer, menuPagesReducer, modalReducer, notificationsReducer, offlineAuthsReducer, orderReducer, posReducer, punchesReducer, refundReducer, sendReceiptReducer, settingsReducer, sidebarReducer, surchargesReducer, taxesReducer, idleReducer
|
|
2
|
+
import { alertsReducer, arrivalsReducer, cartSummaryReducer, checkoutReducer, configReducer, customerReducer, customerIdentifyReducer, dealsReducer, discountsReducer, errorAlertsReducer, kdsReducer, kioskReducer, menuReducer, menuPagesReducer, modalReducer, notificationsReducer, offlineAuthsReducer, orderReducer, posReducer, punchesReducer, refundReducer, sendReceiptReducer, settingsReducer, sidebarReducer, surchargesReducer, taxesReducer, idleReducer } from '../slices';
|
|
3
3
|
export var appReducer = combineReducers({
|
|
4
4
|
alerts: alertsReducer,
|
|
5
5
|
arrivals: arrivalsReducer,
|
|
@@ -27,8 +27,7 @@ export var appReducer = combineReducers({
|
|
|
27
27
|
sidebar: sidebarReducer,
|
|
28
28
|
surcharges: surchargesReducer,
|
|
29
29
|
taxes: taxesReducer,
|
|
30
|
-
idle: idleReducer
|
|
31
|
-
tags: tagsReducer
|
|
30
|
+
idle: idleReducer
|
|
32
31
|
});
|
|
33
32
|
var rootReducer = function (state, action) {
|
|
34
33
|
if (action.type === 'clearState') {
|
|
@@ -63,11 +63,8 @@ import SignInPhone from './SignInPhone';
|
|
|
63
63
|
import SignInQr from './SignInQr';
|
|
64
64
|
import SignUp from './SignUp';
|
|
65
65
|
import SuccessMessage from './SuccessMessage';
|
|
66
|
-
import Switch from './Switch';
|
|
67
66
|
import Tag from './Tag';
|
|
68
|
-
import TagsButton from './TagsButton';
|
|
69
|
-
import TagsFilter from './TagsFilter';
|
|
70
67
|
import TextArea from './TextArea';
|
|
71
68
|
import UpsellItem from './UpsellItem';
|
|
72
69
|
import Upsells from './Upsells';
|
|
73
|
-
export { AccountLoyalty, AccountSection, Allergen, Applied, ButtonLink, CancelButton, Card, Cart, CartButton, CartItem, CartUpsellItem, CartUpsells, CategoryItem, CategoryNav, CategoryNavItem, CategoryNavOther, Checkout, CheckoutCart, CheckoutContent, CheckoutFooter, CheckoutHeader, CheckoutPromoCode, CheckoutTotals, CheckTotals, Discount, ErrorMessage, FavsButton, Header, Ingredients, Input, InputButton, ItemGroup, ItemGroups, ItemOption, ItemOptionSelected, ItemSize, ItemSelections, Keypad, Loader, MadeForName, MadeForNotes, MenuCategory, MenuOther, ModalContent, ModalHeader, NutritionalInfo, Option, OrderCard, OrderDetails, OrderDetailsItem, PointsReward, PointsRewards, PromoCode, Quantity, Reward, Rewards, SignIn, SignInButton, SignInCheckout, SignInOptionsModal, SignInPhone, SignInQr, SignUp, SuccessMessage, Tag, TextArea, UpsellItem, Upsells, IdleModal
|
|
70
|
+
export { AccountLoyalty, AccountSection, Allergen, Applied, ButtonLink, CancelButton, Card, Cart, CartButton, CartItem, CartUpsellItem, CartUpsells, CategoryItem, CategoryNav, CategoryNavItem, CategoryNavOther, Checkout, CheckoutCart, CheckoutContent, CheckoutFooter, CheckoutHeader, CheckoutPromoCode, CheckoutTotals, CheckTotals, Discount, ErrorMessage, FavsButton, Header, Ingredients, Input, InputButton, ItemGroup, ItemGroups, ItemOption, ItemOptionSelected, ItemSize, ItemSelections, Keypad, Loader, MadeForName, MadeForNotes, MenuCategory, MenuOther, ModalContent, ModalHeader, NutritionalInfo, Option, OrderCard, OrderDetails, OrderDetailsItem, PointsReward, PointsRewards, PromoCode, Quantity, Reward, Rewards, SignIn, SignInButton, SignInCheckout, SignInOptionsModal, SignInPhone, SignInQr, SignUp, SuccessMessage, Tag, TextArea, UpsellItem, Upsells, IdleModal };
|
|
@@ -63,11 +63,8 @@ import SignInPhone from './SignInPhone';
|
|
|
63
63
|
import SignInQr from './SignInQr';
|
|
64
64
|
import SignUp from './SignUp';
|
|
65
65
|
import SuccessMessage from './SuccessMessage';
|
|
66
|
-
import Switch from './Switch';
|
|
67
66
|
import Tag from './Tag';
|
|
68
|
-
import TagsButton from './TagsButton';
|
|
69
|
-
import TagsFilter from './TagsFilter';
|
|
70
67
|
import TextArea from './TextArea';
|
|
71
68
|
import UpsellItem from './UpsellItem';
|
|
72
69
|
import Upsells from './Upsells';
|
|
73
|
-
export { AccountLoyalty, AccountSection, Allergen, Applied, ButtonLink, CancelButton, Card, Cart, CartButton, CartItem, CartUpsellItem, CartUpsells, CategoryItem, CategoryNav, CategoryNavItem, CategoryNavOther, Checkout, CheckoutCart, CheckoutContent, CheckoutFooter, CheckoutHeader, CheckoutPromoCode, CheckoutTotals, CheckTotals, Discount, ErrorMessage, FavsButton, Header, Ingredients, Input, InputButton, ItemGroup, ItemGroups, ItemOption, ItemOptionSelected, ItemSize, ItemSelections, Keypad, Loader, MadeForName, MadeForNotes, MenuCategory, MenuOther, ModalContent, ModalHeader, NutritionalInfo, Option, OrderCard, OrderDetails, OrderDetailsItem, PointsReward, PointsRewards, PromoCode, Quantity, Reward, Rewards, SignIn, SignInButton, SignInCheckout, SignInOptionsModal, SignInPhone, SignInQr, SignUp, SuccessMessage, Tag, TextArea, UpsellItem, Upsells, IdleModal
|
|
70
|
+
export { AccountLoyalty, AccountSection, Allergen, Applied, ButtonLink, CancelButton, Card, Cart, CartButton, CartItem, CartUpsellItem, CartUpsells, CategoryItem, CategoryNav, CategoryNavItem, CategoryNavOther, Checkout, CheckoutCart, CheckoutContent, CheckoutFooter, CheckoutHeader, CheckoutPromoCode, CheckoutTotals, CheckTotals, Discount, ErrorMessage, FavsButton, Header, Ingredients, Input, InputButton, ItemGroup, ItemGroups, ItemOption, ItemOptionSelected, ItemSize, ItemSelections, Keypad, Loader, MadeForName, MadeForNotes, MenuCategory, MenuOther, ModalContent, ModalHeader, NutritionalInfo, Option, OrderCard, OrderDetails, OrderDetailsItem, PointsReward, PointsRewards, PromoCode, Quantity, Reward, Rewards, SignIn, SignInButton, SignInCheckout, SignInOptionsModal, SignInPhone, SignInQr, SignUp, SuccessMessage, Tag, TextArea, UpsellItem, Upsells, IdleModal };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Arrivals, CheckoutTender, CustomerEndpoints, CustomerIdentifier, CustomerIdentify, Discount, Discounts, ItemTypes, Menu, Order, Orders, OrderCreatePos, OrderTender, OrderUpdate, OrderType, RequestedAt, RevenueCenter, SelectOptions, ServiceType, TicketUpdate, TicketsUpdate, TicketStatusUpdate, EntityType, KioskConfig, Store, Settings, InternalSettings, GiftCardCredit, GiftCardBalance, Employee, Punch, Employees, CashEvent, CashSummary, ErrorAlerts, ErrorAlert, OfflineAuths, OfflineAuthsResult, MenuColors, MenuPages, Surcharges, Taxes, CheckoutTenderPos, Refund, DeviceRead, OrderCreateSendReceipt
|
|
1
|
+
import { Arrivals, CheckoutTender, CustomerEndpoints, CustomerIdentifier, CustomerIdentify, Discount, Discounts, ItemTypes, Menu, Order, Orders, OrderCreatePos, OrderTender, OrderUpdate, OrderType, RequestedAt, RevenueCenter, SelectOptions, ServiceType, TicketUpdate, TicketsUpdate, TicketStatusUpdate, EntityType, KioskConfig, Store, Settings, InternalSettings, GiftCardCredit, GiftCardBalance, Employee, Punch, Employees, CashEvent, CashSummary, ErrorAlerts, ErrorAlert, OfflineAuths, OfflineAuthsResult, MenuColors, MenuPages, Surcharges, Taxes, CheckoutTenderPos, Refund, DeviceRead, OrderCreateSendReceipt } from '@open-tender/types';
|
|
2
2
|
import { OrdersParams } from '../slices';
|
|
3
3
|
export interface InitAPI {
|
|
4
4
|
apiUrl: string;
|
|
@@ -79,6 +79,5 @@ declare class PosAPI {
|
|
|
79
79
|
postAcknowledgeArrival(orderId: string): Promise<Order>;
|
|
80
80
|
postRefundValidate(orderId: string, refund: Refund): Promise<Order>;
|
|
81
81
|
postRefund(orderId: string, refund: Refund): Promise<Order>;
|
|
82
|
-
getTags(): Promise<Tags>;
|
|
83
82
|
}
|
|
84
83
|
export default PosAPI;
|
package/dist/esm/services/api.js
CHANGED
|
@@ -370,9 +370,6 @@ var PosAPI = /** @class */ (function () {
|
|
|
370
370
|
PosAPI.prototype.postRefund = function (orderId, refund) {
|
|
371
371
|
return this.request("/orders/".concat(orderId, "/refund"), 'POST', refund);
|
|
372
372
|
};
|
|
373
|
-
PosAPI.prototype.getTags = function () {
|
|
374
|
-
return this.request("/tags");
|
|
375
|
-
};
|
|
376
373
|
return PosAPI;
|
|
377
374
|
}());
|
|
378
375
|
export default PosAPI;
|
|
@@ -63,7 +63,6 @@ export declare const selectCustomerLoyalty: ((state: {
|
|
|
63
63
|
surcharges: import("./surcharges").SurchargesState;
|
|
64
64
|
taxes: import("./taxes").TaxesState;
|
|
65
65
|
idle: import("./idle").IdleState;
|
|
66
|
-
tags: import("./tags").TagsState;
|
|
67
66
|
}) => LoyaltyProgramSummary | null) & {
|
|
68
67
|
clearCache: () => void;
|
|
69
68
|
resultsCount: () => number;
|
package/dist/esm/slices/index.js
CHANGED
|
@@ -70,7 +70,6 @@ export declare const selectStoreSettings: ((state: {
|
|
|
70
70
|
surcharges: import("./surcharges").SurchargesState;
|
|
71
71
|
taxes: import("./taxes").TaxesState;
|
|
72
72
|
idle: import("./idle").IdleState;
|
|
73
|
-
tags: import("./tags").TagsState;
|
|
74
73
|
}) => Store) & {
|
|
75
74
|
clearCache: () => void;
|
|
76
75
|
resultsCount: () => number;
|
|
@@ -120,7 +119,6 @@ export declare const selectKioskTerminal: ((state: {
|
|
|
120
119
|
surcharges: import("./surcharges").SurchargesState;
|
|
121
120
|
taxes: import("./taxes").TaxesState;
|
|
122
121
|
idle: import("./idle").IdleState;
|
|
123
|
-
tags: import("./tags").TagsState;
|
|
124
122
|
}) => import("@open-tender/types").PosTerminal | null) & {
|
|
125
123
|
clearCache: () => void;
|
|
126
124
|
resultsCount: () => number;
|
|
@@ -170,7 +168,6 @@ export declare const selectKioskHasPrinter: ((state: {
|
|
|
170
168
|
surcharges: import("./surcharges").SurchargesState;
|
|
171
169
|
taxes: import("./taxes").TaxesState;
|
|
172
170
|
idle: import("./idle").IdleState;
|
|
173
|
-
tags: import("./tags").TagsState;
|
|
174
171
|
}) => boolean) & {
|
|
175
172
|
clearCache: () => void;
|
|
176
173
|
resultsCount: () => number;
|
|
@@ -220,7 +217,6 @@ export declare const selectKioskHasScanner: ((state: {
|
|
|
220
217
|
surcharges: import("./surcharges").SurchargesState;
|
|
221
218
|
taxes: import("./taxes").TaxesState;
|
|
222
219
|
idle: import("./idle").IdleState;
|
|
223
|
-
tags: import("./tags").TagsState;
|
|
224
220
|
}) => boolean) & {
|
|
225
221
|
clearCache: () => void;
|
|
226
222
|
resultsCount: () => number;
|
|
@@ -270,7 +266,6 @@ export declare const selectKioskApi: ((state: {
|
|
|
270
266
|
surcharges: import("./surcharges").SurchargesState;
|
|
271
267
|
taxes: import("./taxes").TaxesState;
|
|
272
268
|
idle: import("./idle").IdleState;
|
|
273
|
-
tags: import("./tags").TagsState;
|
|
274
269
|
}) => string) & {
|
|
275
270
|
clearCache: () => void;
|
|
276
271
|
resultsCount: () => number;
|
|
@@ -320,7 +315,6 @@ export declare const selectKioskConfig: ((state: {
|
|
|
320
315
|
surcharges: import("./surcharges").SurchargesState;
|
|
321
316
|
taxes: import("./taxes").TaxesState;
|
|
322
317
|
idle: import("./idle").IdleState;
|
|
323
|
-
tags: import("./tags").TagsState;
|
|
324
318
|
}) => AppConfig) & {
|
|
325
319
|
clearCache: () => void;
|
|
326
320
|
resultsCount: () => number;
|
|
@@ -370,7 +364,6 @@ export declare const selectKioskConfigScreen: (screen: string) => ((state: {
|
|
|
370
364
|
surcharges: import("./surcharges").SurchargesState;
|
|
371
365
|
taxes: import("./taxes").TaxesState;
|
|
372
366
|
idle: import("./idle").IdleState;
|
|
373
|
-
tags: import("./tags").TagsState;
|
|
374
367
|
}) => import("@open-tender/ui").ScreenConfig | null) & {
|
|
375
368
|
clearCache: () => void;
|
|
376
369
|
resultsCount: () => number;
|
|
@@ -48,7 +48,6 @@ export declare const selectMenuPagesFiltered: ((state: {
|
|
|
48
48
|
surcharges: import("./surcharges").SurchargesState;
|
|
49
49
|
taxes: import("./taxes").TaxesState;
|
|
50
50
|
idle: import("./idle").IdleState;
|
|
51
|
-
tags: import("./tags").TagsState;
|
|
52
51
|
}) => {
|
|
53
52
|
order_type: import("@open-tender/types").FullOrderType;
|
|
54
53
|
name: string;
|
|
@@ -91,7 +91,6 @@ export declare const selectCartIds: ((state: {
|
|
|
91
91
|
surcharges: import("./surcharges").SurchargesState;
|
|
92
92
|
taxes: import("./taxes").TaxesState;
|
|
93
93
|
idle: import("./idle").IdleState;
|
|
94
|
-
tags: import("./tags").TagsState;
|
|
95
94
|
}) => number[]) & {
|
|
96
95
|
clearCache: () => void;
|
|
97
96
|
resultsCount: () => number;
|
|
@@ -141,7 +140,6 @@ export declare const selectCartQuantity: ((state: {
|
|
|
141
140
|
surcharges: import("./surcharges").SurchargesState;
|
|
142
141
|
taxes: import("./taxes").TaxesState;
|
|
143
142
|
idle: import("./idle").IdleState;
|
|
144
|
-
tags: import("./tags").TagsState;
|
|
145
143
|
}) => number) & {
|
|
146
144
|
clearCache: () => void;
|
|
147
145
|
resultsCount: () => number;
|
|
@@ -191,7 +189,6 @@ export declare const selectCartTotal: ((state: {
|
|
|
191
189
|
surcharges: import("./surcharges").SurchargesState;
|
|
192
190
|
taxes: import("./taxes").TaxesState;
|
|
193
191
|
idle: import("./idle").IdleState;
|
|
194
|
-
tags: import("./tags").TagsState;
|
|
195
192
|
}) => number) & {
|
|
196
193
|
clearCache: () => void;
|
|
197
194
|
resultsCount: () => number;
|
|
@@ -241,7 +238,6 @@ export declare const selectCartTotals: ((state: {
|
|
|
241
238
|
surcharges: import("./surcharges").SurchargesState;
|
|
242
239
|
taxes: import("./taxes").TaxesState;
|
|
243
240
|
idle: import("./idle").IdleState;
|
|
244
|
-
tags: import("./tags").TagsState;
|
|
245
241
|
}) => {
|
|
246
242
|
count: number;
|
|
247
243
|
total: number;
|
package/dist/esm/slices/types.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@open-tender/store",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.177",
|
|
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",
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { SwitchProps } from '@open-tender/ui';
|
|
2
|
-
import { ReactNode } from 'react';
|
|
3
|
-
declare const Switch: ({ id, label, on, isRequired, disabled, falseTrackColor, thumbColor, trueTrackColor, onChange, children }: {
|
|
4
|
-
id: number | string;
|
|
5
|
-
label: string;
|
|
6
|
-
on: boolean;
|
|
7
|
-
falseTrackColor?: string;
|
|
8
|
-
trueTrackColor?: string;
|
|
9
|
-
thumbColor?: string;
|
|
10
|
-
isRequired: boolean;
|
|
11
|
-
disabled: boolean;
|
|
12
|
-
onChange: (value: boolean) => void;
|
|
13
|
-
children: (props: SwitchProps) => ReactNode;
|
|
14
|
-
}) => ReactNode;
|
|
15
|
-
export default Switch;
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
var hooks_1 = require("../app/hooks");
|
|
4
|
-
var slices_1 = require("../slices");
|
|
5
|
-
var Switch = function (_a) {
|
|
6
|
-
var id = _a.id, label = _a.label, on = _a.on, isRequired = _a.isRequired, disabled = _a.disabled, falseTrackColor = _a.falseTrackColor, thumbColor = _a.thumbColor, trueTrackColor = _a.trueTrackColor, onChange = _a.onChange, children = _a.children;
|
|
7
|
-
var config = (0, hooks_1.useAppSelector)(slices_1.selectKioskConfig).switch;
|
|
8
|
-
if (!config)
|
|
9
|
-
return null;
|
|
10
|
-
return children({
|
|
11
|
-
id: id,
|
|
12
|
-
config: config,
|
|
13
|
-
label: label,
|
|
14
|
-
value: on,
|
|
15
|
-
onTagSwitch: onChange,
|
|
16
|
-
isRequired: isRequired,
|
|
17
|
-
disabled: disabled,
|
|
18
|
-
falseTrackColor: falseTrackColor,
|
|
19
|
-
thumbColor: thumbColor,
|
|
20
|
-
trueTrackColor: trueTrackColor
|
|
21
|
-
});
|
|
22
|
-
};
|
|
23
|
-
exports.default = Switch;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
var react_1 = require("react");
|
|
4
|
-
var hooks_1 = require("../app/hooks");
|
|
5
|
-
var slices_1 = require("../slices");
|
|
6
|
-
var TagsButton = function (_a) {
|
|
7
|
-
var children = _a.children;
|
|
8
|
-
var config = (0, hooks_1.useAppSelector)(slices_1.selectKioskConfig).tag;
|
|
9
|
-
var isTagsModalShown = (0, hooks_1.useAppSelector)(slices_1.selectShowTagsModal);
|
|
10
|
-
var selectedTags = (0, hooks_1.useAppSelector)(slices_1.selectSelectedTags);
|
|
11
|
-
var dispatch = (0, hooks_1.useAppDispatch)();
|
|
12
|
-
var onClick = (0, react_1.useCallback)(function () {
|
|
13
|
-
dispatch((0, slices_1.toggleTagsModal)(!isTagsModalShown));
|
|
14
|
-
}, [dispatch, isTagsModalShown]);
|
|
15
|
-
var handlers = { onClick: onClick };
|
|
16
|
-
return children({ config: config, handlers: handlers, isSelected: selectedTags.length > 0 });
|
|
17
|
-
};
|
|
18
|
-
exports.default = TagsButton;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { SwitchProps, TagsFilterProps } from '@open-tender/ui';
|
|
2
|
-
import React, { ReactNode } from 'react';
|
|
3
|
-
declare const TagsFilter: ({ children, SwitchView }: {
|
|
4
|
-
children: (props: TagsFilterProps) => ReactNode;
|
|
5
|
-
SwitchView: (props: SwitchProps) => ReactNode;
|
|
6
|
-
}) => React.ReactNode;
|
|
7
|
-
export default TagsFilter;
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
var tslib_1 = require("tslib");
|
|
4
|
-
var utils_1 = require("@open-tender/utils");
|
|
5
|
-
var react_1 = tslib_1.__importStar(require("react"));
|
|
6
|
-
var hooks_1 = require("../app/hooks");
|
|
7
|
-
var slices_1 = require("../slices");
|
|
8
|
-
var Switch_1 = tslib_1.__importDefault(require("./Switch"));
|
|
9
|
-
var TagsFilter = function (_a) {
|
|
10
|
-
var children = _a.children, SwitchView = _a.SwitchView;
|
|
11
|
-
var config = (0, hooks_1.useAppSelector)(slices_1.selectKioskConfig).tags;
|
|
12
|
-
var dispatch = (0, hooks_1.useAppDispatch)();
|
|
13
|
-
var _b = (0, hooks_1.useAppSelector)(slices_1.selectTags), tags = _b.entities, selectedTags = _b.selectedTags, loading = _b.loading, error = _b.error;
|
|
14
|
-
var _c = (0, react_1.useState)([]), localSelectedTags = _c[0], setLocalSelectedTags = _c[1];
|
|
15
|
-
var isLoading = loading === 'pending';
|
|
16
|
-
(0, react_1.useEffect)(function () {
|
|
17
|
-
setLocalSelectedTags(selectedTags.map(function (tag) { return tag.tag_id; }));
|
|
18
|
-
}, [selectedTags]);
|
|
19
|
-
var onTagSwitch = function (tag) {
|
|
20
|
-
setLocalSelectedTags(function (prevSelectedTags) {
|
|
21
|
-
if (prevSelectedTags.includes(tag.tag_id)) {
|
|
22
|
-
return prevSelectedTags.filter(function (id) { return id !== tag.tag_id; });
|
|
23
|
-
}
|
|
24
|
-
else {
|
|
25
|
-
return tslib_1.__spreadArray(tslib_1.__spreadArray([], prevSelectedTags, true), [tag.tag_id], false);
|
|
26
|
-
}
|
|
27
|
-
});
|
|
28
|
-
};
|
|
29
|
-
var handleSubmit = function () {
|
|
30
|
-
var newSelectedTags = tags.filter(function (tag) {
|
|
31
|
-
return localSelectedTags.includes(tag.tag_id);
|
|
32
|
-
});
|
|
33
|
-
dispatch((0, slices_1.setSelectedTags)(newSelectedTags));
|
|
34
|
-
};
|
|
35
|
-
var handlers = { onTagSwitch: onTagSwitch, handleSubmit: handleSubmit };
|
|
36
|
-
var renderSwitch = (0, react_1.useCallback)(function (tag) {
|
|
37
|
-
return (react_1.default.createElement(Switch_1.default, { key: tag.tag_id, id: tag.tag_id, children: SwitchView, label: (0, utils_1.capitalize)(tag.name), on: localSelectedTags.includes(tag.tag_id), onChange: function () { return onTagSwitch(tag); }, disabled: false, isRequired: true }));
|
|
38
|
-
}, [SwitchView, localSelectedTags]);
|
|
39
|
-
return children({
|
|
40
|
-
config: config,
|
|
41
|
-
handlers: handlers,
|
|
42
|
-
isLoading: isLoading,
|
|
43
|
-
renderSwitch: renderSwitch,
|
|
44
|
-
tags: tags,
|
|
45
|
-
error: error === null || error === void 0 ? void 0 : error.detail
|
|
46
|
-
});
|
|
47
|
-
};
|
|
48
|
-
exports.default = TagsFilter;
|
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
import { Tags, RequestError, RequestStatus } from '@open-tender/types';
|
|
2
|
-
import { AppState } from '../app';
|
|
3
|
-
export interface TagsState {
|
|
4
|
-
entities: Tags;
|
|
5
|
-
error: RequestError;
|
|
6
|
-
loading: RequestStatus;
|
|
7
|
-
selectedTags: Tags;
|
|
8
|
-
showTagsModal: boolean;
|
|
9
|
-
}
|
|
10
|
-
export declare enum TagsActionType {
|
|
11
|
-
FetchTags = "tags/fetchTags"
|
|
12
|
-
}
|
|
13
|
-
export declare const fetchTags: import("@reduxjs/toolkit").AsyncThunk<Tags, void, {
|
|
14
|
-
state: AppState;
|
|
15
|
-
rejectValue: RequestError;
|
|
16
|
-
dispatch?: import("redux").Dispatch<import("redux").UnknownAction> | undefined;
|
|
17
|
-
extra?: unknown;
|
|
18
|
-
serializedErrorType?: unknown;
|
|
19
|
-
pendingMeta?: unknown;
|
|
20
|
-
fulfilledMeta?: unknown;
|
|
21
|
-
rejectedMeta?: unknown;
|
|
22
|
-
}>;
|
|
23
|
-
export declare const resetTags: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"tags/resetTags">, setSelectedTags: import("@reduxjs/toolkit").ActionCreatorWithPayload<any, "tags/setSelectedTags">, toggleTagsModal: import("@reduxjs/toolkit").ActionCreatorWithPayload<any, "tags/toggleTagsModal">;
|
|
24
|
-
export declare const selectTags: (state: AppState) => TagsState;
|
|
25
|
-
export declare const selectSelectedTags: (state: AppState) => Tags;
|
|
26
|
-
export declare const selectShowTagsModal: (state: AppState) => boolean;
|
|
27
|
-
export declare const selectSelectedTagNames: ((state: {
|
|
28
|
-
alerts: import("@open-tender/types").Alerts;
|
|
29
|
-
arrivals: import("./arrivals").ArrivalsState;
|
|
30
|
-
cartSummary: import("./cartSummary").CartSummaryState;
|
|
31
|
-
checkout: import("./checkout").CheckoutState;
|
|
32
|
-
config: import("./config").ConfigState;
|
|
33
|
-
customer: import("./customer").CustomerState;
|
|
34
|
-
customerIdentify: import("./customerIdentify").CustomerIdentifyState;
|
|
35
|
-
deals: import("./deals").DealsState;
|
|
36
|
-
discounts: import("./discounts").DiscountsState;
|
|
37
|
-
errorAlerts: import("./errorAlerts").ErrorAlertsState;
|
|
38
|
-
kds: import("./kds").KdsState;
|
|
39
|
-
kiosk: import("./kiosk").KioskState;
|
|
40
|
-
menu: import("./menu").MenuState;
|
|
41
|
-
menuPages: import("./menuPages").MenuPagesState;
|
|
42
|
-
modal: import("./modal").ModalState;
|
|
43
|
-
notifications: import("@open-tender/types").Notifications;
|
|
44
|
-
offlineAuths: import("./offlineAuths").OfflineAuthsState;
|
|
45
|
-
order: import("./order").OrderState;
|
|
46
|
-
pos: import("./pos").PosState;
|
|
47
|
-
punches: import("./punches").PunchesState;
|
|
48
|
-
refund: import("./refund").RefundState;
|
|
49
|
-
sendReceipt: import("./sendReceipt").SendReceiptState;
|
|
50
|
-
settings: import("./settings").SettingsState;
|
|
51
|
-
sidebar: import("./sidebar").SidebarState;
|
|
52
|
-
surcharges: import("./surcharges").SurchargesState;
|
|
53
|
-
taxes: import("./taxes").TaxesState;
|
|
54
|
-
idle: import("./idle").IdleState;
|
|
55
|
-
tags: TagsState;
|
|
56
|
-
}) => string[]) & {
|
|
57
|
-
clearCache: () => void;
|
|
58
|
-
resultsCount: () => number;
|
|
59
|
-
resetResultsCount: () => void;
|
|
60
|
-
} & {
|
|
61
|
-
resultFunc: (resultFuncArgs_0: {
|
|
62
|
-
tags: Tags;
|
|
63
|
-
selectedTags: Tags;
|
|
64
|
-
}) => string[];
|
|
65
|
-
memoizedResultFunc: ((resultFuncArgs_0: {
|
|
66
|
-
tags: Tags;
|
|
67
|
-
selectedTags: Tags;
|
|
68
|
-
}) => string[]) & {
|
|
69
|
-
clearCache: () => void;
|
|
70
|
-
resultsCount: () => number;
|
|
71
|
-
resetResultsCount: () => void;
|
|
72
|
-
};
|
|
73
|
-
lastResult: () => string[];
|
|
74
|
-
dependencies: [(state: AppState) => {
|
|
75
|
-
tags: Tags;
|
|
76
|
-
selectedTags: Tags;
|
|
77
|
-
}];
|
|
78
|
-
recomputations: () => number;
|
|
79
|
-
resetRecomputations: () => void;
|
|
80
|
-
dependencyRecomputations: () => number;
|
|
81
|
-
resetDependencyRecomputations: () => void;
|
|
82
|
-
} & {
|
|
83
|
-
argsMemoize: typeof import("reselect").weakMapMemoize;
|
|
84
|
-
memoize: typeof import("reselect").weakMapMemoize;
|
|
85
|
-
};
|
|
86
|
-
export declare const tagsReducer: import("redux").Reducer<TagsState>;
|
package/dist/cjs/slices/tags.js
DELETED
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var _a;
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.tagsReducer = exports.selectSelectedTagNames = exports.selectShowTagsModal = exports.selectSelectedTags = exports.selectTags = exports.toggleTagsModal = exports.setSelectedTags = exports.resetTags = exports.fetchTags = exports.TagsActionType = void 0;
|
|
5
|
-
var tslib_1 = require("tslib");
|
|
6
|
-
var toolkit_1 = require("@reduxjs/toolkit");
|
|
7
|
-
var types_1 = require("./types");
|
|
8
|
-
var initialState = {
|
|
9
|
-
entities: [],
|
|
10
|
-
error: null,
|
|
11
|
-
loading: 'idle',
|
|
12
|
-
selectedTags: [],
|
|
13
|
-
showTagsModal: false
|
|
14
|
-
};
|
|
15
|
-
var TagsActionType;
|
|
16
|
-
(function (TagsActionType) {
|
|
17
|
-
TagsActionType["FetchTags"] = "tags/fetchTags";
|
|
18
|
-
})(TagsActionType || (exports.TagsActionType = TagsActionType = {}));
|
|
19
|
-
exports.fetchTags = (0, toolkit_1.createAsyncThunk)(TagsActionType.FetchTags, function (_1, _a) { return tslib_1.__awaiter(void 0, [_1, _a], void 0, function (_, _b) {
|
|
20
|
-
var api, data, err_1;
|
|
21
|
-
var getState = _b.getState, rejectWithValue = _b.rejectWithValue;
|
|
22
|
-
return tslib_1.__generator(this, function (_c) {
|
|
23
|
-
switch (_c.label) {
|
|
24
|
-
case 0:
|
|
25
|
-
_c.trys.push([0, 2, , 3]);
|
|
26
|
-
api = getState().config.api;
|
|
27
|
-
return [4 /*yield*/, api.getTags()];
|
|
28
|
-
case 1:
|
|
29
|
-
data = _c.sent();
|
|
30
|
-
return [2 /*return*/, data];
|
|
31
|
-
case 2:
|
|
32
|
-
err_1 = _c.sent();
|
|
33
|
-
return [2 /*return*/, rejectWithValue(err_1)];
|
|
34
|
-
case 3: return [2 /*return*/];
|
|
35
|
-
}
|
|
36
|
-
});
|
|
37
|
-
}); });
|
|
38
|
-
var tagsSlice = (0, toolkit_1.createSlice)({
|
|
39
|
-
name: types_1.ReducerType.Tags,
|
|
40
|
-
initialState: initialState,
|
|
41
|
-
reducers: {
|
|
42
|
-
resetTags: function () { return initialState; },
|
|
43
|
-
setSelectedTags: function (state, action) {
|
|
44
|
-
state.selectedTags = action.payload;
|
|
45
|
-
},
|
|
46
|
-
toggleTagsModal: function (state, action) {
|
|
47
|
-
state.showTagsModal = action.payload;
|
|
48
|
-
}
|
|
49
|
-
},
|
|
50
|
-
extraReducers: function (builder) {
|
|
51
|
-
builder
|
|
52
|
-
.addCase(exports.fetchTags.fulfilled, function (state, action) {
|
|
53
|
-
state.entities = action.payload;
|
|
54
|
-
state.loading = 'idle';
|
|
55
|
-
state.error = null;
|
|
56
|
-
})
|
|
57
|
-
.addCase(exports.fetchTags.pending, function (state) {
|
|
58
|
-
state.loading = 'pending';
|
|
59
|
-
})
|
|
60
|
-
.addCase(exports.fetchTags.rejected, function (state, action) {
|
|
61
|
-
state.error = action.payload;
|
|
62
|
-
state.loading = 'idle';
|
|
63
|
-
});
|
|
64
|
-
}
|
|
65
|
-
});
|
|
66
|
-
exports.resetTags = (_a = tagsSlice.actions, _a.resetTags), exports.setSelectedTags = _a.setSelectedTags, exports.toggleTagsModal = _a.toggleTagsModal;
|
|
67
|
-
var selectTags = function (state) { return state.tags; };
|
|
68
|
-
exports.selectTags = selectTags;
|
|
69
|
-
var selectSelectedTags = function (state) { return state.tags.selectedTags; };
|
|
70
|
-
exports.selectSelectedTags = selectSelectedTags;
|
|
71
|
-
var selectShowTagsModal = function (state) { return state.tags.showTagsModal; };
|
|
72
|
-
exports.selectShowTagsModal = selectShowTagsModal;
|
|
73
|
-
exports.selectSelectedTagNames = (0, toolkit_1.createSelector)(function (state) {
|
|
74
|
-
var _a = state.tags, tags = _a.entities, selectedTags = _a.selectedTags;
|
|
75
|
-
return { tags: tags, selectedTags: selectedTags };
|
|
76
|
-
}, function (_a) {
|
|
77
|
-
var tags = _a.tags, selectedTags = _a.selectedTags;
|
|
78
|
-
if (!selectedTags)
|
|
79
|
-
return [];
|
|
80
|
-
var selected = selectedTags.map(function (i) {
|
|
81
|
-
var _a;
|
|
82
|
-
var tag = tags.find(function (a) { return a.tag_id === i.tag_id; });
|
|
83
|
-
return tag ? (_a = tag.name) !== null && _a !== void 0 ? _a : '' : '';
|
|
84
|
-
});
|
|
85
|
-
return selected;
|
|
86
|
-
});
|
|
87
|
-
exports.tagsReducer = tagsSlice.reducer;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { SwitchProps } from '@open-tender/ui';
|
|
2
|
-
import { ReactNode } from 'react';
|
|
3
|
-
declare const Switch: ({ id, label, on, isRequired, disabled, falseTrackColor, thumbColor, trueTrackColor, onChange, children }: {
|
|
4
|
-
id: number | string;
|
|
5
|
-
label: string;
|
|
6
|
-
on: boolean;
|
|
7
|
-
falseTrackColor?: string;
|
|
8
|
-
trueTrackColor?: string;
|
|
9
|
-
thumbColor?: string;
|
|
10
|
-
isRequired: boolean;
|
|
11
|
-
disabled: boolean;
|
|
12
|
-
onChange: (value: boolean) => void;
|
|
13
|
-
children: (props: SwitchProps) => ReactNode;
|
|
14
|
-
}) => ReactNode;
|
|
15
|
-
export default Switch;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { useAppSelector } from '../app/hooks';
|
|
2
|
-
import { selectKioskConfig } from '../slices';
|
|
3
|
-
var Switch = function (_a) {
|
|
4
|
-
var id = _a.id, label = _a.label, on = _a.on, isRequired = _a.isRequired, disabled = _a.disabled, falseTrackColor = _a.falseTrackColor, thumbColor = _a.thumbColor, trueTrackColor = _a.trueTrackColor, onChange = _a.onChange, children = _a.children;
|
|
5
|
-
var config = useAppSelector(selectKioskConfig).switch;
|
|
6
|
-
if (!config)
|
|
7
|
-
return null;
|
|
8
|
-
return children({
|
|
9
|
-
id: id,
|
|
10
|
-
config: config,
|
|
11
|
-
label: label,
|
|
12
|
-
value: on,
|
|
13
|
-
onTagSwitch: onChange,
|
|
14
|
-
isRequired: isRequired,
|
|
15
|
-
disabled: disabled,
|
|
16
|
-
falseTrackColor: falseTrackColor,
|
|
17
|
-
thumbColor: thumbColor,
|
|
18
|
-
trueTrackColor: trueTrackColor
|
|
19
|
-
});
|
|
20
|
-
};
|
|
21
|
-
export default Switch;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { useCallback } from 'react';
|
|
2
|
-
import { useAppDispatch, useAppSelector } from '../app/hooks';
|
|
3
|
-
import { selectKioskConfig, selectSelectedTags, selectShowTagsModal, toggleTagsModal } from '../slices';
|
|
4
|
-
var TagsButton = function (_a) {
|
|
5
|
-
var children = _a.children;
|
|
6
|
-
var config = useAppSelector(selectKioskConfig).tag;
|
|
7
|
-
var isTagsModalShown = useAppSelector(selectShowTagsModal);
|
|
8
|
-
var selectedTags = useAppSelector(selectSelectedTags);
|
|
9
|
-
var dispatch = useAppDispatch();
|
|
10
|
-
var onClick = useCallback(function () {
|
|
11
|
-
dispatch(toggleTagsModal(!isTagsModalShown));
|
|
12
|
-
}, [dispatch, isTagsModalShown]);
|
|
13
|
-
var handlers = { onClick: onClick };
|
|
14
|
-
return children({ config: config, handlers: handlers, isSelected: selectedTags.length > 0 });
|
|
15
|
-
};
|
|
16
|
-
export default TagsButton;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { SwitchProps, TagsFilterProps } from '@open-tender/ui';
|
|
2
|
-
import React, { ReactNode } from 'react';
|
|
3
|
-
declare const TagsFilter: ({ children, SwitchView }: {
|
|
4
|
-
children: (props: TagsFilterProps) => ReactNode;
|
|
5
|
-
SwitchView: (props: SwitchProps) => ReactNode;
|
|
6
|
-
}) => React.ReactNode;
|
|
7
|
-
export default TagsFilter;
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import { __spreadArray } from "tslib";
|
|
2
|
-
import { capitalize } from '@open-tender/utils';
|
|
3
|
-
import React, { useCallback, useEffect, useState } from 'react';
|
|
4
|
-
import { useAppDispatch, useAppSelector } from '../app/hooks';
|
|
5
|
-
import { selectKioskConfig, selectTags, setSelectedTags } from '../slices';
|
|
6
|
-
import { default as SwitchContainer } from './Switch';
|
|
7
|
-
var TagsFilter = function (_a) {
|
|
8
|
-
var children = _a.children, SwitchView = _a.SwitchView;
|
|
9
|
-
var config = useAppSelector(selectKioskConfig).tags;
|
|
10
|
-
var dispatch = useAppDispatch();
|
|
11
|
-
var _b = useAppSelector(selectTags), tags = _b.entities, selectedTags = _b.selectedTags, loading = _b.loading, error = _b.error;
|
|
12
|
-
var _c = useState([]), localSelectedTags = _c[0], setLocalSelectedTags = _c[1];
|
|
13
|
-
var isLoading = loading === 'pending';
|
|
14
|
-
useEffect(function () {
|
|
15
|
-
setLocalSelectedTags(selectedTags.map(function (tag) { return tag.tag_id; }));
|
|
16
|
-
}, [selectedTags]);
|
|
17
|
-
var onTagSwitch = function (tag) {
|
|
18
|
-
setLocalSelectedTags(function (prevSelectedTags) {
|
|
19
|
-
if (prevSelectedTags.includes(tag.tag_id)) {
|
|
20
|
-
return prevSelectedTags.filter(function (id) { return id !== tag.tag_id; });
|
|
21
|
-
}
|
|
22
|
-
else {
|
|
23
|
-
return __spreadArray(__spreadArray([], prevSelectedTags, true), [tag.tag_id], false);
|
|
24
|
-
}
|
|
25
|
-
});
|
|
26
|
-
};
|
|
27
|
-
var handleSubmit = function () {
|
|
28
|
-
var newSelectedTags = tags.filter(function (tag) {
|
|
29
|
-
return localSelectedTags.includes(tag.tag_id);
|
|
30
|
-
});
|
|
31
|
-
dispatch(setSelectedTags(newSelectedTags));
|
|
32
|
-
};
|
|
33
|
-
var handlers = { onTagSwitch: onTagSwitch, handleSubmit: handleSubmit };
|
|
34
|
-
var renderSwitch = useCallback(function (tag) {
|
|
35
|
-
return (React.createElement(SwitchContainer, { key: tag.tag_id, id: tag.tag_id, children: SwitchView, label: capitalize(tag.name), on: localSelectedTags.includes(tag.tag_id), onChange: function () { return onTagSwitch(tag); }, disabled: false, isRequired: true }));
|
|
36
|
-
}, [SwitchView, localSelectedTags]);
|
|
37
|
-
return children({
|
|
38
|
-
config: config,
|
|
39
|
-
handlers: handlers,
|
|
40
|
-
isLoading: isLoading,
|
|
41
|
-
renderSwitch: renderSwitch,
|
|
42
|
-
tags: tags,
|
|
43
|
-
error: error === null || error === void 0 ? void 0 : error.detail
|
|
44
|
-
});
|
|
45
|
-
};
|
|
46
|
-
export default TagsFilter;
|
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
import { Tags, RequestError, RequestStatus } from '@open-tender/types';
|
|
2
|
-
import { AppState } from '../app';
|
|
3
|
-
export interface TagsState {
|
|
4
|
-
entities: Tags;
|
|
5
|
-
error: RequestError;
|
|
6
|
-
loading: RequestStatus;
|
|
7
|
-
selectedTags: Tags;
|
|
8
|
-
showTagsModal: boolean;
|
|
9
|
-
}
|
|
10
|
-
export declare enum TagsActionType {
|
|
11
|
-
FetchTags = "tags/fetchTags"
|
|
12
|
-
}
|
|
13
|
-
export declare const fetchTags: import("@reduxjs/toolkit").AsyncThunk<Tags, void, {
|
|
14
|
-
state: AppState;
|
|
15
|
-
rejectValue: RequestError;
|
|
16
|
-
dispatch?: import("redux").Dispatch<import("redux").UnknownAction> | undefined;
|
|
17
|
-
extra?: unknown;
|
|
18
|
-
serializedErrorType?: unknown;
|
|
19
|
-
pendingMeta?: unknown;
|
|
20
|
-
fulfilledMeta?: unknown;
|
|
21
|
-
rejectedMeta?: unknown;
|
|
22
|
-
}>;
|
|
23
|
-
export declare const resetTags: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"tags/resetTags">, setSelectedTags: import("@reduxjs/toolkit").ActionCreatorWithPayload<any, "tags/setSelectedTags">, toggleTagsModal: import("@reduxjs/toolkit").ActionCreatorWithPayload<any, "tags/toggleTagsModal">;
|
|
24
|
-
export declare const selectTags: (state: AppState) => TagsState;
|
|
25
|
-
export declare const selectSelectedTags: (state: AppState) => Tags;
|
|
26
|
-
export declare const selectShowTagsModal: (state: AppState) => boolean;
|
|
27
|
-
export declare const selectSelectedTagNames: ((state: {
|
|
28
|
-
alerts: import("@open-tender/types").Alerts;
|
|
29
|
-
arrivals: import("./arrivals").ArrivalsState;
|
|
30
|
-
cartSummary: import("./cartSummary").CartSummaryState;
|
|
31
|
-
checkout: import("./checkout").CheckoutState;
|
|
32
|
-
config: import("./config").ConfigState;
|
|
33
|
-
customer: import("./customer").CustomerState;
|
|
34
|
-
customerIdentify: import("./customerIdentify").CustomerIdentifyState;
|
|
35
|
-
deals: import("./deals").DealsState;
|
|
36
|
-
discounts: import("./discounts").DiscountsState;
|
|
37
|
-
errorAlerts: import("./errorAlerts").ErrorAlertsState;
|
|
38
|
-
kds: import("./kds").KdsState;
|
|
39
|
-
kiosk: import("./kiosk").KioskState;
|
|
40
|
-
menu: import("./menu").MenuState;
|
|
41
|
-
menuPages: import("./menuPages").MenuPagesState;
|
|
42
|
-
modal: import("./modal").ModalState;
|
|
43
|
-
notifications: import("@open-tender/types").Notifications;
|
|
44
|
-
offlineAuths: import("./offlineAuths").OfflineAuthsState;
|
|
45
|
-
order: import("./order").OrderState;
|
|
46
|
-
pos: import("./pos").PosState;
|
|
47
|
-
punches: import("./punches").PunchesState;
|
|
48
|
-
refund: import("./refund").RefundState;
|
|
49
|
-
sendReceipt: import("./sendReceipt").SendReceiptState;
|
|
50
|
-
settings: import("./settings").SettingsState;
|
|
51
|
-
sidebar: import("./sidebar").SidebarState;
|
|
52
|
-
surcharges: import("./surcharges").SurchargesState;
|
|
53
|
-
taxes: import("./taxes").TaxesState;
|
|
54
|
-
idle: import("./idle").IdleState;
|
|
55
|
-
tags: TagsState;
|
|
56
|
-
}) => string[]) & {
|
|
57
|
-
clearCache: () => void;
|
|
58
|
-
resultsCount: () => number;
|
|
59
|
-
resetResultsCount: () => void;
|
|
60
|
-
} & {
|
|
61
|
-
resultFunc: (resultFuncArgs_0: {
|
|
62
|
-
tags: Tags;
|
|
63
|
-
selectedTags: Tags;
|
|
64
|
-
}) => string[];
|
|
65
|
-
memoizedResultFunc: ((resultFuncArgs_0: {
|
|
66
|
-
tags: Tags;
|
|
67
|
-
selectedTags: Tags;
|
|
68
|
-
}) => string[]) & {
|
|
69
|
-
clearCache: () => void;
|
|
70
|
-
resultsCount: () => number;
|
|
71
|
-
resetResultsCount: () => void;
|
|
72
|
-
};
|
|
73
|
-
lastResult: () => string[];
|
|
74
|
-
dependencies: [(state: AppState) => {
|
|
75
|
-
tags: Tags;
|
|
76
|
-
selectedTags: Tags;
|
|
77
|
-
}];
|
|
78
|
-
recomputations: () => number;
|
|
79
|
-
resetRecomputations: () => void;
|
|
80
|
-
dependencyRecomputations: () => number;
|
|
81
|
-
resetDependencyRecomputations: () => void;
|
|
82
|
-
} & {
|
|
83
|
-
argsMemoize: typeof import("reselect").weakMapMemoize;
|
|
84
|
-
memoize: typeof import("reselect").weakMapMemoize;
|
|
85
|
-
};
|
|
86
|
-
export declare const tagsReducer: import("redux").Reducer<TagsState>;
|
package/dist/esm/slices/tags.js
DELETED
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
var _a;
|
|
2
|
-
import { __awaiter, __generator } from "tslib";
|
|
3
|
-
import { createAsyncThunk, createSelector, createSlice } from '@reduxjs/toolkit';
|
|
4
|
-
import { ReducerType } from './types';
|
|
5
|
-
var initialState = {
|
|
6
|
-
entities: [],
|
|
7
|
-
error: null,
|
|
8
|
-
loading: 'idle',
|
|
9
|
-
selectedTags: [],
|
|
10
|
-
showTagsModal: false
|
|
11
|
-
};
|
|
12
|
-
export var TagsActionType;
|
|
13
|
-
(function (TagsActionType) {
|
|
14
|
-
TagsActionType["FetchTags"] = "tags/fetchTags";
|
|
15
|
-
})(TagsActionType || (TagsActionType = {}));
|
|
16
|
-
export var fetchTags = createAsyncThunk(TagsActionType.FetchTags, function (_1, _a) { return __awaiter(void 0, [_1, _a], void 0, function (_, _b) {
|
|
17
|
-
var api, data, err_1;
|
|
18
|
-
var getState = _b.getState, rejectWithValue = _b.rejectWithValue;
|
|
19
|
-
return __generator(this, function (_c) {
|
|
20
|
-
switch (_c.label) {
|
|
21
|
-
case 0:
|
|
22
|
-
_c.trys.push([0, 2, , 3]);
|
|
23
|
-
api = getState().config.api;
|
|
24
|
-
return [4 /*yield*/, api.getTags()];
|
|
25
|
-
case 1:
|
|
26
|
-
data = _c.sent();
|
|
27
|
-
return [2 /*return*/, data];
|
|
28
|
-
case 2:
|
|
29
|
-
err_1 = _c.sent();
|
|
30
|
-
return [2 /*return*/, rejectWithValue(err_1)];
|
|
31
|
-
case 3: return [2 /*return*/];
|
|
32
|
-
}
|
|
33
|
-
});
|
|
34
|
-
}); });
|
|
35
|
-
var tagsSlice = createSlice({
|
|
36
|
-
name: ReducerType.Tags,
|
|
37
|
-
initialState: initialState,
|
|
38
|
-
reducers: {
|
|
39
|
-
resetTags: function () { return initialState; },
|
|
40
|
-
setSelectedTags: function (state, action) {
|
|
41
|
-
state.selectedTags = action.payload;
|
|
42
|
-
},
|
|
43
|
-
toggleTagsModal: function (state, action) {
|
|
44
|
-
state.showTagsModal = action.payload;
|
|
45
|
-
}
|
|
46
|
-
},
|
|
47
|
-
extraReducers: function (builder) {
|
|
48
|
-
builder
|
|
49
|
-
.addCase(fetchTags.fulfilled, function (state, action) {
|
|
50
|
-
state.entities = action.payload;
|
|
51
|
-
state.loading = 'idle';
|
|
52
|
-
state.error = null;
|
|
53
|
-
})
|
|
54
|
-
.addCase(fetchTags.pending, function (state) {
|
|
55
|
-
state.loading = 'pending';
|
|
56
|
-
})
|
|
57
|
-
.addCase(fetchTags.rejected, function (state, action) {
|
|
58
|
-
state.error = action.payload;
|
|
59
|
-
state.loading = 'idle';
|
|
60
|
-
});
|
|
61
|
-
}
|
|
62
|
-
});
|
|
63
|
-
export var resetTags = (_a = tagsSlice.actions, _a.resetTags), setSelectedTags = _a.setSelectedTags, toggleTagsModal = _a.toggleTagsModal;
|
|
64
|
-
export var selectTags = function (state) { return state.tags; };
|
|
65
|
-
export var selectSelectedTags = function (state) { return state.tags.selectedTags; };
|
|
66
|
-
export var selectShowTagsModal = function (state) { return state.tags.showTagsModal; };
|
|
67
|
-
export var selectSelectedTagNames = createSelector(function (state) {
|
|
68
|
-
var _a = state.tags, tags = _a.entities, selectedTags = _a.selectedTags;
|
|
69
|
-
return { tags: tags, selectedTags: selectedTags };
|
|
70
|
-
}, function (_a) {
|
|
71
|
-
var tags = _a.tags, selectedTags = _a.selectedTags;
|
|
72
|
-
if (!selectedTags)
|
|
73
|
-
return [];
|
|
74
|
-
var selected = selectedTags.map(function (i) {
|
|
75
|
-
var _a;
|
|
76
|
-
var tag = tags.find(function (a) { return a.tag_id === i.tag_id; });
|
|
77
|
-
return tag ? (_a = tag.name) !== null && _a !== void 0 ? _a : '' : '';
|
|
78
|
-
});
|
|
79
|
-
return selected;
|
|
80
|
-
});
|
|
81
|
-
export var tagsReducer = tagsSlice.reducer;
|