@panneau/field-upload 4.0.27 → 4.0.33
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/assets/css/styles.css +1 -1
- package/dist/index.js +49 -44
- package/package.json +6 -6
package/assets/css/styles.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.panneau-field-upload-container{position:relative;width:100%}.panneau-field-upload-container .panneau-field-upload-dashboard{position:relative}.panneau-field-upload-container .panneau-field-upload-dashboardModal{position:relative;z-index:10001}.panneau-field-upload-container .panneau-field-upload-uppyDashboardContainer{margin-top:0}
|
|
1
|
+
.panneau-field-upload-container{position:relative;width:100%}.panneau-field-upload-container .panneau-field-upload-dashboard{margin-bottom:10px;position:relative}.panneau-field-upload-container .panneau-field-upload-dashboardModal{position:relative;z-index:10001}.panneau-field-upload-container .panneau-field-upload-uppyDashboardContainer{margin-top:0}
|
package/dist/index.js
CHANGED
|
@@ -119,7 +119,6 @@ function UploadField(_ref) {
|
|
|
119
119
|
return newValue;
|
|
120
120
|
}, []);
|
|
121
121
|
var onComplete = useCallback(function (response) {
|
|
122
|
-
// console.log('upload complete', response); // eslint-disable-line
|
|
123
122
|
var newValue = null;
|
|
124
123
|
if (isArray(response)) {
|
|
125
124
|
if (allowMultipleUploads) {
|
|
@@ -139,9 +138,6 @@ function UploadField(_ref) {
|
|
|
139
138
|
} else if (newValue !== null) {
|
|
140
139
|
newValue = mergeData(newValue);
|
|
141
140
|
}
|
|
142
|
-
|
|
143
|
-
// console.log('new upload value', newValue); // eslint-disable-line
|
|
144
|
-
|
|
145
141
|
if (onChange !== null) {
|
|
146
142
|
onChange(newValue);
|
|
147
143
|
}
|
|
@@ -284,6 +280,15 @@ function UploadField(_ref) {
|
|
|
284
280
|
onListPageChange = _useQuery.onPageChange,
|
|
285
281
|
onListQueryChange = _useQuery.onQueryChange,
|
|
286
282
|
onListQueryReset = _useQuery.onQueryReset;
|
|
283
|
+
var finalOnPageChange = useCallback(function (e) {
|
|
284
|
+
var pageNumber = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
|
|
285
|
+
e.preventDefault();
|
|
286
|
+
e.stopPropagation();
|
|
287
|
+
onListPageChange(pageNumber);
|
|
288
|
+
}, [onListPageChange]);
|
|
289
|
+
var finalOnQueryChange = useCallback(function (newQuery) {
|
|
290
|
+
onListQueryChange(newQuery);
|
|
291
|
+
}, [onListQueryChange]);
|
|
287
292
|
var containerRef = useRef(null);
|
|
288
293
|
|
|
289
294
|
// Keep this stable, uppy doesnt like changes
|
|
@@ -351,44 +356,6 @@ function UploadField(_ref) {
|
|
|
351
356
|
})
|
|
352
357
|
})
|
|
353
358
|
})
|
|
354
|
-
}) : null, withoutMedia || (!hasMedia || allowMultipleUploads) && withButton ? /*#__PURE__*/jsxs("div", {
|
|
355
|
-
className: "row",
|
|
356
|
-
children: [/*#__PURE__*/jsx("div", {
|
|
357
|
-
className: "col-auto",
|
|
358
|
-
children: /*#__PURE__*/jsx(Button, {
|
|
359
|
-
id: "trigger-uppy",
|
|
360
|
-
type: "button",
|
|
361
|
-
theme: "primary",
|
|
362
|
-
icon: finalLoading ? 'loading' : 'upload',
|
|
363
|
-
iconPosition: "right",
|
|
364
|
-
onClick: onClickAdd || openModal,
|
|
365
|
-
disabled: finalLoading || disabled,
|
|
366
|
-
outline: outline,
|
|
367
|
-
children: /*#__PURE__*/jsx(Label, {
|
|
368
|
-
children: finalLoading ? /*#__PURE__*/jsx(FormattedMessage, {
|
|
369
|
-
id: "NozDYd",
|
|
370
|
-
defaultMessage: [{
|
|
371
|
-
"type": 0,
|
|
372
|
-
"value": "Uploading"
|
|
373
|
-
}]
|
|
374
|
-
}) : addButtonLabel
|
|
375
|
-
})
|
|
376
|
-
})
|
|
377
|
-
}), withFind ? /*#__PURE__*/jsx("div", {
|
|
378
|
-
className: "col-auto ps-0",
|
|
379
|
-
children: /*#__PURE__*/jsx(Button, {
|
|
380
|
-
type: "button",
|
|
381
|
-
theme: "primary",
|
|
382
|
-
icon: "search",
|
|
383
|
-
iconPosition: "right",
|
|
384
|
-
onClick: finalOnClickFind,
|
|
385
|
-
disabled: disabled,
|
|
386
|
-
outline: outline,
|
|
387
|
-
children: /*#__PURE__*/jsx(Label, {
|
|
388
|
-
children: findButtonLabel
|
|
389
|
-
})
|
|
390
|
-
})
|
|
391
|
-
}) : null]
|
|
392
359
|
}) : null, finalUppy !== null ? /*#__PURE__*/jsxs(UppyContextProvider, {
|
|
393
360
|
uppy: finalUppy,
|
|
394
361
|
children: [!uploadDisabled && !hasMedia && !withButton && finalUppy !== null ? /*#__PURE__*/jsx("div", {
|
|
@@ -424,12 +391,50 @@ function UploadField(_ref) {
|
|
|
424
391
|
doneButtonHandler: closeModal,
|
|
425
392
|
closeAfterFinish: closeAfterFinish
|
|
426
393
|
}) : null]
|
|
394
|
+
}) : null, withoutMedia || (!hasMedia || allowMultipleUploads) && (withButton || withFind) ? /*#__PURE__*/jsxs("div", {
|
|
395
|
+
className: "row",
|
|
396
|
+
children: [withButton ? /*#__PURE__*/jsx("div", {
|
|
397
|
+
className: "col-auto mb-2 pe-0",
|
|
398
|
+
children: /*#__PURE__*/jsx(Button, {
|
|
399
|
+
id: "trigger-uppy",
|
|
400
|
+
type: "button",
|
|
401
|
+
theme: "primary",
|
|
402
|
+
icon: finalLoading ? 'loading' : 'upload',
|
|
403
|
+
iconPosition: "right",
|
|
404
|
+
onClick: onClickAdd || openModal,
|
|
405
|
+
disabled: finalLoading || disabled,
|
|
406
|
+
outline: outline,
|
|
407
|
+
children: /*#__PURE__*/jsx(Label, {
|
|
408
|
+
children: finalLoading ? /*#__PURE__*/jsx(FormattedMessage, {
|
|
409
|
+
id: "NozDYd",
|
|
410
|
+
defaultMessage: [{
|
|
411
|
+
"type": 0,
|
|
412
|
+
"value": "Uploading"
|
|
413
|
+
}]
|
|
414
|
+
}) : addButtonLabel
|
|
415
|
+
})
|
|
416
|
+
})
|
|
417
|
+
}) : null, withFind ? /*#__PURE__*/jsx("div", {
|
|
418
|
+
className: "col-auto mb-2",
|
|
419
|
+
children: /*#__PURE__*/jsx(Button, {
|
|
420
|
+
type: "button",
|
|
421
|
+
theme: "primary",
|
|
422
|
+
icon: "search",
|
|
423
|
+
iconPosition: "right",
|
|
424
|
+
onClick: finalOnClickFind,
|
|
425
|
+
disabled: disabled,
|
|
426
|
+
outline: outline,
|
|
427
|
+
children: /*#__PURE__*/jsx(Label, {
|
|
428
|
+
children: findButtonLabel
|
|
429
|
+
})
|
|
430
|
+
})
|
|
431
|
+
}) : null]
|
|
427
432
|
}) : null, showResourceModal ? /*#__PURE__*/jsx(ModalResourceItems, {
|
|
428
433
|
id: "upload-".concat(name),
|
|
429
434
|
resource: resource,
|
|
430
435
|
query: listQuery,
|
|
431
|
-
onPageChange:
|
|
432
|
-
onQueryChange:
|
|
436
|
+
onPageChange: finalOnPageChange,
|
|
437
|
+
onQueryChange: finalOnQueryChange,
|
|
433
438
|
onQueryReset: onListQueryReset,
|
|
434
439
|
baseUrl: null,
|
|
435
440
|
showActions: false,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@panneau/field-upload",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.33",
|
|
4
4
|
"description": "An Upload field",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"javascript"
|
|
@@ -67,11 +67,11 @@
|
|
|
67
67
|
"@fortawesome/free-solid-svg-icons": "^6.5.1",
|
|
68
68
|
"@fortawesome/react-fontawesome": "^0.2.0",
|
|
69
69
|
"@panneau/core": "^4.0.27",
|
|
70
|
-
"@panneau/element-button": "^4.0.
|
|
70
|
+
"@panneau/element-button": "^4.0.33",
|
|
71
71
|
"@panneau/element-label": "^4.0.27",
|
|
72
|
-
"@panneau/element-media-card": "^4.0.
|
|
73
|
-
"@panneau/modal-resource-items": "^4.0.
|
|
74
|
-
"@panneau/themes": "^4.0.
|
|
72
|
+
"@panneau/element-media-card": "^4.0.33",
|
|
73
|
+
"@panneau/modal-resource-items": "^4.0.33",
|
|
74
|
+
"@panneau/themes": "^4.0.33",
|
|
75
75
|
"@panneau/uppy": "^4.0.27",
|
|
76
76
|
"@uppy/core": "^5.1.1",
|
|
77
77
|
"@uppy/dashboard": "^5.0.4",
|
|
@@ -85,5 +85,5 @@
|
|
|
85
85
|
"publishConfig": {
|
|
86
86
|
"access": "public"
|
|
87
87
|
},
|
|
88
|
-
"gitHead": "
|
|
88
|
+
"gitHead": "c0e63d849207a4f77f9e6d8d2c9f4b51c3d892d5"
|
|
89
89
|
}
|