@majoo-ui/react 1.58.20-rc.3 → 1.58.20-rc.5

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/index.esm.js CHANGED
@@ -22565,25 +22565,6 @@ const cssAfter = {
22565
22565
  pointerEvents: 'none',
22566
22566
  boxSizing: 'border'
22567
22567
  };
22568
- const cssBtnCustom = {
22569
- position: 'sticky',
22570
- top: 0,
22571
- right: 0,
22572
- display: 'flex',
22573
- justifyContent: 'center',
22574
- alignItems: 'center',
22575
- '@sm': {
22576
- zIndex: 3
22577
- },
22578
- '@md': {
22579
- zIndex: 'unset'
22580
- },
22581
- backgroundColor: 'white',
22582
- '&::after': Object.assign(Object.assign({}, cssAfter), {
22583
- right: '50%',
22584
- boxShadow: 'inset -10px 0 10px -10px #00000026'
22585
- })
22586
- };
22587
22568
  const stickyShadowStyling = (column, tableScrollPosition, scrollAreaWidth) => {
22588
22569
  if ((column === null || column === void 0 ? void 0 : column.sticky) && (column === null || column === void 0 ? void 0 : column.shadow)) {
22589
22570
  return column.sticky === 'left' ? {
@@ -22716,7 +22697,7 @@ function HeaderMenuOption(props) {
22716
22697
  label: item.Header,
22717
22698
  value: item.id,
22718
22699
  disabled: index === 0
22719
- }, void 0), row.length !== index + 1 && jsx(Separator$2, {}, void 0)]
22700
+ }, index), row.length !== index + 1 && jsx(Separator$2, {}, void 0)]
22720
22701
  }, void 0))
22721
22702
  }), void 0)
22722
22703
  }), void 0)
@@ -22737,8 +22718,8 @@ function HeaderMenuOption(props) {
22737
22718
  portalled: true,
22738
22719
  isMobile: false,
22739
22720
  style: {
22740
- right: '100%',
22741
- left: 'unset'
22721
+ right: 20,
22722
+ left: null
22742
22723
  }
22743
22724
  }, {
22744
22725
  children: jsx(Flex$1, Object.assign({
@@ -22749,10 +22730,9 @@ function HeaderMenuOption(props) {
22749
22730
  boxShadow: '$medium',
22750
22731
  backgroundColor: 'white',
22751
22732
  maxHeight: 440,
22752
- height: rowData.length <= 5 ? 300 : 'fit-content',
22753
22733
  minWidth: 167,
22754
- width: 'fit-content',
22755
- overflowY: visibleHeaders.filter(val => typeof val.Header === 'string').length > 7 || rowData.length <= 5 ? 'scroll' : 'none'
22734
+ width: 'max-content',
22735
+ overflowY: visibleHeaders.filter(val => typeof val.Header === 'string').length > 7 ? 'scroll' : 'none'
22756
22736
  }
22757
22737
  }, {
22758
22738
  children: jsx(CheckboxGroup, Object.assign({
@@ -22766,7 +22746,7 @@ function HeaderMenuOption(props) {
22766
22746
  label: item.Header,
22767
22747
  value: item.id,
22768
22748
  disabled: index === 0
22769
- }, void 0), row.length !== index + 1 && jsx(Separator$2, {}, void 0)]
22749
+ }, index), row.length !== index + 1 && jsx(Separator$2, {}, void 0)]
22770
22750
  }, void 0))
22771
22751
  }), void 0)
22772
22752
  }), void 0)
@@ -22817,8 +22797,7 @@ function Table({
22817
22797
  searchQuery,
22818
22798
  additionalExceptionIds = [],
22819
22799
  onExpand,
22820
- id = null,
22821
- customizableColumn = null
22800
+ id = null
22822
22801
  }) {
22823
22802
  var _a, _b, _c, _d;
22824
22803
  const [openMenu, setOpen] = useState(false);
@@ -22827,7 +22806,7 @@ function Table({
22827
22806
  const [tableScrollPosition, setTableScrollPosition] = useState('start');
22828
22807
  const [scrollAreaWidth, setScrollAreaWidth] = useState(0);
22829
22808
  const [stateSelectedRowIds, setStateSelectedRowIds] = useState([]);
22830
- const [filterHeader, setFilterHeader] = useLocalStorageState(`menu:${customizableColumn}`, []);
22809
+ const [filterHeader, setFilterHeader] = useLocalStorageState(`menu:${id}`, []);
22831
22810
  const {
22832
22811
  t
22833
22812
  } = useTranslation('MajooUI/table');
@@ -23202,298 +23181,313 @@ function Table({
23202
23181
  }, {
23203
23182
  children: "Loading .... "
23204
23183
  }), void 0)
23205
- }), void 0), !isMobile || customizableColumn ? jsxs(Fragment, {
23206
- children: [jsxs(TableContainer$3, Object.assign({
23207
- css: css,
23208
- ref: scrollerRef,
23209
- decoration: Boolean(decoration),
23210
- onScroll: e => {
23211
- const scrollPosition = e.currentTarget.scrollLeft;
23212
- if (scrollPosition < 3) {
23213
- setTableScrollPosition('start');
23214
- } else if (scrollPosition > scrollAreaWidth - 3) {
23215
- setTableScrollPosition('end');
23216
- } else {
23217
- setTableScrollPosition('between');
23218
- }
23184
+ }), void 0), !isMobile || id ? jsxs(Fragment, {
23185
+ children: [jsxs(Box, Object.assign({
23186
+ css: {
23187
+ position: 'relative'
23219
23188
  }
23220
23189
  }, {
23221
- children: [jsx(ConditionalWrapper, Object.assign({
23222
- condition: !decoration,
23223
- wrapper: child => renderInfiniteScrollWrapper(child)
23190
+ children: [jsxs(TableContainer$3, Object.assign({
23191
+ id: "table-container",
23192
+ css: css,
23193
+ ref: scrollerRef,
23194
+ decoration: Boolean(decoration),
23195
+ onScroll: e => {
23196
+ const scrollPosition = e.currentTarget.scrollLeft;
23197
+ if (scrollPosition < 3) {
23198
+ setTableScrollPosition('start');
23199
+ } else if (scrollPosition > scrollAreaWidth - 3) {
23200
+ setTableScrollPosition('end');
23201
+ } else {
23202
+ setTableScrollPosition('between');
23203
+ }
23204
+ }
23224
23205
  }, {
23225
- children: jsxs(TableContent$3, Object.assign({}, getTableProps(), {
23226
- children: [jsx(TableHead$3, Object.assign({
23227
- hiddenHeader: hideHeader,
23228
- css: headerCss,
23229
- isInfiniteScroll: isInfiniteScroll
23230
- }, {
23231
- children: headerGroups.map(headerGroup => {
23232
- let visibleHeaders = headerGroup.headers.filter(column => !column.isSubRow);
23233
- if (filterHeader.length > 0) {
23234
- visibleHeaders = visibleHeaders.filter(item => filterHeader.includes(item.id));
23235
- }
23236
- return jsxs(TableHeadRow$3, Object.assign({
23237
- css: cssTableCell
23238
- }, headerGroup.getHeaderGroupProps(), {
23239
- children: [visibleHeaders.map((column, index) => {
23240
- const headerRender = column.render('Header');
23241
- return jsx(TableHeadCell$3, Object.assign({}, column.getHeaderProps(props => [props, !column.unsortable ? column.getSortByToggleProps({
23242
- title: t('sortColumnTitle', 'Urutkan') || 'Urutkan'
23243
- }) : {
23244
- onClick: column.onToggle
23245
- }, {
23246
- style: {
23247
- width: column.colWidth,
23248
- maxWidth: column.colMaxWidth,
23249
- minWidth: column.colMinWidth
23250
- }
23251
- }]), {
23252
- css: Object.assign(Object.assign(Object.assign(Object.assign({}, cssTableCell), stickyPositionStyling(column)), stickyShadowStyling(column, tableScrollPosition, scrollAreaWidth)), column.headerCss)
23253
- }, {
23254
- children: typeof headerRender === 'string' ? jsx(TableHeaderCellContainer, Object.assign({
23255
- isSortedDesc: column.isSortedDesc,
23256
- unsortable: customizableColumn ? true : column.unsortable,
23257
- isToggleable: !!column.onToggle,
23258
- isToggled: column.isToggled
23206
+ children: [jsx(ConditionalWrapper, Object.assign({
23207
+ condition: !decoration,
23208
+ wrapper: child => renderInfiniteScrollWrapper(child)
23209
+ }, {
23210
+ children: jsxs(TableContent$3, Object.assign({}, getTableProps(), {
23211
+ children: [jsx(TableHead$3, Object.assign({
23212
+ hiddenHeader: hideHeader,
23213
+ css: headerCss,
23214
+ isInfiniteScroll: isInfiniteScroll
23215
+ }, {
23216
+ children: headerGroups.map(headerGroup => {
23217
+ let visibleHeaders = headerGroup.headers.filter(column => !column.isSubRow);
23218
+ if (filterHeader.length > 0) {
23219
+ visibleHeaders = visibleHeaders.filter(item => filterHeader.includes(item.id));
23220
+ }
23221
+ return jsx(TableHeadRow$3, Object.assign({
23222
+ css: cssTableCell
23223
+ }, headerGroup.getHeaderGroupProps(), {
23224
+ children: visibleHeaders.map((column, index) => {
23225
+ const headerRender = column.render('Header');
23226
+ return jsx(TableHeadCell$3, Object.assign({}, column.getHeaderProps(props => [props, !column.unsortable ? column.getSortByToggleProps({
23227
+ title: t('sortColumnTitle', 'Urutkan') || 'Urutkan'
23228
+ }) : {
23229
+ onClick: column.onToggle
23259
23230
  }, {
23260
- children: jsx(TableHeadCellContent, Object.assign({
23261
- heading: "headerTable"
23231
+ style: {
23232
+ width: column.colWidth,
23233
+ maxWidth: column.colMaxWidth,
23234
+ minWidth: column.colMinWidth
23235
+ }
23236
+ }]), {
23237
+ css: Object.assign(Object.assign(Object.assign(Object.assign({}, cssTableCell), stickyPositionStyling(column)), stickyShadowStyling(column, tableScrollPosition, scrollAreaWidth)), column.headerCss)
23238
+ }, {
23239
+ children: typeof headerRender === 'string' ? jsx(TableHeaderCellContainer, Object.assign({
23240
+ isSortedDesc: column.isSortedDesc,
23241
+ unsortable: id ? true : column.unsortable,
23242
+ isToggleable: !!column.onToggle,
23243
+ isToggled: column.isToggled
23262
23244
  }, {
23263
- children: headerRender.toUpperCase()
23264
- }), void 0)
23265
- }), void 0) : headerRender
23266
- }), void 0);
23267
- }), customizableColumn && jsx(TableHeadCell$3, Object.assign({
23268
- css: cssBtnCustom
23245
+ children: jsx(TableHeadCellContent, Object.assign({
23246
+ heading: "headerTable"
23247
+ }, {
23248
+ children: headerRender.toUpperCase()
23249
+ }), void 0)
23250
+ }), void 0) : headerRender
23251
+ }), void 0);
23252
+ })
23253
+ }), void 0);
23254
+ })
23255
+ }), void 0), jsxs(TableBody$3, Object.assign({}, getTableBodyProps(), {
23256
+ children: [isInfiniteScroll && paddingTop > 0 && jsx("tr", {
23257
+ children: jsx("td", {
23258
+ style: {
23259
+ height: `${paddingTop}px`
23260
+ }
23261
+ }, void 0)
23262
+ }, void 0), (_c = decoration === null || decoration === void 0 ? void 0 : decoration.headerRender) === null || _c === void 0 ? void 0 : _c.call(decoration), decoration && page.map((row, i) => {
23263
+ var _a;
23264
+ prepareRow(row);
23265
+ const isContextMenu = (_a = row.cells.filter(cell => {
23266
+ var _a, _b;
23267
+ return (_b = (_a = cell.column) === null || _a === void 0 ? void 0 : _a.options) === null || _b === void 0 ? void 0 : _b.length;
23268
+ })) === null || _a === void 0 ? void 0 : _a.length;
23269
+ return i < 1 && renderRowDecorationReference(row, isContextMenu, i);
23270
+ }), jsx(ConditionalWrapper, Object.assign({
23271
+ condition: Boolean(decoration),
23272
+ wrapper: child => jsx(TableRow$3, Object.assign({
23273
+ css: {
23274
+ '&:hover': {
23275
+ backgroundColor: 'unset'
23276
+ }
23277
+ }
23269
23278
  }, {
23270
- children: jsx(HeaderMenuOption, Object.assign({
23271
- rowData: tableRowData,
23272
- open: openMenu,
23273
- id: customizableColumn,
23274
- onOpenChange: setOpen,
23275
- onChange: useCallback(items => {
23276
- setFilterHeader(items);
23277
- }, [filterHeader]),
23278
- headerGroups: headerGroups,
23279
- filterHeader: filterHeader
23279
+ children: jsx(TableCell$3, Object.assign({
23280
+ colSpan: (decoration === null || decoration === void 0 ? void 0 : decoration.colSpan) || 12
23280
23281
  }, {
23281
- children: jsx(IconButton, Object.assign({
23282
- css: {
23283
- '&:hover': {
23284
- backgroundColor: 'unset'
23285
- },
23286
- backgroundColor: '#c0c4c4',
23287
- padding: 0,
23288
- boxShadow: '0px 22px 43px 0px rgba(0, 0, 0, 0.08), 0px 9px 24px 0px rgba(0, 0, 0, 0.09), 0px 3px 9px 0px rgba(0, 0, 0, 0.13)'
23289
- },
23290
- onClick: () => setOpen(!openMenu),
23291
- buttonType: "secondary"
23282
+ children: jsx(Box, Object.assign({
23283
+ css: Object.assign({
23284
+ height: 300,
23285
+ overflow: 'auto'
23286
+ }, decoration === null || decoration === void 0 ? void 0 : decoration.css)
23292
23287
  }, {
23293
- children: jsx(PlusPrimitive, {
23294
- size: "20"
23295
- }, void 0)
23288
+ children: renderInfiniteScrollWrapper(renderTableDecorationChild(child))
23296
23289
  }), void 0)
23297
23290
  }), void 0)
23298
- }), void 0)]
23299
- }), void 0);
23300
- })
23301
- }), void 0), jsxs(TableBody$3, Object.assign({}, getTableBodyProps(), {
23302
- children: [isInfiniteScroll && paddingTop > 0 && jsx("tr", {
23303
- children: jsx("td", {
23304
- style: {
23305
- height: `${paddingTop}px`
23306
- }
23307
- }, void 0)
23308
- }, void 0), (_c = decoration === null || decoration === void 0 ? void 0 : decoration.headerRender) === null || _c === void 0 ? void 0 : _c.call(decoration), decoration && page.map((row, i) => {
23309
- var _a;
23310
- prepareRow(row);
23311
- const isContextMenu = (_a = row.cells.filter(cell => {
23312
- var _a, _b;
23313
- return (_b = (_a = cell.column) === null || _a === void 0 ? void 0 : _a.options) === null || _b === void 0 ? void 0 : _b.length;
23314
- })) === null || _a === void 0 ? void 0 : _a.length;
23315
- return i < 1 && renderRowDecorationReference(row, isContextMenu, i);
23316
- }), jsx(ConditionalWrapper, Object.assign({
23317
- condition: Boolean(decoration),
23318
- wrapper: child => jsx(TableRow$3, Object.assign({
23319
- css: {
23320
- '&:hover': {
23321
- backgroundColor: 'unset'
23322
- }
23323
- }
23324
- }, {
23325
- children: jsx(TableCell$3, Object.assign({
23326
- colSpan: (decoration === null || decoration === void 0 ? void 0 : decoration.colSpan) || 12
23327
- }, {
23328
- children: jsx(Box, Object.assign({
23329
- css: Object.assign({
23330
- height: 300,
23331
- overflow: 'auto'
23332
- }, decoration === null || decoration === void 0 ? void 0 : decoration.css)
23333
- }, {
23334
- children: renderInfiniteScrollWrapper(renderTableDecorationChild(child))
23335
- }), void 0)
23336
23291
  }), void 0)
23337
- }), void 0)
23338
- }, {
23339
- children: tableRowData.map((dataRow, i) => {
23340
- var _a, _b, _c, _d;
23341
- const row = isInfiniteScroll ? page === null || page === void 0 ? void 0 : page[dataRow === null || dataRow === void 0 ? void 0 : dataRow.index] : dataRow;
23342
- prepareRow(row);
23343
- const subRowCells = row.cells.filter(cell => cell.column.isSubRow);
23344
- const leftAddOnCells = (_a = row.cells.filter(cell => ['expander', 'multiple-expander', 'selection'].includes(cell.column.id))) !== null && _a !== void 0 ? _a : [];
23345
- const notNullHeaderColumns = visibleColumns.filter(column => typeof column.Header !== 'function' && column.Header !== null && !column.isSubRow);
23346
- let isContextMenu = Boolean((_b = row.cells.filter(cell => {
23347
- var _a, _b;
23348
- return (_b = (_a = cell.column) === null || _a === void 0 ? void 0 : _a.options) === null || _b === void 0 ? void 0 : _b.length;
23349
- })) === null || _b === void 0 ? void 0 : _b.length);
23350
- let customStyle = {};
23351
- let hideRowMenuColumn = false;
23352
- if (customRowsStyle && customRowsStyle(row.original).length) {
23353
- for (let _i2 = 0; _i2 < customRowsStyle(row.original).length; _i2++) {
23354
- if (customRowsStyle(row.original)[_i2].predicate) {
23355
- const customRowCss = (_c = customRowsStyle(row.original)[_i2]) === null || _c === void 0 ? void 0 : _c.css;
23356
- customStyle = customRowCss || {};
23357
- if ((_d = customRowsStyle(row.original)[_i2]) === null || _d === void 0 ? void 0 : _d.hideRowMenuColumn) {
23358
- isContextMenu = false;
23359
- hideRowMenuColumn = true;
23292
+ }, {
23293
+ children: tableRowData.map((dataRow, i) => {
23294
+ var _a, _b, _c, _d;
23295
+ const row = isInfiniteScroll ? page === null || page === void 0 ? void 0 : page[dataRow === null || dataRow === void 0 ? void 0 : dataRow.index] : dataRow;
23296
+ prepareRow(row);
23297
+ const subRowCells = row.cells.filter(cell => cell.column.isSubRow);
23298
+ const leftAddOnCells = (_a = row.cells.filter(cell => ['expander', 'multiple-expander', 'selection'].includes(cell.column.id))) !== null && _a !== void 0 ? _a : [];
23299
+ const notNullHeaderColumns = visibleColumns.filter(column => typeof column.Header !== 'function' && column.Header !== null && !column.isSubRow);
23300
+ let isContextMenu = Boolean((_b = row.cells.filter(cell => {
23301
+ var _a, _b;
23302
+ return (_b = (_a = cell.column) === null || _a === void 0 ? void 0 : _a.options) === null || _b === void 0 ? void 0 : _b.length;
23303
+ })) === null || _b === void 0 ? void 0 : _b.length);
23304
+ let customStyle = {};
23305
+ let hideRowMenuColumn = false;
23306
+ if (customRowsStyle && customRowsStyle(row.original).length) {
23307
+ for (let _i2 = 0; _i2 < customRowsStyle(row.original).length; _i2++) {
23308
+ if (customRowsStyle(row.original)[_i2].predicate) {
23309
+ const customRowCss = (_c = customRowsStyle(row.original)[_i2]) === null || _c === void 0 ? void 0 : _c.css;
23310
+ customStyle = customRowCss || {};
23311
+ if ((_d = customRowsStyle(row.original)[_i2]) === null || _d === void 0 ? void 0 : _d.hideRowMenuColumn) {
23312
+ isContextMenu = false;
23313
+ hideRowMenuColumn = true;
23314
+ }
23360
23315
  }
23361
23316
  }
23362
23317
  }
23363
- }
23364
- return jsxs(React.Fragment, {
23365
- 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, {
23366
- getCellProps: cellProps => ({
23367
- css: Object.assign(Object.assign(Object.assign({}, stickyPositionStyling({
23368
- sticky: cellProps === null || cellProps === void 0 ? void 0 : cellProps.sticky,
23369
- stickyPosition: cellProps === null || cellProps === void 0 ? void 0 : cellProps.stickyPosition
23370
- })), stickyShadowStyling({
23371
- sticky: cellProps === null || cellProps === void 0 ? void 0 : cellProps.sticky,
23372
- shadow: cellProps === null || cellProps === void 0 ? void 0 : cellProps.shadow
23373
- }, tableScrollPosition, scrollAreaWidth)), cellProps === null || cellProps === void 0 ? void 0 : cellProps.css)
23374
- })
23375
- }) : jsx(Text$1, Object.assign({
23376
- variant: "contentButton"
23377
- }, {
23378
- children: row.cells[0].render('Cell')
23379
- }), void 0)), jsxs(TableRow$3, Object.assign({
23380
- css: customStyle
23381
- }, row && row.getRowProps ? row.getRowProps() : {}, {
23382
- children: [row.cells.filter(cell => filterHeader.length > 0 ? filterHeader.includes(cell.column.id) : cell).filter(cell => !cell.column.isSubRow).map(cell => {
23383
- var _a, _b, _c;
23384
- let visibleHeaders = (_a = headerGroups === null || headerGroups === void 0 ? void 0 : headerGroups[0]) === null || _a === void 0 ? void 0 : _a.headers.filter(column => !column.isSubRow);
23385
- if (filterHeader.length > 0) {
23386
- visibleHeaders = visibleHeaders.filter(item => filterHeader.includes(item.id));
23387
- }
23388
- const collId = (_b = cell === null || cell === void 0 ? void 0 : cell.column) === null || _b === void 0 ? void 0 : _b.id;
23389
- const exceptionId = (_c = ['expander', 'multiple-expander', 'selection', 'menu', 'eye'].concat(additionalExceptionIds)) === null || _c === void 0 ? void 0 : _c.includes(collId);
23390
- return jsx(TableCell$3, Object.assign({}, cell.getCellProps(addOnCellStyle(cell.column.id)), {
23391
- css: Object.assign(Object.assign(Object.assign(Object.assign({}, cssTableCell), {
23392
- padding: !isContextMenu || exceptionId ? collId === 'expander' || collId === 'multiple-expander' ? '20px 4px' : '20px 8px' : '',
23393
- verticalAlign: cell.column.accessor ? cellAlign : 'center',
23394
- cursor: onRowClick ? 'pointer' : 'unset'
23395
- }), stickyPositionStyling(cell.column)), stickyShadowStyling(cell.column, tableScrollPosition, scrollAreaWidth)),
23396
- onClick: () => {
23397
- if (!exceptionId) {
23398
- handleRowClick(row, i);
23399
- }
23318
+ return jsxs(React.Fragment, {
23319
+ 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, {
23320
+ getCellProps: cellProps => ({
23321
+ css: Object.assign(Object.assign(Object.assign({}, stickyPositionStyling({
23322
+ sticky: cellProps === null || cellProps === void 0 ? void 0 : cellProps.sticky,
23323
+ stickyPosition: cellProps === null || cellProps === void 0 ? void 0 : cellProps.stickyPosition
23324
+ })), stickyShadowStyling({
23325
+ sticky: cellProps === null || cellProps === void 0 ? void 0 : cellProps.sticky,
23326
+ shadow: cellProps === null || cellProps === void 0 ? void 0 : cellProps.shadow
23327
+ }, tableScrollPosition, scrollAreaWidth)), cellProps === null || cellProps === void 0 ? void 0 : cellProps.css)
23328
+ })
23329
+ }) : jsx(Text$1, Object.assign({
23330
+ variant: "contentButton"
23331
+ }, {
23332
+ children: row.cells[0].render('Cell')
23333
+ }), void 0)), jsx(TableRow$3, Object.assign({
23334
+ css: customStyle
23335
+ }, row && row.getRowProps ? row.getRowProps() : {}, {
23336
+ children: row.cells.filter(cell => filterHeader.length > 0 ? filterHeader.includes(cell.column.id) : cell).filter(cell => !cell.column.isSubRow).map((cell, index, row) => {
23337
+ var _a, _b, _c;
23338
+ let visibleHeaders = (_a = headerGroups === null || headerGroups === void 0 ? void 0 : headerGroups[0]) === null || _a === void 0 ? void 0 : _a.headers.filter(column => !column.isSubRow);
23339
+ if (filterHeader.length > 0) {
23340
+ visibleHeaders = visibleHeaders.filter(item => filterHeader.includes(item.id));
23400
23341
  }
23401
- }, {
23402
- children: jsx(ConditionalWrapper, Object.assign({
23403
- condition: isContextMenu && !exceptionId,
23404
- wrapper: children => jsx(ContextMenuTrigger, Object.assign({
23405
- id: "context-menu-table",
23406
- triggerSide: "left"
23342
+ const collId = (_b = cell === null || cell === void 0 ? void 0 : cell.column) === null || _b === void 0 ? void 0 : _b.id;
23343
+ const exceptionId = (_c = ['expander', 'multiple-expander', 'selection', 'menu', 'eye'].concat(additionalExceptionIds)) === null || _c === void 0 ? void 0 : _c.includes(collId);
23344
+ return jsx(TableCell$3, Object.assign({}, cell.getCellProps(addOnCellStyle(cell.column.id)), {
23345
+ css: Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, cssTableCell), {
23346
+ padding: !isContextMenu || exceptionId ? collId === 'expander' || collId === 'multiple-expander' ? '20px 4px' : '20px 8px' : '',
23347
+ verticalAlign: cell.column.accessor ? cellAlign : 'center',
23348
+ cursor: onRowClick ? 'pointer' : 'unset'
23349
+ }), stickyPositionStyling(cell.column)), stickyShadowStyling(cell.column, tableScrollPosition, scrollAreaWidth)), {
23350
+ paddingRight: index + 1 === row.length ? 30 : null,
23351
+ paddingLeft: index + 1 === row.length ? 30 : null
23352
+ }),
23353
+ onClick: () => {
23354
+ if (!exceptionId) {
23355
+ handleRowClick(row, i);
23356
+ }
23357
+ }
23358
+ }, {
23359
+ children: jsx(ConditionalWrapper, Object.assign({
23360
+ condition: isContextMenu && !exceptionId,
23361
+ wrapper: children => jsx(ContextMenuTrigger, Object.assign({
23362
+ id: "context-menu-table",
23363
+ triggerSide: "left"
23364
+ }, {
23365
+ children: jsx(Box, Object.assign({
23366
+ css: {
23367
+ cursor: 'pointer',
23368
+ padding: cell.column.accessor ? '20px 8px' : '20px 20px'
23369
+ },
23370
+ onClick: () => handleRowClick(row, i)
23371
+ }, {
23372
+ children: children
23373
+ }), void 0)
23374
+ }), void 0)
23407
23375
  }, {
23408
23376
  children: jsx(Box, Object.assign({
23409
23377
  css: {
23410
- cursor: 'pointer',
23411
- padding: cell.column.accessor ? '20px 8px' : '20px 20px'
23412
- },
23413
- onClick: () => handleRowClick(row, i)
23378
+ visibility: hideRowMenuColumn && collId === 'menu' ? 'hidden' : 'visible'
23379
+ }
23414
23380
  }, {
23415
- children: children
23381
+ children: cell.render('Cell')
23416
23382
  }), void 0)
23417
23383
  }), void 0)
23384
+ }), void 0);
23385
+ })
23386
+ }), void 0), row.isExpanded ? subRowCells.map((cell, index) => jsxs(TableRow$3, Object.assign({
23387
+ subRow: true
23388
+ }, {
23389
+ children: [leftAddOnCells.map((_, index) => jsx("td", {
23390
+ style: {
23391
+ backgroundColor: colors$8.bgGray
23392
+ }
23393
+ }, index)), jsxs(React.Fragment, {
23394
+ children: [jsx(TableCell$3, Object.assign({
23395
+ subCell: true,
23396
+ colSpan: notNullHeaderColumns.length > 5 ? 2 : 1,
23397
+ headerSubCell: true,
23398
+ css: Object.assign(Object.assign({
23399
+ paddingTop: `${index === 0 ? '24px' : '13px'} !important`,
23400
+ paddingBottom: `${index === subRowCells.length - 1 ? '24px' : '13px'} !important`,
23401
+ backgroundColor: '$bgGray'
23402
+ }, stickyPositionStyling(cell.column)), cell.column.headerCss)
23403
+ }, {
23404
+ children: jsx(Paragraph, Object.assign({
23405
+ paragraph: "shortContentBold"
23406
+ }, {
23407
+ children: cell.column.Header
23408
+ }), void 0)
23409
+ }), void 0), jsx(TableCell$3, Object.assign({
23410
+ subCell: true,
23411
+ colSpan: visibleColumns.length - subRowCells.length,
23412
+ css: {
23413
+ paddingTop: `${index === 0 ? '24px' : '13px'} !important`,
23414
+ paddingBottom: `${index === subRowCells.length - 1 ? '24px' : '13px'} !important`
23415
+ }
23418
23416
  }, {
23419
- children: jsx(Box, Object.assign({
23420
- css: {
23421
- visibility: hideRowMenuColumn && collId === 'menu' ? 'hidden' : 'visible'
23422
- }
23417
+ children: jsx(Paragraph, Object.assign({
23418
+ paragraph: "shortContentRegular"
23423
23419
  }, {
23424
23420
  children: cell.render('Cell')
23425
23421
  }), void 0)
23426
- }), void 0)
23427
- }), void 0);
23428
- }), customizableColumn && jsx(TableCell$3, {
23429
- css: Object.assign(Object.assign({}, cssBtnCustom), {
23430
- maxHeight: 100,
23431
- '&::after': Object.assign(Object.assign({}, cssBtnCustom['&::after']), {
23432
- height: 100
23433
- })
23422
+ }), void 0)]
23423
+ }, cell.column.id)]
23424
+ }), cell.column.id)) : 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, {
23425
+ getCellProps: cellProps => ({
23426
+ css: Object.assign(Object.assign(Object.assign({}, stickyPositionStyling({
23427
+ sticky: cellProps === null || cellProps === void 0 ? void 0 : cellProps.sticky,
23428
+ stickyPosition: cellProps === null || cellProps === void 0 ? void 0 : cellProps.stickyPosition
23429
+ })), stickyShadowStyling({
23430
+ sticky: cellProps === null || cellProps === void 0 ? void 0 : cellProps.sticky,
23431
+ shadow: cellProps === null || cellProps === void 0 ? void 0 : cellProps.shadow
23432
+ }, tableScrollPosition, scrollAreaWidth)), cellProps === null || cellProps === void 0 ? void 0 : cellProps.css)
23434
23433
  })
23435
- }, void 0)]
23436
- }), void 0), row.isExpanded ? subRowCells.map((cell, index) => jsxs(TableRow$3, Object.assign({
23437
- subRow: true
23438
- }, {
23439
- children: [leftAddOnCells.map((_, index) => jsx("td", {
23440
- style: {
23441
- backgroundColor: colors$8.bgGray
23442
- }
23443
- }, index)), jsxs(React.Fragment, {
23444
- children: [jsx(TableCell$3, Object.assign({
23445
- subCell: true,
23446
- colSpan: notNullHeaderColumns.length > 5 ? 2 : 1,
23447
- headerSubCell: true,
23448
- css: Object.assign(Object.assign({
23449
- paddingTop: `${index === 0 ? '24px' : '13px'} !important`,
23450
- paddingBottom: `${index === subRowCells.length - 1 ? '24px' : '13px'} !important`,
23451
- backgroundColor: '$bgGray'
23452
- }, stickyPositionStyling(cell.column)), cell.column.headerCss)
23453
- }, {
23454
- children: jsx(Paragraph, Object.assign({
23455
- paragraph: "shortContentBold"
23456
- }, {
23457
- children: cell.column.Header
23458
- }), void 0)
23459
- }), void 0), jsx(TableCell$3, Object.assign({
23460
- subCell: true,
23461
- colSpan: visibleColumns.length - subRowCells.length,
23462
- css: {
23463
- paddingTop: `${index === 0 ? '24px' : '13px'} !important`,
23464
- paddingBottom: `${index === subRowCells.length - 1 ? '24px' : '13px'} !important`
23465
- }
23466
- }, {
23467
- children: jsx(Paragraph, Object.assign({
23468
- paragraph: "shortContentRegular"
23469
- }, {
23470
- children: cell.render('Cell')
23471
- }), void 0)
23472
- }), void 0)]
23473
- }, cell.column.id)]
23474
- }), cell.column.id)) : 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, {
23475
- getCellProps: cellProps => ({
23476
- css: Object.assign(Object.assign(Object.assign({}, stickyPositionStyling({
23477
- sticky: cellProps === null || cellProps === void 0 ? void 0 : cellProps.sticky,
23478
- stickyPosition: cellProps === null || cellProps === void 0 ? void 0 : cellProps.stickyPosition
23479
- })), stickyShadowStyling({
23480
- sticky: cellProps === null || cellProps === void 0 ? void 0 : cellProps.sticky,
23481
- shadow: cellProps === null || cellProps === void 0 ? void 0 : cellProps.shadow
23482
- }, tableScrollPosition, scrollAreaWidth)), cellProps === null || cellProps === void 0 ? void 0 : cellProps.css)
23483
- })
23484
- }))]
23485
- }, row.id);
23486
- })
23487
- }), void 0), (_d = decoration === null || decoration === void 0 ? void 0 : decoration.footerRender) === null || _d === void 0 ? void 0 : _d.call(decoration), isInfiniteScroll && paddingBottom > 0 && jsx("tr", {
23488
- children: jsx("td", {
23489
- style: {
23490
- height: `${paddingBottom}px`
23491
- }
23492
- }, void 0)
23493
- }, void 0)]
23494
- }), void 0)]
23495
- }), void 0)
23496
- }), void 0), renderContextMenu()]
23434
+ }))]
23435
+ }, row.id);
23436
+ })
23437
+ }), void 0), (_d = decoration === null || decoration === void 0 ? void 0 : decoration.footerRender) === null || _d === void 0 ? void 0 : _d.call(decoration), isInfiniteScroll && paddingBottom > 0 && jsx("tr", {
23438
+ children: jsx("td", {
23439
+ style: {
23440
+ height: `${paddingBottom}px`
23441
+ }
23442
+ }, void 0)
23443
+ }, void 0)]
23444
+ }), void 0)]
23445
+ }), void 0)
23446
+ }), void 0), renderContextMenu()]
23447
+ }), void 0), id && jsxs(Fragment, {
23448
+ children: [jsx(HeaderMenuOption, Object.assign({
23449
+ rowData: tableRowData,
23450
+ open: openMenu,
23451
+ id: id,
23452
+ onOpenChange: setOpen,
23453
+ onChange: useCallback(items => {
23454
+ setFilterHeader(items);
23455
+ }, [filterHeader]),
23456
+ headerGroups: headerGroups,
23457
+ filterHeader: filterHeader
23458
+ }, {
23459
+ children: jsx(IconButton, Object.assign({
23460
+ css: {
23461
+ zIndex: '$docked',
23462
+ position: 'absolute',
23463
+ top: '20px',
23464
+ right: '10px',
23465
+ '&:hover': {
23466
+ backgroundColor: '#585f5f'
23467
+ },
23468
+ backgroundColor: '#c0c4c4',
23469
+ padding: 0,
23470
+ boxShadow: '0px 22px 43px 0px rgba(0, 0, 0, 0.08), 0px 9px 24px 0px rgba(0, 0, 0, 0.09), 0px 3px 9px 0px rgba(0, 0, 0, 0.13)'
23471
+ },
23472
+ onClick: () => setOpen(!openMenu),
23473
+ buttonType: "secondary"
23474
+ }, {
23475
+ children: jsx(PlusPrimitive, {
23476
+ size: "20"
23477
+ }, void 0)
23478
+ }), void 0)
23479
+ }), void 0), jsx(Box, {
23480
+ css: {
23481
+ position: 'absolute',
23482
+ top: 0,
23483
+ right: 0,
23484
+ width: 20,
23485
+ height: '100%',
23486
+ boxShadow: '-5px 0px 5px -3px #00000026',
23487
+ backgroundColor: 'white'
23488
+ }
23489
+ }, void 0)]
23490
+ }, void 0)]
23497
23491
  }), void 0), !isInfiniteScroll && jsx(Box, Object.assign({
23498
23492
  css: {
23499
23493
  width: '100%'