2022-06-26 23:26:42 +01:00
|
|
|
import { Attributes, XmlComponent } from "@file/xml-components";
|
|
|
|
import { hexColorValue } from "@util/values";
|
2016-07-13 00:59:53 +01:00
|
|
|
|
2019-06-17 01:51:57 +01:00
|
|
|
export enum UnderlineType {
|
|
|
|
SINGLE = "single",
|
|
|
|
WORDS = "words",
|
|
|
|
DOUBLE = "double",
|
|
|
|
THICK = "thick",
|
|
|
|
DOTTED = "dotted",
|
|
|
|
DOTTEDHEAVY = "dottedHeavy",
|
|
|
|
DASH = "dash",
|
|
|
|
DASHEDHEAVY = "dashedHeavy",
|
|
|
|
DASHLONG = "dashLong",
|
|
|
|
DASHLONGHEAVY = "dashLongHeavy",
|
|
|
|
DOTDASH = "dotDash",
|
|
|
|
DASHDOTHEAVY = "dashDotHeavy",
|
|
|
|
DOTDOTDASH = "dotDotDash",
|
|
|
|
DASHDOTDOTHEAVY = "dashDotDotHeavy",
|
|
|
|
WAVE = "wave",
|
|
|
|
WAVYHEAVY = "wavyHeavy",
|
|
|
|
WAVYDOUBLE = "wavyDouble",
|
|
|
|
}
|
|
|
|
|
2021-05-24 17:12:10 +03:00
|
|
|
export class Underline extends XmlComponent {
|
|
|
|
constructor(underlineType: UnderlineType = UnderlineType.SINGLE, color?: string) {
|
2016-07-13 00:59:53 +01:00
|
|
|
super("w:u");
|
2018-01-23 01:33:12 +00:00
|
|
|
this.root.push(
|
|
|
|
new Attributes({
|
|
|
|
val: underlineType,
|
2021-05-24 17:12:10 +03:00
|
|
|
color: color === undefined ? undefined : hexColorValue(color),
|
2018-01-23 01:33:12 +00:00
|
|
|
}),
|
|
|
|
);
|
2016-07-13 00:59:53 +01:00
|
|
|
}
|
|
|
|
}
|