@azrico/reactgrid 1.2.40 → 1.2.42

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.42](https://github.com/Azrideus/azrico-reactgrid/compare/v1.2.10...v1.2.42) (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.41](https://github.com/Azrideus/azrico-reactgrid/compare/v1.2.10...v1.2.41) (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.40](https://github.com/Azrideus/azrico-reactgrid/compare/v1.2.10...v1.2.40) (2023-07-09)
6
34
 
7
35
 
@@ -11,6 +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");
14
15
  var _react = _interopRequireDefault(require("react"));
15
16
  var _func_child = require("../func/func_child");
16
17
  var _reactdatagridEnterprise = _interopRequireDefault(require("@inovua/reactdatagrid-enterprise"));
@@ -135,23 +136,28 @@ function DataGridEventsWrapper(props) {
135
136
  const onRowContextMenu = _react.default.useCallback((rowProps, event) => {
136
137
  if (!rowProps || !rowProps.data || _func_child.func_selection.has_selection()) return;
137
138
  const anEl = _func_child.func_selection.getVirtualElement(event.clientX, event.clientY);
139
+ console.log('onRowContextMenu', anEl);
138
140
  update_menuAnchorEl(anEl);
139
141
  }, []);
140
- const renderRowContextMenu = _react.default.useCallback((menuProps, rowProps) => {
141
- menuProps.autoDismiss = true;
142
- menuProps.items = [{
143
- label: 'Row ' + rowProps.rowIndex
144
- }, {
145
- label: 'Want to visit '
146
- }];
147
- // return (
148
- // <ContextMenu
149
- // menuAnchorEl={menuAnchorEl}
150
- // set_menuAnchorEl={update_menuAnchorEl}
151
- // menuRow={rowProps.data}
152
- // menu_items={props.contextMenuItems as any}
153
- // />
154
- // );
142
+ const renderRowContextMenu = _react.default.useCallback((menuProps, {
143
+ rowProps
144
+ }) => {
145
+ console.log('cm:', menuAnchorEl);
146
+ // menuProps.autoDismiss = true;
147
+ // menuProps.items = [
148
+ // {
149
+ // label: 'Row ' + rowProps.rowIndex,
150
+ // },
151
+ // {
152
+ // label: 'Want to visit ',
153
+ // },
154
+ // ];
155
+ return _react.default.createElement(_controls.ContextMenu, {
156
+ menuAnchorEl: menuAnchorEl,
157
+ set_menuAnchorEl: update_menuAnchorEl,
158
+ menuRow: rowProps.data,
159
+ menu_items: props.contextMenuItems
160
+ });
155
161
  }, [props.contextMenuItems]);
156
162
  const update_menuAnchorEl = _react.default.useCallback(el => {
157
163
  set_menuAnchorEl(el || null);
@@ -172,19 +178,15 @@ function DataGridEventsWrapper(props) {
172
178
  ...events,
173
179
  ...contextmenuProps
174
180
  };
175
- }, [props.static_gridOptions, onRowClick]);
181
+ }, [props.static_gridOptions, onRowClick, onRowContextMenu, renderRowContextMenu]);
176
182
  /* -------------------------------------------------------------------------- */
177
- if (props.details_dataSource) {
178
- return _react.default.createElement(DataGridDetailsWrapper, {
179
- ...props,
180
- static_gridOptions: static_gridOptions
181
- });
182
- } else {
183
- return _react.default.createElement(DataGridSizeWrapper, {
184
- ...props,
185
- static_gridOptions: static_gridOptions
186
- });
187
- }
183
+ return props.details_dataSource ? _react.default.createElement(DataGridDetailsWrapper, {
184
+ ...props,
185
+ static_gridOptions: static_gridOptions
186
+ }) : _react.default.createElement(DataGridSizeWrapper, {
187
+ ...props,
188
+ static_gridOptions: static_gridOptions
189
+ });
188
190
  }
189
191
  function DataGridDetailsWrapper(props) {
190
192
  const cached_details_columns = _react.default.useMemo(() => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@azrico/reactgrid",
3
- "version": "1.2.40",
3
+ "version": "1.2.42",
4
4
  "main": "dist/index.js",
5
5
  "description": "React Datagrid",
6
6
  "author": "Azrideus <MehrdadTavangar@gmail.com>",
@@ -291,27 +291,29 @@ function DataGridEventsWrapper(props: DataGridWrapperProps) {
291
291
  const onRowContextMenu = React.useCallback((rowProps, event) => {
292
292
  if (!rowProps || !rowProps.data || func_selection.has_selection()) return;
293
293
  const anEl = func_selection.getVirtualElement(event.clientX, event.clientY);
294
+ console.log('onRowContextMenu', anEl);
294
295
  update_menuAnchorEl(anEl);
295
296
  }, []);
296
297
  const renderRowContextMenu = React.useCallback(
297
- (menuProps, rowProps) => {
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
- // );
298
+ (menuProps, { rowProps }) => {
299
+ console.log('cm:', menuAnchorEl);
300
+ // menuProps.autoDismiss = true;
301
+ // menuProps.items = [
302
+ // {
303
+ // label: 'Row ' + rowProps.rowIndex,
304
+ // },
305
+ // {
306
+ // label: 'Want to visit ',
307
+ // },
308
+ // ];
309
+ return (
310
+ <ContextMenu
311
+ menuAnchorEl={menuAnchorEl}
312
+ set_menuAnchorEl={update_menuAnchorEl}
313
+ menuRow={rowProps.data}
314
+ menu_items={props.contextMenuItems as any}
315
+ />
316
+ );
315
317
  },
316
318
  [props.contextMenuItems]
317
319
  );
@@ -331,25 +333,15 @@ function DataGridEventsWrapper(props: DataGridWrapperProps) {
331
333
  renderRowContextMenu: renderRowContextMenu,
332
334
  };
333
335
  return { ...props.static_gridOptions, ...events, ...contextmenuProps };
334
- }, [props.static_gridOptions, onRowClick]);
336
+ }, [props.static_gridOptions, onRowClick, onRowContextMenu, renderRowContextMenu]);
335
337
 
336
338
  /* -------------------------------------------------------------------------- */
337
339
 
338
- if (props.details_dataSource) {
339
- return (
340
- <DataGridDetailsWrapper
341
- {...props}
342
- static_gridOptions={static_gridOptions}
343
- ></DataGridDetailsWrapper>
344
- );
345
- } else {
346
- return (
347
- <DataGridSizeWrapper
348
- {...props}
349
- static_gridOptions={static_gridOptions}
350
- ></DataGridSizeWrapper>
351
- );
352
- }
340
+ return props.details_dataSource ? (
341
+ <DataGridDetailsWrapper {...props} static_gridOptions={static_gridOptions} />
342
+ ) : (
343
+ <DataGridSizeWrapper {...props} static_gridOptions={static_gridOptions} />
344
+ );
353
345
  }
354
346
 
355
347
  function DataGridDetailsWrapper(props: DataGridWrapperProps) {