Merge pull request #565 from SoapyD/height_branch

table-row height correction
This commit is contained in:
Dolan
2021-03-04 02:13:32 +00:00
committed by GitHub
4 changed files with 8 additions and 8 deletions

View File

@ -10,12 +10,12 @@ export enum HeightRule {
}
interface ITableRowHeight {
readonly height: number;
readonly value: number;
readonly rule: HeightRule;
}
export class TableRowHeightAttributes extends XmlAttributeComponent<ITableRowHeight> {
protected readonly xmlKeys = { height: "w:val", rule: "w:hRule" };
protected readonly xmlKeys = { value: "w:val", rule: "w:hRule" };
}
export class TableRowHeight extends XmlComponent {
@ -24,7 +24,7 @@ export class TableRowHeight extends XmlComponent {
this.root.push(
new TableRowHeightAttributes({
height: value,
value: value,
rule: rule,
}),
);

View File

@ -20,8 +20,8 @@ export class TableRowProperties extends IgnoreIfEmptyXmlComponent {
return this;
}
public setHeight(height: number, rule: HeightRule): TableRowProperties {
this.root.push(new TableRowHeight(height, rule));
public setHeight(value: number, rule: HeightRule): TableRowProperties {
this.root.push(new TableRowHeight(value, rule));
return this;
}

View File

@ -92,7 +92,7 @@ describe("TableRow", () => {
const tableRow = new TableRow({
children: [],
height: {
height: 100,
value: 100,
rule: HeightRule.EXACT,
},
});

View File

@ -7,7 +7,7 @@ export interface ITableRowOptions {
readonly cantSplit?: boolean;
readonly tableHeader?: boolean;
readonly height?: {
readonly height: number;
readonly value: number;
readonly rule: HeightRule;
};
readonly children: TableCell[];
@ -34,7 +34,7 @@ export class TableRow extends XmlComponent {
}
if (options.height) {
this.properties.setHeight(options.height.height, options.height.rule);
this.properties.setHeight(options.height.value, options.height.rule);
}
}