@panneau/field-upload 3.0.135 → 3.0.137
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/es/index.js +4 -3
- package/lib/index.js +4 -3
- package/package.json +11 -11
package/es/index.js
CHANGED
|
@@ -273,7 +273,7 @@ var UploadField = function UploadField(_ref) {
|
|
|
273
273
|
}, [resourceModalOpen, setResourceModalOpen, setModalItems]);
|
|
274
274
|
var onClickSelect = useCallback(function (newValue) {
|
|
275
275
|
if (allowMultipleUploads) {
|
|
276
|
-
if (newValue !== null) {
|
|
276
|
+
if (newValue !== null && !isArray(newValue)) {
|
|
277
277
|
var _ref2 = newValue || {},
|
|
278
278
|
_ref2$id = _ref2.id,
|
|
279
279
|
id = _ref2$id === void 0 ? null : _ref2$id;
|
|
@@ -295,6 +295,8 @@ var UploadField = function UploadField(_ref) {
|
|
|
295
295
|
setModalItems([].concat(_toConsumableArray(modalItems || []), [newValue]));
|
|
296
296
|
}
|
|
297
297
|
}
|
|
298
|
+
} else if (newValue !== null && isArray(newValue)) {
|
|
299
|
+
setModalItems(newValue);
|
|
298
300
|
}
|
|
299
301
|
} else if (onChange !== null) {
|
|
300
302
|
onChange(newValue);
|
|
@@ -421,7 +423,7 @@ var UploadField = function UploadField(_ref) {
|
|
|
421
423
|
showActions: false,
|
|
422
424
|
selectable: true,
|
|
423
425
|
onSelectionChange: onClickSelect,
|
|
424
|
-
|
|
426
|
+
multipleSelection: allowMultipleUploads
|
|
425
427
|
}), allowMultipleUploads ? /*#__PURE__*/React.createElement("div", {
|
|
426
428
|
className: "d-flex mt-4 justify-content-between"
|
|
427
429
|
}, modalItems !== null && modalItems.length > 0 ? /*#__PURE__*/React.createElement("span", {
|
|
@@ -625,7 +627,6 @@ var UpdateFileField = function UpdateFileField(_ref) {
|
|
|
625
627
|
}]
|
|
626
628
|
}),
|
|
627
629
|
allowMultipleUploads: false,
|
|
628
|
-
multiple: false,
|
|
629
630
|
linkPath: "panneauUrl",
|
|
630
631
|
onChange: onUploadChange,
|
|
631
632
|
onClose: onUploadChange,
|
package/lib/index.js
CHANGED
|
@@ -277,7 +277,7 @@ var UploadField = function UploadField(_ref) {
|
|
|
277
277
|
}, [resourceModalOpen, setResourceModalOpen, setModalItems]);
|
|
278
278
|
var onClickSelect = React.useCallback(function (newValue) {
|
|
279
279
|
if (allowMultipleUploads) {
|
|
280
|
-
if (newValue !== null) {
|
|
280
|
+
if (newValue !== null && !isArray(newValue)) {
|
|
281
281
|
var _ref2 = newValue || {},
|
|
282
282
|
_ref2$id = _ref2.id,
|
|
283
283
|
id = _ref2$id === void 0 ? null : _ref2$id;
|
|
@@ -299,6 +299,8 @@ var UploadField = function UploadField(_ref) {
|
|
|
299
299
|
setModalItems([].concat(_toConsumableArray(modalItems || []), [newValue]));
|
|
300
300
|
}
|
|
301
301
|
}
|
|
302
|
+
} else if (newValue !== null && isArray(newValue)) {
|
|
303
|
+
setModalItems(newValue);
|
|
302
304
|
}
|
|
303
305
|
} else if (onChange !== null) {
|
|
304
306
|
onChange(newValue);
|
|
@@ -425,7 +427,7 @@ var UploadField = function UploadField(_ref) {
|
|
|
425
427
|
showActions: false,
|
|
426
428
|
selectable: true,
|
|
427
429
|
onSelectionChange: onClickSelect,
|
|
428
|
-
|
|
430
|
+
multipleSelection: allowMultipleUploads
|
|
429
431
|
}), allowMultipleUploads ? /*#__PURE__*/React.createElement("div", {
|
|
430
432
|
className: "d-flex mt-4 justify-content-between"
|
|
431
433
|
}, modalItems !== null && modalItems.length > 0 ? /*#__PURE__*/React.createElement("span", {
|
|
@@ -629,7 +631,6 @@ var UpdateFileField = function UpdateFileField(_ref) {
|
|
|
629
631
|
}]
|
|
630
632
|
}),
|
|
631
633
|
allowMultipleUploads: false,
|
|
632
|
-
multiple: false,
|
|
633
634
|
linkPath: "panneauUrl",
|
|
634
635
|
onChange: onUploadChange,
|
|
635
636
|
onClose: onUploadChange,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@panneau/field-upload",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.137",
|
|
4
4
|
"description": "An Upload field",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"javascript"
|
|
@@ -57,15 +57,15 @@
|
|
|
57
57
|
"@fortawesome/fontawesome-svg-core": "^6.5.1",
|
|
58
58
|
"@fortawesome/free-solid-svg-icons": "^6.5.1",
|
|
59
59
|
"@fortawesome/react-fontawesome": "^0.2.0",
|
|
60
|
-
"@panneau/core": "^3.0.
|
|
61
|
-
"@panneau/element-button": "^3.0.
|
|
62
|
-
"@panneau/element-label": "^3.0.
|
|
63
|
-
"@panneau/element-media-card": "^3.0.
|
|
64
|
-
"@panneau/list-resource-items": "^3.0.
|
|
65
|
-
"@panneau/modal-dialog": "^3.0.
|
|
66
|
-
"@panneau/modal-upload": "^3.0.
|
|
67
|
-
"@panneau/themes": "^3.0.
|
|
68
|
-
"@panneau/uppy": "^3.0.
|
|
60
|
+
"@panneau/core": "^3.0.136",
|
|
61
|
+
"@panneau/element-button": "^3.0.136",
|
|
62
|
+
"@panneau/element-label": "^3.0.136",
|
|
63
|
+
"@panneau/element-media-card": "^3.0.136",
|
|
64
|
+
"@panneau/list-resource-items": "^3.0.137",
|
|
65
|
+
"@panneau/modal-dialog": "^3.0.136",
|
|
66
|
+
"@panneau/modal-upload": "^3.0.136",
|
|
67
|
+
"@panneau/themes": "^3.0.136",
|
|
68
|
+
"@panneau/uppy": "^3.0.136",
|
|
69
69
|
"@uppy/core": "^3.9.1",
|
|
70
70
|
"@uppy/dashboard": "^3.7.3",
|
|
71
71
|
"@uppy/drag-drop": "^3.0.3",
|
|
@@ -82,5 +82,5 @@
|
|
|
82
82
|
"publishConfig": {
|
|
83
83
|
"access": "public"
|
|
84
84
|
},
|
|
85
|
-
"gitHead": "
|
|
85
|
+
"gitHead": "15122b8a8fa0e7b58a45d235171bbedd2e935d30"
|
|
86
86
|
}
|