added style components
This commit is contained in:
@ -1,29 +1,30 @@
|
||||
import {XmlComponent} from "../../docx/xml-components";
|
||||
import {XmlAttributeComponent} from "../../docx/xml-components";
|
||||
|
||||
interface StyleAttributesProperties {
|
||||
type?: string;
|
||||
styleId?: string;
|
||||
default?: string;
|
||||
customStyle?: string;
|
||||
val?: string;
|
||||
}
|
||||
|
||||
export class StyleAttributes extends XmlComponent {
|
||||
export class StyleAttributes extends XmlAttributeComponent {
|
||||
private _attr: Object;
|
||||
|
||||
xmlKeys = {
|
||||
type: "w:type",
|
||||
styleId: "w:styleId",
|
||||
default: "w:default",
|
||||
customStyle: "w:customStyle"
|
||||
};
|
||||
|
||||
constructor(properties?: StyleAttributesProperties) {
|
||||
super("_attr");
|
||||
this._attr = properties
|
||||
super({
|
||||
type: "w:type",
|
||||
styleId: "w:styleId",
|
||||
default: "w:default",
|
||||
customStyle: "w:customStyle",
|
||||
val: "w:val"
|
||||
});
|
||||
|
||||
this.root = properties;
|
||||
|
||||
if (!properties) {
|
||||
this._attr = {};
|
||||
this.root = {};
|
||||
}
|
||||
this._attr["xmlKeys"] = this.xmlKeys;
|
||||
}
|
||||
}
|
@ -1,44 +1,73 @@
|
||||
import {XmlComponent} from "../../docx/xml-components";
|
||||
import {StyleAttributes} from "./attributes";
|
||||
|
||||
export class Name extends XmlComponent {
|
||||
|
||||
constructor() {
|
||||
constructor(value: string) {
|
||||
super("w:name");
|
||||
this.root.push(new StyleAttributes({
|
||||
val: value
|
||||
}));
|
||||
}
|
||||
}
|
||||
|
||||
export class BasedOn {
|
||||
export class BasedOn extends XmlComponent {
|
||||
|
||||
constructor(value: string) {
|
||||
super("w:basedOn");
|
||||
this.root.push(new StyleAttributes({
|
||||
val: value
|
||||
}));
|
||||
}
|
||||
}
|
||||
|
||||
export class Next extends XmlComponent {
|
||||
|
||||
constructor(value: string) {
|
||||
super("w:next");
|
||||
this.root.push(new StyleAttributes({
|
||||
styleId: "1",
|
||||
val: value
|
||||
}));
|
||||
}
|
||||
}
|
||||
|
||||
export class Link extends XmlComponent {
|
||||
|
||||
constructor(value: string) {
|
||||
super("w:link");
|
||||
this.root.push(new StyleAttributes({
|
||||
val: value
|
||||
}));
|
||||
}
|
||||
}
|
||||
|
||||
export class UiPriority extends XmlComponent {
|
||||
|
||||
constructor(value: string) {
|
||||
super("w:uiPriority");
|
||||
this.root.push(new StyleAttributes({
|
||||
val: value
|
||||
}));
|
||||
}
|
||||
}
|
||||
|
||||
export class UnhideWhenUsed extends XmlComponent {
|
||||
|
||||
}
|
||||
|
||||
export class Next {
|
||||
export class QFormat extends XmlComponent {
|
||||
|
||||
}
|
||||
|
||||
export class Link {
|
||||
export class TableProperties extends XmlComponent {
|
||||
|
||||
}
|
||||
|
||||
export class UiPriority {
|
||||
export class RsId extends XmlComponent {
|
||||
|
||||
}
|
||||
|
||||
export class UnhideWhenUsed {
|
||||
|
||||
}
|
||||
|
||||
export class QFormat {
|
||||
|
||||
}
|
||||
|
||||
export class TableProperties {
|
||||
|
||||
}
|
||||
|
||||
export class RsId {
|
||||
|
||||
}
|
||||
|
||||
export class SemiHidden {
|
||||
export class SemiHidden extends XmlComponent {
|
||||
|
||||
}
|
Reference in New Issue
Block a user