parent
2c8bbbb43f
commit
1df5e25523
|
@ -9,6 +9,7 @@ import("../js").then(w => {
|
|||
.bold()
|
||||
.highlight("yellow")
|
||||
.color("FF0000")
|
||||
.size(40)
|
||||
)
|
||||
)
|
||||
.build();
|
||||
|
|
|
@ -176,7 +176,7 @@ export class Docx {
|
|||
break;
|
||||
}
|
||||
case "hanging": {
|
||||
paragraph = paragraph.align(wasm.SpecialIndentKind.Hanging);
|
||||
kind = wasm.SpecialIndentKind.Hanging;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -203,6 +203,7 @@ export class Docx {
|
|||
const cell = this.buildCell(c);
|
||||
row = row.add_cell(cell);
|
||||
});
|
||||
table = table.add_row(row);
|
||||
});
|
||||
table = table.set_grid(new Uint32Array(t.grid));
|
||||
|
||||
|
|
|
@ -40,37 +40,37 @@ export class Run {
|
|||
}
|
||||
|
||||
size(size: number) {
|
||||
this.property.size = size;
|
||||
this.property = { ...this.property, size };
|
||||
return this;
|
||||
}
|
||||
|
||||
color(color: string) {
|
||||
this.property.color = color;
|
||||
this.property = { ...this.property, color };
|
||||
return this;
|
||||
}
|
||||
|
||||
highlight(color: string) {
|
||||
this.property.highlight = color;
|
||||
this.property = { ...this.property, highlight: color };
|
||||
return this;
|
||||
}
|
||||
|
||||
bold() {
|
||||
this.property.bold = true;
|
||||
this.property = { ...this.property, bold: true };
|
||||
return this;
|
||||
}
|
||||
|
||||
italic() {
|
||||
this.property.italic = true;
|
||||
this.property = { ...this.property, italic: true };
|
||||
return this;
|
||||
}
|
||||
|
||||
underline(type: string) {
|
||||
this.property.underline = type;
|
||||
this.property = { ...this.property, underline: type };
|
||||
return this;
|
||||
}
|
||||
|
||||
vanish() {
|
||||
this.property.vanish = true;
|
||||
this.property = { ...this.property, vanish: true };
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -10,7 +10,7 @@ export type CellProperty = {
|
|||
|
||||
export class TableCell {
|
||||
children: Paragraph[] = [];
|
||||
property: CellProperty;
|
||||
property: CellProperty = {};
|
||||
|
||||
addParagraph(p: Paragraph) {
|
||||
this.children.push(p);
|
||||
|
|
|
@ -11,7 +11,7 @@ export type TableProperty = {
|
|||
export class Table {
|
||||
rows: TableRow[] = [];
|
||||
grid: number[] = [];
|
||||
property: TableProperty;
|
||||
property: TableProperty = {};
|
||||
|
||||
addRow(row: TableRow) {
|
||||
this.rows.push(row);
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "docx-wasm",
|
||||
"version": "0.0.11",
|
||||
"version": "0.0.19",
|
||||
"main": "dist/index.js",
|
||||
"author": "bokuweb <bokuweb12@gmail.com>",
|
||||
"license": "MIT",
|
||||
|
|
|
@ -14,5 +14,6 @@
|
|||
"esModuleInterop": true,
|
||||
"outDir": "dist",
|
||||
"declaration": true
|
||||
}
|
||||
},
|
||||
"include": ["js"]
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue