@magic-xpa/angular 4.1300.0-dev4130.3 → 4.1300.0-dev4130.300
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fesm2022/magic-xpa-angular.mjs +788 -566
- package/fesm2022/magic-xpa-angular.mjs.map +1 -1
- package/package.json +17 -14
- package/types/magic-xpa-angular.d.ts +2711 -0
- package/index.d.ts +0 -61
- package/src/controls.metadata.model.d.ts +0 -78
- package/src/interfaces/sub-form-definition.iterface.d.ts +0 -18
- package/src/magic.core.module.d.ts +0 -44
- package/src/services/ISubformMagicService.d.ts +0 -4
- package/src/services/OverlayWindowService.d.ts +0 -49
- package/src/services/StylesMapManager.d.ts +0 -8
- package/src/services/accessor.magic.service.d.ts +0 -311
- package/src/services/commands-collector.magic.service.d.ts +0 -18
- package/src/services/component-list.magic.service.d.ts +0 -50
- package/src/services/confirmation.components.magic.provider.d.ts +0 -24
- package/src/services/engine.magic.service.d.ts +0 -32
- package/src/services/exit.magic.service.d.ts +0 -12
- package/src/services/magic-color.service.d.ts +0 -25
- package/src/services/magic.lazy.loader.service.d.ts +0 -6
- package/src/services/magic.providers.d.ts +0 -110
- package/src/services/magic.services.d.ts +0 -22
- package/src/services/mg-date-adapter.d.ts +0 -38
- package/src/services/overlay.conainer.magic.provider.d.ts +0 -7
- package/src/services/router-commands.magic.service.d.ts +0 -23
- package/src/services/subform.magic.service.d.ts +0 -71
- package/src/services/table.magic.service.d.ts +0 -86
- package/src/services/task.magics.service.d.ts +0 -405
- package/src/services/title.magic.service.d.ts +0 -20
- package/src/ui/GuiInteractiveExecutor.d.ts +0 -25
- package/src/ui/components/base-magic-alert.component.d.ts +0 -26
- package/src/ui/components/base-magic-confirm.component.d.ts +0 -28
- package/src/ui/components/magic-alert.component.d.ts +0 -9
- package/src/ui/components/magic-confirmation-box.component.d.ts +0 -9
- package/src/ui/directives/NonMagicControlDirective.d.ts +0 -67
- package/src/ui/directives/magic/checkbox-noformcontrol.magic.directive.d.ts +0 -15
- package/src/ui/directives/magic/checkbox.magic.directive.d.ts +0 -34
- package/src/ui/directives/magic/combobox.magic.directive.d.ts +0 -19
- package/src/ui/directives/magic/form-controls/control-value-accessors/checkbox.cva.directive.d.ts +0 -13
- package/src/ui/directives/magic/form-controls/control-value-accessors/date.cva.directive.d.ts +0 -36
- package/src/ui/directives/magic/form-controls/control-value-accessors/default.cva.directive.d.ts +0 -13
- package/src/ui/directives/magic/input.noformcontrol.magic.directive.d.ts +0 -15
- package/src/ui/directives/magic/nocontrol.magic.directive.d.ts +0 -21
- package/src/ui/directives/magic/row.magic.directive.d.ts +0 -32
- package/src/ui/directives/magic-focus.directive.d.ts +0 -12
- package/src/ui/directives/magic.directive.d.ts +0 -127
- package/src/ui/directives/magicViewContainerRef.directive.d.ts +0 -11
- package/src/ui/directives/mgformat.magic.directive.d.ts +0 -82
- package/src/ui/directives/range-validator.magic.directive.d.ts +0 -33
- package/src/ui/magic-confirmationBox.d.ts +0 -25
- package/src/ui/magic-modal/base-magic-overlay-container.d.ts +0 -14
- package/src/ui/magic-modal/magic-modal-form.d.ts +0 -8
- package/src/ui/magic-modal/magic-modal-interface.d.ts +0 -45
- package/src/ui/magic-modal/magic-overlay-container-wrapper.d.ts +0 -50
- package/src/ui/magic-modal/magic-overlay-container.d.ts +0 -117
- package/src/ui/magic-root.component.d.ts +0 -85
- package/src/ui/mgerror.magic.component.d.ts +0 -39
- package/src/ui/pipes/date.magic.pipe.d.ts +0 -23
- package/src/ui/pipes/time.magic.pipe.d.ts +0 -14
- package/src/ui/pipes/time24.magic.pipe.d.ts +0 -10
- package/src/ui/router-container.magic.component.d.ts +0 -50
- package/src/ui/subform.magic.component.d.ts +0 -37
- package/src/ui/task-base.magic.component.d.ts +0 -112
- package/src/ui/utils.d.ts +0 -12
|
@@ -1,28 +1,28 @@
|
|
|
1
1
|
import { isNullOrUndefined, NString, List, isUndefined, StringBuilder, RefParam } from '@magic-xpa/mscorelib';
|
|
2
2
|
import * as i0 from '@angular/core';
|
|
3
|
-
import { Injectable,
|
|
3
|
+
import { Injectable, inject, Injector, createNgModule, ViewContainerRef, ChangeDetectionStrategy, Component, Directive, EventEmitter, HostListener, Output, Input, ViewChild, ElementRef, input, output, 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
|
|
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
|
|
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
|
|
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
|
|
20
|
-
import
|
|
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
|
|
24
|
-
import {
|
|
21
|
+
import { Platform } from '@angular/cdk/platform';
|
|
22
|
+
import { NGX_CURRENCY_CONFIG, NgxCurrencyInputMode } from '@dintecom/ngx-currency';
|
|
23
|
+
import { MaskitoDirective } from '@maskito/angular';
|
|
25
24
|
import { NativeDateAdapter, MAT_DATE_LOCALE, DateAdapter, MAT_DATE_FORMATS } from '@angular/material/core';
|
|
25
|
+
import { io } from 'socket.io-client';
|
|
26
26
|
|
|
27
27
|
/**
|
|
28
28
|
* @ignore
|
|
@@ -239,6 +239,63 @@ var HtmlClasses;
|
|
|
239
239
|
HtmlClasses["HintColor"] = "hintcolor";
|
|
240
240
|
})(HtmlClasses || (HtmlClasses = {}));
|
|
241
241
|
|
|
242
|
+
/**
|
|
243
|
+
* Notifies Angular that Magic state changed outside of its knowledge.
|
|
244
|
+
*
|
|
245
|
+
* The WebClient runs zoneless, so Angular no longer re-renders the application
|
|
246
|
+
* after every asynchronous task. Change detection is triggered only by Angular's
|
|
247
|
+
* own APIs - a template event binding, a signal write, `markForCheck()` and so on.
|
|
248
|
+
*
|
|
249
|
+
* Magic drives the UI from sources Angular cannot observe: DOM listeners registered
|
|
250
|
+
* through `Renderer2`, the engine's event loop, and socket callbacks. Every such
|
|
251
|
+
* source calls {@link notify}, and the Magic components refresh themselves in response.
|
|
252
|
+
*
|
|
253
|
+
* Application code can use this service for the same purpose. Call {@link notify}
|
|
254
|
+
* after changing component state from a callback Angular does not control - a
|
|
255
|
+
* `setTimeout`, a `Promise`, a `fetch` response or a third-party widget event:
|
|
256
|
+
*
|
|
257
|
+
* ```ts
|
|
258
|
+
* export class MyForm extends TaskBaseMagicComponent {
|
|
259
|
+
* private readonly magicChangeDetection = inject(MagicChangeDetectionService);
|
|
260
|
+
*
|
|
261
|
+
* override mgOnLoad(): void {
|
|
262
|
+
* setTimeout(() => {
|
|
263
|
+
* this.statusText = 'Ready';
|
|
264
|
+
* this.magicChangeDetection.notify();
|
|
265
|
+
* }, 1000);
|
|
266
|
+
* }
|
|
267
|
+
* }
|
|
268
|
+
* ```
|
|
269
|
+
*
|
|
270
|
+
* Notifications are coalesced by Angular's scheduler, so calling {@link notify}
|
|
271
|
+
* several times in a row still results in a single refresh.
|
|
272
|
+
*/
|
|
273
|
+
class MagicChangeDetectionService {
|
|
274
|
+
/**
|
|
275
|
+
* @ignore
|
|
276
|
+
*/
|
|
277
|
+
changedSubject = new Subject();
|
|
278
|
+
/**
|
|
279
|
+
* Emits whenever Magic state changed and the views should be refreshed.
|
|
280
|
+
* Subscribers are expected to mark their view for check.
|
|
281
|
+
*/
|
|
282
|
+
changed = this.changedSubject.asObservable();
|
|
283
|
+
/**
|
|
284
|
+
* Notify Angular that state which the templates depend on has changed.
|
|
285
|
+
*/
|
|
286
|
+
notify() {
|
|
287
|
+
this.changedSubject.next();
|
|
288
|
+
}
|
|
289
|
+
/** @nocollapse */ static ɵfac = function MagicChangeDetectionService_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || MagicChangeDetectionService)(); };
|
|
290
|
+
/** @nocollapse */ static ɵprov = /** @pureOrBreakMyCode */ i0.ɵɵdefineInjectable({ token: MagicChangeDetectionService, factory: MagicChangeDetectionService.ɵfac, providedIn: 'root' });
|
|
291
|
+
}
|
|
292
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(MagicChangeDetectionService, [{
|
|
293
|
+
type: Injectable,
|
|
294
|
+
args: [{
|
|
295
|
+
providedIn: 'root'
|
|
296
|
+
}]
|
|
297
|
+
}], null, null); })();
|
|
298
|
+
|
|
242
299
|
/**
|
|
243
300
|
* @ignore
|
|
244
301
|
*/
|
|
@@ -279,6 +336,9 @@ class EngineMagicService {
|
|
|
279
336
|
//TODO - unregister
|
|
280
337
|
refreshDom = new Subject();
|
|
281
338
|
interactiveCommands = new Subject();
|
|
339
|
+
// Injected as a field rather than a constructor parameter so that the public
|
|
340
|
+
// constructor signature stays unchanged for anyone extending this service.
|
|
341
|
+
magicChangeDetection = inject(MagicChangeDetectionService);
|
|
282
342
|
startMagicEngine(httpClient, args) {
|
|
283
343
|
this.magicBridge.registerExecuteCommandsCallback(data => {
|
|
284
344
|
if (!this.isStub) {
|
|
@@ -294,11 +354,17 @@ class EngineMagicService {
|
|
|
294
354
|
console.log('moving to stub mode');
|
|
295
355
|
this.isStub = true;
|
|
296
356
|
}
|
|
357
|
+
finally {
|
|
358
|
+
// The engine finished a batch of UI commands. Running zoneless, this is the
|
|
359
|
+
// single point where every server-driven change becomes visible to Angular.
|
|
360
|
+
this.magicChangeDetection.notify();
|
|
361
|
+
}
|
|
297
362
|
}
|
|
298
363
|
});
|
|
299
364
|
this.magicBridge.registerInteractiveCallback(data => {
|
|
300
365
|
if (!this.isStub) {
|
|
301
366
|
this.interactiveCommands.next(data);
|
|
367
|
+
this.magicChangeDetection.notify();
|
|
302
368
|
}
|
|
303
369
|
});
|
|
304
370
|
this.magicBridge.Initialize(httpClient, args);
|
|
@@ -309,6 +375,11 @@ class EngineMagicService {
|
|
|
309
375
|
insertEvent(guiEvent) {
|
|
310
376
|
if (!this.isStub)
|
|
311
377
|
this.magicBridge.insertEvent(guiEvent);
|
|
378
|
+
// Every Magic UI event - from the DOM listeners registered by MagicDirective and
|
|
379
|
+
// its subclasses, from the accessor service, and from the overlay service - reaches
|
|
380
|
+
// the engine through here. Renderer2 listeners do not notify Angular's scheduler on
|
|
381
|
+
// their own, so this is where an interaction becomes a change-detection trigger.
|
|
382
|
+
this.magicChangeDetection.notify();
|
|
312
383
|
}
|
|
313
384
|
GetRangedValue(taskId, controlName, value) {
|
|
314
385
|
return this.magicBridge.GetRangedValue(taskId, controlName, value);
|
|
@@ -430,12 +501,11 @@ class ComponentListMagicService {
|
|
|
430
501
|
* @ignore
|
|
431
502
|
*/
|
|
432
503
|
class CommandsCollectorMagicService {
|
|
433
|
-
magic;
|
|
434
504
|
count = 0;
|
|
435
505
|
commands = new List();
|
|
436
506
|
subscription = null;
|
|
437
|
-
|
|
438
|
-
|
|
507
|
+
magic = inject(EngineMagicService);
|
|
508
|
+
constructor() {
|
|
439
509
|
}
|
|
440
510
|
startCollecting() {
|
|
441
511
|
this.count++;
|
|
@@ -460,7 +530,7 @@ class CommandsCollectorMagicService {
|
|
|
460
530
|
commands.forEach(command => { this.commands.Remove(command); });
|
|
461
531
|
return commands;
|
|
462
532
|
}
|
|
463
|
-
/** @nocollapse */ static ɵfac = function CommandsCollectorMagicService_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || CommandsCollectorMagicService)(
|
|
533
|
+
/** @nocollapse */ static ɵfac = function CommandsCollectorMagicService_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || CommandsCollectorMagicService)(); };
|
|
464
534
|
/** @nocollapse */ static ɵprov = /** @pureOrBreakMyCode */ i0.ɵɵdefineInjectable({ token: CommandsCollectorMagicService, factory: CommandsCollectorMagicService.ɵfac, providedIn: 'root' });
|
|
465
535
|
}
|
|
466
536
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(CommandsCollectorMagicService, [{
|
|
@@ -468,7 +538,7 @@ class CommandsCollectorMagicService {
|
|
|
468
538
|
args: [{
|
|
469
539
|
providedIn: 'root'
|
|
470
540
|
}]
|
|
471
|
-
}], () => [
|
|
541
|
+
}], () => [], null); })();
|
|
472
542
|
|
|
473
543
|
/**
|
|
474
544
|
* @ignore
|
|
@@ -522,32 +592,21 @@ class MagicLazyLoaderService {
|
|
|
522
592
|
* Service for managing subforms and routing
|
|
523
593
|
*/
|
|
524
594
|
class SubformMagicService {
|
|
525
|
-
task;
|
|
526
|
-
activatedRoute;
|
|
527
|
-
componentList;
|
|
528
|
-
pendingCommandsCollector;
|
|
529
|
-
router;
|
|
530
|
-
routerCommandsMagicService;
|
|
531
|
-
componentListMagicService;
|
|
532
|
-
loader;
|
|
533
|
-
injector;
|
|
534
|
-
compiler;
|
|
535
595
|
subformsDict /*:{ [x: string]: SubformDefinition }*/ = {};
|
|
536
596
|
routesDict = {}; // dictionary of router outlet to router path
|
|
537
597
|
currentRouteDefinition = null;
|
|
538
598
|
static currentCallerMgSubformServiceRef = null;
|
|
539
599
|
static routerContainers = new Array();
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
this.compiler = compiler;
|
|
600
|
+
task = inject(TaskMagicService);
|
|
601
|
+
activatedRoute = inject(ActivatedRoute);
|
|
602
|
+
componentList = inject(ComponentListMagicService);
|
|
603
|
+
pendingCommandsCollector = inject(CommandsCollectorMagicService);
|
|
604
|
+
router = inject(Router);
|
|
605
|
+
routerCommandsMagicService = inject(RouterCommandsMagicService);
|
|
606
|
+
componentListMagicService = inject(ComponentListMagicService);
|
|
607
|
+
loader = inject(MagicLazyLoaderService);
|
|
608
|
+
injector = inject(Injector);
|
|
609
|
+
constructor() {
|
|
551
610
|
}
|
|
552
611
|
/**
|
|
553
612
|
* Finds and returns the component according to the subform name
|
|
@@ -608,8 +667,7 @@ class SubformMagicService {
|
|
|
608
667
|
// extract name of module(XX) from 'MagicXXModule'
|
|
609
668
|
const moduleName = lazyLoadModule.moduleName.slice(Magic.length, -Module.length);
|
|
610
669
|
this.loader.Load(moduleName).then(m => {
|
|
611
|
-
|
|
612
|
-
moduleRef = compiled.ngModuleFactory.create(this.injector);
|
|
670
|
+
moduleRef = createNgModule(m[lazyLoadModule.moduleName], this.injector);
|
|
613
671
|
this.subformsDict[subformControlName] = {
|
|
614
672
|
formName,
|
|
615
673
|
parameters: { taskIdParam: taskId, taskDescription: taskDescription }
|
|
@@ -749,25 +807,17 @@ class SubformMagicService {
|
|
|
749
807
|
}
|
|
750
808
|
return currentActiveRoute;
|
|
751
809
|
}
|
|
752
|
-
/** @nocollapse */ static ɵfac = function SubformMagicService_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || SubformMagicService)(
|
|
810
|
+
/** @nocollapse */ static ɵfac = function SubformMagicService_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || SubformMagicService)(); };
|
|
753
811
|
/** @nocollapse */ static ɵprov = /** @pureOrBreakMyCode */ i0.ɵɵdefineInjectable({ token: SubformMagicService, factory: SubformMagicService.ɵfac });
|
|
754
812
|
}
|
|
755
813
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(SubformMagicService, [{
|
|
756
814
|
type: Injectable
|
|
757
|
-
}], () => [
|
|
815
|
+
}], () => [], null); })();
|
|
758
816
|
|
|
759
817
|
/**
|
|
760
818
|
* Mock component, implements routing by connecting the requested URL with the appropriate Magic task
|
|
761
819
|
*/
|
|
762
820
|
class RouterContainerMagicComponent {
|
|
763
|
-
activatedRoute;
|
|
764
|
-
router;
|
|
765
|
-
magic;
|
|
766
|
-
containerTaskService;
|
|
767
|
-
viewContainerRef;
|
|
768
|
-
componentList;
|
|
769
|
-
pendingCommandsCollector;
|
|
770
|
-
routerCommandsMagicService;
|
|
771
821
|
componentRef = null;
|
|
772
822
|
parentMgSubformService = null;
|
|
773
823
|
static lastRoute = "/";
|
|
@@ -775,6 +825,14 @@ class RouterContainerMagicComponent {
|
|
|
775
825
|
static get LastRoute() {
|
|
776
826
|
return RouterContainerMagicComponent.lastRoute;
|
|
777
827
|
}
|
|
828
|
+
activatedRoute = inject(ActivatedRoute);
|
|
829
|
+
router = inject(Router);
|
|
830
|
+
magic = inject(EngineMagicService);
|
|
831
|
+
containerTaskService = inject(TaskMagicService);
|
|
832
|
+
viewContainerRef = inject(ViewContainerRef);
|
|
833
|
+
componentList = inject(ComponentListMagicService);
|
|
834
|
+
pendingCommandsCollector = inject(CommandsCollectorMagicService);
|
|
835
|
+
routerCommandsMagicService = inject(RouterCommandsMagicService);
|
|
778
836
|
/**
|
|
779
837
|
*
|
|
780
838
|
* @param changeDetectorRef
|
|
@@ -785,16 +843,7 @@ class RouterContainerMagicComponent {
|
|
|
785
843
|
* @param componentList
|
|
786
844
|
* @param pendingCommandsCollector
|
|
787
845
|
*/
|
|
788
|
-
constructor(
|
|
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
|
-
}
|
|
846
|
+
constructor() { }
|
|
798
847
|
/**
|
|
799
848
|
* Initialization
|
|
800
849
|
*/
|
|
@@ -872,8 +921,8 @@ class RouterContainerMagicComponent {
|
|
|
872
921
|
getRouterPath() {
|
|
873
922
|
return this.routePath;
|
|
874
923
|
}
|
|
875
|
-
/** @nocollapse */ static ɵfac = function RouterContainerMagicComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || RouterContainerMagicComponent)(
|
|
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 });
|
|
924
|
+
/** @nocollapse */ static ɵfac = function RouterContainerMagicComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || RouterContainerMagicComponent)(); };
|
|
925
|
+
/** @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
926
|
}
|
|
878
927
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(RouterContainerMagicComponent, [{
|
|
879
928
|
type: Component,
|
|
@@ -881,10 +930,11 @@ class RouterContainerMagicComponent {
|
|
|
881
930
|
selector: 'magic-route-outlet',
|
|
882
931
|
template: `
|
|
883
932
|
`,
|
|
933
|
+
changeDetection: ChangeDetectionStrategy.Eager,
|
|
884
934
|
standalone: false
|
|
885
935
|
}]
|
|
886
|
-
}], () => [
|
|
887
|
-
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(RouterContainerMagicComponent, { className: "RouterContainerMagicComponent", filePath: "src/ui/router-container.magic.component.ts", lineNumber:
|
|
936
|
+
}], () => [], null); })();
|
|
937
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(RouterContainerMagicComponent, { className: "RouterContainerMagicComponent", filePath: "src/ui/router-container.magic.component.ts", lineNumber: 24 }); })();
|
|
888
938
|
|
|
889
939
|
/**
|
|
890
940
|
* @ignore
|
|
@@ -1003,37 +1053,81 @@ class GuiInteractiveExecutor {
|
|
|
1003
1053
|
}
|
|
1004
1054
|
}
|
|
1005
1055
|
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1056
|
+
class MagicModalProperties {
|
|
1057
|
+
formName = "overlay";
|
|
1058
|
+
showTitleBar = true;
|
|
1059
|
+
x = 0;
|
|
1060
|
+
y = 0;
|
|
1061
|
+
width = "300px";
|
|
1062
|
+
height = "300px";
|
|
1063
|
+
isCenteredToWindow = true;
|
|
1064
|
+
shouldCloseOnBackgroundClick = true;
|
|
1065
|
+
isResizable = true;
|
|
1066
|
+
isMovable = true;
|
|
1067
|
+
constructor(formName, showTitleBar, x, y, width, height, isCenteredToWindow, shouldCloseOnBackgroundClick, isResizable, isMovable) {
|
|
1068
|
+
this.formName = formName;
|
|
1069
|
+
this.showTitleBar = showTitleBar;
|
|
1070
|
+
this.x = x;
|
|
1071
|
+
this.y = y;
|
|
1072
|
+
this.width = width;
|
|
1073
|
+
this.height = height;
|
|
1074
|
+
this.isCenteredToWindow = isCenteredToWindow;
|
|
1075
|
+
this.shouldCloseOnBackgroundClick = shouldCloseOnBackgroundClick;
|
|
1076
|
+
this.isResizable = isResizable;
|
|
1077
|
+
this.isMovable = isMovable;
|
|
1078
|
+
}
|
|
1079
|
+
X() {
|
|
1080
|
+
return this.x;
|
|
1081
|
+
}
|
|
1082
|
+
Y() {
|
|
1083
|
+
return this.y;
|
|
1084
|
+
}
|
|
1085
|
+
Width() {
|
|
1086
|
+
return this.width;
|
|
1087
|
+
}
|
|
1088
|
+
Height() {
|
|
1089
|
+
return this.height;
|
|
1090
|
+
}
|
|
1091
|
+
IsCenteredToWindow() {
|
|
1092
|
+
return this.isCenteredToWindow;
|
|
1093
|
+
}
|
|
1094
|
+
FormName() {
|
|
1095
|
+
return this.formName;
|
|
1096
|
+
}
|
|
1097
|
+
ShowTitleBar() {
|
|
1098
|
+
return this.showTitleBar;
|
|
1099
|
+
}
|
|
1100
|
+
ShouldCloseOnBackgroundClick() {
|
|
1101
|
+
return this.shouldCloseOnBackgroundClick;
|
|
1102
|
+
}
|
|
1103
|
+
IsResizable() {
|
|
1104
|
+
return this.isResizable;
|
|
1105
|
+
}
|
|
1106
|
+
IsMovable() {
|
|
1107
|
+
return this.isMovable;
|
|
1108
|
+
}
|
|
1109
|
+
}
|
|
1110
|
+
|
|
1111
|
+
/**
|
|
1112
|
+
* Abstract base for Magic overlay container components.
|
|
1113
|
+
* Concrete classes must implement these members using Angular signal APIs (input/output).
|
|
1114
|
+
* The class is kept as an abstract class (not an interface) so that instanceof checks
|
|
1115
|
+
* in MagicOverlayContainerWrapper continue to work at runtime.
|
|
1116
|
+
*/
|
|
1117
|
+
class BaseMagicOverlayContainer {
|
|
1118
|
+
}
|
|
1024
1119
|
|
|
1025
1120
|
/**
|
|
1026
1121
|
* Directive for setting ViewContainerRef on element
|
|
1027
1122
|
*/
|
|
1028
1123
|
class MagicViewContainerRef {
|
|
1029
|
-
vcRef;
|
|
1030
|
-
constructor(
|
|
1031
|
-
this.vcRef = vcRef;
|
|
1124
|
+
vcRef = inject(ViewContainerRef);
|
|
1125
|
+
constructor() {
|
|
1032
1126
|
// For angular 10 - find the component from the views
|
|
1033
1127
|
let comp = (this.vcRef._hostLView).find(v => v != null && !isNullOrUndefined(v.setViewContainerRef));
|
|
1034
|
-
comp.setViewContainerRef(vcRef);
|
|
1128
|
+
comp.setViewContainerRef(this.vcRef);
|
|
1035
1129
|
}
|
|
1036
|
-
/** @nocollapse */ static ɵfac = function MagicViewContainerRef_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || MagicViewContainerRef)(
|
|
1130
|
+
/** @nocollapse */ static ɵfac = function MagicViewContainerRef_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || MagicViewContainerRef)(); };
|
|
1037
1131
|
/** @nocollapse */ static ɵdir = /** @pureOrBreakMyCode */ i0.ɵɵdefineDirective({ type: MagicViewContainerRef, selectors: [["", "magicViewContainerRef", ""]], standalone: false });
|
|
1038
1132
|
}
|
|
1039
1133
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(MagicViewContainerRef, [{
|
|
@@ -1042,54 +1136,54 @@ class MagicViewContainerRef {
|
|
|
1042
1136
|
selector: '[magicViewContainerRef]',
|
|
1043
1137
|
standalone: false
|
|
1044
1138
|
}]
|
|
1045
|
-
}], () => [
|
|
1139
|
+
}], () => [], null); })();
|
|
1046
1140
|
|
|
1047
1141
|
const _c0$3 = ["modalheader"];
|
|
1048
1142
|
const _c1$1 = ["modalForeground"];
|
|
1049
|
-
function
|
|
1050
|
-
const
|
|
1143
|
+
function MagicOverlayContainer_Conditional_2_Template(rf, ctx) { if (rf & 1) {
|
|
1144
|
+
const _r1 = i0.ɵɵgetCurrentView();
|
|
1051
1145
|
i0.ɵɵelementStart(0, "button", 14);
|
|
1052
|
-
i0.ɵɵlistener("click", function
|
|
1146
|
+
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
1147
|
i0.ɵɵtext(1, "X");
|
|
1054
1148
|
i0.ɵɵelementEnd();
|
|
1055
1149
|
} }
|
|
1056
|
-
function
|
|
1057
|
-
const
|
|
1150
|
+
function MagicOverlayContainer_Conditional_5_Template(rf, ctx) { if (rf & 1) {
|
|
1151
|
+
const _r3 = i0.ɵɵgetCurrentView();
|
|
1058
1152
|
i0.ɵɵelementStart(0, "span", 15);
|
|
1059
|
-
i0.ɵɵlistener("mousedown", function
|
|
1153
|
+
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
1154
|
i0.ɵɵelementEnd();
|
|
1061
1155
|
} }
|
|
1062
|
-
function
|
|
1063
|
-
const
|
|
1156
|
+
function MagicOverlayContainer_Conditional_6_Template(rf, ctx) { if (rf & 1) {
|
|
1157
|
+
const _r4 = i0.ɵɵgetCurrentView();
|
|
1064
1158
|
i0.ɵɵelementStart(0, "span", 16);
|
|
1065
|
-
i0.ɵɵlistener("mousedown", function
|
|
1159
|
+
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
1160
|
i0.ɵɵelementEnd();
|
|
1067
1161
|
} }
|
|
1068
|
-
function
|
|
1069
|
-
const
|
|
1162
|
+
function MagicOverlayContainer_Conditional_7_Template(rf, ctx) { if (rf & 1) {
|
|
1163
|
+
const _r5 = i0.ɵɵgetCurrentView();
|
|
1070
1164
|
i0.ɵɵelementStart(0, "span", 17);
|
|
1071
|
-
i0.ɵɵlistener("mousedown", function
|
|
1165
|
+
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
1166
|
i0.ɵɵelementEnd();
|
|
1073
1167
|
} }
|
|
1074
|
-
function
|
|
1075
|
-
const
|
|
1168
|
+
function MagicOverlayContainer_Conditional_8_Template(rf, ctx) { if (rf & 1) {
|
|
1169
|
+
const _r6 = i0.ɵɵgetCurrentView();
|
|
1076
1170
|
i0.ɵɵelementStart(0, "span", 18);
|
|
1077
|
-
i0.ɵɵlistener("mousedown", function
|
|
1171
|
+
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
1172
|
i0.ɵɵelementEnd();
|
|
1079
1173
|
} }
|
|
1080
|
-
function
|
|
1081
|
-
const
|
|
1174
|
+
function MagicOverlayContainer_Conditional_9_Template(rf, ctx) { if (rf & 1) {
|
|
1175
|
+
const _r7 = i0.ɵɵgetCurrentView();
|
|
1082
1176
|
i0.ɵɵelementStart(0, "div", 19, 2);
|
|
1083
1177
|
i0.ɵɵtext(2);
|
|
1084
1178
|
i0.ɵɵelementStart(3, "button", 20);
|
|
1085
|
-
i0.ɵɵlistener("click", function
|
|
1179
|
+
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
1180
|
i0.ɵɵtext(4, "X");
|
|
1087
1181
|
i0.ɵɵelementEnd()();
|
|
1088
1182
|
} if (rf & 2) {
|
|
1089
|
-
const
|
|
1090
|
-
i0.ɵɵclassProp("movable",
|
|
1183
|
+
const ctx_r1 = i0.ɵɵnextContext();
|
|
1184
|
+
i0.ɵɵclassProp("movable", ctx_r1.IsMovable());
|
|
1091
1185
|
i0.ɵɵadvance(2);
|
|
1092
|
-
i0.ɵɵtextInterpolate1(" ",
|
|
1186
|
+
i0.ɵɵtextInterpolate1(" ", ctx_r1.getText(), " ");
|
|
1093
1187
|
} }
|
|
1094
1188
|
/**
|
|
1095
1189
|
* Creates a modal window for Magic modal window components
|
|
@@ -1142,7 +1236,7 @@ class MagicOverlayContainer extends BaseMagicOverlayContainer {
|
|
|
1142
1236
|
ngOnInit() {
|
|
1143
1237
|
this.componentRef = this.modalbodyViewContainerRef.createComponent(this.ModalComp);
|
|
1144
1238
|
Object.assign(this.componentRef.instance, this.ModalCompParameters);
|
|
1145
|
-
let comp = this.
|
|
1239
|
+
let comp = this.getOverlayProps();
|
|
1146
1240
|
this.isCenteredToWindow = comp.IsCenteredToWindow();
|
|
1147
1241
|
}
|
|
1148
1242
|
ngAfterViewInit() {
|
|
@@ -1161,7 +1255,7 @@ class MagicOverlayContainer extends BaseMagicOverlayContainer {
|
|
|
1161
1255
|
*/
|
|
1162
1256
|
getText() {
|
|
1163
1257
|
if (this.componentRef !== null) {
|
|
1164
|
-
let comp = this.
|
|
1258
|
+
let comp = this.getOverlayProps();
|
|
1165
1259
|
return comp.FormName();
|
|
1166
1260
|
}
|
|
1167
1261
|
else
|
|
@@ -1180,7 +1274,7 @@ class MagicOverlayContainer extends BaseMagicOverlayContainer {
|
|
|
1180
1274
|
getStyle() {
|
|
1181
1275
|
let styles = {};
|
|
1182
1276
|
if (this.componentRef != undefined) {
|
|
1183
|
-
let comp = this.
|
|
1277
|
+
let comp = this.getOverlayProps();
|
|
1184
1278
|
styles['width'] = comp.Width();
|
|
1185
1279
|
styles['height'] = comp.Height();
|
|
1186
1280
|
if (this.isCenteredToWindow) {
|
|
@@ -1217,7 +1311,7 @@ class MagicOverlayContainer extends BaseMagicOverlayContainer {
|
|
|
1217
1311
|
*/
|
|
1218
1312
|
getShowTitleBar() {
|
|
1219
1313
|
if (this.componentRef != undefined) {
|
|
1220
|
-
let comp = this.
|
|
1314
|
+
let comp = this.getOverlayProps();
|
|
1221
1315
|
return comp.ShowTitleBar();
|
|
1222
1316
|
}
|
|
1223
1317
|
}
|
|
@@ -1231,7 +1325,7 @@ class MagicOverlayContainer extends BaseMagicOverlayContainer {
|
|
|
1231
1325
|
* Handles click in the background window
|
|
1232
1326
|
*/
|
|
1233
1327
|
OnBackgroundClick() {
|
|
1234
|
-
let comp = this.
|
|
1328
|
+
let comp = this.getOverlayProps();
|
|
1235
1329
|
if (comp.ShouldCloseOnBackgroundClick())
|
|
1236
1330
|
this.OnClose();
|
|
1237
1331
|
}
|
|
@@ -1240,7 +1334,9 @@ class MagicOverlayContainer extends BaseMagicOverlayContainer {
|
|
|
1240
1334
|
* @returns {boolean} True if the overlay is resizable, false otherwise.
|
|
1241
1335
|
*/
|
|
1242
1336
|
IsResizable() {
|
|
1243
|
-
|
|
1337
|
+
if (!this.componentRef)
|
|
1338
|
+
return false;
|
|
1339
|
+
let comp = this.getOverlayProps();
|
|
1244
1340
|
return comp.IsResizable();
|
|
1245
1341
|
}
|
|
1246
1342
|
/**
|
|
@@ -1248,7 +1344,9 @@ class MagicOverlayContainer extends BaseMagicOverlayContainer {
|
|
|
1248
1344
|
* @returns {boolean} True if the overlay is movable, false otherwise.
|
|
1249
1345
|
*/
|
|
1250
1346
|
IsMovable() {
|
|
1251
|
-
|
|
1347
|
+
if (!this.componentRef)
|
|
1348
|
+
return false;
|
|
1349
|
+
let comp = this.getOverlayProps();
|
|
1252
1350
|
return comp.IsMovable();
|
|
1253
1351
|
}
|
|
1254
1352
|
/**
|
|
@@ -1342,45 +1440,60 @@ class MagicOverlayContainer extends BaseMagicOverlayContainer {
|
|
|
1342
1440
|
this.resizing = false;
|
|
1343
1441
|
this.resizeDirection = null;
|
|
1344
1442
|
}
|
|
1443
|
+
getOverlayProps() {
|
|
1444
|
+
let obj = this.componentRef.instance;
|
|
1445
|
+
if (obj && obj.magicModalProperties instanceof MagicModalProperties)
|
|
1446
|
+
obj = obj.magicModalProperties;
|
|
1447
|
+
// The properties come either from a MagicModalProperties object or from a component that implements MagicModalInterface itself.
|
|
1448
|
+
if (!(obj instanceof MagicModalProperties) && typeof obj?.ShowTitleBar !== 'function') {
|
|
1449
|
+
const componentName = this.componentRef?.instance?.constructor?.name || 'Unknown';
|
|
1450
|
+
throw new Error(`Overlay component '${componentName}' cannot be opened. ` +
|
|
1451
|
+
`Ensure that the component contains a 'magicModalProperties' property of type MagicModalProperties. ` +
|
|
1452
|
+
`Example: magicModalProperties: MagicModalProperties = new MagicModalProperties("formName", true, 0, 0, "300px", "300px", true, true, true, true);`);
|
|
1453
|
+
}
|
|
1454
|
+
return obj;
|
|
1455
|
+
}
|
|
1345
1456
|
/** @nocollapse */ static ɵfac = function MagicOverlayContainer_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || MagicOverlayContainer)(); };
|
|
1346
1457
|
/** @nocollapse */ static ɵcmp = /** @pureOrBreakMyCode */ i0.ɵɵdefineComponent({ type: MagicOverlayContainer, selectors: [["app-magic-overlay-container"]], viewQuery: function MagicOverlayContainer_Query(rf, ctx) { if (rf & 1) {
|
|
1347
|
-
i0.ɵɵviewQuery(_c0$3, 5);
|
|
1348
|
-
i0.ɵɵviewQuery(_c1$1, 5);
|
|
1458
|
+
i0.ɵɵviewQuery(_c0$3, 5)(_c1$1, 5);
|
|
1349
1459
|
} if (rf & 2) {
|
|
1350
1460
|
let _t;
|
|
1351
1461
|
i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.headerElementRef = _t.first);
|
|
1352
1462
|
i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.foregroundElementRef = _t.first);
|
|
1353
1463
|
} }, hostBindings: function MagicOverlayContainer_HostBindings(rf, ctx) { if (rf & 1) {
|
|
1354
|
-
i0.ɵɵlistener("mousemove", function MagicOverlayContainer_mousemove_HostBindingHandler($event) { return ctx.onResize($event); },
|
|
1355
|
-
} }, 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", "
|
|
1356
|
-
const _r1 = i0.ɵɵgetCurrentView();
|
|
1464
|
+
i0.ɵɵlistener("mousemove", function MagicOverlayContainer_mousemove_HostBindingHandler($event) { return ctx.onResize($event); }, i0.ɵɵresolveWindow)("mouseup", function MagicOverlayContainer_mouseup_HostBindingHandler() { return ctx.onResizeEnd(); }, i0.ɵɵresolveWindow);
|
|
1465
|
+
} }, 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) {
|
|
1357
1466
|
i0.ɵɵelementStart(0, "div", 3)(1, "div", 4);
|
|
1358
|
-
i0.ɵɵlistener("click", function MagicOverlayContainer_Template_div_click_1_listener() {
|
|
1359
|
-
i0.ɵɵ
|
|
1467
|
+
i0.ɵɵlistener("click", function MagicOverlayContainer_Template_div_click_1_listener() { return ctx.OnBackgroundClick(); });
|
|
1468
|
+
i0.ɵɵconditionalCreate(2, MagicOverlayContainer_Conditional_2_Template, 2, 0, "button", 5);
|
|
1360
1469
|
i0.ɵɵelementEnd();
|
|
1361
1470
|
i0.ɵɵelementStart(3, "div", 6, 0);
|
|
1362
|
-
i0.ɵɵ
|
|
1471
|
+
i0.ɵɵconditionalCreate(5, MagicOverlayContainer_Conditional_5_Template, 1, 0, "span", 7);
|
|
1472
|
+
i0.ɵɵconditionalCreate(6, MagicOverlayContainer_Conditional_6_Template, 1, 0, "span", 8);
|
|
1473
|
+
i0.ɵɵconditionalCreate(7, MagicOverlayContainer_Conditional_7_Template, 1, 0, "span", 9);
|
|
1474
|
+
i0.ɵɵconditionalCreate(8, MagicOverlayContainer_Conditional_8_Template, 1, 0, "span", 10);
|
|
1475
|
+
i0.ɵɵconditionalCreate(9, MagicOverlayContainer_Conditional_9_Template, 5, 3, "div", 11);
|
|
1363
1476
|
i0.ɵɵelementStart(10, "div", 12);
|
|
1364
1477
|
i0.ɵɵelement(11, "div", 13, 1);
|
|
1365
1478
|
i0.ɵɵelementEnd()()();
|
|
1366
1479
|
} if (rf & 2) {
|
|
1367
1480
|
i0.ɵɵadvance(2);
|
|
1368
|
-
i0.ɵɵ
|
|
1481
|
+
i0.ɵɵconditional(!ctx.getShowTitleBar() ? 2 : -1);
|
|
1369
1482
|
i0.ɵɵadvance();
|
|
1370
1483
|
i0.ɵɵproperty("ngStyle", ctx.getStyle())("cdkDragDisabled", !ctx.IsMovable());
|
|
1371
1484
|
i0.ɵɵadvance(2);
|
|
1372
|
-
i0.ɵɵ
|
|
1485
|
+
i0.ɵɵconditional(ctx.IsResizable() && !ctx.isRtl ? 5 : -1);
|
|
1373
1486
|
i0.ɵɵadvance();
|
|
1374
|
-
i0.ɵɵ
|
|
1487
|
+
i0.ɵɵconditional(ctx.IsResizable() && ctx.isRtl ? 6 : -1);
|
|
1375
1488
|
i0.ɵɵadvance();
|
|
1376
|
-
i0.ɵɵ
|
|
1489
|
+
i0.ɵɵconditional(ctx.IsResizable() ? 7 : -1);
|
|
1377
1490
|
i0.ɵɵadvance();
|
|
1378
|
-
i0.ɵɵ
|
|
1491
|
+
i0.ɵɵconditional(ctx.IsResizable() ? 8 : -1);
|
|
1379
1492
|
i0.ɵɵadvance();
|
|
1380
|
-
i0.ɵɵ
|
|
1493
|
+
i0.ɵɵconditional(ctx.getShowTitleBar() ? 9 : -1);
|
|
1381
1494
|
i0.ɵɵadvance();
|
|
1382
1495
|
i0.ɵɵproperty("ngStyle", ctx.getClientAreaStyles());
|
|
1383
|
-
} }, dependencies: [i1.
|
|
1496
|
+
} }, 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 });
|
|
1384
1497
|
}
|
|
1385
1498
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(MagicOverlayContainer, [{
|
|
1386
1499
|
type: Component,
|
|
@@ -1388,20 +1501,32 @@ class MagicOverlayContainer extends BaseMagicOverlayContainer {
|
|
|
1388
1501
|
<div class="boundary-line">
|
|
1389
1502
|
|
|
1390
1503
|
<div class="modal-background" (click)="OnBackgroundClick()">
|
|
1391
|
-
|
|
1504
|
+
@if (!getShowTitleBar()) {
|
|
1505
|
+
<button (click)="OnClose()" tabindex="-1" style="float:right; border: none; background-color: transparent; outline: none; color: white">X</button>
|
|
1506
|
+
}
|
|
1392
1507
|
</div>
|
|
1393
1508
|
|
|
1394
1509
|
<div #modalForeground class="modal-foreground" [ngStyle]="getStyle()" cdkDragBoundary=".boundary-line" cdkDrag [cdkDragDisabled]="!IsMovable()">
|
|
1395
1510
|
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1511
|
+
@if (IsResizable() && !isRtl) {
|
|
1512
|
+
<span class="dragHandle right" (mousedown)="onResizeStart($event, 'right')"></span>
|
|
1513
|
+
}
|
|
1514
|
+
@if (IsResizable() && isRtl) {
|
|
1515
|
+
<span class="dragHandle left" (mousedown)="onResizeStart($event, 'left')"></span>
|
|
1516
|
+
}
|
|
1517
|
+
@if (IsResizable()) {
|
|
1518
|
+
<span class="dragHandle corner" (mousedown)="onResizeStart($event, 'corner')"></span>
|
|
1519
|
+
}
|
|
1520
|
+
@if (IsResizable()) {
|
|
1521
|
+
<span class="dragHandle bottom" (mousedown)="onResizeStart($event, 'bottom')"></span>
|
|
1522
|
+
}
|
|
1400
1523
|
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1524
|
+
@if (getShowTitleBar()) {
|
|
1525
|
+
<div #modalheader class="modal-header" cdkDragHandle [class.movable]="IsMovable()">
|
|
1526
|
+
{{getText()}}
|
|
1527
|
+
<button (click)="OnClose()" style="float:right" tabindex="-1">X</button>
|
|
1528
|
+
</div>
|
|
1529
|
+
}
|
|
1405
1530
|
|
|
1406
1531
|
<div [ngStyle]="getClientAreaStyles()">
|
|
1407
1532
|
<div #modalbody magicViewContainerRef>
|
|
@@ -1409,7 +1534,7 @@ class MagicOverlayContainer extends BaseMagicOverlayContainer {
|
|
|
1409
1534
|
</div>
|
|
1410
1535
|
</div>
|
|
1411
1536
|
</div>
|
|
1412
|
-
|
|
1537
|
+
`, 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"] }]
|
|
1413
1538
|
}], () => [], { headerElementRef: [{
|
|
1414
1539
|
type: ViewChild,
|
|
1415
1540
|
args: ['modalheader', { static: false }]
|
|
@@ -1429,7 +1554,7 @@ class MagicOverlayContainer extends BaseMagicOverlayContainer {
|
|
|
1429
1554
|
type: HostListener,
|
|
1430
1555
|
args: ['window:mouseup']
|
|
1431
1556
|
}] }); })();
|
|
1432
|
-
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(MagicOverlayContainer, { className: "MagicOverlayContainer", filePath: "src/ui/magic-modal/magic-overlay-container.ts", lineNumber:
|
|
1557
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(MagicOverlayContainer, { className: "MagicOverlayContainer", filePath: "src/ui/magic-modal/magic-overlay-container.ts", lineNumber: 67 }); })();
|
|
1433
1558
|
|
|
1434
1559
|
/**
|
|
1435
1560
|
* Service managing overlay windows
|
|
@@ -1472,11 +1597,11 @@ class BaseMagicConfirmComponent {
|
|
|
1472
1597
|
this.onClose.emit(result);
|
|
1473
1598
|
}
|
|
1474
1599
|
/** @nocollapse */ static ɵfac = function BaseMagicConfirmComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || BaseMagicConfirmComponent)(); };
|
|
1475
|
-
/** @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 });
|
|
1600
|
+
/** @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, changeDetection: 1 });
|
|
1476
1601
|
}
|
|
1477
1602
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(BaseMagicConfirmComponent, [{
|
|
1478
1603
|
type: Component,
|
|
1479
|
-
args: [{ selector: 'mg-base-confirm', template: '', standalone: false }]
|
|
1604
|
+
args: [{ selector: 'mg-base-confirm', template: '', changeDetection: ChangeDetectionStrategy.Eager, standalone: false }]
|
|
1480
1605
|
}], null, { title: [{
|
|
1481
1606
|
type: Input
|
|
1482
1607
|
}], message: [{
|
|
@@ -1484,7 +1609,7 @@ class BaseMagicConfirmComponent {
|
|
|
1484
1609
|
}], onClose: [{
|
|
1485
1610
|
type: Output
|
|
1486
1611
|
}] }); })();
|
|
1487
|
-
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(BaseMagicConfirmComponent, { className: "BaseMagicConfirmComponent", filePath: "src/ui/components/base-magic-confirm.component.ts", lineNumber:
|
|
1612
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(BaseMagicConfirmComponent, { className: "BaseMagicConfirmComponent", filePath: "src/ui/components/base-magic-confirm.component.ts", lineNumber: 14 }); })();
|
|
1488
1613
|
|
|
1489
1614
|
/**
|
|
1490
1615
|
* This is a base class for the magic alert components
|
|
@@ -1510,11 +1635,11 @@ class BaseMagicAlertComponent {
|
|
|
1510
1635
|
this.onClose.emit();
|
|
1511
1636
|
}
|
|
1512
1637
|
/** @nocollapse */ static ɵfac = function BaseMagicAlertComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || BaseMagicAlertComponent)(); };
|
|
1513
|
-
/** @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 });
|
|
1638
|
+
/** @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, changeDetection: 1 });
|
|
1514
1639
|
}
|
|
1515
1640
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(BaseMagicAlertComponent, [{
|
|
1516
1641
|
type: Component,
|
|
1517
|
-
args: [{ selector: 'mg-base-alert', template: '', standalone: false }]
|
|
1642
|
+
args: [{ selector: 'mg-base-alert', template: '', changeDetection: ChangeDetectionStrategy.Eager, standalone: false }]
|
|
1518
1643
|
}], null, { title: [{
|
|
1519
1644
|
type: Input
|
|
1520
1645
|
}], message: [{
|
|
@@ -1522,20 +1647,18 @@ class BaseMagicAlertComponent {
|
|
|
1522
1647
|
}], onClose: [{
|
|
1523
1648
|
type: Output
|
|
1524
1649
|
}] }); })();
|
|
1525
|
-
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(BaseMagicAlertComponent, { className: "BaseMagicAlertComponent", filePath: "src/ui/components/base-magic-alert.component.ts", lineNumber:
|
|
1650
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(BaseMagicAlertComponent, { className: "BaseMagicAlertComponent", filePath: "src/ui/components/base-magic-alert.component.ts", lineNumber: 16 }); })();
|
|
1526
1651
|
|
|
1527
1652
|
/**
|
|
1528
1653
|
* Directive for setting focus on element
|
|
1529
1654
|
*/
|
|
1530
1655
|
class MagicFocusDirective {
|
|
1531
|
-
hostElement;
|
|
1532
|
-
constructor(
|
|
1533
|
-
this.hostElement = hostElement;
|
|
1534
|
-
}
|
|
1656
|
+
hostElement = inject(ElementRef);
|
|
1657
|
+
constructor() { }
|
|
1535
1658
|
ngAfterViewInit() {
|
|
1536
1659
|
this.hostElement.nativeElement.focus();
|
|
1537
1660
|
}
|
|
1538
|
-
/** @nocollapse */ static ɵfac = function MagicFocusDirective_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || MagicFocusDirective)(
|
|
1661
|
+
/** @nocollapse */ static ɵfac = function MagicFocusDirective_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || MagicFocusDirective)(); };
|
|
1539
1662
|
/** @nocollapse */ static ɵdir = /** @pureOrBreakMyCode */ i0.ɵɵdefineDirective({ type: MagicFocusDirective, selectors: [["", "magicFocus", ""]], standalone: false });
|
|
1540
1663
|
}
|
|
1541
1664
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(MagicFocusDirective, [{
|
|
@@ -1544,30 +1667,29 @@ class MagicFocusDirective {
|
|
|
1544
1667
|
selector: '[magicFocus]',
|
|
1545
1668
|
standalone: false
|
|
1546
1669
|
}]
|
|
1547
|
-
}], () => [
|
|
1670
|
+
}], () => [], null); })();
|
|
1548
1671
|
|
|
1549
1672
|
const _c0$2 = ["overlayContainerWrapper"];
|
|
1550
1673
|
class MagicOverlayContainerWrapper {
|
|
1551
|
-
componentListMagicService;
|
|
1552
|
-
magicLazyModuleLoader;
|
|
1553
|
-
injector;
|
|
1554
|
-
changeDetectorRef;
|
|
1555
|
-
compiler;
|
|
1556
1674
|
/**
|
|
1557
1675
|
*
|
|
1558
1676
|
*/
|
|
1559
|
-
Component = null
|
|
1677
|
+
Component = input(null, /* @ts-ignore */
|
|
1678
|
+
...(ngDevMode ? [{ debugName: "Component" }] : /* istanbul ignore next */ []));
|
|
1560
1679
|
/**
|
|
1561
1680
|
*
|
|
1562
1681
|
*/
|
|
1563
|
-
Parameters = {}
|
|
1564
|
-
|
|
1565
|
-
|
|
1682
|
+
Parameters = input({}, /* @ts-ignore */
|
|
1683
|
+
...(ngDevMode ? [{ debugName: "Parameters" }] : /* istanbul ignore next */ []));
|
|
1684
|
+
OverlayTypeParam = input(/* @ts-ignore */
|
|
1685
|
+
...(ngDevMode ? [undefined, { debugName: "OverlayTypeParam" }] : /* istanbul ignore next */ []));
|
|
1686
|
+
onClose = output();
|
|
1566
1687
|
/**
|
|
1567
1688
|
* HTML to be displayed in the modal window
|
|
1568
1689
|
*/
|
|
1569
1690
|
overlayContentViewContainerRef;
|
|
1570
|
-
overlayContainerWrapperElementRef
|
|
1691
|
+
overlayContainerWrapperElementRef = viewChild.required('overlayContainerWrapper', /* @ts-ignore */
|
|
1692
|
+
...(ngDevMode ? [{ debugName: "overlayContainerWrapperElementRef" }] : /* istanbul ignore next */ []));
|
|
1571
1693
|
/**
|
|
1572
1694
|
* @ignore
|
|
1573
1695
|
* contais data of allowed base components to use
|
|
@@ -1577,32 +1699,26 @@ class MagicOverlayContainerWrapper {
|
|
|
1577
1699
|
[OverlayType.Alert, { comp: BaseMagicAlertComponent, error: 'BaseMagicAlertComponent. Alert ' }],
|
|
1578
1700
|
[OverlayType.ConfirmationBox, { comp: BaseMagicConfirmComponent, error: 'BaseMagicConfirmComponent. Confirmation ' }]
|
|
1579
1701
|
]);
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
constructor(
|
|
1585
|
-
this.componentListMagicService = componentListMagicService;
|
|
1586
|
-
this.magicLazyModuleLoader = magicLazyModuleLoader;
|
|
1587
|
-
this.injector = injector;
|
|
1588
|
-
this.changeDetectorRef = changeDetectorRef;
|
|
1589
|
-
this.compiler = compiler;
|
|
1702
|
+
componentListMagicService = inject(ComponentListMagicService);
|
|
1703
|
+
magicLazyModuleLoader = inject(MagicLazyLoaderService);
|
|
1704
|
+
injector = inject(Injector);
|
|
1705
|
+
changeDetectorRef = inject(ChangeDetectorRef);
|
|
1706
|
+
constructor() {
|
|
1590
1707
|
}
|
|
1591
1708
|
/**
|
|
1592
1709
|
*
|
|
1593
1710
|
*/
|
|
1594
1711
|
ngOnInit() {
|
|
1595
|
-
let moduleRef = this.componentListMagicService.getModuleRef(this.Parameters.MagicFormName);
|
|
1712
|
+
let moduleRef = this.componentListMagicService.getModuleRef(this.Parameters().MagicFormName);
|
|
1596
1713
|
if (moduleRef == null) {
|
|
1597
|
-
let lazyLoadModule = this.componentListMagicService.getLazyLoadModuleData(this.Parameters.MagicFormName);
|
|
1714
|
+
let lazyLoadModule = this.componentListMagicService.getLazyLoadModuleData(this.Parameters().MagicFormName);
|
|
1598
1715
|
if (lazyLoadModule != null) {
|
|
1599
1716
|
const Magic = 'Magic';
|
|
1600
1717
|
const Module = 'Module';
|
|
1601
1718
|
// extract name of module(XX) from 'MagicXXModule'
|
|
1602
1719
|
const moduleName = lazyLoadModule.moduleName.slice(Magic.length, -Module.length);
|
|
1603
1720
|
this.magicLazyModuleLoader.Load(moduleName).then(m => {
|
|
1604
|
-
|
|
1605
|
-
moduleRef = compiled.ngModuleFactory.create(this.injector);
|
|
1721
|
+
moduleRef = createNgModule(m[lazyLoadModule.moduleName], this.injector);
|
|
1606
1722
|
this.loadComponent(moduleRef);
|
|
1607
1723
|
});
|
|
1608
1724
|
}
|
|
@@ -1614,11 +1730,18 @@ class MagicOverlayContainerWrapper {
|
|
|
1614
1730
|
this.loadComponent(moduleRef);
|
|
1615
1731
|
}
|
|
1616
1732
|
loadComponent(moduleRef) {
|
|
1617
|
-
this.Parameters.ModalComp = this.componentListMagicService.getComponent(this.Parameters.MagicFormName, !isNullOrUndefined(this.Parameters.MagicFormName));
|
|
1618
|
-
let componentRef = this.overlayContentViewContainerRef.createComponent(this.Component);
|
|
1619
|
-
let allowedBaseComp = MagicOverlayContainerWrapper.allowedBaseComps.get(this.OverlayTypeParam);
|
|
1733
|
+
this.Parameters().ModalComp = this.componentListMagicService.getComponent(this.Parameters().MagicFormName, !isNullOrUndefined(this.Parameters().MagicFormName));
|
|
1734
|
+
let componentRef = this.overlayContentViewContainerRef.createComponent(this.Component());
|
|
1735
|
+
let allowedBaseComp = MagicOverlayContainerWrapper.allowedBaseComps.get(this.OverlayTypeParam());
|
|
1620
1736
|
if (componentRef.instance instanceof allowedBaseComp.comp) {
|
|
1621
|
-
|
|
1737
|
+
if (this.OverlayTypeParam() === OverlayType.Overlay) {
|
|
1738
|
+
componentRef.setInput('ModalComp', this.Parameters().ModalComp);
|
|
1739
|
+
componentRef.setInput('ModalCompParameters', this.Parameters().ModalCompParameters);
|
|
1740
|
+
}
|
|
1741
|
+
else {
|
|
1742
|
+
componentRef.setInput('title', this.Parameters().title);
|
|
1743
|
+
componentRef.setInput('message', this.Parameters().message);
|
|
1744
|
+
}
|
|
1622
1745
|
componentRef.instance.onClose.subscribe((res) => {
|
|
1623
1746
|
this.onClose.emit(res);
|
|
1624
1747
|
});
|
|
@@ -1632,18 +1755,17 @@ class MagicOverlayContainerWrapper {
|
|
|
1632
1755
|
this.overlayContentViewContainerRef = vcRef;
|
|
1633
1756
|
}
|
|
1634
1757
|
GetRootElement() {
|
|
1635
|
-
return this.overlayContainerWrapperElementRef.nativeElement;
|
|
1758
|
+
return this.overlayContainerWrapperElementRef().nativeElement;
|
|
1636
1759
|
}
|
|
1637
1760
|
DetectChanges() {
|
|
1638
1761
|
this.changeDetectorRef.detectChanges();
|
|
1639
1762
|
}
|
|
1640
|
-
/** @nocollapse */ static ɵfac = function MagicOverlayContainerWrapper_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || MagicOverlayContainerWrapper)(
|
|
1763
|
+
/** @nocollapse */ static ɵfac = function MagicOverlayContainerWrapper_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || MagicOverlayContainerWrapper)(); };
|
|
1641
1764
|
/** @nocollapse */ static ɵcmp = /** @pureOrBreakMyCode */ i0.ɵɵdefineComponent({ type: MagicOverlayContainerWrapper, selectors: [["app-magic-overlay-container-wrapper"]], viewQuery: function MagicOverlayContainerWrapper_Query(rf, ctx) { if (rf & 1) {
|
|
1642
|
-
i0.ɵɵ
|
|
1765
|
+
i0.ɵɵviewQuerySignal(ctx.overlayContainerWrapperElementRef, _c0$2, 5);
|
|
1643
1766
|
} if (rf & 2) {
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
} }, 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) {
|
|
1767
|
+
i0.ɵɵqueryAdvance();
|
|
1768
|
+
} }, 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) {
|
|
1647
1769
|
i0.ɵɵelementStart(0, "div");
|
|
1648
1770
|
i0.ɵɵelement(1, "div", 2);
|
|
1649
1771
|
i0.ɵɵelementStart(2, "div", 3, 0);
|
|
@@ -1651,7 +1773,7 @@ class MagicOverlayContainerWrapper {
|
|
|
1651
1773
|
i0.ɵɵelementEnd();
|
|
1652
1774
|
i0.ɵɵelement(6, "div", 5);
|
|
1653
1775
|
i0.ɵɵelementEnd();
|
|
1654
|
-
} }, dependencies: [MagicFocusDirective, MagicViewContainerRef], styles: [".overlay-container-wrapper-background[_ngcontent-%COMP%]{position:fixed;z-index:999;inset:0}"] });
|
|
1776
|
+
} }, dependencies: [MagicFocusDirective, MagicViewContainerRef], styles: [".overlay-container-wrapper-background[_ngcontent-%COMP%]{position:fixed;z-index:999;inset:0}"], changeDetection: 1 });
|
|
1655
1777
|
}
|
|
1656
1778
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(MagicOverlayContainerWrapper, [{
|
|
1657
1779
|
type: Component,
|
|
@@ -1664,19 +1786,8 @@ class MagicOverlayContainerWrapper {
|
|
|
1664
1786
|
</div>
|
|
1665
1787
|
<div class="overlay-container-wrapper-background" tabIndex="0" style="width: 0px; height: 0px;" ></div>
|
|
1666
1788
|
</div>
|
|
1667
|
-
`, standalone: false, styles: [".overlay-container-wrapper-background{position:fixed;z-index:999;inset:0}\n"] }]
|
|
1668
|
-
}], () => [{ type:
|
|
1669
|
-
type: Input
|
|
1670
|
-
}], Parameters: [{
|
|
1671
|
-
type: Input
|
|
1672
|
-
}], OverlayTypeParam: [{
|
|
1673
|
-
type: Input
|
|
1674
|
-
}], onClose: [{
|
|
1675
|
-
type: Output
|
|
1676
|
-
}], overlayContainerWrapperElementRef: [{
|
|
1677
|
-
type: ViewChild,
|
|
1678
|
-
args: ['overlayContainerWrapper', { static: true }]
|
|
1679
|
-
}] }); })();
|
|
1789
|
+
`, changeDetection: ChangeDetectionStrategy.Eager, standalone: false, styles: [".overlay-container-wrapper-background{position:fixed;z-index:999;inset:0}\n"] }]
|
|
1790
|
+
}], () => [], { 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 }] }] }); })();
|
|
1680
1791
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(MagicOverlayContainerWrapper, { className: "MagicOverlayContainerWrapper", filePath: "src/ui/magic-modal/magic-overlay-container-wrapper.ts", lineNumber: 46 }); })();
|
|
1681
1792
|
|
|
1682
1793
|
/***
|
|
@@ -1697,7 +1808,7 @@ class MagicAlertComponent extends BaseMagicAlertComponent {
|
|
|
1697
1808
|
i0.ɵɵelementEnd()()();
|
|
1698
1809
|
} if (rf & 2) {
|
|
1699
1810
|
i0.ɵɵadvance(3);
|
|
1700
|
-
i0.ɵɵtextInterpolate1(" ", ctx.title
|
|
1811
|
+
i0.ɵɵtextInterpolate1(" ", ctx.title);
|
|
1701
1812
|
i0.ɵɵadvance(2);
|
|
1702
1813
|
i0.ɵɵtextInterpolate1("", ctx.message, " ");
|
|
1703
1814
|
} }, 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}"] });
|
|
@@ -1736,7 +1847,7 @@ class MagicConfirmationBoxComponent extends BaseMagicConfirmComponent {
|
|
|
1736
1847
|
i0.ɵɵelementEnd()()();
|
|
1737
1848
|
} if (rf & 2) {
|
|
1738
1849
|
i0.ɵɵadvance(3);
|
|
1739
|
-
i0.ɵɵtextInterpolate1(" ", ctx.title
|
|
1850
|
+
i0.ɵɵtextInterpolate1(" ", ctx.title);
|
|
1740
1851
|
i0.ɵɵadvance();
|
|
1741
1852
|
i0.ɵɵtextInterpolate1(" ", ctx.message, " ");
|
|
1742
1853
|
} }, 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}"] });
|
|
@@ -1863,21 +1974,13 @@ class confirmationBox {
|
|
|
1863
1974
|
* Service managing overlay windows
|
|
1864
1975
|
*/
|
|
1865
1976
|
class OverlayWindowService {
|
|
1866
|
-
componentList;
|
|
1867
|
-
engineMagicService;
|
|
1868
|
-
magicLazyModuleLoader;
|
|
1869
|
-
injector;
|
|
1870
|
-
|
|
1871
|
-
|
|
1872
|
-
|
|
1873
|
-
constructor(componentList, engineMagicService, magicLazyModuleLoader, injector, compiler, overlayContainerMagicProvider, confirmationComponentsMagicProvider) {
|
|
1874
|
-
this.componentList = componentList;
|
|
1875
|
-
this.engineMagicService = engineMagicService;
|
|
1876
|
-
this.magicLazyModuleLoader = magicLazyModuleLoader;
|
|
1877
|
-
this.injector = injector;
|
|
1878
|
-
this.compiler = compiler;
|
|
1879
|
-
this.overlayContainerMagicProvider = overlayContainerMagicProvider;
|
|
1880
|
-
this.confirmationComponentsMagicProvider = confirmationComponentsMagicProvider;
|
|
1977
|
+
componentList = inject(ComponentListMagicService);
|
|
1978
|
+
engineMagicService = inject(EngineMagicService);
|
|
1979
|
+
magicLazyModuleLoader = inject(MagicLazyLoaderService);
|
|
1980
|
+
injector = inject(Injector);
|
|
1981
|
+
overlayContainerMagicProvider = inject(OverlayContainerMagicProvider);
|
|
1982
|
+
confirmationComponentsMagicProvider = inject(ConfirmationComponentsMagicProvider);
|
|
1983
|
+
constructor() {
|
|
1881
1984
|
}
|
|
1882
1985
|
// The view reference of container of overlay window
|
|
1883
1986
|
overlayWindowsContainerViewRef;
|
|
@@ -1898,8 +2001,7 @@ class OverlayWindowService {
|
|
|
1898
2001
|
// extract name of module(XX) from 'MagicXXModule'
|
|
1899
2002
|
const moduleName = lazyLoadModule.moduleName.slice(Magic.length, -Module.length);
|
|
1900
2003
|
this.magicLazyModuleLoader.Load(moduleName).then(m => {
|
|
1901
|
-
|
|
1902
|
-
moduleRef = compiled.ngModuleFactory.create(this.injector);
|
|
2004
|
+
moduleRef = createNgModule(m[lazyLoadModule.moduleName], this.injector);
|
|
1903
2005
|
this.open(formName, taskId, taskDescription);
|
|
1904
2006
|
this.finishConfirmation(Styles.MSGBOX_BUTTON_OK, true);
|
|
1905
2007
|
});
|
|
@@ -1980,13 +2082,15 @@ class OverlayWindowService {
|
|
|
1980
2082
|
// Create the UI component of modal window
|
|
1981
2083
|
let viewCRef = this.overlayWindowsContainerViewRef;
|
|
1982
2084
|
componentRef = viewCRef.createComponent(MagicOverlayContainerWrapper);
|
|
1983
|
-
// Set
|
|
1984
|
-
|
|
2085
|
+
// Set signal inputs via setInput() — direct property assignment would overwrite the signal functions
|
|
2086
|
+
componentRef.setInput('Component', magicModalContainerParameters.Component);
|
|
2087
|
+
componentRef.setInput('Parameters', magicModalContainerParameters.Parameters);
|
|
2088
|
+
componentRef.setInput('OverlayTypeParam', magicModalContainerParameters.OverlayTypeParam);
|
|
1985
2089
|
this.overlayWindowFocusManager.pushDialog(componentRef.instance.GetRootElement());
|
|
1986
2090
|
componentRef.instance.DetectChanges();
|
|
1987
2091
|
return componentRef;
|
|
1988
2092
|
}
|
|
1989
|
-
/** @nocollapse */ static ɵfac = function OverlayWindowService_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || OverlayWindowService)(
|
|
2093
|
+
/** @nocollapse */ static ɵfac = function OverlayWindowService_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || OverlayWindowService)(); };
|
|
1990
2094
|
/** @nocollapse */ static ɵprov = /** @pureOrBreakMyCode */ i0.ɵɵdefineInjectable({ token: OverlayWindowService, factory: OverlayWindowService.ɵfac, providedIn: 'root' });
|
|
1991
2095
|
}
|
|
1992
2096
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(OverlayWindowService, [{
|
|
@@ -1994,7 +2098,7 @@ class OverlayWindowService {
|
|
|
1994
2098
|
args: [{
|
|
1995
2099
|
providedIn: 'root'
|
|
1996
2100
|
}]
|
|
1997
|
-
}], () => [
|
|
2101
|
+
}], () => [], null); })();
|
|
1998
2102
|
class OverlayWindowFocusManager {
|
|
1999
2103
|
rootMagicElement = null;
|
|
2000
2104
|
openDialogList = new Array(0);
|
|
@@ -2119,8 +2223,6 @@ class DialogInfo {
|
|
|
2119
2223
|
* Main service to connect the UI with the Magic WebCLient
|
|
2120
2224
|
*/
|
|
2121
2225
|
class TaskMagicService {
|
|
2122
|
-
magic;
|
|
2123
|
-
overlayWindowService;
|
|
2124
2226
|
/**
|
|
2125
2227
|
* Service to provide table-related functionalities
|
|
2126
2228
|
*/
|
|
@@ -2192,13 +2294,9 @@ class TaskMagicService {
|
|
|
2192
2294
|
* @ignore
|
|
2193
2295
|
*/
|
|
2194
2296
|
oldPageSize = 0;
|
|
2195
|
-
|
|
2196
|
-
|
|
2197
|
-
|
|
2198
|
-
*/
|
|
2199
|
-
constructor(magic, overlayWindowService) {
|
|
2200
|
-
this.magic = magic;
|
|
2201
|
-
this.overlayWindowService = overlayWindowService;
|
|
2297
|
+
magic = inject(EngineMagicService);
|
|
2298
|
+
overlayWindowService = inject(OverlayWindowService);
|
|
2299
|
+
constructor() {
|
|
2202
2300
|
this.Records.setGuiTopIndex(0);
|
|
2203
2301
|
this.mgInputDateFormat = null;
|
|
2204
2302
|
}
|
|
@@ -2981,12 +3079,13 @@ class TaskMagicService {
|
|
|
2981
3079
|
}
|
|
2982
3080
|
/**
|
|
2983
3081
|
* Handle the Radio button "change" event
|
|
2984
|
-
* @param event The event received from the UI
|
|
2985
3082
|
* @param idx Id of the control raising the event
|
|
3083
|
+
* @param rowId Id of the row containing the control (defaults to '0' for non-table controls)
|
|
2986
3084
|
*/
|
|
2987
|
-
mgOnRadioSelectionChanged(idx) {
|
|
2988
|
-
|
|
2989
|
-
let
|
|
3085
|
+
mgOnRadioSelectionChanged(idx, rowId = '0') {
|
|
3086
|
+
// Fetch the Form Control for the specific table row (or row '0' for non-table child controls)
|
|
3087
|
+
let result = this.getFormControl(rowId, idx);
|
|
3088
|
+
let guiEvent = getGuiEventObj('selectionchanged', idx, +rowId);
|
|
2990
3089
|
if (typeof result.value !== 'number')
|
|
2991
3090
|
guiEvent.Value = result.value.index;
|
|
2992
3091
|
else
|
|
@@ -3061,29 +3160,22 @@ class TaskMagicService {
|
|
|
3061
3160
|
}
|
|
3062
3161
|
}
|
|
3063
3162
|
}
|
|
3064
|
-
/** @nocollapse */ static ɵfac = function TaskMagicService_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || TaskMagicService)(
|
|
3163
|
+
/** @nocollapse */ static ɵfac = function TaskMagicService_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || TaskMagicService)(); };
|
|
3065
3164
|
/** @nocollapse */ static ɵprov = /** @pureOrBreakMyCode */ i0.ɵɵdefineInjectable({ token: TaskMagicService, factory: TaskMagicService.ɵfac });
|
|
3066
3165
|
}
|
|
3067
3166
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(TaskMagicService, [{
|
|
3068
3167
|
type: Injectable
|
|
3069
|
-
}], () => [
|
|
3168
|
+
}], () => [], null); })();
|
|
3070
3169
|
|
|
3071
3170
|
/**
|
|
3072
3171
|
* Implements various table-related functionalities
|
|
3073
3172
|
*/
|
|
3074
3173
|
class TableMagicService {
|
|
3075
|
-
componentList;
|
|
3076
|
-
task;
|
|
3077
3174
|
selectedItem;
|
|
3078
3175
|
chunkSize;
|
|
3079
|
-
|
|
3080
|
-
|
|
3081
|
-
|
|
3082
|
-
* @param task Magic task service
|
|
3083
|
-
*/
|
|
3084
|
-
constructor(componentList, task) {
|
|
3085
|
-
this.componentList = componentList;
|
|
3086
|
-
this.task = task;
|
|
3176
|
+
componentList = inject(ComponentListMagicService);
|
|
3177
|
+
task = inject(TaskMagicService);
|
|
3178
|
+
constructor() {
|
|
3087
3179
|
}
|
|
3088
3180
|
shouldOpenFieldTextEditor = true;
|
|
3089
3181
|
/**
|
|
@@ -3193,24 +3285,19 @@ class TableMagicService {
|
|
|
3193
3285
|
topIndex--;
|
|
3194
3286
|
return topIndex;
|
|
3195
3287
|
}
|
|
3196
|
-
/** @nocollapse */ static ɵfac = function TableMagicService_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || TableMagicService)(
|
|
3288
|
+
/** @nocollapse */ static ɵfac = function TableMagicService_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || TableMagicService)(); };
|
|
3197
3289
|
/** @nocollapse */ static ɵprov = /** @pureOrBreakMyCode */ i0.ɵɵdefineInjectable({ token: TableMagicService, factory: TableMagicService.ɵfac });
|
|
3198
3290
|
}
|
|
3199
3291
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(TableMagicService, [{
|
|
3200
3292
|
type: Injectable
|
|
3201
|
-
}], () => [
|
|
3293
|
+
}], () => [], null); })();
|
|
3202
3294
|
|
|
3203
3295
|
/**
|
|
3204
3296
|
* Enables changing the browser title using Magic expression (SetTitle)
|
|
3205
3297
|
*/
|
|
3206
3298
|
class TitleMagicService {
|
|
3207
|
-
titleService;
|
|
3208
|
-
|
|
3209
|
-
*
|
|
3210
|
-
* @param titleService Angular's title-changing class
|
|
3211
|
-
*/
|
|
3212
|
-
constructor(titleService) {
|
|
3213
|
-
this.titleService = titleService;
|
|
3299
|
+
titleService = inject(Title);
|
|
3300
|
+
constructor() {
|
|
3214
3301
|
}
|
|
3215
3302
|
/**
|
|
3216
3303
|
* Set the new title of the window
|
|
@@ -3219,12 +3306,12 @@ class TitleMagicService {
|
|
|
3219
3306
|
setTitle(newTitle) {
|
|
3220
3307
|
this.titleService.setTitle(newTitle);
|
|
3221
3308
|
}
|
|
3222
|
-
/** @nocollapse */ static ɵfac = function TitleMagicService_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || TitleMagicService)(
|
|
3309
|
+
/** @nocollapse */ static ɵfac = function TitleMagicService_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || TitleMagicService)(); };
|
|
3223
3310
|
/** @nocollapse */ static ɵprov = /** @pureOrBreakMyCode */ i0.ɵɵdefineInjectable({ token: TitleMagicService, factory: TitleMagicService.ɵfac });
|
|
3224
3311
|
}
|
|
3225
3312
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(TitleMagicService, [{
|
|
3226
3313
|
type: Injectable
|
|
3227
|
-
}], () => [
|
|
3314
|
+
}], () => [], null); })();
|
|
3228
3315
|
|
|
3229
3316
|
let COLOR_FILE_NAME = new InjectionToken('colorFile', {
|
|
3230
3317
|
providedIn: 'root',
|
|
@@ -3237,7 +3324,6 @@ const SYSTEM_BG = 4;
|
|
|
3237
3324
|
const SYSTEM_FG_AND_SYSTEM_BG = 6;
|
|
3238
3325
|
const TRANSPERENT_BG = 1;
|
|
3239
3326
|
class MagicColorService {
|
|
3240
|
-
http;
|
|
3241
3327
|
colorFileName = 'clr_rnt.eng';
|
|
3242
3328
|
getColorFilePath() {
|
|
3243
3329
|
return 'assets/' + this.colorFileName;
|
|
@@ -3245,10 +3331,11 @@ class MagicColorService {
|
|
|
3245
3331
|
colorsData;
|
|
3246
3332
|
fileNotFound = false;
|
|
3247
3333
|
// public static FILE_NAME;
|
|
3248
|
-
|
|
3249
|
-
|
|
3250
|
-
|
|
3251
|
-
|
|
3334
|
+
http = inject(HttpClient);
|
|
3335
|
+
colorFile1 = inject(COLOR_FILE_NAME);
|
|
3336
|
+
constructor() {
|
|
3337
|
+
if (this.colorFile1)
|
|
3338
|
+
this.colorFileName = this.colorFile1;
|
|
3252
3339
|
else
|
|
3253
3340
|
this.colorFileName = 'clr_rnt.eng';
|
|
3254
3341
|
}
|
|
@@ -3320,7 +3407,7 @@ class MagicColorService {
|
|
|
3320
3407
|
}
|
|
3321
3408
|
return '';
|
|
3322
3409
|
}
|
|
3323
|
-
/** @nocollapse */ static ɵfac = function MagicColorService_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || MagicColorService)(
|
|
3410
|
+
/** @nocollapse */ static ɵfac = function MagicColorService_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || MagicColorService)(); };
|
|
3324
3411
|
/** @nocollapse */ static ɵprov = /** @pureOrBreakMyCode */ i0.ɵɵdefineInjectable({ token: MagicColorService, factory: MagicColorService.ɵfac, providedIn: 'root' });
|
|
3325
3412
|
}
|
|
3326
3413
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(MagicColorService, [{
|
|
@@ -3328,26 +3415,21 @@ class MagicColorService {
|
|
|
3328
3415
|
args: [{
|
|
3329
3416
|
providedIn: 'root'
|
|
3330
3417
|
}]
|
|
3331
|
-
}], () => [
|
|
3332
|
-
type: Inject,
|
|
3333
|
-
args: [COLOR_FILE_NAME]
|
|
3334
|
-
}] }], null); })();
|
|
3418
|
+
}], () => [], null); })();
|
|
3335
3419
|
|
|
3336
3420
|
/**
|
|
3337
3421
|
* Provides the UI with values calculated by the Magic WebClient
|
|
3338
3422
|
*/
|
|
3339
3423
|
class AccessorMagicService {
|
|
3340
|
-
task;
|
|
3341
|
-
magicColor;
|
|
3342
3424
|
Logger = null;
|
|
3343
3425
|
hhmm = maskitoTimeOptionsGenerator({ mode: 'HH:MM' });
|
|
3344
3426
|
hhmmss = maskitoTimeOptionsGenerator({ mode: 'HH:MM:SS' });
|
|
3427
|
+
task = inject(TaskMagicService);
|
|
3428
|
+
magicColor = inject(MagicColorService);
|
|
3345
3429
|
/**
|
|
3346
3430
|
* @ignore
|
|
3347
3431
|
*/
|
|
3348
|
-
constructor(
|
|
3349
|
-
this.task = task;
|
|
3350
|
-
this.magicColor = magicColor;
|
|
3432
|
+
constructor() {
|
|
3351
3433
|
this.Logger = Logger.Instance;
|
|
3352
3434
|
}
|
|
3353
3435
|
UploadFileToServer(fileContent, serverFileName) {
|
|
@@ -3448,6 +3530,19 @@ class AccessorMagicService {
|
|
|
3448
3530
|
let vis = this.getProperty(controlId, HtmlProperties.Visible, rowId);
|
|
3449
3531
|
return vis ? 'visible' : 'hidden';
|
|
3450
3532
|
}
|
|
3533
|
+
/**
|
|
3534
|
+
* Returns whether a control is visible or not
|
|
3535
|
+
* @param controlId Id of control
|
|
3536
|
+
* @param rowId Id of row, if applicable
|
|
3537
|
+
* @returns true if the control is visible, false otherwise
|
|
3538
|
+
*/
|
|
3539
|
+
// mgIsVisible
|
|
3540
|
+
isVisible(controlId, rowId) {
|
|
3541
|
+
// The value is not always a boolean: getProperty() returns '' if the control has not sent its
|
|
3542
|
+
// Visible property yet, and undefined if the row does not exist. Comparing with === true turns
|
|
3543
|
+
// both into false. getVisible() behaves the same way - for those values it returns 'hidden'.
|
|
3544
|
+
return this.getProperty(controlId, HtmlProperties.Visible, rowId) === true;
|
|
3545
|
+
}
|
|
3451
3546
|
/**
|
|
3452
3547
|
* Returns alpha mask of a control
|
|
3453
3548
|
* @param controlId Id of control
|
|
@@ -3960,49 +4055,42 @@ class AccessorMagicService {
|
|
|
3960
4055
|
getColor(colorNumber, colorType) {
|
|
3961
4056
|
return this.magicColor.getColor(colorNumber, colorType);
|
|
3962
4057
|
}
|
|
3963
|
-
/** @nocollapse */ static ɵfac = function AccessorMagicService_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || AccessorMagicService)(
|
|
4058
|
+
/** @nocollapse */ static ɵfac = function AccessorMagicService_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || AccessorMagicService)(); };
|
|
3964
4059
|
/** @nocollapse */ static ɵprov = /** @pureOrBreakMyCode */ i0.ɵɵdefineInjectable({ token: AccessorMagicService, factory: AccessorMagicService.ɵfac });
|
|
3965
4060
|
}
|
|
3966
4061
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(AccessorMagicService, [{
|
|
3967
4062
|
type: Injectable
|
|
3968
|
-
}], () => [
|
|
4063
|
+
}], () => [], null); })();
|
|
3969
4064
|
|
|
3970
4065
|
/**
|
|
3971
4066
|
* Central place for adding the Magic services
|
|
3972
4067
|
*/
|
|
3973
4068
|
class MagicServices {
|
|
3974
|
-
task;
|
|
3975
|
-
subformService;
|
|
3976
|
-
tableService;
|
|
3977
|
-
titleService;
|
|
3978
|
-
mgAccessorService;
|
|
4069
|
+
task = inject(TaskMagicService);
|
|
4070
|
+
subformService = inject(SubformMagicService);
|
|
4071
|
+
tableService = inject(TableMagicService);
|
|
4072
|
+
titleService = inject(TitleMagicService);
|
|
4073
|
+
mgAccessorService = inject(AccessorMagicService);
|
|
3979
4074
|
/**
|
|
3980
4075
|
* @ignore
|
|
3981
4076
|
*/
|
|
3982
|
-
constructor(
|
|
3983
|
-
this.task =
|
|
3984
|
-
this.
|
|
3985
|
-
this.
|
|
3986
|
-
this.
|
|
3987
|
-
|
|
3988
|
-
|
|
3989
|
-
task.mgSubformService = subformService;
|
|
3990
|
-
task.mgTitleService = titleService;
|
|
3991
|
-
task.mgAccessorService = mgAccessorService;
|
|
3992
|
-
}
|
|
3993
|
-
/** @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)); };
|
|
4077
|
+
constructor() {
|
|
4078
|
+
this.task.tableService = this.tableService;
|
|
4079
|
+
this.task.mgSubformService = this.subformService;
|
|
4080
|
+
this.task.mgTitleService = this.titleService;
|
|
4081
|
+
this.task.mgAccessorService = this.mgAccessorService;
|
|
4082
|
+
}
|
|
4083
|
+
/** @nocollapse */ static ɵfac = function MagicServices_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || MagicServices)(); };
|
|
3994
4084
|
/** @nocollapse */ static ɵprov = /** @pureOrBreakMyCode */ i0.ɵɵdefineInjectable({ token: MagicServices, factory: MagicServices.ɵfac });
|
|
3995
4085
|
}
|
|
3996
4086
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(MagicServices, [{
|
|
3997
4087
|
type: Injectable
|
|
3998
|
-
}], () => [
|
|
4088
|
+
}], () => [], null); })();
|
|
3999
4089
|
|
|
4000
4090
|
/**
|
|
4001
4091
|
* Base component representing a Magic task
|
|
4002
4092
|
*/
|
|
4003
4093
|
class TaskBaseMagicComponent {
|
|
4004
|
-
ref;
|
|
4005
|
-
magicServices;
|
|
4006
4094
|
/**
|
|
4007
4095
|
* Id of task, used for initializing the task service
|
|
4008
4096
|
*/
|
|
@@ -4015,15 +4103,24 @@ class TaskBaseMagicComponent {
|
|
|
4015
4103
|
* @ignore
|
|
4016
4104
|
*/
|
|
4017
4105
|
magicProperties = MagicProperties;
|
|
4106
|
+
/**
|
|
4107
|
+
* @ignore
|
|
4108
|
+
* Injected as fields rather than constructor parameters, so that the constructor
|
|
4109
|
+
* signature of this base class - which every generated component inherits - is unchanged.
|
|
4110
|
+
*/
|
|
4111
|
+
magicChangeDetection = inject(MagicChangeDetectionService);
|
|
4112
|
+
/**
|
|
4113
|
+
* @ignore
|
|
4114
|
+
*/
|
|
4115
|
+
destroyRef = inject(DestroyRef);
|
|
4116
|
+
ref = inject(ChangeDetectorRef);
|
|
4117
|
+
magicServices = inject(MagicServices);
|
|
4018
4118
|
/**
|
|
4019
4119
|
*
|
|
4020
4120
|
* @param ref changes-detector object
|
|
4021
4121
|
* @param magicServices Access point for all Magic services
|
|
4022
4122
|
*/
|
|
4023
|
-
constructor(
|
|
4024
|
-
this.ref = ref;
|
|
4025
|
-
this.magicServices = magicServices;
|
|
4026
|
-
}
|
|
4123
|
+
constructor() { }
|
|
4027
4124
|
/**
|
|
4028
4125
|
* Returns the Magic task service
|
|
4029
4126
|
* @returns
|
|
@@ -4073,6 +4170,14 @@ class TaskBaseMagicComponent {
|
|
|
4073
4170
|
this.task.detectChanges.pipe().subscribe(c => {
|
|
4074
4171
|
this.ref.detectChanges();
|
|
4075
4172
|
});
|
|
4173
|
+
// Running zoneless, nothing refreshes this view unless Angular is told to.
|
|
4174
|
+
// MagicChangeDetectionService is application-scoped and never completes, so this
|
|
4175
|
+
// subscription must be tied to the component's lifetime.
|
|
4176
|
+
this.magicChangeDetection.changed
|
|
4177
|
+
.pipe(takeUntilDestroyed(this.destroyRef))
|
|
4178
|
+
.subscribe(() => {
|
|
4179
|
+
this.ref.markForCheck();
|
|
4180
|
+
});
|
|
4076
4181
|
this.task.initTask(this.taskIdParam, this.taskDescription);
|
|
4077
4182
|
this.createFormControlsAccessor(this.screenFormGroup);
|
|
4078
4183
|
this.setInputDateFormat();
|
|
@@ -4146,8 +4251,8 @@ class TaskBaseMagicComponent {
|
|
|
4146
4251
|
ngOnDestroy() {
|
|
4147
4252
|
this.task.dispose();
|
|
4148
4253
|
}
|
|
4149
|
-
/** @nocollapse */ static ɵfac = function TaskBaseMagicComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || TaskBaseMagicComponent)(
|
|
4150
|
-
/** @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 });
|
|
4254
|
+
/** @nocollapse */ static ɵfac = function TaskBaseMagicComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || TaskBaseMagicComponent)(); };
|
|
4255
|
+
/** @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 });
|
|
4151
4256
|
}
|
|
4152
4257
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(TaskBaseMagicComponent, [{
|
|
4153
4258
|
type: Component,
|
|
@@ -4155,21 +4260,20 @@ class TaskBaseMagicComponent {
|
|
|
4155
4260
|
selector: 'task-magic',
|
|
4156
4261
|
providers: [TaskMagicService, SubformMagicService, TableMagicService],
|
|
4157
4262
|
template: '',
|
|
4263
|
+
changeDetection: ChangeDetectionStrategy.Eager,
|
|
4158
4264
|
standalone: false
|
|
4159
4265
|
}]
|
|
4160
|
-
}], () => [
|
|
4266
|
+
}], () => [], { taskIdParam: [{
|
|
4161
4267
|
type: Input
|
|
4162
4268
|
}], taskDescription: [{
|
|
4163
4269
|
type: Input
|
|
4164
4270
|
}] }); })();
|
|
4165
|
-
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(TaskBaseMagicComponent, { className: "TaskBaseMagicComponent", filePath: "src/ui/task-base.magic.component.ts", lineNumber:
|
|
4271
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(TaskBaseMagicComponent, { className: "TaskBaseMagicComponent", filePath: "src/ui/task-base.magic.component.ts", lineNumber: 24 }); })();
|
|
4166
4272
|
|
|
4167
4273
|
/**
|
|
4168
4274
|
* @ignore
|
|
4169
4275
|
*/
|
|
4170
4276
|
class RowMagicDirective {
|
|
4171
|
-
_task;
|
|
4172
|
-
element;
|
|
4173
4277
|
rowId;
|
|
4174
4278
|
/**
|
|
4175
4279
|
* The HTML element connected to this directive
|
|
@@ -4179,9 +4283,9 @@ class RowMagicDirective {
|
|
|
4179
4283
|
* @ignore
|
|
4180
4284
|
*/
|
|
4181
4285
|
rowChangedSubscriber = null;
|
|
4182
|
-
|
|
4183
|
-
|
|
4184
|
-
|
|
4286
|
+
_task = inject(TaskMagicService);
|
|
4287
|
+
element = inject(ElementRef);
|
|
4288
|
+
constructor() {
|
|
4185
4289
|
this.htmlElement = this.element.nativeElement;
|
|
4186
4290
|
}
|
|
4187
4291
|
/**
|
|
@@ -4222,7 +4326,7 @@ class RowMagicDirective {
|
|
|
4222
4326
|
event.cancelBubble = true;
|
|
4223
4327
|
}
|
|
4224
4328
|
}
|
|
4225
|
-
/** @nocollapse */ static ɵfac = function RowMagicDirective_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || RowMagicDirective)(
|
|
4329
|
+
/** @nocollapse */ static ɵfac = function RowMagicDirective_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || RowMagicDirective)(); };
|
|
4226
4330
|
/** @nocollapse */ static ɵdir = /** @pureOrBreakMyCode */ i0.ɵɵdefineDirective({ type: RowMagicDirective, selectors: [["", "magicRow", ""]], hostBindings: function RowMagicDirective_HostBindings(rf, ctx) { if (rf & 1) {
|
|
4227
4331
|
i0.ɵɵlistener("click", function RowMagicDirective_click_HostBindingHandler($event) { return ctx.onClick($event); });
|
|
4228
4332
|
} }, inputs: { rowId: [0, "magicRow", "rowId"] }, standalone: false });
|
|
@@ -4233,7 +4337,7 @@ class RowMagicDirective {
|
|
|
4233
4337
|
selector: '[magicRow]',
|
|
4234
4338
|
standalone: false
|
|
4235
4339
|
}]
|
|
4236
|
-
}], () => [
|
|
4340
|
+
}], () => [], { rowId: [{
|
|
4237
4341
|
type: Input,
|
|
4238
4342
|
args: ['magicRow']
|
|
4239
4343
|
}], onClick: [{
|
|
@@ -4245,12 +4349,6 @@ class RowMagicDirective {
|
|
|
4245
4349
|
* Connects HTML elements to the Magic Web Client engine
|
|
4246
4350
|
*/
|
|
4247
4351
|
class MagicDirective {
|
|
4248
|
-
_task;
|
|
4249
|
-
element;
|
|
4250
|
-
renderer;
|
|
4251
|
-
vcRef;
|
|
4252
|
-
platform;
|
|
4253
|
-
magicRow;
|
|
4254
4352
|
set magic(val) {
|
|
4255
4353
|
this.id = val;
|
|
4256
4354
|
this.selector = "magic";
|
|
@@ -4314,21 +4412,15 @@ class MagicDirective {
|
|
|
4314
4412
|
* @param platform
|
|
4315
4413
|
* @param magicRow
|
|
4316
4414
|
*/
|
|
4317
|
-
constructor(
|
|
4318
|
-
this._task = _task;
|
|
4319
|
-
this.element = element;
|
|
4320
|
-
this.renderer = renderer;
|
|
4321
|
-
this.vcRef = vcRef;
|
|
4322
|
-
this.platform = platform;
|
|
4323
|
-
this.magicRow = magicRow;
|
|
4415
|
+
constructor() {
|
|
4324
4416
|
this.htmlElement = this.element.nativeElement;
|
|
4325
4417
|
//let c = (<any>this.vcRef)._view;
|
|
4326
4418
|
//while (!(c instanceof TaskBaseMagicComponent)) {
|
|
4327
4419
|
// c = c.component;
|
|
4328
4420
|
//}
|
|
4329
4421
|
//this.component = c;
|
|
4330
|
-
if (!(typeof magicRow === "undefined" || magicRow === null))
|
|
4331
|
-
this.rowId = magicRow.rowId;
|
|
4422
|
+
if (!(typeof this.magicRow === "undefined" || this.magicRow === null))
|
|
4423
|
+
this.rowId = this.magicRow.rowId;
|
|
4332
4424
|
}
|
|
4333
4425
|
/**
|
|
4334
4426
|
* Get the task service
|
|
@@ -4337,6 +4429,12 @@ class MagicDirective {
|
|
|
4337
4429
|
get task() {
|
|
4338
4430
|
return this._task;
|
|
4339
4431
|
}
|
|
4432
|
+
_task = inject(TaskMagicService);
|
|
4433
|
+
element = inject(ElementRef);
|
|
4434
|
+
renderer = inject(Renderer2);
|
|
4435
|
+
vcRef = inject(ViewContainerRef);
|
|
4436
|
+
platform = inject(Platform);
|
|
4437
|
+
magicRow = inject(RowMagicDirective, { optional: true });
|
|
4340
4438
|
/**
|
|
4341
4439
|
* Register to the events this element may need to handle
|
|
4342
4440
|
*/
|
|
@@ -4539,7 +4637,7 @@ class MagicDirective {
|
|
|
4539
4637
|
ngOnDestroy() {
|
|
4540
4638
|
this.subscribeRefreshDom.unsubscribe();
|
|
4541
4639
|
}
|
|
4542
|
-
/** @nocollapse */ static ɵfac = function MagicDirective_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || MagicDirective)(
|
|
4640
|
+
/** @nocollapse */ static ɵfac = function MagicDirective_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || MagicDirective)(); };
|
|
4543
4641
|
/** @nocollapse */ static ɵdir = /** @pureOrBreakMyCode */ i0.ɵɵdefineDirective({ type: MagicDirective, selectors: [["", "magic", ""]], inputs: { magic: "magic", eventsOnly: "eventsOnly", pollTime: "pollTime", rowId: "rowId" }, standalone: false });
|
|
4544
4642
|
}
|
|
4545
4643
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(MagicDirective, [{
|
|
@@ -4548,9 +4646,7 @@ class MagicDirective {
|
|
|
4548
4646
|
selector: "[magic]",
|
|
4549
4647
|
standalone: false
|
|
4550
4648
|
}]
|
|
4551
|
-
}], () => [
|
|
4552
|
-
type: Optional
|
|
4553
|
-
}] }], { magic: [{
|
|
4649
|
+
}], () => [], { magic: [{
|
|
4554
4650
|
type: Input,
|
|
4555
4651
|
args: ["magic"]
|
|
4556
4652
|
}], eventsOnly: [{
|
|
@@ -4568,9 +4664,15 @@ class MagicDirective {
|
|
|
4568
4664
|
class NoControlMagicDirective extends MagicDirective {
|
|
4569
4665
|
set magic(val) { this.id = val; this.selector = 'magicnc'; }
|
|
4570
4666
|
;
|
|
4571
|
-
constructor(
|
|
4572
|
-
super(
|
|
4667
|
+
constructor() {
|
|
4668
|
+
super();
|
|
4573
4669
|
}
|
|
4670
|
+
_task = inject(TaskMagicService);
|
|
4671
|
+
element = inject(ElementRef);
|
|
4672
|
+
renderer = inject(Renderer2);
|
|
4673
|
+
vcRef = inject(ViewContainerRef);
|
|
4674
|
+
platform = inject(Platform);
|
|
4675
|
+
magicRow = inject(RowMagicDirective, { optional: true });
|
|
4574
4676
|
regEvents() {
|
|
4575
4677
|
super.regEvents();
|
|
4576
4678
|
if (this.htmlElement instanceof HTMLSelectElement) {
|
|
@@ -4737,7 +4839,7 @@ class NoControlMagicDirective extends MagicDirective {
|
|
|
4737
4839
|
break;
|
|
4738
4840
|
}
|
|
4739
4841
|
}
|
|
4740
|
-
/** @nocollapse */ static ɵfac = function NoControlMagicDirective_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || NoControlMagicDirective)(
|
|
4842
|
+
/** @nocollapse */ static ɵfac = function NoControlMagicDirective_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || NoControlMagicDirective)(); };
|
|
4741
4843
|
/** @nocollapse */ static ɵdir = /** @pureOrBreakMyCode */ i0.ɵɵdefineDirective({ type: NoControlMagicDirective, selectors: [["", "magicnc", ""]], inputs: { magic: [0, "magicnc", "magic"] }, standalone: false, features: [i0.ɵɵInheritDefinitionFeature] });
|
|
4742
4844
|
}
|
|
4743
4845
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(NoControlMagicDirective, [{
|
|
@@ -4746,9 +4848,7 @@ class NoControlMagicDirective extends MagicDirective {
|
|
|
4746
4848
|
selector: '[magicnc]',
|
|
4747
4849
|
standalone: false
|
|
4748
4850
|
}]
|
|
4749
|
-
}], () => [
|
|
4750
|
-
type: Optional
|
|
4751
|
-
}] }], { magic: [{
|
|
4851
|
+
}], () => [], { magic: [{
|
|
4752
4852
|
type: Input,
|
|
4753
4853
|
args: ['magicnc']
|
|
4754
4854
|
}] }); })();
|
|
@@ -4763,10 +4863,9 @@ class Constants {
|
|
|
4763
4863
|
* @ignore
|
|
4764
4864
|
*/
|
|
4765
4865
|
class DateMagicPipe extends DatePipe {
|
|
4766
|
-
_task;
|
|
4767
|
-
constructor(
|
|
4866
|
+
_task = inject(TaskMagicService);
|
|
4867
|
+
constructor() {
|
|
4768
4868
|
super('en-US');
|
|
4769
|
-
this._task = _task;
|
|
4770
4869
|
}
|
|
4771
4870
|
transform(value, controlId) {
|
|
4772
4871
|
let mask = this._task.GetControlPictureMask(controlId).getMask();
|
|
@@ -4787,7 +4886,7 @@ class DateMagicPipe extends DatePipe {
|
|
|
4787
4886
|
value = "";
|
|
4788
4887
|
return value;
|
|
4789
4888
|
}
|
|
4790
|
-
/** @nocollapse */ static ɵfac = function DateMagicPipe_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || DateMagicPipe)(
|
|
4889
|
+
/** @nocollapse */ static ɵfac = function DateMagicPipe_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || DateMagicPipe)(); };
|
|
4791
4890
|
/** @nocollapse */ static ɵpipe = /** @pureOrBreakMyCode */ i0.ɵɵdefinePipe({ name: "magicDate", type: DateMagicPipe, pure: true, standalone: false });
|
|
4792
4891
|
}
|
|
4793
4892
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(DateMagicPipe, [{
|
|
@@ -4796,7 +4895,7 @@ class DateMagicPipe extends DatePipe {
|
|
|
4796
4895
|
name: 'magicDate',
|
|
4797
4896
|
standalone: false
|
|
4798
4897
|
}]
|
|
4799
|
-
}], () => [
|
|
4898
|
+
}], () => [], null); })();
|
|
4800
4899
|
class MgDateFormatter {
|
|
4801
4900
|
ConvertMgDateFormatToAngular(mgDateMask) {
|
|
4802
4901
|
let formatStr = new StringBuilder();
|
|
@@ -4864,16 +4963,15 @@ class MgDateFormatter {
|
|
|
4864
4963
|
* Perform Magic validation on input controls which hold alphanumeric strings
|
|
4865
4964
|
*/
|
|
4866
4965
|
class MgformatMagicDirective {
|
|
4867
|
-
magicDir;
|
|
4868
|
-
_task;
|
|
4869
4966
|
datePasteFlag = false;
|
|
4967
|
+
caretPosAfterMinus = null;
|
|
4968
|
+
currencyConfig = inject(NGX_CURRENCY_CONFIG, { optional: true });
|
|
4969
|
+
magicDir = inject(MagicDirective);
|
|
4970
|
+
_task = inject(TaskMagicService);
|
|
4870
4971
|
/**
|
|
4871
4972
|
* @ignore
|
|
4872
4973
|
*/
|
|
4873
|
-
constructor(
|
|
4874
|
-
this.magicDir = magicDir;
|
|
4875
|
-
this._task = _task;
|
|
4876
|
-
}
|
|
4974
|
+
constructor() { }
|
|
4877
4975
|
ngAfterViewInit() {
|
|
4878
4976
|
let control = this._task.getFormControl(this.magicDir.rowId, this.magicDir.id);
|
|
4879
4977
|
if (control != null && this._task.mgInputDateFormat == null) {
|
|
@@ -4903,6 +5001,24 @@ class MgformatMagicDirective {
|
|
|
4903
5001
|
*/
|
|
4904
5002
|
this.datePasteFlag = true;
|
|
4905
5003
|
}
|
|
5004
|
+
/**
|
|
5005
|
+
* ngx-currency moves the cursor to the end when '-' is typed, so fix the cursor position.
|
|
5006
|
+
* Only Natural input mode needs this. In Financial mode digits are entered
|
|
5007
|
+
* from the right, so the cursor at the end already works.
|
|
5008
|
+
*/
|
|
5009
|
+
onBeforeInputEvent(event) {
|
|
5010
|
+
if (event.data == '-') {
|
|
5011
|
+
// Cleared first, so a position saved for an earlier '-' is not used again.
|
|
5012
|
+
this.caretPosAfterMinus = null;
|
|
5013
|
+
// A value that is already negative does not change, so there is nothing to fix.
|
|
5014
|
+
// This change applies only to Natural mode, since digits are entered from left to right and nothing more can be entered once the cursor reaches the far right.
|
|
5015
|
+
if (this.currencyConfig?.inputMode == NgxCurrencyInputMode.Natural && !event.target.value.startsWith('-')) {
|
|
5016
|
+
let attr = this._task.Records.list[0].getControlMetadata(this.magicDir.id).dataType;
|
|
5017
|
+
if (attr == StorageAttribute.NUMERIC)
|
|
5018
|
+
this.saveCaretPosition(event.target);
|
|
5019
|
+
}
|
|
5020
|
+
}
|
|
5021
|
+
}
|
|
4906
5022
|
onInputEvent(event) {
|
|
4907
5023
|
let attr = this._task.Records.list[0].getControlMetadata(this.magicDir.id).dataType;
|
|
4908
5024
|
if (attr == StorageAttribute.DATE) {
|
|
@@ -4910,8 +5026,38 @@ class MgformatMagicDirective {
|
|
|
4910
5026
|
this.dateMasking(event);
|
|
4911
5027
|
this.datePasteFlag = false;
|
|
4912
5028
|
}
|
|
5029
|
+
else if (attr == StorageAttribute.NUMERIC) {
|
|
5030
|
+
// '-' was typed and beforeinput saved where the cursor must go.
|
|
5031
|
+
// ngx-currency's input handler may run after this one, so wait until it is done.
|
|
5032
|
+
if (event.data == '-' && this.caretPosAfterMinus != null) {
|
|
5033
|
+
setTimeout(() => event.target.setSelectionRange(this.caretPosAfterMinus, this.caretPosAfterMinus));
|
|
5034
|
+
}
|
|
5035
|
+
}
|
|
4913
5036
|
this.calculatePattern();
|
|
4914
5037
|
}
|
|
5038
|
+
/**
|
|
5039
|
+
* Saves where the cursor must go after '-' is typed in a numeric control.
|
|
5040
|
+
* The cursor can't be set here: ngx-currency adds the '-' on the input event,
|
|
5041
|
+
* which comes after this one, and moves the cursor to the end.
|
|
5042
|
+
* @param input The input control
|
|
5043
|
+
*/
|
|
5044
|
+
saveCaretPosition(input) {
|
|
5045
|
+
// /[1-9]/ matches any single digit from 1 to 9, and test() returns true
|
|
5046
|
+
// if the value contains at least one of them. '!' turns that around, so
|
|
5047
|
+
// isZero is true when every digit is 0, e.g. '0.00' or '$ 0.00', or the value is empty.
|
|
5048
|
+
// Number(value) can't be used, as the text may hold a prefix or separators.
|
|
5049
|
+
const isZero = !/[1-9]/.test(input.value);
|
|
5050
|
+
// isZero handles the case where the user clears the control and types -.
|
|
5051
|
+
// After clearing, the control is empty or shows 0.00; on - ngx-currency shows -0.00 with the cursor at the far right,
|
|
5052
|
+
// and in Natural mode no digits can be typed there. So the cursor must go before the decimal point (-0|.00),
|
|
5053
|
+
// typing 5 and 2 gives -52.00.
|
|
5054
|
+
if (isZero && input.selectionStart === 0)
|
|
5055
|
+
this.caretPosAfterMinus = 2;
|
|
5056
|
+
else
|
|
5057
|
+
// '-' is added in front of the value: put the cursor back where it was,
|
|
5058
|
+
// moved one place right for the added '-'
|
|
5059
|
+
this.caretPosAfterMinus = input.selectionStart + 1;
|
|
5060
|
+
}
|
|
4915
5061
|
//This method inserts '/' as a separator while entering date in the textbox.
|
|
4916
5062
|
//Example: 10/10/2023
|
|
4917
5063
|
dateMasking(event) {
|
|
@@ -5467,9 +5613,9 @@ class MgformatMagicDirective {
|
|
|
5467
5613
|
return true;
|
|
5468
5614
|
return false;
|
|
5469
5615
|
}
|
|
5470
|
-
/** @nocollapse */ static ɵfac = function MgformatMagicDirective_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || MgformatMagicDirective)(
|
|
5616
|
+
/** @nocollapse */ static ɵfac = function MgformatMagicDirective_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || MgformatMagicDirective)(); };
|
|
5471
5617
|
/** @nocollapse */ static ɵdir = /** @pureOrBreakMyCode */ i0.ɵɵdefineDirective({ type: MgformatMagicDirective, selectors: [["", "mgFormat", ""]], hostBindings: function MgformatMagicDirective_HostBindings(rf, ctx) { if (rf & 1) {
|
|
5472
|
-
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); });
|
|
5618
|
+
i0.ɵɵlistener("focus", function MgformatMagicDirective_focus_HostBindingHandler($event) { return ctx.onFocusEvent($event); })("paste", function MgformatMagicDirective_paste_HostBindingHandler($event) { return ctx.onPaste($event); })("beforeinput", function MgformatMagicDirective_beforeinput_HostBindingHandler($event) { return ctx.onBeforeInputEvent($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); });
|
|
5473
5619
|
} }, standalone: false });
|
|
5474
5620
|
}
|
|
5475
5621
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(MgformatMagicDirective, [{
|
|
@@ -5478,12 +5624,15 @@ class MgformatMagicDirective {
|
|
|
5478
5624
|
selector: '[mgFormat]',
|
|
5479
5625
|
standalone: false
|
|
5480
5626
|
}]
|
|
5481
|
-
}], () => [
|
|
5627
|
+
}], () => [], { onFocusEvent: [{
|
|
5482
5628
|
type: HostListener,
|
|
5483
5629
|
args: ['focus', ['$event']]
|
|
5484
5630
|
}], onPaste: [{
|
|
5485
5631
|
type: HostListener,
|
|
5486
5632
|
args: ['paste', ['$event']]
|
|
5633
|
+
}], onBeforeInputEvent: [{
|
|
5634
|
+
type: HostListener,
|
|
5635
|
+
args: ['beforeinput', ['$event']]
|
|
5487
5636
|
}], onInputEvent: [{
|
|
5488
5637
|
type: HostListener,
|
|
5489
5638
|
args: ['input', ['$event']]
|
|
@@ -5499,10 +5648,9 @@ class MgformatMagicDirective {
|
|
|
5499
5648
|
* @ignore
|
|
5500
5649
|
*/
|
|
5501
5650
|
class TimeMagicPipe extends DatePipe {
|
|
5502
|
-
_task;
|
|
5503
|
-
constructor(
|
|
5651
|
+
_task = inject(TaskMagicService);
|
|
5652
|
+
constructor() {
|
|
5504
5653
|
super('en-US');
|
|
5505
|
-
this._task = _task;
|
|
5506
5654
|
}
|
|
5507
5655
|
transform(value, controlId) {
|
|
5508
5656
|
let mask = this._task.GetControlPictureMask(controlId).getMask();
|
|
@@ -5533,7 +5681,7 @@ class TimeMagicPipe extends DatePipe {
|
|
|
5533
5681
|
}
|
|
5534
5682
|
return value;
|
|
5535
5683
|
}
|
|
5536
|
-
/** @nocollapse */ static ɵfac = function TimeMagicPipe_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || TimeMagicPipe)(
|
|
5684
|
+
/** @nocollapse */ static ɵfac = function TimeMagicPipe_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || TimeMagicPipe)(); };
|
|
5537
5685
|
/** @nocollapse */ static ɵpipe = /** @pureOrBreakMyCode */ i0.ɵɵdefinePipe({ name: "magicTime", type: TimeMagicPipe, pure: true, standalone: false });
|
|
5538
5686
|
}
|
|
5539
5687
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(TimeMagicPipe, [{
|
|
@@ -5542,22 +5690,20 @@ class TimeMagicPipe extends DatePipe {
|
|
|
5542
5690
|
name: 'magicTime',
|
|
5543
5691
|
standalone: false
|
|
5544
5692
|
}]
|
|
5545
|
-
}], () => [
|
|
5693
|
+
}], () => [], null); })();
|
|
5546
5694
|
|
|
5547
5695
|
/**
|
|
5548
5696
|
* Validates the field range.
|
|
5549
5697
|
*/
|
|
5550
5698
|
class RangeValidatorMagicDirective {
|
|
5551
|
-
_task;
|
|
5552
|
-
vcRef;
|
|
5699
|
+
_task = inject(TaskMagicService);
|
|
5700
|
+
vcRef = inject(ViewContainerRef);
|
|
5553
5701
|
/**
|
|
5554
5702
|
*
|
|
5555
5703
|
* @param _task The task service
|
|
5556
5704
|
* @param vcRef
|
|
5557
5705
|
*/
|
|
5558
|
-
constructor(
|
|
5559
|
-
this._task = _task;
|
|
5560
|
-
this.vcRef = vcRef;
|
|
5706
|
+
constructor() {
|
|
5561
5707
|
}
|
|
5562
5708
|
/**
|
|
5563
5709
|
* Validation method
|
|
@@ -5592,7 +5738,7 @@ class RangeValidatorMagicDirective {
|
|
|
5592
5738
|
const formGroup = c.parent.controls;
|
|
5593
5739
|
return Object.keys(formGroup).find(name => c === formGroup[name]) || null;
|
|
5594
5740
|
}
|
|
5595
|
-
/** @nocollapse */ static ɵfac = function RangeValidatorMagicDirective_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || RangeValidatorMagicDirective)(
|
|
5741
|
+
/** @nocollapse */ static ɵfac = function RangeValidatorMagicDirective_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || RangeValidatorMagicDirective)(); };
|
|
5596
5742
|
/** @nocollapse */ static ɵdir = /** @pureOrBreakMyCode */ i0.ɵɵdefineDirective({ type: RangeValidatorMagicDirective, selectors: [["", "rangevalidator", ""]], standalone: false, features: [i0.ɵɵProvidersFeature([
|
|
5597
5743
|
{
|
|
5598
5744
|
provide: NG_VALIDATORS,
|
|
@@ -5614,10 +5760,10 @@ class RangeValidatorMagicDirective {
|
|
|
5614
5760
|
],
|
|
5615
5761
|
standalone: false
|
|
5616
5762
|
}]
|
|
5617
|
-
}], () => [
|
|
5763
|
+
}], () => [], null); })();
|
|
5618
5764
|
|
|
5619
|
-
function
|
|
5620
|
-
i0.ɵɵelement(0, "ndc-dynamic",
|
|
5765
|
+
function SubformMagicComponent_Conditional_0_Template(rf, ctx) { if (rf & 1) {
|
|
5766
|
+
i0.ɵɵelement(0, "ndc-dynamic", 0);
|
|
5621
5767
|
} if (rf & 2) {
|
|
5622
5768
|
const ctx_r0 = i0.ɵɵnextContext();
|
|
5623
5769
|
i0.ɵɵproperty("ndcDynamicComponent", ctx_r0.Component)("ndcDynamicInputs", ctx_r0.Parameters);
|
|
@@ -5626,8 +5772,6 @@ function SubformMagicComponent_ndc_dynamic_0_Template(rf, ctx) { if (rf & 1) {
|
|
|
5626
5772
|
* Represents a Magic subform
|
|
5627
5773
|
*/
|
|
5628
5774
|
class SubformMagicComponent {
|
|
5629
|
-
vcRef;
|
|
5630
|
-
mgSub;
|
|
5631
5775
|
/**
|
|
5632
5776
|
* @ignore
|
|
5633
5777
|
*/
|
|
@@ -5644,12 +5788,12 @@ class SubformMagicComponent {
|
|
|
5644
5788
|
/**
|
|
5645
5789
|
* @ignore
|
|
5646
5790
|
*/
|
|
5647
|
-
constructor(
|
|
5648
|
-
this.vcRef = vcRef;
|
|
5649
|
-
this.mgSub = mgSub;
|
|
5791
|
+
constructor() {
|
|
5650
5792
|
// For angular 13 - find the component from _hostLView
|
|
5651
5793
|
this.component = (this.vcRef._hostLView).find(v => !isNullOrUndefined(v));
|
|
5652
5794
|
}
|
|
5795
|
+
vcRef = inject(ViewContainerRef);
|
|
5796
|
+
mgSub = inject(SubformMagicService);
|
|
5653
5797
|
/**
|
|
5654
5798
|
* @ignore
|
|
5655
5799
|
*/
|
|
@@ -5662,35 +5806,37 @@ class SubformMagicComponent {
|
|
|
5662
5806
|
get Parameters() {
|
|
5663
5807
|
return this.mgSub.mgGetParameters(this.id);
|
|
5664
5808
|
}
|
|
5665
|
-
/** @nocollapse */ static ɵfac = function SubformMagicComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || SubformMagicComponent)(
|
|
5666
|
-
/** @nocollapse */ static ɵcmp = /** @pureOrBreakMyCode */ i0.ɵɵdefineComponent({ type: SubformMagicComponent, selectors: [["magic-subform"]], inputs: { magic: "magic" }, standalone: false, decls: 1, vars: 1, consts: [[3, "ndcDynamicComponent", "ndcDynamicInputs"
|
|
5667
|
-
i0.ɵɵ
|
|
5809
|
+
/** @nocollapse */ static ɵfac = function SubformMagicComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || SubformMagicComponent)(); };
|
|
5810
|
+
/** @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) {
|
|
5811
|
+
i0.ɵɵconditionalCreate(0, SubformMagicComponent_Conditional_0_Template, 1, 2, "ndc-dynamic", 0);
|
|
5668
5812
|
} if (rf & 2) {
|
|
5669
|
-
i0.ɵɵ
|
|
5670
|
-
} }, dependencies: [i1.
|
|
5813
|
+
i0.ɵɵconditional(ctx.Component ? 0 : -1);
|
|
5814
|
+
} }, dependencies: [i1$1.DynamicIoDirective, i1$1.DynamicComponent], encapsulation: 2, changeDetection: 1 });
|
|
5671
5815
|
}
|
|
5672
5816
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(SubformMagicComponent, [{
|
|
5673
5817
|
type: Component,
|
|
5674
5818
|
args: [{
|
|
5675
5819
|
selector: 'magic-subform',
|
|
5676
5820
|
template: `
|
|
5677
|
-
|
|
5678
|
-
|
|
5679
|
-
|
|
5680
|
-
|
|
5681
|
-
|
|
5682
|
-
|
|
5821
|
+
@if (Component) {
|
|
5822
|
+
<ndc-dynamic
|
|
5823
|
+
[ndcDynamicComponent]="Component"
|
|
5824
|
+
[ndcDynamicInputs]="Parameters">
|
|
5825
|
+
</ndc-dynamic>
|
|
5826
|
+
}
|
|
5827
|
+
`,
|
|
5828
|
+
changeDetection: ChangeDetectionStrategy.Eager,
|
|
5683
5829
|
standalone: false
|
|
5684
5830
|
}]
|
|
5685
|
-
}], () => [
|
|
5831
|
+
}], () => [], { magic: [{
|
|
5686
5832
|
type: Input,
|
|
5687
5833
|
args: ['magic']
|
|
5688
5834
|
}] }); })();
|
|
5689
|
-
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(SubformMagicComponent, { className: "SubformMagicComponent", filePath: "src/ui/subform.magic.component.ts", lineNumber:
|
|
5835
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(SubformMagicComponent, { className: "SubformMagicComponent", filePath: "src/ui/subform.magic.component.ts", lineNumber: 24 }); })();
|
|
5690
5836
|
|
|
5691
5837
|
const _c0$1 = ["customContent"];
|
|
5692
5838
|
const _c1 = ["*"];
|
|
5693
|
-
function
|
|
5839
|
+
function ErrorMagicComponent_Conditional_0_Conditional_4_Template(rf, ctx) { if (rf & 1) {
|
|
5694
5840
|
i0.ɵɵelementStart(0, "span");
|
|
5695
5841
|
i0.ɵɵtext(1);
|
|
5696
5842
|
i0.ɵɵelementEnd();
|
|
@@ -5699,24 +5845,21 @@ function ErrorMagicComponent_div_0_span_4_Template(rf, ctx) { if (rf & 1) {
|
|
|
5699
5845
|
i0.ɵɵadvance();
|
|
5700
5846
|
i0.ɵɵtextInterpolate1(" ", ctx_r0.mgService.getErrMsg(ctx_r0.id, ctx_r0.rowId), " ");
|
|
5701
5847
|
} }
|
|
5702
|
-
function
|
|
5848
|
+
function ErrorMagicComponent_Conditional_0_Template(rf, ctx) { if (rf & 1) {
|
|
5703
5849
|
i0.ɵɵelementStart(0, "div")(1, "div", null, 0);
|
|
5704
5850
|
i0.ɵɵprojection(3);
|
|
5705
5851
|
i0.ɵɵelementEnd();
|
|
5706
|
-
i0.ɵɵ
|
|
5852
|
+
i0.ɵɵconditionalCreate(4, ErrorMagicComponent_Conditional_0_Conditional_4_Template, 2, 1, "span");
|
|
5707
5853
|
i0.ɵɵelementEnd();
|
|
5708
5854
|
} if (rf & 2) {
|
|
5709
5855
|
const ctx_r0 = i0.ɵɵnextContext();
|
|
5710
5856
|
i0.ɵɵadvance(4);
|
|
5711
|
-
i0.ɵɵ
|
|
5857
|
+
i0.ɵɵconditional(ctx_r0.defaultDisplay ? 4 : -1);
|
|
5712
5858
|
} }
|
|
5713
5859
|
/**
|
|
5714
5860
|
* Represents a Magic subform
|
|
5715
5861
|
*/
|
|
5716
5862
|
class ErrorMagicComponent {
|
|
5717
|
-
_task;
|
|
5718
|
-
mgService;
|
|
5719
|
-
changeDetectorRef;
|
|
5720
5863
|
/**
|
|
5721
5864
|
* @ignore
|
|
5722
5865
|
*/
|
|
@@ -5735,19 +5878,19 @@ class ErrorMagicComponent {
|
|
|
5735
5878
|
;
|
|
5736
5879
|
// if true - display standard magic error message, if false - customer has provides his own content and we'll use it
|
|
5737
5880
|
defaultDisplay = true;
|
|
5738
|
-
|
|
5739
|
-
|
|
5740
|
-
this.changeDetectorRef.detectChanges();
|
|
5741
|
-
}
|
|
5742
|
-
;
|
|
5881
|
+
customContentRef = viewChild('customContent', /* @ts-ignore */
|
|
5882
|
+
...(ngDevMode ? [{ debugName: "customContentRef" }] : /* istanbul ignore next */ []));
|
|
5743
5883
|
/**
|
|
5744
5884
|
* @ignore
|
|
5745
5885
|
*/
|
|
5746
|
-
constructor(
|
|
5747
|
-
this._task = _task;
|
|
5748
|
-
this.mgService = mgService;
|
|
5749
|
-
this.changeDetectorRef = changeDetectorRef;
|
|
5886
|
+
constructor() {
|
|
5750
5887
|
this.rowId = "0";
|
|
5888
|
+
// Reactively update defaultDisplay whenever customContent changes in the DOM
|
|
5889
|
+
effect(() => {
|
|
5890
|
+
const innerComponent = this.customContentRef();
|
|
5891
|
+
this.defaultDisplay = innerComponent == undefined || this.isEmpty(innerComponent.nativeElement);
|
|
5892
|
+
this.changeDetectorRef.detectChanges();
|
|
5893
|
+
});
|
|
5751
5894
|
}
|
|
5752
5895
|
/**
|
|
5753
5896
|
* returns true if the html element has no children
|
|
@@ -5786,69 +5929,68 @@ class ErrorMagicComponent {
|
|
|
5786
5929
|
}
|
|
5787
5930
|
return false;
|
|
5788
5931
|
}
|
|
5789
|
-
|
|
5932
|
+
_task = inject(TaskMagicService);
|
|
5933
|
+
mgService = inject(AccessorMagicService);
|
|
5934
|
+
changeDetectorRef = inject(ChangeDetectorRef);
|
|
5935
|
+
/** @nocollapse */ static ɵfac = function ErrorMagicComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || ErrorMagicComponent)(); };
|
|
5790
5936
|
/** @nocollapse */ static ɵcmp = /** @pureOrBreakMyCode */ i0.ɵɵdefineComponent({ type: ErrorMagicComponent, selectors: [["mgError"]], viewQuery: function ErrorMagicComponent_Query(rf, ctx) { if (rf & 1) {
|
|
5791
|
-
i0.ɵɵ
|
|
5937
|
+
i0.ɵɵviewQuerySignal(ctx.customContentRef, _c0$1, 5);
|
|
5792
5938
|
} if (rf & 2) {
|
|
5793
|
-
|
|
5794
|
-
|
|
5795
|
-
} }, inputs: { magic: "magic", rowId1: [0, "rowId", "rowId1"] }, standalone: false, ngContentSelectors: _c1, decls: 1, vars: 1, consts: [["customContent", ""], [4, "ngIf"]], template: function ErrorMagicComponent_Template(rf, ctx) { if (rf & 1) {
|
|
5939
|
+
i0.ɵɵqueryAdvance();
|
|
5940
|
+
} }, 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) {
|
|
5796
5941
|
i0.ɵɵprojectionDef();
|
|
5797
|
-
i0.ɵɵ
|
|
5942
|
+
i0.ɵɵconditionalCreate(0, ErrorMagicComponent_Conditional_0_Template, 5, 1, "div");
|
|
5798
5943
|
} if (rf & 2) {
|
|
5799
|
-
i0.ɵɵ
|
|
5800
|
-
} },
|
|
5944
|
+
i0.ɵɵconditional(ctx.HasErrors(ctx.id) ? 0 : -1);
|
|
5945
|
+
} }, encapsulation: 2, changeDetection: 1 });
|
|
5801
5946
|
}
|
|
5802
5947
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(ErrorMagicComponent, [{
|
|
5803
5948
|
type: Component,
|
|
5804
5949
|
args: [{
|
|
5805
5950
|
selector: 'mgError',
|
|
5806
|
-
template:
|
|
5951
|
+
template: `@if (HasErrors(id)) {
|
|
5952
|
+
<div>
|
|
5807
5953
|
<div #customContent>
|
|
5808
5954
|
<ng-content></ng-content>
|
|
5809
5955
|
</div>
|
|
5810
|
-
|
|
5811
|
-
|
|
5812
|
-
|
|
5813
|
-
|
|
5956
|
+
@if (defaultDisplay) {
|
|
5957
|
+
<span>
|
|
5958
|
+
{{mgService.getErrMsg(id, rowId)}}
|
|
5959
|
+
</span>
|
|
5960
|
+
}
|
|
5961
|
+
</div>
|
|
5962
|
+
}
|
|
5814
5963
|
`,
|
|
5964
|
+
changeDetection: ChangeDetectionStrategy.Eager,
|
|
5815
5965
|
standalone: false
|
|
5816
5966
|
}]
|
|
5817
|
-
}], () => [
|
|
5967
|
+
}], () => [], { magic: [{
|
|
5818
5968
|
type: Input,
|
|
5819
5969
|
args: ['magic']
|
|
5820
5970
|
}], rowId1: [{
|
|
5821
5971
|
type: Input,
|
|
5822
5972
|
args: ['rowId']
|
|
5823
|
-
}],
|
|
5824
|
-
|
|
5825
|
-
args: ['customContent', { static: false }]
|
|
5826
|
-
}] }); })();
|
|
5827
|
-
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(ErrorMagicComponent, { className: "ErrorMagicComponent", filePath: "src/ui/mgerror.magic.component.ts", lineNumber: 24 }); })();
|
|
5973
|
+
}], customContentRef: [{ type: i0.ViewChild, args: ['customContent', { isSignal: true }] }] }); })();
|
|
5974
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(ErrorMagicComponent, { className: "ErrorMagicComponent", filePath: "src/ui/mgerror.magic.component.ts", lineNumber: 29 }); })();
|
|
5828
5975
|
|
|
5829
5976
|
/**
|
|
5830
5977
|
* Directive for checkboxes, to handle the 'change' event
|
|
5831
5978
|
*/
|
|
5832
5979
|
class CheckboxMagicDirective {
|
|
5833
|
-
|
|
5834
|
-
|
|
5835
|
-
task;
|
|
5836
|
-
threeState = false;
|
|
5980
|
+
threeState = input(false, /* @ts-ignore */
|
|
5981
|
+
...(ngDevMode ? [{ debugName: "threeState" }] : /* istanbul ignore next */ []));
|
|
5837
5982
|
subscribeRefreshDom = null;
|
|
5838
5983
|
isIndeterminate = false;
|
|
5839
|
-
|
|
5840
|
-
|
|
5841
|
-
|
|
5842
|
-
constructor(
|
|
5843
|
-
this.magicDirective = magicDirective;
|
|
5844
|
-
this.el = el;
|
|
5845
|
-
this.task = task;
|
|
5984
|
+
magicDirective = inject(MagicDirective);
|
|
5985
|
+
el = inject(ElementRef);
|
|
5986
|
+
task = inject(TaskMagicService);
|
|
5987
|
+
constructor() {
|
|
5846
5988
|
}
|
|
5847
5989
|
/**
|
|
5848
5990
|
* Handles the Checkbox 'change' event - pass it to the Magic engine
|
|
5849
5991
|
*/
|
|
5850
5992
|
onChange($event) {
|
|
5851
|
-
if (this.threeState) {
|
|
5993
|
+
if (this.threeState()) {
|
|
5852
5994
|
this.handleThreeState();
|
|
5853
5995
|
}
|
|
5854
5996
|
else {
|
|
@@ -5856,7 +5998,7 @@ class CheckboxMagicDirective {
|
|
|
5856
5998
|
}
|
|
5857
5999
|
}
|
|
5858
6000
|
ngOnInit() {
|
|
5859
|
-
if (this.threeState) {
|
|
6001
|
+
if (this.threeState()) {
|
|
5860
6002
|
let guiEvent = getGuiEventObj("setAsThreeState", this.magicDirective.id, +this.magicDirective.rowId);
|
|
5861
6003
|
this.task.insertEvent(guiEvent);
|
|
5862
6004
|
this.el.nativeElement.indeterminate = this.isIndeterminate = this.task.getProperty(this.magicDirective.id, HtmlProperties.CheckBoxIndeterminate, this.magicDirective.rowId);
|
|
@@ -5911,10 +6053,10 @@ class CheckboxMagicDirective {
|
|
|
5911
6053
|
if (this.subscribeRefreshDom !== null)
|
|
5912
6054
|
this.subscribeRefreshDom.unsubscribe();
|
|
5913
6055
|
}
|
|
5914
|
-
/** @nocollapse */ static ɵfac = function CheckboxMagicDirective_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || CheckboxMagicDirective)(
|
|
6056
|
+
/** @nocollapse */ static ɵfac = function CheckboxMagicDirective_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || CheckboxMagicDirective)(); };
|
|
5915
6057
|
/** @nocollapse */ static ɵdir = /** @pureOrBreakMyCode */ i0.ɵɵdefineDirective({ type: CheckboxMagicDirective, selectors: [["input", "type", "checkbox", "magic", "", 3, "noFormControl", ""]], hostBindings: function CheckboxMagicDirective_HostBindings(rf, ctx) { if (rf & 1) {
|
|
5916
6058
|
i0.ɵɵlistener("change", function CheckboxMagicDirective_change_HostBindingHandler($event) { return ctx.onChange($event); });
|
|
5917
|
-
} }, inputs: { threeState: "threeState" }, standalone: false });
|
|
6059
|
+
} }, inputs: { threeState: [1, "threeState"] }, standalone: false });
|
|
5918
6060
|
}
|
|
5919
6061
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(CheckboxMagicDirective, [{
|
|
5920
6062
|
type: Directive,
|
|
@@ -5924,9 +6066,7 @@ class CheckboxMagicDirective {
|
|
|
5924
6066
|
`,
|
|
5925
6067
|
standalone: false
|
|
5926
6068
|
}]
|
|
5927
|
-
}], () => [{
|
|
5928
|
-
type: Input
|
|
5929
|
-
}], onChange: [{
|
|
6069
|
+
}], () => [], { threeState: [{ type: i0.Input, args: [{ isSignal: true, alias: "threeState", required: false }] }], onChange: [{
|
|
5930
6070
|
type: HostListener,
|
|
5931
6071
|
args: ['change', ['$event']]
|
|
5932
6072
|
}] }); })();
|
|
@@ -5935,9 +6075,8 @@ class CheckboxMagicDirective {
|
|
|
5935
6075
|
* Directive for comboboxes, to handle the 'change' event
|
|
5936
6076
|
*/
|
|
5937
6077
|
class ComboboxMagicDirective {
|
|
5938
|
-
magicDirective;
|
|
5939
|
-
constructor(
|
|
5940
|
-
this.magicDirective = magicDirective;
|
|
6078
|
+
magicDirective = inject(MagicDirective);
|
|
6079
|
+
constructor() {
|
|
5941
6080
|
// subcribe to refreshDom. This is a special case for native select HTML control.
|
|
5942
6081
|
// to refresh the selected property. Else by default, HTML element doesn't get refreshed as per
|
|
5943
6082
|
// selected value and 1st element remains selected.
|
|
@@ -5959,7 +6098,7 @@ class ComboboxMagicDirective {
|
|
|
5959
6098
|
onComboboxItemsListChanged() {
|
|
5960
6099
|
this.magicDirective.task.refreshView();
|
|
5961
6100
|
}
|
|
5962
|
-
/** @nocollapse */ static ɵfac = function ComboboxMagicDirective_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || ComboboxMagicDirective)(
|
|
6101
|
+
/** @nocollapse */ static ɵfac = function ComboboxMagicDirective_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || ComboboxMagicDirective)(); };
|
|
5963
6102
|
/** @nocollapse */ static ɵdir = /** @pureOrBreakMyCode */ i0.ɵɵdefineDirective({ type: ComboboxMagicDirective, selectors: [["select", "magic", "", 3, "multiple", ""]], hostBindings: function ComboboxMagicDirective_HostBindings(rf, ctx) { if (rf & 1) {
|
|
5964
6103
|
i0.ɵɵlistener("change", function ComboboxMagicDirective_change_HostBindingHandler($event) { return ctx.onChange($event); });
|
|
5965
6104
|
} }, standalone: false });
|
|
@@ -5970,7 +6109,7 @@ class ComboboxMagicDirective {
|
|
|
5970
6109
|
selector: `select[magic]:not([multiple])`,
|
|
5971
6110
|
standalone: false
|
|
5972
6111
|
}]
|
|
5973
|
-
}], () => [
|
|
6112
|
+
}], () => [], { onChange: [{
|
|
5974
6113
|
type: HostListener,
|
|
5975
6114
|
args: ['change', ['$event']]
|
|
5976
6115
|
}] }); })();
|
|
@@ -5993,39 +6132,29 @@ class ExitMagicService {
|
|
|
5993
6132
|
}], null, null); })();
|
|
5994
6133
|
|
|
5995
6134
|
const _c0 = ["magicRoot"];
|
|
5996
|
-
function
|
|
5997
|
-
i0.ɵɵelement(0, "ndc-dynamic",
|
|
6135
|
+
function MagicShellComponent_Conditional_2_Template(rf, ctx) { if (rf & 1) {
|
|
6136
|
+
i0.ɵɵelement(0, "ndc-dynamic", 3);
|
|
5998
6137
|
} if (rf & 2) {
|
|
5999
6138
|
const ctx_r0 = i0.ɵɵnextContext();
|
|
6000
6139
|
i0.ɵɵproperty("ndcDynamicComponent", ctx_r0.RootComponent)("ndcDynamicInputs", ctx_r0.RootComponentParameters);
|
|
6001
6140
|
} }
|
|
6002
|
-
function
|
|
6003
|
-
i0.ɵɵelementStart(0, "div",
|
|
6004
|
-
i0.ɵɵelementContainer(1,
|
|
6141
|
+
function MagicShellComponent_Conditional_5_Template(rf, ctx) { if (rf & 1) {
|
|
6142
|
+
i0.ɵɵelementStart(0, "div", 5);
|
|
6143
|
+
i0.ɵɵelementContainer(1, 6);
|
|
6005
6144
|
i0.ɵɵelementEnd();
|
|
6006
6145
|
} if (rf & 2) {
|
|
6007
6146
|
const ctx_r0 = i0.ɵɵnextContext();
|
|
6008
6147
|
const defaultSpinner_r2 = i0.ɵɵreference(7);
|
|
6009
6148
|
i0.ɵɵadvance();
|
|
6010
|
-
i0.ɵɵproperty("ngTemplateOutlet", ctx_r0.SpinnerTemplate ? ctx_r0.SpinnerTemplate : defaultSpinner_r2);
|
|
6149
|
+
i0.ɵɵproperty("ngTemplateOutlet", ctx_r0.SpinnerTemplate() ? ctx_r0.SpinnerTemplate() : defaultSpinner_r2);
|
|
6011
6150
|
} }
|
|
6012
6151
|
function MagicShellComponent_ng_template_6_Template(rf, ctx) { if (rf & 1) {
|
|
6013
|
-
i0.ɵɵelement(0, "div",
|
|
6152
|
+
i0.ɵɵelement(0, "div", 7);
|
|
6014
6153
|
} }
|
|
6015
6154
|
/**
|
|
6016
6155
|
* Root Magic component
|
|
6017
6156
|
*/
|
|
6018
6157
|
class MagicShellComponent {
|
|
6019
|
-
engineMagicService;
|
|
6020
|
-
componentList;
|
|
6021
|
-
changeDetectorRef;
|
|
6022
|
-
titleService;
|
|
6023
|
-
overlayWindowService;
|
|
6024
|
-
httpClient;
|
|
6025
|
-
pendingCommandsCollector;
|
|
6026
|
-
route;
|
|
6027
|
-
router;
|
|
6028
|
-
exitMagicService;
|
|
6029
6158
|
/**
|
|
6030
6159
|
* Root component to be displayed in the window
|
|
6031
6160
|
*/
|
|
@@ -6035,10 +6164,22 @@ class MagicShellComponent {
|
|
|
6035
6164
|
*/
|
|
6036
6165
|
RootComponentParameters;
|
|
6037
6166
|
overlayWindowsContainerViewRef;
|
|
6038
|
-
rootMagicElementRef
|
|
6039
|
-
|
|
6167
|
+
rootMagicElementRef = viewChild.required('magicRoot', /* @ts-ignore */
|
|
6168
|
+
...(ngDevMode ? [{ debugName: "rootMagicElementRef" }] : /* istanbul ignore next */ []));
|
|
6169
|
+
SpinnerTemplate = input(/* @ts-ignore */
|
|
6170
|
+
...(ngDevMode ? [undefined, { debugName: "SpinnerTemplate" }] : /* istanbul ignore next */ []));
|
|
6040
6171
|
showSpinner;
|
|
6041
6172
|
magicEngineTerminated = false;
|
|
6173
|
+
engineMagicService = inject(EngineMagicService);
|
|
6174
|
+
componentList = inject(ComponentListMagicService);
|
|
6175
|
+
changeDetectorRef = inject(ChangeDetectorRef);
|
|
6176
|
+
titleService = inject(Title);
|
|
6177
|
+
overlayWindowService = inject(OverlayWindowService);
|
|
6178
|
+
httpClient = inject(HttpClient);
|
|
6179
|
+
pendingCommandsCollector = inject(CommandsCollectorMagicService);
|
|
6180
|
+
route = inject(ActivatedRoute);
|
|
6181
|
+
router = inject(Router);
|
|
6182
|
+
exitMagicService = inject(ExitMagicService, { optional: true });
|
|
6042
6183
|
/**
|
|
6043
6184
|
*
|
|
6044
6185
|
* @param magic Magic's service
|
|
@@ -6048,17 +6189,7 @@ class MagicShellComponent {
|
|
|
6048
6189
|
* @param httpClient The native httpClient instance
|
|
6049
6190
|
* @param exitMagicService Magic exit service
|
|
6050
6191
|
*/
|
|
6051
|
-
constructor(
|
|
6052
|
-
this.engineMagicService = engineMagicService;
|
|
6053
|
-
this.componentList = componentList;
|
|
6054
|
-
this.changeDetectorRef = changeDetectorRef;
|
|
6055
|
-
this.titleService = titleService;
|
|
6056
|
-
this.overlayWindowService = overlayWindowService;
|
|
6057
|
-
this.httpClient = httpClient;
|
|
6058
|
-
this.pendingCommandsCollector = pendingCommandsCollector;
|
|
6059
|
-
this.route = route;
|
|
6060
|
-
this.router = router;
|
|
6061
|
-
this.exitMagicService = exitMagicService;
|
|
6192
|
+
constructor() {
|
|
6062
6193
|
this.initialize();
|
|
6063
6194
|
this.setTitle();
|
|
6064
6195
|
}
|
|
@@ -6078,13 +6209,20 @@ class MagicShellComponent {
|
|
|
6078
6209
|
this.magicEngineTerminated = true;
|
|
6079
6210
|
}
|
|
6080
6211
|
}
|
|
6081
|
-
|
|
6212
|
+
/**
|
|
6213
|
+
* Page-hide event listener, used in place of 'unload'.
|
|
6214
|
+
* Chrome blocks 'unload' by permissions policy ("unload is not allowed in this document"),
|
|
6215
|
+
* so an unload handler is never even registered. 'pagehide' is fired at an earlier step of
|
|
6216
|
+
* the same unloading sequence, so it covers every case 'unload' did.
|
|
6217
|
+
*/
|
|
6218
|
+
onPageHide() {
|
|
6082
6219
|
// Chrome provides an opportunity to terminate the context after user approves the browser unload alert
|
|
6083
|
-
if (!this.magicEngineTerminated)
|
|
6220
|
+
if (!this.magicEngineTerminated) {
|
|
6084
6221
|
this.engineMagicService.TerminateContextUsingFetchAPI();
|
|
6222
|
+
}
|
|
6085
6223
|
}
|
|
6086
6224
|
ngAfterViewInit() {
|
|
6087
|
-
this.overlayWindowService.init(this.overlayWindowsContainerViewRef, this.rootMagicElementRef.nativeElement, this.changeDetectorRef);
|
|
6225
|
+
this.overlayWindowService.init(this.overlayWindowsContainerViewRef, this.rootMagicElementRef().nativeElement, this.changeDetectorRef);
|
|
6088
6226
|
// Helper function to start the engine
|
|
6089
6227
|
const startEngine = () => {
|
|
6090
6228
|
const queryParams = this.route.snapshot.queryParams;
|
|
@@ -6198,28 +6336,28 @@ class MagicShellComponent {
|
|
|
6198
6336
|
break;
|
|
6199
6337
|
}
|
|
6200
6338
|
}
|
|
6201
|
-
/** @nocollapse */ static ɵfac = function MagicShellComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || MagicShellComponent)(
|
|
6339
|
+
/** @nocollapse */ static ɵfac = function MagicShellComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || MagicShellComponent)(); };
|
|
6202
6340
|
/** @nocollapse */ static ɵcmp = /** @pureOrBreakMyCode */ i0.ɵɵdefineComponent({ type: MagicShellComponent, selectors: [["magic-root"]], viewQuery: function MagicShellComponent_Query(rf, ctx) { if (rf & 1) {
|
|
6203
|
-
i0.ɵɵ
|
|
6341
|
+
i0.ɵɵviewQuerySignal(ctx.rootMagicElementRef, _c0, 5);
|
|
6204
6342
|
} if (rf & 2) {
|
|
6205
|
-
|
|
6206
|
-
i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.rootMagicElementRef = _t.first);
|
|
6343
|
+
i0.ɵɵqueryAdvance();
|
|
6207
6344
|
} }, hostBindings: function MagicShellComponent_HostBindings(rf, ctx) { if (rf & 1) {
|
|
6208
|
-
i0.ɵɵlistener("beforeunload", function MagicShellComponent_beforeunload_HostBindingHandler($event) { return ctx.onBeforeUnload($event); },
|
|
6209
|
-
} }, inputs: { SpinnerTemplate: "SpinnerTemplate" }, standalone: false, features: [i0.ɵɵProvidersFeature([
|
|
6345
|
+
i0.ɵɵlistener("beforeunload", function MagicShellComponent_beforeunload_HostBindingHandler($event) { return ctx.onBeforeUnload($event); }, i0.ɵɵresolveWindow)("pagehide", function MagicShellComponent_pagehide_HostBindingHandler() { return ctx.onPageHide(); }, i0.ɵɵresolveWindow);
|
|
6346
|
+
} }, inputs: { SpinnerTemplate: [1, "SpinnerTemplate"] }, standalone: false, features: [i0.ɵɵProvidersFeature([
|
|
6210
6347
|
// ExitMagicService
|
|
6211
|
-
])], decls: 8, vars: 2, consts: [["magicRoot", ""], ["overlayWindowsContainer", ""], ["defaultSpinner", ""], [3, "ndcDynamicComponent", "ndcDynamicInputs"
|
|
6348
|
+
])], 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) {
|
|
6212
6349
|
i0.ɵɵelementStart(0, "div", null, 0);
|
|
6213
|
-
i0.ɵɵ
|
|
6350
|
+
i0.ɵɵconditionalCreate(2, MagicShellComponent_Conditional_2_Template, 1, 2, "ndc-dynamic", 3);
|
|
6214
6351
|
i0.ɵɵelement(3, "div", 4, 1);
|
|
6215
6352
|
i0.ɵɵelementEnd();
|
|
6216
|
-
i0.ɵɵ
|
|
6353
|
+
i0.ɵɵconditionalCreate(5, MagicShellComponent_Conditional_5_Template, 2, 1, "div", 5);
|
|
6354
|
+
i0.ɵɵtemplate(6, MagicShellComponent_ng_template_6_Template, 1, 0, "ng-template", null, 2, i0.ɵɵtemplateRefExtractor);
|
|
6217
6355
|
} if (rf & 2) {
|
|
6218
6356
|
i0.ɵɵadvance(2);
|
|
6219
|
-
i0.ɵɵ
|
|
6357
|
+
i0.ɵɵconditional(ctx.RootComponent !== null ? 2 : -1);
|
|
6220
6358
|
i0.ɵɵadvance(3);
|
|
6221
|
-
i0.ɵɵ
|
|
6222
|
-
} }, dependencies: [i1.
|
|
6359
|
+
i0.ɵɵconditional(ctx.showSpinner ? 5 : -1);
|
|
6360
|
+
} }, 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 });
|
|
6223
6361
|
}
|
|
6224
6362
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(MagicShellComponent, [{
|
|
6225
6363
|
type: Component,
|
|
@@ -6227,39 +6365,35 @@ class MagicShellComponent {
|
|
|
6227
6365
|
// ExitMagicService
|
|
6228
6366
|
], template: `
|
|
6229
6367
|
<div #magicRoot>
|
|
6230
|
-
|
|
6231
|
-
|
|
6232
|
-
|
|
6233
|
-
|
|
6234
|
-
|
|
6368
|
+
@if (RootComponent !== null) {
|
|
6369
|
+
<ndc-dynamic
|
|
6370
|
+
[ndcDynamicComponent]="RootComponent"
|
|
6371
|
+
[ndcDynamicInputs] ="RootComponentParameters">
|
|
6372
|
+
</ndc-dynamic>
|
|
6373
|
+
}
|
|
6235
6374
|
|
|
6236
6375
|
<div #overlayWindowsContainer magicViewContainerRef>
|
|
6237
6376
|
</div>
|
|
6238
6377
|
</div>
|
|
6239
6378
|
|
|
6240
|
-
|
|
6241
|
-
<
|
|
6242
|
-
|
|
6379
|
+
@if (showSpinner) {
|
|
6380
|
+
<div class="spinner-background">
|
|
6381
|
+
<ng-container [ngTemplateOutlet]="SpinnerTemplate() ? SpinnerTemplate():defaultSpinner"></ng-container>
|
|
6382
|
+
</div>
|
|
6383
|
+
}
|
|
6243
6384
|
|
|
6244
6385
|
<ng-template #defaultSpinner>
|
|
6245
6386
|
<div class="mgSpinnerClass"></div>
|
|
6246
6387
|
</ng-template>
|
|
6247
|
-
|
|
6248
|
-
}], () => [
|
|
6249
|
-
type: Optional
|
|
6250
|
-
}] }], { rootMagicElementRef: [{
|
|
6251
|
-
type: ViewChild,
|
|
6252
|
-
args: ['magicRoot', { static: true }]
|
|
6253
|
-
}], SpinnerTemplate: [{
|
|
6254
|
-
type: Input
|
|
6255
|
-
}], onBeforeUnload: [{
|
|
6388
|
+
`, 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"] }]
|
|
6389
|
+
}], () => [], { rootMagicElementRef: [{ type: i0.ViewChild, args: ['magicRoot', { isSignal: true }] }], SpinnerTemplate: [{ type: i0.Input, args: [{ isSignal: true, alias: "SpinnerTemplate", required: false }] }], onBeforeUnload: [{
|
|
6256
6390
|
type: HostListener,
|
|
6257
6391
|
args: ['window:beforeunload', ['$event']]
|
|
6258
|
-
}],
|
|
6392
|
+
}], onPageHide: [{
|
|
6259
6393
|
type: HostListener,
|
|
6260
|
-
args: ['window:
|
|
6394
|
+
args: ['window:pagehide']
|
|
6261
6395
|
}] }); })();
|
|
6262
|
-
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(MagicShellComponent, { className: "MagicShellComponent", filePath: "src/ui/magic-root.component.ts", lineNumber:
|
|
6396
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(MagicShellComponent, { className: "MagicShellComponent", filePath: "src/ui/magic-root.component.ts", lineNumber: 90 }); })();
|
|
6263
6397
|
|
|
6264
6398
|
/**
|
|
6265
6399
|
* @ignore
|
|
@@ -6286,7 +6420,7 @@ class MagicCheckboxControlValueAccessor extends CheckboxControlValueAccessor {
|
|
|
6286
6420
|
input[type=checkbox][magic]:not([formControl]),
|
|
6287
6421
|
input[type=checkbox][magic]:not([ngModel])
|
|
6288
6422
|
`,
|
|
6289
|
-
host: { '(change)': 'onChange($event.target.checked)', '(blur)': 'onTouched()' },
|
|
6423
|
+
host: { '(change)': 'onChange($any($event.target).checked)', '(blur)': 'onTouched()' },
|
|
6290
6424
|
providers: [CHECKBOX_VALUE_ACCESSOR],
|
|
6291
6425
|
standalone: false
|
|
6292
6426
|
}]
|
|
@@ -6317,10 +6451,10 @@ class MagicDefaultValueAccessor extends DefaultValueAccessor {
|
|
|
6317
6451
|
textarea[magic]:not([formControlName]):not([noFormControl]):not([no-form-control])
|
|
6318
6452
|
`,
|
|
6319
6453
|
host: {
|
|
6320
|
-
'(input)': '$any(this)._handleInput($event.target.value)',
|
|
6454
|
+
'(input)': '$any(this)._handleInput($any($event.target).value)',
|
|
6321
6455
|
'(blur)': 'onTouched()',
|
|
6322
6456
|
'(compositionstart)': '$any(this)._compositionStart()',
|
|
6323
|
-
'(compositionend)': '$any(this)._compositionEnd($event.target.value)'
|
|
6457
|
+
'(compositionend)': '$any(this)._compositionEnd($any($event.target).value)'
|
|
6324
6458
|
},
|
|
6325
6459
|
providers: [MAGIC_DEFAULT_VALUE_ACCESSOR],
|
|
6326
6460
|
exportAs: 'magic',
|
|
@@ -6332,9 +6466,8 @@ class MagicDefaultValueAccessor extends DefaultValueAccessor {
|
|
|
6332
6466
|
* Directive for checkboxes which should not have a form control
|
|
6333
6467
|
*/
|
|
6334
6468
|
class CheckboxNoFormControlMagicDirective {
|
|
6335
|
-
magicDirective;
|
|
6336
|
-
constructor(
|
|
6337
|
-
this.magicDirective = magicDirective;
|
|
6469
|
+
magicDirective = inject(MagicDirective);
|
|
6470
|
+
constructor() {
|
|
6338
6471
|
}
|
|
6339
6472
|
/**
|
|
6340
6473
|
* Handle the 'Checkbox' change event - pass it to the Magic engine
|
|
@@ -6342,7 +6475,7 @@ class CheckboxNoFormControlMagicDirective {
|
|
|
6342
6475
|
onChange($event) {
|
|
6343
6476
|
this.magicDirective.task.onCheckChanged($event, this.magicDirective.id, +this.magicDirective.rowId);
|
|
6344
6477
|
}
|
|
6345
|
-
/** @nocollapse */ static ɵfac = function CheckboxNoFormControlMagicDirective_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || CheckboxNoFormControlMagicDirective)(
|
|
6478
|
+
/** @nocollapse */ static ɵfac = function CheckboxNoFormControlMagicDirective_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || CheckboxNoFormControlMagicDirective)(); };
|
|
6346
6479
|
/** @nocollapse */ static ɵdir = /** @pureOrBreakMyCode */ i0.ɵɵdefineDirective({ type: CheckboxNoFormControlMagicDirective, selectors: [["input", "type", "checkbox", "magic", "", "noFormControl", ""]], hostBindings: function CheckboxNoFormControlMagicDirective_HostBindings(rf, ctx) { if (rf & 1) {
|
|
6347
6480
|
i0.ɵɵlistener("change", function CheckboxNoFormControlMagicDirective_change_HostBindingHandler($event) { return ctx.onChange($event); });
|
|
6348
6481
|
} }, standalone: false });
|
|
@@ -6355,7 +6488,7 @@ class CheckboxNoFormControlMagicDirective {
|
|
|
6355
6488
|
`,
|
|
6356
6489
|
standalone: false
|
|
6357
6490
|
}]
|
|
6358
|
-
}], () => [
|
|
6491
|
+
}], () => [], { onChange: [{
|
|
6359
6492
|
type: HostListener,
|
|
6360
6493
|
args: ['change', ['$event']]
|
|
6361
6494
|
}] }); })();
|
|
@@ -6364,9 +6497,8 @@ class CheckboxNoFormControlMagicDirective {
|
|
|
6364
6497
|
* Directive for non-checkbox input controls which do not have a form control
|
|
6365
6498
|
*/
|
|
6366
6499
|
class InputNoFormControlMagicDirective {
|
|
6367
|
-
magicDirective;
|
|
6368
|
-
constructor(
|
|
6369
|
-
this.magicDirective = magicDirective;
|
|
6500
|
+
magicDirective = inject(MagicDirective);
|
|
6501
|
+
constructor() {
|
|
6370
6502
|
}
|
|
6371
6503
|
/**
|
|
6372
6504
|
* Handles the 'change' event - pass it to the Magic engine
|
|
@@ -6374,7 +6506,7 @@ class InputNoFormControlMagicDirective {
|
|
|
6374
6506
|
onChange($event) {
|
|
6375
6507
|
this.magicDirective.task.setInputTextValue(this.magicDirective.id, this.magicDirective.rowId, event.srcElement.value);
|
|
6376
6508
|
}
|
|
6377
|
-
/** @nocollapse */ static ɵfac = function InputNoFormControlMagicDirective_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || InputNoFormControlMagicDirective)(
|
|
6509
|
+
/** @nocollapse */ static ɵfac = function InputNoFormControlMagicDirective_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || InputNoFormControlMagicDirective)(); };
|
|
6378
6510
|
/** @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) {
|
|
6379
6511
|
i0.ɵɵlistener("change", function InputNoFormControlMagicDirective_change_HostBindingHandler($event) { return ctx.onChange($event); });
|
|
6380
6512
|
} }, standalone: false });
|
|
@@ -6386,7 +6518,7 @@ class InputNoFormControlMagicDirective {
|
|
|
6386
6518
|
textarea[magic]:([noFormControl]):not([type=checkbox])`,
|
|
6387
6519
|
standalone: false
|
|
6388
6520
|
}]
|
|
6389
|
-
}], () => [
|
|
6521
|
+
}], () => [], { onChange: [{
|
|
6390
6522
|
type: HostListener,
|
|
6391
6523
|
args: ['change', ['$event']]
|
|
6392
6524
|
}] }); })();
|
|
@@ -6405,10 +6537,6 @@ const DATE_VALUE_ACCESSOR = {
|
|
|
6405
6537
|
* `<input type="date" formControlName="birthday" dateInput>`
|
|
6406
6538
|
*/
|
|
6407
6539
|
class DateValueAccessor {
|
|
6408
|
-
renderer;
|
|
6409
|
-
elementRef;
|
|
6410
|
-
magicDir;
|
|
6411
|
-
_task;
|
|
6412
6540
|
onChange = (_) => { };
|
|
6413
6541
|
onTouched = () => { };
|
|
6414
6542
|
onBlurEvent(event) {
|
|
@@ -6416,12 +6544,11 @@ class DateValueAccessor {
|
|
|
6416
6544
|
let control = this._task.getFormControl(this.magicDir.rowId, this.magicDir.id);
|
|
6417
6545
|
this.formatDateWithCentury(event.target.value, century, control);
|
|
6418
6546
|
}
|
|
6419
|
-
|
|
6420
|
-
|
|
6421
|
-
|
|
6422
|
-
|
|
6423
|
-
|
|
6424
|
-
}
|
|
6547
|
+
renderer = inject(Renderer2);
|
|
6548
|
+
elementRef = inject(ElementRef);
|
|
6549
|
+
magicDir = inject(MagicDirective);
|
|
6550
|
+
_task = inject(TaskMagicService);
|
|
6551
|
+
constructor() { }
|
|
6425
6552
|
/** Format year, if user enters 2 digits instead of 4 digits as per the century given in Magic.ini file */
|
|
6426
6553
|
formatDateWithCentury(userInput, century, control) {
|
|
6427
6554
|
const separator = userInput.includes('/') ? '/' : "-";
|
|
@@ -6459,7 +6586,7 @@ class DateValueAccessor {
|
|
|
6459
6586
|
setDisabledState(isDisabled) {
|
|
6460
6587
|
this.renderer.setProperty(this.elementRef.nativeElement, "disabled", isDisabled);
|
|
6461
6588
|
}
|
|
6462
|
-
/** @nocollapse */ static ɵfac = function DateValueAccessor_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || DateValueAccessor)(
|
|
6589
|
+
/** @nocollapse */ static ɵfac = function DateValueAccessor_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || DateValueAccessor)(); };
|
|
6463
6590
|
/** @nocollapse */ static ɵdir = /** @pureOrBreakMyCode */ i0.ɵɵdefineDirective({ type: DateValueAccessor, selectors: [["", "dateInput", ""]], hostBindings: function DateValueAccessor_HostBindings(rf, ctx) { if (rf & 1) {
|
|
6464
6591
|
i0.ɵɵlistener("input", function DateValueAccessor_input_HostBindingHandler($event) { return ctx.onChange($event.target.valueAsDate); })("blur", function DateValueAccessor_blur_HostBindingHandler($event) { return ctx.onBlurEvent($event); });
|
|
6465
6592
|
} }, standalone: false, features: [i0.ɵɵProvidersFeature([DATE_VALUE_ACCESSOR])] });
|
|
@@ -6471,7 +6598,7 @@ class DateValueAccessor {
|
|
|
6471
6598
|
providers: [DATE_VALUE_ACCESSOR],
|
|
6472
6599
|
standalone: false
|
|
6473
6600
|
}]
|
|
6474
|
-
}], () => [
|
|
6601
|
+
}], () => [], { onChange: [{
|
|
6475
6602
|
type: HostListener,
|
|
6476
6603
|
args: ["input", ["$event.target.valueAsDate"]]
|
|
6477
6604
|
}], onTouched: [{
|
|
@@ -6486,10 +6613,6 @@ class DateValueAccessor {
|
|
|
6486
6613
|
* 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
|
|
6487
6614
|
*/
|
|
6488
6615
|
class NonMagicControlDirective {
|
|
6489
|
-
_task;
|
|
6490
|
-
element;
|
|
6491
|
-
renderer;
|
|
6492
|
-
vcRef;
|
|
6493
6616
|
set magic(val) {
|
|
6494
6617
|
this.id = val;
|
|
6495
6618
|
this.selector = 'NonMagicControl';
|
|
@@ -6527,13 +6650,13 @@ class NonMagicControlDirective {
|
|
|
6527
6650
|
* @param renderer Renderer for the element
|
|
6528
6651
|
* @param vcRef
|
|
6529
6652
|
*/
|
|
6530
|
-
constructor(
|
|
6531
|
-
this._task = _task;
|
|
6532
|
-
this.element = element;
|
|
6533
|
-
this.renderer = renderer;
|
|
6534
|
-
this.vcRef = vcRef;
|
|
6653
|
+
constructor() {
|
|
6535
6654
|
this.htmlElement = this.element.nativeElement;
|
|
6536
6655
|
}
|
|
6656
|
+
_task = inject(TaskMagicService);
|
|
6657
|
+
element = inject(ElementRef);
|
|
6658
|
+
renderer = inject(Renderer2);
|
|
6659
|
+
vcRef = inject(ViewContainerRef);
|
|
6537
6660
|
/**
|
|
6538
6661
|
* Get the task service
|
|
6539
6662
|
* @returns
|
|
@@ -6564,7 +6687,7 @@ class NonMagicControlDirective {
|
|
|
6564
6687
|
ngOnInit() {
|
|
6565
6688
|
this.regEvents();
|
|
6566
6689
|
}
|
|
6567
|
-
/** @nocollapse */ static ɵfac = function NonMagicControlDirective_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || NonMagicControlDirective)(
|
|
6690
|
+
/** @nocollapse */ static ɵfac = function NonMagicControlDirective_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || NonMagicControlDirective)(); };
|
|
6568
6691
|
/** @nocollapse */ static ɵdir = /** @pureOrBreakMyCode */ i0.ɵɵdefineDirective({ type: NonMagicControlDirective, selectors: [["", "NonMagicControl", ""]], inputs: { magic: [0, "NonMagicControl", "magic"] }, standalone: false });
|
|
6569
6692
|
}
|
|
6570
6693
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(NonMagicControlDirective, [{
|
|
@@ -6573,15 +6696,14 @@ class NonMagicControlDirective {
|
|
|
6573
6696
|
selector: '[NonMagicControl]',
|
|
6574
6697
|
standalone: false
|
|
6575
6698
|
}]
|
|
6576
|
-
}], () => [
|
|
6699
|
+
}], () => [], { magic: [{
|
|
6577
6700
|
type: Input,
|
|
6578
6701
|
args: ['NonMagicControl']
|
|
6579
6702
|
}] }); })();
|
|
6580
6703
|
|
|
6581
6704
|
class Time24MagicPipe {
|
|
6582
|
-
_task;
|
|
6583
|
-
constructor(
|
|
6584
|
-
this._task = _task;
|
|
6705
|
+
_task = inject(TaskMagicService);
|
|
6706
|
+
constructor() {
|
|
6585
6707
|
}
|
|
6586
6708
|
transform(value, controlId) {
|
|
6587
6709
|
let mask = this._task.GetControlPictureMask(controlId).getMask();
|
|
@@ -6599,7 +6721,7 @@ class Time24MagicPipe {
|
|
|
6599
6721
|
}
|
|
6600
6722
|
return value;
|
|
6601
6723
|
}
|
|
6602
|
-
/** @nocollapse */ static ɵfac = function Time24MagicPipe_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || Time24MagicPipe)(
|
|
6724
|
+
/** @nocollapse */ static ɵfac = function Time24MagicPipe_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || Time24MagicPipe)(); };
|
|
6603
6725
|
/** @nocollapse */ static ɵpipe = /** @pureOrBreakMyCode */ i0.ɵɵdefinePipe({ name: "magicTime24", type: Time24MagicPipe, pure: true, standalone: false });
|
|
6604
6726
|
}
|
|
6605
6727
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(Time24MagicPipe, [{
|
|
@@ -6608,7 +6730,7 @@ class Time24MagicPipe {
|
|
|
6608
6730
|
name: 'magicTime24',
|
|
6609
6731
|
standalone: false
|
|
6610
6732
|
}]
|
|
6611
|
-
}], () => [
|
|
6733
|
+
}], () => [], null); })();
|
|
6612
6734
|
|
|
6613
6735
|
/**
|
|
6614
6736
|
* @ignore
|
|
@@ -6650,27 +6772,28 @@ const decs = [
|
|
|
6650
6772
|
class MagicModule {
|
|
6651
6773
|
/** @nocollapse */ static ɵfac = function MagicModule_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || MagicModule)(); };
|
|
6652
6774
|
/** @nocollapse */ static ɵmod = /** @pureOrBreakMyCode */ i0.ɵɵdefineNgModule({ type: MagicModule });
|
|
6653
|
-
/** @nocollapse */ static ɵinj = /** @pureOrBreakMyCode */ i0.ɵɵdefineInjector({ providers: [ConfirmationComponentsMagicProvider, OverlayContainerMagicProvider, provideHttpClient(withInterceptorsFromDi())], imports: [CommonModule,
|
|
6775
|
+
/** @nocollapse */ static ɵinj = /** @pureOrBreakMyCode */ i0.ɵɵdefineInjector({ providers: [ConfirmationComponentsMagicProvider, OverlayContainerMagicProvider, provideHttpClient(withXhr(), withInterceptorsFromDi())], imports: [CommonModule,
|
|
6654
6776
|
FormsModule,
|
|
6655
6777
|
ReactiveFormsModule,
|
|
6656
6778
|
RouterModule,
|
|
6657
6779
|
DynamicModule,
|
|
6658
|
-
DragDropModule
|
|
6780
|
+
DragDropModule] });
|
|
6659
6781
|
}
|
|
6660
6782
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(MagicModule, [{
|
|
6661
6783
|
type: NgModule,
|
|
6662
6784
|
args: [{
|
|
6663
6785
|
declarations: [...decs],
|
|
6664
|
-
exports: [...decs,
|
|
6786
|
+
exports: [...decs, MaskitoDirective],
|
|
6665
6787
|
imports: [CommonModule,
|
|
6666
6788
|
FormsModule,
|
|
6667
6789
|
ReactiveFormsModule,
|
|
6668
6790
|
RouterModule,
|
|
6669
6791
|
DynamicModule,
|
|
6792
|
+
MaskitoDirective,
|
|
6670
6793
|
CdkDragHandle,
|
|
6671
6794
|
CdkDrag,
|
|
6672
6795
|
DragDropModule],
|
|
6673
|
-
providers: [ConfirmationComponentsMagicProvider, OverlayContainerMagicProvider, provideHttpClient(withInterceptorsFromDi())]
|
|
6796
|
+
providers: [ConfirmationComponentsMagicProvider, OverlayContainerMagicProvider, provideHttpClient(withXhr(), withInterceptorsFromDi())]
|
|
6674
6797
|
}]
|
|
6675
6798
|
}], null, null); })();
|
|
6676
6799
|
(function () { (typeof ngJitMode === "undefined" || ngJitMode) && i0.ɵɵsetNgModuleScope(MagicModule, { declarations: [MagicDirective,
|
|
@@ -6706,6 +6829,7 @@ class MagicModule {
|
|
|
6706
6829
|
ReactiveFormsModule,
|
|
6707
6830
|
RouterModule,
|
|
6708
6831
|
DynamicModule,
|
|
6832
|
+
MaskitoDirective,
|
|
6709
6833
|
CdkDragHandle,
|
|
6710
6834
|
CdkDrag,
|
|
6711
6835
|
DragDropModule], exports: [MagicDirective,
|
|
@@ -6736,7 +6860,7 @@ class MagicModule {
|
|
|
6736
6860
|
NonMagicControlDirective,
|
|
6737
6861
|
MagicFocusDirective,
|
|
6738
6862
|
MagicViewContainerRef,
|
|
6739
|
-
Time24MagicPipe,
|
|
6863
|
+
Time24MagicPipe, MaskitoDirective] }); })();
|
|
6740
6864
|
|
|
6741
6865
|
const MG_FORMATS = {
|
|
6742
6866
|
parse: { dateInput: { month: 'short', year: 'numeric', day: 'numeric' } },
|
|
@@ -6748,14 +6872,12 @@ const MG_FORMATS = {
|
|
|
6748
6872
|
}
|
|
6749
6873
|
};
|
|
6750
6874
|
class MgDateAdapter extends NativeDateAdapter {
|
|
6751
|
-
task;
|
|
6752
|
-
localeId;
|
|
6753
6875
|
mgdtfmt = null;
|
|
6754
|
-
|
|
6755
|
-
|
|
6756
|
-
|
|
6757
|
-
|
|
6758
|
-
this.setLocale(localeId);
|
|
6876
|
+
task = inject(TaskMagicService);
|
|
6877
|
+
localeId = inject(MAT_DATE_LOCALE);
|
|
6878
|
+
constructor() {
|
|
6879
|
+
super();
|
|
6880
|
+
this.setLocale(this.localeId);
|
|
6759
6881
|
}
|
|
6760
6882
|
parse(value) {
|
|
6761
6883
|
let valueStr = value;
|
|
@@ -6830,15 +6952,12 @@ class MgDateAdapter extends NativeDateAdapter {
|
|
|
6830
6952
|
return date.toDateString();
|
|
6831
6953
|
}
|
|
6832
6954
|
}
|
|
6833
|
-
/** @nocollapse */ static ɵfac = function MgDateAdapter_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || MgDateAdapter)(
|
|
6955
|
+
/** @nocollapse */ static ɵfac = function MgDateAdapter_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || MgDateAdapter)(); };
|
|
6834
6956
|
/** @nocollapse */ static ɵprov = /** @pureOrBreakMyCode */ i0.ɵɵdefineInjectable({ token: MgDateAdapter, factory: MgDateAdapter.ɵfac });
|
|
6835
6957
|
}
|
|
6836
6958
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(MgDateAdapter, [{
|
|
6837
6959
|
type: Injectable
|
|
6838
|
-
}], () => [
|
|
6839
|
-
type: Inject,
|
|
6840
|
-
args: [MAT_DATE_LOCALE]
|
|
6841
|
-
}] }], null); })();
|
|
6960
|
+
}], () => [], null); })();
|
|
6842
6961
|
|
|
6843
6962
|
const matDateProviders = [
|
|
6844
6963
|
{ provide: DateAdapter, useClass: MgDateAdapter },
|
|
@@ -6860,6 +6979,109 @@ const magicProviders = [
|
|
|
6860
6979
|
TableMagicService
|
|
6861
6980
|
];
|
|
6862
6981
|
|
|
6982
|
+
class SubscriberService {
|
|
6983
|
+
static instance;
|
|
6984
|
+
socket;
|
|
6985
|
+
constructor() {
|
|
6986
|
+
// Connect to the Socket.IO server with subscriber role
|
|
6987
|
+
this.socket = io('http://localhost:3000', {
|
|
6988
|
+
query: {
|
|
6989
|
+
role: 'subscriber',
|
|
6990
|
+
token: 'abc123' // Default token for testing; replace with actual authentication
|
|
6991
|
+
}
|
|
6992
|
+
});
|
|
6993
|
+
// Handle connection
|
|
6994
|
+
this.socket.on('connect', () => {
|
|
6995
|
+
console.log('Connected to server as subscriber:', this.socket.id);
|
|
6996
|
+
});
|
|
6997
|
+
// Handle disconnection
|
|
6998
|
+
this.socket.on('disconnect', () => {
|
|
6999
|
+
console.log('Disconnected from server');
|
|
7000
|
+
});
|
|
7001
|
+
// Handle subscription confirmation
|
|
7002
|
+
this.socket.on('subscribed', (data) => {
|
|
7003
|
+
console.log('Subscribed to topic:', data.topic, data.message);
|
|
7004
|
+
});
|
|
7005
|
+
// Handle unsubscription confirmation
|
|
7006
|
+
this.socket.on('unsubscribed', (data) => {
|
|
7007
|
+
console.log('Unsubscribed from topic:', data.topic, data.message);
|
|
7008
|
+
});
|
|
7009
|
+
// Handle errors
|
|
7010
|
+
this.socket.on('error', (error) => {
|
|
7011
|
+
console.error('Socket error:', error.message);
|
|
7012
|
+
});
|
|
7013
|
+
this.socket.on('message', (error) => {
|
|
7014
|
+
console.error('Message from xpa:', error.message);
|
|
7015
|
+
});
|
|
7016
|
+
}
|
|
7017
|
+
/**
|
|
7018
|
+
* Subscribe to a specific topic
|
|
7019
|
+
* @param topic The topic to subscribe to
|
|
7020
|
+
*/
|
|
7021
|
+
subscribe(topic) {
|
|
7022
|
+
this.socket.emit('subscribe', topic);
|
|
7023
|
+
}
|
|
7024
|
+
/**
|
|
7025
|
+
* Unsubscribe from a specific topic
|
|
7026
|
+
* @param topic The topic to unsubscribe from
|
|
7027
|
+
*/
|
|
7028
|
+
unsubscribe(topic) {
|
|
7029
|
+
this.socket.emit('unsubscribe', topic);
|
|
7030
|
+
}
|
|
7031
|
+
/**
|
|
7032
|
+
* Get an Observable for incoming messages
|
|
7033
|
+
* @returns Observable that emits message data
|
|
7034
|
+
*/
|
|
7035
|
+
onMessage() {
|
|
7036
|
+
return new Observable(observer => {
|
|
7037
|
+
this.socket.on('message', (data) => {
|
|
7038
|
+
observer.next(data);
|
|
7039
|
+
});
|
|
7040
|
+
});
|
|
7041
|
+
}
|
|
7042
|
+
/**
|
|
7043
|
+
* Get current subscriptions (for debugging)
|
|
7044
|
+
*/
|
|
7045
|
+
getSubscriptions() {
|
|
7046
|
+
this.socket.emit('getSubscriptions');
|
|
7047
|
+
}
|
|
7048
|
+
/**
|
|
7049
|
+
* Listen for subscriptions data
|
|
7050
|
+
* @returns Observable that emits subscriptions list
|
|
7051
|
+
*/
|
|
7052
|
+
onSubscriptionsData() {
|
|
7053
|
+
return new Observable(observer => {
|
|
7054
|
+
this.socket.on('subscriptionsData', (data) => {
|
|
7055
|
+
observer.next(data);
|
|
7056
|
+
});
|
|
7057
|
+
});
|
|
7058
|
+
}
|
|
7059
|
+
/**
|
|
7060
|
+
* Get the singleton instance of SubscriberService
|
|
7061
|
+
* @returns {SubscriberService} The singleton instance
|
|
7062
|
+
*/
|
|
7063
|
+
static getInstance() {
|
|
7064
|
+
if (!SubscriberService.instance) {
|
|
7065
|
+
SubscriberService.instance = new SubscriberService();
|
|
7066
|
+
}
|
|
7067
|
+
return SubscriberService.instance;
|
|
7068
|
+
}
|
|
7069
|
+
/**
|
|
7070
|
+
* Disconnect from the server
|
|
7071
|
+
*/
|
|
7072
|
+
disconnect() {
|
|
7073
|
+
this.socket.disconnect();
|
|
7074
|
+
}
|
|
7075
|
+
/** @nocollapse */ static ɵfac = function SubscriberService_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || SubscriberService)(); };
|
|
7076
|
+
/** @nocollapse */ static ɵprov = /** @pureOrBreakMyCode */ i0.ɵɵdefineInjectable({ token: SubscriberService, factory: SubscriberService.ɵfac, providedIn: 'root' });
|
|
7077
|
+
}
|
|
7078
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(SubscriberService, [{
|
|
7079
|
+
type: Injectable,
|
|
7080
|
+
args: [{
|
|
7081
|
+
providedIn: 'root'
|
|
7082
|
+
}]
|
|
7083
|
+
}], () => [], null); })();
|
|
7084
|
+
|
|
6863
7085
|
/**
|
|
6864
7086
|
* @ignore
|
|
6865
7087
|
*/
|
|
@@ -6945,5 +7167,5 @@ class ModalFormDefinition {
|
|
|
6945
7167
|
* Generated bundle index. Do not edit.
|
|
6946
7168
|
*/
|
|
6947
7169
|
|
|
6948
|
-
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 };
|
|
7170
|
+
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 };
|
|
6949
7171
|
//# sourceMappingURL=magic-xpa-angular.mjs.map
|