@panneau/field-upload 3.0.197 → 3.0.199
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 +11 -7
- package/lib/index.js +11 -7
- package/package.json +3 -3
package/es/index.js
CHANGED
|
@@ -52,6 +52,7 @@ var propTypes$1 = {
|
|
|
52
52
|
width: PropTypes.number,
|
|
53
53
|
height: PropTypes.number,
|
|
54
54
|
disabled: PropTypes.bool,
|
|
55
|
+
uploadDisabled: PropTypes.bool,
|
|
55
56
|
loading: PropTypes.bool,
|
|
56
57
|
onChange: PropTypes.func,
|
|
57
58
|
onClear: PropTypes.func,
|
|
@@ -102,6 +103,7 @@ var defaultProps$1 = {
|
|
|
102
103
|
width: null,
|
|
103
104
|
height: 300,
|
|
104
105
|
disabled: false,
|
|
106
|
+
uploadDisabled: false,
|
|
105
107
|
loading: false,
|
|
106
108
|
onChange: null,
|
|
107
109
|
onClear: null,
|
|
@@ -134,6 +136,7 @@ var UploadField = function UploadField(_ref) {
|
|
|
134
136
|
width = _ref.width,
|
|
135
137
|
height = _ref.height,
|
|
136
138
|
disabled = _ref.disabled,
|
|
139
|
+
uploadDisabled = _ref.uploadDisabled,
|
|
137
140
|
parentLoading = _ref.loading,
|
|
138
141
|
onChange = _ref.onChange,
|
|
139
142
|
onClear = _ref.onClear,
|
|
@@ -176,7 +179,7 @@ var UploadField = function UploadField(_ref) {
|
|
|
176
179
|
}
|
|
177
180
|
}, [onChange, allowMultipleUploads, mergeData]);
|
|
178
181
|
var typesString = useMemo(function () {
|
|
179
|
-
return types.join('.');
|
|
182
|
+
return types !== null ? types.join('.') : ['audio', 'image', 'video'].join('.');
|
|
180
183
|
}, [types]);
|
|
181
184
|
var allowedFileTypes = useMemo(function () {
|
|
182
185
|
if (fileTypes !== null) {
|
|
@@ -188,11 +191,11 @@ var UploadField = function UploadField(_ref) {
|
|
|
188
191
|
}, [typesString, fileTypes]);
|
|
189
192
|
var uppyFinalProps = useMemo(function () {
|
|
190
193
|
return _objectSpread(_objectSpread({
|
|
191
|
-
maxNumberOfFiles: allowMultipleUploads && maxNumberOfFiles === 1 ? 50 : maxNumberOfFiles
|
|
192
|
-
}, uppyProps), {}, {
|
|
194
|
+
maxNumberOfFiles: allowMultipleUploads && maxNumberOfFiles === 1 ? 50 : maxNumberOfFiles,
|
|
193
195
|
allowedFileTypes: allowedFileTypes,
|
|
196
|
+
sources: sources
|
|
197
|
+
}, uppyProps), {}, {
|
|
194
198
|
allowMultipleUploads: allowMultipleUploads,
|
|
195
|
-
sources: sources,
|
|
196
199
|
autoProceed: true,
|
|
197
200
|
onComplete: onComplete
|
|
198
201
|
});
|
|
@@ -385,7 +388,7 @@ var UploadField = function UploadField(_ref) {
|
|
|
385
388
|
"type": 0,
|
|
386
389
|
"value": "Uploading"
|
|
387
390
|
}]
|
|
388
|
-
}) : addButtonLabel)))) : null, !
|
|
391
|
+
}) : addButtonLabel)))) : null, !uploadDisabled && !hasMedia && !withButton && finalUppy !== null ? /*#__PURE__*/React.createElement("div", {
|
|
389
392
|
className: styles.dashboard
|
|
390
393
|
}, /*#__PURE__*/React.createElement(Dashboard, Object.assign({
|
|
391
394
|
uppy: finalUppy
|
|
@@ -403,7 +406,7 @@ var UploadField = function UploadField(_ref) {
|
|
|
403
406
|
areInsidesReadyToBeVisible: true,
|
|
404
407
|
proudlyDisplayPoweredByUppy: false,
|
|
405
408
|
closeAfterFinish: closeAfterFinish
|
|
406
|
-
}))) : null, !
|
|
409
|
+
}))) : null, !uploadDisabled && withButton && finalUppy !== null && modalOpened ? /*#__PURE__*/React.createElement(DashboardModal, {
|
|
407
410
|
uppy: finalUppy,
|
|
408
411
|
className: styles.dashboardModal,
|
|
409
412
|
plugins: sources,
|
|
@@ -415,7 +418,8 @@ var UploadField = function UploadField(_ref) {
|
|
|
415
418
|
isDashboardVisible: true,
|
|
416
419
|
showProgressDetails: true,
|
|
417
420
|
showAddFilesPanel: true,
|
|
418
|
-
doneButtonHandler: closeModal
|
|
421
|
+
doneButtonHandler: closeModal,
|
|
422
|
+
closeAfterFinish: closeAfterFinish
|
|
419
423
|
}) : null);
|
|
420
424
|
};
|
|
421
425
|
UploadField.propTypes = propTypes$1;
|
package/lib/index.js
CHANGED
|
@@ -56,6 +56,7 @@ var propTypes$1 = {
|
|
|
56
56
|
width: PropTypes.number,
|
|
57
57
|
height: PropTypes.number,
|
|
58
58
|
disabled: PropTypes.bool,
|
|
59
|
+
uploadDisabled: PropTypes.bool,
|
|
59
60
|
loading: PropTypes.bool,
|
|
60
61
|
onChange: PropTypes.func,
|
|
61
62
|
onClear: PropTypes.func,
|
|
@@ -106,6 +107,7 @@ var defaultProps$1 = {
|
|
|
106
107
|
width: null,
|
|
107
108
|
height: 300,
|
|
108
109
|
disabled: false,
|
|
110
|
+
uploadDisabled: false,
|
|
109
111
|
loading: false,
|
|
110
112
|
onChange: null,
|
|
111
113
|
onClear: null,
|
|
@@ -138,6 +140,7 @@ var UploadField = function UploadField(_ref) {
|
|
|
138
140
|
width = _ref.width,
|
|
139
141
|
height = _ref.height,
|
|
140
142
|
disabled = _ref.disabled,
|
|
143
|
+
uploadDisabled = _ref.uploadDisabled,
|
|
141
144
|
parentLoading = _ref.loading,
|
|
142
145
|
onChange = _ref.onChange,
|
|
143
146
|
onClear = _ref.onClear,
|
|
@@ -180,7 +183,7 @@ var UploadField = function UploadField(_ref) {
|
|
|
180
183
|
}
|
|
181
184
|
}, [onChange, allowMultipleUploads, mergeData]);
|
|
182
185
|
var typesString = React.useMemo(function () {
|
|
183
|
-
return types.join('.');
|
|
186
|
+
return types !== null ? types.join('.') : ['audio', 'image', 'video'].join('.');
|
|
184
187
|
}, [types]);
|
|
185
188
|
var allowedFileTypes = React.useMemo(function () {
|
|
186
189
|
if (fileTypes !== null) {
|
|
@@ -192,11 +195,11 @@ var UploadField = function UploadField(_ref) {
|
|
|
192
195
|
}, [typesString, fileTypes]);
|
|
193
196
|
var uppyFinalProps = React.useMemo(function () {
|
|
194
197
|
return _objectSpread(_objectSpread({
|
|
195
|
-
maxNumberOfFiles: allowMultipleUploads && maxNumberOfFiles === 1 ? 50 : maxNumberOfFiles
|
|
196
|
-
}, uppyProps), {}, {
|
|
198
|
+
maxNumberOfFiles: allowMultipleUploads && maxNumberOfFiles === 1 ? 50 : maxNumberOfFiles,
|
|
197
199
|
allowedFileTypes: allowedFileTypes,
|
|
200
|
+
sources: sources
|
|
201
|
+
}, uppyProps), {}, {
|
|
198
202
|
allowMultipleUploads: allowMultipleUploads,
|
|
199
|
-
sources: sources,
|
|
200
203
|
autoProceed: true,
|
|
201
204
|
onComplete: onComplete
|
|
202
205
|
});
|
|
@@ -389,7 +392,7 @@ var UploadField = function UploadField(_ref) {
|
|
|
389
392
|
"type": 0,
|
|
390
393
|
"value": "Uploading"
|
|
391
394
|
}]
|
|
392
|
-
}) : addButtonLabel)))) : null, !
|
|
395
|
+
}) : addButtonLabel)))) : null, !uploadDisabled && !hasMedia && !withButton && finalUppy !== null ? /*#__PURE__*/React.createElement("div", {
|
|
393
396
|
className: styles.dashboard
|
|
394
397
|
}, /*#__PURE__*/React.createElement(react.Dashboard, Object.assign({
|
|
395
398
|
uppy: finalUppy
|
|
@@ -407,7 +410,7 @@ var UploadField = function UploadField(_ref) {
|
|
|
407
410
|
areInsidesReadyToBeVisible: true,
|
|
408
411
|
proudlyDisplayPoweredByUppy: false,
|
|
409
412
|
closeAfterFinish: closeAfterFinish
|
|
410
|
-
}))) : null, !
|
|
413
|
+
}))) : null, !uploadDisabled && withButton && finalUppy !== null && modalOpened ? /*#__PURE__*/React.createElement(react.DashboardModal, {
|
|
411
414
|
uppy: finalUppy,
|
|
412
415
|
className: styles.dashboardModal,
|
|
413
416
|
plugins: sources,
|
|
@@ -419,7 +422,8 @@ var UploadField = function UploadField(_ref) {
|
|
|
419
422
|
isDashboardVisible: true,
|
|
420
423
|
showProgressDetails: true,
|
|
421
424
|
showAddFilesPanel: true,
|
|
422
|
-
doneButtonHandler: closeModal
|
|
425
|
+
doneButtonHandler: closeModal,
|
|
426
|
+
closeAfterFinish: closeAfterFinish
|
|
423
427
|
}) : null);
|
|
424
428
|
};
|
|
425
429
|
UploadField.propTypes = propTypes$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.199",
|
|
4
4
|
"description": "An Upload field",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"javascript"
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
"@panneau/element-button": "^3.0.194",
|
|
62
62
|
"@panneau/element-label": "^3.0.194",
|
|
63
63
|
"@panneau/element-media-card": "^3.0.194",
|
|
64
|
-
"@panneau/list-resource-items": "^3.0.
|
|
64
|
+
"@panneau/list-resource-items": "^3.0.199",
|
|
65
65
|
"@panneau/themes": "^3.0.194",
|
|
66
66
|
"@panneau/uppy": "^3.0.194",
|
|
67
67
|
"@uppy/core": "^3.9.1",
|
|
@@ -80,5 +80,5 @@
|
|
|
80
80
|
"publishConfig": {
|
|
81
81
|
"access": "public"
|
|
82
82
|
},
|
|
83
|
-
"gitHead": "
|
|
83
|
+
"gitHead": "19617ff84180ba0d3764b13bd320fef524cf7dbb"
|
|
84
84
|
}
|