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 +9 -0
- package/components/grid/dataGrid.d.ts +23 -1
- package/components/grid/dataGrid.js +102 -43
- package/components/grid/dataGrid.js.map +1 -1
- package/components/grid/extendedDataGrid.js +1 -0
- package/components/grid/extendedDataGrid.js.map +1 -1
- package/components/grid/header/simpleHeader.js.map +1 -1
- package/components/grid/panel/dataGridPagination.d.ts +4 -1
- package/components/grid/panel/dataGridPagination.js +13 -8
- package/components/grid/panel/dataGridPagination.js.map +1 -1
- package/package.json +1 -1
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
|
-
/**
|
|
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 && !((
|
|
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, (
|
|
1688
|
-
|
|
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
|
-
/**
|
|
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
|
|
1693
|
-
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
-
|
|
1699
|
-
|
|
1700
|
-
|
|
1701
|
-
|
|
1702
|
-
|
|
1703
|
-
|
|
1704
|
-
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
|
|
1721
|
-
|
|
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
|
-
|
|
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: "
|
|
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;
|