@azrico/reactgrid 1.2.50 → 1.3.0

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.51](https://github.com/Azrideus/azrico-reactgrid/compare/v1.2.10...v1.2.51) (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.50](https://github.com/Azrideus/azrico-reactgrid/compare/v1.2.10...v1.2.50) (2023-07-09)
6
20
 
7
21
 
@@ -307,7 +307,6 @@ function find_realIndex(view) {
307
307
  function find_realData(alldata, view, def = undefined) {
308
308
  if (!Array.isArray(alldata)) return def;
309
309
  const rid = find_realIndex(view);
310
- console.log('rid:', rid);
311
310
  if (rid === -1) return def;
312
311
  // console.log('dataSource', alldata);
313
312
  return alldata.find(s => get_row_id(s) === rid);
@@ -52,7 +52,6 @@ function AzGrid(props) {
52
52
  /* -------------------------------------------------------------------------- */
53
53
  const cached_data = _react.default.useRef();
54
54
  const last_cache_info = _react.default.useRef();
55
- const rawDataSource = props.dataSource;
56
55
  const dataSource = _react.default.useCallback(async dt => {
57
56
  return await (0, _func_grid.ApplyDataSource)(props.dataSource, {
58
57
  skip: dt.skip,
@@ -105,7 +104,6 @@ function AzGrid(props) {
105
104
  dynamic_gridOptions: dynamic_gridOptions,
106
105
  columns: cached_columns,
107
106
  dataSource: dataSource,
108
- rawDataSource: rawDataSource,
109
107
  highlightedRow: props.highlightedRow
110
108
  });
111
109
  }
@@ -140,7 +138,7 @@ function DataGridEventsWrapper(props) {
140
138
  /* ------------------------------- ContextMenu ------------------------------ */
141
139
  const onRowContextMenu = _react.default.useCallback((rowProps, event) => {
142
140
  if (!rowProps || !rowProps.data || _func_child.func_selection.has_selection()) return;
143
- const realRow = (0, _func_grid.find_realData)(props.rawDataSource, event.target, rowProps.data);
141
+ const realRow = (0, _func_grid.find_realData)(rowProps.dataSourceArray, event.target, rowProps.data);
144
142
  const anEl = _func_child.func_selection.getVirtualElement(event.clientX, event.clientY);
145
143
  update_menuRow(realRow, anEl);
146
144
  }, []);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@azrico/reactgrid",
3
- "version": "1.2.50",
3
+ "version": "1.3.0",
4
4
  "main": "dist/index.js",
5
5
  "description": "React Datagrid",
6
6
  "author": "Azrideus <MehrdadTavangar@gmail.com>",
@@ -317,7 +317,6 @@ function find_realIndex(view) {
317
317
  export function find_realData(alldata: any[], view, def = undefined) {
318
318
  if (!Array.isArray(alldata)) return def;
319
319
  const rid = find_realIndex(view);
320
- console.log('rid:', rid);
321
320
  if (rid === -1) return def;
322
321
  // console.log('dataSource', alldata);
323
322
  return alldata.find((s) => get_row_id(s) === rid);
@@ -181,7 +181,6 @@ export function AzGrid(props: AzGridProps) {
181
181
  const cached_data = React.useRef<any>();
182
182
  const last_cache_info = React.useRef<any>();
183
183
 
184
- const rawDataSource = props.dataSource;
185
184
  const dataSource = React.useCallback(
186
185
  async (dt) => {
187
186
  return await ApplyDataSource(props.dataSource, {
@@ -244,7 +243,6 @@ export function AzGrid(props: AzGridProps) {
244
243
  dynamic_gridOptions={dynamic_gridOptions}
245
244
  columns={cached_columns}
246
245
  dataSource={dataSource}
247
- rawDataSource={rawDataSource}
248
246
  highlightedRow={props.highlightedRow}
249
247
  />
250
248
  );
@@ -256,7 +254,7 @@ export function AzGrid(props: AzGridProps) {
256
254
  * @param props
257
255
  * @returns
258
256
  */
259
- function DataGridEventsWrapper(props: DataGridWrapperProps & { rawDataSource: any }) {
257
+ function DataGridEventsWrapper(props: DataGridWrapperProps) {
260
258
  /* -------------------------------------------------------------------------- */
261
259
 
262
260
  const click_data = React.useRef<any>(null);
@@ -294,7 +292,7 @@ function DataGridEventsWrapper(props: DataGridWrapperProps & { rawDataSource: an
294
292
  /* ------------------------------- ContextMenu ------------------------------ */
295
293
  const onRowContextMenu = React.useCallback((rowProps, event) => {
296
294
  if (!rowProps || !rowProps.data || func_selection.has_selection()) return;
297
- const realRow = find_realData(props.rawDataSource, event.target, rowProps.data);
295
+ const realRow = find_realData(rowProps.dataSourceArray, event.target, rowProps.data);
298
296
  const anEl = func_selection.getVirtualElement(event.clientX, event.clientY);
299
297
  update_menuRow(realRow, anEl);
300
298
  }, []);