@spartan-ng/brain 1.8.1-beta.2 → 1.8.1

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,13 +1,13 @@
1
1
  import { Directionality } from '@angular/cdk/bidi';
2
2
  import * as i0 from '@angular/core';
3
- import { inject, input, model, output, signal, Directive, ElementRef, computed, effect, untracked, TemplateRef, ViewContainerRef, DestroyRef, booleanAttribute, contentChildren, Injector, ChangeDetectorRef, NgZone, ANIMATION_MODULE_TYPE, afterNextRender } from '@angular/core';
3
+ import { inject, input, model, output, signal, Directive, ElementRef, computed, effect, untracked, TemplateRef, ViewContainerRef, DestroyRef, booleanAttribute, Injector, contentChildren, ChangeDetectorRef, NgZone, ANIMATION_MODULE_TYPE, afterNextRender } from '@angular/core';
4
4
  import { FocusKeyManager } from '@angular/cdk/a11y';
5
- import { fromEvent, Subject, of, merge, EMPTY, Observable, timer } from 'rxjs';
6
- import { take, takeUntil, debounceTime, startWith, switchMap, skip, filter } from 'rxjs/operators';
7
- import { hasModifierKey, SPACE, ENTER } from '@angular/cdk/keycodes';
5
+ import { hasModifierKey } from '@angular/cdk/keycodes';
8
6
  import { SharedResizeObserver } from '@angular/cdk/observers/private';
9
7
  import { normalizePassiveListenerOptions, Platform } from '@angular/cdk/platform';
10
8
  import { ViewportRuler } from '@angular/cdk/scrolling';
9
+ import { Subject, fromEvent, of, merge, EMPTY, Observable, timer } from 'rxjs';
10
+ import { takeUntil, debounceTime, startWith, switchMap, skip, filter } from 'rxjs/operators';
11
11
 
12
12
  class BrnTabs {
13
13
  _dir = inject(Directionality);
@@ -205,47 +205,41 @@ class BrnTabsList {
205
205
  _root = inject(BrnTabs);
206
206
  _orientation = this._root.$orientation;
207
207
  _direction = this._root.direction;
208
- _activeTab = this._root.$activeTab;
209
- _tabs = this._root.$tabs;
210
- _elementRef = inject(ElementRef);
211
- _keyDownListener = fromEvent(this._elementRef.nativeElement, 'keydown');
208
+ _injector = inject(Injector);
212
209
  _keyManager;
213
210
  triggers = contentChildren(BrnTabsTrigger, { ...(ngDevMode ? { debugName: "triggers" } : /* istanbul ignore next */ {}), descendants: true });
214
211
  ngAfterContentInit() {
215
- this._keyManager = new FocusKeyManager(this.triggers())
212
+ this._keyManager = new FocusKeyManager(this.triggers, this._injector)
216
213
  .withHorizontalOrientation(this._direction())
217
214
  .withHomeAndEnd()
218
215
  .withPageUpDown()
219
216
  .withWrap();
220
- // needed because by default the index is set to -1, which means first interaction is skipped
221
- this._keyDownListener.pipe(take(1)).subscribe(() => {
222
- const currentTabKey = this._activeTab();
223
- const tabs = this._tabs();
224
- let activeIndex = 0;
225
- if (currentTabKey) {
226
- const currentTab = tabs[currentTabKey];
227
- if (currentTab) {
228
- activeIndex = this.triggers().indexOf(currentTab.trigger);
229
- }
217
+ }
218
+ // Activation can bypass the key manager (mouse click, programmatic change), so keep its active
219
+ // item aligned with the trigger that actually owns DOM focus. `focusin` fires before the next
220
+ // keydown, and focus is the correct source in manual activation mode, where focus and selection
221
+ // are allowed to diverge.
222
+ _onFocusIn(event) {
223
+ const focusedTrigger = this.triggers().find((trigger) => trigger.elementRef.nativeElement === event.target);
224
+ if (focusedTrigger) {
225
+ this._keyManager?.updateActiveItem(focusedTrigger);
226
+ }
227
+ }
228
+ _onKeydown(event) {
229
+ if ('key' in event) {
230
+ if (this._orientation() === 'horizontal') {
231
+ if (event.key === 'ArrowUp' || event.key === 'ArrowDown')
232
+ return;
230
233
  }
231
- this._keyManager?.setActiveItem(activeIndex);
232
- });
233
- this._keyDownListener.subscribe((event) => {
234
- if ('key' in event) {
235
- if (this._orientation() === 'horizontal') {
236
- if (event.key === 'ArrowUp' || event.key === 'ArrowDown')
237
- return;
238
- }
239
- if (this._orientation() === 'vertical') {
240
- if (event.key === 'ArrowLeft' || event.key === 'ArrowRight')
241
- return;
242
- }
234
+ if (this._orientation() === 'vertical') {
235
+ if (event.key === 'ArrowLeft' || event.key === 'ArrowRight')
236
+ return;
243
237
  }
244
- this._keyManager?.onKeydown(event);
245
- });
238
+ }
239
+ this._keyManager?.onKeydown(event);
246
240
  }
247
241
  /** @nocollapse */ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: BrnTabsList, deps: [], target: i0.ɵɵFactoryTarget.Directive });
248
- /** @nocollapse */ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.2.0", version: "21.2.16", type: BrnTabsList, isStandalone: true, selector: "[brnTabsList]", host: { attributes: { "role": "tablist" }, properties: { "attr.aria-orientation": "_orientation()", "attr.data-orientation": "_orientation()" } }, queries: [{ propertyName: "triggers", predicate: BrnTabsTrigger, descendants: true, isSignal: true }], exportAs: ["brnTabsList"], ngImport: i0 });
242
+ /** @nocollapse */ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.2.0", version: "21.2.16", type: BrnTabsList, isStandalone: true, selector: "[brnTabsList]", host: { attributes: { "role": "tablist" }, listeners: { "focusin": "_onFocusIn($event)", "keydown": "_onKeydown($event)" }, properties: { "attr.aria-orientation": "_orientation()", "attr.data-orientation": "_orientation()" } }, queries: [{ propertyName: "triggers", predicate: BrnTabsTrigger, descendants: true, isSignal: true }], exportAs: ["brnTabsList"], ngImport: i0 });
249
243
  }
250
244
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: BrnTabsList, decorators: [{
251
245
  type: Directive,
@@ -256,6 +250,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImpo
256
250
  role: 'tablist',
257
251
  '[attr.aria-orientation]': '_orientation()',
258
252
  '[attr.data-orientation]': '_orientation()',
253
+ '(focusin)': '_onFocusIn($event)',
254
+ '(keydown)': '_onKeydown($event)',
259
255
  },
260
256
  }]
261
257
  }], propDecorators: { triggers: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => BrnTabsTrigger), { ...{ descendants: true }, isSignal: true }] }] } });
@@ -324,19 +320,17 @@ class BrnTabsPaginatedList {
324
320
  * layout recalculations if it's known that pagination won't be required.
325
321
  */
326
322
  disablePagination = input(false, { ...(ngDevMode ? { debugName: "disablePagination" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
327
- /** The index of the active tab. */
328
- _selectedIndex = computed(() => {
323
+ /** Index of the active tab among this list's items, or undefined when there isn't one. */
324
+ _selectedItemIndex = computed(() => {
329
325
  const currentTabKey = this._activeTab();
330
- const tabs = this._tabs();
331
- let activeIndex = 0;
332
- if (currentTabKey && this.items()) {
333
- const currentTab = tabs[currentTabKey];
334
- if (currentTab) {
335
- activeIndex = this.items().indexOf(currentTab.trigger);
336
- }
337
- }
338
- return activeIndex;
339
- }, ...(ngDevMode ? [{ debugName: "_selectedIndex" }] : /* istanbul ignore next */ []));
326
+ const trigger = currentTabKey ? this._tabs()[currentTabKey]?.trigger : undefined;
327
+ if (!trigger)
328
+ return undefined;
329
+ const index = this.items().indexOf(trigger);
330
+ return index >= 0 ? index : undefined;
331
+ }, ...(ngDevMode ? [{ debugName: "_selectedItemIndex" }] : /* istanbul ignore next */ []));
332
+ /** The index of the active tab, falling back to the first tab. */
333
+ _selectedIndex = computed(() => this._selectedItemIndex() ?? 0, ...(ngDevMode ? [{ debugName: "_selectedIndex" }] : /* istanbul ignore next */ []));
340
334
  /** Event emitted when the option is selected. */
341
335
  selectFocusedIndex = output();
342
336
  /** Event emitted when a label is focused. */
@@ -360,12 +354,10 @@ class BrnTabsPaginatedList {
360
354
  });
361
355
  });
362
356
  effect(() => {
363
- const selectedIndex = this._selectedIndex();
364
- if (selectedIndex !== 0) {
357
+ const selectedIndex = this._selectedItemIndex();
358
+ if (selectedIndex !== undefined) {
365
359
  this._selectedIndexChanged = true;
366
- if (this._keyManager) {
367
- this._keyManager.updateActiveItem(selectedIndex);
368
- }
360
+ this._keyManager?.updateActiveItem(selectedIndex);
369
361
  }
370
362
  });
371
363
  }
@@ -398,7 +390,7 @@ class BrnTabsPaginatedList {
398
390
  const realign = () => {
399
391
  this.updatePagination();
400
392
  };
401
- this._keyManager = new FocusKeyManager(this.items())
393
+ this._keyManager = new FocusKeyManager(this.items, this._injector)
402
394
  .withHorizontalOrientation(this._getLayoutDirection())
403
395
  .withHomeAndEnd()
404
396
  .withWrap()
@@ -490,10 +482,16 @@ class BrnTabsPaginatedList {
490
482
  if (hasModifierKey(event)) {
491
483
  return;
492
484
  }
493
- switch (event.keyCode) {
494
- case ENTER:
495
- case SPACE:
496
- if (this.focusIndex !== this._selectedIndex()) {
485
+ // A programmatic selection (or any activation that bypasses the key manager) can move its
486
+ // active item away from the trigger that owns focus. Start every key from the focused item.
487
+ const focusedItem = this.items().find((item) => item.elementRef.nativeElement === event.target);
488
+ if (focusedItem) {
489
+ this._keyManager.updateActiveItem(focusedItem);
490
+ }
491
+ switch (event.key) {
492
+ case 'Enter':
493
+ case ' ':
494
+ if (this.focusIndex !== this._selectedItemIndex()) {
497
495
  const item = this.items()[this.focusIndex];
498
496
  if (item && !item.disabled) {
499
497
  this.selectFocusedIndex.emit(this.focusIndex);
@@ -1 +1 @@
1
- {"version":3,"file":"spartan-ng-brain-tabs.mjs","sources":["../../../../libs/brain/tabs/src/lib/brn-tabs.ts","../../../../libs/brain/tabs/src/lib/brn-tabs-content.ts","../../../../libs/brain/tabs/src/lib/brn-tabs-content-lazy.ts","../../../../libs/brain/tabs/src/lib/brn-tabs-trigger.ts","../../../../libs/brain/tabs/src/lib/brn-tabs-list.ts","../../../../libs/brain/tabs/src/lib/brn-tabs-paginated-list.ts","../../../../libs/brain/tabs/src/index.ts","../../../../libs/brain/tabs/src/spartan-ng-brain-tabs.ts"],"sourcesContent":["import { Directionality } from '@angular/cdk/bidi';\nimport { Directive, inject, input, model, output, signal } from '@angular/core';\nimport type { BrnTabsContent } from './brn-tabs-content';\nimport type { BrnTabsTrigger } from './brn-tabs-trigger';\n\nexport type BrnTabsOrientation = 'horizontal' | 'vertical';\nexport type BrnTabsDirection = 'ltr' | 'rtl';\nexport type BrnActivationMode = 'automatic' | 'manual';\nexport type TabEntry = { trigger: BrnTabsTrigger; content: BrnTabsContent };\n\n@Directive({\n\tselector: '[brnTabs]',\n\texportAs: 'brnTabs',\n\thost: {\n\t\t'[attr.data-orientation]': 'orientation()',\n\t\t'[attr.dir]': 'direction()',\n\t},\n})\nexport class BrnTabs {\n\tprivate readonly _dir = inject(Directionality);\n\n\tpublic readonly orientation = input<BrnTabsOrientation>('horizontal');\n\t/** internal **/\n\tpublic $orientation = this.orientation;\n\n\t/** internal **/\n\tpublic readonly direction = this._dir.valueSignal;\n\n\tpublic readonly activeTab = model<string | undefined>(undefined, { alias: 'brnTabs' });\n\t/** internal **/\n\tpublic $activeTab = this.activeTab.asReadonly();\n\n\tpublic readonly activationMode = input<BrnActivationMode>('automatic');\n\t/** internal **/\n\tpublic $activationMode = this.activationMode;\n\n\tpublic readonly tabActivated = output<string>();\n\n\tprivate readonly _tabs = signal<{ [key: string]: TabEntry }>({});\n\tpublic readonly $tabs = this._tabs.asReadonly();\n\n\tpublic registerTrigger(key: string, trigger: BrnTabsTrigger) {\n\t\tthis.updateEntry(key, { trigger });\n\t}\n\n\tpublic registerContent(key: string, content: BrnTabsContent) {\n\t\tthis.updateEntry(key, { content });\n\t}\n\n\tpublic unregisterTrigger(key: string) {\n\t\tthis.updateEntry(key, { trigger: undefined });\n\t}\n\n\tpublic unregisterContent(key: string): void {\n\t\tthis.updateEntry(key, { content: undefined });\n\t}\n\n\tprivate updateEntry(key: string, patch: Partial<TabEntry>) {\n\t\tthis._tabs.update((tabs) => {\n\t\t\tconst existing = tabs[key] ?? {};\n\t\t\tconst merged = { ...existing, ...patch };\n\t\t\tconst entryEmpty = !merged.trigger && !merged.content;\n\t\t\tif (entryEmpty) {\n\t\t\t\tconst { [key]: removed, ...rest } = tabs;\n\t\t\t\treturn rest;\n\t\t\t}\n\t\t\treturn { ...tabs, [key]: merged };\n\t\t});\n\t}\n\n\temitTabActivated(key: string) {\n\t\tthis.tabActivated.emit(key);\n\t}\n\n\tsetActiveTab(key: string) {\n\t\tthis.activeTab.set(key);\n\t}\n}\n","import { computed, Directive, effect, ElementRef, inject, input, type OnDestroy, untracked } from '@angular/core';\nimport { BrnTabs } from './brn-tabs';\n\n@Directive({\n\tselector: '[brnTabsContent]',\n\texportAs: 'brnTabsContent',\n\thost: {\n\t\trole: 'tabpanel',\n\t\ttabindex: '0',\n\t\t'[id]': '_contentId()',\n\t\t'[attr.aria-labelledby]': '_labelId()',\n\t\t'[hidden]': '_isSelected() === false',\n\t},\n})\nexport class BrnTabsContent implements OnDestroy {\n\tprivate readonly _root = inject(BrnTabs);\n\tprivate readonly _elementRef = inject(ElementRef);\n\n\tpublic readonly contentFor = input.required<string>({ alias: 'brnTabsContent' });\n\tprotected readonly _isSelected = computed(() => this._root.$activeTab() === this.contentFor());\n\tprotected readonly _contentId = computed(() => `brn-tabs-content-${this.contentFor()}`);\n\tprotected readonly _labelId = computed(() => `brn-tabs-label-${this.contentFor()}`);\n\n\tconstructor() {\n\t\teffect(() => {\n\t\t\tconst contentFor = this.contentFor();\n\t\t\tuntracked(() => this._root.registerContent(contentFor, this));\n\t\t});\n\t}\n\n\tpublic focus() {\n\t\tthis._elementRef.nativeElement.focus();\n\t}\n\n\tngOnDestroy(): void {\n\t\tthis._root.unregisterContent(this.contentFor());\n\t}\n}\n","import { DestroyRef, Directive, effect, inject, TemplateRef, untracked, ViewContainerRef } from '@angular/core';\nimport { BrnTabs } from './brn-tabs';\nimport { BrnTabsContent } from './brn-tabs-content';\n\n@Directive({\n\tselector: 'ng-template[brnTabsContentLazy]',\n\texportAs: 'brnTabsContentLazy',\n})\nexport class BrnTabsContentLazy {\n\tprivate readonly _root = inject(BrnTabs);\n\tprivate readonly _content = inject(BrnTabsContent);\n\tprivate readonly _templateRef = inject(TemplateRef);\n\tprivate readonly _viewContainerRef = inject(ViewContainerRef);\n\tprivate readonly _destroyRef = inject(DestroyRef);\n\n\tprivate _hasBeenActivated = false;\n\n\tconstructor() {\n\t\tthis._destroyRef.onDestroy(() => this._viewContainerRef.clear());\n\n\t\teffect(() => {\n\t\t\tconst activeTab = this._root.$activeTab();\n\t\t\tconst contentFor = this._content.contentFor();\n\n\t\t\tuntracked(() => {\n\t\t\t\tif (activeTab === contentFor && !this._hasBeenActivated) {\n\t\t\t\t\tthis._viewContainerRef.createEmbeddedView(this._templateRef);\n\t\t\t\t\tthis._hasBeenActivated = true;\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\t}\n}\n","import type { BooleanInput } from '@angular/cdk/coercion';\nimport {\n\tDirective,\n\tElementRef,\n\ttype OnDestroy,\n\tbooleanAttribute,\n\tcomputed,\n\teffect,\n\tinject,\n\tinput,\n\tuntracked,\n} from '@angular/core';\nimport { BrnTabs } from './brn-tabs';\n\n@Directive({\n\tselector: 'button[brnTabsTrigger]',\n\texportAs: 'brnTabsTrigger',\n\thost: {\n\t\t'[id]': '_labelId()',\n\t\ttype: 'button',\n\t\trole: 'tab',\n\t\t'[tabindex]': '_disabled() ? -1 : (selected() ? 0 : -1)',\n\t\t'[attr.aria-selected]': 'selected()',\n\t\t'[attr.aria-controls]': '_contentId()',\n\t\t'[attr.aria-disabled]': '_disabled()',\n\t\t'[attr.data-state]': \"selected() ? 'active' : 'inactive'\",\n\t\t'[attr.data-orientation]': '_orientation()',\n\t\t'[attr.data-disabled]': \"_disabled() ? '' : undefined\",\n\t\t'[attr.disabled]': \"_disabled() ? '' : undefined\",\n\t\t'(click)': 'activate()',\n\t},\n})\nexport class BrnTabsTrigger implements OnDestroy {\n\tpublic readonly elementRef = inject(ElementRef);\n\n\tprivate readonly _root = inject(BrnTabs);\n\n\tprotected readonly _orientation = this._root.$orientation;\n\n\tpublic readonly triggerFor = input.required<string>({ alias: 'brnTabsTrigger' });\n\tpublic readonly selected = computed(() => this._root.$activeTab() === this.triggerFor());\n\tprotected readonly _contentId = computed(() => `brn-tabs-content-${this.triggerFor()}`);\n\tprotected readonly _labelId = computed(() => `brn-tabs-label-${this.triggerFor()}`);\n\n\t// eslint-disable-next-line @typescript-eslint/naming-convention\n\tpublic readonly _disabled = input<boolean, BooleanInput>(false, {\n\t\talias: 'disabled',\n\t\ttransform: booleanAttribute,\n\t});\n\n\tpublic get disabled(): boolean {\n\t\treturn this._disabled();\n\t}\n\n\tconstructor() {\n\t\teffect(() => {\n\t\t\tconst triggerFor = this.triggerFor();\n\t\t\tuntracked(() => this._root.registerTrigger(triggerFor, this));\n\t\t});\n\t}\n\n\tpublic focus() {\n\t\tthis.elementRef.nativeElement.focus();\n\t\tif (this._root.$activationMode() === 'automatic' && !this.selected()) {\n\t\t\tthis.activate();\n\t\t}\n\t}\n\n\tpublic activate() {\n\t\tif (!this.triggerFor()) return;\n\t\tthis._root.setActiveTab(this.triggerFor());\n\t\tthis._root.emitTabActivated(this.triggerFor());\n\t}\n\n\tpublic get key(): string | undefined {\n\t\treturn this.triggerFor();\n\t}\n\n\tngOnDestroy(): void {\n\t\tthis._root.unregisterTrigger(this.triggerFor());\n\t}\n}\n","import { FocusKeyManager } from '@angular/cdk/a11y';\nimport { type AfterContentInit, Directive, ElementRef, contentChildren, inject } from '@angular/core';\nimport { fromEvent } from 'rxjs';\nimport { take } from 'rxjs/operators';\nimport { BrnTabs } from './brn-tabs';\nimport { BrnTabsTrigger } from './brn-tabs-trigger';\n\n@Directive({\n\tselector: '[brnTabsList]',\n\texportAs: 'brnTabsList',\n\thost: {\n\t\trole: 'tablist',\n\t\t'[attr.aria-orientation]': '_orientation()',\n\t\t'[attr.data-orientation]': '_orientation()',\n\t},\n})\nexport class BrnTabsList implements AfterContentInit {\n\tprivate readonly _root = inject(BrnTabs);\n\n\tprotected readonly _orientation = this._root.$orientation;\n\tprivate readonly _direction = this._root.direction;\n\tprivate readonly _activeTab = this._root.$activeTab;\n\tprivate readonly _tabs = this._root.$tabs;\n\tprivate readonly _elementRef = inject<ElementRef<HTMLElement>>(ElementRef);\n\tprivate readonly _keyDownListener = fromEvent(this._elementRef.nativeElement, 'keydown');\n\n\tprivate _keyManager?: FocusKeyManager<BrnTabsTrigger>;\n\n\tpublic readonly triggers = contentChildren(BrnTabsTrigger, { descendants: true });\n\n\tpublic ngAfterContentInit() {\n\t\tthis._keyManager = new FocusKeyManager<BrnTabsTrigger>(this.triggers())\n\t\t\t.withHorizontalOrientation(this._direction())\n\t\t\t.withHomeAndEnd()\n\t\t\t.withPageUpDown()\n\t\t\t.withWrap();\n\n\t\t// needed because by default the index is set to -1, which means first interaction is skipped\n\t\tthis._keyDownListener.pipe(take(1)).subscribe(() => {\n\t\t\tconst currentTabKey = this._activeTab();\n\t\t\tconst tabs = this._tabs();\n\t\t\tlet activeIndex = 0;\n\t\t\tif (currentTabKey) {\n\t\t\t\tconst currentTab = tabs[currentTabKey];\n\t\t\t\tif (currentTab) {\n\t\t\t\t\tactiveIndex = this.triggers().indexOf(currentTab.trigger);\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis._keyManager?.setActiveItem(activeIndex);\n\t\t});\n\n\t\tthis._keyDownListener.subscribe((event) => {\n\t\t\tif ('key' in event) {\n\t\t\t\tif (this._orientation() === 'horizontal') {\n\t\t\t\t\tif (event.key === 'ArrowUp' || event.key === 'ArrowDown') return;\n\t\t\t\t}\n\t\t\t\tif (this._orientation() === 'vertical') {\n\t\t\t\t\tif (event.key === 'ArrowLeft' || event.key === 'ArrowRight') return;\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis._keyManager?.onKeydown(event as KeyboardEvent);\n\t\t});\n\t}\n}\n","/**\n * We are building on shoulders of giants here and adapt the implementation provided by the incredible Angular\n * team: https://github.com/angular/components/blob/main/src/material/tabs/paginated-tab-header.ts\n * Check them out! Give them a try! Leave a star! Their work is incredible!\n */\n\n/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport { FocusKeyManager, type FocusableOption } from '@angular/cdk/a11y';\nimport { type Direction, Directionality } from '@angular/cdk/bidi';\nimport { type BooleanInput } from '@angular/cdk/coercion';\nimport { ENTER, SPACE, hasModifierKey } from '@angular/cdk/keycodes';\nimport { SharedResizeObserver } from '@angular/cdk/observers/private';\nimport { Platform, normalizePassiveListenerOptions } from '@angular/cdk/platform';\nimport { ViewportRuler } from '@angular/cdk/scrolling';\nimport {\n\tANIMATION_MODULE_TYPE,\n\ttype AfterContentChecked,\n\ttype AfterContentInit,\n\ttype AfterViewInit,\n\tChangeDetectorRef,\n\tDirective,\n\tElementRef,\n\tInjector,\n\tNgZone,\n\ttype OnDestroy,\n\ttype Signal,\n\tafterNextRender,\n\tbooleanAttribute,\n\tcomputed,\n\teffect,\n\tinject,\n\tinput,\n\toutput,\n\tsignal,\n} from '@angular/core';\nimport { EMPTY, Observable, type Observer, Subject, fromEvent, merge, of as observableOf, timer } from 'rxjs';\nimport { debounceTime, filter, skip, startWith, switchMap, takeUntil } from 'rxjs/operators';\nimport { BrnTabs } from './brn-tabs';\n\n/** Config used to bind passive event listeners */\nconst passiveEventListenerOptions = normalizePassiveListenerOptions({\n\tpassive: true,\n}) as EventListenerOptions;\n\n/**\n * The directions that scrolling can go in when the header's tabs exceed the header width. 'After'\n * will scroll the header towards the end of the tabs list and 'before' will scroll towards the\n * beginning of the list.\n */\nexport type ScrollDirection = 'after' | 'before';\n\n/**\n * Amount of milliseconds to wait before starting to scroll the header automatically.\n * Set a little conservatively in order to handle fake events dispatched on touch devices.\n */\nconst HEADER_SCROLL_DELAY = 650;\n\n/**\n * Interval in milliseconds at which to scroll the header\n * while the user is holding their pointer.\n */\nconst HEADER_SCROLL_INTERVAL = 100;\n\n/** Item inside a paginated tab header. */\nexport type BrnPaginatedTabHeaderItem = FocusableOption & { elementRef: ElementRef };\n\n/**\n * Base class for a tab header that supported pagination.\n * @docs-private\n */\n@Directive()\nexport abstract class BrnTabsPaginatedList implements AfterContentChecked, AfterContentInit, AfterViewInit, OnDestroy {\n\tpublic abstract items: Signal<ReadonlyArray<BrnPaginatedTabHeaderItem>>;\n\tpublic abstract itemsChanges: Observable<ReadonlyArray<BrnPaginatedTabHeaderItem>>;\n\tpublic abstract tabListContainer: Signal<ElementRef<HTMLElement>>;\n\tpublic abstract tabList: Signal<ElementRef<HTMLElement>>;\n\tpublic abstract tabListInner: Signal<ElementRef<HTMLElement>>;\n\tpublic abstract nextPaginator: Signal<ElementRef<HTMLElement>>;\n\tpublic abstract previousPaginator: Signal<ElementRef<HTMLElement>>;\n\n\t/** The distance in pixels that the tab labels should be translated to the left. */\n\tprivate _scrollDistance = 0;\n\n\t/** Whether the header should scroll to the selected index after the view has been checked. */\n\tprivate _selectedIndexChanged = false;\n\n\tprivate readonly _root = inject(BrnTabs);\n\tprivate readonly _activeTab = this._root.$activeTab;\n\tprivate readonly _tabs = this._root.$tabs;\n\n\t/** Emits when the component is destroyed. */\n\tprotected readonly _destroyed = new Subject<void>();\n\n\t/** Whether the controls for pagination should be displayed */\n\tpublic readonly showPaginationControls = signal(false);\n\n\t/** Whether the tab list can be scrolled more towards the end of the tab label list. */\n\tpublic disableScrollAfter = true;\n\n\t/** Whether the tab list can be scrolled more towards the beginning of the tab label list. */\n\tpublic disableScrollBefore = true;\n\n\t/**\n\t * The number of tab labels that are displayed on the header. When this changes, the header\n\t * should re-evaluate the scroll position.\n\t */\n\tprivate _tabLabelCount!: number;\n\n\t/** Whether the scroll distance has changed and should be applied after the view is checked. */\n\tprivate _scrollDistanceChanged!: boolean;\n\n\t/** Used to manage focus between the tabs. */\n\tprivate _keyManager!: FocusKeyManager<BrnPaginatedTabHeaderItem>;\n\n\t/** Cached text content of the header. */\n\tprivate _currentTextContent!: string;\n\n\t/** Stream that will stop the automated scrolling. */\n\tprivate readonly _stopScrolling = new Subject<void>();\n\n\t/**\n\t * Whether pagination should be disabled. This can be used to avoid unnecessary\n\t * layout recalculations if it's known that pagination won't be required.\n\t */\n\tpublic readonly disablePagination = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n\t/** The index of the active tab. */\n\tprivate readonly _selectedIndex = computed(() => {\n\t\tconst currentTabKey = this._activeTab();\n\t\tconst tabs = this._tabs();\n\n\t\tlet activeIndex = 0;\n\t\tif (currentTabKey && this.items()) {\n\t\t\tconst currentTab = tabs[currentTabKey];\n\t\t\tif (currentTab) {\n\t\t\t\tactiveIndex = this.items().indexOf(currentTab.trigger);\n\t\t\t}\n\t\t}\n\n\t\treturn activeIndex;\n\t});\n\n\t/** Event emitted when the option is selected. */\n\tpublic readonly selectFocusedIndex = output<number>();\n\n\t/** Event emitted when a label is focused. */\n\tpublic readonly indexFocused = output<number>();\n\n\tprivate readonly _sharedResizeObserver = inject(SharedResizeObserver);\n\n\tprivate readonly _injector = inject(Injector);\n\n\tprotected _elementRef: ElementRef<HTMLElement> = inject(ElementRef);\n\tprotected _changeDetectorRef: ChangeDetectorRef = inject(ChangeDetectorRef);\n\tprivate readonly _viewportRuler: ViewportRuler = inject(ViewportRuler);\n\tprivate readonly _dir = inject(Directionality, { optional: true });\n\tprivate readonly _ngZone: NgZone = inject(NgZone);\n\tprivate readonly _platform: Platform = inject(Platform);\n\tpublic readonly animationMode = inject(ANIMATION_MODULE_TYPE, { optional: true });\n\n\tconstructor() {\n\t\t// Bind the `mouseleave` event on the outside since it doesn't change anything in the view.\n\t\tthis._ngZone.runOutsideAngular(() => {\n\t\t\tfromEvent(this._elementRef.nativeElement, 'mouseleave')\n\t\t\t\t.pipe(takeUntil(this._destroyed))\n\t\t\t\t.subscribe(() => {\n\t\t\t\t\tthis._stopInterval();\n\t\t\t\t});\n\t\t});\n\n\t\teffect(() => {\n\t\t\tconst selectedIndex = this._selectedIndex();\n\n\t\t\tif (selectedIndex !== 0) {\n\t\t\t\tthis._selectedIndexChanged = true;\n\t\t\t\tif (this._keyManager) {\n\t\t\t\t\tthis._keyManager.updateActiveItem(selectedIndex);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}\n\n\t/** Called when the user has selected an item via the keyboard. */\n\tprotected abstract _itemSelected(event: KeyboardEvent): void;\n\n\tngAfterViewInit() {\n\t\t// We need to handle these events manually, because we want to bind passive event listeners.\n\t\tfromEvent(this.previousPaginator().nativeElement, 'touchstart', passiveEventListenerOptions)\n\t\t\t.pipe(takeUntil(this._destroyed))\n\t\t\t.subscribe(() => {\n\t\t\t\tthis._handlePaginatorPress('before');\n\t\t\t});\n\n\t\tfromEvent(this.nextPaginator().nativeElement, 'touchstart', passiveEventListenerOptions)\n\t\t\t.pipe(takeUntil(this._destroyed))\n\t\t\t.subscribe(() => {\n\t\t\t\tthis._handlePaginatorPress('after');\n\t\t\t});\n\t}\n\n\tngAfterContentInit() {\n\t\tconst dirChange = this._dir ? this._dir.change : observableOf('ltr');\n\t\t// We need to debounce resize events because the alignment logic is expensive.\n\t\t// If someone animates the width of tabs, we don't want to realign on every animation frame.\n\t\t// Once we haven't seen any more resize events in the last 32ms (~2 animation frames) we can\n\t\t// re-align.\n\t\tconst resize = this._sharedResizeObserver\n\t\t\t.observe(this._elementRef.nativeElement)\n\t\t\t.pipe(debounceTime(32), takeUntil(this._destroyed));\n\t\t// Note: We do not actually need to watch these events for proper functioning of the tabs,\n\t\t// the resize events above should capture any viewport resize that we care about. However,\n\t\t// removing this is fairly breaking for screenshot tests, so we're leaving it here for now.\n\t\tconst viewportResize = this._viewportRuler.change(150).pipe(takeUntil(this._destroyed));\n\n\t\tconst realign = () => {\n\t\t\tthis.updatePagination();\n\t\t};\n\n\t\tthis._keyManager = new FocusKeyManager<BrnPaginatedTabHeaderItem>(this.items())\n\t\t\t.withHorizontalOrientation(this._getLayoutDirection())\n\t\t\t.withHomeAndEnd()\n\t\t\t.withWrap()\n\t\t\t// Allow focus to land on disabled tabs, as per https://w3c.github.io/aria-practices/#kbd_disabled_controls\n\t\t\t.skipPredicate(() => false);\n\n\t\tthis._keyManager.updateActiveItem(this._selectedIndex());\n\n\t\t// Note: We do not need to realign after the first render for proper functioning of the tabs\n\t\t// the resize events above should fire when we first start observing the element. However,\n\t\t// removing this is fairly breaking for screenshot tests, so we're leaving it here for now.\n\t\tafterNextRender(realign, { injector: this._injector });\n\n\t\t// On dir change or resize, realign the ink bar and update the orientation of\n\t\t// the key manager if the direction has changed.\n\t\tmerge(dirChange, viewportResize, resize, this.itemsChanges, this._itemsResized())\n\t\t\t.pipe(takeUntil(this._destroyed))\n\t\t\t.subscribe(() => {\n\t\t\t\t// We need to defer this to give the browser some time to recalculate\n\t\t\t\t// the element dimensions. The call has to be wrapped in `NgZone.run`,\n\t\t\t\t// because the viewport change handler runs outside of Angular.\n\t\t\t\tthis._ngZone.run(() => {\n\t\t\t\t\tPromise.resolve().then(() => {\n\t\t\t\t\t\t// Clamp the scroll distance, because it can change with the number of tabs.\n\t\t\t\t\t\tthis._scrollDistance = Math.max(0, Math.min(this._getMaxScrollDistance(), this._scrollDistance));\n\t\t\t\t\t\trealign();\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t\tthis._keyManager.withHorizontalOrientation(this._getLayoutDirection());\n\t\t\t});\n\n\t\t// If there is a change in the focus key manager we need to emit the `indexFocused`\n\t\t// event in order to provide a public event that notifies about focus changes. Also we realign\n\t\t// the tabs container by scrolling the new focused tab into the visible section.\n\t\tthis._keyManager.change.subscribe((newFocusIndex) => {\n\t\t\tthis.indexFocused.emit(newFocusIndex);\n\t\t\tthis._setTabFocus(newFocusIndex);\n\t\t});\n\t}\n\n\t/** Sends any changes that could affect the layout of the items. */\n\tprivate _itemsResized(): Observable<ResizeObserverEntry[]> {\n\t\tif (typeof ResizeObserver !== 'function') {\n\t\t\treturn EMPTY;\n\t\t}\n\n\t\treturn this.itemsChanges.pipe(\n\t\t\tstartWith(this.items()),\n\t\t\tswitchMap(\n\t\t\t\t(tabItems: ReadonlyArray<BrnPaginatedTabHeaderItem>) =>\n\t\t\t\t\tnew Observable((observer: Observer<ResizeObserverEntry[]>) =>\n\t\t\t\t\t\tthis._ngZone.runOutsideAngular(() => {\n\t\t\t\t\t\t\tconst resizeObserver = new ResizeObserver((entries) => observer.next(entries));\n\t\t\t\t\t\t\tfor (const tabItem of tabItems) {\n\t\t\t\t\t\t\t\tresizeObserver.observe(tabItem.elementRef.nativeElement);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\treturn () => {\n\t\t\t\t\t\t\t\tresizeObserver.disconnect();\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t}),\n\t\t\t\t\t),\n\t\t\t),\n\t\t\t// Skip the first emit since the resize observer emits when an item\n\t\t\t// is observed for new items when the tab is already inserted\n\t\t\tskip(1),\n\t\t\t// Skip emissions where all the elements are invisible since we don't want\n\t\t\t// the header to try and re-render with invalid measurements. See #25574.\n\t\t\tfilter((entries) => entries.some((e) => e.contentRect.width > 0 && e.contentRect.height > 0)),\n\t\t);\n\t}\n\n\tngAfterContentChecked(): void {\n\t\t// If the number of tab labels have changed, check if scrolling should be enabled\n\t\tif (this._tabLabelCount !== this.items().length) {\n\t\t\tthis.updatePagination();\n\t\t\tthis._tabLabelCount = this.items().length;\n\t\t\tthis._changeDetectorRef.markForCheck();\n\t\t}\n\n\t\t// If the selected index has changed, scroll to the label and check if the scrolling controls\n\t\t// should be disabled.\n\t\tif (this._selectedIndexChanged) {\n\t\t\tthis._scrollToLabel(this._selectedIndex());\n\t\t\tthis._checkScrollingControls();\n\t\t\tthis._selectedIndexChanged = false;\n\t\t\tthis._changeDetectorRef.markForCheck();\n\t\t}\n\n\t\t// If the scroll distance has been changed (tab selected, focused, scroll controls activated),\n\t\t// then translate the header to reflect this.\n\t\tif (this._scrollDistanceChanged) {\n\t\t\tthis._updateTabScrollPosition();\n\t\t\tthis._scrollDistanceChanged = false;\n\t\t\tthis._changeDetectorRef.markForCheck();\n\t\t}\n\t}\n\n\tngOnDestroy() {\n\t\tthis._keyManager?.destroy();\n\t\tthis._destroyed.next();\n\t\tthis._destroyed.complete();\n\t\tthis._stopScrolling.complete();\n\t}\n\n\t/** Handles keyboard events on the header. */\n\t_handleKeydown(event: KeyboardEvent) {\n\t\t// We don't handle any key bindings with a modifier key.\n\t\tif (hasModifierKey(event)) {\n\t\t\treturn;\n\t\t}\n\n\t\tswitch (event.keyCode) {\n\t\t\tcase ENTER:\n\t\t\tcase SPACE:\n\t\t\t\tif (this.focusIndex !== this._selectedIndex()) {\n\t\t\t\t\tconst item = this.items()[this.focusIndex];\n\n\t\t\t\t\tif (item && !item.disabled) {\n\t\t\t\t\t\tthis.selectFocusedIndex.emit(this.focusIndex);\n\t\t\t\t\t\tthis._itemSelected(event);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tthis._keyManager.onKeydown(event);\n\t\t}\n\t}\n\n\t/**\n\t * Callback for when the MutationObserver detects that the content has changed.\n\t */\n\t_onContentChanges() {\n\t\tconst textContent = this._elementRef.nativeElement.textContent;\n\n\t\t// We need to diff the text content of the header, because the MutationObserver callback\n\t\t// will fire even if the text content didn't change which is inefficient and is prone\n\t\t// to infinite loops if a poorly constructed expression is passed in (see #14249).\n\t\tif (textContent !== this._currentTextContent) {\n\t\t\tthis._currentTextContent = textContent || '';\n\n\t\t\t// The content observer runs outside the `NgZone` by default, which\n\t\t\t// means that we need to bring the callback back in ourselves.\n\t\t\tthis._ngZone.run(() => {\n\t\t\t\tthis.updatePagination();\n\t\t\t\tthis._changeDetectorRef.markForCheck();\n\t\t\t});\n\t\t}\n\t}\n\n\t/**\n\t * Updates the view whether pagination should be enabled or not.\n\t *\n\t * WARNING: Calling this method can be very costly in terms of performance. It should be called\n\t * as infrequently as possible from outside of the Tabs component as it causes a reflow of the\n\t * page.\n\t */\n\tupdatePagination() {\n\t\tthis._checkPaginationEnabled();\n\t\tthis._checkScrollingControls();\n\t\tthis._updateTabScrollPosition();\n\t}\n\n\t/** Tracks which element has focus; used for keyboard navigation */\n\tpublic get focusIndex(): number {\n\t\treturn this._keyManager ? (this._keyManager.activeItemIndex ?? 0) : 0;\n\t}\n\n\t/** When the focus index is set, we must manually send focus to the correct label */\n\tpublic set focusIndex(value: number) {\n\t\tif (!this._isValidIndex(value) || this.focusIndex === value || !this._keyManager) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._keyManager.setActiveItem(value);\n\t}\n\n\t/**\n\t * Determines if an index is valid. If the tabs are not ready yet, we assume that the user is\n\t * providing a valid index and return true.\n\t */\n\t_isValidIndex(index: number): boolean {\n\t\treturn this.items() ? !!this.items()[index] : true;\n\t}\n\n\t/**\n\t * Sets focus on the HTML element for the label wrapper and scrolls it into the view if\n\t * scrolling is enabled.\n\t */\n\t_setTabFocus(tabIndex: number) {\n\t\tif (this.showPaginationControls()) {\n\t\t\tthis._scrollToLabel(tabIndex);\n\t\t}\n\n\t\tif (this.items()?.length) {\n\t\t\tthis.items()[tabIndex].focus();\n\n\t\t\t// Do not let the browser manage scrolling to focus the element, this will be handled\n\t\t\t// by using translation. In LTR, the scroll left should be 0. In RTL, the scroll width\n\t\t\t// should be the full width minus the offset width.\n\t\t\tconst containerEl = this.tabListContainer().nativeElement;\n\t\t\tconst dir = this._getLayoutDirection();\n\n\t\t\tif (dir === 'ltr') {\n\t\t\t\tcontainerEl.scrollLeft = 0;\n\t\t\t} else {\n\t\t\t\tcontainerEl.scrollLeft = containerEl.scrollWidth - containerEl.offsetWidth;\n\t\t\t}\n\t\t}\n\t}\n\n\t/** The layout direction of the containing app. */\n\t_getLayoutDirection(): Direction {\n\t\treturn this._dir && this._dir.value === 'rtl' ? 'rtl' : 'ltr';\n\t}\n\n\t/** Performs the CSS transformation on the tab list that will cause the list to scroll. */\n\t_updateTabScrollPosition() {\n\t\tif (this.disablePagination()) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst scrollDistance = this.scrollDistance;\n\t\tconst translateX = this._getLayoutDirection() === 'ltr' ? -scrollDistance : scrollDistance;\n\n\t\t// Don't use `translate3d` here because we don't want to create a new layer. A new layer\n\t\t// seems to cause flickering and overflow in Internet Explorer. For example, the ink bar\n\t\t// and ripples will exceed the boundaries of the visible tab bar.\n\t\t// See: https://github.com/angular/components/issues/10276\n\t\t// We round the `transform` here, because transforms with sub-pixel precision cause some\n\t\t// browsers to blur the content of the element.\n\t\tthis.tabList().nativeElement.style.transform = `translateX(${Math.round(translateX)}px)`;\n\n\t\t// Setting the `transform` on IE will change the scroll offset of the parent, causing the\n\t\t// position to be thrown off in some cases. We have to reset it ourselves to ensure that\n\t\t// it doesn't get thrown off. Note that we scope it only to IE and Edge, because messing\n\t\t// with the scroll position throws off Chrome 71+ in RTL mode (see #14689).\n\t\tif (this._platform.TRIDENT || this._platform.EDGE) {\n\t\t\tthis.tabListContainer().nativeElement.scrollLeft = 0;\n\t\t}\n\t}\n\n\t/** Sets the distance in pixels that the tab header should be transformed in the X-axis. */\n\tpublic get scrollDistance(): number {\n\t\treturn this._scrollDistance;\n\t}\n\tpublic set scrollDistance(value: number) {\n\t\tthis._scrollTo(value);\n\t}\n\n\t/**\n\t * Moves the tab list in the 'before' or 'after' direction (towards the beginning of the list or\n\t * the end of the list, respectively). The distance to scroll is computed to be a third of the\n\t * length of the tab list view window.\n\t *\n\t * This is an expensive call that forces a layout reflow to compute box and scroll metrics and\n\t * should be called sparingly.\n\t */\n\t_scrollHeader(direction: ScrollDirection) {\n\t\tconst viewLength = this.tabListContainer().nativeElement.offsetWidth;\n\n\t\t// Move the scroll distance one-third the length of the tab list's viewport.\n\t\tconst scrollAmount = ((direction === 'before' ? -1 : 1) * viewLength) / 3;\n\n\t\treturn this._scrollTo(this._scrollDistance + scrollAmount);\n\t}\n\n\t/** Handles click events on the pagination arrows. */\n\t_handlePaginatorClick(direction: ScrollDirection) {\n\t\tthis._stopInterval();\n\t\tthis._scrollHeader(direction);\n\t}\n\n\t/**\n\t * Moves the tab list such that the desired tab label (marked by index) is moved into view.\n\t *\n\t * This is an expensive call that forces a layout reflow to compute box and scroll metrics and\n\t * should be called sparingly.\n\t */\n\t_scrollToLabel(labelIndex: number) {\n\t\tif (this.disablePagination()) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst selectedLabel = this.items() ? this.items()[labelIndex] : null;\n\n\t\tif (!selectedLabel) {\n\t\t\treturn;\n\t\t}\n\n\t\t// The view length is the visible width of the tab labels.\n\t\tconst viewLength = this.tabListContainer().nativeElement.offsetWidth;\n\t\tconst { offsetLeft, offsetWidth } = selectedLabel.elementRef.nativeElement;\n\n\t\tlet labelBeforePos: number;\n\t\tlet labelAfterPos: number;\n\t\tif (this._getLayoutDirection() === 'ltr') {\n\t\t\tlabelBeforePos = offsetLeft;\n\t\t\tlabelAfterPos = labelBeforePos + offsetWidth;\n\t\t} else {\n\t\t\tlabelAfterPos = this.tabListInner().nativeElement.offsetWidth - offsetLeft;\n\t\t\tlabelBeforePos = labelAfterPos - offsetWidth;\n\t\t}\n\n\t\tconst beforeVisiblePos = this.scrollDistance;\n\t\tconst afterVisiblePos = this.scrollDistance + viewLength;\n\n\t\tif (labelBeforePos < beforeVisiblePos) {\n\t\t\t// Scroll header to move label to the before direction\n\t\t\tthis.scrollDistance -= beforeVisiblePos - labelBeforePos;\n\t\t} else if (labelAfterPos > afterVisiblePos) {\n\t\t\t// Scroll header to move label to the after direction\n\t\t\tthis.scrollDistance += Math.min(labelAfterPos - afterVisiblePos, labelBeforePos - beforeVisiblePos);\n\t\t}\n\t}\n\n\t/**\n\t * Evaluate whether the pagination controls should be displayed. If the scroll width of the\n\t * tab list is wider than the size of the header container, then the pagination controls should\n\t * be shown.\n\t *\n\t * This is an expensive call that forces a layout reflow to compute box and scroll metrics and\n\t * should be called sparingly.\n\t */\n\t_checkPaginationEnabled() {\n\t\tif (this.disablePagination()) {\n\t\t\tthis.showPaginationControls.set(false);\n\t\t} else {\n\t\t\tconst isEnabled = this.tabListInner().nativeElement.scrollWidth > this._elementRef.nativeElement.offsetWidth;\n\n\t\t\tif (!isEnabled) {\n\t\t\t\tthis.scrollDistance = 0;\n\t\t\t}\n\n\t\t\tif (isEnabled !== this.showPaginationControls()) {\n\t\t\t\tthis._changeDetectorRef.markForCheck();\n\t\t\t}\n\n\t\t\tthis.showPaginationControls.set(isEnabled);\n\t\t}\n\t}\n\n\t/**\n\t * Evaluate whether the before and after controls should be enabled or disabled.\n\t * If the header is at the beginning of the list (scroll distance is equal to 0) then disable the\n\t * before button. If the header is at the end of the list (scroll distance is equal to the\n\t * maximum distance we can scroll), then disable the after button.\n\t *\n\t * This is an expensive call that forces a layout reflow to compute box and scroll metrics and\n\t * should be called sparingly.\n\t */\n\t_checkScrollingControls() {\n\t\tif (this.disablePagination()) {\n\t\t\tthis.disableScrollAfter = this.disableScrollBefore = true;\n\t\t} else {\n\t\t\t// Check if the pagination arrows should be activated.\n\t\t\tthis.disableScrollBefore = this.scrollDistance === 0;\n\t\t\tthis.disableScrollAfter = this.scrollDistance === this._getMaxScrollDistance();\n\t\t\tthis._changeDetectorRef.markForCheck();\n\t\t}\n\t}\n\n\t/**\n\t * Determines what is the maximum length in pixels that can be set for the scroll distance. This\n\t * is equal to the difference in width between the tab list container and tab header container.\n\t *\n\t * This is an expensive call that forces a layout reflow to compute box and scroll metrics and\n\t * should be called sparingly.\n\t */\n\t_getMaxScrollDistance(): number {\n\t\tconst lengthOfTabList = this.tabListInner().nativeElement.scrollWidth;\n\t\tconst viewLength = this.tabListContainer().nativeElement.offsetWidth;\n\t\treturn lengthOfTabList - viewLength || 0;\n\t}\n\n\t/** Stops the currently-running paginator interval. */\n\t_stopInterval() {\n\t\tthis._stopScrolling.next();\n\t}\n\n\t/**\n\t * Handles the user pressing down on one of the paginators.\n\t * Starts scrolling the header after a certain amount of time.\n\t * @param direction In which direction the paginator should be scrolled.\n\t */\n\t_handlePaginatorPress(direction: ScrollDirection, mouseEvent?: MouseEvent) {\n\t\t// Don't start auto scrolling for right mouse button clicks. Note that we shouldn't have to\n\t\t// null check the `button`, but we do it so we don't break tests that use fake events.\n\t\tif (mouseEvent && mouseEvent.button !== null && mouseEvent.button !== 0) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Avoid overlapping timers.\n\t\tthis._stopInterval();\n\n\t\t// Start a timer after the delay and keep firing based on the interval.\n\t\ttimer(HEADER_SCROLL_DELAY, HEADER_SCROLL_INTERVAL)\n\t\t\t// Keep the timer going until something tells it to stop or the component is destroyed.\n\t\t\t.pipe(takeUntil(merge(this._stopScrolling, this._destroyed)))\n\t\t\t.subscribe(() => {\n\t\t\t\tconst { maxScrollDistance, distance } = this._scrollHeader(direction);\n\n\t\t\t\t// Stop the timer if we've reached the start or the end.\n\t\t\t\tif (distance === 0 || distance >= maxScrollDistance) {\n\t\t\t\t\tthis._stopInterval();\n\t\t\t\t}\n\t\t\t});\n\t}\n\n\t/**\n\t * Scrolls the header to a given position.\n\t * @param position Position to which to scroll.\n\t * @returns Information on the current scroll distance and the maximum.\n\t */\n\tprivate _scrollTo(position: number) {\n\t\tif (this.disablePagination()) {\n\t\t\treturn { maxScrollDistance: 0, distance: 0 };\n\t\t}\n\n\t\tconst maxScrollDistance = this._getMaxScrollDistance();\n\t\tthis._scrollDistance = Math.max(0, Math.min(maxScrollDistance, position));\n\n\t\t// Mark that the scroll distance has changed so that after the view is checked, the CSS\n\t\t// transformation can move the header.\n\t\tthis._scrollDistanceChanged = true;\n\t\tthis._checkScrollingControls();\n\n\t\treturn { maxScrollDistance, distance: this._scrollDistance };\n\t}\n}\n","import { BrnTabs } from './lib/brn-tabs';\nimport { BrnTabsContent } from './lib/brn-tabs-content';\nimport { BrnTabsContentLazy } from './lib/brn-tabs-content-lazy';\nimport { BrnTabsList } from './lib/brn-tabs-list';\nimport { BrnTabsTrigger } from './lib/brn-tabs-trigger';\n\nexport * from './lib/brn-tabs';\nexport * from './lib/brn-tabs-content';\nexport * from './lib/brn-tabs-content-lazy';\nexport * from './lib/brn-tabs-list';\nexport * from './lib/brn-tabs-paginated-list';\nexport * from './lib/brn-tabs-trigger';\n\nexport const BrnTabsImports = [BrnTabs, BrnTabsList, BrnTabsTrigger, BrnTabsContent, BrnTabsContentLazy] as const;\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["observableOf"],"mappings":";;;;;;;;;;;MAkBa,OAA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AAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;+GAApB,oBAAoB,EAAA,YAAA,EAAA,IAAA,EAAA,MAAA,EAAA,EAAA,iBAAA,EAAA,EAAA,iBAAA,EAAA,mBAAA,EAAA,UAAA,EAAA,mBAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,EAAA,OAAA,EAAA,EAAA,kBAAA,EAAA,oBAAA,EAAA,YAAA,EAAA,cAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA;;4FAApB,oBAAoB,EAAA,UAAA,EAAA,CAAA;kBADzC;;;AChEM,MAAM,cAAc,GAAG,CAAC,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,cAAc,EAAE,kBAAkB;;ACbvG;;AAEG;;;;"}
1
+ {"version":3,"file":"spartan-ng-brain-tabs.mjs","sources":["../../../../libs/brain/tabs/src/lib/brn-tabs.ts","../../../../libs/brain/tabs/src/lib/brn-tabs-content.ts","../../../../libs/brain/tabs/src/lib/brn-tabs-content-lazy.ts","../../../../libs/brain/tabs/src/lib/brn-tabs-trigger.ts","../../../../libs/brain/tabs/src/lib/brn-tabs-list.ts","../../../../libs/brain/tabs/src/lib/brn-tabs-paginated-list.ts","../../../../libs/brain/tabs/src/index.ts","../../../../libs/brain/tabs/src/spartan-ng-brain-tabs.ts"],"sourcesContent":["import { Directionality } from '@angular/cdk/bidi';\nimport { Directive, inject, input, model, output, signal } from '@angular/core';\nimport type { BrnTabsContent } from './brn-tabs-content';\nimport type { BrnTabsTrigger } from './brn-tabs-trigger';\n\nexport type BrnTabsOrientation = 'horizontal' | 'vertical';\nexport type BrnTabsDirection = 'ltr' | 'rtl';\nexport type BrnActivationMode = 'automatic' | 'manual';\nexport type TabEntry = { trigger: BrnTabsTrigger; content: BrnTabsContent };\n\n@Directive({\n\tselector: '[brnTabs]',\n\texportAs: 'brnTabs',\n\thost: {\n\t\t'[attr.data-orientation]': 'orientation()',\n\t\t'[attr.dir]': 'direction()',\n\t},\n})\nexport class BrnTabs {\n\tprivate readonly _dir = inject(Directionality);\n\n\tpublic readonly orientation = input<BrnTabsOrientation>('horizontal');\n\t/** internal **/\n\tpublic $orientation = this.orientation;\n\n\t/** internal **/\n\tpublic readonly direction = this._dir.valueSignal;\n\n\tpublic readonly activeTab = model<string | undefined>(undefined, { alias: 'brnTabs' });\n\t/** internal **/\n\tpublic $activeTab = this.activeTab.asReadonly();\n\n\tpublic readonly activationMode = input<BrnActivationMode>('automatic');\n\t/** internal **/\n\tpublic $activationMode = this.activationMode;\n\n\tpublic readonly tabActivated = output<string>();\n\n\tprivate readonly _tabs = signal<{ [key: string]: TabEntry }>({});\n\tpublic readonly $tabs = this._tabs.asReadonly();\n\n\tpublic registerTrigger(key: string, trigger: BrnTabsTrigger) {\n\t\tthis.updateEntry(key, { trigger });\n\t}\n\n\tpublic registerContent(key: string, content: BrnTabsContent) {\n\t\tthis.updateEntry(key, { content });\n\t}\n\n\tpublic unregisterTrigger(key: string) {\n\t\tthis.updateEntry(key, { trigger: undefined });\n\t}\n\n\tpublic unregisterContent(key: string): void {\n\t\tthis.updateEntry(key, { content: undefined });\n\t}\n\n\tprivate updateEntry(key: string, patch: Partial<TabEntry>) {\n\t\tthis._tabs.update((tabs) => {\n\t\t\tconst existing = tabs[key] ?? {};\n\t\t\tconst merged = { ...existing, ...patch };\n\t\t\tconst entryEmpty = !merged.trigger && !merged.content;\n\t\t\tif (entryEmpty) {\n\t\t\t\tconst { [key]: removed, ...rest } = tabs;\n\t\t\t\treturn rest;\n\t\t\t}\n\t\t\treturn { ...tabs, [key]: merged };\n\t\t});\n\t}\n\n\temitTabActivated(key: string) {\n\t\tthis.tabActivated.emit(key);\n\t}\n\n\tsetActiveTab(key: string) {\n\t\tthis.activeTab.set(key);\n\t}\n}\n","import { computed, Directive, effect, ElementRef, inject, input, type OnDestroy, untracked } from '@angular/core';\nimport { BrnTabs } from './brn-tabs';\n\n@Directive({\n\tselector: '[brnTabsContent]',\n\texportAs: 'brnTabsContent',\n\thost: {\n\t\trole: 'tabpanel',\n\t\ttabindex: '0',\n\t\t'[id]': '_contentId()',\n\t\t'[attr.aria-labelledby]': '_labelId()',\n\t\t'[hidden]': '_isSelected() === false',\n\t},\n})\nexport class BrnTabsContent implements OnDestroy {\n\tprivate readonly _root = inject(BrnTabs);\n\tprivate readonly _elementRef = inject(ElementRef);\n\n\tpublic readonly contentFor = input.required<string>({ alias: 'brnTabsContent' });\n\tprotected readonly _isSelected = computed(() => this._root.$activeTab() === this.contentFor());\n\tprotected readonly _contentId = computed(() => `brn-tabs-content-${this.contentFor()}`);\n\tprotected readonly _labelId = computed(() => `brn-tabs-label-${this.contentFor()}`);\n\n\tconstructor() {\n\t\teffect(() => {\n\t\t\tconst contentFor = this.contentFor();\n\t\t\tuntracked(() => this._root.registerContent(contentFor, this));\n\t\t});\n\t}\n\n\tpublic focus() {\n\t\tthis._elementRef.nativeElement.focus();\n\t}\n\n\tngOnDestroy(): void {\n\t\tthis._root.unregisterContent(this.contentFor());\n\t}\n}\n","import { DestroyRef, Directive, effect, inject, TemplateRef, untracked, ViewContainerRef } from '@angular/core';\nimport { BrnTabs } from './brn-tabs';\nimport { BrnTabsContent } from './brn-tabs-content';\n\n@Directive({\n\tselector: 'ng-template[brnTabsContentLazy]',\n\texportAs: 'brnTabsContentLazy',\n})\nexport class BrnTabsContentLazy {\n\tprivate readonly _root = inject(BrnTabs);\n\tprivate readonly _content = inject(BrnTabsContent);\n\tprivate readonly _templateRef = inject(TemplateRef);\n\tprivate readonly _viewContainerRef = inject(ViewContainerRef);\n\tprivate readonly _destroyRef = inject(DestroyRef);\n\n\tprivate _hasBeenActivated = false;\n\n\tconstructor() {\n\t\tthis._destroyRef.onDestroy(() => this._viewContainerRef.clear());\n\n\t\teffect(() => {\n\t\t\tconst activeTab = this._root.$activeTab();\n\t\t\tconst contentFor = this._content.contentFor();\n\n\t\t\tuntracked(() => {\n\t\t\t\tif (activeTab === contentFor && !this._hasBeenActivated) {\n\t\t\t\t\tthis._viewContainerRef.createEmbeddedView(this._templateRef);\n\t\t\t\t\tthis._hasBeenActivated = true;\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\t}\n}\n","import type { BooleanInput } from '@angular/cdk/coercion';\nimport {\n\tDirective,\n\tElementRef,\n\ttype OnDestroy,\n\tbooleanAttribute,\n\tcomputed,\n\teffect,\n\tinject,\n\tinput,\n\tuntracked,\n} from '@angular/core';\nimport { BrnTabs } from './brn-tabs';\n\n@Directive({\n\tselector: 'button[brnTabsTrigger]',\n\texportAs: 'brnTabsTrigger',\n\thost: {\n\t\t'[id]': '_labelId()',\n\t\ttype: 'button',\n\t\trole: 'tab',\n\t\t'[tabindex]': '_disabled() ? -1 : (selected() ? 0 : -1)',\n\t\t'[attr.aria-selected]': 'selected()',\n\t\t'[attr.aria-controls]': '_contentId()',\n\t\t'[attr.aria-disabled]': '_disabled()',\n\t\t'[attr.data-state]': \"selected() ? 'active' : 'inactive'\",\n\t\t'[attr.data-orientation]': '_orientation()',\n\t\t'[attr.data-disabled]': \"_disabled() ? '' : undefined\",\n\t\t'[attr.disabled]': \"_disabled() ? '' : undefined\",\n\t\t'(click)': 'activate()',\n\t},\n})\nexport class BrnTabsTrigger implements OnDestroy {\n\tpublic readonly elementRef = inject(ElementRef);\n\n\tprivate readonly _root = inject(BrnTabs);\n\n\tprotected readonly _orientation = this._root.$orientation;\n\n\tpublic readonly triggerFor = input.required<string>({ alias: 'brnTabsTrigger' });\n\tpublic readonly selected = computed(() => this._root.$activeTab() === this.triggerFor());\n\tprotected readonly _contentId = computed(() => `brn-tabs-content-${this.triggerFor()}`);\n\tprotected readonly _labelId = computed(() => `brn-tabs-label-${this.triggerFor()}`);\n\n\t// eslint-disable-next-line @typescript-eslint/naming-convention\n\tpublic readonly _disabled = input<boolean, BooleanInput>(false, {\n\t\talias: 'disabled',\n\t\ttransform: booleanAttribute,\n\t});\n\n\tpublic get disabled(): boolean {\n\t\treturn this._disabled();\n\t}\n\n\tconstructor() {\n\t\teffect(() => {\n\t\t\tconst triggerFor = this.triggerFor();\n\t\t\tuntracked(() => this._root.registerTrigger(triggerFor, this));\n\t\t});\n\t}\n\n\tpublic focus() {\n\t\tthis.elementRef.nativeElement.focus();\n\t\tif (this._root.$activationMode() === 'automatic' && !this.selected()) {\n\t\t\tthis.activate();\n\t\t}\n\t}\n\n\tpublic activate() {\n\t\tif (!this.triggerFor()) return;\n\t\tthis._root.setActiveTab(this.triggerFor());\n\t\tthis._root.emitTabActivated(this.triggerFor());\n\t}\n\n\tpublic get key(): string | undefined {\n\t\treturn this.triggerFor();\n\t}\n\n\tngOnDestroy(): void {\n\t\tthis._root.unregisterTrigger(this.triggerFor());\n\t}\n}\n","import { FocusKeyManager } from '@angular/cdk/a11y';\nimport { type AfterContentInit, Directive, Injector, contentChildren, inject } from '@angular/core';\nimport { BrnTabs } from './brn-tabs';\nimport { BrnTabsTrigger } from './brn-tabs-trigger';\n\n@Directive({\n\tselector: '[brnTabsList]',\n\texportAs: 'brnTabsList',\n\thost: {\n\t\trole: 'tablist',\n\t\t'[attr.aria-orientation]': '_orientation()',\n\t\t'[attr.data-orientation]': '_orientation()',\n\t\t'(focusin)': '_onFocusIn($event)',\n\t\t'(keydown)': '_onKeydown($event)',\n\t},\n})\nexport class BrnTabsList implements AfterContentInit {\n\tprivate readonly _root = inject(BrnTabs);\n\n\tprotected readonly _orientation = this._root.$orientation;\n\tprivate readonly _direction = this._root.direction;\n\tprivate readonly _injector = inject(Injector);\n\n\tprivate _keyManager?: FocusKeyManager<BrnTabsTrigger>;\n\n\tpublic readonly triggers = contentChildren(BrnTabsTrigger, { descendants: true });\n\n\tpublic ngAfterContentInit() {\n\t\tthis._keyManager = new FocusKeyManager<BrnTabsTrigger>(this.triggers, this._injector)\n\t\t\t.withHorizontalOrientation(this._direction())\n\t\t\t.withHomeAndEnd()\n\t\t\t.withPageUpDown()\n\t\t\t.withWrap();\n\t}\n\n\t// Activation can bypass the key manager (mouse click, programmatic change), so keep its active\n\t// item aligned with the trigger that actually owns DOM focus. `focusin` fires before the next\n\t// keydown, and focus is the correct source in manual activation mode, where focus and selection\n\t// are allowed to diverge.\n\tprotected _onFocusIn(event: FocusEvent) {\n\t\tconst focusedTrigger = this.triggers().find((trigger) => trigger.elementRef.nativeElement === event.target);\n\t\tif (focusedTrigger) {\n\t\t\tthis._keyManager?.updateActiveItem(focusedTrigger);\n\t\t}\n\t}\n\n\tprotected _onKeydown(event: KeyboardEvent) {\n\t\tif ('key' in event) {\n\t\t\tif (this._orientation() === 'horizontal') {\n\t\t\t\tif (event.key === 'ArrowUp' || event.key === 'ArrowDown') return;\n\t\t\t}\n\t\t\tif (this._orientation() === 'vertical') {\n\t\t\t\tif (event.key === 'ArrowLeft' || event.key === 'ArrowRight') return;\n\t\t\t}\n\t\t}\n\t\tthis._keyManager?.onKeydown(event);\n\t}\n}\n","/**\n * We are building on shoulders of giants here and adapt the implementation provided by the incredible Angular\n * team: https://github.com/angular/components/blob/main/src/material/tabs/paginated-tab-header.ts\n * Check them out! Give them a try! Leave a star! Their work is incredible!\n */\n\n/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport { FocusKeyManager, type FocusableOption } from '@angular/cdk/a11y';\nimport { type Direction, Directionality } from '@angular/cdk/bidi';\nimport { type BooleanInput } from '@angular/cdk/coercion';\nimport { hasModifierKey } from '@angular/cdk/keycodes';\nimport { SharedResizeObserver } from '@angular/cdk/observers/private';\nimport { Platform, normalizePassiveListenerOptions } from '@angular/cdk/platform';\nimport { ViewportRuler } from '@angular/cdk/scrolling';\nimport {\n\tANIMATION_MODULE_TYPE,\n\ttype AfterContentChecked,\n\ttype AfterContentInit,\n\ttype AfterViewInit,\n\tChangeDetectorRef,\n\tDirective,\n\tElementRef,\n\tInjector,\n\tNgZone,\n\ttype OnDestroy,\n\ttype Signal,\n\tafterNextRender,\n\tbooleanAttribute,\n\tcomputed,\n\teffect,\n\tinject,\n\tinput,\n\toutput,\n\tsignal,\n} from '@angular/core';\nimport { EMPTY, Observable, type Observer, Subject, fromEvent, merge, of as observableOf, timer } from 'rxjs';\nimport { debounceTime, filter, skip, startWith, switchMap, takeUntil } from 'rxjs/operators';\nimport { BrnTabs } from './brn-tabs';\n\n/** Config used to bind passive event listeners */\nconst passiveEventListenerOptions = normalizePassiveListenerOptions({\n\tpassive: true,\n}) as EventListenerOptions;\n\n/**\n * The directions that scrolling can go in when the header's tabs exceed the header width. 'After'\n * will scroll the header towards the end of the tabs list and 'before' will scroll towards the\n * beginning of the list.\n */\nexport type ScrollDirection = 'after' | 'before';\n\n/**\n * Amount of milliseconds to wait before starting to scroll the header automatically.\n * Set a little conservatively in order to handle fake events dispatched on touch devices.\n */\nconst HEADER_SCROLL_DELAY = 650;\n\n/**\n * Interval in milliseconds at which to scroll the header\n * while the user is holding their pointer.\n */\nconst HEADER_SCROLL_INTERVAL = 100;\n\n/** Item inside a paginated tab header. */\nexport type BrnPaginatedTabHeaderItem = FocusableOption & { elementRef: ElementRef };\n\n/**\n * Base class for a tab header that supported pagination.\n * @docs-private\n */\n@Directive()\nexport abstract class BrnTabsPaginatedList implements AfterContentChecked, AfterContentInit, AfterViewInit, OnDestroy {\n\tpublic abstract items: Signal<ReadonlyArray<BrnPaginatedTabHeaderItem>>;\n\tpublic abstract itemsChanges: Observable<ReadonlyArray<BrnPaginatedTabHeaderItem>>;\n\tpublic abstract tabListContainer: Signal<ElementRef<HTMLElement>>;\n\tpublic abstract tabList: Signal<ElementRef<HTMLElement>>;\n\tpublic abstract tabListInner: Signal<ElementRef<HTMLElement>>;\n\tpublic abstract nextPaginator: Signal<ElementRef<HTMLElement>>;\n\tpublic abstract previousPaginator: Signal<ElementRef<HTMLElement>>;\n\n\t/** The distance in pixels that the tab labels should be translated to the left. */\n\tprivate _scrollDistance = 0;\n\n\t/** Whether the header should scroll to the selected index after the view has been checked. */\n\tprivate _selectedIndexChanged = false;\n\n\tprivate readonly _root = inject(BrnTabs);\n\tprivate readonly _activeTab = this._root.$activeTab;\n\tprivate readonly _tabs = this._root.$tabs;\n\n\t/** Emits when the component is destroyed. */\n\tprotected readonly _destroyed = new Subject<void>();\n\n\t/** Whether the controls for pagination should be displayed */\n\tpublic readonly showPaginationControls = signal(false);\n\n\t/** Whether the tab list can be scrolled more towards the end of the tab label list. */\n\tpublic disableScrollAfter = true;\n\n\t/** Whether the tab list can be scrolled more towards the beginning of the tab label list. */\n\tpublic disableScrollBefore = true;\n\n\t/**\n\t * The number of tab labels that are displayed on the header. When this changes, the header\n\t * should re-evaluate the scroll position.\n\t */\n\tprivate _tabLabelCount!: number;\n\n\t/** Whether the scroll distance has changed and should be applied after the view is checked. */\n\tprivate _scrollDistanceChanged!: boolean;\n\n\t/** Used to manage focus between the tabs. */\n\tprivate _keyManager!: FocusKeyManager<BrnPaginatedTabHeaderItem>;\n\n\t/** Cached text content of the header. */\n\tprivate _currentTextContent!: string;\n\n\t/** Stream that will stop the automated scrolling. */\n\tprivate readonly _stopScrolling = new Subject<void>();\n\n\t/**\n\t * Whether pagination should be disabled. This can be used to avoid unnecessary\n\t * layout recalculations if it's known that pagination won't be required.\n\t */\n\tpublic readonly disablePagination = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n\t/** Index of the active tab among this list's items, or undefined when there isn't one. */\n\tprivate readonly _selectedItemIndex = computed(() => {\n\t\tconst currentTabKey = this._activeTab();\n\t\tconst trigger = currentTabKey ? this._tabs()[currentTabKey]?.trigger : undefined;\n\t\tif (!trigger) return undefined;\n\n\t\tconst index = this.items().indexOf(trigger);\n\t\treturn index >= 0 ? index : undefined;\n\t});\n\n\t/** The index of the active tab, falling back to the first tab. */\n\tprivate readonly _selectedIndex = computed(() => this._selectedItemIndex() ?? 0);\n\n\t/** Event emitted when the option is selected. */\n\tpublic readonly selectFocusedIndex = output<number>();\n\n\t/** Event emitted when a label is focused. */\n\tpublic readonly indexFocused = output<number>();\n\n\tprivate readonly _sharedResizeObserver = inject(SharedResizeObserver);\n\n\tprivate readonly _injector = inject(Injector);\n\n\tprotected _elementRef: ElementRef<HTMLElement> = inject(ElementRef);\n\tprotected _changeDetectorRef: ChangeDetectorRef = inject(ChangeDetectorRef);\n\tprivate readonly _viewportRuler: ViewportRuler = inject(ViewportRuler);\n\tprivate readonly _dir = inject(Directionality, { optional: true });\n\tprivate readonly _ngZone: NgZone = inject(NgZone);\n\tprivate readonly _platform: Platform = inject(Platform);\n\tpublic readonly animationMode = inject(ANIMATION_MODULE_TYPE, { optional: true });\n\n\tconstructor() {\n\t\t// Bind the `mouseleave` event on the outside since it doesn't change anything in the view.\n\t\tthis._ngZone.runOutsideAngular(() => {\n\t\t\tfromEvent(this._elementRef.nativeElement, 'mouseleave')\n\t\t\t\t.pipe(takeUntil(this._destroyed))\n\t\t\t\t.subscribe(() => {\n\t\t\t\t\tthis._stopInterval();\n\t\t\t\t});\n\t\t});\n\n\t\teffect(() => {\n\t\t\tconst selectedIndex = this._selectedItemIndex();\n\n\t\t\tif (selectedIndex !== undefined) {\n\t\t\t\tthis._selectedIndexChanged = true;\n\t\t\t\tthis._keyManager?.updateActiveItem(selectedIndex);\n\t\t\t}\n\t\t});\n\t}\n\n\t/** Called when the user has selected an item via the keyboard. */\n\tprotected abstract _itemSelected(event: KeyboardEvent): void;\n\n\tngAfterViewInit() {\n\t\t// We need to handle these events manually, because we want to bind passive event listeners.\n\t\tfromEvent(this.previousPaginator().nativeElement, 'touchstart', passiveEventListenerOptions)\n\t\t\t.pipe(takeUntil(this._destroyed))\n\t\t\t.subscribe(() => {\n\t\t\t\tthis._handlePaginatorPress('before');\n\t\t\t});\n\n\t\tfromEvent(this.nextPaginator().nativeElement, 'touchstart', passiveEventListenerOptions)\n\t\t\t.pipe(takeUntil(this._destroyed))\n\t\t\t.subscribe(() => {\n\t\t\t\tthis._handlePaginatorPress('after');\n\t\t\t});\n\t}\n\n\tngAfterContentInit() {\n\t\tconst dirChange = this._dir ? this._dir.change : observableOf('ltr');\n\t\t// We need to debounce resize events because the alignment logic is expensive.\n\t\t// If someone animates the width of tabs, we don't want to realign on every animation frame.\n\t\t// Once we haven't seen any more resize events in the last 32ms (~2 animation frames) we can\n\t\t// re-align.\n\t\tconst resize = this._sharedResizeObserver\n\t\t\t.observe(this._elementRef.nativeElement)\n\t\t\t.pipe(debounceTime(32), takeUntil(this._destroyed));\n\t\t// Note: We do not actually need to watch these events for proper functioning of the tabs,\n\t\t// the resize events above should capture any viewport resize that we care about. However,\n\t\t// removing this is fairly breaking for screenshot tests, so we're leaving it here for now.\n\t\tconst viewportResize = this._viewportRuler.change(150).pipe(takeUntil(this._destroyed));\n\n\t\tconst realign = () => {\n\t\t\tthis.updatePagination();\n\t\t};\n\n\t\tthis._keyManager = new FocusKeyManager<BrnPaginatedTabHeaderItem>(this.items, this._injector)\n\t\t\t.withHorizontalOrientation(this._getLayoutDirection())\n\t\t\t.withHomeAndEnd()\n\t\t\t.withWrap()\n\t\t\t// Allow focus to land on disabled tabs, as per https://w3c.github.io/aria-practices/#kbd_disabled_controls\n\t\t\t.skipPredicate(() => false);\n\n\t\tthis._keyManager.updateActiveItem(this._selectedIndex());\n\n\t\t// Note: We do not need to realign after the first render for proper functioning of the tabs\n\t\t// the resize events above should fire when we first start observing the element. However,\n\t\t// removing this is fairly breaking for screenshot tests, so we're leaving it here for now.\n\t\tafterNextRender(realign, { injector: this._injector });\n\n\t\t// On dir change or resize, realign the ink bar and update the orientation of\n\t\t// the key manager if the direction has changed.\n\t\tmerge(dirChange, viewportResize, resize, this.itemsChanges, this._itemsResized())\n\t\t\t.pipe(takeUntil(this._destroyed))\n\t\t\t.subscribe(() => {\n\t\t\t\t// We need to defer this to give the browser some time to recalculate\n\t\t\t\t// the element dimensions. The call has to be wrapped in `NgZone.run`,\n\t\t\t\t// because the viewport change handler runs outside of Angular.\n\t\t\t\tthis._ngZone.run(() => {\n\t\t\t\t\tPromise.resolve().then(() => {\n\t\t\t\t\t\t// Clamp the scroll distance, because it can change with the number of tabs.\n\t\t\t\t\t\tthis._scrollDistance = Math.max(0, Math.min(this._getMaxScrollDistance(), this._scrollDistance));\n\t\t\t\t\t\trealign();\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t\tthis._keyManager.withHorizontalOrientation(this._getLayoutDirection());\n\t\t\t});\n\n\t\t// If there is a change in the focus key manager we need to emit the `indexFocused`\n\t\t// event in order to provide a public event that notifies about focus changes. Also we realign\n\t\t// the tabs container by scrolling the new focused tab into the visible section.\n\t\tthis._keyManager.change.subscribe((newFocusIndex) => {\n\t\t\tthis.indexFocused.emit(newFocusIndex);\n\t\t\tthis._setTabFocus(newFocusIndex);\n\t\t});\n\t}\n\n\t/** Sends any changes that could affect the layout of the items. */\n\tprivate _itemsResized(): Observable<ResizeObserverEntry[]> {\n\t\tif (typeof ResizeObserver !== 'function') {\n\t\t\treturn EMPTY;\n\t\t}\n\n\t\treturn this.itemsChanges.pipe(\n\t\t\tstartWith(this.items()),\n\t\t\tswitchMap(\n\t\t\t\t(tabItems: ReadonlyArray<BrnPaginatedTabHeaderItem>) =>\n\t\t\t\t\tnew Observable((observer: Observer<ResizeObserverEntry[]>) =>\n\t\t\t\t\t\tthis._ngZone.runOutsideAngular(() => {\n\t\t\t\t\t\t\tconst resizeObserver = new ResizeObserver((entries) => observer.next(entries));\n\t\t\t\t\t\t\tfor (const tabItem of tabItems) {\n\t\t\t\t\t\t\t\tresizeObserver.observe(tabItem.elementRef.nativeElement);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\treturn () => {\n\t\t\t\t\t\t\t\tresizeObserver.disconnect();\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t}),\n\t\t\t\t\t),\n\t\t\t),\n\t\t\t// Skip the first emit since the resize observer emits when an item\n\t\t\t// is observed for new items when the tab is already inserted\n\t\t\tskip(1),\n\t\t\t// Skip emissions where all the elements are invisible since we don't want\n\t\t\t// the header to try and re-render with invalid measurements. See #25574.\n\t\t\tfilter((entries) => entries.some((e) => e.contentRect.width > 0 && e.contentRect.height > 0)),\n\t\t);\n\t}\n\n\tngAfterContentChecked(): void {\n\t\t// If the number of tab labels have changed, check if scrolling should be enabled\n\t\tif (this._tabLabelCount !== this.items().length) {\n\t\t\tthis.updatePagination();\n\t\t\tthis._tabLabelCount = this.items().length;\n\t\t\tthis._changeDetectorRef.markForCheck();\n\t\t}\n\n\t\t// If the selected index has changed, scroll to the label and check if the scrolling controls\n\t\t// should be disabled.\n\t\tif (this._selectedIndexChanged) {\n\t\t\tthis._scrollToLabel(this._selectedIndex());\n\t\t\tthis._checkScrollingControls();\n\t\t\tthis._selectedIndexChanged = false;\n\t\t\tthis._changeDetectorRef.markForCheck();\n\t\t}\n\n\t\t// If the scroll distance has been changed (tab selected, focused, scroll controls activated),\n\t\t// then translate the header to reflect this.\n\t\tif (this._scrollDistanceChanged) {\n\t\t\tthis._updateTabScrollPosition();\n\t\t\tthis._scrollDistanceChanged = false;\n\t\t\tthis._changeDetectorRef.markForCheck();\n\t\t}\n\t}\n\n\tngOnDestroy() {\n\t\tthis._keyManager?.destroy();\n\t\tthis._destroyed.next();\n\t\tthis._destroyed.complete();\n\t\tthis._stopScrolling.complete();\n\t}\n\n\t/** Handles keyboard events on the header. */\n\t_handleKeydown(event: KeyboardEvent) {\n\t\t// We don't handle any key bindings with a modifier key.\n\t\tif (hasModifierKey(event)) {\n\t\t\treturn;\n\t\t}\n\n\t\t// A programmatic selection (or any activation that bypasses the key manager) can move its\n\t\t// active item away from the trigger that owns focus. Start every key from the focused item.\n\t\tconst focusedItem = this.items().find((item) => item.elementRef.nativeElement === event.target);\n\t\tif (focusedItem) {\n\t\t\tthis._keyManager.updateActiveItem(focusedItem);\n\t\t}\n\n\t\tswitch (event.key) {\n\t\t\tcase 'Enter':\n\t\t\tcase ' ':\n\t\t\t\tif (this.focusIndex !== this._selectedItemIndex()) {\n\t\t\t\t\tconst item = this.items()[this.focusIndex];\n\n\t\t\t\t\tif (item && !item.disabled) {\n\t\t\t\t\t\tthis.selectFocusedIndex.emit(this.focusIndex);\n\t\t\t\t\t\tthis._itemSelected(event);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tthis._keyManager.onKeydown(event);\n\t\t}\n\t}\n\n\t/**\n\t * Callback for when the MutationObserver detects that the content has changed.\n\t */\n\t_onContentChanges() {\n\t\tconst textContent = this._elementRef.nativeElement.textContent;\n\n\t\t// We need to diff the text content of the header, because the MutationObserver callback\n\t\t// will fire even if the text content didn't change which is inefficient and is prone\n\t\t// to infinite loops if a poorly constructed expression is passed in (see #14249).\n\t\tif (textContent !== this._currentTextContent) {\n\t\t\tthis._currentTextContent = textContent || '';\n\n\t\t\t// The content observer runs outside the `NgZone` by default, which\n\t\t\t// means that we need to bring the callback back in ourselves.\n\t\t\tthis._ngZone.run(() => {\n\t\t\t\tthis.updatePagination();\n\t\t\t\tthis._changeDetectorRef.markForCheck();\n\t\t\t});\n\t\t}\n\t}\n\n\t/**\n\t * Updates the view whether pagination should be enabled or not.\n\t *\n\t * WARNING: Calling this method can be very costly in terms of performance. It should be called\n\t * as infrequently as possible from outside of the Tabs component as it causes a reflow of the\n\t * page.\n\t */\n\tupdatePagination() {\n\t\tthis._checkPaginationEnabled();\n\t\tthis._checkScrollingControls();\n\t\tthis._updateTabScrollPosition();\n\t}\n\n\t/** Tracks which element has focus; used for keyboard navigation */\n\tpublic get focusIndex(): number {\n\t\treturn this._keyManager ? (this._keyManager.activeItemIndex ?? 0) : 0;\n\t}\n\n\t/** When the focus index is set, we must manually send focus to the correct label */\n\tpublic set focusIndex(value: number) {\n\t\tif (!this._isValidIndex(value) || this.focusIndex === value || !this._keyManager) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._keyManager.setActiveItem(value);\n\t}\n\n\t/**\n\t * Determines if an index is valid. If the tabs are not ready yet, we assume that the user is\n\t * providing a valid index and return true.\n\t */\n\t_isValidIndex(index: number): boolean {\n\t\treturn this.items() ? !!this.items()[index] : true;\n\t}\n\n\t/**\n\t * Sets focus on the HTML element for the label wrapper and scrolls it into the view if\n\t * scrolling is enabled.\n\t */\n\t_setTabFocus(tabIndex: number) {\n\t\tif (this.showPaginationControls()) {\n\t\t\tthis._scrollToLabel(tabIndex);\n\t\t}\n\n\t\tif (this.items()?.length) {\n\t\t\tthis.items()[tabIndex].focus();\n\n\t\t\t// Do not let the browser manage scrolling to focus the element, this will be handled\n\t\t\t// by using translation. In LTR, the scroll left should be 0. In RTL, the scroll width\n\t\t\t// should be the full width minus the offset width.\n\t\t\tconst containerEl = this.tabListContainer().nativeElement;\n\t\t\tconst dir = this._getLayoutDirection();\n\n\t\t\tif (dir === 'ltr') {\n\t\t\t\tcontainerEl.scrollLeft = 0;\n\t\t\t} else {\n\t\t\t\tcontainerEl.scrollLeft = containerEl.scrollWidth - containerEl.offsetWidth;\n\t\t\t}\n\t\t}\n\t}\n\n\t/** The layout direction of the containing app. */\n\t_getLayoutDirection(): Direction {\n\t\treturn this._dir && this._dir.value === 'rtl' ? 'rtl' : 'ltr';\n\t}\n\n\t/** Performs the CSS transformation on the tab list that will cause the list to scroll. */\n\t_updateTabScrollPosition() {\n\t\tif (this.disablePagination()) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst scrollDistance = this.scrollDistance;\n\t\tconst translateX = this._getLayoutDirection() === 'ltr' ? -scrollDistance : scrollDistance;\n\n\t\t// Don't use `translate3d` here because we don't want to create a new layer. A new layer\n\t\t// seems to cause flickering and overflow in Internet Explorer. For example, the ink bar\n\t\t// and ripples will exceed the boundaries of the visible tab bar.\n\t\t// See: https://github.com/angular/components/issues/10276\n\t\t// We round the `transform` here, because transforms with sub-pixel precision cause some\n\t\t// browsers to blur the content of the element.\n\t\tthis.tabList().nativeElement.style.transform = `translateX(${Math.round(translateX)}px)`;\n\n\t\t// Setting the `transform` on IE will change the scroll offset of the parent, causing the\n\t\t// position to be thrown off in some cases. We have to reset it ourselves to ensure that\n\t\t// it doesn't get thrown off. Note that we scope it only to IE and Edge, because messing\n\t\t// with the scroll position throws off Chrome 71+ in RTL mode (see #14689).\n\t\tif (this._platform.TRIDENT || this._platform.EDGE) {\n\t\t\tthis.tabListContainer().nativeElement.scrollLeft = 0;\n\t\t}\n\t}\n\n\t/** Sets the distance in pixels that the tab header should be transformed in the X-axis. */\n\tpublic get scrollDistance(): number {\n\t\treturn this._scrollDistance;\n\t}\n\tpublic set scrollDistance(value: number) {\n\t\tthis._scrollTo(value);\n\t}\n\n\t/**\n\t * Moves the tab list in the 'before' or 'after' direction (towards the beginning of the list or\n\t * the end of the list, respectively). The distance to scroll is computed to be a third of the\n\t * length of the tab list view window.\n\t *\n\t * This is an expensive call that forces a layout reflow to compute box and scroll metrics and\n\t * should be called sparingly.\n\t */\n\t_scrollHeader(direction: ScrollDirection) {\n\t\tconst viewLength = this.tabListContainer().nativeElement.offsetWidth;\n\n\t\t// Move the scroll distance one-third the length of the tab list's viewport.\n\t\tconst scrollAmount = ((direction === 'before' ? -1 : 1) * viewLength) / 3;\n\n\t\treturn this._scrollTo(this._scrollDistance + scrollAmount);\n\t}\n\n\t/** Handles click events on the pagination arrows. */\n\t_handlePaginatorClick(direction: ScrollDirection) {\n\t\tthis._stopInterval();\n\t\tthis._scrollHeader(direction);\n\t}\n\n\t/**\n\t * Moves the tab list such that the desired tab label (marked by index) is moved into view.\n\t *\n\t * This is an expensive call that forces a layout reflow to compute box and scroll metrics and\n\t * should be called sparingly.\n\t */\n\t_scrollToLabel(labelIndex: number) {\n\t\tif (this.disablePagination()) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst selectedLabel = this.items() ? this.items()[labelIndex] : null;\n\n\t\tif (!selectedLabel) {\n\t\t\treturn;\n\t\t}\n\n\t\t// The view length is the visible width of the tab labels.\n\t\tconst viewLength = this.tabListContainer().nativeElement.offsetWidth;\n\t\tconst { offsetLeft, offsetWidth } = selectedLabel.elementRef.nativeElement;\n\n\t\tlet labelBeforePos: number;\n\t\tlet labelAfterPos: number;\n\t\tif (this._getLayoutDirection() === 'ltr') {\n\t\t\tlabelBeforePos = offsetLeft;\n\t\t\tlabelAfterPos = labelBeforePos + offsetWidth;\n\t\t} else {\n\t\t\tlabelAfterPos = this.tabListInner().nativeElement.offsetWidth - offsetLeft;\n\t\t\tlabelBeforePos = labelAfterPos - offsetWidth;\n\t\t}\n\n\t\tconst beforeVisiblePos = this.scrollDistance;\n\t\tconst afterVisiblePos = this.scrollDistance + viewLength;\n\n\t\tif (labelBeforePos < beforeVisiblePos) {\n\t\t\t// Scroll header to move label to the before direction\n\t\t\tthis.scrollDistance -= beforeVisiblePos - labelBeforePos;\n\t\t} else if (labelAfterPos > afterVisiblePos) {\n\t\t\t// Scroll header to move label to the after direction\n\t\t\tthis.scrollDistance += Math.min(labelAfterPos - afterVisiblePos, labelBeforePos - beforeVisiblePos);\n\t\t}\n\t}\n\n\t/**\n\t * Evaluate whether the pagination controls should be displayed. If the scroll width of the\n\t * tab list is wider than the size of the header container, then the pagination controls should\n\t * be shown.\n\t *\n\t * This is an expensive call that forces a layout reflow to compute box and scroll metrics and\n\t * should be called sparingly.\n\t */\n\t_checkPaginationEnabled() {\n\t\tif (this.disablePagination()) {\n\t\t\tthis.showPaginationControls.set(false);\n\t\t} else {\n\t\t\tconst isEnabled = this.tabListInner().nativeElement.scrollWidth > this._elementRef.nativeElement.offsetWidth;\n\n\t\t\tif (!isEnabled) {\n\t\t\t\tthis.scrollDistance = 0;\n\t\t\t}\n\n\t\t\tif (isEnabled !== this.showPaginationControls()) {\n\t\t\t\tthis._changeDetectorRef.markForCheck();\n\t\t\t}\n\n\t\t\tthis.showPaginationControls.set(isEnabled);\n\t\t}\n\t}\n\n\t/**\n\t * Evaluate whether the before and after controls should be enabled or disabled.\n\t * If the header is at the beginning of the list (scroll distance is equal to 0) then disable the\n\t * before button. If the header is at the end of the list (scroll distance is equal to the\n\t * maximum distance we can scroll), then disable the after button.\n\t *\n\t * This is an expensive call that forces a layout reflow to compute box and scroll metrics and\n\t * should be called sparingly.\n\t */\n\t_checkScrollingControls() {\n\t\tif (this.disablePagination()) {\n\t\t\tthis.disableScrollAfter = this.disableScrollBefore = true;\n\t\t} else {\n\t\t\t// Check if the pagination arrows should be activated.\n\t\t\tthis.disableScrollBefore = this.scrollDistance === 0;\n\t\t\tthis.disableScrollAfter = this.scrollDistance === this._getMaxScrollDistance();\n\t\t\tthis._changeDetectorRef.markForCheck();\n\t\t}\n\t}\n\n\t/**\n\t * Determines what is the maximum length in pixels that can be set for the scroll distance. This\n\t * is equal to the difference in width between the tab list container and tab header container.\n\t *\n\t * This is an expensive call that forces a layout reflow to compute box and scroll metrics and\n\t * should be called sparingly.\n\t */\n\t_getMaxScrollDistance(): number {\n\t\tconst lengthOfTabList = this.tabListInner().nativeElement.scrollWidth;\n\t\tconst viewLength = this.tabListContainer().nativeElement.offsetWidth;\n\t\treturn lengthOfTabList - viewLength || 0;\n\t}\n\n\t/** Stops the currently-running paginator interval. */\n\t_stopInterval() {\n\t\tthis._stopScrolling.next();\n\t}\n\n\t/**\n\t * Handles the user pressing down on one of the paginators.\n\t * Starts scrolling the header after a certain amount of time.\n\t * @param direction In which direction the paginator should be scrolled.\n\t */\n\t_handlePaginatorPress(direction: ScrollDirection, mouseEvent?: MouseEvent) {\n\t\t// Don't start auto scrolling for right mouse button clicks. Note that we shouldn't have to\n\t\t// null check the `button`, but we do it so we don't break tests that use fake events.\n\t\tif (mouseEvent && mouseEvent.button !== null && mouseEvent.button !== 0) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Avoid overlapping timers.\n\t\tthis._stopInterval();\n\n\t\t// Start a timer after the delay and keep firing based on the interval.\n\t\ttimer(HEADER_SCROLL_DELAY, HEADER_SCROLL_INTERVAL)\n\t\t\t// Keep the timer going until something tells it to stop or the component is destroyed.\n\t\t\t.pipe(takeUntil(merge(this._stopScrolling, this._destroyed)))\n\t\t\t.subscribe(() => {\n\t\t\t\tconst { maxScrollDistance, distance } = this._scrollHeader(direction);\n\n\t\t\t\t// Stop the timer if we've reached the start or the end.\n\t\t\t\tif (distance === 0 || distance >= maxScrollDistance) {\n\t\t\t\t\tthis._stopInterval();\n\t\t\t\t}\n\t\t\t});\n\t}\n\n\t/**\n\t * Scrolls the header to a given position.\n\t * @param position Position to which to scroll.\n\t * @returns Information on the current scroll distance and the maximum.\n\t */\n\tprivate _scrollTo(position: number) {\n\t\tif (this.disablePagination()) {\n\t\t\treturn { maxScrollDistance: 0, distance: 0 };\n\t\t}\n\n\t\tconst maxScrollDistance = this._getMaxScrollDistance();\n\t\tthis._scrollDistance = Math.max(0, Math.min(maxScrollDistance, position));\n\n\t\t// Mark that the scroll distance has changed so that after the view is checked, the CSS\n\t\t// transformation can move the header.\n\t\tthis._scrollDistanceChanged = true;\n\t\tthis._checkScrollingControls();\n\n\t\treturn { maxScrollDistance, distance: this._scrollDistance };\n\t}\n}\n","import { BrnTabs } from './lib/brn-tabs';\nimport { BrnTabsContent } from './lib/brn-tabs-content';\nimport { BrnTabsContentLazy } from './lib/brn-tabs-content-lazy';\nimport { BrnTabsList } from './lib/brn-tabs-list';\nimport { BrnTabsTrigger } from './lib/brn-tabs-trigger';\n\nexport * from './lib/brn-tabs';\nexport * from './lib/brn-tabs-content';\nexport * from './lib/brn-tabs-content-lazy';\nexport * from './lib/brn-tabs-list';\nexport * from './lib/brn-tabs-paginated-list';\nexport * from './lib/brn-tabs-trigger';\n\nexport const BrnTabsImports = [BrnTabs, BrnTabsList, BrnTabsTrigger, BrnTabsContent, BrnTabsContentLazy] as const;\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["observableOf"],"mappings":";;;;;;;;;;;MAkBa,OAAO,CAAA;AACF,IAAA,IAAI,GAAG,MAAM,CAAC,cAAc,CAAC;AAE9B,IAAA,WAAW,GAAG,KAAK,CAAqB,YAAY,kFAAC;;AAE9D,IAAA,YAAY,GAAG,I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AAA,EAAA,OAAA,EAAA,EAAA,kBAAA,EAAA,oBAAA,EAAA,YAAA,EAAA,cAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA;;4FAApB,oBAAoB,EAAA,UAAA,EAAA,CAAA;kBADzC;;;AChEM,MAAM,cAAc,GAAG,CAAC,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,cAAc,EAAE,kBAAkB;;ACbvG;;AAEG;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spartan-ng/brain",
3
- "version": "1.8.1-beta.2",
3
+ "version": "1.8.1",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/spartan-ng/spartan.git"
@@ -92,13 +92,12 @@ declare class BrnTabsList implements AfterContentInit {
92
92
  private readonly _root;
93
93
  protected readonly _orientation: _angular_core.InputSignal<_spartan_ng_brain_tabs.BrnTabsOrientation>;
94
94
  private readonly _direction;
95
- private readonly _activeTab;
96
- private readonly _tabs;
97
- private readonly _elementRef;
98
- private readonly _keyDownListener;
95
+ private readonly _injector;
99
96
  private _keyManager?;
100
97
  readonly triggers: _angular_core.Signal<readonly BrnTabsTrigger[]>;
101
98
  ngAfterContentInit(): void;
99
+ protected _onFocusIn(event: FocusEvent): void;
100
+ protected _onKeydown(event: KeyboardEvent): void;
102
101
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<BrnTabsList, never>;
103
102
  static ɵdir: _angular_core.ɵɵDirectiveDeclaration<BrnTabsList, "[brnTabsList]", ["brnTabsList"], {}, {}, ["triggers"], never, true, never>;
104
103
  }
@@ -158,7 +157,9 @@ declare abstract class BrnTabsPaginatedList implements AfterContentChecked, Afte
158
157
  * layout recalculations if it's known that pagination won't be required.
159
158
  */
160
159
  readonly disablePagination: _angular_core.InputSignalWithTransform<boolean, BooleanInput>;
161
- /** The index of the active tab. */
160
+ /** Index of the active tab among this list's items, or undefined when there isn't one. */
161
+ private readonly _selectedItemIndex;
162
+ /** The index of the active tab, falling back to the first tab. */
162
163
  private readonly _selectedIndex;
163
164
  /** Event emitted when the option is selected. */
164
165
  readonly selectFocusedIndex: _angular_core.OutputEmitterRef<number>;