@panneau/field-upload 3.0.23 → 3.0.25
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 +41 -8
- package/lib/index.js +40 -7
- package/package.json +3 -3
package/es/index.js
CHANGED
|
@@ -4,7 +4,7 @@ import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
|
|
|
4
4
|
import _objectSpread from '@babel/runtime/helpers/objectSpread2';
|
|
5
5
|
import { faTimes, faFileVideo, faFileImage, faFileAudio } from '@fortawesome/free-solid-svg-icons';
|
|
6
6
|
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
|
7
|
-
import { Dashboard
|
|
7
|
+
import { Dashboard } from '@uppy/react';
|
|
8
8
|
import classNames from 'classnames';
|
|
9
9
|
import get from 'lodash/get';
|
|
10
10
|
import isArray from 'lodash/isArray';
|
|
@@ -188,6 +188,12 @@ var UploadField = function UploadField(_ref) {
|
|
|
188
188
|
var closeModal = useCallback(function () {
|
|
189
189
|
setModalOpened(false);
|
|
190
190
|
}, [setModalOpened]);
|
|
191
|
+
var closeModalAndClear = useCallback(function () {
|
|
192
|
+
closeModal();
|
|
193
|
+
if (uppy !== null) {
|
|
194
|
+
uppy.cancelAll();
|
|
195
|
+
}
|
|
196
|
+
}, [uppy, closeModal]);
|
|
191
197
|
var onClickRemove = useCallback(function (idx) {
|
|
192
198
|
if (onChange !== null && isArray(value) && value.length > 1) {
|
|
193
199
|
onChange(value.filter(function (v, i) {
|
|
@@ -387,14 +393,41 @@ var UploadField = function UploadField(_ref) {
|
|
|
387
393
|
areInsidesReadyToBeVisible: true,
|
|
388
394
|
proudlyDisplayPoweredByUppy: false,
|
|
389
395
|
showProgressDetails: true
|
|
390
|
-
}))) : null, !showResourceModal && !disabled && withButton && uppy !== null
|
|
391
|
-
|
|
392
|
-
|
|
396
|
+
}))) : null, !showResourceModal && !disabled && withButton && uppy !== null && modalOpened ?
|
|
397
|
+
/*#__PURE__*/
|
|
398
|
+
// <DashboardModal
|
|
399
|
+
// uppy={uppy}
|
|
400
|
+
// className={styles.dashboardModal}
|
|
401
|
+
// plugins={sources}
|
|
402
|
+
// open={modalOpened}
|
|
403
|
+
// isHidden={!modalOpened}
|
|
404
|
+
// {...(width !== null ? { width } : null)}
|
|
405
|
+
// {...(height !== null ? { height } : null)}
|
|
406
|
+
// onRequestClose={closeModal}
|
|
407
|
+
// proudlyDisplayPoweredByUppy={false}
|
|
408
|
+
// closeModalOnClickOutside
|
|
409
|
+
// />
|
|
410
|
+
React.createElement(Dialog, {
|
|
411
|
+
size: "lg",
|
|
412
|
+
onClose: closeModal,
|
|
413
|
+
title: addButtonLabel
|
|
414
|
+
}, /*#__PURE__*/React.createElement(Dashboard, Object.assign({
|
|
415
|
+
uppy: uppy
|
|
416
|
+
// {...(containerWidth !== null && height !== null
|
|
417
|
+
// ? { width: containerWidth }
|
|
418
|
+
// : null)}
|
|
419
|
+
}, width !== null ? {
|
|
420
|
+
width: width
|
|
421
|
+
} : null, height !== null ? {
|
|
422
|
+
height: height
|
|
423
|
+
} : null, {
|
|
393
424
|
plugins: sources,
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
425
|
+
inline: true,
|
|
426
|
+
showProgressDetails: true,
|
|
427
|
+
areInsidesReadyToBeVisible: true,
|
|
428
|
+
proudlyDisplayPoweredByUppy: false,
|
|
429
|
+
doneButtonHandler: closeModalAndClear
|
|
430
|
+
}))) : null, showResourceModal ? /*#__PURE__*/React.createElement(Dialog, {
|
|
398
431
|
title: /*#__PURE__*/React.createElement(Label, null, searchButtonLabel),
|
|
399
432
|
size: "lg",
|
|
400
433
|
onClose: closeResourceModal
|
package/lib/index.js
CHANGED
|
@@ -210,6 +210,12 @@ var UploadField = function UploadField(_ref) {
|
|
|
210
210
|
var closeModal = React.useCallback(function () {
|
|
211
211
|
setModalOpened(false);
|
|
212
212
|
}, [setModalOpened]);
|
|
213
|
+
var closeModalAndClear = React.useCallback(function () {
|
|
214
|
+
closeModal();
|
|
215
|
+
if (uppy$1 !== null) {
|
|
216
|
+
uppy$1.cancelAll();
|
|
217
|
+
}
|
|
218
|
+
}, [uppy$1, closeModal]);
|
|
213
219
|
var onClickRemove = React.useCallback(function (idx) {
|
|
214
220
|
if (onChange !== null && isArray__default["default"](value) && value.length > 1) {
|
|
215
221
|
onChange(value.filter(function (v, i) {
|
|
@@ -409,14 +415,41 @@ var UploadField = function UploadField(_ref) {
|
|
|
409
415
|
areInsidesReadyToBeVisible: true,
|
|
410
416
|
proudlyDisplayPoweredByUppy: false,
|
|
411
417
|
showProgressDetails: true
|
|
412
|
-
}))) : null, !showResourceModal && !disabled && withButton && uppy$1 !== null
|
|
413
|
-
|
|
414
|
-
|
|
418
|
+
}))) : null, !showResourceModal && !disabled && withButton && uppy$1 !== null && modalOpened ?
|
|
419
|
+
/*#__PURE__*/
|
|
420
|
+
// <DashboardModal
|
|
421
|
+
// uppy={uppy}
|
|
422
|
+
// className={styles.dashboardModal}
|
|
423
|
+
// plugins={sources}
|
|
424
|
+
// open={modalOpened}
|
|
425
|
+
// isHidden={!modalOpened}
|
|
426
|
+
// {...(width !== null ? { width } : null)}
|
|
427
|
+
// {...(height !== null ? { height } : null)}
|
|
428
|
+
// onRequestClose={closeModal}
|
|
429
|
+
// proudlyDisplayPoweredByUppy={false}
|
|
430
|
+
// closeModalOnClickOutside
|
|
431
|
+
// />
|
|
432
|
+
React__default["default"].createElement(Dialog__default["default"], {
|
|
433
|
+
size: "lg",
|
|
434
|
+
onClose: closeModal,
|
|
435
|
+
title: addButtonLabel
|
|
436
|
+
}, /*#__PURE__*/React__default["default"].createElement(react.Dashboard, Object.assign({
|
|
437
|
+
uppy: uppy$1
|
|
438
|
+
// {...(containerWidth !== null && height !== null
|
|
439
|
+
// ? { width: containerWidth }
|
|
440
|
+
// : null)}
|
|
441
|
+
}, width !== null ? {
|
|
442
|
+
width: width
|
|
443
|
+
} : null, height !== null ? {
|
|
444
|
+
height: height
|
|
445
|
+
} : null, {
|
|
415
446
|
plugins: sources,
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
447
|
+
inline: true,
|
|
448
|
+
showProgressDetails: true,
|
|
449
|
+
areInsidesReadyToBeVisible: true,
|
|
450
|
+
proudlyDisplayPoweredByUppy: false,
|
|
451
|
+
doneButtonHandler: closeModalAndClear
|
|
452
|
+
}))) : null, showResourceModal ? /*#__PURE__*/React__default["default"].createElement(Dialog__default["default"], {
|
|
420
453
|
title: /*#__PURE__*/React__default["default"].createElement(Label__default["default"], null, searchButtonLabel),
|
|
421
454
|
size: "lg",
|
|
422
455
|
onClose: closeResourceModal
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@panneau/field-upload",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.25",
|
|
4
4
|
"description": "An Upload field",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"javascript"
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
"@panneau/element-card": "^3.0.23",
|
|
63
63
|
"@panneau/element-label": "^3.0.23",
|
|
64
64
|
"@panneau/list-resource-items": "^3.0.23",
|
|
65
|
-
"@panneau/modal-dialog": "^3.0.
|
|
65
|
+
"@panneau/modal-dialog": "^3.0.24",
|
|
66
66
|
"@panneau/themes": "^3.0.23",
|
|
67
67
|
"@panneau/uppy": "^3.0.23",
|
|
68
68
|
"@uppy/core": "^3.5.0",
|
|
@@ -82,5 +82,5 @@
|
|
|
82
82
|
"publishConfig": {
|
|
83
83
|
"access": "public"
|
|
84
84
|
},
|
|
85
|
-
"gitHead": "
|
|
85
|
+
"gitHead": "0743de3708364f23d0ade952b62a45c66d7bb699"
|
|
86
86
|
}
|