d2coreui 23.0.32 → 23.0.33

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.
@@ -1,8 +1,6 @@
1
1
  import React, { ReactElement } from "react";
2
2
  import { MenuProps } from "antd";
3
3
  import { AgGridReact } from "ag-grid-react";
4
- import 'ag-grid-community/styles/ag-grid.css';
5
- import 'ag-grid-community/styles/ag-theme-balham.css';
6
4
  import 'd2coreui/style/ag-grid/aggrid-adaptations.css';
7
5
  import { ContextMenuProps, PageOrientation } from "d2coreui/components/grid/export/contextMenu";
8
6
  import { CellClassParams, CellFocusedEvent, CellMouseDownEvent, CellMouseOverEvent, ColDef, Column, ColumnEvent, ColumnState, FilterChangedEvent, FilterModifiedEvent, GridApi, GridOptions, GridReadyEvent, IRowNode, PaginationChangedEvent, RowClassParams, RowPinnedType, RowStyle, ViewportChangedEvent } from "ag-grid-community";
@@ -13,8 +13,6 @@ import React from "react";
13
13
  import { ColumnWidthOutlined, ControlOutlined, DownloadOutlined, FileSearchOutlined, LoadingOutlined, ReloadOutlined, SearchOutlined, SettingOutlined, TableOutlined } from "@ant-design/icons";
14
14
  import { Button, Card, Dropdown, Empty, Space } from "antd";
15
15
  import { AgGridReact } from "ag-grid-react";
16
- import 'ag-grid-community/styles/ag-grid.css';
17
- import 'ag-grid-community/styles/ag-theme-balham.css';
18
16
  import 'd2coreui/style/ag-grid/aggrid-adaptations.css';
19
17
  import TextColumnFilter from "d2coreui/components/grid/filter/textColumnFilter";
20
18
  import CustomColumnFilter from "d2coreui/components/grid/filter/customColumnFilter";
@@ -58,6 +56,11 @@ import DataGridPagination from "./panel/dataGridPagination";
58
56
  import { calculateLineHeight, calculateRowHeight, getFontSize, getLineHeight, getRowHeightDelta, GRID_DEFAULT_FONT_SIZE, GRID_DEFAULT_ROW_HEIGHT_DELTA } from "./config/rowHeightCalculator";
59
57
  import BeanAccessor from "./cell/beanAccessor";
60
58
  import WildcardQuickFilterEngine from "./filter/wildcardQuickFilterEngine";
59
+ import { themeBalham } from "ag-grid-community";
60
+ const myTheme = themeBalham
61
+ .withParams({
62
+ selectedRowBackgroundColor: "#b7e4ff",
63
+ });
61
64
  const gridFrameworkComponents = {
62
65
  customColumnFilter: CustomColumnFilter,
63
66
  textColumnFilter: TextColumnFilter,
@@ -1650,7 +1653,7 @@ class DataGrid extends React.Component {
1650
1653
  ;
1651
1654
  render() {
1652
1655
  var _a, _b, _c, _d;
1653
- const _e = this.props, { onGridReady, columnDefs, disableColumnDefsPreprocessing, onColumnsChanged, paging, onPaginationChanged, onViewportChanged, selectedIds, search, toolbar, filter, onFilterChanged, onFilterModified, onCellFocused, onSortChanged, components, tableConfigVisible, onTableConfigVisible, noRecordsOverlayRenderer, loadingOverlayRenderer, onRowDataUpdated, rowStyleRules, onChangeRowStyleRules, defaultShowMilliseconds, onShowMilliseconds, defaultHideYear, onShowYear, suppressLoadingOverlay, defaultColDef, headerHeight, rowData, rowDataManualMode, gridRef, quickFilterParser, quickFilterMatcher, rowSelection, contextMenu, settingsMenu, exportMenu, panelStyle, tablePanelStyle, onColumnDefsAdapted, tableOverlayRenderer, onKeyPressed } = _e, passedProperties = __rest(_e, ["onGridReady", "columnDefs", "disableColumnDefsPreprocessing", "onColumnsChanged", "paging", "onPaginationChanged", "onViewportChanged", "selectedIds", "search", "toolbar", "filter", "onFilterChanged", "onFilterModified", "onCellFocused", "onSortChanged", "components", "tableConfigVisible", "onTableConfigVisible", "noRecordsOverlayRenderer", "loadingOverlayRenderer", "onRowDataUpdated", "rowStyleRules", "onChangeRowStyleRules", "defaultShowMilliseconds", "onShowMilliseconds", "defaultHideYear", "onShowYear", "suppressLoadingOverlay", "defaultColDef", "headerHeight", "rowData", "rowDataManualMode", "gridRef", "quickFilterParser", "quickFilterMatcher", "rowSelection", "contextMenu", "settingsMenu", "exportMenu", "panelStyle", "tablePanelStyle", "onColumnDefsAdapted", "tableOverlayRenderer", "onKeyPressed"]);
1656
+ const _e = this.props, { onGridReady, columnDefs, disableColumnDefsPreprocessing, onColumnsChanged, paging, onPaginationChanged, onViewportChanged, selectedIds, search, toolbar, filter, onFilterChanged, onFilterModified, onCellFocused, onSortChanged, components, tableConfigVisible, onTableConfigVisible, noRecordsOverlayRenderer, loadingOverlayRenderer, onRowDataUpdated, rowStyleRules, onChangeRowStyleRules, defaultShowMilliseconds, onShowMilliseconds, defaultHideYear, onShowYear, suppressLoadingOverlay, defaultColDef, headerHeight, rowData, rowDataManualMode, gridRef, quickFilterParser, quickFilterMatcher, rowSelection, contextMenu, settingsMenu, exportMenu, panelStyle, tablePanelStyle, onColumnDefsAdapted, tableOverlayRenderer, onKeyPressed, theme } = _e, passedProperties = __rest(_e, ["onGridReady", "columnDefs", "disableColumnDefsPreprocessing", "onColumnsChanged", "paging", "onPaginationChanged", "onViewportChanged", "selectedIds", "search", "toolbar", "filter", "onFilterChanged", "onFilterModified", "onCellFocused", "onSortChanged", "components", "tableConfigVisible", "onTableConfigVisible", "noRecordsOverlayRenderer", "loadingOverlayRenderer", "onRowDataUpdated", "rowStyleRules", "onChangeRowStyleRules", "defaultShowMilliseconds", "onShowMilliseconds", "defaultHideYear", "onShowYear", "suppressLoadingOverlay", "defaultColDef", "headerHeight", "rowData", "rowDataManualMode", "gridRef", "quickFilterParser", "quickFilterMatcher", "rowSelection", "contextMenu", "settingsMenu", "exportMenu", "panelStyle", "tablePanelStyle", "onColumnDefsAdapted", "tableOverlayRenderer", "onKeyPressed", "theme"]);
1654
1657
  let key;
1655
1658
  let paginationPageSize = undefined;
1656
1659
  if (paging.pageSize > 0) {
@@ -1686,6 +1689,7 @@ class DataGrid extends React.Component {
1686
1689
  Object.assign(tPanelStyle, tablePanelStyle);
1687
1690
  }
1688
1691
  const headerFilterRowHeight = calculateRowHeight(this.state.fontSize, GRID_DEFAULT_ROW_HEIGHT_DELTA + 2);
1692
+ const defaultTheme = theme !== null && theme !== void 0 ? theme : myTheme;
1689
1693
  return (React.createElement(React.Fragment, null,
1690
1694
  React.createElement(Card, { size: "small", bordered: false, style: { height: "100%" }, styles: { body: bodyStyle } },
1691
1695
  React.createElement("div", { style: { display: "flex" } }, this.renderNavigationPanel()),
@@ -1714,7 +1718,7 @@ class DataGrid extends React.Component {
1714
1718
  React.createElement("div", { className: "ag-theme-balham", style: { width: "100%", height: "100%" }, ref: (wrapingDiv) => {
1715
1719
  this.wrappingDiv = wrapingDiv;
1716
1720
  } },
1717
- React.createElement(AgGridReact, Object.assign({ key: key, debug: debugMode, ref: gridRef, paginationPageSize: paginationPageSize, maxConcurrentDatasourceRequests: this.props.rowModelType === "infinite" ? 1 : undefined, onGridReady: this.onGridReady, onPaginationChanged: this.onPaginationChanged, onFilterModified: this.onFilterModified, onFilterChanged: this.onFilterChanged, onSortChanged: this.onSortChanged, defaultColDef: this.getDefaultColDefinition(defaultColDef), columnDefs: adaptedColumnDefs, rowData: !rowDataManualMode ? rowData : undefined }, passedProperties, { onCellFocused: this.onCellFocused, cellSelection: rowSelection === "multiple" || (rowSelection === null || rowSelection === void 0 ? void 0 : rowSelection.mode) === "multiRow", rowSelection: rowSelection, suppressPaginationPanel: true, getRowId: getRowId, maintainColumnOrder: true, components: customComponents, columnTypes: this.columnTypes, onColumnVisible: this.onColumnsChanged, onColumnPinned: this.onColumnsChanged, onColumnResized: this.onColumnsChanged, onColumnMoved: this.onColumnsChanged, onCellMouseOver: this.onCellMouseOver, onCellMouseDown: this.onCellMouseDown, navigateToNextCell: this.navigateToNextCell, onViewportChanged: this.onViewportChanged, onCellContextMenu: this.onCellContextMenu, loadingOverlayComponent: 'loadingOverlay', noRowsOverlayComponent: 'noRecordsOverlay', onRowDataUpdated: this.onRowDataUpdated, context: this.table_context, rowHeight: this.state.rowHeight, getRowStyle: this._getRowStyle, getRowHeight: this._getRowHeight, headerHeight: headerHeight !== undefined ? headerHeight : headerFilterRowHeight, floatingFiltersHeight: headerFilterRowHeight, suppressLoadingOverlay: this.props.loadingOverlayRenderer ? true : this.props.suppressLoadingOverlay, quickFilterParser: this.wildcardQuickFilter.quickFilterParser, quickFilterMatcher: this.wildcardQuickFilter.quickFilterMatcher })),
1721
+ React.createElement(AgGridReact, Object.assign({ key: key, debug: debugMode, ref: gridRef, theme: defaultTheme, paginationPageSize: paginationPageSize, maxConcurrentDatasourceRequests: this.props.rowModelType === "infinite" ? 1 : undefined, onGridReady: this.onGridReady, onPaginationChanged: this.onPaginationChanged, onFilterModified: this.onFilterModified, onFilterChanged: this.onFilterChanged, onSortChanged: this.onSortChanged, defaultColDef: this.getDefaultColDefinition(defaultColDef), columnDefs: adaptedColumnDefs, rowData: !rowDataManualMode ? rowData : undefined }, passedProperties, { onCellFocused: this.onCellFocused, cellSelection: rowSelection === "multiple" || (rowSelection === null || rowSelection === void 0 ? void 0 : rowSelection.mode) === "multiRow", rowSelection: rowSelection, suppressPaginationPanel: true, getRowId: getRowId, maintainColumnOrder: true, components: customComponents, columnTypes: this.columnTypes, onColumnVisible: this.onColumnsChanged, onColumnPinned: this.onColumnsChanged, onColumnResized: this.onColumnsChanged, onColumnMoved: this.onColumnsChanged, onCellMouseOver: this.onCellMouseOver, onCellMouseDown: this.onCellMouseDown, navigateToNextCell: this.navigateToNextCell, onViewportChanged: this.onViewportChanged, onCellContextMenu: this.onCellContextMenu, loadingOverlayComponent: 'loadingOverlay', noRowsOverlayComponent: 'noRecordsOverlay', onRowDataUpdated: this.onRowDataUpdated, context: this.table_context, rowHeight: this.state.rowHeight, getRowStyle: this._getRowStyle, getRowHeight: this._getRowHeight, headerHeight: headerHeight !== undefined ? headerHeight : headerFilterRowHeight, floatingFiltersHeight: headerFilterRowHeight, suppressLoadingOverlay: this.props.loadingOverlayRenderer ? true : this.props.suppressLoadingOverlay, quickFilterParser: this.wildcardQuickFilter.quickFilterParser, quickFilterMatcher: this.wildcardQuickFilter.quickFilterMatcher })),
1718
1722
  this.state.loading && this.props.loadingOverlayRenderer &&
1719
1723
  React.createElement("div", { className: "ag-overlay", "aria-hidden": "true", ref: "overlayWrapper" },
1720
1724
  React.createElement("div", { className: "ag-overlay-panel" },