|
@@ -13,11 +13,15 @@ const HeaderTh: FC<Props> = function ({header, useDiv}) {
|
|
|
const {setNodeRef, attributes, listeners} = useSortable({
|
|
|
id: header.id,
|
|
|
data: {header},
|
|
|
+ disabled: header.id === 'id',
|
|
|
});
|
|
|
|
|
|
+ const {fixed} = header.column.columnDef.meta as {fixed: boolean};
|
|
|
+ const isResizing = header.column.getIsResizing();
|
|
|
+
|
|
|
const style: CSSProperties = {
|
|
|
width: header.getSize(),
|
|
|
- cursor: 'move',
|
|
|
+ cursor: isResizing ? 'col-resize' : fixed ? 'auto' : 'move',
|
|
|
boxShadow: useDiv
|
|
|
? '0.5px 0.6px 12.3px rgba(0, 0, 0, 0.059),4px 5px 80px rgba(0, 0, 0, 0.1)'
|
|
|
: '',
|
|
@@ -31,7 +35,7 @@ const HeaderTh: FC<Props> = function ({header, useDiv}) {
|
|
|
ref={setNodeRef}
|
|
|
{...attributes}
|
|
|
{...listeners}
|
|
|
- className={css.tableHeadTh}
|
|
|
+ className={classNames(css.tableHeadTh)}
|
|
|
>
|
|
|
{header.isPlaceholder
|
|
|
? null
|
|
@@ -55,17 +59,19 @@ const HeaderTh: FC<Props> = function ({header, useDiv}) {
|
|
|
ref={setNodeRef}
|
|
|
{...attributes}
|
|
|
{...listeners}
|
|
|
- className={css.tableHeadTh}
|
|
|
+ className={classNames(css.tableHeadTh, {[css.fixedRight]: fixed})}
|
|
|
>
|
|
|
{flexRender(header.column.columnDef.header, header.getContext())}
|
|
|
|
|
|
- <div
|
|
|
- onMouseDown={header.getResizeHandler()}
|
|
|
- onPointerDown={e => e.stopPropagation()}
|
|
|
- className={classNames(css.resizer, {
|
|
|
- [css.resizing]: header.column.getIsResizing(),
|
|
|
- })}
|
|
|
- />
|
|
|
+ {!fixed ? (
|
|
|
+ <div
|
|
|
+ onMouseDown={header.getResizeHandler()}
|
|
|
+ onPointerDown={e => e.stopPropagation()}
|
|
|
+ className={classNames(css.resizer, {
|
|
|
+ [css.resizing]: isResizing,
|
|
|
+ })}
|
|
|
+ />
|
|
|
+ ) : null}
|
|
|
</th>
|
|
|
);
|
|
|
};
|