choerodon-ui
Version:
An enterprise-class UI design language and React-based implementation
81 lines (66 loc) • 2.25 kB
JavaScript
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";
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, { PureComponent } from 'react';
import PropTypes from 'prop-types';
import { pxToRem } from '../../../es/_util/UnitConvertor';
import TableContext from './TableContext';
var TableCol =
/*#__PURE__*/
function (_PureComponent) {
_inherits(TableCol, _PureComponent);
var _super = _createSuper(TableCol);
function TableCol() {
_classCallCheck(this, TableCol);
return _super.apply(this, arguments);
}
_createClass(TableCol, [{
key: "render",
value: function render() {
var _this$props = this.props,
width = _this$props.width,
minWidth = _this$props.minWidth;
return React.createElement("col", {
style: {
width: pxToRem(width),
minWidth: pxToRem(minWidth)
}
});
}
}]);
return TableCol;
}(PureComponent);
export { TableCol as default };
TableCol.displayName = 'TableCol';
TableCol.contextType = TableContext;
TableCol.propTypes = {
width: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
minWidth: PropTypes.oneOfType([PropTypes.number, PropTypes.string])
};
//# sourceMappingURL=TableCol.js.map