UNPKG

1.08 kBJavaScriptView Raw
1import * as React from 'react';
2import classNames from 'classnames';
3var TransBtn = function TransBtn(_ref) {
4 var className = _ref.className,
5 customizeIcon = _ref.customizeIcon,
6 customizeIconProps = _ref.customizeIconProps,
7 _onMouseDown = _ref.onMouseDown,
8 onClick = _ref.onClick,
9 children = _ref.children;
10 var icon;
11 if (typeof customizeIcon === 'function') {
12 icon = customizeIcon(customizeIconProps);
13 } else {
14 icon = customizeIcon;
15 }
16 return /*#__PURE__*/React.createElement("span", {
17 className: className,
18 onMouseDown: function onMouseDown(event) {
19 event.preventDefault();
20 if (_onMouseDown) {
21 _onMouseDown(event);
22 }
23 },
24 style: {
25 userSelect: 'none',
26 WebkitUserSelect: 'none'
27 },
28 unselectable: "on",
29 onClick: onClick,
30 "aria-hidden": true
31 }, icon !== undefined ? icon : /*#__PURE__*/React.createElement("span", {
32 className: classNames(className.split(/\s+/).map(function (cls) {
33 return "".concat(cls, "-icon");
34 }))
35 }, children));
36};
37export default TransBtn;
\No newline at end of file