change shading val -> type
This commit is contained in:
@ -17,7 +17,7 @@ describe("Shading", () => {
|
||||
});
|
||||
|
||||
it("should create with params", () => {
|
||||
const shading = new Shading({ val: ShadingType.PERCENT_40, color: "FF0000", fill: "555555" });
|
||||
const shading = new Shading({ type: ShadingType.PERCENT_40, color: "FF0000", fill: "555555" });
|
||||
const tree = new Formatter().format(shading);
|
||||
expect(tree).to.deep.equal({
|
||||
"w:shd": {
|
||||
|
@ -23,25 +23,25 @@ import { hexColorValue } from "../values";
|
||||
export interface IShadingAttributesProperties {
|
||||
readonly fill?: string;
|
||||
readonly color?: string;
|
||||
readonly val?: ShadingType;
|
||||
readonly type?: ShadingType;
|
||||
}
|
||||
|
||||
class ShadingAttributes extends XmlAttributeComponent<IShadingAttributesProperties> {
|
||||
protected readonly xmlKeys = {
|
||||
fill: "w:fill",
|
||||
color: "w:color",
|
||||
val: "w:val",
|
||||
type: "w:val",
|
||||
};
|
||||
}
|
||||
|
||||
export class Shading extends XmlComponent {
|
||||
constructor({ fill, color, val }: IShadingAttributesProperties) {
|
||||
constructor({ fill, color, type }: IShadingAttributesProperties) {
|
||||
super("w:shd");
|
||||
this.root.push(
|
||||
new ShadingAttributes({
|
||||
fill: fill === undefined ? undefined : hexColorValue(fill),
|
||||
color: color === undefined ? undefined : hexColorValue(color),
|
||||
val,
|
||||
type,
|
||||
}),
|
||||
);
|
||||
}
|
||||
|
Reference in New Issue
Block a user