@visns-studio/visns-components 4.9.9 → 4.9.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.
package/package.json CHANGED
@@ -75,7 +75,7 @@
75
75
  "react-dom": "^17.0.0 || ^18.0.0"
76
76
  },
77
77
  "name": "@visns-studio/visns-components",
78
- "version": "4.9.9",
78
+ "version": "4.9.10",
79
79
  "description": "Various packages to assist in the development of our Custom Applications.",
80
80
  "main": "src/index.js",
81
81
  "files": [
@@ -365,6 +365,20 @@ function GenericDetail({
365
365
  );
366
366
  };
367
367
 
368
+ const renderRelation = () => {
369
+ if (options && options.length > 0) {
370
+ if (options[truncatedValue]) {
371
+ return options[truncatedValue];
372
+ } else {
373
+ return options[0];
374
+ }
375
+ } else {
376
+ return size === 'full' && truncatedValue
377
+ ? parse(`<br /><p>${truncatedValue}</p>`)
378
+ : truncatedValue;
379
+ }
380
+ };
381
+
368
382
  // Render based on the item's type
369
383
  switch (type) {
370
384
  case 'boolean':
@@ -393,6 +407,8 @@ function GenericDetail({
393
407
  return renderTotal();
394
408
  case 'password':
395
409
  return renderPassword();
410
+ case 'relation':
411
+ return renderRelation();
396
412
  default:
397
413
  return size === 'full' && truncatedValue
398
414
  ? parse(`<br /><p>${truncatedValue}</p>`)