@mui/x-date-pickers
Version:
The community edition of the Date and Time Picker components (MUI X).
28 lines (27 loc) • 926 B
JavaScript
'use client';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.useDateField = void 0;
var _valueManagers = require("../internals/utils/valueManagers");
var _useField = require("../internals/hooks/useField");
var _validation = require("../validation");
var _hooks = require("../hooks");
var _defaultizedFieldProps = require("../internals/hooks/defaultizedFieldProps");
const useDateField = inProps => {
const props = (0, _defaultizedFieldProps.useDefaultizedDateField)(inProps);
const {
forwardedProps,
internalProps
} = (0, _hooks.useSplitFieldProps)(props, 'date');
return (0, _useField.useField)({
forwardedProps,
internalProps,
valueManager: _valueManagers.singleItemValueManager,
fieldValueManager: _valueManagers.singleItemFieldValueManager,
validator: _validation.validateDate,
valueType: 'date'
});
};
exports.useDateField = useDateField;
;