@datalayer/primer-rjsf
Version:
React JSON Schema Form (RJSF) for Primer
15 lines (14 loc) • 625 B
JavaScript
import { jsx as _jsx } from "react/jsx-runtime";
import { getTemplate, } from "@rjsf/utils";
/** The `DateWidget` component uses the `BaseInputTemplate` changing the type to `date` and transforms
* the value to undefined when it is falsy during the `onChange` handling.
*
* @param props - The `WidgetProps` for this component
*/
export default function DateWidget(props) {
const { options, registry } = props;
const BaseInputTemplate = getTemplate("BaseInputTemplate", registry, options);
return (_jsx(BaseInputTemplate, { type: "date", InputLabelProps: {
shrink: true,
}, ...props }));
}