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.
@@ -1,8 +1,10 @@
1
1
  (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@syncfusion/ej2-angular-grids'), require('lodash'), require('rxjs'), require('@angular/material/snack-bar'), require('@angular/material/dialog'), require('@syncfusion/ej2-angular-treegrid'), require('@syncfusion/ej2-angular-navigations'), require('@angular/router'), require('rxjs/operators'), require('@angular/common/http'), require('@syncfusion/ej2-base'), require('@angular/common'), require('@syncfusion/ej2-data'), require('@angular/material/icon'), require('@angular/platform-browser'), require('@angular/forms'), require('@syncfusion/ej2-angular-buttons'), require('@syncfusion/ej2-angular-diagrams'), require('@syncfusion/ej2-angular-popups'), require('@syncfusion/ej2-angular-calendars'), require('@syncfusion/ej2-angular-inputs'), require('@syncfusion/ej2-angular-dropdowns'), require('@syncfusion/ej2-angular-pivotview'), require('@syncfusion/ej2-angular-charts'), require('@syncfusion/ej2-angular-layouts'), require('@syncfusion/ej2-angular-pdfviewer'), require('@syncfusion/ej2-angular-splitbuttons'), require('@syncfusion/ej2-angular-richtexteditor'), require('@angular/material/menu'), require('@angular/material/tooltip')) :
3
- typeof define === 'function' && define.amd ? define('raise-common-lib', ['exports', '@angular/core', '@syncfusion/ej2-angular-grids', 'lodash', 'rxjs', '@angular/material/snack-bar', '@angular/material/dialog', '@syncfusion/ej2-angular-treegrid', '@syncfusion/ej2-angular-navigations', '@angular/router', 'rxjs/operators', '@angular/common/http', '@syncfusion/ej2-base', '@angular/common', '@syncfusion/ej2-data', '@angular/material/icon', '@angular/platform-browser', '@angular/forms', '@syncfusion/ej2-angular-buttons', '@syncfusion/ej2-angular-diagrams', '@syncfusion/ej2-angular-popups', '@syncfusion/ej2-angular-calendars', '@syncfusion/ej2-angular-inputs', '@syncfusion/ej2-angular-dropdowns', '@syncfusion/ej2-angular-pivotview', '@syncfusion/ej2-angular-charts', '@syncfusion/ej2-angular-layouts', '@syncfusion/ej2-angular-pdfviewer', '@syncfusion/ej2-angular-splitbuttons', '@syncfusion/ej2-angular-richtexteditor', '@angular/material/menu', '@angular/material/tooltip'], factory) :
4
- (global = global || self, factory(global['raise-common-lib'] = {}, global.ng.core, global.ej2AngularGrids, global.lodash, global.rxjs, global.ng.material['snack-bar'], global.ng.material.dialog, global.ej2AngularTreegrid, global.ej2AngularNavigations, global.ng.router, global.rxjs.operators, global.ng.common.http, global.ej2Base, global.ng.common, global.ej2Data, global.ng.material.icon, global.ng.platformBrowser, global.ng.forms, global.ej2AngularButtons, global.ej2AngularDiagrams, global.ej2AngularPopups, global.ej2AngularCalendars, global.ej2AngularInputs, global.ej2AngularDropdowns, global.ej2AngularPivotview, global.ej2AngularCharts, global.ej2AngularLayouts, global.ej2AngularPdfviewer, global.ej2AngularSplitbuttons, global.ej2AngularRichtexteditor, global.ng.material.menu, global.ng.material.tooltip));
5
- }(this, (function (exports, core, ej2AngularGrids, lodash, rxjs, snackBar, dialog, ej2AngularTreegrid, ej2AngularNavigations, router, operators, http, ej2Base, common, ej2Data, icon, platformBrowser, forms, ej2AngularButtons, ej2AngularDiagrams, ej2AngularPopups, ej2AngularCalendars, ej2AngularInputs, ej2AngularDropdowns, ej2AngularPivotview, ej2AngularCharts, ej2AngularLayouts, ej2AngularPdfviewer, ej2AngularSplitbuttons, ej2AngularRichtexteditor, menu, tooltip) { 'use strict';
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@syncfusion/ej2-angular-grids'), require('lodash'), require('rxjs'), require('@angular/material/snack-bar'), require('@angular/material/dialog'), require('@syncfusion/ej2-angular-treegrid'), require('@syncfusion/ej2-angular-navigations'), require('@angular/router'), require('rxjs/operators'), require('@angular/common/http'), require('@syncfusion/ej2-base'), require('resize-observer-polyfill'), require('@angular/common'), require('@syncfusion/ej2-data'), require('@angular/material/icon'), require('@angular/platform-browser'), require('@angular/forms'), require('@syncfusion/ej2-angular-buttons'), require('@syncfusion/ej2-angular-diagrams'), require('@syncfusion/ej2-angular-popups'), require('@syncfusion/ej2-angular-calendars'), require('@syncfusion/ej2-angular-inputs'), require('@syncfusion/ej2-angular-dropdowns'), require('@syncfusion/ej2-angular-pivotview'), require('@syncfusion/ej2-angular-charts'), require('@syncfusion/ej2-angular-layouts'), require('@syncfusion/ej2-angular-pdfviewer'), require('@syncfusion/ej2-angular-splitbuttons'), require('@syncfusion/ej2-angular-richtexteditor'), require('@angular/material/menu'), require('@angular/material/tooltip')) :
3
+ typeof define === 'function' && define.amd ? define('raise-common-lib', ['exports', '@angular/core', '@syncfusion/ej2-angular-grids', 'lodash', 'rxjs', '@angular/material/snack-bar', '@angular/material/dialog', '@syncfusion/ej2-angular-treegrid', '@syncfusion/ej2-angular-navigations', '@angular/router', 'rxjs/operators', '@angular/common/http', '@syncfusion/ej2-base', 'resize-observer-polyfill', '@angular/common', '@syncfusion/ej2-data', '@angular/material/icon', '@angular/platform-browser', '@angular/forms', '@syncfusion/ej2-angular-buttons', '@syncfusion/ej2-angular-diagrams', '@syncfusion/ej2-angular-popups', '@syncfusion/ej2-angular-calendars', '@syncfusion/ej2-angular-inputs', '@syncfusion/ej2-angular-dropdowns', '@syncfusion/ej2-angular-pivotview', '@syncfusion/ej2-angular-charts', '@syncfusion/ej2-angular-layouts', '@syncfusion/ej2-angular-pdfviewer', '@syncfusion/ej2-angular-splitbuttons', '@syncfusion/ej2-angular-richtexteditor', '@angular/material/menu', '@angular/material/tooltip'], factory) :
4
+ (global = global || self, factory(global['raise-common-lib'] = {}, global.ng.core, global.ej2AngularGrids, global.lodash, global.rxjs, global.ng.material['snack-bar'], global.ng.material.dialog, global.ej2AngularTreegrid, global.ej2AngularNavigations, global.ng.router, global.rxjs.operators, global.ng.common.http, global.ej2Base, global.ResizeObserver, global.ng.common, global.ej2Data, global.ng.material.icon, global.ng.platformBrowser, global.ng.forms, global.ej2AngularButtons, global.ej2AngularDiagrams, global.ej2AngularPopups, global.ej2AngularCalendars, global.ej2AngularInputs, global.ej2AngularDropdowns, global.ej2AngularPivotview, global.ej2AngularCharts, global.ej2AngularLayouts, global.ej2AngularPdfviewer, global.ej2AngularSplitbuttons, global.ej2AngularRichtexteditor, global.ng.material.menu, global.ng.material.tooltip));
5
+ }(this, (function (exports, core, ej2AngularGrids, lodash, rxjs, snackBar, dialog, ej2AngularTreegrid, ej2AngularNavigations, router, operators, http, ej2Base, ResizeObserver, common, ej2Data, icon, platformBrowser, forms, ej2AngularButtons, ej2AngularDiagrams, ej2AngularPopups, ej2AngularCalendars, ej2AngularInputs, ej2AngularDropdowns, ej2AngularPivotview, ej2AngularCharts, ej2AngularLayouts, ej2AngularPdfviewer, ej2AngularSplitbuttons, ej2AngularRichtexteditor, menu, tooltip) { 'use strict';
6
+
7
+ ResizeObserver = ResizeObserver && ResizeObserver.hasOwnProperty('default') ? ResizeObserver['default'] : ResizeObserver;
6
8
 
7
9
  /*! *****************************************************************************
8
10
  Copyright (c) Microsoft Corporation.
@@ -3199,7 +3201,7 @@
3199
3201
  */
3200
3202
  function (event) {
3201
3203
  this.screenWidth = window.innerWidth; // 更新屏幕宽度
3202
- this.setEllipsisTitle();
3204
+ // this.setEllipsisTitle(); 在最外面容器调用
3203
3205
  };
3204
3206
  /**
3205
3207
  * @return {?}
@@ -3217,8 +3219,7 @@
3217
3219
  * @return {?}
3218
3220
  */
3219
3221
  function (ele) {
3220
- return _this.urlWithoutQuery(ele.url) ===
3221
- _this.urlWithoutQuery(_this.router.url);
3222
+ return _this.urlWithoutQuery(ele.url) === _this.urlWithoutQuery(_this.router.url);
3222
3223
  }));
3223
3224
  if (isExistIdx !== -1) {
3224
3225
  this.selectedTab = isExistIdx;
@@ -3296,6 +3297,8 @@
3296
3297
  * @return {?}
3297
3298
  */
3298
3299
  function () {
3300
+ this.tabList = []; // 清空 tab 列表
3301
+ this.selectedTab = 0; // 重置选中的 tab 索引
3299
3302
  this.subscriptions.forEach((/**
3300
3303
  * @param {?} sub
3301
3304
  * @return {?}
@@ -3336,6 +3339,8 @@
3336
3339
  : width - _this.textGap, 12);
3337
3340
  }));
3338
3341
  }
3342
+ this.ref.markForCheck();
3343
+ this.ref.detectChanges();
3339
3344
  };
3340
3345
  /**
3341
3346
  * @return {?}
@@ -3397,15 +3402,15 @@
3397
3402
  };
3398
3403
  /**
3399
3404
  * @param {?} idx
3400
- * @param {?=} isExternal
3405
+ * @param {?=} noChange
3401
3406
  * @return {?}
3402
3407
  */
3403
3408
  MultiTabComponent.prototype.closeTab = /**
3404
3409
  * @param {?} idx
3405
- * @param {?=} isExternal
3410
+ * @param {?=} noChange
3406
3411
  * @return {?}
3407
3412
  */
3408
- function (idx, isExternal) {
3413
+ function (idx, noChange) {
3409
3414
  /** @type {?} */
3410
3415
  var tab = this.tabList[idx];
3411
3416
  this.tabList = this.tabList.filter((/**
@@ -3414,7 +3419,7 @@
3414
3419
  */
3415
3420
  function (ele) { return ele.url !== tab.url; }));
3416
3421
  this.clearCache(this.urlWithoutQuery(tab.url));
3417
- if (!isExternal && this.selectedTab === idx) {
3422
+ if (!noChange && this.selectedTab === idx) {
3418
3423
  /** @type {?} */
3419
3424
  var targetIdx = Math.max(0, idx - 1);
3420
3425
  this.changeTab(this.tabList[targetIdx], targetIdx);
@@ -3441,8 +3446,8 @@
3441
3446
  if (tab.navigationInfo) {
3442
3447
  sessionStorage.setItem("navigationInfo", JSON.stringify(tab.navigationInfo));
3443
3448
  }
3444
- if (tab.fromUrl) {
3445
- sessionStorage.setItem("fromUrl", tab.fromUrl);
3449
+ if (tab.fromInfo) {
3450
+ sessionStorage.setItem("fromInfo", JSON.stringify(tab.fromInfo));
3446
3451
  }
3447
3452
  if (tab.permissions) {
3448
3453
  sessionStorage.setItem("permissions", JSON.stringify(tab.permissions));
@@ -3462,7 +3467,14 @@
3462
3467
  */
3463
3468
  function (url, title) {
3464
3469
  if (this.tabList.length >= this.maxTabs) {
3465
- this.closeTab(1); // 删除第二个,第一个固定
3470
+ /** @type {?} */
3471
+ var secondTab_1 = this.tabList[1];
3472
+ this.tabList = this.tabList.filter((/**
3473
+ * @param {?} ele
3474
+ * @return {?}
3475
+ */
3476
+ function (ele) { return ele.url !== secondTab_1.url; }));
3477
+ this.clearCache(this.urlWithoutQuery(secondTab_1.url));
3466
3478
  }
3467
3479
  /** @type {?} */
3468
3480
  var localPermissions = sessionStorage.getItem("permissions") ||
@@ -3470,7 +3482,7 @@
3470
3482
  /** @type {?} */
3471
3483
  var navigationInfo = JSON.parse(sessionStorage.getItem("navigationInfo"));
3472
3484
  /** @type {?} */
3473
- var fromUrl = sessionStorage.getItem("fromUrl");
3485
+ var fromInfo = JSON.parse(sessionStorage.getItem("fromInfo"));
3474
3486
  /** @type {?} */
3475
3487
  var permissions = JSON.parse(localPermissions);
3476
3488
  this.tabList.push({
@@ -3479,7 +3491,7 @@
3479
3491
  displayTitle: title,
3480
3492
  navigationInfo: navigationInfo,
3481
3493
  permissions: permissions,
3482
- fromUrl: fromUrl,
3494
+ fromInfo: fromInfo,
3483
3495
  });
3484
3496
  this.selectedTab = this.tabList.length - 1;
3485
3497
  this.setEllipsisTitle();
@@ -3532,7 +3544,12 @@
3532
3544
  if (targetTabUrl !== url || noReused) {
3533
3545
  // 当缓存一致时候,但是url不一致,重新按照新的url生成tab
3534
3546
  this.closeTab(isExistIdx, true);
3535
- this.addTab(url, title);
3547
+ setTimeout((/**
3548
+ * @return {?}
3549
+ */
3550
+ function () {
3551
+ _this.addTab(url, title);
3552
+ }), 30);
3536
3553
  }
3537
3554
  else {
3538
3555
  this.changeTab(this.tabList[isExistIdx], isExistIdx);
@@ -3583,6 +3600,18 @@
3583
3600
  this.keepAlive.clearCache(url); // 调用自定义策略的清除缓存方法
3584
3601
  this.drawer.deleteCache(url);
3585
3602
  };
3603
+ /**
3604
+ * @return {?}
3605
+ */
3606
+ MultiTabComponent.prototype.cleanAllCache = /**
3607
+ * @return {?}
3608
+ */
3609
+ function () {
3610
+ sessionStorage.removeItem("TabCache"); // 清除缓存
3611
+ this.tabList = []; // 清空 tab 列表
3612
+ this.selectedTab = 0; // 重置选中的 tab 索引
3613
+ this.keepAlive.clearAllCache(); // 调用自定义策略的清除缓存方法
3614
+ };
3586
3615
  /**
3587
3616
  * @private
3588
3617
  * @param {?} url
@@ -21004,11 +21033,25 @@
21004
21033
  * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
21005
21034
  */
21006
21035
  var MainContainerComponent = /** @class */ (function () {
21007
- function MainContainerComponent(globalDrawer) {
21036
+ function MainContainerComponent(globalDrawer, elementRef) {
21037
+ var _this = this;
21008
21038
  this.globalDrawer = globalDrawer;
21039
+ this.elementRef = elementRef;
21009
21040
  this.isCollapsed = false; // 接收输入属性
21010
21041
  // 接收输入属性
21011
21042
  this.singleReuseUrls = []; //只能单个缓存的url
21043
+ //只能单个缓存的url
21044
+ this.onWidthChange = new core.EventEmitter();
21045
+ this.debouncedHandleResize = lodash.debounce((/**
21046
+ * @param {?} width
21047
+ * @return {?}
21048
+ */
21049
+ function (width) {
21050
+ // console.log("Debounced width change:", width);
21051
+ // 在这里处理防抖后的宽度变化逻辑
21052
+ _this.multiTabRef && _this.multiTabRef.setEllipsisTitle();
21053
+ _this.onWidthChange.emit(width);
21054
+ }), 300);
21012
21055
  }
21013
21056
  /**
21014
21057
  * @return {?}
@@ -21045,7 +21088,45 @@
21045
21088
  * @return {?}
21046
21089
  */
21047
21090
  function () {
21091
+ var _this = this;
21048
21092
  this.globalDrawer.setDrawer(this.drawer); // 设置抽屉组件
21093
+ // 设置抽屉组件
21094
+ /** @type {?} */
21095
+ var rightAside = this.elementRef.nativeElement.querySelector(".right-aside");
21096
+ this.resizeObserver = new ResizeObserver((/**
21097
+ * @param {?} entries
21098
+ * @return {?}
21099
+ */
21100
+ function (entries) {
21101
+ var e_1, _a;
21102
+ try {
21103
+ for (var entries_1 = __values(entries), entries_1_1 = entries_1.next(); !entries_1_1.done; entries_1_1 = entries_1.next()) {
21104
+ var entry = entries_1_1.value;
21105
+ /** @type {?} */
21106
+ var width = entry.contentRect.width;
21107
+ _this.debouncedHandleResize(width);
21108
+ }
21109
+ }
21110
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
21111
+ finally {
21112
+ try {
21113
+ if (entries_1_1 && !entries_1_1.done && (_a = entries_1.return)) _a.call(entries_1);
21114
+ }
21115
+ finally { if (e_1) throw e_1.error; }
21116
+ }
21117
+ }));
21118
+ this.resizeObserver.observe(rightAside);
21119
+ };
21120
+ /**
21121
+ * @return {?}
21122
+ */
21123
+ MainContainerComponent.prototype.ngOnDestroy = /**
21124
+ * @return {?}
21125
+ */
21126
+ function () {
21127
+ if (this.resizeObserver) {
21128
+ this.resizeObserver.disconnect();
21129
+ }
21049
21130
  };
21050
21131
  /**
21051
21132
  * @return {?}
@@ -21069,13 +21150,16 @@
21069
21150
  ];
21070
21151
  /** @nocollapse */
21071
21152
  MainContainerComponent.ctorParameters = function () { return [
21072
- { type: DrawerService }
21153
+ { type: DrawerService },
21154
+ { type: core.ElementRef }
21073
21155
  ]; };
21074
21156
  MainContainerComponent.propDecorators = {
21075
21157
  headerRef: [{ type: core.ContentChild, args: [RSHeaderComponent, { static: true },] }],
21158
+ multiTabRef: [{ type: core.ContentChild, args: [MultiTabComponent, { static: true },] }],
21076
21159
  drawer: [{ type: core.ViewChild, args: ["drawer", { static: false },] }],
21077
21160
  isCollapsed: [{ type: core.Input }],
21078
21161
  singleReuseUrls: [{ type: core.Input }],
21162
+ onWidthChange: [{ type: core.Output }],
21079
21163
  onResize: [{ type: core.HostListener, args: ["window:resize", ["$event"],] }]
21080
21164
  };
21081
21165
  return MainContainerComponent;
@@ -21084,16 +21168,35 @@
21084
21168
  /** @type {?} */
21085
21169
  MainContainerComponent.prototype.headerRef;
21086
21170
  /** @type {?} */
21171
+ MainContainerComponent.prototype.multiTabRef;
21172
+ /** @type {?} */
21087
21173
  MainContainerComponent.prototype.drawer;
21088
21174
  /** @type {?} */
21089
21175
  MainContainerComponent.prototype.isCollapsed;
21090
21176
  /** @type {?} */
21091
21177
  MainContainerComponent.prototype.singleReuseUrls;
21178
+ /** @type {?} */
21179
+ MainContainerComponent.prototype.onWidthChange;
21180
+ /**
21181
+ * @type {?}
21182
+ * @private
21183
+ */
21184
+ MainContainerComponent.prototype.resizeObserver;
21185
+ /**
21186
+ * @type {?}
21187
+ * @private
21188
+ */
21189
+ MainContainerComponent.prototype.debouncedHandleResize;
21092
21190
  /**
21093
21191
  * @type {?}
21094
21192
  * @private
21095
21193
  */
21096
21194
  MainContainerComponent.prototype.globalDrawer;
21195
+ /**
21196
+ * @type {?}
21197
+ * @private
21198
+ */
21199
+ MainContainerComponent.prototype.elementRef;
21097
21200
  }
21098
21201
 
21099
21202
  /**