Skip to content

Commit

Permalink
feat(table): add support for enabling and disabling border per row an…
Browse files Browse the repository at this point in the history
…d cell
  • Loading branch information
c4spar committed Jul 26, 2020
1 parent ddee9d7 commit d62182d
Show file tree
Hide file tree
Showing 4 changed files with 268 additions and 127 deletions.
4 changes: 2 additions & 2 deletions packages/table/lib/cell.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export class Cell extends String {
* Getter:
*/

public getBorder( defaultValue?: boolean ): boolean | undefined {
return this.options.border ?? defaultValue;
public getBorder(): boolean {
return this.options.border === true;
}
}
8 changes: 6 additions & 2 deletions packages/table/lib/row.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,11 @@ export class Row<T extends ICell = ICell> extends Array<T> {
* Getter:
*/

public getBorder( defaultValue?: boolean ): boolean | undefined {
return this.options.border ?? defaultValue;
public getBorder(): boolean {
return this.options.border === true;
}

public hasBorder(): boolean {
return this.getBorder() || this.some( cell => cell instanceof Cell && cell.getBorder() );
}
}
Loading

0 comments on commit d62182d

Please sign in to comment.