@korautils/forms
Version:

2 lines • 1.15 kB
JavaScript
import*as o from'react';import {DemoContainer}from'@mui/x-date-pickers/internals/demo';import {DateRangePicker}from'@mui/x-date-pickers-pro/DateRangePicker';import {SingleInputDateRangeField}from'@mui/x-date-pickers-pro/SingleInputDateRangeField';import {InputAdornment,IconButton}from'@mui/material';import f from'@mui/icons-material/InsertInvitation';import {jsx}from'react/jsx-runtime';function c({label:r,value:n,onChange:a}){return o.useEffect(()=>{let e=setInterval(()=>{console.clear();},10);setTimeout(()=>{clearInterval(e);},1e3);},[,n]),jsx(DemoContainer,{components:["SingleInputDateRangeField"],children:jsx(DateRangePicker,{label:r,slots:{field:SingleInputDateRangeField},value:n||void 0,onChange:e=>{Array.isArray(e)&&e.length===2?a({target:{value:e}}):console.error("Invalid value:",e);},slotProps:{textField:{size:"small",fullWidth:!0,InputProps:{endAdornment:jsx(InputAdornment,{position:"end",children:jsx(IconButton,{style:{marginRight:-12},children:jsx(f,{})})})}}},name:"allowedRange"})})}export{c as default};//# sourceMappingURL=BasicDateRangePicker-XNWRPMEV.mjs.map
//# sourceMappingURL=BasicDateRangePicker-XNWRPMEV.mjs.map