datasync-blob 1.1.32 → 1.1.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.
@@ -267,6 +267,9 @@ class DsBlob extends _react.Component {
267
267
  //-----------------------------------------------------------------------------------------------------------------------------------------
268
268
  storeBase64ImageToImg = e => {
269
269
  var DOM_image = document.createElement('img');
270
+ alert("BIRTHDAY !");
271
+ console.log("BIRTHDAY:Store DOMimage reference");
272
+ this._DOM_image = DOM_image;
270
273
  DOM_image.onload = this.reduceBase64Image;
271
274
  console.log("storeBase64ImageToImg:e.currentTarget.result = ", e.currentTarget.result);
272
275
  DOM_image.src = e.currentTarget.result;
@@ -296,9 +299,8 @@ class DsBlob extends _react.Component {
296
299
  //-----------------------------------------------------------------------------------------------------------------------------------------
297
300
  cleanupBlobUrl = () => {
298
301
  // Only show alert if not in test environment
299
- if (typeof jest === 'undefined') {
300
- console.log("cleanupBlobUrl !");
301
- }
302
+ console.log("cleanupBlobUrl !");
303
+
302
304
  // Revoke blob URL if it exists to prevent memory leaks
303
305
  if (this.state.data && this.state.data.startsWith('blob:')) {
304
306
  URL.revokeObjectURL(this.state.data);
@@ -325,6 +327,11 @@ class DsBlob extends _react.Component {
325
327
  componentWillUnmount() {
326
328
  // Cleanup blob URLs when component unmounts
327
329
  this.cleanupBlobUrl();
330
+ if (this._DOM_image) {
331
+ console.log("BIRTHDAY : Removing reference");
332
+ this._DOM_image.onload = null;
333
+ this._DOM_image = null;
334
+ }
328
335
  }
329
336
 
330
337
  //-----------------------------------------------------------------------------------------------------------------------------------------
@@ -477,7 +484,20 @@ class DsBlob extends _react.Component {
477
484
  type: "button",
478
485
  value: "Effacer",
479
486
  onClick: this.resetUpload
480
- })));
487
+ }), !this.props.readOnly && /*#__PURE__*/_react.default.createElement("label", {
488
+ style: this.state.hover_input ? {
489
+ ...div_show_image_hover_input,
490
+ top: "32px",
491
+ cursor: "pointer"
492
+ } : div_show_image_input,
493
+ className: "btn btn-secondary"
494
+ }, this.props.Caption || 'Remplacer', /*#__PURE__*/_react.default.createElement("input", {
495
+ style: upload_picture_label_input,
496
+ type: "file",
497
+ accept: "image/*",
498
+ onChange: this.onInputChange,
499
+ multiple: true
500
+ }))));
481
501
  }
482
502
  }
483
503
  exports.DsBlob = DsBlob;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "datasync-blob",
3
- "version": "1.1.32",
3
+ "version": "1.1.33",
4
4
  "description": "Datasync Blob component",
5
5
  "main": "./dist/components/DsBlob.js",
6
6
  "files": [