Added DateTimePicker control in React.

This commit is contained in:
Akshay Joshi
2021-08-02 11:38:40 +05:30
parent bcab0e3754
commit 56ef085412
2 changed files with 87 additions and 8 deletions

View File

@@ -10,8 +10,9 @@
import React, { useCallback } from 'react';
import _ from 'lodash';
import { FormInputText, FormInputSelect, FormInputSwitch, FormInputCheckbox, FormInputColor, FormInputFileSelect, FormInputToggle, InputSwitch, FormInputSQL, FormNote } from '../components/FormComponents';
import { InputSelect, InputText, InputCheckbox } from '../components/FormComponents';
import { FormInputText, FormInputSelect, FormInputSwitch, FormInputCheckbox, FormInputColor,
FormInputFileSelect, FormInputToggle, InputSwitch, FormInputSQL, FormNote, FormInputDateTimePicker } from '../components/FormComponents';
import { InputSelect, InputText, InputCheckbox, InputDateTimePicker } from '../components/FormComponents';
import Privilege from '../components/Privilege';
import { evalFunc } from 'sources/utils';
import PropTypes from 'prop-types';
@@ -93,6 +94,8 @@ function MappedFormControlBase({type, value, id, onChange, className, visible, i
return <FormInputSQL name={name} value={value} onChange={onSqlChange} className={className} noLabel={noLabel} {...props} />;
case 'note':
return <FormNote className={className} {...props}/>;
case 'datetimepicker':
return <FormInputDateTimePicker name={name} value={value} onChange={onTextChange} className={className} {...props} />;
default:
return <span>{value}</span>;
}
@@ -180,6 +183,8 @@ function MappedCellControlBase({cell, value, id, optionsLoaded, onCellChange, vi
onChange={(e)=>onTextChange(e.target.checked, e.target.name)} {...props} />;
case 'privilege':
return <Privilege name={name} value={value} onChange={onTextChange} {...props}/>;
case 'datetimepicker':
return <InputDateTimePicker name={name} value={value} onChange={onTextChange} {...props}/>;
default:
return <span>{value}</span>;
}