@fluid-topics/ft-floating-menu 1.3.28 → 1.3.29
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.
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import { PropertyValues } from "lit";
|
|
1
2
|
import { ElementDefinitionsMap, FtLitElement } from "@fluid-topics/ft-wc-utils";
|
|
2
3
|
import { FtIconVariants } from "@fluid-topics/ft-icon/build/ft-icon.properties";
|
|
3
4
|
import { Position } from "@fluid-topics/ft-tooltip/build/ft-tooltip.properties";
|
|
4
|
-
import { PropertyValues } from "lit";
|
|
5
5
|
import { FtBaseFloatingMenuProperties, FtHorizontalAlignment, FtVerticalAlignment } from "./ft-base-floating-menu.properties";
|
|
6
6
|
export declare class FtFloatingMenuStatusChangeEvent extends CustomEvent<{
|
|
7
7
|
open: boolean;
|
|
@@ -49,4 +49,5 @@ export declare class FtBaseFloatingMenu extends FtLitElement implements FtBaseFl
|
|
|
49
49
|
protected contentAvailableCallback(props: PropertyValues): void;
|
|
50
50
|
private positionMenuWrapper;
|
|
51
51
|
private convertPlacement;
|
|
52
|
+
private onKeyDown;
|
|
52
53
|
}
|
|
@@ -60,7 +60,7 @@ class FtBaseFloatingMenu extends FtLitElement {
|
|
|
60
60
|
["ft-floating-menu--" + this.verticalAlignment.toLowerCase()]: true,
|
|
61
61
|
};
|
|
62
62
|
return html `
|
|
63
|
-
<div part="container" class="${classMap(classes)}">
|
|
63
|
+
<div part="container" class="${classMap(classes)}" @keydown=${this.onKeyDown}>
|
|
64
64
|
<slot name="toggle"
|
|
65
65
|
part="toggle"
|
|
66
66
|
@click=${this.toggleMenu}
|
|
@@ -155,6 +155,12 @@ class FtBaseFloatingMenu extends FtLitElement {
|
|
|
155
155
|
return this.verticalAlignment + "-center";
|
|
156
156
|
}
|
|
157
157
|
}
|
|
158
|
+
onKeyDown(e) {
|
|
159
|
+
if (e.code == "Escape") {
|
|
160
|
+
this.closeMenu();
|
|
161
|
+
e.stopPropagation();
|
|
162
|
+
}
|
|
163
|
+
}
|
|
158
164
|
}
|
|
159
165
|
FtBaseFloatingMenu.elementDefinitions = {
|
|
160
166
|
"ft-floating-menu-item": FtFloatingMenuItem,
|