@vaadin/popover 24.5.0-alpha6 → 24.5.0-alpha8
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/lit.d.ts +1 -0
- package/lit.js +1 -0
- package/package.json +14 -11
- package/src/lit/renderer-directives.d.ts +58 -0
- package/src/lit/renderer-directives.js +60 -0
- package/src/vaadin-popover-overlay.js +2 -4
- package/src/vaadin-popover.d.ts +6 -0
- package/src/vaadin-popover.js +99 -9
- package/web-types.json +24 -2
- package/web-types.lit.json +9 -2
package/lit.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './src/lit/renderer-directives.js';
|
package/lit.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './src/lit/renderer-directives.js';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vaadin/popover",
|
|
3
|
-
"version": "24.5.0-
|
|
3
|
+
"version": "24.5.0-alpha8",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -20,6 +20,8 @@
|
|
|
20
20
|
"module": "vaadin-popover.js",
|
|
21
21
|
"type": "module",
|
|
22
22
|
"files": [
|
|
23
|
+
"lit.d.ts",
|
|
24
|
+
"lit.js",
|
|
23
25
|
"src",
|
|
24
26
|
"theme",
|
|
25
27
|
"vaadin-*.d.ts",
|
|
@@ -35,22 +37,23 @@
|
|
|
35
37
|
],
|
|
36
38
|
"dependencies": {
|
|
37
39
|
"@open-wc/dedupe-mixin": "^1.3.0",
|
|
38
|
-
"@vaadin/a11y-base": "24.5.0-
|
|
39
|
-
"@vaadin/component-base": "24.5.0-
|
|
40
|
-
"@vaadin/
|
|
41
|
-
"@vaadin/
|
|
42
|
-
"@vaadin/vaadin-
|
|
43
|
-
"@vaadin/vaadin-
|
|
40
|
+
"@vaadin/a11y-base": "24.5.0-alpha8",
|
|
41
|
+
"@vaadin/component-base": "24.5.0-alpha8",
|
|
42
|
+
"@vaadin/lit-renderer": "24.5.0-alpha8",
|
|
43
|
+
"@vaadin/overlay": "24.5.0-alpha8",
|
|
44
|
+
"@vaadin/vaadin-lumo-styles": "24.5.0-alpha8",
|
|
45
|
+
"@vaadin/vaadin-material-styles": "24.5.0-alpha8",
|
|
46
|
+
"@vaadin/vaadin-themable-mixin": "24.5.0-alpha8",
|
|
44
47
|
"lit": "^3.0.0"
|
|
45
48
|
},
|
|
46
49
|
"devDependencies": {
|
|
47
|
-
"@
|
|
48
|
-
"@vaadin/testing-helpers": "^0.
|
|
49
|
-
"sinon": "^
|
|
50
|
+
"@vaadin/chai-plugins": "24.5.0-alpha8",
|
|
51
|
+
"@vaadin/testing-helpers": "^1.0.0",
|
|
52
|
+
"sinon": "^18.0.0"
|
|
50
53
|
},
|
|
51
54
|
"web-types": [
|
|
52
55
|
"web-types.json",
|
|
53
56
|
"web-types.lit.json"
|
|
54
57
|
],
|
|
55
|
-
"gitHead": "
|
|
58
|
+
"gitHead": "1e227aaa55df3f5dae3d477b9afb5fce4f5ece33"
|
|
56
59
|
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright (c) 2024 Vaadin Ltd.
|
|
4
|
+
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
|
+
*/
|
|
6
|
+
import type { DirectiveResult } from 'lit/directive.js';
|
|
7
|
+
import { LitRendererDirective, type LitRendererResult } from '@vaadin/lit-renderer';
|
|
8
|
+
import type { Popover } from '../vaadin-popover.js';
|
|
9
|
+
|
|
10
|
+
export type PopoverLitRenderer = (popover: Popover) => LitRendererResult;
|
|
11
|
+
|
|
12
|
+
export class PopoverRendererDirective extends LitRendererDirective<Popover, PopoverLitRenderer> {
|
|
13
|
+
/**
|
|
14
|
+
* Adds the renderer callback to the popover.
|
|
15
|
+
*/
|
|
16
|
+
addRenderer(): void;
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Runs the renderer callback on the popover.
|
|
20
|
+
*/
|
|
21
|
+
runRenderer(): void;
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Removes the renderer callback from the popover.
|
|
25
|
+
*/
|
|
26
|
+
removeRenderer(): void;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* A Lit directive for populating the content of the `<vaadin-popover-overlay>` element.
|
|
31
|
+
*
|
|
32
|
+
* The directive accepts a renderer callback returning a Lit template and assigns it to the popover
|
|
33
|
+
* via the `renderer` property. The renderer is called once to populate the content when assigned
|
|
34
|
+
* and whenever a single dependency or an array of dependencies changes.
|
|
35
|
+
* It is not guaranteed that the renderer will be called immediately (synchronously) in both cases.
|
|
36
|
+
*
|
|
37
|
+
* Dependencies can be a single value or an array of values.
|
|
38
|
+
* Values are checked against previous values with strict equality (`===`),
|
|
39
|
+
* so the check won't detect nested property changes inside objects or arrays.
|
|
40
|
+
* When dependencies are provided as an array, each item is checked against the previous value
|
|
41
|
+
* at the same index with strict equality. Nested arrays are also checked only by strict
|
|
42
|
+
* equality.
|
|
43
|
+
*
|
|
44
|
+
* Example of usage:
|
|
45
|
+
* ```js
|
|
46
|
+
* `<vaadin-popover
|
|
47
|
+
* ${popoverRenderer((popover) => html`...`)}
|
|
48
|
+
* ></vaadin-popover>`
|
|
49
|
+
* ```
|
|
50
|
+
*
|
|
51
|
+
* @param renderer the renderer callback that returns a Lit template.
|
|
52
|
+
* @param dependencies a single dependency or an array of dependencies
|
|
53
|
+
* which trigger a re-render when changed.
|
|
54
|
+
*/
|
|
55
|
+
export declare function popoverRenderer(
|
|
56
|
+
renderer: PopoverLitRenderer,
|
|
57
|
+
dependencies?: unknown,
|
|
58
|
+
): DirectiveResult<typeof PopoverRendererDirective>;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright (c) 2024 Vaadin Ltd.
|
|
4
|
+
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
|
+
*/
|
|
6
|
+
import { directive } from 'lit/directive.js';
|
|
7
|
+
import { LitRendererDirective } from '@vaadin/lit-renderer';
|
|
8
|
+
|
|
9
|
+
export class PopoverRendererDirective extends LitRendererDirective {
|
|
10
|
+
/**
|
|
11
|
+
* Adds the renderer callback to the popover.
|
|
12
|
+
*/
|
|
13
|
+
addRenderer() {
|
|
14
|
+
this.element.renderer = (root, popover) => {
|
|
15
|
+
this.renderRenderer(root, popover);
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Runs the renderer callback on the popover.
|
|
21
|
+
*/
|
|
22
|
+
runRenderer() {
|
|
23
|
+
this.element.requestContentUpdate();
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Removes the renderer callback from the popover.
|
|
28
|
+
*/
|
|
29
|
+
removeRenderer() {
|
|
30
|
+
this.element.renderer = null;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* A Lit directive for populating the content of the `<vaadin-popover-overlay>` element.
|
|
36
|
+
*
|
|
37
|
+
* The directive accepts a renderer callback returning a Lit template and assigns it to the popover
|
|
38
|
+
* via the `renderer` property. The renderer is called once to populate the content when assigned
|
|
39
|
+
* and whenever a single dependency or an array of dependencies changes.
|
|
40
|
+
* It is not guaranteed that the renderer will be called immediately (synchronously) in both cases.
|
|
41
|
+
*
|
|
42
|
+
* Dependencies can be a single value or an array of values.
|
|
43
|
+
* Values are checked against previous values with strict equality (`===`),
|
|
44
|
+
* so the check won't detect nested property changes inside objects or arrays.
|
|
45
|
+
* When dependencies are provided as an array, each item is checked against the previous value
|
|
46
|
+
* at the same index with strict equality. Nested arrays are also checked only by strict
|
|
47
|
+
* equality.
|
|
48
|
+
*
|
|
49
|
+
* Example of usage:
|
|
50
|
+
* ```js
|
|
51
|
+
* `<vaadin-popover
|
|
52
|
+
* ${popoverRenderer((popover) => html`...`)}
|
|
53
|
+
* ></vaadin-popover>`
|
|
54
|
+
* ```
|
|
55
|
+
*
|
|
56
|
+
* @param renderer the renderer callback that returns a Lit template.
|
|
57
|
+
* @param dependencies a single dependency or an array of dependencies
|
|
58
|
+
* which trigger a re-render when changed.
|
|
59
|
+
*/
|
|
60
|
+
export const popoverRenderer = directive(PopoverRendererDirective);
|
|
@@ -60,10 +60,8 @@ class PopoverOverlay extends PopoverOverlayMixin(DirMixin(ThemableMixin(PolylitM
|
|
|
60
60
|
[part='overlay']::before {
|
|
61
61
|
position: absolute;
|
|
62
62
|
content: '';
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
inset-inline-start: calc(var(--vaadin-popover-offset-start, 0) * -1);
|
|
66
|
-
inset-inline-end: calc(var(--vaadin-popover-offset-end, 0) * -1);
|
|
63
|
+
inset-block: calc(var(--vaadin-popover-offset-top, 0) * -1) calc(var(--vaadin-popover-offset-bottom, 0) * -1);
|
|
64
|
+
inset-inline: calc(var(--vaadin-popover-offset-start, 0) * -1) calc(var(--vaadin-popover-offset-end, 0) * -1);
|
|
67
65
|
z-index: -1;
|
|
68
66
|
pointer-events: auto;
|
|
69
67
|
}
|
package/src/vaadin-popover.d.ts
CHANGED
|
@@ -91,6 +91,12 @@ declare class Popover extends PopoverPositionMixin(
|
|
|
91
91
|
*/
|
|
92
92
|
accessibleNameRef: string | null | undefined;
|
|
93
93
|
|
|
94
|
+
/**
|
|
95
|
+
* When true, the popover content automatically receives focus after
|
|
96
|
+
* it is opened. Modal popovers use this behavior by default.
|
|
97
|
+
*/
|
|
98
|
+
autofocus: boolean;
|
|
99
|
+
|
|
94
100
|
/**
|
|
95
101
|
* Height to be set on the overlay content.
|
|
96
102
|
*
|
package/src/vaadin-popover.js
CHANGED
|
@@ -6,7 +6,12 @@
|
|
|
6
6
|
import './vaadin-popover-overlay.js';
|
|
7
7
|
import { html, LitElement } from 'lit';
|
|
8
8
|
import { ifDefined } from 'lit/directives/if-defined.js';
|
|
9
|
-
import {
|
|
9
|
+
import {
|
|
10
|
+
getDeepActiveElement,
|
|
11
|
+
getFocusableElements,
|
|
12
|
+
isElementFocused,
|
|
13
|
+
isKeyboardActive,
|
|
14
|
+
} from '@vaadin/a11y-base/src/focus-utils.js';
|
|
10
15
|
import { defineCustomElement } from '@vaadin/component-base/src/define.js';
|
|
11
16
|
import { ElementMixin } from '@vaadin/component-base/src/element-mixin.js';
|
|
12
17
|
import { OverlayClassMixin } from '@vaadin/component-base/src/overlay-class-mixin.js';
|
|
@@ -205,6 +210,14 @@ class Popover extends PopoverPositionMixin(
|
|
|
205
210
|
type: String,
|
|
206
211
|
},
|
|
207
212
|
|
|
213
|
+
/**
|
|
214
|
+
* When true, the popover content automatically receives focus after
|
|
215
|
+
* it is opened. Modal popovers use this behavior by default.
|
|
216
|
+
*/
|
|
217
|
+
autofocus: {
|
|
218
|
+
type: Boolean,
|
|
219
|
+
},
|
|
220
|
+
|
|
208
221
|
/**
|
|
209
222
|
* Height to be set on the overlay content.
|
|
210
223
|
*
|
|
@@ -380,7 +393,6 @@ class Popover extends PopoverPositionMixin(
|
|
|
380
393
|
this.__onGlobalClick = this.__onGlobalClick.bind(this);
|
|
381
394
|
this.__onGlobalKeyDown = this.__onGlobalKeyDown.bind(this);
|
|
382
395
|
this.__onTargetClick = this.__onTargetClick.bind(this);
|
|
383
|
-
this.__onTargetKeydown = this.__onTargetKeydown.bind(this);
|
|
384
396
|
this.__onTargetFocusIn = this.__onTargetFocusIn.bind(this);
|
|
385
397
|
this.__onTargetFocusOut = this.__onTargetFocusOut.bind(this);
|
|
386
398
|
this.__onTargetMouseEnter = this.__onTargetMouseEnter.bind(this);
|
|
@@ -421,6 +433,7 @@ class Popover extends PopoverPositionMixin(
|
|
|
421
433
|
.restoreFocusNode="${this.target}"
|
|
422
434
|
@vaadin-overlay-escape-press="${this.__onEscapePress}"
|
|
423
435
|
@vaadin-overlay-outside-click="${this.__onOutsideClick}"
|
|
436
|
+
@vaadin-overlay-open="${this.__onOverlayOpened}"
|
|
424
437
|
@vaadin-overlay-closed="${this.__onOverlayClosed}"
|
|
425
438
|
></vaadin-popover-overlay>
|
|
426
439
|
`;
|
|
@@ -470,7 +483,6 @@ class Popover extends PopoverPositionMixin(
|
|
|
470
483
|
*/
|
|
471
484
|
_addTargetListeners(target) {
|
|
472
485
|
target.addEventListener('click', this.__onTargetClick);
|
|
473
|
-
target.addEventListener('keydown', this.__onTargetKeydown);
|
|
474
486
|
target.addEventListener('mouseenter', this.__onTargetMouseEnter);
|
|
475
487
|
target.addEventListener('mouseleave', this.__onTargetMouseLeave);
|
|
476
488
|
target.addEventListener('focusin', this.__onTargetFocusIn);
|
|
@@ -484,7 +496,6 @@ class Popover extends PopoverPositionMixin(
|
|
|
484
496
|
*/
|
|
485
497
|
_removeTargetListeners(target) {
|
|
486
498
|
target.removeEventListener('click', this.__onTargetClick);
|
|
487
|
-
target.removeEventListener('keydown', this.__onTargetKeydown);
|
|
488
499
|
target.removeEventListener('mouseenter', this.__onTargetMouseEnter);
|
|
489
500
|
target.removeEventListener('mouseleave', this.__onTargetMouseLeave);
|
|
490
501
|
target.removeEventListener('focusin', this.__onTargetFocusIn);
|
|
@@ -565,9 +576,13 @@ class Popover extends PopoverPositionMixin(
|
|
|
565
576
|
* @private
|
|
566
577
|
*/
|
|
567
578
|
__onGlobalKeyDown(event) {
|
|
579
|
+
// Modal popover uses overlay logic for Esc key and focus trap.
|
|
580
|
+
if (this.modal) {
|
|
581
|
+
return;
|
|
582
|
+
}
|
|
583
|
+
|
|
568
584
|
if (
|
|
569
585
|
event.key === 'Escape' &&
|
|
570
|
-
!this.modal &&
|
|
571
586
|
!this.noCloseOnEsc &&
|
|
572
587
|
this.opened &&
|
|
573
588
|
!this.__isManual &&
|
|
@@ -577,16 +592,84 @@ class Popover extends PopoverPositionMixin(
|
|
|
577
592
|
event.stopPropagation();
|
|
578
593
|
this._openedStateController.close(true);
|
|
579
594
|
}
|
|
595
|
+
|
|
596
|
+
// Include popover content in the Tab order after the target.
|
|
597
|
+
if (event.key === 'Tab') {
|
|
598
|
+
if (event.shiftKey) {
|
|
599
|
+
this.__onGlobalShiftTab(event);
|
|
600
|
+
} else {
|
|
601
|
+
this.__onGlobalTab(event);
|
|
602
|
+
}
|
|
603
|
+
}
|
|
604
|
+
}
|
|
605
|
+
|
|
606
|
+
/** @private */
|
|
607
|
+
__onGlobalTab(event) {
|
|
608
|
+
const overlayPart = this._overlayElement.$.overlay;
|
|
609
|
+
|
|
610
|
+
// Move focus to the popover content on target element Tab
|
|
611
|
+
if (this.target && isElementFocused(this.target)) {
|
|
612
|
+
event.preventDefault();
|
|
613
|
+
overlayPart.focus();
|
|
614
|
+
return;
|
|
615
|
+
}
|
|
616
|
+
|
|
617
|
+
// Move focus to the next element after target on content Tab
|
|
618
|
+
const lastFocusable = this.__getLastFocusable(overlayPart);
|
|
619
|
+
if (lastFocusable && isElementFocused(lastFocusable)) {
|
|
620
|
+
const focusable = this.__getNextBodyFocusable(this.target);
|
|
621
|
+
if (focusable && focusable !== overlayPart) {
|
|
622
|
+
event.preventDefault();
|
|
623
|
+
focusable.focus();
|
|
624
|
+
return;
|
|
625
|
+
}
|
|
626
|
+
}
|
|
627
|
+
|
|
628
|
+
// Prevent focusing the popover content on previous element Tab
|
|
629
|
+
const activeElement = getDeepActiveElement();
|
|
630
|
+
const nextFocusable = this.__getNextBodyFocusable(activeElement);
|
|
631
|
+
if (nextFocusable === overlayPart && lastFocusable) {
|
|
632
|
+
// Move focus to the last overlay focusable and do NOT prevent keydown
|
|
633
|
+
// to move focus outside the popover content (e.g. to the URL bar).
|
|
634
|
+
lastFocusable.focus();
|
|
635
|
+
}
|
|
580
636
|
}
|
|
581
637
|
|
|
582
638
|
/** @private */
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
639
|
+
__onGlobalShiftTab(event) {
|
|
640
|
+
const overlayPart = this._overlayElement.$.overlay;
|
|
641
|
+
|
|
642
|
+
// Move focus back to the target on overlay content Shift + Tab
|
|
643
|
+
if (this.target && isElementFocused(overlayPart)) {
|
|
644
|
+
event.preventDefault();
|
|
645
|
+
this.target.focus();
|
|
646
|
+
return;
|
|
647
|
+
}
|
|
648
|
+
|
|
649
|
+
// Move focus back to the popover on next element Shift + Tab
|
|
650
|
+
const nextFocusable = this.__getNextBodyFocusable(this.target);
|
|
651
|
+
if (nextFocusable && isElementFocused(nextFocusable)) {
|
|
652
|
+
const lastFocusable = this.__getLastFocusable(overlayPart);
|
|
653
|
+
if (lastFocusable) {
|
|
654
|
+
event.preventDefault();
|
|
655
|
+
lastFocusable.focus();
|
|
656
|
+
}
|
|
587
657
|
}
|
|
588
658
|
}
|
|
589
659
|
|
|
660
|
+
/** @private */
|
|
661
|
+
__getNextBodyFocusable(target) {
|
|
662
|
+
const focusables = getFocusableElements(document.body);
|
|
663
|
+
const idx = focusables.findIndex((el) => el === target);
|
|
664
|
+
return focusables[idx + 1];
|
|
665
|
+
}
|
|
666
|
+
|
|
667
|
+
/** @private */
|
|
668
|
+
__getLastFocusable(container) {
|
|
669
|
+
const focusables = getFocusableElements(container);
|
|
670
|
+
return focusables.pop();
|
|
671
|
+
}
|
|
672
|
+
|
|
590
673
|
/** @private */
|
|
591
674
|
__onTargetFocusIn() {
|
|
592
675
|
this.__focusInside = true;
|
|
@@ -708,6 +791,13 @@ class Popover extends PopoverPositionMixin(
|
|
|
708
791
|
this.opened = event.detail.value;
|
|
709
792
|
}
|
|
710
793
|
|
|
794
|
+
/** @private */
|
|
795
|
+
__onOverlayOpened() {
|
|
796
|
+
if (this.autofocus && !this.modal) {
|
|
797
|
+
this._overlayElement.$.overlay.focus();
|
|
798
|
+
}
|
|
799
|
+
}
|
|
800
|
+
|
|
711
801
|
/** @private */
|
|
712
802
|
__onOverlayClosed() {
|
|
713
803
|
// Reset restoring focus state after a timeout to make sure focus was restored
|
package/web-types.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/web-types",
|
|
3
3
|
"name": "@vaadin/popover",
|
|
4
|
-
"version": "24.5.0-
|
|
4
|
+
"version": "24.5.0-alpha8",
|
|
5
5
|
"description-markup": "markdown",
|
|
6
6
|
"contributions": {
|
|
7
7
|
"html": {
|
|
8
8
|
"elements": [
|
|
9
9
|
{
|
|
10
10
|
"name": "vaadin-popover",
|
|
11
|
-
"description": "`<vaadin-popover>` is a Web Component for creating overlays\nthat are positioned next to specified DOM element (target).\n\nUnlike `<vaadin-tooltip>`, the popover supports rich content\nthat can be provided by using `renderer` function.\n\n### Styling\n\n`<vaadin-popover>` uses `<vaadin-popover-overlay>` internal\nthemable component as the actual visible overlay.\n\nSee [`<vaadin-overlay>`](https://cdn.vaadin.com/vaadin-web-components/24.5.0-
|
|
11
|
+
"description": "`<vaadin-popover>` is a Web Component for creating overlays\nthat are positioned next to specified DOM element (target).\n\nUnlike `<vaadin-tooltip>`, the popover supports rich content\nthat can be provided by using `renderer` function.\n\n### Styling\n\n`<vaadin-popover>` uses `<vaadin-popover-overlay>` internal\nthemable component as the actual visible overlay.\n\nSee [`<vaadin-overlay>`](https://cdn.vaadin.com/vaadin-web-components/24.5.0-alpha8/#/elements/vaadin-overlay) documentation\nfor `<vaadin-popover-overlay>` parts.\n\nIn addition to `<vaadin-overlay>` parts, the following parts are available for styling:\n\nPart name | Description\n-----------------|-------------------------------------------\n`arrow` | Optional arrow pointing to the target when using `theme=\"arrow\"`\n\nThe following state attributes are available for styling:\n\nAttribute | Description\n-----------------|----------------------------------------\n`position` | Reflects the `position` property value.\n\nNote: the `theme` attribute value set on `<vaadin-popover>` is\npropagated to the internal `<vaadin-popover-overlay>` component.\n\n### Custom CSS Properties\n\nThe following custom CSS properties are available on the `<vaadin-popover>` element:\n\nCustom CSS property | Description\n---------------------------------|-------------\n`--vaadin-popover-offset-top` | Used as an offset when the popover is aligned vertically below the target\n`--vaadin-popover-offset-bottom` | Used as an offset when the popover is aligned vertically above the target\n`--vaadin-popover-offset-start` | Used as an offset when the popover is aligned horizontally after the target\n`--vaadin-popover-offset-end` | Used as an offset when the popover is aligned horizontally before the target\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.",
|
|
12
12
|
"attributes": [
|
|
13
13
|
{
|
|
14
14
|
"name": "position",
|
|
@@ -54,6 +54,17 @@
|
|
|
54
54
|
]
|
|
55
55
|
}
|
|
56
56
|
},
|
|
57
|
+
{
|
|
58
|
+
"name": "autofocus",
|
|
59
|
+
"description": "When true, the popover content automatically receives focus after\nit is opened. Modal popovers use this behavior by default.",
|
|
60
|
+
"value": {
|
|
61
|
+
"type": [
|
|
62
|
+
"boolean",
|
|
63
|
+
"null",
|
|
64
|
+
"undefined"
|
|
65
|
+
]
|
|
66
|
+
}
|
|
67
|
+
},
|
|
57
68
|
{
|
|
58
69
|
"name": "content-height",
|
|
59
70
|
"description": "Height to be set on the overlay content.",
|
|
@@ -244,6 +255,17 @@
|
|
|
244
255
|
]
|
|
245
256
|
}
|
|
246
257
|
},
|
|
258
|
+
{
|
|
259
|
+
"name": "autofocus",
|
|
260
|
+
"description": "When true, the popover content automatically receives focus after\nit is opened. Modal popovers use this behavior by default.",
|
|
261
|
+
"value": {
|
|
262
|
+
"type": [
|
|
263
|
+
"boolean",
|
|
264
|
+
"null",
|
|
265
|
+
"undefined"
|
|
266
|
+
]
|
|
267
|
+
}
|
|
268
|
+
},
|
|
247
269
|
{
|
|
248
270
|
"name": "contentHeight",
|
|
249
271
|
"description": "Height to be set on the overlay content.",
|
package/web-types.lit.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/web-types",
|
|
3
3
|
"name": "@vaadin/popover",
|
|
4
|
-
"version": "24.5.0-
|
|
4
|
+
"version": "24.5.0-alpha8",
|
|
5
5
|
"description-markup": "markdown",
|
|
6
6
|
"framework": "lit",
|
|
7
7
|
"framework-config": {
|
|
@@ -16,9 +16,16 @@
|
|
|
16
16
|
"elements": [
|
|
17
17
|
{
|
|
18
18
|
"name": "vaadin-popover",
|
|
19
|
-
"description": "`<vaadin-popover>` is a Web Component for creating overlays\nthat are positioned next to specified DOM element (target).\n\nUnlike `<vaadin-tooltip>`, the popover supports rich content\nthat can be provided by using `renderer` function.\n\n### Styling\n\n`<vaadin-popover>` uses `<vaadin-popover-overlay>` internal\nthemable component as the actual visible overlay.\n\nSee [`<vaadin-overlay>`](https://cdn.vaadin.com/vaadin-web-components/24.5.0-
|
|
19
|
+
"description": "`<vaadin-popover>` is a Web Component for creating overlays\nthat are positioned next to specified DOM element (target).\n\nUnlike `<vaadin-tooltip>`, the popover supports rich content\nthat can be provided by using `renderer` function.\n\n### Styling\n\n`<vaadin-popover>` uses `<vaadin-popover-overlay>` internal\nthemable component as the actual visible overlay.\n\nSee [`<vaadin-overlay>`](https://cdn.vaadin.com/vaadin-web-components/24.5.0-alpha8/#/elements/vaadin-overlay) documentation\nfor `<vaadin-popover-overlay>` parts.\n\nIn addition to `<vaadin-overlay>` parts, the following parts are available for styling:\n\nPart name | Description\n-----------------|-------------------------------------------\n`arrow` | Optional arrow pointing to the target when using `theme=\"arrow\"`\n\nThe following state attributes are available for styling:\n\nAttribute | Description\n-----------------|----------------------------------------\n`position` | Reflects the `position` property value.\n\nNote: the `theme` attribute value set on `<vaadin-popover>` is\npropagated to the internal `<vaadin-popover-overlay>` component.\n\n### Custom CSS Properties\n\nThe following custom CSS properties are available on the `<vaadin-popover>` element:\n\nCustom CSS property | Description\n---------------------------------|-------------\n`--vaadin-popover-offset-top` | Used as an offset when the popover is aligned vertically below the target\n`--vaadin-popover-offset-bottom` | Used as an offset when the popover is aligned vertically above the target\n`--vaadin-popover-offset-start` | Used as an offset when the popover is aligned horizontally after the target\n`--vaadin-popover-offset-end` | Used as an offset when the popover is aligned horizontally before the target\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.",
|
|
20
20
|
"extension": true,
|
|
21
21
|
"attributes": [
|
|
22
|
+
{
|
|
23
|
+
"name": "?autofocus",
|
|
24
|
+
"description": "When true, the popover content automatically receives focus after\nit is opened. Modal popovers use this behavior by default.",
|
|
25
|
+
"value": {
|
|
26
|
+
"kind": "expression"
|
|
27
|
+
}
|
|
28
|
+
},
|
|
22
29
|
{
|
|
23
30
|
"name": "?opened",
|
|
24
31
|
"description": "True if the popover overlay is opened, false otherwise.",
|