@payloadcms/ui 3.8.0 → 3.9.0

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.
Files changed (30) hide show
  1. package/dist/elements/Table/DefaultCell/fields/index.d.ts +4 -4
  2. package/dist/exports/client/index.js +22 -22
  3. package/dist/exports/client/index.js.map +4 -4
  4. package/dist/fields/Array/index.d.ts +1 -1
  5. package/dist/fields/Blocks/index.d.ts +1 -1
  6. package/dist/fields/Collapsible/index.d.ts +1 -1
  7. package/dist/fields/Group/index.d.ts +1 -1
  8. package/dist/fields/Join/index.d.ts.map +1 -1
  9. package/dist/fields/Join/index.js +57 -3
  10. package/dist/fields/Join/index.js.map +1 -1
  11. package/dist/fields/RadioGroup/index.d.ts +1 -10
  12. package/dist/fields/RadioGroup/index.d.ts.map +1 -1
  13. package/dist/fields/RadioGroup/index.js.map +1 -1
  14. package/dist/fields/Row/index.d.ts +1 -1
  15. package/dist/fields/Tabs/index.d.ts +1 -1
  16. package/dist/fields/Textarea/index.scss +12 -9
  17. package/dist/fields/Upload/Input.d.ts.map +1 -1
  18. package/dist/fields/Upload/Input.js +130 -111
  19. package/dist/fields/Upload/Input.js.map +1 -1
  20. package/dist/forms/RenderFields/RenderField.d.ts.map +1 -1
  21. package/dist/forms/RenderFields/RenderField.js +2 -2
  22. package/dist/forms/RenderFields/RenderField.js.map +1 -1
  23. package/dist/forms/fieldSchemasToFormState/fieldSchemasToFormState.spec.d.ts +2 -0
  24. package/dist/forms/fieldSchemasToFormState/fieldSchemasToFormState.spec.d.ts.map +1 -0
  25. package/dist/forms/fieldSchemasToFormState/renderField.d.ts.map +1 -1
  26. package/dist/forms/fieldSchemasToFormState/renderField.js +1 -0
  27. package/dist/forms/fieldSchemasToFormState/renderField.js.map +1 -1
  28. package/dist/styles.css +1 -1
  29. package/package.json +4 -4
  30. /package/{license.md → LICENSE.md} +0 -0
@@ -4,7 +4,7 @@ import './index.scss';
4
4
  export declare const ArrayFieldComponent: ArrayFieldClientComponent;
5
5
  export declare const ArrayField: React.FC<{
6
6
  readonly validate?: import("payload").ArrayFieldValidation;
7
- } & import("payload").FieldPaths & Pick<import("payload").ServerFieldBase, "permissions"> & {
7
+ } & import("payload").FieldPaths & {
8
8
  readonly field: Omit<import("payload").ArrayFieldClient, "type"> & Partial<Pick<import("payload").ArrayFieldClient, "type">>;
9
9
  } & Omit<import("payload").ClientComponentProps, "field" | "customComponents">>;
10
10
  //# sourceMappingURL=index.d.ts.map
@@ -2,7 +2,7 @@ import React from 'react';
2
2
  import './index.scss';
3
3
  export declare const BlocksField: React.FC<{
4
4
  readonly validate?: import("payload").BlocksFieldValidation;
5
- } & import("payload").FieldPaths & Pick<import("payload").ServerFieldBase, "permissions"> & {
5
+ } & import("payload").FieldPaths & {
6
6
  readonly field: Omit<import("payload").BlocksFieldClient, "type"> & Partial<Pick<import("payload").BlocksFieldClient, "type">>;
7
7
  } & Omit<import("payload").ClientComponentProps, "field" | "customComponents">>;
8
8
  //# sourceMappingURL=index.d.ts.map
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import './index.scss';
3
- export declare const CollapsibleField: React.FC<import("payload").FieldPaths & Pick<import("payload").ServerFieldBase, "permissions"> & {
3
+ export declare const CollapsibleField: React.FC<import("payload").FieldPaths & {
4
4
  readonly field: Omit<import("payload").CollapsibleFieldClient, "type"> & Partial<Pick<import("payload").CollapsibleFieldClient, "type">>;
5
5
  } & Omit<import("payload").ClientComponentProps, "field" | "customComponents">>;
6
6
  //# sourceMappingURL=index.d.ts.map
@@ -4,7 +4,7 @@ import './index.scss';
4
4
  import { GroupProvider, useGroup } from './provider.js';
5
5
  export declare const GroupFieldComponent: GroupFieldClientComponent;
6
6
  export { GroupProvider, useGroup };
7
- export declare const GroupField: React.FC<import("payload").FieldPaths & Pick<import("payload").ServerFieldBase, "permissions"> & {
7
+ export declare const GroupField: React.FC<import("payload").FieldPaths & {
8
8
  readonly field: Omit<import("payload").GroupFieldClient, "type"> & Partial<Pick<import("payload").GroupFieldClient, "type">>;
9
9
  } & Omit<import("payload").ClientComponentProps, "field" | "customComponents">>;
10
10
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/fields/Join/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAkD,MAAM,SAAS,CAAA;AAE9F,OAAO,KAAkB,MAAM,OAAO,CAAA;AAqFtC,eAAO,MAAM,SAAS;;;;+EAAoC,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/fields/Join/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAEV,eAAe,EAIhB,MAAM,SAAS,CAAA;AAIhB,OAAO,KAAkB,MAAM,OAAO,CAAA;AAqJtC,eAAO,MAAM,SAAS;;;;+EAAoC,CAAA"}
@@ -1,15 +1,58 @@
1
1
  'use client';
2
2
 
3
3
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
4
+ import ObjectIdImport from 'bson-objectid';
5
+ import { flattenTopLevelFields } from 'payload/shared';
4
6
  import React, { useMemo } from 'react';
5
7
  import { RelationshipTable } from '../../elements/RelationshipTable/index.js';
6
8
  import { RenderCustomComponent } from '../../elements/RenderCustomComponent/index.js';
7
9
  import { useField } from '../../forms/useField/index.js';
8
10
  import { withCondition } from '../../forms/withCondition/index.js';
11
+ import { useConfig } from '../../providers/Config/index.js';
9
12
  import { useDocumentInfo } from '../../providers/DocumentInfo/index.js';
10
13
  import { FieldDescription } from '../FieldDescription/index.js';
11
14
  import { FieldLabel } from '../FieldLabel/index.js';
12
15
  import { fieldBaseClass } from '../index.js';
16
+ const ObjectId = ObjectIdImport.default || ObjectIdImport;
17
+ /**
18
+ * Recursively builds the default data for joined collection
19
+ */
20
+ const getInitialDrawerData = ({
21
+ docID,
22
+ fields,
23
+ segments
24
+ }) => {
25
+ const flattenedFields = flattenTopLevelFields(fields);
26
+ const path = segments[0];
27
+ const field = flattenedFields.find(field => field.name === path);
28
+ if (field.type === 'relationship' || field.type === 'upload') {
29
+ return {
30
+ // TODO: Handle polymorphic https://github.com/payloadcms/payload/pull/9990
31
+ [field.name]: field.hasMany ? [docID] : docID
32
+ };
33
+ }
34
+ const nextSegments = segments.slice(1, segments.length);
35
+ if (field.type === 'tab' || field.type === 'group') {
36
+ return {
37
+ [field.name]: getInitialDrawerData({
38
+ docID,
39
+ fields: field.fields,
40
+ segments: nextSegments
41
+ })
42
+ };
43
+ }
44
+ if (field.type === 'array') {
45
+ const initialData = getInitialDrawerData({
46
+ docID,
47
+ fields: field.fields,
48
+ segments: nextSegments
49
+ });
50
+ initialData.id = ObjectId().toHexString();
51
+ return {
52
+ [field.name]: [initialData]
53
+ };
54
+ }
55
+ };
13
56
  const JoinFieldComponent = props => {
14
57
  const {
15
58
  field,
@@ -29,6 +72,11 @@ const JoinFieldComponent = props => {
29
72
  const {
30
73
  id: docID
31
74
  } = useDocumentInfo();
75
+ const {
76
+ config: {
77
+ collections
78
+ }
79
+ } = useConfig();
32
80
  const {
33
81
  customComponents: {
34
82
  AfterInput,
@@ -56,6 +104,14 @@ const JoinFieldComponent = props => {
56
104
  }
57
105
  return where;
58
106
  }, [docID, on, field.where]);
107
+ const initialDrawerData = useMemo(() => {
108
+ const relatedCollection = collections.find(collection_0 => collection_0.slug === field.collection);
109
+ return getInitialDrawerData({
110
+ docID,
111
+ fields: relatedCollection.fields,
112
+ segments: field.on.split('.')
113
+ });
114
+ }, [collections, field.on, docID, field.collection]);
59
115
  return /*#__PURE__*/_jsxs("div", {
60
116
  className: [fieldBaseClass, 'join'].filter(Boolean).join(' '),
61
117
  id: `field-${path?.replace(/\./g, '__')}`,
@@ -69,9 +125,7 @@ const JoinFieldComponent = props => {
69
125
  initialData: docID && value ? value : {
70
126
  docs: []
71
127
  },
72
- initialDrawerData: {
73
- [on]: docID
74
- },
128
+ initialDrawerData: initialDrawerData,
75
129
  Label: /*#__PURE__*/_jsx("h4", {
76
130
  style: {
77
131
  margin: 0
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["React","useMemo","RelationshipTable","RenderCustomComponent","useField","withCondition","useDocumentInfo","FieldDescription","FieldLabel","fieldBaseClass","JoinFieldComponent","props","field","admin","allowCreate","description","collection","label","localized","on","required","path","id","docID","customComponents","AfterInput","BeforeInput","Description","Label","value","filterOptions","where","equals","and","_jsxs","className","filter","Boolean","join","replace","_jsx","disableTable","initialData","docs","initialDrawerData","style","margin","relationTo","CustomComponent","Fallback","JoinField"],"sources":["../../../src/fields/Join/index.tsx"],"sourcesContent":["'use client'\n\nimport type { JoinFieldClient, JoinFieldClientComponent, PaginatedDocs, Where } from 'payload'\n\nimport React, { useMemo } from 'react'\n\nimport { RelationshipTable } from '../../elements/RelationshipTable/index.js'\nimport { RenderCustomComponent } from '../../elements/RenderCustomComponent/index.js'\nimport { useField } from '../../forms/useField/index.js'\nimport { withCondition } from '../../forms/withCondition/index.js'\nimport { useDocumentInfo } from '../../providers/DocumentInfo/index.js'\nimport { FieldDescription } from '../FieldDescription/index.js'\nimport { FieldLabel } from '../FieldLabel/index.js'\nimport { fieldBaseClass } from '../index.js'\n\nconst JoinFieldComponent: JoinFieldClientComponent = (props) => {\n const {\n field,\n field: {\n admin: { allowCreate, description },\n collection,\n label,\n localized,\n on,\n required,\n },\n path,\n } = props\n\n const { id: docID } = useDocumentInfo()\n\n const { customComponents: { AfterInput, BeforeInput, Description, Label } = {}, value } =\n useField<PaginatedDocs>({\n path,\n })\n\n const filterOptions: null | Where = useMemo(() => {\n if (!docID) {\n return null\n }\n\n const where = {\n [on]: {\n equals: docID,\n },\n }\n\n if (field.where) {\n return {\n and: [where, field.where],\n }\n }\n\n return where\n }, [docID, on, field.where])\n\n return (\n <div\n className={[fieldBaseClass, 'join'].filter(Boolean).join(' ')}\n id={`field-${path?.replace(/\\./g, '__')}`}\n >\n <RelationshipTable\n AfterInput={AfterInput}\n allowCreate={typeof docID !== 'undefined' && allowCreate}\n BeforeInput={BeforeInput}\n disableTable={filterOptions === null}\n field={field as JoinFieldClient}\n filterOptions={filterOptions}\n initialData={docID && value ? value : ({ docs: [] } as PaginatedDocs)}\n initialDrawerData={{\n [on]: docID,\n }}\n Label={\n <h4 style={{ margin: 0 }}>\n {Label || (\n <FieldLabel label={label} localized={localized} path={path} required={required} />\n )}\n </h4>\n }\n relationTo={collection}\n />\n <RenderCustomComponent\n CustomComponent={Description}\n Fallback={<FieldDescription description={description} path={path} />}\n />\n </div>\n )\n}\n\nexport const JoinField = withCondition(JoinFieldComponent)\n"],"mappings":"AAAA;;;AAIA,OAAOA,KAAA,IAASC,OAAO,QAAQ;AAE/B,SAASC,iBAAiB,QAAQ;AAClC,SAASC,qBAAqB,QAAQ;AACtC,SAASC,QAAQ,QAAQ;AACzB,SAASC,aAAa,QAAQ;AAC9B,SAASC,eAAe,QAAQ;AAChC,SAASC,gBAAgB,QAAQ;AACjC,SAASC,UAAU,QAAQ;AAC3B,SAASC,cAAc,QAAQ;AAE/B,MAAMC,kBAAA,GAAgDC,KAAA;EACpD,MAAM;IACJC,KAAK;IACLA,KAAA,EAAO;MACLC,KAAA,EAAO;QAAEC,WAAW;QAAEC;MAAW,CAAE;MACnCC,UAAU;MACVC,KAAK;MACLC,SAAS;MACTC,EAAE;MACFC;IAAQ,CACT;IACDC;EAAI,CACL,GAAGV,KAAA;EAEJ,MAAM;IAAEW,EAAA,EAAIC;EAAK,CAAE,GAAGjB,eAAA;EAEtB,MAAM;IAAEkB,gBAAA,EAAkB;MAAEC,UAAU;MAAEC,WAAW;MAAEC,WAAW;MAAEC;IAAK,CAAE,GAAG,CAAC,CAAC;IAAEC;EAAK,CAAE,GACrFzB,QAAA,CAAwB;IACtBiB;EACF;EAEF,MAAMS,aAAA,GAA8B7B,OAAA,CAAQ;IAC1C,IAAI,CAACsB,KAAA,EAAO;MACV,OAAO;IACT;IAEA,MAAMQ,KAAA,GAAQ;MACZ,CAACZ,EAAA,GAAK;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kBAAA","ignoreList":[]}
1
+ {"version":3,"file":"index.js","names":["ObjectIdImport","flattenTopLevelFields","React","useMemo","RelationshipTable","RenderCustomComponent","useField","withCondition","useConfig","useDocumentInfo","FieldDescription","FieldLabel","fieldBaseClass","ObjectId","default","getInitialDrawerData","docID","fields","segments","flattenedFields","path","field","find","name","type","hasMany","nextSegments","slice","length","initialData","id","toHexString","JoinFieldComponent","props","admin","allowCreate","description","collection","label","localized","on","required","config","collections","customComponents","AfterInput","BeforeInput","Description","Label","value","filterOptions","where","equals","and","initialDrawerData","relatedCollection","slug","split","_jsxs","className","filter","Boolean","join","replace","_jsx","disableTable","docs","style","margin","relationTo","CustomComponent","Fallback","JoinField"],"sources":["../../../src/fields/Join/index.tsx"],"sourcesContent":["'use client'\n\nimport type {\n ClientField,\n JoinFieldClient,\n JoinFieldClientComponent,\n PaginatedDocs,\n Where,\n} from 'payload'\n\nimport ObjectIdImport from 'bson-objectid'\nimport { flattenTopLevelFields } from 'payload/shared'\nimport React, { useMemo } from 'react'\n\nimport { RelationshipTable } from '../../elements/RelationshipTable/index.js'\nimport { RenderCustomComponent } from '../../elements/RenderCustomComponent/index.js'\nimport { useField } from '../../forms/useField/index.js'\nimport { withCondition } from '../../forms/withCondition/index.js'\nimport { useConfig } from '../../providers/Config/index.js'\nimport { useDocumentInfo } from '../../providers/DocumentInfo/index.js'\nimport { FieldDescription } from '../FieldDescription/index.js'\nimport { FieldLabel } from '../FieldLabel/index.js'\nimport { fieldBaseClass } from '../index.js'\n\nconst ObjectId = (ObjectIdImport.default ||\n ObjectIdImport) as unknown as typeof ObjectIdImport.default\n\n/**\n * Recursively builds the default data for joined collection\n */\nconst getInitialDrawerData = ({\n docID,\n fields,\n segments,\n}: {\n docID: number | string\n fields: ClientField[]\n segments: string[]\n}) => {\n const flattenedFields = flattenTopLevelFields(fields)\n\n const path = segments[0]\n\n const field = flattenedFields.find((field) => field.name === path)\n\n if (field.type === 'relationship' || field.type === 'upload') {\n return {\n // TODO: Handle polymorphic https://github.com/payloadcms/payload/pull/9990\n [field.name]: field.hasMany ? [docID] : docID,\n }\n }\n\n const nextSegments = segments.slice(1, segments.length)\n\n if (field.type === 'tab' || field.type === 'group') {\n return {\n [field.name]: getInitialDrawerData({ docID, fields: field.fields, segments: nextSegments }),\n }\n }\n\n if (field.type === 'array') {\n const initialData = getInitialDrawerData({\n docID,\n fields: field.fields,\n segments: nextSegments,\n })\n\n initialData.id = ObjectId().toHexString()\n\n return {\n [field.name]: [initialData],\n }\n }\n}\n\nconst JoinFieldComponent: JoinFieldClientComponent = (props) => {\n const {\n field,\n field: {\n admin: { allowCreate, description },\n collection,\n label,\n localized,\n on,\n required,\n },\n path,\n } = props\n\n const { id: docID } = useDocumentInfo()\n\n const {\n config: { collections },\n } = useConfig()\n\n const { customComponents: { AfterInput, BeforeInput, Description, Label } = {}, value } =\n useField<PaginatedDocs>({\n path,\n })\n\n const filterOptions: null | Where = useMemo(() => {\n if (!docID) {\n return null\n }\n\n const where = {\n [on]: {\n equals: docID,\n },\n }\n\n if (field.where) {\n return {\n and: [where, field.where],\n }\n }\n\n return where\n }, [docID, on, field.where])\n\n const initialDrawerData = useMemo(() => {\n const relatedCollection = collections.find((collection) => collection.slug === field.collection)\n\n return getInitialDrawerData({\n docID,\n fields: relatedCollection.fields,\n segments: field.on.split('.'),\n })\n }, [collections, field.on, docID, field.collection])\n\n return (\n <div\n className={[fieldBaseClass, 'join'].filter(Boolean).join(' ')}\n id={`field-${path?.replace(/\\./g, '__')}`}\n >\n <RelationshipTable\n AfterInput={AfterInput}\n allowCreate={typeof docID !== 'undefined' && allowCreate}\n BeforeInput={BeforeInput}\n disableTable={filterOptions === null}\n field={field as JoinFieldClient}\n filterOptions={filterOptions}\n initialData={docID && value ? value : ({ docs: [] } as PaginatedDocs)}\n initialDrawerData={initialDrawerData}\n Label={\n <h4 style={{ margin: 0 }}>\n {Label || (\n <FieldLabel label={label} localized={localized} path={path} required={required} />\n )}\n </h4>\n }\n relationTo={collection}\n />\n <RenderCustomComponent\n CustomComponent={Description}\n Fallback={<FieldDescription description={description} path={path} />}\n />\n </div>\n )\n}\n\nexport const JoinField = withCondition(JoinFieldComponent)\n"],"mappings":"AAAA;;;AAUA,OAAOA,cAAA,MAAoB;AAC3B,SAASC,qBAAqB,QAAQ;AACtC,OAAOC,KAAA,IAASC,OAAO,QAAQ;AAE/B,SAASC,iBAAiB,QAAQ;AAClC,SAASC,qBAAqB,QAAQ;AACtC,SAASC,QAAQ,QAAQ;AACzB,SAASC,aAAa,QAAQ;AAC9B,SAASC,SAAS,QAAQ;AAC1B,SAASC,eAAe,QAAQ;AAChC,SAASC,gBAAgB,QAAQ;AACjC,SAASC,UAAU,QAAQ;AAC3B,SAASC,cAAc,QAAQ;AAE/B,MAAMC,QAAA,GAAYb,cAAA,CAAec,OAAO,IACtCd,cAAA;AAEF;;;AAGA,MAAMe,oBAAA,GAAuBA,CAAC;EAC5BC,KAAK;EACLC,MAAM;EACNC;AAAQ,CAKT;EACC,MAAMC,eAAA,GAAkBlB,qBAAA,CAAsBgB,MAAA;EAE9C,MAAMG,IAAA,GAAOF,QAAQ,CAAC,EAAE;EAExB,MAAMG,KAAA,GAAQF,eAAA,CAAgBG,IAAI,CAAED,KAAA,IAAUA,KAAA,CAAME,IAAI,KAAKH,IAAA;EAE7D,IAAIC,KAAA,CAAMG,IAAI,KAAK,kBAAkBH,KAAA,CAAMG,IAAI,KAAK,UAAU;IAC5D,OAAO;MACL;MACA,CAACH,KAAA,CAAME,IAAI,GAAGF,KAAA,CAAMI,OAAO,GAAG,CAACT,KAAA,CAAM,GAAGA;IAC1C;EACF;EAEA,MAAMU,YAAA,GAAeR,QAAA,CAASS,KAAK,CAAC,GAAGT,QAAA,CAASU,MAAM;EAEtD,IAAIP,KAAA,CAAMG,IAAI,KAAK,SAASH,KAAA,CAAMG,IAAI,KAAK,SAAS;IAClD,OAAO;MACL,CAACH,KAAA,CAAME,IAAI,GAAGR,oBAAA,CAAqB;QAAEC,KA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I5E4B,UAAA,EAAYhC;qBAEd2B,IAAA,CAAC3D,qBAAA;MACCiE,eAAA,EAAiBvB,WAAA;MACjBwB,QAAA,eAAUP,IAAA,CAACtD,gBAAA;QAAiB0B,WAAA,EAAaA,WAAA;QAAahB,IAAA,EAAMA;;;;AAIpE;AAEA,OAAO,MAAMoD,SAAA,GAAYjE,aAAA,CAAcyB,kBAAA","ignoreList":[]}
@@ -1,12 +1,3 @@
1
- import React from 'react';
2
1
  import './index.scss';
3
- export declare const RadioGroupField: React.FC<{
4
- readonly disableModifyingForm?: boolean;
5
- readonly onChange?: import("packages/payload/src/admin/fields/Radio.js").OnChange;
6
- readonly path: string;
7
- readonly validate?: import("payload").RadioFieldValidation;
8
- readonly value?: string;
9
- } & {
10
- readonly field: Omit<import("payload").RadioFieldClient, "type"> & Partial<Pick<import("payload").RadioFieldClient, "type">>;
11
- } & Omit<import("payload").ClientComponentProps, "field" | "customComponents">>;
2
+ export declare const RadioGroupField: any;
12
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/fields/RadioGroup/index.tsx"],"names":[],"mappings":"AAIA,OAAO,KAA+B,MAAM,OAAO,CAAA;AAUnD,OAAO,cAAc,CAAA;AA8HrB,eAAO,MAAM,eAAe;;;;;;;;+EAA0C,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/fields/RadioGroup/index.tsx"],"names":[],"mappings":"AAcA,OAAO,cAAc,CAAA;AA8HrB,eAAO,MAAM,eAAe,EAAE,GAA6C,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["optionIsObject","React","useCallback","useMemo","RenderCustomComponent","FieldDescription","FieldError","FieldLabel","useForm","useField","withCondition","mergeFieldStyles","fieldBaseClass","Radio","baseClass","RadioGroupFieldComponent","props","disableModifyingForm","disableModifyingFormFromProps","field","admin","className","description","layout","label","localized","options","required","onChange","onChangeFromProps","path","readOnly","validate","value","valueFromProps","uuid","memoizedValidate","validationOptions","customComponents","AfterInput","BeforeInput","Description","Error","Label","setValue","showError","valueFromContext","styles","_jsxs","filter","Boolean","join","style","_jsx","CustomComponent","Fallback","id","replace","map","option","optionValue","isSelected","String","RadioGroupField"],"sources":["../../../src/fields/RadioGroup/index.tsx"],"sourcesContent":["'use client'\nimport type { RadioFieldClientComponent, RadioFieldClientProps } from 'payload'\n\nimport { optionIsObject } from 'payload/shared'\nimport React, { useCallback, useMemo } from 'react'\n\nimport { RenderCustomComponent } from '../../elements/RenderCustomComponent/index.js'\nimport { FieldDescription } from '../../fields/FieldDescription/index.js'\nimport { FieldError } from '../../fields/FieldError/index.js'\nimport { FieldLabel } from '../../fields/FieldLabel/index.js'\nimport { useForm } from '../../forms/Form/context.js'\nimport { useField } from '../../forms/useField/index.js'\nimport { withCondition } from '../../forms/withCondition/index.js'\nimport { mergeFieldStyles } from '../mergeFieldStyles.js'\nimport './index.scss'\nimport { fieldBaseClass } from '../shared/index.js'\nimport { Radio } from './Radio/index.js'\n\nconst baseClass = 'radio-group'\n\nconst RadioGroupFieldComponent: RadioFieldClientComponent = (props) => {\n const {\n disableModifyingForm: disableModifyingFormFromProps,\n field,\n field: {\n admin: {\n className,\n description,\n layout = 'horizontal',\n } = {} as RadioFieldClientProps['field']['admin'],\n label,\n localized,\n options = [],\n required,\n } = {} as RadioFieldClientProps['field'],\n onChange: onChangeFromProps,\n path,\n readOnly,\n validate,\n value: valueFromProps,\n } = props\n\n const { uuid } = useForm()\n\n const memoizedValidate = useCallback(\n (value, validationOptions) => {\n if (typeof validate === 'function') {\n return validate(value, { ...validationOptions, options, required })\n }\n },\n [validate, options, required],\n )\n\n const {\n customComponents: { AfterInput, BeforeInput, Description, Error, Label } = {},\n setValue,\n showError,\n value: valueFromContext,\n } = useField<string>({\n path,\n validate: memoizedValidate,\n })\n\n const value = valueFromContext || valueFromProps\n\n const styles = useMemo(() => mergeFieldStyles(field), [field])\n\n return (\n <div\n className={[\n fieldBaseClass,\n baseClass,\n className,\n `${baseClass}--layout-${layout}`,\n showError && 'error',\n readOnly && `${baseClass}--read-only`,\n ]\n .filter(Boolean)\n .join(' ')}\n style={styles}\n >\n <RenderCustomComponent\n CustomComponent={Error}\n Fallback={<FieldError path={path} showError={showError} />}\n />\n <RenderCustomComponent\n CustomComponent={Label}\n Fallback={\n <FieldLabel label={label} localized={localized} path={path} required={required} />\n }\n />\n <div className={`${fieldBaseClass}__wrap`}>\n {BeforeInput}\n <ul className={`${baseClass}--group`} id={`field-${path.replace(/\\./g, '__')}`}>\n {options.map((option) => {\n let optionValue = ''\n\n if (optionIsObject(option)) {\n optionValue = option.value\n } else {\n optionValue = option\n }\n\n const isSelected = String(optionValue) === String(value)\n\n const id = `field-${path}-${optionValue}${uuid ? `-${uuid}` : ''}`\n\n return (\n <li key={`${path} - ${optionValue}`}>\n <Radio\n id={id}\n isSelected={isSelected}\n onChange={() => {\n if (typeof onChangeFromProps === 'function') {\n onChangeFromProps(optionValue)\n }\n\n if (!readOnly) {\n setValue(optionValue, !!disableModifyingFormFromProps)\n }\n }}\n option={optionIsObject(option) ? option : { label: option, value: option }}\n path={path}\n readOnly={readOnly}\n uuid={uuid}\n />\n </li>\n )\n })}\n </ul>\n {AfterInput}\n <RenderCustomComponent\n CustomComponent={Description}\n Fallback={<FieldDescription description={description} path={path} />}\n />\n </div>\n </div>\n )\n}\n\nexport const RadioGroupField = withCondition(RadioGroupFieldComponent)\n"],"mappings":"AAAA;;;AAGA,SAASA,cAAc,QAAQ;AAC/B,OAAOC,KAAA,IAASC,WAAW,EAAEC,OAAO,QAAQ;AAE5C,SAASC,qBAAqB,QAAQ;AACtC,SAASC,gBAAgB,QAAQ;AACjC,SAASC,UAAU,QAAQ;AAC3B,SAASC,UAAU,QAAQ;AAC3B,SAASC,OAAO,QAAQ;AACxB,SAASC,QAAQ,QAAQ;AACzB,SAASC,aAAa,QAAQ;AAC9B,SAASC,gBAAgB,QAAQ;AACjC,OAAO;A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EAAYA,UAAA;cACZjC,QAAA,EAAUA,CAAA;gBACR,IAAI,OAAOC,iBAAA,KAAsB,YAAY;kBAC3CA,iBAAA,CAAkB+B,WAAA;gBACpB;gBAEA,IAAI,CAAC7B,QAAA,EAAU;kBACba,QAAA,CAASgB,WAAA,EAAa,CAAC,CAAC1C,6BAAA;gBAC1B;cACF;cACAyC,MAAA,EAAQ3D,cAAA,CAAe2D,MAAA,IAAUA,MAAA,GAAS;gBAAEnC,KAAA,EAAOmC,MAAA;gBAAQ1B,KAAA,EAAO0B;cAAO;cACzE7B,IAAA,EAAMA,IAAA;cACNC,QAAA,EAAUA,QAAA;cACVI,IAAA,EAAMA;;aAhBD,GAAGL,IAAA,MAAU8B,WAAA,EAAa;QAoBvC;UAEDrB,UAAA,E,aACDc,IAAA,CAACjD,qBAAA;QACCkD,eAAA,EAAiBb,WAAA;QACjBc,QAAA,eAAUF,IAAA,CAAChD,gBAAA;UAAiBiB,WAAA,EAAaA,WAAA;UAAaQ,IAAA,EAAMA;;;;;AAKtE;AAEA,OAAO,MAAMiC,eAAA,GAAkBrD,aAAA,CAAcK,wBAAA","ignoreList":[]}
1
+ {"version":3,"file":"index.js","names":["optionIsObject","React","useCallback","useMemo","RenderCustomComponent","FieldDescription","FieldError","FieldLabel","useForm","useField","withCondition","mergeFieldStyles","fieldBaseClass","Radio","baseClass","RadioGroupFieldComponent","props","disableModifyingForm","disableModifyingFormFromProps","field","admin","className","description","layout","label","localized","options","required","onChange","onChangeFromProps","path","readOnly","validate","value","valueFromProps","uuid","memoizedValidate","validationOptions","customComponents","AfterInput","BeforeInput","Description","Error","Label","setValue","showError","valueFromContext","styles","_jsxs","filter","Boolean","join","style","_jsx","CustomComponent","Fallback","id","replace","map","option","optionValue","isSelected","String","RadioGroupField"],"sources":["../../../src/fields/RadioGroup/index.tsx"],"sourcesContent":["'use client'\nimport type { RadioFieldClientComponent, RadioFieldClientProps } from 'payload'\n\nimport { optionIsObject } from 'payload/shared'\nimport React, { useCallback, useMemo } from 'react'\n\nimport { RenderCustomComponent } from '../../elements/RenderCustomComponent/index.js'\nimport { FieldDescription } from '../../fields/FieldDescription/index.js'\nimport { FieldError } from '../../fields/FieldError/index.js'\nimport { FieldLabel } from '../../fields/FieldLabel/index.js'\nimport { useForm } from '../../forms/Form/context.js'\nimport { useField } from '../../forms/useField/index.js'\nimport { withCondition } from '../../forms/withCondition/index.js'\nimport { mergeFieldStyles } from '../mergeFieldStyles.js'\nimport './index.scss'\nimport { fieldBaseClass } from '../shared/index.js'\nimport { Radio } from './Radio/index.js'\n\nconst baseClass = 'radio-group'\n\nconst RadioGroupFieldComponent: RadioFieldClientComponent = (props) => {\n const {\n disableModifyingForm: disableModifyingFormFromProps,\n field,\n field: {\n admin: {\n className,\n description,\n layout = 'horizontal',\n } = {} as RadioFieldClientProps['field']['admin'],\n label,\n localized,\n options = [],\n required,\n } = {} as RadioFieldClientProps['field'],\n onChange: onChangeFromProps,\n path,\n readOnly,\n validate,\n value: valueFromProps,\n } = props\n\n const { uuid } = useForm()\n\n const memoizedValidate = useCallback(\n (value, validationOptions) => {\n if (typeof validate === 'function') {\n return validate(value, { ...validationOptions, options, required })\n }\n },\n [validate, options, required],\n )\n\n const {\n customComponents: { AfterInput, BeforeInput, Description, Error, Label } = {},\n setValue,\n showError,\n value: valueFromContext,\n } = useField<string>({\n path,\n validate: memoizedValidate,\n })\n\n const value = valueFromContext || valueFromProps\n\n const styles = useMemo(() => mergeFieldStyles(field), [field])\n\n return (\n <div\n className={[\n fieldBaseClass,\n baseClass,\n className,\n `${baseClass}--layout-${layout}`,\n showError && 'error',\n readOnly && `${baseClass}--read-only`,\n ]\n .filter(Boolean)\n .join(' ')}\n style={styles}\n >\n <RenderCustomComponent\n CustomComponent={Error}\n Fallback={<FieldError path={path} showError={showError} />}\n />\n <RenderCustomComponent\n CustomComponent={Label}\n Fallback={\n <FieldLabel label={label} localized={localized} path={path} required={required} />\n }\n />\n <div className={`${fieldBaseClass}__wrap`}>\n {BeforeInput}\n <ul className={`${baseClass}--group`} id={`field-${path.replace(/\\./g, '__')}`}>\n {options.map((option) => {\n let optionValue = ''\n\n if (optionIsObject(option)) {\n optionValue = option.value\n } else {\n optionValue = option\n }\n\n const isSelected = String(optionValue) === String(value)\n\n const id = `field-${path}-${optionValue}${uuid ? `-${uuid}` : ''}`\n\n return (\n <li key={`${path} - ${optionValue}`}>\n <Radio\n id={id}\n isSelected={isSelected}\n onChange={() => {\n if (typeof onChangeFromProps === 'function') {\n onChangeFromProps(optionValue)\n }\n\n if (!readOnly) {\n setValue(optionValue, !!disableModifyingFormFromProps)\n }\n }}\n option={optionIsObject(option) ? option : { label: option, value: option }}\n path={path}\n readOnly={readOnly}\n uuid={uuid}\n />\n </li>\n )\n })}\n </ul>\n {AfterInput}\n <RenderCustomComponent\n CustomComponent={Description}\n Fallback={<FieldDescription description={description} path={path} />}\n />\n </div>\n </div>\n )\n}\n\nexport const RadioGroupField: any = withCondition(RadioGroupFieldComponent)\n"],"mappings":"AAAA;;;AAGA,SAASA,cAAc,QAAQ;AAC/B,OAAOC,KAAA,IAASC,WAAW,EAAEC,OAAO,QAAQ;AAE5C,SAASC,qBAAqB,QAAQ;AACtC,SAASC,gBAAgB,QAAQ;AACjC,SAASC,UAAU,QAAQ;AAC3B,SAASC,UAAU,QAAQ;AAC3B,SAASC,OAAO,QAAQ;AACxB,SAASC,QAAQ,QAAQ;AACzB,SAASC,aAAa,QAAQ;AAC9B,SAASC,gBAAgB,QAAQ;AACjC,OAAO;AACP,SAASC,cAAc,QAAQ;AAC/B,SAASC,KAAK,QAAQ;AAEtB,MAAMC,SAAA,GAAY;AAElB,MAAMC,wBAAA,GAAuDC,KAAA;EAC3D,MAAM;IACJC,oBAAA,EAAsBC,6BAA6B;IACnDC,KAAK;IACLA,KAAA,EAAO;MACLC,KAAA,EAAO;QACLC,SAAS;QACTC,WAAW;QACXC,MAAA,GAAS;MAAY,CACtB,GAAG,CAAC,CAA4C;MACjDC,KAAK;MACLC,S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EAAOmC,MAAA;gBAAQ1B,KAAA,EAAO0B;cAAO;cACzE7B,IAAA,EAAMA,IAAA;cACNC,QAAA,EAAUA,QAAA;cACVI,IAAA,EAAMA;;aAhBD,GAAGL,IAAA,MAAU8B,WAAA,EAAa;QAoBvC;UAEDrB,UAAA,E,aACDc,IAAA,CAACjD,qBAAA;QACCkD,eAAA,EAAiBb,WAAA;QACjBc,QAAA,eAAUF,IAAA,CAAChD,gBAAA;UAAiBiB,WAAA,EAAaA,WAAA;UAAaQ,IAAA,EAAMA;;;;;AAKtE;AAEA,OAAO,MAAMiC,eAAA,GAAuBrD,aAAA,CAAcK,wBAAA","ignoreList":[]}
@@ -2,7 +2,7 @@ import React from 'react';
2
2
  import './index.scss';
3
3
  export declare const RowField: React.FC<{
4
4
  readonly forceRender?: boolean;
5
- } & Omit<import("payload").FieldPaths, "path"> & Pick<import("payload").ServerFieldBase, "permissions"> & {
5
+ } & Omit<import("payload").FieldPaths, "path"> & {
6
6
  readonly field: Omit<import("payload").RowFieldClient, "type"> & Partial<Pick<import("payload").RowFieldClient, "type">>;
7
7
  } & Omit<import("payload").ClientComponentProps, "field" | "customComponents">>;
8
8
  //# sourceMappingURL=index.d.ts.map
@@ -2,7 +2,7 @@ import React from 'react';
2
2
  import './index.scss';
3
3
  import { TabsProvider } from './provider.js';
4
4
  export { TabsProvider };
5
- export declare const TabsField: React.FC<import("payload").FieldPaths & Pick<import("payload").ServerFieldBase, "permissions"> & {
5
+ export declare const TabsField: React.FC<import("payload").FieldPaths & {
6
6
  readonly field: Omit<import("payload").TabsFieldClient, "type"> & Partial<Pick<import("payload").TabsFieldClient, "type">>;
7
7
  } & Omit<import("payload").ClientComponentProps, "field" | "customComponents">>;
8
8
  //# sourceMappingURL=index.d.ts.map
@@ -40,9 +40,8 @@
40
40
 
41
41
  // Unstyle the textarea, the border is rendered on .textarea-outer
42
42
  .textarea-element {
43
- position: absolute;
44
- top: 0;
45
- left: 0;
43
+ position: relative;
44
+ z-index: 1;
46
45
  width: 100%;
47
46
  height: 100%;
48
47
  border: inherit;
@@ -66,13 +65,17 @@
66
65
 
67
66
  // Clone of textarea with same height
68
67
  .textarea-clone {
69
- vertical-align: top;
70
- display: inline-block;
71
- flex-grow: 1;
72
- overflow: hidden;
73
- text-overflow: ellipsis;
74
- white-space: pre-wrap;
68
+ position: absolute;
69
+ top: 0;
70
+ left: 0;
71
+ right: 0;
72
+ bottom: 0;
75
73
  pointer-events: none;
74
+ white-space: pre-wrap;
75
+ overflow-wrap: break-word;
76
+ visibility: hidden;
77
+ z-index: 0;
78
+ line-height: inherit;
76
79
  }
77
80
 
78
81
  .textarea-clone::before {
@@ -1 +1 @@
1
- {"version":3,"file":"Input.d.ts","sourceRoot":"","sources":["../../../src/fields/Upload/Input.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,sBAAsB,EACtB,qBAAqB,EACrB,mBAAmB,EAEnB,iBAAiB,EACjB,WAAW,EACX,iBAAiB,EACjB,WAAW,IAAI,eAAe,EAE/B,MAAM,SAAS,CAAA;AAChB,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAA;AAIjD,OAAO,KAA0C,MAAM,OAAO,CAAA;AAqB9D,OAAO,cAAc,CAAA;AAErB,eAAO,MAAM,SAAS,WAAW,CAAA;AAIjC,MAAM,MAAM,gBAAgB,GAAG;IAC7B,QAAQ,CAAC,UAAU,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IACrC,QAAQ,CAAC,WAAW,CAAC,EAAE,OAAO,CAAA;IAC9B;;OAEG;IACH,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IACtC,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAA;IAC3B,QAAQ,CAAC,UAAU,CAAC,EAAE,sBAAsB,CAAA;IAC5C,QAAQ,CAAC,mBAAmB,CAAC,EAAE,KAAK,CAAC,SAAS,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