@payloadcms/ui 3.0.0-beta.3 → 3.0.0-beta.31

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 (371) hide show
  1. package/dist/assets/index.d.ts +3 -1
  2. package/dist/assets/index.d.ts.map +1 -1
  3. package/dist/assets/index.js +3 -1
  4. package/dist/assets/index.js.map +1 -1
  5. package/dist/assets/payload-favicon-dark.png +0 -0
  6. package/dist/assets/payload-favicon-light.png +0 -0
  7. package/dist/elements/ArrayAction/index.d.ts +1 -0
  8. package/dist/elements/ArrayAction/index.d.ts.map +1 -1
  9. package/dist/elements/ArrayAction/index.js +3 -3
  10. package/dist/elements/ArrayAction/index.js.map +1 -1
  11. package/dist/elements/Autosave/index.d.ts.map +1 -1
  12. package/dist/elements/Autosave/index.js +15 -3
  13. package/dist/elements/Autosave/index.js.map +1 -1
  14. package/dist/elements/ColumnSelector/index.d.ts.map +1 -1
  15. package/dist/elements/ColumnSelector/index.js +8 -2
  16. package/dist/elements/ColumnSelector/index.js.map +1 -1
  17. package/dist/elements/DocumentControls/index.d.ts.map +1 -1
  18. package/dist/elements/DocumentControls/index.js +2 -1
  19. package/dist/elements/DocumentControls/index.js.map +1 -1
  20. package/dist/elements/DocumentControls/index.scss +2 -2
  21. package/dist/elements/DocumentDrawer/DrawerContent.d.ts.map +1 -1
  22. package/dist/elements/DocumentDrawer/DrawerContent.js +7 -7
  23. package/dist/elements/DocumentDrawer/DrawerContent.js.map +1 -1
  24. package/dist/elements/DocumentDrawer/types.d.ts +0 -1
  25. package/dist/elements/DocumentDrawer/types.d.ts.map +1 -1
  26. package/dist/elements/DocumentFields/index.js +1 -1
  27. package/dist/elements/DocumentFields/index.js.map +1 -1
  28. package/dist/elements/DocumentHeader/Tabs/Tab/index.d.ts.map +1 -1
  29. package/dist/elements/DocumentHeader/Tabs/Tab/index.js +3 -2
  30. package/dist/elements/DocumentHeader/Tabs/Tab/index.js.map +1 -1
  31. package/dist/elements/DocumentHeader/Tabs/index.d.ts +2 -0
  32. package/dist/elements/DocumentHeader/Tabs/index.d.ts.map +1 -1
  33. package/dist/elements/DocumentHeader/Tabs/index.js +3 -2
  34. package/dist/elements/DocumentHeader/Tabs/index.js.map +1 -1
  35. package/dist/elements/DocumentHeader/Tabs/tabs/index.d.ts.map +1 -1
  36. package/dist/elements/DocumentHeader/Tabs/tabs/index.js +1 -1
  37. package/dist/elements/DocumentHeader/Tabs/tabs/index.js.map +1 -1
  38. package/dist/elements/DocumentHeader/index.d.ts +2 -0
  39. package/dist/elements/DocumentHeader/index.d.ts.map +1 -1
  40. package/dist/elements/DocumentHeader/index.js +3 -2
  41. package/dist/elements/DocumentHeader/index.js.map +1 -1
  42. package/dist/elements/DraggableSortable/useDraggableSortable/types.d.ts +0 -1
  43. package/dist/elements/DraggableSortable/useDraggableSortable/types.d.ts.map +1 -1
  44. package/dist/elements/Drawer/types.d.ts +0 -1
  45. package/dist/elements/Drawer/types.d.ts.map +1 -1
  46. package/dist/elements/EditMany/index.js +2 -2
  47. package/dist/elements/EditMany/index.js.map +1 -1
  48. package/dist/elements/EditUpload/index.d.ts +12 -0
  49. package/dist/elements/EditUpload/index.d.ts.map +1 -1
  50. package/dist/elements/EditUpload/index.js +25 -25
  51. package/dist/elements/EditUpload/index.js.map +1 -1
  52. package/dist/elements/ErrorPill/index.d.ts +2 -2
  53. package/dist/elements/ErrorPill/index.d.ts.map +1 -1
  54. package/dist/elements/ErrorPill/index.js.map +1 -1
  55. package/dist/elements/FieldSelect/index.d.ts.map +1 -1
  56. package/dist/elements/FieldSelect/index.js +4 -1
  57. package/dist/elements/FieldSelect/index.js.map +1 -1
  58. package/dist/elements/HydrateClientUser/index.d.ts +3 -2
  59. package/dist/elements/HydrateClientUser/index.d.ts.map +1 -1
  60. package/dist/elements/HydrateClientUser/index.js.map +1 -1
  61. package/dist/elements/ListControls/index.d.ts.map +1 -1
  62. package/dist/elements/ListControls/index.js +16 -3
  63. package/dist/elements/ListControls/index.js.map +1 -1
  64. package/dist/elements/ListDrawer/types.d.ts +0 -1
  65. package/dist/elements/ListDrawer/types.d.ts.map +1 -1
  66. package/dist/elements/Nav/index.d.ts +2 -2
  67. package/dist/elements/Nav/index.d.ts.map +1 -1
  68. package/dist/elements/Nav/index.js +15 -8
  69. package/dist/elements/Nav/index.js.map +1 -1
  70. package/dist/elements/Pill/index.d.ts +0 -1
  71. package/dist/elements/Pill/index.d.ts.map +1 -1
  72. package/dist/elements/Publish/index.js +1 -1
  73. package/dist/elements/Publish/index.js.map +1 -1
  74. package/dist/elements/PublishMany/index.js +1 -1
  75. package/dist/elements/PublishMany/index.js.map +1 -1
  76. package/dist/elements/ReactSelect/index.d.ts.map +1 -1
  77. package/dist/elements/ReactSelect/index.js +4 -1
  78. package/dist/elements/ReactSelect/index.js.map +1 -1
  79. package/dist/elements/RenderCustomComponent/index.d.ts +5 -0
  80. package/dist/elements/RenderCustomComponent/index.d.ts.map +1 -1
  81. package/dist/elements/RenderCustomComponent/index.js +11 -2
  82. package/dist/elements/RenderCustomComponent/index.js.map +1 -1
  83. package/dist/elements/Save/index.d.ts.map +1 -1
  84. package/dist/elements/Save/index.js +7 -1
  85. package/dist/elements/Save/index.js.map +1 -1
  86. package/dist/elements/SaveDraft/index.d.ts.map +1 -1
  87. package/dist/elements/SaveDraft/index.js +8 -5
  88. package/dist/elements/SaveDraft/index.js.map +1 -1
  89. package/dist/elements/Status/index.js.map +1 -1
  90. package/dist/elements/StayLoggedIn/index.d.ts +2 -4
  91. package/dist/elements/StayLoggedIn/index.d.ts.map +1 -1
  92. package/dist/elements/StayLoggedIn/index.js +7 -6
  93. package/dist/elements/StayLoggedIn/index.js.map +1 -1
  94. package/dist/elements/StayLoggedIn/index.scss +1 -1
  95. package/dist/elements/StepNav/index.scss +1 -2
  96. package/dist/elements/Table/DefaultCell/fields/Checkbox/index.d.ts.map +1 -1
  97. package/dist/elements/Table/DefaultCell/fields/Checkbox/index.js +6 -2
  98. package/dist/elements/Table/DefaultCell/fields/Checkbox/index.js.map +1 -1
  99. package/dist/elements/Table/DefaultCell/fields/JSON/index.js +1 -1
  100. package/dist/elements/Table/DefaultCell/fields/JSON/index.js.map +1 -1
  101. package/dist/elements/Table/DefaultCell/index.d.ts.map +1 -1
  102. package/dist/elements/Table/DefaultCell/index.js +1 -1
  103. package/dist/elements/Table/DefaultCell/index.js.map +1 -1
  104. package/dist/elements/Table/index.d.ts +1 -0
  105. package/dist/elements/Table/index.d.ts.map +1 -1
  106. package/dist/elements/Table/index.js.map +1 -1
  107. package/dist/elements/TableColumns/buildColumnState.d.ts.map +1 -1
  108. package/dist/elements/TableColumns/buildColumnState.js +7 -1
  109. package/dist/elements/TableColumns/buildColumnState.js.map +1 -1
  110. package/dist/elements/Translation/index.d.ts +2 -2
  111. package/dist/elements/Translation/index.d.ts.map +1 -1
  112. package/dist/elements/Translation/index.js.map +1 -1
  113. package/dist/elements/Upload/index.d.ts.map +1 -1
  114. package/dist/elements/Upload/index.js +37 -1
  115. package/dist/elements/Upload/index.js.map +1 -1
  116. package/dist/elements/Upload/index.scss +12 -1
  117. package/dist/elements/WhereBuilder/Condition/Relationship/types.d.ts +3 -3
  118. package/dist/elements/WhereBuilder/Condition/Relationship/types.d.ts.map +1 -1
  119. package/dist/elements/WhereBuilder/Condition/Relationship/types.js.map +1 -1
  120. package/dist/elements/WhereBuilder/Condition/index.d.ts.map +1 -1
  121. package/dist/elements/WhereBuilder/Condition/index.js.map +1 -1
  122. package/dist/elements/WhereBuilder/reduceFieldMap.d.ts.map +1 -1
  123. package/dist/elements/WhereBuilder/reduceFieldMap.js +1 -0
  124. package/dist/elements/WhereBuilder/reduceFieldMap.js.map +1 -1
  125. package/dist/elements/WithServerSideProps/index.d.ts +3 -0
  126. package/dist/elements/WithServerSideProps/index.d.ts.map +1 -0
  127. package/dist/elements/WithServerSideProps/index.js +19 -0
  128. package/dist/elements/WithServerSideProps/index.js.map +1 -0
  129. package/dist/elements/withMergedProps/index.d.ts +2 -1
  130. package/dist/elements/withMergedProps/index.d.ts.map +1 -1
  131. package/dist/elements/withMergedProps/index.js +7 -1
  132. package/dist/elements/withMergedProps/index.js.map +1 -1
  133. package/dist/exports/elements.d.ts +3 -2
  134. package/dist/exports/elements.d.ts.map +1 -1
  135. package/dist/exports/elements.js +5 -2
  136. package/dist/exports/elements.js.map +1 -1
  137. package/dist/exports/fields.d.ts +2 -0
  138. package/dist/exports/fields.d.ts.map +1 -0
  139. package/dist/exports/fields.js +3 -0
  140. package/dist/exports/fields.js.map +1 -0
  141. package/dist/exports/providers.d.ts +2 -0
  142. package/dist/exports/providers.d.ts.map +1 -0
  143. package/dist/exports/providers.js +3 -0
  144. package/dist/exports/providers.js.map +1 -0
  145. package/dist/fields/Array/ArrayRow.d.ts +1 -0
  146. package/dist/fields/Array/ArrayRow.d.ts.map +1 -1
  147. package/dist/fields/Array/ArrayRow.js +4 -3
  148. package/dist/fields/Array/ArrayRow.js.map +1 -1
  149. package/dist/fields/Array/index.d.ts +1 -2
  150. package/dist/fields/Array/index.d.ts.map +1 -1
  151. package/dist/fields/Array/index.js +4 -3
  152. package/dist/fields/Array/index.js.map +1 -1
  153. package/dist/fields/Blocks/BlockRow.d.ts +1 -0
  154. package/dist/fields/Blocks/BlockRow.d.ts.map +1 -1
  155. package/dist/fields/Blocks/BlockRow.js +4 -3
  156. package/dist/fields/Blocks/BlockRow.js.map +1 -1
  157. package/dist/fields/Blocks/BlocksDrawer/index.js.map +1 -1
  158. package/dist/fields/Blocks/RowActions.d.ts +1 -0
  159. package/dist/fields/Blocks/RowActions.d.ts.map +1 -1
  160. package/dist/fields/Blocks/RowActions.js +2 -1
  161. package/dist/fields/Blocks/RowActions.js.map +1 -1
  162. package/dist/fields/Blocks/index.d.ts +2 -2
  163. package/dist/fields/Blocks/index.d.ts.map +1 -1
  164. package/dist/fields/Blocks/index.js +3 -2
  165. package/dist/fields/Blocks/index.js.map +1 -1
  166. package/dist/fields/Checkbox/Input.d.ts +3 -3
  167. package/dist/fields/Checkbox/Input.d.ts.map +1 -1
  168. package/dist/fields/Checkbox/Input.js.map +1 -1
  169. package/dist/fields/Checkbox/index.d.ts.map +1 -1
  170. package/dist/fields/Checkbox/index.js +3 -1
  171. package/dist/fields/Checkbox/index.js.map +1 -1
  172. package/dist/fields/Checkbox/types.d.ts +0 -2
  173. package/dist/fields/Checkbox/types.d.ts.map +1 -1
  174. package/dist/fields/Checkbox/types.js.map +1 -1
  175. package/dist/fields/Code/index.d.ts +1 -2
  176. package/dist/fields/Code/index.d.ts.map +1 -1
  177. package/dist/fields/Code/index.js.map +1 -1
  178. package/dist/fields/Collapsible/index.d.ts +0 -2
  179. package/dist/fields/Collapsible/index.d.ts.map +1 -1
  180. package/dist/fields/Collapsible/index.js +2 -2
  181. package/dist/fields/Collapsible/index.js.map +1 -1
  182. package/dist/fields/ConfirmPassword/index.js +1 -1
  183. package/dist/fields/ConfirmPassword/index.js.map +1 -1
  184. package/dist/fields/DateTime/index.d.ts +1 -2
  185. package/dist/fields/DateTime/index.d.ts.map +1 -1
  186. package/dist/fields/DateTime/index.js.map +1 -1
  187. package/dist/fields/Email/index.d.ts +1 -2
  188. package/dist/fields/Email/index.d.ts.map +1 -1
  189. package/dist/fields/Email/index.js.map +1 -1
  190. package/dist/fields/Group/index.d.ts +0 -2
  191. package/dist/fields/Group/index.d.ts.map +1 -1
  192. package/dist/fields/Group/index.js +3 -3
  193. package/dist/fields/Group/index.js.map +1 -1
  194. package/dist/fields/HiddenInput/index.d.ts +1 -1
  195. package/dist/fields/HiddenInput/index.d.ts.map +1 -1
  196. package/dist/fields/HiddenInput/index.js.map +1 -1
  197. package/dist/fields/JSON/index.d.ts +2 -2
  198. package/dist/fields/JSON/index.d.ts.map +1 -1
  199. package/dist/fields/JSON/index.js +20 -1
  200. package/dist/fields/JSON/index.js.map +1 -1
  201. package/dist/fields/Number/index.d.ts +1 -2
  202. package/dist/fields/Number/index.d.ts.map +1 -1
  203. package/dist/fields/Number/index.js.map +1 -1
  204. package/dist/fields/Password/index.d.ts +0 -1
  205. package/dist/fields/Password/index.d.ts.map +1 -1
  206. package/dist/fields/Password/index.js.map +1 -1
  207. package/dist/fields/Point/index.d.ts +0 -2
  208. package/dist/fields/Point/index.d.ts.map +1 -1
  209. package/dist/fields/Point/index.js +2 -2
  210. package/dist/fields/Point/index.js.map +1 -1
  211. package/dist/fields/RadioGroup/Radio/index.d.ts +1 -0
  212. package/dist/fields/RadioGroup/Radio/index.d.ts.map +1 -1
  213. package/dist/fields/RadioGroup/Radio/index.js +5 -2
  214. package/dist/fields/RadioGroup/Radio/index.js.map +1 -1
  215. package/dist/fields/RadioGroup/Radio/index.scss +0 -28
  216. package/dist/fields/RadioGroup/index.d.ts +1 -2
  217. package/dist/fields/RadioGroup/index.d.ts.map +1 -1
  218. package/dist/fields/RadioGroup/index.js +1 -0
  219. package/dist/fields/RadioGroup/index.js.map +1 -1
  220. package/dist/fields/RadioGroup/index.scss +28 -0
  221. package/dist/fields/Relationship/types.d.ts +4 -5
  222. package/dist/fields/Relationship/types.d.ts.map +1 -1
  223. package/dist/fields/Relationship/types.js.map +1 -1
  224. package/dist/fields/RichText/index.d.ts +0 -2
  225. package/dist/fields/RichText/index.d.ts.map +1 -1
  226. package/dist/fields/RichText/index.js.map +1 -1
  227. package/dist/fields/Select/index.d.ts +1 -2
  228. package/dist/fields/Select/index.d.ts.map +1 -1
  229. package/dist/fields/Select/index.js.map +1 -1
  230. package/dist/fields/Text/index.d.ts.map +1 -1
  231. package/dist/fields/Text/index.js +2 -1
  232. package/dist/fields/Text/index.js.map +1 -1
  233. package/dist/fields/Text/types.d.ts +1 -2
  234. package/dist/fields/Text/types.d.ts.map +1 -1
  235. package/dist/fields/Text/types.js.map +1 -1
  236. package/dist/fields/Textarea/index.d.ts.map +1 -1
  237. package/dist/fields/Textarea/index.js +2 -1
  238. package/dist/fields/Textarea/index.js.map +1 -1
  239. package/dist/fields/Textarea/types.d.ts +1 -2
  240. package/dist/fields/Textarea/types.d.ts.map +1 -1
  241. package/dist/fields/Textarea/types.js.map +1 -1
  242. package/dist/fields/Upload/types.d.ts +0 -1
  243. package/dist/fields/Upload/types.d.ts.map +1 -1
  244. package/dist/fields/Upload/types.js.map +1 -1
  245. package/dist/fields/shared/index.d.ts +4 -2
  246. package/dist/fields/shared/index.d.ts.map +1 -1
  247. package/dist/fields/shared/index.js.map +1 -1
  248. package/dist/forms/FieldLabel/index.d.ts.map +1 -1
  249. package/dist/forms/FieldLabel/index.js +3 -1
  250. package/dist/forms/FieldLabel/index.js.map +1 -1
  251. package/dist/forms/FieldPropsProvider/index.d.ts +2 -0
  252. package/dist/forms/FieldPropsProvider/index.d.ts.map +1 -1
  253. package/dist/forms/FieldPropsProvider/index.js +5 -3
  254. package/dist/forms/FieldPropsProvider/index.js.map +1 -1
  255. package/dist/forms/RenderFields/RenderField.d.ts +1 -0
  256. package/dist/forms/RenderFields/RenderField.d.ts.map +1 -1
  257. package/dist/forms/RenderFields/RenderField.js +2 -1
  258. package/dist/forms/RenderFields/RenderField.js.map +1 -1
  259. package/dist/forms/RenderFields/index.d.ts.map +1 -1
  260. package/dist/forms/RenderFields/index.js +2 -1
  261. package/dist/forms/RenderFields/index.js.map +1 -1
  262. package/dist/forms/RowLabel/types.d.ts +4 -5
  263. package/dist/forms/RowLabel/types.d.ts.map +1 -1
  264. package/dist/forms/RowLabel/types.js +1 -4
  265. package/dist/forms/RowLabel/types.js.map +1 -1
  266. package/dist/forms/buildStateFromSchema/addFieldStatePromise.d.ts +3 -5
  267. package/dist/forms/buildStateFromSchema/addFieldStatePromise.d.ts.map +1 -1
  268. package/dist/forms/buildStateFromSchema/addFieldStatePromise.js +2 -1
  269. package/dist/forms/buildStateFromSchema/addFieldStatePromise.js.map +1 -1
  270. package/dist/forms/buildStateFromSchema/calculateDefaultValues/index.d.ts +2 -2
  271. package/dist/forms/buildStateFromSchema/calculateDefaultValues/index.d.ts.map +1 -1
  272. package/dist/forms/buildStateFromSchema/calculateDefaultValues/index.js.map +1 -1
  273. package/dist/forms/buildStateFromSchema/calculateDefaultValues/iterateFields.d.ts +2 -2
  274. package/dist/forms/buildStateFromSchema/calculateDefaultValues/iterateFields.d.ts.map +1 -1
  275. package/dist/forms/buildStateFromSchema/calculateDefaultValues/iterateFields.js.map +1 -1
  276. package/dist/forms/buildStateFromSchema/calculateDefaultValues/promise.d.ts +2 -2
  277. package/dist/forms/buildStateFromSchema/calculateDefaultValues/promise.d.ts.map +1 -1
  278. package/dist/forms/buildStateFromSchema/calculateDefaultValues/promise.js +1 -0
  279. package/dist/forms/buildStateFromSchema/calculateDefaultValues/promise.js.map +1 -1
  280. package/dist/forms/buildStateFromSchema/index.d.ts +3 -5
  281. package/dist/forms/buildStateFromSchema/index.d.ts.map +1 -1
  282. package/dist/forms/buildStateFromSchema/index.js.map +1 -1
  283. package/dist/forms/buildStateFromSchema/iterateFields.d.ts +3 -5
  284. package/dist/forms/buildStateFromSchema/iterateFields.d.ts.map +1 -1
  285. package/dist/forms/buildStateFromSchema/iterateFields.js.map +1 -1
  286. package/dist/forms/useField/index.d.ts.map +1 -1
  287. package/dist/forms/useField/index.js +3 -1
  288. package/dist/forms/useField/index.js.map +1 -1
  289. package/dist/graphics/Account/index.js +0 -9
  290. package/dist/graphics/Account/index.js.map +1 -1
  291. package/dist/graphics/Logo/index.d.ts +2 -2
  292. package/dist/graphics/Logo/index.d.ts.map +1 -1
  293. package/dist/graphics/Logo/index.js +4 -3
  294. package/dist/graphics/Logo/index.js.map +1 -1
  295. package/dist/providers/Auth/index.d.ts.map +1 -1
  296. package/dist/providers/Auth/index.js +2 -1
  297. package/dist/providers/Auth/index.js.map +1 -1
  298. package/dist/providers/ComponentMap/buildComponentMap/actions.d.ts +2 -1
  299. package/dist/providers/ComponentMap/buildComponentMap/actions.d.ts.map +1 -1
  300. package/dist/providers/ComponentMap/buildComponentMap/actions.js +7 -3
  301. package/dist/providers/ComponentMap/buildComponentMap/actions.js.map +1 -1
  302. package/dist/providers/ComponentMap/buildComponentMap/collections.d.ts +5 -4
  303. package/dist/providers/ComponentMap/buildComponentMap/collections.d.ts.map +1 -1
  304. package/dist/providers/ComponentMap/buildComponentMap/collections.js +50 -17
  305. package/dist/providers/ComponentMap/buildComponentMap/collections.js.map +1 -1
  306. package/dist/providers/ComponentMap/buildComponentMap/fields.d.ts +4 -3
  307. package/dist/providers/ComponentMap/buildComponentMap/fields.d.ts.map +1 -1
  308. package/dist/providers/ComponentMap/buildComponentMap/fields.js +92 -46
  309. package/dist/providers/ComponentMap/buildComponentMap/fields.js.map +1 -1
  310. package/dist/providers/ComponentMap/buildComponentMap/globals.d.ts +11 -8
  311. package/dist/providers/ComponentMap/buildComponentMap/globals.d.ts.map +1 -1
  312. package/dist/providers/ComponentMap/buildComponentMap/globals.js +34 -9
  313. package/dist/providers/ComponentMap/buildComponentMap/globals.js.map +1 -1
  314. package/dist/providers/ComponentMap/buildComponentMap/index.d.ts +4 -3
  315. package/dist/providers/ComponentMap/buildComponentMap/index.d.ts.map +1 -1
  316. package/dist/providers/ComponentMap/buildComponentMap/index.js +27 -9
  317. package/dist/providers/ComponentMap/buildComponentMap/index.js.map +1 -1
  318. package/dist/providers/ComponentMap/buildComponentMap/types.d.ts +4 -0
  319. package/dist/providers/ComponentMap/buildComponentMap/types.d.ts.map +1 -1
  320. package/dist/providers/ComponentMap/buildComponentMap/types.js.map +1 -1
  321. package/dist/providers/DocumentInfo/index.js +8 -7
  322. package/dist/providers/DocumentInfo/index.js.map +1 -1
  323. package/dist/providers/EntityVisibility/index.d.ts +1 -1
  324. package/dist/providers/EntityVisibility/index.d.ts.map +1 -1
  325. package/dist/providers/EntityVisibility/index.js.map +1 -1
  326. package/dist/providers/Root/index.d.ts +2 -2
  327. package/dist/providers/Root/index.d.ts.map +1 -1
  328. package/dist/providers/Root/index.js +2 -1
  329. package/dist/providers/Root/index.js.map +1 -1
  330. package/dist/providers/Translation/index.d.ts +10 -8
  331. package/dist/providers/Translation/index.d.ts.map +1 -1
  332. package/dist/providers/Translation/index.js +2 -1
  333. package/dist/providers/Translation/index.js.map +1 -1
  334. package/dist/scss/app.scss +2 -3
  335. package/dist/scss/vars.scss +0 -7
  336. package/dist/templates/Default/index.d.ts +2 -2
  337. package/dist/templates/Default/index.d.ts.map +1 -1
  338. package/dist/templates/Default/index.js +5 -5
  339. package/dist/templates/Default/index.js.map +1 -1
  340. package/dist/utilities/formatDate.d.ts +2 -2
  341. package/dist/utilities/formatDate.d.ts.map +1 -1
  342. package/dist/utilities/formatDate.js.map +1 -1
  343. package/dist/utilities/formatDocTitle.d.ts +1 -1
  344. package/dist/utilities/formatDocTitle.d.ts.map +1 -1
  345. package/dist/utilities/formatDocTitle.js.map +1 -1
  346. package/dist/utilities/generateFieldID.d.ts +1 -1
  347. package/dist/utilities/generateFieldID.d.ts.map +1 -1
  348. package/dist/utilities/generateFieldID.js +2 -2
  349. package/dist/utilities/generateFieldID.js.map +1 -1
  350. package/dist/utilities/groupNavItems.d.ts +2 -2
  351. package/dist/utilities/groupNavItems.d.ts.map +1 -1
  352. package/dist/utilities/groupNavItems.js.map +1 -1
  353. package/package.json +35 -34
  354. package/dist/assets/fonts/SuisseIntl-Bold.woff +0 -0
  355. package/dist/assets/fonts/SuisseIntl-Bold.woff2 +0 -0
  356. package/dist/assets/fonts/SuisseIntl-Medium.woff +0 -0
  357. package/dist/assets/fonts/SuisseIntl-Medium.woff2 +0 -0
  358. package/dist/assets/fonts/SuisseIntl-SemiBold.woff +0 -0
  359. package/dist/assets/fonts/SuisseIntl-SemiBold.woff2 +0 -0
  360. package/dist/assets/fonts/SuisseIntl.woff +0 -0
  361. package/dist/assets/fonts/SuisseIntl.woff2 +0 -0
  362. package/dist/assets/fonts/merriweather-v30-latin-900.woff +0 -0
  363. package/dist/assets/fonts/merriweather-v30-latin-900.woff2 +0 -0
  364. package/dist/assets/fonts/merriweather-v30-latin-900italic.woff +0 -0
  365. package/dist/assets/fonts/merriweather-v30-latin-900italic.woff2 +0 -0
  366. package/dist/assets/fonts/merriweather-v30-latin-italic.woff +0 -0
  367. package/dist/assets/fonts/merriweather-v30-latin-italic.woff2 +0 -0
  368. package/dist/assets/fonts/merriweather-v30-latin-regular.woff +0 -0
  369. package/dist/assets/fonts/merriweather-v30-latin-regular.woff2 +0 -0
  370. package/dist/scss/fonts.scss +0 -75
  371. /package/dist/assets/{favicon.svg → payload-favicon.svg} +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/fields/Select/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAkB,SAAS,EAAE,MAAM,EAAgB,MAAM,eAAe,CAAA;AAOpF,OAAO,KAAgC,MAAM,OAAO,CAAA;AAEpD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAOvD,OAAO,cAAc,CAAA;AAErB,MAAM,MAAM,gBAAgB,GAAG,aAAa,GAAG;IAC7C,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,KAAK,CAAC,EAAE,SAAS,CAAC,OAAO,CAAC,CAAA;IAC1B,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,QAAQ,CAAC,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI,CAAA;IAC9B,OAAO,CAAC,EAAE,MAAM,EAAE,CAAA;IAClB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,KAAK,CAAC,EAAE,MAAM,CAAA;CACf,CAAA;AA0JD,eAAO,MAAM,MAAM,4BAA6B,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/fields/Select/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAkB,MAAM,EAAgB,MAAM,eAAe,CAAA;AAOzE,OAAO,KAAgC,MAAM,OAAO,CAAA;AAEpD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAOvD,OAAO,cAAc,CAAA;AAErB,MAAM,MAAM,gBAAgB,GAAG,aAAa,GAAG;IAC7C,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,QAAQ,CAAC,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI,CAAA;IAC9B,OAAO,CAAC,EAAE,MAAM,EAAE,CAAA;IAClB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,KAAK,CAAC,EAAE,MAAM,CAAA;CACf,CAAA;AA0JD,eAAO,MAAM,MAAM,4BAA6B,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/fields/Select/index.tsx"],"sourcesContent":["/* eslint-disable react/destructuring-assignment */\n'use client'\nimport type { ClientValidate, FieldBase, Option, OptionObject } from 'payload/types'\n\nimport { getTranslation } from '@payloadcms/translations'\nimport { FieldDescription } from '@payloadcms/ui/forms/FieldDescription'\nimport { FieldError } from '@payloadcms/ui/forms/FieldError'\nimport { FieldLabel } from '@payloadcms/ui/forms/FieldLabel'\nimport { useFieldProps } from '@payloadcms/ui/forms/FieldPropsProvider'\nimport React, { useCallback, useState } from 'react'\n\nimport type { FormFieldBase } from '../shared/index.js'\n\nimport { ReactSelect } from '../../elements/ReactSelect/index.js'\nimport { useField } from '../../forms/useField/index.js'\nimport { withCondition } from '../../forms/withCondition/index.js'\nimport { useTranslation } from '../../providers/Translation/index.js'\nimport { fieldBaseClass } from '../shared/index.js'\nimport './index.scss'\n\nexport type SelectFieldProps = FormFieldBase & {\n hasMany?: boolean\n isClearable?: boolean\n isSortable?: boolean\n label?: FieldBase['label']\n name?: string\n onChange?: (e: string) => void\n options?: Option[]\n path?: string\n value?: string\n width?: string\n}\n\nconst formatOptions = (options: Option[]): OptionObject[] =>\n options.map((option) => {\n if (typeof option === 'object' && (option.value || option.value === '')) {\n return option\n }\n\n return {\n label: option,\n value: option,\n } as OptionObject\n })\n\nconst SelectField: React.FC<SelectFieldProps> = (props) => {\n const {\n name,\n AfterInput,\n BeforeInput,\n CustomDescription,\n CustomError,\n CustomLabel,\n className,\n descriptionProps,\n errorProps,\n hasMany = false,\n isClearable = true,\n isSortable = true,\n label,\n labelProps,\n onChange: onChangeFromProps,\n options: optionsFromProps = [],\n path: pathFromProps,\n readOnly: readOnlyFromProps,\n required,\n style,\n validate,\n width,\n } = props\n\n const { i18n } = useTranslation()\n\n const [options] = useState(formatOptions(optionsFromProps))\n\n const memoizedValidate: ClientValidate = useCallback(\n (value, validationOptions) => {\n if (typeof validate === 'function')\n return validate(value, { ...validationOptions, hasMany, options, required })\n },\n [validate, required, hasMany, options],\n )\n\n const { path: pathFromContext, readOnly: readOnlyFromContext } = useFieldProps()\n const readOnly = readOnlyFromProps || readOnlyFromContext\n\n const { path, setValue, showError, value } = useField({\n path: pathFromContext || pathFromProps || name,\n validate: memoizedValidate,\n })\n\n let valueToRender\n\n if (hasMany && Array.isArray(value)) {\n valueToRender = value.map((val) => {\n const matchingOption = options.find((option) => option.value === val)\n return {\n label: matchingOption ? getTranslation(matchingOption.label, i18n) : val,\n value: matchingOption?.value ?? val,\n }\n })\n } else if (value) {\n const matchingOption = options.find((option) => option.value === value)\n valueToRender = {\n label: matchingOption ? getTranslation(matchingOption.label, i18n) : value,\n value: matchingOption?.value ?? value,\n }\n }\n\n const onChange = useCallback(\n (selectedOption) => {\n if (!readOnly) {\n let newValue\n if (!selectedOption) {\n newValue = null\n } else if (hasMany) {\n if (Array.isArray(selectedOption)) {\n newValue = selectedOption.map((option) => option.value)\n } else {\n newValue = []\n }\n } else {\n newValue = selectedOption.value\n }\n\n if (typeof onChangeFromProps === 'function') {\n onChangeFromProps(newValue)\n }\n\n setValue(newValue)\n }\n },\n [readOnly, hasMany, setValue, onChangeFromProps],\n )\n\n return (\n <div\n className={[\n fieldBaseClass,\n 'select',\n className,\n showError && 'error',\n readOnly && 'read-only',\n ]\n .filter(Boolean)\n .join(' ')}\n id={`field-${path.replace(/\\./g, '__')}`}\n style={{\n ...style,\n width,\n }}\n >\n <FieldError CustomError={CustomError} path={path} {...(errorProps || {})} />\n <FieldLabel\n CustomLabel={CustomLabel}\n label={label}\n required={required}\n {...(labelProps || {})}\n />\n <div>\n {BeforeInput}\n <ReactSelect\n disabled={readOnly}\n isClearable={isClearable}\n isMulti={hasMany}\n isSortable={isSortable}\n onChange={onChange}\n options={options.map((option) => ({\n ...option,\n label: getTranslation(option.label, i18n),\n }))}\n showError={showError}\n value={valueToRender as OptionObject}\n />\n {AfterInput}\n </div>\n {CustomDescription !== undefined ? (\n CustomDescription\n ) : (\n <FieldDescription {...(descriptionProps || {})} />\n )}\n </div>\n )\n}\n\nexport const Select = withCondition(SelectField)\n"],"names":["getTranslation","FieldDescription","FieldError","FieldLabel","useFieldProps","React","useCallback","useState","ReactSelect","useField","withCondition","useTranslation","fieldBaseClass","formatOptions","options","map","option","value","label","SelectField","props","name","AfterInput","BeforeInput","CustomDescription","CustomError","CustomLabel","className","descriptionProps","errorProps","hasMany","isClearable","isSortable","labelProps","onChange","onChangeFromProps","optionsFromProps","path","pathFromProps","readOnly","readOnlyFromProps","required","style","validate","width","i18n","memoizedValidate","validationOptions","pathFromContext","readOnlyFromContext","setValue","showError","valueToRender","Array","isArray","val","matchingOption","find","selectedOption","newValue","div","filter","Boolean","join","id","replace","disabled","isMulti","undefined","Select"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,iDAAiD,GACjD;AAGA,SAASA,cAAc,QAAQ,2BAA0B;AACzD,SAASC,gBAAgB,QAAQ,wCAAuC;A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;QAAUf;KAAkB;IAGlD,qBACE,oBAACyB;QACCjC,WAAW;YACTf;YACA;YACAe;YACAwB,aAAa;YACbZ,YAAY;SACb,CACEsB,MAAM,CAACC,SACPC,IAAI,CAAC;QACRC,IAAI,CAAC,MAAM,EAAE3B,KAAK4B,OAAO,CAAC,OAAO,MAAM,CAAC;QACxCvB,OAAO;YACL,GAAGA,KAAK;YACRE;QACF;qBAEA,oBAAC1C;QAAWuB,aAAaA;QAAaY,MAAMA;QAAO,GAAIR,cAAc,CAAC,CAAC;sBACvE,oBAAC1B;QACCuB,aAAaA;QACbR,OAAOA;QACPuB,UAAUA;QACT,GAAIR,cAAc,CAAC,CAAC;sBAEvB,oBAAC2B,aACErC,2BACD,oBAACf;QACC0D,UAAU3B;QACVR,aAAaA;QACboC,SAASrC;QACTE,YAAYA;QACZE,UAAUA;QACVpB,SAASA,QAAQC,GAAG,CAAC,CAACC,SAAY,CAAA;gBAChC,GAAGA,MAAM;gBACTE,OAAOlB,eAAegB,OAAOE,KAAK,EAAE2B;YACtC,CAAA;QACAM,WAAWA;QACXlC,OAAOmC;QAER9B,aAEFE,sBAAsB4C,YACrB5C,kCAEA,oBAACvB,kBAAsB2B,oBAAoB,CAAC;AAIpD;AAEA,OAAO,MAAMyC,SAAS3D,cAAcS,aAAY"}
1
+ {"version":3,"sources":["../../../src/fields/Select/index.tsx"],"sourcesContent":["/* eslint-disable react/destructuring-assignment */\n'use client'\nimport type { ClientValidate, Option, OptionObject } from 'payload/types'\n\nimport { getTranslation } from '@payloadcms/translations'\nimport { FieldDescription } from '@payloadcms/ui/forms/FieldDescription'\nimport { FieldError } from '@payloadcms/ui/forms/FieldError'\nimport { FieldLabel } from '@payloadcms/ui/forms/FieldLabel'\nimport { useFieldProps } from '@payloadcms/ui/forms/FieldPropsProvider'\nimport React, { useCallback, useState } from 'react'\n\nimport type { FormFieldBase } from '../shared/index.js'\n\nimport { ReactSelect } from '../../elements/ReactSelect/index.js'\nimport { useField } from '../../forms/useField/index.js'\nimport { withCondition } from '../../forms/withCondition/index.js'\nimport { useTranslation } from '../../providers/Translation/index.js'\nimport { fieldBaseClass } from '../shared/index.js'\nimport './index.scss'\n\nexport type SelectFieldProps = FormFieldBase & {\n hasMany?: boolean\n isClearable?: boolean\n isSortable?: boolean\n name?: string\n onChange?: (e: string) => void\n options?: Option[]\n path?: string\n value?: string\n width?: string\n}\n\nconst formatOptions = (options: Option[]): OptionObject[] =>\n options.map((option) => {\n if (typeof option === 'object' && (option.value || option.value === '')) {\n return option\n }\n\n return {\n label: option,\n value: option,\n } as OptionObject\n })\n\nconst SelectField: React.FC<SelectFieldProps> = (props) => {\n const {\n name,\n AfterInput,\n BeforeInput,\n CustomDescription,\n CustomError,\n CustomLabel,\n className,\n descriptionProps,\n errorProps,\n hasMany = false,\n isClearable = true,\n isSortable = true,\n label,\n labelProps,\n onChange: onChangeFromProps,\n options: optionsFromProps = [],\n path: pathFromProps,\n readOnly: readOnlyFromProps,\n required,\n style,\n validate,\n width,\n } = props\n\n const { i18n } = useTranslation()\n\n const [options] = useState(formatOptions(optionsFromProps))\n\n const memoizedValidate: ClientValidate = useCallback(\n (value, validationOptions) => {\n if (typeof validate === 'function')\n return validate(value, { ...validationOptions, hasMany, options, required })\n },\n [validate, required, hasMany, options],\n )\n\n const { path: pathFromContext, readOnly: readOnlyFromContext } = useFieldProps()\n const readOnly = readOnlyFromProps || readOnlyFromContext\n\n const { path, setValue, showError, value } = useField({\n path: pathFromContext || pathFromProps || name,\n validate: memoizedValidate,\n })\n\n let valueToRender\n\n if (hasMany && Array.isArray(value)) {\n valueToRender = value.map((val) => {\n const matchingOption = options.find((option) => option.value === val)\n return {\n label: matchingOption ? getTranslation(matchingOption.label, i18n) : val,\n value: matchingOption?.value ?? val,\n }\n })\n } else if (value) {\n const matchingOption = options.find((option) => option.value === value)\n valueToRender = {\n label: matchingOption ? getTranslation(matchingOption.label, i18n) : value,\n value: matchingOption?.value ?? value,\n }\n }\n\n const onChange = useCallback(\n (selectedOption) => {\n if (!readOnly) {\n let newValue\n if (!selectedOption) {\n newValue = null\n } else if (hasMany) {\n if (Array.isArray(selectedOption)) {\n newValue = selectedOption.map((option) => option.value)\n } else {\n newValue = []\n }\n } else {\n newValue = selectedOption.value\n }\n\n if (typeof onChangeFromProps === 'function') {\n onChangeFromProps(newValue)\n }\n\n setValue(newValue)\n }\n },\n [readOnly, hasMany, setValue, onChangeFromProps],\n )\n\n return (\n <div\n className={[\n fieldBaseClass,\n 'select',\n className,\n showError && 'error',\n readOnly && 'read-only',\n ]\n .filter(Boolean)\n .join(' ')}\n id={`field-${path.replace(/\\./g, '__')}`}\n style={{\n ...style,\n width,\n }}\n >\n <FieldError CustomError={CustomError} path={path} {...(errorProps || {})} />\n <FieldLabel\n CustomLabel={CustomLabel}\n label={label}\n required={required}\n {...(labelProps || {})}\n />\n <div>\n {BeforeInput}\n <ReactSelect\n disabled={readOnly}\n isClearable={isClearable}\n isMulti={hasMany}\n isSortable={isSortable}\n onChange={onChange}\n options={options.map((option) => ({\n ...option,\n label: getTranslation(option.label, i18n),\n }))}\n showError={showError}\n value={valueToRender as OptionObject}\n />\n {AfterInput}\n </div>\n {CustomDescription !== undefined ? (\n CustomDescription\n ) : (\n <FieldDescription {...(descriptionProps || {})} />\n )}\n </div>\n )\n}\n\nexport const Select = withCondition(SelectField)\n"],"names":["getTranslation","FieldDescription","FieldError","FieldLabel","useFieldProps","React","useCallback","useState","ReactSelect","useField","withCondition","useTranslation","fieldBaseClass","formatOptions","options","map","option","value","label","SelectField","props","name","AfterInput","BeforeInput","CustomDescription","CustomError","CustomLabel","className","descriptionProps","errorProps","hasMany","isClearable","isSortable","labelProps","onChange","onChangeFromProps","optionsFromProps","path","pathFromProps","readOnly","readOnlyFromProps","required","style","validate","width","i18n","memoizedValidate","validationOptions","pathFromContext","readOnlyFromContext","setValue","showError","valueToRender","Array","isArray","val","matchingOption","find","selectedOption","newValue","div","filter","Boolean","join","id","replace","disabled","isMulti","undefined","Select"],"rang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WAAWD,eAAe3C,GAAG,CAAC,CAACC,SAAWA,OAAOC,KAAK;gBACxD,OAAO;oBACL0C,WAAW,EAAE;gBACf;YACF,OAAO;gBACLA,WAAWD,eAAezC,KAAK;YACjC;YAEA,IAAI,OAAOkB,sBAAsB,YAAY;gBAC3CA,kBAAkBwB;YACpB;YAEAT,SAASS;QACX;IACF,GACA;QAACpB;QAAUT;QAASoB;QAAUf;KAAkB;IAGlD,qBACE,oBAACyB;QACCjC,WAAW;YACTf;YACA;YACAe;YACAwB,aAAa;YACbZ,YAAY;SACb,CACEsB,MAAM,CAACC,SACPC,IAAI,CAAC;QACRC,IAAI,CAAC,MAAM,EAAE3B,KAAK4B,OAAO,CAAC,OAAO,MAAM,CAAC;QACxCvB,OAAO;YACL,GAAGA,KAAK;YACRE;QACF;qBAEA,oBAAC1C;QAAWuB,aAAaA;QAAaY,MAAMA;QAAO,GAAIR,cAAc,CAAC,CAAC;sBACvE,oBAAC1B;QACCuB,aAAaA;QACbR,OAAOA;QACPuB,UAAUA;QACT,GAAIR,cAAc,CAAC,CAAC;sBAEvB,oBAAC2B,aACErC,2BACD,oBAACf;QACC0D,UAAU3B;QACVR,aAAaA;QACboC,SAASrC;QACTE,YAAYA;QACZE,UAAUA;QACVpB,SAASA,QAAQC,GAAG,CAAC,CAACC,SAAY,CAAA;gBAChC,GAAGA,MAAM;gBACTE,OAAOlB,eAAegB,OAAOE,KAAK,EAAE2B;YACtC,CAAA;QACAM,WAAWA;QACXlC,OAAOmC;QAER9B,aAEFE,sBAAsB4C,YACrB5C,kCAEA,oBAACvB,kBAAsB2B,oBAAoB,CAAC;AAIpD;AAEA,OAAO,MAAMyC,SAAS3D,cAAcS,aAAY"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/fields/Text/index.tsx"],"names":[],"mappings":"AAKA,OAAO,KAA2C,MAAM,OAAO,CAAA;AAG/D,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;AAOhE,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAA;AACtC,OAAO,cAAc,CAAA;AAErB,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,cAAc,EAAE,CAAA;AAuIpD,eAAO,MAAM,IAAI,0BAA2B,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/fields/Text/index.tsx"],"names":[],"mappings":"AAKA,OAAO,KAA2C,MAAM,OAAO,CAAA;AAG/D,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;AAOhE,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAA;AACtC,OAAO,cAAc,CAAA;AAErB,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,cAAc,EAAE,CAAA;AAyIpD,eAAO,MAAM,IAAI,0BAA2B,CAAA"}
@@ -9,7 +9,7 @@ import { isFieldRTL } from '../shared/index.js';
9
9
  import { TextInput } from './Input.js';
10
10
  export { TextInput };
11
11
  const TextField = (props)=>{
12
- const { name, AfterInput, BeforeInput, CustomDescription, CustomError, CustomLabel, className, descriptionProps, errorProps, hasMany, inputRef, labelProps, localized, maxLength, maxRows, minLength, minRows, path: pathFromProps, placeholder, readOnly: readOnlyFromProps, required, rtl, style, validate, width } = props;
12
+ const { name, AfterInput, BeforeInput, CustomDescription, CustomError, CustomLabel, className, descriptionProps, errorProps, hasMany, inputRef, label, labelProps, localized, maxLength, maxRows, minLength, minRows, path: pathFromProps, placeholder, readOnly: readOnlyFromProps, required, rtl, style, validate, width } = props;
13
13
  const locale = useLocale();
14
14
  const { localization: localizationConfig } = useConfig();
15
15
  const memoizedValidate = useCallback((value, options)=>{
@@ -87,6 +87,7 @@ const TextField = (props)=>{
87
87
  errorProps: errorProps,
88
88
  hasMany: hasMany,
89
89
  inputRef: inputRef,
90
+ label: label,
90
91
  labelProps: labelProps,
91
92
  maxRows: maxRows,
92
93
  minRows: minRows,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/fields/Text/index.tsx"],"sourcesContent":["'use client'\nimport type { ClientValidate } from 'payload/types'\nimport type {} from 'payload/types'\n\nimport { useFieldProps } from '@payloadcms/ui/forms/FieldPropsProvider'\nimport React, { useCallback, useEffect, useState } from 'react'\n\nimport type { Option } from '../../elements/ReactSelect/types.js'\nimport type { TextFieldProps, TextInputProps } 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 { useLocale } from '../../providers/Locale/index.js'\nimport { isFieldRTL } from '../shared/index.js'\nimport { TextInput } from './Input.js'\nimport './index.scss'\n\nexport { TextFieldProps, TextInput, TextInputProps }\n\nconst TextField: React.FC<TextFieldProps> = (props) => {\n const {\n name,\n AfterInput,\n BeforeInput,\n CustomDescription,\n CustomError,\n CustomLabel,\n className,\n descriptionProps,\n errorProps,\n hasMany,\n inputRef,\n labelProps,\n localized,\n maxLength,\n maxRows,\n minLength,\n minRows,\n path: pathFromProps,\n placeholder,\n readOnly: readOnlyFromProps,\n required,\n rtl,\n style,\n validate,\n width,\n } = props\n\n const locale = useLocale()\n\n const { localization: localizationConfig } = useConfig()\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, minLength, maxLength, required],\n )\n\n const { path: pathFromContext, readOnly: readOnlyFromContext } = useFieldProps()\n const readOnly = readOnlyFromProps || readOnlyFromContext\n\n const { formProcessing, path, setValue, showError, value } = useField({\n path: pathFromContext || pathFromProps || name,\n validate: memoizedValidate,\n })\n\n const renderRTL = isFieldRTL({\n fieldLocalized: localized,\n fieldRTL: rtl,\n locale,\n localizationConfig: localizationConfig || undefined,\n })\n\n const [valueToRender, setValueToRender] = useState<\n { id: string; label: string; value: { value: number } }[]\n >([]) // Only for hasMany\n\n const handleHasManyChange = useCallback(\n (selectedOption) => {\n if (!readOnly) {\n let newValue\n if (!selectedOption) {\n newValue = []\n } else if (Array.isArray(selectedOption)) {\n newValue = selectedOption.map((option) => option.value?.value || option.value)\n } else {\n newValue = [selectedOption.value?.value || selectedOption.value]\n }\n\n setValue(newValue)\n }\n },\n [readOnly, setValue],\n )\n\n // useEffect update valueToRender:\n useEffect(() => {\n if (hasMany && Array.isArray(value)) {\n setValueToRender(\n value.map((val, index) => {\n return {\n id: `${val}${index}`, // append index to avoid duplicate keys but allow duplicate numbers\n label: `${val}`,\n value: {\n // React-select automatically uses \"label-value\" as a key, so we will get that react duplicate key warning if we just pass in the value as multiple values can be the same. So we need to append the index to the toString() of the value to avoid that warning, as it uses that as the key.\n toString: () => `${val}${index}`,\n value: val?.value || val,\n },\n }\n }),\n )\n }\n }, [value, hasMany])\n\n return (\n <TextInput\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 hasMany={hasMany}\n inputRef={inputRef}\n labelProps={labelProps}\n maxRows={maxRows}\n minRows={minRows}\n onChange={\n hasMany\n ? handleHasManyChange\n : (e) => {\n setValue(e.target.value)\n }\n }\n path={path}\n placeholder={placeholder}\n readOnly={formProcessing || readOnly}\n required={required}\n rtl={renderRTL}\n showError={showError}\n style={style}\n value={(value as string) || ''}\n valueToRender={valueToRender as Option[]}\n width={width}\n />\n )\n}\n\nexport const Text = withCondition(TextField)\n"],"names":["useFieldProps","React","useCallback","useEffect","useState","useField","withCondition","useConfig","useLocale","isFieldRTL","TextInput","TextField","props","name","AfterInput","BeforeInput","CustomDescription","CustomError","CustomLabel","className","descriptionProps","errorProps","hasMany","inputRef","labelProps","localized","maxLength","maxRows","minLength","minRows","path","pathFromProps","placeholder","readOnly","readOnlyFromProps","required","rtl","style","validate","width","locale","localization","localizationConfig","memoizedValidate","value","options","pathFromContext","readOnlyFromContext","formProcessing","setValue","showError","renderRTL","fieldLocalized","fieldRTL","undefined","valueToRender","setValueToRender","handleHasManyChange","selectedOption","newValue","Array","isArray","map","option","val","index","id","label","toString","onChange","e","target","Text"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;AAIA,SAASA,aAAa,QAAQ,0CAAyC;AACvE,OAAOC,SAASC,WAAW,EAAEC,SAAS,EAAEC,QAAQ,QAAQ,QAAO;AAK/D,SAASC,QAAQ,QAAQ,gCAA+B;AACxD,SAASC,aAAa,QAAQ,qCAAoC;AAClE,SAASC,SAAS,QAAQ,kCAAiC;AAC3D,SAASC,SAAS,QAAQ,kCAAiC;AAC3D,SAASC,UAAU,QAAQ,qBAAoB;AAC/C,SAASC,SAAS,QAAQ,aAAY;AAGtC,SAAyBA,SAAS,GAAkB;AAEpD,MAAMC,YAAsC,CAACC;IAC3C,MAAM,EACJC,IAAI,EACJC,UAAU,EACVC,WAAW,EACXC,iBAAiB,EACjBC,WAAW,EACXC,WAAW,EACXC,SAAS,EACTC,gBAAgB,EAChBC,UAAU,EACVC,OAAO,EACPC,QAAQ,EACRC,UAAU,EACVC,SAAS,EACTC,SAAS,EACTC,OAAO,EACPC,SAAS,EACTC,OAAO,EACPC,MAAMC,aAAa,EACnBC,WAAW,EACXC,UAAUC,iBAAiB,EAC3BC,QAAQ,EACRC,GAAG,EACHC,KAAK,EACLC,QAAQ,EACRC,KAAK,EACN,GAAG3B;IAEJ,MAAM4B,SAAShC;IAEf,MAAM,EAAEiC,cAAcC,kBAAkB,EAAE,GAAGnC;IAE7C,MAAMoC,mBAAmCzC,YACvC,CAAC0C,OAAOC;QACN,IAAI,OAAOP,aAAa,YACtB,OAAOA,SAASM,OAAO;YAAE,GAAGC,OAAO;YAAEnB;YAAWE;YAAWO;QAAS;IACxE,GACA;QAACG;QAAUV;QAAWF;QAAWS;KAAS;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ACpB;QAAOtB;KAAQ;IAEnB,qBACE,oBAACZ;QACCI,YAAYA;QACZC,aAAaA;QACbC,mBAAmBA;QACnBC,aAAaA;QACbC,aAAaA;QACbC,WAAWA;QACXC,kBAAkBA;QAClBC,YAAYA;QACZC,SAASA;QACTC,UAAUA;QACVC,YAAYA;QACZG,SAASA;QACTE,SAASA;QACTwC,UACE/C,UACImC,sBACA,CAACa;YACCrB,SAASqB,EAAEC,MAAM,CAAC3B,KAAK;QACzB;QAENd,MAAMA;QACNE,aAAaA;QACbC,UAAUe,kBAAkBf;QAC5BE,UAAUA;QACVC,KAAKe;QACLD,WAAWA;QACXb,OAAOA;QACPO,OAAO,AAACA,SAAoB;QAC5BW,eAAeA;QACfhB,OAAOA;;AAGb;AAEA,OAAO,MAAMiC,OAAOlE,cAAcK,WAAU"}
1
+ {"version":3,"sources":["../../../src/fields/Text/index.tsx"],"sourcesContent":["'use client'\nimport type { ClientValidate } from 'payload/types'\nimport type {} from 'payload/types'\n\nimport { useFieldProps } from '@payloadcms/ui/forms/FieldPropsProvider'\nimport React, { useCallback, useEffect, useState } from 'react'\n\nimport type { Option } from '../../elements/ReactSelect/types.js'\nimport type { TextFieldProps, TextInputProps } 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 { useLocale } from '../../providers/Locale/index.js'\nimport { isFieldRTL } from '../shared/index.js'\nimport { TextInput } from './Input.js'\nimport './index.scss'\n\nexport { TextFieldProps, TextInput, TextInputProps }\n\nconst TextField: React.FC<TextFieldProps> = (props) => {\n const {\n name,\n AfterInput,\n BeforeInput,\n CustomDescription,\n CustomError,\n CustomLabel,\n className,\n descriptionProps,\n errorProps,\n hasMany,\n inputRef,\n label,\n labelProps,\n localized,\n maxLength,\n maxRows,\n minLength,\n minRows,\n path: pathFromProps,\n placeholder,\n readOnly: readOnlyFromProps,\n required,\n rtl,\n style,\n validate,\n width,\n } = props\n\n const locale = useLocale()\n\n const { localization: localizationConfig } = useConfig()\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, minLength, maxLength, required],\n )\n\n const { path: pathFromContext, readOnly: readOnlyFromContext } = useFieldProps()\n const readOnly = readOnlyFromProps || readOnlyFromContext\n\n const { formProcessing, path, setValue, showError, value } = useField({\n path: pathFromContext || pathFromProps || name,\n validate: memoizedValidate,\n })\n\n const renderRTL = isFieldRTL({\n fieldLocalized: localized,\n fieldRTL: rtl,\n locale,\n localizationConfig: localizationConfig || undefined,\n })\n\n const [valueToRender, setValueToRender] = useState<\n { id: string; label: string; value: { value: number } }[]\n >([]) // Only for hasMany\n\n const handleHasManyChange = useCallback(\n (selectedOption) => {\n if (!readOnly) {\n let newValue\n if (!selectedOption) {\n newValue = []\n } else if (Array.isArray(selectedOption)) {\n newValue = selectedOption.map((option) => option.value?.value || option.value)\n } else {\n newValue = [selectedOption.value?.value || selectedOption.value]\n }\n\n setValue(newValue)\n }\n },\n [readOnly, setValue],\n )\n\n // useEffect update valueToRender:\n useEffect(() => {\n if (hasMany && Array.isArray(value)) {\n setValueToRender(\n value.map((val, index) => {\n return {\n id: `${val}${index}`, // append index to avoid duplicate keys but allow duplicate numbers\n label: `${val}`,\n value: {\n // React-select automatically uses \"label-value\" as a key, so we will get that react duplicate key warning if we just pass in the value as multiple values can be the same. So we need to append the index to the toString() of the value to avoid that warning, as it uses that as the key.\n toString: () => `${val}${index}`,\n value: val?.value || val,\n },\n }\n }),\n )\n }\n }, [value, hasMany])\n\n return (\n <TextInput\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 hasMany={hasMany}\n inputRef={inputRef}\n label={label}\n labelProps={labelProps}\n maxRows={maxRows}\n minRows={minRows}\n onChange={\n hasMany\n ? handleHasManyChange\n : (e) => {\n setValue(e.target.value)\n }\n }\n path={path}\n placeholder={placeholder}\n readOnly={formProcessing || readOnly}\n required={required}\n rtl={renderRTL}\n showError={showError}\n style={style}\n value={(value as string) || ''}\n valueToRender={valueToRender as Option[]}\n width={width}\n />\n )\n}\n\nexport const Text = withCondition(TextField)\n"],"names":["useFieldProps","React","useCallback","useEffect","useState","useField","withCondition","useConfig","useLocale","isFieldRTL","TextInput","TextField","props","name","AfterInput","BeforeInput","CustomDescription","CustomError","CustomLabel","className","descriptionProps","errorProps","hasMany","inputRef","label","labelProps","localized","maxLength","maxRows","minLength","minRows","path","pathFromProps","placeholder","readOnly","readOnlyFromProps","required","rtl","style","validate","width","locale","localization","localizationConfig","memoizedValidate","value","options","pathFromContext","readOnlyFromContext","formProcessing","setValue","showError","renderRTL","fieldLocalized","fieldRTL","undefined","valueToRender","setValueToRender","handleHasManyChange","selectedOption","newValue","Array","isArray","map","option","val","index","id","toString","onChange","e","target","Text"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;AAIA,SAASA,aAAa,QAAQ,0CAAyC;AACvE,OAAOC,SAASC,WAAW,EAAEC,SAAS,EAAEC,QAAQ,QAAQ,QAAO;AAK/D,SAASC,QAAQ,QAAQ,gCAA+B;AACxD,SAASC,aAAa,QAAQ,qCAAoC;AAClE,SAASC,SAAS,QAAQ,kCAAiC;AAC3D,SAASC,SAAS,QAAQ,kCAAiC;AAC3D,SAASC,UAAU,QAAQ,qBAAoB;AAC/C,SAASC,SAAS,QAAQ,aAAY;AAGtC,SAAyBA,SAAS,GAAkB;AAEpD,MAAMC,YAAsC,CAACC;IAC3C,MAAM,EACJC,IAAI,EACJC,UAAU,EACVC,WAAW,EACXC,iBAAiB,EACjBC,WAAW,EACXC,WAAW,EACXC,SAAS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AAK;YAC/E,OAAO;gBACLe,WAAW;oBAACD,eAAed,KAAK,EAAEA,SAASc,eAAed,KAAK;iBAAC;YAClE;YAEAK,SAASU;QACX;IACF,GACA;QAAC1B;QAAUgB;KAAS;IAGtB,kCAAkC;IAClC/C,UAAU;QACR,IAAImB,WAAWuC,MAAMC,OAAO,CAACjB,QAAQ;YACnCY,iBACEZ,MAAMkB,GAAG,CAAC,CAACE,KAAKC;gBACd,OAAO;oBACLC,IAAI,CAAC,EAAEF,IAAI,EAAEC,MAAM,CAAC;oBACpB1C,OAAO,CAAC,EAAEyC,IAAI,CAAC;oBACfpB,OAAO;wBACL,4RAA4R;wBAC5RuB,UAAU,IAAM,CAAC,EAAEH,IAAI,EAAEC,MAAM,CAAC;wBAChCrB,OAAOoB,KAAKpB,SAASoB;oBACvB;gBACF;YACF;QAEJ;IACF,GAAG;QAACpB;QAAOvB;KAAQ;IAEnB,qBACE,oBAACZ;QACCI,YAAYA;QACZC,aAAaA;QACbC,mBAAmBA;QACnBC,aAAaA;QACbC,aAAaA;QACbC,WAAWA;QACXC,kBAAkBA;QAClBC,YAAYA;QACZC,SAASA;QACTC,UAAUA;QACVC,OAAOA;QACPC,YAAYA;QACZG,SAASA;QACTE,SAASA;QACTuC,UACE/C,UACIoC,sBACA,CAACY;YACCpB,SAASoB,EAAEC,MAAM,CAAC1B,KAAK;QACzB;QAENd,MAAMA;QACNE,aAAaA;QACbC,UAAUe,kBAAkBf;QAC5BE,UAAUA;QACVC,KAAKe;QACLD,WAAWA;QACXb,OAAOA;QACPO,OAAO,AAACA,SAAoB;QAC5BW,eAAeA;QACfhB,OAAOA;;AAGb;AAEA,OAAO,MAAMgC,OAAOlE,cAAcK,WAAU"}
@@ -1,11 +1,10 @@
1
- import type { FieldBase, TextField } from 'payload/types';
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,SAAS,EAAE,MAAM,eAAe,CAAA;AACzD,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,KAAK,CAAC,EAAE,SAAS,CAAC,OAAO,CAAC,CAAA;IAC1B,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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,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 { FieldBase, 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 label?: FieldBase['label']\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":"AAqBA,WAUC"}
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;AAoFhE,eAAO,MAAM,QAAQ,8BAA+B,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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","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,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,GAAGzB;IAEJ,MAAM,EAAE0B,IAAI,EAAE,GAAG9B;IAEjB,MAAM,EAAE+B,YAAY,EAAE,GAAGhC;IAEzB,MAAMiC,QAAQ/B,WAAW;QACvBgC,gBAAgBjB;QAChBkB,UAAUR;QACVX;QACAoB,oBAAoBJ,gBAAgBK;IACtC;IAEA,MAAMC,mBAAmCzC,YACvC,CAAC0C,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,GAAG/C;IACjE,MAAM4B,WAAWC,qBAAqBkB;IAEtC,MAAM,EAAEtB,IAAI,EAAEuB,QAAQ,EAAEC,SAAS,EAAEL,KAAK,EAAE,GAAGzC,SAAiB;QAC5DsB,MAAMqB,mBAAmBpB,iBAAiBf;QAC1CuB,UAAUS;IACZ;IAEA,qBACE,oBAACnC;QACCI,YAAYA;QACZC,aAAaA;QACbC,mBAAmBA;QACnBC,aAAaA;QACbC,aAAaA;QACbC,WAAWA;QACXC,kBAAkBA;QAClBC,YAAYA;QACZC,YAAYA;QACZ8B,UAAU,CAACC;YACTH,SAASG,EAAEC,MAAM,CAACR,KAAK;QACzB;QACAnB,MAAMA;QACNE,aAAa5B,eAAe4B,aAAaS;QACzCR,UAAUA;QACVE,UAAUA;QACVC,MAAMA;QACNC,KAAKM;QACLW,WAAWA;QACXhB,OAAOA;QACPW,OAAOA;QACPT,OAAOA;;AAGb;AAEA,OAAO,MAAMkB,WAAWjD,cAAcK,eAAc"}
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","readOnlyFrom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U;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 { FieldBase, TextareaField as TextareaFieldType } from 'payload/types';
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,SAAS,EAAE,aAAa,IAAI,iBAAiB,EAAE,MAAM,eAAe,CAAA;AAElF,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,OAAO,CAAA;AAExC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAE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AAM,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 { FieldBase, 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 label?: FieldBase['label']\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":"AAiBA,WAKC"}
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,KAAK,CAAC,EAAE,WAAW,CAAC,OAAO,CAAC,CAAA;IAC5B,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
+ {"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 label?: UploadField['label']\n name?: string\n path?: string\n relationTo?: UploadField['relationTo']\n width?: string\n}\n"],"names":[],"rangeMappings":"","mappings":"AAIA,WAOC"}
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
- labelProps?: LabelProps;
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,MAA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b,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 labelProps?: LabelProps\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":"AAUA,OAAO,MAAMA,iBAAiB,aAAY;AAyB1C;;;;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
+ {"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;AAG/C,OAAO,KAAK,MAAM,OAAO,CAAA;AAMzB,OAAO,cAAc,CAAA;AA6BrB,eAAO,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,UAAU,CAQ3C,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 htmlFor = htmlForFromProps || generateFieldID(path, uuid);
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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;AAIA,SAASA,cAAc,QAAQ,2BAA0B;AACzD,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,MAAMM,UAAUC,oBAAoBR,gBAAgBc,MAAMD;IAE1D,MAAM,EAAEE,IAAI,EAAE,GAAGhB;IAEjB,IAAIW,gBAAgB;QAClB,qBACE,oBAACJ;YAAQU,WAAW,CAAC,YAAY,EAAEJ,WAAW,aAAa,GAAG,CAAC;YAAEL,SAASA;WACvEV,eAAea,gBAAgBK,OAC/BJ,YAAY,CAACC,0BAAY,oBAACK;YAAKD,WAAU;WAAW;IAG3D;IAEA,OAAO;AACT;AAEA,OAAO,MAAME,aAAmC,CAACd;IAC/C,MAAM,EAAEe,WAAW,EAAE,GAAGf;IAExB,IAAIe,gBAAgBC,WAAW;QAC7B,OAAOD;IACT;IAEA,qBAAO,oBAAChB,mBAAsBC;AAChC,EAAC"}
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;AAYD,MAAM,MAAM,KAAK,GAAG;IAClB,QAAQ,EAAE,K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AAM,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 path = React.useContext(FieldPropsContext);
27
- return path;
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 path = React.useContext(FieldPropsContext)\n return path\n}\n"],"names":["React","FieldPropsContext","createContext","type","indexPath","path","permissions","readOnly","schemaPath","siblingPermissions","FieldPropsProvider","children","Provider","value","useFieldProps","useContext"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;AAIA,OAAOA,WAAW,QAAO;AAczB,MAAMC,kCAAoBD,MAAME,aAAa,CAAwB;IACnEC,MAAM;IACNC,WAAW;IACXC,MAAM;IACNC,aAAa,CAAC;IACdC,UAAU;IACVC,YAAY;IACZC,oBAAoB,CAAC;AACvB;AAeA,OAAO,MAAMC,qBAAsC,CAAC,EAClDP,IAAI,EACJQ,QAAQ,EACRP,SAAS,EACTC,IAAI,EACJC,WAAW,EACXC,QAAQ,EACRC,UAAU,EACVC,kBAAkB,EACnB;IACC,qBACE,oBAACR,kBAAkBW,QAAQ;QACzBC,OAAO;YACLV;YACAC;YACAC;YACAC;YACAC;YACAC;YACAC;QACF;OAECE;AAGP,EAAC;AAED,OAAO,MAAMG,gBAAgB;IAC3B,MAAMT,OAAOL,MAAMe,UAAU,CAACd;IAC9B,OAAOI;AACT,EAAC"}
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;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AG,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","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,YAAYA;QACZE,oBAAoBA;QACpBb,MAAMA;OAELC,gBAAgBsB,YAAYtB,4BAAc,oBAACqB,cAAiBnB;AAGnE,EAAC"}
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,CA+ExC,CAAA"}
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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","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,U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EAAEA,WAAW,CAAC;gBACnFM,UAAUA;gBACVG,KAAKT;gBACLO,MAAMA;gBACNnC,MAAMA;gBACNC,aAAaA,aAAa,CAACkC,KAAK;gBAChCF,UAAUA;gBACV/B,YAAYA;gBACZoC,oBAAoBrC;gBACpB4B,MAAMA;;QAGZ;IAGR;IAEA,OAAO;AACT,EAAC"}
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,oBAAoB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from '@payloadcms/translations';
2
- import type { LabelProps, RowLabel, RowLabelComponent } from 'payload/types';
3
- import React from 'react';
1
+ import type { I18nClient } from '@payloadcms/translations';
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;
7
- i18n: I18n;
7
+ i18n: I18nClient;
8
8
  path: string;
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,QAAQ,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAA;AAE5E,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,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;AAED,wBAAgB,WAAW,CAAC,KAAK,EAAE,QAAQ,GAAG,KAAK,IAAI,iBAAiB,CAEvE"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/forms/RowLabel/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAA;AAC1D,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,UAAU,CAAA;IAChB,IAAI,EAAE,MAAM,CAAA;IACZ,QAAQ,CAAC,EAAE,UAAU,CAAC,OAAO,CAAC,CAAA;IAC9B,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB,CAAA"}