diff --git a/demo/48-vertical-align.ts b/demo/48-vertical-align.ts index c22e6da45a..a9eb7986da 100644 --- a/demo/48-vertical-align.ts +++ b/demo/48-vertical-align.ts @@ -7,7 +7,7 @@ const doc = new Document(); doc.addSection({ properties: { - valign: SectionVerticalAlignValue.Center, + verticalAlign: SectionVerticalAlignValue.CENTER, }, children: [ new Paragraph({ diff --git a/src/file/document/body/section-properties/section-properties.ts b/src/file/document/body/section-properties/section-properties.ts index b4732dea32..37e09e4498 100644 --- a/src/file/document/body/section-properties/section-properties.ts +++ b/src/file/document/body/section-properties/section-properties.ts @@ -89,7 +89,7 @@ export class SectionProperties extends XmlComponent { pageBorderBottom, pageBorderLeft, titlePage = false, - valign, + verticalAlign, } = options; this.options = options; @@ -125,8 +125,8 @@ export class SectionProperties extends XmlComponent { this.root.push(new TitlePage()); } - if (valign) { - this.root.push(new SectionVerticalAlign(valign)); + if (verticalAlign) { + this.root.push(new SectionVerticalAlign(verticalAlign)); } } diff --git a/src/file/document/body/section-properties/vertical-align/vertical-align-attributes.ts b/src/file/document/body/section-properties/vertical-align/vertical-align-attributes.ts index 3e7af94460..fa09712a00 100644 --- a/src/file/document/body/section-properties/vertical-align/vertical-align-attributes.ts +++ b/src/file/document/body/section-properties/vertical-align/vertical-align-attributes.ts @@ -2,11 +2,11 @@ import { XmlAttributeComponent } from "file/xml-components"; import { SectionVerticalAlignValue } from "./vertical-align"; export interface ISectionVerticalAlignAttributes { - readonly valign?: SectionVerticalAlignValue; + readonly verticalAlign?: SectionVerticalAlignValue; } export class SectionVerticalAlignAttributes extends XmlAttributeComponent { protected readonly xmlKeys = { - valign: "w:val", + verticalAlign: "w:val", }; } diff --git a/src/file/document/body/section-properties/vertical-align/vertical-align.ts b/src/file/document/body/section-properties/vertical-align/vertical-align.ts index bde6408ddd..b025059d16 100644 --- a/src/file/document/body/section-properties/vertical-align/vertical-align.ts +++ b/src/file/document/body/section-properties/vertical-align/vertical-align.ts @@ -4,15 +4,15 @@ import { XmlComponent } from "file/xml-components"; import { SectionVerticalAlignAttributes } from "./vertical-align-attributes"; export enum SectionVerticalAlignValue { - Both = "both", - Bottom = "bottom", - Center = "center", - Top = "top", + BOTH = "both", + BOTTOM = "bottom", + CENTER = "center", + TOP = "top", } export class SectionVerticalAlign extends XmlComponent { constructor(value: SectionVerticalAlignValue) { super("w:vAlign"); - this.root.push(new SectionVerticalAlignAttributes({ valign: value })); + this.root.push(new SectionVerticalAlignAttributes({ verticalAlign: value })); } }