diff --git a/api.css b/api.css index ce6496271c759a8831919b10bf9d295dfb3a993c..847bbf56f7ba139aab248f70e41d1698e30755af 100644 --- a/api.css +++ b/api.css @@ -3069,7 +3069,6 @@ mark { right: 0; left: 0; bottom: 0; - background-color: #373737; background-color: rgba(0, 0, 0, 0.65); height: 100%; z-index: 1000; @@ -3115,7 +3114,7 @@ mark { color: rgba(0, 0, 0, 0.85); font-weight: 500; font-size: 16px; - line-height: 22px; + line-height: 1.4; display: block; overflow: auto; } @@ -3829,34 +3828,43 @@ mark { position: relative; display: inline-block; } -.ant-btn-group > .ant-btn { +.ant-btn-group > .ant-btn, +.ant-btn-group > span > .ant-btn { position: relative; line-height: 30px; } .ant-btn-group > .ant-btn:hover, +.ant-btn-group > span > .ant-btn:hover, .ant-btn-group > .ant-btn:focus, +.ant-btn-group > span > .ant-btn:focus, .ant-btn-group > .ant-btn:active, -.ant-btn-group > .ant-btn.active { +.ant-btn-group > span > .ant-btn:active, +.ant-btn-group > .ant-btn.active, +.ant-btn-group > span > .ant-btn.active { z-index: 2; } -.ant-btn-group > .ant-btn:disabled { +.ant-btn-group > .ant-btn:disabled, +.ant-btn-group > span > .ant-btn:disabled { z-index: 0; } -.ant-btn-group-lg > .ant-btn { +.ant-btn-group-lg > .ant-btn, +.ant-btn-group-lg > span > .ant-btn { padding: 0 15px; font-size: 16px; - border-radius: 4px; + border-radius: 0; height: 40px; line-height: 38px; } -.ant-btn-group-sm > .ant-btn { +.ant-btn-group-sm > .ant-btn, +.ant-btn-group-sm > span > .ant-btn { padding: 0 7px; font-size: 14px; - border-radius: 4px; + border-radius: 0; height: 24px; line-height: 22px; } -.ant-btn-group-sm > .ant-btn > .anticon { +.ant-btn-group-sm > .ant-btn > .anticon, +.ant-btn-group-sm > span > .ant-btn > .anticon { font-size: 14px; } .ant-btn-group .ant-btn + .ant-btn, @@ -3871,22 +3879,44 @@ mark { .ant-btn-group .ant-btn-primary + .ant-btn:not(.ant-btn-primary):not([disabled]) { border-left-color: transparent; } -.ant-btn-group .ant-btn:not(:first-child):not(:last-child) { +.ant-btn-group .ant-btn { border-radius: 0; } .ant-btn-group > .ant-btn:first-child, .ant-btn-group > span:first-child > .ant-btn { margin-left: 0; } +.ant-btn-group > .ant-btn:only-child { + border-radius: 4px; +} +.ant-btn-group > span:only-child > .ant-btn { + border-radius: 4px; +} .ant-btn-group > .ant-btn:first-child:not(:last-child), .ant-btn-group > span:first-child:not(:last-child) > .ant-btn { - border-bottom-right-radius: 0; - border-top-right-radius: 0; + border-bottom-left-radius: 4px; + border-top-left-radius: 4px; } .ant-btn-group > .ant-btn:last-child:not(:first-child), .ant-btn-group > span:last-child:not(:first-child) > .ant-btn { - border-bottom-left-radius: 0; - border-top-left-radius: 0; + border-bottom-right-radius: 4px; + border-top-right-radius: 4px; +} +.ant-btn-group-sm > .ant-btn:only-child { + border-radius: 4px; +} +.ant-btn-group-sm > span:only-child > .ant-btn { + border-radius: 4px; +} +.ant-btn-group-sm > .ant-btn:first-child:not(:last-child), +.ant-btn-group-sm > span:first-child:not(:last-child) > .ant-btn { + border-bottom-left-radius: 4px; + border-top-left-radius: 4px; +} +.ant-btn-group-sm > .ant-btn:last-child:not(:first-child), +.ant-btn-group-sm > span:last-child:not(:first-child) > .ant-btn { + border-bottom-right-radius: 4px; + border-top-right-radius: 4px; } .ant-btn-group > .ant-btn-group { float: left; @@ -4208,7 +4238,7 @@ a.ant-btn-sm { border: 1px solid #e8e8e8; } .ant-card-head { - background: #fff; + background: transparent; border-bottom: 1px solid #e8e8e8; padding: 0 24px; border-radius: 2px 2px 0 0; @@ -5016,6 +5046,9 @@ a.ant-btn-sm { -webkit-transition: opacity .3s; transition: opacity .3s; } +.ant-table-empty .ant-table-body { + overflow: auto !important; +} .ant-table table { width: 100%; border-collapse: separate; @@ -5205,10 +5238,10 @@ a.ant-btn-sm { } .ant-table-column-sorter-up, .ant-table-column-sorter-down { - line-height: 6px; display: block; width: 14px; height: 6px; + line-height: 6px; cursor: pointer; position: relative; } @@ -5887,6 +5920,21 @@ span.ant-radio + * { box-shadow: -1px 0 0 0 #096dd9; color: #096dd9; } +.ant-radio-group-solid .ant-radio-button-wrapper-checked:not(.ant-radio-button-wrapper-disabled) { + background: #1890ff; + border-color: #1890ff; + color: #fff; +} +.ant-radio-group-solid .ant-radio-button-wrapper-checked:not(.ant-radio-button-wrapper-disabled):hover { + border-color: #40a9ff; + background: #40a9ff; + color: #fff; +} +.ant-radio-group-solid .ant-radio-button-wrapper-checked:not(.ant-radio-button-wrapper-disabled):active { + border-color: #096dd9; + background: #096dd9; + color: #fff; +} .ant-radio-button-wrapper-disabled { border-color: #d9d9d9; background-color: #f5f5f5; @@ -6227,6 +6275,11 @@ span.ant-radio + * { transition: all .3s; line-height: 22px; } +.ant-dropdown-menu-item > .anticon:first-child, +.ant-dropdown-menu-submenu-title > .anticon:first-child { + min-width: 12px; + margin-right: 8px; +} .ant-dropdown-menu-item > a, .ant-dropdown-menu-submenu-title > a { color: rgba(0, 0, 0, 0.65); @@ -7026,6 +7079,7 @@ textarea.ant-pagination-options-quick-jumper input { list-style: none; display: inline-block; position: relative; + outline: 0; } .ant-select ul, .ant-select ol { @@ -7265,7 +7319,7 @@ textarea.ant-pagination-options-quick-jumper input { } .ant-select-search__field__mirror { position: absolute; - top: 0; + top: -9999px; left: -9999px; white-space: pre; pointer-events: none; @@ -7502,6 +7556,10 @@ textarea.ant-pagination-options-quick-jumper input { line-height: 32px; font-size: 12px; } +.ant-select-dropdown-menu-item-group-list .ant-select-dropdown-menu-item:first-child:not(:last-child), +.ant-select-dropdown-menu-item-group:not(:last-child) .ant-select-dropdown-menu-item-group-list .ant-select-dropdown-menu-item:last-child { + border-radius: 0; +} .ant-select-dropdown-menu-item { position: relative; display: block; diff --git a/api.js b/api.js index 9b873839ad066d737d1a0a7068ced7eac65dbb1d..a873438dc14b57a9b66f718d786b470b1710f565 100644 --- a/api.js +++ b/api.js @@ -24415,13 +24415,6 @@ function baseIsNative(value) { module.exports = baseIsNative; -/***/ }), - -/***/ "iHdM": -/***/ (function(module, exports, __webpack_require__) { - -module.exports = __webpack_require__("tEs8"); - /***/ }), /***/ "iS0Z": @@ -28090,7 +28083,9 @@ var Dialog_Dialog = function (_React$Component) { _this.onKeyDown = function (e) { var props = _this.props; if (props.keyboard && e.keyCode === es_KeyCode.ESC) { + e.stopPropagation(); _this.close(e); + return; } // keep focus inside dialog if (props.visible) { @@ -29136,12 +29131,12 @@ var Modal_Modal = function (_React$Component) { null, react["createElement"]( es_button, - { onClick: _this.handleCancel }, + extends_default()({ onClick: _this.handleCancel }, _this.props.cancelButtonProps), cancelText || locale.cancelText ), react["createElement"]( es_button, - { type: okType, loading: confirmLoading, onClick: _this.handleOk }, + extends_default()({ type: okType, loading: confirmLoading, onClick: _this.handleOk }, _this.props.okButtonProps), okText || locale.okText ) ); @@ -29198,7 +29193,9 @@ Modal_Modal.defaultProps = { maskTransitionName: 'fade', confirmLoading: false, visible: false, - okType: 'primary' + okType: 'primary', + okButtonDisabled: false, + cancelButtonDisabled: false }; Modal_Modal.propTypes = { prefixCls: prop_types_default.a.string, @@ -31367,7 +31364,7 @@ var card_Card = function (_React$Component) { es_tabs, extends_default()({}, extraProps, { className: prefixCls + "-head-tabs", size: "large", onChange: this.onTabChange }), tabList.map(function (item) { - return react["createElement"](es_tabs.TabPane, { tab: item.tab, key: item.key }); + return react["createElement"](es_tabs.TabPane, { tab: item.tab, disabled: item.disabled, key: item.key }); }) ) : null; if (title || extra || tabs) { @@ -31762,6 +31759,8 @@ function remove(array, item) { + + var ColumnManager_ColumnManager = function () { function ColumnManager(columns, elements) { classCallCheck_default()(this, ColumnManager); @@ -31771,174 +31770,189 @@ var ColumnManager_ColumnManager = function () { this.columns = columns || this.normalize(elements); } - ColumnManager.prototype.isAnyColumnsFixed = function isAnyColumnsFixed() { - var _this = this; + createClass_default()(ColumnManager, [{ + key: 'isAnyColumnsFixed', + value: function isAnyColumnsFixed() { + var _this = this; - return this._cache('isAnyColumnsFixed', function () { - return _this.columns.some(function (column) { - return !!column.fixed; + return this._cache('isAnyColumnsFixed', function () { + return _this.columns.some(function (column) { + return !!column.fixed; + }); }); - }); - }; - - ColumnManager.prototype.isAnyColumnsLeftFixed = function isAnyColumnsLeftFixed() { - var _this2 = this; + } + }, { + key: 'isAnyColumnsLeftFixed', + value: function isAnyColumnsLeftFixed() { + var _this2 = this; - return this._cache('isAnyColumnsLeftFixed', function () { - return _this2.columns.some(function (column) { - return column.fixed === 'left' || column.fixed === true; + return this._cache('isAnyColumnsLeftFixed', function () { + return _this2.columns.some(function (column) { + return column.fixed === 'left' || column.fixed === true; + }); }); - }); - }; - - ColumnManager.prototype.isAnyColumnsRightFixed = function isAnyColumnsRightFixed() { - var _this3 = this; + } + }, { + key: 'isAnyColumnsRightFixed', + value: function isAnyColumnsRightFixed() { + var _this3 = this; - return this._cache('isAnyColumnsRightFixed', function () { - return _this3.columns.some(function (column) { - return column.fixed === 'right'; + return this._cache('isAnyColumnsRightFixed', function () { + return _this3.columns.some(function (column) { + return column.fixed === 'right'; + }); }); - }); - }; - - ColumnManager.prototype.leftColumns = function leftColumns() { - var _this4 = this; + } + }, { + key: 'leftColumns', + value: function leftColumns() { + var _this4 = this; - return this._cache('leftColumns', function () { - return _this4.groupedColumns().filter(function (column) { - return column.fixed === 'left' || column.fixed === true; + return this._cache('leftColumns', function () { + return _this4.groupedColumns().filter(function (column) { + return column.fixed === 'left' || column.fixed === true; + }); }); - }); - }; - - ColumnManager.prototype.rightColumns = function rightColumns() { - var _this5 = this; + } + }, { + key: 'rightColumns', + value: function rightColumns() { + var _this5 = this; - return this._cache('rightColumns', function () { - return _this5.groupedColumns().filter(function (column) { - return column.fixed === 'right'; + return this._cache('rightColumns', function () { + return _this5.groupedColumns().filter(function (column) { + return column.fixed === 'right'; + }); }); - }); - }; - - ColumnManager.prototype.leafColumns = function leafColumns() { - var _this6 = this; - - return this._cache('leafColumns', function () { - return _this6._leafColumns(_this6.columns); - }); - }; - - ColumnManager.prototype.leftLeafColumns = function leftLeafColumns() { - var _this7 = this; - - return this._cache('leftLeafColumns', function () { - return _this7._leafColumns(_this7.leftColumns()); - }); - }; - - ColumnManager.prototype.rightLeafColumns = function rightLeafColumns() { - var _this8 = this; - - return this._cache('rightLeafColumns', function () { - return _this8._leafColumns(_this8.rightColumns()); - }); - }; + } + }, { + key: 'leafColumns', + value: function leafColumns() { + var _this6 = this; - // add appropriate rowspan and colspan to column + return this._cache('leafColumns', function () { + return _this6._leafColumns(_this6.columns); + }); + } + }, { + key: 'leftLeafColumns', + value: function leftLeafColumns() { + var _this7 = this; + return this._cache('leftLeafColumns', function () { + return _this7._leafColumns(_this7.leftColumns()); + }); + } + }, { + key: 'rightLeafColumns', + value: function rightLeafColumns() { + var _this8 = this; - ColumnManager.prototype.groupedColumns = function groupedColumns() { - var _this9 = this; + return this._cache('rightLeafColumns', function () { + return _this8._leafColumns(_this8.rightColumns()); + }); + } - return this._cache('groupedColumns', function () { - var _groupColumns = function _groupColumns(columns) { - var currentRow = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; - var parentColumn = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; - var rows = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : []; + // add appropriate rowspan and colspan to column - // track how many rows we got - rows[currentRow] = rows[currentRow] || []; - var grouped = []; - var setRowSpan = function setRowSpan(column) { - var rowSpan = rows.length - currentRow; - if (column && !column.children && // parent columns are supposed to be one row - rowSpan > 1 && (!column.rowSpan || column.rowSpan < rowSpan)) { - column.rowSpan = rowSpan; - } + }, { + key: 'groupedColumns', + value: function groupedColumns() { + var _this9 = this; + + return this._cache('groupedColumns', function () { + var _groupColumns = function _groupColumns(columns) { + var currentRow = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; + var parentColumn = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; + var rows = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : []; + + // track how many rows we got + rows[currentRow] = rows[currentRow] || []; + var grouped = []; + var setRowSpan = function setRowSpan(column) { + var rowSpan = rows.length - currentRow; + if (column && !column.children && // parent columns are supposed to be one row + rowSpan > 1 && (!column.rowSpan || column.rowSpan < rowSpan)) { + column.rowSpan = rowSpan; + } + }; + columns.forEach(function (column, index) { + var newColumn = extends_default()({}, column); + rows[currentRow].push(newColumn); + parentColumn.colSpan = parentColumn.colSpan || 0; + if (newColumn.children && newColumn.children.length > 0) { + newColumn.children = _groupColumns(newColumn.children, currentRow + 1, newColumn, rows); + parentColumn.colSpan += newColumn.colSpan; + } else { + parentColumn.colSpan++; + } + // update rowspan to all same row columns + for (var i = 0; i < rows[currentRow].length - 1; ++i) { + setRowSpan(rows[currentRow][i]); + } + // last column, update rowspan immediately + if (index + 1 === columns.length) { + setRowSpan(newColumn); + } + grouped.push(newColumn); + }); + return grouped; }; - columns.forEach(function (column, index) { - var newColumn = extends_default()({}, column); - rows[currentRow].push(newColumn); - parentColumn.colSpan = parentColumn.colSpan || 0; - if (newColumn.children && newColumn.children.length > 0) { - newColumn.children = _groupColumns(newColumn.children, currentRow + 1, newColumn, rows); - parentColumn.colSpan += newColumn.colSpan; - } else { - parentColumn.colSpan++; - } - // update rowspan to all same row columns - for (var i = 0; i < rows[currentRow].length - 1; ++i) { - setRowSpan(rows[currentRow][i]); - } - // last column, update rowspan immediately - if (index + 1 === columns.length) { - setRowSpan(newColumn); - } - grouped.push(newColumn); - }); - return grouped; - }; - return _groupColumns(_this9.columns); - }); - }; - - ColumnManager.prototype.normalize = function normalize(elements) { - var _this10 = this; + return _groupColumns(_this9.columns); + }); + } + }, { + key: 'normalize', + value: function normalize(elements) { + var _this10 = this; - var columns = []; - react_default.a.Children.forEach(elements, function (element) { - if (!react_default.a.isValidElement(element)) { - return; - } - var column = extends_default()({}, element.props); - if (element.key) { - column.key = element.key; - } - if (element.type.isTableColumnGroup) { - column.children = _this10.normalize(column.children); + var columns = []; + react_default.a.Children.forEach(elements, function (element) { + if (!react_default.a.isValidElement(element)) { + return; + } + var column = extends_default()({}, element.props); + if (element.key) { + column.key = element.key; + } + if (element.type.isTableColumnGroup) { + column.children = _this10.normalize(column.children); + } + columns.push(column); + }); + return columns; + } + }, { + key: 'reset', + value: function reset(columns, elements) { + this.columns = columns || this.normalize(elements); + this._cached = {}; + } + }, { + key: '_cache', + value: function _cache(name, fn) { + if (name in this._cached) { + return this._cached[name]; } - columns.push(column); - }); - return columns; - }; - - ColumnManager.prototype.reset = function reset(columns, elements) { - this.columns = columns || this.normalize(elements); - this._cached = {}; - }; - - ColumnManager.prototype._cache = function _cache(name, fn) { - if (name in this._cached) { + this._cached[name] = fn(); return this._cached[name]; } - this._cached[name] = fn(); - return this._cached[name]; - }; - - ColumnManager.prototype._leafColumns = function _leafColumns(columns) { - var _this11 = this; - - var leafColumns = []; - columns.forEach(function (column) { - if (!column.children) { - leafColumns.push(column); - } else { - leafColumns.push.apply(leafColumns, _this11._leafColumns(column.children)); - } - }); - return leafColumns; - }; + }, { + key: '_leafColumns', + value: function _leafColumns(columns) { + var _this11 = this; + + var leafColumns = []; + columns.forEach(function (column) { + if (!column.children) { + leafColumns.push(column); + } else { + leafColumns.push.apply(leafColumns, toConsumableArray_default()(_this11._leafColumns(column.children))); + } + }); + return leafColumns; + } + }]); return ColumnManager; }(); @@ -32166,6 +32180,7 @@ var get_default = /*#__PURE__*/__webpack_require__.n(get); + function isInvalidRenderCellText(text) { return text && !react_default.a.isValidElement(text) && Object.prototype.toString.call(text) === '[object Object]'; } @@ -32174,6 +32189,8 @@ var TableCell_TableCell = function (_React$Component) { inherits_default()(TableCell, _React$Component); function TableCell() { + var _ref; + var _temp, _this, _ret; classCallCheck_default()(this, TableCell); @@ -32182,7 +32199,7 @@ var TableCell_TableCell = function (_React$Component) { args[_key] = arguments[_key]; } - return _ret = (_temp = (_this = possibleConstructorReturn_default()(this, _React$Component.call.apply(_React$Component, [this].concat(args))), _this), _this.handleClick = function (e) { + return _ret = (_temp = (_this = possibleConstructorReturn_default()(this, (_ref = TableCell.__proto__ || Object.getPrototypeOf(TableCell)).call.apply(_ref, [this].concat(args))), _this), _this.handleClick = function (e) { var _this$props = _this.props, record = _this$props.record, onCellClick = _this$props.column.onCellClick; @@ -32193,76 +32210,79 @@ var TableCell_TableCell = function (_React$Component) { }, _temp), possibleConstructorReturn_default()(_this, _ret); } - TableCell.prototype.render = function render() { - var _props = this.props, - record = _props.record, - indentSize = _props.indentSize, - prefixCls = _props.prefixCls, - indent = _props.indent, - index = _props.index, - expandIcon = _props.expandIcon, - column = _props.column, - BodyCell = _props.component; - var dataIndex = column.dataIndex, - render = column.render, - _column$className = column.className, - className = _column$className === undefined ? '' : _column$className; - - // We should return undefined if no dataIndex is specified, but in order to - // be compatible with object-path's behavior, we return the record object instead. - - var text = void 0; - if (typeof dataIndex === 'number') { - text = get_default()(record, dataIndex); - } else if (!dataIndex || dataIndex.length === 0) { - text = record; - } else { - text = get_default()(record, dataIndex); - } - var tdProps = {}; - var colSpan = void 0; - var rowSpan = void 0; + createClass_default()(TableCell, [{ + key: 'render', + value: function render() { + var _props = this.props, + record = _props.record, + indentSize = _props.indentSize, + prefixCls = _props.prefixCls, + indent = _props.indent, + index = _props.index, + expandIcon = _props.expandIcon, + column = _props.column, + BodyCell = _props.component; + var dataIndex = column.dataIndex, + render = column.render, + _column$className = column.className, + className = _column$className === undefined ? '' : _column$className; + + // We should return undefined if no dataIndex is specified, but in order to + // be compatible with object-path's behavior, we return the record object instead. + + var text = void 0; + if (typeof dataIndex === 'number') { + text = get_default()(record, dataIndex); + } else if (!dataIndex || dataIndex.length === 0) { + text = record; + } else { + text = get_default()(record, dataIndex); + } + var tdProps = {}; + var colSpan = void 0; + var rowSpan = void 0; - if (render) { - text = render(text, record, index); - if (isInvalidRenderCellText(text)) { - tdProps = text.props || tdProps; - colSpan = tdProps.colSpan; - rowSpan = tdProps.rowSpan; - text = text.children; + if (render) { + text = render(text, record, index); + if (isInvalidRenderCellText(text)) { + tdProps = text.props || tdProps; + colSpan = tdProps.colSpan; + rowSpan = tdProps.rowSpan; + text = text.children; + } } - } - if (column.onCell) { - tdProps = extends_default()({}, tdProps, column.onCell(record)); - } + if (column.onCell) { + tdProps = extends_default()({}, tdProps, column.onCell(record)); + } - // Fix https://github.com/ant-design/ant-design/issues/1202 - if (isInvalidRenderCellText(text)) { - text = null; - } + // Fix https://github.com/ant-design/ant-design/issues/1202 + if (isInvalidRenderCellText(text)) { + text = null; + } - var indentText = expandIcon ? react_default.a.createElement('span', { - style: { paddingLeft: indentSize * indent + 'px' }, - className: prefixCls + '-indent indent-level-' + indent - }) : null; + var indentText = expandIcon ? react_default.a.createElement('span', { + style: { paddingLeft: indentSize * indent + 'px' }, + className: prefixCls + '-indent indent-level-' + indent + }) : null; - if (rowSpan === 0 || colSpan === 0) { - return null; - } + if (rowSpan === 0 || colSpan === 0) { + return null; + } - if (column.align) { - tdProps.style = extends_default()({}, tdProps.style, { textAlign: column.align }); - } + if (column.align) { + tdProps.style = extends_default()({}, tdProps.style, { textAlign: column.align }); + } - return react_default.a.createElement( - BodyCell, - extends_default()({ className: className, onClick: this.handleClick }, tdProps), - indentText, - expandIcon, - text - ); - }; + return react_default.a.createElement( + BodyCell, + extends_default()({ className: className, onClick: this.handleClick }, tdProps), + indentText, + expandIcon, + text + ); + } + }]); return TableCell; }(react_default.a.Component); @@ -32291,25 +32311,15 @@ TableCell_TableCell.propTypes = { + + var TableRow_TableRow = function (_React$Component) { inherits_default()(TableRow, _React$Component); - TableRow.getDerivedStateFromProps = function getDerivedStateFromProps(nextProps, prevState) { - if (prevState.visible || !prevState.visible && nextProps.visible) { - return { - shouldRender: true, - visible: nextProps.visible - }; - } - return { - visible: nextProps.visible - }; - }; - function TableRow(props) { classCallCheck_default()(this, TableRow); - var _this = possibleConstructorReturn_default()(this, _React$Component.call(this, props)); + var _this = possibleConstructorReturn_default()(this, (TableRow.__proto__ || Object.getPrototypeOf(TableRow)).call(this, props)); _this.onRowClick = function (event) { var _this$props = _this.props, @@ -32378,169 +32388,195 @@ var TableRow_TableRow = function (_React$Component) { return _this; } - TableRow.prototype.componentDidMount = function componentDidMount() { - if (this.state.shouldRender) { - this.saveRowRef(); + createClass_default()(TableRow, [{ + key: 'componentDidMount', + value: function componentDidMount() { + if (this.state.shouldRender) { + this.saveRowRef(); + } } - }; - - TableRow.prototype.shouldComponentUpdate = function shouldComponentUpdate(nextProps) { - return !!(this.props.visible || nextProps.visible); - }; - - TableRow.prototype.componentDidUpdate = function componentDidUpdate() { - if (this.state.shouldRender && !this.rowRef) { - this.saveRowRef(); + }, { + key: 'shouldComponentUpdate', + value: function shouldComponentUpdate(nextProps) { + return !!(this.props.visible || nextProps.visible); } - }; - - TableRow.prototype.setExpanedRowHeight = function setExpanedRowHeight() { - var _extends2; - - var _props = this.props, - store = _props.store, - rowKey = _props.rowKey; - - var _store$getState = store.getState(), - expandedRowsHeight = _store$getState.expandedRowsHeight; - - var height = this.rowRef.getBoundingClientRect().height; - expandedRowsHeight = extends_default()({}, expandedRowsHeight, (_extends2 = {}, _extends2[rowKey] = height, _extends2)); - store.setState({ expandedRowsHeight: expandedRowsHeight }); - }; + }, { + key: 'componentDidUpdate', + value: function componentDidUpdate() { + if (this.state.shouldRender && !this.rowRef) { + this.saveRowRef(); + } + } + }, { + key: 'setExpanedRowHeight', + value: function setExpanedRowHeight() { + var _props = this.props, + store = _props.store, + rowKey = _props.rowKey; - TableRow.prototype.setRowHeight = function setRowHeight() { - var _props2 = this.props, - store = _props2.store, - index = _props2.index; + var _store$getState = store.getState(), + expandedRowsHeight = _store$getState.expandedRowsHeight; - var fixedColumnsBodyRowsHeight = store.getState().fixedColumnsBodyRowsHeight.slice(); - var height = this.rowRef.getBoundingClientRect().height; - fixedColumnsBodyRowsHeight[index] = height; - store.setState({ fixedColumnsBodyRowsHeight: fixedColumnsBodyRowsHeight }); - }; + var height = this.rowRef.getBoundingClientRect().height; + expandedRowsHeight = extends_default()({}, expandedRowsHeight, defineProperty_default()({}, rowKey, height)); + store.setState({ expandedRowsHeight: expandedRowsHeight }); + } + }, { + key: 'setRowHeight', + value: function setRowHeight() { + var _props2 = this.props, + store = _props2.store, + rowKey = _props2.rowKey; + + var _store$getState2 = store.getState(), + fixedColumnsBodyRowsHeight = _store$getState2.fixedColumnsBodyRowsHeight; + + var height = this.rowRef.getBoundingClientRect().height; + store.setState({ + fixedColumnsBodyRowsHeight: extends_default()({}, fixedColumnsBodyRowsHeight, defineProperty_default()({}, rowKey, height)) + }); + } + }, { + key: 'getStyle', + value: function getStyle() { + var _props3 = this.props, + height = _props3.height, + visible = _props3.visible; - TableRow.prototype.getStyle = function getStyle() { - var _props3 = this.props, - height = _props3.height, - visible = _props3.visible; + if (height && height !== this.style.height) { + this.style = extends_default()({}, this.style, { height: height }); + } - if (height && height !== this.style.height) { - this.style = extends_default()({}, this.style, { height: height }); - } + if (!visible && !this.style.display) { + this.style = extends_default()({}, this.style, { display: 'none' }); + } - if (!visible && !this.style.display) { - this.style = extends_default()({}, this.style, { display: 'none' }); + return this.style; } + }, { + key: 'saveRowRef', + value: function saveRowRef() { + this.rowRef = react_dom_default.a.findDOMNode(this); - return this.style; - }; - - TableRow.prototype.saveRowRef = function saveRowRef() { - this.rowRef = react_dom_default.a.findDOMNode(this); + var _props4 = this.props, + isAnyColumnsFixed = _props4.isAnyColumnsFixed, + fixed = _props4.fixed, + expandedRow = _props4.expandedRow, + ancestorKeys = _props4.ancestorKeys; - var _props4 = this.props, - isAnyColumnsFixed = _props4.isAnyColumnsFixed, - fixed = _props4.fixed, - expandedRow = _props4.expandedRow, - ancestorKeys = _props4.ancestorKeys; + if (!isAnyColumnsFixed) { + return; + } - if (!isAnyColumnsFixed) { - return; - } + if (!fixed && expandedRow) { + this.setExpanedRowHeight(); + } - if (!fixed && expandedRow) { - this.setExpanedRowHeight(); + if (!fixed && ancestorKeys.length >= 0) { + this.setRowHeight(); + } } + }, { + key: 'render', + value: function render() { + if (!this.state.shouldRender) { + return null; + } - if (!fixed && ancestorKeys.length >= 0) { - this.setRowHeight(); - } - }; + var _props5 = this.props, + prefixCls = _props5.prefixCls, + columns = _props5.columns, + record = _props5.record, + rowKey = _props5.rowKey, + index = _props5.index, + onRow = _props5.onRow, + indent = _props5.indent, + indentSize = _props5.indentSize, + hovered = _props5.hovered, + height = _props5.height, + visible = _props5.visible, + components = _props5.components, + hasExpandIcon = _props5.hasExpandIcon, + renderExpandIcon = _props5.renderExpandIcon, + renderExpandIconCell = _props5.renderExpandIconCell; - TableRow.prototype.render = function render() { - if (!this.state.shouldRender) { - return null; - } - var _props5 = this.props, - prefixCls = _props5.prefixCls, - columns = _props5.columns, - record = _props5.record, - index = _props5.index, - onRow = _props5.onRow, - indent = _props5.indent, - indentSize = _props5.indentSize, - hovered = _props5.hovered, - height = _props5.height, - visible = _props5.visible, - components = _props5.components, - hasExpandIcon = _props5.hasExpandIcon, - renderExpandIcon = _props5.renderExpandIcon, - renderExpandIconCell = _props5.renderExpandIconCell; + var BodyRow = components.body.row; + var BodyCell = components.body.cell; + var className = this.props.className; - var BodyRow = components.body.row; - var BodyCell = components.body.cell; - var className = this.props.className; + if (hovered) { + className += ' ' + prefixCls + '-hover'; + } + var cells = []; - if (hovered) { - className += ' ' + prefixCls + '-hover'; - } + renderExpandIconCell(cells); - var cells = []; + for (var i = 0; i < columns.length; i++) { + var column = columns[i]; - renderExpandIconCell(cells); + warningOnce(column.onCellClick === undefined, 'column[onCellClick] is deprecated, please use column[onCell] instead.'); - for (var i = 0; i < columns.length; i++) { - var column = columns[i]; + cells.push(react_default.a.createElement(es_TableCell, { + prefixCls: prefixCls, + record: record, + indentSize: indentSize, + indent: indent, + index: index, + column: column, + key: column.key || column.dataIndex, + expandIcon: hasExpandIcon(i) && renderExpandIcon(), + component: BodyCell + })); + } - warningOnce(column.onCellClick === undefined, 'column[onCellClick] is deprecated, please use column[onCell] instead.'); + var rowClassName = (prefixCls + ' ' + className + ' ' + prefixCls + '-level-' + indent).trim(); - cells.push(react_default.a.createElement(es_TableCell, { - prefixCls: prefixCls, - record: record, - indentSize: indentSize, - indent: indent, - index: index, - column: column, - key: column.key || column.dataIndex, - expandIcon: hasExpandIcon(i) && renderExpandIcon(), - component: BodyCell - })); - } + var rowProps = onRow(record, index); + var customStyle = rowProps ? rowProps.style : {}; + var style = { height: height }; - var rowClassName = (prefixCls + ' ' + className + ' ' + prefixCls + '-level-' + indent).trim(); + if (!visible) { + style.display = 'none'; + } - var rowProps = onRow(record, index); - var customStyle = rowProps ? rowProps.style : {}; - var style = { height: height }; + style = extends_default()({}, style, customStyle); - if (!visible) { - style.display = 'none'; + return react_default.a.createElement( + BodyRow, + extends_default()({ + onClick: this.onRowClick, + onDoubleClick: this.onRowDoubleClick, + onMouseEnter: this.onMouseEnter, + onMouseLeave: this.onMouseLeave, + onContextMenu: this.onContextMenu, + className: rowClassName + }, rowProps, { + style: style, + 'data-row-key': rowKey + }), + cells + ); } - - style = extends_default()({}, style, customStyle); - - return react_default.a.createElement( - BodyRow, - extends_default()({ - onClick: this.onRowClick, - onDoubleClick: this.onRowDoubleClick, - onMouseEnter: this.onMouseEnter, - onMouseLeave: this.onMouseLeave, - onContextMenu: this.onContextMenu, - className: rowClassName - }, rowProps, { - style: style - }), - cells - ); - }; + }], [{ + key: 'getDerivedStateFromProps', + value: function getDerivedStateFromProps(nextProps, prevState) { + if (prevState.visible || !prevState.visible && nextProps.visible) { + return { + shouldRender: true, + visible: nextProps.visible + }; + } + return { + visible: nextProps.visible + }; + } + }]); return TableRow; }(react_default.a.Component); @@ -32587,7 +32623,6 @@ function TableRow_getRowHeight(state, props) { var expandedRowsHeight = state.expandedRowsHeight, fixedColumnsBodyRowsHeight = state.fixedColumnsBodyRowsHeight; var fixed = props.fixed, - index = props.index, rowKey = props.rowKey; @@ -32599,8 +32634,8 @@ function TableRow_getRowHeight(state, props) { return expandedRowsHeight[rowKey]; } - if (fixedColumnsBodyRowsHeight[index]) { - return fixedColumnsBodyRowsHeight[index]; + if (fixedColumnsBodyRowsHeight[rowKey]) { + return fixedColumnsBodyRowsHeight[rowKey]; } return null; @@ -32632,41 +32667,46 @@ polyfill(TableRow_TableRow); + var ExpandIcon_ExpandIcon = function (_React$Component) { inherits_default()(ExpandIcon, _React$Component); function ExpandIcon() { classCallCheck_default()(this, ExpandIcon); - return possibleConstructorReturn_default()(this, _React$Component.apply(this, arguments)); + return possibleConstructorReturn_default()(this, (ExpandIcon.__proto__ || Object.getPrototypeOf(ExpandIcon)).apply(this, arguments)); } - ExpandIcon.prototype.shouldComponentUpdate = function shouldComponentUpdate(nextProps) { - return !shallowequal_default()(nextProps, this.props); - }; - - ExpandIcon.prototype.render = function render() { - var _props = this.props, - expandable = _props.expandable, - prefixCls = _props.prefixCls, - onExpand = _props.onExpand, - needIndentSpaced = _props.needIndentSpaced, - expanded = _props.expanded, - record = _props.record; - - if (expandable) { - var expandClassName = expanded ? 'expanded' : 'collapsed'; - return react_default.a.createElement('span', { - className: prefixCls + '-expand-icon ' + prefixCls + '-' + expandClassName, - onClick: function onClick(e) { - return onExpand(record, e); - } - }); - } else if (needIndentSpaced) { - return react_default.a.createElement('span', { className: prefixCls + '-expand-icon ' + prefixCls + '-spaced' }); + createClass_default()(ExpandIcon, [{ + key: 'shouldComponentUpdate', + value: function shouldComponentUpdate(nextProps) { + return !shallowequal_default()(nextProps, this.props); } - return null; - }; + }, { + key: 'render', + value: function render() { + var _props = this.props, + expandable = _props.expandable, + prefixCls = _props.prefixCls, + onExpand = _props.onExpand, + needIndentSpaced = _props.needIndentSpaced, + expanded = _props.expanded, + record = _props.record; + + if (expandable) { + var expandClassName = expanded ? 'expanded' : 'collapsed'; + return react_default.a.createElement('span', { + className: prefixCls + '-expand-icon ' + prefixCls + '-' + expandClassName, + onClick: function onClick(e) { + return onExpand(record, e); + } + }); + } else if (needIndentSpaced) { + return react_default.a.createElement('span', { className: prefixCls + '-expand-icon ' + prefixCls + '-spaced' }); + } + return null; + } + }]); return ExpandIcon; }(react_default.a.Component); @@ -32689,10 +32729,13 @@ ExpandIcon_ExpandIcon.propTypes = { + var ExpandableRow_ExpandableRow = function (_React$Component) { inherits_default()(ExpandableRow, _React$Component); function ExpandableRow() { + var _ref; + var _temp, _this, _ret; classCallCheck_default()(this, ExpandableRow); @@ -32701,7 +32744,7 @@ var ExpandableRow_ExpandableRow = function (_React$Component) { args[_key] = arguments[_key]; } - return _ret = (_temp = (_this = possibleConstructorReturn_default()(this, _React$Component.call.apply(_React$Component, [this].concat(args))), _this), _this.hasExpandIcon = function (columnIndex) { + return _ret = (_temp = (_this = possibleConstructorReturn_default()(this, (_ref = ExpandableRow.__proto__ || Object.getPrototypeOf(ExpandableRow)).call.apply(_ref, [this].concat(args))), _this), _this.hasExpandIcon = function (columnIndex) { var expandRowByClick = _this.props.expandRowByClick; return !_this.expandIconAsCell && !expandRowByClick && columnIndex === _this.expandIconColumnIndex; @@ -32756,45 +32799,50 @@ var ExpandableRow_ExpandableRow = function (_React$Component) { }, _temp), possibleConstructorReturn_default()(_this, _ret); } - ExpandableRow.prototype.componentWillUnmount = function componentWillUnmount() { - this.handleDestroy(); - }; - - ExpandableRow.prototype.handleDestroy = function handleDestroy() { - var _props = this.props, - onExpandedChange = _props.onExpandedChange, - rowKey = _props.rowKey, - record = _props.record; + createClass_default()(ExpandableRow, [{ + key: 'componentWillUnmount', + value: function componentWillUnmount() { + this.handleDestroy(); + } + }, { + key: 'handleDestroy', + value: function handleDestroy() { + var _props = this.props, + onExpandedChange = _props.onExpandedChange, + rowKey = _props.rowKey, + record = _props.record; - if (this.expandable) { - onExpandedChange(false, record, null, rowKey, true); + if (this.expandable) { + onExpandedChange(false, record, null, rowKey, true); + } } - }; + }, { + key: 'render', + value: function render() { + var _props2 = this.props, + childrenColumnName = _props2.childrenColumnName, + expandedRowRender = _props2.expandedRowRender, + indentSize = _props2.indentSize, + record = _props2.record, + fixed = _props2.fixed; - ExpandableRow.prototype.render = function render() { - var _props2 = this.props, - childrenColumnName = _props2.childrenColumnName, - expandedRowRender = _props2.expandedRowRender, - indentSize = _props2.indentSize, - record = _props2.record, - fixed = _props2.fixed; + this.expandIconAsCell = fixed !== 'right' ? this.props.expandIconAsCell : false; + this.expandIconColumnIndex = fixed !== 'right' ? this.props.expandIconColumnIndex : -1; + var childrenData = record[childrenColumnName]; + this.expandable = !!(childrenData || expandedRowRender); - this.expandIconAsCell = fixed !== 'right' ? this.props.expandIconAsCell : false; - this.expandIconColumnIndex = fixed !== 'right' ? this.props.expandIconColumnIndex : -1; - var childrenData = record[childrenColumnName]; - this.expandable = !!(childrenData || expandedRowRender); - - var expandableRowProps = { - indentSize: indentSize, - onRowClick: this.handleRowClick, - hasExpandIcon: this.hasExpandIcon, - renderExpandIcon: this.renderExpandIcon, - renderExpandIconCell: this.renderExpandIconCell - }; + var expandableRowProps = { + indentSize: indentSize, + onRowClick: this.handleRowClick, + hasExpandIcon: this.hasExpandIcon, + renderExpandIcon: this.renderExpandIcon, + renderExpandIconCell: this.renderExpandIconCell + }; - return this.props.children(expandableRowProps); - }; + return this.props.children(expandableRowProps); + } + }]); return ExpandableRow; }(react_default.a.Component); @@ -32818,9 +32866,9 @@ ExpandableRow_ExpandableRow.propTypes = { }; -/* harmony default export */ var es_ExpandableRow = (Object(mini_store_lib["connect"])(function (_ref, _ref2) { - var expandedRowKeys = _ref.expandedRowKeys; - var rowKey = _ref2.rowKey; +/* harmony default export */ var es_ExpandableRow = (Object(mini_store_lib["connect"])(function (_ref2, _ref3) { + var expandedRowKeys = _ref2.expandedRowKeys; + var rowKey = _ref3.rowKey; return { expanded: !!~expandedRowKeys.indexOf(rowKey) }; @@ -32838,10 +32886,14 @@ ExpandableRow_ExpandableRow.propTypes = { + + var BaseTable_BaseTable = function (_React$Component) { inherits_default()(BaseTable, _React$Component); function BaseTable() { + var _ref; + var _temp, _this, _ret; classCallCheck_default()(this, BaseTable); @@ -32850,12 +32902,13 @@ var BaseTable_BaseTable = function (_React$Component) { args[_key] = arguments[_key]; } - return _ret = (_temp = (_this = possibleConstructorReturn_default()(this, _React$Component.call.apply(_React$Component, [this].concat(args))), _this), _this.handleRowHover = function (isHover, key) { + return _ret = (_temp = (_this = possibleConstructorReturn_default()(this, (_ref = BaseTable.__proto__ || Object.getPrototypeOf(BaseTable)).call.apply(_ref, [this].concat(args))), _this), _this.handleRowHover = function (isHover, key) { _this.props.store.setState({ currentHoverKey: isHover ? key : null }); }, _this.renderRows = function (renderData, indent) { - var ancestorKeys = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : []; + var rows = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : []; + var ancestorKeys = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : []; var table = _this.context.table; var columnManager = table.columnManager, components = table.components; @@ -32876,9 +32929,6 @@ var BaseTable_BaseTable = function (_React$Component) { expander = _this$props.expander, isAnyColumnsFixed = _this$props.isAnyColumnsFixed; - - var rows = []; - var _loop = function _loop(i) { var record = renderData[i]; var key = getRowKey(record, i); @@ -32895,16 +32945,19 @@ var BaseTable_BaseTable = function (_React$Component) { } else if (fixed === 'right') { leafColumns = columnManager.rightLeafColumns(); } else { - leafColumns = columnManager.leafColumns(); + leafColumns = _this.getColumns(columnManager.leafColumns()); } var rowPrefixCls = prefixCls + '-row'; + var rowIndex = rows.filter(function (row) { + return !row.props.expandedRow; + }).length; var row = react_default.a.createElement( es_ExpandableRow, extends_default()({}, expander.props, { fixed: fixed, - index: i, + index: rowIndex, prefixCls: rowPrefixCls, record: record, key: key, @@ -32920,7 +32973,7 @@ var BaseTable_BaseTable = function (_React$Component) { indent: indent, className: className, record: record, - index: i, + index: rowIndex, prefixCls: rowPrefixCls, childrenColumnName: childrenColumnName, columns: leafColumns, @@ -32952,56 +33005,76 @@ var BaseTable_BaseTable = function (_React$Component) { }, _temp), possibleConstructorReturn_default()(_this, _ret); } - BaseTable.prototype.render = function render() { - var table = this.context.table; - var components = table.components; - var _table$props2 = table.props, - prefixCls = _table$props2.prefixCls, - scroll = _table$props2.scroll, - data = _table$props2.data, - getBodyWrapper = _table$props2.getBodyWrapper; - var _props = this.props, - expander = _props.expander, - tableClassName = _props.tableClassName, - hasHead = _props.hasHead, - hasBody = _props.hasBody, - fixed = _props.fixed, - columns = _props.columns; - - var tableStyle = {}; - - if (!fixed && scroll.x) { - // not set width, then use content fixed width - if (scroll.x === true) { - tableStyle.tableLayout = 'fixed'; - } else { - tableStyle.width = scroll.x; - } + createClass_default()(BaseTable, [{ + key: 'getColumns', + value: function getColumns(cols) { + var _props = this.props, + _props$columns = _props.columns, + columns = _props$columns === undefined ? [] : _props$columns, + fixed = _props.fixed; + var table = this.context.table; + var prefixCls = table.props.prefixCls; + + return (cols || columns).map(function (column) { + return extends_default()({}, column, { + className: !!column.fixed && !fixed ? classnames_default()(prefixCls + '-fixed-columns-in-body', column.className) : column.className + }); + }); } + }, { + key: 'render', + value: function render() { + var table = this.context.table; + var components = table.components; + var _table$props2 = table.props, + prefixCls = _table$props2.prefixCls, + scroll = _table$props2.scroll, + data = _table$props2.data, + getBodyWrapper = _table$props2.getBodyWrapper; + var _props2 = this.props, + expander = _props2.expander, + tableClassName = _props2.tableClassName, + hasHead = _props2.hasHead, + hasBody = _props2.hasBody, + fixed = _props2.fixed; + + var tableStyle = {}; + + if (!fixed && scroll.x) { + // not set width, then use content fixed width + if (scroll.x === true) { + tableStyle.tableLayout = 'fixed'; + } else { + tableStyle.width = scroll.x; + } + } - var Table = hasBody ? components.table : 'table'; - var BodyWrapper = components.body.wrapper; + var Table = hasBody ? components.table : 'table'; + var BodyWrapper = components.body.wrapper; - var body = void 0; - if (hasBody) { - body = react_default.a.createElement( - BodyWrapper, - { className: prefixCls + '-tbody' }, - this.renderRows(data, 0) - ); - if (getBodyWrapper) { - body = getBodyWrapper(body); + var body = void 0; + if (hasBody) { + body = react_default.a.createElement( + BodyWrapper, + { className: prefixCls + '-tbody' }, + this.renderRows(data, 0) + ); + if (getBodyWrapper) { + body = getBodyWrapper(body); + } } - } - return react_default.a.createElement( - Table, - { className: tableClassName, style: tableStyle, key: 'table' }, - react_default.a.createElement(ColGroup, { columns: columns, fixed: fixed }), - hasHead && react_default.a.createElement(TableHeader, { expander: expander, columns: columns, fixed: fixed }), - body - ); - }; + var columns = this.getColumns(); + + return react_default.a.createElement( + Table, + { className: tableClassName, style: tableStyle, key: 'table' }, + react_default.a.createElement(ColGroup, { columns: columns, fixed: fixed }), + hasHead && react_default.a.createElement(TableHeader, { expander: expander, columns: columns, fixed: fixed }), + body + ); + } + }]); return BaseTable; }(react_default.a.Component); @@ -33220,13 +33293,15 @@ BodyTable.contextTypes = { + + var ExpandableTable_ExpandableTable = function (_React$Component) { inherits_default()(ExpandableTable, _React$Component); function ExpandableTable(props) { classCallCheck_default()(this, ExpandableTable); - var _this = possibleConstructorReturn_default()(this, _React$Component.call(this, props)); + var _this = possibleConstructorReturn_default()(this, (ExpandableTable.__proto__ || Object.getPrototypeOf(ExpandableTable)).call(this, props)); ExpandableTable__initialiseProps.call(_this); @@ -33239,7 +33314,7 @@ var ExpandableTable_ExpandableTable = function (_React$Component) { var finnalExpandedRowKeys = []; - var rows = [].concat(data); + var rows = [].concat(toConsumableArray_default()(data)); if (defaultExpandAllRows) { for (var i = 0; i < rows.length; i++) { @@ -33261,89 +33336,100 @@ var ExpandableTable_ExpandableTable = function (_React$Component) { return _this; } - ExpandableTable.prototype.componentDidUpdate = function componentDidUpdate() { - if ('expandedRowKeys' in this.props) { - this.store.setState({ - expandedRowKeys: this.props.expandedRowKeys - }); + createClass_default()(ExpandableTable, [{ + key: 'componentDidUpdate', + value: function componentDidUpdate() { + if ('expandedRowKeys' in this.props) { + this.store.setState({ + expandedRowKeys: this.props.expandedRowKeys + }); + } } - }; + }, { + key: 'renderExpandedRow', + value: function renderExpandedRow(record, index, _render, className, ancestorKeys, indent, fixed) { + var _this2 = this; - ExpandableTable.prototype.renderExpandedRow = function renderExpandedRow(record, index, _render, className, ancestorKeys, indent, fixed) { - var _props = this.props, - prefixCls = _props.prefixCls, - expandIconAsCell = _props.expandIconAsCell, - indentSize = _props.indentSize; - - var colCount = void 0; - if (fixed === 'left') { - colCount = this.columnManager.leftLeafColumns().length; - } else if (fixed === 'right') { - colCount = this.columnManager.rightLeafColumns().length; - } else { - colCount = this.columnManager.leafColumns().length; - } - var columns = [{ - key: 'extra-row', - render: function render() { - return { - props: { - colSpan: colCount - }, - children: fixed !== 'right' ? _render(record, index, indent) : ' ' - }; + var _props = this.props, + prefixCls = _props.prefixCls, + expandIconAsCell = _props.expandIconAsCell, + indentSize = _props.indentSize; + + var parentKey = ancestorKeys[ancestorKeys.length - 1]; + var rowKey = parentKey + '-extra-row'; + var components = { + body: { + row: 'tr', + cell: 'td' + } + }; + var colCount = void 0; + if (fixed === 'left') { + colCount = this.columnManager.leftLeafColumns().length; + } else if (fixed === 'right') { + colCount = this.columnManager.rightLeafColumns().length; + } else { + colCount = this.columnManager.leafColumns().length; } - }]; - if (expandIconAsCell && fixed !== 'right') { - columns.unshift({ - key: 'expand-icon-placeholder', + var columns = [{ + key: 'extra-row', render: function render() { - return null; + var _store$getState = _this2.store.getState(), + expandedRowKeys = _store$getState.expandedRowKeys; + + var expanded = !!~expandedRowKeys.indexOf(parentKey); + return { + props: { + colSpan: colCount + }, + children: fixed !== 'right' ? _render(record, index, indent, expanded) : ' ' + }; } - }); - } - var parentKey = ancestorKeys[ancestorKeys.length - 1]; - var rowKey = parentKey + '-extra-row'; - var components = { - body: { - row: 'tr', - cell: 'td' + }]; + if (expandIconAsCell && fixed !== 'right') { + columns.unshift({ + key: 'expand-icon-placeholder', + render: function render() { + return null; + } + }); } - }; - - return react_default.a.createElement(es_TableRow, { - key: rowKey, - columns: columns, - className: className, - rowKey: rowKey, - ancestorKeys: ancestorKeys, - prefixCls: prefixCls + '-expanded-row', - indentSize: indentSize, - indent: indent, - fixed: fixed, - components: components, - expandedRow: true - }); - }; - ExpandableTable.prototype.render = function render() { - var _props2 = this.props, - data = _props2.data, - childrenColumnName = _props2.childrenColumnName, - children = _props2.children; + return react_default.a.createElement(es_TableRow, { + key: rowKey, + columns: columns, + className: className, + rowKey: rowKey, + ancestorKeys: ancestorKeys, + prefixCls: prefixCls + '-expanded-row', + indentSize: indentSize, + indent: indent, + fixed: fixed, + components: components, + expandedRow: true + }); + } + }, { + key: 'render', + value: function render() { + var _props2 = this.props, + data = _props2.data, + childrenColumnName = _props2.childrenColumnName, + children = _props2.children; - var needIndentSpaced = data.some(function (record) { - return record[childrenColumnName]; - }); + var needIndentSpaced = data.some(function (record) { + return record[childrenColumnName]; + }); - return children({ - props: this.props, - needIndentSpaced: needIndentSpaced, - renderRows: this.renderRows, - handleExpandChange: this.handleExpandChange, - renderExpandIndentCell: this.renderExpandIndentCell - }); - }; + return children({ + props: this.props, + needIndentSpaced: needIndentSpaced, + renderRows: this.renderRows, + handleExpandChange: this.handleExpandChange, + renderExpandIndentCell: this.renderExpandIndentCell + }); + } + }]); return ExpandableTable; }(react_default.a.Component); @@ -33382,7 +33468,7 @@ ExpandableTable_ExpandableTable.defaultProps = { }; var ExpandableTable__initialiseProps = function _initialiseProps() { - var _this2 = this; + var _this3 = this; this.handleExpandChange = function (expanded, record, event, rowKey) { var destroy = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false; @@ -33392,16 +33478,16 @@ var ExpandableTable__initialiseProps = function _initialiseProps() { event.stopPropagation(); } - var _props3 = _this2.props, + var _props3 = _this3.props, onExpandedRowsChange = _props3.onExpandedRowsChange, onExpand = _props3.onExpand; - var _store$getState = _this2.store.getState(), - expandedRowKeys = _store$getState.expandedRowKeys; + var _store$getState2 = _this3.store.getState(), + expandedRowKeys = _store$getState2.expandedRowKeys; if (expanded) { // row was expaned - expandedRowKeys = [].concat(expandedRowKeys, [rowKey]); + expandedRowKeys = [].concat(toConsumableArray_default()(expandedRowKeys), [rowKey]); } else { // row was collapse var expandedRowIndex = expandedRowKeys.indexOf(rowKey); @@ -33410,8 +33496,8 @@ var ExpandableTable__initialiseProps = function _initialiseProps() { } } - if (!_this2.props.expandedRowKeys) { - _this2.store.setState({ expandedRowKeys: expandedRowKeys }); + if (!_this3.props.expandedRowKeys) { + _this3.store.setState({ expandedRowKeys: expandedRowKeys }); } onExpandedRowsChange(expandedRowKeys); @@ -33421,7 +33507,7 @@ var ExpandableTable__initialiseProps = function _initialiseProps() { }; this.renderExpandIndentCell = function (rows, fixed) { - var _props4 = _this2.props, + var _props4 = _this3.props, prefixCls = _props4.prefixCls, expandIconAsCell = _props4.expandIconAsCell; @@ -33440,21 +33526,21 @@ var ExpandableTable__initialiseProps = function _initialiseProps() { }; this.renderRows = function (renderRows, rows, record, index, indent, fixed, parentKey, ancestorKeys) { - var _props5 = _this2.props, + var _props5 = _this3.props, expandedRowClassName = _props5.expandedRowClassName, expandedRowRender = _props5.expandedRowRender, childrenColumnName = _props5.childrenColumnName; var childrenData = record[childrenColumnName]; - var nextAncestorKeys = [].concat(ancestorKeys, [parentKey]); + var nextAncestorKeys = [].concat(toConsumableArray_default()(ancestorKeys), [parentKey]); var nextIndent = indent + 1; if (expandedRowRender) { - rows.push(_this2.renderExpandedRow(record, index, expandedRowRender, expandedRowClassName(record, index, indent), nextAncestorKeys, nextIndent, fixed)); + rows.push(_this3.renderExpandedRow(record, index, expandedRowRender, expandedRowClassName(record, index, indent), nextAncestorKeys, nextIndent, fixed)); } if (childrenData) { - rows.push.apply(rows, renderRows(childrenData, nextIndent, nextAncestorKeys)); + renderRows(childrenData, nextIndent, rows, nextAncestorKeys); } }; }; @@ -33481,28 +33567,14 @@ polyfill(ExpandableTable_ExpandableTable); + var Table_Table = function (_React$Component) { inherits_default()(Table, _React$Component); - Table.getDerivedStateFromProps = function getDerivedStateFromProps(nextProps, prevState) { - if (nextProps.columns && nextProps.columns !== prevState.columns) { - return { - columns: nextProps.columns, - children: null - }; - } else if (nextProps.children !== prevState.children) { - return { - columns: null, - children: nextProps.children - }; - } - return null; - }; - function Table(props) { classCallCheck_default()(this, Table); - var _this = possibleConstructorReturn_default()(this, _React$Component.call(this, props)); + var _this = possibleConstructorReturn_default()(this, (Table.__proto__ || Object.getPrototypeOf(Table)).call(this, props)); _this.state = {}; @@ -33532,10 +33604,13 @@ var Table_Table = function (_React$Component) { var fixedColumnsHeadRowsHeight = [].map.call(headRows, function (row) { return row.getBoundingClientRect().height || 'auto'; }); - var fixedColumnsBodyRowsHeight = [].map.call(bodyRows, function (row) { - return row.getBoundingClientRect().height || 'auto'; - }); var state = _this.store.getState(); + var fixedColumnsBodyRowsHeight = [].reduce.call(bodyRows, function (acc, row) { + var rowKey = row.getAttribute('data-row-key'); + var height = row.getBoundingClientRect().height || state.fixedColumnsBodyRowsHeight[rowKey] || 'auto'; + acc[rowKey] = height; + return acc; + }, {}); if (shallowequal_default()(state.fixedColumnsHeadRowsHeight, fixedColumnsHeadRowsHeight) && shallowequal_default()(state.fixedColumnsBodyRowsHeight, fixedColumnsBodyRowsHeight)) { return; } @@ -33652,7 +33727,7 @@ var Table_Table = function (_React$Component) { _this.store = Object(mini_store_lib["create"])({ currentHoverKey: null, fixedColumnsHeadRowsHeight: [], - fixedColumnsBodyRowsHeight: [] + fixedColumnsBodyRowsHeight: {} }); _this.setScrollPosition('left'); @@ -33661,282 +33736,316 @@ var Table_Table = function (_React$Component) { return _this; } - Table.prototype.getChildContext = function getChildContext() { - return { - table: { - props: this.props, - columnManager: this.columnManager, - saveRef: this.saveRef, - components: merge_default()({ - table: 'table', - header: { - wrapper: 'thead', - row: 'tr', - cell: 'th' - }, - body: { - wrapper: 'tbody', - row: 'tr', - cell: 'td' - } - }, this.props.components) - } - }; - }; - - Table.prototype.componentDidMount = function componentDidMount() { - if (this.columnManager.isAnyColumnsFixed()) { - this.handleWindowResize(); - this.resizeEvent = addEventListenerWrap(window, 'resize', this.debouncedWindowResize); + createClass_default()(Table, [{ + key: 'getChildContext', + value: function getChildContext() { + return { + table: { + props: this.props, + columnManager: this.columnManager, + saveRef: this.saveRef, + components: merge_default()({ + table: 'table', + header: { + wrapper: 'thead', + row: 'tr', + cell: 'th' + }, + body: { + wrapper: 'tbody', + row: 'tr', + cell: 'td' + } + }, this.props.components) + } + }; } - }; - - Table.prototype.componentDidUpdate = function componentDidUpdate(prevProps) { - if (this.columnManager.isAnyColumnsFixed()) { - this.handleWindowResize(); - if (!this.resizeEvent) { + }, { + key: 'componentDidMount', + value: function componentDidMount() { + if (this.columnManager.isAnyColumnsFixed()) { + this.handleWindowResize(); this.resizeEvent = addEventListenerWrap(window, 'resize', this.debouncedWindowResize); } } - // when table changes to empty, reset scrollLeft - if (prevProps.data.length > 0 && this.props.data.length === 0 && this.hasScrollX()) { - this.resetScrollX(); + }, { + key: 'componentDidUpdate', + value: function componentDidUpdate(prevProps) { + if (this.columnManager.isAnyColumnsFixed()) { + this.handleWindowResize(); + if (!this.resizeEvent) { + this.resizeEvent = addEventListenerWrap(window, 'resize', this.debouncedWindowResize); + } + } + // when table changes to empty, reset scrollLeft + if (prevProps.data.length > 0 && this.props.data.length === 0 && this.hasScrollX()) { + this.resetScrollX(); + } } - }; - - Table.prototype.componentWillUnmount = function componentWillUnmount() { - if (this.resizeEvent) { - this.resizeEvent.remove(); + }, { + key: 'componentWillUnmount', + value: function componentWillUnmount() { + if (this.resizeEvent) { + this.resizeEvent.remove(); + } + if (this.debouncedWindowResize) { + this.debouncedWindowResize.cancel(); + } } - if (this.debouncedWindowResize) { - this.debouncedWindowResize.cancel(); + }, { + key: 'setScrollPosition', + value: function setScrollPosition(position) { + this.scrollPosition = position; + if (this.tableNode) { + var prefixCls = this.props.prefixCls; + + if (position === 'both') { + component_classes_default()(this.tableNode).remove(new RegExp('^' + prefixCls + '-scroll-position-.+$')).add(prefixCls + '-scroll-position-left').add(prefixCls + '-scroll-position-right'); + } else { + component_classes_default()(this.tableNode).remove(new RegExp('^' + prefixCls + '-scroll-position-.+$')).add(prefixCls + '-scroll-position-' + position); + } + } } - }; - - Table.prototype.setScrollPosition = function setScrollPosition(position) { - this.scrollPosition = position; - if (this.tableNode) { - var prefixCls = this.props.prefixCls; - - if (position === 'both') { - component_classes_default()(this.tableNode).remove(new RegExp('^' + prefixCls + '-scroll-position-.+$')).add(prefixCls + '-scroll-position-left').add(prefixCls + '-scroll-position-right'); - } else { - component_classes_default()(this.tableNode).remove(new RegExp('^' + prefixCls + '-scroll-position-.+$')).add(prefixCls + '-scroll-position-' + position); + }, { + key: 'setScrollPositionClassName', + value: function setScrollPositionClassName() { + var node = this.bodyTable; + var scrollToLeft = node.scrollLeft === 0; + var scrollToRight = node.scrollLeft + 1 >= node.children[0].getBoundingClientRect().width - node.getBoundingClientRect().width; + if (scrollToLeft && scrollToRight) { + this.setScrollPosition('both'); + } else if (scrollToLeft) { + this.setScrollPosition('left'); + } else if (scrollToRight) { + this.setScrollPosition('right'); + } else if (this.scrollPosition !== 'middle') { + this.setScrollPosition('middle'); } } - }; - - Table.prototype.setScrollPositionClassName = function setScrollPositionClassName() { - var node = this.bodyTable; - var scrollToLeft = node.scrollLeft === 0; - var scrollToRight = node.scrollLeft + 1 >= node.children[0].getBoundingClientRect().width - node.getBoundingClientRect().width; - if (scrollToLeft && scrollToRight) { - this.setScrollPosition('both'); - } else if (scrollToLeft) { - this.setScrollPosition('left'); - } else if (scrollToRight) { - this.setScrollPosition('right'); - } else if (this.scrollPosition !== 'middle') { - this.setScrollPosition('middle'); + }, { + key: 'resetScrollX', + value: function resetScrollX() { + if (this.headTable) { + this.headTable.scrollLeft = 0; + } + if (this.bodyTable) { + this.bodyTable.scrollLeft = 0; + } } - }; + }, { + key: 'hasScrollX', + value: function hasScrollX() { + var _props$scroll = this.props.scroll, + scroll = _props$scroll === undefined ? {} : _props$scroll; - Table.prototype.resetScrollX = function resetScrollX() { - if (this.headTable) { - this.headTable.scrollLeft = 0; + return 'x' in scroll; } - if (this.bodyTable) { - this.bodyTable.scrollLeft = 0; - } - }; - - Table.prototype.hasScrollX = function hasScrollX() { - var _props$scroll = this.props.scroll, - scroll = _props$scroll === undefined ? {} : _props$scroll; - - return 'x' in scroll; - }; - - Table.prototype.renderMainTable = function renderMainTable() { - var _props = this.props, - scroll = _props.scroll, - prefixCls = _props.prefixCls; - - var isAnyColumnsFixed = this.columnManager.isAnyColumnsFixed(); - var scrollable = isAnyColumnsFixed || scroll.x || scroll.y; + }, { + key: 'renderMainTable', + value: function renderMainTable() { + var _props = this.props, + scroll = _props.scroll, + prefixCls = _props.prefixCls; - var table = [this.renderTable({ - columns: this.columnManager.groupedColumns(), - isAnyColumnsFixed: isAnyColumnsFixed - }), this.renderEmptyText(), this.renderFooter()]; + var isAnyColumnsFixed = this.columnManager.isAnyColumnsFixed(); + var scrollable = isAnyColumnsFixed || scroll.x || scroll.y; - return scrollable ? react_default.a.createElement( - 'div', - { className: prefixCls + '-scroll' }, - table - ) : table; - }; + var table = [this.renderTable({ + columns: this.columnManager.groupedColumns(), + isAnyColumnsFixed: isAnyColumnsFixed + }), this.renderEmptyText(), this.renderFooter()]; - Table.prototype.renderLeftFixedTable = function renderLeftFixedTable() { - var prefixCls = this.props.prefixCls; + return scrollable ? react_default.a.createElement( + 'div', + { className: prefixCls + '-scroll' }, + table + ) : table; + } + }, { + key: 'renderLeftFixedTable', + value: function renderLeftFixedTable() { + var prefixCls = this.props.prefixCls; - return react_default.a.createElement( - 'div', - { className: prefixCls + '-fixed-left' }, - this.renderTable({ - columns: this.columnManager.leftColumns(), - fixed: 'left' - }) - ); - }; + return react_default.a.createElement( + 'div', + { className: prefixCls + '-fixed-left' }, + this.renderTable({ + columns: this.columnManager.leftColumns(), + fixed: 'left' + }) + ); + } + }, { + key: 'renderRightFixedTable', + value: function renderRightFixedTable() { + var prefixCls = this.props.prefixCls; - Table.prototype.renderRightFixedTable = function renderRightFixedTable() { - var prefixCls = this.props.prefixCls; + return react_default.a.createElement( + 'div', + { className: prefixCls + '-fixed-right' }, + this.renderTable({ + columns: this.columnManager.rightColumns(), + fixed: 'right' + }) + ); + } + }, { + key: 'renderTable', + value: function renderTable(options) { + var columns = options.columns, + fixed = options.fixed, + isAnyColumnsFixed = options.isAnyColumnsFixed; + var _props2 = this.props, + prefixCls = _props2.prefixCls, + _props2$scroll = _props2.scroll, + scroll = _props2$scroll === undefined ? {} : _props2$scroll; + + var tableClassName = scroll.x || fixed ? prefixCls + '-fixed' : ''; + + var headTable = react_default.a.createElement(HeadTable, { + key: 'head', + columns: columns, + fixed: fixed, + tableClassName: tableClassName, + handleBodyScrollLeft: this.handleBodyScrollLeft, + expander: this.expander + }); - return react_default.a.createElement( - 'div', - { className: prefixCls + '-fixed-right' }, - this.renderTable({ - columns: this.columnManager.rightColumns(), - fixed: 'right' - }) - ); - }; + var bodyTable = react_default.a.createElement(BodyTable, { + key: 'body', + columns: columns, + fixed: fixed, + tableClassName: tableClassName, + getRowKey: this.getRowKey, + handleWheel: this.handleWheel, + handleBodyScroll: this.handleBodyScroll, + expander: this.expander, + isAnyColumnsFixed: isAnyColumnsFixed + }); - Table.prototype.renderTable = function renderTable(options) { - var columns = options.columns, - fixed = options.fixed, - isAnyColumnsFixed = options.isAnyColumnsFixed; - var _props2 = this.props, - prefixCls = _props2.prefixCls, - _props2$scroll = _props2.scroll, - scroll = _props2$scroll === undefined ? {} : _props2$scroll; + return [headTable, bodyTable]; + } + }, { + key: 'renderTitle', + value: function renderTitle() { + var _props3 = this.props, + title = _props3.title, + prefixCls = _props3.prefixCls; - var tableClassName = scroll.x || fixed ? prefixCls + '-fixed' : ''; + return title ? react_default.a.createElement( + 'div', + { className: prefixCls + '-title', key: 'title' }, + title(this.props.data) + ) : null; + } + }, { + key: 'renderFooter', + value: function renderFooter() { + var _props4 = this.props, + footer = _props4.footer, + prefixCls = _props4.prefixCls; - var headTable = react_default.a.createElement(HeadTable, { - key: 'head', - columns: columns, - fixed: fixed, - tableClassName: tableClassName, - handleBodyScrollLeft: this.handleBodyScrollLeft, - expander: this.expander - }); - - var bodyTable = react_default.a.createElement(BodyTable, { - key: 'body', - columns: columns, - fixed: fixed, - tableClassName: tableClassName, - getRowKey: this.getRowKey, - handleWheel: this.handleWheel, - handleBodyScroll: this.handleBodyScroll, - expander: this.expander, - isAnyColumnsFixed: isAnyColumnsFixed - }); - - return [headTable, bodyTable]; - }; - - Table.prototype.renderTitle = function renderTitle() { - var _props3 = this.props, - title = _props3.title, - prefixCls = _props3.prefixCls; - - return title ? react_default.a.createElement( - 'div', - { className: prefixCls + '-title', key: 'title' }, - title(this.props.data) - ) : null; - }; - - Table.prototype.renderFooter = function renderFooter() { - var _props4 = this.props, - footer = _props4.footer, - prefixCls = _props4.prefixCls; - - return footer ? react_default.a.createElement( - 'div', - { className: prefixCls + '-footer', key: 'footer' }, - footer(this.props.data) - ) : null; - }; - - Table.prototype.renderEmptyText = function renderEmptyText() { - var _props5 = this.props, - emptyText = _props5.emptyText, - prefixCls = _props5.prefixCls, - data = _props5.data; - - if (data.length) { - return null; + return footer ? react_default.a.createElement( + 'div', + { className: prefixCls + '-footer', key: 'footer' }, + footer(this.props.data) + ) : null; } - var emptyClassName = prefixCls + '-placeholder'; - return react_default.a.createElement( - 'div', - { className: emptyClassName, key: 'emptyText' }, - typeof emptyText === 'function' ? emptyText() : emptyText - ); - }; + }, { + key: 'renderEmptyText', + value: function renderEmptyText() { + var _props5 = this.props, + emptyText = _props5.emptyText, + prefixCls = _props5.prefixCls, + data = _props5.data; + + if (data.length) { + return null; + } + var emptyClassName = prefixCls + '-placeholder'; + return react_default.a.createElement( + 'div', + { className: emptyClassName, key: 'emptyText' }, + typeof emptyText === 'function' ? emptyText() : emptyText + ); + } + }, { + key: 'render', + value: function render() { + var _this2 = this; - Table.prototype.render = function render() { - var _this2 = this; + var props = this.props; + var prefixCls = props.prefixCls; - var props = this.props; - var prefixCls = props.prefixCls; + if (this.state.columns) { + this.columnManager.reset(props.columns); + } else if (this.state.children) { + this.columnManager.reset(null, props.children); + } - if (this.state.columns) { - this.columnManager.reset(props.columns); - } else if (this.state.children) { - this.columnManager.reset(null, props.children); - } + var className = props.prefixCls; + if (props.className) { + className += ' ' + props.className; + } + if (props.useFixedHeader || props.scroll && props.scroll.y) { + className += ' ' + prefixCls + '-fixed-header'; + } + if (this.scrollPosition === 'both') { + className += ' ' + prefixCls + '-scroll-position-left ' + prefixCls + '-scroll-position-right'; + } else { + className += ' ' + prefixCls + '-scroll-position-' + this.scrollPosition; + } + var hasLeftFixed = this.columnManager.isAnyColumnsLeftFixed(); + var hasRightFixed = this.columnManager.isAnyColumnsRightFixed(); - var className = props.prefixCls; - if (props.className) { - className += ' ' + props.className; - } - if (props.useFixedHeader || props.scroll && props.scroll.y) { - className += ' ' + prefixCls + '-fixed-header'; + return react_default.a.createElement( + mini_store_lib["Provider"], + { store: this.store }, + react_default.a.createElement( + es_ExpandableTable, + extends_default()({}, props, { columnManager: this.columnManager, getRowKey: this.getRowKey }), + function (expander) { + _this2.expander = expander; + return react_default.a.createElement( + 'div', + { + ref: _this2.saveRef('tableNode'), + className: className, + style: props.style, + id: props.id + }, + _this2.renderTitle(), + react_default.a.createElement( + 'div', + { className: prefixCls + '-content' }, + _this2.renderMainTable(), + hasLeftFixed && _this2.renderLeftFixedTable(), + hasRightFixed && _this2.renderRightFixedTable() + ) + ); + } + ) + ); } - if (this.scrollPosition === 'both') { - className += ' ' + prefixCls + '-scroll-position-left ' + prefixCls + '-scroll-position-right'; - } else { - className += ' ' + prefixCls + '-scroll-position-' + this.scrollPosition; + }], [{ + key: 'getDerivedStateFromProps', + value: function getDerivedStateFromProps(nextProps, prevState) { + if (nextProps.columns && nextProps.columns !== prevState.columns) { + return { + columns: nextProps.columns, + children: null + }; + } else if (nextProps.children !== prevState.children) { + return { + columns: null, + children: nextProps.children + }; + } + return null; } - var hasLeftFixed = this.columnManager.isAnyColumnsLeftFixed(); - var hasRightFixed = this.columnManager.isAnyColumnsRightFixed(); - - return react_default.a.createElement( - mini_store_lib["Provider"], - { store: this.store }, - react_default.a.createElement( - es_ExpandableTable, - extends_default()({}, props, { columnManager: this.columnManager, getRowKey: this.getRowKey }), - function (expander) { - _this2.expander = expander; - return react_default.a.createElement( - 'div', - { - ref: _this2.saveRef('tableNode'), - className: className, - style: props.style, - id: props.id - }, - _this2.renderTitle(), - react_default.a.createElement( - 'div', - { className: prefixCls + '-content' }, - _this2.renderMainTable(), - hasLeftFixed && _this2.renderLeftFixedTable(), - hasRightFixed && _this2.renderRightFixedTable() - ) - ); - } - ) - ); - }; + }]); return Table; }(react_default.a.Component); @@ -34043,16 +34152,16 @@ var ColumnGroup_ColumnGroup = function (_Component) { function ColumnGroup() { classCallCheck_default()(this, ColumnGroup); - return possibleConstructorReturn_default()(this, _Component.apply(this, arguments)); + return possibleConstructorReturn_default()(this, (ColumnGroup.__proto__ || Object.getPrototypeOf(ColumnGroup)).apply(this, arguments)); } return ColumnGroup; }(react["Component"]); +ColumnGroup_ColumnGroup.isTableColumnGroup = true; ColumnGroup_ColumnGroup.propTypes = { title: prop_types_default.a.node }; -ColumnGroup_ColumnGroup.isTableColumnGroup = true; /* harmony default export */ var es_ColumnGroup = (ColumnGroup_ColumnGroup); // CONCATENATED MODULE: ../node_modules/rc-table/es/index.js @@ -35025,1962 +35134,1635 @@ function loopMenuItemRecursively(children, keys, ret) { }); } -var menuAllProps = ['defaultSelectedKeys', 'selectedKeys', 'defaultOpenKeys', 'openKeys', 'mode', 'getPopupContainer', 'onSelect', 'onDeselect', 'onDestroy', 'openTransitionName', 'openAnimation', 'subMenuOpenDelay', 'subMenuCloseDelay', 'forceSubMenuRender', 'triggerSubMenuAction', 'level', 'selectable', 'multiple', 'onOpenChange', 'visible', 'focusable', 'defaultActiveFirst', 'prefixCls', 'inlineIndent', 'parentMenu', 'title', 'rootPrefixCls', 'eventKey', 'active', 'onItemHover', 'onTitleMouseEnter', 'onTitleMouseLeave', 'onTitleClick', 'popupAlign', 'popupOffset', 'isOpen', 'renderMenuItem', 'manualRef', 'subMenuKey', 'disabled', 'index', 'isSelected', 'store', 'activeKey', 'builtinPlacements', 'overflowedIndicator', +var menuAllProps = ['defaultSelectedKeys', 'selectedKeys', 'defaultOpenKeys', 'openKeys', 'mode', 'getPopupContainer', 'onSelect', 'onDeselect', 'onDestroy', 'openTransitionName', 'openAnimation', 'subMenuOpenDelay', 'subMenuCloseDelay', 'forceSubMenuRender', 'triggerSubMenuAction', 'level', 'selectable', 'multiple', 'onOpenChange', 'visible', 'focusable', 'defaultActiveFirst', 'prefixCls', 'inlineIndent', 'parentMenu', 'title', 'rootPrefixCls', 'eventKey', 'active', 'onItemHover', 'onTitleMouseEnter', 'onTitleMouseLeave', 'onTitleClick', 'popupAlign', 'popupOffset', 'isOpen', 'renderMenuItem', 'manualRef', 'subMenuKey', 'disabled', 'index', 'isSelected', 'store', 'activeKey', 'builtinPlacements', // the following keys found need to be removed from test regression 'attribute', 'value', 'popupClassName', 'inlineCollapsed', 'menu', 'theme']; +// CONCATENATED MODULE: ../node_modules/rc-select/node_modules/rc-menu/es/DOMWrap.js -var getWidth = function getWidth(elem) { - return elem.getBoundingClientRect().width; -}; -var getScrollWidth = function getScrollWidth(elem) { - return elem.scrollWidth; -}; -// CONCATENATED MODULE: ../node_modules/dom-align/es/propertyUtils.js -var vendorPrefix = void 0; -var jsCssMap = { - Webkit: '-webkit-', - Moz: '-moz-', - // IE did it wrong again ... - ms: '-ms-', - O: '-o-' -}; -function getVendorPrefix() { - if (vendorPrefix !== undefined) { - return vendorPrefix; + + + +var DOMWrap_DOMWrap = function (_React$Component) { + inherits_default()(DOMWrap, _React$Component); + + function DOMWrap() { + classCallCheck_default()(this, DOMWrap); + + return possibleConstructorReturn_default()(this, _React$Component.apply(this, arguments)); } - vendorPrefix = ''; - var style = document.createElement('p').style; - var testProp = 'Transform'; - for (var key in jsCssMap) { - if (key + testProp in style) { - vendorPrefix = key; + + DOMWrap.prototype.render = function render() { + var props = extends_default()({}, this.props); + if (!props.visible) { + props.className += ' ' + props.hiddenClassName; } + var Tag = props.tag; + delete props.tag; + delete props.hiddenClassName; + delete props.visible; + return react_default.a.createElement(Tag, props); + }; + + return DOMWrap; +}(react_default.a.Component); + +DOMWrap_DOMWrap.propTypes = { + tag: prop_types_default.a.string, + hiddenClassName: prop_types_default.a.string, + visible: prop_types_default.a.bool +}; +DOMWrap_DOMWrap.defaultProps = { + tag: 'div', + className: '' +}; +/* harmony default export */ var es_DOMWrap = (DOMWrap_DOMWrap); +// CONCATENATED MODULE: ../node_modules/rc-select/node_modules/rc-menu/es/SubPopupMenu.js + + + + + + + + + + + + + + +function allDisabled(arr) { + if (!arr.length) { + return true; } - return vendorPrefix; + return arr.every(function (c) { + return !!c.props.disabled; + }); } -function getTransitionName() { - return getVendorPrefix() ? getVendorPrefix() + 'TransitionProperty' : 'transitionProperty'; +function updateActiveKey(store, menuId, activeKey) { + var _extends2; + + var state = store.getState(); + store.setState({ + activeKey: extends_default()({}, state.activeKey, (_extends2 = {}, _extends2[menuId] = activeKey, _extends2)) + }); } -function getTransformName() { - return getVendorPrefix() ? getVendorPrefix() + 'Transform' : 'transform'; +function getEventKey(props) { + // when eventKey not available ,it's menu and return menu id '0-menu-' + return props.eventKey || '0-menu-'; } -function setTransitionProperty(node, value) { - var name = getTransitionName(); - if (name) { - node.style[name] = value; - if (name !== 'transitionProperty') { - node.style.transitionProperty = value; +function SubPopupMenu_getActiveKey(props, originalActiveKey) { + var activeKey = originalActiveKey; + var children = props.children, + eventKey = props.eventKey; + + if (activeKey) { + var found = void 0; + loopMenuItem(children, function (c, i) { + if (c && !c.props.disabled && activeKey === getKeyFromChildrenIndex(c, eventKey, i)) { + found = true; + } + }); + if (found) { + return activeKey; } } + activeKey = null; + if (props.defaultActiveFirst) { + loopMenuItem(children, function (c, i) { + if (!activeKey && c && !c.props.disabled) { + activeKey = getKeyFromChildrenIndex(c, eventKey, i); + } + }); + return activeKey; + } + return activeKey; } -function propertyUtils_setTransform(node, value) { - var name = getTransformName(); - if (name) { - node.style[name] = value; - if (name !== 'transform') { - node.style.transform = value; +function SubPopupMenu_saveRef(c) { + if (c) { + var index = this.instanceArray.indexOf(c); + if (index !== -1) { + // update component if it's already inside instanceArray + this.instanceArray[index] = c; + } else { + // add component if it's not in instanceArray yet; + this.instanceArray.push(c); } } } -function getTransitionProperty(node) { - return node.style.transitionProperty || node.style[getTransitionName()]; -} +var SubPopupMenu_SubPopupMenu = function (_React$Component) { + inherits_default()(SubPopupMenu, _React$Component); -function getTransformXY(node) { - var style = window.getComputedStyle(node, null); - var transform = style.getPropertyValue('transform') || style.getPropertyValue(getTransformName()); - if (transform && transform !== 'none') { - var matrix = transform.replace(/[^0-9\-.,]/g, '').split(','); - return { x: parseFloat(matrix[12] || matrix[4], 0), y: parseFloat(matrix[13] || matrix[5], 0) }; - } - return { - x: 0, - y: 0 - }; -} + function SubPopupMenu(props) { + var _extends3; -var matrix2d = /matrix\((.*)\)/; -var matrix3d = /matrix3d\((.*)\)/; + classCallCheck_default()(this, SubPopupMenu); -function setTransformXY(node, xy) { - var style = window.getComputedStyle(node, null); - var transform = style.getPropertyValue('transform') || style.getPropertyValue(getTransformName()); - if (transform && transform !== 'none') { - var arr = void 0; - var match2d = transform.match(matrix2d); - if (match2d) { - match2d = match2d[1]; - arr = match2d.split(',').map(function (item) { - return parseFloat(item, 10); - }); - arr[4] = xy.x; - arr[5] = xy.y; - propertyUtils_setTransform(node, 'matrix(' + arr.join(',') + ')'); - } else { - var match3d = transform.match(matrix3d)[1]; - arr = match3d.split(',').map(function (item) { - return parseFloat(item, 10); - }); - arr[12] = xy.x; - arr[13] = xy.y; - propertyUtils_setTransform(node, 'matrix3d(' + arr.join(',') + ')'); - } - } else { - propertyUtils_setTransform(node, 'translateX(' + xy.x + 'px) translateY(' + xy.y + 'px) translateZ(0)'); + var _this = possibleConstructorReturn_default()(this, _React$Component.call(this, props)); + + SubPopupMenu__initialiseProps.call(_this); + + props.store.setState({ + activeKey: extends_default()({}, props.store.getState().activeKey, (_extends3 = {}, _extends3[props.eventKey] = SubPopupMenu_getActiveKey(props, props.activeKey), _extends3)) + }); + + _this.instanceArray = []; + return _this; } -} -// CONCATENATED MODULE: ../node_modules/dom-align/es/utils.js -var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; + SubPopupMenu.prototype.componentDidMount = function componentDidMount() { + // invoke customized ref to expose component to mixin + if (this.props.manualRef) { + this.props.manualRef(this); + } + }; + SubPopupMenu.prototype.shouldComponentUpdate = function shouldComponentUpdate(nextProps) { + return this.props.visible || nextProps.visible; + }; -var RE_NUM = /[\-+]?(?:\d*\.|)\d+(?:[eE][\-+]?\d+|)/.source; + SubPopupMenu.prototype.componentDidUpdate = function componentDidUpdate() { + var props = this.props; + var originalActiveKey = 'activeKey' in props ? props.activeKey : props.store.getState().activeKey[getEventKey(props)]; + var activeKey = SubPopupMenu_getActiveKey(props, originalActiveKey); + if (activeKey !== originalActiveKey) { + updateActiveKey(props.store, getEventKey(props), activeKey); + } + }; -var getComputedStyleX = void 0; + // all keyboard events callbacks run from here at first -// https://stackoverflow.com/a/3485654/3040605 -function forceRelayout(elem) { - var originalStyle = elem.style.display; - elem.style.display = 'none'; - elem.offsetHeight; // eslint-disable-line - elem.style.display = originalStyle; -} -function css(el, name, v) { - var value = v; - if ((typeof name === 'undefined' ? 'undefined' : _typeof(name)) === 'object') { - for (var i in name) { - if (name.hasOwnProperty(i)) { - css(el, i, name[i]); - } + SubPopupMenu.prototype.render = function render() { + var _this2 = this; + + var props = objectWithoutProperties_default()(this.props, []); + + this.instanceArray = []; + var className = classnames_default()(props.prefixCls, props.className, props.prefixCls + '-' + props.mode); + var domProps = { + className: className, + // role could be 'select' and by default set to menu + role: props.role || 'menu' + }; + if (props.id) { + domProps.id = props.id; } - return undefined; - } - if (typeof value !== 'undefined') { - if (typeof value === 'number') { - value = value + 'px'; + if (props.focusable) { + domProps.tabIndex = '0'; + domProps.onKeyDown = this.onKeyDown; } - el.style[name] = value; - return undefined; - } - return getComputedStyleX(el, name); -} + var prefixCls = props.prefixCls, + eventKey = props.eventKey, + visible = props.visible; -function getClientPosition(elem) { - var box = void 0; - var x = void 0; - var y = void 0; - var doc = elem.ownerDocument; - var body = doc.body; - var docElem = doc && doc.documentElement; - // 根据 GBS 最新数据,A-Grade Browsers 都已支持 getBoundingClientRect 方法,不用再考虑传统的实现方式 - box = elem.getBoundingClientRect(); + menuAllProps.forEach(function (key) { + return delete props[key]; + }); - // 注:jQuery 还考虑减去 docElem.clientLeft/clientTop - // 但测试发现,这样反而会导致当 html 和 body 有边距/边框样式时,获取的值不正确 - // 此外,ie6 会忽略 html 的 margin 值,幸运地是没有谁会去设置 html 的 margin + // Otherwise, the propagated click event will trigger another onClick + delete props.onClick; + return ( + // ESLint is not smart enough to know that the type of `children` was checked. + /* eslint-disable */ + react_default.a.createElement( + es_DOMWrap, + extends_default()({}, props, { + tag: 'ul', + hiddenClassName: prefixCls + '-hidden', + visible: visible + }, domProps), + react_default.a.Children.map(props.children, function (c, i) { + return _this2.renderMenuItem(c, i, eventKey || '0-menu-'); + }) + ) + /*eslint-enable */ - x = box.left; - y = box.top; + ); + }; - // In IE, most of the time, 2 extra pixels are added to the top and left - // due to the implicit 2-pixel inset border. In IE6/7 quirks mode and - // IE6 standards mode, this border can be overridden by setting the - // document element's border to zero -- thus, we cannot rely on the - // offset always being 2 pixels. + return SubPopupMenu; +}(react_default.a.Component); - // In quirks mode, the offset can be determined by querying the body's - // clientLeft/clientTop, but in standards mode, it is found by querying - // the document element's clientLeft/clientTop. Since we already called - // getClientBoundingRect we have already forced a reflow, so it is not - // too expensive just to query them all. +SubPopupMenu_SubPopupMenu.propTypes = { + onSelect: prop_types_default.a.func, + onClick: prop_types_default.a.func, + onDeselect: prop_types_default.a.func, + onOpenChange: prop_types_default.a.func, + onDestroy: prop_types_default.a.func, + openTransitionName: prop_types_default.a.string, + openAnimation: prop_types_default.a.oneOfType([prop_types_default.a.string, prop_types_default.a.object]), + openKeys: prop_types_default.a.arrayOf(prop_types_default.a.string), + visible: prop_types_default.a.bool, + children: prop_types_default.a.any, + parentMenu: prop_types_default.a.object, + eventKey: prop_types_default.a.string, + store: prop_types_default.a.shape({ + getState: prop_types_default.a.func, + setState: prop_types_default.a.func + }), - // ie 下应该减去窗口的边框吧,毕竟默认 absolute 都是相对窗口定位的 - // 窗口边框标准是设 documentElement ,quirks 时设置 body - // 最好禁止在 body 和 html 上边框 ,但 ie < 9 html 默认有 2px ,减去 - // 但是非 ie 不可能设置窗口边框,body html 也不是窗口 ,ie 可以通过 html,body 设置 - // 标准 ie 下 docElem.clientTop 就是 border-top - // ie7 html 即窗口边框改变不了。永远为 2 - // 但标准 firefox/chrome/ie9 下 docElem.clientTop 是窗口边框,即使设了 border-top 也为 0 + // adding in refactor + focusable: prop_types_default.a.bool, + multiple: prop_types_default.a.bool, + style: prop_types_default.a.object, + defaultActiveFirst: prop_types_default.a.bool, + activeKey: prop_types_default.a.string, + selectedKeys: prop_types_default.a.arrayOf(prop_types_default.a.string), + defaultSelectedKeys: prop_types_default.a.arrayOf(prop_types_default.a.string), + defaultOpenKeys: prop_types_default.a.arrayOf(prop_types_default.a.string), + level: prop_types_default.a.number, + mode: prop_types_default.a.oneOf(['horizontal', 'vertical', 'vertical-left', 'vertical-right', 'inline']), + triggerSubMenuAction: prop_types_default.a.oneOf(['click', 'hover']), + inlineIndent: prop_types_default.a.oneOfType([prop_types_default.a.number, prop_types_default.a.string]), + manualRef: prop_types_default.a.func +}; +SubPopupMenu_SubPopupMenu.defaultProps = { + prefixCls: 'rc-menu', + className: '', + mode: 'vertical', + level: 1, + inlineIndent: 24, + visible: true, + focusable: true, + style: {}, + manualRef: util_noop +}; - x -= docElem.clientLeft || body.clientLeft || 0; - y -= docElem.clientTop || body.clientTop || 0; +var SubPopupMenu__initialiseProps = function _initialiseProps() { + var _this3 = this; - return { - left: x, - top: y - }; -} + this.onKeyDown = function (e, callback) { + var keyCode = e.keyCode; + var handled = void 0; + _this3.getFlatInstanceArray().forEach(function (obj) { + if (obj && obj.props.active && obj.onKeyDown) { + handled = obj.onKeyDown(e); + } + }); + if (handled) { + return 1; + } + var activeItem = null; + if (keyCode === es_KeyCode.UP || keyCode === es_KeyCode.DOWN) { + activeItem = _this3.step(keyCode === es_KeyCode.UP ? -1 : 1); + } + if (activeItem) { + e.preventDefault(); + updateActiveKey(_this3.props.store, getEventKey(_this3.props), activeItem.props.eventKey); -function utils_getScroll(w, top) { - var ret = w['page' + (top ? 'Y' : 'X') + 'Offset']; - var method = 'scroll' + (top ? 'Top' : 'Left'); - if (typeof ret !== 'number') { - var d = w.document; - // ie6,7,8 standard mode - ret = d.documentElement[method]; - if (typeof ret !== 'number') { - // quirks mode - ret = d.body[method]; + if (typeof callback === 'function') { + callback(activeItem); + } + + return 1; } - } - return ret; -} + }; -function getScrollLeft(w) { - return utils_getScroll(w); -} + this.onItemHover = function (e) { + var key = e.key, + hover = e.hover; -function getScrollTop(w) { - return utils_getScroll(w, true); -} + updateActiveKey(_this3.props.store, getEventKey(_this3.props), hover ? key : null); + }; -function getOffset(el) { - var pos = getClientPosition(el); - var doc = el.ownerDocument; - var w = doc.defaultView || doc.parentWindow; - pos.left += getScrollLeft(w); - pos.top += getScrollTop(w); - return pos; -} + this.onDeselect = function (selectInfo) { + _this3.props.onDeselect(selectInfo); + }; -/** - * A crude way of determining if an object is a window - * @member util - */ -function isWindow(obj) { - // must use == for ie8 - /* eslint eqeqeq:0 */ - return obj !== null && obj !== undefined && obj == obj.window; -} + this.onSelect = function (selectInfo) { + _this3.props.onSelect(selectInfo); + }; -function getDocument(node) { - if (isWindow(node)) { - return node.document; - } - if (node.nodeType === 9) { - return node; - } - return node.ownerDocument; -} + this.onClick = function (e) { + _this3.props.onClick(e); + }; -function _getComputedStyle(elem, name, cs) { - var computedStyle = cs; - var val = ''; - var d = getDocument(elem); - computedStyle = computedStyle || d.defaultView.getComputedStyle(elem, null); + this.onOpenChange = function (e) { + _this3.props.onOpenChange(e); + }; - // https://github.com/kissyteam/kissy/issues/61 - if (computedStyle) { - val = computedStyle.getPropertyValue(name) || computedStyle[name]; - } + this.onDestroy = function (key) { + /* istanbul ignore next */ + _this3.props.onDestroy(key); + }; - return val; -} + this.getFlatInstanceArray = function () { + return _this3.instanceArray; + }; -var _RE_NUM_NO_PX = new RegExp('^(' + RE_NUM + ')(?!px)[a-z%]+$', 'i'); -var RE_POS = /^(top|right|bottom|left)$/; -var CURRENT_STYLE = 'currentStyle'; -var RUNTIME_STYLE = 'runtimeStyle'; -var LEFT = 'left'; -var PX = 'px'; + this.getOpenTransitionName = function () { + return _this3.props.openTransitionName; + }; -function _getComputedStyleIE(elem, name) { - // currentStyle maybe null - // http://msdn.microsoft.com/en-us/library/ms535231.aspx - var ret = elem[CURRENT_STYLE] && elem[CURRENT_STYLE][name]; + this.step = function (direction) { + var children = _this3.getFlatInstanceArray(); + var activeKey = _this3.props.store.getState().activeKey[getEventKey(_this3.props)]; + var len = children.length; + if (!len) { + return null; + } + if (direction < 0) { + children = children.concat().reverse(); + } + // find current activeIndex + var activeIndex = -1; + children.every(function (c, ci) { + if (c && c.props.eventKey === activeKey) { + activeIndex = ci; + return false; + } + return true; + }); + if (!_this3.props.defaultActiveFirst && activeIndex !== -1 && allDisabled(children.slice(activeIndex, len - 1))) { + return undefined; + } + var start = (activeIndex + 1) % len; + var i = start; - // 当 width/height 设置为百分比时,通过 pixelLeft 方式转换的 width/height 值 - // 一开始就处理了! CUSTOM_STYLE.height,CUSTOM_STYLE.width ,cssHook 解决@2011-08-19 - // 在 ie 下不对,需要直接用 offset 方式 - // borderWidth 等值也有问题,但考虑到 borderWidth 设为百分比的概率很小,这里就不考虑了 + do { + var child = children[i]; + if (!child || child.props.disabled) { + i = (i + 1) % len; + } else { + return child; + } + } while (i !== start); - // From the awesome hack by Dean Edwards - // http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291 - // If we're not dealing with a regular pixel number - // but a number that has a weird ending, we need to convert it to pixels - // exclude left right for relativity - if (_RE_NUM_NO_PX.test(ret) && !RE_POS.test(name)) { - // Remember the original values - var style = elem.style; - var left = style[LEFT]; - var rsLeft = elem[RUNTIME_STYLE][LEFT]; + return null; + }; - // prevent flashing of content - elem[RUNTIME_STYLE][LEFT] = elem[CURRENT_STYLE][LEFT]; + this.renderCommonMenuItem = function (child, i, extraProps) { + var state = _this3.props.store.getState(); + var props = _this3.props; + var key = getKeyFromChildrenIndex(child, props.eventKey, i); + var childProps = child.props; + var isActive = key === state.activeKey; + var newChildProps = extends_default()({ + mode: props.mode, + level: props.level, + inlineIndent: props.inlineIndent, + renderMenuItem: _this3.renderMenuItem, + rootPrefixCls: props.prefixCls, + index: i, + parentMenu: props.parentMenu, + // customized ref function, need to be invoked manually in child's componentDidMount + manualRef: childProps.disabled ? undefined : createChainedFunction(child.ref, SubPopupMenu_saveRef.bind(_this3)), + eventKey: key, + active: !childProps.disabled && isActive, + multiple: props.multiple, + onClick: function onClick(e) { + (childProps.onClick || util_noop)(e); + _this3.onClick(e); + }, + onItemHover: _this3.onItemHover, + openTransitionName: _this3.getOpenTransitionName(), + openAnimation: props.openAnimation, + subMenuOpenDelay: props.subMenuOpenDelay, + subMenuCloseDelay: props.subMenuCloseDelay, + forceSubMenuRender: props.forceSubMenuRender, + onOpenChange: _this3.onOpenChange, + onDeselect: _this3.onDeselect, + onSelect: _this3.onSelect, + builtinPlacements: props.builtinPlacements + }, extraProps); + if (props.mode === 'inline') { + newChildProps.triggerSubMenuAction = 'click'; + } + return react_default.a.cloneElement(child, newChildProps); + }; - // Put in the new values to get a computed value out - style[LEFT] = name === 'fontSize' ? '1em' : ret || 0; - ret = style.pixelLeft + PX; + this.renderMenuItem = function (c, i, subMenuKey) { + /* istanbul ignore if */ + if (!c) { + return null; + } + var state = _this3.props.store.getState(); + var extraProps = { + openKeys: state.openKeys, + selectedKeys: state.selectedKeys, + triggerSubMenuAction: _this3.props.triggerSubMenuAction, + subMenuKey: subMenuKey + }; + return _this3.renderCommonMenuItem(c, i, extraProps); + }; +}; - // Revert the changed values - style[LEFT] = left; +/* harmony default export */ var es_SubPopupMenu = (Object(mini_store_lib["connect"])()(SubPopupMenu_SubPopupMenu)); +// CONCATENATED MODULE: ../node_modules/rc-select/node_modules/rc-menu/es/Menu.js - elem[RUNTIME_STYLE][LEFT] = rsLeft; - } - return ret === '' ? 'auto' : ret; -} -if (typeof window !== 'undefined') { - getComputedStyleX = window.getComputedStyle ? _getComputedStyle : _getComputedStyleIE; -} -function getOffsetDirection(dir, option) { - if (dir === 'left') { - return option.useCssRight ? 'right' : dir; - } - return option.useCssBottom ? 'bottom' : dir; -} -function oppositeOffsetDirection(dir) { - if (dir === 'left') { - return 'right'; - } else if (dir === 'right') { - return 'left'; - } else if (dir === 'top') { - return 'bottom'; - } else if (dir === 'bottom') { - return 'top'; - } -} -// 设置 elem 相对 elem.ownerDocument 的坐标 -function setLeftTop(elem, offset, option) { - // set position first, in-case top/left are set even on static elem - if (css(elem, 'position') === 'static') { - elem.style.position = 'relative'; - } - var presetH = -999; - var presetV = -999; - var horizontalProperty = getOffsetDirection('left', option); - var verticalProperty = getOffsetDirection('top', option); - var oppositeHorizontalProperty = oppositeOffsetDirection(horizontalProperty); - var oppositeVerticalProperty = oppositeOffsetDirection(verticalProperty); - if (horizontalProperty !== 'left') { - presetH = 999; - } - if (verticalProperty !== 'top') { - presetV = 999; - } - var originalTransition = ''; - var originalOffset = getOffset(elem); - if ('left' in offset || 'top' in offset) { - originalTransition = getTransitionProperty(elem) || ''; - setTransitionProperty(elem, 'none'); + + + + +var Menu_Menu = function (_React$Component) { + inherits_default()(Menu, _React$Component); + + function Menu(props) { + classCallCheck_default()(this, Menu); + + var _this = possibleConstructorReturn_default()(this, _React$Component.call(this, props)); + + Menu__initialiseProps.call(_this); + + _this.isRootMenu = true; + + var selectedKeys = props.defaultSelectedKeys; + var openKeys = props.defaultOpenKeys; + if ('selectedKeys' in props) { + selectedKeys = props.selectedKeys || []; + } + if ('openKeys' in props) { + openKeys = props.openKeys || []; + } + + _this.store = Object(mini_store_lib["create"])({ + selectedKeys: selectedKeys, + openKeys: openKeys, + activeKey: { '0-menu-': SubPopupMenu_getActiveKey(props, props.activeKey) } + }); + return _this; } - if ('left' in offset) { - elem.style[oppositeHorizontalProperty] = ''; - elem.style[horizontalProperty] = presetH + 'px'; - } - if ('top' in offset) { - elem.style[oppositeVerticalProperty] = ''; - elem.style[verticalProperty] = presetV + 'px'; - } - // force relayout - forceRelayout(elem); - var old = getOffset(elem); - var originalStyle = {}; - for (var key in offset) { - if (offset.hasOwnProperty(key)) { - var dir = getOffsetDirection(key, option); - var preset = key === 'left' ? presetH : presetV; - var off = originalOffset[key] - old[key]; - if (dir === key) { - originalStyle[dir] = preset + off; - } else { - originalStyle[dir] = preset - off; - } - } - } - css(elem, originalStyle); - // force relayout - forceRelayout(elem); - if ('left' in offset || 'top' in offset) { - setTransitionProperty(elem, originalTransition); - } - var ret = {}; - for (var _key in offset) { - if (offset.hasOwnProperty(_key)) { - var _dir = getOffsetDirection(_key, option); - var _off = offset[_key] - originalOffset[_key]; - if (_key === _dir) { - ret[_dir] = originalStyle[_dir] + _off; - } else { - ret[_dir] = originalStyle[_dir] - _off; - } - } - } - css(elem, ret); -} - -function utils_setTransform(elem, offset) { - var originalOffset = getOffset(elem); - var originalXY = getTransformXY(elem); - var resultXY = { x: originalXY.x, y: originalXY.y }; - if ('left' in offset) { - resultXY.x = originalXY.x + offset.left - originalOffset.left; - } - if ('top' in offset) { - resultXY.y = originalXY.y + offset.top - originalOffset.top; - } - setTransformXY(elem, resultXY); -} - -function utils_setOffset(elem, offset, option) { - if (option.ignoreShake) { - var oriOffset = getOffset(elem); - - var oLeft = oriOffset.left.toFixed(0); - var oTop = oriOffset.top.toFixed(0); - var tLeft = offset.left.toFixed(0); - var tTop = offset.top.toFixed(0); - - if (oLeft === tLeft && oTop === tTop) { - return; - } - } - - if (option.useCssRight || option.useCssBottom) { - setLeftTop(elem, offset, option); - } else if (option.useCssTransform && getTransformName() in document.body.style) { - utils_setTransform(elem, offset, option); - } else { - setLeftTop(elem, offset, option); - } -} - -function each(arr, fn) { - for (var i = 0; i < arr.length; i++) { - fn(arr[i]); - } -} - -function isBorderBoxFn(elem) { - return getComputedStyleX(elem, 'boxSizing') === 'border-box'; -} - -var BOX_MODELS = ['margin', 'border', 'padding']; -var CONTENT_INDEX = -1; -var PADDING_INDEX = 2; -var BORDER_INDEX = 1; -var MARGIN_INDEX = 0; - -function swap(elem, options, callback) { - var old = {}; - var style = elem.style; - var name = void 0; - - // Remember the old values, and insert the new ones - for (name in options) { - if (options.hasOwnProperty(name)) { - old[name] = style[name]; - style[name] = options[name]; - } - } - - callback.call(elem); - - // Revert the old values - for (name in options) { - if (options.hasOwnProperty(name)) { - style[name] = old[name]; - } - } -} - -function getPBMWidth(elem, props, which) { - var value = 0; - var prop = void 0; - var j = void 0; - var i = void 0; - for (j = 0; j < props.length; j++) { - prop = props[j]; - if (prop) { - for (i = 0; i < which.length; i++) { - var cssProp = void 0; - if (prop === 'border') { - cssProp = '' + prop + which[i] + 'Width'; - } else { - cssProp = prop + which[i]; - } - value += parseFloat(getComputedStyleX(elem, cssProp)) || 0; - } - } - } - return value; -} - -var domUtils = {}; - -each(['Width', 'Height'], function (name) { - domUtils['doc' + name] = function (refWin) { - var d = refWin.document; - return Math.max( - // firefox chrome documentElement.scrollHeight< body.scrollHeight - // ie standard mode : documentElement.scrollHeight> body.scrollHeight - d.documentElement['scroll' + name], - // quirks : documentElement.scrollHeight 最大等于可视窗口多一点? - d.body['scroll' + name], domUtils['viewport' + name](d)); - }; - - domUtils['viewport' + name] = function (win) { - // pc browser includes scrollbar in window.innerWidth - var prop = 'client' + name; - var doc = win.document; - var body = doc.body; - var documentElement = doc.documentElement; - var documentElementProp = documentElement[prop]; - // 标准模式取 documentElement - // backcompat 取 body - return doc.compatMode === 'CSS1Compat' && documentElementProp || body && body[prop] || documentElementProp; - }; -}); - -/* - 得到元素的大小信息 - @param elem - @param name - @param {String} [extra] 'padding' : (css width) + padding - 'border' : (css width) + padding + border - 'margin' : (css width) + padding + border + margin - */ -function getWH(elem, name, ex) { - var extra = ex; - if (isWindow(elem)) { - return name === 'width' ? domUtils.viewportWidth(elem) : domUtils.viewportHeight(elem); - } else if (elem.nodeType === 9) { - return name === 'width' ? domUtils.docWidth(elem) : domUtils.docHeight(elem); - } - var which = name === 'width' ? ['Left', 'Right'] : ['Top', 'Bottom']; - var borderBoxValue = name === 'width' ? elem.getBoundingClientRect().width : elem.getBoundingClientRect().height; - var computedStyle = getComputedStyleX(elem); - var isBorderBox = isBorderBoxFn(elem, computedStyle); - var cssBoxValue = 0; - if (borderBoxValue === null || borderBoxValue === undefined || borderBoxValue <= 0) { - borderBoxValue = undefined; - // Fall back to computed then un computed css if necessary - cssBoxValue = getComputedStyleX(elem, name); - if (cssBoxValue === null || cssBoxValue === undefined || Number(cssBoxValue) < 0) { - cssBoxValue = elem.style[name] || 0; - } - // Normalize '', auto, and prepare for extra - cssBoxValue = parseFloat(cssBoxValue) || 0; - } - if (extra === undefined) { - extra = isBorderBox ? BORDER_INDEX : CONTENT_INDEX; - } - var borderBoxValueOrIsBorderBox = borderBoxValue !== undefined || isBorderBox; - var val = borderBoxValue || cssBoxValue; - if (extra === CONTENT_INDEX) { - if (borderBoxValueOrIsBorderBox) { - return val - getPBMWidth(elem, ['border', 'padding'], which, computedStyle); - } - return cssBoxValue; - } else if (borderBoxValueOrIsBorderBox) { - if (extra === BORDER_INDEX) { - return val; - } - return val + (extra === PADDING_INDEX ? -getPBMWidth(elem, ['border'], which, computedStyle) : getPBMWidth(elem, ['margin'], which, computedStyle)); - } - return cssBoxValue + getPBMWidth(elem, BOX_MODELS.slice(extra), which, computedStyle); -} - -var cssShow = { - position: 'absolute', - visibility: 'hidden', - display: 'block' -}; - -// fix #119 : https://github.com/kissyteam/kissy/issues/119 -function getWHIgnoreDisplay() { - for (var _len = arguments.length, args = Array(_len), _key2 = 0; _key2 < _len; _key2++) { - args[_key2] = arguments[_key2]; - } - - var val = void 0; - var elem = args[0]; - // in case elem is window - // elem.offsetWidth === undefined - if (elem.offsetWidth !== 0) { - val = getWH.apply(undefined, args); - } else { - swap(elem, cssShow, function () { - val = getWH.apply(undefined, args); - }); - } - return val; -} - -each(['width', 'height'], function (name) { - var first = name.charAt(0).toUpperCase() + name.slice(1); - domUtils['outer' + first] = function (el, includeMargin) { - return el && getWHIgnoreDisplay(el, name, includeMargin ? MARGIN_INDEX : BORDER_INDEX); - }; - var which = name === 'width' ? ['Left', 'Right'] : ['Top', 'Bottom']; - - domUtils[name] = function (elem, v) { - var val = v; - if (val !== undefined) { - if (elem) { - var computedStyle = getComputedStyleX(elem); - var isBorderBox = isBorderBoxFn(elem); - if (isBorderBox) { - val += getPBMWidth(elem, ['padding', 'border'], which, computedStyle); - } - return css(elem, name, val); - } - return undefined; - } - return elem && getWHIgnoreDisplay(elem, name, CONTENT_INDEX); - }; -}); - -function mix(to, from) { - for (var i in from) { - if (from.hasOwnProperty(i)) { - to[i] = from[i]; - } - } - return to; -} - -var utils = { - getWindow: function getWindow(node) { - if (node && node.document && node.setTimeout) { - return node; - } - var doc = node.ownerDocument || node; - return doc.defaultView || doc.parentWindow; - }, - - getDocument: getDocument, - offset: function offset(el, value, option) { - if (typeof value !== 'undefined') { - utils_setOffset(el, value, option || {}); - } else { - return getOffset(el); - } - }, - - isWindow: isWindow, - each: each, - css: css, - clone: function clone(obj) { - var i = void 0; - var ret = {}; - for (i in obj) { - if (obj.hasOwnProperty(i)) { - ret[i] = obj[i]; - } - } - var overflow = obj.overflow; - if (overflow) { - for (i in obj) { - if (obj.hasOwnProperty(i)) { - ret.overflow[i] = obj.overflow[i]; - } - } - } - return ret; - }, - - mix: mix, - getWindowScrollLeft: function getWindowScrollLeft(w) { - return getScrollLeft(w); - }, - getWindowScrollTop: function getWindowScrollTop(w) { - return getScrollTop(w); - }, - merge: function merge() { - var ret = {}; - - for (var _len2 = arguments.length, args = Array(_len2), _key3 = 0; _key3 < _len2; _key3++) { - args[_key3] = arguments[_key3]; - } - - for (var i = 0; i < args.length; i++) { - utils.mix(ret, args[i]); - } - return ret; - }, - - viewportWidth: 0, - viewportHeight: 0 -}; - -mix(utils, domUtils); - -/* harmony default export */ var es_utils = (utils); -// CONCATENATED MODULE: ../node_modules/dom-align/es/getOffsetParent.js - - -/** - * 得到会导致元素显示不全的祖先元素 - */ - -function getOffsetParent(element) { - if (es_utils.isWindow(element) || element.nodeType === 9) { - return null; - } - // ie 这个也不是完全可行 - /* -
- */ - // element.offsetParent does the right thing in ie7 and below. Return parent with layout! - // In other browsers it only includes elements with position absolute, relative or - // fixed, not elements with overflow set to auto or scroll. - // if (UA.ie && ieMode < 8) { - // return element.offsetParent; - // } - // 统一的 offsetParent 方法 - var doc = es_utils.getDocument(element); - var body = doc.body; - var parent = void 0; - var positionStyle = es_utils.css(element, 'position'); - var skipStatic = positionStyle === 'fixed' || positionStyle === 'absolute'; - - if (!skipStatic) { - return element.nodeName.toLowerCase() === 'html' ? null : element.parentNode; - } - - for (parent = element.parentNode; parent && parent !== body; parent = parent.parentNode) { - positionStyle = es_utils.css(parent, 'position'); - if (positionStyle !== 'static') { - return parent; - } - } - return null; -} - -/* harmony default export */ var es_getOffsetParent = (getOffsetParent); -// CONCATENATED MODULE: ../node_modules/dom-align/es/isAncestorFixed.js - - -function isAncestorFixed(element) { - if (es_utils.isWindow(element) || element.nodeType === 9) { - return false; - } - - var doc = es_utils.getDocument(element); - var body = doc.body; - var parent = null; - for (parent = element.parentNode; parent && parent !== body; parent = parent.parentNode) { - var positionStyle = es_utils.css(parent, 'position'); - if (positionStyle === 'fixed') { - return true; - } - } - return false; -} -// CONCATENATED MODULE: ../node_modules/dom-align/es/getVisibleRectForElement.js - - - - -/** - * 获得元素的显示部分的区域 - */ -function getVisibleRectForElement(element) { - var visibleRect = { - left: 0, - right: Infinity, - top: 0, - bottom: Infinity - }; - var el = es_getOffsetParent(element); - var doc = es_utils.getDocument(element); - var win = doc.defaultView || doc.parentWindow; - var body = doc.body; - var documentElement = doc.documentElement; - - // Determine the size of the visible rect by climbing the dom accounting for - // all scrollable containers. - while (el) { - // clientWidth is zero for inline block elements in ie. - if ((navigator.userAgent.indexOf('MSIE') === -1 || el.clientWidth !== 0) && - // body may have overflow set on it, yet we still get the entire - // viewport. In some browsers, el.offsetParent may be - // document.documentElement, so check for that too. - el !== body && el !== documentElement && es_utils.css(el, 'overflow') !== 'visible') { - var pos = es_utils.offset(el); - // add border - pos.left += el.clientLeft; - pos.top += el.clientTop; - visibleRect.top = Math.max(visibleRect.top, pos.top); - visibleRect.right = Math.min(visibleRect.right, - // consider area without scrollBar - pos.left + el.clientWidth); - visibleRect.bottom = Math.min(visibleRect.bottom, pos.top + el.clientHeight); - visibleRect.left = Math.max(visibleRect.left, pos.left); - } else if (el === body || el === documentElement) { - break; - } - el = es_getOffsetParent(el); - } - - // Set element position to fixed - // make sure absolute element itself don't affect it's visible area - // https://github.com/ant-design/ant-design/issues/7601 - var originalPosition = null; - if (!es_utils.isWindow(element) && element.nodeType !== 9) { - originalPosition = element.style.position; - var position = es_utils.css(element, 'position'); - if (position === 'absolute') { - element.style.position = 'fixed'; - } - } - - var scrollX = es_utils.getWindowScrollLeft(win); - var scrollY = es_utils.getWindowScrollTop(win); - var viewportWidth = es_utils.viewportWidth(win); - var viewportHeight = es_utils.viewportHeight(win); - var documentWidth = documentElement.scrollWidth; - var documentHeight = documentElement.scrollHeight; - - // Reset element position after calculate the visible area - if (element.style) { - element.style.position = originalPosition; - } - - if (isAncestorFixed(element)) { - // Clip by viewport's size. - visibleRect.left = Math.max(visibleRect.left, scrollX); - visibleRect.top = Math.max(visibleRect.top, scrollY); - visibleRect.right = Math.min(visibleRect.right, scrollX + viewportWidth); - visibleRect.bottom = Math.min(visibleRect.bottom, scrollY + viewportHeight); - } else { - // Clip by document's size. - var maxVisibleWidth = Math.max(documentWidth, scrollX + viewportWidth); - visibleRect.right = Math.min(visibleRect.right, maxVisibleWidth); - - var maxVisibleHeight = Math.max(documentHeight, scrollY + viewportHeight); - visibleRect.bottom = Math.min(visibleRect.bottom, maxVisibleHeight); - } - - return visibleRect.top >= 0 && visibleRect.left >= 0 && visibleRect.bottom > visibleRect.top && visibleRect.right > visibleRect.left ? visibleRect : null; -} - -/* harmony default export */ var es_getVisibleRectForElement = (getVisibleRectForElement); -// CONCATENATED MODULE: ../node_modules/dom-align/es/adjustForViewport.js - - -function adjustForViewport(elFuturePos, elRegion, visibleRect, overflow) { - var pos = es_utils.clone(elFuturePos); - var size = { - width: elRegion.width, - height: elRegion.height - }; - - if (overflow.adjustX && pos.left < visibleRect.left) { - pos.left = visibleRect.left; - } - - // Left edge inside and right edge outside viewport, try to resize it. - if (overflow.resizeWidth && pos.left >= visibleRect.left && pos.left + size.width > visibleRect.right) { - size.width -= pos.left + size.width - visibleRect.right; - } - - // Right edge outside viewport, try to move it. - if (overflow.adjustX && pos.left + size.width > visibleRect.right) { - // 保证左边界和可视区域左边界对齐 - pos.left = Math.max(visibleRect.right - size.width, visibleRect.left); - } - - // Top edge outside viewport, try to move it. - if (overflow.adjustY && pos.top < visibleRect.top) { - pos.top = visibleRect.top; - } - - // Top edge inside and bottom edge outside viewport, try to resize it. - if (overflow.resizeHeight && pos.top >= visibleRect.top && pos.top + size.height > visibleRect.bottom) { - size.height -= pos.top + size.height - visibleRect.bottom; - } - - // Bottom edge outside viewport, try to move it. - if (overflow.adjustY && pos.top + size.height > visibleRect.bottom) { - // 保证上边界和可视区域上边界对齐 - pos.top = Math.max(visibleRect.bottom - size.height, visibleRect.top); - } - - return es_utils.mix(pos, size); -} - -/* harmony default export */ var es_adjustForViewport = (adjustForViewport); -// CONCATENATED MODULE: ../node_modules/dom-align/es/getRegion.js - - -function getRegion(node) { - var offset = void 0; - var w = void 0; - var h = void 0; - if (!es_utils.isWindow(node) && node.nodeType !== 9) { - offset = es_utils.offset(node); - w = es_utils.outerWidth(node); - h = es_utils.outerHeight(node); - } else { - var win = es_utils.getWindow(node); - offset = { - left: es_utils.getWindowScrollLeft(win), - top: es_utils.getWindowScrollTop(win) - }; - w = es_utils.viewportWidth(win); - h = es_utils.viewportHeight(win); - } - offset.width = w; - offset.height = h; - return offset; -} - -/* harmony default export */ var es_getRegion = (getRegion); -// CONCATENATED MODULE: ../node_modules/dom-align/es/getAlignOffset.js -/** - * 获取 node 上的 align 对齐点 相对于页面的坐标 - */ - -function getAlignOffset(region, align) { - var V = align.charAt(0); - var H = align.charAt(1); - var w = region.width; - var h = region.height; - - var x = region.left; - var y = region.top; - - if (V === 'c') { - y += h / 2; - } else if (V === 'b') { - y += h; - } - - if (H === 'c') { - x += w / 2; - } else if (H === 'r') { - x += w; - } - - return { - left: x, - top: y - }; -} - -/* harmony default export */ var es_getAlignOffset = (getAlignOffset); -// CONCATENATED MODULE: ../node_modules/dom-align/es/getElFuturePos.js - - -function getElFuturePos(elRegion, refNodeRegion, points, offset, targetOffset) { - var p1 = es_getAlignOffset(refNodeRegion, points[1]); - var p2 = es_getAlignOffset(elRegion, points[0]); - var diff = [p2.left - p1.left, p2.top - p1.top]; - - return { - left: elRegion.left - diff[0] + offset[0] - targetOffset[0], - top: elRegion.top - diff[1] + offset[1] - targetOffset[1] - }; -} - -/* harmony default export */ var es_getElFuturePos = (getElFuturePos); -// CONCATENATED MODULE: ../node_modules/dom-align/es/align/align.js -/** - * align dom node flexibly - * @author yiminghe@gmail.com - */ - - - - - - - -// http://yiminghe.iteye.com/blog/1124720 - -function isFailX(elFuturePos, elRegion, visibleRect) { - return elFuturePos.left < visibleRect.left || elFuturePos.left + elRegion.width > visibleRect.right; -} - -function isFailY(elFuturePos, elRegion, visibleRect) { - return elFuturePos.top < visibleRect.top || elFuturePos.top + elRegion.height > visibleRect.bottom; -} - -function isCompleteFailX(elFuturePos, elRegion, visibleRect) { - return elFuturePos.left > visibleRect.right || elFuturePos.left + elRegion.width < visibleRect.left; -} - -function isCompleteFailY(elFuturePos, elRegion, visibleRect) { - return elFuturePos.top > visibleRect.bottom || elFuturePos.top + elRegion.height < visibleRect.top; -} - -function flip(points, reg, map) { - var ret = []; - es_utils.each(points, function (p) { - ret.push(p.replace(reg, function (m) { - return map[m]; - })); - }); - return ret; -} - -function flipOffset(offset, index) { - offset[index] = -offset[index]; - return offset; -} - -function convertOffset(str, offsetLen) { - var n = void 0; - if (/%$/.test(str)) { - n = parseInt(str.substring(0, str.length - 1), 10) / 100 * offsetLen; - } else { - n = parseInt(str, 10); - } - return n || 0; -} - -function normalizeOffset(offset, el) { - offset[0] = convertOffset(offset[0], el.width); - offset[1] = convertOffset(offset[1], el.height); -} - -/** - * @param el - * @param tgtRegion 参照节点所占的区域: { left, top, width, height } - * @param align - */ -function doAlign(el, tgtRegion, align, isTgtRegionVisible) { - var points = align.points; - var offset = align.offset || [0, 0]; - var targetOffset = align.targetOffset || [0, 0]; - var overflow = align.overflow; - var source = align.source || el; - offset = [].concat(offset); - targetOffset = [].concat(targetOffset); - overflow = overflow || {}; - var newOverflowCfg = {}; - var fail = 0; - // 当前节点可以被放置的显示区域 - var visibleRect = es_getVisibleRectForElement(source); - // 当前节点所占的区域, left/top/width/height - var elRegion = es_getRegion(source); - // 将 offset 转换成数值,支持百分比 - normalizeOffset(offset, elRegion); - normalizeOffset(targetOffset, tgtRegion); - // 当前节点将要被放置的位置 - var elFuturePos = es_getElFuturePos(elRegion, tgtRegion, points, offset, targetOffset); - // 当前节点将要所处的区域 - var newElRegion = es_utils.merge(elRegion, elFuturePos); - - // 如果可视区域不能完全放置当前节点时允许调整 - if (visibleRect && (overflow.adjustX || overflow.adjustY) && isTgtRegionVisible) { - if (overflow.adjustX) { - // 如果横向不能放下 - if (isFailX(elFuturePos, elRegion, visibleRect)) { - // 对齐位置反下 - var newPoints = flip(points, /[lr]/ig, { - l: 'r', - r: 'l' - }); - // 偏移量也反下 - var newOffset = flipOffset(offset, 0); - var newTargetOffset = flipOffset(targetOffset, 0); - var newElFuturePos = es_getElFuturePos(elRegion, tgtRegion, newPoints, newOffset, newTargetOffset); - - if (!isCompleteFailX(newElFuturePos, elRegion, visibleRect)) { - fail = 1; - points = newPoints; - offset = newOffset; - targetOffset = newTargetOffset; - } - } - } - - if (overflow.adjustY) { - // 如果纵向不能放下 - if (isFailY(elFuturePos, elRegion, visibleRect)) { - // 对齐位置反下 - var _newPoints = flip(points, /[tb]/ig, { - t: 'b', - b: 't' - }); - // 偏移量也反下 - var _newOffset = flipOffset(offset, 1); - var _newTargetOffset = flipOffset(targetOffset, 1); - var _newElFuturePos = es_getElFuturePos(elRegion, tgtRegion, _newPoints, _newOffset, _newTargetOffset); - - if (!isCompleteFailY(_newElFuturePos, elRegion, visibleRect)) { - fail = 1; - points = _newPoints; - offset = _newOffset; - targetOffset = _newTargetOffset; - } - } - } - - // 如果失败,重新计算当前节点将要被放置的位置 - if (fail) { - elFuturePos = es_getElFuturePos(elRegion, tgtRegion, points, offset, targetOffset); - es_utils.mix(newElRegion, elFuturePos); - } - var isStillFailX = isFailX(elFuturePos, elRegion, visibleRect); - var isStillFailY = isFailY(elFuturePos, elRegion, visibleRect); - // 检查反下后的位置是否可以放下了,如果仍然放不下: - // 1. 复原修改过的定位参数 - if (isStillFailX || isStillFailY) { - points = align.points; - offset = align.offset || [0, 0]; - targetOffset = align.targetOffset || [0, 0]; - } - // 2. 只有指定了可以调整当前方向才调整 - newOverflowCfg.adjustX = overflow.adjustX && isStillFailX; - newOverflowCfg.adjustY = overflow.adjustY && isStillFailY; - - // 确实要调整,甚至可能会调整高度宽度 - if (newOverflowCfg.adjustX || newOverflowCfg.adjustY) { - newElRegion = es_adjustForViewport(elFuturePos, elRegion, visibleRect, newOverflowCfg); - } - } - - // need judge to in case set fixed with in css on height auto element - if (newElRegion.width !== elRegion.width) { - es_utils.css(source, 'width', es_utils.width(source) + newElRegion.width - elRegion.width); - } - - if (newElRegion.height !== elRegion.height) { - es_utils.css(source, 'height', es_utils.height(source) + newElRegion.height - elRegion.height); - } - - // https://github.com/kissyteam/kissy/issues/190 - // 相对于屏幕位置没变,而 left/top 变了 - // 例如]*>/,s={tr:document.createElement("tbody"),tbody:o,thead:o,tfoot:o,td:i,th:i,"*":document.createElement("div")};e.exports={getBoundingClientRect:function(e,t){if(e&&e.getBoundingClientRect){var n=e.getBoundingClientRect(),r=document.documentElement.clientTop,o=document.documentElement.clientLeft;return{top:n.top-r,bottom:n.bottom-r,left:n.left-o,right:n.right-o}}return t||null},getStyle:function(e,t,n){try{return window.getComputedStyle?window.getComputedStyle(e,null)[t]:e.currentStyle[t]}catch(e){return r.isNil(n)?null:n}},modifyCSS:function(e,t){if(e)for(var n in t)t.hasOwnProperty(n)&&(e.style[n]=t[n]);return e},createDom:function(e){var t=a.test(e)&&RegExp.$1;t in s||(t="*");var n=s[t];e=e.replace(/(^\s*)|(\s*$)/g,""),n.innerHTML=""+e;var r=n.childNodes[0];return n.removeChild(r),r},getRatio:function(){return window.devicePixelRatio?window.devicePixelRatio:2},getWidth:function(e,t){var n=this.getStyle(e,"width",t);return"auto"===n&&(n=e.offsetWidth),parseFloat(n)},getHeight:function(e,t){var n=this.getStyle(e,"height",t);return"auto"===n&&(n=e.offsetHeight),parseFloat(n)},getOuterHeight:function(e,t){var n=this.getHeight(e,t),r=parseFloat(this.getStyle(e,"borderTopWidth"))||0,o=parseFloat(this.getStyle(e,"paddingTop"))||0,i=parseFloat(this.getStyle(e,"paddingBottom"))||0;return n+r+(parseFloat(this.getStyle(e,"borderBottomWidth"))||0)+o+i},getOuterWidth:function(e,t){var n=this.getWidth(e,t),r=parseFloat(this.getStyle(e,"borderLeftWidth"))||0,o=parseFloat(this.getStyle(e,"paddingLeft"))||0,i=parseFloat(this.getStyle(e,"paddingRight"))||0;return n+r+(parseFloat(this.getStyle(e,"borderRightWidth"))||0)+o+i},addEventListener:function(e,t,n){if(e){if(e.addEventListener)return e.addEventListener(t,n,!1),{remove:function(){e.removeEventListener(t,n,!1)}};if(e.attachEvent)return e.attachEvent("on"+t,n),{remove:function(){e.detachEvent("on"+t,n)}}}},requestAnimationFrame:function(e){return(window.requestAnimationFrame||window.webkitRequestAnimationFrame||function(e){return setTimeout(e,16)})(e)}}},function(e,t,n){var r=n(0),o=function(e,t,n,r){this.type=e,this.target=null,this.currentTarget=null,this.bubbles=n,this.cancelable=r,this.timeStamp=(new Date).getTime(),this.defaultPrevented=!1,this.propagationStopped=!1,this.removed=!1,this.event=t};r.augment(o,{preventDefault:function(){this.defaultPrevented=this.cancelable&&!0},stopPropagation:function(){this.propagationStopped=!0},remove:function(){this.remove=!0},clone:function(){return r.clone(this)},toString:function(){return"[Event (type="+this.type+")]"}}),e.exports=o},function(e,t,n){function r(e,t,n){for(var r=void 0,o=e.length-1;o>=0;o--){var i=e[o];if(i.__cfg.visible&&i.__cfg.capture&&(i.isGroup?r=i.getShape(t,n):i.isHit(t,n)&&(r=i)),r)break}return r}function o(e){return function(t,n){var r=e(t,n);return 0===r?t[c]-n[c]:r}}function i(e){if(!e.__cfg&&e!==f){var t=e.superclass.constructor;t&&!t.__cfg&&i(t),e.__cfg={},a.merge(e.__cfg,t.__cfg),a.merge(e.__cfg,e.CFG)}}var a=n(0),s=n(89),u=n(263),l={},c="_INDEX",f=function e(t){e.superclass.constructor.call(this,t),this.set("children",[]),this._beforeRenderUI(),this._renderUI(),this._bindUI()};a.extend(f,s),a.augment(f,{isGroup:!0,canFill:!0,canStroke:!0,getDefaultCfg:function(){return i(this.constructor),a.merge({},this.constructor.__cfg)},_beforeRenderUI:function(){},_renderUI:function(){},_bindUI:function(){},addShape:function(e,t){var n=this.get("canvas");t=t||{};var r=l[e];if(r||(r=a.upperFirst(e),l[e]=r),t.attrs){var o=t.attrs;if("text"===e){var i=n.get("fontFamily");i&&(o.fontFamily=o.fontFamily?o.fontFamily:i)}}t.canvas=n,t.type=e;var s=new u[r](t);return this.add(s),s},addGroup:function(e,t){var n=this.get("canvas"),r=void 0;if(t=a.merge({},t),a.isFunction(e))t?(t.canvas=n,t.parent=this,r=new e(t)):r=new e({canvas:n,parent:this}),this.add(r);else if(a.isObject(e))e.canvas=n,r=new f(e),this.add(r);else{if(void 0!==e)return!1;r=new f,this.add(r)}return r},renderBack:function(e,t){var n=this.get("backShape"),r=this.getBBox();return a.merge(t,{x:r.minX-e[3],y:r.minY-e[0],width:r.width+e[1]+e[3],height:r.height+e[0]+e[2]}),n?n.attr(t):n=this.addShape("rect",{zIndex:-1,attrs:t}),this.set("backShape",n),this.sort(),n},removeChild:function(e,t){if(arguments.length>=2)this.contain(e)&&e.remove(t);else{if(1===arguments.length){if(!a.isBoolean(e))return this.contain(e)&&e.remove(!0),this;t=e}0===arguments.length&&(t=!0),f.superclass.remove.call(this,t)}return this},add:function(e){var t=this,n=t.get("children");if(a.isArray(e))a.each(e,function(e){var n=e.get("parent");n&&n.removeChild(e,!1),t.__setEvn(e)}),n.push.apply(n,e);else{var r=e,o=r.get("parent");o&&o.removeChild(r,!1),t.__setEvn(r),n.push(r)}return t},contain:function(e){return this.get("children").indexOf(e)>-1},getChildByIndex:function(e){return this.get("children")[e]},getFirst:function(){return this.getChildByIndex(0)},getLast:function(){var e=this.get("children").length-1;return this.getChildByIndex(e)},__setEvn:function(e){var t=this;e.__cfg.parent=t,e.__cfg.context=t.__cfg.context,e.__cfg.canvas=t.__cfg.canvas;var n=e.__attrs.clip;n&&(n.setSilent("parent",t),n.setSilent("context",t.get("context")));var r=e.__cfg.children;r&&a.each(r,function(t){e.__setEvn(t)})},getBBox:function(){var e=this,t=1/0,n=-1/0,r=1/0,o=-1/0,i=e.get("children");a.each(i,function(e){if(e.get("visible")){var i=e.getBBox();if(!i)return!0;var a=[i.minX,i.minY,1],s=[i.minX,i.maxY,1],u=[i.maxX,i.minY,1],l=[i.maxX,i.maxY,1];e.apply(a),e.apply(s),e.apply(u),e.apply(l);var c=Math.min(a[0],s[0],u[0],l[0]),f=Math.max(a[0],s[0],u[0],l[0]),p=Math.min(a[1],s[1],u[1],l[1]),d=Math.max(a[1],s[1],u[1],l[1]);c 1&&!l&&(a=o[c-2].endPoint,u=o[c-1].endPoint,s.addEndArrow(e,n,a.x,a.y,u.x,u.y))}}}),e.exports=c},function(e,t,n){function r(e,t,n){return{x:n.x+e,y:n.y+t}}function o(e,t){return{x:t.x+(t.x-e.x),y:t.y+(t.y-e.y)}}function i(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1])}function a(e,t){return(e[0]*t[0]+e[1]*t[1])/(i(e)*i(t))}function s(e,t){return(e[0]*t[1] -1}var o=n(65);e.exports=r},function(e,t,n){(function(t){var n="object"==typeof t&&t&&t.Object===Object&&t;e.exports=n}).call(t,n(446))},function(e,t,n){var r=n(38),o=r(Object.keys,Object);e.exports=o},function(e,t,n){var r=n(38),o=r(Object.getPrototypeOf,Object);e.exports=o},function(e,t){function n(){return!1}e.exports=n},function(e,t){function n(e,t){var n=typeof e;return!!(t=null==t?r:t)&&("number"==n||"symbol"!=n&&o.test(e))&&e>-1&&e%1==0&&e -1}return!1},t.prototype._getRange=function(e,t){var n=e+t;return n=n>100?100:n,n=n<0?0:n},t.prototype._updateStatus=function(e,t){var n="x"===e?this.get("width"):this.get("height");e=a.upperFirst(e);var r=this.get("range"),o=this.get("page"+e),i=this.get("currentTarget"),s=this.get("rangeStash"),u=this.get("layout"),l="vertical"===u?-1:1,c=t["page"+e],f=c-o,p=f/n*100*l,d=void 0;r[1]<=r[0]?(this._isElement(i,"minHandleElement")||this._isElement(i,"maxHandleElement"))&&(r[0]=this._getRange(p,r[0]),r[1]=this._getRange(p,r[0])):(this._isElement(i,"minHandleElement")&&(r[0]=this._getRange(p,r[0])),this._isElement(i,"maxHandleElement")&&(r[1]=this._getRange(p,r[1]))),this._isElement(i,"middleHandleElement")&&(d=s[1]-s[0],r[0]=this._getRange(p,r[0]),r[1]=r[0]+d,r[1]>100&&(r[1]=100,r[0]=r[1]-d)),this.emit("sliderchange",{range:r}),this.set("page"+e,c),this._renderUI(),this.get("canvas").draw()},t.prototype._onMouseDown=function(e){var t=e.currentTarget,n=e.event,r=this.get("range");n.stopPropagation(),n.preventDefault(),this.set("pageX",n.pageX),this.set("pageY",n.pageY),this.set("currentTarget",t),this.set("rangeStash",[r[0],r[1]]),this._bindCanvasEvents()},t.prototype._bindCanvasEvents=function(){var e=this.get("canvas").get("containerDOM");this.onMouseMoveListener=l.addEventListener(e,"mousemove",a.wrapBehavior(this,"_onCanvasMouseMove")),this.onMouseUpListener=l.addEventListener(e,"mouseup",a.wrapBehavior(this,"_onCanvasMouseUp"))},t.prototype._onCanvasMouseMove=function(e){"horizontal"===this.get("layout")?this._updateStatus("x",e):this._updateStatus("y",e)},t.prototype._onCanvasMouseUp=function(){this._removeDocumentEvents()},t.prototype._removeDocumentEvents=function(){this.onMouseMoveListener.remove(),this.onMouseUpListener.remove()},t}(u);e.exports=c},function(e,t,n){function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var a=n(0),s=n(2),u=s.Group,l=function(e){function t(){return r(this,t),o(this,e.apply(this,arguments))}return i(t,e),t.prototype.getDefaultCfg=function(){return{type:"plotBack",padding:null,background:null,plotRange:null,plotBackground:null}},t.prototype._beforeRenderUI=function(){this._calculateRange()},t.prototype._renderUI=function(){this._renderBackground(),this._renderPlotBackground()},t.prototype._renderBackground=function(){var e=this,t=e.get("background");if(t){var n=this.get("canvas"),r=e.get("width")||n.get("width"),o=e.get("height")||n.get("height"),i={x:0,y:0,width:r,height:o},s=e.get("backgroundShape");s?s.attr(i):(s=this.addShape("rect",{attrs:a.mix(i,t)}),this.set("backgroundShape",s))}},t.prototype._renderPlotBackground=function(){var e=this,t=e.get("plotBackground");if(t){var n=e.get("plotRange"),r=n.br.x-n.bl.x,o=n.br.y-n.tr.y,i=n.tl,s={x:i.x,y:i.y,width:r,height:o},u=e.get("plotBackShape");u?u.attr(s):(t.image?(s.img=t.image,u=e.addShape("image",{attrs:s})):(a.mix(s,t),u=e.addShape("rect",{attrs:s})),e.set("plotBackShape",u))}},t.prototype._convert=function(e,t){if(a.isString(e))if("auto"===e)e=0;else if(-1!==e.indexOf("%")){var n=this.get("canvas"),r=this.get("width")||n.get("width"),o=this.get("height")||n.get("height");e=parseInt(e,10)/100,e=t?e*r:e*o}return e},t.prototype._calculateRange=function(){var e=this,t=e.get("plotRange");a.isNil(t)&&(t={});var n=e.get("padding"),r=this.get("canvas"),o=e.get("width")||r.get("width"),i=e.get("height")||r.get("height"),s=a.toAllPadding(n),u=e._convert(s[0],!1),l=e._convert(s[1],!0),c=e._convert(s[2],!1),f=e._convert(s[3],!0),p=Math.min(f,o-l),d=Math.max(f,o-l),h=Math.min(i-c,u),v=Math.max(i-c,u);t.tl={x:p,y:h},t.tr={x:d,y:h},t.bl={x:p,y:v},t.br={x:d,y:v},t.cc={x:(d+p)/2,y:(v+h)/2},this.set("plotRange",t)},t.prototype.repaint=function(){return this._calculateRange(),this._renderBackground(),this._renderPlotBackground(),this},t}(u);e.exports=l},function(e,t,n){function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function a(e,t){return e.getElementsByClassName(t)[0]}function s(e,t,n,r,o){var i=n.clientWidth,a=n.clientHeight;return e+i+20>r?(e-=i+20,e=e<0?0:e):e+=20,t+a+20>o?(t-=a+20,t=e<0?0:t):t+=20,[e,t]}function u(e,t,n,r,o){var i=r.clientWidth,a=r.clientHeight,s=0,u=0,l=20;if(o){var c=o.getBBox();s=c.width,u=c.height,e=c.x,t=c.y,l=5}switch(n){case"inside":e=e+s/2-i/2,t=t+u/2-a/2;break;case"top":e=e+s/2-i/2,t=t-a-l;break;case"left":e=e-i-l,t=t+u/2-a/2;break;case"right":e=e+s+l,t=t+u/2-a/2;break;case"bottom":default:e=e+s/2-i/2,t=t+u+l}return[e,t]}function l(e,t,n,r){var o=n.clientWidth,i=n.clientHeight;return e+o>r.tr.x&&(e-=o+40),e l&&(l=f-u);i;)for(d.forEach(function(e){var t=(Math.min.apply(p,e.targets)+Math.max.apply(p,e.targets))/2;e.pos=Math.min(Math.max(p,t-e.size/2),l-e.size)}),i=!1,c=d.length;c--;)if(c>0){var h=d[c-1],v=d[c];h.pos+h.size>v.pos&&(h.size+=v.size,h.targets=h.targets.concat(v.targets),h.pos+h.size>l&&(h.pos=l-h.size),d.splice(c,1),i=!0)}c=0,d.forEach(function(n){var r=u+t/2;n.targets.forEach(function(){e[c].y=n.pos+r,r+=t,c++})}),e.forEach(function(e){var t=e.r*e.r,n=Math.pow(Math.abs(e.y-r.y),2);if(t -1}var o=n(33);e.exports=r},function(e,t,n){function r(e,t){var n=this.__data__,r=o(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}var o=n(33);e.exports=r},function(e,t){function n(e){return e}e.exports=n},function(e,t,n){(function(e){var r=n(123),o="object"==typeof t&&t&&!t.nodeType&&t,i=o&&"object"==typeof e&&e&&!e.nodeType&&e,a=i&&i.exports===o,s=a&&r.process,u=function(){try{var e=i&&i.require&&i.require("util").types;return e||s&&s.binding&&s.binding("util")}catch(e){}}();e.exports=u}).call(t,n(143)(e))},function(e,t){function n(){return[]}e.exports=n},function(e,t,n){function r(e){return i(e)?a(e):o(e)}var o=n(340),i=n(126),a=n(407);e.exports=r},function(e,t,n){var r=n(402),o=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,i=/\\(\\)?/g,a=r(function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(o,function(e,n,r,o){t.push(r?o.replace(i,"$1"):n||e)}),t});e.exports=a},function(e,t){function n(e){return e.split("")}e.exports=n},function(e,t){function n(e){return e.match(r)||[]}var r=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;e.exports=n},function(e,t,n){function r(e){return o(e,i|a)}var o=n(345),i=1,a=4;e.exports=r},function(e,t){function n(e){return e}e.exports=n},function(e,t,n){function r(e,t){return(s(e)?o:i)(e,a(t,3))}var o=n(334),i=n(347),a=n(16),s=n(3);e.exports=r},function(e,t,n){function r(e,t,n){var r=null==e?void 0:o(e,t);return void 0===r?n:r}var o=n(64);e.exports=r},function(e,t,n){var r=n(63),o=n(374),i=Object.prototype,a=i.hasOwnProperty,s=o(function(e,t,n){a.call(e,n)?e[n].push(t):r(e,n,[t])});e.exports=s},function(e,t,n){function r(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var s=null==n?0:i(n);return s<0&&(s=a(r+s,0)),o(e,t,s)}var o=n(65),i=n(140),a=Math.max;e.exports=r},function(e,t,n){function r(e){return i(e)&&o(e)}var o=n(39),i=n(22);e.exports=r},function(e,t,n){var r=n(352),o=n(368),i=n(403),a=i&&i.isDate,s=a?o(a):r;e.exports=s},function(e,t,n){function r(e){if(null==e)return!0;if(u(e)&&(s(e)||"string"==typeof e||"function"==typeof e.splice||l(e)||f(e)||a(e)))return!e.length;var t=i(e);if(t==p||t==d)return!e.size;if(c(e))return!o(e).length;for(var n in e)if(v.call(e,n))return!1;return!0}var o=n(355),i=n(67),a=n(70),s=n(3),u=n(39),l=n(71),c=n(128),f=n(139),p="[object Map]",d="[object Set]",h=Object.prototype,v=h.hasOwnProperty;e.exports=r},function(e,t,n){function r(e,t,n){n="function"==typeof n?n:void 0;var r=n?n(e,t):void 0;return void 0===r?o(e,t,void 0,n):!!r}var o=n(66);e.exports=r},function(e,t,n){function r(e){return"number"==typeof e&&i(e)}var o=n(69),i=o.isFinite;e.exports=r},function(e,t,n){function r(e){if(!i(e))return!1;var t=o(e);return t==s||t==u||t==a||t==l}var o=n(35),i=n(21),a="[object AsyncFunction]",s="[object Function]",u="[object GeneratorFunction]",l="[object Proxy]";e.exports=r},function(e,t){function n(){return!1}e.exports=n},function(e,t,n){function r(e){return o(e)&&e!=+e}var o=n(424);e.exports=r},function(e,t){function n(e){return null===e}e.exports=n},function(e,t,n){function r(e){return"number"==typeof e||i(e)&&o(e)==a}var o=n(35),i=n(22),a="[object Number]";e.exports=r},function(e,t,n){function r(e){if(!a(e)||o(e)!=s)return!1;var t=i(e);if(null===t)return!0;var n=f.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&c.call(n)==p}var o=n(35),i=n(125),a=n(22),s="[object Object]",u=Function.prototype,l=Object.prototype,c=u.toString,f=l.hasOwnProperty,p=c.call(Object);e.exports=r},function(e,t){function n(){return!1}e.exports=n},function(e,t){function n(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t}e.exports=n},function(e,t,n){var r=n(377),o=r("toLowerCase");e.exports=o},function(e,t,n){function r(e,t){return(s(e)?o:a)(e,i(t,3))}var o=n(337),i=n(16),a=n(357),s=n(3);e.exports=r},function(e,t,n){function r(e,t){return e&&e.length?o(e,a(t,2),i):void 0}var o=n(119),i=n(350),a=n(16);e.exports=r},function(e,t,n){function r(e,t){return e&&e.length?o(e,i(t,2),a):void 0}var o=n(119),i=n(16),a=n(356);e.exports=r},function(e,t,n){var r=n(360),o=n(385),i=o(function(e,t){return null==e?{}:r(e,t)});e.exports=i},function(e,t,n){function r(e){return a(e)?o(s(e)):i(e)}var o=n(362),i=n(363),a=n(68),s=n(20);e.exports=r},function(e,t,n){function r(e,t,n){var r=u(e)?o:s,l=arguments.length<3;return r(e,a(t,4),n,l,i)}var o=n(118),i=n(34),a=n(16),s=n(364),u=n(3);e.exports=r},function(e,t,n){function r(){var e=arguments,t=o(e[0]);return e.length<3?t:t.replace(e[1],e[2])}var o=n(23);e.exports=r},function(e,t,n){var r=n(379),o=r("round");e.exports=o},function(e,t){function n(e){return e}e.exports=n},function(e,t,n){var r=n(120),o=n(365),i=n(121),a=n(415),s=o(function(e){return i(r(e,1,a,!0))});e.exports=s},function(e,t,n){function r(e){return e&&e.length?o(e):[]}var o=n(121);e.exports=r},function(e,t,n){var r=n(378),o=r(function(e,t,n){return e+(n?" ":"")+t.toUpperCase()});e.exports=o},function(e,t,n){function r(e,t,n){return e=a(e),t=n?void 0:t,void 0===t?i(e)?s(e):o(e):e.match(t)||[]}var o=n(341),i=n(392),a=n(23),s=n(408);e.exports=r},function(e,t,n){"use strict";function r(e){if(null===e||void 0===e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}var o=Object.getOwnPropertySymbols,i=Object.prototype.hasOwnProperty,a=Object.prototype.propertyIsEnumerable;e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map(function(e){return t[e]}).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach(function(e){r[e]=e}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(e){return!1}}()?Object.assign:function(e,t){for(var n,s,u=r(e),l=1;l =0:f>p;p+=d)p in c&&(s=t(s,c[p],p,l));return s}},FkXd:function(e,t){function n(e){return e&&e.__esModule?e:{default:e}}e.exports=n},Fnm7:function(e,t,n){"use strict";function r(e){var t,n=e.Symbol;return"function"==typeof n?n.observable?t=n.observable:(t=n("observable"),n.observable=t):t="@@observable",t}t.a=r},Fp5l:function(e,t,n){function r(e){return i(e)&&o(e)}var o=n("bGc4"),i=n("UnEC");e.exports=r},FryR:function(e,t,n){var r=n("/whu");e.exports=function(e){return Object(r(e))}},G0Wc:function(e,t,n){function r(e){if(!o(e))return a(e);var t=i(e),n=[];for(var r in e)("constructor"!=r||!t&&u.call(e,r))&&n.push(r);return n}var o=n("yCNF"),i=n("HT7L"),a=n("8gK5"),s=Object.prototype,u=s.hasOwnProperty;e.exports=r},G2xm:function(e,t){function n(e){return this.__data__.has(e)}e.exports=n},G6CJ:function(e,t,n){function r(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var r=i&&o?o(e,n):{};r.get||r.set?i(t,n,r):t[n]=e[n]}return t.default=e,t}var o=n("FKE8"),i=n("lKsG");e.exports=r},G8ar:function(e,t,n){function r(e,t,n){return t===t?a(e,t,n):o(e,i,n)}var o=n("cdq7"),i=n("8++/"),a=n("i6nN");e.exports=r},GDoE:function(e,t){},GKDd:function(e,t,n){"use strict";var r=n("vtiu"),o=(n.n(r),n("DyFj"));n.n(o),n("cwkc"),n("LHBr")},GUYF:function(e,t,n){function r(e,t){return!t||"object"!==o(t)&&"function"!=typeof t?i(e):t}var o=n("q9+U"),i=n("Bymc");e.exports=r},GWr5:function(e,t,n){"use strict";function r(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"vertical";if("undefined"==typeof document||"undefined"==typeof window)return 0;if(re)return re;var t=document.createElement("div");Object.keys(oe).forEach(function(e){t.style[e]=oe[e]}),document.body.appendChild(t);var n=0;return"vertical"===e?n=t.offsetWidth-t.clientWidth:"horizontal"===e&&(n=t.offsetHeight-t.clientHeight),document.body.removeChild(t),re=n}function o(e,t,n){function r(){for(var r=arguments.length,i=Array(r),a=0;a=t[0]&&e<=t[1]&&(n=(e-t[0])/(t[1]-t[0]),o=r)});var a=i[o];if(r.isNil(a)||r.isNil(o))return null;var s=a.length,u=i[o+1];return{x:l.at(a[s-2],u[1],u[3],u[5],1-n),y:l.at(a[s-1],u[2],u[4],u[6],1-n)}},createPath:function(e){var t=this,n=t.__attrs,o=t.get("segments");if(r.isArray(o)){e=e||t.get("context"),e.beginPath();var i=n.path,a=void 0,u=void 0,l=!1;("z"===i[i.length-1]||"Z"===i[i.length-1]||n.fill)&&(l=!0);var c=o.length;c>1&&!l&&(a=o[0].endPoint,u=o[1].endPoint,s.addStartArrow(e,n,u.x,u.y,a.x,a.y));for(var f=0,p=c;f',itemTpl:'
c/a?(p=c/a,d={x:o.x-(.5-u)*c,y:o.y-(.5-l)*p*s}):(p=f/s,d={x:o.x-(.5-u)*p*a,y:o.y-(.5-l)*f}),e?e>0&&e<=1?e*=p:(e<=0||e>p)&&(e=p):e=p;var h={start:n,end:r},v={start:t*e,end:e};this.x=h,this.y=v,this.radius=e,this.circleCentre=d,this.center=d},t.prototype.getCenter=function(){return this.circleCentre},t.prototype.getOneBox=function(){var e=this.startAngle,t=this.endAngle;if(t-e>=2*Math.PI)return{minX:-1,maxX:1,minY:-1,maxY:1};for(var n=[0,Math.cos(e),Math.cos(t)],r=[0,Math.sin(e),Math.sin(t)],o=5*-Math.PI/2;o<3*Math.PI/2;o+=Math.PI/2)e<=o&&o<=t&&(n.push(Math.cos(o)),r.push(Math.sin(o)));return{minX:Math.min.apply(Math,n),maxX:Math.max.apply(Math,n),minY:Math.min.apply(Math,r),maxY:Math.max.apply(Math,r)}},t.prototype.getRadius=function(){return this.radius},t.prototype.convertPoint=function(e){var t=this.getCenter(),n=this.isTransposed?e.y:e.x,r=this.isTransposed?e.x:e.y;return n=this.convertDim(n,"x"),r=this.convertDim(r,"y"),{x:t.x+Math.cos(n)*r,y:t.y+Math.sin(n)*r}},t.prototype.invertPoint=function(e){var t=this.getCenter(),n=[e.x-t.x,e.y-t.y],r=this.x,o=[1,0,0,0,1,0,0,0,1];l.rotate(o,o,r.start);var i=[1,0,0];f.transformMat3(i,i,o),i=[i[0],i[1]];var s=c.angleTo(i,n,r.endi&&(i=t),t1?e[1]:t;return{min:t,max:n,min1:r,max1:e.length>3?e[3]:n,median:e.length>2?e[2]:r}}function o(e,t){p.each(e,function(e){t.push({x:e[0],y:e[1]})})}function i(e){var t=h.shape.schema;return p.mix({},t,{stroke:e.color,strokeOpacity:e.opacity},e.style)}function a(e){var t=h.shape.schema;return p.mix({},t,{fill:e.color,stroke:e.color,fillOpacity:e.opacity},e.style)}function s(e,t,n){var i=[],a=void 0,s=void 0;return p.isArray(t)?(s=r(t),a=[[e-n/2,s.max],[e+n/2,s.max],[e,s.max],[e,s.max1],[e-n/2,s.min1],[e-n/2,s.max1],[e+n/2,s.max1],[e+n/2,s.min1],[e,s.min1],[e,s.min],[e-n/2,s.min],[e+n/2,s.min],[e-n/2,s.median],[e+n/2,s.median]]):(t=t||.5,s=r(e),a=[[s.min,t-n/2],[s.min,t+n/2],[s.min,t],[s.min1,t],[s.min1,t-n/2],[s.min1,t+n/2],[s.max1,t+n/2],[s.max1,t-n/2],[s.max1,t],[s.max,t],[s.max,t-n/2],[s.max,t+n/2],[s.median,t-n/2],[s.median,t+n/2]]),o(a,i),i}function u(e){p.isArray(e)||(e=[e]);var t=e.sort(function(e,t){return e0)n=Math.floor(a(t,e.min));else{var o=e.values,i=e.max;u.each(o,function(e){e>0&&e1&&(i=1),n=Math.floor(a(t,i)),e._minTick=n,e.positiveMin=i}for(var s=r-n,l=e.tickCount,c=Math.ceil(s/l),f=[],p=n;p
=O&&(O=S+1);!(C=w[O])&&++O=0;)(r=o[i])&&(a&&a!==r.nextSibling&&a.parentNode.insertBefore(r,a),a=r);return this}},function(e,t,n){"use strict";function r(e){return function(){delete this[e]}}function o(e,t){return function(){this[e]=t}}function i(e,t){return function(){var n=t.apply(this,arguments);null==n?delete this[e]:this[e]=n}}t.a=function(e,t){return arguments.length>1?this.each((null==t?r:"function"==typeof t?i:o)(e,t)):this.node()[e]}},function(e,t,n){"use strict";function r(){this.nextSibling&&this.parentNode.appendChild(this)}t.a=function(){return this.each(r)}},function(e,t,n){"use strict";function r(){var e=this.parentNode;e&&e.removeChild(this)}t.a=function(){return this.each(r)}},function(e,t,n){"use strict";var r=n(6),o=n(57);t.a=function(e){"function"!=typeof e&&(e=n.i(o.a)(e));for(var t=this._groups,i=t.length,a=new Array(i),s=0;st?1:e>=t?0:NaN}var o=n(6);t.a=function(e){function t(t,n){return t&&n?e(t.__data__,n.__data__):!t-!n}e||(e=r);for(var n=this._groups,i=n.length,a=new Array(i),s=0;so.d&&n.name===t)return new r.b([[e]],i,t,+a)}return null}},function(e,t,n){"use strict";var r=n(8),o=n(311),i=n(312);r.selection.prototype.interrupt=o.a,r.selection.prototype.transition=i.a},function(e,t,n){"use strict";var r=n(111);t.a=function(e){return this.each(function(){n.i(r.a)(this,e)})}},function(e,t,n){"use strict";function r(e,t){for(var r;!(r=e.__transition)||!(r=r[t]);)if(!(e=e.parentNode))return u.time=n.i(s.c)(),u;return r}var o=n(10),i=n(7),a=n(251),s=n(110),u={time:null,delay:0,duration:250,ease:a.a};t.a=function(e){var t,a;e instanceof o.b?(t=e._id,e=e._name):(t=n.i(o.c)(),(a=u).time=n.i(s.c)(),e=null==e?null:e+"");for(var l=this._groups,c=l.length,f=0;f0),"Math",{asinh:r})},"7KvD":function(e,t){var n=e.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},"7O1s":function(e,t,n){var r=n("DIVP"),o=n("XSOZ"),i=n("kkCw")("species");e.exports=function(e,t){var n,a=r(e).constructor;return void 0===a||void 0==(n=r(a)[i])?t:o(n)}},"7UMu":function(e,t,n){var r=n("R9M2");e.exports=Array.isArray||function(e){return"Array"==r(e)}},"7WgF":function(e,t,n){"use strict";var r=n("vtiu"),o=(n.n(r),n("HE74"));n.n(o),n("crfj")},"7YkW":function(e,t,n){function r(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new o;++t0;)u in n?n[s]=n[u]:delete n[s],s+=f,u+=f;return n}},DQfQ:function(e,t,n){var r=n("Ds5P");r(r.G,{global:n("OzIq")})},DRk7:function(e,t,n){"use strict";function r(e){return void 0===e&&(e=""),"lodash-decorators -> "+e}Object.defineProperty(t,"__esModule",{value:!0}),t.log=r},"DT0+":function(e,t,n){"use strict";var r=n("GiK3"),o=n("wqO5");if(void 0===r)throw Error("create-react-class could not find the React object. If you are using script tags, make sure that React is being loaded before create-react-class.");var i=(new r.Component).updater;e.exports=o(r.Component,r.isValidElement,i)},DXVd:function(e,t,n){"use strict";var r=n("vtiu"),o=(n.n(r),n("mnKE"));n.n(o)},Dc0G:function(e,t,n){(function(e){var r=n("blYT"),o="object"==typeof t&&t&&!t.nodeType&&t,i=o&&"object"==typeof e&&e&&!e.nodeType&&e,a=i&&i.exports===o,s=a&&r.process,u=function(){try{var e=i&&i.require&&i.require("util").types;return e||s&&s.binding&&s.binding("util")}catch(e){}}();e.exports=u}).call(t,n("3IRH")(e))},Dd8w:function(e,t,n){"use strict";t.__esModule=!0;var r=n("woOf"),o=function(e){return e&&e.__esModule?e:{default:e}}(r);t.default=o.default||function(e){for(var t=1;t ignores the history prop. To use a custom history, use `import { Router }` instead of `import { BrowserRouter as Router }`.")},t.prototype.render=function(){return g.a.createElement(_,{history:this.history,children:this.props.children})},t}(g.a.Component);C.propTypes={basename:b.a.string,forceRefresh:b.a.bool,getUserConfirmation:b.a.func,keyLength:b.a.number,children:b.a.node};var S=C,O=function(e){function t(){var n,r,o;a(this,t);for(var i=arguments.length,u=Array(i),l=0;l ignores the history prop. To use a custom history, use `import { Router }` instead of `import { HashRouter as Router }`.")},t.prototype.render=function(){return g.a.createElement(_,{history:this.history,children:this.props.children})},t}(g.a.Component);O.propTypes={basename:b.a.string,getUserConfirmation:b.a.func,hashType:b.a.oneOf(["hashbang","noslash","slash"]),children:b.a.node};var k=O,E=n("crWv"),P=n.n(E),M=Object.assign||function(e){for(var t=1;t