#1303 Re-name methods to be full english words
This commit is contained in:
@ -1,12 +1,12 @@
|
|||||||
import { expect } from "chai";
|
import { expect } from "chai";
|
||||||
|
|
||||||
import { Formatter } from "export/formatter";
|
import { Formatter } from "export/formatter";
|
||||||
import { PageTDirection, PageTextDirection } from "./page-text-direction";
|
import { PageTextDirection, PageTextDirectionType } from "./page-text-direction";
|
||||||
|
|
||||||
describe("PageTextDirection", () => {
|
describe("PageTextDirection", () => {
|
||||||
describe("#constructor()", () => {
|
describe("#constructor()", () => {
|
||||||
it("should set the direction of the text flow to top-to-bottom-right-to-left", () => {
|
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);
|
const tree = new Formatter().format(textDirection);
|
||||||
|
|
||||||
|
@ -1,16 +1,16 @@
|
|||||||
import { XmlAttributeComponent, XmlComponent } from "file/xml-components";
|
import { XmlAttributeComponent, XmlComponent } from "file/xml-components";
|
||||||
|
|
||||||
export enum PageTextDirection {
|
export enum PageTextDirectionType {
|
||||||
LEFT_TO_RIGHT_TOP_TO_BOTTOM = "lrTb",
|
LEFT_TO_RIGHT_TOP_TO_BOTTOM = "lrTb",
|
||||||
TOP_TO_BOTTOM_RIGHT_TO_LEFT = "tbRl",
|
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" };
|
protected readonly xmlKeys = { val: "w:val" };
|
||||||
}
|
}
|
||||||
|
|
||||||
export class PageTDirection extends XmlComponent {
|
export class PageTextDirection extends XmlComponent {
|
||||||
constructor(value: PageTextDirection) {
|
constructor(value: PageTextDirectionType) {
|
||||||
super("w:textDirection");
|
super("w:textDirection");
|
||||||
|
|
||||||
this.root.push(
|
this.root.push(
|
||||||
|
@ -11,7 +11,7 @@ import { VerticalAlign } from "file/vertical-align";
|
|||||||
import { PageOrientation } from "./properties";
|
import { PageOrientation } from "./properties";
|
||||||
import { LineNumberRestartFormat } from "./properties/line-number";
|
import { LineNumberRestartFormat } from "./properties/line-number";
|
||||||
import { PageBorderOffsetFrom } from "./properties/page-borders";
|
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 { SectionType } from "./properties/section-type";
|
||||||
import { sectionMarginDefaults, sectionPageSizeDefaults, SectionProperties } from "./section-properties";
|
import { sectionMarginDefaults, sectionPageSizeDefaults, SectionProperties } from "./section-properties";
|
||||||
|
|
||||||
@ -263,7 +263,7 @@ describe("SectionProperties", () => {
|
|||||||
it("should create section properties with text flow direction", () => {
|
it("should create section properties with text flow direction", () => {
|
||||||
const properties = new SectionProperties({
|
const properties = new SectionProperties({
|
||||||
page: {
|
page: {
|
||||||
textDirection: PageTextDirection.TOP_TO_BOTTOM_RIGHT_TO_LEFT,
|
textDirection: PageTextDirectionType.TOP_TO_BOTTOM_RIGHT_TO_LEFT,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
const tree = new Formatter().format(properties);
|
const tree = new Formatter().format(properties);
|
||||||
|
@ -15,7 +15,7 @@ import { IPageBordersOptions, PageBorders } from "./properties/page-borders";
|
|||||||
import { IPageMarginAttributes, PageMargin } from "./properties/page-margin";
|
import { IPageMarginAttributes, PageMargin } from "./properties/page-margin";
|
||||||
import { IPageNumberTypeAttributes, PageNumberType } from "./properties/page-number";
|
import { IPageNumberTypeAttributes, PageNumberType } from "./properties/page-number";
|
||||||
import { IPageSizeAttributes, PageOrientation, PageSize } from "./properties/page-size";
|
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";
|
import { SectionType, Type } from "./properties/section-type";
|
||||||
|
|
||||||
export interface IHeaderFooterGroup<T> {
|
export interface IHeaderFooterGroup<T> {
|
||||||
@ -30,7 +30,7 @@ export interface ISectionPropertiesOptions {
|
|||||||
readonly margin?: IPageMarginAttributes;
|
readonly margin?: IPageMarginAttributes;
|
||||||
readonly pageNumbers?: IPageNumberTypeAttributes;
|
readonly pageNumbers?: IPageNumberTypeAttributes;
|
||||||
readonly borders?: IPageBordersOptions;
|
readonly borders?: IPageBordersOptions;
|
||||||
readonly textDirection?: PageTextDirection;
|
readonly textDirection?: PageTextDirectionType;
|
||||||
};
|
};
|
||||||
readonly grid?: IDocGridAttributesProperties;
|
readonly grid?: IDocGridAttributesProperties;
|
||||||
readonly headerWrapperGroup?: IHeaderFooterGroup<HeaderWrapper>;
|
readonly headerWrapperGroup?: IHeaderFooterGroup<HeaderWrapper>;
|
||||||
@ -156,7 +156,7 @@ export class SectionProperties extends XmlComponent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (textDirection) {
|
if (textDirection) {
|
||||||
this.root.push(new PageTDirection(textDirection));
|
this.root.push(new PageTextDirection(textDirection));
|
||||||
}
|
}
|
||||||
|
|
||||||
this.root.push(new DocumentGrid(linePitch));
|
this.root.push(new DocumentGrid(linePitch));
|
||||||
|
Reference in New Issue
Block a user