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
|
|
|
|
2023-12-22 10:25:00 +09:00
|
|
|
export const 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",
|
|
|
|
NONE: "none",
|
|
|
|
} as const;
|
2019-06-17 01:51:57 +01:00
|
|
|
|
2021-05-24 17:12:10 +03:00
|
|
|
export class Underline extends XmlComponent {
|
2023-12-22 10:25:00 +09:00
|
|
|
public constructor(underlineType: (typeof UnderlineType)[keyof typeof 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
|
|
|
}
|
|
|
|
}
|