udp-stencil-component-library 26.9.0-beta.22 → 26.9.0-beta.24
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/cjs/ag-grid-base_66.cjs.entry.js +84 -2
- package/dist/collection/components/fluent-ui/tooltip/udp-tooltip.js +84 -2
- package/dist/components/udp-tooltip2.js +1 -1
- package/dist/docs.json +1 -1
- package/dist/esm/ag-grid-base_66.entry.js +84 -2
- package/dist/stencil-library/ag-grid-base_66.entry.js +1 -1
- package/dist/types/components/fluent-ui/tooltip/udp-tooltip.d.ts +35 -0
- package/package.json +1 -1
|
@@ -12739,6 +12739,11 @@ const udpTooltipCss = () => `:host{display:inline-flex;align-items:center;vertic
|
|
|
12739
12739
|
const UdpTooltip = class {
|
|
12740
12740
|
constructor(hostRef) {
|
|
12741
12741
|
index.registerInstance(this, hostRef);
|
|
12742
|
+
/**
|
|
12743
|
+
* The event path of the latest `pointerover` or `focusin` inside the anchor.
|
|
12744
|
+
* Read by `isOverOpenPopup()` when the tooltip is about to open.
|
|
12745
|
+
*/
|
|
12746
|
+
this.lastPath = [];
|
|
12742
12747
|
/**
|
|
12743
12748
|
* The delay of the tooltip.
|
|
12744
12749
|
*/
|
|
@@ -12747,17 +12752,94 @@ const UdpTooltip = class {
|
|
|
12747
12752
|
* The positioning of the tooltip.
|
|
12748
12753
|
*/
|
|
12749
12754
|
this.positioning = 'above';
|
|
12755
|
+
/**
|
|
12756
|
+
* Cancels the tooltip's opening while it would cover its own trigger's open menu or popover.
|
|
12757
|
+
*
|
|
12758
|
+
* @param e - The `beforetoggle` event from the inner Fluent tooltip. Only opening is cancelable.
|
|
12759
|
+
*/
|
|
12760
|
+
this.handleBeforeToggle = (e) => {
|
|
12761
|
+
if (e.newState === 'open' && this.isOverOpenPopup()) {
|
|
12762
|
+
e.preventDefault();
|
|
12763
|
+
}
|
|
12764
|
+
};
|
|
12765
|
+
/**
|
|
12766
|
+
* Hides the open tooltip on Escape, wherever focus or the pointer is.
|
|
12767
|
+
* Browsers without popover="hint" fall back to "manual", which has no built-in Escape dismissal.
|
|
12768
|
+
* preventDefault stops the same Escape from also closing a popover or dialog underneath.
|
|
12769
|
+
*
|
|
12770
|
+
* @param e - A `keydown` on the document while the tooltip is open.
|
|
12771
|
+
*/
|
|
12772
|
+
this.handleEscape = (e) => {
|
|
12773
|
+
var _a;
|
|
12774
|
+
if (e.key !== 'Escape' || !((_a = this.tooltipRef) === null || _a === void 0 ? void 0 : _a.matches(':popover-open')))
|
|
12775
|
+
return;
|
|
12776
|
+
e.preventDefault();
|
|
12777
|
+
// Not hideTooltip(): Fluent keeps re-queuing that while the anchor is hovered.
|
|
12778
|
+
this.tooltipRef.setAttribute('aria-hidden', 'true');
|
|
12779
|
+
this.tooltipRef.hidePopover();
|
|
12780
|
+
};
|
|
12781
|
+
/**
|
|
12782
|
+
* Listens for Escape only while the tooltip is open.
|
|
12783
|
+
*
|
|
12784
|
+
* @param e - The `toggle` event from the inner Fluent tooltip.
|
|
12785
|
+
*/
|
|
12786
|
+
this.handleToggle = (e) => {
|
|
12787
|
+
if (e.newState === 'open') {
|
|
12788
|
+
document.addEventListener('keydown', this.handleEscape, true);
|
|
12789
|
+
}
|
|
12790
|
+
else {
|
|
12791
|
+
document.removeEventListener('keydown', this.handleEscape, true);
|
|
12792
|
+
}
|
|
12793
|
+
};
|
|
12794
|
+
}
|
|
12795
|
+
/**
|
|
12796
|
+
* Whether the tooltip would cover a menu or popover that its own trigger has open,
|
|
12797
|
+
* judged from the elements under the pointer or focus (`lastPath`).
|
|
12798
|
+
*
|
|
12799
|
+
* @returns `true` when the tooltip should stay hidden.
|
|
12800
|
+
*/
|
|
12801
|
+
isOverOpenPopup() {
|
|
12802
|
+
const anchorIndex = this.lastPath.indexOf(this.anchorRef);
|
|
12803
|
+
return this.lastPath.some((node, i) => {
|
|
12804
|
+
var _a, _b;
|
|
12805
|
+
if (!(node instanceof Element))
|
|
12806
|
+
return false;
|
|
12807
|
+
// Trigger of an open menu (fluent-menu sets both on its trigger)
|
|
12808
|
+
const hasPopup = ((_a = node.getAttribute('aria-haspopup')) !== null && _a !== void 0 ? _a : 'false') !== 'false';
|
|
12809
|
+
if (hasPopup && node.getAttribute('aria-expanded') === 'true')
|
|
12810
|
+
return true;
|
|
12811
|
+
// Trigger of an open udp-popover
|
|
12812
|
+
if (node instanceof HTMLSlotElement &&
|
|
12813
|
+
node.name === 'trigger' &&
|
|
12814
|
+
((_b = node.getRootNode().host) === null || _b === void 0 ? void 0 : _b.matches('udp-popover[open]'))) {
|
|
12815
|
+
return true;
|
|
12816
|
+
}
|
|
12817
|
+
// Open popup inside the anchor, e.g. the list of a wrapped menu.
|
|
12818
|
+
// Only inside, so tooltips within an open popover's content still show.
|
|
12819
|
+
return i < anchorIndex && node.matches(':popover-open');
|
|
12820
|
+
});
|
|
12821
|
+
}
|
|
12822
|
+
disconnectedCallback() {
|
|
12823
|
+
document.removeEventListener('keydown', this.handleEscape, true);
|
|
12750
12824
|
}
|
|
12751
12825
|
render() {
|
|
12752
12826
|
// A stable, internal ID is safe because it is scoped to this Shadow Root
|
|
12753
12827
|
const anchorId = 'internal-anchor';
|
|
12754
|
-
return (index.h(index.Host, { key: '
|
|
12828
|
+
return (index.h(index.Host, { key: '6cbbccaa80ebaa6a4e220b0149b6f149788f2fe1' }, index.h("div", { key: '4ac2d67666ef0e7ae959d677ffa22955871d5f0f', id: anchorId, ref: el => (this.anchorRef = el), onPointerOver: (e) => (this.lastPath = e.composedPath()), onFocusin: (e) => {
|
|
12755
12829
|
var _a, _b;
|
|
12830
|
+
this.lastPath = e.composedPath();
|
|
12756
12831
|
// Only show on keyboard-driven focus, not pointer clicks or programmatic focus restoration
|
|
12757
12832
|
if ((_a = e.target) === null || _a === void 0 ? void 0 : _a.matches(':focus-visible')) {
|
|
12758
12833
|
(_b = this.tooltipRef) === null || _b === void 0 ? void 0 : _b.showTooltip(0);
|
|
12759
12834
|
}
|
|
12760
|
-
}, onFocusout: () => { var _a; return (_a = this.tooltipRef) === null || _a === void 0 ? void 0 : _a.hideTooltip(0); } }, index.h("slot", { key: '
|
|
12835
|
+
}, onFocusout: () => { var _a; return (_a = this.tooltipRef) === null || _a === void 0 ? void 0 : _a.hideTooltip(0); } }, index.h("slot", { key: 'f250f6cac194aee8947d9e3f5914fe7d680e7c78' })), index.h("fluent-tooltip", { key: 'fac5a135402b7003a215797dba5fb19cbcf271ad', ref: el => {
|
|
12836
|
+
var _a;
|
|
12837
|
+
this.tooltipRef = el;
|
|
12838
|
+
// Fluent's tooltip is popover="auto", so showing it closes any open udp-popover or menu.
|
|
12839
|
+
// "hint" (unsupported browsers fall back to "manual") shows it without dismissing other popovers.
|
|
12840
|
+
// Set in ref (runs after insertion) because Fluent's template re-applies popover="" on connect.
|
|
12841
|
+
(_a = this.tooltipRef) === null || _a === void 0 ? void 0 : _a.setAttribute('popover', 'hint');
|
|
12842
|
+
}, onBeforetoggle: this.handleBeforeToggle, onToggle: this.handleToggle, anchor: anchorId, delay: this.delay, positioning: this.positioning }, this.content)));
|
|
12761
12843
|
}
|
|
12762
12844
|
};
|
|
12763
12845
|
UdpTooltip.style = udpTooltipCss();
|
|
@@ -9,6 +9,11 @@ import "@fluentui/web-components/tooltip.js";
|
|
|
9
9
|
*/
|
|
10
10
|
export class UdpTooltip {
|
|
11
11
|
constructor() {
|
|
12
|
+
/**
|
|
13
|
+
* The event path of the latest `pointerover` or `focusin` inside the anchor.
|
|
14
|
+
* Read by `isOverOpenPopup()` when the tooltip is about to open.
|
|
15
|
+
*/
|
|
16
|
+
this.lastPath = [];
|
|
12
17
|
/**
|
|
13
18
|
* The delay of the tooltip.
|
|
14
19
|
*/
|
|
@@ -17,17 +22,94 @@ export class UdpTooltip {
|
|
|
17
22
|
* The positioning of the tooltip.
|
|
18
23
|
*/
|
|
19
24
|
this.positioning = 'above';
|
|
25
|
+
/**
|
|
26
|
+
* Cancels the tooltip's opening while it would cover its own trigger's open menu or popover.
|
|
27
|
+
*
|
|
28
|
+
* @param e - The `beforetoggle` event from the inner Fluent tooltip. Only opening is cancelable.
|
|
29
|
+
*/
|
|
30
|
+
this.handleBeforeToggle = (e) => {
|
|
31
|
+
if (e.newState === 'open' && this.isOverOpenPopup()) {
|
|
32
|
+
e.preventDefault();
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
/**
|
|
36
|
+
* Hides the open tooltip on Escape, wherever focus or the pointer is.
|
|
37
|
+
* Browsers without popover="hint" fall back to "manual", which has no built-in Escape dismissal.
|
|
38
|
+
* preventDefault stops the same Escape from also closing a popover or dialog underneath.
|
|
39
|
+
*
|
|
40
|
+
* @param e - A `keydown` on the document while the tooltip is open.
|
|
41
|
+
*/
|
|
42
|
+
this.handleEscape = (e) => {
|
|
43
|
+
var _a;
|
|
44
|
+
if (e.key !== 'Escape' || !((_a = this.tooltipRef) === null || _a === void 0 ? void 0 : _a.matches(':popover-open')))
|
|
45
|
+
return;
|
|
46
|
+
e.preventDefault();
|
|
47
|
+
// Not hideTooltip(): Fluent keeps re-queuing that while the anchor is hovered.
|
|
48
|
+
this.tooltipRef.setAttribute('aria-hidden', 'true');
|
|
49
|
+
this.tooltipRef.hidePopover();
|
|
50
|
+
};
|
|
51
|
+
/**
|
|
52
|
+
* Listens for Escape only while the tooltip is open.
|
|
53
|
+
*
|
|
54
|
+
* @param e - The `toggle` event from the inner Fluent tooltip.
|
|
55
|
+
*/
|
|
56
|
+
this.handleToggle = (e) => {
|
|
57
|
+
if (e.newState === 'open') {
|
|
58
|
+
document.addEventListener('keydown', this.handleEscape, true);
|
|
59
|
+
}
|
|
60
|
+
else {
|
|
61
|
+
document.removeEventListener('keydown', this.handleEscape, true);
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Whether the tooltip would cover a menu or popover that its own trigger has open,
|
|
67
|
+
* judged from the elements under the pointer or focus (`lastPath`).
|
|
68
|
+
*
|
|
69
|
+
* @returns `true` when the tooltip should stay hidden.
|
|
70
|
+
*/
|
|
71
|
+
isOverOpenPopup() {
|
|
72
|
+
const anchorIndex = this.lastPath.indexOf(this.anchorRef);
|
|
73
|
+
return this.lastPath.some((node, i) => {
|
|
74
|
+
var _a, _b;
|
|
75
|
+
if (!(node instanceof Element))
|
|
76
|
+
return false;
|
|
77
|
+
// Trigger of an open menu (fluent-menu sets both on its trigger)
|
|
78
|
+
const hasPopup = ((_a = node.getAttribute('aria-haspopup')) !== null && _a !== void 0 ? _a : 'false') !== 'false';
|
|
79
|
+
if (hasPopup && node.getAttribute('aria-expanded') === 'true')
|
|
80
|
+
return true;
|
|
81
|
+
// Trigger of an open udp-popover
|
|
82
|
+
if (node instanceof HTMLSlotElement &&
|
|
83
|
+
node.name === 'trigger' &&
|
|
84
|
+
((_b = node.getRootNode().host) === null || _b === void 0 ? void 0 : _b.matches('udp-popover[open]'))) {
|
|
85
|
+
return true;
|
|
86
|
+
}
|
|
87
|
+
// Open popup inside the anchor, e.g. the list of a wrapped menu.
|
|
88
|
+
// Only inside, so tooltips within an open popover's content still show.
|
|
89
|
+
return i < anchorIndex && node.matches(':popover-open');
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
disconnectedCallback() {
|
|
93
|
+
document.removeEventListener('keydown', this.handleEscape, true);
|
|
20
94
|
}
|
|
21
95
|
render() {
|
|
22
96
|
// A stable, internal ID is safe because it is scoped to this Shadow Root
|
|
23
97
|
const anchorId = 'internal-anchor';
|
|
24
|
-
return (h(Host, { key: '
|
|
98
|
+
return (h(Host, { key: '6cbbccaa80ebaa6a4e220b0149b6f149788f2fe1' }, h("div", { key: '4ac2d67666ef0e7ae959d677ffa22955871d5f0f', id: anchorId, ref: el => (this.anchorRef = el), onPointerOver: (e) => (this.lastPath = e.composedPath()), onFocusin: (e) => {
|
|
25
99
|
var _a, _b;
|
|
100
|
+
this.lastPath = e.composedPath();
|
|
26
101
|
// Only show on keyboard-driven focus, not pointer clicks or programmatic focus restoration
|
|
27
102
|
if ((_a = e.target) === null || _a === void 0 ? void 0 : _a.matches(':focus-visible')) {
|
|
28
103
|
(_b = this.tooltipRef) === null || _b === void 0 ? void 0 : _b.showTooltip(0);
|
|
29
104
|
}
|
|
30
|
-
}, onFocusout: () => { var _a; return (_a = this.tooltipRef) === null || _a === void 0 ? void 0 : _a.hideTooltip(0); } }, h("slot", { key: '
|
|
105
|
+
}, onFocusout: () => { var _a; return (_a = this.tooltipRef) === null || _a === void 0 ? void 0 : _a.hideTooltip(0); } }, h("slot", { key: 'f250f6cac194aee8947d9e3f5914fe7d680e7c78' })), h("fluent-tooltip", { key: 'fac5a135402b7003a215797dba5fb19cbcf271ad', ref: el => {
|
|
106
|
+
var _a;
|
|
107
|
+
this.tooltipRef = el;
|
|
108
|
+
// Fluent's tooltip is popover="auto", so showing it closes any open udp-popover or menu.
|
|
109
|
+
// "hint" (unsupported browsers fall back to "manual") shows it without dismissing other popovers.
|
|
110
|
+
// Set in ref (runs after insertion) because Fluent's template re-applies popover="" on connect.
|
|
111
|
+
(_a = this.tooltipRef) === null || _a === void 0 ? void 0 : _a.setAttribute('popover', 'hint');
|
|
112
|
+
}, onBeforetoggle: this.handleBeforeToggle, onToggle: this.handleToggle, anchor: anchorId, delay: this.delay, positioning: this.positioning }, this.content)));
|
|
31
113
|
}
|
|
32
114
|
static get is() { return "udp-tooltip"; }
|
|
33
115
|
static get encapsulation() { return "shadow"; }
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as e,H as t,h as i,d as
|
|
1
|
+
import{p as e,H as t,h as i,d as o,t as n}from"./index2.js";import"@fluentui/web-components/tooltip.js";const s=e(class extends t{constructor(e){super(),!1!==e&&this.__registerHost(),this.__attachShadow(),this.lastPath=[],this.delay=200,this.positioning="above",this.handleBeforeToggle=e=>{"open"===e.newState&&this.isOverOpenPopup()&&e.preventDefault()},this.handleEscape=e=>{var t;"Escape"===e.key&&(null===(t=this.tooltipRef)||void 0===t?void 0:t.matches(":popover-open"))&&(e.preventDefault(),this.tooltipRef.setAttribute("aria-hidden","true"),this.tooltipRef.hidePopover())},this.handleToggle=e=>{"open"===e.newState?document.addEventListener("keydown",this.handleEscape,!0):document.removeEventListener("keydown",this.handleEscape,!0)}}isOverOpenPopup(){const e=this.lastPath.indexOf(this.anchorRef);return this.lastPath.some(((t,i)=>{var o,n;return t instanceof Element&&(!("false"===(null!==(o=t.getAttribute("aria-haspopup"))&&void 0!==o?o:"false")||"true"!==t.getAttribute("aria-expanded"))||!!(t instanceof HTMLSlotElement&&"trigger"===t.name&&(null===(n=t.getRootNode().host)||void 0===n?void 0:n.matches("udp-popover[open]")))||i<e&&t.matches(":popover-open"))}))}disconnectedCallback(){document.removeEventListener("keydown",this.handleEscape,!0)}render(){const e="internal-anchor";return i(o,{key:"6cbbccaa80ebaa6a4e220b0149b6f149788f2fe1"},i("div",{key:"4ac2d67666ef0e7ae959d677ffa22955871d5f0f",id:e,ref:e=>this.anchorRef=e,onPointerOver:e=>this.lastPath=e.composedPath(),onFocusin:e=>{var t,i;this.lastPath=e.composedPath(),(null===(t=e.target)||void 0===t?void 0:t.matches(":focus-visible"))&&(null===(i=this.tooltipRef)||void 0===i||i.showTooltip(0))},onFocusout:()=>{var e;return null===(e=this.tooltipRef)||void 0===e?void 0:e.hideTooltip(0)}},i("slot",{key:"f250f6cac194aee8947d9e3f5914fe7d680e7c78"})),i("fluent-tooltip",{key:"fac5a135402b7003a215797dba5fb19cbcf271ad",ref:e=>{var t;this.tooltipRef=e,null===(t=this.tooltipRef)||void 0===t||t.setAttribute("popover","hint")},onBeforetoggle:this.handleBeforeToggle,onToggle:this.handleToggle,anchor:e,delay:this.delay,positioning:this.positioning},this.content))}static get style(){return":host{display:inline-flex;align-items:center;vertical-align:middle}#internal-anchor{display:inline-flex;align-items:center}fluent-tooltip{padding-block:5px;white-space:pre-line;}"}},[257,"udp-tooltip",{content:[1],delay:[2],positioning:[1]}]);function a(){"undefined"!=typeof customElements&&["udp-tooltip"].forEach((e=>{"udp-tooltip"===e&&(customElements.get(n(e))||customElements.define(n(e),s))}))}export{s as U,a as d}
|
package/dist/docs.json
CHANGED
|
@@ -12733,6 +12733,11 @@ const udpTooltipCss = () => `:host{display:inline-flex;align-items:center;vertic
|
|
|
12733
12733
|
const UdpTooltip = class {
|
|
12734
12734
|
constructor(hostRef) {
|
|
12735
12735
|
registerInstance(this, hostRef);
|
|
12736
|
+
/**
|
|
12737
|
+
* The event path of the latest `pointerover` or `focusin` inside the anchor.
|
|
12738
|
+
* Read by `isOverOpenPopup()` when the tooltip is about to open.
|
|
12739
|
+
*/
|
|
12740
|
+
this.lastPath = [];
|
|
12736
12741
|
/**
|
|
12737
12742
|
* The delay of the tooltip.
|
|
12738
12743
|
*/
|
|
@@ -12741,17 +12746,94 @@ const UdpTooltip = class {
|
|
|
12741
12746
|
* The positioning of the tooltip.
|
|
12742
12747
|
*/
|
|
12743
12748
|
this.positioning = 'above';
|
|
12749
|
+
/**
|
|
12750
|
+
* Cancels the tooltip's opening while it would cover its own trigger's open menu or popover.
|
|
12751
|
+
*
|
|
12752
|
+
* @param e - The `beforetoggle` event from the inner Fluent tooltip. Only opening is cancelable.
|
|
12753
|
+
*/
|
|
12754
|
+
this.handleBeforeToggle = (e) => {
|
|
12755
|
+
if (e.newState === 'open' && this.isOverOpenPopup()) {
|
|
12756
|
+
e.preventDefault();
|
|
12757
|
+
}
|
|
12758
|
+
};
|
|
12759
|
+
/**
|
|
12760
|
+
* Hides the open tooltip on Escape, wherever focus or the pointer is.
|
|
12761
|
+
* Browsers without popover="hint" fall back to "manual", which has no built-in Escape dismissal.
|
|
12762
|
+
* preventDefault stops the same Escape from also closing a popover or dialog underneath.
|
|
12763
|
+
*
|
|
12764
|
+
* @param e - A `keydown` on the document while the tooltip is open.
|
|
12765
|
+
*/
|
|
12766
|
+
this.handleEscape = (e) => {
|
|
12767
|
+
var _a;
|
|
12768
|
+
if (e.key !== 'Escape' || !((_a = this.tooltipRef) === null || _a === void 0 ? void 0 : _a.matches(':popover-open')))
|
|
12769
|
+
return;
|
|
12770
|
+
e.preventDefault();
|
|
12771
|
+
// Not hideTooltip(): Fluent keeps re-queuing that while the anchor is hovered.
|
|
12772
|
+
this.tooltipRef.setAttribute('aria-hidden', 'true');
|
|
12773
|
+
this.tooltipRef.hidePopover();
|
|
12774
|
+
};
|
|
12775
|
+
/**
|
|
12776
|
+
* Listens for Escape only while the tooltip is open.
|
|
12777
|
+
*
|
|
12778
|
+
* @param e - The `toggle` event from the inner Fluent tooltip.
|
|
12779
|
+
*/
|
|
12780
|
+
this.handleToggle = (e) => {
|
|
12781
|
+
if (e.newState === 'open') {
|
|
12782
|
+
document.addEventListener('keydown', this.handleEscape, true);
|
|
12783
|
+
}
|
|
12784
|
+
else {
|
|
12785
|
+
document.removeEventListener('keydown', this.handleEscape, true);
|
|
12786
|
+
}
|
|
12787
|
+
};
|
|
12788
|
+
}
|
|
12789
|
+
/**
|
|
12790
|
+
* Whether the tooltip would cover a menu or popover that its own trigger has open,
|
|
12791
|
+
* judged from the elements under the pointer or focus (`lastPath`).
|
|
12792
|
+
*
|
|
12793
|
+
* @returns `true` when the tooltip should stay hidden.
|
|
12794
|
+
*/
|
|
12795
|
+
isOverOpenPopup() {
|
|
12796
|
+
const anchorIndex = this.lastPath.indexOf(this.anchorRef);
|
|
12797
|
+
return this.lastPath.some((node, i) => {
|
|
12798
|
+
var _a, _b;
|
|
12799
|
+
if (!(node instanceof Element))
|
|
12800
|
+
return false;
|
|
12801
|
+
// Trigger of an open menu (fluent-menu sets both on its trigger)
|
|
12802
|
+
const hasPopup = ((_a = node.getAttribute('aria-haspopup')) !== null && _a !== void 0 ? _a : 'false') !== 'false';
|
|
12803
|
+
if (hasPopup && node.getAttribute('aria-expanded') === 'true')
|
|
12804
|
+
return true;
|
|
12805
|
+
// Trigger of an open udp-popover
|
|
12806
|
+
if (node instanceof HTMLSlotElement &&
|
|
12807
|
+
node.name === 'trigger' &&
|
|
12808
|
+
((_b = node.getRootNode().host) === null || _b === void 0 ? void 0 : _b.matches('udp-popover[open]'))) {
|
|
12809
|
+
return true;
|
|
12810
|
+
}
|
|
12811
|
+
// Open popup inside the anchor, e.g. the list of a wrapped menu.
|
|
12812
|
+
// Only inside, so tooltips within an open popover's content still show.
|
|
12813
|
+
return i < anchorIndex && node.matches(':popover-open');
|
|
12814
|
+
});
|
|
12815
|
+
}
|
|
12816
|
+
disconnectedCallback() {
|
|
12817
|
+
document.removeEventListener('keydown', this.handleEscape, true);
|
|
12744
12818
|
}
|
|
12745
12819
|
render() {
|
|
12746
12820
|
// A stable, internal ID is safe because it is scoped to this Shadow Root
|
|
12747
12821
|
const anchorId = 'internal-anchor';
|
|
12748
|
-
return (h(Host, { key: '
|
|
12822
|
+
return (h(Host, { key: '6cbbccaa80ebaa6a4e220b0149b6f149788f2fe1' }, h("div", { key: '4ac2d67666ef0e7ae959d677ffa22955871d5f0f', id: anchorId, ref: el => (this.anchorRef = el), onPointerOver: (e) => (this.lastPath = e.composedPath()), onFocusin: (e) => {
|
|
12749
12823
|
var _a, _b;
|
|
12824
|
+
this.lastPath = e.composedPath();
|
|
12750
12825
|
// Only show on keyboard-driven focus, not pointer clicks or programmatic focus restoration
|
|
12751
12826
|
if ((_a = e.target) === null || _a === void 0 ? void 0 : _a.matches(':focus-visible')) {
|
|
12752
12827
|
(_b = this.tooltipRef) === null || _b === void 0 ? void 0 : _b.showTooltip(0);
|
|
12753
12828
|
}
|
|
12754
|
-
}, onFocusout: () => { var _a; return (_a = this.tooltipRef) === null || _a === void 0 ? void 0 : _a.hideTooltip(0); } }, h("slot", { key: '
|
|
12829
|
+
}, onFocusout: () => { var _a; return (_a = this.tooltipRef) === null || _a === void 0 ? void 0 : _a.hideTooltip(0); } }, h("slot", { key: 'f250f6cac194aee8947d9e3f5914fe7d680e7c78' })), h("fluent-tooltip", { key: 'fac5a135402b7003a215797dba5fb19cbcf271ad', ref: el => {
|
|
12830
|
+
var _a;
|
|
12831
|
+
this.tooltipRef = el;
|
|
12832
|
+
// Fluent's tooltip is popover="auto", so showing it closes any open udp-popover or menu.
|
|
12833
|
+
// "hint" (unsupported browsers fall back to "manual") shows it without dismissing other popovers.
|
|
12834
|
+
// Set in ref (runs after insertion) because Fluent's template re-applies popover="" on connect.
|
|
12835
|
+
(_a = this.tooltipRef) === null || _a === void 0 ? void 0 : _a.setAttribute('popover', 'hint');
|
|
12836
|
+
}, onBeforetoggle: this.handleBeforeToggle, onToggle: this.handleToggle, anchor: anchorId, delay: this.delay, positioning: this.positioning }, this.content)));
|
|
12755
12837
|
}
|
|
12756
12838
|
};
|
|
12757
12839
|
UdpTooltip.style = udpTooltipCss();
|