making leader a option field and test improvments

This commit is contained in:
Sergio Mendonça
2018-09-20 10:30:16 -03:00
parent c07b5cf709
commit 12e2ae9e91
2 changed files with 25 additions and 4 deletions

View File

@ -11,7 +11,7 @@ export class TabStop extends XmlComponent {
export type TabValue = "left" | "right" | "center" | "bar" | "clear" | "decimal" | "end" | "num" | "start";
export type LeaderType = "dot" | "hyphen" | "middleDot" | "none" | "underscore";
export class TabAttributes extends XmlAttributeComponent<{ val: TabValue; pos: string | number; leader: LeaderType }> {
export class TabAttributes extends XmlAttributeComponent<{ val: TabValue; pos: string | number; leader?: LeaderType }> {
protected xmlKeys = { val: "w:val", pos: "w:pos", leader: "w:leader" };
}
@ -22,7 +22,7 @@ export class TabStopItem extends XmlComponent {
new TabAttributes({
val: value,
pos: position,
leader: leader || "none",
leader,
}),
);
}