2017-09-22 14:46:19 +01:00
|
|
|
// http://officeopenxml.com/WPalignment.php
|
2017-12-30 20:25:16 +00:00
|
|
|
import { XmlAttributeComponent, XmlComponent } from "file/xml-components";
|
2017-03-12 21:35:30 +01:00
|
|
|
|
2019-06-12 01:03:36 +01:00
|
|
|
export enum AlignmentType {
|
2018-11-02 02:51:57 +00:00
|
|
|
START = "start",
|
|
|
|
END = "end",
|
|
|
|
CENTER = "center",
|
|
|
|
BOTH = "both",
|
2019-06-12 01:03:36 +01:00
|
|
|
JUSTIFIED = "both",
|
2018-11-02 02:51:57 +00:00
|
|
|
DISTRIBUTE = "distribute",
|
|
|
|
LEFT = "left",
|
|
|
|
RIGHT = "right",
|
|
|
|
}
|
2017-03-12 21:35:30 +01:00
|
|
|
|
2019-06-12 01:03:36 +01:00
|
|
|
export class AlignmentAttributes extends XmlAttributeComponent<{ readonly val: AlignmentType }> {
|
2018-11-02 02:51:57 +00:00
|
|
|
protected readonly xmlKeys = { val: "w:val" };
|
2017-03-12 21:35:30 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
export class Alignment extends XmlComponent {
|
2019-06-12 01:03:36 +01:00
|
|
|
constructor(type: AlignmentType) {
|
2017-03-12 21:35:30 +01:00
|
|
|
super("w:jc");
|
2018-01-23 01:33:12 +00:00
|
|
|
this.root.push(new AlignmentAttributes({ val: type }));
|
2017-03-12 21:35:30 +01:00
|
|
|
}
|
|
|
|
}
|