@angular/aria 21.0.0-rc.0 → 21.0.0-rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/_adev_assets/aria-accordion.json +14 -14
- package/_adev_assets/aria-combobox.json +10 -10
- package/_adev_assets/aria-grid.json +81 -12
- package/_adev_assets/aria-listbox.json +3 -3
- package/_adev_assets/aria-menu.json +174 -74
- package/_adev_assets/aria-tabs.json +22 -22
- package/_adev_assets/aria-toolbar.json +99 -120
- package/_adev_assets/aria-tree.json +20 -16
- package/fesm2022/_widget-chunk.mjs +266 -144
- package/fesm2022/_widget-chunk.mjs.map +1 -1
- package/fesm2022/accordion.mjs +12 -13
- package/fesm2022/accordion.mjs.map +1 -1
- package/fesm2022/aria.mjs +1 -1
- package/fesm2022/aria.mjs.map +1 -1
- package/fesm2022/combobox.mjs +9 -7
- package/fesm2022/combobox.mjs.map +1 -1
- package/fesm2022/grid.mjs +61 -12
- package/fesm2022/grid.mjs.map +1 -1
- package/fesm2022/listbox.mjs +14 -15
- package/fesm2022/listbox.mjs.map +1 -1
- package/fesm2022/menu.mjs +117 -61
- package/fesm2022/menu.mjs.map +1 -1
- package/fesm2022/private.mjs +390 -399
- package/fesm2022/private.mjs.map +1 -1
- package/fesm2022/tabs.mjs +16 -17
- package/fesm2022/tabs.mjs.map +1 -1
- package/fesm2022/toolbar.mjs +79 -44
- package/fesm2022/toolbar.mjs.map +1 -1
- package/fesm2022/tree.mjs +22 -19
- package/fesm2022/tree.mjs.map +1 -1
- package/package.json +2 -10
- package/types/_grid-chunk.d.ts +115 -53
- package/types/accordion.d.ts +4 -4
- package/types/combobox.d.ts +2 -2
- package/types/grid.d.ts +12 -3
- package/types/listbox.d.ts +3 -4
- package/types/menu.d.ts +33 -21
- package/types/private.d.ts +263 -341
- package/types/tabs.d.ts +4 -4
- package/types/toolbar.d.ts +29 -26
- package/types/tree.d.ts +5 -6
- package/_adev_assets/aria-radio-group.json +0 -389
- package/fesm2022/deferred-content.mjs +0 -99
- package/fesm2022/deferred-content.mjs.map +0 -1
- package/fesm2022/radio-group.mjs +0 -338
- package/fesm2022/radio-group.mjs.map +0 -1
- package/types/deferred-content.d.ts +0 -38
- package/types/radio-group.d.ts +0 -84
package/fesm2022/tree.mjs
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { inject, computed, ElementRef, signal, input, booleanAttribute, model, afterRenderEffect, untracked, Directive } from '@angular/core';
|
|
2
|
+
import { inject, computed, ElementRef, signal, input, booleanAttribute, model, afterRenderEffect, untracked, Directive, afterNextRender } from '@angular/core';
|
|
3
3
|
import { _IdGenerator } from '@angular/cdk/a11y';
|
|
4
4
|
import { Directionality } from '@angular/cdk/bidi';
|
|
5
|
-
import * as i1 from '@angular/aria/
|
|
6
|
-
import { DeferredContentAware, DeferredContent } from '@angular/aria/
|
|
7
|
-
import { ComboboxTreePattern, TreePattern, TreeItemPattern } from '@angular/aria/private';
|
|
5
|
+
import * as i1 from '@angular/aria/private';
|
|
6
|
+
import { ComboboxTreePattern, TreePattern, DeferredContentAware, TreeItemPattern, DeferredContent } from '@angular/aria/private';
|
|
8
7
|
import { ComboboxPopup } from './combobox.mjs';
|
|
9
8
|
import '@angular/core/rxjs-interop';
|
|
10
9
|
|
|
@@ -12,7 +11,7 @@ function sortDirectives(a, b) {
|
|
|
12
11
|
return (a.element().compareDocumentPosition(b.element()) & Node.DOCUMENT_POSITION_PRECEDING) > 0 ? 1 : -1;
|
|
13
12
|
}
|
|
14
13
|
class Tree {
|
|
15
|
-
_generatedId = inject(_IdGenerator).getId('ng-tree-');
|
|
14
|
+
_generatedId = inject(_IdGenerator).getId('ng-tree-', true);
|
|
16
15
|
id = computed(() => this._generatedId, ...(ngDevMode ? [{
|
|
17
16
|
debugName: "id"
|
|
18
17
|
}] : []));
|
|
@@ -50,8 +49,8 @@ class Tree {
|
|
|
50
49
|
}] : [{
|
|
51
50
|
transform: booleanAttribute
|
|
52
51
|
}]));
|
|
53
|
-
|
|
54
|
-
debugName: "
|
|
52
|
+
softDisabled = input(true, ...(ngDevMode ? [{
|
|
53
|
+
debugName: "softDisabled",
|
|
55
54
|
transform: booleanAttribute
|
|
56
55
|
}] : [{
|
|
57
56
|
transform: booleanAttribute
|
|
@@ -120,7 +119,7 @@ class Tree {
|
|
|
120
119
|
scrollActiveItemIntoView(options = {
|
|
121
120
|
block: 'nearest'
|
|
122
121
|
}) {
|
|
123
|
-
this._pattern.inputs.activeItem()?.element()
|
|
122
|
+
this._pattern.inputs.activeItem()?.element()?.scrollIntoView(options);
|
|
124
123
|
}
|
|
125
124
|
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
126
125
|
minVersion: "12.0.0",
|
|
@@ -179,9 +178,9 @@ class Tree {
|
|
|
179
178
|
isRequired: false,
|
|
180
179
|
transformFunction: null
|
|
181
180
|
},
|
|
182
|
-
|
|
183
|
-
classPropertyName: "
|
|
184
|
-
publicName: "
|
|
181
|
+
softDisabled: {
|
|
182
|
+
classPropertyName: "softDisabled",
|
|
183
|
+
publicName: "softDisabled",
|
|
185
184
|
isSignal: true,
|
|
186
185
|
isRequired: false,
|
|
187
186
|
transformFunction: null
|
|
@@ -232,8 +231,8 @@ class Tree {
|
|
|
232
231
|
"attr.aria-orientation": "_pattern.orientation()",
|
|
233
232
|
"attr.aria-multiselectable": "_pattern.multi()",
|
|
234
233
|
"attr.aria-disabled": "_pattern.disabled()",
|
|
235
|
-
"attr.aria-activedescendant": "_pattern.
|
|
236
|
-
"tabindex": "_pattern.
|
|
234
|
+
"attr.aria-activedescendant": "_pattern.activeDescendant()",
|
|
235
|
+
"tabindex": "_pattern.tabIndex()"
|
|
237
236
|
},
|
|
238
237
|
classAttribute: "ng-tree"
|
|
239
238
|
},
|
|
@@ -261,8 +260,8 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
261
260
|
'[attr.aria-orientation]': '_pattern.orientation()',
|
|
262
261
|
'[attr.aria-multiselectable]': '_pattern.multi()',
|
|
263
262
|
'[attr.aria-disabled]': '_pattern.disabled()',
|
|
264
|
-
'[attr.aria-activedescendant]': '_pattern.
|
|
265
|
-
'[tabindex]': '_pattern.
|
|
263
|
+
'[attr.aria-activedescendant]': '_pattern.activeDescendant()',
|
|
264
|
+
'[tabindex]': '_pattern.tabIndex()',
|
|
266
265
|
'(keydown)': '_pattern.onKeydown($event)',
|
|
267
266
|
'(pointerdown)': '_pattern.onPointerdown($event)',
|
|
268
267
|
'(focusin)': 'onFocus()'
|
|
@@ -276,7 +275,7 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
276
275
|
});
|
|
277
276
|
class TreeItem extends DeferredContentAware {
|
|
278
277
|
_elementRef = inject(ElementRef);
|
|
279
|
-
_id = inject(_IdGenerator).getId('ng-tree-item-');
|
|
278
|
+
_id = inject(_IdGenerator).getId('ng-tree-item-', true);
|
|
280
279
|
_group = signal(undefined, ...(ngDevMode ? [{
|
|
281
280
|
debugName: "_group"
|
|
282
281
|
}] : []));
|
|
@@ -315,7 +314,11 @@ class TreeItem extends DeferredContentAware {
|
|
|
315
314
|
_pattern;
|
|
316
315
|
constructor() {
|
|
317
316
|
super();
|
|
318
|
-
|
|
317
|
+
afterNextRender(() => {
|
|
318
|
+
if (this.tree()._pattern instanceof ComboboxTreePattern) {
|
|
319
|
+
this.preserveContent.set(true);
|
|
320
|
+
}
|
|
321
|
+
});
|
|
319
322
|
afterRenderEffect(() => {
|
|
320
323
|
this.tree()._pattern instanceof ComboboxTreePattern ? this.contentVisible.set(true) : this.contentVisible.set(this._pattern.expanded());
|
|
321
324
|
});
|
|
@@ -418,7 +421,7 @@ class TreeItem extends DeferredContentAware {
|
|
|
418
421
|
"attr.aria-level": "_pattern.level()",
|
|
419
422
|
"attr.aria-setsize": "_pattern.setsize()",
|
|
420
423
|
"attr.aria-posinset": "_pattern.posinset()",
|
|
421
|
-
"attr.tabindex": "_pattern.
|
|
424
|
+
"attr.tabindex": "_pattern.tabIndex()"
|
|
422
425
|
},
|
|
423
426
|
classAttribute: "ng-treeitem"
|
|
424
427
|
},
|
|
@@ -449,7 +452,7 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
449
452
|
'[attr.aria-level]': '_pattern.level()',
|
|
450
453
|
'[attr.aria-setsize]': '_pattern.setsize()',
|
|
451
454
|
'[attr.aria-posinset]': '_pattern.posinset()',
|
|
452
|
-
'[attr.tabindex]': '_pattern.
|
|
455
|
+
'[attr.tabindex]': '_pattern.tabIndex()'
|
|
453
456
|
}
|
|
454
457
|
}]
|
|
455
458
|
}],
|
package/fesm2022/tree.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tree.mjs","sources":["../../../../../darwin_arm64-fastbuild-ST-199a4f3c4e20/bin/src/aria/tree/tree.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 Directive,\n ElementRef,\n afterRenderEffect,\n booleanAttribute,\n computed,\n inject,\n input,\n model,\n signal,\n Signal,\n OnInit,\n OnDestroy,\n untracked,\n} from '@angular/core';\nimport {_IdGenerator} from '@angular/cdk/a11y';\nimport {Directionality} from '@angular/cdk/bidi';\nimport {DeferredContent, DeferredContentAware} from '@angular/aria/deferred-content';\nimport {ComboboxTreePattern, TreeItemPattern, TreePattern} from '@angular/aria/private';\nimport {ComboboxPopup} from '../combobox';\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 Tree container.\n *\n * Transforms nested lists into an accessible, ARIA-compliant tree structure.\n *\n * ```html\n * <ul ngTree [(value)]=\"selectedItems\" [multi]=\"true\">\n * <li ngTreeItem [value]=\"'leaf1'\">Leaf Item 1</li>\n * <li ngTreeItem [value]=\"'parent1'\">\n * Parent Item 1\n * <ul ngTreeItemGroup [value]=\"'parent1'\">\n * <ng-template ngTreeItemGroupContent>\n * <li ngTreeItem [value]=\"'child1.1'\">Child Item 1.1</li>\n * <li ngTreeItem [value]=\"'child1.2'\">Child Item 1.2</li>\n * </ng-template>\n * </ul>\n * </li>\n * <li ngTreeItem [value]=\"'leaf2'\" [disabled]=\"true\">Disabled Leaf Item 2</li>\n * </ul>\n * ```\n */\n@Directive({\n selector: '[ngTree]',\n exportAs: 'ngTree',\n host: {\n 'class': 'ng-tree',\n 'role': 'tree',\n '[attr.id]': 'id()',\n '[attr.aria-orientation]': '_pattern.orientation()',\n '[attr.aria-multiselectable]': '_pattern.multi()',\n '[attr.aria-disabled]': '_pattern.disabled()',\n '[attr.aria-activedescendant]': '_pattern.activedescendant()',\n '[tabindex]': '_pattern.tabindex()',\n '(keydown)': '_pattern.onKeydown($event)',\n '(pointerdown)': '_pattern.onPointerdown($event)',\n '(focusin)': 'onFocus()',\n },\n hostDirectives: [{directive: ComboboxPopup}],\n})\nexport class Tree<V> {\n /** A unique identifier for the tree. */\n private readonly _generatedId = inject(_IdGenerator).getId('ng-tree-');\n\n // TODO(wagnermaciel): https://github.com/angular/components/pull/30495#discussion_r1972601144.\n /** A unique identifier for the tree. */\n protected id = computed(() => this._generatedId);\n\n /** A reference to the parent combobox popup, if one exists. */\n private readonly _popup = inject<ComboboxPopup<V>>(ComboboxPopup, {\n optional: true,\n });\n\n /** A reference to the tree element. */\n private readonly _elementRef = inject(ElementRef);\n\n /** All TreeItem instances within this tree. */\n private readonly _unorderedItems = signal(new Set<TreeItem<V>>());\n\n /** Orientation of the tree. */\n readonly orientation = input<'vertical' | 'horizontal'>('vertical');\n\n /** Whether multi-selection is allowed. */\n readonly multi = input(false, {transform: booleanAttribute});\n\n /** Whether the tree is disabled. */\n readonly disabled = input(false, {transform: booleanAttribute});\n\n /** The selection strategy used by the tree. */\n readonly selectionMode = input<'explicit' | 'follow'>('explicit');\n\n /** The focus strategy used by the tree. */\n readonly focusMode = input<'roving' | 'activedescendant'>('roving');\n\n /** Whether navigation wraps. */\n readonly wrap = input(true, {transform: booleanAttribute});\n\n /** Whether to skip disabled items during navigation. */\n readonly skipDisabled = input(true, {transform: booleanAttribute});\n\n /** Typeahead delay. */\n readonly typeaheadDelay = input(0.5);\n\n /** Selected item values. */\n readonly value = model<V[]>([]);\n\n /** Text direction. */\n readonly textDirection = inject(Directionality).valueSignal;\n\n /** Whether the tree is in navigation mode. */\n readonly nav = input(false);\n\n /** The aria-current type. */\n readonly currentType = input<'page' | 'step' | 'location' | 'date' | 'time' | 'true' | 'false'>(\n 'page',\n );\n\n /** The UI pattern for the tree. */\n readonly _pattern: TreePattern<V>;\n\n /** Whether the tree has received focus yet. */\n private _hasFocused = signal(false);\n\n constructor() {\n const inputs = {\n ...this,\n id: this.id,\n allItems: computed(() =>\n [...this._unorderedItems()].sort(sortDirectives).map(item => item._pattern),\n ),\n activeItem: signal<TreeItemPattern<V> | undefined>(undefined),\n element: () => this._elementRef.nativeElement,\n combobox: () => this._popup?.combobox?._pattern,\n };\n\n this._pattern = this._popup?.combobox\n ? new ComboboxTreePattern<V>(inputs)\n : new TreePattern<V>(inputs);\n\n if (this._popup?.combobox) {\n this._popup?.controls?.set(this._pattern as ComboboxTreePattern<V>);\n }\n\n afterRenderEffect(() => {\n if (!this._hasFocused()) {\n this._pattern.setDefaultState();\n }\n });\n\n afterRenderEffect(() => {\n const items = inputs.allItems();\n const activeItem = untracked(() => inputs.activeItem());\n\n if (!items.some(i => i === activeItem) && activeItem) {\n this._pattern.listBehavior.unfocus();\n }\n });\n\n afterRenderEffect(() => {\n const items = inputs.allItems();\n const value = untracked(() => this.value());\n\n if (items && value.some(v => !items.some(i => i.value() === v))) {\n this.value.set(value.filter(v => items.some(i => i.value() === v)));\n }\n });\n }\n\n onFocus() {\n this._hasFocused.set(true);\n }\n\n register(child: TreeItem<V>) {\n this._unorderedItems().add(child);\n this._unorderedItems.set(new Set(this._unorderedItems()));\n }\n\n unregister(child: TreeItem<V>) {\n this._unorderedItems().delete(child);\n this._unorderedItems.set(new Set(this._unorderedItems()));\n }\n\n scrollActiveItemIntoView(options: ScrollIntoViewOptions = {block: 'nearest'}) {\n this._pattern.inputs.activeItem()?.element().scrollIntoView(options);\n }\n}\n\n/**\n * A selectable and expandable Tree Item in a Tree.\n */\n@Directive({\n selector: '[ngTreeItem]',\n exportAs: 'ngTreeItem',\n host: {\n 'class': 'ng-treeitem',\n '[attr.data-active]': '_pattern.active()',\n 'role': 'treeitem',\n '[id]': '_pattern.id()',\n '[attr.aria-expanded]': '_pattern.expandable() ? _pattern.expanded() : null',\n '[attr.aria-selected]': '_pattern.selected()',\n '[attr.aria-current]': '_pattern.current()',\n '[attr.aria-disabled]': '_pattern.disabled()',\n '[attr.aria-level]': '_pattern.level()',\n '[attr.aria-setsize]': '_pattern.setsize()',\n '[attr.aria-posinset]': '_pattern.posinset()',\n '[attr.tabindex]': '_pattern.tabindex()',\n },\n})\nexport class TreeItem<V> extends DeferredContentAware implements OnInit, OnDestroy, HasElement {\n /** A reference to the tree item element. */\n private readonly _elementRef = inject(ElementRef);\n\n /** A unique identifier for the tree item. */\n private readonly _id = inject(_IdGenerator).getId('ng-tree-item-');\n\n /** The owned tree item group. */\n private readonly _group = signal<TreeItemGroup<V> | undefined>(undefined);\n\n /** The host native element. */\n readonly element = computed(() => this._elementRef.nativeElement);\n\n /** The value of the tree item. */\n readonly value = input.required<V>();\n\n /** The parent tree root or tree item group. */\n readonly parent = input.required<Tree<V> | TreeItemGroup<V>>();\n\n /** Whether the tree item is disabled. */\n readonly disabled = input(false, {transform: booleanAttribute});\n\n /** Whether the tree item is selectable. */\n readonly selectable = input<boolean>(true);\n\n /** Optional label for typeahead. Defaults to the element's textContent. */\n readonly label = input<string>();\n\n /** Search term for typeahead. */\n readonly searchTerm = computed(() => this.label() ?? this.element().textContent);\n\n /** The tree root. */\n readonly tree: Signal<Tree<V>> = computed(() => {\n if (this.parent() instanceof Tree) {\n return this.parent() as Tree<V>;\n }\n return (this.parent() as TreeItemGroup<V>).ownedBy().tree();\n });\n\n /** The UI pattern for this item. */\n _pattern: TreeItemPattern<V>;\n\n constructor() {\n super();\n this.preserveContent.set(true);\n // Connect the group's hidden state to the DeferredContentAware's visibility.\n afterRenderEffect(() => {\n this.tree()._pattern instanceof ComboboxTreePattern\n ? this.contentVisible.set(true)\n : this.contentVisible.set(this._pattern.expanded());\n });\n }\n\n ngOnInit() {\n this.parent().register(this);\n this.tree().register(this);\n\n const treePattern = computed(() => this.tree()._pattern);\n const parentPattern = computed(() => {\n if (this.parent() instanceof Tree) {\n return treePattern();\n }\n return (this.parent() as TreeItemGroup<V>).ownedBy()._pattern;\n });\n this._pattern = new TreeItemPattern<V>({\n ...this,\n id: () => this._id,\n tree: treePattern,\n parent: parentPattern,\n children: computed(() => this._group()?.children() ?? []),\n hasChildren: computed(() => !!this._group()),\n });\n }\n\n ngOnDestroy() {\n this.parent().unregister(this);\n this.tree().unregister(this);\n }\n\n register(group: TreeItemGroup<V>) {\n this._group.set(group);\n }\n\n unregister() {\n this._group.set(undefined);\n }\n}\n\n/**\n * Contains children tree itmes.\n */\n@Directive({\n selector: 'ng-template[ngTreeItemGroup]',\n exportAs: 'ngTreeItemGroup',\n hostDirectives: [DeferredContent],\n})\nexport class TreeItemGroup<V> implements OnInit, OnDestroy {\n /** The DeferredContent host directive. */\n private readonly _deferredContent = inject(DeferredContent);\n\n /** All groupable items that are descendants of the group. */\n private readonly _unorderedItems = signal(new Set<TreeItem<V>>());\n\n /** Child items within this group. */\n readonly children = computed<TreeItemPattern<V>[]>(() =>\n [...this._unorderedItems()].sort(sortDirectives).map(c => c._pattern),\n );\n\n /** Tree item that owns the group. */\n readonly ownedBy = input.required<TreeItem<V>>();\n\n ngOnInit() {\n this._deferredContent.deferredContentAware.set(this.ownedBy());\n this.ownedBy().register(this);\n }\n\n ngOnDestroy() {\n this.ownedBy().unregister();\n }\n\n register(child: TreeItem<V>) {\n this._unorderedItems().add(child);\n this._unorderedItems.set(new Set(this._unorderedItems()));\n }\n\n unregister(child: TreeItem<V>) {\n this._unorderedItems().delete(child);\n this._unorderedItems.set(new Set(this._unorderedItems()));\n }\n}\n"],"names":["_popup","inject","optional","_unorderedItems","signal","Set","ngDevMode","debugName","input","transform","booleanAttribute","disabled","focusMode","wrap","skipDisabled","textDirection","Directionality","valueSignal","currentType","_pattern","id","allItems","computed","sort","sortDirectives","map","item","activeItem","undefined","element","_elementRef","nativeElement","combobox","ComboboxTreePattern","inputs","TreePattern","_hasFocused","setDefaultState","items","untracked","some","i","listBehavior","unfocus","afterRenderEffect","value","v","set","filter","add","child","unregister","delete","scrollActiveItemIntoView","options","block","scrollIntoView","i0","ɵɵngDeclareFactory","minVersion","version","ngImport","type","Tree","deps","target","ɵɵFactoryTarget","Directive","ɵdir","ɵɵngDeclareDirective","isStandalone","selector","orientation","classPropertyName","publicName","isSignal","isRequired","transformFunction","multi","selectionMode","typeaheadDelay","nav","outputs","host","attributes","listeners","properties","classAttribute","exportAs","hostDirectives","directive","i1","decorators","ComboboxPopup","ctorParameters","ElementRef","_id","_IdGenerator","getId","_group","required","parent","selectable","label","tree","constructor","preserveContent","contentVisible","ngOnInit","register","ownedBy"],"mappings":";;;;;;;;;;;;;;;;;;EAiJIA,MAAA,GAAAC;IACEC,QAAA,EAAA;AACQ,GAAA,CAAA;;AASVC,EAAAA,eAAA,GAAAC,MAAA,CAAAC,IAAAA,GAAA,QAAAC,SAAA,GAAA,CAAA;IAAAC,SAAqC,EAAA;AAAA,GAAA,CAAA,GAAA,EAAA,CAAA,CAAA;aAEnC,GAAEC,KAAI,iBAAAF,SAAA,GAAA,CAAA;IAAAC,SAAA,EAAA;AAAA,GAAA,CAAA,GAAA,EAAA,CAAA,CAAA;;IAIRA,SAAA,EAAA,OAAA;AAAAE,IAAAA,SAAA,EAAAC;AAAA,GAAA,CAAA,GA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AAA;AACNsF,EAAAA,WAAAA,GAAK;;IAEP,IAAA,CAAAC,eAAA,CAAA3D,GAAA,CAAA,IAAA,CAAA;IAGEH,iBAAA,CAAA,MAAA;AAGF,MAAA,IAAA,CAAA4D,IAAA,EAAArF,CAAAA,QAAA,YAA2Bc,mBAAA,GACF,KAAA0E,cAAA,CAAA5D,GAAA,CAAA,IAAA,CAAA;AAIzB,KAAA,CAAA;;UAEE6D,GAAA;IACF,IAAAP,CAAAA,MAAA,EAAAQ,CAAAA,QAAA,CAAA,IAAA,CAAA;;;;;;;;AApCA;AACA,MAAA,OAAA,IAAA,CAAAR,MAAA,EAAAS,CAAAA,OAA2B,GAAA3F,QAAA;uBACb,CAAA;MAAAZ,SAAA,EAAA;AAAA,KAAA,CAAA,GAAA,EAAA,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QAzBV,MAAA,EAAA,UAAA;AAAA,QAAA,MAAA,EAAA,eAAA;QACA,sBAAa,EAAA,oDAAA;QACd,sBAAC,EAAA,qBAAA;QACJ,qBAAA,EAAA,oBAAA;QAEA,sBAAW,EAAA,qBAAA;;;AAGX,QAAA,sBAAA,EAAA,qBAAA;AAEA,QAAA,iBAAA,EAAA;;;;AAIA,EAAA,cAAA,EAAAuF,MAAA;AAAA,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"tree.mjs","sources":["../../../../../k8-fastbuild-ST-199a4f3c4e20/bin/src/aria/tree/tree.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 Directive,\n ElementRef,\n afterRenderEffect,\n booleanAttribute,\n computed,\n inject,\n input,\n model,\n signal,\n Signal,\n OnInit,\n OnDestroy,\n untracked,\n afterNextRender,\n} from '@angular/core';\nimport {_IdGenerator} from '@angular/cdk/a11y';\nimport {Directionality} from '@angular/cdk/bidi';\nimport {\n ComboboxTreePattern,\n TreeItemPattern,\n TreePattern,\n DeferredContent,\n DeferredContentAware,\n} from '@angular/aria/private';\nimport {ComboboxPopup} from '../combobox';\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 Tree container.\n *\n * Transforms nested lists into an accessible, ARIA-compliant tree structure.\n *\n * ```html\n * <ul ngTree [(value)]=\"selectedItems\" [multi]=\"true\">\n * <li ngTreeItem [value]=\"'leaf1'\">Leaf Item 1</li>\n * <li ngTreeItem [value]=\"'parent1'\">\n * Parent Item 1\n * <ul ngTreeItemGroup [value]=\"'parent1'\">\n * <ng-template ngTreeItemGroupContent>\n * <li ngTreeItem [value]=\"'child1.1'\">Child Item 1.1</li>\n * <li ngTreeItem [value]=\"'child1.2'\">Child Item 1.2</li>\n * </ng-template>\n * </ul>\n * </li>\n * <li ngTreeItem [value]=\"'leaf2'\" [disabled]=\"true\">Disabled Leaf Item 2</li>\n * </ul>\n * ```\n */\n@Directive({\n selector: '[ngTree]',\n exportAs: 'ngTree',\n host: {\n 'class': 'ng-tree',\n 'role': 'tree',\n '[attr.id]': 'id()',\n '[attr.aria-orientation]': '_pattern.orientation()',\n '[attr.aria-multiselectable]': '_pattern.multi()',\n '[attr.aria-disabled]': '_pattern.disabled()',\n '[attr.aria-activedescendant]': '_pattern.activeDescendant()',\n '[tabindex]': '_pattern.tabIndex()',\n '(keydown)': '_pattern.onKeydown($event)',\n '(pointerdown)': '_pattern.onPointerdown($event)',\n '(focusin)': 'onFocus()',\n },\n hostDirectives: [{directive: ComboboxPopup}],\n})\nexport class Tree<V> {\n /** A unique identifier for the tree. */\n private readonly _generatedId = inject(_IdGenerator).getId('ng-tree-', true);\n\n // TODO(wagnermaciel): https://github.com/angular/components/pull/30495#discussion_r1972601144.\n /** A unique identifier for the tree. */\n protected id = computed(() => this._generatedId);\n\n /** A reference to the parent combobox popup, if one exists. */\n private readonly _popup = inject<ComboboxPopup<V>>(ComboboxPopup, {\n optional: true,\n });\n\n /** A reference to the tree element. */\n private readonly _elementRef = inject(ElementRef);\n\n /** All TreeItem instances within this tree. */\n private readonly _unorderedItems = signal(new Set<TreeItem<V>>());\n\n /** Orientation of the tree. */\n readonly orientation = input<'vertical' | 'horizontal'>('vertical');\n\n /** Whether multi-selection is allowed. */\n readonly multi = input(false, {transform: booleanAttribute});\n\n /** Whether the tree is disabled. */\n readonly disabled = input(false, {transform: booleanAttribute});\n\n /** The selection strategy used by the tree. */\n readonly selectionMode = input<'explicit' | 'follow'>('explicit');\n\n /** The focus strategy used by the tree. */\n readonly focusMode = input<'roving' | 'activedescendant'>('roving');\n\n /** Whether navigation wraps. */\n readonly wrap = input(true, {transform: booleanAttribute});\n\n /** Whether to allow disabled items to receive focus. */\n readonly softDisabled = input(true, {transform: booleanAttribute});\n\n /** Typeahead delay. */\n readonly typeaheadDelay = input(0.5);\n\n /** Selected item values. */\n readonly value = model<V[]>([]);\n\n /** Text direction. */\n readonly textDirection = inject(Directionality).valueSignal;\n\n /** Whether the tree is in navigation mode. */\n readonly nav = input(false);\n\n /** The aria-current type. */\n readonly currentType = input<'page' | 'step' | 'location' | 'date' | 'time' | 'true' | 'false'>(\n 'page',\n );\n\n /** The UI pattern for the tree. */\n readonly _pattern: TreePattern<V>;\n\n /** Whether the tree has received focus yet. */\n private _hasFocused = signal(false);\n\n constructor() {\n const inputs = {\n ...this,\n id: this.id,\n allItems: computed(() =>\n [...this._unorderedItems()].sort(sortDirectives).map(item => item._pattern),\n ),\n activeItem: signal<TreeItemPattern<V> | undefined>(undefined),\n element: () => this._elementRef.nativeElement,\n combobox: () => this._popup?.combobox?._pattern,\n };\n\n this._pattern = this._popup?.combobox\n ? new ComboboxTreePattern<V>(inputs)\n : new TreePattern<V>(inputs);\n\n if (this._popup?.combobox) {\n this._popup?.controls?.set(this._pattern as ComboboxTreePattern<V>);\n }\n\n afterRenderEffect(() => {\n if (!this._hasFocused()) {\n this._pattern.setDefaultState();\n }\n });\n\n afterRenderEffect(() => {\n const items = inputs.allItems();\n const activeItem = untracked(() => inputs.activeItem());\n\n if (!items.some(i => i === activeItem) && activeItem) {\n this._pattern.listBehavior.unfocus();\n }\n });\n\n afterRenderEffect(() => {\n const items = inputs.allItems();\n const value = untracked(() => this.value());\n\n if (items && value.some(v => !items.some(i => i.value() === v))) {\n this.value.set(value.filter(v => items.some(i => i.value() === v)));\n }\n });\n }\n\n onFocus() {\n this._hasFocused.set(true);\n }\n\n register(child: TreeItem<V>) {\n this._unorderedItems().add(child);\n this._unorderedItems.set(new Set(this._unorderedItems()));\n }\n\n unregister(child: TreeItem<V>) {\n this._unorderedItems().delete(child);\n this._unorderedItems.set(new Set(this._unorderedItems()));\n }\n\n scrollActiveItemIntoView(options: ScrollIntoViewOptions = {block: 'nearest'}) {\n this._pattern.inputs.activeItem()?.element()?.scrollIntoView(options);\n }\n}\n\n/**\n * A selectable and expandable Tree Item in a Tree.\n */\n@Directive({\n selector: '[ngTreeItem]',\n exportAs: 'ngTreeItem',\n host: {\n 'class': 'ng-treeitem',\n '[attr.data-active]': '_pattern.active()',\n 'role': 'treeitem',\n '[id]': '_pattern.id()',\n '[attr.aria-expanded]': '_pattern.expandable() ? _pattern.expanded() : null',\n '[attr.aria-selected]': '_pattern.selected()',\n '[attr.aria-current]': '_pattern.current()',\n '[attr.aria-disabled]': '_pattern.disabled()',\n '[attr.aria-level]': '_pattern.level()',\n '[attr.aria-setsize]': '_pattern.setsize()',\n '[attr.aria-posinset]': '_pattern.posinset()',\n '[attr.tabindex]': '_pattern.tabIndex()',\n },\n})\nexport class TreeItem<V> extends DeferredContentAware implements OnInit, OnDestroy, HasElement {\n /** A reference to the tree item element. */\n private readonly _elementRef = inject(ElementRef);\n\n /** A unique identifier for the tree item. */\n private readonly _id = inject(_IdGenerator).getId('ng-tree-item-', true);\n\n /** The owned tree item group. */\n private readonly _group = signal<TreeItemGroup<V> | undefined>(undefined);\n\n /** The host native element. */\n readonly element = computed(() => this._elementRef.nativeElement);\n\n /** The value of the tree item. */\n readonly value = input.required<V>();\n\n /** The parent tree root or tree item group. */\n readonly parent = input.required<Tree<V> | TreeItemGroup<V>>();\n\n /** Whether the tree item is disabled. */\n readonly disabled = input(false, {transform: booleanAttribute});\n\n /** Whether the tree item is selectable. */\n readonly selectable = input<boolean>(true);\n\n /** Optional label for typeahead. Defaults to the element's textContent. */\n readonly label = input<string>();\n\n /** Search term for typeahead. */\n readonly searchTerm = computed(() => this.label() ?? this.element().textContent);\n\n /** The tree root. */\n readonly tree: Signal<Tree<V>> = computed(() => {\n if (this.parent() instanceof Tree) {\n return this.parent() as Tree<V>;\n }\n return (this.parent() as TreeItemGroup<V>).ownedBy().tree();\n });\n\n /** The UI pattern for this item. */\n _pattern: TreeItemPattern<V>;\n\n constructor() {\n super();\n afterNextRender(() => {\n if (this.tree()._pattern instanceof ComboboxTreePattern) {\n this.preserveContent.set(true);\n }\n });\n // Connect the group's hidden state to the DeferredContentAware's visibility.\n afterRenderEffect(() => {\n this.tree()._pattern instanceof ComboboxTreePattern\n ? this.contentVisible.set(true)\n : this.contentVisible.set(this._pattern.expanded());\n });\n }\n\n ngOnInit() {\n this.parent().register(this);\n this.tree().register(this);\n\n const treePattern = computed(() => this.tree()._pattern);\n const parentPattern = computed(() => {\n if (this.parent() instanceof Tree) {\n return treePattern();\n }\n return (this.parent() as TreeItemGroup<V>).ownedBy()._pattern;\n });\n this._pattern = new TreeItemPattern<V>({\n ...this,\n id: () => this._id,\n tree: treePattern,\n parent: parentPattern,\n children: computed(() => this._group()?.children() ?? []),\n hasChildren: computed(() => !!this._group()),\n });\n }\n\n ngOnDestroy() {\n this.parent().unregister(this);\n this.tree().unregister(this);\n }\n\n register(group: TreeItemGroup<V>) {\n this._group.set(group);\n }\n\n unregister() {\n this._group.set(undefined);\n }\n}\n\n/**\n * Contains children tree itmes.\n */\n@Directive({\n selector: 'ng-template[ngTreeItemGroup]',\n exportAs: 'ngTreeItemGroup',\n hostDirectives: [DeferredContent],\n})\nexport class TreeItemGroup<V> implements OnInit, OnDestroy {\n /** The DeferredContent host directive. */\n private readonly _deferredContent = inject(DeferredContent);\n\n /** All groupable items that are descendants of the group. */\n private readonly _unorderedItems = signal(new Set<TreeItem<V>>());\n\n /** Child items within this group. */\n readonly children = computed<TreeItemPattern<V>[]>(() =>\n [...this._unorderedItems()].sort(sortDirectives).map(c => c._pattern),\n );\n\n /** Tree item that owns the group. */\n readonly ownedBy = input.required<TreeItem<V>>();\n\n ngOnInit() {\n this._deferredContent.deferredContentAware.set(this.ownedBy());\n this.ownedBy().register(this);\n }\n\n ngOnDestroy() {\n this.ownedBy().unregister();\n }\n\n register(child: TreeItem<V>) {\n this._unorderedItems().add(child);\n this._unorderedItems.set(new Set(this._unorderedItems()));\n }\n\n unregister(child: TreeItem<V>) {\n this._unorderedItems().delete(child);\n this._unorderedItems.set(new Set(this._unorderedItems()));\n }\n}\n"],"names":["sortDirectives","a","b","element","compareDocumentPosition","Node","DOCUMENT_POSITION_PRECEDING","Tree","_generatedId","inject","_IdGenerator","getId","id","computed","ngDevMode","debugName","_popup","ComboboxPopup","optional","_elementRef","ElementRef","_unorderedItems","signal","Set","orientation","input","multi","transform","booleanAttribute","disabled","selectionMode","focusMode","wrap","softDisabled","typeaheadDelay","value","model","textDirection","Directionality","valueSignal","nav","currentType","_pattern","_hasFocused","constructor","inputs","allItems","sort","map","item","activeItem","undefined","nativeElement","combobox","ComboboxTreePattern","TreePattern","controls","set","afterRenderEffect","setDefaultState","items","untracked","some","i","listBehavior","unfocus","v","filter","onFocus","register","child","add","unregister","delete","scrollActiveItemIntoView","options","block","scrollIntoView","deps","target","i0","ɵɵFactoryTarget","Directive","isStandalone","selector","classPropertyName","publicName","isSignal","isRequired","transformFunction","outputs","host","attributes","listeners","properties","classAttribute","exportAs","hostDirectives","directive","i1","ngImport","decorators","args","TreeItem","DeferredContentAware","_id","_group","required","parent","selectable","label","searchTerm","textContent","tree","ownedBy","afterNextRender","preserveContent","contentVisible","expanded","ngOnInit","treePattern","parentPattern","TreeItemPattern","children","hasChildren","ngOnDestroy","group","usesInheritance","TreeItemGroup","_deferredContent","DeferredContent","c","deferredContentAware","i2"],"mappings":";;;;;;;;;AA0CA,SAASA,cAAcA,CAACC,CAAa,EAAEC,CAAa,EAAA;EAClD,OAAO,CAACD,CAAC,CAACE,OAAO,EAAE,CAACC,uBAAuB,CAACF,CAAC,CAACC,OAAO,EAAE,CAAC,GAAGE,IAAI,CAACC,2BAA2B,IAAI,CAAA,GAC3F,CAAA,GACA,CAAC,CAAC;AACR;MAyCaC,IAAI,CAAA;EAEEC,YAAY,GAAGC,MAAM,CAACC,YAAY,CAAC,CAACC,KAAK,CAAC,UAAU,EAAE,IAAI,CAAC;EAIlEC,EAAE,GAAGC,QAAQ,CAAC,MAAM,IAAI,CAACL,YAAY,EAAA,IAAAM,SAAA,GAAA,CAAA;AAAAC,IAAAA,SAAA,EAAA;AAAA,GAAA,CAAA,GAAA,EAAA,CAAA,CAAC;AAG/BC,EAAAA,MAAM,GAAGP,MAAM,CAAmBQ,aAAa,EAAE;AAChEC,IAAAA,QAAQ,EAAE;AACX,GAAA,CAAC;AAGeC,EAAAA,WAAW,GAAGV,MAAM,CAACW,UAAU,CAAC;EAGhCC,eAAe,GAAGC,MAAM,CAAC,IAAIC,GAAG,EAAe;;WAAC;EAGxDC,WAAW,GAAGC,KAAK,CAA4B,UAAU;;WAAC;EAG1DC,KAAK,GAAGD,KAAK,CAAC,KAAK;;AAAGE,IAAAA,SAAS,EAAEC;GAAgB,CAAA,GAAA,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-12,7 +12,7 @@
|
|
|
12
12
|
},
|
|
13
13
|
"homepage": "https://github.com/angular/components#readme",
|
|
14
14
|
"peerDependencies": {
|
|
15
|
-
"@angular/cdk": "21.0.0-rc.
|
|
15
|
+
"@angular/cdk": "21.0.0-rc.1",
|
|
16
16
|
"@angular/core": "^21.0.0-0 || ^21.1.0-0 || ^21.2.0-0 || ^21.3.0-0 || ^22.0.0-0"
|
|
17
17
|
},
|
|
18
18
|
"devDependencies": {
|
|
@@ -53,10 +53,6 @@
|
|
|
53
53
|
"types": "./types/combobox.d.ts",
|
|
54
54
|
"default": "./fesm2022/combobox.mjs"
|
|
55
55
|
},
|
|
56
|
-
"./deferred-content": {
|
|
57
|
-
"types": "./types/deferred-content.d.ts",
|
|
58
|
-
"default": "./fesm2022/deferred-content.mjs"
|
|
59
|
-
},
|
|
60
56
|
"./grid": {
|
|
61
57
|
"types": "./types/grid.d.ts",
|
|
62
58
|
"default": "./fesm2022/grid.mjs"
|
|
@@ -73,10 +69,6 @@
|
|
|
73
69
|
"types": "./types/private.d.ts",
|
|
74
70
|
"default": "./fesm2022/private.mjs"
|
|
75
71
|
},
|
|
76
|
-
"./radio-group": {
|
|
77
|
-
"types": "./types/radio-group.d.ts",
|
|
78
|
-
"default": "./fesm2022/radio-group.mjs"
|
|
79
|
-
},
|
|
80
72
|
"./tabs": {
|
|
81
73
|
"types": "./types/tabs.d.ts",
|
|
82
74
|
"default": "./fesm2022/tabs.mjs"
|
package/types/_grid-chunk.d.ts
CHANGED
|
@@ -65,9 +65,9 @@ type KeyCode = string | SignalLike<string> | RegExp;
|
|
|
65
65
|
declare class KeyboardEventManager<T extends KeyboardEvent> extends EventManager<T> {
|
|
66
66
|
options: EventHandlerOptions;
|
|
67
67
|
/** Configures this event manager to handle events with a specific key and no modifiers. */
|
|
68
|
-
on(key: KeyCode, handler: EventHandler<T>): this;
|
|
68
|
+
on(key: KeyCode, handler: EventHandler<T>, options?: Partial<EventHandlerOptions>): this;
|
|
69
69
|
/** Configures this event manager to handle events with a specific modifer and key combination. */
|
|
70
|
-
on(modifiers: ModifierInputs, key: KeyCode, handler: EventHandler<T>): this;
|
|
70
|
+
on(modifiers: ModifierInputs, key: KeyCode, handler: EventHandler<T>, options?: Partial<EventHandlerOptions>): this;
|
|
71
71
|
private _normalizeInputs;
|
|
72
72
|
private _isMatch;
|
|
73
73
|
}
|
|
@@ -127,8 +127,6 @@ declare class GridData<T extends BaseGridCell> {
|
|
|
127
127
|
readonly inputs: GridDataInputs<T>;
|
|
128
128
|
/** The two-dimensional array of cells that represents the grid. */
|
|
129
129
|
readonly cells: SignalLike<T[][]>;
|
|
130
|
-
/** The number of rows in the grid. */
|
|
131
|
-
readonly rowCount: _angular_core.Signal<number>;
|
|
132
130
|
/** The maximum number of rows in the grid, accounting for row spans. */
|
|
133
131
|
readonly maxRowCount: _angular_core.Signal<number>;
|
|
134
132
|
/** The maximum number of columns in the grid, accounting for column spans. */
|
|
@@ -169,8 +167,8 @@ interface GridFocusInputs {
|
|
|
169
167
|
focusMode: SignalLike<'roving' | 'activedescendant'>;
|
|
170
168
|
/** Whether the grid is disabled. */
|
|
171
169
|
disabled: SignalLike<boolean>;
|
|
172
|
-
/** Whether disabled cells in the grid should be
|
|
173
|
-
|
|
170
|
+
/** Whether disabled cells in the grid should be focusable. */
|
|
171
|
+
softDisabled: SignalLike<boolean>;
|
|
174
172
|
}
|
|
175
173
|
/** Dependencies for the `GridFocus` class. */
|
|
176
174
|
interface GridFocusDeps<T extends GridFocusCell> {
|
|
@@ -198,11 +196,11 @@ declare class GridFocus<T extends GridFocusCell> {
|
|
|
198
196
|
readonly activeDescendant: _angular_core.Signal<string | undefined>;
|
|
199
197
|
/** Whether the grid is in a disabled state. */
|
|
200
198
|
readonly gridDisabled: _angular_core.Signal<boolean>;
|
|
201
|
-
/** The
|
|
199
|
+
/** The tab index for the grid container. */
|
|
202
200
|
readonly gridTabIndex: _angular_core.Signal<0 | -1>;
|
|
203
201
|
constructor(inputs: GridFocusInputs & GridFocusDeps<T>);
|
|
204
|
-
/** Returns the
|
|
205
|
-
|
|
202
|
+
/** Returns the tab index for the given grid cell cell. */
|
|
203
|
+
getCellTabIndex(cell: T): -1 | 0;
|
|
206
204
|
/** Returns true if the given cell can be navigated to. */
|
|
207
205
|
isFocusable(cell: T): boolean;
|
|
208
206
|
/** Focuses the given cell. */
|
|
@@ -252,7 +250,7 @@ declare class GridNavigation<T extends GridNavigationCell> {
|
|
|
252
250
|
/**
|
|
253
251
|
* Gets the coordinates of the next focusable cell in a given direction, without changing focus.
|
|
254
252
|
*/
|
|
255
|
-
peek(direction: Delta, fromCoords: RowCol, wrap?: WrapStrategy): RowCol | undefined;
|
|
253
|
+
peek(direction: Delta, fromCoords: RowCol, wrap?: WrapStrategy, allowDisabled?: boolean): RowCol | undefined;
|
|
256
254
|
/**
|
|
257
255
|
* Navigates to the next focusable cell in a given direction.
|
|
258
256
|
*/
|
|
@@ -261,7 +259,7 @@ declare class GridNavigation<T extends GridNavigationCell> {
|
|
|
261
259
|
* Gets the coordinates of the first focusable cell.
|
|
262
260
|
* If a row is not provided, searches the entire grid.
|
|
263
261
|
*/
|
|
264
|
-
peekFirst(row?: number): RowCol | undefined;
|
|
262
|
+
peekFirst(row?: number, allowDisabled?: boolean): RowCol | undefined;
|
|
265
263
|
/**
|
|
266
264
|
* Navigates to the first focusable cell.
|
|
267
265
|
* If a row is not provided, searches the entire grid.
|
|
@@ -271,7 +269,7 @@ declare class GridNavigation<T extends GridNavigationCell> {
|
|
|
271
269
|
* Gets the coordinates of the last focusable cell.
|
|
272
270
|
* If a row is not provided, searches the entire grid.
|
|
273
271
|
*/
|
|
274
|
-
peekLast(row?: number): RowCol | undefined;
|
|
272
|
+
peekLast(row?: number, allowDisabled?: boolean): RowCol | undefined;
|
|
275
273
|
/**
|
|
276
274
|
* Navigates to the last focusable cell.
|
|
277
275
|
* If a row is not provided, searches the entire grid.
|
|
@@ -303,7 +301,11 @@ interface GridSelectionDeps<T extends GridSelectionCell> {
|
|
|
303
301
|
/** Controls selection for a grid of items. */
|
|
304
302
|
declare class GridSelection<T extends GridSelectionCell> {
|
|
305
303
|
readonly inputs: GridSelectionInputs & GridSelectionDeps<T>;
|
|
304
|
+
/** The list of cells that were changed in the last selection operation. */
|
|
305
|
+
private readonly _undoList;
|
|
306
306
|
constructor(inputs: GridSelectionInputs & GridSelectionDeps<T>);
|
|
307
|
+
/** Reverts the last selection change. */
|
|
308
|
+
undo(): void;
|
|
307
309
|
/** Selects one or more cells in a given range. */
|
|
308
310
|
select(fromCoords: RowCol, toCoords?: RowCol): void;
|
|
309
311
|
/** Deselects one or more cells in a given range. */
|
|
@@ -314,17 +316,40 @@ declare class GridSelection<T extends GridSelectionCell> {
|
|
|
314
316
|
selectAll(): void;
|
|
315
317
|
/** Deselects all valid cells in the grid. */
|
|
316
318
|
deselectAll(): void;
|
|
317
|
-
/**
|
|
319
|
+
/** Whether a cell is selctable. */
|
|
320
|
+
isSelectable(cell: T): boolean;
|
|
321
|
+
/** A generator that yields all cells within a given range. */
|
|
318
322
|
_validCells(fromCoords: RowCol, toCoords: RowCol): Generator<T>;
|
|
323
|
+
/**
|
|
324
|
+
* Updates the selection state of cells in a given range and preserves previous changes
|
|
325
|
+
* to a undo list.
|
|
326
|
+
*/
|
|
327
|
+
private _updateState;
|
|
319
328
|
}
|
|
320
329
|
|
|
330
|
+
/** The selection operations that can be performed after a navigation operation. */
|
|
331
|
+
interface NavOptions {
|
|
332
|
+
/** Toggles the selection state of the active cell. */
|
|
333
|
+
toggle?: boolean;
|
|
334
|
+
/**
|
|
335
|
+
* Toggles the selection state of the active cell, and deselects all other cells if the
|
|
336
|
+
* active cell is selected. If the active cell is the only selected cell, it will be deselected.
|
|
337
|
+
*/
|
|
338
|
+
toggleOne?: boolean;
|
|
339
|
+
/** Selects the active cell, preserving the selection state of other cells. */
|
|
340
|
+
select?: boolean;
|
|
341
|
+
/** Deselects all other cells and selects the active cell. */
|
|
342
|
+
selectOne?: boolean;
|
|
343
|
+
/**
|
|
344
|
+
* Moves the selection anchor to the active cell and updates the selection to include all
|
|
345
|
+
* cells between the anchor and the active cell.
|
|
346
|
+
*/
|
|
347
|
+
anchor?: boolean;
|
|
348
|
+
}
|
|
321
349
|
/** A type that represents a cell in a grid, combining all cell-related interfaces. */
|
|
322
350
|
type GridCell = BaseGridCell & GridFocusCell & GridNavigationCell & GridSelectionCell;
|
|
323
351
|
/** Represents the required inputs for a grid. */
|
|
324
|
-
|
|
325
|
-
/** Whether selection is enabled for the grid. */
|
|
326
|
-
enableSelection: SignalLike<boolean>;
|
|
327
|
-
}
|
|
352
|
+
type GridInputs$1<T extends GridCell> = GridDataInputs<T> & GridFocusInputs & GridNavigationInputs & GridSelectionInputs;
|
|
328
353
|
/** The main class that orchestrates the grid behaviors. */
|
|
329
354
|
declare class Grid<T extends GridCell> {
|
|
330
355
|
readonly inputs: GridInputs$1<T>;
|
|
@@ -338,59 +363,74 @@ declare class Grid<T extends GridCell> {
|
|
|
338
363
|
readonly selectionBehavior: GridSelection<T>;
|
|
339
364
|
/** The anchor point for range selection, linked to the active coordinates. */
|
|
340
365
|
readonly selectionAnchor: _angular_core.WritableSignal<RowCol>;
|
|
341
|
-
/** The
|
|
342
|
-
readonly
|
|
366
|
+
/** The cell at the selection anchor. */
|
|
367
|
+
readonly selectionAnchorCell: _angular_core.Signal<T | undefined>;
|
|
368
|
+
/** Whether a range selection has settled. */
|
|
369
|
+
readonly selectionStabled: _angular_core.WritableSignal<boolean>;
|
|
370
|
+
/** Whether all selectable cells are selected. */
|
|
371
|
+
readonly allSelected: SignalLike<boolean>;
|
|
372
|
+
/** The tab index for the grid container. */
|
|
373
|
+
readonly gridTabIndex: SignalLike<-1 | 0>;
|
|
343
374
|
/** Whether the grid is in a disabled state. */
|
|
344
|
-
readonly gridDisabled:
|
|
375
|
+
readonly gridDisabled: SignalLike<boolean>;
|
|
345
376
|
/** The ID of the active descendant for ARIA `activedescendant` focus management. */
|
|
346
|
-
readonly activeDescendant:
|
|
377
|
+
readonly activeDescendant: SignalLike<string | undefined>;
|
|
347
378
|
constructor(inputs: GridInputs$1<T>);
|
|
348
379
|
/** Gets the 1-based row index of a cell. */
|
|
349
380
|
rowIndex(cell: T): number | undefined;
|
|
350
381
|
/** Gets the 1-based column index of a cell. */
|
|
351
382
|
colIndex(cell: T): number | undefined;
|
|
352
|
-
/** Gets the
|
|
383
|
+
/** Gets the tab index for a given cell. */
|
|
353
384
|
cellTabIndex(cell: T): -1 | 0;
|
|
354
385
|
/** Navigates to the cell above the currently active cell. */
|
|
355
|
-
up(): boolean;
|
|
356
|
-
/** Extends the selection to the cell above the selection anchor. */
|
|
357
|
-
rangeSelectUp(): void;
|
|
386
|
+
up(opts?: NavOptions): boolean;
|
|
358
387
|
/** Navigates to the cell below the currently active cell. */
|
|
359
|
-
down(): boolean;
|
|
360
|
-
/** Extends the selection to the cell below the selection anchor. */
|
|
361
|
-
rangeSelectDown(): void;
|
|
388
|
+
down(opts?: NavOptions): boolean;
|
|
362
389
|
/** Navigates to the cell to the left of the currently active cell. */
|
|
363
|
-
left(): boolean;
|
|
364
|
-
/** Extends the selection to the cell to the left of the selection anchor. */
|
|
365
|
-
rangeSelectLeft(): void;
|
|
390
|
+
left(opts?: NavOptions): boolean;
|
|
366
391
|
/** Navigates to the cell to the right of the currently active cell. */
|
|
367
|
-
right(): boolean;
|
|
368
|
-
/** Extends the selection to the cell to the right of the selection anchor. */
|
|
369
|
-
rangeSelectRight(): void;
|
|
392
|
+
right(opts?: NavOptions): boolean;
|
|
370
393
|
/** Navigates to the first focusable cell in the grid. */
|
|
371
|
-
first(): boolean;
|
|
394
|
+
first(opts?: NavOptions): boolean;
|
|
372
395
|
/** Navigates to the first focusable cell in the current row. */
|
|
373
|
-
firstInRow(): boolean;
|
|
396
|
+
firstInRow(opts?: NavOptions): boolean;
|
|
374
397
|
/** Navigates to the last focusable cell in the grid. */
|
|
375
|
-
last(): boolean;
|
|
398
|
+
last(opts?: NavOptions): boolean;
|
|
376
399
|
/** Navigates to the last focusable cell in the current row. */
|
|
377
|
-
lastInRow(): boolean;
|
|
400
|
+
lastInRow(opts?: NavOptions): boolean;
|
|
378
401
|
/** Selects all cells in the current row. */
|
|
379
402
|
selectRow(): void;
|
|
380
403
|
/** Selects all cells in the current column. */
|
|
381
404
|
selectCol(): void;
|
|
405
|
+
/** Selects the active cell. */
|
|
406
|
+
select(): void;
|
|
407
|
+
/** Deselects the active cell. */
|
|
408
|
+
deselect(): void;
|
|
409
|
+
/**
|
|
410
|
+
* Toggles the selection state of the coordinates of the given cell
|
|
411
|
+
* or the current active coordinates.
|
|
412
|
+
*/
|
|
413
|
+
toggle(): void;
|
|
414
|
+
/** Toggles the selection state of the active cell, and deselects all other cells. */
|
|
415
|
+
toggleOne(): void;
|
|
382
416
|
/** Selects all selectable cells in the grid. */
|
|
383
417
|
selectAll(): void;
|
|
418
|
+
/** Deselects all cells in the grid. */
|
|
419
|
+
deselectAll(): void;
|
|
384
420
|
/** Navigates to and focuses the given cell. */
|
|
385
|
-
gotoCell(cell: T): boolean;
|
|
386
|
-
/**
|
|
387
|
-
|
|
388
|
-
/** Extends the selection from the anchor to the given cell. */
|
|
389
|
-
rangeSelect(cell: T): void;
|
|
390
|
-
/** Extends the selection to the given coordinates. */
|
|
391
|
-
private _rangeSelectCoords;
|
|
421
|
+
gotoCell(cell: T, opts?: NavOptions): boolean;
|
|
422
|
+
/** Sets the default active state of the grid. */
|
|
423
|
+
setDefaultState(): boolean;
|
|
392
424
|
/** Resets the active state of the grid if it is empty or stale. */
|
|
393
425
|
resetState(): boolean;
|
|
426
|
+
/** Updates the selection anchor to the given coordinates. */
|
|
427
|
+
private _updateSelectionAnchor;
|
|
428
|
+
/** Updates the selection to include all cells between the anchor and the active cell. */
|
|
429
|
+
private _updateRangeSelection;
|
|
430
|
+
/** Gets the start and end coordinates for a selection range. */
|
|
431
|
+
private _getSelectionCoords;
|
|
432
|
+
/** Executes a navigation operation and applies selection options. */
|
|
433
|
+
private _navigateWithSelection;
|
|
394
434
|
}
|
|
395
435
|
|
|
396
436
|
/** The inputs for the `GridCellWidgetPattern`. */
|
|
@@ -410,7 +450,7 @@ declare class GridCellWidgetPattern {
|
|
|
410
450
|
readonly inputs: GridCellWidgetInputs;
|
|
411
451
|
/** The html element that should receive focus. */
|
|
412
452
|
readonly element: SignalLike<HTMLElement>;
|
|
413
|
-
/** The `
|
|
453
|
+
/** The `tab index` for the widget. */
|
|
414
454
|
readonly tabIndex: SignalLike<-1 | 0>;
|
|
415
455
|
/** Whether the widget is in an active state (i.e. its containing cell is active). */
|
|
416
456
|
readonly active: SignalLike<boolean>;
|
|
@@ -455,14 +495,16 @@ declare class GridCellPattern implements GridCell {
|
|
|
455
495
|
readonly element: SignalLike<HTMLElement>;
|
|
456
496
|
/** Whether the cell is active. */
|
|
457
497
|
readonly active: _angular_core.Signal<boolean>;
|
|
498
|
+
/** Whether the cell is a selection anchor. */
|
|
499
|
+
readonly anchor: SignalLike<true | undefined>;
|
|
458
500
|
/** The internal tab index calculation for the cell. */
|
|
459
501
|
private readonly _tabIndex;
|
|
460
|
-
/** The
|
|
502
|
+
/** The tab index for the cell. If the cell contains a widget, the cell's tab index is -1. */
|
|
461
503
|
readonly tabIndex: SignalLike<-1 | 0>;
|
|
462
504
|
/** Whether the widget within the cell is activated. */
|
|
463
505
|
readonly widgetActivated: SignalLike<boolean>;
|
|
464
506
|
constructor(inputs: GridCellInputs);
|
|
465
|
-
/** Gets the
|
|
507
|
+
/** Gets the tab index for the widget within the cell. */
|
|
466
508
|
widgetTabIndex(): -1 | 0;
|
|
467
509
|
}
|
|
468
510
|
|
|
@@ -489,6 +531,16 @@ interface GridInputs extends Omit<GridInputs$1<GridCellPattern>, 'cells'> {
|
|
|
489
531
|
element: SignalLike<HTMLElement>;
|
|
490
532
|
/** The rows that make up the grid. */
|
|
491
533
|
rows: SignalLike<GridRowPattern[]>;
|
|
534
|
+
/** The direction that text is read based on the users locale. */
|
|
535
|
+
textDirection: SignalLike<'rtl' | 'ltr'>;
|
|
536
|
+
/** Whether selection is enabled for the grid. */
|
|
537
|
+
enableSelection: SignalLike<boolean>;
|
|
538
|
+
/** Whether multiple cell in the grid can be selected. */
|
|
539
|
+
multi: SignalLike<boolean>;
|
|
540
|
+
/** The selection strategy used by the grid. */
|
|
541
|
+
selectionMode: SignalLike<'follow' | 'explicit'>;
|
|
542
|
+
/** Whether enable range selection. */
|
|
543
|
+
enableRangeSelection: SignalLike<boolean>;
|
|
492
544
|
/** A function that returns the grid cell associated with a given element. */
|
|
493
545
|
getCell: (e: Element) => GridCellPattern | undefined;
|
|
494
546
|
}
|
|
@@ -507,18 +559,30 @@ declare class GridPattern {
|
|
|
507
559
|
readonly activeDescendant: _angular_core.Signal<string | undefined>;
|
|
508
560
|
/** The currently active cell. */
|
|
509
561
|
readonly activeCell: _angular_core.Signal<GridCellPattern | undefined>;
|
|
562
|
+
/** The current selection anchor cell. */
|
|
563
|
+
readonly anchorCell: SignalLike<GridCellPattern | undefined>;
|
|
510
564
|
/** Whether to pause grid navigation. */
|
|
511
565
|
readonly pauseNavigation: _angular_core.Signal<boolean>;
|
|
512
566
|
/** Whether the focus is in the grid. */
|
|
513
567
|
readonly isFocused: _angular_core.WritableSignal<boolean>;
|
|
568
|
+
/** Whether the grid has been focused once. */
|
|
569
|
+
readonly hasBeenFocused: _angular_core.WritableSignal<boolean>;
|
|
514
570
|
/** Whether the user is currently dragging to select a range of cells. */
|
|
515
571
|
readonly dragging: _angular_core.WritableSignal<boolean>;
|
|
572
|
+
/** The key for navigating to the previous column. */
|
|
573
|
+
readonly prevColKey: _angular_core.Signal<"ArrowRight" | "ArrowLeft">;
|
|
574
|
+
/** The key for navigating to the next column. */
|
|
575
|
+
readonly nextColKey: _angular_core.Signal<"ArrowRight" | "ArrowLeft">;
|
|
516
576
|
/** The keydown event manager for the grid. */
|
|
517
577
|
readonly keydown: _angular_core.Signal<KeyboardEventManager<KeyboardEvent>>;
|
|
518
578
|
/** The pointerdown event manager for the grid. */
|
|
519
579
|
readonly pointerdown: _angular_core.Signal<PointerEventManager<PointerEvent>>;
|
|
520
580
|
/** The pointerup event manager for the grid. */
|
|
521
581
|
readonly pointerup: _angular_core.Signal<PointerEventManager<PointerEvent>>;
|
|
582
|
+
/** Indicates maybe the losing focus is caused by row/cell deletion. */
|
|
583
|
+
private readonly _maybeDeletion;
|
|
584
|
+
/** Indicates the losing focus is certainly caused by row/cell deletion. */
|
|
585
|
+
private readonly _deletion;
|
|
522
586
|
constructor(inputs: GridInputs);
|
|
523
587
|
/** Handles keydown events on the grid. */
|
|
524
588
|
onKeydown(event: KeyboardEvent): void;
|
|
@@ -529,13 +593,11 @@ declare class GridPattern {
|
|
|
529
593
|
/** Handles pointerup events on the grid. */
|
|
530
594
|
onPointerup(event: PointerEvent): void;
|
|
531
595
|
/** Handles focusin events on the grid. */
|
|
532
|
-
onFocusIn(
|
|
533
|
-
/** Indicates maybe the losing focus is caused by row/cell deletion. */
|
|
534
|
-
private readonly _maybeDeletion;
|
|
596
|
+
onFocusIn(): void;
|
|
535
597
|
/** Handles focusout events on the grid. */
|
|
536
598
|
onFocusOut(event: FocusEvent): void;
|
|
537
|
-
/**
|
|
538
|
-
|
|
599
|
+
/** Sets the default active state of the grid before receiving focus the first time. */
|
|
600
|
+
setDefaultStateEffect(): void;
|
|
539
601
|
/** Resets the active state of the grid if it is empty or stale. */
|
|
540
602
|
resetStateEffect(): void;
|
|
541
603
|
/** Focuses on the active cell element. */
|
package/types/accordion.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as _angular_cdk_bidi from '@angular/cdk/bidi';
|
|
2
2
|
import * as _angular_core from '@angular/core';
|
|
3
3
|
import { WritableSignal } from '@angular/core';
|
|
4
|
+
import * as i1 from '@angular/aria/private';
|
|
4
5
|
import { AccordionTriggerPattern, AccordionPanelPattern, AccordionGroupPattern } from '@angular/aria/private';
|
|
5
|
-
import * as i1 from '@angular/aria/deferred-content';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* Represents the content panel of an accordion item. It is controlled by an
|
|
@@ -70,15 +70,15 @@ declare class AccordionGroup {
|
|
|
70
70
|
multiExpandable: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
71
71
|
/** The values of the current selected/expanded accordions. */
|
|
72
72
|
value: _angular_core.ModelSignal<string[]>;
|
|
73
|
-
/** Whether disabled items
|
|
74
|
-
|
|
73
|
+
/** Whether to allow disabled items to receive focus. */
|
|
74
|
+
softDisabled: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
75
75
|
/** Whether keyboard navigation should wrap around from the last item to the first, and vice-versa. */
|
|
76
76
|
wrap: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
77
77
|
/** The UI pattern instance for this accordion group. */
|
|
78
78
|
readonly _pattern: AccordionGroupPattern;
|
|
79
79
|
constructor();
|
|
80
80
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<AccordionGroup, never>;
|
|
81
|
-
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<AccordionGroup, "[ngAccordionGroup]", ["ngAccordionGroup"], { "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "multiExpandable": { "alias": "multiExpandable"; "required": false; "isSignal": true; }; "value": { "alias": "value"; "required": false; "isSignal": true; }; "
|
|
81
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<AccordionGroup, "[ngAccordionGroup]", ["ngAccordionGroup"], { "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "multiExpandable": { "alias": "multiExpandable"; "required": false; "isSignal": true; }; "value": { "alias": "value"; "required": false; "isSignal": true; }; "softDisabled": { "alias": "softDisabled"; "required": false; "isSignal": true; }; "wrap": { "alias": "wrap"; "required": false; "isSignal": true; }; }, { "value": "valueChange"; }, ["_triggers", "_panels"], never, true, never>;
|
|
82
82
|
}
|
|
83
83
|
/**
|
|
84
84
|
* A structural directive that marks the `ng-template` to be used as the content
|