diff --git a/ts/docx/border.ts b/ts/docx/border.ts new file mode 100644 index 0000000000..deedd98fba --- /dev/null +++ b/ts/docx/border.ts @@ -0,0 +1,24 @@ +import {P, Attributes} from "./xml-components"; + +class Border implements P { + private bottom: Array
; + + constructor() { + this.bottom = new Array
(); + this.bottom.push(new Attributes({ + color: "auto", + space: "1", + val: "single", + sz: "6" + })); + } +} + +export class ThematicBreak { + private pBdr: Array
; + + constructor() { + this.pBdr = new Array
(); + this.pBdr.push(new Border()); + } +} \ No newline at end of file diff --git a/ts/docx/paragraph.ts b/ts/docx/paragraph.ts index 024c34fd50..308aaecf66 100644 --- a/ts/docx/paragraph.ts +++ b/ts/docx/paragraph.ts @@ -5,7 +5,9 @@ class Style { constructor(type: string) { this.pStyle = new Array
(); - this.pStyle.push(new Attributes(type)); + this.pStyle.push(new Attributes({ + val: type + })); } } @@ -14,7 +16,9 @@ class Alignment { constructor(type: string) { this.jc = new Array
(); - this.jc.push(new Attributes(type)); + this.jc.push(new Attributes({ + val: type + })); } } diff --git a/ts/docx/xml-components/index.ts b/ts/docx/xml-components/index.ts index c2f18b077a..cb4363f5f5 100644 --- a/ts/docx/xml-components/index.ts +++ b/ts/docx/xml-components/index.ts @@ -2,24 +2,33 @@ export interface P { } +interface AttributesProperties { + val?: string; + color?: string; + space?: string; + sz?: string; +} + export class Attributes implements P { private _attrs: Object; - constructor(value?: string) { - this._attrs = { - val: value - }; + constructor(properties?: AttributesProperties) { + this._attrs = properties + + if (!properties) { + this._attrs = {}; + } } } -export class ParagraphProperties implements P{ +export class ParagraphProperties implements P { private pPr: Array
; constructor() { this.pPr = new Array
();
this.pPr.push(new Attributes());
}
-
+
push(item: P) {
this.pPr.push(item);
}
diff --git a/ts/tests/attributeTest.ts b/ts/tests/attributeTest.ts
index 9436e51bff..24eb317eee 100644
--- a/ts/tests/attributeTest.ts
+++ b/ts/tests/attributeTest.ts
@@ -1,6 +1,6 @@
///