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