added bullet

This commit is contained in:
Dolan Miu
2016-03-30 02:55:11 +01:00
parent 099da3d90c
commit b749e42671
7 changed files with 106 additions and 15 deletions

View File

@ -3,17 +3,9 @@ import {ThematicBreak} from "./border";
import {PageBreak} from "./page-break";
import {TextRun} from "./text-run";
import {ParagraphProperties} from "./properties";
class Style {
private pStyle: Array<XmlComponent>;
constructor(type: string) {
this.pStyle = new Array<XmlComponent>();
this.pStyle.push(new Attributes({
val: type
}));
}
}
import {TabStop} from "../tab-stop";
import {Style} from "./style";
import {NumberProperties} from "./unordered-list";
class Alignment {
private jc: Array<XmlComponent>;
@ -102,4 +94,15 @@ export class Paragraph {
this.properties.push(new PageBreak());
return this;
}
addTabStop(tabStop: TabStop) {
this.properties.push(tabStop);
return this;
}
bullet() {
this.properties.push(new Style("ListParagraph"));
this.properties.push(new NumberProperties());
return this;
}
}

View File

@ -0,0 +1,12 @@
import {XmlComponent, Attributes} from "../xml-components";
export class Style implements XmlComponent {
private pStyle: Array<XmlComponent>;
constructor(type: string) {
this.pStyle = new Array<XmlComponent>();
this.pStyle.push(new Attributes({
val: type
}));
}
}

View File

@ -0,0 +1,34 @@
import {XmlComponent, Attributes} from "../xml-components";
import {Style} from "./style";
export class NumberProperties implements XmlComponent {
private numPr: Array<XmlComponent>;
constructor() {
this.numPr = new Array<XmlComponent>();
this.numPr.push(new IndentLevel(0));
this.numPr.push(new NumberId(1));
}
}
export class IndentLevel implements XmlComponent {
private ilvl: Array<XmlComponent>;
constructor(level: number) {
this.ilvl = new Array<XmlComponent>();
this.ilvl.push(new Attributes({
val: level
}));
}
}
export class NumberId implements XmlComponent {
private ilvl: Array<XmlComponent>;
constructor(id: number) {
this.ilvl = new Array<XmlComponent>();
this.ilvl.push(new Attributes({
val: id
}));
}
}

View File

@ -1,3 +1,3 @@
export class TapStop {
}
export class TabStop {
}

View File

@ -3,7 +3,7 @@ export interface XmlComponent {
}
interface AttributesProperties {
val?: string;
val?: any;
color?: string;
space?: string;
sz?: string;