raise-common-lib 0.0.129 → 0.0.130

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.
@@ -3209,16 +3209,6 @@
3209
3209
  */
3210
3210
  function () {
3211
3211
  var _this = this;
3212
- this.subscriptions.push(this.cf.closeTab$.subscribe((/**
3213
- * @param {?} idx
3214
- * @return {?}
3215
- */
3216
- function (idx) {
3217
- if (idx === undefined) {
3218
- idx = _this.selectedTab;
3219
- }
3220
- _this.closeTab(idx);
3221
- })));
3222
3212
  this.initTab();
3223
3213
  // 解决刷新页面后,选中的 tab 丢失问题
3224
3214
  /** @type {?} */
@@ -3227,7 +3217,8 @@
3227
3217
  * @return {?}
3228
3218
  */
3229
3219
  function (ele) {
3230
- return _this.urlWithoutQuery(ele.url) === _this.urlWithoutQuery(_this.router.url);
3220
+ return _this.urlWithoutQuery(ele.url) ===
3221
+ _this.urlWithoutQuery(_this.router.url);
3231
3222
  }));
3232
3223
  if (isExistIdx !== -1) {
3233
3224
  this.selectedTab = isExistIdx;
@@ -3245,6 +3236,18 @@
3245
3236
  /** @type {?} */
3246
3237
  var navigation = _this.router.getCurrentNavigation();
3247
3238
  if (navigation) {
3239
+ /** @type {?} */
3240
+ var tooltipElements = document.querySelectorAll(".e-popup-open");
3241
+ // 删除tooltips
3242
+ tooltipElements.forEach((/**
3243
+ * @param {?} element
3244
+ * @return {?}
3245
+ */
3246
+ function (element) {
3247
+ /** @type {?} */
3248
+ var htmlElement = (/** @type {?} */ (element));
3249
+ htmlElement.style.display = "none";
3250
+ }));
3248
3251
  /** @type {?} */
3249
3252
  var state = navigation.extras.state;
3250
3253
  // 获取传递的 state
@@ -3258,12 +3261,15 @@
3258
3261
  /** @type {?} */
3259
3262
  var title = (state && state.title) ||
3260
3263
  navigationInfo.title ||
3261
- navigationInfo.subTitle;
3264
+ navigationInfo.subTitle ||
3265
+ navigationInfo.name;
3266
+ /** @type {?} */
3267
+ var noReused = (state && state.noReused) || false;
3262
3268
  if (currentRoute && !skipLocationChange) {
3263
3269
  if (_this.noGenerateTabUrls.includes(_this.urlWithoutQuery(_this.router.url))) {
3264
3270
  return; // 排除不生成tab的url
3265
3271
  }
3266
- _this.setTab(_this.router.url, currentRoute.snapshot.routeConfig.path, title);
3272
+ _this.setTab(_this.router.url, currentRoute.snapshot.routeConfig.path, title, noReused);
3267
3273
  }
3268
3274
  }
3269
3275
  })));
@@ -3391,13 +3397,15 @@
3391
3397
  };
3392
3398
  /**
3393
3399
  * @param {?} idx
3400
+ * @param {?=} isExternal
3394
3401
  * @return {?}
3395
3402
  */
3396
3403
  MultiTabComponent.prototype.closeTab = /**
3397
3404
  * @param {?} idx
3405
+ * @param {?=} isExternal
3398
3406
  * @return {?}
3399
3407
  */
3400
- function (idx) {
3408
+ function (idx, isExternal) {
3401
3409
  /** @type {?} */
3402
3410
  var tab = this.tabList[idx];
3403
3411
  this.tabList = this.tabList.filter((/**
@@ -3406,11 +3414,14 @@
3406
3414
  */
3407
3415
  function (ele) { return ele.url !== tab.url; }));
3408
3416
  this.clearCache(this.urlWithoutQuery(tab.url));
3409
- if (this.selectedTab === idx) {
3417
+ if (!isExternal && this.selectedTab === idx) {
3410
3418
  /** @type {?} */
3411
3419
  var targetIdx = Math.max(0, idx - 1);
3412
3420
  this.changeTab(this.tabList[targetIdx], targetIdx);
3413
3421
  }
3422
+ if (idx < this.selectedTab) {
3423
+ this.selectedTab = this.selectedTab - 1; // 如果关闭的tab在当前选中的tab之前,选中tab索引减1
3424
+ }
3414
3425
  this.setEllipsisTitle();
3415
3426
  sessionStorage.setItem("TabCache", JSON.stringify(this.tabList));
3416
3427
  this.ref.markForCheck();
@@ -3427,6 +3438,15 @@
3427
3438
  */
3428
3439
  function (tab, idx) {
3429
3440
  this.router.navigateByUrl(tab.url);
3441
+ if (tab.navigationInfo) {
3442
+ sessionStorage.setItem("navigationInfo", JSON.stringify(tab.navigationInfo));
3443
+ }
3444
+ if (tab.fromUrl) {
3445
+ sessionStorage.setItem("fromUrl", tab.fromUrl);
3446
+ }
3447
+ if (tab.permissions) {
3448
+ sessionStorage.setItem("permissions", JSON.stringify(tab.permissions));
3449
+ }
3430
3450
  this.selectedTab = idx;
3431
3451
  this.ref.markForCheck();
3432
3452
  };
@@ -3442,12 +3462,24 @@
3442
3462
  */
3443
3463
  function (url, title) {
3444
3464
  if (this.tabList.length >= this.maxTabs) {
3445
- this.closeTab(0); // 删除第一个
3465
+ this.closeTab(1); // 删除第二个,第一个固定
3446
3466
  }
3467
+ /** @type {?} */
3468
+ var localPermissions = sessionStorage.getItem("permissions") ||
3469
+ localStorage.getItem("permissions");
3470
+ /** @type {?} */
3471
+ var navigationInfo = JSON.parse(sessionStorage.getItem("navigationInfo"));
3472
+ /** @type {?} */
3473
+ var fromUrl = sessionStorage.getItem("fromUrl");
3474
+ /** @type {?} */
3475
+ var permissions = JSON.parse(localPermissions);
3447
3476
  this.tabList.push({
3448
3477
  url: url,
3449
3478
  title: title || "default",
3450
3479
  displayTitle: title,
3480
+ navigationInfo: navigationInfo,
3481
+ permissions: permissions,
3482
+ fromUrl: fromUrl,
3451
3483
  });
3452
3484
  this.selectedTab = this.tabList.length - 1;
3453
3485
  this.setEllipsisTitle();
@@ -3456,17 +3488,19 @@
3456
3488
  };
3457
3489
  /**
3458
3490
  * @param {?} url
3459
- * @param {?=} pureUrl
3460
- * @param {?=} title
3491
+ * @param {?} pureUrl
3492
+ * @param {?} title
3493
+ * @param {?} noReused
3461
3494
  * @return {?}
3462
3495
  */
3463
3496
  MultiTabComponent.prototype.setTab = /**
3464
3497
  * @param {?} url
3465
- * @param {?=} pureUrl
3466
- * @param {?=} title
3498
+ * @param {?} pureUrl
3499
+ * @param {?} title
3500
+ * @param {?} noReused
3467
3501
  * @return {?}
3468
3502
  */
3469
- function (url, pureUrl, title) {
3503
+ function (url, pureUrl, title, noReused) {
3470
3504
  var _this = this;
3471
3505
  /** @type {?} */
3472
3506
  var isExistIdx = this.tabList.findIndex((/**
@@ -3493,7 +3527,16 @@
3493
3527
  this.addTab(url, title);
3494
3528
  }
3495
3529
  else {
3496
- this.selectedTab = isExistIdx;
3530
+ /** @type {?} */
3531
+ var targetTabUrl = this.tabList[isExistIdx].url;
3532
+ if (targetTabUrl !== url || noReused) {
3533
+ // 当缓存一致时候,但是url不一致,重新按照新的url生成tab
3534
+ this.closeTab(isExistIdx, true);
3535
+ this.addTab(url, title);
3536
+ }
3537
+ else {
3538
+ this.changeTab(this.tabList[isExistIdx], isExistIdx);
3539
+ }
3497
3540
  this.ref.markForCheck();
3498
3541
  }
3499
3542
  };
@@ -3556,8 +3599,8 @@
3556
3599
  MultiTabComponent.decorators = [
3557
3600
  { type: core.Component, args: [{
3558
3601
  selector: "rs-multi-tab",
3559
- template: "<div class=\"rs-multi-tab\" [ngClass]=\"{ 'b-line': tabList.length > 0 }\">\r\n <ul>\r\n <ng-container *ngFor=\"let tab of tabList; let i = index\">\r\n <li\r\n [ngClass]=\"selectedTab === i ? 'isSelect' : 'notSelect'\"\r\n (click)=\"changeTab(tab, i)\"\r\n >\r\n <ejs-tooltip\r\n id=\"notSelectTooltip\"\r\n [showTipPointer]=\"false\"\r\n [openDelay]=\"500\"\r\n *ngIf=\"tab.displayTitle !== tab.title; else originText\"\r\n style=\"height: 27px\"\r\n >\r\n <ng-template #content>\r\n <div class=\"tooltip-content\">\r\n {{ tab.title }}\r\n </div>\r\n </ng-template>\r\n <span class=\"tabTitle\">{{ tab.displayTitle }}</span>\r\n </ejs-tooltip>\r\n <ng-template #originText>\r\n <span class=\"tabTitle\">\r\n {{ tab.displayTitle }}\r\n </span>\r\n </ng-template>\r\n <span class=\"img-block\" *ngIf=\"selectedTab !== i\"></span>\r\n <img\r\n *ngIf=\"tabList.length !== 1\"\r\n src=\"../../../assets/img/close-url.svg\"\r\n (click)=\"closeTab(i)\"\r\n />\r\n </li>\r\n </ng-container>\r\n </ul>\r\n <div class=\"refresh-tab\" (click)=\"refreshTab()\" *ngIf=\"tabList.length > 0\">\r\n <ejs-tooltip\r\n id=\"notSelectTooltip\"\r\n [showTipPointer]=\"false\"\r\n [openDelay]=\"500\"\r\n style=\"height: 27px\"\r\n >\r\n <ng-template #content>\r\n <div class=\"tooltip-content\">Refresh Current Tab</div>\r\n </ng-template>\r\n <img\r\n id=\"loadingIcon\"\r\n alt\r\n class=\"refresh-btn\"\r\n src=\"../../../assets/img/desktop-refresh-btn.svg\"\r\n />\r\n </ejs-tooltip>\r\n <span>Refresh Current Tab</span>\r\n </div>\r\n</div>\r\n",
3560
- styles: [".rs-multi-tab{width:100%;display:flex;justify-content:space-between;margin:0 auto;max-width:1886px}.rs-multi-tab.b-line{border-bottom:1px solid #e5eaef}.rs-multi-tab ul{display:flex;margin:0 8px;padding:0;overflow:hidden;height:100%}.rs-multi-tab ul li{max-width:164px;padding:0 12px;display:flex;align-items:center;flex:auto;border:1px solid #e5eaef;border-bottom:none;color:#5f6f81;font-family:Arial;font-size:11px;font-style:normal;font-weight:400;line-height:28px;height:28px;background:#f8fafb;vertical-align:top;position:relative;cursor:default}.rs-multi-tab ul li .tabTitle{display:inline-block;white-space:nowrap;font-size:11px;font-family:Arial;font-style:normal;font-weight:400;line-height:16px;transition:width .3s}.rs-multi-tab ul li img{border-radius:4px;padding:4px;margin-left:6px;margin-top:1px;vertical-align:top;cursor:pointer}.rs-multi-tab ul li img:hover{background:#dce8f6}.rs-multi-tab ul li:not(:last-child){border-right:none}.rs-multi-tab ul li:first-of-type{border-top-left-radius:8px}.rs-multi-tab ul li:last-child{border-top-right-radius:8px}.rs-multi-tab ul .isSelect{color:#1f3f5c;background:#fff}.rs-multi-tab ul .notSelect img{display:none}.rs-multi-tab ul .notSelect .img-block{display:inline-block;width:22px}.rs-multi-tab ul .notSelect:hover{color:#1f3f5c;background-color:rgba(31,123,255,.04)}.rs-multi-tab ul .notSelect:hover .img-block{display:none}.rs-multi-tab ul .notSelect:hover img{display:inline-block}.rs-multi-tab .refresh-tab{cursor:pointer;text-align:right;color:#6c7c90;font-family:Arial;font-size:11px;font-style:normal;font-weight:400;line-height:28px;padding-right:12px}.rs-multi-tab .refresh-tab img{vertical-align:middle;margin-right:4px}.refresh-tab-loading{-webkit-animation:1s linear infinite spin;animation:1s linear infinite spin}@-webkit-keyframes spin{0%{transform:rotate(0)}100%{transform:rotate(360deg)}}@keyframes spin{0%{transform:rotate(0)}100%{transform:rotate(360deg)}}.tooltip-content{padding:4px;color:#f8fafb;font-family:Arial;font-size:11px;font-style:normal;font-weight:400;line-height:14px}@media (max-width:1400px){.refresh-tab{padding-right:0!important}.refresh-tab span{display:none!important}}@media (max-width:1100px){.rs-multi-tab ul li img{position:absolute;right:3px;background-color:#fff}.notSelect:hover img{position:absolute;right:3px;background-color:#eff5fb}.img-block{display:none!important}}@media (max-width:600px){.rs-multi-tab ul li{padding:0 8px}.rs-multi-tab ul .notSelect .img-block{width:0!important}}"]
3602
+ template: "<div class=\"rs-multi-tab\" [ngClass]=\"{ 'b-line': tabList.length > 0 }\">\r\n\t<ul>\r\n\t\t<ng-container *ngFor=\"let tab of tabList; let i = index\">\r\n\t\t\t<li\r\n\t\t\t\t[ngClass]=\"selectedTab === i ? 'isSelect' : 'notSelect'\"\r\n\t\t\t\t(click)=\"changeTab(tab, i)\"\r\n\t\t\t>\r\n\t\t\t\t<ejs-tooltip\r\n\t\t\t\t\tid=\"notSelectTooltip\"\r\n\t\t\t\t\t[showTipPointer]=\"false\"\r\n\t\t\t\t\t[openDelay]=\"500\"\r\n\t\t\t\t\t*ngIf=\"tab.displayTitle !== tab.title; else originText\"\r\n\t\t\t\t\tstyle=\"height: 27px\"\r\n\t\t\t\t>\r\n\t\t\t\t\t<ng-template #content>\r\n\t\t\t\t\t\t<div class=\"tooltip-content\">\r\n\t\t\t\t\t\t\t{{ tab.title }}\r\n\t\t\t\t\t\t</div>\r\n\t\t\t\t\t</ng-template>\r\n\t\t\t\t\t<span class=\"tabTitle\">{{ tab.displayTitle }}</span>\r\n\t\t\t\t</ejs-tooltip>\r\n\t\t\t\t<ng-template #originText>\r\n\t\t\t\t\t<span class=\"tabTitle\">\r\n\t\t\t\t\t\t{{ tab.displayTitle }}\r\n\t\t\t\t\t</span>\r\n\t\t\t\t</ng-template>\r\n\t\t\t\t<span\r\n\t\t\t\t\tclass=\"img-block\"\r\n\t\t\t\t\t*ngIf=\"selectedTab !== i && i !== 0\"\r\n\t\t\t\t></span>\r\n\t\t\t\t<img\r\n\t\t\t\t\t*ngIf=\"i !== 0\"\r\n\t\t\t\t\tsrc=\"../../../assets/img/close-url.svg\"\r\n\t\t\t\t\t(click)=\"closeTab(i)\"\r\n\t\t\t\t/>\r\n\t\t\t</li>\r\n\t\t</ng-container>\r\n\t</ul>\r\n\t<div class=\"refresh-tab\" (click)=\"refreshTab()\" *ngIf=\"tabList.length > 0\">\r\n\t\t<ejs-tooltip\r\n\t\t\tid=\"notSelectTooltip\"\r\n\t\t\tcssClass=\"notSelectTooltip\"\r\n\t\t\t[showTipPointer]=\"false\"\r\n\t\t\t[openDelay]=\"500\"\r\n\t\t\tstyle=\"height: 27px\"\r\n\t\t>\r\n\t\t\t<ng-template #content>\r\n\t\t\t\t<div class=\"tooltip-content\">Refresh Current Tab</div>\r\n\t\t\t</ng-template>\r\n\t\t\t<img\r\n\t\t\t\tid=\"loadingIcon\"\r\n\t\t\t\talt\r\n\t\t\t\tclass=\"refresh-btn\"\r\n\t\t\t\tsrc=\"../../../assets/img/desktop-refresh-btn.svg\"\r\n\t\t\t/>\r\n\t\t</ejs-tooltip>\r\n\t</div>\r\n</div>\r\n",
3603
+ styles: [".rs-multi-tab{width:100%;display:flex;justify-content:space-between;margin:0 auto;max-width:1886px}.rs-multi-tab.b-line{border-bottom:1px solid #e5eaef}.rs-multi-tab ul{display:flex;margin:0 8px;padding:0;overflow:hidden;height:100%}.rs-multi-tab ul li{max-width:164px;padding:0 12px;display:flex;align-items:center;flex:auto;border:1px solid #e5eaef;border-bottom:none;color:#5f6f81;font-family:Arial;font-size:11px;font-style:normal;font-weight:400;line-height:28px;height:28px;background:#f8fafb;vertical-align:top;position:relative;cursor:default}.rs-multi-tab ul li .tabTitle{display:inline-block;white-space:nowrap;font-size:11px;font-family:Arial;font-style:normal;font-weight:400;line-height:16px;transition:width .3s}.rs-multi-tab ul li img{border-radius:4px;padding:4px;margin-left:6px;margin-top:1px;vertical-align:top;cursor:pointer}.rs-multi-tab ul li img:hover{background:#dce8f6}.rs-multi-tab ul li:not(:last-child){border-right:none}.rs-multi-tab ul li:first-of-type{border-top-left-radius:8px}.rs-multi-tab ul li:last-child{border-top-right-radius:8px}.rs-multi-tab ul .isSelect{color:#1f3f5c;background:#fff}.rs-multi-tab ul .notSelect img{display:none}.rs-multi-tab ul .notSelect .img-block{display:inline-block;width:22px}.rs-multi-tab ul .notSelect:hover{color:#1f3f5c;background-color:rgba(31,123,255,.04)}.rs-multi-tab ul .notSelect:hover .img-block{display:none}.rs-multi-tab ul .notSelect:hover img{display:inline-block}.rs-multi-tab .refresh-tab{cursor:pointer;text-align:right;color:#6c7c90;font-family:Arial;font-size:11px;font-style:normal;font-weight:400;line-height:28px;padding-right:12px}.rs-multi-tab .refresh-tab img{vertical-align:middle;margin-right:4px}.refresh-tab-loading{-webkit-animation:1s linear infinite spin;animation:1s linear infinite spin}.notSelectTooltip{transform:translateX(-12px)}@-webkit-keyframes spin{0%{transform:rotate(0)}100%{transform:rotate(360deg)}}@keyframes spin{0%{transform:rotate(0)}100%{transform:rotate(360deg)}}.tooltip-content{padding:4px;color:#f8fafb;font-family:Arial;font-size:11px;font-style:normal;font-weight:400;line-height:14px}@media (max-width:1400px){.refresh-tab{padding-right:0!important}.refresh-tab span{display:none!important}}@media (max-width:1100px){.rs-multi-tab ul li img{position:absolute;right:3px;background-color:#fff}.notSelect:hover img{position:absolute;right:3px;background-color:#eff5fb}.img-block{display:none!important}.isSelect:not(:first-child){padding-right:20px!important}}@media (max-width:600px){.rs-multi-tab ul li{padding:0 8px}.rs-multi-tab ul .notSelect .img-block{width:0!important}}"]
3561
3604
  }] }
3562
3605
  ];
3563
3606
  /** @nocollapse */
@@ -4114,7 +4157,7 @@
4114
4157
  RSToolbarComponent.decorators = [
4115
4158
  { type: core.Component, args: [{
4116
4159
  selector: "rs-toolbar",
4117
- template: "<div #toolbarContainer class=\"rs-toolbar-container\">\r\n <!-- \u53EF\u89C1\u6309\u94AE -->\r\n <ng-container *ngFor=\"let button of buttons\">\r\n <div class=\"temp-hidden\" #toolbarItem>\r\n <rs-toolbar-item\r\n [image]=\"button.image\"\r\n [text]=\"button.text\"\r\n [disabled]=\"(button.key && disabledOptions[button.key]) || false\"\r\n (click)=\"button.action && button.action()\"\r\n [children]=\"button.children || []\"\r\n [disabledOptions]=\"disabledOptions\"\r\n >\r\n </rs-toolbar-item>\r\n </div>\r\n </ng-container>\r\n\r\n <!-- \u4E0B\u62C9\u83DC\u5355\uFF08\u5982\u679C\u6709\u9690\u85CF\u6309\u94AE\uFF09 -->\r\n <button\r\n *ngIf=\"hiddenButtons.length > 0\"\r\n mat-button\r\n [matMenuTriggerFor]=\"menu\"\r\n #menuTrigger=\"matMenuTrigger\"\r\n class=\"action-toggle\"\r\n >\r\n <mat-icon svgIcon=\"more\"></mat-icon>\r\n </button>\r\n\r\n <mat-menu #menu=\"matMenu\">\r\n <ng-container *ngFor=\"let button of hiddenButtons\">\r\n <rs-toolbar-item\r\n [image]=\"button.image\"\r\n [text]=\"button.text\"\r\n (click)=\"button.action && button.action()\"\r\n [disabled]=\"disabledOptions[button.key] || false\"\r\n [children]=\"button.children || []\"\r\n >\r\n </rs-toolbar-item>\r\n </ng-container>\r\n </mat-menu>\r\n</div>\r\n",
4160
+ template: "<div #toolbarContainer class=\"rs-toolbar-container\">\r\n <!-- \u53EF\u89C1\u6309\u94AE -->\r\n <ng-container *ngFor=\"let button of buttons\">\r\n <div class=\"temp-hidden\" #toolbarItem>\r\n <rs-toolbar-item\r\n [image]=\"button.image\"\r\n [text]=\"button.text\"\r\n [disabled]=\"(button.key && disabledOptions[button.key]) || false\"\r\n (click)=\"button.action && button.action()\"\r\n [children]=\"button.children || []\"\r\n [disabledOptions]=\"disabledOptions\"\r\n >\r\n </rs-toolbar-item>\r\n </div>\r\n </ng-container>\r\n\r\n <!-- \u4E0B\u62C9\u83DC\u5355\uFF08\u5982\u679C\u6709\u9690\u85CF\u6309\u94AE\uFF09 -->\r\n <button\r\n *ngIf=\"hiddenButtons.length > 0\"\r\n mat-button\r\n [matMenuTriggerFor]=\"menu\"\r\n #menuTrigger=\"matMenuTrigger\"\r\n class=\"action-toggle\"\r\n >\r\n <mat-icon svgIcon=\"more\"></mat-icon>\r\n </button>\r\n\r\n <mat-menu #menu=\"matMenu\">\r\n <ng-container *ngFor=\"let button of hiddenButtons\">\r\n <rs-toolbar-item\r\n [image]=\"button.image\"\r\n [text]=\"button.text\"\r\n (click)=\"button.action && button.action()\"\r\n [disabled]=\"disabledOptions[button.key] || false\"\r\n [children]=\"button.children || []\"\r\n [disabledOptions]=\"disabledOptions\"\r\n >\r\n </rs-toolbar-item>\r\n </ng-container>\r\n </mat-menu>\r\n</div>\r\n",
4118
4161
  styles: [":host{display:block;width:100%}.rs-toolbar-container{width:100%;display:flex;align-items:center}.rs-toolbar-container .temp-hidden{visibility:hidden;position:absolute}.rs-toolbar-container .action-toggle{width:24px;height:24px;min-width:24px;max-width:24px;padding:0;border-radius:4px;display:flex;flex-flow:row nowrap;justify-content:center;align-items:center;background:0 0}.rs-toolbar-container .action-toggle:hover{background:rgba(214,227,245,.2)}.rs-toolbar-container .action-toggle .mat-button-wrapper{max-height:24px;height:24px}.rs-toolbar-container .action-toggle ::ng-deep .mat-icon{width:16px;height:16px;display:flex;flex-flow:row nowrap;justify-content:center;align-items:center}"]
4119
4162
  }] }
4120
4163
  ];