payload 0.13.5 → 0.13.6
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/CHANGELOG.md +7 -0
- package/dist/admin/components/forms/field-types/Select/Input.d.ts +2 -2
- package/dist/admin/components/forms/field-types/Select/index.js +1 -1
- package/dist/admin/components/forms/field-types/Text/Input.d.ts +2 -2
- package/dist/admin/components/forms/field-types/Text/index.js +1 -1
- package/dist/admin/components/forms/field-types/Textarea/Input.d.ts +2 -2
- package/dist/admin/components/forms/field-types/Textarea/index.js +1 -1
- package/dist/admin/components/forms/field-types/Upload/Input.d.ts +2 -2
- package/dist/admin/components/forms/field-types/Upload/index.js +4 -5
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
## [0.13.6](https://github.com/payloadcms/payload/compare/v0.13.5...v0.13.6) (2021-11-30)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* requires path in select, text, textarea, and upload components ([925a33e](https://github.com/payloadcms/payload/commit/925a33e5602336f6128188aaf73001dbd23bd411))
|
|
7
|
+
|
|
1
8
|
## [0.13.5](https://github.com/payloadcms/payload/compare/v0.13.4...v0.13.5) (2021-11-30)
|
|
2
9
|
|
|
3
10
|
|
|
@@ -4,10 +4,10 @@ import { Description } from '../../FieldDescription/types';
|
|
|
4
4
|
import { Value as ReactSelectValue } from '../../../elements/ReactSelect/types';
|
|
5
5
|
import './index.scss';
|
|
6
6
|
export declare type SelectInputProps = Omit<SelectField, 'type' | 'value' | 'options'> & {
|
|
7
|
-
showError
|
|
7
|
+
showError?: boolean;
|
|
8
8
|
errorMessage?: string;
|
|
9
9
|
readOnly?: boolean;
|
|
10
|
-
path
|
|
10
|
+
path: string;
|
|
11
11
|
required?: boolean;
|
|
12
12
|
value?: string | string[];
|
|
13
13
|
description?: Description;
|
|
@@ -46,6 +46,6 @@ const Select = (props) => {
|
|
|
46
46
|
hasMany,
|
|
47
47
|
setValue,
|
|
48
48
|
]);
|
|
49
|
-
return (React.createElement(SelectInput, { onChange: onChange, value: value, name: name, options: options, label: label, showError: showError, errorMessage: errorMessage, description: description, style: style, width: width, hasMany: hasMany }));
|
|
49
|
+
return (React.createElement(SelectInput, { path: path, onChange: onChange, value: value, name: name, options: options, label: label, showError: showError, errorMessage: errorMessage, description: description, style: style, width: width, hasMany: hasMany }));
|
|
50
50
|
};
|
|
51
51
|
export default withCondition(Select);
|
|
@@ -3,10 +3,10 @@ import { TextField } from '../../../../../fields/config/types';
|
|
|
3
3
|
import { Description } from '../../FieldDescription/types';
|
|
4
4
|
import './index.scss';
|
|
5
5
|
export declare type TextInputProps = Omit<TextField, 'type'> & {
|
|
6
|
-
showError
|
|
6
|
+
showError?: boolean;
|
|
7
7
|
errorMessage?: string;
|
|
8
8
|
readOnly?: boolean;
|
|
9
|
-
path
|
|
9
|
+
path: string;
|
|
10
10
|
required?: boolean;
|
|
11
11
|
value?: string;
|
|
12
12
|
description?: Description;
|
|
@@ -13,7 +13,7 @@ const Text = (props) => {
|
|
|
13
13
|
condition,
|
|
14
14
|
});
|
|
15
15
|
const { value, showError, setValue, errorMessage, } = field;
|
|
16
|
-
return (React.createElement(TextInput, { name: name, onChange: (e) => {
|
|
16
|
+
return (React.createElement(TextInput, { path: path, name: name, onChange: (e) => {
|
|
17
17
|
setValue(e.target.value);
|
|
18
18
|
}, showError: showError, errorMessage: errorMessage, required: required, label: label, value: value, placeholder: placeholder, readOnly: readOnly, style: style, width: width, description: description }));
|
|
19
19
|
};
|
|
@@ -3,10 +3,10 @@ import { TextareaField } from '../../../../../fields/config/types';
|
|
|
3
3
|
import { Description } from '../../FieldDescription/types';
|
|
4
4
|
import './index.scss';
|
|
5
5
|
export declare type TextAreaInputProps = Omit<TextareaField, 'type'> & {
|
|
6
|
-
showError
|
|
6
|
+
showError?: boolean;
|
|
7
7
|
errorMessage?: string;
|
|
8
8
|
readOnly?: boolean;
|
|
9
|
-
path
|
|
9
|
+
path: string;
|
|
10
10
|
required?: boolean;
|
|
11
11
|
value?: string;
|
|
12
12
|
description?: Description;
|
|
@@ -17,7 +17,7 @@ const Textarea = (props) => {
|
|
|
17
17
|
enableDebouncedValue: true,
|
|
18
18
|
condition,
|
|
19
19
|
});
|
|
20
|
-
return (React.createElement(TextareaInput, { name: name, onChange: (e) => {
|
|
20
|
+
return (React.createElement(TextareaInput, { path: path, name: name, onChange: (e) => {
|
|
21
21
|
setValue(e.target.value);
|
|
22
22
|
}, showError: showError, errorMessage: errorMessage, required: required, label: label, value: value, placeholder: placeholder, readOnly: readOnly, style: style, width: width, description: description, rows: rows }));
|
|
23
23
|
};
|
|
@@ -5,10 +5,10 @@ import { FieldTypes } from '..';
|
|
|
5
5
|
import { SanitizedCollectionConfig } from '../../../../../collections/config/types';
|
|
6
6
|
import './index.scss';
|
|
7
7
|
export declare type UploadInputProps = Omit<UploadField, 'type'> & {
|
|
8
|
-
showError
|
|
8
|
+
showError?: boolean;
|
|
9
9
|
errorMessage?: string;
|
|
10
10
|
readOnly?: boolean;
|
|
11
|
-
path
|
|
11
|
+
path: string;
|
|
12
12
|
required?: boolean;
|
|
13
13
|
value?: string;
|
|
14
14
|
description?: Description;
|
|
@@ -7,19 +7,18 @@ import UploadInput from './Input';
|
|
|
7
7
|
import './index.scss';
|
|
8
8
|
const Upload = (props) => {
|
|
9
9
|
const { collections, serverURL, routes: { api, }, } = useConfig();
|
|
10
|
-
const { path
|
|
10
|
+
const { path, name, required, admin: { readOnly, style, width, description, condition, } = {}, label, validate = upload, relationTo, fieldTypes, } = props;
|
|
11
11
|
const collection = collections.find((coll) => coll.slug === relationTo);
|
|
12
|
-
const path = pathFromProps || name;
|
|
13
12
|
const memoizedValidate = useCallback((value) => {
|
|
14
13
|
const validationResult = validate(value, { required });
|
|
15
14
|
return validationResult;
|
|
16
15
|
}, [validate, required]);
|
|
17
|
-
const
|
|
16
|
+
const field = useField({
|
|
18
17
|
path,
|
|
19
18
|
validate: memoizedValidate,
|
|
20
19
|
condition,
|
|
21
20
|
});
|
|
22
|
-
const { value, showError, setValue, errorMessage, } =
|
|
21
|
+
const { value, showError, setValue, errorMessage, } = field;
|
|
23
22
|
const onChange = useCallback((incomingValue) => {
|
|
24
23
|
const incomingID = (incomingValue === null || incomingValue === void 0 ? void 0 : incomingValue.id) || incomingValue;
|
|
25
24
|
setValue(incomingID);
|
|
@@ -27,7 +26,7 @@ const Upload = (props) => {
|
|
|
27
26
|
setValue,
|
|
28
27
|
]);
|
|
29
28
|
if (collection.upload) {
|
|
30
|
-
return (React.createElement(UploadInput, { value: value, onChange: onChange, description: description, label: label, required: required, showError: showError, serverURL: serverURL, api: api, errorMessage: errorMessage, readOnly: readOnly, style: style, width: width, collection: collection, fieldTypes: fieldTypes, name: name, relationTo: relationTo }));
|
|
29
|
+
return (React.createElement(UploadInput, { path: path, value: value, onChange: onChange, description: description, label: label, required: required, showError: showError, serverURL: serverURL, api: api, errorMessage: errorMessage, readOnly: readOnly, style: style, width: width, collection: collection, fieldTypes: fieldTypes, name: name, relationTo: relationTo }));
|
|
31
30
|
}
|
|
32
31
|
return null;
|
|
33
32
|
};
|