UNPKG

@adaptabletools/adaptable-cjs

Version:

Powerful data-agnostic HTML5 AG Grid extension which provides advanced, cutting-edge functionality to meet all DataGrid requirements

21 lines (20 loc) 1.04 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const tslib_1 = require("tslib"); const React = tslib_1.__importStar(require("react")); const Input_1 = tslib_1.__importDefault(require("../../../components/Input")); const AdaptableContext_1 = require("../../AdaptableContext"); const AdaptableDateInput_1 = tslib_1.__importDefault(require("../AdaptableDateInput")); const AdaptableInput = React.forwardRef((props, ref) => { const useNativeInputDate = (0, AdaptableContext_1.useAdaptable)().adaptableOptions.userInterfaceOptions?.dateInputOptions?.useNativeInput; const { showClearButton, ...inputProps } = props; if (props.type === 'date' && !useNativeInputDate) { // use AdapTable date input return (React.createElement(AdaptableDateInput_1.default, { showClearButton: showClearButton, ...inputProps, ref: ref })); } else { // native input return React.createElement(Input_1.default, { ...inputProps, ref: ref }); } }); exports.default = AdaptableInput;