@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/components/table/Table.d.ts +4 -7
- package/index.esm.js +289 -295
- package/index.umd.js +357 -363
- package/package.json +1 -1
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
|
-
},
|
|
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:
|
|
22741
|
-
left:
|
|
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: '
|
|
22755
|
-
overflowY: visibleHeaders.filter(val => typeof val.Header === 'string').length > 7
|
|
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
|
-
},
|
|
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:${
|
|
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 ||
|
|
23206
|
-
children: [jsxs(
|
|
23207
|
-
css:
|
|
23208
|
-
|
|
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: [
|
|
23222
|
-
|
|
23223
|
-
|
|
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:
|
|
23226
|
-
|
|
23227
|
-
|
|
23228
|
-
|
|
23229
|
-
|
|
23230
|
-
|
|
23231
|
-
|
|
23232
|
-
|
|
23233
|
-
|
|
23234
|
-
|
|
23235
|
-
|
|
23236
|
-
|
|
23237
|
-
|
|
23238
|
-
|
|
23239
|
-
|
|
23240
|
-
|
|
23241
|
-
|
|
23242
|
-
|
|
23243
|
-
|
|
23244
|
-
|
|
23245
|
-
|
|
23246
|
-
|
|
23247
|
-
|
|
23248
|
-
|
|
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
|
-
|
|
23261
|
-
|
|
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:
|
|
23264
|
-
|
|
23265
|
-
|
|
23266
|
-
|
|
23267
|
-
|
|
23268
|
-
|
|
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(
|
|
23271
|
-
|
|
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(
|
|
23282
|
-
css: {
|
|
23283
|
-
|
|
23284
|
-
|
|
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:
|
|
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
|
-
}
|
|
23338
|
-
|
|
23339
|
-
|
|
23340
|
-
|
|
23341
|
-
|
|
23342
|
-
|
|
23343
|
-
|
|
23344
|
-
|
|
23345
|
-
|
|
23346
|
-
|
|
23347
|
-
|
|
23348
|
-
|
|
23349
|
-
|
|
23350
|
-
|
|
23351
|
-
|
|
23352
|
-
|
|
23353
|
-
|
|
23354
|
-
|
|
23355
|
-
|
|
23356
|
-
|
|
23357
|
-
|
|
23358
|
-
|
|
23359
|
-
|
|
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
|
-
|
|
23365
|
-
|
|
23366
|
-
|
|
23367
|
-
|
|
23368
|
-
|
|
23369
|
-
|
|
23370
|
-
|
|
23371
|
-
|
|
23372
|
-
|
|
23373
|
-
}
|
|
23374
|
-
})
|
|
23375
|
-
|
|
23376
|
-
|
|
23377
|
-
|
|
23378
|
-
|
|
23379
|
-
|
|
23380
|
-
|
|
23381
|
-
|
|
23382
|
-
|
|
23383
|
-
|
|
23384
|
-
|
|
23385
|
-
|
|
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
|
-
|
|
23403
|
-
|
|
23404
|
-
|
|
23405
|
-
|
|
23406
|
-
|
|
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
|
-
|
|
23411
|
-
|
|
23412
|
-
},
|
|
23413
|
-
onClick: () => handleRowClick(row, i)
|
|
23378
|
+
visibility: hideRowMenuColumn && collId === 'menu' ? 'hidden' : 'visible'
|
|
23379
|
+
}
|
|
23414
23380
|
}, {
|
|
23415
|
-
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(
|
|
23420
|
-
|
|
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
|
-
}
|
|
23428
|
-
}),
|
|
23429
|
-
|
|
23430
|
-
|
|
23431
|
-
|
|
23432
|
-
|
|
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
|
-
}
|
|
23436
|
-
}
|
|
23437
|
-
|
|
23438
|
-
|
|
23439
|
-
|
|
23440
|
-
|
|
23441
|
-
|
|
23442
|
-
|
|
23443
|
-
|
|
23444
|
-
|
|
23445
|
-
|
|
23446
|
-
|
|
23447
|
-
|
|
23448
|
-
|
|
23449
|
-
|
|
23450
|
-
|
|
23451
|
-
|
|
23452
|
-
|
|
23453
|
-
|
|
23454
|
-
|
|
23455
|
-
|
|
23456
|
-
|
|
23457
|
-
|
|
23458
|
-
|
|
23459
|
-
|
|
23460
|
-
|
|
23461
|
-
|
|
23462
|
-
|
|
23463
|
-
|
|
23464
|
-
|
|
23465
|
-
|
|
23466
|
-
|
|
23467
|
-
|
|
23468
|
-
|
|
23469
|
-
|
|
23470
|
-
|
|
23471
|
-
|
|
23472
|
-
|
|
23473
|
-
|
|
23474
|
-
|
|
23475
|
-
|
|
23476
|
-
|
|
23477
|
-
|
|
23478
|
-
|
|
23479
|
-
|
|
23480
|
-
|
|
23481
|
-
|
|
23482
|
-
|
|
23483
|
-
|
|
23484
|
-
|
|
23485
|
-
|
|
23486
|
-
|
|
23487
|
-
|
|
23488
|
-
|
|
23489
|
-
|
|
23490
|
-
|
|
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%'
|