@payloadcms/ui 3.0.0-canary.ce278e4 → 3.0.0-canary.ee0375f

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 (214) hide show
  1. package/dist/elements/EditUpload/index.d.ts.map +1 -1
  2. package/dist/elements/EditUpload/index.js +28 -11
  3. package/dist/elements/EditUpload/index.js.map +1 -1
  4. package/dist/elements/HydrateClientUser/index.d.ts +0 -1
  5. package/dist/elements/HydrateClientUser/index.d.ts.map +1 -1
  6. package/dist/elements/ListControls/getTextFieldsToBeSearched.d.ts.map +1 -1
  7. package/dist/elements/Logout/index.d.ts.map +1 -1
  8. package/dist/elements/Logout/index.js +2 -1
  9. package/dist/elements/Logout/index.js.map +1 -1
  10. package/dist/elements/ReactSelect/DropdownIndicator/index.js +1 -1
  11. package/dist/elements/ReactSelect/DropdownIndicator/index.js.map +1 -1
  12. package/dist/elements/ReactSelect/types.d.ts +0 -1
  13. package/dist/elements/ReactSelect/types.d.ts.map +1 -1
  14. package/dist/elements/StepNav/SetStepNav.d.ts +0 -1
  15. package/dist/elements/StepNav/SetStepNav.d.ts.map +1 -1
  16. package/dist/elements/StepNav/index.d.ts.map +1 -1
  17. package/dist/elements/StepNav/index.js +1 -1
  18. package/dist/elements/StepNav/index.js.map +1 -1
  19. package/dist/elements/Table/DefaultCell/fields/index.d.ts +4 -5
  20. package/dist/elements/Table/DefaultCell/fields/index.d.ts.map +1 -1
  21. package/dist/elements/TableColumns/filterFields.d.ts.map +1 -1
  22. package/dist/elements/TableColumns/getInitialColumns.d.ts.map +1 -1
  23. package/dist/elements/WhereBuilder/validateWhereQuery.d.ts.map +1 -1
  24. package/dist/exports/client/{CodeEditor-LQX4VBTA.js → CodeEditor-UTZFZWZG.js} +14 -2
  25. package/dist/exports/client/{CodeEditor-LQX4VBTA.js.map → CodeEditor-UTZFZWZG.js.map} +2 -1
  26. package/dist/exports/client/DatePicker-CBQPW5J5.js +30 -0
  27. package/dist/exports/client/{DatePicker-AXHBRRH5.js.map → DatePicker-CBQPW5J5.js.map} +2 -1
  28. package/dist/exports/client/{chunk-S57FL4TE.js → chunk-5LKBKI4T.js} +13 -1
  29. package/dist/exports/client/{chunk-S57FL4TE.js.map → chunk-5LKBKI4T.js.map} +1 -0
  30. package/dist/exports/client/{chunk-3YOZFV77.js → chunk-DODCWLCH.js} +14 -2
  31. package/dist/exports/client/{chunk-3YOZFV77.js.map → chunk-DODCWLCH.js.map} +2 -1
  32. package/dist/exports/client/{chunk-TLG7P5PN.js → chunk-QJ5EJH4V.js} +13 -1
  33. package/dist/exports/client/{chunk-TLG7P5PN.js.map → chunk-QJ5EJH4V.js.map} +2 -1
  34. package/dist/exports/client/index.d.ts +31 -24
  35. package/dist/exports/client/index.d.ts.map +1 -1
  36. package/dist/exports/client/index.js +38 -18
  37. package/dist/exports/client/index.js.map +5 -4
  38. package/dist/exports/shared/index.d.ts +2 -1
  39. package/dist/exports/shared/index.d.ts.map +1 -1
  40. package/dist/exports/shared/index.js +2 -2
  41. package/dist/exports/shared/index.js.map +4 -4
  42. package/dist/fields/Array/index.d.ts +1 -2
  43. package/dist/fields/Array/index.d.ts.map +1 -1
  44. package/dist/fields/Array/index.js +2 -3
  45. package/dist/fields/Array/index.js.map +1 -1
  46. package/dist/fields/Blocks/index.d.ts +2 -3
  47. package/dist/fields/Blocks/index.d.ts.map +1 -1
  48. package/dist/fields/Blocks/index.js +5 -5
  49. package/dist/fields/Blocks/index.js.map +1 -1
  50. package/dist/fields/Checkbox/index.d.ts +1 -1
  51. package/dist/fields/Checkbox/index.d.ts.map +1 -1
  52. package/dist/fields/Checkbox/index.js +2 -2
  53. package/dist/fields/Checkbox/index.js.map +1 -1
  54. package/dist/fields/Code/index.d.ts +1 -1
  55. package/dist/fields/Code/index.d.ts.map +1 -1
  56. package/dist/fields/Code/index.js +2 -2
  57. package/dist/fields/Code/index.js.map +1 -1
  58. package/dist/fields/Collapsible/index.d.ts +1 -3
  59. package/dist/fields/Collapsible/index.d.ts.map +1 -1
  60. package/dist/fields/Collapsible/index.js +2 -2
  61. package/dist/fields/Collapsible/index.js.map +1 -1
  62. package/dist/fields/ConfirmPassword/index.d.ts +1 -1
  63. package/dist/fields/ConfirmPassword/index.d.ts.map +1 -1
  64. package/dist/fields/ConfirmPassword/index.js +1 -1
  65. package/dist/fields/ConfirmPassword/index.js.map +1 -1
  66. package/dist/fields/DateTime/index.d.ts +1 -1
  67. package/dist/fields/DateTime/index.d.ts.map +1 -1
  68. package/dist/fields/DateTime/index.js +2 -2
  69. package/dist/fields/DateTime/index.js.map +1 -1
  70. package/dist/fields/Email/index.d.ts +1 -1
  71. package/dist/fields/Email/index.d.ts.map +1 -1
  72. package/dist/fields/Email/index.js +2 -2
  73. package/dist/fields/Email/index.js.map +1 -1
  74. package/dist/fields/Group/index.d.ts +2 -3
  75. package/dist/fields/Group/index.d.ts.map +1 -1
  76. package/dist/fields/Group/index.js +2 -2
  77. package/dist/fields/Group/index.js.map +1 -1
  78. package/dist/fields/{HiddenInput → Hidden}/index.d.ts +1 -1
  79. package/dist/fields/Hidden/index.d.ts.map +1 -0
  80. package/dist/fields/{HiddenInput → Hidden}/index.js +2 -2
  81. package/dist/fields/Hidden/index.js.map +1 -0
  82. package/dist/fields/JSON/index.d.ts.map +1 -1
  83. package/dist/fields/JSON/index.js +2 -2
  84. package/dist/fields/JSON/index.js.map +1 -1
  85. package/dist/fields/Number/index.d.ts.map +1 -1
  86. package/dist/fields/Number/index.js +2 -2
  87. package/dist/fields/Number/index.js.map +1 -1
  88. package/dist/fields/Password/index.d.ts +1 -1
  89. package/dist/fields/Password/index.d.ts.map +1 -1
  90. package/dist/fields/Password/index.js +2 -2
  91. package/dist/fields/Password/index.js.map +1 -1
  92. package/dist/fields/Point/index.d.ts +2 -1
  93. package/dist/fields/Point/index.d.ts.map +1 -1
  94. package/dist/fields/Point/index.js +2 -2
  95. package/dist/fields/Point/index.js.map +1 -1
  96. package/dist/fields/RadioGroup/index.d.ts +1 -1
  97. package/dist/fields/RadioGroup/index.d.ts.map +1 -1
  98. package/dist/fields/RadioGroup/index.js +2 -2
  99. package/dist/fields/RadioGroup/index.js.map +1 -1
  100. package/dist/fields/Relationship/index.d.ts +1 -1
  101. package/dist/fields/Relationship/index.d.ts.map +1 -1
  102. package/dist/fields/Relationship/index.js +2 -2
  103. package/dist/fields/Relationship/index.js.map +1 -1
  104. package/dist/fields/RichText/index.d.ts +1 -1
  105. package/dist/fields/RichText/index.d.ts.map +1 -1
  106. package/dist/fields/RichText/index.js +1 -1
  107. package/dist/fields/RichText/index.js.map +1 -1
  108. package/dist/fields/Row/index.d.ts +2 -1
  109. package/dist/fields/Row/index.d.ts.map +1 -1
  110. package/dist/fields/Row/index.js +2 -2
  111. package/dist/fields/Row/index.js.map +1 -1
  112. package/dist/fields/Select/index.d.ts +1 -1
  113. package/dist/fields/Select/index.d.ts.map +1 -1
  114. package/dist/fields/Select/index.js +6 -4
  115. package/dist/fields/Select/index.js.map +1 -1
  116. package/dist/fields/Tabs/index.d.ts +1 -3
  117. package/dist/fields/Tabs/index.d.ts.map +1 -1
  118. package/dist/fields/Tabs/index.js +4 -4
  119. package/dist/fields/Tabs/index.js.map +1 -1
  120. package/dist/fields/Text/index.d.ts +1 -1
  121. package/dist/fields/Text/index.d.ts.map +1 -1
  122. package/dist/fields/Text/index.js +2 -2
  123. package/dist/fields/Text/index.js.map +1 -1
  124. package/dist/fields/Textarea/index.d.ts +1 -1
  125. package/dist/fields/Textarea/index.d.ts.map +1 -1
  126. package/dist/fields/Textarea/index.js +2 -2
  127. package/dist/fields/Textarea/index.js.map +1 -1
  128. package/dist/fields/UI/index.d.ts +1 -1
  129. package/dist/fields/UI/index.d.ts.map +1 -1
  130. package/dist/fields/UI/index.js +1 -1
  131. package/dist/fields/UI/index.js.map +1 -1
  132. package/dist/fields/Upload/index.d.ts +1 -1
  133. package/dist/fields/Upload/index.d.ts.map +1 -1
  134. package/dist/fields/Upload/index.js +1 -1
  135. package/dist/fields/Upload/index.js.map +1 -1
  136. package/dist/fields/index.js +48 -48
  137. package/dist/fields/index.js.map +1 -1
  138. package/dist/fields/shared/index.d.ts +0 -1
  139. package/dist/fields/shared/index.d.ts.map +1 -1
  140. package/dist/forms/Form/context.d.ts +0 -1
  141. package/dist/forms/Form/context.d.ts.map +1 -1
  142. package/dist/forms/Form/getDataByPath.d.ts.map +1 -1
  143. package/dist/forms/Form/getDataByPath.js +1 -2
  144. package/dist/forms/Form/getDataByPath.js.map +1 -1
  145. package/dist/forms/Form/getSiblingData.d.ts.map +1 -1
  146. package/dist/forms/Form/getSiblingData.js +2 -5
  147. package/dist/forms/Form/getSiblingData.js.map +1 -1
  148. package/dist/forms/NullifyField/index.js +2 -2
  149. package/dist/forms/NullifyField/index.js.map +1 -1
  150. package/dist/forms/RenderFields/RenderField.js +2 -2
  151. package/dist/forms/RenderFields/RenderField.js.map +1 -1
  152. package/dist/forms/RowLabel/Context/index.d.ts.map +1 -1
  153. package/dist/forms/WatchChildErrors/buildPathSegments.d.ts.map +1 -1
  154. package/dist/forms/buildStateFromSchema/addFieldStatePromise.d.ts.map +1 -1
  155. package/dist/forms/buildStateFromSchema/calculateDefaultValues/index.d.ts.map +1 -1
  156. package/dist/forms/buildStateFromSchema/calculateDefaultValues/iterateFields.d.ts.map +1 -1
  157. package/dist/forms/buildStateFromSchema/calculateDefaultValues/promise.d.ts.map +1 -1
  158. package/dist/forms/buildStateFromSchema/getFilterOptionsQuery.d.ts +1 -1
  159. package/dist/forms/buildStateFromSchema/getFilterOptionsQuery.d.ts.map +1 -1
  160. package/dist/forms/buildStateFromSchema/index.d.ts.map +1 -1
  161. package/dist/forms/buildStateFromSchema/iterateFields.d.ts.map +1 -1
  162. package/dist/forms/useField/index.d.ts.map +1 -1
  163. package/dist/forms/withCondition/index.d.ts.map +1 -1
  164. package/dist/hooks/useDelay.d.ts.map +1 -1
  165. package/dist/hooks/useIntersect.d.ts +0 -1
  166. package/dist/hooks/useIntersect.d.ts.map +1 -1
  167. package/dist/hooks/usePayloadAPI.d.ts +0 -1
  168. package/dist/hooks/usePayloadAPI.d.ts.map +1 -1
  169. package/dist/hooks/useThrottledEffect.d.ts +0 -1
  170. package/dist/hooks/useThrottledEffect.d.ts.map +1 -1
  171. package/dist/hooks/useUseAsTitle.d.ts.map +1 -1
  172. package/dist/providers/Auth/index.d.ts.map +1 -1
  173. package/dist/providers/ComponentMap/buildComponentMap/collections.d.ts +1 -1
  174. package/dist/providers/ComponentMap/buildComponentMap/collections.d.ts.map +1 -1
  175. package/dist/providers/ComponentMap/buildComponentMap/fields.d.ts.map +1 -1
  176. package/dist/providers/ComponentMap/buildComponentMap/fields.js +2 -2
  177. package/dist/providers/ComponentMap/buildComponentMap/fields.js.map +1 -1
  178. package/dist/providers/ComponentMap/buildComponentMap/globals.d.ts +1 -1
  179. package/dist/providers/ComponentMap/buildComponentMap/globals.d.ts.map +1 -1
  180. package/dist/providers/ComponentMap/buildComponentMap/index.d.ts +1 -1
  181. package/dist/providers/ComponentMap/buildComponentMap/index.d.ts.map +1 -1
  182. package/dist/providers/ComponentMap/buildComponentMap/types.d.ts +1 -2
  183. package/dist/providers/ComponentMap/buildComponentMap/types.d.ts.map +1 -1
  184. package/dist/providers/ComponentMap/buildComponentMap/types.js.map +1 -1
  185. package/dist/providers/FormQueryParams/index.d.ts.map +1 -1
  186. package/dist/providers/ScrollInfo/index.d.ts +0 -1
  187. package/dist/providers/ScrollInfo/index.d.ts.map +1 -1
  188. package/dist/providers/Translation/index.d.ts.map +1 -1
  189. package/dist/providers/WindowInfo/index.d.ts +0 -1
  190. package/dist/providers/WindowInfo/index.d.ts.map +1 -1
  191. package/dist/utilities/api.d.ts.map +1 -1
  192. package/dist/utilities/buildFieldSchemaMap/index.d.ts.map +1 -1
  193. package/dist/utilities/buildFormState.d.ts.map +1 -1
  194. package/dist/utilities/buildFormState.js.map +1 -1
  195. package/dist/utilities/flattenFieldMap.d.ts.map +1 -1
  196. package/dist/utilities/formatDocTitle.d.ts +1 -1
  197. package/dist/utilities/formatDocTitle.d.ts.map +1 -1
  198. package/dist/utilities/getFormState.d.ts +2 -2
  199. package/dist/utilities/getFormState.d.ts.map +1 -1
  200. package/dist/utilities/reduceFieldsToValues.d.ts.map +1 -1
  201. package/dist/utilities/reduceFieldsToValues.js +2 -5
  202. package/dist/utilities/reduceFieldsToValues.js.map +1 -1
  203. package/dist/utilities/reduceFieldsToValuesWithValidation.d.ts.map +1 -1
  204. package/dist/utilities/reduceFieldsToValuesWithValidation.js +2 -5
  205. package/dist/utilities/reduceFieldsToValuesWithValidation.js.map +1 -1
  206. package/dist/utilities/setsAreEqual.d.ts.map +1 -1
  207. package/dist/utilities/unflatten.d.ts +9 -0
  208. package/dist/utilities/unflatten.d.ts.map +1 -0
  209. package/dist/utilities/unflatten.js +58 -0
  210. package/dist/utilities/unflatten.js.map +1 -0
  211. package/package.json +46 -56
  212. package/dist/exports/client/DatePicker-AXHBRRH5.js +0 -18
  213. package/dist/fields/HiddenInput/index.d.ts.map +0 -1
  214. package/dist/fields/HiddenInput/index.js.map +0 -1
@@ -4,5 +4,5 @@ import type { CheckboxFieldProps } from './types.js';
4
4
  import { CheckboxInput } from './Input.js';
5
5
  import './index.scss';
6
6
  export { CheckboxFieldProps, CheckboxInput, type CheckboxInputProps };
7
- export declare const Checkbox: React.FC<CheckboxFieldProps>;
7
+ export declare const CheckboxField: React.FC<CheckboxFieldProps>;
8
8
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/fields/Checkbox/index.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAsB,MAAM,OAAO,CAAA;AAE1C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAA;AACpD,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,QAAQ,8BAA+B,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/fields/Checkbox/index.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAsB,MAAM,OAAO,CAAA;AAE1C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAA;AACpD,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,8BAAgC,CAAA"}
@@ -14,7 +14,7 @@ import { CheckboxInput } from './Input.js';
14
14
  import './index.scss';
15
15
  const baseClass = 'checkbox';
16
16
  export { CheckboxInput };
17
- const CheckboxField = (props)=>{
17
+ const _CheckboxField = (props)=>{
18
18
  const { 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 } = props;
19
19
  const { uuid } = useForm();
20
20
  const editDepth = useEditDepth();
@@ -89,6 +89,6 @@ const CheckboxField = (props)=>{
89
89
  ]
90
90
  });
91
91
  };
92
- export const Checkbox = withCondition(CheckboxField);
92
+ export const CheckboxField = withCondition(_CheckboxField);
93
93
 
94
94
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/fields/Checkbox/index.tsx"],"sourcesContent":["'use client'\nimport type { ClientValidate } from 'payload'\n\nimport React, { useCallback } from 'react'\n\nimport type { CheckboxInputProps } from './Input.js'\nimport type { CheckboxFieldProps } from './types.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 CheckboxField: 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 || {})} />\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 Checkbox = withCondition(CheckboxField)\n"],"names":["React","useCallback","useFieldProps","useForm","useField","withCondition","useEditDepth","generateFieldID","FieldDescription","FieldError","fieldBaseClass","CheckboxInput","baseClass","CheckboxField","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","inputRef","undefined","Checkbox"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;;AAGA,OAAOA,SAASC,WAAW,QAAQ,QAAO;AAK1C,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;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B,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;;0BACvE,KAAChB;gBACCM,YAAYA;gBACZC,aAAaA;gBACbG,aAAaA;gBACbC,SAASA;gBACTP,IAAIwC;gBACJI,UAAU;gBACV/B,OAAOA;gBACPC,YAAYA;gBACZb,MAAMiB;gBACNoB,UAAUA;gBACVrB,gBAAgBA;gBAChBG,UAAUiB;gBACVf,UAAUA;;YAEXlB,sBAAsByC,YACrBzC,kCAEA,KAACX;gBAAkB,GAAIiB,oBAAoB,CAAC,CAAC;;;;AAIrD;AAEA,OAAO,MAAMoC,WAAWxD,cAAcQ,eAAc"}
1
+ {"version":3,"sources":["../../../src/fields/Checkbox/index.tsx"],"sourcesContent":["'use client'\nimport type { ClientValidate } from 'payload'\n\nimport React, { useCallback } from 'react'\n\nimport type { CheckboxInputProps } from './Input.js'\nimport type { CheckboxFieldProps } from './types.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 _CheckboxField: 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 || {})} />\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(_CheckboxField)\n"],"names":["React","useCallback","useFieldProps","useForm","useField","withCondition","useEditDepth","generateFieldID","FieldDescription","FieldError","fieldBaseClass","CheckboxInput","baseClass","_CheckboxField","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","inputRef","undefined","CheckboxField"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;;AAGA,OAAOA,SAASC,WAAW,QAAQ,QAAO;AAK1C,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,iBAA+C,CAACC;IACpD,MAAM,EACJC,EAAE,EACFC,IAAI,EACJC,UAAU,EACVC,WAAW,EACXC,iBAAiB,EACjBC,WAAW,EACXC,WAAW,EACXC,SAASC,gBAAgB,EACzBC,SAAS,EACTC,gBAAgB,EAChB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K;YACRE;QACF;;0BAEA,KAAC/B;gBAAWW,aAAaA;gBAAaa,MAAMA;gBAAO,GAAIN,cAAc,CAAC,CAAC;;0BACvE,KAAChB;gBACCM,YAAYA;gBACZC,aAAaA;gBACbG,aAAaA;gBACbC,SAASA;gBACTP,IAAIwC;gBACJI,UAAU;gBACV/B,OAAOA;gBACPC,YAAYA;gBACZb,MAAMiB;gBACNoB,UAAUA;gBACVrB,gBAAgBA;gBAChBG,UAAUiB;gBACVf,UAAUA;;YAEXlB,sBAAsByC,YACrBzC,kCAEA,KAACX;gBAAkB,GAAIiB,oBAAoB,CAAC,CAAC;;;;AAIrD;AAEA,OAAO,MAAMoC,gBAAgBxD,cAAcQ,gBAAe"}
@@ -9,5 +9,5 @@ export type CodeFieldProps = FormFieldBase & {
9
9
  path?: string;
10
10
  width: string;
11
11
  };
12
- export declare const Code: React.FC<CodeFieldProps>;
12
+ export declare const CodeField: React.FC<CodeFieldProps>;
13
13
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/fields/Code/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,IAAI,aAAa,EAAE,MAAM,SAAS,CAAA;AAEzD,OAAO,KAAsB,MAAM,OAAO,CAAA;AAE1C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAUvD,OAAO,cAAc,CAAA;AAErB,MAAM,MAAM,cAAc,GAAG,aAAa,GAAG;IAC3C,aAAa,CAAC,EAAE,aAAa,CAAC,OAAO,CAAC,CAAC,eAAe,CAAC,CAAA;IACvD,QAAQ,CAAC,EAAE,aAAa,CAAC,OAAO,CAAC,CAAC,UAAU,CAAC,CAAA;IAC7C,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,MAAM,CAAA;CACd,CAAA;AAyFD,eAAO,MAAM,IAAI,0BAA2B,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/fields/Code/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,IAAI,aAAa,EAAE,MAAM,SAAS,CAAA;AAEzD,OAAO,KAAsB,MAAM,OAAO,CAAA;AAE1C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAUvD,OAAO,cAAc,CAAA;AAErB,MAAM,MAAM,cAAc,GAAG,aAAa,GAAG;IAC3C,aAAa,CAAC,EAAE,aAAa,CAAC,OAAO,CAAC,CAAC,eAAe,CAAC,CAAA;IACvD,QAAQ,CAAC,EAAE,aAAa,CAAC,OAAO,CAAC,CAAC,UAAU,CAAC,CAAA;IAC7C,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,MAAM,CAAA;CACd,CAAA;AAyFD,eAAO,MAAM,SAAS,0BAA4B,CAAA"}
@@ -15,7 +15,7 @@ const prismToMonacoLanguageMap = {
15
15
  ts: 'typescript'
16
16
  };
17
17
  const baseClass = 'code-field';
18
- const CodeField = (props)=>{
18
+ const _CodeField = (props)=>{
19
19
  const { name, AfterInput, BeforeInput, CustomDescription, CustomError, CustomLabel, className, descriptionProps, editorOptions = {}, errorProps, label, labelProps, language = 'javascript', path: pathFromProps, readOnly: readOnlyFromProps, required, style, validate, width } = props;
20
20
  const memoizedValidate = useCallback((value, options)=>{
21
21
  if (typeof validate === 'function') {
@@ -78,6 +78,6 @@ const CodeField = (props)=>{
78
78
  ]
79
79
  });
80
80
  };
81
- export const Code = withCondition(CodeField);
81
+ export const CodeField = withCondition(_CodeField);
82
82
 
83
83
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/fields/Code/index.tsx"],"sourcesContent":["/* eslint-disable react/destructuring-assignment */\n'use client'\nimport type { CodeField as CodeFieldType } from 'payload'\n\nimport React, { useCallback } from 'react'\n\nimport type { FormFieldBase } from '../shared/index.js'\n\nimport { CodeEditor } from '../../elements/CodeEditor/index.js'\nimport { useFieldProps } from '../../forms/FieldPropsProvider/index.js'\nimport { useField } from '../../forms/useField/index.js'\nimport { withCondition } from '../../forms/withCondition/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\nexport type CodeFieldProps = FormFieldBase & {\n editorOptions?: CodeFieldType['admin']['editorOptions']\n language?: CodeFieldType['admin']['language']\n name?: string\n path?: string\n width: string\n}\n\nconst prismToMonacoLanguageMap = {\n js: 'javascript',\n ts: 'typescript',\n}\n\nconst baseClass = 'code-field'\n\nconst CodeField: React.FC<CodeFieldProps> = (props) => {\n const {\n name,\n AfterInput,\n BeforeInput,\n CustomDescription,\n CustomError,\n CustomLabel,\n className,\n descriptionProps,\n editorOptions = {},\n errorProps,\n label,\n labelProps,\n language = 'javascript',\n path: pathFromProps,\n readOnly: readOnlyFromProps,\n required,\n style,\n validate,\n width,\n } = props\n\n const memoizedValidate = 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={[\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={prismToMonacoLanguageMap[language] || language}\n onChange={disabled ? () => null : (val) => setValue(val)}\n options={editorOptions}\n readOnly={disabled}\n value={(value as string) || ''}\n />\n {AfterInput}\n </div>\n {CustomDescription ? CustomDescription : <FieldDescription {...(descriptionProps || {})} />}\n </div>\n )\n}\n\nexport const Code = withCondition(CodeField)\n"],"names":["React","useCallback","CodeEditor","useFieldProps","useField","withCondition","FieldDescription","FieldError","FieldLabel","fieldBaseClass","prismToMonacoLanguageMap","js","ts","baseClass","CodeField","props","name","AfterInput","BeforeInput","CustomDescription","CustomError","CustomLabel","className","descriptionProps","editorOptions","errorProps","label","labelProps","language","path","pathFromProps","readOnly","readOnlyFromProps","required","style","validate","width","memoizedValidate","value","options","pathFromContext","readOnlyFromContext","formInitializing","formProcessing","setValue","showError","disabled","div","filter","Boolean","join","defaultLanguage","onChange","val","Code"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,iDAAiD,GACjD;;AAGA,OAAOA,SAASC,WAAW,QAAQ,QAAO;AAI1C,SAASC,UAAU,QAAQ,qCAAoC;AAC/D,SAASC,aAAa,QAAQ,0CAAyC;AACvE,SAASC,QAAQ,QAAQ,gCAA+B;AACxD,SAASC,aAAa,QAAQ,qCAAoC;AAClE,SAASC,gBAAgB,QAAQ,+BAA8B;AAC/D,SAASC,UAAU,QAAQ,yBAAwB;AACnD,SAASC,UAAU,QAAQ,yBAAwB;AACnD,SAASC,cAAc,QAAQ,qBAAoB;AACnD,OAAO,eAAc;AAUrB,MAAMC,2BAA2B;IAC/BC,IAAI;IACJC,IAAI;AACN;AAEA,MAAMC,YAAY;AAElB,MAAMC,YAAsC,CAACC;IAC3C,MAAM,EACJC,IAAI,EACJC,UAAU,EACVC,WAAW,EACXC,iBAAiB,EACjBC,WAAW,EACXC,WAAW,EACXC,SAAS,EACTC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AAACA,SAAoB;;oBAE7BrB;;;YAEFE,oBAAoBA,kCAAoB,KAACb;gBAAkB,GAAIiB,oBAAoB,CAAC,CAAC;;;;AAG5F;AAEA,OAAO,MAAM+B,OAAOjD,cAAcS,WAAU"}
1
+ {"version":3,"sources":["../../../src/fields/Code/index.tsx"],"sourcesContent":["/* eslint-disable react/destructuring-assignment */\n'use client'\nimport type { CodeField as CodeFieldType } from 'payload'\n\nimport React, { useCallback } from 'react'\n\nimport type { FormFieldBase } from '../shared/index.js'\n\nimport { CodeEditor } from '../../elements/CodeEditor/index.js'\nimport { useFieldProps } from '../../forms/FieldPropsProvider/index.js'\nimport { useField } from '../../forms/useField/index.js'\nimport { withCondition } from '../../forms/withCondition/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\nexport type CodeFieldProps = FormFieldBase & {\n editorOptions?: CodeFieldType['admin']['editorOptions']\n language?: CodeFieldType['admin']['language']\n name?: string\n path?: string\n width: string\n}\n\nconst prismToMonacoLanguageMap = {\n js: 'javascript',\n ts: 'typescript',\n}\n\nconst baseClass = 'code-field'\n\nconst _CodeField: React.FC<CodeFieldProps> = (props) => {\n const {\n name,\n AfterInput,\n BeforeInput,\n CustomDescription,\n CustomError,\n CustomLabel,\n className,\n descriptionProps,\n editorOptions = {},\n errorProps,\n label,\n labelProps,\n language = 'javascript',\n path: pathFromProps,\n readOnly: readOnlyFromProps,\n required,\n style,\n validate,\n width,\n } = props\n\n const memoizedValidate = 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={[\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={prismToMonacoLanguageMap[language] || language}\n onChange={disabled ? () => null : (val) => setValue(val)}\n options={editorOptions}\n readOnly={disabled}\n value={(value as string) || ''}\n />\n {AfterInput}\n </div>\n {CustomDescription ? CustomDescription : <FieldDescription {...(descriptionProps || {})} />}\n </div>\n )\n}\n\nexport const CodeField = withCondition(_CodeField)\n"],"names":["React","useCallback","CodeEditor","useFieldProps","useField","withCondition","FieldDescription","FieldError","FieldLabel","fieldBaseClass","prismToMonacoLanguageMap","js","ts","baseClass","_CodeField","props","name","AfterInput","BeforeInput","CustomDescription","CustomError","CustomLabel","className","descriptionProps","editorOptions","errorProps","label","labelProps","language","path","pathFromProps","readOnly","readOnlyFromProps","required","style","validate","width","memoizedValidate","value","options","pathFromContext","readOnlyFromContext","formInitializing","formProcessing","setValue","showError","disabled","div","filter","Boolean","join","defaultLanguage","onChange","val","CodeField"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,iDAAiD,GACjD;;AAGA,OAAOA,SAASC,WAAW,QAAQ,QAAO;AAI1C,SAASC,UAAU,QAAQ,qCAAoC;AAC/D,SAASC,aAAa,QAAQ,0CAAyC;AACvE,SAASC,QAAQ,QAAQ,gCAA+B;AACxD,SAASC,aAAa,QAAQ,qCAAoC;AAClE,SAASC,gBAAgB,QAAQ,+BAA8B;AAC/D,SAASC,UAAU,QAAQ,yB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oB;gBAAIzB,WAAW,CAAC,EAAEb,eAAe,MAAM,CAAC;;kCACvC,KAACF;wBAAWa,aAAaA;wBAAaS,MAAMA;wBAAO,GAAIJ,cAAc,CAAC,CAAC;;oBACtEP;kCACD,KAAChB;wBACCiD,iBAAiBzC,wBAAwB,CAACkB,SAAS,IAAIA;wBACvDwB,UAAUN,WAAW,IAAM,OAAO,CAACO,MAAQT,SAASS;wBACpDd,SAASf;wBACTO,UAAUe;wBACVR,OAAO,AAACA,SAAoB;;oBAE7BrB;;;YAEFE,oBAAoBA,kCAAoB,KAACb;gBAAkB,GAAIiB,oBAAoB,CAAC,CAAC;;;;AAG5F;AAEA,OAAO,MAAM+B,YAAYjD,cAAcS,YAAW"}
@@ -1,4 +1,3 @@
1
- import type { FieldPermissions } from 'payload';
2
1
  import React from 'react';
3
2
  import './index.scss';
4
3
  import type { FieldMap } from '../../providers/ComponentMap/buildComponentMap/types.js';
@@ -6,8 +5,7 @@ import type { FormFieldBase } from '../shared/index.js';
6
5
  export type CollapsibleFieldProps = FormFieldBase & {
7
6
  fieldMap: FieldMap;
8
7
  initCollapsed?: boolean;
9
- permissions: FieldPermissions;
10
8
  width?: string;
11
9
  };
12
- export declare const Collapsible: React.FC<CollapsibleFieldProps>;
10
+ export declare const CollapsibleField: React.FC<CollapsibleFieldProps>;
13
11
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/fields/Collapsible/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAuB,gBAAgB,EAAE,MAAM,SAAS,CAAA;AAEpE,OAAO,KAAqD,MAAM,OAAO,CAAA;AAazE,OAAO,cAAc,CAAA;AAIrB,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,yDAAyD,CAAA;AACvF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAKvD,MAAM,MAAM,qBAAqB,GAAG,aAAa,GAAG;IAClD,QAAQ,EAAE,QAAQ,CAAA;IAClB,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB,WAAW,EAAE,gBAAgB,CAAA;IAC7B,KAAK,CAAC,EAAE,MAAM,CAAA;CACf,CAAA;AAwID,eAAO,MAAM,WAAW,iCAAkC,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/fields/Collapsible/index.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAqD,MAAM,OAAO,CAAA;AAazE,OAAO,cAAc,CAAA;AAIrB,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,yDAAyD,CAAA;AACvF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAKvD,MAAM,MAAM,qBAAqB,GAAG,aAAa,GAAG;IAClD,QAAQ,EAAE,QAAQ,CAAA;IAClB,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB,KAAK,CAAC,EAAE,MAAM,CAAA;CACf,CAAA;AAwID,eAAO,MAAM,gBAAgB,iCAAmC,CAAA"}
@@ -16,7 +16,7 @@ import './index.scss';
16
16
  const baseClass = 'collapsible-field';
17
17
  import { useFormInitializing, useFormProcessing } from '../../forms/Form/context.js';
18
18
  import { FieldDescription } from '../FieldDescription/index.js';
19
- const CollapsibleField = (props)=>{
19
+ const _CollapsibleField = (props)=>{
20
20
  const { CustomDescription, CustomLabel, className, descriptionProps, fieldMap, initCollapsed = false, label, path: pathFromProps, readOnly: readOnlyFromProps } = props;
21
21
  const { indexPath, path: pathFromContext, readOnly: readOnlyFromContext, schemaPath, siblingPermissions } = useFieldProps();
22
22
  const formInitializing = useFormInitializing();
@@ -141,6 +141,6 @@ const CollapsibleField = (props)=>{
141
141
  ]
142
142
  });
143
143
  };
144
- export const Collapsible = withCondition(CollapsibleField);
144
+ export const CollapsibleField = withCondition(_CollapsibleField);
145
145
 
146
146
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/fields/Collapsible/index.tsx"],"sourcesContent":["'use client'\nimport type { DocumentPreferences, FieldPermissions } from 'payload'\n\nimport React, { Fragment, useCallback, useEffect, useState } from 'react'\n\nimport { Collapsible as CollapsibleElement } from '../../elements/Collapsible/index.js'\nimport { ErrorPill } from '../../elements/ErrorPill/index.js'\nimport { useFieldProps } from '../../forms/FieldPropsProvider/index.js'\nimport { RenderFields } from '../../forms/RenderFields/index.js'\nimport { RowLabel } from '../../forms/RowLabel/index.js'\nimport { WatchChildErrors } from '../../forms/WatchChildErrors/index.js'\nimport { withCondition } from '../../forms/withCondition/index.js'\nimport { useDocumentInfo } from '../../providers/DocumentInfo/index.js'\nimport { usePreferences } from '../../providers/Preferences/index.js'\nimport { useTranslation } from '../../providers/Translation/index.js'\nimport { fieldBaseClass } from '../shared/index.js'\nimport './index.scss'\n\nconst baseClass = 'collapsible-field'\n\nimport type { FieldMap } from '../../providers/ComponentMap/buildComponentMap/types.js'\nimport type { FormFieldBase } from '../shared/index.js'\n\nimport { useFormInitializing, useFormProcessing } from '../../forms/Form/context.js'\nimport { FieldDescription } from '../FieldDescription/index.js'\n\nexport type CollapsibleFieldProps = FormFieldBase & {\n fieldMap: FieldMap\n initCollapsed?: boolean\n permissions: FieldPermissions\n width?: string\n}\n\nconst CollapsibleField: React.FC<CollapsibleFieldProps> = (props) => {\n const {\n CustomDescription,\n CustomLabel,\n className,\n descriptionProps,\n fieldMap,\n initCollapsed = false,\n label,\n path: pathFromProps,\n readOnly: readOnlyFromProps,\n } = props\n\n const {\n indexPath,\n path: pathFromContext,\n readOnly: readOnlyFromContext,\n schemaPath,\n siblingPermissions,\n } = useFieldProps()\n\n const formInitializing = useFormInitializing()\n const formProcessing = useFormProcessing()\n\n const path = pathFromContext ?? pathFromProps\n\n const { i18n } = useTranslation()\n const { getPreference, setPreference } = usePreferences()\n const { preferencesKey } = useDocumentInfo()\n const [collapsedOnMount, setCollapsedOnMount] = useState<boolean>()\n const fieldPreferencesKey = `collapsible-${indexPath.replace(/\\./g, '__')}`\n const [errorCount, setErrorCount] = useState(0)\n const fieldHasErrors = errorCount > 0\n\n const onToggle = useCallback(\n async (newCollapsedState: boolean) => {\n const existingPreferences: DocumentPreferences = await getPreference(preferencesKey)\n\n if (preferencesKey) {\n void setPreference(preferencesKey, {\n ...existingPreferences,\n ...(path\n ? {\n fields: {\n ...(existingPreferences?.fields || {}),\n [path]: {\n ...existingPreferences?.fields?.[path],\n collapsed: newCollapsedState,\n },\n },\n }\n : {\n fields: {\n ...(existingPreferences?.fields || {}),\n [fieldPreferencesKey]: {\n ...existingPreferences?.fields?.[fieldPreferencesKey],\n collapsed: newCollapsedState,\n },\n },\n }),\n })\n }\n },\n [preferencesKey, fieldPreferencesKey, getPreference, setPreference, path],\n )\n\n useEffect(() => {\n const fetchInitialState = async () => {\n if (preferencesKey) {\n const preferences = await getPreference(preferencesKey)\n const specificPreference = path\n ? preferences?.fields?.[path]?.collapsed\n : preferences?.fields?.[fieldPreferencesKey]?.collapsed\n\n if (specificPreference !== undefined) {\n setCollapsedOnMount(Boolean(specificPreference))\n } else {\n setCollapsedOnMount(typeof initCollapsed === 'boolean' ? initCollapsed : false)\n }\n } else {\n setCollapsedOnMount(typeof initCollapsed === 'boolean' ? initCollapsed : false)\n }\n }\n\n void fetchInitialState()\n }, [getPreference, preferencesKey, fieldPreferencesKey, initCollapsed, path])\n\n if (typeof collapsedOnMount !== 'boolean') return null\n\n const disabled = readOnlyFromProps || readOnlyFromContext || formProcessing || formInitializing\n\n return (\n <Fragment>\n <WatchChildErrors fieldMap={fieldMap} path={path} setErrorCount={setErrorCount} />\n <div\n className={[\n fieldBaseClass,\n baseClass,\n className,\n fieldHasErrors ? `${baseClass}--has-error` : `${baseClass}--has-no-error`,\n ]\n .filter(Boolean)\n .join(' ')}\n id={`field-${fieldPreferencesKey}${path ? `-${path.replace(/\\./g, '__')}` : ''}`}\n >\n <CollapsibleElement\n className={`${baseClass}__collapsible`}\n collapsibleStyle={fieldHasErrors ? 'error' : 'default'}\n header={\n <div className={`${baseClass}__row-label-wrap`}>\n <RowLabel RowLabelComponent={CustomLabel} i18n={i18n} path={path} rowLabel={label} />\n {fieldHasErrors && <ErrorPill count={errorCount} i18n={i18n} withMessage />}\n </div>\n }\n initCollapsed={collapsedOnMount}\n onToggle={onToggle}\n >\n <RenderFields\n fieldMap={fieldMap}\n forceRender\n indexPath={indexPath}\n margins=\"small\"\n path={path}\n permissions={siblingPermissions}\n readOnly={disabled}\n schemaPath={schemaPath}\n />\n </CollapsibleElement>\n <FieldDescription CustomDescription={CustomDescription} {...(descriptionProps || {})} />\n </div>\n </Fragment>\n )\n}\n\nexport const Collapsible = withCondition(CollapsibleField)\n"],"names":["React","Fragment","useCallback","useEffect","useState","Collapsible","CollapsibleElement","ErrorPill","useFieldProps","RenderFields","RowLabel","WatchChildErrors","withCondition","useDocumentInfo","usePreferences","useTranslation","fieldBaseClass","baseClass","useFormInitializing","useFormProcessing","FieldDescription","CollapsibleField","props","CustomDescription","CustomLabel","className","descriptionProps","fieldMap","initCollapsed","label","path","pathFromProps","readOnly","readOnlyFromProps","indexPath","pathFromContext","readOnlyFromContext","schemaPath","siblingPermissions","formInitializing","formProcessing","i18n","getPreference","setPreference","preferencesKey","collapsedOnMount","setCollapsedOnMount","fieldPreferencesKey","replace","errorCount","setErrorCount","fieldHasErrors","onToggle","newCollapsedState","existingPreferences","fields","collapsed","fetchInitialState","preferences","specificPreference","undefined","Boolean","disabled","div","filter","join","id","collapsibleStyle","header","RowLabelComponent","rowLabel","count","withMessage","forceRender","margins","permissions"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;;AAGA,OAAOA,SAASC,QAAQ,EAAEC,WAAW,EAAEC,SAAS,EAAEC,QAAQ,QAAQ,QAAO;AAEzE,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E,MAACa;gBACCtC,WAAW;oBACTT;oBACAC;oBACAQ;oBACA0B,iBAAiB,CAAC,EAAElC,UAAU,WAAW,CAAC,GAAG,CAAC,EAAEA,UAAU,cAAc,CAAC;iBAC1E,CACE+C,MAAM,CAACH,SACPI,IAAI,CAAC;gBACRC,IAAI,CAAC,MAAM,EAAEnB,oBAAoB,EAAEjB,OAAO,CAAC,CAAC,EAAEA,KAAKkB,OAAO,CAAC,OAAO,MAAM,CAAC,GAAG,GAAG,CAAC;;kCAEhF,KAAC1C;wBACCmB,WAAW,CAAC,EAAER,UAAU,aAAa,CAAC;wBACtCkD,kBAAkBhB,iBAAiB,UAAU;wBAC7CiB,sBACE,MAACL;4BAAItC,WAAW,CAAC,EAAER,UAAU,gBAAgB,CAAC;;8CAC5C,KAACP;oCAAS2D,mBAAmB7C;oCAAaiB,MAAMA;oCAAMX,MAAMA;oCAAMwC,UAAUzC;;gCAC3EsB,gCAAkB,KAAC5C;oCAAUgE,OAAOtB;oCAAYR,MAAMA;oCAAM+B,WAAW;;;;wBAG5E5C,eAAeiB;wBACfO,UAAUA;kCAEV,cAAA,KAAC3C;4BACCkB,UAAUA;4BACV8C,WAAW;4BACXvC,WAAWA;4BACXwC,SAAQ;4BACR5C,MAAMA;4BACN6C,aAAarC;4BACbN,UAAU8B;4BACVzB,YAAYA;;;kCAGhB,KAACjB;wBAAiBG,mBAAmBA;wBAAoB,GAAIG,oBAAoB,CAAC,CAAC;;;;;;AAI3F;AAEA,OAAO,MAAMrB,cAAcO,cAAcS,kBAAiB"}
1
+ {"version":3,"sources":["../../../src/fields/Collapsible/index.tsx"],"sourcesContent":["'use client'\nimport type { DocumentPreferences, FieldPermissions } from 'payload'\n\nimport React, { Fragment, useCallback, useEffect, useState } from 'react'\n\nimport { Collapsible as CollapsibleElement } from '../../elements/Collapsible/index.js'\nimport { ErrorPill } from '../../elements/ErrorPill/index.js'\nimport { useFieldProps } from '../../forms/FieldPropsProvider/index.js'\nimport { RenderFields } from '../../forms/RenderFields/index.js'\nimport { RowLabel } from '../../forms/RowLabel/index.js'\nimport { WatchChildErrors } from '../../forms/WatchChildErrors/index.js'\nimport { withCondition } from '../../forms/withCondition/index.js'\nimport { useDocumentInfo } from '../../providers/DocumentInfo/index.js'\nimport { usePreferences } from '../../providers/Preferences/index.js'\nimport { useTranslation } from '../../providers/Translation/index.js'\nimport { fieldBaseClass } from '../shared/index.js'\nimport './index.scss'\n\nconst baseClass = 'collapsible-field'\n\nimport type { FieldMap } from '../../providers/ComponentMap/buildComponentMap/types.js'\nimport type { FormFieldBase } from '../shared/index.js'\n\nimport { useFormInitializing, useFormProcessing } from '../../forms/Form/context.js'\nimport { FieldDescription } from '../FieldDescription/index.js'\n\nexport type CollapsibleFieldProps = FormFieldBase & {\n fieldMap: FieldMap\n initCollapsed?: boolean\n width?: string\n}\n\nconst _CollapsibleField: React.FC<CollapsibleFieldProps> = (props) => {\n const {\n CustomDescription,\n CustomLabel,\n className,\n descriptionProps,\n fieldMap,\n initCollapsed = false,\n label,\n path: pathFromProps,\n readOnly: readOnlyFromProps,\n } = props\n\n const {\n indexPath,\n path: pathFromContext,\n readOnly: readOnlyFromContext,\n schemaPath,\n siblingPermissions,\n } = useFieldProps()\n\n const formInitializing = useFormInitializing()\n const formProcessing = useFormProcessing()\n\n const path = pathFromContext ?? pathFromProps\n\n const { i18n } = useTranslation()\n const { getPreference, setPreference } = usePreferences()\n const { preferencesKey } = useDocumentInfo()\n const [collapsedOnMount, setCollapsedOnMount] = useState<boolean>()\n const fieldPreferencesKey = `collapsible-${indexPath.replace(/\\./g, '__')}`\n const [errorCount, setErrorCount] = useState(0)\n const fieldHasErrors = errorCount > 0\n\n const onToggle = useCallback(\n async (newCollapsedState: boolean) => {\n const existingPreferences: DocumentPreferences = await getPreference(preferencesKey)\n\n if (preferencesKey) {\n void setPreference(preferencesKey, {\n ...existingPreferences,\n ...(path\n ? {\n fields: {\n ...(existingPreferences?.fields || {}),\n [path]: {\n ...existingPreferences?.fields?.[path],\n collapsed: newCollapsedState,\n },\n },\n }\n : {\n fields: {\n ...(existingPreferences?.fields || {}),\n [fieldPreferencesKey]: {\n ...existingPreferences?.fields?.[fieldPreferencesKey],\n collapsed: newCollapsedState,\n },\n },\n }),\n })\n }\n },\n [preferencesKey, fieldPreferencesKey, getPreference, setPreference, path],\n )\n\n useEffect(() => {\n const fetchInitialState = async () => {\n if (preferencesKey) {\n const preferences = await getPreference(preferencesKey)\n const specificPreference = path\n ? preferences?.fields?.[path]?.collapsed\n : preferences?.fields?.[fieldPreferencesKey]?.collapsed\n\n if (specificPreference !== undefined) {\n setCollapsedOnMount(Boolean(specificPreference))\n } else {\n setCollapsedOnMount(typeof initCollapsed === 'boolean' ? initCollapsed : false)\n }\n } else {\n setCollapsedOnMount(typeof initCollapsed === 'boolean' ? initCollapsed : false)\n }\n }\n\n void fetchInitialState()\n }, [getPreference, preferencesKey, fieldPreferencesKey, initCollapsed, path])\n\n if (typeof collapsedOnMount !== 'boolean') return null\n\n const disabled = readOnlyFromProps || readOnlyFromContext || formProcessing || formInitializing\n\n return (\n <Fragment>\n <WatchChildErrors fieldMap={fieldMap} path={path} setErrorCount={setErrorCount} />\n <div\n className={[\n fieldBaseClass,\n baseClass,\n className,\n fieldHasErrors ? `${baseClass}--has-error` : `${baseClass}--has-no-error`,\n ]\n .filter(Boolean)\n .join(' ')}\n id={`field-${fieldPreferencesKey}${path ? `-${path.replace(/\\./g, '__')}` : ''}`}\n >\n <CollapsibleElement\n className={`${baseClass}__collapsible`}\n collapsibleStyle={fieldHasErrors ? 'error' : 'default'}\n header={\n <div className={`${baseClass}__row-label-wrap`}>\n <RowLabel RowLabelComponent={CustomLabel} i18n={i18n} path={path} rowLabel={label} />\n {fieldHasErrors && <ErrorPill count={errorCount} i18n={i18n} withMessage />}\n </div>\n }\n initCollapsed={collapsedOnMount}\n onToggle={onToggle}\n >\n <RenderFields\n fieldMap={fieldMap}\n forceRender\n indexPath={indexPath}\n margins=\"small\"\n path={path}\n permissions={siblingPermissions}\n readOnly={disabled}\n schemaPath={schemaPath}\n />\n </CollapsibleElement>\n <FieldDescription CustomDescription={CustomDescription} {...(descriptionProps || {})} />\n </div>\n </Fragment>\n )\n}\n\nexport const CollapsibleField = withCondition(_CollapsibleField)\n"],"names":["React","Fragment","useCallback","useEffect","useState","Collapsible","CollapsibleElement","ErrorPill","useFieldProps","RenderFields","RowLabel","WatchChildErrors","withCondition","useDocumentInfo","usePreferences","useTranslation","fieldBaseClass","baseClass","useFormInitializing","useFormProcessing","FieldDescription","_CollapsibleField","props","CustomDescription","CustomLabel","className","descriptionProps","fieldMap","initCollapsed","label","path","pathFromProps","readOnly","readOnlyFromProps","indexPath","pathFromContext","readOnlyFromContext","schemaPath","siblingPermissions","formInitializing","formProcessing","i18n","getPreference","setPreference","preferencesKey","collapsedOnMount","setCollapsedOnMount","fieldPreferencesKey","replace","errorCount","setErrorCount","fieldHasErrors","onToggle","newCollapsedState","existingPreferences","fields","collapsed","fetchInitialState","preferences","specificPreference","undefined","Boolean","disabled","div","filter","join","id","collapsibleStyle","header","RowLabelComponent","rowLabel","count","withMessage","forceRender","margins","permissions","CollapsibleField"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;;AAGA,OAAOA,SAASC,QAAQ,EAAEC,WAAW,EAAEC,SAAS,EAAEC,QAAQ,QAAQ,QAAO;AAEzE,SAASC,eAAeC,kBAAkB,QAAQ,sCAAqC;AACvF,SAASC,SAAS,QAAQ,oCAAmC;AAC7D,SAASC,aAAa,QAAQ,0CAAyC;AACvE,SAASC,YAAY,QAAQ,oCAAmC;AAChE,SAASC,QAAQ,QAAQ,gCAA+B;AACxD,SAASC,gBAAgB,QAAQ,wCAAuC;AACxE,SAASC,aAAa,QA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AAO,CAAC,CAAC,EAAEA,KAAKkB,OAAO,CAAC,OAAO,MAAM,CAAC,GAAG,GAAG,CAAC;;kCAEhF,KAAC1C;wBACCmB,WAAW,CAAC,EAAER,UAAU,aAAa,CAAC;wBACtCkD,kBAAkBhB,iBAAiB,UAAU;wBAC7CiB,sBACE,MAACL;4BAAItC,WAAW,CAAC,EAAER,UAAU,gBAAgB,CAAC;;8CAC5C,KAACP;oCAAS2D,mBAAmB7C;oCAAaiB,MAAMA;oCAAMX,MAAMA;oCAAMwC,UAAUzC;;gCAC3EsB,gCAAkB,KAAC5C;oCAAUgE,OAAOtB;oCAAYR,MAAMA;oCAAM+B,WAAW;;;;wBAG5E5C,eAAeiB;wBACfO,UAAUA;kCAEV,cAAA,KAAC3C;4BACCkB,UAAUA;4BACV8C,WAAW;4BACXvC,WAAWA;4BACXwC,SAAQ;4BACR5C,MAAMA;4BACN6C,aAAarC;4BACbN,UAAU8B;4BACVzB,YAAYA;;;kCAGhB,KAACjB;wBAAiBG,mBAAmBA;wBAAoB,GAAIG,oBAAoB,CAAC,CAAC;;;;;;AAI3F;AAEA,OAAO,MAAMkD,mBAAmBhE,cAAcS,mBAAkB"}
@@ -3,5 +3,5 @@ import './index.scss';
3
3
  export type ConfirmPasswordFieldProps = {
4
4
  disabled?: boolean;
5
5
  };
6
- export declare const ConfirmPassword: React.FC<ConfirmPasswordFieldProps>;
6
+ export declare const ConfirmPasswordField: React.FC<ConfirmPasswordFieldProps>;
7
7
  //# sourceMappingURL=index.d.ts.map
@@ -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;CACnB,CAAA;AAED,eAAO,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,yBAAyB,CAsD/D,CAAA"}
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;CACnB,CAAA;AAED,eAAO,MAAM,oBAAoB,EAAE,KAAK,CAAC,EAAE,CAAC,yBAAyB,CAsDpE,CAAA"}
@@ -8,7 +8,7 @@ import { FieldError } from '../FieldError/index.js';
8
8
  import { FieldLabel } from '../FieldLabel/index.js';
9
9
  import { fieldBaseClass } from '../shared/index.js';
10
10
  import './index.scss';
11
- export const ConfirmPassword = (props)=>{
11
+ export const ConfirmPasswordField = (props)=>{
12
12
  const { disabled } = props;
13
13
  const password = useFormFields(([fields])=>fields?.password);
14
14
  const { t } = useTranslation();
@@ -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}\n\nexport const ConfirmPassword: React.FC<ConfirmPasswordFieldProps> = (props) => {\n const { disabled } = 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 path = 'confirm-password'\n\n const { setValue, showError, value } = useField({\n disableFormData: true,\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 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","ConfirmPassword","props","disabled","password","fields","t","validate","value","path","setValue","showError","disableFormData","div","className","filter","Boolean","join","htmlFor","label","required","input","autoComplete","id","name","onChange","type"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","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;AAMrB,OAAO,MAAMC,kBAAuD,CAACC;IACnE,MAAM,EAAEC,QAAQ,EAAE,GAAGD;IAErB,MAAME,WAAWT,cAAyB,CAAC,CAACU,OAAO,GAAKA,QAAQD;IAChE,MAAM,EAAEE,CAAC,EAAE,GAAGT;IAEd,MAAMU,WAAWb,YACf,CAACc;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,MAAMG,OAAO;IAEb,MAAM,EAAEC,QAAQ,EAAEC,SAAS,EAAEH,KAAK,EAAE,GAAGZ,SAAS;QAC9CgB,iBAAiB;QACjBH;QACAF;IACF;IAEA,qBACE,MAACM;QACCC,WAAW;YAACd;YAAgB;YAAoBW,aAAa;SAAQ,CAClEI,MAAM,CAACC,SACPC,IAAI,CAAC;;0BAER,KAAClB;gBACCmB,SAAQ;gBACRC,OAAOb,EAAE;gBACTc,QAAQ;;0BAEV,MAACP;gBAAIC,WAAW,CAAC,EAAEd,eAAe,MAAM,CAAC;;kCACvC,KAACF;wBAAWW,MAAMA;;kCAClB,KAACY;wBACCC,cAAa;wBACbnB,UAAU,CAAC,CAACA;wBACZoB,IAAG;wBACHC,MAAK;wBACLC,UAAUf;wBACVgB,MAAK;wBACLlB,OAAO,AAACA,SAAoB;;;;;;AAKtC,EAAC"}
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}\n\nexport const ConfirmPasswordField: React.FC<ConfirmPasswordFieldProps> = (props) => {\n const { disabled } = 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 path = 'confirm-password'\n\n const { setValue, showError, value } = useField({\n disableFormData: true,\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 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","password","fields","t","validate","value","path","setValue","showError","disableFormData","div","className","filter","Boolean","join","htmlFor","label","required","input","autoComplete","id","name","onChange","type"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","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;AAMrB,OAAO,MAAMC,uBAA4D,CAACC;IACxE,MAAM,EAAEC,QAAQ,EAAE,GAAGD;IAErB,MAAME,WAAWT,cAAyB,CAAC,CAACU,OAAO,GAAKA,QAAQD;IAChE,MAAM,EAAEE,CAAC,EAAE,GAAGT;IAEd,MAAMU,WAAWb,YACf,CAACc;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,MAAMG,OAAO;IAEb,MAAM,EAAEC,QAAQ,EAAEC,SAAS,EAAEH,KAAK,EAAE,GAAGZ,SAAS;QAC9CgB,iBAAiB;QACjBH;QACAF;IACF;IAEA,qBACE,MAACM;QACCC,WAAW;YAACd;YAAgB;YAAoBW,aAAa;SAAQ,CAClEI,MAAM,CAACC,SACPC,IAAI,CAAC;;0BAER,KAAClB;gBACCmB,SAAQ;gBACRC,OAAOb,EAAE;gBACTc,QAAQ;;0BAEV,MAACP;gBAAIC,WAAW,CAAC,EAAEd,eAAe,MAAM,CAAC;;kCACvC,KAACF;wBAAWW,MAAMA;;kCAClB,KAACY;wBACCC,cAAa;wBACbnB,UAAU,CAAC,CAACA;wBACZoB,IAAG;wBACHC,MAAK;wBACLC,UAAUf;wBACVgB,MAAK;wBACLlB,OAAO,AAACA,SAAoB;;;;;;AAKtC,EAAC"}
@@ -9,5 +9,5 @@ export type DateFieldProps = FormFieldBase & {
9
9
  placeholder?: DateField['admin']['placeholder'] | string;
10
10
  width?: string;
11
11
  };
12
- export declare const DateTime: React.FC<DateFieldProps>;
12
+ export declare const DateTimeField: React.FC<DateFieldProps>;
13
13
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/fields/DateTime/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAkB,SAAS,EAAE,MAAM,SAAS,CAAA;AAGxD,OAAO,KAAsB,MAAM,OAAO,CAAA;AAO1C,OAAO,cAAc,CAAA;AAIrB,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAOvD,MAAM,MAAM,cAAc,GAAG,aAAa,GAAG;IAC3C,IAAI,CAAC,EAAE,SAAS,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,CAAA;IACjC,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,WAAW,CAAC,EAAE,SAAS,CAAC,OAAO,CAAC,CAAC,aAAa,CAAC,GAAG,MAAM,CAAA;IACxD,KAAK,CAAC,EAAE,MAAM,CAAA;CACf,CAAA;AA0FD,eAAO,MAAM,QAAQ,0BAA+B,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/fields/DateTime/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAkB,SAAS,EAAE,MAAM,SAAS,CAAA;AAGxD,OAAO,KAAsB,MAAM,OAAO,CAAA;AAO1C,OAAO,cAAc,CAAA;AAIrB,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAOvD,MAAM,MAAM,cAAc,GAAG,aAAa,GAAG;IAC3C,IAAI,CAAC,EAAE,SAAS,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,CAAA;IACjC,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,WAAW,CAAC,EAAE,SAAS,CAAC,OAAO,CAAC,CAAC,aAAa,CAAC,GAAG,MAAM,CAAA;IACxD,KAAK,CAAC,EAAE,MAAM,CAAA;CACf,CAAA;AA0FD,eAAO,MAAM,aAAa,0BAAgC,CAAA"}
@@ -13,7 +13,7 @@ import { useFieldProps } from '../../forms/FieldPropsProvider/index.js';
13
13
  import { withCondition } from '../../forms/withCondition/index.js';
14
14
  import { FieldDescription } from '../FieldDescription/index.js';
15
15
  import { FieldError } from '../FieldError/index.js';
16
- const DateTimeField = (props)=>{
16
+ const _DateTimeField = (props)=>{
17
17
  const { name, AfterInput, BeforeInput, CustomDescription, CustomError, CustomLabel, className, date: datePickerProps, descriptionProps, errorProps, label, labelProps, path: pathFromProps, placeholder, readOnly: readOnlyFromProps, required, style, validate, width } = props;
18
18
  const { i18n } = useTranslation();
19
19
  const memoizedValidate = useCallback((value, options)=>{
@@ -80,6 +80,6 @@ const DateTimeField = (props)=>{
80
80
  ]
81
81
  });
82
82
  };
83
- export const DateTime = withCondition(DateTimeField);
83
+ export const DateTimeField = withCondition(_DateTimeField);
84
84
 
85
85
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/fields/DateTime/index.tsx"],"sourcesContent":["/* eslint-disable react/destructuring-assignment */\n'use client'\nimport type { ClientValidate, DateField } 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 type { FormFieldBase } from '../shared/index.js'\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\nexport type DateFieldProps = FormFieldBase & {\n date?: DateField['admin']['date']\n name?: string\n path?: string\n placeholder?: DateField['admin']['placeholder'] | string\n width?: string\n}\n\nconst DateTimeField: 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 DateTime = withCondition(DateTimeField)\n"],"names":["getTranslation","React","useCallback","DatePickerField","useField","useTranslation","FieldLabel","fieldBaseClass","baseClass","useFieldProps","withCondition","FieldDescription","FieldError","DateTimeField","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","DateTime"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,iDAAiD,GACjD;;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;AAIlB,SAASC,aAAa,QAAQ,0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C;;0BAEvB,MAACqB;gBAAI3B,WAAW,CAAC,EAAEd,eAAe,MAAM,CAAC;gBAAE6C,IAAI,CAAC,MAAM,EAAExB,KAAKyB,OAAO,CAAC,OAAO,MAAM,CAAC;;kCACjF,KAACzC;wBAAWO,aAAaA;wBAAaS,MAAMA;wBAAO,GAAIH,cAAc,CAAC,CAAC;;oBACtER;kCACD,KAACd;wBACE,GAAGoB,eAAe;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,WAAWhD,cAAcG,eAAc"}
1
+ {"version":3,"sources":["../../../src/fields/DateTime/index.tsx"],"sourcesContent":["/* eslint-disable react/destructuring-assignment */\n'use client'\nimport type { ClientValidate, DateField } 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 type { FormFieldBase } from '../shared/index.js'\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\nexport type DateFieldProps = FormFieldBase & {\n date?: DateField['admin']['date']\n name?: string\n path?: string\n placeholder?: DateField['admin']['placeholder'] | string\n width?: string\n}\n\nconst _DateTimeField: 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(_DateTimeField)\n"],"names":["getTranslation","React","useCallback","DatePickerField","useField","useTranslation","FieldLabel","fieldBaseClass","baseClass","useFieldProps","withCondition","FieldDescription","FieldError","_DateTimeField","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"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,iDAAiD,GACjD;;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;AAIlB,SAASC,aAAa,QAAQ,0CAAyC;AACvE,SAASC,aAAa,QAAQ,qCAAoC;AAClE,SAASC,gBAAgB,QAAQ,+BAA8B;AAC/D,SAASC,UAAU,QAAQ,yBAAwB;AAUnD,MAAMC,iBAA2C,CAACC;IAChD,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,OAAO;gBAAEP;YAAS;QAChD;IACF,GACA;QAACE;QAAUF;KAAS;IAGtB,MAAM,EAAEL,MAAMa,eAAe,EAAEV,UAAUW,mBAAmB,EAAE,GAAGjC;IAEjE,MAAM,EAAEkC,gBAAgB,EAAEC,cAAc,EAAEhB,IAAI,EAAEiB,QAAQ,EAAEC,SAAS,EAAEP,KAAK,EAAE,GAAGnC,SAAe;QAC5FwB,MAAMa,mBAAmBZ,iBAAiBd;QAC1CoB,UAAUG;IACZ;IAEA,MAAMS,WAAWf,qBAAqBU,uBAAuBE,kBAAkBD;IAE/E,qBACE,MAACK;QACC3B,WAAW;YACTd;YACAC;YACAa;YACAyB,aAAa,CAAC,EAAEtC,UAAU,WAAW,CAAC;YACtCuC,YAAY;SACb,CACEE,MAAM,CAACC,SACPC,IAAI,CAAC;QACRjB,OAAO;YACL,GAAGA,KAAK;YACRE;QACF;;0BAEA,KAAC9B;gBACCc,aAAaA;gBACbM,OAAOA;gBACPO,UAAUA;gBACT,GAAIN,cAAc,CAAC,CAAC;;0BAEvB,MAACqB;gBAAI3B,WAAW,CAAC,EAAEd,eAAe,MAAM,CAAC;gBAAE6C,IAAI,CAAC,MAAM,EAAExB,KAAKyB,OAAO,CAAC,OAAO,MAAM,CAAC;;kCACjF,KAACzC;wBAAWO,aAAaA;wBAAaS,MAAMA;wBAAO,GAAIH,cAAc,CAAC,CAAC;;oBACtER;kCACD,KAACd;wBACE,GAAGoB,eAAe;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,gBAAe"}
@@ -9,5 +9,5 @@ export type EmailFieldProps = FormFieldBase & {
9
9
  placeholder?: EmailFieldType['admin']['placeholder'];
10
10
  width?: string;
11
11
  };
12
- export declare const Email: React.FC<EmailFieldProps>;
12
+ export declare const EmailField: React.FC<EmailFieldProps>;
13
13
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/fields/Email/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAkB,UAAU,IAAI,cAAc,EAAE,MAAM,SAAS,CAAA;AAG3E,OAAO,KAAsB,MAAM,OAAO,CAAA;AAE1C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAUvD,OAAO,cAAc,CAAA;AAErB,MAAM,MAAM,eAAe,GAAG,aAAa,GAAG;IAC5C,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,WAAW,CAAC,EAAE,cAAc,CAAC,OAAO,CAAC,CAAC,aAAa,CAAC,CAAA;IACpD,KAAK,CAAC,EAAE,MAAM,CAAA;CACf,CAAA;AAqFD,eAAO,MAAM,KAAK,2BAA4B,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/fields/Email/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAkB,UAAU,IAAI,cAAc,EAAE,MAAM,SAAS,CAAA;AAG3E,OAAO,KAAsB,MAAM,OAAO,CAAA;AAE1C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAUvD,OAAO,cAAc,CAAA;AAErB,MAAM,MAAM,eAAe,GAAG,aAAa,GAAG;IAC5C,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,WAAW,CAAC,EAAE,cAAc,CAAC,OAAO,CAAC,CAAC,aAAa,CAAC,CAAA;IACpD,KAAK,CAAC,EAAE,MAAM,CAAA;CACf,CAAA;AAqFD,eAAO,MAAM,UAAU,2BAA6B,CAAA"}
@@ -11,7 +11,7 @@ import { FieldError } from '../FieldError/index.js';
11
11
  import { FieldLabel } from '../FieldLabel/index.js';
12
12
  import { fieldBaseClass } from '../shared/index.js';
13
13
  import './index.scss';
14
- const EmailField = (props)=>{
14
+ const _EmailField = (props)=>{
15
15
  const { name, AfterInput, BeforeInput, CustomDescription, CustomError, CustomLabel, autoComplete, className, descriptionProps, errorProps, label, labelProps, path: pathFromProps, placeholder, readOnly: readOnlyFromProps, required, style, validate, width } = props;
16
16
  const { i18n } = useTranslation();
17
17
  const memoizedValidate = useCallback((value, options)=>{
@@ -78,6 +78,6 @@ const EmailField = (props)=>{
78
78
  ]
79
79
  });
80
80
  };
81
- export const Email = withCondition(EmailField);
81
+ export const EmailField = withCondition(_EmailField);
82
82
 
83
83
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/fields/Email/index.tsx"],"sourcesContent":["'use client'\nimport type { ClientValidate, EmailField as EmailFieldType } from 'payload'\n\nimport { getTranslation } from '@payloadcms/translations'\nimport React, { useCallback } from 'react'\n\nimport type { FormFieldBase } from '../shared/index.js'\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\nexport type EmailFieldProps = FormFieldBase & {\n autoComplete?: string\n name?: string\n path?: string\n placeholder?: EmailFieldType['admin']['placeholder']\n width?: string\n}\n\nconst EmailField: 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 Email = withCondition(EmailField)\n"],"names":["getTranslation","React","useCallback","useFieldProps","useField","withCondition","useTranslation","FieldDescription","FieldError","FieldLabel","fieldBaseClass","EmailField","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","Email"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;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AMS,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,QAAQlD,cAAcM,YAAW"}
1
+ {"version":3,"sources":["../../../src/fields/Email/index.tsx"],"sourcesContent":["'use client'\nimport type { ClientValidate, EmailField as EmailFieldType } from 'payload'\n\nimport { getTranslation } from '@payloadcms/translations'\nimport React, { useCallback } from 'react'\n\nimport type { FormFieldBase } from '../shared/index.js'\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\nexport type EmailFieldProps = FormFieldBase & {\n autoComplete?: string\n name?: string\n path?: string\n placeholder?: EmailFieldType['admin']['placeholder']\n width?: string\n}\n\nconst _EmailField: 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(_EmailField)\n"],"names":["getTranslation","React","useCallback","useFieldProps","useField","withCondition","useTranslation","FieldDescription","FieldError","FieldLabel","fieldBaseClass","_EmailField","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"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;;AAGA,SAASA,cAAc,QAAQ,2BAA0B;AACzD,OAAOC,SAASC,WAAW,QAAQ,QAAO;AAI1C,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;AAUrB,MAAMC,cAAyC,CAACC;IAC9C,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,aAAY"}
@@ -1,4 +1,3 @@
1
- import type { FieldPermissions } from 'payload';
2
1
  import React from 'react';
3
2
  import type { FieldMap } from '../../providers/ComponentMap/buildComponentMap/types.js';
4
3
  import type { FormFieldBase } from '../shared/index.js';
@@ -9,9 +8,9 @@ export type GroupFieldProps = FormFieldBase & {
9
8
  forceRender?: boolean;
10
9
  hideGutter?: boolean;
11
10
  name?: string;
12
- permissions: FieldPermissions;
13
11
  width?: string;
14
12
  };
13
+ export declare const _GroupField: React.FC<GroupFieldProps>;
15
14
  export { GroupProvider, useGroup };
16
- export declare const Group: React.FC<GroupFieldProps>;
15
+ export declare const GroupField: React.FC<GroupFieldProps>;
17
16
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/fields/Group/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAA;AAG/C,OAAO,KAAmB,MAAM,OAAO,CAAA;AAEvC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,yDAAyD,CAAA;AACvF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAkBvD,OAAO,cAAc,CAAA;AACrB,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AAIvD,MAAM,MAAM,eAAe,GAAG,aAAa,GAAG;IAC5C,QAAQ,EAAE,QAAQ,CAAA;IAClB,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,WAAW,EAAE,gBAAgB,CAAA;IAC7B,KAAK,CAAC,EAAE,MAAM,CAAA;CACf,CAAA;AAyFD,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,CAAA;AAElC,eAAO,MAAM,KAAK,2BAA4B,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/fields/Group/index.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAmB,MAAM,OAAO,CAAA;AAEvC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,yDAAyD,CAAA;AACvF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAkBvD,OAAO,cAAc,CAAA;AACrB,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AAIvD,MAAM,MAAM,eAAe,GAAG,aAAa,GAAG;IAC5C,QAAQ,EAAE,QAAQ,CAAA;IAClB,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,KAAK,CAAC,EAAE,MAAM,CAAA;CACf,CAAA;AAED,eAAO,MAAM,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CAqFjD,CAAA;AAED,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,CAAA;AAElC,eAAO,MAAM,UAAU,2BAA6B,CAAA"}
@@ -17,7 +17,7 @@ import { fieldBaseClass } from '../shared/index.js';
17
17
  import './index.scss';
18
18
  import { GroupProvider, useGroup } from './provider.js';
19
19
  const baseClass = 'group-field';
20
- const GroupField = (props)=>{
20
+ export const _GroupField = (props)=>{
21
21
  const { CustomDescription, CustomLabel, className, descriptionProps, fieldMap, hideGutter, label, readOnly: readOnlyFromProps, style, width } = props;
22
22
  const { path, permissions, readOnly: readOnlyFromContext, schemaPath } = useFieldProps();
23
23
  const { i18n } = useTranslation();
@@ -94,6 +94,6 @@ const GroupField = (props)=>{
94
94
  });
95
95
  };
96
96
  export { GroupProvider, useGroup };
97
- export const Group = withCondition(GroupField);
97
+ export const GroupField = withCondition(_GroupField);
98
98
 
99
99
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/fields/Group/index.tsx"],"sourcesContent":["'use client'\nimport type { FieldPermissions } from 'payload'\n\nimport { getTranslation } from '@payloadcms/translations'\nimport React, { Fragment } from 'react'\n\nimport type { FieldMap } from '../../providers/ComponentMap/buildComponentMap/types.js'\nimport type { FormFieldBase } from '../shared/index.js'\n\nimport { useCollapsible } from '../../elements/Collapsible/provider.js'\nimport { ErrorPill } from '../../elements/ErrorPill/index.js'\nimport { useFieldProps } from '../../forms/FieldPropsProvider/index.js'\nimport {\n useFormInitializing,\n useFormProcessing,\n useFormSubmitted,\n} from '../../forms/Form/context.js'\nimport { RenderFields } from '../../forms/RenderFields/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 { useRow } from '../Row/provider.js'\nimport { useTabs } from '../Tabs/provider.js'\nimport { fieldBaseClass } from '../shared/index.js'\nimport './index.scss'\nimport { GroupProvider, useGroup } from './provider.js'\n\nconst baseClass = 'group-field'\n\nexport type GroupFieldProps = FormFieldBase & {\n fieldMap: FieldMap\n forceRender?: boolean\n hideGutter?: boolean\n name?: string\n permissions: FieldPermissions\n width?: string\n}\n\nconst GroupField: React.FC<GroupFieldProps> = (props) => {\n const {\n CustomDescription,\n CustomLabel,\n className,\n descriptionProps,\n fieldMap,\n hideGutter,\n label,\n readOnly: readOnlyFromProps,\n style,\n width,\n } = props\n\n const { path, permissions, readOnly: readOnlyFromContext, schemaPath } = useFieldProps()\n const { i18n } = useTranslation()\n const { isWithinCollapsible } = useCollapsible()\n const isWithinGroup = useGroup()\n const isWithinRow = useRow()\n const isWithinTab = useTabs()\n const { errorPaths } = useField({ path })\n const formInitializing = useFormInitializing()\n const formProcessing = useFormProcessing()\n const submitted = useFormSubmitted()\n const errorCount = errorPaths.length\n const fieldHasErrors = submitted && errorCount > 0\n const disabled = readOnlyFromProps || readOnlyFromContext || formProcessing || formInitializing\n\n const isTopLevel = !(isWithinCollapsible || isWithinGroup || isWithinRow)\n\n return (\n <Fragment>\n <div\n className={[\n fieldBaseClass,\n baseClass,\n isTopLevel && `${baseClass}--top-level`,\n isWithinCollapsible && `${baseClass}--within-collapsible`,\n isWithinGroup && `${baseClass}--within-group`,\n isWithinRow && `${baseClass}--within-row`,\n isWithinTab && `${baseClass}--within-tab`,\n !hideGutter && isWithinGroup && `${baseClass}--gutter`,\n fieldHasErrors && `${baseClass}--has-error`,\n className,\n ]\n .filter(Boolean)\n .join(' ')}\n id={`field-${path?.replace(/\\./g, '__')}`}\n style={{\n ...style,\n width,\n }}\n >\n <GroupProvider>\n <div className={`${baseClass}__wrap`}>\n <div className={`${baseClass}__header`}>\n {(CustomLabel || CustomDescription || label) && (\n <header>\n {CustomLabel !== undefined ? (\n CustomLabel\n ) : label ? (\n <h3 className={`${baseClass}__title`}>{getTranslation(label, i18n)}</h3>\n ) : null}\n {CustomDescription !== undefined ? (\n CustomDescription\n ) : (\n <FieldDescription {...(descriptionProps || {})} />\n )}\n </header>\n )}\n {fieldHasErrors && <ErrorPill count={errorCount} i18n={i18n} withMessage />}\n </div>\n <RenderFields\n fieldMap={fieldMap}\n margins=\"small\"\n path={path}\n permissions={permissions?.fields}\n readOnly={disabled}\n schemaPath={schemaPath}\n />\n </div>\n </GroupProvider>\n </div>\n </Fragment>\n )\n}\n\nexport { GroupProvider, useGroup }\n\nexport const Group = withCondition(GroupField)\n"],"names":["getTranslation","React","Fragment","useCollapsible","ErrorPill","useFieldProps","useFormInitializing","useFormProcessing","useFormSubmitted","RenderFields","useField","withCondition","useTranslation","FieldDescription","useRow","useTabs","fieldBaseClass","GroupProvider","useGroup","baseClass","GroupField","props","CustomDescription","CustomLabel","className","descriptionProps","fieldMap","hideGutter","label","readOnly","readOnlyFromProps","style","width","path","permissions","readOnlyFromContext","schemaPath","i18n","isWithinCollapsible","isWithinGroup","isWithinRow","isWithinTab","errorPaths","formInitializing","formProcessing","submitted","errorCount","length","fieldHasErrors","disabled","isTopLevel","div","filter","Boolean","join","id","replace","header","undefined","h3","count","withMessage","margins","fields","Group"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","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,KAACpD;4BACCiB,UAAUA;4BACVoC,SAAQ;4BACR7B,MAAMA;4BACNC,aAAaA,aAAa6B;4BAC1BlC,UAAUoB;4BACVb,YAAYA;;;;;;;AAO1B;AAEA,SAASnB,aAAa,EAAEC,QAAQ,GAAE;AAElC,OAAO,MAAM8C,QAAQrD,cAAcS,YAAW"}
1
+ {"version":3,"sources":["../../../src/fields/Group/index.tsx"],"sourcesContent":["'use client'\n\nimport { getTranslation } from '@payloadcms/translations'\nimport React, { Fragment } from 'react'\n\nimport type { FieldMap } from '../../providers/ComponentMap/buildComponentMap/types.js'\nimport type { FormFieldBase } from '../shared/index.js'\n\nimport { useCollapsible } from '../../elements/Collapsible/provider.js'\nimport { ErrorPill } from '../../elements/ErrorPill/index.js'\nimport { useFieldProps } from '../../forms/FieldPropsProvider/index.js'\nimport {\n useFormInitializing,\n useFormProcessing,\n useFormSubmitted,\n} from '../../forms/Form/context.js'\nimport { RenderFields } from '../../forms/RenderFields/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 { useRow } from '../Row/provider.js'\nimport { useTabs } from '../Tabs/provider.js'\nimport { fieldBaseClass } from '../shared/index.js'\nimport './index.scss'\nimport { GroupProvider, useGroup } from './provider.js'\n\nconst baseClass = 'group-field'\n\nexport type GroupFieldProps = FormFieldBase & {\n fieldMap: FieldMap\n forceRender?: boolean\n hideGutter?: boolean\n name?: string\n width?: string\n}\n\nexport const _GroupField: React.FC<GroupFieldProps> = (props) => {\n const {\n CustomDescription,\n CustomLabel,\n className,\n descriptionProps,\n fieldMap,\n hideGutter,\n label,\n readOnly: readOnlyFromProps,\n style,\n width,\n } = props\n\n const { path, permissions, readOnly: readOnlyFromContext, schemaPath } = useFieldProps()\n const { i18n } = useTranslation()\n const { isWithinCollapsible } = useCollapsible()\n const isWithinGroup = useGroup()\n const isWithinRow = useRow()\n const isWithinTab = useTabs()\n const { errorPaths } = useField({ path })\n const formInitializing = useFormInitializing()\n const formProcessing = useFormProcessing()\n const submitted = useFormSubmitted()\n const errorCount = errorPaths.length\n const fieldHasErrors = submitted && errorCount > 0\n const disabled = readOnlyFromProps || readOnlyFromContext || formProcessing || formInitializing\n\n const isTopLevel = !(isWithinCollapsible || isWithinGroup || isWithinRow)\n\n return (\n <Fragment>\n <div\n className={[\n fieldBaseClass,\n baseClass,\n isTopLevel && `${baseClass}--top-level`,\n isWithinCollapsible && `${baseClass}--within-collapsible`,\n isWithinGroup && `${baseClass}--within-group`,\n isWithinRow && `${baseClass}--within-row`,\n isWithinTab && `${baseClass}--within-tab`,\n !hideGutter && isWithinGroup && `${baseClass}--gutter`,\n fieldHasErrors && `${baseClass}--has-error`,\n className,\n ]\n .filter(Boolean)\n .join(' ')}\n id={`field-${path?.replace(/\\./g, '__')}`}\n style={{\n ...style,\n width,\n }}\n >\n <GroupProvider>\n <div className={`${baseClass}__wrap`}>\n <div className={`${baseClass}__header`}>\n {(CustomLabel || CustomDescription || label) && (\n <header>\n {CustomLabel !== undefined ? (\n CustomLabel\n ) : label ? (\n <h3 className={`${baseClass}__title`}>{getTranslation(label, i18n)}</h3>\n ) : null}\n {CustomDescription !== undefined ? (\n CustomDescription\n ) : (\n <FieldDescription {...(descriptionProps || {})} />\n )}\n </header>\n )}\n {fieldHasErrors && <ErrorPill count={errorCount} i18n={i18n} withMessage />}\n </div>\n <RenderFields\n fieldMap={fieldMap}\n margins=\"small\"\n path={path}\n permissions={permissions?.fields}\n readOnly={disabled}\n schemaPath={schemaPath}\n />\n </div>\n </GroupProvider>\n </div>\n </Fragment>\n )\n}\n\nexport { GroupProvider, useGroup }\n\nexport const GroupField = withCondition(_GroupField)\n"],"names":["getTranslation","React","Fragment","useCollapsible","ErrorPill","useFieldProps","useFormInitializing","useFormProcessing","useFormSubmitted","RenderFields","useField","withCondition","useTranslation","FieldDescription","useRow","useTabs","fieldBaseClass","GroupProvider","useGroup","baseClass","_GroupField","props","CustomDescription","CustomLabel","className","descriptionProps","fieldMap","hideGutter","label","readOnly","readOnlyFromProps","style","width","path","permissions","readOnlyFromContext","schemaPath","i18n","isWithinCollapsible","isWithinGroup","isWithinRow","isWithinTab","errorPaths","formInitializing","formProcessing","submitted","errorCount","length","fieldHasErrors","disabled","isTopLevel","div","filter","Boolean","join","id","replace","header","undefined","h3","count","withMessage","margins","fields","GroupField"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;;AAEA,SAASA,cAAc,QAAQ,2BAA0B;AACzD,OAAOC,SAASC,QAAQ,QAAQ,QAAO;AAKvC,SAASC,cAAc,QAAQ,yCAAwC;AACvE,SAASC,SAAS,QAAQ,oCAAmC;AAC7D,SAASC,aAAa,QAAQ,0CAAyC;AACvE,SACEC,mBAAmB,EACnBC,iBAAiB,EACjBC,gBAAgB,QACX,8BAA6B;AACpC,SAASC,YAAY,QAAQ,oCAAmC;AAChE,SAASC,QAAQ,QAAQ,gCAA+B;AACxD,SAASC,aAAa,QAAQ,qCAAoC;AAClE,SAASC,cAAc,QAAQ,uCAAsC;AACrE,SAASC,gBAAgB,QAAQ,+BAA8B;AAC/D,SAASC,MAAM,QAAQ,qBAAoB;AAC3C,SAASC,OAAO,QAAQ,sBAAqB;AAC7C,SAASC,cAAc,QAAQ,qBAAoB;AACnD,OAAO,eAAc;AACrB,SAASC,aAAa,EAAEC,QAAQ,QAAQ,gBAAe;AAEvD,MAAMC,YAAY;AAUlB,OAAO,MAAMC,cAAyC,CAACC;IACrD,MAAM,EACJC,iBAAiB,EACjBC,WAAW,EACXC,SAAS,EACTC,gBAAgB,EAChBC,QAAQ,EACRC,UAAU,EACVC,KAAK,EACLC,UAAUC,iBAAiB,EAC3BC,KAAK,EACLC,KAAK,EACN,GAAGX;IAEJ,MAAM,EA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,MAACgC;4BAAI3B,WAAW,CAAC,EAAEL,UAAU,QAAQ,CAAC;;gCAClCI,CAAAA,eAAeD,qBAAqBM,KAAI,mBACxC,MAAC6B;;wCACElC,gBAAgBmC,YACfnC,cACEK,sBACF,KAAC+B;4CAAGnC,WAAW,CAAC,EAAEL,UAAU,OAAO,CAAC;sDAAGnB,eAAe4B,OAAOS;6CAC3D;wCACHf,sBAAsBoC,YACrBpC,kCAEA,KAACT;4CAAkB,GAAIY,oBAAoB,CAAC,CAAC;;;;gCAIlDuB,gCAAkB,KAAC5C;oCAAUwD,OAAOd;oCAAYT,MAAMA;oCAAMwB,WAAW;;;;sCAE1E,KAACpD;4BACCiB,UAAUA;4BACVoC,SAAQ;4BACR7B,MAAMA;4BACNC,aAAaA,aAAa6B;4BAC1BlC,UAAUoB;4BACVb,YAAYA;;;;;;;AAO1B,EAAC;AAED,SAASnB,aAAa,EAAEC,QAAQ,GAAE;AAElC,OAAO,MAAM8C,aAAarD,cAAcS,aAAY"}
@@ -7,5 +7,5 @@ export type HiddenInputFieldProps = FormFieldBase & {
7
7
  path?: string;
8
8
  value?: unknown;
9
9
  };
10
- export declare const HiddenInput: React.FC<HiddenInputFieldProps>;
10
+ export declare const HiddenField: React.FC<HiddenInputFieldProps>;
11
11
  //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/fields/Hidden/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAoB,MAAM,OAAO,CAAA;AAExC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAMhD,MAAM,MAAM,qBAAqB,GAAG,aAAa,GAAG;IAClD,oBAAoB,CAAC,EAAE,KAAK,CAAA;IAC5B,qBAAqB,CAAC,EAAE,OAAO,CAAA;IAC/B,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,KAAK,CAAC,EAAE,OAAO,CAAA;CAChB,CAAA;AAsCD,eAAO,MAAM,WAAW,iCAA8B,CAAA"}
@@ -7,7 +7,7 @@ import { withCondition } from '../../forms/withCondition/index.js';
7
7
  /**
8
8
  * This is mainly used to save a value on the form that is not visible to the user.
9
9
  * For example, this sets the `ìd` property of a block in the Blocks field.
10
- */ const HiddenInputField = (props)=>{
10
+ */ const _HiddenField = (props)=>{
11
11
  const { name, disableModifyingForm = true, forceUsePathFromProps, path: pathFromProps, value: valueFromProps } = props;
12
12
  const { path: pathFromContext } = useFieldProps();
13
13
  const { path, setValue, value } = useField({
@@ -30,6 +30,6 @@ import { withCondition } from '../../forms/withCondition/index.js';
30
30
  value: value || ''
31
31
  });
32
32
  };
33
- export const HiddenInput = withCondition(HiddenInputField);
33
+ export const HiddenField = withCondition(_HiddenField);
34
34
 
35
35
  //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/fields/Hidden/index.tsx"],"sourcesContent":["'use client'\nimport React, { useEffect } from 'react'\n\nimport type { FormFieldBase } from '../index.js'\n\nimport { useFieldProps } from '../../forms/FieldPropsProvider/index.js'\nimport { useField } from '../../forms/useField/index.js'\nimport { withCondition } from '../../forms/withCondition/index.js'\n\nexport type HiddenInputFieldProps = FormFieldBase & {\n disableModifyingForm?: false\n forceUsePathFromProps?: boolean\n name?: string\n path?: string\n value?: unknown\n}\n\n/**\n * This is mainly used to save a value on the form that is not visible to the user.\n * For example, this sets the `ìd` property of a block in the Blocks field.\n */\nconst _HiddenField: React.FC<HiddenInputFieldProps> = (props) => {\n const {\n name,\n disableModifyingForm = true,\n forceUsePathFromProps,\n path: pathFromProps,\n value: valueFromProps,\n } = props\n\n const { path: pathFromContext } = useFieldProps()\n\n const { path, setValue, value } = useField({\n path: (!forceUsePathFromProps ? pathFromContext : null) || pathFromProps || name,\n })\n\n useEffect(() => {\n if (valueFromProps !== undefined) {\n setValue(valueFromProps, disableModifyingForm)\n }\n }, [valueFromProps, setValue, disableModifyingForm])\n\n return (\n <input\n id={`field-${path?.replace(/\\./g, '__')}`}\n name={path}\n onChange={setValue}\n type=\"hidden\"\n value={(value as string) || ''}\n />\n )\n}\n\nexport const HiddenField = withCondition(_HiddenField)\n"],"names":["React","useEffect","useFieldProps","useField","withCondition","_HiddenField","props","name","disableModifyingForm","forceUsePathFromProps","path","pathFromProps","value","valueFromProps","pathFromContext","setValue","undefined","input","id","replace","onChange","type","HiddenField"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;;AACA,OAAOA,SAASC,SAAS,QAAQ,QAAO;AAIxC,SAASC,aAAa,QAAQ,0CAAyC;AACvE,SAASC,QAAQ,QAAQ,gCAA+B;AACxD,SAASC,aAAa,QAAQ,qCAAoC;AAUlE;;;CAGC,GACD,MAAMC,eAAgD,CAACC;IACrD,MAAM,EACJC,IAAI,EACJC,uBAAuB,IAAI,EAC3BC,qBAAqB,EACrBC,MAAMC,aAAa,EACnBC,OAAOC,cAAc,EACtB,GAAGP;IAEJ,MAAM,EAAEI,MAAMI,eAAe,EAAE,GAAGZ;IAElC,MAAM,EAAEQ,IAAI,EAAEK,QAAQ,EAAEH,KAAK,EAAE,GAAGT,SAAS;QACzCO,MAAM,AAAC,CAAA,CAACD,wBAAwBK,kBAAkB,IAAG,KAAMH,iBAAiBJ;IAC9E;IAEAN,UAAU;QACR,IAAIY,mBAAmBG,WAAW;YAChCD,SAASF,gBAAgBL;QAC3B;IACF,GAAG;QAACK;QAAgBE;QAAUP;KAAqB;IAEnD,qBACE,KAACS;QACCC,IAAI,CAAC,MAAM,EAAER,MAAMS,QAAQ,OAAO,MAAM,CAAC;QACzCZ,MAAMG;QACNU,UAAUL;QACVM,MAAK;QACLT,OAAO,AAACA,SAAoB;;AAGlC;AAEA,OAAO,MAAMU,cAAclB,cAAcC,cAAa"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/fields/JSON/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAkB,SAAS,IAAI,aAAa,EAAE,MAAM,SAAS,CAAA;AAEzE,OAAO,KAA2C,MAAM,OAAO,CAAA;AAO/D,OAAO,cAAc,CAAA;AAIrB,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAMvD,MAAM,MAAM,cAAc,GAAG,aAAa,GAAG;IAC3C,aAAa,CAAC,EAAE,aAAa,CAAC,OAAO,CAAC,CAAC,eAAe,CAAC,CAAA;IACvD,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IACpC,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,KAAK,CAAC,EAAE,MAAM,CAAA;CACf,CAAA;AAyID,eAAO,MAAM,SAAS,0BAAoC,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/fields/JSON/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAkB,SAAS,IAAI,aAAa,EAAE,MAAM,SAAS,CAAA;AAEzE,OAAO,KAA2C,MAAM,OAAO,CAAA;AAO/D,OAAO,cAAc,CAAA;AAIrB,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAMvD,MAAM,MAAM,cAAc,GAAG,aAAa,GAAG;IAC3C,aAAa,CAAC,EAAE,aAAa,CAAC,OAAO,CAAC,CAAC,eAAe,CAAC,CAAA;IACvD,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IACpC,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,KAAK,CAAC,EAAE,MAAM,CAAA;CACf,CAAA;AAyID,eAAO,MAAM,SAAS,0BAA4B,CAAA"}
@@ -11,7 +11,7 @@ const baseClass = 'json-field';
11
11
  import { useFieldProps } from '../../forms/FieldPropsProvider/index.js';
12
12
  import { FieldDescription } from '../FieldDescription/index.js';
13
13
  import { FieldError } from '../FieldError/index.js';
14
- const JSONFieldComponent = (props)=>{
14
+ const _JSONField = (props)=>{
15
15
  const { name, AfterInput, BeforeInput, CustomDescription, CustomError, CustomLabel, className, descriptionProps, editorOptions, errorProps, jsonSchema, label, labelProps, path: pathFromProps, readOnly: readOnlyFromProps, required, style, validate, width } = props;
16
16
  const [stringValue, setStringValue] = useState();
17
17
  const [jsonError, setJsonError] = useState();
@@ -125,6 +125,6 @@ const JSONFieldComponent = (props)=>{
125
125
  ]
126
126
  });
127
127
  };
128
- export const JSONField = withCondition(JSONFieldComponent);
128
+ export const JSONField = withCondition(_JSONField);
129
129
 
130
130
  //# sourceMappingURL=index.js.map