@angular/cdk-experimental 20.0.0-next.7 → 20.0.0-next.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.
- package/column-resize/index.d.ts +39 -5
- package/combobox/index.d.ts +2 -2
- package/fesm2022/cdk-experimental.mjs +1 -1
- package/fesm2022/cdk-experimental.mjs.map +1 -1
- package/fesm2022/column-resize.mjs +77 -10
- package/fesm2022/column-resize.mjs.map +1 -1
- package/fesm2022/combobox.mjs +9 -12
- package/fesm2022/combobox.mjs.map +1 -1
- package/fesm2022/deferred-content.mjs +1 -1
- package/fesm2022/{list-focus-DtTH4bDx.mjs → list-focus-Di7m_z_6.mjs} +112 -88
- package/fesm2022/list-focus-Di7m_z_6.mjs.map +1 -0
- package/fesm2022/listbox.mjs +29 -9
- package/fesm2022/listbox.mjs.map +1 -1
- package/fesm2022/{option-Bgpacz3g.mjs → option-f_gNslw8.mjs} +127 -79
- package/fesm2022/option-f_gNslw8.mjs.map +1 -0
- package/fesm2022/{polyfill-DRXnWbMt.mjs → polyfill-CXksG4af.mjs} +2 -2
- package/fesm2022/{polyfill-DRXnWbMt.mjs.map → polyfill-CXksG4af.mjs.map} +1 -1
- package/fesm2022/popover-edit.mjs +13 -11
- package/fesm2022/popover-edit.mjs.map +1 -1
- package/fesm2022/scrolling.mjs +1 -1
- package/fesm2022/selection.mjs +2 -2
- package/fesm2022/table-scroll-container.mjs +1 -2
- package/fesm2022/table-scroll-container.mjs.map +1 -1
- package/fesm2022/{tabs-cBelBNjZ.mjs → tabs-BunANY1M.mjs} +17 -31
- package/fesm2022/tabs-BunANY1M.mjs.map +1 -0
- package/fesm2022/tabs.mjs +5 -4
- package/fesm2022/tabs.mjs.map +1 -1
- package/fesm2022/ui-patterns.mjs +3 -3
- package/{list-focus.d-1SGksIi8.d.ts → list-navigation.d-DfOSxsSp.d.ts} +90 -81
- package/listbox/index.d.ts +15 -6
- package/{listbox.d-C-LFh0S9.d.ts → listbox.d-QWPLmxRe.d.ts} +54 -21
- package/package.json +2 -2
- package/popover-edit/index.d.ts +2 -2
- package/tabs/index.d.ts +2 -2
- package/{tabs.d-BIIDt2Rf.d.ts → tabs.d-BAo141mw.d.ts} +6 -3
- package/ui-patterns/index.d.ts +3 -3
- package/fesm2022/list-focus-DtTH4bDx.mjs.map +0 -1
- package/fesm2022/option-Bgpacz3g.mjs.map +0 -1
- package/fesm2022/tabs-cBelBNjZ.mjs.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tabs-BunANY1M.mjs","sources":["../../../../../darwin_arm64-fastbuild-ST-46c76129e412/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 */\n\nimport {computed, signal} from '@angular/core';\n\nimport {KeyboardEventManager} from '../behaviors/event-manager/keyboard-event-manager';\nimport {PointerEventManager} from '../behaviors/event-manager/pointer-event-manager';\nimport {ListFocus, ListFocusInputs, ListFocusItem} from '../behaviors/list-focus/list-focus';\nimport {\n ListNavigation,\n ListNavigationInputs,\n ListNavigationItem,\n} from '../behaviors/list-navigation/list-navigation';\nimport {\n ListSelection,\n ListSelectionInputs,\n ListSelectionItem,\n} from '../behaviors/list-selection/list-selection';\nimport {SignalLike} from '../behaviors/signal-like/signal-like';\n\n/** The required inputs to tabs. */\nexport interface TabInputs extends ListNavigationItem, ListSelectionItem<string>, ListFocusItem {\n tablist: SignalLike<TabListPattern>;\n tabpanel: SignalLike<TabPanelPattern | undefined>;\n}\n\n/** A tab in a tablist. */\nexport class TabPattern {\n /** A global unique identifier for the tab. */\n id: SignalLike<string>;\n\n /** A local unique identifier for the tab. */\n value: SignalLike<string>;\n\n /** Whether the tab is active. */\n active = computed(() => this.tablist()?.focusManager.activeItem() === this);\n\n /** Whether the tab is selected. */\n selected = computed(() => this.tablist().selection.inputs.value().includes(this.value()));\n\n /** A Tabpanel Id controlled by the tab. */\n controls = computed(() => this.tabpanel()?.id());\n\n /** Whether the tab is disabled. */\n disabled: SignalLike<boolean>;\n\n /** A reference to the parent tablist. */\n tablist: SignalLike<TabListPattern>;\n\n /** A reference to the corresponding tabpanel. */\n tabpanel: SignalLike<TabPanelPattern | undefined>;\n\n /** The tabindex of the tab. */\n tabindex = computed(() => this.tablist().focusManager.getItemTabindex(this));\n\n /** The html element that should receive focus. */\n element: SignalLike<HTMLElement>;\n\n constructor(inputs: TabInputs) {\n this.id = inputs.id;\n this.value = inputs.value;\n this.tablist = inputs.tablist;\n this.tabpanel = inputs.tabpanel;\n this.element = inputs.element;\n this.disabled = inputs.disabled;\n }\n}\n\n/** The selection operations that the tablist can perform. */\ninterface SelectOptions {\n select?: boolean;\n toggle?: boolean;\n toggleOne?: boolean;\n selectOne?: boolean;\n}\n\n/** The required inputs for the tablist. */\nexport type TabListInputs = ListNavigationInputs<TabPattern> &\n Omit<ListSelectionInputs<TabPattern, string>, 'multi'> &\n ListFocusInputs<TabPattern> & {\n disabled: SignalLike<boolean>;\n };\n\n/** The required inputs for the tabpanel. */\nexport interface TabPanelInputs {\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 id: SignalLike<string>;\n\n /** A local unique identifier for the tabpanel. */\n value: SignalLike<string>;\n\n /** A reference to the corresponding tab. */\n tab: SignalLike<TabPattern | undefined>;\n\n /** Whether the tabpanel is hidden. */\n hidden = computed(() => !this.tab()?.selected());\n\n constructor(inputs: TabPanelInputs) {\n this.id = inputs.id;\n this.value = inputs.value;\n this.tab = inputs.tab;\n }\n}\n\n/** Controls the state of a tablist. */\nexport class TabListPattern {\n /** Controls navigation for the tablist. */\n navigation: ListNavigation<TabPattern>;\n\n /** Controls selection for the tablist. */\n selection: ListSelection<TabPattern, string>;\n\n /** Controls focus for the tablist. */\n focusManager: ListFocus<TabPattern>;\n\n /** Whether the tablist is vertically or horizontally oriented. */\n orientation: SignalLike<'vertical' | 'horizontal'>;\n\n /** Whether the tablist is disabled. */\n disabled: SignalLike<boolean>;\n\n /** The tabindex of the tablist. */\n tabindex = computed(() => this.focusManager.getListTabindex());\n\n /** The id of the current active tab. */\n activedescendant = computed(() => this.focusManager.getActiveDescendant());\n\n /** Whether selection should follow focus. */\n followFocus = computed(() => this.inputs.selectionMode() === 'follow');\n\n /** The key used to navigate to the previous tab in the tablist. */\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 item in the list. */\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 keydown event manager for the tablist. */\n keydown = computed(() => {\n const manager = new KeyboardEventManager()\n .on(this.prevKey, () => this.prev({selectOne: this.followFocus()}))\n .on(this.nextKey, () => this.next({selectOne: this.followFocus()}))\n .on('Home', () => this.first({selectOne: this.followFocus()}))\n .on('End', () => this.last({selectOne: this.followFocus()}))\n .on(' ', () => this.selection.selectOne())\n .on('Enter', () => this.selection.selectOne());\n\n return manager;\n });\n\n /** The pointerdown event manager for the tablist. */\n pointerdown = computed(() => {\n return new PointerEventManager().on(e => this.goto(e, {selectOne: true}));\n });\n\n constructor(readonly inputs: TabListInputs) {\n this.disabled = inputs.disabled;\n this.orientation = inputs.orientation;\n\n this.focusManager = new ListFocus(inputs);\n this.navigation = new ListNavigation({...inputs, focusManager: this.focusManager});\n this.selection = new ListSelection({\n ...inputs,\n multi: signal(false),\n focusManager: this.focusManager,\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 /** Navigates to the first option in the tablist. */\n first(opts?: SelectOptions) {\n this.navigation.first();\n this._updateSelection(opts);\n }\n\n /** Navigates to the last option in the tablist. */\n last(opts?: SelectOptions) {\n this.navigation.last();\n this._updateSelection(opts);\n }\n\n /** Navigates to the next option in the tablist. */\n next(opts?: SelectOptions) {\n this.navigation.next();\n this._updateSelection(opts);\n }\n\n /** Navigates to the previous option in the tablist. */\n prev(opts?: SelectOptions) {\n this.navigation.prev();\n this._updateSelection(opts);\n }\n\n /** Navigates to the given item in the tablist. */\n goto(event: PointerEvent, opts?: SelectOptions) {\n const item = this._getItem(event);\n\n if (item) {\n this.navigation.goto(item);\n this._updateSelection(opts);\n }\n }\n\n /** Handles updating selection for the tablist. */\n private _updateSelection(opts?: SelectOptions) {\n if (opts?.select) {\n this.selection.select();\n }\n if (opts?.toggle) {\n this.selection.toggle();\n }\n if (opts?.toggleOne) {\n this.selection.toggleOne();\n }\n if (opts?.selectOne) {\n this.selection.selectOne();\n }\n }\n\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":";;;AA+BA;MACa,UAAU,CAAA;;AAErB,IAAA,EAAE;;AAGF,IAAA,KAAK;;AAGL,IAAA,MAAM,GAAG,QAAQ,CAAC,MAAM,IAAI,CAAC,OAAO,EAAE,EAAE,YAAY,CAAC,UAAU,EAAE,KAAK,IAAI,CAAC;;IAG3E,QAAQ,GAAG,QAAQ,CAAC,MAAM,IAAI,CAAC,OAAO,EAAE,CAAC,SAAS,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC,CAAC;;AAGzF,IAAA,QAAQ,GAAG,QAAQ,CAAC,MAA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;AAE5B,QAAA,IAAI,IAAI,EAAE,SAAS,EAAE;AACnB,YAAA,IAAI,CAAC,SAAS,CAAC,SAAS,EAAE;;;AAItB,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;;;;"}
|
package/fesm2022/tabs.mjs
CHANGED
|
@@ -3,10 +3,10 @@ import { DeferredContentAware, DeferredContent } from '@angular/cdk-experimental
|
|
|
3
3
|
import { _IdGenerator } from '@angular/cdk/a11y';
|
|
4
4
|
import { Directionality } from '@angular/cdk/bidi';
|
|
5
5
|
import * as i0 from '@angular/core';
|
|
6
|
-
import { contentChild, contentChildren, computed, inject, input, booleanAttribute, model, signal, ElementRef, effect
|
|
6
|
+
import { contentChild, contentChildren, computed, Directive, inject, input, booleanAttribute, model, signal, ElementRef, effect } from '@angular/core';
|
|
7
7
|
import { toSignal } from '@angular/core/rxjs-interop';
|
|
8
|
-
import { TabListPattern, TabPattern, TabPanelPattern } from './tabs-
|
|
9
|
-
import './list-focus-
|
|
8
|
+
import { T as TabListPattern, a as TabPattern, b as TabPanelPattern } from './tabs-BunANY1M.mjs';
|
|
9
|
+
import './list-focus-Di7m_z_6.mjs';
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
12
|
* A Tabs container.
|
|
@@ -135,7 +135,7 @@ class CdkTab {
|
|
|
135
135
|
value: this.value,
|
|
136
136
|
});
|
|
137
137
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0-next.5", ngImport: i0, type: CdkTab, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
138
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.0.0-next.5", type: CdkTab, isStandalone: true, selector: "[cdkTab]", inputs: { disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: true, transformFunction: null } }, host: { attributes: { "role": "tab" }, properties: { "attr.id": "pattern.id()", "attr.tabindex": "pattern.tabindex()", "attr.aria-selected": "pattern.selected()", "attr.aria-disabled": "pattern.disabled()", "attr.aria-controls": "pattern.controls()" }, classAttribute: "cdk-tab" }, exportAs: ["cdkTab"], ngImport: i0 });
|
|
138
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.0.0-next.5", type: CdkTab, isStandalone: true, selector: "[cdkTab]", inputs: { disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: true, transformFunction: null } }, host: { attributes: { "role": "tab" }, properties: { "class.cdk-active": "pattern.active()", "attr.id": "pattern.id()", "attr.tabindex": "pattern.tabindex()", "attr.aria-selected": "pattern.selected()", "attr.aria-disabled": "pattern.disabled()", "attr.aria-controls": "pattern.controls()" }, classAttribute: "cdk-tab" }, exportAs: ["cdkTab"], ngImport: i0 });
|
|
139
139
|
}
|
|
140
140
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0-next.5", ngImport: i0, type: CdkTab, decorators: [{
|
|
141
141
|
type: Directive,
|
|
@@ -145,6 +145,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0-next.5",
|
|
|
145
145
|
host: {
|
|
146
146
|
'role': 'tab',
|
|
147
147
|
'class': 'cdk-tab',
|
|
148
|
+
'[class.cdk-active]': 'pattern.active()',
|
|
148
149
|
'[attr.id]': 'pattern.id()',
|
|
149
150
|
'[attr.tabindex]': 'pattern.tabindex()',
|
|
150
151
|
'[attr.aria-selected]': 'pattern.selected()',
|
package/fesm2022/tabs.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tabs.mjs","sources":["../../../../../darwin_arm64-fastbuild-ST-46c76129e412/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 contentChild,\n contentChildren,\n Directive,\n effect,\n ElementRef,\n inject,\n input,\n model,\n signal,\n} from '@angular/core';\nimport {toSignal} from '@angular/core/rxjs-interop';\nimport {TabListPattern, TabPanelPattern, TabPattern} from '../ui-patterns';\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>Tab 1</li>\n * <li cdkTab>Tab 2</li>\n * <li cdkTab>Tab 3</li>\n * </ul>\n *\n * <div cdkTabPanel>Tab content 1</div>\n * <div cdkTabPanel>Tab content 2</div>\n * <div cdkTabPanel>Tab content 3</div>\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 _cdkTabList = contentChild(CdkTabList);\n\n /** The CdkTabPanels nested inside of the container. */\n private readonly _cdkTabPanels = contentChildren(CdkTabPanel);\n\n /** The Tab UIPattern of the child Tabs. */\n tabs = computed(() => this._cdkTabList()?.tabs());\n\n /** The TabPanel UIPattern of the child TabPanels. */\n tabpanels = computed(() => this._cdkTabPanels().map(tabpanel => tabpanel.pattern));\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 },\n})\nexport class CdkTabList {\n /** The directionality (LTR / RTL) context for the application (or a subtree of it). */\n private readonly _directionality = inject(Directionality);\n\n /** The CdkTabs nested inside of the CdkTabList. */\n private readonly _cdkTabs = contentChildren(CdkTab);\n\n /** A signal wrapper for directionality. */\n protected textDirection = toSignal(this._directionality.change, {\n initialValue: this._directionality.value,\n });\n\n /** The Tab UIPatterns of the child Tabs. */\n tabs = computed(() => this._cdkTabs().map(tab => tab.pattern));\n\n /** Whether the tablist is vertically or horizontally oriented. */\n orientation = input<'vertical' | 'horizontal'>('horizontal');\n\n /** Whether focus should wrap when navigating. */\n wrap = input(true, {transform: booleanAttribute});\n\n /** Whether disabled items in the list should be skipped when navigating. */\n skipDisabled = input(true, {transform: booleanAttribute});\n\n /** The focus strategy used by the tablist. */\n focusMode = input<'roving' | 'activedescendant'>('roving');\n\n /** The selection strategy used by the tablist. */\n selectionMode = input<'follow' | 'explicit'>('follow');\n\n /** Whether the tablist is disabled. */\n disabled = input(false, {transform: booleanAttribute});\n\n /** The current index that has been navigated to. */\n activeIndex = model<number>(0);\n\n /** The TabList UIPattern. */\n pattern: TabListPattern = new TabListPattern({\n ...this,\n items: this.tabs,\n textDirection: this.textDirection,\n value: signal<string[]>([]),\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 '[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 {\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 parent TabList UIPattern. */\n protected tablist = computed(() => this._cdkTabList.pattern);\n\n /** The TabPanel UIPattern associated with the tab */\n protected tabpanel = computed(() =>\n this._cdkTabs.tabpanels().find(tabpanel => tabpanel.value() === this.value()),\n );\n\n /** Whether a tab is disabled. */\n disabled = input(false, {transform: booleanAttribute});\n\n /** A local unique identifier for the tab. */\n value = input.required<string>();\n\n /** The Tab UIPattern. */\n pattern: TabPattern = new TabPattern({\n ...this,\n id: () => this._id,\n element: () => this._elementRef.nativeElement,\n tablist: this.tablist,\n tabpanel: this.tabpanel,\n value: this.value,\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 'tabindex': '0',\n 'class': 'cdk-tabpanel',\n '[attr.id]': 'pattern.id()',\n '[attr.inert]': 'pattern.hidden() ? true : null',\n },\n hostDirectives: [\n {\n directive: DeferredContentAware,\n inputs: ['preserveContent'],\n },\n ],\n})\nexport class CdkTabPanel {\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 protected tab = computed(() => this._cdkTabs.tabs()?.find(tab => tab.value() === this.value()));\n\n /** A local unique identifier for the tabpanel. */\n value = input.required<string>();\n\n /** The TabPanel UIPattern. */\n pattern: TabPanelPattern = new TabPanelPattern({\n ...this,\n id: () => this._id,\n tab: this.tab,\n });\n\n constructor() {\n effect(() => this._deferredContentAware.contentVisible.set(!this.pattern.hidden()));\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":";;;;;;;;;;AA2BA;;;;;;;;;;;;;;;;;;;AAmBG;MAQU,OAAO,CAAA;;AAED,IAAA,WAAW,GAAG,YAAY,CAAC,UAAU,CAAC;;AAGtC,IAAA,aAAa,GAAG,eAAe,CAAC,WAAW,CAAC;;AAG7D,IAAA,IAAI,GAAG,QAAQ,CAAC,MAAM,IAAI,CAAC,WAAW,EAAE,EAAE,IAAI,EAAE,CAAC;;IAGjD,SAAS,GAAG,QAAQ,CAAC,MAAM,IAAI,CAAC,aAAa,EAAE,CAAC,GAAG,CAAC,QAAQ,IAAI,QAAQ,CAAC,OAAO,CAAC,CAAC;8GAXvE,OAAO,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;kGAAP,OAAO,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,WAAA,EAAA,IAAA,EAAA,EAAA,cAAA,EAAA,UAAA,EAAA,EAAA,OAAA,EAAA,CAAA,EAAA,YAAA,EAAA,aAAA,EAAA,KAAA,EAAA,IAAA,EAAA,SAAA,EAE0B,UAAU,EAAA,WAAA,EAAA,IAAA,EAAA,QAA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AA,MAAM,EAAE,UAAU;AAClB,wBAAA,UAAU,EAAE,GAAG;AACf,wBAAA,OAAO,EAAE,cAAc;AACvB,wBAAA,WAAW,EAAE,cAAc;AAC3B,wBAAA,cAAc,EAAE,gCAAgC;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;;AA6BD;;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
|
+
{"version":3,"file":"tabs.mjs","sources":["../../../../../darwin_arm64-fastbuild-ST-46c76129e412/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 contentChild,\n contentChildren,\n Directive,\n effect,\n ElementRef,\n inject,\n input,\n model,\n signal,\n} from '@angular/core';\nimport {toSignal} from '@angular/core/rxjs-interop';\nimport {TabListPattern, TabPanelPattern, TabPattern} from '../ui-patterns';\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>Tab 1</li>\n * <li cdkTab>Tab 2</li>\n * <li cdkTab>Tab 3</li>\n * </ul>\n *\n * <div cdkTabPanel>Tab content 1</div>\n * <div cdkTabPanel>Tab content 2</div>\n * <div cdkTabPanel>Tab content 3</div>\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 _cdkTabList = contentChild(CdkTabList);\n\n /** The CdkTabPanels nested inside of the container. */\n private readonly _cdkTabPanels = contentChildren(CdkTabPanel);\n\n /** The Tab UIPattern of the child Tabs. */\n tabs = computed(() => this._cdkTabList()?.tabs());\n\n /** The TabPanel UIPattern of the child TabPanels. */\n tabpanels = computed(() => this._cdkTabPanels().map(tabpanel => tabpanel.pattern));\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 },\n})\nexport class CdkTabList {\n /** The directionality (LTR / RTL) context for the application (or a subtree of it). */\n private readonly _directionality = inject(Directionality);\n\n /** The CdkTabs nested inside of the CdkTabList. */\n private readonly _cdkTabs = contentChildren(CdkTab);\n\n /** A signal wrapper for directionality. */\n protected textDirection = toSignal(this._directionality.change, {\n initialValue: this._directionality.value,\n });\n\n /** The Tab UIPatterns of the child Tabs. */\n tabs = computed(() => this._cdkTabs().map(tab => tab.pattern));\n\n /** Whether the tablist is vertically or horizontally oriented. */\n orientation = input<'vertical' | 'horizontal'>('horizontal');\n\n /** Whether focus should wrap when navigating. */\n wrap = input(true, {transform: booleanAttribute});\n\n /** Whether disabled items in the list should be skipped when navigating. */\n skipDisabled = input(true, {transform: booleanAttribute});\n\n /** The focus strategy used by the tablist. */\n focusMode = input<'roving' | 'activedescendant'>('roving');\n\n /** The selection strategy used by the tablist. */\n selectionMode = input<'follow' | 'explicit'>('follow');\n\n /** Whether the tablist is disabled. */\n disabled = input(false, {transform: booleanAttribute});\n\n /** The current index that has been navigated to. */\n activeIndex = model<number>(0);\n\n /** The TabList UIPattern. */\n pattern: TabListPattern = new TabListPattern({\n ...this,\n items: this.tabs,\n textDirection: this.textDirection,\n value: signal<string[]>([]),\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 {\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 parent TabList UIPattern. */\n protected tablist = computed(() => this._cdkTabList.pattern);\n\n /** The TabPanel UIPattern associated with the tab */\n protected tabpanel = computed(() =>\n this._cdkTabs.tabpanels().find(tabpanel => tabpanel.value() === this.value()),\n );\n\n /** Whether a tab is disabled. */\n disabled = input(false, {transform: booleanAttribute});\n\n /** A local unique identifier for the tab. */\n value = input.required<string>();\n\n /** The Tab UIPattern. */\n pattern: TabPattern = new TabPattern({\n ...this,\n id: () => this._id,\n element: () => this._elementRef.nativeElement,\n tablist: this.tablist,\n tabpanel: this.tabpanel,\n value: this.value,\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 'tabindex': '0',\n 'class': 'cdk-tabpanel',\n '[attr.id]': 'pattern.id()',\n '[attr.inert]': 'pattern.hidden() ? true : null',\n },\n hostDirectives: [\n {\n directive: DeferredContentAware,\n inputs: ['preserveContent'],\n },\n ],\n})\nexport class CdkTabPanel {\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 protected tab = computed(() => this._cdkTabs.tabs()?.find(tab => tab.value() === this.value()));\n\n /** A local unique identifier for the tabpanel. */\n value = input.required<string>();\n\n /** The TabPanel UIPattern. */\n pattern: TabPanelPattern = new TabPanelPattern({\n ...this,\n id: () => this._id,\n tab: this.tab,\n });\n\n constructor() {\n effect(() => this._deferredContentAware.contentVisible.set(!this.pattern.hidden()));\n }\n}\n\n/**\n * A TabContent container for the lazy-loaded content.\n */\n@Directive({\n selector: 'ng-template[cdkTabContent]',\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,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;;;;;"}
|
package/fesm2022/ui-patterns.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export { ListboxPattern, OptionPattern } from './option-
|
|
2
|
-
export { TabListPattern, TabPanelPattern, TabPattern } from './tabs-
|
|
3
|
-
import './list-focus-
|
|
1
|
+
export { L as ListboxPattern, O as OptionPattern } from './option-f_gNslw8.mjs';
|
|
2
|
+
export { T as TabListPattern, b as TabPanelPattern, a as TabPattern } from './tabs-BunANY1M.mjs';
|
|
3
|
+
import './list-focus-Di7m_z_6.mjs';
|
|
4
4
|
import '@angular/core';
|
|
5
5
|
|
|
6
6
|
/** Converts a getter setter style signal to a WritableSignalLike. */
|
|
@@ -32,7 +32,8 @@ declare enum ModifierKey {
|
|
|
32
32
|
Ctrl = 1,
|
|
33
33
|
Shift = 2,
|
|
34
34
|
Alt = 4,
|
|
35
|
-
Meta = 8
|
|
35
|
+
Meta = 8,
|
|
36
|
+
Any = "Any"
|
|
36
37
|
}
|
|
37
38
|
type ModifierInputs = ModifierKey | ModifierKey[];
|
|
38
39
|
/**
|
|
@@ -102,59 +103,57 @@ declare class PointerEventManager<T extends PointerEvent> extends EventManager<T
|
|
|
102
103
|
_isMatch(event: PointerEvent, button: MouseButton, modifiers: ModifierInputs): boolean;
|
|
103
104
|
}
|
|
104
105
|
|
|
105
|
-
/** Represents an item in a collection, such as a listbox option, than
|
|
106
|
-
interface
|
|
106
|
+
/** Represents an item in a collection, such as a listbox option, than may receive focus. */
|
|
107
|
+
interface ListFocusItem {
|
|
108
|
+
/** A unique identifier for the item. */
|
|
109
|
+
id: SignalLike<string>;
|
|
110
|
+
/** The html element that should receive focus. */
|
|
111
|
+
element: SignalLike<HTMLElement>;
|
|
107
112
|
/** Whether an item is disabled. */
|
|
108
113
|
disabled: SignalLike<boolean>;
|
|
109
114
|
}
|
|
110
|
-
/** Represents the required inputs for a collection that
|
|
111
|
-
interface
|
|
112
|
-
/**
|
|
113
|
-
|
|
115
|
+
/** Represents the required inputs for a collection that contains focusable items. */
|
|
116
|
+
interface ListFocusInputs<T extends ListFocusItem> {
|
|
117
|
+
/** The focus strategy used by the list. */
|
|
118
|
+
focusMode: SignalLike<'roving' | 'activedescendant'>;
|
|
119
|
+
/** Whether the list is disabled. */
|
|
120
|
+
disabled: SignalLike<boolean>;
|
|
114
121
|
/** The items in the list. */
|
|
115
122
|
items: SignalLike<T[]>;
|
|
123
|
+
/** The index of the current active item. */
|
|
124
|
+
activeIndex: WritableSignalLike<number>;
|
|
116
125
|
/** Whether disabled items in the list should be skipped when navigating. */
|
|
117
126
|
skipDisabled: SignalLike<boolean>;
|
|
118
|
-
/** The current index that has been navigated to. */
|
|
119
|
-
activeIndex: WritableSignalLike<number>;
|
|
120
|
-
/** Whether the list is vertically or horizontally oriented. */
|
|
121
|
-
orientation: SignalLike<'vertical' | 'horizontal'>;
|
|
122
|
-
/** The direction that text is read based on the users locale. */
|
|
123
|
-
textDirection: SignalLike<'rtl' | 'ltr'>;
|
|
124
127
|
}
|
|
125
|
-
/** Controls
|
|
126
|
-
declare class
|
|
127
|
-
readonly inputs:
|
|
128
|
+
/** Controls focus for a list of items. */
|
|
129
|
+
declare class ListFocus<T extends ListFocusItem> {
|
|
130
|
+
readonly inputs: ListFocusInputs<T>;
|
|
128
131
|
/** The last index that was active. */
|
|
129
132
|
prevActiveIndex: i0.WritableSignal<number>;
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
/**
|
|
134
|
-
|
|
135
|
-
/**
|
|
136
|
-
|
|
137
|
-
/**
|
|
138
|
-
|
|
139
|
-
/**
|
|
140
|
-
|
|
133
|
+
/** The current active item. */
|
|
134
|
+
activeItem: i0.Signal<T>;
|
|
135
|
+
constructor(inputs: ListFocusInputs<T>);
|
|
136
|
+
/** Whether the list is in a disabled state. */
|
|
137
|
+
isListDisabled(): boolean;
|
|
138
|
+
/** The id of the current active item. */
|
|
139
|
+
getActiveDescendant(): string | undefined;
|
|
140
|
+
/** The tabindex for the list. */
|
|
141
|
+
getListTabindex(): -1 | 0;
|
|
142
|
+
/** Returns the tabindex for the given item. */
|
|
143
|
+
getItemTabindex(item: T): -1 | 0;
|
|
144
|
+
/** Moves focus to the given item if it is focusable. */
|
|
145
|
+
focus(item: T): boolean;
|
|
141
146
|
/** Returns true if the given item can be navigated to. */
|
|
142
147
|
isFocusable(item: T): boolean;
|
|
143
|
-
/** Advances to the next or previous focusable item in the list based on the given delta. */
|
|
144
|
-
private _advance;
|
|
145
148
|
}
|
|
146
149
|
|
|
147
150
|
/** Represents an item in a collection, such as a listbox option, than can be selected. */
|
|
148
|
-
interface ListSelectionItem<V> extends
|
|
151
|
+
interface ListSelectionItem<V> extends ListFocusItem {
|
|
149
152
|
/** The value of the item. */
|
|
150
153
|
value: SignalLike<V>;
|
|
151
|
-
/** Whether an item is disabled. */
|
|
152
|
-
disabled: SignalLike<boolean>;
|
|
153
154
|
}
|
|
154
155
|
/** Represents the required inputs for a collection that contains selectable items. */
|
|
155
|
-
interface ListSelectionInputs<T extends ListSelectionItem<V>, V> {
|
|
156
|
-
/** The items in the list. */
|
|
157
|
-
items: SignalLike<T[]>;
|
|
156
|
+
interface ListSelectionInputs<T extends ListSelectionItem<V>, V> extends ListFocusInputs<T> {
|
|
158
157
|
/** Whether multiple items in the list can be selected at once. */
|
|
159
158
|
multi: SignalLike<boolean>;
|
|
160
159
|
/** The current value of the list selection. */
|
|
@@ -165,17 +164,19 @@ interface ListSelectionInputs<T extends ListSelectionItem<V>, V> {
|
|
|
165
164
|
/** Controls selection for a list of items. */
|
|
166
165
|
declare class ListSelection<T extends ListSelectionItem<V>, V> {
|
|
167
166
|
readonly inputs: ListSelectionInputs<T, V> & {
|
|
168
|
-
|
|
167
|
+
focusManager: ListFocus<T>;
|
|
169
168
|
};
|
|
170
|
-
/** The
|
|
171
|
-
|
|
172
|
-
/** The
|
|
173
|
-
|
|
169
|
+
/** The start index to use for range selection. */
|
|
170
|
+
rangeStartIndex: i0.WritableSignal<number>;
|
|
171
|
+
/** The end index to use for range selection. */
|
|
172
|
+
rangeEndIndex: i0.WritableSignal<number>;
|
|
174
173
|
constructor(inputs: ListSelectionInputs<T, V> & {
|
|
175
|
-
|
|
174
|
+
focusManager: ListFocus<T>;
|
|
176
175
|
});
|
|
177
176
|
/** Selects the item at the current active index. */
|
|
178
|
-
select(item?:
|
|
177
|
+
select(item?: ListSelectionItem<V>, opts?: {
|
|
178
|
+
anchor: boolean;
|
|
179
|
+
}): void;
|
|
179
180
|
/** Deselects the item at the current active index. */
|
|
180
181
|
deselect(item?: T): void;
|
|
181
182
|
/** Toggles the item at the current active index. */
|
|
@@ -186,53 +187,61 @@ declare class ListSelection<T extends ListSelectionItem<V>, V> {
|
|
|
186
187
|
selectAll(): void;
|
|
187
188
|
/** Deselects all items in the list. */
|
|
188
189
|
deselectAll(): void;
|
|
189
|
-
/**
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
190
|
+
/**
|
|
191
|
+
* Selects all items in the list or deselects all
|
|
192
|
+
* items in the list if all items are already selected.
|
|
193
|
+
*/
|
|
194
|
+
toggleAll(): void;
|
|
193
195
|
/** Sets the selection to only the current active item. */
|
|
194
196
|
selectOne(): void;
|
|
195
|
-
/**
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
197
|
+
/**
|
|
198
|
+
* Selects all items in the list up to the anchor item.
|
|
199
|
+
*
|
|
200
|
+
* Deselects all items that were previously within the
|
|
201
|
+
* selected range that are now outside of the selected range
|
|
202
|
+
*/
|
|
203
|
+
selectRange(opts?: {
|
|
204
|
+
anchor: boolean;
|
|
205
|
+
}): void;
|
|
206
|
+
/** Marks the given index as the start of a range selection. */
|
|
207
|
+
beginRangeSelection(index?: number): void;
|
|
208
|
+
/** Returns the items in the list starting from the given index. */
|
|
202
209
|
private _getItemsFromIndex;
|
|
203
210
|
}
|
|
204
211
|
|
|
205
|
-
/** Represents an item in a collection, such as a listbox option, than
|
|
206
|
-
interface
|
|
207
|
-
/** A unique identifier for the item. */
|
|
208
|
-
id: SignalLike<string>;
|
|
209
|
-
/** The html element that should receive focus. */
|
|
210
|
-
element: SignalLike<HTMLElement>;
|
|
212
|
+
/** Represents an item in a collection, such as a listbox option, than can be navigated to. */
|
|
213
|
+
interface ListNavigationItem extends ListFocusItem {
|
|
211
214
|
}
|
|
212
|
-
/** Represents the required inputs for a collection that
|
|
213
|
-
interface
|
|
214
|
-
/**
|
|
215
|
-
|
|
215
|
+
/** Represents the required inputs for a collection that has navigable items. */
|
|
216
|
+
interface ListNavigationInputs<T extends ListNavigationItem> extends ListFocusInputs<T> {
|
|
217
|
+
/** Whether focus should wrap when navigating. */
|
|
218
|
+
wrap: SignalLike<boolean>;
|
|
219
|
+
/** Whether the list is vertically or horizontally oriented. */
|
|
220
|
+
orientation: SignalLike<'vertical' | 'horizontal'>;
|
|
221
|
+
/** The direction that text is read based on the users locale. */
|
|
222
|
+
textDirection: SignalLike<'rtl' | 'ltr'>;
|
|
216
223
|
}
|
|
217
|
-
/** Controls
|
|
218
|
-
declare class
|
|
219
|
-
readonly inputs:
|
|
220
|
-
|
|
224
|
+
/** Controls navigation for a list of items. */
|
|
225
|
+
declare class ListNavigation<T extends ListNavigationItem> {
|
|
226
|
+
readonly inputs: ListNavigationInputs<T> & {
|
|
227
|
+
focusManager: ListFocus<T>;
|
|
221
228
|
};
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
constructor(inputs: ListFocusInputs<T> & {
|
|
225
|
-
navigation: ListNavigation<T>;
|
|
229
|
+
constructor(inputs: ListNavigationInputs<T> & {
|
|
230
|
+
focusManager: ListFocus<T>;
|
|
226
231
|
});
|
|
227
|
-
/**
|
|
228
|
-
|
|
229
|
-
/**
|
|
230
|
-
|
|
231
|
-
/**
|
|
232
|
-
|
|
233
|
-
/**
|
|
234
|
-
|
|
232
|
+
/** Navigates to the given item. */
|
|
233
|
+
goto(item?: T): boolean;
|
|
234
|
+
/** Navigates to the next item in the list. */
|
|
235
|
+
next(): boolean;
|
|
236
|
+
/** Navigates to the previous item in the list. */
|
|
237
|
+
prev(): boolean;
|
|
238
|
+
/** Navigates to the first item in the list. */
|
|
239
|
+
first(): boolean;
|
|
240
|
+
/** Navigates to the last item in the list. */
|
|
241
|
+
last(): boolean;
|
|
242
|
+
/** Advances to the next or previous focusable item in the list based on the given delta. */
|
|
243
|
+
private _advance;
|
|
235
244
|
}
|
|
236
245
|
|
|
237
|
-
export { KeyboardEventManager,
|
|
238
|
-
export type {
|
|
246
|
+
export { KeyboardEventManager as K, PointerEventManager as P, convertGetterSetterToWritableSignalLike as c, ListNavigation as g, ListSelection as h, ListFocus as i };
|
|
247
|
+
export type { ListNavigationItem as L, SignalLike as S, WritableSignalLike as W, ListSelectionItem as a, ListFocusItem as b, ListNavigationInputs as d, ListSelectionInputs as e, ListFocusInputs as f };
|
package/listbox/index.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
+
import { AfterViewInit } from '@angular/core';
|
|
2
3
|
import * as _angular_cdk_bidi from '@angular/cdk/bidi';
|
|
3
|
-
import { OptionPattern, ListboxPattern } from '../listbox.d-
|
|
4
|
-
import '../list-
|
|
4
|
+
import { b as OptionPattern, a as ListboxPattern } from '../listbox.d-QWPLmxRe.js';
|
|
5
|
+
import '../list-navigation.d-DfOSxsSp.js';
|
|
5
6
|
|
|
6
7
|
/**
|
|
7
8
|
* A listbox container.
|
|
@@ -11,13 +12,13 @@ import '../list-focus.d-1SGksIi8.js';
|
|
|
11
12
|
*
|
|
12
13
|
* ```html
|
|
13
14
|
* <ul cdkListbox>
|
|
14
|
-
* <li cdkOption>Item 1</li>
|
|
15
|
-
* <li cdkOption>Item 2</li>
|
|
16
|
-
* <li cdkOption>Item 3</li>
|
|
15
|
+
* <li [value]="1" cdkOption>Item 1</li>
|
|
16
|
+
* <li [value]="2" cdkOption>Item 2</li>
|
|
17
|
+
* <li [value]="3" cdkOption>Item 3</li>
|
|
17
18
|
* </ul>
|
|
18
19
|
* ```
|
|
19
20
|
*/
|
|
20
|
-
declare class CdkListbox<V> {
|
|
21
|
+
declare class CdkListbox<V> implements AfterViewInit {
|
|
21
22
|
/** The directionality (LTR / RTL) context for the application (or a subtree of it). */
|
|
22
23
|
private readonly _directionality;
|
|
23
24
|
/** The CdkOptions nested inside of the CdkListbox. */
|
|
@@ -50,6 +51,13 @@ declare class CdkListbox<V> {
|
|
|
50
51
|
activeIndex: i0.ModelSignal<number>;
|
|
51
52
|
/** The Listbox UIPattern. */
|
|
52
53
|
pattern: ListboxPattern<V>;
|
|
54
|
+
/** Whether the listbox has received focus yet. */
|
|
55
|
+
private _hasFocused;
|
|
56
|
+
/** Whether the options in the listbox have been initialized. */
|
|
57
|
+
private _isViewInitialized;
|
|
58
|
+
constructor();
|
|
59
|
+
ngAfterViewInit(): void;
|
|
60
|
+
onFocus(): void;
|
|
53
61
|
static ɵfac: i0.ɵɵFactoryDeclaration<CdkListbox<any>, never>;
|
|
54
62
|
static ɵdir: i0.ɵɵDirectiveDeclaration<CdkListbox<any>, "[cdkListbox]", ["cdkListbox"], { "orientation": { "alias": "orientation"; "required": false; "isSignal": true; }; "multi": { "alias": "multi"; "required": false; "isSignal": true; }; "wrap": { "alias": "wrap"; "required": false; "isSignal": true; }; "skipDisabled": { "alias": "skipDisabled"; "required": false; "isSignal": true; }; "focusMode": { "alias": "focusMode"; "required": false; "isSignal": true; }; "selectionMode": { "alias": "selectionMode"; "required": false; "isSignal": true; }; "typeaheadDelay": { "alias": "typeaheadDelay"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "readonly": { "alias": "readonly"; "required": false; "isSignal": true; }; "value": { "alias": "value"; "required": false; "isSignal": true; }; "activeIndex": { "alias": "activeIndex"; "required": false; "isSignal": true; }; }, { "value": "valueChange"; "activeIndex": "activeIndexChange"; }, ["_cdkOptions"], never, true, never>;
|
|
55
63
|
}
|
|
@@ -63,6 +71,7 @@ declare class CdkOption<V> {
|
|
|
63
71
|
private readonly _generatedId;
|
|
64
72
|
/** A unique identifier for the option. */
|
|
65
73
|
protected id: i0.Signal<string>;
|
|
74
|
+
/** The value of the option. */
|
|
66
75
|
protected value: i0.InputSignal<V>;
|
|
67
76
|
/** The text used by the typeahead search. */
|
|
68
77
|
protected searchTerm: i0.Signal<any>;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import {
|
|
2
|
+
import { b as ListFocusItem, S as SignalLike, f as ListFocusInputs, i as ListFocus, L as ListNavigationItem, a as ListSelectionItem, h as ListSelection, g as ListNavigation, d as ListNavigationInputs, e as ListSelectionInputs, K as KeyboardEventManager, P as PointerEventManager } from './list-navigation.d-DfOSxsSp.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Represents an item in a collection, such as a listbox option, than can be navigated to by
|
|
6
6
|
* typeahead.
|
|
7
7
|
*/
|
|
8
|
-
interface ListTypeaheadItem extends
|
|
8
|
+
interface ListTypeaheadItem extends ListFocusItem {
|
|
9
9
|
/** The text used by the typeahead search. */
|
|
10
10
|
searchTerm: SignalLike<string>;
|
|
11
11
|
}
|
|
@@ -13,30 +13,30 @@ interface ListTypeaheadItem extends ListNavigationItem {
|
|
|
13
13
|
* Represents the required inputs for a collection that contains items that can be navigated to by
|
|
14
14
|
* typeahead.
|
|
15
15
|
*/
|
|
16
|
-
interface ListTypeaheadInputs {
|
|
16
|
+
interface ListTypeaheadInputs<T extends ListTypeaheadItem> extends ListFocusInputs<T> {
|
|
17
17
|
/** The amount of time before the typeahead search is reset. */
|
|
18
18
|
typeaheadDelay: SignalLike<number>;
|
|
19
19
|
}
|
|
20
20
|
/** Controls typeahead for a list of items. */
|
|
21
21
|
declare class ListTypeahead<T extends ListTypeaheadItem> {
|
|
22
|
-
readonly inputs: ListTypeaheadInputs & {
|
|
23
|
-
|
|
22
|
+
readonly inputs: ListTypeaheadInputs<T> & {
|
|
23
|
+
focusManager: ListFocus<T>;
|
|
24
24
|
};
|
|
25
25
|
/** A reference to the timeout for resetting the typeahead search. */
|
|
26
26
|
timeout?: ReturnType<typeof setTimeout> | undefined;
|
|
27
|
-
/** The
|
|
28
|
-
|
|
27
|
+
/** The focus controller of the parent list. */
|
|
28
|
+
focusManager: ListFocus<T>;
|
|
29
29
|
/** Whether the user is actively typing a typeahead search query. */
|
|
30
30
|
isTyping: i0.Signal<boolean>;
|
|
31
31
|
/** Keeps track of the characters that typeahead search is being called with. */
|
|
32
32
|
private _query;
|
|
33
33
|
/** The index where that the typeahead search was initiated from. */
|
|
34
34
|
private _startIndex;
|
|
35
|
-
constructor(inputs: ListTypeaheadInputs & {
|
|
36
|
-
|
|
35
|
+
constructor(inputs: ListTypeaheadInputs<T> & {
|
|
36
|
+
focusManager: ListFocus<T>;
|
|
37
37
|
});
|
|
38
38
|
/** Performs a typeahead search, appending the given character to the search string. */
|
|
39
|
-
search(char: string):
|
|
39
|
+
search(char: string): boolean;
|
|
40
40
|
/**
|
|
41
41
|
* Returns the first item whose search term matches the
|
|
42
42
|
* current query starting from the the current anchor index.
|
|
@@ -65,6 +65,8 @@ declare class OptionPattern<V> {
|
|
|
65
65
|
value: SignalLike<V>;
|
|
66
66
|
/** The position of the option in the list. */
|
|
67
67
|
index: i0.Signal<number>;
|
|
68
|
+
/** Whether the option is active. */
|
|
69
|
+
active: i0.Signal<boolean>;
|
|
68
70
|
/** Whether the option is selected. */
|
|
69
71
|
selected: i0.Signal<boolean | undefined>;
|
|
70
72
|
/** Whether the option is disabled. */
|
|
@@ -82,18 +84,13 @@ declare class OptionPattern<V> {
|
|
|
82
84
|
|
|
83
85
|
/** The selection operations that the listbox can perform. */
|
|
84
86
|
interface SelectOptions {
|
|
85
|
-
select?: boolean;
|
|
86
87
|
toggle?: boolean;
|
|
87
|
-
toggleOne?: boolean;
|
|
88
88
|
selectOne?: boolean;
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
selectFromActive?: boolean;
|
|
92
|
-
toggleFromAnchor?: boolean;
|
|
89
|
+
selectRange?: boolean;
|
|
90
|
+
anchor?: boolean;
|
|
93
91
|
}
|
|
94
92
|
/** Represents the required inputs for a listbox. */
|
|
95
|
-
type ListboxInputs<V> = ListNavigationInputs<OptionPattern<V>> & ListSelectionInputs<OptionPattern<V>, V> & ListTypeaheadInputs & ListFocusInputs<OptionPattern<V>> & {
|
|
96
|
-
disabled: SignalLike<boolean>;
|
|
93
|
+
type ListboxInputs<V> = ListNavigationInputs<OptionPattern<V>> & ListSelectionInputs<OptionPattern<V>, V> & ListTypeaheadInputs<OptionPattern<V>> & ListFocusInputs<OptionPattern<V>> & {
|
|
97
94
|
readonly: SignalLike<boolean>;
|
|
98
95
|
};
|
|
99
96
|
/** Controls the state of a listbox. */
|
|
@@ -110,7 +107,7 @@ declare class ListboxPattern<V> {
|
|
|
110
107
|
/** Whether the list is vertically or horizontally oriented. */
|
|
111
108
|
orientation: SignalLike<'vertical' | 'horizontal'>;
|
|
112
109
|
/** Whether the listbox is disabled. */
|
|
113
|
-
disabled:
|
|
110
|
+
disabled: i0.Signal<boolean>;
|
|
114
111
|
/** Whether the listbox is readonly. */
|
|
115
112
|
readonly: SignalLike<boolean>;
|
|
116
113
|
/** The tabindex of the listbox. */
|
|
@@ -123,6 +120,8 @@ declare class ListboxPattern<V> {
|
|
|
123
120
|
setsize: i0.Signal<number>;
|
|
124
121
|
/** Whether the listbox selection follows focus. */
|
|
125
122
|
followFocus: i0.Signal<boolean>;
|
|
123
|
+
/** Whether the listbox should wrap. Used to disable wrapping while range selecting. */
|
|
124
|
+
wrap: i0.WritableSignal<boolean>;
|
|
126
125
|
/** The key used to navigate to the previous item in the list. */
|
|
127
126
|
prevKey: i0.Signal<"ArrowUp" | "ArrowRight" | "ArrowLeft">;
|
|
128
127
|
/** The key used to navigate to the next item in the list. */
|
|
@@ -131,6 +130,19 @@ declare class ListboxPattern<V> {
|
|
|
131
130
|
dynamicSpaceKey: i0.Signal<"" | " ">;
|
|
132
131
|
/** The regexp used to decide if a key should trigger typeahead. */
|
|
133
132
|
typeaheadRegexp: RegExp;
|
|
133
|
+
/**
|
|
134
|
+
* The uncommitted index for selecting a range of options.
|
|
135
|
+
*
|
|
136
|
+
* NOTE: This is subtly distinct from the "rangeStartIndex" in the ListSelection behavior.
|
|
137
|
+
* The anchorIndex does not necessarily represent the start of a range, but represents the most
|
|
138
|
+
* recent index where the user showed intent to begin a range selection. Usually, this is wherever
|
|
139
|
+
* the user most recently pressed the "Shift" key, but if the user presses shift + space to select
|
|
140
|
+
* from the anchor, the user is not intending to start a new range from this index.
|
|
141
|
+
*
|
|
142
|
+
* In other words, "rangeStartIndex" is only set when a user commits to starting a range selection
|
|
143
|
+
* while "anchorIndex" is set whenever a user indicates they may be starting a range selection.
|
|
144
|
+
*/
|
|
145
|
+
anchorIndex: i0.WritableSignal<number>;
|
|
134
146
|
/** The keydown event manager for the listbox. */
|
|
135
147
|
keydown: i0.Signal<KeyboardEventManager<KeyboardEvent>>;
|
|
136
148
|
/** The pointerdown event manager for the listbox. */
|
|
@@ -151,10 +163,31 @@ declare class ListboxPattern<V> {
|
|
|
151
163
|
goto(event: PointerEvent, opts?: SelectOptions): void;
|
|
152
164
|
/** Handles typeahead search navigation for the listbox. */
|
|
153
165
|
search(char: string, opts?: SelectOptions): void;
|
|
166
|
+
/**
|
|
167
|
+
* Sets the listbox to it's default initial state.
|
|
168
|
+
*
|
|
169
|
+
* Sets the active index of the listbox to the first focusable selected
|
|
170
|
+
* item if one exists. Otherwise, sets focus to the first focusable item.
|
|
171
|
+
*
|
|
172
|
+
* This method should be called once the listbox and it's options are properly initialized,
|
|
173
|
+
* meaning the ListboxPattern and OptionPatterns should have references to each other before this
|
|
174
|
+
* is called.
|
|
175
|
+
*/
|
|
176
|
+
setDefaultState(): void;
|
|
177
|
+
/**
|
|
178
|
+
* Safely performs a navigation operation.
|
|
179
|
+
*
|
|
180
|
+
* Handles conditionally disabling wrapping for when a navigation
|
|
181
|
+
* operation is occurring while the user is selecting a range of options.
|
|
182
|
+
*
|
|
183
|
+
* Handles boilerplate calling of focus & selection operations. Also ensures these
|
|
184
|
+
* additional operations are only called if the navigation operation moved focus to a new option.
|
|
185
|
+
*/
|
|
186
|
+
private _navigate;
|
|
154
187
|
/** Handles updating selection for the listbox. */
|
|
155
188
|
private _updateSelection;
|
|
156
189
|
private _getItem;
|
|
157
190
|
}
|
|
158
191
|
|
|
159
|
-
export { ListboxPattern, OptionPattern };
|
|
160
|
-
export type { ListboxInputs, OptionInputs };
|
|
192
|
+
export { ListboxPattern as a, OptionPattern as b };
|
|
193
|
+
export type { ListboxInputs as L, OptionInputs as O };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@angular/cdk-experimental",
|
|
3
|
-
"version": "20.0.0-next.
|
|
3
|
+
"version": "20.0.0-next.9",
|
|
4
4
|
"description": "Experimental components for Angular CDK",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
},
|
|
13
13
|
"homepage": "https://github.com/angular/components#readme",
|
|
14
14
|
"peerDependencies": {
|
|
15
|
-
"@angular/cdk": "20.0.0-next.
|
|
15
|
+
"@angular/cdk": "20.0.0-next.9",
|
|
16
16
|
"@angular/core": "^20.0.0-0 || ^20.1.0-0 || ^20.2.0-0 || ^20.3.0-0 || ^21.0.0-0"
|
|
17
17
|
},
|
|
18
18
|
"devDependencies": {
|