mirror of
https://github.com/HackPlan/polaris-react.git
synced 2026-04-29 01:35:39 +08:00
fix ResourceTable selection cell width
This commit is contained in:
@@ -98,6 +98,23 @@ $breakpoint: 768px;
|
||||
text-align: left;
|
||||
transition: background-color 0.2s ease-in-out;
|
||||
vertical-align: middle;
|
||||
|
||||
&.SelectionCell {
|
||||
padding-left: 1.4rem !important;
|
||||
padding-right: 0 !important;
|
||||
width: 46px !important;
|
||||
}
|
||||
}
|
||||
|
||||
.SelectionCell {
|
||||
padding: 0;
|
||||
border-bottom: border-width() solid color('sky', 'light');
|
||||
white-space: nowrap;
|
||||
text-align: left;
|
||||
transition: background-color 0.2s ease-in-out;
|
||||
vertical-align: middle;
|
||||
|
||||
width: 42px !important;
|
||||
}
|
||||
|
||||
.Cell-numeric {
|
||||
|
||||
@@ -222,11 +222,13 @@ export class ResourceTable extends React.PureComponent<
|
||||
}
|
||||
};
|
||||
return (
|
||||
<Checkbox
|
||||
label=""
|
||||
checked={selectedIndexes && selectedIndexes.includes(rowIndex)}
|
||||
onChange={handleOnChange}
|
||||
/>
|
||||
<div style={{marginLeft: 17, width: 10}}>
|
||||
<Checkbox
|
||||
label=""
|
||||
checked={selectedIndexes && selectedIndexes.includes(rowIndex)}
|
||||
onChange={handleOnChange}
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -782,6 +784,7 @@ export class ResourceTable extends React.PureComponent<
|
||||
onRowClicked,
|
||||
selectedIndexes = [],
|
||||
onDragEnd,
|
||||
onSelection,
|
||||
} = this.props;
|
||||
const {heights} = this.state;
|
||||
const bodyCellHeights = totals ? heights.slice(2) : heights.slice(1);
|
||||
@@ -840,6 +843,7 @@ export class ResourceTable extends React.PureComponent<
|
||||
const id = `cell-${cellIndex}-row-${index}`;
|
||||
return (
|
||||
<Cell
|
||||
isSelection={cellIndex === 0 && Boolean(onSelection)}
|
||||
key={id}
|
||||
testID={id}
|
||||
height={bodyCellHeights[index]}
|
||||
|
||||
@@ -28,6 +28,7 @@ export interface Props {
|
||||
event: React.MouseEvent<HTMLTableDataCellElement, MouseEvent>,
|
||||
) => void;
|
||||
isDragOccurring?: boolean;
|
||||
isSelection?: boolean;
|
||||
}
|
||||
|
||||
export type CombinedProps = Props & WithAppProviderProps;
|
||||
@@ -111,12 +112,13 @@ export class Cell extends React.Component<CombinedProps, State, Snapshot> {
|
||||
},
|
||||
onSort,
|
||||
onClick,
|
||||
isSelection,
|
||||
} = this.props;
|
||||
|
||||
const numeric = contentType === 'numeric';
|
||||
|
||||
const className = classNames(
|
||||
styles.Cell,
|
||||
isSelection ? styles.SelectionCell : styles.Cell,
|
||||
fixed && styles['Cell-fixed'],
|
||||
fixed && truncate && styles['Cell-truncated'],
|
||||
header && styles['Cell-header'],
|
||||
|
||||
Reference in New Issue
Block a user