oolib 2.25.3 → 2.25.4
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.
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
export function ActionMenu({ icon, invert, actions, align, iconSize, ButtonComp: _ButtonComp, setShowActions: setShowActionsInParent, popOutOfOverflowHiddenParent, storybookPreview }: {
|
|
1
|
+
export function ActionMenu({ icon, invert, actions, align, iconSize, M, ButtonComp: _ButtonComp, setShowActions: setShowActionsInParent, popOutOfOverflowHiddenParent, storybookPreview }: {
|
|
2
2
|
icon?: string;
|
|
3
3
|
invert: any;
|
|
4
4
|
actions: any;
|
|
5
5
|
align?: string;
|
|
6
6
|
iconSize?: string;
|
|
7
|
+
M: any;
|
|
7
8
|
ButtonComp?: string;
|
|
8
9
|
setShowActions: any;
|
|
9
10
|
popOutOfOverflowHiddenParent?: boolean;
|
|
@@ -46,7 +46,7 @@ var styled_1 = require("./styled");
|
|
|
46
46
|
var ActionMenu = function (_a) {
|
|
47
47
|
var _b, _c;
|
|
48
48
|
var _d = _a.icon, icon = _d === void 0 ? 'DotsThree' : _d, //most likely will never change
|
|
49
|
-
invert = _a.invert, actions = _a.actions, _e = _a.align, align = _e === void 0 ? 'right' : _e, _f = _a.iconSize, iconSize = _f === void 0 ? 'S' : _f, _g = _a.ButtonComp, _ButtonComp = _g === void 0 ? 'ButtonGhost' : _g, setShowActionsInParent = _a.setShowActions, _h = _a.popOutOfOverflowHiddenParent, popOutOfOverflowHiddenParent = _h === void 0 ? false : _h, storybookPreview = _a.storybookPreview //for storybook purposes
|
|
49
|
+
invert = _a.invert, actions = _a.actions, _e = _a.align, align = _e === void 0 ? 'right' : _e, _f = _a.iconSize, iconSize = _f === void 0 ? 'S' : _f, M = _a.M, _g = _a.ButtonComp, _ButtonComp = _g === void 0 ? 'ButtonGhost' : _g, setShowActionsInParent = _a.setShowActions, _h = _a.popOutOfOverflowHiddenParent, popOutOfOverflowHiddenParent = _h === void 0 ? false : _h, storybookPreview = _a.storybookPreview //for storybook purposes
|
|
50
50
|
;
|
|
51
51
|
var actionMenuRef = (0, react_1.useRef)(null);
|
|
52
52
|
var optionsWrapperRef = (0, react_1.useRef)(null);
|
|
@@ -56,6 +56,9 @@ var ActionMenu = function (_a) {
|
|
|
56
56
|
return null;
|
|
57
57
|
var getOpsRect = function () { var _a; return (_a = optionsWrapperRef.current) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect(); };
|
|
58
58
|
var ButtonComp = ButtonComps[_ButtonComp];
|
|
59
|
+
//basically action menu defaults to 'S' button size (cuz its an icon only button)
|
|
60
|
+
//so passing 'M' will override this default and make it a Medium sized button
|
|
61
|
+
var buttonSize = M ? { M: true } : {};
|
|
59
62
|
var genOptionIcon = function (iconName) {
|
|
60
63
|
var IconComp = icons_1.icons[iconName];
|
|
61
64
|
return react_1.default.createElement(IconComp, { size: 16 });
|
|
@@ -75,9 +78,9 @@ var ActionMenu = function (_a) {
|
|
|
75
78
|
}, []);
|
|
76
79
|
var _k = (0, usePopOutOfOverflowHiddenParent_1.usePopOutOfOverflowHiddenParent)(popOutOfOverflowHiddenParent), fixPos = _k.fixPos, applyFixedPos = _k.applyFixedPos, removeFixedPos = _k.removeFixedPos, trackerRef = _k.trackerRef;
|
|
77
80
|
return (react_1.default.createElement(styled_1.StyledActionMenu, { ref: actionMenuRef },
|
|
78
|
-
react_1.default.createElement(ButtonComp, { icon: icon, iconSize: iconSize, invert: invert, stopPropagation: true, onClick: function (e) {
|
|
81
|
+
react_1.default.createElement(ButtonComp, __assign({}, buttonSize, { icon: icon, iconSize: iconSize, invert: invert, stopPropagation: true, onClick: function (e) {
|
|
79
82
|
setShowActions(!showActions);
|
|
80
|
-
}, active: showActions }),
|
|
83
|
+
}, active: showActions })),
|
|
81
84
|
popOutOfOverflowHiddenParent &&
|
|
82
85
|
react_1.default.createElement(styled_1.StyledActionMenuTracker, { storybookPreview: storybookPreview, align: align, ref: trackerRef }),
|
|
83
86
|
react_1.default.createElement(styled_1.StyledActionsDropMenu, __assign({}, {
|