1 | "use strict";
|
2 |
|
3 | var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
4 | var _typeof = require("@babel/runtime/helpers/typeof");
|
5 | Object.defineProperty(exports, "__esModule", {
|
6 | value: true
|
7 | });
|
8 | exports.default = void 0;
|
9 | var React = _interopRequireWildcard(require("react"));
|
10 | var _classnames = _interopRequireDefault(require("classnames"));
|
11 | function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
12 | function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
13 | var TransBtn = function TransBtn(props) {
|
14 | var className = props.className,
|
15 | customizeIcon = props.customizeIcon,
|
16 | customizeIconProps = props.customizeIconProps,
|
17 | children = props.children,
|
18 | _onMouseDown = props.onMouseDown,
|
19 | onClick = props.onClick;
|
20 | var icon = typeof customizeIcon === 'function' ? customizeIcon(customizeIconProps) : customizeIcon;
|
21 | return React.createElement("span", {
|
22 | className: className,
|
23 | onMouseDown: function onMouseDown(event) {
|
24 | event.preventDefault();
|
25 | _onMouseDown === null || _onMouseDown === void 0 || _onMouseDown(event);
|
26 | },
|
27 | style: {
|
28 | userSelect: 'none',
|
29 | WebkitUserSelect: 'none'
|
30 | },
|
31 | unselectable: "on",
|
32 | onClick: onClick,
|
33 | "aria-hidden": true
|
34 | }, icon !== undefined ? icon : React.createElement("span", {
|
35 | className: (0, _classnames.default)(className.split(/\s+/).map(function (cls) {
|
36 | return "".concat(cls, "-icon");
|
37 | }))
|
38 | }, children));
|
39 | };
|
40 | var _default = exports.default = TransBtn; |
\ | No newline at end of file |