1 | "use strict";
|
2 |
|
3 | var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
4 |
|
5 | var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard");
|
6 |
|
7 | Object.defineProperty(exports, "__esModule", {
|
8 | value: true
|
9 | });
|
10 | exports.default = void 0;
|
11 |
|
12 | var React = _interopRequireWildcard(require("react"));
|
13 |
|
14 | var _classnames = _interopRequireDefault(require("classnames"));
|
15 |
|
16 | var TransBtn = function TransBtn(_ref) {
|
17 | var className = _ref.className,
|
18 | customizeIcon = _ref.customizeIcon,
|
19 | customizeIconProps = _ref.customizeIconProps,
|
20 | _onMouseDown = _ref.onMouseDown,
|
21 | onClick = _ref.onClick,
|
22 | children = _ref.children;
|
23 | var icon;
|
24 |
|
25 | if (typeof customizeIcon === 'function') {
|
26 | icon = customizeIcon(customizeIconProps);
|
27 | } else {
|
28 | icon = customizeIcon;
|
29 | }
|
30 |
|
31 | return React.createElement("span", {
|
32 | className: className,
|
33 | onMouseDown: function onMouseDown(event) {
|
34 | event.preventDefault();
|
35 |
|
36 | if (_onMouseDown) {
|
37 | _onMouseDown(event);
|
38 | }
|
39 | },
|
40 | style: {
|
41 | userSelect: 'none',
|
42 | WebkitUserSelect: 'none'
|
43 | },
|
44 | unselectable: "on",
|
45 | onClick: onClick,
|
46 | "aria-hidden": true
|
47 | }, icon !== undefined ? icon : React.createElement("span", {
|
48 | className: (0, _classnames.default)(className.split(/\s+/).map(function (cls) {
|
49 | return "".concat(cls, "-icon");
|
50 | }))
|
51 | }, children));
|
52 | };
|
53 |
|
54 | var _default = TransBtn;
|
55 | exports.default = _default; |
\ | No newline at end of file |