@coveord/plasma-mantine
Version:
A Plasma flavoured Mantine theme
32 lines (31 loc) • 1.49 kB
JavaScript
import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
import { useProps } from '@mantine/core';
import { identity } from '../../../../utils';
import { useTableContext } from '../../TableContext';
import { Th } from '../../table-header/Th';
import { useRowLayout } from './RowLayoutContext';
const defaultProps = {};
export const RowLayoutHeader = (props)=>{
const ctx = useRowLayout();
const { getRowExpandedContent: _getRowExpandedContent, getRowActions: _getRowActions, loading: _loading, getRowAttributes: _getRowAttributes, onRowDoubleClick: _onRowDoubleClick, className, style, classNames, styles, ...others } = useProps('RowLayoutHeader', defaultProps, props);
const { table, store } = useTableContext();
const headers = table.getHeaderGroups().map((headerGroup)=>/*#__PURE__*/ _jsx("tr", {
"data-selectable": store.rowSelectionEnabled,
"data-multi-selection": store.multiRowSelectionEnabled,
...ctx.getStyles('headerRow', {
className,
classNames,
styles,
style
}),
...others,
children: headerGroup.headers.map((columnHeader)=>/*#__PURE__*/ _jsx(Th, {
header: columnHeader
}, columnHeader.id))
}, headerGroup.id));
return /*#__PURE__*/ _jsx(_Fragment, {
children: headers
});
};
RowLayoutHeader.extend = identity;
//# sourceMappingURL=RowLayoutHeader.js.map