@visns-studio/visns-components 1.2.6 → 1.2.7

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.
@@ -28,6 +28,7 @@ import "react-confirm-alert/src/react-confirm-alert.css";
28
28
 
29
29
  import CustomFetch from "./visns-fetch";
30
30
  import Form from "./visns-form";
31
+ import { NonceProvider } from "react-select";
31
32
 
32
33
  const loadData = async (
33
34
  { skip, limit, sortInfo, currentData, filterValue, groupBy },
@@ -35,9 +36,8 @@ const loadData = async (
35
36
  ajaxSetting
36
37
  ) => {
37
38
  const url = ajaxSetting.url;
38
-
39
- let page = Math.floor(skip / limit) + 1;
40
- let params = { page, sortInfo, take: limit, search: search };
39
+ const page = Math.floor(skip / limit) + 1;
40
+ const params = { page, sortInfo, take: limit, search: search, where: [] };
41
41
 
42
42
  if (sortInfo) {
43
43
  params.sortBy = sortInfo.name;
@@ -48,6 +48,16 @@ const loadData = async (
48
48
  params.where = ajaxSetting.where;
49
49
  }
50
50
 
51
+ filterValue.forEach((fv) => {
52
+ const identifier = fv.key ? fv.key : fv.name;
53
+
54
+ if (fv.value !== null && fv.value !== "") {
55
+ params.where.push({ id: identifier, value: fv.value });
56
+ } else {
57
+ params.where = params.where.filter((w) => w.id !== identifier);
58
+ }
59
+ });
60
+
51
61
  try {
52
62
  const response = await axios.post(url, params);
53
63
  const { data, total } = response.data;
@@ -835,6 +845,7 @@ const DataGrid = (props) => {
835
845
  : column.id;
836
846
 
837
847
  return {
848
+ key: column.filter.key ? column.filter.key : null,
838
849
  name: filterName,
839
850
  operator: column.filter.operator,
840
851
  type: column.filter.type,
@@ -884,7 +895,8 @@ const DataGrid = (props) => {
884
895
  // Data Grid Styling
885
896
  const [windowHeight, setWindowHeight] = useState(window.innerHeight);
886
897
  const gridStyle = {
887
- minHeight: windowHeight * 0.6 > 550 ? windowHeight * 0.6 : 550,
898
+ minHeight: windowHeight * 0.7 > 550 ? windowHeight * 0.7 : 550,
899
+ boxShadow: "none",
888
900
  };
889
901
  const headerProps = {
890
902
  style: style ? style : {},
@@ -921,6 +933,7 @@ const DataGrid = (props) => {
921
933
  "-"
922
934
  )}`}
923
935
  style={gridStyle}
936
+ onFilterValueChange={setFilterValue}
924
937
  onRenderRow={onRenderRow}
925
938
  pagination
926
939
  renderColumnContextMenu={renderColumnContextMenu}
package/package.json CHANGED
@@ -34,7 +34,7 @@
34
34
  "react-dom": "^17.0.1"
35
35
  },
36
36
  "name": "@visns-studio/visns-components",
37
- "version": "1.2.6",
37
+ "version": "1.2.7",
38
38
  "description": "Various packages to assist in the development of our Custom Applications.",
39
39
  "main": "index.js",
40
40
  "devDependencies": {},