pixelize-design-library 2.2.195 → 2.2.196
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.
|
@@ -42,17 +42,29 @@ var HeaderActions = function (_a) {
|
|
|
42
42
|
var _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
43
43
|
var actions = _a.actions, selections = _a.selections;
|
|
44
44
|
var colors = (0, useCustomTheme_1.useCustomTheme)().colors;
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
45
|
+
var hasSelections = selections.length > 0;
|
|
46
|
+
return (react_2.default.createElement(react_1.Box, { display: "flex", gap: 2, fontSize: "0.875rem", fontWeight: 400, color: (_b = colors === null || colors === void 0 ? void 0 : colors.secondary) === null || _b === void 0 ? void 0 : _b[500], alignItems: "center" }, (_c = actions === null || actions === void 0 ? void 0 : actions.items) === null || _c === void 0 ? void 0 :
|
|
47
|
+
_c.map(function (item, index) {
|
|
48
|
+
if ("type" in item)
|
|
49
|
+
return null;
|
|
50
|
+
var actionItem = item;
|
|
51
|
+
if (actionItem.isStatic) {
|
|
52
|
+
return (react_2.default.createElement(ListItem, __assign({ key: "static-".concat(index) }, actionItem, { selections: selections })));
|
|
53
|
+
}
|
|
54
|
+
return null;
|
|
55
|
+
}),
|
|
56
|
+
hasSelections && (react_2.default.createElement(react_2.default.Fragment, null,
|
|
57
|
+
((_d = actions === null || actions === void 0 ? void 0 : actions.isDelete) === null || _d === void 0 ? void 0 : _d.enabled) && (react_2.default.createElement(ListItem, { icon: react_2.default.createElement(lucide_react_1.Trash2, { className: "w-4 h-4" }), name: "Delete", onClick: (_e = actions === null || actions === void 0 ? void 0 : actions.isDelete) === null || _e === void 0 ? void 0 : _e.onClick, selections: selections, isHoverEnabled: true, hoverColor: (_f = colors === null || colors === void 0 ? void 0 : colors.red) === null || _f === void 0 ? void 0 : _f[500] })),
|
|
58
|
+
((_g = actions === null || actions === void 0 ? void 0 : actions.isUpdate) === null || _g === void 0 ? void 0 : _g.enabled) && (react_2.default.createElement(ListItem, { icon: react_2.default.createElement(lucide_react_1.SquarePen, { className: "w-4 h-4" }), name: "Mass Update", onClick: (_h = actions === null || actions === void 0 ? void 0 : actions.isUpdate) === null || _h === void 0 ? void 0 : _h.onClick, selections: selections, isHoverEnabled: true, hoverColor: (_j = colors === null || colors === void 0 ? void 0 : colors.primary) === null || _j === void 0 ? void 0 : _j[500] })), (_k = actions === null || actions === void 0 ? void 0 : actions.items) === null || _k === void 0 ? void 0 :
|
|
59
|
+
_k.map(function (item, index) {
|
|
50
60
|
if ("type" in item && item.type === "divider") {
|
|
51
61
|
return react_2.default.createElement(Divider_1.default, { key: index });
|
|
52
62
|
}
|
|
53
63
|
var actionItem = item;
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
64
|
+
if (!actionItem.isStatic) {
|
|
65
|
+
return (react_2.default.createElement(ListItem, __assign({ key: "dynamic-".concat(index) }, actionItem, { selections: selections })));
|
|
66
|
+
}
|
|
67
|
+
return null;
|
|
68
|
+
})))));
|
|
57
69
|
};
|
|
58
70
|
exports.default = HeaderActions;
|