@visns-studio/visns-components 1.2.6 → 1.2.8
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.
|
@@ -35,9 +35,8 @@ const loadData = async (
|
|
|
35
35
|
ajaxSetting
|
|
36
36
|
) => {
|
|
37
37
|
const url = ajaxSetting.url;
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
let params = { page, sortInfo, take: limit, search: search };
|
|
38
|
+
const page = Math.floor(skip / limit) + 1;
|
|
39
|
+
const params = { page, sortInfo, take: limit, search: search, where: [] };
|
|
41
40
|
|
|
42
41
|
if (sortInfo) {
|
|
43
42
|
params.sortBy = sortInfo.name;
|
|
@@ -48,6 +47,18 @@ const loadData = async (
|
|
|
48
47
|
params.where = ajaxSetting.where;
|
|
49
48
|
}
|
|
50
49
|
|
|
50
|
+
if (filterValue) {
|
|
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
|
+
}
|
|
61
|
+
|
|
51
62
|
try {
|
|
52
63
|
const response = await axios.post(url, params);
|
|
53
64
|
const { data, total } = response.data;
|
|
@@ -835,6 +846,7 @@ const DataGrid = (props) => {
|
|
|
835
846
|
: column.id;
|
|
836
847
|
|
|
837
848
|
return {
|
|
849
|
+
key: column.filter.key ? column.filter.key : null,
|
|
838
850
|
name: filterName,
|
|
839
851
|
operator: column.filter.operator,
|
|
840
852
|
type: column.filter.type,
|
|
@@ -884,7 +896,8 @@ const DataGrid = (props) => {
|
|
|
884
896
|
// Data Grid Styling
|
|
885
897
|
const [windowHeight, setWindowHeight] = useState(window.innerHeight);
|
|
886
898
|
const gridStyle = {
|
|
887
|
-
minHeight: windowHeight * 0.
|
|
899
|
+
minHeight: windowHeight * 0.7 > 550 ? windowHeight * 0.7 : 550,
|
|
900
|
+
boxShadow: "none",
|
|
888
901
|
};
|
|
889
902
|
const headerProps = {
|
|
890
903
|
style: style ? style : {},
|
|
@@ -921,6 +934,7 @@ const DataGrid = (props) => {
|
|
|
921
934
|
"-"
|
|
922
935
|
)}`}
|
|
923
936
|
style={gridStyle}
|
|
937
|
+
onFilterValueChange={setFilterValue}
|
|
924
938
|
onRenderRow={onRenderRow}
|
|
925
939
|
pagination
|
|
926
940
|
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.
|
|
37
|
+
"version": "1.2.8",
|
|
38
38
|
"description": "Various packages to assist in the development of our Custom Applications.",
|
|
39
39
|
"main": "index.js",
|
|
40
40
|
"devDependencies": {},
|