@azrico/reactgrid 1.2.37 → 1.2.39
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 +22 -15
- package/package.json +1 -1
- package/src/views/DataGrid.tsx +23 -14
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.39](https://github.com/Azrideus/azrico-reactgrid/compare/v1.2.10...v1.2.39) (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.38](https://github.com/Azrideus/azrico-reactgrid/compare/v1.2.10...v1.2.38) (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.37](https://github.com/Azrideus/azrico-reactgrid/compare/v1.2.10...v1.2.37) (2023-07-09)
|
|
6
34
|
|
|
7
35
|
|
|
@@ -11,9 +11,7 @@ require("@inovua/reactdatagrid-enterprise/theme/amber-dark.css");
|
|
|
11
11
|
require("../themes/base_styles.css");
|
|
12
12
|
require("../themes/grid.css");
|
|
13
13
|
var _func_grid = require("../func/func_grid");
|
|
14
|
-
var _controls = require("@azrico/controls");
|
|
15
14
|
var _react = _interopRequireDefault(require("react"));
|
|
16
|
-
var _func_child = require("../func/func_child");
|
|
17
15
|
var _reactdatagridEnterprise = _interopRequireDefault(require("@inovua/reactdatagrid-enterprise"));
|
|
18
16
|
var _clsx = _interopRequireDefault(require("clsx"));
|
|
19
17
|
var _reactUseSize = require("react-use-size");
|
|
@@ -133,18 +131,26 @@ function DataGridEventsWrapper(props) {
|
|
|
133
131
|
click_data.current = {};
|
|
134
132
|
}, [props.dataSource]);
|
|
135
133
|
/* ------------------------------- ContextMenu ------------------------------ */
|
|
136
|
-
const onRowContextMenu =
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
}, []);
|
|
134
|
+
// const onRowContextMenu = React.useCallback((rowProps, event) => {
|
|
135
|
+
// if (!rowProps || !rowProps.data || func_selection.has_selection()) return;
|
|
136
|
+
// const anEl = func_selection.getVirtualElement(event.clientX, event.clientY);
|
|
137
|
+
// update_menuAnchorEl(anEl);
|
|
138
|
+
// }, []);
|
|
141
139
|
const renderRowContextMenu = _react.default.useCallback((menuProps, rowProps) => {
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
}
|
|
140
|
+
menuProps.autoDismiss = true;
|
|
141
|
+
menuProps.items = [{
|
|
142
|
+
label: 'Row ' + rowProps.rowIndex
|
|
143
|
+
}, {
|
|
144
|
+
label: 'Want to visit '
|
|
145
|
+
}];
|
|
146
|
+
// return (
|
|
147
|
+
// <ContextMenu
|
|
148
|
+
// menuAnchorEl={menuAnchorEl}
|
|
149
|
+
// set_menuAnchorEl={update_menuAnchorEl}
|
|
150
|
+
// menuRow={rowProps.data}
|
|
151
|
+
// menu_items={props.contextMenuItems as any}
|
|
152
|
+
// />
|
|
153
|
+
// );
|
|
148
154
|
}, [props.contextMenuItems]);
|
|
149
155
|
const update_menuAnchorEl = _react.default.useCallback(el => {
|
|
150
156
|
set_menuAnchorEl(el || null);
|
|
@@ -154,9 +160,10 @@ function DataGridEventsWrapper(props) {
|
|
|
154
160
|
*/
|
|
155
161
|
const static_gridOptions = _react.default.useMemo(() => {
|
|
156
162
|
const events = {
|
|
157
|
-
onRowClick: onRowClick
|
|
158
|
-
onRowContextMenu: onRowContextMenu
|
|
163
|
+
onRowClick: onRowClick
|
|
164
|
+
//onRowContextMenu: onRowContextMenu,
|
|
159
165
|
};
|
|
166
|
+
|
|
160
167
|
const contextmenuProps = {
|
|
161
168
|
renderRowContextMenu: renderRowContextMenu
|
|
162
169
|
};
|
package/package.json
CHANGED
package/src/views/DataGrid.tsx
CHANGED
|
@@ -288,21 +288,30 @@ function DataGridEventsWrapper(props: DataGridWrapperProps) {
|
|
|
288
288
|
}, [props.dataSource]);
|
|
289
289
|
|
|
290
290
|
/* ------------------------------- ContextMenu ------------------------------ */
|
|
291
|
-
const onRowContextMenu = React.useCallback((rowProps, event) => {
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
}, []);
|
|
291
|
+
// const onRowContextMenu = React.useCallback((rowProps, event) => {
|
|
292
|
+
// if (!rowProps || !rowProps.data || func_selection.has_selection()) return;
|
|
293
|
+
// const anEl = func_selection.getVirtualElement(event.clientX, event.clientY);
|
|
294
|
+
// update_menuAnchorEl(anEl);
|
|
295
|
+
// }, []);
|
|
296
296
|
const renderRowContextMenu = React.useCallback(
|
|
297
297
|
(menuProps, rowProps) => {
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
298
|
+
menuProps.autoDismiss = true;
|
|
299
|
+
menuProps.items = [
|
|
300
|
+
{
|
|
301
|
+
label: 'Row ' + rowProps.rowIndex,
|
|
302
|
+
},
|
|
303
|
+
{
|
|
304
|
+
label: 'Want to visit ',
|
|
305
|
+
},
|
|
306
|
+
];
|
|
307
|
+
// return (
|
|
308
|
+
// <ContextMenu
|
|
309
|
+
// menuAnchorEl={menuAnchorEl}
|
|
310
|
+
// set_menuAnchorEl={update_menuAnchorEl}
|
|
311
|
+
// menuRow={rowProps.data}
|
|
312
|
+
// menu_items={props.contextMenuItems as any}
|
|
313
|
+
// />
|
|
314
|
+
// );
|
|
306
315
|
},
|
|
307
316
|
[props.contextMenuItems]
|
|
308
317
|
);
|
|
@@ -316,7 +325,7 @@ function DataGridEventsWrapper(props: DataGridWrapperProps) {
|
|
|
316
325
|
const static_gridOptions = React.useMemo<AzGridOptions>(() => {
|
|
317
326
|
const events: AzGridOptions = {
|
|
318
327
|
onRowClick: onRowClick,
|
|
319
|
-
onRowContextMenu: onRowContextMenu,
|
|
328
|
+
//onRowContextMenu: onRowContextMenu,
|
|
320
329
|
};
|
|
321
330
|
const contextmenuProps: AzGridOptions = {
|
|
322
331
|
renderRowContextMenu: renderRowContextMenu,
|