@yelon/bis 16.2.2 → 16.2.4
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/esm2022/layout/layout-nav/layout-nav-application.component.mjs +8 -4
- package/esm2022/layout/layout-nav/layout-nav-group.component.mjs +8 -4
- package/esm2022/layout/widgets/yunzai-i18n.component.mjs +8 -4
- package/esm2022/layout/widgets/yunzai-theme-btn.component.mjs +6 -4
- package/esm2022/layout/yunzai-i18n.service.mjs +10 -7
- package/fesm2022/layout.mjs +27 -10
- package/fesm2022/layout.mjs.map +1 -1
- package/layout/layout-nav/layout-nav-application.component.d.ts +4 -2
- package/layout/layout-nav/layout-nav-group.component.d.ts +4 -2
- package/layout/widgets/yunzai-i18n.component.d.ts +4 -1
- package/layout/widgets/yunzai-theme-btn.component.d.ts +1 -0
- package/layout/yunzai-i18n.service.d.ts +5 -2
- package/package.json +11 -11
package/fesm2022/layout.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { Component, ChangeDetectionStrategy, HostListener,
|
|
2
|
+
import { Component, ChangeDetectionStrategy, HostListener, Injectable, Inject, Input, Optional, NgModule, APP_INITIALIZER } from '@angular/core';
|
|
3
3
|
import * as i1$3 from '@yelon/util';
|
|
4
4
|
import { useLocalStorageLang, useLocalStorageLangs, WINDOW, useLocalStorageProjectInfo, useLocalStorageUser, useLocalStorageHeader, NavType, hasFavicon, setFavicon, useLocalStorageCurrent, useLocalStorageHeaderType, useLocalStorageDefaultRoute, log as log$1, deepCopy, YunzaiConfigService, useLocalStorageTenant } from '@yelon/util';
|
|
5
5
|
import * as i1$4 from '@yelon/theme/layout-default';
|
|
@@ -21,9 +21,8 @@ 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,
|
|
|
21
21
|
import screenfull from 'screenfull';
|
|
22
22
|
import { __decorate } from 'tslib';
|
|
23
23
|
import { InputBoolean } from '@yelon/util/decorator';
|
|
24
|
-
import {
|
|
24
|
+
import { Subject, takeUntil, of, catchError, forkJoin, map as map$1, mergeMap, combineLatest, BehaviorSubject, throwError, filter, take, switchMap } from 'rxjs';
|
|
25
25
|
import ngEn from '@angular/common/locales/en';
|
|
26
|
-
import { of, catchError, forkJoin, map as map$1, mergeMap, combineLatest, BehaviorSubject, throwError, filter, take, switchMap } from 'rxjs';
|
|
27
26
|
import { zhCN, zhTW, enUS, el, es, fr, hr, it, ko, pl, sl, tr } from 'date-fns/locale';
|
|
28
27
|
import { map } from 'rxjs/operators';
|
|
29
28
|
import * as i2 from 'ng-zorro-antd/i18n';
|
|
@@ -262,10 +261,11 @@ class YunzaiI18NService extends YunzaiI18nBaseService {
|
|
|
262
261
|
this.yelonLocaleService = yelonLocaleService;
|
|
263
262
|
this.platform = platform;
|
|
264
263
|
this._defaultLang = DEFAULT;
|
|
264
|
+
this.$destroy = new Subject();
|
|
265
265
|
const defaultLang = this.getDefaultLang();
|
|
266
266
|
this.bis = mergeBisConfig(cogSrv);
|
|
267
267
|
this.getLangs()
|
|
268
|
-
.pipe(
|
|
268
|
+
.pipe(takeUntil(this.$destroy))
|
|
269
269
|
.subscribe(langs => {
|
|
270
270
|
this._defaultLang = langs.findIndex(w => w.code === defaultLang) === -1 ? DEFAULT : defaultLang;
|
|
271
271
|
});
|
|
@@ -286,7 +286,7 @@ class YunzaiI18NService extends YunzaiI18nBaseService {
|
|
|
286
286
|
return this.http.get(`assets/tmp/i18n/${lang}.json`);
|
|
287
287
|
}
|
|
288
288
|
else {
|
|
289
|
-
if (this.getLang(lang)) {
|
|
289
|
+
if (this.getLang(lang) !== null) {
|
|
290
290
|
return of(this.getLang(lang));
|
|
291
291
|
}
|
|
292
292
|
return this.http
|
|
@@ -343,7 +343,7 @@ class YunzaiI18NService extends YunzaiI18nBaseService {
|
|
|
343
343
|
}
|
|
344
344
|
getLang(lang) {
|
|
345
345
|
const [, getL] = useLocalStorageLang();
|
|
346
|
-
return getL(lang) ||
|
|
346
|
+
return getL(lang) || null;
|
|
347
347
|
}
|
|
348
348
|
cacheLangs(langs) {
|
|
349
349
|
const [setLangs] = useLocalStorageLangs();
|
|
@@ -353,6 +353,9 @@ class YunzaiI18NService extends YunzaiI18nBaseService {
|
|
|
353
353
|
const [, getLangs] = useLocalStorageLangs();
|
|
354
354
|
return getLangs() || [];
|
|
355
355
|
}
|
|
356
|
+
ngOnDestroy() {
|
|
357
|
+
this.$destroy.complete();
|
|
358
|
+
}
|
|
356
359
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.1", 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 }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
357
360
|
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.1", ngImport: i0, type: YunzaiI18NService, providedIn: 'root' }); }
|
|
358
361
|
}
|
|
@@ -371,10 +374,11 @@ class YunzaiI18NComponent {
|
|
|
371
374
|
this.doc = doc;
|
|
372
375
|
/** Whether to display language text */
|
|
373
376
|
this.showLangText = true;
|
|
377
|
+
this.$destroy = new Subject();
|
|
374
378
|
this.langs = [];
|
|
375
379
|
this.i18n
|
|
376
380
|
.getLangs()
|
|
377
|
-
.pipe(
|
|
381
|
+
.pipe(takeUntil(this.$destroy))
|
|
378
382
|
.subscribe(langs => {
|
|
379
383
|
this.langs = langs;
|
|
380
384
|
});
|
|
@@ -390,6 +394,9 @@ class YunzaiI18NComponent {
|
|
|
390
394
|
setTimeout(() => this.doc.location.reload());
|
|
391
395
|
});
|
|
392
396
|
}
|
|
397
|
+
ngOnDestroy() {
|
|
398
|
+
this.$destroy.complete();
|
|
399
|
+
}
|
|
393
400
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.1", ngImport: i0, type: YunzaiI18NComponent, deps: [{ token: i1$2.SettingsService }, { token: YUNZAI_I18N_TOKEN }, { token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
394
401
|
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.1", type: YunzaiI18NComponent, selector: "yunzai-i18n", inputs: { showLangText: "showLangText" }, ngImport: i0, template: `
|
|
395
402
|
<div *ngIf="showLangText" nz-dropdown [nzDropdownMenu]="langMenu" nzPlacement="bottomRight">
|
|
@@ -686,10 +693,11 @@ class YunzaiThemBtnComponent {
|
|
|
686
693
|
this.devTips = `When the dark.css file can't be found, you need to run it once: npm run theme`;
|
|
687
694
|
this.deployUrl = '';
|
|
688
695
|
this.dir = 'ltr';
|
|
696
|
+
this.$destroy = new Subject();
|
|
689
697
|
}
|
|
690
698
|
ngOnInit() {
|
|
691
699
|
this.dir = this.directionality.value;
|
|
692
|
-
this.directionality.change?.pipe(
|
|
700
|
+
this.directionality.change?.pipe(takeUntil(this.$destroy)).subscribe((direction) => {
|
|
693
701
|
this.dir = direction;
|
|
694
702
|
});
|
|
695
703
|
this.initTheme();
|
|
@@ -728,6 +736,7 @@ class YunzaiThemBtnComponent {
|
|
|
728
736
|
this.updateChartTheme();
|
|
729
737
|
}
|
|
730
738
|
ngOnDestroy() {
|
|
739
|
+
this.$destroy.complete();
|
|
731
740
|
const el = this.doc.getElementById(this.KEYS);
|
|
732
741
|
if (el != null) {
|
|
733
742
|
this.doc.body.removeChild(el);
|
|
@@ -979,6 +988,7 @@ class LayoutNavApplicationComponent {
|
|
|
979
988
|
this.configService = configService;
|
|
980
989
|
this.win = win;
|
|
981
990
|
this.bis = BUSINESS_DEFAULT_CONFIG;
|
|
991
|
+
this.$destroy = new Subject();
|
|
982
992
|
this.state = {
|
|
983
993
|
active: false,
|
|
984
994
|
type: 'all',
|
|
@@ -1059,7 +1069,7 @@ class LayoutNavApplicationComponent {
|
|
|
1059
1069
|
appId: topic.key,
|
|
1060
1070
|
createDate: new Date()
|
|
1061
1071
|
})
|
|
1062
|
-
.pipe(
|
|
1072
|
+
.pipe(takeUntil(this.$destroy))
|
|
1063
1073
|
.subscribe();
|
|
1064
1074
|
}
|
|
1065
1075
|
switch (topic.target) {
|
|
@@ -1102,6 +1112,9 @@ class LayoutNavApplicationComponent {
|
|
|
1102
1112
|
this.state.list = getTopics();
|
|
1103
1113
|
}
|
|
1104
1114
|
}
|
|
1115
|
+
ngOnDestroy() {
|
|
1116
|
+
this.$destroy.complete();
|
|
1117
|
+
}
|
|
1105
1118
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.1", ngImport: i0, type: LayoutNavApplicationComponent, deps: [{ token: YunzaiI18NService }, { token: i1$2._HttpClient }, { token: i0.Injector }, { token: i1$3.YunzaiConfigService }, { token: WINDOW }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1106
1119
|
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.1", type: LayoutNavApplicationComponent, selector: "layout-nav-application", ngImport: i0, template: `
|
|
1107
1120
|
<!-- search start-->
|
|
@@ -1310,6 +1323,7 @@ class LayoutNavGroupComponent {
|
|
|
1310
1323
|
constructor(inject, http) {
|
|
1311
1324
|
this.inject = inject;
|
|
1312
1325
|
this.http = http;
|
|
1326
|
+
this.$destroy = new Subject();
|
|
1313
1327
|
this.state = {
|
|
1314
1328
|
topics: []
|
|
1315
1329
|
};
|
|
@@ -1325,7 +1339,7 @@ class LayoutNavGroupComponent {
|
|
|
1325
1339
|
appId: topic.key,
|
|
1326
1340
|
createDate: new Date()
|
|
1327
1341
|
})
|
|
1328
|
-
.pipe(
|
|
1342
|
+
.pipe(takeUntil(this.$destroy))
|
|
1329
1343
|
.subscribe();
|
|
1330
1344
|
}
|
|
1331
1345
|
switch (topic.target) {
|
|
@@ -1343,6 +1357,9 @@ class LayoutNavGroupComponent {
|
|
|
1343
1357
|
break;
|
|
1344
1358
|
}
|
|
1345
1359
|
}
|
|
1360
|
+
ngOnDestroy() {
|
|
1361
|
+
this.$destroy.complete();
|
|
1362
|
+
}
|
|
1346
1363
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.1", ngImport: i0, type: LayoutNavGroupComponent, deps: [{ token: i0.Injector }, { token: i1$2._HttpClient }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1347
1364
|
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.1", type: LayoutNavGroupComponent, selector: "layout-nav-group", ngImport: i0, template: `
|
|
1348
1365
|
<div class="yz-application-group">
|