added xmlKeys to xmlcomponent

This commit is contained in:
Dolan Miu
2016-04-03 01:44:18 +01:00
parent a70e82a7d0
commit 69edfcc0c9
24 changed files with 137 additions and 59 deletions

View File

@ -1,7 +1,11 @@
import {XmlComponent, Attributes} from "../../xml-components";
export class Columns {
export class Columns implements XmlComponent {
private cols: Array<XmlComponent>;
xmlKeys = {
cols: 'w:cols'
}
constructor() {
this.cols = new Array<XmlComponent>();

View File

@ -1,7 +1,11 @@
import {XmlComponent, Attributes} from "../../xml-components";
export class DocumentGrid {
export class DocumentGrid implements XmlComponent {
private docGrid: Array<XmlComponent>;
xmlKeys = {
docGrid: 'w:docGrid'
}
constructor() {
this.docGrid = new Array<XmlComponent>();

View File

@ -5,9 +5,13 @@ import {PageMargin} from "./page-margin";
import {Columns} from "./columns";
import {DocumentGrid} from "./doc-grid";
export class Body {
export class Body implements XmlComponent {
private body: Array<XmlComponent>;
xmlKeys = {
body: 'w:body'
}
constructor() {
this.body = new Array<XmlComponent>();
this.body.push(new SectionProperties());
@ -16,7 +20,7 @@ export class Body {
this.body.push(new Columns());
this.body.push(new DocumentGrid());
}
push(component: XmlComponent) {
this.body.push(component);
}

View File

@ -1,7 +1,11 @@
import {XmlComponent, Attributes} from "../../xml-components";
export class PageMargin {
export class PageMargin implements XmlComponent {
private pgMar: Array<XmlComponent>;
xmlKeys = {
pgMar: 'w:pgMar'
}
constructor() {
this.pgMar = new Array<XmlComponent>();

View File

@ -1,7 +1,11 @@
import {XmlComponent, Attributes} from "../../xml-components";
export class PageSize {
export class PageSize implements XmlComponent {
private pgSz: Array<XmlComponent>;
xmlKeys = {
pgSz: 'w:pgSz'
}
constructor() {
this.pgSz = new Array<XmlComponent>();

View File

@ -1,8 +1,12 @@
import {XmlComponent, Attributes} from "../../xml-components";
export class SectionProperties {
export class SectionProperties implements XmlComponent {
private sectPr: Array<XmlComponent>;
xmlKeys = {
sectPr: 'sectPr'
}
constructor() {
this.sectPr = new Array<XmlComponent>();
this.sectPr.push(new Attributes({