raise-common-lib 0.0.217 → 0.0.219

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.
Files changed (55) hide show
  1. package/README.md +57 -57
  2. package/bundles/raise-common-lib.umd.js +1208 -0
  3. package/bundles/raise-common-lib.umd.js.map +1 -1
  4. package/bundles/raise-common-lib.umd.min.js +1 -1
  5. package/bundles/raise-common-lib.umd.min.js.map +1 -1
  6. package/esm2015/lib/raise-common-lib.module.js +4 -1
  7. package/esm2015/lib/smart-popup/index.component.js +1089 -0
  8. package/esm2015/public-api.js +2 -1
  9. package/esm2015/raise-common-lib.js +2 -2
  10. package/esm5/lib/raise-common-lib.module.js +4 -1
  11. package/esm5/lib/smart-popup/index.component.js +1208 -0
  12. package/esm5/public-api.js +2 -1
  13. package/esm5/raise-common-lib.js +2 -2
  14. package/fesm2015/raise-common-lib.js +1091 -1
  15. package/fesm2015/raise-common-lib.js.map +1 -1
  16. package/fesm5/raise-common-lib.js +1208 -1
  17. package/fesm5/raise-common-lib.js.map +1 -1
  18. package/lib/smart-popup/index.component.d.ts +57 -0
  19. package/package.json +1 -1
  20. package/public-api.d.ts +1 -0
  21. package/raise-common-lib.metadata.json +1 -1
  22. package/src/assets/img/arrow_right.svg +4 -4
  23. package/src/assets/img/calendar-disabled.svg +6 -6
  24. package/src/assets/img/calendar.svg +6 -6
  25. package/src/assets/img/calendar_arrow_left.svg +3 -3
  26. package/src/assets/img/calendar_arrow_right.svg +3 -3
  27. package/src/assets/img/checked-vector.svg +3 -3
  28. package/src/assets/img/dialog-close.svg +4 -4
  29. package/src/assets/img/dialog-grow.svg +6 -6
  30. package/src/assets/img/dialog-shrink.svg +6 -6
  31. package/src/assets/img/plus.svg +4 -4
  32. package/src/assets/img/search.svg +4 -4
  33. package/src/assets/img/shrink-icon.svg +6 -6
  34. package/src/assets/img/time-disabled.svg +4 -4
  35. package/src/assets/img/time.svg +4 -4
  36. package/src/assets/img/toolbar-action-addFolder.svg +17 -17
  37. package/src/assets/img/toolbar-action-calculator.svg +11 -11
  38. package/src/assets/img/toolbar-action-collapse.svg +7 -7
  39. package/src/assets/img/toolbar-action-combine.svg +4 -4
  40. package/src/assets/img/toolbar-action-edit.svg +4 -4
  41. package/src/assets/img/toolbar-action-expand.svg +7 -7
  42. package/src/assets/img/toolbar-action-folderMove.svg +8 -8
  43. package/src/assets/img/toolbar-action-lock.svg +6 -6
  44. package/src/assets/img/toolbar-action-preview.svg +7 -7
  45. package/src/assets/img/toolbar-action-publish.svg +5 -5
  46. package/src/assets/img/toolbar-action-reminders.svg +10 -10
  47. package/src/assets/img/toolbar-action-rename.svg +7 -7
  48. package/src/assets/img/toolbar-action-saveSequence.svg +5 -5
  49. package/src/assets/img/toolbar-action-send-file.svg +5 -5
  50. package/src/assets/img/toolbar-action-settle.svg +7 -7
  51. package/src/assets/img/toolbar-action-share.svg +5 -5
  52. package/src/assets/img/toolbar-action-submitForApproval.svg +4 -4
  53. package/src/assets/img/toolbar-action-sync.svg +4 -4
  54. package/src/assets/img/toolbar-action-template.svg +6 -6
  55. package/src/assets/img/toolbar-action-workflow.svg +9 -9
@@ -24109,6 +24109,1211 @@
24109
24109
  CommonDialogComponent.prototype.dialogRef;
24110
24110
  }
24111
24111
 
24112
+ /**
24113
+ * @fileoverview added by tsickle
24114
+ * Generated from: lib/smart-popup/index.component.ts
24115
+ * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
24116
+ */
24117
+ var SmartPopupComponent = /** @class */ (function () {
24118
+ function SmartPopupComponent(ref) {
24119
+ var _this = this;
24120
+ this.ref = ref;
24121
+ this._placement = "BottomLeft";
24122
+ this._offset = 8;
24123
+ this._autoAdjust = "yes";
24124
+ this.triggerElementRef = null;
24125
+ this.loading = false;
24126
+ this._open = false;
24127
+ this._width = null;
24128
+ this._height = null;
24129
+ this.openChange = new core.EventEmitter();
24130
+ this.contentLoad = new core.EventEmitter();
24131
+ this.currentTriggerElement = null;
24132
+ this.FIXED_CONTAINER_ID = "rs-smart-popup-fixed-container";
24133
+ this.opened = "no";
24134
+ this.positioning = "no";
24135
+ this.actualPlacement = "bottom";
24136
+ this.actualPosition = "start";
24137
+ this.onClickOutside = (/**
24138
+ * @param {?} event
24139
+ * @return {?}
24140
+ */
24141
+ function (event) {
24142
+ /** @type {?} */
24143
+ var target = (/** @type {?} */ (event.target));
24144
+ /** @type {?} */
24145
+ var isClickOnTrigger = _this.currentTriggerElement && _this.currentTriggerElement.contains(target);
24146
+ /** @type {?} */
24147
+ var isClickOnPopup = _this.popupElement &&
24148
+ _this.popupElement.nativeElement &&
24149
+ _this.popupElement.nativeElement.contains(target);
24150
+ if (!isClickOnTrigger && !isClickOnPopup) {
24151
+ _this.close();
24152
+ }
24153
+ });
24154
+ this.onWindowScroll = (/**
24155
+ * @param {?} event
24156
+ * @return {?}
24157
+ */
24158
+ function (event) {
24159
+ if (_this.opened === "yes") {
24160
+ // 检查滚动是否发生在弹窗内部
24161
+ /** @type {?} */
24162
+ var target = (/** @type {?} */ (event.target));
24163
+ /** @type {?} */
24164
+ var isScrollOnPopup = _this.popupElement &&
24165
+ _this.popupElement.nativeElement &&
24166
+ _this.popupElement.nativeElement.contains(target);
24167
+ // 如果滚动发生在弹窗内部,不更新位置(避免不必要的计算)
24168
+ // 如果滚动发生在外部,更新位置(因为触发元素位置可能改变)
24169
+ if (!isScrollOnPopup) {
24170
+ _this.updatePopupPosition();
24171
+ }
24172
+ }
24173
+ });
24174
+ }
24175
+ Object.defineProperty(SmartPopupComponent.prototype, "placementInfo", {
24176
+ // 解析placement格式
24177
+ get:
24178
+ // 解析placement格式
24179
+ /**
24180
+ * @return {?}
24181
+ */
24182
+ function () {
24183
+ /** @type {?} */
24184
+ var placementMap = {
24185
+ TopLeft: { placement: "top", position: "start" },
24186
+ TopCenter: { placement: "top", position: "center" },
24187
+ TopRight: { placement: "top", position: "end" },
24188
+ BottomLeft: { placement: "bottom", position: "start" },
24189
+ BottomCenter: { placement: "bottom", position: "center" },
24190
+ BottomRight: { placement: "bottom", position: "end" },
24191
+ LeftTop: { placement: "left", position: "start" },
24192
+ LeftCenter: { placement: "left", position: "center" },
24193
+ LeftBottom: { placement: "left", position: "end" },
24194
+ RightTop: { placement: "right", position: "start" },
24195
+ RightCenter: { placement: "right", position: "center" },
24196
+ RightBottom: { placement: "right", position: "end" },
24197
+ };
24198
+ return (placementMap[this._placement] || {
24199
+ placement: "bottom",
24200
+ position: "start",
24201
+ });
24202
+ },
24203
+ enumerable: true,
24204
+ configurable: true
24205
+ });
24206
+ Object.defineProperty(SmartPopupComponent.prototype, "offset", {
24207
+ get: /**
24208
+ * @return {?}
24209
+ */
24210
+ function () {
24211
+ return this._offset || 8;
24212
+ },
24213
+ enumerable: true,
24214
+ configurable: true
24215
+ });
24216
+ Object.defineProperty(SmartPopupComponent.prototype, "autoAdjust", {
24217
+ get: /**
24218
+ * @return {?}
24219
+ */
24220
+ function () {
24221
+ return this._autoAdjust === "yes";
24222
+ },
24223
+ enumerable: true,
24224
+ configurable: true
24225
+ });
24226
+ /**
24227
+ * @return {?}
24228
+ */
24229
+ SmartPopupComponent.prototype.ngAfterViewInit = /**
24230
+ * @return {?}
24231
+ */
24232
+ function () {
24233
+ var _this = this;
24234
+ this.fixedContainerEl = this.getFixedContainer();
24235
+ this.fixedContainerEl.append(this.popupElement.nativeElement);
24236
+ this.updateTriggerElement();
24237
+ // 如果提供了固定尺寸,立即应用
24238
+ if (this._width !== null &&
24239
+ this._height !== null &&
24240
+ this.popupElement &&
24241
+ this.popupElement.nativeElement) {
24242
+ /** @type {?} */
24243
+ var popupEl = this.popupElement.nativeElement;
24244
+ popupEl.style.width = this._width + "px";
24245
+ popupEl.style.height = this._height + "px";
24246
+ popupEl.style.minWidth = this._width + "px";
24247
+ popupEl.style.maxWidth = this._width + "px";
24248
+ popupEl.style.minHeight = this._height + "px";
24249
+ popupEl.style.maxHeight = this._height + "px";
24250
+ }
24251
+ // 如果外部传入 open 属性为 true,自动打开
24252
+ if (this._open) {
24253
+ setTimeout((/**
24254
+ * @return {?}
24255
+ */
24256
+ function () { return _this.open(); }), 0);
24257
+ }
24258
+ };
24259
+ /**
24260
+ * @param {?} changes
24261
+ * @return {?}
24262
+ */
24263
+ SmartPopupComponent.prototype.ngOnChanges = /**
24264
+ * @param {?} changes
24265
+ * @return {?}
24266
+ */
24267
+ function (changes) {
24268
+ var _this = this;
24269
+ // 处理固定尺寸变化
24270
+ if ((changes._width || changes._height) &&
24271
+ this.popupElement &&
24272
+ this.popupElement.nativeElement) {
24273
+ /** @type {?} */
24274
+ var popupEl = this.popupElement.nativeElement;
24275
+ if (this._width !== null) {
24276
+ popupEl.style.width = this._width + "px";
24277
+ popupEl.style.minWidth = this._width + "px";
24278
+ popupEl.style.maxWidth = this._width + "px";
24279
+ }
24280
+ if (this._height !== null) {
24281
+ popupEl.style.height = this._height + "px";
24282
+ popupEl.style.minHeight = this._height + "px";
24283
+ popupEl.style.maxHeight = this._height + "px";
24284
+ }
24285
+ }
24286
+ // 先处理触发元素变化(确保在打开前更新触发元素)
24287
+ if (changes.triggerElementRef) {
24288
+ /** @type {?} */
24289
+ var previousTrigger = this.currentTriggerElement;
24290
+ this.updateTriggerElement();
24291
+ // 如果弹窗已经打开,且触发元素发生了变化,立即更新位置
24292
+ if (this.opened === "yes" &&
24293
+ previousTrigger !== this.currentTriggerElement &&
24294
+ this.currentTriggerElement) {
24295
+ // 使用新的打开方式更新位置
24296
+ this.positioning = "yes";
24297
+ this.ref.markForCheck();
24298
+ requestAnimationFrame((/**
24299
+ * @return {?}
24300
+ */
24301
+ function () {
24302
+ requestAnimationFrame((/**
24303
+ * @return {?}
24304
+ */
24305
+ function () {
24306
+ _this.updatePopupPosition();
24307
+ _this.positioning = "no";
24308
+ _this.ref.markForCheck();
24309
+ }));
24310
+ }));
24311
+ }
24312
+ }
24313
+ // 处理 open 变化(确保在触发元素更新后处理)
24314
+ if (changes._open) {
24315
+ if (this._open && this.opened === "no") {
24316
+ // 确保触发元素已更新
24317
+ this.updateTriggerElement();
24318
+ // 使用 setTimeout 确保所有变更都已处理
24319
+ setTimeout((/**
24320
+ * @return {?}
24321
+ */
24322
+ function () {
24323
+ // 再次确保触发元素已更新
24324
+ _this.updateTriggerElement();
24325
+ _this.open();
24326
+ }), 0);
24327
+ }
24328
+ else if (!this._open && this.opened === "yes") {
24329
+ this.close();
24330
+ }
24331
+ }
24332
+ // 当加载完成时,更新位置(如果提供了固定尺寸,不需要更新位置)
24333
+ if (changes.loading &&
24334
+ !changes.loading.currentValue &&
24335
+ changes.loading.previousValue) {
24336
+ if (this.opened === "yes") {
24337
+ // 如果提供了固定尺寸,位置已经计算好了,不需要更新
24338
+ if (this._width !== null && this._height !== null) {
24339
+ this.contentLoad.emit();
24340
+ }
24341
+ else {
24342
+ // 如果正在定位,不需要更新位置
24343
+ if (this.positioning === "no") {
24344
+ requestAnimationFrame((/**
24345
+ * @return {?}
24346
+ */
24347
+ function () {
24348
+ _this.updatePopupPosition();
24349
+ _this.contentLoad.emit();
24350
+ }));
24351
+ }
24352
+ else {
24353
+ // 如果正在定位,等待定位完成后再触发事件
24354
+ /** @type {?} */
24355
+ var checkPositioning_1 = (/**
24356
+ * @return {?}
24357
+ */
24358
+ function () {
24359
+ if (_this.positioning === "no") {
24360
+ _this.contentLoad.emit();
24361
+ }
24362
+ else {
24363
+ setTimeout(checkPositioning_1, 10);
24364
+ }
24365
+ });
24366
+ checkPositioning_1();
24367
+ }
24368
+ }
24369
+ }
24370
+ }
24371
+ };
24372
+ /**
24373
+ * @return {?}
24374
+ */
24375
+ SmartPopupComponent.prototype.ngOnDestroy = /**
24376
+ * @return {?}
24377
+ */
24378
+ function () {
24379
+ if (this.popupElement && this.popupElement.nativeElement) {
24380
+ this.popupElement.nativeElement.remove();
24381
+ }
24382
+ window.removeEventListener("click", this.onClickOutside);
24383
+ window.removeEventListener("scroll", this.onWindowScroll, true);
24384
+ };
24385
+ /**
24386
+ * @return {?}
24387
+ */
24388
+ SmartPopupComponent.prototype.updateTriggerElement = /**
24389
+ * @return {?}
24390
+ */
24391
+ function () {
24392
+ if (this.triggerElementRef) {
24393
+ this.currentTriggerElement = this.triggerElementRef;
24394
+ }
24395
+ else if (this.internalTriggerElement &&
24396
+ this.internalTriggerElement.nativeElement) {
24397
+ this.currentTriggerElement = this.internalTriggerElement.nativeElement;
24398
+ }
24399
+ else {
24400
+ this.currentTriggerElement = null;
24401
+ }
24402
+ };
24403
+ /**
24404
+ * @return {?}
24405
+ */
24406
+ SmartPopupComponent.prototype.getFixedContainer = /**
24407
+ * @return {?}
24408
+ */
24409
+ function () {
24410
+ /** @type {?} */
24411
+ var containerElement = document.getElementById(this.FIXED_CONTAINER_ID);
24412
+ if (!containerElement) {
24413
+ containerElement = document.createElement("div");
24414
+ containerElement.setAttribute("id", this.FIXED_CONTAINER_ID);
24415
+ document.body.append(containerElement);
24416
+ }
24417
+ return containerElement;
24418
+ };
24419
+ /**
24420
+ * @param {?=} triggerElement
24421
+ * @return {?}
24422
+ */
24423
+ SmartPopupComponent.prototype.open = /**
24424
+ * @param {?=} triggerElement
24425
+ * @return {?}
24426
+ */
24427
+ function (triggerElement) {
24428
+ var _this = this;
24429
+ // 如果传入了触发元素,使用它
24430
+ if (triggerElement) {
24431
+ this.currentTriggerElement = triggerElement;
24432
+ }
24433
+ else {
24434
+ this.updateTriggerElement();
24435
+ }
24436
+ if (!this.currentTriggerElement) {
24437
+ console.warn("SmartPopupComponent: No trigger element found");
24438
+ return;
24439
+ }
24440
+ // 如果已经打开,先关闭再打开(更新位置)
24441
+ if (this.opened === "yes") {
24442
+ // 先关闭弹窗
24443
+ this.opened = "no";
24444
+ this.positioning = "no";
24445
+ this.ref.markForCheck();
24446
+ // 立即在新位置打开
24447
+ requestAnimationFrame((/**
24448
+ * @return {?}
24449
+ */
24450
+ function () {
24451
+ // 再次确保触发元素已更新
24452
+ _this.updateTriggerElement();
24453
+ _this.openPopup();
24454
+ }));
24455
+ return;
24456
+ }
24457
+ // 确保触发元素已更新
24458
+ this.updateTriggerElement();
24459
+ this.openPopup();
24460
+ };
24461
+ /**
24462
+ * @private
24463
+ * @return {?}
24464
+ */
24465
+ SmartPopupComponent.prototype.openPopup = /**
24466
+ * @private
24467
+ * @return {?}
24468
+ */
24469
+ function () {
24470
+ var _this = this;
24471
+ // 再次确保触发元素已更新
24472
+ this.updateTriggerElement();
24473
+ if (!this.currentTriggerElement) {
24474
+ console.warn("SmartPopupComponent: No trigger element found when opening popup");
24475
+ return;
24476
+ }
24477
+ // 如果提供了固定尺寸,可以在打开前就计算好位置
24478
+ if (this._width !== null && this._height !== null) {
24479
+ // 先计算位置(不依赖DOM渲染,直接根据triggerElement计算)
24480
+ /** @type {?} */
24481
+ var triggerRect = this.currentTriggerElement.getBoundingClientRect();
24482
+ /** @type {?} */
24483
+ var viewportWidth = window.innerWidth;
24484
+ /** @type {?} */
24485
+ var viewportHeight = window.innerHeight;
24486
+ /** @type {?} */
24487
+ var popupSize = {
24488
+ width: this._width,
24489
+ height: this._height,
24490
+ };
24491
+ /** @type {?} */
24492
+ var popupRect = (/** @type {?} */ ({
24493
+ width: popupSize.width,
24494
+ height: popupSize.height,
24495
+ top: 0,
24496
+ left: 0,
24497
+ right: popupSize.width,
24498
+ bottom: popupSize.height,
24499
+ x: 0,
24500
+ y: 0,
24501
+ toJSON: (/**
24502
+ * @return {?}
24503
+ */
24504
+ function () { return ({}); }),
24505
+ }));
24506
+ /** @type {?} */
24507
+ var targetInfo = this.placementInfo;
24508
+ /** @type {?} */
24509
+ var finalPlacement = targetInfo.placement;
24510
+ /** @type {?} */
24511
+ var finalPosition = targetInfo.position;
24512
+ if (this.autoAdjust) {
24513
+ /** @type {?} */
24514
+ var optimal = this.calculateOptimalPlacement(triggerRect, popupRect, viewportWidth, viewportHeight);
24515
+ finalPlacement = optimal.placement;
24516
+ finalPosition = optimal.position;
24517
+ }
24518
+ this.actualPlacement = finalPlacement;
24519
+ this.actualPosition = finalPosition;
24520
+ // 计算位置坐标(不依赖DOM,直接计算)
24521
+ /** @type {?} */
24522
+ var position_1 = this.calculatePositionCoordinates(triggerRect, finalPlacement, finalPosition, popupSize);
24523
+ // 先设置打开状态,但保持隐藏(positioning = yes)
24524
+ this.opened = "yes";
24525
+ this.positioning = "yes";
24526
+ this.openChange.emit(true);
24527
+ this.ref.markForCheck();
24528
+ // 强制更新视图,确保DOM已更新
24529
+ this.ref.detectChanges();
24530
+ // 如果元素已经存在,立即设置位置(不等待 requestAnimationFrame)
24531
+ if (this.popupElement && this.popupElement.nativeElement) {
24532
+ /** @type {?} */
24533
+ var popupEl = this.popupElement.nativeElement;
24534
+ // 立即设置尺寸和位置
24535
+ popupEl.style.width = this._width + "px";
24536
+ popupEl.style.height = this._height + "px";
24537
+ popupEl.style.minWidth = this._width + "px";
24538
+ popupEl.style.maxWidth = this._width + "px";
24539
+ popupEl.style.minHeight = this._height + "px";
24540
+ popupEl.style.maxHeight = this._height + "px";
24541
+ popupEl.style.top = position_1.top;
24542
+ popupEl.style.left = position_1.left;
24543
+ popupEl.style.transform = "translate(" + position_1.translateX + ", " + position_1.translateY + ")";
24544
+ // 强制同步应用样式
24545
+ popupEl.offsetHeight;
24546
+ // 位置设置完成后,立即显示弹窗
24547
+ this.positioning = "no";
24548
+ this.ref.markForCheck();
24549
+ }
24550
+ else {
24551
+ // 如果元素还不存在,等待渲染
24552
+ requestAnimationFrame((/**
24553
+ * @return {?}
24554
+ */
24555
+ function () {
24556
+ if (_this.popupElement && _this.popupElement.nativeElement) {
24557
+ /** @type {?} */
24558
+ var popupEl = _this.popupElement.nativeElement;
24559
+ // 立即设置尺寸和位置
24560
+ popupEl.style.width = _this._width + "px";
24561
+ popupEl.style.height = _this._height + "px";
24562
+ popupEl.style.minWidth = _this._width + "px";
24563
+ popupEl.style.maxWidth = _this._width + "px";
24564
+ popupEl.style.minHeight = _this._height + "px";
24565
+ popupEl.style.maxHeight = _this._height + "px";
24566
+ popupEl.style.top = position_1.top;
24567
+ popupEl.style.left = position_1.left;
24568
+ popupEl.style.transform = "translate(" + position_1.translateX + ", " + position_1.translateY + ")";
24569
+ // 强制同步应用样式
24570
+ popupEl.offsetHeight;
24571
+ // 位置设置完成后,立即显示弹窗
24572
+ _this.positioning = "no";
24573
+ _this.ref.markForCheck();
24574
+ }
24575
+ }));
24576
+ }
24577
+ }
24578
+ else {
24579
+ // 没有固定尺寸,需要等待DOM渲染
24580
+ this.positioning = "yes";
24581
+ this.ref.markForCheck();
24582
+ // 立即强制更新视图,确保DOM已更新
24583
+ this.ref.detectChanges();
24584
+ // 使用 requestAnimationFrame 确保在浏览器渲染之前更新位置
24585
+ requestAnimationFrame((/**
24586
+ * @return {?}
24587
+ */
24588
+ function () {
24589
+ // 确保元素已渲染并获取尺寸
24590
+ if (_this.popupElement && _this.popupElement.nativeElement) {
24591
+ // 强制重新计算布局,确保元素尺寸已计算
24592
+ _this.popupElement.nativeElement.offsetHeight;
24593
+ // 计算并设置位置
24594
+ _this.updatePopupPosition();
24595
+ // 位置设置完成后,移除定位状态,显示弹窗
24596
+ _this.positioning = "no";
24597
+ _this.ref.markForCheck();
24598
+ }
24599
+ }));
24600
+ }
24601
+ window.addEventListener("click", this.onClickOutside);
24602
+ window.addEventListener("scroll", this.onWindowScroll, true);
24603
+ };
24604
+ /**
24605
+ * @return {?}
24606
+ */
24607
+ SmartPopupComponent.prototype.close = /**
24608
+ * @return {?}
24609
+ */
24610
+ function () {
24611
+ if (this.opened === "no") {
24612
+ return;
24613
+ }
24614
+ this.opened = "no";
24615
+ this.positioning = "no";
24616
+ this.openChange.emit(false);
24617
+ window.removeEventListener("click", this.onClickOutside);
24618
+ window.removeEventListener("scroll", this.onWindowScroll, true);
24619
+ this.ref.markForCheck();
24620
+ };
24621
+ /**
24622
+ * @return {?}
24623
+ */
24624
+ SmartPopupComponent.prototype.toggle = /**
24625
+ * @return {?}
24626
+ */
24627
+ function () {
24628
+ if (this.opened === "yes") {
24629
+ this.close();
24630
+ }
24631
+ else {
24632
+ this.open();
24633
+ }
24634
+ };
24635
+ /**
24636
+ * @param {?} event
24637
+ * @return {?}
24638
+ */
24639
+ SmartPopupComponent.prototype.onClickTrigger = /**
24640
+ * @param {?} event
24641
+ * @return {?}
24642
+ */
24643
+ function (event) {
24644
+ event.stopPropagation();
24645
+ this.toggle();
24646
+ };
24647
+ // 处理弹窗内部的滚轮事件
24648
+ // 处理弹窗内部的滚轮事件
24649
+ /**
24650
+ * @param {?} event
24651
+ * @return {?}
24652
+ */
24653
+ SmartPopupComponent.prototype.onPopupWheel =
24654
+ // 处理弹窗内部的滚轮事件
24655
+ /**
24656
+ * @param {?} event
24657
+ * @return {?}
24658
+ */
24659
+ function (event) {
24660
+ // 阻止滚轮事件冒泡,避免触发外部滚动处理
24661
+ event.stopPropagation();
24662
+ };
24663
+ // 处理弹窗内部的滚动事件
24664
+ // 处理弹窗内部的滚动事件
24665
+ /**
24666
+ * @param {?} event
24667
+ * @return {?}
24668
+ */
24669
+ SmartPopupComponent.prototype.onPopupScroll =
24670
+ // 处理弹窗内部的滚动事件
24671
+ /**
24672
+ * @param {?} event
24673
+ * @return {?}
24674
+ */
24675
+ function (event) {
24676
+ // 阻止滚动事件冒泡,避免触发外部滚动处理
24677
+ event.stopPropagation();
24678
+ };
24679
+ // 计算并设置位置(支持固定尺寸,可在打开前调用)
24680
+ // 计算并设置位置(支持固定尺寸,可在打开前调用)
24681
+ /**
24682
+ * @private
24683
+ * @return {?}
24684
+ */
24685
+ SmartPopupComponent.prototype.calculateAndSetPosition =
24686
+ // 计算并设置位置(支持固定尺寸,可在打开前调用)
24687
+ /**
24688
+ * @private
24689
+ * @return {?}
24690
+ */
24691
+ function () {
24692
+ var _this = this;
24693
+ if (!this.currentTriggerElement) {
24694
+ return;
24695
+ }
24696
+ /** @type {?} */
24697
+ var triggerRect = this.currentTriggerElement.getBoundingClientRect();
24698
+ /** @type {?} */
24699
+ var viewportWidth = window.innerWidth;
24700
+ /** @type {?} */
24701
+ var viewportHeight = window.innerHeight;
24702
+ // 获取弹窗尺寸(优先使用固定尺寸)
24703
+ /** @type {?} */
24704
+ var popupSize = {
24705
+ width: this._width !== null
24706
+ ? this._width
24707
+ : this.popupElement && this.popupElement.nativeElement
24708
+ ? this.popupElement.nativeElement.offsetWidth
24709
+ : 300,
24710
+ height: this._height !== null
24711
+ ? this._height
24712
+ : this.popupElement && this.popupElement.nativeElement
24713
+ ? this.popupElement.nativeElement.offsetHeight
24714
+ : 200,
24715
+ };
24716
+ // 创建虚拟的 popupRect(用于计算)
24717
+ /** @type {?} */
24718
+ var popupRect = (/** @type {?} */ ({
24719
+ width: popupSize.width,
24720
+ height: popupSize.height,
24721
+ top: 0,
24722
+ left: 0,
24723
+ right: popupSize.width,
24724
+ bottom: popupSize.height,
24725
+ x: 0,
24726
+ y: 0,
24727
+ toJSON: (/**
24728
+ * @return {?}
24729
+ */
24730
+ function () { return ({}); }),
24731
+ }));
24732
+ // 获取目标位置信息
24733
+ /** @type {?} */
24734
+ var targetInfo = this.placementInfo;
24735
+ /** @type {?} */
24736
+ var finalPlacement = targetInfo.placement;
24737
+ /** @type {?} */
24738
+ var finalPosition = targetInfo.position;
24739
+ if (this.autoAdjust) {
24740
+ /** @type {?} */
24741
+ var optimal = this.calculateOptimalPlacement(triggerRect, popupRect, viewportWidth, viewportHeight);
24742
+ finalPlacement = optimal.placement;
24743
+ finalPosition = optimal.position;
24744
+ }
24745
+ this.actualPlacement = finalPlacement;
24746
+ this.actualPosition = finalPosition;
24747
+ // 立即设置位置(即使元素还没完全渲染,也要先设置位置)
24748
+ if (this.popupElement && this.popupElement.nativeElement) {
24749
+ this.setPopupPosition(triggerRect, popupRect, finalPlacement, finalPosition, popupSize);
24750
+ // 强制应用样式,确保位置立即生效
24751
+ this.ref.detectChanges();
24752
+ }
24753
+ else {
24754
+ // 如果元素还不存在,延迟设置位置
24755
+ setTimeout((/**
24756
+ * @return {?}
24757
+ */
24758
+ function () {
24759
+ if (_this.popupElement && _this.popupElement.nativeElement) {
24760
+ _this.setPopupPosition(triggerRect, popupRect, finalPlacement, finalPosition, popupSize);
24761
+ _this.ref.detectChanges();
24762
+ }
24763
+ }), 0);
24764
+ }
24765
+ this.ref.markForCheck();
24766
+ };
24767
+ /**
24768
+ * @return {?}
24769
+ */
24770
+ SmartPopupComponent.prototype.updatePopupPosition = /**
24771
+ * @return {?}
24772
+ */
24773
+ function () {
24774
+ if (!this.currentTriggerElement ||
24775
+ !this.popupElement ||
24776
+ !this.popupElement.nativeElement) {
24777
+ return;
24778
+ }
24779
+ // 如果提供了固定尺寸,使用固定尺寸计算
24780
+ if (this._width !== null && this._height !== null) {
24781
+ this.calculateAndSetPosition();
24782
+ return;
24783
+ }
24784
+ /** @type {?} */
24785
+ var triggerRect = this.currentTriggerElement.getBoundingClientRect();
24786
+ /** @type {?} */
24787
+ var popupRect = this.popupElement.nativeElement.getBoundingClientRect();
24788
+ /** @type {?} */
24789
+ var viewportWidth = window.innerWidth;
24790
+ /** @type {?} */
24791
+ var viewportHeight = window.innerHeight;
24792
+ // 获取目标位置信息
24793
+ /** @type {?} */
24794
+ var targetInfo = this.placementInfo;
24795
+ /** @type {?} */
24796
+ var finalPlacement = targetInfo.placement;
24797
+ /** @type {?} */
24798
+ var finalPosition = targetInfo.position;
24799
+ if (this.autoAdjust) {
24800
+ /** @type {?} */
24801
+ var optimal = this.calculateOptimalPlacement(triggerRect, popupRect, viewportWidth, viewportHeight);
24802
+ finalPlacement = optimal.placement;
24803
+ finalPosition = optimal.position;
24804
+ }
24805
+ this.actualPlacement = finalPlacement;
24806
+ this.actualPosition = finalPosition;
24807
+ this.setPopupPosition(triggerRect, popupRect, finalPlacement, finalPosition);
24808
+ this.ref.markForCheck();
24809
+ };
24810
+ /**
24811
+ * @param {?} triggerRect
24812
+ * @param {?} popupRect
24813
+ * @param {?} viewportWidth
24814
+ * @param {?} viewportHeight
24815
+ * @return {?}
24816
+ */
24817
+ SmartPopupComponent.prototype.calculateOptimalPlacement = /**
24818
+ * @param {?} triggerRect
24819
+ * @param {?} popupRect
24820
+ * @param {?} viewportWidth
24821
+ * @param {?} viewportHeight
24822
+ * @return {?}
24823
+ */
24824
+ function (triggerRect, popupRect, viewportWidth, viewportHeight) {
24825
+ var e_1, _a;
24826
+ var _this = this;
24827
+ /** @type {?} */
24828
+ var targetInfo = this.placementInfo;
24829
+ /** @type {?} */
24830
+ var preferred = targetInfo.placement;
24831
+ /** @type {?} */
24832
+ var preferredPosition = targetInfo.position;
24833
+ /** @type {?} */
24834
+ var space = {
24835
+ top: triggerRect.top,
24836
+ bottom: viewportHeight - triggerRect.bottom,
24837
+ left: triggerRect.left,
24838
+ right: viewportWidth - triggerRect.right,
24839
+ };
24840
+ /** @type {?} */
24841
+ var popupSize = {
24842
+ width: popupRect.width || 300,
24843
+ // 默认宽度,如果还没有渲染
24844
+ height: popupRect.height || 200,
24845
+ };
24846
+ // 检查首选位置是否有足够空间
24847
+ /** @type {?} */
24848
+ var hasEnoughSpace = (/**
24849
+ * @param {?} placement
24850
+ * @return {?}
24851
+ */
24852
+ function (placement) {
24853
+ switch (placement) {
24854
+ case "top":
24855
+ return space.top >= popupSize.height + _this.offset;
24856
+ case "bottom":
24857
+ return space.bottom >= popupSize.height + _this.offset;
24858
+ case "left":
24859
+ return space.left >= popupSize.width + _this.offset;
24860
+ case "right":
24861
+ return space.right >= popupSize.width + _this.offset;
24862
+ }
24863
+ });
24864
+ // 检查指定位置是否有足够空间
24865
+ /** @type {?} */
24866
+ var checkPositionSpace = (/**
24867
+ * @param {?} placement
24868
+ * @param {?} position
24869
+ * @return {?}
24870
+ */
24871
+ function (placement, position) {
24872
+ if (placement === "top" || placement === "bottom") {
24873
+ // 对于上下位置,检查水平对齐空间
24874
+ /** @type {?} */
24875
+ var popupWidth = popupSize.width;
24876
+ /** @type {?} */
24877
+ var spaceLeft = triggerRect.left;
24878
+ /** @type {?} */
24879
+ var spaceRight = viewportWidth - triggerRect.right;
24880
+ if (position === "center") {
24881
+ return spaceLeft >= popupWidth / 2 && spaceRight >= popupWidth / 2;
24882
+ }
24883
+ else if (position === "start") {
24884
+ return spaceLeft >= popupWidth;
24885
+ }
24886
+ else {
24887
+ // end
24888
+ return spaceRight >= popupWidth;
24889
+ }
24890
+ }
24891
+ else {
24892
+ // 对于左右位置,检查垂直对齐空间
24893
+ /** @type {?} */
24894
+ var popupHeight = popupSize.height;
24895
+ /** @type {?} */
24896
+ var spaceTop = triggerRect.top;
24897
+ /** @type {?} */
24898
+ var spaceBottom = viewportHeight - triggerRect.bottom;
24899
+ if (position === "center") {
24900
+ return spaceTop >= popupHeight / 2 && spaceBottom >= popupHeight / 2;
24901
+ }
24902
+ else if (position === "start") {
24903
+ return spaceTop >= popupHeight;
24904
+ }
24905
+ else {
24906
+ // end
24907
+ return spaceBottom >= popupHeight;
24908
+ }
24909
+ }
24910
+ });
24911
+ // 计算位置是否合适(考虑水平/垂直对齐)
24912
+ /** @type {?} */
24913
+ var calculatePosition = (/**
24914
+ * @param {?} placement
24915
+ * @return {?}
24916
+ */
24917
+ function (placement) {
24918
+ if (placement === "top" || placement === "bottom") {
24919
+ // 对于上下位置,检查水平对齐
24920
+ /** @type {?} */
24921
+ var popupWidth = popupSize.width;
24922
+ /** @type {?} */
24923
+ var spaceLeft = triggerRect.left;
24924
+ /** @type {?} */
24925
+ var spaceRight = viewportWidth - triggerRect.right;
24926
+ // 优先尝试使用用户指定的position
24927
+ if (checkPositionSpace(placement, preferredPosition)) {
24928
+ return preferredPosition;
24929
+ }
24930
+ // 如果中心对齐有足够空间,优先使用中心
24931
+ if (spaceLeft >= popupWidth / 2 && spaceRight >= popupWidth / 2) {
24932
+ return "center";
24933
+ }
24934
+ // 如果左侧空间不足,使用右对齐
24935
+ if (spaceLeft < popupWidth / 2) {
24936
+ return "end";
24937
+ }
24938
+ // 如果右侧空间不足,使用左对齐
24939
+ if (spaceRight < popupWidth / 2) {
24940
+ return "start";
24941
+ }
24942
+ return preferredPosition;
24943
+ }
24944
+ else {
24945
+ // 对于左右位置,检查垂直对齐
24946
+ /** @type {?} */
24947
+ var popupHeight = popupSize.height;
24948
+ /** @type {?} */
24949
+ var spaceTop = triggerRect.top;
24950
+ /** @type {?} */
24951
+ var spaceBottom = viewportHeight - triggerRect.bottom;
24952
+ // 优先尝试使用用户指定的position
24953
+ if (checkPositionSpace(placement, preferredPosition)) {
24954
+ return preferredPosition;
24955
+ }
24956
+ // 如果中心对齐有足够空间,优先使用中心
24957
+ if (spaceTop >= popupHeight / 2 && spaceBottom >= popupHeight / 2) {
24958
+ return "center";
24959
+ }
24960
+ // 如果上方空间不足,使用下对齐
24961
+ if (spaceTop < popupHeight / 2) {
24962
+ return "end";
24963
+ }
24964
+ // 如果下方空间不足,使用上对齐
24965
+ if (spaceBottom < popupHeight / 2) {
24966
+ return "start";
24967
+ }
24968
+ return preferredPosition;
24969
+ }
24970
+ });
24971
+ // 如果首选位置有足够空间,优先使用用户指定的position
24972
+ if (hasEnoughSpace(preferred)) {
24973
+ // 检查用户指定的position是否有足够空间
24974
+ if (checkPositionSpace(preferred, preferredPosition)) {
24975
+ return {
24976
+ placement: preferred,
24977
+ position: preferredPosition,
24978
+ };
24979
+ }
24980
+ // 如果指定的position空间不足,自动计算最佳position
24981
+ return {
24982
+ placement: preferred,
24983
+ position: calculatePosition(preferred),
24984
+ };
24985
+ }
24986
+ // 根据首选位置选择备选位置
24987
+ /** @type {?} */
24988
+ var alternatives = {
24989
+ bottom: ["top", "right", "left"],
24990
+ top: ["bottom", "right", "left"],
24991
+ right: ["left", "bottom", "top"],
24992
+ left: ["right", "bottom", "top"],
24993
+ };
24994
+ /** @type {?} */
24995
+ var altList = alternatives[preferred] || [];
24996
+ try {
24997
+ // 尝试找到第一个有足够空间的备选位置
24998
+ for (var altList_1 = __values(altList), altList_1_1 = altList_1.next(); !altList_1_1.done; altList_1_1 = altList_1.next()) {
24999
+ var alt = altList_1_1.value;
25000
+ if (hasEnoughSpace(alt)) {
25001
+ return {
25002
+ placement: alt,
25003
+ position: calculatePosition(alt),
25004
+ };
25005
+ }
25006
+ }
25007
+ }
25008
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
25009
+ finally {
25010
+ try {
25011
+ if (altList_1_1 && !altList_1_1.done && (_a = altList_1.return)) _a.call(altList_1);
25012
+ }
25013
+ finally { if (e_1) throw e_1.error; }
25014
+ }
25015
+ // 如果都没有足够空间,选择空间最大的位置
25016
+ /** @type {?} */
25017
+ var maxSpace = Math.max(space.top, space.bottom, space.left, space.right);
25018
+ /** @type {?} */
25019
+ var bestPlacement;
25020
+ if (maxSpace === space.top)
25021
+ bestPlacement = "top";
25022
+ else if (maxSpace === space.bottom)
25023
+ bestPlacement = "bottom";
25024
+ else if (maxSpace === space.left)
25025
+ bestPlacement = "left";
25026
+ else
25027
+ bestPlacement = "right";
25028
+ return {
25029
+ placement: bestPlacement,
25030
+ position: calculatePosition(bestPlacement),
25031
+ };
25032
+ };
25033
+ // 计算位置坐标(纯计算,不依赖DOM,包含边界约束)
25034
+ // 计算位置坐标(纯计算,不依赖DOM,包含边界约束)
25035
+ /**
25036
+ * @private
25037
+ * @param {?} triggerRect
25038
+ * @param {?} placement
25039
+ * @param {?} position
25040
+ * @param {?} popupSize
25041
+ * @return {?}
25042
+ */
25043
+ SmartPopupComponent.prototype.calculatePositionCoordinates =
25044
+ // 计算位置坐标(纯计算,不依赖DOM,包含边界约束)
25045
+ /**
25046
+ * @private
25047
+ * @param {?} triggerRect
25048
+ * @param {?} placement
25049
+ * @param {?} position
25050
+ * @param {?} popupSize
25051
+ * @return {?}
25052
+ */
25053
+ function (triggerRect, placement, position, popupSize) {
25054
+ /** @type {?} */
25055
+ var triggerWidth = triggerRect.width;
25056
+ /** @type {?} */
25057
+ var triggerHeight = triggerRect.height;
25058
+ /** @type {?} */
25059
+ var viewportWidth = window.innerWidth;
25060
+ /** @type {?} */
25061
+ var viewportHeight = window.innerHeight;
25062
+ /** @type {?} */
25063
+ var scrollX = window.scrollX;
25064
+ /** @type {?} */
25065
+ var scrollY = window.scrollY;
25066
+ /** @type {?} */
25067
+ var top = 0;
25068
+ /** @type {?} */
25069
+ var left = 0;
25070
+ /** @type {?} */
25071
+ var translateX = "0";
25072
+ /** @type {?} */
25073
+ var translateY = "0";
25074
+ switch (placement) {
25075
+ case "top":
25076
+ top = triggerRect.top + scrollY - this.offset;
25077
+ translateY = "-100%";
25078
+ if (position === "start") {
25079
+ left = triggerRect.left + scrollX;
25080
+ }
25081
+ else if (position === "center") {
25082
+ left = triggerRect.left + scrollX + triggerWidth / 2;
25083
+ translateX = "-50%";
25084
+ }
25085
+ else {
25086
+ left = triggerRect.left + scrollX + triggerWidth;
25087
+ translateX = "-100%";
25088
+ }
25089
+ // 边界约束:确保弹窗不超出视口
25090
+ if (top - popupSize.height < scrollY) {
25091
+ top = scrollY + 8; // 距离顶部至少8px
25092
+ }
25093
+ if (left < scrollX) {
25094
+ left = scrollX + 8;
25095
+ translateX = "0";
25096
+ }
25097
+ else if (left + popupSize.width > scrollX + viewportWidth) {
25098
+ left = scrollX + viewportWidth - popupSize.width - 8;
25099
+ translateX = "0";
25100
+ }
25101
+ break;
25102
+ case "bottom":
25103
+ top = triggerRect.bottom + scrollY + this.offset;
25104
+ if (position === "start") {
25105
+ left = triggerRect.left + scrollX;
25106
+ }
25107
+ else if (position === "center") {
25108
+ left = triggerRect.left + scrollX + triggerWidth / 2;
25109
+ translateX = "-50%";
25110
+ }
25111
+ else {
25112
+ left = triggerRect.left + scrollX + triggerWidth;
25113
+ translateX = "-100%";
25114
+ }
25115
+ // 边界约束:确保弹窗不超出视口
25116
+ if (top + popupSize.height > scrollY + viewportHeight) {
25117
+ top = scrollY + viewportHeight - popupSize.height - 8; // 距离底部至少8px
25118
+ }
25119
+ if (left < scrollX) {
25120
+ left = scrollX + 8;
25121
+ translateX = "0";
25122
+ }
25123
+ else if (left + popupSize.width > scrollX + viewportWidth) {
25124
+ left = scrollX + viewportWidth - popupSize.width - 8;
25125
+ translateX = "0";
25126
+ }
25127
+ break;
25128
+ case "left":
25129
+ left = triggerRect.left + scrollX - this.offset;
25130
+ translateX = "-100%";
25131
+ if (position === "start") {
25132
+ top = triggerRect.top + scrollY;
25133
+ }
25134
+ else if (position === "center") {
25135
+ top = triggerRect.top + scrollY + triggerHeight / 2;
25136
+ translateY = "-50%";
25137
+ }
25138
+ else {
25139
+ top = triggerRect.top + scrollY + triggerHeight;
25140
+ translateY = "-100%";
25141
+ }
25142
+ // 边界约束:确保弹窗不超出视口
25143
+ if (left - popupSize.width < scrollX) {
25144
+ left = scrollX + 8; // 距离左侧至少8px
25145
+ }
25146
+ if (top < scrollY) {
25147
+ top = scrollY + 8;
25148
+ translateY = "0";
25149
+ }
25150
+ else if (top + popupSize.height > scrollY + viewportHeight) {
25151
+ top = scrollY + viewportHeight - popupSize.height - 8;
25152
+ translateY = "0";
25153
+ }
25154
+ break;
25155
+ case "right":
25156
+ left = triggerRect.right + scrollX + this.offset;
25157
+ if (position === "start") {
25158
+ top = triggerRect.top + scrollY;
25159
+ }
25160
+ else if (position === "center") {
25161
+ top = triggerRect.top + scrollY + triggerHeight / 2;
25162
+ translateY = "-50%";
25163
+ }
25164
+ else {
25165
+ top = triggerRect.top + scrollY + triggerHeight;
25166
+ translateY = "-100%";
25167
+ }
25168
+ // 边界约束:确保弹窗不超出视口
25169
+ if (left + popupSize.width > scrollX + viewportWidth) {
25170
+ left = scrollX + viewportWidth - popupSize.width - 8; // 距离右侧至少8px
25171
+ }
25172
+ if (top < scrollY) {
25173
+ top = scrollY + 8;
25174
+ translateY = "0";
25175
+ }
25176
+ else if (top + popupSize.height > scrollY + viewportHeight) {
25177
+ top = scrollY + viewportHeight - popupSize.height - 8;
25178
+ translateY = "0";
25179
+ }
25180
+ break;
25181
+ }
25182
+ return {
25183
+ top: top + "px",
25184
+ left: left + "px",
25185
+ translateX: translateX,
25186
+ translateY: translateY,
25187
+ };
25188
+ };
25189
+ /**
25190
+ * @param {?} triggerRect
25191
+ * @param {?} popupRect
25192
+ * @param {?} placement
25193
+ * @param {?} position
25194
+ * @param {?=} popupSize
25195
+ * @return {?}
25196
+ */
25197
+ SmartPopupComponent.prototype.setPopupPosition = /**
25198
+ * @param {?} triggerRect
25199
+ * @param {?} popupRect
25200
+ * @param {?} placement
25201
+ * @param {?} position
25202
+ * @param {?=} popupSize
25203
+ * @return {?}
25204
+ */
25205
+ function (triggerRect, popupRect, placement, position, popupSize) {
25206
+ /** @type {?} */
25207
+ var popupEl = this.popupElement && this.popupElement.nativeElement
25208
+ ? this.popupElement.nativeElement
25209
+ : null;
25210
+ if (!popupEl) {
25211
+ return; // 如果元素还不存在,无法设置位置
25212
+ }
25213
+ // 优先使用传入的固定尺寸,否则从DOM获取
25214
+ /** @type {?} */
25215
+ var popupWidth = popupSize && popupSize.width !== null && popupSize.width !== undefined
25216
+ ? popupSize.width
25217
+ : popupRect.width || popupEl.offsetWidth || 300;
25218
+ /** @type {?} */
25219
+ var popupHeight = popupSize && popupSize.height !== null && popupSize.height !== undefined
25220
+ ? popupSize.height
25221
+ : popupRect.height || popupEl.offsetHeight || 200;
25222
+ /** @type {?} */
25223
+ var coordinates = this.calculatePositionCoordinates(triggerRect, placement, position, { width: popupWidth, height: popupHeight });
25224
+ popupEl.style.top = coordinates.top;
25225
+ popupEl.style.left = coordinates.left;
25226
+ popupEl.style.transform = "translate(" + coordinates.translateX + ", " + coordinates.translateY + ")";
25227
+ };
25228
+ /**
25229
+ * @return {?}
25230
+ */
25231
+ SmartPopupComponent.prototype.onWindowResize = /**
25232
+ * @return {?}
25233
+ */
25234
+ function () {
25235
+ if (this.opened === "yes") {
25236
+ this.updatePopupPosition();
25237
+ }
25238
+ };
25239
+ SmartPopupComponent.decorators = [
25240
+ { type: core.Component, args: [{
25241
+ selector: "rs-smart-popup",
25242
+ template: "<!-- \u89E6\u53D1\u5143\u7D20\u63D2\u69FD -->\r\n<ng-container #trigger>\r\n <ng-content select=\"[trigger]\"></ng-content>\r\n</ng-container>\r\n\r\n<!-- \u5F39\u7A97\u5185\u5BB9 -->\r\n<div\r\n #popup\r\n class=\"rs-smart-popup-content\"\r\n [attr.data-opened]=\"opened\"\r\n [attr.data-positioning]=\"positioning\"\r\n (wheel)=\"onPopupWheel($event)\"\r\n (scroll)=\"onPopupScroll($event)\"\r\n>\r\n <div *ngIf=\"loading\" class=\"rs-smart-popup-loading\">\r\n <div class=\"loading-spinner\"></div>\r\n </div>\r\n <div *ngIf=\"!loading\" class=\"rs-smart-popup-body\">\r\n <ng-content></ng-content>\r\n </div>\r\n</div>\r\n\r\n",
25243
+ styles: [".rs-smart-popup-trigger{display:inline-block;cursor:pointer}::ng-deep #rs-smart-popup-fixed-container{width:0;height:0;z-index:100000;pointer-events:none}::ng-deep #rs-smart-popup-fixed-container .rs-smart-popup-content{pointer-events:auto;position:fixed;z-index:100001;padding:8px;border-radius:8px;background:#fff;box-shadow:0 0 8px 0 rgba(0,0,0,.25);min-width:200px;max-width:400px;max-height:500px;overflow:auto}::ng-deep #rs-smart-popup-fixed-container .rs-smart-popup-content[data-opened=no]{display:none}::ng-deep #rs-smart-popup-fixed-container .rs-smart-popup-content[data-opened=yes]{display:block}::ng-deep #rs-smart-popup-fixed-container .rs-smart-popup-content[data-opened=yes][data-positioning=yes]{display:none!important}::ng-deep #rs-smart-popup-fixed-container .rs-smart-popup-content[data-opened=yes][data-positioning=no]{display:block;visibility:visible;opacity:1;pointer-events:auto;-webkit-animation:.2s ease-out popup-fade-in;animation:.2s ease-out popup-fade-in}::ng-deep #rs-smart-popup-fixed-container .rs-smart-popup-content .rs-smart-popup-loading{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:20px;min-height:100px}::ng-deep #rs-smart-popup-fixed-container .rs-smart-popup-content .rs-smart-popup-loading .loading-spinner{width:24px;height:24px;border:3px solid #f3f3f3;border-top:3px solid #3498db;border-radius:50%;-webkit-animation:1s linear infinite spin;animation:1s linear infinite spin;margin-bottom:12px}::ng-deep #rs-smart-popup-fixed-container .rs-smart-popup-content .rs-smart-popup-loading .loading-text{color:#666;font-size:14px}@-webkit-keyframes spin{0%{transform:rotate(0)}100%{transform:rotate(360deg)}}@keyframes spin{0%{transform:rotate(0)}100%{transform:rotate(360deg)}}::ng-deep #rs-smart-popup-fixed-container .rs-smart-popup-content .rs-smart-popup-body{width:100%}@-webkit-keyframes popup-fade-in{from{opacity:0;transform:translate(var(--translate-x,0),var(--translate-y,0)) scale(.95)}to{opacity:1;transform:translate(var(--translate-x,0),var(--translate-y,0)) scale(1)}}@keyframes popup-fade-in{from{opacity:0;transform:translate(var(--translate-x,0),var(--translate-y,0)) scale(.95)}to{opacity:1;transform:translate(var(--translate-x,0),var(--translate-y,0)) scale(1)}}"]
25244
+ }] }
25245
+ ];
25246
+ /** @nocollapse */
25247
+ SmartPopupComponent.ctorParameters = function () { return [
25248
+ { type: core.ChangeDetectorRef }
25249
+ ]; };
25250
+ SmartPopupComponent.propDecorators = {
25251
+ _placement: [{ type: core.Input, args: ["placement",] }],
25252
+ _offset: [{ type: core.Input, args: ["offset",] }],
25253
+ _autoAdjust: [{ type: core.Input, args: ["autoAdjust",] }],
25254
+ triggerElementRef: [{ type: core.Input, args: ["triggerElement",] }],
25255
+ loading: [{ type: core.Input, args: ["loading",] }],
25256
+ _open: [{ type: core.Input, args: ["open",] }],
25257
+ _width: [{ type: core.Input, args: ["width",] }],
25258
+ _height: [{ type: core.Input, args: ["height",] }],
25259
+ openChange: [{ type: core.Output, args: ["openChange",] }],
25260
+ contentLoad: [{ type: core.Output, args: ["contentLoad",] }],
25261
+ internalTriggerElement: [{ type: core.ViewChild, args: ["trigger", { static: false },] }],
25262
+ popupElement: [{ type: core.ViewChild, args: ["popup", { static: false },] }],
25263
+ onWindowResize: [{ type: core.HostListener, args: ["window:resize",] }]
25264
+ };
25265
+ return SmartPopupComponent;
25266
+ }());
25267
+ if (false) {
25268
+ /** @type {?} */
25269
+ SmartPopupComponent.prototype._placement;
25270
+ /** @type {?} */
25271
+ SmartPopupComponent.prototype._offset;
25272
+ /** @type {?} */
25273
+ SmartPopupComponent.prototype._autoAdjust;
25274
+ /** @type {?} */
25275
+ SmartPopupComponent.prototype.triggerElementRef;
25276
+ /** @type {?} */
25277
+ SmartPopupComponent.prototype.loading;
25278
+ /** @type {?} */
25279
+ SmartPopupComponent.prototype._open;
25280
+ /** @type {?} */
25281
+ SmartPopupComponent.prototype._width;
25282
+ /** @type {?} */
25283
+ SmartPopupComponent.prototype._height;
25284
+ /** @type {?} */
25285
+ SmartPopupComponent.prototype.openChange;
25286
+ /** @type {?} */
25287
+ SmartPopupComponent.prototype.contentLoad;
25288
+ /** @type {?} */
25289
+ SmartPopupComponent.prototype.internalTriggerElement;
25290
+ /** @type {?} */
25291
+ SmartPopupComponent.prototype.popupElement;
25292
+ /** @type {?} */
25293
+ SmartPopupComponent.prototype.currentTriggerElement;
25294
+ /** @type {?} */
25295
+ SmartPopupComponent.prototype.FIXED_CONTAINER_ID;
25296
+ /** @type {?} */
25297
+ SmartPopupComponent.prototype.fixedContainerEl;
25298
+ /** @type {?} */
25299
+ SmartPopupComponent.prototype.opened;
25300
+ /** @type {?} */
25301
+ SmartPopupComponent.prototype.positioning;
25302
+ /** @type {?} */
25303
+ SmartPopupComponent.prototype.actualPlacement;
25304
+ /** @type {?} */
25305
+ SmartPopupComponent.prototype.actualPosition;
25306
+ /** @type {?} */
25307
+ SmartPopupComponent.prototype.onClickOutside;
25308
+ /** @type {?} */
25309
+ SmartPopupComponent.prototype.onWindowScroll;
25310
+ /**
25311
+ * @type {?}
25312
+ * @private
25313
+ */
25314
+ SmartPopupComponent.prototype.ref;
25315
+ }
25316
+
24112
25317
  /**
24113
25318
  * @fileoverview added by tsickle
24114
25319
  * Generated from: lib/dashboard/dashboard.service.ts
@@ -52178,6 +53383,7 @@
52178
53383
  RSNavCardGroupComponent,
52179
53384
  RSToolbarComponent,
52180
53385
  TruncatedTextToggleComponent,
53386
+ SmartPopupComponent,
52181
53387
  RSStepperComponent,
52182
53388
  PaneGroupNewComponent,
52183
53389
  SidebarIconlistNewComponent,
@@ -52360,6 +53566,7 @@
52360
53566
  RSNavCardGroupComponent,
52361
53567
  RSToolbarComponent,
52362
53568
  TruncatedTextToggleComponent,
53569
+ SmartPopupComponent,
52363
53570
  CommonDialogComponent,
52364
53571
  RSStepperComponent,
52365
53572
  PaneGroupNewComponent,
@@ -52425,6 +53632,7 @@
52425
53632
  exports.RsPageListComponent = RsPageListComponent;
52426
53633
  exports.RsPageTabComponent = RsPageTabComponent;
52427
53634
  exports.SearchInputComponent = SearchInputComponent;
53635
+ exports.SmartPopupComponent = SmartPopupComponent;
52428
53636
  exports.SwitchInputComponent = SwitchInputComponent;
52429
53637
  exports.TagInputComponent = TagInputComponent;
52430
53638
  exports.ToolbarItemComponent = ToolbarItemComponent;