Clean up API
This commit is contained in:
@ -22,9 +22,9 @@ describe("TableProperties", () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe("#fixedWidthLayout", () => {
|
||||
describe("#setFixedWidthLayout", () => {
|
||||
it("sets the table to fixed width layout", () => {
|
||||
const tp = new TableProperties().fixedWidthLayout();
|
||||
const tp = new TableProperties().setFixedWidthLayout();
|
||||
const tree = new Formatter().format(tp);
|
||||
expect(tree).to.deep.equal({
|
||||
"w:tblPr": [{ "w:tblLayout": [{ _attr: { "w:type": "fixed" } }] }],
|
||||
|
@ -12,7 +12,7 @@ export class TableProperties extends XmlComponent {
|
||||
return this;
|
||||
}
|
||||
|
||||
public fixedWidthLayout(): TableProperties {
|
||||
public setFixedWidthLayout(): TableProperties {
|
||||
this.root.push(new TableLayout("fixed"));
|
||||
return this;
|
||||
}
|
||||
|
@ -186,9 +186,9 @@ describe("Table", () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe("#fixedWidthLayout", () => {
|
||||
describe("#setFixedWidthLayout", () => {
|
||||
it("sets the table to fixed width layout", () => {
|
||||
const table = new Table(2, 2).fixedWidthLayout();
|
||||
const table = new Table(2, 2).setFixedWidthLayout();
|
||||
const tree = new Formatter().format(table);
|
||||
expect(tree)
|
||||
.to.have.property("w:tbl")
|
||||
|
@ -72,8 +72,8 @@ export class Table extends XmlComponent {
|
||||
return this;
|
||||
}
|
||||
|
||||
public fixedWidthLayout(): Table {
|
||||
this.properties.fixedWidthLayout();
|
||||
public setFixedWidthLayout(): Table {
|
||||
this.properties.setFixedWidthLayout();
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@ -94,7 +94,7 @@ export class TableRow extends XmlComponent {
|
||||
|
||||
public addGridSpan(ix: number, cellSpan: number): TableCell {
|
||||
const remainCell = this.cells[ix];
|
||||
remainCell.cellProperties.addGridSpan(cellSpan);
|
||||
remainCell.CellProperties.addGridSpan(cellSpan);
|
||||
this.cells.splice(ix + 1, cellSpan - 1);
|
||||
this.root.splice(ix + 2, cellSpan - 1);
|
||||
|
||||
@ -138,7 +138,7 @@ export class TableCell extends XmlComponent {
|
||||
return para;
|
||||
}
|
||||
|
||||
public get cellProperties(): TableCellProperties {
|
||||
public get CellProperties(): TableCellProperties {
|
||||
return this.properties;
|
||||
}
|
||||
}
|
||||
@ -151,7 +151,7 @@ export class TableCellProperties extends XmlComponent {
|
||||
this.root.push(this.cellBorder);
|
||||
}
|
||||
|
||||
public get borders(): TableCellBorders {
|
||||
public get Borders(): TableCellBorders {
|
||||
return this.cellBorder;
|
||||
}
|
||||
|
||||
@ -167,8 +167,8 @@ export class TableCellProperties extends XmlComponent {
|
||||
return this;
|
||||
}
|
||||
|
||||
public setVerticalAlign(vAlignType: VerticalAlign): TableCellProperties {
|
||||
this.root.push(new VAlign(vAlignType));
|
||||
public setVerticalAlign(type: VerticalAlign): TableCellProperties {
|
||||
this.root.push(new VAlign(type));
|
||||
|
||||
return this;
|
||||
}
|
||||
|
Reference in New Issue
Block a user