@testgorilla/tgo-ui 10.3.0 → 10.5.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": "10.3.0",
3
+ "version": "10.5.0",
4
4
  "license": "proprietary-license",
5
5
  "lint-staged": {
6
6
  "{projects,components}/**/*.ts": [
@@ -28,6 +28,7 @@ interface Tab {
28
28
  order?: number;
29
29
  skeletonTheme?: NgxSkeletonLoaderConfigTheme;
30
30
  isSkeletonAiTheme?: boolean;
31
+ isLabelLoading?: boolean;
31
32
  }
32
33
  type TabsType = 'underlined' | 'filled';
33
34
  declare const TAB_HEADER_SIZE: {
@@ -51,6 +52,7 @@ declare class TabDirective implements OnInit {
51
52
  order: _angular_core.InputSignal<number | undefined>;
52
53
  skeletonTheme: _angular_core.InputSignal<NgxSkeletonLoaderConfigTheme | undefined>;
53
54
  isSkeletonAiTheme: _angular_core.InputSignal<boolean | undefined>;
55
+ isLabelLoading: _angular_core.InputSignalWithTransform<boolean, unknown>;
54
56
  private readonly tabsComponent;
55
57
  private readonly template;
56
58
  private readonly syncProps;
@@ -58,7 +60,7 @@ declare class TabDirective implements OnInit {
58
60
  ngOnInit(): void;
59
61
  private addTab;
60
62
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<TabDirective, never>;
61
- static ɵdir: _angular_core.ɵɵDirectiveDeclaration<TabDirective, "ng-template[uiTab]", never, { "tabLabel": { "alias": "tabLabel"; "required": true; "isSignal": true; }; "tabName": { "alias": "tabName"; "required": true; "isSignal": true; }; "iconLeft": { "alias": "iconLeft"; "required": false; "isSignal": true; }; "iconRight": { "alias": "iconRight"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "canLeave": { "alias": "canLeave"; "required": false; "isSignal": true; }; "linkUrl": { "alias": "linkUrl"; "required": false; "isSignal": true; }; "order": { "alias": "order"; "required": false; "isSignal": true; }; "skeletonTheme": { "alias": "skeletonTheme"; "required": false; "isSignal": true; }; "isSkeletonAiTheme": { "alias": "isSkeletonAiTheme"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
63
+ static ɵdir: _angular_core.ɵɵDirectiveDeclaration<TabDirective, "ng-template[uiTab]", never, { "tabLabel": { "alias": "tabLabel"; "required": true; "isSignal": true; }; "tabName": { "alias": "tabName"; "required": true; "isSignal": true; }; "iconLeft": { "alias": "iconLeft"; "required": false; "isSignal": true; }; "iconRight": { "alias": "iconRight"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "canLeave": { "alias": "canLeave"; "required": false; "isSignal": true; }; "linkUrl": { "alias": "linkUrl"; "required": false; "isSignal": true; }; "order": { "alias": "order"; "required": false; "isSignal": true; }; "skeletonTheme": { "alias": "skeletonTheme"; "required": false; "isSignal": true; }; "isSkeletonAiTheme": { "alias": "isSkeletonAiTheme"; "required": false; "isSignal": true; }; "isLabelLoading": { "alias": "isLabelLoading"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
62
64
  }
63
65
 
64
66
  declare class TabsComponent implements AfterViewInit {
@@ -111,6 +113,23 @@ declare class TabsComponent implements AfterViewInit {
111
113
  applicationTheme: ApplicationTheme;
112
114
  tabHeaderSize: _angular_core.InputSignal<TabHeaderSize>;
113
115
  isLoading: _angular_core.InputSignal<boolean>;
116
+ /**
117
+ * Name of the tab to show. Applied as tabs register, so a tab requested before the
118
+ * projected `ng-template uiTab` children exist — a deep link, a query param — is still
119
+ * honoured on first paint, with no need to call `selectTab()` from a lifecycle hook.
120
+ *
121
+ * This is a request, not live state: it is applied when the value changes and once more as
122
+ * soon as the named tab registers, but a later click or a change to the tab list will not
123
+ * snap the selection back to it. An unknown name is a no-op — while tabs are still
124
+ * registering every name is unknown, so it cannot warn or throw. Bind a name the consumer
125
+ * has already validated.
126
+ *
127
+ * Applying it does not emit `selectedTab` / `selectedTabIndex` (the consumer supplied the
128
+ * value, so echoing it back would double-handle it) and does not consult the current tab's
129
+ * `canLeave` — declarative selection is the consumer's own decision, so it owns any
130
+ * guarding around the value it binds. User-driven switches still honour `canLeave`.
131
+ */
132
+ readonly selectedTabName: _angular_core.InputSignal<string | null>;
114
133
  selectedTabIndex: EventEmitter<number>;
115
134
  selectedTab: EventEmitter<Tab>;
116
135
  tabGroup: MatTabGroup;
@@ -119,11 +138,32 @@ declare class TabsComponent implements AfterViewInit {
119
138
  protected tabIndexMap: Record<string, number>;
120
139
  private insertionCounter;
121
140
  private tabTransitionInProgress;
141
+ private requestedTabName;
122
142
  constructor(defaultAppTheme: ApplicationTheme, isMobile$: Observable<boolean>, cdr: ChangeDetectorRef);
123
143
  ngAfterViewInit(): void;
124
144
  addTab(tab: Tab): void;
125
145
  private sortTabs;
126
146
  private updateTabIndexMap;
147
+ private get activeTabName();
148
+ /**
149
+ * `tabIndex` stores a position, but the selection it stands for is a tab identity, and
150
+ * adding, removing or re-ordering tabs shifts positions. Without re-resolving the index
151
+ * from the name, `tabIndex` keeps pointing at whatever tab now sits at that position —
152
+ * MatTabGroup re-derives its own selection from the active tab, so the body stays correct
153
+ * while this component's `aria-selected` and click gating silently drift onto a different
154
+ * tab. Falls back to clamping when the active tab is the one that went away.
155
+ */
156
+ private reconcileTabIndex;
157
+ /**
158
+ * Applies `selectedTabName` once the named tab is known, then clears the request so later
159
+ * clicks and tab list changes are not overridden by a stale value. Stays armed while the
160
+ * name is unresolved, because a requested tab can register after the input is set — either
161
+ * with the rest of a subtree that renders late, or later still if it is behind its own
162
+ * condition — so `addTab()` retries until it resolves.
163
+ *
164
+ * Silent by design — see the doc on `selectedTabName`.
165
+ */
166
+ private applyRequestedTabName;
127
167
  onTabChange(index: number): void;
128
168
  selectTab(tabName: string): void;
129
169
  indexOf(tabName: string): number;
@@ -131,7 +171,7 @@ declare class TabsComponent implements AfterViewInit {
131
171
  removeTab(tabName: string): void;
132
172
  updateTab(tabName: string, tab: Partial<Omit<Tab, 'tabName'>>): void;
133
173
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<TabsComponent, [{ optional: true; }, null, null]>;
134
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<TabsComponent, "ui-tabs", never, { "companyColor": { "alias": "companyColor"; "required": false; }; "type": { "alias": "type"; "required": false; }; "animationDuration": { "alias": "animationDuration"; "required": false; }; "headerContentPadding": { "alias": "headerContentPadding"; "required": false; }; "dynamicHeight": { "alias": "dynamicHeight"; "required": false; }; "applicationTheme": { "alias": "applicationTheme"; "required": false; }; "tabHeaderSize": { "alias": "tabHeaderSize"; "required": false; "isSignal": true; }; "isLoading": { "alias": "isLoading"; "required": false; "isSignal": true; }; }, { "selectedTabIndex": "selectedTabIndex"; "selectedTab": "selectedTab"; }, never, never, true, never>;
174
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<TabsComponent, "ui-tabs", never, { "companyColor": { "alias": "companyColor"; "required": false; }; "type": { "alias": "type"; "required": false; }; "animationDuration": { "alias": "animationDuration"; "required": false; }; "headerContentPadding": { "alias": "headerContentPadding"; "required": false; }; "dynamicHeight": { "alias": "dynamicHeight"; "required": false; }; "applicationTheme": { "alias": "applicationTheme"; "required": false; }; "tabHeaderSize": { "alias": "tabHeaderSize"; "required": false; "isSignal": true; }; "isLoading": { "alias": "isLoading"; "required": false; "isSignal": true; }; "selectedTabName": { "alias": "selectedTabName"; "required": false; "isSignal": true; }; }, { "selectedTabIndex": "selectedTabIndex"; "selectedTab": "selectedTab"; }, never, never, true, never>;
135
175
  static ngAcceptInputType_headerContentPadding: number;
136
176
  static ngAcceptInputType_dynamicHeight: unknown;
137
177
  }
@@ -57,6 +57,19 @@ declare class TagComponent {
57
57
  * @memberof TagComponent
58
58
  */
59
59
  showIconWhenSelected: _angular_core.InputSignalWithTransform<boolean, unknown>;
60
+ /**
61
+ * Pins the tag to its filled background at rest, without tying that background
62
+ * to the selected state — pressing the tag never flips its fill. Interactive
63
+ * states (hover, focus ring, press scale) and the `press` output are unaffected,
64
+ * so the tag stays clickable; use `readOnly` when it should not be.
65
+ *
66
+ * The fill follows the theme: grayscale in `light` / `dark`, petrol in `classic`.
67
+ *
68
+ * @type {boolean}
69
+ * @default false
70
+ * @memberof TagComponent
71
+ */
72
+ pinnedBackground: _angular_core.InputSignalWithTransform<boolean, unknown>;
60
73
  /**
61
74
  * Specifies whether the element is disabled.
62
75
  *
@@ -151,7 +164,7 @@ declare class TagComponent {
151
164
  readonly filled: _angular_core.Signal<boolean>;
152
165
  onKeydown($event: KeyboardEvent): void;
153
166
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<TagComponent, never>;
154
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<TagComponent, "ui-tag", never, { "label": { "alias": "label"; "required": false; "isSignal": true; }; "icon": { "alias": "icon"; "required": false; "isSignal": true; }; "allowClose": { "alias": "allowClose"; "required": false; "isSignal": true; }; "readOnly": { "alias": "readOnly"; "required": false; "isSignal": true; }; "isSelected": { "alias": "isSelected"; "required": false; "isSignal": true; }; "showIconWhenSelected": { "alias": "showIconWhenSelected"; "required": false; "isSignal": true; }; "isDisabled": { "alias": "isDisabled"; "required": false; "isSignal": true; }; "applicationTheme": { "alias": "applicationTheme"; "required": false; "isSignal": true; }; "ariaLabel": { "alias": "ariaLabel"; "required": false; "isSignal": true; }; "ariaRequired": { "alias": "ariaRequired"; "required": false; "isSignal": true; }; "showBadge": { "alias": "showBadge"; "required": false; "isSignal": true; }; "notificationsAmount": { "alias": "notificationsAmount"; "required": false; "isSignal": true; }; }, { "isSelected": "isSelectedChange"; "close": "close"; "press": "press"; }, never, never, true, never>;
167
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<TagComponent, "ui-tag", never, { "label": { "alias": "label"; "required": false; "isSignal": true; }; "icon": { "alias": "icon"; "required": false; "isSignal": true; }; "allowClose": { "alias": "allowClose"; "required": false; "isSignal": true; }; "readOnly": { "alias": "readOnly"; "required": false; "isSignal": true; }; "isSelected": { "alias": "isSelected"; "required": false; "isSignal": true; }; "showIconWhenSelected": { "alias": "showIconWhenSelected"; "required": false; "isSignal": true; }; "pinnedBackground": { "alias": "pinnedBackground"; "required": false; "isSignal": true; }; "isDisabled": { "alias": "isDisabled"; "required": false; "isSignal": true; }; "applicationTheme": { "alias": "applicationTheme"; "required": false; "isSignal": true; }; "ariaLabel": { "alias": "ariaLabel"; "required": false; "isSignal": true; }; "ariaRequired": { "alias": "ariaRequired"; "required": false; "isSignal": true; }; "showBadge": { "alias": "showBadge"; "required": false; "isSignal": true; }; "notificationsAmount": { "alias": "notificationsAmount"; "required": false; "isSignal": true; }; }, { "isSelected": "isSelectedChange"; "close": "close"; "press": "press"; }, never, never, true, never>;
155
168
  }
156
169
 
157
170
  declare class TagComponentModule {