@visns-studio/visns-components 4.9.8 → 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.8",
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": [
@@ -686,7 +686,7 @@ function Form({
686
686
 
687
687
  toast.update(toastId, {
688
688
  render: `${file.name} uploaded successfully!`,
689
- type: toast.TYPE.SUCCESS,
689
+ type: 'success',
690
690
  autoClose: 3000,
691
691
  });
692
692
 
@@ -730,7 +730,7 @@ function Form({
730
730
 
731
731
  toast.update(toastId, {
732
732
  render: `${formData[fileKey].name} uploaded successfully!`,
733
- type: toast.TYPE.SUCCESS,
733
+ type: 'success',
734
734
  autoClose: 3000,
735
735
  });
736
736
 
@@ -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>`)