@payloadcms/ui 3.0.0-beta.133 → 3.0.0-beta.135
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.
- package/dist/assets/payload-favicon-dark.png +0 -0
- package/dist/assets/payload-favicon-light.png +0 -0
- package/dist/assets/payload-favicon.svg +4 -4
- package/dist/assets/payload-logo-dark.svg +1 -23
- package/dist/assets/payload-logo-light.svg +1 -23
- package/dist/assets/static-og-image.png +0 -0
- package/dist/elements/RelationshipTable/index.d.ts +1 -0
- package/dist/elements/RelationshipTable/index.d.ts.map +1 -1
- package/dist/elements/RelationshipTable/index.js +3 -2
- package/dist/elements/RelationshipTable/index.js.map +1 -1
- package/dist/elements/RenderServerComponent/index.d.ts +0 -6
- package/dist/elements/RenderServerComponent/index.d.ts.map +1 -1
- package/dist/elements/RenderServerComponent/index.js +1 -24
- package/dist/elements/RenderServerComponent/index.js.map +1 -1
- package/dist/elements/WhereBuilder/Condition/DefaultFilter/index.js +1 -1
- package/dist/elements/WhereBuilder/Condition/DefaultFilter/index.js.map +1 -1
- package/dist/exports/client/index.js +22 -22
- package/dist/exports/client/index.js.map +4 -4
- package/dist/exports/shared/index.d.ts +1 -0
- package/dist/exports/shared/index.d.ts.map +1 -1
- package/dist/exports/shared/index.js +2 -2
- package/dist/exports/shared/index.js.map +4 -4
- package/dist/fields/Checkbox/index.d.ts.map +1 -1
- package/dist/fields/Checkbox/index.js +71 -183
- package/dist/fields/Checkbox/index.js.map +1 -1
- package/dist/fields/Code/index.d.ts.map +1 -1
- package/dist/fields/Code/index.js +68 -170
- package/dist/fields/Code/index.js.map +1 -1
- package/dist/fields/Collapsible/index.d.ts.map +1 -1
- package/dist/fields/Collapsible/index.js +100 -207
- package/dist/fields/Collapsible/index.js.map +1 -1
- package/dist/fields/DateTime/index.d.ts.map +1 -1
- package/dist/fields/DateTime/index.js +72 -162
- package/dist/fields/DateTime/index.js.map +1 -1
- package/dist/fields/Email/index.d.ts.map +1 -1
- package/dist/fields/Email/index.js +72 -161
- package/dist/fields/Email/index.js.map +1 -1
- package/dist/fields/Group/index.d.ts.map +1 -1
- package/dist/fields/Group/index.js +64 -152
- package/dist/fields/Group/index.js.map +1 -1
- package/dist/fields/JSON/index.d.ts.map +1 -1
- package/dist/fields/JSON/index.js +7 -10
- package/dist/fields/JSON/index.js.map +1 -1
- package/dist/fields/Join/index.d.ts.map +1 -1
- package/dist/fields/Join/index.js +5 -2
- package/dist/fields/Join/index.js.map +1 -1
- package/dist/fields/Number/index.d.ts.map +1 -1
- package/dist/fields/Number/index.js +143 -275
- package/dist/fields/Number/index.js.map +1 -1
- package/dist/fields/Password/index.d.ts.map +1 -1
- package/dist/fields/Password/index.js +79 -166
- package/dist/fields/Password/index.js.map +1 -1
- package/dist/fields/Point/index.d.ts.map +1 -1
- package/dist/fields/Point/index.js +110 -235
- package/dist/fields/Point/index.js.map +1 -1
- package/dist/fields/RadioGroup/index.d.ts.map +1 -1
- package/dist/fields/RadioGroup/index.js +93 -209
- package/dist/fields/RadioGroup/index.js.map +1 -1
- package/dist/fields/Relationship/index.d.ts.map +1 -1
- package/dist/fields/Relationship/index.js +7 -10
- package/dist/fields/Relationship/index.js.map +1 -1
- package/dist/fields/Select/Input.d.ts +0 -1
- package/dist/fields/Select/Input.d.ts.map +1 -1
- package/dist/fields/Select/Input.js +45 -50
- package/dist/fields/Select/Input.js.map +1 -1
- package/dist/fields/Select/index.d.ts.map +1 -1
- package/dist/fields/Select/index.js +7 -7
- package/dist/fields/Select/index.js.map +1 -1
- package/dist/fields/Text/Input.d.ts.map +1 -1
- package/dist/fields/Text/Input.js +31 -36
- package/dist/fields/Text/Input.js.map +1 -1
- package/dist/fields/Text/index.d.ts +1 -1
- package/dist/fields/Text/index.d.ts.map +1 -1
- package/dist/fields/Text/index.js +93 -171
- package/dist/fields/Text/index.js.map +1 -1
- package/dist/fields/Text/types.d.ts +0 -1
- package/dist/fields/Text/types.d.ts.map +1 -1
- package/dist/fields/Text/types.js.map +1 -1
- package/dist/fields/Textarea/Input.d.ts.map +1 -1
- package/dist/fields/Textarea/Input.js +26 -31
- package/dist/fields/Textarea/Input.js.map +1 -1
- package/dist/fields/Textarea/index.d.ts.map +1 -1
- package/dist/fields/Textarea/index.js +62 -112
- package/dist/fields/Textarea/index.js.map +1 -1
- package/dist/fields/Textarea/types.d.ts +0 -1
- package/dist/fields/Textarea/types.d.ts.map +1 -1
- package/dist/fields/Textarea/types.js.map +1 -1
- package/dist/fields/Upload/Input.d.ts +0 -1
- package/dist/fields/Upload/Input.d.ts.map +1 -1
- package/dist/fields/Upload/Input.js +41 -46
- package/dist/fields/Upload/Input.js.map +1 -1
- package/dist/fields/Upload/index.d.ts.map +1 -1
- package/dist/fields/Upload/index.js +63 -135
- package/dist/fields/Upload/index.js.map +1 -1
- package/dist/fields/mergeFieldStyles.d.ts +3 -0
- package/dist/fields/mergeFieldStyles.d.ts.map +1 -0
- package/dist/fields/mergeFieldStyles.js +13 -0
- package/dist/fields/mergeFieldStyles.js.map +1 -0
- package/dist/forms/Form/index.d.ts.map +1 -1
- package/dist/forms/Form/index.js +3 -3
- package/dist/forms/Form/index.js.map +1 -1
- package/dist/forms/Submit/index.d.ts.map +1 -1
- package/dist/forms/Submit/index.js +7 -2
- package/dist/forms/Submit/index.js.map +1 -1
- package/dist/forms/fieldSchemasToFormState/addFieldStatePromise.d.ts.map +1 -1
- package/dist/forms/fieldSchemasToFormState/addFieldStatePromise.js +3 -0
- package/dist/forms/fieldSchemasToFormState/addFieldStatePromise.js.map +1 -1
- package/dist/forms/fieldSchemasToFormState/renderField.d.ts.map +1 -1
- package/dist/forms/fieldSchemasToFormState/renderField.js +40 -9
- package/dist/forms/fieldSchemasToFormState/renderField.js.map +1 -1
- package/dist/forms/fieldSchemasToFormState/types.d.ts +4 -1
- package/dist/forms/fieldSchemasToFormState/types.d.ts.map +1 -1
- package/dist/forms/fieldSchemasToFormState/types.js.map +1 -1
- package/dist/graphics/Icon/index.d.ts.map +1 -1
- package/dist/graphics/Icon/index.js +2 -2
- package/dist/graphics/Icon/index.js.map +1 -1
- package/dist/graphics/Logo/index.d.ts.map +1 -1
- package/dist/graphics/Logo/index.js +30 -21
- package/dist/graphics/Logo/index.js.map +1 -1
- package/dist/utilities/buildFormState.d.ts +0 -4
- package/dist/utilities/buildFormState.d.ts.map +1 -1
- package/dist/utilities/buildFormState.js +1 -15
- package/dist/utilities/buildFormState.js.map +1 -1
- package/dist/utilities/buildTableState.d.ts +2 -1
- package/dist/utilities/buildTableState.d.ts.map +1 -1
- package/dist/utilities/buildTableState.js +7 -4
- package/dist/utilities/buildTableState.js.map +1 -1
- package/package.json +15 -5
|
@@ -12,7 +12,7 @@ import { useTranslation } from '../../providers/Translation/index.js';
|
|
|
12
12
|
import { fieldBaseClass } from '../shared/index.js';
|
|
13
13
|
import './index.scss';
|
|
14
14
|
export const TextareaInput = props => {
|
|
15
|
-
const $ = _c(
|
|
15
|
+
const $ = _c(25);
|
|
16
16
|
const {
|
|
17
17
|
AfterInput,
|
|
18
18
|
BeforeInput,
|
|
@@ -32,8 +32,7 @@ export const TextareaInput = props => {
|
|
|
32
32
|
rtl,
|
|
33
33
|
showError,
|
|
34
34
|
style,
|
|
35
|
-
value
|
|
36
|
-
width
|
|
35
|
+
value
|
|
37
36
|
} = props;
|
|
38
37
|
const {
|
|
39
38
|
i18n
|
|
@@ -52,13 +51,10 @@ export const TextareaInput = props => {
|
|
|
52
51
|
}
|
|
53
52
|
const t3 = t2.join(" ");
|
|
54
53
|
let t4;
|
|
55
|
-
if ($[4] !==
|
|
54
|
+
if ($[4] !== label || $[5] !== localized || $[6] !== path || $[7] !== required || $[8] !== Label || $[9] !== showError || $[10] !== Error || $[11] !== value || $[12] !== placeholder || $[13] !== i18n || $[14] !== rtl || $[15] !== readOnly || $[16] !== onChange || $[17] !== rows || $[18] !== description || $[19] !== Description || $[20] !== BeforeInput || $[21] !== AfterInput || $[22] !== t3 || $[23] !== style) {
|
|
56
55
|
t4 = _jsxs("div", {
|
|
57
56
|
className: t3,
|
|
58
|
-
style
|
|
59
|
-
...style,
|
|
60
|
-
width
|
|
61
|
-
},
|
|
57
|
+
style,
|
|
62
58
|
children: [_jsx(RenderCustomComponent, {
|
|
63
59
|
CustomComponent: Label,
|
|
64
60
|
Fallback: _jsx(FieldLabel, {
|
|
@@ -104,30 +100,29 @@ export const TextareaInput = props => {
|
|
|
104
100
|
})]
|
|
105
101
|
})]
|
|
106
102
|
});
|
|
107
|
-
$[4] =
|
|
108
|
-
$[5] =
|
|
109
|
-
$[6] =
|
|
110
|
-
$[7] =
|
|
111
|
-
$[8] =
|
|
112
|
-
$[9] =
|
|
113
|
-
$[10] =
|
|
114
|
-
$[11] =
|
|
115
|
-
$[12] =
|
|
116
|
-
$[13] =
|
|
117
|
-
$[14] =
|
|
118
|
-
$[15] =
|
|
119
|
-
$[16] =
|
|
120
|
-
$[17] =
|
|
121
|
-
$[18] =
|
|
122
|
-
$[19] =
|
|
123
|
-
$[20] =
|
|
124
|
-
$[21] =
|
|
125
|
-
$[22] =
|
|
126
|
-
$[23] =
|
|
127
|
-
$[24] =
|
|
128
|
-
$[25] = t4;
|
|
103
|
+
$[4] = label;
|
|
104
|
+
$[5] = localized;
|
|
105
|
+
$[6] = path;
|
|
106
|
+
$[7] = required;
|
|
107
|
+
$[8] = Label;
|
|
108
|
+
$[9] = showError;
|
|
109
|
+
$[10] = Error;
|
|
110
|
+
$[11] = value;
|
|
111
|
+
$[12] = placeholder;
|
|
112
|
+
$[13] = i18n;
|
|
113
|
+
$[14] = rtl;
|
|
114
|
+
$[15] = readOnly;
|
|
115
|
+
$[16] = onChange;
|
|
116
|
+
$[17] = rows;
|
|
117
|
+
$[18] = description;
|
|
118
|
+
$[19] = Description;
|
|
119
|
+
$[20] = BeforeInput;
|
|
120
|
+
$[21] = AfterInput;
|
|
121
|
+
$[22] = t3;
|
|
122
|
+
$[23] = style;
|
|
123
|
+
$[24] = t4;
|
|
129
124
|
} else {
|
|
130
|
-
t4 = $[
|
|
125
|
+
t4 = $[24];
|
|
131
126
|
}
|
|
132
127
|
return t4;
|
|
133
128
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Input.js","names":["c","_c","getTranslation","React","RenderCustomComponent","FieldDescription","FieldError","FieldLabel","useTranslation","fieldBaseClass","TextareaInput","props","$","AfterInput","BeforeInput","className","Description","description","Error","Label","label","localized","onChange","path","placeholder","readOnly","required","rows","rtl","showError","style","value","
|
|
1
|
+
{"version":3,"file":"Input.js","names":["c","_c","getTranslation","React","RenderCustomComponent","FieldDescription","FieldError","FieldLabel","useTranslation","fieldBaseClass","TextareaInput","props","$","AfterInput","BeforeInput","className","Description","description","Error","Label","label","localized","onChange","path","placeholder","readOnly","required","rows","rtl","showError","style","value","i18n","t0","t1","t2","filter","Boolean","t3","join","t4","_jsxs","children","_jsx","CustomComponent","Fallback","htmlFor","replace","disabled","id","name"],"sources":["../../../src/fields/Textarea/Input.tsx"],"sourcesContent":["'use client'\nimport { getTranslation } from '@payloadcms/translations'\nimport React from 'react'\n\nimport type { TextAreaInputProps } from './types.js'\n\nimport { RenderCustomComponent } from '../../elements/RenderCustomComponent/index.js'\nimport { FieldDescription } from '../../fields/FieldDescription/index.js'\nimport { FieldError } from '../../fields/FieldError/index.js'\nimport { FieldLabel } from '../../fields/FieldLabel/index.js'\nimport { useTranslation } from '../../providers/Translation/index.js'\nimport { fieldBaseClass } from '../shared/index.js'\nimport './index.scss'\n\nexport const TextareaInput: React.FC<TextAreaInputProps> = (props) => {\n const {\n AfterInput,\n BeforeInput,\n className,\n Description,\n description,\n Error,\n Label,\n label,\n localized,\n onChange,\n path,\n placeholder,\n readOnly,\n required,\n rows,\n rtl,\n showError,\n style,\n value,\n } = props\n\n const { i18n } = useTranslation()\n\n return (\n <div\n className={[\n fieldBaseClass,\n 'textarea',\n className,\n showError && 'error',\n readOnly && 'read-only',\n ]\n .filter(Boolean)\n .join(' ')}\n style={style}\n >\n <RenderCustomComponent\n CustomComponent={Label}\n Fallback={\n <FieldLabel label={label} localized={localized} path={path} required={required} />\n }\n />\n <div className={`${fieldBaseClass}__wrap`}>\n <RenderCustomComponent\n CustomComponent={Error}\n Fallback={<FieldError path={path} showError={showError} />}\n />\n {BeforeInput}\n <label className=\"textarea-outer\" htmlFor={`field-${path.replace(/\\./g, '__')}`}>\n <div className=\"textarea-inner\">\n <div className=\"textarea-clone\" data-value={value || placeholder || ''} />\n <textarea\n className=\"textarea-element\"\n data-rtl={rtl}\n disabled={readOnly}\n id={`field-${path.replace(/\\./g, '__')}`}\n name={path}\n onChange={onChange}\n placeholder={getTranslation(placeholder, i18n)}\n rows={rows}\n value={value || ''}\n />\n </div>\n </label>\n {AfterInput}\n <RenderCustomComponent\n CustomComponent={Description}\n Fallback={<FieldDescription description={description} path={path} />}\n />\n </div>\n </div>\n )\n}\n"],"mappings":"AAAA;;AAAA,SAAAA,CAAA,IAAAC,EAAA;;AACA,SAASC,cAAc,QAAQ;AAC/B,OAAOC,KAAA,MAAW;AAIlB,SAASC,qBAAqB,QAAQ;AACtC,SAASC,gBAAgB,QAAQ;AACjC,SAASC,UAAU,QAAQ;AAC3B,SAASC,UAAU,QAAQ;AAC3B,SAASC,cAAc,QAAQ;AAC/B,SAASC,cAAc,QAAQ;AAC/B,OAAO;AAEP,OAAO,MAAMC,aAAA,GAA8CC,KAAA;EAAA,MAAAC,CAAA,GAAAX,EAAA;EACzD;IAAAY,UAAA;IAAAC,WAAA;IAAAC,SAAA;IAAAC,WAAA;IAAAC,WAAA;IAAAC,KAAA;IAAAC,KAAA;IAAAC,KAAA;IAAAC,SAAA;IAAAC,QAAA;IAAAC,IAAA;IAAAC,WAAA;IAAAC,QAAA;IAAAC,QAAA;IAAAC,IAAA;IAAAC,GAAA;IAAAC,SAAA;IAAAC,KAAA;IAAAC;EAAA,IAoBIpB,KAAA;EAEJ;IAAAqB;EAAA,IAAiBxB,cAAA;EAQX,MAAAyB,EAAA,GAAAJ,SAAA,IA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AAAE,IAAA;UAAAG;QAAA,C;UAGJe,KAAA,CAAC;QAAA1B,SAAA,EAAe,GAAAN,cAAA,QAAyB;QAAAiC,QAAA,GACvCC,IAAA,CAAAvC,qBAAA;UAAAwC,eAAA,EACmB1B,KAAA;UAAA2B,QAAA,EACPF,IAAA,CAAArC,UAAA;YAAAiB,IAAA;YAAAM;UAAA,C;YAEXf,WAAA,EACD6B,IAAA,CAAC;UAAA5B,SAAA,EAAgB;UAAA+B,OAAA,EAA0B,SAASvB,IAAA,CAAAwB,OAAA,QAAoB,OAAO;UAAAL,QAAA,EAC7ED,KAAA,CAAC;YAAA1B,SAAA,EAAc;YAAA2B,QAAA,GACbC,IAAA,CAAC;cAAA5B,SAAA,EAAc;cAAA,cAA6BgB,KAAA,IAASP,WAAA,IAAe;YAAA,C,GACpEmB,IAAA,CAAC;cAAA5B,SAAA,EACW;cAAA,YACAa,GAAA;cAAAoB,QAAA,EACAvB,QAAA;cAAAwB,EAAA,EACN,SAAS1B,IAAA,CAAAwB,OAAA,QAAoB,OAAO;cAAAG,IAAA,EAClC3B,IAAA;cAAAD,QAAA;cAAAE,WAAA,EAEOtB,cAAA,CAAesB,WAAA,EAAaQ,IAAA;cAAAL,IAAA;cAAAI,KAAA,EAElCA,KAAA,IAAS;YAAA,C;;YAIrBlB,UAAA,EACD8B,IAAA,CAAAvC,qBAAA;UAAAwC,eAAA,EACmB5B,WAAA;UAAA6B,QAAA,EACPF,IAAA,CAAAtC,gBAAA;YAAAY,WAAA;YAAAM;UAAA,C;;;;;;;;;;;;;;;;;;;;;;;;;;;;SA3ChBiB,E;CAgDJ","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/fields/Textarea/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAgC,uBAAuB,EAAE,MAAM,SAAS,CAAA;AAGpF,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/fields/Textarea/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAgC,uBAAuB,EAAE,MAAM,SAAS,CAAA;AAGpF,OAAO,KAA+B,MAAM,OAAO,CAAA;AAEnD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAA;AAQpD,OAAO,cAAc,CAAA;AAErB,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAA;AAE1C,OAAO,EAAE,aAAa,EAAE,kBAAkB,EAAE,CAAA;AAiF5C,eAAO,MAAM,aAAa;wBAjFjB,MAAM,GAAG;yBAEF,MAAO,oBAAoB;;;;;+EA+EuB,CAAA"}
|
|
@@ -1,60 +1,47 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
-
import { c as _c } from "react/compiler-runtime";
|
|
4
3
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
5
4
|
import { getTranslation } from '@payloadcms/translations';
|
|
6
|
-
import React, { useCallback } from 'react';
|
|
5
|
+
import React, { useCallback, useMemo } from 'react';
|
|
7
6
|
import { useField } from '../../forms/useField/index.js';
|
|
8
7
|
import { withCondition } from '../../forms/withCondition/index.js';
|
|
9
8
|
import { useConfig } from '../../providers/Config/index.js';
|
|
10
9
|
import { useLocale } from '../../providers/Locale/index.js';
|
|
11
10
|
import { useTranslation } from '../../providers/Translation/index.js';
|
|
12
|
-
import {
|
|
11
|
+
import { mergeFieldStyles } from '../mergeFieldStyles.js';
|
|
13
12
|
import './index.scss';
|
|
13
|
+
import { isFieldRTL } from '../shared/index.js';
|
|
14
14
|
import { TextareaInput } from './Input.js';
|
|
15
15
|
export { TextareaInput };
|
|
16
16
|
const TextareaFieldComponent = props => {
|
|
17
|
-
const $ = _c(14);
|
|
18
17
|
const {
|
|
19
|
-
field
|
|
18
|
+
field,
|
|
19
|
+
field: {
|
|
20
|
+
admin: {
|
|
21
|
+
className,
|
|
22
|
+
description,
|
|
23
|
+
placeholder,
|
|
24
|
+
rows,
|
|
25
|
+
rtl
|
|
26
|
+
} = {},
|
|
27
|
+
label,
|
|
28
|
+
localized,
|
|
29
|
+
maxLength,
|
|
30
|
+
minLength,
|
|
31
|
+
required
|
|
32
|
+
},
|
|
20
33
|
path,
|
|
21
34
|
readOnly,
|
|
22
35
|
validate
|
|
23
36
|
} = props;
|
|
24
|
-
const {
|
|
25
|
-
admin: t1,
|
|
26
|
-
label,
|
|
27
|
-
localized,
|
|
28
|
-
maxLength,
|
|
29
|
-
minLength,
|
|
30
|
-
required
|
|
31
|
-
} = t0;
|
|
32
|
-
let t2;
|
|
33
|
-
if ($[0] !== t1) {
|
|
34
|
-
t2 = t1 === undefined ? {} : t1;
|
|
35
|
-
$[0] = t1;
|
|
36
|
-
$[1] = t2;
|
|
37
|
-
} else {
|
|
38
|
-
t2 = $[1];
|
|
39
|
-
}
|
|
40
|
-
const {
|
|
41
|
-
className,
|
|
42
|
-
description,
|
|
43
|
-
placeholder,
|
|
44
|
-
rows,
|
|
45
|
-
rtl,
|
|
46
|
-
style,
|
|
47
|
-
width
|
|
48
|
-
} = t2;
|
|
49
37
|
const {
|
|
50
38
|
i18n
|
|
51
39
|
} = useTranslation();
|
|
52
40
|
const {
|
|
53
|
-
config:
|
|
41
|
+
config: {
|
|
42
|
+
localization
|
|
43
|
+
}
|
|
54
44
|
} = useConfig();
|
|
55
|
-
const {
|
|
56
|
-
localization
|
|
57
|
-
} = t3;
|
|
58
45
|
const locale = useLocale();
|
|
59
46
|
const isRTL = isFieldRTL({
|
|
60
47
|
fieldLocalized: localized,
|
|
@@ -62,91 +49,54 @@ const TextareaFieldComponent = props => {
|
|
|
62
49
|
locale,
|
|
63
50
|
localizationConfig: localization || undefined
|
|
64
51
|
});
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
}
|
|
76
|
-
};
|
|
77
|
-
$[2] = validate;
|
|
78
|
-
$[3] = maxLength;
|
|
79
|
-
$[4] = minLength;
|
|
80
|
-
$[5] = required;
|
|
81
|
-
$[6] = t4;
|
|
82
|
-
} else {
|
|
83
|
-
t4 = $[6];
|
|
84
|
-
}
|
|
85
|
-
const memoizedValidate = t4;
|
|
86
|
-
let t5;
|
|
87
|
-
if ($[7] !== path || $[8] !== memoizedValidate) {
|
|
88
|
-
t5 = {
|
|
89
|
-
path,
|
|
90
|
-
validate: memoizedValidate
|
|
91
|
-
};
|
|
92
|
-
$[7] = path;
|
|
93
|
-
$[8] = memoizedValidate;
|
|
94
|
-
$[9] = t5;
|
|
95
|
-
} else {
|
|
96
|
-
t5 = $[9];
|
|
97
|
-
}
|
|
52
|
+
const memoizedValidate = useCallback((value, options) => {
|
|
53
|
+
if (typeof validate === 'function') {
|
|
54
|
+
return validate(value, {
|
|
55
|
+
...options,
|
|
56
|
+
maxLength,
|
|
57
|
+
minLength,
|
|
58
|
+
required
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
}, [validate, required, maxLength, minLength]);
|
|
98
62
|
const {
|
|
99
|
-
customComponents:
|
|
63
|
+
customComponents: {
|
|
64
|
+
AfterInput,
|
|
65
|
+
BeforeInput,
|
|
66
|
+
Description,
|
|
67
|
+
Error,
|
|
68
|
+
Label
|
|
69
|
+
} = {},
|
|
100
70
|
setValue,
|
|
101
71
|
showError,
|
|
102
72
|
value: value_0
|
|
103
|
-
} = useField(
|
|
104
|
-
let t7;
|
|
105
|
-
if ($[10] !== t6) {
|
|
106
|
-
t7 = t6 === undefined ? {} : t6;
|
|
107
|
-
$[10] = t6;
|
|
108
|
-
$[11] = t7;
|
|
109
|
-
} else {
|
|
110
|
-
t7 = $[11];
|
|
111
|
-
}
|
|
112
|
-
const {
|
|
113
|
-
AfterInput,
|
|
114
|
-
BeforeInput,
|
|
115
|
-
Description,
|
|
116
|
-
Error,
|
|
117
|
-
Label
|
|
118
|
-
} = t7;
|
|
119
|
-
let t8;
|
|
120
|
-
if ($[12] !== setValue) {
|
|
121
|
-
t8 = e => {
|
|
122
|
-
setValue(e.target.value);
|
|
123
|
-
};
|
|
124
|
-
$[12] = setValue;
|
|
125
|
-
$[13] = t8;
|
|
126
|
-
} else {
|
|
127
|
-
t8 = $[13];
|
|
128
|
-
}
|
|
129
|
-
return _jsx(TextareaInput, {
|
|
130
|
-
AfterInput,
|
|
131
|
-
BeforeInput,
|
|
132
|
-
className,
|
|
133
|
-
Description,
|
|
134
|
-
description,
|
|
135
|
-
Error,
|
|
136
|
-
Label,
|
|
137
|
-
label,
|
|
138
|
-
localized,
|
|
139
|
-
onChange: t8,
|
|
73
|
+
} = useField({
|
|
140
74
|
path,
|
|
75
|
+
validate: memoizedValidate
|
|
76
|
+
});
|
|
77
|
+
const styles = useMemo(() => mergeFieldStyles(field), [field]);
|
|
78
|
+
return /*#__PURE__*/_jsx(TextareaInput, {
|
|
79
|
+
AfterInput: AfterInput,
|
|
80
|
+
BeforeInput: BeforeInput,
|
|
81
|
+
className: className,
|
|
82
|
+
Description: Description,
|
|
83
|
+
description: description,
|
|
84
|
+
Error: Error,
|
|
85
|
+
Label: Label,
|
|
86
|
+
label: label,
|
|
87
|
+
localized: localized,
|
|
88
|
+
onChange: e => {
|
|
89
|
+
setValue(e.target.value);
|
|
90
|
+
},
|
|
91
|
+
path: path,
|
|
141
92
|
placeholder: getTranslation(placeholder, i18n),
|
|
142
|
-
readOnly,
|
|
143
|
-
required,
|
|
144
|
-
rows,
|
|
93
|
+
readOnly: readOnly,
|
|
94
|
+
required: required,
|
|
95
|
+
rows: rows,
|
|
145
96
|
rtl: isRTL,
|
|
146
|
-
showError,
|
|
147
|
-
style,
|
|
148
|
-
value: value_0
|
|
149
|
-
width
|
|
97
|
+
showError: showError,
|
|
98
|
+
style: styles,
|
|
99
|
+
value: value_0
|
|
150
100
|
});
|
|
151
101
|
};
|
|
152
102
|
export const TextareaField = withCondition(TextareaFieldComponent);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["
|
|
1
|
+
{"version":3,"file":"index.js","names":["getTranslation","React","useCallback","useMemo","useField","withCondition","useConfig","useLocale","useTranslation","mergeFieldStyles","isFieldRTL","TextareaInput","TextareaFieldComponent","props","field","admin","className","description","placeholder","rows","rtl","label","localized","maxLength","minLength","required","path","readOnly","validate","i18n","config","localization","locale","isRTL","fieldLocalized","fieldRTL","localizationConfig","undefined","memoizedValidate","value","options","customComponents","AfterInput","BeforeInput","Description","Error","Label","setValue","showError","styles","_jsx","onChange","e","target","style","TextareaField"],"sources":["../../../src/fields/Textarea/index.tsx"],"sourcesContent":["'use client'\nimport type { TextareaFieldClientComponent, TextareaFieldValidation } from 'payload'\n\nimport { getTranslation } from '@payloadcms/translations'\nimport React, { useCallback, useMemo } from 'react'\n\nimport type { TextAreaInputProps } from './types.js'\n\nimport { useField } from '../../forms/useField/index.js'\nimport { withCondition } from '../../forms/withCondition/index.js'\nimport { useConfig } from '../../providers/Config/index.js'\nimport { useLocale } from '../../providers/Locale/index.js'\nimport { useTranslation } from '../../providers/Translation/index.js'\nimport { mergeFieldStyles } from '../mergeFieldStyles.js'\nimport './index.scss'\nimport { isFieldRTL } from '../shared/index.js'\nimport { TextareaInput } from './Input.js'\n\nexport { TextareaInput, TextAreaInputProps }\n\nconst TextareaFieldComponent: TextareaFieldClientComponent = (props) => {\n const {\n field,\n field: {\n admin: { className, description, placeholder, rows, rtl } = {},\n label,\n localized,\n maxLength,\n minLength,\n required,\n },\n path,\n readOnly,\n validate,\n } = props\n\n const { i18n } = useTranslation()\n\n const {\n config: { localization },\n } = useConfig()\n\n const locale = useLocale()\n\n const isRTL = isFieldRTL({\n fieldLocalized: localized,\n fieldRTL: rtl,\n locale,\n localizationConfig: localization || undefined,\n })\n\n const memoizedValidate: TextareaFieldValidation = useCallback(\n (value, options) => {\n if (typeof validate === 'function') {\n return validate(value, { ...options, maxLength, minLength, required })\n }\n },\n [validate, required, maxLength, minLength],\n )\n\n const {\n customComponents: { AfterInput, BeforeInput, Description, Error, Label } = {},\n setValue,\n showError,\n value,\n } = useField<string>({\n path,\n validate: memoizedValidate,\n })\n\n const styles = useMemo(() => mergeFieldStyles(field), [field])\n\n return (\n <TextareaInput\n AfterInput={AfterInput}\n BeforeInput={BeforeInput}\n className={className}\n Description={Description}\n description={description}\n Error={Error}\n Label={Label}\n label={label}\n localized={localized}\n onChange={(e) => {\n setValue(e.target.value)\n }}\n path={path}\n placeholder={getTranslation(placeholder, i18n)}\n readOnly={readOnly}\n required={required}\n rows={rows}\n rtl={isRTL}\n showError={showError}\n style={styles}\n value={value}\n />\n )\n}\n\nexport const TextareaField = withCondition(TextareaFieldComponent)\n"],"mappings":"AAAA;;;AAGA,SAASA,cAAc,QAAQ;AAC/B,OAAOC,KAAA,IAASC,WAAW,EAAEC,OAAO,QAAQ;AAI5C,SAASC,QAAQ,QAAQ;AACzB,SAASC,aAAa,QAAQ;AAC9B,SAASC,SAAS,QAAQ;AAC1B,SAASC,SAAS,QAAQ;AAC1B,SAASC,cAAc,QAAQ;AAC/B,SAASC,gBAAgB,QAAQ;AACjC,OAAO;AACP,SAASC,UAAU,QAAQ;AAC3B,SAASC,aAAa,QAAQ;AAE9B,SAASA,aAAa;AAEtB,MAAMC,sBAAA,GAAwDC,KAAA;EAC5D,MAAM;IACJC,KAAK;IACLA,KAAA,EAAO;MACLC,KAAA,EAAO;QAAEC,SAAS;QAAEC,WAAW;QAAEC,WAAW;QAAEC,IAAI;QAAEC;MAAG,CAAE,GAAG,CAAC,CAAC;MAC9DC,KAAK;MACLC,SAAS;MACTC,SAAS;MACTC,SAAS;MACTC;IAAQ,CACT;IACDC,IAAI;IACJC,QAAQ;IACRC;EAAQ,CACT,GAAGf,KAAA;EAEJ,MAAM;IAAEgB;EAAI,CAAE,GAAGrB,cAAA;EAEjB,MAAM;IACJsB,MAAA,EAAQ;MAAEC;IAAY;EAAE,CACzB,GAAGzB,SAAA;EAEJ,MAAM0B,MAAA,GAASzB,SAAA;EAE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,EAAE,KAAK,CAAC,SAAS,CAAC,gBAAgB,CAAC,CAAA;IACrD,QAAQ,CAAC,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAChC,QAAQ,CAAC,KAAK,CAAC,EAAE,WAAW,CAAA;IAC5B,QAAQ,CAAC,SAAS,CAAC,EAAE,OAAO,CAAA;IAC5B,QAAQ,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,EAAE,WAAW,CAAC,mBAAmB,CAAC,KAAK,IAAI,CAAA;IACjE,QAAQ,CAAC,SAAS,CAAC,EAAE,KAAK,CAAC,oBAAoB,CAAC,gBAAgB,CAAC,CAAA;IACjE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAA;IAC7B,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAA;IAC3B,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAA;IAC3B,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,GAAG,CAAC,EAAE,OAAO,CAAA;IACtB,QAAQ,CAAC,SAAS,CAAC,EAAE,OAAO,CAAA;IAC5B,QAAQ,CAAC,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAA;IACpC,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAA;IACvB,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAA;CAChC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","names":[],"sources":["../../../src/fields/Textarea/types.ts"],"sourcesContent":["import type { StaticDescription, StaticLabel } from 'payload'\nimport type React from 'react'\n\nimport { type ChangeEvent } from 'react'\n\nexport type TextAreaInputProps = {\n readonly AfterInput?: React.ReactNode\n readonly BeforeInput?: React.ReactNode\n readonly className?: string\n readonly Description?: React.ReactNode\n readonly description?: StaticDescription\n readonly Error?: React.ReactNode\n readonly inputRef?: React.RefObject<HTMLInputElement>\n readonly Label?: React.ReactNode\n readonly label?: StaticLabel\n readonly localized?: boolean\n readonly onChange?: (e: ChangeEvent<HTMLTextAreaElement>) => void\n readonly onKeyDown?: React.KeyboardEventHandler<HTMLInputElement>\n readonly path: string\n readonly placeholder?: string\n readonly readOnly?: boolean\n readonly required?: boolean\n readonly rows?: number\n readonly rtl?: boolean\n readonly showError?: boolean\n readonly style?: React.CSSProperties\n readonly value?: string\n readonly valueToRender?: string\n
|
|
1
|
+
{"version":3,"file":"types.js","names":[],"sources":["../../../src/fields/Textarea/types.ts"],"sourcesContent":["import type { StaticDescription, StaticLabel } from 'payload'\nimport type React from 'react'\n\nimport { type ChangeEvent } from 'react'\n\nexport type TextAreaInputProps = {\n readonly AfterInput?: React.ReactNode\n readonly BeforeInput?: React.ReactNode\n readonly className?: string\n readonly Description?: React.ReactNode\n readonly description?: StaticDescription\n readonly Error?: React.ReactNode\n readonly inputRef?: React.RefObject<HTMLInputElement>\n readonly Label?: React.ReactNode\n readonly label?: StaticLabel\n readonly localized?: boolean\n readonly onChange?: (e: ChangeEvent<HTMLTextAreaElement>) => void\n readonly onKeyDown?: React.KeyboardEventHandler<HTMLInputElement>\n readonly path: string\n readonly placeholder?: string\n readonly readOnly?: boolean\n readonly required?: boolean\n readonly rows?: number\n readonly rtl?: boolean\n readonly showError?: boolean\n readonly style?: React.CSSProperties\n readonly value?: string\n readonly valueToRender?: string\n}\n"],"mappings":"AAKA","ignoreList":[]}
|
|
@@ -34,7 +34,6 @@ export type UploadInputProps = {
|
|
|
34
34
|
readonly showError?: boolean;
|
|
35
35
|
readonly style?: React.CSSProperties;
|
|
36
36
|
readonly value?: (number | string)[] | (number | string);
|
|
37
|
-
readonly width?: React.CSSProperties['width'];
|
|
38
37
|
};
|
|
39
38
|
export declare function UploadInput(props: UploadInputProps): React.JSX.Element;
|
|
40
39
|
//# sourceMappingURL=Input.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"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eAAe,CAAC,YAAY,CAAC,CAAA;IAClD,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAA;IAC3B,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAA;IAC3B,QAAQ,CAAC,SAAS,CAAC,EAAE,OAAO,CAAA;IAC5B,QAAQ,CAAC,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAA;IACpC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,GAAG,CAAC,MAAM,GAAG,MAAM,CAAC,CAAA;CACzD,CAAA;AAED,wBAAgB,WAAW,CAAC,KAAK,EAAE,gBAAgB,qBAsflD"}
|
|
@@ -24,7 +24,7 @@ import { UploadComponentHasOne } from './HasOne/index.js';
|
|
|
24
24
|
import './index.scss';
|
|
25
25
|
export const baseClass = 'upload';
|
|
26
26
|
export function UploadInput(props) {
|
|
27
|
-
const $ = _c(
|
|
27
|
+
const $ = _c(121);
|
|
28
28
|
const {
|
|
29
29
|
AfterInput,
|
|
30
30
|
allowCreate,
|
|
@@ -49,8 +49,7 @@ export function UploadInput(props) {
|
|
|
49
49
|
serverURL,
|
|
50
50
|
showError,
|
|
51
51
|
style,
|
|
52
|
-
value
|
|
53
|
-
width
|
|
52
|
+
value
|
|
54
53
|
} = props;
|
|
55
54
|
const [populatedDocs, setPopulatedDocs] = React.useState();
|
|
56
55
|
const [activeRelationTo] = React.useState(Array.isArray(relationTo) ? relationTo[0] : relationTo);
|
|
@@ -527,14 +526,11 @@ export function UploadInput(props) {
|
|
|
527
526
|
const t29 = t28.join(" ");
|
|
528
527
|
const t30 = `field-${path?.replace(/\./g, "__")}`;
|
|
529
528
|
let t31;
|
|
530
|
-
if ($[85] !==
|
|
529
|
+
if ($[85] !== label || $[86] !== localized || $[87] !== path || $[88] !== required || $[89] !== Label || $[90] !== showError || $[91] !== Error || $[92] !== hasMany || $[93] !== value || $[94] !== populatedDocs || $[95] !== isSortable || $[96] !== readOnly || $[97] !== onRemove || $[98] !== onReorder || $[99] !== reloadDoc || $[100] !== serverURL || $[101] !== t || $[102] !== showDropzone || $[103] !== canCreate || $[104] !== onLocalFileSelection || $[105] !== openCreateDocDrawer || $[106] !== openListDrawer || $[107] !== onDocCreate || $[108] !== CreateDocDrawer || $[109] !== onListBulkSelect || $[110] !== onListSelect || $[111] !== ListDrawer || $[112] !== maxRows || $[113] !== description || $[114] !== Description || $[115] !== BeforeInput || $[116] !== AfterInput || $[117] !== t29 || $[118] !== t30 || $[119] !== style) {
|
|
531
530
|
t31 = _jsxs("div", {
|
|
532
531
|
className: t29,
|
|
533
532
|
id: t30,
|
|
534
|
-
style
|
|
535
|
-
...style,
|
|
536
|
-
width
|
|
537
|
-
},
|
|
533
|
+
style,
|
|
538
534
|
children: [_jsx(RenderCustomComponent, {
|
|
539
535
|
CustomComponent: Label,
|
|
540
536
|
Fallback: _jsx(FieldLabel, {
|
|
@@ -640,45 +636,44 @@ export function UploadInput(props) {
|
|
|
640
636
|
})
|
|
641
637
|
})]
|
|
642
638
|
});
|
|
643
|
-
$[85] =
|
|
644
|
-
$[86] =
|
|
645
|
-
$[87] =
|
|
646
|
-
$[88] =
|
|
647
|
-
$[89] =
|
|
648
|
-
$[90] =
|
|
649
|
-
$[91] =
|
|
650
|
-
$[92] =
|
|
651
|
-
$[93] =
|
|
652
|
-
$[94] =
|
|
653
|
-
$[95] =
|
|
654
|
-
$[96] =
|
|
655
|
-
$[97] =
|
|
656
|
-
$[98] =
|
|
657
|
-
$[99] =
|
|
658
|
-
$[100] =
|
|
659
|
-
$[101] =
|
|
660
|
-
$[102] =
|
|
661
|
-
$[103] =
|
|
662
|
-
$[104] =
|
|
663
|
-
$[105] =
|
|
664
|
-
$[106] =
|
|
665
|
-
$[107] =
|
|
666
|
-
$[108] =
|
|
667
|
-
$[109] =
|
|
668
|
-
$[110] =
|
|
669
|
-
$[111] =
|
|
670
|
-
$[112] =
|
|
671
|
-
$[113] =
|
|
672
|
-
$[114] =
|
|
673
|
-
$[115] =
|
|
674
|
-
$[116] =
|
|
675
|
-
$[117] =
|
|
676
|
-
$[118] =
|
|
677
|
-
$[119] =
|
|
678
|
-
$[120] =
|
|
679
|
-
$[121] = t31;
|
|
639
|
+
$[85] = label;
|
|
640
|
+
$[86] = localized;
|
|
641
|
+
$[87] = path;
|
|
642
|
+
$[88] = required;
|
|
643
|
+
$[89] = Label;
|
|
644
|
+
$[90] = showError;
|
|
645
|
+
$[91] = Error;
|
|
646
|
+
$[92] = hasMany;
|
|
647
|
+
$[93] = value;
|
|
648
|
+
$[94] = populatedDocs;
|
|
649
|
+
$[95] = isSortable;
|
|
650
|
+
$[96] = readOnly;
|
|
651
|
+
$[97] = onRemove;
|
|
652
|
+
$[98] = onReorder;
|
|
653
|
+
$[99] = reloadDoc;
|
|
654
|
+
$[100] = serverURL;
|
|
655
|
+
$[101] = t;
|
|
656
|
+
$[102] = showDropzone;
|
|
657
|
+
$[103] = canCreate;
|
|
658
|
+
$[104] = onLocalFileSelection;
|
|
659
|
+
$[105] = openCreateDocDrawer;
|
|
660
|
+
$[106] = openListDrawer;
|
|
661
|
+
$[107] = onDocCreate;
|
|
662
|
+
$[108] = CreateDocDrawer;
|
|
663
|
+
$[109] = onListBulkSelect;
|
|
664
|
+
$[110] = onListSelect;
|
|
665
|
+
$[111] = ListDrawer;
|
|
666
|
+
$[112] = maxRows;
|
|
667
|
+
$[113] = description;
|
|
668
|
+
$[114] = Description;
|
|
669
|
+
$[115] = BeforeInput;
|
|
670
|
+
$[116] = AfterInput;
|
|
671
|
+
$[117] = t29;
|
|
672
|
+
$[118] = t30;
|
|
673
|
+
$[119] = style;
|
|
674
|
+
$[120] = t31;
|
|
680
675
|
} else {
|
|
681
|
-
t31 = $[
|
|
676
|
+
t31 = $[120];
|
|
682
677
|
}
|
|
683
678
|
return t31;
|
|
684
679
|
}
|