fix:单选缺少PropTypes引入

This commit is contained in:
yangchch6 2019-12-17 20:44:55 +08:00
parent 532ceb1166
commit a1bee3fff2
4 changed files with 32 additions and 26 deletions

View File

@ -1,4 +1,4 @@
"use strict";
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
@ -8,11 +8,15 @@ var _extends = Object.assign || function (target) { for (var i = 1; i < argument
exports["default"] = singleSelect;
var _react = require("react");
var _react = require('react');
var _react2 = _interopRequireDefault(_react);
var _util = require("./util");
var _propTypes = require('prop-types');
var _propTypes2 = _interopRequireDefault(_propTypes);
var _util = require('./util');
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
@ -71,8 +75,8 @@ function singleSelect(Table, Radio) {
return _react2["default"].createElement(
Radio.RadioGroup,
{
className: "table-radio",
name: "table-radio",
className: 'table-radio',
name: 'table-radio',
selectedValue: selectedRowIndex,
onClick: _this.handleRadioClick,
onChange: function onChange(value) {
@ -141,7 +145,7 @@ function singleSelect(Table, Radio) {
return SingleSelect;
}(_react.Component), _class.propTypes = {
autoCheckedByClickRows: PropTypes.bool //行点击时,是否自动勾选单选框
autoCheckedByClickRows: _propTypes2["default"].bool //行点击时,是否自动勾选单选框
}, _class.defaultProps = {
prefixCls: "u-table-single-select",
getSelectedDataFunc: function getSelectedDataFunc() {},
@ -149,4 +153,4 @@ function singleSelect(Table, Radio) {
autoCheckedByClickRows: true
}, _temp;
}
module.exports = exports["default"];
module.exports = exports['default'];

37
dist/demo.js vendored
View File

@ -37453,20 +37453,17 @@
if (this.scrollbarWidth <= 0 && this.props.scroll.y) {
this.scrollbarWidth = (0, _utils.measureScrollbar)();
}
if (this.columnManager.isAnyColumnsFixed()) {
this.syncFixedTableRowHeight();
}
// console.log('this.scrollTop**********',this.scrollTop);
};
Table.prototype.componentDidUpdate = function componentDidUpdate(prevProps, prevState) {
// 展开行后追加了新的DOM必须在此阶段同步高度并重新渲染
if (this.state.expandedRowKeys.length > 0) {
if (this.columnManager.isAnyColumnsFixed()) {
this.syncFixedTableRowHeight();
}
// todo: IE 大数据渲染,行高不固定,且设置了 heightConsistent={true} 时,滚动加载操作会导致 ie11 浏览器崩溃
// https://github.com/tinper-bee/bee-table/commit/bd2092cdbaad236ff89477304e58dea93325bf09
if (this.columnManager.isAnyColumnsFixed()) {
this.syncFixedTableRowHeight();
}
//适应模态框中表格、以及父容器宽度变化的情况
if (typeof this.props.scroll.x !== 'number' && this.contentTable.getBoundingClientRect().width !== this.contentDomWidth && this.firstDid) {
this.computeTableWidth();
@ -289316,7 +289313,7 @@
/* 666 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
@ -289324,15 +289321,19 @@
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
exports["default"] = singleSelect;
exports['default'] = singleSelect;
var _react = __webpack_require__(1);
var _react2 = _interopRequireDefault(_react);
var _propTypes = __webpack_require__(6);
var _propTypes2 = _interopRequireDefault(_propTypes);
var _util = __webpack_require__(622);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; }
@ -289386,18 +289387,18 @@
fixed: "left",
width: 49,
render: function render(text, record, index) {
return _react2["default"].createElement(
return _react2['default'].createElement(
Radio.RadioGroup,
{
className: "table-radio",
name: "table-radio",
className: 'table-radio',
name: 'table-radio',
selectedValue: selectedRowIndex,
onClick: _this.handleRadioClick,
onChange: function onChange(value) {
return _this.onRadioChange(value, record, index);
},
style: { width: '14px', height: '14px', display: 'block', marginLeft: '4px' } },
_react2["default"].createElement(Radio, { value: index })
_react2['default'].createElement(Radio, { value: index })
);
}
}];
@ -289451,7 +289452,7 @@
var columns = this.props.columns;
var data = this.state.data;
return _react2["default"].createElement(Table, _extends({}, this.props, {
return _react2['default'].createElement(Table, _extends({}, this.props, {
columns: this.getDefaultColumns(columns),
data: data,
onRowClick: this.onRowClick }));
@ -289459,7 +289460,7 @@
return SingleSelect;
}(_react.Component), _class.propTypes = {
autoCheckedByClickRows: PropTypes.bool //行点击时,是否自动勾选单选框
autoCheckedByClickRows: _propTypes2['default'].bool //行点击时,是否自动勾选单选框
}, _class.defaultProps = {
prefixCls: "u-table-single-select",
getSelectedDataFunc: function getSelectedDataFunc() {},
@ -289467,7 +289468,7 @@
autoCheckedByClickRows: true
}, _temp;
}
module.exports = exports["default"];
module.exports = exports['default'];
/***/ }),
/* 667 */

2
dist/demo.js.map vendored

File diff suppressed because one or more lines are too long

View File

@ -1,4 +1,5 @@
import React, { Component } from "react";
import PropTypes from 'prop-types';
import {ObjectAssign} from './util';
/**
* 参数: 单选表头