@open-tender/store 1.0.28 → 1.0.29

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.
@@ -11,6 +11,7 @@ export interface OrderState {
11
11
  currentVendor: MenuRevenueCenter | null;
12
12
  currentCategory: MenuCategory | null;
13
13
  currentItem: CartItem | null;
14
+ currentSection: string | null;
14
15
  cart: Cart;
15
16
  cartCounts: CartCounts;
16
17
  messages: Messages;
@@ -53,6 +54,7 @@ export declare const selectMenuVars: (state: AppState) => {
53
54
  export declare const selectCurrentVendor: (state: AppState) => MenuRevenueCenter | null;
54
55
  export declare const selectCurrentCategory: (state: AppState) => MenuCategory | null;
55
56
  export declare const selectCurrentItem: (state: AppState) => CartItem | null;
57
+ export declare const selectCurrentSection: (state: AppState) => string | null;
56
58
  export declare const selectCart: (state: AppState) => Cart;
57
59
  export declare const selectCartIds: ((state: {
58
60
  alerts: import("..").Alerts;
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
  var _a;
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.selectCanOrder = exports.selectCartCounts = exports.selectCartTotals = exports.selectCartTotal = exports.selectCartQuantity = exports.selectCartIds = exports.selectCart = exports.selectCurrentItem = exports.selectCurrentCategory = exports.selectCurrentVendor = exports.selectMenuVars = exports.selectMenuSlug = exports.selectRevenueCenterId = exports.selectRequestedAt = exports.selectServiceTypeName = exports.selectServiceType = exports.selectOrderTypeName = exports.selectOrderType = exports.selectMessages = exports.selectAlert = exports.selectOrder = exports.removeMessage = exports.addMessage = exports.decrementItemInCart = exports.incrementItemInCart = exports.removeItemFromCart = exports.addItemToCart = exports.setCurrentItem = exports.setCurrentCategory = exports.setCurrentVendor = exports.setCart = exports.setMenuVars = exports.setOrderServiceType = exports.setPrepType = exports.setTable = exports.setRevenueCenterId = exports.setRequestedAt = exports.setServiceType = exports.setOrderType = exports.setOrderId = exports.setAlert = exports.resetAlert = exports.resetMessages = exports.resetCart = exports.resetLocation = exports.resetRevenueCenter = exports.resetOrderType = exports.resetOrder = exports.reorder = exports.OrderActionType = void 0;
5
- exports.orderReducer = exports.selectCartValidate = void 0;
4
+ exports.selectCartCounts = exports.selectCartTotals = exports.selectCartTotal = exports.selectCartQuantity = exports.selectCartIds = exports.selectCart = exports.selectCurrentSection = exports.selectCurrentItem = exports.selectCurrentCategory = exports.selectCurrentVendor = exports.selectMenuVars = exports.selectMenuSlug = exports.selectRevenueCenterId = exports.selectRequestedAt = exports.selectServiceTypeName = exports.selectServiceType = exports.selectOrderTypeName = exports.selectOrderType = exports.selectMessages = exports.selectAlert = exports.selectOrder = exports.removeMessage = exports.addMessage = exports.decrementItemInCart = exports.incrementItemInCart = exports.removeItemFromCart = exports.addItemToCart = exports.setCurrentItem = exports.setCurrentCategory = exports.setCurrentVendor = exports.setCart = exports.setMenuVars = exports.setOrderServiceType = exports.setPrepType = exports.setTable = exports.setRevenueCenterId = exports.setRequestedAt = exports.setServiceType = exports.setOrderType = exports.setOrderId = exports.setAlert = exports.resetAlert = exports.resetMessages = exports.resetCart = exports.resetLocation = exports.resetRevenueCenter = exports.resetOrderType = exports.resetOrder = exports.reorder = exports.OrderActionType = void 0;
5
+ exports.orderReducer = exports.selectCartValidate = exports.selectCanOrder = void 0;
6
6
  var tslib_1 = require("tslib");
7
7
  var toolkit_1 = require("@reduxjs/toolkit");
8
8
  var utils_1 = require("@open-tender/utils");
@@ -19,6 +19,7 @@ var initialState = {
19
19
  currentVendor: null,
20
20
  currentCategory: null,
21
21
  currentItem: null,
22
+ currentSection: null,
22
23
  cart: [],
23
24
  cartCounts: {},
24
25
  messages: [],
@@ -135,6 +136,9 @@ var orderSlice = (0, toolkit_1.createSlice)({
135
136
  setCurrentItem: function (state, action) {
136
137
  state.currentItem = action.payload;
137
138
  },
139
+ setCurrentSection: function (state, action) {
140
+ state.currentSection = action.payload;
141
+ },
138
142
  addItemToCart: function (state, action) {
139
143
  var _a = (0, utils_1.addItem)(tslib_1.__spreadArray([], state.cart, true), action.payload), cart = _a.cart, cartCounts = _a.cartCounts;
140
144
  state.cart = cart;
@@ -243,6 +247,10 @@ var selectCurrentCategory = function (state) {
243
247
  exports.selectCurrentCategory = selectCurrentCategory;
244
248
  var selectCurrentItem = function (state) { return state.order.currentItem; };
245
249
  exports.selectCurrentItem = selectCurrentItem;
250
+ var selectCurrentSection = function (state) {
251
+ return state.order.currentSection;
252
+ };
253
+ exports.selectCurrentSection = selectCurrentSection;
246
254
  var selectCart = function (state) { return state.order.cart; };
247
255
  exports.selectCart = selectCart;
248
256
  exports.selectCartIds = (0, toolkit_1.createSelector)(function (state) {
@@ -11,6 +11,7 @@ export interface OrderState {
11
11
  currentVendor: MenuRevenueCenter | null;
12
12
  currentCategory: MenuCategory | null;
13
13
  currentItem: CartItem | null;
14
+ currentSection: string | null;
14
15
  cart: Cart;
15
16
  cartCounts: CartCounts;
16
17
  messages: Messages;
@@ -53,6 +54,7 @@ export declare const selectMenuVars: (state: AppState) => {
53
54
  export declare const selectCurrentVendor: (state: AppState) => MenuRevenueCenter | null;
54
55
  export declare const selectCurrentCategory: (state: AppState) => MenuCategory | null;
55
56
  export declare const selectCurrentItem: (state: AppState) => CartItem | null;
57
+ export declare const selectCurrentSection: (state: AppState) => string | null;
56
58
  export declare const selectCart: (state: AppState) => Cart;
57
59
  export declare const selectCartIds: ((state: {
58
60
  alerts: import("..").Alerts;
@@ -15,6 +15,7 @@ var initialState = {
15
15
  currentVendor: null,
16
16
  currentCategory: null,
17
17
  currentItem: null,
18
+ currentSection: null,
18
19
  cart: [],
19
20
  cartCounts: {},
20
21
  messages: [],
@@ -131,6 +132,9 @@ var orderSlice = createSlice({
131
132
  setCurrentItem: function (state, action) {
132
133
  state.currentItem = action.payload;
133
134
  },
135
+ setCurrentSection: function (state, action) {
136
+ state.currentSection = action.payload;
137
+ },
134
138
  addItemToCart: function (state, action) {
135
139
  var _a = addItem(__spreadArray([], state.cart, true), action.payload), cart = _a.cart, cartCounts = _a.cartCounts;
136
140
  state.cart = cart;
@@ -225,6 +229,9 @@ export var selectCurrentCategory = function (state) {
225
229
  return state.order.currentCategory;
226
230
  };
227
231
  export var selectCurrentItem = function (state) { return state.order.currentItem; };
232
+ export var selectCurrentSection = function (state) {
233
+ return state.order.currentSection;
234
+ };
228
235
  export var selectCart = function (state) { return state.order.cart; };
229
236
  export var selectCartIds = createSelector(function (state) {
230
237
  var cart = state.order.cart;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@open-tender/store",
3
- "version": "1.0.28",
3
+ "version": "1.0.29",
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",