@m3e/web 2.1.3 → 2.2.0

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.
Files changed (185) hide show
  1. package/README.md +3 -0
  2. package/dist/all.js +2765 -343
  3. package/dist/all.js.map +1 -1
  4. package/dist/all.min.js +77 -41
  5. package/dist/all.min.js.map +1 -1
  6. package/dist/app-bar.js +14 -7
  7. package/dist/app-bar.js.map +1 -1
  8. package/dist/app-bar.min.js +1 -1
  9. package/dist/app-bar.min.js.map +1 -1
  10. package/dist/autocomplete.js +5 -9
  11. package/dist/autocomplete.js.map +1 -1
  12. package/dist/autocomplete.min.js +1 -1
  13. package/dist/autocomplete.min.js.map +1 -1
  14. package/dist/bottom-sheet.js +8 -27
  15. package/dist/bottom-sheet.js.map +1 -1
  16. package/dist/bottom-sheet.min.js +1 -1
  17. package/dist/bottom-sheet.min.js.map +1 -1
  18. package/dist/calendar.js +1082 -0
  19. package/dist/calendar.js.map +1 -0
  20. package/dist/calendar.min.js +43 -0
  21. package/dist/calendar.min.js.map +1 -0
  22. package/dist/chips.js +2 -6
  23. package/dist/chips.js.map +1 -1
  24. package/dist/chips.min.js +1 -1
  25. package/dist/chips.min.js.map +1 -1
  26. package/dist/core-a11y.js +23 -9
  27. package/dist/core-a11y.js.map +1 -1
  28. package/dist/core-a11y.min.js +4 -4
  29. package/dist/core-a11y.min.js.map +1 -1
  30. package/dist/core-anchoring.js +135 -15
  31. package/dist/core-anchoring.js.map +1 -1
  32. package/dist/core-anchoring.min.js +1 -1
  33. package/dist/core-anchoring.min.js.map +1 -1
  34. package/dist/core.js +101 -1
  35. package/dist/core.js.map +1 -1
  36. package/dist/core.min.js +1 -1
  37. package/dist/core.min.js.map +1 -1
  38. package/dist/css-custom-data.json +819 -319
  39. package/dist/custom-elements.json +16252 -11972
  40. package/dist/datepicker.js +552 -0
  41. package/dist/datepicker.js.map +1 -0
  42. package/dist/datepicker.min.js +7 -0
  43. package/dist/datepicker.min.js.map +1 -0
  44. package/dist/fab-menu.js +1 -1
  45. package/dist/fab-menu.js.map +1 -1
  46. package/dist/fab-menu.min.js +1 -1
  47. package/dist/fab-menu.min.js.map +1 -1
  48. package/dist/form-field.js +2 -6
  49. package/dist/form-field.js.map +1 -1
  50. package/dist/form-field.min.js +3 -3
  51. package/dist/form-field.min.js.map +1 -1
  52. package/dist/html-custom-data.json +478 -112
  53. package/dist/menu.js +3 -7
  54. package/dist/menu.js.map +1 -1
  55. package/dist/menu.min.js +1 -1
  56. package/dist/menu.min.js.map +1 -1
  57. package/dist/nav-menu.js +3 -11
  58. package/dist/nav-menu.js.map +1 -1
  59. package/dist/nav-menu.min.js +1 -1
  60. package/dist/nav-menu.min.js.map +1 -1
  61. package/dist/nav-rail.js +2 -6
  62. package/dist/nav-rail.js.map +1 -1
  63. package/dist/nav-rail.min.js +1 -1
  64. package/dist/nav-rail.min.js.map +1 -1
  65. package/dist/option.js +3 -7
  66. package/dist/option.js.map +1 -1
  67. package/dist/option.min.js +1 -1
  68. package/dist/option.min.js.map +1 -1
  69. package/dist/paginator.js.map +1 -1
  70. package/dist/paginator.min.js.map +1 -1
  71. package/dist/search.js +805 -0
  72. package/dist/search.js.map +1 -0
  73. package/dist/search.min.js +7 -0
  74. package/dist/search.min.js.map +1 -0
  75. package/dist/select.js +3 -14
  76. package/dist/select.js.map +1 -1
  77. package/dist/select.min.js +1 -1
  78. package/dist/select.min.js.map +1 -1
  79. package/dist/snackbar.js +2 -6
  80. package/dist/snackbar.js.map +1 -1
  81. package/dist/snackbar.min.js +1 -1
  82. package/dist/snackbar.min.js.map +1 -1
  83. package/dist/src/all.d.ts +3 -0
  84. package/dist/src/all.d.ts.map +1 -1
  85. package/dist/src/app-bar/AppBarElement.d.ts +6 -4
  86. package/dist/src/app-bar/AppBarElement.d.ts.map +1 -1
  87. package/dist/src/autocomplete/AutocompleteElement.d.ts +2 -2
  88. package/dist/src/autocomplete/AutocompleteElement.d.ts.map +1 -1
  89. package/dist/src/autocomplete/AutocompleteQueryEventDetail.d.ts +12 -0
  90. package/dist/src/autocomplete/AutocompleteQueryEventDetail.d.ts.map +1 -0
  91. package/dist/src/autocomplete/QueryEventDetail.d.ts +3 -8
  92. package/dist/src/autocomplete/QueryEventDetail.d.ts.map +1 -1
  93. package/dist/src/autocomplete/index.d.ts +1 -0
  94. package/dist/src/autocomplete/index.d.ts.map +1 -1
  95. package/dist/src/bottom-sheet/BottomSheetElement.d.ts.map +1 -1
  96. package/dist/src/calendar/CalendarElement.d.ts +213 -0
  97. package/dist/src/calendar/CalendarElement.d.ts.map +1 -0
  98. package/dist/src/calendar/CalendarView.d.ts +3 -0
  99. package/dist/src/calendar/CalendarView.d.ts.map +1 -0
  100. package/dist/src/calendar/CalendarViewElementBase.d.ts +28 -0
  101. package/dist/src/calendar/CalendarViewElementBase.d.ts.map +1 -0
  102. package/dist/src/calendar/MonthViewElement.d.ts +36 -0
  103. package/dist/src/calendar/MonthViewElement.d.ts.map +1 -0
  104. package/dist/src/calendar/MultiYearViewElement.d.ts +27 -0
  105. package/dist/src/calendar/MultiYearViewElement.d.ts.map +1 -0
  106. package/dist/src/calendar/YearViewElement.d.ts +27 -0
  107. package/dist/src/calendar/YearViewElement.d.ts.map +1 -0
  108. package/dist/src/calendar/index.d.ts +7 -0
  109. package/dist/src/calendar/index.d.ts.map +1 -0
  110. package/dist/src/calendar/utils.d.ts +24 -0
  111. package/dist/src/calendar/utils.d.ts.map +1 -0
  112. package/dist/src/chips/InputChipSetElement.d.ts.map +1 -1
  113. package/dist/src/core/a11y/FocusTrapElement.d.ts.map +1 -1
  114. package/dist/src/core/a11y/InteractivityChecker.d.ts.map +1 -1
  115. package/dist/src/core/anchoring/AnchorOptions.d.ts +1 -1
  116. package/dist/src/core/anchoring/AnchorOptions.d.ts.map +1 -1
  117. package/dist/src/core/anchoring/FloatingPanelElement.d.ts +18 -3
  118. package/dist/src/core/anchoring/FloatingPanelElement.d.ts.map +1 -1
  119. package/dist/src/core/anchoring/positionAnchor.d.ts.map +1 -1
  120. package/dist/src/core/shared/controllers/InertController.d.ts +19 -0
  121. package/dist/src/core/shared/controllers/InertController.d.ts.map +1 -0
  122. package/dist/src/core/shared/controllers/index.d.ts +1 -0
  123. package/dist/src/core/shared/controllers/index.d.ts.map +1 -1
  124. package/dist/src/core/shared/converters/dateConverter.d.ts +4 -0
  125. package/dist/src/core/shared/converters/dateConverter.d.ts.map +1 -0
  126. package/dist/src/core/shared/converters/index.d.ts +1 -0
  127. package/dist/src/core/shared/converters/index.d.ts.map +1 -1
  128. package/dist/src/core/shared/utils/index.d.ts +1 -0
  129. package/dist/src/core/shared/utils/index.d.ts.map +1 -1
  130. package/dist/src/core/shared/utils/registerStyleSheet.d.ts +7 -0
  131. package/dist/src/core/shared/utils/registerStyleSheet.d.ts.map +1 -0
  132. package/dist/src/datepicker/DatepickerElement.d.ts +237 -0
  133. package/dist/src/datepicker/DatepickerElement.d.ts.map +1 -0
  134. package/dist/src/datepicker/DatepickerToggleElement.d.ts +21 -0
  135. package/dist/src/datepicker/DatepickerToggleElement.d.ts.map +1 -0
  136. package/dist/src/datepicker/DatepickerVariant.d.ts +3 -0
  137. package/dist/src/datepicker/DatepickerVariant.d.ts.map +1 -0
  138. package/dist/src/datepicker/index.d.ts +4 -0
  139. package/dist/src/datepicker/index.d.ts.map +1 -0
  140. package/dist/src/form-field/FormFieldElement.d.ts.map +1 -1
  141. package/dist/src/menu/MenuElement.d.ts.map +1 -1
  142. package/dist/src/nav-menu/NavMenuElement.d.ts.map +1 -1
  143. package/dist/src/nav-menu/NavMenuItemElement.d.ts.map +1 -1
  144. package/dist/src/nav-rail/NavRailElement.d.ts.map +1 -1
  145. package/dist/src/option/OptionPanelElement.d.ts.map +1 -1
  146. package/dist/src/paginator/PageEventDetail.d.ts +6 -11
  147. package/dist/src/paginator/PageEventDetail.d.ts.map +1 -1
  148. package/dist/src/paginator/PaginatorElement.d.ts +2 -2
  149. package/dist/src/paginator/PaginatorElement.d.ts.map +1 -1
  150. package/dist/src/paginator/PaginatorPageEventDetail.d.ts +12 -0
  151. package/dist/src/paginator/PaginatorPageEventDetail.d.ts.map +1 -0
  152. package/dist/src/paginator/index.d.ts +1 -0
  153. package/dist/src/paginator/index.d.ts.map +1 -1
  154. package/dist/src/search/SearchBarElement.d.ts +92 -0
  155. package/dist/src/search/SearchBarElement.d.ts.map +1 -0
  156. package/dist/src/search/SearchViewElement.d.ts +146 -0
  157. package/dist/src/search/SearchViewElement.d.ts.map +1 -0
  158. package/dist/src/search/SearchViewMode.d.ts +3 -0
  159. package/dist/src/search/SearchViewMode.d.ts.map +1 -0
  160. package/dist/src/search/SearchViewQueryEventDetail.d.ts +12 -0
  161. package/dist/src/search/SearchViewQueryEventDetail.d.ts.map +1 -0
  162. package/dist/src/search/index.d.ts +5 -0
  163. package/dist/src/search/index.d.ts.map +1 -0
  164. package/dist/src/search/styles/SearchBarStyle.d.ts +12 -0
  165. package/dist/src/search/styles/SearchBarStyle.d.ts.map +1 -0
  166. package/dist/src/search/styles/SearchBarToken.d.ts +27 -0
  167. package/dist/src/search/styles/SearchBarToken.d.ts.map +1 -0
  168. package/dist/src/search/styles/SearchViewStyle.d.ts +12 -0
  169. package/dist/src/search/styles/SearchViewStyle.d.ts.map +1 -0
  170. package/dist/src/search/styles/SearchViewToken.d.ts +26 -0
  171. package/dist/src/search/styles/SearchViewToken.d.ts.map +1 -0
  172. package/dist/src/search/styles/index.d.ts +3 -0
  173. package/dist/src/search/styles/index.d.ts.map +1 -0
  174. package/dist/src/select/SelectElement.d.ts.map +1 -1
  175. package/dist/src/snackbar/SnackbarElement.d.ts.map +1 -1
  176. package/dist/src/stepper/StepperElement.d.ts.map +1 -1
  177. package/dist/stepper.js +2 -6
  178. package/dist/stepper.js.map +1 -1
  179. package/dist/stepper.min.js +1 -1
  180. package/dist/stepper.min.js.map +1 -1
  181. package/dist/tooltip.js +1 -1
  182. package/dist/tooltip.js.map +1 -1
  183. package/dist/tooltip.min.js +1 -1
  184. package/dist/tooltip.min.js.map +1 -1
  185. package/package.json +16 -1
@@ -6,7 +6,7 @@
6
6
  import { __classPrivateFieldGet, __classPrivateFieldSet, __decorate } from 'tslib';
7
7
  import { LitElement, html, unsafeCSS, css } from 'lit';
8
8
  import { property } from 'lit/decorators.js';
9
- import { SuppressInitialAnimation, AttachInternals, ScrollController, DesignToken, customElement, setCustomState } from '@m3e/web/core';
9
+ import { SuppressInitialAnimation, AttachInternals, ScrollController, ResizeController, DesignToken, customElement, setCustomState } from '@m3e/web/core';
10
10
  import { M3eDirectionality } from '@m3e/web/core/bidi';
11
11
 
12
12
  /**
@@ -787,6 +787,74 @@ const shift$1 = function (options) {
787
787
  }
788
788
  };
789
789
  };
790
+ /**
791
+ * Built-in `limiter` that will stop `shift()` at a certain point.
792
+ */
793
+ const limitShift$1 = function (options) {
794
+ if (options === void 0) {
795
+ options = {};
796
+ }
797
+ return {
798
+ options,
799
+ fn(state) {
800
+ const {
801
+ x,
802
+ y,
803
+ placement,
804
+ rects,
805
+ middlewareData
806
+ } = state;
807
+ const {
808
+ offset = 0,
809
+ mainAxis: checkMainAxis = true,
810
+ crossAxis: checkCrossAxis = true
811
+ } = evaluate(options, state);
812
+ const coords = {
813
+ x,
814
+ y
815
+ };
816
+ const crossAxis = getSideAxis(placement);
817
+ const mainAxis = getOppositeAxis(crossAxis);
818
+ let mainAxisCoord = coords[mainAxis];
819
+ let crossAxisCoord = coords[crossAxis];
820
+ const rawOffset = evaluate(offset, state);
821
+ const computedOffset = typeof rawOffset === 'number' ? {
822
+ mainAxis: rawOffset,
823
+ crossAxis: 0
824
+ } : {
825
+ mainAxis: 0,
826
+ crossAxis: 0,
827
+ ...rawOffset
828
+ };
829
+ if (checkMainAxis) {
830
+ const len = mainAxis === 'y' ? 'height' : 'width';
831
+ const limitMin = rects.reference[mainAxis] - rects.floating[len] + computedOffset.mainAxis;
832
+ const limitMax = rects.reference[mainAxis] + rects.reference[len] - computedOffset.mainAxis;
833
+ if (mainAxisCoord < limitMin) {
834
+ mainAxisCoord = limitMin;
835
+ } else if (mainAxisCoord > limitMax) {
836
+ mainAxisCoord = limitMax;
837
+ }
838
+ }
839
+ if (checkCrossAxis) {
840
+ var _middlewareData$offse, _middlewareData$offse2;
841
+ const len = mainAxis === 'y' ? 'width' : 'height';
842
+ const isOriginSide = originSides.has(getSide(placement));
843
+ const limitMin = rects.reference[crossAxis] - rects.floating[len] + (isOriginSide ? ((_middlewareData$offse = middlewareData.offset) == null ? void 0 : _middlewareData$offse[crossAxis]) || 0 : 0) + (isOriginSide ? 0 : computedOffset.crossAxis);
844
+ const limitMax = rects.reference[crossAxis] + rects.reference[len] + (isOriginSide ? 0 : ((_middlewareData$offse2 = middlewareData.offset) == null ? void 0 : _middlewareData$offse2[crossAxis]) || 0) - (isOriginSide ? computedOffset.crossAxis : 0);
845
+ if (crossAxisCoord < limitMin) {
846
+ crossAxisCoord = limitMin;
847
+ } else if (crossAxisCoord > limitMax) {
848
+ crossAxisCoord = limitMax;
849
+ }
850
+ }
851
+ return {
852
+ [mainAxis]: mainAxisCoord,
853
+ [crossAxis]: crossAxisCoord
854
+ };
855
+ }
856
+ };
857
+ };
790
858
 
791
859
  function hasWindow() {
792
860
  return typeof window !== 'undefined';
@@ -1659,6 +1727,11 @@ const flip = flip$1;
1659
1727
  */
1660
1728
  const inline = inline$1;
1661
1729
 
1730
+ /**
1731
+ * Built-in `limiter` that will stop `shift()` at a certain point.
1732
+ */
1733
+ const limitShift = limitShift$1;
1734
+
1662
1735
  /**
1663
1736
  * Computes the `x` and `y` coordinates that will place the floating element
1664
1737
  * next to a given reference element.
@@ -1743,7 +1816,11 @@ async function positionAnchor(target, anchor, options, update) {
1743
1816
  }));
1744
1817
  }
1745
1818
  if (options.shift) {
1746
- middleware.push(shift());
1819
+ middleware.push(shift({
1820
+ mainAxis: options.shift === "main" || options.shift === "both",
1821
+ crossAxis: options.shift === "cross" || options.shift === "both",
1822
+ limiter: limitShift()
1823
+ }));
1747
1824
  }
1748
1825
  if (options.offset && !isNaN(options.offset)) {
1749
1826
  middleware.push(offset(options.offset));
@@ -1762,13 +1839,15 @@ async function positionAnchor(target, anchor, options, update) {
1762
1839
  return autoUpdate(anchor, target, async () => await computeAnchorPosition());
1763
1840
  }
1764
1841
 
1765
- var _M3eFloatingPanelElement_instances, _M3eFloatingPanelElement_trigger, _M3eFloatingPanelElement_anchor, _M3eFloatingPanelElement_anchorCleanup, _M3eFloatingPanelElement_documentClickHandler, _M3eFloatingPanelElement_toggleHandler, _M3eFloatingPanelElement_scrollController, _M3eFloatingPanelElement_handleDocumentClick;
1842
+ var _M3eFloatingPanelElement_instances, _M3eFloatingPanelElement_trigger, _M3eFloatingPanelElement_anchor, _M3eFloatingPanelElement_anchorCleanup, _M3eFloatingPanelElement_documentClickHandler, _M3eFloatingPanelElement_toggleHandler, _M3eFloatingPanelElement_scrollController, _M3eFloatingPanelElement_anchorResizeController, _M3eFloatingPanelElement_handleDocumentClick;
1766
1843
  /**
1767
1844
  * A lightweight, generic floating surface used to present content above the page.
1768
1845
  *
1769
1846
  * @tag m3e-floating-panel
1770
1847
  *
1771
1848
  * @attr scroll-strategy - The strategy that controls how the panel behaves when its trigger scrolls.
1849
+ * @attr fit-anchor-width - Whether the panel's width should match its anchor's width.
1850
+ * @attr anchor-offset - The logical margin, in pixels, between the panel and its anchor.
1772
1851
  *
1773
1852
  * @slot - Renders the contents of the panel.
1774
1853
  *
@@ -1808,8 +1887,30 @@ let M3eFloatingPanelElement = class M3eFloatingPanelElement extends SuppressInit
1808
1887
  target: null,
1809
1888
  callback: () => this.hide(false)
1810
1889
  }));
1811
- /** The strategy that controls how the panel behaves when its trigger scrolls. */
1890
+ /** @private */
1891
+ _M3eFloatingPanelElement_anchorResizeController.set(this, new ResizeController(this, {
1892
+ target: null,
1893
+ callback: () => {
1894
+ if (__classPrivateFieldGet(this, _M3eFloatingPanelElement_anchor, "f") && this.fitAnchorWidth) {
1895
+ this.style.minWidth = `${__classPrivateFieldGet(this, _M3eFloatingPanelElement_anchor, "f").clientWidth}px`;
1896
+ }
1897
+ }
1898
+ }));
1899
+ /**
1900
+ * The strategy that controls how the panel behaves when its trigger scrolls.
1901
+ * @default "hide"
1902
+ */
1812
1903
  this.scrollStrategy = "hide";
1904
+ /**
1905
+ * Whether the panel's width should match its anchor's width.
1906
+ * @default false
1907
+ */
1908
+ this.fitAnchorWidth = false;
1909
+ /**
1910
+ * The logical margin, in pixels, between the panel and its anchor.
1911
+ * @default 0
1912
+ */
1913
+ this.anchorOffset = 0;
1813
1914
  }
1814
1915
  /** Whether the panel is open. */
1815
1916
  get isOpen() {
@@ -1835,17 +1936,28 @@ let M3eFloatingPanelElement = class M3eFloatingPanelElement extends SuppressInit
1835
1936
  /**
1836
1937
  * Opens the panel.
1837
1938
  * @param {HTMLElement} trigger The element that triggered the panel.
1838
- * @param {HTMLElement | undefined} anchor The element used to position the panel.
1939
+ * @param {HTMLElement | null | undefined} anchor The element used to position the panel.
1839
1940
  * @returns {Promise<void>} A `Promise` that resolves when the panel is opened.
1840
1941
  */
1841
1942
  async show(trigger, anchor) {
1842
1943
  if (__classPrivateFieldGet(this, _M3eFloatingPanelElement_trigger, "f") && __classPrivateFieldGet(this, _M3eFloatingPanelElement_trigger, "f") !== trigger) {
1843
1944
  this.hide();
1844
1945
  }
1845
- __classPrivateFieldSet(this, _M3eFloatingPanelElement_anchorCleanup, await positionAnchor(this, anchor ?? trigger, {
1946
+ __classPrivateFieldSet(this, _M3eFloatingPanelElement_trigger, trigger, "f");
1947
+ __classPrivateFieldGet(this, _M3eFloatingPanelElement_trigger, "f").ariaExpanded = "true";
1948
+ __classPrivateFieldSet(this, _M3eFloatingPanelElement_anchor, anchor ?? trigger, "f");
1949
+ if (this.scrollStrategy === "hide") {
1950
+ __classPrivateFieldGet(this, _M3eFloatingPanelElement_scrollController, "f").observe(__classPrivateFieldGet(this, _M3eFloatingPanelElement_anchor, "f"));
1951
+ }
1952
+ if (this.fitAnchorWidth) {
1953
+ __classPrivateFieldGet(this, _M3eFloatingPanelElement_anchorResizeController, "f").observe(__classPrivateFieldGet(this, _M3eFloatingPanelElement_anchor, "f"));
1954
+ this.style.minWidth = `${__classPrivateFieldGet(this, _M3eFloatingPanelElement_anchor, "f").clientWidth}px`;
1955
+ }
1956
+ __classPrivateFieldSet(this, _M3eFloatingPanelElement_anchorCleanup, await positionAnchor(this, __classPrivateFieldGet(this, _M3eFloatingPanelElement_anchor, "f"), {
1846
1957
  position: "bottom-start",
1847
1958
  inline: true,
1848
- flip: true
1959
+ flip: true,
1960
+ offset: this.anchorOffset > 0 ? this.anchorOffset : undefined
1849
1961
  }, (x, y, position) => {
1850
1962
  setCustomState(this, "-top", position.includes("top"));
1851
1963
  setCustomState(this, "-bottom", position.includes("bottom"));
@@ -1859,12 +1971,6 @@ let M3eFloatingPanelElement = class M3eFloatingPanelElement extends SuppressInit
1859
1971
  this.style.top = `${y}px`;
1860
1972
  }), "f");
1861
1973
  this.showPopover();
1862
- __classPrivateFieldSet(this, _M3eFloatingPanelElement_trigger, trigger, "f");
1863
- __classPrivateFieldGet(this, _M3eFloatingPanelElement_trigger, "f").ariaExpanded = "true";
1864
- __classPrivateFieldSet(this, _M3eFloatingPanelElement_anchor, anchor, "f");
1865
- if (this.scrollStrategy === "hide") {
1866
- __classPrivateFieldGet(this, _M3eFloatingPanelElement_scrollController, "f").observe(__classPrivateFieldGet(this, _M3eFloatingPanelElement_anchor, "f") ?? __classPrivateFieldGet(this, _M3eFloatingPanelElement_trigger, "f"));
1867
- }
1868
1974
  }
1869
1975
  /**
1870
1976
  * Hides the panel.
@@ -1877,7 +1983,12 @@ let M3eFloatingPanelElement = class M3eFloatingPanelElement extends SuppressInit
1877
1983
  if (restoreFocus) {
1878
1984
  __classPrivateFieldGet(this, _M3eFloatingPanelElement_trigger, "f").focus();
1879
1985
  }
1880
- __classPrivateFieldGet(this, _M3eFloatingPanelElement_scrollController, "f").unobserve(__classPrivateFieldGet(this, _M3eFloatingPanelElement_anchor, "f") ?? __classPrivateFieldGet(this, _M3eFloatingPanelElement_trigger, "f"));
1986
+ if (__classPrivateFieldGet(this, _M3eFloatingPanelElement_anchor, "f")) {
1987
+ __classPrivateFieldGet(this, _M3eFloatingPanelElement_scrollController, "f").unobserve(__classPrivateFieldGet(this, _M3eFloatingPanelElement_anchor, "f"));
1988
+ if (this.fitAnchorWidth) {
1989
+ __classPrivateFieldGet(this, _M3eFloatingPanelElement_anchorResizeController, "f").unobserve(__classPrivateFieldGet(this, _M3eFloatingPanelElement_anchor, "f"));
1990
+ }
1991
+ }
1881
1992
  __classPrivateFieldSet(this, _M3eFloatingPanelElement_trigger, undefined, "f");
1882
1993
  __classPrivateFieldSet(this, _M3eFloatingPanelElement_anchor, undefined, "f");
1883
1994
  }
@@ -1906,9 +2017,10 @@ _M3eFloatingPanelElement_anchorCleanup = new WeakMap();
1906
2017
  _M3eFloatingPanelElement_documentClickHandler = new WeakMap();
1907
2018
  _M3eFloatingPanelElement_toggleHandler = new WeakMap();
1908
2019
  _M3eFloatingPanelElement_scrollController = new WeakMap();
2020
+ _M3eFloatingPanelElement_anchorResizeController = new WeakMap();
1909
2021
  _M3eFloatingPanelElement_instances = new WeakSet();
1910
2022
  _M3eFloatingPanelElement_handleDocumentClick = function _M3eFloatingPanelElement_handleDocumentClick(e) {
1911
- if (this.isOpen && !e.composedPath().some(x => x === this || x === __classPrivateFieldGet(this, _M3eFloatingPanelElement_trigger, "f") || x === __classPrivateFieldGet(this, _M3eFloatingPanelElement_anchor, "f"))) {
2023
+ if (this.isOpen && !e.composedPath().some(x => x === this || x === __classPrivateFieldGet(this, _M3eFloatingPanelElement_anchor, "f"))) {
1912
2024
  this.hide();
1913
2025
  }
1914
2026
  };
@@ -1920,6 +2032,14 @@ M3eFloatingPanelElement.styles = css`:host { position: absolute; flex-direction:
1920
2032
  __decorate([property({
1921
2033
  attribute: "scroll-strategy"
1922
2034
  })], M3eFloatingPanelElement.prototype, "scrollStrategy", void 0);
2035
+ __decorate([property({
2036
+ attribute: "fit-anchor-width",
2037
+ type: Boolean
2038
+ })], M3eFloatingPanelElement.prototype, "fitAnchorWidth", void 0);
2039
+ __decorate([property({
2040
+ attribute: "anchor-offset",
2041
+ type: Number
2042
+ })], M3eFloatingPanelElement.prototype, "anchorOffset", void 0);
1923
2043
  M3eFloatingPanelElement = __decorate([customElement("m3e-floating-panel")], M3eFloatingPanelElement);
1924
2044
 
1925
2045
  export { M3eFloatingPanelElement, positionAnchor };