fix(ui): properly handles column selector labels

This commit is contained in:
Jacob Fletcher
2024-03-27 15:25:40 -04:00
parent 91b4e91e9c
commit a882cc7e8e
9 changed files with 50 additions and 28 deletions

View File

@@ -1,5 +1,5 @@
'use client'
import type { DocumentPreferences, RowLabel as RowLabelType } from 'payload/types'
import type { DocumentPreferences, FieldBase, RowLabel as RowLabelType } from 'payload/types'
import React, { Fragment, useCallback, useEffect, useState } from 'react'
@@ -28,6 +28,7 @@ import type { FormFieldBase } from '../shared/index.js'
export type CollapsibleFieldProps = FormFieldBase & {
fieldMap: FieldMap
initCollapsed?: boolean
label?: FieldBase['label']
permissions: FieldPermissions
width?: string
}

View File

@@ -1,5 +1,5 @@
import type { I18n } from '@payloadcms/translations'
import type { ClientCollectionConfig, RelationshipField } from 'payload/types'
import type { ClientCollectionConfig, FieldBase, RelationshipField } from 'payload/types'
import type { SanitizedConfig } from 'payload/types'
import type { FormFieldBase } from '../shared/index.js'
@@ -8,6 +8,7 @@ export type RelationshipFieldProps = FormFieldBase & {
allowCreate?: RelationshipField['admin']['allowCreate']
hasMany?: boolean
isSortable?: boolean
label?: FieldBase['label']
name: string
relationTo?: RelationshipField['relationTo']
sortOptions?: RelationshipField['admin']['sortOptions']

View File

@@ -1,9 +1,11 @@
import type { FieldBase } from 'packages/payload/src/exports/types.js'
import type React from 'react'
import type { MappedField } from '../../providers/ComponentMap/buildComponentMap/types.js'
import type { FormFieldBase } from '../shared/index.js'
export type RichTextFieldProps = FormFieldBase & {
label?: FieldBase['label']
name: string
richTextComponentMap?: Map<string, MappedField[] | React.ReactNode>
width?: string