@adaptabletools/adaptable
Version:
Powerful data-agnostic HTML5 AG Grid extension which provides advanced, cutting-edge functionality to meet all DataGrid requirements
17 lines (16 loc) • 688 B
JavaScript
import * as React from 'react';
import Input from '../../../components/Input';
import { useAdaptable } from '../../AdaptableContext';
import AdaptableDateInput from '../AdaptableDateInput';
const AdaptableInput = React.forwardRef((props, ref) => {
const useNativeInputDate = useAdaptable().adaptableOptions.userInterfaceOptions?.dateInputOptions?.useNativeInput;
if (props.type === 'date' && !useNativeInputDate) {
// use AdapTable date input
return React.createElement(AdaptableDateInput, { ...props, ref: ref });
}
else {
// native input
return React.createElement(Input, { ...props, ref: ref });
}
});
export default AdaptableInput;