playbook_ui 12.35.0 → 12.36.0.pre.alpha.PLAY942collapsiblenav21035
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/pb_kits/playbook/index.js +2 -1
- data/app/pb_kits/playbook/pb_collapsible/_collapsible.tsx +15 -13
- data/app/pb_kits/playbook/pb_collapsible/child_kits/CollapsibleMain.tsx +24 -8
- data/app/pb_kits/playbook/pb_collapsible/collapsible_main.html.erb +1 -1
- data/app/pb_kits/playbook/pb_collapsible/docs/_collapsible_icons.jsx +15 -4
- data/app/pb_kits/playbook/pb_collapsible/docs/example.yml +2 -2
- data/app/pb_kits/playbook/pb_collapsible/useCollapsible.tsx +14 -0
- data/app/pb_kits/playbook/pb_dialog/dialogHelper.js +7 -3
- data/app/pb_kits/playbook/pb_nav/_collapsible_nav.scss +22 -1
- data/app/pb_kits/playbook/pb_nav/_item.tsx +26 -2
- data/app/pb_kits/playbook/pb_nav/docs/_collapsible_nav.jsx +59 -79
- data/app/pb_kits/playbook/pb_nav/docs/_collapsible_nav_custom_icons.jsx +4 -6
- data/app/pb_kits/playbook/pb_nav/docs/example.yml +2 -2
- data/app/pb_kits/playbook/pb_nav/item.rb +5 -1
- data/app/pb_kits/playbook/pb_popover/_popover.tsx +14 -6
- data/app/pb_kits/playbook/pb_popover/docs/_popover_close.jsx +2 -0
- data/app/pb_kits/playbook/pb_popover/index.ts +5 -2
- data/dist/playbook-rails.js +7 -7
- data/lib/playbook/version.rb +2 -2
- metadata +8 -7
@@ -24,6 +24,7 @@ const PopoverClose = (props) => {
|
|
24
24
|
|
25
25
|
const handleOutsideTogglePopover = () => {
|
26
26
|
setOutsideShowPopover(!showOutsidePopover)
|
27
|
+
setAnyShowPopover(false)
|
27
28
|
}
|
28
29
|
|
29
30
|
const handleAnyShouldClosePopover = (shouldClosePopover) => {
|
@@ -32,6 +33,7 @@ const PopoverClose = (props) => {
|
|
32
33
|
|
33
34
|
const handleAnyTogglePopover = () => {
|
34
35
|
setAnyShowPopover(!showAnyPopover)
|
36
|
+
setOutsideShowPopover(false)
|
35
37
|
}
|
36
38
|
|
37
39
|
const insidePopoverTrigger = (
|
@@ -49,13 +49,16 @@ export default class PbPopover extends PbEnhancedElement {
|
|
49
49
|
checkCloseTooltip() {
|
50
50
|
document.querySelector('body').addEventListener('click', ({ target } ) => {
|
51
51
|
const isTooltipElement = (target as HTMLElement).closest(`#${this.tooltipId}`) !== null
|
52
|
+
const isTriggerElement = (target as HTMLElement).closest(`#${this.triggerElementId}`) !== null
|
52
53
|
|
53
54
|
switch (this.closeOnClick) {
|
54
55
|
case 'any':
|
55
|
-
|
56
|
+
if (isTooltipElement || !isTooltipElement && !isTriggerElement) {
|
57
|
+
this.hideTooltip()
|
58
|
+
}
|
56
59
|
break
|
57
60
|
case 'outside':
|
58
|
-
if (!isTooltipElement) {
|
61
|
+
if (!isTooltipElement && !isTriggerElement) {
|
59
62
|
this.hideTooltip()
|
60
63
|
}
|
61
64
|
break
|