@testgorilla/tgo-ui 11.19.1 → 11.20.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@testgorilla/tgo-ui",
3
- "version": "11.19.1",
3
+ "version": "11.20.0",
4
4
  "license": "proprietary-license",
5
5
  "lint-staged": {
6
6
  "{projects,components}/**/*.ts": [
@@ -5,10 +5,10 @@ import { ConnectedPosition } from '@angular/cdk/overlay';
5
5
  import { ControlValueAccessor } from '@angular/forms';
6
6
  import * as i2 from '@testgorilla/tgo-ui/components/field';
7
7
  import { FieldComponent } from '@testgorilla/tgo-ui/components/field';
8
- import * as i4 from '@testgorilla/tgo-ui/components/overflow-menu';
9
- import { OverflowMenuButtonsType } from '@testgorilla/tgo-ui/components/overflow-menu';
10
8
  import * as i13 from '@testgorilla/tgo-ui/components/icon';
11
9
  import { IconName } from '@testgorilla/tgo-ui/components/icon';
10
+ import * as i4 from '@testgorilla/tgo-ui/components/overflow-menu';
11
+ import { OverflowMenuButtonsType } from '@testgorilla/tgo-ui/components/overflow-menu';
12
12
  import * as i1 from '@angular/common';
13
13
  import * as i3 from '@testgorilla/tgo-ui/components/button';
14
14
  import * as i5 from '@testgorilla/tgo-ui/components/tag';
@@ -32,11 +32,33 @@ interface PromptData {
32
32
  }
33
33
  interface PromptActionTag {
34
34
  label: string;
35
- icon?: IconName;
35
+ /**
36
+ * Leading icon, on the tag and on its menu item when `collapseActionTags` is set. Omitted, the
37
+ * action tag shows `Plus` and the menu item shows none; `null` shows no icon anywhere.
38
+ */
39
+ icon?: IconName | null;
40
+ /**
41
+ * Trailing icon on the menu item when `collapseActionTags` is set. Omitted, it defaults to `Plus`
42
+ * for the action tag and `Arrow-chevron-right-in-line` for the secondary action tag; `null` hides it.
43
+ */
44
+ menuTrailingIcon?: IconName | null;
45
+ /**
46
+ * Position of the menu item when `collapseActionTags` is set; lower comes first. Items without one
47
+ * go after those that have one, in the default order: secondary action tag, then action tag.
48
+ */
49
+ menuOrder?: number;
36
50
  ariaLabel?: string;
37
51
  disabled?: boolean;
38
52
  acceptedFileTypes?: string;
39
53
  }
54
+ /** A tag rendered next to the action tag that only emits a press; it never opens a file picker. */
55
+ type PromptSecondaryActionTag = Omit<PromptActionTag, 'acceptedFileTypes'>;
56
+ /** One item of the collapsed actions menu. */
57
+ interface PromptActionsMenuEntry {
58
+ kind: 'action' | 'secondary';
59
+ tag: PromptSecondaryActionTag;
60
+ trailingIcon: IconName;
61
+ }
40
62
  interface PromptDropdownItem {
41
63
  /** Unique id; used as the dropdown @for track key. */
42
64
  id: number;
@@ -48,6 +70,13 @@ declare class PromptComponent implements ControlValueAccessor, OnInit, AfterView
48
70
  private readonly disabledState;
49
71
  tags: _angular_core.InputSignal<PromptTag[]>;
50
72
  actionTag: _angular_core.InputSignal<PromptActionTag | null>;
73
+ /** Tag rendered next to the action tag or file upload button, e.g. "Find similar profile". */
74
+ secondaryActionTag: _angular_core.InputSignal<PromptSecondaryActionTag | null>;
75
+ /**
76
+ * Collapses `actionTag` and `secondaryActionTag` behind a Plus button that opens a menu listing
77
+ * them; the button turns into a Close button while the menu is open.
78
+ */
79
+ collapseActionTags: _angular_core.InputSignalWithTransform<boolean, unknown>;
51
80
  maxCharacters: _angular_core.InputSignal<number>;
52
81
  supportedFileTypes: _angular_core.InputSignal<string>;
53
82
  autoClear: _angular_core.InputSignal<boolean>;
@@ -80,6 +109,7 @@ declare class PromptComponent implements ControlValueAccessor, OnInit, AfterView
80
109
  set disabled(value: boolean);
81
110
  promptData: _angular_core.OutputEmitterRef<PromptData>;
82
111
  actionTagFileSelected: _angular_core.OutputEmitterRef<File>;
112
+ secondaryActionTagPress: _angular_core.OutputEmitterRef<void>;
83
113
  dropdownItemSelected: _angular_core.OutputEmitterRef<PromptDropdownItem>;
84
114
  dropdownClosed: _angular_core.OutputEmitterRef<void>;
85
115
  promptFilesList: _angular_core.WritableSignal<File[]>;
@@ -89,6 +119,7 @@ declare class PromptComponent implements ControlValueAccessor, OnInit, AfterView
89
119
  tagsInDropdown: _angular_core.WritableSignal<PromptTag[]>;
90
120
  autocompleteSuggestion: _angular_core.WritableSignal<string>;
91
121
  isDropdownOpened: _angular_core.WritableSignal<boolean>;
122
+ readonly actionsMenuId: string;
92
123
  private readonly keepDropdownClosed;
93
124
  isFieldHovered: _angular_core.WritableSignal<boolean>;
94
125
  isFieldFocused: _angular_core.WritableSignal<boolean>;
@@ -103,6 +134,13 @@ declare class PromptComponent implements ControlValueAccessor, OnInit, AfterView
103
134
  readonly showFocusRing: _angular_core.Signal<boolean>;
104
135
  fileInputAccept: _angular_core.Signal<string>;
105
136
  isLocked: _angular_core.Signal<boolean>;
137
+ readonly actionTagIcon: _angular_core.Signal<IconName>;
138
+ readonly actionTagMenuTrailingIcon: _angular_core.Signal<IconName>;
139
+ readonly secondaryActionTagMenuTrailingIcon: _angular_core.Signal<IconName>;
140
+ /** Menu items sorted by `menuOrder`; a stable sort keeps the default order for ties and omissions. */
141
+ readonly actionsMenuEntries: _angular_core.Signal<PromptActionsMenuEntry[]>;
142
+ readonly isActionsMenuOpen: _angular_core.Signal<boolean>;
143
+ readonly showActionsMenuTrigger: _angular_core.Signal<boolean>;
106
144
  private readonly hasContent;
107
145
  /**
108
146
  * Shared by the Send button's disabled state and the Enter shortcut, so they cannot disagree.
@@ -125,6 +163,8 @@ declare class PromptComponent implements ControlValueAccessor, OnInit, AfterView
125
163
  tagDropdown: _angular_core.Signal<ElementRef<HTMLInputElement> | undefined>;
126
164
  fieldComponentRef: _angular_core.Signal<FieldComponent>;
127
165
  private readonly promptContainer;
166
+ private readonly actionsPopover;
167
+ private readonly actionsMenu;
128
168
  readonly dropdownPositions: ConnectedPosition[];
129
169
  ngOnInit(): void;
130
170
  ngAfterViewInit(): void;
@@ -156,10 +196,18 @@ declare class PromptComponent implements ControlValueAccessor, OnInit, AfterView
156
196
  setDisabledState(isDisabled: boolean): void;
157
197
  onFileSelected(event: Event): Promise<void>;
158
198
  onActionTagPress(): void;
199
+ onSecondaryActionTagPress(): void;
200
+ /** The popover's focus trap hands focus back to the Plus button when the menu closes. */
201
+ closeActionsMenu(): void;
202
+ onActionsMenuKeydown(event: KeyboardEvent): void;
203
+ selectActionsMenuEntry(entry: PromptActionsMenuEntry, event: Event): void;
204
+ private selectActionTagFromMenu;
205
+ private selectSecondaryActionTagFromMenu;
206
+ private actionsMenuItems;
159
207
  private handleActionTagFile;
160
208
  private emitValue;
161
209
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<PromptComponent, never>;
162
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<PromptComponent, "ui-prompt", never, { "tags": { "alias": "tags"; "required": false; "isSignal": true; }; "actionTag": { "alias": "actionTag"; "required": false; "isSignal": true; }; "maxCharacters": { "alias": "maxCharacters"; "required": false; "isSignal": true; }; "supportedFileTypes": { "alias": "supportedFileTypes"; "required": false; "isSignal": true; }; "autoClear": { "alias": "autoClear"; "required": false; "isSignal": true; }; "showSendButton": { "alias": "showSendButton"; "required": false; "isSignal": true; }; "sendButtonDisabled": { "alias": "sendButtonDisabled"; "required": false; "isSignal": true; }; "enableFileUpload": { "alias": "enableFileUpload"; "required": false; "isSignal": true; }; "loading": { "alias": "loading"; "required": false; "isSignal": true; }; "placeholder": { "alias": "placeholder"; "required": false; "isSignal": true; }; "errorMessage": { "alias": "errorMessage"; "required": false; "isSignal": true; }; "dropdownItems": { "alias": "dropdownItems"; "required": false; "isSignal": true; }; "dropdownHeading": { "alias": "dropdownHeading"; "required": false; "isSignal": true; }; "showDropdownClose": { "alias": "showDropdownClose"; "required": false; "isSignal": true; }; "showCharacterCount": { "alias": "showCharacterCount"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; }; }, { "promptData": "promptData"; "actionTagFileSelected": "actionTagFileSelected"; "dropdownItemSelected": "dropdownItemSelected"; "dropdownClosed": "dropdownClosed"; }, never, ["[promptFooter]"], true, never>;
210
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<PromptComponent, "ui-prompt", never, { "tags": { "alias": "tags"; "required": false; "isSignal": true; }; "actionTag": { "alias": "actionTag"; "required": false; "isSignal": true; }; "secondaryActionTag": { "alias": "secondaryActionTag"; "required": false; "isSignal": true; }; "collapseActionTags": { "alias": "collapseActionTags"; "required": false; "isSignal": true; }; "maxCharacters": { "alias": "maxCharacters"; "required": false; "isSignal": true; }; "supportedFileTypes": { "alias": "supportedFileTypes"; "required": false; "isSignal": true; }; "autoClear": { "alias": "autoClear"; "required": false; "isSignal": true; }; "showSendButton": { "alias": "showSendButton"; "required": false; "isSignal": true; }; "sendButtonDisabled": { "alias": "sendButtonDisabled"; "required": false; "isSignal": true; }; "enableFileUpload": { "alias": "enableFileUpload"; "required": false; "isSignal": true; }; "loading": { "alias": "loading"; "required": false; "isSignal": true; }; "placeholder": { "alias": "placeholder"; "required": false; "isSignal": true; }; "errorMessage": { "alias": "errorMessage"; "required": false; "isSignal": true; }; "dropdownItems": { "alias": "dropdownItems"; "required": false; "isSignal": true; }; "dropdownHeading": { "alias": "dropdownHeading"; "required": false; "isSignal": true; }; "showDropdownClose": { "alias": "showDropdownClose"; "required": false; "isSignal": true; }; "showCharacterCount": { "alias": "showCharacterCount"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; }; }, { "promptData": "promptData"; "actionTagFileSelected": "actionTagFileSelected"; "secondaryActionTagPress": "secondaryActionTagPress"; "dropdownItemSelected": "dropdownItemSelected"; "dropdownClosed": "dropdownClosed"; }, never, ["[promptFooter]"], true, never>;
163
211
  static ngAcceptInputType_disabled: unknown;
164
212
  }
165
213
 
@@ -170,4 +218,4 @@ declare class PromptModule {
170
218
  }
171
219
 
172
220
  export { PromptComponent, PromptModule };
173
- export type { PromptActionTag, PromptData, PromptDropdownItem, PromptTag };
221
+ export type { PromptActionTag, PromptActionsMenuEntry, PromptData, PromptDropdownItem, PromptSecondaryActionTag, PromptTag };
@@ -151,7 +151,21 @@ declare class SliderComponent implements Validator {
151
151
  cdr: ChangeDetectorRef;
152
152
  decimalPipe: DecimalPipe;
153
153
  private control?;
154
+ private readonly destroyRef;
155
+ private readonly ngZone;
156
+ private readonly matSlider;
157
+ private readonly matSliderElement;
154
158
  constructor(defaultAppTheme: ApplicationTheme);
159
+ /**
160
+ * Works around MatSlider's resize handling for the range variant. On a resize, `_onResize()`
161
+ * repositions the end thumb before the start thumb, and clamps the end thumb so it cannot sit
162
+ * left of the start thumb's position — which at that point is still the pre-resize one. When the
163
+ * slider shrinks to under about half its width, the end thumb is clamped to that stale position
164
+ * and stays there, because nothing repositions it afterwards. Running the resize step once more,
165
+ * after Material's own observer, places the end thumb against the start thumb's new position.
166
+ * Growing the slider never clamps, so the extra pass is a no-op there.
167
+ */
168
+ private observeRangeResize;
155
169
  private value;
156
170
  protected translationContext: string;
157
171
  protected touchedControlName: string;