@xyo-network/react-address-render 2.47.15 → 2.47.17
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/RenderRowBox.js +2 -3
- package/dist/cjs/components/RenderRowBox.js.map +1 -1
- package/dist/cjs/components/favorite/FavoriteIconButton.js +4 -4
- package/dist/cjs/components/favorite/FavoriteIconButton.js.map +1 -1
- package/dist/cjs/components/favorite/Popper.js +6 -6
- package/dist/cjs/components/favorite/Popper.js.map +1 -1
- package/dist/cjs/components/favorite/PopperButtonGroup.js +3 -3
- package/dist/cjs/components/favorite/PopperButtonGroup.js.map +1 -1
- package/dist/cjs/components/lib/FavoriteItemEvent.js +2 -2
- package/dist/cjs/components/lib/FavoriteItemEvent.js.map +1 -1
- package/dist/docs.json +565 -610
- package/dist/esm/components/RenderRowBox.js +2 -2
- package/dist/esm/components/RenderRowBox.js.map +1 -1
- package/dist/esm/components/favorite/FavoriteIconButton.js +4 -4
- package/dist/esm/components/favorite/FavoriteIconButton.js.map +1 -1
- package/dist/esm/components/favorite/Popper.js +5 -5
- package/dist/esm/components/favorite/Popper.js.map +1 -1
- package/dist/esm/components/favorite/PopperButtonGroup.js +3 -3
- package/dist/esm/components/favorite/PopperButtonGroup.js.map +1 -1
- package/dist/esm/components/lib/FavoriteItemEvent.js +2 -2
- package/dist/esm/components/lib/FavoriteItemEvent.js.map +1 -1
- package/dist/types/components/RenderRowBox.d.ts +0 -1
- package/dist/types/components/RenderRowBox.d.ts.map +1 -1
- package/dist/types/components/favorite/FavoriteIconButton.d.ts +1 -1
- package/dist/types/components/favorite/FavoriteIconButton.d.ts.map +1 -1
- package/dist/types/components/favorite/Popper.d.ts +2 -2
- package/dist/types/components/favorite/Popper.d.ts.map +1 -1
- package/dist/types/components/favorite/PopperButtonGroup.d.ts +2 -2
- package/dist/types/components/favorite/PopperButtonGroup.d.ts.map +1 -1
- package/dist/types/components/lib/FavoriteItemEvent.d.ts +2 -2
- package/dist/types/components/lib/FavoriteItemEvent.d.ts.map +1 -1
- package/package.json +3 -3
- package/src/components/RenderRowBox.stories.tsx +5 -5
- package/src/components/RenderRowBox.tsx +3 -4
- package/src/components/favorite/FavoriteIconButton.tsx +5 -5
- package/src/components/favorite/Popper.tsx +10 -10
- package/src/components/favorite/PopperButtonGroup.tsx +5 -5
- package/src/components/lib/FavoriteItemEvent.ts +3 -8
|
@@ -11,13 +11,12 @@ const react_shared_1 = require("@xyo-network/react-shared");
|
|
|
11
11
|
const react_1 = require("react");
|
|
12
12
|
const favorite_1 = require("./favorite");
|
|
13
13
|
exports.AddressRenderRowBox = (0, react_1.forwardRef)((_a, ref) => {
|
|
14
|
-
var
|
|
15
|
-
var { address, alias, children, favorite: favoriteProp = false, iconOnly, iconSize = 24, icons, name, showFavorite = false } = _a, props = tslib_1.__rest(_a, ["address", "alias", "children", "favorite", "iconOnly", "iconSize", "icons", "name", "showFavorite"]);
|
|
14
|
+
var { address, children, favorite: favoriteProp = false, iconOnly, iconSize = 24, icons, name, showFavorite = false } = _a, props = tslib_1.__rest(_a, ["address", "children", "favorite", "iconOnly", "iconSize", "icons", "name", "showFavorite"]);
|
|
16
15
|
const theme = (0, material_1.useTheme)();
|
|
17
16
|
const sharedRef = (0, react_shared_1.useShareForwardedRef)(ref);
|
|
18
17
|
const [elementRef, dispatch] = (0, react_event_1.useXyoEvent)(undefined, sharedRef);
|
|
19
18
|
const handleClickedAddress = () => (address ? dispatch('address', 'click', address) : undefined);
|
|
20
|
-
return ((0, jsx_runtime_1.jsxs)(react_flexbox_1.FlexGrowRow, Object.assign({ gap: 2, justifyContent: "flex-start", ref: elementRef, onClick: handleClickedAddress }, props, { children: [icons && address ? ((0, jsx_runtime_1.jsx)(material_1.ListItemIcon, Object.assign({ sx: { minWidth: 0 } }, { children: (0, jsx_runtime_1.jsx)(react_identicon_1.Identicon, { size: iconSize, value: address }) }))) : null, iconOnly ? null : ((0, jsx_runtime_1.jsx)(material_1.ListItemText, { children: (0, jsx_runtime_1.jsx)(react_shared_1.EllipsizeBox, Object.assign({ ellipsisPosition: 'end', width: "100%", typographyProps: { fontSize: theme.typography.body1.fontSize } }, { children:
|
|
19
|
+
return ((0, jsx_runtime_1.jsxs)(react_flexbox_1.FlexGrowRow, Object.assign({ gap: 2, justifyContent: "flex-start", ref: elementRef, onClick: handleClickedAddress }, props, { children: [icons && address ? ((0, jsx_runtime_1.jsx)(material_1.ListItemIcon, Object.assign({ sx: { minWidth: 0 } }, { children: (0, jsx_runtime_1.jsx)(react_identicon_1.Identicon, { size: iconSize, value: address }) }))) : null, iconOnly ? null : ((0, jsx_runtime_1.jsx)(material_1.ListItemText, { children: (0, jsx_runtime_1.jsx)(react_shared_1.EllipsizeBox, Object.assign({ ellipsisPosition: 'end', width: "100%", typographyProps: { fontSize: theme.typography.body1.fontSize } }, { children: name !== null && name !== void 0 ? name : address })) })), children, showFavorite && address ? ((0, jsx_runtime_1.jsx)(favorite_1.FavoriteIconButton, { name: name, size: 'small', value: address, valueType: 'address', favorite: favoriteProp })) : null] })));
|
|
21
20
|
});
|
|
22
21
|
exports.AddressRenderRowBox.displayName = 'AddressRenderRowBox';
|
|
23
22
|
//# sourceMappingURL=RenderRowBox.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RenderRowBox.js","sourceRoot":"","sources":["../../../src/components/RenderRowBox.tsx"],"names":[],"mappings":";;;;;AAAA,4CAAoE;AACpE,yDAAiE;AACjE,6DAAmD;AAEnD,0DAAsD;AACtD,4DAA8E;AAC9E,iCAAkC;AAElC,yCAA+C;
|
|
1
|
+
{"version":3,"file":"RenderRowBox.js","sourceRoot":"","sources":["../../../src/components/RenderRowBox.tsx"],"names":[],"mappings":";;;;;AAAA,4CAAoE;AACpE,yDAAiE;AACjE,6DAAmD;AAEnD,0DAAsD;AACtD,4DAA8E;AAC9E,iCAAkC;AAElC,yCAA+C;AAclC,QAAA,mBAAmB,GAAG,IAAA,kBAAU,EAC3C,CAAC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I,cAAJ,IAAI,GAAI,OAAO,IACH,GACF,CAChB,EACA,QAAQ,EACR,YAAY,IAAI,OAAO,CAAC,CAAC,CAAC,CACzB,uBAAC,6BAAkB,IAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,QAAQ,EAAE,YAAY,GAAI,CAChH,CAAC,CAAC,CAAC,IAAI,KACI,CACf,CAAA;AACH,CAAC,CACF,CAAA;AAED,2BAAmB,CAAC,WAAW,GAAG,qBAAqB,CAAA"}
|
|
@@ -12,7 +12,7 @@ const FavoriteToggleSVG_1 = require("./FavoriteToggleSVG");
|
|
|
12
12
|
const lib_2 = require("./lib");
|
|
13
13
|
const Popper_1 = require("./Popper");
|
|
14
14
|
exports.FavoriteIconButton = (0, react_1.forwardRef)((_a, ref) => {
|
|
15
|
-
var {
|
|
15
|
+
var { children, favorite: favoriteProp, name, valueType, value } = _a, props = tslib_1.__rest(_a, ["children", "favorite", "name", "valueType", "value"]);
|
|
16
16
|
const [openPopper, setOpenPopper] = (0, react_1.useState)(false);
|
|
17
17
|
const [favorite, setFavorite] = (0, react_1.useState)(favoriteProp);
|
|
18
18
|
(0, react_1.useEffect)(() => {
|
|
@@ -20,8 +20,8 @@ exports.FavoriteIconButton = (0, react_1.forwardRef)((_a, ref) => {
|
|
|
20
20
|
}, [favoriteProp]);
|
|
21
21
|
const sharedRef = (0, react_shared_1.useShareForwardedRef)(ref);
|
|
22
22
|
const [buttonRef, dispatch] = (0, react_event_1.useXyoEvent)(undefined, sharedRef);
|
|
23
|
-
const onConfirmFavorite = (
|
|
24
|
-
const favoriteEvent = (0, lib_1.generateFavoriteEvent)(
|
|
23
|
+
const onConfirmFavorite = (name, newFavoriteState) => {
|
|
24
|
+
const favoriteEvent = (0, lib_1.generateFavoriteEvent)(!!newFavoriteState, valueType, value, name);
|
|
25
25
|
dispatch('address', 'favorite', JSON.stringify(favoriteEvent));
|
|
26
26
|
setFavorite(newFavoriteState);
|
|
27
27
|
setOpenPopper(false);
|
|
@@ -30,7 +30,7 @@ exports.FavoriteIconButton = (0, react_1.forwardRef)((_a, ref) => {
|
|
|
30
30
|
return ((0, jsx_runtime_1.jsxs)(material_1.IconButton, Object.assign({ "aria-describedby": lib_2.popperId, ref: buttonRef, onClick: (event) => {
|
|
31
31
|
event.stopPropagation();
|
|
32
32
|
setOpenPopper(!openPopper);
|
|
33
|
-
}, onMouseDown: (e) => e.stopPropagation() }, props, { children: [(0, jsx_runtime_1.jsx)("span", Object.assign({ ref: starRef }, { children: (0, jsx_runtime_1.jsx)(FavoriteToggleSVG_1.FavoriteToggleSVG, { favorite: favorite }) })), (0, jsx_runtime_1.jsx)(Popper_1.FavoritePopper, { sx: { zIndex: 1301 },
|
|
33
|
+
}, onMouseDown: (e) => e.stopPropagation() }, props, { children: [(0, jsx_runtime_1.jsx)("span", Object.assign({ ref: starRef }, { children: (0, jsx_runtime_1.jsx)(FavoriteToggleSVG_1.FavoriteToggleSVG, { favorite: favorite }) })), (0, jsx_runtime_1.jsx)(Popper_1.FavoritePopper, { sx: { zIndex: 1301 }, name: name, favorite: favorite, favoriteRef: starRef, open: openPopper, onConfirmFavorite: onConfirmFavorite, onClickAway: () => setOpenPopper(false) }), children] })));
|
|
34
34
|
});
|
|
35
35
|
exports.FavoriteIconButton.displayName = 'FavoriteIconButton';
|
|
36
36
|
//# sourceMappingURL=FavoriteIconButton.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FavoriteIconButton.js","sourceRoot":"","sources":["../../../../src/components/favorite/FavoriteIconButton.tsx"],"names":[],"mappings":";;;;;AAAA,4CAA2D;AAE3D,0DAAsD;AACtD,4DAAgE;AAChE,iCAA+D;AAE/D,gCAAiE;AACjE,2DAAuD;AACvD,+BAAgC;AAChC,qCAAyC;AAS5B,QAAA,kBAAkB,GAAG,IAAA,kBAAU,EAC1C,CAAC,
|
|
1
|
+
{"version":3,"file":"Favo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MAAM,OAAO,GAAG,IAAA,cAAM,EAAkB,IAAI,CAAC,CAAA;IAE7C,OAAO,CACL,wBAAC,qBAAU,sCACS,cAAQ,EAC1B,GAAG,EAAE,SAAS,EACd,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE;YACjB,KAAK,CAAC,eAAe,EAAE,CAAA;YACvB,aAAa,CAAC,CAAC,UAAU,CAAC,CAAA;QAC5B,CAAC,EACD,WAAW,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,eAAe,EAAE,IACnC,KAAK,eAET,+CAAM,GAAG,EAAE,OAAO,gBAChB,uBAAC,qCAAiB,IAAC,QAAQ,EAAE,QAAQ,GAAI,IACpC,EACP,uBAAC,uBAAc,IACb,EAAE,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,EACpB,IAAI,EAAE,IAAI,EACV,QAAQ,EAAE,QAAQ,EAClB,WAAW,EAAE,OAAO,EACpB,IAAI,EAAE,UAAU,EAChB,iBAAiB,EAAE,iBAAiB,EACpC,WAAW,EAAE,GAAG,EAAE,CAAC,aAAa,CAAC,KAAK,CAAC,GACvC,EACD,QAAQ,KACE,CACd,CAAA;AACH,CAAC,CACF,CAAA;AAED,0BAAkB,CAAC,WAAW,GAAG,oBAAoB,CAAA"}
|
|
@@ -8,14 +8,14 @@ const react_1 = require("react");
|
|
|
8
8
|
const lib_1 = require("./lib");
|
|
9
9
|
const PopperButtonGroup_1 = require("./PopperButtonGroup");
|
|
10
10
|
exports.FavoritePopper = (0, react_1.forwardRef)((_a, ref) => {
|
|
11
|
-
var {
|
|
11
|
+
var { name: nameProp, favorite, favoriteRef, onClickAway = () => {
|
|
12
12
|
return;
|
|
13
|
-
}, onConfirmFavorite } = _a, props = tslib_1.__rest(_a, ["
|
|
14
|
-
const [
|
|
13
|
+
}, onConfirmFavorite } = _a, props = tslib_1.__rest(_a, ["name", "favorite", "favoriteRef", "onClickAway", "onConfirmFavorite"]);
|
|
14
|
+
const [name, setName] = (0, react_1.useState)();
|
|
15
15
|
(0, react_1.useEffect)(() => {
|
|
16
|
-
|
|
17
|
-
}, [
|
|
18
|
-
return ((0, jsx_runtime_1.jsx)(material_1.ClickAwayListener, Object.assign({ onClickAway: onClickAway }, { children: (0, jsx_runtime_1.jsx)(PopperStyled, Object.assign({ id: lib_1.popperId, anchorEl: favoriteRef === null || favoriteRef === void 0 ? void 0 : favoriteRef.current, onClick: (e) => e.stopPropagation(), transition: true, ref: ref }, props, { children: ({ TransitionProps }) => ((0, jsx_runtime_1.jsx)(material_1.Fade, Object.assign({}, TransitionProps, { timeout: 350 }, { children: (0, jsx_runtime_1.jsx)(material_1.Card, { children: (0, jsx_runtime_1.jsxs)(material_1.CardContent, Object.assign({ sx: { display: 'flex', gap: 1 } }, { children: [(0, jsx_runtime_1.jsx)(material_1.TextField, { autoFocus: true, label: "Favorite
|
|
16
|
+
setName(nameProp);
|
|
17
|
+
}, [nameProp]);
|
|
18
|
+
return ((0, jsx_runtime_1.jsx)(material_1.ClickAwayListener, Object.assign({ onClickAway: onClickAway }, { children: (0, jsx_runtime_1.jsx)(PopperStyled, Object.assign({ id: lib_1.popperId, anchorEl: favoriteRef === null || favoriteRef === void 0 ? void 0 : favoriteRef.current, onClick: (e) => e.stopPropagation(), transition: true, ref: ref }, props, { children: ({ TransitionProps }) => ((0, jsx_runtime_1.jsx)(material_1.Fade, Object.assign({}, TransitionProps, { timeout: 350 }, { children: (0, jsx_runtime_1.jsx)(material_1.Card, { children: (0, jsx_runtime_1.jsxs)(material_1.CardContent, Object.assign({ sx: { display: 'flex', gap: 1 } }, { children: [(0, jsx_runtime_1.jsx)(material_1.TextField, { autoFocus: true, label: "Favorite Name", placeholder: "optional", size: "small", value: name !== null && name !== void 0 ? name : '', onChange: (e) => setName(e.target.value) }), (0, jsx_runtime_1.jsx)(PopperButtonGroup_1.PopperButtonGroup, { favorite: favorite, onConfirmFavorite: onConfirmFavorite, name: name })] })) }) }))) })) })));
|
|
19
19
|
});
|
|
20
20
|
exports.FavoritePopper.displayName = 'FavoritePopper';
|
|
21
21
|
// Ensure the popper is over all other mui portal elements
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Popper.js","sourceRoot":"","sources":["../../../../src/components/favorite/Popper.tsx"],"names":[],"mappings":";;;;;AAAA,4CAAkH;AAClH,iCAAkE;AAElE,+BAAgC;AAChC,2DAAuD;AAS1C,QAAA,cAAc,GAAG,IAAA,kBAAU,EACtC,CACE,EASC,EACD,GAAG,EACH,EAAE;QAXF,EACE,
|
|
1
|
+
{"version":3,"file":"Popper.js","sourceRoot":"","sources":["../../../../src/components/favorite/Popper.tsx"],"names":[],"mappings":";;;;;AAAA,4CAAkH;AAClH,iCAAkE;AAElE,+BAAgC;AAChC,2DAAuD;AAS1C,QAAA,cAAc,GAAG,IAAA,kBAAU,EACtC,CACE,EASC,EACD,GAAG,EACH,EAAE;QAXF,EACE,IAAI,EAAE,QAAQ,EACd,QAAQ,EACR,WAAW,EACX,WAAW,GAAG,GAAG,EAAE;QACjB,OAAM;IACR,CAAC,EACD,iBAAiB,OAElB,EADI,KAAK,sBARV,uEASC,CADS;IAIV,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,IAAA,gBAAQ,GAAU,CAAA;IAC1C,IAAA,iBAAS,EAAC,GAAG,EAAE;QACb,OAAO,CAAC,QAAQ,CAAC,CAAA;IACnB,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAA;IAEd,OAAO,CACL,uBAAC,4BAAiB,kBAAC,WAAW,EAAE,WAAW,gBACzC,uBAAC,YAAY,kBAAC,EAAE,EAAE,cAAQ,EAAE,QAAQ,EAAE,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,OAAO,EAAE,OAAO,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,eAAe,EAAE,EAAE,UAAU,QAAC,GAAG,EAAE,GAAG,IAAM,KAAK,cAC5H,CAAC,EAAE,eAAe,EAAE,EAAE,EAAE,CAAC,CACxB,uBAAC,eAAI,oBAAK,eAAe,IAAE,OAAO,EAAE,GAAG,gBACrC,uBAAC,eAAI,cACH,wBAAC,sBAAW,kBAAC,EAAE,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC,EAAE,iBAC1C,uBAAC,oBAAS,IACR,SAAS,QACT,KAAK,EAAC,eAAe,EACrB,WAAW,EAAC,UAAU,EACtB,IAAI,EAAC,OAAO,EACZ,KAAK,EAAE,IAAI,aAAJ,IAAI,cAAJ,IAAI,GAAI,EAAE,EACjB,QAAQ,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,GACxC,EACF,uBAAC,qCAAiB,IAAC,QAAQ,EAAE,QAAQ,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,IAAI,EAAE,IAAI,GAAI,KAC/E,GACT,IACF,CACR,IACY,IACG,CACrB,CAAA;AACH,CAAC,CACF,CAAA;AAED,sBAAc,CAAC,WAAW,GAAG,gBAAgB,CAAA;AAE7C,0DAA0D;AAC1D,MAAM,YAAY,GAAG,IAAA,iBAAM,EAAC,iBAAM,EAAE,EAAE,IAAI,EAAE,cAAc,EAAE,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,CAAA"}
|
|
@@ -7,13 +7,13 @@ const Delete_1 = tslib_1.__importDefault(require("@mui/icons-material/Delete"));
|
|
|
7
7
|
const Star_1 = tslib_1.__importDefault(require("@mui/icons-material/Star"));
|
|
8
8
|
const material_1 = require("@mui/material");
|
|
9
9
|
const PopperButtonGroup = (_a) => {
|
|
10
|
-
var {
|
|
10
|
+
var { name, onConfirmFavorite, favorite } = _a, props = tslib_1.__rest(_a, ["name", "onConfirmFavorite", "favorite"]);
|
|
11
11
|
return ((0, jsx_runtime_1.jsxs)(material_1.ButtonGroup, Object.assign({}, props, { children: [(0, jsx_runtime_1.jsx)(material_1.Button, Object.assign({ title: "Save Favorite", variant: "contained", onClick: (e) => {
|
|
12
12
|
e.stopPropagation();
|
|
13
|
-
onConfirmFavorite === null || onConfirmFavorite === void 0 ? void 0 : onConfirmFavorite(
|
|
13
|
+
onConfirmFavorite === null || onConfirmFavorite === void 0 ? void 0 : onConfirmFavorite(name, true);
|
|
14
14
|
} }, { children: (0, jsx_runtime_1.jsx)(Star_1.default, {}) })), favorite ? ((0, jsx_runtime_1.jsx)(material_1.Button, Object.assign({ title: "Remove Favorite", variant: "contained", onClick: (e) => {
|
|
15
15
|
e.stopPropagation();
|
|
16
|
-
onConfirmFavorite === null || onConfirmFavorite === void 0 ? void 0 : onConfirmFavorite(
|
|
16
|
+
onConfirmFavorite === null || onConfirmFavorite === void 0 ? void 0 : onConfirmFavorite(name, false);
|
|
17
17
|
} }, { children: (0, jsx_runtime_1.jsx)(Delete_1.default, {}) }))) : null] })));
|
|
18
18
|
};
|
|
19
19
|
exports.PopperButtonGroup = PopperButtonGroup;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PopperButtonGroup.js","sourceRoot":"","sources":["../../../../src/components/favorite/PopperButtonGroup.tsx"],"names":[],"mappings":";;;;;AAAA,gFAAmD;AACnD,4EAA+C;AAC/C,4CAAqE;AAQ9D,MAAM,iBAAiB,GAAkC,CAAC,
|
|
1
|
+
{"version":3,"file":"PopperButtonGroup.js","sourceRoot":"","sources":["../../../../src/components/favorite/PopperButtonGroup.tsx"],"names":[],"mappings":";;;;;AAAA,gFAAmD;AACnD,4EAA+C;AAC/C,4CAAqE;AAQ9D,MAAM,iBAAiB,GAAkC,CAAC,EAA+C,EAAE,EAAE;QAAnD,EAAE,IAAI,EAAE,iBAAiB,EAAE,QAAQ,OAAY,EAAP,KAAK,sBAA7C,yCAA+C,CAAF;IAC5G,OAAO,CACL,wBAAC,sBAAW,oBAAK,KAAK,eACpB,uBAAC,iBAAM,kBACL,KAAK,EAAC,eAAe,EACrB,OAAO,EAAC,WAAW,EACnB,OAAO,EAAE,CAAC,CAAC,EAAE,EAAE;oBACb,CAAC,CAAC,eAAe,EAAE,CAAA;oBACnB,iBAAiB,aAAjB,iBAAiB,uBAAjB,iBAAiB,CAAG,IAAI,EAAE,IAAI,CAAC,CAAA;gBACjC,CAAC,gBAED,uBAAC,cAAQ,KAAG,IACL,EACR,QAAQ,CAAC,CAAC,CAAC,CACV,uBAAC,iBAAM,kBACL,KAAK,EAAC,iBAAiB,EACvB,OAAO,EAAC,WAAW,EACnB,OAAO,EAAE,CAAC,CAAC,EAAE,EAAE;oBACb,CAAC,CAAC,eAAe,EAAE,CAAA;oBACnB,iBAAiB,aAAjB,iBAAiB,uBAAjB,iBAAiB,CAAG,IAAI,EAAE,KAAK,CAAC,CAAA;gBAClC,CAAC,gBAED,uBAAC,gBAAU,KAAG,IACP,CACV,CAAC,CAAC,CAAC,IAAI,KACI,CACf,CAAA;AACH,CAAC,CAAA;AA3BY,QAAA,iBAAiB,qBA2B7B"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.generateFavoriteEvent = void 0;
|
|
4
|
-
const generateFavoriteEvent = (
|
|
5
|
-
alias,
|
|
4
|
+
const generateFavoriteEvent = (favorite, favoriteType, favoriteValue, name) => ({
|
|
6
5
|
favorite: !!favorite,
|
|
7
6
|
favoriteType,
|
|
8
7
|
favoriteValue,
|
|
8
|
+
name,
|
|
9
9
|
});
|
|
10
10
|
exports.generateFavoriteEvent = generateFavoriteEvent;
|
|
11
11
|
//# sourceMappingURL=FavoriteItemEvent.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FavoriteItemEvent.js","sourceRoot":"","sources":["../../../../src/components/lib/FavoriteItemEvent.ts"],"names":[],"mappings":";;;AASO,MAAM,qBAAqB,GAAG,
|
|
1
|
+
{"version":3,"file":"FavoriteItemEvent.js","sourceRoot":"","sources":["../../../../src/components/lib/FavoriteItemEvent.ts"],"names":[],"mappings":";;;AASO,MAAM,qBAAqB,GAAG,CAAC,QAAkB,EAAE,YAA2B,EAAE,aAAsB,EAAE,IAAa,EAAqB,EAAE,CAAC,CAAC;IACnJ,QAAQ,EAAE,CAAC,CAAC,QAAQ;IACpB,YAAY;IACZ,aAAa;IACb,IAAI;CACL,CAAC,CAAA;AALW,QAAA,qBAAqB,yBAKhC"}
|