@open-tender/store 1.1.226 → 1.1.228
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/TagsButton.d.ts +3 -1
- package/dist/cjs/components/TagsButton.js +3 -1
- package/dist/cjs/components/TagsFilter.js +1 -1
- package/dist/esm/components/TagsButton.d.ts +3 -1
- package/dist/esm/components/TagsButton.js +3 -1
- package/dist/esm/components/TagsFilter.js +1 -1
- package/package.json +1 -1
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { TagsButtonProps } from '@open-tender/ui';
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
3
|
declare const TagsButton: ({ children }: {
|
|
4
|
-
children: (props: TagsButtonProps
|
|
4
|
+
children: (props: TagsButtonProps & {
|
|
5
|
+
selectedAllergens: number;
|
|
6
|
+
}) => ReactNode;
|
|
5
7
|
}) => ReactNode;
|
|
6
8
|
export default TagsButton;
|
|
@@ -8,6 +8,7 @@ var TagsButton = function (_a) {
|
|
|
8
8
|
var config = (0, hooks_1.useAppSelector)(slices_1.selectKioskConfig).tagsButton;
|
|
9
9
|
var isTagsModalShown = (0, hooks_1.useAppSelector)(slices_1.selectShowTagsModal);
|
|
10
10
|
var selectedTags = (0, hooks_1.useAppSelector)(slices_1.selectSelectedTags);
|
|
11
|
+
var selectedAllergens = (0, hooks_1.useAppSelector)(slices_1.selectSelectedTags);
|
|
11
12
|
var dispatch = (0, hooks_1.useAppDispatch)();
|
|
12
13
|
var onClick = (0, react_1.useCallback)(function () {
|
|
13
14
|
dispatch((0, slices_1.toggleTagsModal)(!isTagsModalShown));
|
|
@@ -17,7 +18,8 @@ var TagsButton = function (_a) {
|
|
|
17
18
|
config: config,
|
|
18
19
|
handlers: handlers,
|
|
19
20
|
isSelected: selectedTags.length > 0,
|
|
20
|
-
selectedTags: selectedTags.length
|
|
21
|
+
selectedTags: selectedTags.length,
|
|
22
|
+
selectedAllergens: selectedAllergens.length
|
|
21
23
|
});
|
|
22
24
|
};
|
|
23
25
|
exports.default = TagsButton;
|
|
@@ -20,7 +20,7 @@ var TagsFilter = function (_a) {
|
|
|
20
20
|
setLocalSelectedTags(selectedTags.map(function (tag) { return tag.tag_id; }));
|
|
21
21
|
selectedAllergens &&
|
|
22
22
|
setLocalSelectedAllergens(selectedAllergens
|
|
23
|
-
.concat(customerAllergens)
|
|
23
|
+
.concat(customerAllergens !== null && customerAllergens !== void 0 ? customerAllergens : [])
|
|
24
24
|
.map(function (allergen) { return allergen.allergen_id; }));
|
|
25
25
|
}, [selectedAllergens, selectedTags, customerAllergens]);
|
|
26
26
|
var onTagSwitch = function (tag) {
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { TagsButtonProps } from '@open-tender/ui';
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
3
|
declare const TagsButton: ({ children }: {
|
|
4
|
-
children: (props: TagsButtonProps
|
|
4
|
+
children: (props: TagsButtonProps & {
|
|
5
|
+
selectedAllergens: number;
|
|
6
|
+
}) => ReactNode;
|
|
5
7
|
}) => ReactNode;
|
|
6
8
|
export default TagsButton;
|
|
@@ -6,6 +6,7 @@ var TagsButton = function (_a) {
|
|
|
6
6
|
var config = useAppSelector(selectKioskConfig).tagsButton;
|
|
7
7
|
var isTagsModalShown = useAppSelector(selectShowTagsModal);
|
|
8
8
|
var selectedTags = useAppSelector(selectSelectedTags);
|
|
9
|
+
var selectedAllergens = useAppSelector(selectSelectedTags);
|
|
9
10
|
var dispatch = useAppDispatch();
|
|
10
11
|
var onClick = useCallback(function () {
|
|
11
12
|
dispatch(toggleTagsModal(!isTagsModalShown));
|
|
@@ -15,7 +16,8 @@ var TagsButton = function (_a) {
|
|
|
15
16
|
config: config,
|
|
16
17
|
handlers: handlers,
|
|
17
18
|
isSelected: selectedTags.length > 0,
|
|
18
|
-
selectedTags: selectedTags.length
|
|
19
|
+
selectedTags: selectedTags.length,
|
|
20
|
+
selectedAllergens: selectedAllergens.length
|
|
19
21
|
});
|
|
20
22
|
};
|
|
21
23
|
export default TagsButton;
|
|
@@ -18,7 +18,7 @@ var TagsFilter = function (_a) {
|
|
|
18
18
|
setLocalSelectedTags(selectedTags.map(function (tag) { return tag.tag_id; }));
|
|
19
19
|
selectedAllergens &&
|
|
20
20
|
setLocalSelectedAllergens(selectedAllergens
|
|
21
|
-
.concat(customerAllergens)
|
|
21
|
+
.concat(customerAllergens !== null && customerAllergens !== void 0 ? customerAllergens : [])
|
|
22
22
|
.map(function (allergen) { return allergen.allergen_id; }));
|
|
23
23
|
}, [selectedAllergens, selectedTags, customerAllergens]);
|
|
24
24
|
var onTagSwitch = function (tag) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@open-tender/store",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.228",
|
|
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",
|