contextual spacing
This commit is contained in:
@ -1,5 +1,5 @@
|
||||
// http://officeopenxml.com/WPspacing.php
|
||||
import { XmlAttributeComponent, XmlComponent } from "file/xml-components";
|
||||
import { Attributes, XmlAttributeComponent, XmlComponent } from "file/xml-components";
|
||||
|
||||
export interface ISpacingProperties {
|
||||
after?: number;
|
||||
@ -23,3 +23,14 @@ export class Spacing extends XmlComponent {
|
||||
this.root.push(new SpacingAttributes(opts));
|
||||
}
|
||||
}
|
||||
|
||||
export class ContextualSpacing extends XmlComponent {
|
||||
constructor(value: boolean) {
|
||||
super("w:contextualSpacing");
|
||||
this.root.push(
|
||||
new Attributes({
|
||||
val: value === false ? 0 : 1,
|
||||
}),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -10,7 +10,7 @@ import { Border, ThematicBreak } from "./formatting/border";
|
||||
import { IIndentAttributesProperties, Indent } from "./formatting/indent";
|
||||
import { KeepLines, KeepNext } from "./formatting/keep";
|
||||
import { PageBreak, PageBreakBefore } from "./formatting/page-break";
|
||||
import { ISpacingProperties, Spacing } from "./formatting/spacing";
|
||||
import { ContextualSpacing, ISpacingProperties, Spacing } from "./formatting/spacing";
|
||||
import { Style } from "./formatting/style";
|
||||
import { CenterTabStop, LeaderType, LeftTabStop, MaxRightTabStop, RightTabStop } from "./formatting/tab-stop";
|
||||
import { NumberProperties } from "./formatting/unordered-list";
|
||||
@ -211,6 +211,11 @@ export class Paragraph extends XmlComponent {
|
||||
return this;
|
||||
}
|
||||
|
||||
public contextualSpacing(value: boolean): Paragraph {
|
||||
this.properties.push(new ContextualSpacing(value));
|
||||
return this;
|
||||
}
|
||||
|
||||
public keepNext(): Paragraph {
|
||||
this.properties.push(new KeepNext());
|
||||
return this;
|
||||
|
Reference in New Issue
Block a user