diff --git a/src/Email.ts b/src/Email.ts new file mode 100644 index 0000000..4f52ef0 --- /dev/null +++ b/src/Email.ts @@ -0,0 +1,21 @@ +import Field from "./Field"; + +class Email extends Field { + _multi: boolean = false; + get multi(): boolean { + return this._multi; + } + + set multi(value: boolean) { + this._multi = value; + } + + constructor(props: any) { + super(props); + if (this.parsedWidgetProps.multi) { + this.multi = this.parsedWidgetProps.multi; + } + } +} + +export default Email; diff --git a/src/WidgetFactory.ts b/src/WidgetFactory.ts index 84b0f3e..bf535cd 100644 --- a/src/WidgetFactory.ts +++ b/src/WidgetFactory.ts @@ -39,6 +39,7 @@ import Time from "./Time"; import Alert from "./Alert"; import Comments from "./Comments"; import JSONField from "./JSONField"; +import Email from "./Email"; class WidgetFactory { /** @@ -117,7 +118,7 @@ class WidgetFactory { this._widgetClass = Char; break; case "email": - this._widgetClass = Char; + this._widgetClass = Email; break; case "reference": this._widgetClass = Reference; diff --git a/src/index.ts b/src/index.ts index 78a8620..430083d 100644 --- a/src/index.ts +++ b/src/index.ts @@ -51,6 +51,7 @@ import HTMLPreview from "./HTMLPreview"; import Alert from "./Alert"; import JSONField from "./JSONField"; import Comments from "./Comments"; +import Email from "./Email"; import { Graph, @@ -138,4 +139,5 @@ export { MinMaxValues, Comments, JSONField, + Email, };