raise-common-lib 0.0.48 → 0.0.51
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 +79 -33
- 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/form/drawer-form/drawer-form.component.js +22 -1
- package/esm2015/lib/layout/drawer/index.component.js +37 -24
- package/esm2015/lib/layout/multi-tab/index.component.js +4 -2
- package/esm2015/lib/service/drawer.service.js +1 -1
- package/esm2015/lib/service/keep-alive.service.js +4 -7
- package/esm5/lib/form/drawer-form/drawer-form.component.js +29 -1
- package/esm5/lib/layout/drawer/index.component.js +46 -27
- package/esm5/lib/layout/multi-tab/index.component.js +4 -2
- package/esm5/lib/service/drawer.service.js +1 -1
- package/esm5/lib/service/keep-alive.service.js +4 -7
- package/fesm2015/raise-common-lib.js +63 -30
- package/fesm2015/raise-common-lib.js.map +1 -1
- package/fesm5/raise-common-lib.js +79 -33
- package/fesm5/raise-common-lib.js.map +1 -1
- package/lib/form/drawer-form/drawer-form.component.d.ts +1 -0
- package/lib/layout/drawer/index.component.d.ts +12 -4
- package/lib/service/drawer.service.d.ts +1 -0
- package/package.json +1 -1
- package/raise-common-lib.metadata.json +1 -1
|
@@ -1984,7 +1984,9 @@ var MultiTabComponent = /** @class */ (function () {
|
|
|
1984
1984
|
if (_this.noGenerateTabUrls.includes(_this.router.url)) {
|
|
1985
1985
|
return; // 排除不生成tab的url
|
|
1986
1986
|
}
|
|
1987
|
-
|
|
1987
|
+
/** @type {?} */
|
|
1988
|
+
var urlWithoutQuery = _this.router.url.split('?')[0];
|
|
1989
|
+
_this.setTab(urlWithoutQuery, currentRoute.snapshot.routeConfig.path, title);
|
|
1988
1990
|
}
|
|
1989
1991
|
}
|
|
1990
1992
|
})));
|
|
@@ -2339,7 +2341,6 @@ var DrawerComponent = /** @class */ (function () {
|
|
|
2339
2341
|
this.config = DefaultDrawerConfig;
|
|
2340
2342
|
this.useTransition = "yes";
|
|
2341
2343
|
this.$isOpened = new BehaviorSubject(false);
|
|
2342
|
-
this.showToolbarContainer = true;
|
|
2343
2344
|
this.componentRefMap = new Map();
|
|
2344
2345
|
}
|
|
2345
2346
|
/**
|
|
@@ -2404,39 +2405,53 @@ var DrawerComponent = /** @class */ (function () {
|
|
|
2404
2405
|
/**
|
|
2405
2406
|
* @private
|
|
2406
2407
|
* @param {?} componentRef
|
|
2408
|
+
* @param {?} selector
|
|
2407
2409
|
* @return {?}
|
|
2408
2410
|
*/
|
|
2409
|
-
DrawerComponent.prototype.
|
|
2411
|
+
DrawerComponent.prototype.getSlotElement = /**
|
|
2410
2412
|
* @private
|
|
2411
2413
|
* @param {?} componentRef
|
|
2414
|
+
* @param {?} selector
|
|
2412
2415
|
* @return {?}
|
|
2413
2416
|
*/
|
|
2414
|
-
function (componentRef) {
|
|
2417
|
+
function (componentRef, selector) {
|
|
2415
2418
|
/** @type {?} */
|
|
2416
2419
|
var componentEl = componentRef.location.nativeElement;
|
|
2417
|
-
/** @type {?} */
|
|
2418
|
-
var toolbarEl = componentEl.querySelector("[drawer-toolbar]");
|
|
2419
|
-
return toolbarEl;
|
|
2420
|
+
return (/** @type {?} */ (componentEl.querySelector(selector)));
|
|
2420
2421
|
};
|
|
2421
2422
|
/**
|
|
2422
2423
|
* @private
|
|
2423
|
-
* @param {?}
|
|
2424
|
+
* @param {?} slotEl
|
|
2425
|
+
* @param {?} containerEl
|
|
2424
2426
|
* @return {?}
|
|
2425
2427
|
*/
|
|
2426
|
-
DrawerComponent.prototype.
|
|
2428
|
+
DrawerComponent.prototype.setSlotElement = /**
|
|
2427
2429
|
* @private
|
|
2428
|
-
* @param {?}
|
|
2430
|
+
* @param {?} slotEl
|
|
2431
|
+
* @param {?} containerEl
|
|
2429
2432
|
* @return {?}
|
|
2430
2433
|
*/
|
|
2431
|
-
function (
|
|
2432
|
-
|
|
2433
|
-
|
|
2434
|
-
|
|
2435
|
-
this.showToolbarContainer = !!toolbarEl;
|
|
2436
|
-
if (toolbarEl) {
|
|
2437
|
-
toolbarContainerEl.append(toolbarEl);
|
|
2434
|
+
function (slotEl, containerEl) {
|
|
2435
|
+
containerEl.innerHTML = "";
|
|
2436
|
+
if (slotEl) {
|
|
2437
|
+
containerEl.append(slotEl);
|
|
2438
2438
|
}
|
|
2439
2439
|
};
|
|
2440
|
+
/**
|
|
2441
|
+
* @param {?} cache
|
|
2442
|
+
* @return {?}
|
|
2443
|
+
*/
|
|
2444
|
+
DrawerComponent.prototype.setCache = /**
|
|
2445
|
+
* @param {?} cache
|
|
2446
|
+
* @return {?}
|
|
2447
|
+
*/
|
|
2448
|
+
function (cache) {
|
|
2449
|
+
this.setSlotElement(cache.toolbarEl, this.toolbar.nativeElement);
|
|
2450
|
+
this.setSlotElement(cache.headerEl, this.header.nativeElement);
|
|
2451
|
+
/** @type {?} */
|
|
2452
|
+
var drawerTop = cache.config.top ? cache.config.top + "px" : "";
|
|
2453
|
+
this.element.nativeElement.style.setProperty("--drawer-top", drawerTop);
|
|
2454
|
+
};
|
|
2440
2455
|
/**
|
|
2441
2456
|
* @template T
|
|
2442
2457
|
* @param {?} component
|
|
@@ -2457,14 +2472,19 @@ var DrawerComponent = /** @class */ (function () {
|
|
|
2457
2472
|
/** @type {?} */
|
|
2458
2473
|
var componentRef = this.createDynamicComponent(component);
|
|
2459
2474
|
/** @type {?} */
|
|
2460
|
-
var toolbarEl = this.
|
|
2461
|
-
|
|
2462
|
-
this.
|
|
2463
|
-
|
|
2475
|
+
var toolbarEl = this.getSlotElement(componentRef, "[drawer-toolbar]");
|
|
2476
|
+
/** @type {?} */
|
|
2477
|
+
var headerEl = this.getSlotElement(componentRef, "[drawer-header]");
|
|
2478
|
+
/** @type {?} */
|
|
2479
|
+
var cache = {
|
|
2464
2480
|
config: showConfig,
|
|
2465
2481
|
ref: componentRef,
|
|
2466
2482
|
toolbarEl: toolbarEl,
|
|
2467
|
-
|
|
2483
|
+
headerEl: headerEl,
|
|
2484
|
+
};
|
|
2485
|
+
this.setComponentData(componentRef, data);
|
|
2486
|
+
this.componentRefMap.set(this.service.cacheKey, cache);
|
|
2487
|
+
this.setCache(cache);
|
|
2468
2488
|
this.config = showConfig;
|
|
2469
2489
|
this.$isOpened.next(true);
|
|
2470
2490
|
this.useTransition = "yes";
|
|
@@ -2525,7 +2545,7 @@ var DrawerComponent = /** @class */ (function () {
|
|
|
2525
2545
|
if (cache) {
|
|
2526
2546
|
cache.ref.location.nativeElement.style.display = "";
|
|
2527
2547
|
this.config = cache.config;
|
|
2528
|
-
this.
|
|
2548
|
+
this.setCache(cache);
|
|
2529
2549
|
this.$isOpened.next(true);
|
|
2530
2550
|
}
|
|
2531
2551
|
else {
|
|
@@ -2536,8 +2556,8 @@ var DrawerComponent = /** @class */ (function () {
|
|
|
2536
2556
|
DrawerComponent.decorators = [
|
|
2537
2557
|
{ type: Component, args: [{
|
|
2538
2558
|
selector: "rs-drawer",
|
|
2539
|
-
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 class=\"rs-drawer\"\r\n [attr.data-mode]=\"config.mode\"\r\n [attr.data-opened]=\"($isOpened | async) ? 'yes' : 'no'\"\r\n [attr.data-transition]=\"useTransition\"\r\n >\r\n <div class=\"drawer-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>\r\n <div class=\"drawer-content\">\r\n <div class=\"drawer-content-container\">\r\n <ng-template #dynamicComponentContainer></ng-template>\r\n </div>\r\n </div>\r\n <div
|
|
2540
|
-
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;top:0;left:100%}.rs-drawer-container .rs-drawer[data-opened=yes]{left:0;opacity:1
|
|
2559
|
+
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 class=\"rs-drawer\"\r\n [attr.data-mode]=\"config.mode\"\r\n [attr.data-opened]=\"($isOpened | async) ? 'yes' : 'no'\"\r\n [attr.data-transition]=\"useTransition\"\r\n >\r\n <div class=\"drawer-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\" #header></div>\r\n </div>\r\n <div class=\"drawer-content\">\r\n <div class=\"drawer-content-container\">\r\n <ng-template #dynamicComponentContainer></ng-template>\r\n </div>\r\n </div>\r\n <div class=\"drawer-toolbar-slot\" #toolbar></div>\r\n </div>\r\n</div>\r\n",
|
|
2560
|
+
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;top:0;left:100%}.rs-drawer-container .rs-drawer[data-opened=yes]{left:0;opacity:1}.rs-drawer-container .rs-drawer[data-transition=yes]{transition:opacity .5s ease-in-out,left .5s ease-in-out}.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;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-header-slot{margin-left:20px}.rs-drawer-container .rs-drawer .drawer-content{flex:auto;overflow:hidden;pointer-events:auto}.rs-drawer-container .rs-drawer .drawer-content .drawer-content-container{height:100%;overflow:hidden auto}.rs-drawer-container .rs-drawer .drawer-toolbar-slot{flex:none;height:32px;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[data-mode=inner],.rs-drawer-container .rs-drawer[data-mode=outer] .drawer-content{padding:0 20px;border:1px solid #ebedf0;border-radius:15px;background-color:#fff}.rs-drawer-container .rs-drawer[data-mode=outer]{margin-top:var(--drawer-top,0);background-color:#f8fafb}.rs-drawer-container .rs-drawer[data-mode=outer] .drawer-header{height:46px;padding:0 24px 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=outer] .drawer-toolbar-slot{position:absolute;top:7px;right:0;z-index:1}.rs-drawer-container .rs-drawer[data-mode=inner]{height:calc(100% - var(--drawer-top,16px));margin-top:var(--drawer-top,16px);box-shadow:0 min(0,var(--drawer-top,-16px)) #f8fafb}.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{padding:0 20px 0 8px}.rs-drawer-container .rs-drawer[data-mode=inner] .drawer-content .drawer-content-container{margin-right:-20px;padding-right:20px}.rs-drawer-container .rs-drawer[data-mode=inner] .drawer-toolbar-slot{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}"]
|
|
2541
2561
|
}] }
|
|
2542
2562
|
];
|
|
2543
2563
|
/** @nocollapse */
|
|
@@ -2548,6 +2568,7 @@ var DrawerComponent = /** @class */ (function () {
|
|
|
2548
2568
|
DrawerComponent.propDecorators = {
|
|
2549
2569
|
element: [{ type: ViewChild, args: ["element", { static: false },] }],
|
|
2550
2570
|
toolbar: [{ type: ViewChild, args: ["toolbar", { static: false },] }],
|
|
2571
|
+
header: [{ type: ViewChild, args: ["header", { static: false },] }],
|
|
2551
2572
|
container: [{ type: ViewChild, args: ["dynamicComponentContainer", {
|
|
2552
2573
|
read: ViewContainerRef,
|
|
2553
2574
|
static: false,
|
|
@@ -2560,6 +2581,8 @@ if (false) {
|
|
|
2560
2581
|
DrawerComponent.prototype.element;
|
|
2561
2582
|
/** @type {?} */
|
|
2562
2583
|
DrawerComponent.prototype.toolbar;
|
|
2584
|
+
/** @type {?} */
|
|
2585
|
+
DrawerComponent.prototype.header;
|
|
2563
2586
|
/**
|
|
2564
2587
|
* @type {?}
|
|
2565
2588
|
* @private
|
|
@@ -2571,8 +2594,6 @@ if (false) {
|
|
|
2571
2594
|
DrawerComponent.prototype.useTransition;
|
|
2572
2595
|
/** @type {?} */
|
|
2573
2596
|
DrawerComponent.prototype.$isOpened;
|
|
2574
|
-
/** @type {?} */
|
|
2575
|
-
DrawerComponent.prototype.showToolbarContainer;
|
|
2576
2597
|
/**
|
|
2577
2598
|
* @type {?}
|
|
2578
2599
|
* @private
|
|
@@ -20098,6 +20119,9 @@ var DrawerFormComponent = /** @class */ (function () {
|
|
|
20098
20119
|
if (changes.sections) {
|
|
20099
20120
|
this.formatForm(changes.sections.currentValue);
|
|
20100
20121
|
}
|
|
20122
|
+
if (changes.form && !changes.form.firstChange) {
|
|
20123
|
+
this.checkFormChange(changes.form.previousValue, changes.form.currentValue);
|
|
20124
|
+
}
|
|
20101
20125
|
};
|
|
20102
20126
|
/**
|
|
20103
20127
|
* @return {?}
|
|
@@ -20202,6 +20226,31 @@ var DrawerFormComponent = /** @class */ (function () {
|
|
|
20202
20226
|
}));
|
|
20203
20227
|
}
|
|
20204
20228
|
};
|
|
20229
|
+
/**
|
|
20230
|
+
* @param {?} previous
|
|
20231
|
+
* @param {?} current
|
|
20232
|
+
* @return {?}
|
|
20233
|
+
*/
|
|
20234
|
+
DrawerFormComponent.prototype.checkFormChange = /**
|
|
20235
|
+
* @param {?} previous
|
|
20236
|
+
* @param {?} current
|
|
20237
|
+
* @return {?}
|
|
20238
|
+
*/
|
|
20239
|
+
function (previous, current) {
|
|
20240
|
+
var _this = this;
|
|
20241
|
+
Object.entries(current).forEach((/**
|
|
20242
|
+
* @param {?} __0
|
|
20243
|
+
* @return {?}
|
|
20244
|
+
*/
|
|
20245
|
+
function (_a) {
|
|
20246
|
+
var _b = __read(_a, 2), key = _b[0], currentValue = _b[1];
|
|
20247
|
+
if (previous[key] !== currentValue) {
|
|
20248
|
+
/** @type {?} */
|
|
20249
|
+
var field = _this.getField(key);
|
|
20250
|
+
_this.formItemValidator(field);
|
|
20251
|
+
}
|
|
20252
|
+
}));
|
|
20253
|
+
};
|
|
20205
20254
|
/**
|
|
20206
20255
|
* @param {?} sections
|
|
20207
20256
|
* @return {?}
|
|
@@ -21301,9 +21350,7 @@ var KeepAliveService = /** @class */ (function () {
|
|
|
21301
21350
|
if (future.routeConfig === curr.routeConfig) {
|
|
21302
21351
|
if (future.children.length === 0 && curr.children.length === 0) {
|
|
21303
21352
|
// 无子路由时, 通过params和queryParams判断是否复用路由
|
|
21304
|
-
return (JSON.stringify(future.params) === JSON.stringify(curr.params)
|
|
21305
|
-
JSON.stringify(future.queryParams) ===
|
|
21306
|
-
JSON.stringify(curr.queryParams));
|
|
21353
|
+
return (JSON.stringify(future.params) === JSON.stringify(curr.params));
|
|
21307
21354
|
}
|
|
21308
21355
|
return true;
|
|
21309
21356
|
}
|
|
@@ -21320,15 +21367,14 @@ var KeepAliveService = /** @class */ (function () {
|
|
|
21320
21367
|
function (route) {
|
|
21321
21368
|
if (route.routeConfig) {
|
|
21322
21369
|
// const pathParams = JSON.stringify(route.params);
|
|
21323
|
-
|
|
21324
|
-
var queryParams = new URLSearchParams(route.queryParams).toString();
|
|
21370
|
+
// const queryParams = new URLSearchParams(route.queryParams).toString();
|
|
21325
21371
|
/** @type {?} */
|
|
21326
21372
|
var url = route._urlSegment.segments.map((/**
|
|
21327
21373
|
* @param {?} v
|
|
21328
21374
|
* @return {?}
|
|
21329
21375
|
*/
|
|
21330
21376
|
function (v) { return v.path; })).join("/");
|
|
21331
|
-
return "/" + url
|
|
21377
|
+
return "/" + url;
|
|
21332
21378
|
}
|
|
21333
21379
|
return "";
|
|
21334
21380
|
};
|