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 {
|
interface ITableRowHeight {
|
||||||
readonly height: number;
|
readonly value: number;
|
||||||
readonly rule: HeightRule;
|
readonly rule: HeightRule;
|
||||||
}
|
}
|
||||||
|
|
||||||
export class TableRowHeightAttributes extends XmlAttributeComponent<ITableRowHeight> {
|
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 {
|
export class TableRowHeight extends XmlComponent {
|
||||||
@ -24,7 +24,7 @@ export class TableRowHeight extends XmlComponent {
|
|||||||
|
|
||||||
this.root.push(
|
this.root.push(
|
||||||
new TableRowHeightAttributes({
|
new TableRowHeightAttributes({
|
||||||
height: value,
|
value: value,
|
||||||
rule: rule,
|
rule: rule,
|
||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
|
@ -18,8 +18,8 @@ export class TableRowProperties extends IgnoreIfEmptyXmlComponent {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public setHeight(height: number, rule: HeightRule): TableRowProperties {
|
public setHeight(value: number, rule: HeightRule): TableRowProperties {
|
||||||
this.root.push(new TableRowHeight(height, rule));
|
this.root.push(new TableRowHeight(value, rule));
|
||||||
|
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
@ -92,7 +92,7 @@ describe("TableRow", () => {
|
|||||||
const tableRow = new TableRow({
|
const tableRow = new TableRow({
|
||||||
children: [],
|
children: [],
|
||||||
height: {
|
height: {
|
||||||
height: 100,
|
value: 100,
|
||||||
rule: HeightRule.EXACT,
|
rule: HeightRule.EXACT,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
@ -7,7 +7,7 @@ export interface ITableRowOptions {
|
|||||||
readonly cantSplit?: boolean;
|
readonly cantSplit?: boolean;
|
||||||
readonly tableHeader?: boolean;
|
readonly tableHeader?: boolean;
|
||||||
readonly height?: {
|
readonly height?: {
|
||||||
readonly height: number;
|
readonly value: number;
|
||||||
readonly rule: HeightRule;
|
readonly rule: HeightRule;
|
||||||
};
|
};
|
||||||
readonly children: TableCell[];
|
readonly children: TableCell[];
|
||||||
@ -34,7 +34,7 @@ export class TableRow extends XmlComponent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (options.height) {
|
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