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
|
@@ -3,7 +3,7 @@ import { GridModule, PagerModule, GridAllModule, PageService, SortService, Filte
|
|
|
3
3
|
import { debounce } from 'lodash';
|
|
4
4
|
import { NavigationEnd, Router, ActivatedRoute, RouteReuseStrategy } from '@angular/router';
|
|
5
5
|
import { filter } from 'rxjs/operators';
|
|
6
|
-
import { BehaviorSubject } from 'rxjs';
|
|
6
|
+
import { Subject, BehaviorSubject } from 'rxjs';
|
|
7
7
|
import { HttpClient, HttpClientModule } from '@angular/common/http';
|
|
8
8
|
import { setCulture, L10n } from '@syncfusion/ej2-base';
|
|
9
9
|
import { DatePipe, CommonModule } from '@angular/common';
|
|
@@ -1252,7 +1252,10 @@ if (false) {
|
|
|
1252
1252
|
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
1253
1253
|
*/
|
|
1254
1254
|
class CommonFunctionService {
|
|
1255
|
-
constructor() {
|
|
1255
|
+
constructor() {
|
|
1256
|
+
this.closeTabSubject = new Subject();
|
|
1257
|
+
this.closeTab$ = this.closeTabSubject.asObservable();
|
|
1258
|
+
}
|
|
1256
1259
|
/**
|
|
1257
1260
|
* @return {?}
|
|
1258
1261
|
*/
|
|
@@ -1313,6 +1316,14 @@ class CommonFunctionService {
|
|
|
1313
1316
|
}
|
|
1314
1317
|
return url;
|
|
1315
1318
|
}
|
|
1319
|
+
// 删除当前
|
|
1320
|
+
/**
|
|
1321
|
+
* @param {?=} tabIndex
|
|
1322
|
+
* @return {?}
|
|
1323
|
+
*/
|
|
1324
|
+
closeTab(tabIndex) {
|
|
1325
|
+
return this.closeTabSubject.next(tabIndex);
|
|
1326
|
+
}
|
|
1316
1327
|
}
|
|
1317
1328
|
CommonFunctionService.decorators = [
|
|
1318
1329
|
{ type: Injectable, args: [{
|
|
@@ -1321,7 +1332,16 @@ CommonFunctionService.decorators = [
|
|
|
1321
1332
|
];
|
|
1322
1333
|
/** @nocollapse */
|
|
1323
1334
|
CommonFunctionService.ctorParameters = () => [];
|
|
1324
|
-
/** @nocollapse */ CommonFunctionService.ngInjectableDef = ɵɵdefineInjectable({ factory: function CommonFunctionService_Factory() { return new CommonFunctionService(); }, token: CommonFunctionService, providedIn: "root" });
|
|
1335
|
+
/** @nocollapse */ CommonFunctionService.ngInjectableDef = ɵɵdefineInjectable({ factory: function CommonFunctionService_Factory() { return new CommonFunctionService(); }, token: CommonFunctionService, providedIn: "root" });
|
|
1336
|
+
if (false) {
|
|
1337
|
+
/**
|
|
1338
|
+
* @type {?}
|
|
1339
|
+
* @private
|
|
1340
|
+
*/
|
|
1341
|
+
CommonFunctionService.prototype.closeTabSubject;
|
|
1342
|
+
/** @type {?} */
|
|
1343
|
+
CommonFunctionService.prototype.closeTab$;
|
|
1344
|
+
}
|
|
1325
1345
|
|
|
1326
1346
|
/**
|
|
1327
1347
|
* @fileoverview added by tsickle
|
|
@@ -1575,6 +1595,8 @@ class MultiTabComponent {
|
|
|
1575
1595
|
this.singleReuseUrls = []; //只能单个缓存的url
|
|
1576
1596
|
//只能单个缓存的url
|
|
1577
1597
|
this.noGenerateTabUrls = []; //不生成tab的url
|
|
1598
|
+
//不生成tab的url
|
|
1599
|
+
this.subscriptions = [];
|
|
1578
1600
|
this.TAB_WIDTH = 164;
|
|
1579
1601
|
this.GAP_NORMAL = 54;
|
|
1580
1602
|
this.GAP_SMALL = 30;
|
|
@@ -1597,6 +1619,16 @@ class MultiTabComponent {
|
|
|
1597
1619
|
* @return {?}
|
|
1598
1620
|
*/
|
|
1599
1621
|
ngOnInit() {
|
|
1622
|
+
this.subscriptions.push(this.cf.closeTab$.subscribe((/**
|
|
1623
|
+
* @param {?} idx
|
|
1624
|
+
* @return {?}
|
|
1625
|
+
*/
|
|
1626
|
+
(idx) => {
|
|
1627
|
+
if (idx === undefined) {
|
|
1628
|
+
idx = this.selectedTab;
|
|
1629
|
+
}
|
|
1630
|
+
this.closeTab(idx);
|
|
1631
|
+
})));
|
|
1600
1632
|
this.initTab();
|
|
1601
1633
|
// 解决刷新页面后,选中的 tab 丢失问题
|
|
1602
1634
|
/** @type {?} */
|
|
@@ -1608,7 +1640,7 @@ class MultiTabComponent {
|
|
|
1608
1640
|
if (isExistIdx !== -1) {
|
|
1609
1641
|
this.selectedTab = isExistIdx;
|
|
1610
1642
|
}
|
|
1611
|
-
this.
|
|
1643
|
+
this.subscriptions.push(this.router.events
|
|
1612
1644
|
.pipe(filter((/**
|
|
1613
1645
|
* @param {?} event
|
|
1614
1646
|
* @return {?}
|
|
@@ -1642,7 +1674,7 @@ class MultiTabComponent {
|
|
|
1642
1674
|
this.setTab(this.router.url, currentRoute.snapshot.routeConfig.path, title);
|
|
1643
1675
|
}
|
|
1644
1676
|
}
|
|
1645
|
-
}));
|
|
1677
|
+
})));
|
|
1646
1678
|
}
|
|
1647
1679
|
/**
|
|
1648
1680
|
* @return {?}
|
|
@@ -1659,9 +1691,11 @@ class MultiTabComponent {
|
|
|
1659
1691
|
* @return {?}
|
|
1660
1692
|
*/
|
|
1661
1693
|
ngOnDestroy() {
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1694
|
+
this.subscriptions.forEach((/**
|
|
1695
|
+
* @param {?} sub
|
|
1696
|
+
* @return {?}
|
|
1697
|
+
*/
|
|
1698
|
+
(sub) => sub.unsubscribe()));
|
|
1665
1699
|
}
|
|
1666
1700
|
/**
|
|
1667
1701
|
* @param {?=} title
|
|
@@ -1736,11 +1770,12 @@ class MultiTabComponent {
|
|
|
1736
1770
|
this.tabList = TabCache || [];
|
|
1737
1771
|
}
|
|
1738
1772
|
/**
|
|
1739
|
-
* @param {?} tab
|
|
1740
1773
|
* @param {?} idx
|
|
1741
1774
|
* @return {?}
|
|
1742
1775
|
*/
|
|
1743
|
-
closeTab(
|
|
1776
|
+
closeTab(idx) {
|
|
1777
|
+
/** @type {?} */
|
|
1778
|
+
const tab = this.tabList[idx];
|
|
1744
1779
|
this.tabList = this.tabList.filter((/**
|
|
1745
1780
|
* @param {?} ele
|
|
1746
1781
|
* @return {?}
|
|
@@ -1773,7 +1808,7 @@ class MultiTabComponent {
|
|
|
1773
1808
|
*/
|
|
1774
1809
|
addTab(url, title) {
|
|
1775
1810
|
if (this.tabList.length >= this.maxTabs) {
|
|
1776
|
-
this.closeTab(
|
|
1811
|
+
this.closeTab(0); // 删除第一个
|
|
1777
1812
|
}
|
|
1778
1813
|
this.tabList.push({
|
|
1779
1814
|
url: url,
|
|
@@ -1848,8 +1883,8 @@ class MultiTabComponent {
|
|
|
1848
1883
|
MultiTabComponent.decorators = [
|
|
1849
1884
|
{ type: Component, args: [{
|
|
1850
1885
|
selector: "rs-multi-tab",
|
|
1851
|
-
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(
|
|
1852
|
-
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}}"]
|
|
1886
|
+
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",
|
|
1887
|
+
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}}"]
|
|
1853
1888
|
}] }
|
|
1854
1889
|
];
|
|
1855
1890
|
/** @nocollapse */
|
|
@@ -1877,7 +1912,7 @@ if (false) {
|
|
|
1877
1912
|
* @type {?}
|
|
1878
1913
|
* @private
|
|
1879
1914
|
*/
|
|
1880
|
-
MultiTabComponent.prototype.
|
|
1915
|
+
MultiTabComponent.prototype.subscriptions;
|
|
1881
1916
|
/** @type {?} */
|
|
1882
1917
|
MultiTabComponent.prototype.TAB_WIDTH;
|
|
1883
1918
|
/** @type {?} */
|