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
|
@@ -2179,7 +2179,9 @@
|
|
|
2179
2179
|
if (_this.noGenerateTabUrls.includes(_this.router.url)) {
|
|
2180
2180
|
return; // 排除不生成tab的url
|
|
2181
2181
|
}
|
|
2182
|
-
|
|
2182
|
+
/** @type {?} */
|
|
2183
|
+
var urlWithoutQuery = _this.router.url.split('?')[0];
|
|
2184
|
+
_this.setTab(urlWithoutQuery, currentRoute.snapshot.routeConfig.path, title);
|
|
2183
2185
|
}
|
|
2184
2186
|
}
|
|
2185
2187
|
})));
|
|
@@ -2534,7 +2536,6 @@
|
|
|
2534
2536
|
this.config = DefaultDrawerConfig;
|
|
2535
2537
|
this.useTransition = "yes";
|
|
2536
2538
|
this.$isOpened = new rxjs.BehaviorSubject(false);
|
|
2537
|
-
this.showToolbarContainer = true;
|
|
2538
2539
|
this.componentRefMap = new Map();
|
|
2539
2540
|
}
|
|
2540
2541
|
/**
|
|
@@ -2599,39 +2600,53 @@
|
|
|
2599
2600
|
/**
|
|
2600
2601
|
* @private
|
|
2601
2602
|
* @param {?} componentRef
|
|
2603
|
+
* @param {?} selector
|
|
2602
2604
|
* @return {?}
|
|
2603
2605
|
*/
|
|
2604
|
-
DrawerComponent.prototype.
|
|
2606
|
+
DrawerComponent.prototype.getSlotElement = /**
|
|
2605
2607
|
* @private
|
|
2606
2608
|
* @param {?} componentRef
|
|
2609
|
+
* @param {?} selector
|
|
2607
2610
|
* @return {?}
|
|
2608
2611
|
*/
|
|
2609
|
-
function (componentRef) {
|
|
2612
|
+
function (componentRef, selector) {
|
|
2610
2613
|
/** @type {?} */
|
|
2611
2614
|
var componentEl = componentRef.location.nativeElement;
|
|
2612
|
-
/** @type {?} */
|
|
2613
|
-
var toolbarEl = componentEl.querySelector("[drawer-toolbar]");
|
|
2614
|
-
return toolbarEl;
|
|
2615
|
+
return (/** @type {?} */ (componentEl.querySelector(selector)));
|
|
2615
2616
|
};
|
|
2616
2617
|
/**
|
|
2617
2618
|
* @private
|
|
2618
|
-
* @param {?}
|
|
2619
|
+
* @param {?} slotEl
|
|
2620
|
+
* @param {?} containerEl
|
|
2619
2621
|
* @return {?}
|
|
2620
2622
|
*/
|
|
2621
|
-
DrawerComponent.prototype.
|
|
2623
|
+
DrawerComponent.prototype.setSlotElement = /**
|
|
2622
2624
|
* @private
|
|
2623
|
-
* @param {?}
|
|
2625
|
+
* @param {?} slotEl
|
|
2626
|
+
* @param {?} containerEl
|
|
2624
2627
|
* @return {?}
|
|
2625
2628
|
*/
|
|
2626
|
-
function (
|
|
2627
|
-
|
|
2628
|
-
|
|
2629
|
-
|
|
2630
|
-
this.showToolbarContainer = !!toolbarEl;
|
|
2631
|
-
if (toolbarEl) {
|
|
2632
|
-
toolbarContainerEl.append(toolbarEl);
|
|
2629
|
+
function (slotEl, containerEl) {
|
|
2630
|
+
containerEl.innerHTML = "";
|
|
2631
|
+
if (slotEl) {
|
|
2632
|
+
containerEl.append(slotEl);
|
|
2633
2633
|
}
|
|
2634
2634
|
};
|
|
2635
|
+
/**
|
|
2636
|
+
* @param {?} cache
|
|
2637
|
+
* @return {?}
|
|
2638
|
+
*/
|
|
2639
|
+
DrawerComponent.prototype.setCache = /**
|
|
2640
|
+
* @param {?} cache
|
|
2641
|
+
* @return {?}
|
|
2642
|
+
*/
|
|
2643
|
+
function (cache) {
|
|
2644
|
+
this.setSlotElement(cache.toolbarEl, this.toolbar.nativeElement);
|
|
2645
|
+
this.setSlotElement(cache.headerEl, this.header.nativeElement);
|
|
2646
|
+
/** @type {?} */
|
|
2647
|
+
var drawerTop = cache.config.top ? cache.config.top + "px" : "";
|
|
2648
|
+
this.element.nativeElement.style.setProperty("--drawer-top", drawerTop);
|
|
2649
|
+
};
|
|
2635
2650
|
/**
|
|
2636
2651
|
* @template T
|
|
2637
2652
|
* @param {?} component
|
|
@@ -2652,14 +2667,19 @@
|
|
|
2652
2667
|
/** @type {?} */
|
|
2653
2668
|
var componentRef = this.createDynamicComponent(component);
|
|
2654
2669
|
/** @type {?} */
|
|
2655
|
-
var toolbarEl = this.
|
|
2656
|
-
|
|
2657
|
-
this.
|
|
2658
|
-
|
|
2670
|
+
var toolbarEl = this.getSlotElement(componentRef, "[drawer-toolbar]");
|
|
2671
|
+
/** @type {?} */
|
|
2672
|
+
var headerEl = this.getSlotElement(componentRef, "[drawer-header]");
|
|
2673
|
+
/** @type {?} */
|
|
2674
|
+
var cache = {
|
|
2659
2675
|
config: showConfig,
|
|
2660
2676
|
ref: componentRef,
|
|
2661
2677
|
toolbarEl: toolbarEl,
|
|
2662
|
-
|
|
2678
|
+
headerEl: headerEl,
|
|
2679
|
+
};
|
|
2680
|
+
this.setComponentData(componentRef, data);
|
|
2681
|
+
this.componentRefMap.set(this.service.cacheKey, cache);
|
|
2682
|
+
this.setCache(cache);
|
|
2663
2683
|
this.config = showConfig;
|
|
2664
2684
|
this.$isOpened.next(true);
|
|
2665
2685
|
this.useTransition = "yes";
|
|
@@ -2720,7 +2740,7 @@
|
|
|
2720
2740
|
if (cache) {
|
|
2721
2741
|
cache.ref.location.nativeElement.style.display = "";
|
|
2722
2742
|
this.config = cache.config;
|
|
2723
|
-
this.
|
|
2743
|
+
this.setCache(cache);
|
|
2724
2744
|
this.$isOpened.next(true);
|
|
2725
2745
|
}
|
|
2726
2746
|
else {
|
|
@@ -2731,8 +2751,8 @@
|
|
|
2731
2751
|
DrawerComponent.decorators = [
|
|
2732
2752
|
{ type: core.Component, args: [{
|
|
2733
2753
|
selector: "rs-drawer",
|
|
2734
|
-
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
|
|
2735
|
-
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
|
|
2754
|
+
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",
|
|
2755
|
+
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}"]
|
|
2736
2756
|
}] }
|
|
2737
2757
|
];
|
|
2738
2758
|
/** @nocollapse */
|
|
@@ -2743,6 +2763,7 @@
|
|
|
2743
2763
|
DrawerComponent.propDecorators = {
|
|
2744
2764
|
element: [{ type: core.ViewChild, args: ["element", { static: false },] }],
|
|
2745
2765
|
toolbar: [{ type: core.ViewChild, args: ["toolbar", { static: false },] }],
|
|
2766
|
+
header: [{ type: core.ViewChild, args: ["header", { static: false },] }],
|
|
2746
2767
|
container: [{ type: core.ViewChild, args: ["dynamicComponentContainer", {
|
|
2747
2768
|
read: core.ViewContainerRef,
|
|
2748
2769
|
static: false,
|
|
@@ -2755,6 +2776,8 @@
|
|
|
2755
2776
|
DrawerComponent.prototype.element;
|
|
2756
2777
|
/** @type {?} */
|
|
2757
2778
|
DrawerComponent.prototype.toolbar;
|
|
2779
|
+
/** @type {?} */
|
|
2780
|
+
DrawerComponent.prototype.header;
|
|
2758
2781
|
/**
|
|
2759
2782
|
* @type {?}
|
|
2760
2783
|
* @private
|
|
@@ -2766,8 +2789,6 @@
|
|
|
2766
2789
|
DrawerComponent.prototype.useTransition;
|
|
2767
2790
|
/** @type {?} */
|
|
2768
2791
|
DrawerComponent.prototype.$isOpened;
|
|
2769
|
-
/** @type {?} */
|
|
2770
|
-
DrawerComponent.prototype.showToolbarContainer;
|
|
2771
2792
|
/**
|
|
2772
2793
|
* @type {?}
|
|
2773
2794
|
* @private
|
|
@@ -20293,6 +20314,9 @@
|
|
|
20293
20314
|
if (changes.sections) {
|
|
20294
20315
|
this.formatForm(changes.sections.currentValue);
|
|
20295
20316
|
}
|
|
20317
|
+
if (changes.form && !changes.form.firstChange) {
|
|
20318
|
+
this.checkFormChange(changes.form.previousValue, changes.form.currentValue);
|
|
20319
|
+
}
|
|
20296
20320
|
};
|
|
20297
20321
|
/**
|
|
20298
20322
|
* @return {?}
|
|
@@ -20397,6 +20421,31 @@
|
|
|
20397
20421
|
}));
|
|
20398
20422
|
}
|
|
20399
20423
|
};
|
|
20424
|
+
/**
|
|
20425
|
+
* @param {?} previous
|
|
20426
|
+
* @param {?} current
|
|
20427
|
+
* @return {?}
|
|
20428
|
+
*/
|
|
20429
|
+
DrawerFormComponent.prototype.checkFormChange = /**
|
|
20430
|
+
* @param {?} previous
|
|
20431
|
+
* @param {?} current
|
|
20432
|
+
* @return {?}
|
|
20433
|
+
*/
|
|
20434
|
+
function (previous, current) {
|
|
20435
|
+
var _this = this;
|
|
20436
|
+
Object.entries(current).forEach((/**
|
|
20437
|
+
* @param {?} __0
|
|
20438
|
+
* @return {?}
|
|
20439
|
+
*/
|
|
20440
|
+
function (_a) {
|
|
20441
|
+
var _b = __read(_a, 2), key = _b[0], currentValue = _b[1];
|
|
20442
|
+
if (previous[key] !== currentValue) {
|
|
20443
|
+
/** @type {?} */
|
|
20444
|
+
var field = _this.getField(key);
|
|
20445
|
+
_this.formItemValidator(field);
|
|
20446
|
+
}
|
|
20447
|
+
}));
|
|
20448
|
+
};
|
|
20400
20449
|
/**
|
|
20401
20450
|
* @param {?} sections
|
|
20402
20451
|
* @return {?}
|
|
@@ -21496,9 +21545,7 @@
|
|
|
21496
21545
|
if (future.routeConfig === curr.routeConfig) {
|
|
21497
21546
|
if (future.children.length === 0 && curr.children.length === 0) {
|
|
21498
21547
|
// 无子路由时, 通过params和queryParams判断是否复用路由
|
|
21499
|
-
return (JSON.stringify(future.params) === JSON.stringify(curr.params)
|
|
21500
|
-
JSON.stringify(future.queryParams) ===
|
|
21501
|
-
JSON.stringify(curr.queryParams));
|
|
21548
|
+
return (JSON.stringify(future.params) === JSON.stringify(curr.params));
|
|
21502
21549
|
}
|
|
21503
21550
|
return true;
|
|
21504
21551
|
}
|
|
@@ -21515,15 +21562,14 @@
|
|
|
21515
21562
|
function (route) {
|
|
21516
21563
|
if (route.routeConfig) {
|
|
21517
21564
|
// const pathParams = JSON.stringify(route.params);
|
|
21518
|
-
|
|
21519
|
-
var queryParams = new URLSearchParams(route.queryParams).toString();
|
|
21565
|
+
// const queryParams = new URLSearchParams(route.queryParams).toString();
|
|
21520
21566
|
/** @type {?} */
|
|
21521
21567
|
var url = route._urlSegment.segments.map((/**
|
|
21522
21568
|
* @param {?} v
|
|
21523
21569
|
* @return {?}
|
|
21524
21570
|
*/
|
|
21525
21571
|
function (v) { return v.path; })).join("/");
|
|
21526
|
-
return "/" + url
|
|
21572
|
+
return "/" + url;
|
|
21527
21573
|
}
|
|
21528
21574
|
return "";
|
|
21529
21575
|
};
|