Declarative hyperlinks, bookmarks, tab stops and page breaks
This commit is contained in:
@ -8,8 +8,9 @@ import {
|
||||
KeepLines,
|
||||
KeepNext,
|
||||
LeftTabStop,
|
||||
MaxRightTabStop,
|
||||
RightTabStop,
|
||||
Spacing,
|
||||
TabStopPosition,
|
||||
ThematicBreak,
|
||||
} from "../paragraph/formatting";
|
||||
import { ParagraphProperties } from "../paragraph/properties";
|
||||
@ -235,9 +236,8 @@ export class LevelBase extends XmlComponent {
|
||||
return this;
|
||||
}
|
||||
|
||||
public maxRightTabStop(): Level {
|
||||
this.addParagraphProperty(new MaxRightTabStop());
|
||||
return this;
|
||||
public rightTabStop(position: number): Level {
|
||||
return this.addParagraphProperty(new RightTabStop(position));
|
||||
}
|
||||
|
||||
public leftTabStop(position: number): Level {
|
||||
|
@ -8,6 +8,7 @@ import { Num } from "./num";
|
||||
import { Numbering } from "./numbering";
|
||||
|
||||
import { EMPTY_OBJECT } from "file/xml-components";
|
||||
import { TabStopPosition } from "../paragraph";
|
||||
|
||||
describe("Numbering", () => {
|
||||
let numbering: Numbering;
|
||||
@ -202,7 +203,7 @@ describe("AbstractNumbering", () => {
|
||||
|
||||
it("#maxRightTabStop", () => {
|
||||
const abstractNumbering = new AbstractNumbering(1);
|
||||
const level = abstractNumbering.createLevel(0, "lowerRoman", "%0.").maxRightTabStop();
|
||||
const level = abstractNumbering.createLevel(0, "lowerRoman", "%0.").rightTabStop(TabStopPosition.MAX);
|
||||
const tree = new Formatter().format(level);
|
||||
expect(tree["w:lvl"]).to.include({
|
||||
"w:pPr": [
|
||||
|
Reference in New Issue
Block a user