@magic-xpa/angular 4.1300.0-dev4130.28 → 4.1300.0-dev4130.281

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.
@@ -1,28 +1,27 @@
1
1
  import { isNullOrUndefined, NString, List, isUndefined, StringBuilder, RefParam } from '@magic-xpa/mscorelib';
2
2
  import * as i0 from '@angular/core';
3
- import { Injectable, Component, Input, Output, Directive, EventEmitter, HostListener, ViewChild, InjectionToken, Inject, Optional, Pipe, forwardRef, NgModule } from '@angular/core';
3
+ import { Injectable, inject, Injector, createNgModule, ViewContainerRef, ChangeDetectionStrategy, Component, Directive, EventEmitter, HostListener, Output, Input, ViewChild, input, output, ElementRef, viewChild, ChangeDetectorRef, InjectionToken, DestroyRef, Renderer2, Pipe, effect, forwardRef, NgModule } from '@angular/core';
4
4
  import * as i1 from '@angular/common';
5
5
  import { DatePipe, CommonModule, formatDate } from '@angular/common';
6
- import * as i2 from '@angular/router';
7
- import { NavigationEnd, RouterModule } from '@angular/router';
6
+ import { ActivatedRoute, Router, NavigationEnd, RouterModule } from '@angular/router';
8
7
  import { FormGroup, FormControl, Validators, NG_VALIDATORS, NG_VALUE_ACCESSOR, CheckboxControlValueAccessor, DefaultValueAccessor, FormsModule, ReactiveFormsModule } from '@angular/forms';
9
- import * as i2$3 from 'ng-dynamic-component';
8
+ import * as i1$1 from 'ng-dynamic-component';
10
9
  import { DynamicModule } from 'ng-dynamic-component';
11
10
  import { InteractiveCommandType, HtmlProperties, OverlayType, Styles, GuiConstants, CommandType, PIC, GuiEnvironment, Events, Modifiers } from '@magic-xpa/gui';
12
11
  import { MagicBridge, getGuiEventObj, CookieService, Environment, LastFocusedManager } from '@magic-xpa/engine';
12
+ import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
13
13
  import { MagicProperties, Logger, StrUtil, StorageAttribute, PICInterface, MsgInterface, BindingLevel, StorageAttributeType, MgControlType } from '@magic-xpa/utils';
14
+ import { Subject, EMPTY, fromEvent, Observable } from 'rxjs';
14
15
  import { filter, map, debounceTime, take } from 'rxjs/operators';
15
- import { Subject, EMPTY, fromEvent } from 'rxjs';
16
- import { __decorate, __metadata } from 'tslib';
17
- import * as i2$1 from '@angular/cdk/drag-drop';
16
+ import * as i2 from '@angular/cdk/drag-drop';
18
17
  import { DragDropModule, CdkDragHandle, CdkDrag } from '@angular/cdk/drag-drop';
19
- import * as i1$1 from '@angular/platform-browser';
20
- import * as i1$2 from '@angular/common/http';
21
- import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http';
18
+ import { Title } from '@angular/platform-browser';
19
+ import { HttpClient, provideHttpClient, withXhr, withInterceptorsFromDi } from '@angular/common/http';
22
20
  import { maskitoTimeOptionsGenerator } from '@maskito/kit';
23
- import * as i2$2 from '@angular/cdk/platform';
24
- import { MaskitoModule } from '@maskito/angular';
21
+ import { Platform } from '@angular/cdk/platform';
22
+ import { MaskitoDirective } from '@maskito/angular';
25
23
  import { NativeDateAdapter, MAT_DATE_LOCALE, DateAdapter, MAT_DATE_FORMATS } from '@angular/material/core';
24
+ import { io } from 'socket.io-client';
26
25
 
27
26
  /**
28
27
  * @ignore
@@ -239,6 +238,63 @@ var HtmlClasses;
239
238
  HtmlClasses["HintColor"] = "hintcolor";
240
239
  })(HtmlClasses || (HtmlClasses = {}));
241
240
 
241
+ /**
242
+ * Notifies Angular that Magic state changed outside of its knowledge.
243
+ *
244
+ * The WebClient runs zoneless, so Angular no longer re-renders the application
245
+ * after every asynchronous task. Change detection is triggered only by Angular's
246
+ * own APIs - a template event binding, a signal write, `markForCheck()` and so on.
247
+ *
248
+ * Magic drives the UI from sources Angular cannot observe: DOM listeners registered
249
+ * through `Renderer2`, the engine's event loop, and socket callbacks. Every such
250
+ * source calls {@link notify}, and the Magic components refresh themselves in response.
251
+ *
252
+ * Application code can use this service for the same purpose. Call {@link notify}
253
+ * after changing component state from a callback Angular does not control - a
254
+ * `setTimeout`, a `Promise`, a `fetch` response or a third-party widget event:
255
+ *
256
+ * ```ts
257
+ * export class MyForm extends TaskBaseMagicComponent {
258
+ * private readonly magicChangeDetection = inject(MagicChangeDetectionService);
259
+ *
260
+ * override mgOnLoad(): void {
261
+ * setTimeout(() => {
262
+ * this.statusText = 'Ready';
263
+ * this.magicChangeDetection.notify();
264
+ * }, 1000);
265
+ * }
266
+ * }
267
+ * ```
268
+ *
269
+ * Notifications are coalesced by Angular's scheduler, so calling {@link notify}
270
+ * several times in a row still results in a single refresh.
271
+ */
272
+ class MagicChangeDetectionService {
273
+ /**
274
+ * @ignore
275
+ */
276
+ changedSubject = new Subject();
277
+ /**
278
+ * Emits whenever Magic state changed and the views should be refreshed.
279
+ * Subscribers are expected to mark their view for check.
280
+ */
281
+ changed = this.changedSubject.asObservable();
282
+ /**
283
+ * Notify Angular that state which the templates depend on has changed.
284
+ */
285
+ notify() {
286
+ this.changedSubject.next();
287
+ }
288
+ /** @nocollapse */ static ɵfac = function MagicChangeDetectionService_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || MagicChangeDetectionService)(); };
289
+ /** @nocollapse */ static ɵprov = /** @pureOrBreakMyCode */ i0.ɵɵdefineInjectable({ token: MagicChangeDetectionService, factory: MagicChangeDetectionService.ɵfac, providedIn: 'root' });
290
+ }
291
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(MagicChangeDetectionService, [{
292
+ type: Injectable,
293
+ args: [{
294
+ providedIn: 'root'
295
+ }]
296
+ }], null, null); })();
297
+
242
298
  /**
243
299
  * @ignore
244
300
  */
@@ -279,6 +335,9 @@ class EngineMagicService {
279
335
  //TODO - unregister
280
336
  refreshDom = new Subject();
281
337
  interactiveCommands = new Subject();
338
+ // Injected as a field rather than a constructor parameter so that the public
339
+ // constructor signature stays unchanged for anyone extending this service.
340
+ magicChangeDetection = inject(MagicChangeDetectionService);
282
341
  startMagicEngine(httpClient, args) {
283
342
  this.magicBridge.registerExecuteCommandsCallback(data => {
284
343
  if (!this.isStub) {
@@ -294,11 +353,17 @@ class EngineMagicService {
294
353
  console.log('moving to stub mode');
295
354
  this.isStub = true;
296
355
  }
356
+ finally {
357
+ // The engine finished a batch of UI commands. Running zoneless, this is the
358
+ // single point where every server-driven change becomes visible to Angular.
359
+ this.magicChangeDetection.notify();
360
+ }
297
361
  }
298
362
  });
299
363
  this.magicBridge.registerInteractiveCallback(data => {
300
364
  if (!this.isStub) {
301
365
  this.interactiveCommands.next(data);
366
+ this.magicChangeDetection.notify();
302
367
  }
303
368
  });
304
369
  this.magicBridge.Initialize(httpClient, args);
@@ -309,6 +374,11 @@ class EngineMagicService {
309
374
  insertEvent(guiEvent) {
310
375
  if (!this.isStub)
311
376
  this.magicBridge.insertEvent(guiEvent);
377
+ // Every Magic UI event - from the DOM listeners registered by MagicDirective and
378
+ // its subclasses, from the accessor service, and from the overlay service - reaches
379
+ // the engine through here. Renderer2 listeners do not notify Angular's scheduler on
380
+ // their own, so this is where an interaction becomes a change-detection trigger.
381
+ this.magicChangeDetection.notify();
312
382
  }
313
383
  GetRangedValue(taskId, controlName, value) {
314
384
  return this.magicBridge.GetRangedValue(taskId, controlName, value);
@@ -430,12 +500,11 @@ class ComponentListMagicService {
430
500
  * @ignore
431
501
  */
432
502
  class CommandsCollectorMagicService {
433
- magic;
434
503
  count = 0;
435
504
  commands = new List();
436
505
  subscription = null;
437
- constructor(magic) {
438
- this.magic = magic;
506
+ magic = inject(EngineMagicService);
507
+ constructor() {
439
508
  }
440
509
  startCollecting() {
441
510
  this.count++;
@@ -460,7 +529,7 @@ class CommandsCollectorMagicService {
460
529
  commands.forEach(command => { this.commands.Remove(command); });
461
530
  return commands;
462
531
  }
463
- /** @nocollapse */ static ɵfac = function CommandsCollectorMagicService_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || CommandsCollectorMagicService)(i0.ɵɵinject(EngineMagicService)); };
532
+ /** @nocollapse */ static ɵfac = function CommandsCollectorMagicService_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || CommandsCollectorMagicService)(); };
464
533
  /** @nocollapse */ static ɵprov = /** @pureOrBreakMyCode */ i0.ɵɵdefineInjectable({ token: CommandsCollectorMagicService, factory: CommandsCollectorMagicService.ɵfac, providedIn: 'root' });
465
534
  }
466
535
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(CommandsCollectorMagicService, [{
@@ -468,7 +537,7 @@ class CommandsCollectorMagicService {
468
537
  args: [{
469
538
  providedIn: 'root'
470
539
  }]
471
- }], () => [{ type: EngineMagicService }], null); })();
540
+ }], () => [], null); })();
472
541
 
473
542
  /**
474
543
  * @ignore
@@ -522,32 +591,21 @@ class MagicLazyLoaderService {
522
591
  * Service for managing subforms and routing
523
592
  */
524
593
  class SubformMagicService {
525
- task;
526
- activatedRoute;
527
- componentList;
528
- pendingCommandsCollector;
529
- router;
530
- routerCommandsMagicService;
531
- componentListMagicService;
532
- loader;
533
- injector;
534
- compiler;
535
594
  subformsDict /*:{ [x: string]: SubformDefinition }*/ = {};
536
595
  routesDict = {}; // dictionary of router outlet to router path
537
596
  currentRouteDefinition = null;
538
597
  static currentCallerMgSubformServiceRef = null;
539
598
  static routerContainers = new Array();
540
- constructor(task, activatedRoute, componentList, pendingCommandsCollector, router, routerCommandsMagicService, componentListMagicService, loader, injector, compiler) {
541
- this.task = task;
542
- this.activatedRoute = activatedRoute;
543
- this.componentList = componentList;
544
- this.pendingCommandsCollector = pendingCommandsCollector;
545
- this.router = router;
546
- this.routerCommandsMagicService = routerCommandsMagicService;
547
- this.componentListMagicService = componentListMagicService;
548
- this.loader = loader;
549
- this.injector = injector;
550
- this.compiler = compiler;
599
+ task = inject(TaskMagicService);
600
+ activatedRoute = inject(ActivatedRoute);
601
+ componentList = inject(ComponentListMagicService);
602
+ pendingCommandsCollector = inject(CommandsCollectorMagicService);
603
+ router = inject(Router);
604
+ routerCommandsMagicService = inject(RouterCommandsMagicService);
605
+ componentListMagicService = inject(ComponentListMagicService);
606
+ loader = inject(MagicLazyLoaderService);
607
+ injector = inject(Injector);
608
+ constructor() {
551
609
  }
552
610
  /**
553
611
  * Finds and returns the component according to the subform name
@@ -608,8 +666,7 @@ class SubformMagicService {
608
666
  // extract name of module(XX) from 'MagicXXModule'
609
667
  const moduleName = lazyLoadModule.moduleName.slice(Magic.length, -Module.length);
610
668
  this.loader.Load(moduleName).then(m => {
611
- const compiled = this.compiler.compileModuleAndAllComponentsSync(m[lazyLoadModule.moduleName]);
612
- moduleRef = compiled.ngModuleFactory.create(this.injector);
669
+ moduleRef = createNgModule(m[lazyLoadModule.moduleName], this.injector);
613
670
  this.subformsDict[subformControlName] = {
614
671
  formName,
615
672
  parameters: { taskIdParam: taskId, taskDescription: taskDescription }
@@ -749,25 +806,17 @@ class SubformMagicService {
749
806
  }
750
807
  return currentActiveRoute;
751
808
  }
752
- /** @nocollapse */ static ɵfac = function SubformMagicService_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || SubformMagicService)(i0.ɵɵinject(TaskMagicService), i0.ɵɵinject(i2.ActivatedRoute), i0.ɵɵinject(ComponentListMagicService), i0.ɵɵinject(CommandsCollectorMagicService), i0.ɵɵinject(i2.Router), i0.ɵɵinject(RouterCommandsMagicService), i0.ɵɵinject(ComponentListMagicService), i0.ɵɵinject(MagicLazyLoaderService), i0.ɵɵinject(i0.Injector), i0.ɵɵinject(i0.Compiler)); };
809
+ /** @nocollapse */ static ɵfac = function SubformMagicService_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || SubformMagicService)(); };
753
810
  /** @nocollapse */ static ɵprov = /** @pureOrBreakMyCode */ i0.ɵɵdefineInjectable({ token: SubformMagicService, factory: SubformMagicService.ɵfac });
754
811
  }
755
812
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(SubformMagicService, [{
756
813
  type: Injectable
757
- }], () => [{ type: TaskMagicService }, { type: i2.ActivatedRoute }, { type: ComponentListMagicService }, { type: CommandsCollectorMagicService }, { type: i2.Router }, { type: RouterCommandsMagicService }, { type: ComponentListMagicService }, { type: MagicLazyLoaderService }, { type: i0.Injector }, { type: i0.Compiler }], null); })();
814
+ }], () => [], null); })();
758
815
 
759
816
  /**
760
817
  * Mock component, implements routing by connecting the requested URL with the appropriate Magic task
761
818
  */
762
819
  class RouterContainerMagicComponent {
763
- activatedRoute;
764
- router;
765
- magic;
766
- containerTaskService;
767
- viewContainerRef;
768
- componentList;
769
- pendingCommandsCollector;
770
- routerCommandsMagicService;
771
820
  componentRef = null;
772
821
  parentMgSubformService = null;
773
822
  static lastRoute = "/";
@@ -775,6 +824,14 @@ class RouterContainerMagicComponent {
775
824
  static get LastRoute() {
776
825
  return RouterContainerMagicComponent.lastRoute;
777
826
  }
827
+ activatedRoute = inject(ActivatedRoute);
828
+ router = inject(Router);
829
+ magic = inject(EngineMagicService);
830
+ containerTaskService = inject(TaskMagicService);
831
+ viewContainerRef = inject(ViewContainerRef);
832
+ componentList = inject(ComponentListMagicService);
833
+ pendingCommandsCollector = inject(CommandsCollectorMagicService);
834
+ routerCommandsMagicService = inject(RouterCommandsMagicService);
778
835
  /**
779
836
  *
780
837
  * @param changeDetectorRef
@@ -785,16 +842,7 @@ class RouterContainerMagicComponent {
785
842
  * @param componentList
786
843
  * @param pendingCommandsCollector
787
844
  */
788
- constructor(activatedRoute, router, magic, containerTaskService, viewContainerRef, componentList, pendingCommandsCollector, routerCommandsMagicService) {
789
- this.activatedRoute = activatedRoute;
790
- this.router = router;
791
- this.magic = magic;
792
- this.containerTaskService = containerTaskService;
793
- this.viewContainerRef = viewContainerRef;
794
- this.componentList = componentList;
795
- this.pendingCommandsCollector = pendingCommandsCollector;
796
- this.routerCommandsMagicService = routerCommandsMagicService;
797
- }
845
+ constructor() { }
798
846
  /**
799
847
  * Initialization
800
848
  */
@@ -872,8 +920,8 @@ class RouterContainerMagicComponent {
872
920
  getRouterPath() {
873
921
  return this.routePath;
874
922
  }
875
- /** @nocollapse */ static ɵfac = function RouterContainerMagicComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || RouterContainerMagicComponent)(i0.ɵɵdirectiveInject(i2.ActivatedRoute), i0.ɵɵdirectiveInject(i2.Router), i0.ɵɵdirectiveInject(EngineMagicService), i0.ɵɵdirectiveInject(TaskMagicService), i0.ɵɵdirectiveInject(i0.ViewContainerRef), i0.ɵɵdirectiveInject(ComponentListMagicService), i0.ɵɵdirectiveInject(CommandsCollectorMagicService), i0.ɵɵdirectiveInject(RouterCommandsMagicService)); };
876
- /** @nocollapse */ static ɵcmp = /** @pureOrBreakMyCode */ i0.ɵɵdefineComponent({ type: RouterContainerMagicComponent, selectors: [["magic-route-outlet"]], standalone: false, decls: 0, vars: 0, template: function RouterContainerMagicComponent_Template(rf, ctx) { }, encapsulation: 2 });
923
+ /** @nocollapse */ static ɵfac = function RouterContainerMagicComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || RouterContainerMagicComponent)(); };
924
+ /** @nocollapse */ static ɵcmp = /** @pureOrBreakMyCode */ i0.ɵɵdefineComponent({ type: RouterContainerMagicComponent, selectors: [["magic-route-outlet"]], standalone: false, decls: 0, vars: 0, template: function RouterContainerMagicComponent_Template(rf, ctx) { }, encapsulation: 2, changeDetection: 1 });
877
925
  }
878
926
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(RouterContainerMagicComponent, [{
879
927
  type: Component,
@@ -881,10 +929,11 @@ class RouterContainerMagicComponent {
881
929
  selector: 'magic-route-outlet',
882
930
  template: `
883
931
  `,
932
+ changeDetection: ChangeDetectionStrategy.Eager,
884
933
  standalone: false
885
934
  }]
886
- }], () => [{ type: i2.ActivatedRoute }, { type: i2.Router }, { type: EngineMagicService }, { type: TaskMagicService }, { type: i0.ViewContainerRef }, { type: ComponentListMagicService }, { type: CommandsCollectorMagicService }, { type: RouterCommandsMagicService }], null); })();
887
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(RouterContainerMagicComponent, { className: "RouterContainerMagicComponent", filePath: "src/ui/router-container.magic.component.ts", lineNumber: 23 }); })();
935
+ }], () => [], null); })();
936
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(RouterContainerMagicComponent, { className: "RouterContainerMagicComponent", filePath: "src/ui/router-container.magic.component.ts", lineNumber: 24 }); })();
888
937
 
889
938
  /**
890
939
  * @ignore
@@ -1003,37 +1052,81 @@ class GuiInteractiveExecutor {
1003
1052
  }
1004
1053
  }
1005
1054
 
1006
- let BaseMagicOverlayContainer = class BaseMagicOverlayContainer {
1007
- };
1008
- __decorate([
1009
- Input(),
1010
- __metadata("design:type", Object)
1011
- ], BaseMagicOverlayContainer.prototype, "ModalComp", void 0);
1012
- __decorate([
1013
- Input(),
1014
- __metadata("design:type", Object)
1015
- ], BaseMagicOverlayContainer.prototype, "ModalCompParameters", void 0);
1016
- __decorate([
1017
- Output(),
1018
- __metadata("design:type", Object)
1019
- ], BaseMagicOverlayContainer.prototype, "onClose", void 0);
1020
- BaseMagicOverlayContainer = __decorate([
1021
- Input(),
1022
- Output()
1023
- ], BaseMagicOverlayContainer);
1055
+ class MagicModalProperties {
1056
+ formName = "overlay";
1057
+ showTitleBar = true;
1058
+ x = 0;
1059
+ y = 0;
1060
+ width = "300px";
1061
+ height = "300px";
1062
+ isCenteredToWindow = true;
1063
+ shouldCloseOnBackgroundClick = true;
1064
+ isResizable = true;
1065
+ isMovable = true;
1066
+ constructor(formName, showTitleBar, x, y, width, height, isCenteredToWindow, shouldCloseOnBackgroundClick, isResizable, isMovable) {
1067
+ this.formName = formName;
1068
+ this.showTitleBar = showTitleBar;
1069
+ this.x = x;
1070
+ this.y = y;
1071
+ this.width = width;
1072
+ this.height = height;
1073
+ this.isCenteredToWindow = isCenteredToWindow;
1074
+ this.shouldCloseOnBackgroundClick = shouldCloseOnBackgroundClick;
1075
+ this.isResizable = isResizable;
1076
+ this.isMovable = isMovable;
1077
+ }
1078
+ X() {
1079
+ return this.x;
1080
+ }
1081
+ Y() {
1082
+ return this.y;
1083
+ }
1084
+ Width() {
1085
+ return this.width;
1086
+ }
1087
+ Height() {
1088
+ return this.height;
1089
+ }
1090
+ IsCenteredToWindow() {
1091
+ return this.isCenteredToWindow;
1092
+ }
1093
+ FormName() {
1094
+ return this.formName;
1095
+ }
1096
+ ShowTitleBar() {
1097
+ return this.showTitleBar;
1098
+ }
1099
+ ShouldCloseOnBackgroundClick() {
1100
+ return this.shouldCloseOnBackgroundClick;
1101
+ }
1102
+ IsResizable() {
1103
+ return this.isResizable;
1104
+ }
1105
+ IsMovable() {
1106
+ return this.isMovable;
1107
+ }
1108
+ }
1109
+
1110
+ /**
1111
+ * Abstract base for Magic overlay container components.
1112
+ * Concrete classes must implement these members using Angular signal APIs (input/output).
1113
+ * The class is kept as an abstract class (not an interface) so that instanceof checks
1114
+ * in MagicOverlayContainerWrapper continue to work at runtime.
1115
+ */
1116
+ class BaseMagicOverlayContainer {
1117
+ }
1024
1118
 
1025
1119
  /**
1026
1120
  * Directive for setting ViewContainerRef on element
1027
1121
  */
1028
1122
  class MagicViewContainerRef {
1029
- vcRef;
1030
- constructor(vcRef) {
1031
- this.vcRef = vcRef;
1123
+ vcRef = inject(ViewContainerRef);
1124
+ constructor() {
1032
1125
  // For angular 10 - find the component from the views
1033
1126
  let comp = (this.vcRef._hostLView).find(v => v != null && !isNullOrUndefined(v.setViewContainerRef));
1034
- comp.setViewContainerRef(vcRef);
1127
+ comp.setViewContainerRef(this.vcRef);
1035
1128
  }
1036
- /** @nocollapse */ static ɵfac = function MagicViewContainerRef_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || MagicViewContainerRef)(i0.ɵɵdirectiveInject(i0.ViewContainerRef)); };
1129
+ /** @nocollapse */ static ɵfac = function MagicViewContainerRef_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || MagicViewContainerRef)(); };
1037
1130
  /** @nocollapse */ static ɵdir = /** @pureOrBreakMyCode */ i0.ɵɵdefineDirective({ type: MagicViewContainerRef, selectors: [["", "magicViewContainerRef", ""]], standalone: false });
1038
1131
  }
1039
1132
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(MagicViewContainerRef, [{
@@ -1042,54 +1135,54 @@ class MagicViewContainerRef {
1042
1135
  selector: '[magicViewContainerRef]',
1043
1136
  standalone: false
1044
1137
  }]
1045
- }], () => [{ type: i0.ViewContainerRef }], null); })();
1138
+ }], () => [], null); })();
1046
1139
 
1047
1140
  const _c0$3 = ["modalheader"];
1048
1141
  const _c1$1 = ["modalForeground"];
1049
1142
  function MagicOverlayContainer_Conditional_2_Template(rf, ctx) { if (rf & 1) {
1050
- const _r2 = i0.ɵɵgetCurrentView();
1143
+ const _r1 = i0.ɵɵgetCurrentView();
1051
1144
  i0.ɵɵelementStart(0, "button", 14);
1052
- i0.ɵɵlistener("click", function MagicOverlayContainer_Conditional_2_Template_button_click_0_listener() { i0.ɵɵrestoreView(_r2); const ctx_r2 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r2.OnClose()); });
1145
+ i0.ɵɵlistener("click", function MagicOverlayContainer_Conditional_2_Template_button_click_0_listener() { i0.ɵɵrestoreView(_r1); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.OnClose()); });
1053
1146
  i0.ɵɵtext(1, "X");
1054
1147
  i0.ɵɵelementEnd();
1055
1148
  } }
1056
1149
  function MagicOverlayContainer_Conditional_5_Template(rf, ctx) { if (rf & 1) {
1057
- const _r4 = i0.ɵɵgetCurrentView();
1150
+ const _r3 = i0.ɵɵgetCurrentView();
1058
1151
  i0.ɵɵelementStart(0, "span", 15);
1059
- i0.ɵɵlistener("mousedown", function MagicOverlayContainer_Conditional_5_Template_span_mousedown_0_listener($event) { i0.ɵɵrestoreView(_r4); const ctx_r2 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r2.onResizeStart($event, "right")); });
1152
+ i0.ɵɵlistener("mousedown", function MagicOverlayContainer_Conditional_5_Template_span_mousedown_0_listener($event) { i0.ɵɵrestoreView(_r3); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.onResizeStart($event, "right")); });
1060
1153
  i0.ɵɵelementEnd();
1061
1154
  } }
1062
1155
  function MagicOverlayContainer_Conditional_6_Template(rf, ctx) { if (rf & 1) {
1063
- const _r5 = i0.ɵɵgetCurrentView();
1156
+ const _r4 = i0.ɵɵgetCurrentView();
1064
1157
  i0.ɵɵelementStart(0, "span", 16);
1065
- i0.ɵɵlistener("mousedown", function MagicOverlayContainer_Conditional_6_Template_span_mousedown_0_listener($event) { i0.ɵɵrestoreView(_r5); const ctx_r2 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r2.onResizeStart($event, "left")); });
1158
+ i0.ɵɵlistener("mousedown", function MagicOverlayContainer_Conditional_6_Template_span_mousedown_0_listener($event) { i0.ɵɵrestoreView(_r4); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.onResizeStart($event, "left")); });
1066
1159
  i0.ɵɵelementEnd();
1067
1160
  } }
1068
1161
  function MagicOverlayContainer_Conditional_7_Template(rf, ctx) { if (rf & 1) {
1069
- const _r6 = i0.ɵɵgetCurrentView();
1162
+ const _r5 = i0.ɵɵgetCurrentView();
1070
1163
  i0.ɵɵelementStart(0, "span", 17);
1071
- i0.ɵɵlistener("mousedown", function MagicOverlayContainer_Conditional_7_Template_span_mousedown_0_listener($event) { i0.ɵɵrestoreView(_r6); const ctx_r2 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r2.onResizeStart($event, "corner")); });
1164
+ i0.ɵɵlistener("mousedown", function MagicOverlayContainer_Conditional_7_Template_span_mousedown_0_listener($event) { i0.ɵɵrestoreView(_r5); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.onResizeStart($event, "corner")); });
1072
1165
  i0.ɵɵelementEnd();
1073
1166
  } }
1074
1167
  function MagicOverlayContainer_Conditional_8_Template(rf, ctx) { if (rf & 1) {
1075
- const _r7 = i0.ɵɵgetCurrentView();
1168
+ const _r6 = i0.ɵɵgetCurrentView();
1076
1169
  i0.ɵɵelementStart(0, "span", 18);
1077
- i0.ɵɵlistener("mousedown", function MagicOverlayContainer_Conditional_8_Template_span_mousedown_0_listener($event) { i0.ɵɵrestoreView(_r7); const ctx_r2 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r2.onResizeStart($event, "bottom")); });
1170
+ i0.ɵɵlistener("mousedown", function MagicOverlayContainer_Conditional_8_Template_span_mousedown_0_listener($event) { i0.ɵɵrestoreView(_r6); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.onResizeStart($event, "bottom")); });
1078
1171
  i0.ɵɵelementEnd();
1079
1172
  } }
1080
1173
  function MagicOverlayContainer_Conditional_9_Template(rf, ctx) { if (rf & 1) {
1081
- const _r8 = i0.ɵɵgetCurrentView();
1174
+ const _r7 = i0.ɵɵgetCurrentView();
1082
1175
  i0.ɵɵelementStart(0, "div", 19, 2);
1083
1176
  i0.ɵɵtext(2);
1084
1177
  i0.ɵɵelementStart(3, "button", 20);
1085
- i0.ɵɵlistener("click", function MagicOverlayContainer_Conditional_9_Template_button_click_3_listener() { i0.ɵɵrestoreView(_r8); const ctx_r2 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r2.OnClose()); });
1178
+ i0.ɵɵlistener("click", function MagicOverlayContainer_Conditional_9_Template_button_click_3_listener() { i0.ɵɵrestoreView(_r7); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.OnClose()); });
1086
1179
  i0.ɵɵtext(4, "X");
1087
1180
  i0.ɵɵelementEnd()();
1088
1181
  } if (rf & 2) {
1089
- const ctx_r2 = i0.ɵɵnextContext();
1090
- i0.ɵɵclassProp("movable", ctx_r2.IsMovable());
1182
+ const ctx_r1 = i0.ɵɵnextContext();
1183
+ i0.ɵɵclassProp("movable", ctx_r1.IsMovable());
1091
1184
  i0.ɵɵadvance(2);
1092
- i0.ɵɵtextInterpolate1(" ", ctx_r2.getText(), " ");
1185
+ i0.ɵɵtextInterpolate1(" ", ctx_r1.getText(), " ");
1093
1186
  } }
1094
1187
  /**
1095
1188
  * Creates a modal window for Magic modal window components
@@ -1142,7 +1235,7 @@ class MagicOverlayContainer extends BaseMagicOverlayContainer {
1142
1235
  ngOnInit() {
1143
1236
  this.componentRef = this.modalbodyViewContainerRef.createComponent(this.ModalComp);
1144
1237
  Object.assign(this.componentRef.instance, this.ModalCompParameters);
1145
- let comp = this.componentRef.instance;
1238
+ let comp = this.getOverlayProps();
1146
1239
  this.isCenteredToWindow = comp.IsCenteredToWindow();
1147
1240
  }
1148
1241
  ngAfterViewInit() {
@@ -1161,7 +1254,7 @@ class MagicOverlayContainer extends BaseMagicOverlayContainer {
1161
1254
  */
1162
1255
  getText() {
1163
1256
  if (this.componentRef !== null) {
1164
- let comp = this.componentRef.instance;
1257
+ let comp = this.getOverlayProps();
1165
1258
  return comp.FormName();
1166
1259
  }
1167
1260
  else
@@ -1180,7 +1273,7 @@ class MagicOverlayContainer extends BaseMagicOverlayContainer {
1180
1273
  getStyle() {
1181
1274
  let styles = {};
1182
1275
  if (this.componentRef != undefined) {
1183
- let comp = this.componentRef.instance;
1276
+ let comp = this.getOverlayProps();
1184
1277
  styles['width'] = comp.Width();
1185
1278
  styles['height'] = comp.Height();
1186
1279
  if (this.isCenteredToWindow) {
@@ -1217,7 +1310,7 @@ class MagicOverlayContainer extends BaseMagicOverlayContainer {
1217
1310
  */
1218
1311
  getShowTitleBar() {
1219
1312
  if (this.componentRef != undefined) {
1220
- let comp = this.componentRef.instance;
1313
+ let comp = this.getOverlayProps();
1221
1314
  return comp.ShowTitleBar();
1222
1315
  }
1223
1316
  }
@@ -1231,7 +1324,7 @@ class MagicOverlayContainer extends BaseMagicOverlayContainer {
1231
1324
  * Handles click in the background window
1232
1325
  */
1233
1326
  OnBackgroundClick() {
1234
- let comp = this.componentRef.instance;
1327
+ let comp = this.getOverlayProps();
1235
1328
  if (comp.ShouldCloseOnBackgroundClick())
1236
1329
  this.OnClose();
1237
1330
  }
@@ -1240,7 +1333,9 @@ class MagicOverlayContainer extends BaseMagicOverlayContainer {
1240
1333
  * @returns {boolean} True if the overlay is resizable, false otherwise.
1241
1334
  */
1242
1335
  IsResizable() {
1243
- let comp = this.componentRef.instance;
1336
+ if (!this.componentRef)
1337
+ return false;
1338
+ let comp = this.getOverlayProps();
1244
1339
  return comp.IsResizable();
1245
1340
  }
1246
1341
  /**
@@ -1248,7 +1343,9 @@ class MagicOverlayContainer extends BaseMagicOverlayContainer {
1248
1343
  * @returns {boolean} True if the overlay is movable, false otherwise.
1249
1344
  */
1250
1345
  IsMovable() {
1251
- let comp = this.componentRef.instance;
1346
+ if (!this.componentRef)
1347
+ return false;
1348
+ let comp = this.getOverlayProps();
1252
1349
  return comp.IsMovable();
1253
1350
  }
1254
1351
  /**
@@ -1342,6 +1439,19 @@ class MagicOverlayContainer extends BaseMagicOverlayContainer {
1342
1439
  this.resizing = false;
1343
1440
  this.resizeDirection = null;
1344
1441
  }
1442
+ getOverlayProps() {
1443
+ let obj = this.componentRef.instance;
1444
+ if (obj && obj.magicModalProperties instanceof MagicModalProperties)
1445
+ obj = obj.magicModalProperties;
1446
+ // The properties come either from a MagicModalProperties object or from a component that implements MagicModalInterface itself.
1447
+ if (!(obj instanceof MagicModalProperties) && typeof obj?.ShowTitleBar !== 'function') {
1448
+ const componentName = this.componentRef?.instance?.constructor?.name || 'Unknown';
1449
+ throw new Error(`Overlay component '${componentName}' cannot be opened. ` +
1450
+ `Ensure that the component contains a 'magicModalProperties' property of type MagicModalProperties. ` +
1451
+ `Example: magicModalProperties: MagicModalProperties = new MagicModalProperties("formName", true, 0, 0, "300px", "300px", true, true, true, true);`);
1452
+ }
1453
+ return obj;
1454
+ }
1345
1455
  /** @nocollapse */ static ɵfac = function MagicOverlayContainer_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || MagicOverlayContainer)(); };
1346
1456
  /** @nocollapse */ static ɵcmp = /** @pureOrBreakMyCode */ i0.ɵɵdefineComponent({ type: MagicOverlayContainer, selectors: [["app-magic-overlay-container"]], viewQuery: function MagicOverlayContainer_Query(rf, ctx) { if (rf & 1) {
1347
1457
  i0.ɵɵviewQuery(_c0$3, 5)(_c1$1, 5);
@@ -1352,9 +1462,8 @@ class MagicOverlayContainer extends BaseMagicOverlayContainer {
1352
1462
  } }, hostBindings: function MagicOverlayContainer_HostBindings(rf, ctx) { if (rf & 1) {
1353
1463
  i0.ɵɵlistener("mousemove", function MagicOverlayContainer_mousemove_HostBindingHandler($event) { return ctx.onResize($event); }, i0.ɵɵresolveWindow)("mouseup", function MagicOverlayContainer_mouseup_HostBindingHandler() { return ctx.onResizeEnd(); }, i0.ɵɵresolveWindow);
1354
1464
  } }, inputs: { ModalComp: "ModalComp", ModalCompParameters: "ModalCompParameters" }, outputs: { onClose: "onClose" }, standalone: false, features: [i0.ɵɵInheritDefinitionFeature], decls: 13, vars: 9, consts: [["modalForeground", ""], ["modalbody", ""], ["modalheader", ""], [1, "boundary-line"], [1, "modal-background", 3, "click"], ["tabindex", "-1", 2, "float", "right", "border", "none", "background-color", "transparent", "outline", "none", "color", "white"], ["cdkDragBoundary", ".boundary-line", "cdkDrag", "", 1, "modal-foreground", 3, "ngStyle", "cdkDragDisabled"], [1, "dragHandle", "right"], [1, "dragHandle", "left"], [1, "dragHandle", "corner"], [1, "dragHandle", "bottom"], ["cdkDragHandle", "", 1, "modal-header", 3, "movable"], [3, "ngStyle"], ["magicViewContainerRef", ""], ["tabindex", "-1", 2, "float", "right", "border", "none", "background-color", "transparent", "outline", "none", "color", "white", 3, "click"], [1, "dragHandle", "right", 3, "mousedown"], [1, "dragHandle", "left", 3, "mousedown"], [1, "dragHandle", "corner", 3, "mousedown"], [1, "dragHandle", "bottom", 3, "mousedown"], ["cdkDragHandle", "", 1, "modal-header"], ["tabindex", "-1", 2, "float", "right", 3, "click"]], template: function MagicOverlayContainer_Template(rf, ctx) { if (rf & 1) {
1355
- const _r1 = i0.ɵɵgetCurrentView();
1356
1465
  i0.ɵɵelementStart(0, "div", 3)(1, "div", 4);
1357
- i0.ɵɵlistener("click", function MagicOverlayContainer_Template_div_click_1_listener() { i0.ɵɵrestoreView(_r1); return i0.ɵɵresetView(ctx.OnBackgroundClick()); });
1466
+ i0.ɵɵlistener("click", function MagicOverlayContainer_Template_div_click_1_listener() { return ctx.OnBackgroundClick(); });
1358
1467
  i0.ɵɵconditionalCreate(2, MagicOverlayContainer_Conditional_2_Template, 2, 0, "button", 5);
1359
1468
  i0.ɵɵelementEnd();
1360
1469
  i0.ɵɵelementStart(3, "div", 6, 0);
@@ -1383,48 +1492,48 @@ class MagicOverlayContainer extends BaseMagicOverlayContainer {
1383
1492
  i0.ɵɵconditional(ctx.getShowTitleBar() ? 9 : -1);
1384
1493
  i0.ɵɵadvance();
1385
1494
  i0.ɵɵproperty("ngStyle", ctx.getClientAreaStyles());
1386
- } }, dependencies: [i1.NgStyle, i2$1.CdkDragHandle, i2$1.CdkDrag, MagicViewContainerRef], styles: [".modal-foreground[_ngcontent-%COMP%]{position:fixed;inset:0;background-color:#fff}.modal-background[_ngcontent-%COMP%]{position:fixed;inset:0;background-color:#000;opacity:.75}.modal-header[_ngcontent-%COMP%]{background-color:beige;border-bottom:2px solid red}.modal-header.movable[_ngcontent-%COMP%]:active{cursor:move}.container[_ngcontent-%COMP%]{position:relative}.dragHandle[_ngcontent-%COMP%]{position:absolute}.dragHandle.corner[_ngcontent-%COMP%]{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}[dir=\"rtl\"][_nghost-%COMP%] .dragHandle.corner[_ngcontent-%COMP%], [dir=\"rtl\"] [_nghost-%COMP%] .dragHandle.corner[_ngcontent-%COMP%]{right:auto!important;left:0;cursor:nesw-resize;background:linear-gradient(225deg,rgba(0,0,0,.4) 50%,transparent 50%)}.dragHandle.left[_ngcontent-%COMP%]{width:2px;left:-2px;height:100%;cursor:ew-resize}.dragHandle.right[_ngcontent-%COMP%]{width:2px;right:-2px;height:100%;cursor:ew-resize}.dragHandle.bottom[_ngcontent-%COMP%]{height:2px;bottom:-2px;width:100%;cursor:ns-resize}.boundary-line[_ngcontent-%COMP%]{width:100%;height:100%;max-width:100%}"] });
1495
+ } }, dependencies: [i1.NgStyle, i2.CdkDragHandle, i2.CdkDrag, MagicViewContainerRef], styles: [".modal-foreground[_ngcontent-%COMP%]{position:fixed;inset:0;background-color:#fff}.modal-background[_ngcontent-%COMP%]{position:fixed;inset:0;background-color:#000;opacity:.75}.modal-header[_ngcontent-%COMP%]{background-color:beige;border-bottom:2px solid red}.modal-header.movable[_ngcontent-%COMP%]:active{cursor:move}.container[_ngcontent-%COMP%]{position:relative}.dragHandle[_ngcontent-%COMP%]{position:absolute}.dragHandle.corner[_ngcontent-%COMP%]{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}[dir=\"rtl\"][_nghost-%COMP%] .dragHandle.corner[_ngcontent-%COMP%], [dir=\"rtl\"] [_nghost-%COMP%] .dragHandle.corner[_ngcontent-%COMP%]{right:auto!important;left:0;cursor:nesw-resize;background:linear-gradient(225deg,rgba(0,0,0,.4) 50%,transparent 50%)}.dragHandle.left[_ngcontent-%COMP%]{width:2px;left:-2px;height:100%;cursor:ew-resize}.dragHandle.right[_ngcontent-%COMP%]{width:2px;right:-2px;height:100%;cursor:ew-resize}.dragHandle.bottom[_ngcontent-%COMP%]{height:2px;bottom:-2px;width:100%;cursor:ns-resize}.boundary-line[_ngcontent-%COMP%]{width:100%;height:100%;max-width:100%}"], changeDetection: 1 });
1387
1496
  }
1388
1497
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(MagicOverlayContainer, [{
1389
1498
  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>
1427
- `, 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"] }]
1499
+ args: [{ selector: 'app-magic-overlay-container', template: `
1500
+ <div class="boundary-line">
1501
+
1502
+ <div class="modal-background" (click)="OnBackgroundClick()">
1503
+ @if (!getShowTitleBar()) {
1504
+ <button (click)="OnClose()" tabindex="-1" style="float:right; border: none; background-color: transparent; outline: none; color: white">X</button>
1505
+ }
1506
+ </div>
1507
+
1508
+ <div #modalForeground class="modal-foreground" [ngStyle]="getStyle()" cdkDragBoundary=".boundary-line" cdkDrag [cdkDragDisabled]="!IsMovable()">
1509
+
1510
+ @if (IsResizable() && !isRtl) {
1511
+ <span class="dragHandle right" (mousedown)="onResizeStart($event, 'right')"></span>
1512
+ }
1513
+ @if (IsResizable() && isRtl) {
1514
+ <span class="dragHandle left" (mousedown)="onResizeStart($event, 'left')"></span>
1515
+ }
1516
+ @if (IsResizable()) {
1517
+ <span class="dragHandle corner" (mousedown)="onResizeStart($event, 'corner')"></span>
1518
+ }
1519
+ @if (IsResizable()) {
1520
+ <span class="dragHandle bottom" (mousedown)="onResizeStart($event, 'bottom')"></span>
1521
+ }
1522
+
1523
+ @if (getShowTitleBar()) {
1524
+ <div #modalheader class="modal-header" cdkDragHandle [class.movable]="IsMovable()">
1525
+ {{getText()}}
1526
+ <button (click)="OnClose()" style="float:right" tabindex="-1">X</button>
1527
+ </div>
1528
+ }
1529
+
1530
+ <div [ngStyle]="getClientAreaStyles()">
1531
+ <div #modalbody magicViewContainerRef>
1532
+ </div>
1533
+ </div>
1534
+ </div>
1535
+ </div>
1536
+ `, changeDetection: ChangeDetectionStrategy.Eager, 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
1537
  }], () => [], { headerElementRef: [{
1429
1538
  type: ViewChild,
1430
1539
  args: ['modalheader', { static: false }]
@@ -1444,7 +1553,7 @@ class MagicOverlayContainer extends BaseMagicOverlayContainer {
1444
1553
  type: HostListener,
1445
1554
  args: ['window:mouseup']
1446
1555
  }] }); })();
1447
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(MagicOverlayContainer, { className: "MagicOverlayContainer", filePath: "src/ui/magic-modal/magic-overlay-container.ts", lineNumber: 64 }); })();
1556
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(MagicOverlayContainer, { className: "MagicOverlayContainer", filePath: "src/ui/magic-modal/magic-overlay-container.ts", lineNumber: 67 }); })();
1448
1557
 
1449
1558
  /**
1450
1559
  * Service managing overlay windows
@@ -1468,16 +1577,18 @@ class BaseMagicConfirmComponent {
1468
1577
  /**
1469
1578
  * title of the component
1470
1579
  */
1471
- title;
1580
+ title = input(/* @ts-ignore */
1581
+ ...(ngDevMode ? [undefined, { debugName: "title" }] : /* istanbul ignore next */ []));
1472
1582
  /**
1473
1583
  * message of the component
1474
1584
  */
1475
- message;
1585
+ message = input(/* @ts-ignore */
1586
+ ...(ngDevMode ? [undefined, { debugName: "message" }] : /* istanbul ignore next */ []));
1476
1587
  /**
1477
1588
  * onClose Event - to be raised when the component is closed
1478
1589
  * should pass true when OK is pressed and false when cancel is pressed
1479
1590
  */
1480
- onClose = new EventEmitter();
1591
+ onClose = output();
1481
1592
  /**
1482
1593
  * raises close Event
1483
1594
  * @param result true when OK is pressed and false when cancel is pressed
@@ -1487,19 +1598,13 @@ class BaseMagicConfirmComponent {
1487
1598
  this.onClose.emit(result);
1488
1599
  }
1489
1600
  /** @nocollapse */ static ɵfac = function BaseMagicConfirmComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || BaseMagicConfirmComponent)(); };
1490
- /** @nocollapse */ static ɵcmp = /** @pureOrBreakMyCode */ i0.ɵɵdefineComponent({ type: BaseMagicConfirmComponent, selectors: [["mg-base-confirm"]], inputs: { title: "title", message: "message" }, outputs: { onClose: "onClose" }, standalone: false, decls: 0, vars: 0, template: function BaseMagicConfirmComponent_Template(rf, ctx) { }, encapsulation: 2 });
1601
+ /** @nocollapse */ static ɵcmp = /** @pureOrBreakMyCode */ i0.ɵɵdefineComponent({ type: BaseMagicConfirmComponent, selectors: [["mg-base-confirm"]], inputs: { title: [1, "title"], message: [1, "message"] }, outputs: { onClose: "onClose" }, standalone: false, decls: 0, vars: 0, template: function BaseMagicConfirmComponent_Template(rf, ctx) { }, encapsulation: 2, changeDetection: 1 });
1491
1602
  }
1492
1603
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(BaseMagicConfirmComponent, [{
1493
1604
  type: Component,
1494
- args: [{ selector: 'mg-base-confirm', template: '', standalone: false }]
1495
- }], null, { title: [{
1496
- type: Input
1497
- }], message: [{
1498
- type: Input
1499
- }], onClose: [{
1500
- type: Output
1501
- }] }); })();
1502
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(BaseMagicConfirmComponent, { className: "BaseMagicConfirmComponent", filePath: "src/ui/components/base-magic-confirm.component.ts", lineNumber: 13 }); })();
1605
+ args: [{ selector: 'mg-base-confirm', template: '', changeDetection: ChangeDetectionStrategy.Eager, standalone: false }]
1606
+ }], null, { title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: false }] }], message: [{ type: i0.Input, args: [{ isSignal: true, alias: "message", required: false }] }], onClose: [{ type: i0.Output, args: ["onClose"] }] }); })();
1607
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(BaseMagicConfirmComponent, { className: "BaseMagicConfirmComponent", filePath: "src/ui/components/base-magic-confirm.component.ts", lineNumber: 14 }); })();
1503
1608
 
1504
1609
  /**
1505
1610
  * This is a base class for the magic alert components
@@ -1508,16 +1613,18 @@ class BaseMagicAlertComponent {
1508
1613
  /**
1509
1614
  * title of the component
1510
1615
  */
1511
- title;
1616
+ title = input(/* @ts-ignore */
1617
+ ...(ngDevMode ? [undefined, { debugName: "title" }] : /* istanbul ignore next */ []));
1512
1618
  /**
1513
1619
  * message of the component
1514
1620
  */
1515
- message;
1621
+ message = input(/* @ts-ignore */
1622
+ ...(ngDevMode ? [undefined, { debugName: "message" }] : /* istanbul ignore next */ []));
1516
1623
  /**
1517
1624
  * onClose Event - to be raised when the component is closed
1518
1625
 
1519
1626
  */
1520
- onClose = new EventEmitter();
1627
+ onClose = output();
1521
1628
  /**
1522
1629
  * close magic alert
1523
1630
  */
@@ -1525,32 +1632,24 @@ class BaseMagicAlertComponent {
1525
1632
  this.onClose.emit();
1526
1633
  }
1527
1634
  /** @nocollapse */ static ɵfac = function BaseMagicAlertComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || BaseMagicAlertComponent)(); };
1528
- /** @nocollapse */ static ɵcmp = /** @pureOrBreakMyCode */ i0.ɵɵdefineComponent({ type: BaseMagicAlertComponent, selectors: [["mg-base-alert"]], inputs: { title: "title", message: "message" }, outputs: { onClose: "onClose" }, standalone: false, decls: 0, vars: 0, template: function BaseMagicAlertComponent_Template(rf, ctx) { }, encapsulation: 2 });
1635
+ /** @nocollapse */ static ɵcmp = /** @pureOrBreakMyCode */ i0.ɵɵdefineComponent({ type: BaseMagicAlertComponent, selectors: [["mg-base-alert"]], inputs: { title: [1, "title"], message: [1, "message"] }, outputs: { onClose: "onClose" }, standalone: false, decls: 0, vars: 0, template: function BaseMagicAlertComponent_Template(rf, ctx) { }, encapsulation: 2, changeDetection: 1 });
1529
1636
  }
1530
1637
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(BaseMagicAlertComponent, [{
1531
1638
  type: Component,
1532
- args: [{ selector: 'mg-base-alert', template: '', standalone: false }]
1533
- }], null, { title: [{
1534
- type: Input
1535
- }], message: [{
1536
- type: Input
1537
- }], onClose: [{
1538
- type: Output
1539
- }] }); })();
1540
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(BaseMagicAlertComponent, { className: "BaseMagicAlertComponent", filePath: "src/ui/components/base-magic-alert.component.ts", lineNumber: 14 }); })();
1639
+ args: [{ selector: 'mg-base-alert', template: '', changeDetection: ChangeDetectionStrategy.Eager, standalone: false }]
1640
+ }], null, { title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: false }] }], message: [{ type: i0.Input, args: [{ isSignal: true, alias: "message", required: false }] }], onClose: [{ type: i0.Output, args: ["onClose"] }] }); })();
1641
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(BaseMagicAlertComponent, { className: "BaseMagicAlertComponent", filePath: "src/ui/components/base-magic-alert.component.ts", lineNumber: 16 }); })();
1541
1642
 
1542
1643
  /**
1543
1644
  * Directive for setting focus on element
1544
1645
  */
1545
1646
  class MagicFocusDirective {
1546
- hostElement;
1547
- constructor(hostElement) {
1548
- this.hostElement = hostElement;
1549
- }
1647
+ hostElement = inject(ElementRef);
1648
+ constructor() { }
1550
1649
  ngAfterViewInit() {
1551
1650
  this.hostElement.nativeElement.focus();
1552
1651
  }
1553
- /** @nocollapse */ static ɵfac = function MagicFocusDirective_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || MagicFocusDirective)(i0.ɵɵdirectiveInject(i0.ElementRef)); };
1652
+ /** @nocollapse */ static ɵfac = function MagicFocusDirective_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || MagicFocusDirective)(); };
1554
1653
  /** @nocollapse */ static ɵdir = /** @pureOrBreakMyCode */ i0.ɵɵdefineDirective({ type: MagicFocusDirective, selectors: [["", "magicFocus", ""]], standalone: false });
1555
1654
  }
1556
1655
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(MagicFocusDirective, [{
@@ -1559,30 +1658,29 @@ class MagicFocusDirective {
1559
1658
  selector: '[magicFocus]',
1560
1659
  standalone: false
1561
1660
  }]
1562
- }], () => [{ type: i0.ElementRef }], null); })();
1661
+ }], () => [], null); })();
1563
1662
 
1564
1663
  const _c0$2 = ["overlayContainerWrapper"];
1565
1664
  class MagicOverlayContainerWrapper {
1566
- componentListMagicService;
1567
- magicLazyModuleLoader;
1568
- injector;
1569
- changeDetectorRef;
1570
- compiler;
1571
1665
  /**
1572
1666
  *
1573
1667
  */
1574
- Component = null;
1668
+ Component = input(null, /* @ts-ignore */
1669
+ ...(ngDevMode ? [{ debugName: "Component" }] : /* istanbul ignore next */ []));
1575
1670
  /**
1576
1671
  *
1577
1672
  */
1578
- Parameters = {};
1579
- OverlayTypeParam;
1580
- onClose = new EventEmitter();
1673
+ Parameters = input({}, /* @ts-ignore */
1674
+ ...(ngDevMode ? [{ debugName: "Parameters" }] : /* istanbul ignore next */ []));
1675
+ OverlayTypeParam = input(/* @ts-ignore */
1676
+ ...(ngDevMode ? [undefined, { debugName: "OverlayTypeParam" }] : /* istanbul ignore next */ []));
1677
+ onClose = output();
1581
1678
  /**
1582
1679
  * HTML to be displayed in the modal window
1583
1680
  */
1584
1681
  overlayContentViewContainerRef;
1585
- overlayContainerWrapperElementRef;
1682
+ overlayContainerWrapperElementRef = viewChild.required('overlayContainerWrapper', /* @ts-ignore */
1683
+ ...(ngDevMode ? [{ debugName: "overlayContainerWrapperElementRef" }] : /* istanbul ignore next */ []));
1586
1684
  /**
1587
1685
  * @ignore
1588
1686
  * contais data of allowed base components to use
@@ -1592,32 +1690,26 @@ class MagicOverlayContainerWrapper {
1592
1690
  [OverlayType.Alert, { comp: BaseMagicAlertComponent, error: 'BaseMagicAlertComponent. Alert ' }],
1593
1691
  [OverlayType.ConfirmationBox, { comp: BaseMagicConfirmComponent, error: 'BaseMagicConfirmComponent. Confirmation ' }]
1594
1692
  ]);
1595
- /**
1596
- *
1597
- * @param componentFactoryResolver
1598
- */
1599
- constructor(componentListMagicService, magicLazyModuleLoader, injector, changeDetectorRef, compiler) {
1600
- this.componentListMagicService = componentListMagicService;
1601
- this.magicLazyModuleLoader = magicLazyModuleLoader;
1602
- this.injector = injector;
1603
- this.changeDetectorRef = changeDetectorRef;
1604
- this.compiler = compiler;
1693
+ componentListMagicService = inject(ComponentListMagicService);
1694
+ magicLazyModuleLoader = inject(MagicLazyLoaderService);
1695
+ injector = inject(Injector);
1696
+ changeDetectorRef = inject(ChangeDetectorRef);
1697
+ constructor() {
1605
1698
  }
1606
1699
  /**
1607
1700
  *
1608
1701
  */
1609
1702
  ngOnInit() {
1610
- let moduleRef = this.componentListMagicService.getModuleRef(this.Parameters.MagicFormName);
1703
+ let moduleRef = this.componentListMagicService.getModuleRef(this.Parameters().MagicFormName);
1611
1704
  if (moduleRef == null) {
1612
- let lazyLoadModule = this.componentListMagicService.getLazyLoadModuleData(this.Parameters.MagicFormName);
1705
+ let lazyLoadModule = this.componentListMagicService.getLazyLoadModuleData(this.Parameters().MagicFormName);
1613
1706
  if (lazyLoadModule != null) {
1614
1707
  const Magic = 'Magic';
1615
1708
  const Module = 'Module';
1616
1709
  // extract name of module(XX) from 'MagicXXModule'
1617
1710
  const moduleName = lazyLoadModule.moduleName.slice(Magic.length, -Module.length);
1618
1711
  this.magicLazyModuleLoader.Load(moduleName).then(m => {
1619
- const compiled = this.compiler.compileModuleAndAllComponentsSync(m[lazyLoadModule.moduleName]);
1620
- moduleRef = compiled.ngModuleFactory.create(this.injector);
1712
+ moduleRef = createNgModule(m[lazyLoadModule.moduleName], this.injector);
1621
1713
  this.loadComponent(moduleRef);
1622
1714
  });
1623
1715
  }
@@ -1629,11 +1721,18 @@ class MagicOverlayContainerWrapper {
1629
1721
  this.loadComponent(moduleRef);
1630
1722
  }
1631
1723
  loadComponent(moduleRef) {
1632
- this.Parameters.ModalComp = this.componentListMagicService.getComponent(this.Parameters.MagicFormName, !isNullOrUndefined(this.Parameters.MagicFormName));
1633
- let componentRef = this.overlayContentViewContainerRef.createComponent(this.Component);
1634
- let allowedBaseComp = MagicOverlayContainerWrapper.allowedBaseComps.get(this.OverlayTypeParam);
1724
+ this.Parameters().ModalComp = this.componentListMagicService.getComponent(this.Parameters().MagicFormName, !isNullOrUndefined(this.Parameters().MagicFormName));
1725
+ let componentRef = this.overlayContentViewContainerRef.createComponent(this.Component());
1726
+ let allowedBaseComp = MagicOverlayContainerWrapper.allowedBaseComps.get(this.OverlayTypeParam());
1635
1727
  if (componentRef.instance instanceof allowedBaseComp.comp) {
1636
- Object.assign(componentRef.instance, this.Parameters);
1728
+ if (this.OverlayTypeParam() === OverlayType.Overlay) {
1729
+ componentRef.setInput('ModalComp', this.Parameters().ModalComp);
1730
+ componentRef.setInput('ModalCompParameters', this.Parameters().ModalCompParameters);
1731
+ }
1732
+ else {
1733
+ componentRef.setInput('title', this.Parameters().title);
1734
+ componentRef.setInput('message', this.Parameters().message);
1735
+ }
1637
1736
  componentRef.instance.onClose.subscribe((res) => {
1638
1737
  this.onClose.emit(res);
1639
1738
  });
@@ -1647,18 +1746,17 @@ class MagicOverlayContainerWrapper {
1647
1746
  this.overlayContentViewContainerRef = vcRef;
1648
1747
  }
1649
1748
  GetRootElement() {
1650
- return this.overlayContainerWrapperElementRef.nativeElement;
1749
+ return this.overlayContainerWrapperElementRef().nativeElement;
1651
1750
  }
1652
1751
  DetectChanges() {
1653
1752
  this.changeDetectorRef.detectChanges();
1654
1753
  }
1655
- /** @nocollapse */ static ɵfac = function MagicOverlayContainerWrapper_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || MagicOverlayContainerWrapper)(i0.ɵɵdirectiveInject(ComponentListMagicService), i0.ɵɵdirectiveInject(MagicLazyLoaderService), i0.ɵɵdirectiveInject(i0.Injector), i0.ɵɵdirectiveInject(i0.ChangeDetectorRef), i0.ɵɵdirectiveInject(i0.Compiler)); };
1754
+ /** @nocollapse */ static ɵfac = function MagicOverlayContainerWrapper_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || MagicOverlayContainerWrapper)(); };
1656
1755
  /** @nocollapse */ static ɵcmp = /** @pureOrBreakMyCode */ i0.ɵɵdefineComponent({ type: MagicOverlayContainerWrapper, selectors: [["app-magic-overlay-container-wrapper"]], viewQuery: function MagicOverlayContainerWrapper_Query(rf, ctx) { if (rf & 1) {
1657
- i0.ɵɵviewQuery(_c0$2, 7);
1756
+ i0.ɵɵviewQuerySignal(ctx.overlayContainerWrapperElementRef, _c0$2, 5);
1658
1757
  } if (rf & 2) {
1659
- let _t;
1660
- i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.overlayContainerWrapperElementRef = _t.first);
1661
- } }, inputs: { Component: "Component", Parameters: "Parameters", OverlayTypeParam: "OverlayTypeParam" }, outputs: { onClose: "onClose" }, standalone: false, decls: 7, vars: 0, consts: [["overlayContainerWrapper", ""], ["overlayContent", ""], ["tabIndex", "0", "magicFocus", "", 1, "overlay-container-wrapper-background", 2, "width", "0px", "height", "0px"], [1, "overlay-container-wrapper-background"], ["magicViewContainerRef", ""], ["tabIndex", "0", 1, "overlay-container-wrapper-background", 2, "width", "0px", "height", "0px"]], template: function MagicOverlayContainerWrapper_Template(rf, ctx) { if (rf & 1) {
1758
+ i0.ɵɵqueryAdvance();
1759
+ } }, inputs: { Component: [1, "Component"], Parameters: [1, "Parameters"], OverlayTypeParam: [1, "OverlayTypeParam"] }, outputs: { onClose: "onClose" }, standalone: false, decls: 7, vars: 0, consts: [["overlayContainerWrapper", ""], ["overlayContent", ""], ["tabIndex", "0", "magicFocus", "", 1, "overlay-container-wrapper-background", 2, "width", "0px", "height", "0px"], [1, "overlay-container-wrapper-background"], ["magicViewContainerRef", ""], ["tabIndex", "0", 1, "overlay-container-wrapper-background", 2, "width", "0px", "height", "0px"]], template: function MagicOverlayContainerWrapper_Template(rf, ctx) { if (rf & 1) {
1662
1760
  i0.ɵɵelementStart(0, "div");
1663
1761
  i0.ɵɵelement(1, "div", 2);
1664
1762
  i0.ɵɵelementStart(2, "div", 3, 0);
@@ -1666,7 +1764,7 @@ class MagicOverlayContainerWrapper {
1666
1764
  i0.ɵɵelementEnd();
1667
1765
  i0.ɵɵelement(6, "div", 5);
1668
1766
  i0.ɵɵelementEnd();
1669
- } }, dependencies: [MagicFocusDirective, MagicViewContainerRef], styles: [".overlay-container-wrapper-background[_ngcontent-%COMP%]{position:fixed;z-index:999;inset:0}"] });
1767
+ } }, dependencies: [MagicFocusDirective, MagicViewContainerRef], styles: [".overlay-container-wrapper-background[_ngcontent-%COMP%]{position:fixed;z-index:999;inset:0}"], changeDetection: 1 });
1670
1768
  }
1671
1769
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(MagicOverlayContainerWrapper, [{
1672
1770
  type: Component,
@@ -1679,19 +1777,8 @@ class MagicOverlayContainerWrapper {
1679
1777
  </div>
1680
1778
  <div class="overlay-container-wrapper-background" tabIndex="0" style="width: 0px; height: 0px;" ></div>
1681
1779
  </div>
1682
- `, standalone: false, styles: [".overlay-container-wrapper-background{position:fixed;z-index:999;inset:0}\n"] }]
1683
- }], () => [{ type: ComponentListMagicService }, { type: MagicLazyLoaderService }, { type: i0.Injector }, { type: i0.ChangeDetectorRef }, { type: i0.Compiler }], { Component: [{
1684
- type: Input
1685
- }], Parameters: [{
1686
- type: Input
1687
- }], OverlayTypeParam: [{
1688
- type: Input
1689
- }], onClose: [{
1690
- type: Output
1691
- }], overlayContainerWrapperElementRef: [{
1692
- type: ViewChild,
1693
- args: ['overlayContainerWrapper', { static: true }]
1694
- }] }); })();
1780
+ `, changeDetection: ChangeDetectionStrategy.Eager, standalone: false, styles: [".overlay-container-wrapper-background{position:fixed;z-index:999;inset:0}\n"] }]
1781
+ }], () => [], { Component: [{ type: i0.Input, args: [{ isSignal: true, alias: "Component", required: false }] }], Parameters: [{ type: i0.Input, args: [{ isSignal: true, alias: "Parameters", required: false }] }], OverlayTypeParam: [{ type: i0.Input, args: [{ isSignal: true, alias: "OverlayTypeParam", required: false }] }], onClose: [{ type: i0.Output, args: ["onClose"] }], overlayContainerWrapperElementRef: [{ type: i0.ViewChild, args: ['overlayContainerWrapper', { isSignal: true }] }] }); })();
1695
1782
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(MagicOverlayContainerWrapper, { className: "MagicOverlayContainerWrapper", filePath: "src/ui/magic-modal/magic-overlay-container-wrapper.ts", lineNumber: 46 }); })();
1696
1783
 
1697
1784
  /***
@@ -1712,17 +1799,17 @@ class MagicAlertComponent extends BaseMagicAlertComponent {
1712
1799
  i0.ɵɵelementEnd()()();
1713
1800
  } if (rf & 2) {
1714
1801
  i0.ɵɵadvance(3);
1715
- i0.ɵɵtextInterpolate1(" ", ctx.title);
1802
+ i0.ɵɵtextInterpolate1(" ", ctx.title());
1716
1803
  i0.ɵɵadvance(2);
1717
- i0.ɵɵtextInterpolate1("", ctx.message, " ");
1804
+ i0.ɵɵtextInterpolate1("", ctx.message(), " ");
1718
1805
  } }, styles: [".mg-message-background[_ngcontent-%COMP%]{background-color:#f5f5f5;width:40%;font-family:Open Sans,Helvetica Neue,Helvetica,Arial,sans-serif;padding:17px;border-radius:5px;text-align:center;margin-top:10%;margin-left:auto;margin-right:auto;border:1px solid gray}button[_ngcontent-%COMP%]{background-color:#8cd4f5;color:#fff;border:none;box-shadow:none;font-size:17px;font-weight:500;-webkit-border-radius:4px;border-radius:5px;padding:10px 32px;margin:26px 5px 0;cursor:pointer}"] });
1719
1806
  }
1720
1807
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(MagicAlertComponent, [{
1721
1808
  type: Component,
1722
1809
  args: [{ selector: 'sample-magic-alert-component', template: `<div>
1723
1810
  <div class="mg-message-background">
1724
- <h2> {{title}}</h2>
1725
- <p>{{message}} </p>
1811
+ <h2> {{title()}}</h2>
1812
+ <p>{{message()}} </p>
1726
1813
 
1727
1814
  <button (click)="OnClose()">OK</button>
1728
1815
  </div>
@@ -1751,17 +1838,17 @@ class MagicConfirmationBoxComponent extends BaseMagicConfirmComponent {
1751
1838
  i0.ɵɵelementEnd()()();
1752
1839
  } if (rf & 2) {
1753
1840
  i0.ɵɵadvance(3);
1754
- i0.ɵɵtextInterpolate1(" ", ctx.title);
1841
+ i0.ɵɵtextInterpolate1(" ", ctx.title());
1755
1842
  i0.ɵɵadvance();
1756
- i0.ɵɵtextInterpolate1(" ", ctx.message, " ");
1843
+ i0.ɵɵtextInterpolate1(" ", ctx.message(), " ");
1757
1844
  } }, styles: [".mg-message-background[_ngcontent-%COMP%]{background-color:#f5f5f5;width:40%;font-family:Open Sans,Helvetica Neue,Helvetica,Arial,sans-serif;padding:17px;border-radius:5px;text-align:center;margin-top:10%;margin-left:auto;margin-right:auto;border:1px solid gray}button[_ngcontent-%COMP%]{background-color:#8cd4f5;color:#fff;border:none;box-shadow:none;font-size:17px;font-weight:500;-webkit-border-radius:4px;border-radius:5px;padding:10px 32px;margin:26px 5px 0;cursor:pointer}button.cancel[_ngcontent-%COMP%]{background-color:#c1c1c1}"] });
1758
1845
  }
1759
1846
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(MagicConfirmationBoxComponent, [{
1760
1847
  type: Component,
1761
1848
  args: [{ selector: 'sample-magic-confirmation-box', template: `<div>
1762
1849
  <div class="mg-message-background">
1763
- <h2> {{title}}</h2>
1764
- {{message}}
1850
+ <h2> {{title()}}</h2>
1851
+ {{message()}}
1765
1852
  <br>
1766
1853
  <br>
1767
1854
 
@@ -1878,21 +1965,13 @@ class confirmationBox {
1878
1965
  * Service managing overlay windows
1879
1966
  */
1880
1967
  class OverlayWindowService {
1881
- componentList;
1882
- engineMagicService;
1883
- magicLazyModuleLoader;
1884
- injector;
1885
- compiler;
1886
- overlayContainerMagicProvider;
1887
- confirmationComponentsMagicProvider;
1888
- constructor(componentList, engineMagicService, magicLazyModuleLoader, injector, compiler, overlayContainerMagicProvider, confirmationComponentsMagicProvider) {
1889
- this.componentList = componentList;
1890
- this.engineMagicService = engineMagicService;
1891
- this.magicLazyModuleLoader = magicLazyModuleLoader;
1892
- this.injector = injector;
1893
- this.compiler = compiler;
1894
- this.overlayContainerMagicProvider = overlayContainerMagicProvider;
1895
- this.confirmationComponentsMagicProvider = confirmationComponentsMagicProvider;
1968
+ componentList = inject(ComponentListMagicService);
1969
+ engineMagicService = inject(EngineMagicService);
1970
+ magicLazyModuleLoader = inject(MagicLazyLoaderService);
1971
+ injector = inject(Injector);
1972
+ overlayContainerMagicProvider = inject(OverlayContainerMagicProvider);
1973
+ confirmationComponentsMagicProvider = inject(ConfirmationComponentsMagicProvider);
1974
+ constructor() {
1896
1975
  }
1897
1976
  // The view reference of container of overlay window
1898
1977
  overlayWindowsContainerViewRef;
@@ -1913,8 +1992,7 @@ class OverlayWindowService {
1913
1992
  // extract name of module(XX) from 'MagicXXModule'
1914
1993
  const moduleName = lazyLoadModule.moduleName.slice(Magic.length, -Module.length);
1915
1994
  this.magicLazyModuleLoader.Load(moduleName).then(m => {
1916
- const compiled = this.compiler.compileModuleAndAllComponentsSync(m[lazyLoadModule.moduleName]);
1917
- moduleRef = compiled.ngModuleFactory.create(this.injector);
1995
+ moduleRef = createNgModule(m[lazyLoadModule.moduleName], this.injector);
1918
1996
  this.open(formName, taskId, taskDescription);
1919
1997
  this.finishConfirmation(Styles.MSGBOX_BUTTON_OK, true);
1920
1998
  });
@@ -1995,13 +2073,15 @@ class OverlayWindowService {
1995
2073
  // Create the UI component of modal window
1996
2074
  let viewCRef = this.overlayWindowsContainerViewRef;
1997
2075
  componentRef = viewCRef.createComponent(MagicOverlayContainerWrapper);
1998
- // Set the data to newly created component
1999
- Object.assign(componentRef.instance, magicModalContainerParameters);
2076
+ // Set signal inputs via setInput() — direct property assignment would overwrite the signal functions
2077
+ componentRef.setInput('Component', magicModalContainerParameters.Component);
2078
+ componentRef.setInput('Parameters', magicModalContainerParameters.Parameters);
2079
+ componentRef.setInput('OverlayTypeParam', magicModalContainerParameters.OverlayTypeParam);
2000
2080
  this.overlayWindowFocusManager.pushDialog(componentRef.instance.GetRootElement());
2001
2081
  componentRef.instance.DetectChanges();
2002
2082
  return componentRef;
2003
2083
  }
2004
- /** @nocollapse */ static ɵfac = function OverlayWindowService_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || OverlayWindowService)(i0.ɵɵinject(ComponentListMagicService), i0.ɵɵinject(EngineMagicService), i0.ɵɵinject(MagicLazyLoaderService), i0.ɵɵinject(i0.Injector), i0.ɵɵinject(i0.Compiler), i0.ɵɵinject(OverlayContainerMagicProvider), i0.ɵɵinject(ConfirmationComponentsMagicProvider)); };
2084
+ /** @nocollapse */ static ɵfac = function OverlayWindowService_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || OverlayWindowService)(); };
2005
2085
  /** @nocollapse */ static ɵprov = /** @pureOrBreakMyCode */ i0.ɵɵdefineInjectable({ token: OverlayWindowService, factory: OverlayWindowService.ɵfac, providedIn: 'root' });
2006
2086
  }
2007
2087
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(OverlayWindowService, [{
@@ -2009,7 +2089,7 @@ class OverlayWindowService {
2009
2089
  args: [{
2010
2090
  providedIn: 'root'
2011
2091
  }]
2012
- }], () => [{ type: ComponentListMagicService }, { type: EngineMagicService }, { type: MagicLazyLoaderService }, { type: i0.Injector }, { type: i0.Compiler }, { type: OverlayContainerMagicProvider }, { type: ConfirmationComponentsMagicProvider }], null); })();
2092
+ }], () => [], null); })();
2013
2093
  class OverlayWindowFocusManager {
2014
2094
  rootMagicElement = null;
2015
2095
  openDialogList = new Array(0);
@@ -2134,8 +2214,6 @@ class DialogInfo {
2134
2214
  * Main service to connect the UI with the Magic WebCLient
2135
2215
  */
2136
2216
  class TaskMagicService {
2137
- magic;
2138
- overlayWindowService;
2139
2217
  /**
2140
2218
  * Service to provide table-related functionalities
2141
2219
  */
@@ -2207,13 +2285,9 @@ class TaskMagicService {
2207
2285
  * @ignore
2208
2286
  */
2209
2287
  oldPageSize = 0;
2210
- /**
2211
- *
2212
- * @param magic
2213
- */
2214
- constructor(magic, overlayWindowService) {
2215
- this.magic = magic;
2216
- this.overlayWindowService = overlayWindowService;
2288
+ magic = inject(EngineMagicService);
2289
+ overlayWindowService = inject(OverlayWindowService);
2290
+ constructor() {
2217
2291
  this.Records.setGuiTopIndex(0);
2218
2292
  this.mgInputDateFormat = null;
2219
2293
  }
@@ -2996,12 +3070,13 @@ class TaskMagicService {
2996
3070
  }
2997
3071
  /**
2998
3072
  * Handle the Radio button "change" event
2999
- * @param event The event received from the UI
3000
3073
  * @param idx Id of the control raising the event
3074
+ * @param rowId Id of the row containing the control (defaults to '0' for non-table controls)
3001
3075
  */
3002
- mgOnRadioSelectionChanged(idx) {
3003
- let result = this.getFormControl('0', idx);
3004
- let guiEvent = getGuiEventObj('selectionchanged', idx, 0);
3076
+ mgOnRadioSelectionChanged(idx, rowId = '0') {
3077
+ // Fetch the Form Control for the specific table row (or row '0' for non-table child controls)
3078
+ let result = this.getFormControl(rowId, idx);
3079
+ let guiEvent = getGuiEventObj('selectionchanged', idx, +rowId);
3005
3080
  if (typeof result.value !== 'number')
3006
3081
  guiEvent.Value = result.value.index;
3007
3082
  else
@@ -3076,29 +3151,22 @@ class TaskMagicService {
3076
3151
  }
3077
3152
  }
3078
3153
  }
3079
- /** @nocollapse */ static ɵfac = function TaskMagicService_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || TaskMagicService)(i0.ɵɵinject(EngineMagicService), i0.ɵɵinject(OverlayWindowService)); };
3154
+ /** @nocollapse */ static ɵfac = function TaskMagicService_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || TaskMagicService)(); };
3080
3155
  /** @nocollapse */ static ɵprov = /** @pureOrBreakMyCode */ i0.ɵɵdefineInjectable({ token: TaskMagicService, factory: TaskMagicService.ɵfac });
3081
3156
  }
3082
3157
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(TaskMagicService, [{
3083
3158
  type: Injectable
3084
- }], () => [{ type: EngineMagicService }, { type: OverlayWindowService }], null); })();
3159
+ }], () => [], null); })();
3085
3160
 
3086
3161
  /**
3087
3162
  * Implements various table-related functionalities
3088
3163
  */
3089
3164
  class TableMagicService {
3090
- componentList;
3091
- task;
3092
3165
  selectedItem;
3093
3166
  chunkSize;
3094
- /**
3095
- *
3096
- * @param componentList Component-mapping service
3097
- * @param task Magic task service
3098
- */
3099
- constructor(componentList, task) {
3100
- this.componentList = componentList;
3101
- this.task = task;
3167
+ componentList = inject(ComponentListMagicService);
3168
+ task = inject(TaskMagicService);
3169
+ constructor() {
3102
3170
  }
3103
3171
  shouldOpenFieldTextEditor = true;
3104
3172
  /**
@@ -3208,24 +3276,19 @@ class TableMagicService {
3208
3276
  topIndex--;
3209
3277
  return topIndex;
3210
3278
  }
3211
- /** @nocollapse */ static ɵfac = function TableMagicService_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || TableMagicService)(i0.ɵɵinject(ComponentListMagicService), i0.ɵɵinject(TaskMagicService)); };
3279
+ /** @nocollapse */ static ɵfac = function TableMagicService_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || TableMagicService)(); };
3212
3280
  /** @nocollapse */ static ɵprov = /** @pureOrBreakMyCode */ i0.ɵɵdefineInjectable({ token: TableMagicService, factory: TableMagicService.ɵfac });
3213
3281
  }
3214
3282
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(TableMagicService, [{
3215
3283
  type: Injectable
3216
- }], () => [{ type: ComponentListMagicService }, { type: TaskMagicService }], null); })();
3284
+ }], () => [], null); })();
3217
3285
 
3218
3286
  /**
3219
3287
  * Enables changing the browser title using Magic expression (SetTitle)
3220
3288
  */
3221
3289
  class TitleMagicService {
3222
- titleService;
3223
- /**
3224
- *
3225
- * @param titleService Angular's title-changing class
3226
- */
3227
- constructor(titleService) {
3228
- this.titleService = titleService;
3290
+ titleService = inject(Title);
3291
+ constructor() {
3229
3292
  }
3230
3293
  /**
3231
3294
  * Set the new title of the window
@@ -3234,12 +3297,12 @@ class TitleMagicService {
3234
3297
  setTitle(newTitle) {
3235
3298
  this.titleService.setTitle(newTitle);
3236
3299
  }
3237
- /** @nocollapse */ static ɵfac = function TitleMagicService_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || TitleMagicService)(i0.ɵɵinject(i1$1.Title)); };
3300
+ /** @nocollapse */ static ɵfac = function TitleMagicService_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || TitleMagicService)(); };
3238
3301
  /** @nocollapse */ static ɵprov = /** @pureOrBreakMyCode */ i0.ɵɵdefineInjectable({ token: TitleMagicService, factory: TitleMagicService.ɵfac });
3239
3302
  }
3240
3303
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(TitleMagicService, [{
3241
3304
  type: Injectable
3242
- }], () => [{ type: i1$1.Title }], null); })();
3305
+ }], () => [], null); })();
3243
3306
 
3244
3307
  let COLOR_FILE_NAME = new InjectionToken('colorFile', {
3245
3308
  providedIn: 'root',
@@ -3252,7 +3315,6 @@ const SYSTEM_BG = 4;
3252
3315
  const SYSTEM_FG_AND_SYSTEM_BG = 6;
3253
3316
  const TRANSPERENT_BG = 1;
3254
3317
  class MagicColorService {
3255
- http;
3256
3318
  colorFileName = 'clr_rnt.eng';
3257
3319
  getColorFilePath() {
3258
3320
  return 'assets/' + this.colorFileName;
@@ -3260,10 +3322,11 @@ class MagicColorService {
3260
3322
  colorsData;
3261
3323
  fileNotFound = false;
3262
3324
  // public static FILE_NAME;
3263
- constructor(http, colorFile1 = 'clr_rnt.eng') {
3264
- this.http = http;
3265
- if (colorFile1)
3266
- this.colorFileName = colorFile1;
3325
+ http = inject(HttpClient);
3326
+ colorFile1 = inject(COLOR_FILE_NAME);
3327
+ constructor() {
3328
+ if (this.colorFile1)
3329
+ this.colorFileName = this.colorFile1;
3267
3330
  else
3268
3331
  this.colorFileName = 'clr_rnt.eng';
3269
3332
  }
@@ -3335,7 +3398,7 @@ class MagicColorService {
3335
3398
  }
3336
3399
  return '';
3337
3400
  }
3338
- /** @nocollapse */ static ɵfac = function MagicColorService_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || MagicColorService)(i0.ɵɵinject(i1$2.HttpClient), i0.ɵɵinject(COLOR_FILE_NAME)); };
3401
+ /** @nocollapse */ static ɵfac = function MagicColorService_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || MagicColorService)(); };
3339
3402
  /** @nocollapse */ static ɵprov = /** @pureOrBreakMyCode */ i0.ɵɵdefineInjectable({ token: MagicColorService, factory: MagicColorService.ɵfac, providedIn: 'root' });
3340
3403
  }
3341
3404
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(MagicColorService, [{
@@ -3343,26 +3406,21 @@ class MagicColorService {
3343
3406
  args: [{
3344
3407
  providedIn: 'root'
3345
3408
  }]
3346
- }], () => [{ type: i1$2.HttpClient }, { type: undefined, decorators: [{
3347
- type: Inject,
3348
- args: [COLOR_FILE_NAME]
3349
- }] }], null); })();
3409
+ }], () => [], null); })();
3350
3410
 
3351
3411
  /**
3352
3412
  * Provides the UI with values calculated by the Magic WebClient
3353
3413
  */
3354
3414
  class AccessorMagicService {
3355
- task;
3356
- magicColor;
3357
3415
  Logger = null;
3358
3416
  hhmm = maskitoTimeOptionsGenerator({ mode: 'HH:MM' });
3359
3417
  hhmmss = maskitoTimeOptionsGenerator({ mode: 'HH:MM:SS' });
3418
+ task = inject(TaskMagicService);
3419
+ magicColor = inject(MagicColorService);
3360
3420
  /**
3361
3421
  * @ignore
3362
3422
  */
3363
- constructor(task, magicColor) {
3364
- this.task = task;
3365
- this.magicColor = magicColor;
3423
+ constructor() {
3366
3424
  this.Logger = Logger.Instance;
3367
3425
  }
3368
3426
  UploadFileToServer(fileContent, serverFileName) {
@@ -3463,6 +3521,19 @@ class AccessorMagicService {
3463
3521
  let vis = this.getProperty(controlId, HtmlProperties.Visible, rowId);
3464
3522
  return vis ? 'visible' : 'hidden';
3465
3523
  }
3524
+ /**
3525
+ * Returns whether a control is visible or not
3526
+ * @param controlId Id of control
3527
+ * @param rowId Id of row, if applicable
3528
+ * @returns true if the control is visible, false otherwise
3529
+ */
3530
+ // mgIsVisible
3531
+ isVisible(controlId, rowId) {
3532
+ // The value is not always a boolean: getProperty() returns '' if the control has not sent its
3533
+ // Visible property yet, and undefined if the row does not exist. Comparing with === true turns
3534
+ // both into false. getVisible() behaves the same way - for those values it returns 'hidden'.
3535
+ return this.getProperty(controlId, HtmlProperties.Visible, rowId) === true;
3536
+ }
3466
3537
  /**
3467
3538
  * Returns alpha mask of a control
3468
3539
  * @param controlId Id of control
@@ -3975,49 +4046,42 @@ class AccessorMagicService {
3975
4046
  getColor(colorNumber, colorType) {
3976
4047
  return this.magicColor.getColor(colorNumber, colorType);
3977
4048
  }
3978
- /** @nocollapse */ static ɵfac = function AccessorMagicService_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || AccessorMagicService)(i0.ɵɵinject(TaskMagicService), i0.ɵɵinject(MagicColorService)); };
4049
+ /** @nocollapse */ static ɵfac = function AccessorMagicService_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || AccessorMagicService)(); };
3979
4050
  /** @nocollapse */ static ɵprov = /** @pureOrBreakMyCode */ i0.ɵɵdefineInjectable({ token: AccessorMagicService, factory: AccessorMagicService.ɵfac });
3980
4051
  }
3981
4052
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(AccessorMagicService, [{
3982
4053
  type: Injectable
3983
- }], () => [{ type: TaskMagicService }, { type: MagicColorService }], null); })();
4054
+ }], () => [], null); })();
3984
4055
 
3985
4056
  /**
3986
4057
  * Central place for adding the Magic services
3987
4058
  */
3988
4059
  class MagicServices {
3989
- task;
3990
- subformService;
3991
- tableService;
3992
- titleService;
3993
- mgAccessorService;
4060
+ task = inject(TaskMagicService);
4061
+ subformService = inject(SubformMagicService);
4062
+ tableService = inject(TableMagicService);
4063
+ titleService = inject(TitleMagicService);
4064
+ mgAccessorService = inject(AccessorMagicService);
3994
4065
  /**
3995
4066
  * @ignore
3996
4067
  */
3997
- constructor(task, subformService, tableService, titleService, mgAccessorService) {
3998
- this.task = task;
3999
- this.subformService = subformService;
4000
- this.tableService = tableService;
4001
- this.titleService = titleService;
4002
- this.mgAccessorService = mgAccessorService;
4003
- task.tableService = tableService;
4004
- task.mgSubformService = subformService;
4005
- task.mgTitleService = titleService;
4006
- task.mgAccessorService = mgAccessorService;
4007
- }
4008
- /** @nocollapse */ static ɵfac = function MagicServices_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || MagicServices)(i0.ɵɵinject(TaskMagicService), i0.ɵɵinject(SubformMagicService), i0.ɵɵinject(TableMagicService), i0.ɵɵinject(TitleMagicService), i0.ɵɵinject(AccessorMagicService)); };
4068
+ constructor() {
4069
+ this.task.tableService = this.tableService;
4070
+ this.task.mgSubformService = this.subformService;
4071
+ this.task.mgTitleService = this.titleService;
4072
+ this.task.mgAccessorService = this.mgAccessorService;
4073
+ }
4074
+ /** @nocollapse */ static ɵfac = function MagicServices_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || MagicServices)(); };
4009
4075
  /** @nocollapse */ static ɵprov = /** @pureOrBreakMyCode */ i0.ɵɵdefineInjectable({ token: MagicServices, factory: MagicServices.ɵfac });
4010
4076
  }
4011
4077
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(MagicServices, [{
4012
4078
  type: Injectable
4013
- }], () => [{ type: TaskMagicService }, { type: SubformMagicService }, { type: TableMagicService }, { type: TitleMagicService }, { type: AccessorMagicService }], null); })();
4079
+ }], () => [], null); })();
4014
4080
 
4015
4081
  /**
4016
4082
  * Base component representing a Magic task
4017
4083
  */
4018
4084
  class TaskBaseMagicComponent {
4019
- ref;
4020
- magicServices;
4021
4085
  /**
4022
4086
  * Id of task, used for initializing the task service
4023
4087
  */
@@ -4030,15 +4094,24 @@ class TaskBaseMagicComponent {
4030
4094
  * @ignore
4031
4095
  */
4032
4096
  magicProperties = MagicProperties;
4097
+ /**
4098
+ * @ignore
4099
+ * Injected as fields rather than constructor parameters, so that the constructor
4100
+ * signature of this base class - which every generated component inherits - is unchanged.
4101
+ */
4102
+ magicChangeDetection = inject(MagicChangeDetectionService);
4103
+ /**
4104
+ * @ignore
4105
+ */
4106
+ destroyRef = inject(DestroyRef);
4107
+ ref = inject(ChangeDetectorRef);
4108
+ magicServices = inject(MagicServices);
4033
4109
  /**
4034
4110
  *
4035
4111
  * @param ref changes-detector object
4036
4112
  * @param magicServices Access point for all Magic services
4037
4113
  */
4038
- constructor(ref, magicServices) {
4039
- this.ref = ref;
4040
- this.magicServices = magicServices;
4041
- }
4114
+ constructor() { }
4042
4115
  /**
4043
4116
  * Returns the Magic task service
4044
4117
  * @returns
@@ -4088,6 +4161,14 @@ class TaskBaseMagicComponent {
4088
4161
  this.task.detectChanges.pipe().subscribe(c => {
4089
4162
  this.ref.detectChanges();
4090
4163
  });
4164
+ // Running zoneless, nothing refreshes this view unless Angular is told to.
4165
+ // MagicChangeDetectionService is application-scoped and never completes, so this
4166
+ // subscription must be tied to the component's lifetime.
4167
+ this.magicChangeDetection.changed
4168
+ .pipe(takeUntilDestroyed(this.destroyRef))
4169
+ .subscribe(() => {
4170
+ this.ref.markForCheck();
4171
+ });
4091
4172
  this.task.initTask(this.taskIdParam, this.taskDescription);
4092
4173
  this.createFormControlsAccessor(this.screenFormGroup);
4093
4174
  this.setInputDateFormat();
@@ -4161,8 +4242,8 @@ class TaskBaseMagicComponent {
4161
4242
  ngOnDestroy() {
4162
4243
  this.task.dispose();
4163
4244
  }
4164
- /** @nocollapse */ static ɵfac = function TaskBaseMagicComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || TaskBaseMagicComponent)(i0.ɵɵdirectiveInject(i0.ChangeDetectorRef), i0.ɵɵdirectiveInject(MagicServices)); };
4165
- /** @nocollapse */ static ɵcmp = /** @pureOrBreakMyCode */ i0.ɵɵdefineComponent({ type: TaskBaseMagicComponent, selectors: [["task-magic"]], inputs: { taskIdParam: "taskIdParam", taskDescription: "taskDescription" }, standalone: false, features: [i0.ɵɵProvidersFeature([TaskMagicService, SubformMagicService, TableMagicService])], decls: 0, vars: 0, template: function TaskBaseMagicComponent_Template(rf, ctx) { }, encapsulation: 2 });
4245
+ /** @nocollapse */ static ɵfac = function TaskBaseMagicComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || TaskBaseMagicComponent)(); };
4246
+ /** @nocollapse */ static ɵcmp = /** @pureOrBreakMyCode */ i0.ɵɵdefineComponent({ type: TaskBaseMagicComponent, selectors: [["task-magic"]], inputs: { taskIdParam: "taskIdParam", taskDescription: "taskDescription" }, standalone: false, features: [i0.ɵɵProvidersFeature([TaskMagicService, SubformMagicService, TableMagicService])], decls: 0, vars: 0, template: function TaskBaseMagicComponent_Template(rf, ctx) { }, encapsulation: 2, changeDetection: 1 });
4166
4247
  }
4167
4248
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(TaskBaseMagicComponent, [{
4168
4249
  type: Component,
@@ -4170,21 +4251,20 @@ class TaskBaseMagicComponent {
4170
4251
  selector: 'task-magic',
4171
4252
  providers: [TaskMagicService, SubformMagicService, TableMagicService],
4172
4253
  template: '',
4254
+ changeDetection: ChangeDetectionStrategy.Eager,
4173
4255
  standalone: false
4174
4256
  }]
4175
- }], () => [{ type: i0.ChangeDetectorRef }, { type: MagicServices }], { taskIdParam: [{
4257
+ }], () => [], { taskIdParam: [{
4176
4258
  type: Input
4177
4259
  }], taskDescription: [{
4178
4260
  type: Input
4179
4261
  }] }); })();
4180
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(TaskBaseMagicComponent, { className: "TaskBaseMagicComponent", filePath: "src/ui/task-base.magic.component.ts", lineNumber: 21 }); })();
4262
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(TaskBaseMagicComponent, { className: "TaskBaseMagicComponent", filePath: "src/ui/task-base.magic.component.ts", lineNumber: 24 }); })();
4181
4263
 
4182
4264
  /**
4183
4265
  * @ignore
4184
4266
  */
4185
4267
  class RowMagicDirective {
4186
- _task;
4187
- element;
4188
4268
  rowId;
4189
4269
  /**
4190
4270
  * The HTML element connected to this directive
@@ -4194,9 +4274,9 @@ class RowMagicDirective {
4194
4274
  * @ignore
4195
4275
  */
4196
4276
  rowChangedSubscriber = null;
4197
- constructor(_task, element) {
4198
- this._task = _task;
4199
- this.element = element;
4277
+ _task = inject(TaskMagicService);
4278
+ element = inject(ElementRef);
4279
+ constructor() {
4200
4280
  this.htmlElement = this.element.nativeElement;
4201
4281
  }
4202
4282
  /**
@@ -4237,7 +4317,7 @@ class RowMagicDirective {
4237
4317
  event.cancelBubble = true;
4238
4318
  }
4239
4319
  }
4240
- /** @nocollapse */ static ɵfac = function RowMagicDirective_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || RowMagicDirective)(i0.ɵɵdirectiveInject(TaskMagicService), i0.ɵɵdirectiveInject(i0.ElementRef)); };
4320
+ /** @nocollapse */ static ɵfac = function RowMagicDirective_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || RowMagicDirective)(); };
4241
4321
  /** @nocollapse */ static ɵdir = /** @pureOrBreakMyCode */ i0.ɵɵdefineDirective({ type: RowMagicDirective, selectors: [["", "magicRow", ""]], hostBindings: function RowMagicDirective_HostBindings(rf, ctx) { if (rf & 1) {
4242
4322
  i0.ɵɵlistener("click", function RowMagicDirective_click_HostBindingHandler($event) { return ctx.onClick($event); });
4243
4323
  } }, inputs: { rowId: [0, "magicRow", "rowId"] }, standalone: false });
@@ -4248,7 +4328,7 @@ class RowMagicDirective {
4248
4328
  selector: '[magicRow]',
4249
4329
  standalone: false
4250
4330
  }]
4251
- }], () => [{ type: TaskMagicService }, { type: i0.ElementRef }], { rowId: [{
4331
+ }], () => [], { rowId: [{
4252
4332
  type: Input,
4253
4333
  args: ['magicRow']
4254
4334
  }], onClick: [{
@@ -4260,12 +4340,6 @@ class RowMagicDirective {
4260
4340
  * Connects HTML elements to the Magic Web Client engine
4261
4341
  */
4262
4342
  class MagicDirective {
4263
- _task;
4264
- element;
4265
- renderer;
4266
- vcRef;
4267
- platform;
4268
- magicRow;
4269
4343
  set magic(val) {
4270
4344
  this.id = val;
4271
4345
  this.selector = "magic";
@@ -4329,21 +4403,15 @@ class MagicDirective {
4329
4403
  * @param platform
4330
4404
  * @param magicRow
4331
4405
  */
4332
- constructor(_task, element, renderer, vcRef, platform, magicRow) {
4333
- this._task = _task;
4334
- this.element = element;
4335
- this.renderer = renderer;
4336
- this.vcRef = vcRef;
4337
- this.platform = platform;
4338
- this.magicRow = magicRow;
4406
+ constructor() {
4339
4407
  this.htmlElement = this.element.nativeElement;
4340
4408
  //let c = (<any>this.vcRef)._view;
4341
4409
  //while (!(c instanceof TaskBaseMagicComponent)) {
4342
4410
  // c = c.component;
4343
4411
  //}
4344
4412
  //this.component = c;
4345
- if (!(typeof magicRow === "undefined" || magicRow === null))
4346
- this.rowId = magicRow.rowId;
4413
+ if (!(typeof this.magicRow === "undefined" || this.magicRow === null))
4414
+ this.rowId = this.magicRow.rowId;
4347
4415
  }
4348
4416
  /**
4349
4417
  * Get the task service
@@ -4352,6 +4420,12 @@ class MagicDirective {
4352
4420
  get task() {
4353
4421
  return this._task;
4354
4422
  }
4423
+ _task = inject(TaskMagicService);
4424
+ element = inject(ElementRef);
4425
+ renderer = inject(Renderer2);
4426
+ vcRef = inject(ViewContainerRef);
4427
+ platform = inject(Platform);
4428
+ magicRow = inject(RowMagicDirective, { optional: true });
4355
4429
  /**
4356
4430
  * Register to the events this element may need to handle
4357
4431
  */
@@ -4554,7 +4628,7 @@ class MagicDirective {
4554
4628
  ngOnDestroy() {
4555
4629
  this.subscribeRefreshDom.unsubscribe();
4556
4630
  }
4557
- /** @nocollapse */ static ɵfac = function MagicDirective_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || MagicDirective)(i0.ɵɵdirectiveInject(TaskMagicService), i0.ɵɵdirectiveInject(i0.ElementRef), i0.ɵɵdirectiveInject(i0.Renderer2), i0.ɵɵdirectiveInject(i0.ViewContainerRef), i0.ɵɵdirectiveInject(i2$2.Platform), i0.ɵɵdirectiveInject(RowMagicDirective, 8)); };
4631
+ /** @nocollapse */ static ɵfac = function MagicDirective_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || MagicDirective)(); };
4558
4632
  /** @nocollapse */ static ɵdir = /** @pureOrBreakMyCode */ i0.ɵɵdefineDirective({ type: MagicDirective, selectors: [["", "magic", ""]], inputs: { magic: "magic", eventsOnly: "eventsOnly", pollTime: "pollTime", rowId: "rowId" }, standalone: false });
4559
4633
  }
4560
4634
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(MagicDirective, [{
@@ -4563,9 +4637,7 @@ class MagicDirective {
4563
4637
  selector: "[magic]",
4564
4638
  standalone: false
4565
4639
  }]
4566
- }], () => [{ type: TaskMagicService }, { type: i0.ElementRef }, { type: i0.Renderer2 }, { type: i0.ViewContainerRef }, { type: i2$2.Platform }, { type: RowMagicDirective, decorators: [{
4567
- type: Optional
4568
- }] }], { magic: [{
4640
+ }], () => [], { magic: [{
4569
4641
  type: Input,
4570
4642
  args: ["magic"]
4571
4643
  }], eventsOnly: [{
@@ -4583,9 +4655,15 @@ class MagicDirective {
4583
4655
  class NoControlMagicDirective extends MagicDirective {
4584
4656
  set magic(val) { this.id = val; this.selector = 'magicnc'; }
4585
4657
  ;
4586
- constructor(_task, element, renderer, vcRef, platform, magicRow) {
4587
- super(_task, element, renderer, vcRef, platform, magicRow);
4658
+ constructor() {
4659
+ super();
4588
4660
  }
4661
+ _task = inject(TaskMagicService);
4662
+ element = inject(ElementRef);
4663
+ renderer = inject(Renderer2);
4664
+ vcRef = inject(ViewContainerRef);
4665
+ platform = inject(Platform);
4666
+ magicRow = inject(RowMagicDirective, { optional: true });
4589
4667
  regEvents() {
4590
4668
  super.regEvents();
4591
4669
  if (this.htmlElement instanceof HTMLSelectElement) {
@@ -4752,7 +4830,7 @@ class NoControlMagicDirective extends MagicDirective {
4752
4830
  break;
4753
4831
  }
4754
4832
  }
4755
- /** @nocollapse */ static ɵfac = function NoControlMagicDirective_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || NoControlMagicDirective)(i0.ɵɵdirectiveInject(TaskMagicService), i0.ɵɵdirectiveInject(i0.ElementRef), i0.ɵɵdirectiveInject(i0.Renderer2), i0.ɵɵdirectiveInject(i0.ViewContainerRef), i0.ɵɵdirectiveInject(i2$2.Platform), i0.ɵɵdirectiveInject(RowMagicDirective, 8)); };
4833
+ /** @nocollapse */ static ɵfac = function NoControlMagicDirective_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || NoControlMagicDirective)(); };
4756
4834
  /** @nocollapse */ static ɵdir = /** @pureOrBreakMyCode */ i0.ɵɵdefineDirective({ type: NoControlMagicDirective, selectors: [["", "magicnc", ""]], inputs: { magic: [0, "magicnc", "magic"] }, standalone: false, features: [i0.ɵɵInheritDefinitionFeature] });
4757
4835
  }
4758
4836
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(NoControlMagicDirective, [{
@@ -4761,9 +4839,7 @@ class NoControlMagicDirective extends MagicDirective {
4761
4839
  selector: '[magicnc]',
4762
4840
  standalone: false
4763
4841
  }]
4764
- }], () => [{ type: TaskMagicService }, { type: i0.ElementRef }, { type: i0.Renderer2 }, { type: i0.ViewContainerRef }, { type: i2$2.Platform }, { type: RowMagicDirective, decorators: [{
4765
- type: Optional
4766
- }] }], { magic: [{
4842
+ }], () => [], { magic: [{
4767
4843
  type: Input,
4768
4844
  args: ['magicnc']
4769
4845
  }] }); })();
@@ -4778,10 +4854,9 @@ class Constants {
4778
4854
  * @ignore
4779
4855
  */
4780
4856
  class DateMagicPipe extends DatePipe {
4781
- _task;
4782
- constructor(_task) {
4857
+ _task = inject(TaskMagicService);
4858
+ constructor() {
4783
4859
  super('en-US');
4784
- this._task = _task;
4785
4860
  }
4786
4861
  transform(value, controlId) {
4787
4862
  let mask = this._task.GetControlPictureMask(controlId).getMask();
@@ -4802,7 +4877,7 @@ class DateMagicPipe extends DatePipe {
4802
4877
  value = "";
4803
4878
  return value;
4804
4879
  }
4805
- /** @nocollapse */ static ɵfac = function DateMagicPipe_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || DateMagicPipe)(i0.ɵɵdirectiveInject(TaskMagicService, 16)); };
4880
+ /** @nocollapse */ static ɵfac = function DateMagicPipe_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || DateMagicPipe)(); };
4806
4881
  /** @nocollapse */ static ɵpipe = /** @pureOrBreakMyCode */ i0.ɵɵdefinePipe({ name: "magicDate", type: DateMagicPipe, pure: true, standalone: false });
4807
4882
  }
4808
4883
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(DateMagicPipe, [{
@@ -4811,7 +4886,7 @@ class DateMagicPipe extends DatePipe {
4811
4886
  name: 'magicDate',
4812
4887
  standalone: false
4813
4888
  }]
4814
- }], () => [{ type: TaskMagicService }], null); })();
4889
+ }], () => [], null); })();
4815
4890
  class MgDateFormatter {
4816
4891
  ConvertMgDateFormatToAngular(mgDateMask) {
4817
4892
  let formatStr = new StringBuilder();
@@ -4879,16 +4954,13 @@ class MgDateFormatter {
4879
4954
  * Perform Magic validation on input controls which hold alphanumeric strings
4880
4955
  */
4881
4956
  class MgformatMagicDirective {
4882
- magicDir;
4883
- _task;
4884
4957
  datePasteFlag = false;
4958
+ magicDir = inject(MagicDirective);
4959
+ _task = inject(TaskMagicService);
4885
4960
  /**
4886
4961
  * @ignore
4887
4962
  */
4888
- constructor(magicDir, _task) {
4889
- this.magicDir = magicDir;
4890
- this._task = _task;
4891
- }
4963
+ constructor() { }
4892
4964
  ngAfterViewInit() {
4893
4965
  let control = this._task.getFormControl(this.magicDir.rowId, this.magicDir.id);
4894
4966
  if (control != null && this._task.mgInputDateFormat == null) {
@@ -5482,7 +5554,7 @@ class MgformatMagicDirective {
5482
5554
  return true;
5483
5555
  return false;
5484
5556
  }
5485
- /** @nocollapse */ static ɵfac = function MgformatMagicDirective_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || MgformatMagicDirective)(i0.ɵɵdirectiveInject(MagicDirective), i0.ɵɵdirectiveInject(TaskMagicService)); };
5557
+ /** @nocollapse */ static ɵfac = function MgformatMagicDirective_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || MgformatMagicDirective)(); };
5486
5558
  /** @nocollapse */ static ɵdir = /** @pureOrBreakMyCode */ i0.ɵɵdefineDirective({ type: MgformatMagicDirective, selectors: [["", "mgFormat", ""]], hostBindings: function MgformatMagicDirective_HostBindings(rf, ctx) { if (rf & 1) {
5487
5559
  i0.ɵɵlistener("focus", function MgformatMagicDirective_focus_HostBindingHandler($event) { return ctx.onFocusEvent($event); })("paste", function MgformatMagicDirective_paste_HostBindingHandler($event) { return ctx.onPaste($event); })("input", function MgformatMagicDirective_input_HostBindingHandler($event) { return ctx.onInputEvent($event); })("change", function MgformatMagicDirective_change_HostBindingHandler($event) { return ctx.onChangeEvent($event); })("blur", function MgformatMagicDirective_blur_HostBindingHandler($event) { return ctx.onBlurEvent($event); });
5488
5560
  } }, standalone: false });
@@ -5493,7 +5565,7 @@ class MgformatMagicDirective {
5493
5565
  selector: '[mgFormat]',
5494
5566
  standalone: false
5495
5567
  }]
5496
- }], () => [{ type: MagicDirective }, { type: TaskMagicService }], { onFocusEvent: [{
5568
+ }], () => [], { onFocusEvent: [{
5497
5569
  type: HostListener,
5498
5570
  args: ['focus', ['$event']]
5499
5571
  }], onPaste: [{
@@ -5514,10 +5586,9 @@ class MgformatMagicDirective {
5514
5586
  * @ignore
5515
5587
  */
5516
5588
  class TimeMagicPipe extends DatePipe {
5517
- _task;
5518
- constructor(_task) {
5589
+ _task = inject(TaskMagicService);
5590
+ constructor() {
5519
5591
  super('en-US');
5520
- this._task = _task;
5521
5592
  }
5522
5593
  transform(value, controlId) {
5523
5594
  let mask = this._task.GetControlPictureMask(controlId).getMask();
@@ -5548,7 +5619,7 @@ class TimeMagicPipe extends DatePipe {
5548
5619
  }
5549
5620
  return value;
5550
5621
  }
5551
- /** @nocollapse */ static ɵfac = function TimeMagicPipe_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || TimeMagicPipe)(i0.ɵɵdirectiveInject(TaskMagicService, 16)); };
5622
+ /** @nocollapse */ static ɵfac = function TimeMagicPipe_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || TimeMagicPipe)(); };
5552
5623
  /** @nocollapse */ static ɵpipe = /** @pureOrBreakMyCode */ i0.ɵɵdefinePipe({ name: "magicTime", type: TimeMagicPipe, pure: true, standalone: false });
5553
5624
  }
5554
5625
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(TimeMagicPipe, [{
@@ -5557,22 +5628,20 @@ class TimeMagicPipe extends DatePipe {
5557
5628
  name: 'magicTime',
5558
5629
  standalone: false
5559
5630
  }]
5560
- }], () => [{ type: TaskMagicService }], null); })();
5631
+ }], () => [], null); })();
5561
5632
 
5562
5633
  /**
5563
5634
  * Validates the field range.
5564
5635
  */
5565
5636
  class RangeValidatorMagicDirective {
5566
- _task;
5567
- vcRef;
5637
+ _task = inject(TaskMagicService);
5638
+ vcRef = inject(ViewContainerRef);
5568
5639
  /**
5569
5640
  *
5570
5641
  * @param _task The task service
5571
5642
  * @param vcRef
5572
5643
  */
5573
- constructor(_task, vcRef) {
5574
- this._task = _task;
5575
- this.vcRef = vcRef;
5644
+ constructor() {
5576
5645
  }
5577
5646
  /**
5578
5647
  * Validation method
@@ -5607,7 +5676,7 @@ class RangeValidatorMagicDirective {
5607
5676
  const formGroup = c.parent.controls;
5608
5677
  return Object.keys(formGroup).find(name => c === formGroup[name]) || null;
5609
5678
  }
5610
- /** @nocollapse */ static ɵfac = function RangeValidatorMagicDirective_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || RangeValidatorMagicDirective)(i0.ɵɵdirectiveInject(TaskMagicService), i0.ɵɵdirectiveInject(i0.ViewContainerRef)); };
5679
+ /** @nocollapse */ static ɵfac = function RangeValidatorMagicDirective_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || RangeValidatorMagicDirective)(); };
5611
5680
  /** @nocollapse */ static ɵdir = /** @pureOrBreakMyCode */ i0.ɵɵdefineDirective({ type: RangeValidatorMagicDirective, selectors: [["", "rangevalidator", ""]], standalone: false, features: [i0.ɵɵProvidersFeature([
5612
5681
  {
5613
5682
  provide: NG_VALIDATORS,
@@ -5629,7 +5698,7 @@ class RangeValidatorMagicDirective {
5629
5698
  ],
5630
5699
  standalone: false
5631
5700
  }]
5632
- }], () => [{ type: TaskMagicService }, { type: i0.ViewContainerRef }], null); })();
5701
+ }], () => [], null); })();
5633
5702
 
5634
5703
  function SubformMagicComponent_Conditional_0_Template(rf, ctx) { if (rf & 1) {
5635
5704
  i0.ɵɵelement(0, "ndc-dynamic", 0);
@@ -5641,8 +5710,6 @@ function SubformMagicComponent_Conditional_0_Template(rf, ctx) { if (rf & 1) {
5641
5710
  * Represents a Magic subform
5642
5711
  */
5643
5712
  class SubformMagicComponent {
5644
- vcRef;
5645
- mgSub;
5646
5713
  /**
5647
5714
  * @ignore
5648
5715
  */
@@ -5659,12 +5726,12 @@ class SubformMagicComponent {
5659
5726
  /**
5660
5727
  * @ignore
5661
5728
  */
5662
- constructor(vcRef, mgSub) {
5663
- this.vcRef = vcRef;
5664
- this.mgSub = mgSub;
5729
+ constructor() {
5665
5730
  // For angular 13 - find the component from _hostLView
5666
5731
  this.component = (this.vcRef._hostLView).find(v => !isNullOrUndefined(v));
5667
5732
  }
5733
+ vcRef = inject(ViewContainerRef);
5734
+ mgSub = inject(SubformMagicService);
5668
5735
  /**
5669
5736
  * @ignore
5670
5737
  */
@@ -5677,32 +5744,33 @@ class SubformMagicComponent {
5677
5744
  get Parameters() {
5678
5745
  return this.mgSub.mgGetParameters(this.id);
5679
5746
  }
5680
- /** @nocollapse */ static ɵfac = function SubformMagicComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || SubformMagicComponent)(i0.ɵɵdirectiveInject(i0.ViewContainerRef), i0.ɵɵdirectiveInject(SubformMagicService)); };
5747
+ /** @nocollapse */ static ɵfac = function SubformMagicComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || SubformMagicComponent)(); };
5681
5748
  /** @nocollapse */ static ɵcmp = /** @pureOrBreakMyCode */ i0.ɵɵdefineComponent({ type: SubformMagicComponent, selectors: [["magic-subform"]], inputs: { magic: "magic" }, standalone: false, decls: 1, vars: 1, consts: [[3, "ndcDynamicComponent", "ndcDynamicInputs"]], template: function SubformMagicComponent_Template(rf, ctx) { if (rf & 1) {
5682
5749
  i0.ɵɵconditionalCreate(0, SubformMagicComponent_Conditional_0_Template, 1, 2, "ndc-dynamic", 0);
5683
5750
  } if (rf & 2) {
5684
5751
  i0.ɵɵconditional(ctx.Component ? 0 : -1);
5685
- } }, dependencies: [i2$3.DynamicIoDirective, i2$3.DynamicComponent], encapsulation: 2 });
5752
+ } }, dependencies: [i1$1.DynamicIoDirective, i1$1.DynamicComponent], encapsulation: 2, changeDetection: 1 });
5686
5753
  }
5687
5754
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(SubformMagicComponent, [{
5688
5755
  type: Component,
5689
5756
  args: [{
5690
5757
  selector: 'magic-subform',
5691
- template: `
5692
- @if (Component) {
5693
- <ndc-dynamic
5694
- [ndcDynamicComponent]="Component"
5695
- [ndcDynamicInputs]="Parameters">
5696
- </ndc-dynamic>
5697
- }
5758
+ template: `
5759
+ @if (Component) {
5760
+ <ndc-dynamic
5761
+ [ndcDynamicComponent]="Component"
5762
+ [ndcDynamicInputs]="Parameters">
5763
+ </ndc-dynamic>
5764
+ }
5698
5765
  `,
5766
+ changeDetection: ChangeDetectionStrategy.Eager,
5699
5767
  standalone: false
5700
5768
  }]
5701
- }], () => [{ type: i0.ViewContainerRef }, { type: SubformMagicService }], { magic: [{
5769
+ }], () => [], { magic: [{
5702
5770
  type: Input,
5703
5771
  args: ['magic']
5704
5772
  }] }); })();
5705
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(SubformMagicComponent, { className: "SubformMagicComponent", filePath: "src/ui/subform.magic.component.ts", lineNumber: 23 }); })();
5773
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(SubformMagicComponent, { className: "SubformMagicComponent", filePath: "src/ui/subform.magic.component.ts", lineNumber: 24 }); })();
5706
5774
 
5707
5775
  const _c0$1 = ["customContent"];
5708
5776
  const _c1 = ["*"];
@@ -5730,9 +5798,6 @@ function ErrorMagicComponent_Conditional_0_Template(rf, ctx) { if (rf & 1) {
5730
5798
  * Represents a Magic subform
5731
5799
  */
5732
5800
  class ErrorMagicComponent {
5733
- _task;
5734
- mgService;
5735
- changeDetectorRef;
5736
5801
  /**
5737
5802
  * @ignore
5738
5803
  */
@@ -5751,19 +5816,19 @@ class ErrorMagicComponent {
5751
5816
  ;
5752
5817
  // if true - display standard magic error message, if false - customer has provides his own content and we'll use it
5753
5818
  defaultDisplay = true;
5754
- set CustomContent(innerComponent) {
5755
- this.defaultDisplay = innerComponent == undefined || this.isEmpty(innerComponent.nativeElement);
5756
- this.changeDetectorRef.detectChanges();
5757
- }
5758
- ;
5819
+ customContentRef = viewChild('customContent', /* @ts-ignore */
5820
+ ...(ngDevMode ? [{ debugName: "customContentRef" }] : /* istanbul ignore next */ []));
5759
5821
  /**
5760
5822
  * @ignore
5761
5823
  */
5762
- constructor(_task, mgService, changeDetectorRef) {
5763
- this._task = _task;
5764
- this.mgService = mgService;
5765
- this.changeDetectorRef = changeDetectorRef;
5824
+ constructor() {
5766
5825
  this.rowId = "0";
5826
+ // Reactively update defaultDisplay whenever customContent changes in the DOM
5827
+ effect(() => {
5828
+ const innerComponent = this.customContentRef();
5829
+ this.defaultDisplay = innerComponent == undefined || this.isEmpty(innerComponent.nativeElement);
5830
+ this.changeDetectorRef.detectChanges();
5831
+ });
5767
5832
  }
5768
5833
  /**
5769
5834
  * returns true if the html element has no children
@@ -5802,73 +5867,68 @@ class ErrorMagicComponent {
5802
5867
  }
5803
5868
  return false;
5804
5869
  }
5805
- /** @nocollapse */ static ɵfac = function ErrorMagicComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || ErrorMagicComponent)(i0.ɵɵdirectiveInject(TaskMagicService), i0.ɵɵdirectiveInject(AccessorMagicService), i0.ɵɵdirectiveInject(i0.ChangeDetectorRef)); };
5870
+ _task = inject(TaskMagicService);
5871
+ mgService = inject(AccessorMagicService);
5872
+ changeDetectorRef = inject(ChangeDetectorRef);
5873
+ /** @nocollapse */ static ɵfac = function ErrorMagicComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || ErrorMagicComponent)(); };
5806
5874
  /** @nocollapse */ static ɵcmp = /** @pureOrBreakMyCode */ i0.ɵɵdefineComponent({ type: ErrorMagicComponent, selectors: [["mgError"]], viewQuery: function ErrorMagicComponent_Query(rf, ctx) { if (rf & 1) {
5807
- i0.ɵɵviewQuery(_c0$1, 5);
5875
+ i0.ɵɵviewQuerySignal(ctx.customContentRef, _c0$1, 5);
5808
5876
  } if (rf & 2) {
5809
- let _t;
5810
- i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.CustomContent = _t.first);
5877
+ i0.ɵɵqueryAdvance();
5811
5878
  } }, inputs: { magic: "magic", rowId1: [0, "rowId", "rowId1"] }, standalone: false, ngContentSelectors: _c1, decls: 1, vars: 1, consts: [["customContent", ""]], template: function ErrorMagicComponent_Template(rf, ctx) { if (rf & 1) {
5812
5879
  i0.ɵɵprojectionDef();
5813
5880
  i0.ɵɵconditionalCreate(0, ErrorMagicComponent_Conditional_0_Template, 5, 1, "div");
5814
5881
  } if (rf & 2) {
5815
5882
  i0.ɵɵconditional(ctx.HasErrors(ctx.id) ? 0 : -1);
5816
- } }, encapsulation: 2 });
5883
+ } }, encapsulation: 2, changeDetection: 1 });
5817
5884
  }
5818
5885
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(ErrorMagicComponent, [{
5819
5886
  type: Component,
5820
5887
  args: [{
5821
5888
  selector: 'mgError',
5822
- template: `@if (HasErrors(id)) {
5823
- <div>
5824
- <div #customContent>
5825
- <ng-content></ng-content>
5826
- </div>
5827
- @if (defaultDisplay) {
5828
- <span>
5829
- {{mgService.getErrMsg(id, rowId)}}
5830
- </span>
5831
- }
5832
- </div>
5833
- }
5889
+ template: `@if (HasErrors(id)) {
5890
+ <div>
5891
+ <div #customContent>
5892
+ <ng-content></ng-content>
5893
+ </div>
5894
+ @if (defaultDisplay) {
5895
+ <span>
5896
+ {{mgService.getErrMsg(id, rowId)}}
5897
+ </span>
5898
+ }
5899
+ </div>
5900
+ }
5834
5901
  `,
5902
+ changeDetection: ChangeDetectionStrategy.Eager,
5835
5903
  standalone: false
5836
5904
  }]
5837
- }], () => [{ type: TaskMagicService }, { type: AccessorMagicService }, { type: i0.ChangeDetectorRef }], { magic: [{
5905
+ }], () => [], { magic: [{
5838
5906
  type: Input,
5839
5907
  args: ['magic']
5840
5908
  }], rowId1: [{
5841
5909
  type: Input,
5842
5910
  args: ['rowId']
5843
- }], CustomContent: [{
5844
- type: ViewChild,
5845
- args: ['customContent', { static: false }]
5846
- }] }); })();
5847
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(ErrorMagicComponent, { className: "ErrorMagicComponent", filePath: "src/ui/mgerror.magic.component.ts", lineNumber: 28 }); })();
5911
+ }], customContentRef: [{ type: i0.ViewChild, args: ['customContent', { isSignal: true }] }] }); })();
5912
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(ErrorMagicComponent, { className: "ErrorMagicComponent", filePath: "src/ui/mgerror.magic.component.ts", lineNumber: 29 }); })();
5848
5913
 
5849
5914
  /**
5850
5915
  * Directive for checkboxes, to handle the 'change' event
5851
5916
  */
5852
5917
  class CheckboxMagicDirective {
5853
- magicDirective;
5854
- el;
5855
- task;
5856
- threeState = false;
5918
+ threeState = input(false, /* @ts-ignore */
5919
+ ...(ngDevMode ? [{ debugName: "threeState" }] : /* istanbul ignore next */ []));
5857
5920
  subscribeRefreshDom = null;
5858
5921
  isIndeterminate = false;
5859
- /**
5860
- * @ignore
5861
- */
5862
- constructor(magicDirective, el, task) {
5863
- this.magicDirective = magicDirective;
5864
- this.el = el;
5865
- this.task = task;
5922
+ magicDirective = inject(MagicDirective);
5923
+ el = inject(ElementRef);
5924
+ task = inject(TaskMagicService);
5925
+ constructor() {
5866
5926
  }
5867
5927
  /**
5868
5928
  * Handles the Checkbox 'change' event - pass it to the Magic engine
5869
5929
  */
5870
5930
  onChange($event) {
5871
- if (this.threeState) {
5931
+ if (this.threeState()) {
5872
5932
  this.handleThreeState();
5873
5933
  }
5874
5934
  else {
@@ -5876,7 +5936,7 @@ class CheckboxMagicDirective {
5876
5936
  }
5877
5937
  }
5878
5938
  ngOnInit() {
5879
- if (this.threeState) {
5939
+ if (this.threeState()) {
5880
5940
  let guiEvent = getGuiEventObj("setAsThreeState", this.magicDirective.id, +this.magicDirective.rowId);
5881
5941
  this.task.insertEvent(guiEvent);
5882
5942
  this.el.nativeElement.indeterminate = this.isIndeterminate = this.task.getProperty(this.magicDirective.id, HtmlProperties.CheckBoxIndeterminate, this.magicDirective.rowId);
@@ -5931,10 +5991,10 @@ class CheckboxMagicDirective {
5931
5991
  if (this.subscribeRefreshDom !== null)
5932
5992
  this.subscribeRefreshDom.unsubscribe();
5933
5993
  }
5934
- /** @nocollapse */ static ɵfac = function CheckboxMagicDirective_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || CheckboxMagicDirective)(i0.ɵɵdirectiveInject(MagicDirective), i0.ɵɵdirectiveInject(i0.ElementRef), i0.ɵɵdirectiveInject(TaskMagicService)); };
5994
+ /** @nocollapse */ static ɵfac = function CheckboxMagicDirective_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || CheckboxMagicDirective)(); };
5935
5995
  /** @nocollapse */ static ɵdir = /** @pureOrBreakMyCode */ i0.ɵɵdefineDirective({ type: CheckboxMagicDirective, selectors: [["input", "type", "checkbox", "magic", "", 3, "noFormControl", ""]], hostBindings: function CheckboxMagicDirective_HostBindings(rf, ctx) { if (rf & 1) {
5936
5996
  i0.ɵɵlistener("change", function CheckboxMagicDirective_change_HostBindingHandler($event) { return ctx.onChange($event); });
5937
- } }, inputs: { threeState: "threeState" }, standalone: false });
5997
+ } }, inputs: { threeState: [1, "threeState"] }, standalone: false });
5938
5998
  }
5939
5999
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(CheckboxMagicDirective, [{
5940
6000
  type: Directive,
@@ -5944,9 +6004,7 @@ class CheckboxMagicDirective {
5944
6004
  `,
5945
6005
  standalone: false
5946
6006
  }]
5947
- }], () => [{ type: MagicDirective }, { type: i0.ElementRef }, { type: TaskMagicService }], { threeState: [{
5948
- type: Input
5949
- }], onChange: [{
6007
+ }], () => [], { threeState: [{ type: i0.Input, args: [{ isSignal: true, alias: "threeState", required: false }] }], onChange: [{
5950
6008
  type: HostListener,
5951
6009
  args: ['change', ['$event']]
5952
6010
  }] }); })();
@@ -5955,9 +6013,8 @@ class CheckboxMagicDirective {
5955
6013
  * Directive for comboboxes, to handle the 'change' event
5956
6014
  */
5957
6015
  class ComboboxMagicDirective {
5958
- magicDirective;
5959
- constructor(magicDirective) {
5960
- this.magicDirective = magicDirective;
6016
+ magicDirective = inject(MagicDirective);
6017
+ constructor() {
5961
6018
  // subcribe to refreshDom. This is a special case for native select HTML control.
5962
6019
  // to refresh the selected property. Else by default, HTML element doesn't get refreshed as per
5963
6020
  // selected value and 1st element remains selected.
@@ -5979,7 +6036,7 @@ class ComboboxMagicDirective {
5979
6036
  onComboboxItemsListChanged() {
5980
6037
  this.magicDirective.task.refreshView();
5981
6038
  }
5982
- /** @nocollapse */ static ɵfac = function ComboboxMagicDirective_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || ComboboxMagicDirective)(i0.ɵɵdirectiveInject(MagicDirective)); };
6039
+ /** @nocollapse */ static ɵfac = function ComboboxMagicDirective_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || ComboboxMagicDirective)(); };
5983
6040
  /** @nocollapse */ static ɵdir = /** @pureOrBreakMyCode */ i0.ɵɵdefineDirective({ type: ComboboxMagicDirective, selectors: [["select", "magic", "", 3, "multiple", ""]], hostBindings: function ComboboxMagicDirective_HostBindings(rf, ctx) { if (rf & 1) {
5984
6041
  i0.ɵɵlistener("change", function ComboboxMagicDirective_change_HostBindingHandler($event) { return ctx.onChange($event); });
5985
6042
  } }, standalone: false });
@@ -5990,7 +6047,7 @@ class ComboboxMagicDirective {
5990
6047
  selector: `select[magic]:not([multiple])`,
5991
6048
  standalone: false
5992
6049
  }]
5993
- }], () => [{ type: MagicDirective }], { onChange: [{
6050
+ }], () => [], { onChange: [{
5994
6051
  type: HostListener,
5995
6052
  args: ['change', ['$event']]
5996
6053
  }] }); })();
@@ -6027,7 +6084,7 @@ function MagicShellComponent_Conditional_5_Template(rf, ctx) { if (rf & 1) {
6027
6084
  const ctx_r0 = i0.ɵɵnextContext();
6028
6085
  const defaultSpinner_r2 = i0.ɵɵreference(7);
6029
6086
  i0.ɵɵadvance();
6030
- i0.ɵɵproperty("ngTemplateOutlet", ctx_r0.SpinnerTemplate ? ctx_r0.SpinnerTemplate : defaultSpinner_r2);
6087
+ i0.ɵɵproperty("ngTemplateOutlet", ctx_r0.SpinnerTemplate() ? ctx_r0.SpinnerTemplate() : defaultSpinner_r2);
6031
6088
  } }
6032
6089
  function MagicShellComponent_ng_template_6_Template(rf, ctx) { if (rf & 1) {
6033
6090
  i0.ɵɵelement(0, "div", 7);
@@ -6036,16 +6093,6 @@ function MagicShellComponent_ng_template_6_Template(rf, ctx) { if (rf & 1) {
6036
6093
  * Root Magic component
6037
6094
  */
6038
6095
  class MagicShellComponent {
6039
- engineMagicService;
6040
- componentList;
6041
- changeDetectorRef;
6042
- titleService;
6043
- overlayWindowService;
6044
- httpClient;
6045
- pendingCommandsCollector;
6046
- route;
6047
- router;
6048
- exitMagicService;
6049
6096
  /**
6050
6097
  * Root component to be displayed in the window
6051
6098
  */
@@ -6055,10 +6102,22 @@ class MagicShellComponent {
6055
6102
  */
6056
6103
  RootComponentParameters;
6057
6104
  overlayWindowsContainerViewRef;
6058
- rootMagicElementRef;
6059
- SpinnerTemplate;
6105
+ rootMagicElementRef = viewChild.required('magicRoot', /* @ts-ignore */
6106
+ ...(ngDevMode ? [{ debugName: "rootMagicElementRef" }] : /* istanbul ignore next */ []));
6107
+ SpinnerTemplate = input(/* @ts-ignore */
6108
+ ...(ngDevMode ? [undefined, { debugName: "SpinnerTemplate" }] : /* istanbul ignore next */ []));
6060
6109
  showSpinner;
6061
6110
  magicEngineTerminated = false;
6111
+ engineMagicService = inject(EngineMagicService);
6112
+ componentList = inject(ComponentListMagicService);
6113
+ changeDetectorRef = inject(ChangeDetectorRef);
6114
+ titleService = inject(Title);
6115
+ overlayWindowService = inject(OverlayWindowService);
6116
+ httpClient = inject(HttpClient);
6117
+ pendingCommandsCollector = inject(CommandsCollectorMagicService);
6118
+ route = inject(ActivatedRoute);
6119
+ router = inject(Router);
6120
+ exitMagicService = inject(ExitMagicService, { optional: true });
6062
6121
  /**
6063
6122
  *
6064
6123
  * @param magic Magic's service
@@ -6068,17 +6127,7 @@ class MagicShellComponent {
6068
6127
  * @param httpClient The native httpClient instance
6069
6128
  * @param exitMagicService Magic exit service
6070
6129
  */
6071
- constructor(engineMagicService, componentList, changeDetectorRef, titleService, overlayWindowService, httpClient, pendingCommandsCollector, route, router, exitMagicService) {
6072
- this.engineMagicService = engineMagicService;
6073
- this.componentList = componentList;
6074
- this.changeDetectorRef = changeDetectorRef;
6075
- this.titleService = titleService;
6076
- this.overlayWindowService = overlayWindowService;
6077
- this.httpClient = httpClient;
6078
- this.pendingCommandsCollector = pendingCommandsCollector;
6079
- this.route = route;
6080
- this.router = router;
6081
- this.exitMagicService = exitMagicService;
6130
+ constructor() {
6082
6131
  this.initialize();
6083
6132
  this.setTitle();
6084
6133
  }
@@ -6098,13 +6147,20 @@ class MagicShellComponent {
6098
6147
  this.magicEngineTerminated = true;
6099
6148
  }
6100
6149
  }
6101
- onUnload(event) {
6150
+ /**
6151
+ * Page-hide event listener, used in place of 'unload'.
6152
+ * Chrome blocks 'unload' by permissions policy ("unload is not allowed in this document"),
6153
+ * so an unload handler is never even registered. 'pagehide' is fired at an earlier step of
6154
+ * the same unloading sequence, so it covers every case 'unload' did.
6155
+ */
6156
+ onPageHide() {
6102
6157
  // Chrome provides an opportunity to terminate the context after user approves the browser unload alert
6103
- if (!this.magicEngineTerminated)
6158
+ if (!this.magicEngineTerminated) {
6104
6159
  this.engineMagicService.TerminateContextUsingFetchAPI();
6160
+ }
6105
6161
  }
6106
6162
  ngAfterViewInit() {
6107
- this.overlayWindowService.init(this.overlayWindowsContainerViewRef, this.rootMagicElementRef.nativeElement, this.changeDetectorRef);
6163
+ this.overlayWindowService.init(this.overlayWindowsContainerViewRef, this.rootMagicElementRef().nativeElement, this.changeDetectorRef);
6108
6164
  // Helper function to start the engine
6109
6165
  const startEngine = () => {
6110
6166
  const queryParams = this.route.snapshot.queryParams;
@@ -6218,15 +6274,14 @@ class MagicShellComponent {
6218
6274
  break;
6219
6275
  }
6220
6276
  }
6221
- /** @nocollapse */ static ɵfac = function MagicShellComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || MagicShellComponent)(i0.ɵɵdirectiveInject(EngineMagicService), i0.ɵɵdirectiveInject(ComponentListMagicService), i0.ɵɵdirectiveInject(i0.ChangeDetectorRef), i0.ɵɵdirectiveInject(i1$1.Title), i0.ɵɵdirectiveInject(OverlayWindowService), i0.ɵɵdirectiveInject(i1$2.HttpClient), i0.ɵɵdirectiveInject(CommandsCollectorMagicService), i0.ɵɵdirectiveInject(i2.ActivatedRoute), i0.ɵɵdirectiveInject(i2.Router), i0.ɵɵdirectiveInject(ExitMagicService, 8)); };
6277
+ /** @nocollapse */ static ɵfac = function MagicShellComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || MagicShellComponent)(); };
6222
6278
  /** @nocollapse */ static ɵcmp = /** @pureOrBreakMyCode */ i0.ɵɵdefineComponent({ type: MagicShellComponent, selectors: [["magic-root"]], viewQuery: function MagicShellComponent_Query(rf, ctx) { if (rf & 1) {
6223
- i0.ɵɵviewQuery(_c0, 7);
6279
+ i0.ɵɵviewQuerySignal(ctx.rootMagicElementRef, _c0, 5);
6224
6280
  } if (rf & 2) {
6225
- let _t;
6226
- i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.rootMagicElementRef = _t.first);
6281
+ i0.ɵɵqueryAdvance();
6227
6282
  } }, hostBindings: function MagicShellComponent_HostBindings(rf, ctx) { if (rf & 1) {
6228
- i0.ɵɵlistener("beforeunload", function MagicShellComponent_beforeunload_HostBindingHandler($event) { return ctx.onBeforeUnload($event); }, i0.ɵɵresolveWindow)("unload", function MagicShellComponent_unload_HostBindingHandler($event) { return ctx.onUnload($event); }, i0.ɵɵresolveWindow);
6229
- } }, inputs: { SpinnerTemplate: "SpinnerTemplate" }, standalone: false, features: [i0.ɵɵProvidersFeature([
6283
+ i0.ɵɵlistener("beforeunload", function MagicShellComponent_beforeunload_HostBindingHandler($event) { return ctx.onBeforeUnload($event); }, i0.ɵɵresolveWindow)("pagehide", function MagicShellComponent_pagehide_HostBindingHandler() { return ctx.onPageHide(); }, i0.ɵɵresolveWindow);
6284
+ } }, inputs: { SpinnerTemplate: [1, "SpinnerTemplate"] }, standalone: false, features: [i0.ɵɵProvidersFeature([
6230
6285
  // ExitMagicService
6231
6286
  ])], decls: 8, vars: 2, consts: [["magicRoot", ""], ["overlayWindowsContainer", ""], ["defaultSpinner", ""], [3, "ndcDynamicComponent", "ndcDynamicInputs"], ["magicViewContainerRef", ""], [1, "spinner-background"], [3, "ngTemplateOutlet"], [1, "mgSpinnerClass"]], template: function MagicShellComponent_Template(rf, ctx) { if (rf & 1) {
6232
6287
  i0.ɵɵelementStart(0, "div", null, 0);
@@ -6240,50 +6295,43 @@ class MagicShellComponent {
6240
6295
  i0.ɵɵconditional(ctx.RootComponent !== null ? 2 : -1);
6241
6296
  i0.ɵɵadvance(3);
6242
6297
  i0.ɵɵconditional(ctx.showSpinner ? 5 : -1);
6243
- } }, dependencies: [i1.NgTemplateOutlet, i2$3.DynamicIoDirective, i2$3.DynamicComponent, MagicViewContainerRef], styles: [".mgSpinnerClass[_ngcontent-%COMP%]{border:10px solid #cccccc;border-top:10px solid black;border-radius:50%;position:fixed;margin:auto;inset:0;width:100px;height:100px;animation:_ngcontent-%COMP%_spin 2s linear infinite}.spinner-background[_ngcontent-%COMP%]{position:fixed;z-index:1000;inset:0;opacity:.5}@keyframes _ngcontent-%COMP%_spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}"] });
6298
+ } }, dependencies: [i1.NgTemplateOutlet, i1$1.DynamicIoDirective, i1$1.DynamicComponent, MagicViewContainerRef], styles: [".mgSpinnerClass[_ngcontent-%COMP%]{border:10px solid #cccccc;border-top:10px solid black;border-radius:50%;position:fixed;margin:auto;inset:0;width:100px;height:100px;animation:_ngcontent-%COMP%_spin 2s linear infinite}.spinner-background[_ngcontent-%COMP%]{position:fixed;z-index:1000;inset:0;opacity:.5}@keyframes _ngcontent-%COMP%_spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}"], changeDetection: 1 });
6244
6299
  }
6245
6300
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(MagicShellComponent, [{
6246
6301
  type: Component,
6247
6302
  args: [{ selector: 'magic-root', providers: [
6248
6303
  // ExitMagicService
6249
- ], template: `
6250
- <div #magicRoot>
6251
- @if (RootComponent !== null) {
6252
- <ndc-dynamic
6253
- [ndcDynamicComponent]="RootComponent"
6254
- [ndcDynamicInputs] ="RootComponentParameters">
6255
- </ndc-dynamic>
6256
- }
6257
-
6258
- <div #overlayWindowsContainer magicViewContainerRef>
6259
- </div>
6260
- </div>
6261
-
6262
- @if (showSpinner) {
6263
- <div class="spinner-background">
6264
- <ng-container [ngTemplateOutlet]="SpinnerTemplate ? SpinnerTemplate:defaultSpinner"></ng-container>
6265
- </div>
6266
- }
6267
-
6268
- <ng-template #defaultSpinner>
6269
- <div class="mgSpinnerClass"></div>
6270
- </ng-template>
6271
- `, standalone: false, styles: [".mgSpinnerClass{border:10px solid #cccccc;border-top:10px solid black;border-radius:50%;position:fixed;margin:auto;inset:0;width:100px;height:100px;animation:spin 2s linear infinite}.spinner-background{position:fixed;z-index:1000;inset:0;opacity:.5}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}\n"] }]
6272
- }], () => [{ type: EngineMagicService }, { type: ComponentListMagicService }, { type: i0.ChangeDetectorRef }, { type: i1$1.Title }, { type: OverlayWindowService }, { type: i1$2.HttpClient }, { type: CommandsCollectorMagicService }, { type: i2.ActivatedRoute }, { type: i2.Router }, { type: ExitMagicService, decorators: [{
6273
- type: Optional
6274
- }] }], { rootMagicElementRef: [{
6275
- type: ViewChild,
6276
- args: ['magicRoot', { static: true }]
6277
- }], SpinnerTemplate: [{
6278
- type: Input
6279
- }], onBeforeUnload: [{
6304
+ ], template: `
6305
+ <div #magicRoot>
6306
+ @if (RootComponent !== null) {
6307
+ <ndc-dynamic
6308
+ [ndcDynamicComponent]="RootComponent"
6309
+ [ndcDynamicInputs] ="RootComponentParameters">
6310
+ </ndc-dynamic>
6311
+ }
6312
+
6313
+ <div #overlayWindowsContainer magicViewContainerRef>
6314
+ </div>
6315
+ </div>
6316
+
6317
+ @if (showSpinner) {
6318
+ <div class="spinner-background">
6319
+ <ng-container [ngTemplateOutlet]="SpinnerTemplate() ? SpinnerTemplate():defaultSpinner"></ng-container>
6320
+ </div>
6321
+ }
6322
+
6323
+ <ng-template #defaultSpinner>
6324
+ <div class="mgSpinnerClass"></div>
6325
+ </ng-template>
6326
+ `, changeDetection: ChangeDetectionStrategy.Eager, standalone: false, styles: [".mgSpinnerClass{border:10px solid #cccccc;border-top:10px solid black;border-radius:50%;position:fixed;margin:auto;inset:0;width:100px;height:100px;animation:spin 2s linear infinite}.spinner-background{position:fixed;z-index:1000;inset:0;opacity:.5}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}\n"] }]
6327
+ }], () => [], { rootMagicElementRef: [{ type: i0.ViewChild, args: ['magicRoot', { isSignal: true }] }], SpinnerTemplate: [{ type: i0.Input, args: [{ isSignal: true, alias: "SpinnerTemplate", required: false }] }], onBeforeUnload: [{
6280
6328
  type: HostListener,
6281
6329
  args: ['window:beforeunload', ['$event']]
6282
- }], onUnload: [{
6330
+ }], onPageHide: [{
6283
6331
  type: HostListener,
6284
- args: ['window:unload', ['$event']]
6332
+ args: ['window:pagehide']
6285
6333
  }] }); })();
6286
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(MagicShellComponent, { className: "MagicShellComponent", filePath: "src/ui/magic-root.component.ts", lineNumber: 89 }); })();
6334
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(MagicShellComponent, { className: "MagicShellComponent", filePath: "src/ui/magic-root.component.ts", lineNumber: 90 }); })();
6287
6335
 
6288
6336
  /**
6289
6337
  * @ignore
@@ -6310,7 +6358,7 @@ class MagicCheckboxControlValueAccessor extends CheckboxControlValueAccessor {
6310
6358
  input[type=checkbox][magic]:not([formControl]),
6311
6359
  input[type=checkbox][magic]:not([ngModel])
6312
6360
  `,
6313
- host: { '(change)': 'onChange($event.target.checked)', '(blur)': 'onTouched()' },
6361
+ host: { '(change)': 'onChange($any($event.target).checked)', '(blur)': 'onTouched()' },
6314
6362
  providers: [CHECKBOX_VALUE_ACCESSOR],
6315
6363
  standalone: false
6316
6364
  }]
@@ -6341,10 +6389,10 @@ class MagicDefaultValueAccessor extends DefaultValueAccessor {
6341
6389
  textarea[magic]:not([formControlName]):not([noFormControl]):not([no-form-control])
6342
6390
  `,
6343
6391
  host: {
6344
- '(input)': '$any(this)._handleInput($event.target.value)',
6392
+ '(input)': '$any(this)._handleInput($any($event.target).value)',
6345
6393
  '(blur)': 'onTouched()',
6346
6394
  '(compositionstart)': '$any(this)._compositionStart()',
6347
- '(compositionend)': '$any(this)._compositionEnd($event.target.value)'
6395
+ '(compositionend)': '$any(this)._compositionEnd($any($event.target).value)'
6348
6396
  },
6349
6397
  providers: [MAGIC_DEFAULT_VALUE_ACCESSOR],
6350
6398
  exportAs: 'magic',
@@ -6356,9 +6404,8 @@ class MagicDefaultValueAccessor extends DefaultValueAccessor {
6356
6404
  * Directive for checkboxes which should not have a form control
6357
6405
  */
6358
6406
  class CheckboxNoFormControlMagicDirective {
6359
- magicDirective;
6360
- constructor(magicDirective) {
6361
- this.magicDirective = magicDirective;
6407
+ magicDirective = inject(MagicDirective);
6408
+ constructor() {
6362
6409
  }
6363
6410
  /**
6364
6411
  * Handle the 'Checkbox' change event - pass it to the Magic engine
@@ -6366,7 +6413,7 @@ class CheckboxNoFormControlMagicDirective {
6366
6413
  onChange($event) {
6367
6414
  this.magicDirective.task.onCheckChanged($event, this.magicDirective.id, +this.magicDirective.rowId);
6368
6415
  }
6369
- /** @nocollapse */ static ɵfac = function CheckboxNoFormControlMagicDirective_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || CheckboxNoFormControlMagicDirective)(i0.ɵɵdirectiveInject(MagicDirective)); };
6416
+ /** @nocollapse */ static ɵfac = function CheckboxNoFormControlMagicDirective_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || CheckboxNoFormControlMagicDirective)(); };
6370
6417
  /** @nocollapse */ static ɵdir = /** @pureOrBreakMyCode */ i0.ɵɵdefineDirective({ type: CheckboxNoFormControlMagicDirective, selectors: [["input", "type", "checkbox", "magic", "", "noFormControl", ""]], hostBindings: function CheckboxNoFormControlMagicDirective_HostBindings(rf, ctx) { if (rf & 1) {
6371
6418
  i0.ɵɵlistener("change", function CheckboxNoFormControlMagicDirective_change_HostBindingHandler($event) { return ctx.onChange($event); });
6372
6419
  } }, standalone: false });
@@ -6379,7 +6426,7 @@ class CheckboxNoFormControlMagicDirective {
6379
6426
  `,
6380
6427
  standalone: false
6381
6428
  }]
6382
- }], () => [{ type: MagicDirective }], { onChange: [{
6429
+ }], () => [], { onChange: [{
6383
6430
  type: HostListener,
6384
6431
  args: ['change', ['$event']]
6385
6432
  }] }); })();
@@ -6388,9 +6435,8 @@ class CheckboxNoFormControlMagicDirective {
6388
6435
  * Directive for non-checkbox input controls which do not have a form control
6389
6436
  */
6390
6437
  class InputNoFormControlMagicDirective {
6391
- magicDirective;
6392
- constructor(magicDirective) {
6393
- this.magicDirective = magicDirective;
6438
+ magicDirective = inject(MagicDirective);
6439
+ constructor() {
6394
6440
  }
6395
6441
  /**
6396
6442
  * Handles the 'change' event - pass it to the Magic engine
@@ -6398,7 +6444,7 @@ class InputNoFormControlMagicDirective {
6398
6444
  onChange($event) {
6399
6445
  this.magicDirective.task.setInputTextValue(this.magicDirective.id, this.magicDirective.rowId, event.srcElement.value);
6400
6446
  }
6401
- /** @nocollapse */ static ɵfac = function InputNoFormControlMagicDirective_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || InputNoFormControlMagicDirective)(i0.ɵɵdirectiveInject(MagicDirective)); };
6447
+ /** @nocollapse */ static ɵfac = function InputNoFormControlMagicDirective_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || InputNoFormControlMagicDirective)(); };
6402
6448
  /** @nocollapse */ static ɵdir = /** @pureOrBreakMyCode */ i0.ɵɵdefineDirective({ type: InputNoFormControlMagicDirective, selectors: [["input", "magic", "", "noFormControl", "", 3, "type", "checkbox"], ["textarea", "magic", "", "noFormControl", "", 3, "type", "checkbox"]], hostBindings: function InputNoFormControlMagicDirective_HostBindings(rf, ctx) { if (rf & 1) {
6403
6449
  i0.ɵɵlistener("change", function InputNoFormControlMagicDirective_change_HostBindingHandler($event) { return ctx.onChange($event); });
6404
6450
  } }, standalone: false });
@@ -6410,7 +6456,7 @@ class InputNoFormControlMagicDirective {
6410
6456
  textarea[magic]:([noFormControl]):not([type=checkbox])`,
6411
6457
  standalone: false
6412
6458
  }]
6413
- }], () => [{ type: MagicDirective }], { onChange: [{
6459
+ }], () => [], { onChange: [{
6414
6460
  type: HostListener,
6415
6461
  args: ['change', ['$event']]
6416
6462
  }] }); })();
@@ -6429,10 +6475,6 @@ const DATE_VALUE_ACCESSOR = {
6429
6475
  * `<input type="date" formControlName="birthday" dateInput>`
6430
6476
  */
6431
6477
  class DateValueAccessor {
6432
- renderer;
6433
- elementRef;
6434
- magicDir;
6435
- _task;
6436
6478
  onChange = (_) => { };
6437
6479
  onTouched = () => { };
6438
6480
  onBlurEvent(event) {
@@ -6440,12 +6482,11 @@ class DateValueAccessor {
6440
6482
  let control = this._task.getFormControl(this.magicDir.rowId, this.magicDir.id);
6441
6483
  this.formatDateWithCentury(event.target.value, century, control);
6442
6484
  }
6443
- constructor(renderer, elementRef, magicDir, _task) {
6444
- this.renderer = renderer;
6445
- this.elementRef = elementRef;
6446
- this.magicDir = magicDir;
6447
- this._task = _task;
6448
- }
6485
+ renderer = inject(Renderer2);
6486
+ elementRef = inject(ElementRef);
6487
+ magicDir = inject(MagicDirective);
6488
+ _task = inject(TaskMagicService);
6489
+ constructor() { }
6449
6490
  /** Format year, if user enters 2 digits instead of 4 digits as per the century given in Magic.ini file */
6450
6491
  formatDateWithCentury(userInput, century, control) {
6451
6492
  const separator = userInput.includes('/') ? '/' : "-";
@@ -6483,7 +6524,7 @@ class DateValueAccessor {
6483
6524
  setDisabledState(isDisabled) {
6484
6525
  this.renderer.setProperty(this.elementRef.nativeElement, "disabled", isDisabled);
6485
6526
  }
6486
- /** @nocollapse */ static ɵfac = function DateValueAccessor_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || DateValueAccessor)(i0.ɵɵdirectiveInject(i0.Renderer2), i0.ɵɵdirectiveInject(i0.ElementRef), i0.ɵɵdirectiveInject(MagicDirective), i0.ɵɵdirectiveInject(TaskMagicService)); };
6527
+ /** @nocollapse */ static ɵfac = function DateValueAccessor_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || DateValueAccessor)(); };
6487
6528
  /** @nocollapse */ static ɵdir = /** @pureOrBreakMyCode */ i0.ɵɵdefineDirective({ type: DateValueAccessor, selectors: [["", "dateInput", ""]], hostBindings: function DateValueAccessor_HostBindings(rf, ctx) { if (rf & 1) {
6488
6529
  i0.ɵɵlistener("input", function DateValueAccessor_input_HostBindingHandler($event) { return ctx.onChange($event.target.valueAsDate); })("blur", function DateValueAccessor_blur_HostBindingHandler($event) { return ctx.onBlurEvent($event); });
6489
6530
  } }, standalone: false, features: [i0.ɵɵProvidersFeature([DATE_VALUE_ACCESSOR])] });
@@ -6495,7 +6536,7 @@ class DateValueAccessor {
6495
6536
  providers: [DATE_VALUE_ACCESSOR],
6496
6537
  standalone: false
6497
6538
  }]
6498
- }], () => [{ type: i0.Renderer2 }, { type: i0.ElementRef }, { type: MagicDirective }, { type: TaskMagicService }], { onChange: [{
6539
+ }], () => [], { onChange: [{
6499
6540
  type: HostListener,
6500
6541
  args: ["input", ["$event.target.valueAsDate"]]
6501
6542
  }], onTouched: [{
@@ -6510,10 +6551,6 @@ class DateValueAccessor {
6510
6551
  * Responsible for connecting HTML elements to the Magic WebClient engine showing it is not Magic Control but a Dummy control which is used to notify only receeive focus event for now
6511
6552
  */
6512
6553
  class NonMagicControlDirective {
6513
- _task;
6514
- element;
6515
- renderer;
6516
- vcRef;
6517
6554
  set magic(val) {
6518
6555
  this.id = val;
6519
6556
  this.selector = 'NonMagicControl';
@@ -6551,13 +6588,13 @@ class NonMagicControlDirective {
6551
6588
  * @param renderer Renderer for the element
6552
6589
  * @param vcRef
6553
6590
  */
6554
- constructor(_task, element, renderer, vcRef) {
6555
- this._task = _task;
6556
- this.element = element;
6557
- this.renderer = renderer;
6558
- this.vcRef = vcRef;
6591
+ constructor() {
6559
6592
  this.htmlElement = this.element.nativeElement;
6560
6593
  }
6594
+ _task = inject(TaskMagicService);
6595
+ element = inject(ElementRef);
6596
+ renderer = inject(Renderer2);
6597
+ vcRef = inject(ViewContainerRef);
6561
6598
  /**
6562
6599
  * Get the task service
6563
6600
  * @returns
@@ -6588,7 +6625,7 @@ class NonMagicControlDirective {
6588
6625
  ngOnInit() {
6589
6626
  this.regEvents();
6590
6627
  }
6591
- /** @nocollapse */ static ɵfac = function NonMagicControlDirective_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || NonMagicControlDirective)(i0.ɵɵdirectiveInject(TaskMagicService), i0.ɵɵdirectiveInject(i0.ElementRef), i0.ɵɵdirectiveInject(i0.Renderer2), i0.ɵɵdirectiveInject(i0.ViewContainerRef)); };
6628
+ /** @nocollapse */ static ɵfac = function NonMagicControlDirective_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || NonMagicControlDirective)(); };
6592
6629
  /** @nocollapse */ static ɵdir = /** @pureOrBreakMyCode */ i0.ɵɵdefineDirective({ type: NonMagicControlDirective, selectors: [["", "NonMagicControl", ""]], inputs: { magic: [0, "NonMagicControl", "magic"] }, standalone: false });
6593
6630
  }
6594
6631
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(NonMagicControlDirective, [{
@@ -6597,15 +6634,14 @@ class NonMagicControlDirective {
6597
6634
  selector: '[NonMagicControl]',
6598
6635
  standalone: false
6599
6636
  }]
6600
- }], () => [{ type: TaskMagicService }, { type: i0.ElementRef }, { type: i0.Renderer2 }, { type: i0.ViewContainerRef }], { magic: [{
6637
+ }], () => [], { magic: [{
6601
6638
  type: Input,
6602
6639
  args: ['NonMagicControl']
6603
6640
  }] }); })();
6604
6641
 
6605
6642
  class Time24MagicPipe {
6606
- _task;
6607
- constructor(_task) {
6608
- this._task = _task;
6643
+ _task = inject(TaskMagicService);
6644
+ constructor() {
6609
6645
  }
6610
6646
  transform(value, controlId) {
6611
6647
  let mask = this._task.GetControlPictureMask(controlId).getMask();
@@ -6623,7 +6659,7 @@ class Time24MagicPipe {
6623
6659
  }
6624
6660
  return value;
6625
6661
  }
6626
- /** @nocollapse */ static ɵfac = function Time24MagicPipe_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || Time24MagicPipe)(i0.ɵɵdirectiveInject(TaskMagicService, 16)); };
6662
+ /** @nocollapse */ static ɵfac = function Time24MagicPipe_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || Time24MagicPipe)(); };
6627
6663
  /** @nocollapse */ static ɵpipe = /** @pureOrBreakMyCode */ i0.ɵɵdefinePipe({ name: "magicTime24", type: Time24MagicPipe, pure: true, standalone: false });
6628
6664
  }
6629
6665
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(Time24MagicPipe, [{
@@ -6632,7 +6668,7 @@ class Time24MagicPipe {
6632
6668
  name: 'magicTime24',
6633
6669
  standalone: false
6634
6670
  }]
6635
- }], () => [{ type: TaskMagicService }], null); })();
6671
+ }], () => [], null); })();
6636
6672
 
6637
6673
  /**
6638
6674
  * @ignore
@@ -6674,27 +6710,28 @@ const decs = [
6674
6710
  class MagicModule {
6675
6711
  /** @nocollapse */ static ɵfac = function MagicModule_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || MagicModule)(); };
6676
6712
  /** @nocollapse */ static ɵmod = /** @pureOrBreakMyCode */ i0.ɵɵdefineNgModule({ type: MagicModule });
6677
- /** @nocollapse */ static ɵinj = /** @pureOrBreakMyCode */ i0.ɵɵdefineInjector({ providers: [ConfirmationComponentsMagicProvider, OverlayContainerMagicProvider, provideHttpClient(withInterceptorsFromDi())], imports: [CommonModule,
6713
+ /** @nocollapse */ static ɵinj = /** @pureOrBreakMyCode */ i0.ɵɵdefineInjector({ providers: [ConfirmationComponentsMagicProvider, OverlayContainerMagicProvider, provideHttpClient(withXhr(), withInterceptorsFromDi())], imports: [CommonModule,
6678
6714
  FormsModule,
6679
6715
  ReactiveFormsModule,
6680
6716
  RouterModule,
6681
6717
  DynamicModule,
6682
- DragDropModule, MaskitoModule] });
6718
+ DragDropModule] });
6683
6719
  }
6684
6720
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(MagicModule, [{
6685
6721
  type: NgModule,
6686
6722
  args: [{
6687
6723
  declarations: [...decs],
6688
- exports: [...decs, MaskitoModule],
6724
+ exports: [...decs, MaskitoDirective],
6689
6725
  imports: [CommonModule,
6690
6726
  FormsModule,
6691
6727
  ReactiveFormsModule,
6692
6728
  RouterModule,
6693
6729
  DynamicModule,
6730
+ MaskitoDirective,
6694
6731
  CdkDragHandle,
6695
6732
  CdkDrag,
6696
6733
  DragDropModule],
6697
- providers: [ConfirmationComponentsMagicProvider, OverlayContainerMagicProvider, provideHttpClient(withInterceptorsFromDi())]
6734
+ providers: [ConfirmationComponentsMagicProvider, OverlayContainerMagicProvider, provideHttpClient(withXhr(), withInterceptorsFromDi())]
6698
6735
  }]
6699
6736
  }], null, null); })();
6700
6737
  (function () { (typeof ngJitMode === "undefined" || ngJitMode) && i0.ɵɵsetNgModuleScope(MagicModule, { declarations: [MagicDirective,
@@ -6730,6 +6767,7 @@ class MagicModule {
6730
6767
  ReactiveFormsModule,
6731
6768
  RouterModule,
6732
6769
  DynamicModule,
6770
+ MaskitoDirective,
6733
6771
  CdkDragHandle,
6734
6772
  CdkDrag,
6735
6773
  DragDropModule], exports: [MagicDirective,
@@ -6760,7 +6798,7 @@ class MagicModule {
6760
6798
  NonMagicControlDirective,
6761
6799
  MagicFocusDirective,
6762
6800
  MagicViewContainerRef,
6763
- Time24MagicPipe, MaskitoModule] }); })();
6801
+ Time24MagicPipe, MaskitoDirective] }); })();
6764
6802
 
6765
6803
  const MG_FORMATS = {
6766
6804
  parse: { dateInput: { month: 'short', year: 'numeric', day: 'numeric' } },
@@ -6772,14 +6810,12 @@ const MG_FORMATS = {
6772
6810
  }
6773
6811
  };
6774
6812
  class MgDateAdapter extends NativeDateAdapter {
6775
- task;
6776
- localeId;
6777
6813
  mgdtfmt = null;
6778
- constructor(task, localeId) {
6779
- super(localeId);
6780
- this.task = task;
6781
- this.localeId = localeId;
6782
- this.setLocale(localeId);
6814
+ task = inject(TaskMagicService);
6815
+ localeId = inject(MAT_DATE_LOCALE);
6816
+ constructor() {
6817
+ super();
6818
+ this.setLocale(this.localeId);
6783
6819
  }
6784
6820
  parse(value) {
6785
6821
  let valueStr = value;
@@ -6854,15 +6890,12 @@ class MgDateAdapter extends NativeDateAdapter {
6854
6890
  return date.toDateString();
6855
6891
  }
6856
6892
  }
6857
- /** @nocollapse */ static ɵfac = function MgDateAdapter_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || MgDateAdapter)(i0.ɵɵinject(TaskMagicService), i0.ɵɵinject(MAT_DATE_LOCALE)); };
6893
+ /** @nocollapse */ static ɵfac = function MgDateAdapter_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || MgDateAdapter)(); };
6858
6894
  /** @nocollapse */ static ɵprov = /** @pureOrBreakMyCode */ i0.ɵɵdefineInjectable({ token: MgDateAdapter, factory: MgDateAdapter.ɵfac });
6859
6895
  }
6860
6896
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(MgDateAdapter, [{
6861
6897
  type: Injectable
6862
- }], () => [{ type: TaskMagicService }, { type: undefined, decorators: [{
6863
- type: Inject,
6864
- args: [MAT_DATE_LOCALE]
6865
- }] }], null); })();
6898
+ }], () => [], null); })();
6866
6899
 
6867
6900
  const matDateProviders = [
6868
6901
  { provide: DateAdapter, useClass: MgDateAdapter },
@@ -6884,6 +6917,109 @@ const magicProviders = [
6884
6917
  TableMagicService
6885
6918
  ];
6886
6919
 
6920
+ class SubscriberService {
6921
+ static instance;
6922
+ socket;
6923
+ constructor() {
6924
+ // Connect to the Socket.IO server with subscriber role
6925
+ this.socket = io('http://localhost:3000', {
6926
+ query: {
6927
+ role: 'subscriber',
6928
+ token: 'abc123' // Default token for testing; replace with actual authentication
6929
+ }
6930
+ });
6931
+ // Handle connection
6932
+ this.socket.on('connect', () => {
6933
+ console.log('Connected to server as subscriber:', this.socket.id);
6934
+ });
6935
+ // Handle disconnection
6936
+ this.socket.on('disconnect', () => {
6937
+ console.log('Disconnected from server');
6938
+ });
6939
+ // Handle subscription confirmation
6940
+ this.socket.on('subscribed', (data) => {
6941
+ console.log('Subscribed to topic:', data.topic, data.message);
6942
+ });
6943
+ // Handle unsubscription confirmation
6944
+ this.socket.on('unsubscribed', (data) => {
6945
+ console.log('Unsubscribed from topic:', data.topic, data.message);
6946
+ });
6947
+ // Handle errors
6948
+ this.socket.on('error', (error) => {
6949
+ console.error('Socket error:', error.message);
6950
+ });
6951
+ this.socket.on('message', (error) => {
6952
+ console.error('Message from xpa:', error.message);
6953
+ });
6954
+ }
6955
+ /**
6956
+ * Subscribe to a specific topic
6957
+ * @param topic The topic to subscribe to
6958
+ */
6959
+ subscribe(topic) {
6960
+ this.socket.emit('subscribe', topic);
6961
+ }
6962
+ /**
6963
+ * Unsubscribe from a specific topic
6964
+ * @param topic The topic to unsubscribe from
6965
+ */
6966
+ unsubscribe(topic) {
6967
+ this.socket.emit('unsubscribe', topic);
6968
+ }
6969
+ /**
6970
+ * Get an Observable for incoming messages
6971
+ * @returns Observable that emits message data
6972
+ */
6973
+ onMessage() {
6974
+ return new Observable(observer => {
6975
+ this.socket.on('message', (data) => {
6976
+ observer.next(data);
6977
+ });
6978
+ });
6979
+ }
6980
+ /**
6981
+ * Get current subscriptions (for debugging)
6982
+ */
6983
+ getSubscriptions() {
6984
+ this.socket.emit('getSubscriptions');
6985
+ }
6986
+ /**
6987
+ * Listen for subscriptions data
6988
+ * @returns Observable that emits subscriptions list
6989
+ */
6990
+ onSubscriptionsData() {
6991
+ return new Observable(observer => {
6992
+ this.socket.on('subscriptionsData', (data) => {
6993
+ observer.next(data);
6994
+ });
6995
+ });
6996
+ }
6997
+ /**
6998
+ * Get the singleton instance of SubscriberService
6999
+ * @returns {SubscriberService} The singleton instance
7000
+ */
7001
+ static getInstance() {
7002
+ if (!SubscriberService.instance) {
7003
+ SubscriberService.instance = new SubscriberService();
7004
+ }
7005
+ return SubscriberService.instance;
7006
+ }
7007
+ /**
7008
+ * Disconnect from the server
7009
+ */
7010
+ disconnect() {
7011
+ this.socket.disconnect();
7012
+ }
7013
+ /** @nocollapse */ static ɵfac = function SubscriberService_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || SubscriberService)(); };
7014
+ /** @nocollapse */ static ɵprov = /** @pureOrBreakMyCode */ i0.ɵɵdefineInjectable({ token: SubscriberService, factory: SubscriberService.ɵfac, providedIn: 'root' });
7015
+ }
7016
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(SubscriberService, [{
7017
+ type: Injectable,
7018
+ args: [{
7019
+ providedIn: 'root'
7020
+ }]
7021
+ }], () => [], null); })();
7022
+
6887
7023
  /**
6888
7024
  * @ignore
6889
7025
  */
@@ -6969,5 +7105,5 @@ class ModalFormDefinition {
6969
7105
  * Generated bundle index. Do not edit.
6970
7106
  */
6971
7107
 
6972
- 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, TableMagicService, TaskBaseMagicComponent, TaskMagicService, Time24MagicPipe, TimeMagicPipe, TitleMagicService, basicMagicProviders, confirmationBox, magicProviders, matDateProviders, utils };
7108
+ 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, MagicChangeDetectionService, 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 };
6973
7109
  //# sourceMappingURL=magic-xpa-angular.mjs.map