Skip to content

Commit f3b2478

Browse files
committed
Migrated build targets to ng_project and fixed breakage
1 parent 5ff1b6e commit f3b2478

File tree

9 files changed

+28
-30
lines changed

9 files changed

+28
-30
lines changed

Diff for: src/cdk-experimental/deferred-content/BUILD.bazel

+5-7
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
load("//tools:defaults.bzl", "ng_module", "ng_web_test_suite")
2-
load("//tools:defaults2.bzl", "ts_project")
1+
load("//tools:defaults.bzl", "ng_web_test_suite")
2+
load("//tools:defaults2.bzl", "ng_project", "ts_project")
33

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

6-
ng_module(
6+
ng_project(
77
name = "deferred-content",
88
srcs = glob(
99
["**/*.ts"],
1010
exclude = ["**/*.spec.ts"],
1111
),
1212
deps = [
13-
"@npm//@angular/core",
13+
"//:node_modules/@angular/core",
1414
],
1515
)
1616

@@ -21,10 +21,8 @@ ts_project(
2121
["**/*.spec.ts"],
2222
exclude = ["**/*.e2e.spec.ts"],
2323
),
24-
interop_deps = [
25-
":deferred-content",
26-
],
2724
deps = [
25+
":deferred-content",
2826
"//:node_modules/@angular/core",
2927
"//:node_modules/@angular/platform-browser",
3028
],

Diff for: src/cdk-experimental/tabs/BUILD.bazel

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
load("//tools:defaults.bzl", "ng_module")
1+
load("//tools:defaults2.bzl", "ng_project")
22

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

5-
ng_module(
5+
ng_project(
66
name = "tabs",
77
srcs = glob(
88
["**/*.ts"],

Diff for: src/cdk-experimental/tabs/tabs.ts

+3
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import {
1515
ElementRef,
1616
inject,
1717
input,
18+
signal,
1819
model,
1920
} from '@angular/core';
2021
import {Directionality} from '@angular/cdk/bidi';
@@ -126,6 +127,7 @@ export class CdkTablist {
126127
...this,
127128
items: this.tabs,
128129
textDirection: this.textDirection,
130+
value: signal<string[]>([]),
129131
});
130132
}
131133

@@ -172,6 +174,7 @@ export class CdkTab {
172174
pattern: TabPattern = new TabPattern({
173175
...this,
174176
id: () => this._id,
177+
value: () => this._id,
175178
element: () => this._elementRef.nativeElement,
176179
tablist: this.tablist,
177180
tabpanel: this.tabpanel,

Diff for: src/cdk-experimental/ui-patterns/BUILD.bazel

+1-6
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,8 @@ ts_project(
1010
),
1111
deps = [
1212
"//:node_modules/@angular/core",
13-
<<<<<<< HEAD
1413
"//src/cdk-experimental/ui-patterns/behaviors/signal-like",
1514
"//src/cdk-experimental/ui-patterns/listbox",
16-
=======
17-
"//src/cdk-experimental/ui-patterns/behaviors/signal-like:signal-like_rjs",
18-
"//src/cdk-experimental/ui-patterns/listbox:listbox_rjs",
19-
"//src/cdk-experimental/ui-patterns/tabs:tabs_rjs",
20-
>>>>>>> a9685f503 (Migrated build targets to `ts_project`)
15+
"//src/cdk-experimental/ui-patterns/tabs",
2116
],
2217
)

Diff for: src/cdk-experimental/ui-patterns/tabs/BUILD.bazel

+5-5
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ ts_project(
1010
),
1111
deps = [
1212
"//:node_modules/@angular/core",
13-
"//src/cdk-experimental/ui-patterns/behaviors/event-manager:event-manager_rjs",
14-
"//src/cdk-experimental/ui-patterns/behaviors/list-focus:list-focus_rjs",
15-
"//src/cdk-experimental/ui-patterns/behaviors/list-navigation:list-navigation_rjs",
16-
"//src/cdk-experimental/ui-patterns/behaviors/list-selection:list-selection_rjs",
17-
"//src/cdk-experimental/ui-patterns/behaviors/signal-like:signal-like_rjs",
13+
"//src/cdk-experimental/ui-patterns/behaviors/event-manager",
14+
"//src/cdk-experimental/ui-patterns/behaviors/list-focus",
15+
"//src/cdk-experimental/ui-patterns/behaviors/list-navigation",
16+
"//src/cdk-experimental/ui-patterns/behaviors/list-selection",
17+
"//src/cdk-experimental/ui-patterns/behaviors/signal-like",
1818
],
1919
)

Diff for: src/cdk-experimental/ui-patterns/tabs/tab.ts

+5-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import {TabpanelPattern} from './tabpanel';
1515
import {TablistPattern} from './tablist';
1616

1717
/** The required inputs to tabs. */
18-
export interface TabInputs extends ListNavigationItem, ListSelectionItem, ListFocusItem {
18+
export interface TabInputs extends ListNavigationItem, ListSelectionItem<string>, ListFocusItem {
1919
tablist: SignalLike<TablistPattern>;
2020
tabpanel: SignalLike<TabpanelPattern>;
2121
}
@@ -25,8 +25,11 @@ export class TabPattern {
2525
/** A unique identifier for the tab. */
2626
id: SignalLike<string>;
2727

28+
/** The value of the tab. */
29+
value = () => this.id();
30+
2831
/** Whether the tab is selected. */
29-
selected = computed(() => this.tablist().selection.inputs.selectedIds().includes(this.id()));
32+
selected = computed(() => this.tablist().selection.inputs.value().includes(this.value()));
3033

3134
/** A Tabpanel Id controlled by the tab. */
3235
controls = computed(() => this.tabpanel().id());

Diff for: src/cdk-experimental/ui-patterns/tabs/tablist.ts

+3-4
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ interface SelectOptions {
2828

2929
/** The required inputs for the tablist. */
3030
export type TablistInputs = ListNavigationInputs<TabPattern> &
31-
Omit<ListSelectionInputs<TabPattern>, 'multiselectable' | 'selectedIds'> &
31+
Omit<ListSelectionInputs<TabPattern, string>, 'multi'> &
3232
ListFocusInputs<TabPattern> & {
3333
disabled: SignalLike<boolean>;
3434
};
@@ -39,7 +39,7 @@ export class TablistPattern {
3939
navigation: ListNavigation<TabPattern>;
4040

4141
/** Controls selection for the tablist. */
42-
selection: ListSelection<TabPattern>;
42+
selection: ListSelection<TabPattern, string>;
4343

4444
/** Controls focus for the tablist. */
4545
focusManager: ListFocus<TabPattern>;
@@ -113,8 +113,7 @@ export class TablistPattern {
113113
this.selection = new ListSelection({
114114
...inputs,
115115
navigation: this.navigation,
116-
multiselectable: signal(false),
117-
selectedIds: signal<string[]>([]),
116+
multi: signal(false),
118117
});
119118
this.focusManager = new ListFocus({...inputs, navigation: this.navigation});
120119
}

Diff for: src/components-examples/cdk-experimental/tabs/BUILD.bazel

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
load("//tools:defaults.bzl", "ng_module")
1+
load("//tools:defaults2.bzl", "ng_project")
22

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

5-
ng_module(
5+
ng_project(
66
name = "tabs",
77
srcs = glob(["**/*.ts"]),
88
assets = glob([

Diff for: src/dev-app/cdk-experimental-tabs/BUILD.bazel

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
load("//tools:defaults.bzl", "ng_module")
1+
load("//tools:defaults2.bzl", "ng_project")
22

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

5-
ng_module(
5+
ng_project(
66
name = "cdk-experimental-tabs",
77
srcs = glob(["**/*.ts"]),
88
assets = ["cdk-tabs-demo.html"],

0 commit comments

Comments
 (0)