raise-common-lib 0.0.42 → 0.0.44
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 +53 -13
- 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/multi-tab/index.component.js +27 -12
- package/esm2015/lib/service/common-function.service.js +23 -2
- package/esm5/lib/layout/multi-tab/index.component.js +27 -13
- package/esm5/lib/service/common-function.service.js +28 -1
- package/fesm2015/raise-common-lib.js +49 -14
- package/fesm2015/raise-common-lib.js.map +1 -1
- package/fesm5/raise-common-lib.js +54 -14
- package/fesm5/raise-common-lib.js.map +1 -1
- package/lib/layout/multi-tab/index.component.d.ts +2 -2
- package/lib/service/common-function.service.d.ts +4 -0
- package/package.json +1 -1
- package/raise-common-lib.metadata.json +1 -1
- package/src/assets/style/reset/dropdown.scss +0 -1
- package/src/assets/style/reset/input.scss +0 -2
|
@@ -1673,6 +1673,8 @@
|
|
|
1673
1673
|
*/
|
|
1674
1674
|
var CommonFunctionService = /** @class */ (function () {
|
|
1675
1675
|
function CommonFunctionService() {
|
|
1676
|
+
this.closeTabSubject = new rxjs.Subject();
|
|
1677
|
+
this.closeTab$ = this.closeTabSubject.asObservable();
|
|
1676
1678
|
}
|
|
1677
1679
|
/**
|
|
1678
1680
|
* @return {?}
|
|
@@ -1749,6 +1751,21 @@
|
|
|
1749
1751
|
}
|
|
1750
1752
|
return url;
|
|
1751
1753
|
};
|
|
1754
|
+
// 删除当前
|
|
1755
|
+
// 删除当前
|
|
1756
|
+
/**
|
|
1757
|
+
* @param {?=} tabIndex
|
|
1758
|
+
* @return {?}
|
|
1759
|
+
*/
|
|
1760
|
+
CommonFunctionService.prototype.closeTab =
|
|
1761
|
+
// 删除当前
|
|
1762
|
+
/**
|
|
1763
|
+
* @param {?=} tabIndex
|
|
1764
|
+
* @return {?}
|
|
1765
|
+
*/
|
|
1766
|
+
function (tabIndex) {
|
|
1767
|
+
return this.closeTabSubject.next(tabIndex);
|
|
1768
|
+
};
|
|
1752
1769
|
CommonFunctionService.decorators = [
|
|
1753
1770
|
{ type: core.Injectable, args: [{
|
|
1754
1771
|
providedIn: "root",
|
|
@@ -1758,7 +1775,16 @@
|
|
|
1758
1775
|
CommonFunctionService.ctorParameters = function () { return []; };
|
|
1759
1776
|
/** @nocollapse */ CommonFunctionService.ngInjectableDef = core.ɵɵdefineInjectable({ factory: function CommonFunctionService_Factory() { return new CommonFunctionService(); }, token: CommonFunctionService, providedIn: "root" });
|
|
1760
1777
|
return CommonFunctionService;
|
|
1761
|
-
}());
|
|
1778
|
+
}());
|
|
1779
|
+
if (false) {
|
|
1780
|
+
/**
|
|
1781
|
+
* @type {?}
|
|
1782
|
+
* @private
|
|
1783
|
+
*/
|
|
1784
|
+
CommonFunctionService.prototype.closeTabSubject;
|
|
1785
|
+
/** @type {?} */
|
|
1786
|
+
CommonFunctionService.prototype.closeTab$;
|
|
1787
|
+
}
|
|
1762
1788
|
|
|
1763
1789
|
/**
|
|
1764
1790
|
* @fileoverview added by tsickle
|
|
@@ -2053,6 +2079,8 @@
|
|
|
2053
2079
|
this.singleReuseUrls = []; //只能单个缓存的url
|
|
2054
2080
|
//只能单个缓存的url
|
|
2055
2081
|
this.noGenerateTabUrls = []; //不生成tab的url
|
|
2082
|
+
//不生成tab的url
|
|
2083
|
+
this.subscriptions = [];
|
|
2056
2084
|
this.TAB_WIDTH = 164;
|
|
2057
2085
|
this.GAP_NORMAL = 54;
|
|
2058
2086
|
this.GAP_SMALL = 30;
|
|
@@ -2085,6 +2113,16 @@
|
|
|
2085
2113
|
*/
|
|
2086
2114
|
function () {
|
|
2087
2115
|
var _this = this;
|
|
2116
|
+
this.subscriptions.push(this.cf.closeTab$.subscribe((/**
|
|
2117
|
+
* @param {?} idx
|
|
2118
|
+
* @return {?}
|
|
2119
|
+
*/
|
|
2120
|
+
function (idx) {
|
|
2121
|
+
if (idx === undefined) {
|
|
2122
|
+
idx = _this.selectedTab;
|
|
2123
|
+
}
|
|
2124
|
+
_this.closeTab(idx);
|
|
2125
|
+
})));
|
|
2088
2126
|
this.initTab();
|
|
2089
2127
|
// 解决刷新页面后,选中的 tab 丢失问题
|
|
2090
2128
|
/** @type {?} */
|
|
@@ -2096,7 +2134,7 @@
|
|
|
2096
2134
|
if (isExistIdx !== -1) {
|
|
2097
2135
|
this.selectedTab = isExistIdx;
|
|
2098
2136
|
}
|
|
2099
|
-
this.
|
|
2137
|
+
this.subscriptions.push(this.router.events
|
|
2100
2138
|
.pipe(operators.filter((/**
|
|
2101
2139
|
* @param {?} event
|
|
2102
2140
|
* @return {?}
|
|
@@ -2130,7 +2168,7 @@
|
|
|
2130
2168
|
_this.setTab(_this.router.url, currentRoute.snapshot.routeConfig.path, title);
|
|
2131
2169
|
}
|
|
2132
2170
|
}
|
|
2133
|
-
}));
|
|
2171
|
+
})));
|
|
2134
2172
|
};
|
|
2135
2173
|
/**
|
|
2136
2174
|
* @return {?}
|
|
@@ -2154,9 +2192,11 @@
|
|
|
2154
2192
|
* @return {?}
|
|
2155
2193
|
*/
|
|
2156
2194
|
function () {
|
|
2157
|
-
|
|
2158
|
-
|
|
2159
|
-
|
|
2195
|
+
this.subscriptions.forEach((/**
|
|
2196
|
+
* @param {?} sub
|
|
2197
|
+
* @return {?}
|
|
2198
|
+
*/
|
|
2199
|
+
function (sub) { return sub.unsubscribe(); }));
|
|
2160
2200
|
};
|
|
2161
2201
|
/**
|
|
2162
2202
|
* @param {?=} title
|
|
@@ -2242,16 +2282,16 @@
|
|
|
2242
2282
|
this.tabList = TabCache || [];
|
|
2243
2283
|
};
|
|
2244
2284
|
/**
|
|
2245
|
-
* @param {?} tab
|
|
2246
2285
|
* @param {?} idx
|
|
2247
2286
|
* @return {?}
|
|
2248
2287
|
*/
|
|
2249
2288
|
MultiTabComponent.prototype.closeTab = /**
|
|
2250
|
-
* @param {?} tab
|
|
2251
2289
|
* @param {?} idx
|
|
2252
2290
|
* @return {?}
|
|
2253
2291
|
*/
|
|
2254
|
-
function (
|
|
2292
|
+
function (idx) {
|
|
2293
|
+
/** @type {?} */
|
|
2294
|
+
var tab = this.tabList[idx];
|
|
2255
2295
|
this.tabList = this.tabList.filter((/**
|
|
2256
2296
|
* @param {?} ele
|
|
2257
2297
|
* @return {?}
|
|
@@ -2294,7 +2334,7 @@
|
|
|
2294
2334
|
*/
|
|
2295
2335
|
function (url, title) {
|
|
2296
2336
|
if (this.tabList.length >= this.maxTabs) {
|
|
2297
|
-
this.closeTab(
|
|
2337
|
+
this.closeTab(0); // 删除第一个
|
|
2298
2338
|
}
|
|
2299
2339
|
this.tabList.push({
|
|
2300
2340
|
url: url,
|
|
@@ -2383,8 +2423,8 @@
|
|
|
2383
2423
|
MultiTabComponent.decorators = [
|
|
2384
2424
|
{ type: core.Component, args: [{
|
|
2385
2425
|
selector: "rs-multi-tab",
|
|
2386
|
-
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(
|
|
2387
|
-
styles: [".rs-multi-tab{width:100%;display:flex;justify-content:space-between}.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}}"]
|
|
2426
|
+
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 <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 <span>Refresh Current Tab</span>\r\n </div>\r\n</div>\r\n",
|
|
2427
|
+
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}}"]
|
|
2388
2428
|
}] }
|
|
2389
2429
|
];
|
|
2390
2430
|
/** @nocollapse */
|
|
@@ -2414,7 +2454,7 @@
|
|
|
2414
2454
|
* @type {?}
|
|
2415
2455
|
* @private
|
|
2416
2456
|
*/
|
|
2417
|
-
MultiTabComponent.prototype.
|
|
2457
|
+
MultiTabComponent.prototype.subscriptions;
|
|
2418
2458
|
/** @type {?} */
|
|
2419
2459
|
MultiTabComponent.prototype.TAB_WIDTH;
|
|
2420
2460
|
/** @type {?} */
|