import _extends from "babel-runtime/helpers/extends";
import _classCallCheck from "babel-runtime/helpers/classCallCheck";
import _createClass from "babel-runtime/helpers/createClass";
import _possibleConstructorReturn from "babel-runtime/helpers/possibleConstructorReturn";
import _inherits from "babel-runtime/helpers/inherits";
import React, { Component } from "react";
import AntdTable from "antd/es/table";
import PagePointEnhanced from "../page-point/pagePointEnhanced";
import { ConfigConsumer } from "../config-provider";
import "antd/es/table/style";

var NativeTable = function (_Component) {
    _inherits(NativeTable, _Component);

    function NativeTable() {
        _classCallCheck(this, NativeTable);

        return _possibleConstructorReturn(this, (NativeTable.__proto__ || Object.getPrototypeOf(NativeTable)).apply(this, arguments));
    }

    _createClass(NativeTable, [{
        key: "render",
        value: function render() {
            var _this2 = this;

            var _props = this.props,
                rowSelection = _props.rowSelection,
                onRow = _props.onRow;

            return React.createElement(
                ConfigConsumer,
                null,
                function (_ref) {
                    var pagePoint = _ref.pagePoint;
                    return React.createElement(
                        React.Fragment,
                        null,
                        pagePoint ? React.createElement(PagePointEnhanced, _extends({ compType: "Table" }, _this2.props, { render: function render(eventprops) {
                                return React.createElement(AntdTable, _extends({}, _this2.props, { rowSelection: rowSelection ? _extends(_extends({}, rowSelection), eventprops.onChange ? { onChange: eventprops.onChange } : {}) : null, onRow: eventprops.onRow ? eventprops.onRow : onRow, "data-ui-role": "Table" }));
                            } })) : React.createElement(AntdTable, _this2.props)
                    );
                }
            );
        }
    }]);

    return NativeTable;
}(Component);

export default NativeTable;