@panneau/field-upload 3.0.158 → 3.0.160
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 +19 -89
- package/lib/index.js +19 -89
- package/package.json +12 -11
package/es/index.js
CHANGED
|
@@ -10,12 +10,10 @@ import PropTypes from 'prop-types';
|
|
|
10
10
|
import React, { useCallback, useMemo, useState, useRef, useEffect } from 'react';
|
|
11
11
|
import { FormattedMessage } from 'react-intl';
|
|
12
12
|
import { PropTypes as PropTypes$1 } from '@panneau/core';
|
|
13
|
-
import { useQuery } from '@panneau/core/hooks';
|
|
14
13
|
import Button from '@panneau/element-button';
|
|
15
14
|
import Label from '@panneau/element-label';
|
|
16
15
|
import MediaCard, { MediaCards } from '@panneau/element-media-card';
|
|
17
|
-
import
|
|
18
|
-
import Dialog from '@panneau/modal-dialog';
|
|
16
|
+
import ModalPicker from '@panneau/modal-medias-picker';
|
|
19
17
|
import { useUppy } from '@panneau/uppy';
|
|
20
18
|
import '@uppy/core/dist/style.css';
|
|
21
19
|
import '@uppy/dashboard/dist/style.css';
|
|
@@ -37,12 +35,10 @@ var propTypes$1 = {
|
|
|
37
35
|
withButton: PropTypes.bool,
|
|
38
36
|
withFind: PropTypes.bool,
|
|
39
37
|
withClearButton: PropTypes.bool,
|
|
38
|
+
withoutMedia: PropTypes.bool,
|
|
40
39
|
addButtonLabel: PropTypes$1.label,
|
|
41
40
|
findButtonLabel: PropTypes$1.label,
|
|
42
41
|
clearButtonLabel: PropTypes$1.label,
|
|
43
|
-
countLabel: PropTypes$1.label,
|
|
44
|
-
confirmButtonLabel: PropTypes$1.label,
|
|
45
|
-
cancelButtonLabel: PropTypes$1.label,
|
|
46
42
|
allowMultipleUploads: PropTypes.bool,
|
|
47
43
|
maxNumberOfFiles: PropTypes.number,
|
|
48
44
|
namePath: PropTypes.string,
|
|
@@ -69,11 +65,12 @@ var defaultProps$1 = {
|
|
|
69
65
|
withButton: false,
|
|
70
66
|
withFind: false,
|
|
71
67
|
withClearButton: false,
|
|
68
|
+
withoutMedia: false,
|
|
72
69
|
addButtonLabel: /*#__PURE__*/React.createElement(FormattedMessage, {
|
|
73
|
-
id: "
|
|
70
|
+
id: "BeKVq6",
|
|
74
71
|
defaultMessage: [{
|
|
75
72
|
"type": 0,
|
|
76
|
-
"value": "
|
|
73
|
+
"value": "Upload file"
|
|
77
74
|
}]
|
|
78
75
|
}),
|
|
79
76
|
findButtonLabel: /*#__PURE__*/React.createElement(FormattedMessage, {
|
|
@@ -90,27 +87,6 @@ var defaultProps$1 = {
|
|
|
90
87
|
"value": "Clear"
|
|
91
88
|
}]
|
|
92
89
|
}),
|
|
93
|
-
countLabel: /*#__PURE__*/React.createElement(FormattedMessage, {
|
|
94
|
-
id: "XLOebh",
|
|
95
|
-
defaultMessage: [{
|
|
96
|
-
"type": 0,
|
|
97
|
-
"value": "items selected"
|
|
98
|
-
}]
|
|
99
|
-
}),
|
|
100
|
-
confirmButtonLabel: /*#__PURE__*/React.createElement(FormattedMessage, {
|
|
101
|
-
id: "UaVu03",
|
|
102
|
-
defaultMessage: [{
|
|
103
|
-
"type": 0,
|
|
104
|
-
"value": "Confirm"
|
|
105
|
-
}]
|
|
106
|
-
}),
|
|
107
|
-
cancelButtonLabel: /*#__PURE__*/React.createElement(FormattedMessage, {
|
|
108
|
-
id: "PyxZY2",
|
|
109
|
-
defaultMessage: [{
|
|
110
|
-
"type": 0,
|
|
111
|
-
"value": "Cancel"
|
|
112
|
-
}]
|
|
113
|
-
}),
|
|
114
90
|
allowMultipleUploads: false,
|
|
115
91
|
maxNumberOfFiles: 1,
|
|
116
92
|
namePath: 'name',
|
|
@@ -135,12 +111,10 @@ var UploadField = function UploadField(_ref) {
|
|
|
135
111
|
withButton = _ref.withButton,
|
|
136
112
|
withFind = _ref.withFind,
|
|
137
113
|
withClearButton = _ref.withClearButton,
|
|
114
|
+
withoutMedia = _ref.withoutMedia,
|
|
138
115
|
addButtonLabel = _ref.addButtonLabel,
|
|
139
116
|
findButtonLabel = _ref.findButtonLabel,
|
|
140
117
|
clearButtonLabel = _ref.clearButtonLabel,
|
|
141
|
-
countLabel = _ref.countLabel,
|
|
142
|
-
confirmButtonLabel = _ref.confirmButtonLabel,
|
|
143
|
-
cancelButtonLabel = _ref.cancelButtonLabel,
|
|
144
118
|
allowMultipleUploads = _ref.allowMultipleUploads,
|
|
145
119
|
maxNumberOfFiles = _ref.maxNumberOfFiles,
|
|
146
120
|
namePath = _ref.namePath,
|
|
@@ -271,7 +245,7 @@ var UploadField = function UploadField(_ref) {
|
|
|
271
245
|
setResourceModalOpen(false);
|
|
272
246
|
setModalItems(null);
|
|
273
247
|
}, [resourceModalOpen, setResourceModalOpen, setModalItems]);
|
|
274
|
-
var
|
|
248
|
+
var onChangeSelection = useCallback(function (newValue) {
|
|
275
249
|
if (allowMultipleUploads) {
|
|
276
250
|
if (newValue !== null && !isArray(newValue)) {
|
|
277
251
|
var _ref2 = newValue || {},
|
|
@@ -308,31 +282,12 @@ var UploadField = function UploadField(_ref) {
|
|
|
308
282
|
setResourceModalOpen(false);
|
|
309
283
|
}
|
|
310
284
|
}, [onChange, setResourceModalOpen, allowMultipleUploads, modalItems, setModalItems]);
|
|
311
|
-
var
|
|
285
|
+
var onConfirmSelection = useCallback(function () {
|
|
312
286
|
if (onChange !== null) {
|
|
313
|
-
// Always multiple onchange
|
|
314
287
|
onChange(modalItems);
|
|
315
288
|
setResourceModalOpen(false);
|
|
316
|
-
setModalItems(null);
|
|
317
289
|
}
|
|
318
|
-
}, [onChange,
|
|
319
|
-
var initialQuery = useMemo(function () {
|
|
320
|
-
return {
|
|
321
|
-
types: types
|
|
322
|
-
};
|
|
323
|
-
}, [types]);
|
|
324
|
-
var _useQuery = useQuery(initialQuery, true),
|
|
325
|
-
listQuery = _useQuery.query,
|
|
326
|
-
onListPageChange = _useQuery.onPageChange,
|
|
327
|
-
onListQueryChange = _useQuery.onQueryChange,
|
|
328
|
-
onListQueryReset = _useQuery.onQueryReset;
|
|
329
|
-
|
|
330
|
-
// console.log(
|
|
331
|
-
// 'modalOpened',
|
|
332
|
-
// !showResourceModal && !disabled && withButton && uppy !== null && modalOpened,
|
|
333
|
-
// );
|
|
334
|
-
// console.log('uppy', uppy);
|
|
335
|
-
|
|
290
|
+
}, [onChange, modalItems, setResourceModalOpen, allowMultipleUploads]);
|
|
336
291
|
var containerRef = useRef(null);
|
|
337
292
|
|
|
338
293
|
// Keep this stable, uppy doesnt like
|
|
@@ -348,7 +303,7 @@ var UploadField = function UploadField(_ref) {
|
|
|
348
303
|
return /*#__PURE__*/React.createElement("div", {
|
|
349
304
|
className: classNames([styles.container, _defineProperty({}, className, className !== null)]),
|
|
350
305
|
ref: containerRef
|
|
351
|
-
}, hasMedia ? /*#__PURE__*/React.createElement(MediaCards, {
|
|
306
|
+
}, !withoutMedia && hasMedia ? /*#__PURE__*/React.createElement(MediaCards, {
|
|
352
307
|
value: values,
|
|
353
308
|
namePath: namePath,
|
|
354
309
|
thumbnailPath: thumbnailPath,
|
|
@@ -356,7 +311,7 @@ var UploadField = function UploadField(_ref) {
|
|
|
356
311
|
linkPath: linkPath,
|
|
357
312
|
disabled: disabled,
|
|
358
313
|
onClickRemove: onClickRemove
|
|
359
|
-
}) : null, hasMedia && withClearButton ? /*#__PURE__*/React.createElement("div", {
|
|
314
|
+
}) : null, !withoutMedia && hasMedia && withClearButton ? /*#__PURE__*/React.createElement("div", {
|
|
360
315
|
className: "row mt-2"
|
|
361
316
|
}, /*#__PURE__*/React.createElement("div", {
|
|
362
317
|
className: "col-auto"
|
|
@@ -365,7 +320,7 @@ var UploadField = function UploadField(_ref) {
|
|
|
365
320
|
theme: "primary",
|
|
366
321
|
onClick: onClickClear,
|
|
367
322
|
outline: true
|
|
368
|
-
}, /*#__PURE__*/React.createElement(Label, null, clearButtonLabel)))) : null, (!hasMedia || allowMultipleUploads) && withButton ? /*#__PURE__*/React.createElement("div", {
|
|
323
|
+
}, /*#__PURE__*/React.createElement(Label, null, clearButtonLabel)))) : null, withoutMedia || (!hasMedia || allowMultipleUploads) && withButton ? /*#__PURE__*/React.createElement("div", {
|
|
369
324
|
className: "row"
|
|
370
325
|
}, /*#__PURE__*/React.createElement("div", {
|
|
371
326
|
className: "col-auto"
|
|
@@ -414,40 +369,15 @@ var UploadField = function UploadField(_ref) {
|
|
|
414
369
|
showProgressDetails: true,
|
|
415
370
|
showAddFilesPanel: true,
|
|
416
371
|
doneButtonHandler: closeModal
|
|
417
|
-
}) : null, showResourceModal ? /*#__PURE__*/React.createElement(
|
|
418
|
-
title: /*#__PURE__*/React.createElement(Label, null, findButtonLabel),
|
|
419
|
-
size: "xl",
|
|
420
|
-
onClose: closeResourceModal
|
|
421
|
-
}, /*#__PURE__*/React.createElement(ResourceItemsList, {
|
|
372
|
+
}) : null, showResourceModal ? /*#__PURE__*/React.createElement(ModalPicker, {
|
|
422
373
|
resource: "medias",
|
|
423
|
-
|
|
424
|
-
onPageChange: onListPageChange,
|
|
425
|
-
onQueryChange: onListQueryChange,
|
|
426
|
-
onQueryReset: onListQueryReset,
|
|
427
|
-
baseUrl: null,
|
|
428
|
-
showActions: false,
|
|
374
|
+
types: types,
|
|
429
375
|
selectable: true,
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
}
|
|
435
|
-
className: "me-2"
|
|
436
|
-
}, modalItems.length, " ", countLabel) : /*#__PURE__*/React.createElement("span", null), /*#__PURE__*/React.createElement("div", {
|
|
437
|
-
className: "d-flex"
|
|
438
|
-
}, /*#__PURE__*/React.createElement(Button, {
|
|
439
|
-
type: "button",
|
|
440
|
-
theme: "secondary",
|
|
441
|
-
onClick: closeResourceModal,
|
|
442
|
-
disabled: disabled,
|
|
443
|
-
className: "d-block me-2"
|
|
444
|
-
}, /*#__PURE__*/React.createElement(Label, null, cancelButtonLabel)), /*#__PURE__*/React.createElement(Button, {
|
|
445
|
-
type: "button",
|
|
446
|
-
theme: "primary",
|
|
447
|
-
onClick: confirmResourceModal,
|
|
448
|
-
disabled: disabled || modalItems !== null && modalItems.length === 0,
|
|
449
|
-
className: "d-block"
|
|
450
|
-
}, /*#__PURE__*/React.createElement(Label, null, confirmButtonLabel)))) : null) : null);
|
|
376
|
+
onChange: onChangeSelection,
|
|
377
|
+
onConfirm: onConfirmSelection,
|
|
378
|
+
onClose: closeResourceModal,
|
|
379
|
+
multiple: allowMultipleUploads
|
|
380
|
+
}) : null);
|
|
451
381
|
};
|
|
452
382
|
UploadField.propTypes = propTypes$1;
|
|
453
383
|
UploadField.defaultProps = defaultProps$1;
|
package/lib/index.js
CHANGED
|
@@ -14,12 +14,10 @@ var PropTypes = require('prop-types');
|
|
|
14
14
|
var React = require('react');
|
|
15
15
|
var reactIntl = require('react-intl');
|
|
16
16
|
var core = require('@panneau/core');
|
|
17
|
-
var hooks = require('@panneau/core/hooks');
|
|
18
17
|
var Button = require('@panneau/element-button');
|
|
19
18
|
var Label = require('@panneau/element-label');
|
|
20
19
|
var MediaCard = require('@panneau/element-media-card');
|
|
21
|
-
var
|
|
22
|
-
var Dialog = require('@panneau/modal-dialog');
|
|
20
|
+
var ModalPicker = require('@panneau/modal-medias-picker');
|
|
23
21
|
var uppy = require('@panneau/uppy');
|
|
24
22
|
require('@uppy/core/dist/style.css');
|
|
25
23
|
require('@uppy/dashboard/dist/style.css');
|
|
@@ -41,12 +39,10 @@ var propTypes$1 = {
|
|
|
41
39
|
withButton: PropTypes.bool,
|
|
42
40
|
withFind: PropTypes.bool,
|
|
43
41
|
withClearButton: PropTypes.bool,
|
|
42
|
+
withoutMedia: PropTypes.bool,
|
|
44
43
|
addButtonLabel: core.PropTypes.label,
|
|
45
44
|
findButtonLabel: core.PropTypes.label,
|
|
46
45
|
clearButtonLabel: core.PropTypes.label,
|
|
47
|
-
countLabel: core.PropTypes.label,
|
|
48
|
-
confirmButtonLabel: core.PropTypes.label,
|
|
49
|
-
cancelButtonLabel: core.PropTypes.label,
|
|
50
46
|
allowMultipleUploads: PropTypes.bool,
|
|
51
47
|
maxNumberOfFiles: PropTypes.number,
|
|
52
48
|
namePath: PropTypes.string,
|
|
@@ -73,11 +69,12 @@ var defaultProps$1 = {
|
|
|
73
69
|
withButton: false,
|
|
74
70
|
withFind: false,
|
|
75
71
|
withClearButton: false,
|
|
72
|
+
withoutMedia: false,
|
|
76
73
|
addButtonLabel: /*#__PURE__*/React.createElement(reactIntl.FormattedMessage, {
|
|
77
|
-
id: "
|
|
74
|
+
id: "BeKVq6",
|
|
78
75
|
defaultMessage: [{
|
|
79
76
|
"type": 0,
|
|
80
|
-
"value": "
|
|
77
|
+
"value": "Upload file"
|
|
81
78
|
}]
|
|
82
79
|
}),
|
|
83
80
|
findButtonLabel: /*#__PURE__*/React.createElement(reactIntl.FormattedMessage, {
|
|
@@ -94,27 +91,6 @@ var defaultProps$1 = {
|
|
|
94
91
|
"value": "Clear"
|
|
95
92
|
}]
|
|
96
93
|
}),
|
|
97
|
-
countLabel: /*#__PURE__*/React.createElement(reactIntl.FormattedMessage, {
|
|
98
|
-
id: "XLOebh",
|
|
99
|
-
defaultMessage: [{
|
|
100
|
-
"type": 0,
|
|
101
|
-
"value": "items selected"
|
|
102
|
-
}]
|
|
103
|
-
}),
|
|
104
|
-
confirmButtonLabel: /*#__PURE__*/React.createElement(reactIntl.FormattedMessage, {
|
|
105
|
-
id: "UaVu03",
|
|
106
|
-
defaultMessage: [{
|
|
107
|
-
"type": 0,
|
|
108
|
-
"value": "Confirm"
|
|
109
|
-
}]
|
|
110
|
-
}),
|
|
111
|
-
cancelButtonLabel: /*#__PURE__*/React.createElement(reactIntl.FormattedMessage, {
|
|
112
|
-
id: "PyxZY2",
|
|
113
|
-
defaultMessage: [{
|
|
114
|
-
"type": 0,
|
|
115
|
-
"value": "Cancel"
|
|
116
|
-
}]
|
|
117
|
-
}),
|
|
118
94
|
allowMultipleUploads: false,
|
|
119
95
|
maxNumberOfFiles: 1,
|
|
120
96
|
namePath: 'name',
|
|
@@ -139,12 +115,10 @@ var UploadField = function UploadField(_ref) {
|
|
|
139
115
|
withButton = _ref.withButton,
|
|
140
116
|
withFind = _ref.withFind,
|
|
141
117
|
withClearButton = _ref.withClearButton,
|
|
118
|
+
withoutMedia = _ref.withoutMedia,
|
|
142
119
|
addButtonLabel = _ref.addButtonLabel,
|
|
143
120
|
findButtonLabel = _ref.findButtonLabel,
|
|
144
121
|
clearButtonLabel = _ref.clearButtonLabel,
|
|
145
|
-
countLabel = _ref.countLabel,
|
|
146
|
-
confirmButtonLabel = _ref.confirmButtonLabel,
|
|
147
|
-
cancelButtonLabel = _ref.cancelButtonLabel,
|
|
148
122
|
allowMultipleUploads = _ref.allowMultipleUploads,
|
|
149
123
|
maxNumberOfFiles = _ref.maxNumberOfFiles,
|
|
150
124
|
namePath = _ref.namePath,
|
|
@@ -275,7 +249,7 @@ var UploadField = function UploadField(_ref) {
|
|
|
275
249
|
setResourceModalOpen(false);
|
|
276
250
|
setModalItems(null);
|
|
277
251
|
}, [resourceModalOpen, setResourceModalOpen, setModalItems]);
|
|
278
|
-
var
|
|
252
|
+
var onChangeSelection = React.useCallback(function (newValue) {
|
|
279
253
|
if (allowMultipleUploads) {
|
|
280
254
|
if (newValue !== null && !isArray(newValue)) {
|
|
281
255
|
var _ref2 = newValue || {},
|
|
@@ -312,31 +286,12 @@ var UploadField = function UploadField(_ref) {
|
|
|
312
286
|
setResourceModalOpen(false);
|
|
313
287
|
}
|
|
314
288
|
}, [onChange, setResourceModalOpen, allowMultipleUploads, modalItems, setModalItems]);
|
|
315
|
-
var
|
|
289
|
+
var onConfirmSelection = React.useCallback(function () {
|
|
316
290
|
if (onChange !== null) {
|
|
317
|
-
// Always multiple onchange
|
|
318
291
|
onChange(modalItems);
|
|
319
292
|
setResourceModalOpen(false);
|
|
320
|
-
setModalItems(null);
|
|
321
293
|
}
|
|
322
|
-
}, [onChange,
|
|
323
|
-
var initialQuery = React.useMemo(function () {
|
|
324
|
-
return {
|
|
325
|
-
types: types
|
|
326
|
-
};
|
|
327
|
-
}, [types]);
|
|
328
|
-
var _useQuery = hooks.useQuery(initialQuery, true),
|
|
329
|
-
listQuery = _useQuery.query,
|
|
330
|
-
onListPageChange = _useQuery.onPageChange,
|
|
331
|
-
onListQueryChange = _useQuery.onQueryChange,
|
|
332
|
-
onListQueryReset = _useQuery.onQueryReset;
|
|
333
|
-
|
|
334
|
-
// console.log(
|
|
335
|
-
// 'modalOpened',
|
|
336
|
-
// !showResourceModal && !disabled && withButton && uppy !== null && modalOpened,
|
|
337
|
-
// );
|
|
338
|
-
// console.log('uppy', uppy);
|
|
339
|
-
|
|
294
|
+
}, [onChange, modalItems, setResourceModalOpen, allowMultipleUploads]);
|
|
340
295
|
var containerRef = React.useRef(null);
|
|
341
296
|
|
|
342
297
|
// Keep this stable, uppy doesnt like
|
|
@@ -352,7 +307,7 @@ var UploadField = function UploadField(_ref) {
|
|
|
352
307
|
return /*#__PURE__*/React.createElement("div", {
|
|
353
308
|
className: classNames([styles.container, _defineProperty({}, className, className !== null)]),
|
|
354
309
|
ref: containerRef
|
|
355
|
-
}, hasMedia ? /*#__PURE__*/React.createElement(MediaCard.MediaCards, {
|
|
310
|
+
}, !withoutMedia && hasMedia ? /*#__PURE__*/React.createElement(MediaCard.MediaCards, {
|
|
356
311
|
value: values,
|
|
357
312
|
namePath: namePath,
|
|
358
313
|
thumbnailPath: thumbnailPath,
|
|
@@ -360,7 +315,7 @@ var UploadField = function UploadField(_ref) {
|
|
|
360
315
|
linkPath: linkPath,
|
|
361
316
|
disabled: disabled,
|
|
362
317
|
onClickRemove: onClickRemove
|
|
363
|
-
}) : null, hasMedia && withClearButton ? /*#__PURE__*/React.createElement("div", {
|
|
318
|
+
}) : null, !withoutMedia && hasMedia && withClearButton ? /*#__PURE__*/React.createElement("div", {
|
|
364
319
|
className: "row mt-2"
|
|
365
320
|
}, /*#__PURE__*/React.createElement("div", {
|
|
366
321
|
className: "col-auto"
|
|
@@ -369,7 +324,7 @@ var UploadField = function UploadField(_ref) {
|
|
|
369
324
|
theme: "primary",
|
|
370
325
|
onClick: onClickClear,
|
|
371
326
|
outline: true
|
|
372
|
-
}, /*#__PURE__*/React.createElement(Label, null, clearButtonLabel)))) : null, (!hasMedia || allowMultipleUploads) && withButton ? /*#__PURE__*/React.createElement("div", {
|
|
327
|
+
}, /*#__PURE__*/React.createElement(Label, null, clearButtonLabel)))) : null, withoutMedia || (!hasMedia || allowMultipleUploads) && withButton ? /*#__PURE__*/React.createElement("div", {
|
|
373
328
|
className: "row"
|
|
374
329
|
}, /*#__PURE__*/React.createElement("div", {
|
|
375
330
|
className: "col-auto"
|
|
@@ -418,40 +373,15 @@ var UploadField = function UploadField(_ref) {
|
|
|
418
373
|
showProgressDetails: true,
|
|
419
374
|
showAddFilesPanel: true,
|
|
420
375
|
doneButtonHandler: closeModal
|
|
421
|
-
}) : null, showResourceModal ? /*#__PURE__*/React.createElement(
|
|
422
|
-
title: /*#__PURE__*/React.createElement(Label, null, findButtonLabel),
|
|
423
|
-
size: "xl",
|
|
424
|
-
onClose: closeResourceModal
|
|
425
|
-
}, /*#__PURE__*/React.createElement(ResourceItemsList, {
|
|
376
|
+
}) : null, showResourceModal ? /*#__PURE__*/React.createElement(ModalPicker, {
|
|
426
377
|
resource: "medias",
|
|
427
|
-
|
|
428
|
-
onPageChange: onListPageChange,
|
|
429
|
-
onQueryChange: onListQueryChange,
|
|
430
|
-
onQueryReset: onListQueryReset,
|
|
431
|
-
baseUrl: null,
|
|
432
|
-
showActions: false,
|
|
378
|
+
types: types,
|
|
433
379
|
selectable: true,
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
}
|
|
439
|
-
className: "me-2"
|
|
440
|
-
}, modalItems.length, " ", countLabel) : /*#__PURE__*/React.createElement("span", null), /*#__PURE__*/React.createElement("div", {
|
|
441
|
-
className: "d-flex"
|
|
442
|
-
}, /*#__PURE__*/React.createElement(Button, {
|
|
443
|
-
type: "button",
|
|
444
|
-
theme: "secondary",
|
|
445
|
-
onClick: closeResourceModal,
|
|
446
|
-
disabled: disabled,
|
|
447
|
-
className: "d-block me-2"
|
|
448
|
-
}, /*#__PURE__*/React.createElement(Label, null, cancelButtonLabel)), /*#__PURE__*/React.createElement(Button, {
|
|
449
|
-
type: "button",
|
|
450
|
-
theme: "primary",
|
|
451
|
-
onClick: confirmResourceModal,
|
|
452
|
-
disabled: disabled || modalItems !== null && modalItems.length === 0,
|
|
453
|
-
className: "d-block"
|
|
454
|
-
}, /*#__PURE__*/React.createElement(Label, null, confirmButtonLabel)))) : null) : null);
|
|
380
|
+
onChange: onChangeSelection,
|
|
381
|
+
onConfirm: onConfirmSelection,
|
|
382
|
+
onClose: closeResourceModal,
|
|
383
|
+
multiple: allowMultipleUploads
|
|
384
|
+
}) : null);
|
|
455
385
|
};
|
|
456
386
|
UploadField.propTypes = propTypes$1;
|
|
457
387
|
UploadField.defaultProps = defaultProps$1;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@panneau/field-upload",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.160",
|
|
4
4
|
"description": "An Upload field",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"javascript"
|
|
@@ -57,15 +57,16 @@
|
|
|
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-
|
|
67
|
-
"@panneau/
|
|
68
|
-
"@panneau/
|
|
60
|
+
"@panneau/core": "^3.0.160",
|
|
61
|
+
"@panneau/element-button": "^3.0.160",
|
|
62
|
+
"@panneau/element-label": "^3.0.160",
|
|
63
|
+
"@panneau/element-media-card": "^3.0.160",
|
|
64
|
+
"@panneau/list-resource-items": "^3.0.160",
|
|
65
|
+
"@panneau/modal-dialog": "^3.0.160",
|
|
66
|
+
"@panneau/modal-medias-picker": "^3.0.160",
|
|
67
|
+
"@panneau/modal-upload": "^3.0.160",
|
|
68
|
+
"@panneau/themes": "^3.0.160",
|
|
69
|
+
"@panneau/uppy": "^3.0.160",
|
|
69
70
|
"@uppy/core": "^3.9.1",
|
|
70
71
|
"@uppy/dashboard": "^3.7.3",
|
|
71
72
|
"@uppy/drag-drop": "^3.0.3",
|
|
@@ -82,5 +83,5 @@
|
|
|
82
83
|
"publishConfig": {
|
|
83
84
|
"access": "public"
|
|
84
85
|
},
|
|
85
|
-
"gitHead": "
|
|
86
|
+
"gitHead": "71a2a64cd2e0ed3cc921b0ec3b0a69449a4a978c"
|
|
86
87
|
}
|