@ember-eui/core 8.0.21 → 8.0.23
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/declarations/components/eui-popover.d.ts +12 -1
- package/declarations/components/eui-popover.d.ts.map +1 -1
- package/declarations/components/eui-portal.d.ts +6 -2
- package/declarations/components/eui-portal.d.ts.map +1 -1
- package/declarations/utils/popover/index.d.ts +3 -1
- package/declarations/utils/popover/index.d.ts.map +1 -1
- package/dist/components/eui-popover.js +41 -7
- package/dist/components/eui-popover.js.map +1 -1
- package/dist/components/eui-portal.js +14 -12
- package/dist/components/eui-portal.js.map +1 -1
- package/dist/utils/popover/index.js +17 -0
- package/dist/utils/popover/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -82,6 +82,10 @@ export type EuiPopoverArgs = {
|
|
|
82
82
|
};
|
|
83
83
|
panelRef?: (e: HTMLElement | null) => unknown;
|
|
84
84
|
popoverRef?: (e: HTMLElement) => unknown;
|
|
85
|
+
/**
|
|
86
|
+
* when not `false`, the popover will check if this popover is inside another popover and if so. will reposition itself to be inside the other popover
|
|
87
|
+
*/
|
|
88
|
+
shouldAccountForOtherPopovers?: boolean;
|
|
85
89
|
/**
|
|
86
90
|
* When `true`, the popover's position is re-calculated when the user
|
|
87
91
|
* scrolls, this supports having fixed-position popover anchors
|
|
@@ -173,6 +177,7 @@ export default class EuiPopoverComponent extends Component<EuiPopoverSignature>
|
|
|
173
177
|
openPosition: EuiPopoverPosition | null;
|
|
174
178
|
isOpenStable: boolean;
|
|
175
179
|
isCurrentlyOpen: boolean | undefined;
|
|
180
|
+
popoverHost?: HTMLElement | null;
|
|
176
181
|
private respositionTimeout;
|
|
177
182
|
private closingTransitionTimeout;
|
|
178
183
|
private closingTransitionAnimationFrame;
|
|
@@ -181,13 +186,19 @@ export default class EuiPopoverComponent extends Component<EuiPopoverSignature>
|
|
|
181
186
|
button: HTMLElement | null;
|
|
182
187
|
panel: HTMLElement | null;
|
|
183
188
|
constructor(owner: unknown, args: EuiPopoverArgs);
|
|
189
|
+
get insert(): {
|
|
190
|
+
sibling: HTMLElement;
|
|
191
|
+
position: string;
|
|
192
|
+
} | undefined;
|
|
184
193
|
closePopover(): void;
|
|
185
194
|
onEscapeKey(event: Event, ekEvent?: EmberKeyboardEvent): void;
|
|
186
195
|
onKeyDown(event: KeyboardEvent, ekEvent: EmberKeyboardEvent): void;
|
|
187
196
|
onClickOutside(event: Event): void;
|
|
188
197
|
updateFocus(): void;
|
|
189
198
|
onOpenPopover(): void;
|
|
190
|
-
|
|
199
|
+
get shouldAccountForOtherPopovers(): boolean;
|
|
200
|
+
checkIfPopoverIsInsideAnotherPopover(ele: HTMLElement): void;
|
|
201
|
+
didInsertPopover(ele: HTMLDivElement): void;
|
|
191
202
|
didUpdateRepositionOnScroll(): void;
|
|
192
203
|
didUpdateIsOpen(): void;
|
|
193
204
|
willDestroy(): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"eui-popover.d.ts","sourceRoot":"","sources":["../../src/components/eui-popover.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,oBAAoB,CAAC;AAS3C,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAiB3C,OAAO,EAEL,cAAc,EACf,MAAM,mCAAmC,CAAC;AAU3C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AAC1E,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AACjE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AAE1E,KAAK,gBAAgB,GAAG,MAAM,OAAO,kBAAkB,CAAC;AAExD,MAAM,MAAM,qBAAqB,GAC7B,UAAU,GACV,QAAQ,GACR,SAAS,GACT,YAAY,GACZ,UAAU,GACV,WAAW,GACX,YAAY,GACZ,QAAQ,GACR,UAAU,GACV,aAAa,GACb,SAAS,GACT,WAAW,CAAC;AAEhB,MAAM,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,IAAI;IAWnB,UAAU,CAAC,OAAO,EAAE,cAAc,EAAE,GAAG,IAAI;IAS3C,eAAe,CAAC,oBAAoB,EAAE,OAAO,GAAG,IAAI;IAuFpD,IAAI,YAAY,IAAI,UAAU,CAAC,OAAO,QAAQ,CAAC,GAAG,SAAS,CAM1D;IAED,IAAI,cAAc,IAAI;QAAE,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,CAU5C;IAED,IAAI,QAAQ,oBAMX;IAGD,oBAAoB,IAAI,IAAI;IAK5B,oBAAoB,IAAI,IAAI;IAK5B,cAAc,CAAC,GAAG,EAAE,cAAc,GAAG,IAAI;IAMzC,aAAa,CAAC,KAAK,EAAE,WAAW,GAAG,IAAI;CA2HxC"}
|
|
@@ -5,14 +5,14 @@ interface InsertPositionsMap {
|
|
|
5
5
|
export declare const insertPositions: InsertPositionsMap;
|
|
6
6
|
export declare const INSERT_POSITIONS: EuiPortalInsertPosition[];
|
|
7
7
|
type EuiPortalInsertPosition = keyof typeof insertPositions;
|
|
8
|
-
interface EuiPortalArgs {
|
|
8
|
+
export interface EuiPortalArgs {
|
|
9
9
|
insert?: {
|
|
10
10
|
sibling: HTMLElement;
|
|
11
11
|
position: EuiPortalInsertPosition;
|
|
12
12
|
};
|
|
13
13
|
portalRef?: (ref: HTMLDivElement | null) => void;
|
|
14
14
|
}
|
|
15
|
-
interface EuiPortalSignature {
|
|
15
|
+
export interface EuiPortalSignature {
|
|
16
16
|
Args: EuiPortalArgs;
|
|
17
17
|
Element: HTMLDivElement;
|
|
18
18
|
Blocks: {
|
|
@@ -21,6 +21,10 @@ interface EuiPortalSignature {
|
|
|
21
21
|
}
|
|
22
22
|
export default class EuiPortal extends Component<EuiPortalSignature> {
|
|
23
23
|
portalNode: HTMLElement;
|
|
24
|
+
get insert(): {
|
|
25
|
+
sibling: HTMLElement;
|
|
26
|
+
position: string | number;
|
|
27
|
+
};
|
|
24
28
|
constructor(owner: unknown, args: EuiPortalArgs);
|
|
25
29
|
willDestroy(): void;
|
|
26
30
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"eui-portal.d.ts","sourceRoot":"","sources":["../../src/components/eui-portal.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,oBAAoB,CAAC;AAM3C,UAAU,kBAAkB;IAC1B,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC;CACvB;AAED,eAAO,MAAM,eAAe,EAAE,kBAG7B,CAAC;AAEF,eAAO,MAAM,gBAAgB,EAAE,uBAAuB,EAC7B,CAAC;AAE1B,KAAK,uBAAuB,GAAG,MAAM,OAAO,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"eui-portal.d.ts","sourceRoot":"","sources":["../../src/components/eui-portal.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,oBAAoB,CAAC;AAM3C,UAAU,kBAAkB;IAC1B,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC;CACvB;AAED,eAAO,MAAM,eAAe,EAAE,kBAG7B,CAAC;AAEF,eAAO,MAAM,gBAAgB,EAAE,uBAAuB,EAC7B,CAAC;AAE1B,KAAK,uBAAuB,GAAG,MAAM,OAAO,eAAe,CAAC;AAE5D,MAAM,WAAW,aAAa;IAC5B,MAAM,CAAC,EAAE;QAAE,OAAO,EAAE,WAAW,CAAC;QAAC,QAAQ,EAAE,uBAAuB,CAAA;KAAE,CAAC;IACrE,SAAS,CAAC,EAAE,CAAC,GAAG,EAAE,cAAc,GAAG,IAAI,KAAK,IAAI,CAAC;CAClD;AAED,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,aAAa,CAAC;IACpB,OAAO,EAAE,cAAc,CAAC;IACxB,MAAM,EAAE;QAAE,OAAO,EAAE,EAAE,CAAA;KAAE,CAAC;CACzB;AAED,MAAM,CAAC,OAAO,OAAO,SAAU,SAAQ,SAAS,CAAC,kBAAkB,CAAC;IACzD,UAAU,EAAG,WAAW,CAAC;IAElC,IAAI,MAAM;;;MAET;gBAEW,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,aAAa;IAiB/C,WAAW,IAAI,IAAI;CAqBpB"}
|
|
@@ -14,6 +14,7 @@ export interface EuiClientRect extends BoundingBox {
|
|
|
14
14
|
interface FindPopoverPositionArgs {
|
|
15
15
|
anchor: HTMLElement;
|
|
16
16
|
popover: HTMLElement;
|
|
17
|
+
host?: HTMLElement | null;
|
|
17
18
|
align?: EuiPopoverPosition;
|
|
18
19
|
position: EuiPopoverPosition;
|
|
19
20
|
forcePosition?: boolean;
|
|
@@ -45,6 +46,7 @@ interface FindPopoverPositionResult {
|
|
|
45
46
|
* @param popover {HTMLElement} Element containing the popover content
|
|
46
47
|
* @param position {string} Position the user wants. One of ["top", "right", "bottom", "left"]
|
|
47
48
|
* @param [forcePosition] {boolean} If true, use only the provided `position` value and don't try any other position
|
|
49
|
+
* @param host {HTMLElement} Element the popover must be positioned relative to
|
|
48
50
|
* @param [align] {string} Cross-axis alignment. One of ["top", "right", "bottom", "left"]
|
|
49
51
|
* @param [buffer=16] {number} Minimum distance between the popover and the bounding container
|
|
50
52
|
* @param [offset=0] {number} Distance between the popover and the anchor
|
|
@@ -58,7 +60,7 @@ interface FindPopoverPositionResult {
|
|
|
58
60
|
* popover, and the placement's relation to the anchor or undefined
|
|
59
61
|
* there's no room.
|
|
60
62
|
*/
|
|
61
|
-
export declare function findPopoverPosition({ anchor, popover, align, position, forcePosition, buffer, offset, allowCrossAxis, container, arrowConfig, returnBoundingBox }: FindPopoverPositionArgs): FindPopoverPositionResult;
|
|
63
|
+
export declare function findPopoverPosition({ anchor, popover, align, position, forcePosition, host, buffer, offset, allowCrossAxis, container, arrowConfig, returnBoundingBox }: FindPopoverPositionArgs): FindPopoverPositionResult;
|
|
62
64
|
interface GetPopoverScreenCoordinatesArgs {
|
|
63
65
|
position: EuiPopoverPosition;
|
|
64
66
|
align?: EuiPopoverPosition;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"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B,CAAC,EAC1C,QAAQ,EACR,KAAK,EACL,iBAAiB,EACjB,kBAAkB,EAClB,iBAAiB,EACjB,oBAAoB,EACpB,WAAW,EACX,MAAU,EACV,MAAU,EACX,EAAE,+BAA+B,GAAG,iCAAiC,CAkHrE;AAyMD;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,WAAW,GAAG,aAAa,CAWzE;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,iBAAiB,CAC/B,iBAAiB,EAAE,WAAW,EAC9B,oBAAoB,EAAE,WAAW,EACjC,MAAM,EAAE,MAAM,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EACjD,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,kBAAkB,GAC7B,WAAW,CA0Bb;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,CAC3B,kBAAkB,EAAE,WAAW,EAC/B,oBAAoB,EAAE,WAAW,GAChC,MAAM,CAsBR;AAED;;;;;;GAMG;AACH,wBAAgB,sBAAsB,CACpC,QAAQ,EAAE,WAAW,EACrB,SAAS,EAAE,WAAW,GACrB,aAAa,CAgBf;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAC9B,OAAO,EAAE,WAAW,EACpB,MAAM,EAAE,WAAW,GAClB,MAAM,CA4DR"}
|
|
@@ -30,7 +30,7 @@ import { getTransitionTimings, getWaitDuration, performOnFrame } from '../utils/
|
|
|
30
30
|
import EuiPanel from './eui-panel.js';
|
|
31
31
|
import EuiPortal from './eui-portal.js';
|
|
32
32
|
|
|
33
|
-
var _dec, _dec2, _dec3, _dec4, _dec5, _dec6, _dec7, _dec8, _class, _descriptor, _descriptor2, _descriptor3, _descriptor4, _descriptor5, _descriptor6, _descriptor7, _descriptor8, _descriptor9, _descriptor10, _descriptor11, _descriptor12, _descriptor13, _descriptor14, _descriptor15, _descriptor16, _descriptor17, _descriptor18, _descriptor19, _descriptor20;
|
|
33
|
+
var _dec, _dec2, _dec3, _dec4, _dec5, _dec6, _dec7, _dec8, _class, _descriptor, _descriptor2, _descriptor3, _descriptor4, _descriptor5, _descriptor6, _descriptor7, _descriptor8, _descriptor9, _descriptor10, _descriptor11, _descriptor12, _descriptor13, _descriptor14, _descriptor15, _descriptor16, _descriptor17, _descriptor18, _descriptor19, _descriptor20, _descriptor21;
|
|
34
34
|
const anchorPositionToPopoverPositionMap = {
|
|
35
35
|
up: 'top',
|
|
36
36
|
right: 'right',
|
|
@@ -130,7 +130,7 @@ let EuiPopoverComponent = setComponentTemplate(precompileTemplate(`
|
|
|
130
130
|
(or this.isCurrentlyOpen this.isClosing)
|
|
131
131
|
)
|
|
132
132
|
}}
|
|
133
|
-
<EuiPortal @insert={{
|
|
133
|
+
<EuiPortal @insert={{this.insert}}>
|
|
134
134
|
{{#let (randomId) as |panelId|}}
|
|
135
135
|
<EuiPanel
|
|
136
136
|
id={{panelId}}
|
|
@@ -252,19 +252,34 @@ let EuiPopoverComponent = setComponentTemplate(precompileTemplate(`
|
|
|
252
252
|
_initializerDefineProperty(this, "openPosition", _descriptor16, this);
|
|
253
253
|
_initializerDefineProperty(this, "isOpenStable", _descriptor17, this);
|
|
254
254
|
_initializerDefineProperty(this, "isCurrentlyOpen", _descriptor18, this);
|
|
255
|
+
_initializerDefineProperty(this, "popoverHost", _descriptor19, this);
|
|
255
256
|
///
|
|
256
257
|
_defineProperty(this, "respositionTimeout", null);
|
|
257
258
|
_defineProperty(this, "closingTransitionTimeout", null);
|
|
258
259
|
_defineProperty(this, "closingTransitionAnimationFrame", void 0);
|
|
259
260
|
_defineProperty(this, "updateFocusAnimationFrame", void 0);
|
|
260
261
|
_defineProperty(this, "hasSetInitialFocus", false);
|
|
261
|
-
_initializerDefineProperty(this, "button",
|
|
262
|
-
_initializerDefineProperty(this, "panel",
|
|
262
|
+
_initializerDefineProperty(this, "button", _descriptor20, this);
|
|
263
|
+
_initializerDefineProperty(this, "panel", _descriptor21, this);
|
|
263
264
|
assert(`Must provide closePopover function`, this.args.closePopover);
|
|
264
265
|
this.prevIsOpen = this.isOpen;
|
|
265
266
|
this.suppressingPopover = this.isOpen;
|
|
266
267
|
this.isCurrentlyOpen = this.isOpen;
|
|
267
268
|
}
|
|
269
|
+
get insert() {
|
|
270
|
+
if (this.args.insert) {
|
|
271
|
+
return this.args.insert;
|
|
272
|
+
}
|
|
273
|
+
if (this.shouldAccountForOtherPopovers) {
|
|
274
|
+
if (this.popoverHost) {
|
|
275
|
+
return {
|
|
276
|
+
sibling: this.popoverHost.children[0],
|
|
277
|
+
position: 'after'
|
|
278
|
+
};
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
return undefined;
|
|
282
|
+
}
|
|
268
283
|
closePopover() {
|
|
269
284
|
if (this.isOpen) {
|
|
270
285
|
this.args.closePopover();
|
|
@@ -381,7 +396,14 @@ let EuiPopoverComponent = setComponentTemplate(precompileTemplate(`
|
|
|
381
396
|
scheduleOnce('afterRender', this, fn);
|
|
382
397
|
}, durationMatch + delayMatch);
|
|
383
398
|
}
|
|
384
|
-
|
|
399
|
+
get shouldAccountForOtherPopovers() {
|
|
400
|
+
return this.args.shouldAccountForOtherPopovers ?? true;
|
|
401
|
+
}
|
|
402
|
+
checkIfPopoverIsInsideAnotherPopover(ele) {
|
|
403
|
+
const otherPopover = ele.closest('div.euiPopover__panel');
|
|
404
|
+
this.popoverHost = otherPopover;
|
|
405
|
+
}
|
|
406
|
+
didInsertPopover(ele) {
|
|
385
407
|
if (this.suppressingPopover) {
|
|
386
408
|
// component was created with isOpen=true; now that it's inserted
|
|
387
409
|
// stop suppressing and start opening
|
|
@@ -393,6 +415,9 @@ let EuiPopoverComponent = setComponentTemplate(precompileTemplate(`
|
|
|
393
415
|
if (this.args.repositionOnScroll) {
|
|
394
416
|
window.addEventListener('scroll', this.positionPopoverFixed, true);
|
|
395
417
|
}
|
|
418
|
+
if (this.shouldAccountForOtherPopovers) {
|
|
419
|
+
this.checkIfPopoverIsInsideAnotherPopover(ele);
|
|
420
|
+
}
|
|
396
421
|
this.updateFocus();
|
|
397
422
|
}
|
|
398
423
|
didUpdateRepositionOnScroll() {
|
|
@@ -421,6 +446,7 @@ let EuiPopoverComponent = setComponentTemplate(precompileTemplate(`
|
|
|
421
446
|
willDestroy() {
|
|
422
447
|
super.willDestroy();
|
|
423
448
|
window.removeEventListener('scroll', this.positionPopoverFixed, true);
|
|
449
|
+
this.popoverHost = null;
|
|
424
450
|
cancel(this.respositionTimeout);
|
|
425
451
|
cancel(this.closingTransitionTimeout);
|
|
426
452
|
cancelAnimationFrame(this.closingTransitionAnimationFrame);
|
|
@@ -447,6 +473,7 @@ let EuiPopoverComponent = setComponentTemplate(precompileTemplate(`
|
|
|
447
473
|
anchorBoundingBox
|
|
448
474
|
} = findPopoverPosition({
|
|
449
475
|
container: this.args.container,
|
|
476
|
+
host: this.shouldAccountForOtherPopovers ? this.popoverHost : null,
|
|
450
477
|
position,
|
|
451
478
|
forcePosition,
|
|
452
479
|
align: getPopoverAlignFromAnchorPosition(this.anchorPosition),
|
|
@@ -638,14 +665,21 @@ let EuiPopoverComponent = setComponentTemplate(precompileTemplate(`
|
|
|
638
665
|
enumerable: true,
|
|
639
666
|
writable: true,
|
|
640
667
|
initializer: null
|
|
641
|
-
}), _descriptor19 = _applyDecoratedDescriptor(_class.prototype, "
|
|
668
|
+
}), _descriptor19 = _applyDecoratedDescriptor(_class.prototype, "popoverHost", [tracked], {
|
|
669
|
+
configurable: true,
|
|
670
|
+
enumerable: true,
|
|
671
|
+
writable: true,
|
|
672
|
+
initializer: function () {
|
|
673
|
+
return null;
|
|
674
|
+
}
|
|
675
|
+
}), _descriptor20 = _applyDecoratedDescriptor(_class.prototype, "button", [tracked], {
|
|
642
676
|
configurable: true,
|
|
643
677
|
enumerable: true,
|
|
644
678
|
writable: true,
|
|
645
679
|
initializer: function () {
|
|
646
680
|
return null;
|
|
647
681
|
}
|
|
648
|
-
}),
|
|
682
|
+
}), _descriptor21 = _applyDecoratedDescriptor(_class.prototype, "panel", [tracked], {
|
|
649
683
|
configurable: true,
|
|
650
684
|
enumerable: true,
|
|
651
685
|
writable: true,
|