unify Shading; breaking change: Paragraph/Run shading option key type changed to val, and shadow alias removed

This commit is contained in:
Tom Hunkapiller
2021-05-23 04:25:07 +03:00
parent fcc393aca2
commit 496fcb55fa
22 changed files with 70 additions and 162 deletions

View File

@ -1,7 +1,7 @@
// http://officeopenxml.com/WPparagraphProperties.php
import { IContext, IgnoreIfEmptyXmlComponent, IXmlableObject, XmlComponent } from "file/xml-components";
import { DocumentWrapper } from "../document-wrapper";
import { ShadingType } from "../table/shading";
import { IShadingAttributesProperties, Shading } from "../shading";
import { Alignment, AlignmentType } from "./formatting/alignment";
import { Bidirectional } from "./formatting/bidirectional";
import { Border, IBorderOptions, ThematicBreak } from "./formatting/border";
@ -15,7 +15,6 @@ import { NumberProperties } from "./formatting/unordered-list";
import { WidowControl } from "./formatting/widow-control";
import { FrameProperties, IFrameOptions } from "./frame/frame-properties";
import { OutlineLevel } from "./links";
import { Shading } from "./run/formatting";
export interface IParagraphStylePropertiesOptions {
readonly alignment?: AlignmentType;
@ -50,11 +49,7 @@ export interface IParagraphPropertiesOptions extends IParagraphStylePropertiesOp
readonly instance?: number;
readonly custom?: boolean;
};
readonly shading?: {
readonly type: ShadingType;
readonly fill: string;
readonly color: string;
};
readonly shading?: IShadingAttributesProperties;
readonly widowControl?: boolean;
readonly frame?: IFrameOptions;
}
@ -131,7 +126,7 @@ export class ParagraphProperties extends IgnoreIfEmptyXmlComponent {
}
if (options.shading) {
this.push(new Shading(options.shading.type, options.shading.fill, options.shading.color));
this.push(new Shading(options.shading));
}
if (options.rightTabStop) {