Skip to content

Commit

Permalink
fix: table: increase selection column size, add border bottom header …
Browse files Browse the repository at this point in the history
…prop (#209)
  • Loading branch information
ychhabra-eightfold authored Jun 29, 2022
1 parent e9c7617 commit 2a36bee
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 1 deletion.
10 changes: 10 additions & 0 deletions src/components/Table/Styles/bordered.scss
Original file line number Diff line number Diff line change
Expand Up @@ -360,6 +360,16 @@
}
}

&-header-bottom-bordered {
table {
thead {
tr th {
border-bottom: $table-border;
}
}
}
}

&-inner-bordered {
.table-title {
border: $table-border;
Expand Down
2 changes: 1 addition & 1 deletion src/components/Table/Styles/table.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
--table-font-size-md: 14px;
--table-font-size-sm: 14px;
--table-line-height: 20px;
--table-selection-column-width: 32px;
--table-selection-column-width: 80px;

clear: both;
max-width: 100%;
Expand Down
1 change: 1 addition & 0 deletions src/components/Table/Table.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1404,6 +1404,7 @@ Header_Bordered.args = {
...tableArgs,
bordered: false,
headerBordered: true,
headerBottomBordered: false,
};

Inner_Bordered.args = {
Expand Down
9 changes: 9 additions & 0 deletions src/components/Table/Table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ function InternalTable<RecordType extends object = any>(
filterSearchPlaceholderText,
getPopupContainer,
headerBordered = false,
headerBottomBordered = false,
indentSize,
innerBordered = false,
loading,
Expand Down Expand Up @@ -556,6 +557,14 @@ function InternalTable<RecordType extends object = any>(
!innerBordered &&
headerBordered,
},
{
[styles.tableHeaderBottomBordered]:
!bordered &&
!rowBordered &&
!innerBordered &&
!headerBordered &&
headerBottomBordered,
},
{
[styles.tableInnerBordered]:
!bordered && !rowBordered && innerBordered,
Expand Down
5 changes: 5 additions & 0 deletions src/components/Table/Table.types.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,11 @@ export interface TableProps<RecordType>
filterSearchPlaceholderText?: string;
getPopupContainer?: GetPopupContainer;
headerBordered?: boolean;
/**
* Adds border to the bottom of the header
* @default false
*/
headerBottomBordered?: boolean;
onChange?: (
pagination: TablePaginationConfig,
filters: Record<string, FilterValue | null>,
Expand Down

0 comments on commit 2a36bee

Please sign in to comment.