@noraent/nora-datagrid 0.0.37 → 0.0.39

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.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@noraent/nora-datagrid",
3
- "version": "0.0.37",
3
+ "version": "0.0.39",
4
4
  "module": "./lib/esm/index.js",
5
5
  "main": "./lib/cjs/index.js",
6
6
  "private": false,
@@ -2,7 +2,9 @@ import React from "react";
2
2
  import { useGridApiMethod } from "../useGridApiMethod";
3
3
  import { classes } from "../../types/classes";
4
4
  import { defaultProps } from "../../common/constants";
5
+ import { useStore } from "../../provider/GridStoreContent";
5
6
  export default function usePublicTest(apiRef) {
7
+ const store = useStore();
6
8
  const getData = React.useCallback(() => {
7
9
  return apiRef.current.store.state.dataSource;
8
10
  }, []);
@@ -23,6 +25,7 @@ export default function usePublicTest(apiRef) {
23
25
  }, []);
24
26
  const setRowHeight = React.useCallback((rowIndex, height = defaultProps.height) => {
25
27
  apiRef.current.store.state.dataSource[rowIndex] = Object.assign(Object.assign({}, apiRef.current.store.state.dataSource[rowIndex]), { height: height });
28
+ store.setState(["state", "dataSource"], apiRef.current.store.state.dataSource);
26
29
  }, []);
27
30
  const apiMethods = { addCellRange, getData, scrollToRowIndex, setRowHeight };
28
31
  useGridApiMethod(apiRef, apiMethods, "public");
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@noraent/nora-datagrid",
3
- "version": "0.0.37",
3
+ "version": "0.0.39",
4
4
  "module": "./lib/esm/index.js",
5
5
  "main": "./lib/cjs/index.js",
6
6
  "private": false,
@@ -2,7 +2,9 @@ import React from "react";
2
2
  import { useGridApiMethod } from "../useGridApiMethod";
3
3
  import { classes } from "../../types/classes";
4
4
  import { defaultProps } from "../../common/constants";
5
+ import { useStore } from "../../provider/GridStoreContent";
5
6
  export default function usePublicTest(apiRef) {
7
+ const store = useStore();
6
8
  const getData = React.useCallback(() => {
7
9
  return apiRef.current.store.state.dataSource;
8
10
  }, []);
@@ -23,6 +25,7 @@ export default function usePublicTest(apiRef) {
23
25
  }, []);
24
26
  const setRowHeight = React.useCallback((rowIndex, height = defaultProps.height) => {
25
27
  apiRef.current.store.state.dataSource[rowIndex] = Object.assign(Object.assign({}, apiRef.current.store.state.dataSource[rowIndex]), { height: height });
28
+ store.setState(["state", "dataSource"], apiRef.current.store.state.dataSource);
26
29
  }, []);
27
30
  const apiMethods = { addCellRange, getData, scrollToRowIndex, setRowHeight };
28
31
  useGridApiMethod(apiRef, apiMethods, "public");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@noraent/nora-datagrid",
3
- "version": "0.0.37",
3
+ "version": "0.0.39",
4
4
  "module": "./lib/esm/index.js",
5
5
  "main": "./lib/cjs/index.js",
6
6
  "private": false,