@azrico/reactgrid 1.2.22 → 1.2.25

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,17 @@
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.25](https://github.com/Azrideus/azrico-reactgrid/compare/v1.2.24...v1.2.25) (2023-04-03)
6
+
7
+ ### [1.2.24](https://github.com/Azrideus/azrico-reactgrid/compare/v1.2.23...v1.2.24) (2023-04-03)
8
+
9
+ ### [1.2.23](https://github.com/Azrideus/azrico-reactgrid/compare/v1.2.22...v1.2.23) (2023-04-03)
10
+
11
+
12
+ ### Bug Fixes
13
+
14
+ * styling ([9018f75](https://github.com/Azrideus/azrico-reactgrid/commit/9018f7593e253720f751f52855a2d956dfc578ed))
15
+
5
16
  ### [1.2.22](https://github.com/Azrideus/azrico-reactgrid/compare/v1.2.21...v1.2.22) (2023-04-03)
6
17
 
7
18
  ### [1.2.21](https://github.com/Azrideus/azrico-reactgrid/compare/v1.2.20...v1.2.21) (2023-04-03)
package/dist/src/index.js CHANGED
@@ -47,14 +47,13 @@ Object.keys(_DataGrid).forEach(function (key) {
47
47
  });
48
48
  });
49
49
  var _func_grid = require("./func/func_grid");
50
- var _example = _interopRequireDefault(require("./example"));
51
- var _react = _interopRequireDefault(require("react"));
52
- var _client = _interopRequireDefault(require("react-dom/client"));
53
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
54
50
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
55
51
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
56
52
  /* -------------------------------------------------------------------------- */
57
- var _default = _DataGrid.default;
58
- exports.default = _default;
59
- const root = _client.default.createRoot(document.getElementById('testroot'));
60
- root.render(_react.default.createElement(_example.default, null));
53
+ //
54
+ var _default = _DataGrid.default; // const testroot = document.getElementById('testroot');
55
+ // if (testroot) {
56
+ // // const root = ReactDOM.createRoot(document.getElementById('testroot') as HTMLElement);
57
+ // // root.render(<ExampleGrid />);
58
+ // }
59
+ exports.default = _default;
@@ -25,6 +25,6 @@
25
25
  margin: 0;
26
26
  }
27
27
  .azgrid-delayedresize {
28
- transition-property: 'width,height';
28
+ transition-property: width, height;
29
29
  transition-delay: 200ms;
30
30
  }
@@ -118,7 +118,7 @@ function DataGridEventsWrapper(props) {
118
118
  const [menuRow, set_menuRow] = _react.default.useState(null);
119
119
  /* --------------------------------- events --------------------------------- */
120
120
  const onRowContextMenu = _react.default.useCallback((rowProps, event) => {
121
- if (_func_child.func_selection.has_selection()) return;
121
+ if (!rowProps || !rowProps.data || _func_child.func_selection.has_selection()) return;
122
122
  update_menuRow(rowProps.data);
123
123
  update_menuAnchorEl(_func_child.func_selection.getVirtualElement(event.clientX, event.clientY));
124
124
  event.preventDefault();
@@ -221,17 +221,17 @@ function DataGridDetailsWrapper(props) {
221
221
  }
222
222
  function DataGridSizeWrapper(props) {
223
223
  if (props.delayedSize) {
224
- return _react.default.createElement(DataGridDelayedSize, {
224
+ return _react.default.createElement(DataGridDelayedSizeWrapper, {
225
225
  ...props
226
226
  });
227
227
  } else {
228
- return _react.default.createElement(DataGridFlexSize, {
228
+ return _react.default.createElement(DataGridCore, {
229
229
  ...props
230
230
  });
231
231
  }
232
232
  }
233
233
  /* -------------------------------------------------------------------------- */
234
- function DataGridDelayedSize(props) {
234
+ function DataGridDelayedSizeWrapper(props) {
235
235
  const {
236
236
  ref,
237
237
  height,
@@ -240,20 +240,16 @@ function DataGridDelayedSize(props) {
240
240
  return _react.default.createElement("div", {
241
241
  ref: ref,
242
242
  className: (0, _clsx.default)(props.className, 'azgrid-nooverflow', 'azgrid-filler')
243
- }, _react.default.createElement(_reactdatagridEnterprise.default, {
244
- ...props.static_gridOptions,
245
- ...props.dynamic_gridOptions,
246
- handle: ref => props.gridRef.current = ref ? ref.current : null,
247
- className: 'azgrid-delayedresize',
243
+ }, _react.default.createElement("div", {
248
244
  style: {
249
245
  height: height,
250
246
  width: width
251
- },
252
- columns: props.columns,
253
- dataSource: props.dataSource
254
- }), props.children);
247
+ }
248
+ }, _react.default.createElement(DataGridCore, {
249
+ ...props
250
+ })));
255
251
  }
256
- function DataGridFlexSize(props) {
252
+ function DataGridCore(props) {
257
253
  return _react.default.createElement("div", {
258
254
  className: (0, _clsx.default)(props.className, 'azgrid-nooverflow', 'azgrid-filler')
259
255
  }, _react.default.createElement(_reactdatagridEnterprise.default, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@azrico/reactgrid",
3
- "version": "1.2.22",
3
+ "version": "1.2.25",
4
4
  "main": "dist/index.js",
5
5
  "description": "React Datagrid",
6
6
  "author": "Azrideus <MehrdadTavangar@gmail.com>",
@@ -29,23 +29,23 @@
29
29
  "typescript": "^4.8.4"
30
30
  },
31
31
  "dependencies": {
32
- "@azrico/controls": "1.4.26",
32
+ "@azrico/controls": "1.4.27",
33
33
  "@azrico/object": "^1.3.1",
34
34
  "@emotion/react": "^11.9.3",
35
35
  "@emotion/styled": "^11.9.3",
36
- "@inovua/reactdatagrid-enterprise": "^5.8.1",
36
+ "@inovua/reactdatagrid-enterprise": "^5.8.5",
37
37
  "clsx": "^1.2.1",
38
38
  "react": "^18.2.0",
39
39
  "react-use-size": "^3.0.1"
40
40
  },
41
41
  "peerDependencies": {
42
- "@azrico/controls": "*",
43
- "@emotion/react": "*",
44
- "@emotion/styled": "*",
45
- "@inovua/reactdatagrid-enterprise": "*",
46
- "clsx": "*",
47
- "react": "*",
48
- "react-use-size": "*"
42
+ "@azrico/controls": ">=1.4.27",
43
+ "@emotion/react": ">=11.9.3",
44
+ "@emotion/styled": ">=11.9.3",
45
+ "@inovua/reactdatagrid-enterprise": ">=5.8.5",
46
+ "clsx": ">=1.2.1",
47
+ "react": ">=18.2.0",
48
+ "react-use-size": ">=3.0.1"
49
49
  },
50
50
  "browserslist": {
51
51
  "production": [
package/src/index.tsx CHANGED
@@ -7,8 +7,12 @@ import React from 'react';
7
7
  import ReactDOM from 'react-dom/client';
8
8
 
9
9
  /* -------------------------------------------------------------------------- */
10
-
10
+ //
11
11
  export default AzGrid;
12
12
 
13
- const root = ReactDOM.createRoot(document.getElementById('testroot') as HTMLElement);
14
- root.render(<ExampleGrid />);
13
+ // const testroot = document.getElementById('testroot');
14
+ // if (testroot) {
15
+ // // const root = ReactDOM.createRoot(document.getElementById('testroot') as HTMLElement);
16
+ // // root.render(<ExampleGrid />);
17
+
18
+ // }
@@ -25,6 +25,6 @@
25
25
  margin: 0;
26
26
  }
27
27
  .azgrid-delayedresize {
28
- transition-property: 'width,height';
28
+ transition-property: width, height;
29
29
  transition-delay: 200ms;
30
30
  }
@@ -264,7 +264,7 @@ function DataGridEventsWrapper(props: DataGridWrapperProps) {
264
264
  /* --------------------------------- events --------------------------------- */
265
265
 
266
266
  const onRowContextMenu = React.useCallback((rowProps, event) => {
267
- if (func_selection.has_selection()) return;
267
+ if (!rowProps || !rowProps.data || func_selection.has_selection()) return;
268
268
  update_menuRow(rowProps.data);
269
269
  update_menuAnchorEl(func_selection.getVirtualElement(event.clientX, event.clientY));
270
270
  event.preventDefault();
@@ -393,37 +393,27 @@ function DataGridDetailsWrapper(props: DataGridWrapperProps) {
393
393
 
394
394
  function DataGridSizeWrapper(props: DataGridWrapperProps) {
395
395
  if (props.delayedSize) {
396
- return <DataGridDelayedSize {...props} />;
396
+ return <DataGridDelayedSizeWrapper {...props} />;
397
397
  } else {
398
- return <DataGridFlexSize {...props} />;
398
+ return <DataGridCore {...props} />;
399
399
  }
400
400
  }
401
401
 
402
402
  /* -------------------------------------------------------------------------- */
403
- function DataGridDelayedSize(props: DataGridWrapperProps) {
403
+ function DataGridDelayedSizeWrapper(props: DataGridWrapperProps) {
404
404
  const { ref, height, width } = useComponentSize();
405
405
  return (
406
406
  <div
407
407
  ref={ref}
408
408
  className={clsx(props.className, 'azgrid-nooverflow', 'azgrid-filler')}
409
409
  >
410
- <ReactDataGrid
411
- {...props.static_gridOptions}
412
- {...props.dynamic_gridOptions}
413
- handle={(ref) => (props.gridRef.current = ref ? ref.current : null)}
414
- className={'azgrid-delayedresize'}
415
- style={{
416
- height: height,
417
- width: width,
418
- }}
419
- columns={props.columns}
420
- dataSource={props.dataSource}
421
- />
422
- {props.children}
410
+ <div style={{ height: height, width: width }}>
411
+ <DataGridCore {...props} />
412
+ </div>
423
413
  </div>
424
414
  );
425
415
  }
426
- function DataGridFlexSize(props: DataGridWrapperProps) {
416
+ function DataGridCore(props: DataGridWrapperProps) {
427
417
  return (
428
418
  <div className={clsx(props.className, 'azgrid-nooverflow', 'azgrid-filler')}>
429
419
  <ReactDataGrid