@ttk/component
Version:
ttk组件库
51 lines (40 loc) • 2.07 kB
JavaScript
import { _ as _inherits, a as _getPrototypeOf, b as _possibleConstructorReturn, c as _classCallCheck, e as _assertThisInitialized, d as _createClass } from '../getPrototypeOf-b95655c5.js';
import React__default, { Component } from 'react';
import '../_commonjsHelpers-471920d6.js';
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
var Resizer = /*#__PURE__*/function (_Component) {
_inherits(Resizer, _Component);
var _super = _createSuper(Resizer);
function Resizer(props) {
var _this;
_classCallCheck(this, Resizer);
_this = _super.call(this, props);
_this.onMouseDown = _this.onMouseDown.bind(_assertThisInitialized(_this));
return _this;
}
_createClass(Resizer, [{
key: "onMouseDown",
value: function onMouseDown(event) {
this.props.onMouseDown(event);
}
}, {
key: "render",
value: function render() {
var _this$props = this.props,
split = _this$props.split,
className = _this$props.className;
var classes = ['Resizer', split, className];
return /*#__PURE__*/React__default.createElement("span", {
className: classes.join(' '),
style: this.props.style || {
width: 3,
cursor: 'e-resize'
},
onMouseDown: this.onMouseDown
});
}
}]);
return Resizer;
}(Component);
export { Resizer as default };