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
|
@@ -1993,7 +1993,6 @@ class DrawerComponent {
|
|
|
1993
1993
|
this.config = DefaultDrawerConfig;
|
|
1994
1994
|
this.useTransition = "yes";
|
|
1995
1995
|
this.$isOpened = new BehaviorSubject(false);
|
|
1996
|
-
this.showToolbarContainer = true;
|
|
1997
1996
|
this.componentRefMap = new Map();
|
|
1998
1997
|
}
|
|
1999
1998
|
/**
|
|
@@ -2040,29 +2039,37 @@ class DrawerComponent {
|
|
|
2040
2039
|
/**
|
|
2041
2040
|
* @private
|
|
2042
2041
|
* @param {?} componentRef
|
|
2042
|
+
* @param {?} selector
|
|
2043
2043
|
* @return {?}
|
|
2044
2044
|
*/
|
|
2045
|
-
|
|
2045
|
+
getSlotElement(componentRef, selector) {
|
|
2046
2046
|
/** @type {?} */
|
|
2047
2047
|
const componentEl = componentRef.location.nativeElement;
|
|
2048
|
-
/** @type {?} */
|
|
2049
|
-
const toolbarEl = componentEl.querySelector("[drawer-toolbar]");
|
|
2050
|
-
return toolbarEl;
|
|
2048
|
+
return (/** @type {?} */ (componentEl.querySelector(selector)));
|
|
2051
2049
|
}
|
|
2052
2050
|
/**
|
|
2053
2051
|
* @private
|
|
2054
|
-
* @param {?}
|
|
2052
|
+
* @param {?} slotEl
|
|
2053
|
+
* @param {?} containerEl
|
|
2055
2054
|
* @return {?}
|
|
2056
2055
|
*/
|
|
2057
|
-
|
|
2058
|
-
|
|
2059
|
-
|
|
2060
|
-
|
|
2061
|
-
this.showToolbarContainer = !!toolbarEl;
|
|
2062
|
-
if (toolbarEl) {
|
|
2063
|
-
toolbarContainerEl.append(toolbarEl);
|
|
2056
|
+
setSlotElement(slotEl, containerEl) {
|
|
2057
|
+
containerEl.innerHTML = "";
|
|
2058
|
+
if (slotEl) {
|
|
2059
|
+
containerEl.append(slotEl);
|
|
2064
2060
|
}
|
|
2065
2061
|
}
|
|
2062
|
+
/**
|
|
2063
|
+
* @param {?} cache
|
|
2064
|
+
* @return {?}
|
|
2065
|
+
*/
|
|
2066
|
+
setCache(cache) {
|
|
2067
|
+
this.setSlotElement(cache.toolbarEl, this.toolbar.nativeElement);
|
|
2068
|
+
this.setSlotElement(cache.headerEl, this.header.nativeElement);
|
|
2069
|
+
/** @type {?} */
|
|
2070
|
+
const drawerTop = cache.config.top ? `${cache.config.top}px` : "";
|
|
2071
|
+
this.element.nativeElement.style.setProperty("--drawer-top", drawerTop);
|
|
2072
|
+
}
|
|
2066
2073
|
/**
|
|
2067
2074
|
* @template T
|
|
2068
2075
|
* @param {?} component
|
|
@@ -2076,14 +2083,19 @@ class DrawerComponent {
|
|
|
2076
2083
|
/** @type {?} */
|
|
2077
2084
|
const componentRef = this.createDynamicComponent(component);
|
|
2078
2085
|
/** @type {?} */
|
|
2079
|
-
const toolbarEl = this.
|
|
2080
|
-
|
|
2081
|
-
this.
|
|
2082
|
-
|
|
2086
|
+
const toolbarEl = this.getSlotElement(componentRef, "[drawer-toolbar]");
|
|
2087
|
+
/** @type {?} */
|
|
2088
|
+
const headerEl = this.getSlotElement(componentRef, "[drawer-header]");
|
|
2089
|
+
/** @type {?} */
|
|
2090
|
+
const cache = {
|
|
2083
2091
|
config: showConfig,
|
|
2084
2092
|
ref: componentRef,
|
|
2085
2093
|
toolbarEl,
|
|
2086
|
-
|
|
2094
|
+
headerEl,
|
|
2095
|
+
};
|
|
2096
|
+
this.setComponentData(componentRef, data);
|
|
2097
|
+
this.componentRefMap.set(this.service.cacheKey, cache);
|
|
2098
|
+
this.setCache(cache);
|
|
2087
2099
|
this.config = showConfig;
|
|
2088
2100
|
this.$isOpened.next(true);
|
|
2089
2101
|
this.useTransition = "yes";
|
|
@@ -2131,7 +2143,7 @@ class DrawerComponent {
|
|
|
2131
2143
|
if (cache) {
|
|
2132
2144
|
cache.ref.location.nativeElement.style.display = "";
|
|
2133
2145
|
this.config = cache.config;
|
|
2134
|
-
this.
|
|
2146
|
+
this.setCache(cache);
|
|
2135
2147
|
this.$isOpened.next(true);
|
|
2136
2148
|
}
|
|
2137
2149
|
else {
|
|
@@ -2143,8 +2155,8 @@ class DrawerComponent {
|
|
|
2143
2155
|
DrawerComponent.decorators = [
|
|
2144
2156
|
{ type: Component, args: [{
|
|
2145
2157
|
selector: "rs-drawer",
|
|
2146
|
-
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
|
|
2147
|
-
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
|
|
2158
|
+
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",
|
|
2159
|
+
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}"]
|
|
2148
2160
|
}] }
|
|
2149
2161
|
];
|
|
2150
2162
|
/** @nocollapse */
|
|
@@ -2155,6 +2167,7 @@ DrawerComponent.ctorParameters = () => [
|
|
|
2155
2167
|
DrawerComponent.propDecorators = {
|
|
2156
2168
|
element: [{ type: ViewChild, args: ["element", { static: false },] }],
|
|
2157
2169
|
toolbar: [{ type: ViewChild, args: ["toolbar", { static: false },] }],
|
|
2170
|
+
header: [{ type: ViewChild, args: ["header", { static: false },] }],
|
|
2158
2171
|
container: [{ type: ViewChild, args: ["dynamicComponentContainer", {
|
|
2159
2172
|
read: ViewContainerRef,
|
|
2160
2173
|
static: false,
|
|
@@ -2165,6 +2178,8 @@ if (false) {
|
|
|
2165
2178
|
DrawerComponent.prototype.element;
|
|
2166
2179
|
/** @type {?} */
|
|
2167
2180
|
DrawerComponent.prototype.toolbar;
|
|
2181
|
+
/** @type {?} */
|
|
2182
|
+
DrawerComponent.prototype.header;
|
|
2168
2183
|
/**
|
|
2169
2184
|
* @type {?}
|
|
2170
2185
|
* @private
|
|
@@ -2176,8 +2191,6 @@ if (false) {
|
|
|
2176
2191
|
DrawerComponent.prototype.useTransition;
|
|
2177
2192
|
/** @type {?} */
|
|
2178
2193
|
DrawerComponent.prototype.$isOpened;
|
|
2179
|
-
/** @type {?} */
|
|
2180
|
-
DrawerComponent.prototype.showToolbarContainer;
|
|
2181
2194
|
/**
|
|
2182
2195
|
* @type {?}
|
|
2183
2196
|
* @private
|
|
@@ -19593,6 +19606,9 @@ class DrawerFormComponent {
|
|
|
19593
19606
|
if (changes.sections) {
|
|
19594
19607
|
this.formatForm(changes.sections.currentValue);
|
|
19595
19608
|
}
|
|
19609
|
+
if (changes.form && !changes.form.firstChange) {
|
|
19610
|
+
this.checkFormChange(changes.form.previousValue, changes.form.currentValue);
|
|
19611
|
+
}
|
|
19596
19612
|
}
|
|
19597
19613
|
/**
|
|
19598
19614
|
* @return {?}
|
|
@@ -19683,6 +19699,24 @@ class DrawerFormComponent {
|
|
|
19683
19699
|
}));
|
|
19684
19700
|
}
|
|
19685
19701
|
}
|
|
19702
|
+
/**
|
|
19703
|
+
* @param {?} previous
|
|
19704
|
+
* @param {?} current
|
|
19705
|
+
* @return {?}
|
|
19706
|
+
*/
|
|
19707
|
+
checkFormChange(previous, current) {
|
|
19708
|
+
Object.entries(current).forEach((/**
|
|
19709
|
+
* @param {?} __0
|
|
19710
|
+
* @return {?}
|
|
19711
|
+
*/
|
|
19712
|
+
([key, currentValue]) => {
|
|
19713
|
+
if (previous[key] !== currentValue) {
|
|
19714
|
+
/** @type {?} */
|
|
19715
|
+
const field = this.getField(key);
|
|
19716
|
+
this.formItemValidator(field);
|
|
19717
|
+
}
|
|
19718
|
+
}));
|
|
19719
|
+
}
|
|
19686
19720
|
/**
|
|
19687
19721
|
* @param {?} sections
|
|
19688
19722
|
* @return {?}
|
|
@@ -20587,9 +20621,7 @@ class KeepAliveService {
|
|
|
20587
20621
|
if (future.routeConfig === curr.routeConfig) {
|
|
20588
20622
|
if (future.children.length === 0 && curr.children.length === 0) {
|
|
20589
20623
|
// 无子路由时, 通过params和queryParams判断是否复用路由
|
|
20590
|
-
return (JSON.stringify(future.params) === JSON.stringify(curr.params)
|
|
20591
|
-
JSON.stringify(future.queryParams) ===
|
|
20592
|
-
JSON.stringify(curr.queryParams));
|
|
20624
|
+
return (JSON.stringify(future.params) === JSON.stringify(curr.params));
|
|
20593
20625
|
}
|
|
20594
20626
|
return true;
|
|
20595
20627
|
}
|
|
@@ -20602,15 +20634,14 @@ class KeepAliveService {
|
|
|
20602
20634
|
getRoutePath(route) {
|
|
20603
20635
|
if (route.routeConfig) {
|
|
20604
20636
|
// const pathParams = JSON.stringify(route.params);
|
|
20605
|
-
|
|
20606
|
-
const queryParams = new URLSearchParams(route.queryParams).toString();
|
|
20637
|
+
// const queryParams = new URLSearchParams(route.queryParams).toString();
|
|
20607
20638
|
/** @type {?} */
|
|
20608
20639
|
const url = route._urlSegment.segments.map((/**
|
|
20609
20640
|
* @param {?} v
|
|
20610
20641
|
* @return {?}
|
|
20611
20642
|
*/
|
|
20612
20643
|
(v) => v.path)).join("/");
|
|
20613
|
-
return "/" + url
|
|
20644
|
+
return "/" + url;
|
|
20614
20645
|
}
|
|
20615
20646
|
return "";
|
|
20616
20647
|
}
|