@xaypay/tui 0.0.109 → 0.0.111

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
@@ -44,16 +44,16 @@ const SvgRequired = ({
44
44
  titleId,
45
45
  ...props
46
46
  }) => /*#__PURE__*/React.createElement("svg", _extends({
47
- width: "12",
48
- height: "12",
49
- viewBox: "0 0 12 12",
47
+ width: "10",
48
+ height: "10",
49
+ viewBox: "0 0 10 10",
50
50
  fill: "none",
51
51
  xmlns: "http://www.w3.org/2000/svg",
52
52
  "aria-labelledby": titleId
53
53
  }, props), title ? /*#__PURE__*/React.createElement("title", {
54
54
  id: titleId
55
55
  }, title) : null, /*#__PURE__*/React.createElement("path", {
56
- d: "M9.281 7.317 7 6l2.281-1.317a.5.5 0 0 0-.5-.866L6.5 5.134V2.5a.5.5 0 1 0-1 0v2.634L3.219 3.817a.5.5 0 0 0-.5.866L5 6 2.719 7.317a.5.5 0 0 0 .5.866L5.5 6.866V9.5a.5.5 0 1 0 1 0V6.866l2.281 1.317a.5.5 0 0 0 .5-.866Z",
56
+ d: "M7.734 6.097 5.834 5l1.9-1.098a.417.417 0 0 0-.417-.721l-1.9 1.097V2.083a.417.417 0 0 0-.834 0v2.195l-1.9-1.097a.417.417 0 0 0-.417.721L4.166 5l-1.9 1.097a.417.417 0 0 0 .416.722l1.901-1.097v2.195a.417.417 0 1 0 .834 0V5.722l1.9 1.097a.417.417 0 0 0 .417-.722Z",
57
57
  fill: "#E00"
58
58
  }));
59
59
 
@@ -85,7 +85,7 @@ function styleInject(css, ref) {
85
85
  }
86
86
 
87
87
  var css_248z$f = ".file-module_file-form__l13d5{align-items:center;background:#fbfbfb;border:2px dashed;border-radius:6px;cursor:pointer;display:flex;flex-direction:column;height:190px;justify-content:space-between;overflow:hidden;padding:4px 0;position:relative;width:100%}.file-module_file-form-wrap__qY--B:before{background:rgba(60,57,62,.4);border-radius:6px;content:\"\";height:100%;left:0;opacity:0;pointer-events:none;position:absolute;top:0;transition:opacity .24s;width:100%;z-index:1}.file-module_file-form-wrap__qY--B.file-module_active__L1gPt:hover:before{opacity:1;pointer-events:unset}.file-module_file-form-wrap__qY--B.file-module_active__L1gPt:hover .file-module_delete-upload-icon__PWN66{opacity:1}.file-module_file-form-inner-upload__tq3Dn{align-items:center;display:flex;flex-direction:column;justify-content:space-between;padding-bottom:16px;padding-top:48px}.file-module_file-form-inner-upload__tq3Dn>img{display:block;margin-bottom:14px}.file-module_upload-info__a8GFs{margin-bottom:40px;max-width:150px;text-align:center}.file-module_upload-info-txt__l11uN{color:#0da574}.file-module_file-form__l13d5.file-module_default__t7KU0{border-color:#d1d1d1}.file-module_file-form__l13d5.file-module_error__H-M4Z{border-color:#e00!important}.file-module_file-form__l13d5.file-module_accept__WTW6V{border-color:#00236a}.file-module_delete-upload-icon__PWN66{align-items:center;background:#fff;border-radius:6px;cursor:pointer;display:flex;height:26px;justify-content:center;opacity:0;position:absolute;right:10px;top:10px;transition:opacity .24s;width:26px;z-index:11}.file-module_delete-upload-icon__PWN66>i{color:#00236a;font-size:16px}.file-module_upload-file-content__QHMjn{align-items:center;display:flex;height:100%;justify-content:center;max-height:190px;overflow:hidden;position:relative;width:100%}.file-module_upload-file-content__QHMjn>img{display:block;height:auto;max-height:95%;object-fit:contain;width:27.8rem}.file-module_file-form-title__zWTSB{margin-bottom:10px;max-width:390px;word-break:break-all}.file-module_file-form-wrap__qY--B{position:relative;transform:translateZ(0)}";
88
- var styles$c = {"file-form-wrap":"file-module_file-form-wrap__qY--B","file-form":"file-module_file-form__l13d5","active":"file-module_active__L1gPt","delete-upload-icon":"file-module_delete-upload-icon__PWN66","file-form-inner-upload":"file-module_file-form-inner-upload__tq3Dn","upload-info":"file-module_upload-info__a8GFs","upload-info-txt":"file-module_upload-info-txt__l11uN","default":"file-module_default__t7KU0","error":"file-module_error__H-M4Z","accept":"file-module_accept__WTW6V","upload-file-content":"file-module_upload-file-content__QHMjn","file-form-title":"file-module_file-form-title__zWTSB"};
88
+ var styles$d = {"file-form-wrap":"file-module_file-form-wrap__qY--B","file-form":"file-module_file-form__l13d5","active":"file-module_active__L1gPt","delete-upload-icon":"file-module_delete-upload-icon__PWN66","file-form-inner-upload":"file-module_file-form-inner-upload__tq3Dn","upload-info":"file-module_upload-info__a8GFs","upload-info-txt":"file-module_upload-info-txt__l11uN","default":"file-module_default__t7KU0","error":"file-module_error__H-M4Z","accept":"file-module_accept__WTW6V","upload-file-content":"file-module_upload-file-content__QHMjn","file-form-title":"file-module_file-form-title__zWTSB"};
89
89
  styleInject(css_248z$f);
90
90
 
91
91
  const File = ({
@@ -146,11 +146,11 @@ const File = ({
146
146
  document.querySelector(`.${name}`).value = '';
147
147
  };
148
148
  return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("p", {
149
- className: `${styles$c['file-form-title']} ile-form-title-rem`
149
+ className: `${styles$d['file-form-title']} ile-form-title-rem`
150
150
  }, label, required && /*#__PURE__*/React__default.createElement("sup", null, /*#__PURE__*/React__default.createElement(SvgRequired, null))), /*#__PURE__*/React__default.createElement("div", {
151
- className: classnames(`${styles$c['file-form-wrap']} file-form-wrap-rem`, image ? styles$c['active'] : '')
151
+ className: classnames(`${styles$d['file-form-wrap']} file-form-wrap-rem`, image ? styles$d['active'] : '')
152
152
  }, /*#__PURE__*/React__default.createElement("div", {
153
- className: `${styles$c['file-form']} file-form-rem ${error || errorMessage ? styles$c['error'] : ''}`,
153
+ className: `${styles$d['file-form']} file-form-rem ${error || errorMessage ? styles$d['error'] : ''}`,
154
154
  onClick: () => document.querySelector(`.${name}`).click()
155
155
  }, /*#__PURE__*/React__default.createElement("input", {
156
156
  hidden: true,
@@ -159,23 +159,23 @@ const File = ({
159
159
  disabled: disabled,
160
160
  onChange: e => handleCheckFile(e)
161
161
  }), image ? /*#__PURE__*/React__default.createElement("div", {
162
- className: `${styles$c['upload-file-content']} upload-file-content-rem`
162
+ className: `${styles$d['upload-file-content']} upload-file-content-rem`
163
163
  }, image === 'pdf' ? /*#__PURE__*/React__default.createElement(SvgPdf, null) : /*#__PURE__*/React__default.createElement("img", {
164
164
  src: image,
165
165
  alt: fileName
166
166
  })) : /*#__PURE__*/React__default.createElement("div", {
167
- className: `${styles$c['file-form-inner-upload']} ile-form-inner-upload-rem`
167
+ className: `${styles$d['file-form-inner-upload']} ile-form-inner-upload-rem`
168
168
  }, /*#__PURE__*/React__default.createElement("img", {
169
169
  src: "../../assets/upload.svg",
170
170
  alt: ""
171
171
  }), /*#__PURE__*/React__default.createElement("span", {
172
- className: `${styles$c['upload-info']} upload-info-rem`
172
+ className: `${styles$d['upload-info']} upload-info-rem`
173
173
  }, /*#__PURE__*/React__default.createElement("span", {
174
- className: `${styles$c['upload-info-txt']} upload-info-txt-rem`
174
+ className: `${styles$d['upload-info-txt']} upload-info-txt-rem`
175
175
  }, "\u0532\u0565\u057C\u0576\u0565\u056C")), /*#__PURE__*/React__default.createElement("span", {
176
- className: `${styles$c['upload-info-size']} upload-info-size-rem`
176
+ className: `${styles$d['upload-info-size']} upload-info-size-rem`
177
177
  }, "\u0531\u057C\u0561\u057E\u0565\u056C\u0561\u0563\u0578\u0582\u0575\u0576\u0568 ", maxSize, "\u0544\u0532 ( ", fileExtensions.toString().split(',').join(', '), " )"))), !disabled && /*#__PURE__*/React__default.createElement("div", {
178
- className: `${styles$c['delete-upload-icon']} delete-upload-icon-rem`,
178
+ className: `${styles$d['delete-upload-icon']} delete-upload-icon-rem`,
179
179
  onClick: handleRemoveFile
180
180
  }, /*#__PURE__*/React__default.createElement("i", {
181
181
  className: "icon-delete"
@@ -269,9 +269,11 @@ const SvgCheckboxChecked = ({
269
269
 
270
270
  const Checkbox$1 = ({
271
271
  data,
272
+ index,
272
273
  styles,
273
274
  checked,
274
275
  disabled,
276
+ innerIndex,
275
277
  checkedColor,
276
278
  handleChecked,
277
279
  unCheckedColor,
@@ -281,7 +283,11 @@ const Checkbox$1 = ({
281
283
  const [innerChecked, setInnerChecked] = useState(false);
282
284
  const [innerDisabled, setInnerDisabled] = useState(false);
283
285
  const handleClick = e => {
284
- handleChecked(data, e);
286
+ if (index !== undefined && innerIndex !== undefined && typeof index === 'number' && typeof innerIndex === 'number') {
287
+ handleChecked(data, e, index, innerIndex);
288
+ } else {
289
+ handleChecked(data, e);
290
+ }
285
291
  };
286
292
  useEffect(() => {
287
293
  setInnerDisabled(disabled);
@@ -308,9 +314,11 @@ const Checkbox$1 = ({
308
314
 
309
315
  const SingleCheckbox = ({
310
316
  data,
317
+ index,
311
318
  styles,
312
319
  checked,
313
320
  disabled,
321
+ innerIndex,
314
322
  checkedColor,
315
323
  handleChecked,
316
324
  unCheckedColor,
@@ -330,10 +338,12 @@ const SingleCheckbox = ({
330
338
  setInnerData(data);
331
339
  }, [data]);
332
340
  return /*#__PURE__*/React__default.createElement(Checkbox$1, {
341
+ index: index,
333
342
  styles: styles,
334
343
  data: innerData,
335
344
  checked: checked,
336
345
  disabled: disabled,
346
+ innerIndex: innerIndex,
337
347
  checkedColor: checkedColor,
338
348
  handleChecked: handleChecked,
339
349
  unCheckedColor: unCheckedColor,
@@ -343,22 +353,889 @@ const SingleCheckbox = ({
343
353
  SingleCheckbox.propTypes = {
344
354
  data: PropTypes.object,
345
355
  onClick: PropTypes.func,
356
+ index: PropTypes.number,
346
357
  styles: PropTypes.object,
347
358
  disabled: PropTypes.bool,
359
+ innerIndex: PropTypes.number,
348
360
  checkedColor: PropTypes.string,
349
361
  unCheckedColor: PropTypes.string,
350
362
  ignoreDisabledForChecked: PropTypes.bool
351
363
  };
352
364
 
353
- var css_248z$e = ".table-module_sorting-arrows__BaN-G:after{content:\"▲\";font-size:11px;position:absolute;right:0;top:calc(50% - 12px)}.table-module_sorting-arrows__BaN-G:before{bottom:calc(50% - 12px);content:\"▼\";font-size:11px;position:absolute;right:0}.table-module_td-span__XHo6k{cursor:pointer;display:inline-block;position:relative}.table-module_td-span__XHo6k>svg{left:0;position:absolute;top:0;z-index:-1}";
365
+ var css_248z$e = ".table-module_sorting-arrows__BaN-G:after{content:\"▲\";font-size:11px;position:absolute;right:0;top:calc(50% - 12px)}.table-module_sorting-arrows__BaN-G:before{bottom:calc(50% - 12px);content:\"▼\";font-size:11px;position:absolute;right:0}.table-module_td-span__XHo6k{display:inline-block;position:relative}.table-module_td-span__XHo6k>svg{left:0;position:absolute;top:0;z-index:-1}.table-module_list-text__kmKIq{cursor:pointer;margin:0 0 8px;overflow:hidden;text-align:left;text-overflow:ellipsis;white-space:nowrap}.table-module_dots-option-item__jNOxO{box-sizing:border-box;cursor:pointer;display:flex;height:39px;margin-bottom:2px;padding:10px;position:relative;width:100%}.table-module_dots-option-item__jNOxO:after{background-color:#eee;border-radius:1px;-webkit-border-radius:1px;-moz-border-radius:1px;-ms-border-radius:1px;-o-border-radius:1px;content:\"\";height:2px;left:10px;position:absolute;top:calc(100% - 2px);width:calc(100% - 20px)}.table-module_dots-option-item__jNOxO:last-child:after{display:none}";
366
+ var styles$c = {"sorting-arrows":"table-module_sorting-arrows__BaN-G","td-span":"table-module_td-span__XHo6k","list-text":"table-module_list-text__kmKIq","dots-option-item":"table-module_dots-option-item__jNOxO"};
354
367
  styleInject(css_248z$e);
355
368
 
356
- ({
369
+ /* eslint-disable no-prototype-builtins */
370
+ const TH = ({
371
+ item,
372
+ tHeadFamily,
373
+ tHeadPadding,
374
+ tHeadFontSize,
375
+ tHeadFontWeight,
376
+ handleCheckedHeader,
377
+ borderTopLeftRadius,
378
+ borderTopRightRadius,
379
+ handleHeaderItemClick,
380
+ handleCheckArrowActionHeader
381
+ }) => {
382
+ return /*#__PURE__*/React__default.createElement("th", {
383
+ style: {
384
+ width: 'auto',
385
+ cursor: 'pointer',
386
+ whiteSpace: 'nowrap',
387
+ position: 'relative',
388
+ padding: tHeadPadding,
389
+ fontSize: tHeadFontSize,
390
+ fontFamily: tHeadFamily,
391
+ fontWeight: tHeadFontWeight,
392
+ borderTopLeftRadius: borderTopLeftRadius,
393
+ borderTopRightRadius: borderTopRightRadius
394
+ },
395
+ onClick: handleHeaderItemClick,
396
+ className: `${item.sortingArrows && styles$c['sorting-arrows']}`
397
+ }, /*#__PURE__*/React__default.createElement("div", {
398
+ style: {
399
+ display: 'flex',
400
+ alignItems: 'flex-start',
401
+ justifyContent: Object.prototype.hasOwnProperty.call(item, 'checkBox') ? 'space-between' : 'center'
402
+ }
403
+ }, item.hasOwnProperty('checkBox') ? /*#__PURE__*/React__default.createElement(SingleCheckbox, {
404
+ data: item,
405
+ float: "left",
406
+ checked: item.checkBox.checked,
407
+ disabled: item.checkBox.disabled,
408
+ handleChecked: !item.checkBox.disabled ? handleCheckedHeader : _ => _,
409
+ checkedColor: item.checkBox.checkedColor ? item.checkBox.checkedColor : '',
410
+ unCheckedColor: item.checkBox.unCheckedColor ? item.checkBox.unCheckedColor : ''
411
+ }) : '', /*#__PURE__*/React__default.createElement("p", {
412
+ style: {
413
+ margin: '0px'
414
+ },
415
+ onClick: Object.prototype.hasOwnProperty.call(item, 'arrowComponent') ? e => handleCheckArrowActionHeader(e, item) : _ => _
416
+ }, item.type === 'show' ? item.content : Object.prototype.hasOwnProperty.call(item, 'arrowComponent') ? item.status === 'close' ? item.closeArrow : item.openArrow : '')));
417
+ };
418
+
419
+ const TD = ({
420
+ item,
421
+ index,
422
+ innerIndex,
423
+ tBodyColor,
424
+ borderRight,
425
+ tBodyPadding,
426
+ tBodyFontSize,
427
+ openListColor,
428
+ tBodyTextAlign,
429
+ tBodyFontFamily,
430
+ tBodyFontWeight,
431
+ handleCheckDots,
432
+ handleCheckedBody,
433
+ handleBodyActionClick,
434
+ handleMoreOptionsClick,
435
+ handleContentListClick,
436
+ handleCheckArrowAction,
437
+ handleOpenCloseRowSingleArrow
438
+ }) => {
439
+ const handleBodyAction = (e, data) => {
440
+ const actionData = {
441
+ index,
442
+ innerIndex,
443
+ items: item,
444
+ item: data.item,
445
+ itemIndex: data.itemIndex
446
+ };
447
+ handleBodyActionClick(e, actionData);
448
+ };
449
+ return /*#__PURE__*/React__default.createElement("td", {
450
+ style: {
451
+ width: 'auto',
452
+ color: tBodyColor,
453
+ verticalAlign: 'top',
454
+ whiteSpace: 'nowrap',
455
+ padding: tBodyPadding,
456
+ fontSize: tBodyFontSize,
457
+ borderRight: borderRight,
458
+ textAlign: tBodyTextAlign,
459
+ fontFamily: tBodyFontFamily,
460
+ fontWeight: tBodyFontWeight,
461
+ boxShadow: Object.prototype.hasOwnProperty.call(item, 'colorStatus') ? `inset 3px 0px 0px 0px ${item.colorStatus}` : ''
462
+ }
463
+ }, Array.isArray(item) ? item.length > 0 ? item.map((newItem, newIndex) => {
464
+ if (newItem && !Array.isArray(newItem) && typeof newItem === 'object') {
465
+ return /*#__PURE__*/React__default.createElement("span", {
466
+ style: {
467
+ width: '32px',
468
+ height: '32px',
469
+ marginRight: '10px',
470
+ cursor: Object.prototype.hasOwnProperty.call(newItem, 'type') ? 'pointer' : 'auto'
471
+ },
472
+ id: newItem.id,
473
+ type: newItem.type,
474
+ className: styles$c['td-span'],
475
+ key: `${newItem.id}_${newIndex}`,
476
+ onClick: Object.prototype.hasOwnProperty.call(newItem, 'type') ? e => handleBodyAction(e, {
477
+ item: newItem,
478
+ itemIndex: newIndex
479
+ }) : _ => _
480
+ }, newItem.content);
481
+ } else if (newItem && Array.isArray(newItem)) {
482
+ return /*#__PURE__*/React__default.createElement("span", {
483
+ key: `${newItem.id}_${newIndex}`,
484
+ style: {
485
+ display: 'inline-block',
486
+ marginRight: newIndex !== item.length - 1 ? '10px' : '0px',
487
+ borderRight: newIndex !== item.length - 1 ? '1px solid rgb(238, 238, 238)' : 'none'
488
+ }
489
+ }, item[newIndex].map((iT, iN) => {
490
+ return /*#__PURE__*/React__default.createElement("span", {
491
+ style: {
492
+ width: '32px',
493
+ height: '32px',
494
+ marginRight: '10px',
495
+ cursor: Object.prototype.hasOwnProperty.call(iT, 'type') ? 'pointer' : 'auto'
496
+ },
497
+ id: iT.id ? iT.id : '',
498
+ type: iT.type ? iT.type : '',
499
+ className: styles$c['td-span'],
500
+ onClick: Object.prototype.hasOwnProperty.call(iT, 'type') ? e => handleBodyAction(e, {
501
+ item: iT,
502
+ itemIndex: iN
503
+ }) : _ => _,
504
+ key: `${iT.id || iT.content}_${iN}`
505
+ }, iT.content);
506
+ }));
507
+ } else {
508
+ return /*#__PURE__*/React__default.createElement("span", {
509
+ key: `${newItem.id}_${newIndex}`
510
+ }, newItem);
511
+ }
512
+ }) : /*#__PURE__*/React__default.createElement(React__default.Fragment, null) : item !== null && !Array.isArray(item) && typeof item === 'object' ? /*#__PURE__*/React__default.createElement("div", {
513
+ style: {
514
+ display: 'flex',
515
+ alignItems: 'flex-start',
516
+ justifyContent: Object.prototype.hasOwnProperty.call(item, 'contentList') || Object.prototype.hasOwnProperty.call(item, 'checkBox') ? 'space-between' : 'center'
517
+ }
518
+ }, Object.prototype.hasOwnProperty.call(item, 'contentList') && /*#__PURE__*/React__default.createElement("div", {
519
+ id: item.id,
520
+ style: {
521
+ width: '21px',
522
+ height: '21px',
523
+ cursor: 'pointer'
524
+ },
525
+ onClick: () => handleOpenCloseRowSingleArrow(index, innerIndex),
526
+ className: styles$c['td-span']
527
+ }, item.status === 'close' ? item.closeArrow : item.openArrow), Object.prototype.hasOwnProperty.call(item, 'checkBox') && /*#__PURE__*/React__default.createElement(SingleCheckbox, {
528
+ data: item,
529
+ index: index,
530
+ innerIndex: innerIndex,
531
+ checked: item.checkBox.checked,
532
+ handleChecked: handleCheckedBody,
533
+ disabled: item.checkBox.disabled,
534
+ checkedColor: item.checkBox.checkedColor,
535
+ unCheckedColor: item.checkBox.unCheckedColor
536
+ }), /*#__PURE__*/React__default.createElement("div", {
537
+ style: {
538
+ marginLeft: item.contentList ? '10px' : '0px'
539
+ }
540
+ }, /*#__PURE__*/React__default.createElement("p", {
541
+ style: {
542
+ margin: '0px',
543
+ cursor: Object.prototype.hasOwnProperty.call(item, 'arrowComponent') || Object.prototype.hasOwnProperty.call(item, 'dots') ? 'pointer' : 'auto'
544
+ },
545
+ onClick: Object.prototype.hasOwnProperty.call(item, 'arrowComponent') ? () => handleCheckArrowAction(item, item.checkIndex) : Object.prototype.hasOwnProperty.call(item, 'dots') ? e => handleCheckDots(e, item, index, innerIndex) : _ => _
546
+ }, item.content ? item.content : Object.prototype.hasOwnProperty.call(item, 'arrowComponent') ? item.status === 'close' ? item.closeArrow : item.openArrow : Object.prototype.hasOwnProperty.call(item, 'dots') ? /*#__PURE__*/React__default.createElement("span", {
547
+ style: {
548
+ display: 'block',
549
+ position: 'relative'
550
+ }
551
+ }, item.dotsStatus === 'deActive' ? item.deActiveIcon : item.activeIcon, /*#__PURE__*/React__default.createElement("span", {
552
+ style: {
553
+ position: 'absolute',
554
+ display: item.dotsStatus === 'deActive' ? 'none' : 'block',
555
+ top: '0px',
556
+ zIndex: 100,
557
+ right: 'calc(100% + 6px)',
558
+ width: '223px',
559
+ height: 'auto',
560
+ overflow: 'auto',
561
+ minHeight: '40px',
562
+ maxHeight: '246px',
563
+ borderRadius: '6px',
564
+ backgroundColor: '#FFFFFF',
565
+ boxShadow: '0px 0px 20px 0px #3C393E4D'
566
+ }
567
+ }, Object.prototype.hasOwnProperty.call(item, 'options') && item.options.map((optionItem, optionIndex) => {
568
+ return /*#__PURE__*/React__default.createElement("span", {
569
+ key: `${optionItem.content}_${optionIndex}`,
570
+ className: styles$c['dots-option-item'],
571
+ style: {
572
+ color: '#3C393E',
573
+ fontSize: '14px',
574
+ fontFamily: 'Noto Sans Armenian'
575
+ },
576
+ onClick: () => handleMoreOptionsClick({
577
+ item,
578
+ index,
579
+ optionItem,
580
+ innerIndex,
581
+ optionIndex,
582
+ options: item.options
583
+ })
584
+ }, /*#__PURE__*/React__default.createElement("span", {
585
+ style: {
586
+ marginRight: '10px'
587
+ }
588
+ }, optionItem.icon), /*#__PURE__*/React__default.createElement("span", {
589
+ style: {
590
+ width: 'calc(100% - 36px)',
591
+ textAlign: 'left',
592
+ overflow: 'hidden',
593
+ whiteSpace: 'nowrap',
594
+ textOverflow: 'ellipsis'
595
+ },
596
+ title: optionItem.content
597
+ }, optionItem.content));
598
+ }))) : ''), Object.prototype.hasOwnProperty.call(item, 'contentList') && /*#__PURE__*/React__default.createElement("div", {
599
+ style: {
600
+ overflow: 'auto',
601
+ marginTop: '10px',
602
+ maxHeight: '300px',
603
+ maxWidth: '100%',
604
+ height: item.status === 'close' ? '0px' : 'auto'
605
+ }
606
+ }, item.contentList.map((innerItem, innerItemIndex) => {
607
+ return /*#__PURE__*/React__default.createElement("p", {
608
+ key: `${innerItem}_${innerItemIndex}`,
609
+ className: styles$c['list-text'],
610
+ style: {
611
+ color: openListColor
612
+ },
613
+ onClick: e => handleContentListClick(e, {
614
+ item,
615
+ index,
616
+ innerIndex,
617
+ listContentId: innerItem.id,
618
+ listContent: innerItem.content,
619
+ listContentIndex: innerItemIndex
620
+ })
621
+ }, innerItem.content.length >= item.content.length ? innerItem.content.substr(0, item.content.length - 4) + '...' : innerItem.content);
622
+ })))) : '');
623
+ };
624
+
625
+ const SvgUpArrow = ({
626
+ title,
627
+ titleId,
628
+ ...props
629
+ }) => /*#__PURE__*/React.createElement("svg", _extends({
630
+ width: "21",
631
+ height: "21",
632
+ viewBox: "0 0 21 21",
633
+ fill: "none",
634
+ xmlns: "http://www.w3.org/2000/svg",
635
+ "aria-labelledby": titleId
636
+ }, props), title ? /*#__PURE__*/React.createElement("title", {
637
+ id: titleId
638
+ }, title) : null, /*#__PURE__*/React.createElement("rect", {
639
+ x: 0.5,
640
+ y: 0.5,
641
+ width: 20,
642
+ height: 20,
643
+ rx: 0.5,
644
+ fill: "#fff",
645
+ stroke: "#EEE"
646
+ }), /*#__PURE__*/React.createElement("path", {
647
+ d: "M10.509 8.002c.183 0 .36.07.502.197l4.706 4.284a.912.912 0 0 1 .102 1.208.767.767 0 0 1-.532.305.742.742 0 0 1-.574-.194l-4.204-3.838-4.204 3.7a.765.765 0 0 1-.272.157.721.721 0 0 1-.599-.07.805.805 0 0 1-.235-.215.879.879 0 0 1-.16-.303.932.932 0 0 1 .06-.683.84.84 0 0 1 .21-.264l4.705-4.138a.735.735 0 0 1 .495-.146Z",
648
+ fill: "#3C393E"
649
+ }));
650
+
651
+ const SvgDownArrow = ({
652
+ title,
653
+ titleId,
654
+ ...props
655
+ }) => /*#__PURE__*/React.createElement("svg", _extends({
656
+ width: "21",
657
+ height: "21",
658
+ viewBox: "0 0 21 21",
659
+ fill: "none",
660
+ xmlns: "http://www.w3.org/2000/svg",
661
+ "aria-labelledby": titleId
662
+ }, props), title ? /*#__PURE__*/React.createElement("title", {
663
+ id: titleId
664
+ }, title) : null, /*#__PURE__*/React.createElement("rect", {
665
+ x: 0.5,
666
+ y: 0.5,
667
+ width: 20,
668
+ height: 20,
669
+ rx: 0.5,
670
+ fill: "#fff",
671
+ stroke: "#EEE"
672
+ }), /*#__PURE__*/React.createElement("path", {
673
+ d: "M10.491 13.998a.745.745 0 0 1-.502-.197L5.283 9.517a.912.912 0 0 1-.102-1.208.767.767 0 0 1 .532-.305c.208-.021.414.049.574.194l4.204 3.838 4.204-3.7a.765.765 0 0 1 .272-.157.721.721 0 0 1 .599.07c.09.054.17.127.235.215a.88.88 0 0 1 .16.303.933.933 0 0 1-.06.683.841.841 0 0 1-.21.264l-4.706 4.138a.735.735 0 0 1-.494.146Z",
674
+ fill: "#3C393E"
675
+ }));
676
+
677
+ const Table = ({
678
+ getData,
679
+ dataBody,
680
+ arrowShow,
681
+ dataHeader,
682
+ arrowColumn,
683
+ tHeadColor,
684
+ tHeadFamily,
685
+ tHeadPadding,
686
+ tHeadFontSize,
687
+ tHeadFontWeight,
688
+ tHeadBorderRadius,
689
+ tHeadBackgroundColor,
690
+ tBodyColor,
691
+ tBodyPadding,
692
+ tBodyFontSize,
693
+ tBodyTextAlign,
694
+ tBodyFontWeight,
695
+ tBodyFontFamily,
696
+ tBodyRowBorder,
697
+ openListColor
698
+ }) => {
699
+ const [body, setBody] = useState([]);
700
+ const [header, setHeader] = useState([]);
701
+ const [disableArr, setDisableArr] = useState([]);
702
+ const [checkedArray, setCheckedArray] = useState([]);
703
+ const configStyles = compereConfigs();
704
+ const handleCheckIfArrow = (bodyData, data) => {
705
+ let removeItemIndex;
706
+ let headerWithoutArrow = [];
707
+ bodyData.map((item, index) => {
708
+ if (index === data.index) {
709
+ item.map((innerItem, innerIndex) => {
710
+ if (Object.prototype.hasOwnProperty.call(innerItem, 'arrowComponent')) {
711
+ removeItemIndex = innerIndex;
712
+ }
713
+ });
714
+ if (removeItemIndex !== undefined) {
715
+ const firstPart = item.slice(0, removeItemIndex);
716
+ const secondPart = item.slice(removeItemIndex + 1, item.length);
717
+ headerWithoutArrow = [...firstPart, ...secondPart];
718
+ } else {
719
+ headerWithoutArrow.push(item);
720
+ }
721
+ }
722
+ });
723
+ return {
724
+ removeItemIndex,
725
+ headerWithoutArrow
726
+ };
727
+ };
728
+ const handleHeaderItemClick = e => {
729
+ e.stopPropagation();
730
+ if (!e.target.tagName.startsWith('svg') && e.target.innerText !== undefined && e.target.innerText !== '') {
731
+ let removeItemIndex;
732
+ let headerWithoutArrow;
733
+ header.map((item, index) => {
734
+ if (Object.prototype.hasOwnProperty.call(item, 'arrowComponent')) {
735
+ removeItemIndex = index;
736
+ }
737
+ });
738
+ if (removeItemIndex !== undefined) {
739
+ const firstPart = header.slice(0, removeItemIndex);
740
+ const secondPart = header.slice(removeItemIndex + 1, header.length);
741
+ headerWithoutArrow = [...firstPart, ...secondPart];
742
+ }
743
+ const returnedData = {
744
+ from: 'header',
745
+ content: e.target.innerText,
746
+ row: headerWithoutArrow !== undefined ? headerWithoutArrow : header
747
+ };
748
+ getData(returnedData);
749
+ }
750
+ };
751
+ const handleBodyActionClick = (e, data) => {
752
+ e.stopPropagation();
753
+ const {
754
+ removeItemIndex,
755
+ headerWithoutArrow
756
+ } = handleCheckIfArrow(body, data);
757
+ const actionData = {
758
+ from: 'body',
759
+ item: data.item,
760
+ id: data.item.id,
761
+ items: data.items,
762
+ type: data.item.type,
763
+ rowIndex: data.index,
764
+ row: headerWithoutArrow,
765
+ itemInnerIndex: data.itemIndex,
766
+ itemIndex: removeItemIndex !== undefined && removeItemIndex < data.innerIndex ? data.innerIndex - 1 : data.innerIndex
767
+ };
768
+ getData(actionData);
769
+ };
770
+ const handleSetCheckboxArray = data => {
771
+ let checkedItems = [];
772
+ data.map((item, index) => {
773
+ item.map((innerItem, innerIndex) => {
774
+ if (Object.prototype.hasOwnProperty.call(innerItem, 'checkBox')) {
775
+ if (!checkedItems[innerIndex]) {
776
+ checkedItems[innerIndex] = [];
777
+ }
778
+ checkedItems[innerIndex].push({
779
+ rowCount: index,
780
+ columnCount: innerIndex,
781
+ checked: innerItem.checkBox.checked
782
+ });
783
+ }
784
+ });
785
+ });
786
+ return checkedItems;
787
+ };
788
+ const handleSetInsertIndex = (data, count) => {
789
+ let arrowColumnCount;
790
+ if (typeof count !== 'number') {
791
+ alert('arrowColumn props must be a number, please check it');
792
+ } else {
793
+ if (count <= 0) {
794
+ arrowColumnCount = 0;
795
+ } else {
796
+ if (count >= data.length - 1) {
797
+ arrowColumnCount = data.length;
798
+ } else {
799
+ arrowColumnCount = count;
800
+ }
801
+ }
802
+ }
803
+ return arrowColumnCount;
804
+ };
805
+ const handleInsertArrow = (data, count, arrowObject) => {
806
+ if (count === 0) {
807
+ data.unshift(arrowObject);
808
+ } else if (count >= data.length - 1) {
809
+ data.push(arrowObject);
810
+ } else {
811
+ data.splice(count, 0, arrowObject);
812
+ }
813
+ return data;
814
+ };
815
+ const handleTransformDataForInsertArrow = (data, count, type) => {
816
+ const arrowObject = {
817
+ status: 'close',
818
+ checkIndex: null,
819
+ arrowComponent: true,
820
+ openArrow: /*#__PURE__*/React__default.createElement(SvgUpArrow, null),
821
+ closeArrow: /*#__PURE__*/React__default.createElement(SvgDownArrow, null)
822
+ };
823
+ if (type === 'body') {
824
+ return data.map((item, index) => {
825
+ const newObjWithArrow = {
826
+ ...arrowObject
827
+ };
828
+ newObjWithArrow.checkIndex = index;
829
+ return handleInsertArrow(item, count, newObjWithArrow);
830
+ });
831
+ } else {
832
+ const newObjWithArrow = {
833
+ ...arrowObject
834
+ };
835
+ newObjWithArrow.checkIndex = count;
836
+ return handleInsertArrow(data, count, newObjWithArrow);
837
+ }
838
+ };
839
+ const handleCheckedHeader = (data, e) => {
840
+ e.stopPropagation();
841
+ let removeItemIndex;
842
+ let checkableItemBool;
843
+ let checkableItemIndex;
844
+ let headerWithoutArrow;
845
+ let checkableBodyRowItems = [];
846
+ const updatedHeader = header.slice();
847
+ const updatedBody = body.slice().map(item => Object.values(item));
848
+ const newData = updatedHeader.map((item, index) => {
849
+ if (item.content == data.content) {
850
+ checkableItemIndex = index;
851
+ checkableItemBool = !item.checkBox.checked;
852
+ item.checkBox.checked = !item.checkBox.checked;
853
+ }
854
+ if (Object.prototype.hasOwnProperty.call(item, 'arrowComponent')) {
855
+ removeItemIndex = index;
856
+ }
857
+ return item;
858
+ });
859
+ const newUpdatedBody = updatedBody.map((item, index) => {
860
+ return item.map((innerItem, innerIndex) => {
861
+ if (checkableItemIndex === innerIndex) {
862
+ innerItem.checkBox.checked = checkableItemBool;
863
+ checkableBodyRowItems.push({
864
+ column: innerIndex,
865
+ columnItem: innerItem
866
+ });
867
+ handleHeaderCheckedUpdate({
868
+ row: index,
869
+ column: innerIndex,
870
+ checked: {
871
+ checked: checkableItemBool
872
+ }
873
+ });
874
+ }
875
+ return innerItem;
876
+ });
877
+ });
878
+ if (removeItemIndex !== undefined) {
879
+ const firstPart = newData.slice(0, removeItemIndex);
880
+ const secondPart = newData.slice(removeItemIndex + 1, newData.length);
881
+ headerWithoutArrow = [...firstPart, ...secondPart];
882
+ }
883
+ const returnedData = {
884
+ from: 'header',
885
+ content: data.content,
886
+ checkBox: data.checkBox,
887
+ columnArray: checkableBodyRowItems,
888
+ row: headerWithoutArrow !== undefined ? headerWithoutArrow : newData
889
+ };
890
+ getData(returnedData);
891
+ setHeader(newData);
892
+ setBody(newUpdatedBody);
893
+ };
894
+ const handleCheckedBody = (data, e, dataRowIndex, dataItemIndex) => {
895
+ e.stopPropagation();
896
+ const transformedData = {
897
+ ...data
898
+ };
899
+ transformedData.index = dataRowIndex;
900
+ transformedData.innerIndex = dataItemIndex;
901
+ const updatedBody = body.slice().map(item => Object.values(item));
902
+ const newData = updatedBody.map((item, index) => {
903
+ return item.map((innerItem, innerIndex) => {
904
+ if (innerItem.id === data.id && innerItem.content == data.content && Object.prototype.hasOwnProperty.call(innerItem, 'checkBox')) {
905
+ innerItem.checkBox.checked = !innerItem.checkBox.checked;
906
+ handleHeaderCheckedUpdate({
907
+ row: index,
908
+ column: innerIndex,
909
+ checked: innerItem.checkBox
910
+ });
911
+ }
912
+ return innerItem;
913
+ });
914
+ });
915
+ const {
916
+ removeItemIndex,
917
+ headerWithoutArrow
918
+ } = handleCheckIfArrow(body, transformedData);
919
+ const checkedData = {
920
+ item: data,
921
+ from: 'body',
922
+ row: removeItemIndex !== undefined ? headerWithoutArrow : headerWithoutArrow[0],
923
+ rowIndex: transformedData.index,
924
+ itemIndex: removeItemIndex !== undefined && removeItemIndex < transformedData.innerIndex ? transformedData.innerIndex - 1 : transformedData.innerIndex
925
+ };
926
+ getData(checkedData);
927
+ setBody(newData);
928
+ };
929
+ const handleHeaderCheckedUpdate = checkedData => {
930
+ const updatedHeader = header.slice();
931
+ const newCheckedArray = checkedArray.map((item, index) => {
932
+ return item.map((innerItem, innerIndex) => {
933
+ if (index === checkedData.column) {
934
+ if (innerIndex === checkedData.row) {
935
+ innerItem.checked = checkedData.checked.checked;
936
+ }
937
+ }
938
+ return innerItem;
939
+ });
940
+ });
941
+ const newData = updatedHeader.map((item, index) => {
942
+ if (newCheckedArray[index]) {
943
+ const tempCheckedArray = [];
944
+ newCheckedArray[index].map(innerItem => {
945
+ tempCheckedArray.push(innerItem.checked);
946
+ });
947
+ if (tempCheckedArray.every(i => i)) {
948
+ item.checkBox.checked = true;
949
+ } else {
950
+ item.checkBox.checked = false;
951
+ }
952
+ }
953
+ return item;
954
+ });
955
+ setHeader(newData);
956
+ setCheckedArray(newCheckedArray);
957
+ };
958
+ const handleCheckArrowAction = (item, rowPosition) => {
959
+ const status = item.status;
960
+ const checkedOpenableRow = body[rowPosition].map(innerItem => {
961
+ if (Object.prototype.hasOwnProperty.call(innerItem, 'status')) {
962
+ if (status === 'close') {
963
+ innerItem.status = 'open';
964
+ } else {
965
+ innerItem.status = 'close';
966
+ }
967
+ }
968
+ return innerItem;
969
+ });
970
+ setBody(prev => {
971
+ prev[rowPosition] = checkedOpenableRow;
972
+ return [...prev];
973
+ });
974
+ };
975
+ const handleOpenCloseRowSingleArrow = (arrowRowIndex, arrowIndex) => {
976
+ let single = {};
977
+ const allArrows = [];
978
+ const checkedOpenableRow = body[arrowRowIndex].map((item, index) => {
979
+ if (index === arrowIndex) {
980
+ if (item.status === 'close') {
981
+ item.status = 'open';
982
+ } else {
983
+ item.status = 'close';
984
+ }
985
+ single = item;
986
+ }
987
+ if (Object.prototype.hasOwnProperty.call(item, 'status') && !Object.prototype.hasOwnProperty.call(item, 'arrowComponent')) {
988
+ allArrows.push(item);
989
+ }
990
+ return item;
991
+ });
992
+ const checkedOpenableRowArrow = checkedOpenableRow.map(item => {
993
+ if (Object.prototype.hasOwnProperty.call(item, 'arrowComponent')) {
994
+ if (single && single.status === 'close') {
995
+ item.status = 'close';
996
+ } else if (single && single.status === 'open') {
997
+ if (allArrows.every(i => i.status === 'open')) {
998
+ item.status = 'open';
999
+ }
1000
+ }
1001
+ }
1002
+ return item;
1003
+ });
1004
+ setBody(prev => {
1005
+ prev[arrowRowIndex] = checkedOpenableRowArrow;
1006
+ return [...prev];
1007
+ });
1008
+ };
1009
+ const handleCheckArrowActionHeader = (e, item) => {
1010
+ e.stopPropagation();
1011
+ const checkedOpenableAllRows = header.map((innerItem, innerIndex) => {
1012
+ if (item.checkIndex === innerIndex) {
1013
+ if (item.status === 'close') {
1014
+ innerItem.status = 'open';
1015
+ } else {
1016
+ innerItem.status = 'close';
1017
+ }
1018
+ }
1019
+ return innerItem;
1020
+ });
1021
+ const checkedOpenableAllRowsBody = body.map(innerItem => {
1022
+ return innerItem.map(iElem => {
1023
+ if (Object.prototype.hasOwnProperty.call(iElem, 'status')) {
1024
+ if (item.status === 'open') {
1025
+ iElem.status = 'open';
1026
+ } else {
1027
+ iElem.status = 'close';
1028
+ }
1029
+ }
1030
+ return iElem;
1031
+ });
1032
+ });
1033
+ setHeader(() => checkedOpenableAllRows);
1034
+ setBody(() => checkedOpenableAllRowsBody);
1035
+ };
1036
+ const handleCheckDots = (e, item, index, innerIndex) => {
1037
+ e.stopPropagation();
1038
+ const checkBodyMore = body.map((elemItem, elemIndex) => {
1039
+ return elemItem.map((elemInnerItem, elemInnerIndex) => {
1040
+ if (elemIndex === index && Object.prototype.hasOwnProperty.call(elemInnerItem, 'dots')) {
1041
+ if (elemInnerIndex === innerIndex) {
1042
+ if (item.dotsStatus === 'deActive') {
1043
+ elemInnerItem.dotsStatus = 'active';
1044
+ } else {
1045
+ elemInnerItem.dotsStatus = 'deActive';
1046
+ }
1047
+ }
1048
+ } else if (elemIndex !== index && Object.prototype.hasOwnProperty.call(elemInnerItem, 'dots')) {
1049
+ if (elemInnerIndex === innerIndex) {
1050
+ elemInnerItem.dotsStatus = 'deActive';
1051
+ }
1052
+ }
1053
+ return elemInnerItem;
1054
+ });
1055
+ });
1056
+ setBody(() => checkBodyMore);
1057
+ };
1058
+ const handleCheckDisable = (arr, disableArr) => {
1059
+ let headerWithDisabled = [];
1060
+ if (disableArr && disableArr.length > 0) {
1061
+ headerWithDisabled = arr.map((item, index) => {
1062
+ if (disableArr[index]) {
1063
+ if (Object.prototype.hasOwnProperty.call(item, 'checkBox')) {
1064
+ item.checkBox.disabled = true;
1065
+ }
1066
+ }
1067
+ return item;
1068
+ });
1069
+ }
1070
+ return headerWithDisabled;
1071
+ };
1072
+ const handleContentListClick = (e, data) => {
1073
+ e.stopPropagation();
1074
+ const {
1075
+ removeItemIndex,
1076
+ headerWithoutArrow
1077
+ } = handleCheckIfArrow(body, data);
1078
+ const listData = {
1079
+ from: 'body',
1080
+ item: data.item,
1081
+ rowIndex: data.index,
1082
+ row: headerWithoutArrow,
1083
+ listItemId: data.listContentId,
1084
+ listItemContent: data.listContent,
1085
+ itemIndex: removeItemIndex !== undefined && removeItemIndex < data.innerIndex ? data.innerIndex - 1 : data.innerIndex,
1086
+ listItemInnerIndex: data.listContentIndex
1087
+ };
1088
+ getData(listData);
1089
+ };
1090
+ const handleMoreOptionsClick = data => {
1091
+ const {
1092
+ removeItemIndex,
1093
+ headerWithoutArrow
1094
+ } = handleCheckIfArrow(body, data);
1095
+ const moreData = {
1096
+ from: 'body',
1097
+ item: data.item,
1098
+ rowIndex: data.index,
1099
+ options: data.options,
1100
+ row: headerWithoutArrow,
1101
+ itemIndex: removeItemIndex !== undefined && removeItemIndex < data.innerIndex ? data.innerIndex - 1 : data.innerIndex,
1102
+ optionItem: data.optionItem,
1103
+ optionIndex: data.optionIndex
1104
+ };
1105
+ getData(moreData);
1106
+ };
1107
+ useEffect(() => {
1108
+ let checkedItems = [];
1109
+ const disabledArray = [];
1110
+ const checkBodyForChackedItems = dataBody.slice().map(item => Object.values(item));
1111
+ if (arrowShow) {
1112
+ const arrowColumnCount = handleSetInsertIndex(checkBodyForChackedItems[0], arrowColumn);
1113
+ const checkForInsertArrow = handleTransformDataForInsertArrow(checkBodyForChackedItems, arrowColumnCount, 'body');
1114
+ const insert = checkForInsertArrow.map((item, index) => {
1115
+ item.map((innerItem, innerIndex) => {
1116
+ if (Object.prototype.hasOwnProperty.call(innerItem, 'checkBox')) {
1117
+ if (Object.prototype.hasOwnProperty.call(innerItem.checkBox, 'disabled')) {
1118
+ if (innerItem.checkBox.disabled === true) {
1119
+ if (!disabledArray[innerIndex]) {
1120
+ disabledArray[innerIndex] = {
1121
+ rowIndex: index,
1122
+ columnIndex: innerIndex
1123
+ };
1124
+ }
1125
+ }
1126
+ }
1127
+ }
1128
+ });
1129
+ return item;
1130
+ });
1131
+ checkedItems = handleSetCheckboxArray(insert);
1132
+ setBody(() => insert);
1133
+ } else {
1134
+ const insert = checkBodyForChackedItems.map((item, index) => {
1135
+ item.map((innerItem, innerIndex) => {
1136
+ if (Object.prototype.hasOwnProperty.call(innerItem, 'checkBox')) {
1137
+ if (Object.prototype.hasOwnProperty.call(innerItem.checkBox, 'disabled')) {
1138
+ if (innerItem.checkBox.disabled === true) {
1139
+ if (!disabledArray[innerIndex]) {
1140
+ disabledArray[innerIndex] = {
1141
+ rowIndex: index,
1142
+ columnIndex: innerIndex
1143
+ };
1144
+ }
1145
+ }
1146
+ }
1147
+ }
1148
+ });
1149
+ return item;
1150
+ });
1151
+ checkedItems = handleSetCheckboxArray(insert);
1152
+ setBody(() => insert);
1153
+ }
1154
+ setDisableArr(disabledArray);
1155
+ setCheckedArray(() => checkedItems);
1156
+ }, [dataBody, arrowColumn, arrowShow]);
1157
+ useEffect(() => {
1158
+ if (arrowShow) {
1159
+ const header = dataHeader.slice();
1160
+ const arrowColumnCount = handleSetInsertIndex(header, arrowColumn);
1161
+ const checkForInsertArrow = handleTransformDataForInsertArrow(header, arrowColumnCount, 'header');
1162
+ const headerWithDisabled = handleCheckDisable(checkForInsertArrow, disableArr);
1163
+ setHeader(() => headerWithDisabled.length > 0 ? headerWithDisabled : checkForInsertArrow);
1164
+ } else {
1165
+ const headerWithDisabled = handleCheckDisable(dataHeader, disableArr);
1166
+ setHeader(() => headerWithDisabled.length > 0 ? headerWithDisabled : dataHeader);
1167
+ }
1168
+ }, [dataHeader, arrowColumn, arrowShow, disableArr]);
1169
+ return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("table", {
1170
+ style: {
1171
+ width: '100%',
1172
+ borderCollapse: 'collapse'
1173
+ }
1174
+ }, header && header.length > 0 && /*#__PURE__*/React__default.createElement("thead", null, /*#__PURE__*/React__default.createElement("tr", {
1175
+ style: {
1176
+ color: tHeadColor ? tHeadColor : configStyles.TABLE.tHeadColor,
1177
+ backgroundColor: tHeadBackgroundColor ? tHeadBackgroundColor : configStyles.TABLE.tHeadBackgroundColor
1178
+ }
1179
+ }, header.map((item, index) => {
1180
+ return /*#__PURE__*/React__default.createElement(TH, {
1181
+ item: item,
1182
+ key: `${item}_${index}`,
1183
+ handleCheckedHeader: handleCheckedHeader,
1184
+ handleHeaderItemClick: handleHeaderItemClick,
1185
+ handleCheckArrowActionHeader: handleCheckArrowActionHeader,
1186
+ tHeadFamily: tHeadFamily ? tHeadFamily : configStyles.TABLE.tHeadFamily,
1187
+ tHeadPadding: tHeadPadding ? tHeadPadding : configStyles.TABLE.tHeadPadding,
1188
+ tHeadFontSize: tHeadFontSize ? tHeadFontSize : configStyles.TABLE.tHeadFontSize,
1189
+ tHeadFontWeight: tHeadFontWeight ? tHeadFontWeight : configStyles.TABLE.tHeadFontWeight,
1190
+ borderTopLeftRadius: index === 0 ? tHeadBorderRadius ? tHeadBorderRadius : configStyles.TABLE.tHeadBorderRadius : '0px',
1191
+ borderTopRightRadius: index === header.length - 1 ? tHeadBorderRadius ? tHeadBorderRadius : configStyles.TABLE.tHeadBorderRadius : '0px'
1192
+ });
1193
+ }))), body && body.length > 0 && /*#__PURE__*/React__default.createElement("tbody", {
1194
+ style: {
1195
+ boxShadow: '0px 10px 30px rgba(0, 35, 106, 0.06)'
1196
+ }
1197
+ }, body.map((item, index) => {
1198
+ return /*#__PURE__*/React__default.createElement("tr", {
1199
+ key: `${item}_${index}`,
1200
+ style: {
1201
+ borderBottom: index === body.length - 1 ? 'none' : tBodyRowBorder ? tBodyRowBorder : configStyles.TABLE.tBodyRowBorder
1202
+ }
1203
+ }, Object.values(item).map((innerItem, innerIndex) => {
1204
+ return /*#__PURE__*/React__default.createElement(TD, {
1205
+ index: index,
1206
+ item: innerItem,
1207
+ innerIndex: innerIndex,
1208
+ id: item.id ? item.id : '',
1209
+ handleCheckDots: handleCheckDots,
1210
+ key: `${innerItem}_${index}_${innerIndex}`,
1211
+ openListColor: openListColor ? openListColor : configStyles.TABLE.openListColor,
1212
+ handleCheckedBody: handleCheckedBody,
1213
+ handleBodyActionClick: handleBodyActionClick,
1214
+ handleMoreOptionsClick: handleMoreOptionsClick,
1215
+ handleContentListClick: handleContentListClick,
1216
+ tBodyColor: tBodyColor ? tBodyColor : configStyles.TABLE.tBodyColor,
1217
+ tBodyPadding: tBodyPadding ? tBodyPadding : configStyles.TABLE.tBodyPadding,
1218
+ tBodyFontSize: tBodyFontSize ? tBodyFontSize : configStyles.TABLE.tBodyFontSize,
1219
+ tBodyTextAlign: tBodyTextAlign ? tBodyTextAlign : configStyles.TABLE.tBodyTextAlign,
1220
+ tBodyFontFamily: tBodyFontFamily ? tBodyFontFamily : configStyles.TABLE.tBodyFontFamily,
1221
+ tBodyFontWeight: tBodyFontWeight ? tBodyFontWeight : configStyles.TABLE.tBodyFontWeight,
1222
+ borderRight: innerIndex === Object.values(item).length - 1 ? 'none' : configStyles.TABLE.tBodyRowBorder,
1223
+ handleCheckArrowAction: handleCheckArrowAction,
1224
+ handleOpenCloseRowSingleArrow: handleOpenCloseRowSingleArrow
1225
+ });
1226
+ }));
1227
+ }))));
1228
+ };
1229
+ Table.propTypes = {
1230
+ getData: PropTypes.func,
357
1231
  dataBody: PropTypes.array,
1232
+ arrowShow: PropTypes.bool,
358
1233
  dataHeader: PropTypes.array,
1234
+ arrowColumn: PropTypes.number,
359
1235
  tHeadColor: PropTypes.string,
360
1236
  tHeadFamily: PropTypes.string,
361
1237
  tHeadPadding: PropTypes.string,
1238
+ tHeadFontSize: PropTypes.string,
362
1239
  tHeadFontWeight: PropTypes.number,
363
1240
  tHeadBorderRadius: PropTypes.string,
364
1241
  tHeadBackgroundColor: PropTypes.string,
@@ -369,8 +1246,8 @@ styleInject(css_248z$e);
369
1246
  tBodyFontWeight: PropTypes.string,
370
1247
  tBodyFontFamily: PropTypes.string,
371
1248
  tBodyRowBorder: PropTypes.string,
372
- setTableDataHeader: PropTypes.func
373
- });
1249
+ openListColor: PropTypes.string
1250
+ };
374
1251
 
375
1252
  var css_248z$d = ".modal-module_animation__modal__3mt48{animation:modal-module_show-popup__WrH7a .15s;-webkit-animation:modal-module_show-popup__WrH7a .15s}@keyframes modal-module_show-popup__WrH7a{0%{transform:translate3d(0,-50%,0);-webkit-transform:translate3d(0,-50%,0);-moz-transform:translate3d(0,-50%,0);-ms-transform:translate3d(0,-50%,0);-o-transform:translate3d(0,-50%,0)}to{opacity:1;transform:translateZ(0);-webkit-transform:translateZ(0);-moz-transform:translateZ(0);-ms-transform:translateZ(0);-o-transform:translateZ(0)}}";
376
1253
  var styles$b = {"animation__modal":"modal-module_animation__modal__3mt48","show-popup":"modal-module_show-popup__WrH7a"};
@@ -2491,7 +3368,7 @@ for (let i = 0; i < 256; ++i) {
2491
3368
  function unsafeStringify(arr, offset = 0) {
2492
3369
  // Note: Be careful editing this code! It's been tuned for performance
2493
3370
  // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434
2494
- return byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + '-' + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + '-' + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + '-' + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + '-' + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]];
3371
+ return (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + '-' + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + '-' + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + '-' + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + '-' + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase();
2495
3372
  }
2496
3373
 
2497
3374
  const randomUUID = typeof crypto !== 'undefined' && crypto.randomUUID && crypto.randomUUID.bind(crypto);
@@ -2951,6 +3828,7 @@ const NewFile = ({
2951
3828
  labelColor,
2952
3829
  errorColor,
2953
3830
  filesArray,
3831
+ componentId,
2954
3832
  putFileHere,
2955
3833
  borderColor,
2956
3834
  uploadColor,
@@ -2965,6 +3843,7 @@ const NewFile = ({
2965
3843
  listItemHeight,
2966
3844
  backgroundColor,
2967
3845
  deleteComponent,
3846
+ removeComponent,
2968
3847
  listItemPadding,
2969
3848
  progressFontSize,
2970
3849
  borderHoverColor,
@@ -3000,6 +3879,7 @@ const NewFile = ({
3000
3879
  } else {
3001
3880
  removeFile && removeFile(filesArray);
3002
3881
  }
3882
+ removeComponent(componentId);
3003
3883
  };
3004
3884
  const handleRemoveFile = () => {
3005
3885
  setImage(null);
@@ -3119,6 +3999,11 @@ const NewFile = ({
3119
3999
  alert('Please add removeFile prop on NewFile component, it is a require in multiple mode');
3120
4000
  }
3121
4001
  }, [multiple, removeFile, filesArray && filesArray.length, defaultData]);
4002
+ useEffect(() => {
4003
+ if (deleteComponent && !removeComponent) {
4004
+ alert('Please add removeComponent prop on NewFile component it is require when deleteComponent prop is true');
4005
+ }
4006
+ }, [deleteComponent]);
3122
4007
  useEffect(() => {
3123
4008
  if (errorMessage) {
3124
4009
  setError(errorMessage);
@@ -3303,12 +4188,14 @@ NewFile.propTypes = {
3303
4188
  borderColor: PropTypes.string,
3304
4189
  uploadColor: PropTypes.string,
3305
4190
  defaultData: PropTypes.object,
4191
+ componentId: PropTypes.number,
3306
4192
  maxSizeError: PropTypes.string,
3307
4193
  errorMessage: PropTypes.string,
3308
4194
  fileSizeText: PropTypes.string,
3309
4195
  noChoosenFile: PropTypes.string,
3310
4196
  progressColor: PropTypes.string,
3311
4197
  deleteComponent: PropTypes.bool,
4198
+ removeComponent: PropTypes.func,
3312
4199
  listItemHeight: PropTypes.string,
3313
4200
  backgroundColor: PropTypes.string,
3314
4201
  change: PropTypes.func.isRequired,
@@ -3699,7 +4586,7 @@ Typography.propTypes = {
3699
4586
  textDecoration: PropTypes.string,
3700
4587
  backgroundColor: PropTypes.string,
3701
4588
  variant: PropTypes.oneOf(Object.values(TypographyType)),
3702
- size: PropTypes.oneOf(PropTypes.string, PropTypes.number)
4589
+ size: PropTypes.oneOf([PropTypes.string, PropTypes.number])
3703
4590
  };
3704
4591
  Typography.defaultProps = {
3705
4592
  variant: 'p'
@@ -4456,4 +5343,4 @@ NewAutocomplete.defaultProps = {
4456
5343
  disabled: false
4457
5344
  };
4458
5345
 
4459
- export { Autocomplate, Button, Captcha, Checkbox, File, Input, InputTypes, Modal, NewAutocomplete, NewFile, Pagination, Radio, Select, SingleCheckbox, Stepper, Textarea, Toaster, Tooltip, Typography, TypographyType, toast };
5346
+ export { Autocomplate, Button, Captcha, Checkbox, File, Input, InputTypes, Modal, NewAutocomplete, NewFile, Pagination, Radio, Select, SingleCheckbox, Stepper, Table, Textarea, Toaster, Tooltip, Typography, TypographyType, toast };