@panneau/field-upload 3.0.57 → 3.0.59

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 +43 -43
  2. package/lib/index.js +42 -42
  3. package/package.json +4 -4
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';
@@ -20,10 +20,10 @@ import Label from '@panneau/element-label';
20
20
  import ResourceItemsList from '@panneau/list-resource-items';
21
21
  import Dialog from '@panneau/modal-dialog';
22
22
  import { useUppy } from '@panneau/uppy';
23
- import '@uppy/core/dist/style.min.css';
24
- import '@uppy/dashboard/dist/style.min.css';
25
- import '@uppy/drag-drop/dist/style.min.css';
26
- import '@uppy/status-bar/dist/style.min.css';
23
+ import '@uppy/core/dist/style.css';
24
+ import '@uppy/dashboard/dist/style.css';
25
+ import '@uppy/drag-drop/dist/style.css';
26
+ import '@uppy/status-bar/dist/style.css';
27
27
 
28
28
  var styles = {"container":"panneau-field-upload-container","dashboard":"panneau-field-upload-dashboard","dashboardModal":"panneau-field-upload-dashboardModal"};
29
29
 
@@ -116,11 +116,6 @@ var UploadField = function UploadField(_ref) {
116
116
  disabled = _ref.disabled,
117
117
  onChange = _ref.onChange,
118
118
  className = _ref.className;
119
- // const [{ pathname = null }] = useLocation();
120
- // const { ref: containerRef, entry = null } = useResizeObserver();
121
- // const { contentRect } = entry || {};
122
- // const { width: containerWidth = null } = contentRect || {};
123
-
124
119
  var mergeData = useCallback(function (newValue) {
125
120
  // Merge the response from our back-end
126
121
  if (isObject(newValue) && isObject(newValue.response) && newValue.response.status === 200 && newValue.response.body !== null) {
@@ -188,7 +183,7 @@ var UploadField = function UploadField(_ref) {
188
183
  var closeModal = useCallback(function () {
189
184
  setModalOpened(false);
190
185
  }, [setModalOpened]);
191
- useCallback(function () {
186
+ var closeModalAndClear = useCallback(function () {
192
187
  closeModal();
193
188
  if (uppy !== null) {
194
189
  uppy.cancelAll();
@@ -393,44 +388,49 @@ var UploadField = function UploadField(_ref) {
393
388
  showProgressDetails: true,
394
389
  areInsidesReadyToBeVisible: true,
395
390
  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
391
+ }))) : null, !showResourceModal && !disabled && withButton && uppy !== null && modalOpened ?
392
+ /*#__PURE__*/
393
+ // <DashboardModal
394
+ // uppy={uppy}
395
+ // className={styles.dashboardModal}
396
+ // plugins={sources}
397
+ // open={modalOpened}
398
+ // isHidden={!modalOpened}
399
+ // {...(width !== null ? { width } : null)}
400
+ // {...(height !== null ? { height } : null)}
401
+ // onRequestClose={closeModal}
402
+ // proudlyDisplayPoweredByUppy={false}
403
+ // closeModalOnClickOutside
404
+ // areInsidesReadyToBeVisible
405
+ // isDashboardVisible
406
+ // showProgressDetailss
407
+ // showAddFilesPanel
408
+ // />
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)}
402
419
  }, width !== null ? {
403
420
  width: width
404
421
  } : null, height !== null ? {
405
422
  height: height
406
423
  } : null, {
407
- onRequestClose: closeModal,
424
+ plugins: sources,
425
+ inline: true,
426
+ showProgressDetails: true
427
+ // areInsidesReadyToBeVisible
428
+ // isDashboardVisible
429
+ ,
430
+ showAddFilesPanel: true,
408
431
  proudlyDisplayPoweredByUppy: false,
409
- closeModalOnClickOutside: true,
410
- areInsidesReadyToBeVisible: true,
411
- 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, {
432
+ doneButtonHandler: closeModalAndClear
433
+ }))) : null, showResourceModal ? /*#__PURE__*/React.createElement(Dialog, {
434
434
  title: /*#__PURE__*/React.createElement(Label, null, searchButtonLabel),
435
435
  size: "lg",
436
436
  onClose: closeResourceModal
package/lib/index.js CHANGED
@@ -24,10 +24,10 @@ var Label = require('@panneau/element-label');
24
24
  var ResourceItemsList = require('@panneau/list-resource-items');
25
25
  var Dialog = require('@panneau/modal-dialog');
26
26
  var uppy = require('@panneau/uppy');
27
- require('@uppy/core/dist/style.min.css');
28
- require('@uppy/dashboard/dist/style.min.css');
29
- require('@uppy/drag-drop/dist/style.min.css');
30
- require('@uppy/status-bar/dist/style.min.css');
27
+ require('@uppy/core/dist/style.css');
28
+ require('@uppy/dashboard/dist/style.css');
29
+ require('@uppy/drag-drop/dist/style.css');
30
+ require('@uppy/status-bar/dist/style.css');
31
31
 
32
32
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
33
33
 
@@ -138,11 +138,6 @@ var UploadField = function UploadField(_ref) {
138
138
  disabled = _ref.disabled,
139
139
  onChange = _ref.onChange,
140
140
  className = _ref.className;
141
- // const [{ pathname = null }] = useLocation();
142
- // const { ref: containerRef, entry = null } = useResizeObserver();
143
- // const { contentRect } = entry || {};
144
- // const { width: containerWidth = null } = contentRect || {};
145
-
146
141
  var mergeData = React.useCallback(function (newValue) {
147
142
  // Merge the response from our back-end
148
143
  if (isObject__default["default"](newValue) && isObject__default["default"](newValue.response) && newValue.response.status === 200 && newValue.response.body !== null) {
@@ -210,7 +205,7 @@ var UploadField = function UploadField(_ref) {
210
205
  var closeModal = React.useCallback(function () {
211
206
  setModalOpened(false);
212
207
  }, [setModalOpened]);
213
- React.useCallback(function () {
208
+ var closeModalAndClear = React.useCallback(function () {
214
209
  closeModal();
215
210
  if (uppy$1 !== null) {
216
211
  uppy$1.cancelAll();
@@ -415,44 +410,49 @@ var UploadField = function UploadField(_ref) {
415
410
  showProgressDetails: true,
416
411
  areInsidesReadyToBeVisible: true,
417
412
  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
413
+ }))) : null, !showResourceModal && !disabled && withButton && uppy$1 !== null && modalOpened ?
414
+ /*#__PURE__*/
415
+ // <DashboardModal
416
+ // uppy={uppy}
417
+ // className={styles.dashboardModal}
418
+ // plugins={sources}
419
+ // open={modalOpened}
420
+ // isHidden={!modalOpened}
421
+ // {...(width !== null ? { width } : null)}
422
+ // {...(height !== null ? { height } : null)}
423
+ // onRequestClose={closeModal}
424
+ // proudlyDisplayPoweredByUppy={false}
425
+ // closeModalOnClickOutside
426
+ // areInsidesReadyToBeVisible
427
+ // isDashboardVisible
428
+ // showProgressDetailss
429
+ // showAddFilesPanel
430
+ // />
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)}
424
441
  }, width !== null ? {
425
442
  width: width
426
443
  } : null, height !== null ? {
427
444
  height: height
428
445
  } : null, {
429
- onRequestClose: closeModal,
446
+ plugins: sources,
447
+ inline: true,
448
+ showProgressDetails: true
449
+ // areInsidesReadyToBeVisible
450
+ // isDashboardVisible
451
+ ,
452
+ showAddFilesPanel: true,
430
453
  proudlyDisplayPoweredByUppy: false,
431
- closeModalOnClickOutside: true,
432
- areInsidesReadyToBeVisible: true,
433
- 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"], {
454
+ doneButtonHandler: closeModalAndClear
455
+ }))) : null, showResourceModal ? /*#__PURE__*/React__default["default"].createElement(Dialog__default["default"], {
456
456
  title: /*#__PURE__*/React__default["default"].createElement(Label__default["default"], null, searchButtonLabel),
457
457
  size: "lg",
458
458
  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.59",
4
4
  "description": "An Upload field",
5
5
  "keywords": [
6
6
  "javascript"
@@ -61,10 +61,10 @@
61
61
  "@panneau/element-button": "^3.0.55",
62
62
  "@panneau/element-card": "^3.0.55",
63
63
  "@panneau/element-label": "^3.0.45",
64
- "@panneau/list-resource-items": "^3.0.55",
64
+ "@panneau/list-resource-items": "^3.0.59",
65
65
  "@panneau/modal-dialog": "^3.0.55",
66
66
  "@panneau/themes": "^3.0.55",
67
- "@panneau/uppy": "^3.0.56",
67
+ "@panneau/uppy": "^3.0.59",
68
68
  "@uppy/core": "^3.5.0",
69
69
  "@uppy/dashboard": "^3.5.2",
70
70
  "@uppy/drag-drop": "^3.0.3",
@@ -82,5 +82,5 @@
82
82
  "publishConfig": {
83
83
  "access": "public"
84
84
  },
85
- "gitHead": "336779835a337f6ba502b74595b3733f6288d3c2"
85
+ "gitHead": "91d48907b776239b19aea03fe91f2227014d0556"
86
86
  }