mirror of
https://github.com/jeffvli/feishin.git
synced 2026-05-10 04:30:25 +02:00
normalize user action columns
This commit is contained in:
@@ -15,9 +15,9 @@ export const ActionsColumn = (props: ItemTableListInnerColumn) => {
|
|||||||
icon="ellipsisHorizontal"
|
icon="ellipsisHorizontal"
|
||||||
iconProps={{
|
iconProps={{
|
||||||
color: 'muted',
|
color: 'muted',
|
||||||
|
size: 'lg',
|
||||||
}}
|
}}
|
||||||
size="lg"
|
variant="subtle"
|
||||||
variant="transparent"
|
|
||||||
/>
|
/>
|
||||||
</TableColumnContainer>
|
</TableColumnContainer>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -18,9 +18,9 @@ export const FavoriteColumn = (props: ItemTableListInnerColumn) => {
|
|||||||
iconProps={{
|
iconProps={{
|
||||||
color: row ? 'primary' : 'muted',
|
color: row ? 'primary' : 'muted',
|
||||||
fill: row ? 'primary' : undefined,
|
fill: row ? 'primary' : undefined,
|
||||||
|
size: 'lg',
|
||||||
}}
|
}}
|
||||||
size="lg"
|
variant="subtle"
|
||||||
variant="transparent"
|
|
||||||
/>
|
/>
|
||||||
</TableColumnContainer>
|
</TableColumnContainer>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -0,0 +1,3 @@
|
|||||||
|
.expand {
|
||||||
|
position: absolute;
|
||||||
|
}
|
||||||
@@ -1,8 +1,40 @@
|
|||||||
|
import clsx from 'clsx';
|
||||||
|
|
||||||
|
import styles from './row-index-column.module.css';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
ItemTableListInnerColumn,
|
ItemTableListInnerColumn,
|
||||||
|
TableColumnContainer,
|
||||||
TableColumnTextContainer,
|
TableColumnTextContainer,
|
||||||
} from '/@/renderer/components/item-list/item-table-list/item-table-list-column';
|
} from '/@/renderer/components/item-list/item-table-list/item-table-list-column';
|
||||||
|
import { ActionIcon } from '/@/shared/components/action-icon/action-icon';
|
||||||
|
import { Text } from '/@/shared/components/text/text';
|
||||||
|
|
||||||
export const RowIndexColumn = (props: ItemTableListInnerColumn) => {
|
export const RowIndexColumn = (props: ItemTableListInnerColumn) => {
|
||||||
|
const { controls, enableExpansion } = props;
|
||||||
|
|
||||||
|
if (enableExpansion) {
|
||||||
|
return (
|
||||||
|
<TableColumnContainer {...props}>
|
||||||
|
<ActionIcon
|
||||||
|
className={clsx(styles.expand, 'hover-only')}
|
||||||
|
icon="arrowDownS"
|
||||||
|
iconProps={{ color: 'muted', size: 'xl' }}
|
||||||
|
onClick={(e) =>
|
||||||
|
controls.onItemExpand?.(
|
||||||
|
props.data[props.rowIndex] as any,
|
||||||
|
props.itemType,
|
||||||
|
e,
|
||||||
|
)
|
||||||
|
}
|
||||||
|
variant="subtle"
|
||||||
|
/>
|
||||||
|
<Text className="hide-on-hover" isMuted>
|
||||||
|
{props.rowIndex}
|
||||||
|
</Text>
|
||||||
|
</TableColumnContainer>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
return <TableColumnTextContainer {...props}>{props.rowIndex}</TableColumnTextContainer>;
|
return <TableColumnTextContainer {...props}>{props.rowIndex}</TableColumnTextContainer>;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -93,3 +93,12 @@
|
|||||||
.container.data-row.row-hovered :global(.hover-only-flex) {
|
.container.data-row.row-hovered :global(.hover-only-flex) {
|
||||||
display: flex;
|
display: flex;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.container :global(.hide-on-hover) {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
|
||||||
|
.container.data-row:hover :global(.hide-on-hover),
|
||||||
|
.container.data-row.row-hovered :global(.hide-on-hover) {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user