ze-react-component-library
Version:
ZeroETP React Component Library
59 lines (52 loc) • 1.64 kB
JavaScript
import "antd/es/tooltip/style";
import _Tooltip from "antd/es/tooltip";
var __assign = this && this.__assign || function () {
__assign = Object.assign || function (t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) {
if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
}
}
return t;
};
return __assign.apply(this, arguments);
};
import React from "react";
import "./index.less";
var HoverAction = function HoverAction(_a) {
var actions = _a.actions,
children = _a.children,
_b = _a.fixed,
fixed = _b === void 0 ? "right" : _b,
_c = _a.className,
className = _c === void 0 ? "" : _c,
_d = _a.mode,
mode = _d === void 0 ? "default" : _d,
onClick = _a.onClick,
style = _a.style;
return /*#__PURE__*/React.createElement("span", {
className: "hover-action hover-action-" + mode + " " + className,
onClick: onClick,
style: style
}, children, /*#__PURE__*/React.createElement("span", {
className: "hover-action-list " + (fixed ? "fixed " + fixed : "")
}, actions.map(function (d) {
return /*#__PURE__*/React.createElement(_Tooltip, __assign({
key: d.key
}, d.tip ? {
title: d.tip
} : {
open: false,
title: null
}), /*#__PURE__*/React.createElement("span", {
onClick: d.onClick,
className: "hover-action-list-item " + mode
}, d.icon, mode === "normal" && d.title && /*#__PURE__*/React.createElement("span", {
style: {
marginLeft: 4
}
}, d.title)));
})));
};
export default HoverAction;