@magic-xpa/angular 4.1300.0-dev4130.210 → 4.1300.0-dev4130.212

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.
@@ -1004,6 +1004,61 @@ class GuiInteractiveExecutor {
1004
1004
  }
1005
1005
  }
1006
1006
 
1007
+ class MagicModalProperties {
1008
+ static formName = "overlay";
1009
+ static showTitleBar = true;
1010
+ static x = 0;
1011
+ static y = 0;
1012
+ static width = "300px";
1013
+ static height = "300px";
1014
+ static isCenteredToWindow = true;
1015
+ static shouldCloseOnBackgroundClick = true;
1016
+ static isResizable = true;
1017
+ static isMovable = true;
1018
+ constructor(formName, showTitleBar, x, y, width, height, isCenteredToWindow, shouldCloseOnBackgroundClick, isResizable, isMovable) {
1019
+ MagicModalProperties.formName = formName;
1020
+ MagicModalProperties.showTitleBar = showTitleBar;
1021
+ MagicModalProperties.x = x;
1022
+ MagicModalProperties.y = y;
1023
+ MagicModalProperties.width = width;
1024
+ MagicModalProperties.height = height;
1025
+ MagicModalProperties.isCenteredToWindow = isCenteredToWindow;
1026
+ MagicModalProperties.shouldCloseOnBackgroundClick = shouldCloseOnBackgroundClick;
1027
+ MagicModalProperties.isResizable = isResizable;
1028
+ MagicModalProperties.isMovable = isMovable;
1029
+ }
1030
+ X() {
1031
+ return MagicModalProperties.x;
1032
+ }
1033
+ Y() {
1034
+ return MagicModalProperties.y;
1035
+ }
1036
+ Width() {
1037
+ return MagicModalProperties.width;
1038
+ }
1039
+ Height() {
1040
+ return MagicModalProperties.height;
1041
+ }
1042
+ IsCenteredToWindow() {
1043
+ return MagicModalProperties.isCenteredToWindow;
1044
+ }
1045
+ FormName() {
1046
+ return MagicModalProperties.formName;
1047
+ }
1048
+ ShowTitleBar() {
1049
+ return MagicModalProperties.showTitleBar;
1050
+ }
1051
+ ShouldCloseOnBackgroundClick() {
1052
+ return MagicModalProperties.shouldCloseOnBackgroundClick;
1053
+ }
1054
+ IsResizable() {
1055
+ return MagicModalProperties.isResizable;
1056
+ }
1057
+ IsMovable() {
1058
+ return MagicModalProperties.isMovable;
1059
+ }
1060
+ }
1061
+
1007
1062
  let BaseMagicOverlayContainer = class BaseMagicOverlayContainer {
1008
1063
  };
1009
1064
  __decorate([
@@ -1143,7 +1198,7 @@ class MagicOverlayContainer extends BaseMagicOverlayContainer {
1143
1198
  ngOnInit() {
1144
1199
  this.componentRef = this.modalbodyViewContainerRef.createComponent(this.ModalComp);
1145
1200
  Object.assign(this.componentRef.instance, this.ModalCompParameters);
1146
- let comp = this.componentRef.instance;
1201
+ let comp = this.getOverlayProps();
1147
1202
  this.isCenteredToWindow = comp.IsCenteredToWindow();
1148
1203
  }
1149
1204
  ngAfterViewInit() {
@@ -1162,7 +1217,7 @@ class MagicOverlayContainer extends BaseMagicOverlayContainer {
1162
1217
  */
1163
1218
  getText() {
1164
1219
  if (this.componentRef !== null) {
1165
- let comp = this.componentRef.instance;
1220
+ let comp = this.getOverlayProps();
1166
1221
  return comp.FormName();
1167
1222
  }
1168
1223
  else
@@ -1181,7 +1236,7 @@ class MagicOverlayContainer extends BaseMagicOverlayContainer {
1181
1236
  getStyle() {
1182
1237
  let styles = {};
1183
1238
  if (this.componentRef != undefined) {
1184
- let comp = this.componentRef.instance;
1239
+ let comp = this.getOverlayProps();
1185
1240
  styles['width'] = comp.Width();
1186
1241
  styles['height'] = comp.Height();
1187
1242
  if (this.isCenteredToWindow) {
@@ -1218,7 +1273,7 @@ class MagicOverlayContainer extends BaseMagicOverlayContainer {
1218
1273
  */
1219
1274
  getShowTitleBar() {
1220
1275
  if (this.componentRef != undefined) {
1221
- let comp = this.componentRef.instance;
1276
+ let comp = this.getOverlayProps();
1222
1277
  return comp.ShowTitleBar();
1223
1278
  }
1224
1279
  }
@@ -1232,7 +1287,7 @@ class MagicOverlayContainer extends BaseMagicOverlayContainer {
1232
1287
  * Handles click in the background window
1233
1288
  */
1234
1289
  OnBackgroundClick() {
1235
- let comp = this.componentRef.instance;
1290
+ let comp = this.getOverlayProps();
1236
1291
  if (comp.ShouldCloseOnBackgroundClick())
1237
1292
  this.OnClose();
1238
1293
  }
@@ -1241,7 +1296,7 @@ class MagicOverlayContainer extends BaseMagicOverlayContainer {
1241
1296
  * @returns {boolean} True if the overlay is resizable, false otherwise.
1242
1297
  */
1243
1298
  IsResizable() {
1244
- let comp = this.componentRef.instance;
1299
+ let comp = this.getOverlayProps();
1245
1300
  return comp.IsResizable();
1246
1301
  }
1247
1302
  /**
@@ -1249,7 +1304,7 @@ class MagicOverlayContainer extends BaseMagicOverlayContainer {
1249
1304
  * @returns {boolean} True if the overlay is movable, false otherwise.
1250
1305
  */
1251
1306
  IsMovable() {
1252
- let comp = this.componentRef.instance;
1307
+ let comp = this.getOverlayProps();
1253
1308
  return comp.IsMovable();
1254
1309
  }
1255
1310
  /**
@@ -1343,6 +1398,12 @@ class MagicOverlayContainer extends BaseMagicOverlayContainer {
1343
1398
  this.resizing = false;
1344
1399
  this.resizeDirection = null;
1345
1400
  }
1401
+ getOverlayProps() {
1402
+ let obj = this.componentRef.instance;
1403
+ if (obj && obj.magicModalProperties instanceof MagicModalProperties)
1404
+ obj = obj.magicModalProperties;
1405
+ return obj;
1406
+ }
1346
1407
  /** @nocollapse */ static ɵfac = function MagicOverlayContainer_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || MagicOverlayContainer)(); };
1347
1408
  /** @nocollapse */ static ɵcmp = /** @pureOrBreakMyCode */ i0.ɵɵdefineComponent({ type: MagicOverlayContainer, selectors: [["app-magic-overlay-container"]], viewQuery: function MagicOverlayContainer_Query(rf, ctx) { if (rf & 1) {
1348
1409
  i0.ɵɵviewQuery(_c0$3, 5)(_c1$1, 5);
@@ -1387,43 +1448,43 @@ class MagicOverlayContainer extends BaseMagicOverlayContainer {
1387
1448
  }
1388
1449
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(MagicOverlayContainer, [{
1389
1450
  type: Component,
1390
- args: [{ selector: 'app-magic-overlay-container', template: `
1391
- <div class="boundary-line">
1392
-
1393
- <div class="modal-background" (click)="OnBackgroundClick()">
1394
- @if (!getShowTitleBar()) {
1395
- <button (click)="OnClose()" tabindex="-1" style="float:right; border: none; background-color: transparent; outline: none; color: white">X</button>
1396
- }
1397
- </div>
1398
-
1399
- <div #modalForeground class="modal-foreground" [ngStyle]="getStyle()" cdkDragBoundary=".boundary-line" cdkDrag [cdkDragDisabled]="!IsMovable()">
1400
-
1401
- @if (IsResizable() && !isRtl) {
1402
- <span class="dragHandle right" (mousedown)="onResizeStart($event, 'right')"></span>
1403
- }
1404
- @if (IsResizable() && isRtl) {
1405
- <span class="dragHandle left" (mousedown)="onResizeStart($event, 'left')"></span>
1406
- }
1407
- @if (IsResizable()) {
1408
- <span class="dragHandle corner" (mousedown)="onResizeStart($event, 'corner')"></span>
1409
- }
1410
- @if (IsResizable()) {
1411
- <span class="dragHandle bottom" (mousedown)="onResizeStart($event, 'bottom')"></span>
1412
- }
1413
-
1414
- @if (getShowTitleBar()) {
1415
- <div #modalheader class="modal-header" cdkDragHandle [class.movable]="IsMovable()">
1416
- {{getText()}}
1417
- <button (click)="OnClose()" style="float:right" tabindex="-1">X</button>
1418
- </div>
1419
- }
1420
-
1421
- <div [ngStyle]="getClientAreaStyles()">
1422
- <div #modalbody magicViewContainerRef>
1423
- </div>
1424
- </div>
1425
- </div>
1426
- </div>
1451
+ args: [{ selector: 'app-magic-overlay-container', template: `
1452
+ <div class="boundary-line">
1453
+
1454
+ <div class="modal-background" (click)="OnBackgroundClick()">
1455
+ @if (!getShowTitleBar()) {
1456
+ <button (click)="OnClose()" tabindex="-1" style="float:right; border: none; background-color: transparent; outline: none; color: white">X</button>
1457
+ }
1458
+ </div>
1459
+
1460
+ <div #modalForeground class="modal-foreground" [ngStyle]="getStyle()" cdkDragBoundary=".boundary-line" cdkDrag [cdkDragDisabled]="!IsMovable()">
1461
+
1462
+ @if (IsResizable() && !isRtl) {
1463
+ <span class="dragHandle right" (mousedown)="onResizeStart($event, 'right')"></span>
1464
+ }
1465
+ @if (IsResizable() && isRtl) {
1466
+ <span class="dragHandle left" (mousedown)="onResizeStart($event, 'left')"></span>
1467
+ }
1468
+ @if (IsResizable()) {
1469
+ <span class="dragHandle corner" (mousedown)="onResizeStart($event, 'corner')"></span>
1470
+ }
1471
+ @if (IsResizable()) {
1472
+ <span class="dragHandle bottom" (mousedown)="onResizeStart($event, 'bottom')"></span>
1473
+ }
1474
+
1475
+ @if (getShowTitleBar()) {
1476
+ <div #modalheader class="modal-header" cdkDragHandle [class.movable]="IsMovable()">
1477
+ {{getText()}}
1478
+ <button (click)="OnClose()" style="float:right" tabindex="-1">X</button>
1479
+ </div>
1480
+ }
1481
+
1482
+ <div [ngStyle]="getClientAreaStyles()">
1483
+ <div #modalbody magicViewContainerRef>
1484
+ </div>
1485
+ </div>
1486
+ </div>
1487
+ </div>
1427
1488
  `, standalone: false, styles: [".modal-foreground{position:fixed;inset:0;background-color:#fff}.modal-background{position:fixed;inset:0;background-color:#000;opacity:.75}.modal-header{background-color:beige;border-bottom:2px solid red}.modal-header.movable:active{cursor:move}.container{position:relative}.dragHandle{position:absolute}.dragHandle.corner{width:10px;right:0;bottom:0;height:10px;cursor:nwse-resize;background:linear-gradient(135deg,rgba(0,0,0,.4) 50%,transparent 50%);position:absolute}:host-context([dir=\"rtl\"]) .dragHandle.corner{right:auto!important;left:0;cursor:nesw-resize;background:linear-gradient(225deg,rgba(0,0,0,.4) 50%,transparent 50%)}.dragHandle.left{width:2px;left:-2px;height:100%;cursor:ew-resize}.dragHandle.right{width:2px;right:-2px;height:100%;cursor:ew-resize}.dragHandle.bottom{height:2px;bottom:-2px;width:100%;cursor:ns-resize}.boundary-line{width:100%;height:100%;max-width:100%}\n"] }]
1428
1489
  }], () => [], { headerElementRef: [{
1429
1490
  type: ViewChild,
@@ -1444,7 +1505,7 @@ class MagicOverlayContainer extends BaseMagicOverlayContainer {
1444
1505
  type: HostListener,
1445
1506
  args: ['window:mouseup']
1446
1507
  }] }); })();
1447
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(MagicOverlayContainer, { className: "MagicOverlayContainer", filePath: "src/ui/magic-modal/magic-overlay-container.ts", lineNumber: 64 }); })();
1508
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(MagicOverlayContainer, { className: "MagicOverlayContainer", filePath: "src/ui/magic-modal/magic-overlay-container.ts", lineNumber: 65 }); })();
1448
1509
 
1449
1510
  /**
1450
1511
  * Service managing overlay windows
@@ -7073,5 +7134,5 @@ class ModalFormDefinition {
7073
7134
  * Generated bundle index. Do not edit.
7074
7135
  */
7075
7136
 
7076
- export { AccessorMagicService, BaseMagicAlertComponent, BaseMagicConfirmComponent, BaseMagicOverlayContainer, CHECKBOX_VALUE_ACCESSOR, COLOR_FILE_NAME, CheckboxMagicDirective, CheckboxNoFormControlMagicDirective, ComboboxMagicDirective, CommandsCollectorMagicService, ComponentListMagicService, ConfirmationComponentsMagicProvider, Constants, ControlMetadata, ControlsMetadata, DATE_VALUE_ACCESSOR, DateMagicPipe, DateValueAccessor, EngineMagicService, ErrorMagicComponent, ExitMagicService, GuiInteractiveExecutor, HtmlClasses, InputNoFormControlMagicDirective, MAGIC_BG_COLOR, MAGIC_DEFAULT_VALUE_ACCESSOR, MAGIC_FG_COLOR, MG_FORMATS, MagicAlertComponent, MagicCheckboxControlValueAccessor, MagicColorService, MagicConfirmationBoxComponent, MagicDefaultValueAccessor, MagicDirective, MagicFocusDirective, MagicLazyLoaderService, MagicModule, MagicOverlayContainer, MagicOverlayContainerWrapper, MagicServices, MagicShellComponent, MagicViewContainerRef, MgDateAdapter, MgDateFormatter, MgformatMagicDirective, ModalFormDefinition, NoControlMagicDirective, NonMagicControlDirective, OverlayContainerMagicProvider, OverlayWindowService, RangeValidatorMagicDirective, Records, RouteCommand, RouterCommandsMagicService, RouterContainerMagicComponent, RowMagicDirective, StylesMapManager, SubformMagicComponent, SubformMagicService, SubscriberService, TableMagicService, TaskBaseMagicComponent, TaskMagicService, Time24MagicPipe, TimeMagicPipe, TitleMagicService, basicMagicProviders, confirmationBox, magicProviders, matDateProviders, utils };
7137
+ export { AccessorMagicService, BaseMagicAlertComponent, BaseMagicConfirmComponent, BaseMagicOverlayContainer, CHECKBOX_VALUE_ACCESSOR, COLOR_FILE_NAME, CheckboxMagicDirective, CheckboxNoFormControlMagicDirective, ComboboxMagicDirective, CommandsCollectorMagicService, ComponentListMagicService, ConfirmationComponentsMagicProvider, Constants, ControlMetadata, ControlsMetadata, DATE_VALUE_ACCESSOR, DateMagicPipe, DateValueAccessor, EngineMagicService, ErrorMagicComponent, ExitMagicService, GuiInteractiveExecutor, HtmlClasses, InputNoFormControlMagicDirective, MAGIC_BG_COLOR, MAGIC_DEFAULT_VALUE_ACCESSOR, MAGIC_FG_COLOR, MG_FORMATS, MagicAlertComponent, MagicCheckboxControlValueAccessor, MagicColorService, MagicConfirmationBoxComponent, MagicDefaultValueAccessor, MagicDirective, MagicFocusDirective, MagicLazyLoaderService, MagicModalProperties, MagicModule, MagicOverlayContainer, MagicOverlayContainerWrapper, MagicServices, MagicShellComponent, MagicViewContainerRef, MgDateAdapter, MgDateFormatter, MgformatMagicDirective, ModalFormDefinition, NoControlMagicDirective, NonMagicControlDirective, OverlayContainerMagicProvider, OverlayWindowService, RangeValidatorMagicDirective, Records, RouteCommand, RouterCommandsMagicService, RouterContainerMagicComponent, RowMagicDirective, StylesMapManager, SubformMagicComponent, SubformMagicService, SubscriberService, TableMagicService, TaskBaseMagicComponent, TaskMagicService, Time24MagicPipe, TimeMagicPipe, TitleMagicService, basicMagicProviders, confirmationBox, magicProviders, matDateProviders, utils };
7077
7138
  //# sourceMappingURL=magic-xpa-angular.mjs.map