2020-01-30 16:14:25 +02:00
|
|
|
import { TableCell } from "./table-cell";
|
|
|
|
|
2021-03-02 05:31:46 +02:00
|
|
|
export type HeightRule = "auto" | "atLeast" | "exact";
|
|
|
|
|
2020-01-30 16:14:25 +02:00
|
|
|
export class TableRow {
|
|
|
|
cells: TableCell[] = [];
|
2020-05-15 09:51:45 +03:00
|
|
|
hasNumberings = false;
|
2020-10-13 10:27:03 +03:00
|
|
|
height: number | null = null;
|
2021-03-15 08:54:14 +02:00
|
|
|
hRule: HeightRule = "atLeast";
|
2022-01-25 15:12:45 +02:00
|
|
|
del: { author: string; date: string } | null = null;
|
2020-01-30 16:14:25 +02:00
|
|
|
|
|
|
|
addCell(cell: TableCell) {
|
2020-05-15 09:51:45 +03:00
|
|
|
if (cell.hasNumberings) {
|
|
|
|
this.hasNumberings = true;
|
|
|
|
}
|
2020-01-30 16:14:25 +02:00
|
|
|
this.cells.push(cell);
|
2020-10-13 10:27:03 +03:00
|
|
|
return this;
|
|
|
|
}
|
|
|
|
|
|
|
|
rowHeight(h: number) {
|
|
|
|
this.height = h;
|
|
|
|
return this;
|
2020-01-30 16:14:25 +02:00
|
|
|
}
|
2021-03-02 05:31:46 +02:00
|
|
|
|
|
|
|
heightRule(r: HeightRule) {
|
|
|
|
this.hRule = r;
|
|
|
|
return this;
|
|
|
|
}
|
2022-01-25 15:12:45 +02:00
|
|
|
|
|
|
|
delete(author: string, date: string) {
|
|
|
|
this.del = { author, date };
|
|
|
|
return this;
|
|
|
|
}
|
2020-01-30 16:14:25 +02:00
|
|
|
}
|