@azrico/reactgrid 1.2.8 → 1.2.12

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,11 +2,9 @@
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.8](https://github.com/Azrideus/azrico-reactgrid/compare/v1.2.7...v1.2.8) (2023-02-26)
5
+ ### [1.2.12](https://github.com/Azrideus/azrico-reactgrid/compare/v1.2.11...v1.2.12) (2023-03-31)
6
6
 
7
- ### [1.2.7](https://github.com/Azrideus/azrico-reactgrid/compare/v1.2.6...v1.2.7) (2023-02-26)
8
-
9
- ### 1.2.6 (2023-02-26)
7
+ ### 1.2.11 (2023-03-31)
10
8
 
11
9
 
12
10
  ### Features
@@ -15,6 +13,7 @@ All notable changes to this project will be documented in this file. See [standa
15
13
  * added inovua grid ([a178208](https://github.com/Azrideus/azrico-reactgrid/commit/a178208975212d16ce9feff359b09a6d8926b54d))
16
14
  * added onLimitChange ([4b16681](https://github.com/Azrideus/azrico-reactgrid/commit/4b1668194776ebec51cdf9af0969132d5883d79a))
17
15
  * added skip and limit values ([87a975c](https://github.com/Azrideus/azrico-reactgrid/commit/87a975cad9803b4d41d770c0758d6b4d09946a53))
16
+ * editable can be a function ([6ea857e](https://github.com/Azrideus/azrico-reactgrid/commit/6ea857e4f403d2a334dc5e74065f6b8033277ca4))
18
17
  * fixed dataSource ([ce5a4fe](https://github.com/Azrideus/azrico-reactgrid/commit/ce5a4fe09809aeddeeb0305d48b5294b1e9654b2))
19
18
 
20
19
 
@@ -27,3 +26,33 @@ All notable changes to this project will be documented in this file. See [standa
27
26
  * fixed package for publish ([95b8f46](https://github.com/Azrideus/azrico-reactgrid/commit/95b8f46e672174928aa4d8cd6c4924553eb025e5))
28
27
  * no null rows ([e85511b](https://github.com/Azrideus/azrico-reactgrid/commit/e85511beb98c884a3820dfae7c2c57891910b6d1))
29
28
  * removed extra styles from maincode ([7ee097e](https://github.com/Azrideus/azrico-reactgrid/commit/7ee097e4b7db1209490ce29bdb25fc605dfa7db3))
29
+
30
+ ### [1.2.10](https://github.com/Azrideus/azrico-reactgrid/compare/v1.2.9...v1.2.10) (2023-03-05)
31
+
32
+ ### [1.2.9](https://github.com/Azrideus/azrico-reactgrid/compare/v1.2.8...v1.2.9) (2023-02-26)
33
+
34
+ ### [1.2.8](https://github.com/Azrideus/azrico-reactgrid/compare/v1.2.7...v1.2.8) (2023-02-26)
35
+
36
+ ### [1.2.7](https://github.com/Azrideus/azrico-reactgrid/compare/v1.2.6...v1.2.7) (2023-02-26)
37
+
38
+ ### 1.2.6 (2023-02-26)
39
+
40
+
41
+ ### Features
42
+
43
+ * added datasource Support ([4270ac1](https://github.com/Azrideus/azrico-reactgrid/commit/4270ac19623ef4c7404f0475825647c63ca98ffb))
44
+ * added inovua grid ([a178208](https://github.com/Azrideus/azrico-reactgrid/commit/a178208975212d16ce9feff359b09a6d8926b54d))
45
+ * added onLimitChange ([4b16681](https://github.com/Azrideus/azrico-reactgrid/commit/4b1668194776ebec51cdf9af0969132d5883d79a))
46
+ * added skip and limit values ([87a975c](https://github.com/Azrideus/azrico-reactgrid/commit/87a975cad9803b4d41d770c0758d6b4d09946a53))
47
+ * fixed dataSource ([ce5a4fe](https://github.com/Azrideus/azrico-reactgrid/commit/ce5a4fe09809aeddeeb0305d48b5294b1e9654b2))
48
+
49
+
50
+ ### Bug Fixes
51
+
52
+ * added get_col_name ([c7ff2da](https://github.com/Azrideus/azrico-reactgrid/commit/c7ff2daab8bf2ddf3c5fcbe6b47c7876d9ed9f88))
53
+ * added support for promise DS ([b684c26](https://github.com/Azrideus/azrico-reactgrid/commit/b684c2635d59f5d5dde129ed6425ce30abbeebed))
54
+ * coyp styles to dist ([23694f2](https://github.com/Azrideus/azrico-reactgrid/commit/23694f23634eb0b4038f399b1b2cd5c57992b64b))
55
+ * fixed fix_parent_child_relations ([f165179](https://github.com/Azrideus/azrico-reactgrid/commit/f1651797e2adfc2dfbe1905b8c858b150c842dfa))
56
+ * fixed package for publish ([95b8f46](https://github.com/Azrideus/azrico-reactgrid/commit/95b8f46e672174928aa4d8cd6c4924553eb025e5))
57
+ * no null rows ([e85511b](https://github.com/Azrideus/azrico-reactgrid/commit/e85511beb98c884a3820dfae7c2c57891910b6d1))
58
+ * removed extra styles from maincode ([7ee097e](https://github.com/Azrideus/azrico-reactgrid/commit/7ee097e4b7db1209490ce29bdb25fc605dfa7db3))
@@ -56,27 +56,19 @@ function getData(delta, max = 200) {
56
56
  currentObject[key] = delta[index][key];
57
57
  }
58
58
  }
59
+ const childrows = [];
60
+ if (index % 5 == 0) {
61
+ const sub_selfid = 's' + index;
62
+ childrows.push({
63
+ __table_id: sub_selfid,
64
+ __parent__table_id: String(index),
65
+ name: 'sub-' + index,
66
+ age: 20
67
+ });
68
+ }
69
+ currentObject['__children'] = childrows;
59
70
  fd.push(currentObject);
60
- //if (index % 5 == 0) {
61
- // const sub_selfid = 's' + index;
62
- // fd.push({
63
- // __table_id: sub_selfid,
64
- // __parent__table_id: String(index),
65
- // name: 'sub-' + index,
66
- // age: 20,
67
- // });
68
- // if (index % 2 == 0) {
69
- // const sub2_selfid = 'ss' + index;
70
- // fd.push({
71
- // __table_id: sub2_selfid,
72
- // __parent__table_id: sub_selfid,
73
- // name: 'sub2-' + index,
74
- // age: 20,
75
- // });
76
- // }
77
- //}
78
71
  }
79
-
80
72
  return fd;
81
73
  }
82
74
  function ExampleGrid() {
@@ -141,7 +133,7 @@ function ExampleGrid() {
141
133
  details_columns: columns,
142
134
  onRowClick: onRowClick,
143
135
  onRowDoubleClick: onRowDoubleClick,
144
- // allowChildRows
136
+ allowChildRows: true,
145
137
  // onSelectionChange={onSelectionChange}
146
138
  // selected={selected}
147
139
  contextMenuItems: contextMenuItems,
@@ -14,6 +14,7 @@ exports.validateCache = validateCache;
14
14
  var _BoolEditor = _interopRequireDefault(require("@inovua/reactdatagrid-community/BoolEditor"));
15
15
  var _NumericEditor = _interopRequireDefault(require("@inovua/reactdatagrid-community/NumericEditor"));
16
16
  var _SelectEditor = _interopRequireDefault(require("@inovua/reactdatagrid-community/SelectEditor"));
17
+ var _func_child = require("./func_child");
17
18
  var _object = require("@azrico/object");
18
19
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
19
20
  const defaultColumnOptions = {
@@ -54,7 +55,7 @@ async function ApplyDataSource(datasource, props) {
54
55
  if (!Array.isArray(result_data.data)) result_data.data = [result_data.data];
55
56
  //no need to fix parent/child when using cache (it should be already fixed)
56
57
  if (!isUsingCache && props.allowChildRows) {
57
- //result_data.data = fix_parent_child_relations(result_data.data);
58
+ result_data.data = (0, _func_child.fix_parent_child_relations)(result_data.data);
58
59
  }
59
60
  if (!result_data.count) {
60
61
  result_data.count = result_data.data.length;
@@ -61,9 +61,9 @@ export type AzGridProps = {
61
61
  onSkipChange?: (v: number) => void;
62
62
  skip?: number;
63
63
  limit?: number;
64
+ editable?: boolean | ((editValue: any, cellProps: any) => boolean);
64
65
  loading?: boolean;
65
66
  dark?: boolean;
66
- editable?: boolean;
67
67
  delayedSize?: boolean;
68
68
  allowChildRows?: boolean;
69
69
  looseCacheCheck?: boolean;
@@ -28,9 +28,7 @@ const defaultOptions = {
28
28
  resizable: true,
29
29
  columnUserSelect: true,
30
30
  rowIndexColumn: true,
31
- rowHeight: 35,
32
- maxRowHeight: 40,
33
- minRowHeight: 30
31
+ rowHeight: 35
34
32
  };
35
33
  const forcedOptions = {
36
34
  idProperty: '__table_id',
@@ -168,7 +166,7 @@ function DataGridEventsWrapper(props) {
168
166
  menuAnchorEl: menuAnchorEl,
169
167
  set_menuAnchorEl: update_menuAnchorEl,
170
168
  menuRow: menuRow,
171
- menu_items: props.contextMenuItems
169
+ items: props.contextMenuItems
172
170
  });
173
171
  if (props.details_dataSource) {
174
172
  return _react.default.createElement(DataGridDetailsWrapper, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@azrico/reactgrid",
3
- "version": "1.2.8",
3
+ "version": "1.2.12",
4
4
  "main": "dist/index.js",
5
5
  "description": "React Datagrid",
6
6
  "author": "Azrideus <MehrdadTavangar@gmail.com>",
@@ -1,9 +1,9 @@
1
- {
2
- "short_name": "AzGrid",
3
- "name": "React Grid Wrapper",
4
- "icons": [],
5
- "start_url": "./index.html",
6
- "display": "standalone",
7
- "theme_color": "#000000",
8
- "background_color": "#ffffff"
9
- }
1
+ {
2
+ "short_name": "AzGrid",
3
+ "name": "React Grid Wrapper",
4
+ "icons": [],
5
+ "start_url": "./index.html",
6
+ "display": "standalone",
7
+ "theme_color": "#000000",
8
+ "background_color": "#ffffff"
9
+ }
package/src/example.tsx CHANGED
@@ -45,25 +45,19 @@ function getData(delta: any, max = 200) {
45
45
  }
46
46
  }
47
47
 
48
+ const childrows: any[] = [];
49
+ if (index % 5 == 0) {
50
+ const sub_selfid = 's' + index;
51
+ childrows.push({
52
+ __table_id: sub_selfid,
53
+ __parent__table_id: String(index),
54
+ name: 'sub-' + index,
55
+ age: 20,
56
+ });
57
+ }
58
+
59
+ currentObject['__children'] = childrows;
48
60
  fd.push(currentObject);
49
- //if (index % 5 == 0) {
50
- // const sub_selfid = 's' + index;
51
- // fd.push({
52
- // __table_id: sub_selfid,
53
- // __parent__table_id: String(index),
54
- // name: 'sub-' + index,
55
- // age: 20,
56
- // });
57
- // if (index % 2 == 0) {
58
- // const sub2_selfid = 'ss' + index;
59
- // fd.push({
60
- // __table_id: sub2_selfid,
61
- // __parent__table_id: sub_selfid,
62
- // name: 'sub2-' + index,
63
- // age: 20,
64
- // });
65
- // }
66
- //}
67
61
  }
68
62
  return fd;
69
63
  }
@@ -131,7 +125,7 @@ export function ExampleGrid() {
131
125
  details_columns={columns}
132
126
  onRowClick={onRowClick}
133
127
  onRowDoubleClick={onRowDoubleClick}
134
- // allowChildRows
128
+ allowChildRows
135
129
  // onSelectionChange={onSelectionChange}
136
130
  // selected={selected}
137
131
  contextMenuItems={contextMenuItems}