raise-common-lib 0.0.22 → 0.0.23
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 +75 -36
- package/bundles/raise-common-lib.umd.js.map +1 -1
- package/bundles/raise-common-lib.umd.min.js +2 -2
- package/bundles/raise-common-lib.umd.min.js.map +1 -1
- package/esm2015/lib/dialog/common-delete-dialog/index.component.js +2 -2
- package/esm2015/lib/dialog/common-dialog/index.component.js +2 -2
- package/esm2015/lib/layout/multi-tab/index.component.js +1 -1
- package/esm2015/lib/layout/rs-aside/index.component.js +23 -8
- package/esm2015/lib/layout/rs-header/index.component.js +39 -24
- package/esm2015/lib/service/dialog.service.js +2 -2
- package/esm2015/lib/service/keep-alive.service.js +11 -6
- package/esm5/lib/dialog/common-delete-dialog/index.component.js +2 -2
- package/esm5/lib/dialog/common-dialog/index.component.js +2 -2
- package/esm5/lib/layout/multi-tab/index.component.js +1 -1
- package/esm5/lib/layout/rs-aside/index.component.js +24 -8
- package/esm5/lib/layout/rs-header/index.component.js +43 -24
- package/esm5/lib/service/dialog.service.js +2 -2
- package/esm5/lib/service/keep-alive.service.js +11 -6
- package/fesm2015/raise-common-lib.js +70 -36
- package/fesm2015/raise-common-lib.js.map +1 -1
- package/fesm5/raise-common-lib.js +75 -36
- package/fesm5/raise-common-lib.js.map +1 -1
- package/lib/layout/rs-aside/index.component.d.ts +1 -1
- package/lib/layout/rs-header/index.component.d.ts +5 -9
- package/package.json +1 -1
- package/raise-common-lib.metadata.json +1 -1
|
@@ -1624,11 +1624,16 @@ var KeepAliveService = /** @class */ (function () {
|
|
|
1624
1624
|
* @return {?}
|
|
1625
1625
|
*/
|
|
1626
1626
|
function (future, curr) {
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
|
|
1631
|
-
|
|
1627
|
+
if (future.routeConfig === curr.routeConfig) {
|
|
1628
|
+
if (future.children.length === 0 && curr.children.length === 0) {
|
|
1629
|
+
// 无子路由时, 通过params和queryParams判断是否复用路由
|
|
1630
|
+
return (JSON.stringify(future.params) === JSON.stringify(curr.params) &&
|
|
1631
|
+
JSON.stringify(future.queryParams) ===
|
|
1632
|
+
JSON.stringify(curr.queryParams));
|
|
1633
|
+
}
|
|
1634
|
+
return true;
|
|
1635
|
+
}
|
|
1636
|
+
return false;
|
|
1632
1637
|
};
|
|
1633
1638
|
/**
|
|
1634
1639
|
* @param {?} route
|
|
@@ -2030,26 +2035,37 @@ if (false) {
|
|
|
2030
2035
|
*/
|
|
2031
2036
|
var RSHeaderComponent = /** @class */ (function () {
|
|
2032
2037
|
function RSHeaderComponent() {
|
|
2033
|
-
this.toggleMenu = new EventEmitter();
|
|
2034
2038
|
this.isCollapsed = false; // 接收输入属性
|
|
2035
2039
|
// 接收输入属性
|
|
2036
2040
|
this.lastLoginTime = new Date();
|
|
2037
|
-
this.
|
|
2038
|
-
|
|
2039
|
-
|
|
2040
|
-
text: "English",
|
|
2041
|
-
},
|
|
2042
|
-
{
|
|
2043
|
-
value: 2,
|
|
2044
|
-
text: "繁體中文",
|
|
2045
|
-
},
|
|
2046
|
-
{
|
|
2047
|
-
value: 3,
|
|
2048
|
-
text: "简体中文",
|
|
2049
|
-
},
|
|
2050
|
-
];
|
|
2051
|
-
this.currentLang = this.langOptions[0];
|
|
2041
|
+
this.toggleMenu = new EventEmitter();
|
|
2042
|
+
this.changeLanguage = new EventEmitter();
|
|
2043
|
+
this._langOptions = [];
|
|
2052
2044
|
}
|
|
2045
|
+
Object.defineProperty(RSHeaderComponent.prototype, "langOptions", {
|
|
2046
|
+
get: /**
|
|
2047
|
+
* @return {?}
|
|
2048
|
+
*/
|
|
2049
|
+
function () {
|
|
2050
|
+
return this._langOptions;
|
|
2051
|
+
},
|
|
2052
|
+
set: /**
|
|
2053
|
+
* @param {?} options
|
|
2054
|
+
* @return {?}
|
|
2055
|
+
*/
|
|
2056
|
+
function (options) {
|
|
2057
|
+
this._langOptions = options;
|
|
2058
|
+
if (options && options.length > 0) {
|
|
2059
|
+
this.currentLang = options.find((/**
|
|
2060
|
+
* @param {?} e
|
|
2061
|
+
* @return {?}
|
|
2062
|
+
*/
|
|
2063
|
+
function (e) { return e.defaultLang; }));
|
|
2064
|
+
}
|
|
2065
|
+
},
|
|
2066
|
+
enumerable: true,
|
|
2067
|
+
configurable: true
|
|
2068
|
+
});
|
|
2053
2069
|
/**
|
|
2054
2070
|
* @return {?}
|
|
2055
2071
|
*/
|
|
@@ -2057,7 +2073,7 @@ var RSHeaderComponent = /** @class */ (function () {
|
|
|
2057
2073
|
* @return {?}
|
|
2058
2074
|
*/
|
|
2059
2075
|
function () {
|
|
2060
|
-
this.translation = JSON.parse(localStorage.getItem("translation"));
|
|
2076
|
+
this.translation = JSON.parse(localStorage.getItem("translation")) || {};
|
|
2061
2077
|
};
|
|
2062
2078
|
/**
|
|
2063
2079
|
* @return {?}
|
|
@@ -2082,6 +2098,7 @@ var RSHeaderComponent = /** @class */ (function () {
|
|
|
2082
2098
|
* @return {?}
|
|
2083
2099
|
*/
|
|
2084
2100
|
function (item) { return item.text === event.item.text; }));
|
|
2101
|
+
this.changeLanguage.emit(this.currentLang.languageCode);
|
|
2085
2102
|
};
|
|
2086
2103
|
RSHeaderComponent.decorators = [
|
|
2087
2104
|
{ type: Component, args: [{
|
|
@@ -2091,25 +2108,32 @@ var RSHeaderComponent = /** @class */ (function () {
|
|
|
2091
2108
|
}] }
|
|
2092
2109
|
];
|
|
2093
2110
|
RSHeaderComponent.propDecorators = {
|
|
2094
|
-
toggleMenu: [{ type: Output }],
|
|
2095
2111
|
isCollapsed: [{ type: Input }],
|
|
2096
|
-
lastLoginTime: [{ type: Input }]
|
|
2112
|
+
lastLoginTime: [{ type: Input }],
|
|
2113
|
+
langOptions: [{ type: Input }],
|
|
2114
|
+
toggleMenu: [{ type: Output }],
|
|
2115
|
+
changeLanguage: [{ type: Output }]
|
|
2097
2116
|
};
|
|
2098
2117
|
return RSHeaderComponent;
|
|
2099
2118
|
}());
|
|
2100
2119
|
if (false) {
|
|
2101
|
-
/** @type {?} */
|
|
2102
|
-
RSHeaderComponent.prototype.toggleMenu;
|
|
2103
2120
|
/** @type {?} */
|
|
2104
2121
|
RSHeaderComponent.prototype.isCollapsed;
|
|
2105
2122
|
/** @type {?} */
|
|
2106
2123
|
RSHeaderComponent.prototype.lastLoginTime;
|
|
2107
2124
|
/** @type {?} */
|
|
2108
|
-
RSHeaderComponent.prototype.
|
|
2125
|
+
RSHeaderComponent.prototype.toggleMenu;
|
|
2109
2126
|
/** @type {?} */
|
|
2110
|
-
RSHeaderComponent.prototype.
|
|
2127
|
+
RSHeaderComponent.prototype.changeLanguage;
|
|
2128
|
+
/**
|
|
2129
|
+
* @type {?}
|
|
2130
|
+
* @private
|
|
2131
|
+
*/
|
|
2132
|
+
RSHeaderComponent.prototype._langOptions;
|
|
2111
2133
|
/** @type {?} */
|
|
2112
2134
|
RSHeaderComponent.prototype.currentLang;
|
|
2135
|
+
/** @type {?} */
|
|
2136
|
+
RSHeaderComponent.prototype.translation;
|
|
2113
2137
|
}
|
|
2114
2138
|
|
|
2115
2139
|
/**
|
|
@@ -2212,7 +2236,7 @@ var RSAsideComponent = /** @class */ (function () {
|
|
|
2212
2236
|
this.isCollapsed = false; // 接收输入属性
|
|
2213
2237
|
// 接收输入属性
|
|
2214
2238
|
this.navList = [];
|
|
2215
|
-
this.currentNav =
|
|
2239
|
+
this.currentNav = "";
|
|
2216
2240
|
}
|
|
2217
2241
|
/**
|
|
2218
2242
|
* @return {?}
|
|
@@ -2220,7 +2244,22 @@ var RSAsideComponent = /** @class */ (function () {
|
|
|
2220
2244
|
RSAsideComponent.prototype.ngOnInit = /**
|
|
2221
2245
|
* @return {?}
|
|
2222
2246
|
*/
|
|
2223
|
-
function () {
|
|
2247
|
+
function () {
|
|
2248
|
+
var _this = this;
|
|
2249
|
+
// 监听路由变化
|
|
2250
|
+
this.router.events
|
|
2251
|
+
.pipe(filter((/**
|
|
2252
|
+
* @param {?} event
|
|
2253
|
+
* @return {?}
|
|
2254
|
+
*/
|
|
2255
|
+
function (event) { return event instanceof NavigationEnd; })))
|
|
2256
|
+
.subscribe((/**
|
|
2257
|
+
* @return {?}
|
|
2258
|
+
*/
|
|
2259
|
+
function () {
|
|
2260
|
+
_this.currentNav = _this.router.url;
|
|
2261
|
+
}));
|
|
2262
|
+
};
|
|
2224
2263
|
/**
|
|
2225
2264
|
* @param {?} item
|
|
2226
2265
|
* @return {?}
|
|
@@ -2230,8 +2269,8 @@ var RSAsideComponent = /** @class */ (function () {
|
|
|
2230
2269
|
* @return {?}
|
|
2231
2270
|
*/
|
|
2232
2271
|
function (item) {
|
|
2233
|
-
this.currentNav = item.
|
|
2234
|
-
this.router.navigate([item.url], { state: { title: item.
|
|
2272
|
+
this.currentNav = item.url;
|
|
2273
|
+
this.router.navigate([item.url], { state: { title: item.label } });
|
|
2235
2274
|
/** @type {?} */
|
|
2236
2275
|
var screenWidth = window.innerWidth;
|
|
2237
2276
|
if (screenWidth <= 992 && this.isCollapsed) {
|
|
@@ -2241,7 +2280,7 @@ var RSAsideComponent = /** @class */ (function () {
|
|
|
2241
2280
|
RSAsideComponent.decorators = [
|
|
2242
2281
|
{ type: Component, args: [{
|
|
2243
2282
|
selector: "rs-aside",
|
|
2244
|
-
template: "<div class=\"rs-aside\" [ngClass]=\"{ isCollapsed: isCollapsed }\">\r\n <div class=\"nav-list\">\r\n <div\r\n class=\"nav-item\"\r\n [ngClass]=\"{ isCurrent: currentNav === nav.
|
|
2283
|
+
template: "<div class=\"rs-aside\" [ngClass]=\"{ isCollapsed: isCollapsed }\">\r\n <div class=\"nav-list\">\r\n <div\r\n class=\"nav-item\"\r\n [ngClass]=\"{ isCurrent: currentNav === nav.url }\"\r\n *ngFor=\"let nav of navList\"\r\n (click)=\"onNavClick(nav)\"\r\n >\r\n <div class=\"nav-item-inner\">\r\n <mat-icon class=\"menu-icon\" [svgIcon]=\"nav.iconCode\"></mat-icon>\r\n <span class=\"nav-text\" [ngClass]=\"{ isCollapsed: isCollapsed }\">{{\r\n nav.label\r\n }}</span>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"bottom-iconbox\" [ngClass]=\"{ isCollapsed: isCollapsed }\">\r\n <ng-content select=\"[bottomIconBox]\"></ng-content>\r\n </div>\r\n</div>\r\n",
|
|
2245
2284
|
styles: [".rs-aside{display:flex;flex-direction:column;height:100%;width:240px;will-change:width;transition:width .3s;padding-right:16px}.rs-aside.isCollapsed{width:64px;padding-right:0}.rs-aside .nav-list{padding-top:12px;flex:1;overflow:auto;height:0}.rs-aside .nav-list .nav-item{height:32px;cursor:pointer;padding-left:11px}.rs-aside .nav-list .nav-item .nav-item-inner{display:flex;align-items:center;padding:8px 8px 8px 12px}.rs-aside .nav-list .nav-item .nav-item-inner ::ng-deep .menu-icon{width:33px;height:16px}.rs-aside .nav-list .nav-item .nav-item-inner ::ng-deep .menu-icon svg{width:16px;height:16px;color:#6c7c90;stroke:#6c7c90}.rs-aside .nav-list .nav-item:hover .nav-item-inner{border-radius:6px;background:rgba(31,123,255,.04)}.rs-aside .nav-list .nav-item:hover .nav-item-inner ::ng-deep .menu-icon svg{color:#44566c;stroke:#44566c}.rs-aside .nav-list .nav-item .nav-text{color:#5f6f81;font-family:Arial;font-size:12px;font-weight:400;line-height:16px;transition:.3s;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;position:relative;top:1px}@media (min-width:992px){.rs-aside .nav-list .nav-item .nav-text.isCollapsed{opacity:0;width:0}}.rs-aside .nav-list .nav-item.isCurrent{position:relative}.rs-aside .nav-list .nav-item.isCurrent .nav-text{color:#44566c;font-weight:700}.rs-aside .nav-list .nav-item.isCurrent::before{content:\"\";position:absolute;left:4px;top:8px;width:3px;height:16px;background-color:#1364b3;border-radius:2px}.rs-aside .bottom-iconbox{padding:12px 20px;height:48px;display:flex;gap:12px}.rs-aside .bottom-iconbox ::ng-deep .menu-bottom-icon{width:24px;height:24px;display:flex;justify-content:center;align-items:center;border:1px solid #eaedf0;border-radius:24px;cursor:pointer}.rs-aside .bottom-iconbox ::ng-deep .menu-bottom-icon svg{width:16px;height:16px;color:#6c7c90;stroke:#6c7c90}.rs-aside .bottom-iconbox ::ng-deep .menu-bottom-icon.disabled{cursor:default;opacity:.5}.rs-aside .bottom-iconbox ::ng-deep .menu-bottom-icon:not(.disabled):hover{background-color:#fff}.rs-aside .bottom-iconbox ::ng-deep .menu-bottom-icon:not(.disabled):hover svg{color:#1f7bff;stroke:#1f7bff}@media (min-width:992px){.rs-aside .bottom-iconbox.isCollapsed{flex-direction:column;height:auto}}@media (max-width:992px){.rs-aside{width:0;overflow:hidden;position:absolute;height:calc(100% - 50px);z-index:10;background-color:var(--rs-container-bg);padding-right:0}.rs-aside.isCollapsed{width:240px;padding-right:16px}}"]
|
|
2246
2285
|
}] }
|
|
2247
2286
|
];
|
|
@@ -2840,7 +2879,7 @@ var CommonDeleteComponent = /** @class */ (function () {
|
|
|
2840
2879
|
* @return {?}
|
|
2841
2880
|
*/
|
|
2842
2881
|
function () {
|
|
2843
|
-
this.translation = JSON.parse(localStorage.getItem("translation"));
|
|
2882
|
+
this.translation = JSON.parse(localStorage.getItem("translation")) || {};
|
|
2844
2883
|
this.title =
|
|
2845
2884
|
this.data.title || this.translation["DELETE_RECORD"] || ".DELETE_RECORD";
|
|
2846
2885
|
this.saveBtnLabel =
|
|
@@ -2924,7 +2963,7 @@ var DialogService = /** @class */ (function () {
|
|
|
2924
2963
|
* @param dialog: MatDialog
|
|
2925
2964
|
*/
|
|
2926
2965
|
this.translation = null;
|
|
2927
|
-
this.translation = JSON.parse(localStorage.getItem("translation"));
|
|
2966
|
+
this.translation = JSON.parse(localStorage.getItem("translation")) || {};
|
|
2928
2967
|
}
|
|
2929
2968
|
/**
|
|
2930
2969
|
* @param {?} config
|
|
@@ -3224,7 +3263,7 @@ var CommonDialogComponent = /** @class */ (function () {
|
|
|
3224
3263
|
* @return {?}
|
|
3225
3264
|
*/
|
|
3226
3265
|
function () {
|
|
3227
|
-
this.translation = JSON.parse(localStorage.getItem("translation"));
|
|
3266
|
+
this.translation = JSON.parse(localStorage.getItem("translation")) || {};
|
|
3228
3267
|
this.saveBtnLabel =
|
|
3229
3268
|
this.saveBtnLabel || this.translation.SAVE || ".SAVE";
|
|
3230
3269
|
this.cancelBtnLabel =
|