Files
payloadcms/packages/payload/src/admin/fields/Checkbox.ts
Jarrod Flesch 1ebd54b315 feat: allows loginWithUsername to not require username (#7480)
Allows username to be optional when using the new loginWithUsername
feature. This can be done by the following:

```ts
auth: {
  loginWithUsername: {
    requireUsername: false, // <-- new property, default true
    requireEmail: false, // default: false
    allowEmailLogin: true, // default false
  },
},
```
2024-08-05 11:35:01 -04:00

22 lines
705 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
} & FormFieldBase
export type CheckboxFieldLabelComponent = LabelComponent<'checkbox'>
export type CheckboxFieldDescriptionComponent = DescriptionComponent<'checkbox'>
export type CheckboxFieldErrorComponent = ErrorComponent<'checkbox'>