@open-tender/store 0.1.280 → 0.1.282
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/components/AccessibilityButton.d.ts +10 -0
- package/dist/cjs/components/AccessibilityButton.js +20 -0
- package/dist/cjs/components/index.d.ts +2 -1
- package/dist/cjs/components/index.js +3 -1
- package/dist/cjs/slices/config.d.ts +3 -1
- package/dist/cjs/slices/config.js +11 -3
- package/dist/esm/components/AccessibilityButton.d.ts +10 -0
- package/dist/esm/components/AccessibilityButton.js +18 -0
- package/dist/esm/components/index.d.ts +2 -1
- package/dist/esm/components/index.js +2 -1
- package/dist/esm/slices/config.d.ts +3 -1
- package/dist/esm/slices/config.js +9 -2
- package/package.json +4 -5
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Handlers, ScreenConfig } from '@open-tender/ui';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
declare const AccessibilityButton: ({ children }: {
|
|
4
|
+
children: (props: {
|
|
5
|
+
config: ScreenConfig;
|
|
6
|
+
isAccessibilityOn?: boolean;
|
|
7
|
+
handlers: Handlers;
|
|
8
|
+
}) => ReactNode;
|
|
9
|
+
}) => ReactNode;
|
|
10
|
+
export default AccessibilityButton;
|
|
@@ -0,0 +1,20 @@
|
|
|
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 AccessibilityButton = function (_a) {
|
|
6
|
+
var children = _a.children;
|
|
7
|
+
var dispatch = (0, hooks_1.useAppDispatch)();
|
|
8
|
+
var config = (0, hooks_1.useAppSelector)(slices_1.selectKioskConfig).accessibilityButton;
|
|
9
|
+
var isAccessibilityOn = (0, hooks_1.useAppSelector)(slices_1.selectAccessibility);
|
|
10
|
+
var toggleAccessibility = function () {
|
|
11
|
+
dispatch((0, slices_1.setAccessibility)(!isAccessibilityOn));
|
|
12
|
+
};
|
|
13
|
+
var handlers = {
|
|
14
|
+
toggleAccessibility: toggleAccessibility
|
|
15
|
+
};
|
|
16
|
+
if (!config)
|
|
17
|
+
return null;
|
|
18
|
+
return children({ config: config, isAccessibilityOn: isAccessibilityOn, handlers: handlers });
|
|
19
|
+
};
|
|
20
|
+
exports.default = AccessibilityButton;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import AccessibilityButton from './AccessibilityButton';
|
|
1
2
|
import AccountLoyalty from './AccountLoyalty';
|
|
2
3
|
import AccountSection from './AccountSection';
|
|
3
4
|
import Allergen from './Allergen';
|
|
@@ -75,4 +76,4 @@ import TagsFilter from './TagsFilter';
|
|
|
75
76
|
import TextArea from './TextArea';
|
|
76
77
|
import UpsellItem from './UpsellItem';
|
|
77
78
|
import Upsells from './Upsells';
|
|
78
|
-
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, TagsFilter, Switch, TagsButton, CheckoutTable, DisabledModal, Notifications, LoyaltyDiscount, LoyaltyDiscounts };
|
|
79
|
+
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, TagsFilter, Switch, TagsButton, CheckoutTable, DisabledModal, Notifications, LoyaltyDiscount, LoyaltyDiscounts, AccessibilityButton };
|
|
@@ -1,8 +1,10 @@
|
|
|
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.LoyaltyDiscounts = exports.LoyaltyDiscount = exports.Notifications = exports.DisabledModal = exports.CheckoutTable = exports.TagsButton = exports.Switch = exports.TagsFilter = 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;
|
|
4
|
+
exports.AccessibilityButton = exports.LoyaltyDiscounts = exports.LoyaltyDiscount = exports.Notifications = exports.DisabledModal = exports.CheckoutTable = exports.TagsButton = exports.Switch = exports.TagsFilter = 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
|
+
var AccessibilityButton_1 = tslib_1.__importDefault(require("./AccessibilityButton"));
|
|
7
|
+
exports.AccessibilityButton = AccessibilityButton_1.default;
|
|
6
8
|
var AccountLoyalty_1 = tslib_1.__importDefault(require("./AccountLoyalty"));
|
|
7
9
|
exports.AccountLoyalty = AccountLoyalty_1.default;
|
|
8
10
|
var AccountSection_1 = tslib_1.__importDefault(require("./AccountSection"));
|
|
@@ -20,6 +20,7 @@ export interface ConfigState {
|
|
|
20
20
|
loading: RequestStatus;
|
|
21
21
|
error: RequestError | null;
|
|
22
22
|
retries: number;
|
|
23
|
+
accessibilityOn?: boolean;
|
|
23
24
|
}
|
|
24
25
|
export declare enum ConfigActionType {
|
|
25
26
|
FetchConfig = "config/getConfig"
|
|
@@ -36,7 +37,7 @@ export declare const fetchConfig: import("@reduxjs/toolkit").AsyncThunk<ConfigSt
|
|
|
36
37
|
fulfilledMeta?: unknown;
|
|
37
38
|
rejectedMeta?: unknown;
|
|
38
39
|
}>;
|
|
39
|
-
export declare const resetConfig: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"config/resetConfig">, resetRetries: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"config/resetRetries">, incrementRetries: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"config/incrementRetries">, setVersion: import("@reduxjs/toolkit").ActionCreatorWithPayload<any, "config/setVersion">, setApi: import("@reduxjs/toolkit").ActionCreatorWithPayload<any, "config/setApi">, setApiTerminal: import("@reduxjs/toolkit").ActionCreatorWithPayload<InitAPI, "config/setApiTerminal">;
|
|
40
|
+
export declare const resetConfig: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"config/resetConfig">, resetRetries: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"config/resetRetries">, incrementRetries: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"config/incrementRetries">, setVersion: import("@reduxjs/toolkit").ActionCreatorWithPayload<any, "config/setVersion">, setApi: import("@reduxjs/toolkit").ActionCreatorWithPayload<any, "config/setApi">, setApiTerminal: import("@reduxjs/toolkit").ActionCreatorWithPayload<InitAPI, "config/setApiTerminal">, setAccessibility: import("@reduxjs/toolkit").ActionCreatorWithPayload<boolean, "config/setAccessibility">;
|
|
40
41
|
export declare const selectConfig: (state: AppState) => ConfigState;
|
|
41
42
|
export declare const selectApi: (state: AppState) => PosAPI;
|
|
42
43
|
export declare const selectVersion: (state: AppState) => string | null | undefined;
|
|
@@ -47,5 +48,6 @@ export declare const selectTimezone: () => Timezone;
|
|
|
47
48
|
export declare const selectLoyalty: (state: AppState) => boolean;
|
|
48
49
|
export declare const selectPinpad: (state: AppState) => boolean;
|
|
49
50
|
export declare const selectCashDrawer: (state: AppState) => boolean;
|
|
51
|
+
export declare const selectAccessibility: (state: AppState) => boolean | undefined;
|
|
50
52
|
export declare const selectStore: (state: AppState) => Store | null;
|
|
51
53
|
export declare const configReducer: import("redux").Reducer<ConfigState>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var _a;
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.configReducer = exports.selectStore = exports.selectCashDrawer = exports.selectPinpad = exports.selectLoyalty = exports.selectTimezone = exports.selectMenuColors = exports.selectSelectOptions = exports.selectDevices = exports.selectVersion = exports.selectApi = exports.selectConfig = exports.setApiTerminal = exports.setApi = exports.setVersion = exports.incrementRetries = exports.resetRetries = exports.resetConfig = exports.fetchConfig = exports.ConfigActionType = void 0;
|
|
4
|
+
exports.configReducer = exports.selectStore = exports.selectAccessibility = exports.selectCashDrawer = exports.selectPinpad = exports.selectLoyalty = exports.selectTimezone = exports.selectMenuColors = exports.selectSelectOptions = exports.selectDevices = exports.selectVersion = exports.selectApi = exports.selectConfig = exports.setAccessibility = exports.setApiTerminal = exports.setApi = exports.setVersion = exports.incrementRetries = exports.resetRetries = exports.resetConfig = exports.fetchConfig = exports.ConfigActionType = void 0;
|
|
5
5
|
var tslib_1 = require("tslib");
|
|
6
6
|
var utils_1 = require("@open-tender/utils");
|
|
7
7
|
var toolkit_1 = require("@reduxjs/toolkit");
|
|
@@ -27,7 +27,8 @@ var initialState = {
|
|
|
27
27
|
hasCashDrawer: true,
|
|
28
28
|
loading: 'idle',
|
|
29
29
|
error: null,
|
|
30
|
-
retries: 0
|
|
30
|
+
retries: 0,
|
|
31
|
+
accessibilityOn: false
|
|
31
32
|
};
|
|
32
33
|
var ConfigActionType;
|
|
33
34
|
(function (ConfigActionType) {
|
|
@@ -129,6 +130,9 @@ var configSlice = (0, toolkit_1.createSlice)({
|
|
|
129
130
|
},
|
|
130
131
|
setApiTerminal: function (state, action) {
|
|
131
132
|
state.api = new services_1.PosAPI(action.payload);
|
|
133
|
+
},
|
|
134
|
+
setAccessibility: function (state, action) {
|
|
135
|
+
state.accessibilityOn = action.payload;
|
|
132
136
|
}
|
|
133
137
|
},
|
|
134
138
|
extraReducers: function (builder) {
|
|
@@ -156,7 +160,7 @@ var configSlice = (0, toolkit_1.createSlice)({
|
|
|
156
160
|
});
|
|
157
161
|
}
|
|
158
162
|
});
|
|
159
|
-
exports.resetConfig = (_a = configSlice.actions, _a.resetConfig), exports.resetRetries = _a.resetRetries, exports.incrementRetries = _a.incrementRetries, exports.setVersion = _a.setVersion, exports.setApi = _a.setApi, exports.setApiTerminal = _a.setApiTerminal;
|
|
163
|
+
exports.resetConfig = (_a = configSlice.actions, _a.resetConfig), exports.resetRetries = _a.resetRetries, exports.incrementRetries = _a.incrementRetries, exports.setVersion = _a.setVersion, exports.setApi = _a.setApi, exports.setApiTerminal = _a.setApiTerminal, exports.setAccessibility = _a.setAccessibility;
|
|
160
164
|
var selectConfig = function (state) { return state.config; };
|
|
161
165
|
exports.selectConfig = selectConfig;
|
|
162
166
|
var selectApi = function (state) { return state.config.api; };
|
|
@@ -187,6 +191,10 @@ var selectPinpad = function (state) { return state.config.hasPinpad; };
|
|
|
187
191
|
exports.selectPinpad = selectPinpad;
|
|
188
192
|
var selectCashDrawer = function (state) { return state.config.hasCashDrawer; };
|
|
189
193
|
exports.selectCashDrawer = selectCashDrawer;
|
|
194
|
+
var selectAccessibility = function (state) {
|
|
195
|
+
return state.config.accessibilityOn;
|
|
196
|
+
};
|
|
197
|
+
exports.selectAccessibility = selectAccessibility;
|
|
190
198
|
var selectStore = function (state) { return state.config.store; };
|
|
191
199
|
exports.selectStore = selectStore;
|
|
192
200
|
exports.configReducer = configSlice.reducer;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Handlers, ScreenConfig } from '@open-tender/ui';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
declare const AccessibilityButton: ({ children }: {
|
|
4
|
+
children: (props: {
|
|
5
|
+
config: ScreenConfig;
|
|
6
|
+
isAccessibilityOn?: boolean;
|
|
7
|
+
handlers: Handlers;
|
|
8
|
+
}) => ReactNode;
|
|
9
|
+
}) => ReactNode;
|
|
10
|
+
export default AccessibilityButton;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { useAppDispatch, useAppSelector } from '../app/hooks';
|
|
2
|
+
import { selectAccessibility, selectKioskConfig, setAccessibility } from '../slices';
|
|
3
|
+
var AccessibilityButton = function (_a) {
|
|
4
|
+
var children = _a.children;
|
|
5
|
+
var dispatch = useAppDispatch();
|
|
6
|
+
var config = useAppSelector(selectKioskConfig).accessibilityButton;
|
|
7
|
+
var isAccessibilityOn = useAppSelector(selectAccessibility);
|
|
8
|
+
var toggleAccessibility = function () {
|
|
9
|
+
dispatch(setAccessibility(!isAccessibilityOn));
|
|
10
|
+
};
|
|
11
|
+
var handlers = {
|
|
12
|
+
toggleAccessibility: toggleAccessibility
|
|
13
|
+
};
|
|
14
|
+
if (!config)
|
|
15
|
+
return null;
|
|
16
|
+
return children({ config: config, isAccessibilityOn: isAccessibilityOn, handlers: handlers });
|
|
17
|
+
};
|
|
18
|
+
export default AccessibilityButton;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import AccessibilityButton from './AccessibilityButton';
|
|
1
2
|
import AccountLoyalty from './AccountLoyalty';
|
|
2
3
|
import AccountSection from './AccountSection';
|
|
3
4
|
import Allergen from './Allergen';
|
|
@@ -75,4 +76,4 @@ import TagsFilter from './TagsFilter';
|
|
|
75
76
|
import TextArea from './TextArea';
|
|
76
77
|
import UpsellItem from './UpsellItem';
|
|
77
78
|
import Upsells from './Upsells';
|
|
78
|
-
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, TagsFilter, Switch, TagsButton, CheckoutTable, DisabledModal, Notifications, LoyaltyDiscount, LoyaltyDiscounts };
|
|
79
|
+
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, TagsFilter, Switch, TagsButton, CheckoutTable, DisabledModal, Notifications, LoyaltyDiscount, LoyaltyDiscounts, AccessibilityButton };
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import AccessibilityButton from './AccessibilityButton';
|
|
1
2
|
import AccountLoyalty from './AccountLoyalty';
|
|
2
3
|
import AccountSection from './AccountSection';
|
|
3
4
|
import Allergen from './Allergen';
|
|
@@ -75,4 +76,4 @@ import TagsFilter from './TagsFilter';
|
|
|
75
76
|
import TextArea from './TextArea';
|
|
76
77
|
import UpsellItem from './UpsellItem';
|
|
77
78
|
import Upsells from './Upsells';
|
|
78
|
-
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, TagsFilter, Switch, TagsButton, CheckoutTable, DisabledModal, Notifications, LoyaltyDiscount, LoyaltyDiscounts };
|
|
79
|
+
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, TagsFilter, Switch, TagsButton, CheckoutTable, DisabledModal, Notifications, LoyaltyDiscount, LoyaltyDiscounts, AccessibilityButton };
|
|
@@ -20,6 +20,7 @@ export interface ConfigState {
|
|
|
20
20
|
loading: RequestStatus;
|
|
21
21
|
error: RequestError | null;
|
|
22
22
|
retries: number;
|
|
23
|
+
accessibilityOn?: boolean;
|
|
23
24
|
}
|
|
24
25
|
export declare enum ConfigActionType {
|
|
25
26
|
FetchConfig = "config/getConfig"
|
|
@@ -36,7 +37,7 @@ export declare const fetchConfig: import("@reduxjs/toolkit").AsyncThunk<ConfigSt
|
|
|
36
37
|
fulfilledMeta?: unknown;
|
|
37
38
|
rejectedMeta?: unknown;
|
|
38
39
|
}>;
|
|
39
|
-
export declare const resetConfig: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"config/resetConfig">, resetRetries: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"config/resetRetries">, incrementRetries: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"config/incrementRetries">, setVersion: import("@reduxjs/toolkit").ActionCreatorWithPayload<any, "config/setVersion">, setApi: import("@reduxjs/toolkit").ActionCreatorWithPayload<any, "config/setApi">, setApiTerminal: import("@reduxjs/toolkit").ActionCreatorWithPayload<InitAPI, "config/setApiTerminal">;
|
|
40
|
+
export declare const resetConfig: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"config/resetConfig">, resetRetries: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"config/resetRetries">, incrementRetries: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"config/incrementRetries">, setVersion: import("@reduxjs/toolkit").ActionCreatorWithPayload<any, "config/setVersion">, setApi: import("@reduxjs/toolkit").ActionCreatorWithPayload<any, "config/setApi">, setApiTerminal: import("@reduxjs/toolkit").ActionCreatorWithPayload<InitAPI, "config/setApiTerminal">, setAccessibility: import("@reduxjs/toolkit").ActionCreatorWithPayload<boolean, "config/setAccessibility">;
|
|
40
41
|
export declare const selectConfig: (state: AppState) => ConfigState;
|
|
41
42
|
export declare const selectApi: (state: AppState) => PosAPI;
|
|
42
43
|
export declare const selectVersion: (state: AppState) => string | null | undefined;
|
|
@@ -47,5 +48,6 @@ export declare const selectTimezone: () => Timezone;
|
|
|
47
48
|
export declare const selectLoyalty: (state: AppState) => boolean;
|
|
48
49
|
export declare const selectPinpad: (state: AppState) => boolean;
|
|
49
50
|
export declare const selectCashDrawer: (state: AppState) => boolean;
|
|
51
|
+
export declare const selectAccessibility: (state: AppState) => boolean | undefined;
|
|
50
52
|
export declare const selectStore: (state: AppState) => Store | null;
|
|
51
53
|
export declare const configReducer: import("redux").Reducer<ConfigState>;
|
|
@@ -24,7 +24,8 @@ var initialState = {
|
|
|
24
24
|
hasCashDrawer: true,
|
|
25
25
|
loading: 'idle',
|
|
26
26
|
error: null,
|
|
27
|
-
retries: 0
|
|
27
|
+
retries: 0,
|
|
28
|
+
accessibilityOn: false
|
|
28
29
|
};
|
|
29
30
|
export var ConfigActionType;
|
|
30
31
|
(function (ConfigActionType) {
|
|
@@ -126,6 +127,9 @@ var configSlice = createSlice({
|
|
|
126
127
|
},
|
|
127
128
|
setApiTerminal: function (state, action) {
|
|
128
129
|
state.api = new PosAPI(action.payload);
|
|
130
|
+
},
|
|
131
|
+
setAccessibility: function (state, action) {
|
|
132
|
+
state.accessibilityOn = action.payload;
|
|
129
133
|
}
|
|
130
134
|
},
|
|
131
135
|
extraReducers: function (builder) {
|
|
@@ -153,7 +157,7 @@ var configSlice = createSlice({
|
|
|
153
157
|
});
|
|
154
158
|
}
|
|
155
159
|
});
|
|
156
|
-
export var resetConfig = (_a = configSlice.actions, _a.resetConfig), resetRetries = _a.resetRetries, incrementRetries = _a.incrementRetries, setVersion = _a.setVersion, setApi = _a.setApi, setApiTerminal = _a.setApiTerminal;
|
|
160
|
+
export var resetConfig = (_a = configSlice.actions, _a.resetConfig), resetRetries = _a.resetRetries, incrementRetries = _a.incrementRetries, setVersion = _a.setVersion, setApi = _a.setApi, setApiTerminal = _a.setApiTerminal, setAccessibility = _a.setAccessibility;
|
|
157
161
|
export var selectConfig = function (state) { return state.config; };
|
|
158
162
|
export var selectApi = function (state) { return state.config.api; };
|
|
159
163
|
export var selectVersion = function (state) { return state.config.version; };
|
|
@@ -174,5 +178,8 @@ export var selectLoyalty = function (state) {
|
|
|
174
178
|
};
|
|
175
179
|
export var selectPinpad = function (state) { return state.config.hasPinpad; };
|
|
176
180
|
export var selectCashDrawer = function (state) { return state.config.hasCashDrawer; };
|
|
181
|
+
export var selectAccessibility = function (state) {
|
|
182
|
+
return state.config.accessibilityOn;
|
|
183
|
+
};
|
|
177
184
|
export var selectStore = function (state) { return state.config.store; };
|
|
178
185
|
export var configReducer = configSlice.reducer;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@open-tender/store",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.282",
|
|
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",
|
|
@@ -61,9 +61,9 @@
|
|
|
61
61
|
},
|
|
62
62
|
"peerDependencies": {
|
|
63
63
|
"@emotion/react": "^11.11.1",
|
|
64
|
-
"@open-tender/types": "^0.4.
|
|
64
|
+
"@open-tender/types": "^0.4.172",
|
|
65
65
|
"@open-tender/ui": "^0.4.52",
|
|
66
|
-
"@open-tender/utils": "^0.5.
|
|
66
|
+
"@open-tender/utils": "^0.5.59",
|
|
67
67
|
"@reduxjs/toolkit": "^2.0.1",
|
|
68
68
|
"date-fns": "2.30.0",
|
|
69
69
|
"date-fns-tz": "^2.0.0",
|
|
@@ -71,6 +71,5 @@
|
|
|
71
71
|
"react-device-detect": "^2.2.3",
|
|
72
72
|
"react-dom": "^18.2.0",
|
|
73
73
|
"uuid": "^9.0.1"
|
|
74
|
-
}
|
|
75
|
-
"packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e"
|
|
74
|
+
}
|
|
76
75
|
}
|