@payloadcms/ui 3.0.0-beta.103 → 3.0.0-beta.105

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 (133) hide show
  1. package/dist/elements/DeleteDocument/index.d.ts +9 -6
  2. package/dist/elements/DeleteDocument/index.d.ts.map +1 -1
  3. package/dist/elements/DeleteDocument/index.js +40 -8
  4. package/dist/elements/DeleteDocument/index.js.map +1 -1
  5. package/dist/elements/DocumentControls/index.d.ts +8 -0
  6. package/dist/elements/DocumentControls/index.d.ts.map +1 -1
  7. package/dist/elements/DocumentControls/index.js +26 -8
  8. package/dist/elements/DocumentControls/index.js.map +1 -1
  9. package/dist/elements/DocumentDrawer/DrawerContent.d.ts.map +1 -1
  10. package/dist/elements/DocumentDrawer/DrawerContent.js +97 -35
  11. package/dist/elements/DocumentDrawer/DrawerContent.js.map +1 -1
  12. package/dist/elements/DocumentDrawer/types.d.ts +5 -0
  13. package/dist/elements/DocumentDrawer/types.d.ts.map +1 -1
  14. package/dist/elements/DocumentDrawer/types.js.map +1 -1
  15. package/dist/elements/Drawer/index.d.ts +1 -0
  16. package/dist/elements/Drawer/index.d.ts.map +1 -1
  17. package/dist/elements/Drawer/index.js +2 -2
  18. package/dist/elements/Drawer/index.js.map +1 -1
  19. package/dist/elements/DuplicateDocument/index.d.ts +6 -3
  20. package/dist/elements/DuplicateDocument/index.d.ts.map +1 -1
  21. package/dist/elements/DuplicateDocument/index.js +101 -151
  22. package/dist/elements/DuplicateDocument/index.js.map +1 -1
  23. package/dist/elements/ReactSelect/types.d.ts +4 -2
  24. package/dist/elements/ReactSelect/types.d.ts.map +1 -1
  25. package/dist/elements/ReactSelect/types.js.map +1 -1
  26. package/dist/elements/SelectRow/index.js +29 -20
  27. package/dist/elements/SelectRow/index.js.map +1 -1
  28. package/dist/elements/Table/DefaultCell/fields/Blocks/index.d.ts +2 -2
  29. package/dist/elements/Table/DefaultCell/fields/Blocks/index.d.ts.map +1 -1
  30. package/dist/elements/Table/DefaultCell/fields/Blocks/index.js.map +1 -1
  31. package/dist/elements/TableColumns/buildColumnState.d.ts.map +1 -1
  32. package/dist/elements/TableColumns/buildColumnState.js +0 -1
  33. package/dist/elements/TableColumns/buildColumnState.js.map +1 -1
  34. package/dist/elements/WhereBuilder/reduceClientFields.d.ts.map +1 -1
  35. package/dist/elements/WhereBuilder/reduceClientFields.js +3 -1
  36. package/dist/elements/WhereBuilder/reduceClientFields.js.map +1 -1
  37. package/dist/exports/client/index.js +19 -19
  38. package/dist/exports/client/index.js.map +3 -3
  39. package/dist/fields/Array/index.d.ts.map +1 -1
  40. package/dist/fields/Array/index.js +6 -3
  41. package/dist/fields/Array/index.js.map +1 -1
  42. package/dist/fields/Blocks/BlockRow.d.ts +2 -2
  43. package/dist/fields/Blocks/BlockRow.d.ts.map +1 -1
  44. package/dist/fields/Blocks/BlockRow.js.map +1 -1
  45. package/dist/fields/Blocks/index.d.ts +5 -5
  46. package/dist/fields/Blocks/index.d.ts.map +1 -1
  47. package/dist/fields/Blocks/index.js +0 -3
  48. package/dist/fields/Blocks/index.js.map +1 -1
  49. package/dist/fields/Checkbox/Input.js +1 -1
  50. package/dist/fields/Checkbox/Input.js.map +1 -1
  51. package/dist/fields/Checkbox/index.scss +13 -0
  52. package/dist/fields/Code/index.d.ts.map +1 -1
  53. package/dist/fields/Code/index.js +31 -36
  54. package/dist/fields/Code/index.js.map +1 -1
  55. package/dist/fields/Collapsible/index.d.ts +141 -4
  56. package/dist/fields/Collapsible/index.d.ts.map +1 -1
  57. package/dist/fields/Collapsible/index.js +48 -41
  58. package/dist/fields/Collapsible/index.js.map +1 -1
  59. package/dist/fields/DateTime/index.d.ts.map +1 -1
  60. package/dist/fields/DateTime/index.js +32 -37
  61. package/dist/fields/DateTime/index.js.map +1 -1
  62. package/dist/fields/Email/index.d.ts.map +1 -1
  63. package/dist/fields/Email/index.js +28 -32
  64. package/dist/fields/Email/index.js.map +1 -1
  65. package/dist/fields/FieldLabel/index.d.ts.map +1 -1
  66. package/dist/fields/FieldLabel/index.js +7 -1
  67. package/dist/fields/FieldLabel/index.js.map +1 -1
  68. package/dist/fields/JSON/index.d.ts.map +1 -1
  69. package/dist/fields/JSON/index.js +0 -2
  70. package/dist/fields/JSON/index.js.map +1 -1
  71. package/dist/fields/Number/index.d.ts.map +1 -1
  72. package/dist/fields/Number/index.js +35 -40
  73. package/dist/fields/Number/index.js.map +1 -1
  74. package/dist/fields/Password/types.d.ts +2 -2
  75. package/dist/fields/Password/types.d.ts.map +1 -1
  76. package/dist/fields/Password/types.js.map +1 -1
  77. package/dist/fields/Point/index.d.ts.map +1 -1
  78. package/dist/fields/Point/index.js +1 -0
  79. package/dist/fields/Point/index.js.map +1 -1
  80. package/dist/fields/RadioGroup/index.d.ts.map +1 -1
  81. package/dist/fields/RadioGroup/index.js +34 -39
  82. package/dist/fields/RadioGroup/index.js.map +1 -1
  83. package/dist/fields/Relationship/index.d.ts +4 -4
  84. package/dist/fields/Relationship/index.d.ts.map +1 -1
  85. package/dist/fields/Relationship/index.js +64 -19
  86. package/dist/fields/Relationship/index.js.map +1 -1
  87. package/dist/fields/Relationship/optionsReducer.d.ts.map +1 -1
  88. package/dist/fields/Relationship/optionsReducer.js +17 -0
  89. package/dist/fields/Relationship/optionsReducer.js.map +1 -1
  90. package/dist/fields/Relationship/types.d.ts +11 -4
  91. package/dist/fields/Relationship/types.d.ts.map +1 -1
  92. package/dist/fields/Relationship/types.js.map +1 -1
  93. package/dist/fields/Row/index.scss +12 -2
  94. package/dist/fields/Select/Input.d.ts +2 -2
  95. package/dist/fields/Select/Input.d.ts.map +1 -1
  96. package/dist/fields/Select/Input.js.map +1 -1
  97. package/dist/fields/Select/index.d.ts.map +1 -1
  98. package/dist/fields/Select/index.js +0 -2
  99. package/dist/fields/Select/index.js.map +1 -1
  100. package/dist/fields/Text/index.d.ts.map +1 -1
  101. package/dist/fields/Text/index.js +0 -2
  102. package/dist/fields/Text/index.js.map +1 -1
  103. package/dist/fields/Text/types.d.ts +2 -2
  104. package/dist/fields/Text/types.d.ts.map +1 -1
  105. package/dist/fields/Text/types.js.map +1 -1
  106. package/dist/fields/Textarea/index.d.ts.map +1 -1
  107. package/dist/fields/Textarea/index.js +0 -2
  108. package/dist/fields/Textarea/index.js.map +1 -1
  109. package/dist/fields/Textarea/types.d.ts +2 -2
  110. package/dist/fields/Textarea/types.d.ts.map +1 -1
  111. package/dist/fields/Textarea/types.js.map +1 -1
  112. package/dist/fields/Upload/Input.d.ts +2 -2
  113. package/dist/fields/Upload/Input.d.ts.map +1 -1
  114. package/dist/fields/Upload/Input.js +11 -12
  115. package/dist/fields/Upload/Input.js.map +1 -1
  116. package/dist/fields/Upload/index.d.ts.map +1 -1
  117. package/dist/fields/Upload/index.js +14 -17
  118. package/dist/fields/Upload/index.js.map +1 -1
  119. package/dist/providers/Config/createClientConfig/fields.d.ts.map +1 -1
  120. package/dist/providers/Config/createClientConfig/fields.js +31 -11
  121. package/dist/providers/Config/createClientConfig/fields.js.map +1 -1
  122. package/dist/providers/DocumentInfo/index.d.ts +1 -1
  123. package/dist/providers/DocumentInfo/index.d.ts.map +1 -1
  124. package/dist/providers/DocumentInfo/index.js.map +1 -1
  125. package/dist/providers/DocumentInfo/types.d.ts +18 -1
  126. package/dist/providers/DocumentInfo/types.d.ts.map +1 -1
  127. package/dist/providers/DocumentInfo/types.js.map +1 -1
  128. package/dist/providers/Selection/index.d.ts +1 -1
  129. package/dist/providers/Selection/index.d.ts.map +1 -1
  130. package/dist/providers/Selection/index.js +43 -29
  131. package/dist/providers/Selection/index.js.map +1 -1
  132. package/dist/styles.css +1 -1
  133. package/package.json +6 -6
@@ -17,7 +17,7 @@ import { RenderComponent } from '../../providers/Config/RenderComponent.js';
17
17
  import { FieldDescription } from '../FieldDescription/index.js';
18
18
  import { FieldError } from '../FieldError/index.js';
19
19
  const DateTimeFieldComponent = props => {
20
- const $ = _c(39);
20
+ const $ = _c(37);
21
21
  const {
22
22
  descriptionProps,
23
23
  errorProps,
@@ -31,7 +31,6 @@ const DateTimeFieldComponent = props => {
31
31
  name,
32
32
  _path: pathFromProps,
33
33
  admin: t1,
34
- label,
35
34
  required
36
35
  } = t0;
37
36
  let t2;
@@ -112,43 +111,43 @@ const DateTimeFieldComponent = props => {
112
111
  }
113
112
  const t9 = t8.join(" ");
114
113
  let t10;
115
- if ($[12] !== style || $[13] !== width || $[14] !== field || $[15] !== labelProps || $[16] !== label || $[17] !== required || $[18] !== path || $[19] !== errorProps || $[20] !== disabled || $[21] !== setValue || $[22] !== placeholder || $[23] !== i18n || $[24] !== datePickerProps || $[25] !== value_0 || $[26] !== descriptionProps || $[27] !== description || $[28] !== t9) {
114
+ if ($[12] !== style || $[13] !== width || $[14] !== field || $[15] !== labelProps || $[16] !== path || $[17] !== errorProps || $[18] !== disabled || $[19] !== setValue || $[20] !== placeholder || $[21] !== i18n || $[22] !== datePickerProps || $[23] !== value_0 || $[24] !== descriptionProps || $[25] !== description || $[26] !== t9) {
116
115
  let t11;
117
- if ($[30] !== labelProps) {
116
+ if ($[28] !== labelProps) {
118
117
  t11 = labelProps || {};
119
- $[30] = labelProps;
120
- $[31] = t11;
118
+ $[28] = labelProps;
119
+ $[29] = t11;
121
120
  } else {
122
- t11 = $[31];
121
+ t11 = $[29];
123
122
  }
124
123
  let t12;
125
- if ($[32] !== errorProps) {
124
+ if ($[30] !== errorProps) {
126
125
  t12 = errorProps || {};
127
- $[32] = errorProps;
128
- $[33] = t12;
126
+ $[30] = errorProps;
127
+ $[31] = t12;
129
128
  } else {
130
- t12 = $[33];
129
+ t12 = $[31];
131
130
  }
132
131
  let t13;
133
- if ($[34] !== disabled || $[35] !== setValue) {
132
+ if ($[32] !== disabled || $[33] !== setValue) {
134
133
  t13 = incomingDate => {
135
134
  if (!disabled) {
136
135
  setValue(incomingDate?.toISOString() || null);
137
136
  }
138
137
  };
139
- $[34] = disabled;
140
- $[35] = setValue;
141
- $[36] = t13;
138
+ $[32] = disabled;
139
+ $[33] = setValue;
140
+ $[34] = t13;
142
141
  } else {
143
- t13 = $[36];
142
+ t13 = $[34];
144
143
  }
145
144
  let t14;
146
- if ($[37] !== descriptionProps) {
145
+ if ($[35] !== descriptionProps) {
147
146
  t14 = descriptionProps || {};
148
- $[37] = descriptionProps;
149
- $[38] = t14;
147
+ $[35] = descriptionProps;
148
+ $[36] = t14;
150
149
  } else {
151
- t14 = $[38];
150
+ t14 = $[36];
152
151
  }
153
152
  t10 = _jsxs("div", {
154
153
  className: t9,
@@ -159,8 +158,6 @@ const DateTimeFieldComponent = props => {
159
158
  children: [_jsx(FieldLabel, {
160
159
  field,
161
160
  Label: field?.admin?.components?.Label,
162
- label,
163
- required,
164
161
  ...t11
165
162
  }), _jsxs("div", {
166
163
  className: `${fieldBaseClass}__wrap`,
@@ -192,22 +189,20 @@ const DateTimeFieldComponent = props => {
192
189
  $[13] = width;
193
190
  $[14] = field;
194
191
  $[15] = labelProps;
195
- $[16] = label;
196
- $[17] = required;
197
- $[18] = path;
198
- $[19] = errorProps;
199
- $[20] = disabled;
200
- $[21] = setValue;
201
- $[22] = placeholder;
202
- $[23] = i18n;
203
- $[24] = datePickerProps;
204
- $[25] = value_0;
205
- $[26] = descriptionProps;
206
- $[27] = description;
207
- $[28] = t9;
208
- $[29] = t10;
192
+ $[16] = path;
193
+ $[17] = errorProps;
194
+ $[18] = disabled;
195
+ $[19] = setValue;
196
+ $[20] = placeholder;
197
+ $[21] = i18n;
198
+ $[22] = datePickerProps;
199
+ $[23] = value_0;
200
+ $[24] = descriptionProps;
201
+ $[25] = description;
202
+ $[26] = t9;
203
+ $[27] = t10;
209
204
  } else {
210
- t10 = $[29];
205
+ t10 = $[27];
211
206
  }
212
207
  return t10;
213
208
  };
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["c","_c","getTranslation","React","useCallback","DatePickerField","useField","useTranslation","FieldLabel","fieldBaseClass","baseClass","useFieldProps","withCondition","RenderComponent","FieldDescription","FieldError","DateTimeFieldComponent","props","$","descriptionProps","errorProps","field","t0","labelProps","readOnly","readOnlyFromTopLevelProps","validate","name","_path","pathFromProps","admin","t1","label","required","t2","undefined","className","date","datePickerProps","description","placeholder","readOnlyFromAdmin","style","width","readOnlyFromProps","i18n","t3","value","options","memoizedValidate","path","pathFromContext","readOnlyFromContext","t4","t5","formInitializing","formProcessing","setValue","showError","value_0","disabled","t6","t7","t8","filter","Boolean","t9","join","t10","t11","t12","t13","incomingDate","toISOString","t14","_jsxs","children","_jsx","Label","components","id","replace","CustomError","Error","mappedComponent","beforeInput","onChange","afterInput","Description","DateTimeField"],"sources":["../../../src/fields/DateTime/index.tsx"],"sourcesContent":["'use client'\nimport type { DateFieldClientComponent, DateFieldValidation } from 'payload'\n\nimport { getTranslation } from '@payloadcms/translations'\nimport React, { useCallback } from 'react'\n\nimport { DatePickerField } from '../../elements/DatePicker/index.js'\nimport { useField } from '../../forms/useField/index.js'\nimport { useTranslation } from '../../providers/Translation/index.js'\nimport { FieldLabel } from '../FieldLabel/index.js'\nimport { fieldBaseClass } from '../shared/index.js'\nimport './index.scss'\n\nconst baseClass = 'date-time-field'\n\nimport { useFieldProps } from '../../forms/FieldPropsProvider/index.js'\nimport { withCondition } from '../../forms/withCondition/index.js'\nimport { RenderComponent } from '../../providers/Config/RenderComponent.js'\nimport { FieldDescription } from '../FieldDescription/index.js'\nimport { FieldError } from '../FieldError/index.js'\n\nconst DateTimeFieldComponent: DateFieldClientComponent = (props) => {\n const {\n descriptionProps,\n errorProps,\n field,\n field: {\n name,\n _path: pathFromProps,\n admin: {\n className,\n date: datePickerProps,\n description,\n placeholder,\n readOnly: readOnlyFromAdmin,\n style,\n width,\n } = {},\n label,\n required,\n },\n labelProps,\n readOnly: readOnlyFromTopLevelProps,\n validate,\n } = props\n const readOnlyFromProps = readOnlyFromTopLevelProps || readOnlyFromAdmin\n\n const { i18n } = useTranslation()\n\n const memoizedValidate: DateFieldValidation = useCallback(\n (value, options) => {\n if (typeof validate === 'function') {\n return validate(value, { ...options, required })\n }\n },\n [validate, required],\n )\n\n const { path: pathFromContext, readOnly: readOnlyFromContext } = useFieldProps()\n\n const { formInitializing, formProcessing, path, setValue, showError, value } = useField<Date>({\n path: pathFromContext ?? pathFromProps ?? name,\n validate: memoizedValidate,\n })\n\n const disabled = readOnlyFromProps || readOnlyFromContext || formProcessing || formInitializing\n\n return (\n <div\n className={[\n fieldBaseClass,\n baseClass,\n className,\n showError && `${baseClass}--has-error`,\n disabled && 'read-only',\n ]\n .filter(Boolean)\n .join(' ')}\n style={{\n ...style,\n width,\n }}\n >\n <FieldLabel\n field={field}\n Label={field?.admin?.components?.Label}\n label={label}\n required={required}\n {...(labelProps || {})}\n />\n <div className={`${fieldBaseClass}__wrap`} id={`field-${path.replace(/\\./g, '__')}`}>\n <FieldError\n CustomError={field?.admin?.components?.Error}\n field={field}\n path={path}\n {...(errorProps || {})}\n />\n <RenderComponent mappedComponent={field?.admin?.components?.beforeInput} />\n <DatePickerField\n {...datePickerProps}\n onChange={(incomingDate) => {\n if (!disabled) {\n setValue(incomingDate?.toISOString() || null)\n }\n }}\n placeholder={getTranslation(placeholder, i18n)}\n readOnly={disabled}\n value={value}\n />\n <RenderComponent mappedComponent={field?.admin?.components?.afterInput} />\n </div>\n <FieldDescription\n Description={field?.admin?.components?.Description}\n description={description}\n field={field}\n {...(descriptionProps || {})}\n />\n </div>\n )\n}\n\nexport const DateTimeField = withCondition(DateTimeFieldComponent)\n"],"mappings":"AAAA;;AAAA,SAAAA,CAAA,IAAAC,EAAA;;AAGA,SAASC,cAAc,QAAQ;AAC/B,OAAOC,KAAA,IAASC,WAAW,QAAQ;AAEnC,SAASC,eAAe,QAAQ;AAChC,SAASC,QAAQ,QAAQ;AACzB,SAASC,cAAc,QAAQ;AAC/B,SAASC,UAAU,QAAQ;AAC3B,SAASC,cAAc,QAAQ;AAC/B,OAAO;AAEP,MAAMC,SAAA,GAAY;AAElB,SAASC,aAAa,QAAQ;AAC9B,SAASC,aAAa,QAAQ;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AEA,OAAO,MAAMqB,aAAA,GAAgB7E,aAAA,CAAcI,sBAAA","ignoreList":[]}
1
+ {"version":3,"file":"index.js","names":["c","_c","getTranslation","React","useCallback","DatePickerField","useField","useTranslation","FieldLabel","fieldBaseClass","baseClass","useFieldProps","withCondition","RenderComponent","FieldDescription","FieldError","DateTimeFieldComponent","props","$","descriptionProps","errorProps","field","t0","labelProps","readOnly","readOnlyFromTopLevelProps","validate","name","_path","pathFromProps","admin","t1","required","t2","undefined","className","date","datePickerProps","description","placeholder","readOnlyFromAdmin","style","width","readOnlyFromProps","i18n","t3","value","options","memoizedValidate","path","pathFromContext","readOnlyFromContext","t4","t5","formInitializing","formProcessing","setValue","showError","value_0","disabled","t6","t7","t8","filter","Boolean","t9","join","t10","t11","t12","t13","incomingDate","toISOString","t14","_jsxs","children","_jsx","Label","components","id","replace","CustomError","Error","mappedComponent","beforeInput","onChange","afterInput","Description","DateTimeField"],"sources":["../../../src/fields/DateTime/index.tsx"],"sourcesContent":["'use client'\nimport type { DateFieldClientComponent, DateFieldValidation } from 'payload'\n\nimport { getTranslation } from '@payloadcms/translations'\nimport React, { useCallback } from 'react'\n\nimport { DatePickerField } from '../../elements/DatePicker/index.js'\nimport { useField } from '../../forms/useField/index.js'\nimport { useTranslation } from '../../providers/Translation/index.js'\nimport { FieldLabel } from '../FieldLabel/index.js'\nimport { fieldBaseClass } from '../shared/index.js'\nimport './index.scss'\n\nconst baseClass = 'date-time-field'\n\nimport { useFieldProps } from '../../forms/FieldPropsProvider/index.js'\nimport { withCondition } from '../../forms/withCondition/index.js'\nimport { RenderComponent } from '../../providers/Config/RenderComponent.js'\nimport { FieldDescription } from '../FieldDescription/index.js'\nimport { FieldError } from '../FieldError/index.js'\n\nconst DateTimeFieldComponent: DateFieldClientComponent = (props) => {\n const {\n descriptionProps,\n errorProps,\n field,\n field: {\n name,\n _path: pathFromProps,\n admin: {\n className,\n date: datePickerProps,\n description,\n placeholder,\n readOnly: readOnlyFromAdmin,\n style,\n width,\n } = {},\n label,\n required,\n },\n labelProps,\n readOnly: readOnlyFromTopLevelProps,\n validate,\n } = props\n const readOnlyFromProps = readOnlyFromTopLevelProps || readOnlyFromAdmin\n\n const { i18n } = useTranslation()\n\n const memoizedValidate: DateFieldValidation = useCallback(\n (value, options) => {\n if (typeof validate === 'function') {\n return validate(value, { ...options, required })\n }\n },\n [validate, required],\n )\n\n const { path: pathFromContext, readOnly: readOnlyFromContext } = useFieldProps()\n\n const { formInitializing, formProcessing, path, setValue, showError, value } = useField<Date>({\n path: pathFromContext ?? pathFromProps ?? name,\n validate: memoizedValidate,\n })\n\n const disabled = readOnlyFromProps || readOnlyFromContext || formProcessing || formInitializing\n\n return (\n <div\n className={[\n fieldBaseClass,\n baseClass,\n className,\n showError && `${baseClass}--has-error`,\n disabled && 'read-only',\n ]\n .filter(Boolean)\n .join(' ')}\n style={{\n ...style,\n width,\n }}\n >\n <FieldLabel field={field} Label={field?.admin?.components?.Label} {...(labelProps || {})} />\n <div className={`${fieldBaseClass}__wrap`} id={`field-${path.replace(/\\./g, '__')}`}>\n <FieldError\n CustomError={field?.admin?.components?.Error}\n field={field}\n path={path}\n {...(errorProps || {})}\n />\n <RenderComponent mappedComponent={field?.admin?.components?.beforeInput} />\n <DatePickerField\n {...datePickerProps}\n onChange={(incomingDate) => {\n if (!disabled) {\n setValue(incomingDate?.toISOString() || null)\n }\n }}\n placeholder={getTranslation(placeholder, i18n)}\n readOnly={disabled}\n value={value}\n />\n <RenderComponent mappedComponent={field?.admin?.components?.afterInput} />\n </div>\n <FieldDescription\n Description={field?.admin?.components?.Description}\n description={description}\n field={field}\n {...(descriptionProps || {})}\n />\n </div>\n )\n}\n\nexport const DateTimeField = withCondition(DateTimeFieldComponent)\n"],"mappings":"AAAA;;AAAA,SAAAA,CAAA,IAAAC,EAAA;;AAGA,SAASC,cAAc,QAAQ;AAC/B,OAAOC,KAAA,IAASC,WAAW,QAAQ;AAEnC,SAASC,eAAe,QAAQ;AAChC,SAASC,Q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A;QAAAjB,KAAA;QAAA,GAGRoD;MAAsB,C;;;;;;;;;;;;;;;;;;;;;SAzC/BN,G;CA6CJ;AAEA,OAAO,MAAMqB,aAAA,GAAgB5E,aAAA,CAAcI,sBAAA","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/fields/Email/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAGV,oBAAoB,EACrB,MAAM,SAAS,CAAA;AAGhB,OAAO,KAAsB,MAAM,OAAO,CAAA;AAW1C,OAAO,cAAc,CAAA;AAoGrB,eAAO,MAAM,UAAU;;;;;;;;oCAAqC,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/fields/Email/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAGV,oBAAoB,EACrB,MAAM,SAAS,CAAA;AAGhB,OAAO,KAAsB,MAAM,OAAO,CAAA;AAW1C,OAAO,cAAc,CAAA;AA8FrB,eAAO,MAAM,UAAU;;;;;;;;oCAAqC,CAAA"}
@@ -15,7 +15,7 @@ import { FieldLabel } from '../FieldLabel/index.js';
15
15
  import { fieldBaseClass } from '../shared/index.js';
16
16
  import './index.scss';
17
17
  const EmailFieldComponent = props => {
18
- const $ = _c(38);
18
+ const $ = _c(37);
19
19
  const {
20
20
  autoComplete,
21
21
  descriptionProps,
@@ -38,7 +38,6 @@ const EmailFieldComponent = props => {
38
38
  name,
39
39
  _path: pathFromProps,
40
40
  admin: t2,
41
- label,
42
41
  required
43
42
  } = t1;
44
43
  let t3;
@@ -118,30 +117,30 @@ const EmailFieldComponent = props => {
118
117
  }
119
118
  const t10 = t9.join(" ");
120
119
  let t11;
121
- if ($[14] !== style || $[15] !== width || $[16] !== field || $[17] !== labelProps || $[18] !== label || $[19] !== required || $[20] !== errorProps || $[21] !== path || $[22] !== placeholder || $[23] !== i18n || $[24] !== value_0 || $[25] !== autoComplete || $[26] !== disabled || $[27] !== setValue || $[28] !== descriptionProps || $[29] !== description || $[30] !== t10) {
120
+ if ($[14] !== style || $[15] !== width || $[16] !== field || $[17] !== labelProps || $[18] !== errorProps || $[19] !== path || $[20] !== placeholder || $[21] !== i18n || $[22] !== value_0 || $[23] !== autoComplete || $[24] !== disabled || $[25] !== setValue || $[26] !== required || $[27] !== descriptionProps || $[28] !== description || $[29] !== t10) {
122
121
  let t12;
123
- if ($[32] !== labelProps) {
122
+ if ($[31] !== labelProps) {
124
123
  t12 = labelProps || {};
125
- $[32] = labelProps;
126
- $[33] = t12;
124
+ $[31] = labelProps;
125
+ $[32] = t12;
127
126
  } else {
128
- t12 = $[33];
127
+ t12 = $[32];
129
128
  }
130
129
  let t13;
131
- if ($[34] !== errorProps) {
130
+ if ($[33] !== errorProps) {
132
131
  t13 = errorProps || {};
133
- $[34] = errorProps;
134
- $[35] = t13;
132
+ $[33] = errorProps;
133
+ $[34] = t13;
135
134
  } else {
136
- t13 = $[35];
135
+ t13 = $[34];
137
136
  }
138
137
  let t14;
139
- if ($[36] !== descriptionProps) {
138
+ if ($[35] !== descriptionProps) {
140
139
  t14 = descriptionProps || {};
141
- $[36] = descriptionProps;
142
- $[37] = t14;
140
+ $[35] = descriptionProps;
141
+ $[36] = t14;
143
142
  } else {
144
- t14 = $[37];
143
+ t14 = $[36];
145
144
  }
146
145
  t11 = _jsxs("div", {
147
146
  className: t10,
@@ -152,8 +151,6 @@ const EmailFieldComponent = props => {
152
151
  children: [_jsx(FieldLabel, {
153
152
  field,
154
153
  Label: field?.admin?.components?.Label,
155
- label,
156
- required,
157
154
  ...t12
158
155
  }), _jsxs("div", {
159
156
  className: `${fieldBaseClass}__wrap`,
@@ -188,22 +185,21 @@ const EmailFieldComponent = props => {
188
185
  $[15] = width;
189
186
  $[16] = field;
190
187
  $[17] = labelProps;
191
- $[18] = label;
192
- $[19] = required;
193
- $[20] = errorProps;
194
- $[21] = path;
195
- $[22] = placeholder;
196
- $[23] = i18n;
197
- $[24] = value_0;
198
- $[25] = autoComplete;
199
- $[26] = disabled;
200
- $[27] = setValue;
201
- $[28] = descriptionProps;
202
- $[29] = description;
203
- $[30] = t10;
204
- $[31] = t11;
188
+ $[18] = errorProps;
189
+ $[19] = path;
190
+ $[20] = placeholder;
191
+ $[21] = i18n;
192
+ $[22] = value_0;
193
+ $[23] = autoComplete;
194
+ $[24] = disabled;
195
+ $[25] = setValue;
196
+ $[26] = required;
197
+ $[27] = descriptionProps;
198
+ $[28] = description;
199
+ $[29] = t10;
200
+ $[30] = t11;
205
201
  } else {
206
- t11 = $[31];
202
+ t11 = $[30];
207
203
  }
208
204
  return t11;
209
205
  };
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["c","_c","getTranslation","React","useCallback","useFieldProps","useField","withCondition","RenderComponent","useTranslation","FieldDescription","FieldError","FieldLabel","fieldBaseClass","EmailFieldComponent","props","$","autoComplete","descriptionProps","errorProps","field","t0","labelProps","readOnly","readOnlyFromTopLevelProps","validate","t1","undefined","name","_path","pathFromProps","admin","t2","label","required","t3","readOnlyFromAdmin","className","description","placeholder","style","width","readOnlyFromProps","i18n","t4","value","options","memoizedValidate","path","pathFromContext","readOnlyFromContext","t5","t6","formInitializing","formProcessing","setValue","showError","value_0","disabled","t7","t8","t9","filter","Boolean","t10","join","t11","t12","t13","t14","_jsxs","children","_jsx","Label","components","CustomError","Error","mappedComponent","beforeInput","id","replace","onChange","type","afterInput","Description","EmailField"],"sources":["../../../src/fields/Email/index.tsx"],"sourcesContent":["'use client'\nimport type {\n EmailFieldClientComponent,\n EmailFieldClientProps,\n EmailFieldValidation,\n} from 'payload'\n\nimport { getTranslation } from '@payloadcms/translations'\nimport React, { useCallback } from 'react'\n\nimport { useFieldProps } from '../../forms/FieldPropsProvider/index.js'\nimport { useField } from '../../forms/useField/index.js'\nimport { withCondition } from '../../forms/withCondition/index.js'\nimport { RenderComponent } from '../../providers/Config/RenderComponent.js'\nimport { useTranslation } from '../../providers/Translation/index.js'\nimport { FieldDescription } from '../FieldDescription/index.js'\nimport { FieldError } from '../FieldError/index.js'\nimport { FieldLabel } from '../FieldLabel/index.js'\nimport { fieldBaseClass } from '../shared/index.js'\nimport './index.scss'\n\nconst EmailFieldComponent: EmailFieldClientComponent = (props) => {\n const {\n autoComplete,\n descriptionProps,\n errorProps,\n field: {\n name,\n _path: pathFromProps,\n admin: {\n readOnly: readOnlyFromAdmin,\n\n className,\n description,\n placeholder,\n style,\n width,\n } = {} as EmailFieldClientProps['field']['admin'],\n label,\n required,\n } = {} as EmailFieldClientProps['field'],\n field,\n labelProps,\n readOnly: readOnlyFromTopLevelProps,\n validate,\n } = props\n\n const readOnlyFromProps = readOnlyFromTopLevelProps || readOnlyFromAdmin\n\n const { i18n } = useTranslation()\n\n const memoizedValidate: EmailFieldValidation = useCallback(\n (value, options) => {\n if (typeof validate === 'function') {\n return validate(value, { ...options, required })\n }\n },\n [validate, required],\n )\n\n const { path: pathFromContext, readOnly: readOnlyFromContext } = useFieldProps()\n\n const { formInitializing, formProcessing, path, setValue, showError, value } = useField({\n path: pathFromContext ?? pathFromProps ?? name,\n validate: memoizedValidate,\n })\n\n const disabled = readOnlyFromProps || readOnlyFromContext || formProcessing || formInitializing\n\n return (\n <div\n className={[fieldBaseClass, 'email', className, showError && 'error', disabled && 'read-only']\n .filter(Boolean)\n .join(' ')}\n style={{\n ...style,\n width,\n }}\n >\n <FieldLabel\n field={field}\n Label={field?.admin?.components?.Label}\n label={label}\n required={required}\n {...(labelProps || {})}\n />\n <div className={`${fieldBaseClass}__wrap`}>\n <FieldError\n CustomError={field?.admin?.components?.Error}\n field={field}\n path={path}\n {...(errorProps || {})}\n />\n <RenderComponent mappedComponent={field?.admin?.components?.beforeInput} />\n {/* disable eslint here because the label is dynamic */}\n {/* eslint-disable-next-line jsx-a11y/control-has-associated-label */}\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 required={required}\n type=\"email\"\n value={(value as string) || ''}\n />\n <RenderComponent mappedComponent={field?.admin?.components?.afterInput} />\n </div>\n <FieldDescription\n Description={field?.admin?.components?.Description}\n description={description}\n field={field}\n {...(descriptionProps || {})}\n />\n </div>\n )\n}\n\nexport const EmailField = withCondition(EmailFieldComponent)\n"],"mappings":"AAAA;;AAAA,SAAAA,CAAA,IAAAC,EAAA;;AAOA,SAASC,cAAc,QAAQ;AAC/B,OAAOC,KAAA,IAASC,WAAW,QAAQ;AAEnC,SAASC,aAAa,QAAQ;AAC9B,SAASC,QAAQ,QAAQ;AACzB,SAASC,aAAa,QAAQ;AAC9B,SAASC,eAAe,QAAQ;AAChC,SAASC,cAAc,QAAQ;AAC/B,SAASC,gBAAgB,QAAQ;AACjC,SAASC,UAAU,QAAQ;AAC3B,SAASC,UAAU,QAAQ;AAC3B,SAASC,cAAc,QAAQ;AAC/B,OAAO;AAEP,MAAMC,mBAAA,GAAiDC,KAAA;EAAA,MAAAC,CAAA,GAAAf,EAAA;EACrD;IAAAgB,YAAA;IAAAC,gBAAA;IAAAC,UAAA;IAAAC,KAAA,EAAAC,EAAA;IAAAD,KAAA;IAAAE,UAAA;IAAAC,QAAA,EAAAC,yBAAA;IAAAC;EAAA,IAuBIV,KAAA;EAAA,IAAAW,EAAA;EAAA,IAAAV,CAAA,QAAAK,EAAA;IAnBKK,EAAA,GAAAL,EAciC,KAAAM,SAAA,QAdjCN,EAciC;IAAAL,CAAA,MAAAK,EAAA;IAAAL,CAAA,MAAAU,EAAA;EAAA;IAAAA,EAAA,GAAAV,CAAA;EAAA;EAdjC;IAAAY,IAAA;IAAAC,KAAA,EAAAC,aAAA;IAAAC,KAAA,EAAAC,EAAA;IAAAC,KAAA;IAAAC;EAAA,IAAAR,EAciC;EAAA,IAAAS,EAAA;EAAA,IAAAnB,CAAA,QAAAgB,EAAA;IAX/BG,EAAA,GAAAH,EAQ0C,KAAAL,SAAA,QAR1CK,EAQ0C;IAAAhB,CAAA,MAAAgB,EAAA;IA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AAaI,IAAA;UAAAT,QAAA;UAAAgD,IAAA,EAEpC;UAAArC,KAAA,EACEA,OAAC,IAAoB;QAAA,C,GAE9B2B,IAAA,CAAAhE,eAAA;UAAAqE,eAAA,EAAkCzD,KAAA,EAAAW,KAAA,EAAA2C,UAAA,EAAAS;QAAA,C;UAEpCX,IAAA,CAAA9D,gBAAA;QAAA0E,WAAA,EACehE,KAAA,EAAAW,KAAA,EAAA2C,UAAA,EAAAU,WAAA;QAAA9C,WAAA;QAAAlB,KAAA;QAAA,GAGRiD;MAAsB,C;;;;;;;;;;;;;;;;;;;;;;;SA3C/BH,G;CA+CJ;AAEA,OAAO,MAAMmB,UAAA,GAAa9E,aAAA,CAAcO,mBAAA","ignoreList":[]}
1
+ {"version":3,"file":"index.js","names":["c","_c","getTranslation","React","useCallback","useFieldProps","useField","withCondition","RenderComponent","useTranslation","FieldDescription","FieldError","FieldLabel","fieldBaseClass","EmailFieldComponent","props","$","autoComplete","descriptionProps","errorProps","field","t0","labelProps","readOnly","readOnlyFromTopLevelProps","validate","t1","undefined","name","_path","pathFromProps","admin","t2","required","t3","readOnlyFromAdmin","className","description","placeholder","style","width","readOnlyFromProps","i18n","t4","value","options","memoizedValidate","path","pathFromContext","readOnlyFromContext","t5","t6","formInitializing","formProcessing","setValue","showError","value_0","disabled","t7","t8","t9","filter","Boolean","t10","join","t11","t12","t13","t14","_jsxs","children","_jsx","Label","components","CustomError","Error","mappedComponent","beforeInput","id","replace","onChange","type","afterInput","Description","EmailField"],"sources":["../../../src/fields/Email/index.tsx"],"sourcesContent":["'use client'\nimport type {\n EmailFieldClientComponent,\n EmailFieldClientProps,\n EmailFieldValidation,\n} from 'payload'\n\nimport { getTranslation } from '@payloadcms/translations'\nimport React, { useCallback } from 'react'\n\nimport { useFieldProps } from '../../forms/FieldPropsProvider/index.js'\nimport { useField } from '../../forms/useField/index.js'\nimport { withCondition } from '../../forms/withCondition/index.js'\nimport { RenderComponent } from '../../providers/Config/RenderComponent.js'\nimport { useTranslation } from '../../providers/Translation/index.js'\nimport { FieldDescription } from '../FieldDescription/index.js'\nimport { FieldError } from '../FieldError/index.js'\nimport { FieldLabel } from '../FieldLabel/index.js'\nimport { fieldBaseClass } from '../shared/index.js'\nimport './index.scss'\n\nconst EmailFieldComponent: EmailFieldClientComponent = (props) => {\n const {\n autoComplete,\n descriptionProps,\n errorProps,\n field: {\n name,\n _path: pathFromProps,\n admin: {\n readOnly: readOnlyFromAdmin,\n\n className,\n description,\n placeholder,\n style,\n width,\n } = {} as EmailFieldClientProps['field']['admin'],\n label,\n required,\n } = {} as EmailFieldClientProps['field'],\n field,\n labelProps,\n readOnly: readOnlyFromTopLevelProps,\n validate,\n } = props\n\n const readOnlyFromProps = readOnlyFromTopLevelProps || readOnlyFromAdmin\n\n const { i18n } = useTranslation()\n\n const memoizedValidate: EmailFieldValidation = useCallback(\n (value, options) => {\n if (typeof validate === 'function') {\n return validate(value, { ...options, required })\n }\n },\n [validate, required],\n )\n\n const { path: pathFromContext, readOnly: readOnlyFromContext } = useFieldProps()\n\n const { formInitializing, formProcessing, path, setValue, showError, value } = useField({\n path: pathFromContext ?? pathFromProps ?? name,\n validate: memoizedValidate,\n })\n\n const disabled = readOnlyFromProps || readOnlyFromContext || formProcessing || formInitializing\n\n return (\n <div\n className={[fieldBaseClass, 'email', className, showError && 'error', disabled && 'read-only']\n .filter(Boolean)\n .join(' ')}\n style={{\n ...style,\n width,\n }}\n >\n <FieldLabel field={field} Label={field?.admin?.components?.Label} {...(labelProps || {})} />\n <div className={`${fieldBaseClass}__wrap`}>\n <FieldError\n CustomError={field?.admin?.components?.Error}\n field={field}\n path={path}\n {...(errorProps || {})}\n />\n <RenderComponent mappedComponent={field?.admin?.components?.beforeInput} />\n {/* disable eslint here because the label is dynamic */}\n {/* eslint-disable-next-line jsx-a11y/control-has-associated-label */}\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 required={required}\n type=\"email\"\n value={(value as string) || ''}\n />\n <RenderComponent mappedComponent={field?.admin?.components?.afterInput} />\n </div>\n <FieldDescription\n Description={field?.admin?.components?.Description}\n description={description}\n field={field}\n {...(descriptionProps || {})}\n />\n </div>\n )\n}\n\nexport const EmailField = withCondition(EmailFieldComponent)\n"],"mappings":"AAAA;;AAAA,SAAAA,CAAA,IAAAC,EAAA;;AAOA,SAASC,cAAc,QAAQ;AAC/B,OAAOC,KAAA,IAASC,WAAW,QAAQ;AAEnC,SAASC,aAAa,QAAQ;AAC9B,SAASC,QAAQ,QAAQ;AACzB,SAASC,aAAa,QAAQ;AAC9B,SAASC,eAAe,QAAQ;AAChC,SAASC,cAAc,QAAQ;AAC/B,SAASC,gBAAgB,QAAQ;AACjC,SAASC,UAAU,QAAQ;AAC3B,SAASC,UAAU,QAAQ;AAC3B,SAASC,cAAc,QAAQ;AAC/B,OAAO;AAEP,MAAMC,mBAAA,GAAiDC,KAAA;EAAA,MAAAC,CAAA,GAAAf,EAAA;EACrD;IAAAgB,YAAA;IAAAC,gBAAA;IAAAC,UAAA;IAAAC,KAAA,EAAAC,EAAA;IAAAD,KAAA;IAAAE,UAAA;IAAAC,QAAA,EAAAC,yBAAA;IAAAC;EAAA,IAuBIV,KAAA;EAAA,IAAAW,EAAA;EAAA,IAAAV,CAAA,QAAAK,EAAA;IAnBKK,EAAA,GAAAL,EAciC,KAAAM,SAAA,QAdjCN,EAciC;IAAAL,CAAA,MAAAK,EAAA;IAAAL,CAAA,MAAAU,EAAA;EAAA;IAAAA,EAAA,GAAAV,CAAA;EAAA;EAdjC;IAAAY,IAAA;IAAAC,KAAA,EAAAC,aAAA;IAAAC,KAAA,EAAAC,EAAA;IAAAC;EAAA,IAAAP,EAciC;EAAA,IAAAQ,EAAA;EAAA,IAAAlB,CAAA,QAAAgB,EAAA;IAX/BE,EAAA,GAAAF,EAQ0C,KAAAL,SAAA,QAR1CK,EAQ0C;IAAAhB,CA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AgD,IAAA,EAEpC;UAAArC,KAAA,EACEA,OAAC,IAAoB;QAAA,C,GAE9B2B,IAAA,CAAA/D,eAAA;UAAAoE,eAAA,EAAkCxD,KAAA,EAAAW,KAAA,EAAA0C,UAAA,EAAAS;QAAA,C;UAEpCX,IAAA,CAAA7D,gBAAA;QAAAyE,WAAA,EACe/D,KAAA,EAAAW,KAAA,EAAA0C,UAAA,EAAAU,WAAA;QAAA9C,WAAA;QAAAjB,KAAA;QAAA,GAGRgD;MAAsB,C;;;;;;;;;;;;;;;;;;;;;;SArC/BH,G;CAyCJ;AAEA,OAAO,MAAMmB,UAAA,GAAa7E,aAAA,CAAcO,mBAAA","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/fields/FieldLabel/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,yBAAyB,EAAqB,MAAM,SAAS,CAAA;AAW3E,OAAO,cAAc,CAAA;AA8BrB,eAAO,MAAM,UAAU,EAAE,yBAQxB,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/fields/FieldLabel/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,yBAAyB,EAAkC,MAAM,SAAS,CAAA;AAWxF,OAAO,cAAc,CAAA;AA8BrB,eAAO,MAAM,UAAU,EAAE,yBAwBxB,CAAA"}
@@ -86,6 +86,8 @@ export const FieldLabel = props => {
86
86
  Label,
87
87
  ...rest
88
88
  } = props;
89
+ // Don't get `Label` from `field.admin.components.Label` here because
90
+ // this will cause an infinite loop when threading field through custom usages of `FieldLabel`
89
91
  if (Label) {
90
92
  return /*#__PURE__*/_jsx(RenderComponent, {
91
93
  clientProps: rest,
@@ -93,7 +95,11 @@ export const FieldLabel = props => {
93
95
  });
94
96
  }
95
97
  return /*#__PURE__*/_jsx(DefaultFieldLabel, {
96
- ...rest
98
+ ...rest,
99
+ label: typeof props?.label !== 'undefined' ? props.label : props?.field && 'label' in props.field && props.field.label // type assertion needed for `row` fields
100
+ ,
101
+
102
+ required: typeof props.required !== 'undefined' ? props.required : props?.field && 'required' in props.field && props.field?.required // type assertion needed for `group` fields
97
103
  });
98
104
  };
99
105
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["c","_c","getTranslation","React","useFieldProps","useForm","RenderComponent","useEditDepth","useTranslation","generateFieldID","DefaultFieldLabel","props","$","as","t0","htmlFor","htmlForFromProps","label","labelFromProps","required","t1","unstyled","t2","Element","undefined","uuid","path","editDepth","t3","i18n","t4","t5","t6","_jsx","className","children","_jsxs","FieldLabel","Label","rest","clientProps","mappedComponent"],"sources":["../../../src/fields/FieldLabel/index.tsx"],"sourcesContent":["'use client'\n\nimport type { FieldLabelClientComponent, GenericLabelProps } from 'payload'\n\nimport { getTranslation } from '@payloadcms/translations'\nimport React from 'react'\n\nimport { useFieldProps } from '../../forms/FieldPropsProvider/index.js'\nimport { useForm } from '../../forms/Form/context.js'\nimport { RenderComponent } from '../../providers/Config/RenderComponent.js'\nimport { useEditDepth } from '../../providers/EditDepth/index.js'\nimport { useTranslation } from '../../providers/Translation/index.js'\nimport { generateFieldID } from '../../utilities/generateFieldID.js'\nimport './index.scss'\n\nconst DefaultFieldLabel: React.FC<GenericLabelProps> = (props) => {\n const {\n as: Element = 'label',\n htmlFor: htmlForFromProps,\n label: labelFromProps,\n required = false,\n unstyled = false,\n } = props\n\n const { uuid } = useForm()\n const { path } = useFieldProps()\n const editDepth = useEditDepth()\n const htmlFor = htmlForFromProps || generateFieldID(path, editDepth, uuid)\n\n const { i18n } = useTranslation()\n\n if (labelFromProps) {\n return (\n <Element className={`field-label ${unstyled ? 'unstyled' : ''}`} htmlFor={htmlFor}>\n {getTranslation(labelFromProps, i18n)}\n {required && !unstyled && <span className=\"required\">*</span>}\n </Element>\n )\n }\n\n return null\n}\n\nexport const FieldLabel: FieldLabelClientComponent = (props) => {\n const { Label, ...rest } = props\n\n if (Label) {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IAAAA,EAAA,GAAAhB,CAAA;EAAA;EAArE,MAAAG,OAAA,GAAgBa,EAAqD;EAErE;IAAAC;EAAA,IAAiBrB,cAAA;EAAA,IAEbU,cAAA;IAEoB,MAAAY,EAAA,kBAAeT,QAAA,GAAW,aAAa,IAAI;IAAA,IAAAU,EAAA;IAAA,IAAAnB,CAAA,QAAAM,cAAA,IAAAN,CAAA,QAAAiB,IAAA,IAAAjB,CAAA,QAAAO,QAAA,IAAAP,CAAA,QAAAS,QAAA,IAAAT,CAAA,QAAAkB,EAAA,IAAAlB,CAAA,SAAAG,OAAA,IAAAH,CAAA,SAAAW,OAAA;MAAA,IAAAS,EAAA;MAAA,IAAApB,CAAA,SAAAO,QAAA,IAAAP,CAAA,SAAAS,QAAA;QAE5DW,EAAA,GAAAb,QAAA,KAAaE,QAAA,IAAYY,IAAA,CAAC;UAAAC,SAAA,EAAe;UAAAC,QAAA,EAAW;QAAA,C;;;;;;;MAFvDJ,EAAA,GAAAK,KAAA,CAACb,OAAA;QAAAW,SAAA,EAAmBJ,EAA2C;QAAAf,OAAA;QAAAoB,QAAA,GAC5DjC,cAAA,CAAegB,cAAA,EAAgBW,IAAA,GAC/BG,E;;;;;;;;;;;;;WAFHD,E;;;CAQN;AAEA,OAAO,MAAMM,UAAA,GAAyC1B,KAAA;EACpD,MAAM;IAAE2B,KAAK;IAAE,GAAGC;EAAA,CAAM,GAAG5B,KAAA;EAE3B,IAAI2B,KAAA,EAAO;IACT,oBAAOL,IAAA,CAAC3B,eAAA;MAAgBkC,WAAA,EAAaD,IAAA;MAAME,eAAA,EAAiBH;;EAC9D;EAEA,oBAAOL,IAAA,CAACvB,iBAAA;IAAmB,GAAG6B;;AAChC","ignoreList":[]}
1
+ {"version":3,"file":"index.js","names":["c","_c","getTranslation","React","useFieldProps","useForm","RenderComponent","useEditDepth","useTranslation","generateFieldID","DefaultFieldLabel","props","$","as","t0","htmlFor","htmlForFromProps","label","labelFromProps","required","t1","unstyled","t2","Element","undefined","uuid","path","editDepth","t3","i18n","t4","t5","t6","_jsx","className","children","_jsxs","FieldLabel","Label","rest","clientProps","mappedComponent","field"],"sources":["../../../src/fields/FieldLabel/index.tsx"],"sourcesContent":["'use client'\n\nimport type { FieldLabelClientComponent, GenericLabelProps, StaticLabel } from 'payload'\n\nimport { getTranslation } from '@payloadcms/translations'\nimport React from 'react'\n\nimport { useFieldProps } from '../../forms/FieldPropsProvider/index.js'\nimport { useForm } from '../../forms/Form/context.js'\nimport { RenderComponent } from '../../providers/Config/RenderComponent.js'\nimport { useEditDepth } from '../../providers/EditDepth/index.js'\nimport { useTranslation } from '../../providers/Translation/index.js'\nimport { generateFieldID } from '../../utilities/generateFieldID.js'\nimport './index.scss'\n\nconst DefaultFieldLabel: React.FC<GenericLabelProps> = (props) => {\n const {\n as: Element = 'label',\n htmlFor: htmlForFromProps,\n label: labelFromProps,\n required = false,\n unstyled = false,\n } = props\n\n const { uuid } = useForm()\n const { path } = useFieldProps()\n const editDepth = useEditDepth()\n const htmlFor = htmlForFromProps || generateFieldID(path, editDepth, uuid)\n\n const { i18n } = useTranslation()\n\n if (labelFromProps) {\n return (\n <Element className={`field-label ${unstyled ? 'unstyled' : ''}`} htmlFor={htmlFor}>\n {getTranslation(labelFromProps, i18n)}\n {required && !unstyled && <span className=\"required\">*</span>}\n </Element>\n )\n }\n\n return null\n}\n\nexport const FieldLabel: FieldLabelClientComponent = (props) => {\n const { Label, ...rest } = props\n\n // Don't get `Label` from `field.admin.components.Label` here because\n // this will cause an infinite loop when threading field through custom usages of `FieldLabel`\n if (Label) {\n return <RenderComponent clientProps={rest} mappedComponent={Label} />\n }\n\n return (\n <DefaultFieldLabel\n {...rest}\n label={\n typeof props?.label !== 'undefined'\n ? props.label\n : props?.field && 'label' in props.field && (props.field.label as StaticLabel) // type assertion needed for `row` fields\n }\n required={\n typeof props.required !== 'undefined'\n ? props.required\n : props?.field && 'required' in props.field && (props.field?.required as boolean) // type assertion needed for `group` fields\n }\n />\n )\n}\n"],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,cACtBR,KAAA,CAAMQ,QAAQ,GACdR,KAAA,EAAO+B,KAAA,IAAS,cAAc/B,KAAA,CAAM+B,KAAK,IAAK/B,KAAA,CAAM+B,KAAK,EAAEvB,QAAA,CAAqB;;AAI5F","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/fields/JSON/index.tsx"],"names":[],"mappings":"AAGA,OAAO,KAA2C,MAAM,OAAO,CAAA;AAO/D,OAAO,cAAc,CAAA;AAgKrB,eAAO,MAAM,SAAS;;;;;;;oCAAoC,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/fields/JSON/index.tsx"],"names":[],"mappings":"AAGA,OAAO,KAA2C,MAAM,OAAO,CAAA;AAO/D,OAAO,cAAc,CAAA;AA0JrB,eAAO,MAAM,SAAS;;;;;;;oCAAoC,CAAA"}
@@ -110,8 +110,6 @@ const JSONFieldComponent = props => {
110
110
  children: [/*#__PURE__*/_jsx(FieldLabel, {
111
111
  field: field,
112
112
  Label: field?.admin?.components?.Label,
113
- label: label,
114
- required: required,
115
113
  ...(labelProps || {})
116
114
  }), /*#__PURE__*/_jsxs("div", {
117
115
  className: `${fieldBaseClass}__wrap`,
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["React","useCallback","useEffect","useState","CodeEditor","useField","withCondition","FieldLabel","fieldBaseClass","baseClass","useFieldProps","RenderComponent","FieldDescription","FieldError","JSONFieldComponent","props","descriptionProps","errorProps","field","name","_path","pathFromProps","admin","className","description","editorOptions","readOnly","readOnlyFromAdmin","style","width","jsonSchema","label","required","labelProps","readOnlyFromTopLevelProps","validate","readOnlyFromProps","stringValue","setStringValue","jsonError","setJsonError","hasLoadedValue","setHasLoadedValue","memoizedValidate","value","options","path","pathFromContext","readOnlyFromContext","formInitializing","formProcessing","initialValue","setValue","showError","disabled","handleMount","editor","monaco","existingSchemas","languages","json","jsonDefaults","diagnosticsOptions","schemas","modelUri","Uri","parse","uri","model","createModel","JSON","stringify","setDiagnosticsOptions","enableSchemaRequest","setModel","handleChange","val","undefined","e","_jsxs","filter","Boolean","join","_jsx","Label","components","CustomError","Error","mappedComponent","beforeInput","defaultLanguage","onChange","onMount","afterInput","Description","JSONField"],"sources":["../../../src/fields/JSON/index.tsx"],"sourcesContent":["'use client'\nimport type { JSONFieldClientComponent } from 'payload'\n\nimport React, { useCallback, useEffect, useState } from 'react'\n\nimport { CodeEditor } from '../../elements/CodeEditor/index.js'\nimport { useField } from '../../forms/useField/index.js'\nimport { withCondition } from '../../forms/withCondition/index.js'\nimport { FieldLabel } from '../FieldLabel/index.js'\nimport { fieldBaseClass } from '../shared/index.js'\nimport './index.scss'\n\nconst baseClass = 'json-field'\n\nimport { useFieldProps } from '../../forms/FieldPropsProvider/index.js'\nimport { RenderComponent } from '../../providers/Config/RenderComponent.js'\nimport { FieldDescription } from '../FieldDescription/index.js'\nimport { FieldError } from '../FieldError/index.js'\n\nconst JSONFieldComponent: JSONFieldClientComponent = (props) => {\n const {\n descriptionProps,\n errorProps,\n field,\n field: {\n name,\n _path: pathFromProps,\n admin: {\n className,\n description,\n editorOptions,\n readOnly: readOnlyFromAdmin,\n style,\n width,\n } = {},\n jsonSchema,\n label,\n required,\n },\n labelProps,\n readOnly: readOnlyFromTopLevelProps,\n validate,\n } = props\n const readOnlyFromProps = readOnlyFromTopLevelProps || readOnlyFromAdmin\n\n const [stringValue, setStringValue] = useState<string>()\n const [jsonError, setJsonError] = useState<string>()\n const [hasLoadedValue, setHasLoadedValue] = useState(false)\n\n const memoizedValidate = useCallback(\n (value, options) => {\n if (typeof validate === 'function') {\n return validate(value, { ...options, jsonError, required })\n }\n },\n [validate, required, jsonError],\n )\n\n const { path: pathFromContext, readOnly: readOnlyFromContext } = useFieldProps()\n\n const { formInitializing, formProcessing, initialValue, path, setValue, showError, value } =\n useField<string>({\n path: pathFromContext ?? pathFromProps ?? name,\n validate: memoizedValidate,\n })\n\n const disabled = readOnlyFromProps || readOnlyFromContext || formProcessing || formInitializing\n\n const handleMount = useCallback(\n (editor, monaco) => {\n if (!jsonSchema) {\n return\n }\n\n const existingSchemas = monaco.languages.json.jsonDefaults.diagnosticsOptions.schemas || []\n const modelUri = monaco.Uri.parse(jsonSchema.uri)\n\n const model = monaco.editor.createModel(JSON.stringify(value, null, 2), 'json', modelUri)\n monaco.languages.json.jsonDefaults.setDiagnosticsOptions({\n enableSchemaRequest: true,\n schemas: [...existingSchemas, jsonSchema],\n validate: true,\n })\n\n editor.setModel(model)\n },\n [jsonSchema, value],\n )\n\n const handleChange = useCallback(\n (val) => {\n if (disabled) {\n return\n }\n setStringValue(val)\n\n try {\n setValue(val ? JSON.parse(val) : null)\n setJsonError(undefined)\n } catch (e) {\n setValue(val ? val : null)\n setJsonError(e)\n }\n },\n [disabled, setValue, setStringValue],\n )\n\n useEffect(() => {\n if (hasLoadedValue || value === undefined) {\n return\n }\n\n setStringValue(\n value || initialValue ? JSON.stringify(value ? value : initialValue, null, 2) : '',\n )\n\n setHasLoadedValue(true)\n }, [initialValue, value, hasLoadedValue])\n\n return (\n <div\n className={[\n fieldBaseClass,\n baseClass,\n className,\n showError && 'error',\n disabled && 'read-only',\n ]\n .filter(Boolean)\n .join(' ')}\n style={{\n ...style,\n width,\n }}\n >\n <FieldLabel\n field={field}\n Label={field?.admin?.components?.Label}\n label={label}\n required={required}\n {...(labelProps || {})}\n />\n <div className={`${fieldBaseClass}__wrap`}>\n <FieldError\n CustomError={field?.admin?.components?.Error}\n field={field}\n path={path}\n {...(errorProps || {})}\n />\n <RenderComponent mappedComponent={field?.admin?.components?.beforeInput} />\n <CodeEditor\n defaultLanguage=\"json\"\n onChange={handleChange}\n onMount={handleMount}\n options={editorOptions}\n readOnly={disabled}\n value={stringValue}\n />\n <RenderComponent mappedComponent={field?.admin?.components?.afterInput} />\n </div>\n <FieldDescription\n Description={field?.admin?.components?.Description}\n description={description}\n field={field}\n {...(descriptionProps || {})}\n />\n </div>\n )\n}\n\nexport const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AAI7B,UAAA,IAAc,CAAC,CAAC;uBAEvBkE,IAAA,CAACxE,eAAA;QAAgB6E,eAAA,EAAiBtE,KAAA,EAAOI,KAAA,EAAO+D,UAAA,EAAYI;uBAC5DN,IAAA,CAAC/E,UAAA;QACCsF,eAAA,EAAgB;QAChBC,QAAA,EAAUhB,YAAA;QACViB,OAAA,EAASrC,WAAA;QACTV,OAAA,EAASpB,aAAA;QACTC,QAAA,EAAU4B,QAAA;QACVV,KAAA,EAAOP;uBAET8C,IAAA,CAACxE,eAAA;QAAgB6E,eAAA,EAAiBtE,KAAA,EAAOI,KAAA,EAAO+D,UAAA,EAAYQ;;qBAE9DV,IAAA,CAACvE,gBAAA;MACCkF,WAAA,EAAa5E,KAAA,EAAOI,KAAA,EAAO+D,UAAA,EAAYS,WAAA;MACvCtE,WAAA,EAAaA,WAAA;MACbN,KAAA,EAAOA,KAAA;MACN,IAAIF,gBAAA,IAAoB,CAAC,CAAC;;;AAInC;AAEA,OAAO,MAAM+E,SAAA,GAAYzF,aAAA,CAAcQ,kBAAA","ignoreList":[]}
1
+ {"version":3,"file":"index.js","names":["React","useCallback","useEffect","useState","CodeEditor","useField","withCondition","FieldLabel","fieldBaseClass","baseClass","useFieldProps","RenderComponent","FieldDescription","FieldError","JSONFieldComponent","props","descriptionProps","errorProps","field","name","_path","pathFromProps","admin","className","description","editorOptions","readOnly","readOnlyFromAdmin","style","width","jsonSchema","label","required","labelProps","readOnlyFromTopLevelProps","validate","readOnlyFromProps","stringValue","setStringValue","jsonError","setJsonError","hasLoadedValue","setHasLoadedValue","memoizedValidate","value","options","path","pathFromContext","readOnlyFromContext","formInitializing","formProcessing","initialValue","setValue","showError","disabled","handleMount","editor","monaco","existingSchemas","languages","json","jsonDefaults","diagnosticsOptions","schemas","modelUri","Uri","parse","uri","model","createModel","JSON","stringify","setDiagnosticsOptions","enableSchemaRequest","setModel","handleChange","val","undefined","e","_jsxs","filter","Boolean","join","_jsx","Label","components","CustomError","Error","mappedComponent","beforeInput","defaultLanguage","onChange","onMount","afterInput","Description","JSONField"],"sources":["../../../src/fields/JSON/index.tsx"],"sourcesContent":["'use client'\nimport type { JSONFieldClientComponent } from 'payload'\n\nimport React, { useCallback, useEffect, useState } from 'react'\n\nimport { CodeEditor } from '../../elements/CodeEditor/index.js'\nimport { useField } from '../../forms/useField/index.js'\nimport { withCondition } from '../../forms/withCondition/index.js'\nimport { FieldLabel } from '../FieldLabel/index.js'\nimport { fieldBaseClass } from '../shared/index.js'\nimport './index.scss'\n\nconst baseClass = 'json-field'\n\nimport { useFieldProps } from '../../forms/FieldPropsProvider/index.js'\nimport { RenderComponent } from '../../providers/Config/RenderComponent.js'\nimport { FieldDescription } from '../FieldDescription/index.js'\nimport { FieldError } from '../FieldError/index.js'\n\nconst JSONFieldComponent: JSONFieldClientComponent = (props) => {\n const {\n descriptionProps,\n errorProps,\n field,\n field: {\n name,\n _path: pathFromProps,\n admin: {\n className,\n description,\n editorOptions,\n readOnly: readOnlyFromAdmin,\n style,\n width,\n } = {},\n jsonSchema,\n label,\n required,\n },\n labelProps,\n readOnly: readOnlyFromTopLevelProps,\n validate,\n } = props\n const readOnlyFromProps = readOnlyFromTopLevelProps || readOnlyFromAdmin\n\n const [stringValue, setStringValue] = useState<string>()\n const [jsonError, setJsonError] = useState<string>()\n const [hasLoadedValue, setHasLoadedValue] = useState(false)\n\n const memoizedValidate = useCallback(\n (value, options) => {\n if (typeof validate === 'function') {\n return validate(value, { ...options, jsonError, required })\n }\n },\n [validate, required, jsonError],\n )\n\n const { path: pathFromContext, readOnly: readOnlyFromContext } = useFieldProps()\n\n const { formInitializing, formProcessing, initialValue, path, setValue, showError, value } =\n useField<string>({\n path: pathFromContext ?? pathFromProps ?? name,\n validate: memoizedValidate,\n })\n\n const disabled = readOnlyFromProps || readOnlyFromContext || formProcessing || formInitializing\n\n const handleMount = useCallback(\n (editor, monaco) => {\n if (!jsonSchema) {\n return\n }\n\n const existingSchemas = monaco.languages.json.jsonDefaults.diagnosticsOptions.schemas || []\n const modelUri = monaco.Uri.parse(jsonSchema.uri)\n\n const model = monaco.editor.createModel(JSON.stringify(value, null, 2), 'json', modelUri)\n monaco.languages.json.jsonDefaults.setDiagnosticsOptions({\n enableSchemaRequest: true,\n schemas: [...existingSchemas, jsonSchema],\n validate: true,\n })\n\n editor.setModel(model)\n },\n [jsonSchema, value],\n )\n\n const handleChange = useCallback(\n (val) => {\n if (disabled) {\n return\n }\n setStringValue(val)\n\n try {\n setValue(val ? JSON.parse(val) : null)\n setJsonError(undefined)\n } catch (e) {\n setValue(val ? val : null)\n setJsonError(e)\n }\n },\n [disabled, setValue, setStringValue],\n )\n\n useEffect(() => {\n if (hasLoadedValue || value === undefined) {\n return\n }\n\n setStringValue(\n value || initialValue ? JSON.stringify(value ? value : initialValue, null, 2) : '',\n )\n\n setHasLoadedValue(true)\n }, [initialValue, value, hasLoadedValue])\n\n return (\n <div\n className={[\n fieldBaseClass,\n baseClass,\n className,\n showError && 'error',\n disabled && 'read-only',\n ]\n .filter(Boolean)\n .join(' ')}\n style={{\n ...style,\n width,\n }}\n >\n <FieldLabel field={field} Label={field?.admin?.components?.Label} {...(labelProps || {})} />\n <div className={`${fieldBaseClass}__wrap`}>\n <FieldError\n CustomError={field?.admin?.components?.Error}\n field={field}\n path={path}\n {...(errorProps || {})}\n />\n <RenderComponent mappedComponent={field?.admin?.components?.beforeInput} />\n <CodeEditor\n defaultLanguage=\"json\"\n onChange={handleChange}\n onMount={handleMount}\n options={editorOptions}\n readOnly={disabled}\n value={stringValue}\n />\n <RenderComponent mappedComponent={field?.admin?.components?.afterInput} />\n </div>\n <FieldDescription\n Description={field?.admin?.components?.Description}\n description={description}\n field={field}\n {...(descriptionProps || {})}\n />\n </div>\n )\n}\n\nexport const JSONField = withCondition(JSONFieldComponent)\n"],"mappings":"AAAA;;;AAGA,OAAOA,KAAA,IAASC,WAAW,EAAEC,SAAS,EAAEC,QAAQ,QAAQ;AAExD,SAASC,UAAU,QAAQ;AAC3B,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AAUhB,YAAA;QACViB,OAAA,EAASrC,WAAA;QACTV,OAAA,EAASpB,aAAA;QACTC,QAAA,EAAU4B,QAAA;QACVV,KAAA,EAAOP;uBAET8C,IAAA,CAACxE,eAAA;QAAgB6E,eAAA,EAAiBtE,KAAA,EAAOI,KAAA,EAAO+D,UAAA,EAAYQ;;qBAE9DV,IAAA,CAACvE,gBAAA;MACCkF,WAAA,EAAa5E,KAAA,EAAOI,KAAA,EAAO+D,UAAA,EAAYS,WAAA;MACvCtE,WAAA,EAAaA,WAAA;MACbN,KAAA,EAAOA,KAAA;MACN,IAAIF,gBAAA,IAAoB,CAAC,CAAC;;;AAInC;AAEA,OAAO,MAAM+E,SAAA,GAAYzF,aAAA,CAAcQ,kBAAA","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/fields/Number/index.tsx"],"names":[],"mappings":"AAKA,OAAO,KAA2C,MAAM,OAAO,CAAA;AAc/D,OAAO,cAAc,CAAA;AA2MrB,eAAO,MAAM,WAAW;;;;;;;;oCAAsC,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/fields/Number/index.tsx"],"names":[],"mappings":"AAKA,OAAO,KAA2C,MAAM,OAAO,CAAA;AAc/D,OAAO,cAAc,CAAA;AAqMrB,eAAO,MAAM,WAAW;;;;;;;;oCAAsC,CAAA"}
@@ -17,7 +17,7 @@ import { FieldLabel } from '../FieldLabel/index.js';
17
17
  import { fieldBaseClass } from '../shared/index.js';
18
18
  import './index.scss';
19
19
  const NumberFieldComponent = props => {
20
- const $ = _c(58);
20
+ const $ = _c(56);
21
21
  const {
22
22
  descriptionProps,
23
23
  errorProps,
@@ -33,7 +33,6 @@ const NumberFieldComponent = props => {
33
33
  _path: pathFromProps,
34
34
  admin: t1,
35
35
  hasMany: t2,
36
- label,
37
36
  max: t3,
38
37
  maxRows: t4,
39
38
  min: t5,
@@ -206,30 +205,30 @@ const NumberFieldComponent = props => {
206
205
  }
207
206
  const t20 = t19.join(" ");
208
207
  let t21;
209
- if ($[26] !== style || $[27] !== width || $[28] !== field || $[29] !== labelProps || $[30] !== label || $[31] !== required || $[32] !== errorProps || $[33] !== path || $[34] !== hasMany || $[35] !== value_0 || $[36] !== maxRows || $[37] !== t || $[38] !== disabled || $[39] !== handleHasManyChange || $[40] !== showError || $[41] !== valueToRender || $[42] !== placeholder || $[43] !== i18n || $[44] !== max || $[45] !== min || $[46] !== handleChange || $[47] !== step || $[48] !== descriptionProps || $[49] !== description || $[50] !== t20) {
208
+ if ($[26] !== style || $[27] !== width || $[28] !== field || $[29] !== labelProps || $[30] !== errorProps || $[31] !== path || $[32] !== hasMany || $[33] !== value_0 || $[34] !== maxRows || $[35] !== t || $[36] !== disabled || $[37] !== handleHasManyChange || $[38] !== showError || $[39] !== valueToRender || $[40] !== placeholder || $[41] !== i18n || $[42] !== max || $[43] !== min || $[44] !== handleChange || $[45] !== step || $[46] !== descriptionProps || $[47] !== description || $[48] !== t20) {
210
209
  let t22;
211
- if ($[52] !== labelProps) {
210
+ if ($[50] !== labelProps) {
212
211
  t22 = labelProps || {};
213
- $[52] = labelProps;
214
- $[53] = t22;
212
+ $[50] = labelProps;
213
+ $[51] = t22;
215
214
  } else {
216
- t22 = $[53];
215
+ t22 = $[51];
217
216
  }
218
217
  let t23;
219
- if ($[54] !== errorProps) {
218
+ if ($[52] !== errorProps) {
220
219
  t23 = errorProps || {};
221
- $[54] = errorProps;
222
- $[55] = t23;
220
+ $[52] = errorProps;
221
+ $[53] = t23;
223
222
  } else {
224
- t23 = $[55];
223
+ t23 = $[53];
225
224
  }
226
225
  let t24;
227
- if ($[56] !== descriptionProps) {
226
+ if ($[54] !== descriptionProps) {
228
227
  t24 = descriptionProps || {};
229
- $[56] = descriptionProps;
230
- $[57] = t24;
228
+ $[54] = descriptionProps;
229
+ $[55] = t24;
231
230
  } else {
232
- t24 = $[57];
231
+ t24 = $[55];
233
232
  }
234
233
  t21 = _jsxs("div", {
235
234
  className: t20,
@@ -240,8 +239,6 @@ const NumberFieldComponent = props => {
240
239
  children: [_jsx(FieldLabel, {
241
240
  field,
242
241
  Label: field?.admin?.components?.Label,
243
- label,
244
- required,
245
242
  ...t22
246
243
  }), _jsxs("div", {
247
244
  className: `${fieldBaseClass}__wrap`,
@@ -306,30 +303,28 @@ const NumberFieldComponent = props => {
306
303
  $[27] = width;
307
304
  $[28] = field;
308
305
  $[29] = labelProps;
309
- $[30] = label;
310
- $[31] = required;
311
- $[32] = errorProps;
312
- $[33] = path;
313
- $[34] = hasMany;
314
- $[35] = value_0;
315
- $[36] = maxRows;
316
- $[37] = t;
317
- $[38] = disabled;
318
- $[39] = handleHasManyChange;
319
- $[40] = showError;
320
- $[41] = valueToRender;
321
- $[42] = placeholder;
322
- $[43] = i18n;
323
- $[44] = max;
324
- $[45] = min;
325
- $[46] = handleChange;
326
- $[47] = step;
327
- $[48] = descriptionProps;
328
- $[49] = description;
329
- $[50] = t20;
330
- $[51] = t21;
306
+ $[30] = errorProps;
307
+ $[31] = path;
308
+ $[32] = hasMany;
309
+ $[33] = value_0;
310
+ $[34] = maxRows;
311
+ $[35] = t;
312
+ $[36] = disabled;
313
+ $[37] = handleHasManyChange;
314
+ $[38] = showError;
315
+ $[39] = valueToRender;
316
+ $[40] = placeholder;
317
+ $[41] = i18n;
318
+ $[42] = max;
319
+ $[43] = min;
320
+ $[44] = handleChange;
321
+ $[45] = step;
322
+ $[46] = descriptionProps;
323
+ $[47] = description;
324
+ $[48] = t20;
325
+ $[49] = t21;
331
326
  } else {
332
- t21 = $[51];
327
+ t21 = $[49];
333
328
  }
334
329
  return t21;
335
330
  };