@payloadcms/ui 3.0.0-beta.7 → 3.0.0-canary.6041f49
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/elements/ArrayAction/index.d.ts +1 -0
- package/dist/elements/ArrayAction/index.d.ts.map +1 -1
- package/dist/elements/ArrayAction/index.js +3 -3
- package/dist/elements/ArrayAction/index.js.map +1 -1
- package/dist/elements/Autosave/index.d.ts.map +1 -1
- package/dist/elements/Autosave/index.js +15 -3
- package/dist/elements/Autosave/index.js.map +1 -1
- package/dist/elements/ColumnSelector/index.d.ts.map +1 -1
- package/dist/elements/ColumnSelector/index.js +8 -2
- package/dist/elements/ColumnSelector/index.js.map +1 -1
- package/dist/elements/DocumentControls/index.js +1 -1
- package/dist/elements/DocumentControls/index.js.map +1 -1
- package/dist/elements/DocumentControls/index.scss +2 -2
- package/dist/elements/DocumentDrawer/DrawerContent.d.ts.map +1 -1
- package/dist/elements/DocumentDrawer/DrawerContent.js +7 -7
- package/dist/elements/DocumentDrawer/DrawerContent.js.map +1 -1
- package/dist/elements/DocumentFields/index.js +1 -1
- package/dist/elements/DocumentFields/index.js.map +1 -1
- package/dist/elements/DocumentHeader/Tabs/Tab/index.d.ts.map +1 -1
- package/dist/elements/DocumentHeader/Tabs/Tab/index.js +3 -2
- package/dist/elements/DocumentHeader/Tabs/Tab/index.js.map +1 -1
- package/dist/elements/DocumentHeader/Tabs/index.d.ts +2 -0
- package/dist/elements/DocumentHeader/Tabs/index.d.ts.map +1 -1
- package/dist/elements/DocumentHeader/Tabs/index.js +3 -2
- package/dist/elements/DocumentHeader/Tabs/index.js.map +1 -1
- package/dist/elements/DocumentHeader/Tabs/tabs/index.d.ts.map +1 -1
- package/dist/elements/DocumentHeader/Tabs/tabs/index.js +1 -1
- package/dist/elements/DocumentHeader/Tabs/tabs/index.js.map +1 -1
- package/dist/elements/DocumentHeader/index.d.ts +2 -0
- package/dist/elements/DocumentHeader/index.d.ts.map +1 -1
- package/dist/elements/DocumentHeader/index.js +3 -2
- package/dist/elements/DocumentHeader/index.js.map +1 -1
- package/dist/elements/EditMany/index.js +2 -2
- package/dist/elements/EditMany/index.js.map +1 -1
- package/dist/elements/EditUpload/index.d.ts +12 -0
- package/dist/elements/EditUpload/index.d.ts.map +1 -1
- package/dist/elements/EditUpload/index.js +25 -25
- package/dist/elements/EditUpload/index.js.map +1 -1
- package/dist/elements/FieldSelect/index.d.ts.map +1 -1
- package/dist/elements/FieldSelect/index.js +4 -1
- package/dist/elements/FieldSelect/index.js.map +1 -1
- package/dist/elements/HydrateClientUser/index.d.ts +2 -2
- package/dist/elements/HydrateClientUser/index.d.ts.map +1 -1
- package/dist/elements/HydrateClientUser/index.js.map +1 -1
- package/dist/elements/ListControls/index.d.ts.map +1 -1
- package/dist/elements/ListControls/index.js +16 -3
- package/dist/elements/ListControls/index.js.map +1 -1
- package/dist/elements/PublishMany/index.js +1 -1
- package/dist/elements/PublishMany/index.js.map +1 -1
- package/dist/elements/ReactSelect/index.d.ts.map +1 -1
- package/dist/elements/ReactSelect/index.js +4 -1
- package/dist/elements/ReactSelect/index.js.map +1 -1
- package/dist/elements/Save/index.d.ts.map +1 -1
- package/dist/elements/Save/index.js +7 -1
- package/dist/elements/Save/index.js.map +1 -1
- package/dist/elements/SaveDraft/index.d.ts.map +1 -1
- package/dist/elements/SaveDraft/index.js +8 -5
- package/dist/elements/SaveDraft/index.js.map +1 -1
- package/dist/elements/StayLoggedIn/index.d.ts +2 -4
- package/dist/elements/StayLoggedIn/index.d.ts.map +1 -1
- package/dist/elements/StayLoggedIn/index.js +7 -6
- package/dist/elements/StayLoggedIn/index.js.map +1 -1
- package/dist/elements/StayLoggedIn/index.scss +1 -1
- package/dist/elements/Table/DefaultCell/fields/Checkbox/index.d.ts.map +1 -1
- package/dist/elements/Table/DefaultCell/fields/Checkbox/index.js +6 -2
- package/dist/elements/Table/DefaultCell/fields/Checkbox/index.js.map +1 -1
- package/dist/elements/Table/DefaultCell/fields/JSON/index.js +1 -1
- package/dist/elements/Table/DefaultCell/fields/JSON/index.js.map +1 -1
- package/dist/elements/Table/DefaultCell/index.d.ts.map +1 -1
- package/dist/elements/Table/DefaultCell/index.js +1 -1
- package/dist/elements/Table/DefaultCell/index.js.map +1 -1
- package/dist/elements/Table/index.d.ts +1 -0
- package/dist/elements/Table/index.d.ts.map +1 -1
- package/dist/elements/Table/index.js.map +1 -1
- package/dist/elements/TableColumns/buildColumnState.d.ts.map +1 -1
- package/dist/elements/TableColumns/buildColumnState.js +7 -1
- package/dist/elements/TableColumns/buildColumnState.js.map +1 -1
- package/dist/elements/Upload/index.d.ts.map +1 -1
- package/dist/elements/Upload/index.js +37 -1
- package/dist/elements/Upload/index.js.map +1 -1
- package/dist/elements/Upload/index.scss +12 -1
- package/dist/elements/WhereBuilder/reduceFieldMap.d.ts.map +1 -1
- package/dist/elements/WhereBuilder/reduceFieldMap.js +1 -0
- package/dist/elements/WhereBuilder/reduceFieldMap.js.map +1 -1
- package/dist/{providers/ComponentMap/buildComponentMap/WithServerSideProps.d.ts → elements/WithServerSideProps/index.d.ts} +1 -1
- package/dist/elements/WithServerSideProps/index.d.ts.map +1 -0
- package/dist/{providers/ComponentMap/buildComponentMap/WithServerSideProps.js → elements/WithServerSideProps/index.js} +3 -3
- package/dist/elements/WithServerSideProps/index.js.map +1 -0
- package/dist/exports/elements.d.ts +3 -2
- package/dist/exports/elements.d.ts.map +1 -1
- package/dist/exports/elements.js +5 -2
- package/dist/exports/elements.js.map +1 -1
- package/dist/exports/fields.d.ts +2 -0
- package/dist/exports/fields.d.ts.map +1 -0
- package/dist/exports/fields.js +3 -0
- package/dist/exports/fields.js.map +1 -0
- package/dist/exports/providers.d.ts +2 -0
- package/dist/exports/providers.d.ts.map +1 -0
- package/dist/exports/providers.js +3 -0
- package/dist/exports/providers.js.map +1 -0
- package/dist/fields/Array/ArrayRow.d.ts +1 -0
- package/dist/fields/Array/ArrayRow.d.ts.map +1 -1
- package/dist/fields/Array/ArrayRow.js +4 -3
- package/dist/fields/Array/ArrayRow.js.map +1 -1
- package/dist/fields/Array/index.d.ts +1 -2
- package/dist/fields/Array/index.d.ts.map +1 -1
- package/dist/fields/Array/index.js +4 -3
- package/dist/fields/Array/index.js.map +1 -1
- package/dist/fields/Blocks/BlockRow.d.ts +1 -0
- package/dist/fields/Blocks/BlockRow.d.ts.map +1 -1
- package/dist/fields/Blocks/BlockRow.js +4 -3
- package/dist/fields/Blocks/BlockRow.js.map +1 -1
- package/dist/fields/Blocks/RowActions.d.ts +1 -0
- package/dist/fields/Blocks/RowActions.d.ts.map +1 -1
- package/dist/fields/Blocks/RowActions.js +2 -1
- package/dist/fields/Blocks/RowActions.js.map +1 -1
- package/dist/fields/Blocks/index.d.ts +2 -2
- package/dist/fields/Blocks/index.d.ts.map +1 -1
- package/dist/fields/Blocks/index.js +3 -2
- package/dist/fields/Blocks/index.js.map +1 -1
- package/dist/fields/Checkbox/Input.d.ts +3 -3
- package/dist/fields/Checkbox/Input.d.ts.map +1 -1
- package/dist/fields/Checkbox/Input.js.map +1 -1
- package/dist/fields/Checkbox/index.d.ts.map +1 -1
- package/dist/fields/Checkbox/index.js +3 -1
- package/dist/fields/Checkbox/index.js.map +1 -1
- package/dist/fields/Checkbox/types.d.ts +0 -2
- package/dist/fields/Checkbox/types.d.ts.map +1 -1
- package/dist/fields/Checkbox/types.js.map +1 -1
- package/dist/fields/Code/index.d.ts +1 -2
- package/dist/fields/Code/index.d.ts.map +1 -1
- package/dist/fields/Code/index.js.map +1 -1
- package/dist/fields/Collapsible/index.d.ts +0 -2
- package/dist/fields/Collapsible/index.d.ts.map +1 -1
- package/dist/fields/Collapsible/index.js +2 -2
- package/dist/fields/Collapsible/index.js.map +1 -1
- package/dist/fields/ConfirmPassword/index.js +1 -1
- package/dist/fields/ConfirmPassword/index.js.map +1 -1
- package/dist/fields/DateTime/index.d.ts +1 -2
- package/dist/fields/DateTime/index.d.ts.map +1 -1
- package/dist/fields/DateTime/index.js.map +1 -1
- package/dist/fields/Email/index.d.ts +1 -2
- package/dist/fields/Email/index.d.ts.map +1 -1
- package/dist/fields/Email/index.js.map +1 -1
- package/dist/fields/Group/index.d.ts +0 -2
- package/dist/fields/Group/index.d.ts.map +1 -1
- package/dist/fields/Group/index.js +3 -3
- package/dist/fields/Group/index.js.map +1 -1
- package/dist/fields/JSON/index.d.ts +2 -2
- package/dist/fields/JSON/index.d.ts.map +1 -1
- package/dist/fields/JSON/index.js +20 -1
- package/dist/fields/JSON/index.js.map +1 -1
- package/dist/fields/Number/index.d.ts +1 -2
- package/dist/fields/Number/index.d.ts.map +1 -1
- package/dist/fields/Number/index.js.map +1 -1
- package/dist/fields/Password/index.d.ts +0 -1
- package/dist/fields/Password/index.d.ts.map +1 -1
- package/dist/fields/Password/index.js.map +1 -1
- package/dist/fields/Point/index.d.ts +0 -2
- package/dist/fields/Point/index.d.ts.map +1 -1
- package/dist/fields/Point/index.js +2 -2
- package/dist/fields/Point/index.js.map +1 -1
- package/dist/fields/RadioGroup/Radio/index.d.ts.map +1 -1
- package/dist/fields/RadioGroup/Radio/index.js +3 -1
- package/dist/fields/RadioGroup/Radio/index.js.map +1 -1
- package/dist/fields/RadioGroup/index.d.ts +1 -2
- package/dist/fields/RadioGroup/index.d.ts.map +1 -1
- package/dist/fields/RadioGroup/index.js.map +1 -1
- package/dist/fields/Relationship/types.d.ts +1 -2
- package/dist/fields/Relationship/types.d.ts.map +1 -1
- package/dist/fields/Relationship/types.js.map +1 -1
- package/dist/fields/RichText/index.d.ts +0 -2
- package/dist/fields/RichText/index.d.ts.map +1 -1
- package/dist/fields/RichText/index.js.map +1 -1
- package/dist/fields/Select/index.d.ts +1 -2
- package/dist/fields/Select/index.d.ts.map +1 -1
- package/dist/fields/Select/index.js.map +1 -1
- package/dist/fields/Text/index.d.ts.map +1 -1
- package/dist/fields/Text/index.js +2 -1
- package/dist/fields/Text/index.js.map +1 -1
- package/dist/fields/Text/types.d.ts +1 -2
- package/dist/fields/Text/types.d.ts.map +1 -1
- package/dist/fields/Text/types.js.map +1 -1
- package/dist/fields/Textarea/index.d.ts.map +1 -1
- package/dist/fields/Textarea/index.js +2 -1
- package/dist/fields/Textarea/index.js.map +1 -1
- package/dist/fields/Textarea/types.d.ts +1 -2
- package/dist/fields/Textarea/types.d.ts.map +1 -1
- package/dist/fields/Textarea/types.js.map +1 -1
- package/dist/fields/Upload/types.d.ts +0 -1
- package/dist/fields/Upload/types.d.ts.map +1 -1
- package/dist/fields/Upload/types.js.map +1 -1
- package/dist/fields/shared/index.d.ts +4 -2
- package/dist/fields/shared/index.d.ts.map +1 -1
- package/dist/fields/shared/index.js.map +1 -1
- package/dist/forms/FieldLabel/index.d.ts.map +1 -1
- package/dist/forms/FieldLabel/index.js +3 -1
- package/dist/forms/FieldLabel/index.js.map +1 -1
- package/dist/forms/FieldPropsProvider/index.d.ts +2 -0
- package/dist/forms/FieldPropsProvider/index.d.ts.map +1 -1
- package/dist/forms/FieldPropsProvider/index.js +5 -3
- package/dist/forms/FieldPropsProvider/index.js.map +1 -1
- package/dist/forms/RenderFields/RenderField.d.ts +1 -0
- package/dist/forms/RenderFields/RenderField.d.ts.map +1 -1
- package/dist/forms/RenderFields/RenderField.js +2 -1
- package/dist/forms/RenderFields/RenderField.js.map +1 -1
- package/dist/forms/RenderFields/index.d.ts.map +1 -1
- package/dist/forms/RenderFields/index.js +2 -1
- package/dist/forms/RenderFields/index.js.map +1 -1
- package/dist/forms/RowLabel/types.d.ts +2 -3
- package/dist/forms/RowLabel/types.d.ts.map +1 -1
- package/dist/forms/RowLabel/types.js +1 -4
- package/dist/forms/RowLabel/types.js.map +1 -1
- package/dist/forms/buildStateFromSchema/addFieldStatePromise.d.ts +3 -5
- package/dist/forms/buildStateFromSchema/addFieldStatePromise.d.ts.map +1 -1
- package/dist/forms/buildStateFromSchema/addFieldStatePromise.js +2 -1
- package/dist/forms/buildStateFromSchema/addFieldStatePromise.js.map +1 -1
- package/dist/forms/buildStateFromSchema/calculateDefaultValues/index.d.ts +2 -2
- package/dist/forms/buildStateFromSchema/calculateDefaultValues/index.d.ts.map +1 -1
- package/dist/forms/buildStateFromSchema/calculateDefaultValues/index.js.map +1 -1
- package/dist/forms/buildStateFromSchema/calculateDefaultValues/iterateFields.d.ts +2 -2
- package/dist/forms/buildStateFromSchema/calculateDefaultValues/iterateFields.d.ts.map +1 -1
- package/dist/forms/buildStateFromSchema/calculateDefaultValues/iterateFields.js.map +1 -1
- package/dist/forms/buildStateFromSchema/calculateDefaultValues/promise.d.ts +2 -2
- package/dist/forms/buildStateFromSchema/calculateDefaultValues/promise.d.ts.map +1 -1
- package/dist/forms/buildStateFromSchema/calculateDefaultValues/promise.js +1 -0
- package/dist/forms/buildStateFromSchema/calculateDefaultValues/promise.js.map +1 -1
- package/dist/forms/buildStateFromSchema/index.d.ts +3 -5
- package/dist/forms/buildStateFromSchema/index.d.ts.map +1 -1
- package/dist/forms/buildStateFromSchema/index.js.map +1 -1
- package/dist/forms/buildStateFromSchema/iterateFields.d.ts +3 -5
- package/dist/forms/buildStateFromSchema/iterateFields.d.ts.map +1 -1
- package/dist/forms/buildStateFromSchema/iterateFields.js.map +1 -1
- package/dist/forms/useField/index.d.ts.map +1 -1
- package/dist/forms/useField/index.js +3 -1
- package/dist/forms/useField/index.js.map +1 -1
- package/dist/graphics/Account/index.js +0 -9
- package/dist/graphics/Account/index.js.map +1 -1
- package/dist/providers/Auth/index.d.ts.map +1 -1
- package/dist/providers/Auth/index.js +2 -1
- package/dist/providers/Auth/index.js.map +1 -1
- package/dist/providers/ComponentMap/buildComponentMap/collections.d.ts +1 -1
- package/dist/providers/ComponentMap/buildComponentMap/collections.d.ts.map +1 -1
- package/dist/providers/ComponentMap/buildComponentMap/collections.js +16 -4
- package/dist/providers/ComponentMap/buildComponentMap/collections.js.map +1 -1
- package/dist/providers/ComponentMap/buildComponentMap/fields.d.ts.map +1 -1
- package/dist/providers/ComponentMap/buildComponentMap/fields.js +52 -36
- package/dist/providers/ComponentMap/buildComponentMap/fields.js.map +1 -1
- package/dist/providers/ComponentMap/buildComponentMap/globals.d.ts +1 -1
- package/dist/providers/ComponentMap/buildComponentMap/globals.d.ts.map +1 -1
- package/dist/providers/ComponentMap/buildComponentMap/globals.js +16 -4
- package/dist/providers/ComponentMap/buildComponentMap/globals.js.map +1 -1
- package/dist/providers/ComponentMap/buildComponentMap/index.js +1 -1
- package/dist/providers/ComponentMap/buildComponentMap/index.js.map +1 -1
- package/dist/providers/ComponentMap/buildComponentMap/types.d.ts +4 -0
- package/dist/providers/ComponentMap/buildComponentMap/types.d.ts.map +1 -1
- package/dist/providers/ComponentMap/buildComponentMap/types.js.map +1 -1
- package/dist/providers/ComponentMap/index.d.ts +0 -1
- package/dist/providers/ComponentMap/index.d.ts.map +1 -1
- package/dist/providers/ComponentMap/index.js +0 -1
- package/dist/providers/ComponentMap/index.js.map +1 -1
- package/dist/providers/DocumentInfo/index.js +8 -7
- package/dist/providers/DocumentInfo/index.js.map +1 -1
- package/dist/providers/EntityVisibility/index.d.ts +1 -1
- package/dist/providers/EntityVisibility/index.d.ts.map +1 -1
- package/dist/providers/EntityVisibility/index.js.map +1 -1
- package/dist/providers/Root/index.d.ts.map +1 -1
- package/dist/providers/Root/index.js +2 -1
- package/dist/providers/Root/index.js.map +1 -1
- package/dist/utilities/generateFieldID.d.ts +1 -1
- package/dist/utilities/generateFieldID.d.ts.map +1 -1
- package/dist/utilities/generateFieldID.js +2 -2
- package/dist/utilities/generateFieldID.js.map +1 -1
- package/package.json +32 -31
- package/dist/providers/ComponentMap/buildComponentMap/WithServerSideProps.d.ts.map +0 -1
- package/dist/providers/ComponentMap/buildComponentMap/WithServerSideProps.js.map +0 -1
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { TextField } from 'payload/types';
|
|
2
2
|
import type { ChangeEvent } from 'react';
|
|
3
3
|
import type { Option } from '../../elements/ReactSelect/types.js';
|
|
4
4
|
import type { FormFieldBase } from '../shared/index.js';
|
|
5
5
|
export type TextFieldProps = FormFieldBase & {
|
|
6
6
|
hasMany?: boolean;
|
|
7
7
|
inputRef?: React.MutableRefObject<HTMLInputElement>;
|
|
8
|
-
label?: FieldBase['label'];
|
|
9
8
|
maxLength?: number;
|
|
10
9
|
maxRows?: number;
|
|
11
10
|
minLength?: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/fields/Text/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/fields/Text/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAC9C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,OAAO,CAAA;AAExC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qCAAqC,CAAA;AACjE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAEvD,MAAM,MAAM,cAAc,GAAG,aAAa,GAAG;IAC3C,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,QAAQ,CAAC,EAAE,KAAK,CAAC,gBAAgB,CAAC,gBAAgB,CAAC,CAAA;IACnD,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,SAAS,CAAC,EAAE,KAAK,CAAC,oBAAoB,CAAC,gBAAgB,CAAC,CAAA;IACxD,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,WAAW,CAAC,EAAE,SAAS,CAAC,OAAO,CAAC,CAAC,aAAa,CAAC,CAAA;IAC/C,KAAK,CAAC,EAAE,MAAM,CAAA;CACf,CAAA;AAED,MAAM,MAAM,cAAc,GAAG,IAAI,CAAC,cAAc,EAAE,MAAM,CAAC,GAAG;IAC1D,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,QAAQ,CAAC,EAAE,KAAK,CAAC,gBAAgB,CAAC,gBAAgB,CAAC,CAAA;IACnD,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,QAAQ,CAAC,EAAE,CAAC,CAAC,EAAE,WAAW,CAAC,gBAAgB,CAAC,KAAK,IAAI,CAAA;IACrD,SAAS,CAAC,EAAE,KAAK,CAAC,oBAAoB,CAAC,gBAAgB,CAAC,CAAA;IACxD,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,aAAa,CAAC,EAAE,MAAM,EAAE,CAAA;CACzB,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/fields/Text/types.ts"],"sourcesContent":["import type {
|
|
1
|
+
{"version":3,"sources":["../../../src/fields/Text/types.ts"],"sourcesContent":["import type { TextField } from 'payload/types'\nimport type { ChangeEvent } from 'react'\n\nimport type { Option } from '../../elements/ReactSelect/types.js'\nimport type { FormFieldBase } from '../shared/index.js'\n\nexport type TextFieldProps = FormFieldBase & {\n hasMany?: boolean\n inputRef?: React.MutableRefObject<HTMLInputElement>\n maxLength?: number\n maxRows?: number\n minLength?: number\n minRows?: number\n name?: string\n onKeyDown?: React.KeyboardEventHandler<HTMLInputElement>\n path?: string\n placeholder?: TextField['admin']['placeholder']\n width?: string\n}\n\nexport type TextInputProps = Omit<TextFieldProps, 'type'> & {\n hasMany?: boolean\n inputRef?: React.MutableRefObject<HTMLInputElement>\n maxRows?: number\n minRows?: number\n onChange?: (e: ChangeEvent<HTMLInputElement>) => void\n onKeyDown?: React.KeyboardEventHandler<HTMLInputElement>\n showError?: boolean\n value?: string\n valueToRender?: Option[]\n}\n"],"names":[],"rangeMappings":"","mappings":"AAoBA,WAUC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/fields/Textarea/index.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAsB,MAAM,OAAO,CAAA;AAE1C,OAAO,KAAK,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAA;AAOxE,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAA;AAC1C,OAAO,cAAc,CAAA;AAErB,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,aAAa,EAAE,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/fields/Textarea/index.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAsB,MAAM,OAAO,CAAA;AAE1C,OAAO,KAAK,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAA;AAOxE,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAA;AAC1C,OAAO,cAAc,CAAA;AAErB,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,aAAa,EAAE,CAAA;AAsFhE,eAAO,MAAM,QAAQ,8BAA+B,CAAA"}
|
|
@@ -10,7 +10,7 @@ import { isFieldRTL } from '../shared/index.js';
|
|
|
10
10
|
import { TextareaInput } from './Input.js';
|
|
11
11
|
export { TextareaInput };
|
|
12
12
|
const TextareaField = (props)=>{
|
|
13
|
-
const { name, AfterInput, BeforeInput, CustomDescription, CustomError, CustomLabel, className, descriptionProps, errorProps, labelProps, locale, localized, maxLength, minLength, path: pathFromProps, placeholder, readOnly: readOnlyFromProps, required, rows, rtl, style, validate, width } = props;
|
|
13
|
+
const { name, AfterInput, BeforeInput, CustomDescription, CustomError, CustomLabel, className, descriptionProps, errorProps, label, labelProps, locale, localized, maxLength, minLength, path: pathFromProps, placeholder, readOnly: readOnlyFromProps, required, rows, rtl, style, validate, width } = props;
|
|
14
14
|
const { i18n } = useTranslation();
|
|
15
15
|
const { localization } = useConfig();
|
|
16
16
|
const isRTL = isFieldRTL({
|
|
@@ -47,6 +47,7 @@ const TextareaField = (props)=>{
|
|
|
47
47
|
className: className,
|
|
48
48
|
descriptionProps: descriptionProps,
|
|
49
49
|
errorProps: errorProps,
|
|
50
|
+
label: label,
|
|
50
51
|
labelProps: labelProps,
|
|
51
52
|
onChange: (e)=>{
|
|
52
53
|
setValue(e.target.value);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/fields/Textarea/index.tsx"],"sourcesContent":["/* eslint-disable react/destructuring-assignment */\n'use client'\nimport type { ClientValidate } from 'payload/types'\n\nimport { getTranslation } from '@payloadcms/translations'\nimport { useFieldProps } from '@payloadcms/ui/forms/FieldPropsProvider'\nimport React, { useCallback } from 'react'\n\nimport type { TextAreaInputProps, TextareaFieldProps } from './types.js'\n\nimport { useField } from '../../forms/useField/index.js'\nimport { withCondition } from '../../forms/withCondition/index.js'\nimport { useConfig } from '../../providers/Config/index.js'\nimport { useTranslation } from '../../providers/Translation/index.js'\nimport { isFieldRTL } from '../shared/index.js'\nimport { TextareaInput } from './Input.js'\nimport './index.scss'\n\nexport { TextAreaInputProps, TextareaFieldProps, TextareaInput }\n\nconst TextareaField: React.FC<TextareaFieldProps> = (props) => {\n const {\n name,\n AfterInput,\n BeforeInput,\n CustomDescription,\n CustomError,\n CustomLabel,\n className,\n descriptionProps,\n errorProps,\n labelProps,\n locale,\n localized,\n maxLength,\n minLength,\n path: pathFromProps,\n placeholder,\n readOnly: readOnlyFromProps,\n required,\n rows,\n rtl,\n style,\n validate,\n width,\n } = props\n\n const { i18n } = useTranslation()\n\n const { localization } = useConfig()\n\n const isRTL = isFieldRTL({\n fieldLocalized: localized,\n fieldRTL: rtl,\n locale,\n localizationConfig: localization || undefined,\n })\n\n const memoizedValidate: ClientValidate = useCallback(\n (value, options) => {\n if (typeof validate === 'function')\n return validate(value, { ...options, maxLength, minLength, required })\n },\n [validate, required, maxLength, minLength],\n )\n\n const { path: pathFromContext, readOnly: readOnlyFromContext } = useFieldProps()\n const readOnly = readOnlyFromProps || readOnlyFromContext\n\n const { path, setValue, showError, value } = useField<string>({\n path: pathFromContext || pathFromProps || name,\n validate: memoizedValidate,\n })\n\n return (\n <TextareaInput\n AfterInput={AfterInput}\n BeforeInput={BeforeInput}\n CustomDescription={CustomDescription}\n CustomError={CustomError}\n CustomLabel={CustomLabel}\n className={className}\n descriptionProps={descriptionProps}\n errorProps={errorProps}\n labelProps={labelProps}\n onChange={(e) => {\n setValue(e.target.value)\n }}\n path={path}\n placeholder={getTranslation(placeholder, i18n)}\n readOnly={readOnly}\n required={required}\n rows={rows}\n rtl={isRTL}\n showError={showError}\n style={style}\n value={value}\n width={width}\n />\n )\n}\n\nexport const Textarea = withCondition(TextareaField)\n"],"names":["getTranslation","useFieldProps","React","useCallback","useField","withCondition","useConfig","useTranslation","isFieldRTL","TextareaInput","TextareaField","props","name","AfterInput","BeforeInput","CustomDescription","CustomError","CustomLabel","className","descriptionProps","errorProps","labelProps","locale","localized","maxLength","minLength","path","pathFromProps","placeholder","readOnly","readOnlyFromProps","required","rows","rtl","style","validate","width","i18n","localization","isRTL","fieldLocalized","fieldRTL","localizationConfig","undefined","memoizedValidate","value","options","pathFromContext","readOnlyFromContext","setValue","showError","onChange","e","target","Textarea"],"rangeMappings":"
|
|
1
|
+
{"version":3,"sources":["../../../src/fields/Textarea/index.tsx"],"sourcesContent":["/* eslint-disable react/destructuring-assignment */\n'use client'\nimport type { ClientValidate } from 'payload/types'\n\nimport { getTranslation } from '@payloadcms/translations'\nimport { useFieldProps } from '@payloadcms/ui/forms/FieldPropsProvider'\nimport React, { useCallback } from 'react'\n\nimport type { TextAreaInputProps, TextareaFieldProps } from './types.js'\n\nimport { useField } from '../../forms/useField/index.js'\nimport { withCondition } from '../../forms/withCondition/index.js'\nimport { useConfig } from '../../providers/Config/index.js'\nimport { useTranslation } from '../../providers/Translation/index.js'\nimport { isFieldRTL } from '../shared/index.js'\nimport { TextareaInput } from './Input.js'\nimport './index.scss'\n\nexport { TextAreaInputProps, TextareaFieldProps, TextareaInput }\n\nconst TextareaField: React.FC<TextareaFieldProps> = (props) => {\n const {\n name,\n AfterInput,\n BeforeInput,\n CustomDescription,\n CustomError,\n CustomLabel,\n className,\n descriptionProps,\n errorProps,\n label,\n labelProps,\n locale,\n localized,\n maxLength,\n minLength,\n path: pathFromProps,\n placeholder,\n readOnly: readOnlyFromProps,\n required,\n rows,\n rtl,\n style,\n validate,\n width,\n } = props\n\n const { i18n } = useTranslation()\n\n const { localization } = useConfig()\n\n const isRTL = isFieldRTL({\n fieldLocalized: localized,\n fieldRTL: rtl,\n locale,\n localizationConfig: localization || undefined,\n })\n\n const memoizedValidate: ClientValidate = useCallback(\n (value, options) => {\n if (typeof validate === 'function')\n return validate(value, { ...options, maxLength, minLength, required })\n },\n [validate, required, maxLength, minLength],\n )\n\n const { path: pathFromContext, readOnly: readOnlyFromContext } = useFieldProps()\n const readOnly = readOnlyFromProps || readOnlyFromContext\n\n const { path, setValue, showError, value } = useField<string>({\n path: pathFromContext || pathFromProps || name,\n validate: memoizedValidate,\n })\n\n return (\n <TextareaInput\n AfterInput={AfterInput}\n BeforeInput={BeforeInput}\n CustomDescription={CustomDescription}\n CustomError={CustomError}\n CustomLabel={CustomLabel}\n className={className}\n descriptionProps={descriptionProps}\n errorProps={errorProps}\n label={label}\n labelProps={labelProps}\n onChange={(e) => {\n setValue(e.target.value)\n }}\n path={path}\n placeholder={getTranslation(placeholder, i18n)}\n readOnly={readOnly}\n required={required}\n rows={rows}\n rtl={isRTL}\n showError={showError}\n style={style}\n value={value}\n width={width}\n />\n )\n}\n\nexport const Textarea = withCondition(TextareaField)\n"],"names":["getTranslation","useFieldProps","React","useCallback","useField","withCondition","useConfig","useTranslation","isFieldRTL","TextareaInput","TextareaField","props","name","AfterInput","BeforeInput","CustomDescription","CustomError","CustomLabel","className","descriptionProps","errorProps","label","labelProps","locale","localized","maxLength","minLength","path","pathFromProps","placeholder","readOnly","readOnlyFromProps","required","rows","rtl","style","validate","width","i18n","localization","isRTL","fieldLocalized","fieldRTL","localizationConfig","undefined","memoizedValidate","value","options","pathFromContext","readOnlyFromContext","setValue","showError","onChange","e","target","Textarea"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,iDAAiD,GACjD;AAGA,SAASA,cAAc,QAAQ,2BAA0B;AACzD,SAASC,aAAa,QAAQ,0CAAyC;AACvE,OAAOC,SAASC,WAAW,QAAQ,QAAO;AAI1C,SAASC,QAAQ,QAAQ,gCAA+B;AACxD,SAASC,aAAa,QAAQ,qCAAoC;AAClE,SAASC,SAAS,QAAQ,kCAAiC;AAC3D,SAASC,cAAc,QAAQ,uCAAsC;AACrE,SAASC,UAAU,QAAQ,qBAAoB;AAC/C,SAASC,aAAa,QAAQ,aAAY;AAG1C,SAAiDA,aAAa,GAAE;AAEhE,MAAMC,gBAA8C,CAACC;IACnD,MAAM,EACJC,IAAI,EACJC,UAAU,EACVC,WAAW,EACXC,iBAAiB,EACjBC,WAAW,EACXC,WAAW,EACXC,SAAS,EACTC,gBAAgB,EAChBC,UAAU,EACVC,KAAK,EACLC,UAAU,EACVC,MAAM,EACNC,SAAS,EACTC,SAAS,EACTC,SAAS,EACTC,MAAMC,aAAa,EACnBC,WAAW,EACXC,UAAUC,iBAAiB,EAC3BC,QAAQ,EACRC,IAAI,EACJC,GAAG,EACHC,KAAK,EACLC,QAAQ,EACRC,KAAK,EACN,GAAG1B;IAEJ,MAAM,EAAE2B,IAAI,EAAE,GAAG/B;IAEjB,MAAM,EAAEgC,YAAY,EAAE,GAAGjC;IAEzB,MAAMkC,QAAQhC,WAAW;QACvBiC,gBAAgBjB;QAChBkB,UAAUR;QACVX;QACAoB,oBAAoBJ,gBAAgBK;IACtC;IAEA,MAAMC,mBAAmC1C,YACvC,CAAC2C,OAAOC;QACN,IAAI,OAAOX,aAAa,YACtB,OAAOA,SAASU,OAAO;YAAE,GAAGC,OAAO;YAAEtB;YAAWC;YAAWM;QAAS;IACxE,GACA;QAACI;QAAUJ;QAAUP;QAAWC;KAAU;IAG5C,MAAM,EAAEC,MAAMqB,eAAe,EAAElB,UAAUmB,mBAAmB,EAAE,GAAGhD;IACjE,MAAM6B,WAAWC,qBAAqBkB;IAEtC,MAAM,EAAEtB,IAAI,EAAEuB,QAAQ,EAAEC,SAAS,EAAEL,KAAK,EAAE,GAAG1C,SAAiB;QAC5DuB,MAAMqB,mBAAmBpB,iBAAiBhB;QAC1CwB,UAAUS;IACZ;IAEA,qBACE,oBAACpC;QACCI,YAAYA;QACZC,aAAaA;QACbC,mBAAmBA;QACnBC,aAAaA;QACbC,aAAaA;QACbC,WAAWA;QACXC,kBAAkBA;QAClBC,YAAYA;QACZC,OAAOA;QACPC,YAAYA;QACZ8B,UAAU,CAACC;YACTH,SAASG,EAAEC,MAAM,CAACR,KAAK;QACzB;QACAnB,MAAMA;QACNE,aAAa7B,eAAe6B,aAAaS;QACzCR,UAAUA;QACVE,UAAUA;QACVC,MAAMA;QACNC,KAAKM;QACLW,WAAWA;QACXhB,OAAOA;QACPW,OAAOA;QACPT,OAAOA;;AAGb;AAEA,OAAO,MAAMkB,WAAWlD,cAAcK,eAAc"}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { TextareaField as TextareaFieldType } from 'payload/types';
|
|
2
2
|
import { type ChangeEvent } from 'react';
|
|
3
3
|
import type { FormFieldBase } from '../shared/index.js';
|
|
4
4
|
export type TextareaFieldProps = FormFieldBase & {
|
|
5
|
-
label?: FieldBase['label'];
|
|
6
5
|
maxLength?: number;
|
|
7
6
|
minLength?: number;
|
|
8
7
|
name?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/fields/Textarea/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/fields/Textarea/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,IAAI,iBAAiB,EAAE,MAAM,eAAe,CAAA;AAEvE,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,OAAO,CAAA;AAExC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAEvD,MAAM,MAAM,kBAAkB,GAAG,aAAa,GAAG;IAC/C,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,WAAW,CAAC,EAAE,iBAAiB,CAAC,OAAO,CAAC,CAAC,aAAa,CAAC,CAAA;IACvD,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,KAAK,CAAC,EAAE,MAAM,CAAA;CACf,CAAA;AAED,MAAM,MAAM,kBAAkB,GAAG,kBAAkB,GAAG;IACpD,QAAQ,CAAC,EAAE,CAAC,CAAC,EAAE,WAAW,CAAC,mBAAmB,CAAC,KAAK,IAAI,CAAA;IACxD,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,KAAK,CAAC,EAAE,MAAM,CAAA;CACf,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/fields/Textarea/types.ts"],"sourcesContent":["import type {
|
|
1
|
+
{"version":3,"sources":["../../../src/fields/Textarea/types.ts"],"sourcesContent":["import type { TextareaField as TextareaFieldType } from 'payload/types'\n\nimport { type ChangeEvent } from 'react'\n\nimport type { FormFieldBase } from '../shared/index.js'\n\nexport type TextareaFieldProps = FormFieldBase & {\n maxLength?: number\n minLength?: number\n name?: string\n path?: string\n placeholder?: TextareaFieldType['admin']['placeholder']\n rows?: number\n width?: string\n}\n\nexport type TextAreaInputProps = TextareaFieldProps & {\n onChange?: (e: ChangeEvent<HTMLTextAreaElement>) => void\n rows?: number\n showError?: boolean\n value?: string\n}\n"],"names":[],"rangeMappings":"","mappings":"AAgBA,WAKC"}
|
|
@@ -2,7 +2,6 @@ import type { UploadField } from 'payload/types';
|
|
|
2
2
|
import type { FormFieldBase } from '../shared/index.js';
|
|
3
3
|
export type UploadFieldProps = FormFieldBase & {
|
|
4
4
|
filterOptions?: UploadField['filterOptions'];
|
|
5
|
-
label?: UploadField['label'];
|
|
6
5
|
name?: string;
|
|
7
6
|
path?: string;
|
|
8
7
|
relationTo?: UploadField['relationTo'];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/fields/Upload/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAEhD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAEvD,MAAM,MAAM,gBAAgB,GAAG,aAAa,GAAG;IAC7C,aAAa,CAAC,EAAE,WAAW,CAAC,eAAe,CAAC,CAAA;IAC5C,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/fields/Upload/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAEhD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAEvD,MAAM,MAAM,gBAAgB,GAAG,aAAa,GAAG;IAC7C,aAAa,CAAC,EAAE,WAAW,CAAC,eAAe,CAAC,CAAA;IAC5C,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,UAAU,CAAC,EAAE,WAAW,CAAC,YAAY,CAAC,CAAA;IACtC,KAAK,CAAC,EAAE,MAAM,CAAA;CACf,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/fields/Upload/types.ts"],"sourcesContent":["import type { UploadField } from 'payload/types'\n\nimport type { FormFieldBase } from '../shared/index.js'\n\nexport type UploadFieldProps = FormFieldBase & {\n filterOptions?: UploadField['filterOptions']\n
|
|
1
|
+
{"version":3,"sources":["../../../src/fields/Upload/types.ts"],"sourcesContent":["import type { UploadField } from 'payload/types'\n\nimport type { FormFieldBase } from '../shared/index.js'\n\nexport type UploadFieldProps = FormFieldBase & {\n filterOptions?: UploadField['filterOptions']\n name?: string\n path?: string\n relationTo?: UploadField['relationTo']\n width?: string\n}\n"],"names":[],"rangeMappings":"","mappings":"AAIA,WAMC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" resolution-mode="require"/>
|
|
2
2
|
import type { User } from 'payload/auth';
|
|
3
3
|
import type { Locale, SanitizedLocalizationConfig } from 'payload/config';
|
|
4
|
-
import type { DocumentPreferences, ErrorProps, FieldDescriptionProps, LabelProps, Validate } from 'payload/types';
|
|
4
|
+
import type { DocumentPreferences, ErrorProps, FieldDescriptionProps, LabelProps, SanitizedLabelProps, Validate } from 'payload/types';
|
|
5
5
|
export declare const fieldBaseClass = "field-type";
|
|
6
6
|
export type FormFieldBase = {
|
|
7
7
|
AfterInput?: React.ReactNode;
|
|
@@ -10,11 +10,13 @@ export type FormFieldBase = {
|
|
|
10
10
|
CustomError?: React.ReactNode;
|
|
11
11
|
CustomLabel?: React.ReactNode;
|
|
12
12
|
className?: string;
|
|
13
|
+
custom?: Record<string, any>;
|
|
13
14
|
descriptionProps?: FieldDescriptionProps;
|
|
14
15
|
disabled?: boolean;
|
|
15
16
|
docPreferences?: DocumentPreferences;
|
|
16
17
|
errorProps?: ErrorProps;
|
|
17
|
-
|
|
18
|
+
label?: LabelProps['label'];
|
|
19
|
+
labelProps?: SanitizedLabelProps;
|
|
18
20
|
locale?: Locale;
|
|
19
21
|
localized?: boolean;
|
|
20
22
|
path?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/fields/shared/index.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AACxC,OAAO,KAAK,EAAE,MAAM,EAAE,2BAA2B,EAAE,MAAM,gBAAgB,CAAA;AACzE,OAAO,KAAK,EACV,mBAAmB,EACnB,UAAU,EACV,qBAAqB,EACrB,UAAU,EACV,QAAQ,EACT,MAAM,eAAe,CAAA;AAEtB,eAAO,MAAM,cAAc,eAAe,CAAA;AAE1C,MAAM,MAAM,aAAa,GAAG;IAC1B,UAAU,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAC5B,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAC7B,iBAAiB,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IACnC,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAC7B,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,gBAAgB,CAAC,EAAE,qBAAqB,CAAA;IACxC,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,cAAc,CAAC,EAAE,mBAAmB,CAAA;IACpC,UAAU,CAAC,EAAE,UAAU,CAAA;IACvB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/fields/shared/index.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AACxC,OAAO,KAAK,EAAE,MAAM,EAAE,2BAA2B,EAAE,MAAM,gBAAgB,CAAA;AACzE,OAAO,KAAK,EACV,mBAAmB,EACnB,UAAU,EACV,qBAAqB,EACrB,UAAU,EACV,mBAAmB,EACnB,QAAQ,EACT,MAAM,eAAe,CAAA;AAEtB,eAAO,MAAM,cAAc,eAAe,CAAA;AAE1C,MAAM,MAAM,aAAa,GAAG;IAC1B,UAAU,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAC5B,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAC7B,iBAAiB,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IACnC,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAC7B,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IAC5B,gBAAgB,CAAC,EAAE,qBAAqB,CAAA;IACxC,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,cAAc,CAAC,EAAE,mBAAmB,CAAA;IACpC,UAAU,CAAC,EAAE,UAAU,CAAA;IACvB,KAAK,CAAC,EAAE,UAAU,CAAC,OAAO,CAAC,CAAA;IAC3B,UAAU,CAAC,EAAE,mBAAmB,CAAA;IAChC,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,GAAG,CAAC,EAAE,OAAO,CAAA;IACb,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAA;IAC3B,IAAI,CAAC,EAAE,IAAI,CAAA;IACX,QAAQ,CAAC,EAAE,QAAQ,CAAA;CACpB,CAAA;AAED;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,EACzB,cAAc,EACd,QAAQ,EACR,MAAM,EACN,kBAAkB,GACnB,EAAE;IACD,cAAc,EAAE,OAAO,CAAA;IACvB,QAAQ,EAAE,OAAO,CAAA;IACjB,MAAM,EAAE,MAAM,CAAA;IACd,kBAAkB,CAAC,EAAE,2BAA2B,CAAA;CACjD,WAiBA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/fields/shared/index.tsx"],"sourcesContent":["import type { User } from 'payload/auth'\nimport type { Locale, SanitizedLocalizationConfig } from 'payload/config'\nimport type {\n DocumentPreferences,\n ErrorProps,\n FieldDescriptionProps,\n LabelProps,\n Validate,\n} from 'payload/types'\n\nexport const fieldBaseClass = 'field-type'\n\nexport type FormFieldBase = {\n AfterInput?: React.ReactNode\n BeforeInput?: React.ReactNode\n CustomDescription?: React.ReactNode\n CustomError?: React.ReactNode\n CustomLabel?: React.ReactNode\n className?: string\n descriptionProps?: FieldDescriptionProps\n disabled?: boolean\n docPreferences?: DocumentPreferences\n errorProps?: ErrorProps\n
|
|
1
|
+
{"version":3,"sources":["../../../src/fields/shared/index.tsx"],"sourcesContent":["import type { User } from 'payload/auth'\nimport type { Locale, SanitizedLocalizationConfig } from 'payload/config'\nimport type {\n DocumentPreferences,\n ErrorProps,\n FieldDescriptionProps,\n LabelProps,\n SanitizedLabelProps,\n Validate,\n} from 'payload/types'\n\nexport const fieldBaseClass = 'field-type'\n\nexport type FormFieldBase = {\n AfterInput?: React.ReactNode\n BeforeInput?: React.ReactNode\n CustomDescription?: React.ReactNode\n CustomError?: React.ReactNode\n CustomLabel?: React.ReactNode\n className?: string\n custom?: Record<string, any>\n descriptionProps?: FieldDescriptionProps\n disabled?: boolean\n docPreferences?: DocumentPreferences\n errorProps?: ErrorProps\n label?: LabelProps['label']\n labelProps?: SanitizedLabelProps\n locale?: Locale\n localized?: boolean\n path?: string\n readOnly?: boolean\n required?: boolean\n rtl?: boolean\n style?: React.CSSProperties\n user?: User\n validate?: Validate\n}\n\n/**\n * Determines whether a field should be displayed as right-to-left (RTL) based on its configuration, payload's localization configuration and the adming user's currently enabled locale.\n\n * @returns Whether the field should be displayed as RTL.\n */\nexport function isFieldRTL({\n fieldLocalized,\n fieldRTL,\n locale,\n localizationConfig,\n}: {\n fieldLocalized: boolean\n fieldRTL: boolean\n locale: Locale\n localizationConfig?: SanitizedLocalizationConfig\n}) {\n const hasMultipleLocales =\n locale &&\n localizationConfig &&\n localizationConfig.locales &&\n localizationConfig.locales.length > 1\n\n const isCurrentLocaleDefaultLocale = locale?.code === localizationConfig?.defaultLocale\n\n return (\n (fieldRTL !== false &&\n locale?.rtl === true &&\n (fieldLocalized ||\n (!fieldLocalized && !hasMultipleLocales) || // If there is only one locale which is also rtl, that field is rtl too\n (!fieldLocalized && isCurrentLocaleDefaultLocale))) || // If the current locale is the default locale, but the field is not localized, that field is rtl too\n fieldRTL === true\n ) // If fieldRTL is true. This should be useful for when no localization is set at all in the payload config, but you still want fields to be rtl.\n}\n"],"names":["fieldBaseClass","isFieldRTL","fieldLocalized","fieldRTL","locale","localizationConfig","hasMultipleLocales","locales","length","isCurrentLocaleDefaultLocale","code","defaultLocale","rtl"],"rangeMappings":";;;;;;;;;;;;","mappings":"AAWA,OAAO,MAAMA,iBAAiB,aAAY;AA2B1C;;;;CAIC,GACD,OAAO,SAASC,WAAW,EACzBC,cAAc,EACdC,QAAQ,EACRC,MAAM,EACNC,kBAAkB,EAMnB;IACC,MAAMC,qBACJF,UACAC,sBACAA,mBAAmBE,OAAO,IAC1BF,mBAAmBE,OAAO,CAACC,MAAM,GAAG;IAEtC,MAAMC,+BAA+BL,QAAQM,SAASL,oBAAoBM;IAE1E,OACE,AAACR,aAAa,SACZC,QAAQQ,QAAQ,QACfV,CAAAA,kBACE,CAACA,kBAAkB,CAACI,sBAAuB,uEAAuE;IAClH,CAACJ,kBAAkBO,4BAA4B,KAAO,qGAAqG;IAChKN,aAAa,KACb,gJAAgJ;;AACpJ"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/forms/FieldLabel/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/forms/FieldLabel/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAI/C,OAAO,KAAK,MAAM,OAAO,CAAA;AAMzB,OAAO,cAAc,CAAA;AA8BrB,eAAO,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,UAAU,CAQ3C,CAAA"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { getTranslation } from '@payloadcms/translations';
|
|
3
|
+
import { useEditDepth } from '@payloadcms/ui/providers/EditDepth';
|
|
3
4
|
import React from 'react';
|
|
4
5
|
import { useTranslation } from '../../providers/Translation/index.js';
|
|
5
6
|
import { generateFieldID } from '../../utilities/generateFieldID.js';
|
|
@@ -9,7 +10,8 @@ const DefaultFieldLabel = (props)=>{
|
|
|
9
10
|
const { as: Element = 'label', htmlFor: htmlForFromProps, label: labelFromProps, required = false, unstyled = false } = props;
|
|
10
11
|
const { uuid } = useForm();
|
|
11
12
|
const { path } = useFieldProps();
|
|
12
|
-
const
|
|
13
|
+
const editDepth = useEditDepth();
|
|
14
|
+
const htmlFor = htmlForFromProps || generateFieldID(path, editDepth, uuid);
|
|
13
15
|
const { i18n } = useTranslation();
|
|
14
16
|
if (labelFromProps) {
|
|
15
17
|
return /*#__PURE__*/ React.createElement(Element, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/forms/FieldLabel/index.tsx"],"sourcesContent":["'use client'\n\nimport type { LabelProps } from 'payload/types'\n\nimport { getTranslation } from '@payloadcms/translations'\nimport React from 'react'\n\nimport { useTranslation } from '../../providers/Translation/index.js'\nimport { generateFieldID } from '../../utilities/generateFieldID.js'\nimport { useFieldProps } from '../FieldPropsProvider/index.js'\nimport { useForm } from '../Form/context.js'\nimport './index.scss'\n\nconst DefaultFieldLabel: React.FC<LabelProps> = (props) => {\n const {\n as: Element = 'label',\n htmlFor: htmlForFromProps,\n label: labelFromProps,\n required = false,\n unstyled = false,\n } = props\n\n const { uuid } = useForm()\n const { path } = useFieldProps()\n const htmlFor = htmlForFromProps || generateFieldID(path, uuid)\n\n const { i18n } = useTranslation()\n\n if (labelFromProps) {\n return (\n <Element className={`field-label ${unstyled ? 'unstyled' : ''}`} htmlFor={htmlFor}>\n {getTranslation(labelFromProps, i18n)}\n {required && !unstyled && <span className=\"required\">*</span>}\n </Element>\n )\n }\n\n return null\n}\n\nexport const FieldLabel: React.FC<LabelProps> = (props) => {\n const { CustomLabel } = props\n\n if (CustomLabel !== undefined) {\n return CustomLabel\n }\n\n return <DefaultFieldLabel {...props} />\n}\n"],"names":["getTranslation","React","useTranslation","generateFieldID","useFieldProps","useForm","DefaultFieldLabel","props","as","Element","htmlFor","htmlForFromProps","label","labelFromProps","required","unstyled","uuid","path","i18n","className","span","FieldLabel","CustomLabel","undefined"],"rangeMappings":"
|
|
1
|
+
{"version":3,"sources":["../../../src/forms/FieldLabel/index.tsx"],"sourcesContent":["'use client'\n\nimport type { LabelProps } from 'payload/types'\n\nimport { getTranslation } from '@payloadcms/translations'\nimport { useEditDepth } from '@payloadcms/ui/providers/EditDepth'\nimport React from 'react'\n\nimport { useTranslation } from '../../providers/Translation/index.js'\nimport { generateFieldID } from '../../utilities/generateFieldID.js'\nimport { useFieldProps } from '../FieldPropsProvider/index.js'\nimport { useForm } from '../Form/context.js'\nimport './index.scss'\n\nconst DefaultFieldLabel: React.FC<LabelProps> = (props) => {\n const {\n as: Element = 'label',\n htmlFor: htmlForFromProps,\n label: labelFromProps,\n required = false,\n unstyled = false,\n } = props\n\n const { uuid } = useForm()\n const { path } = useFieldProps()\n const editDepth = useEditDepth()\n const htmlFor = htmlForFromProps || generateFieldID(path, editDepth, uuid)\n\n const { i18n } = useTranslation()\n\n if (labelFromProps) {\n return (\n <Element className={`field-label ${unstyled ? 'unstyled' : ''}`} htmlFor={htmlFor}>\n {getTranslation(labelFromProps, i18n)}\n {required && !unstyled && <span className=\"required\">*</span>}\n </Element>\n )\n }\n\n return null\n}\n\nexport const FieldLabel: React.FC<LabelProps> = (props) => {\n const { CustomLabel } = props\n\n if (CustomLabel !== undefined) {\n return CustomLabel\n }\n\n return <DefaultFieldLabel {...props} />\n}\n"],"names":["getTranslation","useEditDepth","React","useTranslation","generateFieldID","useFieldProps","useForm","DefaultFieldLabel","props","as","Element","htmlFor","htmlForFromProps","label","labelFromProps","required","unstyled","uuid","path","editDepth","i18n","className","span","FieldLabel","CustomLabel","undefined"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;AAIA,SAASA,cAAc,QAAQ,2BAA0B;AACzD,SAASC,YAAY,QAAQ,qCAAoC;AACjE,OAAOC,WAAW,QAAO;AAEzB,SAASC,cAAc,QAAQ,uCAAsC;AACrE,SAASC,eAAe,QAAQ,qCAAoC;AACpE,SAASC,aAAa,QAAQ,iCAAgC;AAC9D,SAASC,OAAO,QAAQ,qBAAoB;AAG5C,MAAMC,oBAA0C,CAACC;IAC/C,MAAM,EACJC,IAAIC,UAAU,OAAO,EACrBC,SAASC,gBAAgB,EACzBC,OAAOC,cAAc,EACrBC,WAAW,KAAK,EAChBC,WAAW,KAAK,EACjB,GAAGR;IAEJ,MAAM,EAAES,IAAI,EAAE,GAAGX;IACjB,MAAM,EAAEY,IAAI,EAAE,GAAGb;IACjB,MAAMc,YAAYlB;IAClB,MAAMU,UAAUC,oBAAoBR,gBAAgBc,MAAMC,WAAWF;IAErE,MAAM,EAAEG,IAAI,EAAE,GAAGjB;IAEjB,IAAIW,gBAAgB;QAClB,qBACE,oBAACJ;YAAQW,WAAW,CAAC,YAAY,EAAEL,WAAW,aAAa,GAAG,CAAC;YAAEL,SAASA;WACvEX,eAAec,gBAAgBM,OAC/BL,YAAY,CAACC,0BAAY,oBAACM;YAAKD,WAAU;WAAW;IAG3D;IAEA,OAAO;AACT;AAEA,OAAO,MAAME,aAAmC,CAACf;IAC/C,MAAM,EAAEgB,WAAW,EAAE,GAAGhB;IAExB,IAAIgB,gBAAgBC,WAAW;QAC7B,OAAOD;IACT;IAEA,qBAAO,oBAACjB,mBAAsBC;AAChC,EAAC"}
|
|
@@ -2,6 +2,7 @@ import type { FieldTypes } from 'payload/config';
|
|
|
2
2
|
import type { FieldPermissions } from 'payload/types';
|
|
3
3
|
import React from 'react';
|
|
4
4
|
export type FieldPropsContextType = {
|
|
5
|
+
custom?: Record<any, string>;
|
|
5
6
|
indexPath?: string;
|
|
6
7
|
path: string;
|
|
7
8
|
permissions?: FieldPermissions;
|
|
@@ -14,6 +15,7 @@ export type FieldPropsContextType = {
|
|
|
14
15
|
};
|
|
15
16
|
export type Props = {
|
|
16
17
|
children: React.ReactNode;
|
|
18
|
+
custom?: Record<any, string>;
|
|
17
19
|
indexPath?: string;
|
|
18
20
|
path: string;
|
|
19
21
|
permissions?: FieldPermissions;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/forms/FieldPropsProvider/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAChD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAA;AAErD,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,MAAM,MAAM,qBAAqB,GAAG;IAClC,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,IAAI,EAAE,MAAM,CAAA;IACZ,WAAW,CAAC,EAAE,gBAAgB,CAAA;IAC9B,QAAQ,EAAE,OAAO,CAAA;IACjB,UAAU,EAAE,MAAM,CAAA;IAClB,kBAAkB,EAAE;QAClB,CAAC,SAAS,EAAE,MAAM,GAAG,gBAAgB,CAAA;KACtC,CAAA;IACD,IAAI,EAAE,MAAM,UAAU,CAAA;CACvB,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/forms/FieldPropsProvider/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAChD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAA;AAErD,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,MAAM,MAAM,qBAAqB,GAAG;IAClC,MAAM,CAAC,EAAE,MAAM,CAAC,GAAG,EAAE,MAAM,CAAC,CAAA;IAC5B,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,IAAI,EAAE,MAAM,CAAA;IACZ,WAAW,CAAC,EAAE,gBAAgB,CAAA;IAC9B,QAAQ,EAAE,OAAO,CAAA;IACjB,UAAU,EAAE,MAAM,CAAA;IAClB,kBAAkB,EAAE;QAClB,CAAC,SAAS,EAAE,MAAM,GAAG,gBAAgB,CAAA;KACtC,CAAA;IACD,IAAI,EAAE,MAAM,UAAU,CAAA;CACvB,CAAA;AAaD,MAAM,MAAM,KAAK,GAAG;IAClB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;IACzB,MAAM,CAAC,EAAE,MAAM,CAAC,GAAG,EAAE,MAAM,CAAC,CAAA;IAC5B,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,IAAI,EAAE,MAAM,CAAA;IACZ,WAAW,CAAC,EAAE,gBAAgB,CAAA;IAC9B,QAAQ,EAAE,OAAO,CAAA;IACjB,UAAU,EAAE,MAAM,CAAA;IAClB,kBAAkB,EAAE;QAClB,CAAC,SAAS,EAAE,MAAM,GAAG,gBAAgB,CAAA;KACtC,CAAA;IACD,IAAI,EAAE,MAAM,UAAU,CAAA;CACvB,CAAA;AAED,eAAO,MAAM,kBAAkB,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,CA2B9C,CAAA;AAED,eAAO,MAAM,aAAa,6BAGzB,CAAA"}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import React from 'react';
|
|
3
3
|
const FieldPropsContext = /*#__PURE__*/ React.createContext({
|
|
4
4
|
type: '',
|
|
5
|
+
custom: {},
|
|
5
6
|
indexPath: '',
|
|
6
7
|
path: '',
|
|
7
8
|
permissions: {},
|
|
@@ -9,10 +10,11 @@ const FieldPropsContext = /*#__PURE__*/ React.createContext({
|
|
|
9
10
|
schemaPath: '',
|
|
10
11
|
siblingPermissions: {}
|
|
11
12
|
});
|
|
12
|
-
export const FieldPropsProvider = ({ type, children, indexPath, path, permissions, readOnly, schemaPath, siblingPermissions })=>{
|
|
13
|
+
export const FieldPropsProvider = ({ type, children, custom, indexPath, path, permissions, readOnly, schemaPath, siblingPermissions })=>{
|
|
13
14
|
return /*#__PURE__*/ React.createElement(FieldPropsContext.Provider, {
|
|
14
15
|
value: {
|
|
15
16
|
type,
|
|
17
|
+
custom,
|
|
16
18
|
indexPath,
|
|
17
19
|
path,
|
|
18
20
|
permissions,
|
|
@@ -23,8 +25,8 @@ export const FieldPropsProvider = ({ type, children, indexPath, path, permission
|
|
|
23
25
|
}, children);
|
|
24
26
|
};
|
|
25
27
|
export const useFieldProps = ()=>{
|
|
26
|
-
const
|
|
27
|
-
return
|
|
28
|
+
const props = React.useContext(FieldPropsContext);
|
|
29
|
+
return props;
|
|
28
30
|
};
|
|
29
31
|
|
|
30
32
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/forms/FieldPropsProvider/index.tsx"],"sourcesContent":["'use client'\nimport type { FieldTypes } from 'payload/config'\nimport type { FieldPermissions } from 'payload/types'\n\nimport React from 'react'\n\nexport type FieldPropsContextType = {\n indexPath?: string\n path: string\n permissions?: FieldPermissions\n readOnly: boolean\n schemaPath: string\n siblingPermissions: {\n [fieldName: string]: FieldPermissions\n }\n type: keyof FieldTypes\n}\n\nconst FieldPropsContext = React.createContext<FieldPropsContextType>({\n type: '' as keyof FieldTypes,\n indexPath: '',\n path: '',\n permissions: {} as FieldPermissions,\n readOnly: false,\n schemaPath: '',\n siblingPermissions: {},\n})\n\nexport type Props = {\n children: React.ReactNode\n indexPath?: string\n path: string\n permissions?: FieldPermissions\n readOnly: boolean\n schemaPath: string\n siblingPermissions: {\n [fieldName: string]: FieldPermissions\n }\n type: keyof FieldTypes\n}\n\nexport const FieldPropsProvider: React.FC<Props> = ({\n type,\n children,\n indexPath,\n path,\n permissions,\n readOnly,\n schemaPath,\n siblingPermissions,\n}) => {\n return (\n <FieldPropsContext.Provider\n value={{\n type,\n indexPath,\n path,\n permissions,\n readOnly,\n schemaPath,\n siblingPermissions,\n }}\n >\n {children}\n </FieldPropsContext.Provider>\n )\n}\n\nexport const useFieldProps = () => {\n const
|
|
1
|
+
{"version":3,"sources":["../../../src/forms/FieldPropsProvider/index.tsx"],"sourcesContent":["'use client'\nimport type { FieldTypes } from 'payload/config'\nimport type { FieldPermissions } from 'payload/types'\n\nimport React from 'react'\n\nexport type FieldPropsContextType = {\n custom?: Record<any, string>\n indexPath?: string\n path: string\n permissions?: FieldPermissions\n readOnly: boolean\n schemaPath: string\n siblingPermissions: {\n [fieldName: string]: FieldPermissions\n }\n type: keyof FieldTypes\n}\n\nconst FieldPropsContext = React.createContext<FieldPropsContextType>({\n type: '' as keyof FieldTypes,\n custom: {},\n indexPath: '',\n path: '',\n permissions: {} as FieldPermissions,\n readOnly: false,\n schemaPath: '',\n siblingPermissions: {},\n})\n\nexport type Props = {\n children: React.ReactNode\n custom?: Record<any, string>\n indexPath?: string\n path: string\n permissions?: FieldPermissions\n readOnly: boolean\n schemaPath: string\n siblingPermissions: {\n [fieldName: string]: FieldPermissions\n }\n type: keyof FieldTypes\n}\n\nexport const FieldPropsProvider: React.FC<Props> = ({\n type,\n children,\n custom,\n indexPath,\n path,\n permissions,\n readOnly,\n schemaPath,\n siblingPermissions,\n}) => {\n return (\n <FieldPropsContext.Provider\n value={{\n type,\n custom,\n indexPath,\n path,\n permissions,\n readOnly,\n schemaPath,\n siblingPermissions,\n }}\n >\n {children}\n </FieldPropsContext.Provider>\n )\n}\n\nexport const useFieldProps = () => {\n const props = React.useContext(FieldPropsContext)\n return props\n}\n"],"names":["React","FieldPropsContext","createContext","type","custom","indexPath","path","permissions","readOnly","schemaPath","siblingPermissions","FieldPropsProvider","children","Provider","value","useFieldProps","props","useContext"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;AAIA,OAAOA,WAAW,QAAO;AAezB,MAAMC,kCAAoBD,MAAME,aAAa,CAAwB;IACnEC,MAAM;IACNC,QAAQ,CAAC;IACTC,WAAW;IACXC,MAAM;IACNC,aAAa,CAAC;IACdC,UAAU;IACVC,YAAY;IACZC,oBAAoB,CAAC;AACvB;AAgBA,OAAO,MAAMC,qBAAsC,CAAC,EAClDR,IAAI,EACJS,QAAQ,EACRR,MAAM,EACNC,SAAS,EACTC,IAAI,EACJC,WAAW,EACXC,QAAQ,EACRC,UAAU,EACVC,kBAAkB,EACnB;IACC,qBACE,oBAACT,kBAAkBY,QAAQ;QACzBC,OAAO;YACLX;YACAC;YACAC;YACAC;YACAC;YACAC;YACAC;YACAC;QACF;OAECE;AAGP,EAAC;AAED,OAAO,MAAMG,gBAAgB;IAC3B,MAAMC,QAAQhB,MAAMiB,UAAU,CAAChB;IAC/B,OAAOe;AACT,EAAC"}
|
|
@@ -4,6 +4,7 @@ import React from 'react';
|
|
|
4
4
|
import type { FieldComponentProps, MappedField } from '../../providers/ComponentMap/buildComponentMap/types.js';
|
|
5
5
|
type Props = {
|
|
6
6
|
CustomField: MappedField['CustomField'];
|
|
7
|
+
custom?: Record<any, string>;
|
|
7
8
|
disabled: boolean;
|
|
8
9
|
fieldComponentProps?: FieldComponentProps;
|
|
9
10
|
indexPath?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RenderField.d.ts","sourceRoot":"","sources":["../../../src/forms/RenderFields/RenderField.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAChD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAA;AAErD,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,KAAK,EACV,mBAAmB,EACnB,WAAW,EACZ,MAAM,yDAAyD,CAAA;AAOhE,KAAK,KAAK,GAAG;IACX,WAAW,EAAE,WAAW,CAAC,aAAa,CAAC,CAAA;IACvC,QAAQ,EAAE,OAAO,CAAA;IACjB,mBAAmB,CAAC,EAAE,mBAAmB,CAAA;IACzC,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,MAAM,CAAA;IACZ,WAAW,CAAC,EAAE,gBAAgB,CAAA;IAC9B,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,UAAU,EAAE,MAAM,CAAA;IAClB,kBAAkB,EAAE;QAClB,CAAC,SAAS,EAAE,MAAM,GAAG,gBAAgB,CAAA;KACtC,CAAA;IACD,IAAI,EAAE,MAAM,UAAU,CAAA;CACvB,CAAA;AAED,eAAO,MAAM,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,
|
|
1
|
+
{"version":3,"file":"RenderField.d.ts","sourceRoot":"","sources":["../../../src/forms/RenderFields/RenderField.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAChD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAA;AAErD,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,KAAK,EACV,mBAAmB,EACnB,WAAW,EACZ,MAAM,yDAAyD,CAAA;AAOhE,KAAK,KAAK,GAAG;IACX,WAAW,EAAE,WAAW,CAAC,aAAa,CAAC,CAAA;IACvC,MAAM,CAAC,EAAE,MAAM,CAAC,GAAG,EAAE,MAAM,CAAC,CAAA;IAC5B,QAAQ,EAAE,OAAO,CAAA;IACjB,mBAAmB,CAAC,EAAE,mBAAmB,CAAA;IACzC,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,MAAM,CAAA;IACZ,WAAW,CAAC,EAAE,gBAAgB,CAAA;IAC9B,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,UAAU,EAAE,MAAM,CAAA;IAClB,kBAAkB,EAAE;QAClB,CAAC,SAAS,EAAE,MAAM,GAAG,gBAAgB,CAAA;KACtC,CAAA;IACD,IAAI,EAAE,MAAM,UAAU,CAAA;CACvB,CAAA;AAED,eAAO,MAAM,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,CA2DvC,CAAA"}
|
|
@@ -4,7 +4,7 @@ import { HiddenInput } from '../../fields/HiddenInput/index.js';
|
|
|
4
4
|
import { useFieldComponents } from '../../providers/FieldComponents/index.js';
|
|
5
5
|
import { useOperation } from '../../providers/Operation/index.js';
|
|
6
6
|
import { FieldPropsProvider, useFieldProps } from '../FieldPropsProvider/index.js';
|
|
7
|
-
export const RenderField = ({ name, type, CustomField, disabled, fieldComponentProps, indexPath, isHidden, path: pathFromProps, permissions, readOnly: readOnlyFromProps, schemaPath: schemaPathFromProps, siblingPermissions })=>{
|
|
7
|
+
export const RenderField = ({ name, type, CustomField, custom, disabled, fieldComponentProps, indexPath, isHidden, path: pathFromProps, permissions, readOnly: readOnlyFromProps, schemaPath: schemaPathFromProps, siblingPermissions })=>{
|
|
8
8
|
const operation = useOperation();
|
|
9
9
|
const { readOnly: readOnlyFromContext } = useFieldProps();
|
|
10
10
|
const fieldComponents = useFieldComponents();
|
|
@@ -34,6 +34,7 @@ export const RenderField = ({ name, type, CustomField, disabled, fieldComponentP
|
|
|
34
34
|
return null;
|
|
35
35
|
}
|
|
36
36
|
return /*#__PURE__*/ React.createElement(FieldPropsProvider, {
|
|
37
|
+
custom: custom,
|
|
37
38
|
indexPath: indexPath,
|
|
38
39
|
path: path,
|
|
39
40
|
permissions: permissions,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/forms/RenderFields/RenderField.tsx"],"sourcesContent":["'use client'\n\nimport type { FieldTypes } from 'payload/config'\nimport type { FieldPermissions } from 'payload/types'\n\nimport React from 'react'\n\nimport type {\n FieldComponentProps,\n MappedField,\n} from '../../providers/ComponentMap/buildComponentMap/types.js'\n\nimport { HiddenInput } from '../../fields/HiddenInput/index.js'\nimport { useFieldComponents } from '../../providers/FieldComponents/index.js'\nimport { useOperation } from '../../providers/Operation/index.js'\nimport { FieldPropsProvider, useFieldProps } from '../FieldPropsProvider/index.js'\n\ntype Props = {\n CustomField: MappedField['CustomField']\n disabled: boolean\n fieldComponentProps?: FieldComponentProps\n indexPath?: string\n isHidden?: boolean\n name?: string\n path: string\n permissions?: FieldPermissions\n readOnly?: boolean\n schemaPath: string\n siblingPermissions: {\n [fieldName: string]: FieldPermissions\n }\n type: keyof FieldTypes\n}\n\nexport const RenderField: React.FC<Props> = ({\n name,\n type,\n CustomField,\n disabled,\n fieldComponentProps,\n indexPath,\n isHidden,\n path: pathFromProps,\n permissions,\n readOnly: readOnlyFromProps,\n schemaPath: schemaPathFromProps,\n siblingPermissions,\n}) => {\n const operation = useOperation()\n const { readOnly: readOnlyFromContext } = useFieldProps()\n const fieldComponents = useFieldComponents()\n\n const path = [pathFromProps, name].filter(Boolean).join('.')\n const schemaPath = [schemaPathFromProps, name].filter(Boolean).join('.')\n\n // if the user cannot read the field, then filter it out\n // this is different from `admin.readOnly` which is executed based on `operation`\n if (permissions?.read?.permission === false || disabled) {\n return null\n }\n\n // `admin.readOnly` displays the value but prevents the field from being edited\n let readOnly = readOnlyFromProps\n\n // if parent field is `readOnly: true`, but this field is `readOnly: false`, the field should still be editable\n if (readOnlyFromContext && readOnly !== false) readOnly = true\n\n // if the user does not have access control to begin with, force it to be read-only\n if (permissions?.[operation]?.permission === false) {\n readOnly = true\n }\n\n const DefaultField = isHidden ? HiddenInput : fieldComponents[type]\n\n if (CustomField === undefined && !DefaultField) {\n return null\n }\n\n return (\n <FieldPropsProvider\n indexPath={indexPath}\n path={path}\n permissions={permissions}\n readOnly={readOnly}\n schemaPath={schemaPath}\n siblingPermissions={siblingPermissions}\n type={type}\n >\n {CustomField !== undefined ? CustomField : <DefaultField {...fieldComponentProps} />}\n </FieldPropsProvider>\n )\n}\n"],"names":["React","HiddenInput","useFieldComponents","useOperation","FieldPropsProvider","useFieldProps","RenderField","name","type","CustomField","disabled","fieldComponentProps","indexPath","isHidden","path","pathFromProps","permissions","readOnly","readOnlyFromProps","schemaPath","schemaPathFromProps","siblingPermissions","operation","readOnlyFromContext","fieldComponents","filter","Boolean","join","read","permission","DefaultField","undefined"],"rangeMappings":"
|
|
1
|
+
{"version":3,"sources":["../../../src/forms/RenderFields/RenderField.tsx"],"sourcesContent":["'use client'\n\nimport type { FieldTypes } from 'payload/config'\nimport type { FieldPermissions } from 'payload/types'\n\nimport React from 'react'\n\nimport type {\n FieldComponentProps,\n MappedField,\n} from '../../providers/ComponentMap/buildComponentMap/types.js'\n\nimport { HiddenInput } from '../../fields/HiddenInput/index.js'\nimport { useFieldComponents } from '../../providers/FieldComponents/index.js'\nimport { useOperation } from '../../providers/Operation/index.js'\nimport { FieldPropsProvider, useFieldProps } from '../FieldPropsProvider/index.js'\n\ntype Props = {\n CustomField: MappedField['CustomField']\n custom?: Record<any, string>\n disabled: boolean\n fieldComponentProps?: FieldComponentProps\n indexPath?: string\n isHidden?: boolean\n name?: string\n path: string\n permissions?: FieldPermissions\n readOnly?: boolean\n schemaPath: string\n siblingPermissions: {\n [fieldName: string]: FieldPermissions\n }\n type: keyof FieldTypes\n}\n\nexport const RenderField: React.FC<Props> = ({\n name,\n type,\n CustomField,\n custom,\n disabled,\n fieldComponentProps,\n indexPath,\n isHidden,\n path: pathFromProps,\n permissions,\n readOnly: readOnlyFromProps,\n schemaPath: schemaPathFromProps,\n siblingPermissions,\n}) => {\n const operation = useOperation()\n const { readOnly: readOnlyFromContext } = useFieldProps()\n const fieldComponents = useFieldComponents()\n\n const path = [pathFromProps, name].filter(Boolean).join('.')\n const schemaPath = [schemaPathFromProps, name].filter(Boolean).join('.')\n\n // if the user cannot read the field, then filter it out\n // this is different from `admin.readOnly` which is executed based on `operation`\n if (permissions?.read?.permission === false || disabled) {\n return null\n }\n\n // `admin.readOnly` displays the value but prevents the field from being edited\n let readOnly = readOnlyFromProps\n\n // if parent field is `readOnly: true`, but this field is `readOnly: false`, the field should still be editable\n if (readOnlyFromContext && readOnly !== false) readOnly = true\n\n // if the user does not have access control to begin with, force it to be read-only\n if (permissions?.[operation]?.permission === false) {\n readOnly = true\n }\n\n const DefaultField = isHidden ? HiddenInput : fieldComponents[type]\n\n if (CustomField === undefined && !DefaultField) {\n return null\n }\n\n return (\n <FieldPropsProvider\n custom={custom}\n indexPath={indexPath}\n path={path}\n permissions={permissions}\n readOnly={readOnly}\n schemaPath={schemaPath}\n siblingPermissions={siblingPermissions}\n type={type}\n >\n {CustomField !== undefined ? CustomField : <DefaultField {...fieldComponentProps} />}\n </FieldPropsProvider>\n )\n}\n"],"names":["React","HiddenInput","useFieldComponents","useOperation","FieldPropsProvider","useFieldProps","RenderField","name","type","CustomField","custom","disabled","fieldComponentProps","indexPath","isHidden","path","pathFromProps","permissions","readOnly","readOnlyFromProps","schemaPath","schemaPathFromProps","siblingPermissions","operation","readOnlyFromContext","fieldComponents","filter","Boolean","join","read","permission","DefaultField","undefined"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;AAKA,OAAOA,WAAW,QAAO;AAOzB,SAASC,WAAW,QAAQ,oCAAmC;AAC/D,SAASC,kBAAkB,QAAQ,2CAA0C;AAC7E,SAASC,YAAY,QAAQ,qCAAoC;AACjE,SAASC,kBAAkB,EAAEC,aAAa,QAAQ,iCAAgC;AAoBlF,OAAO,MAAMC,cAA+B,CAAC,EAC3CC,IAAI,EACJC,IAAI,EACJC,WAAW,EACXC,MAAM,EACNC,QAAQ,EACRC,mBAAmB,EACnBC,SAAS,EACTC,QAAQ,EACRC,MAAMC,aAAa,EACnBC,WAAW,EACXC,UAAUC,iBAAiB,EAC3BC,YAAYC,mBAAmB,EAC/BC,kBAAkB,EACnB;IACC,MAAMC,YAAYpB;IAClB,MAAM,EAAEe,UAAUM,mBAAmB,EAAE,GAAGnB;IAC1C,MAAMoB,kBAAkBvB;IAExB,MAAMa,OAAO;QAACC;QAAeT;KAAK,CAACmB,MAAM,CAACC,SAASC,IAAI,CAAC;IACxD,MAAMR,aAAa;QAACC;QAAqBd;KAAK,CAACmB,MAAM,CAACC,SAASC,IAAI,CAAC;IAEpE,wDAAwD;IACxD,iFAAiF;IACjF,IAAIX,aAAaY,MAAMC,eAAe,SAASnB,UAAU;QACvD,OAAO;IACT;IAEA,+EAA+E;IAC/E,IAAIO,WAAWC;IAEf,+GAA+G;IAC/G,IAAIK,uBAAuBN,aAAa,OAAOA,WAAW;IAE1D,mFAAmF;IACnF,IAAID,aAAa,CAACM,UAAU,EAAEO,eAAe,OAAO;QAClDZ,WAAW;IACb;IAEA,MAAMa,eAAejB,WAAWb,cAAcwB,eAAe,CAACjB,KAAK;IAEnE,IAAIC,gBAAgBuB,aAAa,CAACD,cAAc;QAC9C,OAAO;IACT;IAEA,qBACE,oBAAC3B;QACCM,QAAQA;QACRG,WAAWA;QACXE,MAAMA;QACNE,aAAaA;QACbC,UAAUA;QACVE,YAAYA;QACZE,oBAAoBA;QACpBd,MAAMA;OAELC,gBAAgBuB,YAAYvB,4BAAc,oBAACsB,cAAiBnB;AAGnE,EAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/forms/RenderFields/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,YAAY,CAAA;AAKvC,OAAO,cAAc,CAAA;AAIrB,OAAO,EAAE,KAAK,EAAE,CAAA;AAEhB,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/forms/RenderFields/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,YAAY,CAAA;AAKvC,OAAO,cAAc,CAAA;AAIrB,OAAO,EAAE,KAAK,EAAE,CAAA;AAEhB,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,CAiFxC,CAAA"}
|
|
@@ -39,10 +39,11 @@ export const RenderFields = (props)=>{
|
|
|
39
39
|
].filter(Boolean).join(' '),
|
|
40
40
|
ref: intersectionRef
|
|
41
41
|
}, hasRendered && fieldMap?.map((f, fieldIndex)=>{
|
|
42
|
-
const { type, CustomField, disabled, fieldComponentProps, fieldComponentProps: { readOnly }, isHidden } = f;
|
|
42
|
+
const { type, CustomField, custom, disabled, fieldComponentProps, fieldComponentProps: { readOnly }, isHidden } = f;
|
|
43
43
|
const name = 'name' in f ? f.name : undefined;
|
|
44
44
|
return /*#__PURE__*/ React.createElement(RenderField, {
|
|
45
45
|
CustomField: CustomField,
|
|
46
|
+
custom: custom,
|
|
46
47
|
disabled: disabled,
|
|
47
48
|
fieldComponentProps: fieldComponentProps,
|
|
48
49
|
indexPath: indexPath !== undefined ? `${indexPath}.${fieldIndex}` : `${fieldIndex}`,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/forms/RenderFields/index.tsx"],"sourcesContent":["'use client'\nimport React from 'react'\n\nimport type { Props } from './types.js'\n\nimport { useIntersect } from '../../hooks/useIntersect.js'\nimport { useTranslation } from '../../providers/Translation/index.js'\nimport { RenderField } from './RenderField.js'\nimport './index.scss'\n\nconst baseClass = 'render-fields'\n\nexport { Props }\n\nexport const RenderFields: React.FC<Props> = (props) => {\n const { className, fieldMap, forceRender, indexPath, margins, path, permissions, schemaPath } =\n props\n\n const { i18n } = useTranslation()\n const [hasRendered, setHasRendered] = React.useState(Boolean(forceRender))\n const [intersectionRef, entry] = useIntersect(\n {\n rootMargin: '1000px',\n },\n forceRender,\n )\n const isIntersecting = Boolean(entry?.isIntersecting)\n const isAboveViewport = entry?.boundingClientRect?.top < 0\n const shouldRender = forceRender || isIntersecting || isAboveViewport\n\n React.useEffect(() => {\n if (shouldRender && !hasRendered) {\n setHasRendered(true)\n }\n }, [shouldRender, hasRendered])\n\n if (!fieldMap || (Array.isArray(fieldMap) && fieldMap.length === 0)) {\n return null\n }\n\n if (!i18n) {\n console.error('Need to implement i18n when calling RenderFields') // eslint-disable-line no-console\n }\n\n if (fieldMap) {\n return (\n <div\n className={[\n baseClass,\n className,\n margins && `${baseClass}--margins-${margins}`,\n margins === false && `${baseClass}--margins-none`,\n ]\n .filter(Boolean)\n .join(' ')}\n ref={intersectionRef}\n >\n {hasRendered &&\n fieldMap?.map((f, fieldIndex) => {\n const {\n type,\n CustomField,\n disabled,\n fieldComponentProps,\n fieldComponentProps: { readOnly },\n isHidden,\n } = f\n\n const name = 'name' in f ? f.name : undefined\n\n return (\n <RenderField\n CustomField={CustomField}\n disabled={disabled}\n fieldComponentProps={fieldComponentProps}\n indexPath={indexPath !== undefined ? `${indexPath}.${fieldIndex}` : `${fieldIndex}`}\n isHidden={isHidden}\n key={fieldIndex}\n name={name}\n path={path}\n permissions={permissions?.[name]}\n readOnly={readOnly}\n schemaPath={schemaPath}\n siblingPermissions={permissions}\n type={type}\n />\n )\n })}\n </div>\n )\n }\n\n return null\n}\n"],"names":["React","useIntersect","useTranslation","RenderField","baseClass","RenderFields","props","className","fieldMap","forceRender","indexPath","margins","path","permissions","schemaPath","i18n","hasRendered","setHasRendered","useState","Boolean","intersectionRef","entry","rootMargin","isIntersecting","isAboveViewport","boundingClientRect","top","shouldRender","useEffect","Array","isArray","length","console","error","div","filter","join","ref","map","f","fieldIndex","type","CustomField","disabled","fieldComponentProps","readOnly","isHidden","name","undefined","key","siblingPermissions"],"rangeMappings":"
|
|
1
|
+
{"version":3,"sources":["../../../src/forms/RenderFields/index.tsx"],"sourcesContent":["'use client'\nimport React from 'react'\n\nimport type { Props } from './types.js'\n\nimport { useIntersect } from '../../hooks/useIntersect.js'\nimport { useTranslation } from '../../providers/Translation/index.js'\nimport { RenderField } from './RenderField.js'\nimport './index.scss'\n\nconst baseClass = 'render-fields'\n\nexport { Props }\n\nexport const RenderFields: React.FC<Props> = (props) => {\n const { className, fieldMap, forceRender, indexPath, margins, path, permissions, schemaPath } =\n props\n\n const { i18n } = useTranslation()\n const [hasRendered, setHasRendered] = React.useState(Boolean(forceRender))\n const [intersectionRef, entry] = useIntersect(\n {\n rootMargin: '1000px',\n },\n forceRender,\n )\n const isIntersecting = Boolean(entry?.isIntersecting)\n const isAboveViewport = entry?.boundingClientRect?.top < 0\n const shouldRender = forceRender || isIntersecting || isAboveViewport\n\n React.useEffect(() => {\n if (shouldRender && !hasRendered) {\n setHasRendered(true)\n }\n }, [shouldRender, hasRendered])\n\n if (!fieldMap || (Array.isArray(fieldMap) && fieldMap.length === 0)) {\n return null\n }\n\n if (!i18n) {\n console.error('Need to implement i18n when calling RenderFields') // eslint-disable-line no-console\n }\n\n if (fieldMap) {\n return (\n <div\n className={[\n baseClass,\n className,\n margins && `${baseClass}--margins-${margins}`,\n margins === false && `${baseClass}--margins-none`,\n ]\n .filter(Boolean)\n .join(' ')}\n ref={intersectionRef}\n >\n {hasRendered &&\n fieldMap?.map((f, fieldIndex) => {\n const {\n type,\n CustomField,\n custom,\n disabled,\n fieldComponentProps,\n fieldComponentProps: { readOnly },\n isHidden,\n } = f\n\n const name = 'name' in f ? f.name : undefined\n\n return (\n <RenderField\n CustomField={CustomField}\n custom={custom}\n disabled={disabled}\n fieldComponentProps={fieldComponentProps}\n indexPath={indexPath !== undefined ? `${indexPath}.${fieldIndex}` : `${fieldIndex}`}\n isHidden={isHidden}\n key={fieldIndex}\n name={name}\n path={path}\n permissions={permissions?.[name]}\n readOnly={readOnly}\n schemaPath={schemaPath}\n siblingPermissions={permissions}\n type={type}\n />\n )\n })}\n </div>\n )\n }\n\n return null\n}\n"],"names":["React","useIntersect","useTranslation","RenderField","baseClass","RenderFields","props","className","fieldMap","forceRender","indexPath","margins","path","permissions","schemaPath","i18n","hasRendered","setHasRendered","useState","Boolean","intersectionRef","entry","rootMargin","isIntersecting","isAboveViewport","boundingClientRect","top","shouldRender","useEffect","Array","isArray","length","console","error","div","filter","join","ref","map","f","fieldIndex","type","CustomField","custom","disabled","fieldComponentProps","readOnly","isHidden","name","undefined","key","siblingPermissions"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;AACA,OAAOA,WAAW,QAAO;AAIzB,SAASC,YAAY,QAAQ,8BAA6B;AAC1D,SAASC,cAAc,QAAQ,uCAAsC;AACrE,SAASC,WAAW,QAAQ,mBAAkB;AAG9C,MAAMC,YAAY;AAIlB,OAAO,MAAMC,eAAgC,CAACC;IAC5C,MAAM,EAAEC,SAAS,EAAEC,QAAQ,EAAEC,WAAW,EAAEC,SAAS,EAAEC,OAAO,EAAEC,IAAI,EAAEC,WAAW,EAAEC,UAAU,EAAE,GAC3FR;IAEF,MAAM,EAAES,IAAI,EAAE,GAAGb;IACjB,MAAM,CAACc,aAAaC,eAAe,GAAGjB,MAAMkB,QAAQ,CAACC,QAAQV;IAC7D,MAAM,CAACW,iBAAiBC,MAAM,GAAGpB,aAC/B;QACEqB,YAAY;IACd,GACAb;IAEF,MAAMc,iBAAiBJ,QAAQE,OAAOE;IACtC,MAAMC,kBAAkBH,OAAOI,oBAAoBC,MAAM;IACzD,MAAMC,eAAelB,eAAec,kBAAkBC;IAEtDxB,MAAM4B,SAAS,CAAC;QACd,IAAID,gBAAgB,CAACX,aAAa;YAChCC,eAAe;QACjB;IACF,GAAG;QAACU;QAAcX;KAAY;IAE9B,IAAI,CAACR,YAAaqB,MAAMC,OAAO,CAACtB,aAAaA,SAASuB,MAAM,KAAK,GAAI;QACnE,OAAO;IACT;IAEA,IAAI,CAAChB,MAAM;QACTiB,QAAQC,KAAK,CAAC,oDAAoD,iCAAiC;;IACrG;IAEA,IAAIzB,UAAU;QACZ,qBACE,oBAAC0B;YACC3B,WAAW;gBACTH;gBACAG;gBACAI,WAAW,CAAC,EAAEP,UAAU,UAAU,EAAEO,QAAQ,CAAC;gBAC7CA,YAAY,SAAS,CAAC,EAAEP,UAAU,cAAc,CAAC;aAClD,CACE+B,MAAM,CAAChB,SACPiB,IAAI,CAAC;YACRC,KAAKjB;WAEJJ,eACCR,UAAU8B,IAAI,CAACC,GAAGC;YAChB,MAAM,EACJC,IAAI,EACJC,WAAW,EACXC,MAAM,EACNC,QAAQ,EACRC,mBAAmB,EACnBA,qBAAqB,EAAEC,QAAQ,EAAE,EACjCC,QAAQ,EACT,GAAGR;YAEJ,MAAMS,OAAO,UAAUT,IAAIA,EAAES,IAAI,GAAGC;YAEpC,qBACE,oBAAC9C;gBACCuC,aAAaA;gBACbC,QAAQA;gBACRC,UAAUA;gBACVC,qBAAqBA;gBACrBnC,WAAWA,cAAcuC,YAAY,CAAC,EAAEvC,UAAU,CAAC,EAAE8B,WAAW,CAAC,GAAG,CAAC,EAAEA,WAAW,CAAC;gBACnFO,UAAUA;gBACVG,KAAKV;gBACLQ,MAAMA;gBACNpC,MAAMA;gBACNC,aAAaA,aAAa,CAACmC,KAAK;gBAChCF,UAAUA;gBACVhC,YAAYA;gBACZqC,oBAAoBtC;gBACpB4B,MAAMA;;QAGZ;IAGR;IAEA,OAAO;AACT,EAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { I18n } from '@payloadcms/translations';
|
|
2
|
-
import type { LabelProps
|
|
3
|
-
import React from 'react';
|
|
2
|
+
import type { LabelProps } from 'payload/types';
|
|
3
|
+
import type React from 'react';
|
|
4
4
|
export type Props = {
|
|
5
5
|
RowLabelComponent?: React.ReactNode;
|
|
6
6
|
className?: string;
|
|
@@ -9,5 +9,4 @@ export type Props = {
|
|
|
9
9
|
rowLabel?: LabelProps['label'];
|
|
10
10
|
rowNumber?: number;
|
|
11
11
|
};
|
|
12
|
-
export declare function isComponent(label: RowLabel): label is RowLabelComponent;
|
|
13
12
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/forms/RowLabel/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAA;AACpD,OAAO,KAAK,EAAE,UAAU,EAAE,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/forms/RowLabel/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAA;AACpD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAC/C,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,MAAM,MAAM,KAAK,GAAG;IAClB,iBAAiB,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IACnC,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,IAAI,EAAE,IAAI,CAAA;IACV,IAAI,EAAE,MAAM,CAAA;IACZ,QAAQ,CAAC,EAAE,UAAU,CAAC,OAAO,CAAC,CAAA;IAC9B,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/forms/RowLabel/types.ts"],"sourcesContent":["import type { I18n } from '@payloadcms/translations'\nimport type { LabelProps
|
|
1
|
+
{"version":3,"sources":["../../../src/forms/RowLabel/types.ts"],"sourcesContent":["import type { I18n } from '@payloadcms/translations'\nimport type { LabelProps } from 'payload/types'\nimport type React from 'react'\n\nexport type Props = {\n RowLabelComponent?: React.ReactNode\n className?: string\n i18n: I18n\n path: string\n rowLabel?: LabelProps['label']\n rowNumber?: number\n}\n"],"names":[],"rangeMappings":"","mappings":"AAIA,WAOC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Data, Field, FormState,
|
|
1
|
+
import type { Data, DocumentPreferences, Field, FormState, PayloadRequestWithData } from 'payload/types';
|
|
2
2
|
export type AddFieldStatePromiseArgs = {
|
|
3
3
|
addErrorPathToParent: (path: string) => void;
|
|
4
4
|
/**
|
|
@@ -29,14 +29,12 @@ export type AddFieldStatePromiseArgs = {
|
|
|
29
29
|
operation: 'create' | 'update';
|
|
30
30
|
passesCondition: boolean;
|
|
31
31
|
path: string;
|
|
32
|
-
preferences:
|
|
33
|
-
[key: string]: unknown;
|
|
34
|
-
};
|
|
32
|
+
preferences: DocumentPreferences;
|
|
35
33
|
/**
|
|
36
34
|
* Req is used for validation and defaultValue calculation. If you don't need validation,
|
|
37
35
|
* just create your own req and pass in the locale and the user
|
|
38
36
|
*/
|
|
39
|
-
req:
|
|
37
|
+
req: PayloadRequestWithData;
|
|
40
38
|
/**
|
|
41
39
|
* Whether to skip checking the field's condition. @default false
|
|
42
40
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"addFieldStatePromise.d.ts","sourceRoot":"","sources":["../../../src/forms/buildStateFromSchema/addFieldStatePromise.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"addFieldStatePromise.d.ts","sourceRoot":"","sources":["../../../src/forms/buildStateFromSchema/addFieldStatePromise.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,IAAI,EACJ,mBAAmB,EACnB,KAAK,EAEL,SAAS,EACT,sBAAsB,EACvB,MAAM,eAAe,CAAA;AAWtB,MAAM,MAAM,wBAAwB,GAAG;IACrC,oBAAoB,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAA;IAC5C;;OAEG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAA;IAC5B,IAAI,EAAE,IAAI,CAAA;IACV,KAAK,EAAE,KAAK,CAAA;IACZ,UAAU,EAAE,MAAM,CAAA;IAClB;;OAEG;IACH,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,wBAAwB,KAAK,OAAO,CAAA;IACpD;;OAEG;IACH,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,QAAQ,EAAE,IAAI,CAAA;IACd,EAAE,EAAE,MAAM,GAAG,MAAM,CAAA;IACnB;;OAEG;IACH,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB;;OAEG;IACH,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,SAAS,EAAE,QAAQ,GAAG,QAAQ,CAAA;IAC9B,eAAe,EAAE,OAAO,CAAA;IACxB,IAAI,EAAE,MAAM,CAAA;IACZ,WAAW,EAAE,mBAAmB,CAAA;IAEhC;;;OAGG;IACH,GAAG,EAAE,sBAAsB,CAAA;IAC3B;;OAEG;IACH,mBAAmB,CAAC,EAAE,OAAO,CAAA;IAC7B;;OAEG;IACH,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,KAAK,EAAE,SAAS,CAAA;CACjB,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,oBAAoB,SAAgB,wBAAwB,KAAG,QAAQ,IAAI,CA8evF,CAAA"}
|