diff --git a/src/file/document/body/section-properties/properties/page-text-direction.spec.ts b/src/file/document/body/section-properties/properties/page-text-direction.spec.ts index da6a06e4a4..b8c9fa6f68 100644 --- a/src/file/document/body/section-properties/properties/page-text-direction.spec.ts +++ b/src/file/document/body/section-properties/properties/page-text-direction.spec.ts @@ -1,12 +1,12 @@ import { expect } from "chai"; import { Formatter } from "export/formatter"; -import { PageTDirection, PageTextDirection } from "./page-text-direction"; +import { PageTextDirection, PageTextDirectionType } from "./page-text-direction"; describe("PageTextDirection", () => { describe("#constructor()", () => { it("should set the direction of the text flow to top-to-bottom-right-to-left", () => { - const textDirection = new PageTDirection(PageTextDirection.TOP_TO_BOTTOM_RIGHT_TO_LEFT); + const textDirection = new PageTextDirection(PageTextDirectionType.TOP_TO_BOTTOM_RIGHT_TO_LEFT); const tree = new Formatter().format(textDirection); diff --git a/src/file/document/body/section-properties/properties/page-text-direction.ts b/src/file/document/body/section-properties/properties/page-text-direction.ts index 6edd300980..0136f18428 100644 --- a/src/file/document/body/section-properties/properties/page-text-direction.ts +++ b/src/file/document/body/section-properties/properties/page-text-direction.ts @@ -1,16 +1,16 @@ import { XmlAttributeComponent, XmlComponent } from "file/xml-components"; -export enum PageTextDirection { +export enum PageTextDirectionType { LEFT_TO_RIGHT_TOP_TO_BOTTOM = "lrTb", TOP_TO_BOTTOM_RIGHT_TO_LEFT = "tbRl", } -class PageTextDirectionAttributes extends XmlAttributeComponent<{ readonly val: PageTextDirection }> { +class PageTextDirectionAttributes extends XmlAttributeComponent<{ readonly val: PageTextDirectionType }> { protected readonly xmlKeys = { val: "w:val" }; } -export class PageTDirection extends XmlComponent { - constructor(value: PageTextDirection) { +export class PageTextDirection extends XmlComponent { + constructor(value: PageTextDirectionType) { super("w:textDirection"); this.root.push( diff --git a/src/file/document/body/section-properties/section-properties.spec.ts b/src/file/document/body/section-properties/section-properties.spec.ts index 9460f16d9b..2cc0d7fd44 100644 --- a/src/file/document/body/section-properties/section-properties.spec.ts +++ b/src/file/document/body/section-properties/section-properties.spec.ts @@ -11,7 +11,7 @@ import { VerticalAlign } from "file/vertical-align"; import { PageOrientation } from "./properties"; import { LineNumberRestartFormat } from "./properties/line-number"; import { PageBorderOffsetFrom } from "./properties/page-borders"; -import { PageTextDirection } from "./properties/page-text-direction"; +import { PageTextDirectionType } from "./properties/page-text-direction"; import { SectionType } from "./properties/section-type"; import { sectionMarginDefaults, sectionPageSizeDefaults, SectionProperties } from "./section-properties"; @@ -263,7 +263,7 @@ describe("SectionProperties", () => { it("should create section properties with text flow direction", () => { const properties = new SectionProperties({ page: { - textDirection: PageTextDirection.TOP_TO_BOTTOM_RIGHT_TO_LEFT, + textDirection: PageTextDirectionType.TOP_TO_BOTTOM_RIGHT_TO_LEFT, }, }); const tree = new Formatter().format(properties); diff --git a/src/file/document/body/section-properties/section-properties.ts b/src/file/document/body/section-properties/section-properties.ts index 22591ede9d..36b230582b 100644 --- a/src/file/document/body/section-properties/section-properties.ts +++ b/src/file/document/body/section-properties/section-properties.ts @@ -15,7 +15,7 @@ import { IPageBordersOptions, PageBorders } from "./properties/page-borders"; import { IPageMarginAttributes, PageMargin } from "./properties/page-margin"; import { IPageNumberTypeAttributes, PageNumberType } from "./properties/page-number"; import { IPageSizeAttributes, PageOrientation, PageSize } from "./properties/page-size"; -import { PageTDirection, PageTextDirection } from "./properties/page-text-direction"; +import { PageTextDirection, PageTextDirectionType } from "./properties/page-text-direction"; import { SectionType, Type } from "./properties/section-type"; export interface IHeaderFooterGroup { @@ -30,7 +30,7 @@ export interface ISectionPropertiesOptions { readonly margin?: IPageMarginAttributes; readonly pageNumbers?: IPageNumberTypeAttributes; readonly borders?: IPageBordersOptions; - readonly textDirection?: PageTextDirection; + readonly textDirection?: PageTextDirectionType; }; readonly grid?: IDocGridAttributesProperties; readonly headerWrapperGroup?: IHeaderFooterGroup; @@ -156,7 +156,7 @@ export class SectionProperties extends XmlComponent { } if (textDirection) { - this.root.push(new PageTDirection(textDirection)); + this.root.push(new PageTextDirection(textDirection)); } this.root.push(new DocumentGrid(linePitch));