@policystudio/policy-studio-ui-vue 1.1.90-access.3 → 1.1.90-access.5
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/dist/css/psui_styles_output.css +180 -179
- package/package.json +4 -2
- package/src/assets/scss/components/PsAccordion.scss +0 -12
- package/src/assets/scss/components/PsCardInfos.scss +1 -1
- package/src/assets/scss/components/PsChips.scss +61 -30
- package/src/assets/scss/components/PsDropdown.scss +1 -10
- package/src/assets/scss/components/PsDropdownList.scss +1 -1
- package/src/components/accordion/PsAccordionItem.vue +65 -9
- package/src/components/badges-and-tags/PsCardInfos.vue +26 -2
- package/src/components/chips/PsChips.vue +21 -2
- package/src/components/controls/PsSwitch.vue +14 -5
- package/src/components/forms/PsDropdown.vue +92 -176
- package/src/components/notifications/PsDialog.vue +11 -1
|
@@ -549,6 +549,150 @@ video {
|
|
|
549
549
|
-webkit-font-feature-settings: "liga";
|
|
550
550
|
-webkit-font-smoothing: antialiased;
|
|
551
551
|
}
|
|
552
|
+
.psui-el-chips .psui-el-chips-text {
|
|
553
|
+
display: inline-flex;
|
|
554
|
+
flex-direction: column;
|
|
555
|
+
align-items: center;
|
|
556
|
+
justify-content: center;
|
|
557
|
+
position: relative;
|
|
558
|
+
}
|
|
559
|
+
.psui-el-chips .psui-el-chips-text::after {
|
|
560
|
+
content: attr(data-text);
|
|
561
|
+
}
|
|
562
|
+
.psui-el-chips .psui-el-chips-text::after {
|
|
563
|
+
pointer-events: none;
|
|
564
|
+
}
|
|
565
|
+
.psui-el-chips .psui-el-chips-text::after {
|
|
566
|
+
visibility: hidden;
|
|
567
|
+
}
|
|
568
|
+
.psui-el-chips .psui-el-chips-text::after {
|
|
569
|
+
height: 0px;
|
|
570
|
+
}
|
|
571
|
+
.psui-el-chips .psui-el-chips-text::after {
|
|
572
|
+
-webkit-user-select: none;
|
|
573
|
+
-moz-user-select: none;
|
|
574
|
+
user-select: none;
|
|
575
|
+
}
|
|
576
|
+
.psui-el-chips .psui-el-chips-text::after {
|
|
577
|
+
overflow: hidden;
|
|
578
|
+
}
|
|
579
|
+
.psui-el-chips .psui-el-chips-text::after {
|
|
580
|
+
white-space: nowrap;
|
|
581
|
+
}
|
|
582
|
+
.psui-el-chips .psui-el-chips-text::after {
|
|
583
|
+
font-weight: 700;
|
|
584
|
+
}
|
|
585
|
+
.psui-el-chips label {
|
|
586
|
+
display: flex;
|
|
587
|
+
}
|
|
588
|
+
.psui-el-chips label {
|
|
589
|
+
cursor: pointer;
|
|
590
|
+
}
|
|
591
|
+
.psui-el-chips label {
|
|
592
|
+
align-items: center;
|
|
593
|
+
}
|
|
594
|
+
.psui-el-chips label {
|
|
595
|
+
justify-content: center;
|
|
596
|
+
}
|
|
597
|
+
.psui-el-chips label {
|
|
598
|
+
border-radius: 0.25rem;
|
|
599
|
+
}
|
|
600
|
+
.psui-el-chips label {
|
|
601
|
+
border-width: 1px;
|
|
602
|
+
}
|
|
603
|
+
.psui-el-chips label {
|
|
604
|
+
--tw-border-opacity: 1;
|
|
605
|
+
border-color: rgb(162, 172, 183, var(--tw-border-opacity, 1));
|
|
606
|
+
}
|
|
607
|
+
.psui-el-chips label {
|
|
608
|
+
--tw-bg-opacity: 1;
|
|
609
|
+
background-color: rgb(255, 255, 255, var(--tw-bg-opacity, 1));
|
|
610
|
+
}
|
|
611
|
+
.psui-el-chips label {
|
|
612
|
+
padding-top: 0.25rem;
|
|
613
|
+
padding-bottom: 0.25rem;
|
|
614
|
+
}
|
|
615
|
+
.psui-el-chips label {
|
|
616
|
+
padding-left: 0.75rem;
|
|
617
|
+
padding-right: 0.75rem;
|
|
618
|
+
}
|
|
619
|
+
.psui-el-chips label {
|
|
620
|
+
font-size: 14px;
|
|
621
|
+
line-height: 130%;
|
|
622
|
+
}
|
|
623
|
+
.psui-el-chips label {
|
|
624
|
+
--tw-text-opacity: 1;
|
|
625
|
+
color: rgb(81, 94, 106, var(--tw-text-opacity, 1));
|
|
626
|
+
}
|
|
627
|
+
.psui-el-chips label {
|
|
628
|
+
transition-property: color, background-color, border-color, text-decoration-color, fill, stroke;
|
|
629
|
+
transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
|
|
630
|
+
transition-duration: 150ms;
|
|
631
|
+
}
|
|
632
|
+
.psui-el-chips label {
|
|
633
|
+
padding: 5px 8px 5px 8px;
|
|
634
|
+
}
|
|
635
|
+
.psui-el-chips label:hover {
|
|
636
|
+
--tw-bg-opacity: 1;
|
|
637
|
+
background-color: rgb(236, 247, 251, var(--tw-bg-opacity, 1));
|
|
638
|
+
}
|
|
639
|
+
.psui-el-chips label:focus, .psui-el-chips label:active {
|
|
640
|
+
--tw-border-opacity: 1;
|
|
641
|
+
border-color: rgb(49, 143, 172, var(--tw-border-opacity, 1));
|
|
642
|
+
}
|
|
643
|
+
.psui-el-chips label:focus, .psui-el-chips label:active {
|
|
644
|
+
--tw-bg-opacity: 1;
|
|
645
|
+
background-color: rgb(236, 247, 251, var(--tw-bg-opacity, 1));
|
|
646
|
+
}
|
|
647
|
+
.psui-el-chips label:focus, .psui-el-chips label:active {
|
|
648
|
+
font-weight: 700;
|
|
649
|
+
}
|
|
650
|
+
.psui-el-chips label:focus, .psui-el-chips label:active {
|
|
651
|
+
--tw-text-opacity: 1;
|
|
652
|
+
color: rgb(0, 70, 95, var(--tw-text-opacity, 1));
|
|
653
|
+
}
|
|
654
|
+
.psui-el-chips label.checked {
|
|
655
|
+
--tw-border-opacity: 1;
|
|
656
|
+
border-color: rgb(49, 143, 172, var(--tw-border-opacity, 1));
|
|
657
|
+
}
|
|
658
|
+
.psui-el-chips label.checked {
|
|
659
|
+
--tw-bg-opacity: 1;
|
|
660
|
+
background-color: rgb(236, 247, 251, var(--tw-bg-opacity, 1));
|
|
661
|
+
}
|
|
662
|
+
.psui-el-chips label.checked {
|
|
663
|
+
--tw-text-opacity: 1;
|
|
664
|
+
color: rgb(0, 70, 95, var(--tw-text-opacity, 1));
|
|
665
|
+
}
|
|
666
|
+
.psui-el-chips label.icon-position-right {
|
|
667
|
+
flex-direction: row-reverse;
|
|
668
|
+
}
|
|
669
|
+
.psui-el-chips label.icon-position-right {
|
|
670
|
+
padding: 5px 6px 5px 8px;
|
|
671
|
+
}
|
|
672
|
+
.psui-el-chips label.icon-position-right .psui-el-chips-icon {
|
|
673
|
+
margin-left: 0.25rem;
|
|
674
|
+
}
|
|
675
|
+
.psui-el-chips .psui-el-chips-icon {
|
|
676
|
+
font-family: "Material Icons Round";
|
|
677
|
+
font-weight: normal;
|
|
678
|
+
font-style: normal;
|
|
679
|
+
font-size: 24px;
|
|
680
|
+
line-height: 1;
|
|
681
|
+
letter-spacing: normal;
|
|
682
|
+
text-transform: none;
|
|
683
|
+
display: inline-block;
|
|
684
|
+
white-space: nowrap;
|
|
685
|
+
word-wrap: normal;
|
|
686
|
+
direction: ltr;
|
|
687
|
+
-webkit-font-feature-settings: "liga";
|
|
688
|
+
-webkit-font-smoothing: antialiased;
|
|
689
|
+
}
|
|
690
|
+
.psui-el-chips .psui-el-chips-icon {
|
|
691
|
+
font-size: 16px;
|
|
692
|
+
}
|
|
693
|
+
.psui-el-chips .psui-el-chips-icon.is-rotated {
|
|
694
|
+
transform: rotate(180deg);
|
|
695
|
+
}
|
|
552
696
|
.psui-el-chips.type-checkbox, .psui-el-chips.type-radio {
|
|
553
697
|
font-size: 14px;
|
|
554
698
|
}
|
|
@@ -567,14 +711,6 @@ video {
|
|
|
567
711
|
.psui-el-chips.type-checkbox input, .psui-el-chips.type-radio input {
|
|
568
712
|
clip: rect(0, 0, 0, 0);
|
|
569
713
|
}
|
|
570
|
-
.psui-el-chips.type-checkbox input:checked + label, .psui-el-chips.type-radio input:checked + label {
|
|
571
|
-
--tw-bg-opacity: 1;
|
|
572
|
-
background-color: rgb(224, 239, 246, var(--tw-bg-opacity, 1));
|
|
573
|
-
}
|
|
574
|
-
.psui-el-chips.type-checkbox input:checked + label, .psui-el-chips.type-radio input:checked + label {
|
|
575
|
-
--tw-text-opacity: 1;
|
|
576
|
-
color: rgb(49, 143, 172, var(--tw-text-opacity, 1));
|
|
577
|
-
}
|
|
578
714
|
.psui-el-chips.type-checkbox input:checked + label.layout-disabled, .psui-el-chips.type-radio input:checked + label.layout-disabled {
|
|
579
715
|
cursor: default;
|
|
580
716
|
}
|
|
@@ -595,38 +731,14 @@ video {
|
|
|
595
731
|
}
|
|
596
732
|
.psui-el-chips.type-checkbox input:checked + label:before, .psui-el-chips.type-radio input:checked + label:before {
|
|
597
733
|
--tw-text-opacity: 1;
|
|
598
|
-
color: rgb(
|
|
599
|
-
}
|
|
600
|
-
.psui-el-chips.type-checkbox label, .psui-el-chips.type-radio label {
|
|
601
|
-
display: flex;
|
|
602
|
-
}
|
|
603
|
-
.psui-el-chips.type-checkbox label, .psui-el-chips.type-radio label {
|
|
604
|
-
cursor: pointer;
|
|
605
|
-
}
|
|
606
|
-
.psui-el-chips.type-checkbox label, .psui-el-chips.type-radio label {
|
|
607
|
-
align-items: center;
|
|
608
|
-
}
|
|
609
|
-
.psui-el-chips.type-checkbox label, .psui-el-chips.type-radio label {
|
|
610
|
-
justify-content: center;
|
|
611
|
-
}
|
|
612
|
-
.psui-el-chips.type-checkbox label, .psui-el-chips.type-radio label {
|
|
613
|
-
border-radius: 0.25rem;
|
|
614
|
-
}
|
|
615
|
-
.psui-el-chips.type-checkbox label, .psui-el-chips.type-radio label {
|
|
616
|
-
--tw-bg-opacity: 1;
|
|
617
|
-
background-color: rgb(243, 246, 249, var(--tw-bg-opacity, 1));
|
|
734
|
+
color: rgb(49, 143, 172, var(--tw-text-opacity, 1));
|
|
618
735
|
}
|
|
619
|
-
.psui-el-chips.type-checkbox label, .psui-el-chips.type-radio label {
|
|
736
|
+
.psui-el-chips.type-checkbox input:checked + label:hover, .psui-el-chips.type-radio input:checked + label:hover {
|
|
620
737
|
--tw-text-opacity: 1;
|
|
621
|
-
color: rgb(
|
|
622
|
-
}
|
|
623
|
-
.psui-el-chips.type-checkbox label, .psui-el-chips.type-radio label {
|
|
624
|
-
transition-property: all;
|
|
625
|
-
transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
|
|
626
|
-
transition-duration: 150ms;
|
|
738
|
+
color: rgb(81, 94, 106, var(--tw-text-opacity, 1));
|
|
627
739
|
}
|
|
628
|
-
.psui-el-chips.type-checkbox label, .psui-el-chips.type-radio label {
|
|
629
|
-
|
|
740
|
+
.psui-el-chips.type-checkbox label:before, .psui-el-chips.type-radio label:before {
|
|
741
|
+
margin-right: 0.25rem;
|
|
630
742
|
}
|
|
631
743
|
.psui-el-chips.type-checkbox label:before, .psui-el-chips.type-radio label:before {
|
|
632
744
|
display: inline-block;
|
|
@@ -636,7 +748,7 @@ video {
|
|
|
636
748
|
}
|
|
637
749
|
.psui-el-chips.type-checkbox label:before, .psui-el-chips.type-radio label:before {
|
|
638
750
|
--tw-text-opacity: 1;
|
|
639
|
-
color: rgb(
|
|
751
|
+
color: rgb(121, 132, 144, var(--tw-text-opacity, 1));
|
|
640
752
|
}
|
|
641
753
|
.psui-el-chips.type-checkbox label:before, .psui-el-chips.type-radio label:before {
|
|
642
754
|
transition-property: all;
|
|
@@ -647,19 +759,10 @@ video {
|
|
|
647
759
|
content: "";
|
|
648
760
|
font-family: "Material Icons Round";
|
|
649
761
|
font-size: 18px;
|
|
650
|
-
margin-right: 6px;
|
|
651
762
|
}
|
|
652
763
|
.psui-el-chips.type-checkbox label:hover, .psui-el-chips.type-radio label:hover {
|
|
653
764
|
--tw-bg-opacity: 1;
|
|
654
|
-
background-color: rgb(
|
|
655
|
-
}
|
|
656
|
-
.psui-el-chips.type-checkbox label:hover, .psui-el-chips.type-radio label:hover {
|
|
657
|
-
--tw-text-opacity: 1;
|
|
658
|
-
color: rgb(49, 143, 172, var(--tw-text-opacity, 1));
|
|
659
|
-
}
|
|
660
|
-
.psui-el-chips.type-checkbox label:hover:before, .psui-el-chips.type-radio label:hover:before {
|
|
661
|
-
--tw-text-opacity: 1;
|
|
662
|
-
color: rgb(100, 181, 206, var(--tw-text-opacity, 1));
|
|
765
|
+
background-color: rgb(236, 247, 251, var(--tw-bg-opacity, 1));
|
|
663
766
|
}
|
|
664
767
|
.psui-el-chips.type-checkbox input:checked + label:before {
|
|
665
768
|
content: "check_box";
|
|
@@ -673,69 +776,6 @@ video {
|
|
|
673
776
|
.psui-el-chips.type-radio label:before {
|
|
674
777
|
content: "radio_button_unchecked";
|
|
675
778
|
}
|
|
676
|
-
.psui-el-chips.type-button label {
|
|
677
|
-
display: flex;
|
|
678
|
-
}
|
|
679
|
-
.psui-el-chips.type-button label {
|
|
680
|
-
cursor: pointer;
|
|
681
|
-
}
|
|
682
|
-
.psui-el-chips.type-button label {
|
|
683
|
-
align-items: center;
|
|
684
|
-
}
|
|
685
|
-
.psui-el-chips.type-button label {
|
|
686
|
-
justify-content: center;
|
|
687
|
-
}
|
|
688
|
-
.psui-el-chips.type-button label {
|
|
689
|
-
border-radius: 0.25rem;
|
|
690
|
-
}
|
|
691
|
-
.psui-el-chips.type-button label {
|
|
692
|
-
padding-top: 0.25rem;
|
|
693
|
-
padding-bottom: 0.25rem;
|
|
694
|
-
}
|
|
695
|
-
.psui-el-chips.type-button label {
|
|
696
|
-
padding-left: 0.75rem;
|
|
697
|
-
padding-right: 0.75rem;
|
|
698
|
-
}
|
|
699
|
-
.psui-el-chips.type-button label {
|
|
700
|
-
font-size: 14px;
|
|
701
|
-
line-height: 130%;
|
|
702
|
-
}
|
|
703
|
-
.psui-el-chips.type-button label {
|
|
704
|
-
--tw-text-opacity: 1;
|
|
705
|
-
color: rgb(81, 94, 106, var(--tw-text-opacity, 1));
|
|
706
|
-
}
|
|
707
|
-
.psui-el-chips.type-button label {
|
|
708
|
-
transition-property: all;
|
|
709
|
-
transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
|
|
710
|
-
transition-duration: 150ms;
|
|
711
|
-
}
|
|
712
|
-
.psui-el-chips.type-button label {
|
|
713
|
-
background-color: #F6F7F8;
|
|
714
|
-
}
|
|
715
|
-
.psui-el-chips.type-button label:hover {
|
|
716
|
-
--tw-bg-opacity: 1;
|
|
717
|
-
background-color: rgb(255, 255, 255, var(--tw-bg-opacity, 1));
|
|
718
|
-
}
|
|
719
|
-
.psui-el-chips.type-button label:hover {
|
|
720
|
-
--tw-text-opacity: 1;
|
|
721
|
-
color: rgb(49, 143, 172, var(--tw-text-opacity, 1));
|
|
722
|
-
}
|
|
723
|
-
.psui-el-chips.type-button label:focus, .psui-el-chips.type-button label:active {
|
|
724
|
-
--tw-bg-opacity: 1;
|
|
725
|
-
background-color: rgb(224, 239, 246, var(--tw-bg-opacity, 1));
|
|
726
|
-
}
|
|
727
|
-
.psui-el-chips.type-button label:focus, .psui-el-chips.type-button label:active {
|
|
728
|
-
--tw-text-opacity: 1;
|
|
729
|
-
color: rgb(49, 143, 172, var(--tw-text-opacity, 1));
|
|
730
|
-
}
|
|
731
|
-
.psui-el-chips.type-button label.checked {
|
|
732
|
-
--tw-bg-opacity: 1;
|
|
733
|
-
background-color: rgb(224, 239, 246, var(--tw-bg-opacity, 1));
|
|
734
|
-
}
|
|
735
|
-
.psui-el-chips.type-button label.checked {
|
|
736
|
-
--tw-text-opacity: 1;
|
|
737
|
-
color: rgb(49, 143, 172, var(--tw-text-opacity, 1));
|
|
738
|
-
}
|
|
739
779
|
.psui-el-chips.type-button.layout-with-icon label {
|
|
740
780
|
display: flex;
|
|
741
781
|
}
|
|
@@ -836,10 +876,7 @@ video {
|
|
|
836
876
|
background-color: rgb(49, 143, 172, var(--tw-bg-opacity, 1));
|
|
837
877
|
}
|
|
838
878
|
.psui-el-chips.type-button.layout-rich .psui-el-chips-icon {
|
|
839
|
-
font-size:
|
|
840
|
-
}
|
|
841
|
-
.psui-el-chips.type-button.layout-rich .psui-el-chips-icon-prepend {
|
|
842
|
-
margin-right: 0.5rem;
|
|
879
|
+
font-size: 16px;
|
|
843
880
|
}
|
|
844
881
|
.psui-el-chips.type-button.layout-rich .psui-el-chips-icon-prepend {
|
|
845
882
|
display: flex;
|
|
@@ -867,9 +904,6 @@ video {
|
|
|
867
904
|
--tw-text-opacity: 1;
|
|
868
905
|
color: rgb(255, 255, 255, var(--tw-text-opacity, 1));
|
|
869
906
|
}
|
|
870
|
-
.psui-el-chips.type-button.layout-rich .psui-el-chips-close {
|
|
871
|
-
margin-left: 0.5rem;
|
|
872
|
-
}
|
|
873
907
|
.psui-el-chips.type-button.layout-rich .psui-el-chips-close {
|
|
874
908
|
display: flex;
|
|
875
909
|
}
|
|
@@ -1334,17 +1368,6 @@ video {
|
|
|
1334
1368
|
--tw-text-opacity: 1;
|
|
1335
1369
|
color: rgb(81, 94, 106, var(--tw-text-opacity, 1));
|
|
1336
1370
|
}
|
|
1337
|
-
.psui-el-accordion .accordion-fade-enter-active,
|
|
1338
|
-
.psui-el-accordion .accordion-fade-leave-active {
|
|
1339
|
-
will-change: height, margin-bottom;
|
|
1340
|
-
transition: height 0.4s ease, margin-bottom 0.4s ease-in-out;
|
|
1341
|
-
overflow: hidden;
|
|
1342
|
-
}
|
|
1343
|
-
.psui-el-accordion .accordion-fade-enter-from,
|
|
1344
|
-
.psui-el-accordion .accordion-fade-leave-to {
|
|
1345
|
-
height: 0 !important;
|
|
1346
|
-
margin-bottom: 0 !important;
|
|
1347
|
-
}
|
|
1348
1371
|
|
|
1349
1372
|
.psui-el-input {
|
|
1350
1373
|
/* Layout Default */
|
|
@@ -1801,11 +1824,11 @@ video {
|
|
|
1801
1824
|
margin-bottom: 0.25rem;
|
|
1802
1825
|
}
|
|
1803
1826
|
.psui-el-card-infos-title {
|
|
1804
|
-
|
|
1805
|
-
line-height: 130%;
|
|
1827
|
+
display: flex;
|
|
1806
1828
|
}
|
|
1807
1829
|
.psui-el-card-infos-title {
|
|
1808
|
-
font-
|
|
1830
|
+
font-size: 12px;
|
|
1831
|
+
line-height: 130%;
|
|
1809
1832
|
}
|
|
1810
1833
|
.psui-el-card-infos-title {
|
|
1811
1834
|
--tw-text-opacity: 1;
|
|
@@ -4071,57 +4094,15 @@ video {
|
|
|
4071
4094
|
min-height: 27px;
|
|
4072
4095
|
font-size: 0.875rem;
|
|
4073
4096
|
}
|
|
4074
|
-
.psui-el-dropdown-menu button:focus {
|
|
4075
|
-
outline: none;
|
|
4076
|
-
box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.5);
|
|
4077
|
-
}
|
|
4078
|
-
.psui-el-dropdown-menu-dialog-wrapper {
|
|
4079
|
-
position: fixed;
|
|
4080
|
-
}
|
|
4081
4097
|
.psui-el-dropdown-menu-dialog-wrapper {
|
|
4082
4098
|
z-index: 50;
|
|
4083
4099
|
}
|
|
4084
4100
|
.psui-el-dropdown-menu-dialog-wrapper {
|
|
4085
|
-
|
|
4086
|
-
}
|
|
4087
|
-
.psui-el-dropdown-menu-dialog-wrapper {
|
|
4088
|
-
width: auto;
|
|
4089
|
-
}
|
|
4090
|
-
.psui-el-dropdown-menu-dialog-wrapper {
|
|
4091
|
-
transform-origin: top right;
|
|
4101
|
+
height: auto;
|
|
4092
4102
|
}
|
|
4093
4103
|
.psui-el-dropdown-menu-dialog-wrapper {
|
|
4094
4104
|
overflow: auto;
|
|
4095
4105
|
}
|
|
4096
|
-
.psui-el-dropdown-menu-dialog-wrapper {
|
|
4097
|
-
border-radius: 0.375rem;
|
|
4098
|
-
}
|
|
4099
|
-
.psui-el-dropdown-menu-dialog-wrapper {
|
|
4100
|
-
--tw-bg-opacity: 1;
|
|
4101
|
-
background-color: rgb(255, 255, 255, var(--tw-bg-opacity, 1));
|
|
4102
|
-
}
|
|
4103
|
-
.psui-el-dropdown-menu-dialog-wrapper {
|
|
4104
|
-
opacity: 0;
|
|
4105
|
-
}
|
|
4106
|
-
.psui-el-dropdown-menu-dialog-wrapper {
|
|
4107
|
-
--tw-shadow: 0px 0px 8px rgba(0, 0, 0, 0.04), 0px 5px 6px rgba(0, 0, 0, 0.1);
|
|
4108
|
-
--tw-shadow-colored: 0px 0px 8px var(--tw-shadow-color), 0px 5px 6px var(--tw-shadow-color);
|
|
4109
|
-
box-shadow: var(--tw-ring-offset-shadow, 0 0 rgba(0, 0, 0, 0)), var(--tw-ring-shadow, 0 0 rgba(0, 0, 0, 0)), var(--tw-shadow);
|
|
4110
|
-
}
|
|
4111
|
-
.psui-el-dropdown-menu-dialog-wrapper {
|
|
4112
|
-
transition-property: all;
|
|
4113
|
-
transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
|
|
4114
|
-
transition-duration: 150ms;
|
|
4115
|
-
}
|
|
4116
|
-
.psui-el-dropdown-menu-dialog-wrapper {
|
|
4117
|
-
transition-duration: 100ms;
|
|
4118
|
-
}
|
|
4119
|
-
.psui-el-dropdown-menu-dialog-wrapper {
|
|
4120
|
-
transition-timing-function: cubic-bezier(0.4, 0, 1, 1);
|
|
4121
|
-
}
|
|
4122
|
-
.psui-el-dropdown-menu-dialog-wrapper-dialog {
|
|
4123
|
-
width: 100%;
|
|
4124
|
-
}
|
|
4125
4106
|
|
|
4126
4107
|
.psui-el-dropdown-menu-list {
|
|
4127
4108
|
margin-top: 1rem;
|
|
@@ -4129,6 +4110,15 @@ video {
|
|
|
4129
4110
|
display: flex;
|
|
4130
4111
|
width: 100%;
|
|
4131
4112
|
flex-direction: column;
|
|
4113
|
+
}
|
|
4114
|
+
|
|
4115
|
+
.psui-el-dropdown-menu-list > :not([hidden]) ~ :not([hidden]) {
|
|
4116
|
+
--tw-space-y-reverse: 0;
|
|
4117
|
+
margin-top: calc(0.25rem * (1 - var(--tw-space-y-reverse)));
|
|
4118
|
+
margin-bottom: calc(0.25rem * var(--tw-space-y-reverse));
|
|
4119
|
+
}
|
|
4120
|
+
|
|
4121
|
+
.psui-el-dropdown-menu-list {
|
|
4132
4122
|
font-weight: 500;
|
|
4133
4123
|
}
|
|
4134
4124
|
.psui-el-dropdown-menu-list .psui-el-dropdown-menu-list-item {
|
|
@@ -6437,6 +6427,10 @@ video {
|
|
|
6437
6427
|
justify-self: center;
|
|
6438
6428
|
}
|
|
6439
6429
|
|
|
6430
|
+
.psui-rounded {
|
|
6431
|
+
border-radius: 0.25rem;
|
|
6432
|
+
}
|
|
6433
|
+
|
|
6440
6434
|
.psui-rounded-md {
|
|
6441
6435
|
border-radius: 0.375rem;
|
|
6442
6436
|
}
|
|
@@ -6481,6 +6475,11 @@ video {
|
|
|
6481
6475
|
background-color: rgb(214, 92, 90, var(--tw-bg-opacity, 1));
|
|
6482
6476
|
}
|
|
6483
6477
|
|
|
6478
|
+
.psui-bg-white {
|
|
6479
|
+
--tw-bg-opacity: 1;
|
|
6480
|
+
background-color: rgb(255, 255, 255, var(--tw-bg-opacity, 1));
|
|
6481
|
+
}
|
|
6482
|
+
|
|
6484
6483
|
.psui-bg-yellow-20 {
|
|
6485
6484
|
--tw-bg-opacity: 1;
|
|
6486
6485
|
background-color: rgb(237, 171, 62, var(--tw-bg-opacity, 1));
|
|
@@ -6626,6 +6625,12 @@ video {
|
|
|
6626
6625
|
opacity: 0.75;
|
|
6627
6626
|
}
|
|
6628
6627
|
|
|
6628
|
+
.psui-shadow-elevation-20 {
|
|
6629
|
+
--tw-shadow: 0px 0px 8px rgba(0, 0, 0, 0.04), 0px 5px 6px rgba(0, 0, 0, 0.1);
|
|
6630
|
+
--tw-shadow-colored: 0px 0px 8px var(--tw-shadow-color), 0px 5px 6px var(--tw-shadow-color);
|
|
6631
|
+
box-shadow: var(--tw-ring-offset-shadow, 0 0 rgba(0, 0, 0, 0)), var(--tw-ring-shadow, 0 0 rgba(0, 0, 0, 0)), var(--tw-shadow);
|
|
6632
|
+
}
|
|
6633
|
+
|
|
6629
6634
|
.psui-transition {
|
|
6630
6635
|
transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, -webkit-backdrop-filter;
|
|
6631
6636
|
transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;
|
|
@@ -6634,10 +6639,6 @@ video {
|
|
|
6634
6639
|
transition-duration: 150ms;
|
|
6635
6640
|
}
|
|
6636
6641
|
|
|
6637
|
-
.psui-duration-300 {
|
|
6638
|
-
transition-duration: 300ms;
|
|
6639
|
-
}
|
|
6640
|
-
|
|
6641
6642
|
*:focus {
|
|
6642
6643
|
outline: none;
|
|
6643
6644
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@policystudio/policy-studio-ui-vue",
|
|
3
|
-
"version": "1.1.90-access.
|
|
3
|
+
"version": "1.1.90-access.05",
|
|
4
4
|
"description": "Policy Studio UI",
|
|
5
5
|
"author": "Policy Studio Team",
|
|
6
6
|
"scripts": {
|
|
@@ -15,10 +15,12 @@
|
|
|
15
15
|
"main": "dist/index.js",
|
|
16
16
|
"types": "src/types/index.d.ts",
|
|
17
17
|
"dependencies": {
|
|
18
|
+
"@floating-ui/vue": "^1.1.9",
|
|
18
19
|
"@vue/compat": "^3.4.5",
|
|
19
20
|
"core-js": "^3.6.5",
|
|
20
21
|
"v-tooltip": "^2.1.3",
|
|
21
|
-
"vue": "^3.4.5"
|
|
22
|
+
"vue": "^3.4.5",
|
|
23
|
+
"vue2-teleport": "^1.1.4"
|
|
22
24
|
},
|
|
23
25
|
"devDependencies": {
|
|
24
26
|
"@typescript-eslint/eslint-plugin": "^5.4.0",
|
|
@@ -104,17 +104,5 @@
|
|
|
104
104
|
@apply psui-list-none psui-text-gray-60 psui-mb-5;
|
|
105
105
|
}
|
|
106
106
|
|
|
107
|
-
.accordion-fade-enter-active,
|
|
108
|
-
.accordion-fade-leave-active {
|
|
109
|
-
will-change: height, margin-bottom;
|
|
110
|
-
transition: height 0.4s ease, margin-bottom 0.4s ease-in-out;
|
|
111
|
-
overflow: hidden;
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
.accordion-fade-enter-from,
|
|
115
|
-
.accordion-fade-leave-to {
|
|
116
|
-
height: 0 !important;
|
|
117
|
-
margin-bottom: 0 !important;
|
|
118
|
-
}
|
|
119
107
|
}
|
|
120
108
|
}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
@apply psui-border psui-border-gray-20 psui-rounded-md psui-flex psui-flex-col psui-items-center psui-justify-center psui-px-3 psui-py-2 psui-cursor-pointer;
|
|
5
5
|
|
|
6
6
|
&-title {
|
|
7
|
-
@apply psui-
|
|
7
|
+
@apply psui-flex psui-text-xsmall psui-text-gray-40 psui-mb-1;
|
|
8
8
|
}
|
|
9
9
|
|
|
10
10
|
&-content {
|
|
@@ -17,6 +17,56 @@
|
|
|
17
17
|
@apply psui-icon;
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
+
.psui-el-chips-text {
|
|
21
|
+
display: inline-flex;
|
|
22
|
+
flex-direction: column;
|
|
23
|
+
align-items: center;
|
|
24
|
+
justify-content: center;
|
|
25
|
+
position: relative;
|
|
26
|
+
|
|
27
|
+
&::after {
|
|
28
|
+
content: attr(data-text);
|
|
29
|
+
@apply psui-font-bold psui-h-0 psui-invisible psui-overflow-hidden psui-select-none psui-pointer-events-none psui-whitespace-nowrap;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
label {
|
|
34
|
+
@apply psui-flex psui-bg-white psui-items-center psui-justify-center psui-text-gray-60 psui-transition-colors psui-cursor-pointer psui-rounded psui-py-1 psui-px-3 psui-text-small psui-border psui-border-gray-40;
|
|
35
|
+
padding: 5px 8px 5px 8px;
|
|
36
|
+
|
|
37
|
+
&:hover {
|
|
38
|
+
@apply psui-bg-blue-10;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
&:focus,
|
|
42
|
+
&:active {
|
|
43
|
+
@apply psui-text-blue-70 psui-bg-blue-10 psui-border-blue-60 psui-font-bold;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
&.checked {
|
|
47
|
+
@apply psui-text-blue-70 psui-bg-blue-10 psui-border-blue-60;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
&.icon-position-right {
|
|
51
|
+
@apply psui-flex-row-reverse;
|
|
52
|
+
padding: 5px 6px 5px 8px;
|
|
53
|
+
|
|
54
|
+
.psui-el-chips-icon {
|
|
55
|
+
@apply psui-ml-1;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.psui-el-chips-icon {
|
|
62
|
+
@apply psui-icon;
|
|
63
|
+
font-size: 16px;
|
|
64
|
+
|
|
65
|
+
&.is-rotated {
|
|
66
|
+
transform: rotate(180deg);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
20
70
|
&.type-checkbox,
|
|
21
71
|
&.type-radio {
|
|
22
72
|
font-size: 14px;
|
|
@@ -28,8 +78,6 @@
|
|
|
28
78
|
|
|
29
79
|
&:checked {
|
|
30
80
|
+ label {
|
|
31
|
-
@apply psui-text-blue-60 psui-bg-blue-20;
|
|
32
|
-
|
|
33
81
|
&.layout-disabled {
|
|
34
82
|
@apply psui-bg-gray-20 psui-text-gray-40 psui-cursor-default;
|
|
35
83
|
|
|
@@ -39,29 +87,28 @@
|
|
|
39
87
|
}
|
|
40
88
|
|
|
41
89
|
&:before {
|
|
42
|
-
@apply psui-text-blue-
|
|
90
|
+
@apply psui-text-blue-60;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
&:hover {
|
|
94
|
+
@apply psui-text-gray-60;
|
|
43
95
|
}
|
|
44
96
|
}
|
|
45
97
|
}
|
|
46
98
|
}
|
|
47
99
|
|
|
48
100
|
label {
|
|
49
|
-
@apply psui-flex psui-items-center psui-justify-center psui-text-gray-50 psui-bg-gray-10 psui-transition-all psui-cursor-pointer psui-rounded;
|
|
50
|
-
padding: 4px 8px 4px 6px;
|
|
51
101
|
|
|
52
102
|
&:before {
|
|
53
|
-
@apply psui-inline-block psui-text-gray-
|
|
103
|
+
@apply psui-inline-block psui-mr-1 psui-text-gray-50 psui-cursor-pointer psui-transition-all;
|
|
54
104
|
content: '';
|
|
55
105
|
font-family: 'Material Icons Round';
|
|
56
106
|
font-size: 18px;
|
|
57
|
-
margin-right: 6px;
|
|
58
107
|
}
|
|
59
108
|
|
|
60
109
|
&:hover {
|
|
61
|
-
@apply psui-
|
|
62
|
-
|
|
63
|
-
@apply psui-text-blue-50;
|
|
64
|
-
}
|
|
110
|
+
@apply psui-bg-blue-10;
|
|
111
|
+
|
|
65
112
|
}
|
|
66
113
|
}
|
|
67
114
|
}
|
|
@@ -100,22 +147,6 @@
|
|
|
100
147
|
}
|
|
101
148
|
|
|
102
149
|
&.type-button {
|
|
103
|
-
label {
|
|
104
|
-
@apply psui-flex psui-items-center psui-justify-center psui-text-gray-60 psui-transition-all psui-cursor-pointer psui-rounded psui-py-1 psui-px-3 psui-text-small;
|
|
105
|
-
background-color: #F6F7F8;
|
|
106
|
-
&:hover {
|
|
107
|
-
@apply psui-text-blue-60 psui-bg-white;
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
&:focus,
|
|
111
|
-
&:active {
|
|
112
|
-
@apply psui-text-blue-60 psui-bg-blue-20;
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
&.checked {
|
|
116
|
-
@apply psui-text-blue-60 psui-bg-blue-20;
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
150
|
|
|
120
151
|
&.layout-with-icon {
|
|
121
152
|
label {
|
|
@@ -165,15 +196,15 @@
|
|
|
165
196
|
}
|
|
166
197
|
|
|
167
198
|
.psui-el-chips-icon {
|
|
168
|
-
font-size:
|
|
199
|
+
font-size: 16px;
|
|
169
200
|
|
|
170
201
|
&-prepend {
|
|
171
|
-
@apply psui-bg-gray-30 psui-rounded-full psui-text-white psui-
|
|
202
|
+
@apply psui-bg-gray-30 psui-rounded-full psui-text-white psui-w-6 psui-h-6 psui-flex psui-items-center psui-justify-center;
|
|
172
203
|
}
|
|
173
204
|
}
|
|
174
205
|
|
|
175
206
|
.psui-el-chips-close {
|
|
176
|
-
@apply psui-text-gray-40 psui-flex psui-items-center psui-justify-center
|
|
207
|
+
@apply psui-text-gray-40 psui-flex psui-items-center psui-justify-center;
|
|
177
208
|
}
|
|
178
209
|
}
|
|
179
210
|
}
|
|
@@ -20,19 +20,10 @@
|
|
|
20
20
|
min-height: 27px;
|
|
21
21
|
font-size: 0.875rem;
|
|
22
22
|
|
|
23
|
-
|
|
24
|
-
&:focus {
|
|
25
|
-
outline: none;
|
|
26
|
-
box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.5);
|
|
27
|
-
}
|
|
28
23
|
}
|
|
29
24
|
|
|
30
25
|
&-dialog-wrapper {
|
|
31
|
-
@apply psui-
|
|
32
|
-
|
|
33
|
-
&-dialog {
|
|
34
|
-
@apply psui-w-full;
|
|
35
|
-
}
|
|
26
|
+
@apply psui-z-50 psui-overflow-auto psui-h-auto;
|
|
36
27
|
}
|
|
37
28
|
}
|
|
38
29
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
@layer components {
|
|
2
2
|
.psui-el-dropdown-menu-list {
|
|
3
|
-
@apply psui-w-full psui-flex psui-flex-col psui-font-medium psui-my-4;
|
|
3
|
+
@apply psui-w-full psui-flex psui-flex-col psui-font-medium psui-my-4 psui-space-y-1;
|
|
4
4
|
|
|
5
5
|
.psui-el-dropdown-menu-list-item {
|
|
6
6
|
@apply psui-flex psui-items-end psui-justify-between psui-mx-0 psui-text-small psui-text-gray-60 psui-cursor-pointer psui-transition-all;
|
|
@@ -31,10 +31,12 @@
|
|
|
31
31
|
</div>
|
|
32
32
|
<transition
|
|
33
33
|
name="accordion-fade"
|
|
34
|
-
|
|
35
|
-
@
|
|
36
|
-
@
|
|
37
|
-
@after-
|
|
34
|
+
:css="false"
|
|
35
|
+
@before-enter="beforeEnter"
|
|
36
|
+
@enter="enter"
|
|
37
|
+
@after-enter="afterEnter"
|
|
38
|
+
@before-leave="beforeLeave"
|
|
39
|
+
@leave="leave"
|
|
38
40
|
>
|
|
39
41
|
<div
|
|
40
42
|
v-if="isOpen"
|
|
@@ -129,13 +131,67 @@ const toggle = () => {
|
|
|
129
131
|
localOpened.value = !localOpened.value
|
|
130
132
|
}
|
|
131
133
|
}
|
|
132
|
-
|
|
134
|
+
|
|
135
|
+
const beforeEnter = (el) => {
|
|
136
|
+
el.style.height = '0'
|
|
137
|
+
el.style.opacity = '0'
|
|
138
|
+
el.style.overflow = 'hidden'
|
|
139
|
+
el.style.paddingTop = '0'
|
|
140
|
+
el.style.paddingBottom = '0'
|
|
141
|
+
el.style.marginTop = '0'
|
|
142
|
+
el.style.marginBottom = '0'
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
const enter = (el, done) => {
|
|
146
|
+
void el.offsetHeight
|
|
147
|
+
|
|
148
|
+
el.style.transition = 'all 0.3s ease-in-out'
|
|
133
149
|
el.style.height = el.scrollHeight + 'px'
|
|
134
|
-
el.style.
|
|
150
|
+
el.style.opacity = '1'
|
|
151
|
+
|
|
152
|
+
el.style.removeProperty('padding-top')
|
|
153
|
+
el.style.removeProperty('padding-bottom')
|
|
154
|
+
el.style.removeProperty('margin-top')
|
|
155
|
+
el.style.removeProperty('margin-bottom')
|
|
156
|
+
|
|
157
|
+
el.addEventListener('transitionend', done, { once: true })
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
const afterEnter = (el) => {
|
|
161
|
+
el.style.height = 'auto'
|
|
162
|
+
el.style.overflow = 'visible'
|
|
163
|
+
el.style.transition = ''
|
|
135
164
|
}
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
el
|
|
165
|
+
|
|
166
|
+
const beforeLeave = (el) => {
|
|
167
|
+
if (!el) return
|
|
168
|
+
|
|
169
|
+
el.style.height = el.scrollHeight + 'px'
|
|
170
|
+
el.style.overflow = 'hidden'
|
|
171
|
+
|
|
172
|
+
const style = window.getComputedStyle(el)
|
|
173
|
+
el.style.paddingTop = style.paddingTop
|
|
174
|
+
el.style.paddingBottom = style.paddingBottom
|
|
175
|
+
el.style.marginTop = style.marginTop
|
|
176
|
+
el.style.marginBottom = style.marginBottom
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
const leave = (el, done) => {
|
|
180
|
+
if (!el) return
|
|
181
|
+
|
|
182
|
+
void el.offsetHeight
|
|
183
|
+
el.style.transition = 'all 0.3s ease-in-out'
|
|
184
|
+
|
|
185
|
+
requestAnimationFrame(() => {
|
|
186
|
+
el.style.height = '0'
|
|
187
|
+
el.style.opacity = '0'
|
|
188
|
+
el.style.paddingTop = '0'
|
|
189
|
+
el.style.paddingBottom = '0'
|
|
190
|
+
el.style.marginTop = '0'
|
|
191
|
+
el.style.marginBottom = '0'
|
|
192
|
+
})
|
|
193
|
+
|
|
194
|
+
el.addEventListener('transitionend', done, { once: true })
|
|
139
195
|
}
|
|
140
196
|
</script>
|
|
141
197
|
|
|
@@ -4,11 +4,14 @@
|
|
|
4
4
|
@click="onClick()"
|
|
5
5
|
>
|
|
6
6
|
<h5 class="psui-el-card-infos-title">
|
|
7
|
-
<span class="
|
|
7
|
+
<span :class="[titleClass, 'psui-mr-1']">{{ title }}</span>
|
|
8
|
+
<slot name="subtitle">
|
|
9
|
+
<span :class="subtitleClass">{{ subtitle }}</span>
|
|
10
|
+
</slot>
|
|
8
11
|
</h5>
|
|
9
12
|
<div class="psui-el-card-infos-content">
|
|
10
13
|
<span class="psui-el-card-infos-icon material-icons-round">{{ icon }}</span>
|
|
11
|
-
<h5 class="
|
|
14
|
+
<h5 :class="totalClass">
|
|
12
15
|
{{ total }}
|
|
13
16
|
</h5>
|
|
14
17
|
</div>
|
|
@@ -45,6 +48,27 @@ defineProps({
|
|
|
45
48
|
type: String,
|
|
46
49
|
default: '',
|
|
47
50
|
},
|
|
51
|
+
/**
|
|
52
|
+
* It sets the class for the title text (color, font-weight, font-size, etc.).
|
|
53
|
+
*/
|
|
54
|
+
titleClass: {
|
|
55
|
+
type: String,
|
|
56
|
+
default: 'psui-text-gray-60 psui-font-bold',
|
|
57
|
+
},
|
|
58
|
+
/**
|
|
59
|
+
* It sets the class for the subtitle text (color, font-weight, font-size, etc.).
|
|
60
|
+
*/
|
|
61
|
+
subtitleClass: {
|
|
62
|
+
type: String,
|
|
63
|
+
default: 'psui-text-gray-40 psui-font-bold',
|
|
64
|
+
},
|
|
65
|
+
/**
|
|
66
|
+
* It sets the class for the total text (color, font-weight, font-size, etc.).
|
|
67
|
+
*/
|
|
68
|
+
totalClass: {
|
|
69
|
+
type: String,
|
|
70
|
+
default: 'psui-text-gray-80',
|
|
71
|
+
},
|
|
48
72
|
})
|
|
49
73
|
|
|
50
74
|
const onClick = () => {
|
|
@@ -24,13 +24,23 @@
|
|
|
24
24
|
<label
|
|
25
25
|
:disabled="disabled"
|
|
26
26
|
:for="getInputId"
|
|
27
|
-
:class="
|
|
27
|
+
:class="[
|
|
28
|
+
{'checked': checked && type === 'button', 'layout-disabled': layout === 'disabled'},
|
|
29
|
+
`icon-position-${iconPosition}`
|
|
30
|
+
]"
|
|
28
31
|
>
|
|
29
32
|
<i
|
|
30
33
|
v-if="icon"
|
|
31
34
|
class="psui-el-chips-icon psui-el-chips-icon-prepend"
|
|
35
|
+
:class="{ 'is-rotated': rotableIcon }"
|
|
32
36
|
>{{ icon }}</i>
|
|
33
|
-
|
|
37
|
+
<span
|
|
38
|
+
class="psui-el-chips-text"
|
|
39
|
+
:data-text="label"
|
|
40
|
+
>
|
|
41
|
+
{{ label }}
|
|
42
|
+
</span>
|
|
43
|
+
|
|
34
44
|
<button
|
|
35
45
|
@click="onClose"
|
|
36
46
|
v-if="layout === 'rich'"
|
|
@@ -83,6 +93,15 @@ const props = defineProps({
|
|
|
83
93
|
/**
|
|
84
94
|
* It sets if the button was checked or not checked.
|
|
85
95
|
*/
|
|
96
|
+
iconPosition: {
|
|
97
|
+
type: String,
|
|
98
|
+
default: 'left',
|
|
99
|
+
validator: (value) => ['left', 'right'].includes(value)
|
|
100
|
+
},
|
|
101
|
+
rotableIcon:{
|
|
102
|
+
type: Boolean,
|
|
103
|
+
defaul: false
|
|
104
|
+
},
|
|
86
105
|
checked: {
|
|
87
106
|
type: Boolean,
|
|
88
107
|
default: false,
|
|
@@ -5,20 +5,24 @@
|
|
|
5
5
|
@click="change()"
|
|
6
6
|
tabindex="0"
|
|
7
7
|
>
|
|
8
|
-
<input
|
|
9
|
-
type="checkbox"
|
|
10
|
-
:checked="value"
|
|
11
|
-
>
|
|
12
8
|
<label
|
|
13
9
|
class="psui-el-switch-button"
|
|
14
10
|
:class="[getToggleClass]"
|
|
11
|
+
:for="uniqueId"
|
|
15
12
|
/>
|
|
13
|
+
<input
|
|
14
|
+
type="checkbox"
|
|
15
|
+
:checked="value"
|
|
16
|
+
:id="uniqueId"
|
|
17
|
+
tabindex="-1"
|
|
18
|
+
:aria-label="label"
|
|
19
|
+
>
|
|
16
20
|
</div>
|
|
17
21
|
</template>
|
|
18
22
|
|
|
19
23
|
<script setup>
|
|
20
24
|
//FIGMA CONTROLS & SELECTORS https://www.figma.com/file/Tto8hrNlSfuPcwd1pfqogF/%E2%9A%A1%EF%B8%8F-Design-System?node-id=1768%3A64852
|
|
21
|
-
import { computed } from 'vue'
|
|
25
|
+
import { computed, getCurrentInstance } from 'vue'
|
|
22
26
|
|
|
23
27
|
const emit = defineEmits('change', 'update:value')
|
|
24
28
|
|
|
@@ -66,7 +70,12 @@ const getComponentClass = computed(() => {
|
|
|
66
70
|
return `size-${props.size}`
|
|
67
71
|
})
|
|
68
72
|
|
|
73
|
+
const instance = getCurrentInstance()
|
|
74
|
+
const uniqueId = computed(() => `psui-switch-${instance.uid}`)
|
|
75
|
+
|
|
69
76
|
const change = () => {
|
|
77
|
+
if (props.disabled) return
|
|
78
|
+
|
|
70
79
|
emit('update:value', !props.value)
|
|
71
80
|
emit('change', !props.value)
|
|
72
81
|
}
|
|
@@ -1,218 +1,134 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div
|
|
3
|
-
ref="PSDropdown"
|
|
4
3
|
class="psui-el-dropdown-menu"
|
|
5
|
-
:class="{ 'is-open': show.value }"
|
|
6
|
-
v-click-outside="close"
|
|
7
4
|
>
|
|
8
5
|
<div
|
|
9
6
|
ref="PSDropdownTrigger"
|
|
10
|
-
|
|
11
|
-
@click="show && !toggleWhenActive ? '' : toggle($event)"
|
|
12
|
-
>
|
|
13
|
-
<slot name="dropdownTrigger" />
|
|
14
|
-
</div>
|
|
15
|
-
|
|
16
|
-
<button
|
|
17
|
-
v-else
|
|
18
|
-
@click="show && !toggleWhenActive ? '' : toggle($event)"
|
|
19
|
-
type="button"
|
|
20
|
-
:id="id.value"
|
|
21
|
-
aria-haspopup="true"
|
|
22
|
-
aria-expanded="true"
|
|
23
|
-
ref="PSDropdownTrigger"
|
|
7
|
+
@click="toggle"
|
|
24
8
|
>
|
|
25
9
|
<slot
|
|
26
|
-
v-if="
|
|
27
|
-
name="
|
|
10
|
+
v-if="hasDropdownTrigger"
|
|
11
|
+
name="dropdownTrigger"
|
|
12
|
+
:show="show"
|
|
28
13
|
/>
|
|
29
|
-
<
|
|
14
|
+
<button
|
|
30
15
|
v-else
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
<slot name="items" />
|
|
44
|
-
</div>
|
|
16
|
+
type="button"
|
|
17
|
+
:aria-expanded="show"
|
|
18
|
+
>
|
|
19
|
+
<slot
|
|
20
|
+
v-if="show && $slots.buttonLabelOnShow"
|
|
21
|
+
name="buttonLabelOnShow"
|
|
22
|
+
/>
|
|
23
|
+
<slot
|
|
24
|
+
v-else
|
|
25
|
+
name="buttonLabel"
|
|
26
|
+
/>
|
|
27
|
+
</button>
|
|
45
28
|
</div>
|
|
29
|
+
<Teleport to="body">
|
|
30
|
+
<Transition name="fade">
|
|
31
|
+
<div
|
|
32
|
+
v-if="show"
|
|
33
|
+
ref="PSDropdownFloating"
|
|
34
|
+
role="menu"
|
|
35
|
+
class="psui-el-dropdown-menu-dialog-wrapper"
|
|
36
|
+
:class="contentCss"
|
|
37
|
+
aria-orientation="vertical"
|
|
38
|
+
:style="floatingStyles"
|
|
39
|
+
v-click-outside="close"
|
|
40
|
+
>
|
|
41
|
+
<slot name="items" />
|
|
42
|
+
</div>
|
|
43
|
+
</Transition>
|
|
44
|
+
</Teleport>
|
|
46
45
|
</div>
|
|
47
46
|
</template>
|
|
48
47
|
|
|
49
48
|
<script setup>
|
|
50
49
|
// Figma - 2.3 Dropdown with category divider https://www.figma.com/file/Tto8hrNlSfuPcwd1pfqogF/%E2%9A%A1%EF%B8%8F-Design-System?node-id=1768%3A64886
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
50
|
+
import {
|
|
51
|
+
useFloating,
|
|
52
|
+
autoUpdate,
|
|
53
|
+
offset,
|
|
54
|
+
flip,
|
|
55
|
+
shift,
|
|
56
|
+
size
|
|
57
|
+
} from '@floating-ui/vue'
|
|
58
|
+
|
|
59
|
+
import { ref, defineProps, useSlots, computed } from 'vue'
|
|
60
|
+
import Teleport from 'vue2-teleport'
|
|
60
61
|
|
|
61
62
|
const props = defineProps({
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
type: String,
|
|
67
|
-
default:
|
|
68
|
-
},
|
|
69
|
-
/**
|
|
70
|
-
* It's a boolean responsible for showing a slot within the html tag button.
|
|
71
|
-
*/
|
|
72
|
-
buttonLabelOnShow: {
|
|
73
|
-
type: Boolean,
|
|
74
|
-
default: false,
|
|
75
|
-
},
|
|
76
|
-
/**
|
|
77
|
-
* It's a property responsible for toggling the dropdown menu. default: true.
|
|
78
|
-
*/
|
|
79
|
-
toggleWhenActive: {
|
|
80
|
-
type: Boolean,
|
|
81
|
-
default: true,
|
|
63
|
+
disabled: {type: Boolean, default: false},
|
|
64
|
+
placement: { type: String, default: 'bottom-start' },
|
|
65
|
+
offsetVal: { type: Number, default: 4 },
|
|
66
|
+
width: {
|
|
67
|
+
type: [Number, String],
|
|
68
|
+
default: null
|
|
82
69
|
},
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
disabled: {
|
|
87
|
-
type: Boolean,
|
|
88
|
-
default: false,
|
|
70
|
+
height: {
|
|
71
|
+
type: [Number, String],
|
|
72
|
+
default: 'auto'
|
|
89
73
|
},
|
|
90
|
-
|
|
91
|
-
* It sets the vertical and horizontal position.
|
|
92
|
-
*/
|
|
93
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment, vue/require-default-prop
|
|
94
|
-
position: {
|
|
74
|
+
contentCss: {
|
|
95
75
|
type: String,
|
|
96
|
-
|
|
97
|
-
}
|
|
76
|
+
default: 'psui-rounded psui-bg-white psui-shadow-elevation-20'
|
|
77
|
+
}
|
|
98
78
|
})
|
|
99
79
|
|
|
100
80
|
const emit = defineEmits(['open', 'close'])
|
|
101
81
|
|
|
102
|
-
const
|
|
103
|
-
const id = ref(randomString(8))
|
|
104
|
-
// const marginLeft = ref('-0px')
|
|
105
|
-
const scrollableParentEl = ref(null)
|
|
106
|
-
const PSDropdown = ref(null)
|
|
107
|
-
const PSDropdownDialog = ref(null)
|
|
108
|
-
const PSDropdownTrigger = ref(null)
|
|
109
|
-
|
|
110
|
-
// const getMaxWidth = computed(() => {
|
|
111
|
-
// let bounds = PSDropdown.getBoundingClientRect()
|
|
112
|
-
// return document.documentElement.clientWidth - bounds['left'] - 30
|
|
113
|
-
// })
|
|
82
|
+
const slots = useSlots()
|
|
114
83
|
|
|
115
|
-
|
|
116
|
-
|
|
84
|
+
const hasDropdownTrigger = computed(() => {
|
|
85
|
+
return !!slots.dropdownTrigger
|
|
117
86
|
})
|
|
118
87
|
|
|
119
|
-
const
|
|
120
|
-
if (props.disabled) return
|
|
121
|
-
if (!show.value) {
|
|
122
|
-
open()
|
|
123
|
-
} else {
|
|
124
|
-
close()
|
|
125
|
-
}
|
|
126
|
-
event.stopPropagation()
|
|
127
|
-
}
|
|
88
|
+
const show = ref(false)
|
|
128
89
|
|
|
129
|
-
const
|
|
130
|
-
|
|
131
|
-
|
|
90
|
+
const PSDropdownTrigger = ref(null)
|
|
91
|
+
const PSDropdownFloating = ref(null)
|
|
92
|
+
|
|
93
|
+
const { floatingStyles } = useFloating(PSDropdownTrigger, PSDropdownFloating, {
|
|
94
|
+
placement: props.placement,
|
|
95
|
+
whileElementsMounted: autoUpdate,
|
|
96
|
+
middleware: [
|
|
97
|
+
offset(props.offsetVal),
|
|
98
|
+
flip(),
|
|
99
|
+
shift(),
|
|
100
|
+
size({
|
|
101
|
+
apply({rects, elements}) {
|
|
102
|
+
const customWidth = props.width ?? rects.reference.width
|
|
103
|
+
Object.assign(elements.floating.style, {
|
|
104
|
+
width: `${customWidth}px`,
|
|
105
|
+
...(typeof height == 'string' ? {maxHeight: props.height} : {maxHeight : `${props.height}px`})
|
|
106
|
+
})
|
|
107
|
+
},
|
|
108
|
+
})
|
|
109
|
+
],
|
|
110
|
+
})
|
|
132
111
|
|
|
133
112
|
const open = () => {
|
|
134
|
-
emit('open')
|
|
135
113
|
show.value = true
|
|
136
|
-
|
|
137
|
-
PSDropdownDialog.value.style.opacity = 0
|
|
138
|
-
PSDropdownDialog.value.style.display = 'block'
|
|
139
|
-
}
|
|
140
|
-
setTimeout(() => {
|
|
141
|
-
updatePosition()
|
|
142
|
-
watchParentScrolling()
|
|
143
|
-
document.addEventListener('keyup', handleEsc)
|
|
144
|
-
window.addEventListener('resize', updatePosition)
|
|
145
|
-
// window.addEventListener('click', clickOutside)
|
|
146
|
-
}, 10)
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
const close = () => {
|
|
150
|
-
if (show.value == true) {
|
|
151
|
-
emit('close')
|
|
152
|
-
if (PSDropdownDialog.value !== null) {
|
|
153
|
-
PSDropdownDialog.value.style.display = 'none'
|
|
154
|
-
PSDropdownDialog.value.style.opacity = 0
|
|
155
|
-
}
|
|
156
|
-
show.value = false
|
|
157
|
-
unwatchParentScrolling()
|
|
158
|
-
}
|
|
159
|
-
document.removeEventListener('keyup', handleEsc)
|
|
160
|
-
document.removeEventListener('resize', updatePosition)
|
|
161
|
-
// document.removeEventListener('click', clickOutside)
|
|
114
|
+
emit('open')
|
|
162
115
|
}
|
|
163
116
|
|
|
164
|
-
const
|
|
165
|
-
|
|
166
|
-
if (scrollableParentEl.value) {
|
|
167
|
-
scrollableParentEl.value.addEventListener('scroll', updatePosition)
|
|
168
|
-
}
|
|
169
|
-
}
|
|
117
|
+
const close = (event) => {
|
|
118
|
+
if(event?.target && PSDropdownTrigger.value.contains(event?.target)) return
|
|
170
119
|
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
scrollableParentEl.value.removeEventListener('scroll', updatePosition())
|
|
174
|
-
}
|
|
120
|
+
show.value = false
|
|
121
|
+
emit('close')
|
|
175
122
|
}
|
|
176
123
|
|
|
177
|
-
const
|
|
178
|
-
if (
|
|
179
|
-
|
|
180
|
-
const rectTrigger = PSDropdownTrigger.value.getBoundingClientRect()
|
|
181
|
-
const rectDialog = PSDropdownDialog.value.getBoundingClientRect()
|
|
182
|
-
const windowWidth = document.documentElement.clientWidth
|
|
183
|
-
|
|
184
|
-
PSDropdownDialog.value.style.position = 'fixed'
|
|
185
|
-
PSDropdownDialog.value.style.top = `${rectTrigger.y + rectTrigger.height}px`
|
|
186
|
-
PSDropdownDialog.value.style.minWidth = `${rectTrigger.width}px`
|
|
187
|
-
|
|
188
|
-
if (rectTrigger.x + rectDialog.width + 20 > windowWidth) {
|
|
189
|
-
PSDropdownDialog.value.style.left = `${windowWidth - rectDialog.width - 30}px`
|
|
190
|
-
} else {
|
|
191
|
-
PSDropdownDialog.value.style.left = `${rectTrigger.x}px`
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
if (props.position == 'custom') {
|
|
195
|
-
PSDropdownDialog.value.style.top = `${rectTrigger.y}px`
|
|
196
|
-
PSDropdownDialog.value.style.left = `${rectTrigger.x + 100}px`
|
|
197
|
-
}
|
|
124
|
+
const toggle = (event) => {
|
|
125
|
+
if (props.disabled) return
|
|
198
126
|
|
|
199
|
-
if (
|
|
200
|
-
close()
|
|
201
|
-
console.warn('The dropdown are too close from the top of the page')
|
|
202
|
-
return
|
|
203
|
-
}
|
|
127
|
+
if (event) event.stopPropagation()
|
|
204
128
|
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
PSDropdownDialog.value.style.opacity = 1
|
|
208
|
-
}
|
|
209
|
-
}, 10)
|
|
129
|
+
show.value = !show.value
|
|
130
|
+
|
|
210
131
|
}
|
|
211
132
|
|
|
212
|
-
|
|
213
|
-
if (!show.value) return
|
|
214
|
-
if (!PSDropdown.value == event.target || !PSDropdown.value?.contains(event.target)) {
|
|
215
|
-
close()
|
|
216
|
-
}
|
|
217
|
-
}
|
|
133
|
+
defineExpose({ open, close })
|
|
218
134
|
</script>
|
|
@@ -3,7 +3,10 @@
|
|
|
3
3
|
class="psui-el-dialog"
|
|
4
4
|
:class="getComponentClass"
|
|
5
5
|
>
|
|
6
|
-
<div
|
|
6
|
+
<div
|
|
7
|
+
v-if="hasIcon"
|
|
8
|
+
class="psui-el-dialog-icon"
|
|
9
|
+
>
|
|
7
10
|
<i class="material-icons-round">{{ icon }}</i>
|
|
8
11
|
</div>
|
|
9
12
|
<div class="psui-el-dialog-wrapper">
|
|
@@ -71,6 +74,13 @@ const props = defineProps({
|
|
|
71
74
|
type: String,
|
|
72
75
|
default: 'info',
|
|
73
76
|
},
|
|
77
|
+
/**
|
|
78
|
+
* It sets whether the icon should be displayed or not.
|
|
79
|
+
*/
|
|
80
|
+
hasIcon: {
|
|
81
|
+
type: Boolean,
|
|
82
|
+
default: true,
|
|
83
|
+
},
|
|
74
84
|
})
|
|
75
85
|
|
|
76
86
|
const emit = defineEmits(['close'])
|