@visns-studio/visns-components 1.1.4 → 1.1.6

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.
@@ -360,10 +360,22 @@ const DataGrid = (props) => {
360
360
  header: column.label,
361
361
  defaultFlex: 1,
362
362
  link: column.link ? column.link : {},
363
+ defaultWidth:
364
+ column.width && column.width > 0
365
+ ? column.width
366
+ : undefined,
363
367
  render: ({ data }) => {
364
- let value = data.audits[0].user.name;
368
+ if (
369
+ data.audits[0] &&
370
+ data.audits[0].user &&
371
+ data.audits[0].user.name
372
+ ) {
373
+ let value = data.audits[0].user.name;
365
374
 
366
- return <span>{value}</span>;
375
+ return <span>{value}</span>;
376
+ } else {
377
+ return null;
378
+ }
367
379
  },
368
380
  };
369
381
  case "currency":
@@ -371,6 +383,10 @@ const DataGrid = (props) => {
371
383
  name: column.id,
372
384
  header: column.label,
373
385
  defaultFlex: 1,
386
+ defaultWidth:
387
+ column.width && column.width > 0
388
+ ? column.width
389
+ : undefined,
374
390
  link: column.link ? column.link : {},
375
391
  render: ({ data }) => {
376
392
  if (data) {
@@ -386,6 +402,10 @@ const DataGrid = (props) => {
386
402
  name: column.id,
387
403
  header: column.label,
388
404
  defaultFlex: 1,
405
+ defaultWidth:
406
+ column.width && column.width > 0
407
+ ? column.width
408
+ : undefined,
389
409
  link: column.link ? column.link : {},
390
410
  render: ({ data }) => {
391
411
  if (data && data[column.id]) {
@@ -401,6 +421,10 @@ const DataGrid = (props) => {
401
421
  name: column.id,
402
422
  header: column.label,
403
423
  defaultFlex: 1,
424
+ defaultWidth:
425
+ column.width && column.width > 0
426
+ ? column.width
427
+ : undefined,
404
428
  link: column.link ? column.link : {},
405
429
  render: ({ data }) => {
406
430
  if (data && data[column.id]) {
@@ -418,6 +442,10 @@ const DataGrid = (props) => {
418
442
  name: column.id,
419
443
  header: column.label,
420
444
  defaultFlex: 1,
445
+ defaultWidth:
446
+ column.width && column.width > 0
447
+ ? column.width
448
+ : undefined,
421
449
  link: column.link ? column.link : {},
422
450
  render: ({ data }) => {
423
451
  if (data) {
@@ -442,6 +470,10 @@ const DataGrid = (props) => {
442
470
  name: column.id,
443
471
  header: column.label,
444
472
  defaultFlex: 1,
473
+ defaultWidth:
474
+ column.width && column.width > 0
475
+ ? column.width
476
+ : undefined,
445
477
  link: column.link ? column.link : {},
446
478
  render: ({ data }) => {
447
479
  let icons = [];
@@ -467,6 +499,10 @@ const DataGrid = (props) => {
467
499
  name: column.id,
468
500
  header: column.label,
469
501
  defaultFlex: 1,
502
+ defaultWidth:
503
+ column.width && column.width > 0
504
+ ? column.width
505
+ : undefined,
470
506
  link: column.link ? column.link : {},
471
507
  render: ({ data }) => {
472
508
  if (
@@ -487,6 +523,10 @@ const DataGrid = (props) => {
487
523
  name: column.id,
488
524
  header: column.label,
489
525
  defaultFlex: 1,
526
+ defaultWidth:
527
+ column.width && column.width > 0
528
+ ? column.width
529
+ : undefined,
490
530
  link: column.link ? column.link : {},
491
531
  type: "number",
492
532
  };
@@ -495,6 +535,10 @@ const DataGrid = (props) => {
495
535
  name: column.id,
496
536
  header: column.label,
497
537
  defaultFlex: 1,
538
+ defaultWidth:
539
+ column.width && column.width > 0
540
+ ? column.width
541
+ : undefined,
498
542
  link: column.link ? column.link : {},
499
543
  render: ({ data }) => {
500
544
  if (data) {
@@ -508,6 +552,10 @@ const DataGrid = (props) => {
508
552
  name: column.id,
509
553
  header: column.label,
510
554
  defaultFlex: 1,
555
+ defaultWidth:
556
+ column.width && column.width > 0
557
+ ? column.width
558
+ : undefined,
511
559
  link: column.link ? column.link : {},
512
560
  render: ({ data }) => {
513
561
  return <span>{column.placeholder}</span>;
@@ -524,6 +572,10 @@ const DataGrid = (props) => {
524
572
  name: relationName,
525
573
  header: column.label,
526
574
  defaultFlex: 1,
575
+ defaultWidth:
576
+ column.width && column.width > 0
577
+ ? column.width
578
+ : undefined,
527
579
  link: column.link ? column.link : {},
528
580
  render: ({ data }) => {
529
581
  let value = column.id.reduce((acc, id) => {
@@ -552,6 +604,10 @@ const DataGrid = (props) => {
552
604
  name: column.id,
553
605
  header: column.label,
554
606
  defaultFlex: 1,
607
+ defaultWidth:
608
+ column.width && column.width > 0
609
+ ? column.width
610
+ : undefined,
555
611
  link: column.link ? column.link : {},
556
612
  render: ({ data }) => {
557
613
  let stage = "";
@@ -570,6 +626,10 @@ const DataGrid = (props) => {
570
626
  name: column.id,
571
627
  header: column.label,
572
628
  defaultFlex: 1,
629
+ defaultWidth:
630
+ column.width && column.width > 0
631
+ ? column.width
632
+ : undefined,
573
633
  link: column.link ? column.link : {},
574
634
  render: ({ data }) => {
575
635
  if (data && data[column.id]) {
@@ -585,6 +645,10 @@ const DataGrid = (props) => {
585
645
  name: column.id,
586
646
  header: column.label,
587
647
  defaultFlex: 1,
648
+ defaultWidth:
649
+ column.width && column.width > 0
650
+ ? column.width
651
+ : undefined,
588
652
  link: column.link ? column.link : {},
589
653
  render: ({ data }) => {
590
654
  return (
@@ -601,6 +665,10 @@ const DataGrid = (props) => {
601
665
  name: column.id,
602
666
  header: column.label,
603
667
  defaultFlex: 1,
668
+ defaultWidth:
669
+ column.width && column.width > 0
670
+ ? column.width
671
+ : undefined,
604
672
  link: column.link ? column.link : {},
605
673
  };
606
674
  }
package/package.json CHANGED
@@ -32,7 +32,7 @@
32
32
  "react-dom": ">=18.2.0"
33
33
  },
34
34
  "name": "@visns-studio/visns-components",
35
- "version": "1.1.4",
35
+ "version": "1.1.6",
36
36
  "description": "Various packages to assist in the development of our Custom Applications.",
37
37
  "main": "index.js",
38
38
  "devDependencies": {},