clean up latentstyles to use modern attribute implementation
This commit is contained in:
@ -3,7 +3,6 @@ import { XmlComponent } from "../docx/xml-components";
|
|||||||
import { DocumentDefaults } from "./defaults";
|
import { DocumentDefaults } from "./defaults";
|
||||||
import { LatentStyles } from "./latent-styles";
|
import { LatentStyles } from "./latent-styles";
|
||||||
import { LatentStyleException } from "./latent-styles/exceptions";
|
import { LatentStyleException } from "./latent-styles/exceptions";
|
||||||
import { LatentStyleExceptionAttributes } from "./latent-styles/exceptions/attributes";
|
|
||||||
import { ParagraphStyle } from "./style";
|
import { ParagraphStyle } from "./style";
|
||||||
|
|
||||||
export class Styles extends XmlComponent {
|
export class Styles extends XmlComponent {
|
||||||
|
27
ts/styles/latent-styles/exceptions.ts
Normal file
27
ts/styles/latent-styles/exceptions.ts
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
import { XmlAttributeComponent, XmlComponent } from "../../docx/xml-components";
|
||||||
|
|
||||||
|
interface ILatentStyleExceptionAttributesProperties {
|
||||||
|
name?: string;
|
||||||
|
uiPriority?: string;
|
||||||
|
qFormat?: string;
|
||||||
|
semiHidden?: string;
|
||||||
|
unhideWhenUsed?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
class LatentStyleExceptionAttributes extends XmlAttributeComponent<ILatentStyleExceptionAttributesProperties> {
|
||||||
|
protected xmlKeys = {
|
||||||
|
name: "w:name",
|
||||||
|
uiPriority: "w:uiPriority",
|
||||||
|
qFormat: "w:qFormat",
|
||||||
|
semiHidden: "w:semiHidden",
|
||||||
|
unhideWhenUsed: "w:unhideWhenUsed",
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
export class LatentStyleException extends XmlComponent {
|
||||||
|
|
||||||
|
constructor(attributes: ILatentStyleExceptionAttributesProperties) {
|
||||||
|
super("w:lsdException");
|
||||||
|
this.root.push(new LatentStyleExceptionAttributes(attributes));
|
||||||
|
}
|
||||||
|
}
|
@ -1,33 +0,0 @@
|
|||||||
import {XmlComponent} from "../../../docx/xml-components";
|
|
||||||
|
|
||||||
interface ILatentStyleExceptionAttributesProperties {
|
|
||||||
name?: string;
|
|
||||||
uiPriority?: string;
|
|
||||||
qFormat?: string;
|
|
||||||
semiHidden?: string;
|
|
||||||
unhideWhenUsed?: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export class LatentStyleExceptionAttributes extends XmlComponent {
|
|
||||||
/* tslint:disable */
|
|
||||||
private _attr: ILatentStyleExceptionAttributesProperties;
|
|
||||||
/* tslint:enable */
|
|
||||||
|
|
||||||
private xmlKeys = {
|
|
||||||
name: "w:name",
|
|
||||||
uiPriority: "w:uiPriority",
|
|
||||||
qFormat: "w:qFormat",
|
|
||||||
semiHidden: "w:semiHidden",
|
|
||||||
unhideWhenUsed: "w:unhideWhenUsed",
|
|
||||||
};
|
|
||||||
|
|
||||||
constructor(properties?: ILatentStyleExceptionAttributesProperties) {
|
|
||||||
super("_attr");
|
|
||||||
this._attr = properties;
|
|
||||||
|
|
||||||
if (!properties) {
|
|
||||||
this._attr = {};
|
|
||||||
}
|
|
||||||
// this._attr.xmlKeys = this.xmlKeys;
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,10 +0,0 @@
|
|||||||
import { XmlComponent } from "../../../docx/xml-components";
|
|
||||||
import { LatentStyleExceptionAttributes } from "./attributes";
|
|
||||||
|
|
||||||
export class LatentStyleException extends XmlComponent {
|
|
||||||
|
|
||||||
constructor(attributes: LatentStyleExceptionAttributes) {
|
|
||||||
super("w:lsdException");
|
|
||||||
this.root.push(attributes);
|
|
||||||
}
|
|
||||||
}
|
|
Reference in New Issue
Block a user