@angular/aria 22.0.0-next.7 → 22.0.0-rc.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fesm2022/_accordion-chunk.mjs +11 -1
- package/fesm2022/_accordion-chunk.mjs.map +1 -1
- package/fesm2022/_click-event-manager-chunk.mjs +1 -1
- package/fesm2022/_deferred-content-chunk.mjs +6 -6
- package/fesm2022/_list-chunk.mjs +4 -1
- package/fesm2022/_list-chunk.mjs.map +1 -1
- package/fesm2022/_list-navigation-chunk.mjs +1 -1
- package/fesm2022/_list-typeahead-chunk.mjs +1 -1
- package/fesm2022/_menu-chunk.mjs +10 -1
- package/fesm2022/_menu-chunk.mjs.map +1 -1
- package/fesm2022/{_combobox-listbox-chunk.mjs → _option-chunk.mjs} +13 -50
- package/fesm2022/_option-chunk.mjs.map +1 -0
- package/fesm2022/_tabs-chunk.mjs +1 -1
- package/fesm2022/_toolbar-widget-group-chunk.mjs +10 -1
- package/fesm2022/_toolbar-widget-group-chunk.mjs.map +1 -1
- package/fesm2022/_transforms-chunk.mjs +8 -0
- package/fesm2022/_transforms-chunk.mjs.map +1 -0
- package/fesm2022/{_combobox-tree-chunk.mjs → _tree-chunk.mjs} +8 -48
- package/fesm2022/_tree-chunk.mjs.map +1 -0
- package/fesm2022/{_signal-like-chunk.mjs → _violations-chunk.mjs} +60 -2
- package/fesm2022/_violations-chunk.mjs.map +1 -0
- package/fesm2022/_widget-chunk.mjs +46 -15
- package/fesm2022/_widget-chunk.mjs.map +1 -1
- package/fesm2022/accordion.mjs +116 -89
- package/fesm2022/accordion.mjs.map +1 -1
- package/fesm2022/aria.mjs +1 -1
- package/fesm2022/aria.mjs.map +1 -1
- package/fesm2022/combobox-testing.mjs +79 -0
- package/fesm2022/combobox-testing.mjs.map +1 -0
- package/fesm2022/combobox.mjs +273 -307
- package/fesm2022/combobox.mjs.map +1 -1
- package/fesm2022/grid-testing.mjs +8 -0
- package/fesm2022/grid-testing.mjs.map +1 -1
- package/fesm2022/grid.mjs +75 -87
- package/fesm2022/grid.mjs.map +1 -1
- package/fesm2022/listbox-testing.mjs +4 -0
- package/fesm2022/listbox-testing.mjs.map +1 -1
- package/fesm2022/listbox.mjs +192 -215
- package/fesm2022/listbox.mjs.map +1 -1
- package/fesm2022/menu-testing.mjs +11 -0
- package/fesm2022/menu-testing.mjs.map +1 -1
- package/fesm2022/menu.mjs +60 -66
- package/fesm2022/menu.mjs.map +1 -1
- package/fesm2022/private.mjs +19 -13
- package/fesm2022/private.mjs.map +1 -1
- package/fesm2022/tabs.mjs +172 -115
- package/fesm2022/tabs.mjs.map +1 -1
- package/fesm2022/toolbar-testing.mjs +5 -1
- package/fesm2022/toolbar-testing.mjs.map +1 -1
- package/fesm2022/toolbar.mjs +41 -30
- package/fesm2022/toolbar.mjs.map +1 -1
- package/fesm2022/tree-testing.mjs +12 -0
- package/fesm2022/tree-testing.mjs.map +1 -1
- package/fesm2022/tree.mjs +126 -156
- package/fesm2022/tree.mjs.map +1 -1
- package/package.json +6 -6
- package/types/_accordion-chunk.d.ts +4 -2
- package/types/_collection-chunk.d.ts +42 -0
- package/types/_expansion-chunk.d.ts +1 -1
- package/types/_grid-chunk.d.ts +11 -3
- package/types/_keyboard-event-manager-chunk.d.ts +1 -1
- package/types/_list-chunk.d.ts +1 -1
- package/types/_list-navigation-chunk.d.ts +1 -1
- package/types/_listbox-chunk.d.ts +1 -1
- package/types/_menu-chunk.d.ts +3 -1
- package/types/_tabs-chunk.d.ts +1 -1
- package/types/_toolbar-chunk.d.ts +3 -1
- package/types/_tree-chunk.d.ts +1 -1
- package/types/accordion.d.ts +10 -18
- package/types/combobox-testing.d.ts +63 -0
- package/types/combobox.d.ts +96 -193
- package/types/grid-testing.d.ts +4 -0
- package/types/grid.d.ts +99 -103
- package/types/listbox-testing.d.ts +25 -0
- package/types/listbox.d.ts +53 -62
- package/types/menu-testing.d.ts +6 -0
- package/types/menu.d.ts +17 -23
- package/types/private.d.ts +26 -137
- package/types/tabs.d.ts +69 -80
- package/types/toolbar-testing.d.ts +4 -0
- package/types/toolbar.d.ts +6 -12
- package/types/tree-testing.d.ts +8 -0
- package/types/tree.d.ts +7 -20
- package/fesm2022/_combobox-chunk.mjs +0 -478
- package/fesm2022/_combobox-chunk.mjs.map +0 -1
- package/fesm2022/_combobox-listbox-chunk.mjs.map +0 -1
- package/fesm2022/_combobox-tree-chunk.mjs.map +0 -1
- package/fesm2022/_element-chunk.mjs +0 -6
- package/fesm2022/_element-chunk.mjs.map +0 -1
- package/fesm2022/_signal-like-chunk.mjs.map +0 -1
- package/fesm2022/simple-combobox.mjs +0 -443
- package/fesm2022/simple-combobox.mjs.map +0 -1
- package/types/_combobox-chunk.d.ts +0 -224
- package/types/_element-chunk.d.ts +0 -10
- package/types/_signal-like-chunk.d.ts +0 -14
- package/types/simple-combobox.d.ts +0 -124
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { computed, signal, linkedSignal, KeyboardEventManager, Modifier } from './
|
|
1
|
+
import { computed, signal, linkedSignal, KeyboardEventManager, Modifier } from './_violations-chunk.mjs';
|
|
2
2
|
import { ClickEventManager } from './_click-event-manager-chunk.mjs';
|
|
3
3
|
import { untracked } from '@angular/core/primitives/signals';
|
|
4
4
|
import { ElementRef } from '@angular/core';
|
|
@@ -707,6 +707,16 @@ class GridPattern {
|
|
|
707
707
|
cells: computed(() => this.inputs.rows().map(row => row.inputs.cells()))
|
|
708
708
|
});
|
|
709
709
|
}
|
|
710
|
+
validate() {
|
|
711
|
+
const violations = [];
|
|
712
|
+
const rows = this.inputs.rows();
|
|
713
|
+
for (const row of rows) {
|
|
714
|
+
if (row.inputs.cells().length === 0) {
|
|
715
|
+
violations.push('ngGridRow must contain at least one ngGridCell.');
|
|
716
|
+
}
|
|
717
|
+
}
|
|
718
|
+
return violations;
|
|
719
|
+
}
|
|
710
720
|
onKeydown(event) {
|
|
711
721
|
if (this.disabled()) return;
|
|
712
722
|
this.hasBeenInteracted.set(true);
|
|
@@ -831,11 +841,6 @@ class GridCellPattern {
|
|
|
831
841
|
onKeydown(event) {
|
|
832
842
|
if (this.disabled()) return;
|
|
833
843
|
this.widget()?.onKeydown(event);
|
|
834
|
-
if (this.widget()?.inputs.widgetType() === 'simple') {
|
|
835
|
-
if (event.key === 'Enter' || event.key === ' ') {
|
|
836
|
-
this.inputs.onActivate?.(event);
|
|
837
|
-
}
|
|
838
|
-
}
|
|
839
844
|
}
|
|
840
845
|
onFocusIn(event) {
|
|
841
846
|
this.isFocused.set(true);
|
|
@@ -877,23 +882,31 @@ class GridCellWidgetPattern {
|
|
|
877
882
|
element = () => this.inputs.element();
|
|
878
883
|
widgetHost = () => resolveElement(this.inputs.focusTarget(), this.element()) ?? this.element();
|
|
879
884
|
disabled = computed(() => this.inputs.disabled() || this.inputs.cell().disabled());
|
|
880
|
-
tabIndex = computed(() =>
|
|
885
|
+
tabIndex = computed(() => {
|
|
886
|
+
if (this.inputs.focusTarget()) {
|
|
887
|
+
return -1;
|
|
888
|
+
}
|
|
889
|
+
return this.inputs.cell().widgetTabIndex();
|
|
890
|
+
});
|
|
881
891
|
active = computed(() => this.inputs.cell().active() && this.inputs.cell().widget() === this);
|
|
882
892
|
isActivated = signal(false);
|
|
883
893
|
lastActivateEvent = signal(undefined);
|
|
884
894
|
lastDeactivateEvent = signal(undefined);
|
|
885
895
|
keydown = computed(() => {
|
|
886
896
|
const manager = new KeyboardEventManager();
|
|
887
|
-
if (this.
|
|
888
|
-
manager.on('
|
|
889
|
-
|
|
890
|
-
|
|
897
|
+
if (this.inputs.widgetType() === 'simple') {
|
|
898
|
+
return manager.on('Enter', e => this.inputs.onActivate?.(e), {
|
|
899
|
+
preventDefault: false,
|
|
900
|
+
stopPropagation: false
|
|
901
|
+
}).on(' ', e => this.inputs.onActivate?.(e), {
|
|
902
|
+
preventDefault: false,
|
|
903
|
+
stopPropagation: false
|
|
891
904
|
});
|
|
905
|
+
}
|
|
906
|
+
if (this.isActivated()) {
|
|
907
|
+
manager.on('Escape', e => this.deactivate(e));
|
|
892
908
|
if (this.inputs.widgetType() === 'editable') {
|
|
893
|
-
manager.on('Enter', e =>
|
|
894
|
-
this.deactivate(e);
|
|
895
|
-
this.focus();
|
|
896
|
-
});
|
|
909
|
+
manager.on('Enter', e => this.deactivate(e));
|
|
897
910
|
}
|
|
898
911
|
return manager;
|
|
899
912
|
}
|
|
@@ -927,6 +940,24 @@ class GridCellWidgetPattern {
|
|
|
927
940
|
focus() {
|
|
928
941
|
this.widgetHost().focus();
|
|
929
942
|
}
|
|
943
|
+
activationEffect() {
|
|
944
|
+
if (this.isActivated()) {
|
|
945
|
+
const event = this.lastActivateEvent();
|
|
946
|
+
this.inputs.onActivate?.(event);
|
|
947
|
+
if (this.inputs.focusTarget()) {
|
|
948
|
+
this.focus();
|
|
949
|
+
}
|
|
950
|
+
}
|
|
951
|
+
}
|
|
952
|
+
deactivationEffect() {
|
|
953
|
+
const event = this.lastDeactivateEvent();
|
|
954
|
+
if (event) {
|
|
955
|
+
this.inputs.onDeactivate?.(event);
|
|
956
|
+
if (event instanceof KeyboardEvent) {
|
|
957
|
+
this.focus();
|
|
958
|
+
}
|
|
959
|
+
}
|
|
960
|
+
}
|
|
930
961
|
activate(event) {
|
|
931
962
|
if (this.isActivated()) return;
|
|
932
963
|
if (this.inputs.widgetType() === 'simple') return;
|