@payloadcms/ui 3.0.0-beta.73 → 3.0.0-beta.75

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 (277) hide show
  1. package/dist/elements/ArrayAction/index.scss +0 -13
  2. package/dist/elements/Banner/index.scss +1 -1
  3. package/dist/elements/Button/index.js +1 -1
  4. package/dist/elements/Button/index.js.map +1 -1
  5. package/dist/elements/Button/index.scss +112 -118
  6. package/dist/elements/Button/types.d.ts +1 -1
  7. package/dist/elements/Button/types.d.ts.map +1 -1
  8. package/dist/elements/Button/types.js.map +1 -1
  9. package/dist/elements/Card/index.scss +38 -9
  10. package/dist/elements/CodeEditor/CodeEditor.d.ts.map +1 -1
  11. package/dist/elements/CodeEditor/CodeEditor.js +2 -1
  12. package/dist/elements/CodeEditor/CodeEditor.js.map +1 -1
  13. package/dist/elements/Collapsible/index.scss +61 -30
  14. package/dist/elements/ColumnSelector/index.scss +20 -2
  15. package/dist/elements/DocumentControls/index.scss +2 -2
  16. package/dist/elements/DocumentDrawer/index.scss +4 -6
  17. package/dist/elements/DraggableSortable/DraggableSortableItem/index.d.ts.map +1 -1
  18. package/dist/elements/DraggableSortable/DraggableSortableItem/index.js +4 -2
  19. package/dist/elements/DraggableSortable/DraggableSortableItem/index.js.map +1 -1
  20. package/dist/elements/DraggableSortable/useDraggableSortable/index.d.ts.map +1 -1
  21. package/dist/elements/DraggableSortable/useDraggableSortable/index.js +10 -4
  22. package/dist/elements/DraggableSortable/useDraggableSortable/index.js.map +1 -1
  23. package/dist/elements/DraggableSortable/useDraggableSortable/types.d.ts +1 -0
  24. package/dist/elements/DraggableSortable/useDraggableSortable/types.d.ts.map +1 -1
  25. package/dist/elements/DraggableSortable/useDraggableSortable/types.js.map +1 -1
  26. package/dist/elements/Drawer/index.scss +11 -7
  27. package/dist/elements/Dropzone/index.js +2 -2
  28. package/dist/elements/Dropzone/index.js.map +1 -1
  29. package/dist/elements/Dropzone/index.scss +7 -3
  30. package/dist/elements/EditMany/index.scss +2 -2
  31. package/dist/elements/EditUpload/index.scss +4 -1
  32. package/dist/elements/FileDetails/FileMeta/index.scss +1 -0
  33. package/dist/elements/FileDetails/index.d.ts.map +1 -1
  34. package/dist/elements/FileDetails/index.js +3 -1
  35. package/dist/elements/FileDetails/index.js.map +1 -1
  36. package/dist/elements/FileDetails/index.scss +28 -12
  37. package/dist/elements/Hamburger/index.d.ts.map +1 -1
  38. package/dist/elements/Hamburger/index.js +17 -41
  39. package/dist/elements/Hamburger/index.js.map +1 -1
  40. package/dist/elements/Hamburger/index.scss +22 -102
  41. package/dist/elements/HydrateAuthProvider/index.d.ts +13 -0
  42. package/dist/elements/HydrateAuthProvider/index.d.ts.map +1 -0
  43. package/dist/elements/{HydrateClientUser → HydrateAuthProvider}/index.js +3 -6
  44. package/dist/elements/HydrateAuthProvider/index.js.map +1 -0
  45. package/dist/elements/IDLabel/index.js +1 -1
  46. package/dist/elements/IDLabel/index.js.map +1 -1
  47. package/dist/elements/IDLabel/index.scss +2 -2
  48. package/dist/elements/ListControls/index.d.ts.map +1 -1
  49. package/dist/elements/ListControls/index.js +5 -1
  50. package/dist/elements/ListControls/index.js.map +1 -1
  51. package/dist/elements/ListControls/index.scss +6 -12
  52. package/dist/elements/NavGroup/index.scss +2 -2
  53. package/dist/elements/Pill/index.d.ts.map +1 -1
  54. package/dist/elements/Pill/index.js +1 -5
  55. package/dist/elements/Pill/index.js.map +1 -1
  56. package/dist/elements/Pill/index.scss +8 -21
  57. package/dist/elements/Popup/index.scss +6 -0
  58. package/dist/elements/PreviewButton/index.d.ts.map +1 -1
  59. package/dist/elements/PreviewButton/index.js +3 -1
  60. package/dist/elements/PreviewButton/index.js.map +1 -1
  61. package/dist/elements/PublishButton/index.js +1 -1
  62. package/dist/elements/PublishButton/index.js.map +1 -1
  63. package/dist/elements/ReactSelect/MultiValue/index.scss +25 -3
  64. package/dist/elements/ReactSelect/MultiValueLabel/index.scss +1 -1
  65. package/dist/elements/ReactSelect/MultiValueRemove/index.scss +3 -3
  66. package/dist/elements/ReactSelect/ValueContainer/index.scss +5 -12
  67. package/dist/elements/ReactSelect/index.scss +2 -3
  68. package/dist/elements/RenderTitle/index.scss +1 -1
  69. package/dist/elements/SaveButton/index.d.ts.map +1 -1
  70. package/dist/elements/SaveButton/index.js +4 -2
  71. package/dist/elements/SaveButton/index.js.map +1 -1
  72. package/dist/elements/SaveDraftButton/index.d.ts.map +1 -1
  73. package/dist/elements/SaveDraftButton/index.js +4 -2
  74. package/dist/elements/SaveDraftButton/index.js.map +1 -1
  75. package/dist/elements/SearchFilter/index.d.ts.map +1 -1
  76. package/dist/elements/SearchFilter/index.js +11 -15
  77. package/dist/elements/SearchFilter/index.js.map +1 -1
  78. package/dist/elements/SearchFilter/index.scss +2 -1
  79. package/dist/elements/SelectRow/index.scss +1 -0
  80. package/dist/elements/StayLoggedIn/index.d.ts.map +1 -1
  81. package/dist/elements/StayLoggedIn/index.js +2 -0
  82. package/dist/elements/StayLoggedIn/index.js.map +1 -1
  83. package/dist/elements/Table/DefaultCell/fields/Code/index.scss +1 -1
  84. package/dist/elements/Table/DefaultCell/fields/JSON/index.scss +1 -1
  85. package/dist/elements/Table/index.scss +10 -1
  86. package/dist/elements/ThumbnailCard/index.scss +10 -1
  87. package/dist/elements/Upload/index.scss +2 -1
  88. package/dist/elements/WhereBuilder/Condition/index.d.ts.map +1 -1
  89. package/dist/elements/WhereBuilder/Condition/index.js +8 -2
  90. package/dist/elements/WhereBuilder/Condition/index.js.map +1 -1
  91. package/dist/exports/client/{CodeEditor-OI35YO7H.js → CodeEditor-UPOVAXRP.js} +2 -2
  92. package/dist/exports/client/{CodeEditor-OI35YO7H.js.map → CodeEditor-UPOVAXRP.js.map} +2 -2
  93. package/dist/exports/client/{DatePicker-5IFHNQHA.js → DatePicker-XJHHMZP7.js} +2 -2
  94. package/dist/exports/client/chunk-TIH7OFW3.js +30 -0
  95. package/dist/exports/client/{chunk-WDFUZ6GL.js.map → chunk-TIH7OFW3.js.map} +2 -2
  96. package/dist/exports/client/index.d.ts +2 -1
  97. package/dist/exports/client/index.d.ts.map +1 -1
  98. package/dist/exports/client/index.js +27 -27
  99. package/dist/exports/client/index.js.map +4 -4
  100. package/dist/fields/Array/ArrayRow.d.ts.map +1 -1
  101. package/dist/fields/Array/ArrayRow.js +4 -2
  102. package/dist/fields/Array/ArrayRow.js.map +1 -1
  103. package/dist/fields/Array/index.scss +3 -1
  104. package/dist/fields/Blocks/BlocksDrawer/BlockSearch/index.scss +3 -4
  105. package/dist/fields/Blocks/SectionTitle/index.scss +1 -0
  106. package/dist/fields/Checkbox/index.d.ts.map +1 -1
  107. package/dist/fields/Checkbox/index.js.map +1 -1
  108. package/dist/fields/Checkbox/index.scss +7 -8
  109. package/dist/fields/Code/index.scss +6 -0
  110. package/dist/fields/ConfirmPassword/index.d.ts.map +1 -1
  111. package/dist/fields/ConfirmPassword/index.js +10 -16
  112. package/dist/fields/ConfirmPassword/index.js.map +1 -1
  113. package/dist/fields/DateTime/index.d.ts.map +1 -1
  114. package/dist/fields/DateTime/index.js.map +1 -1
  115. package/dist/fields/Email/index.d.ts.map +1 -1
  116. package/dist/fields/Email/index.js.map +1 -1
  117. package/dist/fields/JSON/index.d.ts.map +1 -1
  118. package/dist/fields/JSON/index.js.map +1 -1
  119. package/dist/fields/Password/index.d.ts +2 -2
  120. package/dist/fields/Password/index.d.ts.map +1 -1
  121. package/dist/fields/Password/index.js.map +1 -1
  122. package/dist/fields/Point/index.d.ts.map +1 -1
  123. package/dist/fields/Point/index.js.map +1 -1
  124. package/dist/fields/RadioGroup/Radio/index.d.ts.map +1 -1
  125. package/dist/fields/RadioGroup/Radio/index.js +4 -1
  126. package/dist/fields/RadioGroup/Radio/index.js.map +1 -1
  127. package/dist/fields/RadioGroup/Radio/index.scss +13 -6
  128. package/dist/fields/RadioGroup/index.scss +5 -1
  129. package/dist/fields/Relationship/AddNew/index.scss +3 -0
  130. package/dist/fields/Relationship/index.d.ts.map +1 -1
  131. package/dist/fields/Relationship/index.js +2 -1
  132. package/dist/fields/Relationship/index.js.map +1 -1
  133. package/dist/fields/Relationship/index.scss +7 -0
  134. package/dist/fields/Relationship/select-components/MultiValueLabel/index.scss +8 -5
  135. package/dist/fields/Select/index.d.ts.map +1 -1
  136. package/dist/fields/Select/index.js.map +1 -1
  137. package/dist/fields/Text/Input.d.ts.map +1 -1
  138. package/dist/fields/Text/Input.js +13 -17
  139. package/dist/fields/Text/Input.js.map +1 -1
  140. package/dist/fields/Text/index.d.ts.map +1 -1
  141. package/dist/fields/Text/index.js.map +1 -1
  142. package/dist/fields/Text/index.scss +6 -0
  143. package/dist/fields/Textarea/index.d.ts.map +1 -1
  144. package/dist/fields/Textarea/index.js.map +1 -1
  145. package/dist/fields/Textarea/index.scss +1 -6
  146. package/dist/fields/Upload/index.scss +10 -3
  147. package/dist/forms/Form/index.d.ts.map +1 -1
  148. package/dist/forms/Form/index.js +17 -9
  149. package/dist/forms/Form/index.js.map +1 -1
  150. package/dist/forms/RenderFields/index.scss +1 -1
  151. package/dist/forms/buildStateFromSchema/addFieldStatePromise.d.ts +1 -0
  152. package/dist/forms/buildStateFromSchema/addFieldStatePromise.d.ts.map +1 -1
  153. package/dist/forms/buildStateFromSchema/addFieldStatePromise.js +2 -1
  154. package/dist/forms/buildStateFromSchema/addFieldStatePromise.js.map +1 -1
  155. package/dist/forms/buildStateFromSchema/index.d.ts +1 -0
  156. package/dist/forms/buildStateFromSchema/index.d.ts.map +1 -1
  157. package/dist/forms/buildStateFromSchema/index.js +2 -1
  158. package/dist/forms/buildStateFromSchema/index.js.map +1 -1
  159. package/dist/forms/buildStateFromSchema/iterateFields.d.ts +2 -1
  160. package/dist/forms/buildStateFromSchema/iterateFields.d.ts.map +1 -1
  161. package/dist/forms/buildStateFromSchema/iterateFields.js +2 -1
  162. package/dist/forms/buildStateFromSchema/iterateFields.js.map +1 -1
  163. package/dist/forms/useField/index.d.ts.map +1 -1
  164. package/dist/forms/useField/index.js +13 -7
  165. package/dist/forms/useField/index.js.map +1 -1
  166. package/dist/forms/useField/types.d.ts +3 -3
  167. package/dist/forms/useField/types.d.ts.map +1 -1
  168. package/dist/forms/useField/types.js.map +1 -1
  169. package/dist/icons/Calendar/index.d.ts.map +1 -1
  170. package/dist/icons/Calendar/index.js +8 -33
  171. package/dist/icons/Calendar/index.js.map +1 -1
  172. package/dist/icons/Calendar/index.scss +1 -1
  173. package/dist/icons/Check/index.d.ts.map +1 -1
  174. package/dist/icons/Check/index.js +8 -17
  175. package/dist/icons/Check/index.js.map +1 -1
  176. package/dist/icons/Check/index.scss +1 -1
  177. package/dist/icons/Chevron/index.js +5 -4
  178. package/dist/icons/Chevron/index.js.map +1 -1
  179. package/dist/icons/Chevron/index.scss +2 -5
  180. package/dist/icons/CloseMenu/index.d.ts.map +1 -1
  181. package/dist/icons/CloseMenu/index.js +8 -22
  182. package/dist/icons/CloseMenu/index.js.map +1 -1
  183. package/dist/icons/CloseMenu/index.scss +2 -2
  184. package/dist/icons/CodeBlock/index.d.ts.map +1 -1
  185. package/dist/icons/CodeBlock/index.js +8 -14
  186. package/dist/icons/CodeBlock/index.js.map +1 -1
  187. package/dist/icons/Copy/index.d.ts.map +1 -1
  188. package/dist/icons/Copy/index.js +12 -16
  189. package/dist/icons/Copy/index.js.map +1 -1
  190. package/dist/icons/Copy/index.scss +1 -1
  191. package/dist/icons/DragHandle/index.d.ts.map +1 -1
  192. package/dist/icons/DragHandle/index.js +19 -25
  193. package/dist/icons/DragHandle/index.js.map +1 -1
  194. package/dist/icons/DragHandle/index.scss +2 -0
  195. package/dist/icons/Edit/index.d.ts.map +1 -1
  196. package/dist/icons/Edit/index.js +8 -21
  197. package/dist/icons/Edit/index.js.map +1 -1
  198. package/dist/icons/Edit/index.scss +3 -3
  199. package/dist/icons/Line/index.d.ts.map +1 -1
  200. package/dist/icons/Line/index.js +7 -6
  201. package/dist/icons/Line/index.js.map +1 -1
  202. package/dist/icons/Line/index.scss +1 -1
  203. package/dist/icons/Link/index.d.ts.map +1 -1
  204. package/dist/icons/Link/index.js +11 -14
  205. package/dist/icons/Link/index.js.map +1 -1
  206. package/dist/icons/Link/index.scss +1 -1
  207. package/dist/icons/LogOut/index.d.ts.map +1 -1
  208. package/dist/icons/LogOut/index.js +9 -24
  209. package/dist/icons/LogOut/index.js.map +1 -1
  210. package/dist/icons/LogOut/index.scss +1 -1
  211. package/dist/icons/Menu/index.d.ts.map +1 -1
  212. package/dist/icons/Menu/index.js +10 -28
  213. package/dist/icons/Menu/index.js.map +1 -1
  214. package/dist/icons/Menu/index.scss +3 -2
  215. package/dist/icons/MinimizeMaximize/index.d.ts.map +1 -1
  216. package/dist/icons/MinimizeMaximize/index.js +8 -35
  217. package/dist/icons/MinimizeMaximize/index.js.map +1 -1
  218. package/dist/icons/More/index.d.ts.map +1 -1
  219. package/dist/icons/More/index.js +10 -13
  220. package/dist/icons/More/index.js.map +1 -1
  221. package/dist/icons/More/index.scss +1 -0
  222. package/dist/icons/Plus/index.d.ts.map +1 -1
  223. package/dist/icons/Plus/index.js +10 -20
  224. package/dist/icons/Plus/index.js.map +1 -1
  225. package/dist/icons/Plus/index.scss +1 -1
  226. package/dist/icons/Search/index.d.ts.map +1 -1
  227. package/dist/icons/Search/index.js +8 -18
  228. package/dist/icons/Search/index.js.map +1 -1
  229. package/dist/icons/Search/index.scss +1 -1
  230. package/dist/icons/Swap/index.d.ts.map +1 -1
  231. package/dist/icons/Swap/index.js +8 -28
  232. package/dist/icons/Swap/index.js.map +1 -1
  233. package/dist/icons/Swap/index.scss +2 -2
  234. package/dist/icons/X/index.d.ts.map +1 -1
  235. package/dist/icons/X/index.js +10 -21
  236. package/dist/icons/X/index.js.map +1 -1
  237. package/dist/icons/X/index.scss +3 -3
  238. package/dist/providers/Auth/index.d.ts +6 -2
  239. package/dist/providers/Auth/index.d.ts.map +1 -1
  240. package/dist/providers/Auth/index.js +4 -4
  241. package/dist/providers/Auth/index.js.map +1 -1
  242. package/dist/providers/ComponentMap/buildComponentMap/collections.d.ts +2 -1
  243. package/dist/providers/ComponentMap/buildComponentMap/collections.d.ts.map +1 -1
  244. package/dist/providers/ComponentMap/buildComponentMap/collections.js +2 -1
  245. package/dist/providers/ComponentMap/buildComponentMap/collections.js.map +1 -1
  246. package/dist/providers/ComponentMap/buildComponentMap/fields.d.ts +2 -1
  247. package/dist/providers/ComponentMap/buildComponentMap/fields.d.ts.map +1 -1
  248. package/dist/providers/ComponentMap/buildComponentMap/fields.js +9 -2
  249. package/dist/providers/ComponentMap/buildComponentMap/fields.js.map +1 -1
  250. package/dist/providers/ComponentMap/buildComponentMap/globals.d.ts +2 -1
  251. package/dist/providers/ComponentMap/buildComponentMap/globals.d.ts.map +1 -1
  252. package/dist/providers/ComponentMap/buildComponentMap/globals.js +2 -1
  253. package/dist/providers/ComponentMap/buildComponentMap/globals.js.map +1 -1
  254. package/dist/providers/ComponentMap/buildComponentMap/index.d.ts.map +1 -1
  255. package/dist/providers/ComponentMap/buildComponentMap/index.js +2 -0
  256. package/dist/providers/ComponentMap/buildComponentMap/index.js.map +1 -1
  257. package/dist/providers/Params/index.d.ts +2 -1
  258. package/dist/providers/Params/index.d.ts.map +1 -1
  259. package/dist/providers/Params/index.js.map +1 -1
  260. package/dist/providers/Root/index.d.ts +3 -1
  261. package/dist/providers/Root/index.d.ts.map +1 -1
  262. package/dist/providers/Root/index.js +3 -1
  263. package/dist/providers/Root/index.js.map +1 -1
  264. package/dist/scss/app.scss +2 -1
  265. package/dist/scss/toasts.scss +10 -3
  266. package/dist/scss/type.scss +14 -23
  267. package/dist/scss/vars.scss +26 -47
  268. package/dist/styles.css +1 -1
  269. package/dist/utilities/buildFormState.d.ts.map +1 -1
  270. package/dist/utilities/buildFormState.js +18 -7
  271. package/dist/utilities/buildFormState.js.map +1 -1
  272. package/package.json +8 -8
  273. package/dist/elements/HydrateClientUser/index.d.ts +0 -6
  274. package/dist/elements/HydrateClientUser/index.d.ts.map +0 -1
  275. package/dist/elements/HydrateClientUser/index.js.map +0 -1
  276. package/dist/exports/client/chunk-WDFUZ6GL.js +0 -30
  277. /package/dist/exports/client/{DatePicker-5IFHNQHA.js.map → DatePicker-XJHHMZP7.js.map} +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"ArrayRow.d.ts","sourceRoot":"","sources":["../../../src/fields/Array/ArrayRow.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,QAAQ,EAAE,gBAAgB,EAAE,GAAG,EAAE,MAAM,SAAS,CAAA;AAG1E,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,gEAAgE,CAAA;AAShH,OAAO,cAAc,CAAA;AAIrB,KAAK,aAAa,GAAG;IACnB,cAAc,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAChC,MAAM,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAA;IAClD,YAAY,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAA;IACxC,UAAU,EAAE,MAAM,CAAA;IAClB,QAAQ,EAAE,QAAQ,CAAA;IAClB,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,SAAS,EAAE,MAAM,CAAA;IACjB,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,MAAM,EAAE,UAAU,CAAC,QAAQ,CAAC,CAAA;IAC5B,OAAO,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,KAAK,IAAI,CAAA;IACrD,IAAI,EAAE,MAAM,CAAA;IACZ,WAAW,EAAE,gBAAgB,CAAA;IAC7B,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,SAAS,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAA;IACrC,GAAG,EAAE,GAAG,CAAA;IACR,QAAQ,EAAE,MAAM,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S,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAA;IACrC,GAAG,EAAE,GAAG,CAAA;IACR,QAAQ,EAAE,MAAM,CAAA;IAChB,QAAQ,EAAE,MAAM,CAAA;IAChB,UAAU,EAAE,MAAM,CAAA;IAClB,WAAW,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,KAAK,IAAI,CAAA;CACzD,GAAG,0BAA0B,CAAA;AAE9B,eAAO,MAAM,QAAQ,EAAE,KAAK,CAAC,EAAE,CAAC,aAAa,CAgH5C,CAAA"}
@@ -11,7 +11,7 @@ import { RowLabel } from '../../forms/RowLabel/index.js';
11
11
  import { useTranslation } from '../../providers/Translation/index.js';
12
12
  import './index.scss';
13
13
  const baseClass = 'array-field';
14
- export const ArrayRow = ({ CustomRowLabel, addRow, attributes, duplicateRow, errorCount, fieldMap, forceRender = false, hasMaxRows, indexPath, isSortable, labels, listeners, moveRow, path: parentPath, permissions, readOnly, removeRow, row, rowCount, rowIndex, schemaPath, setCollapse, setNodeRef, transform })=>{
14
+ export const ArrayRow = ({ CustomRowLabel, addRow, attributes, duplicateRow, errorCount, fieldMap, forceRender = false, hasMaxRows, indexPath, isDragging, isSortable, labels, listeners, moveRow, path: parentPath, permissions, readOnly, removeRow, row, rowCount, rowIndex, schemaPath, setCollapse, setNodeRef, transform, transition })=>{
15
15
  const path = `${parentPath}.${rowIndex}`;
16
16
  const { i18n } = useTranslation();
17
17
  const hasSubmitted = useFormSubmitted();
@@ -25,7 +25,9 @@ export const ArrayRow = ({ CustomRowLabel, addRow, attributes, duplicateRow, err
25
25
  id: `${parentPath.split('.').join('-')}-row-${rowIndex}`,
26
26
  ref: setNodeRef,
27
27
  style: {
28
- transform
28
+ transform,
29
+ transition,
30
+ zIndex: isDragging ? 1 : undefined
29
31
  },
30
32
  children: /*#__PURE__*/ _jsx(Collapsible, {
31
33
  actions: !readOnly ? /*#__PURE__*/ _jsx(ArrayAction, {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/fields/Array/ArrayRow.tsx"],"sourcesContent":["'use client'\nimport type { ArrayField, FieldMap, FieldPermissions, Row } from 'payload'\n\nimport { getTranslation } from '@payloadcms/translations'\nimport React from 'react'\n\nimport type { UseDraggableSortableReturn } from '../../elements/DraggableSortable/useDraggableSortable/types.js'\n\nimport { ArrayAction } from '../../elements/ArrayAction/index.js'\nimport { Collapsible } from '../../elements/Collapsible/index.js'\nimport { ErrorPill } from '../../elements/ErrorPill/index.js'\nimport { useFormSubmitted } from '../../forms/Form/context.js'\nimport { RenderFields } from '../../forms/RenderFields/index.js'\nimport { RowLabel } from '../../forms/RowLabel/index.js'\nimport { useTranslation } from '../../providers/Translation/index.js'\nimport './index.scss'\n\nconst baseClass = 'array-field'\n\ntype ArrayRowProps = {\n CustomRowLabel?: React.ReactNode\n addRow: (rowIndex: number) => Promise<void> | void\n duplicateRow: (rowIndex: number) => void\n errorCount: number\n fieldMap: FieldMap\n forceRender?: boolean\n hasMaxRows?: boolean\n indexPath: string\n isSortable?: boolean\n labels: ArrayField['labels']\n moveRow: (fromIndex: number, toIndex: number) => void\n path: string\n permissions: FieldPermissions\n readOnly?: boolean\n removeRow: (rowIndex: number) => void\n row: Row\n rowCount: number\n rowIndex: number\n schemaPath: string\n setCollapse: (rowID: string, collapsed: boolean) => void\n} & UseDraggableSortableReturn\n\nexport const ArrayRow: React.FC<ArrayRowProps> = ({\n CustomRowLabel,\n addRow,\n attributes,\n duplicateRow,\n errorCount,\n fieldMap,\n forceRender = false,\n hasMaxRows,\n indexPath,\n isSortable,\n labels,\n listeners,\n moveRow,\n path: parentPath,\n permissions,\n readOnly,\n removeRow,\n row,\n rowCount,\n rowIndex,\n schemaPath,\n setCollapse,\n setNodeRef,\n transform,\n}) => {\n const path = `${parentPath}.${rowIndex}`\n const { i18n } = useTranslation()\n const hasSubmitted = useFormSubmitted()\n\n const fallbackLabel = `${getTranslation(labels.singular, i18n)} ${String(rowIndex + 1).padStart(\n 2,\n '0',\n )}`\n\n const fieldHasErrors = errorCount > 0 && hasSubmitted\n\n const classNames = [\n `${baseClass}__row`,\n fieldHasErrors ? `${baseClass}__row--has-errors` : `${baseClass}__row--no-errors`,\n ]\n .filter(Boolean)\n .join(' ')\n\n return (\n <div\n id={`${parentPath.split('.').join('-')}-row-${rowIndex}`}\n key={`${parentPath}-row-${row.id}`}\n ref={setNodeRef}\n style={{\n transform,\n }}\n >\n <Collapsible\n actions={\n !readOnly ? (\n <ArrayAction\n addRow={addRow}\n duplicateRow={duplicateRow}\n hasMaxRows={hasMaxRows}\n index={rowIndex}\n isSortable={isSortable}\n moveRow={moveRow}\n removeRow={removeRow}\n rowCount={rowCount}\n />\n ) : undefined\n }\n className={classNames}\n collapsibleStyle={fieldHasErrors ? 'error' : 'default'}\n dragHandleProps={\n isSortable\n ? {\n id: row.id,\n attributes,\n listeners,\n }\n : undefined\n }\n header={\n <div className={`${baseClass}__row-header`}>\n <RowLabel\n RowLabelComponent={CustomRowLabel}\n i18n={i18n}\n path={path}\n rowLabel={fallbackLabel}\n rowNumber={rowIndex + 1}\n />\n {fieldHasErrors && <ErrorPill count={errorCount} i18n={i18n} withMessage />}\n </div>\n }\n isCollapsed={row.collapsed}\n onToggle={(collapsed) => setCollapse(row.id, collapsed)}\n >\n <RenderFields\n className={`${baseClass}__fields`}\n fieldMap={fieldMap}\n forceRender={forceRender}\n indexPath={indexPath}\n margins=\"small\"\n path={path}\n permissions={permissions?.fields}\n readOnly={readOnly}\n schemaPath={schemaPath}\n />\n </Collapsible>\n </div>\n )\n}\n"],"names":["getTranslation","React","ArrayAction","Collapsible","ErrorPill","useFormSubmitted","RenderFields","RowLabel","useTranslation","baseClass","ArrayRow","CustomRowLabel","addRow","attributes","duplicateRow","errorCount","fieldMap","forceRender","hasMaxRows","indexPath","isSortable","labels","listeners","moveRow","path","parentPath","permissions","readOnly","removeRow","row","rowCount","rowIndex","schemaPath","setCollapse","setNodeRef","transform","i18n","hasSubmitted","fallbackLabel","singular","String","padStart","fieldHasErrors","classNames","filter","Boolean","join","div","id","split","ref","style","actions","index","undefined","className","collapsibleStyle","dragHandleProps","header","RowLabelComponent","rowLabel","rowNumber","count","withMessage","isCollapsed","collapsed","onToggle","margins","fields"],"mappings":"AAAA;;AAGA,SAASA,cAAc,QAAQ,2BAA0B;AACzD,OAAOC,WAAW,QAAO;AAIzB,SAASC,WAAW,QAAQ,sCAAqC;AACjE,SAASC,WAAW,QAAQ,sCAAqC;AACjE,SAASC,SAAS,QAAQ,oCAAmC;AAC7D,SAASC,gBAAgB,QAAQ,8BAA6B;AAC9D,SAASC,YAAY,QAAQ,oCAAmC;AAChE,SAASC,QAAQ,QAAQ,gCAA+B;AACxD,SAASC,cAAc,QAAQ,uCAAsC;AACrE,OAAO,eAAc;AAErB,MAAMC,YAAY;AAyBlB,OAAO,MAAMC,WAAoC,CAAC,EAChDC,cAAc,EACdC,MAAM,EACNC,UAAU,EACVC,YAAY,EACZC,UAAU,EACVC,QAAQ,EACRC,cAAc,KAAK,EACnBC,UAAU,EACVC,SAAS,EACTC,UAAU,EACVC,MAAM,EACNC,SAAS,EACTC,OAAO,EACPC,MAAMC,UAAU,EAChBC,WAAW,EACXC,QAAQ,EACRC,SAAS,EACTC,GAAG,EACHC,QAAQ,EACRC,QAAQ,EACRC,UAAU,EACVC,WAAW,EACXC,UAAU,EACVC,SAAS,EACV;IACC,MAAMX,OAAO,CAAC,EAAEC,WAAW,CAAC,EAAEM,SAAS,CAAC;IACxC,MAAM,EAAEK,IAAI,EAAE,GAAG5B;IACjB,MAAM6B,eAAehC;IAErB,MAAMiC,gBAAgB,CAAC,EAAEtC,eAAeqB,OAAOkB,QAAQ,EAAEH,MAAM,CAAC,EAAEI,OAAOT,WAAW,GAAGU,QAAQ,CAC7F,GACA,KACA,CAAC;IAEH,MAAMC,iBAAiB3B,aAAa,KAAKsB;IAEzC,MAAMM,aAAa;QACjB,CAAC,EAAElC,UAAU,KAAK,CAAC;QACnBiC,iBAAiB,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/ArrayRow.tsx"],"sourcesContent":["'use client'\nimport type { ArrayField, FieldMap, FieldPermissions, Row } from 'payload'\n\nimport { getTranslation } from '@payloadcms/translations'\nimport React from 'react'\n\nimport type { UseDraggableSortableReturn } from '../../elements/DraggableSortable/useDraggableSortable/types.js'\n\nimport { ArrayAction } from '../../elements/ArrayAction/index.js'\nimport { Collapsible } from '../../elements/Collapsible/index.js'\nimport { ErrorPill } from '../../elements/ErrorPill/index.js'\nimport { useFormSubmitted } from '../../forms/Form/context.js'\nimport { RenderFields } from '../../forms/RenderFields/index.js'\nimport { RowLabel } from '../../forms/RowLabel/index.js'\nimport { useTranslation } from '../../providers/Translation/index.js'\nimport './index.scss'\n\nconst baseClass = 'array-field'\n\ntype ArrayRowProps = {\n CustomRowLabel?: React.ReactNode\n addRow: (rowIndex: number) => Promise<void> | void\n duplicateRow: (rowIndex: number) => void\n errorCount: number\n fieldMap: FieldMap\n forceRender?: boolean\n hasMaxRows?: boolean\n indexPath: string\n isSortable?: boolean\n labels: ArrayField['labels']\n moveRow: (fromIndex: number, toIndex: number) => void\n path: string\n permissions: FieldPermissions\n readOnly?: boolean\n removeRow: (rowIndex: number) => void\n row: Row\n rowCount: number\n rowIndex: number\n schemaPath: string\n setCollapse: (rowID: string, collapsed: boolean) => void\n} & UseDraggableSortableReturn\n\nexport const ArrayRow: React.FC<ArrayRowProps> = ({\n CustomRowLabel,\n addRow,\n attributes,\n duplicateRow,\n errorCount,\n fieldMap,\n forceRender = false,\n hasMaxRows,\n indexPath,\n isDragging,\n isSortable,\n labels,\n listeners,\n moveRow,\n path: parentPath,\n permissions,\n readOnly,\n removeRow,\n row,\n rowCount,\n rowIndex,\n schemaPath,\n setCollapse,\n setNodeRef,\n transform,\n transition,\n}) => {\n const path = `${parentPath}.${rowIndex}`\n const { i18n } = useTranslation()\n const hasSubmitted = useFormSubmitted()\n\n const fallbackLabel = `${getTranslation(labels.singular, i18n)} ${String(rowIndex + 1).padStart(\n 2,\n '0',\n )}`\n\n const fieldHasErrors = errorCount > 0 && hasSubmitted\n\n const classNames = [\n `${baseClass}__row`,\n fieldHasErrors ? `${baseClass}__row--has-errors` : `${baseClass}__row--no-errors`,\n ]\n .filter(Boolean)\n .join(' ')\n\n return (\n <div\n id={`${parentPath.split('.').join('-')}-row-${rowIndex}`}\n key={`${parentPath}-row-${row.id}`}\n ref={setNodeRef}\n style={{\n transform,\n transition,\n zIndex: isDragging ? 1 : undefined,\n }}\n >\n <Collapsible\n actions={\n !readOnly ? (\n <ArrayAction\n addRow={addRow}\n duplicateRow={duplicateRow}\n hasMaxRows={hasMaxRows}\n index={rowIndex}\n isSortable={isSortable}\n moveRow={moveRow}\n removeRow={removeRow}\n rowCount={rowCount}\n />\n ) : undefined\n }\n className={classNames}\n collapsibleStyle={fieldHasErrors ? 'error' : 'default'}\n dragHandleProps={\n isSortable\n ? {\n id: row.id,\n attributes,\n listeners,\n }\n : undefined\n }\n header={\n <div className={`${baseClass}__row-header`}>\n <RowLabel\n RowLabelComponent={CustomRowLabel}\n i18n={i18n}\n path={path}\n rowLabel={fallbackLabel}\n rowNumber={rowIndex + 1}\n />\n {fieldHasErrors && <ErrorPill count={errorCount} i18n={i18n} withMessage />}\n </div>\n }\n isCollapsed={row.collapsed}\n onToggle={(collapsed) => setCollapse(row.id, collapsed)}\n >\n <RenderFields\n className={`${baseClass}__fields`}\n fieldMap={fieldMap}\n forceRender={forceRender}\n indexPath={indexPath}\n margins=\"small\"\n path={path}\n permissions={permissions?.fields}\n readOnly={readOnly}\n schemaPath={schemaPath}\n />\n </Collapsible>\n </div>\n )\n}\n"],"names":["getTranslation","React","ArrayAction","Collapsible","ErrorPill","useFormSubmitted","RenderFields","RowLabel","useTranslation","baseClass","ArrayRow","CustomRowLabel","addRow","attributes","duplicateRow","errorCount","fieldMap","forceRender","hasMaxRows","indexPath","isDragging","isSortable","labels","listeners","moveRow","path","parentPath","permissions","readOnly","removeRow","row","rowCount","rowIndex","schemaPath","setCollapse","setNodeRef","transform","transition","i18n","hasSubmitted","fallbackLabel","singular","String","padStart","fieldHasErrors","classNames","filter","Boolean","join","div","id","split","ref","style","zIndex","undefined","actions","index","className","collapsibleStyle","dragHandleProps","header","RowLabelComponent","rowLabel","rowNumber","count","withMessage","isCollapsed","collapsed","onToggle","margins","fields"],"mappings":"AAAA;;AAGA,SAASA,cAAc,QAAQ,2BAA0B;AACzD,OAAOC,WAAW,QAAO;AAIzB,SAASC,WAAW,QAAQ,sCAAqC;AACjE,SAASC,WAAW,QAAQ,sCAAqC;AACjE,SAASC,SAAS,QAAQ,oCAAmC;AAC7D,SAASC,gBAAgB,QAAQ,8BAA6B;AAC9D,SAASC,YAAY,QAAQ,oCAAmC;AAChE,SAASC,QAAQ,QAAQ,gCAA+B;AACxD,SAASC,cAAc,QAAQ,uCAAsC;AACrE,OAAO,eAAc;AAErB,MAAMC,YAAY;AAyBlB,OAAO,MAAMC,WAAoC,CAAC,EAChDC,cAAc,EACdC,MAAM,EACNC,UAAU,EACVC,YAAY,EACZC,UAAU,EACVC,QAAQ,EACRC,cAAc,KAAK,EACnBC,UAAU,EACVC,SAAS,EACTC,UAAU,EACVC,UAAU,EACVC,MAAM,EACNC,SAAS,EACTC,OAAO,EACPC,MAAMC,UAAU,EAChBC,WAAW,EACXC,QAAQ,EACRC,SAAS,EACTC,GAAG,EACHC,QAAQ,EACRC,QAAQ,EACRC,UAAU,EACVC,WAAW,EACXC,UAAU,EACVC,SAAS,EACTC,UAAU,EACX;IACC,MAAMZ,OAAO,CAAC,EAAEC,WAAW,CAAC,EAAEM,SAAS,CAAC;IACxC,MAAM,EAAEM,IAAI,EAAE,GAAG9B;IACjB,MAAM+B,eAAelC;IAErB,MAAMmC,gBAAgB,CAAC,EAAExC,eAAesB,OAAOmB,QAAQ,EAAEH,MAAM,CAAC,EAAEI,OAAOV,WAAW,GAAGW,QAAQ,CAC7F,GACA,KACA,CAAC;IAEH,MAAMC,iBAAiB7B,aAAa,KAAKwB;IAEzC,MAAMM,aAAa;Q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AAEP,WAAW,KAAK,EAAEI,IAAIoB,EAAE,CAAC,CAAC;AA+DxC,EAAC"}
@@ -41,6 +41,7 @@
41
41
  margin: 0;
42
42
  padding: 0;
43
43
  display: flex;
44
+ color: var(--theme-elevation-800);
44
45
  }
45
46
 
46
47
  &__header-action {
@@ -51,6 +52,7 @@
51
52
  &:hover,
52
53
  &:focus-visible {
53
54
  text-decoration: underline;
55
+ color: var(--theme-elevation-600);
54
56
  }
55
57
  }
56
58
 
@@ -74,7 +76,7 @@
74
76
  &__add-row {
75
77
  align-self: flex-start;
76
78
  color: var(--theme-elevation-400);
77
- margin: 0;
79
+ margin: 2px 0;
78
80
 
79
81
  &:hover {
80
82
  color: var(--theme-elevation-800);
@@ -1,6 +1,6 @@
1
1
  @import '../../../../scss/styles.scss';
2
2
 
3
- $icon-width: base(1);
3
+ $icon-width: base(2);
4
4
  $icon-margin: base(0.25);
5
5
 
6
6
  .block-search {
@@ -13,14 +13,13 @@ $icon-margin: base(0.25);
13
13
 
14
14
  &__input {
15
15
  @include formInput;
16
- padding-right: calc(#{$icon-width} + #{$icon-margin} * 2);
17
16
  }
18
17
 
19
- .search {
18
+ .icon--search {
20
19
  position: absolute;
21
20
  top: 50%;
22
21
  transform: translate3d(0, -50%, 0);
23
- right: base(0.25);
22
+ right: 0;
24
23
  width: $icon-width;
25
24
  margin: 0 $icon-margin;
26
25
 
@@ -3,6 +3,7 @@
3
3
  .section-title {
4
4
  position: relative;
5
5
  min-width: 0;
6
+ pointer-events: all;
6
7
 
7
8
  &:after {
8
9
  display: block;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/fields/Checkbox/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,kBAAkB,EAAkB,MAAM,SAAS,CAAA;AAEjE,OAAO,KAAsB,MAAM,OAAO,CAAA;AAE1C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAA;AAWpD,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAA;AAC1C,OAAO,cAAc,CAAA;AAIrB,OAAO,EAAE,kBAAkB,EAAE,aAAa,EAAE,KAAK,kBAAkB,EAAE,CAAA;AAwGrE,eAAO,MAAM,aAAa,8BAAwC,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/fields/Checkbox/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,kBAAkB,EAA2B,MAAM,SAAS,CAAA;AAE1E,OAAO,KAAsB,MAAM,OAAO,CAAA;AAE1C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAA;AAWpD,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAA;AAC1C,OAAO,cAAc,CAAA;AAIrB,OAAO,EAAE,kBAAkB,EAAE,aAAa,EAAE,KAAK,kBAAkB,EAAE,CAAA;AAwGrE,eAAO,MAAM,aAAa,8BAAwC,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/fields/Checkbox/index.tsx"],"sourcesContent":["'use client'\nimport type { CheckboxFieldProps, ClientValidate } from 'payload'\n\nimport React, { useCallback } from 'react'\n\nimport type { CheckboxInputProps } from './Input.js'\n\nimport { useFieldProps } from '../../forms/FieldPropsProvider/index.js'\nimport { useForm } from '../../forms/Form/context.js'\nimport { useField } from '../../forms/useField/index.js'\nimport { withCondition } from '../../forms/withCondition/index.js'\nimport { useEditDepth } from '../../providers/EditDepth/index.js'\nimport { generateFieldID } from '../../utilities/generateFieldID.js'\nimport { FieldDescription } from '../FieldDescription/index.js'\nimport { FieldError } from '../FieldError/index.js'\nimport { fieldBaseClass } from '../shared/index.js'\nimport { CheckboxInput } from './Input.js'\nimport './index.scss'\n\nconst baseClass = 'checkbox'\n\nexport { CheckboxFieldProps, CheckboxInput, type CheckboxInputProps }\n\nconst CheckboxFieldComponent: React.FC<CheckboxFieldProps> = (props) => {\n const {\n id,\n name,\n AfterInput,\n BeforeInput,\n CustomDescription,\n CustomError,\n CustomLabel,\n checked: checkedFromProps,\n className,\n descriptionProps,\n disableFormData,\n errorProps,\n label,\n labelProps,\n onChange: onChangeFromProps,\n partialChecked,\n path: pathFromProps,\n readOnly: readOnlyFromProps,\n required,\n style,\n validate,\n width,\n } = props\n\n const { uuid } = useForm()\n\n const editDepth = useEditDepth()\n\n const memoizedValidate: ClientValidate = useCallback(\n (value, options) => {\n if (typeof validate === 'function') {\n return validate(value, { ...options, required })\n }\n },\n [validate, required],\n )\n\n const { path: pathFromContext, readOnly: readOnlyFromContext } = useFieldProps()\n\n const { formInitializing, formProcessing, path, setValue, showError, value } = useField({\n disableFormData,\n path: pathFromContext ?? pathFromProps ?? name,\n validate: memoizedValidate,\n })\n\n const disabled = readOnlyFromProps || readOnlyFromContext || formProcessing || formInitializing\n\n const onToggle = useCallback(() => {\n if (!disabled) {\n setValue(!value)\n if (typeof onChangeFromProps === 'function') onChangeFromProps(!value)\n }\n }, [onChangeFromProps, disabled, setValue, value])\n\n const checked = checkedFromProps || Boolean(value)\n\n const fieldID = id || generateFieldID(path, editDepth, uuid)\n\n return (\n <div\n className={[\n fieldBaseClass,\n baseClass,\n showError && 'error',\n className,\n value && `${baseClass}--checked`,\n disabled && `${baseClass}--read-only`,\n ]\n .filter(Boolean)\n .join(' ')}\n style={{\n ...style,\n width,\n }}\n >\n <FieldError CustomError={CustomError} path={path} {...(errorProps || {})} alignCaret=\"left\" />\n <CheckboxInput\n AfterInput={AfterInput}\n BeforeInput={BeforeInput}\n CustomLabel={CustomLabel}\n checked={checked}\n id={fieldID}\n inputRef={null}\n label={label}\n labelProps={labelProps}\n name={path}\n onToggle={onToggle}\n partialChecked={partialChecked}\n readOnly={disabled}\n required={required}\n />\n {CustomDescription !== undefined ? (\n CustomDescription\n ) : (\n <FieldDescription {...(descriptionProps || {})} />\n )}\n </div>\n )\n}\n\nexport const CheckboxField = withCondition(CheckboxFieldComponent)\n"],"names":["React","useCallback","useFieldProps","useForm","useField","withCondition","useEditDepth","generateFieldID","FieldDescription","FieldError","fieldBaseClass","CheckboxInput","baseClass","CheckboxFieldComponent","props","id","name","AfterInput","BeforeInput","CustomDescription","CustomError","CustomLabel","checked","checkedFromProps","className","descriptionProps","disableFormData","errorProps","label","labelProps","onChange","onChangeFromProps","partialChecked","path","pathFromProps","readOnly","readOnlyFromProps","required","style","validate","width","uuid","editDepth","memoizedValidate","value","options","pathFromContext","readOnlyFromContext","formInitializing","formProcessing","setValue","showError","disabled","onToggle","Boolean","fieldID","div","filter","join","alignCaret","inputRef","undefined","CheckboxField"],"mappings":"AAAA;;AAGA,OAAOA,SAASC,WAAW,QAAQ,QAAO;AAI1C,SAASC,aAAa,QAAQ,0CAAyC;AACvE,SAASC,OAAO,QAAQ,8BAA6B;AACrD,SAASC,QAAQ,QAAQ,gCAA+B;AACxD,SAASC,aAAa,QAAQ,qCAAoC;AAClE,SAASC,YAAY,QAAQ,qCAAoC;AACjE,SAASC,eAAe,QAAQ,qCAAoC;AACpE,SAASC,gBAAgB,QAAQ,+BAA8B;AAC/D,SAASC,UAAU,QAAQ,yBAAwB;AACnD,SAASC,cAAc,QAAQ,qBAAoB;AACnD,SAASC,aAAa,QAAQ,aAAY;AAC1C,OAAO,eAAc;AAErB,MAAMC,YAAY;AAElB,SAA6BD,aAAa,GAA2B;AAErE,MAAME,yBAAuD,CAACC;IAC5D,MAAM,EACJC,EAAE,EACFC,IAAI,EACJC,UAAU,EACVC,WAAW,EACXC,iBAAiB,EACjBC,WAAW,EACXC,WAAW,EACXC,SAASC,gBAAgB,EACzBC,SAAS,EACTC,gBAAgB,EAChBC,eAAe,EACfC,UAAU,EACVC,KAAK,EACLC,UAAU,EACVC,UAAUC,iBAAiB,EAC3BC,cAAc,EACdC,MAAMC,aAAa,EACnBC,UAAUC,iBAAiB,EAC3BC,QAAQ,EACRC,KAAK,EACLC,QAAQ,EACRC,KAAK,EACN,GAAG1B;IAEJ,MAAM,EAAE2B,IAAI,EAAE,GAAGtC;IAEjB,MAAMuC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b,MAAMiB;gBACNoB,UAAUA;gBACVrB,gBAAgBA;gBAChBG,UAAUiB;gBACVf,UAAUA;;YAEXlB,sBAAsB0C,YACrB1C,kCAEA,KAACX;gBAAkB,GAAIiB,oBAAoB,CAAC,CAAC;;;;AAIrD;AAEA,OAAO,MAAMqC,gBAAgBzD,cAAcQ,wBAAuB"}
1
+ {"version":3,"sources":["../../../src/fields/Checkbox/index.tsx"],"sourcesContent":["'use client'\nimport type { CheckboxFieldProps, CheckboxFieldValidation } from 'payload'\n\nimport React, { useCallback } from 'react'\n\nimport type { CheckboxInputProps } from './Input.js'\n\nimport { useFieldProps } from '../../forms/FieldPropsProvider/index.js'\nimport { useForm } from '../../forms/Form/context.js'\nimport { useField } from '../../forms/useField/index.js'\nimport { withCondition } from '../../forms/withCondition/index.js'\nimport { useEditDepth } from '../../providers/EditDepth/index.js'\nimport { generateFieldID } from '../../utilities/generateFieldID.js'\nimport { FieldDescription } from '../FieldDescription/index.js'\nimport { FieldError } from '../FieldError/index.js'\nimport { fieldBaseClass } from '../shared/index.js'\nimport { CheckboxInput } from './Input.js'\nimport './index.scss'\n\nconst baseClass = 'checkbox'\n\nexport { CheckboxFieldProps, CheckboxInput, type CheckboxInputProps }\n\nconst CheckboxFieldComponent: React.FC<CheckboxFieldProps> = (props) => {\n const {\n id,\n name,\n AfterInput,\n BeforeInput,\n CustomDescription,\n CustomError,\n CustomLabel,\n checked: checkedFromProps,\n className,\n descriptionProps,\n disableFormData,\n errorProps,\n label,\n labelProps,\n onChange: onChangeFromProps,\n partialChecked,\n path: pathFromProps,\n readOnly: readOnlyFromProps,\n required,\n style,\n validate,\n width,\n } = props\n\n const { uuid } = useForm()\n\n const editDepth = useEditDepth()\n\n const memoizedValidate: CheckboxFieldValidation = useCallback(\n (value, options) => {\n if (typeof validate === 'function') {\n return validate(value, { ...options, required })\n }\n },\n [validate, required],\n )\n\n const { path: pathFromContext, readOnly: readOnlyFromContext } = useFieldProps()\n\n const { formInitializing, formProcessing, path, setValue, showError, value } = useField({\n disableFormData,\n path: pathFromContext ?? pathFromProps ?? name,\n validate: memoizedValidate,\n })\n\n const disabled = readOnlyFromProps || readOnlyFromContext || formProcessing || formInitializing\n\n const onToggle = useCallback(() => {\n if (!disabled) {\n setValue(!value)\n if (typeof onChangeFromProps === 'function') onChangeFromProps(!value)\n }\n }, [onChangeFromProps, disabled, setValue, value])\n\n const checked = checkedFromProps || Boolean(value)\n\n const fieldID = id || generateFieldID(path, editDepth, uuid)\n\n return (\n <div\n className={[\n fieldBaseClass,\n baseClass,\n showError && 'error',\n className,\n value && `${baseClass}--checked`,\n disabled && `${baseClass}--read-only`,\n ]\n .filter(Boolean)\n .join(' ')}\n style={{\n ...style,\n width,\n }}\n >\n <FieldError CustomError={CustomError} path={path} {...(errorProps || {})} alignCaret=\"left\" />\n <CheckboxInput\n AfterInput={AfterInput}\n BeforeInput={BeforeInput}\n CustomLabel={CustomLabel}\n checked={checked}\n id={fieldID}\n inputRef={null}\n label={label}\n labelProps={labelProps}\n name={path}\n onToggle={onToggle}\n partialChecked={partialChecked}\n readOnly={disabled}\n required={required}\n />\n {CustomDescription !== undefined ? (\n CustomDescription\n ) : (\n <FieldDescription {...(descriptionProps || {})} />\n )}\n </div>\n )\n}\n\nexport const CheckboxField = withCondition(CheckboxFieldComponent)\n"],"names":["React","useCallback","useFieldProps","useForm","useField","withCondition","useEditDepth","generateFieldID","FieldDescription","FieldError","fieldBaseClass","CheckboxInput","baseClass","CheckboxFieldComponent","props","id","name","AfterInput","BeforeInput","CustomDescription","CustomError","CustomLabel","checked","checkedFromProps","className","descriptionProps","disableFormData","errorProps","label","labelProps","onChange","onChangeFromProps","partialChecked","path","pathFromProps","readOnly","readOnlyFromProps","required","style","validate","width","uuid","editDepth","memoizedValidate","value","options","pathFromContext","readOnlyFromContext","formInitializing","formProcessing","setValue","showError","disabled","onToggle","Boolean","fieldID","div","filter","join","alignCaret","inputRef","undefined","CheckboxField"],"mappings":"AAAA;;AAGA,OAAOA,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tFsB;QACAO,MAAMa,mBAAmBZ,iBAAiBlB;QAC1CuB,UAAUI;IACZ;IAEA,MAAMS,WAAWhB,qBAAqBW,uBAAuBE,kBAAkBD;IAE/E,MAAMK,WAAWpD,YAAY;QAC3B,IAAI,CAACmD,UAAU;YACbF,SAAS,CAACN;YACV,IAAI,OAAOb,sBAAsB,YAAYA,kBAAkB,CAACa;QAClE;IACF,GAAG;QAACb;QAAmBqB;QAAUF;QAAUN;KAAM;IAEjD,MAAMtB,UAAUC,oBAAoB+B,QAAQV;IAE5C,MAAMW,UAAUxC,MAAMR,gBAAgB0B,MAAMS,WAAWD;IAEvD,qBACE,MAACe;QACChC,WAAW;YACTd;YACAE;YACAuC,aAAa;YACb3B;YACAoB,SAAS,CAAC,EAAEhC,UAAU,SAAS,CAAC;YAChCwC,YAAY,CAAC,EAAExC,UAAU,WAAW,CAAC;SACtC,CACE6C,MAAM,CAACH,SACPI,IAAI,CAAC;QACRpB,OAAO;YACL,GAAGA,KAAK;YACRE;QACF;;0BAEA,KAAC/B;gBAAWW,aAAaA;gBAAaa,MAAMA;gBAAO,GAAIN,cAAc,CAAC,CAAC;gBAAGgC,YAAW;;0BACrF,KAAChD;gBACCM,YAAYA;gBACZC,aAAaA;gBACbG,aAAaA;gBACbC,SAASA;gBACTP,IAAIwC;gBACJK,UAAU;gBACVhC,OAAOA;gBACPC,YAAYA;gBACZb,MAAMiB;gBACNoB,UAAUA;gBACVrB,gBAAgBA;gBAChBG,UAAUiB;gBACVf,UAAUA;;YAEXlB,sBAAsB0C,YACrB1C,kCAEA,KAACX;gBAAkB,GAAIiB,oBAAoB,CAAC,CAAC;;;;AAIrD;AAEA,OAAO,MAAMqC,gBAAgBzD,cAAcQ,wBAAuB"}
@@ -15,14 +15,16 @@
15
15
 
16
16
  .checkbox-input {
17
17
  display: inline-flex;
18
+ &:hover:not(&--read-only) {
19
+ label,
20
+ input {
21
+ cursor: pointer;
22
+ }
23
+ }
18
24
 
19
25
  label {
20
26
  padding-bottom: 0;
21
27
  padding-left: base(0.5);
22
-
23
- &[for] {
24
- cursor: pointer;
25
- }
26
28
  }
27
29
 
28
30
  [dir='rtl'] &__input {
@@ -51,7 +53,6 @@
51
53
  opacity: 0;
52
54
  border-radius: 0;
53
55
  z-index: 1;
54
- cursor: pointer;
55
56
  }
56
57
  }
57
58
 
@@ -69,8 +70,6 @@
69
70
  &:focus {
70
71
  .checkbox-input__input,
71
72
  & input[type='checkbox'] {
72
- @include inputShadowActive;
73
-
74
73
  outline: 0;
75
74
  box-shadow: 0 0 3px 3px var(--theme-success-400) !important;
76
75
  border: 1px solid var(--theme-elevation-150);
@@ -105,7 +104,7 @@
105
104
 
106
105
  &--read-only {
107
106
  .checkbox-input__input {
108
- background-color: var(--theme-elevation-100);
107
+ @include readOnly;
109
108
  }
110
109
 
111
110
  label {
@@ -15,4 +15,10 @@
15
15
  background-color: var(--theme-error-50);
16
16
  }
17
17
  }
18
+
19
+ .read-only {
20
+ .code-editor {
21
+ @include readOnly;
22
+ }
23
+ }
18
24
  }
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/fields/ConfirmPassword/index.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAsB,MAAM,OAAO,CAAA;AAQ1C,OAAO,cAAc,CAAA;AAErB,MAAM,MAAM,yBAAyB,GAAG;IACtC,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,IAAI,CAAC,EAAE,MAAM,CAAA;CACd,CAAA;AAED,eAAO,MAAM,oBAAoB,EAAE,KAAK,CAAC,EAAE,CAAC,yBAAyB,CAoDpE,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/fields/ConfirmPassword/index.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,MAAM,OAAO,CAAA;AAOzB,OAAO,cAAc,CAAA;AAErB,MAAM,MAAM,yBAAyB,GAAG;IACtC,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,IAAI,CAAC,EAAE,MAAM,CAAA;CACd,CAAA;AAED,eAAO,MAAM,oBAAoB,EAAE,KAAK,CAAC,EAAE,CAAC,yBAAyB,CA0CpE,CAAA"}
@@ -1,7 +1,7 @@
1
1
  'use client';
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
- import React, { useCallback } from 'react';
4
- import { useFormFields } from '../../forms/Form/context.js';
3
+ import { confirmPassword } from 'payload/shared';
4
+ import React from 'react';
5
5
  import { useField } from '../../forms/useField/index.js';
6
6
  import { useTranslation } from '../../providers/Translation/index.js';
7
7
  import { FieldError } from '../FieldError/index.js';
@@ -10,23 +10,17 @@ import { fieldBaseClass } from '../shared/index.js';
10
10
  import './index.scss';
11
11
  export const ConfirmPasswordField = (props)=>{
12
12
  const { disabled, path = 'confirm-password' } = props;
13
- const password = useFormFields(([fields])=>fields?.password);
14
13
  const { t } = useTranslation();
15
- const validate = useCallback((value)=>{
16
- if (!value) {
17
- return t('validation:required');
18
- }
19
- if (value === password?.value) {
20
- return true;
21
- }
22
- return t('fields:passwordsDoNotMatch');
23
- }, [
24
- password,
25
- t
26
- ]);
27
14
  const { setValue, showError, value } = useField({
28
15
  path,
29
- validate
16
+ validate: (value, options)=>{
17
+ return confirmPassword(value, {
18
+ name: 'confirm-password',
19
+ type: 'text',
20
+ required: true,
21
+ ...options
22
+ });
23
+ }
30
24
  });
31
25
  return /*#__PURE__*/ _jsxs("div", {
32
26
  className: [
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/fields/ConfirmPassword/index.tsx"],"sourcesContent":["'use client'\nimport type { FormField } from 'payload'\n\nimport React, { useCallback } from 'react'\n\nimport { useFormFields } from '../../forms/Form/context.js'\nimport { useField } from '../../forms/useField/index.js'\nimport { useTranslation } from '../../providers/Translation/index.js'\nimport { FieldError } from '../FieldError/index.js'\nimport { FieldLabel } from '../FieldLabel/index.js'\nimport { fieldBaseClass } from '../shared/index.js'\nimport './index.scss'\n\nexport type ConfirmPasswordFieldProps = {\n disabled?: boolean\n path?: string\n}\n\nexport const ConfirmPasswordField: React.FC<ConfirmPasswordFieldProps> = (props) => {\n const { disabled, path = 'confirm-password' } = props\n\n const password = useFormFields<FormField>(([fields]) => fields?.password)\n const { t } = useTranslation()\n\n const validate = useCallback(\n (value: string) => {\n if (!value) {\n return t('validation:required')\n }\n\n if (value === password?.value) {\n return true\n }\n\n return t('fields:passwordsDoNotMatch')\n },\n [password, t],\n )\n\n const { setValue, showError, value } = useField({\n path,\n validate,\n })\n\n return (\n <div\n className={[fieldBaseClass, 'confirm-password', showError && 'error']\n .filter(Boolean)\n .join(' ')}\n >\n <FieldLabel\n htmlFor=\"field-confirm-password\"\n label={t('authentication:confirmPassword')}\n required\n />\n <div className={`${fieldBaseClass}__wrap`}>\n <FieldError path={path} />\n <input\n aria-label={t('authentication:confirmPassword')}\n autoComplete=\"off\"\n disabled={!!disabled}\n id=\"field-confirm-password\"\n name=\"confirm-password\"\n onChange={setValue}\n type=\"password\"\n value={(value as string) || ''}\n />\n </div>\n </div>\n )\n}\n"],"names":["React","useCallback","useFormFields","useField","useTranslation","FieldError","FieldLabel","fieldBaseClass","ConfirmPasswordField","props","disabled","path","password","fields","t","validate","value","setValue","showError","div","className","filter","Boolean","join","htmlFor","label","required","input","aria-label","autoComplete","id","name","onChange","type"],"mappings":"AAAA;;AAGA,OAAOA,SAASC,WAAW,QAAQ,QAAO;AAE1C,SAASC,aAAa,QAAQ,8BAA6B;AAC3D,SAASC,QAAQ,QAAQ,gCAA+B;AACxD,SAASC,cAAc,QAAQ,uCAAsC;AACrE,SAASC,UAAU,QAAQ,yBAAwB;AACnD,SAASC,UAAU,QAAQ,yBAAwB;AACnD,SAASC,cAAc,QAAQ,qBAAoB;AACnD,OAAO,eAAc;AAOrB,OAAO,MAAMC,uBAA4D,CAACC;IACxE,MAAM,EAAEC,QAAQ,EAAEC,OAAO,kBAAkB,EAAE,GAAGF;IAEhD,MAAMG,WAAWV,cAAyB,CAAC,CAACW,OAAO,GAAKA,QAAQD;IAChE,MAAM,EAAEE,CAAC,EAAE,GAAGV;IAEd,MAAMW,WAAWd,YACf,CAACe;QACC,IAAI,CAACA,OAAO;YACV,OAAOF,EAAE;QACX;QAEA,IAAIE,UAAUJ,UAAUI,OAAO;YAC7B,OAAO;QACT;QAEA,OAAOF,EAAE;IACX,GACA;QAACF;QAAUE;KAAE;IAGf,MAAM,EAAEG,QAAQ,EAAEC,SAAS,EAAEF,KAAK,EAAE,GAAGb,SAAS;QAC9CQ;QACAI;IACF;IAEA,qBACE,MAACI;QACCC,WAAW;YAACb;YAAgB;YAAoBW,aAAa;SAAQ,CAClEG,MAAM,CAACC,SACPC,IAAI,CAAC;;0BAER,KAACjB;gBACCkB,SAAQ;gBACRC,OAAOX,EAAE;gBACTY,QAAQ;;0BAEV,MAACP;gBAAIC,WAAW,CAAC,EAAEb,eAAe,MAAM,CAAC;;kCACvC,KAACF;wBAAWM,MAAMA;;kCAClB,KAACgB;wBACCC,cAAYd,EAAE;wBACde,cAAa;wBACbnB,UAAU,CAAC,CAACA;wBACZoB,IAAG;wBACHC,MAAK;wBACLC,UAAUf;wBACVgB,MAAK;wBACLjB,OAAO,AAACA,SAAoB;;;;;;AAKtC,EAAC"}
1
+ {"version":3,"sources":["../../../src/fields/ConfirmPassword/index.tsx"],"sourcesContent":["'use client'\n\nimport { confirmPassword } from 'payload/shared'\nimport React from 'react'\n\nimport { useField } from '../../forms/useField/index.js'\nimport { useTranslation } from '../../providers/Translation/index.js'\nimport { FieldError } from '../FieldError/index.js'\nimport { FieldLabel } from '../FieldLabel/index.js'\nimport { fieldBaseClass } from '../shared/index.js'\nimport './index.scss'\n\nexport type ConfirmPasswordFieldProps = {\n disabled?: boolean\n path?: string\n}\n\nexport const ConfirmPasswordField: React.FC<ConfirmPasswordFieldProps> = (props) => {\n const { disabled, path = 'confirm-password' } = props\n const { t } = useTranslation()\n\n const { setValue, showError, value } = useField({\n path,\n validate: (value, options) => {\n return confirmPassword(value, {\n name: 'confirm-password',\n type: 'text',\n required: true,\n ...options,\n })\n },\n })\n\n return (\n <div\n className={[fieldBaseClass, 'confirm-password', showError && 'error']\n .filter(Boolean)\n .join(' ')}\n >\n <FieldLabel\n htmlFor=\"field-confirm-password\"\n label={t('authentication:confirmPassword')}\n required\n />\n <div className={`${fieldBaseClass}__wrap`}>\n <FieldError path={path} />\n <input\n aria-label={t('authentication:confirmPassword')}\n autoComplete=\"off\"\n disabled={!!disabled}\n id=\"field-confirm-password\"\n name=\"confirm-password\"\n onChange={setValue}\n type=\"password\"\n value={(value as string) || ''}\n />\n </div>\n </div>\n )\n}\n"],"names":["confirmPassword","React","useField","useTranslation","FieldError","FieldLabel","fieldBaseClass","ConfirmPasswordField","props","disabled","path","t","setValue","showError","value","validate","options","name","type","required","div","className","filter","Boolean","join","htmlFor","label","input","aria-label","autoComplete","id","onChange"],"mappings":"AAAA;;AAEA,SAASA,eAAe,QAAQ,iBAAgB;AAChD,OAAOC,WAAW,QAAO;AAEzB,SAASC,QAAQ,QAAQ,gCAA+B;AACxD,SAASC,cAAc,QAAQ,uCAAsC;AACrE,SAASC,UAAU,QAAQ,yBAAwB;AACnD,SAASC,UAAU,QAAQ,yBAAwB;AACnD,SAASC,cAAc,QAAQ,qBAAoB;AACnD,OAAO,eAAc;AAOrB,OAAO,MAAMC,uBAA4D,CAACC;IACxE,MAAM,EAAEC,QAAQ,EAAEC,OAAO,kBAAkB,EAAE,GAAGF;IAChD,MAAM,EAAEG,CAAC,EAAE,GAAGR;IAEd,MAAM,EAAES,QAAQ,EAAEC,SAAS,EAAEC,KAAK,EAAE,GAAGZ,SAAS;QAC9CQ;QACAK,UAAU,CAACD,OAAOE;YAChB,OAAOhB,gBAAgBc,OAAO;gBAC5BG,MAAM;gBACNC,MAAM;gBACNC,UAAU;gBACV,GAAGH,OAAO;YACZ;QACF;IACF;IAEA,qBACE,MAACI;QACCC,WAAW;YAACf;YAAgB;YAAoBO,aAAa;SAAQ,CAClES,MAAM,CAACC,SACPC,IAAI,CAAC;;0BAER,KAACnB;gBACCoB,SAAQ;gBACRC,OAAOf,EAAE;gBACTQ,QAAQ;;0BAEV,MAACC;gBAAIC,WAAW,CAAC,EAAEf,eAAe,MAAM,CAAC;;kCACvC,KAACF;wBAAWM,MAAMA;;kCAClB,KAACiB;wBACCC,cAAYjB,EAAE;wBACdkB,cAAa;wBACbpB,UAAU,CAAC,CAACA;wBACZqB,IAAG;wBACHb,MAAK;wBACLc,UAAUnB;wBACVM,MAAK;wBACLJ,OAAO,AAACA,SAAoB;;;;;;AAKtC,EAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/fields/DateTime/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAA6B,cAAc,EAAE,MAAM,SAAS,CAAA;AAGxE,OAAO,KAAsB,MAAM,OAAO,CAAA;AAO1C,OAAO,cAAc,CAAA;AAiGrB,eAAO,MAAM,aAAa,0BAAwC,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/fields/DateTime/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAuB,MAAM,SAAS,CAAA;AAGlE,OAAO,KAAsB,MAAM,OAAO,CAAA;AAO1C,OAAO,cAAc,CAAA;AAiGrB,eAAO,MAAM,aAAa,0BAAwC,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/fields/DateTime/index.tsx"],"sourcesContent":["'use client'\nimport type { ClientValidate, DateField, DateFieldProps } from 'payload'\n\nimport { getTranslation } from '@payloadcms/translations'\nimport React, { useCallback } from 'react'\n\nimport { DatePickerField } from '../../elements/DatePicker/index.js'\nimport { useField } from '../../forms/useField/index.js'\nimport { useTranslation } from '../../providers/Translation/index.js'\nimport { FieldLabel } from '../FieldLabel/index.js'\nimport { fieldBaseClass } from '../shared/index.js'\nimport './index.scss'\n\nconst baseClass = 'date-time-field'\n\nimport { useFieldProps } from '../../forms/FieldPropsProvider/index.js'\nimport { withCondition } from '../../forms/withCondition/index.js'\nimport { FieldDescription } from '../FieldDescription/index.js'\nimport { FieldError } from '../FieldError/index.js'\n\nconst DateTimeFieldComponent: React.FC<DateFieldProps> = (props) => {\n const {\n name,\n AfterInput,\n BeforeInput,\n CustomDescription,\n CustomError,\n CustomLabel,\n className,\n date: datePickerProps,\n descriptionProps,\n errorProps,\n label,\n labelProps,\n path: pathFromProps,\n placeholder,\n readOnly: readOnlyFromProps,\n required,\n style,\n validate,\n width,\n } = props\n\n const { i18n } = useTranslation()\n\n const memoizedValidate: ClientValidate = useCallback(\n (value, options) => {\n if (typeof validate === 'function') {\n return validate(value, { ...options, required })\n }\n },\n [validate, required],\n )\n\n const { path: pathFromContext, readOnly: readOnlyFromContext } = useFieldProps()\n\n const { formInitializing, formProcessing, path, setValue, showError, value } = useField<Date>({\n path: pathFromContext ?? pathFromProps ?? name,\n validate: memoizedValidate,\n })\n\n const disabled = readOnlyFromProps || readOnlyFromContext || formProcessing || formInitializing\n\n return (\n <div\n className={[\n fieldBaseClass,\n baseClass,\n className,\n showError && `${baseClass}--has-error`,\n disabled && 'read-only',\n ]\n .filter(Boolean)\n .join(' ')}\n style={{\n ...style,\n width,\n }}\n >\n <FieldLabel\n CustomLabel={CustomLabel}\n label={label}\n required={required}\n {...(labelProps || {})}\n />\n <div className={`${fieldBaseClass}__wrap`} id={`field-${path.replace(/\\./g, '__')}`}>\n <FieldError CustomError={CustomError} path={path} {...(errorProps || {})} />\n {BeforeInput}\n <DatePickerField\n {...datePickerProps}\n onChange={(incomingDate) => {\n if (!disabled) setValue(incomingDate?.toISOString() || null)\n }}\n placeholder={getTranslation(placeholder, i18n)}\n readOnly={disabled}\n value={value}\n />\n {AfterInput}\n </div>\n {CustomDescription !== undefined ? (\n CustomDescription\n ) : (\n <FieldDescription {...(descriptionProps || {})} />\n )}\n </div>\n )\n}\n\nexport const DateTimeField = withCondition(DateTimeFieldComponent)\n"],"names":["getTranslation","React","useCallback","DatePickerField","useField","useTranslation","FieldLabel","fieldBaseClass","baseClass","useFieldProps","withCondition","FieldDescription","FieldError","DateTimeFieldComponent","props","name","AfterInput","BeforeInput","CustomDescription","CustomError","CustomLabel","className","date","datePickerProps","descriptionProps","errorProps","label","labelProps","path","pathFromProps","placeholder","readOnly","readOnlyFromProps","required","style","validate","width","i18n","memoizedValidate","value","options","pathFromContext","readOnlyFromContext","formInitializing","formProcessing","setValue","showError","disabled","div","filter","Boolean","join","id","replace","onChange","incomingDate","toISOString","undefined","DateTimeField"],"mappings":"AAAA;;AAGA,SAASA,cAAc,QAAQ,2BAA0B;AACzD,OAAOC,SAASC,WAAW,QAAQ,QAAO;AAE1C,SAASC,eAAe,QAAQ,qCAAoC;AACpE,SAASC,QAAQ,QAAQ,gCAA+B;AACxD,SAASC,cAAc,QAAQ,uCAAsC;AACrE,SAASC,UAAU,QAAQ,yBAAwB;AACnD,SAASC,cAAc,QAAQ,qBAAoB;AACnD,OAAO,eAAc;AAErB,MAAMC,YAAY;AAElB,SAASC,aAAa,QAAQ,0CAAyC;AACvE,SAASC,aAAa,QAAQ,qCAAoC;AAClE,SAASC,gBAAgB,QAAQ,+BAA8B;AAC/D,SAASC,UAAU,QAAQ,yBAAwB;AAEnD,MAAMC,yBAAmD,CAACC;IACxD,MAAM,EACJC,IAAI,EACJC,UAAU,EACVC,WAAW,EACXC,iBAAiB,EACjBC,WAAW,EACXC,WAAW,EACXC,SAAS,EACTC,MAAMC,eAAe,EACrBC,gBAAgB,EAChBC,UAAU,EACVC,KAAK,EACLC,UAAU,EACVC,MAAMC,aAAa,EACnBC,WAAW,EACXC,UAAUC,iBAAiB,EAC3BC,QAAQ,EACRC,KAAK,EACLC,QAAQ,EACRC,KAAK,EACN,GAAGtB;IAEJ,MAAM,EAAEuB,IAAI,EAAE,GAAGhC;IAEjB,MAAMiC,mBAAmCpC,YACvC,CAACqC,OAAOC;QACN,IAAI,OAAOL,aAAa,YAAY;YAClC,OAAOA,SAASI,OAAO;gBAAE,GAAGC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ourcesContent":["'use client'\nimport type { DateFieldProps, DateFieldValidation } from 'payload'\n\nimport { getTranslation } from '@payloadcms/translations'\nimport React, { useCallback } from 'react'\n\nimport { DatePickerField } from '../../elements/DatePicker/index.js'\nimport { useField } from '../../forms/useField/index.js'\nimport { useTranslation } from '../../providers/Translation/index.js'\nimport { FieldLabel } from '../FieldLabel/index.js'\nimport { fieldBaseClass } from '../shared/index.js'\nimport './index.scss'\n\nconst baseClass = 'date-time-field'\n\nimport { useFieldProps } from '../../forms/FieldPropsProvider/index.js'\nimport { withCondition } from '../../forms/withCondition/index.js'\nimport { FieldDescription } from '../FieldDescription/index.js'\nimport { FieldError } from '../FieldError/index.js'\n\nconst DateTimeFieldComponent: React.FC<DateFieldProps> = (props) => {\n const {\n name,\n AfterInput,\n BeforeInput,\n CustomDescription,\n CustomError,\n CustomLabel,\n className,\n date: datePickerProps,\n descriptionProps,\n errorProps,\n label,\n labelProps,\n path: pathFromProps,\n placeholder,\n readOnly: readOnlyFromProps,\n required,\n style,\n validate,\n width,\n } = props\n\n const { i18n } = useTranslation()\n\n const memoizedValidate: DateFieldValidation = useCallback(\n (value, options) => {\n if (typeof validate === 'function') {\n return validate(value, { ...options, required })\n }\n },\n [validate, required],\n )\n\n const { path: pathFromContext, readOnly: readOnlyFromContext } = useFieldProps()\n\n const { formInitializing, formProcessing, path, setValue, showError, value } = useField<Date>({\n path: pathFromContext ?? pathFromProps ?? name,\n validate: memoizedValidate,\n })\n\n const disabled = readOnlyFromProps || readOnlyFromContext || formProcessing || formInitializing\n\n return (\n <div\n className={[\n fieldBaseClass,\n baseClass,\n className,\n showError && `${baseClass}--has-error`,\n disabled && 'read-only',\n ]\n .filter(Boolean)\n .join(' ')}\n style={{\n ...style,\n width,\n }}\n >\n <FieldLabel\n CustomLabel={CustomLabel}\n label={label}\n required={required}\n {...(labelProps || {})}\n />\n <div className={`${fieldBaseClass}__wrap`} id={`field-${path.replace(/\\./g, '__')}`}>\n <FieldError CustomError={CustomError} path={path} {...(errorProps || {})} />\n {BeforeInput}\n <DatePickerField\n {...datePickerProps}\n onChange={(incomingDate) => {\n if (!disabled) setValue(incomingDate?.toISOString() || null)\n }}\n placeholder={getTranslation(placeholder, i18n)}\n readOnly={disabled}\n value={value}\n />\n {AfterInput}\n </div>\n {CustomDescription !== undefined ? (\n CustomDescription\n ) : (\n <FieldDescription {...(descriptionProps || {})} />\n )}\n </div>\n )\n}\n\nexport const DateTimeField = withCondition(DateTimeFieldComponent)\n"],"names":["getTranslation","React","useCallback","DatePickerField","useField","useTranslation","FieldLabel","fieldBaseClass","baseClass","useFieldProps","withCondition","FieldDescription","FieldError","DateTimeFieldComponent","props","name","AfterInput","BeforeInput","CustomDescription","CustomError","CustomLabel","className","date","datePickerProps","descriptionProps","errorProps","label","labelProps","path","pathFromProps","placeholder","readOnly","readOnlyFromProps","required","style","validate","width","i18n","memoizedValidate","value","options","pathFromContext","readOnlyFromContext","formInitializing","formProcessing","setValue","showError","disabled","div","filter","Boolean","join","id","replace","onChange","incomingDate","toISOString","undefined","DateTimeField"],"mappings":"AAAA;;AAGA,SAASA,cAAc,QAAQ,2BAA0B;AACzD,OAAOC,SAASC,WAAW,QAAQ,QAAO;AAE1C,SAASC,eAAe,QAAQ,qCAAoC;AACpE,SAASC,QAAQ,QAAQ,gCAA+B;AACxD,SAASC,cAAc,QAAQ,uCAAsC;AACrE,SAASC,UAAU,QAAQ,yBAAwB;AACnD,SAASC,cAAc,QAAQ,qBAAoB;AACnD,OAAO,eAAc;AAErB,MAAMC,YAAY;AAElB,SAASC,aAAa,QAAQ,0CAAyC;AACvE,SAASC,aAAa,QAAQ,qCAAoC;AAClE,SAASC,gBAAgB,QAAQ,+BAA8B;AAC/D,SAASC,UAAU,QAAQ,yBAAwB;AAEnD,MAAMC,yBAAmD,CAACC;IACxD,MAAM,EACJC,IAAI,EACJC,UAAU,EACVC,WAAW,EACXC,iBAAiB,EACjBC,WAAW,EACXC,WAAW,EACXC,SAAS,EACTC,MAAMC,eA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Ae;wBACnB+B,UAAU,CAACC;4BACT,IAAI,CAACR,UAAUF,SAASU,cAAcC,iBAAiB;wBACzD;wBACA1B,aAAa9B,eAAe8B,aAAaO;wBACzCN,UAAUgB;wBACVR,OAAOA;;oBAERvB;;;YAEFE,sBAAsBuC,YACrBvC,kCAEA,KAACP;gBAAkB,GAAIa,oBAAoB,CAAC,CAAC;;;;AAIrD;AAEA,OAAO,MAAMkC,gBAAgBhD,cAAcG,wBAAuB"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/fields/Email/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAkB,eAAe,EAAE,MAAM,SAAS,CAAA;AAG9D,OAAO,KAAsB,MAAM,OAAO,CAAA;AAU1C,OAAO,cAAc,CAAA;AAqFrB,eAAO,MAAM,UAAU,2BAAqC,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/fields/Email/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAwB,MAAM,SAAS,CAAA;AAGpE,OAAO,KAAsB,MAAM,OAAO,CAAA;AAU1C,OAAO,cAAc,CAAA;AAqFrB,eAAO,MAAM,UAAU,2BAAqC,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/fields/Email/index.tsx"],"sourcesContent":["'use client'\nimport type { ClientValidate, EmailFieldProps } from 'payload'\n\nimport { getTranslation } from '@payloadcms/translations'\nimport React, { useCallback } from 'react'\n\nimport { useFieldProps } from '../../forms/FieldPropsProvider/index.js'\nimport { useField } from '../../forms/useField/index.js'\nimport { withCondition } from '../../forms/withCondition/index.js'\nimport { useTranslation } from '../../providers/Translation/index.js'\nimport { FieldDescription } from '../FieldDescription/index.js'\nimport { FieldError } from '../FieldError/index.js'\nimport { FieldLabel } from '../FieldLabel/index.js'\nimport { fieldBaseClass } from '../shared/index.js'\nimport './index.scss'\n\nconst EmailFieldComponent: React.FC<EmailFieldProps> = (props) => {\n const {\n name,\n AfterInput,\n BeforeInput,\n CustomDescription,\n CustomError,\n CustomLabel,\n autoComplete,\n className,\n descriptionProps,\n errorProps,\n label,\n labelProps,\n path: pathFromProps,\n placeholder,\n readOnly: readOnlyFromProps,\n required,\n style,\n validate,\n width,\n } = props\n\n const { i18n } = useTranslation()\n\n const memoizedValidate: ClientValidate = useCallback(\n (value, options) => {\n if (typeof validate === 'function') {\n return validate(value, { ...options, required })\n }\n },\n [validate, required],\n )\n\n const { path: pathFromContext, readOnly: readOnlyFromContext } = useFieldProps()\n\n const { formInitializing, formProcessing, path, setValue, showError, value } = useField({\n path: pathFromContext ?? pathFromProps ?? name,\n validate: memoizedValidate,\n })\n\n const disabled = readOnlyFromProps || readOnlyFromContext || formProcessing || formInitializing\n\n return (\n <div\n className={[fieldBaseClass, 'email', className, showError && 'error', disabled && 'read-only']\n .filter(Boolean)\n .join(' ')}\n style={{\n ...style,\n width,\n }}\n >\n <FieldLabel\n CustomLabel={CustomLabel}\n label={label}\n required={required}\n {...(labelProps || {})}\n />\n <div className={`${fieldBaseClass}__wrap`}>\n <FieldError CustomError={CustomError} path={path} {...(errorProps || {})} />\n {BeforeInput}\n <input\n autoComplete={autoComplete}\n disabled={disabled}\n id={`field-${path.replace(/\\./g, '__')}`}\n name={path}\n onChange={setValue}\n placeholder={getTranslation(placeholder, i18n)}\n type=\"email\"\n value={(value as string) || ''}\n />\n {AfterInput}\n </div>\n {CustomDescription !== undefined ? (\n CustomDescription\n ) : (\n <FieldDescription {...(descriptionProps || {})} />\n )}\n </div>\n )\n}\n\nexport const EmailField = withCondition(EmailFieldComponent)\n"],"names":["getTranslation","React","useCallback","useFieldProps","useField","withCondition","useTranslation","FieldDescription","FieldError","FieldLabel","fieldBaseClass","EmailFieldComponent","props","name","AfterInput","BeforeInput","CustomDescription","CustomError","CustomLabel","autoComplete","className","descriptionProps","errorProps","label","labelProps","path","pathFromProps","placeholder","readOnly","readOnlyFromProps","required","style","validate","width","i18n","memoizedValidate","value","options","pathFromContext","readOnlyFromContext","formInitializing","formProcessing","setValue","showError","disabled","div","filter","Boolean","join","input","id","replace","onChange","type","undefined","EmailField"],"mappings":"AAAA;;AAGA,SAASA,cAAc,QAAQ,2BAA0B;AACzD,OAAOC,SAASC,WAAW,QAAQ,QAAO;AAE1C,SAASC,aAAa,QAAQ,0CAAyC;AACvE,SAASC,QAAQ,QAAQ,gCAA+B;AACxD,SAASC,aAAa,QAAQ,qCAAoC;AAClE,SAASC,cAAc,QAAQ,uCAAsC;AACrE,SAASC,gBAAgB,QAAQ,+BAA8B;AAC/D,SAASC,UAAU,QAAQ,yBAAwB;AACnD,SAASC,UAAU,QAAQ,yBAAwB;AACnD,SAASC,cAAc,QAAQ,qBAAoB;AACnD,OAAO,eAAc;AAErB,MAAMC,sBAAiD,CAACC;IACtD,MAAM,EACJC,IAAI,EACJC,UAAU,EACVC,WAAW,EACXC,iBAAiB,EACjBC,WAAW,EACXC,WAAW,EACXC,YAAY,EACZC,SAAS,EACTC,gBAAgB,EAChBC,UAAU,EACVC,KAAK,EACLC,UAAU,EACVC,MAAMC,aAAa,EACnBC,WAAW,EACXC,UAAUC,iBAAiB,EAC3BC,QAAQ,EACRC,KAAK,EACLC,QAAQ,EACRC,KAAK,EACN,GAAGrB;IAEJ,MAAM,EAAEsB,IAAI,EAAE,GAAG5B;IAEjB,MAAM6B,mBAAmCjC,YACvC,CAACkC,OAAOC;QACN,IAAI,OAAOL,aAAa,YAAY;YAClC,OAAOA,SAASI,OAAO;gBAAE,GAAGC,OAAO;gBAAEP;YAAS;QAChD;IACF,GACA;QAACE;QAAUF;KAAS;IAGtB,MAAM,EAAEL,MAAMa,eAAe,EAAEV,UAAUW,mBAAmB,EAAE,GAAGpC;IAEjE,MAAM,EAAEqC,gBAAgB,EAAEC,cAAc,EAAEhB,IAAI,EAAEiB,QAAQ,EAAEC,SAAS,EAAEP,KAAK,EAAE,GAAGhC,SAAS;QACtFqB,MAAMa,mBAAmBZ,iBAAiBb;QAC1CmB,UAAUG;IACZ;IAEA,MAAMS,WAAWf,qBAAqBU,uBAAuBE,kBAAkBD;IAE/E,qBACE,MAACK;QACCzB,WAAW;YAACV;YAAgB;YAASU;YAAWuB,aAAa;YAASC,YAAY;SAAY,CAC3FE,MAAM,CAACC,SACPC,IAAI,CAAC;QACRjB,OAAO;YACL,GAAGA,KAAK;YACRE;QACF;;0BAEA,KAACxB;gBACCS,aAAaA;gBACbK,OAAOA;gBACPO,UAAUA;gBACT,GAAIN,cAAc,CAAC,CAAC;;0BAEvB,MAACqB;gBAAIzB,WAAW,CAAC,EAAEV,eAAe,MAAM,CAAC;;kCACvC,KAACF;wBAAWS,aAAaA;wBAAaQ,MAAMA;wBAAO,GAAIH,cAAc,CAAC,CAAC;;oBACtEP;kCACD,KAACkC;wBACC9B,cAAcA;wBACdyB,UAAUA;wBACVM,IAAI,CAAC,MAAM,EAAEzB,KAAK0B,OAAO,CAAC,OAAO,MAAM,CAAC;wBACxCtC,MAAMY;wBACN2B,UAAUV;wBACVf,aAAa3B,eAAe2B,aAAaO;wBACzCmB,MAAK;wBACLjB,OAAO,AAACA,SAAoB;;oBAE7BtB;;;YAEFE,sBAAsBsC,YACrBtC,kCAEA,KAACT;gBAAkB,GAAIc,oBAAoB,CAAC,CAAC;;;;AAIrD;AAEA,OAAO,MAAMkC,aAAalD,cAAcM,qBAAoB"}
1
+ {"version":3,"sources":["../../../src/fields/Email/index.tsx"],"sourcesContent":["'use client'\nimport type { EmailFieldProps, EmailFieldValidation } from 'payload'\n\nimport { getTranslation } from '@payloadcms/translations'\nimport React, { useCallback } from 'react'\n\nimport { useFieldProps } from '../../forms/FieldPropsProvider/index.js'\nimport { useField } from '../../forms/useField/index.js'\nimport { withCondition } from '../../forms/withCondition/index.js'\nimport { useTranslation } from '../../providers/Translation/index.js'\nimport { FieldDescription } from '../FieldDescription/index.js'\nimport { FieldError } from '../FieldError/index.js'\nimport { FieldLabel } from '../FieldLabel/index.js'\nimport { fieldBaseClass } from '../shared/index.js'\nimport './index.scss'\n\nconst EmailFieldComponent: React.FC<EmailFieldProps> = (props) => {\n const {\n name,\n AfterInput,\n BeforeInput,\n CustomDescription,\n CustomError,\n CustomLabel,\n autoComplete,\n className,\n descriptionProps,\n errorProps,\n label,\n labelProps,\n path: pathFromProps,\n placeholder,\n readOnly: readOnlyFromProps,\n required,\n style,\n validate,\n width,\n } = props\n\n const { i18n } = useTranslation()\n\n const memoizedValidate: EmailFieldValidation = useCallback(\n (value, options) => {\n if (typeof validate === 'function') {\n return validate(value, { ...options, required })\n }\n },\n [validate, required],\n )\n\n const { path: pathFromContext, readOnly: readOnlyFromContext } = useFieldProps()\n\n const { formInitializing, formProcessing, path, setValue, showError, value } = useField({\n path: pathFromContext ?? pathFromProps ?? name,\n validate: memoizedValidate,\n })\n\n const disabled = readOnlyFromProps || readOnlyFromContext || formProcessing || formInitializing\n\n return (\n <div\n className={[fieldBaseClass, 'email', className, showError && 'error', disabled && 'read-only']\n .filter(Boolean)\n .join(' ')}\n style={{\n ...style,\n width,\n }}\n >\n <FieldLabel\n CustomLabel={CustomLabel}\n label={label}\n required={required}\n {...(labelProps || {})}\n />\n <div className={`${fieldBaseClass}__wrap`}>\n <FieldError CustomError={CustomError} path={path} {...(errorProps || {})} />\n {BeforeInput}\n <input\n autoComplete={autoComplete}\n disabled={disabled}\n id={`field-${path.replace(/\\./g, '__')}`}\n name={path}\n onChange={setValue}\n placeholder={getTranslation(placeholder, i18n)}\n type=\"email\"\n value={(value as string) || ''}\n />\n {AfterInput}\n </div>\n {CustomDescription !== undefined ? (\n CustomDescription\n ) : (\n <FieldDescription {...(descriptionProps || {})} />\n )}\n </div>\n )\n}\n\nexport const EmailField = withCondition(EmailFieldComponent)\n"],"names":["getTranslation","React","useCallback","useFieldProps","useField","withCondition","useTranslation","FieldDescription","FieldError","FieldLabel","fieldBaseClass","EmailFieldComponent","props","name","AfterInput","BeforeInput","CustomDescription","CustomError","CustomLabel","autoComplete","className","descriptionProps","errorProps","label","labelProps","path","pathFromProps","placeholder","readOnly","readOnlyFromProps","required","style","validate","width","i18n","memoizedValidate","value","options","pathFromContext","readOnlyFromContext","formInitializing","formProcessing","setValue","showError","disabled","div","filter","Boolean","join","input","id","replace","onChange","type","undefined","EmailField"],"mappings":"AAAA;;AAGA,SAASA,cAAc,QAAQ,2BAA0B;AACzD,OAAOC,SAASC,WAAW,QAAQ,QAAO;AAE1C,SAASC,aAAa,QAAQ,0CAAyC;AACvE,SAASC,QAAQ,QAAQ,gCAA+B;AACxD,SAASC,aAAa,QAAQ,qCAAoC;AAClE,SAASC,cAAc,QAAQ,uCAAsC;AACrE,SAASC,gBAAgB,QAAQ,+BAA8B;AAC/D,SAASC,UAAU,QAAQ,yBAAwB;AACnD,SAASC,UAAU,QAAQ,yBAAwB;AACnD,SAASC,cAAc,QAAQ,qBAAoB;AACnD,OAAO,eAAc;AAErB,MAAMC,sBAAiD,CAACC;IACtD,MAAM,EACJC,IAAI,EACJC,UAAU,EACVC,WAAW,EACXC,iBAAiB,EACjBC,WAAW,EACXC,WAAW,EACXC,YAAY,EACZC,SAAS,EACTC,gBAAgB,EAChBC,UAAU,EACVC,KAAK,EACLC,UAAU,EACVC,MAAMC,aAAa,EACnBC,WAAW,EACXC,UAAUC,iBAAiB,EAC3BC,QAAQ,EACRC,KAAK,EACLC,QAAQ,EACRC,KAAK,EACN,GAAGrB;IAEJ,MAAM,EAAEsB,IAAI,EAAE,GAAG5B;IAEjB,MAAM6B,mBAAyCjC,YAC7C,CAACkC,OAAOC;QACN,IAAI,OAAOL,aAAa,YAAY;YAClC,OAAOA,SAASI,OAAO;gBAAE,GAAGC,OAAO;gBAAEP;YAAS;QAChD;IACF,GACA;QAACE;QAAUF;KAAS;IAGtB,MAAM,EAAEL,MAAMa,eAAe,EAAEV,UAAUW,mBAAmB,EAAE,GAAGpC;IAEjE,MAAM,EAAEqC,gBAAgB,EAAEC,cAAc,EAAEhB,IAAI,EAAEiB,QAAQ,EAAEC,SAAS,EAAEP,KAAK,EAAE,GAAGhC,SAAS;QACtFqB,MAAMa,mBAAmBZ,iBAAiBb;QAC1CmB,UAAUG;IACZ;IAEA,MAAMS,WAAWf,qBAAqBU,uBAAuBE,kBAAkBD;IAE/E,qBACE,MAACK;QACCzB,WAAW;YAACV;YAAgB;YAASU;YAAWuB,aAAa;YAASC,YAAY;SAAY,CAC3FE,MAAM,CAACC,SACPC,IAAI,CAAC;QACRjB,OAAO;YACL,GAAGA,KAAK;YACRE;QACF;;0BAEA,KAACxB;gBACCS,aAAaA;gBACbK,OAAOA;gBACPO,UAAUA;gBACT,GAAIN,cAAc,CAAC,CAAC;;0BAEvB,MAACqB;gBAAIzB,WAAW,CAAC,EAAEV,eAAe,MAAM,CAAC;;kCACvC,KAACF;wBAAWS,aAAaA;wBAAaQ,MAAMA;wBAAO,GAAIH,cAAc,CAAC,CAAC;;oBACtEP;kCACD,KAACkC;wBACC9B,cAAcA;wBACdyB,UAAUA;wBACVM,IAAI,CAAC,MAAM,EAAEzB,KAAK0B,OAAO,CAAC,OAAO,MAAM,CAAC;wBACxCtC,MAAMY;wBACN2B,UAAUV;wBACVf,aAAa3B,eAAe2B,aAAaO;wBACzCmB,MAAK;wBACLjB,OAAO,AAACA,SAAoB;;oBAE7BtB;;;YAEFE,sBAAsBsC,YACrBtC,kCAEA,KAACT;gBAAkB,GAAIc,oBAAoB,CAAC,CAAC;;;;AAIrD;AAEA,OAAO,MAAMkC,aAAalD,cAAcM,qBAAoB"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/fields/JSON/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAkB,cAAc,EAAE,MAAM,SAAS,CAAA;AAE7D,OAAO,KAA2C,MAAM,OAAO,CAAA;AAO/D,OAAO,cAAc,CAAA;AA8IrB,eAAO,MAAM,SAAS,0BAAoC,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/fields/JSON/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAE7C,OAAO,KAA2C,MAAM,OAAO,CAAA;AAO/D,OAAO,cAAc,CAAA;AA8IrB,eAAO,MAAM,SAAS,0BAAoC,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/fields/JSON/index.tsx"],"sourcesContent":["'use client'\nimport type { ClientValidate, JSONFieldProps } from 'payload'\n\nimport React, { useCallback, useEffect, useState } from 'react'\n\nimport { CodeEditor } from '../../elements/CodeEditor/index.js'\nimport { useField } from '../../forms/useField/index.js'\nimport { withCondition } from '../../forms/withCondition/index.js'\nimport { FieldLabel } from '../FieldLabel/index.js'\nimport { fieldBaseClass } from '../shared/index.js'\nimport './index.scss'\n\nconst baseClass = 'json-field'\n\nimport { useFieldProps } from '../../forms/FieldPropsProvider/index.js'\nimport { FieldDescription } from '../FieldDescription/index.js'\nimport { FieldError } from '../FieldError/index.js'\n\nconst JSONFieldComponent: React.FC<JSONFieldProps> = (props) => {\n const {\n name,\n AfterInput,\n BeforeInput,\n CustomDescription,\n CustomError,\n CustomLabel,\n className,\n descriptionProps,\n editorOptions,\n errorProps,\n jsonSchema,\n label,\n labelProps,\n path: pathFromProps,\n readOnly: readOnlyFromProps,\n required,\n style,\n validate,\n width,\n } = props\n\n const [stringValue, setStringValue] = useState<string>()\n const [jsonError, setJsonError] = useState<string>()\n const [hasLoadedValue, setHasLoadedValue] = useState(false)\n\n const memoizedValidate: ClientValidate = useCallback(\n (value, options) => {\n if (typeof validate === 'function')\n return validate(value, { ...options, jsonError, required })\n },\n [validate, required, jsonError],\n )\n\n const { path: pathFromContext, readOnly: readOnlyFromContext } = useFieldProps()\n\n const { formInitializing, formProcessing, initialValue, path, setValue, showError, value } =\n useField<string>({\n path: pathFromContext ?? pathFromProps ?? name,\n validate: memoizedValidate,\n })\n\n const disabled = readOnlyFromProps || readOnlyFromContext || formProcessing || formInitializing\n\n const handleMount = useCallback(\n (editor, monaco) => {\n if (!jsonSchema) return\n\n const existingSchemas = monaco.languages.json.jsonDefaults.diagnosticsOptions.schemas || []\n const modelUri = monaco.Uri.parse(jsonSchema.uri)\n\n const model = monaco.editor.createModel(JSON.stringify(value, null, 2), 'json', modelUri)\n monaco.languages.json.jsonDefaults.setDiagnosticsOptions({\n enableSchemaRequest: true,\n schemas: [...existingSchemas, jsonSchema],\n validate: true,\n })\n\n editor.setModel(model)\n },\n [jsonSchema, value],\n )\n\n const handleChange = useCallback(\n (val) => {\n if (disabled) return\n setStringValue(val)\n\n try {\n setValue(val ? JSON.parse(val) : null)\n setJsonError(undefined)\n } catch (e) {\n setValue(val ? val : null)\n setJsonError(e)\n }\n },\n [disabled, setValue, setStringValue],\n )\n\n useEffect(() => {\n if (hasLoadedValue || value === undefined) return\n\n setStringValue(\n value || initialValue ? JSON.stringify(value ? value : initialValue, null, 2) : '',\n )\n\n setHasLoadedValue(true)\n }, [initialValue, value, hasLoadedValue])\n\n return (\n <div\n className={[\n fieldBaseClass,\n baseClass,\n className,\n showError && 'error',\n disabled && 'read-only',\n ]\n .filter(Boolean)\n .join(' ')}\n style={{\n ...style,\n width,\n }}\n >\n <FieldLabel\n CustomLabel={CustomLabel}\n label={label}\n required={required}\n {...(labelProps || {})}\n />\n <div className={`${fieldBaseClass}__wrap`}>\n <FieldError CustomError={CustomError} path={path} {...(errorProps || {})} />\n {BeforeInput}\n <CodeEditor\n defaultLanguage=\"json\"\n onChange={handleChange}\n onMount={handleMount}\n options={editorOptions}\n readOnly={disabled}\n value={stringValue}\n />\n {AfterInput}\n </div>\n {CustomDescription !== undefined ? (\n CustomDescription\n ) : (\n <FieldDescription {...(descriptionProps || {})} />\n )}\n </div>\n )\n}\n\nexport const JSONField = withCondition(JSONFieldComponent)\n"],"names":["React","useCallback","useEffect","useState","CodeEditor","useField","withCondition","FieldLabel","fieldBaseClass","baseClass","useFieldProps","FieldDescription","FieldError","JSONFieldComponent","props","name","AfterInput","BeforeInput","CustomDescription","CustomError","CustomLabel","className","descriptionProps","editorOptions","errorProps","jsonSchema","label","labelProps","path","pathFromProps","readOnly","readOnlyFromProps","required","style","validate","width","stringValue","setStringValue","jsonError","setJsonError","hasLoadedValue","setHasLoadedValue","memoizedValidate","value","options","pathFromContext","readOnlyFromContext","formInitializing","formProcessing","initialValue","setValue","showError","disabled","handleMount","editor","monaco","existingSchemas","languages","json","jsonDefaults","diagnosticsOptions","schemas","modelUri","Uri","parse","uri","model","createModel","JSON","stringify","setDiagnosticsOptions","enableSchemaRequest","setModel","handleChange","val","undefined","e","div","filter","Boolean","join","defaultLanguage","onChange","onMount","JSONField"],"mappings":"AAAA;;AAGA,OAAOA,SAASC,WAAW,EAAEC,SAAS,EAAEC,QAAQ,QAAQ,QAAO;AAE/D,SAASC,UAAU,QAAQ,qCAAoC;AAC/D,SAASC,QAAQ,QAAQ,gCAA+B;AACxD,SAASC,aAAa,QAAQ,qCAAoC;AAClE,SAASC,UAAU,QAAQ,yBAAwB;AACnD,SAASC,cAAc,QAAQ,qBAAoB;AACnD,OAAO,eAAc;AAErB,MAAMC,YAAY;AAElB,SAASC,aAAa,QAAQ,0CAAyC;AACvE,SAASC,gBAAgB,QAAQ,+BAA8B;AAC/D,SAASC,UAAU,QAAQ,yBAAwB;AAEnD,MAAMC,qBAA+C,CAACC;IACpD,MAAM,EACJC,IAAI,EACJC,UAAU,EACVC,WAAW,EACXC,iBAAiB,EACjBC,WAAW,EACXC,WAAW,EACXC,SAAS,EACTC,gBAAgB,EAChBC,aAAa,EACbC,UAAU,EACVC,UAAU,EACVC,KAAK,EACLC,UAAU,EACVC,MAAMC,aAAa,EACnBC,UAAUC,iBAAiB,EAC3BC,QAAQ,EACRC,KAAK,EACLC,QAAQ,EACRC,KAAK,EACN,GAAGrB;IAEJ,MAAM,CAACsB,aAAaC,eAAe,GAAGlC;IACtC,MAAM,CAACmC,WAAWC,aAAa,GAAGpC;IAClC,MAAM,CAACqC,gBAAgBC,kBAAkB,GAAGtC,SAA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YACrBnC,aAAaqC;QACf;IACF,GACA;QAACxB;QAAUF;QAAUb;KAAe;IAGtCnC,UAAU;QACR,IAAIsC,kBAAkBG,UAAUgC,WAAW;QAE3CtC,eACEM,SAASM,eAAemB,KAAKC,SAAS,CAAC1B,QAAQA,QAAQM,cAAc,MAAM,KAAK;QAGlFR,kBAAkB;IACpB,GAAG;QAACQ;QAAcN;QAAOH;KAAe;IAExC,qBACE,MAACqC;QACCxD,WAAW;YACTb;YACAC;YACAY;YACA8B,aAAa;YACbC,YAAY;SACb,CACE0B,MAAM,CAACC,SACPC,IAAI,CAAC;QACR/C,OAAO;YACL,GAAGA,KAAK;YACRE;QACF;;0BAEA,KAAC5B;gBACCa,aAAaA;gBACbM,OAAOA;gBACPM,UAAUA;gBACT,GAAIL,cAAc,CAAC,CAAC;;0BAEvB,MAACkD;gBAAIxD,WAAW,CAAC,EAAEb,eAAe,MAAM,CAAC;;kCACvC,KAACI;wBAAWO,aAAaA;wBAAaS,MAAMA;wBAAO,GAAIJ,cAAc,CAAC,CAAC;;oBACtEP;kCACD,KAACb;wBACC6E,iBAAgB;wBAChBC,UAAUT;wBACVU,SAAS9B;wBACTT,SAASrB;wBACTO,UAAUsB;wBACVT,OAAOP;;oBAERpB;;;YAEFE,sBAAsByD,YACrBzD,kCAEA,KAACP;gBAAkB,GAAIW,oBAAoB,CAAC,CAAC;;;;AAIrD;AAEA,OAAO,MAAM8D,YAAY9E,cAAcO,oBAAmB"}
1
+ {"version":3,"sources":["../../../src/fields/JSON/index.tsx"],"sourcesContent":["'use client'\nimport type { JSONFieldProps } from 'payload'\n\nimport React, { useCallback, useEffect, useState } from 'react'\n\nimport { CodeEditor } from '../../elements/CodeEditor/index.js'\nimport { useField } from '../../forms/useField/index.js'\nimport { withCondition } from '../../forms/withCondition/index.js'\nimport { FieldLabel } from '../FieldLabel/index.js'\nimport { fieldBaseClass } from '../shared/index.js'\nimport './index.scss'\n\nconst baseClass = 'json-field'\n\nimport { useFieldProps } from '../../forms/FieldPropsProvider/index.js'\nimport { FieldDescription } from '../FieldDescription/index.js'\nimport { FieldError } from '../FieldError/index.js'\n\nconst JSONFieldComponent: React.FC<JSONFieldProps> = (props) => {\n const {\n name,\n AfterInput,\n BeforeInput,\n CustomDescription,\n CustomError,\n CustomLabel,\n className,\n descriptionProps,\n editorOptions,\n errorProps,\n jsonSchema,\n label,\n labelProps,\n path: pathFromProps,\n readOnly: readOnlyFromProps,\n required,\n style,\n validate,\n width,\n } = props\n\n const [stringValue, setStringValue] = useState<string>()\n const [jsonError, setJsonError] = useState<string>()\n const [hasLoadedValue, setHasLoadedValue] = useState(false)\n\n const memoizedValidate = useCallback(\n (value, options) => {\n if (typeof validate === 'function')\n return validate(value, { ...options, jsonError, required })\n },\n [validate, required, jsonError],\n )\n\n const { path: pathFromContext, readOnly: readOnlyFromContext } = useFieldProps()\n\n const { formInitializing, formProcessing, initialValue, path, setValue, showError, value } =\n useField<string>({\n path: pathFromContext ?? pathFromProps ?? name,\n validate: memoizedValidate,\n })\n\n const disabled = readOnlyFromProps || readOnlyFromContext || formProcessing || formInitializing\n\n const handleMount = useCallback(\n (editor, monaco) => {\n if (!jsonSchema) return\n\n const existingSchemas = monaco.languages.json.jsonDefaults.diagnosticsOptions.schemas || []\n const modelUri = monaco.Uri.parse(jsonSchema.uri)\n\n const model = monaco.editor.createModel(JSON.stringify(value, null, 2), 'json', modelUri)\n monaco.languages.json.jsonDefaults.setDiagnosticsOptions({\n enableSchemaRequest: true,\n schemas: [...existingSchemas, jsonSchema],\n validate: true,\n })\n\n editor.setModel(model)\n },\n [jsonSchema, value],\n )\n\n const handleChange = useCallback(\n (val) => {\n if (disabled) return\n setStringValue(val)\n\n try {\n setValue(val ? JSON.parse(val) : null)\n setJsonError(undefined)\n } catch (e) {\n setValue(val ? val : null)\n setJsonError(e)\n }\n },\n [disabled, setValue, setStringValue],\n )\n\n useEffect(() => {\n if (hasLoadedValue || value === undefined) return\n\n setStringValue(\n value || initialValue ? JSON.stringify(value ? value : initialValue, null, 2) : '',\n )\n\n setHasLoadedValue(true)\n }, [initialValue, value, hasLoadedValue])\n\n return (\n <div\n className={[\n fieldBaseClass,\n baseClass,\n className,\n showError && 'error',\n disabled && 'read-only',\n ]\n .filter(Boolean)\n .join(' ')}\n style={{\n ...style,\n width,\n }}\n >\n <FieldLabel\n CustomLabel={CustomLabel}\n label={label}\n required={required}\n {...(labelProps || {})}\n />\n <div className={`${fieldBaseClass}__wrap`}>\n <FieldError CustomError={CustomError} path={path} {...(errorProps || {})} />\n {BeforeInput}\n <CodeEditor\n defaultLanguage=\"json\"\n onChange={handleChange}\n onMount={handleMount}\n options={editorOptions}\n readOnly={disabled}\n value={stringValue}\n />\n {AfterInput}\n </div>\n {CustomDescription !== undefined ? (\n CustomDescription\n ) : (\n <FieldDescription {...(descriptionProps || {})} />\n )}\n </div>\n )\n}\n\nexport const JSONField = withCondition(JSONFieldComponent)\n"],"names":["React","useCallback","useEffect","useState","CodeEditor","useField","withCondition","FieldLabel","fieldBaseClass","baseClass","useFieldProps","FieldDescription","FieldError","JSONFieldComponent","props","name","AfterInput","BeforeInput","CustomDescription","CustomError","CustomLabel","className","descriptionProps","editorOptions","errorProps","jsonSchema","label","labelProps","path","pathFromProps","readOnly","readOnlyFromProps","required","style","validate","width","stringValue","setStringValue","jsonError","setJsonError","hasLoadedValue","setHasLoadedValue","memoizedValidate","value","options","pathFromContext","readOnlyFromContext","formInitializing","formProcessing","initialValue","setValue","showError","disabled","handleMount","editor","monaco","existingSchemas","languages","json","jsonDefaults","diagnosticsOptions","schemas","modelUri","Uri","parse","uri","model","createModel","JSON","stringify","setDiagnosticsOptions","enableSchemaRequest","setModel","handleChange","val","undefined","e","div","filter","Boolean","join","defaultLanguage","onChange","onMount","JSONField"],"mappings":"AAAA;;AAGA,OAAOA,SAASC,WAAW,EAAEC,SAAS,EAAEC,QAAQ,QAAQ,QAAO;AAE/D,SAASC,UAAU,QAAQ,qCAAoC;AAC/D,SAASC,QAAQ,QAA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AW,CAAC,EAAEb,eAAe,MAAM,CAAC;;kCACvC,KAACI;wBAAWO,aAAaA;wBAAaS,MAAMA;wBAAO,GAAIJ,cAAc,CAAC,CAAC;;oBACtEP;kCACD,KAACb;wBACC6E,iBAAgB;wBAChBC,UAAUT;wBACVU,SAAS9B;wBACTT,SAASrB;wBACTO,UAAUsB;wBACVT,OAAOP;;oBAERpB;;;YAEFE,sBAAsByD,YACrBzD,kCAEA,KAACP;gBAAkB,GAAIW,oBAAoB,CAAC,CAAC;;;;AAIrD;AAEA,OAAO,MAAM8D,YAAY9E,cAAcO,oBAAmB"}
@@ -1,4 +1,4 @@
1
- import type { Description, Validate } from 'payload';
1
+ import type { Description, PasswordFieldValidation } from 'payload';
2
2
  import React from 'react';
3
3
  import './index.scss';
4
4
  export type PasswordFieldProps = {
@@ -21,7 +21,7 @@ export type PasswordFieldProps = {
21
21
  required?: boolean;
22
22
  rtl?: boolean;
23
23
  style?: React.CSSProperties;
24
- validate?: Validate;
24
+ validate?: PasswordFieldValidation;
25
25
  width?: string;
26
26
  };
27
27
  export declare const PasswordField: React.FC<PasswordFieldProps>;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/fields/Password/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAkB,WAAW,EAAkB,QAAQ,EAAE,MAAM,SAAS,CAAA;AAIpF,OAAO,KAAsB,MAAM,OAAO,CAAA;AAK1C,OAAO,cAAc,CAAA;AAGrB,MAAM,MAAM,kBAAkB,GAAG;IAC/B,UAAU,CAAC,EAAE,KAAK,CAAC,YAAY,CAAA;IAC/B,WAAW,CAAC,EAAE,KAAK,CAAC,YAAY,CAAA;IAChC,iBAAiB,CAAC,EAAE,KAAK,CAAC,YAAY,CAAA;IACtC,WAAW,CAAC,EAAE,KAAK,CAAC,YAAY,CAAA;IAChC,WAAW,CAAC,EAAE,KAAK,CAAC,YAAY,CAAA;IAChC,YAAY,CAAC,EAAE,MAAM,CAAA;I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IACzB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,UAAU,CAAC,EAAE,GAAG,CAAA;IAChB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,gBAAgB,CAAC,CAAA;IAC5C,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,UAAU,CAAC,EAAE,GAAG,CAAA;IAChB,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,GAAG,CAAC,EAAE,OAAO,CAAA;IACb,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAA;IAC3B,QAAQ,CAAC,EAAE,uBAAuB,CAAA;IAClC,KAAK,CAAC,EAAE,MAAM,CAAA;CACf,CAAA;AAiGD,eAAO,MAAM,aAAa,8BAAwC,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/fields/Password/index.tsx"],"sourcesContent":["'use client'\nimport type { ClientValidate, Description, PayloadRequest, Validate } from 'payload'\n\nimport { useConfig, useLocale, useTranslation } from '@payloadcms/ui'\nimport { password } from 'payload/shared'\nimport React, { useCallback } from 'react'\n\nimport { useField } from '../../forms/useField/index.js'\nimport { withCondition } from '../../forms/withCondition/index.js'\nimport { isFieldRTL } from '../shared/index.js'\nimport './index.scss'\nimport { PasswordInput } from './input.js'\n\nexport type PasswordFieldProps = {\n AfterInput?: React.ReactElement\n BeforeInput?: React.ReactElement\n CustomDescription?: React.ReactElement\n CustomError?: React.ReactElement\n CustomLabel?: React.ReactElement\n autoComplete?: string\n className?: string\n description?: Description\n disabled?: boolean\n errorProps?: any // unknown type\n inputRef?: React.RefObject<HTMLInputElement>\n label?: string\n labelProps?: any // unknown type\n name: string\n path?: string\n placeholder?: string\n required?: boolean\n rtl?: boolean\n style?: React.CSSProperties\n validate?: Validate\n width?: string\n}\n\nconst PasswordFieldComponent: React.FC<PasswordFieldProps> = (props) => {\n const {\n name,\n AfterInput,\n BeforeInput,\n CustomDescription,\n CustomError,\n CustomLabel,\n autoComplete,\n className,\n disabled: disabledFromProps,\n errorProps,\n inputRef,\n label,\n labelProps,\n path: pathFromProps,\n placeholder,\n required,\n rtl,\n style,\n validate,\n width,\n } = props\n\n const { t } = useTranslation()\n const locale = useLocale()\n const config = useConfig()\n\n const memoizedValidate: ClientValidate = useCallback(\n (value, options) => {\n if (typeof validate === 'function') {\n return validate(value, { ...options, required })\n }\n\n return password(value, {\n name: 'password',\n type: 'text',\n data: {},\n preferences: { fields: {} },\n req: {\n payload: {\n config,\n },\n t,\n } as PayloadRequest,\n required: true,\n siblingData: {},\n })\n },\n [validate, config, t, required],\n )\n\n const { formInitializing, formProcessing, path, setValue, showError, value } = useField({\n path: pathFromProps || name,\n validate: memoizedValidate,\n })\n\n const disabled = disabledFromProps || formInitializing || formProcessing\n\n const renderRTL = isFieldRTL({\n fieldLocalized: false,\n fieldRTL: rtl,\n locale,\n localizationConfig: config.localization || undefined,\n })\n\n return (\n <PasswordInput\n AfterInput={AfterInput}\n BeforeInput={BeforeInput}\n CustomDescription={CustomDescription}\n CustomError={CustomError}\n CustomLabel={CustomLabel}\n autoComplete={autoComplete}\n className={className}\n errorProps={errorProps}\n inputRef={inputRef}\n label={label}\n labelProps={labelProps}\n onChange={(e) => {\n setValue(e.target.value)\n }}\n path={path}\n placeholder={placeholder}\n readOnly={disabled}\n required={required}\n rtl={renderRTL}\n showError={showError}\n style={style}\n value={(value as string) || ''}\n width={width}\n />\n )\n}\n\nexport const PasswordField = withCondition(PasswordFieldComponent)\n"],"names":["useConfig","useLocale","useTranslation","password","React","useCallback","useField","withCondition","isFieldRTL","PasswordInput","PasswordFieldComponent","props","name","AfterInput","BeforeInput","CustomDescription","CustomError","CustomLabel","autoComplete","className","disabled","disabledFromProps","errorProps","inputRef","label","labelProps","path","pathFromProps","placeholder","required","rtl","style","validate","width","t","locale","config","memoizedValidate","value","options","type","data","preferences","fields","req","payload","siblingData","formInitializing","formProcessing","setValue","showError","renderRTL","fieldLocalized","fieldRTL","localizationConfig","localization","undefined","onChange","e","target","readOnly","PasswordField"],"mappings":"AAAA;;AAGA,SAASA,SAAS,EAAEC,SAAS,EAAEC,cAAc,QAAQ,iBAAgB;AACrE,SAASC,QAAQ,QAAQ,iBAAgB;AACzC,OAAOC,SAASC,WAAW,QAAQ,QAAO;AAE1C,SAASC,QAAQ,QAAQ,gCAA+B;AACxD,SAASC,aAAa,QAAQ,qCAAoC;AAClE,SAASC,UAAU,QAAQ,qBAAoB;AAC/C,OAAO,eAAc;AACrB,SAASC,aAAa,QAAQ,aAAY;AA0B1C,MAAMC,yBAAuD,CAACC;IAC5D,MAAM,EACJC,IAAI,EACJC,UAAU,EACVC,WAAW,EACXC,iBAAiB,EACjBC,WAAW,EACXC,WAAW,EACXC,YAAY,EACZC,SAAS,EACTC,UAAUC,iBAAiB,EAC3BC,UAAU,EACVC,QAAQ,EACRC,KAAK,EACLC,UAAU,EACVC,MAAMC,aAAa,EACnBC,WAAW,EACXC,QAAQ,EACRC,GAAG,EACHC,KAAK,EACLC,QAAQ,EACRC,KAAK,EACN,GAAGtB;IAEJ,MAAM,EAAEuB,CAAC,EAAE,GAAGhC;IACd,MAAMiC,SAASlC;IACf,MAAMmC,SAASpC;IAEf,MAAMqC,mBAAmChC,YACvC,CAACiC,OAAOC;QACN,IAAI,OAAOP,aAAa,YAAY;YAClC,OAAOA,SAASM,OAAO;gBAAE,GAAGC,OAAO;gBAAEV;YAAS;QAChD;QAEA,OAAO1B,SAASmC,OAAO;YACrB1B,MAAM;YACN4B,MAAM;YACNC,MAAM,CAAC;YACPC,aAAa;gBAAEC,QAAQ,CAAC;YAAE;YAC1BC,KAAK;gBACHC,SAAS;oBACPT;gBACF;gBACAF;YACF;YACAL,UAAU;YACViB,aAAa,CAAC;QAChB;IACF,GACA;QAACd;QAAUI;QAAQF;QAAGL;KAAS;IAGjC,MAAM,EAAEkB,gBAAgB,EAAEC,cAAc,EAAEtB,IAAI,EAAEuB,QAAQ,EAAEC,SAAS,EAAEZ,KAAK,EAAE,GAAGhC,SAAS;QACtFoB,MAAMC,iBAAiBf;QACvBoB,UAAUK;IACZ;IAEA,MAAMjB,WAAWC,qBAAqB0B,oBAAoBC;IAE1D,MAAMG,YAAY3C,WAAW;QAC3B4C,gBAAgB;QAChBC,UAAUvB;QACVK;QACAmB,oBAAoBlB,OAAOmB,YAAY,IAAIC;IAC7C;IAEA,qBACE,KAAC/C;QACCI,YAAYA;QACZC,aAAaA;QACbC,mBAAmBA;QACnBC,aAAaA;QACbC,aAAaA;QACbC,cAAcA;QACdC,WAAWA;QACXG,YAAYA;QACZC,UAAUA;QACVC,OAAOA;QACPC,YAAYA;QACZgC,UAAU,CAACC;YACTT,SAASS,EAAEC,MAAM,CAACrB,KAAK;QACzB;QACAZ,MAAMA;QACNE,aAAaA;QACbgC,UAAUxC;QACVS,UAAUA;QACVC,KAAKqB;QACLD,WAAWA;QACXnB,OAAOA;QACPO,OAAO,AAACA,SAAoB;QAC5BL,OAAOA;;AAGb;AAEA,OAAO,MAAM4B,gBAAgBtD,cAAcG,wBAAuB"}
1
+ {"version":3,"sources":["../../../src/fields/Password/index.tsx"],"sourcesContent":["'use client'\nimport type { Description, PasswordFieldValidation, PayloadRequest, Validate } from 'payload'\n\nimport { useConfig, useLocale, useTranslation } from '@payloadcms/ui'\nimport { password } from 'payload/shared'\nimport React, { useCallback } from 'react'\n\nimport { useField } from '../../forms/useField/index.js'\nimport { withCondition } from '../../forms/withCondition/index.js'\nimport { isFieldRTL } from '../shared/index.js'\nimport './index.scss'\nimport { PasswordInput } from './input.js'\n\nexport type PasswordFieldProps = {\n AfterInput?: React.ReactElement\n BeforeInput?: React.ReactElement\n CustomDescription?: React.ReactElement\n CustomError?: React.ReactElement\n CustomLabel?: React.ReactElement\n autoComplete?: string\n className?: string\n description?: Description\n disabled?: boolean\n errorProps?: any // unknown type\n inputRef?: React.RefObject<HTMLInputElement>\n label?: string\n labelProps?: any // unknown type\n name: string\n path?: string\n placeholder?: string\n required?: boolean\n rtl?: boolean\n style?: React.CSSProperties\n validate?: PasswordFieldValidation\n width?: string\n}\n\nconst PasswordFieldComponent: React.FC<PasswordFieldProps> = (props) => {\n const {\n name,\n AfterInput,\n BeforeInput,\n CustomDescription,\n CustomError,\n CustomLabel,\n autoComplete,\n className,\n disabled: disabledFromProps,\n errorProps,\n inputRef,\n label,\n labelProps,\n path: pathFromProps,\n placeholder,\n required,\n rtl,\n style,\n validate,\n width,\n } = props\n\n const { t } = useTranslation()\n const locale = useLocale()\n const config = useConfig()\n\n const memoizedValidate: PasswordFieldValidation = useCallback(\n (value, options) => {\n if (typeof validate === 'function') {\n return validate(value, { ...options, required })\n }\n\n return password(value, {\n name: 'password',\n type: 'text',\n data: {},\n preferences: { fields: {} },\n req: {\n payload: {\n config,\n },\n t,\n } as PayloadRequest,\n required: true,\n siblingData: {},\n })\n },\n [validate, config, t, required],\n )\n\n const { formInitializing, formProcessing, path, setValue, showError, value } = useField({\n path: pathFromProps || name,\n validate: memoizedValidate,\n })\n\n const disabled = disabledFromProps || formInitializing || formProcessing\n\n const renderRTL = isFieldRTL({\n fieldLocalized: false,\n fieldRTL: rtl,\n locale,\n localizationConfig: config.localization || undefined,\n })\n\n return (\n <PasswordInput\n AfterInput={AfterInput}\n BeforeInput={BeforeInput}\n CustomDescription={CustomDescription}\n CustomError={CustomError}\n CustomLabel={CustomLabel}\n autoComplete={autoComplete}\n className={className}\n errorProps={errorProps}\n inputRef={inputRef}\n label={label}\n labelProps={labelProps}\n onChange={(e) => {\n setValue(e.target.value)\n }}\n path={path}\n placeholder={placeholder}\n readOnly={disabled}\n required={required}\n rtl={renderRTL}\n showError={showError}\n style={style}\n value={(value as string) || ''}\n width={width}\n />\n )\n}\n\nexport const PasswordField = withCondition(PasswordFieldComponent)\n"],"names":["useConfig","useLocale","useTranslation","password","React","useCallback","useField","withCondition","isFieldRTL","PasswordInput","PasswordFieldComponent","props","name","AfterInput","BeforeInput","CustomDescription","CustomError","CustomLabel","autoComplete","className","disabled","disabledFromProps","errorProps","inputRef","label","labelProps","path","pathFromProps","placeholder","required","rtl","style","validate","width","t","locale","config","memoizedValidate","value","options","type","data","preferences","fields","req","payload","siblingData","formInitializing","formProcessing","setValue","showError","renderRTL","fieldLocalized","fieldRTL","localizationConfig","localization","undefined","onChange","e","target","readOnly","PasswordField"],"mappings":"AAAA;;AAGA,SAASA,SAAS,EAAEC,SAAS,EAAEC,cAAc,QAAQ,iBAAgB;AACrE,SAASC,QAAQ,QAAQ,iBAAgB;AACzC,OAAOC,SAASC,WAAW,QAAQ,QAAO;AAE1C,SAASC,QAAQ,QAAQ,gCAA+B;AACxD,SAASC,aAAa,QAAQ,qCAAoC;AAClE,SAASC,UAAU,QAAQ,qBAAoB;AAC/C,OAAO,eAAc;AACrB,SAASC,aAAa,QAAQ,aAAY;AA0B1C,MAAMC,yBAAuD,CAACC;IAC5D,MAAM,EACJC,IAAI,EACJC,UAAU,EACVC,WAAW,EACXC,iBAAiB,EACjBC,WAAW,EACXC,WAAW,EACXC,YAAY,EACZC,SAAS,EACTC,UAAUC,iBAAiB,EAC3BC,UAAU,EACVC,QAAQ,EACRC,KAAK,EACLC,UAAU,EACVC,MAAMC,aAAa,EACnBC,WAAW,EACXC,QAAQ,EACRC,GAAG,EACHC,KAAK,EACLC,QAAQ,EACRC,KAAK,EACN,GAAGtB;IAEJ,MAAM,EAAEuB,CAAC,EAAE,GAAGhC;IACd,MAAMiC,SAASlC;IACf,MAAMmC,SAASpC;IAEf,MAAMqC,mBAA4ChC,YAChD,CAACiC,OAAOC;QACN,IAAI,OAAOP,aAAa,YAAY;YAClC,OAAOA,SAASM,OAAO;gBAAE,GAAGC,OAAO;gBAAEV;YAAS;QAChD;QAEA,OAAO1B,SAASmC,OAAO;YACrB1B,MAAM;YACN4B,MAAM;YACNC,MAAM,CAAC;YACPC,aAAa;gBAAEC,QAAQ,CAAC;YAAE;YAC1BC,KAAK;gBACHC,SAAS;oBACPT;gBACF;gBACAF;YACF;YACAL,UAAU;YACViB,aAAa,CAAC;QAChB;IACF,GACA;QAACd;QAAUI;QAAQF;QAAGL;KAAS;IAGjC,MAAM,EAAEkB,gBAAgB,EAAEC,cAAc,EAAEtB,IAAI,EAAEuB,QAAQ,EAAEC,SAAS,EAAEZ,KAAK,EAAE,GAAGhC,SAAS;QACtFoB,MAAMC,iBAAiBf;QACvBoB,UAAUK;IACZ;IAEA,MAAMjB,WAAWC,qBAAqB0B,oBAAoBC;IAE1D,MAAMG,YAAY3C,WAAW;QAC3B4C,gBAAgB;QAChBC,UAAUvB;QACVK;QACAmB,oBAAoBlB,OAAOmB,YAAY,IAAIC;IAC7C;IAEA,qBACE,KAAC/C;QACCI,YAAYA;QACZC,aAAaA;QACbC,mBAAmBA;QACnBC,aAAaA;QACbC,aAAaA;QACbC,cAAcA;QACdC,WAAWA;QACXG,YAAYA;QACZC,UAAUA;QACVC,OAAOA;QACPC,YAAYA;QACZgC,UAAU,CAACC;YACTT,SAASS,EAAEC,MAAM,CAACrB,KAAK;QACzB;QACAZ,MAAMA;QACNE,aAAaA;QACbgC,UAAUxC;QACVS,UAAUA;QACVC,KAAKqB;QACLD,WAAWA;QACXnB,OAAOA;QACPO,OAAO,AAACA,SAAoB;QAC5BL,OAAOA;;AAGb;AAEA,OAAO,MAAM4B,gBAAgBtD,cAAcG,wBAAuB"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/fields/Point/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAkB,eAAe,EAAE,MAAM,SAAS,CAAA;AAG9D,OAAO,KAAsB,MAAM,OAAO,CAAA;AAM1C,OAAO,cAAc,CAAA;AASrB,eAAO,MAAM,mBAAmB,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CA8IzD,CAAA;AAED,eAAO,MAAM,UAAU,2BAAqC,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/fields/Point/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAwB,MAAM,SAAS,CAAA;AAGpE,OAAO,KAAsB,MAAM,OAAO,CAAA;AAM1C,OAAO,cAAc,CAAA;AASrB,eAAO,MAAM,mBAAmB,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CA8IzD,CAAA;AAED,eAAO,MAAM,UAAU,2BAAqC,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/fields/Point/index.tsx"],"sourcesContent":["'use client'\nimport type { ClientValidate, PointFieldProps } from 'payload'\n\nimport { getTranslation } from '@payloadcms/translations'\nimport React, { useCallback } from 'react'\n\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\nconst baseClass = 'point'\n\nimport { useFieldProps } from '../../forms/FieldPropsProvider/index.js'\nimport { FieldDescription } from '../FieldDescription/index.js'\nimport { FieldError } from '../FieldError/index.js'\nimport { FieldLabel } from '../FieldLabel/index.js'\n\nexport const PointFieldComponent: React.FC<PointFieldProps> = (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 path: pathFromProps,\n placeholder,\n readOnly: readOnlyFromProps,\n required,\n step,\n style,\n validate,\n width,\n } = props\n\n const { i18n, t } = useTranslation()\n\n const memoizedValidate: ClientValidate = useCallback(\n (value, options) => {\n if (typeof validate === 'function') {\n return validate(value, { ...options, required })\n }\n },\n [validate, required],\n )\n\n const { path: pathFromContext, readOnly: readOnlyFromContext } = useFieldProps()\n const readOnly = readOnlyFromProps || readOnlyFromContext\n\n const {\n path,\n setValue,\n showError,\n value = [null, null],\n } = useField<[number, number]>({\n path: pathFromContext ?? pathFromProps ?? name,\n validate: memoizedValidate,\n })\n\n const handleChange = useCallback(\n (e, index: 0 | 1) => {\n let val = parseFloat(e.target.value)\n if (Number.isNaN(val)) {\n val = e.target.value\n }\n const coordinates = [...value]\n coordinates[index] = val\n setValue(coordinates)\n },\n [setValue, value],\n )\n\n const getCoordinateFieldLabel = (type: 'latitude' | 'longitude') => {\n const suffix = type === 'longitude' ? t('fields:longitude') : t('fields:latitude')\n const fieldLabel = label ? getTranslation(label, i18n) : ''\n\n return {\n ...labelProps,\n label: `${fieldLabel}${fieldLabel ? ' - ' : ''}${suffix}`,\n }\n }\n\n return (\n <div\n className={[\n fieldBaseClass,\n baseClass,\n className,\n showError && 'error',\n readOnly && 'read-only',\n ]\n .filter(Boolean)\n .join(' ')}\n style={{\n ...style,\n width,\n }}\n >\n <ul className={`${baseClass}__wrap`}>\n <li>\n {CustomLabel !== undefined ? (\n CustomLabel\n ) : (\n <FieldLabel {...getCoordinateFieldLabel('longitude')} />\n )}\n <div className=\"input-wrapper\">\n {BeforeInput}\n {/* disable eslint rule because the label is dynamic */}\n {/* eslint-disable-next-line jsx-a11y/control-has-associated-label */}\n <input\n disabled={readOnly}\n id={`field-longitude-${path.replace(/\\./g, '__')}`}\n name={`${path}.longitude`}\n onChange={(e) => handleChange(e, 0)}\n placeholder={getTranslation(placeholder, i18n)}\n step={step}\n type=\"number\"\n value={value && typeof value[0] === 'number' ? value[0] : ''}\n />\n {AfterInput}\n </div>\n </li>\n <li>\n {CustomLabel !== undefined ? (\n CustomLabel\n ) : (\n <FieldLabel {...getCoordinateFieldLabel('latitude')} />\n )}\n <div className=\"input-wrapper\">\n <FieldError CustomError={CustomError} path={path} {...(errorProps || {})} />\n {BeforeInput}\n {/* disable eslint rule because the label is dynamic */}\n {/* eslint-disable-next-line jsx-a11y/control-has-associated-label */}\n <input\n disabled={readOnly}\n id={`field-latitude-${path.replace(/\\./g, '__')}`}\n name={`${path}.latitude`}\n onChange={(e) => handleChange(e, 1)}\n placeholder={getTranslation(placeholder, i18n)}\n step={step}\n type=\"number\"\n value={value && typeof value[1] === 'number' ? value[1] : ''}\n />\n {AfterInput}\n </div>\n </li>\n </ul>\n {CustomDescription !== undefined ? (\n CustomDescription\n ) : (\n <FieldDescription {...(descriptionProps || {})} />\n )}\n </div>\n )\n}\n\nexport const PointField = withCondition(PointFieldComponent)\n"],"names":["getTranslation","React","useCallback","useField","withCondition","useTranslation","fieldBaseClass","baseClass","useFieldProps","FieldDescription","FieldError","FieldLabel","PointFieldComponent","props","name","AfterInput","BeforeInput","CustomDescription","CustomError","CustomLabel","className","descriptionProps","errorProps","label","labelProps","path","pathFromProps","placeholder","readOnly","readOnlyFromProps","required","step","style","validate","width","i18n","t","memoizedValidate","value","options","pathFromContext","readOnlyFromContext","setValue","showError","handleChange","e","index","val","parseFloat","target","Number","isNaN","coordinates","getCoordinateFieldLabel","type","suffix","fieldLabel","div","filter","Boolean","join","ul","li","undefined","input","disabled","id","replace","onChange","PointField"],"mappings":"AAAA;;AAGA,SAASA,cAAc,QAAQ,2BAA0B;AACzD,OAAOC,SAASC,WAAW,QAAQ,QAAO;AAE1C,SAASC,QAAQ,QAAQ,gCAA+B;AACxD,SAASC,aAAa,QAAQ,qCAAoC;AAClE,SAASC,cAAc,QAAQ,uCAAsC;AACrE,SAASC,cAAc,QAAQ,qBAAoB;AACnD,OAAO,eAAc;AAErB,MAAMC,YAAY;AAElB,SAASC,aAAa,QAAQ,0CAAyC;AACvE,SAASC,gBAAgB,QAAQ,+BAA8B;AAC/D,SAASC,UAAU,QAAQ,yBAAwB;AACnD,SAASC,UAAU,QAAQ,yBAAwB;AAEnD,OAAO,MAAMC,sBAAiD,CAACC;IAC7D,MAAM,EACJC,IAAI,EACJC,UAAU,EACVC,WAAW,EACXC,iBAAiB,EACjBC,WAAW,EACXC,WAAW,EACXC,SAAS,EACTC,gBAAgB,EAChBC,UAAU,EACVC,KAAK,EACLC,UAAU,EACVC,MAAMC,aAAa,EACnBC,WAAW,EACXC,UAAUC,iBAAiB,EAC3BC,QAAQ,EACRC,I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C;AAED,OAAO,MAAMgD,aAAajE,cAAcQ,qBAAoB"}
1
+ {"version":3,"sources":["../../../src/fields/Point/index.tsx"],"sourcesContent":["'use client'\nimport type { PointFieldProps, PointFieldValidation } from 'payload'\n\nimport { getTranslation } from '@payloadcms/translations'\nimport React, { useCallback } from 'react'\n\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\nconst baseClass = 'point'\n\nimport { useFieldProps } from '../../forms/FieldPropsProvider/index.js'\nimport { FieldDescription } from '../FieldDescription/index.js'\nimport { FieldError } from '../FieldError/index.js'\nimport { FieldLabel } from '../FieldLabel/index.js'\n\nexport const PointFieldComponent: React.FC<PointFieldProps> = (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 path: pathFromProps,\n placeholder,\n readOnly: readOnlyFromProps,\n required,\n step,\n style,\n validate,\n width,\n } = props\n\n const { i18n, t } = useTranslation()\n\n const memoizedValidate: PointFieldValidation = useCallback(\n (value, options) => {\n if (typeof validate === 'function') {\n return validate(value, { ...options, required })\n }\n },\n [validate, required],\n )\n\n const { path: pathFromContext, readOnly: readOnlyFromContext } = useFieldProps()\n const readOnly = readOnlyFromProps || readOnlyFromContext\n\n const {\n path,\n setValue,\n showError,\n value = [null, null],\n } = useField<[number, number]>({\n path: pathFromContext ?? pathFromProps ?? name,\n validate: memoizedValidate,\n })\n\n const handleChange = useCallback(\n (e, index: 0 | 1) => {\n let val = parseFloat(e.target.value)\n if (Number.isNaN(val)) {\n val = e.target.value\n }\n const coordinates = [...value]\n coordinates[index] = val\n setValue(coordinates)\n },\n [setValue, value],\n )\n\n const getCoordinateFieldLabel = (type: 'latitude' | 'longitude') => {\n const suffix = type === 'longitude' ? t('fields:longitude') : t('fields:latitude')\n const fieldLabel = label ? getTranslation(label, i18n) : ''\n\n return {\n ...labelProps,\n label: `${fieldLabel}${fieldLabel ? ' - ' : ''}${suffix}`,\n }\n }\n\n return (\n <div\n className={[\n fieldBaseClass,\n baseClass,\n className,\n showError && 'error',\n readOnly && 'read-only',\n ]\n .filter(Boolean)\n .join(' ')}\n style={{\n ...style,\n width,\n }}\n >\n <ul className={`${baseClass}__wrap`}>\n <li>\n {CustomLabel !== undefined ? (\n CustomLabel\n ) : (\n <FieldLabel {...getCoordinateFieldLabel('longitude')} />\n )}\n <div className=\"input-wrapper\">\n {BeforeInput}\n {/* disable eslint rule because the label is dynamic */}\n {/* eslint-disable-next-line jsx-a11y/control-has-associated-label */}\n <input\n disabled={readOnly}\n id={`field-longitude-${path.replace(/\\./g, '__')}`}\n name={`${path}.longitude`}\n onChange={(e) => handleChange(e, 0)}\n placeholder={getTranslation(placeholder, i18n)}\n step={step}\n type=\"number\"\n value={value && typeof value[0] === 'number' ? value[0] : ''}\n />\n {AfterInput}\n </div>\n </li>\n <li>\n {CustomLabel !== undefined ? (\n CustomLabel\n ) : (\n <FieldLabel {...getCoordinateFieldLabel('latitude')} />\n )}\n <div className=\"input-wrapper\">\n <FieldError CustomError={CustomError} path={path} {...(errorProps || {})} />\n {BeforeInput}\n {/* disable eslint rule because the label is dynamic */}\n {/* eslint-disable-next-line jsx-a11y/control-has-associated-label */}\n <input\n disabled={readOnly}\n id={`field-latitude-${path.replace(/\\./g, '__')}`}\n name={`${path}.latitude`}\n onChange={(e) => handleChange(e, 1)}\n placeholder={getTranslation(placeholder, i18n)}\n step={step}\n type=\"number\"\n value={value && typeof value[1] === 'number' ? value[1] : ''}\n />\n {AfterInput}\n </div>\n </li>\n </ul>\n {CustomDescription !== undefined ? (\n CustomDescription\n ) : (\n <FieldDescription {...(descriptionProps || {})} />\n )}\n </div>\n )\n}\n\nexport const PointField = withCondition(PointFieldComponent)\n"],"names":["getTranslation","React","useCallback","useField","withCondition","useTranslation","fieldBaseClass","baseClass","useFieldProps","FieldDescription","FieldError","FieldLabel","PointFieldComponent","props","name","AfterInput","BeforeInput","CustomDescription","CustomError","CustomLabel","className","descriptionProps","errorProps","label","labelProps","path","pathFromProps","placeholder","readOnly","readOnlyFromProps","required","step","style","validate","width","i18n","t","memoizedValidate","value","options","pathFromContext","readOnlyFromContext","setValue","showError","handleChange","e","index","val","parseFloat","target","Number","isNaN","coordinates","getCoordinateFieldLabel","type","suffix","fieldLabel","div","filter","Boolean","join","ul","li","undefined","input","disabled","id","replace","onChange","PointField"],"mappings":"AAAA;;AAGA,SAASA,cAAc,QAAQ,2BAA0B;AACzD,OAAOC,SAASC,WAAW,QAAQ,QAAO;AAE1C,SAASC,QAAQ,QAAQ,gCAA+B;AACxD,SAASC,aAAa,QAAQ,qCAAoC;AAClE,SAASC,cAAc,QAAQ,uCAAsC;AACrE,SAASC,cAAc,QAAQ,qBAAoB;AACnD,OAAO,eAAc;AAErB,MAAMC,YAAY;AAElB,SAASC,aAAa,QAAQ,0CAAyC;AACvE,SAASC,gBAAgB,QAAQ,+BAA8B;AAC/D,SAASC,UAAU,QAAQ,yBAAwB;AACnD,SAASC,UAAU,QAAQ,yBAAwB;AAEnD,OAAO,MAAMC,sBAAiD,CAACC;IAC7D,MAAM,EACJC,IAAI,EACJC,UAAU,EACVC,WAAW,EACXC,iBAAiB,EACjBC,WAAW,EACXC,WAAW,EACXC,SAAS,EACTC,gBAAgB,EAChBC,UAAU,EACVC,KAAK,EACLC,UAAU,EACVC,MAAMC,aAAa,EACnBC,WAAW,EACXC,UAAUC,iBAAiB,EAC3BC,QAAQ,EACRC,IAAI,EACJC,KAAK,EACLC,QAAQ,EACRC,KAAK,EACN,GAAGrB;IAEJ,MAAM,EAAEsB,IAAI,EAAEC,CAAC,EAAE,GAAG/B;IAEpB,MAAMgC,mBAAyCnC,YAC7C,CAACoC,OAAOC;QACN,IAAI,OAAON,aAAa,YAAY;YAClC,OAAOA,SAASK,OAAO;gBAAE,GAAGC,OAAO;gBAAET;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AAO,CAAA;AAIzB,OAAO,cAAc,CAAA;AAIrB,eAAO,MAAM,KAAK,EAAE,KAAK,CAAC,EAAE,CAAC;IAC3B,EAAE,EAAE,MAAM,CAAA;IACV,UAAU,EAAE,OAAO,CAAA;IACnB,QAAQ,EAAE,eAAe,CAAC,UAAU,CAAC,CAAA;IACrC,MAAM,EAAE,YAAY,CAAA;IACpB,IAAI,EAAE,MAAM,CAAA;IACZ,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,IAAI,CAAC,EAAE,MAAM,CAAA;CACd,CA0BA,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/fields/RadioGroup/Radio/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAG5D,OAAO,KAAK,MAAM,OAAO,CAAA;AAIzB,OAAO,cAAc,CAAA;AAIrB,eAAO,MAAM,KAAK,EAAE,KAAK,CAAC,EAAE,CAAC;IAC3B,EAAE,EAAE,MAAM,CAAA;IACV,UAAU,EAAE,OAAO,CAAA;IACnB,QAAQ,EAAE,eAAe,CAAC,UAAU,CAAC,CAAA;IACrC,MAAM,EAAE,YAAY,CAAA;IACpB,IAAI,EAAE,MAAM,CAAA;IACZ,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,IAAI,CAAC,EAAE,MAAM,CAAA;CACd,CAiCA,CAAA"}
@@ -28,7 +28,10 @@ export const Radio = (props)=>{
28
28
  type: "radio"
29
29
  }),
30
30
  /*#__PURE__*/ _jsx("span", {
31
- className: `${baseClass}__styled-radio`
31
+ className: [
32
+ `${baseClass}__styled-radio`,
33
+ readOnly && `${baseClass}__styled-radio--disabled`
34
+ ].filter(Boolean).join(' ')
32
35
  }),
33
36
  /*#__PURE__*/ _jsx("span", {
34
37
  className: `${baseClass}__label`,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/fields/RadioGroup/Radio/index.tsx"],"sourcesContent":["'use client'\nimport type { OptionObject, RadioFieldProps } from 'payload'\n\nimport { getTranslation } from '@payloadcms/translations'\nimport React from 'react'\n\nimport { useEditDepth } from '../../../providers/EditDepth/index.js'\nimport { useTranslation } from '../../../providers/Translation/index.js'\nimport './index.scss'\n\nconst baseClass = 'radio-input'\n\nexport const Radio: React.FC<{\n id: string\n isSelected: boolean\n onChange: RadioFieldProps['onChange']\n option: OptionObject\n path: string\n readOnly?: boolean\n uuid?: string\n}> = (props) => {\n const { isSelected, onChange, option, path, readOnly, uuid } = props\n const { i18n } = useTranslation()\n\n const editDepth = useEditDepth()\n\n const id = `field-${path}-${option.value}${editDepth > 1 ? `-${editDepth}` : ''}${uuid ? `-${uuid}` : ''}`\n\n return (\n <label htmlFor={id}>\n <div\n className={[baseClass, isSelected && `${baseClass}--is-selected`].filter(Boolean).join(' ')}\n >\n <input\n checked={isSelected}\n disabled={readOnly}\n id={id}\n name={path}\n onChange={() => (typeof onChange === 'function' ? onChange(option.value) : null)}\n type=\"radio\"\n />\n <span className={`${baseClass}__styled-radio`} />\n <span className={`${baseClass}__label`}>{getTranslation(option.label, i18n)}</span>\n </div>\n </label>\n )\n}\n"],"names":["getTranslation","React","useEditDepth","useTranslation","baseClass","Radio","props","isSelected","onChange","option","path","readOnly","uuid","i18n","editDepth","id","value","label","htmlFor","div","className","filter","Boolean","join","input","checked","disabled","name","type","span"],"mappings":"AAAA;;AAGA,SAASA,cAAc,QAAQ,2BAA0B;AACzD,OAAOC,WAAW,QAAO;AAEzB,SAASC,YAAY,QAAQ,wCAAuC;AACpE,SAASC,cAAc,QAAQ,0CAAyC;AACxE,OAAO,eAAc;AAErB,MAAMC,YAAY;AAElB,OAAO,MAAMC,QAQR,CAACC;IACJ,MAAM,EAAEC,UAAU,EAAEC,QAAQ,EAAEC,MAAM,EAAEC,IAAI,EAAEC,QAAQ,EAAEC,IAAI,EAAE,GAAGN;IAC/D,MAAM,EAAEO,IAAI,EAAE,GAAGV;IAEjB,MAAMW,YAAYZ;IAElB,MAAMa,KAAK,CAAC,MAAM,EAAEL,KAAK,CAAC,EAAED,OAAOO,KAAK,CAAC,EAAEF,YAAY,IAAI,CAAC,CAAC,EAAEA,UAAU,CAAC,GAAG,GAAG,EAAEF,OAAO,CAAC,CAAC,EAAEA,KAAK,CAAC,GAAG,GAAG,CAAC;IAE1G,qBACE,KAACK;QAAMC,SAASH;kBACd,cAAA,MAACI;YACCC,WAAW;gBAAChB;gBAAWG,cAAc,CAAC,EAAEH,UAAU,aAAa,CAAC;aAAC,CAACiB,MAAM,CAACC,SAASC,IAAI,CAAC;;8BAEvF,KAACC;oBACCC,SAASlB;oBACTmB,UAAUf;oBACVI,IAAIA;oBACJY,MAAMjB;oBACNF,UAAU,IAAO,OAAOA,aAAa,aAAaA,SAASC,OAAOO,KAAK,IAAI;oBAC3EY,MAAK;;8BAEP,KAACC;oBAAKT,WAAW,CAAC,EAAEhB,UAAU,cAAc,CAAC;;8BAC7C,KAACyB;oBAAKT,WAAW,CAAC,EAAEhB,UAAU,OAAO,CAAC;8BAAGJ,eAAeS,OAAOQ,KAAK,EAAEJ;;;;;AAI9E,EAAC"}
1
+ {"version":3,"sources":["../../../../src/fields/RadioGroup/Radio/index.tsx"],"sourcesContent":["'use client'\nimport type { OptionObject, RadioFieldProps } from 'payload'\n\nimport { getTranslation } from '@payloadcms/translations'\nimport React from 'react'\n\nimport { useEditDepth } from '../../../providers/EditDepth/index.js'\nimport { useTranslation } from '../../../providers/Translation/index.js'\nimport './index.scss'\n\nconst baseClass = 'radio-input'\n\nexport const Radio: React.FC<{\n id: string\n isSelected: boolean\n onChange: RadioFieldProps['onChange']\n option: OptionObject\n path: string\n readOnly?: boolean\n uuid?: string\n}> = (props) => {\n const { isSelected, onChange, option, path, readOnly, uuid } = props\n const { i18n } = useTranslation()\n\n const editDepth = useEditDepth()\n\n const id = `field-${path}-${option.value}${editDepth > 1 ? `-${editDepth}` : ''}${uuid ? `-${uuid}` : ''}`\n\n return (\n <label htmlFor={id}>\n <div\n className={[baseClass, isSelected && `${baseClass}--is-selected`].filter(Boolean).join(' ')}\n >\n <input\n checked={isSelected}\n disabled={readOnly}\n id={id}\n name={path}\n onChange={() => (typeof onChange === 'function' ? onChange(option.value) : null)}\n type=\"radio\"\n />\n <span\n className={[\n `${baseClass}__styled-radio`,\n readOnly && `${baseClass}__styled-radio--disabled`,\n ]\n .filter(Boolean)\n .join(' ')}\n />\n <span className={`${baseClass}__label`}>{getTranslation(option.label, i18n)}</span>\n </div>\n </label>\n )\n}\n"],"names":["getTranslation","React","useEditDepth","useTranslation","baseClass","Radio","props","isSelected","onChange","option","path","readOnly","uuid","i18n","editDepth","id","value","label","htmlFor","div","className","filter","Boolean","join","input","checked","disabled","name","type","span"],"mappings":"AAAA;;AAGA,SAASA,cAAc,QAAQ,2BAA0B;AACzD,OAAOC,WAAW,QAAO;AAEzB,SAASC,YAAY,QAAQ,wCAAuC;AACpE,SAASC,cAAc,QAAQ,0CAAyC;AACxE,OAAO,eAAc;AAErB,MAAMC,YAAY;AAElB,OAAO,MAAMC,QAQR,CAACC;IACJ,MAAM,EAAEC,UAAU,EAAEC,QAAQ,EAAEC,MAAM,EAAEC,IAAI,EAAEC,QAAQ,EAAEC,IAAI,EAAE,GAAGN;IAC/D,MAAM,EAAEO,IAAI,EAAE,GAAGV;IAEjB,MAAMW,YAAYZ;IAElB,MAAMa,KAAK,CAAC,MAAM,EAAEL,KAAK,CAAC,EAAED,OAAOO,KAAK,CAAC,EAAEF,YAAY,IAAI,CAAC,CAAC,EAAEA,UAAU,CAAC,GAAG,GAAG,EAAEF,OAAO,CAAC,CAAC,EAAEA,KAAK,CAAC,GAAG,GAAG,CAAC;IAE1G,qBACE,KAACK;QAAMC,SAASH;kBACd,cAAA,MAACI;YACCC,WAAW;gBAAChB;gBAAWG,cAAc,CAAC,EAAEH,UAAU,aAAa,CAAC;aAAC,CAACiB,MAAM,CAACC,SAASC,IAAI,CAAC;;8BAEvF,KAACC;oBACCC,SAASlB;oBACTmB,UAAUf;oBACVI,IAAIA;oBACJY,MAAMjB;oBACNF,UAAU,IAAO,OAAOA,aAAa,aAAaA,SAASC,OAAOO,KAAK,IAAI;oBAC3EY,MAAK;;8BAEP,KAACC;oBACCT,WAAW;wBACT,CAAC,EAAEhB,UAAU,cAAc,CAAC;wBAC5BO,YAAY,CAAC,EAAEP,UAAU,wBAAwB,CAAC;qBACnD,CACEiB,MAAM,CAACC,SACPC,IAAI,CAAC;;8BAEV,KAACM;oBAAKT,WAAW,CAAC,EAAEhB,UAAU,OAAO,CAAC;8BAAGJ,eAAeS,OAAOQ,KAAK,EAAEJ;;;;;AAI9E,EAAC"}