@visns-studio/visns-components 1.1.15 → 1.1.17

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.
@@ -5,7 +5,7 @@ import debounce from "lodash.debounce";
5
5
  import moment from "moment";
6
6
  import numeral from "numeral";
7
7
  import Popup from "reactjs-popup";
8
- import ReactDataGrid from "@inovua/reactdatagrid-enterprise";
8
+ import ReactDataGrid from "@inovua/reactdatagrid-community";
9
9
  import { confirmAlert } from "react-confirm-alert";
10
10
  import { toast } from "react-toastify";
11
11
  import {
@@ -19,7 +19,7 @@ import {
19
19
  Search,
20
20
  } from "akar-icons";
21
21
 
22
- import "@inovua/reactdatagrid-enterprise/index.css";
22
+ import "@inovua/reactdatagrid-community/index.css";
23
23
  import "react-confirm-alert/src/react-confirm-alert.css";
24
24
 
25
25
  import CustomFetch from "./visns-fetch";
@@ -257,9 +257,6 @@ const DataGrid = (props) => {
257
257
  onClick(event);
258
258
  }
259
259
  };
260
-
261
- // add a CSS class to rowProps
262
- rowProps.className = "vs-datagrid--row";
263
260
  }, []);
264
261
 
265
262
  /** Table Hooks */
@@ -739,7 +736,35 @@ const DataGrid = (props) => {
739
736
  }, [columns]);
740
737
 
741
738
  // Data Grid Styling
742
- const gridStyle = { minHeight: gridHeight };
739
+ const [windowHeight, setWindowHeight] = useState(window.innerHeight);
740
+ const gridStyle = {
741
+ minHeight: windowHeight * 0.6 > 550 ? windowHeight * 0.6 : 550,
742
+ };
743
+ const headerProps = {
744
+ style: {
745
+ color: import.meta.env.REACT_APP_VISNS_COMPONENT_HEADER_STYLE_COLOR
746
+ ? import.meta.env.REACT_APP_VISNS_COMPONENT_HEADER_STYLE_COLOR
747
+ : null,
748
+ background: import.meta.env
749
+ .REACT_APP_VISNS_COMPONENT_HEADER_STYLE_BACKGROUND
750
+ ? import.meta.env
751
+ .REACT_APP_VISNS_COMPONENT_HEADER_STYLE_BACKGROUND
752
+ : null,
753
+ },
754
+ };
755
+
756
+ useEffect(() => {
757
+ const handleResize = () => {
758
+ setWindowHeight(window.innerHeight);
759
+ };
760
+
761
+ window.addEventListener("resize", handleResize);
762
+
763
+ // Clean up the event listener
764
+ return () => {
765
+ window.removeEventListener("resize", handleResize);
766
+ };
767
+ }, []);
743
768
 
744
769
  return (
745
770
  <>
@@ -770,7 +795,11 @@ const DataGrid = (props) => {
770
795
  defaultLimit={limit}
771
796
  defaultSortInfo={sortInfo}
772
797
  enableColumnAutosize={false}
773
- idProperty="uniqueId"
798
+ headerProps={headerProps}
799
+ idProperty={`visns-datagrid-${ajaxSetting.url.replace(
800
+ /\//g,
801
+ "-"
802
+ )}`}
774
803
  style={gridStyle}
775
804
  onRenderRow={onRenderRow}
776
805
  pagination
package/package.json CHANGED
@@ -33,7 +33,7 @@
33
33
  "react-dom": ">=18.2.0"
34
34
  },
35
35
  "name": "@visns-studio/visns-components",
36
- "version": "1.1.15",
36
+ "version": "1.1.17",
37
37
  "description": "Various packages to assist in the development of our Custom Applications.",
38
38
  "main": "index.js",
39
39
  "devDependencies": {},