Files
docx-js/src/file/styles/style/components.ts

68 lines
1.6 KiB
TypeScript
Raw Normal View History

import { XmlAttributeComponent, XmlComponent } from "file/xml-components";
2017-03-09 10:54:40 +01:00
interface IComponentAttributes {
readonly val: string;
2017-03-09 10:54:40 +01:00
}
class ComponentAttributes extends XmlAttributeComponent<IComponentAttributes> {
protected readonly xmlKeys = { val: "w:val" };
2017-03-09 10:54:40 +01:00
}
2016-04-09 04:53:42 +01:00
2016-04-09 20:16:35 +01:00
export class Name extends XmlComponent {
2016-05-03 04:31:08 +01:00
constructor(value: string) {
2016-04-09 20:16:35 +01:00
super("w:name");
2018-01-23 01:33:12 +00:00
this.root.push(new ComponentAttributes({ val: value }));
2016-04-09 04:53:42 +01:00
}
}
2016-05-03 04:31:08 +01:00
export class BasedOn extends XmlComponent {
constructor(value: string) {
super("w:basedOn");
2018-01-23 01:33:12 +00:00
this.root.push(new ComponentAttributes({ val: value }));
2016-05-03 04:31:08 +01:00
}
2016-04-09 04:53:42 +01:00
}
2016-05-03 04:31:08 +01:00
export class Next extends XmlComponent {
constructor(value: string) {
super("w:next");
2018-01-23 01:33:12 +00:00
this.root.push(new ComponentAttributes({ val: value }));
2016-05-03 04:31:08 +01:00
}
2016-04-09 04:53:42 +01:00
}
2016-05-03 04:31:08 +01:00
export class Link extends XmlComponent {
constructor(value: string) {
super("w:link");
2018-01-23 01:33:12 +00:00
this.root.push(new ComponentAttributes({ val: value }));
2016-05-03 04:31:08 +01:00
}
2016-04-09 04:53:42 +01:00
}
2016-05-03 04:31:08 +01:00
export class UiPriority extends XmlComponent {
constructor(value: string) {
super("w:uiPriority");
2017-03-09 10:54:40 +01:00
// TODO: this value should be a ST_DecimalNumber
2018-01-23 01:33:12 +00:00
this.root.push(new ComponentAttributes({ val: value }));
2016-05-03 04:31:08 +01:00
}
2016-04-09 04:53:42 +01:00
}
2018-06-28 03:01:25 +01:00
export class UnhideWhenUsed extends XmlComponent {
constructor() {
super("w:unhideWhenUsed");
}
}
2016-04-09 04:53:42 +01:00
2016-05-08 17:01:20 +01:00
export class QuickFormat extends XmlComponent {
constructor() {
super("w:qFormat");
}
2016-04-09 04:53:42 +01:00
}
2018-01-23 01:33:12 +00:00
export class TableProperties extends XmlComponent {}
2016-04-09 04:53:42 +01:00
2018-01-23 01:33:12 +00:00
export class RsId extends XmlComponent {}
2016-05-03 04:31:08 +01:00
2018-06-28 03:01:25 +01:00
export class SemiHidden extends XmlComponent {
constructor() {
super("w:semiHidden");
}
}