@xaypay/tui 0.0.113 → 0.0.114

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/dist/index.es.js CHANGED
@@ -543,18 +543,18 @@ const TD = ({
543
543
  style: {
544
544
  display: 'flex',
545
545
  alignItems: 'flex-start',
546
- justifyContent: hasOwnerProperty(item, 'contentList') || hasOwnerProperty(item, 'checkBox') ? 'space-between' : 'center'
546
+ justifyContent: hasOwnerProperty(item, 'checkBox') ? 'space-between' : 'center'
547
547
  }
548
- }, hasOwnerProperty(item, 'contentList') && /*#__PURE__*/React__default.createElement("div", {
548
+ }, !hasOwnerProperty(item, 'hideArrow') && item.hideArrow !== false && (!hasOwnerProperty(item, 'rightArrow') || item.rightArrow !== true) ? hasOwnerProperty(item, 'contentList') && (hasOwnerProperty(item, 'closeArrow') || hasOwnerProperty(item, 'openArrow')) && /*#__PURE__*/React__default.createElement("div", {
549
549
  id: item.id,
550
550
  style: {
551
551
  width: '21px',
552
552
  height: '21px',
553
553
  cursor: 'pointer'
554
554
  },
555
- onClick: () => handleOpenCloseRowSingleArrow(index, innerIndex),
555
+ onClick: () => handleOpenCloseRowSingleArrow(index, innerIndex, item),
556
556
  className: styles$c['td-span']
557
- }, item.status === 'close' ? item.closeArrow : item.openArrow), hasOwnerProperty(item, 'checkBox') && /*#__PURE__*/React__default.createElement(SingleCheckbox, {
557
+ }, hasOwnerProperty(item, 'status') && item.status === 'close' ? item.closeArrow : item.openArrow) : '', hasOwnerProperty(item, 'checkBox') && /*#__PURE__*/React__default.createElement(SingleCheckbox, {
558
558
  data: item,
559
559
  index: index,
560
560
  innerIndex: innerIndex,
@@ -565,7 +565,8 @@ const TD = ({
565
565
  unCheckedColor: item.checkBox.unCheckedColor
566
566
  }), /*#__PURE__*/React__default.createElement("div", {
567
567
  style: {
568
- marginLeft: item.contentList ? '10px' : '0px'
568
+ marginLeft: hasOwnerProperty(item, 'contentList') && (!hasOwnerProperty(item, 'hideArrow') || item.hideArrow !== true) ? hasOwnerProperty(item, 'rightArrow') ? item.rightArrow === true ? '0px' : '10px' : hasOwnerProperty(item, 'closeArrow') || hasOwnerProperty(item, 'openArrow') ? '10px' : '0px' : '0px',
569
+ marginRight: hasOwnerProperty(item, 'contentList') && (!hasOwnerProperty(item, 'hideArrow') || item.hideArrow !== true) ? hasOwnerProperty(item, 'rightArrow') ? item.rightArrow === true ? '10px' : '0px' : '0px' : '0px'
569
570
  }
570
571
  }, /*#__PURE__*/React__default.createElement("p", {
571
572
  style: {
@@ -614,7 +615,8 @@ const TD = ({
614
615
  textAlign: 'left',
615
616
  overflow: 'hidden',
616
617
  whiteSpace: 'nowrap',
617
- textOverflow: 'ellipsis'
618
+ textOverflow: 'ellipsis',
619
+ marginBottom: '5px'
618
620
  },
619
621
  title: optionItem.content
620
622
  }, optionItem.content));
@@ -636,7 +638,16 @@ const TD = ({
636
638
  },
637
639
  onClick: e => handleContentList(e, item, index, innerIndex, innerItem.id, innerItem.content, innerItemIndex)
638
640
  }, innerItem.content);
639
- })))) : '');
641
+ }))), !hasOwnerProperty(item, 'hideArrow') && item.hideArrow !== false && hasOwnerProperty(item, 'rightArrow') && item.rightArrow === true ? hasOwnerProperty(item, 'contentList') && (hasOwnerProperty(item, 'closeArrow') || hasOwnerProperty(item, 'openArrow')) && /*#__PURE__*/React__default.createElement("div", {
642
+ id: item.id,
643
+ style: {
644
+ width: '21px',
645
+ height: '21px',
646
+ cursor: 'pointer'
647
+ },
648
+ onClick: () => handleOpenCloseRowSingleArrow(index, innerIndex, item),
649
+ className: styles$c['td-span']
650
+ }, hasOwnerProperty(item, 'status') && item.status === 'close' ? item.closeArrow : item.openArrow) : '') : '');
640
651
  };
641
652
 
642
653
  const SvgUpArrow = ({
@@ -876,11 +887,13 @@ const Table = ({
876
887
  const newUpdatedBody = updatedBody.map((item, index) => {
877
888
  return item.map((innerItem, innerIndex) => {
878
889
  if (checkableItemIndex === innerIndex) {
879
- innerItem.checkBox.checked = checkableItemBool;
880
- checkableBodyRowItems.push({
881
- column: innerIndex,
882
- columnItem: innerItem
883
- });
890
+ if (!hasOwnerProperty(innerItem.checkBox, 'disabled') || innerItem.checkBox.disabled !== true) {
891
+ innerItem.checkBox.checked = checkableItemBool;
892
+ checkableBodyRowItems.push({
893
+ column: innerIndex,
894
+ columnItem: innerItem
895
+ });
896
+ }
884
897
  handleHeaderCheckedUpdate({
885
898
  row: index,
886
899
  column: innerIndex,
@@ -989,7 +1002,8 @@ const Table = ({
989
1002
  return [...prev];
990
1003
  });
991
1004
  };
992
- const handleOpenCloseRowSingleArrow = (arrowRowIndex, arrowIndex) => {
1005
+ const handleOpenCloseRowSingleArrow = (arrowRowIndex, arrowIndex, clickableItem) => {
1006
+ console.log(clickableItem, 'clickableItem');
993
1007
  let single = {};
994
1008
  const allArrows = [];
995
1009
  const checkedOpenableRow = body[arrowRowIndex].map((item, index) => {
@@ -1016,6 +1030,9 @@ const Table = ({
1016
1030
  }
1017
1031
  }
1018
1032
  }
1033
+ if (hasOwnerProperty(clickableItem, 'theSame') && hasOwnerProperty(item, 'theSame') && clickableItem.theSame === item.theSame) {
1034
+ item.status = clickableItem.status;
1035
+ }
1019
1036
  return item;
1020
1037
  });
1021
1038
  setBody(prev => {
@@ -1072,20 +1089,6 @@ const Table = ({
1072
1089
  });
1073
1090
  setBody(() => checkBodyMore);
1074
1091
  };
1075
- const handleCheckDisable = (arr, disableArr) => {
1076
- let headerWithDisabled = [];
1077
- if (disableArr && disableArr.length > 0) {
1078
- headerWithDisabled = arr.map((item, index) => {
1079
- if (disableArr[index]) {
1080
- if (hasOwnerProperty(item, 'checkBox')) {
1081
- item.checkBox.disabled = true;
1082
- }
1083
- }
1084
- return item;
1085
- });
1086
- }
1087
- return headerWithDisabled;
1088
- };
1089
1092
  const handleContentListClick = (e, data) => {
1090
1093
  e.stopPropagation();
1091
1094
  const {
@@ -1187,11 +1190,9 @@ const Table = ({
1187
1190
  const header = dataHeader.slice();
1188
1191
  const arrowColumnCount = handleSetInsertIndex(header, arrowColumn);
1189
1192
  const checkForInsertArrow = handleTransformDataForInsertArrow(header, arrowColumnCount, 'header');
1190
- const headerWithDisabled = handleCheckDisable(checkForInsertArrow, disableArr);
1191
- setHeader(() => headerWithDisabled.length > 0 ? headerWithDisabled : checkForInsertArrow);
1193
+ setHeader(() => checkForInsertArrow);
1192
1194
  } else {
1193
- const headerWithDisabled = handleCheckDisable(dataHeader, disableArr);
1194
- setHeader(() => headerWithDisabled.length > 0 ? headerWithDisabled : dataHeader);
1195
+ setHeader(() => dataHeader);
1195
1196
  }
1196
1197
  }, [dataHeader, arrowColumn, arrowShow, disableArr]);
1197
1198
  return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("table", {
@@ -1329,6 +1330,26 @@ const SvgPrev = ({
1329
1330
  fill: "#3C393E"
1330
1331
  }));
1331
1332
 
1333
+ const SvgZoom = ({
1334
+ title,
1335
+ titleId,
1336
+ ...props
1337
+ }) => /*#__PURE__*/React.createElement("svg", _extends({
1338
+ width: "32",
1339
+ height: "32",
1340
+ viewBox: "0 0 32 32",
1341
+ fill: "none",
1342
+ xmlns: "http://www.w3.org/2000/svg",
1343
+ "aria-labelledby": titleId
1344
+ }, props), title ? /*#__PURE__*/React.createElement("title", {
1345
+ id: titleId
1346
+ }, title) : null, /*#__PURE__*/React.createElement("path", {
1347
+ fillRule: "evenodd",
1348
+ clipRule: "evenodd",
1349
+ d: "M3 14C3 7.925 7.925 3 14 3s11 4.925 11 11-4.925 11-11 11S3 20.075 3 14ZM14 1C6.82 1 1 6.82 1 14s5.82 13 13 13c3.23 0 6.185-1.178 8.458-3.128l6.835 6.835a1 1 0 0 0 1.414-1.414l-6.835-6.835A12.949 12.949 0 0 0 27 14c0-7.18-5.82-13-13-13Zm1 9a1 1 0 1 0-2 0v3h-3a1 1 0 1 0 0 2h3v3a1 1 0 1 0 2 0v-3h3a1 1 0 1 0 0-2h-3v-3Z",
1350
+ fill: "#fff"
1351
+ }));
1352
+
1332
1353
  const SvgCloseIcon = ({
1333
1354
  title,
1334
1355
  titleId,
@@ -1374,6 +1395,7 @@ const Modal = ({
1374
1395
  height,
1375
1396
  padding,
1376
1397
  setShow,
1398
+ zoomIcon,
1377
1399
  selected,
1378
1400
  children,
1379
1401
  minWidth,
@@ -1390,17 +1412,18 @@ const Modal = ({
1390
1412
  borderStyle,
1391
1413
  borderWidth,
1392
1414
  borderColor,
1415
+ imageMargin,
1416
+ showZoomIcon,
1393
1417
  outsideClose,
1394
1418
  headerWeight,
1395
1419
  headerHeight,
1420
+ imageMaxWidth,
1396
1421
  justifyContent,
1422
+ imageWrapWidth,
1397
1423
  backgroundColor,
1424
+ imageWrapHeight,
1398
1425
  grayDecorHeight,
1399
- layerBackgroundColor,
1400
- imageMargin,
1401
- imageMaxWidth,
1402
- imageWrapWidth,
1403
- imageWrapHeight
1426
+ layerBackgroundColor
1404
1427
  }) => {
1405
1428
  const [select, setSelect] = useState(0);
1406
1429
  const [innerData, setInnerData] = useState([]);
@@ -1432,6 +1455,11 @@ const Modal = ({
1432
1455
  handleCloseModal();
1433
1456
  }
1434
1457
  };
1458
+ const handleOpenInNewTab = url => {
1459
+ const imageLink = document.createElement('a');
1460
+ imageLink.href = url, imageLink.target = '_blank';
1461
+ imageLink.click();
1462
+ };
1435
1463
  useEffect(() => {
1436
1464
  if (type === 'images') {
1437
1465
  if (data) {
@@ -1582,7 +1610,9 @@ const Modal = ({
1582
1610
  if (!hasOwnerProperty(item, 'url')) {
1583
1611
  alert('Please add url property in data prop on each element');
1584
1612
  } else {
1585
- return /*#__PURE__*/React__default.createElement("img", {
1613
+ return /*#__PURE__*/React__default.createElement("span", {
1614
+ key: `${item.url}_${item.id ? item.id : '007'}_${index}`
1615
+ }, /*#__PURE__*/React__default.createElement("img", {
1586
1616
  style: {
1587
1617
  display: 'block',
1588
1618
  objectFit: 'cover',
@@ -1593,9 +1623,26 @@ const Modal = ({
1593
1623
  height: imageHeight ? imageHeight : configStyles.MODAL.imageHeight,
1594
1624
  maxWidth: imageMaxWidth ? imageMaxWidth : configStyles.MODAL.imageMaxWidth
1595
1625
  },
1596
- src: item.url,
1597
- key: item.id ? item.id : index
1598
- });
1626
+ src: item.url
1627
+ }), showZoomIcon ? /*#__PURE__*/React__default.createElement("div", {
1628
+ style: {
1629
+ top: '0px',
1630
+ left: '0px',
1631
+ zIndex: '10',
1632
+ right: '0px',
1633
+ bottom: '0px',
1634
+ margin: 'auto',
1635
+ display: 'flex',
1636
+ maxWidth: '40px',
1637
+ maxHeight: '40px',
1638
+ cursor: 'pointer',
1639
+ overflow: 'hidden',
1640
+ position: 'absolute',
1641
+ alignItems: 'center',
1642
+ justifyContent: 'center'
1643
+ },
1644
+ onClick: () => handleOpenInNewTab(item.url)
1645
+ }, zoomIcon ? zoomIcon : /*#__PURE__*/React__default.createElement(SvgZoom, null)) : '');
1599
1646
  }
1600
1647
  }
1601
1648
  }), innerData && innerData.length > 1 && /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("button", {
@@ -1641,26 +1688,28 @@ Modal.propTypes = {
1641
1688
  mMaxWidth: PropTypes.string,
1642
1689
  minHeight: PropTypes.string,
1643
1690
  className: PropTypes.string,
1691
+ zoomIcon: PropTypes.element,
1644
1692
  alignItems: PropTypes.string,
1645
1693
  mMaxHeight: PropTypes.string,
1646
1694
  headerText: PropTypes.string,
1647
1695
  imageWidth: PropTypes.string,
1648
1696
  headerSize: PropTypes.string,
1649
1697
  outsideClose: PropTypes.bool,
1698
+ showZoomIcon: PropTypes.bool,
1699
+ imageMargin: PropTypes.string,
1650
1700
  borderStyle: PropTypes.string,
1651
1701
  borderWidth: PropTypes.string,
1652
1702
  headerColor: PropTypes.string,
1653
1703
  imageHeight: PropTypes.string,
1654
1704
  headerWeight: PropTypes.string,
1655
1705
  headerHeight: PropTypes.string,
1706
+ imageMaxWidth: PropTypes.string,
1656
1707
  justifyContent: PropTypes.string,
1708
+ imageWrapWidth: PropTypes.string,
1657
1709
  backgroundColor: PropTypes.string,
1658
1710
  grayDecorHeight: PropTypes.string,
1659
- layerBackgroundColor: PropTypes.string,
1660
- imageMargin: PropTypes.string,
1661
- imageMaxWidth: PropTypes.string,
1662
- imageWrapWidth: PropTypes.string,
1663
- imageWrapHeight: PropTypes.string
1711
+ imageWrapHeight: PropTypes.string,
1712
+ layerBackgroundColor: PropTypes.string
1664
1713
  };
1665
1714
  Modal.defaultProps = {
1666
1715
  type: 'content'
package/dist/index.js CHANGED
@@ -573,18 +573,18 @@ const TD = ({
573
573
  style: {
574
574
  display: 'flex',
575
575
  alignItems: 'flex-start',
576
- justifyContent: hasOwnerProperty(item, 'contentList') || hasOwnerProperty(item, 'checkBox') ? 'space-between' : 'center'
576
+ justifyContent: hasOwnerProperty(item, 'checkBox') ? 'space-between' : 'center'
577
577
  }
578
- }, hasOwnerProperty(item, 'contentList') && /*#__PURE__*/React__default["default"].createElement("div", {
578
+ }, !hasOwnerProperty(item, 'hideArrow') && item.hideArrow !== false && (!hasOwnerProperty(item, 'rightArrow') || item.rightArrow !== true) ? hasOwnerProperty(item, 'contentList') && (hasOwnerProperty(item, 'closeArrow') || hasOwnerProperty(item, 'openArrow')) && /*#__PURE__*/React__default["default"].createElement("div", {
579
579
  id: item.id,
580
580
  style: {
581
581
  width: '21px',
582
582
  height: '21px',
583
583
  cursor: 'pointer'
584
584
  },
585
- onClick: () => handleOpenCloseRowSingleArrow(index, innerIndex),
585
+ onClick: () => handleOpenCloseRowSingleArrow(index, innerIndex, item),
586
586
  className: styles$c['td-span']
587
- }, item.status === 'close' ? item.closeArrow : item.openArrow), hasOwnerProperty(item, 'checkBox') && /*#__PURE__*/React__default["default"].createElement(SingleCheckbox, {
587
+ }, hasOwnerProperty(item, 'status') && item.status === 'close' ? item.closeArrow : item.openArrow) : '', hasOwnerProperty(item, 'checkBox') && /*#__PURE__*/React__default["default"].createElement(SingleCheckbox, {
588
588
  data: item,
589
589
  index: index,
590
590
  innerIndex: innerIndex,
@@ -595,7 +595,8 @@ const TD = ({
595
595
  unCheckedColor: item.checkBox.unCheckedColor
596
596
  }), /*#__PURE__*/React__default["default"].createElement("div", {
597
597
  style: {
598
- marginLeft: item.contentList ? '10px' : '0px'
598
+ marginLeft: hasOwnerProperty(item, 'contentList') && (!hasOwnerProperty(item, 'hideArrow') || item.hideArrow !== true) ? hasOwnerProperty(item, 'rightArrow') ? item.rightArrow === true ? '0px' : '10px' : hasOwnerProperty(item, 'closeArrow') || hasOwnerProperty(item, 'openArrow') ? '10px' : '0px' : '0px',
599
+ marginRight: hasOwnerProperty(item, 'contentList') && (!hasOwnerProperty(item, 'hideArrow') || item.hideArrow !== true) ? hasOwnerProperty(item, 'rightArrow') ? item.rightArrow === true ? '10px' : '0px' : '0px' : '0px'
599
600
  }
600
601
  }, /*#__PURE__*/React__default["default"].createElement("p", {
601
602
  style: {
@@ -644,7 +645,8 @@ const TD = ({
644
645
  textAlign: 'left',
645
646
  overflow: 'hidden',
646
647
  whiteSpace: 'nowrap',
647
- textOverflow: 'ellipsis'
648
+ textOverflow: 'ellipsis',
649
+ marginBottom: '5px'
648
650
  },
649
651
  title: optionItem.content
650
652
  }, optionItem.content));
@@ -666,7 +668,16 @@ const TD = ({
666
668
  },
667
669
  onClick: e => handleContentList(e, item, index, innerIndex, innerItem.id, innerItem.content, innerItemIndex)
668
670
  }, innerItem.content);
669
- })))) : '');
671
+ }))), !hasOwnerProperty(item, 'hideArrow') && item.hideArrow !== false && hasOwnerProperty(item, 'rightArrow') && item.rightArrow === true ? hasOwnerProperty(item, 'contentList') && (hasOwnerProperty(item, 'closeArrow') || hasOwnerProperty(item, 'openArrow')) && /*#__PURE__*/React__default["default"].createElement("div", {
672
+ id: item.id,
673
+ style: {
674
+ width: '21px',
675
+ height: '21px',
676
+ cursor: 'pointer'
677
+ },
678
+ onClick: () => handleOpenCloseRowSingleArrow(index, innerIndex, item),
679
+ className: styles$c['td-span']
680
+ }, hasOwnerProperty(item, 'status') && item.status === 'close' ? item.closeArrow : item.openArrow) : '') : '');
670
681
  };
671
682
 
672
683
  const SvgUpArrow = ({
@@ -906,11 +917,13 @@ const Table = ({
906
917
  const newUpdatedBody = updatedBody.map((item, index) => {
907
918
  return item.map((innerItem, innerIndex) => {
908
919
  if (checkableItemIndex === innerIndex) {
909
- innerItem.checkBox.checked = checkableItemBool;
910
- checkableBodyRowItems.push({
911
- column: innerIndex,
912
- columnItem: innerItem
913
- });
920
+ if (!hasOwnerProperty(innerItem.checkBox, 'disabled') || innerItem.checkBox.disabled !== true) {
921
+ innerItem.checkBox.checked = checkableItemBool;
922
+ checkableBodyRowItems.push({
923
+ column: innerIndex,
924
+ columnItem: innerItem
925
+ });
926
+ }
914
927
  handleHeaderCheckedUpdate({
915
928
  row: index,
916
929
  column: innerIndex,
@@ -1019,7 +1032,8 @@ const Table = ({
1019
1032
  return [...prev];
1020
1033
  });
1021
1034
  };
1022
- const handleOpenCloseRowSingleArrow = (arrowRowIndex, arrowIndex) => {
1035
+ const handleOpenCloseRowSingleArrow = (arrowRowIndex, arrowIndex, clickableItem) => {
1036
+ console.log(clickableItem, 'clickableItem');
1023
1037
  let single = {};
1024
1038
  const allArrows = [];
1025
1039
  const checkedOpenableRow = body[arrowRowIndex].map((item, index) => {
@@ -1046,6 +1060,9 @@ const Table = ({
1046
1060
  }
1047
1061
  }
1048
1062
  }
1063
+ if (hasOwnerProperty(clickableItem, 'theSame') && hasOwnerProperty(item, 'theSame') && clickableItem.theSame === item.theSame) {
1064
+ item.status = clickableItem.status;
1065
+ }
1049
1066
  return item;
1050
1067
  });
1051
1068
  setBody(prev => {
@@ -1102,20 +1119,6 @@ const Table = ({
1102
1119
  });
1103
1120
  setBody(() => checkBodyMore);
1104
1121
  };
1105
- const handleCheckDisable = (arr, disableArr) => {
1106
- let headerWithDisabled = [];
1107
- if (disableArr && disableArr.length > 0) {
1108
- headerWithDisabled = arr.map((item, index) => {
1109
- if (disableArr[index]) {
1110
- if (hasOwnerProperty(item, 'checkBox')) {
1111
- item.checkBox.disabled = true;
1112
- }
1113
- }
1114
- return item;
1115
- });
1116
- }
1117
- return headerWithDisabled;
1118
- };
1119
1122
  const handleContentListClick = (e, data) => {
1120
1123
  e.stopPropagation();
1121
1124
  const {
@@ -1217,11 +1220,9 @@ const Table = ({
1217
1220
  const header = dataHeader.slice();
1218
1221
  const arrowColumnCount = handleSetInsertIndex(header, arrowColumn);
1219
1222
  const checkForInsertArrow = handleTransformDataForInsertArrow(header, arrowColumnCount, 'header');
1220
- const headerWithDisabled = handleCheckDisable(checkForInsertArrow, disableArr);
1221
- setHeader(() => headerWithDisabled.length > 0 ? headerWithDisabled : checkForInsertArrow);
1223
+ setHeader(() => checkForInsertArrow);
1222
1224
  } else {
1223
- const headerWithDisabled = handleCheckDisable(dataHeader, disableArr);
1224
- setHeader(() => headerWithDisabled.length > 0 ? headerWithDisabled : dataHeader);
1225
+ setHeader(() => dataHeader);
1225
1226
  }
1226
1227
  }, [dataHeader, arrowColumn, arrowShow, disableArr]);
1227
1228
  return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement("table", {
@@ -1359,6 +1360,26 @@ const SvgPrev = ({
1359
1360
  fill: "#3C393E"
1360
1361
  }));
1361
1362
 
1363
+ const SvgZoom = ({
1364
+ title,
1365
+ titleId,
1366
+ ...props
1367
+ }) => /*#__PURE__*/React__namespace.createElement("svg", _extends({
1368
+ width: "32",
1369
+ height: "32",
1370
+ viewBox: "0 0 32 32",
1371
+ fill: "none",
1372
+ xmlns: "http://www.w3.org/2000/svg",
1373
+ "aria-labelledby": titleId
1374
+ }, props), title ? /*#__PURE__*/React__namespace.createElement("title", {
1375
+ id: titleId
1376
+ }, title) : null, /*#__PURE__*/React__namespace.createElement("path", {
1377
+ fillRule: "evenodd",
1378
+ clipRule: "evenodd",
1379
+ d: "M3 14C3 7.925 7.925 3 14 3s11 4.925 11 11-4.925 11-11 11S3 20.075 3 14ZM14 1C6.82 1 1 6.82 1 14s5.82 13 13 13c3.23 0 6.185-1.178 8.458-3.128l6.835 6.835a1 1 0 0 0 1.414-1.414l-6.835-6.835A12.949 12.949 0 0 0 27 14c0-7.18-5.82-13-13-13Zm1 9a1 1 0 1 0-2 0v3h-3a1 1 0 1 0 0 2h3v3a1 1 0 1 0 2 0v-3h3a1 1 0 1 0 0-2h-3v-3Z",
1380
+ fill: "#fff"
1381
+ }));
1382
+
1362
1383
  const SvgCloseIcon = ({
1363
1384
  title,
1364
1385
  titleId,
@@ -1404,6 +1425,7 @@ const Modal = ({
1404
1425
  height,
1405
1426
  padding,
1406
1427
  setShow,
1428
+ zoomIcon,
1407
1429
  selected,
1408
1430
  children,
1409
1431
  minWidth,
@@ -1420,17 +1442,18 @@ const Modal = ({
1420
1442
  borderStyle,
1421
1443
  borderWidth,
1422
1444
  borderColor,
1445
+ imageMargin,
1446
+ showZoomIcon,
1423
1447
  outsideClose,
1424
1448
  headerWeight,
1425
1449
  headerHeight,
1450
+ imageMaxWidth,
1426
1451
  justifyContent,
1452
+ imageWrapWidth,
1427
1453
  backgroundColor,
1454
+ imageWrapHeight,
1428
1455
  grayDecorHeight,
1429
- layerBackgroundColor,
1430
- imageMargin,
1431
- imageMaxWidth,
1432
- imageWrapWidth,
1433
- imageWrapHeight
1456
+ layerBackgroundColor
1434
1457
  }) => {
1435
1458
  const [select, setSelect] = React.useState(0);
1436
1459
  const [innerData, setInnerData] = React.useState([]);
@@ -1462,6 +1485,11 @@ const Modal = ({
1462
1485
  handleCloseModal();
1463
1486
  }
1464
1487
  };
1488
+ const handleOpenInNewTab = url => {
1489
+ const imageLink = document.createElement('a');
1490
+ imageLink.href = url, imageLink.target = '_blank';
1491
+ imageLink.click();
1492
+ };
1465
1493
  React.useEffect(() => {
1466
1494
  if (type === 'images') {
1467
1495
  if (data) {
@@ -1612,7 +1640,9 @@ const Modal = ({
1612
1640
  if (!hasOwnerProperty(item, 'url')) {
1613
1641
  alert('Please add url property in data prop on each element');
1614
1642
  } else {
1615
- return /*#__PURE__*/React__default["default"].createElement("img", {
1643
+ return /*#__PURE__*/React__default["default"].createElement("span", {
1644
+ key: `${item.url}_${item.id ? item.id : '007'}_${index}`
1645
+ }, /*#__PURE__*/React__default["default"].createElement("img", {
1616
1646
  style: {
1617
1647
  display: 'block',
1618
1648
  objectFit: 'cover',
@@ -1623,9 +1653,26 @@ const Modal = ({
1623
1653
  height: imageHeight ? imageHeight : configStyles.MODAL.imageHeight,
1624
1654
  maxWidth: imageMaxWidth ? imageMaxWidth : configStyles.MODAL.imageMaxWidth
1625
1655
  },
1626
- src: item.url,
1627
- key: item.id ? item.id : index
1628
- });
1656
+ src: item.url
1657
+ }), showZoomIcon ? /*#__PURE__*/React__default["default"].createElement("div", {
1658
+ style: {
1659
+ top: '0px',
1660
+ left: '0px',
1661
+ zIndex: '10',
1662
+ right: '0px',
1663
+ bottom: '0px',
1664
+ margin: 'auto',
1665
+ display: 'flex',
1666
+ maxWidth: '40px',
1667
+ maxHeight: '40px',
1668
+ cursor: 'pointer',
1669
+ overflow: 'hidden',
1670
+ position: 'absolute',
1671
+ alignItems: 'center',
1672
+ justifyContent: 'center'
1673
+ },
1674
+ onClick: () => handleOpenInNewTab(item.url)
1675
+ }, zoomIcon ? zoomIcon : /*#__PURE__*/React__default["default"].createElement(SvgZoom, null)) : '');
1629
1676
  }
1630
1677
  }
1631
1678
  }), innerData && innerData.length > 1 && /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement("button", {
@@ -1671,26 +1718,28 @@ Modal.propTypes = {
1671
1718
  mMaxWidth: PropTypes__default["default"].string,
1672
1719
  minHeight: PropTypes__default["default"].string,
1673
1720
  className: PropTypes__default["default"].string,
1721
+ zoomIcon: PropTypes__default["default"].element,
1674
1722
  alignItems: PropTypes__default["default"].string,
1675
1723
  mMaxHeight: PropTypes__default["default"].string,
1676
1724
  headerText: PropTypes__default["default"].string,
1677
1725
  imageWidth: PropTypes__default["default"].string,
1678
1726
  headerSize: PropTypes__default["default"].string,
1679
1727
  outsideClose: PropTypes__default["default"].bool,
1728
+ showZoomIcon: PropTypes__default["default"].bool,
1729
+ imageMargin: PropTypes__default["default"].string,
1680
1730
  borderStyle: PropTypes__default["default"].string,
1681
1731
  borderWidth: PropTypes__default["default"].string,
1682
1732
  headerColor: PropTypes__default["default"].string,
1683
1733
  imageHeight: PropTypes__default["default"].string,
1684
1734
  headerWeight: PropTypes__default["default"].string,
1685
1735
  headerHeight: PropTypes__default["default"].string,
1736
+ imageMaxWidth: PropTypes__default["default"].string,
1686
1737
  justifyContent: PropTypes__default["default"].string,
1738
+ imageWrapWidth: PropTypes__default["default"].string,
1687
1739
  backgroundColor: PropTypes__default["default"].string,
1688
1740
  grayDecorHeight: PropTypes__default["default"].string,
1689
- layerBackgroundColor: PropTypes__default["default"].string,
1690
- imageMargin: PropTypes__default["default"].string,
1691
- imageMaxWidth: PropTypes__default["default"].string,
1692
- imageWrapWidth: PropTypes__default["default"].string,
1693
- imageWrapHeight: PropTypes__default["default"].string
1741
+ imageWrapHeight: PropTypes__default["default"].string,
1742
+ layerBackgroundColor: PropTypes__default["default"].string
1694
1743
  };
1695
1744
  Modal.defaultProps = {
1696
1745
  type: 'content'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xaypay/tui",
3
- "version": "0.0.113",
3
+ "version": "0.0.114",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.es.js",
@@ -0,0 +1,21 @@
1
+ import * as React from 'react'
2
+ const SvgZoom = ({ title, titleId, ...props }) => (
3
+ <svg
4
+ width="32"
5
+ height="32"
6
+ viewBox="0 0 32 32"
7
+ fill="none"
8
+ xmlns="http://www.w3.org/2000/svg"
9
+ aria-labelledby={titleId}
10
+ {...props}
11
+ >
12
+ {title ? <title id={titleId}>{title}</title> : null}
13
+ <path
14
+ fillRule="evenodd"
15
+ clipRule="evenodd"
16
+ d="M3 14C3 7.925 7.925 3 14 3s11 4.925 11 11-4.925 11-11 11S3 20.075 3 14ZM14 1C6.82 1 1 6.82 1 14s5.82 13 13 13c3.23 0 6.185-1.178 8.458-3.128l6.835 6.835a1 1 0 0 0 1.414-1.414l-6.835-6.835A12.949 12.949 0 0 0 27 14c0-7.18-5.82-13-13-13Zm1 9a1 1 0 1 0-2 0v3h-3a1 1 0 1 0 0 2h3v3a1 1 0 1 0 2 0v-3h3a1 1 0 1 0 0-2h-3v-3Z"
17
+ fill="#fff"
18
+ />
19
+ </svg>
20
+ )
21
+ export default SvgZoom
@@ -7,6 +7,7 @@ import styles from './modal.module.css'
7
7
 
8
8
  import SvgNext from './../icon/Next'
9
9
  import SvgPrev from './../icon/Prev'
10
+ import SvgZoom from './../icon/Zoom'
10
11
  import SvgCloseIcon from './../icon/CloseIcon'
11
12
  import SvgCloseSlide from './../icon/CloseSlide'
12
13
 
@@ -18,6 +19,7 @@ export const Modal = ({
18
19
  height,
19
20
  padding,
20
21
  setShow,
22
+ zoomIcon,
21
23
  selected,
22
24
  children,
23
25
  minWidth,
@@ -34,17 +36,18 @@ export const Modal = ({
34
36
  borderStyle,
35
37
  borderWidth,
36
38
  borderColor,
39
+ imageMargin,
40
+ showZoomIcon,
37
41
  outsideClose,
38
42
  headerWeight,
39
43
  headerHeight,
44
+ imageMaxWidth,
40
45
  justifyContent,
46
+ imageWrapWidth,
41
47
  backgroundColor,
48
+ imageWrapHeight,
42
49
  grayDecorHeight,
43
50
  layerBackgroundColor,
44
- imageMargin,
45
- imageMaxWidth,
46
- imageWrapWidth,
47
- imageWrapHeight,
48
51
  }) => {
49
52
  const [select, setSelect] = useState(0)
50
53
  const [innerData, setInnerData] = useState([])
@@ -82,6 +85,12 @@ export const Modal = ({
82
85
  }
83
86
  }
84
87
 
88
+ const handleOpenInNewTab = (url) => {
89
+ const imageLink = document.createElement('a')
90
+ ;(imageLink.href = url), (imageLink.target = '_blank')
91
+ imageLink.click()
92
+ }
93
+
85
94
  useEffect(() => {
86
95
  if (type === 'images') {
87
96
  if (data) {
@@ -270,30 +279,56 @@ export const Modal = ({
270
279
  alert('Please add url property in data prop on each element')
271
280
  } else {
272
281
  return (
273
- <img
274
- style={{
275
- display: 'block',
276
- objectFit: 'cover',
277
- objectPosition: 'center',
278
- margin: imageMargin
279
- ? imageMargin
280
- : configStyles.MODAL.imageMargin,
281
- borderRadius: radius
282
- ? radius
283
- : configStyles.MODAL.radius,
284
- width: imageWidth
285
- ? imageWidth
286
- : configStyles.MODAL.imageWidth,
287
- height: imageHeight
288
- ? imageHeight
289
- : configStyles.MODAL.imageHeight,
290
- maxWidth: imageMaxWidth
291
- ? imageMaxWidth
292
- : configStyles.MODAL.imageMaxWidth,
293
- }}
294
- src={item.url}
295
- key={item.id ? item.id : index}
296
- />
282
+ <span key={`${item.url}_${item.id ? item.id : '007'}_${index}`}>
283
+ <img
284
+ style={{
285
+ display: 'block',
286
+ objectFit: 'cover',
287
+ objectPosition: 'center',
288
+ margin: imageMargin
289
+ ? imageMargin
290
+ : configStyles.MODAL.imageMargin,
291
+ borderRadius: radius
292
+ ? radius
293
+ : configStyles.MODAL.radius,
294
+ width: imageWidth
295
+ ? imageWidth
296
+ : configStyles.MODAL.imageWidth,
297
+ height: imageHeight
298
+ ? imageHeight
299
+ : configStyles.MODAL.imageHeight,
300
+ maxWidth: imageMaxWidth
301
+ ? imageMaxWidth
302
+ : configStyles.MODAL.imageMaxWidth,
303
+ }}
304
+ src={item.url}
305
+ />
306
+ {showZoomIcon ? (
307
+ <div
308
+ style={{
309
+ top: '0px',
310
+ left: '0px',
311
+ zIndex: '10',
312
+ right: '0px',
313
+ bottom: '0px',
314
+ margin: 'auto',
315
+ display: 'flex',
316
+ maxWidth: '40px',
317
+ maxHeight: '40px',
318
+ cursor: 'pointer',
319
+ overflow: 'hidden',
320
+ position: 'absolute',
321
+ alignItems: 'center',
322
+ justifyContent: 'center',
323
+ }}
324
+ onClick={() => handleOpenInNewTab(item.url)}
325
+ >
326
+ {zoomIcon ? zoomIcon : <SvgZoom />}
327
+ </div>
328
+ ) : (
329
+ ''
330
+ )}
331
+ </span>
297
332
  )
298
333
  }
299
334
  }
@@ -360,26 +395,28 @@ Modal.propTypes = {
360
395
  mMaxWidth: PropTypes.string,
361
396
  minHeight: PropTypes.string,
362
397
  className: PropTypes.string,
398
+ zoomIcon: PropTypes.element,
363
399
  alignItems: PropTypes.string,
364
400
  mMaxHeight: PropTypes.string,
365
401
  headerText: PropTypes.string,
366
402
  imageWidth: PropTypes.string,
367
403
  headerSize: PropTypes.string,
368
404
  outsideClose: PropTypes.bool,
405
+ showZoomIcon: PropTypes.bool,
406
+ imageMargin: PropTypes.string,
369
407
  borderStyle: PropTypes.string,
370
408
  borderWidth: PropTypes.string,
371
409
  headerColor: PropTypes.string,
372
410
  imageHeight: PropTypes.string,
373
411
  headerWeight: PropTypes.string,
374
412
  headerHeight: PropTypes.string,
413
+ imageMaxWidth: PropTypes.string,
375
414
  justifyContent: PropTypes.string,
415
+ imageWrapWidth: PropTypes.string,
376
416
  backgroundColor: PropTypes.string,
377
417
  grayDecorHeight: PropTypes.string,
378
- layerBackgroundColor: PropTypes.string,
379
- imageMargin: PropTypes.string,
380
- imageMaxWidth: PropTypes.string,
381
- imageWrapWidth: PropTypes.string,
382
418
  imageWrapHeight: PropTypes.string,
419
+ layerBackgroundColor: PropTypes.string,
383
420
  }
384
421
 
385
422
  Modal.defaultProps = {
@@ -64,7 +64,7 @@ const Template = ({ className }) => {
64
64
  Change type to {type === 'content' ? 'images' : 'content'}
65
65
  </button>
66
66
  {show && (
67
- <Modal type={type} selected={0} data={data} setShow={setShow} className={className}>
67
+ <Modal type={type} selected={0} showZoomIcon data={data} setShow={setShow} className={className}>
68
68
  <div
69
69
  style={{
70
70
  width: '400px',
@@ -212,8 +212,10 @@ export const Table = ({
212
212
  const newUpdatedBody = updatedBody.map((item, index) => {
213
213
  return item.map((innerItem, innerIndex) => {
214
214
  if (checkableItemIndex === innerIndex) {
215
- innerItem.checkBox.checked = checkableItemBool
216
- checkableBodyRowItems.push({ column: innerIndex, columnItem: innerItem })
215
+ if (!hasOwnerProperty(innerItem.checkBox, 'disabled') || innerItem.checkBox.disabled !== true) {
216
+ innerItem.checkBox.checked = checkableItemBool
217
+ checkableBodyRowItems.push({ column: innerIndex, columnItem: innerItem })
218
+ }
217
219
  handleHeaderCheckedUpdate({
218
220
  row: index,
219
221
  column: innerIndex,
@@ -333,7 +335,8 @@ export const Table = ({
333
335
  })
334
336
  }
335
337
 
336
- const handleOpenCloseRowSingleArrow = (arrowRowIndex, arrowIndex) => {
338
+ const handleOpenCloseRowSingleArrow = (arrowRowIndex, arrowIndex, clickableItem) => {
339
+ console.log(clickableItem, 'clickableItem')
337
340
  let single = {}
338
341
  const allArrows = []
339
342
  const checkedOpenableRow = body[arrowRowIndex].map((item, index) => {
@@ -343,6 +346,7 @@ export const Table = ({
343
346
  } else {
344
347
  item.status = 'close'
345
348
  }
349
+
346
350
  single = item
347
351
  }
348
352
 
@@ -363,6 +367,15 @@ export const Table = ({
363
367
  }
364
368
  }
365
369
  }
370
+
371
+ if (
372
+ hasOwnerProperty(clickableItem, 'theSame') &&
373
+ hasOwnerProperty(item, 'theSame') &&
374
+ clickableItem.theSame === item.theSame
375
+ ) {
376
+ item.status = clickableItem.status
377
+ }
378
+
366
379
  return item
367
380
  })
368
381
 
@@ -424,21 +437,6 @@ export const Table = ({
424
437
  setBody(() => checkBodyMore)
425
438
  }
426
439
 
427
- const handleCheckDisable = (arr, disableArr) => {
428
- let headerWithDisabled = []
429
- if (disableArr && disableArr.length > 0) {
430
- headerWithDisabled = arr.map((item, index) => {
431
- if (disableArr[index]) {
432
- if (hasOwnerProperty(item, 'checkBox')) {
433
- item.checkBox.disabled = true
434
- }
435
- }
436
- return item
437
- })
438
- }
439
- return headerWithDisabled
440
- }
441
-
442
440
  const handleContentListClick = (e, data) => {
443
441
  e.stopPropagation()
444
442
 
@@ -548,17 +546,11 @@ export const Table = ({
548
546
  useEffect(() => {
549
547
  if (arrowShow) {
550
548
  const header = dataHeader.slice()
551
-
552
549
  const arrowColumnCount = handleSetInsertIndex(header, arrowColumn)
553
-
554
550
  const checkForInsertArrow = handleTransformDataForInsertArrow(header, arrowColumnCount, 'header')
555
-
556
- const headerWithDisabled = handleCheckDisable(checkForInsertArrow, disableArr)
557
-
558
- setHeader(() => (headerWithDisabled.length > 0 ? headerWithDisabled : checkForInsertArrow))
551
+ setHeader(() => checkForInsertArrow)
559
552
  } else {
560
- const headerWithDisabled = handleCheckDisable(dataHeader, disableArr)
561
- setHeader(() => (headerWithDisabled.length > 0 ? headerWithDisabled : dataHeader))
553
+ setHeader(() => dataHeader)
562
554
  }
563
555
  }, [dataHeader, arrowColumn, arrowShow, disableArr])
564
556
 
@@ -76,6 +76,11 @@ const headerData = [
76
76
  content: 'Գործողություն',
77
77
  sortingArrows: true,
78
78
  },
79
+ {
80
+ type: 'show',
81
+ content: 'Գործողություն 2',
82
+ sortingArrows: true,
83
+ },
79
84
  {
80
85
  type: 'show',
81
86
  content: <ReactSVG />,
@@ -118,6 +123,9 @@ const bodyData = [
118
123
  },
119
124
  info: {
120
125
  status: 'close',
126
+ hideArrow: true, // prop for hide open close arrows
127
+ rightArrow: true, // prop for set arrow side, if true arrow go to right side, if false or if haven't this prop arrow go left ( by defult )
128
+ theSame: 'to open another list', // prop for open close another list item, IMPORTANT theSame prop in another list should be equal
121
129
  openArrow: <ReactSVGArrowUp />,
122
130
  closeArrow: <ReactSVGArrowDown />,
123
131
  content: 'Այլ արտաքին գովազդի տեղադրելու վճար / ԱՁ',
@@ -131,6 +139,17 @@ const bodyData = [
131
139
  create: {
132
140
  content: '27.05.2022',
133
141
  },
142
+ info2: {
143
+ status: 'close',
144
+ theSame: 'to open another list', // prop for open close another list item, IMPORTANT theSame prop in another list should be equal
145
+ content: ' - - ',
146
+ contentList: [
147
+ { id: 0, content: <ReactSVGPlus /> },
148
+ { id: 1, content: <ReactSVGPlus /> },
149
+ { id: 2, content: <ReactSVGPlus /> },
150
+ { id: 3, content: <ReactSVGPlus /> },
151
+ ],
152
+ },
134
153
  actions: [
135
154
  {
136
155
  id: 19854,
@@ -198,6 +217,7 @@ const bodyData = [
198
217
  },
199
218
  info: {
200
219
  status: 'close',
220
+ theSame: 'to open just list',
201
221
  openArrow: <ReactSVGArrowUp />,
202
222
  closeArrow: <ReactSVGArrowDown />,
203
223
  content: 'Այլ արտաքին գովազդի տեղադրելու վճար / ԱՁ',
@@ -211,6 +231,17 @@ const bodyData = [
211
231
  create: {
212
232
  content: '27.05.2022',
213
233
  },
234
+ info2: {
235
+ status: 'close',
236
+ theSame: 'to open just list',
237
+ content: ' - - ',
238
+ contentList: [
239
+ { id: 0, content: <ReactSVGPlus /> },
240
+ { id: 1, content: <ReactSVGPlus /> },
241
+ { id: 2, content: <ReactSVGPlus /> },
242
+ { id: 3, content: <ReactSVGPlus /> },
243
+ ],
244
+ },
214
245
  actions: [
215
246
  {
216
247
  id: 19954,
@@ -278,6 +309,7 @@ const bodyData = [
278
309
  },
279
310
  info: {
280
311
  status: 'close',
312
+ theSame: 'to open second list',
281
313
  openArrow: <ReactSVGArrowUp />,
282
314
  closeArrow: <ReactSVGArrowDown />,
283
315
  content: 'Այլ արտաքին գովազդի տեղադրելու վճար / ԱՁ',
@@ -291,6 +323,17 @@ const bodyData = [
291
323
  create: {
292
324
  content: '27.05.2022',
293
325
  },
326
+ info2: {
327
+ status: 'close',
328
+ theSame: 'to open second list',
329
+ content: ' - - ',
330
+ contentList: [
331
+ { id: 0, content: <ReactSVGPlus /> },
332
+ { id: 1, content: <ReactSVGPlus /> },
333
+ { id: 2, content: <ReactSVGPlus /> },
334
+ { id: 3, content: <ReactSVGPlus /> },
335
+ ],
336
+ },
294
337
  actions: [
295
338
  {
296
339
  id: 20037,
@@ -359,6 +402,7 @@ const bodyData = [
359
402
  },
360
403
  info: {
361
404
  status: 'close',
405
+ theSame: 'to open third list',
362
406
  openArrow: <ReactSVGArrowUp />,
363
407
  closeArrow: <ReactSVGArrowDown />,
364
408
  content: 'Այլ արտաքին գովազդի տեղադրելու վճար / ԱՁ',
@@ -381,6 +425,17 @@ const bodyData = [
381
425
  },
382
426
  ],
383
427
  ],
428
+ info2: {
429
+ status: 'close',
430
+ theSame: 'to open third list',
431
+ content: ' - - ',
432
+ contentList: [
433
+ { id: 0, content: <ReactSVGPlus /> },
434
+ { id: 1, content: <ReactSVGPlus /> },
435
+ { id: 2, content: <ReactSVGPlus /> },
436
+ { id: 3, content: <ReactSVGPlus /> },
437
+ ],
438
+ },
384
439
  actions: [
385
440
  [
386
441
  {
@@ -435,7 +490,16 @@ const Template = (args) => {
435
490
  console.log(tData, ' data from table click action, with getData props')
436
491
  }
437
492
 
438
- return <Table {...args} dataBody={bodyData} dataHeader={headerData} getData={handleGetData} />
493
+ return (
494
+ <Table
495
+ {...args}
496
+ arrowColumn={2}
497
+ arrowShow
498
+ dataBody={bodyData}
499
+ dataHeader={headerData}
500
+ getData={handleGetData}
501
+ />
502
+ )
439
503
  }
440
504
 
441
505
  export const Default = Template.bind({})
@@ -149,26 +149,30 @@ const TD = ({
149
149
  style={{
150
150
  display: 'flex',
151
151
  alignItems: 'flex-start',
152
- justifyContent:
153
- hasOwnerProperty(item, 'contentList') || hasOwnerProperty(item, 'checkBox')
154
- ? 'space-between'
155
- : 'center',
152
+ justifyContent: hasOwnerProperty(item, 'checkBox') ? 'space-between' : 'center',
156
153
  }}
157
154
  >
158
- {hasOwnerProperty(item, 'contentList') && (
159
- <div
160
- id={item.id}
161
- style={{
162
- width: '21px',
163
- height: '21px',
164
- cursor: 'pointer',
165
- }}
166
- onClick={() => handleOpenCloseRowSingleArrow(index, innerIndex)}
167
- className={styles['td-span']}
168
- >
169
- {item.status === 'close' ? item.closeArrow : item.openArrow}
170
- </div>
171
- )}
155
+ {!hasOwnerProperty(item, 'hideArrow') &&
156
+ item.hideArrow !== false &&
157
+ (!hasOwnerProperty(item, 'rightArrow') || item.rightArrow !== true)
158
+ ? hasOwnerProperty(item, 'contentList') &&
159
+ (hasOwnerProperty(item, 'closeArrow') || hasOwnerProperty(item, 'openArrow')) && (
160
+ <div
161
+ id={item.id}
162
+ style={{
163
+ width: '21px',
164
+ height: '21px',
165
+ cursor: 'pointer',
166
+ }}
167
+ onClick={() => handleOpenCloseRowSingleArrow(index, innerIndex, item)}
168
+ className={styles['td-span']}
169
+ >
170
+ {hasOwnerProperty(item, 'status') && item.status === 'close'
171
+ ? item.closeArrow
172
+ : item.openArrow}
173
+ </div>
174
+ )
175
+ : ''}
172
176
 
173
177
  {hasOwnerProperty(item, 'checkBox') && (
174
178
  <SingleCheckbox
@@ -185,7 +189,26 @@ const TD = ({
185
189
 
186
190
  <div
187
191
  style={{
188
- marginLeft: item.contentList ? '10px' : '0px',
192
+ marginLeft:
193
+ hasOwnerProperty(item, 'contentList') &&
194
+ (!hasOwnerProperty(item, 'hideArrow') || item.hideArrow !== true)
195
+ ? hasOwnerProperty(item, 'rightArrow')
196
+ ? item.rightArrow === true
197
+ ? '0px'
198
+ : '10px'
199
+ : hasOwnerProperty(item, 'closeArrow') || hasOwnerProperty(item, 'openArrow')
200
+ ? '10px'
201
+ : '0px'
202
+ : '0px',
203
+ marginRight:
204
+ hasOwnerProperty(item, 'contentList') &&
205
+ (!hasOwnerProperty(item, 'hideArrow') || item.hideArrow !== true)
206
+ ? hasOwnerProperty(item, 'rightArrow')
207
+ ? item.rightArrow === true
208
+ ? '10px'
209
+ : '0px'
210
+ : '0px'
211
+ : '0px',
189
212
  }}
190
213
  >
191
214
  <p
@@ -273,6 +296,7 @@ const TD = ({
273
296
  overflow: 'hidden',
274
297
  whiteSpace: 'nowrap',
275
298
  textOverflow: 'ellipsis',
299
+ marginBottom: '5px',
276
300
  }}
277
301
  title={optionItem.content}
278
302
  >
@@ -327,6 +351,29 @@ const TD = ({
327
351
  </div>
328
352
  )}
329
353
  </div>
354
+
355
+ {!hasOwnerProperty(item, 'hideArrow') &&
356
+ item.hideArrow !== false &&
357
+ hasOwnerProperty(item, 'rightArrow') &&
358
+ item.rightArrow === true
359
+ ? hasOwnerProperty(item, 'contentList') &&
360
+ (hasOwnerProperty(item, 'closeArrow') || hasOwnerProperty(item, 'openArrow')) && (
361
+ <div
362
+ id={item.id}
363
+ style={{
364
+ width: '21px',
365
+ height: '21px',
366
+ cursor: 'pointer',
367
+ }}
368
+ onClick={() => handleOpenCloseRowSingleArrow(index, innerIndex, item)}
369
+ className={styles['td-span']}
370
+ >
371
+ {hasOwnerProperty(item, 'status') && item.status === 'close'
372
+ ? item.closeArrow
373
+ : item.openArrow}
374
+ </div>
375
+ )
376
+ : ''}
330
377
  </div>
331
378
  ) : (
332
379
  ''
@@ -22,6 +22,7 @@ import fileSingleImage from './static/file-single-usage.png';
22
22
  import tableComponent from './static/table-component-usage.png';
23
23
  import toasterImage from './static/toaster-container-usage.png';
24
24
  import autocompleteImage from './static/autocomplete-usage.png';
25
+ import tableBodyStructureNew from './static/table-new-data-structure-usage.png';
25
26
  import tableHeaderStructure from './static/table-header-data-structure-usage.png';
26
27
  import tableBodyStructureFirst from './static/table-body-data-structure-first-part-usage.png';
27
28
  import tableBodyStructureThird from './static/table-body-data-structure-third-part-usage.png';
@@ -185,4 +186,5 @@ import tableBodyStructureSecond from './static/table-body-data-structure-second-
185
186
  <img src={tableHeaderStructure} alt="file image" />
186
187
  <img src={tableBodyStructureFirst} alt="file image" />
187
188
  <img src={tableBodyStructureSecond} alt="file image" />
189
+ <img src={tableBodyStructureNew} alt="file image" />
188
190
  <img src={tableBodyStructureThird} alt="file image" />