forked from syncfusion/ej2-react-ui-components
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrichtexteditor.component.tsx
49 lines (44 loc) · 1.8 KB
/
richtexteditor.component.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
import * as React from 'react';
import { RichTextEditor, RichTextEditorModel } from '@syncfusion/ej2-richtexteditor';
import { ComponentBase, applyMixins, DefaultHtmlAttributes } from '@syncfusion/ej2-react-base';
export interface RichTextEditorTypecast {
valueTemplate?: string | Function | any;
}
/**
* `RichTextEditor` represents the react RichTextEditor.
* ```tsx
* <RichTextEditor/>
* ```
*/
export class RichTextEditorComponent extends RichTextEditor {
public state: Readonly<{ children?: React.ReactNode | React.ReactNode[] }>
& Readonly<RichTextEditorModel & DefaultHtmlAttributes| RichTextEditorTypecast>;
public setState: any;
private getDefaultAttributes: Function;
public initRenderCalled: boolean = false;
private checkInjectedModules: boolean = true;
private statelessTemplateProps: string[] = ["valueTemplate"];
private templateProps: string[] = null;
private immediateRender: boolean = false;
public props: Readonly<{ children?: React.ReactNode | React.ReactNode[] }>
& Readonly<RichTextEditorModel & DefaultHtmlAttributes| RichTextEditorTypecast>;
public forceUpdate: (callBack?: () => any) => void;
public context: Object;
public portals: any = [];
public isReactComponent: Object;
public refs: {
[key: string]: React.ReactInstance
};
constructor(props: any) {
super(props);
}
public render(): any {
if (((this.element && !this.initRenderCalled) || this.refreshing) && !(this as any).isReactForeceUpdate) {
super.render();
this.initRenderCalled = true;
} else {
return React.createElement('div', this.getDefaultAttributes(),[].concat(this.props.children,this.portals));
}
}
}
applyMixins(RichTextEditorComponent, [ComponentBase, React.Component]);