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
|
@@ -2339,7 +2339,6 @@ var DrawerComponent = /** @class */ (function () {
|
|
|
2339
2339
|
this.config = DefaultDrawerConfig;
|
|
2340
2340
|
this.useTransition = "yes";
|
|
2341
2341
|
this.$isOpened = new BehaviorSubject(false);
|
|
2342
|
-
this.showToolbarContainer = true;
|
|
2343
2342
|
this.componentRefMap = new Map();
|
|
2344
2343
|
}
|
|
2345
2344
|
/**
|
|
@@ -2404,39 +2403,53 @@ var DrawerComponent = /** @class */ (function () {
|
|
|
2404
2403
|
/**
|
|
2405
2404
|
* @private
|
|
2406
2405
|
* @param {?} componentRef
|
|
2406
|
+
* @param {?} selector
|
|
2407
2407
|
* @return {?}
|
|
2408
2408
|
*/
|
|
2409
|
-
DrawerComponent.prototype.
|
|
2409
|
+
DrawerComponent.prototype.getSlotElement = /**
|
|
2410
2410
|
* @private
|
|
2411
2411
|
* @param {?} componentRef
|
|
2412
|
+
* @param {?} selector
|
|
2412
2413
|
* @return {?}
|
|
2413
2414
|
*/
|
|
2414
|
-
function (componentRef) {
|
|
2415
|
+
function (componentRef, selector) {
|
|
2415
2416
|
/** @type {?} */
|
|
2416
2417
|
var componentEl = componentRef.location.nativeElement;
|
|
2417
|
-
/** @type {?} */
|
|
2418
|
-
var toolbarEl = componentEl.querySelector("[drawer-toolbar]");
|
|
2419
|
-
return toolbarEl;
|
|
2418
|
+
return (/** @type {?} */ (componentEl.querySelector(selector)));
|
|
2420
2419
|
};
|
|
2421
2420
|
/**
|
|
2422
2421
|
* @private
|
|
2423
|
-
* @param {?}
|
|
2422
|
+
* @param {?} slotEl
|
|
2423
|
+
* @param {?} containerEl
|
|
2424
2424
|
* @return {?}
|
|
2425
2425
|
*/
|
|
2426
|
-
DrawerComponent.prototype.
|
|
2426
|
+
DrawerComponent.prototype.setSlotElement = /**
|
|
2427
2427
|
* @private
|
|
2428
|
-
* @param {?}
|
|
2428
|
+
* @param {?} slotEl
|
|
2429
|
+
* @param {?} containerEl
|
|
2429
2430
|
* @return {?}
|
|
2430
2431
|
*/
|
|
2431
|
-
function (
|
|
2432
|
-
|
|
2433
|
-
|
|
2434
|
-
|
|
2435
|
-
this.showToolbarContainer = !!toolbarEl;
|
|
2436
|
-
if (toolbarEl) {
|
|
2437
|
-
toolbarContainerEl.append(toolbarEl);
|
|
2432
|
+
function (slotEl, containerEl) {
|
|
2433
|
+
containerEl.innerHTML = "";
|
|
2434
|
+
if (slotEl) {
|
|
2435
|
+
containerEl.append(slotEl);
|
|
2438
2436
|
}
|
|
2439
2437
|
};
|
|
2438
|
+
/**
|
|
2439
|
+
* @param {?} cache
|
|
2440
|
+
* @return {?}
|
|
2441
|
+
*/
|
|
2442
|
+
DrawerComponent.prototype.setCache = /**
|
|
2443
|
+
* @param {?} cache
|
|
2444
|
+
* @return {?}
|
|
2445
|
+
*/
|
|
2446
|
+
function (cache) {
|
|
2447
|
+
this.setSlotElement(cache.toolbarEl, this.toolbar.nativeElement);
|
|
2448
|
+
this.setSlotElement(cache.headerEl, this.header.nativeElement);
|
|
2449
|
+
/** @type {?} */
|
|
2450
|
+
var drawerTop = cache.config.top ? cache.config.top + "px" : "";
|
|
2451
|
+
this.element.nativeElement.style.setProperty("--drawer-top", drawerTop);
|
|
2452
|
+
};
|
|
2440
2453
|
/**
|
|
2441
2454
|
* @template T
|
|
2442
2455
|
* @param {?} component
|
|
@@ -2457,14 +2470,19 @@ var DrawerComponent = /** @class */ (function () {
|
|
|
2457
2470
|
/** @type {?} */
|
|
2458
2471
|
var componentRef = this.createDynamicComponent(component);
|
|
2459
2472
|
/** @type {?} */
|
|
2460
|
-
var toolbarEl = this.
|
|
2461
|
-
|
|
2462
|
-
this.
|
|
2463
|
-
|
|
2473
|
+
var toolbarEl = this.getSlotElement(componentRef, "[drawer-toolbar]");
|
|
2474
|
+
/** @type {?} */
|
|
2475
|
+
var headerEl = this.getSlotElement(componentRef, "[drawer-header]");
|
|
2476
|
+
/** @type {?} */
|
|
2477
|
+
var cache = {
|
|
2464
2478
|
config: showConfig,
|
|
2465
2479
|
ref: componentRef,
|
|
2466
2480
|
toolbarEl: toolbarEl,
|
|
2467
|
-
|
|
2481
|
+
headerEl: headerEl,
|
|
2482
|
+
};
|
|
2483
|
+
this.setComponentData(componentRef, data);
|
|
2484
|
+
this.componentRefMap.set(this.service.cacheKey, cache);
|
|
2485
|
+
this.setCache(cache);
|
|
2468
2486
|
this.config = showConfig;
|
|
2469
2487
|
this.$isOpened.next(true);
|
|
2470
2488
|
this.useTransition = "yes";
|
|
@@ -2525,7 +2543,7 @@ var DrawerComponent = /** @class */ (function () {
|
|
|
2525
2543
|
if (cache) {
|
|
2526
2544
|
cache.ref.location.nativeElement.style.display = "";
|
|
2527
2545
|
this.config = cache.config;
|
|
2528
|
-
this.
|
|
2546
|
+
this.setCache(cache);
|
|
2529
2547
|
this.$isOpened.next(true);
|
|
2530
2548
|
}
|
|
2531
2549
|
else {
|
|
@@ -2536,8 +2554,8 @@ var DrawerComponent = /** @class */ (function () {
|
|
|
2536
2554
|
DrawerComponent.decorators = [
|
|
2537
2555
|
{ type: Component, args: [{
|
|
2538
2556
|
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
|
|
2557
|
+
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",
|
|
2558
|
+
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
2559
|
}] }
|
|
2542
2560
|
];
|
|
2543
2561
|
/** @nocollapse */
|
|
@@ -2548,6 +2566,7 @@ var DrawerComponent = /** @class */ (function () {
|
|
|
2548
2566
|
DrawerComponent.propDecorators = {
|
|
2549
2567
|
element: [{ type: ViewChild, args: ["element", { static: false },] }],
|
|
2550
2568
|
toolbar: [{ type: ViewChild, args: ["toolbar", { static: false },] }],
|
|
2569
|
+
header: [{ type: ViewChild, args: ["header", { static: false },] }],
|
|
2551
2570
|
container: [{ type: ViewChild, args: ["dynamicComponentContainer", {
|
|
2552
2571
|
read: ViewContainerRef,
|
|
2553
2572
|
static: false,
|
|
@@ -2560,6 +2579,8 @@ if (false) {
|
|
|
2560
2579
|
DrawerComponent.prototype.element;
|
|
2561
2580
|
/** @type {?} */
|
|
2562
2581
|
DrawerComponent.prototype.toolbar;
|
|
2582
|
+
/** @type {?} */
|
|
2583
|
+
DrawerComponent.prototype.header;
|
|
2563
2584
|
/**
|
|
2564
2585
|
* @type {?}
|
|
2565
2586
|
* @private
|
|
@@ -2571,8 +2592,6 @@ if (false) {
|
|
|
2571
2592
|
DrawerComponent.prototype.useTransition;
|
|
2572
2593
|
/** @type {?} */
|
|
2573
2594
|
DrawerComponent.prototype.$isOpened;
|
|
2574
|
-
/** @type {?} */
|
|
2575
|
-
DrawerComponent.prototype.showToolbarContainer;
|
|
2576
2595
|
/**
|
|
2577
2596
|
* @type {?}
|
|
2578
2597
|
* @private
|
|
@@ -20098,6 +20117,9 @@ var DrawerFormComponent = /** @class */ (function () {
|
|
|
20098
20117
|
if (changes.sections) {
|
|
20099
20118
|
this.formatForm(changes.sections.currentValue);
|
|
20100
20119
|
}
|
|
20120
|
+
if (changes.form && !changes.form.firstChange) {
|
|
20121
|
+
this.checkFormChange(changes.form.previousValue, changes.form.currentValue);
|
|
20122
|
+
}
|
|
20101
20123
|
};
|
|
20102
20124
|
/**
|
|
20103
20125
|
* @return {?}
|
|
@@ -20202,6 +20224,31 @@ var DrawerFormComponent = /** @class */ (function () {
|
|
|
20202
20224
|
}));
|
|
20203
20225
|
}
|
|
20204
20226
|
};
|
|
20227
|
+
/**
|
|
20228
|
+
* @param {?} previous
|
|
20229
|
+
* @param {?} current
|
|
20230
|
+
* @return {?}
|
|
20231
|
+
*/
|
|
20232
|
+
DrawerFormComponent.prototype.checkFormChange = /**
|
|
20233
|
+
* @param {?} previous
|
|
20234
|
+
* @param {?} current
|
|
20235
|
+
* @return {?}
|
|
20236
|
+
*/
|
|
20237
|
+
function (previous, current) {
|
|
20238
|
+
var _this = this;
|
|
20239
|
+
Object.entries(current).forEach((/**
|
|
20240
|
+
* @param {?} __0
|
|
20241
|
+
* @return {?}
|
|
20242
|
+
*/
|
|
20243
|
+
function (_a) {
|
|
20244
|
+
var _b = __read(_a, 2), key = _b[0], currentValue = _b[1];
|
|
20245
|
+
if (previous[key] !== currentValue) {
|
|
20246
|
+
/** @type {?} */
|
|
20247
|
+
var field = _this.getField(key);
|
|
20248
|
+
_this.formItemValidator(field);
|
|
20249
|
+
}
|
|
20250
|
+
}));
|
|
20251
|
+
};
|
|
20205
20252
|
/**
|
|
20206
20253
|
* @param {?} sections
|
|
20207
20254
|
* @return {?}
|
|
@@ -21301,9 +21348,7 @@ var KeepAliveService = /** @class */ (function () {
|
|
|
21301
21348
|
if (future.routeConfig === curr.routeConfig) {
|
|
21302
21349
|
if (future.children.length === 0 && curr.children.length === 0) {
|
|
21303
21350
|
// 无子路由时, 通过params和queryParams判断是否复用路由
|
|
21304
|
-
return (JSON.stringify(future.params) === JSON.stringify(curr.params)
|
|
21305
|
-
JSON.stringify(future.queryParams) ===
|
|
21306
|
-
JSON.stringify(curr.queryParams));
|
|
21351
|
+
return (JSON.stringify(future.params) === JSON.stringify(curr.params));
|
|
21307
21352
|
}
|
|
21308
21353
|
return true;
|
|
21309
21354
|
}
|
|
@@ -21320,15 +21365,14 @@ var KeepAliveService = /** @class */ (function () {
|
|
|
21320
21365
|
function (route) {
|
|
21321
21366
|
if (route.routeConfig) {
|
|
21322
21367
|
// const pathParams = JSON.stringify(route.params);
|
|
21323
|
-
|
|
21324
|
-
var queryParams = new URLSearchParams(route.queryParams).toString();
|
|
21368
|
+
// const queryParams = new URLSearchParams(route.queryParams).toString();
|
|
21325
21369
|
/** @type {?} */
|
|
21326
21370
|
var url = route._urlSegment.segments.map((/**
|
|
21327
21371
|
* @param {?} v
|
|
21328
21372
|
* @return {?}
|
|
21329
21373
|
*/
|
|
21330
21374
|
function (v) { return v.path; })).join("/");
|
|
21331
|
-
return "/" + url
|
|
21375
|
+
return "/" + url;
|
|
21332
21376
|
}
|
|
21333
21377
|
return "";
|
|
21334
21378
|
};
|