2017-03-12 22:06:11 +01:00
|
|
|
import { XmlAttributeComponent, XmlComponent } from "../xml-components";
|
2016-05-18 17:06:21 +01:00
|
|
|
|
|
|
|
class TabStop extends XmlComponent {
|
|
|
|
|
|
|
|
constructor(tab: Tab) {
|
|
|
|
super("w:tabs");
|
|
|
|
this.root.push(tab);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-03-12 22:06:11 +01:00
|
|
|
export type tabOptions = "left" | "right";
|
|
|
|
|
|
|
|
class TabAttributes extends XmlAttributeComponent<{val: tabOptions, pos: string | number}> {
|
|
|
|
protected xmlKeys = {val: "w:val", pos: "w:pos"};
|
|
|
|
}
|
|
|
|
|
2016-05-18 17:06:21 +01:00
|
|
|
class Tab extends XmlComponent {
|
|
|
|
|
2017-03-12 22:06:11 +01:00
|
|
|
constructor(value: tabOptions, position: string | number) {
|
2016-05-18 17:06:21 +01:00
|
|
|
super("w:tab");
|
2017-03-12 22:06:11 +01:00
|
|
|
this.root.push(new TabAttributes({
|
2016-05-18 17:06:21 +01:00
|
|
|
val: value,
|
2017-03-08 21:40:21 +00:00
|
|
|
pos: position,
|
2016-05-18 17:06:21 +01:00
|
|
|
}));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export class MaxRightTabStop extends TabStop {
|
|
|
|
constructor() {
|
2016-06-10 15:03:44 +01:00
|
|
|
super(new Tab("right", 9026));
|
2016-05-18 17:06:21 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export class LeftTabStop extends TabStop {
|
|
|
|
constructor(position: number) {
|
|
|
|
super(new Tab("left", position));
|
|
|
|
}
|
|
|
|
}
|