raise-common-lib 0.0.131 → 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,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 {?=} isExternal
3212
+ * @param {?=} noChange
3209
3213
  * @return {?}
3210
3214
  */
3211
3215
  MultiTabComponent.prototype.closeTab = /**
3212
3216
  * @param {?} idx
3213
- * @param {?=} isExternal
3217
+ * @param {?=} noChange
3214
3218
  * @return {?}
3215
3219
  */
3216
- function (idx, isExternal) {
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 (!isExternal && this.selectedTab === idx) {
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.fromUrl) {
3253
- sessionStorage.setItem("fromUrl", tab.fromUrl);
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));
@@ -3278,7 +3282,7 @@ var MultiTabComponent = /** @class */ (function () {
3278
3282
  /** @type {?} */
3279
3283
  var navigationInfo = JSON.parse(sessionStorage.getItem("navigationInfo"));
3280
3284
  /** @type {?} */
3281
- var fromUrl = sessionStorage.getItem("fromUrl");
3285
+ var fromInfo = JSON.parse(sessionStorage.getItem("fromInfo"));
3282
3286
  /** @type {?} */
3283
3287
  var permissions = JSON.parse(localPermissions);
3284
3288
  this.tabList.push({
@@ -3287,7 +3291,7 @@ var MultiTabComponent = /** @class */ (function () {
3287
3291
  displayTitle: title,
3288
3292
  navigationInfo: navigationInfo,
3289
3293
  permissions: permissions,
3290
- fromUrl: fromUrl,
3294
+ fromInfo: fromInfo,
3291
3295
  });
3292
3296
  this.selectedTab = this.tabList.length - 1;
3293
3297
  this.setEllipsisTitle();
@@ -3340,7 +3344,12 @@ var MultiTabComponent = /** @class */ (function () {
3340
3344
  if (targetTabUrl !== url || noReused) {
3341
3345
  // 当缓存一致时候,但是url不一致,重新按照新的url生成tab
3342
3346
  this.closeTab(isExistIdx, true);
3343
- this.addTab(url, title);
3347
+ setTimeout((/**
3348
+ * @return {?}
3349
+ */
3350
+ function () {
3351
+ _this.addTab(url, title);
3352
+ }), 30);
3344
3353
  }
3345
3354
  else {
3346
3355
  this.changeTab(this.tabList[isExistIdx], isExistIdx);
@@ -3391,6 +3400,18 @@ var MultiTabComponent = /** @class */ (function () {
3391
3400
  this.keepAlive.clearCache(url); // 调用自定义策略的清除缓存方法
3392
3401
  this.drawer.deleteCache(url);
3393
3402
  };
3403
+ /**
3404
+ * @return {?}
3405
+ */
3406
+ MultiTabComponent.prototype.cleanAllCache = /**
3407
+ * @return {?}
3408
+ */
3409
+ function () {
3410
+ sessionStorage.removeItem("TabCache"); // 清除缓存
3411
+ this.tabList = []; // 清空 tab 列表
3412
+ this.selectedTab = 0; // 重置选中的 tab 索引
3413
+ this.keepAlive.clearAllCache(); // 调用自定义策略的清除缓存方法
3414
+ };
3394
3415
  /**
3395
3416
  * @private
3396
3417
  * @param {?} url
@@ -20812,11 +20833,25 @@ if (false) {
20812
20833
  * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
20813
20834
  */
20814
20835
  var MainContainerComponent = /** @class */ (function () {
20815
- function MainContainerComponent(globalDrawer) {
20836
+ function MainContainerComponent(globalDrawer, elementRef) {
20837
+ var _this = this;
20816
20838
  this.globalDrawer = globalDrawer;
20839
+ this.elementRef = elementRef;
20817
20840
  this.isCollapsed = false; // 接收输入属性
20818
20841
  // 接收输入属性
20819
20842
  this.singleReuseUrls = []; //只能单个缓存的url
20843
+ //只能单个缓存的url
20844
+ this.onWidthChange = new EventEmitter();
20845
+ this.debouncedHandleResize = debounce((/**
20846
+ * @param {?} width
20847
+ * @return {?}
20848
+ */
20849
+ function (width) {
20850
+ // console.log("Debounced width change:", width);
20851
+ // 在这里处理防抖后的宽度变化逻辑
20852
+ _this.multiTabRef && _this.multiTabRef.setEllipsisTitle();
20853
+ _this.onWidthChange.emit(width);
20854
+ }), 300);
20820
20855
  }
20821
20856
  /**
20822
20857
  * @return {?}
@@ -20853,7 +20888,45 @@ var MainContainerComponent = /** @class */ (function () {
20853
20888
  * @return {?}
20854
20889
  */
20855
20890
  function () {
20891
+ var _this = this;
20856
20892
  this.globalDrawer.setDrawer(this.drawer); // 设置抽屉组件
20893
+ // 设置抽屉组件
20894
+ /** @type {?} */
20895
+ var rightAside = this.elementRef.nativeElement.querySelector(".right-aside");
20896
+ this.resizeObserver = new ResizeObserver((/**
20897
+ * @param {?} entries
20898
+ * @return {?}
20899
+ */
20900
+ function (entries) {
20901
+ var e_1, _a;
20902
+ try {
20903
+ for (var entries_1 = __values(entries), entries_1_1 = entries_1.next(); !entries_1_1.done; entries_1_1 = entries_1.next()) {
20904
+ var entry = entries_1_1.value;
20905
+ /** @type {?} */
20906
+ var width = entry.contentRect.width;
20907
+ _this.debouncedHandleResize(width);
20908
+ }
20909
+ }
20910
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
20911
+ finally {
20912
+ try {
20913
+ if (entries_1_1 && !entries_1_1.done && (_a = entries_1.return)) _a.call(entries_1);
20914
+ }
20915
+ finally { if (e_1) throw e_1.error; }
20916
+ }
20917
+ }));
20918
+ this.resizeObserver.observe(rightAside);
20919
+ };
20920
+ /**
20921
+ * @return {?}
20922
+ */
20923
+ MainContainerComponent.prototype.ngOnDestroy = /**
20924
+ * @return {?}
20925
+ */
20926
+ function () {
20927
+ if (this.resizeObserver) {
20928
+ this.resizeObserver.disconnect();
20929
+ }
20857
20930
  };
20858
20931
  /**
20859
20932
  * @return {?}
@@ -20877,13 +20950,16 @@ var MainContainerComponent = /** @class */ (function () {
20877
20950
  ];
20878
20951
  /** @nocollapse */
20879
20952
  MainContainerComponent.ctorParameters = function () { return [
20880
- { type: DrawerService }
20953
+ { type: DrawerService },
20954
+ { type: ElementRef }
20881
20955
  ]; };
20882
20956
  MainContainerComponent.propDecorators = {
20883
20957
  headerRef: [{ type: ContentChild, args: [RSHeaderComponent, { static: true },] }],
20958
+ multiTabRef: [{ type: ContentChild, args: [MultiTabComponent, { static: true },] }],
20884
20959
  drawer: [{ type: ViewChild, args: ["drawer", { static: false },] }],
20885
20960
  isCollapsed: [{ type: Input }],
20886
20961
  singleReuseUrls: [{ type: Input }],
20962
+ onWidthChange: [{ type: Output }],
20887
20963
  onResize: [{ type: HostListener, args: ["window:resize", ["$event"],] }]
20888
20964
  };
20889
20965
  return MainContainerComponent;
@@ -20892,16 +20968,35 @@ if (false) {
20892
20968
  /** @type {?} */
20893
20969
  MainContainerComponent.prototype.headerRef;
20894
20970
  /** @type {?} */
20971
+ MainContainerComponent.prototype.multiTabRef;
20972
+ /** @type {?} */
20895
20973
  MainContainerComponent.prototype.drawer;
20896
20974
  /** @type {?} */
20897
20975
  MainContainerComponent.prototype.isCollapsed;
20898
20976
  /** @type {?} */
20899
20977
  MainContainerComponent.prototype.singleReuseUrls;
20978
+ /** @type {?} */
20979
+ MainContainerComponent.prototype.onWidthChange;
20980
+ /**
20981
+ * @type {?}
20982
+ * @private
20983
+ */
20984
+ MainContainerComponent.prototype.resizeObserver;
20985
+ /**
20986
+ * @type {?}
20987
+ * @private
20988
+ */
20989
+ MainContainerComponent.prototype.debouncedHandleResize;
20900
20990
  /**
20901
20991
  * @type {?}
20902
20992
  * @private
20903
20993
  */
20904
20994
  MainContainerComponent.prototype.globalDrawer;
20995
+ /**
20996
+ * @type {?}
20997
+ * @private
20998
+ */
20999
+ MainContainerComponent.prototype.elementRef;
20905
21000
  }
20906
21001
 
20907
21002
  /**
@@ -21036,7 +21131,7 @@ var RSAsideComponent = /** @class */ (function () {
21036
21131
  RSAsideComponent.decorators = [
21037
21132
  { type: Component, args: [{
21038
21133
  selector: "rs-aside",
21039
- template: "<div class=\"rs-aside\" [ngClass]=\"{ isCollapsed: isCollapsed }\">\r\n <div class=\"nav-list\">\r\n <div class=\"nav-group\" [ngClass]=\"group.class\" *ngFor=\"let group of navList\">\r\n <div\r\n class=\"nav-item\"\r\n [ngClass]=\"{ isCurrent: currentNav === nav.url }\"\r\n *ngFor=\"let nav of group.navItems\"\r\n (click)=\"onNavClick(nav)\"\r\n >\r\n <div class=\"nav-item-inner\" *ngIf=\"nav.menuType === 'MENU'\">\r\n <mat-icon class=\"menu-icon\" [svgIcon]=\"nav.iconCode\"></mat-icon>\r\n <span class=\"nav-text\" [ngClass]=\"{ isCollapsed: isCollapsed }\">{{\r\n nav.label\r\n }}</span>\r\n </div>\r\n <div class=\"dividing-line\" *ngIf=\"nav.menuType === 'LABEL'\"></div>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"bottom-iconbox\" [ngClass]=\"{ isCollapsed: isCollapsed }\">\r\n <ng-content select=\"[bottomIconBox]\"></ng-content>\r\n </div>\r\n</div>\r\n",
21134
+ template: "<div class=\"rs-aside\" [ngClass]=\"{ isCollapsed: isCollapsed }\">\r\n <div class=\"nav-list\">\r\n <div\r\n class=\"nav-group\"\r\n [ngClass]=\"group.class\"\r\n *ngFor=\"let group of navList\"\r\n >\r\n <div\r\n class=\"nav-item\"\r\n [ngClass]=\"{ isCurrent: currentNav === nav.url }\"\r\n *ngFor=\"let nav of group.navItems\"\r\n (click)=\"onNavClick(nav)\"\r\n >\r\n <div class=\"nav-item-inner\" *ngIf=\"nav.menuType === 'MENU'\">\r\n <ejs-tooltip\r\n [showTipPointer]=\"false\"\r\n *ngIf=\"isCollapsed; else originIcon\"\r\n >\r\n <ng-template #content>\r\n <div class=\"tooltip-content\">\r\n {{ nav.label }}\r\n </div>\r\n </ng-template>\r\n <mat-icon class=\"menu-icon\" [svgIcon]=\"nav.iconCode\"></mat-icon>\r\n </ejs-tooltip>\r\n <ng-template #originIcon>\r\n <mat-icon class=\"menu-icon\" [svgIcon]=\"nav.iconCode\"></mat-icon>\r\n </ng-template>\r\n <!-- <mat-icon class=\"menu-icon\" [svgIcon]=\"nav.iconCode\"></mat-icon> -->\r\n\r\n <span class=\"nav-text\" [ngClass]=\"{ isCollapsed: isCollapsed }\">{{\r\n nav.label\r\n }}</span>\r\n </div>\r\n <div class=\"dividing-line\" *ngIf=\"nav.menuType === 'LABEL'\"></div>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"bottom-iconbox\" [ngClass]=\"{ isCollapsed: isCollapsed }\">\r\n <ng-content select=\"[bottomIconBox]\"></ng-content>\r\n </div>\r\n</div>\r\n",
21040
21135
  styles: [".rs-aside{display:flex;flex-direction:column;height:100%;width:240px;will-change:width;transition:width .3s;padding-right:20px}.rs-aside.isCollapsed{width:64px;padding-right:0}.rs-aside.isCollapsed .nav-list .nav-item .nav-item-inner{margin-right:12px}.rs-aside.isCollapsed .nav-list .nav-item .dividing-line{margin:8px 20px 8px 10px}.rs-aside .nav-list{padding-top:12px;flex:1;overflow:auto;height:0}.rs-aside .nav-list .nav-item{cursor:pointer;padding-left:11px}.rs-aside .nav-list .nav-item .nav-item-inner{height:32px;display:flex;align-items:center;padding:8px 8px 8px 12px}.rs-aside .nav-list .nav-item .nav-item-inner ::ng-deep .menu-icon{width:33px;height:16px;display:flex;align-items:center}.rs-aside .nav-list .nav-item .nav-item-inner ::ng-deep .menu-icon svg{width:16px;height:16px}.rs-aside .nav-list .nav-item .dividing-line{margin:8px 0 8px 10px;height:1px;background-color:rgba(219,225,231,.5)}.rs-aside .nav-list .nav-item:hover .nav-item-inner{border-radius:6px;background:rgba(31,123,255,.04)}.rs-aside .nav-list .nav-item .nav-text{color:#5f6f81;font-family:Arial;font-size:12px;font-weight:400;line-height:16px;transition:.3s;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;position:relative;top:1px}@media (min-width:993px){.rs-aside .nav-list .nav-item .nav-text.isCollapsed{opacity:0;width:0}}.rs-aside .nav-list .nav-item.isCurrent{position:relative}.rs-aside .nav-list .nav-item.isCurrent .nav-text{color:#44566c;font-weight:700}.rs-aside .nav-list .nav-item.isCurrent::before{content:\"\";position:absolute;left:4px;top:8px;width:3px;height:16px;background-color:#1364b3;border-radius:2px}.rs-aside .bottom-iconbox{padding:12px 20px;height:48px;display:flex;gap:12px}.rs-aside .bottom-iconbox ::ng-deep .menu-bottom-icon{width:24px;height:24px;display:flex;justify-content:center;align-items:center;border:1px solid #eaedf0;border-radius:24px;cursor:pointer}.rs-aside .bottom-iconbox ::ng-deep .menu-bottom-icon svg{width:16px;height:16px;color:#6c7c90;stroke:#6c7c90}.rs-aside .bottom-iconbox ::ng-deep .menu-bottom-icon.disabled{cursor:default;opacity:.5}.rs-aside .bottom-iconbox ::ng-deep .menu-bottom-icon:not(.disabled):hover{background-color:#fff}.rs-aside .bottom-iconbox ::ng-deep .menu-bottom-icon:not(.disabled):hover svg{color:#1f7bff;stroke:#1f7bff}@media (min-width:993px){.rs-aside .bottom-iconbox.isCollapsed{flex-direction:column;height:auto}}@media (max-width:992px){.rs-aside{width:0;position:absolute;height:calc(100% - 50px);z-index:10;background-color:var(--rs-container-bg);padding-right:0}.rs-aside .bottom-iconbox{display:none}.rs-aside.isCollapsed{width:240px;padding-right:16px}.rs-aside.isCollapsed .bottom-iconbox{display:flex}}"]
21041
21136
  }] }
21042
21137
  ];
@@ -21578,7 +21673,7 @@ function filterShowSection(sections) {
21578
21673
  * @param {?} field
21579
21674
  * @return {?}
21580
21675
  */
21581
- function (field) { return field.show || section.show(); })) })); }));
21676
+ function (field) { return !field.show || field.show(); })) })); }));
21582
21677
  }
21583
21678
  /** @type {?} */
21584
21679
  var EmailPattern = /^(?=.{1,254}$)(?=.{1,64}@)[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+)*@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/;