modifications make to table-row files to correct table-row height property. Code was previously using height.height ini setHeight but should instead be using value.
This commit is contained in:
@ -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,
|
||||
}),
|
||||
);
|
||||
|
@ -18,8 +18,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;
|
||||
}
|
||||
|
@ -92,7 +92,7 @@ describe("TableRow", () => {
|
||||
const tableRow = new TableRow({
|
||||
children: [],
|
||||
height: {
|
||||
height: 100,
|
||||
value: 100,
|
||||
rule: HeightRule.EXACT,
|
||||
},
|
||||
});
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user