raise-common-lib 0.0.175 → 0.0.177
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 +50 -40
- package/bundles/raise-common-lib.umd.js.map +1 -1
- package/bundles/raise-common-lib.umd.min.js +1 -1
- package/bundles/raise-common-lib.umd.min.js.map +1 -1
- package/esm2015/lib/layout/drawer/index.component.js +9 -9
- package/esm2015/lib/layout/multi-tab/index.component.js +42 -33
- package/esm5/lib/layout/drawer/index.component.js +9 -9
- package/esm5/lib/layout/multi-tab/index.component.js +44 -34
- package/fesm2015/raise-common-lib.js +49 -40
- package/fesm2015/raise-common-lib.js.map +1 -1
- package/fesm5/raise-common-lib.js +51 -41
- package/fesm5/raise-common-lib.js.map +1 -1
- package/lib/layout/drawer/index.component.d.ts +2 -2
- package/lib/layout/multi-tab/index.component.d.ts +1 -1
- package/package.json +1 -1
- package/raise-common-lib.metadata.json +1 -1
|
@@ -7,7 +7,7 @@ import { MAT_SNACK_BAR_DATA, MatSnackBar, MatSnackBarModule } from '@angular/mat
|
|
|
7
7
|
import { MAT_DIALOG_DATA, MatDialogRef, MatDialog, MatDialogModule } from '@angular/material/dialog';
|
|
8
8
|
import { TreeGridComponent } from '@syncfusion/ej2-angular-treegrid';
|
|
9
9
|
import { CarouselAllModule, ToolbarModule, TabModule, TreeViewModule } from '@syncfusion/ej2-angular-navigations';
|
|
10
|
-
import { NavigationEnd, Router, ActivatedRoute, RouteReuseStrategy } from '@angular/router';
|
|
10
|
+
import { NavigationEnd, Router, NavigationStart, ActivatedRoute, RouteReuseStrategy } from '@angular/router';
|
|
11
11
|
import { filter } from 'rxjs/operators';
|
|
12
12
|
import { moveItemInArray, DragDropModule } from '@angular/cdk/drag-drop';
|
|
13
13
|
import { HttpClient, HttpClientModule } from '@angular/common/http';
|
|
@@ -3190,6 +3190,42 @@ var MultiTabComponent = /** @class */ (function () {
|
|
|
3190
3190
|
if (isExistIdx !== -1) {
|
|
3191
3191
|
this.selectedTab = isExistIdx;
|
|
3192
3192
|
}
|
|
3193
|
+
this.subscriptions.push(this.router.events
|
|
3194
|
+
.pipe(filter((/**
|
|
3195
|
+
* @param {?} event
|
|
3196
|
+
* @return {?}
|
|
3197
|
+
*/
|
|
3198
|
+
function (event) { return event instanceof NavigationStart; })))
|
|
3199
|
+
.subscribe((/**
|
|
3200
|
+
* @param {?} event
|
|
3201
|
+
* @return {?}
|
|
3202
|
+
*/
|
|
3203
|
+
function (event) {
|
|
3204
|
+
/** @type {?} */
|
|
3205
|
+
var navigation = _this.router.getCurrentNavigation();
|
|
3206
|
+
if (navigation) {
|
|
3207
|
+
/** @type {?} */
|
|
3208
|
+
var state = navigation.extras.state;
|
|
3209
|
+
// 获取传递的 state
|
|
3210
|
+
/** @type {?} */
|
|
3211
|
+
var noReused = (state && state["noReused"]) || false;
|
|
3212
|
+
// 当前tab不复用,新开一个tab,当有已经存在的tab时候也是新开
|
|
3213
|
+
/** @type {?} */
|
|
3214
|
+
var isExistIdx_1 = _this.tabList.findIndex((/**
|
|
3215
|
+
* @param {?} ele
|
|
3216
|
+
* @return {?}
|
|
3217
|
+
*/
|
|
3218
|
+
function (ele) {
|
|
3219
|
+
return _this.urlWithoutQuery(ele.url) ===
|
|
3220
|
+
_this.urlWithoutQuery(event.url);
|
|
3221
|
+
}));
|
|
3222
|
+
if (isExistIdx_1 !== -1 &&
|
|
3223
|
+
(noReused || _this.tabList[isExistIdx_1].url !== event.url)) {
|
|
3224
|
+
// 如果当前tab已经存在,并且是新开的tab
|
|
3225
|
+
_this.closeTab(isExistIdx_1, true); // 关闭当前tab
|
|
3226
|
+
}
|
|
3227
|
+
}
|
|
3228
|
+
})));
|
|
3193
3229
|
this.subscriptions.push(this.router.events
|
|
3194
3230
|
.pipe(filter((/**
|
|
3195
3231
|
* @param {?} event
|
|
@@ -3197,9 +3233,10 @@ var MultiTabComponent = /** @class */ (function () {
|
|
|
3197
3233
|
*/
|
|
3198
3234
|
function (event) { return event instanceof NavigationEnd; })))
|
|
3199
3235
|
.subscribe((/**
|
|
3236
|
+
* @param {?} event
|
|
3200
3237
|
* @return {?}
|
|
3201
3238
|
*/
|
|
3202
|
-
function () {
|
|
3239
|
+
function (event) {
|
|
3203
3240
|
/** @type {?} */
|
|
3204
3241
|
var navigation = _this.router.getCurrentNavigation();
|
|
3205
3242
|
if (navigation) {
|
|
@@ -3230,13 +3267,11 @@ var MultiTabComponent = /** @class */ (function () {
|
|
|
3230
3267
|
navigationInfo.title ||
|
|
3231
3268
|
navigationInfo.subTitle ||
|
|
3232
3269
|
navigationInfo.name;
|
|
3233
|
-
/** @type {?} */
|
|
3234
|
-
var noReused = (state && state["noReused"]) || false;
|
|
3235
3270
|
if (currentRoute && !skipLocationChange) {
|
|
3236
3271
|
if (_this.noGenerateTabUrls.includes(_this.urlWithoutQuery(_this.router.url))) {
|
|
3237
3272
|
return; // 排除不生成tab的url
|
|
3238
3273
|
}
|
|
3239
|
-
_this.setTab(_this.router.url, currentRoute.snapshot.routeConfig.path, title
|
|
3274
|
+
_this.setTab(_this.router.url, currentRoute.snapshot.routeConfig.path, title);
|
|
3240
3275
|
}
|
|
3241
3276
|
}
|
|
3242
3277
|
})));
|
|
@@ -3478,17 +3513,15 @@ var MultiTabComponent = /** @class */ (function () {
|
|
|
3478
3513
|
* @param {?} url
|
|
3479
3514
|
* @param {?} pureUrl
|
|
3480
3515
|
* @param {?} title
|
|
3481
|
-
* @param {?} noReused
|
|
3482
3516
|
* @return {?}
|
|
3483
3517
|
*/
|
|
3484
3518
|
MultiTabComponent.prototype.setTab = /**
|
|
3485
3519
|
* @param {?} url
|
|
3486
3520
|
* @param {?} pureUrl
|
|
3487
3521
|
* @param {?} title
|
|
3488
|
-
* @param {?} noReused
|
|
3489
3522
|
* @return {?}
|
|
3490
3523
|
*/
|
|
3491
|
-
function (url, pureUrl, title
|
|
3524
|
+
function (url, pureUrl, title) {
|
|
3492
3525
|
var _this = this;
|
|
3493
3526
|
/** @type {?} */
|
|
3494
3527
|
var isExistIdx = this.tabList.findIndex((/**
|
|
@@ -3515,30 +3548,7 @@ var MultiTabComponent = /** @class */ (function () {
|
|
|
3515
3548
|
this.addTab(url, title);
|
|
3516
3549
|
}
|
|
3517
3550
|
else {
|
|
3518
|
-
|
|
3519
|
-
var targetTabUrl = this.tabList[isExistIdx].url;
|
|
3520
|
-
if (targetTabUrl !== url || noReused) {
|
|
3521
|
-
// 当缓存一致时候,但是url不一致,重新按照新的url生成tab
|
|
3522
|
-
this.closeTab(isExistIdx, true);
|
|
3523
|
-
setTimeout((/**
|
|
3524
|
-
* @return {?}
|
|
3525
|
-
*/
|
|
3526
|
-
function () {
|
|
3527
|
-
_this.keepAlive.clearCache(url);
|
|
3528
|
-
_this.drawer.deleteCache(url);
|
|
3529
|
-
_this.router
|
|
3530
|
-
.navigateByUrl("/", { skipLocationChange: true })
|
|
3531
|
-
.then((/**
|
|
3532
|
-
* @return {?}
|
|
3533
|
-
*/
|
|
3534
|
-
function () {
|
|
3535
|
-
_this.router.navigateByUrl(url); // 重新导航到当前 URL
|
|
3536
|
-
}));
|
|
3537
|
-
}), 30);
|
|
3538
|
-
}
|
|
3539
|
-
else {
|
|
3540
|
-
this.changeTab(this.tabList[isExistIdx], isExistIdx);
|
|
3541
|
-
}
|
|
3551
|
+
this.changeTab(this.tabList[isExistIdx], isExistIdx);
|
|
3542
3552
|
this.ref.markForCheck();
|
|
3543
3553
|
}
|
|
3544
3554
|
};
|
|
@@ -3552,7 +3562,7 @@ var MultiTabComponent = /** @class */ (function () {
|
|
|
3552
3562
|
*/
|
|
3553
3563
|
function (event) {
|
|
3554
3564
|
var previousIndex = event.previousIndex, currentIndex = event.currentIndex;
|
|
3555
|
-
console.log("previousIndex", previousIndex, "currentIndex", currentIndex);
|
|
3565
|
+
// console.log("previousIndex", previousIndex, "currentIndex", currentIndex);
|
|
3556
3566
|
if (previousIndex === 0 || currentIndex === 0) {
|
|
3557
3567
|
return;
|
|
3558
3568
|
}
|
|
@@ -3731,7 +3741,7 @@ var DrawerComponent = /** @class */ (function () {
|
|
|
3731
3741
|
this.resolver = resolver;
|
|
3732
3742
|
this.service = service;
|
|
3733
3743
|
this.config = DefaultDrawerConfig;
|
|
3734
|
-
this.
|
|
3744
|
+
this.useAnimation = "yes";
|
|
3735
3745
|
this.isOpened = false;
|
|
3736
3746
|
this.hiddenDrawer = true;
|
|
3737
3747
|
this.componentRefMap = new Map();
|
|
@@ -3954,7 +3964,7 @@ var DrawerComponent = /** @class */ (function () {
|
|
|
3954
3964
|
else {
|
|
3955
3965
|
this.toggleOpenStatus(false);
|
|
3956
3966
|
}
|
|
3957
|
-
this.
|
|
3967
|
+
this.useAnimation = "no";
|
|
3958
3968
|
};
|
|
3959
3969
|
/**
|
|
3960
3970
|
* @param {?} isOpen
|
|
@@ -3969,25 +3979,25 @@ var DrawerComponent = /** @class */ (function () {
|
|
|
3969
3979
|
function (isOpen, useTransition) {
|
|
3970
3980
|
if (useTransition === void 0) { useTransition = false; }
|
|
3971
3981
|
this.isOpened = isOpen;
|
|
3972
|
-
this.
|
|
3982
|
+
this.useAnimation = useTransition ? "yes" : "no";
|
|
3973
3983
|
this.hiddenDrawer = !isOpen && !useTransition;
|
|
3974
3984
|
};
|
|
3975
3985
|
/**
|
|
3976
3986
|
* @return {?}
|
|
3977
3987
|
*/
|
|
3978
|
-
DrawerComponent.prototype.
|
|
3988
|
+
DrawerComponent.prototype.onAnimationEnd = /**
|
|
3979
3989
|
* @return {?}
|
|
3980
3990
|
*/
|
|
3981
3991
|
function () {
|
|
3982
|
-
if (this.isOpened) {
|
|
3992
|
+
if (!this.isOpened) {
|
|
3983
3993
|
this.hiddenDrawer = true;
|
|
3984
3994
|
}
|
|
3985
3995
|
};
|
|
3986
3996
|
DrawerComponent.decorators = [
|
|
3987
3997
|
{ type: Component, args: [{
|
|
3988
3998
|
selector: "rs-drawer",
|
|
3989
|
-
template: "<div #element id=\"rs-drawer-container\" class=\"rs-drawer-container\">\r\n <div class=\"rs-drawer-content\">\r\n <ng-content></ng-content>\r\n </div>\r\n <div\r\n #drawer\r\n class=\"rs-drawer\"\r\n [attr.data-mode]=\"config.mode\"\r\n [attr.data-opened]=\"isOpened ? 'yes' : 'no'\"\r\n [attr.data-
|
|
3990
|
-
styles: [":host{display:block;height:100%}#rs-drawer-container{height:100%}.rs-drawer-container{height:100%;background-color:transparent;overflow:hidden;position:relative}.rs-drawer-container .rs-drawer-content{width:100%;height:100%;overflow:auto;margin-right:0!important}.rs-drawer-container .rs-drawer-content::-webkit-scrollbar{width:5px;height:5px;background:#fff;position:static;z-index:999;border-radius:10px}.rs-drawer-container .rs-drawer-content::-webkit-scrollbar-thumb{background:#eaedf0}.rs-drawer-container .rs-drawer{width:100%;height:100%;border-left:none;background-color:transparent;overflow:visible;pointer-events:none;opacity:0;display:flex;flex-flow:column nowrap;position:absolute;z-index:2;top:0;left:100%}.rs-drawer-container .rs-drawer[data-opened=yes]{left:0;opacity:1}.rs-drawer-container .rs-drawer[data-
|
|
3999
|
+
template: "<div #element id=\"rs-drawer-container\" class=\"rs-drawer-container\">\r\n <div class=\"rs-drawer-content\">\r\n <ng-content></ng-content>\r\n </div>\r\n <div\r\n #drawer\r\n class=\"rs-drawer\"\r\n [attr.data-mode]=\"config.mode\"\r\n [attr.data-opened]=\"isOpened ? 'yes' : 'no'\"\r\n [attr.data-animation]=\"useAnimation\"\r\n [hidden]=\"hiddenDrawer\"\r\n (animationend)=\"onAnimationEnd()\"\r\n >\r\n <div class=\"drawer-header\" #header>\r\n <button class=\"drawer-return-button\" (click)=\"hide()\">\r\n <span class=\"drawer-sub-title\" *ngIf=\"config.subTitle\">\r\n {{ config.subTitle }}\r\n </span>\r\n </button>\r\n <div class=\"drawer-title\">{{ config.title }}</div>\r\n <div class=\"drawer-header-slot\" #headerSlot></div>\r\n </div>\r\n <div class=\"drawer-top-slot\" #topSlot></div>\r\n <div class=\"drawer-content-box\">\r\n <div class=\"drawer-content\" #content>\r\n <div class=\"drawer-content-container\">\r\n <ng-template #dynamicComponentContainer></ng-template>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"drawer-toolbar-slot\" #toolbarSlot></div>\r\n </div>\r\n</div>\r\n",
|
|
4000
|
+
styles: [":host{display:block;height:100%}#rs-drawer-container{height:100%}.rs-drawer-container{height:100%;background-color:transparent;overflow:hidden;position:relative}.rs-drawer-container .rs-drawer-content{width:100%;height:100%;overflow:auto;margin-right:0!important}.rs-drawer-container .rs-drawer-content::-webkit-scrollbar{width:5px;height:5px;background:#fff;position:static;z-index:999;border-radius:10px}.rs-drawer-container .rs-drawer-content::-webkit-scrollbar-thumb{background:#eaedf0}.rs-drawer-container .rs-drawer{width:100%;height:100%;border-left:none;background-color:transparent;overflow:visible;pointer-events:none;opacity:0;display:flex;flex-flow:column nowrap;position:absolute;z-index:2;top:0;left:100%}.rs-drawer-container .rs-drawer[data-opened=yes]{left:0;opacity:1}.rs-drawer-container .rs-drawer[data-animation=yes][data-opened=yes]{-webkit-animation:.5s ease-in-out drawer-open;animation:.5s ease-in-out drawer-open}@-webkit-keyframes drawer-open{from{left:100%;opacity:0}to{left:0;opacity:1}}@keyframes drawer-open{from{left:100%;opacity:0}to{left:0;opacity:1}}.rs-drawer-container .rs-drawer[data-animation=yes][data-opened=no]{-webkit-animation:.5s ease-in-out drawer-close;animation:.5s ease-in-out drawer-close}@-webkit-keyframes drawer-close{from{left:0;opacity:1}to{left:100%;opacity:0}}@keyframes drawer-close{from{left:0;opacity:1}to{left:100%;opacity:0}}.rs-drawer-container .rs-drawer[hidden]{display:none}.rs-drawer-container .rs-drawer .drawer-header{flex:none;display:flex;flex-flow:row nowrap;justify-content:flex-start;align-items:center;box-sizing:content-box;pointer-events:auto}.rs-drawer-container .rs-drawer .drawer-header .drawer-return-button{flex:none;display:flex;flex-flow:row nowrap;align-items:center;padding:0;border:none;background-color:transparent;cursor:pointer}.rs-drawer-container .rs-drawer .drawer-header .drawer-return-button::before{content:url(../../assets/img/drawer-back.svg);width:24px;height:24px;margin-right:8px;transition:transform 125ms ease-in-out}.rs-drawer-container .rs-drawer .drawer-header .drawer-return-button:hover::before{transform:translateX(-2px)}.rs-drawer-container .rs-drawer .drawer-header .drawer-return-button .drawer-sub-title{margin-right:12px;font-family:Arial;font-style:normal;font-weight:400}.rs-drawer-container .rs-drawer .drawer-header .drawer-title{flex:none;min-height:14px;padding:0 12px;border-left:1px solid #bdc4ca;font-family:Arial;font-style:normal;font-weight:400}.rs-drawer-container .rs-drawer .drawer-header .drawer-title:empty{padding:0}.rs-drawer-container .rs-drawer .drawer-content-box{flex:auto;height:0;background-color:#f7fafb;pointer-events:auto}.rs-drawer-container .rs-drawer .drawer-content{height:100%;padding:0 20px;border:1px solid #ebedf0;border-radius:15px;background-color:#fff;display:flex;flex-flow:column nowrap}.rs-drawer-container .rs-drawer .drawer-content .drawer-content-container{flex:auto;overflow:hidden auto}.rs-drawer-container .rs-drawer .drawer-toolbar-slot{flex:none;height:32px;margin-left:auto;display:flex;flex-flow:row nowrap;justify-content:flex-end;align-items:center;pointer-events:auto}.rs-drawer-container .rs-drawer .drawer-toolbar-slot:empty{display:none}.rs-drawer-container .rs-drawer .drawer-top-slot{flex:none;pointer-events:auto}.rs-drawer-container .rs-drawer .drawer-top-slot:empty{height:var(--drawer-top,0);pointer-events:none}.rs-drawer-container .rs-drawer[data-mode=outer] .drawer-header{height:46px;padding:0 12px 0 8px;background-color:#f7fafb}.rs-drawer-container .rs-drawer[data-mode=outer] .drawer-header .drawer-sub-title,.rs-drawer-container .rs-drawer[data-mode=outer] .drawer-header .drawer-title{color:#1f3f5c;font-size:15px;font-weight:700;line-height:18px}.rs-drawer-container .rs-drawer[data-mode=outer] .drawer-content{padding-bottom:20px}.rs-drawer-container .rs-drawer[data-mode=outer] .drawer-content .drawer-content-container{margin-right:-20px;padding-right:20px}.rs-drawer-container .rs-drawer[data-mode=inner] .drawer-top-slot:empty+.drawer-content-box{padding-top:calc((var(--drawer-top,0) + 1) * 16px)}.rs-drawer-container .rs-drawer[data-mode=inner] .drawer-header{height:24px;padding:6px 0;border-bottom:1px solid #eaedf0}.rs-drawer-container .rs-drawer[data-mode=inner] .drawer-header .drawer-sub-title,.rs-drawer-container .rs-drawer[data-mode=inner] .drawer-header .drawer-title{color:#44566c;font-size:12px;line-height:14px}.rs-drawer-container .rs-drawer[data-mode=inner] .drawer-header .drawer-title{font-weight:700}.rs-drawer-container .rs-drawer[data-mode=inner] .drawer-content .drawer-content-container{margin-right:-20px;padding-right:20px;padding-left:8px}.rs-drawer-container .rs-drawer[data-mode=inner] .drawer-toolbar-slot{width:100%;padding:16px 0;box-sizing:content-box;border-top:1px solid #eaedf0}::ng-deep .rs-drawer-container .rs-drawer .drawer-toolbar-slot [drawer-toolbar]{display:flex;flex-flow:row nowrap;justify-content:flex-end;align-items:center;gap:12px}::ng-deep .rs-drawer-container .rs-drawer .drawer-toolbar-slot [drawer-toolbar] button{display:flex;flex-flow:row nowrap;justify-content:center;align-items:center;gap:6px;min-width:80px;height:32px;padding:0 12px;border:1px solid #adb5bd;border-radius:4px;background-color:#fff;cursor:pointer;color:#44566c;font-size:13px;font-family:Arial;font-style:normal;font-weight:400;line-height:16px}::ng-deep .rs-drawer-container .rs-drawer .drawer-toolbar-slot [drawer-toolbar] button:hover{border-color:#6c7c90}::ng-deep .rs-drawer-container .rs-drawer .drawer-toolbar-slot [drawer-toolbar] button:disabled{opacity:1!important;border-color:#6c7c9066;color:#44566c66;cursor:unset}::ng-deep .rs-drawer-container .rs-drawer .drawer-toolbar-slot [drawer-toolbar] button.primary{border:none;background-color:#1364b3;color:#fff}::ng-deep .rs-drawer-container .rs-drawer .drawer-toolbar-slot [drawer-toolbar] button.primary:hover{background-color:#176bca}::ng-deep .rs-drawer-container .rs-drawer .drawer-toolbar-slot [drawer-toolbar] button.primary:disabled{background-color:#1364b366}::ng-deep .rs-drawer-container .rs-drawer .drawer-toolbar-slot [drawer-toolbar] button img{width:16px;height:16px}::ng-deep .rs-drawer-container .rs-drawer[data-mode=outer] .drawer-toolbar-slot [drawer-toolbar] button{height:26px;font-size:12px;line-height:14px}::ng-deep .rs-drawer-container .rs-drawer[data-mode=inner] .drawer-toolbar-slot [drawer-toolbar] button img{display:none}"]
|
|
3991
4001
|
}] }
|
|
3992
4002
|
];
|
|
3993
4003
|
/** @nocollapse */
|
|
@@ -4033,7 +4043,7 @@ if (false) {
|
|
|
4033
4043
|
/** @type {?} */
|
|
4034
4044
|
DrawerComponent.prototype.config;
|
|
4035
4045
|
/** @type {?} */
|
|
4036
|
-
DrawerComponent.prototype.
|
|
4046
|
+
DrawerComponent.prototype.useAnimation;
|
|
4037
4047
|
/** @type {?} */
|
|
4038
4048
|
DrawerComponent.prototype.isOpened;
|
|
4039
4049
|
/** @type {?} */
|