chore: converts some files to esm
This commit is contained in:
@@ -1,50 +1,50 @@
|
||||
export { Button } from '../elements/Button'
|
||||
export { Card } from '../elements/Card'
|
||||
export { Collapsible } from '../elements/Collapsible'
|
||||
export { default as CopyToClipboard } from '../elements/CopyToClipboard'
|
||||
export { DeleteMany } from '../elements/DeleteMany'
|
||||
export { DocumentControls } from '../elements/DocumentControls'
|
||||
export { useDocumentDrawer } from '../elements/DocumentDrawer'
|
||||
export { DocumentFields } from '../elements/DocumentFields'
|
||||
export { DocumentHeader } from '../elements/DocumentHeader'
|
||||
export { Drawer, DrawerToggler, formatDrawerSlug } from '../elements/Drawer'
|
||||
export { useDrawerSlug } from '../elements/Drawer/useDrawerSlug'
|
||||
export { EditMany } from '../elements/EditMany'
|
||||
export { ErrorPill } from '../elements/ErrorPill'
|
||||
export { default as GenerateConfirmation } from '../elements/GenerateConfirmation'
|
||||
export { Gutter } from '../elements/Gutter'
|
||||
export { HydrateClientUser } from '../elements/HydrateClientUser'
|
||||
export { ListControls } from '../elements/ListControls'
|
||||
export { useListDrawer } from '../elements/ListDrawer'
|
||||
export { ListSelection } from '../elements/ListSelection'
|
||||
export { LoadingOverlayToggle } from '../elements/Loading'
|
||||
export { FormLoadingOverlayToggle } from '../elements/Loading'
|
||||
export { LoadingOverlay } from '../elements/Loading'
|
||||
export { Pagination } from '../elements/Pagination'
|
||||
export { PerPage } from '../elements/PerPage'
|
||||
export { Pill } from '../elements/Pill'
|
||||
export { default as Popup } from '../elements/Popup'
|
||||
export * as PopupList from '../elements/Popup/PopupButtonList'
|
||||
export { PublishMany } from '../elements/PublishMany'
|
||||
export { default as ReactSelect } from '../elements/ReactSelect'
|
||||
export type { Option } from '../elements/ReactSelect/types'
|
||||
export { RenderCustomComponent } from '../elements/RenderCustomComponent'
|
||||
export { ShimmerEffect } from '../elements/ShimmerEffect'
|
||||
export { StaggeredShimmers } from '../elements/ShimmerEffect'
|
||||
export { SortColumn } from '../elements/SortColumn'
|
||||
export { useStepNav } from '../elements/StepNav'
|
||||
export { SetStepNav } from '../elements/StepNav/SetStepNav'
|
||||
export type { StepNavItem } from '../elements/StepNav/types'
|
||||
export { Table } from '../elements/Table'
|
||||
export { TableCellProvider, useTableCell } from '../elements/Table/TableCellProvider'
|
||||
export type { Column } from '../elements/Table/types'
|
||||
export { TableColumnsProvider } from '../elements/TableColumns'
|
||||
export { default as Thumbnail } from '../elements/Thumbnail'
|
||||
export { Tooltip } from '../elements/Tooltip'
|
||||
// export { useThumbnail } from '../elements/Upload'
|
||||
export { Translation } from '../elements/Translation'
|
||||
export { UnpublishMany } from '../elements/UnpublishMany'
|
||||
export { Upload } from '../elements/Upload'
|
||||
export { BlocksDrawer } from '../forms/fields/Blocks/BlocksDrawer'
|
||||
export { SetViewActions } from '../providers/ActionsProvider/SetViewActions'
|
||||
export { Button } from '../elements/Button/index.js'
|
||||
export { Card } from '../elements/Card/index.js'
|
||||
export { Collapsible } from '../elements/Collapsible/index.js'
|
||||
export { default as CopyToClipboard } from '../elements/CopyToClipboard/index.js'
|
||||
export { DeleteMany } from '../elements/DeleteMany/index.js'
|
||||
export { DocumentControls } from '../elements/DocumentControls/index.js'
|
||||
export { useDocumentDrawer } from '../elements/DocumentDrawer/index.js'
|
||||
export { DocumentFields } from '../elements/DocumentFields/index.js'
|
||||
export { DocumentHeader } from '../elements/DocumentHeader/index.js'
|
||||
export { Drawer, DrawerToggler, formatDrawerSlug } from '../elements/Drawer/index.js'
|
||||
export { useDrawerSlug } from '../elements/Drawer/useDrawerSlug.js'
|
||||
export { EditMany } from '../elements/EditMany/index.js'
|
||||
export { ErrorPill } from '../elements/ErrorPill/index.js'
|
||||
export { default as GenerateConfirmation } from '../elements/GenerateConfirmation/index.js'
|
||||
export { Gutter } from '../elements/Gutter/index.js'
|
||||
export { HydrateClientUser } from '../elements/HydrateClientUser/index.js'
|
||||
export { ListControls } from '../elements/ListControls/index.js'
|
||||
export { useListDrawer } from '../elements/ListDrawer/index.js'
|
||||
export { ListSelection } from '../elements/ListSelection/index.js'
|
||||
export { LoadingOverlayToggle } from '../elements/Loading/index.js'
|
||||
export { FormLoadingOverlayToggle } from '../elements/Loading/index.js'
|
||||
export { LoadingOverlay } from '../elements/Loading/index.js'
|
||||
export { Pagination } from '../elements/Pagination/index.js'
|
||||
export { PerPage } from '../elements/PerPage/index.js'
|
||||
export { Pill } from '../elements/Pill/index.js'
|
||||
export { default as Popup } from '../elements/Popup/index.js'
|
||||
export * as PopupList from '../elements/Popup/PopupButtonList/index.js'
|
||||
export { PublishMany } from '../elements/PublishMany/index.js'
|
||||
export { default as ReactSelect } from '../elements/ReactSelect/index.js'
|
||||
export type { Option } from '../elements/ReactSelect/types.d.ts'
|
||||
export { RenderCustomComponent } from '../elements/RenderCustomComponent/index.js'
|
||||
export { ShimmerEffect } from '../elements/ShimmerEffect/index.js'
|
||||
export { StaggeredShimmers } from '../elements/ShimmerEffect/index.js'
|
||||
export { SortColumn } from '../elements/SortColumn/index.js'
|
||||
export { useStepNav } from '../elements/StepNav/index.js'
|
||||
export { SetStepNav } from '../elements/StepNav/SetStepNav.js'
|
||||
export type { StepNavItem } from '../elements/StepNav/types.d.ts'
|
||||
export { Table } from '../elements/Table/index.js'
|
||||
export { TableCellProvider, useTableCell } from '../elements/Table/TableCellProvider/index.js'
|
||||
export type { Column } from '../elements/Table/types.d.ts'
|
||||
export { TableColumnsProvider } from '../elements/TableColumns/index.js'
|
||||
export { default as Thumbnail } from '../elements/Thumbnail/index.js'
|
||||
export { Tooltip } from '../elements/Tooltip/index.js'
|
||||
// export { useThumbnail } from '../elements/Upload/index.js'
|
||||
export { Translation } from '../elements/Translation/index.js'
|
||||
export { UnpublishMany } from '../elements/UnpublishMany/index.js'
|
||||
export { Upload } from '../elements/Upload/index.js'
|
||||
export { BlocksDrawer } from '../forms/fields/Blocks/BlocksDrawer/index.js'
|
||||
export { SetViewActions } from '../providers/ActionsProvider/SetViewActions/index.js'
|
||||
export { Modal } from '@faceless-ui/modal'
|
||||
|
||||
@@ -1,50 +1,46 @@
|
||||
export { default as Error } from '../forms/Error'
|
||||
export { default as FieldDescription } from '../forms/FieldDescription'
|
||||
export { FieldPathProvider } from '../forms/FieldPathProvider'
|
||||
export { useFieldPath } from '../forms/FieldPathProvider'
|
||||
export { default as Form } from '../forms/Form'
|
||||
export { default as buildInitialState } from '../forms/Form'
|
||||
export { default as Error } from '../forms/Error/index.js'
|
||||
export { default as FieldDescription } from '../forms/FieldDescription/index.js'
|
||||
export { useFieldPath, FieldPathProvider } from '../forms/FieldPathProvider/index.js'
|
||||
export { default as Form } from '../forms/Form/index.js'
|
||||
export {
|
||||
useAllFormFields,
|
||||
useForm,
|
||||
useFormFields,
|
||||
useFormSubmitted,
|
||||
useWatchForm,
|
||||
} from '../forms/Form/context'
|
||||
export { useFormModified } from '../forms/Form/context'
|
||||
export { createNestedFieldPath } from '../forms/Form/createNestedFieldPath'
|
||||
export { default as reduceFieldsToValues } from '../forms/Form/reduceFieldsToValues'
|
||||
export type { Props as FormProps } from '../forms/Form/types'
|
||||
export { default as Label } from '../forms/Label'
|
||||
export { default as RenderFields } from '../forms/RenderFields'
|
||||
export { default as FormSubmit } from '../forms/Submit'
|
||||
export { default as Submit } from '../forms/Submit'
|
||||
export { fieldTypes } from '../forms/fields'
|
||||
export { default as SectionTitle } from '../forms/fields/Blocks/SectionTitle'
|
||||
export { default as Checkbox } from '../forms/fields/Checkbox'
|
||||
export { CheckboxInput } from '../forms/fields/Checkbox/Input'
|
||||
export { default as ConfirmPassword } from '../forms/fields/ConfirmPassword'
|
||||
export { default as Email } from '../forms/fields/Email'
|
||||
export { default as HiddenInput } from '../forms/fields/HiddenInput'
|
||||
export { default as Number } from '../forms/fields/Number'
|
||||
export { default as Password } from '../forms/fields/Password'
|
||||
export { default as RadioGroupInput } from '../forms/fields/RadioGroup'
|
||||
export type { OnChange } from '../forms/fields/RadioGroup/types'
|
||||
export { default as Select } from '../forms/fields/Select'
|
||||
export { default as SelectInput } from '../forms/fields/Select'
|
||||
export { default as Text } from '../forms/fields/Text'
|
||||
export { TextInput, type TextInputProps } from '../forms/fields/Text/Input'
|
||||
export type { Props as TextFieldProps } from '../forms/fields/Text/types'
|
||||
export { default as Textarea } from '../forms/fields/Textarea'
|
||||
export { type TextAreaInputProps, TextareaInput } from '../forms/fields/Textarea/Input'
|
||||
export { default as UploadField } from '../forms/fields/Upload'
|
||||
} from '../forms/Form/context.js'
|
||||
export { useFormModified } from '../forms/Form/context.js'
|
||||
export { createNestedFieldPath } from '../forms/Form/createNestedFieldPath.js'
|
||||
export { default as reduceFieldsToValues } from '../forms/Form/reduceFieldsToValues.js'
|
||||
export type { Props as FormProps } from '../forms/Form/types.d.ts'
|
||||
export { default as Label } from '../forms/Label/index.js'
|
||||
export { default as RenderFields } from '../forms/RenderFields/index.js'
|
||||
export { fieldTypes } from '../forms/fields/index.js'
|
||||
export { default as SectionTitle } from '../forms/fields/Blocks/SectionTitle/index.js'
|
||||
export { default as Checkbox } from '../forms/fields/Checkbox/index.js'
|
||||
export { CheckboxInput } from '../forms/fields/Checkbox/Input.js'
|
||||
export { default as ConfirmPassword } from '../forms/fields/ConfirmPassword/index.js'
|
||||
export { default as Email } from '../forms/fields/Email/index.js'
|
||||
export { default as HiddenInput } from '../forms/fields/HiddenInput/index.js'
|
||||
export { default as Number } from '../forms/fields/Number/index.js'
|
||||
export { default as Password } from '../forms/fields/Password/index.js'
|
||||
export { default as RadioGroupInput } from '../forms/fields/RadioGroup/index.js'
|
||||
export type { OnChange } from '../forms/fields/RadioGroup/types.d.ts'
|
||||
export { default as Select } from '../forms/fields/Select/index.js'
|
||||
export { default as SelectInput } from '../forms/fields/Select/index.js'
|
||||
export { default as Text } from '../forms/fields/Text/index.js'
|
||||
export { TextInput, type TextInputProps } from '../forms/fields/Text/Input.js'
|
||||
export type { Props as TextFieldProps } from '../forms/fields/Text/types.d.ts'
|
||||
export { default as Textarea } from '../forms/fields/Textarea/index.js'
|
||||
export { type TextAreaInputProps, TextareaInput } from '../forms/fields/Textarea/Input.js'
|
||||
export { default as UploadField } from '../forms/fields/Upload/index.js'
|
||||
|
||||
export { UploadInput, type UploadInputProps } from '../forms/fields/Upload/Input'
|
||||
export { UploadInput, type UploadInputProps } from '../forms/fields/Upload/Input.js'
|
||||
|
||||
export { fieldBaseClass } from '../forms/fields/shared'
|
||||
export { default as useField } from '../forms/useField'
|
||||
export type { FieldType, Options } from '../forms/useField/types'
|
||||
export { default as buildStateFromSchema } from '../forms/utilities/buildStateFromSchema'
|
||||
export type { BuildFormStateArgs } from '../forms/utilities/buildStateFromSchema'
|
||||
export { withCondition } from '../forms/withCondition'
|
||||
export { buildComponentMap } from '../utilities/buildComponentMap'
|
||||
export { fieldBaseClass } from '../forms/fields/shared.js'
|
||||
export { default as useField } from '../forms/useField/index.js'
|
||||
export type { FieldType, Options } from '../forms/useField/types.d.ts'
|
||||
export { default as buildStateFromSchema } from '../forms/utilities/buildStateFromSchema/index.js'
|
||||
export type { BuildFormStateArgs } from '../forms/utilities/buildStateFromSchema/index.d.ts'
|
||||
export { withCondition } from '../forms/withCondition/index.js'
|
||||
export { buildComponentMap } from '../utilities/buildComponentMap/index.js'
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
export { default as FileGraphic } from '../graphics/File'
|
||||
export { Logo } from '../graphics/Logo'
|
||||
export { default as FileGraphic } from '../graphics/File/index.js'
|
||||
export { Logo } from '../graphics/Logo/index.js'
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
export { useAdminThumbnail } from '../hooks/useAdminThumbnail'
|
||||
export { default as useDebounce } from '../hooks/useDebounce'
|
||||
export { default as useHotkey } from '../hooks/useHotkey'
|
||||
export { useIntersect } from '../hooks/useIntersect'
|
||||
export { default as usePayloadAPI } from '../hooks/usePayloadAPI'
|
||||
export { useResize } from '../hooks/useResize'
|
||||
export { default as useThumbnail } from '../hooks/useThumbnail'
|
||||
export { useAdminThumbnail } from '../hooks/useAdminThumbnail.js'
|
||||
export { default as useDebounce } from '../hooks/useDebounce.js'
|
||||
export { default as useHotkey } from '../hooks/useHotkey.js'
|
||||
export { useIntersect } from '../hooks/useIntersect.js'
|
||||
export { default as usePayloadAPI } from '../hooks/usePayloadAPI.js'
|
||||
export { useResize } from '../hooks/useResize.js'
|
||||
export { default as useThumbnail } from '../hooks/useThumbnail.js'
|
||||
export { useModal } from '@faceless-ui/modal'
|
||||
export { useWindowInfo } from '@faceless-ui/window-info'
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
export { Calendar } from '../icons/Calendar'
|
||||
export { Check } from '../icons/Check'
|
||||
export { Chevron } from '../icons/Chevron'
|
||||
export { CodeBlockIcon } from '../icons/CodeBlock'
|
||||
export { Copy } from '../icons/Copy'
|
||||
export { DragHandle } from '../icons/DragHandle'
|
||||
export { Edit } from '../icons/Edit'
|
||||
export { Line } from '../icons/Line'
|
||||
export { LinkIcon } from '../icons/Link'
|
||||
export { LogOut } from '../icons/LogOut'
|
||||
export { Menu } from '../icons/Menu'
|
||||
export { MinimizeMaximize } from '../icons/MinimizeMaximize'
|
||||
export { MoreIcon } from '../icons/More'
|
||||
export { Plus } from '../icons/Plus'
|
||||
export { Search } from '../icons/Search'
|
||||
export { Swap } from '../icons/Swap'
|
||||
export { X } from '../icons/X'
|
||||
export { Calendar } from '../icons/Calendar/index.js'
|
||||
export { Check } from '../icons/Check/index.js'
|
||||
export { Chevron } from '../icons/Chevron/index.js'
|
||||
export { CodeBlockIcon } from '../icons/CodeBlock/index.js'
|
||||
export { Copy } from '../icons/Copy/index.js'
|
||||
export { DragHandle } from '../icons/DragHandle/index.js'
|
||||
export { Edit } from '../icons/Edit/index.js'
|
||||
export { Line } from '../icons/Line/index.js'
|
||||
export { LinkIcon } from '../icons/Link/index.js'
|
||||
export { LogOut } from '../icons/LogOut/index.js'
|
||||
export { Menu } from '../icons/Menu/index.js'
|
||||
export { MinimizeMaximize } from '../icons/MinimizeMaximize/index.js'
|
||||
export { MoreIcon } from '../icons/More/index.js'
|
||||
export { Plus } from '../icons/Plus/index.js'
|
||||
export { Search } from '../icons/Search/index.js'
|
||||
export { Swap } from '../icons/Swap/index.js'
|
||||
export { X } from '../icons/X/index.js'
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
export * from './elements'
|
||||
export * from './forms'
|
||||
export * from './hooks'
|
||||
export * from './providers'
|
||||
export * from './utilities'
|
||||
export * from './templates'
|
||||
export * from './graphics'
|
||||
export * from './icons'
|
||||
export * from './types'
|
||||
export * from './elements.js'
|
||||
export * from './forms.js'
|
||||
export * from './hooks.js'
|
||||
export * from './providers.js'
|
||||
export * from './utilities.js'
|
||||
export * from './templates.js'
|
||||
export * from './graphics.js'
|
||||
export * from './icons.js'
|
||||
export * from './types.js'
|
||||
|
||||
@@ -3,9 +3,9 @@ import type { ErrorProps } from 'payload/types'
|
||||
|
||||
import React from 'react'
|
||||
|
||||
import { Tooltip } from '../../elements/Tooltip'
|
||||
import { useFieldPath } from '../FieldPathProvider'
|
||||
import { useFormFields, useFormSubmitted } from '../Form/context'
|
||||
import { Tooltip } from '../../elements/Tooltip/index.js'
|
||||
import { useFieldPath } from '../FieldPathProvider/index.js'
|
||||
import { useFormFields, useFormSubmitted } from '../Form/context.js'
|
||||
import './index.scss'
|
||||
|
||||
const baseClass = 'field-error'
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
import { getTranslation } from '@payloadcms/translations'
|
||||
import React from 'react'
|
||||
|
||||
import type { Props } from './types'
|
||||
import type { Props } from './types.d.ts'
|
||||
|
||||
import { useTranslation } from '../../providers/Translation'
|
||||
import { useTranslation } from '../../providers/Translation/index.js'
|
||||
import './index.scss'
|
||||
|
||||
const baseClass = 'field-description'
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import type { Field } from 'payload/types'
|
||||
|
||||
import { createNestedFieldPath } from './createNestedFieldPath'
|
||||
import { createNestedFieldPath } from './createNestedFieldPath.js'
|
||||
|
||||
/**
|
||||
* **Returns Map with array and block field schemas**
|
||||
|
||||
@@ -1,19 +0,0 @@
|
||||
const buildInitialState = (data) => {
|
||||
if (data) {
|
||||
return Object.entries(data).reduce(
|
||||
(state, [path, value]) => ({
|
||||
...state,
|
||||
[path]: {
|
||||
initialValue: value,
|
||||
valid: true,
|
||||
value,
|
||||
},
|
||||
}),
|
||||
{},
|
||||
)
|
||||
}
|
||||
|
||||
return undefined
|
||||
}
|
||||
|
||||
export default buildInitialState
|
||||
@@ -6,7 +6,7 @@ import {
|
||||
useContext as useFullContext,
|
||||
} from 'use-context-selector'
|
||||
|
||||
import type { Context, FormFieldsContext as FormFieldsContextType } from './types'
|
||||
import type { Context, FormFieldsContext as FormFieldsContextType } from './types.d.ts'
|
||||
|
||||
const FormContext = createContext({} as Context)
|
||||
const FormWatchContext = createContext({} as Context)
|
||||
|
||||
@@ -1,12 +1,14 @@
|
||||
import type { FormField, FormState, Row } from 'payload/types'
|
||||
|
||||
import ObjectId from 'bson-objectid'
|
||||
import ObjectIdDefault from 'bson-objectid'
|
||||
import equal from 'deep-equal'
|
||||
import { deepCopyObject } from 'payload/utilities'
|
||||
|
||||
import type { FieldAction } from './types'
|
||||
import type { FieldAction } from './types.d.ts'
|
||||
|
||||
import { flattenRows, separateRows } from './rows'
|
||||
import { flattenRows, separateRows } from './rows.js'
|
||||
|
||||
const ObjectId = ObjectIdDefault.default
|
||||
|
||||
/**
|
||||
* Reducer which modifies the form field state (all the current data of the fields in the form). When called using dispatch, it will return a new state object.
|
||||
|
||||
@@ -2,7 +2,7 @@ import type { Data, FormState } from 'payload/types'
|
||||
|
||||
import { unflatten } from 'flatley'
|
||||
|
||||
import reduceFieldsToValues from './reduceFieldsToValues'
|
||||
import reduceFieldsToValues from './reduceFieldsToValues.js'
|
||||
|
||||
const getSiblingData = (fields: FormState, path: string): Data => {
|
||||
if (path.indexOf('.') === -1) {
|
||||
|
||||
@@ -11,7 +11,7 @@ import type {
|
||||
SetSubmitted,
|
||||
Submit,
|
||||
ValidateForm,
|
||||
} from './types'
|
||||
} from './types.d.ts'
|
||||
|
||||
const submit: Submit = () => undefined
|
||||
const getSiblingData: GetSiblingData = () => undefined
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import type { FormState } from 'payload/types'
|
||||
|
||||
import { arraysHaveSameStrings } from '../../utilities/arraysHaveSameStrings'
|
||||
import { arraysHaveSameStrings } from '../../utilities/arraysHaveSameStrings.js'
|
||||
|
||||
const propsToCheck = ['passesCondition', 'valid', 'errorMessage']
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ import type { LabelProps } from 'payload/types'
|
||||
import { getTranslation } from '@payloadcms/translations'
|
||||
import React from 'react'
|
||||
|
||||
import { useTranslation } from '../../providers/Translation'
|
||||
import { useTranslation } from '../../providers/Translation/index.js'
|
||||
import './index.scss'
|
||||
|
||||
const Label: React.FC<LabelProps> = (props) => {
|
||||
|
||||
@@ -2,12 +2,12 @@
|
||||
|
||||
import * as React from 'react'
|
||||
|
||||
import { Banner } from '../../elements/Banner'
|
||||
import { useConfig } from '../../providers/Config'
|
||||
import { useLocale } from '../../providers/Locale'
|
||||
import { useTranslation } from '../../providers/Translation'
|
||||
import { useForm } from '../Form/context'
|
||||
import CheckboxInput from '../fields/Checkbox'
|
||||
import { Banner } from '../../elements/Banner/index.js'
|
||||
import { useConfig } from '../../providers/Config/index.js'
|
||||
import { useLocale } from '../../providers/Locale/index.js'
|
||||
import { useTranslation } from '../../providers/Translation/index.js'
|
||||
import { useForm } from '../Form/context.js'
|
||||
import CheckboxInput from '../fields/Checkbox/index.js'
|
||||
|
||||
type NullifyLocaleFieldProps = {
|
||||
fieldValue?: [] | null | number
|
||||
|
||||
@@ -3,9 +3,9 @@ import type { FieldPermissions } from 'payload/auth'
|
||||
|
||||
import React from 'react'
|
||||
|
||||
import { useOperation } from '../../providers/OperationProvider'
|
||||
import { FieldPathProvider, useFieldPath } from '../FieldPathProvider'
|
||||
import { ReadOnlyProvider, useReadOnly } from '../ReadOnlyProvider'
|
||||
import { useOperation } from '../../providers/OperationProvider/index.js'
|
||||
import { FieldPathProvider, useFieldPath } from '../FieldPathProvider/index.js'
|
||||
import { ReadOnlyProvider, useReadOnly } from '../ReadOnlyProvider/index.js'
|
||||
|
||||
export const RenderField: React.FC<{
|
||||
Field: React.ReactNode
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
'use client'
|
||||
import React from 'react'
|
||||
|
||||
import type { Props } from './types'
|
||||
import type { Props } from './types.d.ts'
|
||||
|
||||
import { useIntersect } from '../../hooks/useIntersect'
|
||||
import { useTranslation } from '../../providers/Translation'
|
||||
import { RenderField } from './RenderField'
|
||||
import { useIntersect } from '../../hooks/useIntersect.js'
|
||||
import { useTranslation } from '../../providers/Translation/index.js'
|
||||
import { RenderField } from './RenderField.js'
|
||||
import './index.scss'
|
||||
|
||||
const baseClass = 'render-fields'
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import type { Operation } from 'payload/types'
|
||||
|
||||
import type { FieldMap } from '../../utilities/buildComponentMap/types'
|
||||
import type { FieldMap } from '../../utilities/buildComponentMap/types.d.ts'
|
||||
|
||||
export type Props = {
|
||||
className?: string
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import { getTranslation } from '@payloadcms/translations'
|
||||
import React from 'react'
|
||||
|
||||
import type { Props } from './types'
|
||||
import type { Props } from './types.d.ts'
|
||||
|
||||
import getDataByPath from '../Form/getDataByPath'
|
||||
import getSiblingData from '../Form/getSiblingData'
|
||||
import { isComponent } from './types'
|
||||
import getDataByPath from '../Form/getDataByPath.js'
|
||||
import getSiblingData from '../Form/getSiblingData.js'
|
||||
import { isComponent } from './types.js'
|
||||
|
||||
const baseClass = 'row-label'
|
||||
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
'use client'
|
||||
import React, { forwardRef } from 'react'
|
||||
|
||||
import type { Props } from '../../elements/Button/types'
|
||||
import type { Props } from '../../elements/Button/types.d.ts'
|
||||
|
||||
import { Button } from '../../elements/Button'
|
||||
import { useForm, useFormProcessing } from '../Form/context'
|
||||
import { Button } from '../../elements/Button/index.js'
|
||||
import { useForm, useFormProcessing } from '../Form/context.js'
|
||||
import './index.scss'
|
||||
|
||||
const baseClass = 'form-submit'
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { FieldMap } from '../../utilities/buildComponentMap/types'
|
||||
import type { FieldMap } from '../../utilities/buildComponentMap/types.d.ts'
|
||||
|
||||
export const buildPathSegments = (parentPath: string, fieldMap: FieldMap): string[] => {
|
||||
const pathNames = fieldMap.reduce((acc, subField) => {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import type { Field, FormState } from 'payload/types'
|
||||
|
||||
// import { buildPathSegments } from './buildPathSegments'
|
||||
import { getFieldStateFromPaths } from './getFieldStateFromPaths'
|
||||
import { getFieldStateFromPaths } from './getFieldStateFromPaths.js'
|
||||
|
||||
export const getNestedFieldState = ({
|
||||
fieldSchema,
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
'use client'
|
||||
import type React from 'react'
|
||||
|
||||
import type { FieldMap } from '../../utilities/buildComponentMap/types'
|
||||
import type { FieldMap } from '../../utilities/buildComponentMap/types.d.ts'
|
||||
|
||||
import useThrottledEffect from '../../hooks/useThrottledEffect'
|
||||
import { useAllFormFields, useFormSubmitted } from '../Form/context'
|
||||
import { buildPathSegments } from './buildPathSegments'
|
||||
import { getFieldStateFromPaths } from './getFieldStateFromPaths'
|
||||
import useThrottledEffect from '../../hooks/useThrottledEffect.js'
|
||||
import { useAllFormFields, useFormSubmitted } from '../Form/context.js'
|
||||
import { buildPathSegments } from './buildPathSegments.js'
|
||||
import { getFieldStateFromPaths } from './getFieldStateFromPaths.js'
|
||||
|
||||
type TrackSubSchemaErrorCountProps = {
|
||||
fieldMap?: FieldMap
|
||||
|
||||
@@ -4,17 +4,17 @@ import type { ArrayField, Operation, Row, RowLabel as RowLabelType } from 'paylo
|
||||
import { getTranslation } from '@payloadcms/translations'
|
||||
import React from 'react'
|
||||
|
||||
import type { UseDraggableSortableReturn } from '../../../elements/DraggableSortable/useDraggableSortable/types'
|
||||
import type { FieldMap } from '../../../utilities/buildComponentMap/types'
|
||||
import type { UseDraggableSortableReturn } from '../../../elements/DraggableSortable/useDraggableSortable/types.d.ts'
|
||||
import type { FieldMap } from '../../../utilities/buildComponentMap/types.d.ts'
|
||||
|
||||
import { ArrayAction } from '../../../elements/ArrayAction'
|
||||
import { Collapsible } from '../../../elements/Collapsible'
|
||||
import { ErrorPill } from '../../../elements/ErrorPill'
|
||||
import { useTranslation } from '../../../providers/Translation'
|
||||
import { FieldPathProvider } from '../../FieldPathProvider'
|
||||
import { useFormSubmitted } from '../../Form/context'
|
||||
import RenderFields from '../../RenderFields'
|
||||
import HiddenInput from '../HiddenInput'
|
||||
import { ArrayAction } from '../../../elements/ArrayAction/index.js'
|
||||
import { Collapsible } from '../../../elements/Collapsible/index.js'
|
||||
import { ErrorPill } from '../../../elements/ErrorPill/index.js'
|
||||
import { useTranslation } from '../../../providers/Translation/index.js'
|
||||
import { FieldPathProvider } from '../../FieldPathProvider/index.js'
|
||||
import { useFormSubmitted } from '../../Form/context.js'
|
||||
import RenderFields from '../../RenderFields/index.js'
|
||||
import HiddenInput from '../HiddenInput/index.js'
|
||||
import './index.scss'
|
||||
|
||||
const baseClass = 'array-field'
|
||||
|
||||
@@ -2,24 +2,24 @@
|
||||
import { getTranslation } from '@payloadcms/translations'
|
||||
import React, { useCallback } from 'react'
|
||||
|
||||
import type { Props } from './types'
|
||||
import type { Props } from './types.d.ts'
|
||||
|
||||
import Banner from '../../../elements/Banner'
|
||||
import { Button } from '../../../elements/Button'
|
||||
import DraggableSortable from '../../../elements/DraggableSortable'
|
||||
import DraggableSortableItem from '../../../elements/DraggableSortable/DraggableSortableItem'
|
||||
import { ErrorPill } from '../../../elements/ErrorPill'
|
||||
import { useConfig } from '../../../providers/Config'
|
||||
import { useDocumentInfo } from '../../../providers/DocumentInfo'
|
||||
import { useLocale } from '../../../providers/Locale'
|
||||
import { useTranslation } from '../../../providers/Translation'
|
||||
import { scrollToID } from '../../../utilities/scrollToID'
|
||||
import { useForm, useFormSubmitted } from '../../Form/context'
|
||||
import LabelComp from '../../Label'
|
||||
import { NullifyLocaleField } from '../../NullifyField'
|
||||
import useField from '../../useField'
|
||||
import { fieldBaseClass } from '../shared'
|
||||
import { ArrayRow } from './ArrayRow'
|
||||
import Banner from '../../../elements/Banner/index.js'
|
||||
import { Button } from '../../../elements/Button/index.js'
|
||||
import DraggableSortable from '../../../elements/DraggableSortable/index.js'
|
||||
import DraggableSortableItem from '../../../elements/DraggableSortable/DraggableSortableItem/index.js'
|
||||
import { ErrorPill } from '../../../elements/ErrorPill/index.js'
|
||||
import { useConfig } from '../../../providers/Config/index.js'
|
||||
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 { useForm, useFormSubmitted } from '../../Form/context.js'
|
||||
import LabelComp from '../../Label/index.js'
|
||||
import { NullifyLocaleField } from '../../NullifyField/index.js'
|
||||
import useField from '../../useField/index.js'
|
||||
import { fieldBaseClass } from '../shared.js'
|
||||
import { ArrayRow } from './ArrayRow.js'
|
||||
import './index.scss'
|
||||
|
||||
const baseClass = 'array-field'
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import type { FieldPermissions } from 'payload/auth'
|
||||
|
||||
import type { FormFieldBase } from '../shared'
|
||||
import type { FormFieldBase } from '../shared.d.ts'
|
||||
|
||||
export type Props = FormFieldBase & {
|
||||
forceRender?: boolean
|
||||
|
||||
@@ -5,19 +5,19 @@ import type { Labels, Row } from 'payload/types'
|
||||
import { getTranslation } from '@payloadcms/translations'
|
||||
import React from 'react'
|
||||
|
||||
import type { UseDraggableSortableReturn } from '../../../elements/DraggableSortable/useDraggableSortable/types'
|
||||
import type { ReducedBlock } from '../../../utilities/buildComponentMap/types'
|
||||
import type { UseDraggableSortableReturn } from '../../../elements/DraggableSortable/useDraggableSortable/types.d.ts'
|
||||
import type { ReducedBlock } from '../../../utilities/buildComponentMap/types.d.ts'
|
||||
|
||||
import { Collapsible } from '../../../elements/Collapsible'
|
||||
import { ErrorPill } from '../../../elements/ErrorPill'
|
||||
import Pill from '../../../elements/Pill'
|
||||
import { useTranslation } from '../../../providers/Translation'
|
||||
import { FieldPathProvider } from '../../FieldPathProvider'
|
||||
import { useFormSubmitted } from '../../Form/context'
|
||||
import RenderFields from '../../RenderFields'
|
||||
import HiddenInput from '../HiddenInput'
|
||||
import { RowActions } from './RowActions'
|
||||
import SectionTitle from './SectionTitle'
|
||||
import { Collapsible } from '../../../elements/Collapsible/index.js'
|
||||
import { ErrorPill } from '../../../elements/ErrorPill/index.js'
|
||||
import Pill from '../../../elements/Pill/index.js'
|
||||
import { useTranslation } from '../../../providers/Translation/index.js'
|
||||
import { FieldPathProvider } from '../../FieldPathProvider/index.js'
|
||||
import { useFormSubmitted } from '../../Form/context.js'
|
||||
import RenderFields from '../../RenderFields/index.js'
|
||||
import HiddenInput from '../HiddenInput/index.js'
|
||||
import { RowActions } from './RowActions.js'
|
||||
import SectionTitle from './SectionTitle/index.js'
|
||||
|
||||
const baseClass = 'blocks-field'
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import React from 'react'
|
||||
|
||||
import SearchIcon from '../../../../../graphics/Search'
|
||||
import { useTranslation } from '../../../../../providers/Translation'
|
||||
import SearchIcon from '../../../../../graphics/Search/index.js'
|
||||
import { useTranslation } from '../../../../../providers/Translation/index.js'
|
||||
import './index.scss'
|
||||
|
||||
const baseClass = 'block-search'
|
||||
|
||||
@@ -5,14 +5,14 @@ import { useModal } from '@faceless-ui/modal'
|
||||
import { getTranslation } from '@payloadcms/translations'
|
||||
import React, { useEffect, useState } from 'react'
|
||||
|
||||
import type { ReducedBlock } from '../../../../utilities/buildComponentMap/types'
|
||||
import type { Props } from './types'
|
||||
import type { ReducedBlock } from '../../../../utilities/buildComponentMap/types.d.ts'
|
||||
import type { Props } from './types.d.ts'
|
||||
|
||||
import { Drawer } from '../../../../elements/Drawer'
|
||||
import { ThumbnailCard } from '../../../../elements/ThumbnailCard'
|
||||
import DefaultBlockImage from '../../../../graphics/DefaultBlockImage'
|
||||
import { useTranslation } from '../../../../providers/Translation'
|
||||
import BlockSearch from './BlockSearch'
|
||||
import { Drawer } from '../../../../elements/Drawer/index.js'
|
||||
import { ThumbnailCard } from '../../../../elements/ThumbnailCard/index.js'
|
||||
import DefaultBlockImage from '../../../../graphics/DefaultBlockImage/index.js'
|
||||
import { useTranslation } from '../../../../providers/Translation/index.js'
|
||||
import BlockSearch from './BlockSearch/index.js'
|
||||
import './index.scss'
|
||||
|
||||
const baseClass = 'blocks-drawer'
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import type { Labels } from 'payload/types'
|
||||
|
||||
import type { ReducedBlock } from '../../../../utilities/buildComponentMap/types'
|
||||
import type { ReducedBlock } from '../../../../utilities/buildComponentMap/types.d.ts'
|
||||
|
||||
export type Props = {
|
||||
addRow: (index: number, blockType?: string) => void
|
||||
|
||||
@@ -4,11 +4,11 @@ import type { Labels } from 'payload/types'
|
||||
import { useModal } from '@faceless-ui/modal'
|
||||
import React from 'react'
|
||||
|
||||
import type { FieldMap, ReducedBlock } from '../../../utilities/buildComponentMap/types'
|
||||
import type { FieldMap, ReducedBlock } from '../../../utilities/buildComponentMap/types.d.ts'
|
||||
|
||||
import { ArrayAction } from '../../../elements/ArrayAction'
|
||||
import { useDrawerSlug } from '../../../elements/Drawer/useDrawerSlug'
|
||||
import { BlocksDrawer } from './BlocksDrawer'
|
||||
import { ArrayAction } from '../../../elements/ArrayAction/index.js'
|
||||
import { useDrawerSlug } from '../../../elements/Drawer/useDrawerSlug.js'
|
||||
import { BlocksDrawer } from './BlocksDrawer/index.js'
|
||||
|
||||
export const RowActions: React.FC<{
|
||||
addRow: (rowIndex: number, blockType: string) => void
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import React from 'react'
|
||||
|
||||
import type { Props } from './types'
|
||||
import type { Props } from './types.d.ts'
|
||||
|
||||
import { useTranslation } from '../../../../providers/Translation'
|
||||
import useField from '../../../useField'
|
||||
import { useTranslation } from '../../../../providers/Translation/index.js'
|
||||
import useField from '../../../useField/index.js'
|
||||
import './index.scss'
|
||||
|
||||
const baseClass = 'section-title'
|
||||
|
||||
@@ -2,27 +2,27 @@
|
||||
import { getTranslation } from '@payloadcms/translations'
|
||||
import React, { Fragment, useCallback } from 'react'
|
||||
|
||||
import type { Props } from './types'
|
||||
import type { Props } from './types.d.ts'
|
||||
|
||||
import Banner from '../../../elements/Banner'
|
||||
import { Button } from '../../../elements/Button'
|
||||
import DraggableSortable from '../../../elements/DraggableSortable'
|
||||
import DraggableSortableItem from '../../../elements/DraggableSortable/DraggableSortableItem'
|
||||
import { DrawerToggler } from '../../../elements/Drawer'
|
||||
import { useDrawerSlug } from '../../../elements/Drawer/useDrawerSlug'
|
||||
import { ErrorPill } from '../../../elements/ErrorPill'
|
||||
import { useConfig } from '../../../providers/Config'
|
||||
import { useDocumentInfo } from '../../../providers/DocumentInfo'
|
||||
import { useLocale } from '../../../providers/Locale'
|
||||
import { useTranslation } from '../../../providers/Translation'
|
||||
import { scrollToID } from '../../../utilities/scrollToID'
|
||||
import { useForm, useFormSubmitted } from '../../Form/context'
|
||||
import LabelComp from '../../Label'
|
||||
import { NullifyLocaleField } from '../../NullifyField'
|
||||
import useField from '../../useField'
|
||||
import { fieldBaseClass } from '../shared'
|
||||
import { BlockRow } from './BlockRow'
|
||||
import { BlocksDrawer } from './BlocksDrawer'
|
||||
import Banner from '../../../elements/Banner/index.js'
|
||||
import { Button } from '../../../elements/Button/index.js'
|
||||
import DraggableSortable from '../../../elements/DraggableSortable/index.js'
|
||||
import DraggableSortableItem from '../../../elements/DraggableSortable/DraggableSortableItem/index.js'
|
||||
import { DrawerToggler } from '../../../elements/Drawer/index.js'
|
||||
import { useDrawerSlug } from '../../../elements/Drawer/useDrawerSlug.js'
|
||||
import { ErrorPill } from '../../../elements/ErrorPill/index.js'
|
||||
import { useConfig } from '../../../providers/Config/index.js'
|
||||
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 { useForm, useFormSubmitted } from '../../Form/context.js'
|
||||
import LabelComp from '../../Label/index.js'
|
||||
import { NullifyLocaleField } from '../../NullifyField/index.js'
|
||||
import useField from '../../useField/index.js'
|
||||
import { fieldBaseClass } from '../shared.js'
|
||||
import { BlockRow } from './BlockRow.js'
|
||||
import { BlocksDrawer } from './BlocksDrawer/index.js'
|
||||
import './index.scss'
|
||||
|
||||
const baseClass = 'blocks-field'
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import type { FieldPermissions } from 'payload/auth'
|
||||
|
||||
import type { FormFieldBase } from '../shared'
|
||||
import type { FormFieldBase } from '../shared.js'
|
||||
|
||||
export type Props = FormFieldBase & {
|
||||
forceRender?: boolean
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
'use client'
|
||||
import React from 'react'
|
||||
|
||||
import { Check } from '../../../icons/Check'
|
||||
import { Line } from '../../../icons/Line'
|
||||
import { Check } from '../../../icons/Check/index.js'
|
||||
import { Line } from '../../../icons/Line/index.js'
|
||||
|
||||
type Props = {
|
||||
AfterInput?: React.ReactNode
|
||||
|
||||
@@ -3,14 +3,14 @@ import type { ClientValidate } from 'payload/types'
|
||||
|
||||
import React, { useCallback } from 'react'
|
||||
|
||||
import type { Props } from './types'
|
||||
import type { Props } from './types.d.ts'
|
||||
|
||||
import { useForm } from '../../Form/context'
|
||||
import LabelComp from '../../Label'
|
||||
import useField from '../../useField'
|
||||
import { withCondition } from '../../withCondition'
|
||||
import { fieldBaseClass } from '../shared'
|
||||
import { CheckboxInput } from './Input'
|
||||
import { useForm } from '../../Form/context.js'
|
||||
import LabelComp from '../../Label/index.js'
|
||||
import useField from '../../useField/index.js'
|
||||
import { withCondition } from '../../withCondition/index.js'
|
||||
import { fieldBaseClass } from '../shared.js'
|
||||
import { CheckboxInput } from './Input.js'
|
||||
import './index.scss'
|
||||
|
||||
const baseClass = 'checkbox'
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { FormFieldBase } from '../shared'
|
||||
import type { FormFieldBase } from '../shared.js'
|
||||
|
||||
export type Props = FormFieldBase & {
|
||||
checked?: boolean
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
'use client'
|
||||
import React, { useCallback } from 'react'
|
||||
|
||||
import type { Props } from './types'
|
||||
import type { Props } from './types.d.ts'
|
||||
|
||||
import { CodeEditor } from '../../../elements/CodeEditor'
|
||||
import LabelComp from '../../Label'
|
||||
import useField from '../../useField'
|
||||
import { withCondition } from '../../withCondition'
|
||||
import { fieldBaseClass } from '../shared'
|
||||
import { CodeEditor } from '../../../elements/CodeEditor/index.js'
|
||||
import LabelComp from '../../Label/index.js'
|
||||
import useField from '../../useField/index.js'
|
||||
import { withCondition } from '../../withCondition/index.js'
|
||||
import { fieldBaseClass } from '../shared.js'
|
||||
import './index.scss'
|
||||
|
||||
const prismToMonacoLanguageMap = {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { FormFieldBase } from '../shared'
|
||||
import type { FormFieldBase } from '../shared.d.ts'
|
||||
|
||||
export type Props = FormFieldBase & {
|
||||
name?: string
|
||||
|
||||
@@ -3,19 +3,19 @@ import type { DocumentPreferences } from 'payload/types'
|
||||
|
||||
import React, { Fragment, useCallback, useEffect, useState } from 'react'
|
||||
|
||||
import type { Props } from './types'
|
||||
import type { Props } from './types.d.ts'
|
||||
|
||||
import { Collapsible } from '../../../elements/Collapsible'
|
||||
import { ErrorPill } from '../../../elements/ErrorPill'
|
||||
import { useDocumentInfo } from '../../../providers/DocumentInfo'
|
||||
import { usePreferences } from '../../../providers/Preferences'
|
||||
import { useTranslation } from '../../../providers/Translation'
|
||||
import { useFieldPath } from '../../FieldPathProvider'
|
||||
import LabelComp from '../../Label'
|
||||
import RenderFields from '../../RenderFields'
|
||||
import { WatchChildErrors } from '../../WatchChildErrors'
|
||||
import { withCondition } from '../../withCondition'
|
||||
import { fieldBaseClass } from '../shared'
|
||||
import { Collapsible } from '../../../elements/Collapsible/index.js'
|
||||
import { ErrorPill } from '../../../elements/ErrorPill/index.js'
|
||||
import { useDocumentInfo } from '../../../providers/DocumentInfo/index.js'
|
||||
import { usePreferences } from '../../../providers/Preferences/index.js'
|
||||
import { useTranslation } from '../../../providers/Translation/index.js'
|
||||
import { useFieldPath } from '../../FieldPathProvider/index.js'
|
||||
import LabelComp from '../../Label/index.js'
|
||||
import RenderFields from '../../RenderFields/index.js'
|
||||
import { WatchChildErrors } from '../../WatchChildErrors/index.js'
|
||||
import { withCondition } from '../../withCondition/index.js'
|
||||
import { fieldBaseClass } from '../shared.js'
|
||||
import './index.scss'
|
||||
|
||||
const baseClass = 'collapsible-field'
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import type { FieldPermissions } from 'payload/auth'
|
||||
import type { FieldTypes } from 'payload/config'
|
||||
|
||||
import type { FormFieldBase } from '../shared'
|
||||
import type { FormFieldBase } from '../shared.js'
|
||||
|
||||
export type Props = FormFieldBase & {
|
||||
fieldTypes: FieldTypes
|
||||
|
||||
@@ -3,14 +3,14 @@ import type { FormField } from 'payload/types'
|
||||
|
||||
import React, { useCallback } from 'react'
|
||||
|
||||
import type { Props } from './types'
|
||||
import type { Props } from './types.d.ts'
|
||||
|
||||
import { useTranslation } from '../../../providers/Translation'
|
||||
import Error from '../../Error'
|
||||
import { useFormFields } from '../../Form/context'
|
||||
import Label from '../../Label'
|
||||
import useField from '../../useField'
|
||||
import { fieldBaseClass } from '../shared'
|
||||
import { useTranslation } from '../../../providers/Translation/index.js'
|
||||
import Error from '../../Error/index.js'
|
||||
import { useFormFields } from '../../Form/context.js'
|
||||
import Label from '../../Label/index.js'
|
||||
import useField from '../../useField/index.js'
|
||||
import { fieldBaseClass } from '../shared.js'
|
||||
import './index.scss'
|
||||
|
||||
const ConfirmPassword: React.FC<Props> = (props) => {
|
||||
|
||||
@@ -4,12 +4,12 @@ import type { ClientValidate } from 'payload/types'
|
||||
import { getTranslation } from '@payloadcms/translations'
|
||||
import React, { useCallback } from 'react'
|
||||
|
||||
import type { Props } from './types'
|
||||
import type { Props } from './types.d.ts'
|
||||
|
||||
import DatePickerField from '../../../elements/DatePicker'
|
||||
import { useTranslation } from '../../../providers/Translation'
|
||||
import useField from '../../useField'
|
||||
import { fieldBaseClass } from '../shared'
|
||||
import DatePickerField from '../../../elements/DatePicker/index.js'
|
||||
import { useTranslation } from '../../../providers/Translation/index.js'
|
||||
import useField from '../../useField/index.js'
|
||||
import { fieldBaseClass } from '../shared.js'
|
||||
import './index.scss'
|
||||
|
||||
const baseClass = 'date-time-field'
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { FormFieldBase } from '../shared'
|
||||
import type { FormFieldBase } from '../shared.js'
|
||||
|
||||
export type Props = FormFieldBase & {
|
||||
name?: string
|
||||
|
||||
@@ -4,13 +4,13 @@ import type { ClientValidate } from 'payload/types'
|
||||
import { getTranslation } from '@payloadcms/translations'
|
||||
import React, { useCallback } from 'react'
|
||||
|
||||
import type { Props } from './types'
|
||||
import type { Props } from './types.d.ts'
|
||||
|
||||
import { useTranslation } from '../../../providers/Translation'
|
||||
import LabelComp from '../../Label'
|
||||
import useField from '../../useField'
|
||||
import { withCondition } from '../../withCondition'
|
||||
import { fieldBaseClass } from '../shared'
|
||||
import { useTranslation } from '../../../providers/Translation/index.js'
|
||||
import LabelComp from '../../Label/index.js'
|
||||
import useField from '../../useField/index.js'
|
||||
import { withCondition } from '../../withCondition/index.js'
|
||||
import { fieldBaseClass } from '../shared.js'
|
||||
import './index.scss'
|
||||
|
||||
export const Email: React.FC<Props> = (props) => {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { FormFieldBase } from '../shared'
|
||||
import type { FormFieldBase } from '../shared.js'
|
||||
|
||||
export type Props = FormFieldBase & {
|
||||
autoComplete?: string
|
||||
|
||||
@@ -1,21 +1,21 @@
|
||||
'use client'
|
||||
import React, { Fragment } from 'react'
|
||||
|
||||
import type { Props } from './types'
|
||||
import type { Props } from './types.d.ts'
|
||||
|
||||
import { useCollapsible } from '../../../elements/Collapsible/provider'
|
||||
import { ErrorPill } from '../../../elements/ErrorPill'
|
||||
import { useTranslation } from '../../../providers/Translation'
|
||||
import { FieldPathProvider, useFieldPath } from '../../FieldPathProvider'
|
||||
import LabelComp from '../../Label'
|
||||
import RenderFields from '../../RenderFields'
|
||||
import { WatchChildErrors } from '../../WatchChildErrors'
|
||||
import { withCondition } from '../../withCondition'
|
||||
import { useRow } from '../Row/provider'
|
||||
import { useTabs } from '../Tabs/provider'
|
||||
import { fieldBaseClass } from '../shared'
|
||||
import { useCollapsible } from '../../../elements/Collapsible/provider.js'
|
||||
import { ErrorPill } from '../../../elements/ErrorPill/index.js'
|
||||
import { useTranslation } from '../../../providers/Translation/index.js'
|
||||
import { FieldPathProvider, useFieldPath } from '../../FieldPathProvider/index.js'
|
||||
import LabelComp from '../../Label/index.js'
|
||||
import RenderFields from '../../RenderFields/index.js'
|
||||
import { WatchChildErrors } from '../../WatchChildErrors/index.js'
|
||||
import { withCondition } from '../../withCondition/index.js'
|
||||
import { useRow } from '../Row/provider.js'
|
||||
import { useTabs } from '../Tabs/provider.js'
|
||||
import { fieldBaseClass } from '../shared.js'
|
||||
import './index.scss'
|
||||
import { GroupProvider, useGroup } from './provider'
|
||||
import { GroupProvider, useGroup } from './provider.js'
|
||||
|
||||
const baseClass = 'group-field'
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import type { FieldPermissions } from 'payload/auth'
|
||||
|
||||
import type { FormFieldBase } from '../shared'
|
||||
import type { FormFieldBase } from '../shared.d.ts'
|
||||
|
||||
export type Props = FormFieldBase & {
|
||||
forceRender?: boolean
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
'use client'
|
||||
import React, { useEffect } from 'react'
|
||||
|
||||
import type { Props } from './types'
|
||||
import type { Props } from './types.d.ts'
|
||||
|
||||
import useField from '../../useField'
|
||||
import { withCondition } from '../../withCondition'
|
||||
import useField from '../../useField/index.js'
|
||||
import { withCondition } from '../../withCondition/index.js'
|
||||
|
||||
/**
|
||||
* This is mainly used to save a value on the form that is not visible to the user.
|
||||
|
||||
@@ -3,13 +3,13 @@ import type { ClientValidate } from 'payload/types'
|
||||
|
||||
import React, { useCallback, useEffect, useState } from 'react'
|
||||
|
||||
import type { Props } from './types'
|
||||
import type { Props } from './types.d.ts'
|
||||
|
||||
import { CodeEditor } from '../../../elements/CodeEditor'
|
||||
import LabelComp from '../../Label'
|
||||
import useField from '../../useField'
|
||||
import { withCondition } from '../../withCondition'
|
||||
import { fieldBaseClass } from '../shared'
|
||||
import { CodeEditor } from '../../../elements/CodeEditor/index.js'
|
||||
import LabelComp from '../../Label/index.js'
|
||||
import useField from '../../useField/index.js'
|
||||
import { withCondition } from '../../withCondition/index.js'
|
||||
import { fieldBaseClass } from '../shared.js'
|
||||
import './index.scss'
|
||||
|
||||
const baseClass = 'json-field'
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { FormFieldBase } from '../shared'
|
||||
import type { FormFieldBase } from '../shared.js'
|
||||
|
||||
export type Props = FormFieldBase & {
|
||||
name?: string
|
||||
|
||||
@@ -3,15 +3,15 @@ import { getTranslation } from '@payloadcms/translations'
|
||||
import { isNumber } from 'payload/utilities'
|
||||
import React, { useCallback, useEffect, useState } from 'react'
|
||||
|
||||
import type { Option } from '../../../elements/ReactSelect/types'
|
||||
import type { Props } from './types'
|
||||
import type { Option } from '../../../elements/ReactSelect/types.d.ts'
|
||||
import type { Props } from './types.d.ts'
|
||||
|
||||
import ReactSelect from '../../../elements/ReactSelect'
|
||||
import { useTranslation } from '../../../providers/Translation'
|
||||
import LabelComp from '../../Label'
|
||||
import useField from '../../useField'
|
||||
import { withCondition } from '../../withCondition'
|
||||
import { fieldBaseClass } from '../shared'
|
||||
import ReactSelect from '../../../elements/ReactSelect/index.js'
|
||||
import { useTranslation } from '../../../providers/Translation/index.js'
|
||||
import LabelComp from '../../Label/index.js'
|
||||
import useField from '../../useField/index.js'
|
||||
import { withCondition } from '../../withCondition/index.js'
|
||||
import { fieldBaseClass } from '../shared.js'
|
||||
import './index.scss'
|
||||
|
||||
const NumberField: React.FC<Props> = (props) => {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { FormFieldBase } from '../shared'
|
||||
import type { FormFieldBase } from '../shared.js'
|
||||
|
||||
export type Props = FormFieldBase & {
|
||||
name?: string
|
||||
|
||||
@@ -3,12 +3,12 @@ import type { ClientValidate } from 'payload/types'
|
||||
|
||||
import React, { useCallback } from 'react'
|
||||
|
||||
import type { Props } from './types'
|
||||
import type { Props } from './types.d.ts'
|
||||
|
||||
import LabelComp from '../../Label'
|
||||
import useField from '../../useField'
|
||||
import { withCondition } from '../../withCondition'
|
||||
import { fieldBaseClass } from '../shared'
|
||||
import LabelComp from '../../Label/index.js'
|
||||
import useField from '../../useField/index.js'
|
||||
import { withCondition } from '../../withCondition/index.js'
|
||||
import { fieldBaseClass } from '../shared.js'
|
||||
import './index.scss'
|
||||
|
||||
export const Password: React.FC<Props> = (props) => {
|
||||
|
||||
@@ -2,7 +2,7 @@ import type { Validate } from 'payload/types'
|
||||
import type { Description } from 'payload/types'
|
||||
import type React from 'react'
|
||||
|
||||
import type { FormFieldBase } from '../shared'
|
||||
import type { FormFieldBase } from '../shared.d.ts'
|
||||
|
||||
export type Props = FormFieldBase & {
|
||||
autoComplete?: string
|
||||
|
||||
@@ -4,13 +4,13 @@ import type { ClientValidate } from 'payload/types'
|
||||
import { getTranslation } from '@payloadcms/translations'
|
||||
import React, { useCallback } from 'react'
|
||||
|
||||
import type { Props } from './types'
|
||||
import type { Props } from './types.d.ts'
|
||||
|
||||
import { useTranslation } from '../../../providers/Translation'
|
||||
import LabelComp from '../../Label'
|
||||
import useField from '../../useField'
|
||||
import { withCondition } from '../../withCondition'
|
||||
import { fieldBaseClass } from '../shared'
|
||||
import { useTranslation } from '../../../providers/Translation/index.js'
|
||||
import LabelComp from '../../Label/index.js'
|
||||
import useField from '../../useField/index.js'
|
||||
import { withCondition } from '../../withCondition/index.js'
|
||||
import { fieldBaseClass } from '../shared.js'
|
||||
import './index.scss'
|
||||
|
||||
const baseClass = 'point'
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { FormFieldBase } from '../shared'
|
||||
import type { FormFieldBase } from '../shared.d.ts'
|
||||
|
||||
export type Props = FormFieldBase & {
|
||||
name?: string
|
||||
|
||||
@@ -4,9 +4,9 @@ import type { OptionObject } from 'payload/types'
|
||||
import { getTranslation } from '@payloadcms/translations'
|
||||
import React from 'react'
|
||||
|
||||
import type { OnChange } from '../types'
|
||||
import type { OnChange } from '../types.d.ts'
|
||||
|
||||
import { useTranslation } from '../../../../providers/Translation'
|
||||
import { useTranslation } from '../../../../providers/Translation/index.js'
|
||||
import './index.scss'
|
||||
|
||||
const baseClass = 'radio-input'
|
||||
|
||||
@@ -2,14 +2,14 @@
|
||||
import { optionIsObject } from 'payload/types'
|
||||
import React, { useCallback } from 'react'
|
||||
|
||||
import type { Props } from './types'
|
||||
import type { Props } from './types.d.ts'
|
||||
|
||||
import { useForm } from '../../Form/context'
|
||||
import LabelComp from '../../Label'
|
||||
import useField from '../../useField'
|
||||
import { withCondition } from '../../withCondition'
|
||||
import { fieldBaseClass } from '../shared'
|
||||
import { Radio } from './Radio'
|
||||
import { useForm } from '../../Form/context.js'
|
||||
import LabelComp from '../../Label/index.js'
|
||||
import useField from '../../useField/index.js'
|
||||
import { withCondition } from '../../withCondition/index.js'
|
||||
import { fieldBaseClass } from '../shared.js'
|
||||
import { Radio } from './Radio/index.js'
|
||||
import './index.scss'
|
||||
|
||||
const baseClass = 'radio-group'
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { FormFieldBase } from '../shared'
|
||||
import type { FormFieldBase } from '../shared.d.ts'
|
||||
|
||||
export type Props = FormFieldBase & {
|
||||
name?: string
|
||||
|
||||
@@ -4,21 +4,21 @@ import type { SanitizedCollectionConfig } from 'payload/types'
|
||||
import { getTranslation } from '@payloadcms/translations'
|
||||
import React, { Fragment, useCallback, useEffect, useState } from 'react'
|
||||
|
||||
import type { DocumentInfoContext } from '../../../../providers/DocumentInfo/types'
|
||||
import type { Value } from '../types'
|
||||
import type { Props } from './types'
|
||||
import type { DocumentInfoContext } from '../../../../providers/DocumentInfo/types.d.ts'
|
||||
import type { Value } from '../types.d.ts'
|
||||
import type { Props } from './types.d.ts'
|
||||
|
||||
import { Button } from '../../../../elements/Button'
|
||||
import { useDocumentDrawer } from '../../../../elements/DocumentDrawer'
|
||||
import Popup from '../../../../elements/Popup'
|
||||
import * as PopupList from '../../../../elements/Popup/PopupButtonList'
|
||||
import { Tooltip } from '../../../../elements/Tooltip'
|
||||
import { Plus } from '../../../../icons/Plus'
|
||||
import { useAuth } from '../../../../providers/Auth'
|
||||
import { useConfig } from '../../../../providers/Config'
|
||||
import { useTranslation } from '../../../../providers/Translation'
|
||||
import { Button } from '../../../../elements/Button/index.js'
|
||||
import { useDocumentDrawer } from '../../../../elements/DocumentDrawer/index.js'
|
||||
import Popup from '../../../../elements/Popup/index.js'
|
||||
import * as PopupList from '../../../../elements/Popup/PopupButtonList/index.js'
|
||||
import { Tooltip } from '../../../../elements/Tooltip/index.js'
|
||||
import { Plus } from '../../../../icons/Plus/index.js'
|
||||
import { useAuth } from '../../../../providers/Auth/index.js'
|
||||
import { useConfig } from '../../../../providers/Config/index.js'
|
||||
import { useTranslation } from '../../../../providers/Translation/index.js'
|
||||
import './index.scss'
|
||||
import { useRelatedCollections } from './useRelatedCollections'
|
||||
import { useRelatedCollections } from './useRelatedCollections.js'
|
||||
|
||||
const baseClass = 'relationship-add-new'
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import type React from 'react'
|
||||
|
||||
import type { Action, OptionGroup, Value } from '../types'
|
||||
import type { Action, OptionGroup, Value } from '../types.d.ts'
|
||||
|
||||
export type Props = {
|
||||
dispatchOptions: React.Dispatch<Action>
|
||||
|
||||
@@ -2,7 +2,7 @@ import type { ClientConfig, SanitizedCollectionConfig } from 'payload/types'
|
||||
|
||||
import { useState } from 'react'
|
||||
|
||||
import { useConfig } from '../../../../providers/Config'
|
||||
import { useConfig } from '../../../../providers/Config/index.js'
|
||||
|
||||
export const useRelatedCollections = (
|
||||
relationTo: string | string[],
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { Value } from './types'
|
||||
import type { Value } from './types.d.ts'
|
||||
|
||||
type RelationMap = {
|
||||
[relation: string]: (number | string)[]
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { Option } from '../../../elements/ReactSelect/types'
|
||||
import type { OptionGroup, Value } from './types'
|
||||
import type { Option } from '../../../elements/ReactSelect/types.d.ts'
|
||||
import type { OptionGroup, Value } from './types.d.ts'
|
||||
|
||||
type Args = {
|
||||
options: OptionGroup[]
|
||||
|
||||
@@ -6,27 +6,27 @@ import { wordBoundariesRegex } from 'payload/utilities'
|
||||
import qs from 'qs'
|
||||
import React, { useCallback, useEffect, useReducer, useRef, useState } from 'react'
|
||||
|
||||
import type { DocumentDrawerProps } from '../../../elements/DocumentDrawer/types'
|
||||
import type { FilterOptionsResult, GetResults, Option, Props, Value } from './types'
|
||||
import type { DocumentDrawerProps } from '../../../elements/DocumentDrawer/types.d.ts'
|
||||
import type { FilterOptionsResult, GetResults, Option, Props, Value } from './types.d.ts'
|
||||
|
||||
import { GetFilterOptions } from '../../../elements/GetFilterOptions'
|
||||
import ReactSelect from '../../../elements/ReactSelect'
|
||||
import { useDebouncedCallback } from '../../../hooks/useDebouncedCallback'
|
||||
import { useAuth } from '../../../providers/Auth'
|
||||
import { useConfig } from '../../../providers/Config'
|
||||
import { useLocale } from '../../../providers/Locale'
|
||||
import { useTranslation } from '../../../providers/Translation'
|
||||
import { useFormProcessing } from '../../Form/context'
|
||||
import useField from '../../useField'
|
||||
import { withCondition } from '../../withCondition'
|
||||
import { fieldBaseClass } from '../shared'
|
||||
import { AddNewRelation } from './AddNew'
|
||||
import { createRelationMap } from './createRelationMap'
|
||||
import { findOptionsByValue } from './findOptionsByValue'
|
||||
import { GetFilterOptions } from '../../../elements/GetFilterOptions/index.js'
|
||||
import ReactSelect from '../../../elements/ReactSelect/index.js'
|
||||
import { useDebouncedCallback } from '../../../hooks/useDebouncedCallback.js'
|
||||
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 { useFormProcessing } from '../../Form/context.js'
|
||||
import useField from '../../useField/index.js'
|
||||
import { withCondition } from '../../withCondition/index.js'
|
||||
import { fieldBaseClass } from '../shared.js'
|
||||
import { AddNewRelation } from './AddNew/index.js'
|
||||
import { createRelationMap } from './createRelationMap.js'
|
||||
import { findOptionsByValue } from './findOptionsByValue.js'
|
||||
import './index.scss'
|
||||
import optionsReducer from './optionsReducer'
|
||||
import { MultiValueLabel } from './select-components/MultiValueLabel'
|
||||
import { SingleValue } from './select-components/SingleValue'
|
||||
import optionsReducer from './optionsReducer.js'
|
||||
import { MultiValueLabel } from './select-components/MultiValueLabel/index.js'
|
||||
import { SingleValue } from './select-components/SingleValue/index.js'
|
||||
|
||||
const maxResultsPerRequest = 10
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { getTranslation } from '@payloadcms/translations'
|
||||
|
||||
import type { Action, Option, OptionGroup } from './types'
|
||||
import type { Action, Option, OptionGroup } from './types.d.ts'
|
||||
|
||||
import { formatDocTitle } from '../../../utilities/formatDocTitle'
|
||||
import { formatDocTitle } from '../../../utilities/formatDocTitle.js'
|
||||
|
||||
const reduceToIDs = (options) =>
|
||||
options.reduce((ids, option) => {
|
||||
|
||||
@@ -4,13 +4,13 @@ import type { MultiValueProps } from 'react-select'
|
||||
import React, { Fragment, useEffect, useState } from 'react'
|
||||
import { components } from 'react-select'
|
||||
|
||||
import type { Option } from '../../types'
|
||||
import type { Option } from '../../types.d.ts'
|
||||
|
||||
import { useDocumentDrawer } from '../../../../../elements/DocumentDrawer'
|
||||
import { Tooltip } from '../../../../../elements/Tooltip'
|
||||
import { Edit } from '../../../../../icons/Edit'
|
||||
import { useAuth } from '../../../../../providers/Auth'
|
||||
import { useTranslation } from '../../../../../providers/Translation'
|
||||
import { useDocumentDrawer } from '../../../../../elements/DocumentDrawer/index.js'
|
||||
import { Tooltip } from '../../../../../elements/Tooltip/index.js'
|
||||
import { Edit } from '../../../../../icons/Edit/index.js'
|
||||
import { useAuth } from '../../../../../providers/Auth/index.js'
|
||||
import { useTranslation } from '../../../../../providers/Translation/index.js'
|
||||
import './index.scss'
|
||||
|
||||
const baseClass = 'relationship--multi-value-label'
|
||||
|
||||
@@ -4,13 +4,13 @@ import type { SingleValueProps } from 'react-select'
|
||||
import React, { Fragment, useEffect, useState } from 'react'
|
||||
import { components as SelectComponents } from 'react-select'
|
||||
|
||||
import type { Option } from '../../types'
|
||||
import type { Option } from '../../types.d.ts'
|
||||
|
||||
import { useDocumentDrawer } from '../../../../../elements/DocumentDrawer'
|
||||
import { Tooltip } from '../../../../../elements/Tooltip'
|
||||
import { Edit } from '../../../../../icons/Edit'
|
||||
import { useAuth } from '../../../../../providers/Auth'
|
||||
import { useTranslation } from '../../../../../providers/Translation'
|
||||
import { useDocumentDrawer } from '../../../../../elements/DocumentDrawer/index.js'
|
||||
import { Tooltip } from '../../../../../elements/Tooltip/index.js'
|
||||
import { Edit } from '../../../../../icons/Edit/index.js'
|
||||
import { useAuth } from '../../../../../providers/Auth/index.js'
|
||||
import { useTranslation } from '../../../../../providers/Translation/index.js'
|
||||
import './index.scss'
|
||||
|
||||
const baseClass = 'relationship--single-value'
|
||||
|
||||
@@ -3,7 +3,7 @@ import type { SanitizedCollectionConfig } from 'payload/types'
|
||||
import type { SanitizedConfig } from 'payload/types'
|
||||
import type { Where } from 'payload/types'
|
||||
|
||||
import type { FormFieldBase } from '../shared'
|
||||
import type { FormFieldBase } from '../shared.d.ts'
|
||||
|
||||
export type Props = FormFieldBase & {
|
||||
name: string
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import type React from 'react'
|
||||
|
||||
import type { Props } from './types'
|
||||
import type { Props } from './types.d.ts'
|
||||
|
||||
const RichText: React.FC<Props> = (props) => {
|
||||
return null
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
import type { FormFieldBase } from '../shared'
|
||||
import type { FormFieldBase } from '../shared.d.ts'
|
||||
|
||||
export type Props = FormFieldBase
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
'use client'
|
||||
import React from 'react'
|
||||
|
||||
import type { Props } from './types'
|
||||
import type { Props } from './types.d.ts'
|
||||
|
||||
import RenderFields from '../../RenderFields'
|
||||
import { withCondition } from '../../withCondition'
|
||||
import { fieldBaseClass } from '../shared'
|
||||
import RenderFields from '../../RenderFields/index.js'
|
||||
import { withCondition } from '../../withCondition/index.js'
|
||||
import { fieldBaseClass } from '../shared.js'
|
||||
import './index.scss'
|
||||
import { RowProvider } from './provider'
|
||||
import { RowProvider } from './provider.js'
|
||||
|
||||
const baseClass = 'row'
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import type { FieldPermissions } from 'payload/auth'
|
||||
import type { FieldTypes } from 'payload/config'
|
||||
|
||||
import type { FormFieldBase } from '../shared'
|
||||
import type { FormFieldBase } from '../shared.d.ts'
|
||||
|
||||
export type Props = FormFieldBase & {
|
||||
fieldTypes: FieldTypes
|
||||
|
||||
@@ -4,14 +4,14 @@ import type { ClientValidate, Option, OptionObject } from 'payload/types'
|
||||
import { getTranslation } from '@payloadcms/translations'
|
||||
import React, { useCallback, useState } from 'react'
|
||||
|
||||
import type { Props } from './types'
|
||||
import type { Props } from './types.d.ts'
|
||||
|
||||
import ReactSelect from '../../../elements/ReactSelect'
|
||||
import { useTranslation } from '../../../providers/Translation'
|
||||
import LabelComp from '../../Label'
|
||||
import useField from '../../useField'
|
||||
import { withCondition } from '../../withCondition'
|
||||
import { fieldBaseClass } from '../shared'
|
||||
import ReactSelect from '../../../elements/ReactSelect/index.js'
|
||||
import { useTranslation } from '../../../providers/Translation/index.js'
|
||||
import LabelComp from '../../Label/index.js'
|
||||
import useField from '../../useField/index.js'
|
||||
import { withCondition } from '../../withCondition/index.js'
|
||||
import { fieldBaseClass } from '../shared.js'
|
||||
import './index.scss'
|
||||
|
||||
const formatOptions = (options: Option[]): OptionObject[] =>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { FormFieldBase } from '../shared'
|
||||
import type { FormFieldBase } from '../shared.d.ts'
|
||||
|
||||
export type Props = FormFieldBase & {
|
||||
name?: string
|
||||
|
||||
@@ -2,11 +2,11 @@
|
||||
import { getTranslation } from '@payloadcms/translations'
|
||||
import React, { useState } from 'react'
|
||||
|
||||
import type { MappedTab } from '../../../../utilities/buildComponentMap/types'
|
||||
import type { MappedTab } from '../../../../utilities/buildComponentMap/types.d.ts'
|
||||
|
||||
import { ErrorPill } from '../../../../elements/ErrorPill'
|
||||
import { useTranslation } from '../../../../providers/Translation'
|
||||
import { WatchChildErrors } from '../../../WatchChildErrors'
|
||||
import { ErrorPill } from '../../../../elements/ErrorPill/index.js'
|
||||
import { useTranslation } from '../../../../providers/Translation/index.js'
|
||||
import { WatchChildErrors } from '../../../WatchChildErrors/index.js'
|
||||
import './index.scss'
|
||||
|
||||
const baseClass = 'tabs-field__tab-button'
|
||||
|
||||
@@ -5,19 +5,19 @@ import { getTranslation } from '@payloadcms/translations'
|
||||
import { toKebabCase } from 'payload/utilities'
|
||||
import React, { useCallback, useEffect, useState } from 'react'
|
||||
|
||||
import type { Props } from './types'
|
||||
import type { Props } from './types.d.ts'
|
||||
|
||||
import { useCollapsible } from '../../../elements/Collapsible/provider'
|
||||
import { useDocumentInfo } from '../../../providers/DocumentInfo'
|
||||
import { usePreferences } from '../../../providers/Preferences'
|
||||
import { useTranslation } from '../../../providers/Translation'
|
||||
import { FieldPathProvider, useFieldPath } from '../../FieldPathProvider'
|
||||
import RenderFields from '../../RenderFields'
|
||||
import { withCondition } from '../../withCondition'
|
||||
import { fieldBaseClass } from '../shared'
|
||||
import { TabComponent } from './Tab'
|
||||
import { useCollapsible } from '../../../elements/Collapsible/provider.js'
|
||||
import { useDocumentInfo } from '../../../providers/DocumentInfo/index.js'
|
||||
import { usePreferences } from '../../../providers/Preferences/index.js'
|
||||
import { useTranslation } from '../../../providers/Translation/index.js'
|
||||
import { FieldPathProvider, useFieldPath } from '../../FieldPathProvider/index.js'
|
||||
import RenderFields from '../../RenderFields/index.js'
|
||||
import { withCondition } from '../../withCondition/index.js'
|
||||
import { fieldBaseClass } from '../shared.js'
|
||||
import { TabComponent } from './Tab/index.js'
|
||||
import './index.scss'
|
||||
import { TabsProvider } from './provider'
|
||||
import { TabsProvider } from './provider.js'
|
||||
|
||||
const baseClass = 'tabs-field'
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import type { FieldPermissions } from 'payload/auth'
|
||||
|
||||
import type { FormFieldBase } from '../shared'
|
||||
import type { FormFieldBase } from '../shared.d.ts'
|
||||
|
||||
export type Props = FormFieldBase & {
|
||||
forceRender?: boolean
|
||||
|
||||
@@ -4,11 +4,11 @@ import type { ChangeEvent } from 'react'
|
||||
import { getTranslation } from '@payloadcms/translations'
|
||||
import React from 'react'
|
||||
|
||||
import type { Option } from '../../../elements/ReactSelect/types'
|
||||
import type { Option } from '../../../elements/ReactSelect/types.d.ts'
|
||||
|
||||
import ReactSelect from '../../../elements/ReactSelect'
|
||||
import { useTranslation } from '../../../providers/Translation'
|
||||
import { type FormFieldBase, fieldBaseClass } from '../shared'
|
||||
import ReactSelect from '../../../elements/ReactSelect/index.js'
|
||||
import { useTranslation } from '../../../providers/Translation/index.js'
|
||||
import { type FormFieldBase, fieldBaseClass } from '../shared.js'
|
||||
import './index.scss'
|
||||
|
||||
export type TextInputProps = Omit<FormFieldBase, 'type'> & {
|
||||
|
||||
@@ -3,16 +3,16 @@ import type { ClientValidate } from 'payload/types'
|
||||
|
||||
import React, { useCallback, useEffect, useState } from 'react'
|
||||
|
||||
import type { Option } from '../../../elements/ReactSelect/types'
|
||||
import type { Props } from './types'
|
||||
import type { Option } from '../../../elements/ReactSelect/types.d.ts'
|
||||
import type { Props } from './types.d.ts'
|
||||
|
||||
import { useConfig } from '../../../providers/Config'
|
||||
import { useLocale } from '../../../providers/Locale'
|
||||
import LabelComp from '../../Label'
|
||||
import useField from '../../useField'
|
||||
import { withCondition } from '../../withCondition'
|
||||
import { isFieldRTL } from '../shared'
|
||||
import { TextInput } from './Input'
|
||||
import { useConfig } from '../../../providers/Config/index.js'
|
||||
import { useLocale } from '../../../providers/Locale/index.js'
|
||||
import LabelComp from '../../Label/index.js'
|
||||
import useField from '../../useField/index.js'
|
||||
import { withCondition } from '../../withCondition/index.js'
|
||||
import { isFieldRTL } from '../shared.js'
|
||||
import { TextInput } from './Input.js'
|
||||
import './index.scss'
|
||||
|
||||
const Text: React.FC<Props> = (props) => {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { FormFieldBase } from '../shared'
|
||||
import type { FormFieldBase } from '../shared.d.ts'
|
||||
|
||||
export type Props = FormFieldBase & {
|
||||
hasMany?: boolean
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
import { getTranslation } from '@payloadcms/translations'
|
||||
import React, { type ChangeEvent } from 'react'
|
||||
|
||||
import { useTranslation } from '../../../providers/Translation'
|
||||
import { type FormFieldBase, fieldBaseClass } from '../shared'
|
||||
import { useTranslation } from '../../../providers/Translation/index.js'
|
||||
import { type FormFieldBase, fieldBaseClass } from '../shared.js'
|
||||
import './index.scss'
|
||||
|
||||
export type TextAreaInputProps = FormFieldBase & {
|
||||
|
||||
@@ -4,15 +4,15 @@ import type { ClientValidate } from 'payload/types'
|
||||
import { getTranslation } from '@payloadcms/translations'
|
||||
import React, { useCallback } from 'react'
|
||||
|
||||
import type { Props } from './types'
|
||||
import type { Props } from './types.d.ts'
|
||||
|
||||
import { useConfig } from '../../../providers/Config'
|
||||
import { useTranslation } from '../../../providers/Translation'
|
||||
import LabelComp from '../../Label'
|
||||
import useField from '../../useField'
|
||||
import { withCondition } from '../../withCondition'
|
||||
import { isFieldRTL } from '../shared'
|
||||
import { TextareaInput } from './Input'
|
||||
import { useConfig } from '../../../providers/Config/index.js'
|
||||
import { useTranslation } from '../../../providers/Translation/index.js'
|
||||
import LabelComp from '../../Label/index.js'
|
||||
import useField from '../../useField/index.js'
|
||||
import { withCondition } from '../../withCondition/index.js'
|
||||
import { isFieldRTL } from '../shared.js'
|
||||
import { TextareaInput } from './Input.js'
|
||||
import './index.scss'
|
||||
|
||||
const Textarea: React.FC<Props> = (props) => {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { FormFieldBase } from '../shared'
|
||||
import type { FormFieldBase } from '../shared.d.ts'
|
||||
|
||||
export type Props = FormFieldBase & {
|
||||
name?: string
|
||||
|
||||
@@ -5,17 +5,17 @@ import type { SanitizedCollectionConfig, UploadField } from 'payload/types'
|
||||
import { getTranslation } from '@payloadcms/translations'
|
||||
import React, { useCallback, useEffect, useState } from 'react'
|
||||
|
||||
import type { DocumentDrawerProps } from '../../../elements/DocumentDrawer/types'
|
||||
import type { ListDrawerProps } from '../../../elements/ListDrawer/types'
|
||||
import type { FilterOptionsResult } from '../Relationship/types'
|
||||
import type { DocumentDrawerProps } from '../../../elements/DocumentDrawer/types.d.ts'
|
||||
import type { ListDrawerProps } from '../../../elements/ListDrawer/types.d.ts'
|
||||
import type { FilterOptionsResult } from '../Relationship/types.d.ts'
|
||||
|
||||
import { Button } from '../../../elements/Button'
|
||||
import { useDocumentDrawer } from '../../../elements/DocumentDrawer'
|
||||
import FileDetails from '../../../elements/FileDetails'
|
||||
import { useListDrawer } from '../../../elements/ListDrawer'
|
||||
import { useTranslation } from '../../../providers/Translation'
|
||||
import LabelComp from '../../Label'
|
||||
import { type FormFieldBase, fieldBaseClass } from '../shared'
|
||||
import { Button } from '../../../elements/Button/index.js'
|
||||
import { useDocumentDrawer } from '../../../elements/DocumentDrawer/index.js'
|
||||
import FileDetails from '../../../elements/FileDetails/index.js'
|
||||
import { useListDrawer } from '../../../elements/ListDrawer/index.js'
|
||||
import { useTranslation } from '../../../providers/Translation/index.js'
|
||||
import LabelComp from '../../Label/index.js'
|
||||
import { type FormFieldBase, fieldBaseClass } from '../shared.js'
|
||||
import './index.scss'
|
||||
|
||||
const baseClass = 'upload'
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
'use client'
|
||||
import React, { useCallback } from 'react'
|
||||
|
||||
import type { Props } from './types'
|
||||
import type { Props } from './types.d.ts'
|
||||
|
||||
import { useConfig } from '../../../providers/Config'
|
||||
import LabelComp from '../../Label'
|
||||
import useField from '../../useField'
|
||||
import { UploadInput } from './Input'
|
||||
import { useConfig } from '../../../providers/Config/index.js'
|
||||
import LabelComp from '../../Label/index.js'
|
||||
import useField from '../../useField/index.js'
|
||||
import { UploadInput } from './Input.js'
|
||||
import './index.scss'
|
||||
|
||||
const Upload: React.FC<Props> = (props) => {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import type { UploadField } from 'payload/types'
|
||||
|
||||
import type { FormFieldBase } from '../shared'
|
||||
import type { FormFieldBase } from '../shared.d.ts'
|
||||
|
||||
export type Props = FormFieldBase & {
|
||||
filterOptions?: UploadField['filterOptions']
|
||||
|
||||
@@ -1,29 +1,29 @@
|
||||
import type { FieldTypes } from 'payload/config'
|
||||
|
||||
import array from './Array'
|
||||
import blocks from './Blocks'
|
||||
import checkbox from './Checkbox'
|
||||
import code from './Code'
|
||||
import collapsible from './Collapsible'
|
||||
import confirmPassword from './ConfirmPassword'
|
||||
import date from './DateTime'
|
||||
import email from './Email'
|
||||
import group from './Group'
|
||||
import hidden from './HiddenInput'
|
||||
import json from './JSON'
|
||||
import number from './Number'
|
||||
import password from './Password'
|
||||
import point from './Point'
|
||||
import radio from './RadioGroup'
|
||||
import relationship from './Relationship'
|
||||
import richText from './RichText'
|
||||
import row from './Row'
|
||||
import select from './Select'
|
||||
import tabs from './Tabs'
|
||||
import text from './Text'
|
||||
import textarea from './Textarea'
|
||||
import ui from './UI'
|
||||
import upload from './Upload'
|
||||
import array from './Array/index.js'
|
||||
import blocks from './Blocks/index.js'
|
||||
import checkbox from './Checkbox/index.js'
|
||||
import code from './Code/index.js'
|
||||
import collapsible from './Collapsible/index.js'
|
||||
import confirmPassword from './ConfirmPassword/index.js'
|
||||
import date from './DateTime/index.js'
|
||||
import email from './Email/index.js'
|
||||
import group from './Group/index.js'
|
||||
import hidden from './HiddenInput/index.js'
|
||||
import json from './JSON/index.js'
|
||||
import number from './Number/index.js'
|
||||
import password from './Password/index.js'
|
||||
import point from './Point/index.js'
|
||||
import radio from './RadioGroup/index.js'
|
||||
import relationship from './Relationship/index.js'
|
||||
import richText from './RichText/index.js'
|
||||
import row from './Row/index.js'
|
||||
import select from './Select/index.js'
|
||||
import tabs from './Tabs/index.js'
|
||||
import text from './Text/index.js'
|
||||
import textarea from './Textarea/index.js'
|
||||
import ui from './UI/index.js'
|
||||
import upload from './Upload/index.js'
|
||||
|
||||
export const fieldTypes: FieldTypes = {
|
||||
array,
|
||||
|
||||
@@ -20,7 +20,7 @@ import type {
|
||||
MappedField,
|
||||
MappedTab,
|
||||
ReducedBlock,
|
||||
} from '../../utilities/buildComponentMap/types'
|
||||
} from '../../utilities/buildComponentMap/types.d.ts'
|
||||
|
||||
export const fieldBaseClass = 'field-type'
|
||||
|
||||
|
||||
@@ -1,18 +1,18 @@
|
||||
'use client'
|
||||
import { useCallback, useMemo, useRef } from 'react'
|
||||
|
||||
import type { UPDATE } from '../Form/types'
|
||||
import type { FieldType, Options } from './types'
|
||||
import type { UPDATE } from '../Form/types.d.ts'
|
||||
import type { FieldType, Options } from './types.d.ts'
|
||||
|
||||
import useThrottledEffect from '../../hooks/useThrottledEffect'
|
||||
import { useAuth } from '../../providers/Auth'
|
||||
import { useConfig } from '../../providers/Config'
|
||||
import { useDocumentInfo } from '../../providers/DocumentInfo'
|
||||
import { useOperation } from '../../providers/OperationProvider'
|
||||
import { useTranslation } from '../../providers/Translation'
|
||||
import { useFieldPath } from '../FieldPathProvider'
|
||||
import { useForm, useFormFields, useFormProcessing, useFormSubmitted } from '../Form/context'
|
||||
import { useReadOnly } from '../ReadOnlyProvider'
|
||||
import useThrottledEffect from '../../hooks/useThrottledEffect.js'
|
||||
import { useAuth } from '../../providers/Auth/index.js'
|
||||
import { useConfig } from '../../providers/Config/index.js'
|
||||
import { useDocumentInfo } from '../../providers/DocumentInfo/index.js'
|
||||
import { useOperation } from '../../providers/OperationProvider/index.js'
|
||||
import { useTranslation } from '../../providers/Translation/index.js'
|
||||
import { useFieldPath } from '../FieldPathProvider/index.js'
|
||||
import { useForm, useFormFields, useFormProcessing, useFormSubmitted } from '../Form/context.js'
|
||||
import { useReadOnly } from '../ReadOnlyProvider/index.js'
|
||||
|
||||
/**
|
||||
* Get and set the value of a form field.
|
||||
|
||||
@@ -7,11 +7,13 @@ import type {
|
||||
PayloadRequest,
|
||||
} from 'payload/types'
|
||||
|
||||
import ObjectId from 'bson-objectid'
|
||||
import ObjectIdDefault from 'bson-objectid'
|
||||
import { fieldAffectsData, fieldHasSubFields, tabHasName } from 'payload/types'
|
||||
import { getDefaultValue } from 'payload/utilities'
|
||||
|
||||
import { iterateFields } from './iterateFields'
|
||||
import { iterateFields } from './iterateFields.js'
|
||||
|
||||
const ObjectId = ObjectIdDefault.default
|
||||
|
||||
export type AddFieldStatePromiseArgs = {
|
||||
/**
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import buildStateFromSchema from './index'
|
||||
import buildStateFromSchema from './index.js'
|
||||
|
||||
describe('Form - buildStateFromSchema', () => {
|
||||
const defaultValue = 'Default'
|
||||
@@ -6,9 +6,9 @@ describe('Form - buildStateFromSchema', () => {
|
||||
const fieldSchema = [
|
||||
{
|
||||
name: 'text',
|
||||
type: 'text',
|
||||
defaultValue,
|
||||
label: 'Text',
|
||||
type: 'text',
|
||||
},
|
||||
]
|
||||
const state = await buildStateFromSchema({ fieldSchema })
|
||||
@@ -20,9 +20,9 @@ describe('Form - buildStateFromSchema', () => {
|
||||
const fieldSchema = [
|
||||
{
|
||||
name: 'text',
|
||||
type: 'text',
|
||||
defaultValue,
|
||||
label: 'Text',
|
||||
type: 'text',
|
||||
},
|
||||
]
|
||||
const state = await buildStateFromSchema({ data, fieldSchema })
|
||||
@@ -34,6 +34,7 @@ describe('Form - buildStateFromSchema', () => {
|
||||
const fieldSchema = [
|
||||
{
|
||||
name: 'text',
|
||||
type: 'text',
|
||||
defaultValue: (args) => {
|
||||
if (!args.locale) {
|
||||
return 'missing locale'
|
||||
@@ -44,7 +45,6 @@ describe('Form - buildStateFromSchema', () => {
|
||||
return 'Default'
|
||||
},
|
||||
label: 'Text',
|
||||
type: 'text',
|
||||
},
|
||||
]
|
||||
const state = await buildStateFromSchema({ fieldSchema, locale, user })
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import type { Data, Field as FieldSchema, FormState, PayloadRequest } from 'payload/types'
|
||||
|
||||
import { iterateFields } from './iterateFields'
|
||||
import { iterateFields } from './iterateFields.js'
|
||||
|
||||
type Args = {
|
||||
data?: Data
|
||||
|
||||
@@ -2,9 +2,9 @@ import type { Data, Field as FieldSchema, FormState, PayloadRequest } from 'payl
|
||||
|
||||
import { fieldIsPresentationalOnly } from 'payload/types'
|
||||
|
||||
import type { AddFieldStatePromiseArgs } from './addFieldStatePromise'
|
||||
import type { AddFieldStatePromiseArgs } from './addFieldStatePromise.d.ts'
|
||||
|
||||
import { addFieldStatePromise } from './addFieldStatePromise'
|
||||
import { addFieldStatePromise } from './addFieldStatePromise.js'
|
||||
|
||||
type Args = {
|
||||
/**
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
import React from 'react'
|
||||
import { Fragment } from 'react'
|
||||
|
||||
import { useFormFields } from '../Form/context'
|
||||
import { useFormFields } from '../Form/context.js'
|
||||
|
||||
export const WatchCondition: React.FC<{
|
||||
children: React.ReactNode
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
'use client'
|
||||
import React from 'react'
|
||||
|
||||
import { useFieldPath } from '../FieldPathProvider'
|
||||
import { WatchCondition } from './WatchCondition'
|
||||
import { useFieldPath } from '../FieldPathProvider/index.js'
|
||||
import { WatchCondition } from './WatchCondition.js'
|
||||
|
||||
export const withCondition = <P extends Record<string, unknown>>(
|
||||
Field: React.ComponentType<P>,
|
||||
|
||||
Reference in New Issue
Block a user