@flywheel-io/vision 21.1.1 → 21.1.2

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flywheel-io/vision",
3
- "version": "21.1.1",
3
+ "version": "21.1.2",
4
4
  "description": "Flywheel UI elements provided as Angular components and native web components",
5
5
  "author": "Flywheel",
6
6
  "license": "MIT",
@@ -1649,6 +1649,11 @@ type MenuFilterFn = (filter: string, menuItems: readonly FwMenuItemComponent[])
1649
1649
  declare class FwMenuContainerComponent implements AfterViewInit {
1650
1650
  private sanitizer;
1651
1651
  private ngZone;
1652
+ /**
1653
+ * The container's own element. Exposed because this component is usually rendered into a cdk
1654
+ * overlay, so a consumer holding the instance has no other way to reach the rendered panel.
1655
+ */
1656
+ readonly hostElement: HTMLElement;
1652
1657
  menuWrapperRef: _angular_core.Signal<HTMLElement>;
1653
1658
  canScrollUp: _angular_core.WritableSignal<boolean>;
1654
1659
  canScrollDown: _angular_core.WritableSignal<boolean>;
@@ -1918,10 +1923,31 @@ declare class MenuRegisterDirective implements OnInit, OnDestroy {
1918
1923
  * Form control component for selecting multiple options from a dropdown, displaying selected values as chips
1919
1924
  * @see [Vision storybook](https://cdn.flywheel.io/docs/vision/master/?path=/docs/form-controls-multi-select--docs)
1920
1925
  */
1921
- declare class FwMultiSelectMenuComponent implements ControlValueAccessor, AfterContentInit, OnDestroy {
1926
+ declare class FwMultiSelectMenuComponent implements ControlValueAccessor, AfterContentInit, OnInit, OnDestroy {
1922
1927
  private elementRef;
1928
+ private document;
1923
1929
  readonly listboxId: string;
1924
- outsideClick(event: MouseEvent): void;
1930
+ private readonly documentClickListener;
1931
+ /**
1932
+ * Closes the options panel when a click lands outside of both the trigger and the panel.
1933
+ *
1934
+ * Registered by hand instead of through `@HostListener('document:click')` so that it runs in the
1935
+ * capture phase: a number of components in the library (`fw-menu-item`, `fw-chip`, `fw-navbar-item`,
1936
+ * the dialog backdrop, ...) call `stopPropagation()` on click, which would otherwise keep this
1937
+ * listener from ever seeing the click and leave the panel open.
1938
+ */
1939
+ outsideClick(event: Event): void;
1940
+ /**
1941
+ * Whether the options panel is currently open. The single place this class asks that question -
1942
+ * the trigger owns the state, so there is no local flag to keep in sync.
1943
+ *
1944
+ * ! Deliberately a plain method, not a `computed()` ! The trigger reports its state from the
1945
+ * overlay ref rather than from a signal, so a computed would memoize the first answer and stop
1946
+ * tracking, silently freezing `aria-expanded`.
1947
+ */
1948
+ isMenuOpen(): boolean;
1949
+ /** Whether an event originated on this select's control box or inside its rendered options panel */
1950
+ private isEventInsideSelect;
1925
1951
  readonly options: _angular_core.InputSignal<object[]>;
1926
1952
  readonly valueProperty: _angular_core.InputSignal<string>;
1927
1953
  readonly titleProperty: _angular_core.InputSignal<string>;
@@ -1945,6 +1971,12 @@ declare class FwMultiSelectMenuComponent implements ControlValueAccessor, AfterC
1945
1971
  readonly size: _angular_core.InputSignal<"large" | "medium" | "small">;
1946
1972
  trigger: CdkMenuTrigger;
1947
1973
  menu: FwMenuComponent;
1974
+ /**
1975
+ * The control itself, which is only as wide as `width()`. The host element is a block element and
1976
+ * so can be considerably wider, and a click in that gap is an outside click.
1977
+ */
1978
+ private wrapper;
1979
+ /** The options panel, `undefined` while it is closed since it only exists inside the cdk overlay */
1948
1980
  menuFilter: _angular_core.Signal<FwMenuContainerComponent>;
1949
1981
  renderedMenuItems: QueryList<FwMenuItemComponent>;
1950
1982
  customMenuItems: QueryList<FwMenuItemComponent>;
@@ -1955,7 +1987,6 @@ declare class FwMultiSelectMenuComponent implements ControlValueAccessor, AfterC
1955
1987
  focusedIndex: WritableSignal<number>;
1956
1988
  touched: boolean;
1957
1989
  private subscriptions;
1958
- private _isOpen;
1959
1990
  change: EventEmitter<any>;
1960
1991
  defaultFilter: MenuFilterFn;
1961
1992
  /**
@@ -1974,6 +2005,7 @@ declare class FwMultiSelectMenuComponent implements ControlValueAccessor, AfterC
1974
2005
  registerOnTouched(fn: () => void): void;
1975
2006
  setDisabledState?(isDisabled: boolean): void;
1976
2007
  writeValue(value: any[]): void;
2008
+ ngOnInit(): void;
1977
2009
  ngOnDestroy(): void;
1978
2010
  ngAfterContentInit(): void;
1979
2011
  private registerCustomMenuItems;
@@ -2000,8 +2032,20 @@ type DisplayFn = (menuItem: FwMenuItemComponent) => string;
2000
2032
  */
2001
2033
  declare class FwSelectMenuComponent implements OnInit, OnDestroy, ControlValueAccessor {
2002
2034
  private ngControl;
2035
+ private document;
2003
2036
  readonly listboxId: string;
2004
- outsideClick(evt: any): void;
2037
+ private readonly documentClickListener;
2038
+ /**
2039
+ * Closes the options panel when a click lands outside of both the trigger and the panel.
2040
+ *
2041
+ * Registered by hand instead of through `@HostListener('document:click')` so that it runs in the
2042
+ * capture phase: a number of components in the library (`fw-menu-item`, `fw-chip`, `fw-navbar-item`,
2043
+ * the dialog backdrop, ...) call `stopPropagation()` on click, which would otherwise keep this
2044
+ * listener from ever seeing the click and leave the panel open.
2045
+ */
2046
+ outsideClick(event: Event): void;
2047
+ /** Whether an event originated on this select's control box or inside its rendered options panel */
2048
+ private isEventInsideSelect;
2005
2049
  get disabledClass(): boolean;
2006
2050
  options: _angular_core.InputSignal<Object[]>;
2007
2051
  valueProperty: _angular_core.InputSignal<string>;
@@ -2023,6 +2067,13 @@ declare class FwSelectMenuComponent implements OnInit, OnDestroy, ControlValueAc
2023
2067
  trigger: CdkMenuTrigger;
2024
2068
  textInput: FwTextInputComponent;
2025
2069
  menu: _angular_core.Signal<FwMenuComponent>;
2070
+ /**
2071
+ * The control itself, which is only as wide as `width()`. The host element is a block element and
2072
+ * so can be considerably wider, and a click in that gap is an outside click.
2073
+ */
2074
+ private wrapper;
2075
+ /** The options panel, `undefined` while it is closed since it only exists inside the cdk overlay */
2076
+ private panel;
2026
2077
  menuItems: _angular_core.Signal<readonly FwMenuItemComponent[]>;
2027
2078
  viewMenuItems: _angular_core.Signal<readonly FwMenuItemComponent[]>;
2028
2079
  menuItemGroups: _angular_core.Signal<readonly FwMenuItemGroupComponent[]>;
@@ -2034,10 +2085,12 @@ declare class FwSelectMenuComponent implements OnInit, OnDestroy, ControlValueAc
2034
2085
  filterValue: _angular_core.WritableSignal<string>;
2035
2086
  private menuItemClickSubscriptions;
2036
2087
  private subscriptions;
2037
- private _isOpen;
2038
2088
  focused: number;
2039
2089
  inFocusOpen: boolean;
2040
2090
  preFocusValue: any;
2091
+ /** Displayed value and title as of the last time the panel was opened, used to undo a dismissed filter */
2092
+ private displayValueOnOpen;
2093
+ private displayTitleOnOpen;
2041
2094
  isTyping: _angular_core.WritableSignal<boolean>;
2042
2095
  valueDisplayFn: _angular_core.InputSignal<DisplayFn>;
2043
2096
  custom(menuItem: FwMenuItemComponent): string;
@@ -2074,6 +2127,14 @@ declare class FwSelectMenuComponent implements OnInit, OnDestroy, ControlValueAc
2074
2127
  setDisabledState(isDisabled: boolean): void;
2075
2128
  writeValue(value: any): void;
2076
2129
  handleClick(e: string): void;
2130
+ /**
2131
+ * Whether the options panel is currently open. The single place this class asks that question -
2132
+ * the trigger owns the state, so there is no local flag to keep in sync.
2133
+ *
2134
+ * ! Deliberately a plain method, not a `computed()` ! The trigger reports its state from the
2135
+ * overlay ref rather than from a signal, so a computed would memoize the first answer and stop
2136
+ * tracking, silently freezing `aria-expanded`.
2137
+ */
2077
2138
  isMenuOpen(): boolean;
2078
2139
  /**
2079
2140
  * The DOM id of the currently active/highlighted option, for aria-activedescendant on the combobox input.