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
|
@@ -3382,6 +3382,42 @@
|
|
|
3382
3382
|
if (isExistIdx !== -1) {
|
|
3383
3383
|
this.selectedTab = isExistIdx;
|
|
3384
3384
|
}
|
|
3385
|
+
this.subscriptions.push(this.router.events
|
|
3386
|
+
.pipe(operators.filter((/**
|
|
3387
|
+
* @param {?} event
|
|
3388
|
+
* @return {?}
|
|
3389
|
+
*/
|
|
3390
|
+
function (event) { return event instanceof router.NavigationStart; })))
|
|
3391
|
+
.subscribe((/**
|
|
3392
|
+
* @param {?} event
|
|
3393
|
+
* @return {?}
|
|
3394
|
+
*/
|
|
3395
|
+
function (event) {
|
|
3396
|
+
/** @type {?} */
|
|
3397
|
+
var navigation = _this.router.getCurrentNavigation();
|
|
3398
|
+
if (navigation) {
|
|
3399
|
+
/** @type {?} */
|
|
3400
|
+
var state = navigation.extras.state;
|
|
3401
|
+
// 获取传递的 state
|
|
3402
|
+
/** @type {?} */
|
|
3403
|
+
var noReused = (state && state["noReused"]) || false;
|
|
3404
|
+
// 当前tab不复用,新开一个tab,当有已经存在的tab时候也是新开
|
|
3405
|
+
/** @type {?} */
|
|
3406
|
+
var isExistIdx_1 = _this.tabList.findIndex((/**
|
|
3407
|
+
* @param {?} ele
|
|
3408
|
+
* @return {?}
|
|
3409
|
+
*/
|
|
3410
|
+
function (ele) {
|
|
3411
|
+
return _this.urlWithoutQuery(ele.url) ===
|
|
3412
|
+
_this.urlWithoutQuery(event.url);
|
|
3413
|
+
}));
|
|
3414
|
+
if (isExistIdx_1 !== -1 &&
|
|
3415
|
+
(noReused || _this.tabList[isExistIdx_1].url !== event.url)) {
|
|
3416
|
+
// 如果当前tab已经存在,并且是新开的tab
|
|
3417
|
+
_this.closeTab(isExistIdx_1, true); // 关闭当前tab
|
|
3418
|
+
}
|
|
3419
|
+
}
|
|
3420
|
+
})));
|
|
3385
3421
|
this.subscriptions.push(this.router.events
|
|
3386
3422
|
.pipe(operators.filter((/**
|
|
3387
3423
|
* @param {?} event
|
|
@@ -3389,9 +3425,10 @@
|
|
|
3389
3425
|
*/
|
|
3390
3426
|
function (event) { return event instanceof router.NavigationEnd; })))
|
|
3391
3427
|
.subscribe((/**
|
|
3428
|
+
* @param {?} event
|
|
3392
3429
|
* @return {?}
|
|
3393
3430
|
*/
|
|
3394
|
-
function () {
|
|
3431
|
+
function (event) {
|
|
3395
3432
|
/** @type {?} */
|
|
3396
3433
|
var navigation = _this.router.getCurrentNavigation();
|
|
3397
3434
|
if (navigation) {
|
|
@@ -3422,13 +3459,11 @@
|
|
|
3422
3459
|
navigationInfo.title ||
|
|
3423
3460
|
navigationInfo.subTitle ||
|
|
3424
3461
|
navigationInfo.name;
|
|
3425
|
-
/** @type {?} */
|
|
3426
|
-
var noReused = (state && state["noReused"]) || false;
|
|
3427
3462
|
if (currentRoute && !skipLocationChange) {
|
|
3428
3463
|
if (_this.noGenerateTabUrls.includes(_this.urlWithoutQuery(_this.router.url))) {
|
|
3429
3464
|
return; // 排除不生成tab的url
|
|
3430
3465
|
}
|
|
3431
|
-
_this.setTab(_this.router.url, currentRoute.snapshot.routeConfig.path, title
|
|
3466
|
+
_this.setTab(_this.router.url, currentRoute.snapshot.routeConfig.path, title);
|
|
3432
3467
|
}
|
|
3433
3468
|
}
|
|
3434
3469
|
})));
|
|
@@ -3670,17 +3705,15 @@
|
|
|
3670
3705
|
* @param {?} url
|
|
3671
3706
|
* @param {?} pureUrl
|
|
3672
3707
|
* @param {?} title
|
|
3673
|
-
* @param {?} noReused
|
|
3674
3708
|
* @return {?}
|
|
3675
3709
|
*/
|
|
3676
3710
|
MultiTabComponent.prototype.setTab = /**
|
|
3677
3711
|
* @param {?} url
|
|
3678
3712
|
* @param {?} pureUrl
|
|
3679
3713
|
* @param {?} title
|
|
3680
|
-
* @param {?} noReused
|
|
3681
3714
|
* @return {?}
|
|
3682
3715
|
*/
|
|
3683
|
-
function (url, pureUrl, title
|
|
3716
|
+
function (url, pureUrl, title) {
|
|
3684
3717
|
var _this = this;
|
|
3685
3718
|
/** @type {?} */
|
|
3686
3719
|
var isExistIdx = this.tabList.findIndex((/**
|
|
@@ -3707,30 +3740,7 @@
|
|
|
3707
3740
|
this.addTab(url, title);
|
|
3708
3741
|
}
|
|
3709
3742
|
else {
|
|
3710
|
-
|
|
3711
|
-
var targetTabUrl = this.tabList[isExistIdx].url;
|
|
3712
|
-
if (targetTabUrl !== url || noReused) {
|
|
3713
|
-
// 当缓存一致时候,但是url不一致,重新按照新的url生成tab
|
|
3714
|
-
this.closeTab(isExistIdx, true);
|
|
3715
|
-
setTimeout((/**
|
|
3716
|
-
* @return {?}
|
|
3717
|
-
*/
|
|
3718
|
-
function () {
|
|
3719
|
-
_this.keepAlive.clearCache(url);
|
|
3720
|
-
_this.drawer.deleteCache(url);
|
|
3721
|
-
_this.router
|
|
3722
|
-
.navigateByUrl("/", { skipLocationChange: true })
|
|
3723
|
-
.then((/**
|
|
3724
|
-
* @return {?}
|
|
3725
|
-
*/
|
|
3726
|
-
function () {
|
|
3727
|
-
_this.router.navigateByUrl(url); // 重新导航到当前 URL
|
|
3728
|
-
}));
|
|
3729
|
-
}), 30);
|
|
3730
|
-
}
|
|
3731
|
-
else {
|
|
3732
|
-
this.changeTab(this.tabList[isExistIdx], isExistIdx);
|
|
3733
|
-
}
|
|
3743
|
+
this.changeTab(this.tabList[isExistIdx], isExistIdx);
|
|
3734
3744
|
this.ref.markForCheck();
|
|
3735
3745
|
}
|
|
3736
3746
|
};
|
|
@@ -3744,7 +3754,7 @@
|
|
|
3744
3754
|
*/
|
|
3745
3755
|
function (event) {
|
|
3746
3756
|
var previousIndex = event.previousIndex, currentIndex = event.currentIndex;
|
|
3747
|
-
console.log("previousIndex", previousIndex, "currentIndex", currentIndex);
|
|
3757
|
+
// console.log("previousIndex", previousIndex, "currentIndex", currentIndex);
|
|
3748
3758
|
if (previousIndex === 0 || currentIndex === 0) {
|
|
3749
3759
|
return;
|
|
3750
3760
|
}
|
|
@@ -3923,7 +3933,7 @@
|
|
|
3923
3933
|
this.resolver = resolver;
|
|
3924
3934
|
this.service = service;
|
|
3925
3935
|
this.config = DefaultDrawerConfig;
|
|
3926
|
-
this.
|
|
3936
|
+
this.useAnimation = "yes";
|
|
3927
3937
|
this.isOpened = false;
|
|
3928
3938
|
this.hiddenDrawer = true;
|
|
3929
3939
|
this.componentRefMap = new Map();
|
|
@@ -4146,7 +4156,7 @@
|
|
|
4146
4156
|
else {
|
|
4147
4157
|
this.toggleOpenStatus(false);
|
|
4148
4158
|
}
|
|
4149
|
-
this.
|
|
4159
|
+
this.useAnimation = "no";
|
|
4150
4160
|
};
|
|
4151
4161
|
/**
|
|
4152
4162
|
* @param {?} isOpen
|
|
@@ -4161,25 +4171,25 @@
|
|
|
4161
4171
|
function (isOpen, useTransition) {
|
|
4162
4172
|
if (useTransition === void 0) { useTransition = false; }
|
|
4163
4173
|
this.isOpened = isOpen;
|
|
4164
|
-
this.
|
|
4174
|
+
this.useAnimation = useTransition ? "yes" : "no";
|
|
4165
4175
|
this.hiddenDrawer = !isOpen && !useTransition;
|
|
4166
4176
|
};
|
|
4167
4177
|
/**
|
|
4168
4178
|
* @return {?}
|
|
4169
4179
|
*/
|
|
4170
|
-
DrawerComponent.prototype.
|
|
4180
|
+
DrawerComponent.prototype.onAnimationEnd = /**
|
|
4171
4181
|
* @return {?}
|
|
4172
4182
|
*/
|
|
4173
4183
|
function () {
|
|
4174
|
-
if (this.isOpened) {
|
|
4184
|
+
if (!this.isOpened) {
|
|
4175
4185
|
this.hiddenDrawer = true;
|
|
4176
4186
|
}
|
|
4177
4187
|
};
|
|
4178
4188
|
DrawerComponent.decorators = [
|
|
4179
4189
|
{ type: core.Component, args: [{
|
|
4180
4190
|
selector: "rs-drawer",
|
|
4181
|
-
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-
|
|
4182
|
-
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-
|
|
4191
|
+
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",
|
|
4192
|
+
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}"]
|
|
4183
4193
|
}] }
|
|
4184
4194
|
];
|
|
4185
4195
|
/** @nocollapse */
|
|
@@ -4225,7 +4235,7 @@
|
|
|
4225
4235
|
/** @type {?} */
|
|
4226
4236
|
DrawerComponent.prototype.config;
|
|
4227
4237
|
/** @type {?} */
|
|
4228
|
-
DrawerComponent.prototype.
|
|
4238
|
+
DrawerComponent.prototype.useAnimation;
|
|
4229
4239
|
/** @type {?} */
|
|
4230
4240
|
DrawerComponent.prototype.isOpened;
|
|
4231
4241
|
/** @type {?} */
|