@panneau/field-upload 3.0.57 → 3.0.58

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.
Files changed (3) hide show
  1. package/es/index.js +37 -33
  2. package/lib/index.js +36 -32
  3. package/package.json +2 -2
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, DashboardModal } from '@uppy/react';
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,7 +188,7 @@ var UploadField = function UploadField(_ref) {
188
188
  var closeModal = useCallback(function () {
189
189
  setModalOpened(false);
190
190
  }, [setModalOpened]);
191
- useCallback(function () {
191
+ var closeModalAndClear = useCallback(function () {
192
192
  closeModal();
193
193
  if (uppy !== null) {
194
194
  uppy.cancelAll();
@@ -393,44 +393,48 @@ var UploadField = function UploadField(_ref) {
393
393
  showProgressDetails: true,
394
394
  areInsidesReadyToBeVisible: true,
395
395
  proudlyDisplayPoweredByUppy: false
396
- }))) : null, !showResourceModal && !disabled && withButton && uppy !== null ? /*#__PURE__*/React.createElement(DashboardModal, Object.assign({
397
- uppy: uppy,
398
- className: styles.dashboardModal,
399
- plugins: sources,
400
- open: modalOpened,
401
- isHidden: !modalOpened
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
+ // areInsidesReadyToBeVisible
410
+ // isDashboardVisible
411
+ // showProgressDetailss
412
+ // showAddFilesPanel
413
+ // />
414
+ // ) : //
415
+ React.createElement(Dialog, {
416
+ size: "lg",
417
+ onClose: closeModal,
418
+ title: addButtonLabel
419
+ }, /*#__PURE__*/React.createElement(Dashboard, Object.assign({
420
+ uppy: uppy
421
+ // {...(containerWidth !== null && height !== null
422
+ // ? { width: containerWidth }
423
+ // : null)}
402
424
  }, width !== null ? {
403
425
  width: width
404
426
  } : null, height !== null ? {
405
427
  height: height
406
428
  } : null, {
407
- onRequestClose: closeModal,
408
- proudlyDisplayPoweredByUppy: false,
409
- closeModalOnClickOutside: true,
429
+ plugins: sources,
430
+ inline: true,
431
+ showProgressDetails: true,
410
432
  areInsidesReadyToBeVisible: true,
411
433
  isDashboardVisible: true,
412
- showProgressDetailss: true,
413
- showAddFilesPanel: true
414
- })) :
415
- // <Dialog size="lg" onClose={closeModal} title={addButtonLabel}>
416
- // <Dashboard
417
- // uppy={uppy}
418
- // // {...(containerWidth !== null && height !== null
419
- // // ? { width: containerWidth }
420
- // // : null)}
421
- // {...(width !== null ? { width } : null)}
422
- // {...(height !== null ? { height } : null)}
423
- // plugins={sources}
424
- // inline
425
- // showProgressDetails
426
- // areInsidesReadyToBeVisible
427
- // isDashboardVisible
428
- // showAddFilesPanel
429
- // proudlyDisplayPoweredByUppy={false}
430
- // doneButtonHandler={closeModalAndClear}
431
- // />
432
- // </Dialog>
433
- null, showResourceModal ? /*#__PURE__*/React.createElement(Dialog, {
434
+ showAddFilesPanel: true,
435
+ proudlyDisplayPoweredByUppy: false,
436
+ doneButtonHandler: closeModalAndClear
437
+ }))) : null, showResourceModal ? /*#__PURE__*/React.createElement(Dialog, {
434
438
  title: /*#__PURE__*/React.createElement(Label, null, searchButtonLabel),
435
439
  size: "lg",
436
440
  onClose: closeResourceModal
package/lib/index.js CHANGED
@@ -210,7 +210,7 @@ var UploadField = function UploadField(_ref) {
210
210
  var closeModal = React.useCallback(function () {
211
211
  setModalOpened(false);
212
212
  }, [setModalOpened]);
213
- React.useCallback(function () {
213
+ var closeModalAndClear = React.useCallback(function () {
214
214
  closeModal();
215
215
  if (uppy$1 !== null) {
216
216
  uppy$1.cancelAll();
@@ -415,44 +415,48 @@ var UploadField = function UploadField(_ref) {
415
415
  showProgressDetails: true,
416
416
  areInsidesReadyToBeVisible: true,
417
417
  proudlyDisplayPoweredByUppy: false
418
- }))) : null, !showResourceModal && !disabled && withButton && uppy$1 !== null ? /*#__PURE__*/React__default["default"].createElement(react.DashboardModal, Object.assign({
419
- uppy: uppy$1,
420
- className: styles.dashboardModal,
421
- plugins: sources,
422
- open: modalOpened,
423
- isHidden: !modalOpened
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
+ // areInsidesReadyToBeVisible
432
+ // isDashboardVisible
433
+ // showProgressDetailss
434
+ // showAddFilesPanel
435
+ // />
436
+ // ) : //
437
+ React__default["default"].createElement(Dialog__default["default"], {
438
+ size: "lg",
439
+ onClose: closeModal,
440
+ title: addButtonLabel
441
+ }, /*#__PURE__*/React__default["default"].createElement(react.Dashboard, Object.assign({
442
+ uppy: uppy$1
443
+ // {...(containerWidth !== null && height !== null
444
+ // ? { width: containerWidth }
445
+ // : null)}
424
446
  }, width !== null ? {
425
447
  width: width
426
448
  } : null, height !== null ? {
427
449
  height: height
428
450
  } : null, {
429
- onRequestClose: closeModal,
430
- proudlyDisplayPoweredByUppy: false,
431
- closeModalOnClickOutside: true,
451
+ plugins: sources,
452
+ inline: true,
453
+ showProgressDetails: true,
432
454
  areInsidesReadyToBeVisible: true,
433
455
  isDashboardVisible: true,
434
- showProgressDetailss: true,
435
- showAddFilesPanel: true
436
- })) :
437
- // <Dialog size="lg" onClose={closeModal} title={addButtonLabel}>
438
- // <Dashboard
439
- // uppy={uppy}
440
- // // {...(containerWidth !== null && height !== null
441
- // // ? { width: containerWidth }
442
- // // : null)}
443
- // {...(width !== null ? { width } : null)}
444
- // {...(height !== null ? { height } : null)}
445
- // plugins={sources}
446
- // inline
447
- // showProgressDetails
448
- // areInsidesReadyToBeVisible
449
- // isDashboardVisible
450
- // showAddFilesPanel
451
- // proudlyDisplayPoweredByUppy={false}
452
- // doneButtonHandler={closeModalAndClear}
453
- // />
454
- // </Dialog>
455
- null, showResourceModal ? /*#__PURE__*/React__default["default"].createElement(Dialog__default["default"], {
456
+ showAddFilesPanel: true,
457
+ proudlyDisplayPoweredByUppy: false,
458
+ doneButtonHandler: closeModalAndClear
459
+ }))) : null, showResourceModal ? /*#__PURE__*/React__default["default"].createElement(Dialog__default["default"], {
456
460
  title: /*#__PURE__*/React__default["default"].createElement(Label__default["default"], null, searchButtonLabel),
457
461
  size: "lg",
458
462
  onClose: closeResourceModal
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@panneau/field-upload",
3
- "version": "3.0.57",
3
+ "version": "3.0.58",
4
4
  "description": "An Upload field",
5
5
  "keywords": [
6
6
  "javascript"
@@ -82,5 +82,5 @@
82
82
  "publishConfig": {
83
83
  "access": "public"
84
84
  },
85
- "gitHead": "336779835a337f6ba502b74595b3733f6288d3c2"
85
+ "gitHead": "dfe49b5c00a2425a7eb889d47ee5e78de6f49ccf"
86
86
  }