@azrico/reactgrid 1.2.47 → 1.2.48
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 +14 -0
- package/dist/src/views/DataGrid.js +6 -4
- package/package.json +1 -1
- package/src/views/DataGrid.tsx +6 -4
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,20 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
### [1.2.48](https://github.com/Azrideus/azrico-reactgrid/compare/v1.2.10...v1.2.48) (2023-07-09)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
* editable can be a function ([6ea857e](https://github.com/Azrideus/azrico-reactgrid/commit/6ea857e4f403d2a334dc5e74065f6b8033277ca4))
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Bug Fixes
|
|
14
|
+
|
|
15
|
+
* DataGridDelayedSizeWrapper actual delayed ([2ddfd2f](https://github.com/Azrideus/azrico-reactgrid/commit/2ddfd2fb58c90bd906e1330f22f0ef7468d34afb))
|
|
16
|
+
* onCellSelectionChange ([95c8f54](https://github.com/Azrideus/azrico-reactgrid/commit/95c8f540e94dde0c7e245fb29fb6afc7172957ec))
|
|
17
|
+
* styling ([9018f75](https://github.com/Azrideus/azrico-reactgrid/commit/9018f7593e253720f751f52855a2d956dfc578ed))
|
|
18
|
+
|
|
5
19
|
### [1.2.47](https://github.com/Azrideus/azrico-reactgrid/compare/v1.2.10...v1.2.47) (2023-07-09)
|
|
6
20
|
|
|
7
21
|
|
|
@@ -115,6 +115,7 @@ function DataGridEventsWrapper(props) {
|
|
|
115
115
|
/* -------------------------------------------------------------------------- */
|
|
116
116
|
const click_data = _react.default.useRef(null);
|
|
117
117
|
const [menuAnchorEl, set_menuAnchorEl] = _react.default.useState(null);
|
|
118
|
+
const [menuRow, set_menuRow] = _react.default.useState(null);
|
|
118
119
|
/* --------------------------------- events --------------------------------- */
|
|
119
120
|
const onRowClick = _react.default.useCallback((rowProps, event) => {
|
|
120
121
|
const nowDate = Date.now();
|
|
@@ -136,9 +137,10 @@ function DataGridEventsWrapper(props) {
|
|
|
136
137
|
const onRowContextMenu = _react.default.useCallback((rowProps, event) => {
|
|
137
138
|
if (!rowProps || !rowProps.data || _func_child.func_selection.has_selection()) return;
|
|
138
139
|
const anEl = _func_child.func_selection.getVirtualElement(event.clientX, event.clientY);
|
|
139
|
-
|
|
140
|
+
update_menuRow(rowProps.data, anEl);
|
|
140
141
|
}, []);
|
|
141
|
-
const
|
|
142
|
+
const update_menuRow = _react.default.useCallback((r, el) => {
|
|
143
|
+
set_menuRow(r || null);
|
|
142
144
|
set_menuAnchorEl(el || null);
|
|
143
145
|
}, []);
|
|
144
146
|
const renderRowContextMenu = _react.default.useCallback((menuProps, {
|
|
@@ -151,11 +153,11 @@ function DataGridEventsWrapper(props) {
|
|
|
151
153
|
}
|
|
152
154
|
return _react.default.createElement(_controls.ContextMenu, {
|
|
153
155
|
menuAnchorEl: menuAnchorEl,
|
|
156
|
+
menuRow: menuRow,
|
|
154
157
|
close: onclose,
|
|
155
|
-
menuRow: rowProps.data,
|
|
156
158
|
menu_items: props.contextMenuItems
|
|
157
159
|
});
|
|
158
|
-
}, [props.contextMenuItems, menuAnchorEl,
|
|
160
|
+
}, [props.contextMenuItems, menuAnchorEl, menuRow, update_menuRow]);
|
|
159
161
|
/**
|
|
160
162
|
* Merge click events into grid options
|
|
161
163
|
*/
|
package/package.json
CHANGED
package/src/views/DataGrid.tsx
CHANGED
|
@@ -259,6 +259,7 @@ function DataGridEventsWrapper(props: DataGridWrapperProps) {
|
|
|
259
259
|
const click_data = React.useRef<any>(null);
|
|
260
260
|
|
|
261
261
|
const [menuAnchorEl, set_menuAnchorEl] = React.useState<any>(null);
|
|
262
|
+
const [menuRow, set_menuRow] = React.useState<any>(null);
|
|
262
263
|
|
|
263
264
|
/* --------------------------------- events --------------------------------- */
|
|
264
265
|
|
|
@@ -291,10 +292,11 @@ function DataGridEventsWrapper(props: DataGridWrapperProps) {
|
|
|
291
292
|
const onRowContextMenu = React.useCallback((rowProps, event) => {
|
|
292
293
|
if (!rowProps || !rowProps.data || func_selection.has_selection()) return;
|
|
293
294
|
const anEl = func_selection.getVirtualElement(event.clientX, event.clientY);
|
|
294
|
-
|
|
295
|
+
update_menuRow(rowProps.data, anEl);
|
|
295
296
|
}, []);
|
|
296
297
|
|
|
297
|
-
const
|
|
298
|
+
const update_menuRow = React.useCallback((r, el) => {
|
|
299
|
+
set_menuRow(r || null);
|
|
298
300
|
set_menuAnchorEl(el || null);
|
|
299
301
|
}, []);
|
|
300
302
|
|
|
@@ -308,13 +310,13 @@ function DataGridEventsWrapper(props: DataGridWrapperProps) {
|
|
|
308
310
|
return (
|
|
309
311
|
<ContextMenu
|
|
310
312
|
menuAnchorEl={menuAnchorEl}
|
|
313
|
+
menuRow={menuRow}
|
|
311
314
|
close={onclose}
|
|
312
|
-
menuRow={rowProps.data}
|
|
313
315
|
menu_items={props.contextMenuItems as any}
|
|
314
316
|
/>
|
|
315
317
|
);
|
|
316
318
|
},
|
|
317
|
-
[props.contextMenuItems, menuAnchorEl,
|
|
319
|
+
[props.contextMenuItems, menuAnchorEl, menuRow, update_menuRow]
|
|
318
320
|
);
|
|
319
321
|
/**
|
|
320
322
|
* Merge click events into grid options
|