@angular/cdk-experimental 20.2.7 → 20.2.9

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 +1 @@
1
- {"version":3,"file":"tabs.mjs","sources":["../../../../../k8-fastbuild-ST-199a4f3c4e20/bin/src/cdk-experimental/tabs/tabs.ts"],"sourcesContent":["/**\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.dev/license\n */\n\nimport {DeferredContent, DeferredContentAware} from '@angular/cdk-experimental/deferred-content';\nimport {_IdGenerator} from '@angular/cdk/a11y';\nimport {Directionality} from '@angular/cdk/bidi';\nimport {\n booleanAttribute,\n computed,\n Directive,\n ElementRef,\n inject,\n input,\n model,\n linkedSignal,\n signal,\n Signal,\n afterRenderEffect,\n OnInit,\n OnDestroy,\n} from '@angular/core';\nimport {TabListPattern, TabPanelPattern, TabPattern} from '../ui-patterns';\n\ninterface HasElement {\n element: Signal<HTMLElement>;\n}\n\n/**\n * Sort directives by their document order.\n */\nfunction sortDirectives(a: HasElement, b: HasElement) {\n return (a.element().compareDocumentPosition(b.element()) & Node.DOCUMENT_POSITION_PRECEDING) > 0\n ? 1\n : -1;\n}\n\n/**\n * A Tabs container.\n *\n * Represents a set of layered sections of content. The CdkTabs is a container meant to be used with\n * CdkTabList, CdkTab, and CdkTabPanel as follows:\n *\n * ```html\n * <div cdkTabs>\n * <ul cdkTabList>\n * <li cdkTab value=\"tab1\">Tab 1</li>\n * <li cdkTab value=\"tab2\">Tab 2</li>\n * <li cdkTab value=\"tab3\">Tab 3</li>\n * </ul>\n *\n * <div cdkTabPanel value=\"tab1\">\n * <ng-template cdkTabContent>Tab content 1</ng-template>\n * </div>\n * <div cdkTabPanel value=\"tab2\">\n * <ng-template cdkTabContent>Tab content 2</ng-template>\n * </div>\n * <div cdkTabPanel value=\"tab3\">\n * <ng-template cdkTabContent>Tab content 3</ng-template>\n * </div>\n * ```\n */\n@Directive({\n selector: '[cdkTabs]',\n exportAs: 'cdkTabs',\n host: {\n 'class': 'cdk-tabs',\n },\n})\nexport class CdkTabs {\n /** The CdkTabList nested inside of the container. */\n private readonly _tablist = signal<CdkTabList | undefined>(undefined);\n\n /** The CdkTabPanels nested inside of the container. */\n private readonly _unorderedPanels = signal(new Set<CdkTabPanel>());\n\n /** The Tab UIPattern of the child Tabs. */\n tabs = computed(() => this._tablist()?.tabs());\n\n /** The TabPanel UIPattern of the child TabPanels. */\n unorderedTabpanels = computed(() =>\n [...this._unorderedPanels()].map(tabpanel => tabpanel.pattern),\n );\n\n register(child: CdkTabList | CdkTabPanel) {\n if (child instanceof CdkTabList) {\n this._tablist.set(child);\n }\n\n if (child instanceof CdkTabPanel) {\n this._unorderedPanels().add(child);\n this._unorderedPanels.set(new Set(this._unorderedPanels()));\n }\n }\n\n deregister(child: CdkTabList | CdkTabPanel) {\n if (child instanceof CdkTabList) {\n this._tablist.set(undefined);\n }\n\n if (child instanceof CdkTabPanel) {\n this._unorderedPanels().delete(child);\n this._unorderedPanels.set(new Set(this._unorderedPanels()));\n }\n }\n}\n\n/**\n * A TabList container.\n *\n * Controls a list of CdkTab(s).\n */\n@Directive({\n selector: '[cdkTabList]',\n exportAs: 'cdkTabList',\n host: {\n 'role': 'tablist',\n 'class': 'cdk-tablist',\n '[attr.tabindex]': 'pattern.tabindex()',\n '[attr.aria-disabled]': 'pattern.disabled()',\n '[attr.aria-orientation]': 'pattern.orientation()',\n '[attr.aria-activedescendant]': 'pattern.activedescendant()',\n '(keydown)': 'pattern.onKeydown($event)',\n '(pointerdown)': 'pattern.onPointerdown($event)',\n '(focusin)': 'onFocus()',\n },\n})\nexport class CdkTabList implements OnInit, OnDestroy {\n /** The parent CdkTabs. */\n private readonly _cdkTabs = inject(CdkTabs);\n\n /** The CdkTabs nested inside of the CdkTabList. */\n private readonly _unorderedTabs = signal(new Set<CdkTab>());\n\n /** The internal tab selection state. */\n private readonly _selection = linkedSignal(() => (this.tab() ? [this.tab()!] : []));\n\n /** Text direction. */\n readonly textDirection = inject(Directionality).valueSignal;\n\n /** The Tab UIPatterns of the child Tabs. */\n readonly tabs = computed(() =>\n [...this._unorderedTabs()].sort(sortDirectives).map(tab => tab.pattern),\n );\n\n /** Whether the tablist is vertically or horizontally oriented. */\n readonly orientation = input<'vertical' | 'horizontal'>('horizontal');\n\n /** Whether focus should wrap when navigating. */\n readonly wrap = input(true, {transform: booleanAttribute});\n\n /** Whether disabled items in the list should be skipped when navigating. */\n readonly skipDisabled = input(true, {transform: booleanAttribute});\n\n /** The focus strategy used by the tablist. */\n readonly focusMode = input<'roving' | 'activedescendant'>('roving');\n\n /** The selection strategy used by the tablist. */\n readonly selectionMode = input<'follow' | 'explicit'>('follow');\n\n /** Whether the tablist is disabled. */\n readonly disabled = input(false, {transform: booleanAttribute});\n\n /** The current selected tab. */\n readonly tab = model<string | undefined>();\n\n /** The TabList UIPattern. */\n readonly pattern: TabListPattern = new TabListPattern({\n ...this,\n items: this.tabs,\n value: this._selection,\n activeItem: signal(undefined),\n });\n\n /** Whether the tree has received focus yet. */\n private _hasFocused = signal(false);\n\n constructor() {\n afterRenderEffect(() => this.tab.set(this._selection()[0]));\n\n afterRenderEffect(() => {\n if (!this._hasFocused()) {\n this.pattern.setDefaultState();\n }\n });\n }\n\n onFocus() {\n this._hasFocused.set(true);\n }\n\n ngOnInit() {\n this._cdkTabs.register(this);\n }\n\n ngOnDestroy() {\n this._cdkTabs.deregister(this);\n }\n\n register(child: CdkTab) {\n this._unorderedTabs().add(child);\n this._unorderedTabs.set(new Set(this._unorderedTabs()));\n }\n\n deregister(child: CdkTab) {\n this._unorderedTabs().delete(child);\n this._unorderedTabs.set(new Set(this._unorderedTabs()));\n }\n}\n\n/** A selectable tab in a TabList. */\n@Directive({\n selector: '[cdkTab]',\n exportAs: 'cdkTab',\n host: {\n 'role': 'tab',\n 'class': 'cdk-tab',\n '[class.cdk-active]': 'pattern.active()',\n '[attr.id]': 'pattern.id()',\n '[attr.tabindex]': 'pattern.tabindex()',\n '[attr.aria-selected]': 'pattern.selected()',\n '[attr.aria-disabled]': 'pattern.disabled()',\n '[attr.aria-controls]': 'pattern.controls()',\n },\n})\nexport class CdkTab implements HasElement, OnInit, OnDestroy {\n /** A reference to the tab element. */\n private readonly _elementRef = inject(ElementRef);\n\n /** The parent CdkTabs. */\n private readonly _cdkTabs = inject(CdkTabs);\n\n /** The parent CdkTabList. */\n private readonly _cdkTabList = inject(CdkTabList);\n\n /** A global unique identifier for the tab. */\n private readonly _id = inject(_IdGenerator).getId('cdk-tab-');\n\n /** The host native element. */\n readonly element = computed(() => this._elementRef.nativeElement);\n\n /** The parent TabList UIPattern. */\n readonly tablist = computed(() => this._cdkTabList.pattern);\n\n /** The TabPanel UIPattern associated with the tab */\n readonly tabpanel = computed(() =>\n this._cdkTabs.unorderedTabpanels().find(tabpanel => tabpanel.value() === this.value()),\n );\n\n /** Whether a tab is disabled. */\n readonly disabled = input(false, {transform: booleanAttribute});\n\n /** A local unique identifier for the tab. */\n readonly value = input.required<string>();\n\n /** The Tab UIPattern. */\n readonly pattern: TabPattern = new TabPattern({\n ...this,\n id: () => this._id,\n tablist: this.tablist,\n tabpanel: this.tabpanel,\n value: this.value,\n });\n\n ngOnInit() {\n this._cdkTabList.register(this);\n }\n\n ngOnDestroy() {\n this._cdkTabList.deregister(this);\n }\n}\n\n/**\n * A TabPanel container for the resources of layered content associated with a tab.\n *\n * If a tabpanel is hidden due to its corresponding tab is not activated, the `inert` attribute\n * will be applied to the tabpanel element to remove it from the accessibility tree and stop\n * all the keyboard and pointer interactions. Note that this does not visually hide the tabpenl\n * and a proper styling is required.\n */\n@Directive({\n selector: '[cdkTabPanel]',\n exportAs: 'cdkTabPanel',\n host: {\n 'role': 'tabpanel',\n 'class': 'cdk-tabpanel',\n '[attr.id]': 'pattern.id()',\n '[attr.tabindex]': 'pattern.tabindex()',\n '[attr.inert]': 'pattern.hidden() ? true : null',\n '[attr.aria-labelledby]': 'pattern.labelledBy()',\n },\n hostDirectives: [\n {\n directive: DeferredContentAware,\n inputs: ['preserveContent'],\n },\n ],\n})\nexport class CdkTabPanel implements OnInit, OnDestroy {\n /** The DeferredContentAware host directive. */\n private readonly _deferredContentAware = inject(DeferredContentAware);\n\n /** The parent CdkTabs. */\n private readonly _cdkTabs = inject(CdkTabs);\n\n /** A global unique identifier for the tab. */\n private readonly _id = inject(_IdGenerator).getId('cdk-tabpanel-');\n\n /** The Tab UIPattern associated with the tabpanel */\n readonly tab = computed(() => this._cdkTabs.tabs()?.find(tab => tab.value() === this.value()));\n\n /** A local unique identifier for the tabpanel. */\n readonly value = input.required<string>();\n\n /** The TabPanel UIPattern. */\n readonly pattern: TabPanelPattern = new TabPanelPattern({\n ...this,\n id: () => this._id,\n tab: this.tab,\n });\n\n constructor() {\n afterRenderEffect(() => this._deferredContentAware.contentVisible.set(!this.pattern.hidden()));\n }\n\n ngOnInit() {\n this._cdkTabs.register(this);\n }\n\n ngOnDestroy() {\n this._cdkTabs.deregister(this);\n }\n}\n\n/**\n * A TabContent container for the lazy-loaded content.\n */\n@Directive({\n selector: 'ng-template[cdkTabContent]',\n exportAs: 'cdTabContent',\n hostDirectives: [DeferredContent],\n})\nexport class CdkTabContent {}\n"],"names":[],"mappings":";;;;;;;;;;;AAgCA;;AAEG;AACH,SAAS,cAAc,CAAC,CAAa,EAAE,CAAa,EAAA;AAClD,IAAA,OAAO,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC,uBAAuB,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC,GAAG,IAAI,CAAC,2BAA2B,IAAI;AAC7F,UAAE;UACA,CAAC,CAAC;AACR;AAEA;;;;;;;;;;;;;;;;;;;;;;;;AAwBG;MAQU,OAAO,CAAA;;AAED,IAAA,QAAQ,GAAG,MAAM,CAAyB,SAAS,oDAAC;;AAGpD,IAAA,gBAAgB,GAAG,MAAM,CAAC,IAAI,GAAG,EAAe,4DAAC;;AAGlE,I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A,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;kGAAb,aAAa,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,4BAAA,EAAA,QAAA,EAAA,CAAA,cAAA,CAAA,EAAA,cAAA,EAAA,CAAA,EAAA,SAAA,EAAA,EAAA,CAAA,eAAA,EAAA,CAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA;;kGAAb,aAAa,EAAA,UAAA,EAAA,CAAA;kBALzB,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,4BAA4B;AACtC,oBAAA,QAAQ,EAAE,cAAc;oBACxB,cAAc,EAAE,CAAC,eAAe,CAAC;AAClC,iBAAA;;;;;"}
1
+ {"version":3,"file":"tabs.mjs","sources":["../../../../../darwin_arm64-fastbuild-ST-199a4f3c4e20/bin/src/cdk-experimental/tabs/tabs.ts"],"sourcesContent":["/**\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.dev/license\n */\n\nimport {DeferredContent, DeferredContentAware} from '@angular/cdk-experimental/deferred-content';\nimport {_IdGenerator} from '@angular/cdk/a11y';\nimport {Directionality} from '@angular/cdk/bidi';\nimport {\n booleanAttribute,\n computed,\n Directive,\n ElementRef,\n inject,\n input,\n model,\n linkedSignal,\n signal,\n Signal,\n afterRenderEffect,\n OnInit,\n OnDestroy,\n} from '@angular/core';\nimport {TabListPattern, TabPanelPattern, TabPattern} from '../ui-patterns';\n\ninterface HasElement {\n element: Signal<HTMLElement>;\n}\n\n/**\n * Sort directives by their document order.\n */\nfunction sortDirectives(a: HasElement, b: HasElement) {\n return (a.element().compareDocumentPosition(b.element()) & Node.DOCUMENT_POSITION_PRECEDING) > 0\n ? 1\n : -1;\n}\n\n/**\n * A Tabs container.\n *\n * Represents a set of layered sections of content. The CdkTabs is a container meant to be used with\n * CdkTabList, CdkTab, and CdkTabPanel as follows:\n *\n * ```html\n * <div cdkTabs>\n * <ul cdkTabList>\n * <li cdkTab value=\"tab1\">Tab 1</li>\n * <li cdkTab value=\"tab2\">Tab 2</li>\n * <li cdkTab value=\"tab3\">Tab 3</li>\n * </ul>\n *\n * <div cdkTabPanel value=\"tab1\">\n * <ng-template cdkTabContent>Tab content 1</ng-template>\n * </div>\n * <div cdkTabPanel value=\"tab2\">\n * <ng-template cdkTabContent>Tab content 2</ng-template>\n * </div>\n * <div cdkTabPanel value=\"tab3\">\n * <ng-template cdkTabContent>Tab content 3</ng-template>\n * </div>\n * ```\n */\n@Directive({\n selector: '[cdkTabs]',\n exportAs: 'cdkTabs',\n host: {\n 'class': 'cdk-tabs',\n },\n})\nexport class CdkTabs {\n /** The CdkTabList nested inside of the container. */\n private readonly _tablist = signal<CdkTabList | undefined>(undefined);\n\n /** The CdkTabPanels nested inside of the container. */\n private readonly _unorderedPanels = signal(new Set<CdkTabPanel>());\n\n /** The Tab UIPattern of the child Tabs. */\n tabs = computed(() => this._tablist()?.tabs());\n\n /** The TabPanel UIPattern of the child TabPanels. */\n unorderedTabpanels = computed(() =>\n [...this._unorderedPanels()].map(tabpanel => tabpanel.pattern),\n );\n\n register(child: CdkTabList | CdkTabPanel) {\n if (child instanceof CdkTabList) {\n this._tablist.set(child);\n }\n\n if (child instanceof CdkTabPanel) {\n this._unorderedPanels().add(child);\n this._unorderedPanels.set(new Set(this._unorderedPanels()));\n }\n }\n\n deregister(child: CdkTabList | CdkTabPanel) {\n if (child instanceof CdkTabList) {\n this._tablist.set(undefined);\n }\n\n if (child instanceof CdkTabPanel) {\n this._unorderedPanels().delete(child);\n this._unorderedPanels.set(new Set(this._unorderedPanels()));\n }\n }\n}\n\n/**\n * A TabList container.\n *\n * Controls a list of CdkTab(s).\n */\n@Directive({\n selector: '[cdkTabList]',\n exportAs: 'cdkTabList',\n host: {\n 'role': 'tablist',\n 'class': 'cdk-tablist',\n '[attr.tabindex]': 'pattern.tabindex()',\n '[attr.aria-disabled]': 'pattern.disabled()',\n '[attr.aria-orientation]': 'pattern.orientation()',\n '[attr.aria-activedescendant]': 'pattern.activedescendant()',\n '(keydown)': 'pattern.onKeydown($event)',\n '(pointerdown)': 'pattern.onPointerdown($event)',\n '(focusin)': 'onFocus()',\n },\n})\nexport class CdkTabList implements OnInit, OnDestroy {\n /** The parent CdkTabs. */\n private readonly _cdkTabs = inject(CdkTabs);\n\n /** The CdkTabs nested inside of the CdkTabList. */\n private readonly _unorderedTabs = signal(new Set<CdkTab>());\n\n /** The internal tab selection state. */\n private readonly _selection = linkedSignal(() => (this.tab() ? [this.tab()!] : []));\n\n /** Text direction. */\n readonly textDirection = inject(Directionality).valueSignal;\n\n /** The Tab UIPatterns of the child Tabs. */\n readonly tabs = computed(() =>\n [...this._unorderedTabs()].sort(sortDirectives).map(tab => tab.pattern),\n );\n\n /** Whether the tablist is vertically or horizontally oriented. */\n readonly orientation = input<'vertical' | 'horizontal'>('horizontal');\n\n /** Whether focus should wrap when navigating. */\n readonly wrap = input(true, {transform: booleanAttribute});\n\n /** Whether disabled items in the list should be skipped when navigating. */\n readonly skipDisabled = input(true, {transform: booleanAttribute});\n\n /** The focus strategy used by the tablist. */\n readonly focusMode = input<'roving' | 'activedescendant'>('roving');\n\n /** The selection strategy used by the tablist. */\n readonly selectionMode = input<'follow' | 'explicit'>('follow');\n\n /** Whether the tablist is disabled. */\n readonly disabled = input(false, {transform: booleanAttribute});\n\n /** The current selected tab. */\n readonly tab = model<string | undefined>();\n\n /** The TabList UIPattern. */\n readonly pattern: TabListPattern = new TabListPattern({\n ...this,\n items: this.tabs,\n value: this._selection,\n activeItem: signal(undefined),\n });\n\n /** Whether the tree has received focus yet. */\n private _hasFocused = signal(false);\n\n constructor() {\n afterRenderEffect(() => this.tab.set(this._selection()[0]));\n\n afterRenderEffect(() => {\n if (!this._hasFocused()) {\n this.pattern.setDefaultState();\n }\n });\n }\n\n onFocus() {\n this._hasFocused.set(true);\n }\n\n ngOnInit() {\n this._cdkTabs.register(this);\n }\n\n ngOnDestroy() {\n this._cdkTabs.deregister(this);\n }\n\n register(child: CdkTab) {\n this._unorderedTabs().add(child);\n this._unorderedTabs.set(new Set(this._unorderedTabs()));\n }\n\n deregister(child: CdkTab) {\n this._unorderedTabs().delete(child);\n this._unorderedTabs.set(new Set(this._unorderedTabs()));\n }\n}\n\n/** A selectable tab in a TabList. */\n@Directive({\n selector: '[cdkTab]',\n exportAs: 'cdkTab',\n host: {\n 'role': 'tab',\n 'class': 'cdk-tab',\n '[class.cdk-active]': 'pattern.active()',\n '[attr.id]': 'pattern.id()',\n '[attr.tabindex]': 'pattern.tabindex()',\n '[attr.aria-selected]': 'pattern.selected()',\n '[attr.aria-disabled]': 'pattern.disabled()',\n '[attr.aria-controls]': 'pattern.controls()',\n },\n})\nexport class CdkTab implements HasElement, OnInit, OnDestroy {\n /** A reference to the tab element. */\n private readonly _elementRef = inject(ElementRef);\n\n /** The parent CdkTabs. */\n private readonly _cdkTabs = inject(CdkTabs);\n\n /** The parent CdkTabList. */\n private readonly _cdkTabList = inject(CdkTabList);\n\n /** A global unique identifier for the tab. */\n private readonly _id = inject(_IdGenerator).getId('cdk-tab-');\n\n /** The host native element. */\n readonly element = computed(() => this._elementRef.nativeElement);\n\n /** The parent TabList UIPattern. */\n readonly tablist = computed(() => this._cdkTabList.pattern);\n\n /** The TabPanel UIPattern associated with the tab */\n readonly tabpanel = computed(() =>\n this._cdkTabs.unorderedTabpanels().find(tabpanel => tabpanel.value() === this.value()),\n );\n\n /** Whether a tab is disabled. */\n readonly disabled = input(false, {transform: booleanAttribute});\n\n /** A local unique identifier for the tab. */\n readonly value = input.required<string>();\n\n /** The Tab UIPattern. */\n readonly pattern: TabPattern = new TabPattern({\n ...this,\n id: () => this._id,\n tablist: this.tablist,\n tabpanel: this.tabpanel,\n value: this.value,\n });\n\n ngOnInit() {\n this._cdkTabList.register(this);\n }\n\n ngOnDestroy() {\n this._cdkTabList.deregister(this);\n }\n}\n\n/**\n * A TabPanel container for the resources of layered content associated with a tab.\n *\n * If a tabpanel is hidden due to its corresponding tab is not activated, the `inert` attribute\n * will be applied to the tabpanel element to remove it from the accessibility tree and stop\n * all the keyboard and pointer interactions. Note that this does not visually hide the tabpenl\n * and a proper styling is required.\n */\n@Directive({\n selector: '[cdkTabPanel]',\n exportAs: 'cdkTabPanel',\n host: {\n 'role': 'tabpanel',\n 'class': 'cdk-tabpanel',\n '[attr.id]': 'pattern.id()',\n '[attr.tabindex]': 'pattern.tabindex()',\n '[attr.inert]': 'pattern.hidden() ? true : null',\n '[attr.aria-labelledby]': 'pattern.labelledBy()',\n },\n hostDirectives: [\n {\n directive: DeferredContentAware,\n inputs: ['preserveContent'],\n },\n ],\n})\nexport class CdkTabPanel implements OnInit, OnDestroy {\n /** The DeferredContentAware host directive. */\n private readonly _deferredContentAware = inject(DeferredContentAware);\n\n /** The parent CdkTabs. */\n private readonly _cdkTabs = inject(CdkTabs);\n\n /** A global unique identifier for the tab. */\n private readonly _id = inject(_IdGenerator).getId('cdk-tabpanel-');\n\n /** The Tab UIPattern associated with the tabpanel */\n readonly tab = computed(() => this._cdkTabs.tabs()?.find(tab => tab.value() === this.value()));\n\n /** A local unique identifier for the tabpanel. */\n readonly value = input.required<string>();\n\n /** The TabPanel UIPattern. */\n readonly pattern: TabPanelPattern = new TabPanelPattern({\n ...this,\n id: () => this._id,\n tab: this.tab,\n });\n\n constructor() {\n afterRenderEffect(() => this._deferredContentAware.contentVisible.set(!this.pattern.hidden()));\n }\n\n ngOnInit() {\n this._cdkTabs.register(this);\n }\n\n ngOnDestroy() {\n this._cdkTabs.deregister(this);\n }\n}\n\n/**\n * A TabContent container for the lazy-loaded content.\n */\n@Directive({\n selector: 'ng-template[cdkTabContent]',\n exportAs: 'cdTabContent',\n hostDirectives: [DeferredContent],\n})\nexport class CdkTabContent {}\n"],"names":[],"mappings":";;;;;;;;;;;AAgCA;;AAEG;AACH,SAAS,cAAc,CAAC,CAAa,EAAE,CAAa,EAA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WAAW,EAAE,cAAc;AAC3B,wBAAA,iBAAiB,EAAE,oBAAoB;AACvC,wBAAA,cAAc,EAAE,gCAAgC;AAChD,wBAAA,wBAAwB,EAAE,sBAAsB;AACjD,qBAAA;AACD,oBAAA,cAAc,EAAE;AACd,wBAAA;AACE,4BAAA,SAAS,EAAE,oBAAoB;4BAC/B,MAAM,EAAE,CAAC,iBAAiB,CAAC;AAC5B,yBAAA;AACF,qBAAA;AACF,iBAAA;;AAqCD;;AAEG;MAMU,aAAa,CAAA;8GAAb,aAAa,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;kGAAb,aAAa,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,4BAAA,EAAA,QAAA,EAAA,CAAA,cAAA,CAAA,EAAA,cAAA,EAAA,CAAA,EAAA,SAAA,EAAA,EAAA,CAAA,eAAA,EAAA,CAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA;;kGAAb,aAAa,EAAA,UAAA,EAAA,CAAA;kBALzB,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,4BAA4B;AACtC,oBAAA,QAAQ,EAAE,cAAc;oBACxB,cAAc,EAAE,CAAC,eAAe,CAAC;AAClC,iBAAA;;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"tabs2.mjs","sources":["../../../../../k8-fastbuild-ST-199a4f3c4e20/bin/src/cdk-experimental/ui-patterns/behaviors/label/label.ts","../../../../../k8-fastbuild-ST-199a4f3c4e20/bin/src/cdk-experimental/ui-patterns/tabs/tabs.ts"],"sourcesContent":["/**\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.dev/license\n */\nimport {computed} from '@angular/core';\nimport {SignalLike} from '../signal-like/signal-like';\n\n/** Represents the required inputs for the label control. */\nexport interface LabelControlInputs {\n /** The default `aria-labelledby` ids. */\n defaultLabelledBy: SignalLike<string[]>;\n}\n\n/** Represents the optional inputs for the label control. */\nexport interface LabelControlOptionalInputs {\n /** The `aria-label`. */\n label?: SignalLike<string | undefined>;\n\n /** The user-provided `aria-labelledby` ids. */\n labelledBy?: SignalLike<string[]>;\n}\n\n/** Controls label and description of an element. */\nexport class LabelControl {\n /** The `aria-label`. */\n readonly label = computed(() => this.inputs.label?.());\n\n /** The `aria-labelledby` ids. */\n readonly labelledBy = computed(() => {\n const label = this.label();\n const labelledBy = this.inputs.labelledBy?.();\n const defaultLabelledBy = this.inputs.defaultLabelledBy();\n\n if (labelledBy && labelledBy.length > 0) {\n return labelledBy;\n }\n\n // If an aria-label is provided by developers, do not set aria-labelledby with the\n // defaultLabelledBy value because if both attributes are set, aria-labelledby will be used.\n if (label) {\n return [];\n }\n\n return defaultLabelledBy;\n });\n\n constructor(readonly inputs: LabelControlInputs & LabelControlOptionalInputs) {}\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.dev/license\n */\n\nimport {computed} from '@angular/core';\nimport {KeyboardEventManager, PointerEventManager} from '../behaviors/event-manager';\nimport {\n ExpansionItem,\n ExpansionControl,\n ListExpansionInputs,\n ListExpansion,\n} from '../behaviors/expansion/expansion';\nimport {SignalLike} from '../behaviors/signal-like/signal-like';\nimport {LabelControl, LabelControlOptionalInputs} from '../behaviors/label/label';\nimport {List, ListInputs, ListItem} from '../behaviors/list/list';\n\n/** The required inputs to tabs. */\nexport interface TabInputs\n extends Omit<ListItem<string>, 'searchTerm' | 'index'>,\n Omit<ExpansionItem, 'expansionId' | 'expandable'> {\n /** The parent tablist that controls the tab. */\n tablist: SignalLike<TabListPattern>;\n\n /** The remote tabpanel controlled by the tab. */\n tabpanel: SignalLike<TabPanelPattern | undefined>;\n}\n\n/** A tab in a tablist. */\nexport class TabPattern {\n /** Controls expansion for this tab. */\n readonly expansion: ExpansionControl;\n\n /** A global unique identifier for the tab. */\n readonly id: SignalLike<string>;\n\n /** The index of the tab. */\n readonly index = computed(() => this.inputs.tablist().inputs.items().indexOf(this));\n\n /** A local unique identifier for the tab. */\n readonly value: SignalLike<string>;\n\n /** Whether the tab is disabled. */\n readonly disabled: SignalLike<boolean>;\n\n /** The html element that should receive focus. */\n readonly element: SignalLike<HTMLElement>;\n\n /** The text used by the typeahead search. */\n readonly searchTerm = () => ''; // Unused because tabs do not support typeahead.\n\n /** Whether this tab has expandable content. */\n readonly expandable = computed(() => this.expansion.expandable());\n\n /** The unique identifier used by the expansion behavior. */\n readonly expansionId = computed(() => this.expansion.expansionId());\n\n /** Whether the tab is expanded. */\n readonly expanded = computed(() => this.expansion.isExpanded());\n\n /** Whether the tab is active. */\n readonly active = computed(() => this.inputs.tablist().inputs.activeItem() === this);\n\n /** Whether the tab is selected. */\n readonly selected = computed(() => !!this.inputs.tablist().inputs.value().includes(this.value()));\n\n /** The tabindex of the tab. */\n readonly tabindex = computed(() => this.inputs.tablist().listBehavior.getItemTabindex(this));\n\n /** The id of the tabpanel associated with the tab. */\n readonly controls = computed(() => this.inputs.tabpanel()?.id());\n\n constructor(readonly inputs: TabInputs) {\n this.id = inputs.id;\n this.value = inputs.value;\n this.disabled = inputs.disabled;\n this.element = inputs.element;\n this.expansion = new ExpansionControl({\n ...inputs,\n expansionId: inputs.value,\n expandable: () => true,\n expansionManager: inputs.tablist().expansionManager,\n });\n }\n}\n\n/** The required inputs for the tabpanel. */\nexport interface TabPanelInputs extends LabelControlOptionalInputs {\n id: SignalLike<string>;\n tab: SignalLike<TabPattern | undefined>;\n value: SignalLike<string>;\n}\n\n/** A tabpanel associated with a tab. */\nexport class TabPanelPattern {\n /** A global unique identifier for the tabpanel. */\n readonly id: SignalLike<string>;\n\n /** A local unique identifier for the tabpanel. */\n readonly value: SignalLike<string>;\n\n /** Controls label for this tabpanel. */\n readonly labelManager: LabelControl;\n\n /** Whether the tabpanel is hidden. */\n readonly hidden = computed(() => this.inputs.tab()?.expanded() === false);\n\n /** The tabindex of this tabpanel. */\n readonly tabindex = computed(() => (this.hidden() ? -1 : 0));\n\n /** The aria-labelledby value for this tabpanel. */\n readonly labelledBy = computed(() =>\n this.labelManager.labelledBy().length > 0\n ? this.labelManager.labelledBy().join(' ')\n : undefined,\n );\n\n constructor(readonly inputs: TabPanelInputs) {\n this.id = inputs.id;\n this.value = inputs.value;\n this.labelManager = new LabelControl({\n ...inputs,\n defaultLabelledBy: computed(() => (this.inputs.tab() ? [this.inputs.tab()!.id()] : [])),\n });\n }\n}\n\n/** The required inputs for the tablist. */\nexport type TabListInputs = Omit<ListInputs<TabPattern, string>, 'multi' | 'typeaheadDelay'> &\n Omit<ListExpansionInputs, 'multiExpandable' | 'expandedIds' | 'items'>;\n\n/** Controls the state of a tablist. */\nexport class TabListPattern {\n /** The list behavior for the tablist. */\n readonly listBehavior: List<TabPattern, string>;\n\n /** Controls expansion for the tablist. */\n readonly expansionManager: ListExpansion;\n\n /** Whether the tablist is vertically or horizontally oriented. */\n readonly orientation: SignalLike<'vertical' | 'horizontal'>;\n\n /** Whether the tablist is disabled. */\n readonly disabled: SignalLike<boolean>;\n\n /** The tabindex of the tablist. */\n readonly tabindex = computed(() => this.listBehavior.tabindex());\n\n /** The id of the current active tab. */\n readonly activedescendant = computed(() => this.listBehavior.activedescendant());\n\n /** Whether selection should follow focus. */\n readonly followFocus = computed(() => this.inputs.selectionMode() === 'follow');\n\n /** The key used to navigate to the previous tab in the tablist. */\n readonly prevKey = computed(() => {\n if (this.inputs.orientation() === 'vertical') {\n return 'ArrowUp';\n }\n return this.inputs.textDirection() === 'rtl' ? 'ArrowRight' : 'ArrowLeft';\n });\n\n /** The key used to navigate to the next item in the list. */\n readonly nextKey = computed(() => {\n if (this.inputs.orientation() === 'vertical') {\n return 'ArrowDown';\n }\n return this.inputs.textDirection() === 'rtl' ? 'ArrowLeft' : 'ArrowRight';\n });\n\n /** The keydown event manager for the tablist. */\n readonly keydown = computed(() => {\n return new KeyboardEventManager()\n .on(this.prevKey, () => this.listBehavior.prev({select: this.followFocus()}))\n .on(this.nextKey, () => this.listBehavior.next({select: this.followFocus()}))\n .on('Home', () => this.listBehavior.first({select: this.followFocus()}))\n .on('End', () => this.listBehavior.last({select: this.followFocus()}))\n .on(' ', () => this.listBehavior.select())\n .on('Enter', () => this.listBehavior.select());\n });\n\n /** The pointerdown event manager for the tablist. */\n readonly pointerdown = computed(() => {\n return new PointerEventManager().on(e =>\n this.listBehavior.goto(this._getItem(e)!, {select: true}),\n );\n });\n\n constructor(readonly inputs: TabListInputs) {\n this.disabled = inputs.disabled;\n this.orientation = inputs.orientation;\n\n this.listBehavior = new List({\n ...inputs,\n multi: () => false,\n typeaheadDelay: () => 0, // Tabs do not support typeahead.\n });\n\n this.expansionManager = new ListExpansion({\n ...inputs,\n multiExpandable: () => false,\n expandedIds: this.inputs.value,\n });\n }\n\n /**\n * Sets the tablist to its default initial state.\n *\n * Sets the active index of the tablist to the first focusable selected\n * tab if one exists. Otherwise, sets focus to the first focusable tab.\n *\n * This method should be called once the tablist and its tabs are properly initialized.\n */\n setDefaultState() {\n let firstItem: TabPattern | undefined;\n\n for (const item of this.inputs.items()) {\n if (!this.listBehavior.isFocusable(item)) continue;\n\n if (firstItem === undefined) {\n firstItem = item;\n }\n\n if (item.selected()) {\n this.inputs.activeItem.set(item);\n return;\n }\n }\n if (firstItem !== undefined) {\n this.inputs.activeItem.set(firstItem);\n }\n }\n\n /** Handles keydown events for the tablist. */\n onKeydown(event: KeyboardEvent) {\n if (!this.disabled()) {\n this.keydown().handle(event);\n }\n }\n\n /** The pointerdown event manager for the tablist. */\n onPointerdown(event: PointerEvent) {\n if (!this.disabled()) {\n this.pointerdown().handle(event);\n }\n }\n\n /** Returns the tab item associated with the given pointer event. */\n private _getItem(e: PointerEvent) {\n if (!(e.target instanceof HTMLElement)) {\n return;\n }\n\n const element = e.target.closest('[role=\"tab\"]');\n return this.inputs.items().find(i => i.element() === element);\n }\n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C,GAAG,CAAC,IAAI,CAAC;gBAChC;;;AAGJ,QAAA,IAAI,SAAS,KAAK,SAAS,EAAE;YAC3B,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,GAAG,CAAC,SAAS,CAAC;;;;AAKzC,IAAA,SAAS,CAAC,KAAoB,EAAA;AAC5B,QAAA,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,EAAE;YACpB,IAAI,CAAC,OAAO,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC;;;;AAKhC,IAAA,aAAa,CAAC,KAAmB,EAAA;AAC/B,QAAA,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,EAAE;YACpB,IAAI,CAAC,WAAW,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC;;;;AAK5B,IAAA,QAAQ,CAAC,CAAe,EAAA;QAC9B,IAAI,EAAE,CAAC,CAAC,MAAM,YAAY,WAAW,CAAC,EAAE;YACtC;;QAGF,MAAM,OAAO,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,cAAc,CAAC;QAChD,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,KAAK,OAAO,CAAC;;AAEhE;;;;"}
1
+ {"version":3,"file":"tabs2.mjs","sources":["../../../../../darwin_arm64-fastbuild-ST-199a4f3c4e20/bin/src/cdk-experimental/ui-patterns/behaviors/label/label.ts","../../../../../darwin_arm64-fastbuild-ST-199a4f3c4e20/bin/src/cdk-experimental/ui-patterns/tabs/tabs.ts"],"sourcesContent":["/**\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.dev/license\n */\nimport {computed} from '@angular/core';\nimport {SignalLike} from '../signal-like/signal-like';\n\n/** Represents the required inputs for the label control. */\nexport interface LabelControlInputs {\n /** The default `aria-labelledby` ids. */\n defaultLabelledBy: SignalLike<string[]>;\n}\n\n/** Represents the optional inputs for the label control. */\nexport interface LabelControlOptionalInputs {\n /** The `aria-label`. */\n label?: SignalLike<string | undefined>;\n\n /** The user-provided `aria-labelledby` ids. */\n labelledBy?: SignalLike<string[]>;\n}\n\n/** Controls label and description of an element. */\nexport class LabelControl {\n /** The `aria-label`. */\n readonly label = computed(() => this.inputs.label?.());\n\n /** The `aria-labelledby` ids. */\n readonly labelledBy = computed(() => {\n const label = this.label();\n const labelledBy = this.inputs.labelledBy?.();\n const defaultLabelledBy = this.inputs.defaultLabelledBy();\n\n if (labelledBy && labelledBy.length > 0) {\n return labelledBy;\n }\n\n // If an aria-label is provided by developers, do not set aria-labelledby with the\n // defaultLabelledBy value because if both attributes are set, aria-labelledby will be used.\n if (label) {\n return [];\n }\n\n return defaultLabelledBy;\n });\n\n constructor(readonly inputs: LabelControlInputs & LabelControlOptionalInputs) {}\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.dev/license\n */\n\nimport {computed} from '@angular/core';\nimport {KeyboardEventManager, PointerEventManager} from '../behaviors/event-manager';\nimport {\n ExpansionItem,\n ExpansionControl,\n ListExpansionInputs,\n ListExpansion,\n} from '../behaviors/expansion/expansion';\nimport {SignalLike} from '../behaviors/signal-like/signal-like';\nimport {LabelControl, LabelControlOptionalInputs} from '../behaviors/label/label';\nimport {List, ListInputs, ListItem} from '../behaviors/list/list';\n\n/** The required inputs to tabs. */\nexport interface TabInputs\n extends Omit<ListItem<string>, 'searchTerm' | 'index'>,\n Omit<ExpansionItem, 'expansionId' | 'expandable'> {\n /** The parent tablist that controls the tab. */\n tablist: SignalLike<TabListPattern>;\n\n /** The remote tabpanel controlled by the tab. */\n tabpanel: SignalLike<TabPanelPattern | undefined>;\n}\n\n/** A tab in a tablist. */\nexport class TabPattern {\n /** Controls expansion for this tab. */\n readonly expansion: ExpansionControl;\n\n /** A global unique identifier for the tab. */\n readonly id: SignalLike<string>;\n\n /** The index of the tab. */\n readonly index = computed(() => this.inputs.tablist().inputs.items().indexOf(this));\n\n /** A local unique identifier for the tab. */\n readonly value: SignalLike<string>;\n\n /** Whether the tab is disabled. */\n readonly disabled: SignalLike<boolean>;\n\n /** The html element that should receive focus. */\n readonly element: SignalLike<HTMLElement>;\n\n /** The text used by the typeahead search. */\n readonly searchTerm = () => ''; // Unused because tabs do not support typeahead.\n\n /** Whether this tab has expandable content. */\n readonly expandable = computed(() => this.expansion.expandable());\n\n /** The unique identifier used by the expansion behavior. */\n readonly expansionId = computed(() => this.expansion.expansionId());\n\n /** Whether the tab is expanded. */\n readonly expanded = computed(() => this.expansion.isExpanded());\n\n /** Whether the tab is active. */\n readonly active = computed(() => this.inputs.tablist().inputs.activeItem() === this);\n\n /** Whether the tab is selected. */\n readonly selected = computed(() => !!this.inputs.tablist().inputs.value().includes(this.value()));\n\n /** The tabindex of the tab. */\n readonly tabindex = computed(() => this.inputs.tablist().listBehavior.getItemTabindex(this));\n\n /** The id of the tabpanel associated with the tab. */\n readonly controls = computed(() => this.inputs.tabpanel()?.id());\n\n constructor(readonly inputs: TabInputs) {\n this.id = inputs.id;\n this.value = inputs.value;\n this.disabled = inputs.disabled;\n this.element = inputs.element;\n this.expansion = new ExpansionControl({\n ...inputs,\n expansionId: inputs.value,\n expandable: () => true,\n expansionManager: inputs.tablist().expansionManager,\n });\n }\n}\n\n/** The required inputs for the tabpanel. */\nexport interface TabPanelInputs extends LabelControlOptionalInputs {\n id: SignalLike<string>;\n tab: SignalLike<TabPattern | undefined>;\n value: SignalLike<string>;\n}\n\n/** A tabpanel associated with a tab. */\nexport class TabPanelPattern {\n /** A global unique identifier for the tabpanel. */\n readonly id: SignalLike<string>;\n\n /** A local unique identifier for the tabpanel. */\n readonly value: SignalLike<string>;\n\n /** Controls label for this tabpanel. */\n readonly labelManager: LabelControl;\n\n /** Whether the tabpanel is hidden. */\n readonly hidden = computed(() => this.inputs.tab()?.expanded() === false);\n\n /** The tabindex of this tabpanel. */\n readonly tabindex = computed(() => (this.hidden() ? -1 : 0));\n\n /** The aria-labelledby value for this tabpanel. */\n readonly labelledBy = computed(() =>\n this.labelManager.labelledBy().length > 0\n ? this.labelManager.labelledBy().join(' ')\n : undefined,\n );\n\n constructor(readonly inputs: TabPanelInputs) {\n this.id = inputs.id;\n this.value = inputs.value;\n this.labelManager = new LabelControl({\n ...inputs,\n defaultLabelledBy: computed(() => (this.inputs.tab() ? [this.inputs.tab()!.id()] : [])),\n });\n }\n}\n\n/** The required inputs for the tablist. */\nexport type TabListInputs = Omit<ListInputs<TabPattern, string>, 'multi' | 'typeaheadDelay'> &\n Omit<ListExpansionInputs, 'multiExpandable' | 'expandedIds' | 'items'>;\n\n/** Controls the state of a tablist. */\nexport class TabListPattern {\n /** The list behavior for the tablist. */\n readonly listBehavior: List<TabPattern, string>;\n\n /** Controls expansion for the tablist. */\n readonly expansionManager: ListExpansion;\n\n /** Whether the tablist is vertically or horizontally oriented. */\n readonly orientation: SignalLike<'vertical' | 'horizontal'>;\n\n /** Whether the tablist is disabled. */\n readonly disabled: SignalLike<boolean>;\n\n /** The tabindex of the tablist. */\n readonly tabindex = computed(() => this.listBehavior.tabindex());\n\n /** The id of the current active tab. */\n readonly activedescendant = computed(() => this.listBehavior.activedescendant());\n\n /** Whether selection should follow focus. */\n readonly followFocus = computed(() => this.inputs.selectionMode() === 'follow');\n\n /** The key used to navigate to the previous tab in the tablist. */\n readonly prevKey = computed(() => {\n if (this.inputs.orientation() === 'vertical') {\n return 'ArrowUp';\n }\n return this.inputs.textDirection() === 'rtl' ? 'ArrowRight' : 'ArrowLeft';\n });\n\n /** The key used to navigate to the next item in the list. */\n readonly nextKey = computed(() => {\n if (this.inputs.orientation() === 'vertical') {\n return 'ArrowDown';\n }\n return this.inputs.textDirection() === 'rtl' ? 'ArrowLeft' : 'ArrowRight';\n });\n\n /** The keydown event manager for the tablist. */\n readonly keydown = computed(() => {\n return new KeyboardEventManager()\n .on(this.prevKey, () => this.listBehavior.prev({select: this.followFocus()}))\n .on(this.nextKey, () => this.listBehavior.next({select: this.followFocus()}))\n .on('Home', () => this.listBehavior.first({select: this.followFocus()}))\n .on('End', () => this.listBehavior.last({select: this.followFocus()}))\n .on(' ', () => this.listBehavior.select())\n .on('Enter', () => this.listBehavior.select());\n });\n\n /** The pointerdown event manager for the tablist. */\n readonly pointerdown = computed(() => {\n return new PointerEventManager().on(e =>\n this.listBehavior.goto(this._getItem(e)!, {select: true}),\n );\n });\n\n constructor(readonly inputs: TabListInputs) {\n this.disabled = inputs.disabled;\n this.orientation = inputs.orientation;\n\n this.listBehavior = new List({\n ...inputs,\n multi: () => false,\n typeaheadDelay: () => 0, // Tabs do not support typeahead.\n });\n\n this.expansionManager = new ListExpansion({\n ...inputs,\n multiExpandable: () => false,\n expandedIds: this.inputs.value,\n });\n }\n\n /**\n * Sets the tablist to its default initial state.\n *\n * Sets the active index of the tablist to the first focusable selected\n * tab if one exists. Otherwise, sets focus to the first focusable tab.\n *\n * This method should be called once the tablist and its tabs are properly initialized.\n */\n setDefaultState() {\n let firstItem: TabPattern | undefined;\n\n for (const item of this.inputs.items()) {\n if (!this.listBehavior.isFocusable(item)) continue;\n\n if (firstItem === undefined) {\n firstItem = item;\n }\n\n if (item.selected()) {\n this.inputs.activeItem.set(item);\n return;\n }\n }\n if (firstItem !== undefined) {\n this.inputs.activeItem.set(firstItem);\n }\n }\n\n /** Handles keydown events for the tablist. */\n onKeydown(event: KeyboardEvent) {\n if (!this.disabled()) {\n this.keydown().handle(event);\n }\n }\n\n /** The pointerdown event manager for the tablist. */\n onPointerdown(event: PointerEvent) {\n if (!this.disabled()) {\n this.pointerdown().handle(event);\n }\n }\n\n /** Returns the tab item associated with the given pointer event. */\n private _getItem(e: PointerEvent) {\n if (!(e.target instanceof HTMLElement)) {\n return;\n }\n\n const element = e.target.closest('[role=\"tab\"]');\n return this.inputs.items().find(i => i.element() === element);\n }\n}\n"],"names":[],"mappings":";;;;;AAyBA;MACa,YAAY,CAAA;A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IAAI,SAAS,KAAK,SAAS,EAAE;YAC3B,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,GAAG,CAAC,SAAS,CAAC;;;;AAKzC,IAAA,SAAS,CAAC,KAAoB,EAAA;AAC5B,QAAA,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,EAAE;YACpB,IAAI,CAAC,OAAO,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC;;;;AAKhC,IAAA,aAAa,CAAC,KAAmB,EAAA;AAC/B,QAAA,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,EAAE;YACpB,IAAI,CAAC,WAAW,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC;;;;AAK5B,IAAA,QAAQ,CAAC,CAAe,EAAA;QAC9B,IAAI,EAAE,CAAC,CAAC,MAAM,YAAY,WAAW,CAAC,EAAE;YACtC;;QAGF,MAAM,OAAO,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,cAAc,CAAC;QAChD,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,KAAK,OAAO,CAAC;;AAEhE;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"toolbar.mjs","sources":["../../../../../k8-fastbuild-ST-199a4f3c4e20/bin/src/cdk-experimental/toolbar/toolbar.ts"],"sourcesContent":["/**\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.dev/license\n */\n\nimport {\n afterRenderEffect,\n Directive,\n ElementRef,\n inject,\n computed,\n input,\n booleanAttribute,\n signal,\n Signal,\n OnInit,\n OnDestroy,\n} from '@angular/core';\nimport {ToolbarPattern, RadioButtonPattern, ToolbarWidgetPattern} from '../ui-patterns';\nimport {Directionality} from '@angular/cdk/bidi';\nimport {_IdGenerator} from '@angular/cdk/a11y';\n\n/** Interface for a radio button that can be used with a toolbar. Based on radio-button in ui-patterns */\ninterface CdkRadioButtonInterface<V> {\n /** The HTML element associated with the radio button. */\n element: Signal<HTMLElement>;\n /** Whether the radio button is disabled. */\n disabled: Signal<boolean>;\n\n pattern: RadioButtonPattern<V>;\n}\n\ninterface HasElement {\n element: Signal<HTMLElement>;\n}\n\n/**\n * Sort directives by their document order.\n */\nfunction sortDirectives(a: HasElement, b: HasElement) {\n return (a.element().compareDocumentPosition(b.element()) & Node.DOCUMENT_POSITION_PRECEDING) > 0\n ? 1\n : -1;\n}\n\n/**\n * A toolbar widget container.\n *\n * Widgets such as radio groups or buttons are nested within a toolbar to allow for a single\n * place of reference for focus and navigation. The CdkToolbar is meant to be used in conjunction\n * with CdkToolbarWidget and CdkRadioGroup as follows:\n *\n * ```html\n * <div cdkToolbar>\n * <button cdkToolbarWidget>Button</button>\n * <div cdkRadioGroup>\n * <label cdkRadioButton value=\"1\">Option 1</label>\n * <label cdkRadioButton value=\"2\">Option 2</label>\n * <label cdkRadioButton value=\"3\">Option 3</label>\n * </div>\n * </div>\n * ```\n */\n@Directive({\n selector: '[cdkToolbar]',\n exportAs: 'cdkToolbar',\n host: {\n 'role': 'toolbar',\n 'class': 'cdk-toolbar',\n '[attr.tabindex]': 'pattern.tabindex()',\n '[attr.aria-disabled]': 'pattern.disabled()',\n '[attr.aria-orientation]': 'pattern.orientation()',\n '[attr.aria-activedescendant]': 'pattern.activedescendant()',\n '(keydown)': 'pattern.onKeydown($event)',\n '(pointerdown)': 'pattern.onPointerdown($event)',\n '(focusin)': 'onFocus()',\n },\n})\nexport class CdkToolbar<V> {\n /** The CdkTabList nested inside of the container. */\n private readonly _cdkWidgets = signal(new Set<CdkRadioButtonInterface<V> | CdkToolbarWidget>());\n\n /** A signal wrapper for directionality. */\n textDirection = inject(Directionality).valueSignal;\n\n /** Sorted UIPatterns of the child widgets */\n items = computed(() =>\n [...this._cdkWidgets()].sort(sortDirectives).map(widget => widget.pattern),\n );\n\n /** Whether the toolbar is vertically or horizontally oriented. */\n orientation = input<'vertical' | 'horizontal'>('horizontal');\n\n /** Whether disabled items in the group should be skipped when navigating. */\n skipDisabled = input(false, {transform: booleanAttribute});\n\n /** Whether the toolbar is disabled. */\n disabled = input(false, {transform: booleanAttribute});\n\n /** Whether focus should wrap when navigating. */\n readonly wrap = input(true, {transform: booleanAttribute});\n\n /** The toolbar UIPattern. */\n pattern: ToolbarPattern<V> = new ToolbarPattern<V>({\n ...this,\n activeItem: signal(undefined),\n textDirection: this.textDirection,\n focusMode: signal('roving'),\n });\n\n /** Whether the toolbar has received focus yet. */\n private _hasFocused = signal(false);\n\n onFocus() {\n this._hasFocused.set(true);\n }\n\n constructor() {\n afterRenderEffect(() => {\n if (!this._hasFocused()) {\n this.pattern.setDefaultState();\n }\n });\n\n afterRenderEffect(() => {\n if (typeof ngDevMode === 'undefined' || ngDevMode) {\n const violations = this.pattern.validate();\n for (const violation of violations) {\n console.error(violation);\n }\n }\n });\n }\n\n register(widget: CdkRadioButtonInterface<V> | CdkToolbarWidget) {\n const widgets = this._cdkWidgets();\n if (!widgets.has(widget)) {\n widgets.add(widget);\n this._cdkWidgets.set(new Set(widgets));\n }\n }\n\n unregister(widget: CdkRadioButtonInterface<V> | CdkToolbarWidget) {\n const widgets = this._cdkWidgets();\n if (widgets.delete(widget)) {\n this._cdkWidgets.set(new Set(widgets));\n }\n }\n}\n\n/**\n * A widget within a toolbar.\n *\n * A widget is anything that is within a toolbar. It should be applied to any native HTML element\n * that has the purpose of acting as a widget navigatable within a toolbar.\n */\n@Directive({\n selector: '[cdkToolbarWidget]',\n exportAs: 'cdkToolbarWidget',\n host: {\n 'role': 'button',\n 'class': 'cdk-toolbar-widget',\n '[class.cdk-active]': 'pattern.active()',\n '[attr.tabindex]': 'pattern.tabindex()',\n '[attr.inert]': 'hardDisabled() ? true : null',\n '[attr.disabled]': 'hardDisabled() ? true : null',\n '[attr.aria-disabled]': 'pattern.disabled()',\n '[id]': 'pattern.id()',\n },\n})\nexport class CdkToolbarWidget implements OnInit, OnDestroy {\n /** A reference to the widget element. */\n private readonly _elementRef = inject(ElementRef);\n\n /** The parent CdkToolbar. */\n private readonly _cdkToolbar = inject(CdkToolbar);\n\n /** A unique identifier for the widget. */\n private readonly _generatedId = inject(_IdGenerator).getId('cdk-toolbar-widget-');\n\n /** A unique identifier for the widget. */\n protected id = computed(() => this._generatedId);\n\n /** The parent Toolbar UIPattern. */\n protected parentToolbar = computed(() => this._cdkToolbar.pattern);\n\n /** A reference to the widget element to be focused on navigation. */\n element = computed(() => this._elementRef.nativeElement);\n\n /** Whether the widget is disabled. */\n disabled = input(false, {transform: booleanAttribute});\n\n readonly hardDisabled = computed(\n () => this.pattern.disabled() && this._cdkToolbar.skipDisabled(),\n );\n\n pattern = new ToolbarWidgetPattern({\n ...this,\n id: this.id,\n element: this.element,\n disabled: computed(() => this._cdkToolbar.disabled() || this.disabled()),\n parentToolbar: this.parentToolbar,\n });\n\n ngOnInit() {\n this._cdkToolbar.register(this);\n }\n\n ngOnDestroy() {\n this._cdkToolbar.unregister(this);\n }\n}\n"],"names":[],"mappings":";;;;;;;;AAuCA;;AAEG;AACH,SAAS,cAAc,CAAC,CAAa,EAAE,CAAa,EAAA;AAClD,IAAA,OAAO,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC,uBAAuB,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC,GAAG,IAAI,CAAC,2BAA2B,IAAI;AAC7F,UAAE;UACA,CAAC,CAAC;AACR;AAEA;;;;;;;;;;;;;;;;;AAiBG;MAgBU,UAAU,CAAA;;AAEJ,IAAA,WAAW,GAAG,MAAM,CAAC,IAAI,GAAG,EAAiD,uDAAC;;AAG/F,IAAA,aAAa,GAAG,MAAM,CAAC,cAAc,CAAC,CAAC,WAAW;;AAGlD,IAAA,KAAK,GAAG,QAAQ,CAAC,MACf,CAAC,GAAG,IAAI,CAAC,WAAW,EAAE,CAAC,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,GAAG,CAAC,MAAM,IAAI,MAAM,CAAC,OAAO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olbar.ts"],"sourcesContent":["/**\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.dev/license\n */\n\nimport {\n afterRenderEffect,\n Directive,\n ElementRef,\n inject,\n computed,\n input,\n booleanAttribute,\n signal,\n Signal,\n OnInit,\n OnDestroy,\n} from '@angular/core';\nimport {ToolbarPattern, RadioButtonPattern, ToolbarWidgetPattern} from '../ui-patterns';\nimport {Directionality} from '@angular/cdk/bidi';\nimport {_IdGenerator} from '@angular/cdk/a11y';\n\n/** Interface for a radio button that can be used with a toolbar. Based on radio-button in ui-patterns */\ninterface CdkRadioButtonInterface<V> {\n /** The HTML element associated with the radio button. */\n element: Signal<HTMLElement>;\n /** Whether the radio button is disabled. */\n disabled: Signal<boolean>;\n\n pattern: RadioButtonPattern<V>;\n}\n\ninterface HasElement {\n element: Signal<HTMLElement>;\n}\n\n/**\n * Sort directives by their document order.\n */\nfunction sortDirectives(a: HasElement, b: HasElement) {\n return (a.element().compareDocumentPosition(b.element()) & Node.DOCUMENT_POSITION_PRECEDING) > 0\n ? 1\n : -1;\n}\n\n/**\n * A toolbar widget container.\n *\n * Widgets such as radio groups or buttons are nested within a toolbar to allow for a single\n * place of reference for focus and navigation. The CdkToolbar is meant to be used in conjunction\n * with CdkToolbarWidget and CdkRadioGroup as follows:\n *\n * ```html\n * <div cdkToolbar>\n * <button cdkToolbarWidget>Button</button>\n * <div cdkRadioGroup>\n * <label cdkRadioButton value=\"1\">Option 1</label>\n * <label cdkRadioButton value=\"2\">Option 2</label>\n * <label cdkRadioButton value=\"3\">Option 3</label>\n * </div>\n * </div>\n * ```\n */\n@Directive({\n selector: '[cdkToolbar]',\n exportAs: 'cdkToolbar',\n host: {\n 'role': 'toolbar',\n 'class': 'cdk-toolbar',\n '[attr.tabindex]': 'pattern.tabindex()',\n '[attr.aria-disabled]': 'pattern.disabled()',\n '[attr.aria-orientation]': 'pattern.orientation()',\n '[attr.aria-activedescendant]': 'pattern.activedescendant()',\n '(keydown)': 'pattern.onKeydown($event)',\n '(pointerdown)': 'pattern.onPointerdown($event)',\n '(focusin)': 'onFocus()',\n },\n})\nexport class CdkToolbar<V> {\n /** The CdkTabList nested inside of the container. */\n private readonly _cdkWidgets = signal(new Set<CdkRadioButtonInterface<V> | CdkToolbarWidget>());\n\n /** A signal wrapper for directionality. */\n textDirection = inject(Directionality).valueSignal;\n\n /** Sorted UIPatterns of the child widgets */\n items = computed(() =>\n [...this._cdkWidgets()].sort(sortDirectives).map(widget => widget.pattern),\n );\n\n /** Whether the toolbar is vertically or horizontally oriented. */\n orientation = input<'vertical' | 'horizontal'>('horizontal');\n\n /** Whether disabled items in the group should be skipped when navigating. */\n skipDisabled = input(false, {transform: booleanAttribute});\n\n /** Whether the toolbar is disabled. */\n disabled = input(false, {transform: booleanAttribute});\n\n /** Whether focus should wrap when navigating. */\n readonly wrap = input(true, {transform: booleanAttribute});\n\n /** The toolbar UIPattern. */\n pattern: ToolbarPattern<V> = new ToolbarPattern<V>({\n ...this,\n activeItem: signal(undefined),\n textDirection: this.textDirection,\n focusMode: signal('roving'),\n });\n\n /** Whether the toolbar has received focus yet. */\n private _hasFocused = signal(false);\n\n onFocus() {\n this._hasFocused.set(true);\n }\n\n constructor() {\n afterRenderEffect(() => {\n if (!this._hasFocused()) {\n this.pattern.setDefaultState();\n }\n });\n\n afterRenderEffect(() => {\n if (typeof ngDevMode === 'undefined' || ngDevMode) {\n const violations = this.pattern.validate();\n for (const violation of violations) {\n console.error(violation);\n }\n }\n });\n }\n\n register(widget: CdkRadioButtonInterface<V> | CdkToolbarWidget) {\n const widgets = this._cdkWidgets();\n if (!widgets.has(widget)) {\n widgets.add(widget);\n this._cdkWidgets.set(new Set(widgets));\n }\n }\n\n unregister(widget: CdkRadioButtonInterface<V> | CdkToolbarWidget) {\n const widgets = this._cdkWidgets();\n if (widgets.delete(widget)) {\n this._cdkWidgets.set(new Set(widgets));\n }\n }\n}\n\n/**\n * A widget within a toolbar.\n *\n * A widget is anything that is within a toolbar. It should be applied to any native HTML element\n * that has the purpose of acting as a widget navigatable within a toolbar.\n */\n@Directive({\n selector: '[cdkToolbarWidget]',\n exportAs: 'cdkToolbarWidget',\n host: {\n 'role': 'button',\n 'class': 'cdk-toolbar-widget',\n '[class.cdk-active]': 'pattern.active()',\n '[attr.tabindex]': 'pattern.tabindex()',\n '[attr.inert]': 'hardDisabled() ? true : null',\n '[attr.disabled]': 'hardDisabled() ? true : null',\n '[attr.aria-disabled]': 'pattern.disabled()',\n '[id]': 'pattern.id()',\n },\n})\nexport class CdkToolbarWidget implements OnInit, OnDestroy {\n /** A reference to the widget element. */\n private readonly _elementRef = inject(ElementRef);\n\n /** The parent CdkToolbar. */\n private readonly _cdkToolbar = inject(CdkToolbar);\n\n /** A unique identifier for the widget. */\n private readonly _generatedId = inject(_IdGenerator).getId('cdk-toolbar-widget-');\n\n /** A unique identifier for the widget. */\n protected id = computed(() => this._generatedId);\n\n /** The parent Toolbar UIPattern. */\n protected parentToolbar = computed(() => this._cdkToolbar.pattern);\n\n /** A reference to the widget element to be focused on navigation. */\n element = computed(() => this._elementRef.nativeElement);\n\n /** Whether the widget is disabled. */\n disabled = input(false, {transform: booleanAttribute});\n\n readonly hardDisabled = computed(\n () => this.pattern.disabled() && this._cdkToolbar.skipDisabled(),\n );\n\n pattern = new ToolbarWidgetPattern({\n ...this,\n id: this.id,\n element: this.element,\n disabled: computed(() => this._cdkToolbar.disabled() || this.disabled()),\n parentToolbar: this.parentToolbar,\n });\n\n ngOnInit() {\n this._cdkToolbar.register(this);\n }\n\n ngOnDestroy() {\n this._cdkToolbar.unregister(this);\n }\n}\n"],"names":[],"mappings":";;;;;;;;AAuCA;;AAEG;AACH,SAAS,cAAc,CAAC,CAAa,EAAE,CAAa,EAAA;AAClD,IAAA,OAAO,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC,uBAAuB,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC,GAAG,IAAI,C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AA,MAAM,EAAE,QAAQ;AAChB,wBAAA,OAAO,EAAE,oBAAoB;AAC7B,wBAAA,oBAAoB,EAAE,kBAAkB;AACxC,wBAAA,iBAAiB,EAAE,oBAAoB;AACvC,wBAAA,cAAc,EAAE,8BAA8B;AAC9C,wBAAA,iBAAiB,EAAE,8BAA8B;AACjD,wBAAA,sBAAsB,EAAE,oBAAoB;AAC5C,wBAAA,MAAM,EAAE,cAAc;AACvB,qBAAA;AACF,iBAAA;;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"toolbar2.mjs","sources":["../../../../../k8-fastbuild-ST-199a4f3c4e20/bin/src/cdk-experimental/ui-patterns/radio-group/radio-button.ts","../../../../../k8-fastbuild-ST-199a4f3c4e20/bin/src/cdk-experimental/ui-patterns/toolbar/toolbar.ts"],"sourcesContent":["/**\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.dev/license\n */\n\nimport {computed} from '@angular/core';\nimport {SignalLike} from '../behaviors/signal-like/signal-like';\nimport {List, ListItem} from '../behaviors/list/list';\n\n/**\n * Represents the properties exposed by a toolbar widget that need to be accessed by a radio group.\n * This exists to avoid circular dependency errors between the toolbar and radio button.\n */\ntype ToolbarWidgetLike = {\n id: SignalLike<string>;\n index: SignalLike<number>;\n element: SignalLike<HTMLElement>;\n disabled: SignalLike<boolean>;\n searchTerm: SignalLike<any>;\n value: SignalLike<any>;\n};\n\n/**\n * Represents the properties exposed by a radio group that need to be accessed by a radio button.\n * This exists to avoid circular dependency errors between the radio group and radio button.\n */\ninterface RadioGroupLike<V> {\n /** The list behavior for the radio group. */\n listBehavior: List<RadioButtonPattern<V> | ToolbarWidgetLike, V>;\n /** Whether the list is readonly */\n readonly: SignalLike<boolean>;\n /** Whether the radio group is disabled. */\n disabled: SignalLike<boolean>;\n}\n\n/** Represents the required inputs for a radio button in a radio group. */\nexport interface RadioButtonInputs<V> extends Omit<ListItem<V>, 'searchTerm' | 'index'> {\n /** A reference to the parent radio group. */\n group: SignalLike<RadioGroupLike<V> | undefined>;\n}\n\n/** Represents a radio button within a radio group. */\nexport class RadioButtonPattern<V> {\n /** A unique identifier for the radio button. */\n id: SignalLike<string>;\n\n /** The value associated with the radio button. */\n value: SignalLike<V>;\n\n /** The position of the radio button within the group. */\n index: SignalLike<number> = computed(\n () => this.group()?.listBehavior.inputs.items().indexOf(this) ?? -1,\n );\n\n /** Whether the radio button is currently the active one (focused). */\n active = computed(() => this.group()?.listBehavior.inputs.activeItem() === this);\n\n /** Whether the radio button is selected. */\n selected: SignalLike<boolean> = computed(\n () => !!this.group()?.listBehavior.inputs.value().includes(this.value()),\n );\n\n /** Whether the radio button is disabled. */\n disabled: SignalLike<boolean>;\n\n /** A reference to the parent radio group. */\n group: SignalLike<RadioGroupLike<V> | undefined>;\n\n /** The tabindex of the radio button. */\n tabindex = computed(() => this.group()?.listBehavior.getItemTabindex(this));\n\n /** The HTML element associated with the radio button. */\n element: SignalLike<HTMLElement>;\n\n /** The search term for typeahead. */\n readonly searchTerm = () => ''; // Radio groups do not support typeahead.\n\n constructor(readonly inputs: RadioButtonInputs<V>) {\n this.id = inputs.id;\n this.value = inputs.value;\n this.group = inputs.group;\n this.element = inputs.element;\n this.disabled = inputs.disabled;\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.dev/license\n */\n\nimport {computed, signal} from '@angular/core';\nimport {KeyboardEventManager, PointerEventManager} from '../behaviors/event-manager';\nimport {SignalLike} from '../behaviors/signal-like/signal-like';\nimport {RadioButtonPattern} from '../radio-group/radio-button';\nimport {List, ListInputs, ListItem} from '../behaviors/list/list';\n\n/** Represents the required inputs for a toolbar. */\nexport type ToolbarInputs<V> = Omit<\n ListInputs<ToolbarWidgetPattern | RadioButtonPattern<V>, V>,\n 'multi' | 'typeaheadDelay' | 'value' | 'selectionMode'\n>;\n\n/** Controls the state of a toolbar. */\nexport class ToolbarPattern<V> {\n /** The list behavior for the toolbar. */\n listBehavior: List<ToolbarWidgetPattern | RadioButtonPattern<V>, V>;\n\n /** Whether the tablist is vertically or horizontally oriented. */\n readonly orientation: SignalLike<'vertical' | 'horizontal'>;\n\n /** Whether the toolbar is disabled. */\n disabled = computed(() => this.listBehavior.disabled());\n\n /** The tabindex of the toolbar (if using activedescendant). */\n tabindex = computed(() => this.listBehavior.tabindex());\n\n /** The id of the current active widget (if using activedescendant). */\n activedescendant = computed(() => this.listBehavior.activedescendant());\n\n /** The key used to navigate to the previous widget. */\n prevKey = computed(() => {\n if (this.inputs.orientation() === 'vertical') {\n return 'ArrowUp';\n }\n return this.inputs.textDirection() === 'rtl' ? 'ArrowRight' : 'ArrowLeft';\n });\n\n /** The key used to navigate to the next widget. */\n nextKey = computed(() => {\n if (this.inputs.orientation() === 'vertical') {\n return 'ArrowDown';\n }\n return this.inputs.textDirection() === 'rtl' ? 'ArrowLeft' : 'ArrowRight';\n });\n\n /** The alternate key used to navigate to the previous widget */\n altPrevKey = computed(() => {\n if (this.inputs.orientation() === 'vertical') {\n return this.inputs.textDirection() === 'rtl' ? 'ArrowRight' : 'ArrowLeft';\n }\n return 'ArrowUp';\n });\n\n /** The alternate key used to navigate to the next widget. */\n altNextKey = computed(() => {\n if (this.inputs.orientation() === 'vertical') {\n return this.inputs.textDirection() === 'rtl' ? 'ArrowLeft' : 'ArrowRight';\n }\n return 'ArrowDown';\n });\n\n /** The keydown event manager for the toolbar. */\n keydown = computed(() => {\n const manager = new KeyboardEventManager();\n\n const activeItem = this.inputs.activeItem();\n const isRadioButton = activeItem instanceof RadioButtonPattern;\n\n if (isRadioButton) {\n manager\n .on(' ', () => this.selectRadioButton())\n .on('Enter', () => this.selectRadioButton())\n .on(this.altNextKey, () => activeItem?.group()?.listBehavior.next())\n .on(this.altPrevKey, () => activeItem?.group()?.listBehavior.prev());\n } else {\n manager.on(this.altNextKey, () => this.listBehavior.next());\n manager.on(this.altPrevKey, () => this.listBehavior.prev());\n }\n\n return manager\n .on(this.prevKey, () => this.listBehavior.prev())\n .on(this.nextKey, () => this.listBehavior.next())\n .on('Home', () => this.listBehavior.first())\n .on('End', () => this.listBehavior.last());\n });\n\n selectRadioButton() {\n const activeItem = this.inputs.activeItem() as RadioButtonPattern<V>;\n\n // activeItem must be a radio button\n const group = activeItem!.group();\n if (group && !group.readonly() && !group.disabled()) {\n group.listBehavior.selectOne();\n }\n }\n\n /** The pointerdown event manager for the toolbar. */\n pointerdown = computed(() => new PointerEventManager().on(e => this.goto(e)));\n\n /** Navigates to the widget associated with the given pointer event. */\n goto(event: PointerEvent) {\n const item = this._getItem(event);\n if (!item) return;\n\n if (item instanceof RadioButtonPattern) {\n const group = item.group();\n if (group && !group.disabled()) {\n group.listBehavior.goto(item, {selectOne: !group.readonly()});\n }\n } else {\n this.listBehavior.goto(item);\n }\n }\n\n /** Handles keydown events for the toolbar. */\n onKeydown(event: KeyboardEvent) {\n if (!this.disabled()) {\n this.keydown().handle(event);\n }\n }\n\n /** Handles pointerdown events for the toolbar. */\n onPointerdown(event: PointerEvent) {\n if (!this.disabled()) {\n this.pointerdown().handle(event);\n }\n }\n\n /** Finds the Toolbar Widget associated with a pointer event target. */\n private _getItem(e: PointerEvent): RadioButtonPattern<V> | ToolbarWidgetPattern | undefined {\n if (!(e.target instanceof HTMLElement)) {\n return undefined;\n }\n\n // Assumes the target or its ancestor has role=\"radio\" or role=\"button\"\n const element = e.target.closest('[role=\"button\"], [role=\"radio\"]');\n return this.inputs.items().find(i => i.element() === element);\n }\n\n constructor(readonly inputs: ToolbarInputs<V>) {\n this.orientation = inputs.orientation;\n\n this.listBehavior = new List({\n ...inputs,\n multi: () => false,\n selectionMode: () => 'explicit',\n value: signal([] as any),\n typeaheadDelay: () => 0, // Toolbar widgets do not support typeahead.\n });\n }\n\n /**\n * Sets the toolbar to its default initial state.\n *\n * Sets the active index to the selected widget if one exists and is focusable.\n * Otherwise, sets the active index to the first focusable widget.\n */\n setDefaultState() {\n let firstItem: RadioButtonPattern<V> | ToolbarWidgetPattern | null = null;\n\n for (const item of this.inputs.items()) {\n if (this.listBehavior.isFocusable(item)) {\n if (!firstItem) {\n firstItem = item;\n }\n if (item instanceof RadioButtonPattern && item.selected()) {\n this.inputs.activeItem.set(item);\n return;\n }\n }\n }\n\n if (firstItem) {\n this.inputs.activeItem.set(firstItem);\n }\n }\n\n /** Validates the state of the toolbar and returns a list of accessibility violations. */\n validate(): string[] {\n const violations: string[] = [];\n\n if (this.inputs.skipDisabled()) {\n for (const item of this.inputs.items()) {\n if (item instanceof RadioButtonPattern && item.selected() && item.disabled()) {\n violations.push(\n \"Accessibility Violation: A selected radio button inside the toolbar is disabled while 'skipDisabled' is true, making the selection unreachable via keyboard.\",\n );\n }\n }\n }\n return violations;\n }\n}\n\n/** Represents the required inputs for a toolbar widget in a toolbar. */\nexport interface ToolbarWidgetInputs extends Omit<ListItem<any>, 'searchTerm' | 'value' | 'index'> {\n /** A reference to the parent toolbar. */\n parentToolbar: SignalLike<ToolbarPattern<null>>;\n}\n\nexport class ToolbarWidgetPattern {\n /** A unique identifier for the widget. */\n id: SignalLike<string>;\n\n /** The html element that should receive focus. */\n readonly element: SignalLike<HTMLElement>;\n\n /** Whether the widget is disabled. */\n disabled: SignalLike<boolean>;\n\n /** A reference to the parent toolbar. */\n parentToolbar: SignalLike<ToolbarPattern<null> | undefined>;\n\n /** The tabindex of the widgdet. */\n tabindex = computed(() => this.inputs.parentToolbar().listBehavior.getItemTabindex(this));\n\n /** The text used by the typeahead search. */\n readonly searchTerm = () => ''; // Unused because toolbar does not support typeahead.\n\n /** The value associated with the widget. */\n readonly value = () => '' as any; // Unused because toolbar does not support selection.\n\n /** The position of the widget within the toolbar. */\n index = computed(() => this.parentToolbar()?.inputs.items().indexOf(this) ?? -1);\n\n /** Whether the widget is currently the active one (focused). */\n active = computed(() => this.parentToolbar()?.inputs.activeItem() === this);\n\n constructor(readonly inputs: ToolbarWidgetInputs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AAM,CAAC,OAAO;AAC7B,QAAA,IAAI,CAAC,QAAQ,GAAG,MAAM,CAAC,QAAQ;AAC/B,QAAA,IAAI,CAAC,aAAa,GAAG,MAAM,CAAC,aAAa;;AAE5C;;;;"}
1
+ {"version":3,"file":"toolbar2.mjs","sources":["../../../../../darwin_arm64-fastbuild-ST-199a4f3c4e20/bin/src/cdk-experimental/ui-patterns/radio-group/radio-button.ts","../../../../../darwin_arm64-fastbuild-ST-199a4f3c4e20/bin/src/cdk-experimental/ui-patterns/toolbar/toolbar.ts"],"sourcesContent":["/**\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.dev/license\n */\n\nimport {computed} from '@angular/core';\nimport {SignalLike} from '../behaviors/signal-like/signal-like';\nimport {List, ListItem} from '../behaviors/list/list';\n\n/**\n * Represents the properties exposed by a toolbar widget that need to be accessed by a radio group.\n * This exists to avoid circular dependency errors between the toolbar and radio button.\n */\ntype ToolbarWidgetLike = {\n id: SignalLike<string>;\n index: SignalLike<number>;\n element: SignalLike<HTMLElement>;\n disabled: SignalLike<boolean>;\n searchTerm: SignalLike<any>;\n value: SignalLike<any>;\n};\n\n/**\n * Represents the properties exposed by a radio group that need to be accessed by a radio button.\n * This exists to avoid circular dependency errors between the radio group and radio button.\n */\ninterface RadioGroupLike<V> {\n /** The list behavior for the radio group. */\n listBehavior: List<RadioButtonPattern<V> | ToolbarWidgetLike, V>;\n /** Whether the list is readonly */\n readonly: SignalLike<boolean>;\n /** Whether the radio group is disabled. */\n disabled: SignalLike<boolean>;\n}\n\n/** Represents the required inputs for a radio button in a radio group. */\nexport interface RadioButtonInputs<V> extends Omit<ListItem<V>, 'searchTerm' | 'index'> {\n /** A reference to the parent radio group. */\n group: SignalLike<RadioGroupLike<V> | undefined>;\n}\n\n/** Represents a radio button within a radio group. */\nexport class RadioButtonPattern<V> {\n /** A unique identifier for the radio button. */\n id: SignalLike<string>;\n\n /** The value associated with the radio button. */\n value: SignalLike<V>;\n\n /** The position of the radio button within the group. */\n index: SignalLike<number> = computed(\n () => this.group()?.listBehavior.inputs.items().indexOf(this) ?? -1,\n );\n\n /** Whether the radio button is currently the active one (focused). */\n active = computed(() => this.group()?.listBehavior.inputs.activeItem() === this);\n\n /** Whether the radio button is selected. */\n selected: SignalLike<boolean> = computed(\n () => !!this.group()?.listBehavior.inputs.value().includes(this.value()),\n );\n\n /** Whether the radio button is disabled. */\n disabled: SignalLike<boolean>;\n\n /** A reference to the parent radio group. */\n group: SignalLike<RadioGroupLike<V> | undefined>;\n\n /** The tabindex of the radio button. */\n tabindex = computed(() => this.group()?.listBehavior.getItemTabindex(this));\n\n /** The HTML element associated with the radio button. */\n element: SignalLike<HTMLElement>;\n\n /** The search term for typeahead. */\n readonly searchTerm = () => ''; // Radio groups do not support typeahead.\n\n constructor(readonly inputs: RadioButtonInputs<V>) {\n this.id = inputs.id;\n this.value = inputs.value;\n this.group = inputs.group;\n this.element = inputs.element;\n this.disabled = inputs.disabled;\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.dev/license\n */\n\nimport {computed, signal} from '@angular/core';\nimport {KeyboardEventManager, PointerEventManager} from '../behaviors/event-manager';\nimport {SignalLike} from '../behaviors/signal-like/signal-like';\nimport {RadioButtonPattern} from '../radio-group/radio-button';\nimport {List, ListInputs, ListItem} from '../behaviors/list/list';\n\n/** Represents the required inputs for a toolbar. */\nexport type ToolbarInputs<V> = Omit<\n ListInputs<ToolbarWidgetPattern | RadioButtonPattern<V>, V>,\n 'multi' | 'typeaheadDelay' | 'value' | 'selectionMode'\n>;\n\n/** Controls the state of a toolbar. */\nexport class ToolbarPattern<V> {\n /** The list behavior for the toolbar. */\n listBehavior: List<ToolbarWidgetPattern | RadioButtonPattern<V>, V>;\n\n /** Whether the tablist is vertically or horizontally oriented. */\n readonly orientation: SignalLike<'vertical' | 'horizontal'>;\n\n /** Whether the toolbar is disabled. */\n disabled = computed(() => this.listBehavior.disabled());\n\n /** The tabindex of the toolbar (if using activedescendant). */\n tabindex = computed(() => this.listBehavior.tabindex());\n\n /** The id of the current active widget (if using activedescendant). */\n activedescendant = computed(() => this.listBehavior.activedescendant());\n\n /** The key used to navigate to the previous widget. */\n prevKey = computed(() => {\n if (this.inputs.orientation() === 'vertical') {\n return 'ArrowUp';\n }\n return this.inputs.textDirection() === 'rtl' ? 'ArrowRight' : 'ArrowLeft';\n });\n\n /** The key used to navigate to the next widget. */\n nextKey = computed(() => {\n if (this.inputs.orientation() === 'vertical') {\n return 'ArrowDown';\n }\n return this.inputs.textDirection() === 'rtl' ? 'ArrowLeft' : 'ArrowRight';\n });\n\n /** The alternate key used to navigate to the previous widget */\n altPrevKey = computed(() => {\n if (this.inputs.orientation() === 'vertical') {\n return this.inputs.textDirection() === 'rtl' ? 'ArrowRight' : 'ArrowLeft';\n }\n return 'ArrowUp';\n });\n\n /** The alternate key used to navigate to the next widget. */\n altNextKey = computed(() => {\n if (this.inputs.orientation() === 'vertical') {\n return this.inputs.textDirection() === 'rtl' ? 'ArrowLeft' : 'ArrowRight';\n }\n return 'ArrowDown';\n });\n\n /** The keydown event manager for the toolbar. */\n keydown = computed(() => {\n const manager = new KeyboardEventManager();\n\n const activeItem = this.inputs.activeItem();\n const isRadioButton = activeItem instanceof RadioButtonPattern;\n\n if (isRadioButton) {\n manager\n .on(' ', () => this.selectRadioButton())\n .on('Enter', () => this.selectRadioButton())\n .on(this.altNextKey, () => activeItem?.group()?.listBehavior.next())\n .on(this.altPrevKey, () => activeItem?.group()?.listBehavior.prev());\n } else {\n manager.on(this.altNextKey, () => this.listBehavior.next());\n manager.on(this.altPrevKey, () => this.listBehavior.prev());\n }\n\n return manager\n .on(this.prevKey, () => this.listBehavior.prev())\n .on(this.nextKey, () => this.listBehavior.next())\n .on('Home', () => this.listBehavior.first())\n .on('End', () => this.listBehavior.last());\n });\n\n selectRadioButton() {\n const activeItem = this.inputs.activeItem() as RadioButtonPattern<V>;\n\n // activeItem must be a radio button\n const group = activeItem!.group();\n if (group && !group.readonly() && !group.disabled()) {\n group.listBehavior.selectOne();\n }\n }\n\n /** The pointerdown event manager for the toolbar. */\n pointerdown = computed(() => new PointerEventManager().on(e => this.goto(e)));\n\n /** Navigates to the widget associated with the given pointer event. */\n goto(event: PointerEvent) {\n const item = this._getItem(event);\n if (!item) return;\n\n if (item instanceof RadioButtonPattern) {\n const group = item.group();\n if (group && !group.disabled()) {\n group.listBehavior.goto(item, {selectOne: !group.readonly()});\n }\n } else {\n this.listBehavior.goto(item);\n }\n }\n\n /** Handles keydown events for the toolbar. */\n onKeydown(event: KeyboardEvent) {\n if (!this.disabled()) {\n this.keydown().handle(event);\n }\n }\n\n /** Handles pointerdown events for the toolbar. */\n onPointerdown(event: PointerEvent) {\n if (!this.disabled()) {\n this.pointerdown().handle(event);\n }\n }\n\n /** Finds the Toolbar Widget associated with a pointer event target. */\n private _getItem(e: PointerEvent): RadioButtonPattern<V> | ToolbarWidgetPattern | undefined {\n if (!(e.target instanceof HTMLElement)) {\n return undefined;\n }\n\n // Assumes the target or its ancestor has role=\"radio\" or role=\"button\"\n const element = e.target.closest('[role=\"button\"], [role=\"radio\"]');\n return this.inputs.items().find(i => i.element() === element);\n }\n\n constructor(readonly inputs: ToolbarInputs<V>) {\n this.orientation = inputs.orientation;\n\n this.listBehavior = new List({\n ...inputs,\n multi: () => false,\n selectionMode: () => 'explicit',\n value: signal([] as any),\n typeaheadDelay: () => 0, // Toolbar widgets do not support typeahead.\n });\n }\n\n /**\n * Sets the toolbar to its default initial state.\n *\n * Sets the active index to the selected widget if one exists and is focusable.\n * Otherwise, sets the active index to the first focusable widget.\n */\n setDefaultState() {\n let firstItem: RadioButtonPattern<V> | ToolbarWidgetPattern | null = null;\n\n for (const item of this.inputs.items()) {\n if (this.listBehavior.isFocusable(item)) {\n if (!firstItem) {\n firstItem = item;\n }\n if (item instanceof RadioButtonPattern && item.selected()) {\n this.inputs.activeItem.set(item);\n return;\n }\n }\n }\n\n if (firstItem) {\n this.inputs.activeItem.set(firstItem);\n }\n }\n\n /** Validates the state of the toolbar and returns a list of accessibility violations. */\n validate(): string[] {\n const violations: string[] = [];\n\n if (this.inputs.skipDisabled()) {\n for (const item of this.inputs.items()) {\n if (item instanceof RadioButtonPattern && item.selected() && item.disabled()) {\n violations.push(\n \"Accessibility Violation: A selected radio button inside the toolbar is disabled while 'skipDisabled' is true, making the selection unreachable via keyboard.\",\n );\n }\n }\n }\n return violations;\n }\n}\n\n/** Represents the required inputs for a toolbar widget in a toolbar. */\nexport interface ToolbarWidgetInputs extends Omit<ListItem<any>, 'searchTerm' | 'value' | 'index'> {\n /** A reference to the parent toolbar. */\n parentToolbar: SignalLike<ToolbarPattern<null>>;\n}\n\nexport class ToolbarWidgetPattern {\n /** A unique identifier for the widget. */\n id: SignalLike<string>;\n\n /** The html element that should receive focus. */\n readonly element: SignalLike<HTMLElement>;\n\n /** Whether the widget is disabled. */\n disabled: SignalLike<boolean>;\n\n /** A reference to the parent toolbar. */\n parentToolbar: SignalLike<ToolbarPattern<null> | undefined>;\n\n /** The tabindex of the widgdet. */\n tabindex = computed(() => this.inputs.parentToolbar().listBehavior.getItemTabindex(this));\n\n /** The text used by the typeahead search. */\n readonly searchTerm = () => ''; // Unused because toolbar does not support typeahead.\n\n /** The value associated with the widget. */\n readonly value = () => '' as any; // Unused because toolbar does not support selection.\n\n /** The position of the widget within the toolbar. */\n index = computed(() => this.parentToolbar()?.inputs.items().indexOf(this) ?? -1);\n\n /** Whether the widget is currently the active one (focused). */\n active = computed(() => this.parentToolbar()?.inputs.activeItem() === this);\n\n constructor(readonly inputs: ToolbarWidgetInputs) {\n this.id = inputs.id;\n this.element = inputs.element;\n this.disabled = inputs.disabled;\n this.parentToolbar = inputs.parentToolbar;\n }\n}\n"],"names":[],"mappings":";;;;AA4CA;MACa,kBAAkB,CAAA;AAmCR,IAAA,MAAA;;AAjCr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