You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

42 lines
1.0 KiB

import * as React from 'react';
import classNames from 'classnames';
var TransBtn = function TransBtn(_ref) {
var className = _ref.className,
customizeIcon = _ref.customizeIcon,
customizeIconProps = _ref.customizeIconProps,
_onMouseDown = _ref.onMouseDown,
onClick = _ref.onClick,
children = _ref.children;
var icon;
if (typeof customizeIcon === 'function') {
icon = customizeIcon(customizeIconProps);
} else {
icon = customizeIcon;
}
return React.createElement("span", {
className: className,
onMouseDown: function onMouseDown(event) {
event.preventDefault();
if (_onMouseDown) {
_onMouseDown(event);
}
},
style: {
userSelect: 'none',
WebkitUserSelect: 'none'
},
unselectable: "on",
onClick: onClick,
"aria-hidden": true
}, icon !== undefined ? icon : React.createElement("span", {
className: classNames(className.split(/\s+/).map(function (cls) {
return "".concat(cls, "-icon");
}))
}, children));
};
export default TransBtn;