raise-common-lib 0.0.132 → 0.0.133

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));
@@ -3470,7 +3475,7 @@
3470
3475
  /** @type {?} */
3471
3476
  var navigationInfo = JSON.parse(sessionStorage.getItem("navigationInfo"));
3472
3477
  /** @type {?} */
3473
- var fromUrl = sessionStorage.getItem("fromUrl");
3478
+ var fromInfo = JSON.parse(sessionStorage.getItem("fromInfo"));
3474
3479
  /** @type {?} */
3475
3480
  var permissions = JSON.parse(localPermissions);
3476
3481
  this.tabList.push({
@@ -3479,7 +3484,7 @@
3479
3484
  displayTitle: title,
3480
3485
  navigationInfo: navigationInfo,
3481
3486
  permissions: permissions,
3482
- fromUrl: fromUrl,
3487
+ fromInfo: fromInfo,
3483
3488
  });
3484
3489
  this.selectedTab = this.tabList.length - 1;
3485
3490
  this.setEllipsisTitle();
@@ -3532,7 +3537,12 @@
3532
3537
  if (targetTabUrl !== url || noReused) {
3533
3538
  // 当缓存一致时候,但是url不一致,重新按照新的url生成tab
3534
3539
  this.closeTab(isExistIdx, true);
3535
- this.addTab(url, title);
3540
+ setTimeout((/**
3541
+ * @return {?}
3542
+ */
3543
+ function () {
3544
+ _this.addTab(url, title);
3545
+ }), 30);
3536
3546
  }
3537
3547
  else {
3538
3548
  this.changeTab(this.tabList[isExistIdx], isExistIdx);
@@ -3583,6 +3593,18 @@
3583
3593
  this.keepAlive.clearCache(url); // 调用自定义策略的清除缓存方法
3584
3594
  this.drawer.deleteCache(url);
3585
3595
  };
3596
+ /**
3597
+ * @return {?}
3598
+ */
3599
+ MultiTabComponent.prototype.cleanAllCache = /**
3600
+ * @return {?}
3601
+ */
3602
+ function () {
3603
+ sessionStorage.removeItem("TabCache"); // 清除缓存
3604
+ this.tabList = []; // 清空 tab 列表
3605
+ this.selectedTab = 0; // 重置选中的 tab 索引
3606
+ this.keepAlive.clearAllCache(); // 调用自定义策略的清除缓存方法
3607
+ };
3586
3608
  /**
3587
3609
  * @private
3588
3610
  * @param {?} url
@@ -21004,11 +21026,25 @@
21004
21026
  * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
21005
21027
  */
21006
21028
  var MainContainerComponent = /** @class */ (function () {
21007
- function MainContainerComponent(globalDrawer) {
21029
+ function MainContainerComponent(globalDrawer, elementRef) {
21030
+ var _this = this;
21008
21031
  this.globalDrawer = globalDrawer;
21032
+ this.elementRef = elementRef;
21009
21033
  this.isCollapsed = false; // 接收输入属性
21010
21034
  // 接收输入属性
21011
21035
  this.singleReuseUrls = []; //只能单个缓存的url
21036
+ //只能单个缓存的url
21037
+ this.onWidthChange = new core.EventEmitter();
21038
+ this.debouncedHandleResize = lodash.debounce((/**
21039
+ * @param {?} width
21040
+ * @return {?}
21041
+ */
21042
+ function (width) {
21043
+ // console.log("Debounced width change:", width);
21044
+ // 在这里处理防抖后的宽度变化逻辑
21045
+ _this.multiTabRef && _this.multiTabRef.setEllipsisTitle();
21046
+ _this.onWidthChange.emit(width);
21047
+ }), 300);
21012
21048
  }
21013
21049
  /**
21014
21050
  * @return {?}
@@ -21045,7 +21081,45 @@
21045
21081
  * @return {?}
21046
21082
  */
21047
21083
  function () {
21084
+ var _this = this;
21048
21085
  this.globalDrawer.setDrawer(this.drawer); // 设置抽屉组件
21086
+ // 设置抽屉组件
21087
+ /** @type {?} */
21088
+ var rightAside = this.elementRef.nativeElement.querySelector(".right-aside");
21089
+ this.resizeObserver = new ResizeObserver((/**
21090
+ * @param {?} entries
21091
+ * @return {?}
21092
+ */
21093
+ function (entries) {
21094
+ var e_1, _a;
21095
+ try {
21096
+ for (var entries_1 = __values(entries), entries_1_1 = entries_1.next(); !entries_1_1.done; entries_1_1 = entries_1.next()) {
21097
+ var entry = entries_1_1.value;
21098
+ /** @type {?} */
21099
+ var width = entry.contentRect.width;
21100
+ _this.debouncedHandleResize(width);
21101
+ }
21102
+ }
21103
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
21104
+ finally {
21105
+ try {
21106
+ if (entries_1_1 && !entries_1_1.done && (_a = entries_1.return)) _a.call(entries_1);
21107
+ }
21108
+ finally { if (e_1) throw e_1.error; }
21109
+ }
21110
+ }));
21111
+ this.resizeObserver.observe(rightAside);
21112
+ };
21113
+ /**
21114
+ * @return {?}
21115
+ */
21116
+ MainContainerComponent.prototype.ngOnDestroy = /**
21117
+ * @return {?}
21118
+ */
21119
+ function () {
21120
+ if (this.resizeObserver) {
21121
+ this.resizeObserver.disconnect();
21122
+ }
21049
21123
  };
21050
21124
  /**
21051
21125
  * @return {?}
@@ -21069,13 +21143,16 @@
21069
21143
  ];
21070
21144
  /** @nocollapse */
21071
21145
  MainContainerComponent.ctorParameters = function () { return [
21072
- { type: DrawerService }
21146
+ { type: DrawerService },
21147
+ { type: core.ElementRef }
21073
21148
  ]; };
21074
21149
  MainContainerComponent.propDecorators = {
21075
21150
  headerRef: [{ type: core.ContentChild, args: [RSHeaderComponent, { static: true },] }],
21151
+ multiTabRef: [{ type: core.ContentChild, args: [MultiTabComponent, { static: true },] }],
21076
21152
  drawer: [{ type: core.ViewChild, args: ["drawer", { static: false },] }],
21077
21153
  isCollapsed: [{ type: core.Input }],
21078
21154
  singleReuseUrls: [{ type: core.Input }],
21155
+ onWidthChange: [{ type: core.Output }],
21079
21156
  onResize: [{ type: core.HostListener, args: ["window:resize", ["$event"],] }]
21080
21157
  };
21081
21158
  return MainContainerComponent;
@@ -21084,16 +21161,35 @@
21084
21161
  /** @type {?} */
21085
21162
  MainContainerComponent.prototype.headerRef;
21086
21163
  /** @type {?} */
21164
+ MainContainerComponent.prototype.multiTabRef;
21165
+ /** @type {?} */
21087
21166
  MainContainerComponent.prototype.drawer;
21088
21167
  /** @type {?} */
21089
21168
  MainContainerComponent.prototype.isCollapsed;
21090
21169
  /** @type {?} */
21091
21170
  MainContainerComponent.prototype.singleReuseUrls;
21171
+ /** @type {?} */
21172
+ MainContainerComponent.prototype.onWidthChange;
21173
+ /**
21174
+ * @type {?}
21175
+ * @private
21176
+ */
21177
+ MainContainerComponent.prototype.resizeObserver;
21178
+ /**
21179
+ * @type {?}
21180
+ * @private
21181
+ */
21182
+ MainContainerComponent.prototype.debouncedHandleResize;
21092
21183
  /**
21093
21184
  * @type {?}
21094
21185
  * @private
21095
21186
  */
21096
21187
  MainContainerComponent.prototype.globalDrawer;
21188
+ /**
21189
+ * @type {?}
21190
+ * @private
21191
+ */
21192
+ MainContainerComponent.prototype.elementRef;
21097
21193
  }
21098
21194
 
21099
21195
  /**