From e136f4e987e3f800b384a9bddbc592c6e6ddc844 Mon Sep 17 00:00:00 2001 From: amitm02 Date: Wed, 25 Jul 2018 13:07:58 +0300 Subject: [PATCH] more alignments --- src/file/paragraph/formatting/alignment.ts | 2 +- src/file/paragraph/paragraph.ts | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/src/file/paragraph/formatting/alignment.ts b/src/file/paragraph/formatting/alignment.ts index fbf0fdcdae..b1fa0ca2af 100644 --- a/src/file/paragraph/formatting/alignment.ts +++ b/src/file/paragraph/formatting/alignment.ts @@ -1,7 +1,7 @@ // http://officeopenxml.com/WPalignment.php import { XmlAttributeComponent, XmlComponent } from "file/xml-components"; -export type AlignmentOptions = "left" | "center" | "right" | "both"; +export type AlignmentOptions = "start" | "end" | "center" | "both" | "distribute" | "left" | "right"; export class AlignmentAttributes extends XmlAttributeComponent<{ val: AlignmentOptions }> { protected xmlKeys = { val: "w:val" }; diff --git a/src/file/paragraph/paragraph.ts b/src/file/paragraph/paragraph.ts index 35faf62005..3695b70bd5 100644 --- a/src/file/paragraph/paragraph.ts +++ b/src/file/paragraph/paragraph.ts @@ -110,6 +110,21 @@ export class Paragraph extends XmlComponent { return this; } + public start(): Paragraph { + this.properties.push(new Alignment("start")); + return this; + } + + public end(): Paragraph { + this.properties.push(new Alignment("end")); + return this; + } + + public distribute(): Paragraph { + this.properties.push(new Alignment("distribute")); + return this; + } + public justified(): Paragraph { this.properties.push(new Alignment("both")); return this;