raise-common-lib 0.0.132 → 0.0.134
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/bundles/raise-common-lib.umd.js +122 -19
- package/bundles/raise-common-lib.umd.js.map +1 -1
- package/bundles/raise-common-lib.umd.min.js +1 -15
- package/bundles/raise-common-lib.umd.min.js.map +1 -1
- package/esm2015/lib/layout/main-container/index.component.js +66 -5
- package/esm2015/lib/layout/multi-tab/index.component.js +37 -13
- package/esm5/lib/layout/main-container/index.component.js +82 -4
- package/esm5/lib/layout/multi-tab/index.component.js +41 -14
- package/fesm2015/raise-common-lib.js +99 -16
- package/fesm2015/raise-common-lib.js.map +1 -1
- package/fesm5/raise-common-lib.js +119 -17
- package/fesm5/raise-common-lib.js.map +1 -1
- package/lib/layout/main-container/index.component.d.ts +8 -2
- package/lib/layout/multi-tab/index.component.d.ts +2 -1
- package/package.json +1 -1
- package/raise-common-lib.metadata.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { __assign, __awaiter, __generator, __decorate, __metadata, __read, __spread } from 'tslib';
|
|
2
|
-
import { EventEmitter, Component, ChangeDetectorRef, ViewChild, Input, Output, HostBinding, Injectable, ɵɵdefineInjectable, Inject, ɵɵinject, ContentChild, HostListener, ComponentFactoryResolver, ViewContainerRef, ViewChildren, NgModule, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
|
|
1
|
+
import { __assign, __awaiter, __generator, __decorate, __metadata, __read, __values, __spread } from 'tslib';
|
|
2
|
+
import { EventEmitter, Component, ChangeDetectorRef, ViewChild, Input, Output, HostBinding, Injectable, ɵɵdefineInjectable, Inject, ɵɵinject, ContentChild, HostListener, ComponentFactoryResolver, ViewContainerRef, ViewChildren, ElementRef, NgModule, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
|
|
3
3
|
import { GridComponent, GridModule, PagerModule, GridAllModule, PageService, SortService, FilterService, ExcelExportService, EditService, ResizeService, ToolbarService, ColumnChooserService, AggregateService, ColumnMenuService, DetailRowService, SelectionService, GroupService } from '@syncfusion/ej2-angular-grids';
|
|
4
4
|
import { times, debounce } from 'lodash';
|
|
5
5
|
import { Subject, BehaviorSubject } from 'rxjs';
|
|
@@ -11,6 +11,7 @@ import { NavigationEnd, Router, ActivatedRoute, RouteReuseStrategy } from '@angu
|
|
|
11
11
|
import { filter } from 'rxjs/operators';
|
|
12
12
|
import { HttpClient, HttpClientModule } from '@angular/common/http';
|
|
13
13
|
import { setCulture, L10n } from '@syncfusion/ej2-base';
|
|
14
|
+
import ResizeObserver from 'resize-observer-polyfill';
|
|
14
15
|
import { DatePipe, CommonModule } from '@angular/common';
|
|
15
16
|
import { Query } from '@syncfusion/ej2-data';
|
|
16
17
|
import { MatIconRegistry, MatIconModule } from '@angular/material/icon';
|
|
@@ -3007,7 +3008,7 @@ var MultiTabComponent = /** @class */ (function () {
|
|
|
3007
3008
|
*/
|
|
3008
3009
|
function (event) {
|
|
3009
3010
|
this.screenWidth = window.innerWidth; // 更新屏幕宽度
|
|
3010
|
-
this.setEllipsisTitle();
|
|
3011
|
+
// this.setEllipsisTitle(); 在最外面容器调用
|
|
3011
3012
|
};
|
|
3012
3013
|
/**
|
|
3013
3014
|
* @return {?}
|
|
@@ -3025,8 +3026,7 @@ var MultiTabComponent = /** @class */ (function () {
|
|
|
3025
3026
|
* @return {?}
|
|
3026
3027
|
*/
|
|
3027
3028
|
function (ele) {
|
|
3028
|
-
return _this.urlWithoutQuery(ele.url) ===
|
|
3029
|
-
_this.urlWithoutQuery(_this.router.url);
|
|
3029
|
+
return _this.urlWithoutQuery(ele.url) === _this.urlWithoutQuery(_this.router.url);
|
|
3030
3030
|
}));
|
|
3031
3031
|
if (isExistIdx !== -1) {
|
|
3032
3032
|
this.selectedTab = isExistIdx;
|
|
@@ -3104,6 +3104,8 @@ var MultiTabComponent = /** @class */ (function () {
|
|
|
3104
3104
|
* @return {?}
|
|
3105
3105
|
*/
|
|
3106
3106
|
function () {
|
|
3107
|
+
this.tabList = []; // 清空 tab 列表
|
|
3108
|
+
this.selectedTab = 0; // 重置选中的 tab 索引
|
|
3107
3109
|
this.subscriptions.forEach((/**
|
|
3108
3110
|
* @param {?} sub
|
|
3109
3111
|
* @return {?}
|
|
@@ -3144,6 +3146,8 @@ var MultiTabComponent = /** @class */ (function () {
|
|
|
3144
3146
|
: width - _this.textGap, 12);
|
|
3145
3147
|
}));
|
|
3146
3148
|
}
|
|
3149
|
+
this.ref.markForCheck();
|
|
3150
|
+
this.ref.detectChanges();
|
|
3147
3151
|
};
|
|
3148
3152
|
/**
|
|
3149
3153
|
* @return {?}
|
|
@@ -3205,15 +3209,15 @@ var MultiTabComponent = /** @class */ (function () {
|
|
|
3205
3209
|
};
|
|
3206
3210
|
/**
|
|
3207
3211
|
* @param {?} idx
|
|
3208
|
-
* @param {?=}
|
|
3212
|
+
* @param {?=} noChange
|
|
3209
3213
|
* @return {?}
|
|
3210
3214
|
*/
|
|
3211
3215
|
MultiTabComponent.prototype.closeTab = /**
|
|
3212
3216
|
* @param {?} idx
|
|
3213
|
-
* @param {?=}
|
|
3217
|
+
* @param {?=} noChange
|
|
3214
3218
|
* @return {?}
|
|
3215
3219
|
*/
|
|
3216
|
-
function (idx,
|
|
3220
|
+
function (idx, noChange) {
|
|
3217
3221
|
/** @type {?} */
|
|
3218
3222
|
var tab = this.tabList[idx];
|
|
3219
3223
|
this.tabList = this.tabList.filter((/**
|
|
@@ -3222,7 +3226,7 @@ var MultiTabComponent = /** @class */ (function () {
|
|
|
3222
3226
|
*/
|
|
3223
3227
|
function (ele) { return ele.url !== tab.url; }));
|
|
3224
3228
|
this.clearCache(this.urlWithoutQuery(tab.url));
|
|
3225
|
-
if (!
|
|
3229
|
+
if (!noChange && this.selectedTab === idx) {
|
|
3226
3230
|
/** @type {?} */
|
|
3227
3231
|
var targetIdx = Math.max(0, idx - 1);
|
|
3228
3232
|
this.changeTab(this.tabList[targetIdx], targetIdx);
|
|
@@ -3249,8 +3253,8 @@ var MultiTabComponent = /** @class */ (function () {
|
|
|
3249
3253
|
if (tab.navigationInfo) {
|
|
3250
3254
|
sessionStorage.setItem("navigationInfo", JSON.stringify(tab.navigationInfo));
|
|
3251
3255
|
}
|
|
3252
|
-
if (tab.
|
|
3253
|
-
sessionStorage.setItem("
|
|
3256
|
+
if (tab.fromInfo) {
|
|
3257
|
+
sessionStorage.setItem("fromInfo", JSON.stringify(tab.fromInfo));
|
|
3254
3258
|
}
|
|
3255
3259
|
if (tab.permissions) {
|
|
3256
3260
|
sessionStorage.setItem("permissions", JSON.stringify(tab.permissions));
|
|
@@ -3270,7 +3274,14 @@ var MultiTabComponent = /** @class */ (function () {
|
|
|
3270
3274
|
*/
|
|
3271
3275
|
function (url, title) {
|
|
3272
3276
|
if (this.tabList.length >= this.maxTabs) {
|
|
3273
|
-
|
|
3277
|
+
/** @type {?} */
|
|
3278
|
+
var secondTab_1 = this.tabList[1];
|
|
3279
|
+
this.tabList = this.tabList.filter((/**
|
|
3280
|
+
* @param {?} ele
|
|
3281
|
+
* @return {?}
|
|
3282
|
+
*/
|
|
3283
|
+
function (ele) { return ele.url !== secondTab_1.url; }));
|
|
3284
|
+
this.clearCache(this.urlWithoutQuery(secondTab_1.url));
|
|
3274
3285
|
}
|
|
3275
3286
|
/** @type {?} */
|
|
3276
3287
|
var localPermissions = sessionStorage.getItem("permissions") ||
|
|
@@ -3278,7 +3289,7 @@ var MultiTabComponent = /** @class */ (function () {
|
|
|
3278
3289
|
/** @type {?} */
|
|
3279
3290
|
var navigationInfo = JSON.parse(sessionStorage.getItem("navigationInfo"));
|
|
3280
3291
|
/** @type {?} */
|
|
3281
|
-
var
|
|
3292
|
+
var fromInfo = JSON.parse(sessionStorage.getItem("fromInfo"));
|
|
3282
3293
|
/** @type {?} */
|
|
3283
3294
|
var permissions = JSON.parse(localPermissions);
|
|
3284
3295
|
this.tabList.push({
|
|
@@ -3287,7 +3298,7 @@ var MultiTabComponent = /** @class */ (function () {
|
|
|
3287
3298
|
displayTitle: title,
|
|
3288
3299
|
navigationInfo: navigationInfo,
|
|
3289
3300
|
permissions: permissions,
|
|
3290
|
-
|
|
3301
|
+
fromInfo: fromInfo,
|
|
3291
3302
|
});
|
|
3292
3303
|
this.selectedTab = this.tabList.length - 1;
|
|
3293
3304
|
this.setEllipsisTitle();
|
|
@@ -3340,7 +3351,12 @@ var MultiTabComponent = /** @class */ (function () {
|
|
|
3340
3351
|
if (targetTabUrl !== url || noReused) {
|
|
3341
3352
|
// 当缓存一致时候,但是url不一致,重新按照新的url生成tab
|
|
3342
3353
|
this.closeTab(isExistIdx, true);
|
|
3343
|
-
|
|
3354
|
+
setTimeout((/**
|
|
3355
|
+
* @return {?}
|
|
3356
|
+
*/
|
|
3357
|
+
function () {
|
|
3358
|
+
_this.addTab(url, title);
|
|
3359
|
+
}), 30);
|
|
3344
3360
|
}
|
|
3345
3361
|
else {
|
|
3346
3362
|
this.changeTab(this.tabList[isExistIdx], isExistIdx);
|
|
@@ -3391,6 +3407,18 @@ var MultiTabComponent = /** @class */ (function () {
|
|
|
3391
3407
|
this.keepAlive.clearCache(url); // 调用自定义策略的清除缓存方法
|
|
3392
3408
|
this.drawer.deleteCache(url);
|
|
3393
3409
|
};
|
|
3410
|
+
/**
|
|
3411
|
+
* @return {?}
|
|
3412
|
+
*/
|
|
3413
|
+
MultiTabComponent.prototype.cleanAllCache = /**
|
|
3414
|
+
* @return {?}
|
|
3415
|
+
*/
|
|
3416
|
+
function () {
|
|
3417
|
+
sessionStorage.removeItem("TabCache"); // 清除缓存
|
|
3418
|
+
this.tabList = []; // 清空 tab 列表
|
|
3419
|
+
this.selectedTab = 0; // 重置选中的 tab 索引
|
|
3420
|
+
this.keepAlive.clearAllCache(); // 调用自定义策略的清除缓存方法
|
|
3421
|
+
};
|
|
3394
3422
|
/**
|
|
3395
3423
|
* @private
|
|
3396
3424
|
* @param {?} url
|
|
@@ -20812,11 +20840,25 @@ if (false) {
|
|
|
20812
20840
|
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
20813
20841
|
*/
|
|
20814
20842
|
var MainContainerComponent = /** @class */ (function () {
|
|
20815
|
-
function MainContainerComponent(globalDrawer) {
|
|
20843
|
+
function MainContainerComponent(globalDrawer, elementRef) {
|
|
20844
|
+
var _this = this;
|
|
20816
20845
|
this.globalDrawer = globalDrawer;
|
|
20846
|
+
this.elementRef = elementRef;
|
|
20817
20847
|
this.isCollapsed = false; // 接收输入属性
|
|
20818
20848
|
// 接收输入属性
|
|
20819
20849
|
this.singleReuseUrls = []; //只能单个缓存的url
|
|
20850
|
+
//只能单个缓存的url
|
|
20851
|
+
this.onWidthChange = new EventEmitter();
|
|
20852
|
+
this.debouncedHandleResize = debounce((/**
|
|
20853
|
+
* @param {?} width
|
|
20854
|
+
* @return {?}
|
|
20855
|
+
*/
|
|
20856
|
+
function (width) {
|
|
20857
|
+
// console.log("Debounced width change:", width);
|
|
20858
|
+
// 在这里处理防抖后的宽度变化逻辑
|
|
20859
|
+
_this.multiTabRef && _this.multiTabRef.setEllipsisTitle();
|
|
20860
|
+
_this.onWidthChange.emit(width);
|
|
20861
|
+
}), 300);
|
|
20820
20862
|
}
|
|
20821
20863
|
/**
|
|
20822
20864
|
* @return {?}
|
|
@@ -20853,7 +20895,45 @@ var MainContainerComponent = /** @class */ (function () {
|
|
|
20853
20895
|
* @return {?}
|
|
20854
20896
|
*/
|
|
20855
20897
|
function () {
|
|
20898
|
+
var _this = this;
|
|
20856
20899
|
this.globalDrawer.setDrawer(this.drawer); // 设置抽屉组件
|
|
20900
|
+
// 设置抽屉组件
|
|
20901
|
+
/** @type {?} */
|
|
20902
|
+
var rightAside = this.elementRef.nativeElement.querySelector(".right-aside");
|
|
20903
|
+
this.resizeObserver = new ResizeObserver((/**
|
|
20904
|
+
* @param {?} entries
|
|
20905
|
+
* @return {?}
|
|
20906
|
+
*/
|
|
20907
|
+
function (entries) {
|
|
20908
|
+
var e_1, _a;
|
|
20909
|
+
try {
|
|
20910
|
+
for (var entries_1 = __values(entries), entries_1_1 = entries_1.next(); !entries_1_1.done; entries_1_1 = entries_1.next()) {
|
|
20911
|
+
var entry = entries_1_1.value;
|
|
20912
|
+
/** @type {?} */
|
|
20913
|
+
var width = entry.contentRect.width;
|
|
20914
|
+
_this.debouncedHandleResize(width);
|
|
20915
|
+
}
|
|
20916
|
+
}
|
|
20917
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
20918
|
+
finally {
|
|
20919
|
+
try {
|
|
20920
|
+
if (entries_1_1 && !entries_1_1.done && (_a = entries_1.return)) _a.call(entries_1);
|
|
20921
|
+
}
|
|
20922
|
+
finally { if (e_1) throw e_1.error; }
|
|
20923
|
+
}
|
|
20924
|
+
}));
|
|
20925
|
+
this.resizeObserver.observe(rightAside);
|
|
20926
|
+
};
|
|
20927
|
+
/**
|
|
20928
|
+
* @return {?}
|
|
20929
|
+
*/
|
|
20930
|
+
MainContainerComponent.prototype.ngOnDestroy = /**
|
|
20931
|
+
* @return {?}
|
|
20932
|
+
*/
|
|
20933
|
+
function () {
|
|
20934
|
+
if (this.resizeObserver) {
|
|
20935
|
+
this.resizeObserver.disconnect();
|
|
20936
|
+
}
|
|
20857
20937
|
};
|
|
20858
20938
|
/**
|
|
20859
20939
|
* @return {?}
|
|
@@ -20877,13 +20957,16 @@ var MainContainerComponent = /** @class */ (function () {
|
|
|
20877
20957
|
];
|
|
20878
20958
|
/** @nocollapse */
|
|
20879
20959
|
MainContainerComponent.ctorParameters = function () { return [
|
|
20880
|
-
{ type: DrawerService }
|
|
20960
|
+
{ type: DrawerService },
|
|
20961
|
+
{ type: ElementRef }
|
|
20881
20962
|
]; };
|
|
20882
20963
|
MainContainerComponent.propDecorators = {
|
|
20883
20964
|
headerRef: [{ type: ContentChild, args: [RSHeaderComponent, { static: true },] }],
|
|
20965
|
+
multiTabRef: [{ type: ContentChild, args: [MultiTabComponent, { static: true },] }],
|
|
20884
20966
|
drawer: [{ type: ViewChild, args: ["drawer", { static: false },] }],
|
|
20885
20967
|
isCollapsed: [{ type: Input }],
|
|
20886
20968
|
singleReuseUrls: [{ type: Input }],
|
|
20969
|
+
onWidthChange: [{ type: Output }],
|
|
20887
20970
|
onResize: [{ type: HostListener, args: ["window:resize", ["$event"],] }]
|
|
20888
20971
|
};
|
|
20889
20972
|
return MainContainerComponent;
|
|
@@ -20892,16 +20975,35 @@ if (false) {
|
|
|
20892
20975
|
/** @type {?} */
|
|
20893
20976
|
MainContainerComponent.prototype.headerRef;
|
|
20894
20977
|
/** @type {?} */
|
|
20978
|
+
MainContainerComponent.prototype.multiTabRef;
|
|
20979
|
+
/** @type {?} */
|
|
20895
20980
|
MainContainerComponent.prototype.drawer;
|
|
20896
20981
|
/** @type {?} */
|
|
20897
20982
|
MainContainerComponent.prototype.isCollapsed;
|
|
20898
20983
|
/** @type {?} */
|
|
20899
20984
|
MainContainerComponent.prototype.singleReuseUrls;
|
|
20985
|
+
/** @type {?} */
|
|
20986
|
+
MainContainerComponent.prototype.onWidthChange;
|
|
20987
|
+
/**
|
|
20988
|
+
* @type {?}
|
|
20989
|
+
* @private
|
|
20990
|
+
*/
|
|
20991
|
+
MainContainerComponent.prototype.resizeObserver;
|
|
20992
|
+
/**
|
|
20993
|
+
* @type {?}
|
|
20994
|
+
* @private
|
|
20995
|
+
*/
|
|
20996
|
+
MainContainerComponent.prototype.debouncedHandleResize;
|
|
20900
20997
|
/**
|
|
20901
20998
|
* @type {?}
|
|
20902
20999
|
* @private
|
|
20903
21000
|
*/
|
|
20904
21001
|
MainContainerComponent.prototype.globalDrawer;
|
|
21002
|
+
/**
|
|
21003
|
+
* @type {?}
|
|
21004
|
+
* @private
|
|
21005
|
+
*/
|
|
21006
|
+
MainContainerComponent.prototype.elementRef;
|
|
20905
21007
|
}
|
|
20906
21008
|
|
|
20907
21009
|
/**
|