@panneau/field-upload 3.0.135 → 3.0.136
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 +5 -3
- package/lib/index.js +5 -3
- package/package.json +11 -11
package/es/index.js
CHANGED
|
@@ -273,7 +273,8 @@ var UploadField = function UploadField(_ref) {
|
|
|
273
273
|
}, [resourceModalOpen, setResourceModalOpen, setModalItems]);
|
|
274
274
|
var onClickSelect = useCallback(function (newValue) {
|
|
275
275
|
if (allowMultipleUploads) {
|
|
276
|
-
|
|
276
|
+
console.log('newValue', newValue);
|
|
277
|
+
if (newValue !== null && !isArray(newValue)) {
|
|
277
278
|
var _ref2 = newValue || {},
|
|
278
279
|
_ref2$id = _ref2.id,
|
|
279
280
|
id = _ref2$id === void 0 ? null : _ref2$id;
|
|
@@ -295,6 +296,8 @@ var UploadField = function UploadField(_ref) {
|
|
|
295
296
|
setModalItems([].concat(_toConsumableArray(modalItems || []), [newValue]));
|
|
296
297
|
}
|
|
297
298
|
}
|
|
299
|
+
} else if (newValue !== null && isArray(newValue)) {
|
|
300
|
+
setModalItems(newValue);
|
|
298
301
|
}
|
|
299
302
|
} else if (onChange !== null) {
|
|
300
303
|
onChange(newValue);
|
|
@@ -421,7 +424,7 @@ var UploadField = function UploadField(_ref) {
|
|
|
421
424
|
showActions: false,
|
|
422
425
|
selectable: true,
|
|
423
426
|
onSelectionChange: onClickSelect,
|
|
424
|
-
|
|
427
|
+
multipleSelection: allowMultipleUploads
|
|
425
428
|
}), allowMultipleUploads ? /*#__PURE__*/React.createElement("div", {
|
|
426
429
|
className: "d-flex mt-4 justify-content-between"
|
|
427
430
|
}, modalItems !== null && modalItems.length > 0 ? /*#__PURE__*/React.createElement("span", {
|
|
@@ -625,7 +628,6 @@ var UpdateFileField = function UpdateFileField(_ref) {
|
|
|
625
628
|
}]
|
|
626
629
|
}),
|
|
627
630
|
allowMultipleUploads: false,
|
|
628
|
-
multiple: false,
|
|
629
631
|
linkPath: "panneauUrl",
|
|
630
632
|
onChange: onUploadChange,
|
|
631
633
|
onClose: onUploadChange,
|
package/lib/index.js
CHANGED
|
@@ -277,7 +277,8 @@ var UploadField = function UploadField(_ref) {
|
|
|
277
277
|
}, [resourceModalOpen, setResourceModalOpen, setModalItems]);
|
|
278
278
|
var onClickSelect = React.useCallback(function (newValue) {
|
|
279
279
|
if (allowMultipleUploads) {
|
|
280
|
-
|
|
280
|
+
console.log('newValue', newValue);
|
|
281
|
+
if (newValue !== null && !isArray(newValue)) {
|
|
281
282
|
var _ref2 = newValue || {},
|
|
282
283
|
_ref2$id = _ref2.id,
|
|
283
284
|
id = _ref2$id === void 0 ? null : _ref2$id;
|
|
@@ -299,6 +300,8 @@ var UploadField = function UploadField(_ref) {
|
|
|
299
300
|
setModalItems([].concat(_toConsumableArray(modalItems || []), [newValue]));
|
|
300
301
|
}
|
|
301
302
|
}
|
|
303
|
+
} else if (newValue !== null && isArray(newValue)) {
|
|
304
|
+
setModalItems(newValue);
|
|
302
305
|
}
|
|
303
306
|
} else if (onChange !== null) {
|
|
304
307
|
onChange(newValue);
|
|
@@ -425,7 +428,7 @@ var UploadField = function UploadField(_ref) {
|
|
|
425
428
|
showActions: false,
|
|
426
429
|
selectable: true,
|
|
427
430
|
onSelectionChange: onClickSelect,
|
|
428
|
-
|
|
431
|
+
multipleSelection: allowMultipleUploads
|
|
429
432
|
}), allowMultipleUploads ? /*#__PURE__*/React.createElement("div", {
|
|
430
433
|
className: "d-flex mt-4 justify-content-between"
|
|
431
434
|
}, modalItems !== null && modalItems.length > 0 ? /*#__PURE__*/React.createElement("span", {
|
|
@@ -629,7 +632,6 @@ var UpdateFileField = function UpdateFileField(_ref) {
|
|
|
629
632
|
}]
|
|
630
633
|
}),
|
|
631
634
|
allowMultipleUploads: false,
|
|
632
|
-
multiple: false,
|
|
633
635
|
linkPath: "panneauUrl",
|
|
634
636
|
onChange: onUploadChange,
|
|
635
637
|
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.136",
|
|
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.136",
|
|
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": "c9a3de330286a6cadd73651f1893adbbe090cd0e"
|
|
86
86
|
}
|