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.
- package/components/form-control/attachment/index.js +23 -22
- package/package.json +1 -1
- package/readme.md +4 -0
|
@@ -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:
|
|
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
|
-
* "AttachmentID": "ATT2U8O7YPTF1KSNCW3X",<br />
|
|
1473
|
-
* "URL": "https://apricot.diginet.com.vn/cdn-dev/file/8a07bee1eeff17a14eee.jpg?path=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJmaWxlUGF0aCI6Ii8yMDIwLzA4LzQ0YjNhYjQ4LTMwNGQtNDQ3NC05ZDk0LWNkNGVlMDQwOGNlMy5qcGciLCJmaWxlTmFtZSI6IjhhMDdiZWUxZWVmZjE3YTE0ZWVlLmpwZyIsImZpbGVTaXplIjoyNDg4MzcsImZpbGVUeXBlIjoiaW1hZ2UvanBlZyIsImlhdCI6MTU5ODI0NDMwMiwiZXhwIjo4Nzk5ODI0NDMwMn0.fow6O5fp2z3vieA9gom5RRwQ7xxwBx9_7X2Fe8T2YI0",<br />
|
|
1474
|
-
* "FileName": "8a07bee1eeff17a14eee.jpg",<br />
|
|
1475
|
-
* "FileSize": 248837,<br />
|
|
1476
|
-
* "KeyID": "W39OAD3YGLCWAQKV1D6PGEKNW4RLGVTZTUWLYEVFQ2QG8AOCXW",<br />
|
|
1477
|
-
* "CreateUserID": "LEMONADMIN",<br />
|
|
1478
|
-
* "CreateDate": "2020-08-24T11:54:04.307Z",<br />
|
|
1479
|
-
* "UserName": "Quản trị hệ thống"<br />
|
|
1480
|
-
* }, ...]
|
|
1471
|
+
/** List attachment:<br />
|
|
1472
|
+
* [{<br />
|
|
1473
|
+
* "AttachmentID": "ATT2U8O7YPTF1KSNCW3X",<br />
|
|
1474
|
+
* "URL": "https://apricot.diginet.com.vn/cdn-dev/file/8a07bee1eeff17a14eee.jpg?path=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJmaWxlUGF0aCI6Ii8yMDIwLzA4LzQ0YjNhYjQ4LTMwNGQtNDQ3NC05ZDk0LWNkNGVlMDQwOGNlMy5qcGciLCJmaWxlTmFtZSI6IjhhMDdiZWUxZWVmZjE3YTE0ZWVlLmpwZyIsImZpbGVTaXplIjoyNDg4MzcsImZpbGVUeXBlIjoiaW1hZ2UvanBlZyIsImlhdCI6MTU5ODI0NDMwMiwiZXhwIjo4Nzk5ODI0NDMwMn0.fow6O5fp2z3vieA9gom5RRwQ7xxwBx9_7X2Fe8T2YI0",<br />
|
|
1475
|
+
* "FileName": "8a07bee1eeff17a14eee.jpg",<br />
|
|
1476
|
+
* "FileSize": 248837,<br />
|
|
1477
|
+
* "KeyID": "W39OAD3YGLCWAQKV1D6PGEKNW4RLGVTZTUWLYEVFQ2QG8AOCXW",<br />
|
|
1478
|
+
* "CreateUserID": "LEMONADMIN",<br />
|
|
1479
|
+
* "CreateDate": "2020-08-24T11:54:04.307Z",<br />
|
|
1480
|
+
* "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
|
-
* attached: [Files] (insist old and all new files )<br/>
|
|
1516
|
-
* allNewAttached: [Files]<br/>
|
|
1517
|
-
* oldAttached: [Files]<br/>
|
|
1518
|
-
* removedAttached: [Files]<br/>
|
|
1519
|
-
* element: [NodeList (just removed)]<br/>
|
|
1520
|
-
* }
|
|
1512
|
+
/**
|
|
1513
|
+
* event when removed file(s)
|
|
1514
|
+
*
|
|
1515
|
+
* return data: {<br/>
|
|
1516
|
+
* attached: [Files] (insist old and all new files )<br/>
|
|
1517
|
+
* allNewAttached: [Files]<br/>
|
|
1518
|
+
* oldAttached: [Files]<br/>
|
|
1519
|
+
* removedAttached: [Files]<br/>
|
|
1520
|
+
* 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