@yelon/bis 15.1.0-29196db0 → 15.1.0-f09cdbae

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.
@@ -1,8 +1,8 @@
1
1
  import * as i0 from '@angular/core';
2
2
  import { Component, ChangeDetectionStrategy, HostListener, Injectable, Inject, Input, Optional, NgModule, APP_INITIALIZER } from '@angular/core';
3
- import { of, forkJoin, map, Subject, takeUntil, mergeMap, mergeAll, BehaviorSubject, throwError, filter, take, switchMap, catchError } from 'rxjs';
3
+ import { Subject, takeUntil, of, catchError, forkJoin, map, mergeMap, mergeAll, BehaviorSubject, throwError, filter, take, switchMap } from 'rxjs';
4
4
  import * as i1$4 from '@yelon/util';
5
- import { WINDOW, log as log$1, deepCopy, YunzaiConfigService } from '@yelon/util';
5
+ import { WINDOW, hasFavicon, setFavicon, log as log$1, deepCopy, YunzaiConfigService } from '@yelon/util';
6
6
  import * as i1$5 from '@yelon/theme/layout-default';
7
7
  import * as i1$3 from '@yelon/cache';
8
8
  import { CacheService } from '@yelon/cache';
@@ -20,26 +20,25 @@ import * as i9 from 'ng-zorro-antd/avatar';
20
20
  import * as i1 from 'ng-zorro-antd/modal';
21
21
  import * as i1$1 from 'ng-zorro-antd/message';
22
22
  import * as i1$2 from '@yelon/theme';
23
- import { zh_CN as zh_CN$1, zh_TW as zh_TW$1, en_US as en_US$1, el_GR as el_GR$1, es_ES as es_ES$1, fr_FR as fr_FR$1, hr_HR as hr_HR$1, it_IT as it_IT$1, ja_JP as ja_JP$1, ko_KR as ko_KR$1, pl_PL as pl_PL$1, sl_SI as sl_SI$1, tr_TR as tr_TR$1, YunzaiI18nBaseService, YUNZAI_I18N_TOKEN, _HttpClient } from '@yelon/theme';
23
+ import { zh_CN as zh_CN$1, zh_TW as zh_TW$1, en_US as en_US$1, el_GR as el_GR$1, es_ES as es_ES$1, fr_FR as fr_FR$1, hr_HR as hr_HR$1, it_IT as it_IT$1, ko_KR as ko_KR$1, pl_PL as pl_PL$1, sl_SI as sl_SI$1, tr_TR as tr_TR$1, YunzaiI18nBaseService, YUNZAI_I18N_TOKEN, _HttpClient } from '@yelon/theme';
24
24
  import screenfull from 'screenfull';
25
25
  import { __decorate } from 'tslib';
26
26
  import { InputBoolean } from '@yelon/util/decorator';
27
- import ngElGr from '@angular/common/locales/el';
28
27
  import ngEn from '@angular/common/locales/en';
28
+ import { zhCN, zhTW, enUS, el, es, fr, hr, it, ko, pl, sl, tr } from 'date-fns/locale';
29
+ import * as i2 from 'ng-zorro-antd/i18n';
30
+ import { zh_CN, zh_TW, en_US, el_GR, es_ES, fr_FR, hr_HR, it_IT, ko_KR, pl_PL, sl_SI, tr_TR } from 'ng-zorro-antd/i18n';
31
+ import ngElGr from '@angular/common/locales/el';
29
32
  import ngEsEs from '@angular/common/locales/es';
30
33
  import ngFr from '@angular/common/locales/fr';
31
34
  import ngHr from '@angular/common/locales/hr';
32
35
  import ngIt from '@angular/common/locales/it';
33
- import ngJa from '@angular/common/locales/ja';
34
36
  import ngKo from '@angular/common/locales/ko';
35
37
  import ngPl from '@angular/common/locales/pl';
36
38
  import ngSl from '@angular/common/locales/sl';
37
39
  import ngTr from '@angular/common/locales/tr';
38
40
  import ngZh from '@angular/common/locales/zh';
39
41
  import ngZhTw from '@angular/common/locales/zh-Hant';
40
- import { zhCN, zhTW, enUS, el, es, fr, hr, it, ja, ko, pl, sl, tr } from 'date-fns/locale';
41
- import * as i2 from 'ng-zorro-antd/i18n';
42
- import { zh_CN, zh_TW, en_US, el_GR, es_ES, fr_FR, hr_HR, it_IT, ja_JP, ko_KR, pl_PL, sl_SI, tr_TR } from 'ng-zorro-antd/i18n';
43
42
  import * as i3$1 from '@angular/cdk/platform';
44
43
  import * as i4 from '@yelon/util/config';
45
44
  import { YunzaiConfigService as YunzaiConfigService$1 } from '@yelon/util/config';
@@ -221,14 +220,6 @@ const YUNZAI_LANGS = {
221
220
  yelon: it_IT$1,
222
221
  abbr: '🇮🇹'
223
222
  },
224
- 'ja-JP': {
225
- text: '日本語',
226
- ng: ngJa,
227
- zorro: ja_JP,
228
- date: ja,
229
- yelon: ja_JP$1,
230
- abbr: '🇯🇵'
231
- },
232
223
  'ko-KR': {
233
224
  text: '한국어',
234
225
  ng: ngKo,
@@ -274,13 +265,14 @@ class YunzaiI18NService extends YunzaiI18nBaseService {
274
265
  this.platform = platform;
275
266
  this.cacheService = cacheService;
276
267
  this._defaultLang = DEFAULT;
277
- this._langs = Object.keys(YUNZAI_LANGS).map(code => {
278
- const item = YUNZAI_LANGS[code];
279
- return { code, text: item.text, abbr: item.abbr };
280
- });
281
- this.bisConf = mergeBisConfig(cogSrv);
268
+ this.destroy$ = new Subject();
282
269
  const defaultLang = this.getDefaultLang();
283
- this._defaultLang = this._langs.findIndex(w => w.code === defaultLang) === -1 ? DEFAULT : defaultLang;
270
+ this.bis = mergeBisConfig(cogSrv);
271
+ this.getLangs()
272
+ .pipe(takeUntil(this.destroy$))
273
+ .subscribe(langs => {
274
+ this._defaultLang = langs.findIndex(w => w.code === defaultLang) === -1 ? DEFAULT : defaultLang;
275
+ });
284
276
  }
285
277
  getDefaultLang() {
286
278
  if (!this.platform.isBrowser) {
@@ -303,7 +295,9 @@ class YunzaiI18NService extends YunzaiI18nBaseService {
303
295
  return this.http.get(`assets/tmp/i18n/${lang}.json`);
304
296
  }
305
297
  else {
306
- return this.http.get(`${this.bisConf.baseUrl}/i18n/${lang}`);
298
+ return this.http
299
+ .get(`${this.bis.baseUrl}/i18n/api/v2/${lang}?_allow_anonymous`)
300
+ .pipe(catchError(() => this.http.get(`assets/tmp/i18n/${lang}.json`)));
307
301
  }
308
302
  }
309
303
  }
@@ -312,17 +306,40 @@ class YunzaiI18NService extends YunzaiI18nBaseService {
312
306
  return;
313
307
  const key = `_yz_lang_${lang}`;
314
308
  this.cacheService.set(key, data);
309
+ this.cacheService.set(this.cacheDefaultKey, lang);
315
310
  this._data = this.flatData(data, []);
316
311
  const item = YUNZAI_LANGS[lang];
317
- registerLocaleData(item.ng);
318
- this.nzI18nService.setLocale(item.zorro);
319
- this.nzI18nService.setDateLocale(item.date);
320
- this.yelonLocaleService.setLocale(item.yelon);
321
- this._currentLang = lang;
322
- this._change$.next(lang);
312
+ if (item) {
313
+ registerLocaleData(item.ng);
314
+ this.nzI18nService.setLocale(item.zorro);
315
+ this.nzI18nService.setDateLocale(item.date);
316
+ this.yelonLocaleService.setLocale(item.yelon);
317
+ this._currentLang = lang;
318
+ this._change$.next(lang);
319
+ }
320
+ else {
321
+ registerLocaleData(ngEn);
322
+ this.nzI18nService.setLocale(en_US);
323
+ this.nzI18nService.setDateLocale(enUS);
324
+ this.yelonLocaleService.setLocale(en_US$1);
325
+ this._currentLang = lang;
326
+ this._change$.next(lang);
327
+ }
323
328
  }
324
329
  getLangs() {
325
- return this._langs;
330
+ const langs = Object.keys(YUNZAI_LANGS).map(code => {
331
+ const item = YUNZAI_LANGS[code];
332
+ return { code, text: item.text, abbr: item.abbr, icon: undefined };
333
+ });
334
+ if (ngDevMode) {
335
+ return of(langs);
336
+ }
337
+ else {
338
+ return this.http.get(`${this.bis.baseUrl}/i18n/api/v2/list?_allow_anonymous`).pipe(catchError(() => of(langs)));
339
+ }
340
+ }
341
+ ngOnDestroy() {
342
+ this.destroy$.complete();
326
343
  }
327
344
  }
328
345
  YunzaiI18NService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: YunzaiI18NService, deps: [{ token: i1$2._HttpClient }, { token: i1$2.SettingsService }, { token: i2.NzI18nService }, { token: i1$2.YelonLocaleService }, { token: i3$1.Platform }, { token: i4.YunzaiConfigService }, { token: i1$3.CacheService }], target: i0.ɵɵFactoryTarget.Injectable });
@@ -333,9 +350,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImpor
333
350
  }], ctorParameters: function () { return [{ type: i1$2._HttpClient }, { type: i1$2.SettingsService }, { type: i2.NzI18nService }, { type: i1$2.YelonLocaleService }, { type: i3$1.Platform }, { type: i4.YunzaiConfigService }, { type: i1$3.CacheService }]; } });
334
351
 
335
352
  class YunzaiI18NComponent {
336
- get langs() {
337
- return this.i18n.getLangs();
338
- }
339
353
  get curLangCode() {
340
354
  return this.settings.layout.lang;
341
355
  }
@@ -343,8 +357,16 @@ class YunzaiI18NComponent {
343
357
  this.settings = settings;
344
358
  this.i18n = i18n;
345
359
  this.doc = doc;
360
+ this.destroy$ = new Subject();
346
361
  /** Whether to display language text */
347
362
  this.showLangText = true;
363
+ this.langs = [];
364
+ this.i18n
365
+ .getLangs()
366
+ .pipe(takeUntil(this.destroy$))
367
+ .subscribe(langs => {
368
+ this.langs = langs;
369
+ });
348
370
  }
349
371
  change(lang) {
350
372
  const spinEl = this.doc.createElement('div');
@@ -357,6 +379,9 @@ class YunzaiI18NComponent {
357
379
  setTimeout(() => this.doc.location.reload());
358
380
  });
359
381
  }
382
+ ngOnDestroy() {
383
+ this.destroy$.complete();
384
+ }
360
385
  }
361
386
  YunzaiI18NComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: YunzaiI18NComponent, deps: [{ token: i1$2.SettingsService }, { token: YUNZAI_I18N_TOKEN }, { token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Component });
362
387
  YunzaiI18NComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.1.4", type: YunzaiI18NComponent, selector: "yunzai-i18n", inputs: { showLangText: "showLangText" }, ngImport: i0, template: `
@@ -381,7 +406,12 @@ YunzaiI18NComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", ve
381
406
  [nzSelected]="item.code === curLangCode"
382
407
  (click)="change(item.code)"
383
408
  >
384
- <span role="img" [attr.aria-label]="item.text" class="pr-xs">{{ item.abbr }}</span>
409
+ <template *ngIf="!item.image">
410
+ <span role="img" [attr.aria-label]="item.text" class="pr-xs">{{ item.abbr }}</span>
411
+ </template>
412
+ <template *ngIf="item.image">
413
+ <img [src]="'data:image/png;base64,' + item.image" [alt]="item.abbr" class="pr-xs" />
414
+ </template>
385
415
  {{ item.text }}
386
416
  </li>
387
417
  </ul>
@@ -416,7 +446,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImpor
416
446
  [nzSelected]="item.code === curLangCode"
417
447
  (click)="change(item.code)"
418
448
  >
419
- <span role="img" [attr.aria-label]="item.text" class="pr-xs">{{ item.abbr }}</span>
449
+ <template *ngIf="!item.image">
450
+ <span role="img" [attr.aria-label]="item.text" class="pr-xs">{{ item.abbr }}</span>
451
+ </template>
452
+ <template *ngIf="item.image">
453
+ <img [src]="'data:image/png;base64,' + item.image" [alt]="item.abbr" class="pr-xs" />
454
+ </template>
420
455
  {{ item.text }}
421
456
  </li>
422
457
  </ul>
@@ -879,23 +914,15 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImpor
879
914
  }] }, { type: i1$4.YunzaiConfigService }, { type: i1$3.CacheService }];
880
915
  } });
881
916
 
882
- var TopicType;
883
- (function (TopicType) {
884
- TopicType[TopicType["FULL"] = 0] = "FULL";
885
- TopicType[TopicType["OWN"] = 1] = "OWN";
886
- TopicType[TopicType["EVERY"] = 2] = "EVERY";
887
- })(TopicType || (TopicType = {}));
888
-
889
917
  class LayoutNavApplicationComponent {
890
918
  constructor(cacheService, i18n, http, inject) {
891
919
  this.cacheService = cacheService;
892
920
  this.i18n = i18n;
893
921
  this.http = http;
894
922
  this.inject = inject;
895
- this.TopicType = TopicType;
896
923
  this.state = {
897
924
  active: false,
898
- type: TopicType.FULL,
925
+ type: 'all',
899
926
  topic: undefined,
900
927
  topics: [],
901
928
  list: [],
@@ -904,18 +931,32 @@ class LayoutNavApplicationComponent {
904
931
  };
905
932
  }
906
933
  ngOnInit() {
907
- this.state.list = this.state.topics = this.cacheService.get('_yz_header', { mode: 'none' });
934
+ this.fetchAllTopic();
935
+ this.attachNav('all');
908
936
  }
909
- initTopic(type) {
910
- this.state.search = null;
911
- this.state.list = this.cacheService.get('_yz_header', { mode: 'none' });
937
+ fetchAllTopic() {
938
+ this.state.topics = this.cacheService.get('_yz_header', { mode: 'none' });
939
+ }
940
+ attachNav(type, topic) {
912
941
  this.state.type = type;
942
+ this.clearSearch();
943
+ if (type === 'all') {
944
+ this.displayAllNav();
945
+ }
946
+ if (type === 'mine') {
947
+ this.displayMineNav();
948
+ }
949
+ if (type === 'other' && topic) {
950
+ this.displayOtherNav(topic);
951
+ }
913
952
  }
914
- full() {
915
- this.initTopic(TopicType.FULL);
953
+ clearSearch() {
954
+ this.state.search = null;
916
955
  }
917
- own() {
918
- this.initTopic(TopicType.OWN);
956
+ displayAllNav() {
957
+ this.state.list = this.cacheService.get('_yz_header', { mode: 'none' });
958
+ }
959
+ displayMineNav() {
919
960
  const temp = this.cacheService.get('_yz_header', { mode: 'none' });
920
961
  this.state.list = temp
921
962
  .filter((topic) => {
@@ -928,11 +969,10 @@ class LayoutNavApplicationComponent {
928
969
  return topic.children.length > 0;
929
970
  });
930
971
  }
931
- every(e) {
932
- this.initTopic(TopicType.EVERY);
933
- this.state.topic = e;
972
+ displayOtherNav(topic) {
973
+ this.state.topic = topic;
934
974
  const temp = this.cacheService.get('_yz_header', { mode: 'none' });
935
- this.state.list = [...temp.filter(t => t.key === e.key)[0].children];
975
+ this.state.list = temp.filter(t => t.key === topic.key)[0].children;
936
976
  }
937
977
  diffChange(flag) {
938
978
  if (flag) {
@@ -996,7 +1036,7 @@ class LayoutNavApplicationComponent {
996
1036
  }
997
1037
  LayoutNavApplicationComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: LayoutNavApplicationComponent, deps: [{ token: i1$3.CacheService }, { token: YunzaiI18NService }, { token: i1$2._HttpClient }, { token: i0.Injector }], target: i0.ɵɵFactoryTarget.Component });
998
1038
  LayoutNavApplicationComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.1.4", type: LayoutNavApplicationComponent, selector: "layout-nav-application", ngImport: i0, template: `
999
- <!-- template start-->
1039
+ <!-- search start-->
1000
1040
  <ng-template #search>
1001
1041
  <div nz-row class="yz-application-list-search">
1002
1042
  <nz-input-group [nzPrefix]="prefixTemplate">
@@ -1013,17 +1053,20 @@ LayoutNavApplicationComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "1
1013
1053
  </nz-input-group>
1014
1054
  </div>
1015
1055
  </ng-template>
1056
+ <!-- search end -->
1057
+
1058
+ <!-- right menu start -->
1016
1059
  <ng-template #ld>
1017
1060
  <div class="yz-application-list">
1018
1061
  <ul>
1019
- <li *ngFor="let d of state.list">
1020
- <h5>{{ d.name }}</h5>
1021
- <a href="javascript:;" *ngFor="let cd of d.children" (click)="open(cd)">{{ cd.name }}</a>
1062
+ <li *ngFor="let topic of state.list">
1063
+ <h5>{{ topic.name | i18n }}</h5>
1064
+ <a href="javascript:;" *ngFor="let nav of topic.children" (click)="open(nav)">{{ nav.name | i18n }}</a>
1022
1065
  </li>
1023
1066
  </ul>
1024
1067
  </div>
1025
1068
  </ng-template>
1026
- <!-- template end-->
1069
+ <!-- right menu end -->
1027
1070
 
1028
1071
  <!-- button start-->
1029
1072
  <div class="yunzai-default__nav-item" (click)="diffChange()"> {{ 'mode.nav' | i18n }}</div>
@@ -1032,26 +1075,28 @@ LayoutNavApplicationComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "1
1032
1075
  <!-- header start-->
1033
1076
  <div class="yz-application" nz-row *ngIf="state.active">
1034
1077
  <div nz-col [nzSpan]="3" class="yz-application-topic">
1035
- <div class="yz-application-text" (click)="full()">{{ 'mode.nav.all' | i18n }}</div>
1036
- <div class="yz-application-text" (click)="own()">{{ 'mode.nav.mine' | i18n }}</div>
1037
- <div class="yz-application-text" *ngFor="let d of state.topics" (click)="every(d)">{{ d.name | i18n }}</div>
1078
+ <div class="yz-application-text" (click)="attachNav('all')">{{ 'mode.nav.all' | i18n }}</div>
1079
+ <div class="yz-application-text" (click)="attachNav('mine')">{{ 'mode.nav.mine' | i18n }}</div>
1080
+ <div class="yz-application-text" *ngFor="let nav of state.topics" (click)="attachNav('other', nav)">{{
1081
+ nav.name | i18n
1082
+ }}</div>
1038
1083
  </div>
1039
1084
  <div nz-col [nzSpan]="21" [ngSwitch]="state.topic" class="yz-application-container">
1040
- <div *ngSwitchCase="TopicType.FULL">
1085
+ <div *ngIf="state.type === 'all'">
1041
1086
  <ng-template [ngTemplateOutlet]="search"></ng-template>
1042
1087
  <ng-template [ngTemplateOutlet]="ld"></ng-template>
1043
1088
  </div>
1044
- <div *ngSwitchCase="TopicType.OWN">
1089
+ <div *ngIf="state.type === 'mine'">
1045
1090
  <ng-template [ngTemplateOutlet]="search"></ng-template>
1046
1091
  <ng-template [ngTemplateOutlet]="ld"></ng-template>
1047
1092
  </div>
1048
- <div *ngSwitchCase="TopicType.EVERY" class="yz-application-list">
1093
+ <div *ngIf="state.type === 'other'" class="yz-application-list">
1049
1094
  <div class="yz-application-list-item">
1050
1095
  <ul>
1051
- <li *ngFor="let d of state.list" (click)="open(d)">
1096
+ <li *ngFor="let nav of state.list" (click)="open(nav)">
1052
1097
  <a href="javascript:;">
1053
- <h4>{{ d.name | i18n }}</h4>
1054
- <p>{{ d.intro | i18n }}</p>
1098
+ <h4>{{ nav.name | i18n }}</h4>
1099
+ <p>{{ nav.intro | i18n }}</p>
1055
1100
  </a>
1056
1101
  </li>
1057
1102
  </ul>
@@ -1060,13 +1105,13 @@ LayoutNavApplicationComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "1
1060
1105
  </div>
1061
1106
  </div>
1062
1107
  <!-- header end-->
1063
- `, isInline: true, dependencies: [{ kind: "directive", type: i4$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i4$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i4$1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i4$1.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { kind: "directive", type: i4$1.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { kind: "directive", type: i5.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i5.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i5.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i3.ɵNzTransitionPatchDirective, selector: "[nz-button], nz-button-group, [nz-icon], [nz-menu-item], [nz-submenu], nz-select-top-control, nz-select-placeholder, nz-input-group", inputs: ["hidden"] }, { kind: "directive", type: i7$1.NzColDirective, selector: "[nz-col],nz-col,nz-form-control,nz-form-label", inputs: ["nzFlex", "nzSpan", "nzOrder", "nzOffset", "nzPush", "nzPull", "nzXs", "nzSm", "nzMd", "nzLg", "nzXl", "nzXXl"], exportAs: ["nzCol"] }, { kind: "directive", type: i7$1.NzRowDirective, selector: "[nz-row],nz-row,nz-form-item", inputs: ["nzAlign", "nzJustify", "nzGutter"], exportAs: ["nzRow"] }, { kind: "directive", type: i8.NzIconDirective, selector: "[nz-icon]", inputs: ["nzSpin", "nzRotate", "nzType", "nzTheme", "nzTwotoneColor", "nzIconfont"], exportAs: ["nzIcon"] }, { kind: "directive", type: i9$1.NzInputDirective, selector: "input[nz-input],textarea[nz-input]", inputs: ["nzBorderless", "nzSize", "nzStatus", "disabled"], exportAs: ["nzInput"] }, { kind: "component", type: i9$1.NzInputGroupComponent, selector: "nz-input-group", inputs: ["nzAddOnBeforeIcon", "nzAddOnAfterIcon", "nzPrefixIcon", "nzSuffixIcon", "nzAddOnBefore", "nzAddOnAfter", "nzPrefix", "nzStatus", "nzSuffix", "nzSize", "nzSearch", "nzCompact"], exportAs: ["nzInputGroup"] }, { kind: "directive", type: i9$1.NzInputGroupWhitSuffixOrPrefixDirective, selector: "nz-input-group[nzSuffix], nz-input-group[nzPrefix]" }, { kind: "pipe", type: i1$2.I18nPipe, name: "i18n" }] });
1108
+ `, isInline: true, dependencies: [{ kind: "directive", type: i4$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i4$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i4$1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i4$1.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { kind: "directive", type: i5.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i5.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i5.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i3.ɵNzTransitionPatchDirective, selector: "[nz-button], nz-button-group, [nz-icon], [nz-menu-item], [nz-submenu], nz-select-top-control, nz-select-placeholder, nz-input-group", inputs: ["hidden"] }, { kind: "directive", type: i7$1.NzColDirective, selector: "[nz-col],nz-col,nz-form-control,nz-form-label", inputs: ["nzFlex", "nzSpan", "nzOrder", "nzOffset", "nzPush", "nzPull", "nzXs", "nzSm", "nzMd", "nzLg", "nzXl", "nzXXl"], exportAs: ["nzCol"] }, { kind: "directive", type: i7$1.NzRowDirective, selector: "[nz-row],nz-row,nz-form-item", inputs: ["nzAlign", "nzJustify", "nzGutter"], exportAs: ["nzRow"] }, { kind: "directive", type: i8.NzIconDirective, selector: "[nz-icon]", inputs: ["nzSpin", "nzRotate", "nzType", "nzTheme", "nzTwotoneColor", "nzIconfont"], exportAs: ["nzIcon"] }, { kind: "directive", type: i9$1.NzInputDirective, selector: "input[nz-input],textarea[nz-input]", inputs: ["nzBorderless", "nzSize", "nzStatus", "disabled"], exportAs: ["nzInput"] }, { kind: "component", type: i9$1.NzInputGroupComponent, selector: "nz-input-group", inputs: ["nzAddOnBeforeIcon", "nzAddOnAfterIcon", "nzPrefixIcon", "nzSuffixIcon", "nzAddOnBefore", "nzAddOnAfter", "nzPrefix", "nzStatus", "nzSuffix", "nzSize", "nzSearch", "nzCompact"], exportAs: ["nzInputGroup"] }, { kind: "directive", type: i9$1.NzInputGroupWhitSuffixOrPrefixDirective, selector: "nz-input-group[nzSuffix], nz-input-group[nzPrefix]" }, { kind: "pipe", type: i1$2.I18nPipe, name: "i18n" }] });
1064
1109
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: LayoutNavApplicationComponent, decorators: [{
1065
1110
  type: Component,
1066
1111
  args: [{
1067
1112
  selector: `layout-nav-application`,
1068
1113
  template: `
1069
- <!-- template start-->
1114
+ <!-- search start-->
1070
1115
  <ng-template #search>
1071
1116
  <div nz-row class="yz-application-list-search">
1072
1117
  <nz-input-group [nzPrefix]="prefixTemplate">
@@ -1083,17 +1128,20 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImpor
1083
1128
  </nz-input-group>
1084
1129
  </div>
1085
1130
  </ng-template>
1131
+ <!-- search end -->
1132
+
1133
+ <!-- right menu start -->
1086
1134
  <ng-template #ld>
1087
1135
  <div class="yz-application-list">
1088
1136
  <ul>
1089
- <li *ngFor="let d of state.list">
1090
- <h5>{{ d.name }}</h5>
1091
- <a href="javascript:;" *ngFor="let cd of d.children" (click)="open(cd)">{{ cd.name }}</a>
1137
+ <li *ngFor="let topic of state.list">
1138
+ <h5>{{ topic.name | i18n }}</h5>
1139
+ <a href="javascript:;" *ngFor="let nav of topic.children" (click)="open(nav)">{{ nav.name | i18n }}</a>
1092
1140
  </li>
1093
1141
  </ul>
1094
1142
  </div>
1095
1143
  </ng-template>
1096
- <!-- template end-->
1144
+ <!-- right menu end -->
1097
1145
 
1098
1146
  <!-- button start-->
1099
1147
  <div class="yunzai-default__nav-item" (click)="diffChange()"> {{ 'mode.nav' | i18n }}</div>
@@ -1102,26 +1150,28 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImpor
1102
1150
  <!-- header start-->
1103
1151
  <div class="yz-application" nz-row *ngIf="state.active">
1104
1152
  <div nz-col [nzSpan]="3" class="yz-application-topic">
1105
- <div class="yz-application-text" (click)="full()">{{ 'mode.nav.all' | i18n }}</div>
1106
- <div class="yz-application-text" (click)="own()">{{ 'mode.nav.mine' | i18n }}</div>
1107
- <div class="yz-application-text" *ngFor="let d of state.topics" (click)="every(d)">{{ d.name | i18n }}</div>
1153
+ <div class="yz-application-text" (click)="attachNav('all')">{{ 'mode.nav.all' | i18n }}</div>
1154
+ <div class="yz-application-text" (click)="attachNav('mine')">{{ 'mode.nav.mine' | i18n }}</div>
1155
+ <div class="yz-application-text" *ngFor="let nav of state.topics" (click)="attachNav('other', nav)">{{
1156
+ nav.name | i18n
1157
+ }}</div>
1108
1158
  </div>
1109
1159
  <div nz-col [nzSpan]="21" [ngSwitch]="state.topic" class="yz-application-container">
1110
- <div *ngSwitchCase="TopicType.FULL">
1160
+ <div *ngIf="state.type === 'all'">
1111
1161
  <ng-template [ngTemplateOutlet]="search"></ng-template>
1112
1162
  <ng-template [ngTemplateOutlet]="ld"></ng-template>
1113
1163
  </div>
1114
- <div *ngSwitchCase="TopicType.OWN">
1164
+ <div *ngIf="state.type === 'mine'">
1115
1165
  <ng-template [ngTemplateOutlet]="search"></ng-template>
1116
1166
  <ng-template [ngTemplateOutlet]="ld"></ng-template>
1117
1167
  </div>
1118
- <div *ngSwitchCase="TopicType.EVERY" class="yz-application-list">
1168
+ <div *ngIf="state.type === 'other'" class="yz-application-list">
1119
1169
  <div class="yz-application-list-item">
1120
1170
  <ul>
1121
- <li *ngFor="let d of state.list" (click)="open(d)">
1171
+ <li *ngFor="let nav of state.list" (click)="open(nav)">
1122
1172
  <a href="javascript:;">
1123
- <h4>{{ d.name | i18n }}</h4>
1124
- <p>{{ d.intro | i18n }}</p>
1173
+ <h4>{{ nav.name | i18n }}</h4>
1174
+ <p>{{ nav.intro | i18n }}</p>
1125
1175
  </a>
1126
1176
  </li>
1127
1177
  </ul>
@@ -1305,12 +1355,27 @@ class YunzaiLayoutBasicComponent {
1305
1355
  }
1306
1356
  ngOnInit() {
1307
1357
  this.initLogo();
1358
+ this.initFavicon();
1308
1359
  this.initNavType();
1309
1360
  this.initAside();
1310
1361
  this.addLayoutDisplayListener();
1311
1362
  this.stompService.listen();
1312
1363
  this.toIndex();
1313
1364
  }
1365
+ initFavicon() {
1366
+ console.log('init favicon');
1367
+ const projectInfo = this.cacheService.get('_yz_project_info', { mode: 'none' });
1368
+ if (projectInfo.faviconUrl) {
1369
+ hasFavicon(projectInfo.faviconUrl).then((has) => {
1370
+ if (has) {
1371
+ setFavicon(projectInfo.faviconUrl);
1372
+ }
1373
+ else {
1374
+ setFavicon('./assets/favicon.ico');
1375
+ }
1376
+ });
1377
+ }
1378
+ }
1314
1379
  initAside() {
1315
1380
  const aside = this.cacheService.get('_yz_current', { mode: 'none' });
1316
1381
  this.state.aside = Object.assign({}, aside);
@@ -1430,8 +1495,8 @@ YunzaiLayoutBasicComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0
1430
1495
  <div nz-dropdown nzTrigger="click" [nzDropdownMenu]="userMenu" class="yunzai-default__aside-user">
1431
1496
  <nz-avatar class="yunzai-default__aside-user-avatar" [nzSrc]="aside.icon"></nz-avatar>
1432
1497
  <div class="yunzai-default__aside-user-info">
1433
- <strong>{{ aside.name }}</strong>
1434
- <p class="mb0">{{ aside.intro }}</p>
1498
+ <strong>{{ aside.name | i18n }}</strong>
1499
+ <p class="mb0">{{ aside.intro | i18n }}</p>
1435
1500
  </div>
1436
1501
  </div>
1437
1502
  <nz-dropdown-menu #userMenu="nzDropdownMenu">
@@ -1518,8 +1583,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImpor
1518
1583
  <div nz-dropdown nzTrigger="click" [nzDropdownMenu]="userMenu" class="yunzai-default__aside-user">
1519
1584
  <nz-avatar class="yunzai-default__aside-user-avatar" [nzSrc]="aside.icon"></nz-avatar>
1520
1585
  <div class="yunzai-default__aside-user-info">
1521
- <strong>{{ aside.name }}</strong>
1522
- <p class="mb0">{{ aside.intro }}</p>
1586
+ <strong>{{ aside.name | i18n }}</strong>
1587
+ <p class="mb0">{{ aside.intro | i18n }}</p>
1523
1588
  </div>
1524
1589
  </div>
1525
1590
  <nz-dropdown-menu #userMenu="nzDropdownMenu">
@@ -1965,6 +2030,8 @@ class YunzaiDefaultInterceptor {
1965
2030
  if (url.includes('.json') && url.includes('assets')) {
1966
2031
  url = req.url;
1967
2032
  }
2033
+ if (url.includes('i18n'))
2034
+ return next.handle(req);
1968
2035
  // 加入语言头
1969
2036
  const newReq = req.clone({ url, setHeaders: this.getAdditionalHeaders(req.headers) });
1970
2037
  return next.handle(newReq).pipe(mergeMap(ev => {
@@ -2860,7 +2927,9 @@ class YunzaiStartupService {
2860
2927
  }
2861
2928
  load() {
2862
2929
  log$1('startup.service: ', 'load');
2863
- const defaultLang = this.i18n.defaultLang;
2930
+ let defaultLang = this.cacheService.getNone(this.i18n.cacheDefaultKey);
2931
+ if (!defaultLang)
2932
+ defaultLang = this.i18n.defaultLang;
2864
2933
  return this.i18n.loadLangData(defaultLang).pipe(mergeMap(langData => {
2865
2934
  log$1('startup.service: ', 'set i18n, defaultLang->', defaultLang, ' langData->', langData);
2866
2935
  this.i18n.use(defaultLang, langData);
@@ -2989,5 +3058,5 @@ const YUNZAI_APPINIT_PROVIDES = [
2989
3058
  * Generated bundle index. Do not edit.
2990
3059
  */
2991
3060
 
2992
- export { ActGuard, BUSINESS_DEFAULT_CONFIG, LayoutNavApplicationComponent, LayoutNavGroupComponent, LayoutNavTileComponent, NavType, TopicType, YUNZAI_APPINIT_PROVIDES, YUNZAI_APPINIT_PROVIDES as YZ_APPINIT_PROVIDES, YunzaiAuthService, YunzaiClearStorageComponent, YunzaiDefaultInterceptor, YunzaiFullScreenComponent, YunzaiI18NComponent, YunzaiI18NService, YunzaiLayoutBasicComponent, YunzaiLayoutModule, YunzaiNotifyComponent, YunzaiStartupService, YunzaiStartupServiceFactory, YunzaiThemBtnComponent, YunzaiUserComponent, YunzaiAuthService as YzAuthService, YunzaiDefaultInterceptor as YzDefaultInterceptor, YunzaiI18NService as YzI18NService, YunzaiLayoutBasicComponent as YzLayoutBasicComponent, YunzaiStartupService as YzStartupService, YunzaiStartupServiceFactory as YzStartupServiceFactory, generateAbility, mapYzSideToYelonMenu, mergeBisConfig };
3061
+ export { ActGuard, BUSINESS_DEFAULT_CONFIG, LayoutNavApplicationComponent, LayoutNavGroupComponent, LayoutNavTileComponent, NavType, YUNZAI_APPINIT_PROVIDES, YUNZAI_LANGS, YUNZAI_APPINIT_PROVIDES as YZ_APPINIT_PROVIDES, YunzaiAuthService, YunzaiClearStorageComponent, YunzaiDefaultInterceptor, YunzaiFullScreenComponent, YunzaiI18NComponent, YunzaiI18NService, YunzaiLayoutBasicComponent, YunzaiLayoutModule, YunzaiNotifyComponent, YunzaiStartupService, YunzaiStartupServiceFactory, YunzaiThemBtnComponent, YunzaiUserComponent, YunzaiAuthService as YzAuthService, YunzaiDefaultInterceptor as YzDefaultInterceptor, YunzaiI18NService as YzI18NService, YunzaiLayoutBasicComponent as YzLayoutBasicComponent, YunzaiStartupService as YzStartupService, YunzaiStartupServiceFactory as YzStartupServiceFactory, generateAbility, mapYzSideToYelonMenu, mergeBisConfig };
2993
3062
  //# sourceMappingURL=layout.mjs.map