mirror of https://github.com/acid-info/lsd.git
feat: add label element to DateField and adjust styles
This commit is contained in:
parent
5f623c8700
commit
2537acf89d
|
@ -2,7 +2,7 @@ import React from 'react'
|
||||||
|
|
||||||
export type CalendarContextType = {
|
export type CalendarContextType = {
|
||||||
focusedDate: Date | null
|
focusedDate: Date | null
|
||||||
size?: 'large' | 'medium'
|
size?: 'large' | 'medium' | 'small'
|
||||||
isDateFocused: (date: Date) => boolean
|
isDateFocused: (date: Date) => boolean
|
||||||
isDateSelected: (date: Date) => boolean
|
isDateSelected: (date: Date) => boolean
|
||||||
isDateHovered: (date: Date) => boolean
|
isDateHovered: (date: Date) => boolean
|
||||||
|
|
|
@ -9,7 +9,7 @@ export default {
|
||||||
size: {
|
size: {
|
||||||
type: {
|
type: {
|
||||||
name: 'enum',
|
name: 'enum',
|
||||||
value: ['medium', 'large'],
|
value: ['small', 'medium', 'large'],
|
||||||
},
|
},
|
||||||
defaultValue: 'large',
|
defaultValue: 'large',
|
||||||
},
|
},
|
||||||
|
|
|
@ -20,7 +20,7 @@ export type CalendarProps = Omit<
|
||||||
value?: string
|
value?: string
|
||||||
onChange: (data: Date) => void
|
onChange: (data: Date) => void
|
||||||
handleRef: React.RefObject<HTMLElement>
|
handleRef: React.RefObject<HTMLElement>
|
||||||
size?: 'large' | 'medium'
|
size?: 'large' | 'medium' | 'small'
|
||||||
onClose?: () => void
|
onClose?: () => void
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,10 +1,11 @@
|
||||||
export const dateFieldClasses = {
|
export const dateFieldClasses = {
|
||||||
root: `lsd-date-field`,
|
root: `lsd-date-field`,
|
||||||
|
label: 'lsd-date-field__label',
|
||||||
|
|
||||||
inputContainer: `lsd-date-field-input-container`,
|
inputContainer: `lsd-date-field__input-container`,
|
||||||
input: `lsd-date-field-input-container__input`,
|
input: `lsd-date-field__input-container__input`,
|
||||||
icon: `lsd-date-field-input-container__icon`,
|
icon: `lsd-date-field__input-container__icon`,
|
||||||
iconButton: `lsd-date-field-input-container__icon-button`,
|
iconButton: `lsd-date-field__input-container__icon-button`,
|
||||||
|
|
||||||
supportingText: 'lsd-date-field__supporting-text',
|
supportingText: 'lsd-date-field__supporting-text',
|
||||||
|
|
||||||
|
@ -13,4 +14,8 @@ export const dateFieldClasses = {
|
||||||
|
|
||||||
large: `lsd-date-field--large`,
|
large: `lsd-date-field--large`,
|
||||||
medium: `lsd-date-field--medium`,
|
medium: `lsd-date-field--medium`,
|
||||||
|
small: `lsd-date-field--small`,
|
||||||
|
|
||||||
|
outlined: `lsd-date-field--outlined`,
|
||||||
|
outlinedBottom: `lsd-date-field--outlined-bottom`,
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,7 +8,14 @@ export default {
|
||||||
size: {
|
size: {
|
||||||
type: {
|
type: {
|
||||||
name: 'enum',
|
name: 'enum',
|
||||||
value: ['medium', 'large'],
|
value: ['small', 'medium', 'large'],
|
||||||
|
},
|
||||||
|
defaultValue: 'large',
|
||||||
|
},
|
||||||
|
variant: {
|
||||||
|
type: {
|
||||||
|
name: 'enum',
|
||||||
|
value: ['outlined', 'outlined-bottom'],
|
||||||
},
|
},
|
||||||
defaultValue: 'large',
|
defaultValue: 'large',
|
||||||
},
|
},
|
||||||
|
@ -24,6 +31,7 @@ export const Controlled: Story<DateFieldProps> = ({ ...args }) => {
|
||||||
}
|
}
|
||||||
|
|
||||||
Uncontrolled.args = {
|
Uncontrolled.args = {
|
||||||
|
id: 'label',
|
||||||
size: 'large',
|
size: 'large',
|
||||||
supportingText: 'Supporting text',
|
supportingText: 'Supporting text',
|
||||||
disabled: false,
|
disabled: false,
|
||||||
|
@ -32,9 +40,12 @@ Uncontrolled.args = {
|
||||||
error: false,
|
error: false,
|
||||||
errorIcon: false,
|
errorIcon: false,
|
||||||
clearButton: true,
|
clearButton: true,
|
||||||
|
variant: 'outlined-bottom',
|
||||||
|
label: 'Label',
|
||||||
}
|
}
|
||||||
|
|
||||||
Controlled.args = {
|
Controlled.args = {
|
||||||
|
id: 'label',
|
||||||
size: 'large',
|
size: 'large',
|
||||||
supportingText: 'Supporting text',
|
supportingText: 'Supporting text',
|
||||||
disabled: false,
|
disabled: false,
|
||||||
|
@ -43,4 +54,6 @@ Controlled.args = {
|
||||||
error: false,
|
error: false,
|
||||||
errorIcon: false,
|
errorIcon: false,
|
||||||
clearButton: true,
|
clearButton: true,
|
||||||
|
variant: 'outlined-bottom',
|
||||||
|
label: 'Label',
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,10 +4,27 @@ import { dateFieldClasses } from './DateField.classes'
|
||||||
export const DateFieldStyles = css`
|
export const DateFieldStyles = css`
|
||||||
.${dateFieldClasses.root} {
|
.${dateFieldClasses.root} {
|
||||||
width: auto;
|
width: auto;
|
||||||
border-bottom: 1px solid rgb(var(--lsd-border-primary));
|
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.${dateFieldClasses.label} {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
|
||||||
|
.${dateFieldClasses.icon} {
|
||||||
|
cursor: pointer;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.${dateFieldClasses.outlined} {
|
||||||
|
border: 1px solid rgb(var(--lsd-border-primary));
|
||||||
|
}
|
||||||
|
|
||||||
|
.${dateFieldClasses.outlinedBottom} {
|
||||||
|
border-bottom: 1px solid rgb(var(--lsd-border-primary));
|
||||||
|
}
|
||||||
|
|
||||||
.${dateFieldClasses.inputContainer} {
|
.${dateFieldClasses.inputContainer} {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
@ -48,32 +65,64 @@ export const DateFieldStyles = css`
|
||||||
}
|
}
|
||||||
|
|
||||||
.${dateFieldClasses.supportingText} {
|
.${dateFieldClasses.supportingText} {
|
||||||
width: fit-content;
|
position: absolute;
|
||||||
margin-top: 20px;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.${dateFieldClasses.large} {
|
.${dateFieldClasses.large} {
|
||||||
width: 208px;
|
width: 208px;
|
||||||
|
|
||||||
|
.${dateFieldClasses.label} {
|
||||||
|
margin: 0 0 6px 18px;
|
||||||
|
}
|
||||||
|
.${dateFieldClasses.inputContainer} {
|
||||||
height: 40px;
|
height: 40px;
|
||||||
padding: 10px 14px;
|
}
|
||||||
|
.${dateFieldClasses.input} {
|
||||||
|
padding: 9px 13px 9px 17px;
|
||||||
|
}
|
||||||
|
.${dateFieldClasses.icon} {
|
||||||
|
padding: 12px 13px;
|
||||||
|
}
|
||||||
|
.${dateFieldClasses.supportingText} {
|
||||||
|
margin: 6px 18px 0 18px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.${dateFieldClasses.medium} {
|
.${dateFieldClasses.medium} {
|
||||||
width: 188px;
|
width: 188px;
|
||||||
|
.${dateFieldClasses.label} {
|
||||||
|
margin: 0 0 6px 14px;
|
||||||
|
}
|
||||||
|
.${dateFieldClasses.inputContainer} {
|
||||||
height: 32px;
|
height: 32px;
|
||||||
padding: 6px 12px;
|
}
|
||||||
|
.${dateFieldClasses.input} {
|
||||||
|
padding: 5px 11px 5px 13px;
|
||||||
|
}
|
||||||
|
.${dateFieldClasses.icon} {
|
||||||
|
padding: 8px 11px;
|
||||||
|
}
|
||||||
|
.${dateFieldClasses.supportingText} {
|
||||||
|
margin: 6px 14px 0 14px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.${dateFieldClasses.iconButton} {
|
.${dateFieldClasses.small} {
|
||||||
padding: 0;
|
width: 164px;
|
||||||
width: auto;
|
.${dateFieldClasses.label} {
|
||||||
height: auto;
|
margin: 0 0 6px 12px;
|
||||||
margin: 0;
|
}
|
||||||
border: 0;
|
.${dateFieldClasses.inputContainer} {
|
||||||
|
height: 28px;
|
||||||
svg {
|
}
|
||||||
width: 100%;
|
.${dateFieldClasses.input} {
|
||||||
height: auto;
|
padding: 5px 9px 5px 11px;
|
||||||
|
}
|
||||||
|
.${dateFieldClasses.icon} {
|
||||||
|
padding: 6px 9px;
|
||||||
|
}
|
||||||
|
.${dateFieldClasses.supportingText} {
|
||||||
|
margin: 6px 12px 0 12px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
`
|
`
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
import clsx from 'clsx'
|
import clsx from 'clsx'
|
||||||
import React, { useRef } from 'react'
|
import React, { useRef } from 'react'
|
||||||
import { useInput } from '../../utils/useInput'
|
import { useInput } from '../../utils/useInput'
|
||||||
import { IconButton } from '../IconButton'
|
|
||||||
import { CloseIcon, ErrorIcon } from '../Icons'
|
import { CloseIcon, ErrorIcon } from '../Icons'
|
||||||
import { Typography } from '../Typography'
|
import { Typography } from '../Typography'
|
||||||
import { dateFieldClasses } from './DateField.classes'
|
import { dateFieldClasses } from './DateField.classes'
|
||||||
|
@ -11,7 +10,8 @@ export type DateFieldProps = Omit<
|
||||||
'onChange' | 'value'
|
'onChange' | 'value'
|
||||||
> &
|
> &
|
||||||
Pick<React.InputHTMLAttributes<HTMLInputElement>, 'onChange'> & {
|
Pick<React.InputHTMLAttributes<HTMLInputElement>, 'onChange'> & {
|
||||||
size?: 'large' | 'medium'
|
label?: React.ReactNode
|
||||||
|
size?: 'large' | 'medium' | 'small'
|
||||||
error?: boolean
|
error?: boolean
|
||||||
errorIcon?: boolean
|
errorIcon?: boolean
|
||||||
clearButton?: boolean
|
clearButton?: boolean
|
||||||
|
@ -23,11 +23,13 @@ export type DateFieldProps = Omit<
|
||||||
icon?: React.ReactNode
|
icon?: React.ReactNode
|
||||||
onIconClick?: () => void
|
onIconClick?: () => void
|
||||||
inputProps?: React.InputHTMLAttributes<HTMLInputElement>
|
inputProps?: React.InputHTMLAttributes<HTMLInputElement>
|
||||||
|
variant?: 'outlined' | 'outlined-bottom'
|
||||||
}
|
}
|
||||||
|
|
||||||
export const DateField: React.FC<DateFieldProps> & {
|
export const DateField: React.FC<DateFieldProps> & {
|
||||||
classes: typeof dateFieldClasses
|
classes: typeof dateFieldClasses
|
||||||
} = ({
|
} = ({
|
||||||
|
label,
|
||||||
size = 'large',
|
size = 'large',
|
||||||
error = false,
|
error = false,
|
||||||
errorIcon = false,
|
errorIcon = false,
|
||||||
|
@ -42,6 +44,7 @@ export const DateField: React.FC<DateFieldProps> & {
|
||||||
icon,
|
icon,
|
||||||
onIconClick,
|
onIconClick,
|
||||||
inputProps = {},
|
inputProps = {},
|
||||||
|
variant = 'outlined-bottom',
|
||||||
...props
|
...props
|
||||||
}) => {
|
}) => {
|
||||||
const ref = useRef<HTMLInputElement>(null)
|
const ref = useRef<HTMLInputElement>(null)
|
||||||
|
@ -49,6 +52,8 @@ export const DateField: React.FC<DateFieldProps> & {
|
||||||
|
|
||||||
const onCancel = () => input.setValue('')
|
const onCancel = () => input.setValue('')
|
||||||
|
|
||||||
|
const inputId = inputProps?.id ?? (props.id || 'date-field') + '-input'
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
aria-disabled={disabled ? 'true' : 'false'}
|
aria-disabled={disabled ? 'true' : 'false'}
|
||||||
|
@ -61,8 +66,26 @@ export const DateField: React.FC<DateFieldProps> & {
|
||||||
error && dateFieldClasses.error,
|
error && dateFieldClasses.error,
|
||||||
)}
|
)}
|
||||||
>
|
>
|
||||||
<div className={dateFieldClasses.inputContainer}>
|
{label && (
|
||||||
|
<Typography
|
||||||
|
htmlFor={inputId}
|
||||||
|
className={dateFieldClasses.label}
|
||||||
|
variant="label2"
|
||||||
|
component="label"
|
||||||
|
>
|
||||||
|
{label}
|
||||||
|
</Typography>
|
||||||
|
)}
|
||||||
|
<div
|
||||||
|
className={clsx(
|
||||||
|
dateFieldClasses.inputContainer,
|
||||||
|
variant === 'outlined'
|
||||||
|
? dateFieldClasses.outlined
|
||||||
|
: dateFieldClasses.outlinedBottom,
|
||||||
|
)}
|
||||||
|
>
|
||||||
<input
|
<input
|
||||||
|
id={inputId}
|
||||||
type="date"
|
type="date"
|
||||||
placeholder={placeholder}
|
placeholder={placeholder}
|
||||||
{...inputProps}
|
{...inputProps}
|
||||||
|
@ -72,32 +95,28 @@ export const DateField: React.FC<DateFieldProps> & {
|
||||||
className={clsx(inputProps.className, dateFieldClasses.input)}
|
className={clsx(inputProps.className, dateFieldClasses.input)}
|
||||||
/>
|
/>
|
||||||
{icon ? (
|
{icon ? (
|
||||||
<IconButton
|
<span
|
||||||
disabled={disabled}
|
className={dateFieldClasses.icon}
|
||||||
className={dateFieldClasses.iconButton}
|
|
||||||
onClick={() => !disabled && onIconClick && onIconClick()}
|
onClick={() => !disabled && onIconClick && onIconClick()}
|
||||||
>
|
>
|
||||||
{icon}
|
{icon}
|
||||||
</IconButton>
|
</span>
|
||||||
) : error && errorIcon ? (
|
) : error && errorIcon ? (
|
||||||
<ErrorIcon color="primary" className={dateFieldClasses.icon} />
|
<span className={dateFieldClasses.icon}>
|
||||||
|
<ErrorIcon color="primary" />
|
||||||
|
</span>
|
||||||
) : clearButton && input.filled ? (
|
) : clearButton && input.filled ? (
|
||||||
<IconButton
|
<span
|
||||||
disabled={disabled}
|
|
||||||
onClick={() => !disabled && onCancel()}
|
onClick={() => !disabled && onCancel()}
|
||||||
aria-label="clear"
|
className={dateFieldClasses.icon}
|
||||||
className={dateFieldClasses.iconButton}
|
|
||||||
>
|
>
|
||||||
<CloseIcon color="primary" className={dateFieldClasses.icon} />
|
<CloseIcon color="primary" />
|
||||||
</IconButton>
|
</span>
|
||||||
) : null}
|
) : null}
|
||||||
</div>
|
</div>
|
||||||
{supportingText && (
|
{supportingText && (
|
||||||
<div className={clsx(dateFieldClasses.supportingText)}>
|
<div className={clsx(dateFieldClasses.supportingText)}>
|
||||||
<Typography
|
<Typography variant={'label2'} component="p">
|
||||||
variant={size === 'large' ? 'label1' : 'label2'}
|
|
||||||
component="p"
|
|
||||||
>
|
|
||||||
{supportingText}
|
{supportingText}
|
||||||
</Typography>
|
</Typography>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -1,5 +1,9 @@
|
||||||
export const datePickerClasses = {
|
export const datePickerClasses = {
|
||||||
root: `lsd-date-picker`,
|
root: `lsd-date-picker`,
|
||||||
|
|
||||||
calendar: `lsd-date-picker-calendar`,
|
calendar: `lsd-date-picker__calendar`,
|
||||||
|
|
||||||
|
large: `lsd-date-picker--large`,
|
||||||
|
medium: `lsd-date-picker--medium`,
|
||||||
|
small: `lsd-date-picker--small`,
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,7 +8,14 @@ export default {
|
||||||
size: {
|
size: {
|
||||||
type: {
|
type: {
|
||||||
name: 'enum',
|
name: 'enum',
|
||||||
value: ['medium', 'large'],
|
value: ['small', 'medium', 'large'],
|
||||||
|
},
|
||||||
|
defaultValue: 'large',
|
||||||
|
},
|
||||||
|
variant: {
|
||||||
|
type: {
|
||||||
|
name: 'enum',
|
||||||
|
value: ['outlined', 'outlined-bottom'],
|
||||||
},
|
},
|
||||||
defaultValue: 'large',
|
defaultValue: 'large',
|
||||||
},
|
},
|
||||||
|
@ -24,6 +31,7 @@ export const Controlled: Story<DatePickerProps> = ({ ...args }) => {
|
||||||
}
|
}
|
||||||
|
|
||||||
Uncontrolled.args = {
|
Uncontrolled.args = {
|
||||||
|
id: 'label',
|
||||||
supportingText: 'Supporting text',
|
supportingText: 'Supporting text',
|
||||||
disabled: false,
|
disabled: false,
|
||||||
error: false,
|
error: false,
|
||||||
|
@ -33,9 +41,12 @@ Uncontrolled.args = {
|
||||||
clearButton: true,
|
clearButton: true,
|
||||||
withCalendar: true,
|
withCalendar: true,
|
||||||
size: 'large',
|
size: 'large',
|
||||||
|
variant: 'outlined-bottom',
|
||||||
|
label: 'Label',
|
||||||
}
|
}
|
||||||
|
|
||||||
Controlled.args = {
|
Controlled.args = {
|
||||||
|
id: 'label',
|
||||||
supportingText: 'Supporting text',
|
supportingText: 'Supporting text',
|
||||||
disabled: false,
|
disabled: false,
|
||||||
error: false,
|
error: false,
|
||||||
|
@ -45,4 +56,6 @@ Controlled.args = {
|
||||||
clearButton: true,
|
clearButton: true,
|
||||||
withCalendar: true,
|
withCalendar: true,
|
||||||
size: 'large',
|
size: 'large',
|
||||||
|
variant: 'outlined-bottom',
|
||||||
|
label: 'Label',
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
import { css } from '@emotion/react'
|
import { css } from '@emotion/react'
|
||||||
import { datePickerClasses } from './DatePicker.classes'
|
import { datePickerClasses } from './DatePicker.classes'
|
||||||
|
import { dateFieldClasses } from '../DateField/DateField.classes'
|
||||||
|
|
||||||
export const DatePickerStyles = css`
|
export const DatePickerStyles = css`
|
||||||
.${datePickerClasses.root} {
|
.${datePickerClasses.root} {
|
||||||
|
@ -9,4 +10,22 @@ export const DatePickerStyles = css`
|
||||||
.${datePickerClasses.calendar} {
|
.${datePickerClasses.calendar} {
|
||||||
border-top: none !important;
|
border-top: none !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.${datePickerClasses.large} {
|
||||||
|
.${dateFieldClasses.large} {
|
||||||
|
width: 318px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.${datePickerClasses.medium} {
|
||||||
|
.${dateFieldClasses.medium} {
|
||||||
|
width: 290px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.${datePickerClasses.small} {
|
||||||
|
.${dateFieldClasses.small} {
|
||||||
|
width: 262px;
|
||||||
|
}
|
||||||
|
}
|
||||||
`
|
`
|
||||||
|
|
|
@ -16,6 +16,7 @@ export type DatePickerProps = Omit<
|
||||||
'onChange' | 'value'
|
'onChange' | 'value'
|
||||||
> &
|
> &
|
||||||
Pick<React.InputHTMLAttributes<HTMLInputElement>, 'onChange'> & {
|
Pick<React.InputHTMLAttributes<HTMLInputElement>, 'onChange'> & {
|
||||||
|
label?: React.ReactNode
|
||||||
error?: boolean
|
error?: boolean
|
||||||
errorIcon?: boolean
|
errorIcon?: boolean
|
||||||
clearButton?: boolean
|
clearButton?: boolean
|
||||||
|
@ -25,13 +26,22 @@ export type DatePickerProps = Omit<
|
||||||
value?: string
|
value?: string
|
||||||
defaultValue?: string
|
defaultValue?: string
|
||||||
placeholder?: string
|
placeholder?: string
|
||||||
size?: 'large' | 'medium'
|
size?: 'large' | 'medium' | 'small'
|
||||||
|
variant?: 'outlined' | 'outlined-bottom'
|
||||||
inputProps?: React.InputHTMLAttributes<HTMLInputElement>
|
inputProps?: React.InputHTMLAttributes<HTMLInputElement>
|
||||||
}
|
}
|
||||||
|
|
||||||
export const DatePicker: React.FC<DatePickerProps> & {
|
export const DatePicker: React.FC<DatePickerProps> & {
|
||||||
classes: typeof datePickerClasses
|
classes: typeof datePickerClasses
|
||||||
} = ({ value: valueProp, onChange, withCalendar = true, ...props }) => {
|
} = ({
|
||||||
|
label,
|
||||||
|
size = 'large',
|
||||||
|
value: valueProp,
|
||||||
|
onChange,
|
||||||
|
withCalendar = true,
|
||||||
|
variant = 'outlined-bottom',
|
||||||
|
...props
|
||||||
|
}) => {
|
||||||
const ref = useRef<HTMLDivElement>(null)
|
const ref = useRef<HTMLDivElement>(null)
|
||||||
const [openCalendar, setOpenCalendar] = useState(false)
|
const [openCalendar, setOpenCalendar] = useState(false)
|
||||||
|
|
||||||
|
@ -48,18 +58,27 @@ export const DatePicker: React.FC<DatePickerProps> & {
|
||||||
const handleDateChange = (date: Date) =>
|
const handleDateChange = (date: Date) =>
|
||||||
input.setValue(dateToISODateString(removeDateTimezoneOffset(date)))
|
input.setValue(dateToISODateString(removeDateTimezoneOffset(date)))
|
||||||
|
|
||||||
|
const inputId = (props.id || 'date-picker') + '-input'
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
|
id={inputId}
|
||||||
ref={ref}
|
ref={ref}
|
||||||
{...props}
|
{...props}
|
||||||
className={clsx(props.className, datePickerClasses.root)}
|
className={clsx(
|
||||||
|
props.className,
|
||||||
|
datePickerClasses.root,
|
||||||
|
datePickerClasses[size],
|
||||||
|
)}
|
||||||
>
|
>
|
||||||
<DateField
|
<DateField
|
||||||
|
label={label}
|
||||||
|
size={size}
|
||||||
|
variant={variant}
|
||||||
icon={withCalendar && <CalendarIcon color="primary" />}
|
icon={withCalendar && <CalendarIcon color="primary" />}
|
||||||
onIconClick={() => setOpenCalendar((prev) => !prev)}
|
onIconClick={() => setOpenCalendar((prev) => !prev)}
|
||||||
value={input.value}
|
value={input.value}
|
||||||
onChange={input.onChange}
|
onChange={input.onChange}
|
||||||
style={{ width: '310px' }}
|
|
||||||
{...props}
|
{...props}
|
||||||
>
|
>
|
||||||
<Portal id="calendar">
|
<Portal id="calendar">
|
||||||
|
|
Loading…
Reference in New Issue