var __assign = (this && this.__assign) || function () {
    __assign = Object.assign || function(t) {
        for (var s, i = 1, n = arguments.length; i < n; i++) {
            s = arguments[i];
            for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
                t[p] = s[p];
        }
        return t;
    };
    return __assign.apply(this, arguments);
};
var __rest = (this && this.__rest) || function (s, e) {
    var t = {};
    for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
        t[p] = s[p];
    if (s != null && typeof Object.getOwnPropertySymbols === "function")
        for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
            if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
                t[p[i]] = s[p[i]];
        }
    return t;
};
import React, { forwardRef } from 'react';
import classnames from 'classnames';
import { Table as FusionTable, Icon } from '@alifd/next';
import hoist from '../../utils/hoist';
var ExtendedTable = forwardRef(function (_a, ref) {
    var className = _a.className, rowSelection = _a.rowSelection, sortIcons = _a.sortIcons, rtl = _a.rtl, props = __rest(_a, ["className", "rowSelection", "sortIcons", "rtl"]);
    return (React.createElement(FusionTable.StickyLock, __assign({}, __assign(__assign({ rowSelection: rowSelection, hasBorder: false, className: classnames(className, {
            'with-row-select': !!rowSelection, // 对于有选择列的表格，我们增加一个类名，方便对这种表格进行样式覆盖
        }), 
        // 因为 dsm 上配置的 asc icon 和 desc icon 是反着的，所以这里需要手动调转下
        sortIcons: __assign({ desc: React.createElement(Icon, { rtl: rtl, type: "ascending", size: "xs" }), asc: React.createElement(Icon, { rtl: rtl, type: "descending", size: "xs" }) }, sortIcons) }, props), { ref: ref }))));
});
var Table = ExtendedTable;
Table.StickyLock = ExtendedTable;
export default hoist(Table, FusionTable);
export var TableColumn = FusionTable.Column;
export var TableColumnGroup = FusionTable.ColumnGroup;
export var TableColumnGroupHeader = FusionTable.GroupHeader;
export var TableColumnGroupFooter = FusionTable.GroupFooter;
export var TableStickyLock = FusionTable.StickyLock;
export var TableBase = FusionTable.Base;
