Fixes https://github.com/payloadcms/payload/issues/7428 Now email and username fields are rendered with the RenderFields component, making them behave similarly to other fields. They now appear and can respect doc permissions, readOnly settings, etc.
22 lines
723 B
TypeScript
22 lines
723 B
TypeScript
import type { CheckboxFieldValidation } from '../../fields/validations.js'
|
|
import type { ErrorComponent } from '../forms/Error.js'
|
|
import type { DescriptionComponent, FormFieldBase, LabelComponent } from '../types.js'
|
|
|
|
export type CheckboxFieldProps = {
|
|
checked?: boolean
|
|
disableFormData?: boolean
|
|
id?: string
|
|
name?: string
|
|
onChange?: (val: boolean) => void
|
|
partialChecked?: boolean
|
|
path?: string
|
|
validate?: CheckboxFieldValidation
|
|
width?: string
|
|
} & Omit<FormFieldBase, 'validate'>
|
|
|
|
export type CheckboxFieldLabelComponent = LabelComponent<'checkbox'>
|
|
|
|
export type CheckboxFieldDescriptionComponent = DescriptionComponent<'checkbox'>
|
|
|
|
export type CheckboxFieldErrorComponent = ErrorComponent<'checkbox'>
|