@fluid-topics/ft-floating-menu 1.3.20 → 1.3.22

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.
@@ -3,6 +3,11 @@ import { FtIconVariants } from "@fluid-topics/ft-icon/build/ft-icon.properties";
3
3
  import { Position } from "@fluid-topics/ft-tooltip/build/ft-tooltip.properties";
4
4
  import { PropertyValues } from "lit";
5
5
  import { FtBaseFloatingMenuProperties, FtHorizontalAlignment, FtVerticalAlignment } from "./ft-base-floating-menu.properties";
6
+ export declare class FtFloatingMenuStatusChangeEvent extends CustomEvent<{
7
+ open: boolean;
8
+ }> {
9
+ constructor(open: boolean);
10
+ }
6
11
  export declare class FloatingMenuCloseEvent extends CustomEvent<void> {
7
12
  constructor();
8
13
  }
@@ -31,6 +36,7 @@ export declare class FtBaseFloatingMenu extends FtLitElement implements FtBaseFl
31
36
  verticalAlignment: FtVerticalAlignment;
32
37
  disabled: boolean;
33
38
  closeMenuMatchers: string[];
39
+ protected updated(props: PropertyValues): void;
34
40
  protected render(): import("lit-html").TemplateResult<1>;
35
41
  toggleMenu(): void;
36
42
  openMenu(): void;
@@ -6,11 +6,16 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
6
6
  };
7
7
  import { html } from "lit";
8
8
  import { property, query, queryAssignedElements, state } from "lit/decorators.js";
9
- import { eventPathContainsMatchingElement, FtLitElement, jsonProperty, } from "@fluid-topics/ft-wc-utils";
9
+ import { eventPathContainsMatchingElement, FtLitElement, jsonProperty } from "@fluid-topics/ft-wc-utils";
10
10
  import { classMap } from "lit/directives/class-map.js";
11
11
  import { FtFloatingMenuItem } from "./ft-floating-menu-item";
12
12
  import { FtIconVariants } from "@fluid-topics/ft-icon/build/ft-icon.properties";
13
13
  import { computeOffsetPosition } from "@fluid-topics/ft-wc-utils/build/floating";
14
+ export class FtFloatingMenuStatusChangeEvent extends CustomEvent {
15
+ constructor(open) {
16
+ super("change", { detail: { open } });
17
+ }
18
+ }
14
19
  export class FloatingMenuCloseEvent extends CustomEvent {
15
20
  constructor() {
16
21
  super("close-ft-floating-menu");
@@ -41,6 +46,12 @@ class FtBaseFloatingMenu extends FtLitElement {
41
46
  this.menuOpen = this.menuOpen && e.composedPath().includes(this.container);
42
47
  };
43
48
  }
49
+ updated(props) {
50
+ super.updated(props);
51
+ if (props.has("menuOpen")) {
52
+ this.dispatchEvent(new FtFloatingMenuStatusChangeEvent(this.menuOpen));
53
+ }
54
+ }
44
55
  render() {
45
56
  const classes = {
46
57
  "ft-floating-menu": true,
@@ -75,7 +86,7 @@ class FtBaseFloatingMenu extends FtLitElement {
75
86
  <div id="ft-floating-menu-options"
76
87
  class="ft-floating-menu--options"
77
88
  part="options"
78
- @ft-floating-menu-item-select="${this.onItemSelect}">
89
+ @ft-floating-menu-item-select=${this.onItemSelect}>
79
90
  <slot id="ft-floating-menu-content"
80
91
  @click=${this.onContentClick}
81
92
  @close-ft-floating-menu=${this.onCloseEvent}