d2coreui 23.0.61 → 23.0.62
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 +156 -150
- package/components/grid/dataGrid.d.ts +5 -2
- package/components/grid/dataGrid.js +11 -8
- package/components/grid/dataGrid.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,150 +1,156 @@
|
|
|
1
|
-
# Changelog
|
|
2
|
-
|
|
3
|
-
## 23.0.
|
|
4
|
-
|
|
5
|
-
- `DataGrid
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
- `
|
|
29
|
-
|
|
30
|
-
- `
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
- `
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
- `
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
- `
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
- `
|
|
70
|
-
|
|
71
|
-
- `
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
- `
|
|
76
|
-
|
|
77
|
-
- `
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
`
|
|
81
|
-
- `
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
-
|
|
97
|
-
`
|
|
98
|
-
-
|
|
99
|
-
- `DateRangeInput`: the
|
|
100
|
-
no longer
|
|
101
|
-
- `
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
-
|
|
150
|
-
|
|
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"`.
|
|
@@ -70,8 +70,10 @@ export type FilterRenderer = (value: string, changeValue: (newValue: string) =>
|
|
|
70
70
|
* search is visible, and takes `hide` from the current column state when the column is already known.
|
|
71
71
|
* ag-grid's `lockVisible` is honoured by the grid's own column menu and columns configuration dialog.
|
|
72
72
|
*
|
|
73
|
-
* Besides ag-grid's own, these values can be used in `type`: `numberColumn` (localized number,
|
|
74
|
-
* `cellRendererParams.fractionDigits
|
|
73
|
+
* Besides ag-grid's own, these values can be used in `type`: `numberColumn` (localized number - in the cells, the export
|
|
74
|
+
* and the filters - with the maximum of fraction digits from `cellRendererParams.fractionDigits`, the minimum (capped
|
|
75
|
+
* at the maximum) from `cellRendererParams.minFractionDigits` and without grouping separators by
|
|
76
|
+
* `cellRendererParams.omitGrouping`), `dateColumn`, `dateTimeColumn`, `fromNowDateTimeColumn` (D2000 unix time values,
|
|
75
77
|
* formatted according to `hideYear`/`showMilliseconds`/`showUtcOffset`), `localizedArrayColumn` (array of i18n keys),
|
|
76
78
|
* `escapedValueColumn` (line breaks shown as spaces), `alignRight`, and the filter types `textColumnFilter`
|
|
77
79
|
* (client-side text filter), `textColumnServerFilter` and `customColumnServerFilter` (filter applied explicitly, the latter
|
|
@@ -459,6 +461,7 @@ export default class DataGrid<TData extends {
|
|
|
459
461
|
table_context: any;
|
|
460
462
|
private readonly getTheme;
|
|
461
463
|
constructor(props: Readonly<DataGridProps<TData>>);
|
|
464
|
+
private static formatNumberCell;
|
|
462
465
|
private static getTimeCellValue;
|
|
463
466
|
private static getCellValue;
|
|
464
467
|
/**
|
|
@@ -254,20 +254,18 @@ class DataGrid extends React.Component {
|
|
|
254
254
|
},
|
|
255
255
|
"numberColumn": {
|
|
256
256
|
cellRenderer: (params) => {
|
|
257
|
-
var _a, _b;
|
|
258
257
|
const value = DataGrid.getCellValue(params);
|
|
259
258
|
if (value !== undefined && value !== null) {
|
|
260
|
-
return
|
|
259
|
+
return DataGrid.formatNumberCell(value, params.colDef);
|
|
261
260
|
}
|
|
262
261
|
else {
|
|
263
262
|
return "";
|
|
264
263
|
}
|
|
265
264
|
},
|
|
266
265
|
valueFormatter: (params) => {
|
|
267
|
-
var _a, _b;
|
|
268
266
|
const value = DataGrid.getCellValue(params);
|
|
269
267
|
if (value !== undefined && value !== null) {
|
|
270
|
-
return
|
|
268
|
+
return DataGrid.formatNumberCell(value, params.colDef);
|
|
271
269
|
}
|
|
272
270
|
else {
|
|
273
271
|
return "";
|
|
@@ -277,20 +275,18 @@ class DataGrid extends React.Component {
|
|
|
277
275
|
textCustomComparator: this.textCustomComparator
|
|
278
276
|
},
|
|
279
277
|
filterValueGetter: function (params) {
|
|
280
|
-
var _a, _b;
|
|
281
278
|
const value = DataGrid.getCellValue(params);
|
|
282
279
|
if (value) {
|
|
283
|
-
return
|
|
280
|
+
return DataGrid.formatNumberCell(value, params.colDef);
|
|
284
281
|
}
|
|
285
282
|
else {
|
|
286
283
|
return "";
|
|
287
284
|
}
|
|
288
285
|
},
|
|
289
286
|
getQuickFilterText: function (params) {
|
|
290
|
-
var _a, _b;
|
|
291
287
|
const value = DataGrid.getCellValue(params);
|
|
292
288
|
if (value !== undefined) {
|
|
293
|
-
return
|
|
289
|
+
return DataGrid.formatNumberCell(value, params.colDef);
|
|
294
290
|
}
|
|
295
291
|
else {
|
|
296
292
|
return "";
|
|
@@ -462,6 +458,13 @@ class DataGrid extends React.Component {
|
|
|
462
458
|
"alignRight": {}
|
|
463
459
|
};
|
|
464
460
|
}
|
|
461
|
+
static formatNumberCell(value, colDef) {
|
|
462
|
+
var _a;
|
|
463
|
+
const { fractionDigits, minFractionDigits, omitGrouping } = (_a = colDef === null || colDef === void 0 ? void 0 : colDef.cellRendererParams) !== null && _a !== void 0 ? _a : {};
|
|
464
|
+
// Intl throws a RangeError when the minimum exceeds the maximum
|
|
465
|
+
const minimum = fractionDigits !== undefined && minFractionDigits !== undefined ? Math.min(minFractionDigits, fractionDigits) : minFractionDigits;
|
|
466
|
+
return LocaleHolder.getNumberFormatter(fractionDigits, omitGrouping, minimum).format(value);
|
|
467
|
+
}
|
|
465
468
|
static getTimeCellValue(props) {
|
|
466
469
|
const value = DataGrid.getCellValue(props);
|
|
467
470
|
return value === undefined || value === null || value === D2000UnixTimeNullValue ? undefined : value;
|