@visns-studio/visns-components 1.1.15 → 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-
|
|
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-
|
|
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,34 @@ const DataGrid = (props) => {
|
|
|
739
736
|
}, [columns]);
|
|
740
737
|
|
|
741
738
|
// Data Grid Styling
|
|
742
|
-
const
|
|
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
|
+
}, []);
|
|
743
767
|
|
|
744
768
|
return (
|
|
745
769
|
<>
|
|
@@ -770,7 +794,11 @@ const DataGrid = (props) => {
|
|
|
770
794
|
defaultLimit={limit}
|
|
771
795
|
defaultSortInfo={sortInfo}
|
|
772
796
|
enableColumnAutosize={false}
|
|
773
|
-
|
|
797
|
+
headerProps={headerProps}
|
|
798
|
+
idProperty={`visns-datagrid-${ajaxSetting.url.replace(
|
|
799
|
+
/\//g,
|
|
800
|
+
"-"
|
|
801
|
+
)}`}
|
|
774
802
|
style={gridStyle}
|
|
775
803
|
onRenderRow={onRenderRow}
|
|
776
804
|
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.
|
|
36
|
+
"version": "1.1.16",
|
|
37
37
|
"description": "Various packages to assist in the development of our Custom Applications.",
|
|
38
38
|
"main": "index.js",
|
|
39
39
|
"devDependencies": {},
|