@azrico/reactgrid 1.2.40 → 1.2.41

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,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.41](https://github.com/Azrideus/azrico-reactgrid/compare/v1.2.10...v1.2.41) (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.40](https://github.com/Azrideus/azrico-reactgrid/compare/v1.2.10...v1.2.40) (2023-07-09)
6
20
 
7
21
 
@@ -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"));
@@ -137,21 +138,25 @@ function DataGridEventsWrapper(props) {
137
138
  const anEl = _func_child.func_selection.getVirtualElement(event.clientX, event.clientY);
138
139
  update_menuAnchorEl(anEl);
139
140
  }, []);
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
- // );
141
+ const renderRowContextMenu = _react.default.useCallback((menuProps, {
142
+ rowProps
143
+ }) => {
144
+ console.log('cm:', menuProps, rowProps, menuAnchorEl);
145
+ // menuProps.autoDismiss = true;
146
+ // menuProps.items = [
147
+ // {
148
+ // label: 'Row ' + rowProps.rowIndex,
149
+ // },
150
+ // {
151
+ // label: 'Want to visit ',
152
+ // },
153
+ // ];
154
+ return _react.default.createElement(_controls.ContextMenu, {
155
+ menuAnchorEl: menuAnchorEl,
156
+ set_menuAnchorEl: update_menuAnchorEl,
157
+ menuRow: rowProps.data,
158
+ menu_items: props.contextMenuItems
159
+ });
155
160
  }, [props.contextMenuItems]);
156
161
  const update_menuAnchorEl = _react.default.useCallback(el => {
157
162
  set_menuAnchorEl(el || null);
@@ -172,19 +177,15 @@ function DataGridEventsWrapper(props) {
172
177
  ...events,
173
178
  ...contextmenuProps
174
179
  };
175
- }, [props.static_gridOptions, onRowClick]);
180
+ }, [props.static_gridOptions, onRowClick, onRowContextMenu, renderRowContextMenu]);
176
181
  /* -------------------------------------------------------------------------- */
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
- }
182
+ return props.details_dataSource ? _react.default.createElement(DataGridDetailsWrapper, {
183
+ ...props,
184
+ static_gridOptions: static_gridOptions
185
+ }) : _react.default.createElement(DataGridSizeWrapper, {
186
+ ...props,
187
+ static_gridOptions: static_gridOptions
188
+ });
188
189
  }
189
190
  function DataGridDetailsWrapper(props) {
190
191
  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.41",
4
4
  "main": "dist/index.js",
5
5
  "description": "React Datagrid",
6
6
  "author": "Azrideus <MehrdadTavangar@gmail.com>",
@@ -294,24 +294,25 @@ function DataGridEventsWrapper(props: DataGridWrapperProps) {
294
294
  update_menuAnchorEl(anEl);
295
295
  }, []);
296
296
  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
- // );
297
+ (menuProps, { rowProps }) => {
298
+ console.log('cm:', menuProps, rowProps, menuAnchorEl);
299
+ // menuProps.autoDismiss = true;
300
+ // menuProps.items = [
301
+ // {
302
+ // label: 'Row ' + rowProps.rowIndex,
303
+ // },
304
+ // {
305
+ // label: 'Want to visit ',
306
+ // },
307
+ // ];
308
+ return (
309
+ <ContextMenu
310
+ menuAnchorEl={menuAnchorEl}
311
+ set_menuAnchorEl={update_menuAnchorEl}
312
+ menuRow={rowProps.data}
313
+ menu_items={props.contextMenuItems as any}
314
+ />
315
+ );
315
316
  },
316
317
  [props.contextMenuItems]
317
318
  );
@@ -331,25 +332,15 @@ function DataGridEventsWrapper(props: DataGridWrapperProps) {
331
332
  renderRowContextMenu: renderRowContextMenu,
332
333
  };
333
334
  return { ...props.static_gridOptions, ...events, ...contextmenuProps };
334
- }, [props.static_gridOptions, onRowClick]);
335
+ }, [props.static_gridOptions, onRowClick, onRowContextMenu, renderRowContextMenu]);
335
336
 
336
337
  /* -------------------------------------------------------------------------- */
337
338
 
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
- }
339
+ return props.details_dataSource ? (
340
+ <DataGridDetailsWrapper {...props} static_gridOptions={static_gridOptions} />
341
+ ) : (
342
+ <DataGridSizeWrapper {...props} static_gridOptions={static_gridOptions} />
343
+ );
353
344
  }
354
345
 
355
346
  function DataGridDetailsWrapper(props: DataGridWrapperProps) {