The form component's `initializing` and `processing` states do not disable fields that are rendered outside of `DocumentFields`. Fields currently rely on the `readOnly` prop provided by `DocumentFields` and do not subscribe to these states for themselves. This means that fields that are rendered outright, such as within the bulk edit drawer, they do not receive a `readOnly` prop and are therefore never disabled. The fix is add a `disabled` property to the `useField` hook. This subscribes to the `initializing` and `processing` states in the same way as `DocumentFields`, however, now each field can determine its own disabled state instead of relying solely on the `readOnly` prop. Adding this new prop has no overhead as `processing` and `initializing` is already being subscribed to within `useField`.
87 lines
3.7 KiB
JSON
87 lines
3.7 KiB
JSON
{
|
|
"compilerOptions": {
|
|
/* Strictness */
|
|
"strict": true,
|
|
"noUncheckedIndexedAccess": true,
|
|
"noImplicitOverride": true,
|
|
"composite": true,
|
|
"declaration": true,
|
|
"declarationMap": true,
|
|
"target": "ES2022",
|
|
"rootDir": "${configDir}/src",
|
|
"module": "NodeNext",
|
|
"moduleResolution": "NodeNext",
|
|
"allowJs": true,
|
|
"checkJs": false,
|
|
"esModuleInterop": true,
|
|
"forceConsistentCasingInFileNames": true,
|
|
"jsx": "preserve",
|
|
"lib": ["DOM", "DOM.Iterable", "ES2022"],
|
|
"outDir": "${configDir}/dist",
|
|
"resolveJsonModule": true,
|
|
"skipLibCheck": true,
|
|
"emitDeclarationOnly": true,
|
|
"sourceMap": true,
|
|
"types": ["jest", "node", "@types/jest"],
|
|
"incremental": true,
|
|
"isolatedModules": true,
|
|
"plugins": [
|
|
{
|
|
"name": "next"
|
|
}
|
|
],
|
|
"paths": {
|
|
"@payload-config": ["./test/form-state/config.ts"],
|
|
"@payloadcms/admin-bar": ["./packages/admin-bar/src"],
|
|
"@payloadcms/live-preview": ["./packages/live-preview/src"],
|
|
"@payloadcms/live-preview-react": ["./packages/live-preview-react/src/index.ts"],
|
|
"@payloadcms/live-preview-vue": ["./packages/live-preview-vue/src/index.ts"],
|
|
"@payloadcms/ui": ["./packages/ui/src/exports/client/index.ts"],
|
|
"@payloadcms/ui/shared": ["./packages/ui/src/exports/shared/index.ts"],
|
|
"@payloadcms/ui/scss": ["./packages/ui/src/scss.scss"],
|
|
"@payloadcms/ui/scss/app.scss": ["./packages/ui/src/scss/app.scss"],
|
|
"@payloadcms/next/*": ["./packages/next/src/exports/*.ts"],
|
|
"@payloadcms/richtext-lexical/client": [
|
|
"./packages/richtext-lexical/src/exports/client/index.ts"
|
|
],
|
|
"@payloadcms/richtext-lexical/rsc": ["./packages/richtext-lexical/src/exports/server/rsc.ts"],
|
|
"@payloadcms/richtext-slate/rsc": ["./packages/richtext-slate/src/exports/server/rsc.ts"],
|
|
"@payloadcms/richtext-slate/client": [
|
|
"./packages/richtext-slate/src/exports/client/index.ts"
|
|
],
|
|
"@payloadcms/plugin-seo/client": ["./packages/plugin-seo/src/exports/client.ts"],
|
|
"@payloadcms/plugin-sentry/client": ["./packages/plugin-sentry/src/exports/client.ts"],
|
|
"@payloadcms/plugin-stripe/client": ["./packages/plugin-stripe/src/exports/client.ts"],
|
|
"@payloadcms/plugin-search/client": ["./packages/plugin-search/src/exports/client.ts"],
|
|
"@payloadcms/plugin-form-builder/client": [
|
|
"./packages/plugin-form-builder/src/exports/client.ts"
|
|
],
|
|
"@payloadcms/plugin-import-export/rsc": [
|
|
"./packages/plugin-import-export/src/exports/rsc.ts"
|
|
],
|
|
"@payloadcms/plugin-multi-tenant/rsc": ["./packages/plugin-multi-tenant/src/exports/rsc.ts"],
|
|
"@payloadcms/plugin-multi-tenant/utilities": [
|
|
"./packages/plugin-multi-tenant/src/exports/utilities.ts"
|
|
],
|
|
"@payloadcms/plugin-multi-tenant/fields": [
|
|
"./packages/plugin-multi-tenant/src/exports/fields.ts"
|
|
],
|
|
"@payloadcms/plugin-multi-tenant/client": [
|
|
"./packages/plugin-multi-tenant/src/exports/client.ts"
|
|
],
|
|
"@payloadcms/plugin-multi-tenant": ["./packages/plugin-multi-tenant/src/index.ts"],
|
|
"@payloadcms/next": ["./packages/next/src/exports/*"],
|
|
"@payloadcms/storage-s3/client": ["./packages/storage-s3/src/exports/client.ts"],
|
|
"@payloadcms/storage-vercel-blob/client": [
|
|
"./packages/storage-vercel-blob/src/exports/client.ts"
|
|
],
|
|
"@payloadcms/storage-gcs/client": ["./packages/storage-gcs/src/exports/client.ts"],
|
|
"@payloadcms/storage-uploadthing/client": [
|
|
"./packages/storage-uploadthing/src/exports/client.ts"
|
|
]
|
|
}
|
|
},
|
|
"include": ["${configDir}/src"],
|
|
"exclude": ["${configDir}/dist", "${configDir}/build", "${configDir}/temp", "**/*.spec.ts"]
|
|
}
|