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.
@@ -657,6 +657,7 @@ export type ToolbarItem = {
657
657
  title?: React.ReactNode;
658
658
  disabled?: boolean;
659
659
  hasMenu?: boolean;
660
+ fixedRight?: boolean;
660
661
  [key: string]: any;
661
662
  };
662
663
  export type LoadOptionsArgs = {
@@ -166,6 +166,16 @@ const InternalTable = props => {
166
166
  ...a
167
167
  });
168
168
  }, [columns]);
169
+
170
+ // React.useEffect(() => {
171
+ // const a = getInvisibleColumns(columns)
172
+
173
+ // const bcd = convertToObj(groupColumns)
174
+
175
+ // setColumnVisibility({...a, ...bcd})
176
+
177
+ // }, [columns, groupColumns])
178
+
169
179
  const [columnsHiddenKeys, setColumnsHiddenKeys] = useMergedState(undefined, {
170
180
  value: undefined
171
181
  });
@@ -1432,6 +1432,221 @@ const TableContainerEdit = props => {
1432
1432
  triggerChangeData?.([...newData]);
1433
1433
  }
1434
1434
  };
1435
+ const toolbarItemsTop = React.useMemo(() => {
1436
+ if (!rowsFocus || rowsFocus.length === 0) {
1437
+ 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 => {
1438
+ if (item.key === 'ADD') {
1439
+ return {
1440
+ ...item,
1441
+ template: () => {
1442
+ return /*#__PURE__*/React.createElement(Fragment, null, item.key === 'ADD' && /*#__PURE__*/React.createElement("div", {
1443
+ className: classNames(`be-toolbar-item`, item?.className)
1444
+ }, /*#__PURE__*/React.createElement(Dropdown.Button, {
1445
+ overlayClassName: 'be-popup-container',
1446
+ trigger: ['click'],
1447
+ style: {
1448
+ color: '#28c76f',
1449
+ borderColor: '#28c76f'
1450
+ },
1451
+ className: 'toolbar-button toolbar-dropdown-button',
1452
+ menu: {
1453
+ items: itemsAdd,
1454
+ onClick: e => handleAddMulti(item, Number(e.key))
1455
+ }
1456
+ }, /*#__PURE__*/React.createElement("span", {
1457
+ style: {
1458
+ color: '#28c76f'
1459
+ },
1460
+ onClick: () => handleAddMulti(item, 1)
1461
+ }, item.label ? t ? t(item.label) : item.label : t ? t('Add item') : 'Add item'))));
1462
+ }
1463
+ };
1464
+ }
1465
+ if (item.key === 'DELETE') {
1466
+ return {
1467
+ ...item,
1468
+ template: () => {
1469
+ return /*#__PURE__*/React.createElement("div", {
1470
+ className: classNames(`be-toolbar-item`, item?.className)
1471
+ }, /*#__PURE__*/React.createElement(Button, {
1472
+ style: {
1473
+ color: '#eb4619',
1474
+ borderColor: '#eb4619'
1475
+ },
1476
+ variant: 'outlined',
1477
+ onClick: () => handleDeleteAll(item),
1478
+ className: "d-flex toolbar-button"
1479
+ }, item.label ? t ? t(item.label) : item.label : t ? t('Delete all item') : 'Delete all item'));
1480
+ }
1481
+ };
1482
+ }
1483
+ return {
1484
+ ...item
1485
+ };
1486
+ });
1487
+ }
1488
+ return toolbarItems?.filter(it => it.position === 'Bottom' && it.visible !== false).map(item => {
1489
+ if (item.key === 'ADD') {
1490
+ return {
1491
+ ...item,
1492
+ template: () => {
1493
+ return /*#__PURE__*/React.createElement(Fragment, null, item.key === 'ADD' && /*#__PURE__*/React.createElement("div", {
1494
+ className: classNames(`be-toolbar-item`, item?.className)
1495
+ }, /*#__PURE__*/React.createElement(Dropdown.Button, {
1496
+ overlayClassName: 'be-popup-container',
1497
+ style: {
1498
+ color: '#28c76f',
1499
+ borderColor: '#28c76f'
1500
+ },
1501
+ className: 'toolbar-button toolbar-dropdown-button',
1502
+ menu: {
1503
+ items: itemsAdd,
1504
+ onClick: e => handleAddMulti(item, Number(e.key))
1505
+ }
1506
+ }, /*#__PURE__*/React.createElement("span", {
1507
+ style: {
1508
+ color: '#28c76f'
1509
+ },
1510
+ onClick: () => handleAddMulti(item, 1)
1511
+ }, item.label ? t ? t(item.label) : item.label : t ? t('Add item') : 'Add item'))));
1512
+ }
1513
+ };
1514
+ }
1515
+ if (item.key === 'DUPLICATE') {
1516
+ return {
1517
+ ...item,
1518
+ template: () => {
1519
+ return /*#__PURE__*/React.createElement(Fragment, null, item.key === 'DUPLICATE' && item.visible !== false && rowsFocus.length > 0 && /*#__PURE__*/React.createElement("div", {
1520
+ className: classNames(`be-toolbar-item`, item?.className)
1521
+ }, /*#__PURE__*/React.createElement(Button, {
1522
+ style: {
1523
+ color: '#28c76f',
1524
+ borderColor: '#28c76f'
1525
+ },
1526
+ variant: 'outlined',
1527
+ onClick: handleDuplicate,
1528
+ className: "d-flex toolbar-button"
1529
+ }, item.label ? t ? t(item.label) : item.label : t ? t('Duplicate') : 'Duplicate')));
1530
+ }
1531
+ };
1532
+ }
1533
+ if (item.key === 'INSERT_BEFORE') {
1534
+ return {
1535
+ ...item,
1536
+ template: () => {
1537
+ return /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement("div", {
1538
+ className: classNames(`be-toolbar-item`, item?.className)
1539
+ }, /*#__PURE__*/React.createElement(Dropdown.Button, {
1540
+ overlayClassName: 'be-popup-container',
1541
+ style: {
1542
+ color: '#28c76f',
1543
+ borderColor: '#28c76f'
1544
+ },
1545
+ className: 'toolbar-button toolbar-dropdown-button',
1546
+ menu: {
1547
+ items: itemsAdd,
1548
+ onClick: e => handleInsertBefore(item, Number(e.key))
1549
+ }
1550
+ }, /*#__PURE__*/React.createElement("span", {
1551
+ style: {
1552
+ color: '#28c76f'
1553
+ },
1554
+ onClick: () => handleInsertBefore(item, 1)
1555
+ }, item.label ? t ? t(item.label) : item.label : t ? t('Insert item before') : 'Insert item before'))));
1556
+ }
1557
+ };
1558
+ }
1559
+ if (item.key === 'INSERT_AFTER') {
1560
+ return {
1561
+ ...item,
1562
+ template: () => {
1563
+ return /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement("div", {
1564
+ className: classNames(`be-toolbar-item`, item?.className)
1565
+ }, /*#__PURE__*/React.createElement(Dropdown.Button, {
1566
+ overlayClassName: 'be-popup-container',
1567
+ style: {
1568
+ color: '#28c76f',
1569
+ borderColor: '#28c76f'
1570
+ },
1571
+ className: 'toolbar-button toolbar-dropdown-button',
1572
+ menu: {
1573
+ items: itemsAdd,
1574
+ onClick: e => handleInsertAfter(item, Number(e.key))
1575
+ }
1576
+ }, /*#__PURE__*/React.createElement("span", {
1577
+ style: {
1578
+ color: '#28c76f'
1579
+ },
1580
+ onClick: () => handleInsertAfter(item, 1)
1581
+ }, item.label ? t ? t(item.label) : item.label : t ? t('Insert item after') : 'Insert item after'))));
1582
+ }
1583
+ };
1584
+ }
1585
+ if (item.key === 'INSERT_CHILDREN') {
1586
+ return {
1587
+ ...item,
1588
+ template: () => {
1589
+ return /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement("div", {
1590
+ className: classNames(`be-toolbar-item`, item?.className)
1591
+ }, /*#__PURE__*/React.createElement(Button, {
1592
+ style: {
1593
+ color: '#28c76f',
1594
+ borderColor: '#28c76f'
1595
+ },
1596
+ variant: 'outlined',
1597
+ onClick: () => handleInsertChild(item),
1598
+ className: "d-flex toolbar-button"
1599
+ }, item.label ? t ? t(item.label) : item.label : t ? t('Insert item children') : 'Insert item children')));
1600
+ }
1601
+ };
1602
+ }
1603
+ if (item.key === 'DELETE') {
1604
+ return {
1605
+ ...item,
1606
+ template: () => {
1607
+ return /*#__PURE__*/React.createElement("div", {
1608
+ className: classNames(`be-toolbar-item`, item?.className)
1609
+ }, /*#__PURE__*/React.createElement(Button, {
1610
+ style: {
1611
+ color: '#eb4619',
1612
+ borderColor: '#eb4619'
1613
+ },
1614
+ variant: 'outlined',
1615
+ onClick: handleDeleteAll,
1616
+ className: "d-flex toolbar-button"
1617
+ }, item.label ? t ? t(item.label) : item.label : t ? t('Delete all item') : 'Delete all item'));
1618
+ }
1619
+ };
1620
+ }
1621
+ if (item.key === 'DELETE_ROWS') {
1622
+ return {
1623
+ ...item,
1624
+ template: () => {
1625
+ return /*#__PURE__*/React.createElement("div", {
1626
+ className: classNames(`be-toolbar-item`, item?.className)
1627
+ }, /*#__PURE__*/React.createElement(Button, {
1628
+ style: {
1629
+ color: '#eb4619',
1630
+ borderColor: '#eb4619'
1631
+ },
1632
+ variant: 'outlined',
1633
+ onClick: () => handleDeleteRows(item),
1634
+ className: "d-flex toolbar-button"
1635
+ }, t ? `${t('Delete')} ${rowsFocus.length} ${t('row')}` : `Delete ${rowsFocus.length} item`));
1636
+ }
1637
+ };
1638
+ }
1639
+ return {
1640
+ ...item
1641
+ };
1642
+ });
1643
+ }, [handleAddMulti, handleDeleteAll, handleDeleteRows, handleDuplicate, handleInsertAfter, handleInsertBefore, handleInsertChild, itemsAdd, rowsFocus, t, toolbarItems]);
1644
+ const toolbarItemTopRight = React.useMemo(() => {
1645
+ if (!toolbarItems) {
1646
+ return undefined;
1647
+ }
1648
+ return toolbarItems.filter(it => it.position !== 'Bottom' && it.fixedRight && it.visible !== false);
1649
+ }, [toolbarItems]);
1435
1650
  const toolbarItemsBottom = React.useMemo(() => {
1436
1651
  if (!rowsFocus || rowsFocus.length === 0) {
1437
1652
  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 => {
@@ -1900,7 +2115,7 @@ const TableContainerEdit = props => {
1900
2115
  overflow: 'hidden'
1901
2116
  }
1902
2117
  }, /*#__PURE__*/React.createElement(Toolbar, {
1903
- items: (toolbarItems ?? []).filter(it => it.position !== 'Bottom'),
2118
+ items: toolbarItemsTop ?? [],
1904
2119
  mode: 'scroll'
1905
2120
  })), /*#__PURE__*/React.createElement("div", {
1906
2121
  style: {
@@ -1917,7 +2132,15 @@ const TableContainerEdit = props => {
1917
2132
  showTotal: (total, range) =>
1918
2133
  // @ts-ignore
1919
2134
  `${range[0]}-${range[1]} / ${total} ${t ? t(pagination?.locale?.items ?? 'items') : 'items'}`
1920
- }, pagination)), typeof actionTemplate === 'function' ? actionTemplate() : actionTemplate, fullScreen !== false && (isFullScreen ? /*#__PURE__*/React.createElement(Minimize, {
2135
+ }, pagination)), typeof actionTemplate === 'function' ? actionTemplate() : actionTemplate, toolbarItemTopRight && /*#__PURE__*/React.createElement("div", {
2136
+ style: {
2137
+ flex: 1,
2138
+ overflow: 'hidden'
2139
+ }
2140
+ }, /*#__PURE__*/React.createElement(Toolbar, {
2141
+ items: toolbarItemTopRight,
2142
+ mode: 'responsive'
2143
+ })), fullScreen !== false && (isFullScreen ? /*#__PURE__*/React.createElement(Minimize, {
1921
2144
  fontSize: 16,
1922
2145
  onClick: () => {
1923
2146
  setIsFullScreen(!isFullScreen);
@@ -1959,7 +2182,10 @@ const TableContainerEdit = props => {
1959
2182
  originData,
1960
2183
  wrapSettings,
1961
2184
  recordDoubleClick,
1962
- selectionSettings,
2185
+ selectionSettings: {
2186
+ ...selectionSettings,
2187
+ checkboxOnly: true
2188
+ },
1963
2189
  isSelectionChange,
1964
2190
  setIsSelectionChange,
1965
2191
  // onContextMenu,
@@ -194,10 +194,10 @@ export declare const fixColumnsLeft: <RecordType>(columns: ColumnTable<RecordTyp
194
194
  value: any;
195
195
  rowData: RecordType;
196
196
  }) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | import("react").ReactNode);
197
- onCellStyles?: Omit<CSSProperties, "width" | "minWidth" | "right" | "left" | "position" | "display"> | ((cellValue: any, cell: import("@tanstack/react-table").Cell<RecordType, unknown>) => Omit<CSSProperties, "width" | "minWidth" | "right" | "left" | "position" | "display">);
198
- onCellHeaderStyles?: Omit<CSSProperties, "width" | "minWidth" | "right" | "left" | "position" | "display"> | ((cell: import("@tanstack/react-table").Header<RecordType, unknown>) => Omit<CSSProperties, "width" | "minWidth" | "right" | "left" | "position" | "display">);
197
+ onCellStyles?: Omit<CSSProperties, "left" | "right" | "display" | "width" | "minWidth" | "position"> | ((cellValue: any, cell: import("@tanstack/react-table").Cell<RecordType, unknown>) => Omit<CSSProperties, "left" | "right" | "display" | "width" | "minWidth" | "position">);
198
+ onCellHeaderStyles?: Omit<CSSProperties, "left" | "right" | "display" | "width" | "minWidth" | "position"> | ((cell: import("@tanstack/react-table").Header<RecordType, unknown>) => Omit<CSSProperties, "left" | "right" | "display" | "width" | "minWidth" | "position">);
199
199
  onCell?: (rowData: RecordType, index: number) => import("react").TdHTMLAttributes<HTMLTableCellElement>;
200
- onCellFooterStyles?: Omit<CSSProperties, "width" | "minWidth" | "right" | "left" | "position" | "display"> | ((cellValue: any, cell: import("@tanstack/react-table").Header<RecordType, unknown>) => Omit<CSSProperties, "width" | "minWidth" | "right" | "left" | "position" | "display">);
200
+ onCellFooterStyles?: Omit<CSSProperties, "left" | "right" | "display" | "width" | "minWidth" | "position"> | ((cellValue: any, cell: import("@tanstack/react-table").Header<RecordType, unknown>) => Omit<CSSProperties, "left" | "right" | "display" | "width" | "minWidth" | "position">);
201
201
  getValue?: (row: any, rowIndex: number) => any;
202
202
  getCellProps?: (value: any, row: any, rowIndex: number) => import("./../../grid-component/type").CellProps;
203
203
  headerCellProps?: import("./../../grid-component/type").CellProps;
@@ -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 = {
@@ -89,7 +89,6 @@ const TableContainer = props => {
89
89
  const [tableHeight, settableHeight] = React.useState(0);
90
90
  const [focusedCell, setFocusedCell] = React.useState(undefined);
91
91
  React.useEffect(() => {
92
- // const totalHeight = minHeight ?? height
93
92
  const totalHeight = getTableHeight(height, minHeight);
94
93
  if (totalHeight) {
95
94
  const topHeight = topToolbarRef.current ? topToolbarRef.current.offsetHeight : 0;
@@ -197,6 +196,24 @@ const TableContainer = props => {
197
196
  // })
198
197
  }
199
198
  }, [columnSizingInfo]);
199
+ const toolbarItemTop = React.useMemo(() => {
200
+ if (!toolbarItems) {
201
+ return undefined;
202
+ }
203
+ return toolbarItems.filter(it => it.position !== 'Bottom' && it.fixedRight !== false);
204
+ }, [toolbarItems]);
205
+ const toolbarItemBottom = React.useMemo(() => {
206
+ if (!toolbarItems) {
207
+ return undefined;
208
+ }
209
+ return toolbarItems.filter(it => it.position === 'Bottom');
210
+ }, [toolbarItems]);
211
+ const toolbarItemTopRight = React.useMemo(() => {
212
+ if (!toolbarItems) {
213
+ return undefined;
214
+ }
215
+ return toolbarItems.filter(it => it.position !== 'Bottom' && it.fixedRight);
216
+ }, [toolbarItems]);
200
217
  const triggerCommandClick = args => {
201
218
  // const { id: idCommand, rowId, rowData, index } = args
202
219
 
@@ -219,7 +236,8 @@ const TableContainer = props => {
219
236
  style: {
220
237
  display: 'flex',
221
238
  justifyContent: 'space-between',
222
- alignItems: 'center'
239
+ alignItems: 'center',
240
+ gap: '1rem'
223
241
  }
224
242
  }, /*#__PURE__*/React.createElement("div", {
225
243
  style: {
@@ -227,7 +245,7 @@ const TableContainer = props => {
227
245
  overflow: 'hidden'
228
246
  }
229
247
  }, /*#__PURE__*/React.createElement(Toolbar, {
230
- items: (toolbarItems ?? []).filter(it => it.position !== 'Bottom')
248
+ items: toolbarItemTop ?? []
231
249
  // mode={'scroll'}
232
250
  ,
233
251
  mode: toolbarMode
@@ -246,7 +264,15 @@ const TableContainer = props => {
246
264
  showTotal: (totalItems, range) =>
247
265
  // @ts-ignore
248
266
  `${range[0]}-${range[1]} / ${totalItems} ${t ? t(pagination?.locale?.items ?? 'items') : 'items'}`
249
- }, pagination)), typeof actionTemplate === 'function' ? actionTemplate() : actionTemplate, fullScreen !== false && (isFullScreen ? /*#__PURE__*/React.createElement(Minimize, {
267
+ }, pagination)), typeof actionTemplate === 'function' ? actionTemplate() : actionTemplate, toolbarItemTopRight && /*#__PURE__*/React.createElement("div", {
268
+ style: {
269
+ flex: 1,
270
+ overflow: 'hidden'
271
+ }
272
+ }, /*#__PURE__*/React.createElement(Toolbar, {
273
+ items: toolbarItemTopRight,
274
+ mode: toolbarMode
275
+ })), fullScreen !== false && (isFullScreen ? /*#__PURE__*/React.createElement(Minimize, {
250
276
  fontSize: 16,
251
277
  onClick: () => {
252
278
  setIsFullScreen(!isFullScreen);
@@ -341,7 +367,17 @@ const TableContainer = props => {
341
367
  fixedRightColumns: fixedRightColumns
342
368
  }))), /*#__PURE__*/React.createElement("div", {
343
369
  ref: bottomToolbarRef
344
- }, pagination && !infiniteScroll && /*#__PURE__*/React.createElement(Pagination, _extends({
370
+ }, /*#__PURE__*/React.createElement("div", {
371
+ style: {
372
+ flex: 1,
373
+ overflow: 'hidden'
374
+ }
375
+ }, /*#__PURE__*/React.createElement(Toolbar, {
376
+ items: toolbarItemBottom ?? []
377
+ // mode={'scroll'}
378
+ ,
379
+ mode: toolbarMode
380
+ })), pagination && !infiniteScroll && /*#__PURE__*/React.createElement(Pagination, _extends({
345
381
  pageSizeOptions: [20, 50, 100, 1000, 10000],
346
382
  rootClassName: 'pagination-template',
347
383
  showSizeChanger: true,
@@ -1575,7 +1575,7 @@ const TableContainerEdit = props => {
1575
1575
  const toolbarItemsTop = React.useMemo(() => {
1576
1576
  // Chưa có dòng| ô được chọn
1577
1577
  if (!rowsFocus || rowsFocus.length === 0) {
1578
- 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 => {
1578
+ 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 => {
1579
1579
  if (item.key === 'ADD') {
1580
1580
  return {
1581
1581
  ...item,
@@ -1636,7 +1636,7 @@ const TableContainerEdit = props => {
1636
1636
  };
1637
1637
  });
1638
1638
  }
1639
- return toolbarItems?.filter(it => it.position !== 'Bottom' && it.visible !== false).map(item => {
1639
+ return toolbarItems?.filter(it => it.position !== 'Bottom' && it.visible !== false && it.fixedRight !== false).map(item => {
1640
1640
  if (item.key === 'ADD') {
1641
1641
  return {
1642
1642
  ...item,
@@ -1824,6 +1824,12 @@ const TableContainerEdit = props => {
1824
1824
  };
1825
1825
  });
1826
1826
  }, [handleAddMulti, handleDeleteAll, handleDeleteRows, handleDuplicate, handleInsertAfter, handleInsertBefore, handleInsertChild, itemsAdd, rowsFocus, t, toolbarItems]);
1827
+ const toolbarItemTopRight = React.useMemo(() => {
1828
+ if (!toolbarItems) {
1829
+ return undefined;
1830
+ }
1831
+ return toolbarItems.filter(it => it.position !== 'Bottom' && it.fixedRight);
1832
+ }, [toolbarItems]);
1827
1833
  const triggerCommandClick = args => {
1828
1834
  const {
1829
1835
  id: idCommand,
@@ -2032,7 +2038,8 @@ const TableContainerEdit = props => {
2032
2038
  style: {
2033
2039
  display: 'flex',
2034
2040
  justifyContent: 'space-between',
2035
- alignItems: 'center'
2041
+ alignItems: 'center',
2042
+ gap: '1rem'
2036
2043
  }
2037
2044
  }, /*#__PURE__*/React.createElement("div", {
2038
2045
  style: {
@@ -2067,7 +2074,15 @@ const TableContainerEdit = props => {
2067
2074
  showTotal: (total, range) =>
2068
2075
  // @ts-ignore
2069
2076
  `${range[0]}-${range[1]} / ${total} ${t ? t(pagination?.locale?.items ?? 'items') : 'items'}`
2070
- }, pagination)), typeof actionTemplate === 'function' ? actionTemplate() : actionTemplate, fullScreen !== false && (isFullScreen ? /*#__PURE__*/React.createElement(Minimize, {
2077
+ }, pagination)), typeof actionTemplate === 'function' ? actionTemplate() : actionTemplate, toolbarItemTopRight && /*#__PURE__*/React.createElement("div", {
2078
+ style: {
2079
+ flex: 1,
2080
+ overflow: 'hidden'
2081
+ }
2082
+ }, /*#__PURE__*/React.createElement(Toolbar, {
2083
+ items: toolbarItemTopRight,
2084
+ mode: toolbarMode
2085
+ })), fullScreen !== false && (isFullScreen ? /*#__PURE__*/React.createElement(Minimize, {
2071
2086
  fontSize: 16,
2072
2087
  onClick: () => {
2073
2088
  setIsFullScreen(!isFullScreen);
@@ -244,7 +244,12 @@ const TableBodyCell = props => {
244
244
  className: "ui-rc-table-row-expand-icon ui-rc-table-row-expand-icon-collapsed"
245
245
  })) : /*#__PURE__*/React.createElement("span", {
246
246
  className: "ui-rc-table-row-expand-icon ui-rc-table-row-expand-icon-spaced"
247
- }))), renderCellIndex({
247
+ }))), isLastLeftPinnedColumn ? /*#__PURE__*/React.createElement("span", {
248
+ className: "ui-rc_cell-content"
249
+ }, renderCellIndex({
250
+ cell,
251
+ pagination
252
+ })) : renderCellIndex({
248
253
  cell,
249
254
  pagination
250
255
  }));
@@ -335,7 +340,7 @@ const TableBodyCell = props => {
335
340
  className: classNames(`${prefix}-grid-cell`, {
336
341
  // [`${prefix}-grid-cell-ellipsis`]: true,
337
342
 
338
- [`${prefix}-grid-cell-ellipsis`]: !wrapSettings || !(wrapSettings && (wrapSettings.wrapMode === 'Both' || wrapSettings.wrapMode === 'Content')),
343
+ [`${prefix}-grid-cell-ellipsis`]: !isLastLeftPinnedColumn && !wrapSettings || !(wrapSettings && (wrapSettings.wrapMode === 'Both' || wrapSettings.wrapMode === 'Content')),
339
344
  [`${prefix}-grid-cell-text-wrap`]: wrapSettings && (wrapSettings.wrapMode === 'Both' || wrapSettings.wrapMode === 'Content'),
340
345
  // [`${prefix}-grid-cell-selected`]: isCellSelected,
341
346
 
@@ -466,6 +471,17 @@ const TableBodyCell = props => {
466
471
  className: "ui-rc-table-row-expand-icon ui-rc-table-row-expand-icon-collapsed"
467
472
  })) : /*#__PURE__*/React.createElement("span", {
468
473
  className: "ui-rc-table-row-expand-icon ui-rc-table-row-expand-icon-spaced"
469
- }))), groupValue ? groupValue : cellContent) : /*#__PURE__*/React.createElement(React.Fragment, null, groupValue ? groupValue : cellContent));
474
+ }))), groupValue ? groupValue : cellContent) : /*#__PURE__*/React.createElement(React.Fragment, null, isLastLeftPinnedColumn ? /*#__PURE__*/React.createElement("div", {
475
+ className: classNames('ui-rc_cell-content', {
476
+ [`${prefix}-grid-cell-ellipsis`]: !wrapSettings || !(wrapSettings && (wrapSettings.wrapMode === 'Both' || wrapSettings.wrapMode === 'Content')),
477
+ [`${prefix}-grid-cell-text-wrap`]: wrapSettings && (wrapSettings.wrapMode === 'Both' || wrapSettings.wrapMode === 'Content'),
478
+ // [`${prefix}-grid-cell-selected`]: isCellSelected,
479
+
480
+ [`${prefix}-grid-cell-fix-left-last`]: isLastLeftPinnedColumn,
481
+ [`${prefix}-grid-cell-fix-right-first`]: isFirstRightPinnedColumn,
482
+ [`${prefix}-grid-cell-text-center`]: columnMeta?.textAlign === 'center',
483
+ [`${prefix}-grid-cell-text-right`]: columnMeta?.textAlign === 'right' || columnMeta.type === 'number'
484
+ })
485
+ }, groupValue ? groupValue : cellContent) : groupValue ? groupValue : cellContent));
470
486
  };
471
487
  export default TableBodyCell;
@@ -234,6 +234,10 @@ export function groupArrayByColumns(arr, columns) {
234
234
 
235
235
  columns.forEach((column, index) => {
236
236
  const value = item[column];
237
+ if (value === null || value === undefined) {
238
+ // Nếu giá trị nhóm là null/undefined thì bỏ qua cột này
239
+ return;
240
+ }
237
241
 
238
242
  // Tạo key unique cho group dựa trên value của cột
239
243
  // Tìm existing item ở level hiện tại
@@ -1,7 +1,7 @@
1
1
  /// <reference types="react" />
2
2
  type GridProps = {
3
3
  $theme: {
4
- theme?: "light" | "dark";
4
+ theme?: 'light' | 'dark';
5
5
  backgroundColor?: string;
6
6
  color?: string;
7
7
  };
@@ -1,14 +1,14 @@
1
- import styled from "styled-components";
2
- const color = "#000000de";
3
- const BgColor = "#ffffff";
4
- const rowSelectedBg = "#FEF2EF";
5
- const cellSelectedBg = "#F3F8FF";
6
- const borderSelectedColor = "#0550C5";
7
- const tableBorderColor = "#e0e0e0";
8
- const tableBorderColorDark = "#44485E";
9
- const BgColorDark = "#343e59";
10
- const colorDark = "#e6e4f3e6";
1
+ import styled from 'styled-components';
2
+ const color = '#000000de';
3
+ const BgColor = '#ffffff';
4
+ const rowSelectedBg = '#FEF2EF';
5
+ const cellSelectedBg = '#F3F8FF';
6
+ const borderSelectedColor = '#0550C5';
7
+ const tableBorderColor = '#e0e0e0';
8
+ const tableBorderColorDark = '#44485E';
9
+ const BgColorDark = '#343e59';
10
+ const colorDark = '#e6e4f3e6';
11
11
  export const GridStyle = styled.div.withConfig({
12
12
  displayName: "GridStyle",
13
13
  componentId: "es-grid-template__sc-rs980s-0"
14
- })(["&.", "-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;.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.$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);
14
+ })(["&.", "-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);
@@ -109,6 +109,18 @@ const TableContainer = props => {
109
109
  document.removeEventListener('mousedown', handleClickOutside);
110
110
  };
111
111
  }, []);
112
+ const toolbarItemTop = React.useMemo(() => {
113
+ if (!toolbarItems) {
114
+ return undefined;
115
+ }
116
+ return toolbarItems.filter(it => it.position !== 'Bottom' && it.fixedRight !== false);
117
+ }, [toolbarItems]);
118
+ const toolbarItemTopRight = React.useMemo(() => {
119
+ if (!toolbarItems) {
120
+ return undefined;
121
+ }
122
+ return toolbarItems.filter(it => it.position !== 'Bottom' && it.fixedRight);
123
+ }, [toolbarItems]);
112
124
  const triggerCommandClick = args => {
113
125
  // const { id: idCommand, rowId, rowData, index } = args
114
126
 
@@ -181,7 +193,7 @@ const TableContainer = props => {
181
193
  overflow: 'hidden'
182
194
  }
183
195
  }, /*#__PURE__*/React.createElement(Toolbar, {
184
- items: (toolbarItems ?? []).filter(it => it.position !== 'Bottom'),
196
+ items: toolbarItemTop ?? [],
185
197
  mode: toolbarMode
186
198
  })), /*#__PURE__*/React.createElement("div", {
187
199
  style: {
@@ -198,7 +210,15 @@ const TableContainer = props => {
198
210
  showTotal: (totalItems, range) =>
199
211
  // @ts-ignore
200
212
  `${range[0]}-${range[1]} / ${totalItems} ${t ? t(pagination?.locale?.items ?? 'items') : 'items'}`
201
- }, pagination)), typeof actionTemplate === 'function' ? actionTemplate() : actionTemplate, fullScreen !== false && (isFullScreen ? /*#__PURE__*/React.createElement(Minimize, {
213
+ }, pagination)), typeof actionTemplate === 'function' ? actionTemplate() : actionTemplate, toolbarItemTopRight && /*#__PURE__*/React.createElement("div", {
214
+ style: {
215
+ flex: 1,
216
+ overflow: 'hidden'
217
+ }
218
+ }, /*#__PURE__*/React.createElement(Toolbar, {
219
+ items: toolbarItemTopRight,
220
+ mode: toolbarMode
221
+ })), fullScreen !== false && (isFullScreen ? /*#__PURE__*/React.createElement(Minimize, {
202
222
  fontSize: 16,
203
223
  onClick: () => {
204
224
  setIsFullScreen(!isFullScreen);