UNPKG

choerodon-ui

Version:

An enterprise-class UI design language and React-based implementation

96 lines (79 loc) 3.02 kB
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties"; import _classCallCheck from "@babel/runtime/helpers/classCallCheck"; import _createClass from "@babel/runtime/helpers/createClass"; import _inherits from "@babel/runtime/helpers/inherits"; import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn"; import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf"; import _defineProperty from "@babel/runtime/helpers/defineProperty"; function _createSuper(Derived) { function isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } } return function () { var Super = _getPrototypeOf(Derived), result; if (isNativeReflectConstruct()) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } import React, { Component } from 'react'; import PropTypes from 'prop-types'; import Touchable from 'rmc-feedback'; var InputHandler = /*#__PURE__*/ function (_Component) { _inherits(InputHandler, _Component); var _super = _createSuper(InputHandler); function InputHandler() { _classCallCheck(this, InputHandler); return _super.apply(this, arguments); } _createClass(InputHandler, [{ key: "render", value: function render() { var _this$props = this.props, prefixCls = _this$props.prefixCls, disabled = _this$props.disabled, onTouchStart = _this$props.onTouchStart, onTouchEnd = _this$props.onTouchEnd, onMouseDown = _this$props.onMouseDown, onMouseUp = _this$props.onMouseUp, onMouseLeave = _this$props.onMouseLeave, otherProps = _objectWithoutProperties(_this$props, ["prefixCls", "disabled", "onTouchStart", "onTouchEnd", "onMouseDown", "onMouseUp", "onMouseLeave"]); return React.createElement(Touchable, { disabled: disabled, onTouchStart: onTouchStart, onTouchEnd: onTouchEnd, onMouseDown: onMouseDown, onMouseUp: onMouseUp, onMouseLeave: onMouseLeave, activeClassName: "".concat(prefixCls, "-handler-active") }, React.createElement("span", otherProps)); } }]); return InputHandler; }(Component); _defineProperty(InputHandler, "propTypes", { prefixCls: PropTypes.string, disabled: PropTypes.bool, onTouchStart: PropTypes.func, onTouchEnd: PropTypes.func, onMouseDown: PropTypes.func, onMouseUp: PropTypes.func, onMouseLeave: PropTypes.func }); export { InputHandler as default }; //# sourceMappingURL=InputHandler.js.map