@testgorilla/tgo-ui 9.1.0 → 9.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.
@@ -1,6 +1,6 @@
1
1
  import * as _angular_core from '@angular/core';
2
- import { OnChanges, EventEmitter, ElementRef, QueryList, ChangeDetectorRef, SimpleChanges } from '@angular/core';
3
- import { FocusableOption, FocusKeyManager } from '@angular/cdk/a11y';
2
+ import { OnChanges, EventEmitter, ElementRef, ChangeDetectorRef, DestroyRef, SimpleChanges } from '@angular/core';
3
+ import { CdkVirtualScrollViewport } from '@angular/cdk/scrolling';
4
4
  import * as i6 from '@testgorilla/tgo-ui/components/button';
5
5
  import { ButtonIconPosition } from '@testgorilla/tgo-ui/components/button';
6
6
  import * as i5 from '@testgorilla/tgo-ui/components/core';
@@ -29,6 +29,13 @@ interface OptionChangeEvent {
29
29
  option: FilterButtonOption;
30
30
  }
31
31
 
32
+ type FilterButtonRow = {
33
+ kind: 'header';
34
+ title: string;
35
+ } | {
36
+ kind: 'option';
37
+ option: FilterButtonOption;
38
+ };
32
39
  declare class FilterButtonComponent implements OnChanges {
33
40
  private readonly defaultAppTheme;
34
41
  private readonly cdr;
@@ -131,11 +138,15 @@ declare class FilterButtonComponent implements OnChanges {
131
138
  */
132
139
  applicationTheme: ApplicationTheme;
133
140
  overlayContainer: ElementRef<HTMLElement>;
134
- filterOptions: QueryList<FocusableOption>;
141
+ viewport?: CdkVirtualScrollViewport;
142
+ /** Must match the `.item` height in the SCSS — the fixed-size viewport relies on it. */
143
+ readonly ITEM_SIZE = 48;
144
+ readonly MAX_LIST_HEIGHT = 290;
135
145
  isOpen: _angular_core.WritableSignal<boolean>;
136
146
  displayedLabel: _angular_core.WritableSignal<string>;
137
147
  tooltip: _angular_core.WritableSignal<string>;
138
148
  search: _angular_core.WritableSignal<string>;
149
+ activeIndex: _angular_core.WritableSignal<number>;
139
150
  showTooltip: {
140
151
  [key: string]: boolean;
141
152
  };
@@ -146,20 +157,30 @@ declare class FilterButtonComponent implements OnChanges {
146
157
  labelNumber?: number;
147
158
  icon?: IconName;
148
159
  }[]>;
160
+ flatOptions: _angular_core.Signal<FilterButtonRow[]>;
161
+ optionCount: _angular_core.Signal<number>;
162
+ activeOption: _angular_core.Signal<FilterButtonOption | undefined>;
163
+ activePosition: _angular_core.Signal<number>;
164
+ listHeight: _angular_core.Signal<number>;
165
+ protected trackByRow: (_index: number, row: FilterButtonRow) => string;
149
166
  readonly MIN_OPTIONS_LENGTH_FOR_SEARCH = 8;
150
- protected keyManager: FocusKeyManager<FocusableOption>;
151
167
  protected translationContext: string;
152
- constructor(defaultAppTheme: ApplicationTheme, cdr: ChangeDetectorRef);
168
+ private readonly searchInput$;
169
+ constructor(defaultAppTheme: ApplicationTheme, cdr: ChangeDetectorRef, destroyRef: DestroyRef);
153
170
  ngOnChanges(changes: SimpleChanges): void;
154
171
  clearValue(): void;
155
172
  outsideClick(): void;
156
173
  toggle(): void;
157
174
  isSelected(value?: FilterValue): boolean;
158
175
  optionChanged(selected: boolean, option: FilterButtonOption): void;
176
+ onSearchChange(value: string): void;
159
177
  keyDownHandler(ev: KeyboardEvent): void;
160
178
  onLabelEllipsisChange(isEllipsis: boolean, value: FilterValue): void;
179
+ private firstOptionIndex;
180
+ private moveActive;
181
+ private toggleActiveOption;
161
182
  private updateLabel;
162
- static ɵfac: _angular_core.ɵɵFactoryDeclaration<FilterButtonComponent, [{ optional: true; }, null]>;
183
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<FilterButtonComponent, [{ optional: true; }, null, null]>;
163
184
  static ɵcmp: _angular_core.ɵɵComponentDeclaration<FilterButtonComponent, "ui-filter-button", never, { "label": { "alias": "label"; "required": false; }; "message": { "alias": "message"; "required": false; }; "value": { "alias": "value"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "options": { "alias": "options"; "required": false; "isSignal": true; }; "allowClear": { "alias": "allowClear"; "required": false; }; "singleSelection": { "alias": "singleSelection"; "required": false; }; "iconName": { "alias": "iconName"; "required": false; }; "iconPosition": { "alias": "iconPosition"; "required": false; }; "noOptionsMessage": { "alias": "noOptionsMessage"; "required": false; }; "applicationTheme": { "alias": "applicationTheme"; "required": false; }; }, { "changed": "changed"; "optionChange": "optionChange"; }, never, never, true, never>;
164
185
  }
165
186