ublo-lib 1.20.3 → 1.20.5
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.
|
@@ -17,7 +17,7 @@ export default function Attachment({
|
|
|
17
17
|
const ref = React.useRef();
|
|
18
18
|
const [dragging, setDragging] = React.useState(false);
|
|
19
19
|
const [error, setError] = React.useState(false);
|
|
20
|
-
const items = data
|
|
20
|
+
const items = data?.attachment?.value || [];
|
|
21
21
|
const {
|
|
22
22
|
attachmentAllowed,
|
|
23
23
|
attachmentMaxSize,
|
|
@@ -58,7 +58,7 @@ export default function Attachment({
|
|
|
58
58
|
} = handleDrop(files);
|
|
59
59
|
if (success) {
|
|
60
60
|
setData(data => {
|
|
61
|
-
const currentFiles = data
|
|
61
|
+
const currentFiles = data?.attachment?.value || [];
|
|
62
62
|
const newFiles = convertToFileList([...currentFiles, ...files]);
|
|
63
63
|
return {
|
|
64
64
|
...data,
|
|
@@ -35,7 +35,8 @@ export default function Field({
|
|
|
35
35
|
} = field;
|
|
36
36
|
const [activated, setActivated] = React.useState(false);
|
|
37
37
|
const [valid, setValid] = React.useState(!required || false);
|
|
38
|
-
const
|
|
38
|
+
const presetValues = presets?.values;
|
|
39
|
+
const disablePresetedFields = presetValues && presets?.disableFields && Object.keys(presets.values).includes(name);
|
|
39
40
|
const isTitle = type === "title";
|
|
40
41
|
const classes = classNames({
|
|
41
42
|
[css.fieldFullWidth]: isTitle || fullWidth,
|
|
@@ -65,7 +66,7 @@ export default function Field({
|
|
|
65
66
|
field: field,
|
|
66
67
|
data: data,
|
|
67
68
|
setData: setData,
|
|
68
|
-
disabled:
|
|
69
|
+
disabled: disablePresetedFields,
|
|
69
70
|
activated: activated,
|
|
70
71
|
setActivated: setActivated,
|
|
71
72
|
valid: valid,
|