@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.js CHANGED
@@ -74,16 +74,16 @@ const SvgRequired = ({
74
74
  titleId,
75
75
  ...props
76
76
  }) => /*#__PURE__*/React__namespace.createElement("svg", _extends({
77
- width: "12",
78
- height: "12",
79
- viewBox: "0 0 12 12",
77
+ width: "10",
78
+ height: "10",
79
+ viewBox: "0 0 10 10",
80
80
  fill: "none",
81
81
  xmlns: "http://www.w3.org/2000/svg",
82
82
  "aria-labelledby": titleId
83
83
  }, props), title ? /*#__PURE__*/React__namespace.createElement("title", {
84
84
  id: titleId
85
85
  }, title) : null, /*#__PURE__*/React__namespace.createElement("path", {
86
- 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",
86
+ 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",
87
87
  fill: "#E00"
88
88
  }));
89
89
 
@@ -115,7 +115,7 @@ function styleInject(css, ref) {
115
115
  }
116
116
 
117
117
  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)}";
118
- 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"};
118
+ 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"};
119
119
  styleInject(css_248z$f);
120
120
 
121
121
  const File = ({
@@ -176,11 +176,11 @@ const File = ({
176
176
  document.querySelector(`.${name}`).value = '';
177
177
  };
178
178
  return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement("p", {
179
- className: `${styles$c['file-form-title']} ile-form-title-rem`
179
+ className: `${styles$d['file-form-title']} ile-form-title-rem`
180
180
  }, label, required && /*#__PURE__*/React__default["default"].createElement("sup", null, /*#__PURE__*/React__default["default"].createElement(SvgRequired, null))), /*#__PURE__*/React__default["default"].createElement("div", {
181
- className: classnames__default["default"](`${styles$c['file-form-wrap']} file-form-wrap-rem`, image ? styles$c['active'] : '')
181
+ className: classnames__default["default"](`${styles$d['file-form-wrap']} file-form-wrap-rem`, image ? styles$d['active'] : '')
182
182
  }, /*#__PURE__*/React__default["default"].createElement("div", {
183
- className: `${styles$c['file-form']} file-form-rem ${error || errorMessage ? styles$c['error'] : ''}`,
183
+ className: `${styles$d['file-form']} file-form-rem ${error || errorMessage ? styles$d['error'] : ''}`,
184
184
  onClick: () => document.querySelector(`.${name}`).click()
185
185
  }, /*#__PURE__*/React__default["default"].createElement("input", {
186
186
  hidden: true,
@@ -189,23 +189,23 @@ const File = ({
189
189
  disabled: disabled,
190
190
  onChange: e => handleCheckFile(e)
191
191
  }), image ? /*#__PURE__*/React__default["default"].createElement("div", {
192
- className: `${styles$c['upload-file-content']} upload-file-content-rem`
192
+ className: `${styles$d['upload-file-content']} upload-file-content-rem`
193
193
  }, image === 'pdf' ? /*#__PURE__*/React__default["default"].createElement(SvgPdf, null) : /*#__PURE__*/React__default["default"].createElement("img", {
194
194
  src: image,
195
195
  alt: fileName
196
196
  })) : /*#__PURE__*/React__default["default"].createElement("div", {
197
- className: `${styles$c['file-form-inner-upload']} ile-form-inner-upload-rem`
197
+ className: `${styles$d['file-form-inner-upload']} ile-form-inner-upload-rem`
198
198
  }, /*#__PURE__*/React__default["default"].createElement("img", {
199
199
  src: "../../assets/upload.svg",
200
200
  alt: ""
201
201
  }), /*#__PURE__*/React__default["default"].createElement("span", {
202
- className: `${styles$c['upload-info']} upload-info-rem`
202
+ className: `${styles$d['upload-info']} upload-info-rem`
203
203
  }, /*#__PURE__*/React__default["default"].createElement("span", {
204
- className: `${styles$c['upload-info-txt']} upload-info-txt-rem`
204
+ className: `${styles$d['upload-info-txt']} upload-info-txt-rem`
205
205
  }, "\u0532\u0565\u057C\u0576\u0565\u056C")), /*#__PURE__*/React__default["default"].createElement("span", {
206
- className: `${styles$c['upload-info-size']} upload-info-size-rem`
206
+ className: `${styles$d['upload-info-size']} upload-info-size-rem`
207
207
  }, "\u0531\u057C\u0561\u057E\u0565\u056C\u0561\u0563\u0578\u0582\u0575\u0576\u0568 ", maxSize, "\u0544\u0532 ( ", fileExtensions.toString().split(',').join(', '), " )"))), !disabled && /*#__PURE__*/React__default["default"].createElement("div", {
208
- className: `${styles$c['delete-upload-icon']} delete-upload-icon-rem`,
208
+ className: `${styles$d['delete-upload-icon']} delete-upload-icon-rem`,
209
209
  onClick: handleRemoveFile
210
210
  }, /*#__PURE__*/React__default["default"].createElement("i", {
211
211
  className: "icon-delete"
@@ -299,9 +299,11 @@ const SvgCheckboxChecked = ({
299
299
 
300
300
  const Checkbox$1 = ({
301
301
  data,
302
+ index,
302
303
  styles,
303
304
  checked,
304
305
  disabled,
306
+ innerIndex,
305
307
  checkedColor,
306
308
  handleChecked,
307
309
  unCheckedColor,
@@ -311,7 +313,11 @@ const Checkbox$1 = ({
311
313
  const [innerChecked, setInnerChecked] = React.useState(false);
312
314
  const [innerDisabled, setInnerDisabled] = React.useState(false);
313
315
  const handleClick = e => {
314
- handleChecked(data, e);
316
+ if (index !== undefined && innerIndex !== undefined && typeof index === 'number' && typeof innerIndex === 'number') {
317
+ handleChecked(data, e, index, innerIndex);
318
+ } else {
319
+ handleChecked(data, e);
320
+ }
315
321
  };
316
322
  React.useEffect(() => {
317
323
  setInnerDisabled(disabled);
@@ -338,9 +344,11 @@ const Checkbox$1 = ({
338
344
 
339
345
  const SingleCheckbox = ({
340
346
  data,
347
+ index,
341
348
  styles,
342
349
  checked,
343
350
  disabled,
351
+ innerIndex,
344
352
  checkedColor,
345
353
  handleChecked,
346
354
  unCheckedColor,
@@ -360,10 +368,12 @@ const SingleCheckbox = ({
360
368
  setInnerData(data);
361
369
  }, [data]);
362
370
  return /*#__PURE__*/React__default["default"].createElement(Checkbox$1, {
371
+ index: index,
363
372
  styles: styles,
364
373
  data: innerData,
365
374
  checked: checked,
366
375
  disabled: disabled,
376
+ innerIndex: innerIndex,
367
377
  checkedColor: checkedColor,
368
378
  handleChecked: handleChecked,
369
379
  unCheckedColor: unCheckedColor,
@@ -373,22 +383,889 @@ const SingleCheckbox = ({
373
383
  SingleCheckbox.propTypes = {
374
384
  data: PropTypes__default["default"].object,
375
385
  onClick: PropTypes__default["default"].func,
386
+ index: PropTypes__default["default"].number,
376
387
  styles: PropTypes__default["default"].object,
377
388
  disabled: PropTypes__default["default"].bool,
389
+ innerIndex: PropTypes__default["default"].number,
378
390
  checkedColor: PropTypes__default["default"].string,
379
391
  unCheckedColor: PropTypes__default["default"].string,
380
392
  ignoreDisabledForChecked: PropTypes__default["default"].bool
381
393
  };
382
394
 
383
- 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}";
395
+ 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}";
396
+ 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"};
384
397
  styleInject(css_248z$e);
385
398
 
386
- ({
399
+ /* eslint-disable no-prototype-builtins */
400
+ const TH = ({
401
+ item,
402
+ tHeadFamily,
403
+ tHeadPadding,
404
+ tHeadFontSize,
405
+ tHeadFontWeight,
406
+ handleCheckedHeader,
407
+ borderTopLeftRadius,
408
+ borderTopRightRadius,
409
+ handleHeaderItemClick,
410
+ handleCheckArrowActionHeader
411
+ }) => {
412
+ return /*#__PURE__*/React__default["default"].createElement("th", {
413
+ style: {
414
+ width: 'auto',
415
+ cursor: 'pointer',
416
+ whiteSpace: 'nowrap',
417
+ position: 'relative',
418
+ padding: tHeadPadding,
419
+ fontSize: tHeadFontSize,
420
+ fontFamily: tHeadFamily,
421
+ fontWeight: tHeadFontWeight,
422
+ borderTopLeftRadius: borderTopLeftRadius,
423
+ borderTopRightRadius: borderTopRightRadius
424
+ },
425
+ onClick: handleHeaderItemClick,
426
+ className: `${item.sortingArrows && styles$c['sorting-arrows']}`
427
+ }, /*#__PURE__*/React__default["default"].createElement("div", {
428
+ style: {
429
+ display: 'flex',
430
+ alignItems: 'flex-start',
431
+ justifyContent: Object.prototype.hasOwnProperty.call(item, 'checkBox') ? 'space-between' : 'center'
432
+ }
433
+ }, item.hasOwnProperty('checkBox') ? /*#__PURE__*/React__default["default"].createElement(SingleCheckbox, {
434
+ data: item,
435
+ float: "left",
436
+ checked: item.checkBox.checked,
437
+ disabled: item.checkBox.disabled,
438
+ handleChecked: !item.checkBox.disabled ? handleCheckedHeader : _ => _,
439
+ checkedColor: item.checkBox.checkedColor ? item.checkBox.checkedColor : '',
440
+ unCheckedColor: item.checkBox.unCheckedColor ? item.checkBox.unCheckedColor : ''
441
+ }) : '', /*#__PURE__*/React__default["default"].createElement("p", {
442
+ style: {
443
+ margin: '0px'
444
+ },
445
+ onClick: Object.prototype.hasOwnProperty.call(item, 'arrowComponent') ? e => handleCheckArrowActionHeader(e, item) : _ => _
446
+ }, item.type === 'show' ? item.content : Object.prototype.hasOwnProperty.call(item, 'arrowComponent') ? item.status === 'close' ? item.closeArrow : item.openArrow : '')));
447
+ };
448
+
449
+ const TD = ({
450
+ item,
451
+ index,
452
+ innerIndex,
453
+ tBodyColor,
454
+ borderRight,
455
+ tBodyPadding,
456
+ tBodyFontSize,
457
+ openListColor,
458
+ tBodyTextAlign,
459
+ tBodyFontFamily,
460
+ tBodyFontWeight,
461
+ handleCheckDots,
462
+ handleCheckedBody,
463
+ handleBodyActionClick,
464
+ handleMoreOptionsClick,
465
+ handleContentListClick,
466
+ handleCheckArrowAction,
467
+ handleOpenCloseRowSingleArrow
468
+ }) => {
469
+ const handleBodyAction = (e, data) => {
470
+ const actionData = {
471
+ index,
472
+ innerIndex,
473
+ items: item,
474
+ item: data.item,
475
+ itemIndex: data.itemIndex
476
+ };
477
+ handleBodyActionClick(e, actionData);
478
+ };
479
+ return /*#__PURE__*/React__default["default"].createElement("td", {
480
+ style: {
481
+ width: 'auto',
482
+ color: tBodyColor,
483
+ verticalAlign: 'top',
484
+ whiteSpace: 'nowrap',
485
+ padding: tBodyPadding,
486
+ fontSize: tBodyFontSize,
487
+ borderRight: borderRight,
488
+ textAlign: tBodyTextAlign,
489
+ fontFamily: tBodyFontFamily,
490
+ fontWeight: tBodyFontWeight,
491
+ boxShadow: Object.prototype.hasOwnProperty.call(item, 'colorStatus') ? `inset 3px 0px 0px 0px ${item.colorStatus}` : ''
492
+ }
493
+ }, Array.isArray(item) ? item.length > 0 ? item.map((newItem, newIndex) => {
494
+ if (newItem && !Array.isArray(newItem) && typeof newItem === 'object') {
495
+ return /*#__PURE__*/React__default["default"].createElement("span", {
496
+ style: {
497
+ width: '32px',
498
+ height: '32px',
499
+ marginRight: '10px',
500
+ cursor: Object.prototype.hasOwnProperty.call(newItem, 'type') ? 'pointer' : 'auto'
501
+ },
502
+ id: newItem.id,
503
+ type: newItem.type,
504
+ className: styles$c['td-span'],
505
+ key: `${newItem.id}_${newIndex}`,
506
+ onClick: Object.prototype.hasOwnProperty.call(newItem, 'type') ? e => handleBodyAction(e, {
507
+ item: newItem,
508
+ itemIndex: newIndex
509
+ }) : _ => _
510
+ }, newItem.content);
511
+ } else if (newItem && Array.isArray(newItem)) {
512
+ return /*#__PURE__*/React__default["default"].createElement("span", {
513
+ key: `${newItem.id}_${newIndex}`,
514
+ style: {
515
+ display: 'inline-block',
516
+ marginRight: newIndex !== item.length - 1 ? '10px' : '0px',
517
+ borderRight: newIndex !== item.length - 1 ? '1px solid rgb(238, 238, 238)' : 'none'
518
+ }
519
+ }, item[newIndex].map((iT, iN) => {
520
+ return /*#__PURE__*/React__default["default"].createElement("span", {
521
+ style: {
522
+ width: '32px',
523
+ height: '32px',
524
+ marginRight: '10px',
525
+ cursor: Object.prototype.hasOwnProperty.call(iT, 'type') ? 'pointer' : 'auto'
526
+ },
527
+ id: iT.id ? iT.id : '',
528
+ type: iT.type ? iT.type : '',
529
+ className: styles$c['td-span'],
530
+ onClick: Object.prototype.hasOwnProperty.call(iT, 'type') ? e => handleBodyAction(e, {
531
+ item: iT,
532
+ itemIndex: iN
533
+ }) : _ => _,
534
+ key: `${iT.id || iT.content}_${iN}`
535
+ }, iT.content);
536
+ }));
537
+ } else {
538
+ return /*#__PURE__*/React__default["default"].createElement("span", {
539
+ key: `${newItem.id}_${newIndex}`
540
+ }, newItem);
541
+ }
542
+ }) : /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null) : item !== null && !Array.isArray(item) && typeof item === 'object' ? /*#__PURE__*/React__default["default"].createElement("div", {
543
+ style: {
544
+ display: 'flex',
545
+ alignItems: 'flex-start',
546
+ justifyContent: Object.prototype.hasOwnProperty.call(item, 'contentList') || Object.prototype.hasOwnProperty.call(item, 'checkBox') ? 'space-between' : 'center'
547
+ }
548
+ }, Object.prototype.hasOwnProperty.call(item, 'contentList') && /*#__PURE__*/React__default["default"].createElement("div", {
549
+ id: item.id,
550
+ style: {
551
+ width: '21px',
552
+ height: '21px',
553
+ cursor: 'pointer'
554
+ },
555
+ onClick: () => handleOpenCloseRowSingleArrow(index, innerIndex),
556
+ className: styles$c['td-span']
557
+ }, item.status === 'close' ? item.closeArrow : item.openArrow), Object.prototype.hasOwnProperty.call(item, 'checkBox') && /*#__PURE__*/React__default["default"].createElement(SingleCheckbox, {
558
+ data: item,
559
+ index: index,
560
+ innerIndex: innerIndex,
561
+ checked: item.checkBox.checked,
562
+ handleChecked: handleCheckedBody,
563
+ disabled: item.checkBox.disabled,
564
+ checkedColor: item.checkBox.checkedColor,
565
+ unCheckedColor: item.checkBox.unCheckedColor
566
+ }), /*#__PURE__*/React__default["default"].createElement("div", {
567
+ style: {
568
+ marginLeft: item.contentList ? '10px' : '0px'
569
+ }
570
+ }, /*#__PURE__*/React__default["default"].createElement("p", {
571
+ style: {
572
+ margin: '0px',
573
+ cursor: Object.prototype.hasOwnProperty.call(item, 'arrowComponent') || Object.prototype.hasOwnProperty.call(item, 'dots') ? 'pointer' : 'auto'
574
+ },
575
+ onClick: Object.prototype.hasOwnProperty.call(item, 'arrowComponent') ? () => handleCheckArrowAction(item, item.checkIndex) : Object.prototype.hasOwnProperty.call(item, 'dots') ? e => handleCheckDots(e, item, index, innerIndex) : _ => _
576
+ }, 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["default"].createElement("span", {
577
+ style: {
578
+ display: 'block',
579
+ position: 'relative'
580
+ }
581
+ }, item.dotsStatus === 'deActive' ? item.deActiveIcon : item.activeIcon, /*#__PURE__*/React__default["default"].createElement("span", {
582
+ style: {
583
+ position: 'absolute',
584
+ display: item.dotsStatus === 'deActive' ? 'none' : 'block',
585
+ top: '0px',
586
+ zIndex: 100,
587
+ right: 'calc(100% + 6px)',
588
+ width: '223px',
589
+ height: 'auto',
590
+ overflow: 'auto',
591
+ minHeight: '40px',
592
+ maxHeight: '246px',
593
+ borderRadius: '6px',
594
+ backgroundColor: '#FFFFFF',
595
+ boxShadow: '0px 0px 20px 0px #3C393E4D'
596
+ }
597
+ }, Object.prototype.hasOwnProperty.call(item, 'options') && item.options.map((optionItem, optionIndex) => {
598
+ return /*#__PURE__*/React__default["default"].createElement("span", {
599
+ key: `${optionItem.content}_${optionIndex}`,
600
+ className: styles$c['dots-option-item'],
601
+ style: {
602
+ color: '#3C393E',
603
+ fontSize: '14px',
604
+ fontFamily: 'Noto Sans Armenian'
605
+ },
606
+ onClick: () => handleMoreOptionsClick({
607
+ item,
608
+ index,
609
+ optionItem,
610
+ innerIndex,
611
+ optionIndex,
612
+ options: item.options
613
+ })
614
+ }, /*#__PURE__*/React__default["default"].createElement("span", {
615
+ style: {
616
+ marginRight: '10px'
617
+ }
618
+ }, optionItem.icon), /*#__PURE__*/React__default["default"].createElement("span", {
619
+ style: {
620
+ width: 'calc(100% - 36px)',
621
+ textAlign: 'left',
622
+ overflow: 'hidden',
623
+ whiteSpace: 'nowrap',
624
+ textOverflow: 'ellipsis'
625
+ },
626
+ title: optionItem.content
627
+ }, optionItem.content));
628
+ }))) : ''), Object.prototype.hasOwnProperty.call(item, 'contentList') && /*#__PURE__*/React__default["default"].createElement("div", {
629
+ style: {
630
+ overflow: 'auto',
631
+ marginTop: '10px',
632
+ maxHeight: '300px',
633
+ maxWidth: '100%',
634
+ height: item.status === 'close' ? '0px' : 'auto'
635
+ }
636
+ }, item.contentList.map((innerItem, innerItemIndex) => {
637
+ return /*#__PURE__*/React__default["default"].createElement("p", {
638
+ key: `${innerItem}_${innerItemIndex}`,
639
+ className: styles$c['list-text'],
640
+ style: {
641
+ color: openListColor
642
+ },
643
+ onClick: e => handleContentListClick(e, {
644
+ item,
645
+ index,
646
+ innerIndex,
647
+ listContentId: innerItem.id,
648
+ listContent: innerItem.content,
649
+ listContentIndex: innerItemIndex
650
+ })
651
+ }, innerItem.content.length >= item.content.length ? innerItem.content.substr(0, item.content.length - 4) + '...' : innerItem.content);
652
+ })))) : '');
653
+ };
654
+
655
+ const SvgUpArrow = ({
656
+ title,
657
+ titleId,
658
+ ...props
659
+ }) => /*#__PURE__*/React__namespace.createElement("svg", _extends({
660
+ width: "21",
661
+ height: "21",
662
+ viewBox: "0 0 21 21",
663
+ fill: "none",
664
+ xmlns: "http://www.w3.org/2000/svg",
665
+ "aria-labelledby": titleId
666
+ }, props), title ? /*#__PURE__*/React__namespace.createElement("title", {
667
+ id: titleId
668
+ }, title) : null, /*#__PURE__*/React__namespace.createElement("rect", {
669
+ x: 0.5,
670
+ y: 0.5,
671
+ width: 20,
672
+ height: 20,
673
+ rx: 0.5,
674
+ fill: "#fff",
675
+ stroke: "#EEE"
676
+ }), /*#__PURE__*/React__namespace.createElement("path", {
677
+ 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",
678
+ fill: "#3C393E"
679
+ }));
680
+
681
+ const SvgDownArrow = ({
682
+ title,
683
+ titleId,
684
+ ...props
685
+ }) => /*#__PURE__*/React__namespace.createElement("svg", _extends({
686
+ width: "21",
687
+ height: "21",
688
+ viewBox: "0 0 21 21",
689
+ fill: "none",
690
+ xmlns: "http://www.w3.org/2000/svg",
691
+ "aria-labelledby": titleId
692
+ }, props), title ? /*#__PURE__*/React__namespace.createElement("title", {
693
+ id: titleId
694
+ }, title) : null, /*#__PURE__*/React__namespace.createElement("rect", {
695
+ x: 0.5,
696
+ y: 0.5,
697
+ width: 20,
698
+ height: 20,
699
+ rx: 0.5,
700
+ fill: "#fff",
701
+ stroke: "#EEE"
702
+ }), /*#__PURE__*/React__namespace.createElement("path", {
703
+ 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",
704
+ fill: "#3C393E"
705
+ }));
706
+
707
+ const Table = ({
708
+ getData,
709
+ dataBody,
710
+ arrowShow,
711
+ dataHeader,
712
+ arrowColumn,
713
+ tHeadColor,
714
+ tHeadFamily,
715
+ tHeadPadding,
716
+ tHeadFontSize,
717
+ tHeadFontWeight,
718
+ tHeadBorderRadius,
719
+ tHeadBackgroundColor,
720
+ tBodyColor,
721
+ tBodyPadding,
722
+ tBodyFontSize,
723
+ tBodyTextAlign,
724
+ tBodyFontWeight,
725
+ tBodyFontFamily,
726
+ tBodyRowBorder,
727
+ openListColor
728
+ }) => {
729
+ const [body, setBody] = React.useState([]);
730
+ const [header, setHeader] = React.useState([]);
731
+ const [disableArr, setDisableArr] = React.useState([]);
732
+ const [checkedArray, setCheckedArray] = React.useState([]);
733
+ const configStyles = compereConfigs();
734
+ const handleCheckIfArrow = (bodyData, data) => {
735
+ let removeItemIndex;
736
+ let headerWithoutArrow = [];
737
+ bodyData.map((item, index) => {
738
+ if (index === data.index) {
739
+ item.map((innerItem, innerIndex) => {
740
+ if (Object.prototype.hasOwnProperty.call(innerItem, 'arrowComponent')) {
741
+ removeItemIndex = innerIndex;
742
+ }
743
+ });
744
+ if (removeItemIndex !== undefined) {
745
+ const firstPart = item.slice(0, removeItemIndex);
746
+ const secondPart = item.slice(removeItemIndex + 1, item.length);
747
+ headerWithoutArrow = [...firstPart, ...secondPart];
748
+ } else {
749
+ headerWithoutArrow.push(item);
750
+ }
751
+ }
752
+ });
753
+ return {
754
+ removeItemIndex,
755
+ headerWithoutArrow
756
+ };
757
+ };
758
+ const handleHeaderItemClick = e => {
759
+ e.stopPropagation();
760
+ if (!e.target.tagName.startsWith('svg') && e.target.innerText !== undefined && e.target.innerText !== '') {
761
+ let removeItemIndex;
762
+ let headerWithoutArrow;
763
+ header.map((item, index) => {
764
+ if (Object.prototype.hasOwnProperty.call(item, 'arrowComponent')) {
765
+ removeItemIndex = index;
766
+ }
767
+ });
768
+ if (removeItemIndex !== undefined) {
769
+ const firstPart = header.slice(0, removeItemIndex);
770
+ const secondPart = header.slice(removeItemIndex + 1, header.length);
771
+ headerWithoutArrow = [...firstPart, ...secondPart];
772
+ }
773
+ const returnedData = {
774
+ from: 'header',
775
+ content: e.target.innerText,
776
+ row: headerWithoutArrow !== undefined ? headerWithoutArrow : header
777
+ };
778
+ getData(returnedData);
779
+ }
780
+ };
781
+ const handleBodyActionClick = (e, data) => {
782
+ e.stopPropagation();
783
+ const {
784
+ removeItemIndex,
785
+ headerWithoutArrow
786
+ } = handleCheckIfArrow(body, data);
787
+ const actionData = {
788
+ from: 'body',
789
+ item: data.item,
790
+ id: data.item.id,
791
+ items: data.items,
792
+ type: data.item.type,
793
+ rowIndex: data.index,
794
+ row: headerWithoutArrow,
795
+ itemInnerIndex: data.itemIndex,
796
+ itemIndex: removeItemIndex !== undefined && removeItemIndex < data.innerIndex ? data.innerIndex - 1 : data.innerIndex
797
+ };
798
+ getData(actionData);
799
+ };
800
+ const handleSetCheckboxArray = data => {
801
+ let checkedItems = [];
802
+ data.map((item, index) => {
803
+ item.map((innerItem, innerIndex) => {
804
+ if (Object.prototype.hasOwnProperty.call(innerItem, 'checkBox')) {
805
+ if (!checkedItems[innerIndex]) {
806
+ checkedItems[innerIndex] = [];
807
+ }
808
+ checkedItems[innerIndex].push({
809
+ rowCount: index,
810
+ columnCount: innerIndex,
811
+ checked: innerItem.checkBox.checked
812
+ });
813
+ }
814
+ });
815
+ });
816
+ return checkedItems;
817
+ };
818
+ const handleSetInsertIndex = (data, count) => {
819
+ let arrowColumnCount;
820
+ if (typeof count !== 'number') {
821
+ alert('arrowColumn props must be a number, please check it');
822
+ } else {
823
+ if (count <= 0) {
824
+ arrowColumnCount = 0;
825
+ } else {
826
+ if (count >= data.length - 1) {
827
+ arrowColumnCount = data.length;
828
+ } else {
829
+ arrowColumnCount = count;
830
+ }
831
+ }
832
+ }
833
+ return arrowColumnCount;
834
+ };
835
+ const handleInsertArrow = (data, count, arrowObject) => {
836
+ if (count === 0) {
837
+ data.unshift(arrowObject);
838
+ } else if (count >= data.length - 1) {
839
+ data.push(arrowObject);
840
+ } else {
841
+ data.splice(count, 0, arrowObject);
842
+ }
843
+ return data;
844
+ };
845
+ const handleTransformDataForInsertArrow = (data, count, type) => {
846
+ const arrowObject = {
847
+ status: 'close',
848
+ checkIndex: null,
849
+ arrowComponent: true,
850
+ openArrow: /*#__PURE__*/React__default["default"].createElement(SvgUpArrow, null),
851
+ closeArrow: /*#__PURE__*/React__default["default"].createElement(SvgDownArrow, null)
852
+ };
853
+ if (type === 'body') {
854
+ return data.map((item, index) => {
855
+ const newObjWithArrow = {
856
+ ...arrowObject
857
+ };
858
+ newObjWithArrow.checkIndex = index;
859
+ return handleInsertArrow(item, count, newObjWithArrow);
860
+ });
861
+ } else {
862
+ const newObjWithArrow = {
863
+ ...arrowObject
864
+ };
865
+ newObjWithArrow.checkIndex = count;
866
+ return handleInsertArrow(data, count, newObjWithArrow);
867
+ }
868
+ };
869
+ const handleCheckedHeader = (data, e) => {
870
+ e.stopPropagation();
871
+ let removeItemIndex;
872
+ let checkableItemBool;
873
+ let checkableItemIndex;
874
+ let headerWithoutArrow;
875
+ let checkableBodyRowItems = [];
876
+ const updatedHeader = header.slice();
877
+ const updatedBody = body.slice().map(item => Object.values(item));
878
+ const newData = updatedHeader.map((item, index) => {
879
+ if (item.content == data.content) {
880
+ checkableItemIndex = index;
881
+ checkableItemBool = !item.checkBox.checked;
882
+ item.checkBox.checked = !item.checkBox.checked;
883
+ }
884
+ if (Object.prototype.hasOwnProperty.call(item, 'arrowComponent')) {
885
+ removeItemIndex = index;
886
+ }
887
+ return item;
888
+ });
889
+ const newUpdatedBody = updatedBody.map((item, index) => {
890
+ return item.map((innerItem, innerIndex) => {
891
+ if (checkableItemIndex === innerIndex) {
892
+ innerItem.checkBox.checked = checkableItemBool;
893
+ checkableBodyRowItems.push({
894
+ column: innerIndex,
895
+ columnItem: innerItem
896
+ });
897
+ handleHeaderCheckedUpdate({
898
+ row: index,
899
+ column: innerIndex,
900
+ checked: {
901
+ checked: checkableItemBool
902
+ }
903
+ });
904
+ }
905
+ return innerItem;
906
+ });
907
+ });
908
+ if (removeItemIndex !== undefined) {
909
+ const firstPart = newData.slice(0, removeItemIndex);
910
+ const secondPart = newData.slice(removeItemIndex + 1, newData.length);
911
+ headerWithoutArrow = [...firstPart, ...secondPart];
912
+ }
913
+ const returnedData = {
914
+ from: 'header',
915
+ content: data.content,
916
+ checkBox: data.checkBox,
917
+ columnArray: checkableBodyRowItems,
918
+ row: headerWithoutArrow !== undefined ? headerWithoutArrow : newData
919
+ };
920
+ getData(returnedData);
921
+ setHeader(newData);
922
+ setBody(newUpdatedBody);
923
+ };
924
+ const handleCheckedBody = (data, e, dataRowIndex, dataItemIndex) => {
925
+ e.stopPropagation();
926
+ const transformedData = {
927
+ ...data
928
+ };
929
+ transformedData.index = dataRowIndex;
930
+ transformedData.innerIndex = dataItemIndex;
931
+ const updatedBody = body.slice().map(item => Object.values(item));
932
+ const newData = updatedBody.map((item, index) => {
933
+ return item.map((innerItem, innerIndex) => {
934
+ if (innerItem.id === data.id && innerItem.content == data.content && Object.prototype.hasOwnProperty.call(innerItem, 'checkBox')) {
935
+ innerItem.checkBox.checked = !innerItem.checkBox.checked;
936
+ handleHeaderCheckedUpdate({
937
+ row: index,
938
+ column: innerIndex,
939
+ checked: innerItem.checkBox
940
+ });
941
+ }
942
+ return innerItem;
943
+ });
944
+ });
945
+ const {
946
+ removeItemIndex,
947
+ headerWithoutArrow
948
+ } = handleCheckIfArrow(body, transformedData);
949
+ const checkedData = {
950
+ item: data,
951
+ from: 'body',
952
+ row: removeItemIndex !== undefined ? headerWithoutArrow : headerWithoutArrow[0],
953
+ rowIndex: transformedData.index,
954
+ itemIndex: removeItemIndex !== undefined && removeItemIndex < transformedData.innerIndex ? transformedData.innerIndex - 1 : transformedData.innerIndex
955
+ };
956
+ getData(checkedData);
957
+ setBody(newData);
958
+ };
959
+ const handleHeaderCheckedUpdate = checkedData => {
960
+ const updatedHeader = header.slice();
961
+ const newCheckedArray = checkedArray.map((item, index) => {
962
+ return item.map((innerItem, innerIndex) => {
963
+ if (index === checkedData.column) {
964
+ if (innerIndex === checkedData.row) {
965
+ innerItem.checked = checkedData.checked.checked;
966
+ }
967
+ }
968
+ return innerItem;
969
+ });
970
+ });
971
+ const newData = updatedHeader.map((item, index) => {
972
+ if (newCheckedArray[index]) {
973
+ const tempCheckedArray = [];
974
+ newCheckedArray[index].map(innerItem => {
975
+ tempCheckedArray.push(innerItem.checked);
976
+ });
977
+ if (tempCheckedArray.every(i => i)) {
978
+ item.checkBox.checked = true;
979
+ } else {
980
+ item.checkBox.checked = false;
981
+ }
982
+ }
983
+ return item;
984
+ });
985
+ setHeader(newData);
986
+ setCheckedArray(newCheckedArray);
987
+ };
988
+ const handleCheckArrowAction = (item, rowPosition) => {
989
+ const status = item.status;
990
+ const checkedOpenableRow = body[rowPosition].map(innerItem => {
991
+ if (Object.prototype.hasOwnProperty.call(innerItem, 'status')) {
992
+ if (status === 'close') {
993
+ innerItem.status = 'open';
994
+ } else {
995
+ innerItem.status = 'close';
996
+ }
997
+ }
998
+ return innerItem;
999
+ });
1000
+ setBody(prev => {
1001
+ prev[rowPosition] = checkedOpenableRow;
1002
+ return [...prev];
1003
+ });
1004
+ };
1005
+ const handleOpenCloseRowSingleArrow = (arrowRowIndex, arrowIndex) => {
1006
+ let single = {};
1007
+ const allArrows = [];
1008
+ const checkedOpenableRow = body[arrowRowIndex].map((item, index) => {
1009
+ if (index === arrowIndex) {
1010
+ if (item.status === 'close') {
1011
+ item.status = 'open';
1012
+ } else {
1013
+ item.status = 'close';
1014
+ }
1015
+ single = item;
1016
+ }
1017
+ if (Object.prototype.hasOwnProperty.call(item, 'status') && !Object.prototype.hasOwnProperty.call(item, 'arrowComponent')) {
1018
+ allArrows.push(item);
1019
+ }
1020
+ return item;
1021
+ });
1022
+ const checkedOpenableRowArrow = checkedOpenableRow.map(item => {
1023
+ if (Object.prototype.hasOwnProperty.call(item, 'arrowComponent')) {
1024
+ if (single && single.status === 'close') {
1025
+ item.status = 'close';
1026
+ } else if (single && single.status === 'open') {
1027
+ if (allArrows.every(i => i.status === 'open')) {
1028
+ item.status = 'open';
1029
+ }
1030
+ }
1031
+ }
1032
+ return item;
1033
+ });
1034
+ setBody(prev => {
1035
+ prev[arrowRowIndex] = checkedOpenableRowArrow;
1036
+ return [...prev];
1037
+ });
1038
+ };
1039
+ const handleCheckArrowActionHeader = (e, item) => {
1040
+ e.stopPropagation();
1041
+ const checkedOpenableAllRows = header.map((innerItem, innerIndex) => {
1042
+ if (item.checkIndex === innerIndex) {
1043
+ if (item.status === 'close') {
1044
+ innerItem.status = 'open';
1045
+ } else {
1046
+ innerItem.status = 'close';
1047
+ }
1048
+ }
1049
+ return innerItem;
1050
+ });
1051
+ const checkedOpenableAllRowsBody = body.map(innerItem => {
1052
+ return innerItem.map(iElem => {
1053
+ if (Object.prototype.hasOwnProperty.call(iElem, 'status')) {
1054
+ if (item.status === 'open') {
1055
+ iElem.status = 'open';
1056
+ } else {
1057
+ iElem.status = 'close';
1058
+ }
1059
+ }
1060
+ return iElem;
1061
+ });
1062
+ });
1063
+ setHeader(() => checkedOpenableAllRows);
1064
+ setBody(() => checkedOpenableAllRowsBody);
1065
+ };
1066
+ const handleCheckDots = (e, item, index, innerIndex) => {
1067
+ e.stopPropagation();
1068
+ const checkBodyMore = body.map((elemItem, elemIndex) => {
1069
+ return elemItem.map((elemInnerItem, elemInnerIndex) => {
1070
+ if (elemIndex === index && Object.prototype.hasOwnProperty.call(elemInnerItem, 'dots')) {
1071
+ if (elemInnerIndex === innerIndex) {
1072
+ if (item.dotsStatus === 'deActive') {
1073
+ elemInnerItem.dotsStatus = 'active';
1074
+ } else {
1075
+ elemInnerItem.dotsStatus = 'deActive';
1076
+ }
1077
+ }
1078
+ } else if (elemIndex !== index && Object.prototype.hasOwnProperty.call(elemInnerItem, 'dots')) {
1079
+ if (elemInnerIndex === innerIndex) {
1080
+ elemInnerItem.dotsStatus = 'deActive';
1081
+ }
1082
+ }
1083
+ return elemInnerItem;
1084
+ });
1085
+ });
1086
+ setBody(() => checkBodyMore);
1087
+ };
1088
+ const handleCheckDisable = (arr, disableArr) => {
1089
+ let headerWithDisabled = [];
1090
+ if (disableArr && disableArr.length > 0) {
1091
+ headerWithDisabled = arr.map((item, index) => {
1092
+ if (disableArr[index]) {
1093
+ if (Object.prototype.hasOwnProperty.call(item, 'checkBox')) {
1094
+ item.checkBox.disabled = true;
1095
+ }
1096
+ }
1097
+ return item;
1098
+ });
1099
+ }
1100
+ return headerWithDisabled;
1101
+ };
1102
+ const handleContentListClick = (e, data) => {
1103
+ e.stopPropagation();
1104
+ const {
1105
+ removeItemIndex,
1106
+ headerWithoutArrow
1107
+ } = handleCheckIfArrow(body, data);
1108
+ const listData = {
1109
+ from: 'body',
1110
+ item: data.item,
1111
+ rowIndex: data.index,
1112
+ row: headerWithoutArrow,
1113
+ listItemId: data.listContentId,
1114
+ listItemContent: data.listContent,
1115
+ itemIndex: removeItemIndex !== undefined && removeItemIndex < data.innerIndex ? data.innerIndex - 1 : data.innerIndex,
1116
+ listItemInnerIndex: data.listContentIndex
1117
+ };
1118
+ getData(listData);
1119
+ };
1120
+ const handleMoreOptionsClick = data => {
1121
+ const {
1122
+ removeItemIndex,
1123
+ headerWithoutArrow
1124
+ } = handleCheckIfArrow(body, data);
1125
+ const moreData = {
1126
+ from: 'body',
1127
+ item: data.item,
1128
+ rowIndex: data.index,
1129
+ options: data.options,
1130
+ row: headerWithoutArrow,
1131
+ itemIndex: removeItemIndex !== undefined && removeItemIndex < data.innerIndex ? data.innerIndex - 1 : data.innerIndex,
1132
+ optionItem: data.optionItem,
1133
+ optionIndex: data.optionIndex
1134
+ };
1135
+ getData(moreData);
1136
+ };
1137
+ React.useEffect(() => {
1138
+ let checkedItems = [];
1139
+ const disabledArray = [];
1140
+ const checkBodyForChackedItems = dataBody.slice().map(item => Object.values(item));
1141
+ if (arrowShow) {
1142
+ const arrowColumnCount = handleSetInsertIndex(checkBodyForChackedItems[0], arrowColumn);
1143
+ const checkForInsertArrow = handleTransformDataForInsertArrow(checkBodyForChackedItems, arrowColumnCount, 'body');
1144
+ const insert = checkForInsertArrow.map((item, index) => {
1145
+ item.map((innerItem, innerIndex) => {
1146
+ if (Object.prototype.hasOwnProperty.call(innerItem, 'checkBox')) {
1147
+ if (Object.prototype.hasOwnProperty.call(innerItem.checkBox, 'disabled')) {
1148
+ if (innerItem.checkBox.disabled === true) {
1149
+ if (!disabledArray[innerIndex]) {
1150
+ disabledArray[innerIndex] = {
1151
+ rowIndex: index,
1152
+ columnIndex: innerIndex
1153
+ };
1154
+ }
1155
+ }
1156
+ }
1157
+ }
1158
+ });
1159
+ return item;
1160
+ });
1161
+ checkedItems = handleSetCheckboxArray(insert);
1162
+ setBody(() => insert);
1163
+ } else {
1164
+ const insert = checkBodyForChackedItems.map((item, index) => {
1165
+ item.map((innerItem, innerIndex) => {
1166
+ if (Object.prototype.hasOwnProperty.call(innerItem, 'checkBox')) {
1167
+ if (Object.prototype.hasOwnProperty.call(innerItem.checkBox, 'disabled')) {
1168
+ if (innerItem.checkBox.disabled === true) {
1169
+ if (!disabledArray[innerIndex]) {
1170
+ disabledArray[innerIndex] = {
1171
+ rowIndex: index,
1172
+ columnIndex: innerIndex
1173
+ };
1174
+ }
1175
+ }
1176
+ }
1177
+ }
1178
+ });
1179
+ return item;
1180
+ });
1181
+ checkedItems = handleSetCheckboxArray(insert);
1182
+ setBody(() => insert);
1183
+ }
1184
+ setDisableArr(disabledArray);
1185
+ setCheckedArray(() => checkedItems);
1186
+ }, [dataBody, arrowColumn, arrowShow]);
1187
+ React.useEffect(() => {
1188
+ if (arrowShow) {
1189
+ const header = dataHeader.slice();
1190
+ const arrowColumnCount = handleSetInsertIndex(header, arrowColumn);
1191
+ const checkForInsertArrow = handleTransformDataForInsertArrow(header, arrowColumnCount, 'header');
1192
+ const headerWithDisabled = handleCheckDisable(checkForInsertArrow, disableArr);
1193
+ setHeader(() => headerWithDisabled.length > 0 ? headerWithDisabled : checkForInsertArrow);
1194
+ } else {
1195
+ const headerWithDisabled = handleCheckDisable(dataHeader, disableArr);
1196
+ setHeader(() => headerWithDisabled.length > 0 ? headerWithDisabled : dataHeader);
1197
+ }
1198
+ }, [dataHeader, arrowColumn, arrowShow, disableArr]);
1199
+ return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement("table", {
1200
+ style: {
1201
+ width: '100%',
1202
+ borderCollapse: 'collapse'
1203
+ }
1204
+ }, header && header.length > 0 && /*#__PURE__*/React__default["default"].createElement("thead", null, /*#__PURE__*/React__default["default"].createElement("tr", {
1205
+ style: {
1206
+ color: tHeadColor ? tHeadColor : configStyles.TABLE.tHeadColor,
1207
+ backgroundColor: tHeadBackgroundColor ? tHeadBackgroundColor : configStyles.TABLE.tHeadBackgroundColor
1208
+ }
1209
+ }, header.map((item, index) => {
1210
+ return /*#__PURE__*/React__default["default"].createElement(TH, {
1211
+ item: item,
1212
+ key: `${item}_${index}`,
1213
+ handleCheckedHeader: handleCheckedHeader,
1214
+ handleHeaderItemClick: handleHeaderItemClick,
1215
+ handleCheckArrowActionHeader: handleCheckArrowActionHeader,
1216
+ tHeadFamily: tHeadFamily ? tHeadFamily : configStyles.TABLE.tHeadFamily,
1217
+ tHeadPadding: tHeadPadding ? tHeadPadding : configStyles.TABLE.tHeadPadding,
1218
+ tHeadFontSize: tHeadFontSize ? tHeadFontSize : configStyles.TABLE.tHeadFontSize,
1219
+ tHeadFontWeight: tHeadFontWeight ? tHeadFontWeight : configStyles.TABLE.tHeadFontWeight,
1220
+ borderTopLeftRadius: index === 0 ? tHeadBorderRadius ? tHeadBorderRadius : configStyles.TABLE.tHeadBorderRadius : '0px',
1221
+ borderTopRightRadius: index === header.length - 1 ? tHeadBorderRadius ? tHeadBorderRadius : configStyles.TABLE.tHeadBorderRadius : '0px'
1222
+ });
1223
+ }))), body && body.length > 0 && /*#__PURE__*/React__default["default"].createElement("tbody", {
1224
+ style: {
1225
+ boxShadow: '0px 10px 30px rgba(0, 35, 106, 0.06)'
1226
+ }
1227
+ }, body.map((item, index) => {
1228
+ return /*#__PURE__*/React__default["default"].createElement("tr", {
1229
+ key: `${item}_${index}`,
1230
+ style: {
1231
+ borderBottom: index === body.length - 1 ? 'none' : tBodyRowBorder ? tBodyRowBorder : configStyles.TABLE.tBodyRowBorder
1232
+ }
1233
+ }, Object.values(item).map((innerItem, innerIndex) => {
1234
+ return /*#__PURE__*/React__default["default"].createElement(TD, {
1235
+ index: index,
1236
+ item: innerItem,
1237
+ innerIndex: innerIndex,
1238
+ id: item.id ? item.id : '',
1239
+ handleCheckDots: handleCheckDots,
1240
+ key: `${innerItem}_${index}_${innerIndex}`,
1241
+ openListColor: openListColor ? openListColor : configStyles.TABLE.openListColor,
1242
+ handleCheckedBody: handleCheckedBody,
1243
+ handleBodyActionClick: handleBodyActionClick,
1244
+ handleMoreOptionsClick: handleMoreOptionsClick,
1245
+ handleContentListClick: handleContentListClick,
1246
+ tBodyColor: tBodyColor ? tBodyColor : configStyles.TABLE.tBodyColor,
1247
+ tBodyPadding: tBodyPadding ? tBodyPadding : configStyles.TABLE.tBodyPadding,
1248
+ tBodyFontSize: tBodyFontSize ? tBodyFontSize : configStyles.TABLE.tBodyFontSize,
1249
+ tBodyTextAlign: tBodyTextAlign ? tBodyTextAlign : configStyles.TABLE.tBodyTextAlign,
1250
+ tBodyFontFamily: tBodyFontFamily ? tBodyFontFamily : configStyles.TABLE.tBodyFontFamily,
1251
+ tBodyFontWeight: tBodyFontWeight ? tBodyFontWeight : configStyles.TABLE.tBodyFontWeight,
1252
+ borderRight: innerIndex === Object.values(item).length - 1 ? 'none' : configStyles.TABLE.tBodyRowBorder,
1253
+ handleCheckArrowAction: handleCheckArrowAction,
1254
+ handleOpenCloseRowSingleArrow: handleOpenCloseRowSingleArrow
1255
+ });
1256
+ }));
1257
+ }))));
1258
+ };
1259
+ Table.propTypes = {
1260
+ getData: PropTypes__default["default"].func,
387
1261
  dataBody: PropTypes__default["default"].array,
1262
+ arrowShow: PropTypes__default["default"].bool,
388
1263
  dataHeader: PropTypes__default["default"].array,
1264
+ arrowColumn: PropTypes__default["default"].number,
389
1265
  tHeadColor: PropTypes__default["default"].string,
390
1266
  tHeadFamily: PropTypes__default["default"].string,
391
1267
  tHeadPadding: PropTypes__default["default"].string,
1268
+ tHeadFontSize: PropTypes__default["default"].string,
392
1269
  tHeadFontWeight: PropTypes__default["default"].number,
393
1270
  tHeadBorderRadius: PropTypes__default["default"].string,
394
1271
  tHeadBackgroundColor: PropTypes__default["default"].string,
@@ -399,8 +1276,8 @@ styleInject(css_248z$e);
399
1276
  tBodyFontWeight: PropTypes__default["default"].string,
400
1277
  tBodyFontFamily: PropTypes__default["default"].string,
401
1278
  tBodyRowBorder: PropTypes__default["default"].string,
402
- setTableDataHeader: PropTypes__default["default"].func
403
- });
1279
+ openListColor: PropTypes__default["default"].string
1280
+ };
404
1281
 
405
1282
  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)}}";
406
1283
  var styles$b = {"animation__modal":"modal-module_animation__modal__3mt48","show-popup":"modal-module_show-popup__WrH7a"};
@@ -2521,7 +3398,7 @@ for (let i = 0; i < 256; ++i) {
2521
3398
  function unsafeStringify(arr, offset = 0) {
2522
3399
  // Note: Be careful editing this code! It's been tuned for performance
2523
3400
  // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434
2524
- 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]];
3401
+ 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();
2525
3402
  }
2526
3403
 
2527
3404
  const randomUUID = typeof crypto !== 'undefined' && crypto.randomUUID && crypto.randomUUID.bind(crypto);
@@ -2981,6 +3858,7 @@ const NewFile = ({
2981
3858
  labelColor,
2982
3859
  errorColor,
2983
3860
  filesArray,
3861
+ componentId,
2984
3862
  putFileHere,
2985
3863
  borderColor,
2986
3864
  uploadColor,
@@ -2995,6 +3873,7 @@ const NewFile = ({
2995
3873
  listItemHeight,
2996
3874
  backgroundColor,
2997
3875
  deleteComponent,
3876
+ removeComponent,
2998
3877
  listItemPadding,
2999
3878
  progressFontSize,
3000
3879
  borderHoverColor,
@@ -3030,6 +3909,7 @@ const NewFile = ({
3030
3909
  } else {
3031
3910
  removeFile && removeFile(filesArray);
3032
3911
  }
3912
+ removeComponent(componentId);
3033
3913
  };
3034
3914
  const handleRemoveFile = () => {
3035
3915
  setImage(null);
@@ -3149,6 +4029,11 @@ const NewFile = ({
3149
4029
  alert('Please add removeFile prop on NewFile component, it is a require in multiple mode');
3150
4030
  }
3151
4031
  }, [multiple, removeFile, filesArray && filesArray.length, defaultData]);
4032
+ React.useEffect(() => {
4033
+ if (deleteComponent && !removeComponent) {
4034
+ alert('Please add removeComponent prop on NewFile component it is require when deleteComponent prop is true');
4035
+ }
4036
+ }, [deleteComponent]);
3152
4037
  React.useEffect(() => {
3153
4038
  if (errorMessage) {
3154
4039
  setError(errorMessage);
@@ -3333,12 +4218,14 @@ NewFile.propTypes = {
3333
4218
  borderColor: PropTypes__default["default"].string,
3334
4219
  uploadColor: PropTypes__default["default"].string,
3335
4220
  defaultData: PropTypes__default["default"].object,
4221
+ componentId: PropTypes__default["default"].number,
3336
4222
  maxSizeError: PropTypes__default["default"].string,
3337
4223
  errorMessage: PropTypes__default["default"].string,
3338
4224
  fileSizeText: PropTypes__default["default"].string,
3339
4225
  noChoosenFile: PropTypes__default["default"].string,
3340
4226
  progressColor: PropTypes__default["default"].string,
3341
4227
  deleteComponent: PropTypes__default["default"].bool,
4228
+ removeComponent: PropTypes__default["default"].func,
3342
4229
  listItemHeight: PropTypes__default["default"].string,
3343
4230
  backgroundColor: PropTypes__default["default"].string,
3344
4231
  change: PropTypes__default["default"].func.isRequired,
@@ -3729,7 +4616,7 @@ Typography.propTypes = {
3729
4616
  textDecoration: PropTypes__default["default"].string,
3730
4617
  backgroundColor: PropTypes__default["default"].string,
3731
4618
  variant: PropTypes__default["default"].oneOf(Object.values(TypographyType)),
3732
- size: PropTypes__default["default"].oneOf(PropTypes__default["default"].string, PropTypes__default["default"].number)
4619
+ size: PropTypes__default["default"].oneOf([PropTypes__default["default"].string, PropTypes__default["default"].number])
3733
4620
  };
3734
4621
  Typography.defaultProps = {
3735
4622
  variant: 'p'
@@ -4501,6 +5388,7 @@ exports.Radio = Radio;
4501
5388
  exports.Select = Select;
4502
5389
  exports.SingleCheckbox = SingleCheckbox;
4503
5390
  exports.Stepper = Stepper;
5391
+ exports.Table = Table;
4504
5392
  exports.Textarea = Textarea;
4505
5393
  exports.Toaster = Toaster;
4506
5394
  exports.Tooltip = Tooltip;