Allow contextual spacing to be specified as an argument to paragraph style
This commit is contained in:
@ -29,6 +29,7 @@ export interface IRunStyleOptions {
|
|||||||
export interface IParagraphStyleOptions2 {
|
export interface IParagraphStyleOptions2 {
|
||||||
readonly alignment?: AlignmentType;
|
readonly alignment?: AlignmentType;
|
||||||
readonly thematicBreak?: boolean;
|
readonly thematicBreak?: boolean;
|
||||||
|
readonly contextualSpacing?: boolean;
|
||||||
readonly rightTabStop?: number;
|
readonly rightTabStop?: number;
|
||||||
readonly leftTabStop?: number;
|
readonly leftTabStop?: number;
|
||||||
readonly indent?: IIndentAttributesProperties;
|
readonly indent?: IIndentAttributesProperties;
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { Alignment, Indent, KeepLines, KeepNext, OutlineLevel, ParagraphProperties, Spacing, ThematicBreak } from "file/paragraph";
|
import { Alignment, ContextualSpacing, Indent, KeepLines, KeepNext, OutlineLevel, ParagraphProperties, Spacing, ThematicBreak } from "file/paragraph";
|
||||||
import { TabStop, TabStopType } from "file/paragraph/formatting";
|
import { TabStop, TabStopType } from "file/paragraph/formatting";
|
||||||
import * as formatting from "file/paragraph/run/formatting";
|
import * as formatting from "file/paragraph/run/formatting";
|
||||||
import { RunProperties } from "file/paragraph/run/properties";
|
import { RunProperties } from "file/paragraph/run/properties";
|
||||||
@ -134,6 +134,10 @@ export class ParagraphStyle extends Style {
|
|||||||
this.paragraphProperties.push(new ThematicBreak());
|
this.paragraphProperties.push(new ThematicBreak());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (options.paragraph.contextualSpacing) {
|
||||||
|
this.paragraphProperties.push(new ContextualSpacing(options.paragraph.contextualSpacing));
|
||||||
|
}
|
||||||
|
|
||||||
if (options.paragraph.rightTabStop) {
|
if (options.paragraph.rightTabStop) {
|
||||||
this.paragraphProperties.push(new TabStop(TabStopType.RIGHT, options.paragraph.rightTabStop));
|
this.paragraphProperties.push(new TabStop(TabStopType.RIGHT, options.paragraph.rightTabStop));
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user