Skip to content

Commit 88a962f

Browse files
committed
fix(table-color): allow undefined type for color input prop
1 parent d9cc821 commit 88a962f

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

projects/coreui-angular/src/lib/table/table-color.directive.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,12 @@ export class TableColorDirective {
1313
* Use contextual color for tables, table rows or individual cells.
1414
* @return Colors
1515
*/
16-
readonly color = input<Colors>(undefined, { alias: 'cTableColor' });
16+
readonly color = input<Colors | undefined>(undefined, { alias: 'cTableColor' });
1717

1818
readonly hostClasses = computed(() => {
19+
const color = this.color();
1920
return {
20-
[`table-${this.color()}`]: !!this.color()
21+
[`table-${color}`]: !!color
2122
} as Record<string, boolean>;
2223
});
2324
}

0 commit comments

Comments
 (0)