@patternfly/react-core 4.202.2 → 4.202.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/CHANGELOG.md +24 -0
- package/dist/umd/react-core.css +229 -229
- package/package.json +6 -6
- package/src/components/Dropdown/examples/Dropdown.md +62 -24
- package/src/components/Select/examples/Select.md +91 -48
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,30 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## 4.202.5 (2022-03-25)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @patternfly/react-core
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
## 4.202.4 (2022-03-25)
|
|
15
|
+
|
|
16
|
+
**Note:** Version bump only for package @patternfly/react-core
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
## 4.202.3 (2022-03-25)
|
|
23
|
+
|
|
24
|
+
**Note:** Version bump only for package @patternfly/react-core
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
6
30
|
## 4.202.2 (2022-03-25)
|
|
7
31
|
|
|
8
32
|
**Note:** Version bump only for package @patternfly/react-core
|
package/dist/umd/react-core.css
CHANGED
|
@@ -509,235 +509,6 @@
|
|
|
509
509
|
--pf-c-alert__title--FontWeight: var(--pf-global--FontWeight--normal);
|
|
510
510
|
}
|
|
511
511
|
|
|
512
|
-
.pf-c-app-launcher {
|
|
513
|
-
--pf-c-app-launcher__menu--BackgroundColor: var(--pf-global--BackgroundColor--light-100);
|
|
514
|
-
--pf-c-app-launcher__menu--BoxShadow: var(--pf-global--BoxShadow--md);
|
|
515
|
-
--pf-c-app-launcher__menu--PaddingTop: var(--pf-global--spacer--sm);
|
|
516
|
-
--pf-c-app-launcher__menu--PaddingBottom: var(--pf-global--spacer--sm);
|
|
517
|
-
--pf-c-app-launcher__menu--Top: calc(100% + var(--pf-global--spacer--xs));
|
|
518
|
-
--pf-c-app-launcher__menu--ZIndex: var(--pf-global--ZIndex--sm);
|
|
519
|
-
--pf-c-app-launcher--m-top__menu--Top: 0;
|
|
520
|
-
--pf-c-app-launcher--m-top__menu--TranslateY: calc(-100% - var(--pf-global--spacer--xs));
|
|
521
|
-
--pf-c-app-launcher__toggle--PaddingTop: var(--pf-global--spacer--form-element);
|
|
522
|
-
--pf-c-app-launcher__toggle--PaddingRight: var(--pf-global--spacer--md);
|
|
523
|
-
--pf-c-app-launcher__toggle--PaddingBottom: var(--pf-global--spacer--form-element);
|
|
524
|
-
--pf-c-app-launcher__toggle--PaddingLeft: var(--pf-global--spacer--md);
|
|
525
|
-
--pf-c-app-launcher__toggle--Color: var(--pf-global--Color--200);
|
|
526
|
-
--pf-c-app-launcher__toggle--hover--Color: var(--pf-global--Color--100);
|
|
527
|
-
--pf-c-app-launcher__toggle--active--Color: var(--pf-global--Color--100);
|
|
528
|
-
--pf-c-app-launcher__toggle--focus--Color: var(--pf-global--Color--100);
|
|
529
|
-
--pf-c-app-launcher__toggle--disabled--Color: var(--pf-global--disabled-color--200);
|
|
530
|
-
--pf-c-app-launcher__toggle--m-expanded--Color: var(--pf-global--Color--100);
|
|
531
|
-
--pf-c-app-launcher__menu-search--PaddingTop: var(--pf-global--spacer--sm);
|
|
532
|
-
--pf-c-app-launcher__menu-search--PaddingRight: var(--pf-global--spacer--md);
|
|
533
|
-
--pf-c-app-launcher__menu-search--PaddingBottom: var(--pf-global--spacer--md);
|
|
534
|
-
--pf-c-app-launcher__menu-search--PaddingLeft: var(--pf-global--spacer--md);
|
|
535
|
-
--pf-c-app-launcher__menu-search--BottomBorderColor: var(--pf-global--BorderColor--100);
|
|
536
|
-
--pf-c-app-launcher__menu-search--BottomBorderWidth: var(--pf-global--BorderWidth--sm);
|
|
537
|
-
--pf-c-app-launcher__menu-search--MarginBottom: var(--pf-global--spacer--sm);
|
|
538
|
-
--pf-c-app-launcher__menu-item--PaddingTop: var(--pf-global--spacer--sm);
|
|
539
|
-
--pf-c-app-launcher__menu-item--PaddingRight: var(--pf-global--spacer--md);
|
|
540
|
-
--pf-c-app-launcher__menu-item--PaddingBottom: var(--pf-global--spacer--sm);
|
|
541
|
-
--pf-c-app-launcher__menu-item--PaddingLeft: var(--pf-global--spacer--md);
|
|
542
|
-
--pf-c-app-launcher__menu-item--Color: var(--pf-global--Color--dark-100);
|
|
543
|
-
--pf-c-app-launcher__menu-item--FontWeight: var(--pf-global--FontWeight--normal);
|
|
544
|
-
--pf-c-app-launcher__menu-item--Width: 100%;
|
|
545
|
-
--pf-c-app-launcher__menu-item--disabled--Color: var(--pf-global--Color--dark-200);
|
|
546
|
-
--pf-c-app-launcher__menu-item--hover--BackgroundColor: var(--pf-global--BackgroundColor--light-300);
|
|
547
|
-
--pf-c-app-launcher__menu-item--m-link--PaddingRight: 0;
|
|
548
|
-
--pf-c-app-launcher__menu-item--m-link--hover--BackgroundColor: transparent;
|
|
549
|
-
--pf-c-app-launcher__menu-item--m-action--Color: var(--pf-global--Color--200);
|
|
550
|
-
--pf-c-app-launcher__menu-item--m-action--Width: auto;
|
|
551
|
-
--pf-c-app-launcher__menu-item--m-action--FontSize: var(--pf-global--icon--FontSize--sm);
|
|
552
|
-
--pf-c-app-launcher__menu-item--m-action--hover--BackgroundColor: transparent;
|
|
553
|
-
--pf-c-app-launcher__menu-item--hover__menu-item--m-action--Color: var(--pf-global--Color--200);
|
|
554
|
-
--pf-c-app-launcher__menu-item--m-action--hover--Color: var(--pf-global--Color--100);
|
|
555
|
-
--pf-c-app-launcher__menu-item--m-action--disabled--Color: var(--pf-global--disabled-color--200);
|
|
556
|
-
--pf-c-app-launcher__menu-item--m-favorite__menu-item--m-action--Color: var(--pf-global--palette--gold-400);
|
|
557
|
-
--pf-c-app-launcher__menu-item--m-favorite__menu-item--m-action--hover--Color: var(--pf-global--palette--gold-500);
|
|
558
|
-
--pf-c-app-launcher__menu-item-icon--MarginRight: var(--pf-global--spacer--sm);
|
|
559
|
-
--pf-c-app-launcher__menu-item-icon--Width: var(--pf-global--icon--FontSize--lg);
|
|
560
|
-
--pf-c-app-launcher__menu-item-icon--Height: var(--pf-global--icon--FontSize--lg);
|
|
561
|
-
--pf-c-app-launcher__menu-item-external-icon--Color: var(--pf-global--link--Color);
|
|
562
|
-
--pf-c-app-launcher__menu-item-external-icon--PaddingLeft: var(--pf-global--spacer--md);
|
|
563
|
-
--pf-c-app-launcher__menu-item-external-icon--TranslateY: -0.0625rem;
|
|
564
|
-
--pf-c-app-launcher__menu-item-external-icon--FontSize: var(--pf-global--icon--FontSize--sm);
|
|
565
|
-
--pf-c-app-launcher__group--group--PaddingTop: var(--pf-global--spacer--sm);
|
|
566
|
-
--pf-c-app-launcher__group-title--PaddingTop: var(--pf-global--spacer--sm);
|
|
567
|
-
--pf-c-app-launcher__group-title--PaddingRight: var(--pf-c-app-launcher__menu-item--PaddingRight);
|
|
568
|
-
--pf-c-app-launcher__group-title--PaddingBottom: var(--pf-c-app-launcher__menu-item--PaddingBottom);
|
|
569
|
-
--pf-c-app-launcher__group-title--PaddingLeft: var(--pf-c-app-launcher__menu-item--PaddingLeft);
|
|
570
|
-
--pf-c-app-launcher__group-title--FontSize: var(--pf-global--FontSize--sm);
|
|
571
|
-
--pf-c-app-launcher__group-title--FontWeight: var(--pf-global--FontWeight--semi-bold);
|
|
572
|
-
--pf-c-app-launcher__group-title--Color: var(--pf-global--Color--dark-200);
|
|
573
|
-
--pf-c-app-launcher--c-divider--MarginTop: var(--pf-global--spacer--sm);
|
|
574
|
-
--pf-c-app-launcher--c-divider--MarginBottom: var(--pf-global--spacer--sm);
|
|
575
|
-
position: relative;
|
|
576
|
-
display: inline-block;
|
|
577
|
-
max-width: 100%;
|
|
578
|
-
}
|
|
579
|
-
|
|
580
|
-
.pf-c-app-launcher.pf-m-expanded > .pf-c-app-launcher__toggle {
|
|
581
|
-
color: var(--pf-c-app-launcher__toggle--m-expanded--Color);
|
|
582
|
-
}
|
|
583
|
-
|
|
584
|
-
.pf-c-app-launcher .pf-c-divider {
|
|
585
|
-
margin-top: var(--pf-c-app-launcher--c-divider--MarginTop);
|
|
586
|
-
margin-bottom: var(--pf-c-app-launcher--c-divider--MarginBottom);
|
|
587
|
-
}
|
|
588
|
-
|
|
589
|
-
.pf-c-app-launcher .pf-c-divider:last-child {
|
|
590
|
-
--pf-c-app-launcher--c-divider--MarginBottom: 0;
|
|
591
|
-
}
|
|
592
|
-
|
|
593
|
-
.pf-c-app-launcher__toggle {
|
|
594
|
-
padding: var(--pf-c-app-launcher__toggle--PaddingTop) var(--pf-c-app-launcher__toggle--PaddingRight) var(--pf-c-app-launcher__toggle--PaddingBottom) var(--pf-c-app-launcher__toggle--PaddingLeft);
|
|
595
|
-
color: var(--pf-c-app-launcher__toggle--Color);
|
|
596
|
-
border: none;
|
|
597
|
-
}
|
|
598
|
-
|
|
599
|
-
.pf-c-app-launcher__toggle:hover {
|
|
600
|
-
--pf-c-app-launcher__toggle--Color: var(--pf-c-app-launcher__toggle--hover--Color);
|
|
601
|
-
}
|
|
602
|
-
|
|
603
|
-
.pf-c-app-launcher__toggle:active, .pf-c-app-launcher__toggle.pf-m-active {
|
|
604
|
-
--pf-c-app-launcher__toggle--Color: var(--pf-c-app-launcher__toggle--active--Color);
|
|
605
|
-
}
|
|
606
|
-
|
|
607
|
-
.pf-c-app-launcher__toggle:focus {
|
|
608
|
-
--pf-c-app-launcher__toggle--Color: var(--pf-c-app-launcher__toggle--focus--Color);
|
|
609
|
-
}
|
|
610
|
-
|
|
611
|
-
.pf-c-app-launcher__toggle:disabled {
|
|
612
|
-
--pf-c-app-launcher__toggle--Color: var(--pf-c-app-launcher__toggle--disabled--Color);
|
|
613
|
-
pointer-events: none;
|
|
614
|
-
}
|
|
615
|
-
|
|
616
|
-
.pf-c-app-launcher__menu {
|
|
617
|
-
position: absolute;
|
|
618
|
-
top: var(--pf-c-app-launcher__menu--Top);
|
|
619
|
-
z-index: var(--pf-c-app-launcher__menu--ZIndex);
|
|
620
|
-
min-width: 100%;
|
|
621
|
-
padding-top: var(--pf-c-app-launcher__menu--PaddingTop);
|
|
622
|
-
padding-bottom: var(--pf-c-app-launcher__menu--PaddingBottom);
|
|
623
|
-
background-color: var(--pf-c-app-launcher__menu--BackgroundColor);
|
|
624
|
-
background-clip: padding-box;
|
|
625
|
-
box-shadow: var(--pf-c-app-launcher__menu--BoxShadow);
|
|
626
|
-
}
|
|
627
|
-
|
|
628
|
-
.pf-c-app-launcher__menu.pf-m-align-right {
|
|
629
|
-
right: 0;
|
|
630
|
-
}
|
|
631
|
-
|
|
632
|
-
.pf-c-app-launcher.pf-m-top .pf-c-app-launcher__menu {
|
|
633
|
-
--pf-c-app-launcher__menu--Top: var(--pf-c-app-launcher--m-top__menu--Top);
|
|
634
|
-
transform: translateY(var(--pf-c-app-launcher--m-top__menu--TranslateY));
|
|
635
|
-
}
|
|
636
|
-
|
|
637
|
-
.pf-c-app-launcher__menu-search {
|
|
638
|
-
padding: var(--pf-c-app-launcher__menu-search--PaddingTop) var(--pf-c-app-launcher__menu-search--PaddingRight) var(--pf-c-app-launcher__menu-search--PaddingBottom) var(--pf-c-app-launcher__menu-search--PaddingLeft);
|
|
639
|
-
margin-bottom: var(--pf-c-app-launcher__menu-search--MarginBottom);
|
|
640
|
-
border-bottom: var(--pf-c-app-launcher__menu-search--BottomBorderWidth) solid var(--pf-c-app-launcher__menu-search--BottomBorderColor);
|
|
641
|
-
}
|
|
642
|
-
|
|
643
|
-
.pf-c-app-launcher__menu-wrapper {
|
|
644
|
-
display: flex;
|
|
645
|
-
}
|
|
646
|
-
|
|
647
|
-
.pf-c-app-launcher__menu-wrapper.pf-m-favorite {
|
|
648
|
-
--pf-c-app-launcher__menu-item--m-action--Color: var(--pf-c-app-launcher__menu-item--m-favorite__menu-item--m-action--Color);
|
|
649
|
-
--pf-c-app-launcher__menu-item--m-action--hover--Color: var(--pf-c-app-launcher__menu-item--m-favorite__menu-item--m-action--hover--Color);
|
|
650
|
-
}
|
|
651
|
-
|
|
652
|
-
.pf-c-app-launcher__menu-item {
|
|
653
|
-
display: flex;
|
|
654
|
-
align-items: center;
|
|
655
|
-
width: var(--pf-c-app-launcher__menu-item--Width);
|
|
656
|
-
padding: var(--pf-c-app-launcher__menu-item--PaddingTop) var(--pf-c-app-launcher__menu-item--PaddingRight) var(--pf-c-app-launcher__menu-item--PaddingBottom) var(--pf-c-app-launcher__menu-item--PaddingLeft);
|
|
657
|
-
font-weight: var(--pf-c-app-launcher__menu-item--FontWeight);
|
|
658
|
-
color: var(--pf-c-app-launcher__menu-item--Color);
|
|
659
|
-
white-space: nowrap;
|
|
660
|
-
border: 0;
|
|
661
|
-
}
|
|
662
|
-
|
|
663
|
-
.pf-c-app-launcher__menu-item:hover, .pf-c-app-launcher__menu-item:focus {
|
|
664
|
-
--pf-c-app-launcher__menu-item--m-action--Color: var(--pf-c-app-launcher__menu-item--hover__menu-item--m-action--Color);
|
|
665
|
-
text-decoration: none;
|
|
666
|
-
}
|
|
667
|
-
|
|
668
|
-
.pf-c-app-launcher__menu-wrapper:hover,
|
|
669
|
-
.pf-c-app-launcher__menu-wrapper:focus-within,
|
|
670
|
-
.pf-c-app-launcher__menu-wrapper.pf-m-focus, .pf-c-app-launcher__menu-item:hover, .pf-c-app-launcher__menu-item:focus {
|
|
671
|
-
background-color: var(--pf-c-app-launcher__menu-item--hover--BackgroundColor);
|
|
672
|
-
}
|
|
673
|
-
|
|
674
|
-
.pf-c-app-launcher__menu-item:disabled, .pf-c-app-launcher__menu-item.pf-m-disabled {
|
|
675
|
-
--pf-c-app-launcher__menu-item--Color: var(--pf-c-app-launcher__menu-item--disabled--Color);
|
|
676
|
-
--pf-c-app-launcher__menu-item--m-action--Color: var(--pf-c-app-launcher__menu-item--m-action--disabled--Color);
|
|
677
|
-
pointer-events: none;
|
|
678
|
-
}
|
|
679
|
-
|
|
680
|
-
.pf-c-app-launcher__menu-wrapper:disabled, .pf-c-app-launcher__menu-wrapper.pf-m-disabled, .pf-c-app-launcher__menu-item:disabled, .pf-c-app-launcher__menu-item.pf-m-disabled {
|
|
681
|
-
background-color: transparent;
|
|
682
|
-
}
|
|
683
|
-
|
|
684
|
-
.pf-c-app-launcher__menu-wrapper.pf-m-external:hover .pf-c-app-launcher__menu-item-external-icon, .pf-c-app-launcher__menu-wrapper.pf-m-external:focus .pf-c-app-launcher__menu-item-external-icon, .pf-c-app-launcher__menu-item.pf-m-external:hover .pf-c-app-launcher__menu-item-external-icon, .pf-c-app-launcher__menu-item.pf-m-external:focus .pf-c-app-launcher__menu-item-external-icon {
|
|
685
|
-
opacity: 1;
|
|
686
|
-
}
|
|
687
|
-
|
|
688
|
-
.pf-c-app-launcher__menu-item.pf-m-link {
|
|
689
|
-
--pf-c-app-launcher__menu-item--PaddingRight: var(--pf-c-app-launcher__menu-item--m-link--PaddingRight);
|
|
690
|
-
--pf-c-app-launcher__menu-item--hover--BackgroundColor: var(--pf-c-app-launcher__menu-item--m-link--hover--BackgroundColor);
|
|
691
|
-
}
|
|
692
|
-
|
|
693
|
-
.pf-c-app-launcher__menu-item.pf-m-action {
|
|
694
|
-
--pf-c-app-launcher__menu-item--Color: var(--pf-c-app-launcher__menu-item--m-action--Color);
|
|
695
|
-
--pf-c-app-launcher__menu-item--Width: var(--pf-c-app-launcher__menu-item--m-action--Width);
|
|
696
|
-
--pf-c-app-launcher__menu-item--hover--BackgroundColor: var(--pf-c-app-launcher__menu-item--m-action--hover--BackgroundColor);
|
|
697
|
-
font-size: var(--pf-c-app-launcher__menu-item--m-action--FontSize);
|
|
698
|
-
}
|
|
699
|
-
|
|
700
|
-
.pf-c-app-launcher__menu-item.pf-m-action:hover, .pf-c-app-launcher__menu-item.pf-m-action:focus {
|
|
701
|
-
--pf-c-app-launcher__menu-item--m-action--Color: var(--pf-c-app-launcher__menu-item--m-action--hover--Color);
|
|
702
|
-
}
|
|
703
|
-
|
|
704
|
-
.pf-c-app-launcher__menu-item-icon {
|
|
705
|
-
display: inline-flex;
|
|
706
|
-
align-items: center;
|
|
707
|
-
justify-content: center;
|
|
708
|
-
width: var(--pf-c-app-launcher__menu-item-icon--Width);
|
|
709
|
-
height: var(--pf-c-app-launcher__menu-item-icon--Height);
|
|
710
|
-
margin-right: var(--pf-c-app-launcher__menu-item-icon--MarginRight);
|
|
711
|
-
}
|
|
712
|
-
|
|
713
|
-
.pf-c-app-launcher__menu-item-icon > * {
|
|
714
|
-
max-width: 100%;
|
|
715
|
-
max-height: 100%;
|
|
716
|
-
}
|
|
717
|
-
|
|
718
|
-
.pf-c-app-launcher__menu-item-external-icon {
|
|
719
|
-
padding-left: var(--pf-c-app-launcher__menu-item-external-icon--PaddingLeft);
|
|
720
|
-
margin-left: auto;
|
|
721
|
-
font-size: var(--pf-c-app-launcher__menu-item-external-icon--FontSize);
|
|
722
|
-
color: var(--pf-c-app-launcher__menu-item-external-icon--Color);
|
|
723
|
-
opacity: 0;
|
|
724
|
-
transform: translateY(var(--pf-c-app-launcher__menu-item-external-icon--TranslateY));
|
|
725
|
-
}
|
|
726
|
-
|
|
727
|
-
.pf-c-app-launcher__group + .pf-c-app-launcher__group {
|
|
728
|
-
padding-top: var(--pf-c-app-launcher__group--group--PaddingTop);
|
|
729
|
-
}
|
|
730
|
-
|
|
731
|
-
.pf-c-app-launcher__group-title {
|
|
732
|
-
padding-top: var(--pf-c-app-launcher__group-title--PaddingTop);
|
|
733
|
-
padding-right: var(--pf-c-app-launcher__group-title--PaddingRight);
|
|
734
|
-
padding-bottom: var(--pf-c-app-launcher__group-title--PaddingBottom);
|
|
735
|
-
padding-left: var(--pf-c-app-launcher__group-title--PaddingLeft);
|
|
736
|
-
font-size: var(--pf-c-app-launcher__group-title--FontSize);
|
|
737
|
-
font-weight: var(--pf-c-app-launcher__group-title--FontWeight);
|
|
738
|
-
color: var(--pf-c-app-launcher__group-title--Color);
|
|
739
|
-
}
|
|
740
|
-
|
|
741
512
|
.pf-c-form-control {
|
|
742
513
|
--pf-global--Color--100: var(--pf-global--Color--dark-100);
|
|
743
514
|
--pf-global--Color--200: var(--pf-global--Color--dark-200);
|
|
@@ -1076,6 +847,235 @@ textarea.pf-c-form-control {
|
|
|
1076
847
|
resize: horizontal;
|
|
1077
848
|
}
|
|
1078
849
|
|
|
850
|
+
.pf-c-app-launcher {
|
|
851
|
+
--pf-c-app-launcher__menu--BackgroundColor: var(--pf-global--BackgroundColor--light-100);
|
|
852
|
+
--pf-c-app-launcher__menu--BoxShadow: var(--pf-global--BoxShadow--md);
|
|
853
|
+
--pf-c-app-launcher__menu--PaddingTop: var(--pf-global--spacer--sm);
|
|
854
|
+
--pf-c-app-launcher__menu--PaddingBottom: var(--pf-global--spacer--sm);
|
|
855
|
+
--pf-c-app-launcher__menu--Top: calc(100% + var(--pf-global--spacer--xs));
|
|
856
|
+
--pf-c-app-launcher__menu--ZIndex: var(--pf-global--ZIndex--sm);
|
|
857
|
+
--pf-c-app-launcher--m-top__menu--Top: 0;
|
|
858
|
+
--pf-c-app-launcher--m-top__menu--TranslateY: calc(-100% - var(--pf-global--spacer--xs));
|
|
859
|
+
--pf-c-app-launcher__toggle--PaddingTop: var(--pf-global--spacer--form-element);
|
|
860
|
+
--pf-c-app-launcher__toggle--PaddingRight: var(--pf-global--spacer--md);
|
|
861
|
+
--pf-c-app-launcher__toggle--PaddingBottom: var(--pf-global--spacer--form-element);
|
|
862
|
+
--pf-c-app-launcher__toggle--PaddingLeft: var(--pf-global--spacer--md);
|
|
863
|
+
--pf-c-app-launcher__toggle--Color: var(--pf-global--Color--200);
|
|
864
|
+
--pf-c-app-launcher__toggle--hover--Color: var(--pf-global--Color--100);
|
|
865
|
+
--pf-c-app-launcher__toggle--active--Color: var(--pf-global--Color--100);
|
|
866
|
+
--pf-c-app-launcher__toggle--focus--Color: var(--pf-global--Color--100);
|
|
867
|
+
--pf-c-app-launcher__toggle--disabled--Color: var(--pf-global--disabled-color--200);
|
|
868
|
+
--pf-c-app-launcher__toggle--m-expanded--Color: var(--pf-global--Color--100);
|
|
869
|
+
--pf-c-app-launcher__menu-search--PaddingTop: var(--pf-global--spacer--sm);
|
|
870
|
+
--pf-c-app-launcher__menu-search--PaddingRight: var(--pf-global--spacer--md);
|
|
871
|
+
--pf-c-app-launcher__menu-search--PaddingBottom: var(--pf-global--spacer--md);
|
|
872
|
+
--pf-c-app-launcher__menu-search--PaddingLeft: var(--pf-global--spacer--md);
|
|
873
|
+
--pf-c-app-launcher__menu-search--BottomBorderColor: var(--pf-global--BorderColor--100);
|
|
874
|
+
--pf-c-app-launcher__menu-search--BottomBorderWidth: var(--pf-global--BorderWidth--sm);
|
|
875
|
+
--pf-c-app-launcher__menu-search--MarginBottom: var(--pf-global--spacer--sm);
|
|
876
|
+
--pf-c-app-launcher__menu-item--PaddingTop: var(--pf-global--spacer--sm);
|
|
877
|
+
--pf-c-app-launcher__menu-item--PaddingRight: var(--pf-global--spacer--md);
|
|
878
|
+
--pf-c-app-launcher__menu-item--PaddingBottom: var(--pf-global--spacer--sm);
|
|
879
|
+
--pf-c-app-launcher__menu-item--PaddingLeft: var(--pf-global--spacer--md);
|
|
880
|
+
--pf-c-app-launcher__menu-item--Color: var(--pf-global--Color--dark-100);
|
|
881
|
+
--pf-c-app-launcher__menu-item--FontWeight: var(--pf-global--FontWeight--normal);
|
|
882
|
+
--pf-c-app-launcher__menu-item--Width: 100%;
|
|
883
|
+
--pf-c-app-launcher__menu-item--disabled--Color: var(--pf-global--Color--dark-200);
|
|
884
|
+
--pf-c-app-launcher__menu-item--hover--BackgroundColor: var(--pf-global--BackgroundColor--light-300);
|
|
885
|
+
--pf-c-app-launcher__menu-item--m-link--PaddingRight: 0;
|
|
886
|
+
--pf-c-app-launcher__menu-item--m-link--hover--BackgroundColor: transparent;
|
|
887
|
+
--pf-c-app-launcher__menu-item--m-action--Color: var(--pf-global--Color--200);
|
|
888
|
+
--pf-c-app-launcher__menu-item--m-action--Width: auto;
|
|
889
|
+
--pf-c-app-launcher__menu-item--m-action--FontSize: var(--pf-global--icon--FontSize--sm);
|
|
890
|
+
--pf-c-app-launcher__menu-item--m-action--hover--BackgroundColor: transparent;
|
|
891
|
+
--pf-c-app-launcher__menu-item--hover__menu-item--m-action--Color: var(--pf-global--Color--200);
|
|
892
|
+
--pf-c-app-launcher__menu-item--m-action--hover--Color: var(--pf-global--Color--100);
|
|
893
|
+
--pf-c-app-launcher__menu-item--m-action--disabled--Color: var(--pf-global--disabled-color--200);
|
|
894
|
+
--pf-c-app-launcher__menu-item--m-favorite__menu-item--m-action--Color: var(--pf-global--palette--gold-400);
|
|
895
|
+
--pf-c-app-launcher__menu-item--m-favorite__menu-item--m-action--hover--Color: var(--pf-global--palette--gold-500);
|
|
896
|
+
--pf-c-app-launcher__menu-item-icon--MarginRight: var(--pf-global--spacer--sm);
|
|
897
|
+
--pf-c-app-launcher__menu-item-icon--Width: var(--pf-global--icon--FontSize--lg);
|
|
898
|
+
--pf-c-app-launcher__menu-item-icon--Height: var(--pf-global--icon--FontSize--lg);
|
|
899
|
+
--pf-c-app-launcher__menu-item-external-icon--Color: var(--pf-global--link--Color);
|
|
900
|
+
--pf-c-app-launcher__menu-item-external-icon--PaddingLeft: var(--pf-global--spacer--md);
|
|
901
|
+
--pf-c-app-launcher__menu-item-external-icon--TranslateY: -0.0625rem;
|
|
902
|
+
--pf-c-app-launcher__menu-item-external-icon--FontSize: var(--pf-global--icon--FontSize--sm);
|
|
903
|
+
--pf-c-app-launcher__group--group--PaddingTop: var(--pf-global--spacer--sm);
|
|
904
|
+
--pf-c-app-launcher__group-title--PaddingTop: var(--pf-global--spacer--sm);
|
|
905
|
+
--pf-c-app-launcher__group-title--PaddingRight: var(--pf-c-app-launcher__menu-item--PaddingRight);
|
|
906
|
+
--pf-c-app-launcher__group-title--PaddingBottom: var(--pf-c-app-launcher__menu-item--PaddingBottom);
|
|
907
|
+
--pf-c-app-launcher__group-title--PaddingLeft: var(--pf-c-app-launcher__menu-item--PaddingLeft);
|
|
908
|
+
--pf-c-app-launcher__group-title--FontSize: var(--pf-global--FontSize--sm);
|
|
909
|
+
--pf-c-app-launcher__group-title--FontWeight: var(--pf-global--FontWeight--semi-bold);
|
|
910
|
+
--pf-c-app-launcher__group-title--Color: var(--pf-global--Color--dark-200);
|
|
911
|
+
--pf-c-app-launcher--c-divider--MarginTop: var(--pf-global--spacer--sm);
|
|
912
|
+
--pf-c-app-launcher--c-divider--MarginBottom: var(--pf-global--spacer--sm);
|
|
913
|
+
position: relative;
|
|
914
|
+
display: inline-block;
|
|
915
|
+
max-width: 100%;
|
|
916
|
+
}
|
|
917
|
+
|
|
918
|
+
.pf-c-app-launcher.pf-m-expanded > .pf-c-app-launcher__toggle {
|
|
919
|
+
color: var(--pf-c-app-launcher__toggle--m-expanded--Color);
|
|
920
|
+
}
|
|
921
|
+
|
|
922
|
+
.pf-c-app-launcher .pf-c-divider {
|
|
923
|
+
margin-top: var(--pf-c-app-launcher--c-divider--MarginTop);
|
|
924
|
+
margin-bottom: var(--pf-c-app-launcher--c-divider--MarginBottom);
|
|
925
|
+
}
|
|
926
|
+
|
|
927
|
+
.pf-c-app-launcher .pf-c-divider:last-child {
|
|
928
|
+
--pf-c-app-launcher--c-divider--MarginBottom: 0;
|
|
929
|
+
}
|
|
930
|
+
|
|
931
|
+
.pf-c-app-launcher__toggle {
|
|
932
|
+
padding: var(--pf-c-app-launcher__toggle--PaddingTop) var(--pf-c-app-launcher__toggle--PaddingRight) var(--pf-c-app-launcher__toggle--PaddingBottom) var(--pf-c-app-launcher__toggle--PaddingLeft);
|
|
933
|
+
color: var(--pf-c-app-launcher__toggle--Color);
|
|
934
|
+
border: none;
|
|
935
|
+
}
|
|
936
|
+
|
|
937
|
+
.pf-c-app-launcher__toggle:hover {
|
|
938
|
+
--pf-c-app-launcher__toggle--Color: var(--pf-c-app-launcher__toggle--hover--Color);
|
|
939
|
+
}
|
|
940
|
+
|
|
941
|
+
.pf-c-app-launcher__toggle:active, .pf-c-app-launcher__toggle.pf-m-active {
|
|
942
|
+
--pf-c-app-launcher__toggle--Color: var(--pf-c-app-launcher__toggle--active--Color);
|
|
943
|
+
}
|
|
944
|
+
|
|
945
|
+
.pf-c-app-launcher__toggle:focus {
|
|
946
|
+
--pf-c-app-launcher__toggle--Color: var(--pf-c-app-launcher__toggle--focus--Color);
|
|
947
|
+
}
|
|
948
|
+
|
|
949
|
+
.pf-c-app-launcher__toggle:disabled {
|
|
950
|
+
--pf-c-app-launcher__toggle--Color: var(--pf-c-app-launcher__toggle--disabled--Color);
|
|
951
|
+
pointer-events: none;
|
|
952
|
+
}
|
|
953
|
+
|
|
954
|
+
.pf-c-app-launcher__menu {
|
|
955
|
+
position: absolute;
|
|
956
|
+
top: var(--pf-c-app-launcher__menu--Top);
|
|
957
|
+
z-index: var(--pf-c-app-launcher__menu--ZIndex);
|
|
958
|
+
min-width: 100%;
|
|
959
|
+
padding-top: var(--pf-c-app-launcher__menu--PaddingTop);
|
|
960
|
+
padding-bottom: var(--pf-c-app-launcher__menu--PaddingBottom);
|
|
961
|
+
background-color: var(--pf-c-app-launcher__menu--BackgroundColor);
|
|
962
|
+
background-clip: padding-box;
|
|
963
|
+
box-shadow: var(--pf-c-app-launcher__menu--BoxShadow);
|
|
964
|
+
}
|
|
965
|
+
|
|
966
|
+
.pf-c-app-launcher__menu.pf-m-align-right {
|
|
967
|
+
right: 0;
|
|
968
|
+
}
|
|
969
|
+
|
|
970
|
+
.pf-c-app-launcher.pf-m-top .pf-c-app-launcher__menu {
|
|
971
|
+
--pf-c-app-launcher__menu--Top: var(--pf-c-app-launcher--m-top__menu--Top);
|
|
972
|
+
transform: translateY(var(--pf-c-app-launcher--m-top__menu--TranslateY));
|
|
973
|
+
}
|
|
974
|
+
|
|
975
|
+
.pf-c-app-launcher__menu-search {
|
|
976
|
+
padding: var(--pf-c-app-launcher__menu-search--PaddingTop) var(--pf-c-app-launcher__menu-search--PaddingRight) var(--pf-c-app-launcher__menu-search--PaddingBottom) var(--pf-c-app-launcher__menu-search--PaddingLeft);
|
|
977
|
+
margin-bottom: var(--pf-c-app-launcher__menu-search--MarginBottom);
|
|
978
|
+
border-bottom: var(--pf-c-app-launcher__menu-search--BottomBorderWidth) solid var(--pf-c-app-launcher__menu-search--BottomBorderColor);
|
|
979
|
+
}
|
|
980
|
+
|
|
981
|
+
.pf-c-app-launcher__menu-wrapper {
|
|
982
|
+
display: flex;
|
|
983
|
+
}
|
|
984
|
+
|
|
985
|
+
.pf-c-app-launcher__menu-wrapper.pf-m-favorite {
|
|
986
|
+
--pf-c-app-launcher__menu-item--m-action--Color: var(--pf-c-app-launcher__menu-item--m-favorite__menu-item--m-action--Color);
|
|
987
|
+
--pf-c-app-launcher__menu-item--m-action--hover--Color: var(--pf-c-app-launcher__menu-item--m-favorite__menu-item--m-action--hover--Color);
|
|
988
|
+
}
|
|
989
|
+
|
|
990
|
+
.pf-c-app-launcher__menu-item {
|
|
991
|
+
display: flex;
|
|
992
|
+
align-items: center;
|
|
993
|
+
width: var(--pf-c-app-launcher__menu-item--Width);
|
|
994
|
+
padding: var(--pf-c-app-launcher__menu-item--PaddingTop) var(--pf-c-app-launcher__menu-item--PaddingRight) var(--pf-c-app-launcher__menu-item--PaddingBottom) var(--pf-c-app-launcher__menu-item--PaddingLeft);
|
|
995
|
+
font-weight: var(--pf-c-app-launcher__menu-item--FontWeight);
|
|
996
|
+
color: var(--pf-c-app-launcher__menu-item--Color);
|
|
997
|
+
white-space: nowrap;
|
|
998
|
+
border: 0;
|
|
999
|
+
}
|
|
1000
|
+
|
|
1001
|
+
.pf-c-app-launcher__menu-item:hover, .pf-c-app-launcher__menu-item:focus {
|
|
1002
|
+
--pf-c-app-launcher__menu-item--m-action--Color: var(--pf-c-app-launcher__menu-item--hover__menu-item--m-action--Color);
|
|
1003
|
+
text-decoration: none;
|
|
1004
|
+
}
|
|
1005
|
+
|
|
1006
|
+
.pf-c-app-launcher__menu-wrapper:hover,
|
|
1007
|
+
.pf-c-app-launcher__menu-wrapper:focus-within,
|
|
1008
|
+
.pf-c-app-launcher__menu-wrapper.pf-m-focus, .pf-c-app-launcher__menu-item:hover, .pf-c-app-launcher__menu-item:focus {
|
|
1009
|
+
background-color: var(--pf-c-app-launcher__menu-item--hover--BackgroundColor);
|
|
1010
|
+
}
|
|
1011
|
+
|
|
1012
|
+
.pf-c-app-launcher__menu-item:disabled, .pf-c-app-launcher__menu-item.pf-m-disabled {
|
|
1013
|
+
--pf-c-app-launcher__menu-item--Color: var(--pf-c-app-launcher__menu-item--disabled--Color);
|
|
1014
|
+
--pf-c-app-launcher__menu-item--m-action--Color: var(--pf-c-app-launcher__menu-item--m-action--disabled--Color);
|
|
1015
|
+
pointer-events: none;
|
|
1016
|
+
}
|
|
1017
|
+
|
|
1018
|
+
.pf-c-app-launcher__menu-wrapper:disabled, .pf-c-app-launcher__menu-wrapper.pf-m-disabled, .pf-c-app-launcher__menu-item:disabled, .pf-c-app-launcher__menu-item.pf-m-disabled {
|
|
1019
|
+
background-color: transparent;
|
|
1020
|
+
}
|
|
1021
|
+
|
|
1022
|
+
.pf-c-app-launcher__menu-wrapper.pf-m-external:hover .pf-c-app-launcher__menu-item-external-icon, .pf-c-app-launcher__menu-wrapper.pf-m-external:focus .pf-c-app-launcher__menu-item-external-icon, .pf-c-app-launcher__menu-item.pf-m-external:hover .pf-c-app-launcher__menu-item-external-icon, .pf-c-app-launcher__menu-item.pf-m-external:focus .pf-c-app-launcher__menu-item-external-icon {
|
|
1023
|
+
opacity: 1;
|
|
1024
|
+
}
|
|
1025
|
+
|
|
1026
|
+
.pf-c-app-launcher__menu-item.pf-m-link {
|
|
1027
|
+
--pf-c-app-launcher__menu-item--PaddingRight: var(--pf-c-app-launcher__menu-item--m-link--PaddingRight);
|
|
1028
|
+
--pf-c-app-launcher__menu-item--hover--BackgroundColor: var(--pf-c-app-launcher__menu-item--m-link--hover--BackgroundColor);
|
|
1029
|
+
}
|
|
1030
|
+
|
|
1031
|
+
.pf-c-app-launcher__menu-item.pf-m-action {
|
|
1032
|
+
--pf-c-app-launcher__menu-item--Color: var(--pf-c-app-launcher__menu-item--m-action--Color);
|
|
1033
|
+
--pf-c-app-launcher__menu-item--Width: var(--pf-c-app-launcher__menu-item--m-action--Width);
|
|
1034
|
+
--pf-c-app-launcher__menu-item--hover--BackgroundColor: var(--pf-c-app-launcher__menu-item--m-action--hover--BackgroundColor);
|
|
1035
|
+
font-size: var(--pf-c-app-launcher__menu-item--m-action--FontSize);
|
|
1036
|
+
}
|
|
1037
|
+
|
|
1038
|
+
.pf-c-app-launcher__menu-item.pf-m-action:hover, .pf-c-app-launcher__menu-item.pf-m-action:focus {
|
|
1039
|
+
--pf-c-app-launcher__menu-item--m-action--Color: var(--pf-c-app-launcher__menu-item--m-action--hover--Color);
|
|
1040
|
+
}
|
|
1041
|
+
|
|
1042
|
+
.pf-c-app-launcher__menu-item-icon {
|
|
1043
|
+
display: inline-flex;
|
|
1044
|
+
align-items: center;
|
|
1045
|
+
justify-content: center;
|
|
1046
|
+
width: var(--pf-c-app-launcher__menu-item-icon--Width);
|
|
1047
|
+
height: var(--pf-c-app-launcher__menu-item-icon--Height);
|
|
1048
|
+
margin-right: var(--pf-c-app-launcher__menu-item-icon--MarginRight);
|
|
1049
|
+
}
|
|
1050
|
+
|
|
1051
|
+
.pf-c-app-launcher__menu-item-icon > * {
|
|
1052
|
+
max-width: 100%;
|
|
1053
|
+
max-height: 100%;
|
|
1054
|
+
}
|
|
1055
|
+
|
|
1056
|
+
.pf-c-app-launcher__menu-item-external-icon {
|
|
1057
|
+
padding-left: var(--pf-c-app-launcher__menu-item-external-icon--PaddingLeft);
|
|
1058
|
+
margin-left: auto;
|
|
1059
|
+
font-size: var(--pf-c-app-launcher__menu-item-external-icon--FontSize);
|
|
1060
|
+
color: var(--pf-c-app-launcher__menu-item-external-icon--Color);
|
|
1061
|
+
opacity: 0;
|
|
1062
|
+
transform: translateY(var(--pf-c-app-launcher__menu-item-external-icon--TranslateY));
|
|
1063
|
+
}
|
|
1064
|
+
|
|
1065
|
+
.pf-c-app-launcher__group + .pf-c-app-launcher__group {
|
|
1066
|
+
padding-top: var(--pf-c-app-launcher__group--group--PaddingTop);
|
|
1067
|
+
}
|
|
1068
|
+
|
|
1069
|
+
.pf-c-app-launcher__group-title {
|
|
1070
|
+
padding-top: var(--pf-c-app-launcher__group-title--PaddingTop);
|
|
1071
|
+
padding-right: var(--pf-c-app-launcher__group-title--PaddingRight);
|
|
1072
|
+
padding-bottom: var(--pf-c-app-launcher__group-title--PaddingBottom);
|
|
1073
|
+
padding-left: var(--pf-c-app-launcher__group-title--PaddingLeft);
|
|
1074
|
+
font-size: var(--pf-c-app-launcher__group-title--FontSize);
|
|
1075
|
+
font-weight: var(--pf-c-app-launcher__group-title--FontWeight);
|
|
1076
|
+
color: var(--pf-c-app-launcher__group-title--Color);
|
|
1077
|
+
}
|
|
1078
|
+
|
|
1079
1079
|
.pf-u-screen-reader {
|
|
1080
1080
|
position: fixed;
|
|
1081
1081
|
top: 0;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@patternfly/react-core",
|
|
3
|
-
"version": "4.202.
|
|
3
|
+
"version": "4.202.5",
|
|
4
4
|
"description": "This library provides a set of common React components for use with the PatternFly reference implementation.",
|
|
5
5
|
"main": "dist/js/index.js",
|
|
6
6
|
"module": "dist/esm/index.js",
|
|
@@ -34,16 +34,16 @@
|
|
|
34
34
|
"generate": "node scripts/copyStyles.js"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@patternfly/react-icons": "^4.53.
|
|
38
|
-
"@patternfly/react-styles": "^4.52.
|
|
39
|
-
"@patternfly/react-tokens": "^4.54.
|
|
37
|
+
"@patternfly/react-icons": "^4.53.5",
|
|
38
|
+
"@patternfly/react-styles": "^4.52.5",
|
|
39
|
+
"@patternfly/react-tokens": "^4.54.5",
|
|
40
40
|
"focus-trap": "6.2.2",
|
|
41
41
|
"react-dropzone": "9.0.0",
|
|
42
42
|
"tippy.js": "5.1.2",
|
|
43
43
|
"tslib": "^2.0.0"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
|
-
"@patternfly/patternfly": "4.184.
|
|
46
|
+
"@patternfly/patternfly": "4.184.3",
|
|
47
47
|
"@rollup/plugin-commonjs": "^21.0.0",
|
|
48
48
|
"@rollup/plugin-node-resolve": "^13.0.0",
|
|
49
49
|
"@rollup/plugin-replace": "^3.0.0",
|
|
@@ -60,5 +60,5 @@
|
|
|
60
60
|
"react": "^16.8.0 || ^17.0.0",
|
|
61
61
|
"react-dom": "^16.8.0 || ^17.0.0"
|
|
62
62
|
},
|
|
63
|
-
"gitHead": "
|
|
63
|
+
"gitHead": "8f1429e189f96d539e5c6bffe4b8e07976efdf1e"
|
|
64
64
|
}
|
|
@@ -444,11 +444,7 @@ const SecondaryDropdown = () => {
|
|
|
444
444
|
onFocus();
|
|
445
445
|
}}
|
|
446
446
|
toggle={
|
|
447
|
-
<DropdownToggle
|
|
448
|
-
onToggle={next => setIsOpen(next)}
|
|
449
|
-
toggleIndicator={CaretDownIcon}
|
|
450
|
-
id="toggle-id-plain-text"
|
|
451
|
-
>
|
|
447
|
+
<DropdownToggle onToggle={next => setIsOpen(next)} toggleIndicator={CaretDownIcon} id="toggle-id-plain-text">
|
|
452
448
|
Dropdown
|
|
453
449
|
</DropdownToggle>
|
|
454
450
|
}
|
|
@@ -1489,53 +1485,95 @@ class ImageTextDropdown extends React.Component {
|
|
|
1489
1485
|
}
|
|
1490
1486
|
```
|
|
1491
1487
|
|
|
1492
|
-
###
|
|
1488
|
+
### Appending document body vs parent
|
|
1489
|
+
|
|
1490
|
+
Avoid passing in `document.body` when passing a value to the `menuAppendTo` prop on the Dropdown component, as it can cause accessibility issues. These issues can include, but are not limited to, being unable to enter the contents of the Dropdown options via assistive technologies (like keyboards or screen readers).
|
|
1491
|
+
|
|
1492
|
+
Instead append to `"parent"` to achieve the same result without sacrificing accessibility.
|
|
1493
|
+
|
|
1494
|
+
In this example, while, after making a selection, both variants retain focus on their respective Dropdown component, the options for the `document.body` variant cannot be navigated to via Voice Over.
|
|
1493
1495
|
|
|
1494
1496
|
```js
|
|
1495
1497
|
import React from 'react';
|
|
1496
|
-
import { Dropdown, DropdownToggle, DropdownItem } from '@patternfly/react-core';
|
|
1498
|
+
import { Dropdown, DropdownToggle, DropdownItem, Flex } from '@patternfly/react-core';
|
|
1497
1499
|
import CaretDownIcon from '@patternfly/react-icons/dist/esm/icons/caret-down-icon';
|
|
1498
1500
|
|
|
1499
|
-
class
|
|
1501
|
+
class DropdownDocumentBodyVsParent extends React.Component {
|
|
1500
1502
|
constructor(props) {
|
|
1501
1503
|
super(props);
|
|
1502
1504
|
this.state = {
|
|
1503
|
-
|
|
1505
|
+
isBodyOpen: false,
|
|
1506
|
+
isParentOpen: false
|
|
1504
1507
|
};
|
|
1505
|
-
this.
|
|
1508
|
+
this.onBodyToggle = isBodyOpen => {
|
|
1506
1509
|
this.setState({
|
|
1507
|
-
|
|
1510
|
+
isBodyOpen
|
|
1508
1511
|
});
|
|
1509
1512
|
};
|
|
1510
|
-
this.
|
|
1513
|
+
this.onBodySelect = event => {
|
|
1511
1514
|
this.setState({
|
|
1512
|
-
|
|
1515
|
+
isBodyOpen: !this.state.isBodyOpen
|
|
1513
1516
|
});
|
|
1514
|
-
this.
|
|
1517
|
+
this.onBodyFocus();
|
|
1515
1518
|
};
|
|
1516
|
-
this.
|
|
1517
|
-
const element = document.getElementById('toggle-id-
|
|
1519
|
+
this.onBodyFocus = () => {
|
|
1520
|
+
const element = document.getElementById('toggle-id-document-body');
|
|
1521
|
+
element.focus();
|
|
1522
|
+
};
|
|
1523
|
+
|
|
1524
|
+
this.onParentToggle = isParentOpen => {
|
|
1525
|
+
this.setState({
|
|
1526
|
+
isParentOpen
|
|
1527
|
+
});
|
|
1528
|
+
};
|
|
1529
|
+
this.onParentSelect = event => {
|
|
1530
|
+
this.setState({
|
|
1531
|
+
isParentOpen: !this.state.isParentOpen
|
|
1532
|
+
});
|
|
1533
|
+
this.onParentFocus();
|
|
1534
|
+
};
|
|
1535
|
+
this.onParentFocus = () => {
|
|
1536
|
+
const element = document.getElementById('toggle-id-parent');
|
|
1518
1537
|
element.focus();
|
|
1519
1538
|
};
|
|
1520
1539
|
}
|
|
1521
1540
|
|
|
1522
1541
|
render() {
|
|
1523
|
-
const {
|
|
1524
|
-
const dropdownItems = [
|
|
1542
|
+
const { isBodyOpen, isParentOpen } = this.state;
|
|
1543
|
+
const dropdownItems = [
|
|
1544
|
+
<DropdownItem key="link">Link</DropdownItem>,
|
|
1545
|
+
<DropdownItem key="action" component="button">
|
|
1546
|
+
Action
|
|
1547
|
+
</DropdownItem>,
|
|
1548
|
+
<DropdownItem key="disabled link" isDisabled href="www.google.com">
|
|
1549
|
+
Disabled link
|
|
1550
|
+
</DropdownItem>
|
|
1551
|
+
];
|
|
1525
1552
|
return (
|
|
1526
|
-
<
|
|
1553
|
+
<Flex>
|
|
1527
1554
|
<Dropdown
|
|
1528
|
-
onSelect={this.
|
|
1555
|
+
onSelect={this.onBodySelect}
|
|
1529
1556
|
toggle={
|
|
1530
|
-
<DropdownToggle id="toggle-id-
|
|
1531
|
-
Dropdown
|
|
1557
|
+
<DropdownToggle id="toggle-id-document-body" onToggle={this.onBodyToggle} toggleIndicator={CaretDownIcon}>
|
|
1558
|
+
Dropdown - Document Body
|
|
1532
1559
|
</DropdownToggle>
|
|
1533
1560
|
}
|
|
1534
|
-
isOpen={
|
|
1561
|
+
isOpen={isBodyOpen}
|
|
1535
1562
|
dropdownItems={dropdownItems}
|
|
1536
1563
|
menuAppendTo={() => document.body}
|
|
1537
1564
|
/>
|
|
1538
|
-
|
|
1565
|
+
<Dropdown
|
|
1566
|
+
onSelect={this.onParentSelect}
|
|
1567
|
+
toggle={
|
|
1568
|
+
<DropdownToggle id="toggle-id-parent" onToggle={this.onParentToggle} toggleIndicator={CaretDownIcon}>
|
|
1569
|
+
Dropdown - Parent
|
|
1570
|
+
</DropdownToggle>
|
|
1571
|
+
}
|
|
1572
|
+
isOpen={isParentOpen}
|
|
1573
|
+
dropdownItems={dropdownItems}
|
|
1574
|
+
menuAppendTo="parent"
|
|
1575
|
+
/>
|
|
1576
|
+
</Flex>
|
|
1539
1577
|
);
|
|
1540
1578
|
}
|
|
1541
1579
|
}
|
|
@@ -2210,79 +2210,122 @@ class SingleSelectInput extends React.Component {
|
|
|
2210
2210
|
}
|
|
2211
2211
|
```
|
|
2212
2212
|
|
|
2213
|
-
###
|
|
2213
|
+
### Appending document body vs parent
|
|
2214
|
+
|
|
2215
|
+
Avoid passing in `document.body` when passing a value to the `menuAppendTo` prop on the Select component, as it can cause accessibility issues. These issues can include, but are not limited to, being unable to enter the contents of the Select options via assistive technologies (like keyboards or screen readers).
|
|
2216
|
+
|
|
2217
|
+
Instead append to `"parent"` to achieve the same result without sacrificing accessibility.
|
|
2218
|
+
|
|
2219
|
+
In this example, while, when the dropdown is opened, both Select variants handle focus management within their dropdown contents the same way, you'll notice a difference when you try pressing the Tab key after selecting an option.
|
|
2220
|
+
|
|
2221
|
+
For the `document.body` variant, the focus will be placed at the end of the page, since that is where the dropdown content is appended to in the DOM (rather than focus being placed on the second Select variant as one might expect). For the `"parent"` variant, however, the focus will be placed on the next tab-able element (the "Toggle JS code" button for the code editor in this case).
|
|
2214
2222
|
|
|
2215
2223
|
```js
|
|
2216
2224
|
import React from 'react';
|
|
2217
|
-
import { Select, SelectOption,
|
|
2225
|
+
import { Select, SelectOption, Flex, FlexItem } from '@patternfly/react-core';
|
|
2218
2226
|
|
|
2219
|
-
class
|
|
2227
|
+
class SelectDocumentBodyVsParent extends React.Component {
|
|
2220
2228
|
constructor(props) {
|
|
2221
2229
|
super(props);
|
|
2230
|
+
this.bodyOptions = [
|
|
2231
|
+
<SelectOption key={0} value="Select a title - document body" isPlaceholder />,
|
|
2232
|
+
<SelectOption key={1} value="Mr" />,
|
|
2233
|
+
<SelectOption key={2} value="Miss" />,
|
|
2234
|
+
<SelectOption key={3} value="Mrs" />,
|
|
2235
|
+
<SelectOption key={4} value="Ms" />,
|
|
2236
|
+
<SelectOption key={6} value="Dr" />,
|
|
2237
|
+
<SelectOption key={7} value="Other" />
|
|
2238
|
+
];
|
|
2239
|
+
|
|
2240
|
+
this.parentOptions = [
|
|
2241
|
+
<SelectOption key={0} value="Select a title - parent" isPlaceholder />,
|
|
2242
|
+
<SelectOption key={1} value="Mr" />,
|
|
2243
|
+
<SelectOption key={2} value="Miss" />,
|
|
2244
|
+
<SelectOption key={3} value="Mrs" />,
|
|
2245
|
+
<SelectOption key={4} value="Ms" />,
|
|
2246
|
+
<SelectOption key={6} value="Dr" />,
|
|
2247
|
+
<SelectOption key={7} value="Other" />
|
|
2248
|
+
];
|
|
2222
2249
|
|
|
2223
2250
|
this.state = {
|
|
2224
|
-
|
|
2225
|
-
|
|
2251
|
+
isBodyOpen: false,
|
|
2252
|
+
isParentOpen: false,
|
|
2253
|
+
bodySelected: null,
|
|
2254
|
+
parentSelected: null
|
|
2226
2255
|
};
|
|
2227
2256
|
|
|
2228
|
-
this.
|
|
2257
|
+
this.onBodyToggle = isBodyOpen => {
|
|
2229
2258
|
this.setState({
|
|
2230
|
-
|
|
2259
|
+
isBodyOpen
|
|
2231
2260
|
});
|
|
2232
2261
|
};
|
|
2233
2262
|
|
|
2234
|
-
this.
|
|
2235
|
-
|
|
2236
|
-
|
|
2237
|
-
|
|
2238
|
-
|
|
2239
|
-
|
|
2240
|
-
|
|
2241
|
-
|
|
2242
|
-
|
|
2243
|
-
|
|
2244
|
-
|
|
2245
|
-
|
|
2263
|
+
this.onParentToggle = isParentOpen => {
|
|
2264
|
+
this.setState({
|
|
2265
|
+
isParentOpen
|
|
2266
|
+
});
|
|
2267
|
+
};
|
|
2268
|
+
|
|
2269
|
+
this.onBodySelect = (event, selection, isPlaceholder) => {
|
|
2270
|
+
if (isPlaceholder) this.clearSelection();
|
|
2271
|
+
else {
|
|
2272
|
+
this.setState({
|
|
2273
|
+
bodySelected: selection,
|
|
2274
|
+
isBodyOpen: false
|
|
2275
|
+
});
|
|
2276
|
+
console.log('selected on document body:', selection);
|
|
2277
|
+
}
|
|
2278
|
+
};
|
|
2279
|
+
|
|
2280
|
+
this.onParentSelect = (event, selection, isPlaceholder) => {
|
|
2281
|
+
if (isPlaceholder) this.clearSelection();
|
|
2282
|
+
else {
|
|
2283
|
+
this.setState({
|
|
2284
|
+
parentSelected: selection,
|
|
2285
|
+
isParentOpen: false
|
|
2286
|
+
});
|
|
2287
|
+
console.log('selected on parent:', selection);
|
|
2246
2288
|
}
|
|
2247
2289
|
};
|
|
2248
2290
|
|
|
2249
2291
|
this.clearSelection = () => {
|
|
2250
2292
|
this.setState({
|
|
2251
|
-
selected:
|
|
2293
|
+
selected: null,
|
|
2294
|
+
isOpen: false
|
|
2252
2295
|
});
|
|
2253
2296
|
};
|
|
2254
|
-
|
|
2255
|
-
this.options = [
|
|
2256
|
-
<SelectOption key={0} value="Debug" />,
|
|
2257
|
-
<SelectOption key={1} value="Info" />,
|
|
2258
|
-
<SelectOption key={2} value="Warn" />,
|
|
2259
|
-
<SelectOption key={3} value="Error" />
|
|
2260
|
-
];
|
|
2261
2297
|
}
|
|
2262
2298
|
|
|
2263
2299
|
render() {
|
|
2264
|
-
const {
|
|
2265
|
-
|
|
2300
|
+
const { isBodyOpen, isParentOpen, bodySelected, parentSelected } = this.state;
|
|
2301
|
+
|
|
2266
2302
|
return (
|
|
2267
|
-
<
|
|
2268
|
-
<
|
|
2269
|
-
|
|
2270
|
-
|
|
2271
|
-
|
|
2272
|
-
|
|
2273
|
-
|
|
2274
|
-
|
|
2275
|
-
|
|
2276
|
-
|
|
2277
|
-
|
|
2278
|
-
|
|
2279
|
-
|
|
2280
|
-
|
|
2281
|
-
|
|
2282
|
-
|
|
2283
|
-
|
|
2284
|
-
|
|
2285
|
-
|
|
2303
|
+
<Flex space={{ default: 'spacerMd' }} direction={{ default: 'column' }}>
|
|
2304
|
+
<FlexItem>
|
|
2305
|
+
<Select
|
|
2306
|
+
aria-label="Select Input for Document Body"
|
|
2307
|
+
onToggle={this.onBodyToggle}
|
|
2308
|
+
onSelect={this.onBodySelect}
|
|
2309
|
+
selections={bodySelected}
|
|
2310
|
+
isOpen={isBodyOpen}
|
|
2311
|
+
menuAppendTo={() => document.body}
|
|
2312
|
+
>
|
|
2313
|
+
{this.bodyOptions}
|
|
2314
|
+
</Select>
|
|
2315
|
+
</FlexItem>
|
|
2316
|
+
<FlexItem>
|
|
2317
|
+
<Select
|
|
2318
|
+
aria-label="Select Input for Parent"
|
|
2319
|
+
onToggle={this.onParentToggle}
|
|
2320
|
+
onSelect={this.onParentSelect}
|
|
2321
|
+
selections={parentSelected}
|
|
2322
|
+
isOpen={isParentOpen}
|
|
2323
|
+
menuAppendTo="parent"
|
|
2324
|
+
>
|
|
2325
|
+
{this.parentOptions}
|
|
2326
|
+
</Select>
|
|
2327
|
+
</FlexItem>
|
|
2328
|
+
</Flex>
|
|
2286
2329
|
);
|
|
2287
2330
|
}
|
|
2288
2331
|
}
|