@majoo-ui/react 1.55.37 → 1.55.38

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.
Files changed (3) hide show
  1. package/index.esm.js +339 -193
  2. package/index.umd.js +365 -207
  3. package/package.json +2 -2
package/index.umd.js CHANGED
@@ -2374,7 +2374,7 @@
2374
2374
  };
2375
2375
  Flex$1.displayName = 'Flex';
2376
2376
 
2377
- const _excluded$B = ["children"],
2377
+ const _excluded$C = ["children"],
2378
2378
  _excluded2$4 = ["children"];
2379
2379
  var _jsxFileName$12 = "/Users/apple/Documents/project/majoo/majoo-ui/packages/react/src/layout/grid/Grid.js";
2380
2380
  const GridComponent = styled('div', {
@@ -2550,7 +2550,7 @@
2550
2550
  let {
2551
2551
  children
2552
2552
  } = _ref,
2553
- props = _objectWithoutPropertiesLoose(_ref, _excluded$B);
2553
+ props = _objectWithoutPropertiesLoose(_ref, _excluded$C);
2554
2554
  return /*#__PURE__*/React__default["default"].createElement(GridComponent, _extends({}, props, {
2555
2555
  css: Object.assign({}, props.css, {
2556
2556
  gridAutoColumns: props.autoColumns,
@@ -2630,7 +2630,7 @@
2630
2630
  };
2631
2631
  GridItem.displayName = 'Grid Item';
2632
2632
 
2633
- const _excluded$A = ["children", "isCollapse", "css", "contentHeader"];
2633
+ const _excluded$B = ["children", "isCollapse", "css", "contentHeader"];
2634
2634
  var _jsxFileName$11 = "/Users/apple/Documents/project/majoo/majoo-ui/packages/react/src/layout/pageContainer/PageContainer.js";
2635
2635
  const StyledDiv$2 = styled(Flex$1, {
2636
2636
  justifyContent: 'center',
@@ -2659,7 +2659,7 @@
2659
2659
  css,
2660
2660
  contentHeader
2661
2661
  } = _ref,
2662
- props = _objectWithoutPropertiesLoose(_ref, _excluded$A);
2662
+ props = _objectWithoutPropertiesLoose(_ref, _excluded$B);
2663
2663
  return /*#__PURE__*/React__default["default"].createElement(StyledDiv$2, _extends({
2664
2664
  id: "retina-container",
2665
2665
  css: Object.assign({
@@ -2953,7 +2953,7 @@
2953
2953
  }), void 0);
2954
2954
  });
2955
2955
 
2956
- const _excluded$z = ["id", "title", "description", "position", "dismissAfter", "variant", "onClick", "onRemove", "isExternalOfAction", "onClickOfAction", "captionOfAction", "hrefOfAction"];
2956
+ const _excluded$A = ["id", "title", "description", "position", "dismissAfter", "variant", "onClick", "onRemove", "isExternalOfAction", "onClickOfAction", "captionOfAction", "hrefOfAction"];
2957
2957
  var _jsxFileName$10 = "/Users/apple/Documents/project/majoo/majoo-ui/packages/react/src/components/toast/Toast.js";
2958
2958
  const TOAST_WIDTH = 576;
2959
2959
  const ANIMATION_DURATION = 400;
@@ -3121,7 +3121,7 @@
3121
3121
  captionOfAction,
3122
3122
  hrefOfAction
3123
3123
  } = _ref,
3124
- rest = _objectWithoutPropertiesLoose(_ref, _excluded$z);
3124
+ rest = _objectWithoutPropertiesLoose(_ref, _excluded$A);
3125
3125
  const [isOpen, setIsOpen] = React__namespace.useState(false);
3126
3126
  const close = React__namespace.useCallback(() => {
3127
3127
  setIsOpen(false);
@@ -3301,6 +3301,7 @@
3301
3301
 
3302
3302
  const ToastContext = /*#__PURE__*/React__namespace.createContext({});
3303
3303
 
3304
+ const _excluded$z = ["preventDuplicate"];
3304
3305
  var _jsxFileName$$ = "/Users/apple/Documents/project/majoo/majoo-ui/packages/react/src/components/toast/ToastContainer.js";
3305
3306
  const ToastBox = styled(Flex$1, {
3306
3307
  position: 'fixed',
@@ -3360,15 +3361,19 @@
3360
3361
  lineNumber: 44,
3361
3362
  columnNumber: 7
3362
3363
  }
3363
- }, toasts.map(toast => {
3364
+ }, toasts.map((item, index) => {
3365
+ const {
3366
+ preventDuplicate
3367
+ } = item,
3368
+ toast = _objectWithoutPropertiesLoose(item, _excluded$z);
3364
3369
  return /*#__PURE__*/React__namespace.createElement(Toast, _extends({
3365
- key: toast.id,
3370
+ key: preventDuplicate ? toast.id : `${toast.id}-${index}`,
3366
3371
  onRemove: () => removeToast(toast.id)
3367
3372
  }, toast, {
3368
3373
  __self: undefined,
3369
3374
  __source: {
3370
3375
  fileName: _jsxFileName$$,
3371
- lineNumber: 46,
3376
+ lineNumber: 47,
3372
3377
  columnNumber: 18
3373
3378
  }
3374
3379
  }));
@@ -3398,9 +3403,12 @@
3398
3403
  };
3399
3404
  const addToast = React__namespace.useCallback(toast => {
3400
3405
  const toastInstance = createToastInstance(toast);
3401
- if (!toasts.some(currToast => toast.id === currToast.id) || !toast.preventDuplicate) {
3402
- setToasts(toastItems => [...toastItems, toastInstance]);
3403
- }
3406
+ setToasts(toastItems => {
3407
+ if (!toastItems.some(currToast => toast.id === currToast.id) || !toast.preventDuplicate) {
3408
+ return [...toastItems, toastInstance];
3409
+ }
3410
+ return toastItems;
3411
+ });
3404
3412
  return toastInstance;
3405
3413
  }, [toasts, setToasts]);
3406
3414
  const removeToast = React__namespace.useCallback(id => {
@@ -3414,7 +3422,7 @@
3414
3422
  __self: undefined,
3415
3423
  __source: {
3416
3424
  fileName: _jsxFileName$_,
3417
- lineNumber: 43,
3425
+ lineNumber: 47,
3418
3426
  columnNumber: 5
3419
3427
  }
3420
3428
  }, children, /*#__PURE__*/React__namespace.createElement(ToastContainer, {
@@ -3423,7 +3431,7 @@
3423
3431
  __self: undefined,
3424
3432
  __source: {
3425
3433
  fileName: _jsxFileName$_,
3426
- lineNumber: 45,
3434
+ lineNumber: 49,
3427
3435
  columnNumber: 7
3428
3436
  }
3429
3437
  }), /*#__PURE__*/React__namespace.createElement(ToastContainer, {
@@ -3432,7 +3440,7 @@
3432
3440
  __self: undefined,
3433
3441
  __source: {
3434
3442
  fileName: _jsxFileName$_,
3435
- lineNumber: 49,
3443
+ lineNumber: 53,
3436
3444
  columnNumber: 7
3437
3445
  }
3438
3446
  }), /*#__PURE__*/React__namespace.createElement(ToastContainer, {
@@ -3441,7 +3449,7 @@
3441
3449
  __self: undefined,
3442
3450
  __source: {
3443
3451
  fileName: _jsxFileName$_,
3444
- lineNumber: 53,
3452
+ lineNumber: 57,
3445
3453
  columnNumber: 7
3446
3454
  }
3447
3455
  }), /*#__PURE__*/React__namespace.createElement(ToastContainer, {
@@ -3450,7 +3458,7 @@
3450
3458
  __self: undefined,
3451
3459
  __source: {
3452
3460
  fileName: _jsxFileName$_,
3453
- lineNumber: 57,
3461
+ lineNumber: 61,
3454
3462
  columnNumber: 7
3455
3463
  }
3456
3464
  }));
@@ -10041,7 +10049,7 @@
10041
10049
  const OptionWrapper$1 = styled('div', {
10042
10050
  display: 'none',
10043
10051
  overflow: 'hidden',
10044
- zIndex: 1,
10052
+ zIndex: 12,
10045
10053
  borderRadius: '$sm',
10046
10054
  backgroundColor: '$bgWhite',
10047
10055
  boxShadow: '0px 2px 12px #00000014',
@@ -10644,78 +10652,82 @@
10644
10652
  lineNumber: 671,
10645
10653
  columnNumber: 13
10646
10654
  }
10647
- }), isOpen && items.map((item, index) => /*#__PURE__*/React__default["default"].createElement(ItemWrapper$1, _extends({
10648
- key: item.id
10649
- }, getItemProps({
10650
- item,
10651
- index: index,
10652
- disabled: item.isDisabled
10653
- }), {
10654
- css: {
10655
- backgroundColor: highlightedIndex === index ? '$bgGray' : 'white',
10656
- cursor: item.isDisabled ? 'not-allowed' : 'pointer',
10657
- color: item.isDisabled ? '$textDisable' : 'textPrimary'
10658
- },
10659
- __self: undefined,
10660
- __source: {
10661
- fileName: _jsxFileName$w,
10662
- lineNumber: 674,
10663
- columnNumber: 19
10664
- }
10665
- }), /*#__PURE__*/React__default["default"].createElement(IconWrapper, {
10666
- css: {
10667
- width: '16px',
10668
- height: '16px',
10669
- border: '1px solid $bgBorder',
10670
- cursor: item.isDisabled ? 'not-allowed' : 'pointer'
10671
- },
10672
- __self: undefined,
10673
- __source: {
10674
- fileName: _jsxFileName$w,
10675
- lineNumber: 687,
10676
- columnNumber: 21
10677
- }
10678
- }, item.isDisabled ? /*#__PURE__*/React__default["default"].createElement(CheckOutline, {
10679
- color: colors$5.iconDisable,
10680
- __self: undefined,
10681
- __source: {
10682
- fileName: _jsxFileName$w,
10683
- lineNumber: 696,
10684
- columnNumber: 25
10685
- }
10686
- }) : selectedValue.includes(item.id) && (item.isDisabled === false || item.isDisabled === undefined) && /*#__PURE__*/React__default["default"].createElement(CheckOutline, {
10687
- color: colors$5.iconGreen,
10688
- __self: undefined,
10689
- __source: {
10690
- fileName: _jsxFileName$w,
10691
- lineNumber: 700,
10692
- columnNumber: 27
10693
- }
10694
- }), showSelectAll && (item === null || item === void 0 ? void 0 : item.id) === '!all' && selectedValue !== null && selectedValue !== void 0 && selectedValue.length && (selectedValue === null || selectedValue === void 0 ? void 0 : selectedValue.length) < (items === null || items === void 0 ? void 0 : items.length) ? /*#__PURE__*/React__default["default"].createElement(IndeterminateFilled, {
10695
- __self: undefined,
10696
- __source: {
10697
- fileName: _jsxFileName$w,
10698
- lineNumber: 707,
10699
- columnNumber: 25
10700
- }
10701
- }, "-") : /*#__PURE__*/React__default["default"].createElement("div", {
10702
- __self: undefined,
10703
- __source: {
10704
- fileName: _jsxFileName$w,
10705
- lineNumber: 709,
10706
- columnNumber: 25
10707
- }
10708
- })), /*#__PURE__*/React__default["default"].createElement(Item$3, {
10709
- css: {
10710
- backgroundColor: 'unset'
10711
- },
10712
- __self: undefined,
10713
- __source: {
10714
- fileName: _jsxFileName$w,
10715
- lineNumber: 712,
10716
- columnNumber: 21
10717
- }
10718
- }, item.name)))) : /*#__PURE__*/React__default["default"].createElement(Option, _extends({
10655
+ }), isOpen && items.map((item, index) => {
10656
+ var _item$render;
10657
+ return /*#__PURE__*/React__default["default"].createElement(ItemWrapper$1, _extends({
10658
+ key: item.id
10659
+ }, getItemProps({
10660
+ item,
10661
+ index: index,
10662
+ disabled: item.isDisabled
10663
+ }), {
10664
+ css: {
10665
+ backgroundColor: highlightedIndex === index ? '$bgGray' : 'white',
10666
+ cursor: item.isDisabled ? 'not-allowed' : 'pointer',
10667
+ color: item.isDisabled ? '$textDisable' : 'textPrimary'
10668
+ },
10669
+ __self: undefined,
10670
+ __source: {
10671
+ fileName: _jsxFileName$w,
10672
+ lineNumber: 674,
10673
+ columnNumber: 19
10674
+ }
10675
+ }), /*#__PURE__*/React__default["default"].createElement(IconWrapper, {
10676
+ css: {
10677
+ width: '16px',
10678
+ height: '16px',
10679
+ border: '1px solid $bgBorder',
10680
+ cursor: item.isDisabled ? 'not-allowed' : 'pointer'
10681
+ },
10682
+ __self: undefined,
10683
+ __source: {
10684
+ fileName: _jsxFileName$w,
10685
+ lineNumber: 687,
10686
+ columnNumber: 21
10687
+ }
10688
+ }, item.isDisabled ? /*#__PURE__*/React__default["default"].createElement(CheckOutline, {
10689
+ color: colors$5.iconDisable,
10690
+ __self: undefined,
10691
+ __source: {
10692
+ fileName: _jsxFileName$w,
10693
+ lineNumber: 696,
10694
+ columnNumber: 25
10695
+ }
10696
+ }) : selectedValue.includes(item.id) && (item.isDisabled === false || item.isDisabled === undefined) && /*#__PURE__*/React__default["default"].createElement(CheckOutline, {
10697
+ color: colors$5.iconGreen,
10698
+ __self: undefined,
10699
+ __source: {
10700
+ fileName: _jsxFileName$w,
10701
+ lineNumber: 700,
10702
+ columnNumber: 27
10703
+ }
10704
+ }), showSelectAll && (item === null || item === void 0 ? void 0 : item.id) === '!all' && selectedValue !== null && selectedValue !== void 0 && selectedValue.length && (selectedValue === null || selectedValue === void 0 ? void 0 : selectedValue.length) < (items === null || items === void 0 ? void 0 : items.length) ? /*#__PURE__*/React__default["default"].createElement(IndeterminateFilled, {
10705
+ __self: undefined,
10706
+ __source: {
10707
+ fileName: _jsxFileName$w,
10708
+ lineNumber: 707,
10709
+ columnNumber: 25
10710
+ }
10711
+ }, "-") : /*#__PURE__*/React__default["default"].createElement("div", {
10712
+ __self: undefined,
10713
+ __source: {
10714
+ fileName: _jsxFileName$w,
10715
+ lineNumber: 709,
10716
+ columnNumber: 25
10717
+ }
10718
+ })), /*#__PURE__*/React__default["default"].createElement(Item$3, {
10719
+ css: {
10720
+ backgroundColor: 'unset',
10721
+ width: '100%'
10722
+ },
10723
+ __self: undefined,
10724
+ __source: {
10725
+ fileName: _jsxFileName$w,
10726
+ lineNumber: 712,
10727
+ columnNumber: 21
10728
+ }
10729
+ }, item.render ? (_item$render = item.render) === null || _item$render === void 0 ? void 0 : _item$render.call(item, item.name) : item.name));
10730
+ })) : /*#__PURE__*/React__default["default"].createElement(Option, _extends({
10719
10731
  css: {
10720
10732
  height: 'auto'
10721
10733
  }
@@ -10725,14 +10737,14 @@
10725
10737
  __self: undefined,
10726
10738
  __source: {
10727
10739
  fileName: _jsxFileName$w,
10728
- lineNumber: 717,
10740
+ lineNumber: 719,
10729
10741
  columnNumber: 13
10730
10742
  }
10731
10743
  }), /*#__PURE__*/React__default["default"].createElement(StyledDiv, {
10732
10744
  __self: undefined,
10733
10745
  __source: {
10734
10746
  fileName: _jsxFileName$w,
10735
- lineNumber: 718,
10747
+ lineNumber: 720,
10736
10748
  columnNumber: 15
10737
10749
  }
10738
10750
  }, /*#__PURE__*/React__default["default"].createElement("div", {
@@ -10742,7 +10754,7 @@
10742
10754
  __self: undefined,
10743
10755
  __source: {
10744
10756
  fileName: _jsxFileName$w,
10745
- lineNumber: 719,
10757
+ lineNumber: 721,
10746
10758
  columnNumber: 17
10747
10759
  }
10748
10760
  }, /*#__PURE__*/React__default["default"].createElement(icons.CircleInfoOutline, {
@@ -10754,7 +10766,7 @@
10754
10766
  __self: undefined,
10755
10767
  __source: {
10756
10768
  fileName: _jsxFileName$w,
10757
- lineNumber: 720,
10769
+ lineNumber: 722,
10758
10770
  columnNumber: 19
10759
10771
  }
10760
10772
  })), textEmptyItem != null ? textEmptyItem : t('emptyItemText', 'Item tidak ditemukan')))));
@@ -18990,7 +19002,14 @@
18990
19002
  maxWidth: '100%',
18991
19003
  position: 'relative',
18992
19004
  height: '100%',
18993
- overflow: 'auto'
19005
+ overflow: 'auto',
19006
+ variants: {
19007
+ decoration: {
19008
+ true: {
19009
+ overflow: 'unset'
19010
+ }
19011
+ }
19012
+ }
18994
19013
  });
18995
19014
  var TableContent$3 = styled('table', {
18996
19015
  width: '100%',
@@ -19016,12 +19035,8 @@
19016
19035
  hiddenHeader: {
19017
19036
  true: {
19018
19037
  opacity: 0,
19019
- '& > tr > th': {
19020
- height: '0px !important',
19021
- '& > div': {
19022
- marginTop: '-50px'
19023
- }
19024
- }
19038
+ zIndex: -100,
19039
+ border: 'none'
19025
19040
  }
19026
19041
  }
19027
19042
  }
@@ -19551,6 +19566,114 @@
19551
19566
  })
19552
19567
  }), void 0);
19553
19568
  };
19569
+ var renderRowDecorationReference = function renderRowDecorationReference(row, isContextMenu, i) {
19570
+ return jsxRuntime.jsx(TableRow$3, __assign({
19571
+ css: {
19572
+ display: 'none'
19573
+ }
19574
+ }, row.getRowProps(), {
19575
+ children: row.cells.filter(function (cell) {
19576
+ return !cell.column.isSubRow;
19577
+ }).map(function (cell) {
19578
+ var _a, _b;
19579
+ var collId = (_a = cell === null || cell === void 0 ? void 0 : cell.column) === null || _a === void 0 ? void 0 : _a.id;
19580
+ var exceptionId = (_b = ['expander', 'selection', 'menu', 'eye'].concat(additionalExceptionIds)) === null || _b === void 0 ? void 0 : _b.includes(collId);
19581
+ return jsxRuntime.jsx(TableCell$3, __assign({}, cell.getCellProps(addOnCellStyle(cell.column.id)), {
19582
+ css: __assign(__assign({
19583
+ padding: !isContextMenu || exceptionId ? collId === 'expander' ? '20px 4px' : '20px 8px' : '',
19584
+ verticalAlign: cell.column.accessor ? cellAlign : 'center',
19585
+ cursor: onRowClick ? 'pointer' : 'unset'
19586
+ }, stickyPositionStyling(cell.column)), stickyShadowStyling(cell.column, tableScrollPosition, scrollAreaWidth)),
19587
+ onClick: function () {
19588
+ if (!exceptionId) {
19589
+ handleRowClick(row, i);
19590
+ }
19591
+ }
19592
+ }, {
19593
+ children: jsxRuntime.jsx(ConditionalWrapper, __assign({
19594
+ condition: isContextMenu && !exceptionId,
19595
+ wrapper: function (children) {
19596
+ return jsxRuntime.jsx(ContextMenuTrigger, __assign({
19597
+ id: "context-menu-table",
19598
+ triggerSide: "left"
19599
+ }, {
19600
+ children: jsxRuntime.jsx(Box, __assign({
19601
+ css: {
19602
+ cursor: 'pointer',
19603
+ padding: cell.column.accessor ? '20px 8px' : '20px 20px'
19604
+ },
19605
+ onClick: function () {
19606
+ return handleRowClick(row, i);
19607
+ }
19608
+ }, {
19609
+ children: children
19610
+ }), void 0)
19611
+ }), void 0);
19612
+ }
19613
+ }, {
19614
+ children: cell.render('Cell')
19615
+ }), void 0)
19616
+ }), void 0);
19617
+ })
19618
+ }), void 0);
19619
+ };
19620
+ var renderTableDecorationChild = function renderTableDecorationChild(child) {
19621
+ return jsxRuntime.jsxs(TableContent$3, {
19622
+ children: [jsxRuntime.jsx(TableHead$3, __assign({
19623
+ css: {
19624
+ '& > tr > th': {
19625
+ height: '0px !important',
19626
+ '& > div': {
19627
+ marginTop: '-50px'
19628
+ }
19629
+ }
19630
+ },
19631
+ hiddenHeader: true,
19632
+ isInfiniteScroll: isInfiniteScroll
19633
+ }, {
19634
+ children: headerGroups.map(function (headerGroup) {
19635
+ var visibleHeaders = headerGroup.headers.filter(function (column) {
19636
+ return !column.isSubRow;
19637
+ });
19638
+ return jsxRuntime.jsx(TableHeadRow$3, __assign({}, headerGroup.getHeaderGroupProps(), {
19639
+ children: visibleHeaders.map(function (column, index) {
19640
+ var headerRender = column.render('Header');
19641
+ return jsxRuntime.jsx(TableHeadCell$3, __assign({}, column.getHeaderProps(function (props) {
19642
+ return [props, !column.unsortable ? column.getSortByToggleProps({
19643
+ title: t('sortColumnTitle', 'Urutkan') || 'Urutkan'
19644
+ }) : {
19645
+ onClick: column.onToggle
19646
+ }, {
19647
+ style: {
19648
+ width: column.colWidth,
19649
+ maxWidth: column.colMaxWidth,
19650
+ minWidth: column.colMinWidth
19651
+ }
19652
+ }];
19653
+ }), {
19654
+ css: __assign(__assign(__assign({}, stickyPositionStyling(column)), stickyShadowStyling(column, tableScrollPosition, scrollAreaWidth)), column.headerCss)
19655
+ }, {
19656
+ children: typeof headerRender === 'string' ? jsxRuntime.jsx(TableHeaderCellContainer, __assign({
19657
+ isSortedDesc: column.isSortedDesc,
19658
+ unsortable: column.unsortable,
19659
+ isToggleable: !!column.onToggle,
19660
+ isToggled: column.isToggled
19661
+ }, {
19662
+ children: jsxRuntime.jsx(TableHeadCellContent, __assign({
19663
+ heading: "headerTable"
19664
+ }, {
19665
+ children: headerRender.toUpperCase()
19666
+ }), void 0)
19667
+ }), void 0) : headerRender
19668
+ }), void 0);
19669
+ })
19670
+ }), void 0);
19671
+ })
19672
+ }), void 0), jsxRuntime.jsx(TableBody$3, __assign({}, getTableBodyProps(), {
19673
+ children: child
19674
+ }), void 0)]
19675
+ }, void 0);
19676
+ };
19554
19677
  var handleRowClick = function handleRowClick(row, i) {
19555
19678
  var _a, _b, _c, _d;
19556
19679
  var clickable = false;
@@ -19645,6 +19768,7 @@
19645
19768
  children: [jsxRuntime.jsxs(TableContainer$3, __assign({
19646
19769
  css: css,
19647
19770
  ref: scrollerRef,
19771
+ decoration: Boolean(decoration),
19648
19772
  onScroll: function (e) {
19649
19773
  var scrollPosition = e.currentTarget.scrollLeft;
19650
19774
  if (scrollPosition < 3) {
@@ -19701,126 +19825,160 @@
19701
19825
  }), void 0);
19702
19826
  })
19703
19827
  }), void 0), jsxRuntime.jsxs(TableBody$3, __assign({}, getTableBodyProps(), {
19704
- children: [(_b = decoration === null || decoration === void 0 ? void 0 : decoration.headerRender) === null || _b === void 0 ? void 0 : _b.call(decoration), page.map(function (row, i) {
19705
- var _a, _b;
19828
+ children: [(_b = decoration === null || decoration === void 0 ? void 0 : decoration.headerRender) === null || _b === void 0 ? void 0 : _b.call(decoration), decoration && page.map(function (row, i) {
19829
+ var _a;
19706
19830
  prepareRow(row);
19707
- var subRowCells = row.cells.filter(function (cell) {
19708
- return cell.column.isSubRow;
19709
- });
19710
- var leftAddOnCells = (_a = row.cells.filter(function (cell) {
19711
- return ['expander', 'selection'].includes(cell.column.id);
19712
- })) !== null && _a !== void 0 ? _a : [];
19713
- var notNullHeaderColumns = visibleColumns.filter(function (column) {
19714
- return typeof column.Header !== 'function' && column.Header !== null && !column.isSubRow;
19715
- });
19716
- var isContextMenu = (_b = row.cells.filter(function (cell) {
19831
+ var isContextMenu = (_a = row.cells.filter(function (cell) {
19717
19832
  var _a, _b;
19718
19833
  return (_b = (_a = cell.column) === null || _a === void 0 ? void 0 : _a.options) === null || _b === void 0 ? void 0 : _b.length;
19719
- })) === null || _b === void 0 ? void 0 : _b.length;
19720
- var customStyle = {};
19721
- if (customRowsStyle && customRowsStyle(row.original).length) {
19722
- for (var i_2 = 0; i_2 < customRowsStyle(row.original).length; i_2++) {
19723
- if (customRowsStyle(row.original)[i_2].predicate) {
19724
- customStyle = customRowsStyle(row.original)[i_2].css;
19834
+ })) === null || _a === void 0 ? void 0 : _a.length;
19835
+ return i < 1 && renderRowDecorationReference(row, isContextMenu, i);
19836
+ }), jsxRuntime.jsx(ConditionalWrapper, __assign({
19837
+ condition: Boolean(decoration),
19838
+ wrapper: function (child) {
19839
+ return jsxRuntime.jsx(TableRow$3, __assign({
19840
+ css: {
19841
+ '&:hover': {
19842
+ backgroundColor: 'unset'
19843
+ }
19725
19844
  }
19726
- }
19727
- }
19728
- return jsxRuntime.jsxs(React__namespace.Fragment, {
19729
- children: [((rowGroup === null || rowGroup === void 0 ? void 0 : rowGroup.showGroupingWhenSorted) || sortBy.length <= 0) && row.original['isTopChild'] && ((rowGroup === null || rowGroup === void 0 ? void 0 : rowGroup.headerRender) ? rowGroup === null || rowGroup === void 0 ? void 0 : rowGroup.headerRender(row) : jsxRuntime.jsx(Text$1, __assign({
19730
- variant: "contentButton"
19731
19845
  }, {
19732
- children: row.cells[0].render('Cell')
19733
- }), void 0)), jsxRuntime.jsx(TableRow$3, __assign({
19734
- css: customStyle
19735
- }, row.getRowProps(), {
19736
- children: row.cells.filter(function (cell) {
19737
- return !cell.column.isSubRow;
19738
- }).map(function (cell) {
19739
- var _a, _b;
19740
- var collId = (_a = cell === null || cell === void 0 ? void 0 : cell.column) === null || _a === void 0 ? void 0 : _a.id;
19741
- var exceptionId = (_b = ['expander', 'selection', 'menu', 'eye'].concat(additionalExceptionIds)) === null || _b === void 0 ? void 0 : _b.includes(collId);
19742
- return jsxRuntime.jsx(TableCell$3, __assign({}, cell.getCellProps(addOnCellStyle(cell.column.id)), {
19743
- css: __assign(__assign({
19744
- padding: !isContextMenu || exceptionId ? collId === 'expander' ? '20px 4px' : '20px 8px' : '',
19745
- verticalAlign: cell.column.accessor ? cellAlign : 'center',
19746
- cursor: onRowClick ? 'pointer' : 'unset'
19747
- }, stickyPositionStyling(cell.column)), stickyShadowStyling(cell.column, tableScrollPosition, scrollAreaWidth)),
19748
- onClick: function () {
19749
- if (!exceptionId) {
19750
- handleRowClick(row, i);
19751
- }
19846
+ children: jsxRuntime.jsx(TableCell$3, __assign({
19847
+ colSpan: 12
19848
+ }, {
19849
+ children: jsxRuntime.jsx(Box, __assign({
19850
+ css: {
19851
+ height: 300,
19852
+ overflow: 'auto'
19752
19853
  }
19753
19854
  }, {
19754
- children: jsxRuntime.jsx(ConditionalWrapper, __assign({
19755
- condition: isContextMenu && !exceptionId,
19756
- wrapper: function (children) {
19757
- return jsxRuntime.jsx(ContextMenuTrigger, __assign({
19758
- id: "context-menu-table",
19759
- triggerSide: "left"
19760
- }, {
19761
- children: jsxRuntime.jsx(Box, __assign({
19762
- css: {
19763
- cursor: 'pointer',
19764
- padding: cell.column.accessor ? '20px 8px' : '20px 20px'
19765
- },
19766
- onClick: function () {
19767
- return handleRowClick(row, i);
19768
- }
19769
- }, {
19770
- children: children
19771
- }), void 0)
19772
- }), void 0);
19773
- }
19774
- }, {
19775
- children: cell.render('Cell')
19776
- }), void 0)
19777
- }), void 0);
19778
- })
19779
- }), void 0), row.isExpanded ? subRowCells.map(function (cell, index) {
19780
- return jsxRuntime.jsxs(TableRow$3, __assign({
19781
- subRow: true
19855
+ children: renderInfiniteScrollWrapper(renderTableDecorationChild(child))
19856
+ }), void 0)
19857
+ }), void 0)
19858
+ }), void 0);
19859
+ }
19860
+ }, {
19861
+ children: page.map(function (row, i) {
19862
+ var _a, _b;
19863
+ prepareRow(row);
19864
+ var subRowCells = row.cells.filter(function (cell) {
19865
+ return cell.column.isSubRow;
19866
+ });
19867
+ var leftAddOnCells = (_a = row.cells.filter(function (cell) {
19868
+ return ['expander', 'selection'].includes(cell.column.id);
19869
+ })) !== null && _a !== void 0 ? _a : [];
19870
+ var notNullHeaderColumns = visibleColumns.filter(function (column) {
19871
+ return typeof column.Header !== 'function' && column.Header !== null && !column.isSubRow;
19872
+ });
19873
+ var isContextMenu = (_b = row.cells.filter(function (cell) {
19874
+ var _a, _b;
19875
+ return (_b = (_a = cell.column) === null || _a === void 0 ? void 0 : _a.options) === null || _b === void 0 ? void 0 : _b.length;
19876
+ })) === null || _b === void 0 ? void 0 : _b.length;
19877
+ var customStyle = {};
19878
+ if (customRowsStyle && customRowsStyle(row.original).length) {
19879
+ for (var i_2 = 0; i_2 < customRowsStyle(row.original).length; i_2++) {
19880
+ if (customRowsStyle(row.original)[i_2].predicate) {
19881
+ customStyle = customRowsStyle(row.original)[i_2].css;
19882
+ }
19883
+ }
19884
+ }
19885
+ return jsxRuntime.jsxs(React__namespace.Fragment, {
19886
+ children: [((rowGroup === null || rowGroup === void 0 ? void 0 : rowGroup.showGroupingWhenSorted) || sortBy.length <= 0) && row.original['isTopChild'] && ((rowGroup === null || rowGroup === void 0 ? void 0 : rowGroup.headerRender) ? rowGroup === null || rowGroup === void 0 ? void 0 : rowGroup.headerRender(row) : jsxRuntime.jsx(Text$1, __assign({
19887
+ variant: "contentButton"
19782
19888
  }, {
19783
- children: [leftAddOnCells.map(function (_, index) {
19784
- return jsxRuntime.jsx("td", {
19785
- style: {
19786
- backgroundColor: colors$5.bgGray
19787
- }
19788
- }, index);
19789
- }), jsxRuntime.jsxs(React__namespace.Fragment, {
19790
- children: [jsxRuntime.jsx(TableCell$3, __assign({
19791
- subCell: true,
19792
- colSpan: notNullHeaderColumns.length > 5 ? 2 : 1,
19793
- headerSubCell: true,
19889
+ children: row.cells[0].render('Cell')
19890
+ }), void 0)), jsxRuntime.jsx(TableRow$3, __assign({
19891
+ css: customStyle
19892
+ }, row.getRowProps(), {
19893
+ children: row.cells.filter(function (cell) {
19894
+ return !cell.column.isSubRow;
19895
+ }).map(function (cell) {
19896
+ var _a, _b;
19897
+ var collId = (_a = cell === null || cell === void 0 ? void 0 : cell.column) === null || _a === void 0 ? void 0 : _a.id;
19898
+ var exceptionId = (_b = ['expander', 'selection', 'menu', 'eye'].concat(additionalExceptionIds)) === null || _b === void 0 ? void 0 : _b.includes(collId);
19899
+ return jsxRuntime.jsx(TableCell$3, __assign({}, cell.getCellProps(addOnCellStyle(cell.column.id)), {
19794
19900
  css: __assign(__assign({
19795
- paddingTop: "".concat(index === 0 ? '24px' : '13px', " !important"),
19796
- paddingBottom: "".concat(index === subRowCells.length - 1 ? '24px' : '13px', " !important"),
19797
- backgroundColor: '$bgGray'
19798
- }, stickyPositionStyling(cell.column)), cell.column.headerCss)
19799
- }, {
19800
- children: jsxRuntime.jsx(Paragraph, __assign({
19801
- paragraph: "shortContentBold"
19802
- }, {
19803
- children: cell.column.Header
19804
- }), void 0)
19805
- }), void 0), jsxRuntime.jsx(TableCell$3, __assign({
19806
- subCell: true,
19807
- colSpan: visibleColumns.length - subRowCells.length,
19808
- css: {
19809
- paddingTop: "".concat(index === 0 ? '24px' : '13px', " !important"),
19810
- paddingBottom: "".concat(index === subRowCells.length - 1 ? '24px' : '13px', " !important")
19901
+ padding: !isContextMenu || exceptionId ? collId === 'expander' ? '20px 4px' : '20px 8px' : '',
19902
+ verticalAlign: cell.column.accessor ? cellAlign : 'center',
19903
+ cursor: onRowClick ? 'pointer' : 'unset'
19904
+ }, stickyPositionStyling(cell.column)), stickyShadowStyling(cell.column, tableScrollPosition, scrollAreaWidth)),
19905
+ onClick: function () {
19906
+ if (!exceptionId) {
19907
+ handleRowClick(row, i);
19908
+ }
19811
19909
  }
19812
19910
  }, {
19813
- children: jsxRuntime.jsx(Paragraph, __assign({
19814
- paragraph: "shortContentRegular"
19911
+ children: jsxRuntime.jsx(ConditionalWrapper, __assign({
19912
+ condition: isContextMenu && !exceptionId,
19913
+ wrapper: function (children) {
19914
+ return jsxRuntime.jsx(ContextMenuTrigger, __assign({
19915
+ id: "context-menu-table",
19916
+ triggerSide: "left"
19917
+ }, {
19918
+ children: jsxRuntime.jsx(Box, __assign({
19919
+ css: {
19920
+ cursor: 'pointer',
19921
+ padding: cell.column.accessor ? '20px 8px' : '20px 20px'
19922
+ },
19923
+ onClick: function () {
19924
+ return handleRowClick(row, i);
19925
+ }
19926
+ }, {
19927
+ children: children
19928
+ }), void 0)
19929
+ }), void 0);
19930
+ }
19815
19931
  }, {
19816
19932
  children: cell.render('Cell')
19817
19933
  }), void 0)
19818
- }), void 0)]
19819
- }, cell.column.id)]
19820
- }), cell.column.id);
19821
- }) : null, ((rowGroup === null || rowGroup === void 0 ? void 0 : rowGroup.showGroupingWhenSorted) || sortBy.length <= 0) && row.original['isBottomChild'] && !!(rowGroup === null || rowGroup === void 0 ? void 0 : rowGroup.footerRender) && (rowGroup === null || rowGroup === void 0 ? void 0 : rowGroup.footerRender(row))]
19822
- }, row.id);
19823
- }), (_c = decoration === null || decoration === void 0 ? void 0 : decoration.footerRender) === null || _c === void 0 ? void 0 : _c.call(decoration)]
19934
+ }), void 0);
19935
+ })
19936
+ }), void 0), row.isExpanded ? subRowCells.map(function (cell, index) {
19937
+ return jsxRuntime.jsxs(TableRow$3, __assign({
19938
+ subRow: true
19939
+ }, {
19940
+ children: [leftAddOnCells.map(function (_, index) {
19941
+ return jsxRuntime.jsx("td", {
19942
+ style: {
19943
+ backgroundColor: colors$5.bgGray
19944
+ }
19945
+ }, index);
19946
+ }), jsxRuntime.jsxs(React__namespace.Fragment, {
19947
+ children: [jsxRuntime.jsx(TableCell$3, __assign({
19948
+ subCell: true,
19949
+ colSpan: notNullHeaderColumns.length > 5 ? 2 : 1,
19950
+ headerSubCell: true,
19951
+ css: __assign(__assign({
19952
+ paddingTop: "".concat(index === 0 ? '24px' : '13px', " !important"),
19953
+ paddingBottom: "".concat(index === subRowCells.length - 1 ? '24px' : '13px', " !important"),
19954
+ backgroundColor: '$bgGray'
19955
+ }, stickyPositionStyling(cell.column)), cell.column.headerCss)
19956
+ }, {
19957
+ children: jsxRuntime.jsx(Paragraph, __assign({
19958
+ paragraph: "shortContentBold"
19959
+ }, {
19960
+ children: cell.column.Header
19961
+ }), void 0)
19962
+ }), void 0), jsxRuntime.jsx(TableCell$3, __assign({
19963
+ subCell: true,
19964
+ colSpan: visibleColumns.length - subRowCells.length,
19965
+ css: {
19966
+ paddingTop: "".concat(index === 0 ? '24px' : '13px', " !important"),
19967
+ paddingBottom: "".concat(index === subRowCells.length - 1 ? '24px' : '13px', " !important")
19968
+ }
19969
+ }, {
19970
+ children: jsxRuntime.jsx(Paragraph, __assign({
19971
+ paragraph: "shortContentRegular"
19972
+ }, {
19973
+ children: cell.render('Cell')
19974
+ }), void 0)
19975
+ }), void 0)]
19976
+ }, cell.column.id)]
19977
+ }), cell.column.id);
19978
+ }) : null, ((rowGroup === null || rowGroup === void 0 ? void 0 : rowGroup.showGroupingWhenSorted) || sortBy.length <= 0) && row.original['isBottomChild'] && !!(rowGroup === null || rowGroup === void 0 ? void 0 : rowGroup.footerRender) && (rowGroup === null || rowGroup === void 0 ? void 0 : rowGroup.footerRender(row))]
19979
+ }, row.id);
19980
+ })
19981
+ }), void 0), (_c = decoration === null || decoration === void 0 ? void 0 : decoration.footerRender) === null || _c === void 0 ? void 0 : _c.call(decoration)]
19824
19982
  }), void 0)]
19825
19983
  }), void 0)), renderContextMenu()]
19826
19984
  }), void 0), !isInfiniteScroll && jsxRuntime.jsx(Box, __assign({