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.
- package/bundles/raise-common-lib.umd.js +116 -20
- 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/form/drawer-form/constants.js +2 -2
- package/esm2015/lib/layout/main-container/index.component.js +66 -5
- package/esm2015/lib/layout/multi-tab/index.component.js +29 -12
- package/esm2015/lib/layout/rs-aside/index.component.js +2 -2
- package/esm5/lib/form/drawer-form/constants.js +2 -2
- package/esm5/lib/layout/main-container/index.component.js +82 -4
- package/esm5/lib/layout/multi-tab/index.component.js +33 -13
- package/esm5/lib/layout/rs-aside/index.component.js +2 -2
- package/fesm2015/raise-common-lib.js +93 -17
- package/fesm2015/raise-common-lib.js.map +1 -1
- package/fesm5/raise-common-lib.js +113 -18
- package/fesm5/raise-common-lib.js.map +1 -1
- package/lib/form/drawer-form/constants.d.ts +1 -6
- 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,4 +1,4 @@
|
|
|
1
|
-
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 { EventEmitter, Component, ChangeDetectorRef, ViewChild, Input, Output, HostBinding, Injectable, ɵɵdefineInjectable, Inject, ɵɵinject, ContentChild, HostListener, ComponentFactoryResolver, ViewContainerRef, ViewChildren, ElementRef, NgModule, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
|
|
2
2
|
import { GridComponent, GridModule, PagerModule, GridAllModule, PageService, SortService, FilterService, ExcelExportService, EditService, ResizeService, ToolbarService, ColumnChooserService, AggregateService, ColumnMenuService, DetailRowService, SelectionService, GroupService } from '@syncfusion/ej2-angular-grids';
|
|
3
3
|
import { times, debounce } from 'lodash';
|
|
4
4
|
import { __awaiter, __decorate, __metadata } from 'tslib';
|
|
@@ -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';
|
|
@@ -2571,7 +2572,7 @@ class MultiTabComponent {
|
|
|
2571
2572
|
*/
|
|
2572
2573
|
onResize(event) {
|
|
2573
2574
|
this.screenWidth = window.innerWidth; // 更新屏幕宽度
|
|
2574
|
-
this.setEllipsisTitle();
|
|
2575
|
+
// this.setEllipsisTitle(); 在最外面容器调用
|
|
2575
2576
|
}
|
|
2576
2577
|
/**
|
|
2577
2578
|
* @return {?}
|
|
@@ -2584,8 +2585,7 @@ class MultiTabComponent {
|
|
|
2584
2585
|
* @param {?} ele
|
|
2585
2586
|
* @return {?}
|
|
2586
2587
|
*/
|
|
2587
|
-
(ele) => this.urlWithoutQuery(ele.url) ===
|
|
2588
|
-
this.urlWithoutQuery(this.router.url)));
|
|
2588
|
+
(ele) => this.urlWithoutQuery(ele.url) === this.urlWithoutQuery(this.router.url)));
|
|
2589
2589
|
if (isExistIdx !== -1) {
|
|
2590
2590
|
this.selectedTab = isExistIdx;
|
|
2591
2591
|
}
|
|
@@ -2655,6 +2655,8 @@ class MultiTabComponent {
|
|
|
2655
2655
|
* @return {?}
|
|
2656
2656
|
*/
|
|
2657
2657
|
ngOnDestroy() {
|
|
2658
|
+
this.tabList = []; // 清空 tab 列表
|
|
2659
|
+
this.selectedTab = 0; // 重置选中的 tab 索引
|
|
2658
2660
|
this.subscriptions.forEach((/**
|
|
2659
2661
|
* @param {?} sub
|
|
2660
2662
|
* @return {?}
|
|
@@ -2690,6 +2692,8 @@ class MultiTabComponent {
|
|
|
2690
2692
|
: width - this.textGap, 12);
|
|
2691
2693
|
}));
|
|
2692
2694
|
}
|
|
2695
|
+
this.ref.markForCheck();
|
|
2696
|
+
this.ref.detectChanges();
|
|
2693
2697
|
}
|
|
2694
2698
|
/**
|
|
2695
2699
|
* @return {?}
|
|
@@ -2745,10 +2749,10 @@ class MultiTabComponent {
|
|
|
2745
2749
|
}
|
|
2746
2750
|
/**
|
|
2747
2751
|
* @param {?} idx
|
|
2748
|
-
* @param {?=}
|
|
2752
|
+
* @param {?=} noChange
|
|
2749
2753
|
* @return {?}
|
|
2750
2754
|
*/
|
|
2751
|
-
closeTab(idx,
|
|
2755
|
+
closeTab(idx, noChange) {
|
|
2752
2756
|
/** @type {?} */
|
|
2753
2757
|
const tab = this.tabList[idx];
|
|
2754
2758
|
this.tabList = this.tabList.filter((/**
|
|
@@ -2757,7 +2761,7 @@ class MultiTabComponent {
|
|
|
2757
2761
|
*/
|
|
2758
2762
|
(ele) => ele.url !== tab.url));
|
|
2759
2763
|
this.clearCache(this.urlWithoutQuery(tab.url));
|
|
2760
|
-
if (!
|
|
2764
|
+
if (!noChange && this.selectedTab === idx) {
|
|
2761
2765
|
/** @type {?} */
|
|
2762
2766
|
const targetIdx = Math.max(0, idx - 1);
|
|
2763
2767
|
this.changeTab(this.tabList[targetIdx], targetIdx);
|
|
@@ -2779,8 +2783,8 @@ class MultiTabComponent {
|
|
|
2779
2783
|
if (tab.navigationInfo) {
|
|
2780
2784
|
sessionStorage.setItem("navigationInfo", JSON.stringify(tab.navigationInfo));
|
|
2781
2785
|
}
|
|
2782
|
-
if (tab.
|
|
2783
|
-
sessionStorage.setItem("
|
|
2786
|
+
if (tab.fromInfo) {
|
|
2787
|
+
sessionStorage.setItem("fromInfo", JSON.stringify(tab.fromInfo));
|
|
2784
2788
|
}
|
|
2785
2789
|
if (tab.permissions) {
|
|
2786
2790
|
sessionStorage.setItem("permissions", JSON.stringify(tab.permissions));
|
|
@@ -2803,7 +2807,7 @@ class MultiTabComponent {
|
|
|
2803
2807
|
/** @type {?} */
|
|
2804
2808
|
const navigationInfo = JSON.parse(sessionStorage.getItem("navigationInfo"));
|
|
2805
2809
|
/** @type {?} */
|
|
2806
|
-
const
|
|
2810
|
+
const fromInfo = JSON.parse(sessionStorage.getItem("fromInfo"));
|
|
2807
2811
|
/** @type {?} */
|
|
2808
2812
|
const permissions = JSON.parse(localPermissions);
|
|
2809
2813
|
this.tabList.push({
|
|
@@ -2812,7 +2816,7 @@ class MultiTabComponent {
|
|
|
2812
2816
|
displayTitle: title,
|
|
2813
2817
|
navigationInfo: navigationInfo,
|
|
2814
2818
|
permissions: permissions,
|
|
2815
|
-
|
|
2819
|
+
fromInfo: fromInfo,
|
|
2816
2820
|
});
|
|
2817
2821
|
this.selectedTab = this.tabList.length - 1;
|
|
2818
2822
|
this.setEllipsisTitle();
|
|
@@ -2857,7 +2861,12 @@ class MultiTabComponent {
|
|
|
2857
2861
|
if (targetTabUrl !== url || noReused) {
|
|
2858
2862
|
// 当缓存一致时候,但是url不一致,重新按照新的url生成tab
|
|
2859
2863
|
this.closeTab(isExistIdx, true);
|
|
2860
|
-
|
|
2864
|
+
setTimeout((/**
|
|
2865
|
+
* @return {?}
|
|
2866
|
+
*/
|
|
2867
|
+
() => {
|
|
2868
|
+
this.addTab(url, title);
|
|
2869
|
+
}), 30);
|
|
2861
2870
|
}
|
|
2862
2871
|
else {
|
|
2863
2872
|
this.changeTab(this.tabList[isExistIdx], isExistIdx);
|
|
@@ -2900,6 +2909,15 @@ class MultiTabComponent {
|
|
|
2900
2909
|
this.keepAlive.clearCache(url); // 调用自定义策略的清除缓存方法
|
|
2901
2910
|
this.drawer.deleteCache(url);
|
|
2902
2911
|
}
|
|
2912
|
+
/**
|
|
2913
|
+
* @return {?}
|
|
2914
|
+
*/
|
|
2915
|
+
cleanAllCache() {
|
|
2916
|
+
sessionStorage.removeItem("TabCache"); // 清除缓存
|
|
2917
|
+
this.tabList = []; // 清空 tab 列表
|
|
2918
|
+
this.selectedTab = 0; // 重置选中的 tab 索引
|
|
2919
|
+
this.keepAlive.clearAllCache(); // 调用自定义策略的清除缓存方法
|
|
2920
|
+
}
|
|
2903
2921
|
/**
|
|
2904
2922
|
* @private
|
|
2905
2923
|
* @param {?} url
|
|
@@ -20217,15 +20235,28 @@ if (false) {
|
|
|
20217
20235
|
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
20218
20236
|
*/
|
|
20219
20237
|
class MainContainerComponent {
|
|
20220
|
-
//只能单个缓存的url
|
|
20221
20238
|
/**
|
|
20222
20239
|
* @param {?} globalDrawer
|
|
20240
|
+
* @param {?} elementRef
|
|
20223
20241
|
*/
|
|
20224
|
-
constructor(globalDrawer) {
|
|
20242
|
+
constructor(globalDrawer, elementRef) {
|
|
20225
20243
|
this.globalDrawer = globalDrawer;
|
|
20244
|
+
this.elementRef = elementRef;
|
|
20226
20245
|
this.isCollapsed = false; // 接收输入属性
|
|
20227
20246
|
// 接收输入属性
|
|
20228
20247
|
this.singleReuseUrls = []; //只能单个缓存的url
|
|
20248
|
+
//只能单个缓存的url
|
|
20249
|
+
this.onWidthChange = new EventEmitter();
|
|
20250
|
+
this.debouncedHandleResize = debounce((/**
|
|
20251
|
+
* @param {?} width
|
|
20252
|
+
* @return {?}
|
|
20253
|
+
*/
|
|
20254
|
+
(width) => {
|
|
20255
|
+
// console.log("Debounced width change:", width);
|
|
20256
|
+
// 在这里处理防抖后的宽度变化逻辑
|
|
20257
|
+
this.multiTabRef && this.multiTabRef.setEllipsisTitle();
|
|
20258
|
+
this.onWidthChange.emit(width);
|
|
20259
|
+
}), 300);
|
|
20229
20260
|
}
|
|
20230
20261
|
/**
|
|
20231
20262
|
* @return {?}
|
|
@@ -20253,6 +20284,29 @@ class MainContainerComponent {
|
|
|
20253
20284
|
*/
|
|
20254
20285
|
ngAfterViewInit() {
|
|
20255
20286
|
this.globalDrawer.setDrawer(this.drawer); // 设置抽屉组件
|
|
20287
|
+
// 设置抽屉组件
|
|
20288
|
+
/** @type {?} */
|
|
20289
|
+
const rightAside = this.elementRef.nativeElement.querySelector(".right-aside");
|
|
20290
|
+
this.resizeObserver = new ResizeObserver((/**
|
|
20291
|
+
* @param {?} entries
|
|
20292
|
+
* @return {?}
|
|
20293
|
+
*/
|
|
20294
|
+
(entries) => {
|
|
20295
|
+
for (const entry of entries) {
|
|
20296
|
+
/** @type {?} */
|
|
20297
|
+
const width = entry.contentRect.width;
|
|
20298
|
+
this.debouncedHandleResize(width);
|
|
20299
|
+
}
|
|
20300
|
+
}));
|
|
20301
|
+
this.resizeObserver.observe(rightAside);
|
|
20302
|
+
}
|
|
20303
|
+
/**
|
|
20304
|
+
* @return {?}
|
|
20305
|
+
*/
|
|
20306
|
+
ngOnDestroy() {
|
|
20307
|
+
if (this.resizeObserver) {
|
|
20308
|
+
this.resizeObserver.disconnect();
|
|
20309
|
+
}
|
|
20256
20310
|
}
|
|
20257
20311
|
/**
|
|
20258
20312
|
* @return {?}
|
|
@@ -20274,29 +20328,51 @@ MainContainerComponent.decorators = [
|
|
|
20274
20328
|
];
|
|
20275
20329
|
/** @nocollapse */
|
|
20276
20330
|
MainContainerComponent.ctorParameters = () => [
|
|
20277
|
-
{ type: DrawerService }
|
|
20331
|
+
{ type: DrawerService },
|
|
20332
|
+
{ type: ElementRef }
|
|
20278
20333
|
];
|
|
20279
20334
|
MainContainerComponent.propDecorators = {
|
|
20280
20335
|
headerRef: [{ type: ContentChild, args: [RSHeaderComponent, { static: true },] }],
|
|
20336
|
+
multiTabRef: [{ type: ContentChild, args: [MultiTabComponent, { static: true },] }],
|
|
20281
20337
|
drawer: [{ type: ViewChild, args: ["drawer", { static: false },] }],
|
|
20282
20338
|
isCollapsed: [{ type: Input }],
|
|
20283
20339
|
singleReuseUrls: [{ type: Input }],
|
|
20340
|
+
onWidthChange: [{ type: Output }],
|
|
20284
20341
|
onResize: [{ type: HostListener, args: ["window:resize", ["$event"],] }]
|
|
20285
20342
|
};
|
|
20286
20343
|
if (false) {
|
|
20287
20344
|
/** @type {?} */
|
|
20288
20345
|
MainContainerComponent.prototype.headerRef;
|
|
20289
20346
|
/** @type {?} */
|
|
20347
|
+
MainContainerComponent.prototype.multiTabRef;
|
|
20348
|
+
/** @type {?} */
|
|
20290
20349
|
MainContainerComponent.prototype.drawer;
|
|
20291
20350
|
/** @type {?} */
|
|
20292
20351
|
MainContainerComponent.prototype.isCollapsed;
|
|
20293
20352
|
/** @type {?} */
|
|
20294
20353
|
MainContainerComponent.prototype.singleReuseUrls;
|
|
20354
|
+
/** @type {?} */
|
|
20355
|
+
MainContainerComponent.prototype.onWidthChange;
|
|
20356
|
+
/**
|
|
20357
|
+
* @type {?}
|
|
20358
|
+
* @private
|
|
20359
|
+
*/
|
|
20360
|
+
MainContainerComponent.prototype.resizeObserver;
|
|
20361
|
+
/**
|
|
20362
|
+
* @type {?}
|
|
20363
|
+
* @private
|
|
20364
|
+
*/
|
|
20365
|
+
MainContainerComponent.prototype.debouncedHandleResize;
|
|
20295
20366
|
/**
|
|
20296
20367
|
* @type {?}
|
|
20297
20368
|
* @private
|
|
20298
20369
|
*/
|
|
20299
20370
|
MainContainerComponent.prototype.globalDrawer;
|
|
20371
|
+
/**
|
|
20372
|
+
* @type {?}
|
|
20373
|
+
* @private
|
|
20374
|
+
*/
|
|
20375
|
+
MainContainerComponent.prototype.elementRef;
|
|
20300
20376
|
}
|
|
20301
20377
|
|
|
20302
20378
|
/**
|
|
@@ -20415,7 +20491,7 @@ class RSAsideComponent {
|
|
|
20415
20491
|
RSAsideComponent.decorators = [
|
|
20416
20492
|
{ type: Component, args: [{
|
|
20417
20493
|
selector: "rs-aside",
|
|
20418
|
-
template: "<div class=\"rs-aside\" [ngClass]=\"{ isCollapsed: isCollapsed }\">\r\n <div class=\"nav-list\">\r\n <div
|
|
20494
|
+
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",
|
|
20419
20495
|
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}}"]
|
|
20420
20496
|
}] }
|
|
20421
20497
|
];
|
|
@@ -20887,7 +20963,7 @@ function filterShowSection(sections) {
|
|
|
20887
20963
|
* @param {?} field
|
|
20888
20964
|
* @return {?}
|
|
20889
20965
|
*/
|
|
20890
|
-
(field) => field.show ||
|
|
20966
|
+
(field) => !field.show || field.show())) }))));
|
|
20891
20967
|
}
|
|
20892
20968
|
/** @type {?} */
|
|
20893
20969
|
const 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])?)*$/;
|