@azrico/reactgrid 1.2.46 → 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 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.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
+
19
+ ### [1.2.47](https://github.com/Azrideus/azrico-reactgrid/compare/v1.2.10...v1.2.47) (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.46](https://github.com/Azrideus/azrico-reactgrid/compare/v1.2.10...v1.2.46) (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,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
- update_menuAnchorEl(anEl);
140
+ update_menuRow(rowProps.data, anEl);
140
141
  }, []);
141
- const update_menuAnchorEl = _react.default.useCallback(el => {
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, {
@@ -150,13 +152,12 @@ function DataGridEventsWrapper(props) {
150
152
  set_menuAnchorEl(null);
151
153
  }
152
154
  return _react.default.createElement(_controls.ContextMenu, {
153
- dontAutoClose: true,
154
155
  menuAnchorEl: menuAnchorEl,
156
+ menuRow: menuRow,
155
157
  close: onclose,
156
- menuRow: rowProps.data,
157
158
  menu_items: props.contextMenuItems
158
159
  });
159
- }, [props.contextMenuItems, menuAnchorEl, update_menuAnchorEl]);
160
+ }, [props.contextMenuItems, menuAnchorEl, menuRow, update_menuRow]);
160
161
  /**
161
162
  * Merge click events into grid options
162
163
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@azrico/reactgrid",
3
- "version": "1.2.46",
3
+ "version": "1.2.48",
4
4
  "main": "dist/index.js",
5
5
  "description": "React Datagrid",
6
6
  "author": "Azrideus <MehrdadTavangar@gmail.com>",
@@ -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
- update_menuAnchorEl(anEl);
295
+ update_menuRow(rowProps.data, anEl);
295
296
  }, []);
296
297
 
297
- const update_menuAnchorEl = React.useCallback((el) => {
298
+ const update_menuRow = React.useCallback((r, el) => {
299
+ set_menuRow(r || null);
298
300
  set_menuAnchorEl(el || null);
299
301
  }, []);
300
302
 
@@ -307,15 +309,14 @@ function DataGridEventsWrapper(props: DataGridWrapperProps) {
307
309
  }
308
310
  return (
309
311
  <ContextMenu
310
- dontAutoClose
311
312
  menuAnchorEl={menuAnchorEl}
313
+ menuRow={menuRow}
312
314
  close={onclose}
313
- menuRow={rowProps.data}
314
315
  menu_items={props.contextMenuItems as any}
315
316
  />
316
317
  );
317
318
  },
318
- [props.contextMenuItems, menuAnchorEl, update_menuAnchorEl]
319
+ [props.contextMenuItems, menuAnchorEl, menuRow, update_menuRow]
319
320
  );
320
321
  /**
321
322
  * Merge click events into grid options