d2coreui 23.0.62 → 26.1.1

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,156 +1,153 @@
1
- # Changelog
2
-
3
- ## 23.0.62
4
-
5
- - `DataGrid`: the `numberColumn` type takes also `cellRendererParams.minFractionDigits` (capped at `fractionDigits`)
6
- and `omitGrouping`, in the cells, the export and the filters. `minFractionDigits` needs `d2core` 23.0.22 or newer -
7
- with an older one, columns of the same `fractionDigits` share the minimum of the first one rendered.
8
-
9
- ## 23.0.61
10
-
11
- - `DataGrid` / `ExtendedDataGrid`: `exportData(exportType, options)` exports the grid to a TXT, CSV or PDF file or to
12
- the clipboard the same way as the toolbar export menu, so that the export can be started from a custom button
13
- outside the grid; `options.onlySelectedRows` exports only the selected rows and `options.pageOrientation` sets the
14
- PDF page orientation. `toolbar.hideExportButton` hides the built-in export menu button.
15
- - `grid/export/contextMenu`: `runExport(exportType, props)` runs one export of the menu built by `getContextMenu`.
16
- - `grid/export/contextMenu` / `DataGrid`: a failed export no longer leaves the grid exporting with the export menu
17
- items disabled - `onExport(false)` is called also after a failure, and the progress notification is replaced by an
18
- error one. For the PDF export `onExport(false)` comes once the file is saved, not when its generation starts. Clicks
19
- on custom menu items no longer call `onExport`.
20
- - `DataGrid` / `grid/export/contextMenu`: the CSV export starts with a UTF-8 BOM, so that Excel shows characters with
21
- diacritics correctly instead of opening the file in the ANSI code page.
22
-
23
- ## 23.0.60
24
-
25
- - `ExtendedDataGrid`: `GridConfiguration.showUtcOffset` and `defaultShowUtcOffset` are no longer `true` by default -
26
- without them the grid follows the global mode of `LocaleHolder.setUtcOffsetMode`. Pass `showUtcOffset: true` in
27
- `defaultGridConfiguration` to keep the UTC offset in a grid.
28
- - `ExtendedDataGrid`: `getGridDateTimeFormat(configuration)` returns the date-time format the grid's date-time columns
29
- use (year, milliseconds and UTC offset of the table settings), for columns that format date-time values themselves.
30
- - `DataGrid`: the `dateColumn`, `dateTimeColumn` and `fromNowDateTimeColumn` columns show a missing value and the D2000
31
- null time as an empty cell (also in the copied and exported text) instead of `---`, `Null Time` or a date in 1972,
32
- and the column filters and the quick filter no longer match the null time by its 1972 date. The time `0` is shown
33
- as its date in 1970 in `dateTimeColumn` too, instead of an empty cell.
34
- - `DataGrid`: Ctrl+Enter in a cell editor works like Enter instead of ag-grid's bulk edit, which wrote the value into
35
- every cell of the selected rows.
36
- - `DateTimeInput`: the D2000 null time is recognized (shown empty with the `Null Time` placeholder) also after
37
- `setUnixTimeConversion(UnixTimeConversionEnum.FROM_MILIS)`, not only in the seconds mode.
38
- - `DateTimeInput` / `DateRangeInput`: with a `Z` / `ZZ` mask the UTC offset no longer has to be typed - an empty or
39
- mismatching offset is completed from the typed date and time (in the repeated hour of the daylight saving time to
40
- the second one, as `B` of `HH?`), instead of leaving the value invalid until the exact offset is typed.
41
- - `DurationInput`: no longer fails with `isDuration is not a function` in a Vite production build of an application,
42
- when the component is loaded before the dayjs duration plugin of `d2core/dayjs` is applied.
43
-
44
- ## 23.0.59
45
-
46
- - `DataGrid` / `ExtendedDataGrid`: `toolbar.compact` for a narrow (mobile) screen - the export and table settings
47
- buttons move into a popover opened by one button, the pager has only the previous, "page / pages" and next buttons,
48
- and a pager that still does not fit moves to a line of its own under the toolbar.
49
- - `DataGrid`: the toolbar line is aligned to the top, so the pager and the record range stay next to the toolbar
50
- buttons when `toolbar.renderToolbar` adds content under them; `toolbar.extraContent` lower than a button is now at the
51
- top of the line instead of in its middle.
52
-
53
- ## 23.0.58
54
-
55
- - `ModalDialog`: the maximize / restore button is shown only with `maximizable`, which is now `false` by default -
56
- pass `maximizable` to keep the button in a dialog.
57
- - `DataGrid` / `ExtendedDataGrid`: a column with ag-grid's `lockVisible` (also from `defaultColDef` or a column type)
58
- can no longer be hidden or shown from the column menu ("Hide Column" is disabled), the columns configuration dialog
59
- or the column tree of the table settings (the column is disabled there and left out when its whole group is moved
60
- or checked). ag-grid applies `lockVisible` only to its own UI, which the grid does not use.
61
- - `ColumnTransfer`: a column group in the tree (the `SIMPLE` layout and the hidden columns of the `FULL` layout) is
62
- shown as fully checked only when all its columns are checked, including locked ones; otherwise it is half checked.
63
- A click on a group checks its unlocked columns, or unchecks them when all of them are checked.
64
-
65
- ## 23.0.57
66
-
67
- - `DateTimeInput` / `DateRangeInput`: `autoWidth` measures the right width with a theme `fontFamily` that is not a
68
- valid unquoted CSS name (e.g. `"72"`); the input was too narrow and cut the value.
69
- - `DateRangeInput`: in the advanced popup the begin / both / end time shift icons sit below the duration buttons,
70
- so that "Now", "Hour" and "15 min" of the three columns are in one row.
71
- - `DataGrid` / `ExtendedDataGrid`: the `oddRowBackgroundColor` of a `theme` passed in is applied; rows without a
72
- background color from `rowStyleRules` no longer get an inline `background-color: inherit` that overrode it. The
73
- default theme keeps odd rows unstriped unless the new antd token `gridOddRowBg` is set (`ConfigProvider`
74
- `theme={{token: {gridOddRowBg: "#fafafa"}}}`).
75
- - `ModalDialog`: a dialog opened larger than the window is shrunk to the window minus the margin a maximized dialog
76
- keeps, and centred, instead of filling the window edge to edge.
77
- - `ModalDialog`: a dialog kept in the DOM (`destroyOnHidden={false}`) opens on top of the modals opened since its first
78
- opening, instead of under them.
79
- - `DataGrid` / `ExtendedDataGrid`: changing the table configuration (column order, width, sort, …) no longer makes
80
- ag-grid log `Updated property onShowUtcOffset` in development - the time format props stay out of `AgGridReact`.
81
- - `DataGrid`: `onLoadData`, `defaultRowStyleRules` and the time format props no longer reach `AgGridReact`, which
82
- warned about them as invalid grid options.
83
- - `DataGrid` / `ExtendedDataGrid`: `showUtcOffset` takes a `UtcOffsetMode` of `d2core/i18n/localeHolder` - besides
84
- `true` / `false` also `"hourLetter"` (the repeated hour at the end of the daylight saving time as `A2:00` / `B2:00`)
85
- and `"offsetInFold"` (the UTC offset only in that hour); the table settings offer all four. `DataGrid` without
86
- `showUtcOffset` follows the global mode of `LocaleHolder.setUtcOffsetMode`.
87
- - `DateTimeInput` / `DateRangeInput`: a mask with `HH?` shows and takes the repeated hour as `A2` / `B2` - an hour
88
- typed there without the letter is the second one (`B`) and a letter outside that hour is invalid; a mask with `Z?`
89
- shows the UTC offset at every time, so that the input keeps its layout.
90
- - `DateTimeInput` / `DateRangeInput`: a time skipped at the start of the daylight saving time (29.03. 02:30) and a day
91
- that does not exist (31.02.) are invalid with any mask, instead of being silently moved to another time; the input
92
- no longer keeps showing such a typed text while it holds the moved value.
93
-
94
- ## 23.0.56
95
-
96
- - Components styled through `WithCss` (`DateTimeInput`, `DateRangeInput`, `DurationInput`, grid, pagination, …) take
97
- the `componentSize` of an enclosing `ConfigProvider` when given no `size` and outside a `Space.Compact`, instead of
98
- `middle` - the box no longer stays taller than the small inputs inside it.
99
- - `DateTimeInput` / `DateRangeInput`: `autoWidth` measures the mask in the font of the resolved size, so a `large`
100
- size taken from a `ConfigProvider` or a `Space.Compact` no longer cuts the value off.
101
- - `WithCss`: the render function gets the resolved `size` and `variant` as its second argument.
102
- - `DateRangeInputConfirm`: the Revert/Apply buttons are 48 px wide for a `small` size taken from a `ConfigProvider` or a
103
- `Space.Compact` as well, not only for the `size` prop.
104
- - `DateTimeInput`: the calendar icon is centred on the input even when a flex parent stretches the component.
105
- - `DateRangeInput`: the inputs and the `⟷` separator of the advanced popup are vertically centred; `compact` and `ranges`
106
- no longer reach the DOM as attributes.
107
- - `DateRangeInput`: the inputs of the advanced popup are at least as wide as the mask, so the popup grows with a long
108
- mask instead of cutting the values off; `autoWidth` inputs fill a root stretched by their parent.
109
- - `DateRangeInput`: the three button columns of the advanced popup share the extra width of a popup widened by the
110
- mask; the popup inputs are `small` like the rest of its controls.
111
-
112
- ## 23.0.55
113
-
114
- - `DateTimeInput`, `DateRangeInput`: optional `autoWidth` prop sizes the component to the rendered mask instead of
115
- filling the parent.
116
- - `DateRangeInput`: the separator between the two inputs is the antd `SwapRightOutlined` icon with the antd range
117
- picker spacing instead of the `⟷` character.
118
-
119
- ## 23.0.54
120
-
121
- - `DataGrid` / `ExtendedDataGrid`: typed by the row data type. `DataGridProps<TData>` and
122
- `ExtendedDataGridProps<TData>` pass it to the ag-grid `GridOptions` (`rowData`, `getRowId`, events, `gridRef`), and
123
- `DataGrid<TData>` uses it for `gridApi` and `columnTypes`. Without an explicit type argument the type is inferred from
124
- `rowData` and the handlers, so rows must have an `id` of type `number | string`, and handlers typed for another row
125
- type no longer compile. The default type argument is `any`.
126
- - `DataGrid` / `ExtendedDataGrid`: `columnDefs` may contain column groups (`DataGridColGroupDef`). The group is only a
127
- header; its children are adapted like top-level columns (header menu, resizing, cell style, drag & drop in the grid
128
- header) and the columns configuration dialog lists them by their own `group`. Reordering in the dialog does not
129
- respect group boundaries.
130
- - `DataGrid`: the fill-handle highlight uses the displayed column order, the same as the filled range.
131
-
132
- ## 23.0.53
133
-
134
- - `DateRangeInput`: time shift by month or year keeps an interval end that lies at the end of a month at the end of
135
- the target month (30.09. 23:59:59.999 - 1 month = 31.08. 23:59:59.999, not 30.08.). Other values shift as before.
136
- - The public API is documented with JSDoc and the published declaration files (`.d.ts`) keep the comments.
137
- - The package ships `README.md` and `CHANGELOG.md`.
138
-
139
- ## 23.0.52
140
-
141
- - `ExtendedDataGrid`: optional `detailPanel.onVisibleChange(visible)` handler, called when the splitter collapses or
142
- expands the detail panel (collapse arrow or dragging the divider).
143
-
144
- ## 23.0.51
145
-
146
- - pdfmake 0.2.23: `pdfmake/build/vfs_fonts` is a regular CommonJS module, vite applications need no workaround for
147
- the PDF export worker anymore.
148
- - `style/index.less` imports `antd/dist/reset.css` without the webpack-only `~` prefix.
149
- - codemirror 5.65.20.
150
- - Removed the unused `react-codemirror-runmode` dependency.
151
- - The package no longer ships `tsconfig.json` and `tsconfig.build.json`.
152
-
153
- ## 23.0.50
154
-
155
- - Grid export workers are standard `new Worker(new URL(...))` entry points: a webpack application emitting its
156
- chunks into a subdirectory needs `output.publicPath: "auto"`.
1
+ # Changelog
2
+
3
+ ## 26.1.1
4
+
5
+ - `DataGrid`: a `getRowId` prop overrides the default row id `String(data.id)`.
6
+ - `DataGrid` / `ExtendedDataGrid`: `headerMenu` (`renderer`, `onClick`, both with the column) customizes the menu of a
7
+ column header, like `settingsMenu` the toolbar settings menu.
8
+
9
+ ## 26.1.0
10
+
11
+ - `DataGrid` / `ExtendedDataGrid`: `toolbar.compact` for a narrow (mobile) screen - the export and table settings
12
+ buttons move into a popover opened by one button, the pager has only the previous, "page / pages" and next buttons,
13
+ and a pager that still does not fit moves to a line of its own under the toolbar.
14
+ - `DataGrid`: the toolbar line is aligned to the top, so the pager and the record range stay next to the toolbar
15
+ buttons when `toolbar.renderToolbar` adds content under them; `toolbar.extraContent` lower than a button is now at the
16
+ top of the line instead of in its middle.
17
+ - `ExtendedDataGrid`: `GridConfiguration.showUtcOffset` and `defaultShowUtcOffset` are no longer `true` by default -
18
+ without them the grid follows the global mode of `LocaleHolder.setUtcOffsetMode`. Pass `showUtcOffset: true` in
19
+ `defaultGridConfiguration` to keep the UTC offset in a grid.
20
+ - `ExtendedDataGrid`: `getGridDateTimeFormat(configuration)` returns the date-time format the grid's date-time columns
21
+ use (year, milliseconds and UTC offset of the table settings), for columns that format date-time values themselves.
22
+ - `DataGrid`: the `dateColumn`, `dateTimeColumn` and `fromNowDateTimeColumn` columns show a missing value and the D2000
23
+ null time as an empty cell (also in the copied and exported text) instead of `---`, `Null Time` or a date in 1972,
24
+ and the column filters and the quick filter no longer match the null time by its 1972 date. The time `0` is shown
25
+ as its date in 1970 in `dateTimeColumn` too, instead of an empty cell.
26
+ - `DataGrid`: Ctrl+Enter in a cell editor works like Enter instead of ag-grid's bulk edit, which wrote the value into
27
+ every cell of the selected rows.
28
+ - `DateTimeInput`: the D2000 null time is recognized (shown empty with the `Null Time` placeholder) also after
29
+ `setUnixTimeConversion(UnixTimeConversionEnum.FROM_MILIS)`, not only in the seconds mode.
30
+ - `DateTimeInput` / `DateRangeInput`: with a `Z` / `ZZ` mask the UTC offset no longer has to be typed - an empty or
31
+ mismatching offset is completed from the typed date and time (in the repeated hour of the daylight saving time to
32
+ the second one, as `B` of `HH?`), instead of leaving the value invalid until the exact offset is typed.
33
+ - `DurationInput`: no longer fails with `isDuration is not a function` in a Vite production build of an application,
34
+ when the component is loaded before the dayjs duration plugin of `d2core/dayjs` is applied.
35
+ - `DataGrid` / `ExtendedDataGrid`: `exportData(exportType, options)` exports the grid to a TXT, CSV or PDF file or to
36
+ the clipboard the same way as the toolbar export menu, so that the export can be started from a custom button
37
+ outside the grid; `options.onlySelectedRows` exports only the selected rows and `options.pageOrientation` sets the
38
+ PDF page orientation. `toolbar.hideExportButton` hides the built-in export menu button.
39
+ - `grid/export/contextMenu`: `runExport(exportType, props)` runs one export of the menu built by `getContextMenu`.
40
+ - `grid/export/contextMenu` / `DataGrid`: a failed export no longer leaves the grid exporting with the export menu
41
+ items disabled - `onExport(false)` is called also after a failure, and the progress notification is replaced by an
42
+ error one. For the PDF export `onExport(false)` comes once the file is saved, not when its generation starts. Clicks
43
+ on custom menu items no longer call `onExport`.
44
+ - `DataGrid` / `grid/export/contextMenu`: the CSV export starts with a UTF-8 BOM, so that Excel shows characters with
45
+ diacritics correctly instead of opening the file in the ANSI code page.
46
+ - `DataGrid`: the `numberColumn` type takes also `cellRendererParams.minFractionDigits` (capped at `fractionDigits`)
47
+ and `omitGrouping`, in the cells, the export and the filters. `minFractionDigits` needs `d2core` 23.0.22 or newer -
48
+ with an older one, columns of the same `fractionDigits` share the minimum of the first one rendered.
49
+
50
+ ## 23.0.58
51
+
52
+ - `ModalDialog`: the maximize / restore button is shown only with `maximizable`, which is now `false` by default -
53
+ pass `maximizable` to keep the button in a dialog.
54
+ - `DataGrid` / `ExtendedDataGrid`: a column with ag-grid's `lockVisible` (also from `defaultColDef` or a column type)
55
+ can no longer be hidden or shown from the column menu ("Hide Column" is disabled), the columns configuration dialog
56
+ or the column tree of the table settings (the column is disabled there and left out when its whole group is moved
57
+ or checked). ag-grid applies `lockVisible` only to its own UI, which the grid does not use.
58
+ - `ColumnTransfer`: a column group in the tree (the `SIMPLE` layout and the hidden columns of the `FULL` layout) is
59
+ shown as fully checked only when all its columns are checked, including locked ones; otherwise it is half checked.
60
+ A click on a group checks its unlocked columns, or unchecks them when all of them are checked.
61
+
62
+ ## 23.0.57
63
+
64
+ - `DateTimeInput` / `DateRangeInput`: `autoWidth` measures the right width with a theme `fontFamily` that is not a
65
+ valid unquoted CSS name (e.g. `"72"`); the input was too narrow and cut the value.
66
+ - `DateRangeInput`: in the advanced popup the begin / both / end time shift icons sit below the duration buttons,
67
+ so that "Now", "Hour" and "15 min" of the three columns are in one row.
68
+ - `DataGrid` / `ExtendedDataGrid`: the `oddRowBackgroundColor` of a `theme` passed in is applied; rows without a
69
+ background color from `rowStyleRules` no longer get an inline `background-color: inherit` that overrode it. The
70
+ default theme keeps odd rows unstriped unless the new antd token `gridOddRowBg` is set (`ConfigProvider`
71
+ `theme={{token: {gridOddRowBg: "#fafafa"}}}`).
72
+ - `ModalDialog`: a dialog opened larger than the window is shrunk to the window minus the margin a maximized dialog
73
+ keeps, and centred, instead of filling the window edge to edge.
74
+ - `ModalDialog`: a dialog kept in the DOM (`destroyOnHidden={false}`) opens on top of the modals opened since its first
75
+ opening, instead of under them.
76
+ - `DataGrid` / `ExtendedDataGrid`: changing the table configuration (column order, width, sort, …) no longer makes
77
+ ag-grid log `Updated property onShowUtcOffset` in development - the time format props stay out of `AgGridReact`.
78
+ - `DataGrid`: `onLoadData`, `defaultRowStyleRules` and the time format props no longer reach `AgGridReact`, which
79
+ warned about them as invalid grid options.
80
+ - `DataGrid` / `ExtendedDataGrid`: `showUtcOffset` takes a `UtcOffsetMode` of `d2core/i18n/localeHolder` - besides
81
+ `true` / `false` also `"hourLetter"` (the repeated hour at the end of the daylight saving time as `A2:00` / `B2:00`)
82
+ and `"offsetInFold"` (the UTC offset only in that hour); the table settings offer all four. `DataGrid` without
83
+ `showUtcOffset` follows the global mode of `LocaleHolder.setUtcOffsetMode`.
84
+ - `DateTimeInput` / `DateRangeInput`: a mask with `HH?` shows and takes the repeated hour as `A2` / `B2` - an hour
85
+ typed there without the letter is the second one (`B`) and a letter outside that hour is invalid; a mask with `Z?`
86
+ shows the UTC offset at every time, so that the input keeps its layout.
87
+ - `DateTimeInput` / `DateRangeInput`: a time skipped at the start of the daylight saving time (29.03. 02:30) and a day
88
+ that does not exist (31.02.) are invalid with any mask, instead of being silently moved to another time; the input
89
+ no longer keeps showing such a typed text while it holds the moved value.
90
+
91
+ ## 23.0.56
92
+
93
+ - Components styled through `WithCss` (`DateTimeInput`, `DateRangeInput`, `DurationInput`, grid, pagination, …) take
94
+ the `componentSize` of an enclosing `ConfigProvider` when given no `size` and outside a `Space.Compact`, instead of
95
+ `middle` - the box no longer stays taller than the small inputs inside it.
96
+ - `DateTimeInput` / `DateRangeInput`: `autoWidth` measures the mask in the font of the resolved size, so a `large`
97
+ size taken from a `ConfigProvider` or a `Space.Compact` no longer cuts the value off.
98
+ - `WithCss`: the render function gets the resolved `size` and `variant` as its second argument.
99
+ - `DateRangeInputConfirm`: the Revert/Apply buttons are 48 px wide for a `small` size taken from a `ConfigProvider` or a
100
+ `Space.Compact` as well, not only for the `size` prop.
101
+ - `DateTimeInput`: the calendar icon is centred on the input even when a flex parent stretches the component.
102
+ - `DateRangeInput`: the inputs and the `⟷` separator of the advanced popup are vertically centred; `compact` and `ranges`
103
+ no longer reach the DOM as attributes.
104
+ - `DateRangeInput`: the inputs of the advanced popup are at least as wide as the mask, so the popup grows with a long
105
+ mask instead of cutting the values off; `autoWidth` inputs fill a root stretched by their parent.
106
+ - `DateRangeInput`: the three button columns of the advanced popup share the extra width of a popup widened by the
107
+ mask; the popup inputs are `small` like the rest of its controls.
108
+
109
+ ## 23.0.55
110
+
111
+ - `DateTimeInput`, `DateRangeInput`: optional `autoWidth` prop sizes the component to the rendered mask instead of
112
+ filling the parent.
113
+ - `DateRangeInput`: the separator between the two inputs is the antd `SwapRightOutlined` icon with the antd range
114
+ picker spacing instead of the `⟷` character.
115
+
116
+ ## 23.0.54
117
+
118
+ - `DataGrid` / `ExtendedDataGrid`: typed by the row data type. `DataGridProps<TData>` and
119
+ `ExtendedDataGridProps<TData>` pass it to the ag-grid `GridOptions` (`rowData`, `getRowId`, events, `gridRef`), and
120
+ `DataGrid<TData>` uses it for `gridApi` and `columnTypes`. Without an explicit type argument the type is inferred from
121
+ `rowData` and the handlers, so rows must have an `id` of type `number | string`, and handlers typed for another row
122
+ type no longer compile. The default type argument is `any`.
123
+ - `DataGrid` / `ExtendedDataGrid`: `columnDefs` may contain column groups (`DataGridColGroupDef`). The group is only a
124
+ header; its children are adapted like top-level columns (header menu, resizing, cell style, drag & drop in the grid
125
+ header) and the columns configuration dialog lists them by their own `group`. Reordering in the dialog does not
126
+ respect group boundaries.
127
+ - `DataGrid`: the fill-handle highlight uses the displayed column order, the same as the filled range.
128
+
129
+ ## 23.0.53
130
+
131
+ - `DateRangeInput`: time shift by month or year keeps an interval end that lies at the end of a month at the end of
132
+ the target month (30.09. 23:59:59.999 - 1 month = 31.08. 23:59:59.999, not 30.08.). Other values shift as before.
133
+ - The public API is documented with JSDoc and the published declaration files (`.d.ts`) keep the comments.
134
+ - The package ships `README.md` and `CHANGELOG.md`.
135
+
136
+ ## 23.0.52
137
+
138
+ - `ExtendedDataGrid`: optional `detailPanel.onVisibleChange(visible)` handler, called when the splitter collapses or
139
+ expands the detail panel (collapse arrow or dragging the divider).
140
+
141
+ ## 23.0.51
142
+
143
+ - pdfmake 0.2.23: `pdfmake/build/vfs_fonts` is a regular CommonJS module, vite applications need no workaround for
144
+ the PDF export worker anymore.
145
+ - `style/index.less` imports `antd/dist/reset.css` without the webpack-only `~` prefix.
146
+ - codemirror 5.65.20.
147
+ - Removed the unused `react-codemirror-runmode` dependency.
148
+ - The package no longer ships `tsconfig.json` and `tsconfig.build.json`.
149
+
150
+ ## 23.0.50
151
+
152
+ - Grid export workers are standard `new Worker(new URL(...))` entry points: a webpack application emitting its
153
+ chunks into a subdirectory needs `output.publicPath: "auto"`.
@@ -166,7 +166,7 @@ export type OnLoadDataCallback = (totalRecords: number) => void;
166
166
  * - `columnDefs` are {@link DataGridColDef}s, optionally wrapped in {@link DataGridColGroupDef}s;
167
167
  * - `paginationPageSize` is not available, use `paging.pageSize`;
168
168
  * - `getRowStyle` is combined with {@link DataGridProps.rowStyleRules};
169
- * - `getRowId` is fixed to `String(data.id)`, so every row object must have a unique `id`;
169
+ * - `getRowId` defaults to `String(data.id)`, so without it every row object must have a unique `id`;
170
170
  * - the pagination panel, overlays, header component, column types, `context` and several event handlers are provided
171
171
  * by DataGrid (the handlers listed here are still called).
172
172
  *
@@ -335,6 +335,27 @@ export interface DataGridProps<TData = any> extends Omit<GridOptions<TData>, "co
335
335
  /** Called with the key of a clicked custom (non built-in) menu item. */
336
336
  onClick?(key: string): void;
337
337
  };
338
+ /**
339
+ * Column header menu customization (right click or the menu button of a column header - pin, autosize, hide, reset
340
+ * columns, columns configuration). Applies to the columns with the built-in header component.
341
+ */
342
+ headerMenu?: {
343
+ /**
344
+ * Transforms the default menu items, e.g. to add or remove entries.
345
+ *
346
+ * @param menuElements The default items.
347
+ * @param column The column whose header the menu belongs to.
348
+ * @returns The items of the menu.
349
+ */
350
+ renderer?(menuElements: MenuElement[], column: Column): MenuElement[];
351
+ /**
352
+ * Called with the key of a clicked custom (non built-in) menu item.
353
+ *
354
+ * @param key The key of the item.
355
+ * @param column The column whose header the menu belongs to.
356
+ */
357
+ onClick?(key: string, column: Column): void;
358
+ };
338
359
  /** Row context menu (right click) customization; the built-in items export the selected rows to TXT, CSV, PDF or the clipboard. */
339
360
  contextMenu?: {
340
361
  /** Transforms the default menu items, e.g. to add or remove entries. */
@@ -653,6 +674,8 @@ export default class DataGrid<TData extends {
653
674
  private renderSearchButton;
654
675
  /** Builds the toolbar settings menu (keys `columnFilter`, `autosizeAllColumns`, `columnsConfig`, `advancedConfig`), passed through `settingsMenu.renderer`. */
655
676
  getSettingsMenu(): MenuProps;
677
+ /** @returns {@link DataGridProps.headerMenu} as it is now - the header components keep this function, not the props. */
678
+ getHeaderMenuCustomization(): DataGridProps["headerMenu"];
656
679
  private getAdaptedColumnDefs;
657
680
  private isInRange;
658
681
  render(): React.JSX.Element;
@@ -201,6 +201,7 @@ class DataGrid extends React.Component {
201
201
  this.onSortChanged = this.onSortChanged.bind(this);
202
202
  this.showTableConfiguration = this.showTableConfiguration.bind(this);
203
203
  this.showColumnsConfig = this.showColumnsConfig.bind(this);
204
+ this.getHeaderMenuCustomization = this.getHeaderMenuCustomization.bind(this);
204
205
  this.navigateToNextCell = this.navigateToNextCell.bind(this);
205
206
  this.suppressKeyboardEvent = this.suppressKeyboardEvent.bind(this);
206
207
  this.onRowDataUpdated = this.onRowDataUpdated.bind(this);
@@ -1871,6 +1872,10 @@ class DataGrid extends React.Component {
1871
1872
  }
1872
1873
  };
1873
1874
  }
1875
+ /** @returns {@link DataGridProps.headerMenu} as it is now - the header components keep this function, not the props. */
1876
+ getHeaderMenuCustomization() {
1877
+ return this.props.headerMenu;
1878
+ }
1874
1879
  getAdaptedColumnDefs(columnDefs, floatingFilterEnabled, disableColumnDefsPreprocessing) {
1875
1880
  if (columnDefs.length === 0) {
1876
1881
  return undefined;
@@ -1899,7 +1904,8 @@ class DataGrid extends React.Component {
1899
1904
  });
1900
1905
  }
1901
1906
  return Object.assign(Object.assign({}, rest), { floatingFilter: floatingFilterEnabledForColumn && floatingFilterEnabled, resizable: true, headerComponent: headerComponent !== null && headerComponent !== void 0 ? headerComponent : "simpleHeader", headerComponentParams: headerComponentParams !== null && headerComponentParams !== void 0 ? headerComponentParams : {
1902
- onColumnsConfigVisible: this.showColumnsConfig
1907
+ onColumnsConfigVisible: this.showColumnsConfig,
1908
+ getHeaderMenuCustomization: this.getHeaderMenuCustomization,
1903
1909
  }, hide: (_d = (_c = this.state.columnModel.find((c) => c.colId === columnDef.colId)) === null || _c === void 0 ? void 0 : _c.hide) !== null && _d !== void 0 ? _d : (hide === undefined ? rest.initialHide : hide), cellStyle: this._getCellStyle, cellRendererParams: columnDef.cellStyle ? Object.assign(columnDef.cellRendererParams !== undefined ? columnDef.cellRendererParams : {}, { originalCellStyle: columnDef.cellStyle }) : columnDef.cellRendererParams, editable: editable, cellEditorPopup: !editable ? undefined : cellEditorPopup !== false, cellClassRules: {
1904
1910
  'cell-has-handle': (p) => { var _a, _b; return ((_a = this.state.focusedCell) === null || _a === void 0 ? void 0 : _a.rowIndex) === p.rowIndex && ((_b = this.state.focusedCell) === null || _b === void 0 ? void 0 : _b.colId) === p.colDef.colId && !this.state.isDragging; },
1905
1911
  'cell-drag-selected': (params) => (this.state.startCoord !== null && this.state.endCoord !== null) ? this.isInRange(params.rowIndex, params.colDef.colId) : false,
@@ -1929,7 +1935,7 @@ class DataGrid extends React.Component {
1929
1935
  ;
1930
1936
  render() {
1931
1937
  var _a;
1932
- 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"]);
1938
+ 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, headerMenu, 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", "headerMenu", "exportMenu", "panelStyle", "tablePanelStyle", "onColumnDefsAdapted", "tableOverlayRenderer", "onKeyPressed", "theme"]);
1933
1939
  let key;
1934
1940
  let paginationPageSize = undefined;
1935
1941
  if (paging.pageSize > 0) {
@@ -1994,7 +2000,7 @@ class DataGrid extends React.Component {
1994
2000
  React.createElement(ConfigProvider.ConfigContext.Consumer, null, (context) => {
1995
2001
  var _a;
1996
2002
  const defaultTheme = theme !== null && theme !== void 0 ? theme : this.getTheme((_a = context.theme) === null || _a === void 0 ? void 0 : _a.algorithm, styles.theme);
1997
- return (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, suppressRowClickSelection: rowSelection === "multiple" || (rowSelection === null || rowSelection === void 0 ? void 0 : rowSelection.mode) === "multiRow", suppressRowDeselection: rowSelection === "multiple" || (rowSelection === null || rowSelection === void 0 ? void 0 : rowSelection.mode) === "multiRow", suppressPaginationPanel: true, getRowId: getRowId, maintainColumnOrder: true, components: customComponents, columnTypes: this.columnTypes, onColumnVisible: this.onColumnsChanged, onColumnPinned: this.onColumnsChanged, onColumnResized: this.onColumnsChanged, onColumnMoved: this.onColumnsChanged, onNewColumnsLoaded: this.onNewColumnsLoaded, 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 })));
2003
+ return (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, getRowId: getRowId }, passedProperties, { onCellFocused: this.onCellFocused, cellSelection: rowSelection === "multiple" || (rowSelection === null || rowSelection === void 0 ? void 0 : rowSelection.mode) === "multiRow", rowSelection: rowSelection, suppressRowClickSelection: rowSelection === "multiple" || (rowSelection === null || rowSelection === void 0 ? void 0 : rowSelection.mode) === "multiRow", suppressRowDeselection: rowSelection === "multiple" || (rowSelection === null || rowSelection === void 0 ? void 0 : rowSelection.mode) === "multiRow", suppressPaginationPanel: true, maintainColumnOrder: true, components: customComponents, columnTypes: this.columnTypes, onColumnVisible: this.onColumnsChanged, onColumnPinned: this.onColumnsChanged, onColumnResized: this.onColumnsChanged, onColumnMoved: this.onColumnsChanged, onNewColumnsLoaded: this.onNewColumnsLoaded, 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 })));
1998
2004
  }),
1999
2005
  this.state.loading && this.props.loadingOverlayRenderer &&
2000
2006
  React.createElement("div", { className: "ag-overlay", "aria-hidden": "true" },