@visns-studio/visns-components 1.1.14 → 1.1.16

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,8 +19,7 @@ import {
19
19
  Search,
20
20
  } from "akar-icons";
21
21
 
22
- import "@inovua/reactdatagrid-enterprise/base.css";
23
- import "@inovua/reactdatagrid-enterprise/theme/default-light.css";
22
+ import "@inovua/reactdatagrid-community/index.css";
24
23
  import "react-confirm-alert/src/react-confirm-alert.css";
25
24
 
26
25
  import CustomFetch from "./visns-fetch";
@@ -258,9 +257,6 @@ const DataGrid = (props) => {
258
257
  onClick(event);
259
258
  }
260
259
  };
261
-
262
- // add a CSS class to rowProps
263
- rowProps.className = "vs-datagrid--row";
264
260
  }, []);
265
261
 
266
262
  /** Table Hooks */
@@ -740,7 +736,34 @@ const DataGrid = (props) => {
740
736
  }, [columns]);
741
737
 
742
738
  // Data Grid Styling
743
- 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.VITE_VISNS_COMPONENT_HEADER_STYLE_COLOR
746
+ ? import.meta.env.VITE_VISNS_COMPONENT_HEADER_STYLE_COLOR
747
+ : null,
748
+ background: import.meta.env
749
+ .VITE_VISNS_COMPONENT_HEADER_STYLE_BACKGROUND
750
+ ? import.meta.env.VITE_VISNS_COMPONENT_HEADER_STYLE_BACKGROUND
751
+ : null,
752
+ },
753
+ };
754
+
755
+ useEffect(() => {
756
+ const handleResize = () => {
757
+ setWindowHeight(window.innerHeight);
758
+ };
759
+
760
+ window.addEventListener("resize", handleResize);
761
+
762
+ // Clean up the event listener
763
+ return () => {
764
+ window.removeEventListener("resize", handleResize);
765
+ };
766
+ }, []);
744
767
 
745
768
  return (
746
769
  <>
@@ -771,7 +794,11 @@ const DataGrid = (props) => {
771
794
  defaultLimit={limit}
772
795
  defaultSortInfo={sortInfo}
773
796
  enableColumnAutosize={false}
774
- idProperty="uniqueId"
797
+ headerProps={headerProps}
798
+ idProperty={`visns-datagrid-${ajaxSetting.url.replace(
799
+ /\//g,
800
+ "-"
801
+ )}`}
775
802
  style={gridStyle}
776
803
  onRenderRow={onRenderRow}
777
804
  pagination
package/package.json CHANGED
@@ -1,6 +1,7 @@
1
1
  {
2
2
  "dependencies": {
3
3
  "@inovua/reactdatagrid-community": "^5.9.4",
4
+ "@inovua/reactdatagrid-enterprise": "^5.9.4",
4
5
  "akar-icons": "^1.9.28",
5
6
  "awesome-debounce-promise": "^2.1.0",
6
7
  "axios": "^1.4.0",
@@ -32,7 +33,7 @@
32
33
  "react-dom": ">=18.2.0"
33
34
  },
34
35
  "name": "@visns-studio/visns-components",
35
- "version": "1.1.14",
36
+ "version": "1.1.16",
36
37
  "description": "Various packages to assist in the development of our Custom Applications.",
37
38
  "main": "index.js",
38
39
  "devDependencies": {},