@rolatech/angular-user 19.0.0-beta.10

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/README.md ADDED
@@ -0,0 +1,3 @@
1
+ # angular-user
2
+
3
+ This library was generated with [Nx](https://nx.dev).
@@ -0,0 +1,380 @@
1
+ import * as i0 from '@angular/core';
2
+ import { Injectable, inject, model, effect, Component, ViewEncapsulation, input, output, HostBinding, signal } from '@angular/core';
3
+ import { BaseComponent, AvatarComponent, ContainerComponent, TabsComponent, TabComponent, RichViewComponent, RichItemComponent, EmptyComponent, ToolbarComponent } from '@rolatech/angular-components';
4
+ import { AuthService, AuthUserService } from '@rolatech/angular-auth';
5
+ import { BehaviorSubject } from 'rxjs';
6
+ import * as i2 from '@angular/material/button';
7
+ import { MatButtonModule } from '@angular/material/button';
8
+ import * as i1 from '@angular/material/icon';
9
+ import { MatIconModule } from '@angular/material/icon';
10
+ import { RouterLink, RouterOutlet, ActivatedRoute } from '@angular/router';
11
+ import { CourseService } from '@rolatech/angular-course';
12
+ import { CommonModule } from '@angular/common';
13
+ import { ProductService } from '@rolatech/angular-services';
14
+ import { Title } from '@angular/platform-browser';
15
+ import { map } from 'lodash';
16
+
17
+ class UserDataService {
18
+ userInfo = new BehaviorSubject(null);
19
+ data = this.userInfo.asObservable();
20
+ send(data) {
21
+ this.userInfo.next(data);
22
+ }
23
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: UserDataService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
24
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: UserDataService, providedIn: 'root' });
25
+ }
26
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: UserDataService, decorators: [{
27
+ type: Injectable,
28
+ args: [{
29
+ providedIn: 'root',
30
+ }]
31
+ }] });
32
+
33
+ class UserLayoutComponent extends BaseComponent {
34
+ authService = inject(AuthService);
35
+ authUserService = inject(AuthUserService);
36
+ userDataService = inject(UserDataService);
37
+ authenticated = this.authService.authenticated;
38
+ userInfo;
39
+ courses = [];
40
+ meta;
41
+ isFollowed = false;
42
+ username = '';
43
+ selectIndex = model(0);
44
+ path = '';
45
+ statsData;
46
+ constructor() {
47
+ super();
48
+ effect(() => {
49
+ if (this.authenticated()) {
50
+ this.checkIfFollowed();
51
+ }
52
+ });
53
+ }
54
+ ngOnInit() {
55
+ this.username = this.route.snapshot.params['username'];
56
+ this.stats();
57
+ this.findUserInfo();
58
+ this.route.params.subscribe((params) => {
59
+ if (params['path'] === 'community') {
60
+ this.selectIndex.set(1);
61
+ }
62
+ if (params['path'] === 'store') {
63
+ this.selectIndex.set(2);
64
+ }
65
+ });
66
+ }
67
+ stats() {
68
+ this.authUserService.followersStats(this.username).subscribe({
69
+ next: (res) => {
70
+ this.statsData = res.data;
71
+ },
72
+ });
73
+ }
74
+ findUserInfo() {
75
+ this.authUserService.findUserInfoByUsername(this.username).subscribe({
76
+ next: (res) => {
77
+ this.userInfo = res.data;
78
+ this.userDataService.send(res.data);
79
+ if (res.data) {
80
+ this.titleService.setTitle(`${this.userInfo.name}(@${this.userInfo.username}) - 拼小课`);
81
+ }
82
+ else {
83
+ this.titleService.setTitle(`拼小课`);
84
+ }
85
+ },
86
+ });
87
+ }
88
+ checkIfFollowed() {
89
+ this.authUserService.isFollowing(this.username).subscribe({
90
+ next: (res) => {
91
+ this.isFollowed = res.data;
92
+ },
93
+ });
94
+ }
95
+ follow() {
96
+ this.authUserService.follow(this.username).subscribe({
97
+ next: (res) => {
98
+ this.isFollowed = true;
99
+ },
100
+ });
101
+ }
102
+ unfollow() {
103
+ this.authUserService.unfollow(this.username).subscribe({
104
+ next: (res) => {
105
+ this.isFollowed = false;
106
+ },
107
+ });
108
+ }
109
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: UserLayoutComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
110
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.2", type: UserLayoutComponent, isStandalone: true, selector: "rolatech-user-layout", inputs: { selectIndex: { classPropertyName: "selectIndex", publicName: "selectIndex", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { selectIndex: "selectIndexChange" }, usesInheritance: true, ngImport: i0, template: "<rolatech-container>\n @if (userInfo) {\n <div>\n <div class=\"h-8\"></div>\n <div class=\"flex\">\n <div\n class=\"w-[80px] h-[80px] md:w-36 md:h-36 sm:w-28 sm:h-28 rounded-full border-white mr-4 bg-[--rt-raised-background]\"\n >\n @defer {\n <rolatech-avatar [src]=\"userInfo.avatar + '!w400'\" size=\"full\"> </rolatech-avatar>\n }\n </div>\n <div class=\"flex flex-col flex-grow\">\n <div class=\"flex justify-between items-center sm:mt-1\">\n <div class=\"flex items-center gap-2\">\n <div class=\"text-xl md:text-2xl font-medium\">\n <span>{{ userInfo.name }}</span>\n </div>\n <mat-icon color=\"primary\">verified</mat-icon>\n </div>\n <div>\n @if (isFollowed) {\n <button mat-flat-button (click)=\"unfollow()\" class=\"w-28 max-h-8\">\u53D6\u6D88\u5173\u6CE8</button>\n } @else {\n <button mat-flat-button (click)=\"follow()\" class=\"w-28 max-h-8\">\u5173\u6CE8</button>\n }\n </div>\n </div>\n <div class=\"text-sm text-[--rt-text-secondary]\">\n <div class=\"flex gap-3 py-2 items-center\">\n <a>\n <span>&#64;{{ userInfo.username }}</span>\n </a>\n <a class=\"cursor-pointer hover:text-orange-600\" [routerLink]=\"['./following']\">\n <span class=\"font-bold\">{{ statsData?.following }}</span>\n <span class=\"ml-1\">\u5173\u6CE8</span>\n </a>\n <a class=\"cursor-pointer hover:text-orange-600\" [routerLink]=\"['./followers']\">\n <span class=\"font-bold\">{{ statsData?.followers }}</span>\n <span class=\"ml-1\">\u7C89\u4E1D</span>\n </a>\n </div>\n <div class=\"mb-3\">\n <div>\n {{ userInfo.bio }}\n </div>\n </div>\n </div>\n </div>\n </div>\n <div class=\"py-2\">\n <rolatech-tabs [(select)]=\"selectIndex\" ngSkipHydration>\n <rolatech-tab label=\"\u8BFE\u7A0B\" routerLink=\"./\"></rolatech-tab>\n <rolatech-tab label=\"\u793E\u533A\" routerLink=\"./community\"></rolatech-tab>\n <rolatech-tab label=\"\u5546\u54C1\" routerLink=\"./store\"></rolatech-tab>\n </rolatech-tabs>\n </div>\n\n <router-outlet></router-outlet>\n </div>\n }\n</rolatech-container>\n", styles: ["mat-icon{transform:scale(.8);color:var(--rt-brand-color)}\n"], dependencies: [{ kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "component", type: ContainerComponent, selector: "rolatech-container" }, { kind: "component", type: TabsComponent, selector: "rolatech-tabs", inputs: ["select", "loading"], outputs: ["selectChange"] }, { kind: "component", type: TabComponent, selector: "rolatech-tab", inputs: ["label"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i2.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }, { kind: "directive", type: RouterOutlet, selector: "router-outlet", inputs: ["name", "routerOutletData"], outputs: ["activate", "deactivate", "attach", "detach"], exportAs: ["outlet"] }], deferBlockDependencies: [() => [AvatarComponent]] });
111
+ }
112
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: UserLayoutComponent, decorators: [{
113
+ type: Component,
114
+ args: [{ selector: 'rolatech-user-layout', imports: [
115
+ MatIconModule,
116
+ RouterLink,
117
+ ContainerComponent,
118
+ AvatarComponent,
119
+ TabsComponent,
120
+ TabComponent,
121
+ MatButtonModule,
122
+ TabsComponent,
123
+ TabComponent,
124
+ RouterOutlet,
125
+ ], template: "<rolatech-container>\n @if (userInfo) {\n <div>\n <div class=\"h-8\"></div>\n <div class=\"flex\">\n <div\n class=\"w-[80px] h-[80px] md:w-36 md:h-36 sm:w-28 sm:h-28 rounded-full border-white mr-4 bg-[--rt-raised-background]\"\n >\n @defer {\n <rolatech-avatar [src]=\"userInfo.avatar + '!w400'\" size=\"full\"> </rolatech-avatar>\n }\n </div>\n <div class=\"flex flex-col flex-grow\">\n <div class=\"flex justify-between items-center sm:mt-1\">\n <div class=\"flex items-center gap-2\">\n <div class=\"text-xl md:text-2xl font-medium\">\n <span>{{ userInfo.name }}</span>\n </div>\n <mat-icon color=\"primary\">verified</mat-icon>\n </div>\n <div>\n @if (isFollowed) {\n <button mat-flat-button (click)=\"unfollow()\" class=\"w-28 max-h-8\">\u53D6\u6D88\u5173\u6CE8</button>\n } @else {\n <button mat-flat-button (click)=\"follow()\" class=\"w-28 max-h-8\">\u5173\u6CE8</button>\n }\n </div>\n </div>\n <div class=\"text-sm text-[--rt-text-secondary]\">\n <div class=\"flex gap-3 py-2 items-center\">\n <a>\n <span>&#64;{{ userInfo.username }}</span>\n </a>\n <a class=\"cursor-pointer hover:text-orange-600\" [routerLink]=\"['./following']\">\n <span class=\"font-bold\">{{ statsData?.following }}</span>\n <span class=\"ml-1\">\u5173\u6CE8</span>\n </a>\n <a class=\"cursor-pointer hover:text-orange-600\" [routerLink]=\"['./followers']\">\n <span class=\"font-bold\">{{ statsData?.followers }}</span>\n <span class=\"ml-1\">\u7C89\u4E1D</span>\n </a>\n </div>\n <div class=\"mb-3\">\n <div>\n {{ userInfo.bio }}\n </div>\n </div>\n </div>\n </div>\n </div>\n <div class=\"py-2\">\n <rolatech-tabs [(select)]=\"selectIndex\" ngSkipHydration>\n <rolatech-tab label=\"\u8BFE\u7A0B\" routerLink=\"./\"></rolatech-tab>\n <rolatech-tab label=\"\u793E\u533A\" routerLink=\"./community\"></rolatech-tab>\n <rolatech-tab label=\"\u5546\u54C1\" routerLink=\"./store\"></rolatech-tab>\n </rolatech-tabs>\n </div>\n\n <router-outlet></router-outlet>\n </div>\n }\n</rolatech-container>\n", styles: ["mat-icon{transform:scale(.8);color:var(--rt-brand-color)}\n"] }]
126
+ }], ctorParameters: () => [] });
127
+
128
+ class UserInfoComponent extends BaseComponent {
129
+ courseService = inject(CourseService);
130
+ userDataService = inject(UserDataService);
131
+ courses = [];
132
+ meta;
133
+ constructor() {
134
+ super();
135
+ }
136
+ ngOnInit() {
137
+ this.userDataService.data.subscribe({
138
+ next: (userInfo) => {
139
+ this.findCoursesByInstructorId(userInfo.id);
140
+ },
141
+ });
142
+ }
143
+ findCoursesByInstructorId(instructorId) {
144
+ const options = {
145
+ filter: `instructorId:${instructorId},published:true`,
146
+ sort: 'updatedAt desc',
147
+ };
148
+ this.courseService.find(options).subscribe({
149
+ next: (res) => {
150
+ this.courses = res.data;
151
+ this.meta = res.meta;
152
+ },
153
+ });
154
+ }
155
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: UserInfoComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
156
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.2", type: UserInfoComponent, isStandalone: true, selector: "rolatech-user-info", usesInheritance: true, ngImport: i0, template: "<rolatech-rich-view list>\n @for (item of courses; track $index) {\n <rolatech-rich-item\n [title]=\"item.name\"\n [thumbnail]=\"item.media[0].url + '!w400'\"\n [price]=\"(item.pricing[0].total / 100).toFixed(2)\"\n [routerLink]=\"['/courses', item.id]\"\n class=\"cursor-pointer hover:bg-[--rt-raised-background]\"\n ></rolatech-rich-item>\n }\n</rolatech-rich-view>\n", styles: [""], dependencies: [{ kind: "directive", type: RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "component", type: RichViewComponent, selector: "rolatech-rich-view", inputs: ["list", "wrap"] }, { kind: "component", type: RichItemComponent, selector: "rolatech-rich-item", inputs: ["list", "thumbnail", "avatar", "title", "subtitle", "price", "thumbnailRatio"] }], encapsulation: i0.ViewEncapsulation.None });
157
+ }
158
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: UserInfoComponent, decorators: [{
159
+ type: Component,
160
+ args: [{ selector: 'rolatech-user-info', imports: [RouterLink, RichViewComponent, RichItemComponent], encapsulation: ViewEncapsulation.None, template: "<rolatech-rich-view list>\n @for (item of courses; track $index) {\n <rolatech-rich-item\n [title]=\"item.name\"\n [thumbnail]=\"item.media[0].url + '!w400'\"\n [price]=\"(item.pricing[0].total / 100).toFixed(2)\"\n [routerLink]=\"['/courses', item.id]\"\n class=\"cursor-pointer hover:bg-[--rt-raised-background]\"\n ></rolatech-rich-item>\n }\n</rolatech-rich-view>\n" }]
161
+ }], ctorParameters: () => [] });
162
+
163
+ class UserCommunityComponent {
164
+ userDataService = inject(UserDataService);
165
+ ngOnInit() {
166
+ this.userDataService.data.subscribe({
167
+ next: (userInfo) => { },
168
+ });
169
+ }
170
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: UserCommunityComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
171
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.2", type: UserCommunityComponent, isStandalone: true, selector: "rolatech-user-community", ngImport: i0, template: "<rolatech-empty></rolatech-empty>\n", styles: [""], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "component", type: EmptyComponent, selector: "rolatech-empty" }], encapsulation: i0.ViewEncapsulation.None });
172
+ }
173
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: UserCommunityComponent, decorators: [{
174
+ type: Component,
175
+ args: [{ selector: 'rolatech-user-community', imports: [CommonModule, EmptyComponent], encapsulation: ViewEncapsulation.None, template: "<rolatech-empty></rolatech-empty>\n" }]
176
+ }] });
177
+
178
+ class UserStoreComponent {
179
+ userDataService = inject(UserDataService);
180
+ productService = inject(ProductService);
181
+ products;
182
+ ngOnInit() {
183
+ this.userDataService.data.subscribe({
184
+ next: (userInfo) => {
185
+ this.findProductsByUserId(userInfo.id);
186
+ },
187
+ });
188
+ }
189
+ findProductsByUserId(userId) {
190
+ const options = {
191
+ filter: `userId:${userId}`,
192
+ sort: 'updatedAt desc',
193
+ };
194
+ this.productService.find(options).subscribe({
195
+ next: (res) => {
196
+ this.products = res.data;
197
+ },
198
+ });
199
+ }
200
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: UserStoreComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
201
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.2", type: UserStoreComponent, isStandalone: true, selector: "rolatech-user-store", ngImport: i0, template: "@if (products) {\n <div>\n <rolatech-rich-view wrap>\n @for (item of products; track item) {\n @defer {\n <rolatech-rich-item\n [routerLink]=\"['/products', item.id]\"\n [thumbnail]=\"item.media ? item.media[0].url + '!w400' : ''\"\n [title]=\"item.name\"\n [subtitle]=\"item.description\"\n [price]=\"(item.price / 100).toFixed(2)\"\n thumbnailRatio=\"square\"\n ></rolatech-rich-item>\n }\n }\n </rolatech-rich-view>\n </div>\n} @else {\n <rolatech-empty></rolatech-empty>\n}\n", styles: [""], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "component", type: EmptyComponent, selector: "rolatech-empty" }, { kind: "component", type: RichViewComponent, selector: "rolatech-rich-view", inputs: ["list", "wrap"] }], encapsulation: i0.ViewEncapsulation.None, deferBlockDependencies: [() => [RichItemComponent, import('@angular/router').then(m => m.RouterLink)]] });
202
+ }
203
+ i0.ɵɵngDeclareClassMetadataAsync({ minVersion: "18.0.0", version: "19.2.2", ngImport: i0, type: UserStoreComponent, resolveDeferredDeps: () => [import('@angular/router').then(m => m.RouterLink)], resolveMetadata: RouterLink => ({ decorators: [{
204
+ type: Component,
205
+ args: [{ selector: 'rolatech-user-store', imports: [CommonModule, EmptyComponent, RichViewComponent, RichItemComponent, RouterLink], encapsulation: ViewEncapsulation.None, template: "@if (products) {\n <div>\n <rolatech-rich-view wrap>\n @for (item of products; track item) {\n @defer {\n <rolatech-rich-item\n [routerLink]=\"['/products', item.id]\"\n [thumbnail]=\"item.media ? item.media[0].url + '!w400' : ''\"\n [title]=\"item.name\"\n [subtitle]=\"item.description\"\n [price]=\"(item.price / 100).toFixed(2)\"\n thumbnailRatio=\"square\"\n ></rolatech-rich-item>\n }\n }\n </rolatech-rich-view>\n </div>\n} @else {\n <rolatech-empty></rolatech-empty>\n}\n" }]
206
+ }], ctorParameters: null, propDecorators: null }) });
207
+
208
+ class UserItemComponent {
209
+ hasClass = true;
210
+ user = input();
211
+ isFollowing = input(true);
212
+ follow = output();
213
+ unfollow = output();
214
+ own = input();
215
+ onFollow() {
216
+ this.follow.emit(this.user().username);
217
+ }
218
+ onUnFollow() {
219
+ this.unfollow.emit(this.user().username);
220
+ }
221
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: UserItemComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
222
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.2", type: UserItemComponent, isStandalone: true, selector: "rolatech-user-item", inputs: { user: { classPropertyName: "user", publicName: "user", isSignal: true, isRequired: false, transformFunction: null }, isFollowing: { classPropertyName: "isFollowing", publicName: "isFollowing", isSignal: true, isRequired: false, transformFunction: null }, own: { classPropertyName: "own", publicName: "own", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { follow: "follow", unfollow: "unfollow" }, host: { properties: { "class.rolatech-user-item": "this.hasClass" } }, ngImport: i0, template: "<div class=\"flex w-full justify-between items-center p-2 hover:bg-[--rt-raised-background] cursor-pointer\">\n <div class=\"flex items-center\">\n <div class=\"bg-[--rt-brand-color] w-12 h-12 rounded-full\">\n @if (user().avatar) {\n <img class=\"w-12 h-12 object-cover rounded-full\" [src]=\"user().avatar\" alt=\"avatar img\" />\n }\n </div>\n <div class=\"flex flex-col ml-3\">\n <a class=\"text-lg font-bold\">\n <span>{{ user().name }}</span>\n </a>\n <a class=\"text-md\">\n <span>{{ user().username }}</span>\n </a>\n </div>\n </div>\n @if (!own()) {\n @if (isFollowing()) {\n <button mat-flat-button class=\"w-28 max-h-8\" (click)=\"onUnFollow()\">\u53D6\u6D88\u5173\u6CE8</button>\n } @else {\n <button mat-flat-button class=\"w-28 max-h-8\" (click)=\"onFollow()\">\u5173\u6CE8</button>\n }\n }\n</div>\n", styles: [""], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i2.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }], encapsulation: i0.ViewEncapsulation.None });
223
+ }
224
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: UserItemComponent, decorators: [{
225
+ type: Component,
226
+ args: [{ selector: 'rolatech-user-item', imports: [CommonModule, MatButtonModule], encapsulation: ViewEncapsulation.None, template: "<div class=\"flex w-full justify-between items-center p-2 hover:bg-[--rt-raised-background] cursor-pointer\">\n <div class=\"flex items-center\">\n <div class=\"bg-[--rt-brand-color] w-12 h-12 rounded-full\">\n @if (user().avatar) {\n <img class=\"w-12 h-12 object-cover rounded-full\" [src]=\"user().avatar\" alt=\"avatar img\" />\n }\n </div>\n <div class=\"flex flex-col ml-3\">\n <a class=\"text-lg font-bold\">\n <span>{{ user().name }}</span>\n </a>\n <a class=\"text-md\">\n <span>{{ user().username }}</span>\n </a>\n </div>\n </div>\n @if (!own()) {\n @if (isFollowing()) {\n <button mat-flat-button class=\"w-28 max-h-8\" (click)=\"onUnFollow()\">\u53D6\u6D88\u5173\u6CE8</button>\n } @else {\n <button mat-flat-button class=\"w-28 max-h-8\" (click)=\"onFollow()\">\u5173\u6CE8</button>\n }\n }\n</div>\n" }]
227
+ }], propDecorators: { hasClass: [{
228
+ type: HostBinding,
229
+ args: ['class.rolatech-user-item']
230
+ }] } });
231
+
232
+ class UserFollowInfoComponent {
233
+ title = inject(Title);
234
+ route = inject(ActivatedRoute);
235
+ authService = inject(AuthService);
236
+ authUserService = inject(AuthUserService);
237
+ authenticated = this.authService.authenticated;
238
+ userId = this.authService.userId;
239
+ tabIndex = signal(0);
240
+ userInfo;
241
+ users = [];
242
+ username = '';
243
+ path = '';
244
+ myId = '';
245
+ constructor() {
246
+ this.route.params.subscribe({
247
+ next: (params) => {
248
+ this.username = params['username'];
249
+ this.path = params.path;
250
+ },
251
+ });
252
+ effect(() => {
253
+ switch (this.tabIndex()) {
254
+ case 0:
255
+ this.listFollowingByUsername();
256
+ break;
257
+ case 1:
258
+ this.listFollowersByUsername();
259
+ break;
260
+ default:
261
+ break;
262
+ }
263
+ });
264
+ }
265
+ ngOnInit() {
266
+ if (this.path === 'following') {
267
+ this.tabIndex.set(0);
268
+ }
269
+ else {
270
+ this.tabIndex.set(1);
271
+ }
272
+ this.findUserInfo();
273
+ }
274
+ findUserInfo() {
275
+ this.authUserService.findUserInfoByUsername(this.username).subscribe({
276
+ next: (res) => {
277
+ this.userInfo = res.data;
278
+ if (res.data) {
279
+ this.title.setTitle(`${this.userInfo.name}(@${this.userInfo.username}) - 拼小课`);
280
+ }
281
+ else {
282
+ this.title.setTitle(`拼小课`);
283
+ }
284
+ },
285
+ });
286
+ }
287
+ follow(user) {
288
+ this.authUserService.follow(user.username).subscribe({
289
+ next: (res) => {
290
+ user.isFollowing = true;
291
+ },
292
+ });
293
+ }
294
+ unfollow(user) {
295
+ this.authUserService.unfollow(user.username).subscribe({
296
+ next: (res) => {
297
+ user.isFollowing = false;
298
+ if (this.myId === this.userInfo.id) {
299
+ const index = this.users.findIndex((item) => item.username === user.username);
300
+ this.users.splice(index, 1);
301
+ }
302
+ },
303
+ });
304
+ }
305
+ listFollowingByUsername() {
306
+ this.authUserService.listFollowingByUsername(this.username).subscribe({
307
+ next: (res) => {
308
+ this.users = map(res.data, 'user');
309
+ const ids = map(res.data, 'user.id');
310
+ this.friendships(ids);
311
+ },
312
+ });
313
+ }
314
+ listFollowersByUsername() {
315
+ this.authUserService.listFollowersByUsername(this.username).subscribe({
316
+ next: (res) => {
317
+ this.users = map(res.data, 'follower');
318
+ const ids = map(res.data, 'follower.id');
319
+ this.friendships(ids);
320
+ },
321
+ });
322
+ }
323
+ friendships(ids) {
324
+ if (this.authenticated()) {
325
+ this.myId = this.userId();
326
+ const index = this.users.findIndex((item) => item.id === this.myId);
327
+ if (index > 0) {
328
+ this.users.unshift(this.users.splice(index, 1)[0]);
329
+ }
330
+ this.authUserService.friendships(ids).subscribe({
331
+ next: (res) => {
332
+ this.format(res.data);
333
+ },
334
+ });
335
+ }
336
+ }
337
+ format(friendships) {
338
+ this.users.map((item) => {
339
+ item.isFollowing = friendships[item.id].following;
340
+ });
341
+ }
342
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: UserFollowInfoComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
343
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.2", type: UserFollowInfoComponent, isStandalone: true, selector: "rolatech-user-follow-info", ngImport: i0, template: "<rolatech-container>\n <rolatech-toolbar [title]=\"userInfo?.name\" link=\"../\" [subtitle]=\"userInfo?.username\"></rolatech-toolbar>\n <div class=\"mb-3\"></div>\n\n <rolatech-tabs [(select)]=\"tabIndex\">\n <rolatech-tab label=\"\u5173\u6CE8\" [routerLink]=\"['../', 'following']\"></rolatech-tab>\n <rolatech-tab label=\"\u7C89\u4E1D\" [routerLink]=\"['../', 'followers']\"></rolatech-tab>\n </rolatech-tabs>\n <div class=\"mb-3\"></div>\n @for (user of users; track $index) {\n <rolatech-user-item\n [user]=\"user\"\n [routerLink]=\"'/@' + user.username\"\n [isFollowing]=\"user.isFollowing\"\n (follow)=\"follow(user)\"\n (unfollow)=\"unfollow(user)\"\n [own]=\"user.id === myId\"\n ></rolatech-user-item>\n }\n</rolatech-container>\n", styles: [""], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "component", type: TabsComponent, selector: "rolatech-tabs", inputs: ["select", "loading"], outputs: ["selectChange"] }, { kind: "component", type: TabComponent, selector: "rolatech-tab", inputs: ["label"] }, { kind: "component", type: ContainerComponent, selector: "rolatech-container" }, { kind: "component", type: ToolbarComponent, selector: "rolatech-toolbar", inputs: ["title", "subtitle", "back", "link", "large", "divider"] }, { kind: "directive", type: RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "component", type: UserItemComponent, selector: "rolatech-user-item", inputs: ["user", "isFollowing", "own"], outputs: ["follow", "unfollow"] }], encapsulation: i0.ViewEncapsulation.None });
344
+ }
345
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: UserFollowInfoComponent, decorators: [{
346
+ type: Component,
347
+ args: [{ selector: 'rolatech-user-follow-info', imports: [CommonModule, TabsComponent, TabComponent, ContainerComponent, ToolbarComponent, RouterLink, UserItemComponent], encapsulation: ViewEncapsulation.None, template: "<rolatech-container>\n <rolatech-toolbar [title]=\"userInfo?.name\" link=\"../\" [subtitle]=\"userInfo?.username\"></rolatech-toolbar>\n <div class=\"mb-3\"></div>\n\n <rolatech-tabs [(select)]=\"tabIndex\">\n <rolatech-tab label=\"\u5173\u6CE8\" [routerLink]=\"['../', 'following']\"></rolatech-tab>\n <rolatech-tab label=\"\u7C89\u4E1D\" [routerLink]=\"['../', 'followers']\"></rolatech-tab>\n </rolatech-tabs>\n <div class=\"mb-3\"></div>\n @for (user of users; track $index) {\n <rolatech-user-item\n [user]=\"user\"\n [routerLink]=\"'/@' + user.username\"\n [isFollowing]=\"user.isFollowing\"\n (follow)=\"follow(user)\"\n (unfollow)=\"unfollow(user)\"\n [own]=\"user.id === myId\"\n ></rolatech-user-item>\n }\n</rolatech-container>\n" }]
348
+ }], ctorParameters: () => [] });
349
+
350
+ const userRoutes = [
351
+ {
352
+ path: '',
353
+ component: UserLayoutComponent,
354
+ children: [
355
+ {
356
+ path: '',
357
+ component: UserInfoComponent,
358
+ },
359
+ {
360
+ path: 'community',
361
+ component: UserCommunityComponent,
362
+ },
363
+ {
364
+ path: 'store',
365
+ component: UserStoreComponent,
366
+ },
367
+ ],
368
+ },
369
+ {
370
+ path: ':path',
371
+ component: UserFollowInfoComponent,
372
+ },
373
+ ];
374
+
375
+ /**
376
+ * Generated bundle index. Do not edit.
377
+ */
378
+
379
+ export { userRoutes };
380
+ //# sourceMappingURL=rolatech-angular-user.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rolatech-angular-user.mjs","sources":["../../../../packages/angular-user/src/lib/user-data.service.ts","../../../../packages/angular-user/src/lib/components/user-layout/user-layout.component.ts","../../../../packages/angular-user/src/lib/components/user-layout/user-layout.component.html","../../../../packages/angular-user/src/lib/pages/user-info/user-info.component.ts","../../../../packages/angular-user/src/lib/pages/user-info/user-info.component.html","../../../../packages/angular-user/src/lib/pages/user-community/user-community.component.ts","../../../../packages/angular-user/src/lib/pages/user-community/user-community.component.html","../../../../packages/angular-user/src/lib/pages/user-store/user-store.component.ts","../../../../packages/angular-user/src/lib/pages/user-store/user-store.component.html","../../../../packages/angular-user/src/lib/components/user-item/user-item.component.ts","../../../../packages/angular-user/src/lib/components/user-item/user-item.component.html","../../../../packages/angular-user/src/lib/pages/user-follow-info/user-follow-info.component.ts","../../../../packages/angular-user/src/lib/pages/user-follow-info/user-follow-info.component.html","../../../../packages/angular-user/src/lib/pages/user.routes.ts","../../../../packages/angular-user/src/rolatech-angular-user.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\nimport { BehaviorSubject } from 'rxjs';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class UserDataService {\n private userInfo = new BehaviorSubject<any>(null);\n data = this.userInfo.asObservable();\n send(data: any) {\n this.userInfo.next(data);\n }\n}\n","import { Component, effect, inject, model, OnInit } from '@angular/core';\nimport { AvatarComponent, BaseComponent, ContainerComponent, TabComponent, TabsComponent } from '@rolatech/angular-components';\nimport { AuthService, AuthUserService } from '@rolatech/angular-auth';\nimport { Course } from '@rolatech/angular-course';\nimport { UserDataService } from '../../user-data.service';\nimport { MatButtonModule } from '@angular/material/button';\nimport { MatIconModule } from '@angular/material/icon';\nimport { RouterLink, RouterOutlet } from '@angular/router';\n\n@Component({\n selector: 'rolatech-user-layout',\n imports: [\n MatIconModule,\n RouterLink,\n ContainerComponent,\n AvatarComponent,\n TabsComponent,\n TabComponent,\n MatButtonModule,\n TabsComponent,\n TabComponent,\n RouterOutlet,\n ],\n templateUrl: './user-layout.component.html',\n styleUrl: './user-layout.component.scss',\n})\nexport class UserLayoutComponent extends BaseComponent implements OnInit {\n authService = inject(AuthService);\n authUserService = inject(AuthUserService);\n userDataService = inject(UserDataService);\n authenticated = this.authService.authenticated;\n userInfo: any;\n courses: Course[] = [];\n meta: any;\n isFollowed = false;\n username = '';\n selectIndex = model(0);\n path = '';\n statsData: any;\n constructor() {\n super();\n effect(() => {\n if (this.authenticated()) {\n this.checkIfFollowed();\n }\n });\n }\n ngOnInit(): void {\n this.username = this.route.snapshot.params['username'];\n this.stats();\n this.findUserInfo();\n this.route.params.subscribe((params) => {\n if (params['path'] === 'community') {\n this.selectIndex.set(1);\n }\n if (params['path'] === 'store') {\n this.selectIndex.set(2);\n }\n });\n }\n stats() {\n this.authUserService.followersStats(this.username).subscribe({\n next: (res) => {\n this.statsData = res.data;\n },\n });\n }\n findUserInfo() {\n this.authUserService.findUserInfoByUsername(this.username).subscribe({\n next: (res) => {\n this.userInfo = res.data;\n this.userDataService.send(res.data);\n if (res.data) {\n this.titleService.setTitle(`${this.userInfo.name}(@${this.userInfo.username}) - 拼小课`);\n } else {\n this.titleService.setTitle(`拼小课`);\n }\n },\n });\n }\n\n checkIfFollowed() {\n this.authUserService.isFollowing(this.username).subscribe({\n next: (res) => {\n this.isFollowed = res.data;\n },\n });\n }\n follow() {\n this.authUserService.follow(this.username).subscribe({\n next: (res) => {\n this.isFollowed = true;\n },\n });\n }\n unfollow() {\n this.authUserService.unfollow(this.username).subscribe({\n next: (res) => {\n this.isFollowed = false;\n },\n });\n }\n}\n","<rolatech-container>\n @if (userInfo) {\n <div>\n <div class=\"h-8\"></div>\n <div class=\"flex\">\n <div\n class=\"w-[80px] h-[80px] md:w-36 md:h-36 sm:w-28 sm:h-28 rounded-full border-white mr-4 bg-[--rt-raised-background]\"\n >\n @defer {\n <rolatech-avatar [src]=\"userInfo.avatar + '!w400'\" size=\"full\"> </rolatech-avatar>\n }\n </div>\n <div class=\"flex flex-col flex-grow\">\n <div class=\"flex justify-between items-center sm:mt-1\">\n <div class=\"flex items-center gap-2\">\n <div class=\"text-xl md:text-2xl font-medium\">\n <span>{{ userInfo.name }}</span>\n </div>\n <mat-icon color=\"primary\">verified</mat-icon>\n </div>\n <div>\n @if (isFollowed) {\n <button mat-flat-button (click)=\"unfollow()\" class=\"w-28 max-h-8\">取消关注</button>\n } @else {\n <button mat-flat-button (click)=\"follow()\" class=\"w-28 max-h-8\">关注</button>\n }\n </div>\n </div>\n <div class=\"text-sm text-[--rt-text-secondary]\">\n <div class=\"flex gap-3 py-2 items-center\">\n <a>\n <span>&#64;{{ userInfo.username }}</span>\n </a>\n <a class=\"cursor-pointer hover:text-orange-600\" [routerLink]=\"['./following']\">\n <span class=\"font-bold\">{{ statsData?.following }}</span>\n <span class=\"ml-1\">关注</span>\n </a>\n <a class=\"cursor-pointer hover:text-orange-600\" [routerLink]=\"['./followers']\">\n <span class=\"font-bold\">{{ statsData?.followers }}</span>\n <span class=\"ml-1\">粉丝</span>\n </a>\n </div>\n <div class=\"mb-3\">\n <div>\n {{ userInfo.bio }}\n </div>\n </div>\n </div>\n </div>\n </div>\n <div class=\"py-2\">\n <rolatech-tabs [(select)]=\"selectIndex\" ngSkipHydration>\n <rolatech-tab label=\"课程\" routerLink=\"./\"></rolatech-tab>\n <rolatech-tab label=\"社区\" routerLink=\"./community\"></rolatech-tab>\n <rolatech-tab label=\"商品\" routerLink=\"./store\"></rolatech-tab>\n </rolatech-tabs>\n </div>\n\n <router-outlet></router-outlet>\n </div>\n }\n</rolatech-container>\n","import { Component, inject, OnInit, ViewEncapsulation } from '@angular/core';\nimport { BaseComponent, RichItemComponent, RichViewComponent } from '@rolatech/angular-components';\nimport { UserDataService } from '../../user-data.service';\nimport { CourseService, Course } from '@rolatech/angular-course';\nimport { RouterLink } from '@angular/router';\n\n@Component({\n selector: 'rolatech-user-info',\n imports: [RouterLink, RichViewComponent, RichItemComponent],\n templateUrl: './user-info.component.html',\n styleUrl: './user-info.component.scss',\n encapsulation: ViewEncapsulation.None,\n})\nexport class UserInfoComponent extends BaseComponent implements OnInit {\n courseService = inject(CourseService);\n userDataService = inject(UserDataService);\n courses: Course[] = [];\n meta: any;\n constructor() {\n super();\n }\n ngOnInit(): void {\n this.userDataService.data.subscribe({\n next: (userInfo) => {\n this.findCoursesByInstructorId(userInfo.id);\n },\n });\n }\n findCoursesByInstructorId(instructorId: string) {\n const options = {\n filter: `instructorId:${instructorId},published:true`,\n sort: 'updatedAt desc',\n };\n this.courseService.find(options).subscribe({\n next: (res: any) => {\n this.courses = res.data;\n this.meta = res.meta;\n },\n });\n }\n}\n","<rolatech-rich-view list>\n @for (item of courses; track $index) {\n <rolatech-rich-item\n [title]=\"item.name\"\n [thumbnail]=\"item.media[0].url + '!w400'\"\n [price]=\"(item.pricing[0].total / 100).toFixed(2)\"\n [routerLink]=\"['/courses', item.id]\"\n class=\"cursor-pointer hover:bg-[--rt-raised-background]\"\n ></rolatech-rich-item>\n }\n</rolatech-rich-view>\n","import { Component, inject, OnInit, ViewEncapsulation } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { UserDataService } from '../../user-data.service';\nimport { EmptyComponent } from '@rolatech/angular-components';\n\n@Component({\n selector: 'rolatech-user-community',\n imports: [CommonModule, EmptyComponent],\n templateUrl: './user-community.component.html',\n styleUrl: './user-community.component.scss',\n encapsulation: ViewEncapsulation.None,\n})\nexport class UserCommunityComponent implements OnInit {\n userDataService = inject(UserDataService);\n ngOnInit(): void {\n this.userDataService.data.subscribe({\n next: (userInfo) => {},\n });\n }\n}\n","<rolatech-empty></rolatech-empty>\n","import { Component, inject, OnInit, ViewEncapsulation } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { ProductService } from '@rolatech/angular-services';\nimport { UserDataService } from '../../user-data.service';\nimport { RouterLink } from '@angular/router';\nimport { EmptyComponent, RichViewComponent, RichItemComponent } from '@rolatech/angular-components';\n\n@Component({\n selector: 'rolatech-user-store',\n imports: [CommonModule, EmptyComponent, RichViewComponent, RichItemComponent, RouterLink],\n templateUrl: './user-store.component.html',\n styleUrl: './user-store.component.scss',\n encapsulation: ViewEncapsulation.None,\n})\nexport class UserStoreComponent implements OnInit {\n userDataService = inject(UserDataService);\n productService = inject(ProductService);\n products: any;\n ngOnInit(): void {\n this.userDataService.data.subscribe({\n next: (userInfo) => {\n this.findProductsByUserId(userInfo.id);\n },\n });\n }\n findProductsByUserId(userId: string) {\n const options = {\n filter: `userId:${userId}`,\n sort: 'updatedAt desc',\n };\n this.productService.find(options).subscribe({\n next: (res: any) => {\n this.products = res.data;\n },\n });\n }\n}\n","@if (products) {\n <div>\n <rolatech-rich-view wrap>\n @for (item of products; track item) {\n @defer {\n <rolatech-rich-item\n [routerLink]=\"['/products', item.id]\"\n [thumbnail]=\"item.media ? item.media[0].url + '!w400' : ''\"\n [title]=\"item.name\"\n [subtitle]=\"item.description\"\n [price]=\"(item.price / 100).toFixed(2)\"\n thumbnailRatio=\"square\"\n ></rolatech-rich-item>\n }\n }\n </rolatech-rich-view>\n </div>\n} @else {\n <rolatech-empty></rolatech-empty>\n}\n","import { Component, HostBinding, ViewEncapsulation, input, output } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { MatButtonModule } from '@angular/material/button';\n\n@Component({\n selector: 'rolatech-user-item',\n imports: [CommonModule, MatButtonModule],\n templateUrl: './user-item.component.html',\n styleUrl: './user-item.component.scss',\n encapsulation: ViewEncapsulation.None,\n})\nexport class UserItemComponent {\n @HostBinding('class.rolatech-user-item') hasClass = true;\n user = input<any>();\n isFollowing = input(true);\n follow = output<string>();\n unfollow = output();\n own = input();\n onFollow() {\n this.follow.emit(this.user().username);\n }\n onUnFollow() {\n this.unfollow.emit(this.user().username);\n }\n}\n","<div class=\"flex w-full justify-between items-center p-2 hover:bg-[--rt-raised-background] cursor-pointer\">\n <div class=\"flex items-center\">\n <div class=\"bg-[--rt-brand-color] w-12 h-12 rounded-full\">\n @if (user().avatar) {\n <img class=\"w-12 h-12 object-cover rounded-full\" [src]=\"user().avatar\" alt=\"avatar img\" />\n }\n </div>\n <div class=\"flex flex-col ml-3\">\n <a class=\"text-lg font-bold\">\n <span>{{ user().name }}</span>\n </a>\n <a class=\"text-md\">\n <span>{{ user().username }}</span>\n </a>\n </div>\n </div>\n @if (!own()) {\n @if (isFollowing()) {\n <button mat-flat-button class=\"w-28 max-h-8\" (click)=\"onUnFollow()\">取消关注</button>\n } @else {\n <button mat-flat-button class=\"w-28 max-h-8\" (click)=\"onFollow()\">关注</button>\n }\n }\n</div>\n","import { Component, effect, inject, OnInit, signal, ViewEncapsulation } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { Title } from '@angular/platform-browser';\nimport { ActivatedRoute, RouterLink } from '@angular/router';\nimport { AuthService, AuthUserService } from '@rolatech/angular-auth';\nimport { map } from 'lodash';\nimport { TabsComponent, TabComponent, ContainerComponent, ToolbarComponent } from '@rolatech/angular-components';\nimport { UserItemComponent } from '../../components/user-item/user-item.component';\n\n@Component({\n selector: 'rolatech-user-follow-info',\n imports: [CommonModule, TabsComponent, TabComponent, ContainerComponent, ToolbarComponent, RouterLink, UserItemComponent],\n templateUrl: './user-follow-info.component.html',\n styleUrl: './user-follow-info.component.scss',\n encapsulation: ViewEncapsulation.None,\n})\nexport class UserFollowInfoComponent implements OnInit {\n title = inject(Title);\n route = inject(ActivatedRoute);\n authService = inject(AuthService);\n authUserService = inject(AuthUserService);\n authenticated = this.authService.authenticated;\n userId = this.authService.userId;\n tabIndex = signal(0);\n userInfo: any;\n users: any[] = [];\n username = '';\n path = '';\n myId = '';\n constructor() {\n this.route.params.subscribe({\n next: (params: any) => {\n this.username = params['username'];\n this.path = params.path;\n },\n });\n effect(() => {\n switch (this.tabIndex()) {\n case 0:\n this.listFollowingByUsername();\n break;\n case 1:\n this.listFollowersByUsername();\n break;\n default:\n break;\n }\n });\n }\n ngOnInit(): void {\n if (this.path === 'following') {\n this.tabIndex.set(0);\n } else {\n this.tabIndex.set(1);\n }\n this.findUserInfo();\n }\n findUserInfo() {\n this.authUserService.findUserInfoByUsername(this.username).subscribe({\n next: (res) => {\n this.userInfo = res.data;\n if (res.data) {\n this.title.setTitle(`${this.userInfo.name}(@${this.userInfo.username}) - 拼小课`);\n } else {\n this.title.setTitle(`拼小课`);\n }\n },\n });\n }\n follow(user: any) {\n this.authUserService.follow(user.username).subscribe({\n next: (res) => {\n user.isFollowing = true;\n },\n });\n }\n unfollow(user: any) {\n this.authUserService.unfollow(user.username).subscribe({\n next: (res) => {\n user.isFollowing = false;\n if (this.myId === this.userInfo.id) {\n const index = this.users.findIndex((item) => item.username === user.username);\n this.users.splice(index, 1);\n }\n },\n });\n }\n listFollowingByUsername() {\n this.authUserService.listFollowingByUsername(this.username).subscribe({\n next: (res) => {\n this.users = map(res.data, 'user');\n const ids = map(res.data, 'user.id');\n this.friendships(ids);\n },\n });\n }\n listFollowersByUsername() {\n this.authUserService.listFollowersByUsername(this.username).subscribe({\n next: (res) => {\n this.users = map(res.data, 'follower');\n const ids = map(res.data, 'follower.id');\n this.friendships(ids);\n },\n });\n }\n friendships(ids: string[]) {\n if (this.authenticated()) {\n this.myId = this.userId();\n const index = this.users.findIndex((item) => item.id === this.myId);\n if (index > 0) {\n this.users.unshift(this.users.splice(index, 1)[0]);\n }\n this.authUserService.friendships(ids).subscribe({\n next: (res) => {\n this.format(res.data);\n },\n });\n }\n }\n format(friendships: any) {\n this.users.map((item: any) => {\n item.isFollowing = friendships[item.id].following;\n });\n }\n}\n","<rolatech-container>\n <rolatech-toolbar [title]=\"userInfo?.name\" link=\"../\" [subtitle]=\"userInfo?.username\"></rolatech-toolbar>\n <div class=\"mb-3\"></div>\n\n <rolatech-tabs [(select)]=\"tabIndex\">\n <rolatech-tab label=\"关注\" [routerLink]=\"['../', 'following']\"></rolatech-tab>\n <rolatech-tab label=\"粉丝\" [routerLink]=\"['../', 'followers']\"></rolatech-tab>\n </rolatech-tabs>\n <div class=\"mb-3\"></div>\n @for (user of users; track $index) {\n <rolatech-user-item\n [user]=\"user\"\n [routerLink]=\"'/@' + user.username\"\n [isFollowing]=\"user.isFollowing\"\n (follow)=\"follow(user)\"\n (unfollow)=\"unfollow(user)\"\n [own]=\"user.id === myId\"\n ></rolatech-user-item>\n }\n</rolatech-container>\n","import { UserLayoutComponent } from '../components/user-layout/user-layout.component';\nimport { UserInfoComponent } from './user-info/user-info.component';\nimport { UserCommunityComponent } from './user-community/user-community.component';\nimport { UserStoreComponent } from './user-store/user-store.component';\nimport { UserFollowInfoComponent } from './user-follow-info/user-follow-info.component';\n\nexport const userRoutes = [\n {\n path: '',\n component: UserLayoutComponent,\n children: [\n {\n path: '',\n component: UserInfoComponent,\n },\n {\n path: 'community',\n component: UserCommunityComponent,\n },\n {\n path: 'store',\n component: UserStoreComponent,\n },\n ],\n },\n {\n path: ':path',\n component: UserFollowIn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EAAA,uxBAAA,EAAA;;;AER1B,MAAA,UAAU,GAAG;AACxB,IAAA;AACE,QAAA,IAAI,EAAE,EAAE;AACR,QAAA,SAAS,EAAE,mBAAmB;AAC9B,QAAA,QAAQ,EAAE;AACR,YAAA;AACE,gBAAA,IAAI,EAAE,EAAE;AACR,gBAAA,SAAS,EAAE,iBAAiB;AAC7B,aAAA;AACD,YAAA;AACE,gBAAA,IAAI,EAAE,WAAW;AACjB,gBAAA,SAAS,EAAE,sBAAsB;AAClC,aAAA;AACD,YAAA;AACE,gBAAA,IAAI,EAAE,OAAO;AACb,gBAAA,SAAS,EAAE,kBAAkB;AAC9B,aAAA;AACF,SAAA;AACF,KAAA;AACD,IAAA;AACE,QAAA,IAAI,EAAE,OAAO;AACb,QAAA,SAAS,EAAE,uBAAuB;AACnC,KAAA;;;AC5BH;;AAEG;;;;"}
package/index.d.ts ADDED
@@ -0,0 +1 @@
1
+ export { userRoutes } from './lib/pages/user.routes';
@@ -0,0 +1,13 @@
1
+ import * as i0 from "@angular/core";
2
+ export declare class UserItemComponent {
3
+ hasClass: boolean;
4
+ user: import("@angular/core").InputSignal<any>;
5
+ isFollowing: import("@angular/core").InputSignal<boolean>;
6
+ follow: import("@angular/core").OutputEmitterRef<string>;
7
+ unfollow: import("@angular/core").OutputEmitterRef<void>;
8
+ own: import("@angular/core").InputSignal<unknown>;
9
+ onFollow(): void;
10
+ onUnFollow(): void;
11
+ static ɵfac: i0.ɵɵFactoryDeclaration<UserItemComponent, never>;
12
+ static ɵcmp: i0.ɵɵComponentDeclaration<UserItemComponent, "rolatech-user-item", never, { "user": { "alias": "user"; "required": false; "isSignal": true; }; "isFollowing": { "alias": "isFollowing"; "required": false; "isSignal": true; }; "own": { "alias": "own"; "required": false; "isSignal": true; }; }, { "follow": "follow"; "unfollow": "unfollow"; }, never, never, true, never>;
13
+ }
@@ -0,0 +1,29 @@
1
+ import { OnInit } from '@angular/core';
2
+ import { BaseComponent } from '@rolatech/angular-components';
3
+ import { AuthService, AuthUserService } from '@rolatech/angular-auth';
4
+ import { Course } from '@rolatech/angular-course';
5
+ import { UserDataService } from '../../user-data.service';
6
+ import * as i0 from "@angular/core";
7
+ export declare class UserLayoutComponent extends BaseComponent implements OnInit {
8
+ authService: AuthService;
9
+ authUserService: AuthUserService;
10
+ userDataService: UserDataService;
11
+ authenticated: import("@angular/core").Signal<boolean | null>;
12
+ userInfo: any;
13
+ courses: Course[];
14
+ meta: any;
15
+ isFollowed: boolean;
16
+ username: string;
17
+ selectIndex: import("@angular/core").ModelSignal<number>;
18
+ path: string;
19
+ statsData: any;
20
+ constructor();
21
+ ngOnInit(): void;
22
+ stats(): void;
23
+ findUserInfo(): void;
24
+ checkIfFollowed(): void;
25
+ follow(): void;
26
+ unfollow(): void;
27
+ static ɵfac: i0.ɵɵFactoryDeclaration<UserLayoutComponent, never>;
28
+ static ɵcmp: i0.ɵɵComponentDeclaration<UserLayoutComponent, "rolatech-user-layout", never, { "selectIndex": { "alias": "selectIndex"; "required": false; "isSignal": true; }; }, { "selectIndex": "selectIndexChange"; }, never, never, true, never>;
29
+ }
@@ -0,0 +1,9 @@
1
+ import { OnInit } from '@angular/core';
2
+ import { UserDataService } from '../../user-data.service';
3
+ import * as i0 from "@angular/core";
4
+ export declare class UserCommunityComponent implements OnInit {
5
+ userDataService: UserDataService;
6
+ ngOnInit(): void;
7
+ static ɵfac: i0.ɵɵFactoryDeclaration<UserCommunityComponent, never>;
8
+ static ɵcmp: i0.ɵɵComponentDeclaration<UserCommunityComponent, "rolatech-user-community", never, {}, {}, never, never, true, never>;
9
+ }
@@ -0,0 +1,30 @@
1
+ import { OnInit } from '@angular/core';
2
+ import { Title } from '@angular/platform-browser';
3
+ import { ActivatedRoute } from '@angular/router';
4
+ import { AuthService, AuthUserService } from '@rolatech/angular-auth';
5
+ import * as i0 from "@angular/core";
6
+ export declare class UserFollowInfoComponent implements OnInit {
7
+ title: Title;
8
+ route: ActivatedRoute;
9
+ authService: AuthService;
10
+ authUserService: AuthUserService;
11
+ authenticated: import("@angular/core").Signal<boolean | null>;
12
+ userId: import("@angular/core").Signal<string>;
13
+ tabIndex: import("@angular/core").WritableSignal<number>;
14
+ userInfo: any;
15
+ users: any[];
16
+ username: string;
17
+ path: string;
18
+ myId: string;
19
+ constructor();
20
+ ngOnInit(): void;
21
+ findUserInfo(): void;
22
+ follow(user: any): void;
23
+ unfollow(user: any): void;
24
+ listFollowingByUsername(): void;
25
+ listFollowersByUsername(): void;
26
+ friendships(ids: string[]): void;
27
+ format(friendships: any): void;
28
+ static ɵfac: i0.ɵɵFactoryDeclaration<UserFollowInfoComponent, never>;
29
+ static ɵcmp: i0.ɵɵComponentDeclaration<UserFollowInfoComponent, "rolatech-user-follow-info", never, {}, {}, never, never, true, never>;
30
+ }
@@ -0,0 +1,16 @@
1
+ import { OnInit } from '@angular/core';
2
+ import { BaseComponent } from '@rolatech/angular-components';
3
+ import { UserDataService } from '../../user-data.service';
4
+ import { CourseService, Course } from '@rolatech/angular-course';
5
+ import * as i0 from "@angular/core";
6
+ export declare class UserInfoComponent extends BaseComponent implements OnInit {
7
+ courseService: CourseService;
8
+ userDataService: UserDataService;
9
+ courses: Course[];
10
+ meta: any;
11
+ constructor();
12
+ ngOnInit(): void;
13
+ findCoursesByInstructorId(instructorId: string): void;
14
+ static ɵfac: i0.ɵɵFactoryDeclaration<UserInfoComponent, never>;
15
+ static ɵcmp: i0.ɵɵComponentDeclaration<UserInfoComponent, "rolatech-user-info", never, {}, {}, never, never, true, never>;
16
+ }
@@ -0,0 +1,13 @@
1
+ import { OnInit } from '@angular/core';
2
+ import { ProductService } from '@rolatech/angular-services';
3
+ import { UserDataService } from '../../user-data.service';
4
+ import * as i0 from "@angular/core";
5
+ export declare class UserStoreComponent implements OnInit {
6
+ userDataService: UserDataService;
7
+ productService: ProductService;
8
+ products: any;
9
+ ngOnInit(): void;
10
+ findProductsByUserId(userId: string): void;
11
+ static ɵfac: i0.ɵɵFactoryDeclaration<UserStoreComponent, never>;
12
+ static ɵcmp: i0.ɵɵComponentDeclaration<UserStoreComponent, "rolatech-user-store", never, {}, {}, never, never, true, never>;
13
+ }
@@ -0,0 +1,15 @@
1
+ import { UserLayoutComponent } from '../components/user-layout/user-layout.component';
2
+ import { UserCommunityComponent } from './user-community/user-community.component';
3
+ import { UserFollowInfoComponent } from './user-follow-info/user-follow-info.component';
4
+ export declare const userRoutes: ({
5
+ path: string;
6
+ component: typeof UserLayoutComponent;
7
+ children: {
8
+ path: string;
9
+ component: typeof UserCommunityComponent;
10
+ }[];
11
+ } | {
12
+ path: string;
13
+ component: typeof UserFollowInfoComponent;
14
+ children?: undefined;
15
+ })[];
@@ -0,0 +1,8 @@
1
+ import * as i0 from "@angular/core";
2
+ export declare class UserDataService {
3
+ private userInfo;
4
+ data: import("rxjs").Observable<any>;
5
+ send(data: any): void;
6
+ static ɵfac: i0.ɵɵFactoryDeclaration<UserDataService, never>;
7
+ static ɵprov: i0.ɵɵInjectableDeclaration<UserDataService>;
8
+ }
package/package.json ADDED
@@ -0,0 +1,42 @@
1
+ {
2
+ "name": "@rolatech/angular-user",
3
+ "version": "19.0.0-beta.10",
4
+ "private": false,
5
+ "peerDependencies": {
6
+ "@angular/core": "^19.0.0",
7
+ "@angular/common": "^19.0.0",
8
+ "@angular/router": "^19.0.0",
9
+ "@angular/material": "^19.0.0",
10
+ "@angular/platform-browser": "^19.0.0",
11
+ "@nx/angular": "^19.0.0 || ^20.0.0",
12
+ "rxjs": "^6.5.3 || ^7.4.0",
13
+ "lodash": "^4.17.21"
14
+ },
15
+ "dependencies": {
16
+ "@rolatech/angular-components": "19.0.0-beta.10",
17
+ "@rolatech/angular-services": "19.0.0-beta.10",
18
+ "@rolatech/angular-auth": "19.0.0-beta.10",
19
+ "@rolatech/angular-course": "19.0.0-beta.10",
20
+ "tslib": "^2.3.0"
21
+ },
22
+ "sideEffects": false,
23
+ "repository": {
24
+ "type": "git",
25
+ "url": "https://github.com/viablecell/rolatech-web.git"
26
+ },
27
+ "license": "MIT",
28
+ "publishConfig": {
29
+ "access": "public"
30
+ },
31
+ "module": "fesm2022/rolatech-angular-user.mjs",
32
+ "typings": "index.d.ts",
33
+ "exports": {
34
+ "./package.json": {
35
+ "default": "./package.json"
36
+ },
37
+ ".": {
38
+ "types": "./index.d.ts",
39
+ "default": "./fesm2022/rolatech-angular-user.mjs"
40
+ }
41
+ }
42
+ }
File without changes