diginet-core-ui 1.4.12-beta.2 → 1.4.12-beta.3

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.
@@ -463,7 +463,7 @@ const Attachment = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
463
463
  // newAttachedRef.current = [files[0]];
464
464
  if (isSpecialCase) setDataState([]);
465
465
  setTimeout(() => {
466
- setNewDataState([files[0]]);
466
+ setNewDataState(files[0] ? [files[0]] : []);
467
467
  });
468
468
  }
469
469
  // attachmentInputRef.current.files = allNewAttached.getAll('files');
@@ -1130,6 +1130,7 @@ const Attachment = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
1130
1130
  })) : null));
1131
1131
  };
1132
1132
  const renderAttachmentItem = (item, idx, isNew = false) => {
1133
+ if (!item) return;
1133
1134
  const date = isNew ? new Date() : new Date(item.CreateDate);
1134
1135
  if (isNew) item.CreateDate = date.toISOString();
1135
1136
  return viewTypeState === 'detail' ? renderAttachmentItemDetail(item, idx, isNew) : viewTypeState === 'icon' ? renderAttachmentItemIcon(item, idx, isNew) : renderAttachmentItemPicture(item, idx, isNew);
@@ -1170,10 +1171,10 @@ const Attachment = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
1170
1171
  // let data = oldAttached[index] || allNewAttached.getAll('files')[index-oldAttached.length];
1171
1172
  return jsx(ModalSample, {
1172
1173
  open: showModal,
1173
- title: data.FileName,
1174
+ title: data === null || data === void 0 ? void 0 : data.FileName,
1174
1175
  onClose: () => setShowModal(false)
1175
1176
  }, jsx(Slider, null, jsx(SliderItem, {
1176
- url: data.URL
1177
+ url: data === null || data === void 0 ? void 0 : data.URL
1177
1178
  })));
1178
1179
  }, [domain, showModal]);
1179
1180
  // End view
@@ -1413,17 +1414,17 @@ Attachment.propTypes = {
1413
1414
  allowSort: PropTypes.bool,
1414
1415
  /** Class for component. */
1415
1416
  className: PropTypes.string,
1416
- /** List attachment:<br />
1417
- * [{<br />
1418
- * &nbsp;&nbsp;&nbsp;&nbsp;"AttachmentID": "ATT2U8O7YPTF1KSNCW3X",<br />
1419
- * &nbsp;&nbsp;&nbsp;&nbsp;"URL": "https://apricot.diginet.com.vn/cdn-dev/file/8a07bee1eeff17a14eee.jpg?path=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJmaWxlUGF0aCI6Ii8yMDIwLzA4LzQ0YjNhYjQ4LTMwNGQtNDQ3NC05ZDk0LWNkNGVlMDQwOGNlMy5qcGciLCJmaWxlTmFtZSI6IjhhMDdiZWUxZWVmZjE3YTE0ZWVlLmpwZyIsImZpbGVTaXplIjoyNDg4MzcsImZpbGVUeXBlIjoiaW1hZ2UvanBlZyIsImlhdCI6MTU5ODI0NDMwMiwiZXhwIjo4Nzk5ODI0NDMwMn0.fow6O5fp2z3vieA9gom5RRwQ7xxwBx9_7X2Fe8T2YI0",<br />
1420
- * &nbsp;&nbsp;&nbsp;&nbsp;"FileName": "8a07bee1eeff17a14eee.jpg",<br />
1421
- * &nbsp;&nbsp;&nbsp;&nbsp;"FileSize": 248837,<br />
1422
- * &nbsp;&nbsp;&nbsp;&nbsp;"KeyID": "W39OAD3YGLCWAQKV1D6PGEKNW4RLGVTZTUWLYEVFQ2QG8AOCXW",<br />
1423
- * &nbsp;&nbsp;&nbsp;&nbsp;"CreateUserID": "LEMONADMIN",<br />
1424
- * &nbsp;&nbsp;&nbsp;&nbsp;"CreateDate": "2020-08-24T11:54:04.307Z",<br />
1425
- * &nbsp;&nbsp;&nbsp;&nbsp;"UserName": "Quản trị hệ thống"<br />
1426
- * }, ...]
1417
+ /** List attachment:<br />
1418
+ * [{<br />
1419
+ * &nbsp;&nbsp;&nbsp;&nbsp;"AttachmentID": "ATT2U8O7YPTF1KSNCW3X",<br />
1420
+ * &nbsp;&nbsp;&nbsp;&nbsp;"URL": "https://apricot.diginet.com.vn/cdn-dev/file/8a07bee1eeff17a14eee.jpg?path=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJmaWxlUGF0aCI6Ii8yMDIwLzA4LzQ0YjNhYjQ4LTMwNGQtNDQ3NC05ZDk0LWNkNGVlMDQwOGNlMy5qcGciLCJmaWxlTmFtZSI6IjhhMDdiZWUxZWVmZjE3YTE0ZWVlLmpwZyIsImZpbGVTaXplIjoyNDg4MzcsImZpbGVUeXBlIjoiaW1hZ2UvanBlZyIsImlhdCI6MTU5ODI0NDMwMiwiZXhwIjo4Nzk5ODI0NDMwMn0.fow6O5fp2z3vieA9gom5RRwQ7xxwBx9_7X2Fe8T2YI0",<br />
1421
+ * &nbsp;&nbsp;&nbsp;&nbsp;"FileName": "8a07bee1eeff17a14eee.jpg",<br />
1422
+ * &nbsp;&nbsp;&nbsp;&nbsp;"FileSize": 248837,<br />
1423
+ * &nbsp;&nbsp;&nbsp;&nbsp;"KeyID": "W39OAD3YGLCWAQKV1D6PGEKNW4RLGVTZTUWLYEVFQ2QG8AOCXW",<br />
1424
+ * &nbsp;&nbsp;&nbsp;&nbsp;"CreateUserID": "LEMONADMIN",<br />
1425
+ * &nbsp;&nbsp;&nbsp;&nbsp;"CreateDate": "2020-08-24T11:54:04.307Z",<br />
1426
+ * &nbsp;&nbsp;&nbsp;&nbsp;"UserName": "Quản trị hệ thống"<br />
1427
+ * }, ...]
1427
1428
  */
1428
1429
  data: PropTypes.array,
1429
1430
  /** The message to display when deleting files. */
@@ -1454,16 +1455,16 @@ Attachment.propTypes = {
1454
1455
  onChange: PropTypes.func,
1455
1456
  /** Download attached event, if not it will use default. */
1456
1457
  onDownload: PropTypes.func,
1457
- /**
1458
- * event when removed file(s)
1459
- *
1460
- * return data: {<br/>
1461
- * &nbsp;&nbsp;&nbsp;&nbsp;attached: [Files] (insist old and all new files )<br/>
1462
- * &nbsp;&nbsp;&nbsp;&nbsp;allNewAttached: [Files]<br/>
1463
- * &nbsp;&nbsp;&nbsp;&nbsp;oldAttached: [Files]<br/>
1464
- * &nbsp;&nbsp;&nbsp;&nbsp;removedAttached: [Files]<br/>
1465
- * &nbsp;&nbsp;&nbsp;&nbsp;element: [NodeList (just removed)]<br/>
1466
- * }
1458
+ /**
1459
+ * event when removed file(s)
1460
+ *
1461
+ * return data: {<br/>
1462
+ * &nbsp;&nbsp;&nbsp;&nbsp;attached: [Files] (insist old and all new files )<br/>
1463
+ * &nbsp;&nbsp;&nbsp;&nbsp;allNewAttached: [Files]<br/>
1464
+ * &nbsp;&nbsp;&nbsp;&nbsp;oldAttached: [Files]<br/>
1465
+ * &nbsp;&nbsp;&nbsp;&nbsp;removedAttached: [Files]<br/>
1466
+ * &nbsp;&nbsp;&nbsp;&nbsp;element: [NodeList (just removed)]<br/>
1467
+ * }
1467
1468
  */
1468
1469
  onRemove: PropTypes.func,
1469
1470
  /** 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.12-beta.2",
3
+ "version": "1.4.12-beta.3",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "license": "UNLICENSED",