@visns-studio/visns-components 1.1.20 → 1.2.2
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/components/crm/visns-data-grid.jsx +110 -61
- package/package.json +1 -1
|
@@ -358,8 +358,12 @@ const DataGrid = (props) => {
|
|
|
358
358
|
defaultFlex: 1,
|
|
359
359
|
link: column.link ? column.link : {},
|
|
360
360
|
minWidth:
|
|
361
|
-
column.
|
|
362
|
-
? column.
|
|
361
|
+
column.minWidth && column.minWidth > 0
|
|
362
|
+
? column.minWidth
|
|
363
|
+
: undefined,
|
|
364
|
+
maxWidth:
|
|
365
|
+
column.maxWidth && column.maxWidth > 0
|
|
366
|
+
? column.maxWidth
|
|
363
367
|
: undefined,
|
|
364
368
|
render: ({ data }) => {
|
|
365
369
|
if (
|
|
@@ -381,8 +385,12 @@ const DataGrid = (props) => {
|
|
|
381
385
|
header: column.label,
|
|
382
386
|
defaultFlex: 1,
|
|
383
387
|
minWidth:
|
|
384
|
-
column.
|
|
385
|
-
? column.
|
|
388
|
+
column.minWidth && column.minWidth > 0
|
|
389
|
+
? column.minWidth
|
|
390
|
+
: undefined,
|
|
391
|
+
maxWidth:
|
|
392
|
+
column.maxWidth && column.maxWidth > 0
|
|
393
|
+
? column.maxWidth
|
|
386
394
|
: undefined,
|
|
387
395
|
link: column.link ? column.link : {},
|
|
388
396
|
render: ({ data }) => {
|
|
@@ -403,8 +411,12 @@ const DataGrid = (props) => {
|
|
|
403
411
|
header: column.label,
|
|
404
412
|
defaultFlex: 1,
|
|
405
413
|
minWidth:
|
|
406
|
-
column.
|
|
407
|
-
? column.
|
|
414
|
+
column.minWidth && column.minWidth > 0
|
|
415
|
+
? column.minWidth
|
|
416
|
+
: undefined,
|
|
417
|
+
maxWidth:
|
|
418
|
+
column.maxWidth && column.maxWidth > 0
|
|
419
|
+
? column.maxWidth
|
|
408
420
|
: undefined,
|
|
409
421
|
link: column.link ? column.link : {},
|
|
410
422
|
render: ({ data }) => {
|
|
@@ -425,8 +437,12 @@ const DataGrid = (props) => {
|
|
|
425
437
|
header: column.label,
|
|
426
438
|
defaultFlex: 1,
|
|
427
439
|
minWidth:
|
|
428
|
-
column.
|
|
429
|
-
? column.
|
|
440
|
+
column.minWidth && column.minWidth > 0
|
|
441
|
+
? column.minWidth
|
|
442
|
+
: undefined,
|
|
443
|
+
maxWidth:
|
|
444
|
+
column.maxWidth && column.maxWidth > 0
|
|
445
|
+
? column.maxWidth
|
|
430
446
|
: undefined,
|
|
431
447
|
link: column.link ? column.link : {},
|
|
432
448
|
render: ({ data }) => {
|
|
@@ -449,8 +465,12 @@ const DataGrid = (props) => {
|
|
|
449
465
|
header: column.label,
|
|
450
466
|
defaultFlex: 1,
|
|
451
467
|
minWidth:
|
|
452
|
-
column.
|
|
453
|
-
? column.
|
|
468
|
+
column.minWidth && column.minWidth > 0
|
|
469
|
+
? column.minWidth
|
|
470
|
+
: undefined,
|
|
471
|
+
maxWidth:
|
|
472
|
+
column.maxWidth && column.maxWidth > 0
|
|
473
|
+
? column.maxWidth
|
|
454
474
|
: undefined,
|
|
455
475
|
link: column.link ? column.link : {},
|
|
456
476
|
render: ({ data }) => {
|
|
@@ -477,8 +497,12 @@ const DataGrid = (props) => {
|
|
|
477
497
|
header: column.label,
|
|
478
498
|
defaultFlex: 1,
|
|
479
499
|
minWidth:
|
|
480
|
-
column.
|
|
481
|
-
? column.
|
|
500
|
+
column.minWidth && column.minWidth > 0
|
|
501
|
+
? column.minWidth
|
|
502
|
+
: undefined,
|
|
503
|
+
maxWidth:
|
|
504
|
+
column.maxWidth && column.maxWidth > 0
|
|
505
|
+
? column.maxWidth
|
|
482
506
|
: undefined,
|
|
483
507
|
link: column.link ? column.link : {},
|
|
484
508
|
render: ({ data }) => {
|
|
@@ -506,8 +530,12 @@ const DataGrid = (props) => {
|
|
|
506
530
|
header: column.label,
|
|
507
531
|
defaultFlex: 1,
|
|
508
532
|
minWidth:
|
|
509
|
-
column.
|
|
510
|
-
? column.
|
|
533
|
+
column.minWidth && column.minWidth > 0
|
|
534
|
+
? column.minWidth
|
|
535
|
+
: undefined,
|
|
536
|
+
maxWidth:
|
|
537
|
+
column.maxWidth && column.maxWidth > 0
|
|
538
|
+
? column.maxWidth
|
|
511
539
|
: undefined,
|
|
512
540
|
link: column.link ? column.link : {},
|
|
513
541
|
render: ({ data }) => {
|
|
@@ -530,8 +558,12 @@ const DataGrid = (props) => {
|
|
|
530
558
|
header: column.label,
|
|
531
559
|
defaultFlex: 1,
|
|
532
560
|
minWidth:
|
|
533
|
-
column.
|
|
534
|
-
? column.
|
|
561
|
+
column.minWidth && column.minWidth > 0
|
|
562
|
+
? column.minWidth
|
|
563
|
+
: undefined,
|
|
564
|
+
maxWidth:
|
|
565
|
+
column.maxWidth && column.maxWidth > 0
|
|
566
|
+
? column.maxWidth
|
|
535
567
|
: undefined,
|
|
536
568
|
link: column.link ? column.link : {},
|
|
537
569
|
type: "number",
|
|
@@ -542,8 +574,12 @@ const DataGrid = (props) => {
|
|
|
542
574
|
header: column.label,
|
|
543
575
|
defaultFlex: 1,
|
|
544
576
|
minWidth:
|
|
545
|
-
column.
|
|
546
|
-
? column.
|
|
577
|
+
column.minWidth && column.minWidth > 0
|
|
578
|
+
? column.minWidth
|
|
579
|
+
: undefined,
|
|
580
|
+
maxWidth:
|
|
581
|
+
column.maxWidth && column.maxWidth > 0
|
|
582
|
+
? column.maxWidth
|
|
547
583
|
: undefined,
|
|
548
584
|
link: column.link ? column.link : {},
|
|
549
585
|
render: ({ data }) => {
|
|
@@ -566,8 +602,12 @@ const DataGrid = (props) => {
|
|
|
566
602
|
header: column.label,
|
|
567
603
|
defaultFlex: 1,
|
|
568
604
|
minWidth:
|
|
569
|
-
column.
|
|
570
|
-
? column.
|
|
605
|
+
column.minWidth && column.minWidth > 0
|
|
606
|
+
? column.minWidth
|
|
607
|
+
: undefined,
|
|
608
|
+
maxWidth:
|
|
609
|
+
column.maxWidth && column.maxWidth > 0
|
|
610
|
+
? column.maxWidth
|
|
571
611
|
: undefined,
|
|
572
612
|
link: column.link ? column.link : {},
|
|
573
613
|
render: ({ data }) => {
|
|
@@ -586,8 +626,12 @@ const DataGrid = (props) => {
|
|
|
586
626
|
header: column.label,
|
|
587
627
|
defaultFlex: 1,
|
|
588
628
|
minWidth:
|
|
589
|
-
column.
|
|
590
|
-
? column.
|
|
629
|
+
column.minWidth && column.minWidth > 0
|
|
630
|
+
? column.minWidth
|
|
631
|
+
: undefined,
|
|
632
|
+
maxWidth:
|
|
633
|
+
column.maxWidth && column.maxWidth > 0
|
|
634
|
+
? column.maxWidth
|
|
591
635
|
: undefined,
|
|
592
636
|
link: column.link ? column.link : {},
|
|
593
637
|
render: ({ data }) => {
|
|
@@ -622,59 +666,52 @@ const DataGrid = (props) => {
|
|
|
622
666
|
},
|
|
623
667
|
};
|
|
624
668
|
case "relationArray":
|
|
625
|
-
|
|
626
|
-
(acc, id) => acc + `${id}.`,
|
|
627
|
-
|
|
628
|
-
);
|
|
629
|
-
relationArrayName += column.nameFrom;
|
|
669
|
+
const relationArrayName =
|
|
670
|
+
column.id.reduce((acc, id) => acc + `${id}.`, "") +
|
|
671
|
+
column.nameFrom;
|
|
630
672
|
|
|
631
673
|
return {
|
|
632
674
|
name: relationArrayName,
|
|
633
675
|
header: column.label,
|
|
634
676
|
defaultFlex: 1,
|
|
635
677
|
minWidth:
|
|
636
|
-
column.
|
|
637
|
-
? column.
|
|
678
|
+
column.minWidth && column.minWidth > 0
|
|
679
|
+
? column.minWidth
|
|
680
|
+
: undefined,
|
|
681
|
+
maxWidth:
|
|
682
|
+
column.maxWidth && column.maxWidth > 0
|
|
683
|
+
? column.maxWidth
|
|
638
684
|
: undefined,
|
|
639
685
|
link: column.link ? column.link : {},
|
|
640
686
|
render: ({ data }) => {
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
let value = '';
|
|
652
|
-
|
|
653
|
-
relationValue.forEach((rv, rvKey) => {
|
|
654
|
-
if ( rvKey > 0 ) {
|
|
655
|
-
value += ', ';
|
|
656
|
-
}
|
|
657
|
-
|
|
658
|
-
value += rv[column.nameFrom];
|
|
659
|
-
});
|
|
660
|
-
|
|
661
|
-
return <span>{value}</span>;
|
|
662
|
-
} else {
|
|
663
|
-
return null;
|
|
664
|
-
}
|
|
687
|
+
const relationValue = column.id.reduce(
|
|
688
|
+
(acc, id) => (acc === "" ? data[id] : acc[id]),
|
|
689
|
+
""
|
|
690
|
+
);
|
|
691
|
+
|
|
692
|
+
if (relationValue && Array.isArray(relationValue)) {
|
|
693
|
+
const value = relationValue
|
|
694
|
+
.map((rv) => rv[column.nameFrom])
|
|
695
|
+
.join(", ");
|
|
696
|
+
return <span>{value}</span>;
|
|
665
697
|
} else {
|
|
666
698
|
return null;
|
|
667
699
|
}
|
|
668
700
|
},
|
|
669
701
|
};
|
|
702
|
+
|
|
670
703
|
case "stage":
|
|
671
704
|
return {
|
|
672
705
|
name: column.id,
|
|
673
706
|
header: column.label,
|
|
674
707
|
defaultFlex: 1,
|
|
675
708
|
minWidth:
|
|
676
|
-
column.
|
|
677
|
-
? column.
|
|
709
|
+
column.minWidth && column.minWidth > 0
|
|
710
|
+
? column.minWidth
|
|
711
|
+
: undefined,
|
|
712
|
+
maxWidth:
|
|
713
|
+
column.maxWidth && column.maxWidth > 0
|
|
714
|
+
? column.maxWidth
|
|
678
715
|
: undefined,
|
|
679
716
|
link: column.link ? column.link : {},
|
|
680
717
|
render: ({ data }) => {
|
|
@@ -695,8 +732,12 @@ const DataGrid = (props) => {
|
|
|
695
732
|
header: column.label,
|
|
696
733
|
defaultFlex: 1,
|
|
697
734
|
minWidth:
|
|
698
|
-
column.
|
|
699
|
-
? column.
|
|
735
|
+
column.minWidth && column.minWidth > 0
|
|
736
|
+
? column.minWidth
|
|
737
|
+
: undefined,
|
|
738
|
+
maxWidth:
|
|
739
|
+
column.maxWidth && column.maxWidth > 0
|
|
740
|
+
? column.maxWidth
|
|
700
741
|
: undefined,
|
|
701
742
|
link: column.link ? column.link : {},
|
|
702
743
|
render: ({ data }) => {
|
|
@@ -717,8 +758,12 @@ const DataGrid = (props) => {
|
|
|
717
758
|
header: column.label,
|
|
718
759
|
defaultFlex: 1,
|
|
719
760
|
minWidth:
|
|
720
|
-
column.
|
|
721
|
-
? column.
|
|
761
|
+
column.minWidth && column.minWidth > 0
|
|
762
|
+
? column.minWidth
|
|
763
|
+
: undefined,
|
|
764
|
+
maxWidth:
|
|
765
|
+
column.maxWidth && column.maxWidth > 0
|
|
766
|
+
? column.maxWidth
|
|
722
767
|
: undefined,
|
|
723
768
|
link: column.link ? column.link : {},
|
|
724
769
|
render: ({ data }) => {
|
|
@@ -741,8 +786,12 @@ const DataGrid = (props) => {
|
|
|
741
786
|
header: column.label,
|
|
742
787
|
defaultFlex: 1,
|
|
743
788
|
minWidth:
|
|
744
|
-
column.
|
|
745
|
-
? column.
|
|
789
|
+
column.minWidth && column.minWidth > 0
|
|
790
|
+
? column.minWidth
|
|
791
|
+
: undefined,
|
|
792
|
+
maxWidth:
|
|
793
|
+
column.maxWidth && column.maxWidth > 0
|
|
794
|
+
? column.maxWidth
|
|
746
795
|
: undefined,
|
|
747
796
|
link: column.link ? column.link : {},
|
|
748
797
|
};
|
package/package.json
CHANGED
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"react-dom": ">=18.2.0"
|
|
34
34
|
},
|
|
35
35
|
"name": "@visns-studio/visns-components",
|
|
36
|
-
"version": "1.
|
|
36
|
+
"version": "1.2.2",
|
|
37
37
|
"description": "Various packages to assist in the development of our Custom Applications.",
|
|
38
38
|
"main": "index.js",
|
|
39
39
|
"devDependencies": {},
|