d2coreui 23.0.58 → 23.0.59

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/CHANGELOG.md CHANGED
@@ -1,5 +1,14 @@
1
1
  # Changelog
2
2
 
3
+ ## 23.0.59
4
+
5
+ - `DataGrid` / `ExtendedDataGrid`: `toolbar.compact` for a narrow (mobile) screen - the export and table settings
6
+ buttons move into a popover opened by one button, the pager has only the previous, "page / pages" and next buttons,
7
+ and a pager that still does not fit moves to a line of its own under the toolbar.
8
+ - `DataGrid`: the toolbar line is aligned to the top, so the pager and the record range stay next to the toolbar
9
+ buttons when `toolbar.renderToolbar` adds content under them; `toolbar.extraContent` lower than a button is now at the
10
+ top of the line instead of in its middle.
11
+
3
12
  ## 23.0.58
4
13
 
5
14
  - `ModalDialog`: the maximize / restore button is shown only with `maximizable`, which is now `false` by default -
@@ -257,6 +257,12 @@ export interface DataGridProps<TData = any> extends Omit<GridOptions<TData>, "co
257
257
  hideRecordCount?: boolean;
258
258
  /** Extra content rendered at the end of the toolbar, after the pager or record count. */
259
259
  extraContent?: React.ReactNode;
260
+ /**
261
+ * Compact toolbar for a narrow (mobile) screen: the export and settings buttons move into a popover opened by
262
+ * one button, and the pager has only the previous, "page / pages" and next buttons. A pager that still does not fit
263
+ * moves to a line of its own under the toolbar.
264
+ */
265
+ compact?: boolean;
260
266
  };
261
267
  /** Called with the new row height in pixels when it changes because of the font size/line indentation rules. */
262
268
  onRowHeightChanged?(rowHeight: number): void;
@@ -366,6 +372,8 @@ interface DataGridState {
366
372
  columnTransferHeight: number;
367
373
  pageOrientation: PageOrientation;
368
374
  exporting: boolean;
375
+ /** Whether the popover with the export and settings buttons of the compact toolbar is open. */
376
+ compactMenuOpen?: boolean;
369
377
  isDragging: boolean;
370
378
  startCoord: CellCoord | null;
371
379
  endCoord: CellCoord | null;
@@ -591,8 +599,22 @@ export default class DataGrid<TData extends {
591
599
  private onExport;
592
600
  /** Renders the toolbar row: toolbar with search, pager (or record range when paging is disabled) and `toolbar.extraContent`. */
593
601
  renderNavigationPanel(): ReactElement;
594
- /** Renders the default toolbar: `toolbar.toolbarButtons`, export and settings menus, search field and search button. */
602
+ /**
603
+ * Renders the default toolbar: `toolbar.toolbarButtons`, export and settings menus, search field and search button.
604
+ * With `toolbar.compact` the export and settings buttons move into a popover opened by one button.
605
+ */
595
606
  renderToolBarWithSearch(): ReactElement;
607
+ /**
608
+ * Button of the compact toolbar opening a popover with the export and settings buttons, so that a phone screen
609
+ * keeps room for the pager. The popover closes once one of their menu items is used.
610
+ */
611
+ private renderCompactMenu;
612
+ /** Export button with the export menu; `onUsed` is called after a menu item is clicked. */
613
+ private renderExportButton;
614
+ /** Table settings button with the settings menu; `onUsed` is called after a menu item is clicked. */
615
+ private renderSettingsButton;
616
+ /** The primary search button - a refresh button when the search field is hidden. */
617
+ private renderSearchButton;
596
618
  /** Builds the toolbar settings menu (keys `columnFilter`, `autosizeAllColumns`, `columnsConfig`, `advancedConfig`), passed through `settingsMenu.renderer`. */
597
619
  getSettingsMenu(): MenuProps;
598
620
  private getAdaptedColumnDefs;
@@ -10,8 +10,8 @@ var __rest = (this && this.__rest) || function (s, e) {
10
10
  return t;
11
11
  };
12
12
  import React from "react";
13
- import { ColumnWidthOutlined, ControlOutlined, DownloadOutlined, FileSearchOutlined, LoadingOutlined, ReloadOutlined, SearchOutlined, SettingOutlined, TableOutlined } from "@ant-design/icons";
14
- import { Button, Card, ConfigProvider, Dropdown, Empty, Space, theme } from "antd";
13
+ import { ColumnWidthOutlined, ControlOutlined, DownloadOutlined, EllipsisOutlined, FileSearchOutlined, LoadingOutlined, ReloadOutlined, SearchOutlined, SettingOutlined, TableOutlined } from "@ant-design/icons";
14
+ import { Button, Card, ConfigProvider, Dropdown, Empty, Popover, Space, theme } from "antd";
15
15
  import { AgGridReact } from "ag-grid-react";
16
16
  import 'd2coreui/style/ag-grid/aggrid-adaptations.css';
17
17
  import TextColumnFilter from "d2coreui/components/grid/filter/textColumnFilter";
@@ -59,11 +59,17 @@ import WildcardQuickFilterEngine from "./filter/wildcardQuickFilterEngine";
59
59
  import { colorSchemeDark, themeBalham } from "ag-grid-community";
60
60
  import WithCss from "../style/withCss";
61
61
  import { createStyles } from "antd-style";
62
- const useStyles = createStyles(({ css }) => {
62
+ const useStyles = createStyles(({ css, token }, props) => {
63
+ var _a;
64
+ const controlHeight = { small: token.controlHeightSM, middle: token.controlHeight, large: token.controlHeightLG }[(_a = props === null || props === void 0 ? void 0 : props.size) !== null && _a !== void 0 ? _a : "middle"];
63
65
  return {
64
66
  baseLayout: css `
65
67
  width: 100%;
66
68
  height: 100%;
69
+ `,
70
+ // as high as a toolbar button, so that the text is in the middle of the toolbar line
71
+ recordRange: css `
72
+ line-height: ${controlHeight}px;
67
73
  `
68
74
  };
69
75
  });
@@ -512,6 +518,11 @@ class DataGrid extends React.Component {
512
518
  }
513
519
  }
514
520
  componentDidUpdate(prevProps) {
521
+ var _a;
522
+ if (this.state.compactMenuOpen && !((_a = this.props.toolbar) === null || _a === void 0 ? void 0 : _a.compact)) {
523
+ // the popover is gone with the compact toolbar - it must not open by itself when the toolbar is compact again
524
+ this.setState({ compactMenuOpen: false });
525
+ }
515
526
  if (!this.gridApi) {
516
527
  return;
517
528
  }
@@ -1670,55 +1681,90 @@ class DataGrid extends React.Component {
1670
1681
  }
1671
1682
  /** Renders the toolbar row: toolbar with search, pager (or record range when paging is disabled) and `toolbar.extraContent`. */
1672
1683
  renderNavigationPanel() {
1673
- var _a, _b, _c;
1684
+ var _a, _b, _c, _d;
1674
1685
  return (React.createElement(React.Fragment, null,
1675
1686
  this.props.toolbar && this.props.toolbar.renderToolbar ? this.props.toolbar.renderToolbar(this.renderToolBarWithSearch()) : this.renderToolBarWithSearch(),
1676
1687
  this.props.paging.pageSize >= 0 &&
1677
- React.createElement(DataGridPagination, { disabled: this.state.loading, current: this.state.pageIndex ? this.state.pageIndex + 1 : 1, pageSize: this.state.pageSize ? this.state.pageSize : 20, total: (_a = this.state.recordsCount) !== null && _a !== void 0 ? _a : 1, onGoToPage: page => {
1688
+ React.createElement(DataGridPagination, { disabled: this.state.loading, current: this.state.pageIndex ? this.state.pageIndex + 1 : 1, pageSize: this.state.pageSize ? this.state.pageSize : 20, total: (_a = this.state.recordsCount) !== null && _a !== void 0 ? _a : 1, compact: (_b = this.props.toolbar) === null || _b === void 0 ? void 0 : _b.compact, onGoToPage: page => {
1678
1689
  this.onGoToPage(page - 1);
1679
1690
  } }),
1680
- this.props.paging.pageSize < 0 && this.state.recordsCount && !((_b = this.props.toolbar) === null || _b === void 0 ? void 0 : _b.hideRecordCount) ?
1681
- React.createElement("span", { style: {
1691
+ this.props.paging.pageSize < 0 && this.state.recordsCount && !((_c = this.props.toolbar) === null || _c === void 0 ? void 0 : _c.hideRecordCount) ?
1692
+ React.createElement(WithCss, { useStyles: useStyles }, ({ styles }) => React.createElement("span", { className: styles.recordRange, style: {
1682
1693
  flex: "0 1 auto",
1683
1694
  textAlign: "right",
1684
1695
  whiteSpace: "nowrap",
1685
1696
  margin: "0 12px",
1686
- } }, `${this.state.viewport[0]}-${this.state.viewport[1]} ${i18n('of')} ${this.state.recordsCount}`)
1687
- : undefined, (_c = this.props.toolbar) === null || _c === void 0 ? void 0 :
1688
- _c.extraContent));
1697
+ } }, `${this.state.viewport[0]}-${this.state.viewport[1]} ${i18n('of')} ${this.state.recordsCount}`))
1698
+ : undefined, (_d = this.props.toolbar) === null || _d === void 0 ? void 0 :
1699
+ _d.extraContent));
1689
1700
  }
1690
- /** Renders the default toolbar: `toolbar.toolbarButtons`, export and settings menus, search field and search button. */
1701
+ /**
1702
+ * Renders the default toolbar: `toolbar.toolbarButtons`, export and settings menus, search field and search button.
1703
+ * With `toolbar.compact` the export and settings buttons move into a popover opened by one button.
1704
+ */
1691
1705
  renderToolBarWithSearch() {
1692
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
1693
- return (React.createElement(Space.Compact, { key: "filter-panel", className: "datagrid-autocomplete-input-group", style: { whiteSpace: "nowrap", flexGrow: 1, display: "flex" } }, (_a = this.props.toolbar) === null || _a === void 0 ? void 0 :
1694
- _a.toolbarButtons,
1695
- React.createElement(Dropdown, { trigger: ["click"], menu: getContextMenu({
1696
- showMilliseconds: !!this.props.showMilliseconds,
1697
- showYear: !this.props.hideYear,
1698
- showUtcOffset: LocaleHolder.resolveUtcOffsetMode(this.props.showUtcOffset),
1699
- renderer: (_b = this.props.exportMenu) === null || _b === void 0 ? void 0 : _b.renderer,
1700
- onClick: (_c = this.props.exportMenu) === null || _c === void 0 ? void 0 : _c.onClick,
1701
- onExported: (_d = this.props.exportMenu) === null || _d === void 0 ? void 0 : _d.onExported,
1702
- getExportContent: this.getExportContent,
1703
- pageOrientation: this.state.pageOrientation,
1704
- exporting: this.state.exporting,
1705
- onPageOrientationChange: this.onPageOrientationChange,
1706
- onExport: this.onExport
1707
- }), disabled: this.state.loading },
1708
- React.createElement(Button, { title: i18n("Export") },
1709
- React.createElement(DownloadOutlined, null))),
1710
- React.createElement(Dropdown, { trigger: ["click"], menu: this.getSettingsMenu() },
1711
- React.createElement(Button, { title: i18n("Extended table features"), disabled: this.state.loading },
1712
- React.createElement(TableOutlined, null))),
1713
- !((_e = this.props.search) === null || _e === void 0 ? void 0 : _e.hidden) && !((_f = this.props.search) === null || _f === void 0 ? void 0 : _f.searchRenderer) && React.createElement(AutoCompleteInput, { style: { minWidth: 100, flexGrow: 1 }, placeholder: this.props.search ? this.props.search.placeholder : undefined, stringFormatter: this.props.search ? this.props.search.stringFormatter : undefined, value: this.props.search ? this.props.search.searchString : undefined, options: this.props.search ? this.props.search.searchHistory : undefined, onChange: this.props.search ? this.props.search.onChange : undefined, onSearch: this.props.search ? this.props.search.onSearch : undefined, disabled: this.state.loading || (this.props.filter && this.props.filter.columnSearchVisible) }), (_h = (_g = this.props.search) === null || _g === void 0 ? void 0 : _g.searchRenderer) === null || _h === void 0 ? void 0 :
1714
- _h.call(_g),
1715
- !((_j = this.props.search) === null || _j === void 0 ? void 0 : _j.searchButtonHidden) &&
1716
- React.createElement(Button, { title: ((_k = this.props.search) === null || _k === void 0 ? void 0 : _k.hidden) ? i18n("Refresh") : i18n("Search"), className: "search-btn " + (this.props.search && this.props.search.searchButtonClassName ? this.props.search.searchButtonClassName : ""), disabled: (_l = this.props.search) === null || _l === void 0 ? void 0 : _l.searchButtonDisabled, type: "primary", danger: (_m = this.props.search) === null || _m === void 0 ? void 0 : _m.searchButtonDanger, onClick: () => {
1717
- if (this.props.search && this.props.search.onSearch) {
1718
- this.props.search.onSearch();
1719
- }
1720
- } }, this.state.loading ? React.createElement(LoadingOutlined, null) : ((_p = (_o = this.props.search) === null || _o === void 0 ? void 0 : _o.searchButtonIcon) !== null && _p !== void 0 ? _p : (((_q = this.props.search) === null || _q === void 0 ? void 0 : _q.hidden) ? React.createElement(ReloadOutlined, null) :
1721
- React.createElement(SearchOutlined, null))))));
1706
+ var _a, _b, _c, _d;
1707
+ const compact = (_a = this.props.toolbar) === null || _a === void 0 ? void 0 : _a.compact;
1708
+ const search = this.props.search;
1709
+ return (React.createElement(Space.Compact, { key: "filter-panel", className: "datagrid-autocomplete-input-group", style: { whiteSpace: "nowrap", flexGrow: 1, display: "flex" } }, (_b = this.props.toolbar) === null || _b === void 0 ? void 0 :
1710
+ _b.toolbarButtons,
1711
+ compact ? this.renderCompactMenu() : React.createElement(React.Fragment, null,
1712
+ this.renderExportButton(),
1713
+ this.renderSettingsButton()),
1714
+ !(search === null || search === void 0 ? void 0 : search.hidden) && !(search === null || search === void 0 ? void 0 : search.searchRenderer) && React.createElement(AutoCompleteInput, { style: { minWidth: 100, flexGrow: 1 }, placeholder: search === null || search === void 0 ? void 0 : search.placeholder, stringFormatter: search === null || search === void 0 ? void 0 : search.stringFormatter, value: search === null || search === void 0 ? void 0 : search.searchString, options: search === null || search === void 0 ? void 0 : search.searchHistory, onChange: search === null || search === void 0 ? void 0 : search.onChange, onSearch: search === null || search === void 0 ? void 0 : search.onSearch, disabled: this.state.loading || ((_c = this.props.filter) === null || _c === void 0 ? void 0 : _c.columnSearchVisible) }), (_d = search === null || search === void 0 ? void 0 : search.searchRenderer) === null || _d === void 0 ? void 0 :
1715
+ _d.call(search),
1716
+ !(search === null || search === void 0 ? void 0 : search.searchButtonHidden) && this.renderSearchButton()));
1717
+ }
1718
+ /**
1719
+ * Button of the compact toolbar opening a popover with the export and settings buttons, so that a phone screen
1720
+ * keeps room for the pager. The popover closes once one of their menu items is used.
1721
+ */
1722
+ renderCompactMenu() {
1723
+ const close = () => this.setState({ compactMenuOpen: false });
1724
+ return (React.createElement(Popover, { open: this.state.compactMenuOpen, onOpenChange: open => this.setState({ compactMenuOpen: open }), trigger: "click", placement: "bottomLeft",
1725
+ // the menus are built only while the popover is open - the grid renders often, e.g. while scrolling
1726
+ destroyOnHidden: true, content: React.createElement(RenderLater, null, () => React.createElement(Space.Compact, null,
1727
+ this.renderExportButton(close),
1728
+ this.renderSettingsButton(close))) },
1729
+ React.createElement(Button, { title: i18n("Extended table features") }, this.state.loading ? React.createElement(LoadingOutlined, null) : React.createElement(EllipsisOutlined, null))));
1730
+ }
1731
+ /** Export button with the export menu; `onUsed` is called after a menu item is clicked. */
1732
+ renderExportButton(onUsed) {
1733
+ var _a, _b, _c;
1734
+ const exportMenu = getContextMenu({
1735
+ showMilliseconds: !!this.props.showMilliseconds,
1736
+ showYear: !this.props.hideYear,
1737
+ showUtcOffset: LocaleHolder.resolveUtcOffsetMode(this.props.showUtcOffset),
1738
+ renderer: (_a = this.props.exportMenu) === null || _a === void 0 ? void 0 : _a.renderer,
1739
+ onClick: (_b = this.props.exportMenu) === null || _b === void 0 ? void 0 : _b.onClick,
1740
+ onExported: (_c = this.props.exportMenu) === null || _c === void 0 ? void 0 : _c.onExported,
1741
+ getExportContent: this.getExportContent,
1742
+ pageOrientation: this.state.pageOrientation,
1743
+ exporting: this.state.exporting,
1744
+ onPageOrientationChange: this.onPageOrientationChange,
1745
+ onExport: this.onExport
1746
+ });
1747
+ return (React.createElement(Dropdown, { trigger: ["click"], menu: withOnUsed(exportMenu, onUsed), disabled: this.state.loading },
1748
+ React.createElement(Button, { title: i18n("Export") },
1749
+ React.createElement(DownloadOutlined, null))));
1750
+ }
1751
+ /** Table settings button with the settings menu; `onUsed` is called after a menu item is clicked. */
1752
+ renderSettingsButton(onUsed) {
1753
+ const settingsMenu = this.getSettingsMenu();
1754
+ return (React.createElement(Dropdown, { trigger: ["click"], menu: withOnUsed(settingsMenu, onUsed) },
1755
+ React.createElement(Button, { title: i18n("Extended table features"), disabled: this.state.loading },
1756
+ React.createElement(TableOutlined, null))));
1757
+ }
1758
+ /** The primary search button - a refresh button when the search field is hidden. */
1759
+ renderSearchButton() {
1760
+ var _a, _b;
1761
+ const search = this.props.search;
1762
+ return (React.createElement(Button, { title: (search === null || search === void 0 ? void 0 : search.hidden) ? i18n("Refresh") : i18n("Search"), className: "search-btn " + ((_a = search === null || search === void 0 ? void 0 : search.searchButtonClassName) !== null && _a !== void 0 ? _a : ""), disabled: search === null || search === void 0 ? void 0 : search.searchButtonDisabled, type: "primary", danger: search === null || search === void 0 ? void 0 : search.searchButtonDanger, onClick: () => {
1763
+ var _a;
1764
+ this.setState({ compactMenuOpen: false });
1765
+ (_a = search === null || search === void 0 ? void 0 : search.onSearch) === null || _a === void 0 ? void 0 : _a.call(search);
1766
+ } }, this.state.loading ? React.createElement(LoadingOutlined, null) : ((_b = search === null || search === void 0 ? void 0 : search.searchButtonIcon) !== null && _b !== void 0 ? _b : ((search === null || search === void 0 ? void 0 : search.hidden) ? React.createElement(ReloadOutlined, null) :
1767
+ React.createElement(SearchOutlined, null)))));
1722
1768
  }
1723
1769
  /** Builds the toolbar settings menu (keys `columnFilter`, `autosizeAllColumns`, `columnsConfig`, `advancedConfig`), passed through `settingsMenu.renderer`. */
1724
1770
  getSettingsMenu() {
@@ -1837,7 +1883,8 @@ class DataGrid extends React.Component {
1837
1883
  }
1838
1884
  ;
1839
1885
  render() {
1840
- const _a = this.props, { onGridReady, columnDefs, disableColumnDefsPreprocessing, onColumnsChanged, paging, onPaginationChanged, onViewportChanged, selectedIds, search, toolbar, filter, onFilterChanged, onFilterModified, onCellFocused, onSortChanged, components, tableConfigVisible, onTableConfigVisible, noRecordsOverlayRenderer, loadingOverlayRenderer, onRowDataUpdated, onLoadData, rowStyleRules, defaultRowStyleRules, onChangeRowStyleRules, showMilliseconds, defaultShowMilliseconds, onShowMilliseconds, hideYear, defaultHideYear, onShowYear, showUtcOffset, defaultShowUtcOffset, onShowUtcOffset, suppressLoadingOverlay, defaultColDef, headerHeight, rowData, rowDataManualMode, gridRef, quickFilterParser, quickFilterMatcher, rowSelection, contextMenu, settingsMenu, exportMenu, panelStyle, tablePanelStyle, onColumnDefsAdapted, tableOverlayRenderer, onKeyPressed, theme } = _a, passedProperties = __rest(_a, ["onGridReady", "columnDefs", "disableColumnDefsPreprocessing", "onColumnsChanged", "paging", "onPaginationChanged", "onViewportChanged", "selectedIds", "search", "toolbar", "filter", "onFilterChanged", "onFilterModified", "onCellFocused", "onSortChanged", "components", "tableConfigVisible", "onTableConfigVisible", "noRecordsOverlayRenderer", "loadingOverlayRenderer", "onRowDataUpdated", "onLoadData", "rowStyleRules", "defaultRowStyleRules", "onChangeRowStyleRules", "showMilliseconds", "defaultShowMilliseconds", "onShowMilliseconds", "hideYear", "defaultHideYear", "onShowYear", "showUtcOffset", "defaultShowUtcOffset", "onShowUtcOffset", "suppressLoadingOverlay", "defaultColDef", "headerHeight", "rowData", "rowDataManualMode", "gridRef", "quickFilterParser", "quickFilterMatcher", "rowSelection", "contextMenu", "settingsMenu", "exportMenu", "panelStyle", "tablePanelStyle", "onColumnDefsAdapted", "tableOverlayRenderer", "onKeyPressed", "theme"]);
1886
+ var _a;
1887
+ const _b = this.props, { onGridReady, columnDefs, disableColumnDefsPreprocessing, onColumnsChanged, paging, onPaginationChanged, onViewportChanged, selectedIds, search, toolbar, filter, onFilterChanged, onFilterModified, onCellFocused, onSortChanged, components, tableConfigVisible, onTableConfigVisible, noRecordsOverlayRenderer, loadingOverlayRenderer, onRowDataUpdated, onLoadData, rowStyleRules, defaultRowStyleRules, onChangeRowStyleRules, showMilliseconds, defaultShowMilliseconds, onShowMilliseconds, hideYear, defaultHideYear, onShowYear, showUtcOffset, defaultShowUtcOffset, onShowUtcOffset, suppressLoadingOverlay, defaultColDef, headerHeight, rowData, rowDataManualMode, gridRef, quickFilterParser, quickFilterMatcher, rowSelection, contextMenu, settingsMenu, exportMenu, panelStyle, tablePanelStyle, onColumnDefsAdapted, tableOverlayRenderer, onKeyPressed, theme } = _b, passedProperties = __rest(_b, ["onGridReady", "columnDefs", "disableColumnDefsPreprocessing", "onColumnsChanged", "paging", "onPaginationChanged", "onViewportChanged", "selectedIds", "search", "toolbar", "filter", "onFilterChanged", "onFilterModified", "onCellFocused", "onSortChanged", "components", "tableConfigVisible", "onTableConfigVisible", "noRecordsOverlayRenderer", "loadingOverlayRenderer", "onRowDataUpdated", "onLoadData", "rowStyleRules", "defaultRowStyleRules", "onChangeRowStyleRules", "showMilliseconds", "defaultShowMilliseconds", "onShowMilliseconds", "hideYear", "defaultHideYear", "onShowYear", "showUtcOffset", "defaultShowUtcOffset", "onShowUtcOffset", "suppressLoadingOverlay", "defaultColDef", "headerHeight", "rowData", "rowDataManualMode", "gridRef", "quickFilterParser", "quickFilterMatcher", "rowSelection", "contextMenu", "settingsMenu", "exportMenu", "panelStyle", "tablePanelStyle", "onColumnDefsAdapted", "tableOverlayRenderer", "onKeyPressed", "theme"]);
1841
1888
  let key;
1842
1889
  let paginationPageSize = undefined;
1843
1890
  if (paging.pageSize > 0) {
@@ -1879,7 +1926,7 @@ class DataGrid extends React.Component {
1879
1926
  const headerFilterRowHeight = calculateRowHeight(this.state.fontSize, GRID_DEFAULT_ROW_HEIGHT_DELTA + 2);
1880
1927
  return (React.createElement(React.Fragment, null,
1881
1928
  React.createElement(Card, { size: "small", variant: "borderless", style: { height: "100%" }, styles: { body: bodyStyle } },
1882
- React.createElement("div", { style: { display: "flex", alignItems: "center" } }, this.renderNavigationPanel()),
1929
+ React.createElement("div", { style: Object.assign({ display: "flex", alignItems: "flex-start" }, (((_a = this.props.toolbar) === null || _a === void 0 ? void 0 : _a.compact) && paging.pageSize >= 0 ? { flexWrap: "wrap", gap: 8 } : {})) }, this.renderNavigationPanel()),
1883
1930
  React.createElement("div", { style: tPanelStyle },
1884
1931
  React.createElement(WithCss, { useStyles: useStyles }, (styles) => {
1885
1932
  var _a, _b, _c, _d;
@@ -1952,6 +1999,18 @@ DataGrid.defaultProps = {
1952
1999
  };
1953
2000
  DataGrid.EMPTY_STYLE = {};
1954
2001
  export default DataGrid;
2002
+ /** Renders `children()` - defers building content until React renders it, e.g. until a popover opens. */
2003
+ function RenderLater({ children }) {
2004
+ return React.createElement(React.Fragment, null, children());
2005
+ }
2006
+ /** The menu with `onUsed` called after its own `onClick`, i.e. after any of its items is clicked. */
2007
+ function withOnUsed(menu, onUsed) {
2008
+ return onUsed ? Object.assign(Object.assign({}, menu), { onClick: info => {
2009
+ var _a;
2010
+ (_a = menu.onClick) === null || _a === void 0 ? void 0 : _a.call(menu, info);
2011
+ onUsed();
2012
+ } }) : menu;
2013
+ }
1955
2014
  function getAgGridThemeFromAntd(algorithm, token) {
1956
2015
  var _a;
1957
2016
  const isDark = algorithm === theme.darkAlgorithm;