@azrico/reactgrid 1.2.47 → 1.2.49
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 +28 -0
- package/dist/src/views/DataGrid.js +10 -5
- package/package.json +1 -1
- package/src/views/DataGrid.tsx +11 -5
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,34 @@
|
|
|
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.49](https://github.com/Azrideus/azrico-reactgrid/compare/v1.2.10...v1.2.49) (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
|
+
|
|
19
|
+
### [1.2.48](https://github.com/Azrideus/azrico-reactgrid/compare/v1.2.10...v1.2.48) (2023-07-09)
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
### Features
|
|
23
|
+
|
|
24
|
+
* editable can be a function ([6ea857e](https://github.com/Azrideus/azrico-reactgrid/commit/6ea857e4f403d2a334dc5e74065f6b8033277ca4))
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
### Bug Fixes
|
|
28
|
+
|
|
29
|
+
* DataGridDelayedSizeWrapper actual delayed ([2ddfd2f](https://github.com/Azrideus/azrico-reactgrid/commit/2ddfd2fb58c90bd906e1330f22f0ef7468d34afb))
|
|
30
|
+
* onCellSelectionChange ([95c8f54](https://github.com/Azrideus/azrico-reactgrid/commit/95c8f540e94dde0c7e245fb29fb6afc7172957ec))
|
|
31
|
+
* styling ([9018f75](https://github.com/Azrideus/azrico-reactgrid/commit/9018f7593e253720f751f52855a2d956dfc578ed))
|
|
32
|
+
|
|
5
33
|
### [1.2.47](https://github.com/Azrideus/azrico-reactgrid/compare/v1.2.10...v1.2.47) (2023-07-09)
|
|
6
34
|
|
|
7
35
|
|
|
@@ -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,11 @@ 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 = null, el = null) => {
|
|
143
|
+
console.log('Set menuRow:', r);
|
|
144
|
+
set_menuRow(r || null);
|
|
142
145
|
set_menuAnchorEl(el || null);
|
|
143
146
|
}, []);
|
|
144
147
|
const renderRowContextMenu = _react.default.useCallback((menuProps, {
|
|
@@ -147,15 +150,17 @@ function DataGridEventsWrapper(props) {
|
|
|
147
150
|
menuProps.autoDismiss = true;
|
|
148
151
|
function onclose() {
|
|
149
152
|
menuProps.onDismiss();
|
|
150
|
-
|
|
153
|
+
update_menuRow();
|
|
151
154
|
}
|
|
155
|
+
console.log('rowProps.data:', rowProps.data);
|
|
156
|
+
console.log('menuRow:', menuRow);
|
|
152
157
|
return _react.default.createElement(_controls.ContextMenu, {
|
|
153
158
|
menuAnchorEl: menuAnchorEl,
|
|
159
|
+
menuRow: menuRow,
|
|
154
160
|
close: onclose,
|
|
155
|
-
menuRow: rowProps.data,
|
|
156
161
|
menu_items: props.contextMenuItems
|
|
157
162
|
});
|
|
158
|
-
}, [props.contextMenuItems, menuAnchorEl,
|
|
163
|
+
}, [props.contextMenuItems, menuAnchorEl, menuRow, update_menuRow]);
|
|
159
164
|
/**
|
|
160
165
|
* Merge click events into grid options
|
|
161
166
|
*/
|
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,12 @@ 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: any = null, el: any = null) => {
|
|
299
|
+
console.log('Set menuRow:', r);
|
|
300
|
+
set_menuRow(r || null);
|
|
298
301
|
set_menuAnchorEl(el || null);
|
|
299
302
|
}, []);
|
|
300
303
|
|
|
@@ -303,18 +306,21 @@ function DataGridEventsWrapper(props: DataGridWrapperProps) {
|
|
|
303
306
|
menuProps.autoDismiss = true;
|
|
304
307
|
function onclose() {
|
|
305
308
|
menuProps.onDismiss();
|
|
306
|
-
|
|
309
|
+
update_menuRow();
|
|
307
310
|
}
|
|
311
|
+
console.log('rowProps.data:', rowProps.data);
|
|
312
|
+
console.log('menuRow:', menuRow);
|
|
313
|
+
|
|
308
314
|
return (
|
|
309
315
|
<ContextMenu
|
|
310
316
|
menuAnchorEl={menuAnchorEl}
|
|
317
|
+
menuRow={menuRow}
|
|
311
318
|
close={onclose}
|
|
312
|
-
menuRow={rowProps.data}
|
|
313
319
|
menu_items={props.contextMenuItems as any}
|
|
314
320
|
/>
|
|
315
321
|
);
|
|
316
322
|
},
|
|
317
|
-
[props.contextMenuItems, menuAnchorEl,
|
|
323
|
+
[props.contextMenuItems, menuAnchorEl, menuRow, update_menuRow]
|
|
318
324
|
);
|
|
319
325
|
/**
|
|
320
326
|
* Merge click events into grid options
|