numbering: add support to define suffix for numbering level

This commit is contained in:
Igor Bulovski
2018-07-06 18:54:30 +02:00
parent c95e765456
commit a05abd0eea
2 changed files with 23 additions and 0 deletions

View File

@ -1,2 +1,3 @@
export * from "./numbering"; export * from "./numbering";
export * from "./abstract-numbering"; export * from "./abstract-numbering";
export * from "./level";

View File

@ -60,6 +60,23 @@ class LevelJc extends XmlComponent {
} }
} }
export enum LevelSuffix {
NOTHING = "nothing",
SPACE = "space",
TAB = "tab",
}
class Suffix extends XmlComponent {
constructor(value: LevelSuffix) {
super("w:suff");
this.root.push(
new Attributes({
val: value,
}),
);
}
}
export class LevelBase extends XmlComponent { export class LevelBase extends XmlComponent {
private readonly paragraphProperties: ParagraphProperties; private readonly paragraphProperties: ParagraphProperties;
private readonly runProperties: RunProperties; private readonly runProperties: RunProperties;
@ -93,6 +110,11 @@ export class LevelBase extends XmlComponent {
this.root.push(this.runProperties); this.root.push(this.runProperties);
} }
public setSuffix(value: LevelSuffix) {
this.root.push(new Suffix(value));
return this;
}
public addParagraphProperty(property: XmlComponent): Level { public addParagraphProperty(property: XmlComponent): Level {
this.paragraphProperties.push(property); this.paragraphProperties.push(property);
return this; return this;