Files
docx-js/src/file/paragraph/run/underline.ts

136 lines
2.9 KiB
TypeScript
Raw Normal View History

import { Attributes, XmlComponent } from "file/xml-components";
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",
}
export abstract class BaseUnderline extends XmlComponent {
constructor(underlineType: UnderlineType, 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,
color: color,
}),
);
2016-07-13 00:59:53 +01:00
}
}
export class Underline extends BaseUnderline {
2019-10-04 01:20:41 +01:00
constructor(underlineType: UnderlineType = UnderlineType.SINGLE, color?: string) {
super(underlineType, color);
2016-07-13 00:59:53 +01:00
}
}
export class DashUnderline extends BaseUnderline {
constructor() {
super(UnderlineType.DASH);
2016-07-13 00:59:53 +01:00
}
}
export class DashDotDotHeavyUnderline extends BaseUnderline {
constructor() {
super(UnderlineType.DASHDOTDOTHEAVY);
2016-07-13 00:59:53 +01:00
}
}
export class DashDotHeavyUnderline extends BaseUnderline {
constructor() {
super(UnderlineType.DASHDOTHEAVY);
2016-07-13 00:59:53 +01:00
}
}
export class DashLongUnderline extends BaseUnderline {
constructor() {
super(UnderlineType.DASHLONG);
2016-07-13 00:59:53 +01:00
}
}
export class DashLongHeavyUnderline extends BaseUnderline {
constructor() {
super(UnderlineType.DASHLONGHEAVY);
2016-07-13 00:59:53 +01:00
}
}
export class DotDashUnderline extends BaseUnderline {
constructor() {
super(UnderlineType.DOTDASH);
2016-07-13 00:59:53 +01:00
}
}
export class DotDotDashUnderline extends BaseUnderline {
constructor() {
super(UnderlineType.DOTDOTDASH);
2016-07-13 00:59:53 +01:00
}
}
export class DottedUnderline extends BaseUnderline {
constructor() {
super(UnderlineType.DOTTED);
2016-07-13 00:59:53 +01:00
}
}
export class DottedHeavyUnderline extends BaseUnderline {
constructor() {
super(UnderlineType.DOTTEDHEAVY);
2016-07-13 00:59:53 +01:00
}
}
export class DoubleUnderline extends BaseUnderline {
constructor() {
super(UnderlineType.DOUBLE);
2016-07-13 00:59:53 +01:00
}
}
export class SingleUnderline extends BaseUnderline {
constructor() {
super(UnderlineType.SINGLE);
2016-07-13 00:59:53 +01:00
}
}
export class ThickUnderline extends BaseUnderline {
constructor() {
super(UnderlineType.THICK);
2016-07-13 00:59:53 +01:00
}
}
export class WaveUnderline extends BaseUnderline {
constructor() {
super(UnderlineType.WAVE);
2016-07-13 00:59:53 +01:00
}
}
export class WavyDoubleUnderline extends BaseUnderline {
constructor() {
super(UnderlineType.WAVYDOUBLE);
2016-07-13 00:59:53 +01:00
}
}
export class WavyHeavyUnderline extends BaseUnderline {
constructor() {
super(UnderlineType.WAVYHEAVY);
2016-07-13 00:59:53 +01:00
}
}
export class WordsUnderline extends BaseUnderline {
constructor() {
super(UnderlineType.WORDS);
2016-07-13 00:59:53 +01:00
}
2017-03-08 21:49:41 +00:00
}