Skip to content

Commit

Permalink
feat(email): add multi email widget
Browse files Browse the repository at this point in the history
  • Loading branch information
ecarreras committed Nov 13, 2024
1 parent b149065 commit 35d27b4
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 1 deletion.
21 changes: 21 additions & 0 deletions src/Email.ts
Original file line number Diff line number Diff line change
@@ -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;
3 changes: 2 additions & 1 deletion src/WidgetFactory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
/**
Expand Down Expand Up @@ -117,7 +118,7 @@ class WidgetFactory {
this._widgetClass = Char;
break;
case "email":
this._widgetClass = Char;
this._widgetClass = Email;
break;
case "reference":
this._widgetClass = Reference;
Expand Down
2 changes: 2 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -138,4 +139,5 @@ export {
MinMaxValues,
Comments,
JSONField,
Email,
};

0 comments on commit 35d27b4

Please sign in to comment.