@visns-studio/visns-components 1.5.8 → 1.5.10

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.
@@ -1199,7 +1199,8 @@ const DataGrid = forwardRef(
1199
1199
 
1200
1200
  if (
1201
1201
  relationValue &&
1202
- Array.isArray(relationValue)
1202
+ Array.isArray(relationValue) &&
1203
+ relationValue.length > 0
1203
1204
  ) {
1204
1205
  const nameProperties = Array.isArray(
1205
1206
  column.nameFrom
@@ -1297,6 +1298,29 @@ const DataGrid = forwardRef(
1297
1298
 
1298
1299
  return <span>{parse(result)}</span>;
1299
1300
  // }
1301
+ } else {
1302
+ let result = "";
1303
+
1304
+ if (
1305
+ column.relation?.id &&
1306
+ column.relation?.key
1307
+ ) {
1308
+ const relationValue =
1309
+ column.relation.key.reduce(
1310
+ (acc, id) =>
1311
+ acc === ""
1312
+ ? data[id]
1313
+ : acc && acc[id]
1314
+ ? acc[id]
1315
+ : "",
1316
+ ""
1317
+ );
1318
+
1319
+ result =
1320
+ relationValue[column.relation.id];
1321
+ }
1322
+
1323
+ return <span>{parse(result)}</span>;
1300
1324
  }
1301
1325
 
1302
1326
  return null;
package/package.json CHANGED
@@ -35,7 +35,7 @@
35
35
  "react-dom": "^17.0.1"
36
36
  },
37
37
  "name": "@visns-studio/visns-components",
38
- "version": "1.5.8",
38
+ "version": "1.5.10",
39
39
  "description": "Various packages to assist in the development of our Custom Applications.",
40
40
  "main": "index.js",
41
41
  "devDependencies": {},