Skip to content

Commit c9b71be

Browse files
committed
fix: Update table sizes
Signed-off-by: Akshat Patel <[email protected]>
1 parent 2ae2d16 commit c9b71be

File tree

4 files changed

+15
-16
lines changed

4 files changed

+15
-16
lines changed

src/table/table.component.spec.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import { TableItem } from "./table-item.class";
1515
(sort)="simpleSort()"
1616
(selectRow)="onChange()"
1717
(deselectRow)="onChange()"
18-
size="sh"
18+
size="md"
1919
title="title"
2020
[showSelectionColumn]="showSelectionColumn">
2121
</ibm-table>`
@@ -110,8 +110,8 @@ describe("Table", () => {
110110
expect(tableInstance.componentInstance.deselectRow.emit).toHaveBeenCalled();
111111
});
112112

113-
it("should set the .cds--data-table--short class", () => {
114-
expect(tableInstance.nativeElement.querySelector(".cds--data-table--short")).toBeTruthy();
113+
it("should set the .cds--data-table--md class", () => {
114+
expect(tableInstance.nativeElement.querySelector(".cds--data-table--md")).toBeTruthy();
115115
});
116116

117117
it("should not show checkboxes when showSelectionColumn is false", () => {

src/table/table.directive.ts

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,11 @@ export class TableDirective {
2020

2121
@HostBinding("class.cds--data-table") tableClass = true;
2222

23-
@HostBinding("class.cds--data-table--compact") get compactClass() {
24-
return this.size === "sm";
25-
}
23+
// Bind table size class
24+
@HostBinding("class.cds--data-table--xs") get extraSmallSize() { return this.size === "xs"; }
25+
@HostBinding("class.cds--data-table--sm") get smallSize() { return this.size === "sm"; }
26+
@HostBinding("class.cds--data-table--md") get mediumSize() { return this.size === "md"; }
27+
@HostBinding("class.cds--data-table--lg") get LargeSize() { return this.size === "lg"; }
28+
@HostBinding("class.cds--data-table--xl") get extraLargeSize() { return this.size === "xl"; }
2629

27-
@HostBinding("class.cds--data-table--tall") get tallClass() {
28-
return this.size === "lg";
29-
}
30-
31-
@HostBinding("class.cds--data-table--short") get shortClass() {
32-
return this.size === "sh";
33-
}
3430
}

src/table/table.stories.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ const getProps = (more = {}, type: "args" | "argTypes") => {
5757
skeleton: false
5858
} : {
5959
size: {
60-
options: ["sm", "sh", "md", "lg"],
60+
options: ["xs", "sm", "md", "lg", "xl"],
6161
control: "select"
6262
}
6363
};
@@ -145,6 +145,9 @@ Basic.args = {
145145
enableSingleSelect: false
146146
}, "args")
147147
};
148+
Basic.argTypes = {
149+
...getProps({}, "argTypes")
150+
};
148151

149152
const NoDataTemplate: Story = (args) => ({
150153
props: args,
@@ -353,7 +356,7 @@ WithDisabledRows.args = {
353356
};
354357
WithDisabledRows.argTypes = {
355358
size: {
356-
options: ["sm", "sh", "md", "lg"],
359+
options: ["xs", "sm", "md", "lg", "xl"],
357360
control: "select"
358361
}
359362
};

src/table/table.types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ export interface TableTranslations {
66
CHECKBOX_ROW: string;
77
}
88

9-
export type TableRowSize = "sm" | "sh" | "md" | "lg";
9+
export type TableRowSize = "xs" | "sm" | "md" | "lg" | "xl";

0 commit comments

Comments
 (0)