lightning-base-components 1.28.14-alpha → 1.28.15-alpha
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/metadata/raptor.json +3 -10
- package/package.json +5 -1
- package/scopedImports/@salesforce-label-LightningRichTextAssist.composeText.js +1 -1
- package/src/lightning/datatable/keyboard.d.ts.map +1 -1
- package/src/lightning/datatable/keyboard.js +4 -4
- package/src/lightning/features/gates/imports.d.ts +1 -0
- package/src/lightning/features/gates/imports.d.ts.map +1 -1
- package/src/lightning/features/gates/imports.js +1 -0
- package/src/lightning/features/types.d.ts +1 -0
- package/src/lightning/features/types.d.ts.map +1 -1
- package/src/lightning/groupedCombobox/groupedCombobox.d.ts +4 -0
- package/src/lightning/groupedCombobox/groupedCombobox.d.ts.map +1 -1
- package/src/lightning/groupedCombobox/groupedCombobox.html +1 -0
- package/src/lightning/groupedCombobox/groupedCombobox.js +13 -1
- package/src/lightning/multiColumnSortingModal/multiColumnSortingModal.d.ts +1 -1
- package/src/lightning/multiColumnSortingModal/multiColumnSortingModal.d.ts.map +1 -1
- package/src/lightning/overlayBase/overlayBase.css +21 -0
- package/src/lightning/overlayBase/overlayBase.d.ts +28 -0
- package/src/lightning/overlayBase/overlayBase.d.ts.map +1 -0
- package/src/lightning/overlayBase/overlayBase.html +24 -0
- package/src/lightning/overlayBase/overlayBase.js +125 -0
- package/src/lightning/overlayBase/overlayBase.js-meta.xml +8 -0
- package/src/lightning/overlayPositionUtils/anchorPositioningAdapter.d.ts +24 -0
- package/src/lightning/overlayPositionUtils/anchorPositioningAdapter.d.ts.map +1 -0
- package/src/lightning/overlayPositionUtils/anchorPositioningAdapter.js +49 -0
- package/src/lightning/overlayPositionUtils/cssAnchorPositioning.d.ts +14 -0
- package/src/lightning/overlayPositionUtils/cssAnchorPositioning.d.ts.map +1 -0
- package/src/lightning/overlayPositionUtils/cssAnchorPositioning.js +94 -0
- package/src/lightning/overlayPositionUtils/overlayPositionUtils.d.ts +55 -0
- package/src/lightning/overlayPositionUtils/overlayPositionUtils.d.ts.map +1 -0
- package/src/lightning/overlayPositionUtils/overlayPositionUtils.js +107 -0
- package/src/lightning/overlayPositionUtils/overlayPositionUtils.js-meta.xml +6 -0
- package/src/lightning/overlayPositionUtils/positionLibraryFallback.d.ts +30 -0
- package/src/lightning/overlayPositionUtils/positionLibraryFallback.d.ts.map +1 -0
- package/src/lightning/overlayPositionUtils/positionLibraryFallback.js +435 -0
- package/src/lightning/primitiveCellFactory/primitiveCellFactory.d.ts +1 -1
- package/src/lightning/primitiveCellFactory/primitiveCellFactory.d.ts.map +1 -1
- package/src/lightning/primitiveCellFactory/primitiveCellFactory.js +4 -4
- package/src/lightning/primitiveHeaderFactory/selectableHeader.html +1 -0
- package/src/lightning/primitiveInputCheckboxButton/primitiveInputCheckboxButton.js +1 -1
- package/src/lightning/primitiveInputSimple/primitiveInputSimple.d.ts.map +1 -1
- package/src/lightning/primitiveInputSimple/primitiveInputSimple.js +2 -1
- package/src/lightning/primitiveOverlay/__examples__/alert/alert.d.ts +13 -0
- package/src/lightning/primitiveOverlay/__examples__/alert/alert.d.ts.map +1 -0
- package/src/lightning/primitiveOverlay/__examples__/alert/alert.html +27 -0
- package/src/lightning/primitiveOverlay/__examples__/alert/alert.js +34 -0
- package/src/lightning/primitiveOverlay/__examples__/basic/basic.css +7 -0
- package/src/lightning/primitiveOverlay/__examples__/basic/basic.d.ts +12 -0
- package/src/lightning/primitiveOverlay/__examples__/basic/basic.d.ts.map +1 -0
- package/src/lightning/primitiveOverlay/__examples__/basic/basic.html +18 -0
- package/src/lightning/primitiveOverlay/__examples__/basic/basic.js +58 -0
- package/src/lightning/primitiveOverlay/__examples__/demo/demo.d.ts +11 -0
- package/src/lightning/primitiveOverlay/__examples__/demo/demo.d.ts.map +1 -0
- package/src/lightning/primitiveOverlay/__examples__/demo/demo.html +29 -0
- package/src/lightning/primitiveOverlay/__examples__/demo/demo.js +41 -0
- package/src/lightning/primitiveOverlay/__examples__/panel/panel.d.ts +9 -0
- package/src/lightning/primitiveOverlay/__examples__/panel/panel.d.ts.map +1 -0
- package/src/lightning/primitiveOverlay/__examples__/panel/panel.html +17 -0
- package/src/lightning/primitiveOverlay/__examples__/panel/panel.js +24 -0
- package/src/lightning/primitiveOverlay/primitiveOverlay.d.ts +8 -0
- package/src/lightning/primitiveOverlay/primitiveOverlay.d.ts.map +1 -0
- package/src/lightning/primitiveOverlay/primitiveOverlay.html +4 -0
- package/src/lightning/primitiveOverlay/primitiveOverlay.js +37 -0
- package/src/lightning/primitiveOverlay/primitiveOverlay.js-meta.xml +7 -0
- package/src/lightning/tooltipLibrary/tooltipLibrary.d.ts +2 -0
- package/src/lightning/tooltipLibrary/tooltipLibrary.d.ts.map +1 -1
- package/src/lightning/tooltipLibrary/tooltipLibrary.js +45 -3
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2025, Salesforce, Inc.,
|
|
3
|
+
* All rights reserved.
|
|
4
|
+
* For full license text, see the LICENSE.txt file
|
|
5
|
+
*/
|
|
6
|
+
import { LightningElement } from 'lwc';
|
|
7
|
+
import OverlayAlert from 'overlay/alert';
|
|
8
|
+
import OverlayDemo from 'overlay/demo';
|
|
9
|
+
import OverlayPanel from 'overlay/panel';
|
|
10
|
+
export default class OverlayBasic extends LightningElement {
|
|
11
|
+
confirmResult = 'unset';
|
|
12
|
+
handleConfirmModal() {
|
|
13
|
+
OverlayAlert.open({
|
|
14
|
+
header: 'Are you sure?',
|
|
15
|
+
body: 'Click cancel or okay below to get a string result.',
|
|
16
|
+
}).then((result) => {
|
|
17
|
+
this.confirmResult = result;
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
confirmAltResult = 'unset';
|
|
21
|
+
handleConfirmAltModal() {
|
|
22
|
+
OverlayAlert.open({
|
|
23
|
+
header: 'Do you like this demo?',
|
|
24
|
+
body: '...',
|
|
25
|
+
okayText: 'Yes',
|
|
26
|
+
cancelText: 'Also Yes',
|
|
27
|
+
}).then((result) => {
|
|
28
|
+
this.confirmAltResult = result;
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
demoResult = 'unset';
|
|
32
|
+
handleDemoModal() {
|
|
33
|
+
OverlayDemo.open({
|
|
34
|
+
header: 'Select an Option',
|
|
35
|
+
body: 'From the list below select an item',
|
|
36
|
+
options: [
|
|
37
|
+
{ id: 1, label: 'Option 1' },
|
|
38
|
+
{ id: 2, label: 'Option 2' },
|
|
39
|
+
],
|
|
40
|
+
}).then((result) => {
|
|
41
|
+
if (result === 0) {
|
|
42
|
+
this.demoResult = 'dismiss';
|
|
43
|
+
}
|
|
44
|
+
else {
|
|
45
|
+
this.demoResult = result;
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
panelResult = 'unset';
|
|
50
|
+
handlePanel() {
|
|
51
|
+
OverlayPanel.open({
|
|
52
|
+
header: 'Select an Option',
|
|
53
|
+
body: 'From the list below select an item',
|
|
54
|
+
}).then((result) => {
|
|
55
|
+
this.demoResult = result;
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export default class OverlayDemo extends LightningPrimitiveOverlay {
|
|
2
|
+
header: string;
|
|
3
|
+
body: string;
|
|
4
|
+
options: any[];
|
|
5
|
+
handleOptionClick(e: any): void;
|
|
6
|
+
handleDismiss(): void;
|
|
7
|
+
hasFocus: boolean;
|
|
8
|
+
renderedCallback(): void;
|
|
9
|
+
}
|
|
10
|
+
import LightningPrimitiveOverlay from 'lightning/primitiveOverlay';
|
|
11
|
+
//# sourceMappingURL=demo.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"demo.d.ts","sourceRoot":"","sources":["../../../../../../../modules/lightning/primitiveOverlay/__examples__/demo/demo.js"],"names":[],"mappings":"AAKA;IACI,eAAuB;IAEvB,aAAmB;IAEnB,eAAkB;IAElB,gCAaC;IAED,sBAEC;IAED,kBAAiB;IACjB,yBAMC;CACJ;sCArCqC,4BAA4B"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<section role="dialog" tabindex="-1" aria-labelledby="modal-heading-01" aria-modal="true"
|
|
3
|
+
aria-describedby="modal-content-id-1" class="slds-modal slds-fade-in-open">
|
|
4
|
+
<div class="slds-modal__container">
|
|
5
|
+
<header class="slds-modal__header">
|
|
6
|
+
<button class="slds-button slds-button_icon slds-modal__close slds-button_icon-inverse" title="Close" onclick={handleDismiss}>
|
|
7
|
+
<svg class="slds-button__icon slds-button__icon_large" aria-hidden="true">
|
|
8
|
+
<use xlink:href="/assets/icons/utility-sprite/svg/symbols.svg#close"></use>
|
|
9
|
+
</svg>
|
|
10
|
+
<span class="slds-assistive-text">Close</span>
|
|
11
|
+
</button>
|
|
12
|
+
<h2 id="modal-heading-01" class="slds-modal__title slds-hyphenate">{header}</h2>
|
|
13
|
+
</header>
|
|
14
|
+
<div class="slds-modal__content slds-p-around_medium" id="modal-content-id-1">
|
|
15
|
+
<p>{body}</p>
|
|
16
|
+
<ul>
|
|
17
|
+
<template for:each={options} for:item="option">
|
|
18
|
+
<li key={option.id}>
|
|
19
|
+
<button onclick={handleOptionClick} data-id={option.id}>
|
|
20
|
+
{option.label}
|
|
21
|
+
</button>
|
|
22
|
+
</li>
|
|
23
|
+
</template>
|
|
24
|
+
</ul>
|
|
25
|
+
</div>
|
|
26
|
+
</div>
|
|
27
|
+
</section>
|
|
28
|
+
<div class="slds-backdrop slds-backdrop_open"></div>
|
|
29
|
+
</template>
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2025, Salesforce, Inc.,
|
|
3
|
+
* All rights reserved.
|
|
4
|
+
* For full license text, see the LICENSE.txt file
|
|
5
|
+
*/
|
|
6
|
+
import { api } from 'lwc';
|
|
7
|
+
import LightningPrimitiveOverlay from 'lightning/primitiveOverlay';
|
|
8
|
+
import OverlayAlert from 'overlay/alert';
|
|
9
|
+
export default class OverlayDemo extends LightningPrimitiveOverlay {
|
|
10
|
+
@api
|
|
11
|
+
header = 'Header';
|
|
12
|
+
@api
|
|
13
|
+
body = 'Body';
|
|
14
|
+
@api
|
|
15
|
+
options = [];
|
|
16
|
+
handleOptionClick(e) {
|
|
17
|
+
const { target } = e;
|
|
18
|
+
const id = parseInt(target.dataset.id, 10);
|
|
19
|
+
const option = this.options.find((x) => x.id === id);
|
|
20
|
+
OverlayAlert.open({
|
|
21
|
+
header: 'Are you sure?',
|
|
22
|
+
body: `You selected "${option.label}".`,
|
|
23
|
+
okayText: `Yes, ${option.label}`,
|
|
24
|
+
}).then((result) => {
|
|
25
|
+
if (result === 'okay') {
|
|
26
|
+
this.close(parseInt(target.dataset.id, 10));
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
handleDismiss() {
|
|
31
|
+
this.close(0);
|
|
32
|
+
}
|
|
33
|
+
hasFocus = false;
|
|
34
|
+
renderedCallback() {
|
|
35
|
+
if (!this.hasFocus) {
|
|
36
|
+
const close = this.template.querySelector('header > button');
|
|
37
|
+
close.focus();
|
|
38
|
+
this.hasFocus = true;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export default class OverlayPanel extends LightningPrimitiveOverlay {
|
|
2
|
+
header: string;
|
|
3
|
+
body: string;
|
|
4
|
+
handleDismiss(): void;
|
|
5
|
+
hasFocus: boolean;
|
|
6
|
+
renderedCallback(): void;
|
|
7
|
+
}
|
|
8
|
+
import LightningPrimitiveOverlay from 'lightning/primitiveOverlay';
|
|
9
|
+
//# sourceMappingURL=panel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"panel.d.ts","sourceRoot":"","sources":["../../../../../../../modules/lightning/primitiveOverlay/__examples__/panel/panel.js"],"names":[],"mappings":"AAGA;IACI,eAAuB;IAEvB,aAAmB;IAEnB,sBAEC;IAED,kBAAiB;IACjB,yBAMC;CACJ;sCAnBqC,4BAA4B"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<lightning-focus-trap>
|
|
3
|
+
<div class="slds-panel slds-size_medium slds-panel_docked slds-panel_docked-left slds-is-open" aria-hidden="false">
|
|
4
|
+
<div class="slds-panel__header">
|
|
5
|
+
<h2 class="slds-panel__header-title slds-text-heading_small slds-truncate" title="Panel Header">{header}</h2>
|
|
6
|
+
<button class="slds-button slds-button_icon slds-button_icon-small slds-panel__close" title="Collapse Panel Header" onclick={handleDismiss}>
|
|
7
|
+
<svg class="slds-button__icon" aria-hidden="true">
|
|
8
|
+
<use xlink:href="/assets/icons/utility-sprite/svg/symbols.svg#close"></use>
|
|
9
|
+
</svg>
|
|
10
|
+
<span class="slds-assistive-text">Collapse Panel Header</span>
|
|
11
|
+
</button>
|
|
12
|
+
</div>
|
|
13
|
+
<div class="slds-panel__body">{body}</div>
|
|
14
|
+
</div>
|
|
15
|
+
</lightning-focus-trap>
|
|
16
|
+
<!-- <div class="slds-backdrop slds-backdrop_open"></div>-->
|
|
17
|
+
</template>
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2025, Salesforce, Inc.,
|
|
3
|
+
* All rights reserved.
|
|
4
|
+
* For full license text, see the LICENSE.txt file
|
|
5
|
+
*/
|
|
6
|
+
import { api } from 'lwc';
|
|
7
|
+
import LightningPrimitiveOverlay from 'lightning/primitiveOverlay';
|
|
8
|
+
export default class OverlayPanel extends LightningPrimitiveOverlay {
|
|
9
|
+
@api
|
|
10
|
+
header = 'Header';
|
|
11
|
+
@api
|
|
12
|
+
body = 'Body';
|
|
13
|
+
handleDismiss() {
|
|
14
|
+
this.close('dismiss');
|
|
15
|
+
}
|
|
16
|
+
hasFocus = false;
|
|
17
|
+
renderedCallback() {
|
|
18
|
+
if (!this.hasFocus) {
|
|
19
|
+
const close = this.template.querySelector('div > button');
|
|
20
|
+
close.focus();
|
|
21
|
+
this.hasFocus = true;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import LightningShadowBaseClass from 'lightning/shadowBaseClassPrivate';
|
|
2
|
+
import { instanceName } from 'lightning/overlayUtils';
|
|
3
|
+
export default class LightningPrimitiveOverlay extends LightningShadowBaseClass {
|
|
4
|
+
static [instanceName]: string;
|
|
5
|
+
static open(apis: object): Promise<void>;
|
|
6
|
+
close(result?: any, promise?: Promise<void>): void;
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=primitiveOverlay.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"primitiveOverlay.d.ts","sourceRoot":"","sources":["../../../../../modules/lightning/primitiveOverlay/primitiveOverlay.ts"],"names":[],"mappings":"AACA,OAAO,wBAAwB,MAAM,kCAAkC,CAAC;AACxE,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAwBtD,MAAM,CAAC,OAAO,OAAO,yBAA0B,SAAQ,wBAAwB;IAI3E,MAAM,CAAC,CAAC,YAAY,CAAC,SAAiC;IAOtD,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAaxC,KAAK,CAAC,MAAM,CAAC,EAAE,GAAG,EAAE,OAAO,CAAC,EAAE,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI;CAKrD"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2025, Salesforce, Inc.,
|
|
3
|
+
* All rights reserved.
|
|
4
|
+
* For full license text, see the LICENSE.txt file
|
|
5
|
+
*/
|
|
6
|
+
import { createElement, api } from 'lwc';
|
|
7
|
+
import LightningShadowBaseClass from 'lightning/shadowBaseClassPrivate';
|
|
8
|
+
import { instanceName } from 'lightning/overlayUtils';
|
|
9
|
+
import OverlayContainer from 'lightning/overlayContainer';
|
|
10
|
+
const ROOT = 'body';
|
|
11
|
+
const OVERLAY_CONTAINER = 'lightning-overlay-container';
|
|
12
|
+
function container() {
|
|
13
|
+
let element = document.querySelector(`${ROOT} > ${OVERLAY_CONTAINER}`);
|
|
14
|
+
if (!element) {
|
|
15
|
+
element = createElement(OVERLAY_CONTAINER, {
|
|
16
|
+
is: OverlayContainer,
|
|
17
|
+
});
|
|
18
|
+
element.classList.add('slds-scope');
|
|
19
|
+
document.body.appendChild(element);
|
|
20
|
+
}
|
|
21
|
+
return element;
|
|
22
|
+
}
|
|
23
|
+
export default class LightningPrimitiveOverlay extends LightningShadowBaseClass {
|
|
24
|
+
static [instanceName] = 'lightning-primitive-overlay';
|
|
25
|
+
static open(apis) {
|
|
26
|
+
if (!import.meta.env.SSR) {
|
|
27
|
+
return container().push(this, apis);
|
|
28
|
+
}
|
|
29
|
+
return new Promise(() => { });
|
|
30
|
+
}
|
|
31
|
+
@api
|
|
32
|
+
close(result, promise) {
|
|
33
|
+
if (!import.meta.env.SSR) {
|
|
34
|
+
container().pop(this.template.host, result, promise);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
@@ -37,6 +37,7 @@ export declare class Tooltip {
|
|
|
37
37
|
_target: () => any;
|
|
38
38
|
_element: () => any;
|
|
39
39
|
_type: string;
|
|
40
|
+
boundHandleTooltipMouseLeave?: (event: MouseEvent | Event) => void;
|
|
40
41
|
constructor(value: string, config: TooltipConfig);
|
|
41
42
|
detach(): void;
|
|
42
43
|
attach(): void;
|
|
@@ -45,6 +46,7 @@ export declare class Tooltip {
|
|
|
45
46
|
addInfoListeners(): void;
|
|
46
47
|
hideIfNotSelfCover(event: MouseEvent | KeyboardEvent): void;
|
|
47
48
|
handleDocumentTouch(): void;
|
|
49
|
+
_handleTooltipMouseLeave: (event: MouseEvent | Event) => void;
|
|
48
50
|
addToggleListeners(): void;
|
|
49
51
|
handleEscape(e: KeyboardEvent): void;
|
|
50
52
|
get resizeObserver(): ResizeObserver;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tooltipLibrary.d.ts","sourceRoot":"","sources":["../../../../../modules/lightning/tooltipLibrary/tooltipLibrary.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAa,MAAM,2BAA2B,CAAC;AASpE,OAAO,YAAY,MAAM,wBAAwB,CAAC;AAClD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,KAAK,CAAC;AAE5C,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAEtD,eAAO,MAAM,aAAa,wCAAwC,CAAC;AAsDnE,eAAO,MAAM,WAAW;;;CAGd,CAAC;AASX,KAAK,aAAa,GAAG;IACjB,IAAI,CAAC,EAAE,gBAAgB,CAAC;IACxB,MAAM,CAAC,EAAE,MAAM,WAAW,CAAC;IAC3B,OAAO,CAAC,EAAE,MAAM,WAAW,CAAC;IAC5B,KAAK,CAAC,EAAE;QAAE,UAAU,CAAC,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IACnD,WAAW,CAAC,EAAE;QAAE,UAAU,CAAC,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IACzD,sBAAsB,CAAC,EAAE,OAAO,CAAC;IACjC,IAAI,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,qBAAa,OAAO;IAChB,aAAa,EAAE,YAAY,GAAG,IAAI,CAAQ;IAC1C,SAAS,UAAQ;IACjB,YAAY,UAAS;IACrB,QAAQ,UAAS;IACjB,aAAa,UAAS;IACtB,cAAc,UAAQ;IACtB,aAAa,EAAE,YAAY,GAAG,IAAI,CAAQ;IAC1C,eAAe,MAAC;IAChB,OAAO,EAAE,aAAa,CAAM;IAC5B,MAAM,EAAE,MAAM,CAAM;IACpB,KAAK,EAAE,gBAAgB,CAAC;IACxB,OAAO,EAAE,MAAM,GAAG,CAAC;IACnB,QAAQ,EAAE,MAAM,GAAG,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"tooltipLibrary.d.ts","sourceRoot":"","sources":["../../../../../modules/lightning/tooltipLibrary/tooltipLibrary.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAa,MAAM,2BAA2B,CAAC;AASpE,OAAO,YAAY,MAAM,wBAAwB,CAAC;AAClD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,KAAK,CAAC;AAE5C,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAEtD,eAAO,MAAM,aAAa,wCAAwC,CAAC;AAsDnE,eAAO,MAAM,WAAW;;;CAGd,CAAC;AASX,KAAK,aAAa,GAAG;IACjB,IAAI,CAAC,EAAE,gBAAgB,CAAC;IACxB,MAAM,CAAC,EAAE,MAAM,WAAW,CAAC;IAC3B,OAAO,CAAC,EAAE,MAAM,WAAW,CAAC;IAC5B,KAAK,CAAC,EAAE;QAAE,UAAU,CAAC,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IACnD,WAAW,CAAC,EAAE;QAAE,UAAU,CAAC,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IACzD,sBAAsB,CAAC,EAAE,OAAO,CAAC;IACjC,IAAI,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,qBAAa,OAAO;IAChB,aAAa,EAAE,YAAY,GAAG,IAAI,CAAQ;IAC1C,SAAS,UAAQ;IACjB,YAAY,UAAS;IACrB,QAAQ,UAAS;IACjB,aAAa,UAAS;IACtB,cAAc,UAAQ;IACtB,aAAa,EAAE,YAAY,GAAG,IAAI,CAAQ;IAC1C,eAAe,MAAC;IAChB,OAAO,EAAE,aAAa,CAAM;IAC5B,MAAM,EAAE,MAAM,CAAM;IACpB,KAAK,EAAE,gBAAgB,CAAC;IACxB,OAAO,EAAE,MAAM,GAAG,CAAC;IACnB,QAAQ,EAAE,MAAM,GAAG,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,4BAA4B,CAAC,EAAE,CAAC,KAAK,EAAE,UAAU,GAAG,KAAK,KAAK,IAAI,CAAC;gBASvD,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,aAAa;IAwChD,MAAM,IAAI,IAAI;IAOd,MAAM,IAAI,IAAI;IAQd,UAAU,IAAI,IAAI;IA0BlB,UAAU,IAAI,IAAI;IASlB,gBAAgB,IAAI,IAAI;IAsBxB,kBAAkB,CAAC,KAAK,EAAE,UAAU,GAAG,aAAa,GAAG,IAAI;IAyC3D,mBAAmB,IAAI,IAAI;IAiB3B,wBAAwB,UAAW,UAAU,GAAG,KAAK,KAAG,IAAI,CAoC1D;IAEF,kBAAkB,IAAI,IAAI;IA2B1B,YAAY,CAAC,CAAC,EAAE,aAAa,GAAG,IAAI;IAUpC,IAAI,cAAc,IAAI,cAAc,CA6CnC;IAED,IAAI,CAAC,EAAE,CAAC,EAAE,KAAK,GAAG,IAAI;IAkDtB,IAAI,CAAC,UAAU,GAAE,OAAc,GAAG,IAAI;IA+BtC,MAAM,IAAI,IAAI;IAQd,IAAI,KAAK,IAAI,MAAM,CAElB;IAED,IAAI,KAAK,CAAC,KAAK,EAAE,MAAM,EAGtB;IAED,IAAI,WAAW,IAAI,OAAO,CAEzB;IAED,IAAI,OAAO,IAAI,OAAO,CAErB;IAED,gBAAgB,IAAI,OAAO,CAAC,IAAI,CAAC;IAyCjC,eAAe,IAAI,IAAI;IAMvB,oBAAoB,CAAC,QAAQ,EAAE,MAAM,IAAI,GAAG,cAAc;CAU7D"}
|
|
@@ -51,6 +51,7 @@ export class Tooltip {
|
|
|
51
51
|
_target;
|
|
52
52
|
_element;
|
|
53
53
|
_type;
|
|
54
|
+
boundHandleTooltipMouseLeave;
|
|
54
55
|
constructor(value, config) {
|
|
55
56
|
assert(!!config.target, 'target for tooltip is undefined or missing');
|
|
56
57
|
this.value = value;
|
|
@@ -76,6 +77,10 @@ export class Tooltip {
|
|
|
76
77
|
this.handleDocumentTouch = this.handleDocumentTouch.bind(this);
|
|
77
78
|
this.handleEscape = this.handleEscape.bind(this);
|
|
78
79
|
this.hide = this.hide.bind(this);
|
|
80
|
+
if (features.enableTooltipFlashingFix) {
|
|
81
|
+
this.boundHandleTooltipMouseLeave =
|
|
82
|
+
this._handleTooltipMouseLeave.bind(this);
|
|
83
|
+
}
|
|
79
84
|
}
|
|
80
85
|
detach() {
|
|
81
86
|
this._disabled = true;
|
|
@@ -161,6 +166,30 @@ export class Tooltip {
|
|
|
161
166
|
this.hide();
|
|
162
167
|
}
|
|
163
168
|
}
|
|
169
|
+
_handleTooltipMouseLeave = (event) => {
|
|
170
|
+
if (!this._visible) {
|
|
171
|
+
return;
|
|
172
|
+
}
|
|
173
|
+
if (event instanceof MouseEvent && event.clientX && event.clientY) {
|
|
174
|
+
try {
|
|
175
|
+
const target = this._target();
|
|
176
|
+
if (target) {
|
|
177
|
+
const { clientX, clientY } = event;
|
|
178
|
+
const { left, right, top, bottom } = target.getBoundingClientRect();
|
|
179
|
+
const tolerance = 1;
|
|
180
|
+
if (clientX >= left - tolerance &&
|
|
181
|
+
clientX <= right + tolerance &&
|
|
182
|
+
clientY >= top - tolerance &&
|
|
183
|
+
clientY <= bottom + tolerance) {
|
|
184
|
+
return;
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
catch (ex) {
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
this.hide();
|
|
192
|
+
};
|
|
164
193
|
addToggleListeners() {
|
|
165
194
|
const target = this._target();
|
|
166
195
|
if (!this._initialized && target) {
|
|
@@ -200,11 +229,19 @@ export class Tooltip {
|
|
|
200
229
|
this.hide(false);
|
|
201
230
|
return;
|
|
202
231
|
}
|
|
203
|
-
this.startPositioning()
|
|
232
|
+
this.startPositioning()
|
|
233
|
+
.then(() => {
|
|
204
234
|
if (this._initialResize) {
|
|
205
|
-
|
|
235
|
+
if (features.enableTooltipFlashingFix) {
|
|
236
|
+
tooltip.addEventListener('mouseleave', this.boundHandleTooltipMouseLeave);
|
|
237
|
+
}
|
|
238
|
+
else {
|
|
239
|
+
tooltip.addEventListener('mouseleave', this.hide);
|
|
240
|
+
}
|
|
206
241
|
this._initialResize = false;
|
|
207
242
|
}
|
|
243
|
+
})
|
|
244
|
+
.catch(() => {
|
|
208
245
|
});
|
|
209
246
|
}
|
|
210
247
|
});
|
|
@@ -253,7 +290,12 @@ export class Tooltip {
|
|
|
253
290
|
this.stopPositioning();
|
|
254
291
|
document.removeEventListener('touchstart', this.handleDocumentTouch);
|
|
255
292
|
document.removeEventListener('keydown', this.handleEscape);
|
|
256
|
-
|
|
293
|
+
if (features.enableTooltipFlashingFix) {
|
|
294
|
+
tooltip.removeEventListener('mouseleave', this.boundHandleTooltipMouseLeave);
|
|
295
|
+
}
|
|
296
|
+
else {
|
|
297
|
+
tooltip.removeEventListener('mouseleave', this.hide);
|
|
298
|
+
}
|
|
257
299
|
this.resizeObserver.unobserve(tooltip);
|
|
258
300
|
if (features.enableTooltipHoverDismiss) {
|
|
259
301
|
setActiveTooltip(null);
|