diginet-core-ui 1.4.27 → 1.4.28

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.
@@ -15,6 +15,7 @@ const allNewAttached = new FormData();
15
15
  const attached = []; // attached = [...dataState, ...newDataState]
16
16
  const chosenItems = [];
17
17
  const getType = data => {
18
+ if (!data) return null;
18
19
  if (data !== null && data !== void 0 && data.type) {
19
20
  var _type$match;
20
21
  const pattern = /word|sheet|presentation|pdf|image|compressed/i;
@@ -457,7 +458,7 @@ const Attachment = /*#__PURE__*/memo( /*#__PURE__*/forwardRef((inProps, referenc
457
458
  recentRemovedAttached,
458
459
  removedAttached: removedAttachedRef.current,
459
460
  oldAttached,
460
- allNewAttached: newDataState
461
+ allNewAttached: tempNewDataState
461
462
  });
462
463
  !!onRemoveProp && onRemoveProp(recentRemovedAttached);
463
464
  onClosePopup();
@@ -1467,17 +1468,17 @@ Attachment.propTypes = {
1467
1468
  allowSort: PropTypes.bool,
1468
1469
  /** Class for component. */
1469
1470
  className: PropTypes.string,
1470
- /** List attachment:<br />
1471
- * [{<br />
1472
- * &nbsp;&nbsp;&nbsp;&nbsp;"AttachmentID": "ATT2U8O7YPTF1KSNCW3X",<br />
1473
- * &nbsp;&nbsp;&nbsp;&nbsp;"URL": "https://apricot.diginet.com.vn/cdn-dev/file/8a07bee1eeff17a14eee.jpg?path=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJmaWxlUGF0aCI6Ii8yMDIwLzA4LzQ0YjNhYjQ4LTMwNGQtNDQ3NC05ZDk0LWNkNGVlMDQwOGNlMy5qcGciLCJmaWxlTmFtZSI6IjhhMDdiZWUxZWVmZjE3YTE0ZWVlLmpwZyIsImZpbGVTaXplIjoyNDg4MzcsImZpbGVUeXBlIjoiaW1hZ2UvanBlZyIsImlhdCI6MTU5ODI0NDMwMiwiZXhwIjo4Nzk5ODI0NDMwMn0.fow6O5fp2z3vieA9gom5RRwQ7xxwBx9_7X2Fe8T2YI0",<br />
1474
- * &nbsp;&nbsp;&nbsp;&nbsp;"FileName": "8a07bee1eeff17a14eee.jpg",<br />
1475
- * &nbsp;&nbsp;&nbsp;&nbsp;"FileSize": 248837,<br />
1476
- * &nbsp;&nbsp;&nbsp;&nbsp;"KeyID": "W39OAD3YGLCWAQKV1D6PGEKNW4RLGVTZTUWLYEVFQ2QG8AOCXW",<br />
1477
- * &nbsp;&nbsp;&nbsp;&nbsp;"CreateUserID": "LEMONADMIN",<br />
1478
- * &nbsp;&nbsp;&nbsp;&nbsp;"CreateDate": "2020-08-24T11:54:04.307Z",<br />
1479
- * &nbsp;&nbsp;&nbsp;&nbsp;"UserName": "Quản trị hệ thống"<br />
1480
- * }, ...]
1471
+ /** List attachment:<br />
1472
+ * [{<br />
1473
+ * &nbsp;&nbsp;&nbsp;&nbsp;"AttachmentID": "ATT2U8O7YPTF1KSNCW3X",<br />
1474
+ * &nbsp;&nbsp;&nbsp;&nbsp;"URL": "https://apricot.diginet.com.vn/cdn-dev/file/8a07bee1eeff17a14eee.jpg?path=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJmaWxlUGF0aCI6Ii8yMDIwLzA4LzQ0YjNhYjQ4LTMwNGQtNDQ3NC05ZDk0LWNkNGVlMDQwOGNlMy5qcGciLCJmaWxlTmFtZSI6IjhhMDdiZWUxZWVmZjE3YTE0ZWVlLmpwZyIsImZpbGVTaXplIjoyNDg4MzcsImZpbGVUeXBlIjoiaW1hZ2UvanBlZyIsImlhdCI6MTU5ODI0NDMwMiwiZXhwIjo4Nzk5ODI0NDMwMn0.fow6O5fp2z3vieA9gom5RRwQ7xxwBx9_7X2Fe8T2YI0",<br />
1475
+ * &nbsp;&nbsp;&nbsp;&nbsp;"FileName": "8a07bee1eeff17a14eee.jpg",<br />
1476
+ * &nbsp;&nbsp;&nbsp;&nbsp;"FileSize": 248837,<br />
1477
+ * &nbsp;&nbsp;&nbsp;&nbsp;"KeyID": "W39OAD3YGLCWAQKV1D6PGEKNW4RLGVTZTUWLYEVFQ2QG8AOCXW",<br />
1478
+ * &nbsp;&nbsp;&nbsp;&nbsp;"CreateUserID": "LEMONADMIN",<br />
1479
+ * &nbsp;&nbsp;&nbsp;&nbsp;"CreateDate": "2020-08-24T11:54:04.307Z",<br />
1480
+ * &nbsp;&nbsp;&nbsp;&nbsp;"UserName": "Quản trị hệ thống"<br />
1481
+ * }, ...]
1481
1482
  */
1482
1483
  data: PropTypes.array,
1483
1484
  /** The message to display when deleting files. */
@@ -1508,16 +1509,16 @@ Attachment.propTypes = {
1508
1509
  onChange: PropTypes.func,
1509
1510
  /** Download attached event, if not it will use default. */
1510
1511
  onDownload: PropTypes.func,
1511
- /**
1512
- * event when removed file(s)
1513
- *
1514
- * return data: {<br/>
1515
- * &nbsp;&nbsp;&nbsp;&nbsp;attached: [Files] (insist old and all new files )<br/>
1516
- * &nbsp;&nbsp;&nbsp;&nbsp;allNewAttached: [Files]<br/>
1517
- * &nbsp;&nbsp;&nbsp;&nbsp;oldAttached: [Files]<br/>
1518
- * &nbsp;&nbsp;&nbsp;&nbsp;removedAttached: [Files]<br/>
1519
- * &nbsp;&nbsp;&nbsp;&nbsp;element: [NodeList (just removed)]<br/>
1520
- * }
1512
+ /**
1513
+ * event when removed file(s)
1514
+ *
1515
+ * return data: {<br/>
1516
+ * &nbsp;&nbsp;&nbsp;&nbsp;attached: [Files] (insist old and all new files )<br/>
1517
+ * &nbsp;&nbsp;&nbsp;&nbsp;allNewAttached: [Files]<br/>
1518
+ * &nbsp;&nbsp;&nbsp;&nbsp;oldAttached: [Files]<br/>
1519
+ * &nbsp;&nbsp;&nbsp;&nbsp;removedAttached: [Files]<br/>
1520
+ * &nbsp;&nbsp;&nbsp;&nbsp;element: [NodeList (just removed)]<br/>
1521
+ * }
1521
1522
  */
1522
1523
  onRemove: PropTypes.func,
1523
1524
  /** View attached event, if not it will use default. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "diginet-core-ui",
3
- "version": "1.4.27",
3
+ "version": "1.4.28",
4
4
  "description": "The DigiNet core ui",
5
5
  "homepage": "https://diginet.com.vn",
6
6
  "main": "index.js",
package/readme.md CHANGED
@@ -42,6 +42,10 @@ npm test
42
42
 
43
43
  ## Changelog
44
44
 
45
+ ## 1.4.28
46
+
47
+ - \[Fixed\]: Attachment – Fix allNewAttached in onChange after delete
48
+
45
49
  ## 1.4.27
46
50
 
47
51
  - \[Changed\]: Button – Remove transition when disabled