@payloadcms/ui 3.71.0-internal.27e1e08 → 3.71.0-internal.49c4f67
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/exports/client/index.js +12 -12
- package/dist/exports/client/index.js.map +3 -3
- package/dist/fields/Group/index.scss +2 -0
- package/dist/fields/Tabs/index.d.ts.map +1 -1
- package/dist/fields/Tabs/index.js +138 -201
- package/dist/fields/Tabs/index.js.map +1 -1
- package/dist/forms/fieldSchemasToFormState/addFieldStatePromise.d.ts +2 -2
- package/dist/forms/fieldSchemasToFormState/addFieldStatePromise.d.ts.map +1 -1
- package/dist/forms/fieldSchemasToFormState/addFieldStatePromise.js +125 -103
- package/dist/forms/fieldSchemasToFormState/addFieldStatePromise.js.map +1 -1
- package/dist/forms/fieldSchemasToFormState/iterateFields.d.ts +2 -2
- package/dist/forms/fieldSchemasToFormState/iterateFields.d.ts.map +1 -1
- package/dist/forms/fieldSchemasToFormState/iterateFields.js +1 -1
- package/dist/forms/fieldSchemasToFormState/iterateFields.js.map +1 -1
- package/dist/forms/fieldSchemasToFormState/renderField.d.ts.map +1 -1
- package/dist/forms/fieldSchemasToFormState/renderField.js +5 -3
- package/dist/forms/fieldSchemasToFormState/renderField.js.map +1 -1
- package/dist/styles.css +1 -1
- package/dist/utilities/buildClientFieldSchemaMap/traverseFields.d.ts +2 -2
- package/dist/utilities/buildClientFieldSchemaMap/traverseFields.d.ts.map +1 -1
- package/dist/utilities/buildClientFieldSchemaMap/traverseFields.js +40 -36
- package/dist/utilities/buildClientFieldSchemaMap/traverseFields.js.map +1 -1
- package/dist/utilities/buildFieldSchemaMap/traverseFields.d.ts +2 -2
- package/dist/utilities/buildFieldSchemaMap/traverseFields.d.ts.map +1 -1
- package/dist/utilities/buildFieldSchemaMap/traverseFields.js +40 -38
- package/dist/utilities/buildFieldSchemaMap/traverseFields.js.map +1 -1
- package/package.json +4 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"iterateFields.js","names":["stripUnselectedFields","getFieldPaths","addFieldStatePromise","iterateFields","id","addErrorPathToParent","addErrorPathToParentArg","anyParentLocalized","blockData","clientFieldSchemaMap","collectionSlug","data","fields","fieldSchemaMap","filter","forceFullValue","fullData","includeSchema","mockRSCs","omitParents","operation","parentIndexPath","parentPassesCondition","parentPath","parentSchemaPath","permissions","preferences","previousFormState","readOnly","renderAllFields","renderFieldFn","req","select","selectMode","skipConditionChecks","skipValidation","state","promises","forEach","field","fieldIndex","passesCondition","indexPath","path","schemaPath","index","shouldContinue","siblingDoc","pathSegments","split","Boolean","admin","condition","user","err","payload","logger","error","msg","push","parentPermissions","Promise","all"],"sources":["../../../src/forms/fieldSchemasToFormState/iterateFields.ts"],"sourcesContent":["import type {\n BuildFormStateArgs,\n ClientFieldSchemaMap,\n Data,\n DocumentPreferences,\n Field
|
|
1
|
+
{"version":3,"file":"iterateFields.js","names":["stripUnselectedFields","getFieldPaths","addFieldStatePromise","iterateFields","id","addErrorPathToParent","addErrorPathToParentArg","anyParentLocalized","blockData","clientFieldSchemaMap","collectionSlug","data","fields","fieldSchemaMap","filter","forceFullValue","fullData","includeSchema","mockRSCs","omitParents","operation","parentIndexPath","parentPassesCondition","parentPath","parentSchemaPath","permissions","preferences","previousFormState","readOnly","renderAllFields","renderFieldFn","req","select","selectMode","skipConditionChecks","skipValidation","state","promises","forEach","field","fieldIndex","passesCondition","indexPath","path","schemaPath","index","shouldContinue","siblingDoc","pathSegments","split","Boolean","admin","condition","user","err","payload","logger","error","msg","push","parentPermissions","Promise","all"],"sources":["../../../src/forms/fieldSchemasToFormState/iterateFields.ts"],"sourcesContent":["import type {\n BuildFormStateArgs,\n ClientFieldSchemaMap,\n Data,\n DocumentPreferences,\n Field,\n FieldSchemaMap,\n FormState,\n FormStateWithoutComponents,\n PayloadRequest,\n SanitizedFieldsPermissions,\n SelectMode,\n SelectType,\n TabAsField,\n} from 'payload'\n\nimport { stripUnselectedFields } from 'payload'\nimport { getFieldPaths } from 'payload/shared'\n\nimport type { AddFieldStatePromiseArgs } from './addFieldStatePromise.js'\nimport type { RenderFieldMethod } from './types.js'\n\nimport { addFieldStatePromise } from './addFieldStatePromise.js'\n\ntype Args = {\n addErrorPathToParent: (fieldPath: string) => void\n /**\n * if any parents is localized, then the field is localized. @default false\n */\n anyParentLocalized?: boolean\n /**\n * Data of the nearest parent block, or undefined\n */\n blockData: Data | undefined\n clientFieldSchemaMap?: ClientFieldSchemaMap\n collectionSlug?: string\n data: Data\n fields: (Field | TabAsField)[]\n fieldSchemaMap: FieldSchemaMap\n filter?: (args: AddFieldStatePromiseArgs) => boolean\n /**\n * Force the value of fields like arrays or blocks to be the full value instead of the length @default false\n */\n forceFullValue?: boolean\n fullData: Data\n id?: number | string\n /**\n * Whether the field schema should be included in the state. @default false\n */\n includeSchema?: boolean\n mockRSCs?: BuildFormStateArgs['mockRSCs']\n /**\n * Whether to omit parent fields in the state. @default false\n */\n omitParents?: boolean\n /**\n * operation is only needed for validation\n */\n operation: 'create' | 'update'\n parentIndexPath: string\n parentPassesCondition?: boolean\n parentPath: string\n parentSchemaPath: string\n permissions: SanitizedFieldsPermissions\n preferences?: DocumentPreferences\n previousFormState: FormState\n readOnly?: boolean\n renderAllFields: boolean\n renderFieldFn: RenderFieldMethod\n req: PayloadRequest\n select?: SelectType\n selectMode?: SelectMode\n /**\n * Whether to skip checking the field's condition. @default false\n */\n skipConditionChecks?: boolean\n /**\n * Whether to skip validating the field. @default false\n */\n skipValidation?: boolean\n state?: FormStateWithoutComponents\n}\n\n/**\n * Flattens the fields schema and fields data\n */\nexport const iterateFields = async ({\n id,\n addErrorPathToParent: addErrorPathToParentArg,\n anyParentLocalized = false,\n blockData,\n clientFieldSchemaMap,\n collectionSlug,\n data,\n fields,\n fieldSchemaMap,\n filter,\n forceFullValue = false,\n fullData,\n includeSchema = false,\n mockRSCs,\n omitParents = false,\n operation,\n parentIndexPath,\n parentPassesCondition = true,\n parentPath,\n parentSchemaPath,\n permissions,\n preferences,\n previousFormState,\n readOnly,\n renderAllFields,\n renderFieldFn: renderFieldFn,\n req,\n select,\n selectMode,\n skipConditionChecks = false,\n skipValidation = false,\n state = {},\n}: Args): Promise<void> => {\n const promises = []\n\n fields.forEach((field, fieldIndex) => {\n let passesCondition = true\n\n const { indexPath, path, schemaPath } = getFieldPaths({\n field,\n index: fieldIndex,\n parentIndexPath,\n parentPath,\n parentSchemaPath,\n })\n\n if (path !== 'id') {\n const shouldContinue = stripUnselectedFields({\n field,\n select,\n selectMode,\n siblingDoc: data,\n })\n\n if (!shouldContinue) {\n return\n }\n }\n\n const pathSegments = path ? path.split('.') : []\n\n if (!skipConditionChecks) {\n try {\n passesCondition = Boolean(\n (field?.admin?.condition\n ? Boolean(\n field.admin.condition(fullData || {}, data || {}, {\n blockData,\n operation,\n path: pathSegments,\n user: req.user,\n }),\n )\n : true) && parentPassesCondition,\n )\n } catch (err) {\n passesCondition = false\n\n req.payload.logger.error({\n err,\n msg: `Error evaluating field condition at path: ${path}`,\n })\n }\n }\n\n promises.push(\n addFieldStatePromise({\n id,\n addErrorPathToParent: addErrorPathToParentArg,\n anyParentLocalized,\n blockData,\n clientFieldSchemaMap,\n collectionSlug,\n data,\n field,\n fieldIndex,\n fieldSchemaMap,\n filter,\n forceFullValue,\n fullData,\n includeSchema,\n indexPath,\n mockRSCs,\n omitParents,\n operation,\n parentIndexPath,\n parentPath,\n parentPermissions: permissions,\n parentSchemaPath,\n passesCondition,\n path,\n preferences,\n previousFormState,\n readOnly,\n renderAllFields,\n renderFieldFn,\n req,\n schemaPath,\n select,\n selectMode,\n skipConditionChecks,\n skipValidation,\n state,\n }),\n )\n })\n\n await Promise.all(promises)\n}\n"],"mappings":"AAgBA,SAASA,qBAAqB,QAAQ;AACtC,SAASC,aAAa,QAAQ;AAK9B,SAASC,oBAAoB,QAAQ;AA6DrC;;;AAGA,OAAO,MAAMC,aAAA,GAAgB,MAAAA,CAAO;EAClCC,EAAE;EACFC,oBAA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K,CAACC,SAAS,CAACpC,QAAA,IAAY,CAAC,GAAGL,IAAA,IAAQ,CAAC,GAAG;UAChDH,SAAA;UACAY,SAAA;UACAuB,IAAA,EAAMK,YAAA;UACNK,IAAA,EAAMtB,GAAA,CAAIsB;QACZ,MAEF,IAAG,KAAM/B,qBAAA;MAEjB,EAAE,OAAOgC,GAAA,EAAK;QACZb,eAAA,GAAkB;QAElBV,GAAA,CAAIwB,OAAO,CAACC,MAAM,CAACC,KAAK,CAAC;UACvBH,GAAA;UACAI,GAAA,EAAK,6CAA6Cf,IAAA;QACpD;MACF;IACF;IAEAN,QAAA,CAASsB,IAAI,CACXzD,oBAAA,CAAqB;MACnBE,EAAA;MACAC,oBAAA,EAAsBC,uBAAA;MACtBC,kBAAA;MACAC,SAAA;MACAC,oBAAA;MACAC,cAAA;MACAC,IAAA;MACA4B,KAAA;MACAC,UAAA;MACA3B,cAAA;MACAC,MAAA;MACAC,cAAA;MACAC,QAAA;MACAC,aAAA;MACAyB,SAAA;MACAxB,QAAA;MACAC,WAAA;MACAC,SAAA;MACAC,eAAA;MACAE,UAAA;MACAqC,iBAAA,EAAmBnC,WAAA;MACnBD,gBAAA;MACAiB,eAAA;MACAE,IAAA;MACAjB,WAAA;MACAC,iBAAA;MACAC,QAAA;MACAC,eAAA;MACAC,aAAA;MACAC,GAAA;MACAa,UAAA;MACAZ,MAAA;MACAC,UAAA;MACAC,mBAAA;MACAC,cAAA;MACAC;IACF;EAEJ;EAEA,MAAMyB,OAAA,CAAQC,GAAG,CAACzB,QAAA;AACpB","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"renderField.d.ts","sourceRoot":"","sources":["../../../src/forms/fieldSchemasToFormState/renderField.tsx"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAA;AAcnD,eAAO,MAAM,WAAW,EAAE,
|
|
1
|
+
{"version":3,"file":"renderField.d.ts","sourceRoot":"","sources":["../../../src/forms/fieldSchemasToFormState/renderField.tsx"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAA;AAcnD,eAAO,MAAM,WAAW,EAAE,iBA4XzB,CAAA"}
|
|
@@ -31,7 +31,9 @@ export const renderField = ({
|
|
|
31
31
|
schemaPath,
|
|
32
32
|
siblingData
|
|
33
33
|
}) => {
|
|
34
|
-
|
|
34
|
+
// Fields with beforeInput/afterInput need custom components created, so they require render
|
|
35
|
+
const hasBeforeOrAfterInput = fieldConfig.admin?.components && ('beforeInput' in fieldConfig.admin.components || 'afterInput' in fieldConfig.admin.components);
|
|
36
|
+
const requiresRender = renderAllFields || !lastRenderedPath || lastRenderedPath !== path || hasBeforeOrAfterInput;
|
|
35
37
|
if (!requiresRender && fieldConfig.type !== 'array' && fieldConfig.type !== 'blocks') {
|
|
36
38
|
return;
|
|
37
39
|
}
|
|
@@ -233,7 +235,7 @@ export const renderField = ({
|
|
|
233
235
|
clientProps,
|
|
234
236
|
Component: fieldConfig.admin.components.afterInput,
|
|
235
237
|
importMap: req.payload.importMap,
|
|
236
|
-
key:
|
|
238
|
+
key: `field.admin.components.afterInput.${path}`,
|
|
237
239
|
serverProps
|
|
238
240
|
}) : 'Mock';
|
|
239
241
|
}
|
|
@@ -242,7 +244,7 @@ export const renderField = ({
|
|
|
242
244
|
clientProps,
|
|
243
245
|
Component: fieldConfig.admin.components.beforeInput,
|
|
244
246
|
importMap: req.payload.importMap,
|
|
245
|
-
key:
|
|
247
|
+
key: `field.admin.components.beforeInput.${path}`,
|
|
246
248
|
serverProps
|
|
247
249
|
}) : 'Mock';
|
|
248
250
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"renderField.js","names":["getTranslation","createClientField","MissingEditorProp","fieldIsHiddenOrDisabled","RenderServerComponent","FieldDescription","WatchCondition","defaultUIFieldComponentKeys","renderField","id","clientFieldSchemaMap","collectionSlug","data","fieldConfig","fieldSchemaMap","fieldState","forceCreateClientField","formState","indexPath","lastRenderedPath","mockRSCs","operation","parentPath","parentSchemaPath","path","permissions","preferences","readOnly","readOnlyFromProps","renderAllFields","req","schemaPath","siblingData","requiresRender","type","clientField","get","defaultIDType","payload","config","db","field","i18n","importMap","clientProps","customComponents","includes","serverProps","user","value","name","rows","forEach","row","rowIndex","rowLastRenderedPath","rowPath","rowRequiresRender","admin","components","RowLabel","Component","key","rowLabel","labels","singular","String","padStart","rowNumber","blockTypeToMatch","blockType","blockConfig","blocks","blockReferences","find","block","slug","Label","Object","keys","length","description","editor","Error","Field","_jsx","FieldComponent","sanitizedEditorConfig","editorConfig","undefined","Description","t","AfterInput","afterInput","BeforeInput","beforeInput"],"sources":["../../../src/forms/fieldSchemasToFormState/renderField.tsx"],"sourcesContent":["import type {\n ClientComponentProps,\n ClientField,\n FieldPaths,\n FlattenedBlock,\n ServerComponentProps,\n} from 'payload'\n\nimport { getTranslation } from '@payloadcms/translations'\nimport { createClientField, MissingEditorProp } from 'payload'\nimport { fieldIsHiddenOrDisabled } from 'payload/shared'\n\nimport type { RenderFieldMethod } from './types.js'\n\nimport { RenderServerComponent } from '../../elements/RenderServerComponent/index.js'\n\n// eslint-disable-next-line payload/no-imports-from-exports-dir -- MUST reference the exports dir: https://github.com/payloadcms/payload/issues/12002#issuecomment-2791493587\nimport { FieldDescription, WatchCondition } from '../../exports/client/index.js'\n\nconst defaultUIFieldComponentKeys: Array<'Cell' | 'Description' | 'Field' | 'Filter'> = [\n 'Cell',\n 'Description',\n 'Field',\n 'Filter',\n]\n\nexport const renderField: RenderFieldMethod = ({\n id,\n clientFieldSchemaMap,\n collectionSlug,\n data,\n fieldConfig,\n fieldSchemaMap,\n fieldState,\n forceCreateClientField,\n formState,\n indexPath,\n lastRenderedPath,\n mockRSCs,\n operation,\n parentPath,\n parentSchemaPath,\n path,\n permissions,\n preferences,\n readOnly: readOnlyFromProps,\n renderAllFields,\n req,\n schemaPath,\n siblingData,\n}) => {\n const requiresRender = renderAllFields || !lastRenderedPath || lastRenderedPath !== path\n\n if (!requiresRender && fieldConfig.type !== 'array' && fieldConfig.type !== 'blocks') {\n return\n }\n\n const clientField =\n clientFieldSchemaMap && !forceCreateClientField\n ? (clientFieldSchemaMap.get(schemaPath) as ClientField)\n : createClientField({\n defaultIDType: req.payload.config.db.defaultIDType,\n field: fieldConfig,\n i18n: req.i18n,\n importMap: req.payload.importMap,\n })\n\n const clientProps: ClientComponentProps & Partial<FieldPaths> = {\n field: clientField,\n path,\n permissions,\n readOnly:\n readOnlyFromProps === true\n ? true\n : typeof permissions === 'boolean'\n ? !permissions\n : !permissions?.[operation],\n schemaPath,\n }\n\n if (fieldState?.customComponents) {\n clientProps.customComponents = fieldState.customComponents\n }\n\n // fields with subfields\n if (['array', 'blocks', 'collapsible', 'group', 'row', 'tabs'].includes(fieldConfig.type)) {\n clientProps.indexPath = indexPath\n clientProps.parentPath = parentPath\n clientProps.parentSchemaPath = parentSchemaPath\n }\n\n const serverProps: ServerComponentProps = {\n id,\n clientField,\n clientFieldSchemaMap,\n data,\n field: fieldConfig,\n fieldSchemaMap,\n permissions,\n // TODO: Should we pass explicit values? initialValue, value, valid\n // value and initialValue should be typed\n collectionSlug,\n formState,\n i18n: req.i18n,\n operation,\n payload: req.payload,\n preferences,\n req,\n siblingData,\n user: req.user,\n value: 'name' in fieldConfig && data?.[fieldConfig.name],\n }\n\n switch (fieldConfig.type) {\n case 'array': {\n fieldState?.rows?.forEach((row, rowIndex) => {\n const rowLastRenderedPath = row.lastRenderedPath\n\n const rowPath = `${path}.${rowIndex}`\n\n const rowRequiresRender =\n renderAllFields || !rowLastRenderedPath || rowLastRenderedPath !== rowPath\n\n if (!rowRequiresRender) {\n return\n }\n\n row.lastRenderedPath = rowPath\n\n if (fieldConfig.admin?.components && 'RowLabel' in fieldConfig.admin.components) {\n if (!row.customComponents) {\n row.customComponents = {}\n }\n\n row.customComponents.RowLabel = !mockRSCs\n ? RenderServerComponent({\n clientProps,\n Component: fieldConfig.admin.components.RowLabel,\n importMap: req.payload.importMap,\n key: `${rowIndex}`,\n serverProps: {\n ...serverProps,\n rowLabel: `${getTranslation(fieldConfig.labels.singular, req.i18n)} ${String(\n rowIndex + 1,\n ).padStart(2, '0')}`,\n rowNumber: rowIndex + 1,\n },\n })\n : 'Mock'\n }\n })\n\n break\n }\n\n case 'blocks': {\n fieldState?.rows?.forEach((row, rowIndex) => {\n const rowLastRenderedPath = row.lastRenderedPath\n\n const rowPath = `${path}.${rowIndex}`\n\n const rowRequiresRender =\n renderAllFields || !rowLastRenderedPath || rowLastRenderedPath !== rowPath\n\n if (!rowRequiresRender) {\n return\n }\n\n row.lastRenderedPath = rowPath\n\n const blockTypeToMatch: string = row.blockType\n\n const blockConfig =\n req.payload.blocks[blockTypeToMatch] ??\n ((fieldConfig.blockReferences ?? fieldConfig.blocks).find(\n (block) => typeof block !== 'string' && block.slug === blockTypeToMatch,\n ) as FlattenedBlock | undefined)\n\n if (blockConfig.admin?.components && 'Label' in blockConfig.admin.components) {\n if (!fieldState.rows[rowIndex]?.customComponents) {\n fieldState.rows[rowIndex].customComponents = {}\n }\n\n fieldState.rows[rowIndex].customComponents.RowLabel = !mockRSCs\n ? RenderServerComponent({\n clientProps,\n Component: blockConfig.admin.components.Label,\n importMap: req.payload.importMap,\n key: `${rowIndex}`,\n serverProps: {\n ...serverProps,\n blockType: row.blockType,\n rowLabel: `${getTranslation(blockConfig.labels.singular, req.i18n)} ${String(\n rowIndex + 1,\n ).padStart(2, '0')}`,\n rowNumber: rowIndex + 1,\n },\n })\n : 'Mock'\n }\n })\n\n break\n }\n }\n\n if (!requiresRender) {\n return\n }\n\n /**\n * Set the `lastRenderedPath` equal to the new path of the field, this will prevent it from being rendered again\n */\n fieldState.lastRenderedPath = path\n\n if (fieldIsHiddenOrDisabled(clientField)) {\n return\n }\n\n /**\n * Only create the `customComponents` object if needed.\n * This will prevent unnecessary data from being transferred to the client.\n */\n if (fieldConfig.admin) {\n if (\n (Object.keys(fieldConfig.admin.components || {}).length > 0 ||\n fieldConfig.type === 'richText' ||\n ('description' in fieldConfig.admin &&\n typeof fieldConfig.admin.description === 'function')) &&\n !fieldState?.customComponents\n ) {\n fieldState.customComponents = {}\n }\n }\n\n switch (fieldConfig.type) {\n case 'richText': {\n if (!fieldConfig?.editor) {\n throw new MissingEditorProp(fieldConfig) // while we allow disabling editor functionality, you should not have any richText fields defined if you do not have an editor\n }\n\n if (typeof fieldConfig?.editor === 'function') {\n throw new Error('Attempted to access unsanitized rich text editor.')\n }\n\n if (!fieldConfig.admin) {\n fieldConfig.admin = {}\n }\n\n if (!fieldConfig.admin.components) {\n fieldConfig.admin.components = {}\n }\n\n fieldState.customComponents.Field = !mockRSCs ? (\n <WatchCondition path={path}>\n {RenderServerComponent({\n clientProps,\n Component: fieldConfig.editor.FieldComponent,\n importMap: req.payload.importMap,\n serverProps: {\n ...serverProps,\n // Manually inject lexical-specific `sanitizedEditorConfig` server prop, in order to reduce the size of the field schema.\n // Otherwise, the editorConfig would be included twice - once on the top-level, and once as part of the `FieldComponent` server props.\n sanitizedEditorConfig:\n 'editorConfig' in fieldConfig.editor ? fieldConfig.editor.editorConfig : undefined,\n },\n })}\n </WatchCondition>\n ) : (\n 'Mock'\n )\n\n break\n }\n\n case 'ui': {\n if (fieldConfig?.admin?.components) {\n // Render any extra, untyped components\n for (const key in fieldConfig.admin.components) {\n if (key in defaultUIFieldComponentKeys) {\n continue\n }\n\n const Component = fieldConfig.admin.components[key]\n\n fieldState.customComponents[key] = !mockRSCs\n ? RenderServerComponent({\n clientProps,\n Component,\n importMap: req.payload.importMap,\n key: `field.admin.components.${key}`,\n serverProps,\n })\n : 'Mock'\n }\n }\n break\n }\n\n default: {\n break\n }\n }\n\n if (fieldConfig.admin) {\n if (\n 'description' in fieldConfig.admin &&\n typeof fieldConfig.admin?.description === 'function'\n ) {\n fieldState.customComponents.Description = !mockRSCs ? (\n <FieldDescription\n description={fieldConfig.admin?.description({\n i18n: req.i18n,\n t: req.i18n.t,\n })}\n path={path}\n />\n ) : (\n 'Mock'\n )\n }\n\n if (fieldConfig.admin?.components) {\n if ('afterInput' in fieldConfig.admin.components) {\n fieldState.customComponents.AfterInput = !mockRSCs\n ? RenderServerComponent({\n clientProps,\n Component: fieldConfig.admin.components.afterInput,\n importMap: req.payload.importMap,\n key: 'field.admin.components.afterInput',\n serverProps,\n })\n : 'Mock'\n }\n\n if ('beforeInput' in fieldConfig.admin.components) {\n fieldState.customComponents.BeforeInput = !mockRSCs\n ? RenderServerComponent({\n clientProps,\n Component: fieldConfig.admin.components.beforeInput,\n importMap: req.payload.importMap,\n key: 'field.admin.components.beforeInput',\n serverProps,\n })\n : 'Mock'\n }\n\n if ('Description' in fieldConfig.admin.components) {\n fieldState.customComponents.Description = !mockRSCs\n ? RenderServerComponent({\n clientProps,\n Component: fieldConfig.admin.components.Description,\n importMap: req.payload.importMap,\n key: 'field.admin.components.Description',\n serverProps,\n })\n : 'Mock'\n }\n\n if ('Error' in fieldConfig.admin.components) {\n fieldState.customComponents.Error = !mockRSCs\n ? RenderServerComponent({\n clientProps,\n Component: fieldConfig.admin.components.Error,\n importMap: req.payload.importMap,\n key: 'field.admin.components.Error',\n serverProps,\n })\n : 'Mock'\n }\n\n if ('Label' in fieldConfig.admin.components) {\n fieldState.customComponents.Label = !mockRSCs\n ? RenderServerComponent({\n clientProps,\n Component: fieldConfig.admin.components.Label,\n importMap: req.payload.importMap,\n key: 'field.admin.components.Label',\n serverProps,\n })\n : 'Mock'\n }\n\n if ('Field' in fieldConfig.admin.components) {\n fieldState.customComponents.Field = !mockRSCs ? (\n <WatchCondition path={path}>\n {RenderServerComponent({\n clientProps,\n Component: fieldConfig.admin.components.Field,\n importMap: req.payload.importMap,\n key: 'field.admin.components.Field',\n serverProps,\n })}\n </WatchCondition>\n ) : (\n 'Mock'\n )\n }\n }\n }\n}\n"],"mappings":";AAQA,SAASA,cAAc,QAAQ;AAC/B,SAASC,iBAAiB,EAAEC,iBAAiB,QAAQ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A,GACjChB,qBAAA,CAAsB;UACpBwC,WAAA;UACAiB,SAAA,EAAWhD,WAAA,CAAY6C,KAAK,CAACC,UAAU,CAACkB,KAAK;UAC7ClC,SAAA,EAAWb,GAAA,CAAIQ,OAAO,CAACK,SAAS;UAChCmB,GAAA,EAAK;UACLf;QACF,KACA;MACN;MAEA,IAAI,WAAWlC,WAAA,CAAY6C,KAAK,CAACC,UAAU,EAAE;QAC3C5C,UAAA,CAAW8B,gBAAgB,CAACuC,KAAK,GAAG,CAAChE,QAAA,gBACnCiE,IAAA,CAAC/E,cAAA;UAAekB,IAAA,EAAMA,IAAA;oBACnBpB,qBAAA,CAAsB;YACrBwC,WAAA;YACAiB,SAAA,EAAWhD,WAAA,CAAY6C,KAAK,CAACC,UAAU,CAACyB,KAAK;YAC7CzC,SAAA,EAAWb,GAAA,CAAIQ,OAAO,CAACK,SAAS;YAChCmB,GAAA,EAAK;YACLf;UACF;aAGF;MAEJ;IACF;EACF;AACF","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"renderField.js","names":["getTranslation","createClientField","MissingEditorProp","fieldIsHiddenOrDisabled","RenderServerComponent","FieldDescription","WatchCondition","defaultUIFieldComponentKeys","renderField","id","clientFieldSchemaMap","collectionSlug","data","fieldConfig","fieldSchemaMap","fieldState","forceCreateClientField","formState","indexPath","lastRenderedPath","mockRSCs","operation","parentPath","parentSchemaPath","path","permissions","preferences","readOnly","readOnlyFromProps","renderAllFields","req","schemaPath","siblingData","hasBeforeOrAfterInput","admin","components","requiresRender","type","clientField","get","defaultIDType","payload","config","db","field","i18n","importMap","clientProps","customComponents","includes","serverProps","user","value","name","rows","forEach","row","rowIndex","rowLastRenderedPath","rowPath","rowRequiresRender","RowLabel","Component","key","rowLabel","labels","singular","String","padStart","rowNumber","blockTypeToMatch","blockType","blockConfig","blocks","blockReferences","find","block","slug","Label","Object","keys","length","description","editor","Error","Field","_jsx","FieldComponent","sanitizedEditorConfig","editorConfig","undefined","Description","t","AfterInput","afterInput","BeforeInput","beforeInput"],"sources":["../../../src/forms/fieldSchemasToFormState/renderField.tsx"],"sourcesContent":["import type {\n ClientComponentProps,\n ClientField,\n FieldPaths,\n FlattenedBlock,\n ServerComponentProps,\n} from 'payload'\n\nimport { getTranslation } from '@payloadcms/translations'\nimport { createClientField, MissingEditorProp } from 'payload'\nimport { fieldIsHiddenOrDisabled } from 'payload/shared'\n\nimport type { RenderFieldMethod } from './types.js'\n\nimport { RenderServerComponent } from '../../elements/RenderServerComponent/index.js'\n\n// eslint-disable-next-line payload/no-imports-from-exports-dir -- MUST reference the exports dir: https://github.com/payloadcms/payload/issues/12002#issuecomment-2791493587\nimport { FieldDescription, WatchCondition } from '../../exports/client/index.js'\n\nconst defaultUIFieldComponentKeys: Array<'Cell' | 'Description' | 'Field' | 'Filter'> = [\n 'Cell',\n 'Description',\n 'Field',\n 'Filter',\n]\n\nexport const renderField: RenderFieldMethod = ({\n id,\n clientFieldSchemaMap,\n collectionSlug,\n data,\n fieldConfig,\n fieldSchemaMap,\n fieldState,\n forceCreateClientField,\n formState,\n indexPath,\n lastRenderedPath,\n mockRSCs,\n operation,\n parentPath,\n parentSchemaPath,\n path,\n permissions,\n preferences,\n readOnly: readOnlyFromProps,\n renderAllFields,\n req,\n schemaPath,\n siblingData,\n}) => {\n // Fields with beforeInput/afterInput need custom components created, so they require render\n const hasBeforeOrAfterInput =\n fieldConfig.admin?.components &&\n ('beforeInput' in fieldConfig.admin.components || 'afterInput' in fieldConfig.admin.components)\n\n const requiresRender =\n renderAllFields || !lastRenderedPath || lastRenderedPath !== path || hasBeforeOrAfterInput\n\n if (!requiresRender && fieldConfig.type !== 'array' && fieldConfig.type !== 'blocks') {\n return\n }\n\n const clientField =\n clientFieldSchemaMap && !forceCreateClientField\n ? (clientFieldSchemaMap.get(schemaPath) as ClientField)\n : createClientField({\n defaultIDType: req.payload.config.db.defaultIDType,\n field: fieldConfig,\n i18n: req.i18n,\n importMap: req.payload.importMap,\n })\n\n const clientProps: ClientComponentProps & Partial<FieldPaths> = {\n field: clientField,\n path,\n permissions,\n readOnly:\n readOnlyFromProps === true\n ? true\n : typeof permissions === 'boolean'\n ? !permissions\n : !permissions?.[operation],\n schemaPath,\n }\n\n if (fieldState?.customComponents) {\n clientProps.customComponents = fieldState.customComponents\n }\n\n // fields with subfields\n if (['array', 'blocks', 'collapsible', 'group', 'row', 'tabs'].includes(fieldConfig.type)) {\n clientProps.indexPath = indexPath\n clientProps.parentPath = parentPath\n clientProps.parentSchemaPath = parentSchemaPath\n }\n\n const serverProps: ServerComponentProps = {\n id,\n clientField,\n clientFieldSchemaMap,\n data,\n field: fieldConfig,\n fieldSchemaMap,\n permissions,\n // TODO: Should we pass explicit values? initialValue, value, valid\n // value and initialValue should be typed\n collectionSlug,\n formState,\n i18n: req.i18n,\n operation,\n payload: req.payload,\n preferences,\n req,\n siblingData,\n user: req.user,\n value: 'name' in fieldConfig && data?.[fieldConfig.name],\n }\n\n switch (fieldConfig.type) {\n case 'array': {\n fieldState?.rows?.forEach((row, rowIndex) => {\n const rowLastRenderedPath = row.lastRenderedPath\n\n const rowPath = `${path}.${rowIndex}`\n\n const rowRequiresRender =\n renderAllFields || !rowLastRenderedPath || rowLastRenderedPath !== rowPath\n\n if (!rowRequiresRender) {\n return\n }\n\n row.lastRenderedPath = rowPath\n\n if (fieldConfig.admin?.components && 'RowLabel' in fieldConfig.admin.components) {\n if (!row.customComponents) {\n row.customComponents = {}\n }\n\n row.customComponents.RowLabel = !mockRSCs\n ? RenderServerComponent({\n clientProps,\n Component: fieldConfig.admin.components.RowLabel,\n importMap: req.payload.importMap,\n key: `${rowIndex}`,\n serverProps: {\n ...serverProps,\n rowLabel: `${getTranslation(fieldConfig.labels.singular, req.i18n)} ${String(\n rowIndex + 1,\n ).padStart(2, '0')}`,\n rowNumber: rowIndex + 1,\n },\n })\n : 'Mock'\n }\n })\n\n break\n }\n\n case 'blocks': {\n fieldState?.rows?.forEach((row, rowIndex) => {\n const rowLastRenderedPath = row.lastRenderedPath\n\n const rowPath = `${path}.${rowIndex}`\n\n const rowRequiresRender =\n renderAllFields || !rowLastRenderedPath || rowLastRenderedPath !== rowPath\n\n if (!rowRequiresRender) {\n return\n }\n\n row.lastRenderedPath = rowPath\n\n const blockTypeToMatch: string = row.blockType\n\n const blockConfig =\n req.payload.blocks[blockTypeToMatch] ??\n ((fieldConfig.blockReferences ?? fieldConfig.blocks).find(\n (block) => typeof block !== 'string' && block.slug === blockTypeToMatch,\n ) as FlattenedBlock | undefined)\n\n if (blockConfig.admin?.components && 'Label' in blockConfig.admin.components) {\n if (!fieldState.rows[rowIndex]?.customComponents) {\n fieldState.rows[rowIndex].customComponents = {}\n }\n\n fieldState.rows[rowIndex].customComponents.RowLabel = !mockRSCs\n ? RenderServerComponent({\n clientProps,\n Component: blockConfig.admin.components.Label,\n importMap: req.payload.importMap,\n key: `${rowIndex}`,\n serverProps: {\n ...serverProps,\n blockType: row.blockType,\n rowLabel: `${getTranslation(blockConfig.labels.singular, req.i18n)} ${String(\n rowIndex + 1,\n ).padStart(2, '0')}`,\n rowNumber: rowIndex + 1,\n },\n })\n : 'Mock'\n }\n })\n\n break\n }\n }\n\n if (!requiresRender) {\n return\n }\n\n /**\n * Set the `lastRenderedPath` equal to the new path of the field, this will prevent it from being rendered again\n */\n fieldState.lastRenderedPath = path\n\n if (fieldIsHiddenOrDisabled(clientField)) {\n return\n }\n\n /**\n * Only create the `customComponents` object if needed.\n * This will prevent unnecessary data from being transferred to the client.\n */\n if (fieldConfig.admin) {\n if (\n (Object.keys(fieldConfig.admin.components || {}).length > 0 ||\n fieldConfig.type === 'richText' ||\n ('description' in fieldConfig.admin &&\n typeof fieldConfig.admin.description === 'function')) &&\n !fieldState?.customComponents\n ) {\n fieldState.customComponents = {}\n }\n }\n\n switch (fieldConfig.type) {\n case 'richText': {\n if (!fieldConfig?.editor) {\n throw new MissingEditorProp(fieldConfig) // while we allow disabling editor functionality, you should not have any richText fields defined if you do not have an editor\n }\n\n if (typeof fieldConfig?.editor === 'function') {\n throw new Error('Attempted to access unsanitized rich text editor.')\n }\n\n if (!fieldConfig.admin) {\n fieldConfig.admin = {}\n }\n\n if (!fieldConfig.admin.components) {\n fieldConfig.admin.components = {}\n }\n\n fieldState.customComponents.Field = !mockRSCs ? (\n <WatchCondition path={path}>\n {RenderServerComponent({\n clientProps,\n Component: fieldConfig.editor.FieldComponent,\n importMap: req.payload.importMap,\n serverProps: {\n ...serverProps,\n // Manually inject lexical-specific `sanitizedEditorConfig` server prop, in order to reduce the size of the field schema.\n // Otherwise, the editorConfig would be included twice - once on the top-level, and once as part of the `FieldComponent` server props.\n sanitizedEditorConfig:\n 'editorConfig' in fieldConfig.editor ? fieldConfig.editor.editorConfig : undefined,\n },\n })}\n </WatchCondition>\n ) : (\n 'Mock'\n )\n\n break\n }\n\n case 'ui': {\n if (fieldConfig?.admin?.components) {\n // Render any extra, untyped components\n for (const key in fieldConfig.admin.components) {\n if (key in defaultUIFieldComponentKeys) {\n continue\n }\n\n const Component = fieldConfig.admin.components[key]\n\n fieldState.customComponents[key] = !mockRSCs\n ? RenderServerComponent({\n clientProps,\n Component,\n importMap: req.payload.importMap,\n key: `field.admin.components.${key}`,\n serverProps,\n })\n : 'Mock'\n }\n }\n break\n }\n\n default: {\n break\n }\n }\n\n if (fieldConfig.admin) {\n if (\n 'description' in fieldConfig.admin &&\n typeof fieldConfig.admin?.description === 'function'\n ) {\n fieldState.customComponents.Description = !mockRSCs ? (\n <FieldDescription\n description={fieldConfig.admin?.description({\n i18n: req.i18n,\n t: req.i18n.t,\n })}\n path={path}\n />\n ) : (\n 'Mock'\n )\n }\n\n if (fieldConfig.admin?.components) {\n if ('afterInput' in fieldConfig.admin.components) {\n fieldState.customComponents.AfterInput = !mockRSCs\n ? RenderServerComponent({\n clientProps,\n Component: fieldConfig.admin.components.afterInput,\n importMap: req.payload.importMap,\n key: `field.admin.components.afterInput.${path}`,\n serverProps,\n })\n : 'Mock'\n }\n\n if ('beforeInput' in fieldConfig.admin.components) {\n fieldState.customComponents.BeforeInput = !mockRSCs\n ? RenderServerComponent({\n clientProps,\n Component: fieldConfig.admin.components.beforeInput,\n importMap: req.payload.importMap,\n key: `field.admin.components.beforeInput.${path}`,\n serverProps,\n })\n : 'Mock'\n }\n\n if ('Description' in fieldConfig.admin.components) {\n fieldState.customComponents.Description = !mockRSCs\n ? RenderServerComponent({\n clientProps,\n Component: fieldConfig.admin.components.Description,\n importMap: req.payload.importMap,\n key: 'field.admin.components.Description',\n serverProps,\n })\n : 'Mock'\n }\n\n if ('Error' in fieldConfig.admin.components) {\n fieldState.customComponents.Error = !mockRSCs\n ? RenderServerComponent({\n clientProps,\n Component: fieldConfig.admin.components.Error,\n importMap: req.payload.importMap,\n key: 'field.admin.components.Error',\n serverProps,\n })\n : 'Mock'\n }\n\n if ('Label' in fieldConfig.admin.components) {\n fieldState.customComponents.Label = !mockRSCs\n ? RenderServerComponent({\n clientProps,\n Component: fieldConfig.admin.components.Label,\n importMap: req.payload.importMap,\n key: 'field.admin.components.Label',\n serverProps,\n })\n : 'Mock'\n }\n\n if ('Field' in fieldConfig.admin.components) {\n fieldState.customComponents.Field = !mockRSCs ? (\n <WatchCondition path={path}>\n {RenderServerComponent({\n clientProps,\n Component: fieldConfig.admin.components.Field,\n importMap: req.payload.importMap,\n key: 'field.admin.components.Field',\n serverProps,\n })}\n </WatchCondition>\n ) : (\n 'Mock'\n )\n }\n }\n }\n}\n"],"mappings":";AAQA,SAASA,cAAc,QAAQ;AAC/B,SAASC,iBAAiB,EAAEC,iBAAiB,QAAQ;AACrD,SAASC,uBAAuB,QAAQ;AAIxC,SAASC,qBAAqB,QAAQ;AAEtC;AACA,SAASC,gBAAgB,EAAEC,cAAc,QAAQ;AAEjD,MAAMC,2BAAA,GAAkF,CACtF,QACA,eACA,SACA,SACD;AAED,OAAO,MAAMC,WAAA,GAAiCA,CAAC;EAC7CC,EAAE;EACFC,oBAAoB;EACpBC,cAAc;EACdC,IAAI;EACJC,WAAW;EAC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