es-grid-template 1.9.39 → 1.9.41
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/es/grid-component/type.d.ts +1 -0
- package/es/group-component/InternalTable.js +10 -0
- package/es/group-component/TableContainerEdit.js +229 -3
- package/es/group-component/hook/utils.d.ts +3 -3
- package/es/group-component/useContext.d.ts +2 -1
- package/es/table-component/TableContainer.js +41 -5
- package/es/table-component/TableContainerEdit.js +19 -4
- package/es/table-virtuoso/body/TableBodyCell.js +19 -3
- package/es/table-virtuoso/hook/utils.js +4 -0
- package/es/table-virtuoso/style.d.ts +1 -1
- package/es/table-virtuoso/style.js +11 -11
- package/es/table-virtuoso/table/TableContainer.js +22 -2
- package/es/table-virtuoso/table/TableWrapper.js +4 -3
- package/lib/grid-component/type.d.ts +1 -0
- package/lib/group-component/InternalTable.js +10 -0
- package/lib/group-component/TableContainerEdit.js +229 -3
- package/lib/group-component/useContext.d.ts +2 -1
- package/lib/table-component/TableContainer.js +41 -5
- package/lib/table-component/TableContainerEdit.js +19 -4
- package/lib/table-virtuoso/body/TableBodyCell.js +19 -3
- package/lib/table-virtuoso/hook/utils.js +4 -0
- package/lib/table-virtuoso/style.d.ts +1 -1
- package/lib/table-virtuoso/style.js +10 -10
- package/lib/table-virtuoso/table/TableContainer.js +22 -2
- package/lib/table-virtuoso/table/TableWrapper.js +4 -3
- package/package.json +2 -2
|
@@ -19,7 +19,8 @@ const TableWrapper = props => {
|
|
|
19
19
|
contextMenuItems: propContextMenuItems,
|
|
20
20
|
contextMenuHidden,
|
|
21
21
|
contextMenuClick,
|
|
22
|
-
contextMenuOpen
|
|
22
|
+
contextMenuOpen,
|
|
23
|
+
summary
|
|
23
24
|
} = props;
|
|
24
25
|
const menuRef = React.useRef(null);
|
|
25
26
|
const {
|
|
@@ -229,7 +230,7 @@ const TableWrapper = props => {
|
|
|
229
230
|
}));
|
|
230
231
|
});
|
|
231
232
|
},
|
|
232
|
-
fixedFooterContent: () => {
|
|
233
|
+
fixedFooterContent: summary ? () => {
|
|
233
234
|
const visibleColumns = table.getVisibleLeafColumns();
|
|
234
235
|
return /*#__PURE__*/React.createElement("tr", {
|
|
235
236
|
className: "ui-rc-grid-footer-row"
|
|
@@ -239,7 +240,7 @@ const TableWrapper = props => {
|
|
|
239
240
|
column: header
|
|
240
241
|
});
|
|
241
242
|
}));
|
|
242
|
-
}
|
|
243
|
+
} : undefined
|
|
243
244
|
})), /*#__PURE__*/React.createElement(Tooltip, {
|
|
244
245
|
id: `${id}-tooltip-content`,
|
|
245
246
|
style: {
|
|
@@ -175,6 +175,16 @@ const InternalTable = props => {
|
|
|
175
175
|
...a
|
|
176
176
|
});
|
|
177
177
|
}, [columns]);
|
|
178
|
+
|
|
179
|
+
// React.useEffect(() => {
|
|
180
|
+
// const a = getInvisibleColumns(columns)
|
|
181
|
+
|
|
182
|
+
// const bcd = convertToObj(groupColumns)
|
|
183
|
+
|
|
184
|
+
// setColumnVisibility({...a, ...bcd})
|
|
185
|
+
|
|
186
|
+
// }, [columns, groupColumns])
|
|
187
|
+
|
|
178
188
|
const [columnsHiddenKeys, setColumnsHiddenKeys] = (0, _useMergedState.default)(undefined, {
|
|
179
189
|
value: undefined
|
|
180
190
|
});
|
|
@@ -1440,6 +1440,221 @@ const TableContainerEdit = props => {
|
|
|
1440
1440
|
triggerChangeData?.([...newData]);
|
|
1441
1441
|
}
|
|
1442
1442
|
};
|
|
1443
|
+
const toolbarItemsTop = _react.default.useMemo(() => {
|
|
1444
|
+
if (!rowsFocus || rowsFocus.length === 0) {
|
|
1445
|
+
return toolbarItems?.filter(it => it.position !== 'Bottom' && it.fixedRight !== false && it.visible !== false && it.key !== 'DUPLICATE' && it.key !== 'INSERT_BEFORE' && it.key !== 'INSERT_AFTER' && it.key !== 'DELETE_ROWS' && it.key !== 'INSERT_CHILDREN').map(item => {
|
|
1446
|
+
if (item.key === 'ADD') {
|
|
1447
|
+
return {
|
|
1448
|
+
...item,
|
|
1449
|
+
template: () => {
|
|
1450
|
+
return /*#__PURE__*/_react.default.createElement(_react.Fragment, null, item.key === 'ADD' && /*#__PURE__*/_react.default.createElement("div", {
|
|
1451
|
+
className: (0, _classnames.default)(`be-toolbar-item`, item?.className)
|
|
1452
|
+
}, /*#__PURE__*/_react.default.createElement(_rcMasterUi.Dropdown.Button, {
|
|
1453
|
+
overlayClassName: 'be-popup-container',
|
|
1454
|
+
trigger: ['click'],
|
|
1455
|
+
style: {
|
|
1456
|
+
color: '#28c76f',
|
|
1457
|
+
borderColor: '#28c76f'
|
|
1458
|
+
},
|
|
1459
|
+
className: 'toolbar-button toolbar-dropdown-button',
|
|
1460
|
+
menu: {
|
|
1461
|
+
items: itemsAdd,
|
|
1462
|
+
onClick: e => handleAddMulti(item, Number(e.key))
|
|
1463
|
+
}
|
|
1464
|
+
}, /*#__PURE__*/_react.default.createElement("span", {
|
|
1465
|
+
style: {
|
|
1466
|
+
color: '#28c76f'
|
|
1467
|
+
},
|
|
1468
|
+
onClick: () => handleAddMulti(item, 1)
|
|
1469
|
+
}, item.label ? t ? t(item.label) : item.label : t ? t('Add item') : 'Add item'))));
|
|
1470
|
+
}
|
|
1471
|
+
};
|
|
1472
|
+
}
|
|
1473
|
+
if (item.key === 'DELETE') {
|
|
1474
|
+
return {
|
|
1475
|
+
...item,
|
|
1476
|
+
template: () => {
|
|
1477
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
1478
|
+
className: (0, _classnames.default)(`be-toolbar-item`, item?.className)
|
|
1479
|
+
}, /*#__PURE__*/_react.default.createElement(_button.default, {
|
|
1480
|
+
style: {
|
|
1481
|
+
color: '#eb4619',
|
|
1482
|
+
borderColor: '#eb4619'
|
|
1483
|
+
},
|
|
1484
|
+
variant: 'outlined',
|
|
1485
|
+
onClick: () => handleDeleteAll(item),
|
|
1486
|
+
className: "d-flex toolbar-button"
|
|
1487
|
+
}, item.label ? t ? t(item.label) : item.label : t ? t('Delete all item') : 'Delete all item'));
|
|
1488
|
+
}
|
|
1489
|
+
};
|
|
1490
|
+
}
|
|
1491
|
+
return {
|
|
1492
|
+
...item
|
|
1493
|
+
};
|
|
1494
|
+
});
|
|
1495
|
+
}
|
|
1496
|
+
return toolbarItems?.filter(it => it.position === 'Bottom' && it.visible !== false).map(item => {
|
|
1497
|
+
if (item.key === 'ADD') {
|
|
1498
|
+
return {
|
|
1499
|
+
...item,
|
|
1500
|
+
template: () => {
|
|
1501
|
+
return /*#__PURE__*/_react.default.createElement(_react.Fragment, null, item.key === 'ADD' && /*#__PURE__*/_react.default.createElement("div", {
|
|
1502
|
+
className: (0, _classnames.default)(`be-toolbar-item`, item?.className)
|
|
1503
|
+
}, /*#__PURE__*/_react.default.createElement(_rcMasterUi.Dropdown.Button, {
|
|
1504
|
+
overlayClassName: 'be-popup-container',
|
|
1505
|
+
style: {
|
|
1506
|
+
color: '#28c76f',
|
|
1507
|
+
borderColor: '#28c76f'
|
|
1508
|
+
},
|
|
1509
|
+
className: 'toolbar-button toolbar-dropdown-button',
|
|
1510
|
+
menu: {
|
|
1511
|
+
items: itemsAdd,
|
|
1512
|
+
onClick: e => handleAddMulti(item, Number(e.key))
|
|
1513
|
+
}
|
|
1514
|
+
}, /*#__PURE__*/_react.default.createElement("span", {
|
|
1515
|
+
style: {
|
|
1516
|
+
color: '#28c76f'
|
|
1517
|
+
},
|
|
1518
|
+
onClick: () => handleAddMulti(item, 1)
|
|
1519
|
+
}, item.label ? t ? t(item.label) : item.label : t ? t('Add item') : 'Add item'))));
|
|
1520
|
+
}
|
|
1521
|
+
};
|
|
1522
|
+
}
|
|
1523
|
+
if (item.key === 'DUPLICATE') {
|
|
1524
|
+
return {
|
|
1525
|
+
...item,
|
|
1526
|
+
template: () => {
|
|
1527
|
+
return /*#__PURE__*/_react.default.createElement(_react.Fragment, null, item.key === 'DUPLICATE' && item.visible !== false && rowsFocus.length > 0 && /*#__PURE__*/_react.default.createElement("div", {
|
|
1528
|
+
className: (0, _classnames.default)(`be-toolbar-item`, item?.className)
|
|
1529
|
+
}, /*#__PURE__*/_react.default.createElement(_button.default, {
|
|
1530
|
+
style: {
|
|
1531
|
+
color: '#28c76f',
|
|
1532
|
+
borderColor: '#28c76f'
|
|
1533
|
+
},
|
|
1534
|
+
variant: 'outlined',
|
|
1535
|
+
onClick: handleDuplicate,
|
|
1536
|
+
className: "d-flex toolbar-button"
|
|
1537
|
+
}, item.label ? t ? t(item.label) : item.label : t ? t('Duplicate') : 'Duplicate')));
|
|
1538
|
+
}
|
|
1539
|
+
};
|
|
1540
|
+
}
|
|
1541
|
+
if (item.key === 'INSERT_BEFORE') {
|
|
1542
|
+
return {
|
|
1543
|
+
...item,
|
|
1544
|
+
template: () => {
|
|
1545
|
+
return /*#__PURE__*/_react.default.createElement(_react.Fragment, null, /*#__PURE__*/_react.default.createElement("div", {
|
|
1546
|
+
className: (0, _classnames.default)(`be-toolbar-item`, item?.className)
|
|
1547
|
+
}, /*#__PURE__*/_react.default.createElement(_rcMasterUi.Dropdown.Button, {
|
|
1548
|
+
overlayClassName: 'be-popup-container',
|
|
1549
|
+
style: {
|
|
1550
|
+
color: '#28c76f',
|
|
1551
|
+
borderColor: '#28c76f'
|
|
1552
|
+
},
|
|
1553
|
+
className: 'toolbar-button toolbar-dropdown-button',
|
|
1554
|
+
menu: {
|
|
1555
|
+
items: itemsAdd,
|
|
1556
|
+
onClick: e => handleInsertBefore(item, Number(e.key))
|
|
1557
|
+
}
|
|
1558
|
+
}, /*#__PURE__*/_react.default.createElement("span", {
|
|
1559
|
+
style: {
|
|
1560
|
+
color: '#28c76f'
|
|
1561
|
+
},
|
|
1562
|
+
onClick: () => handleInsertBefore(item, 1)
|
|
1563
|
+
}, item.label ? t ? t(item.label) : item.label : t ? t('Insert item before') : 'Insert item before'))));
|
|
1564
|
+
}
|
|
1565
|
+
};
|
|
1566
|
+
}
|
|
1567
|
+
if (item.key === 'INSERT_AFTER') {
|
|
1568
|
+
return {
|
|
1569
|
+
...item,
|
|
1570
|
+
template: () => {
|
|
1571
|
+
return /*#__PURE__*/_react.default.createElement(_react.Fragment, null, /*#__PURE__*/_react.default.createElement("div", {
|
|
1572
|
+
className: (0, _classnames.default)(`be-toolbar-item`, item?.className)
|
|
1573
|
+
}, /*#__PURE__*/_react.default.createElement(_rcMasterUi.Dropdown.Button, {
|
|
1574
|
+
overlayClassName: 'be-popup-container',
|
|
1575
|
+
style: {
|
|
1576
|
+
color: '#28c76f',
|
|
1577
|
+
borderColor: '#28c76f'
|
|
1578
|
+
},
|
|
1579
|
+
className: 'toolbar-button toolbar-dropdown-button',
|
|
1580
|
+
menu: {
|
|
1581
|
+
items: itemsAdd,
|
|
1582
|
+
onClick: e => handleInsertAfter(item, Number(e.key))
|
|
1583
|
+
}
|
|
1584
|
+
}, /*#__PURE__*/_react.default.createElement("span", {
|
|
1585
|
+
style: {
|
|
1586
|
+
color: '#28c76f'
|
|
1587
|
+
},
|
|
1588
|
+
onClick: () => handleInsertAfter(item, 1)
|
|
1589
|
+
}, item.label ? t ? t(item.label) : item.label : t ? t('Insert item after') : 'Insert item after'))));
|
|
1590
|
+
}
|
|
1591
|
+
};
|
|
1592
|
+
}
|
|
1593
|
+
if (item.key === 'INSERT_CHILDREN') {
|
|
1594
|
+
return {
|
|
1595
|
+
...item,
|
|
1596
|
+
template: () => {
|
|
1597
|
+
return /*#__PURE__*/_react.default.createElement(_react.Fragment, null, /*#__PURE__*/_react.default.createElement("div", {
|
|
1598
|
+
className: (0, _classnames.default)(`be-toolbar-item`, item?.className)
|
|
1599
|
+
}, /*#__PURE__*/_react.default.createElement(_button.default, {
|
|
1600
|
+
style: {
|
|
1601
|
+
color: '#28c76f',
|
|
1602
|
+
borderColor: '#28c76f'
|
|
1603
|
+
},
|
|
1604
|
+
variant: 'outlined',
|
|
1605
|
+
onClick: () => handleInsertChild(item),
|
|
1606
|
+
className: "d-flex toolbar-button"
|
|
1607
|
+
}, item.label ? t ? t(item.label) : item.label : t ? t('Insert item children') : 'Insert item children')));
|
|
1608
|
+
}
|
|
1609
|
+
};
|
|
1610
|
+
}
|
|
1611
|
+
if (item.key === 'DELETE') {
|
|
1612
|
+
return {
|
|
1613
|
+
...item,
|
|
1614
|
+
template: () => {
|
|
1615
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
1616
|
+
className: (0, _classnames.default)(`be-toolbar-item`, item?.className)
|
|
1617
|
+
}, /*#__PURE__*/_react.default.createElement(_button.default, {
|
|
1618
|
+
style: {
|
|
1619
|
+
color: '#eb4619',
|
|
1620
|
+
borderColor: '#eb4619'
|
|
1621
|
+
},
|
|
1622
|
+
variant: 'outlined',
|
|
1623
|
+
onClick: handleDeleteAll,
|
|
1624
|
+
className: "d-flex toolbar-button"
|
|
1625
|
+
}, item.label ? t ? t(item.label) : item.label : t ? t('Delete all item') : 'Delete all item'));
|
|
1626
|
+
}
|
|
1627
|
+
};
|
|
1628
|
+
}
|
|
1629
|
+
if (item.key === 'DELETE_ROWS') {
|
|
1630
|
+
return {
|
|
1631
|
+
...item,
|
|
1632
|
+
template: () => {
|
|
1633
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
1634
|
+
className: (0, _classnames.default)(`be-toolbar-item`, item?.className)
|
|
1635
|
+
}, /*#__PURE__*/_react.default.createElement(_button.default, {
|
|
1636
|
+
style: {
|
|
1637
|
+
color: '#eb4619',
|
|
1638
|
+
borderColor: '#eb4619'
|
|
1639
|
+
},
|
|
1640
|
+
variant: 'outlined',
|
|
1641
|
+
onClick: () => handleDeleteRows(item),
|
|
1642
|
+
className: "d-flex toolbar-button"
|
|
1643
|
+
}, t ? `${t('Delete')} ${rowsFocus.length} ${t('row')}` : `Delete ${rowsFocus.length} item`));
|
|
1644
|
+
}
|
|
1645
|
+
};
|
|
1646
|
+
}
|
|
1647
|
+
return {
|
|
1648
|
+
...item
|
|
1649
|
+
};
|
|
1650
|
+
});
|
|
1651
|
+
}, [handleAddMulti, handleDeleteAll, handleDeleteRows, handleDuplicate, handleInsertAfter, handleInsertBefore, handleInsertChild, itemsAdd, rowsFocus, t, toolbarItems]);
|
|
1652
|
+
const toolbarItemTopRight = _react.default.useMemo(() => {
|
|
1653
|
+
if (!toolbarItems) {
|
|
1654
|
+
return undefined;
|
|
1655
|
+
}
|
|
1656
|
+
return toolbarItems.filter(it => it.position !== 'Bottom' && it.fixedRight && it.visible !== false);
|
|
1657
|
+
}, [toolbarItems]);
|
|
1443
1658
|
const toolbarItemsBottom = _react.default.useMemo(() => {
|
|
1444
1659
|
if (!rowsFocus || rowsFocus.length === 0) {
|
|
1445
1660
|
return toolbarItems?.filter(it => it.position === 'Bottom' && it.visible !== false && it.key !== 'DUPLICATE' && it.key !== 'INSERT_BEFORE' && it.key !== 'INSERT_AFTER' && it.key !== 'DELETE_ROWS' && it.key !== 'INSERT_CHILDREN').map(item => {
|
|
@@ -1908,7 +2123,7 @@ const TableContainerEdit = props => {
|
|
|
1908
2123
|
overflow: 'hidden'
|
|
1909
2124
|
}
|
|
1910
2125
|
}, /*#__PURE__*/_react.default.createElement(_rcMasterUi.Toolbar, {
|
|
1911
|
-
items:
|
|
2126
|
+
items: toolbarItemsTop ?? [],
|
|
1912
2127
|
mode: 'scroll'
|
|
1913
2128
|
})), /*#__PURE__*/_react.default.createElement("div", {
|
|
1914
2129
|
style: {
|
|
@@ -1925,7 +2140,15 @@ const TableContainerEdit = props => {
|
|
|
1925
2140
|
showTotal: (total, range) =>
|
|
1926
2141
|
// @ts-ignore
|
|
1927
2142
|
`${range[0]}-${range[1]} / ${total} ${t ? t(pagination?.locale?.items ?? 'items') : 'items'}`
|
|
1928
|
-
}, pagination)), typeof actionTemplate === 'function' ? actionTemplate() : actionTemplate,
|
|
2143
|
+
}, pagination)), typeof actionTemplate === 'function' ? actionTemplate() : actionTemplate, toolbarItemTopRight && /*#__PURE__*/_react.default.createElement("div", {
|
|
2144
|
+
style: {
|
|
2145
|
+
flex: 1,
|
|
2146
|
+
overflow: 'hidden'
|
|
2147
|
+
}
|
|
2148
|
+
}, /*#__PURE__*/_react.default.createElement(_rcMasterUi.Toolbar, {
|
|
2149
|
+
items: toolbarItemTopRight,
|
|
2150
|
+
mode: 'responsive'
|
|
2151
|
+
})), fullScreen !== false && (isFullScreen ? /*#__PURE__*/_react.default.createElement(_becoxyIcons.Minimize, {
|
|
1929
2152
|
fontSize: 16,
|
|
1930
2153
|
onClick: () => {
|
|
1931
2154
|
setIsFullScreen(!isFullScreen);
|
|
@@ -1967,7 +2190,10 @@ const TableContainerEdit = props => {
|
|
|
1967
2190
|
originData,
|
|
1968
2191
|
wrapSettings,
|
|
1969
2192
|
recordDoubleClick,
|
|
1970
|
-
selectionSettings
|
|
2193
|
+
selectionSettings: {
|
|
2194
|
+
...selectionSettings,
|
|
2195
|
+
checkboxOnly: true
|
|
2196
|
+
},
|
|
1971
2197
|
isSelectionChange,
|
|
1972
2198
|
setIsSelectionChange,
|
|
1973
2199
|
// onContextMenu,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Dispatch, SetStateAction } from 'react';
|
|
2
|
-
import type { ColumnTable, ExpandableConfig, IFormat, IWrapSettings, Locale, PaginationConfig, RangeState, RecordDoubleClickEventArgs, RowClassName, SelectionSettings, SourceFilter } from "./../grid-component/type";
|
|
2
|
+
import type { ColumnTable, ExpandableConfig, IFormat, IGroupSetting, IWrapSettings, Locale, PaginationConfig, RangeState, RecordDoubleClickEventArgs, RowClassName, SelectionSettings, SourceFilter } from "./../grid-component/type";
|
|
3
3
|
import type { SubmitHandler } from "react-hook-form";
|
|
4
4
|
import type { ExpandedState, Row, Table } from '@tanstack/react-table';
|
|
5
5
|
export type IPositionCell = {
|
|
@@ -84,6 +84,7 @@ export interface IContext<T> {
|
|
|
84
84
|
onRowFooterStyles?: Omit<React.CSSProperties, 'display' | 'transform' | 'gridTemplateColumns' | 'height' | 'minHeight'> | (() => Omit<React.CSSProperties, 'display' | 'transform' | 'gridTemplateColumns' | 'height' | 'minHeight'>);
|
|
85
85
|
dataSourceFilter?: SourceFilter[];
|
|
86
86
|
groupColumns?: string[];
|
|
87
|
+
groupSetting?: IGroupSetting;
|
|
87
88
|
}
|
|
88
89
|
export declare const TableContext: import("react").Context<IContext<any>>;
|
|
89
90
|
export type ContextCellChange = {
|
|
@@ -96,7 +96,6 @@ const TableContainer = props => {
|
|
|
96
96
|
const [tableHeight, settableHeight] = _react.default.useState(0);
|
|
97
97
|
const [focusedCell, setFocusedCell] = _react.default.useState(undefined);
|
|
98
98
|
_react.default.useEffect(() => {
|
|
99
|
-
// const totalHeight = minHeight ?? height
|
|
100
99
|
const totalHeight = (0, _utils.getTableHeight)(height, minHeight);
|
|
101
100
|
if (totalHeight) {
|
|
102
101
|
const topHeight = topToolbarRef.current ? topToolbarRef.current.offsetHeight : 0;
|
|
@@ -204,6 +203,24 @@ const TableContainer = props => {
|
|
|
204
203
|
// })
|
|
205
204
|
}
|
|
206
205
|
}, [columnSizingInfo]);
|
|
206
|
+
const toolbarItemTop = _react.default.useMemo(() => {
|
|
207
|
+
if (!toolbarItems) {
|
|
208
|
+
return undefined;
|
|
209
|
+
}
|
|
210
|
+
return toolbarItems.filter(it => it.position !== 'Bottom' && it.fixedRight !== false);
|
|
211
|
+
}, [toolbarItems]);
|
|
212
|
+
const toolbarItemBottom = _react.default.useMemo(() => {
|
|
213
|
+
if (!toolbarItems) {
|
|
214
|
+
return undefined;
|
|
215
|
+
}
|
|
216
|
+
return toolbarItems.filter(it => it.position === 'Bottom');
|
|
217
|
+
}, [toolbarItems]);
|
|
218
|
+
const toolbarItemTopRight = _react.default.useMemo(() => {
|
|
219
|
+
if (!toolbarItems) {
|
|
220
|
+
return undefined;
|
|
221
|
+
}
|
|
222
|
+
return toolbarItems.filter(it => it.position !== 'Bottom' && it.fixedRight);
|
|
223
|
+
}, [toolbarItems]);
|
|
207
224
|
const triggerCommandClick = args => {
|
|
208
225
|
// const { id: idCommand, rowId, rowData, index } = args
|
|
209
226
|
|
|
@@ -226,7 +243,8 @@ const TableContainer = props => {
|
|
|
226
243
|
style: {
|
|
227
244
|
display: 'flex',
|
|
228
245
|
justifyContent: 'space-between',
|
|
229
|
-
alignItems: 'center'
|
|
246
|
+
alignItems: 'center',
|
|
247
|
+
gap: '1rem'
|
|
230
248
|
}
|
|
231
249
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
232
250
|
style: {
|
|
@@ -234,7 +252,7 @@ const TableContainer = props => {
|
|
|
234
252
|
overflow: 'hidden'
|
|
235
253
|
}
|
|
236
254
|
}, /*#__PURE__*/_react.default.createElement(_rcMasterUi.Toolbar, {
|
|
237
|
-
items:
|
|
255
|
+
items: toolbarItemTop ?? []
|
|
238
256
|
// mode={'scroll'}
|
|
239
257
|
,
|
|
240
258
|
mode: toolbarMode
|
|
@@ -253,7 +271,15 @@ const TableContainer = props => {
|
|
|
253
271
|
showTotal: (totalItems, range) =>
|
|
254
272
|
// @ts-ignore
|
|
255
273
|
`${range[0]}-${range[1]} / ${totalItems} ${t ? t(pagination?.locale?.items ?? 'items') : 'items'}`
|
|
256
|
-
}, pagination)), typeof actionTemplate === 'function' ? actionTemplate() : actionTemplate,
|
|
274
|
+
}, pagination)), typeof actionTemplate === 'function' ? actionTemplate() : actionTemplate, toolbarItemTopRight && /*#__PURE__*/_react.default.createElement("div", {
|
|
275
|
+
style: {
|
|
276
|
+
flex: 1,
|
|
277
|
+
overflow: 'hidden'
|
|
278
|
+
}
|
|
279
|
+
}, /*#__PURE__*/_react.default.createElement(_rcMasterUi.Toolbar, {
|
|
280
|
+
items: toolbarItemTopRight,
|
|
281
|
+
mode: toolbarMode
|
|
282
|
+
})), fullScreen !== false && (isFullScreen ? /*#__PURE__*/_react.default.createElement(_becoxyIcons.Minimize, {
|
|
257
283
|
fontSize: 16,
|
|
258
284
|
onClick: () => {
|
|
259
285
|
setIsFullScreen(!isFullScreen);
|
|
@@ -348,7 +374,17 @@ const TableContainer = props => {
|
|
|
348
374
|
fixedRightColumns: fixedRightColumns
|
|
349
375
|
}))), /*#__PURE__*/_react.default.createElement("div", {
|
|
350
376
|
ref: bottomToolbarRef
|
|
351
|
-
},
|
|
377
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
378
|
+
style: {
|
|
379
|
+
flex: 1,
|
|
380
|
+
overflow: 'hidden'
|
|
381
|
+
}
|
|
382
|
+
}, /*#__PURE__*/_react.default.createElement(_rcMasterUi.Toolbar, {
|
|
383
|
+
items: toolbarItemBottom ?? []
|
|
384
|
+
// mode={'scroll'}
|
|
385
|
+
,
|
|
386
|
+
mode: toolbarMode
|
|
387
|
+
})), pagination && !infiniteScroll && /*#__PURE__*/_react.default.createElement(_pagination.default, (0, _extends2.default)({
|
|
352
388
|
pageSizeOptions: [20, 50, 100, 1000, 10000],
|
|
353
389
|
rootClassName: 'pagination-template',
|
|
354
390
|
showSizeChanger: true,
|
|
@@ -1576,7 +1576,7 @@ const TableContainerEdit = props => {
|
|
|
1576
1576
|
const toolbarItemsTop = _react.default.useMemo(() => {
|
|
1577
1577
|
// Chưa có dòng| ô được chọn
|
|
1578
1578
|
if (!rowsFocus || rowsFocus.length === 0) {
|
|
1579
|
-
return toolbarItems?.filter(it => it.position !== 'Bottom' && it.visible !== false && it.key !== 'DUPLICATE' && it.key !== 'INSERT_BEFORE' && it.key !== 'INSERT_AFTER' && it.key !== 'DELETE_ROWS' && it.key !== 'INSERT_CHILDREN').map(item => {
|
|
1579
|
+
return toolbarItems?.filter(it => it.position !== 'Bottom' && it.visible !== false && it.fixedRight !== false && it.key !== 'DUPLICATE' && it.key !== 'INSERT_BEFORE' && it.key !== 'INSERT_AFTER' && it.key !== 'DELETE_ROWS' && it.key !== 'INSERT_CHILDREN').map(item => {
|
|
1580
1580
|
if (item.key === 'ADD') {
|
|
1581
1581
|
return {
|
|
1582
1582
|
...item,
|
|
@@ -1637,7 +1637,7 @@ const TableContainerEdit = props => {
|
|
|
1637
1637
|
};
|
|
1638
1638
|
});
|
|
1639
1639
|
}
|
|
1640
|
-
return toolbarItems?.filter(it => it.position !== 'Bottom' && it.visible !== false).map(item => {
|
|
1640
|
+
return toolbarItems?.filter(it => it.position !== 'Bottom' && it.visible !== false && it.fixedRight !== false).map(item => {
|
|
1641
1641
|
if (item.key === 'ADD') {
|
|
1642
1642
|
return {
|
|
1643
1643
|
...item,
|
|
@@ -1825,6 +1825,12 @@ const TableContainerEdit = props => {
|
|
|
1825
1825
|
};
|
|
1826
1826
|
});
|
|
1827
1827
|
}, [handleAddMulti, handleDeleteAll, handleDeleteRows, handleDuplicate, handleInsertAfter, handleInsertBefore, handleInsertChild, itemsAdd, rowsFocus, t, toolbarItems]);
|
|
1828
|
+
const toolbarItemTopRight = _react.default.useMemo(() => {
|
|
1829
|
+
if (!toolbarItems) {
|
|
1830
|
+
return undefined;
|
|
1831
|
+
}
|
|
1832
|
+
return toolbarItems.filter(it => it.position !== 'Bottom' && it.fixedRight);
|
|
1833
|
+
}, [toolbarItems]);
|
|
1828
1834
|
const triggerCommandClick = args => {
|
|
1829
1835
|
const {
|
|
1830
1836
|
id: idCommand,
|
|
@@ -2033,7 +2039,8 @@ const TableContainerEdit = props => {
|
|
|
2033
2039
|
style: {
|
|
2034
2040
|
display: 'flex',
|
|
2035
2041
|
justifyContent: 'space-between',
|
|
2036
|
-
alignItems: 'center'
|
|
2042
|
+
alignItems: 'center',
|
|
2043
|
+
gap: '1rem'
|
|
2037
2044
|
}
|
|
2038
2045
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
2039
2046
|
style: {
|
|
@@ -2068,7 +2075,15 @@ const TableContainerEdit = props => {
|
|
|
2068
2075
|
showTotal: (total, range) =>
|
|
2069
2076
|
// @ts-ignore
|
|
2070
2077
|
`${range[0]}-${range[1]} / ${total} ${t ? t(pagination?.locale?.items ?? 'items') : 'items'}`
|
|
2071
|
-
}, pagination)), typeof actionTemplate === 'function' ? actionTemplate() : actionTemplate,
|
|
2078
|
+
}, pagination)), typeof actionTemplate === 'function' ? actionTemplate() : actionTemplate, toolbarItemTopRight && /*#__PURE__*/_react.default.createElement("div", {
|
|
2079
|
+
style: {
|
|
2080
|
+
flex: 1,
|
|
2081
|
+
overflow: 'hidden'
|
|
2082
|
+
}
|
|
2083
|
+
}, /*#__PURE__*/_react.default.createElement(_rcMasterUi.Toolbar, {
|
|
2084
|
+
items: toolbarItemTopRight,
|
|
2085
|
+
mode: toolbarMode
|
|
2086
|
+
})), fullScreen !== false && (isFullScreen ? /*#__PURE__*/_react.default.createElement(_becoxyIcons.Minimize, {
|
|
2072
2087
|
fontSize: 16,
|
|
2073
2088
|
onClick: () => {
|
|
2074
2089
|
setIsFullScreen(!isFullScreen);
|
|
@@ -251,7 +251,12 @@ const TableBodyCell = props => {
|
|
|
251
251
|
className: "ui-rc-table-row-expand-icon ui-rc-table-row-expand-icon-collapsed"
|
|
252
252
|
})) : /*#__PURE__*/_react.default.createElement("span", {
|
|
253
253
|
className: "ui-rc-table-row-expand-icon ui-rc-table-row-expand-icon-spaced"
|
|
254
|
-
}))),
|
|
254
|
+
}))), isLastLeftPinnedColumn ? /*#__PURE__*/_react.default.createElement("span", {
|
|
255
|
+
className: "ui-rc_cell-content"
|
|
256
|
+
}, renderCellIndex({
|
|
257
|
+
cell,
|
|
258
|
+
pagination
|
|
259
|
+
})) : renderCellIndex({
|
|
255
260
|
cell,
|
|
256
261
|
pagination
|
|
257
262
|
}));
|
|
@@ -342,7 +347,7 @@ const TableBodyCell = props => {
|
|
|
342
347
|
className: (0, _classnames.default)(`${prefix}-grid-cell`, {
|
|
343
348
|
// [`${prefix}-grid-cell-ellipsis`]: true,
|
|
344
349
|
|
|
345
|
-
[`${prefix}-grid-cell-ellipsis`]: !wrapSettings || !(wrapSettings && (wrapSettings.wrapMode === 'Both' || wrapSettings.wrapMode === 'Content')),
|
|
350
|
+
[`${prefix}-grid-cell-ellipsis`]: !isLastLeftPinnedColumn && !wrapSettings || !(wrapSettings && (wrapSettings.wrapMode === 'Both' || wrapSettings.wrapMode === 'Content')),
|
|
346
351
|
[`${prefix}-grid-cell-text-wrap`]: wrapSettings && (wrapSettings.wrapMode === 'Both' || wrapSettings.wrapMode === 'Content'),
|
|
347
352
|
// [`${prefix}-grid-cell-selected`]: isCellSelected,
|
|
348
353
|
|
|
@@ -473,6 +478,17 @@ const TableBodyCell = props => {
|
|
|
473
478
|
className: "ui-rc-table-row-expand-icon ui-rc-table-row-expand-icon-collapsed"
|
|
474
479
|
})) : /*#__PURE__*/_react.default.createElement("span", {
|
|
475
480
|
className: "ui-rc-table-row-expand-icon ui-rc-table-row-expand-icon-spaced"
|
|
476
|
-
}))), groupValue ? groupValue : cellContent) : /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null,
|
|
481
|
+
}))), groupValue ? groupValue : cellContent) : /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, isLastLeftPinnedColumn ? /*#__PURE__*/_react.default.createElement("div", {
|
|
482
|
+
className: (0, _classnames.default)('ui-rc_cell-content', {
|
|
483
|
+
[`${prefix}-grid-cell-ellipsis`]: !wrapSettings || !(wrapSettings && (wrapSettings.wrapMode === 'Both' || wrapSettings.wrapMode === 'Content')),
|
|
484
|
+
[`${prefix}-grid-cell-text-wrap`]: wrapSettings && (wrapSettings.wrapMode === 'Both' || wrapSettings.wrapMode === 'Content'),
|
|
485
|
+
// [`${prefix}-grid-cell-selected`]: isCellSelected,
|
|
486
|
+
|
|
487
|
+
[`${prefix}-grid-cell-fix-left-last`]: isLastLeftPinnedColumn,
|
|
488
|
+
[`${prefix}-grid-cell-fix-right-first`]: isFirstRightPinnedColumn,
|
|
489
|
+
[`${prefix}-grid-cell-text-center`]: columnMeta?.textAlign === 'center',
|
|
490
|
+
[`${prefix}-grid-cell-text-right`]: columnMeta?.textAlign === 'right' || columnMeta.type === 'number'
|
|
491
|
+
})
|
|
492
|
+
}, groupValue ? groupValue : cellContent) : groupValue ? groupValue : cellContent));
|
|
477
493
|
};
|
|
478
494
|
var _default = exports.default = TableBodyCell;
|
|
@@ -318,6 +318,10 @@ function groupArrayByColumns(arr, columns) {
|
|
|
318
318
|
|
|
319
319
|
columns.forEach((column, index) => {
|
|
320
320
|
const value = item[column];
|
|
321
|
+
if (value === null || value === undefined) {
|
|
322
|
+
// Nếu giá trị nhóm là null/undefined thì bỏ qua cột này
|
|
323
|
+
return;
|
|
324
|
+
}
|
|
321
325
|
|
|
322
326
|
// Tạo key unique cho group dựa trên value của cột
|
|
323
327
|
// Tìm existing item ở level hiện tại
|
|
@@ -6,16 +6,16 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.GridStyle = void 0;
|
|
8
8
|
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
9
|
-
const color =
|
|
10
|
-
const BgColor =
|
|
11
|
-
const rowSelectedBg =
|
|
12
|
-
const cellSelectedBg =
|
|
13
|
-
const borderSelectedColor =
|
|
14
|
-
const tableBorderColor =
|
|
15
|
-
const tableBorderColorDark =
|
|
16
|
-
const BgColorDark =
|
|
17
|
-
const colorDark =
|
|
9
|
+
const color = '#000000de';
|
|
10
|
+
const BgColor = '#ffffff';
|
|
11
|
+
const rowSelectedBg = '#FEF2EF';
|
|
12
|
+
const cellSelectedBg = '#F3F8FF';
|
|
13
|
+
const borderSelectedColor = '#0550C5';
|
|
14
|
+
const tableBorderColor = '#e0e0e0';
|
|
15
|
+
const tableBorderColorDark = '#44485E';
|
|
16
|
+
const BgColorDark = '#343e59';
|
|
17
|
+
const colorDark = '#e6e4f3e6';
|
|
18
18
|
const GridStyle = exports.GridStyle = _styledComponents.default.div.withConfig({
|
|
19
19
|
displayName: "GridStyle",
|
|
20
20
|
componentId: "es-grid-template__sc-rs980s-0"
|
|
21
|
-
})(["&.", "-grid{color:", ";font-size:13px;background-color:", ";table{table-layout:fixed;border-collapse:separate;border-spacing:0;}.", "-grid-container{border:1px solid ", ";.", "-grid-thead{&:has(.resizer.isResizing){.", "-grid-cell{touch-action:none;user-select:none;}}.", "-grid-cell{background-color:#ffffff;&:has(.resizer.isResizing){touch-action:none;user-select:none;}.resizer{cursor:col-resize;height:100%;position:absolute;right:0;top:0;touch-action:none;user-select:none;width:5px;}}}tbody{.", "-grid-row{&.", "-grid-row-parent{.", "-grid-cell{font-weight:600;background-color:#f5f5f5;}}}}.", "-grid-tfoot{z-index:3 !important;.ui-rc-grid-footer-row{.ui-rc-grid-cell{border-top:1px solid ", ";border-bottom:1px solid ", ";font-weight:500;}}}.", "-grid-cell{padding:5px 8px
|
|
21
|
+
})(["&.", "-grid{color:", ";font-size:13px;background-color:", ";table{table-layout:fixed;border-collapse:separate;border-spacing:0;}.", "-grid-container{border:1px solid ", ";.", "-grid-thead{&:has(.resizer.isResizing){.", "-grid-cell{touch-action:none;user-select:none;}}.", "-grid-cell{background-color:#ffffff;&:has(.resizer.isResizing){touch-action:none;user-select:none;}.resizer{cursor:col-resize;height:100%;position:absolute;right:0;top:0;touch-action:none;user-select:none;width:5px;}}}tbody{.", "-grid-row{&.", "-grid-row-parent{.", "-grid-cell{font-weight:600;background-color:#f5f5f5;}}}}.", "-grid-tfoot{z-index:3 !important;.ui-rc-grid-footer-row{.ui-rc-grid-cell{border-top:1px solid ", ";border-bottom:1px solid ", ";font-weight:500;}}}.", "-grid-cell{padding:5px 8px;&.", "-grid-cell-fix-left-last{.", "-grid-cell-ellipsis{overflow:hidden;white-space:nowrap;text-overflow:ellipsis;word-break:keep-all;}&::after{position:absolute;top:0;right:0;bottom:-1px;width:30px;transform:translateX(100%);transition:box-shadow 0.3s;content:'';pointer-events:none;box-shadow:inset 10px 0 8px -8px rgba(5,5,5,0.09);}}&.", "-grid-cell-fix-right-first{.", "-grid-cell-ellipsis{overflow:hidden;white-space:nowrap;text-overflow:ellipsis;word-break:keep-all;}&::after{position:absolute;top:0;bottom:-1px;left:0;width:30px;transform:translateX(-100%);transition:box-shadow 0.3s;content:'';pointer-events:none;box-shadow:inset -10px 0 8px -8px rgba(5,5,5,0.09);}&::before{content:'';position:absolute;inset-block:0;inset-inline-start:-1px;border-inline-start:1px solid #e0e0e0;}}.class-content:has(*){background:lightblue;}.class-content:not(:has(*)){background:lightgreen;}&.", "-grid-cell-text-center{text-align:center;justify-content:center;}&.", "-grid-cell-text-righ{text-align:right;justify-content:flex-end;}}.", "-grid-cell:not(:has(*)){&.", "-grid-cell-text-center{text-align:center;justify-content:center;}&.", "-grid-cell-text-right{text-align:right;justify-content:flex-end;}&.", "-grid-cell-ellipsis{overflow:hidden;white-space:nowrap;text-overflow:ellipsis;word-break:keep-all;}}}&.", "-grid-light{.", "-grid-container{.", "-grid-thead{z-index:3 !important;background-color:", ";font-weight:500;.", "-grid-cell{font-weight:inherit;color:", ";background-color:#ffffff;border-inline-end:1px solid ", ";border-bottom:1px solid ", ";&.ui-rc-grid-cell-ellipsis{.ui-rc-table-column-title,.", "-grid-cell-ellipsis{width:100%;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;word-break:keep-all;}}&.ui-rc-grid-cell-wrap{.ui-rc-table-column-title,.", "-grid-cell-text-wrap{white-space:normal;word-break:break-word;overflow:hidden;}}&:hover{.ui-rc-header-trigger{.ui-rc-table-column-sorter-cancel{opacity:1;}}}.", "-grid-filter-column{display:flex;justify-content:space-between;width:100%;align-items:center;position:relative;}.ui-rc-header-trigger{padding-left:6px;display:flex;align-items:center;.ui-rc-table-column-sorter-cancel{opacity:0;}}.resizer{cursor:col-resize;height:100%;position:absolute;right:0;top:0;touch-action:none;user-select:none;width:5px;}.resizer.isResizing{opacity:1;}}}.", "-grid-tbody{.", "-grid-row{background-color:", ";color:", ";}}tbody{background-color:", ";color:", ";.", "-grid-row{&.ui-rc-grid-row-selected{.", "-grid-cell{background-color:", ";}}}.", "-grid-cell{outline:none;background-color:#ffffff;border-inline-end:1px solid ", ";border-bottom:1px solid ", ";&.ui-rc-grid-cell-selected{background-color:", " !important;}&.disable{background-color:#f0f0f0;}&.cell-editable{user-select:none;&.cell-border-top{&::after{content:'';position:absolute;top:0px;left:0;height:1px;width:100%;border-top:1px solid ", ";pointer-events:none;z-index:1;}}&.cell-border-bottom{border-bottom:1px solid ", ";}&.cell-border-left{&::before{content:'';position:absolute;top:0;left:0;height:102%;width:1px;border-left:1px solid ", ";pointer-events:none;z-index:1;}}&.cell-border-right{border-inline-end:1px solid ", ";}&.cell-paste-border-top{&::after{content:'';position:absolute;top:0px;left:0;height:1px;width:100%;border-top:1px dashed #949494;pointer-events:none;z-index:1;}&.ui-rc-grid-cell-fix-left-last{&::after{left:-100%;}}&.ui-rc-grid-cell-fix-right-first{&::after{left:100%;}}}&.cell-paste-border-bottom{border-bottom:1px dashed #949494;}&.cell-paste-border-left{&::before{content:'';position:absolute;top:0;left:0;height:102%;width:1px;border-left:1px dashed #949494;pointer-events:none;z-index:1;}}&.cell-paste-border-right{border-inline-end:1px dashed #949494;}.dragging-point{width:6px;height:6px;position:absolute;cursor:crosshair;right:0px;bottom:0px;&.hidden{display:none;}.dot-point{position:absolute;width:6px;height:6px;border-radius:0px;background-color:", ";bottom:0;right:0;}}}&.cell-editing{padding:0;&:focus-visible{outline:none;}.ant-form-item,.ant-row.ant-form-item-row,.ant-col.ant-form-item-control,.ant-form-item-control-input,.ant-form-item-control-input-content,.ant-input{height:100% !important;&:focus-visible{outline:none;}}textarea.ant-input{line-height:1.8;height:36px !important;min-height:36px !important;}input.be-cell-editing,.ant-picker,.ui-rc-select-selector,.ui-rc-table-select-selector{padding-inline:7px;}.", "-checkbox-wrapper{.", "-checkbox{background-color:red;}.", "-checkbox-input{&:focus-visible{outline:none;}}}.ant-input,.ant-picker{border-radius:0;}.ant-color-picker-trigger{height:100%;border-radius:0;.ant-color-picker-color-block{height:100%;width:100%;}}.", "-table-select-single .", "-table-select-selector,.", "-select-single .", "-select-selector,.ui-rc-table-select-selector{border-radius:0 !important;}.", "-table-select-single:not(.", "-table-select-customize-input){.", "-table-select-selector{.", "-table-select-selection-search-input{height:auto;}}}}}}.", "-grid-tfoot{.", "-grid-footer-row{border-bottom-width:1px;border-bottom-color:", ";border-bottom-style:solid;border-top-width:1px;border-top-color:", ";border-top-style:solid;background-color:#fafafa;}.", "-grid-cell{background-color:inherit;border-inline-end:1px solid ", ";}}}}&.", "-grid-dark{background-color:", ";color:", ";.", "-grid-container{border-color:", ";&::after{border-right-color:", ";}}}}"], props => props.$prefix, color, BgColor, props => props.$prefix, tableBorderColor, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, tableBorderColor, tableBorderColor, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => `${props.$theme.backgroundColor ? props.$theme.backgroundColor : BgColor}`, props => props.$prefix, props => `${props.$theme.color ? props.$theme.color : color}`, tableBorderColor, tableBorderColor, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => `${props.$theme.backgroundColor ? props.$theme.backgroundColor : BgColor}`, props => `${props.$theme.color ? props.$theme.color : color}`, props => `${props.$theme.backgroundColor ? props.$theme.backgroundColor : BgColor}`, props => `${props.$theme.color ? props.$theme.color : color}`, props => props.$prefix, props => props.$prefix, rowSelectedBg, props => props.$prefix, tableBorderColor, tableBorderColor, cellSelectedBg, borderSelectedColor, borderSelectedColor, borderSelectedColor, borderSelectedColor, borderSelectedColor, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, tableBorderColor, tableBorderColor, props => props.$prefix, tableBorderColor, props => props.$prefix, BgColorDark, colorDark, props => props.$prefix, tableBorderColorDark, tableBorderColorDark);
|
|
@@ -117,6 +117,18 @@ const TableContainer = props => {
|
|
|
117
117
|
document.removeEventListener('mousedown', handleClickOutside);
|
|
118
118
|
};
|
|
119
119
|
}, []);
|
|
120
|
+
const toolbarItemTop = _react.default.useMemo(() => {
|
|
121
|
+
if (!toolbarItems) {
|
|
122
|
+
return undefined;
|
|
123
|
+
}
|
|
124
|
+
return toolbarItems.filter(it => it.position !== 'Bottom' && it.fixedRight !== false);
|
|
125
|
+
}, [toolbarItems]);
|
|
126
|
+
const toolbarItemTopRight = _react.default.useMemo(() => {
|
|
127
|
+
if (!toolbarItems) {
|
|
128
|
+
return undefined;
|
|
129
|
+
}
|
|
130
|
+
return toolbarItems.filter(it => it.position !== 'Bottom' && it.fixedRight);
|
|
131
|
+
}, [toolbarItems]);
|
|
120
132
|
const triggerCommandClick = args => {
|
|
121
133
|
// const { id: idCommand, rowId, rowData, index } = args
|
|
122
134
|
|
|
@@ -189,7 +201,7 @@ const TableContainer = props => {
|
|
|
189
201
|
overflow: 'hidden'
|
|
190
202
|
}
|
|
191
203
|
}, /*#__PURE__*/_react.default.createElement(_rcMasterUi.Toolbar, {
|
|
192
|
-
items:
|
|
204
|
+
items: toolbarItemTop ?? [],
|
|
193
205
|
mode: toolbarMode
|
|
194
206
|
})), /*#__PURE__*/_react.default.createElement("div", {
|
|
195
207
|
style: {
|
|
@@ -206,7 +218,15 @@ const TableContainer = props => {
|
|
|
206
218
|
showTotal: (totalItems, range) =>
|
|
207
219
|
// @ts-ignore
|
|
208
220
|
`${range[0]}-${range[1]} / ${totalItems} ${t ? t(pagination?.locale?.items ?? 'items') : 'items'}`
|
|
209
|
-
}, pagination)), typeof actionTemplate === 'function' ? actionTemplate() : actionTemplate,
|
|
221
|
+
}, pagination)), typeof actionTemplate === 'function' ? actionTemplate() : actionTemplate, toolbarItemTopRight && /*#__PURE__*/_react.default.createElement("div", {
|
|
222
|
+
style: {
|
|
223
|
+
flex: 1,
|
|
224
|
+
overflow: 'hidden'
|
|
225
|
+
}
|
|
226
|
+
}, /*#__PURE__*/_react.default.createElement(_rcMasterUi.Toolbar, {
|
|
227
|
+
items: toolbarItemTopRight,
|
|
228
|
+
mode: toolbarMode
|
|
229
|
+
})), fullScreen !== false && (isFullScreen ? /*#__PURE__*/_react.default.createElement(_becoxyIcons.Minimize, {
|
|
210
230
|
fontSize: 16,
|
|
211
231
|
onClick: () => {
|
|
212
232
|
setIsFullScreen(!isFullScreen);
|