chore: update ui refs in plugins
This commit is contained in:
@@ -1,10 +1,11 @@
|
||||
'use client'
|
||||
|
||||
import type { TextFieldProps } from '@payloadcms/ui/forms'
|
||||
import type { TextFieldProps } from '@payloadcms/ui/fields/Text'
|
||||
import type { Data } from 'payload/types'
|
||||
|
||||
import { useLocale, useWatchForm } from '@payloadcms/ui'
|
||||
import { Text } from '@payloadcms/ui/forms'
|
||||
import { Text } from '@payloadcms/ui/fields/Text'
|
||||
import { useWatchForm } from '@payloadcms/ui/forms/Form'
|
||||
import { useLocale } from '@payloadcms/ui/providers/Locale'
|
||||
import React, { useEffect, useState } from 'react'
|
||||
|
||||
type FieldWithID = {
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import type { FormState, UIField } from 'payload/types'
|
||||
|
||||
import { useConfig, useWatchForm } from '@payloadcms/ui'
|
||||
import { useWatchForm } from '@payloadcms/ui/forms/Form'
|
||||
import { useConfig } from '@payloadcms/ui/providers/Config'
|
||||
import React from 'react'
|
||||
// TODO: fix this import to work in dev mode within the monorepo in a way that is backwards compatible with 1.x
|
||||
// import CopyToClipboard from 'payload/dist/admin/components/elements/CopyToClipboard'
|
||||
|
||||
@@ -1,11 +1,15 @@
|
||||
'use client'
|
||||
|
||||
import type { FieldType, FormFieldBase, Options } from '@payloadcms/ui'
|
||||
import type { FormFieldBase } from '@payloadcms/ui/fields/shared'
|
||||
import type { FieldType, Options } from '@payloadcms/ui/forms/useField'
|
||||
|
||||
import { useFieldPath } from '@payloadcms/ui'
|
||||
import { useTranslation } from '@payloadcms/ui'
|
||||
import { TextareaInput } from '@payloadcms/ui'
|
||||
import { useAllFormFields, useDocumentInfo, useField, useLocale } from '@payloadcms/ui'
|
||||
import { TextareaInput } from '@payloadcms/ui/fields/Textarea'
|
||||
import { useFieldProps } from '@payloadcms/ui/forms/FieldPropsProvider'
|
||||
import { useAllFormFields } from '@payloadcms/ui/forms/Form'
|
||||
import { useField } from '@payloadcms/ui/forms/useField'
|
||||
import { useDocumentInfo } from '@payloadcms/ui/providers/DocumentInfo'
|
||||
import { useLocale } from '@payloadcms/ui/providers/Locale'
|
||||
import { useTranslation } from '@payloadcms/ui/providers/Translation'
|
||||
import React, { useCallback } from 'react'
|
||||
|
||||
import type { GenerateDescription } from '../types.js'
|
||||
@@ -23,7 +27,7 @@ type MetaDescriptionProps = FormFieldBase & {
|
||||
|
||||
export const MetaDescription: React.FC<MetaDescriptionProps> = (props) => {
|
||||
const { Label, hasGenerateDescriptionFn, path, required } = props
|
||||
const { path: pathFromContext } = useFieldPath()
|
||||
const { path: pathFromContext } = useFieldProps()
|
||||
|
||||
const { t } = useTranslation()
|
||||
|
||||
|
||||
@@ -1,16 +1,15 @@
|
||||
'use client'
|
||||
|
||||
import type { FieldType, Options, UploadInputProps } from '@payloadcms/ui'
|
||||
import type { UploadInputProps } from '@payloadcms/ui/fields/Upload'
|
||||
import type { FieldType, Options } from '@payloadcms/ui/forms/useField'
|
||||
|
||||
import {
|
||||
UploadInput,
|
||||
useAllFormFields,
|
||||
useConfig,
|
||||
useDocumentInfo,
|
||||
useField,
|
||||
useLocale,
|
||||
useTranslation,
|
||||
} from '@payloadcms/ui'
|
||||
import { UploadInput } from '@payloadcms/ui/fields/Upload'
|
||||
import { useAllFormFields } from '@payloadcms/ui/forms/Form'
|
||||
import { useField } from '@payloadcms/ui/forms/useField'
|
||||
import { useConfig } from '@payloadcms/ui/providers/Config'
|
||||
import { useDocumentInfo } from '@payloadcms/ui/providers/DocumentInfo'
|
||||
import { useLocale } from '@payloadcms/ui/providers/Locale'
|
||||
import { useTranslation } from '@payloadcms/ui/providers/Translation'
|
||||
import React, { useCallback } from 'react'
|
||||
|
||||
import type { GenerateImage } from '../types.js'
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
'use client'
|
||||
|
||||
import type { FieldType, FormFieldBase, Options } from '@payloadcms/ui'
|
||||
import type { FormFieldBase } from '@payloadcms/ui/fields/shared'
|
||||
import type { Options } from '@payloadcms/ui/forms/useField'
|
||||
import type { FieldType } from '@payloadcms/ui/forms/useField'
|
||||
|
||||
import { useFieldPath } from '@payloadcms/ui'
|
||||
import {
|
||||
TextInput,
|
||||
useAllFormFields,
|
||||
useDocumentInfo,
|
||||
useField,
|
||||
useLocale,
|
||||
useTranslation,
|
||||
} from '@payloadcms/ui'
|
||||
import { TextInput } from '@payloadcms/ui/fields/Text'
|
||||
import { useFieldProps } from '@payloadcms/ui/forms/FieldPropsProvider'
|
||||
import { useAllFormFields } from '@payloadcms/ui/forms/Form'
|
||||
import { useField } from '@payloadcms/ui/forms/useField'
|
||||
import { useDocumentInfo } from '@payloadcms/ui/providers/DocumentInfo'
|
||||
import { useLocale } from '@payloadcms/ui/providers/Locale'
|
||||
import { useTranslation } from '@payloadcms/ui/providers/Translation'
|
||||
import React, { useCallback } from 'react'
|
||||
|
||||
import type { GenerateTitle } from '../types.js'
|
||||
@@ -28,7 +28,7 @@ type MetaTitleProps = FormFieldBase & {
|
||||
|
||||
export const MetaTitle: React.FC<MetaTitleProps> = (props) => {
|
||||
const { Label, hasGenerateTitleFn, path, required } = props || {}
|
||||
const { path: pathFromContext } = useFieldPath()
|
||||
const { path: pathFromContext } = useFieldProps()
|
||||
|
||||
const { t } = useTranslation()
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { DocumentInfoContext } from '@payloadcms/ui/providers'
|
||||
import type { DocumentInfoContext } from '@payloadcms/ui/providers/DocumentInfo'
|
||||
import type { Field, TextField, TextareaField, UploadField } from 'payload/types'
|
||||
|
||||
export type GenerateTitle = <T = any>(
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
'use client'
|
||||
|
||||
import { useTranslation } from '@payloadcms/ui'
|
||||
import { useTranslation } from '@payloadcms/ui/providers/Translation'
|
||||
import React, { Fragment, useEffect, useState } from 'react'
|
||||
|
||||
import { Pill } from './Pill.js'
|
||||
|
||||
@@ -2,7 +2,8 @@
|
||||
|
||||
import type { FormField } from 'payload/types'
|
||||
|
||||
import { useAllFormFields, useForm, useTranslation } from '@payloadcms/ui'
|
||||
import { useAllFormFields, useForm } from '@payloadcms/ui/forms/Form'
|
||||
import { useTranslation } from '@payloadcms/ui/providers/Translation'
|
||||
import React, { useCallback, useEffect, useState } from 'react'
|
||||
|
||||
import { defaults } from '../defaults.js'
|
||||
|
||||
@@ -2,7 +2,10 @@
|
||||
|
||||
import type { FormField, UIField } from 'payload/types'
|
||||
|
||||
import { useAllFormFields, useDocumentInfo, useLocale, useTranslation } from '@payloadcms/ui'
|
||||
import { useAllFormFields } from '@payloadcms/ui/forms/Form'
|
||||
import { useDocumentInfo } from '@payloadcms/ui/providers/DocumentInfo'
|
||||
import { useLocale } from '@payloadcms/ui/providers/Locale'
|
||||
import { useTranslation } from '@payloadcms/ui/providers/Translation'
|
||||
import React, { useEffect, useState } from 'react'
|
||||
|
||||
import type { GenerateURL } from '../types.js'
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
import type { EditorConfig as LexicalEditorConfig } from 'lexical/LexicalEditor.js'
|
||||
|
||||
import { type FormFieldBase, ShimmerEffect } from '@payloadcms/ui'
|
||||
import { useFieldPath } from '@payloadcms/ui/forms'
|
||||
import { useClientFunctions } from '@payloadcms/ui/providers'
|
||||
import React, { Suspense, lazy, useEffect, useState } from 'react'
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ import type { FormState, SanitizedCollectionConfig } from 'payload/types'
|
||||
import { isImage } from 'payload/utilities'
|
||||
import React, { useCallback, useEffect, useState } from 'react'
|
||||
|
||||
import { fieldBaseClass } from '../../fields/shared.js'
|
||||
import { fieldBaseClass } from '../../fields/shared/index.js'
|
||||
import { Error } from '../../forms/Error/index.js'
|
||||
import { useFormSubmitted } from '../../forms/Form/context.js'
|
||||
import { useField } from '../../forms/useField/index.js'
|
||||
|
||||
@@ -7,7 +7,7 @@ import { getTranslation } from '@payloadcms/translations'
|
||||
import React, { useCallback } from 'react'
|
||||
|
||||
import type { FieldMap } from '../../providers/ComponentMap/buildComponentMap/types.js'
|
||||
import type { FormFieldBase } from '../shared.js'
|
||||
import type { FormFieldBase } from '../shared/index.js'
|
||||
|
||||
import { Banner } from '../../elements/Banner/index.js'
|
||||
import { Button } from '../../elements/Button/index.js'
|
||||
@@ -23,7 +23,7 @@ import { useDocumentInfo } from '../../providers/DocumentInfo/index.js'
|
||||
import { useLocale } from '../../providers/Locale/index.js'
|
||||
import { useTranslation } from '../../providers/Translation/index.js'
|
||||
import { scrollToID } from '../../utilities/scrollToID.js'
|
||||
import { fieldBaseClass } from '../shared.js'
|
||||
import { fieldBaseClass } from '../shared/index.js'
|
||||
import { ArrayRow } from './ArrayRow.js'
|
||||
import './index.scss'
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ import { useDocumentInfo } from '../../providers/DocumentInfo/index.js'
|
||||
import { useLocale } from '../../providers/Locale/index.js'
|
||||
import { useTranslation } from '../../providers/Translation/index.js'
|
||||
import { scrollToID } from '../../utilities/scrollToID.js'
|
||||
import { fieldBaseClass } from '../shared.js'
|
||||
import { fieldBaseClass } from '../shared/index.js'
|
||||
import { BlockRow } from './BlockRow.js'
|
||||
import { BlocksDrawer } from './BlocksDrawer/index.js'
|
||||
import './index.scss'
|
||||
@@ -32,7 +32,7 @@ import type {
|
||||
FieldMap,
|
||||
ReducedBlock,
|
||||
} from '../../providers/ComponentMap/buildComponentMap/types.js'
|
||||
import type { FormFieldBase } from '../shared.js'
|
||||
import type { FormFieldBase } from '../shared/index.js'
|
||||
|
||||
export type BlocksFieldProps = FormFieldBase & {
|
||||
blocks?: ReducedBlock[]
|
||||
|
||||
@@ -10,7 +10,7 @@ import { Label as LabelComp } from '../../forms/Label/index.js'
|
||||
import { useField } from '../../forms/useField/index.js'
|
||||
import { withCondition } from '../../forms/withCondition/index.js'
|
||||
import { generateFieldID } from '../../utilities/generateFieldID.js'
|
||||
import { fieldBaseClass } from '../shared.js'
|
||||
import { fieldBaseClass } from '../shared/index.js'
|
||||
import { CheckboxInput } from './Input.js'
|
||||
import './index.scss'
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import type { FieldBase } from 'payload/types'
|
||||
|
||||
import type { FormFieldBase } from '../shared.js'
|
||||
import type { FormFieldBase } from '../shared/index.js'
|
||||
|
||||
export type CheckboxFieldProps = FormFieldBase & {
|
||||
checked?: boolean
|
||||
|
||||
@@ -4,13 +4,13 @@ import type { CodeField as CodeFieldType, FieldBase } from 'payload/types'
|
||||
|
||||
import React, { useCallback } from 'react'
|
||||
|
||||
import type { FormFieldBase } from '../shared.js'
|
||||
import type { FormFieldBase } from '../shared/index.js'
|
||||
|
||||
import { CodeEditor } from '../../elements/CodeEditor/index.js'
|
||||
import { Label as LabelComp } from '../../forms/Label/index.js'
|
||||
import { useField } from '../../forms/useField/index.js'
|
||||
import { withCondition } from '../../forms/withCondition/index.js'
|
||||
import { fieldBaseClass } from '../shared.js'
|
||||
import { fieldBaseClass } from '../shared/index.js'
|
||||
import './index.scss'
|
||||
|
||||
export type CodeFieldProps = FormFieldBase & {
|
||||
|
||||
@@ -14,7 +14,7 @@ import { withCondition } from '../../forms/withCondition/index.js'
|
||||
import { useDocumentInfo } from '../../providers/DocumentInfo/index.js'
|
||||
import { usePreferences } from '../../providers/Preferences/index.js'
|
||||
import { useTranslation } from '../../providers/Translation/index.js'
|
||||
import { fieldBaseClass } from '../shared.js'
|
||||
import { fieldBaseClass } from '../shared/index.js'
|
||||
import './index.scss'
|
||||
|
||||
const baseClass = 'collapsible-field'
|
||||
@@ -23,7 +23,7 @@ import type { FieldPermissions } from 'payload/auth'
|
||||
import type { FieldBase } from 'payload/types'
|
||||
|
||||
import type { FieldMap } from '../../providers/ComponentMap/buildComponentMap/types.js'
|
||||
import type { FormFieldBase } from '../shared.js'
|
||||
import type { FormFieldBase } from '../shared/index.js'
|
||||
|
||||
export type CollapsibleFieldProps = FormFieldBase & {
|
||||
fieldMap: FieldMap
|
||||
|
||||
@@ -8,7 +8,7 @@ import { useFormFields } from '../../forms/Form/context.js'
|
||||
import { Label } from '../../forms/Label/index.js'
|
||||
import { useField } from '../../forms/useField/index.js'
|
||||
import { useTranslation } from '../../providers/Translation/index.js'
|
||||
import { fieldBaseClass } from '../shared.js'
|
||||
import { fieldBaseClass } from '../shared/index.js'
|
||||
import './index.scss'
|
||||
|
||||
export type ConfirmPasswordFieldProps = {
|
||||
|
||||
@@ -9,14 +9,14 @@ import { DatePickerField } from '../../elements/DatePicker/index.js'
|
||||
import { Label as LabelComp } from '../../forms/Label/index.js'
|
||||
import { useField } from '../../forms/useField/index.js'
|
||||
import { useTranslation } from '../../providers/Translation/index.js'
|
||||
import { fieldBaseClass } from '../shared.js'
|
||||
import { fieldBaseClass } from '../shared/index.js'
|
||||
import './index.scss'
|
||||
|
||||
const baseClass = 'date-time-field'
|
||||
|
||||
import type { DateField, FieldBase } from 'payload/types'
|
||||
|
||||
import type { FormFieldBase } from '../shared.js'
|
||||
import type { FormFieldBase } from '../shared/index.js'
|
||||
|
||||
import { withCondition } from '../../forms/withCondition/index.js'
|
||||
|
||||
|
||||
@@ -5,13 +5,13 @@ import type { EmailField as EmailFieldType, FieldBase } from 'payload/types'
|
||||
import { getTranslation } from '@payloadcms/translations'
|
||||
import React, { useCallback } from 'react'
|
||||
|
||||
import type { FormFieldBase } from '../shared.js'
|
||||
import type { FormFieldBase } from '../shared/index.js'
|
||||
|
||||
import { Label as LabelComp } from '../../forms/Label/index.js'
|
||||
import { useField } from '../../forms/useField/index.js'
|
||||
import { withCondition } from '../../forms/withCondition/index.js'
|
||||
import { useTranslation } from '../../providers/Translation/index.js'
|
||||
import { fieldBaseClass } from '../shared.js'
|
||||
import { fieldBaseClass } from '../shared/index.js'
|
||||
import './index.scss'
|
||||
|
||||
export type EmailFieldProps = FormFieldBase & {
|
||||
|
||||
@@ -5,7 +5,7 @@ import type { FieldBase } from 'payload/types'
|
||||
import React, { Fragment } from 'react'
|
||||
|
||||
import type { FieldMap } from '../../providers/ComponentMap/buildComponentMap/types.js'
|
||||
import type { FormFieldBase } from '../shared.js'
|
||||
import type { FormFieldBase } from '../shared/index.js'
|
||||
|
||||
import { useCollapsible } from '../../elements/Collapsible/provider.js'
|
||||
import { ErrorPill } from '../../elements/ErrorPill/index.js'
|
||||
@@ -17,7 +17,7 @@ import { withCondition } from '../../forms/withCondition/index.js'
|
||||
import { useTranslation } from '../../providers/Translation/index.js'
|
||||
import { useRow } from '../Row/provider.js'
|
||||
import { useTabs } from '../Tabs/provider.js'
|
||||
import { fieldBaseClass } from '../shared.js'
|
||||
import { fieldBaseClass } from '../shared/index.js'
|
||||
import './index.scss'
|
||||
import { GroupProvider, useGroup } from './provider.js'
|
||||
|
||||
|
||||
@@ -7,14 +7,14 @@ import { CodeEditor } from '../../elements/CodeEditor/index.js'
|
||||
import { Label as LabelComp } from '../../forms/Label/index.js'
|
||||
import { useField } from '../../forms/useField/index.js'
|
||||
import { withCondition } from '../../forms/withCondition/index.js'
|
||||
import { fieldBaseClass } from '../shared.js'
|
||||
import { fieldBaseClass } from '../shared/index.js'
|
||||
import './index.scss'
|
||||
|
||||
const baseClass = 'json-field'
|
||||
|
||||
import type { FieldBase, JSONField as JSONFieldType } from 'payload/types'
|
||||
|
||||
import type { FormFieldBase } from '../shared.js'
|
||||
import type { FormFieldBase } from '../shared/index.js'
|
||||
|
||||
export type JSONFieldProps = FormFieldBase & {
|
||||
editorOptions?: JSONFieldType['admin']['editorOptions']
|
||||
|
||||
@@ -7,14 +7,14 @@ import { isNumber } from 'payload/utilities'
|
||||
import React, { useCallback, useEffect, useState } from 'react'
|
||||
|
||||
import type { Option } from '../../elements/ReactSelect/types.js'
|
||||
import type { FormFieldBase } from '../shared.js'
|
||||
import type { FormFieldBase } from '../shared/index.js'
|
||||
|
||||
import { ReactSelect } from '../../elements/ReactSelect/index.js'
|
||||
import { Label as LabelComp } from '../../forms/Label/index.js'
|
||||
import { useField } from '../../forms/useField/index.js'
|
||||
import { withCondition } from '../../forms/withCondition/index.js'
|
||||
import { useTranslation } from '../../providers/Translation/index.js'
|
||||
import { fieldBaseClass } from '../shared.js'
|
||||
import { fieldBaseClass } from '../shared/index.js'
|
||||
import './index.scss'
|
||||
|
||||
export type NumberFieldProps = FormFieldBase & {
|
||||
|
||||
@@ -3,12 +3,12 @@ import type { ClientValidate, Description, Validate } from 'payload/types'
|
||||
|
||||
import React, { useCallback } from 'react'
|
||||
|
||||
import type { FormFieldBase } from '../shared.js'
|
||||
import type { FormFieldBase } from '../shared/index.js'
|
||||
|
||||
import { Label as LabelComp } from '../../forms/Label/index.js'
|
||||
import { useField } from '../../forms/useField/index.js'
|
||||
import { withCondition } from '../../forms/withCondition/index.js'
|
||||
import { fieldBaseClass } from '../shared.js'
|
||||
import { fieldBaseClass } from '../shared/index.js'
|
||||
import './index.scss'
|
||||
|
||||
export type PasswordFieldProps = FormFieldBase & {
|
||||
|
||||
@@ -9,12 +9,12 @@ import { Label as LabelComp } from '../../forms/Label/index.js'
|
||||
import { useField } from '../../forms/useField/index.js'
|
||||
import { withCondition } from '../../forms/withCondition/index.js'
|
||||
import { useTranslation } from '../../providers/Translation/index.js'
|
||||
import { fieldBaseClass } from '../shared.js'
|
||||
import { fieldBaseClass } from '../shared/index.js'
|
||||
import './index.scss'
|
||||
|
||||
const baseClass = 'point'
|
||||
|
||||
import type { FormFieldBase } from '../shared.js'
|
||||
import type { FormFieldBase } from '../shared/index.js'
|
||||
|
||||
export type PointFieldProps = FormFieldBase & {
|
||||
label?: FieldBase['label']
|
||||
|
||||
@@ -10,13 +10,13 @@ import { useForm } from '../../forms/Form/context.js'
|
||||
import { Label as LabelComp } from '../../forms/Label/index.js'
|
||||
import { useField } from '../../forms/useField/index.js'
|
||||
import { withCondition } from '../../forms/withCondition/index.js'
|
||||
import { fieldBaseClass } from '../shared.js'
|
||||
import { fieldBaseClass } from '../shared/index.js'
|
||||
import { Radio } from './Radio/index.js'
|
||||
import './index.scss'
|
||||
|
||||
const baseClass = 'radio-group'
|
||||
|
||||
import type { FormFieldBase } from '../shared.js'
|
||||
import type { FormFieldBase } from '../shared/index.js'
|
||||
|
||||
export type RadioFieldProps = FormFieldBase & {
|
||||
label?: FieldBase['label']
|
||||
|
||||
@@ -18,7 +18,7 @@ import { useAuth } from '../../providers/Auth/index.js'
|
||||
import { useConfig } from '../../providers/Config/index.js'
|
||||
import { useLocale } from '../../providers/Locale/index.js'
|
||||
import { useTranslation } from '../../providers/Translation/index.js'
|
||||
import { fieldBaseClass } from '../shared.js'
|
||||
import { fieldBaseClass } from '../shared/index.js'
|
||||
import { AddNewRelation } from './AddNew/index.js'
|
||||
import { createRelationMap } from './createRelationMap.js'
|
||||
import { findOptionsByValue } from './findOptionsByValue.js'
|
||||
|
||||
@@ -2,7 +2,7 @@ import type { I18n } from '@payloadcms/translations'
|
||||
import type { RelationshipField, SanitizedCollectionConfig } from 'payload/types'
|
||||
import type { SanitizedConfig } from 'payload/types'
|
||||
|
||||
import type { FormFieldBase } from '../shared.js'
|
||||
import type { FormFieldBase } from '../shared/index.js'
|
||||
|
||||
export type RelationshipFieldProps = FormFieldBase & {
|
||||
allowCreate?: RelationshipField['admin']['allowCreate']
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import type React from 'react'
|
||||
|
||||
import type { MappedField } from '../../providers/ComponentMap/buildComponentMap/types.js'
|
||||
import type { FormFieldBase } from '../shared.js'
|
||||
import type { FormFieldBase } from '../shared/index.js'
|
||||
|
||||
export type RichTextFieldProps = FormFieldBase & {
|
||||
richTextComponentMap?: Map<string, MappedField[] | React.ReactNode>
|
||||
|
||||
@@ -6,7 +6,7 @@ import type { RowFieldProps } from './types.js'
|
||||
import { useFieldProps } from '../../forms/FieldPropsProvider/index.js'
|
||||
import { RenderFields } from '../../forms/RenderFields/index.js'
|
||||
import { withCondition } from '../../forms/withCondition/index.js'
|
||||
import { fieldBaseClass } from '../shared.js'
|
||||
import { fieldBaseClass } from '../shared/index.js'
|
||||
import './index.scss'
|
||||
import { RowProvider, useRow } from './provider.js'
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import type { FieldPermissions } from 'payload/auth'
|
||||
|
||||
import type { FieldMap } from '../../providers/ComponentMap/buildComponentMap/types.js'
|
||||
import type { FormFieldBase } from '../shared.js'
|
||||
import type { FormFieldBase } from '../shared/index.js'
|
||||
|
||||
export type RowFieldProps = FormFieldBase & {
|
||||
fieldMap: FieldMap
|
||||
|
||||
@@ -5,14 +5,14 @@ import type { ClientValidate, FieldBase, Option, OptionObject } from 'payload/ty
|
||||
import { getTranslation } from '@payloadcms/translations'
|
||||
import React, { useCallback, useState } from 'react'
|
||||
|
||||
import type { FormFieldBase } from '../shared.js'
|
||||
import type { FormFieldBase } from '../shared/index.js'
|
||||
|
||||
import { ReactSelect } from '../../elements/ReactSelect/index.js'
|
||||
import { Label as LabelComp } from '../../forms/Label/index.js'
|
||||
import { useField } from '../../forms/useField/index.js'
|
||||
import { withCondition } from '../../forms/withCondition/index.js'
|
||||
import { useTranslation } from '../../providers/Translation/index.js'
|
||||
import { fieldBaseClass } from '../shared.js'
|
||||
import { fieldBaseClass } from '../shared/index.js'
|
||||
import './index.scss'
|
||||
|
||||
export type SelectFieldProps = FormFieldBase & {
|
||||
|
||||
@@ -7,7 +7,7 @@ import { toKebabCase } from 'payload/utilities'
|
||||
import React, { useCallback, useEffect, useState } from 'react'
|
||||
|
||||
import type { FieldMap, MappedTab } from '../../providers/ComponentMap/buildComponentMap/types.js'
|
||||
import type { FormFieldBase } from '../shared.js'
|
||||
import type { FormFieldBase } from '../shared/index.js'
|
||||
|
||||
import { useCollapsible } from '../../elements/Collapsible/provider.js'
|
||||
import { useFieldProps } from '../../forms/FieldPropsProvider/index.js'
|
||||
@@ -16,7 +16,7 @@ import { withCondition } from '../../forms/withCondition/index.js'
|
||||
import { useDocumentInfo } from '../../providers/DocumentInfo/index.js'
|
||||
import { usePreferences } from '../../providers/Preferences/index.js'
|
||||
import { useTranslation } from '../../providers/Translation/index.js'
|
||||
import { fieldBaseClass } from '../shared.js'
|
||||
import { fieldBaseClass } from '../shared/index.js'
|
||||
import { TabComponent } from './Tab/index.js'
|
||||
import './index.scss'
|
||||
import { TabsProvider } from './provider.js'
|
||||
|
||||
@@ -6,7 +6,7 @@ import type { TextInputProps } from './types.js'
|
||||
|
||||
import { ReactSelect } from '../../elements/ReactSelect/index.js'
|
||||
import { useTranslation } from '../../providers/Translation/index.js'
|
||||
import { fieldBaseClass } from '../shared.js'
|
||||
import { fieldBaseClass } from '../shared/index.js'
|
||||
import './index.scss'
|
||||
|
||||
export const TextInput: React.FC<TextInputProps> = (props) => {
|
||||
|
||||
@@ -12,7 +12,7 @@ import { useField } from '../../forms/useField/index.js'
|
||||
import { withCondition } from '../../forms/withCondition/index.js'
|
||||
import { useConfig } from '../../providers/Config/index.js'
|
||||
import { useLocale } from '../../providers/Locale/index.js'
|
||||
import { isFieldRTL } from '../shared.js'
|
||||
import { isFieldRTL } from '../shared/index.js'
|
||||
import { TextInput } from './Input.js'
|
||||
import './index.scss'
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ import type { FieldBase, TextField } from 'payload/types'
|
||||
import type { ChangeEvent } from 'react'
|
||||
|
||||
import type { Option } from '../../elements/ReactSelect/types.js'
|
||||
import type { FormFieldBase } from '../shared.js'
|
||||
import type { FormFieldBase } from '../shared/index.js'
|
||||
|
||||
export type TextFieldProps = FormFieldBase & {
|
||||
hasMany?: boolean
|
||||
|
||||
@@ -5,7 +5,7 @@ import React from 'react'
|
||||
import type { TextAreaInputProps } from './types.js'
|
||||
|
||||
import { useTranslation } from '../../providers/Translation/index.js'
|
||||
import { fieldBaseClass } from '../shared.js'
|
||||
import { fieldBaseClass } from '../shared/index.js'
|
||||
import './index.scss'
|
||||
|
||||
export const TextareaInput: React.FC<TextAreaInputProps> = (props) => {
|
||||
|
||||
@@ -12,7 +12,7 @@ import { useField } from '../../forms/useField/index.js'
|
||||
import { withCondition } from '../../forms/withCondition/index.js'
|
||||
import { useConfig } from '../../providers/Config/index.js'
|
||||
import { useTranslation } from '../../providers/Translation/index.js'
|
||||
import { isFieldRTL } from '../shared.js'
|
||||
import { isFieldRTL } from '../shared/index.js'
|
||||
import { TextareaInput } from './Input.js'
|
||||
import './index.scss'
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ import type { FieldBase, TextareaField as TextareaFieldType } from 'payload/type
|
||||
|
||||
import { type ChangeEvent } from 'react'
|
||||
|
||||
import type { FormFieldBase } from '../shared.js'
|
||||
import type { FormFieldBase } from '../shared/index.js'
|
||||
|
||||
export type TextareaFieldProps = FormFieldBase & {
|
||||
label?: FieldBase['label']
|
||||
|
||||
@@ -15,7 +15,7 @@ import FileDetails from '../../elements/FileDetails/index.js'
|
||||
import { useListDrawer } from '../../elements/ListDrawer/index.js'
|
||||
import { Label as LabelComp } from '../../forms/Label/index.js'
|
||||
import { useTranslation } from '../../providers/Translation/index.js'
|
||||
import { fieldBaseClass } from '../shared.js'
|
||||
import { fieldBaseClass } from '../shared/index.js'
|
||||
import './index.scss'
|
||||
|
||||
const baseClass = 'upload'
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
'use client'
|
||||
import React, { useCallback } from 'react'
|
||||
|
||||
import type { UploadInputProps } from './Input.js'
|
||||
import type { UploadFieldProps } from './types.js'
|
||||
|
||||
import { Label as LabelComp } from '../../forms/Label/index.js'
|
||||
@@ -10,6 +11,7 @@ import { UploadInput } from './Input.js'
|
||||
import './index.scss'
|
||||
|
||||
export { UploadFieldProps, UploadInput }
|
||||
export type { UploadInputProps }
|
||||
|
||||
export const Upload: React.FC<UploadFieldProps> = (props) => {
|
||||
const {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import type { UploadField } from 'payload/types'
|
||||
|
||||
import type { FormFieldBase } from '../shared.js'
|
||||
import type { FormFieldBase } from '../shared/index.js'
|
||||
|
||||
export type UploadFieldProps = FormFieldBase & {
|
||||
filterOptions?: UploadField['filterOptions']
|
||||
|
||||
@@ -25,6 +25,8 @@ import { Textarea as textarea } from './Textarea/index.js'
|
||||
import { UI as ui } from './UI/index.js'
|
||||
import { Upload as upload } from './Upload/index.js'
|
||||
|
||||
export * from './shared/index.js'
|
||||
|
||||
export const fieldComponents: FieldTypes = {
|
||||
array,
|
||||
blocks,
|
||||
|
||||
@@ -586,6 +586,13 @@ export const Form: React.FC<Props> = (props) => {
|
||||
export * from './types.js'
|
||||
|
||||
export {
|
||||
FormContext,
|
||||
FormFieldsContext,
|
||||
FormWatchContext,
|
||||
ModifiedContext,
|
||||
ProcessingContext,
|
||||
SubmittedContext,
|
||||
useAllFormFields,
|
||||
useForm,
|
||||
useFormFields,
|
||||
useFormModified,
|
||||
|
||||
@@ -4,6 +4,8 @@ import { useCallback, useMemo, useRef } from 'react'
|
||||
import type { UPDATE } from '../Form/types.js'
|
||||
import type { FieldType, Options } from './types.js'
|
||||
|
||||
export type { FieldType, Options }
|
||||
|
||||
import useThrottledEffect from '../../hooks/useThrottledEffect.js'
|
||||
import { useAuth } from '../../providers/Auth/index.js'
|
||||
import { useConfig } from '../../providers/Config/index.js'
|
||||
|
||||
@@ -22,7 +22,7 @@ import type { TabsFieldProps } from '../../../fields/Tabs/index.js'
|
||||
import type { TextFieldProps } from '../../../fields/Text/types.js'
|
||||
import type { TextareaFieldProps } from '../../../fields/Textarea/types.js'
|
||||
import type { UploadFieldProps } from '../../../fields/Upload/types.js'
|
||||
import type { FormFieldBase } from '../../../fields/shared.js'
|
||||
import type { FormFieldBase } from '../../../fields/shared/index.js'
|
||||
import type { Props as FieldDescription } from '../../../forms/FieldDescription/types.js'
|
||||
import type {
|
||||
FieldComponentProps,
|
||||
|
||||
Reference in New Issue
Block a user