Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion goldens/aria/listbox/index.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ class Option_2<V> {
readonly id: _angular_core.InputSignal<string>;
readonly label: _angular_core.InputSignal<string | undefined>;
readonly _pattern: OptionPattern<V>;
protected readonly searchTerm: _angular_core.Signal<string>;
readonly selected: _angular_core.Signal<boolean | undefined>;
readonly value: _angular_core.InputSignal<V>;
// (undocumented)
Expand Down
16 changes: 1 addition & 15 deletions src/aria/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
load("@bazel_lib//lib:copy_to_directory.bzl", "copy_to_directory")
load("@npm//:defs.bzl", "npm_link_all_packages")
load("//src/aria:config.bzl", "ARIA_TARGETS")
load("//tools:defaults.bzl", "ng_examples_db", "ng_package", "ts_project")
load("//tools:defaults.bzl", "ng_package", "ts_project")

package(default_visibility = ["//visibility:public"])

Expand All @@ -16,25 +16,11 @@ ts_project(
deps = ["//:node_modules/@angular/core"],
)

ng_examples_db(
name = "aria_example_database",
srcs = glob(
include = [
"examples/**/*.md",
],
# TODO: Remove this once examples are created. It should never be empty at that point.
allow_empty = True,
),
out = "resources/code-examples.db",
path = "src/aria/examples",
)

ng_package(
name = "npm_package",
package_name = "@angular/aria",
srcs = [
"package.json",
"resources/code-examples.db",
],
nested_packages = select({
"//:snapshot_adev_assets": [":adev_assets"],
Expand Down
1 change: 0 additions & 1 deletion src/aria/accordion/accordion-group.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,6 @@ export class AccordionGroup {
element: () => this.element,
activeItem: signal(undefined),
items: this._triggerPatterns,
// TODO(ok7sai): Investigate whether an accordion should support horizontal mode.
orientation: () => 'vertical',
});

Expand Down
7 changes: 1 addition & 6 deletions src/aria/listbox/option.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,6 @@ export class Option<V> {
/** A unique identifier for the option. */
readonly id = input(inject(_IdGenerator).getId('ng-option-', true));

// TODO(wagnermaciel): See if we want to change how we handle this since textContent is not
// reactive. See https://github.com/angular/components/pull/30495#discussion_r1961260216.
/** The text used by the typeahead search. */
protected readonly searchTerm = computed(() => this.label() ?? this.element.textContent);

/** The parent Listbox UIPattern. */
private readonly _listboxPattern = computed(() => this._listbox._pattern);

Expand All @@ -83,6 +78,6 @@ export class Option<V> {
value: this.value,
listbox: this._listboxPattern,
element: () => this.element,
searchTerm: () => this.searchTerm() ?? '',
searchTerm: () => this.label() ?? '',
});
}
2 changes: 0 additions & 2 deletions src/aria/menu/menu-item.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,6 @@ export class MenuItem<V> {
/** Whether the menu item is disabled. */
readonly disabled = input<boolean>(false);

// TODO(wagnermaciel): Discuss whether all inputs should be models.

/** The search term associated with the menu item. */
readonly searchTerm = model<string>('');

Expand Down
2 changes: 0 additions & 2 deletions src/aria/private/behaviors/signal-like/signal-like.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,6 @@ export function convertGetterSetterToWritableSignalLike<T>(

export function computed<T>(computation: () => T): SignalLike<T> {
const computed = createComputed(computation);
// TODO: Remove the `toString` after https://github.com/angular/angular/pull/65948 is merged.
computed.toString = () => `[Computed: ${computed()}]`;
computed[SIGNAL].debugName = '';
return computed;
}
Expand Down
4 changes: 3 additions & 1 deletion src/aria/private/behaviors/tree/tree.ts
Original file line number Diff line number Diff line change
Expand Up @@ -260,9 +260,11 @@ export class Tree<T extends TreeItem<V, T>, V> {
item ??= this.inputs.activeItem();
if (!item) return;

// If the item has a parent, get all of the parent's children.
// Otherwise, it is a root item, and get all other root items.
const parent = item.parent?.();
// TODO: This assumes that items without a parent are root items.
const siblings = parent ? parent.children?.() : this.inputs.items().filter(i => !i.parent?.());

siblings?.forEach(s => this.expand(s));
}

Expand Down
Loading