/
daterangepicker.component.tsx
51 lines (46 loc) · 2 KB
/
daterangepicker.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
50
51
import * as React from 'react';
import { DateRangePicker, DateRangePickerModel } from '@syncfusion/ej2-calendars';
import { ComponentBase, applyMixins, DefaultHtmlAttributes } from '@syncfusion/ej2-react-base';
export interface DateRangePickerTypecast {
start?: string | Function | any;
end?: string | Function | any;
}
/**
* Represents the Essential JS 2 React DateRangePicker Component.
* ```ts
* <DateRangePickerComponent startDate={date} endDate={date}></DateRangePickerComponent>
* ```
*/
export class DateRangePickerComponent extends DateRangePicker {
public state: Readonly<{ children?: React.ReactNode | React.ReactNode[] }>
& Readonly<DateRangePickerModel | DefaultHtmlAttributes| DateRangePickerTypecast>;
public setState: any;
private getDefaultAttributes: Function;
public initRenderCalled: boolean = false;
private checkInjectedModules: boolean = false;
public directivekeys: { [key: string]: Object } = {'presets': 'preset'};
private statelessTemplateProps: string[] = null;
private templateProps: string[] = null;
private immediateRender: boolean = false;
public props: Readonly<{ children?: React.ReactNode | React.ReactNode[] }>
& Readonly<DateRangePickerModel | DefaultHtmlAttributes| DateRangePickerTypecast>;
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((React as any).Fragment, null,[].concat(React.createElement("input", this.getDefaultAttributes()),this.portals));
}
}
}
applyMixins(DateRangePickerComponent, [ComponentBase, React.Component]);