@yelon/bis 18.1.1 → 18.1.3

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.
@@ -43,8 +43,8 @@ export class YunzaiHeaderI18nComponent {
43
43
  ngOnDestroy() {
44
44
  this.destroy$.complete();
45
45
  }
46
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.6", ngImport: i0, type: YunzaiHeaderI18nComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
47
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.0.6", type: YunzaiHeaderI18nComponent, isStandalone: true, selector: "yunzai-header-i18n", inputs: { showLangText: ["showLangText", "showLangText", booleanAttribute] }, host: { properties: { "class.flex-1": "true" } }, ngImport: i0, template: `
46
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.6", ngImport: i0, type: YunzaiHeaderI18nComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
47
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.6", type: YunzaiHeaderI18nComponent, isStandalone: true, selector: "yunzai-header-i18n", inputs: { showLangText: ["showLangText", "showLangText", booleanAttribute] }, host: { properties: { "class.flex-1": "true" } }, ngImport: i0, template: `
48
48
  @if (showLangText) {
49
49
  <div nz-dropdown [nzDropdownMenu]="langMenu" nzPlacement="bottomRight">
50
50
  <i nz-icon nzType="global"></i>
@@ -83,7 +83,7 @@ export class YunzaiHeaderI18nComponent {
83
83
  </nz-dropdown-menu>
84
84
  `, isInline: true, dependencies: [{ kind: "ngmodule", type: NzDropDownModule }, { kind: "directive", type: i1.NzMenuDirective, selector: "[nz-menu]", inputs: ["nzInlineIndent", "nzTheme", "nzMode", "nzInlineCollapsed", "nzSelectable"], outputs: ["nzClick"], exportAs: ["nzMenu"] }, { kind: "component", type: i1.NzMenuItemComponent, selector: "[nz-menu-item]", inputs: ["nzPaddingLeft", "nzDisabled", "nzSelected", "nzDanger", "nzMatchRouterExact", "nzMatchRouter"], exportAs: ["nzMenuItem"] }, { kind: "directive", type: i2.NzDropDownDirective, selector: "[nz-dropdown]", inputs: ["nzDropdownMenu", "nzTrigger", "nzMatchWidthElement", "nzBackdrop", "nzClickHide", "nzDisabled", "nzVisible", "nzOverlayClassName", "nzOverlayStyle", "nzPlacement"], outputs: ["nzVisibleChange"], exportAs: ["nzDropdown"] }, { kind: "component", type: i2.NzDropdownMenuComponent, selector: "nz-dropdown-menu", exportAs: ["nzDropdownMenu"] }, { kind: "ngmodule", type: NzIconModule }, { kind: "directive", type: i3.NzIconDirective, selector: "[nz-icon]", inputs: ["nzSpin", "nzRotate", "nzType", "nzTheme", "nzTwotoneColor", "nzIconfont"], exportAs: ["nzIcon"] }, { kind: "pipe", type: I18nPipe, name: "i18n" }, { kind: "ngmodule", type: CommonModule }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
85
85
  }
86
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.6", ngImport: i0, type: YunzaiHeaderI18nComponent, decorators: [{
86
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.6", ngImport: i0, type: YunzaiHeaderI18nComponent, decorators: [{
87
87
  type: Component,
88
88
  args: [{
89
89
  selector: `yunzai-header-i18n`,
@@ -144,8 +144,8 @@ export class YunzaiHeaderNotifyComponent {
144
144
  ngOnDestroy() {
145
145
  this.subs.forEach(a => a.unsubscribe());
146
146
  }
147
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.6", ngImport: i0, type: YunzaiHeaderNotifyComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
148
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.0.6", type: YunzaiHeaderNotifyComponent, isStandalone: true, selector: "yunzai-header-notify", ngImport: i0, template: `
147
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.6", ngImport: i0, type: YunzaiHeaderNotifyComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
148
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.6", type: YunzaiHeaderNotifyComponent, isStandalone: true, selector: "yunzai-header-notify", ngImport: i0, template: `
149
149
  <notice-icon
150
150
  [data]="data"
151
151
  [count]="count"
@@ -157,7 +157,7 @@ export class YunzaiHeaderNotifyComponent {
157
157
  />
158
158
  `, isInline: true, dependencies: [{ kind: "ngmodule", type: NoticeIconModule }, { kind: "component", type: i1.NoticeIconComponent, selector: "notice-icon", inputs: ["data", "count", "loading", "popoverVisible", "btnClass", "btnIconClass", "centered"], outputs: ["select", "clear", "popoverVisibleChange"], exportAs: ["noticeIcon"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
159
159
  }
160
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.6", ngImport: i0, type: YunzaiHeaderNotifyComponent, decorators: [{
160
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.6", ngImport: i0, type: YunzaiHeaderNotifyComponent, decorators: [{
161
161
  type: Component,
162
162
  args: [{
163
163
  selector: `yunzai-header-notify`,
@@ -48,8 +48,8 @@ export class YunzaiHeaderUserComponent {
48
48
  this.msg.error('该菜单没有配置链接!');
49
49
  }
50
50
  }
51
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.6", ngImport: i0, type: YunzaiHeaderUserComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
52
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.0.6", type: YunzaiHeaderUserComponent, isStandalone: true, selector: "yunzai-header-user", ngImport: i0, template: `
51
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.6", ngImport: i0, type: YunzaiHeaderUserComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
52
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.6", type: YunzaiHeaderUserComponent, isStandalone: true, selector: "yunzai-header-user", ngImport: i0, template: `
53
53
  <div
54
54
  class="yunzai-default__nav-item d-flex align-items-center px-sm"
55
55
  data-event-id="_nav_user"
@@ -79,7 +79,7 @@ export class YunzaiHeaderUserComponent {
79
79
  </nz-dropdown-menu>
80
80
  `, isInline: true, dependencies: [{ kind: "ngmodule", type: NzDropDownModule }, { kind: "directive", type: i1.NzMenuDirective, selector: "[nz-menu]", inputs: ["nzInlineIndent", "nzTheme", "nzMode", "nzInlineCollapsed", "nzSelectable"], outputs: ["nzClick"], exportAs: ["nzMenu"] }, { kind: "component", type: i1.NzMenuItemComponent, selector: "[nz-menu-item]", inputs: ["nzPaddingLeft", "nzDisabled", "nzSelected", "nzDanger", "nzMatchRouterExact", "nzMatchRouter"], exportAs: ["nzMenuItem"] }, { kind: "directive", type: i1.NzMenuDividerDirective, selector: "[nz-menu-divider]", exportAs: ["nzMenuDivider"] }, { kind: "directive", type: i2.NzDropDownDirective, selector: "[nz-dropdown]", inputs: ["nzDropdownMenu", "nzTrigger", "nzMatchWidthElement", "nzBackdrop", "nzClickHide", "nzDisabled", "nzVisible", "nzOverlayClassName", "nzOverlayStyle", "nzPlacement"], outputs: ["nzVisibleChange"], exportAs: ["nzDropdown"] }, { kind: "component", type: i2.NzDropdownMenuComponent, selector: "nz-dropdown-menu", exportAs: ["nzDropdownMenu"] }, { kind: "pipe", type: I18nPipe, name: "i18n" }, { kind: "ngmodule", type: NzIconModule }, { kind: "directive", type: i3.NzIconDirective, selector: "[nz-icon]", inputs: ["nzSpin", "nzRotate", "nzType", "nzTheme", "nzTwotoneColor", "nzIconfont"], exportAs: ["nzIcon"] }, { kind: "ngmodule", type: NzAvatarModule }, { kind: "component", type: i4.NzAvatarComponent, selector: "nz-avatar", inputs: ["nzShape", "nzSize", "nzGap", "nzText", "nzSrc", "nzSrcSet", "nzAlt", "nzIcon"], outputs: ["nzError"], exportAs: ["nzAvatar"] }, { kind: "ngmodule", type: RouterModule }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
81
81
  }
82
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.6", ngImport: i0, type: YunzaiHeaderUserComponent, decorators: [{
82
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.6", ngImport: i0, type: YunzaiHeaderUserComponent, decorators: [{
83
83
  type: Component,
84
84
  args: [{
85
85
  selector: `yunzai-header-user`,
@@ -20,8 +20,8 @@ const COMPONENTS = [
20
20
  YunzaiHeaderUserComponent
21
21
  ];
22
22
  export class YunzaiWidgetsModule {
23
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.6", ngImport: i0, type: YunzaiWidgetsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
24
- static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.0.6", ngImport: i0, type: YunzaiWidgetsModule, imports: [NzAvatarModule,
23
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.6", ngImport: i0, type: YunzaiWidgetsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
24
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.2.6", ngImport: i0, type: YunzaiWidgetsModule, imports: [NzAvatarModule,
25
25
  RouterModule,
26
26
  NoticeIconModule,
27
27
  NzDropDownModule,
@@ -36,14 +36,14 @@ export class YunzaiWidgetsModule {
36
36
  YunzaiHeaderNotifyComponent,
37
37
  YunzaiHeaderI18nComponent,
38
38
  YunzaiHeaderUserComponent] }); }
39
- static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.0.6", ngImport: i0, type: YunzaiWidgetsModule, imports: [NzAvatarModule,
39
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.2.6", ngImport: i0, type: YunzaiWidgetsModule, imports: [NzAvatarModule,
40
40
  RouterModule,
41
41
  NoticeIconModule,
42
42
  NzDropDownModule,
43
43
  CommonModule,
44
44
  NzIconModule, COMPONENTS] }); }
45
45
  }
46
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.6", ngImport: i0, type: YunzaiWidgetsModule, decorators: [{
46
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.6", ngImport: i0, type: YunzaiWidgetsModule, decorators: [{
47
47
  type: NgModule,
48
48
  args: [{
49
49
  imports: [
package/fesm2022/bis.mjs CHANGED
@@ -1,25 +1,32 @@
1
1
  import * as i0 from '@angular/core';
2
- import { NgModule, importProvidersFrom, makeEnvironmentProviders, inject, APP_INITIALIZER, Injector, Injectable, Inject } from '@angular/core';
2
+ import { NgModule, importProvidersFrom, makeEnvironmentProviders, inject, APP_INITIALIZER, Injector, Injectable, Inject, Component, ChangeDetectionStrategy, Input } from '@angular/core';
3
3
  import { YunzaiLayoutModule } from '@yelon/bis/layout';
4
4
  import { YunzaiWidgetsModule } from '@yelon/bis/yunzai-widgets';
5
5
  import * as i2 from '@angular/router';
6
- import { Router } from '@angular/router';
6
+ import { Router, RouterOutlet } from '@angular/router';
7
7
  import { YA_SERVICE_TOKEN } from '@yelon/auth';
8
- import { YUNZAI_I18N_TOKEN, IGNORE_BASE_URL, MenuService, TitleService, SettingsService } from '@yelon/theme';
8
+ import { YUNZAI_I18N_TOKEN, IGNORE_BASE_URL, MenuService, TitleService, SettingsService, I18nPipe } from '@yelon/theme';
9
9
  import { NzNotificationService } from 'ng-zorro-antd/notification';
10
10
  import { HttpClient, HttpErrorResponse, HttpResponseBase } from '@angular/common/http';
11
- import { BehaviorSubject, throwError, filter, take, switchMap, catchError, of, mergeMap, EMPTY, combineLatest, map } from 'rxjs';
11
+ import { BehaviorSubject, throwError, filter, take, switchMap, catchError, of, mergeMap, map, EMPTY, combineLatest } from 'rxjs';
12
12
  import { mergeBisConfig, BUSINESS_DEFAULT_CONFIG } from '@yelon/bis/config';
13
13
  import * as i1 from '@yelon/util';
14
14
  import { log, YUNZAI_CONFIG, YunzaiConfigService, WINDOW, useLocalStorageTenant, useLocalStorageUser, useLocalStorageHeader, useLocalStorageProjectInfo, useLocalStorageDefaultRoute, useLocalStorageCurrent, deepCopy } from '@yelon/util';
15
15
  import { ACLService } from '@yelon/acl';
16
+ import { NgTemplateOutlet, NgFor, NgIf } from '@angular/common';
17
+ import * as i2$1 from 'ng-zorro-antd/dropdown';
18
+ import { NzDropDownModule } from 'ng-zorro-antd/dropdown';
19
+ import { NzI18nModule } from 'ng-zorro-antd/i18n';
20
+ import * as i3 from 'ng-zorro-antd/icon';
21
+ import { NzIconModule } from 'ng-zorro-antd/icon';
22
+ import * as i1$1 from 'ng-zorro-antd/menu';
16
23
 
17
24
  class BisModule {
18
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.6", ngImport: i0, type: BisModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
19
- static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.0.6", ngImport: i0, type: BisModule, imports: [YunzaiLayoutModule, YunzaiWidgetsModule], exports: [YunzaiLayoutModule, YunzaiWidgetsModule] }); }
20
- static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.0.6", ngImport: i0, type: BisModule, imports: [YunzaiLayoutModule, YunzaiWidgetsModule, YunzaiLayoutModule, YunzaiWidgetsModule] }); }
25
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.6", ngImport: i0, type: BisModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
26
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.2.6", ngImport: i0, type: BisModule, imports: [YunzaiLayoutModule, YunzaiWidgetsModule], exports: [YunzaiLayoutModule, YunzaiWidgetsModule] }); }
27
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.2.6", ngImport: i0, type: BisModule, imports: [YunzaiLayoutModule, YunzaiWidgetsModule, YunzaiLayoutModule, YunzaiWidgetsModule] }); }
21
28
  }
22
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.6", ngImport: i0, type: BisModule, decorators: [{
29
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.6", ngImport: i0, type: BisModule, decorators: [{
23
30
  type: NgModule,
24
31
  args: [{
25
32
  imports: [YunzaiLayoutModule, YunzaiWidgetsModule],
@@ -226,7 +233,7 @@ class YunzaiStartupService {
226
233
  this.configService = inject(YunzaiConfigService);
227
234
  }
228
235
  load(param) {
229
- let defaultLang = this.settingService.layout.lang || this.i18n.defaultLang;
236
+ let defaultLang = this.settingService.layout.lang || this.i18n.defaultLang || 'zh-CN';
230
237
  const [setTenant] = useLocalStorageTenant();
231
238
  const [setUser, getUser] = useLocalStorageUser();
232
239
  const [setHeader] = useLocalStorageHeader();
@@ -235,7 +242,10 @@ class YunzaiStartupService {
235
242
  const [setCurrent] = useLocalStorageCurrent();
236
243
  return this.token(param).pipe(mergeMap((token) => {
237
244
  if (token === false) {
238
- return this.i18n.loadLocaleData(defaultLang).pipe(mergeMap(() => EMPTY));
245
+ return this.i18n.loadLocaleData(defaultLang).pipe(map((langData) => {
246
+ this.i18n.use(defaultLang, langData);
247
+ this.settingService.setLayout('lang', defaultLang);
248
+ }), mergeMap(() => EMPTY));
239
249
  }
240
250
  this.configService.set('auth', {
241
251
  token_send_key: 'Authorization',
@@ -329,6 +339,10 @@ class YunzaiStartupService {
329
339
  return response.data;
330
340
  case 2001:
331
341
  if (!force && !auto) {
342
+ // 自动认证为false情况下会出现: 后台已经下线,但是用户进入网页存储了上次的cookie,Token,所以网页还是登录状态
343
+ // 在这里如果2001时自动清理客户端过时的token以保证页面显示登录状态正常
344
+ localStorage.clear();
345
+ this.tokenService.clear();
332
346
  return false;
333
347
  }
334
348
  this.win.location.href = response.msg;
@@ -350,10 +364,10 @@ class YunzaiStartupService {
350
364
  }));
351
365
  }
352
366
  }
353
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.6", ngImport: i0, type: YunzaiStartupService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
354
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.6", ngImport: i0, type: YunzaiStartupService }); }
367
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.6", ngImport: i0, type: YunzaiStartupService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
368
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.6", ngImport: i0, type: YunzaiStartupService }); }
355
369
  }
356
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.6", ngImport: i0, type: YunzaiStartupService, decorators: [{
370
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.6", ngImport: i0, type: YunzaiStartupService, decorators: [{
357
371
  type: Injectable
358
372
  }] });
359
373
  function mapYzSideToYelonMenu(menus) {
@@ -465,10 +479,10 @@ class YunzaiAnalysisAddonGuardService {
465
479
  }
466
480
  });
467
481
  }
468
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.6", ngImport: i0, type: YunzaiAnalysisAddonGuardService, deps: [{ token: i1.YunzaiConfigService }, { token: i1.PathToRegexpService }, { token: WINDOW }, { token: YA_SERVICE_TOKEN }], target: i0.ɵɵFactoryTarget.Injectable }); }
469
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.6", ngImport: i0, type: YunzaiAnalysisAddonGuardService, providedIn: 'root' }); }
482
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.6", ngImport: i0, type: YunzaiAnalysisAddonGuardService, deps: [{ token: i1.YunzaiConfigService }, { token: i1.PathToRegexpService }, { token: WINDOW }, { token: YA_SERVICE_TOKEN }], target: i0.ɵɵFactoryTarget.Injectable }); }
483
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.6", ngImport: i0, type: YunzaiAnalysisAddonGuardService, providedIn: 'root' }); }
470
484
  }
471
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.6", ngImport: i0, type: YunzaiAnalysisAddonGuardService, decorators: [{
485
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.6", ngImport: i0, type: YunzaiAnalysisAddonGuardService, decorators: [{
472
486
  type: Injectable,
473
487
  args: [{
474
488
  providedIn: 'root'
@@ -555,19 +569,179 @@ class ActGuardService {
555
569
  }
556
570
  });
557
571
  }
558
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.6", ngImport: i0, type: ActGuardService, deps: [{ token: i1.YunzaiConfigService }, { token: i1.PathToRegexpService }, { token: i2.Router }], target: i0.ɵɵFactoryTarget.Injectable }); }
559
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.6", ngImport: i0, type: ActGuardService, providedIn: 'root' }); }
572
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.6", ngImport: i0, type: ActGuardService, deps: [{ token: i1.YunzaiConfigService }, { token: i1.PathToRegexpService }, { token: i2.Router }], target: i0.ɵɵFactoryTarget.Injectable }); }
573
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.6", ngImport: i0, type: ActGuardService, providedIn: 'root' }); }
560
574
  }
561
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.6", ngImport: i0, type: ActGuardService, decorators: [{
575
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.6", ngImport: i0, type: ActGuardService, decorators: [{
562
576
  type: Injectable,
563
577
  args: [{ providedIn: 'root' }]
564
578
  }], ctorParameters: () => [{ type: i1.YunzaiConfigService }, { type: i1.PathToRegexpService }, { type: i2.Router }] });
565
579
  const actGuardCanActive = (_, state) => inject(ActGuardService).process(state.url);
566
580
  const actGuardCanActiveChild = (_, state) => inject(ActGuardService).process(state.url);
567
581
 
582
+ class YunzaiLayoutWebsite01Component {
583
+ constructor() {
584
+ this.logoAlt = 'logo';
585
+ this.slogan = '';
586
+ this.tokenService = inject(YA_SERVICE_TOKEN);
587
+ this.configService = inject(YunzaiConfigService);
588
+ this.startupSrv = inject(YunzaiStartupService);
589
+ this.win = inject(WINDOW);
590
+ }
591
+ get _logoSrc() {
592
+ return this.logoSrc;
593
+ }
594
+ get _logoAlt() {
595
+ return this.logoAlt || 'logo';
596
+ }
597
+ get _slogan() {
598
+ return this.slogan || '';
599
+ }
600
+ get _contentTpl() {
601
+ return this.contentTpl;
602
+ }
603
+ get _username() {
604
+ const [_, getUser] = useLocalStorageUser();
605
+ return getUser()?.realname || '';
606
+ }
607
+ get isLogin() {
608
+ const [_, getUser] = useLocalStorageUser();
609
+ return !!this.tokenService.get()?.access_token && !!getUser();
610
+ }
611
+ get _links() {
612
+ const [_, getProjectInfo] = useLocalStorageProjectInfo();
613
+ return getProjectInfo()?.profileList || [];
614
+ }
615
+ login() {
616
+ this.startupSrv.load({ force: true }).subscribe(() => { });
617
+ }
618
+ logout() {
619
+ const baseUrl = this.configService.get('bis')?.baseUrl || '/backstage';
620
+ this.win.location.href = `${baseUrl}/cas-proxy/app/logout`;
621
+ }
622
+ to(url) {
623
+ if (url)
624
+ this.win.location.href = url;
625
+ }
626
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.6", ngImport: i0, type: YunzaiLayoutWebsite01Component, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
627
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.6", type: YunzaiLayoutWebsite01Component, isStandalone: true, selector: "yunzai-layout-website-01", inputs: { logoSrc: "logoSrc", logoAlt: "logoAlt", slogan: "slogan", contentTpl: "contentTpl" }, ngImport: i0, template: `
628
+ <div class="yz-layout-website-01">
629
+ <div class="yz-layout-website-01-nav__user">
630
+ @if (isLogin) {
631
+ <a
632
+ class="yz-layout-website-01-link"
633
+ nz-dropdown
634
+ [nzDropdownMenu]="menu"
635
+ [nzOverlayStyle]="{ width: '120px' }"
636
+ >
637
+ <span nz-icon nzType="user" nzTheme="outline"></span>{{ _username }}<span nz-icon nzType="down"></span>
638
+ </a>
639
+ <nz-dropdown-menu #menu="nzDropdownMenu">
640
+ <ul nz-menu nzSelectable>
641
+ @for (link of _links; track $index) {
642
+ <li nz-menu-item class="yz-layout-website-01-link__li" (click)="to(link.url)">{{ link.name }}</li>
643
+ }
644
+ <li nz-menu-item nzDanger class="yz-layout-website-01-link__li" (click)="logout()"
645
+ >{{ 'menu.account.logout' | i18n }}
646
+ </li>
647
+ </ul>
648
+ </nz-dropdown-menu>
649
+ } @else {
650
+ <a class="yz-layout-website-01-link" (click)="login()">
651
+ <span nz-icon nzType="login" nzTheme="outline"></span>{{ 'app.login.login' | i18n }}</a
652
+ >
653
+ }
654
+ </div>
655
+
656
+ <header class="yz-layout-website-01-nav">
657
+ @if (_logoSrc) {
658
+ <img [alt]="_logoAlt" class="yz-layout-website-01-nav__logo" [src]="_logoSrc" />
659
+ } @else {
660
+ <div class="yz-layout-website-01-nav__logo__full">LOGO</div>
661
+ }
662
+
663
+ <div class="yz-layout-website-01-nav__content">
664
+ <ng-template *ngTemplateOutlet="_contentTpl" />
665
+ </div>
666
+ <div class="yz-layout-website-01-nav__slogan">
667
+ {{ _slogan }}
668
+ </div>
669
+ </header>
670
+ <main class="yz-layout-website-01-container">
671
+ <router-outlet />
672
+ </main>
673
+ </div>
674
+ `, isInline: true, dependencies: [{ kind: "directive", type: RouterOutlet, selector: "router-outlet", inputs: ["name"], outputs: ["activate", "deactivate", "attach", "detach"], exportAs: ["outlet"] }, { kind: "pipe", type: I18nPipe, name: "i18n" }, { kind: "ngmodule", type: NzI18nModule }, { kind: "ngmodule", type: NzDropDownModule }, { kind: "directive", type: i1$1.NzMenuDirective, selector: "[nz-menu]", inputs: ["nzInlineIndent", "nzTheme", "nzMode", "nzInlineCollapsed", "nzSelectable"], outputs: ["nzClick"], exportAs: ["nzMenu"] }, { kind: "component", type: i1$1.NzMenuItemComponent, selector: "[nz-menu-item]", inputs: ["nzPaddingLeft", "nzDisabled", "nzSelected", "nzDanger", "nzMatchRouterExact", "nzMatchRouter"], exportAs: ["nzMenuItem"] }, { kind: "directive", type: i2$1.NzDropDownDirective, selector: "[nz-dropdown]", inputs: ["nzDropdownMenu", "nzTrigger", "nzMatchWidthElement", "nzBackdrop", "nzClickHide", "nzDisabled", "nzVisible", "nzOverlayClassName", "nzOverlayStyle", "nzPlacement"], outputs: ["nzVisibleChange"], exportAs: ["nzDropdown"] }, { kind: "directive", type: i2$1.NzDropDownADirective, selector: "a[nz-dropdown]" }, { kind: "component", type: i2$1.NzDropdownMenuComponent, selector: "nz-dropdown-menu", exportAs: ["nzDropdownMenu"] }, { kind: "ngmodule", type: NzIconModule }, { kind: "directive", type: i3.NzIconDirective, selector: "[nz-icon]", inputs: ["nzSpin", "nzRotate", "nzType", "nzTheme", "nzTwotoneColor", "nzIconfont"], exportAs: ["nzIcon"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
675
+ }
676
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.6", ngImport: i0, type: YunzaiLayoutWebsite01Component, decorators: [{
677
+ type: Component,
678
+ args: [{
679
+ selector: 'yunzai-layout-website-01',
680
+ template: `
681
+ <div class="yz-layout-website-01">
682
+ <div class="yz-layout-website-01-nav__user">
683
+ @if (isLogin) {
684
+ <a
685
+ class="yz-layout-website-01-link"
686
+ nz-dropdown
687
+ [nzDropdownMenu]="menu"
688
+ [nzOverlayStyle]="{ width: '120px' }"
689
+ >
690
+ <span nz-icon nzType="user" nzTheme="outline"></span>{{ _username }}<span nz-icon nzType="down"></span>
691
+ </a>
692
+ <nz-dropdown-menu #menu="nzDropdownMenu">
693
+ <ul nz-menu nzSelectable>
694
+ @for (link of _links; track $index) {
695
+ <li nz-menu-item class="yz-layout-website-01-link__li" (click)="to(link.url)">{{ link.name }}</li>
696
+ }
697
+ <li nz-menu-item nzDanger class="yz-layout-website-01-link__li" (click)="logout()"
698
+ >{{ 'menu.account.logout' | i18n }}
699
+ </li>
700
+ </ul>
701
+ </nz-dropdown-menu>
702
+ } @else {
703
+ <a class="yz-layout-website-01-link" (click)="login()">
704
+ <span nz-icon nzType="login" nzTheme="outline"></span>{{ 'app.login.login' | i18n }}</a
705
+ >
706
+ }
707
+ </div>
708
+
709
+ <header class="yz-layout-website-01-nav">
710
+ @if (_logoSrc) {
711
+ <img [alt]="_logoAlt" class="yz-layout-website-01-nav__logo" [src]="_logoSrc" />
712
+ } @else {
713
+ <div class="yz-layout-website-01-nav__logo__full">LOGO</div>
714
+ }
715
+
716
+ <div class="yz-layout-website-01-nav__content">
717
+ <ng-template *ngTemplateOutlet="_contentTpl" />
718
+ </div>
719
+ <div class="yz-layout-website-01-nav__slogan">
720
+ {{ _slogan }}
721
+ </div>
722
+ </header>
723
+ <main class="yz-layout-website-01-container">
724
+ <router-outlet />
725
+ </main>
726
+ </div>
727
+ `,
728
+ changeDetection: ChangeDetectionStrategy.OnPush,
729
+ standalone: true,
730
+ imports: [RouterOutlet, I18nPipe, NzI18nModule, NgFor, NgIf, NzDropDownModule, NzIconModule, NgTemplateOutlet]
731
+ }]
732
+ }], propDecorators: { logoSrc: [{
733
+ type: Input
734
+ }], logoAlt: [{
735
+ type: Input
736
+ }], slogan: [{
737
+ type: Input
738
+ }], contentTpl: [{
739
+ type: Input
740
+ }] } });
741
+
568
742
  /**
569
743
  * Generated bundle index. Do not edit.
570
744
  */
571
745
 
572
- export { ActGuardService, BisModule, CODEMESSAGE, YunzaiAnalysisAddonGuardService, YunzaiStartupService, actGuardCanActive, actGuardCanActiveChild, analysisAddonCanActive, analysisAddonCanActiveChild, checkStatus, generateAbility, getAdditionalHeaders, goTo, mapYzSideToYelonMenu, provideYunzaiBindAuthRefresh, provideYunzaiBis, provideYunzaiStartup, toLogin, tryRefreshToken, yunzaiDefaultInterceptor };
746
+ export { ActGuardService, BisModule, CODEMESSAGE, YunzaiAnalysisAddonGuardService, YunzaiLayoutWebsite01Component, YunzaiStartupService, actGuardCanActive, actGuardCanActiveChild, analysisAddonCanActive, analysisAddonCanActiveChild, checkStatus, generateAbility, getAdditionalHeaders, goTo, mapYzSideToYelonMenu, provideYunzaiBindAuthRefresh, provideYunzaiBis, provideYunzaiStartup, toLogin, tryRefreshToken, yunzaiDefaultInterceptor };
573
747
  //# sourceMappingURL=bis.mjs.map