@syncfusion/ej2-react-inputs
Version:
A package of Essential JS 2 input components such as Textbox, Color-picker, Masked-textbox, Numeric-textbox, Slider, Upload, and Form-validator that is used to get input from the users. for React
391 lines (376 loc) • 12.6 kB
JavaScript
import { createElement, Fragment, Component } from 'react';
import { TextBox, TextArea, NumericTextBox, MaskedTextBox, Slider, Uploader, ColorPicker, Signature, Rating, OtpInput, SmartTextArea, SpeechToText } from '@syncfusion/ej2-inputs';
export * from '@syncfusion/ej2-inputs';
import { applyMixins, ComponentBase, ComplexBase } from '@syncfusion/ej2-react-base';
/**
* Represents the React TextBox Component
* ```html
* <TextBox value={value}></TextBox>
* ```
*/
class TextBoxComponent extends TextBox {
constructor(props) {
super(props);
this.initRenderCalled = false;
this.checkInjectedModules = false;
this.statelessTemplateProps = null;
this.templateProps = null;
this.immediateRender = true;
this.isReactMock = true;
this.portals = [];
}
render() {
this.isReactMock = false;
if (((this.element && !this.initRenderCalled) || this.refreshing) && !this.isReactForeceUpdate) {
super.render();
this.initRenderCalled = true;
}
else {
return createElement(Fragment, null, [].concat(createElement("input", this.getDefaultAttributes()), this.portals));
}
}
}
applyMixins(TextBoxComponent, [ComponentBase, Component]);
/**
* Represents the React TextArea Component
* ```html
* <TextArea value={value}></TextArea>
* ```
*/
class TextAreaComponent extends TextArea {
constructor(props) {
super(props);
this.initRenderCalled = false;
this.checkInjectedModules = false;
this.statelessTemplateProps = null;
this.templateProps = null;
this.immediateRender = true;
this.isReactMock = true;
this.portals = [];
}
render() {
this.isReactMock = false;
if (((this.element && !this.initRenderCalled) || this.refreshing) && !this.isReactForeceUpdate) {
super.render();
this.initRenderCalled = true;
}
else {
return createElement(Fragment, null, [].concat(createElement("textarea", this.getDefaultAttributes()), this.portals));
}
}
}
applyMixins(TextAreaComponent, [ComponentBase, Component]);
/**
* Represents the React NumericTextBox Component
* ```html
* <NumericTextBox value={value}></NumericTextBox>
* ```
*/
class NumericTextBoxComponent extends NumericTextBox {
constructor(props) {
super(props);
this.initRenderCalled = false;
this.checkInjectedModules = false;
this.statelessTemplateProps = null;
this.templateProps = null;
this.immediateRender = true;
this.isReactMock = true;
this.portals = [];
}
render() {
this.isReactMock = false;
if (((this.element && !this.initRenderCalled) || this.refreshing) && !this.isReactForeceUpdate) {
super.render();
this.initRenderCalled = true;
}
else {
return createElement(Fragment, null, [].concat(createElement("input", this.getDefaultAttributes()), this.portals));
}
}
}
applyMixins(NumericTextBoxComponent, [ComponentBase, Component]);
/**
* Represents the React MaskedTextBox Component
* ```html
* <MaskedTextBox value={value}></MaskedTextBox>
* ```
*/
class MaskedTextBoxComponent extends MaskedTextBox {
constructor(props) {
super(props);
this.controlAttributes = ['name'];
this.initRenderCalled = false;
this.checkInjectedModules = false;
this.statelessTemplateProps = null;
this.templateProps = null;
this.immediateRender = true;
this.isReactMock = true;
this.portals = [];
}
render() {
this.isReactMock = false;
if (((this.element && !this.initRenderCalled) || this.refreshing) && !this.isReactForeceUpdate) {
super.render();
this.initRenderCalled = true;
}
else {
return createElement(Fragment, null, [].concat(createElement("input", this.getDefaultAttributes()), this.portals));
}
}
}
applyMixins(MaskedTextBoxComponent, [ComponentBase, Component]);
/**
* Represents the React Slider Component
* ```html
* <Slider value={value}></Slider>
* ```
*/
class SliderComponent extends Slider {
constructor(props) {
super(props);
this.controlAttributes = ['name'];
this.initRenderCalled = false;
this.checkInjectedModules = false;
this.statelessTemplateProps = null;
this.templateProps = null;
this.immediateRender = true;
this.isReactMock = true;
this.portals = [];
}
render() {
this.isReactMock = false;
if (((this.element && !this.initRenderCalled) || this.refreshing) && !this.isReactForeceUpdate) {
super.render();
this.initRenderCalled = true;
}
else {
return createElement('div', this.getDefaultAttributes(), [].concat(this.props.children, this.portals));
}
}
}
applyMixins(SliderComponent, [ComponentBase, Component]);
/**
* `FilesDirective` represent a file of the react uploader.
* It must be contained in a Uploader component(`UploaderComponent`).
* ```tsx
* <UploaderComponent multiple={true}>
* <FilesDirective>
* <FileDirective name='Java' size=23000 type='pdf'><FileDirective>
* <FileDirective name='C++' size=30000 type='.docx'><FileDirective>
* </FilesDirective>
* </UploaderComponent>
* ```
*/
class UploadedFilesDirective extends ComplexBase {
}
UploadedFilesDirective.moduleName = 'uploadedFiles';
class FilesDirective extends ComplexBase {
}
FilesDirective.propertyName = 'files';
FilesDirective.moduleName = 'files';
/**
* Represents the React Uploader Component
* ```html
* <UploaderComponent></UploaderComponent>
* ```
*/
class UploaderComponent extends Uploader {
constructor(props) {
super(props);
this.initRenderCalled = false;
this.checkInjectedModules = false;
this.directivekeys = { 'files': 'uploadedFiles' };
this.statelessTemplateProps = null;
this.templateProps = null;
this.immediateRender = false;
this.isReactMock = true;
this.portals = [];
}
render() {
this.isReactMock = false;
if (((this.element && !this.initRenderCalled) || this.refreshing) && !this.isReactForeceUpdate) {
super.render();
this.initRenderCalled = true;
}
else {
return createElement(Fragment, null, [].concat(createElement("input", this.getDefaultAttributes()), this.portals));
}
}
}
applyMixins(UploaderComponent, [ComponentBase, Component]);
/**
* Represents the React ColorPicker Component
* ```html
* <ColorPickerComponent></ColorPickerComponent>
* ```
*/
class ColorPickerComponent extends ColorPicker {
constructor(props) {
super(props);
this.initRenderCalled = false;
this.checkInjectedModules = false;
this.statelessTemplateProps = null;
this.templateProps = null;
this.immediateRender = true;
this.isReactMock = true;
this.portals = [];
}
render() {
this.isReactMock = false;
if (((this.element && !this.initRenderCalled) || this.refreshing) && !this.isReactForeceUpdate) {
super.render();
this.initRenderCalled = true;
}
else {
return createElement(Fragment, null, [].concat(createElement("input", this.getDefaultAttributes()), this.portals));
}
}
}
applyMixins(ColorPickerComponent, [ComponentBase, Component]);
/**
* Represents the React Signature Component
* ```html
* <SignatureComponent></SignatureComponent>
* ```
*/
class SignatureComponent extends Signature {
constructor(props) {
super(props);
this.initRenderCalled = false;
this.checkInjectedModules = false;
this.statelessTemplateProps = null;
this.templateProps = null;
this.immediateRender = true;
this.isReactMock = true;
this.portals = [];
}
render() {
this.isReactMock = false;
if (((this.element && !this.initRenderCalled) || this.refreshing) && !this.isReactForeceUpdate) {
super.render();
this.initRenderCalled = true;
}
else {
return createElement('canvas', this.getDefaultAttributes(), [].concat(this.props.children, this.portals));
}
}
}
applyMixins(SignatureComponent, [ComponentBase, Component]);
/**
* Represents the React Rating Component
* ```html
* <RatingComponent value={value}></RatingComponent>
* ```
*/
class RatingComponent extends Rating {
constructor(props) {
super(props);
this.initRenderCalled = false;
this.checkInjectedModules = false;
this.statelessTemplateProps = null;
this.templateProps = null;
this.immediateRender = false;
this.isReactMock = true;
this.portals = [];
}
render() {
this.isReactMock = false;
if (((this.element && !this.initRenderCalled) || this.refreshing) && !this.isReactForeceUpdate) {
super.render();
this.initRenderCalled = true;
}
else {
return createElement(Fragment, null, [].concat(createElement("input", this.getDefaultAttributes()), this.portals));
}
}
}
applyMixins(RatingComponent, [ComponentBase, Component]);
/**
* Represents the React OtpInput Component
* ```html
* <OtpInputComponent value={value}></OtpInputComponent>
* ```
*/
class OtpInputComponent extends OtpInput {
constructor(props) {
super(props);
this.initRenderCalled = false;
this.checkInjectedModules = false;
this.statelessTemplateProps = null;
this.templateProps = null;
this.immediateRender = true;
this.isReactMock = true;
this.portals = [];
}
render() {
this.isReactMock = false;
if (((this.element && !this.initRenderCalled) || this.refreshing) && !this.isReactForeceUpdate) {
super.render();
this.initRenderCalled = true;
}
else {
return createElement('div', this.getDefaultAttributes(), [].concat(this.props.children, this.portals));
}
}
}
applyMixins(OtpInputComponent, [ComponentBase, Component]);
/**
* Represents the React Smart TextArea Component
* ```html
* <SmartTextArea></SmartTextArea>
* ```
*/
class SmartTextAreaComponent extends SmartTextArea {
constructor(props) {
super(props);
this.initRenderCalled = false;
this.checkInjectedModules = false;
this.statelessTemplateProps = null;
this.templateProps = null;
this.immediateRender = true;
this.isReactMock = true;
this.portals = [];
}
render() {
this.isReactMock = false;
if (((this.element && !this.initRenderCalled) || this.refreshing) && !this.isReactForeceUpdate) {
super.render();
this.initRenderCalled = true;
}
else {
return createElement(Fragment, null, [].concat(createElement("textarea", this.getDefaultAttributes()), this.portals));
}
}
}
applyMixins(SmartTextAreaComponent, [ComponentBase, Component]);
/**
* Represents the React SpeechToText Component
* ```html
* <SpeechToTextComponent></SpeechToTextComponent>
* ```
*/
class SpeechToTextComponent extends SpeechToText {
constructor(props) {
super(props);
this.initRenderCalled = false;
this.checkInjectedModules = false;
this.statelessTemplateProps = null;
this.templateProps = null;
this.immediateRender = true;
this.isReactMock = true;
this.portals = [];
}
render() {
this.isReactMock = false;
if (((this.element && !this.initRenderCalled) || this.refreshing) && !this.isReactForeceUpdate) {
super.render();
this.initRenderCalled = true;
}
else {
return createElement('button', this.getDefaultAttributes(), [].concat(this.props.children, this.portals));
}
}
}
applyMixins(SpeechToTextComponent, [ComponentBase, Component]);
export { ColorPickerComponent, FilesDirective, MaskedTextBoxComponent, NumericTextBoxComponent, OtpInputComponent, RatingComponent, SignatureComponent, SliderComponent, SmartTextAreaComponent, SpeechToTextComponent, TextAreaComponent, TextBoxComponent, UploadedFilesDirective, UploaderComponent };
//# sourceMappingURL=ej2-react-inputs.es2015.js.map